Built motion from commit (unavailable).|2.5.4
authorCris Di Sclafani <cris.disclafani@gmail.com>
Sat, 31 Oct 2020 09:43:49 +0000 (10:43 +0100)
committerCris Di Sclafani <cris.disclafani@gmail.com>
Sat, 31 Oct 2020 09:43:49 +0000 (10:43 +0100)
1160 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/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.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/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.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/cmContactHasPhone/cmContactHasPhone.attributes.js
server/api/cmContactHasPhone/cmContactHasPhone.controller.js
server/api/cmContactHasPhone/cmContactHasPhone.model.js
server/api/cmContactHasPhone/cmContactHasPhone.rpc.js
server/api/cmContactHasPhone/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.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/notification/index.js
server/api/notification/notification.attributes.js
server/api/notification/notification.controller.js
server/api/notification/notification.events.js
server/api/notification/notification.model.js
server/api/notification/notification.rpc.js
server/api/notification/notification.socket.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/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/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/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/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/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/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/license/service.js
server/components/parsers/advancedSearch.js
server/components/parsers/qs.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/index.js
server/config/schedule/transcribe.js
server/config/seedContact.js
server/config/seedUsers.js
server/config/socketio.js
server/config/triggers/index.js
server/config/utils.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/graph/index.js
server/services/agi/index.js
server/services/agi/mailRpc/index.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/action.js
server/services/ami/dialer/additionalPhone.js
server/services/ami/dialer/agentComplete.js
server/services/ami/dialer/final.js
server/services/ami/dialer/hangup.js
server/services/ami/dialer/history.js
server/services/ami/dialer/index.js
server/services/ami/dialer/queueCallerAbandon.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/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/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/memberReport.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/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/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/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

index 356d1e4..4efec6c 100644 (file)
@@ -1 +1 @@
-define({\r  "name": "xCALLY Motion API",\r  "version": "2.5.4",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre class=\"prettyprint lang-sh\">GET /api/users\n</pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre class=\"prettyprint lang-sh\">https://motion.xcally.com/api/users\n</pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre class=\"prettyprint lang-sh\">GET  /api/users/{id}\n</pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n</pre>\n<h3>API Key</h3>\n<p>In your request, specify the API Key in apikey query parameter</p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n</pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2020-10-30T18:32:11.850Z",\r    "url": "http://apidocjs.com",\r    "version": "0.19.0"\r  }\r});
+define({\r  "name": "xCALLY Motion API",\r  "version": "2.5.4",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre class=\"prettyprint lang-sh\">GET /api/users\n</pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre class=\"prettyprint lang-sh\">https://motion.xcally.com/api/users\n</pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre class=\"prettyprint lang-sh\">GET  /api/users/{id}\n</pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n</pre>\n<h3>API Key</h3>\n<p>In your request, specify the API Key in apikey query parameter</p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n</pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2020-10-31T09:36:07.100Z",\r    "url": "http://apidocjs.com",\r    "version": "0.19.0"\r  }\r});
index fdfeca3..fb76059 100644 (file)
@@ -1 +1 @@
-{\r  "name": "xCALLY Motion API",\r  "version": "2.5.4",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre class=\"prettyprint lang-sh\">GET /api/users\n</pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre class=\"prettyprint lang-sh\">https://motion.xcally.com/api/users\n</pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre class=\"prettyprint lang-sh\">GET  /api/users/{id}\n</pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n</pre>\n<h3>API Key</h3>\n<p>In your request, specify the API Key in apikey query parameter</p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n</pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2020-10-30T18:32:11.850Z",\r    "url": "http://apidocjs.com",\r    "version": "0.19.0"\r  }\r}
+{\r  "name": "xCALLY Motion API",\r  "version": "2.5.4",\r  "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",\r  "title": "xCALLY MOTION API",\r  "header": {\r    "title": "Introduction",\r    "content": "<h2>The API</h2>\n<p>This is the documentation for the xCALLY MOTION API.</p>\n<p>We make changes to the APIs from time to time. For more information, see <a href=\"https://wiki.xcallymotion.com/display/XMV/Motion+GUI\">Changelog</a>.</p>\n<p>The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.</p>\n<p>The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].</p>\n<p>Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:</p>\n<pre class=\"prettyprint lang-sh\">GET /api/users\n</pre>\n<p>Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:</p>\n<pre class=\"prettyprint lang-sh\">https://motion.xcally.com/api/users\n</pre>\n<p>Curly braces, <code>{}</code>, indicate values you have to supply. Example:</p>\n<pre class=\"prettyprint lang-sh\">GET  /api/users/{id}\n</pre>\n<p>The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].</p>\n<p>The examples use basic authentication requiring a xCALLY username and password.</p>\n<h2>Security and Authentication</h2>\n<p>This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.</p>\n<p>Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.</p>\n<h3>Basic authentication</h3>\n<p>Use the following authentication format with your username and password:\n<code>{username}:{password}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -u admin:password https://motion.xcally.com/api/users\n</pre>\n<h3>OAuth access token</h3>\n<p>The xCALLY API supports OAuth authorization flows.</p>\n<p>OAuth access tokens also permit client-side API requests.</p>\n<p>In your requests, specify the access token in an Authorization header as follows:\n<code>Authorization: Bearer {token}</code></p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n</pre>\n<h3>API Key</h3>\n<p>In your request, specify the API Key in apikey query parameter</p>\n<p>Example:</p>\n<pre class=\"prettyprint lang-sh\">curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n</pre>\n<h2>Request Format</h2>\n<p>The xCALLY API is a JSON API. You must supply a <code>Content-Type: application/json</code> header in <code>PUT</code> and <code>POST</code> requests. You must set an <code>Accept: application/json</code> header on all requests. You may get a <code>text/plain</code> response in case of an error like a bad request. You should treat this as an error you need to fix.</p>\n<h2>Response Format</h2>\n<p>The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.</p>\n<p>Responses may have the status codes described in the following sections.</p>\n<h3>200 range</h3>\n<p>The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.</p>\n<h3>400 range</h3>\n<p>The request was not successful. The content type of the response may be <code>text/plain</code> for API-level error messages, such as when trying to call the API without SSL. The content type is <code>application/json</code> for business-level error messages because the response includes a JSON object with information about the error.</p>\n<p>If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.</p>\n<h3>500 range</h3>\n<p>When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.</p>\n<p>If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.</p>\n<h2>Data Types</h2>\n<p>The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.</p>\n<h2>ID integers</h2>\n<p>Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.</p>\n<p>The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.</p>\n<h2>Time stamps</h2>\n<p>Time stamps use UTC time and are formatted as ISO 8601 strings. Example: <code>2017-04-16T09:14:57Z</code></p>\n"\r  },\r  "template": {\r    "withGenerator": false,\r    "withCompare": false,\r    "forceLanguage": "en"\r  },\r  "sampleUrl": false,\r  "defaultVersion": "0.0.0",\r  "apidoc": "0.3.0",\r  "generator": {\r    "name": "apidoc",\r    "time": "2020-10-31T09:36:07.100Z",\r    "url": "http://apidocjs.com",\r    "version": "0.19.0"\r  }\r}
index 3d6b0e9..df829b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa422=['TEXT','sequelize','exports','getDataValue','action','STRING','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xa422,0x121));var _0x2a42=function(_0x155f10,_0x21d9e7){_0x155f10=_0x155f10-0x0;var _0x478e14=_0xa422[_0x155f10];return _0x478e14;};'use strict';var Sequelize=require(_0x2a42('0x0'));module[_0x2a42('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x31b477){return this[_0x2a42('0x2')](_0x2a42('0x3'));}},'action':{'type':Sequelize[_0x2a42('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x2a42('0x5'),_0x2a42('0x6'),'jscripty',_0x2a42('0x7'),_0x2a42('0x8'),_0x2a42('0x9'),_0x2a42('0xa')]],'msg':_0x2a42('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x2a42('0x4')](0x1000),'comment':_0x2a42('0xc')},'data2':{'type':Sequelize[_0x2a42('0x4')](0x1000),'comment':_0x2a42('0xd')},'data3':{'type':Sequelize[_0x2a42('0x4')](0x1000),'comment':_0x2a42('0xe')},'data4':{'type':Sequelize[_0x2a42('0x4')](0x1000)},'data5':{'type':Sequelize[_0x2a42('0x4')](0x1000)},'data6':{'type':Sequelize[_0x2a42('0x4')]},'data7':{'type':Sequelize[_0x2a42('0xf')]}};
\ No newline at end of file
+var _0x30a5=['motionbar','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','sequelize','getDataValue','action','contactManager'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x30a5,0xc2));var _0x530a=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0x30a5[_0x4cd21c];return _0x5d8e5e;};'use strict';var Sequelize=require(_0x530a('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x55f4a7){return this[_0x530a('0x1')](_0x530a('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x530a('0x3'),'integration',_0x530a('0x4'),'jscripty',_0x530a('0x5'),'browser',_0x530a('0x6'),_0x530a('0x7')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x530a('0x8')},'data1':{'type':Sequelize[_0x530a('0x9')](0x1000),'comment':_0x530a('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0x530a('0x9')](0x1000)},'data5':{'type':Sequelize[_0x530a('0x9')](0x1000)},'data6':{'type':Sequelize[_0x530a('0x9')]},'data7':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 277370a..28607c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dff=['to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','json','save','update','then','destroy','error','stack','name','send','Action','params','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x184eb8,_0xda3739){var _0x151d24=function(_0x19fcea){while(--_0x19fcea){_0x184eb8['push'](_0x184eb8['shift']());}};_0x151d24(++_0xda3739);}(_0x1dff,0xfe));var _0xf1df=function(_0x3844ab,_0x461e40){_0x3844ab=_0x3844ab-0x0;var _0x2a3276=_0x1dff[_0x3844ab];return _0x2a3276;};'use strict';var pdf=require(_0xf1df('0x0'));var emlformat=require(_0xf1df('0x1'));var rimraf=require(_0xf1df('0x2'));var zipdir=require(_0xf1df('0x3'));var jsonpatch=require(_0xf1df('0x4'));var rp=require(_0xf1df('0x5'));var moment=require(_0xf1df('0x6'));var BPromise=require(_0xf1df('0x7'));var Mustache=require(_0xf1df('0x8'));var util=require('util');var path=require(_0xf1df('0x9'));var sox=require('sox');var csv=require(_0xf1df('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf1df('0xb'));var crypto=require(_0xf1df('0xc'));var jsforce=require(_0xf1df('0xd'));var deskjs=require(_0xf1df('0xe'));var toCsv=require(_0xf1df('0xa'));var querystring=require(_0xf1df('0xf'));var Papa=require(_0xf1df('0x10'));var Redis=require('ioredis');var authService=require(_0xf1df('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf1df('0x12'));var hardwareService=require(_0xf1df('0x13'));var logger=require(_0xf1df('0x14'))(_0xf1df('0x15'));var utils=require(_0xf1df('0x16'));var config=require(_0xf1df('0x17'));var db=require(_0xf1df('0x18'))['db'];function respondWithStatusCode(_0x3a2bd7,_0x1bbe49){_0x1bbe49=_0x1bbe49||0xcc;return function(_0x44457a){if(_0x44457a){return _0x3a2bd7[_0xf1df('0x19')](_0x1bbe49);}return _0x3a2bd7[_0xf1df('0x1a')](_0x1bbe49)[_0xf1df('0x1b')]();};}function respondWithResult(_0x407d4c,_0x16172e){_0x16172e=_0x16172e||0xc8;return function(_0x2750cd){if(_0x2750cd){return _0x407d4c[_0xf1df('0x1a')](_0x16172e)['json'](_0x2750cd);}};}function respondWithFilteredResult(_0x142ed5,_0x36d7ff){return function(_0x44847a){if(_0x44847a){var _0xedd0d0=_0x44847a['count'],_0x2c9b9b=_0x36d7ff[_0xf1df('0x1c')],_0x2d3778=_0x36d7ff['offset']+_0x36d7ff[_0xf1df('0x1d')],_0x30119e;if(_0x2d3778>=_0xedd0d0){_0x2d3778=_0xedd0d0;_0x30119e=0xc8;}else{_0x30119e=0xce;}_0x142ed5[_0xf1df('0x1a')](_0x30119e);return _0x142ed5[_0xf1df('0x1e')]('Content-Range',_0x2c9b9b+'-'+_0x2d3778+'/'+_0xedd0d0)[_0xf1df('0x1f')](_0x44847a);}return null;};}function patchUpdates(_0x3c26c5){return function(_0x4235c4){try{jsonpatch['apply'](_0x4235c4,_0x3c26c5,!![]);}catch(_0x40761f){return BPromise['reject'](_0x40761f);}return _0x4235c4[_0xf1df('0x20')]();};}function saveUpdates(_0x1de658,_0x2f68fc){return function(_0x2395dc){if(_0x2395dc){return _0x2395dc[_0xf1df('0x21')](_0x1de658)[_0xf1df('0x22')](function(_0x20c843){return _0x20c843;});}return null;};}function removeEntity(_0x132d30,_0x13984f){return function(_0x10dffd){if(_0x10dffd){return _0x10dffd[_0xf1df('0x23')]()[_0xf1df('0x22')](function(){_0x132d30[_0xf1df('0x1a')](0xcc)[_0xf1df('0x1b')]();});}};}function handleEntityNotFound(_0x2769a2,_0x4ceb9f){return function(_0x331077){if(!_0x331077){_0x2769a2[_0xf1df('0x19')](0x194);}return _0x331077;};}function handleError(_0xbe021d,_0xac6e05){_0xac6e05=_0xac6e05||0x1f4;return function(_0x11bef0){logger[_0xf1df('0x24')](_0x11bef0[_0xf1df('0x25')]);if(_0x11bef0[_0xf1df('0x26')]){delete _0x11bef0['name'];}_0xbe021d[_0xf1df('0x1a')](_0xac6e05)[_0xf1df('0x27')](_0x11bef0);};}exports[_0xf1df('0x21')]=function(_0x5c4c9f,_0x5f45d0){if(_0x5c4c9f['body']['id']){delete _0x5c4c9f['body']['id'];}return db[_0xf1df('0x28')]['find']({'where':{'id':_0x5c4c9f[_0xf1df('0x29')]['id']}})['then'](handleEntityNotFound(_0x5f45d0,null))[_0xf1df('0x22')](saveUpdates(_0x5c4c9f[_0xf1df('0x2a')],null))[_0xf1df('0x22')](respondWithResult(_0x5f45d0,null))['catch'](handleError(_0x5f45d0,null));};exports[_0xf1df('0x23')]=function(_0xb12b3b,_0x462dbe){return db[_0xf1df('0x28')][_0xf1df('0x2b')]({'where':{'id':_0xb12b3b[_0xf1df('0x29')]['id']}})[_0xf1df('0x22')](handleEntityNotFound(_0x462dbe,null))['then'](removeEntity(_0x462dbe,null))['catch'](handleError(_0x462dbe,null));};
\ No newline at end of file
+var _0x1ff0=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body','Action','find','params','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service'];(function(_0x2614b4,_0x4cad13){var _0x3180bc=function(_0x37fed0){while(--_0x37fed0){_0x2614b4['push'](_0x2614b4['shift']());}};_0x3180bc(++_0x4cad13);}(_0x1ff0,0xe6));var _0x01ff=function(_0x49809e,_0x216d55){_0x49809e=_0x49809e-0x0;var _0x4996f9=_0x1ff0[_0x49809e];return _0x4996f9;};'use strict';var pdf=require(_0x01ff('0x0'));var emlformat=require(_0x01ff('0x1'));var rimraf=require(_0x01ff('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01ff('0x3'));var rp=require(_0x01ff('0x4'));var moment=require(_0x01ff('0x5'));var BPromise=require(_0x01ff('0x6'));var Mustache=require(_0x01ff('0x7'));var util=require(_0x01ff('0x8'));var path=require('path');var sox=require(_0x01ff('0x9'));var csv=require('to-csv');var ejs=require(_0x01ff('0xa'));var fs=require('fs');var _=require(_0x01ff('0xb'));var squel=require(_0x01ff('0xc'));var crypto=require(_0x01ff('0xd'));var jsforce=require(_0x01ff('0xe'));var deskjs=require(_0x01ff('0xf'));var toCsv=require(_0x01ff('0x10'));var querystring=require(_0x01ff('0x11'));var Papa=require('papaparse');var Redis=require(_0x01ff('0x12'));var authService=require(_0x01ff('0x13'));var qs=require(_0x01ff('0x14'));var as=require(_0x01ff('0x15'));var hardwareService=require(_0x01ff('0x16'));var logger=require(_0x01ff('0x17'))(_0x01ff('0x18'));var utils=require(_0x01ff('0x19'));var config=require(_0x01ff('0x1a'));var db=require(_0x01ff('0x1b'))['db'];function respondWithStatusCode(_0x5eabfa,_0xed59e2){_0xed59e2=_0xed59e2||0xcc;return function(_0x3e6809){if(_0x3e6809){return _0x5eabfa[_0x01ff('0x1c')](_0xed59e2);}return _0x5eabfa[_0x01ff('0x1d')](_0xed59e2)[_0x01ff('0x1e')]();};}function respondWithResult(_0x214289,_0x38729c){_0x38729c=_0x38729c||0xc8;return function(_0x361dd4){if(_0x361dd4){return _0x214289[_0x01ff('0x1d')](_0x38729c)[_0x01ff('0x1f')](_0x361dd4);}};}function respondWithFilteredResult(_0x25f6b4,_0x5a31e4){return function(_0x49c9be){if(_0x49c9be){var _0x3b26ad=_0x49c9be[_0x01ff('0x20')],_0x5990a0=_0x5a31e4['offset'],_0x571417=_0x5a31e4[_0x01ff('0x21')]+_0x5a31e4['limit'],_0x5965d7;if(_0x571417>=_0x3b26ad){_0x571417=_0x3b26ad;_0x5965d7=0xc8;}else{_0x5965d7=0xce;}_0x25f6b4[_0x01ff('0x1d')](_0x5965d7);return _0x25f6b4[_0x01ff('0x22')](_0x01ff('0x23'),_0x5990a0+'-'+_0x571417+'/'+_0x3b26ad)[_0x01ff('0x1f')](_0x49c9be);}return null;};}function patchUpdates(_0x4e56d1){return function(_0x41d8be){try{jsonpatch[_0x01ff('0x24')](_0x41d8be,_0x4e56d1,!![]);}catch(_0x2a5555){return BPromise[_0x01ff('0x25')](_0x2a5555);}return _0x41d8be[_0x01ff('0x26')]();};}function saveUpdates(_0xd7dcb5,_0x408544){return function(_0xef4b88){if(_0xef4b88){return _0xef4b88[_0x01ff('0x27')](_0xd7dcb5)[_0x01ff('0x28')](function(_0x184e3a){return _0x184e3a;});}return null;};}function removeEntity(_0x44ae92,_0x474759){return function(_0x37a0ab){if(_0x37a0ab){return _0x37a0ab[_0x01ff('0x29')]()[_0x01ff('0x28')](function(){_0x44ae92[_0x01ff('0x1d')](0xcc)[_0x01ff('0x1e')]();});}};}function handleEntityNotFound(_0x22f678,_0xde580a){return function(_0x2689c3){if(!_0x2689c3){_0x22f678[_0x01ff('0x1c')](0x194);}return _0x2689c3;};}function handleError(_0x48c11f,_0x257e45){_0x257e45=_0x257e45||0x1f4;return function(_0x521cbf){logger['error'](_0x521cbf[_0x01ff('0x2a')]);if(_0x521cbf['name']){delete _0x521cbf[_0x01ff('0x2b')];}_0x48c11f[_0x01ff('0x1d')](_0x257e45)[_0x01ff('0x2c')](_0x521cbf);};}exports['update']=function(_0xb883e5,_0x62a1bd){if(_0xb883e5['body']['id']){delete _0xb883e5[_0x01ff('0x2d')]['id'];}return db[_0x01ff('0x2e')][_0x01ff('0x2f')]({'where':{'id':_0xb883e5[_0x01ff('0x30')]['id']}})[_0x01ff('0x28')](handleEntityNotFound(_0x62a1bd,null))[_0x01ff('0x28')](saveUpdates(_0xb883e5[_0x01ff('0x2d')],null))['then'](respondWithResult(_0x62a1bd,null))[_0x01ff('0x31')](handleError(_0x62a1bd,null));};exports[_0x01ff('0x29')]=function(_0x282695,_0x5bcfa6){return db['Action'][_0x01ff('0x2f')]({'where':{'id':_0x282695[_0x01ff('0x30')]['id']}})[_0x01ff('0x28')](handleEntityNotFound(_0x5bcfa6,null))[_0x01ff('0x28')](removeEntity(_0x5bcfa6,null))[_0x01ff('0x31')](handleError(_0x5bcfa6,null));};
\ No newline at end of file
index 52386c9..bd21614 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4423=['./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5745d2,_0x536b58){var _0xd6df54=function(_0xfc4bad){while(--_0xfc4bad){_0x5745d2['push'](_0x5745d2['shift']());}};_0xd6df54(++_0x536b58);}(_0x4423,0x1ef));var _0x3442=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x4423[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x3442('0x0'));var util=require(_0x3442('0x1'));var logger=require(_0x3442('0x2'))(_0x3442('0x3'));var moment=require(_0x3442('0x4'));var BPromise=require(_0x3442('0x5'));var rp=require(_0x3442('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3442('0x7'));var config=require(_0x3442('0x8'));var attributes=require(_0x3442('0x9'));module[_0x3442('0xa')]=function(_0x196ef3,_0x16701e){return _0x196ef3[_0x3442('0xb')](_0x3442('0xc'),attributes,{'tableName':_0x3442('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d08=['Action','tools_actions','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports','define'];(function(_0x579521,_0xc8efc){var _0x4a934d=function(_0x37c4fa){while(--_0x37c4fa){_0x579521['push'](_0x579521['shift']());}};_0x4a934d(++_0xc8efc);}(_0x5d08,0x157));var _0x85d0=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5d08[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x85d0('0x0'));var util=require(_0x85d0('0x1'));var logger=require(_0x85d0('0x2'))(_0x85d0('0x3'));var moment=require('moment');var BPromise=require(_0x85d0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x85d0('0x5'));var rimraf=require('rimraf');var config=require(_0x85d0('0x6'));var attributes=require('./action.attributes');module[_0x85d0('0x7')]=function(_0x9fe4e,_0xa991dd){return _0x9fe4e[_0x85d0('0x8')](_0x85d0('0x9'),attributes,{'tableName':_0x85d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 424161b..d829b16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0x3981e5,_0x248851){var _0x39694d=function(_0x1c4c66){while(--_0x1c4c66){_0x3981e5['push'](_0x3981e5['shift']());}};_0x39694d(++_0x248851);}(_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')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('Action,\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')]('Action,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
+var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x4498a2,_0x143689){var _0x411aa8=function(_0x1a85dc){while(--_0x1a85dc){_0x4498a2['push'](_0x4498a2['shift']());}};_0x411aa8(++_0x143689);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}
\ No newline at end of file
index fc44d7c..5e34088 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bba=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','destroy'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x3bba,0x7f));var _0xa3bb=function(_0x158dbf,_0x1fa775){_0x158dbf=_0x158dbf-0x0;var _0x766087=_0x3bba[_0x158dbf];return _0x766087;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa3bb('0x0'));var timeout=require(_0xa3bb('0x1'));var express=require(_0xa3bb('0x2'));var router=express[_0xa3bb('0x3')]();var auth=require(_0xa3bb('0x4'));var interaction=require(_0xa3bb('0x5'));var config=require(_0xa3bb('0x6'));var controller=require(_0xa3bb('0x7'));router[_0xa3bb('0x8')]('/:id',auth[_0xa3bb('0x9')](),controller[_0xa3bb('0xa')]);router[_0xa3bb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xa3bb('0xc')]);module[_0xa3bb('0xd')]=router;
\ No newline at end of file
+var _0x7625=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./action.controller','isAuthenticated','delete'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x7625,0x73));var _0x5762=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7625[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5762('0x0'));var util=require(_0x5762('0x1'));var path=require(_0x5762('0x2'));var timeout=require(_0x5762('0x3'));var express=require(_0x5762('0x4'));var router=express[_0x5762('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5762('0x6'));var config=require(_0x5762('0x7'));var controller=require(_0x5762('0x8'));router['put']('/:id',auth[_0x5762('0x9')](),controller['update']);router[_0x5762('0xa')](_0x5762('0xb'),auth[_0x5762('0x9')](),controller[_0x5762('0xc')]);module[_0x5762('0xd')]=router;
\ No newline at end of file
index 92784b5..ce728b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d0a=['sequelize','exports','STRING','TEXT'];(function(_0x168478,_0x323a27){var _0x29c2f8=function(_0x4f7a8a){while(--_0x4f7a8a){_0x168478['push'](_0x168478['shift']());}};_0x29c2f8(++_0x323a27);}(_0x9d0a,0x74));var _0xa9d0=function(_0x151418,_0x2cbffa){_0x151418=_0x151418-0x0;var _0x40e29a=_0x9d0a[_0x151418];return _0x40e29a;};'use strict';var Sequelize=require(_0xa9d0('0x0'));module[_0xa9d0('0x1')]={'name':{'type':Sequelize[_0xa9d0('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa9d0('0x2')]},'parent':{'type':Sequelize[_0xa9d0('0x2')]},'table':{'type':Sequelize[_0xa9d0('0x2')]},'conditions':{'type':Sequelize[_0xa9d0('0x3')]},'joins':{'type':Sequelize[_0xa9d0('0x3')]}};
\ No newline at end of file
+var _0x75b7=['TEXT','sequelize','exports','STRING'];(function(_0x2b040c,_0x4a2b5d){var _0x36532b=function(_0x1bff30){while(--_0x1bff30){_0x2b040c['push'](_0x2b040c['shift']());}};_0x36532b(++_0x4a2b5d);}(_0x75b7,0x81));var _0x775b=function(_0x5505e1,_0x4fcdce){_0x5505e1=_0x5505e1-0x0;var _0x326316=_0x75b7[_0x5505e1];return _0x326316;};'use strict';var Sequelize=require(_0x775b('0x0'));module[_0x775b('0x1')]={'name':{'type':Sequelize[_0x775b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x775b('0x2')]},'parent':{'type':Sequelize[_0x775b('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x775b('0x3')]}};
\ No newline at end of file
index 6f513be..8565cb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ccb=['end','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','AnalyticCustomReport','includeAll','include','findAll','catch','show','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','UNIX_TIMESTAMP(%s)','operator','Sequelize','keyBy','from','alias','No\x20available\x20data','web','fullPath','%s-%s.%s','randomstring','generate','output','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','params','getFields','ValidationErrorItem','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource'];(function(_0x4629ed,_0x59ef85){var _0x52ca04=function(_0x59dc63){while(--_0x59dc63){_0x4629ed['push'](_0x4629ed['shift']());}};_0x52ca04(++_0x59ef85);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0x8ccb[_0xa28b1a];return _0x4c9b78;};'use strict';var pdf=require(_0xb8cc('0x0'));var emlformat=require(_0xb8cc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb8cc('0x2'));var jsonpatch=require(_0xb8cc('0x3'));var rp=require(_0xb8cc('0x4'));var moment=require(_0xb8cc('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb8cc('0x6'));var path=require(_0xb8cc('0x7'));var sox=require(_0xb8cc('0x8'));var csv=require('to-csv');var ejs=require(_0xb8cc('0x9'));var fs=require('fs');var _=require(_0xb8cc('0xa'));var squel=require(_0xb8cc('0xb'));var crypto=require('crypto');var jsforce=require(_0xb8cc('0xc'));var deskjs=require(_0xb8cc('0xd'));var toCsv=require(_0xb8cc('0xe'));var querystring=require('querystring');var Papa=require(_0xb8cc('0xf'));var Redis=require(_0xb8cc('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb8cc('0x11'));var hardwareService=require(_0xb8cc('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xb8cc('0x13'));var config=require(_0xb8cc('0x14'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb8cc('0x15'))[_0xb8cc('0x16')];function respondWithStatusCode(_0xfd89e0,_0x2875e0){_0x2875e0=_0x2875e0||0xcc;return function(_0x4157db){if(_0x4157db){return _0xfd89e0[_0xb8cc('0x17')](_0x2875e0);}return _0xfd89e0[_0xb8cc('0x18')](_0x2875e0)['end']();};}function respondWithResult(_0x11ecf2,_0x5ec8a7){_0x5ec8a7=_0x5ec8a7||0xc8;return function(_0x2f876e){if(_0x2f876e){return _0x11ecf2[_0xb8cc('0x18')](_0x5ec8a7)[_0xb8cc('0x19')](_0x2f876e);}};}function respondWithFilteredResult(_0x5f3b91,_0x1f8b8d){return function(_0x274cab){if(_0x274cab){var _0x4663d4=_0x274cab[_0xb8cc('0x1a')],_0x4bc6dd=_0x1f8b8d['offset'],_0x2ba498=_0x1f8b8d[_0xb8cc('0x1b')]+_0x1f8b8d[_0xb8cc('0x1c')],_0x50185a;if(_0x2ba498>=_0x4663d4){_0x2ba498=_0x4663d4;_0x50185a=0xc8;}else{_0x50185a=0xce;}_0x5f3b91[_0xb8cc('0x18')](_0x50185a);return _0x5f3b91[_0xb8cc('0x1d')](_0xb8cc('0x1e'),_0x4bc6dd+'-'+_0x2ba498+'/'+_0x4663d4)['json'](_0x274cab);}return null;};}function patchUpdates(_0x1c1022){return function(_0x1e9769){try{jsonpatch[_0xb8cc('0x1f')](_0x1e9769,_0x1c1022,!![]);}catch(_0x500120){return BPromise[_0xb8cc('0x20')](_0x500120);}return _0x1e9769[_0xb8cc('0x21')]();};}function saveUpdates(_0x4a7aac,_0x9b0aba){return function(_0xe5ad50){if(_0xe5ad50){return _0xe5ad50['update'](_0x4a7aac)[_0xb8cc('0x22')](function(_0xdcb33d){return _0xdcb33d;});}return null;};}function removeEntity(_0xd1c676,_0x1d372c){return function(_0x26fba9){if(_0x26fba9){return _0x26fba9[_0xb8cc('0x23')]()[_0xb8cc('0x22')](function(){var _0x59608c=_0x26fba9['get']({'plain':!![]});var _0x8b6b21='CustomReports';return db[_0xb8cc('0x24')]['destroy']({'where':{'type':_0x8b6b21,'resourceId':_0x59608c['id']}})[_0xb8cc('0x22')](function(){return _0x26fba9;});})[_0xb8cc('0x22')](function(){_0xd1c676[_0xb8cc('0x18')](0xcc)[_0xb8cc('0x25')]();});}};}function handleEntityNotFound(_0x56ed01,_0x2c4aa0){return function(_0x2cc7f3){if(!_0x2cc7f3){_0x56ed01[_0xb8cc('0x17')](0x194);}return _0x2cc7f3;};}function handleError(_0x13acba,_0x22b99a){_0x22b99a=_0x22b99a||0x1f4;return function(_0x491a03){logger['error'](_0x491a03[_0xb8cc('0x26')]);if(_0x491a03[_0xb8cc('0x27')]){delete _0x491a03['name'];}_0x13acba[_0xb8cc('0x18')](_0x22b99a)['send'](_0x491a03);};}exports[_0xb8cc('0x28')]=function(_0x2634a4,_0x1d1514){var _0x118a18={},_0x4e3883={},_0x37daf0={'count':0x0,'rows':[]};var _0x1fc4ac=_[_0xb8cc('0x29')](db['AnalyticCustomReport'][_0xb8cc('0x2a')],function(_0x59e850){return{'name':_0x59e850[_0xb8cc('0x2b')],'type':_0x59e850['type'][_0xb8cc('0x2c')]};});_0x4e3883[_0xb8cc('0x2d')]=_['map'](_0x1fc4ac,_0xb8cc('0x27'));_0x4e3883[_0xb8cc('0x2e')]=_[_0xb8cc('0x2f')](_0x2634a4[_0xb8cc('0x2e')]);_0x4e3883[_0xb8cc('0x30')]=_[_0xb8cc('0x31')](_0x4e3883[_0xb8cc('0x2d')],_0x4e3883['query']);_0x118a18['attributes']=_[_0xb8cc('0x31')](_0x4e3883['model'],qs[_0xb8cc('0x32')](_0x2634a4['query']['fields']));_0x118a18[_0xb8cc('0x33')]=_0x118a18[_0xb8cc('0x33')][_0xb8cc('0x34')]?_0x118a18['attributes']:_0x4e3883[_0xb8cc('0x2d')];if(!_0x2634a4[_0xb8cc('0x2e')][_0xb8cc('0x35')](_0xb8cc('0x36'))){_0x118a18[_0xb8cc('0x1c')]=qs[_0xb8cc('0x1c')](_0x2634a4[_0xb8cc('0x2e')][_0xb8cc('0x1c')]);_0x118a18[_0xb8cc('0x1b')]=qs[_0xb8cc('0x1b')](_0x2634a4[_0xb8cc('0x2e')][_0xb8cc('0x1b')]);}_0x118a18[_0xb8cc('0x37')]=qs[_0xb8cc('0x38')](_0x2634a4[_0xb8cc('0x2e')][_0xb8cc('0x38')]);_0x118a18[_0xb8cc('0x39')]=qs[_0xb8cc('0x30')](_['pick'](_0x2634a4['query'],_0x4e3883[_0xb8cc('0x30')]),_0x1fc4ac);if(_0x2634a4[_0xb8cc('0x2e')][_0xb8cc('0x3a')]){_0x118a18[_0xb8cc('0x39')]=_[_0xb8cc('0x3b')](_0x118a18[_0xb8cc('0x39')],{'$or':_[_0xb8cc('0x29')](_0x1fc4ac,function(_0x1564e9){if(_0x1564e9[_0xb8cc('0x3c')]!=='VIRTUAL'){var _0x5f5b62={};_0x5f5b62[_0x1564e9['name']]={'$like':'%'+_0x2634a4['query'][_0xb8cc('0x3a')]+'%'};return _0x5f5b62;}})});}_0x118a18=_['merge']({},_0x118a18,_0x2634a4[_0xb8cc('0x3d')]);var _0x4affc5={'where':_0x118a18[_0xb8cc('0x39')]};return db[_0xb8cc('0x3e')][_0xb8cc('0x1a')](_0x4affc5)[_0xb8cc('0x22')](function(_0x1d4a83){_0x37daf0['count']=_0x1d4a83;if(_0x2634a4[_0xb8cc('0x2e')][_0xb8cc('0x3f')]){_0x118a18[_0xb8cc('0x40')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xb8cc('0x41')](_0x118a18);})['then'](function(_0x4ba848){_0x37daf0['rows']=_0x4ba848;return _0x37daf0;})[_0xb8cc('0x22')](respondWithFilteredResult(_0x1d1514,_0x118a18))[_0xb8cc('0x42')](handleError(_0x1d1514,null));};exports[_0xb8cc('0x43')]=function(_0x3f3a96,_0x51b0e5){var _0x4ba0ae={'raw':![],'where':{'id':_0x3f3a96['params']['id']}},_0x231d78={};_0x231d78['model']=_[_0xb8cc('0x2f')](db[_0xb8cc('0x3e')][_0xb8cc('0x2a')]);_0x231d78[_0xb8cc('0x2e')]=_['keys'](_0x3f3a96[_0xb8cc('0x2e')]);_0x231d78[_0xb8cc('0x30')]=_['intersection'](_0x231d78[_0xb8cc('0x2d')],_0x231d78[_0xb8cc('0x2e')]);_0x4ba0ae[_0xb8cc('0x33')]=_[_0xb8cc('0x31')](_0x231d78[_0xb8cc('0x2d')],qs[_0xb8cc('0x32')](_0x3f3a96[_0xb8cc('0x2e')]['fields']));_0x4ba0ae[_0xb8cc('0x33')]=_0x4ba0ae[_0xb8cc('0x33')][_0xb8cc('0x34')]?_0x4ba0ae[_0xb8cc('0x33')]:_0x231d78[_0xb8cc('0x2d')];if(_0x3f3a96[_0xb8cc('0x2e')][_0xb8cc('0x3f')]){_0x4ba0ae['include']=[{'all':!![]}];}_0x4ba0ae=_[_0xb8cc('0x3b')]({},_0x4ba0ae,_0x3f3a96['options']);return db['AnalyticCustomReport']['find'](_0x4ba0ae)[_0xb8cc('0x22')](handleEntityNotFound(_0x51b0e5,null))[_0xb8cc('0x22')](respondWithResult(_0x51b0e5,null))[_0xb8cc('0x42')](handleError(_0x51b0e5,null));};exports[_0xb8cc('0x44')]=function(_0x5b4a45,_0x5a91a0){return db[_0xb8cc('0x3e')][_0xb8cc('0x44')](_0x5b4a45[_0xb8cc('0x45')],{})[_0xb8cc('0x22')](function(_0x3216a4){var _0x34a8a5=_0x5b4a45[_0xb8cc('0x46')][_0xb8cc('0x47')]({'plain':!![]});if(!_0x34a8a5)throw new Error(_0xb8cc('0x48'));if(_0x34a8a5[_0xb8cc('0x49')]==='user'){var _0x453af7=_0x3216a4[_0xb8cc('0x47')]({'plain':!![]});var _0x3b1e24=_0xb8cc('0x4a');return db['UserProfileSection'][_0xb8cc('0x4b')]({'where':{'name':_0x3b1e24,'userProfileId':_0x34a8a5[_0xb8cc('0x4c')]},'raw':!![]})[_0xb8cc('0x22')](function(_0x5d22bd){if(_0x5d22bd&&_0x5d22bd[_0xb8cc('0x4d')]===0x0){return db[_0xb8cc('0x24')][_0xb8cc('0x44')]({'name':_0x453af7['name'],'resourceId':_0x453af7['id'],'type':_0xb8cc('0x4e'),'sectionId':_0x5d22bd['id']},{})[_0xb8cc('0x22')](function(){return _0x3216a4;});}else{return _0x3216a4;}})[_0xb8cc('0x42')](function(_0xaeb76){logger[_0xb8cc('0x4f')](_0xb8cc('0x50'),_0xaeb76);throw _0xaeb76;});}return _0x3216a4;})['then'](respondWithResult(_0x5a91a0,0xc9))[_0xb8cc('0x42')](handleError(_0x5a91a0,null));};exports[_0xb8cc('0x51')]=function(_0x2ced82,_0x31b89b){if(_0x2ced82['body']['id']){delete _0x2ced82[_0xb8cc('0x45')]['id'];}return db[_0xb8cc('0x3e')][_0xb8cc('0x4b')]({'where':{'id':_0x2ced82['params']['id']}})[_0xb8cc('0x22')](handleEntityNotFound(_0x31b89b,null))[_0xb8cc('0x22')](saveUpdates(_0x2ced82[_0xb8cc('0x45')],null))[_0xb8cc('0x22')](respondWithResult(_0x31b89b,null))[_0xb8cc('0x42')](handleError(_0x31b89b,null));};exports[_0xb8cc('0x23')]=function(_0x2ac6ba,_0xba1e1b){return db[_0xb8cc('0x3e')]['find']({'where':{'id':_0x2ac6ba['params']['id']}})[_0xb8cc('0x22')](handleEntityNotFound(_0xba1e1b,null))[_0xb8cc('0x22')](removeEntity(_0xba1e1b,null))['catch'](handleError(_0xba1e1b,null));};exports['preview']=function(_0xf8e17,_0xa84996){var _0x3bf493=0xa;var _0x2404e1=[_0xb8cc('0x52'),'left_join',_0xb8cc('0x53'),_0xb8cc('0x54')];var _0x14600c={'SUM':'SUM(%s)','COUNT':_0xb8cc('0x55'),'COUNT DISTINCT':_0xb8cc('0x56'),'MAX':_0xb8cc('0x57'),'MIN':_0xb8cc('0x58'),'AVG':_0xb8cc('0x59'),'GROUP_CONCAT':_0xb8cc('0x5a'),'GROUP_CONCAT ASC':_0xb8cc('0x5b'),'GROUP_CONCAT DESC':_0xb8cc('0x5c')};var _0x142ebf={'SEC_TO_TIME':_0xb8cc('0x5d'),'DATE':_0xb8cc('0x5e'),'HOUR':_0xb8cc('0x5f'),'ROUND':_0xb8cc('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x56aa7d=function(_0x49389d){return!_[_0xb8cc('0x61')]([_0xb8cc('0x62'),_0xb8cc('0x63'),_0xb8cc('0x64'),_0xb8cc('0x65')],_0x49389d);};var _0x175fd4=function(_0x51f7dd){if(!_0x51f7dd||!_0x51f7dd['rules']['length']){return'';}for(var _0x714811='(',_0x3eddf4=0x0;_0x3eddf4<_0x51f7dd[_0xb8cc('0x66')][_0xb8cc('0x34')];_0x3eddf4+=0x1){_0x3eddf4>0x0&&(_0x714811+='\x20'+_0x51f7dd['operator']+'\x20');_0x714811+=_0x51f7dd['rules'][_0x3eddf4][_0xb8cc('0x67')]?_0x175fd4(_0x51f7dd[_0xb8cc('0x66')][_0x3eddf4][_0xb8cc('0x67')]):_0x51f7dd['rules'][_0x3eddf4][_0xb8cc('0x68')]+'\x20'+_0x51f7dd[_0xb8cc('0x66')][_0x3eddf4]['condition']+(_0x56aa7d(_0x51f7dd['rules'][_0x3eddf4][_0xb8cc('0x69')])?'\x20'+_0x51f7dd[_0xb8cc('0x66')][_0x3eddf4][_0xb8cc('0x6a')]:'');}return _0x714811+')';};var _0x10d93a={'where':{'id':_0xf8e17['params']['id']}},_0x2c9ff5,_0x1858e5,_0x7481fd,_0x4eeb36,_0x24491e;_0x10d93a=_['merge']({},_0x10d93a,_0xf8e17[_0xb8cc('0x3d')]);return db['AnalyticCustomReport'][_0xb8cc('0x4b')](_0x10d93a)['then'](function(_0x1a2b54){if(_0x1a2b54){_0x2c9ff5=_0x1a2b54;return _0x1a2b54['getFields']();}return null;})[_0xb8cc('0x22')](function(_0x3eccde){if(_0x3eccde){if(!_0x3eccde[_0xb8cc('0x34')]){throw new db['Sequelize']['ValidationErrorItem'](_0xb8cc('0x6b'),0x193);}_0x1858e5=_0x3eccde;return db[_0xb8cc('0x6c')][_0xb8cc('0x41')]({'raw':!![]});}return null;})[_0xb8cc('0x22')](function(_0x510212){if(_0x510212){_0x7481fd=_['keyBy'](_0x510212,'id');var _0x412d56;var _0x28bfce=squel[_0xb8cc('0x6d')]();_0x28bfce['from'](_0x2c9ff5[_0xb8cc('0x6e')]);for(var _0x4cc4bd=0x0;_0x4cc4bd<_0x1858e5[_0xb8cc('0x34')];_0x4cc4bd+=0x1){_0x412d56=_0x1858e5[_0x4cc4bd]['MetricId']?_0x7481fd[_0x1858e5[_0x4cc4bd][_0xb8cc('0x6f')]][_0xb8cc('0x70')]:_0x1858e5[_0x4cc4bd][_0xb8cc('0x68')];_0x412d56=_0x1858e5[_0x4cc4bd][_0xb8cc('0x71')]?_[_0xb8cc('0x72')](_0x14600c[_0x1858e5[_0x4cc4bd][_0xb8cc('0x71')]],'%s',_0x412d56):_0x412d56;_0x412d56=_0x1858e5[_0x4cc4bd][_0xb8cc('0x73')]?_[_0xb8cc('0x72')](_0x142ebf[_0x1858e5[_0x4cc4bd][_0xb8cc('0x73')]],'%s',_0x412d56):_0x412d56;if(_0x1858e5[_0x4cc4bd][_0xb8cc('0x74')]){_0x28bfce['group'](_0x412d56);}_0x1858e5[_0x4cc4bd]['orderBy']&&_0x28bfce['order'](_0x412d56,_0x1858e5[_0x4cc4bd][_0xb8cc('0x75')]===_0xb8cc('0x76')?![]:!![]);_0x28bfce['field'](_0x412d56,_0x1858e5[_0x4cc4bd]['alias']||_0x412d56);}if(_0x2c9ff5[_0xb8cc('0x77')]){_0x2c9ff5[_0xb8cc('0x77')]=JSON['parse'](_0x2c9ff5[_0xb8cc('0x77')]);for(var _0x4bf010=0x0;_0x4bf010<_0x2c9ff5[_0xb8cc('0x77')]['length'];_0x4bf010+=0x1){if(_0x2c9ff5[_0xb8cc('0x77')][_0x4bf010][_0xb8cc('0x3c')]&&_['includes'](_0x2404e1,_0x2c9ff5[_0xb8cc('0x77')][_0x4bf010][_0xb8cc('0x3c')])&&_0x2c9ff5[_0xb8cc('0x77')][_0x4bf010][_0xb8cc('0x78')]&&_0x2c9ff5[_0xb8cc('0x77')][_0x4bf010]['foreignTable']&&_0x2c9ff5[_0xb8cc('0x77')][_0x4bf010][_0xb8cc('0x79')]){_0x28bfce[_0x2c9ff5['joins'][_0x4bf010][_0xb8cc('0x3c')]](_0x2c9ff5[_0xb8cc('0x77')][_0x4bf010][_0xb8cc('0x7a')],null,util[_0xb8cc('0x73')](_0xb8cc('0x7b'),_0x2c9ff5['table'],_0x2c9ff5[_0xb8cc('0x77')][_0x4bf010][_0xb8cc('0x78')],_0x2c9ff5[_0xb8cc('0x77')][_0x4bf010][_0xb8cc('0x7a')],_0x2c9ff5['joins'][_0x4bf010]['foreignKey']));}}}if(_0x2c9ff5['conditions']){_0x2c9ff5[_0xb8cc('0x7c')]=JSON[_0xb8cc('0x7d')](_0x2c9ff5[_0xb8cc('0x7c')]);_0x28bfce[_0xb8cc('0x39')](_0x175fd4(_0x2c9ff5[_0xb8cc('0x7c')]['group']));}_0x24491e=_0x28bfce[_0xb8cc('0x7e')]();_0x28bfce[_0xb8cc('0x1c')](_0x3bf493);_0x28bfce['offset'](0x0);logger[_0xb8cc('0x7f')](_0xb8cc('0x80'),_0x28bfce[_0xb8cc('0x81')]());return db[_0xb8cc('0x82')][_0xb8cc('0x2e')](_0x28bfce[_0xb8cc('0x81')](),{'type':db[_0xb8cc('0x82')][_0xb8cc('0x83')][_0xb8cc('0x84')]});}})[_0xb8cc('0x22')](respondWithResult(_0xa84996,null))['catch'](handleError(_0xa84996,null));};function runReport(_0x35178a,_0x73e192,_0x2cce64){var _0x270fcc=_0x73e192[_0xb8cc('0x27')];var _0x461b2e=0xa;var _0x1fe714=[_0xb8cc('0x52'),_0xb8cc('0x85'),'right_join','cross_join'];var _0x164b6d={'SUM':'SUM(%s)','COUNT':_0xb8cc('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb8cc('0x57'),'MIN':_0xb8cc('0x58'),'AVG':_0xb8cc('0x59'),'GROUP_CONCAT':_0xb8cc('0x5a'),'GROUP_CONCAT ASC':_0xb8cc('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x37e16f={'SEC_TO_TIME':_0xb8cc('0x5d'),'DATE':_0xb8cc('0x5e'),'HOUR':_0xb8cc('0x5f'),'ROUND':_0xb8cc('0x60'),'UNIX_TIMESTAMP':_0xb8cc('0x86')};var _0x188b18=function(_0x523375){return!_[_0xb8cc('0x61')]([_0xb8cc('0x62'),'IS\x20NOT\x20NULL',_0xb8cc('0x64'),_0xb8cc('0x65')],_0x523375);};var _0x414644=function(_0x4a5b41){if(!_0x4a5b41||!_0x4a5b41[_0xb8cc('0x66')][_0xb8cc('0x34')]){return'';}for(var _0x186e73='(',_0x208713=0x0;_0x208713<_0x4a5b41['rules'][_0xb8cc('0x34')];_0x208713+=0x1){_0x208713>0x0&&(_0x186e73+='\x20'+_0x4a5b41[_0xb8cc('0x87')]+'\x20');_0x186e73+=_0x4a5b41[_0xb8cc('0x66')][_0x208713][_0xb8cc('0x67')]?_0x414644(_0x4a5b41[_0xb8cc('0x66')][_0x208713][_0xb8cc('0x67')]):_0x4a5b41[_0xb8cc('0x66')][_0x208713][_0xb8cc('0x68')]+'\x20'+_0x4a5b41[_0xb8cc('0x66')][_0x208713]['condition']+(_0x188b18(_0x4a5b41[_0xb8cc('0x66')][_0x208713][_0xb8cc('0x69')])?'\x20'+_0x4a5b41[_0xb8cc('0x66')][_0x208713][_0xb8cc('0x6a')]:'');}return _0x186e73+')';};var _0x5e279b={'where':{'id':_0x35178a['id']}},_0x68d624,_0x979f1f,_0x3bebb7,_0x2e6098,_0x2024ad;_0x5e279b=_[_0xb8cc('0x3b')]({},_0x5e279b,_0x2cce64);return db[_0xb8cc('0x3e')]['find'](_0x5e279b)[_0xb8cc('0x22')](function(_0x3927a9){if(_0x3927a9){_0x68d624=_0x3927a9;return _0x3927a9['getFields']();}return null;})['then'](function(_0xd294b5){if(_0xd294b5){if(!_0xd294b5[_0xb8cc('0x34')]){throw new db[(_0xb8cc('0x88'))]['ValidationErrorItem'](_0xb8cc('0x6b'),0x193);}_0x979f1f=_0xd294b5;return db[_0xb8cc('0x6c')][_0xb8cc('0x41')]({'raw':!![]});}return null;})[_0xb8cc('0x22')](function(_0x3286a2){if(_0x3286a2){_0x3bebb7=_[_0xb8cc('0x89')](_0x3286a2,'id');var _0x9dac3a;var _0x677d90=squel[_0xb8cc('0x6d')]();_0x677d90[_0xb8cc('0x8a')](_0x68d624[_0xb8cc('0x6e')]);for(var _0xce02d7=0x0;_0xce02d7<_0x979f1f[_0xb8cc('0x34')];_0xce02d7+=0x1){_0x9dac3a=_0x979f1f[_0xce02d7][_0xb8cc('0x6f')]?_0x3bebb7[_0x979f1f[_0xce02d7]['MetricId']]['metric']:_0x979f1f[_0xce02d7]['field'];_0x9dac3a=_0x979f1f[_0xce02d7]['function']?_[_0xb8cc('0x72')](_0x164b6d[_0x979f1f[_0xce02d7]['function']],'%s',_0x9dac3a):_0x9dac3a;_0x9dac3a=_0x979f1f[_0xce02d7]['format']?_[_0xb8cc('0x72')](_0x37e16f[_0x979f1f[_0xce02d7]['format']],'%s',_0x9dac3a):_0x9dac3a;if(_0x979f1f[_0xce02d7]['groupBy']){_0x677d90['group'](_0x9dac3a);}_0x979f1f[_0xce02d7][_0xb8cc('0x75')]&&_0x677d90[_0xb8cc('0x37')](_0x9dac3a,_0x979f1f[_0xce02d7]['orderBy']===_0xb8cc('0x76')?![]:!![]);_0x677d90[_0xb8cc('0x68')](_0x9dac3a,_0x979f1f[_0xce02d7][_0xb8cc('0x8b')]||_0x9dac3a);}if(_0x68d624[_0xb8cc('0x77')]){_0x68d624['joins']=JSON['parse'](_0x68d624[_0xb8cc('0x77')]);for(var _0x3ef64c=0x0;_0x3ef64c<_0x68d624[_0xb8cc('0x77')]['length'];_0x3ef64c+=0x1){if(_0x68d624[_0xb8cc('0x77')][_0x3ef64c][_0xb8cc('0x3c')]&&_[_0xb8cc('0x61')](_0x1fe714,_0x68d624[_0xb8cc('0x77')][_0x3ef64c]['type'])&&_0x68d624[_0xb8cc('0x77')][_0x3ef64c]['parentKey']&&_0x68d624[_0xb8cc('0x77')][_0x3ef64c][_0xb8cc('0x7a')]&&_0x68d624[_0xb8cc('0x77')][_0x3ef64c][_0xb8cc('0x79')]){_0x677d90[_0x68d624[_0xb8cc('0x77')][_0x3ef64c]['type']](_0x68d624[_0xb8cc('0x77')][_0x3ef64c][_0xb8cc('0x7a')],null,util[_0xb8cc('0x73')]('%s.%s\x20=\x20%s.%s',_0x68d624[_0xb8cc('0x6e')],_0x68d624['joins'][_0x3ef64c][_0xb8cc('0x78')],_0x68d624[_0xb8cc('0x77')][_0x3ef64c]['foreignTable'],_0x68d624['joins'][_0x3ef64c]['foreignKey']));}}}if(_0x68d624[_0xb8cc('0x7c')]){_0x68d624[_0xb8cc('0x7c')]=JSON['parse'](_0x68d624[_0xb8cc('0x7c')]);_0x677d90[_0xb8cc('0x39')](_0x414644(_0x68d624['conditions']['group']));}_0x2024ad=_0x677d90[_0xb8cc('0x7e')]();_0x677d90[_0xb8cc('0x1c')](_0x461b2e);_0x677d90[_0xb8cc('0x1b')](0x0);logger[_0xb8cc('0x7f')](_0xb8cc('0x80'),_0x677d90['toString']());return db[_0xb8cc('0x82')][_0xb8cc('0x2e')](_0x677d90[_0xb8cc('0x81')](),{'type':db[_0xb8cc('0x82')][_0xb8cc('0x83')][_0xb8cc('0x84')]});}})[_0xb8cc('0x22')](function(_0x147590){if(!_0x147590[_0xb8cc('0x34')]){throw new db[(_0xb8cc('0x88'))]['ValidationErrorItem'](_0xb8cc('0x8c'),0xcc);}if(_0x73e192['output']===_0xb8cc('0x8d')){return null;}var _0x2629ab=_['merge'](_0x73e192,{'name':_0x73e192[_0xb8cc('0x8e')]||_0x73e192[_0xb8cc('0x27')]||_0x68d624[_0xb8cc('0x27')],'basename':_0x270fcc,'savename':util[_0xb8cc('0x73')](_0xb8cc('0x8f'),_0x73e192['name']||_0x68d624[_0xb8cc('0x27')],require(_0xb8cc('0x90'))[_0xb8cc('0x91')](0x4),_0x73e192[_0xb8cc('0x92')]||'csv'),'reportId':_0x68d624['id'],'reportType':_0xb8cc('0x93')});return db['AnalyticExtractedReport']['create'](_0x2629ab,{'raw':!![]});})[_0xb8cc('0x22')](function(_0x35ab49){if(_0x68d624[_0xb8cc('0x6e')]===_0xb8cc('0x94')){_0x2024ad['where'](_0x68d624['table']+_0xb8cc('0x95'),_0x73e192['startDate'],_0x73e192['endDate']);}else{_0x2024ad[_0xb8cc('0x39')](_0x68d624[_0xb8cc('0x6e')]+_0xb8cc('0x96'),_0x73e192['startDate'],_0x73e192['endDate']);}if(_0x35ab49){logger[_0xb8cc('0x97')]('Run\x20Query:',_0x2024ad[_0xb8cc('0x81')]());require(_0xb8cc('0x98'))[_0xb8cc('0x99')](path[_0xb8cc('0x52')](__dirname,_0xb8cc('0x9a'),_0x35ab49[_0xb8cc('0x92')]),[_0x35ab49['id'],_0x2024ad['toString'](),path['join'](__dirname,_0xb8cc('0x9b'),_0x35ab49[_0xb8cc('0x9c')]),_0x270fcc]);return _0x35ab49;}else{var _0x4ad416=squel['select']();_0x4ad416[_0xb8cc('0x8a')]('('+_0x2024ad['toString']()+')',_0xb8cc('0x9d'));_0x4ad416[_0xb8cc('0x68')]('COUNT(*)',_0xb8cc('0x1a'));_0x2024ad[_0xb8cc('0x1c')](_0x73e192[_0xb8cc('0x1c')]||_0x461b2e);_0x2024ad[_0xb8cc('0x1b')](_0x73e192[_0xb8cc('0x1b')]||0x0);return dbH['sequelize']['query'](_0x4ad416[_0xb8cc('0x81')](),{'type':dbH[_0xb8cc('0x82')][_0xb8cc('0x83')][_0xb8cc('0x84')]})[_0xb8cc('0x22')](function(_0x178d71){if(!_0x178d71[_0xb8cc('0x34')]){_0x2e6098=0x0;}else{_0x2e6098=_0x178d71[0x0][_0xb8cc('0x1a')]||0x0;}return dbH[_0xb8cc('0x82')][_0xb8cc('0x2e')](_0x2024ad[_0xb8cc('0x81')](),{'type':dbH[_0xb8cc('0x82')]['QueryTypes'][_0xb8cc('0x84')]});})[_0xb8cc('0x22')](function(_0x43fe14){return{'rows':_0x43fe14||[],'count':_0x2e6098};});}});}exports[_0xb8cc('0x9e')]=function(_0x321c71,_0x21d6de){return runReport(_0x321c71['params'],_0x321c71[_0xb8cc('0x2e')],_0x321c71['options'])[_0xb8cc('0x22')](respondWithResult(_0x21d6de,null))[_0xb8cc('0x42')](handleError(_0x21d6de,null));};exports[_0xb8cc('0x9f')]=runReport;exports[_0xb8cc('0x2e')]=function(_0x192d84,_0x3e6f59){var _0x1b4ccc=0xa;var _0x28c09b=[_0xb8cc('0x52'),'left_join',_0xb8cc('0x53'),_0xb8cc('0x54')];var _0x1fcf8d={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb8cc('0x56'),'MAX':'MAX(%s)','MIN':_0xb8cc('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb8cc('0x5a'),'GROUP_CONCAT ASC':_0xb8cc('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x49d0e9={'SEC_TO_TIME':_0xb8cc('0x5d'),'DATE':_0xb8cc('0x5e'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb8cc('0x86')};var _0x3c9c28=function(_0x5e1383){return!_[_0xb8cc('0x61')]([_0xb8cc('0x62'),_0xb8cc('0x63'),'IS\x20EMPTY',_0xb8cc('0x65')],_0x5e1383);};var _0x5312e5=function(_0x9c4b80){if(!_0x9c4b80||!_0x9c4b80['rules'][_0xb8cc('0x34')]){return'';}for(var _0x3490e5='(',_0x3db420=0x0;_0x3db420<_0x9c4b80['rules']['length'];_0x3db420+=0x1){_0x3db420>0x0&&(_0x3490e5+='\x20'+_0x9c4b80[_0xb8cc('0x87')]+'\x20');_0x3490e5+=_0x9c4b80[_0xb8cc('0x66')][_0x3db420][_0xb8cc('0x67')]?_0x5312e5(_0x9c4b80[_0xb8cc('0x66')][_0x3db420][_0xb8cc('0x67')]):_0x9c4b80[_0xb8cc('0x66')][_0x3db420][_0xb8cc('0x68')]+'\x20'+_0x9c4b80[_0xb8cc('0x66')][_0x3db420][_0xb8cc('0x69')]+(_0x3c9c28(_0x9c4b80['rules'][_0x3db420][_0xb8cc('0x69')])?'\x20'+_0x9c4b80[_0xb8cc('0x66')][_0x3db420][_0xb8cc('0x6a')]:'');}return _0x3490e5+')';};var _0x2c176c={'where':{'id':_0x192d84[_0xb8cc('0xa0')]['id']}},_0x246132,_0xbb2002,_0x5d1f88,_0x2f8bd2,_0x4af102;_0x2c176c=_[_0xb8cc('0x3b')]({},_0x2c176c,_0x192d84[_0xb8cc('0x3d')]);return db[_0xb8cc('0x3e')][_0xb8cc('0x4b')](_0x2c176c)['then'](function(_0x533a75){if(_0x533a75){_0x246132=_0x533a75;return _0x533a75[_0xb8cc('0xa1')]();}return null;})['then'](function(_0x3406a5){if(_0x3406a5){if(!_0x3406a5[_0xb8cc('0x34')]){throw new db[(_0xb8cc('0x88'))][(_0xb8cc('0xa2'))](_0xb8cc('0x6b'),0x193);}_0xbb2002=_0x3406a5;return db[_0xb8cc('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xb8cc('0x22')](function(_0x506050){if(_0x506050){_0x5d1f88=_['keyBy'](_0x506050,'id');var _0x6ccec0;var _0x4405e7=squel[_0xb8cc('0x6d')]();_0x4405e7['from'](_0x246132[_0xb8cc('0x6e')]);for(var _0x53e695=0x0;_0x53e695<_0xbb2002[_0xb8cc('0x34')];_0x53e695+=0x1){_0x6ccec0=_0xbb2002[_0x53e695]['MetricId']?_0x5d1f88[_0xbb2002[_0x53e695]['MetricId']]['metric']:_0xbb2002[_0x53e695][_0xb8cc('0x68')];_0x6ccec0=_0xbb2002[_0x53e695][_0xb8cc('0x71')]?_[_0xb8cc('0x72')](_0x1fcf8d[_0xbb2002[_0x53e695][_0xb8cc('0x71')]],'%s',_0x6ccec0):_0x6ccec0;_0x6ccec0=_0xbb2002[_0x53e695][_0xb8cc('0x73')]?_[_0xb8cc('0x72')](_0x49d0e9[_0xbb2002[_0x53e695][_0xb8cc('0x73')]],'%s',_0x6ccec0):_0x6ccec0;if(_0xbb2002[_0x53e695]['groupBy']){_0x4405e7['group'](_0x6ccec0);}_0xbb2002[_0x53e695][_0xb8cc('0x75')]&&_0x4405e7[_0xb8cc('0x37')](_0x6ccec0,_0xbb2002[_0x53e695]['orderBy']===_0xb8cc('0x76')?![]:!![]);_0x4405e7[_0xb8cc('0x68')](_0x6ccec0,_0xbb2002[_0x53e695][_0xb8cc('0x8b')]||_0x6ccec0);}if(_0x246132[_0xb8cc('0x77')]){_0x246132[_0xb8cc('0x77')]=JSON[_0xb8cc('0x7d')](_0x246132[_0xb8cc('0x77')]);for(var _0x407932=0x0;_0x407932<_0x246132[_0xb8cc('0x77')][_0xb8cc('0x34')];_0x407932+=0x1){if(_0x246132[_0xb8cc('0x77')][_0x407932]['type']&&_[_0xb8cc('0x61')](_0x28c09b,_0x246132['joins'][_0x407932]['type'])&&_0x246132['joins'][_0x407932][_0xb8cc('0x78')]&&_0x246132[_0xb8cc('0x77')][_0x407932][_0xb8cc('0x7a')]&&_0x246132[_0xb8cc('0x77')][_0x407932][_0xb8cc('0x79')]){_0x4405e7[_0x246132['joins'][_0x407932][_0xb8cc('0x3c')]](_0x246132[_0xb8cc('0x77')][_0x407932][_0xb8cc('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x246132[_0xb8cc('0x6e')],_0x246132['joins'][_0x407932][_0xb8cc('0x78')],_0x246132['joins'][_0x407932][_0xb8cc('0x7a')],_0x246132['joins'][_0x407932][_0xb8cc('0x79')]));}}}if(_0x246132['conditions']){_0x246132['conditions']=JSON['parse'](_0x246132[_0xb8cc('0x7c')]);_0x4405e7['where'](_0x5312e5(_0x246132[_0xb8cc('0x7c')][_0xb8cc('0x67')]));}_0x4af102=_0x4405e7[_0xb8cc('0x7e')]();_0x4405e7[_0xb8cc('0x1c')](_0x1b4ccc);_0x4405e7[_0xb8cc('0x1b')](0x0);logger[_0xb8cc('0x7f')](_0xb8cc('0x80'),_0x4405e7[_0xb8cc('0x81')]());return db[_0xb8cc('0x82')][_0xb8cc('0x2e')](_0x4405e7[_0xb8cc('0x81')](),{'type':db[_0xb8cc('0x82')][_0xb8cc('0x83')][_0xb8cc('0x84')]});}})[_0xb8cc('0x22')](function(){return{'sql':_0x4af102[_0xb8cc('0x81')]()};})[_0xb8cc('0x22')](respondWithResult(_0x3e6f59,null))[_0xb8cc('0x42')](handleError(_0x3e6f59,null));};
\ No newline at end of file
+var _0x3dd5=['keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','include','AnalyticCustomReport','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','userProfileId','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','SELECT','left_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','operator','Limited\x20Query:','sequelize','QueryTypes','No\x20available\x20data','fullPath','%s-%s.%s','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','sendStatus','status','offset','limit','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','end','stack','send','map','rawAttributes','fieldName','type','model','name','query'];(function(_0x2db48e,_0x313065){var _0xd2f8fd=function(_0x2f097f){while(--_0x2f097f){_0x2db48e['push'](_0x2db48e['shift']());}};_0xd2f8fd(++_0x313065);}(_0x3dd5,0x73));var _0x53dd=function(_0x1f066f,_0x4a6815){_0x1f066f=_0x1f066f-0x0;var _0xa1296a=_0x3dd5[_0x1f066f];return _0xa1296a;};'use strict';var pdf=require(_0x53dd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x53dd('0x1'));var zipdir=require(_0x53dd('0x2'));var jsonpatch=require(_0x53dd('0x3'));var rp=require(_0x53dd('0x4'));var moment=require(_0x53dd('0x5'));var BPromise=require(_0x53dd('0x6'));var Mustache=require(_0x53dd('0x7'));var util=require(_0x53dd('0x8'));var path=require(_0x53dd('0x9'));var sox=require('sox');var csv=require(_0x53dd('0xa'));var ejs=require(_0x53dd('0xb'));var fs=require('fs');var _=require(_0x53dd('0xc'));var squel=require(_0x53dd('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x53dd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x53dd('0xf'));var Papa=require(_0x53dd('0x10'));var Redis=require(_0x53dd('0x11'));var authService=require(_0x53dd('0x12'));var qs=require(_0x53dd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x53dd('0x14'));var logger=require(_0x53dd('0x15'))(_0x53dd('0x16'));var utils=require(_0x53dd('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var dbH=require(_0x53dd('0x18'))[_0x53dd('0x19')];function respondWithStatusCode(_0xdddaa8,_0x5117a6){_0x5117a6=_0x5117a6||0xcc;return function(_0x3fc986){if(_0x3fc986){return _0xdddaa8[_0x53dd('0x1a')](_0x5117a6);}return _0xdddaa8[_0x53dd('0x1b')](_0x5117a6)['end']();};}function respondWithResult(_0x130671,_0x345f36){_0x345f36=_0x345f36||0xc8;return function(_0x1baf8b){if(_0x1baf8b){return _0x130671['status'](_0x345f36)['json'](_0x1baf8b);}};}function respondWithFilteredResult(_0x5364be,_0x595f18){return function(_0x1d8ecf){if(_0x1d8ecf){var _0x4449e1=_0x1d8ecf['count'],_0xef43a7=_0x595f18['offset'],_0x30052e=_0x595f18[_0x53dd('0x1c')]+_0x595f18[_0x53dd('0x1d')],_0x180d1e;if(_0x30052e>=_0x4449e1){_0x30052e=_0x4449e1;_0x180d1e=0xc8;}else{_0x180d1e=0xce;}_0x5364be[_0x53dd('0x1b')](_0x180d1e);return _0x5364be[_0x53dd('0x1e')](_0x53dd('0x1f'),_0xef43a7+'-'+_0x30052e+'/'+_0x4449e1)['json'](_0x1d8ecf);}return null;};}function patchUpdates(_0x5d0e96){return function(_0x586e47){try{jsonpatch['apply'](_0x586e47,_0x5d0e96,!![]);}catch(_0x52d48b){return BPromise[_0x53dd('0x20')](_0x52d48b);}return _0x586e47['save']();};}function saveUpdates(_0x5365a7,_0x180765){return function(_0x1dcc36){if(_0x1dcc36){return _0x1dcc36[_0x53dd('0x21')](_0x5365a7)[_0x53dd('0x22')](function(_0x17ac0a){return _0x17ac0a;});}return null;};}function removeEntity(_0x4a4b3b,_0x340da7){return function(_0x47f2c5){if(_0x47f2c5){return _0x47f2c5[_0x53dd('0x23')]()[_0x53dd('0x22')](function(){var _0x534ce0=_0x47f2c5[_0x53dd('0x24')]({'plain':!![]});var _0x13e087='CustomReports';return db[_0x53dd('0x25')]['destroy']({'where':{'type':_0x13e087,'resourceId':_0x534ce0['id']}})[_0x53dd('0x22')](function(){return _0x47f2c5;});})[_0x53dd('0x22')](function(){_0x4a4b3b[_0x53dd('0x1b')](0xcc)[_0x53dd('0x26')]();});}};}function handleEntityNotFound(_0x39e5f7,_0x234bf6){return function(_0x1c0b0d){if(!_0x1c0b0d){_0x39e5f7[_0x53dd('0x1a')](0x194);}return _0x1c0b0d;};}function handleError(_0x43ea8d,_0x895636){_0x895636=_0x895636||0x1f4;return function(_0x3cfbcd){logger['error'](_0x3cfbcd[_0x53dd('0x27')]);if(_0x3cfbcd['name']){delete _0x3cfbcd['name'];}_0x43ea8d[_0x53dd('0x1b')](_0x895636)[_0x53dd('0x28')](_0x3cfbcd);};}exports['index']=function(_0x24403d,_0x55443d){var _0x3b2f31={},_0x21e92d={},_0x578d1e={'count':0x0,'rows':[]};var _0x293957=_[_0x53dd('0x29')](db['AnalyticCustomReport'][_0x53dd('0x2a')],function(_0x4ebe0a){return{'name':_0x4ebe0a[_0x53dd('0x2b')],'type':_0x4ebe0a[_0x53dd('0x2c')]['key']};});_0x21e92d[_0x53dd('0x2d')]=_[_0x53dd('0x29')](_0x293957,_0x53dd('0x2e'));_0x21e92d[_0x53dd('0x2f')]=_[_0x53dd('0x30')](_0x24403d[_0x53dd('0x2f')]);_0x21e92d['filters']=_['intersection'](_0x21e92d[_0x53dd('0x2d')],_0x21e92d[_0x53dd('0x2f')]);_0x3b2f31[_0x53dd('0x31')]=_[_0x53dd('0x32')](_0x21e92d['model'],qs[_0x53dd('0x33')](_0x24403d[_0x53dd('0x2f')][_0x53dd('0x33')]));_0x3b2f31[_0x53dd('0x31')]=_0x3b2f31[_0x53dd('0x31')][_0x53dd('0x34')]?_0x3b2f31[_0x53dd('0x31')]:_0x21e92d['model'];if(!_0x24403d[_0x53dd('0x2f')]['hasOwnProperty'](_0x53dd('0x35'))){_0x3b2f31[_0x53dd('0x1d')]=qs[_0x53dd('0x1d')](_0x24403d['query'][_0x53dd('0x1d')]);_0x3b2f31['offset']=qs[_0x53dd('0x1c')](_0x24403d[_0x53dd('0x2f')][_0x53dd('0x1c')]);}_0x3b2f31[_0x53dd('0x36')]=qs[_0x53dd('0x37')](_0x24403d[_0x53dd('0x2f')][_0x53dd('0x37')]);_0x3b2f31[_0x53dd('0x38')]=qs[_0x53dd('0x39')](_[_0x53dd('0x3a')](_0x24403d['query'],_0x21e92d[_0x53dd('0x39')]),_0x293957);if(_0x24403d['query'][_0x53dd('0x3b')]){_0x3b2f31[_0x53dd('0x38')]=_[_0x53dd('0x3c')](_0x3b2f31[_0x53dd('0x38')],{'$or':_['map'](_0x293957,function(_0x13f789){if(_0x13f789[_0x53dd('0x2c')]!==_0x53dd('0x3d')){var _0x4d6b63={};_0x4d6b63[_0x13f789[_0x53dd('0x2e')]]={'$like':'%'+_0x24403d[_0x53dd('0x2f')][_0x53dd('0x3b')]+'%'};return _0x4d6b63;}})});}_0x3b2f31=_[_0x53dd('0x3c')]({},_0x3b2f31,_0x24403d[_0x53dd('0x3e')]);var _0x51e95f={'where':_0x3b2f31[_0x53dd('0x38')]};return db['AnalyticCustomReport'][_0x53dd('0x3f')](_0x51e95f)[_0x53dd('0x22')](function(_0x1e44b0){_0x578d1e[_0x53dd('0x3f')]=_0x1e44b0;if(_0x24403d['query']['includeAll']){_0x3b2f31[_0x53dd('0x40')]=[{'all':!![]}];}return db[_0x53dd('0x41')][_0x53dd('0x42')](_0x3b2f31);})[_0x53dd('0x22')](function(_0x34e641){_0x578d1e[_0x53dd('0x43')]=_0x34e641;return _0x578d1e;})[_0x53dd('0x22')](respondWithFilteredResult(_0x55443d,_0x3b2f31))[_0x53dd('0x44')](handleError(_0x55443d,null));};exports[_0x53dd('0x45')]=function(_0x8b9797,_0x1fbcf5){var _0x1195d3={'raw':![],'where':{'id':_0x8b9797[_0x53dd('0x46')]['id']}},_0x2cfa58={};_0x2cfa58[_0x53dd('0x2d')]=_[_0x53dd('0x30')](db[_0x53dd('0x41')][_0x53dd('0x2a')]);_0x2cfa58[_0x53dd('0x2f')]=_[_0x53dd('0x30')](_0x8b9797[_0x53dd('0x2f')]);_0x2cfa58[_0x53dd('0x39')]=_['intersection'](_0x2cfa58[_0x53dd('0x2d')],_0x2cfa58[_0x53dd('0x2f')]);_0x1195d3[_0x53dd('0x31')]=_[_0x53dd('0x32')](_0x2cfa58[_0x53dd('0x2d')],qs[_0x53dd('0x33')](_0x8b9797[_0x53dd('0x2f')]['fields']));_0x1195d3[_0x53dd('0x31')]=_0x1195d3[_0x53dd('0x31')]['length']?_0x1195d3[_0x53dd('0x31')]:_0x2cfa58[_0x53dd('0x2d')];if(_0x8b9797['query']['includeAll']){_0x1195d3[_0x53dd('0x40')]=[{'all':!![]}];}_0x1195d3=_[_0x53dd('0x3c')]({},_0x1195d3,_0x8b9797[_0x53dd('0x3e')]);return db[_0x53dd('0x41')][_0x53dd('0x47')](_0x1195d3)[_0x53dd('0x22')](handleEntityNotFound(_0x1fbcf5,null))[_0x53dd('0x22')](respondWithResult(_0x1fbcf5,null))['catch'](handleError(_0x1fbcf5,null));};exports[_0x53dd('0x48')]=function(_0x978acf,_0x2ec7d4){return db['AnalyticCustomReport'][_0x53dd('0x48')](_0x978acf[_0x53dd('0x49')],{})[_0x53dd('0x22')](function(_0x5c0775){var _0x375d89=_0x978acf['user'][_0x53dd('0x24')]({'plain':!![]});if(!_0x375d89)throw new Error(_0x53dd('0x4a'));if(_0x375d89['role']===_0x53dd('0x4b')){var _0x45e83e=_0x5c0775['get']({'plain':!![]});var _0x18f2e7=_0x53dd('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x18f2e7,'userProfileId':_0x375d89[_0x53dd('0x4d')]},'raw':!![]})['then'](function(_0x386858){if(_0x386858&&_0x386858['autoAssociation']===0x0){return db[_0x53dd('0x25')][_0x53dd('0x48')]({'name':_0x45e83e[_0x53dd('0x2e')],'resourceId':_0x45e83e['id'],'type':_0x53dd('0x4e'),'sectionId':_0x386858['id']},{})[_0x53dd('0x22')](function(){return _0x5c0775;});}else{return _0x5c0775;}})[_0x53dd('0x44')](function(_0x64d2ab){logger[_0x53dd('0x4f')](_0x53dd('0x50'),_0x64d2ab);throw _0x64d2ab;});}return _0x5c0775;})[_0x53dd('0x22')](respondWithResult(_0x2ec7d4,0xc9))[_0x53dd('0x44')](handleError(_0x2ec7d4,null));};exports[_0x53dd('0x21')]=function(_0x373244,_0xb82775){if(_0x373244[_0x53dd('0x49')]['id']){delete _0x373244[_0x53dd('0x49')]['id'];}return db[_0x53dd('0x41')][_0x53dd('0x47')]({'where':{'id':_0x373244['params']['id']}})[_0x53dd('0x22')](handleEntityNotFound(_0xb82775,null))[_0x53dd('0x22')](saveUpdates(_0x373244[_0x53dd('0x49')],null))[_0x53dd('0x22')](respondWithResult(_0xb82775,null))['catch'](handleError(_0xb82775,null));};exports[_0x53dd('0x23')]=function(_0x3f306b,_0x21e3ed){return db[_0x53dd('0x41')][_0x53dd('0x47')]({'where':{'id':_0x3f306b[_0x53dd('0x46')]['id']}})[_0x53dd('0x22')](handleEntityNotFound(_0x21e3ed,null))[_0x53dd('0x22')](removeEntity(_0x21e3ed,null))['catch'](handleError(_0x21e3ed,null));};exports['preview']=function(_0x1b08f2,_0x317189){var _0x26136e=0xa;var _0x2859f8=[_0x53dd('0x51'),'left_join',_0x53dd('0x52'),_0x53dd('0x53')];var _0x85ae38={'SUM':_0x53dd('0x54'),'COUNT':_0x53dd('0x55'),'COUNT DISTINCT':_0x53dd('0x56'),'MAX':_0x53dd('0x57'),'MIN':_0x53dd('0x58'),'AVG':_0x53dd('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x53dd('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5ab35d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x53dd('0x5b'),'ROUND':_0x53dd('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x19d2ed=function(_0x5b7884){return!_[_0x53dd('0x5d')]([_0x53dd('0x5e'),'IS\x20NOT\x20NULL',_0x53dd('0x5f'),_0x53dd('0x60')],_0x5b7884);};var _0x447552=function(_0x1e4cf6){if(!_0x1e4cf6||!_0x1e4cf6[_0x53dd('0x61')][_0x53dd('0x34')]){return'';}for(var _0x592282='(',_0x2975e2=0x0;_0x2975e2<_0x1e4cf6[_0x53dd('0x61')][_0x53dd('0x34')];_0x2975e2+=0x1){_0x2975e2>0x0&&(_0x592282+='\x20'+_0x1e4cf6['operator']+'\x20');_0x592282+=_0x1e4cf6[_0x53dd('0x61')][_0x2975e2][_0x53dd('0x62')]?_0x447552(_0x1e4cf6[_0x53dd('0x61')][_0x2975e2][_0x53dd('0x62')]):_0x1e4cf6[_0x53dd('0x61')][_0x2975e2][_0x53dd('0x63')]+'\x20'+_0x1e4cf6[_0x53dd('0x61')][_0x2975e2]['condition']+(_0x19d2ed(_0x1e4cf6[_0x53dd('0x61')][_0x2975e2][_0x53dd('0x64')])?'\x20'+_0x1e4cf6[_0x53dd('0x61')][_0x2975e2][_0x53dd('0x65')]:'');}return _0x592282+')';};var _0x3f0775={'where':{'id':_0x1b08f2['params']['id']}},_0x1b550a,_0x50ac1e,_0x5a5ead,_0x3c3e56,_0x293010;_0x3f0775=_['merge']({},_0x3f0775,_0x1b08f2[_0x53dd('0x3e')]);return db['AnalyticCustomReport'][_0x53dd('0x47')](_0x3f0775)[_0x53dd('0x22')](function(_0x43c015){if(_0x43c015){_0x1b550a=_0x43c015;return _0x43c015[_0x53dd('0x66')]();}return null;})[_0x53dd('0x22')](function(_0xb355a9){if(_0xb355a9){if(!_0xb355a9[_0x53dd('0x34')]){throw new db[(_0x53dd('0x67'))][(_0x53dd('0x68'))](_0x53dd('0x69'),0x193);}_0x50ac1e=_0xb355a9;return db[_0x53dd('0x6a')][_0x53dd('0x42')]({'raw':!![]});}return null;})[_0x53dd('0x22')](function(_0x56f799){if(_0x56f799){_0x5a5ead=_[_0x53dd('0x6b')](_0x56f799,'id');var _0x255d9c;var _0x3ba030=squel[_0x53dd('0x6c')]();_0x3ba030[_0x53dd('0x6d')](_0x1b550a[_0x53dd('0x6e')]);for(var _0x13998d=0x0;_0x13998d<_0x50ac1e[_0x53dd('0x34')];_0x13998d+=0x1){_0x255d9c=_0x50ac1e[_0x13998d][_0x53dd('0x6f')]?_0x5a5ead[_0x50ac1e[_0x13998d][_0x53dd('0x6f')]][_0x53dd('0x70')]:_0x50ac1e[_0x13998d][_0x53dd('0x63')];_0x255d9c=_0x50ac1e[_0x13998d][_0x53dd('0x71')]?_[_0x53dd('0x72')](_0x85ae38[_0x50ac1e[_0x13998d][_0x53dd('0x71')]],'%s',_0x255d9c):_0x255d9c;_0x255d9c=_0x50ac1e[_0x13998d][_0x53dd('0x73')]?_['replace'](_0x5ab35d[_0x50ac1e[_0x13998d]['format']],'%s',_0x255d9c):_0x255d9c;if(_0x50ac1e[_0x13998d][_0x53dd('0x74')]){_0x3ba030['group'](_0x255d9c);}_0x50ac1e[_0x13998d][_0x53dd('0x75')]&&_0x3ba030[_0x53dd('0x36')](_0x255d9c,_0x50ac1e[_0x13998d][_0x53dd('0x75')]===_0x53dd('0x76')?![]:!![]);_0x3ba030['field'](_0x255d9c,_0x50ac1e[_0x13998d][_0x53dd('0x77')]||_0x255d9c);}if(_0x1b550a[_0x53dd('0x78')]){_0x1b550a[_0x53dd('0x78')]=JSON[_0x53dd('0x79')](_0x1b550a[_0x53dd('0x78')]);for(var _0x2f92fd=0x0;_0x2f92fd<_0x1b550a['joins'][_0x53dd('0x34')];_0x2f92fd+=0x1){if(_0x1b550a[_0x53dd('0x78')][_0x2f92fd][_0x53dd('0x2c')]&&_[_0x53dd('0x5d')](_0x2859f8,_0x1b550a[_0x53dd('0x78')][_0x2f92fd][_0x53dd('0x2c')])&&_0x1b550a[_0x53dd('0x78')][_0x2f92fd][_0x53dd('0x7a')]&&_0x1b550a['joins'][_0x2f92fd][_0x53dd('0x7b')]&&_0x1b550a[_0x53dd('0x78')][_0x2f92fd][_0x53dd('0x7c')]){_0x3ba030[_0x1b550a[_0x53dd('0x78')][_0x2f92fd][_0x53dd('0x2c')]](_0x1b550a['joins'][_0x2f92fd]['foreignTable'],null,util[_0x53dd('0x73')](_0x53dd('0x7d'),_0x1b550a[_0x53dd('0x6e')],_0x1b550a['joins'][_0x2f92fd][_0x53dd('0x7a')],_0x1b550a[_0x53dd('0x78')][_0x2f92fd][_0x53dd('0x7b')],_0x1b550a['joins'][_0x2f92fd][_0x53dd('0x7c')]));}}}if(_0x1b550a['conditions']){_0x1b550a[_0x53dd('0x7e')]=JSON[_0x53dd('0x79')](_0x1b550a[_0x53dd('0x7e')]);_0x3ba030[_0x53dd('0x38')](_0x447552(_0x1b550a[_0x53dd('0x7e')]['group']));}_0x293010=_0x3ba030[_0x53dd('0x7f')]();_0x3ba030[_0x53dd('0x1d')](_0x26136e);_0x3ba030[_0x53dd('0x1c')](0x0);logger[_0x53dd('0x80')]('Limited\x20Query:',_0x3ba030['toString']());return db['sequelize'][_0x53dd('0x2f')](_0x3ba030[_0x53dd('0x81')](),{'type':db['sequelize']['QueryTypes'][_0x53dd('0x82')]});}})['then'](respondWithResult(_0x317189,null))[_0x53dd('0x44')](handleError(_0x317189,null));};function runReport(_0xccf36,_0x414930,_0x279632){var _0x5db6c8=_0x414930['name'];var _0x432357=0xa;var _0x58894e=[_0x53dd('0x51'),_0x53dd('0x83'),'right_join',_0x53dd('0x53')];var _0x43e72d={'SUM':_0x53dd('0x54'),'COUNT':_0x53dd('0x55'),'COUNT DISTINCT':_0x53dd('0x56'),'MAX':_0x53dd('0x57'),'MIN':_0x53dd('0x58'),'AVG':_0x53dd('0x59'),'GROUP_CONCAT':_0x53dd('0x84'),'GROUP_CONCAT ASC':_0x53dd('0x5a'),'GROUP_CONCAT DESC':_0x53dd('0x85')};var _0x53606a={'SEC_TO_TIME':_0x53dd('0x86'),'DATE':_0x53dd('0x87'),'HOUR':'HOUR(%s)','ROUND':_0x53dd('0x5c'),'UNIX_TIMESTAMP':_0x53dd('0x88')};var _0x538870=function(_0x151fbc){return!_[_0x53dd('0x5d')]([_0x53dd('0x5e'),'IS\x20NOT\x20NULL',_0x53dd('0x5f'),_0x53dd('0x60')],_0x151fbc);};var _0xe7db25=function(_0xaf39e8){if(!_0xaf39e8||!_0xaf39e8[_0x53dd('0x61')]['length']){return'';}for(var _0x5ade9d='(',_0x3137d3=0x0;_0x3137d3<_0xaf39e8[_0x53dd('0x61')][_0x53dd('0x34')];_0x3137d3+=0x1){_0x3137d3>0x0&&(_0x5ade9d+='\x20'+_0xaf39e8[_0x53dd('0x89')]+'\x20');_0x5ade9d+=_0xaf39e8['rules'][_0x3137d3][_0x53dd('0x62')]?_0xe7db25(_0xaf39e8[_0x53dd('0x61')][_0x3137d3][_0x53dd('0x62')]):_0xaf39e8[_0x53dd('0x61')][_0x3137d3][_0x53dd('0x63')]+'\x20'+_0xaf39e8[_0x53dd('0x61')][_0x3137d3][_0x53dd('0x64')]+(_0x538870(_0xaf39e8[_0x53dd('0x61')][_0x3137d3][_0x53dd('0x64')])?'\x20'+_0xaf39e8[_0x53dd('0x61')][_0x3137d3]['value']:'');}return _0x5ade9d+')';};var _0x46e173={'where':{'id':_0xccf36['id']}},_0xd571f3,_0x2e3626,_0x48c4f1,_0x5753d1,_0x3f4f9d;_0x46e173=_[_0x53dd('0x3c')]({},_0x46e173,_0x279632);return db[_0x53dd('0x41')]['find'](_0x46e173)[_0x53dd('0x22')](function(_0x197ed2){if(_0x197ed2){_0xd571f3=_0x197ed2;return _0x197ed2[_0x53dd('0x66')]();}return null;})['then'](function(_0x171d50){if(_0x171d50){if(!_0x171d50['length']){throw new db[(_0x53dd('0x67'))][(_0x53dd('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2e3626=_0x171d50;return db[_0x53dd('0x6a')][_0x53dd('0x42')]({'raw':!![]});}return null;})[_0x53dd('0x22')](function(_0x405664){if(_0x405664){_0x48c4f1=_[_0x53dd('0x6b')](_0x405664,'id');var _0xcec1f7;var _0x11c4cb=squel[_0x53dd('0x6c')]();_0x11c4cb['from'](_0xd571f3[_0x53dd('0x6e')]);for(var _0x3e8058=0x0;_0x3e8058<_0x2e3626[_0x53dd('0x34')];_0x3e8058+=0x1){_0xcec1f7=_0x2e3626[_0x3e8058][_0x53dd('0x6f')]?_0x48c4f1[_0x2e3626[_0x3e8058][_0x53dd('0x6f')]][_0x53dd('0x70')]:_0x2e3626[_0x3e8058][_0x53dd('0x63')];_0xcec1f7=_0x2e3626[_0x3e8058][_0x53dd('0x71')]?_[_0x53dd('0x72')](_0x43e72d[_0x2e3626[_0x3e8058][_0x53dd('0x71')]],'%s',_0xcec1f7):_0xcec1f7;_0xcec1f7=_0x2e3626[_0x3e8058][_0x53dd('0x73')]?_[_0x53dd('0x72')](_0x53606a[_0x2e3626[_0x3e8058]['format']],'%s',_0xcec1f7):_0xcec1f7;if(_0x2e3626[_0x3e8058]['groupBy']){_0x11c4cb[_0x53dd('0x62')](_0xcec1f7);}_0x2e3626[_0x3e8058][_0x53dd('0x75')]&&_0x11c4cb[_0x53dd('0x36')](_0xcec1f7,_0x2e3626[_0x3e8058]['orderBy']==='DESC'?![]:!![]);_0x11c4cb[_0x53dd('0x63')](_0xcec1f7,_0x2e3626[_0x3e8058][_0x53dd('0x77')]||_0xcec1f7);}if(_0xd571f3[_0x53dd('0x78')]){_0xd571f3[_0x53dd('0x78')]=JSON[_0x53dd('0x79')](_0xd571f3['joins']);for(var _0x265325=0x0;_0x265325<_0xd571f3[_0x53dd('0x78')][_0x53dd('0x34')];_0x265325+=0x1){if(_0xd571f3[_0x53dd('0x78')][_0x265325]['type']&&_[_0x53dd('0x5d')](_0x58894e,_0xd571f3[_0x53dd('0x78')][_0x265325][_0x53dd('0x2c')])&&_0xd571f3['joins'][_0x265325][_0x53dd('0x7a')]&&_0xd571f3['joins'][_0x265325]['foreignTable']&&_0xd571f3[_0x53dd('0x78')][_0x265325][_0x53dd('0x7c')]){_0x11c4cb[_0xd571f3[_0x53dd('0x78')][_0x265325][_0x53dd('0x2c')]](_0xd571f3[_0x53dd('0x78')][_0x265325]['foreignTable'],null,util[_0x53dd('0x73')](_0x53dd('0x7d'),_0xd571f3[_0x53dd('0x6e')],_0xd571f3[_0x53dd('0x78')][_0x265325]['parentKey'],_0xd571f3[_0x53dd('0x78')][_0x265325][_0x53dd('0x7b')],_0xd571f3['joins'][_0x265325][_0x53dd('0x7c')]));}}}if(_0xd571f3[_0x53dd('0x7e')]){_0xd571f3['conditions']=JSON[_0x53dd('0x79')](_0xd571f3[_0x53dd('0x7e')]);_0x11c4cb[_0x53dd('0x38')](_0xe7db25(_0xd571f3[_0x53dd('0x7e')][_0x53dd('0x62')]));}_0x3f4f9d=_0x11c4cb['clone']();_0x11c4cb[_0x53dd('0x1d')](_0x432357);_0x11c4cb[_0x53dd('0x1c')](0x0);logger[_0x53dd('0x80')](_0x53dd('0x8a'),_0x11c4cb[_0x53dd('0x81')]());return db[_0x53dd('0x8b')][_0x53dd('0x2f')](_0x11c4cb['toString'](),{'type':db['sequelize'][_0x53dd('0x8c')][_0x53dd('0x82')]});}})[_0x53dd('0x22')](function(_0x40da04){if(!_0x40da04[_0x53dd('0x34')]){throw new db[(_0x53dd('0x67'))]['ValidationErrorItem'](_0x53dd('0x8d'),0xcc);}if(_0x414930['output']==='web'){return null;}var _0x5bf22e=_[_0x53dd('0x3c')](_0x414930,{'name':_0x414930[_0x53dd('0x8e')]||_0x414930[_0x53dd('0x2e')]||_0xd571f3[_0x53dd('0x2e')],'basename':_0x5db6c8,'savename':util[_0x53dd('0x73')](_0x53dd('0x8f'),_0x414930[_0x53dd('0x2e')]||_0xd571f3[_0x53dd('0x2e')],require('randomstring')['generate'](0x4),_0x414930[_0x53dd('0x90')]||_0x53dd('0x91')),'reportId':_0xd571f3['id'],'reportType':_0x53dd('0x92')});return db[_0x53dd('0x93')]['create'](_0x5bf22e,{'raw':!![]});})[_0x53dd('0x22')](function(_0x3e0c08){if(_0xd571f3[_0x53dd('0x6e')]===_0x53dd('0x94')){_0x3f4f9d['where'](_0xd571f3['table']+_0x53dd('0x95'),_0x414930[_0x53dd('0x96')],_0x414930[_0x53dd('0x97')]);}else{_0x3f4f9d[_0x53dd('0x38')](_0xd571f3[_0x53dd('0x6e')]+_0x53dd('0x98'),_0x414930[_0x53dd('0x96')],_0x414930[_0x53dd('0x97')]);}if(_0x3e0c08){logger[_0x53dd('0x99')](_0x53dd('0x9a'),_0x3f4f9d[_0x53dd('0x81')]());require(_0x53dd('0x9b'))[_0x53dd('0x9c')](path[_0x53dd('0x51')](__dirname,_0x53dd('0x9d'),_0x3e0c08[_0x53dd('0x90')]),[_0x3e0c08['id'],_0x3f4f9d[_0x53dd('0x81')](),path[_0x53dd('0x51')](__dirname,_0x53dd('0x9e'),_0x3e0c08[_0x53dd('0x9f')]),_0x5db6c8]);return _0x3e0c08;}else{var _0x5de872=squel[_0x53dd('0x6c')]();_0x5de872[_0x53dd('0x6d')]('('+_0x3f4f9d[_0x53dd('0x81')]()+')',_0x53dd('0xa0'));_0x5de872['field'](_0x53dd('0xa1'),_0x53dd('0x3f'));_0x3f4f9d[_0x53dd('0x1d')](_0x414930[_0x53dd('0x1d')]||_0x432357);_0x3f4f9d[_0x53dd('0x1c')](_0x414930[_0x53dd('0x1c')]||0x0);return dbH[_0x53dd('0x8b')][_0x53dd('0x2f')](_0x5de872[_0x53dd('0x81')](),{'type':dbH[_0x53dd('0x8b')][_0x53dd('0x8c')][_0x53dd('0x82')]})[_0x53dd('0x22')](function(_0x57134a){if(!_0x57134a[_0x53dd('0x34')]){_0x5753d1=0x0;}else{_0x5753d1=_0x57134a[0x0][_0x53dd('0x3f')]||0x0;}return dbH[_0x53dd('0x8b')][_0x53dd('0x2f')](_0x3f4f9d[_0x53dd('0x81')](),{'type':dbH['sequelize'][_0x53dd('0x8c')][_0x53dd('0x82')]});})[_0x53dd('0x22')](function(_0x2e2728){return{'rows':_0x2e2728||[],'count':_0x5753d1};});}});}exports[_0x53dd('0xa2')]=function(_0x57d1df,_0x4afc62){return runReport(_0x57d1df['params'],_0x57d1df[_0x53dd('0x2f')],_0x57d1df[_0x53dd('0x3e')])['then'](respondWithResult(_0x4afc62,null))[_0x53dd('0x44')](handleError(_0x4afc62,null));};exports['runReport']=runReport;exports['query']=function(_0x3a9241,_0x430bba){var _0x3cfeb0=0xa;var _0x522cfb=[_0x53dd('0x51'),_0x53dd('0x83'),_0x53dd('0x52'),_0x53dd('0x53')];var _0x54ae4a={'SUM':_0x53dd('0x54'),'COUNT':_0x53dd('0x55'),'COUNT DISTINCT':_0x53dd('0x56'),'MAX':_0x53dd('0x57'),'MIN':'MIN(%s)','AVG':_0x53dd('0x59'),'GROUP_CONCAT':_0x53dd('0x84'),'GROUP_CONCAT ASC':_0x53dd('0x5a'),'GROUP_CONCAT DESC':_0x53dd('0x85')};var _0x49a8a7={'SEC_TO_TIME':_0x53dd('0x86'),'DATE':_0x53dd('0x87'),'HOUR':_0x53dd('0x5b'),'ROUND':_0x53dd('0x5c'),'UNIX_TIMESTAMP':_0x53dd('0x88')};var _0x5f099b=function(_0x3d6d3d){return!_[_0x53dd('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x53dd('0x5f'),'IS\x20NOT\x20EMPTY'],_0x3d6d3d);};var _0x24bcea=function(_0x41f3d9){if(!_0x41f3d9||!_0x41f3d9['rules'][_0x53dd('0x34')]){return'';}for(var _0x22a1cf='(',_0x3d833c=0x0;_0x3d833c<_0x41f3d9[_0x53dd('0x61')]['length'];_0x3d833c+=0x1){_0x3d833c>0x0&&(_0x22a1cf+='\x20'+_0x41f3d9[_0x53dd('0x89')]+'\x20');_0x22a1cf+=_0x41f3d9[_0x53dd('0x61')][_0x3d833c]['group']?_0x24bcea(_0x41f3d9['rules'][_0x3d833c]['group']):_0x41f3d9[_0x53dd('0x61')][_0x3d833c][_0x53dd('0x63')]+'\x20'+_0x41f3d9[_0x53dd('0x61')][_0x3d833c][_0x53dd('0x64')]+(_0x5f099b(_0x41f3d9[_0x53dd('0x61')][_0x3d833c][_0x53dd('0x64')])?'\x20'+_0x41f3d9[_0x53dd('0x61')][_0x3d833c][_0x53dd('0x65')]:'');}return _0x22a1cf+')';};var _0x3eebc2={'where':{'id':_0x3a9241[_0x53dd('0x46')]['id']}},_0x3b8b6e,_0x514efe,_0x285d62,_0x33693e,_0x26decb;_0x3eebc2=_['merge']({},_0x3eebc2,_0x3a9241[_0x53dd('0x3e')]);return db[_0x53dd('0x41')]['find'](_0x3eebc2)[_0x53dd('0x22')](function(_0x416550){if(_0x416550){_0x3b8b6e=_0x416550;return _0x416550[_0x53dd('0x66')]();}return null;})['then'](function(_0x21c0e4){if(_0x21c0e4){if(!_0x21c0e4[_0x53dd('0x34')]){throw new db[(_0x53dd('0x67'))][(_0x53dd('0x68'))](_0x53dd('0x69'),0x193);}_0x514efe=_0x21c0e4;return db[_0x53dd('0x6a')][_0x53dd('0x42')]({'raw':!![]});}return null;})[_0x53dd('0x22')](function(_0xeeb579){if(_0xeeb579){_0x285d62=_['keyBy'](_0xeeb579,'id');var _0x26e3c3;var _0x4877f1=squel['select']();_0x4877f1[_0x53dd('0x6d')](_0x3b8b6e[_0x53dd('0x6e')]);for(var _0x22d6cc=0x0;_0x22d6cc<_0x514efe[_0x53dd('0x34')];_0x22d6cc+=0x1){_0x26e3c3=_0x514efe[_0x22d6cc][_0x53dd('0x6f')]?_0x285d62[_0x514efe[_0x22d6cc][_0x53dd('0x6f')]][_0x53dd('0x70')]:_0x514efe[_0x22d6cc][_0x53dd('0x63')];_0x26e3c3=_0x514efe[_0x22d6cc]['function']?_[_0x53dd('0x72')](_0x54ae4a[_0x514efe[_0x22d6cc][_0x53dd('0x71')]],'%s',_0x26e3c3):_0x26e3c3;_0x26e3c3=_0x514efe[_0x22d6cc]['format']?_[_0x53dd('0x72')](_0x49a8a7[_0x514efe[_0x22d6cc][_0x53dd('0x73')]],'%s',_0x26e3c3):_0x26e3c3;if(_0x514efe[_0x22d6cc]['groupBy']){_0x4877f1[_0x53dd('0x62')](_0x26e3c3);}_0x514efe[_0x22d6cc][_0x53dd('0x75')]&&_0x4877f1['order'](_0x26e3c3,_0x514efe[_0x22d6cc]['orderBy']==='DESC'?![]:!![]);_0x4877f1[_0x53dd('0x63')](_0x26e3c3,_0x514efe[_0x22d6cc][_0x53dd('0x77')]||_0x26e3c3);}if(_0x3b8b6e[_0x53dd('0x78')]){_0x3b8b6e['joins']=JSON[_0x53dd('0x79')](_0x3b8b6e[_0x53dd('0x78')]);for(var _0x404113=0x0;_0x404113<_0x3b8b6e[_0x53dd('0x78')][_0x53dd('0x34')];_0x404113+=0x1){if(_0x3b8b6e[_0x53dd('0x78')][_0x404113]['type']&&_[_0x53dd('0x5d')](_0x522cfb,_0x3b8b6e['joins'][_0x404113]['type'])&&_0x3b8b6e['joins'][_0x404113][_0x53dd('0x7a')]&&_0x3b8b6e[_0x53dd('0x78')][_0x404113]['foreignTable']&&_0x3b8b6e[_0x53dd('0x78')][_0x404113][_0x53dd('0x7c')]){_0x4877f1[_0x3b8b6e[_0x53dd('0x78')][_0x404113][_0x53dd('0x2c')]](_0x3b8b6e['joins'][_0x404113][_0x53dd('0x7b')],null,util[_0x53dd('0x73')]('%s.%s\x20=\x20%s.%s',_0x3b8b6e[_0x53dd('0x6e')],_0x3b8b6e[_0x53dd('0x78')][_0x404113][_0x53dd('0x7a')],_0x3b8b6e[_0x53dd('0x78')][_0x404113][_0x53dd('0x7b')],_0x3b8b6e['joins'][_0x404113][_0x53dd('0x7c')]));}}}if(_0x3b8b6e['conditions']){_0x3b8b6e[_0x53dd('0x7e')]=JSON[_0x53dd('0x79')](_0x3b8b6e[_0x53dd('0x7e')]);_0x4877f1[_0x53dd('0x38')](_0x24bcea(_0x3b8b6e[_0x53dd('0x7e')][_0x53dd('0x62')]));}_0x26decb=_0x4877f1[_0x53dd('0x7f')]();_0x4877f1[_0x53dd('0x1d')](_0x3cfeb0);_0x4877f1[_0x53dd('0x1c')](0x0);logger['debug'](_0x53dd('0x8a'),_0x4877f1[_0x53dd('0x81')]());return db[_0x53dd('0x8b')][_0x53dd('0x2f')](_0x4877f1[_0x53dd('0x81')](),{'type':db[_0x53dd('0x8b')]['QueryTypes']['SELECT']});}})['then'](function(){return{'sql':_0x26decb['toString']()};})[_0x53dd('0x22')](respondWithResult(_0x430bba,null))[_0x53dd('0x44')](handleError(_0x430bba,null));};
\ No newline at end of file
index f27626a..2df5e1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53a8=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','api','moment','bluebird'];(function(_0x344128,_0x9b9e88){var _0x693fae=function(_0x3e2b2e){while(--_0x3e2b2e){_0x344128['push'](_0x344128['shift']());}};_0x693fae(++_0x9b9e88);}(_0x53a8,0xa5));var _0x853a=function(_0x2577d4,_0x3a5e96){_0x2577d4=_0x2577d4-0x0;var _0x3f53fd=_0x53a8[_0x2577d4];return _0x3f53fd;};'use strict';var _=require(_0x853a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x853a('0x1'));var moment=require(_0x853a('0x2'));var BPromise=require(_0x853a('0x3'));var rp=require(_0x853a('0x4'));var fs=require('fs');var path=require(_0x853a('0x5'));var rimraf=require(_0x853a('0x6'));var config=require(_0x853a('0x7'));var attributes=require(_0x853a('0x8'));module[_0x853a('0x9')]=function(_0x363be6,_0x5a7de0){return _0x363be6[_0x853a('0xa')](_0x853a('0xb'),attributes,{'tableName':_0x853a('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc43b=['bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xc43b,0x134));var _0xbc43=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc43b[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xbc43('0x0'));var util=require(_0xbc43('0x1'));var logger=require(_0xbc43('0x2'))('api');var moment=require(_0xbc43('0x3'));var BPromise=require(_0xbc43('0x4'));var rp=require(_0xbc43('0x5'));var fs=require('fs');var path=require(_0xbc43('0x6'));var rimraf=require(_0xbc43('0x7'));var config=require('../../config/environment');var attributes=require(_0xbc43('0x8'));module[_0xbc43('0x9')]=function(_0xef4017,_0x145c05){return _0xef4017[_0xbc43('0xa')](_0xbc43('0xb'),attributes,{'tableName':_0xbc43('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2738b62..639a545 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6beb=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x3bb280,_0x516ad5){var _0xa15601=function(_0x555604){while(--_0x555604){_0x3bb280['push'](_0x3bb280['shift']());}};_0xa15601(++_0x516ad5);}(_0x6beb,0x1a1));var _0xb6be=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6beb[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xb6be('0x0'));var moment=require(_0xb6be('0x1'));var BPromise=require(_0xb6be('0x2'));var rs=require(_0xb6be('0x3'));var fs=require('fs');var Redis=require(_0xb6be('0x4'));var db=require(_0xb6be('0x5'))['db'];var utils=require(_0xb6be('0x6'));var logger=require(_0xb6be('0x7'))(_0xb6be('0x8'));var config=require(_0xb6be('0x9'));var jayson=require(_0xb6be('0xa'));var client=jayson[_0xb6be('0xb')][_0xb6be('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42f466,_0x388cd3,_0x5d7f13){return new BPromise(function(_0x43bc30,_0x29ca02){return client[_0xb6be('0xd')](_0x42f466,_0x5d7f13)[_0xb6be('0xe')](function(_0x747bbc){logger[_0xb6be('0xf')](_0xb6be('0x10'),_0x388cd3,'request\x20sent');logger[_0xb6be('0x11')](_0xb6be('0x12'),_0x388cd3,_0xb6be('0x13'),JSON[_0xb6be('0x14')](_0x747bbc));if(_0x747bbc[_0xb6be('0x15')]){if(_0x747bbc[_0xb6be('0x15')][_0xb6be('0x16')]===0x1f4){logger[_0xb6be('0x15')](_0xb6be('0x10'),_0x388cd3,_0x747bbc[_0xb6be('0x15')][_0xb6be('0x17')]);return _0x29ca02(_0x747bbc['error']['message']);}logger[_0xb6be('0x15')](_0xb6be('0x10'),_0x388cd3,_0x747bbc[_0xb6be('0x15')][_0xb6be('0x17')]);return _0x43bc30(_0x747bbc[_0xb6be('0x15')][_0xb6be('0x17')]);}else{logger[_0xb6be('0xf')](_0xb6be('0x10'),_0x388cd3,_0xb6be('0x13'));_0x43bc30(_0x747bbc[_0xb6be('0x18')][_0xb6be('0x17')]);}})[_0xb6be('0x19')](function(_0x4aa92f){logger[_0xb6be('0x15')](_0xb6be('0x10'),_0x388cd3,_0x4aa92f);_0x29ca02(_0x4aa92f);});});}
\ No newline at end of file
+var _0xd9cb=['../../config/logger','../../config/environment','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x471103,_0xcaed26){var _0x4e39d0=function(_0x1e221f){while(--_0x1e221f){_0x471103['push'](_0x471103['shift']());}};_0x4e39d0(++_0xcaed26);}(_0xd9cb,0x112));var _0xbd9c=function(_0x5842ed,_0x3d858c){_0x5842ed=_0x5842ed-0x0;var _0x5312c7=_0xd9cb[_0x5842ed];return _0x5312c7;};'use strict';var _=require(_0xbd9c('0x0'));var util=require('util');var moment=require(_0xbd9c('0x1'));var BPromise=require(_0xbd9c('0x2'));var rs=require(_0xbd9c('0x3'));var fs=require('fs');var Redis=require(_0xbd9c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbd9c('0x5'));var logger=require(_0xbd9c('0x6'))('rpc');var config=require(_0xbd9c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbd9c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x368979,_0x380310,_0x7c50c7){return new BPromise(function(_0x3a507a,_0x48bc8a){return client[_0xbd9c('0x9')](_0x368979,_0x7c50c7)[_0xbd9c('0xa')](function(_0x1c00d4){logger['info'](_0xbd9c('0xb'),_0x380310,_0xbd9c('0xc'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x380310,_0xbd9c('0xc'),JSON[_0xbd9c('0xd')](_0x1c00d4));if(_0x1c00d4[_0xbd9c('0xe')]){if(_0x1c00d4['error'][_0xbd9c('0xf')]===0x1f4){logger[_0xbd9c('0xe')](_0xbd9c('0xb'),_0x380310,_0x1c00d4[_0xbd9c('0xe')][_0xbd9c('0x10')]);return _0x48bc8a(_0x1c00d4[_0xbd9c('0xe')][_0xbd9c('0x10')]);}logger['error'](_0xbd9c('0xb'),_0x380310,_0x1c00d4[_0xbd9c('0xe')][_0xbd9c('0x10')]);return _0x3a507a(_0x1c00d4[_0xbd9c('0xe')][_0xbd9c('0x10')]);}else{logger[_0xbd9c('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x380310,_0xbd9c('0xc'));_0x3a507a(_0x1c00d4[_0xbd9c('0x12')][_0xbd9c('0x10')]);}})[_0xbd9c('0x13')](function(_0x423636){logger[_0xbd9c('0xe')](_0xbd9c('0xb'),_0x380310,_0x423636);_0x48bc8a(_0x423636);});});}
\ No newline at end of file
index c43c498..4deae20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf54=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','delete','destroy','exports'];(function(_0xa941cd,_0x4cd8c4){var _0x429f5b=function(_0x301141){while(--_0x301141){_0xa941cd['push'](_0xa941cd['shift']());}};_0x429f5b(++_0x4cd8c4);}(_0xdf54,0x1c2));var _0x4df5=function(_0x1916b3,_0x536071){_0x1916b3=_0x1916b3-0x0;var _0x57b327=_0xdf54[_0x1916b3];return _0x57b327;};'use strict';var multer=require(_0x4df5('0x0'));var util=require(_0x4df5('0x1'));var path=require(_0x4df5('0x2'));var timeout=require('connect-timeout');var express=require(_0x4df5('0x3'));var router=express[_0x4df5('0x4')]();var auth=require(_0x4df5('0x5'));var interaction=require(_0x4df5('0x6'));var config=require(_0x4df5('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x4df5('0x8')]('/',auth[_0x4df5('0x9')](),controller[_0x4df5('0xa')]);router[_0x4df5('0x8')](_0x4df5('0xb'),auth[_0x4df5('0x9')](),controller[_0x4df5('0xc')]);router[_0x4df5('0x8')](_0x4df5('0xd'),auth[_0x4df5('0x9')](),controller[_0x4df5('0xe')]);router[_0x4df5('0x8')]('/:id/run',auth[_0x4df5('0x9')](),controller[_0x4df5('0xf')]);router[_0x4df5('0x8')](_0x4df5('0x10'),auth[_0x4df5('0x9')](),controller[_0x4df5('0x11')]);router[_0x4df5('0x12')]('/',auth['isAuthenticated'](),controller[_0x4df5('0x13')]);router[_0x4df5('0x14')](_0x4df5('0xb'),auth[_0x4df5('0x9')](),controller[_0x4df5('0x15')]);router[_0x4df5('0x16')](_0x4df5('0xb'),auth['isAuthenticated'](),controller[_0x4df5('0x17')]);module[_0x4df5('0x18')]=router;
\ No newline at end of file
+var _0x22a8=['/:id','show','/:id/preview','preview','get','/:id/run','run','query','post','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','isAuthenticated'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x22a8,0x1d4));var _0x822a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x22a8[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x822a('0x0'));var util=require('util');var path=require(_0x822a('0x1'));var timeout=require(_0x822a('0x2'));var express=require(_0x822a('0x3'));var router=express['Router']();var auth=require(_0x822a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x822a('0x5'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0x822a('0x6')](),controller['index']);router['get'](_0x822a('0x7'),auth[_0x822a('0x6')](),controller[_0x822a('0x8')]);router['get'](_0x822a('0x9'),auth['isAuthenticated'](),controller[_0x822a('0xa')]);router[_0x822a('0xb')](_0x822a('0xc'),auth[_0x822a('0x6')](),controller[_0x822a('0xd')]);router['get']('/:id/query',auth[_0x822a('0x6')](),controller[_0x822a('0xe')]);router[_0x822a('0xf')]('/',auth[_0x822a('0x6')](),controller['create']);router['put'](_0x822a('0x7'),auth[_0x822a('0x6')](),controller[_0x822a('0x10')]);router['delete']('/:id',auth[_0x822a('0x6')](),controller[_0x822a('0x11')]);module[_0x822a('0x12')]=router;
\ No newline at end of file
index bd8281a..1bb03c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b46=['STRING','TEXT','sequelize','exports'];(function(_0x58acd7,_0x2e44ad){var _0x590fba=function(_0x3007b2){while(--_0x3007b2){_0x58acd7['push'](_0x58acd7['shift']());}};_0x590fba(++_0x2e44ad);}(_0x7b46,0x17e));var _0x67b4=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x7b46[_0x102e37];return _0x35a07c;};'use strict';var Sequelize=require(_0x67b4('0x0'));module[_0x67b4('0x1')]={'name':{'type':Sequelize[_0x67b4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x67b4('0x2')]},'parent':{'type':Sequelize[_0x67b4('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x67b4('0x3')]}};
\ No newline at end of file
+var _0xb401=['STRING','TEXT','sequelize','exports'];(function(_0x5cb139,_0x1a5f77){var _0x816e2b=function(_0x1ad50f){while(--_0x1ad50f){_0x5cb139['push'](_0x5cb139['shift']());}};_0x816e2b(++_0x1a5f77);}(_0xb401,0x136));var _0x1b40=function(_0x3e9d63,_0x375e22){_0x3e9d63=_0x3e9d63-0x0;var _0x4e357e=_0xb401[_0x3e9d63];return _0x4e357e;};'use strict';var Sequelize=require(_0x1b40('0x0'));module[_0x1b40('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1b40('0x2')]},'parent':{'type':Sequelize[_0x1b40('0x2')]},'table':{'type':Sequelize[_0x1b40('0x2')]},'conditions':{'type':Sequelize[_0x1b40('0x3')]},'joins':{'type':Sequelize[_0x1b40('0x3')]}};
\ No newline at end of file
index 52f8937..66cccf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdab6=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','dbH','status','json','count','offset','limit','set','reject','save','update','destroy','UserProfileResource','then','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','get','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%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)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','cross_join','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','groupBy','DESC','parentKey','SELECT','No\x20available\x20data','output','web','%s-%s.%s','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','COUNT(%s)','operator','metric','%s.%s\x20=\x20%s.%s','html-pdf','eml-format','rimraf'];(function(_0x47aca7,_0x146518){var _0x524aef=function(_0x3ddac1){while(--_0x3ddac1){_0x47aca7['push'](_0x47aca7['shift']());}};_0x524aef(++_0x146518);}(_0xdab6,0x153));var _0x6dab=function(_0x2d243f,_0x47aba5){_0x2d243f=_0x2d243f-0x0;var _0x53c2cf=_0xdab6[_0x2d243f];return _0x53c2cf;};'use strict';var pdf=require(_0x6dab('0x0'));var emlformat=require(_0x6dab('0x1'));var rimraf=require(_0x6dab('0x2'));var zipdir=require(_0x6dab('0x3'));var jsonpatch=require(_0x6dab('0x4'));var rp=require(_0x6dab('0x5'));var moment=require(_0x6dab('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x6dab('0x7'));var util=require(_0x6dab('0x8'));var path=require(_0x6dab('0x9'));var sox=require(_0x6dab('0xa'));var csv=require(_0x6dab('0xb'));var ejs=require(_0x6dab('0xc'));var fs=require('fs');var _=require(_0x6dab('0xd'));var squel=require('squel');var crypto=require(_0x6dab('0xe'));var jsforce=require(_0x6dab('0xf'));var deskjs=require(_0x6dab('0x10'));var toCsv=require(_0x6dab('0xb'));var querystring=require(_0x6dab('0x11'));var Papa=require(_0x6dab('0x12'));var Redis=require(_0x6dab('0x13'));var authService=require(_0x6dab('0x14'));var qs=require(_0x6dab('0x15'));var as=require(_0x6dab('0x16'));var hardwareService=require(_0x6dab('0x17'));var logger=require(_0x6dab('0x18'))(_0x6dab('0x19'));var utils=require('../../config/utils');var config=require(_0x6dab('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require(_0x6dab('0x1b'))[_0x6dab('0x1c')];function respondWithStatusCode(_0x51d444,_0x51afa2){_0x51afa2=_0x51afa2||0xcc;return function(_0x327e76){if(_0x327e76){return _0x51d444['sendStatus'](_0x51afa2);}return _0x51d444[_0x6dab('0x1d')](_0x51afa2)['end']();};}function respondWithResult(_0xc14b45,_0x511d72){_0x511d72=_0x511d72||0xc8;return function(_0x4ec34d){if(_0x4ec34d){return _0xc14b45[_0x6dab('0x1d')](_0x511d72)[_0x6dab('0x1e')](_0x4ec34d);}};}function respondWithFilteredResult(_0x140d2a,_0x5f5d9e){return function(_0xf11c22){if(_0xf11c22){var _0x5bcb8c=_0xf11c22[_0x6dab('0x1f')],_0xa4ac33=_0x5f5d9e[_0x6dab('0x20')],_0x3dfd90=_0x5f5d9e[_0x6dab('0x20')]+_0x5f5d9e[_0x6dab('0x21')],_0x1e416f;if(_0x3dfd90>=_0x5bcb8c){_0x3dfd90=_0x5bcb8c;_0x1e416f=0xc8;}else{_0x1e416f=0xce;}_0x140d2a[_0x6dab('0x1d')](_0x1e416f);return _0x140d2a[_0x6dab('0x22')]('Content-Range',_0xa4ac33+'-'+_0x3dfd90+'/'+_0x5bcb8c)[_0x6dab('0x1e')](_0xf11c22);}return null;};}function patchUpdates(_0x36ee1c){return function(_0x2236db){try{jsonpatch['apply'](_0x2236db,_0x36ee1c,!![]);}catch(_0x153b73){return BPromise[_0x6dab('0x23')](_0x153b73);}return _0x2236db[_0x6dab('0x24')]();};}function saveUpdates(_0x240d1d,_0x4a4f60){return function(_0x444c68){if(_0x444c68){return _0x444c68[_0x6dab('0x25')](_0x240d1d)['then'](function(_0x1c8f27){return _0x1c8f27;});}return null;};}function removeEntity(_0x58b8a2,_0x2d6ea3){return function(_0x2a2afc){if(_0x2a2afc){return _0x2a2afc[_0x6dab('0x26')]()['then'](function(){var _0x49a14a=_0x2a2afc['get']({'plain':!![]});var _0x3d0569='DefaultReports';return db[_0x6dab('0x27')][_0x6dab('0x26')]({'where':{'type':_0x3d0569,'resourceId':_0x49a14a['id']}})[_0x6dab('0x28')](function(){return _0x2a2afc;});})[_0x6dab('0x28')](function(){_0x58b8a2[_0x6dab('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x169cd0,_0x4bba45){return function(_0x3d7d0e){if(!_0x3d7d0e){_0x169cd0[_0x6dab('0x29')](0x194);}return _0x3d7d0e;};}function handleError(_0x2bfac7,_0x4e75ca){_0x4e75ca=_0x4e75ca||0x1f4;return function(_0xacb2d3){logger[_0x6dab('0x2a')](_0xacb2d3[_0x6dab('0x2b')]);if(_0xacb2d3[_0x6dab('0x2c')]){delete _0xacb2d3[_0x6dab('0x2c')];}_0x2bfac7[_0x6dab('0x1d')](_0x4e75ca)[_0x6dab('0x2d')](_0xacb2d3);};}exports[_0x6dab('0x2e')]=function(_0x2c017b,_0x5eeec8){var _0x473d3e={},_0x3d7ce8={},_0x4b118b={'count':0x0,'rows':[]};var _0x28aede=_[_0x6dab('0x2f')](db[_0x6dab('0x30')]['rawAttributes'],function(_0x1120d3){return{'name':_0x1120d3[_0x6dab('0x31')],'type':_0x1120d3[_0x6dab('0x32')][_0x6dab('0x33')]};});_0x3d7ce8['model']=_['map'](_0x28aede,'name');_0x3d7ce8[_0x6dab('0x34')]=_[_0x6dab('0x35')](_0x2c017b[_0x6dab('0x34')]);_0x3d7ce8[_0x6dab('0x36')]=_[_0x6dab('0x37')](_0x3d7ce8[_0x6dab('0x38')],_0x3d7ce8['query']);_0x473d3e[_0x6dab('0x39')]=_[_0x6dab('0x37')](_0x3d7ce8[_0x6dab('0x38')],qs[_0x6dab('0x3a')](_0x2c017b[_0x6dab('0x34')][_0x6dab('0x3a')]));_0x473d3e[_0x6dab('0x39')]=_0x473d3e[_0x6dab('0x39')][_0x6dab('0x3b')]?_0x473d3e[_0x6dab('0x39')]:_0x3d7ce8[_0x6dab('0x38')];if(!_0x2c017b[_0x6dab('0x34')][_0x6dab('0x3c')](_0x6dab('0x3d'))){_0x473d3e['limit']=qs[_0x6dab('0x21')](_0x2c017b['query'][_0x6dab('0x21')]);_0x473d3e[_0x6dab('0x20')]=qs['offset'](_0x2c017b[_0x6dab('0x34')]['offset']);}_0x473d3e[_0x6dab('0x3e')]=qs['sort'](_0x2c017b[_0x6dab('0x34')][_0x6dab('0x3f')]);_0x473d3e[_0x6dab('0x40')]=qs['filters'](_[_0x6dab('0x41')](_0x2c017b[_0x6dab('0x34')],_0x3d7ce8['filters']),_0x28aede);if(_0x2c017b['query'][_0x6dab('0x42')]){_0x473d3e['where']=_[_0x6dab('0x43')](_0x473d3e[_0x6dab('0x40')],{'$or':_[_0x6dab('0x2f')](_0x28aede,function(_0x35213c){if(_0x35213c[_0x6dab('0x32')]!==_0x6dab('0x44')){var _0x503178={};_0x503178[_0x35213c['name']]={'$like':'%'+_0x2c017b['query'][_0x6dab('0x42')]+'%'};return _0x503178;}})});}_0x473d3e=_[_0x6dab('0x43')]({},_0x473d3e,_0x2c017b[_0x6dab('0x45')]);var _0x2b0aa8={'where':_0x473d3e[_0x6dab('0x40')]};return db[_0x6dab('0x30')][_0x6dab('0x1f')](_0x2b0aa8)[_0x6dab('0x28')](function(_0x2dcc8f){_0x4b118b[_0x6dab('0x1f')]=_0x2dcc8f;if(_0x2c017b[_0x6dab('0x34')][_0x6dab('0x46')]){_0x473d3e[_0x6dab('0x47')]=[{'all':!![]}];}return db[_0x6dab('0x30')][_0x6dab('0x48')](_0x473d3e);})[_0x6dab('0x28')](function(_0x22a73d){_0x4b118b[_0x6dab('0x49')]=_0x22a73d;return _0x4b118b;})[_0x6dab('0x28')](respondWithFilteredResult(_0x5eeec8,_0x473d3e))['catch'](handleError(_0x5eeec8,null));};exports[_0x6dab('0x4a')]=function(_0xcfc9c2,_0x48563f){var _0x42e352={'raw':!![],'where':{'id':_0xcfc9c2[_0x6dab('0x4b')]['id']}},_0x5e69a0={};_0x5e69a0[_0x6dab('0x38')]=_[_0x6dab('0x35')](db[_0x6dab('0x30')][_0x6dab('0x4c')]);_0x5e69a0['query']=_[_0x6dab('0x35')](_0xcfc9c2[_0x6dab('0x34')]);_0x5e69a0[_0x6dab('0x36')]=_[_0x6dab('0x37')](_0x5e69a0[_0x6dab('0x38')],_0x5e69a0['query']);_0x42e352[_0x6dab('0x39')]=_[_0x6dab('0x37')](_0x5e69a0[_0x6dab('0x38')],qs[_0x6dab('0x3a')](_0xcfc9c2[_0x6dab('0x34')][_0x6dab('0x3a')]));_0x42e352[_0x6dab('0x39')]=_0x42e352[_0x6dab('0x39')][_0x6dab('0x3b')]?_0x42e352[_0x6dab('0x39')]:_0x5e69a0[_0x6dab('0x38')];if(_0xcfc9c2[_0x6dab('0x34')][_0x6dab('0x46')]){_0x42e352[_0x6dab('0x47')]=[{'all':!![]}];}_0x42e352=_[_0x6dab('0x43')]({},_0x42e352,_0xcfc9c2[_0x6dab('0x45')]);return db[_0x6dab('0x30')][_0x6dab('0x4d')](_0x42e352)[_0x6dab('0x28')](handleEntityNotFound(_0x48563f,null))[_0x6dab('0x28')](respondWithResult(_0x48563f,null))['catch'](handleError(_0x48563f,null));};exports[_0x6dab('0x4e')]=function(_0x4f2066,_0x4ed878){return db[_0x6dab('0x30')][_0x6dab('0x4e')](_0x4f2066[_0x6dab('0x4f')],{})[_0x6dab('0x28')](function(_0x4434a9){var _0x53b259=_0x4f2066['user'][_0x6dab('0x50')]({'plain':!![]});if(!_0x53b259)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53b259[_0x6dab('0x51')]===_0x6dab('0x52')){var _0x530be4=_0x4434a9[_0x6dab('0x50')]({'plain':!![]});var _0x357948=_0x6dab('0x53');return db[_0x6dab('0x54')]['find']({'where':{'name':_0x357948,'userProfileId':_0x53b259[_0x6dab('0x55')]},'raw':!![]})[_0x6dab('0x28')](function(_0x76170e){if(_0x76170e&&_0x76170e[_0x6dab('0x56')]===0x0){return db[_0x6dab('0x27')]['create']({'name':_0x530be4['name'],'resourceId':_0x530be4['id'],'type':'DefaultReports','sectionId':_0x76170e['id']},{})[_0x6dab('0x28')](function(){return _0x4434a9;});}else{return _0x4434a9;}})[_0x6dab('0x57')](function(_0x22a382){logger[_0x6dab('0x2a')](_0x6dab('0x58'),_0x22a382);throw _0x22a382;});}return _0x4434a9;})[_0x6dab('0x28')](respondWithResult(_0x4ed878,0xc9))[_0x6dab('0x57')](handleError(_0x4ed878,null));};exports[_0x6dab('0x25')]=function(_0x5a682b,_0x8b181c){if(_0x5a682b[_0x6dab('0x4f')]['id']){delete _0x5a682b['body']['id'];}return db['AnalyticDefaultReport']['find']({'where':{'id':_0x5a682b[_0x6dab('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8b181c,null))[_0x6dab('0x28')](saveUpdates(_0x5a682b['body'],null))[_0x6dab('0x28')](respondWithResult(_0x8b181c,null))[_0x6dab('0x57')](handleError(_0x8b181c,null));};exports['destroy']=function(_0x1de637,_0x3a5c0b){return db['AnalyticDefaultReport'][_0x6dab('0x4d')]({'where':{'id':_0x1de637['params']['id']}})[_0x6dab('0x28')](handleEntityNotFound(_0x3a5c0b,null))['then'](removeEntity(_0x3a5c0b,null))[_0x6dab('0x57')](handleError(_0x3a5c0b,null));};exports[_0x6dab('0x59')]=function(_0x5b11ff,_0x3f5144){var _0x1282af=0xa;var _0x3235c8=[_0x6dab('0x5a'),_0x6dab('0x5b'),_0x6dab('0x5c'),'cross_join'];var _0x192f14={'SUM':_0x6dab('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6dab('0x5e'),'MAX':'MAX(%s)','MIN':_0x6dab('0x5f'),'AVG':_0x6dab('0x60'),'GROUP_CONCAT':_0x6dab('0x61'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6dab('0x62')};var _0x4cc1a7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6dab('0x63'),'HOUR':_0x6dab('0x64'),'ROUND':_0x6dab('0x65'),'UNIX_TIMESTAMP':_0x6dab('0x66')};var _0x36cb02=function(_0x4b3bf1){return!_[_0x6dab('0x67')]([_0x6dab('0x68'),_0x6dab('0x69'),_0x6dab('0x6a'),'IS\x20NOT\x20EMPTY'],_0x4b3bf1);};var _0x3a5df3=function(_0x3efe8f){if(!_0x3efe8f||!_0x3efe8f[_0x6dab('0x6b')][_0x6dab('0x3b')]){return'';}for(var _0x5744a7='(',_0x47180f=0x0;_0x47180f<_0x3efe8f['rules']['length'];_0x47180f+=0x1){_0x47180f>0x0&&(_0x5744a7+='\x20'+_0x3efe8f['operator']+'\x20');_0x5744a7+=_0x3efe8f[_0x6dab('0x6b')][_0x47180f][_0x6dab('0x6c')]?_0x3a5df3(_0x3efe8f[_0x6dab('0x6b')][_0x47180f][_0x6dab('0x6c')]):_0x3efe8f['rules'][_0x47180f][_0x6dab('0x6d')]+'\x20'+_0x3efe8f[_0x6dab('0x6b')][_0x47180f][_0x6dab('0x6e')]+(_0x36cb02(_0x3efe8f[_0x6dab('0x6b')][_0x47180f]['condition'])?'\x20'+_0x3efe8f[_0x6dab('0x6b')][_0x47180f][_0x6dab('0x6f')]:'');}return _0x5744a7+')';};var _0x5b2960={'where':{'id':_0x5b11ff['params']['id']}},_0x2d1f6f,_0x3195f7,_0x2eada2,_0x4f8186,_0x27a479;_0x5b2960=_[_0x6dab('0x43')]({},_0x5b2960,_0x5b11ff[_0x6dab('0x45')]);return db[_0x6dab('0x30')][_0x6dab('0x4d')](_0x5b2960)[_0x6dab('0x28')](function(_0x1990c6){if(_0x1990c6){_0x2d1f6f=_0x1990c6;return _0x1990c6[_0x6dab('0x70')]();}return null;})['then'](function(_0x2339da){if(_0x2339da){if(!_0x2339da[_0x6dab('0x3b')]){throw new db[(_0x6dab('0x71'))]['ValidationErrorItem'](_0x6dab('0x72'),0x193);}_0x3195f7=_0x2339da;return db[_0x6dab('0x73')]['findAll']({'raw':!![]});}return null;})[_0x6dab('0x28')](function(_0x3168f7){if(_0x3168f7){_0x2eada2=_[_0x6dab('0x74')](_0x3168f7,'id');var _0x23683b;var _0x3e67c5=squel[_0x6dab('0x75')]();_0x3e67c5[_0x6dab('0x76')](_0x2d1f6f[_0x6dab('0x77')]);for(var _0x464d51=0x0;_0x464d51<_0x3195f7[_0x6dab('0x3b')];_0x464d51+=0x1){_0x23683b=_0x3195f7[_0x464d51][_0x6dab('0x78')]?_0x2eada2[_0x3195f7[_0x464d51][_0x6dab('0x78')]]['metric']:_0x3195f7[_0x464d51]['field'];_0x23683b=_0x3195f7[_0x464d51][_0x6dab('0x79')]?_[_0x6dab('0x7a')](_0x192f14[_0x3195f7[_0x464d51][_0x6dab('0x79')]],'%s',_0x23683b):_0x23683b;_0x23683b=_0x3195f7[_0x464d51]['format']?_[_0x6dab('0x7a')](_0x4cc1a7[_0x3195f7[_0x464d51][_0x6dab('0x7b')]],'%s',_0x23683b):_0x23683b;if(_0x3195f7[_0x464d51]['groupBy']){_0x3e67c5[_0x6dab('0x6c')](_0x23683b);}_0x3195f7[_0x464d51][_0x6dab('0x7c')]&&_0x3e67c5[_0x6dab('0x3e')](_0x23683b,_0x3195f7[_0x464d51][_0x6dab('0x7c')]==='DESC'?![]:!![]);_0x3e67c5[_0x6dab('0x6d')](_0x23683b,_0x3195f7[_0x464d51][_0x6dab('0x7d')]||_0x23683b);}if(_0x2d1f6f[_0x6dab('0x7e')]){_0x2d1f6f[_0x6dab('0x7e')]=JSON[_0x6dab('0x7f')](_0x2d1f6f['joins']);for(var _0x472719=0x0;_0x472719<_0x2d1f6f['joins'][_0x6dab('0x3b')];_0x472719+=0x1){if(_0x2d1f6f[_0x6dab('0x7e')][_0x472719][_0x6dab('0x32')]&&_[_0x6dab('0x67')](_0x3235c8,_0x2d1f6f[_0x6dab('0x7e')][_0x472719][_0x6dab('0x32')])&&_0x2d1f6f[_0x6dab('0x7e')][_0x472719]['parentKey']&&_0x2d1f6f[_0x6dab('0x7e')][_0x472719]['foreignTable']&&_0x2d1f6f[_0x6dab('0x7e')][_0x472719]['foreignKey']){_0x3e67c5[_0x2d1f6f[_0x6dab('0x7e')][_0x472719][_0x6dab('0x32')]](_0x2d1f6f[_0x6dab('0x7e')][_0x472719][_0x6dab('0x80')],null,util[_0x6dab('0x7b')]('%s.%s\x20=\x20%s.%s',_0x2d1f6f['table'],_0x2d1f6f[_0x6dab('0x7e')][_0x472719]['parentKey'],_0x2d1f6f[_0x6dab('0x7e')][_0x472719][_0x6dab('0x80')],_0x2d1f6f[_0x6dab('0x7e')][_0x472719][_0x6dab('0x81')]));}}}if(_0x2d1f6f[_0x6dab('0x82')]){_0x2d1f6f[_0x6dab('0x82')]=JSON[_0x6dab('0x7f')](_0x2d1f6f[_0x6dab('0x82')]);_0x3e67c5[_0x6dab('0x40')](_0x3a5df3(_0x2d1f6f[_0x6dab('0x82')][_0x6dab('0x6c')]));}_0x27a479=_0x3e67c5[_0x6dab('0x83')]();_0x3e67c5[_0x6dab('0x21')](_0x1282af);_0x3e67c5['offset'](0x0);logger[_0x6dab('0x84')](_0x6dab('0x85'),_0x3e67c5[_0x6dab('0x86')]());return db['sequelize']['query'](_0x3e67c5[_0x6dab('0x86')](),{'type':db[_0x6dab('0x87')][_0x6dab('0x88')]['SELECT']});}})[_0x6dab('0x28')](respondWithResult(_0x3f5144,null))[_0x6dab('0x57')](handleError(_0x3f5144,null));};function runReport(_0x354408,_0x38dd3f,_0x56b247){var _0x10db44=_0x38dd3f[_0x6dab('0x2c')];var _0x197c0f=0xa;var _0x4e8ab4=['join','left_join',_0x6dab('0x5c'),_0x6dab('0x89')];var _0x5a1332={'SUM':_0x6dab('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6dab('0x5e'),'MAX':_0x6dab('0x8a'),'MIN':_0x6dab('0x5f'),'AVG':_0x6dab('0x60'),'GROUP_CONCAT':_0x6dab('0x61'),'GROUP_CONCAT ASC':_0x6dab('0x8b'),'GROUP_CONCAT DESC':_0x6dab('0x62')};var _0x5614b7={'SEC_TO_TIME':_0x6dab('0x8c'),'DATE':_0x6dab('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x6dab('0x65'),'UNIX_TIMESTAMP':_0x6dab('0x66')};var _0x2eb14c=function(_0x2e26fd){return!_[_0x6dab('0x67')](['IS\x20NULL',_0x6dab('0x69'),_0x6dab('0x6a'),_0x6dab('0x8d')],_0x2e26fd);};var _0x3d1485=function(_0x282aa9){if(!_0x282aa9||!_0x282aa9['rules']['length']){return'';}for(var _0x14e7d4='(',_0x121b8e=0x0;_0x121b8e<_0x282aa9['rules'][_0x6dab('0x3b')];_0x121b8e+=0x1){_0x121b8e>0x0&&(_0x14e7d4+='\x20'+_0x282aa9['operator']+'\x20');_0x14e7d4+=_0x282aa9['rules'][_0x121b8e][_0x6dab('0x6c')]?_0x3d1485(_0x282aa9[_0x6dab('0x6b')][_0x121b8e]['group']):_0x282aa9[_0x6dab('0x6b')][_0x121b8e][_0x6dab('0x6d')]+'\x20'+_0x282aa9[_0x6dab('0x6b')][_0x121b8e][_0x6dab('0x6e')]+(_0x2eb14c(_0x282aa9['rules'][_0x121b8e][_0x6dab('0x6e')])?'\x20'+_0x282aa9[_0x6dab('0x6b')][_0x121b8e]['value']:'');}return _0x14e7d4+')';};var _0x49c3da={'where':{'id':_0x354408['id']}},_0x4ba271,_0x7036a7,_0x4f1108,_0x2a4fd3,_0x48412b;_0x49c3da=_['merge']({},_0x49c3da,_0x56b247);return db[_0x6dab('0x30')][_0x6dab('0x4d')](_0x49c3da)[_0x6dab('0x28')](function(_0x520160){if(_0x520160){_0x4ba271=_0x520160;return _0x520160[_0x6dab('0x70')]();}return null;})['then'](function(_0x131b1e){if(_0x131b1e){if(!_0x131b1e[_0x6dab('0x3b')]){throw new db[(_0x6dab('0x71'))][(_0x6dab('0x8e'))](_0x6dab('0x72'),0x193);}_0x7036a7=_0x131b1e;return db['AnalyticMetric'][_0x6dab('0x48')]({'raw':!![]});}return null;})[_0x6dab('0x28')](function(_0x211364){if(_0x211364){_0x4f1108=_[_0x6dab('0x74')](_0x211364,'id');var _0x475e22;var _0x2647fd=squel[_0x6dab('0x75')]();_0x2647fd['from'](_0x4ba271['table']);for(var _0x2ea7bf=0x0;_0x2ea7bf<_0x7036a7['length'];_0x2ea7bf+=0x1){_0x475e22=_0x7036a7[_0x2ea7bf][_0x6dab('0x78')]?_0x4f1108[_0x7036a7[_0x2ea7bf][_0x6dab('0x78')]]['metric']:_0x7036a7[_0x2ea7bf][_0x6dab('0x6d')];_0x475e22=_0x7036a7[_0x2ea7bf]['function']?_['replace'](_0x5a1332[_0x7036a7[_0x2ea7bf][_0x6dab('0x79')]],'%s',_0x475e22):_0x475e22;_0x475e22=_0x7036a7[_0x2ea7bf][_0x6dab('0x7b')]?_[_0x6dab('0x7a')](_0x5614b7[_0x7036a7[_0x2ea7bf][_0x6dab('0x7b')]],'%s',_0x475e22):_0x475e22;if(_0x7036a7[_0x2ea7bf][_0x6dab('0x8f')]){_0x2647fd['group'](_0x475e22);}_0x7036a7[_0x2ea7bf][_0x6dab('0x7c')]&&_0x2647fd[_0x6dab('0x3e')](_0x475e22,_0x7036a7[_0x2ea7bf][_0x6dab('0x7c')]===_0x6dab('0x90')?![]:!![]);_0x2647fd[_0x6dab('0x6d')](_0x475e22,_0x7036a7[_0x2ea7bf][_0x6dab('0x7d')]||_0x475e22);}if(_0x4ba271[_0x6dab('0x7e')]){_0x4ba271[_0x6dab('0x7e')]=JSON[_0x6dab('0x7f')](_0x4ba271[_0x6dab('0x7e')]);for(var _0x3afc96=0x0;_0x3afc96<_0x4ba271[_0x6dab('0x7e')]['length'];_0x3afc96+=0x1){if(_0x4ba271[_0x6dab('0x7e')][_0x3afc96][_0x6dab('0x32')]&&_[_0x6dab('0x67')](_0x4e8ab4,_0x4ba271['joins'][_0x3afc96]['type'])&&_0x4ba271[_0x6dab('0x7e')][_0x3afc96][_0x6dab('0x91')]&&_0x4ba271[_0x6dab('0x7e')][_0x3afc96][_0x6dab('0x80')]&&_0x4ba271[_0x6dab('0x7e')][_0x3afc96][_0x6dab('0x81')]){_0x2647fd[_0x4ba271[_0x6dab('0x7e')][_0x3afc96][_0x6dab('0x32')]](_0x4ba271[_0x6dab('0x7e')][_0x3afc96][_0x6dab('0x80')],null,util[_0x6dab('0x7b')]('%s.%s\x20=\x20%s.%s',_0x4ba271[_0x6dab('0x77')],_0x4ba271[_0x6dab('0x7e')][_0x3afc96]['parentKey'],_0x4ba271[_0x6dab('0x7e')][_0x3afc96]['foreignTable'],_0x4ba271['joins'][_0x3afc96][_0x6dab('0x81')]));}}}if(_0x4ba271[_0x6dab('0x82')]){_0x4ba271[_0x6dab('0x82')]=JSON['parse'](_0x4ba271[_0x6dab('0x82')]);_0x2647fd[_0x6dab('0x40')](_0x3d1485(_0x4ba271['conditions'][_0x6dab('0x6c')]));}_0x48412b=_0x2647fd[_0x6dab('0x83')]();_0x2647fd[_0x6dab('0x21')](_0x197c0f);_0x2647fd['offset'](0x0);logger[_0x6dab('0x84')]('Limited\x20Query:',_0x2647fd[_0x6dab('0x86')]());return db['sequelize'][_0x6dab('0x34')](_0x2647fd[_0x6dab('0x86')](),{'type':db[_0x6dab('0x87')][_0x6dab('0x88')][_0x6dab('0x92')]});}})['then'](function(_0x1a60e3){if(!_0x1a60e3[_0x6dab('0x3b')]){throw new db['Sequelize'][(_0x6dab('0x8e'))](_0x6dab('0x93'),0xcc);}if(_0x38dd3f[_0x6dab('0x94')]===_0x6dab('0x95')){return null;}var _0x3f8aed=_[_0x6dab('0x43')](_0x38dd3f,{'name':_0x38dd3f['fullPath']||_0x38dd3f['name']||_0x4ba271['name'],'basename':_0x10db44,'savename':util[_0x6dab('0x7b')](_0x6dab('0x96'),_0x38dd3f[_0x6dab('0x2c')]||_0x4ba271['name'],require('randomstring')[_0x6dab('0x97')](0x4),_0x38dd3f[_0x6dab('0x94')]||_0x6dab('0x98')),'reportId':_0x4ba271['id'],'reportType':_0x6dab('0x99')});return db['AnalyticExtractedReport']['create'](_0x3f8aed,{'raw':!![]});})[_0x6dab('0x28')](function(_0x5ab518){if(_0x4ba271['table']===_0x6dab('0x9a')){_0x48412b[_0x6dab('0x40')](_0x4ba271[_0x6dab('0x77')]+_0x6dab('0x9b'),_0x38dd3f[_0x6dab('0x9c')],_0x38dd3f['endDate']);}else{_0x48412b[_0x6dab('0x40')](_0x4ba271['table']+_0x6dab('0x9d'),_0x38dd3f[_0x6dab('0x9c')],_0x38dd3f[_0x6dab('0x9e')]);}if(_0x5ab518){logger[_0x6dab('0x9f')](_0x6dab('0xa0'),_0x48412b[_0x6dab('0x86')]());require(_0x6dab('0xa1'))['fork'](path[_0x6dab('0x5a')](__dirname,_0x6dab('0xa2'),_0x5ab518[_0x6dab('0x94')]),[_0x5ab518['id'],_0x48412b[_0x6dab('0x86')](),path[_0x6dab('0x5a')](__dirname,'../../files/reports',_0x5ab518[_0x6dab('0xa3')]),_0x10db44]);return _0x5ab518;}else{var _0x59c00d=squel[_0x6dab('0x75')]();_0x59c00d[_0x6dab('0x76')]('('+_0x48412b[_0x6dab('0x86')]()+')',_0x6dab('0xa4'));_0x59c00d[_0x6dab('0x6d')](_0x6dab('0xa5'),_0x6dab('0x1f'));_0x48412b[_0x6dab('0x21')](_0x38dd3f[_0x6dab('0x21')]||_0x197c0f);_0x48412b[_0x6dab('0x20')](_0x38dd3f['offset']||0x0);return dbH['sequelize'][_0x6dab('0x34')](_0x59c00d[_0x6dab('0x86')](),{'type':dbH['sequelize'][_0x6dab('0x88')][_0x6dab('0x92')]})[_0x6dab('0x28')](function(_0x9ae309){if(!_0x9ae309[_0x6dab('0x3b')]){_0x2a4fd3=0x0;}else{_0x2a4fd3=_0x9ae309[0x0][_0x6dab('0x1f')]||0x0;}return dbH[_0x6dab('0x87')]['query'](_0x48412b[_0x6dab('0x86')](),{'type':dbH[_0x6dab('0x87')][_0x6dab('0x88')][_0x6dab('0x92')]});})['then'](function(_0xa330c3){return{'rows':_0xa330c3||[],'count':_0x2a4fd3};});}});}exports[_0x6dab('0xa6')]=function(_0x5ad86d,_0x23dd6d){return runReport(_0x5ad86d['params'],_0x5ad86d['query'],_0x5ad86d['options'])[_0x6dab('0x28')](respondWithResult(_0x23dd6d,null))['catch'](handleError(_0x23dd6d,null));};exports['runReport']=runReport;exports[_0x6dab('0x34')]=function(_0x56ba2c,_0x53d58f){var _0x271600=0xa;var _0x59aea4=[_0x6dab('0x5a'),_0x6dab('0x5b'),_0x6dab('0x5c'),_0x6dab('0x89')];var _0xafb582={'SUM':'SUM(%s)','COUNT':_0x6dab('0xa7'),'COUNT DISTINCT':_0x6dab('0x5e'),'MAX':'MAX(%s)','MIN':_0x6dab('0x5f'),'AVG':_0x6dab('0x60'),'GROUP_CONCAT':_0x6dab('0x61'),'GROUP_CONCAT ASC':_0x6dab('0x8b'),'GROUP_CONCAT DESC':_0x6dab('0x62')};var _0x4d6b79={'SEC_TO_TIME':_0x6dab('0x8c'),'DATE':_0x6dab('0x63'),'HOUR':_0x6dab('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34ca6d=function(_0x36662d){return!_[_0x6dab('0x67')]([_0x6dab('0x68'),_0x6dab('0x69'),_0x6dab('0x6a'),'IS\x20NOT\x20EMPTY'],_0x36662d);};var _0x416035=function(_0x3f872b){if(!_0x3f872b||!_0x3f872b['rules'][_0x6dab('0x3b')]){return'';}for(var _0xf5714='(',_0xdc5153=0x0;_0xdc5153<_0x3f872b[_0x6dab('0x6b')][_0x6dab('0x3b')];_0xdc5153+=0x1){_0xdc5153>0x0&&(_0xf5714+='\x20'+_0x3f872b[_0x6dab('0xa8')]+'\x20');_0xf5714+=_0x3f872b[_0x6dab('0x6b')][_0xdc5153][_0x6dab('0x6c')]?_0x416035(_0x3f872b[_0x6dab('0x6b')][_0xdc5153][_0x6dab('0x6c')]):_0x3f872b[_0x6dab('0x6b')][_0xdc5153][_0x6dab('0x6d')]+'\x20'+_0x3f872b[_0x6dab('0x6b')][_0xdc5153][_0x6dab('0x6e')]+(_0x34ca6d(_0x3f872b[_0x6dab('0x6b')][_0xdc5153][_0x6dab('0x6e')])?'\x20'+_0x3f872b[_0x6dab('0x6b')][_0xdc5153][_0x6dab('0x6f')]:'');}return _0xf5714+')';};var _0x2bd563={'where':{'id':_0x56ba2c['params']['id']}},_0x54b72a,_0x1962f1,_0xf93e19,_0x5d9636,_0x65f6b8;_0x2bd563=_[_0x6dab('0x43')]({},_0x2bd563,_0x56ba2c[_0x6dab('0x45')]);return db[_0x6dab('0x30')][_0x6dab('0x4d')](_0x2bd563)[_0x6dab('0x28')](function(_0x5b4d80){if(_0x5b4d80){_0x54b72a=_0x5b4d80;return _0x5b4d80[_0x6dab('0x70')]();}return null;})[_0x6dab('0x28')](function(_0x404f1f){if(_0x404f1f){if(!_0x404f1f[_0x6dab('0x3b')]){throw new db[(_0x6dab('0x71'))]['ValidationErrorItem'](_0x6dab('0x72'),0x193);}_0x1962f1=_0x404f1f;return db[_0x6dab('0x73')]['findAll']({'raw':!![]});}return null;})[_0x6dab('0x28')](function(_0x1e4389){if(_0x1e4389){_0xf93e19=_[_0x6dab('0x74')](_0x1e4389,'id');var _0x10a743;var _0x2f9e7a=squel['select']();_0x2f9e7a['from'](_0x54b72a[_0x6dab('0x77')]);for(var _0x21a2db=0x0;_0x21a2db<_0x1962f1[_0x6dab('0x3b')];_0x21a2db+=0x1){_0x10a743=_0x1962f1[_0x21a2db][_0x6dab('0x78')]?_0xf93e19[_0x1962f1[_0x21a2db]['MetricId']][_0x6dab('0xa9')]:_0x1962f1[_0x21a2db][_0x6dab('0x6d')];_0x10a743=_0x1962f1[_0x21a2db][_0x6dab('0x79')]?_[_0x6dab('0x7a')](_0xafb582[_0x1962f1[_0x21a2db][_0x6dab('0x79')]],'%s',_0x10a743):_0x10a743;_0x10a743=_0x1962f1[_0x21a2db][_0x6dab('0x7b')]?_['replace'](_0x4d6b79[_0x1962f1[_0x21a2db]['format']],'%s',_0x10a743):_0x10a743;if(_0x1962f1[_0x21a2db]['groupBy']){_0x2f9e7a['group'](_0x10a743);}_0x1962f1[_0x21a2db][_0x6dab('0x7c')]&&_0x2f9e7a[_0x6dab('0x3e')](_0x10a743,_0x1962f1[_0x21a2db]['orderBy']===_0x6dab('0x90')?![]:!![]);_0x2f9e7a[_0x6dab('0x6d')](_0x10a743,_0x1962f1[_0x21a2db][_0x6dab('0x7d')]||_0x10a743);}if(_0x54b72a[_0x6dab('0x7e')]){_0x54b72a[_0x6dab('0x7e')]=JSON[_0x6dab('0x7f')](_0x54b72a[_0x6dab('0x7e')]);for(var _0x14123b=0x0;_0x14123b<_0x54b72a[_0x6dab('0x7e')]['length'];_0x14123b+=0x1){if(_0x54b72a[_0x6dab('0x7e')][_0x14123b][_0x6dab('0x32')]&&_['includes'](_0x59aea4,_0x54b72a[_0x6dab('0x7e')][_0x14123b]['type'])&&_0x54b72a[_0x6dab('0x7e')][_0x14123b]['parentKey']&&_0x54b72a[_0x6dab('0x7e')][_0x14123b]['foreignTable']&&_0x54b72a[_0x6dab('0x7e')][_0x14123b][_0x6dab('0x81')]){_0x2f9e7a[_0x54b72a['joins'][_0x14123b][_0x6dab('0x32')]](_0x54b72a[_0x6dab('0x7e')][_0x14123b][_0x6dab('0x80')],null,util[_0x6dab('0x7b')](_0x6dab('0xaa'),_0x54b72a[_0x6dab('0x77')],_0x54b72a['joins'][_0x14123b][_0x6dab('0x91')],_0x54b72a['joins'][_0x14123b]['foreignTable'],_0x54b72a[_0x6dab('0x7e')][_0x14123b]['foreignKey']));}}}if(_0x54b72a[_0x6dab('0x82')]){_0x54b72a[_0x6dab('0x82')]=JSON[_0x6dab('0x7f')](_0x54b72a[_0x6dab('0x82')]);_0x2f9e7a[_0x6dab('0x40')](_0x416035(_0x54b72a[_0x6dab('0x82')][_0x6dab('0x6c')]));}_0x65f6b8=_0x2f9e7a[_0x6dab('0x83')]();_0x2f9e7a['limit'](_0x271600);_0x2f9e7a[_0x6dab('0x20')](0x0);logger[_0x6dab('0x84')](_0x6dab('0x85'),_0x2f9e7a[_0x6dab('0x86')]());return db[_0x6dab('0x87')][_0x6dab('0x34')](_0x2f9e7a[_0x6dab('0x86')](),{'type':db[_0x6dab('0x87')]['QueryTypes']['SELECT']});}})['then'](function(){return{'sql':_0x65f6b8[_0x6dab('0x86')]()};})[_0x6dab('0x28')](respondWithResult(_0x53d58f,null))[_0x6dab('0x57')](handleError(_0x53d58f,null));};
\ No newline at end of file
+var _0xb0f5=['SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','COUNT(%s)','MAX(%s)','AVG(%s)','ROUND(%s)','IS\x20EMPTY','ValidationErrorItem','foreignKey','No\x20available\x20data','output','web','fullPath','%s-%s.%s','generate','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','COUNT(*)'];(function(_0x4cba56,_0x5b2c44){var _0x3cc9f3=function(_0x5bb80a){while(--_0x5bb80a){_0x4cba56['push'](_0x4cba56['shift']());}};_0x3cc9f3(++_0x5b2c44);}(_0xb0f5,0xac));var _0x5b0f=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xb0f5[_0x4792c8];return _0x35edb1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5b0f('0x0'));var rimraf=require(_0x5b0f('0x1'));var zipdir=require(_0x5b0f('0x2'));var jsonpatch=require(_0x5b0f('0x3'));var rp=require(_0x5b0f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b0f('0x5'));var util=require(_0x5b0f('0x6'));var path=require(_0x5b0f('0x7'));var sox=require('sox');var csv=require(_0x5b0f('0x8'));var ejs=require(_0x5b0f('0x9'));var fs=require('fs');var _=require(_0x5b0f('0xa'));var squel=require('squel');var crypto=require(_0x5b0f('0xb'));var jsforce=require(_0x5b0f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5b0f('0xd'));var Papa=require(_0x5b0f('0xe'));var Redis=require(_0x5b0f('0xf'));var authService=require(_0x5b0f('0x10'));var qs=require(_0x5b0f('0x11'));var as=require(_0x5b0f('0x12'));var hardwareService=require(_0x5b0f('0x13'));var logger=require(_0x5b0f('0x14'))(_0x5b0f('0x15'));var utils=require(_0x5b0f('0x16'));var config=require(_0x5b0f('0x17'));var db=require(_0x5b0f('0x18'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x1ed105,_0x55d0ac){_0x55d0ac=_0x55d0ac||0xcc;return function(_0x27dabf){if(_0x27dabf){return _0x1ed105[_0x5b0f('0x19')](_0x55d0ac);}return _0x1ed105[_0x5b0f('0x1a')](_0x55d0ac)[_0x5b0f('0x1b')]();};}function respondWithResult(_0x31d725,_0x17f282){_0x17f282=_0x17f282||0xc8;return function(_0xbe5232){if(_0xbe5232){return _0x31d725[_0x5b0f('0x1a')](_0x17f282)[_0x5b0f('0x1c')](_0xbe5232);}};}function respondWithFilteredResult(_0x3a8cff,_0x45bae0){return function(_0x5b3bfc){if(_0x5b3bfc){var _0x1784a1=_0x5b3bfc['count'],_0x279a33=_0x45bae0[_0x5b0f('0x1d')],_0x8e5ee5=_0x45bae0[_0x5b0f('0x1d')]+_0x45bae0[_0x5b0f('0x1e')],_0x165d2c;if(_0x8e5ee5>=_0x1784a1){_0x8e5ee5=_0x1784a1;_0x165d2c=0xc8;}else{_0x165d2c=0xce;}_0x3a8cff[_0x5b0f('0x1a')](_0x165d2c);return _0x3a8cff[_0x5b0f('0x1f')](_0x5b0f('0x20'),_0x279a33+'-'+_0x8e5ee5+'/'+_0x1784a1)[_0x5b0f('0x1c')](_0x5b3bfc);}return null;};}function patchUpdates(_0x683b19){return function(_0x7eda84){try{jsonpatch[_0x5b0f('0x21')](_0x7eda84,_0x683b19,!![]);}catch(_0x582b0e){return BPromise[_0x5b0f('0x22')](_0x582b0e);}return _0x7eda84[_0x5b0f('0x23')]();};}function saveUpdates(_0x2b1817,_0x5cce54){return function(_0x580e82){if(_0x580e82){return _0x580e82[_0x5b0f('0x24')](_0x2b1817)['then'](function(_0x199bd7){return _0x199bd7;});}return null;};}function removeEntity(_0x2c252b,_0x2c1b1f){return function(_0xa0d281){if(_0xa0d281){return _0xa0d281[_0x5b0f('0x25')]()[_0x5b0f('0x26')](function(){var _0x3d029c=_0xa0d281[_0x5b0f('0x27')]({'plain':!![]});var _0x1208ba=_0x5b0f('0x28');return db[_0x5b0f('0x29')][_0x5b0f('0x25')]({'where':{'type':_0x1208ba,'resourceId':_0x3d029c['id']}})['then'](function(){return _0xa0d281;});})[_0x5b0f('0x26')](function(){_0x2c252b[_0x5b0f('0x1a')](0xcc)[_0x5b0f('0x1b')]();});}};}function handleEntityNotFound(_0x1ec9ed,_0x1d67ba){return function(_0x591661){if(!_0x591661){_0x1ec9ed[_0x5b0f('0x19')](0x194);}return _0x591661;};}function handleError(_0x4ab3ae,_0x123dcb){_0x123dcb=_0x123dcb||0x1f4;return function(_0x36f690){logger[_0x5b0f('0x2a')](_0x36f690['stack']);if(_0x36f690[_0x5b0f('0x2b')]){delete _0x36f690[_0x5b0f('0x2b')];}_0x4ab3ae[_0x5b0f('0x1a')](_0x123dcb)[_0x5b0f('0x2c')](_0x36f690);};}exports[_0x5b0f('0x2d')]=function(_0x24d86f,_0x435b9d){var _0x376e77={},_0x295c1d={},_0x10905d={'count':0x0,'rows':[]};var _0xa819e0=_[_0x5b0f('0x2e')](db[_0x5b0f('0x2f')][_0x5b0f('0x30')],function(_0x1f08b7){return{'name':_0x1f08b7[_0x5b0f('0x31')],'type':_0x1f08b7[_0x5b0f('0x32')][_0x5b0f('0x33')]};});_0x295c1d[_0x5b0f('0x34')]=_[_0x5b0f('0x2e')](_0xa819e0,_0x5b0f('0x2b'));_0x295c1d[_0x5b0f('0x35')]=_[_0x5b0f('0x36')](_0x24d86f[_0x5b0f('0x35')]);_0x295c1d[_0x5b0f('0x37')]=_[_0x5b0f('0x38')](_0x295c1d[_0x5b0f('0x34')],_0x295c1d[_0x5b0f('0x35')]);_0x376e77['attributes']=_[_0x5b0f('0x38')](_0x295c1d['model'],qs['fields'](_0x24d86f[_0x5b0f('0x35')][_0x5b0f('0x39')]));_0x376e77[_0x5b0f('0x3a')]=_0x376e77[_0x5b0f('0x3a')][_0x5b0f('0x3b')]?_0x376e77[_0x5b0f('0x3a')]:_0x295c1d['model'];if(!_0x24d86f['query'][_0x5b0f('0x3c')](_0x5b0f('0x3d'))){_0x376e77[_0x5b0f('0x1e')]=qs[_0x5b0f('0x1e')](_0x24d86f['query'][_0x5b0f('0x1e')]);_0x376e77[_0x5b0f('0x1d')]=qs[_0x5b0f('0x1d')](_0x24d86f[_0x5b0f('0x35')][_0x5b0f('0x1d')]);}_0x376e77[_0x5b0f('0x3e')]=qs[_0x5b0f('0x3f')](_0x24d86f[_0x5b0f('0x35')][_0x5b0f('0x3f')]);_0x376e77[_0x5b0f('0x40')]=qs[_0x5b0f('0x37')](_[_0x5b0f('0x41')](_0x24d86f[_0x5b0f('0x35')],_0x295c1d[_0x5b0f('0x37')]),_0xa819e0);if(_0x24d86f['query'][_0x5b0f('0x42')]){_0x376e77['where']=_[_0x5b0f('0x43')](_0x376e77[_0x5b0f('0x40')],{'$or':_[_0x5b0f('0x2e')](_0xa819e0,function(_0x34f2b7){if(_0x34f2b7['type']!==_0x5b0f('0x44')){var _0x515772={};_0x515772[_0x34f2b7[_0x5b0f('0x2b')]]={'$like':'%'+_0x24d86f[_0x5b0f('0x35')][_0x5b0f('0x42')]+'%'};return _0x515772;}})});}_0x376e77=_['merge']({},_0x376e77,_0x24d86f[_0x5b0f('0x45')]);var _0x1e42ee={'where':_0x376e77['where']};return db[_0x5b0f('0x2f')][_0x5b0f('0x46')](_0x1e42ee)[_0x5b0f('0x26')](function(_0xdde2d6){_0x10905d['count']=_0xdde2d6;if(_0x24d86f[_0x5b0f('0x35')][_0x5b0f('0x47')]){_0x376e77[_0x5b0f('0x48')]=[{'all':!![]}];}return db[_0x5b0f('0x2f')][_0x5b0f('0x49')](_0x376e77);})['then'](function(_0x3fd346){_0x10905d[_0x5b0f('0x4a')]=_0x3fd346;return _0x10905d;})[_0x5b0f('0x26')](respondWithFilteredResult(_0x435b9d,_0x376e77))[_0x5b0f('0x4b')](handleError(_0x435b9d,null));};exports[_0x5b0f('0x4c')]=function(_0x23ea73,_0x44059d){var _0x430909={'raw':!![],'where':{'id':_0x23ea73[_0x5b0f('0x4d')]['id']}},_0x18d8b3={};_0x18d8b3['model']=_['keys'](db['AnalyticDefaultReport'][_0x5b0f('0x30')]);_0x18d8b3['query']=_[_0x5b0f('0x36')](_0x23ea73[_0x5b0f('0x35')]);_0x18d8b3['filters']=_['intersection'](_0x18d8b3[_0x5b0f('0x34')],_0x18d8b3['query']);_0x430909[_0x5b0f('0x3a')]=_[_0x5b0f('0x38')](_0x18d8b3[_0x5b0f('0x34')],qs[_0x5b0f('0x39')](_0x23ea73[_0x5b0f('0x35')][_0x5b0f('0x39')]));_0x430909['attributes']=_0x430909[_0x5b0f('0x3a')][_0x5b0f('0x3b')]?_0x430909[_0x5b0f('0x3a')]:_0x18d8b3[_0x5b0f('0x34')];if(_0x23ea73[_0x5b0f('0x35')]['includeAll']){_0x430909['include']=[{'all':!![]}];}_0x430909=_[_0x5b0f('0x43')]({},_0x430909,_0x23ea73[_0x5b0f('0x45')]);return db[_0x5b0f('0x2f')][_0x5b0f('0x4e')](_0x430909)['then'](handleEntityNotFound(_0x44059d,null))[_0x5b0f('0x26')](respondWithResult(_0x44059d,null))[_0x5b0f('0x4b')](handleError(_0x44059d,null));};exports[_0x5b0f('0x4f')]=function(_0x2825f2,_0x3cd066){return db[_0x5b0f('0x2f')][_0x5b0f('0x4f')](_0x2825f2[_0x5b0f('0x50')],{})[_0x5b0f('0x26')](function(_0x3bd8a3){var _0x7b3033=_0x2825f2[_0x5b0f('0x51')]['get']({'plain':!![]});if(!_0x7b3033)throw new Error(_0x5b0f('0x52'));if(_0x7b3033[_0x5b0f('0x53')]===_0x5b0f('0x51')){var _0x211f42=_0x3bd8a3[_0x5b0f('0x27')]({'plain':!![]});var _0xb4fa44=_0x5b0f('0x54');return db[_0x5b0f('0x55')][_0x5b0f('0x4e')]({'where':{'name':_0xb4fa44,'userProfileId':_0x7b3033[_0x5b0f('0x56')]},'raw':!![]})['then'](function(_0x119cfb){if(_0x119cfb&&_0x119cfb['autoAssociation']===0x0){return db[_0x5b0f('0x29')][_0x5b0f('0x4f')]({'name':_0x211f42[_0x5b0f('0x2b')],'resourceId':_0x211f42['id'],'type':_0x5b0f('0x28'),'sectionId':_0x119cfb['id']},{})['then'](function(){return _0x3bd8a3;});}else{return _0x3bd8a3;}})[_0x5b0f('0x4b')](function(_0x36ed81){logger[_0x5b0f('0x2a')](_0x5b0f('0x57'),_0x36ed81);throw _0x36ed81;});}return _0x3bd8a3;})[_0x5b0f('0x26')](respondWithResult(_0x3cd066,0xc9))[_0x5b0f('0x4b')](handleError(_0x3cd066,null));};exports['update']=function(_0x299bf9,_0xcdc89f){if(_0x299bf9[_0x5b0f('0x50')]['id']){delete _0x299bf9['body']['id'];}return db[_0x5b0f('0x2f')][_0x5b0f('0x4e')]({'where':{'id':_0x299bf9[_0x5b0f('0x4d')]['id']}})[_0x5b0f('0x26')](handleEntityNotFound(_0xcdc89f,null))[_0x5b0f('0x26')](saveUpdates(_0x299bf9[_0x5b0f('0x50')],null))[_0x5b0f('0x26')](respondWithResult(_0xcdc89f,null))[_0x5b0f('0x4b')](handleError(_0xcdc89f,null));};exports[_0x5b0f('0x25')]=function(_0x445b71,_0x250b61){return db[_0x5b0f('0x2f')][_0x5b0f('0x4e')]({'where':{'id':_0x445b71[_0x5b0f('0x4d')]['id']}})[_0x5b0f('0x26')](handleEntityNotFound(_0x250b61,null))[_0x5b0f('0x26')](removeEntity(_0x250b61,null))['catch'](handleError(_0x250b61,null));};exports[_0x5b0f('0x58')]=function(_0x103d2f,_0x4f8cd7){var _0x24420f=0xa;var _0x41c375=[_0x5b0f('0x59'),_0x5b0f('0x5a'),'right_join',_0x5b0f('0x5b')];var _0x5c898e={'SUM':_0x5b0f('0x5c'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5b0f('0x5d'),'MAX':'MAX(%s)','MIN':_0x5b0f('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x5b0f('0x5f'),'GROUP_CONCAT ASC':_0x5b0f('0x60'),'GROUP_CONCAT DESC':_0x5b0f('0x61')};var _0x10e627={'SEC_TO_TIME':_0x5b0f('0x62'),'DATE':_0x5b0f('0x63'),'HOUR':_0x5b0f('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5b0f('0x65')};var _0x580b3f=function(_0x322695){return!_[_0x5b0f('0x66')]([_0x5b0f('0x67'),_0x5b0f('0x68'),'IS\x20EMPTY',_0x5b0f('0x69')],_0x322695);};var _0x41e01b=function(_0x492972){if(!_0x492972||!_0x492972[_0x5b0f('0x6a')]['length']){return'';}for(var _0x2aae36='(',_0x35e478=0x0;_0x35e478<_0x492972['rules'][_0x5b0f('0x3b')];_0x35e478+=0x1){_0x35e478>0x0&&(_0x2aae36+='\x20'+_0x492972[_0x5b0f('0x6b')]+'\x20');_0x2aae36+=_0x492972[_0x5b0f('0x6a')][_0x35e478]['group']?_0x41e01b(_0x492972[_0x5b0f('0x6a')][_0x35e478][_0x5b0f('0x6c')]):_0x492972['rules'][_0x35e478][_0x5b0f('0x6d')]+'\x20'+_0x492972[_0x5b0f('0x6a')][_0x35e478][_0x5b0f('0x6e')]+(_0x580b3f(_0x492972[_0x5b0f('0x6a')][_0x35e478][_0x5b0f('0x6e')])?'\x20'+_0x492972[_0x5b0f('0x6a')][_0x35e478]['value']:'');}return _0x2aae36+')';};var _0x1edbc7={'where':{'id':_0x103d2f[_0x5b0f('0x4d')]['id']}},_0x52d34d,_0x2cb94c,_0x396ecd,_0x10ad9c,_0x2aac8e;_0x1edbc7=_['merge']({},_0x1edbc7,_0x103d2f[_0x5b0f('0x45')]);return db[_0x5b0f('0x2f')][_0x5b0f('0x4e')](_0x1edbc7)[_0x5b0f('0x26')](function(_0x54766f){if(_0x54766f){_0x52d34d=_0x54766f;return _0x54766f[_0x5b0f('0x6f')]();}return null;})[_0x5b0f('0x26')](function(_0xda28bd){if(_0xda28bd){if(!_0xda28bd[_0x5b0f('0x3b')]){throw new db[(_0x5b0f('0x70'))]['ValidationErrorItem'](_0x5b0f('0x71'),0x193);}_0x2cb94c=_0xda28bd;return db[_0x5b0f('0x72')][_0x5b0f('0x49')]({'raw':!![]});}return null;})['then'](function(_0x487780){if(_0x487780){_0x396ecd=_[_0x5b0f('0x73')](_0x487780,'id');var _0x124b7c;var _0x40cd05=squel[_0x5b0f('0x74')]();_0x40cd05[_0x5b0f('0x75')](_0x52d34d[_0x5b0f('0x76')]);for(var _0x2a2fe9=0x0;_0x2a2fe9<_0x2cb94c[_0x5b0f('0x3b')];_0x2a2fe9+=0x1){_0x124b7c=_0x2cb94c[_0x2a2fe9][_0x5b0f('0x77')]?_0x396ecd[_0x2cb94c[_0x2a2fe9][_0x5b0f('0x77')]][_0x5b0f('0x78')]:_0x2cb94c[_0x2a2fe9][_0x5b0f('0x6d')];_0x124b7c=_0x2cb94c[_0x2a2fe9][_0x5b0f('0x79')]?_[_0x5b0f('0x7a')](_0x5c898e[_0x2cb94c[_0x2a2fe9]['function']],'%s',_0x124b7c):_0x124b7c;_0x124b7c=_0x2cb94c[_0x2a2fe9][_0x5b0f('0x7b')]?_['replace'](_0x10e627[_0x2cb94c[_0x2a2fe9][_0x5b0f('0x7b')]],'%s',_0x124b7c):_0x124b7c;if(_0x2cb94c[_0x2a2fe9][_0x5b0f('0x7c')]){_0x40cd05[_0x5b0f('0x6c')](_0x124b7c);}_0x2cb94c[_0x2a2fe9][_0x5b0f('0x7d')]&&_0x40cd05[_0x5b0f('0x3e')](_0x124b7c,_0x2cb94c[_0x2a2fe9][_0x5b0f('0x7d')]===_0x5b0f('0x7e')?![]:!![]);_0x40cd05['field'](_0x124b7c,_0x2cb94c[_0x2a2fe9][_0x5b0f('0x7f')]||_0x124b7c);}if(_0x52d34d[_0x5b0f('0x80')]){_0x52d34d[_0x5b0f('0x80')]=JSON[_0x5b0f('0x81')](_0x52d34d[_0x5b0f('0x80')]);for(var _0x21ced5=0x0;_0x21ced5<_0x52d34d['joins'][_0x5b0f('0x3b')];_0x21ced5+=0x1){if(_0x52d34d[_0x5b0f('0x80')][_0x21ced5][_0x5b0f('0x32')]&&_['includes'](_0x41c375,_0x52d34d[_0x5b0f('0x80')][_0x21ced5][_0x5b0f('0x32')])&&_0x52d34d[_0x5b0f('0x80')][_0x21ced5][_0x5b0f('0x82')]&&_0x52d34d[_0x5b0f('0x80')][_0x21ced5][_0x5b0f('0x83')]&&_0x52d34d['joins'][_0x21ced5]['foreignKey']){_0x40cd05[_0x52d34d[_0x5b0f('0x80')][_0x21ced5][_0x5b0f('0x32')]](_0x52d34d[_0x5b0f('0x80')][_0x21ced5]['foreignTable'],null,util[_0x5b0f('0x7b')](_0x5b0f('0x84'),_0x52d34d[_0x5b0f('0x76')],_0x52d34d[_0x5b0f('0x80')][_0x21ced5][_0x5b0f('0x82')],_0x52d34d[_0x5b0f('0x80')][_0x21ced5][_0x5b0f('0x83')],_0x52d34d[_0x5b0f('0x80')][_0x21ced5]['foreignKey']));}}}if(_0x52d34d[_0x5b0f('0x85')]){_0x52d34d[_0x5b0f('0x85')]=JSON[_0x5b0f('0x81')](_0x52d34d[_0x5b0f('0x85')]);_0x40cd05['where'](_0x41e01b(_0x52d34d[_0x5b0f('0x85')][_0x5b0f('0x6c')]));}_0x2aac8e=_0x40cd05[_0x5b0f('0x86')]();_0x40cd05['limit'](_0x24420f);_0x40cd05[_0x5b0f('0x1d')](0x0);logger[_0x5b0f('0x87')](_0x5b0f('0x88'),_0x40cd05['toString']());return db[_0x5b0f('0x89')][_0x5b0f('0x35')](_0x40cd05[_0x5b0f('0x8a')](),{'type':db[_0x5b0f('0x89')][_0x5b0f('0x8b')]['SELECT']});}})[_0x5b0f('0x26')](respondWithResult(_0x4f8cd7,null))['catch'](handleError(_0x4f8cd7,null));};function runReport(_0xd61d47,_0x2fd379,_0x155822){var _0x4d9cd1=_0x2fd379['name'];var _0x3f09e1=0xa;var _0x4f4acf=[_0x5b0f('0x59'),_0x5b0f('0x5a'),_0x5b0f('0x8c'),_0x5b0f('0x5b')];var _0x2331c5={'SUM':_0x5b0f('0x5c'),'COUNT':_0x5b0f('0x8d'),'COUNT DISTINCT':_0x5b0f('0x5d'),'MAX':_0x5b0f('0x8e'),'MIN':_0x5b0f('0x5e'),'AVG':_0x5b0f('0x8f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5b0f('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x14bdf2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5b0f('0x63'),'HOUR':_0x5b0f('0x64'),'ROUND':_0x5b0f('0x90'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x316d06=function(_0x1a54cd){return!_[_0x5b0f('0x66')]([_0x5b0f('0x67'),'IS\x20NOT\x20NULL',_0x5b0f('0x91'),_0x5b0f('0x69')],_0x1a54cd);};var _0x3b5633=function(_0xa43f90){if(!_0xa43f90||!_0xa43f90[_0x5b0f('0x6a')][_0x5b0f('0x3b')]){return'';}for(var _0x355cbb='(',_0xb6425f=0x0;_0xb6425f<_0xa43f90[_0x5b0f('0x6a')]['length'];_0xb6425f+=0x1){_0xb6425f>0x0&&(_0x355cbb+='\x20'+_0xa43f90[_0x5b0f('0x6b')]+'\x20');_0x355cbb+=_0xa43f90[_0x5b0f('0x6a')][_0xb6425f][_0x5b0f('0x6c')]?_0x3b5633(_0xa43f90[_0x5b0f('0x6a')][_0xb6425f][_0x5b0f('0x6c')]):_0xa43f90[_0x5b0f('0x6a')][_0xb6425f][_0x5b0f('0x6d')]+'\x20'+_0xa43f90['rules'][_0xb6425f][_0x5b0f('0x6e')]+(_0x316d06(_0xa43f90['rules'][_0xb6425f][_0x5b0f('0x6e')])?'\x20'+_0xa43f90[_0x5b0f('0x6a')][_0xb6425f]['value']:'');}return _0x355cbb+')';};var _0x5a5b8a={'where':{'id':_0xd61d47['id']}},_0x3cc966,_0x51f94d,_0x2992a9,_0x121e89,_0x36cab6;_0x5a5b8a=_[_0x5b0f('0x43')]({},_0x5a5b8a,_0x155822);return db[_0x5b0f('0x2f')][_0x5b0f('0x4e')](_0x5a5b8a)[_0x5b0f('0x26')](function(_0x53f4f6){if(_0x53f4f6){_0x3cc966=_0x53f4f6;return _0x53f4f6[_0x5b0f('0x6f')]();}return null;})[_0x5b0f('0x26')](function(_0x3a75b7){if(_0x3a75b7){if(!_0x3a75b7[_0x5b0f('0x3b')]){throw new db[(_0x5b0f('0x70'))][(_0x5b0f('0x92'))](_0x5b0f('0x71'),0x193);}_0x51f94d=_0x3a75b7;return db['AnalyticMetric'][_0x5b0f('0x49')]({'raw':!![]});}return null;})['then'](function(_0x268bd0){if(_0x268bd0){_0x2992a9=_[_0x5b0f('0x73')](_0x268bd0,'id');var _0x1bdee4;var _0x4bcb5=squel[_0x5b0f('0x74')]();_0x4bcb5[_0x5b0f('0x75')](_0x3cc966[_0x5b0f('0x76')]);for(var _0x5a5468=0x0;_0x5a5468<_0x51f94d[_0x5b0f('0x3b')];_0x5a5468+=0x1){_0x1bdee4=_0x51f94d[_0x5a5468][_0x5b0f('0x77')]?_0x2992a9[_0x51f94d[_0x5a5468][_0x5b0f('0x77')]]['metric']:_0x51f94d[_0x5a5468]['field'];_0x1bdee4=_0x51f94d[_0x5a5468]['function']?_[_0x5b0f('0x7a')](_0x2331c5[_0x51f94d[_0x5a5468][_0x5b0f('0x79')]],'%s',_0x1bdee4):_0x1bdee4;_0x1bdee4=_0x51f94d[_0x5a5468]['format']?_[_0x5b0f('0x7a')](_0x14bdf2[_0x51f94d[_0x5a5468][_0x5b0f('0x7b')]],'%s',_0x1bdee4):_0x1bdee4;if(_0x51f94d[_0x5a5468][_0x5b0f('0x7c')]){_0x4bcb5[_0x5b0f('0x6c')](_0x1bdee4);}_0x51f94d[_0x5a5468]['orderBy']&&_0x4bcb5[_0x5b0f('0x3e')](_0x1bdee4,_0x51f94d[_0x5a5468][_0x5b0f('0x7d')]===_0x5b0f('0x7e')?![]:!![]);_0x4bcb5[_0x5b0f('0x6d')](_0x1bdee4,_0x51f94d[_0x5a5468][_0x5b0f('0x7f')]||_0x1bdee4);}if(_0x3cc966[_0x5b0f('0x80')]){_0x3cc966[_0x5b0f('0x80')]=JSON[_0x5b0f('0x81')](_0x3cc966[_0x5b0f('0x80')]);for(var _0x49e12b=0x0;_0x49e12b<_0x3cc966[_0x5b0f('0x80')]['length'];_0x49e12b+=0x1){if(_0x3cc966[_0x5b0f('0x80')][_0x49e12b][_0x5b0f('0x32')]&&_[_0x5b0f('0x66')](_0x4f4acf,_0x3cc966[_0x5b0f('0x80')][_0x49e12b][_0x5b0f('0x32')])&&_0x3cc966[_0x5b0f('0x80')][_0x49e12b][_0x5b0f('0x82')]&&_0x3cc966['joins'][_0x49e12b][_0x5b0f('0x83')]&&_0x3cc966['joins'][_0x49e12b][_0x5b0f('0x93')]){_0x4bcb5[_0x3cc966['joins'][_0x49e12b]['type']](_0x3cc966['joins'][_0x49e12b][_0x5b0f('0x83')],null,util['format'](_0x5b0f('0x84'),_0x3cc966[_0x5b0f('0x76')],_0x3cc966[_0x5b0f('0x80')][_0x49e12b][_0x5b0f('0x82')],_0x3cc966[_0x5b0f('0x80')][_0x49e12b][_0x5b0f('0x83')],_0x3cc966[_0x5b0f('0x80')][_0x49e12b][_0x5b0f('0x93')]));}}}if(_0x3cc966[_0x5b0f('0x85')]){_0x3cc966[_0x5b0f('0x85')]=JSON[_0x5b0f('0x81')](_0x3cc966[_0x5b0f('0x85')]);_0x4bcb5[_0x5b0f('0x40')](_0x3b5633(_0x3cc966['conditions'][_0x5b0f('0x6c')]));}_0x36cab6=_0x4bcb5[_0x5b0f('0x86')]();_0x4bcb5['limit'](_0x3f09e1);_0x4bcb5[_0x5b0f('0x1d')](0x0);logger[_0x5b0f('0x87')](_0x5b0f('0x88'),_0x4bcb5[_0x5b0f('0x8a')]());return db['sequelize'][_0x5b0f('0x35')](_0x4bcb5[_0x5b0f('0x8a')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0x5b0f('0x26')](function(_0x3f78a3){if(!_0x3f78a3['length']){throw new db[(_0x5b0f('0x70'))][(_0x5b0f('0x92'))](_0x5b0f('0x94'),0xcc);}if(_0x2fd379[_0x5b0f('0x95')]===_0x5b0f('0x96')){return null;}var _0x20ca7f=_[_0x5b0f('0x43')](_0x2fd379,{'name':_0x2fd379[_0x5b0f('0x97')]||_0x2fd379[_0x5b0f('0x2b')]||_0x3cc966['name'],'basename':_0x4d9cd1,'savename':util[_0x5b0f('0x7b')](_0x5b0f('0x98'),_0x2fd379[_0x5b0f('0x2b')]||_0x3cc966['name'],require('randomstring')[_0x5b0f('0x99')](0x4),_0x2fd379[_0x5b0f('0x95')]||_0x5b0f('0x9a')),'reportId':_0x3cc966['id'],'reportType':'default'});return db[_0x5b0f('0x9b')]['create'](_0x20ca7f,{'raw':!![]});})[_0x5b0f('0x26')](function(_0x14aa83){if(_0x3cc966[_0x5b0f('0x76')]==='cdr'){_0x36cab6[_0x5b0f('0x40')](_0x3cc966[_0x5b0f('0x76')]+_0x5b0f('0x9c'),_0x2fd379['startDate'],_0x2fd379[_0x5b0f('0x9d')]);}else{_0x36cab6[_0x5b0f('0x40')](_0x3cc966[_0x5b0f('0x76')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2fd379[_0x5b0f('0x9e')],_0x2fd379[_0x5b0f('0x9d')]);}if(_0x14aa83){logger[_0x5b0f('0x9f')](_0x5b0f('0xa0'),_0x36cab6['toString']());require(_0x5b0f('0xa1'))[_0x5b0f('0xa2')](path[_0x5b0f('0x59')](__dirname,_0x5b0f('0xa3'),_0x14aa83['output']),[_0x14aa83['id'],_0x36cab6[_0x5b0f('0x8a')](),path[_0x5b0f('0x59')](__dirname,_0x5b0f('0xa4'),_0x14aa83['savename']),_0x4d9cd1]);return _0x14aa83;}else{var _0x516939=squel[_0x5b0f('0x74')]();_0x516939[_0x5b0f('0x75')]('('+_0x36cab6['toString']()+')','countTable');_0x516939[_0x5b0f('0x6d')](_0x5b0f('0xa5'),_0x5b0f('0x46'));_0x36cab6['limit'](_0x2fd379[_0x5b0f('0x1e')]||_0x3f09e1);_0x36cab6[_0x5b0f('0x1d')](_0x2fd379[_0x5b0f('0x1d')]||0x0);return dbH['sequelize'][_0x5b0f('0x35')](_0x516939[_0x5b0f('0x8a')](),{'type':dbH['sequelize']['QueryTypes'][_0x5b0f('0xa6')]})['then'](function(_0x43dfdf){if(!_0x43dfdf[_0x5b0f('0x3b')]){_0x121e89=0x0;}else{_0x121e89=_0x43dfdf[0x0][_0x5b0f('0x46')]||0x0;}return dbH[_0x5b0f('0x89')][_0x5b0f('0x35')](_0x36cab6[_0x5b0f('0x8a')](),{'type':dbH['sequelize'][_0x5b0f('0x8b')][_0x5b0f('0xa6')]});})[_0x5b0f('0x26')](function(_0x33ceea){return{'rows':_0x33ceea||[],'count':_0x121e89};});}});}exports[_0x5b0f('0xa7')]=function(_0x52effa,_0xe5949b){return runReport(_0x52effa[_0x5b0f('0x4d')],_0x52effa[_0x5b0f('0x35')],_0x52effa[_0x5b0f('0x45')])[_0x5b0f('0x26')](respondWithResult(_0xe5949b,null))[_0x5b0f('0x4b')](handleError(_0xe5949b,null));};exports[_0x5b0f('0xa8')]=runReport;exports[_0x5b0f('0x35')]=function(_0x29bc77,_0x3d4270){var _0x1a1dd6=0xa;var _0x5c8a52=[_0x5b0f('0x59'),_0x5b0f('0x5a'),_0x5b0f('0x8c'),_0x5b0f('0x5b')];var _0x17cd23={'SUM':_0x5b0f('0x5c'),'COUNT':_0x5b0f('0x8d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5b0f('0x5e'),'AVG':_0x5b0f('0x8f'),'GROUP_CONCAT':_0x5b0f('0x5f'),'GROUP_CONCAT ASC':_0x5b0f('0x60'),'GROUP_CONCAT DESC':_0x5b0f('0x61')};var _0x591dac={'SEC_TO_TIME':_0x5b0f('0x62'),'DATE':_0x5b0f('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x5b0f('0x90'),'UNIX_TIMESTAMP':_0x5b0f('0x65')};var _0x1a1a2b=function(_0x178dd4){return!_[_0x5b0f('0x66')]([_0x5b0f('0x67'),_0x5b0f('0x68'),_0x5b0f('0x91'),_0x5b0f('0x69')],_0x178dd4);};var _0x105cf8=function(_0x2009f8){if(!_0x2009f8||!_0x2009f8[_0x5b0f('0x6a')][_0x5b0f('0x3b')]){return'';}for(var _0xe684d='(',_0x1fc930=0x0;_0x1fc930<_0x2009f8[_0x5b0f('0x6a')]['length'];_0x1fc930+=0x1){_0x1fc930>0x0&&(_0xe684d+='\x20'+_0x2009f8[_0x5b0f('0x6b')]+'\x20');_0xe684d+=_0x2009f8[_0x5b0f('0x6a')][_0x1fc930]['group']?_0x105cf8(_0x2009f8[_0x5b0f('0x6a')][_0x1fc930][_0x5b0f('0x6c')]):_0x2009f8[_0x5b0f('0x6a')][_0x1fc930][_0x5b0f('0x6d')]+'\x20'+_0x2009f8['rules'][_0x1fc930][_0x5b0f('0x6e')]+(_0x1a1a2b(_0x2009f8[_0x5b0f('0x6a')][_0x1fc930][_0x5b0f('0x6e')])?'\x20'+_0x2009f8[_0x5b0f('0x6a')][_0x1fc930]['value']:'');}return _0xe684d+')';};var _0x3eddf0={'where':{'id':_0x29bc77[_0x5b0f('0x4d')]['id']}},_0x25f6f9,_0x420b45,_0xab80ec,_0x18c7cb,_0x1e6cbc;_0x3eddf0=_[_0x5b0f('0x43')]({},_0x3eddf0,_0x29bc77['options']);return db[_0x5b0f('0x2f')]['find'](_0x3eddf0)[_0x5b0f('0x26')](function(_0xbe76a8){if(_0xbe76a8){_0x25f6f9=_0xbe76a8;return _0xbe76a8[_0x5b0f('0x6f')]();}return null;})[_0x5b0f('0x26')](function(_0x45b227){if(_0x45b227){if(!_0x45b227[_0x5b0f('0x3b')]){throw new db[(_0x5b0f('0x70'))][(_0x5b0f('0x92'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x420b45=_0x45b227;return db[_0x5b0f('0x72')]['findAll']({'raw':!![]});}return null;})[_0x5b0f('0x26')](function(_0x32a1ad){if(_0x32a1ad){_0xab80ec=_[_0x5b0f('0x73')](_0x32a1ad,'id');var _0x4dcda2;var _0x3327c4=squel[_0x5b0f('0x74')]();_0x3327c4[_0x5b0f('0x75')](_0x25f6f9[_0x5b0f('0x76')]);for(var _0x9cd5e9=0x0;_0x9cd5e9<_0x420b45[_0x5b0f('0x3b')];_0x9cd5e9+=0x1){_0x4dcda2=_0x420b45[_0x9cd5e9][_0x5b0f('0x77')]?_0xab80ec[_0x420b45[_0x9cd5e9][_0x5b0f('0x77')]][_0x5b0f('0x78')]:_0x420b45[_0x9cd5e9][_0x5b0f('0x6d')];_0x4dcda2=_0x420b45[_0x9cd5e9]['function']?_[_0x5b0f('0x7a')](_0x17cd23[_0x420b45[_0x9cd5e9][_0x5b0f('0x79')]],'%s',_0x4dcda2):_0x4dcda2;_0x4dcda2=_0x420b45[_0x9cd5e9]['format']?_[_0x5b0f('0x7a')](_0x591dac[_0x420b45[_0x9cd5e9][_0x5b0f('0x7b')]],'%s',_0x4dcda2):_0x4dcda2;if(_0x420b45[_0x9cd5e9][_0x5b0f('0x7c')]){_0x3327c4[_0x5b0f('0x6c')](_0x4dcda2);}_0x420b45[_0x9cd5e9][_0x5b0f('0x7d')]&&_0x3327c4[_0x5b0f('0x3e')](_0x4dcda2,_0x420b45[_0x9cd5e9][_0x5b0f('0x7d')]===_0x5b0f('0x7e')?![]:!![]);_0x3327c4[_0x5b0f('0x6d')](_0x4dcda2,_0x420b45[_0x9cd5e9]['alias']||_0x4dcda2);}if(_0x25f6f9[_0x5b0f('0x80')]){_0x25f6f9[_0x5b0f('0x80')]=JSON['parse'](_0x25f6f9[_0x5b0f('0x80')]);for(var _0x507fae=0x0;_0x507fae<_0x25f6f9['joins']['length'];_0x507fae+=0x1){if(_0x25f6f9[_0x5b0f('0x80')][_0x507fae][_0x5b0f('0x32')]&&_[_0x5b0f('0x66')](_0x5c8a52,_0x25f6f9[_0x5b0f('0x80')][_0x507fae][_0x5b0f('0x32')])&&_0x25f6f9[_0x5b0f('0x80')][_0x507fae]['parentKey']&&_0x25f6f9['joins'][_0x507fae][_0x5b0f('0x83')]&&_0x25f6f9[_0x5b0f('0x80')][_0x507fae][_0x5b0f('0x93')]){_0x3327c4[_0x25f6f9[_0x5b0f('0x80')][_0x507fae][_0x5b0f('0x32')]](_0x25f6f9[_0x5b0f('0x80')][_0x507fae][_0x5b0f('0x83')],null,util[_0x5b0f('0x7b')](_0x5b0f('0x84'),_0x25f6f9[_0x5b0f('0x76')],_0x25f6f9['joins'][_0x507fae][_0x5b0f('0x82')],_0x25f6f9[_0x5b0f('0x80')][_0x507fae][_0x5b0f('0x83')],_0x25f6f9['joins'][_0x507fae][_0x5b0f('0x93')]));}}}if(_0x25f6f9[_0x5b0f('0x85')]){_0x25f6f9[_0x5b0f('0x85')]=JSON[_0x5b0f('0x81')](_0x25f6f9[_0x5b0f('0x85')]);_0x3327c4['where'](_0x105cf8(_0x25f6f9[_0x5b0f('0x85')][_0x5b0f('0x6c')]));}_0x1e6cbc=_0x3327c4['clone']();_0x3327c4[_0x5b0f('0x1e')](_0x1a1dd6);_0x3327c4[_0x5b0f('0x1d')](0x0);logger[_0x5b0f('0x87')](_0x5b0f('0x88'),_0x3327c4[_0x5b0f('0x8a')]());return db[_0x5b0f('0x89')][_0x5b0f('0x35')](_0x3327c4[_0x5b0f('0x8a')](),{'type':db['sequelize']['QueryTypes'][_0x5b0f('0xa6')]});}})[_0x5b0f('0x26')](function(){return{'sql':_0x1e6cbc[_0x5b0f('0x8a')]()};})[_0x5b0f('0x26')](respondWithResult(_0x3d4270,null))['catch'](handleError(_0x3d4270,null));};
\ No newline at end of file
index a09209f..ae330c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1967=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3d7595,_0x23bf60){var _0x163d06=function(_0x2c3a21){while(--_0x2c3a21){_0x3d7595['push'](_0x3d7595['shift']());}};_0x163d06(++_0x23bf60);}(_0x1967,0x173));var _0x7196=function(_0x4d7d4e,_0x42f570){_0x4d7d4e=_0x4d7d4e-0x0;var _0x5bcd91=_0x1967[_0x4d7d4e];return _0x5bcd91;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x326f=['analytics_default_reports','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport'];(function(_0x266a10,_0x28035d){var _0x10acd8=function(_0x2db22a){while(--_0x2db22a){_0x266a10['push'](_0x266a10['shift']());}};_0x10acd8(++_0x28035d);}(_0x326f,0xd1));var _0xf326=function(_0x314b4f,_0xf30dff){_0x314b4f=_0x314b4f-0x0;var _0x1f2a6c=_0x326f[_0x314b4f];return _0x1f2a6c;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eec0fd8..824499d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dd2=['../../config/environment','jayson/promise','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc'];(function(_0x1e67d0,_0x13b2c1){var _0x54f7de=function(_0x32fa45){while(--_0x32fa45){_0x1e67d0['push'](_0x1e67d0['shift']());}};_0x54f7de(++_0x13b2c1);}(_0x4dd2,0xf1));var _0x24dd=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0x4dd2[_0x2b0bc2];return _0x56e5b9;};'use strict';var _=require('lodash');var util=require(_0x24dd('0x0'));var moment=require(_0x24dd('0x1'));var BPromise=require(_0x24dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24dd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x24dd('0x4'));var logger=require('../../config/logger')(_0x24dd('0x5'));var config=require(_0x24dd('0x6'));var jayson=require(_0x24dd('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21b5b4,_0x390472,_0x1dd44c){return new BPromise(function(_0x424e48,_0x312f04){return client['request'](_0x21b5b4,_0x1dd44c)[_0x24dd('0x8')](function(_0x107a09){logger[_0x24dd('0x9')](_0x24dd('0xa'),_0x390472,_0x24dd('0xb'));logger['debug'](_0x24dd('0xc'),_0x390472,_0x24dd('0xb'),JSON[_0x24dd('0xd')](_0x107a09));if(_0x107a09[_0x24dd('0xe')]){if(_0x107a09[_0x24dd('0xe')][_0x24dd('0xf')]===0x1f4){logger[_0x24dd('0xe')](_0x24dd('0xa'),_0x390472,_0x107a09['error'][_0x24dd('0x10')]);return _0x312f04(_0x107a09['error'][_0x24dd('0x10')]);}logger[_0x24dd('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x390472,_0x107a09['error'][_0x24dd('0x10')]);return _0x424e48(_0x107a09[_0x24dd('0xe')][_0x24dd('0x10')]);}else{logger['info'](_0x24dd('0xa'),_0x390472,'request\x20sent');_0x424e48(_0x107a09[_0x24dd('0x11')][_0x24dd('0x10')]);}})[_0x24dd('0x12')](function(_0x25bdf4){logger['error'](_0x24dd('0xa'),_0x390472,_0x25bdf4);_0x312f04(_0x25bdf4);});});}
\ No newline at end of file
+var _0x6324=['client','http','then','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x2215ff,_0x48a5cf){var _0x3532bb=function(_0x518607){while(--_0x518607){_0x2215ff['push'](_0x2215ff['shift']());}};_0x3532bb(++_0x48a5cf);}(_0x6324,0x142));var _0x4632=function(_0x268c4c,_0x5cce8d){_0x268c4c=_0x268c4c-0x0;var _0x37e96e=_0x6324[_0x268c4c];return _0x37e96e;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var moment=require(_0x4632('0x2'));var BPromise=require(_0x4632('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4632('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4632('0x5'));var logger=require('../../config/logger')(_0x4632('0x6'));var config=require('../../config/environment');var jayson=require(_0x4632('0x7'));var client=jayson[_0x4632('0x8')][_0x4632('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x126e9a,_0x4a15b2,_0x17e860){return new BPromise(function(_0x44dd6d,_0x390a46){return client['request'](_0x126e9a,_0x17e860)[_0x4632('0xa')](function(_0x47824c){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4a15b2,_0x4632('0xb'));logger[_0x4632('0xc')](_0x4632('0xd'),_0x4a15b2,_0x4632('0xb'),JSON[_0x4632('0xe')](_0x47824c));if(_0x47824c[_0x4632('0xf')]){if(_0x47824c[_0x4632('0xf')][_0x4632('0x10')]===0x1f4){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x47824c['error'][_0x4632('0x12')]);return _0x390a46(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}logger[_0x4632('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4a15b2,_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);return _0x44dd6d(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}else{logger[_0x4632('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4a15b2,'request\x20sent');_0x44dd6d(_0x47824c[_0x4632('0x14')][_0x4632('0x12')]);}})[_0x4632('0x15')](function(_0x125eb9){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x125eb9);_0x390a46(_0x125eb9);});});}
\ No newline at end of file
index fadfbab..399adb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89d3=['./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x89d3,0x1db));var _0x389d=function(_0x27c24d,_0x2b50f1){_0x27c24d=_0x27c24d-0x0;var _0x14e722=_0x89d3[_0x27c24d];return _0x14e722;};'use strict';var multer=require(_0x389d('0x0'));var util=require(_0x389d('0x1'));var path=require(_0x389d('0x2'));var timeout=require(_0x389d('0x3'));var express=require(_0x389d('0x4'));var router=express[_0x389d('0x5')]();var auth=require(_0x389d('0x6'));var interaction=require(_0x389d('0x7'));var config=require('../../config/environment');var controller=require(_0x389d('0x8'));router[_0x389d('0x9')]('/',auth[_0x389d('0xa')](),controller['index']);router[_0x389d('0x9')](_0x389d('0xb'),auth['isAuthenticated'](),controller[_0x389d('0xc')]);router['get'](_0x389d('0xd'),auth[_0x389d('0xa')](),controller[_0x389d('0xe')]);router[_0x389d('0x9')](_0x389d('0xf'),auth['isAuthenticated'](),controller[_0x389d('0x10')]);router[_0x389d('0x9')]('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0x389d('0x11')]('/',auth[_0x389d('0xa')](),controller[_0x389d('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x389d('0x13')]);router[_0x389d('0x14')](_0x389d('0xb'),auth[_0x389d('0xa')](),controller[_0x389d('0x15')]);module[_0x389d('0x16')]=router;
\ No newline at end of file
+var _0x6e29=['/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x6e29,0x18b));var _0x96e2=function(_0x598bee,_0x4e464f){_0x598bee=_0x598bee-0x0;var _0x53ea99=_0x6e29[_0x598bee];return _0x53ea99;};'use strict';var multer=require('multer');var util=require(_0x96e2('0x0'));var path=require('path');var timeout=require(_0x96e2('0x1'));var express=require(_0x96e2('0x2'));var router=express[_0x96e2('0x3')]();var auth=require(_0x96e2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x96e2('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0x96e2('0x6')]('/',auth[_0x96e2('0x7')](),controller[_0x96e2('0x8')]);router[_0x96e2('0x6')](_0x96e2('0x9'),auth[_0x96e2('0x7')](),controller[_0x96e2('0xa')]);router[_0x96e2('0x6')](_0x96e2('0xb'),auth[_0x96e2('0x7')](),controller[_0x96e2('0xc')]);router[_0x96e2('0x6')](_0x96e2('0xd'),auth[_0x96e2('0x7')](),controller[_0x96e2('0xe')]);router[_0x96e2('0x6')](_0x96e2('0xf'),auth['isAuthenticated'](),controller[_0x96e2('0x10')]);router[_0x96e2('0x11')]('/',auth[_0x96e2('0x7')](),controller[_0x96e2('0x12')]);router[_0x96e2('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x96e2('0x14')]);router[_0x96e2('0x15')](_0x96e2('0x9'),auth[_0x96e2('0x7')](),controller[_0x96e2('0x16')]);module[_0x96e2('0x17')]=router;
\ No newline at end of file
index f2d1602..44c732a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2660=['manual','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','scheduled'];(function(_0x46e0d2,_0x4585c6){var _0x5c8615=function(_0x105cc5){while(--_0x105cc5){_0x46e0d2['push'](_0x46e0d2['shift']());}};_0x5c8615(++_0x4585c6);}(_0x2660,0xed));var _0x0266=function(_0x582d0b,_0x28f609){_0x582d0b=_0x582d0b-0x0;var _0x2e93e1=_0x2660[_0x582d0b];return _0x2e93e1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0266('0x0'));module[_0x0266('0x1')]={'name':{'type':Sequelize[_0x0266('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x0266('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x0266('0x3')](_0x0266('0x4'),_0x0266('0x5'),_0x0266('0x6')),'allowNull':![],'defaultValue':_0x0266('0x4')},'savename':{'type':Sequelize[_0x0266('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x0266('0x7')]},'status':{'type':Sequelize[_0x0266('0x2')],'defaultValue':_0x0266('0x8')},'type':{'type':Sequelize[_0x0266('0x3')]('manual',_0x0266('0x9')),'allowNull':![],'defaultValue':_0x0266('0xa')},'reportId':{'type':Sequelize[_0x0266('0xb')](0xb)[_0x0266('0xc')]},'reportType':{'type':Sequelize[_0x0266('0x2')]}};
\ No newline at end of file
+var _0xe785=['pdf','STRING','DATE','Loading','manual','scheduled','INTEGER','ENUM','csv'];(function(_0x4691ca,_0x3cf10c){var _0x197c25=function(_0x380824){while(--_0x380824){_0x4691ca['push'](_0x4691ca['shift']());}};_0x197c25(++_0x3cf10c);}(_0xe785,0x18a));var _0x5e78=function(_0x2e51f9,_0x320019){_0x2e51f9=_0x2e51f9-0x0;var _0xb560e3=_0xe785[_0x2e51f9];return _0xb560e3;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x5e78('0x0')](_0x5e78('0x1'),_0x5e78('0x2'),'xlsx'),'allowNull':![],'defaultValue':_0x5e78('0x1')},'savename':{'type':Sequelize[_0x5e78('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5e78('0x4')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x5e78('0x3')],'defaultValue':_0x5e78('0x5')},'type':{'type':Sequelize[_0x5e78('0x0')](_0x5e78('0x6'),_0x5e78('0x7')),'allowNull':![],'defaultValue':_0x5e78('0x6')},'reportId':{'type':Sequelize[_0x5e78('0x8')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
index acc0284..6c7fad7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb596=['get','ExtractedReports','UserProfileResource','stack','index','map','AnalyticExtractedReport','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','user','UserProfileSection','userProfileId','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','existsSync','join','root','Sequelize','Report\x20not\x20found\x20or\x20empty','download','server/files/reports','format','%s.%s','basename','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','destroy','then'];(function(_0x2d5d3c,_0x4e0363){var _0x32725b=function(_0x939891){while(--_0x939891){_0x2d5d3c['push'](_0x2d5d3c['shift']());}};_0x32725b(++_0x4e0363);}(_0xb596,0x15b));var _0x6b59=function(_0x1a15ed,_0x406a1b){_0x1a15ed=_0x1a15ed-0x0;var _0x386fe8=_0xb596[_0x1a15ed];return _0x386fe8;};'use strict';var pdf=require(_0x6b59('0x0'));var emlformat=require(_0x6b59('0x1'));var rimraf=require(_0x6b59('0x2'));var zipdir=require(_0x6b59('0x3'));var jsonpatch=require(_0x6b59('0x4'));var rp=require(_0x6b59('0x5'));var moment=require(_0x6b59('0x6'));var BPromise=require(_0x6b59('0x7'));var Mustache=require('mustache');var util=require(_0x6b59('0x8'));var path=require('path');var sox=require(_0x6b59('0x9'));var csv=require('to-csv');var ejs=require(_0x6b59('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6b59('0xb'));var crypto=require('crypto');var jsforce=require(_0x6b59('0xc'));var deskjs=require(_0x6b59('0xd'));var toCsv=require(_0x6b59('0xe'));var querystring=require(_0x6b59('0xf'));var Papa=require(_0x6b59('0x10'));var Redis=require(_0x6b59('0x11'));var authService=require(_0x6b59('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b59('0x13'));var logger=require(_0x6b59('0x14'))(_0x6b59('0x15'));var utils=require(_0x6b59('0x16'));var config=require(_0x6b59('0x17'));var db=require(_0x6b59('0x18'))['db'];function respondWithStatusCode(_0xd63d1f,_0x3b6aae){_0x3b6aae=_0x3b6aae||0xcc;return function(_0x4aa1aa){if(_0x4aa1aa){return _0xd63d1f[_0x6b59('0x19')](_0x3b6aae);}return _0xd63d1f[_0x6b59('0x1a')](_0x3b6aae)[_0x6b59('0x1b')]();};}function respondWithResult(_0x3ae834,_0x37c07f){_0x37c07f=_0x37c07f||0xc8;return function(_0xbecfc5){if(_0xbecfc5){return _0x3ae834[_0x6b59('0x1a')](_0x37c07f)[_0x6b59('0x1c')](_0xbecfc5);}};}function respondWithFilteredResult(_0x2d3d88,_0x56b584){return function(_0x373ae7){if(_0x373ae7){var _0xb71fd3=_0x373ae7[_0x6b59('0x1d')],_0x24a572=_0x56b584[_0x6b59('0x1e')],_0x3017cf=_0x56b584[_0x6b59('0x1e')]+_0x56b584['limit'],_0x431ceb;if(_0x3017cf>=_0xb71fd3){_0x3017cf=_0xb71fd3;_0x431ceb=0xc8;}else{_0x431ceb=0xce;}_0x2d3d88[_0x6b59('0x1a')](_0x431ceb);return _0x2d3d88['set'](_0x6b59('0x1f'),_0x24a572+'-'+_0x3017cf+'/'+_0xb71fd3)['json'](_0x373ae7);}return null;};}function patchUpdates(_0x530e55){return function(_0x49377b){try{jsonpatch['apply'](_0x49377b,_0x530e55,!![]);}catch(_0x4dcaf9){return BPromise[_0x6b59('0x20')](_0x4dcaf9);}return _0x49377b[_0x6b59('0x21')]();};}function saveUpdates(_0x5b8bcb,_0x22f165){return function(_0x1130b3){if(_0x1130b3){return _0x1130b3[_0x6b59('0x22')](_0x5b8bcb)['then'](function(_0x2703b2){return _0x2703b2;});}return null;};}function removeEntity(_0x48f223,_0x5d101a){return function(_0x319cf7){if(_0x319cf7){return _0x319cf7[_0x6b59('0x23')]()[_0x6b59('0x24')](function(){var _0x2915bf=_0x319cf7[_0x6b59('0x25')]({'plain':!![]});var _0x4c2116=_0x6b59('0x26');return db[_0x6b59('0x27')][_0x6b59('0x23')]({'where':{'type':_0x4c2116,'resourceId':_0x2915bf['id']}})['then'](function(){return _0x319cf7;});})[_0x6b59('0x24')](function(){_0x48f223['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4431cd,_0x2a70f0){return function(_0x1da595){if(!_0x1da595){_0x4431cd[_0x6b59('0x19')](0x194);}return _0x1da595;};}function handleError(_0x205d51,_0x47db5a){_0x47db5a=_0x47db5a||0x1f4;return function(_0x1c75f0){logger['error'](_0x1c75f0[_0x6b59('0x28')]);if(_0x1c75f0['name']){delete _0x1c75f0['name'];}_0x205d51[_0x6b59('0x1a')](_0x47db5a)['send'](_0x1c75f0);};}exports[_0x6b59('0x29')]=function(_0x588f38,_0x515580){var _0x1cc062={},_0x1a9f44={},_0xb306a6={'count':0x0,'rows':[]};var _0x5d2284=_[_0x6b59('0x2a')](db[_0x6b59('0x2b')]['rawAttributes'],function(_0x3a88af){return{'name':_0x3a88af[_0x6b59('0x2c')],'type':_0x3a88af[_0x6b59('0x2d')][_0x6b59('0x2e')]};});_0x1a9f44[_0x6b59('0x2f')]=_[_0x6b59('0x2a')](_0x5d2284,_0x6b59('0x30'));_0x1a9f44[_0x6b59('0x31')]=_[_0x6b59('0x32')](_0x588f38[_0x6b59('0x31')]);_0x1a9f44['filters']=_[_0x6b59('0x33')](_0x1a9f44[_0x6b59('0x2f')],_0x1a9f44[_0x6b59('0x31')]);_0x1cc062['attributes']=_['intersection'](_0x1a9f44[_0x6b59('0x2f')],qs[_0x6b59('0x34')](_0x588f38['query'][_0x6b59('0x34')]));_0x1cc062[_0x6b59('0x35')]=_0x1cc062[_0x6b59('0x35')][_0x6b59('0x36')]?_0x1cc062[_0x6b59('0x35')]:_0x1a9f44[_0x6b59('0x2f')];if(!_0x588f38[_0x6b59('0x31')][_0x6b59('0x37')](_0x6b59('0x38'))){_0x1cc062[_0x6b59('0x39')]=qs[_0x6b59('0x39')](_0x588f38[_0x6b59('0x31')][_0x6b59('0x39')]);_0x1cc062[_0x6b59('0x1e')]=qs[_0x6b59('0x1e')](_0x588f38[_0x6b59('0x31')][_0x6b59('0x1e')]);}_0x1cc062[_0x6b59('0x3a')]=qs[_0x6b59('0x3b')](_0x588f38[_0x6b59('0x31')][_0x6b59('0x3b')]);_0x1cc062[_0x6b59('0x3c')]=qs[_0x6b59('0x3d')](_[_0x6b59('0x3e')](_0x588f38[_0x6b59('0x31')],_0x1a9f44[_0x6b59('0x3d')]),_0x5d2284);if(_0x588f38[_0x6b59('0x31')]['filter']){_0x1cc062[_0x6b59('0x3c')]=_['merge'](_0x1cc062[_0x6b59('0x3c')],{'$or':_['map'](_0x5d2284,function(_0x5e6aa5){if(_0x5e6aa5[_0x6b59('0x2d')]!==_0x6b59('0x3f')){var _0x2f869f={};_0x2f869f[_0x5e6aa5['name']]={'$like':'%'+_0x588f38[_0x6b59('0x31')][_0x6b59('0x40')]+'%'};return _0x2f869f;}})});}_0x1cc062=_[_0x6b59('0x41')]({},_0x1cc062,_0x588f38[_0x6b59('0x42')]);var _0x5d7914={'where':_0x1cc062[_0x6b59('0x3c')]};return db[_0x6b59('0x2b')][_0x6b59('0x1d')](_0x5d7914)[_0x6b59('0x24')](function(_0x3bf9ab){_0xb306a6['count']=_0x3bf9ab;if(_0x588f38[_0x6b59('0x31')][_0x6b59('0x43')]){_0x1cc062[_0x6b59('0x44')]=[{'all':!![]}];}return db[_0x6b59('0x2b')][_0x6b59('0x45')](_0x1cc062);})['then'](function(_0x3d8659){_0xb306a6[_0x6b59('0x46')]=_0x3d8659;return _0xb306a6;})[_0x6b59('0x24')](respondWithFilteredResult(_0x515580,_0x1cc062))[_0x6b59('0x47')](handleError(_0x515580,null));};exports[_0x6b59('0x48')]=function(_0x356957,_0x3282a7){var _0x4f8b70={'raw':!![],'where':{'id':_0x356957[_0x6b59('0x49')]['id']}},_0x3b62f7={};_0x3b62f7[_0x6b59('0x2f')]=_[_0x6b59('0x32')](db[_0x6b59('0x2b')][_0x6b59('0x4a')]);_0x3b62f7[_0x6b59('0x31')]=_['keys'](_0x356957['query']);_0x3b62f7[_0x6b59('0x3d')]=_[_0x6b59('0x33')](_0x3b62f7['model'],_0x3b62f7[_0x6b59('0x31')]);_0x4f8b70[_0x6b59('0x35')]=_['intersection'](_0x3b62f7[_0x6b59('0x2f')],qs[_0x6b59('0x34')](_0x356957[_0x6b59('0x31')][_0x6b59('0x34')]));_0x4f8b70[_0x6b59('0x35')]=_0x4f8b70['attributes']['length']?_0x4f8b70[_0x6b59('0x35')]:_0x3b62f7[_0x6b59('0x2f')];if(_0x356957['query'][_0x6b59('0x43')]){_0x4f8b70[_0x6b59('0x44')]=[{'all':!![]}];}_0x4f8b70=_['merge']({},_0x4f8b70,_0x356957[_0x6b59('0x42')]);return db[_0x6b59('0x2b')][_0x6b59('0x4b')](_0x4f8b70)[_0x6b59('0x24')](handleEntityNotFound(_0x3282a7,null))[_0x6b59('0x24')](respondWithResult(_0x3282a7,null))[_0x6b59('0x47')](handleError(_0x3282a7,null));};exports['create']=function(_0x44d018,_0x26c111){return db['AnalyticExtractedReport']['create'](_0x44d018[_0x6b59('0x4c')],{})[_0x6b59('0x24')](function(_0xbb6f06){var _0x40dbcd=_0x44d018['user'][_0x6b59('0x25')]({'plain':!![]});if(!_0x40dbcd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40dbcd['role']===_0x6b59('0x4d')){var _0x478336=_0xbb6f06[_0x6b59('0x25')]({'plain':!![]});var _0x298118='ExtractedReports';return db[_0x6b59('0x4e')][_0x6b59('0x4b')]({'where':{'name':_0x298118,'userProfileId':_0x40dbcd[_0x6b59('0x4f')]},'raw':!![]})[_0x6b59('0x24')](function(_0x3543a2){if(_0x3543a2&&_0x3543a2['autoAssociation']===0x0){return db[_0x6b59('0x27')][_0x6b59('0x50')]({'name':_0x478336[_0x6b59('0x30')],'resourceId':_0x478336['id'],'type':_0x3543a2['name'],'sectionId':_0x3543a2['id']},{})[_0x6b59('0x24')](function(){return _0xbb6f06;});}else{return _0xbb6f06;}})[_0x6b59('0x47')](function(_0x1bc4e1){logger[_0x6b59('0x51')](_0x6b59('0x52'),_0x1bc4e1);throw _0x1bc4e1;});}return _0xbb6f06;})[_0x6b59('0x24')](respondWithResult(_0x26c111,0xc9))[_0x6b59('0x47')](handleError(_0x26c111,null));};exports[_0x6b59('0x22')]=function(_0x321601,_0x25d556){if(_0x321601['body']['id']){delete _0x321601[_0x6b59('0x4c')]['id'];}return db[_0x6b59('0x2b')][_0x6b59('0x4b')]({'where':{'id':_0x321601[_0x6b59('0x49')]['id']}})['then'](handleEntityNotFound(_0x25d556,null))[_0x6b59('0x24')](saveUpdates(_0x321601[_0x6b59('0x4c')],null))[_0x6b59('0x24')](respondWithResult(_0x25d556,null))[_0x6b59('0x47')](handleError(_0x25d556,null));};exports[_0x6b59('0x23')]=function(_0x1a3099,_0x25cefd){return db['AnalyticExtractedReport'][_0x6b59('0x4b')]({'where':{'id':_0x1a3099[_0x6b59('0x49')]['id']}})['then'](handleEntityNotFound(_0x25cefd,null))[_0x6b59('0x24')](removeEntity(_0x25cefd,null))[_0x6b59('0x47')](handleError(_0x25cefd,null));};exports['download']=function(_0x36fdb0,_0x8046a1,_0x33f8af){return db[_0x6b59('0x2b')]['find']({'where':{'id':_0x36fdb0['params']['id']},'attributes':['name','basename',_0x6b59('0x53'),_0x6b59('0x54')],'raw':!![]})[_0x6b59('0x24')](handleEntityNotFound(_0x8046a1,null))[_0x6b59('0x24')](function(_0x2ca302){if(_0x2ca302){if(!fs[_0x6b59('0x55')](path[_0x6b59('0x56')](config[_0x6b59('0x57')],'server/files/reports',_0x2ca302[_0x6b59('0x53')]))){throw new db[(_0x6b59('0x58'))]['ValidationError'](_0x6b59('0x59'));}if(_0x36fdb0[_0x6b59('0x31')]['exists']){return _0x8046a1[_0x6b59('0x19')](0xc8);}return _0x8046a1[_0x6b59('0x5a')](path[_0x6b59('0x56')](config['root'],_0x6b59('0x5b'),_0x2ca302[_0x6b59('0x53')]),util[_0x6b59('0x5c')](_0x6b59('0x5d'),_0x2ca302[_0x6b59('0x5e')]||_0x2ca302[_0x6b59('0x30')],_0x2ca302[_0x6b59('0x54')][_0x6b59('0x5f')]()));}})[_0x6b59('0x47')](handleError(_0x8046a1,null));};
\ No newline at end of file
+var _0xfeee=['name','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','download','format','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','error','stack'];(function(_0x5a4979,_0x5f445b){var _0xe92b3a=function(_0x183055){while(--_0x183055){_0x5a4979['push'](_0x5a4979['shift']());}};_0xe92b3a(++_0x5f445b);}(_0xfeee,0x8a));var _0xefee=function(_0x3e2789,_0x6d23c6){_0x3e2789=_0x3e2789-0x0;var _0x4371ba=_0xfeee[_0x3e2789];return _0x4371ba;};'use strict';var pdf=require(_0xefee('0x0'));var emlformat=require(_0xefee('0x1'));var rimraf=require(_0xefee('0x2'));var zipdir=require(_0xefee('0x3'));var jsonpatch=require(_0xefee('0x4'));var rp=require(_0xefee('0x5'));var moment=require('moment');var BPromise=require(_0xefee('0x6'));var Mustache=require(_0xefee('0x7'));var util=require('util');var path=require('path');var sox=require(_0xefee('0x8'));var csv=require(_0xefee('0x9'));var ejs=require(_0xefee('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xefee('0xb'));var crypto=require(_0xefee('0xc'));var jsforce=require(_0xefee('0xd'));var deskjs=require(_0xefee('0xe'));var toCsv=require(_0xefee('0x9'));var querystring=require('querystring');var Papa=require(_0xefee('0xf'));var Redis=require('ioredis');var authService=require(_0xefee('0x10'));var qs=require(_0xefee('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefee('0x12'));var logger=require(_0xefee('0x13'))(_0xefee('0x14'));var utils=require(_0xefee('0x15'));var config=require(_0xefee('0x16'));var db=require(_0xefee('0x17'))['db'];function respondWithStatusCode(_0x100cb6,_0x439afc){_0x439afc=_0x439afc||0xcc;return function(_0x2ccd11){if(_0x2ccd11){return _0x100cb6[_0xefee('0x18')](_0x439afc);}return _0x100cb6[_0xefee('0x19')](_0x439afc)[_0xefee('0x1a')]();};}function respondWithResult(_0x24934a,_0x49a603){_0x49a603=_0x49a603||0xc8;return function(_0x4f34f5){if(_0x4f34f5){return _0x24934a[_0xefee('0x19')](_0x49a603)[_0xefee('0x1b')](_0x4f34f5);}};}function respondWithFilteredResult(_0x41a3f4,_0x1b9cac){return function(_0x2ab471){if(_0x2ab471){var _0x59ef52=_0x2ab471[_0xefee('0x1c')],_0x3beea0=_0x1b9cac[_0xefee('0x1d')],_0x2b99b6=_0x1b9cac['offset']+_0x1b9cac[_0xefee('0x1e')],_0x3ec7ff;if(_0x2b99b6>=_0x59ef52){_0x2b99b6=_0x59ef52;_0x3ec7ff=0xc8;}else{_0x3ec7ff=0xce;}_0x41a3f4['status'](_0x3ec7ff);return _0x41a3f4[_0xefee('0x1f')](_0xefee('0x20'),_0x3beea0+'-'+_0x2b99b6+'/'+_0x59ef52)[_0xefee('0x1b')](_0x2ab471);}return null;};}function patchUpdates(_0xd55bf9){return function(_0x4ef0d2){try{jsonpatch[_0xefee('0x21')](_0x4ef0d2,_0xd55bf9,!![]);}catch(_0xa1aa80){return BPromise[_0xefee('0x22')](_0xa1aa80);}return _0x4ef0d2[_0xefee('0x23')]();};}function saveUpdates(_0xa9796c,_0x4e3e6e){return function(_0x4136f3){if(_0x4136f3){return _0x4136f3[_0xefee('0x24')](_0xa9796c)[_0xefee('0x25')](function(_0x214a80){return _0x214a80;});}return null;};}function removeEntity(_0x2da554,_0xf6a1dd){return function(_0x3c61dc){if(_0x3c61dc){return _0x3c61dc[_0xefee('0x26')]()[_0xefee('0x25')](function(){var _0x5e4bda=_0x3c61dc['get']({'plain':!![]});var _0x49d177=_0xefee('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x49d177,'resourceId':_0x5e4bda['id']}})[_0xefee('0x25')](function(){return _0x3c61dc;});})[_0xefee('0x25')](function(){_0x2da554['status'](0xcc)[_0xefee('0x1a')]();});}};}function handleEntityNotFound(_0x4bef00,_0x5929d9){return function(_0x1d1e61){if(!_0x1d1e61){_0x4bef00[_0xefee('0x18')](0x194);}return _0x1d1e61;};}function handleError(_0x5b81c8,_0x4b28cf){_0x4b28cf=_0x4b28cf||0x1f4;return function(_0x246709){logger[_0xefee('0x28')](_0x246709[_0xefee('0x29')]);if(_0x246709[_0xefee('0x2a')]){delete _0x246709['name'];}_0x5b81c8[_0xefee('0x19')](_0x4b28cf)['send'](_0x246709);};}exports['index']=function(_0xc96a2f,_0x57b2d4){var _0x19186c={},_0x7a6719={},_0x487492={'count':0x0,'rows':[]};var _0x4d7373=_[_0xefee('0x2b')](db[_0xefee('0x2c')][_0xefee('0x2d')],function(_0x21c047){return{'name':_0x21c047[_0xefee('0x2e')],'type':_0x21c047[_0xefee('0x2f')][_0xefee('0x30')]};});_0x7a6719[_0xefee('0x31')]=_[_0xefee('0x2b')](_0x4d7373,_0xefee('0x2a'));_0x7a6719['query']=_[_0xefee('0x32')](_0xc96a2f['query']);_0x7a6719[_0xefee('0x33')]=_[_0xefee('0x34')](_0x7a6719[_0xefee('0x31')],_0x7a6719[_0xefee('0x35')]);_0x19186c['attributes']=_['intersection'](_0x7a6719['model'],qs[_0xefee('0x36')](_0xc96a2f['query'][_0xefee('0x36')]));_0x19186c[_0xefee('0x37')]=_0x19186c[_0xefee('0x37')][_0xefee('0x38')]?_0x19186c['attributes']:_0x7a6719[_0xefee('0x31')];if(!_0xc96a2f[_0xefee('0x35')]['hasOwnProperty'](_0xefee('0x39'))){_0x19186c[_0xefee('0x1e')]=qs[_0xefee('0x1e')](_0xc96a2f[_0xefee('0x35')][_0xefee('0x1e')]);_0x19186c[_0xefee('0x1d')]=qs[_0xefee('0x1d')](_0xc96a2f[_0xefee('0x35')]['offset']);}_0x19186c[_0xefee('0x3a')]=qs[_0xefee('0x3b')](_0xc96a2f['query'][_0xefee('0x3b')]);_0x19186c[_0xefee('0x3c')]=qs[_0xefee('0x33')](_['pick'](_0xc96a2f[_0xefee('0x35')],_0x7a6719[_0xefee('0x33')]),_0x4d7373);if(_0xc96a2f[_0xefee('0x35')][_0xefee('0x3d')]){_0x19186c[_0xefee('0x3c')]=_[_0xefee('0x3e')](_0x19186c[_0xefee('0x3c')],{'$or':_[_0xefee('0x2b')](_0x4d7373,function(_0x56f14f){if(_0x56f14f['type']!=='VIRTUAL'){var _0x1d774d={};_0x1d774d[_0x56f14f['name']]={'$like':'%'+_0xc96a2f[_0xefee('0x35')][_0xefee('0x3d')]+'%'};return _0x1d774d;}})});}_0x19186c=_[_0xefee('0x3e')]({},_0x19186c,_0xc96a2f[_0xefee('0x3f')]);var _0x39f8f6={'where':_0x19186c[_0xefee('0x3c')]};return db[_0xefee('0x2c')]['count'](_0x39f8f6)[_0xefee('0x25')](function(_0x5bf80a){_0x487492[_0xefee('0x1c')]=_0x5bf80a;if(_0xc96a2f[_0xefee('0x35')][_0xefee('0x40')]){_0x19186c['include']=[{'all':!![]}];}return db[_0xefee('0x2c')][_0xefee('0x41')](_0x19186c);})[_0xefee('0x25')](function(_0x355bb6){_0x487492['rows']=_0x355bb6;return _0x487492;})[_0xefee('0x25')](respondWithFilteredResult(_0x57b2d4,_0x19186c))[_0xefee('0x42')](handleError(_0x57b2d4,null));};exports['show']=function(_0x4bd95c,_0x177075){var _0x44fd1f={'raw':!![],'where':{'id':_0x4bd95c[_0xefee('0x43')]['id']}},_0x51a897={};_0x51a897[_0xefee('0x31')]=_[_0xefee('0x32')](db[_0xefee('0x2c')][_0xefee('0x2d')]);_0x51a897[_0xefee('0x35')]=_[_0xefee('0x32')](_0x4bd95c[_0xefee('0x35')]);_0x51a897['filters']=_[_0xefee('0x34')](_0x51a897['model'],_0x51a897[_0xefee('0x35')]);_0x44fd1f['attributes']=_[_0xefee('0x34')](_0x51a897['model'],qs[_0xefee('0x36')](_0x4bd95c[_0xefee('0x35')]['fields']));_0x44fd1f['attributes']=_0x44fd1f[_0xefee('0x37')][_0xefee('0x38')]?_0x44fd1f['attributes']:_0x51a897[_0xefee('0x31')];if(_0x4bd95c[_0xefee('0x35')]['includeAll']){_0x44fd1f['include']=[{'all':!![]}];}_0x44fd1f=_[_0xefee('0x3e')]({},_0x44fd1f,_0x4bd95c[_0xefee('0x3f')]);return db[_0xefee('0x2c')][_0xefee('0x44')](_0x44fd1f)[_0xefee('0x25')](handleEntityNotFound(_0x177075,null))[_0xefee('0x25')](respondWithResult(_0x177075,null))[_0xefee('0x42')](handleError(_0x177075,null));};exports[_0xefee('0x45')]=function(_0x3efbd8,_0x328e8b){return db['AnalyticExtractedReport'][_0xefee('0x45')](_0x3efbd8[_0xefee('0x46')],{})[_0xefee('0x25')](function(_0x416512){var _0x5a3514=_0x3efbd8[_0xefee('0x47')][_0xefee('0x48')]({'plain':!![]});if(!_0x5a3514)throw new Error(_0xefee('0x49'));if(_0x5a3514['role']===_0xefee('0x47')){var _0x530e21=_0x416512[_0xefee('0x48')]({'plain':!![]});var _0x17e148='ExtractedReports';return db['UserProfileSection'][_0xefee('0x44')]({'where':{'name':_0x17e148,'userProfileId':_0x5a3514['userProfileId']},'raw':!![]})[_0xefee('0x25')](function(_0xfaef9){if(_0xfaef9&&_0xfaef9[_0xefee('0x4a')]===0x0){return db[_0xefee('0x4b')]['create']({'name':_0x530e21[_0xefee('0x2a')],'resourceId':_0x530e21['id'],'type':_0xfaef9[_0xefee('0x2a')],'sectionId':_0xfaef9['id']},{})[_0xefee('0x25')](function(){return _0x416512;});}else{return _0x416512;}})[_0xefee('0x42')](function(_0x5541b6){logger['error'](_0xefee('0x4c'),_0x5541b6);throw _0x5541b6;});}return _0x416512;})[_0xefee('0x25')](respondWithResult(_0x328e8b,0xc9))[_0xefee('0x42')](handleError(_0x328e8b,null));};exports[_0xefee('0x24')]=function(_0x34f9b3,_0x60e954){if(_0x34f9b3[_0xefee('0x46')]['id']){delete _0x34f9b3[_0xefee('0x46')]['id'];}return db[_0xefee('0x2c')]['find']({'where':{'id':_0x34f9b3[_0xefee('0x43')]['id']}})[_0xefee('0x25')](handleEntityNotFound(_0x60e954,null))[_0xefee('0x25')](saveUpdates(_0x34f9b3[_0xefee('0x46')],null))[_0xefee('0x25')](respondWithResult(_0x60e954,null))[_0xefee('0x42')](handleError(_0x60e954,null));};exports[_0xefee('0x26')]=function(_0x43240f,_0x5ecd68){return db[_0xefee('0x2c')]['find']({'where':{'id':_0x43240f['params']['id']}})[_0xefee('0x25')](handleEntityNotFound(_0x5ecd68,null))[_0xefee('0x25')](removeEntity(_0x5ecd68,null))[_0xefee('0x42')](handleError(_0x5ecd68,null));};exports['download']=function(_0xdf8e8c,_0x185a4a,_0x4e329b){return db[_0xefee('0x2c')][_0xefee('0x44')]({'where':{'id':_0xdf8e8c[_0xefee('0x43')]['id']},'attributes':[_0xefee('0x2a'),_0xefee('0x4d'),_0xefee('0x4e'),_0xefee('0x4f')],'raw':!![]})[_0xefee('0x25')](handleEntityNotFound(_0x185a4a,null))['then'](function(_0x139425){if(_0x139425){if(!fs[_0xefee('0x50')](path[_0xefee('0x51')](config[_0xefee('0x52')],_0xefee('0x53'),_0x139425[_0xefee('0x4e')]))){throw new db['Sequelize'][(_0xefee('0x54'))](_0xefee('0x55'));}if(_0xdf8e8c[_0xefee('0x35')]['exists']){return _0x185a4a[_0xefee('0x18')](0xc8);}return _0x185a4a[_0xefee('0x56')](path['join'](config[_0xefee('0x52')],_0xefee('0x53'),_0x139425['savename']),util[_0xefee('0x57')](_0xefee('0x58'),_0x139425[_0xefee('0x4d')]||_0x139425[_0xefee('0x2a')],_0x139425[_0xefee('0x4f')][_0xefee('0x59')]()));}})['catch'](handleError(_0x185a4a,null));};
\ No newline at end of file
index f5c75b3..06bd9b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2647=['request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2f483e,_0x4d2161){var _0x29238d=function(_0x28d089){while(--_0x28d089){_0x2f483e['push'](_0x2f483e['shift']());}};_0x29238d(++_0x4d2161);}(_0x2647,0x7f));var _0x7264=function(_0x524e23,_0x1e2aa7){_0x524e23=_0x524e23-0x0;var _0x231413=_0x2647[_0x524e23];return _0x231413;};'use strict';var _=require(_0x7264('0x0'));var util=require(_0x7264('0x1'));var logger=require(_0x7264('0x2'))('api');var moment=require(_0x7264('0x3'));var BPromise=require(_0x7264('0x4'));var rp=require(_0x7264('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7264('0x6'));var config=require('../../config/environment');var attributes=require(_0x7264('0x7'));module[_0x7264('0x8')]=function(_0x22ae89,_0x4a3072){return _0x22ae89[_0x7264('0x9')](_0x7264('0xa'),attributes,{'tableName':_0x7264('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb0ff=['define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','moment','bluebird','request-promise','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x27fa58,_0x33b050){var _0x5bd300=function(_0x1477ef){while(--_0x1477ef){_0x27fa58['push'](_0x27fa58['shift']());}};_0x5bd300(++_0x33b050);}(_0xb0ff,0xb3));var _0xfb0f=function(_0x231b28,_0x310bd1){_0x231b28=_0x231b28-0x0;var _0x110c17=_0xb0ff[_0x231b28];return _0x110c17;};'use strict';var _=require('lodash');var util=require(_0xfb0f('0x0'));var logger=require(_0xfb0f('0x1'))('api');var moment=require(_0xfb0f('0x2'));var BPromise=require(_0xfb0f('0x3'));var rp=require(_0xfb0f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb0f('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb0f('0x6'));module[_0xfb0f('0x7')]=function(_0x334b59,_0x2583f8){return _0x334b59[_0xfb0f('0x8')](_0xfb0f('0x9'),attributes,{'tableName':_0xfb0f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 30a1428..fbbc2db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9335=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','util'];(function(_0x1d7cc3,_0x5dfffe){var _0x4468ae=function(_0x4c765f){while(--_0x4c765f){_0x1d7cc3['push'](_0x1d7cc3['shift']());}};_0x4468ae(++_0x5dfffe);}(_0x9335,0x1f2));var _0x5933=function(_0x4b5807,_0x2ba496){_0x4b5807=_0x4b5807-0x0;var _0x420adb=_0x9335[_0x4b5807];return _0x420adb;};'use strict';var _=require(_0x5933('0x0'));var util=require(_0x5933('0x1'));var moment=require(_0x5933('0x2'));var BPromise=require(_0x5933('0x3'));var rs=require(_0x5933('0x4'));var fs=require('fs');var Redis=require(_0x5933('0x5'));var db=require(_0x5933('0x6'))['db'];var utils=require(_0x5933('0x7'));var logger=require(_0x5933('0x8'))(_0x5933('0x9'));var config=require(_0x5933('0xa'));var jayson=require(_0x5933('0xb'));var client=jayson[_0x5933('0xc')][_0x5933('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5ee123,_0x198217,_0x5ec1e4){return new BPromise(function(_0x38cdf7,_0x20fe77){return client[_0x5933('0xe')](_0x5ee123,_0x5ec1e4)[_0x5933('0xf')](function(_0x242ead){logger[_0x5933('0x10')](_0x5933('0x11'),_0x198217,'request\x20sent');logger[_0x5933('0x12')](_0x5933('0x13'),_0x198217,'request\x20sent',JSON[_0x5933('0x14')](_0x242ead));if(_0x242ead[_0x5933('0x15')]){if(_0x242ead[_0x5933('0x15')]['code']===0x1f4){logger[_0x5933('0x15')](_0x5933('0x11'),_0x198217,_0x242ead['error'][_0x5933('0x16')]);return _0x20fe77(_0x242ead[_0x5933('0x15')][_0x5933('0x16')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x198217,_0x242ead['error'][_0x5933('0x16')]);return _0x38cdf7(_0x242ead[_0x5933('0x15')][_0x5933('0x16')]);}else{logger[_0x5933('0x10')](_0x5933('0x11'),_0x198217,_0x5933('0x17'));_0x38cdf7(_0x242ead['result']['message']);}})[_0x5933('0x18')](function(_0x17afe7){logger[_0x5933('0x15')](_0x5933('0x11'),_0x198217,_0x17afe7);_0x20fe77(_0x17afe7);});});}
\ No newline at end of file
+var _0x2e44=['jayson/promise','client','http','request','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2ed01e,_0x588831){var _0x3108e6=function(_0xabd816){while(--_0xabd816){_0x2ed01e['push'](_0x2ed01e['shift']());}};_0x3108e6(++_0x588831);}(_0x2e44,0xa8));var _0x42e4=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x2e44[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x42e4('0x0'));var util=require('util');var moment=require(_0x42e4('0x1'));var BPromise=require(_0x42e4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x42e4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x42e4('0x4'));var logger=require(_0x42e4('0x5'))(_0x42e4('0x6'));var config=require(_0x42e4('0x7'));var jayson=require(_0x42e4('0x8'));var client=jayson[_0x42e4('0x9')][_0x42e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ae979,_0x5681ea,_0x5eca3d){return new BPromise(function(_0x5e6806,_0x18466f){return client[_0x42e4('0xb')](_0x3ae979,_0x5eca3d)['then'](function(_0x323c5b){logger[_0x42e4('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5681ea,_0x42e4('0xd'));logger[_0x42e4('0xe')](_0x42e4('0xf'),_0x5681ea,_0x42e4('0xd'),JSON[_0x42e4('0x10')](_0x323c5b));if(_0x323c5b[_0x42e4('0x11')]){if(_0x323c5b[_0x42e4('0x11')][_0x42e4('0x12')]===0x1f4){logger[_0x42e4('0x11')](_0x42e4('0x13'),_0x5681ea,_0x323c5b[_0x42e4('0x11')]['message']);return _0x18466f(_0x323c5b['error']['message']);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5681ea,_0x323c5b[_0x42e4('0x11')][_0x42e4('0x14')]);return _0x5e6806(_0x323c5b[_0x42e4('0x11')][_0x42e4('0x14')]);}else{logger[_0x42e4('0xc')](_0x42e4('0x13'),_0x5681ea,_0x42e4('0xd'));_0x5e6806(_0x323c5b[_0x42e4('0x15')][_0x42e4('0x14')]);}})['catch'](function(_0x34d05e){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5681ea,_0x34d05e);_0x18466f(_0x34d05e);});});}
\ No newline at end of file
index 39b5018..501f389 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3ef=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/download','download','create','put','delete','exports','util','path','connect-timeout'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xd3ef,0xce));var _0xfd3e=function(_0x3028b1,_0x5f25f6){_0x3028b1=_0x3028b1-0x0;var _0x48a234=_0xd3ef[_0x3028b1];return _0x48a234;};'use strict';var multer=require('multer');var util=require(_0xfd3e('0x0'));var path=require(_0xfd3e('0x1'));var timeout=require(_0xfd3e('0x2'));var express=require(_0xfd3e('0x3'));var router=express[_0xfd3e('0x4')]();var auth=require(_0xfd3e('0x5'));var interaction=require(_0xfd3e('0x6'));var config=require(_0xfd3e('0x7'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xfd3e('0x8')](),controller[_0xfd3e('0x9')]);router[_0xfd3e('0xa')](_0xfd3e('0xb'),auth[_0xfd3e('0x8')](),controller[_0xfd3e('0xc')]);router[_0xfd3e('0xa')](_0xfd3e('0xd'),auth[_0xfd3e('0x8')](),controller[_0xfd3e('0xe')]);router['post']('/',auth[_0xfd3e('0x8')](),controller[_0xfd3e('0xf')]);router[_0xfd3e('0x10')](_0xfd3e('0xb'),auth[_0xfd3e('0x8')](),controller['update']);router[_0xfd3e('0x11')](_0xfd3e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xfd3e('0x12')]=router;
\ No newline at end of file
+var _0x4e60=['index','/:id','show','/:id/download','download','post','create','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x4e60,0x1ea));var _0x04e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4e60[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x04e6('0x0'));var util=require(_0x04e6('0x1'));var path=require(_0x04e6('0x2'));var timeout=require(_0x04e6('0x3'));var express=require(_0x04e6('0x4'));var router=express['Router']();var auth=require(_0x04e6('0x5'));var interaction=require(_0x04e6('0x6'));var config=require('../../config/environment');var controller=require(_0x04e6('0x7'));router[_0x04e6('0x8')]('/',auth[_0x04e6('0x9')](),controller[_0x04e6('0xa')]);router[_0x04e6('0x8')](_0x04e6('0xb'),auth[_0x04e6('0x9')](),controller[_0x04e6('0xc')]);router['get'](_0x04e6('0xd'),auth[_0x04e6('0x9')](),controller[_0x04e6('0xe')]);router[_0x04e6('0xf')]('/',auth[_0x04e6('0x9')](),controller[_0x04e6('0x10')]);router[_0x04e6('0x11')]('/:id',auth[_0x04e6('0x9')](),controller[_0x04e6('0x12')]);router['delete']('/:id',auth[_0x04e6('0x9')](),controller['destroy']);module[_0x04e6('0x13')]=router;
\ No newline at end of file
index 0e7c983..d6c774d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['sequelize','exports','STRING'];(function(_0x5ed1d4,_0x3e2218){var _0x1a85ca=function(_0x384ae3){while(--_0x384ae3){_0x5ed1d4['push'](_0x5ed1d4['shift']());}};_0x1a85ca(++_0x3e2218);}(_0xe14b,0x93));var _0xbe14=function(_0x4ef970,_0x56d3ec){_0x4ef970=_0x4ef970-0x0;var _0x3a29e1=_0xe14b[_0x4ef970];return _0x3a29e1;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe14('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xe14b=['sequelize','exports','STRING'];(function(_0x26f641,_0x1111f1){var _0x27462c=function(_0x35bdeb){while(--_0x35bdeb){_0x26f641['push'](_0x26f641['shift']());}};_0x27462c(++_0x1111f1);}(_0xe14b,0x93));var _0xbe14=function(_0x122fe6,_0x4ac758){_0x122fe6=_0x122fe6-0x0;var _0x36b7d2=_0xe14b[_0x122fe6];return _0x36b7d2;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe14('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 1aa86dd..5ead312 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b99=['order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','keys','catch','create','body','bulkCreate','find','bulkDestroy','addFields','findOne','sequelize','transaction','CustomReportId','html-pdf','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','save','update','then','destroy','end','error','stack','name','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','nolimit','limit'];(function(_0x2f843f,_0x4b368c){var _0x6df32d=function(_0x1314f3){while(--_0x1314f3){_0x2f843f['push'](_0x2f843f['shift']());}};_0x6df32d(++_0x4b368c);}(_0x4b99,0x107));var _0x94b9=function(_0x531a72,_0x10922e){_0x531a72=_0x531a72-0x0;var _0x26ccd5=_0x4b99[_0x531a72];return _0x26ccd5;};'use strict';var pdf=require(_0x94b9('0x0'));var emlformat=require(_0x94b9('0x1'));var rimraf=require(_0x94b9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x94b9('0x3'));var moment=require(_0x94b9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x94b9('0x5'));var util=require('util');var path=require('path');var sox=require(_0x94b9('0x6'));var csv=require(_0x94b9('0x7'));var ejs=require(_0x94b9('0x8'));var fs=require('fs');var _=require(_0x94b9('0x9'));var squel=require(_0x94b9('0xa'));var crypto=require('crypto');var jsforce=require(_0x94b9('0xb'));var deskjs=require(_0x94b9('0xc'));var toCsv=require(_0x94b9('0x7'));var querystring=require('querystring');var Papa=require(_0x94b9('0xd'));var Redis=require('ioredis');var authService=require(_0x94b9('0xe'));var qs=require(_0x94b9('0xf'));var as=require(_0x94b9('0x10'));var hardwareService=require(_0x94b9('0x11'));var logger=require(_0x94b9('0x12'))(_0x94b9('0x13'));var utils=require(_0x94b9('0x14'));var config=require(_0x94b9('0x15'));var db=require(_0x94b9('0x16'))['db'];function respondWithStatusCode(_0x31fe50,_0xd85cff){_0xd85cff=_0xd85cff||0xcc;return function(_0x8d76a2){if(_0x8d76a2){return _0x31fe50[_0x94b9('0x17')](_0xd85cff);}return _0x31fe50[_0x94b9('0x18')](_0xd85cff)['end']();};}function respondWithResult(_0x4c639f,_0x424934){_0x424934=_0x424934||0xc8;return function(_0x5341e3){if(_0x5341e3){return _0x4c639f[_0x94b9('0x18')](_0x424934)[_0x94b9('0x19')](_0x5341e3);}};}function respondWithFilteredResult(_0x4d37d6,_0x3c9810){return function(_0xf9cf71){if(_0xf9cf71){var _0x5068cf=_0xf9cf71[_0x94b9('0x1a')],_0x47e92e=_0x3c9810[_0x94b9('0x1b')],_0x1d488f=_0x3c9810[_0x94b9('0x1b')]+_0x3c9810['limit'],_0x2c34ae;if(_0x1d488f>=_0x5068cf){_0x1d488f=_0x5068cf;_0x2c34ae=0xc8;}else{_0x2c34ae=0xce;}_0x4d37d6[_0x94b9('0x18')](_0x2c34ae);return _0x4d37d6[_0x94b9('0x1c')]('Content-Range',_0x47e92e+'-'+_0x1d488f+'/'+_0x5068cf)[_0x94b9('0x19')](_0xf9cf71);}return null;};}function patchUpdates(_0x5ad329){return function(_0x3b3e97){try{jsonpatch[_0x94b9('0x1d')](_0x3b3e97,_0x5ad329,!![]);}catch(_0x23b64d){return BPromise[_0x94b9('0x1e')](_0x23b64d);}return _0x3b3e97[_0x94b9('0x1f')]();};}function saveUpdates(_0x389f80,_0x8ed231){return function(_0x4b501c){if(_0x4b501c){return _0x4b501c[_0x94b9('0x20')](_0x389f80)[_0x94b9('0x21')](function(_0x2267fb){return _0x2267fb;});}return null;};}function removeEntity(_0x191b17,_0x209685){return function(_0x511654){if(_0x511654){return _0x511654[_0x94b9('0x22')]()[_0x94b9('0x21')](function(){_0x191b17[_0x94b9('0x18')](0xcc)[_0x94b9('0x23')]();});}};}function handleEntityNotFound(_0x3f0f02,_0x22b3dc){return function(_0x14edb3){if(!_0x14edb3){_0x3f0f02['sendStatus'](0x194);}return _0x14edb3;};}function handleError(_0x422500,_0x11d5f4){_0x11d5f4=_0x11d5f4||0x1f4;return function(_0x356ed9){logger[_0x94b9('0x24')](_0x356ed9[_0x94b9('0x25')]);if(_0x356ed9[_0x94b9('0x26')]){delete _0x356ed9[_0x94b9('0x26')];}_0x422500[_0x94b9('0x18')](_0x11d5f4)['send'](_0x356ed9);};}exports['index']=function(_0x51514e,_0x2cb15b){var _0x3f4846={},_0x5dcc1e={},_0x23bf24={'count':0x0,'rows':[]};var _0x2b5a48=_[_0x94b9('0x27')](db[_0x94b9('0x28')][_0x94b9('0x29')],function(_0xabf559){return{'name':_0xabf559[_0x94b9('0x2a')],'type':_0xabf559[_0x94b9('0x2b')][_0x94b9('0x2c')]};});_0x5dcc1e['model']=_['map'](_0x2b5a48,'name');_0x5dcc1e[_0x94b9('0x2d')]=_['keys'](_0x51514e['query']);_0x5dcc1e['filters']=_[_0x94b9('0x2e')](_0x5dcc1e['model'],_0x5dcc1e['query']);_0x3f4846[_0x94b9('0x2f')]=_[_0x94b9('0x2e')](_0x5dcc1e[_0x94b9('0x30')],qs['fields'](_0x51514e[_0x94b9('0x2d')][_0x94b9('0x31')]));_0x3f4846[_0x94b9('0x2f')]=_0x3f4846[_0x94b9('0x2f')][_0x94b9('0x32')]?_0x3f4846['attributes']:_0x5dcc1e['model'];if(!_0x51514e[_0x94b9('0x2d')]['hasOwnProperty'](_0x94b9('0x33'))){_0x3f4846['limit']=qs[_0x94b9('0x34')](_0x51514e[_0x94b9('0x2d')]['limit']);_0x3f4846[_0x94b9('0x1b')]=qs[_0x94b9('0x1b')](_0x51514e['query'][_0x94b9('0x1b')]);}_0x3f4846[_0x94b9('0x35')]=qs[_0x94b9('0x36')](_0x51514e[_0x94b9('0x2d')][_0x94b9('0x36')]);_0x3f4846[_0x94b9('0x37')]=qs[_0x94b9('0x38')](_[_0x94b9('0x39')](_0x51514e[_0x94b9('0x2d')],_0x5dcc1e[_0x94b9('0x38')]),_0x2b5a48);if(_0x51514e[_0x94b9('0x2d')]['filter']){_0x3f4846[_0x94b9('0x37')]=_['merge'](_0x3f4846['where'],{'$or':_[_0x94b9('0x27')](_0x2b5a48,function(_0x7ad2ab){if(_0x7ad2ab[_0x94b9('0x2b')]!==_0x94b9('0x3a')){var _0x5092ed={};_0x5092ed[_0x7ad2ab[_0x94b9('0x26')]]={'$like':'%'+_0x51514e['query'][_0x94b9('0x3b')]+'%'};return _0x5092ed;}})});}_0x3f4846=_[_0x94b9('0x3c')]({},_0x3f4846,_0x51514e[_0x94b9('0x3d')]);var _0x2a3fe3={'where':_0x3f4846[_0x94b9('0x37')]};return db[_0x94b9('0x28')][_0x94b9('0x1a')](_0x2a3fe3)[_0x94b9('0x21')](function(_0x5a5432){_0x23bf24[_0x94b9('0x1a')]=_0x5a5432;if(_0x51514e[_0x94b9('0x2d')][_0x94b9('0x3e')]){_0x3f4846[_0x94b9('0x3f')]=[{'all':!![]}];}return db[_0x94b9('0x28')][_0x94b9('0x40')](_0x3f4846);})[_0x94b9('0x21')](function(_0x99bd1e){_0x23bf24[_0x94b9('0x41')]=_0x99bd1e;return _0x23bf24;})[_0x94b9('0x21')](respondWithFilteredResult(_0x2cb15b,_0x3f4846))['catch'](handleError(_0x2cb15b,null));};exports['show']=function(_0x12642a,_0x2b988c){var _0x123c34={'raw':![],'where':{'id':_0x12642a[_0x94b9('0x42')]['id']}},_0x31021e={};_0x31021e[_0x94b9('0x30')]=_[_0x94b9('0x43')](db[_0x94b9('0x28')][_0x94b9('0x29')]);_0x31021e['query']=_['keys'](_0x12642a[_0x94b9('0x2d')]);_0x31021e[_0x94b9('0x38')]=_[_0x94b9('0x2e')](_0x31021e[_0x94b9('0x30')],_0x31021e[_0x94b9('0x2d')]);_0x123c34[_0x94b9('0x2f')]=_['intersection'](_0x31021e['model'],qs[_0x94b9('0x31')](_0x12642a[_0x94b9('0x2d')][_0x94b9('0x31')]));_0x123c34['attributes']=_0x123c34[_0x94b9('0x2f')][_0x94b9('0x32')]?_0x123c34[_0x94b9('0x2f')]:_0x31021e[_0x94b9('0x30')];if(_0x12642a['query'][_0x94b9('0x3e')]){_0x123c34[_0x94b9('0x3f')]=[{'all':!![]}];}_0x123c34=_[_0x94b9('0x3c')]({},_0x123c34,_0x12642a[_0x94b9('0x3d')]);return db['AnalyticFieldReport']['find'](_0x123c34)[_0x94b9('0x21')](handleEntityNotFound(_0x2b988c,null))[_0x94b9('0x21')](respondWithResult(_0x2b988c,null))[_0x94b9('0x44')](handleError(_0x2b988c,null));};exports[_0x94b9('0x45')]=function(_0x19530c,_0x24b907){return db[_0x94b9('0x28')][_0x94b9('0x45')](_0x19530c[_0x94b9('0x46')],{})[_0x94b9('0x21')](respondWithResult(_0x24b907,0xc9))['catch'](handleError(_0x24b907,null));};exports[_0x94b9('0x47')]=function(_0x3d6805,_0x4bd04a){return db['AnalyticFieldReport'][_0x94b9('0x47')](_0x3d6805[_0x94b9('0x46')],{'raw':![],'individualHooks':!![]})[_0x94b9('0x21')](respondWithResult(_0x4bd04a,0xc9))[_0x94b9('0x44')](handleError(_0x4bd04a,null));};exports[_0x94b9('0x20')]=function(_0x4e80e4,_0x7cc486){if(_0x4e80e4[_0x94b9('0x46')]['id']){delete _0x4e80e4['body']['id'];}return db['AnalyticFieldReport'][_0x94b9('0x48')]({'where':{'id':_0x4e80e4[_0x94b9('0x42')]['id']}})['then'](handleEntityNotFound(_0x7cc486,null))[_0x94b9('0x21')](saveUpdates(_0x4e80e4[_0x94b9('0x46')],null))[_0x94b9('0x21')](respondWithResult(_0x7cc486,null))[_0x94b9('0x44')](handleError(_0x7cc486,null));};exports[_0x94b9('0x22')]=function(_0x186f1b,_0x1270ea){return db[_0x94b9('0x28')][_0x94b9('0x48')]({'where':{'id':_0x186f1b['params']['id']}})[_0x94b9('0x21')](handleEntityNotFound(_0x1270ea,null))[_0x94b9('0x21')](removeEntity(_0x1270ea,null))[_0x94b9('0x44')](handleError(_0x1270ea,null));};exports[_0x94b9('0x49')]=function(_0x36faac,_0x48f4f8){return db['AnalyticFieldReport'][_0x94b9('0x22')]({'where':{'id':_0x36faac[_0x94b9('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x48f4f8,0xcc))[_0x94b9('0x44')](handleError(_0x48f4f8,null));};exports[_0x94b9('0x4a')]=function(_0x10e95f,_0x523758,_0x3c4432){return db['AnalyticCustomReport'][_0x94b9('0x4b')]({'where':{'id':_0x10e95f[_0x94b9('0x42')]['id']}})[_0x94b9('0x21')](handleEntityNotFound(_0x523758,null))[_0x94b9('0x21')](function(_0x105722){if(_0x105722){return db[_0x94b9('0x4c')][_0x94b9('0x4d')](function(_0x14b3aa){return db[_0x94b9('0x28')][_0x94b9('0x22')]({'where':{'CustomReportId':_0x10e95f[_0x94b9('0x42')]['id']},'transaction':_0x14b3aa})['then'](function(_0x542c96){var _0x5844d2=_[_0x94b9('0x27')](_0x10e95f[_0x94b9('0x46')],function(_0x51e6a7){delete _0x51e6a7['id'];_0x51e6a7[_0x94b9('0x4e')]=_0x10e95f[_0x94b9('0x42')]['id'];return _0x51e6a7;});return db['AnalyticFieldReport']['bulkCreate'](_0x5844d2,{'transaction':_0x14b3aa});});})[_0x94b9('0x21')](function(){return db[_0x94b9('0x28')]['findAll']({'where':{'CustomReportId':_0x10e95f[_0x94b9('0x42')]['id']}});});}})[_0x94b9('0x21')](respondWithResult(_0x523758,null))['catch'](handleError(_0x523758,null));};
\ No newline at end of file
+var _0xfb7e=['includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','request-promise','moment','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','send','map','AnalyticFieldReport','rawAttributes','type','model','query','keys','filters','attributes','fields','length','order','sort','where','pick','filter','name','merge','options'];(function(_0x1da46b,_0x109ac4){var _0x3a94ef=function(_0x31a2b4){while(--_0x31a2b4){_0x1da46b['push'](_0x1da46b['shift']());}};_0x3a94ef(++_0x109ac4);}(_0xfb7e,0x145));var _0xefb7=function(_0x5efaa9,_0x1c12aa){_0x5efaa9=_0x5efaa9-0x0;var _0x50f6a3=_0xfb7e[_0x5efaa9];return _0x50f6a3;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xefb7('0x0'));var zipdir=require(_0xefb7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xefb7('0x2'));var moment=require(_0xefb7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xefb7('0x4'));var path=require(_0xefb7('0x5'));var sox=require(_0xefb7('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xefb7('0x7'));var squel=require(_0xefb7('0x8'));var crypto=require(_0xefb7('0x9'));var jsforce=require(_0xefb7('0xa'));var deskjs=require(_0xefb7('0xb'));var toCsv=require(_0xefb7('0xc'));var querystring=require(_0xefb7('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xefb7('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xefb7('0xf'))(_0xefb7('0x10'));var utils=require(_0xefb7('0x11'));var config=require(_0xefb7('0x12'));var db=require(_0xefb7('0x13'))['db'];function respondWithStatusCode(_0x5db428,_0x560f88){_0x560f88=_0x560f88||0xcc;return function(_0x16d481){if(_0x16d481){return _0x5db428[_0xefb7('0x14')](_0x560f88);}return _0x5db428[_0xefb7('0x15')](_0x560f88)[_0xefb7('0x16')]();};}function respondWithResult(_0x5508d8,_0x46d669){_0x46d669=_0x46d669||0xc8;return function(_0x3d3c33){if(_0x3d3c33){return _0x5508d8['status'](_0x46d669)[_0xefb7('0x17')](_0x3d3c33);}};}function respondWithFilteredResult(_0xe4766,_0x47f3ae){return function(_0x3c0a14){if(_0x3c0a14){var _0x11cea7=_0x3c0a14[_0xefb7('0x18')],_0x460d8d=_0x47f3ae[_0xefb7('0x19')],_0x593b89=_0x47f3ae[_0xefb7('0x19')]+_0x47f3ae[_0xefb7('0x1a')],_0x5eadc8;if(_0x593b89>=_0x11cea7){_0x593b89=_0x11cea7;_0x5eadc8=0xc8;}else{_0x5eadc8=0xce;}_0xe4766[_0xefb7('0x15')](_0x5eadc8);return _0xe4766[_0xefb7('0x1b')](_0xefb7('0x1c'),_0x460d8d+'-'+_0x593b89+'/'+_0x11cea7)['json'](_0x3c0a14);}return null;};}function patchUpdates(_0x209b26){return function(_0x3f1abf){try{jsonpatch[_0xefb7('0x1d')](_0x3f1abf,_0x209b26,!![]);}catch(_0x43c211){return BPromise['reject'](_0x43c211);}return _0x3f1abf[_0xefb7('0x1e')]();};}function saveUpdates(_0x92b3fd,_0x4cdaf6){return function(_0x4a960d){if(_0x4a960d){return _0x4a960d['update'](_0x92b3fd)[_0xefb7('0x1f')](function(_0x5b97f9){return _0x5b97f9;});}return null;};}function removeEntity(_0x2093f3,_0x3e93ae){return function(_0x52b020){if(_0x52b020){return _0x52b020[_0xefb7('0x20')]()[_0xefb7('0x1f')](function(){_0x2093f3[_0xefb7('0x15')](0xcc)[_0xefb7('0x16')]();});}};}function handleEntityNotFound(_0xd770ba,_0x31757b){return function(_0x449117){if(!_0x449117){_0xd770ba['sendStatus'](0x194);}return _0x449117;};}function handleError(_0x15837e,_0x5a955f){_0x5a955f=_0x5a955f||0x1f4;return function(_0x568bcb){logger[_0xefb7('0x21')](_0x568bcb[_0xefb7('0x22')]);if(_0x568bcb['name']){delete _0x568bcb['name'];}_0x15837e['status'](_0x5a955f)[_0xefb7('0x23')](_0x568bcb);};}exports['index']=function(_0x255f33,_0x3fda18){var _0x3c1929={},_0x10567c={},_0x253153={'count':0x0,'rows':[]};var _0x10721f=_[_0xefb7('0x24')](db[_0xefb7('0x25')][_0xefb7('0x26')],function(_0x34a42b){return{'name':_0x34a42b['fieldName'],'type':_0x34a42b[_0xefb7('0x27')]['key']};});_0x10567c[_0xefb7('0x28')]=_[_0xefb7('0x24')](_0x10721f,'name');_0x10567c[_0xefb7('0x29')]=_[_0xefb7('0x2a')](_0x255f33[_0xefb7('0x29')]);_0x10567c[_0xefb7('0x2b')]=_['intersection'](_0x10567c[_0xefb7('0x28')],_0x10567c[_0xefb7('0x29')]);_0x3c1929[_0xefb7('0x2c')]=_['intersection'](_0x10567c['model'],qs[_0xefb7('0x2d')](_0x255f33['query']['fields']));_0x3c1929['attributes']=_0x3c1929[_0xefb7('0x2c')][_0xefb7('0x2e')]?_0x3c1929['attributes']:_0x10567c['model'];if(!_0x255f33[_0xefb7('0x29')]['hasOwnProperty']('nolimit')){_0x3c1929[_0xefb7('0x1a')]=qs[_0xefb7('0x1a')](_0x255f33[_0xefb7('0x29')][_0xefb7('0x1a')]);_0x3c1929[_0xefb7('0x19')]=qs[_0xefb7('0x19')](_0x255f33[_0xefb7('0x29')][_0xefb7('0x19')]);}_0x3c1929[_0xefb7('0x2f')]=qs[_0xefb7('0x30')](_0x255f33[_0xefb7('0x29')][_0xefb7('0x30')]);_0x3c1929[_0xefb7('0x31')]=qs[_0xefb7('0x2b')](_[_0xefb7('0x32')](_0x255f33[_0xefb7('0x29')],_0x10567c[_0xefb7('0x2b')]),_0x10721f);if(_0x255f33[_0xefb7('0x29')][_0xefb7('0x33')]){_0x3c1929[_0xefb7('0x31')]=_['merge'](_0x3c1929['where'],{'$or':_[_0xefb7('0x24')](_0x10721f,function(_0x48e895){if(_0x48e895[_0xefb7('0x27')]!=='VIRTUAL'){var _0xe38ee3={};_0xe38ee3[_0x48e895[_0xefb7('0x34')]]={'$like':'%'+_0x255f33[_0xefb7('0x29')][_0xefb7('0x33')]+'%'};return _0xe38ee3;}})});}_0x3c1929=_[_0xefb7('0x35')]({},_0x3c1929,_0x255f33[_0xefb7('0x36')]);var _0x37a3d3={'where':_0x3c1929[_0xefb7('0x31')]};return db[_0xefb7('0x25')]['count'](_0x37a3d3)[_0xefb7('0x1f')](function(_0x129412){_0x253153[_0xefb7('0x18')]=_0x129412;if(_0x255f33[_0xefb7('0x29')][_0xefb7('0x37')]){_0x3c1929[_0xefb7('0x38')]=[{'all':!![]}];}return db[_0xefb7('0x25')][_0xefb7('0x39')](_0x3c1929);})[_0xefb7('0x1f')](function(_0x4fea44){_0x253153[_0xefb7('0x3a')]=_0x4fea44;return _0x253153;})[_0xefb7('0x1f')](respondWithFilteredResult(_0x3fda18,_0x3c1929))[_0xefb7('0x3b')](handleError(_0x3fda18,null));};exports[_0xefb7('0x3c')]=function(_0x1111f7,_0x2a6ef2){var _0xa18ad1={'raw':![],'where':{'id':_0x1111f7[_0xefb7('0x3d')]['id']}},_0x4a7f1a={};_0x4a7f1a[_0xefb7('0x28')]=_[_0xefb7('0x2a')](db[_0xefb7('0x25')][_0xefb7('0x26')]);_0x4a7f1a[_0xefb7('0x29')]=_[_0xefb7('0x2a')](_0x1111f7[_0xefb7('0x29')]);_0x4a7f1a[_0xefb7('0x2b')]=_[_0xefb7('0x3e')](_0x4a7f1a['model'],_0x4a7f1a['query']);_0xa18ad1[_0xefb7('0x2c')]=_[_0xefb7('0x3e')](_0x4a7f1a[_0xefb7('0x28')],qs[_0xefb7('0x2d')](_0x1111f7[_0xefb7('0x29')][_0xefb7('0x2d')]));_0xa18ad1['attributes']=_0xa18ad1[_0xefb7('0x2c')]['length']?_0xa18ad1[_0xefb7('0x2c')]:_0x4a7f1a[_0xefb7('0x28')];if(_0x1111f7[_0xefb7('0x29')][_0xefb7('0x37')]){_0xa18ad1[_0xefb7('0x38')]=[{'all':!![]}];}_0xa18ad1=_[_0xefb7('0x35')]({},_0xa18ad1,_0x1111f7[_0xefb7('0x36')]);return db['AnalyticFieldReport'][_0xefb7('0x3f')](_0xa18ad1)[_0xefb7('0x1f')](handleEntityNotFound(_0x2a6ef2,null))['then'](respondWithResult(_0x2a6ef2,null))[_0xefb7('0x3b')](handleError(_0x2a6ef2,null));};exports['create']=function(_0x1dfc71,_0xf1150e){return db[_0xefb7('0x25')][_0xefb7('0x40')](_0x1dfc71[_0xefb7('0x41')],{})['then'](respondWithResult(_0xf1150e,0xc9))[_0xefb7('0x3b')](handleError(_0xf1150e,null));};exports[_0xefb7('0x42')]=function(_0x15aef0,_0x3aabd1){return db[_0xefb7('0x25')][_0xefb7('0x42')](_0x15aef0[_0xefb7('0x41')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3aabd1,0xc9))[_0xefb7('0x3b')](handleError(_0x3aabd1,null));};exports[_0xefb7('0x43')]=function(_0x5b2dd9,_0x4c2b4f){if(_0x5b2dd9[_0xefb7('0x41')]['id']){delete _0x5b2dd9[_0xefb7('0x41')]['id'];}return db['AnalyticFieldReport'][_0xefb7('0x3f')]({'where':{'id':_0x5b2dd9[_0xefb7('0x3d')]['id']}})[_0xefb7('0x1f')](handleEntityNotFound(_0x4c2b4f,null))[_0xefb7('0x1f')](saveUpdates(_0x5b2dd9[_0xefb7('0x41')],null))[_0xefb7('0x1f')](respondWithResult(_0x4c2b4f,null))[_0xefb7('0x3b')](handleError(_0x4c2b4f,null));};exports[_0xefb7('0x20')]=function(_0x428041,_0x536601){return db['AnalyticFieldReport'][_0xefb7('0x3f')]({'where':{'id':_0x428041[_0xefb7('0x3d')]['id']}})['then'](handleEntityNotFound(_0x536601,null))[_0xefb7('0x1f')](removeEntity(_0x536601,null))[_0xefb7('0x3b')](handleError(_0x536601,null));};exports[_0xefb7('0x44')]=function(_0x90e582,_0x52eaa2){return db['AnalyticFieldReport'][_0xefb7('0x20')]({'where':{'id':_0x90e582[_0xefb7('0x29')][_0xefb7('0x45')]||[]},'raw':![],'individualHooks':!![]})[_0xefb7('0x1f')](respondWithResult(_0x52eaa2,0xcc))[_0xefb7('0x3b')](handleError(_0x52eaa2,null));};exports[_0xefb7('0x46')]=function(_0x221d3b,_0x1387df,_0x579033){return db[_0xefb7('0x47')][_0xefb7('0x48')]({'where':{'id':_0x221d3b['params']['id']}})[_0xefb7('0x1f')](handleEntityNotFound(_0x1387df,null))[_0xefb7('0x1f')](function(_0x52dbe2){if(_0x52dbe2){return db[_0xefb7('0x49')][_0xefb7('0x4a')](function(_0x386018){return db[_0xefb7('0x25')][_0xefb7('0x20')]({'where':{'CustomReportId':_0x221d3b['params']['id']},'transaction':_0x386018})[_0xefb7('0x1f')](function(_0x208cf1){var _0x175deb=_[_0xefb7('0x24')](_0x221d3b['body'],function(_0x3de1ac){delete _0x3de1ac['id'];_0x3de1ac[_0xefb7('0x4b')]=_0x221d3b[_0xefb7('0x3d')]['id'];return _0x3de1ac;});return db['AnalyticFieldReport'][_0xefb7('0x42')](_0x175deb,{'transaction':_0x386018});});})['then'](function(){return db['AnalyticFieldReport'][_0xefb7('0x39')]({'where':{'CustomReportId':_0x221d3b['params']['id']}});});}})['then'](respondWithResult(_0x1387df,null))[_0xefb7('0x3b')](handleError(_0x1387df,null));};
\ No newline at end of file
index 4197dd7..d19aad2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7136=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x5ece6e,_0x3a04e2){var _0x3691f9=function(_0x12a74f){while(--_0x12a74f){_0x5ece6e['push'](_0x5ece6e['shift']());}};_0x3691f9(++_0x3a04e2);}(_0x7136,0x15f));var _0x6713=function(_0x5c9317,_0x38bba4){_0x5c9317=_0x5c9317-0x0;var _0x50ccb4=_0x7136[_0x5c9317];return _0x50ccb4;};'use strict';var _=require(_0x6713('0x0'));var util=require(_0x6713('0x1'));var logger=require(_0x6713('0x2'))(_0x6713('0x3'));var moment=require(_0x6713('0x4'));var BPromise=require(_0x6713('0x5'));var rp=require(_0x6713('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6713('0x7'));var config=require(_0x6713('0x8'));var attributes=require(_0x6713('0x9'));module['exports']=function(_0x238615,_0x271d29){return _0x238615[_0x6713('0xa')](_0x6713('0xb'),attributes,{'tableName':_0x6713('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4250=['bluebird','path','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x4250,0x149));var _0x0425=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x4250[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x0425('0x0'));var util=require(_0x0425('0x1'));var logger=require('../../config/logger')(_0x0425('0x2'));var moment=require(_0x0425('0x3'));var BPromise=require(_0x0425('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0425('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x0425('0x6')]=function(_0x5651bb,_0x5518f3){return _0x5651bb['define'](_0x0425('0x7'),attributes,{'tableName':_0x0425('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ed0fd94..27567d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5a5=['then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xc5a5,0x1ee));var _0x5c5a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc5a5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5c5a('0x0'));var util=require(_0x5c5a('0x1'));var moment=require(_0x5c5a('0x2'));var BPromise=require('bluebird');var rs=require(_0x5c5a('0x3'));var fs=require('fs');var Redis=require(_0x5c5a('0x4'));var db=require(_0x5c5a('0x5'))['db'];var utils=require(_0x5c5a('0x6'));var logger=require(_0x5c5a('0x7'))(_0x5c5a('0x8'));var config=require(_0x5c5a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5c5a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x276a60,_0x59a31e,_0x23f85e){return new BPromise(function(_0x41c8bb,_0x38da76){return client[_0x5c5a('0xb')](_0x276a60,_0x23f85e)[_0x5c5a('0xc')](function(_0x586c0c){logger[_0x5c5a('0xd')](_0x5c5a('0xe'),_0x59a31e,_0x5c5a('0xf'));logger[_0x5c5a('0x10')](_0x5c5a('0x11'),_0x59a31e,_0x5c5a('0xf'),JSON['stringify'](_0x586c0c));if(_0x586c0c['error']){if(_0x586c0c['error']['code']===0x1f4){logger['error'](_0x5c5a('0xe'),_0x59a31e,_0x586c0c[_0x5c5a('0x12')][_0x5c5a('0x13')]);return _0x38da76(_0x586c0c[_0x5c5a('0x12')][_0x5c5a('0x13')]);}logger[_0x5c5a('0x12')](_0x5c5a('0xe'),_0x59a31e,_0x586c0c['error'][_0x5c5a('0x13')]);return _0x41c8bb(_0x586c0c[_0x5c5a('0x12')][_0x5c5a('0x13')]);}else{logger[_0x5c5a('0xd')](_0x5c5a('0xe'),_0x59a31e,_0x5c5a('0xf'));_0x41c8bb(_0x586c0c[_0x5c5a('0x14')]['message']);}})[_0x5c5a('0x15')](function(_0x24ad13){logger[_0x5c5a('0x12')](_0x5c5a('0xe'),_0x59a31e,_0x24ad13);_0x38da76(_0x24ad13);});});}
\ No newline at end of file
+var _0x83c6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83c6,0xbe));var _0x683c=function(_0x20efde,_0x46604a){_0x20efde=_0x20efde-0x0;var _0x30e88c=_0x83c6[_0x20efde];return _0x30e88c;};'use strict';var _=require(_0x683c('0x0'));var util=require('util');var moment=require(_0x683c('0x1'));var BPromise=require(_0x683c('0x2'));var rs=require(_0x683c('0x3'));var fs=require('fs');var Redis=require(_0x683c('0x4'));var db=require(_0x683c('0x5'))['db'];var utils=require(_0x683c('0x6'));var logger=require('../../config/logger')(_0x683c('0x7'));var config=require(_0x683c('0x8'));var jayson=require(_0x683c('0x9'));var client=jayson[_0x683c('0xa')][_0x683c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ae3c7,_0x57e2e1,_0x4cd98d){return new BPromise(function(_0x1beb29,_0x3e5691){return client[_0x683c('0xc')](_0x5ae3c7,_0x4cd98d)[_0x683c('0xd')](function(_0x3fe5d5){logger[_0x683c('0xe')](_0x683c('0xf'),_0x57e2e1,_0x683c('0x10'));logger[_0x683c('0x11')](_0x683c('0x12'),_0x57e2e1,_0x683c('0x10'),JSON['stringify'](_0x3fe5d5));if(_0x3fe5d5[_0x683c('0x13')]){if(_0x3fe5d5[_0x683c('0x13')][_0x683c('0x14')]===0x1f4){logger['error'](_0x683c('0xf'),_0x57e2e1,_0x3fe5d5[_0x683c('0x13')][_0x683c('0x15')]);return _0x3e5691(_0x3fe5d5[_0x683c('0x13')][_0x683c('0x15')]);}logger['error'](_0x683c('0xf'),_0x57e2e1,_0x3fe5d5[_0x683c('0x13')][_0x683c('0x15')]);return _0x1beb29(_0x3fe5d5[_0x683c('0x13')]['message']);}else{logger['info'](_0x683c('0xf'),_0x57e2e1,'request\x20sent');_0x1beb29(_0x3fe5d5[_0x683c('0x16')]['message']);}})[_0x683c('0x17')](function(_0x44d041){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x57e2e1,_0x44d041);_0x3e5691(_0x44d041);});});}
\ No newline at end of file
index 861e6ec..7010a95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','post','create','/create_many','bulkCreate','/:id/create_many','addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x4c8ba9,_0x26a343){var _0x3805e0=function(_0xfa7122){while(--_0xfa7122){_0x4c8ba9['push'](_0x4c8ba9['shift']());}};_0x3805e0(++_0x26a343);}(_0x814b,0x1a2));var _0xb814=function(_0x2c18a8,_0x24eaa5){_0x2c18a8=_0x2c18a8-0x0;var _0x1e009a=_0x814b[_0x2c18a8];return _0x1e009a;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0xd')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xd')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0xd')](_0xb814('0x11'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['put'](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router[_0xb814('0x14')](_0xb814('0x15'),auth[_0xb814('0xa')](),controller[_0xb814('0x16')]);router[_0xb814('0x14')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x17')]);module[_0xb814('0x18')]=router;
\ No newline at end of file
+var _0x3e74=['./analyticFieldReport.controller','get','isAuthenticated','index','show','post','create','/create_many','/:id/create_many','addFields','/:id','delete','/destroy_many','bulkDestroy','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service'];(function(_0x38b0bd,_0x4519a2){var _0xa6e47e=function(_0x10a4c3){while(--_0x10a4c3){_0x38b0bd['push'](_0x38b0bd['shift']());}};_0xa6e47e(++_0x4519a2);}(_0x3e74,0x175));var _0x43e7=function(_0x2aec86,_0x529118){_0x2aec86=_0x2aec86-0x0;var _0x35d938=_0x3e74[_0x2aec86];return _0x35d938;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['post'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x43e7('0xa')](_0x43e7('0xd'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router['put'](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller['update']);router[_0x43e7('0x10')](_0x43e7('0x11'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x12')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x13')]);module[_0x43e7('0x14')]=router;
\ No newline at end of file
index 828fdeb..cb318ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9189=['STRING','name','TEXT'];(function(_0x4c1c9c,_0x4cde28){var _0x456d9f=function(_0x32d3bc){while(--_0x32d3bc){_0x4c1c9c['push'](_0x4c1c9c['shift']());}};_0x456d9f(++_0x4cde28);}(_0x9189,0x1b0));var _0x9918=function(_0x4fc013,_0x40d3fb){_0x4fc013=_0x4fc013-0x0;var _0x15e85a=_0x9189[_0x4fc013];return _0x15e85a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9918('0x0')],'allowNull':![],'unique':_0x9918('0x1')},'table':{'type':Sequelize[_0x9918('0x0')]},'metric':{'type':Sequelize[_0x9918('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6e1c=['STRING','TEXT','sequelize','name'];(function(_0x2981f2,_0x419adb){var _0x42c24d=function(_0x36571f){while(--_0x36571f){_0x2981f2['push'](_0x2981f2['shift']());}};_0x42c24d(++_0x419adb);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6e1c[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc6e1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc6e1('0x1')},'table':{'type':Sequelize[_0xc6e1('0x2')]},'metric':{'type':Sequelize[_0xc6e1('0x3')]},'description':{'type':Sequelize[_0xc6e1('0x2')]}};
\ No newline at end of file
index 8a05ff3..3624767 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5204=['sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','get','Metrics','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','AnalyticMetric','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0xc2f4eb,_0x4eab5a){var _0x4c1341=function(_0x49cd5a){while(--_0x49cd5a){_0xc2f4eb['push'](_0xc2f4eb['shift']());}};_0x4c1341(++_0x4eab5a);}(_0x5204,0xdf));var _0x4520=function(_0x38622b,_0x3cfdf7){_0x38622b=_0x38622b-0x0;var _0x2c1a7a=_0x5204[_0x38622b];return _0x2c1a7a;};'use strict';var pdf=require(_0x4520('0x0'));var emlformat=require(_0x4520('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4520('0x2'));var jsonpatch=require(_0x4520('0x3'));var rp=require(_0x4520('0x4'));var moment=require(_0x4520('0x5'));var BPromise=require(_0x4520('0x6'));var Mustache=require('mustache');var util=require(_0x4520('0x7'));var path=require('path');var sox=require(_0x4520('0x8'));var csv=require(_0x4520('0x9'));var ejs=require(_0x4520('0xa'));var fs=require('fs');var _=require(_0x4520('0xb'));var squel=require(_0x4520('0xc'));var crypto=require(_0x4520('0xd'));var jsforce=require(_0x4520('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4520('0x9'));var querystring=require('querystring');var Papa=require(_0x4520('0xf'));var Redis=require(_0x4520('0x10'));var authService=require(_0x4520('0x11'));var qs=require(_0x4520('0x12'));var as=require(_0x4520('0x13'));var hardwareService=require(_0x4520('0x14'));var logger=require(_0x4520('0x15'))(_0x4520('0x16'));var utils=require(_0x4520('0x17'));var config=require(_0x4520('0x18'));var db=require(_0x4520('0x19'))['db'];function respondWithStatusCode(_0x394072,_0x3c7a5d){_0x3c7a5d=_0x3c7a5d||0xcc;return function(_0x508ea6){if(_0x508ea6){return _0x394072[_0x4520('0x1a')](_0x3c7a5d);}return _0x394072[_0x4520('0x1b')](_0x3c7a5d)[_0x4520('0x1c')]();};}function respondWithResult(_0x4677d7,_0x426836){_0x426836=_0x426836||0xc8;return function(_0x34d383){if(_0x34d383){return _0x4677d7[_0x4520('0x1b')](_0x426836)['json'](_0x34d383);}};}function respondWithFilteredResult(_0x3e53e5,_0x20de6b){return function(_0x1ab841){if(_0x1ab841){var _0x15a31f=_0x1ab841[_0x4520('0x1d')],_0x32d8aa=_0x20de6b[_0x4520('0x1e')],_0x51d85f=_0x20de6b[_0x4520('0x1e')]+_0x20de6b[_0x4520('0x1f')],_0x2c1805;if(_0x51d85f>=_0x15a31f){_0x51d85f=_0x15a31f;_0x2c1805=0xc8;}else{_0x2c1805=0xce;}_0x3e53e5[_0x4520('0x1b')](_0x2c1805);return _0x3e53e5[_0x4520('0x20')](_0x4520('0x21'),_0x32d8aa+'-'+_0x51d85f+'/'+_0x15a31f)[_0x4520('0x22')](_0x1ab841);}return null;};}function patchUpdates(_0x11eaea){return function(_0x398dd2){try{jsonpatch[_0x4520('0x23')](_0x398dd2,_0x11eaea,!![]);}catch(_0x4ac41d){return BPromise[_0x4520('0x24')](_0x4ac41d);}return _0x398dd2['save']();};}function saveUpdates(_0x5ceff6,_0x4c46c5){return function(_0x2b9456){if(_0x2b9456){return _0x2b9456['update'](_0x5ceff6)[_0x4520('0x25')](function(_0x270dc2){return _0x270dc2;});}return null;};}function removeEntity(_0x428d36,_0x534b15){return function(_0x3199a9){if(_0x3199a9){return _0x3199a9[_0x4520('0x26')]()[_0x4520('0x25')](function(){var _0x4b889a=_0x3199a9[_0x4520('0x27')]({'plain':!![]});var _0x847d15=_0x4520('0x28');return db[_0x4520('0x29')][_0x4520('0x26')]({'where':{'type':_0x847d15,'resourceId':_0x4b889a['id']}})['then'](function(){return _0x3199a9;});})[_0x4520('0x25')](function(){_0x428d36[_0x4520('0x1b')](0xcc)[_0x4520('0x1c')]();});}};}function handleEntityNotFound(_0x3e2906,_0x57306b){return function(_0x336c63){if(!_0x336c63){_0x3e2906[_0x4520('0x1a')](0x194);}return _0x336c63;};}function handleError(_0x92168b,_0x21e1f3){_0x21e1f3=_0x21e1f3||0x1f4;return function(_0xad9f8){logger[_0x4520('0x2a')](_0xad9f8[_0x4520('0x2b')]);if(_0xad9f8[_0x4520('0x2c')]){delete _0xad9f8[_0x4520('0x2c')];}_0x92168b[_0x4520('0x1b')](_0x21e1f3)['send'](_0xad9f8);};}exports[_0x4520('0x2d')]=function(_0x5c1a0b,_0x7ce8d2){var _0x14778a={},_0x43b4a2={},_0x157293={'count':0x0,'rows':[]};var _0x1da740=_[_0x4520('0x2e')](db['AnalyticMetric'][_0x4520('0x2f')],function(_0x508c05){return{'name':_0x508c05[_0x4520('0x30')],'type':_0x508c05['type'][_0x4520('0x31')]};});_0x43b4a2['model']=_[_0x4520('0x2e')](_0x1da740,'name');_0x43b4a2['query']=_[_0x4520('0x32')](_0x5c1a0b[_0x4520('0x33')]);_0x43b4a2[_0x4520('0x34')]=_['intersection'](_0x43b4a2[_0x4520('0x35')],_0x43b4a2[_0x4520('0x33')]);_0x14778a[_0x4520('0x36')]=_[_0x4520('0x37')](_0x43b4a2['model'],qs['fields'](_0x5c1a0b[_0x4520('0x33')][_0x4520('0x38')]));_0x14778a['attributes']=_0x14778a[_0x4520('0x36')][_0x4520('0x39')]?_0x14778a[_0x4520('0x36')]:_0x43b4a2[_0x4520('0x35')];if(!_0x5c1a0b[_0x4520('0x33')][_0x4520('0x3a')]('nolimit')){_0x14778a[_0x4520('0x1f')]=qs[_0x4520('0x1f')](_0x5c1a0b['query'][_0x4520('0x1f')]);_0x14778a['offset']=qs[_0x4520('0x1e')](_0x5c1a0b[_0x4520('0x33')]['offset']);}_0x14778a['order']=qs['sort'](_0x5c1a0b[_0x4520('0x33')][_0x4520('0x3b')]);_0x14778a[_0x4520('0x3c')]=qs[_0x4520('0x34')](_[_0x4520('0x3d')](_0x5c1a0b[_0x4520('0x33')],_0x43b4a2[_0x4520('0x34')]),_0x1da740);if(_0x5c1a0b['query'][_0x4520('0x3e')]){_0x14778a[_0x4520('0x3c')]=_[_0x4520('0x3f')](_0x14778a['where'],{'$or':_[_0x4520('0x2e')](_0x1da740,function(_0x1981fd){if(_0x1981fd['type']!=='VIRTUAL'){var _0x1c4fd2={};_0x1c4fd2[_0x1981fd[_0x4520('0x2c')]]={'$like':'%'+_0x5c1a0b[_0x4520('0x33')][_0x4520('0x3e')]+'%'};return _0x1c4fd2;}})});}_0x14778a=_[_0x4520('0x3f')]({},_0x14778a,_0x5c1a0b['options']);var _0x492702={'where':_0x14778a['where']};return db[_0x4520('0x40')]['count'](_0x492702)[_0x4520('0x25')](function(_0x54da7a){_0x157293['count']=_0x54da7a;if(_0x5c1a0b[_0x4520('0x33')][_0x4520('0x41')]){_0x14778a[_0x4520('0x42')]=[{'all':!![]}];}return db[_0x4520('0x40')][_0x4520('0x43')](_0x14778a);})['then'](function(_0x1675e6){_0x157293[_0x4520('0x44')]=_0x1675e6;return _0x157293;})['then'](respondWithFilteredResult(_0x7ce8d2,_0x14778a))['catch'](handleError(_0x7ce8d2,null));};exports[_0x4520('0x45')]=function(_0x2ff306,_0x500c45){var _0x2978d5={'raw':!![],'where':{'id':_0x2ff306[_0x4520('0x46')]['id']}},_0x15a83b={};_0x15a83b[_0x4520('0x35')]=_['keys'](db[_0x4520('0x40')][_0x4520('0x2f')]);_0x15a83b[_0x4520('0x33')]=_[_0x4520('0x32')](_0x2ff306[_0x4520('0x33')]);_0x15a83b[_0x4520('0x34')]=_[_0x4520('0x37')](_0x15a83b[_0x4520('0x35')],_0x15a83b[_0x4520('0x33')]);_0x2978d5[_0x4520('0x36')]=_[_0x4520('0x37')](_0x15a83b[_0x4520('0x35')],qs[_0x4520('0x38')](_0x2ff306[_0x4520('0x33')][_0x4520('0x38')]));_0x2978d5[_0x4520('0x36')]=_0x2978d5[_0x4520('0x36')]['length']?_0x2978d5[_0x4520('0x36')]:_0x15a83b[_0x4520('0x35')];if(_0x2ff306['query']['includeAll']){_0x2978d5['include']=[{'all':!![]}];}_0x2978d5=_['merge']({},_0x2978d5,_0x2ff306[_0x4520('0x47')]);return db['AnalyticMetric'][_0x4520('0x48')](_0x2978d5)[_0x4520('0x25')](handleEntityNotFound(_0x500c45,null))[_0x4520('0x25')](respondWithResult(_0x500c45,null))[_0x4520('0x49')](handleError(_0x500c45,null));};exports[_0x4520('0x4a')]=function(_0x5e3eef,_0x2b89be){return db[_0x4520('0x40')][_0x4520('0x4a')](_0x5e3eef[_0x4520('0x4b')],{})[_0x4520('0x25')](function(_0x25f5d5){var _0x737ba4=_0x5e3eef[_0x4520('0x4c')][_0x4520('0x27')]({'plain':!![]});if(!_0x737ba4)throw new Error(_0x4520('0x4d'));if(_0x737ba4[_0x4520('0x4e')]===_0x4520('0x4c')){var _0x4cf80e=_0x25f5d5['get']({'plain':!![]});var _0x2f14c1=_0x4520('0x28');return db[_0x4520('0x4f')]['find']({'where':{'name':_0x2f14c1,'userProfileId':_0x737ba4[_0x4520('0x50')]},'raw':!![]})[_0x4520('0x25')](function(_0x3f9a4c){if(_0x3f9a4c&&_0x3f9a4c['autoAssociation']===0x0){return db[_0x4520('0x29')][_0x4520('0x4a')]({'name':_0x4cf80e[_0x4520('0x2c')],'resourceId':_0x4cf80e['id'],'type':_0x3f9a4c['name'],'sectionId':_0x3f9a4c['id']},{})['then'](function(){return _0x25f5d5;});}else{return _0x25f5d5;}})[_0x4520('0x49')](function(_0x24a6a4){logger[_0x4520('0x2a')](_0x4520('0x51'),_0x24a6a4);throw _0x24a6a4;});}return _0x25f5d5;})[_0x4520('0x25')](respondWithResult(_0x2b89be,0xc9))[_0x4520('0x49')](handleError(_0x2b89be,null));};exports[_0x4520('0x52')]=function(_0x1c2d7f,_0x4d30d3){if(_0x1c2d7f[_0x4520('0x4b')]['id']){delete _0x1c2d7f[_0x4520('0x4b')]['id'];}return db[_0x4520('0x40')][_0x4520('0x48')]({'where':{'id':_0x1c2d7f[_0x4520('0x46')]['id']}})[_0x4520('0x25')](handleEntityNotFound(_0x4d30d3,null))[_0x4520('0x25')](saveUpdates(_0x1c2d7f[_0x4520('0x4b')],null))[_0x4520('0x25')](respondWithResult(_0x4d30d3,null))[_0x4520('0x49')](handleError(_0x4d30d3,null));};exports[_0x4520('0x26')]=function(_0x1f881f,_0x2f11d9){return db[_0x4520('0x40')][_0x4520('0x48')]({'where':{'id':_0x1f881f[_0x4520('0x46')]['id']}})[_0x4520('0x25')](handleEntityNotFound(_0x2f11d9,null))['then'](removeEntity(_0x2f11d9,null))['catch'](handleError(_0x2f11d9,null));};
\ No newline at end of file
+var _0x0833=['json','count','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','end','error','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x278f0a,_0x35bf1d){var _0x8c96de=function(_0x4f8cc4){while(--_0x4f8cc4){_0x278f0a['push'](_0x278f0a['shift']());}};_0x8c96de(++_0x35bf1d);}(_0x0833,0x1bd));var _0x3083=function(_0x267ed0,_0x555d95){_0x267ed0=_0x267ed0-0x0;var _0x3f0eba=_0x0833[_0x267ed0];return _0x3f0eba;};'use strict';var pdf=require(_0x3083('0x0'));var emlformat=require(_0x3083('0x1'));var rimraf=require(_0x3083('0x2'));var zipdir=require(_0x3083('0x3'));var jsonpatch=require(_0x3083('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3083('0x5'));var util=require('util');var path=require(_0x3083('0x6'));var sox=require(_0x3083('0x7'));var csv=require(_0x3083('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3083('0x9'));var squel=require(_0x3083('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3083('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3083('0xb'));var authService=require(_0x3083('0xc'));var qs=require(_0x3083('0xd'));var as=require(_0x3083('0xe'));var hardwareService=require(_0x3083('0xf'));var logger=require(_0x3083('0x10'))(_0x3083('0x11'));var utils=require(_0x3083('0x12'));var config=require(_0x3083('0x13'));var db=require(_0x3083('0x14'))['db'];function respondWithStatusCode(_0x3a2460,_0x4960f9){_0x4960f9=_0x4960f9||0xcc;return function(_0x126765){if(_0x126765){return _0x3a2460[_0x3083('0x15')](_0x4960f9);}return _0x3a2460[_0x3083('0x16')](_0x4960f9)['end']();};}function respondWithResult(_0x2fe399,_0x2a8cd0){_0x2a8cd0=_0x2a8cd0||0xc8;return function(_0x5f39e3){if(_0x5f39e3){return _0x2fe399[_0x3083('0x16')](_0x2a8cd0)[_0x3083('0x17')](_0x5f39e3);}};}function respondWithFilteredResult(_0x507441,_0x293ca0){return function(_0x20cc31){if(_0x20cc31){var _0x1b6955=_0x20cc31[_0x3083('0x18')],_0x143cac=_0x293ca0['offset'],_0x3f1f08=_0x293ca0['offset']+_0x293ca0['limit'],_0x1de928;if(_0x3f1f08>=_0x1b6955){_0x3f1f08=_0x1b6955;_0x1de928=0xc8;}else{_0x1de928=0xce;}_0x507441[_0x3083('0x16')](_0x1de928);return _0x507441['set'](_0x3083('0x19'),_0x143cac+'-'+_0x3f1f08+'/'+_0x1b6955)[_0x3083('0x17')](_0x20cc31);}return null;};}function patchUpdates(_0x419c95){return function(_0x3b61db){try{jsonpatch[_0x3083('0x1a')](_0x3b61db,_0x419c95,!![]);}catch(_0x43d42a){return BPromise[_0x3083('0x1b')](_0x43d42a);}return _0x3b61db[_0x3083('0x1c')]();};}function saveUpdates(_0x3c3da6,_0x164988){return function(_0x3d9d42){if(_0x3d9d42){return _0x3d9d42[_0x3083('0x1d')](_0x3c3da6)[_0x3083('0x1e')](function(_0x1a6035){return _0x1a6035;});}return null;};}function removeEntity(_0x51afc7,_0x4c2a0b){return function(_0x4dc9ad){if(_0x4dc9ad){return _0x4dc9ad['destroy']()[_0x3083('0x1e')](function(){var _0x8225f7=_0x4dc9ad[_0x3083('0x1f')]({'plain':!![]});var _0x3187f3=_0x3083('0x20');return db[_0x3083('0x21')][_0x3083('0x22')]({'where':{'type':_0x3187f3,'resourceId':_0x8225f7['id']}})[_0x3083('0x1e')](function(){return _0x4dc9ad;});})[_0x3083('0x1e')](function(){_0x51afc7['status'](0xcc)[_0x3083('0x23')]();});}};}function handleEntityNotFound(_0x52b77c,_0x5de58e){return function(_0x1bea50){if(!_0x1bea50){_0x52b77c[_0x3083('0x15')](0x194);}return _0x1bea50;};}function handleError(_0x2afe80,_0x2efe93){_0x2efe93=_0x2efe93||0x1f4;return function(_0x484c07){logger[_0x3083('0x24')](_0x484c07['stack']);if(_0x484c07[_0x3083('0x25')]){delete _0x484c07[_0x3083('0x25')];}_0x2afe80[_0x3083('0x16')](_0x2efe93)[_0x3083('0x26')](_0x484c07);};}exports['index']=function(_0x3055d2,_0x55a515){var _0x5d9c98={},_0x1677de={},_0x233a81={'count':0x0,'rows':[]};var _0x2e3158=_['map'](db[_0x3083('0x27')][_0x3083('0x28')],function(_0x153aac){return{'name':_0x153aac[_0x3083('0x29')],'type':_0x153aac[_0x3083('0x2a')][_0x3083('0x2b')]};});_0x1677de[_0x3083('0x2c')]=_[_0x3083('0x2d')](_0x2e3158,_0x3083('0x25'));_0x1677de[_0x3083('0x2e')]=_[_0x3083('0x2f')](_0x3055d2[_0x3083('0x2e')]);_0x1677de[_0x3083('0x30')]=_[_0x3083('0x31')](_0x1677de[_0x3083('0x2c')],_0x1677de[_0x3083('0x2e')]);_0x5d9c98[_0x3083('0x32')]=_[_0x3083('0x31')](_0x1677de[_0x3083('0x2c')],qs[_0x3083('0x33')](_0x3055d2['query'][_0x3083('0x33')]));_0x5d9c98[_0x3083('0x32')]=_0x5d9c98['attributes'][_0x3083('0x34')]?_0x5d9c98[_0x3083('0x32')]:_0x1677de['model'];if(!_0x3055d2['query'][_0x3083('0x35')](_0x3083('0x36'))){_0x5d9c98[_0x3083('0x37')]=qs[_0x3083('0x37')](_0x3055d2['query']['limit']);_0x5d9c98[_0x3083('0x38')]=qs[_0x3083('0x38')](_0x3055d2[_0x3083('0x2e')]['offset']);}_0x5d9c98[_0x3083('0x39')]=qs[_0x3083('0x3a')](_0x3055d2[_0x3083('0x2e')][_0x3083('0x3a')]);_0x5d9c98[_0x3083('0x3b')]=qs['filters'](_['pick'](_0x3055d2[_0x3083('0x2e')],_0x1677de['filters']),_0x2e3158);if(_0x3055d2[_0x3083('0x2e')][_0x3083('0x3c')]){_0x5d9c98[_0x3083('0x3b')]=_[_0x3083('0x3d')](_0x5d9c98['where'],{'$or':_[_0x3083('0x2d')](_0x2e3158,function(_0xfce3a9){if(_0xfce3a9[_0x3083('0x2a')]!=='VIRTUAL'){var _0xc887f6={};_0xc887f6[_0xfce3a9['name']]={'$like':'%'+_0x3055d2[_0x3083('0x2e')][_0x3083('0x3c')]+'%'};return _0xc887f6;}})});}_0x5d9c98=_[_0x3083('0x3d')]({},_0x5d9c98,_0x3055d2[_0x3083('0x3e')]);var _0x489292={'where':_0x5d9c98[_0x3083('0x3b')]};return db['AnalyticMetric'][_0x3083('0x18')](_0x489292)[_0x3083('0x1e')](function(_0x166162){_0x233a81[_0x3083('0x18')]=_0x166162;if(_0x3055d2[_0x3083('0x2e')]['includeAll']){_0x5d9c98[_0x3083('0x3f')]=[{'all':!![]}];}return db[_0x3083('0x27')][_0x3083('0x40')](_0x5d9c98);})[_0x3083('0x1e')](function(_0x180333){_0x233a81[_0x3083('0x41')]=_0x180333;return _0x233a81;})[_0x3083('0x1e')](respondWithFilteredResult(_0x55a515,_0x5d9c98))[_0x3083('0x42')](handleError(_0x55a515,null));};exports[_0x3083('0x43')]=function(_0x2570b7,_0x49b0b8){var _0x406d89={'raw':!![],'where':{'id':_0x2570b7['params']['id']}},_0x505091={};_0x505091[_0x3083('0x2c')]=_[_0x3083('0x2f')](db[_0x3083('0x27')]['rawAttributes']);_0x505091[_0x3083('0x2e')]=_[_0x3083('0x2f')](_0x2570b7[_0x3083('0x2e')]);_0x505091['filters']=_[_0x3083('0x31')](_0x505091['model'],_0x505091[_0x3083('0x2e')]);_0x406d89['attributes']=_[_0x3083('0x31')](_0x505091['model'],qs['fields'](_0x2570b7['query']['fields']));_0x406d89[_0x3083('0x32')]=_0x406d89[_0x3083('0x32')][_0x3083('0x34')]?_0x406d89[_0x3083('0x32')]:_0x505091[_0x3083('0x2c')];if(_0x2570b7[_0x3083('0x2e')][_0x3083('0x44')]){_0x406d89[_0x3083('0x3f')]=[{'all':!![]}];}_0x406d89=_[_0x3083('0x3d')]({},_0x406d89,_0x2570b7[_0x3083('0x3e')]);return db['AnalyticMetric'][_0x3083('0x45')](_0x406d89)[_0x3083('0x1e')](handleEntityNotFound(_0x49b0b8,null))[_0x3083('0x1e')](respondWithResult(_0x49b0b8,null))[_0x3083('0x42')](handleError(_0x49b0b8,null));};exports['create']=function(_0x3dd19c,_0xcd4679){return db[_0x3083('0x27')][_0x3083('0x46')](_0x3dd19c[_0x3083('0x47')],{})[_0x3083('0x1e')](function(_0x437150){var _0x5cf5cd=_0x3dd19c[_0x3083('0x48')][_0x3083('0x1f')]({'plain':!![]});if(!_0x5cf5cd)throw new Error(_0x3083('0x49'));if(_0x5cf5cd[_0x3083('0x4a')]===_0x3083('0x48')){var _0x340a86=_0x437150['get']({'plain':!![]});var _0x5ca6fa=_0x3083('0x20');return db['UserProfileSection'][_0x3083('0x45')]({'where':{'name':_0x5ca6fa,'userProfileId':_0x5cf5cd[_0x3083('0x4b')]},'raw':!![]})[_0x3083('0x1e')](function(_0x301409){if(_0x301409&&_0x301409[_0x3083('0x4c')]===0x0){return db[_0x3083('0x21')][_0x3083('0x46')]({'name':_0x340a86['name'],'resourceId':_0x340a86['id'],'type':_0x301409[_0x3083('0x25')],'sectionId':_0x301409['id']},{})[_0x3083('0x1e')](function(){return _0x437150;});}else{return _0x437150;}})[_0x3083('0x42')](function(_0x488943){logger[_0x3083('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x488943);throw _0x488943;});}return _0x437150;})[_0x3083('0x1e')](respondWithResult(_0xcd4679,0xc9))[_0x3083('0x42')](handleError(_0xcd4679,null));};exports['update']=function(_0x16802d,_0x2182ef){if(_0x16802d[_0x3083('0x47')]['id']){delete _0x16802d[_0x3083('0x47')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x16802d[_0x3083('0x4d')]['id']}})[_0x3083('0x1e')](handleEntityNotFound(_0x2182ef,null))[_0x3083('0x1e')](saveUpdates(_0x16802d[_0x3083('0x47')],null))[_0x3083('0x1e')](respondWithResult(_0x2182ef,null))[_0x3083('0x42')](handleError(_0x2182ef,null));};exports[_0x3083('0x22')]=function(_0x4e21c4,_0x568ac9){return db[_0x3083('0x27')][_0x3083('0x45')]({'where':{'id':_0x4e21c4['params']['id']}})[_0x3083('0x1e')](handleEntityNotFound(_0x568ac9,null))[_0x3083('0x1e')](removeEntity(_0x568ac9,null))[_0x3083('0x42')](handleError(_0x568ac9,null));};
\ No newline at end of file
index 8d181e0..fb38766 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd303=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define','analytics_metrics','util','../../config/logger'];(function(_0x9ec45c,_0x2a2443){var _0x369ff7=function(_0x5438d7){while(--_0x5438d7){_0x9ec45c['push'](_0x9ec45c['shift']());}};_0x369ff7(++_0x2a2443);}(_0xd303,0xfa));var _0x3d30=function(_0x5b071a,_0x40992a){_0x5b071a=_0x5b071a-0x0;var _0x1b6b5e=_0xd303[_0x5b071a];return _0x1b6b5e;};'use strict';var _=require('lodash');var util=require(_0x3d30('0x0'));var logger=require(_0x3d30('0x1'))(_0x3d30('0x2'));var moment=require(_0x3d30('0x3'));var BPromise=require(_0x3d30('0x4'));var rp=require(_0x3d30('0x5'));var fs=require('fs');var path=require(_0x3d30('0x6'));var rimraf=require(_0x3d30('0x7'));var config=require(_0x3d30('0x8'));var attributes=require(_0x3d30('0x9'));module['exports']=function(_0x5df136,_0x2e7b8f){return _0x5df136[_0x3d30('0xa')]('AnalyticMetric',attributes,{'tableName':_0x3d30('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x44c8=['AnalyticMetric','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x44c8,0x1c3));var _0x844c=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x44c8[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0x844c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x844c('0x1'));var moment=require('moment');var BPromise=require(_0x844c('0x2'));var rp=require(_0x844c('0x3'));var fs=require('fs');var path=require(_0x844c('0x4'));var rimraf=require(_0x844c('0x5'));var config=require(_0x844c('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x844c('0x7')]=function(_0x4fd1e1,_0x55ce36){return _0x4fd1e1['define'](_0x844c('0x8'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 05b077c..faa13da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd9d=['../../config/utils','../../config/environment','jayson/promise','request','then','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x56b4be,_0x1c520e){var _0x34571d=function(_0xaab4a4){while(--_0xaab4a4){_0x56b4be['push'](_0x56b4be['shift']());}};_0x34571d(++_0x1c520e);}(_0xcd9d,0x105));var _0xdcd9=function(_0x3533e7,_0x3ebb8b){_0x3533e7=_0x3533e7-0x0;var _0x2bd4f9=_0xcd9d[_0x3533e7];return _0x2bd4f9;};'use strict';var _=require('lodash');var util=require(_0xdcd9('0x0'));var moment=require('moment');var BPromise=require(_0xdcd9('0x1'));var rs=require(_0xdcd9('0x2'));var fs=require('fs');var Redis=require(_0xdcd9('0x3'));var db=require(_0xdcd9('0x4'))['db'];var utils=require(_0xdcd9('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdcd9('0x6'));var jayson=require(_0xdcd9('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52191f,_0x5530de,_0x2d09df){return new BPromise(function(_0x575b71,_0x1b5c8f){return client[_0xdcd9('0x8')](_0x52191f,_0x2d09df)[_0xdcd9('0x9')](function(_0x137151){logger['info'](_0xdcd9('0xa'),_0x5530de,'request\x20sent');logger[_0xdcd9('0xb')](_0xdcd9('0xc'),_0x5530de,'request\x20sent',JSON[_0xdcd9('0xd')](_0x137151));if(_0x137151['error']){if(_0x137151[_0xdcd9('0xe')][_0xdcd9('0xf')]===0x1f4){logger[_0xdcd9('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x5530de,_0x137151[_0xdcd9('0xe')][_0xdcd9('0x10')]);return _0x1b5c8f(_0x137151[_0xdcd9('0xe')][_0xdcd9('0x10')]);}logger[_0xdcd9('0xe')](_0xdcd9('0xa'),_0x5530de,_0x137151[_0xdcd9('0xe')]['message']);return _0x575b71(_0x137151['error']['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x5530de,_0xdcd9('0x11'));_0x575b71(_0x137151[_0xdcd9('0x12')][_0xdcd9('0x10')]);}})['catch'](function(_0x3ba812){logger[_0xdcd9('0xe')](_0xdcd9('0xa'),_0x5530de,_0x3ba812);_0x1b5c8f(_0x3ba812);});});}
\ No newline at end of file
+var _0xe8da=['request\x20sent','error','code','message','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x1c7d64,_0x113563){var _0x5c840d=function(_0x581e02){while(--_0x581e02){_0x1c7d64['push'](_0x1c7d64['shift']());}};_0x5c840d(++_0x113563);}(_0xe8da,0x1cf));var _0xae8d=function(_0x1cded5,_0xd66c1a){_0x1cded5=_0x1cded5-0x0;var _0xc6c883=_0xe8da[_0x1cded5];return _0xc6c883;};'use strict';var _=require('lodash');var util=require(_0xae8d('0x0'));var moment=require('moment');var BPromise=require(_0xae8d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae8d('0x2'))['db'];var utils=require(_0xae8d('0x3'));var logger=require(_0xae8d('0x4'))(_0xae8d('0x5'));var config=require(_0xae8d('0x6'));var jayson=require(_0xae8d('0x7'));var client=jayson[_0xae8d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c40ba,_0x15e67a,_0x5c5d64){return new BPromise(function(_0xe2f2a4,_0xf392bc){return client[_0xae8d('0x9')](_0x1c40ba,_0x5c5d64)[_0xae8d('0xa')](function(_0x483e4f){logger[_0xae8d('0xb')](_0xae8d('0xc'),_0x15e67a,_0xae8d('0xd'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x15e67a,_0xae8d('0xd'),JSON['stringify'](_0x483e4f));if(_0x483e4f['error']){if(_0x483e4f[_0xae8d('0xe')][_0xae8d('0xf')]===0x1f4){logger[_0xae8d('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x15e67a,_0x483e4f[_0xae8d('0xe')][_0xae8d('0x10')]);return _0xf392bc(_0x483e4f[_0xae8d('0xe')][_0xae8d('0x10')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x15e67a,_0x483e4f[_0xae8d('0xe')][_0xae8d('0x10')]);return _0xe2f2a4(_0x483e4f['error'][_0xae8d('0x10')]);}else{logger[_0xae8d('0xb')](_0xae8d('0xc'),_0x15e67a,'request\x20sent');_0xe2f2a4(_0x483e4f['result'][_0xae8d('0x10')]);}})['catch'](function(_0x501dfc){logger['error'](_0xae8d('0xc'),_0x15e67a,_0x501dfc);_0xf392bc(_0x501dfc);});});}
\ No newline at end of file
index b3a4809..917e998 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x351426,_0x38206d){_0x351426=_0x351426-0x0;var _0x5159bb=_0xc6ac[_0x351426];return _0x5159bb;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var auth=require(_0xcc6a('0x6'));var interaction=require(_0xcc6a('0x7'));var config=require(_0xcc6a('0x8'));var controller=require(_0xcc6a('0x9'));router[_0xcc6a('0xa')]('/',auth[_0xcc6a('0xb')](),controller[_0xcc6a('0xc')]);router[_0xcc6a('0xa')]('/:id',auth[_0xcc6a('0xb')](),controller[_0xcc6a('0xd')]);router[_0xcc6a('0xe')]('/',auth['isAuthenticated'](),controller[_0xcc6a('0xf')]);router[_0xcc6a('0x10')](_0xcc6a('0x11'),auth[_0xcc6a('0xb')](),controller[_0xcc6a('0x12')]);router['delete'](_0xcc6a('0x11'),auth[_0xcc6a('0xb')](),controller[_0xcc6a('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x524e=['/:id','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x555c0b,_0x2a5cae){var _0x7f508=function(_0x1b511b){while(--_0x1b511b){_0x555c0b['push'](_0x555c0b['shift']());}};_0x7f508(++_0x2a5cae);}(_0x524e,0x15e));var _0xe524=function(_0x266c68,_0x4118cd){_0x266c68=_0x266c68-0x0;var _0x70a491=_0x524e[_0x266c68];return _0x70a491;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var auth=require(_0xe524('0x4'));var interaction=require(_0xe524('0x5'));var config=require(_0xe524('0x6'));var controller=require(_0xe524('0x7'));router[_0xe524('0x8')]('/',auth[_0xe524('0x9')](),controller['index']);router[_0xe524('0x8')](_0xe524('0xa'),auth[_0xe524('0x9')](),controller['show']);router[_0xe524('0xb')]('/',auth[_0xe524('0x9')](),controller[_0xe524('0xc')]);router[_0xe524('0xd')](_0xe524('0xa'),auth[_0xe524('0x9')](),controller[_0xe524('0xe')]);router[_0xe524('0xf')](_0xe524('0xa'),auth[_0xe524('0x9')](),controller[_0xe524('0x10')]);module[_0xe524('0x11')]=router;
\ No newline at end of file
index 77c553d..1fdb15a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e29=['TEXT','exports'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x2e29,0xd9));var _0x92e2=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x2e29[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require('sequelize');module[_0x92e2('0x0')]={'tree':{'type':Sequelize[_0x92e2('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xcfc9=['sequelize'];(function(_0x1f507d,_0x2cb2e6){var _0x12c032=function(_0x11dbbe){while(--_0x11dbbe){_0x1f507d['push'](_0x1f507d['shift']());}};_0x12c032(++_0x2cb2e6);}(_0xcfc9,0x150));var _0x9cfc=function(_0x577233,_0x5956e4){_0x577233=_0x577233-0x0;var _0x628a94=_0xcfc9[_0x577233];return _0x628a94;};'use strict';var Sequelize=require(_0x9cfc('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
index a98e829..ceeda42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9ba=['query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','keys','include','find','body','params','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','then','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xd9ba,0x102));var _0xad9b=function(_0x254de5,_0x784048){_0x254de5=_0x254de5-0x0;var _0x5aa4a3=_0xd9ba[_0x254de5];return _0x5aa4a3;};'use strict';var pdf=require(_0xad9b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xad9b('0x1'));var zipdir=require(_0xad9b('0x2'));var jsonpatch=require(_0xad9b('0x3'));var rp=require(_0xad9b('0x4'));var moment=require(_0xad9b('0x5'));var BPromise=require(_0xad9b('0x6'));var Mustache=require(_0xad9b('0x7'));var util=require(_0xad9b('0x8'));var path=require(_0xad9b('0x9'));var sox=require(_0xad9b('0xa'));var csv=require(_0xad9b('0xb'));var ejs=require(_0xad9b('0xc'));var fs=require('fs');var _=require(_0xad9b('0xd'));var squel=require(_0xad9b('0xe'));var crypto=require(_0xad9b('0xf'));var jsforce=require(_0xad9b('0x10'));var deskjs=require(_0xad9b('0x11'));var toCsv=require(_0xad9b('0xb'));var querystring=require('querystring');var Papa=require(_0xad9b('0x12'));var Redis=require(_0xad9b('0x13'));var authService=require(_0xad9b('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xad9b('0x15'));var hardwareService=require(_0xad9b('0x16'));var logger=require(_0xad9b('0x17'))(_0xad9b('0x18'));var utils=require(_0xad9b('0x19'));var config=require(_0xad9b('0x1a'));var db=require(_0xad9b('0x1b'))['db'];function respondWithStatusCode(_0x13f10f,_0x13bede){_0x13bede=_0x13bede||0xcc;return function(_0x46bf44){if(_0x46bf44){return _0x13f10f[_0xad9b('0x1c')](_0x13bede);}return _0x13f10f[_0xad9b('0x1d')](_0x13bede)[_0xad9b('0x1e')]();};}function respondWithResult(_0x4a8539,_0x33d88b){_0x33d88b=_0x33d88b||0xc8;return function(_0x2ea442){if(_0x2ea442){return _0x4a8539[_0xad9b('0x1d')](_0x33d88b)[_0xad9b('0x1f')](_0x2ea442);}};}function respondWithFilteredResult(_0x4dcc87,_0x16fc05){return function(_0x1a924c){if(_0x1a924c){var _0x2e1049=_0x1a924c['count'],_0x4bb8ba=_0x16fc05[_0xad9b('0x20')],_0x2cb55a=_0x16fc05['offset']+_0x16fc05['limit'],_0x1a24c6;if(_0x2cb55a>=_0x2e1049){_0x2cb55a=_0x2e1049;_0x1a24c6=0xc8;}else{_0x1a24c6=0xce;}_0x4dcc87[_0xad9b('0x1d')](_0x1a24c6);return _0x4dcc87[_0xad9b('0x21')](_0xad9b('0x22'),_0x4bb8ba+'-'+_0x2cb55a+'/'+_0x2e1049)[_0xad9b('0x1f')](_0x1a924c);}return null;};}function patchUpdates(_0x5c9216){return function(_0x48f607){try{jsonpatch['apply'](_0x48f607,_0x5c9216,!![]);}catch(_0x5a0abd){return BPromise[_0xad9b('0x23')](_0x5a0abd);}return _0x48f607[_0xad9b('0x24')]();};}function saveUpdates(_0x4bdda0,_0x492b85){return function(_0x375efc){if(_0x375efc){return _0x375efc[_0xad9b('0x25')](_0x4bdda0)[_0xad9b('0x26')](function(_0x32f888){return _0x32f888;});}return null;};}function removeEntity(_0x2cbd5e,_0x11a78c){return function(_0x2522af){if(_0x2522af){return _0x2522af['destroy']()[_0xad9b('0x26')](function(){_0x2cbd5e[_0xad9b('0x1d')](0xcc)[_0xad9b('0x1e')]();});}};}function handleEntityNotFound(_0x21e4f0,_0x31235c){return function(_0x2c5c8c){if(!_0x2c5c8c){_0x21e4f0[_0xad9b('0x1c')](0x194);}return _0x2c5c8c;};}function handleError(_0x4f8fcf,_0x2a2992){_0x2a2992=_0x2a2992||0x1f4;return function(_0x2f3eb3){logger[_0xad9b('0x27')](_0x2f3eb3[_0xad9b('0x28')]);if(_0x2f3eb3[_0xad9b('0x29')]){delete _0x2f3eb3[_0xad9b('0x29')];}_0x4f8fcf[_0xad9b('0x1d')](_0x2a2992)['send'](_0x2f3eb3);};}exports[_0xad9b('0x2a')]=function(_0x3a0916,_0x4a2a1a){var _0x428f9c={},_0x35bf30={},_0x3163f4={'count':0x0,'rows':[]};var _0x5d80c4=_[_0xad9b('0x2b')](db[_0xad9b('0x2c')][_0xad9b('0x2d')],function(_0x27de61){return{'name':_0x27de61[_0xad9b('0x2e')],'type':_0x27de61[_0xad9b('0x2f')][_0xad9b('0x30')]};});_0x35bf30[_0xad9b('0x31')]=_[_0xad9b('0x2b')](_0x5d80c4,'name');_0x35bf30['query']=_['keys'](_0x3a0916[_0xad9b('0x32')]);_0x35bf30['filters']=_[_0xad9b('0x33')](_0x35bf30['model'],_0x35bf30['query']);_0x428f9c['attributes']=_['intersection'](_0x35bf30['model'],qs[_0xad9b('0x34')](_0x3a0916['query'][_0xad9b('0x34')]));_0x428f9c[_0xad9b('0x35')]=_0x428f9c['attributes'][_0xad9b('0x36')]?_0x428f9c[_0xad9b('0x35')]:_0x35bf30[_0xad9b('0x31')];if(!_0x3a0916['query'][_0xad9b('0x37')](_0xad9b('0x38'))){_0x428f9c['limit']=qs['limit'](_0x3a0916[_0xad9b('0x32')][_0xad9b('0x39')]);_0x428f9c[_0xad9b('0x20')]=qs[_0xad9b('0x20')](_0x3a0916[_0xad9b('0x32')][_0xad9b('0x20')]);}_0x428f9c['order']=qs[_0xad9b('0x3a')](_0x3a0916[_0xad9b('0x32')][_0xad9b('0x3a')]);_0x428f9c[_0xad9b('0x3b')]=qs[_0xad9b('0x3c')](_['pick'](_0x3a0916[_0xad9b('0x32')],_0x35bf30[_0xad9b('0x3c')]),_0x5d80c4);if(_0x3a0916[_0xad9b('0x32')][_0xad9b('0x3d')]){_0x428f9c['where']=_[_0xad9b('0x3e')](_0x428f9c[_0xad9b('0x3b')],{'$or':_['map'](_0x5d80c4,function(_0xf551b){if(_0xf551b[_0xad9b('0x2f')]!==_0xad9b('0x3f')){var _0x271c32={};_0x271c32[_0xf551b[_0xad9b('0x29')]]={'$like':'%'+_0x3a0916[_0xad9b('0x32')][_0xad9b('0x3d')]+'%'};return _0x271c32;}})});}_0x428f9c=_[_0xad9b('0x3e')]({},_0x428f9c,_0x3a0916[_0xad9b('0x40')]);var _0x3335f9={'where':_0x428f9c['where']};return db[_0xad9b('0x2c')][_0xad9b('0x41')](_0x3335f9)[_0xad9b('0x26')](function(_0xade6a1){_0x3163f4[_0xad9b('0x41')]=_0xade6a1;if(_0x3a0916[_0xad9b('0x32')][_0xad9b('0x42')]){_0x428f9c['include']=[{'all':!![]}];}return db[_0xad9b('0x2c')][_0xad9b('0x43')](_0x428f9c);})[_0xad9b('0x26')](function(_0x5e1e50){_0x3163f4[_0xad9b('0x44')]=_0x5e1e50;return _0x3163f4;})[_0xad9b('0x26')](respondWithFilteredResult(_0x4a2a1a,_0x428f9c))[_0xad9b('0x45')](handleError(_0x4a2a1a,null));};exports[_0xad9b('0x46')]=function(_0x113172,_0x818fb8){var _0x692fb3={'raw':!![],'where':{'id':_0x113172['params']['id']}},_0x4cf14c={};_0x4cf14c['model']=_[_0xad9b('0x47')](db[_0xad9b('0x2c')][_0xad9b('0x2d')]);_0x4cf14c['query']=_[_0xad9b('0x47')](_0x113172[_0xad9b('0x32')]);_0x4cf14c[_0xad9b('0x3c')]=_[_0xad9b('0x33')](_0x4cf14c['model'],_0x4cf14c[_0xad9b('0x32')]);_0x692fb3[_0xad9b('0x35')]=_[_0xad9b('0x33')](_0x4cf14c[_0xad9b('0x31')],qs['fields'](_0x113172[_0xad9b('0x32')][_0xad9b('0x34')]));_0x692fb3['attributes']=_0x692fb3[_0xad9b('0x35')]['length']?_0x692fb3['attributes']:_0x4cf14c[_0xad9b('0x31')];if(_0x113172[_0xad9b('0x32')][_0xad9b('0x42')]){_0x692fb3[_0xad9b('0x48')]=[{'all':!![]}];}_0x692fb3=_[_0xad9b('0x3e')]({},_0x692fb3,_0x113172[_0xad9b('0x40')]);return db[_0xad9b('0x2c')][_0xad9b('0x49')](_0x692fb3)[_0xad9b('0x26')](handleEntityNotFound(_0x818fb8,null))['then'](respondWithResult(_0x818fb8,null))['catch'](handleError(_0x818fb8,null));};exports['create']=function(_0x1a0763,_0x23d763){return db['AnalyticTreeReport']['create'](_0x1a0763[_0xad9b('0x4a')],{})['then'](respondWithResult(_0x23d763,0xc9))[_0xad9b('0x45')](handleError(_0x23d763,null));};exports[_0xad9b('0x25')]=function(_0x124a61,_0x43f8ab){if(_0x124a61[_0xad9b('0x4a')]['id']){delete _0x124a61[_0xad9b('0x4a')]['id'];}return db[_0xad9b('0x2c')]['find']({'where':{'id':_0x124a61[_0xad9b('0x4b')]['id']}})[_0xad9b('0x26')](handleEntityNotFound(_0x43f8ab,null))[_0xad9b('0x26')](saveUpdates(_0x124a61[_0xad9b('0x4a')],null))[_0xad9b('0x26')](respondWithResult(_0x43f8ab,null))[_0xad9b('0x45')](handleError(_0x43f8ab,null));};exports[_0xad9b('0x4c')]=function(_0x5ab9ef,_0x1ea818){return db[_0xad9b('0x2c')][_0xad9b('0x49')]({'where':{'id':_0x5ab9ef[_0xad9b('0x4b')]['id']}})[_0xad9b('0x26')](handleEntityNotFound(_0x1ea818,null))['then'](removeEntity(_0x1ea818,null))[_0xad9b('0x45')](handleError(_0x1ea818,null));};
\ No newline at end of file
+var _0x1cf2=['include','findAll','rows','params','keys','create','body','find','catch','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','end','error','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll'];(function(_0x4c548b,_0x14af65){var _0x1827fd=function(_0xfe5ac8){while(--_0xfe5ac8){_0x4c548b['push'](_0x4c548b['shift']());}};_0x1827fd(++_0x14af65);}(_0x1cf2,0x99));var _0x21cf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1cf2[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x21cf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x21cf('0x1'));var zipdir=require(_0x21cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x21cf('0x3'));var moment=require(_0x21cf('0x4'));var BPromise=require(_0x21cf('0x5'));var Mustache=require(_0x21cf('0x6'));var util=require(_0x21cf('0x7'));var path=require(_0x21cf('0x8'));var sox=require('sox');var csv=require(_0x21cf('0x9'));var ejs=require(_0x21cf('0xa'));var fs=require('fs');var _=require(_0x21cf('0xb'));var squel=require(_0x21cf('0xc'));var crypto=require('crypto');var jsforce=require(_0x21cf('0xd'));var deskjs=require(_0x21cf('0xe'));var toCsv=require(_0x21cf('0x9'));var querystring=require(_0x21cf('0xf'));var Papa=require(_0x21cf('0x10'));var Redis=require(_0x21cf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x21cf('0x12'));var as=require(_0x21cf('0x13'));var hardwareService=require(_0x21cf('0x14'));var logger=require('../../config/logger')(_0x21cf('0x15'));var utils=require(_0x21cf('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f1b18,_0x1e2a6c){_0x1e2a6c=_0x1e2a6c||0xcc;return function(_0x37e303){if(_0x37e303){return _0x5f1b18[_0x21cf('0x17')](_0x1e2a6c);}return _0x5f1b18[_0x21cf('0x18')](_0x1e2a6c)['end']();};}function respondWithResult(_0x540db3,_0x3619ba){_0x3619ba=_0x3619ba||0xc8;return function(_0x312a6a){if(_0x312a6a){return _0x540db3[_0x21cf('0x18')](_0x3619ba)[_0x21cf('0x19')](_0x312a6a);}};}function respondWithFilteredResult(_0x4bcca7,_0x3b377f){return function(_0x340099){if(_0x340099){var _0x52cb3e=_0x340099[_0x21cf('0x1a')],_0x47ebf8=_0x3b377f[_0x21cf('0x1b')],_0x4aa833=_0x3b377f[_0x21cf('0x1b')]+_0x3b377f[_0x21cf('0x1c')],_0x977974;if(_0x4aa833>=_0x52cb3e){_0x4aa833=_0x52cb3e;_0x977974=0xc8;}else{_0x977974=0xce;}_0x4bcca7[_0x21cf('0x18')](_0x977974);return _0x4bcca7[_0x21cf('0x1d')](_0x21cf('0x1e'),_0x47ebf8+'-'+_0x4aa833+'/'+_0x52cb3e)[_0x21cf('0x19')](_0x340099);}return null;};}function patchUpdates(_0x2f2eb8){return function(_0x3ae755){try{jsonpatch['apply'](_0x3ae755,_0x2f2eb8,!![]);}catch(_0x4db71c){return BPromise[_0x21cf('0x1f')](_0x4db71c);}return _0x3ae755[_0x21cf('0x20')]();};}function saveUpdates(_0x296109,_0x54e528){return function(_0x5ce715){if(_0x5ce715){return _0x5ce715[_0x21cf('0x21')](_0x296109)['then'](function(_0x301f88){return _0x301f88;});}return null;};}function removeEntity(_0x2d5df9,_0x4d2b5c){return function(_0x13c2ed){if(_0x13c2ed){return _0x13c2ed[_0x21cf('0x22')]()[_0x21cf('0x23')](function(){_0x2d5df9[_0x21cf('0x18')](0xcc)[_0x21cf('0x24')]();});}};}function handleEntityNotFound(_0x5b8e88,_0xd8c55b){return function(_0x2baa37){if(!_0x2baa37){_0x5b8e88['sendStatus'](0x194);}return _0x2baa37;};}function handleError(_0x478395,_0x4caec5){_0x4caec5=_0x4caec5||0x1f4;return function(_0x336dbb){logger[_0x21cf('0x25')](_0x336dbb['stack']);if(_0x336dbb[_0x21cf('0x26')]){delete _0x336dbb['name'];}_0x478395[_0x21cf('0x18')](_0x4caec5)['send'](_0x336dbb);};}exports[_0x21cf('0x27')]=function(_0x1363df,_0xd5d1d1){var _0x207e96={},_0x5edd10={},_0x2c2e8f={'count':0x0,'rows':[]};var _0x4c8b58=_[_0x21cf('0x28')](db[_0x21cf('0x29')][_0x21cf('0x2a')],function(_0x3cf01b){return{'name':_0x3cf01b[_0x21cf('0x2b')],'type':_0x3cf01b['type'][_0x21cf('0x2c')]};});_0x5edd10[_0x21cf('0x2d')]=_[_0x21cf('0x28')](_0x4c8b58,_0x21cf('0x26'));_0x5edd10[_0x21cf('0x2e')]=_['keys'](_0x1363df[_0x21cf('0x2e')]);_0x5edd10['filters']=_[_0x21cf('0x2f')](_0x5edd10[_0x21cf('0x2d')],_0x5edd10[_0x21cf('0x2e')]);_0x207e96['attributes']=_[_0x21cf('0x2f')](_0x5edd10[_0x21cf('0x2d')],qs[_0x21cf('0x30')](_0x1363df[_0x21cf('0x2e')][_0x21cf('0x30')]));_0x207e96[_0x21cf('0x31')]=_0x207e96[_0x21cf('0x31')][_0x21cf('0x32')]?_0x207e96[_0x21cf('0x31')]:_0x5edd10[_0x21cf('0x2d')];if(!_0x1363df[_0x21cf('0x2e')][_0x21cf('0x33')](_0x21cf('0x34'))){_0x207e96[_0x21cf('0x1c')]=qs[_0x21cf('0x1c')](_0x1363df[_0x21cf('0x2e')][_0x21cf('0x1c')]);_0x207e96['offset']=qs[_0x21cf('0x1b')](_0x1363df[_0x21cf('0x2e')][_0x21cf('0x1b')]);}_0x207e96[_0x21cf('0x35')]=qs[_0x21cf('0x36')](_0x1363df[_0x21cf('0x2e')][_0x21cf('0x36')]);_0x207e96[_0x21cf('0x37')]=qs[_0x21cf('0x38')](_[_0x21cf('0x39')](_0x1363df[_0x21cf('0x2e')],_0x5edd10['filters']),_0x4c8b58);if(_0x1363df[_0x21cf('0x2e')][_0x21cf('0x3a')]){_0x207e96[_0x21cf('0x37')]=_[_0x21cf('0x3b')](_0x207e96[_0x21cf('0x37')],{'$or':_['map'](_0x4c8b58,function(_0x178dca){if(_0x178dca[_0x21cf('0x3c')]!=='VIRTUAL'){var _0x3b33bd={};_0x3b33bd[_0x178dca['name']]={'$like':'%'+_0x1363df[_0x21cf('0x2e')]['filter']+'%'};return _0x3b33bd;}})});}_0x207e96=_[_0x21cf('0x3b')]({},_0x207e96,_0x1363df[_0x21cf('0x3d')]);var _0x59c1cf={'where':_0x207e96[_0x21cf('0x37')]};return db[_0x21cf('0x29')][_0x21cf('0x1a')](_0x59c1cf)[_0x21cf('0x23')](function(_0x23f8ca){_0x2c2e8f[_0x21cf('0x1a')]=_0x23f8ca;if(_0x1363df[_0x21cf('0x2e')][_0x21cf('0x3e')]){_0x207e96[_0x21cf('0x3f')]=[{'all':!![]}];}return db[_0x21cf('0x29')][_0x21cf('0x40')](_0x207e96);})[_0x21cf('0x23')](function(_0x2e07d5){_0x2c2e8f[_0x21cf('0x41')]=_0x2e07d5;return _0x2c2e8f;})[_0x21cf('0x23')](respondWithFilteredResult(_0xd5d1d1,_0x207e96))['catch'](handleError(_0xd5d1d1,null));};exports['show']=function(_0x20a524,_0x144664){var _0x52318b={'raw':!![],'where':{'id':_0x20a524[_0x21cf('0x42')]['id']}},_0x2b2f17={};_0x2b2f17[_0x21cf('0x2d')]=_['keys'](db['AnalyticTreeReport'][_0x21cf('0x2a')]);_0x2b2f17['query']=_[_0x21cf('0x43')](_0x20a524[_0x21cf('0x2e')]);_0x2b2f17[_0x21cf('0x38')]=_['intersection'](_0x2b2f17[_0x21cf('0x2d')],_0x2b2f17[_0x21cf('0x2e')]);_0x52318b[_0x21cf('0x31')]=_['intersection'](_0x2b2f17['model'],qs[_0x21cf('0x30')](_0x20a524[_0x21cf('0x2e')][_0x21cf('0x30')]));_0x52318b[_0x21cf('0x31')]=_0x52318b[_0x21cf('0x31')][_0x21cf('0x32')]?_0x52318b['attributes']:_0x2b2f17[_0x21cf('0x2d')];if(_0x20a524[_0x21cf('0x2e')][_0x21cf('0x3e')]){_0x52318b[_0x21cf('0x3f')]=[{'all':!![]}];}_0x52318b=_[_0x21cf('0x3b')]({},_0x52318b,_0x20a524[_0x21cf('0x3d')]);return db[_0x21cf('0x29')]['find'](_0x52318b)[_0x21cf('0x23')](handleEntityNotFound(_0x144664,null))[_0x21cf('0x23')](respondWithResult(_0x144664,null))['catch'](handleError(_0x144664,null));};exports[_0x21cf('0x44')]=function(_0x538294,_0x23f368){return db[_0x21cf('0x29')][_0x21cf('0x44')](_0x538294['body'],{})[_0x21cf('0x23')](respondWithResult(_0x23f368,0xc9))['catch'](handleError(_0x23f368,null));};exports[_0x21cf('0x21')]=function(_0x80b469,_0x2659f3){if(_0x80b469['body']['id']){delete _0x80b469[_0x21cf('0x45')]['id'];}return db[_0x21cf('0x29')]['find']({'where':{'id':_0x80b469[_0x21cf('0x42')]['id']}})[_0x21cf('0x23')](handleEntityNotFound(_0x2659f3,null))[_0x21cf('0x23')](saveUpdates(_0x80b469['body'],null))[_0x21cf('0x23')](respondWithResult(_0x2659f3,null))['catch'](handleError(_0x2659f3,null));};exports[_0x21cf('0x22')]=function(_0x20a82c,_0x12dd68){return db['AnalyticTreeReport'][_0x21cf('0x46')]({'where':{'id':_0x20a82c[_0x21cf('0x42')]['id']}})['then'](handleEntityNotFound(_0x12dd68,null))[_0x21cf('0x23')](removeEntity(_0x12dd68,null))[_0x21cf('0x47')](handleError(_0x12dd68,null));};
\ No newline at end of file
index 7ed3b2f..e844f20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3e5=['api','moment','path','../../config/environment','exports','define'];(function(_0x1e450c,_0xb3cec0){var _0x50c788=function(_0x170fe6){while(--_0x170fe6){_0x1e450c['push'](_0x1e450c['shift']());}};_0x50c788(++_0xb3cec0);}(_0xf3e5,0x1a4));var _0x5f3e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xf3e5[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x5f3e('0x0'));var moment=require(_0x5f3e('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f3e('0x2'));var rimraf=require('rimraf');var config=require(_0x5f3e('0x3'));var attributes=require('./analyticTreeReport.attributes');module[_0x5f3e('0x4')]=function(_0x132bd2,_0x5b10e0){return _0x132bd2[_0x5f3e('0x5')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc224=['define','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x5e1d19,_0x3cb838){var _0x263c5b=function(_0x5b1629){while(--_0x5b1629){_0x5e1d19['push'](_0x5e1d19['shift']());}};_0x263c5b(++_0x3cb838);}(_0xc224,0x17d));var _0x4c22=function(_0x41c826,_0x34bfb9){_0x41c826=_0x41c826-0x0;var _0x6920de=_0xc224[_0x41c826];return _0x6920de;};'use strict';var _=require('lodash');var util=require(_0x4c22('0x0'));var logger=require(_0x4c22('0x1'))(_0x4c22('0x2'));var moment=require(_0x4c22('0x3'));var BPromise=require(_0x4c22('0x4'));var rp=require(_0x4c22('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4c22('0x6'));var attributes=require(_0x4c22('0x7'));module[_0x4c22('0x8')]=function(_0xd734f5,_0x527331){return _0xd734f5[_0x4c22('0x9')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2ae9654..a674caf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4766=['result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x6c9e12,_0x48328c){var _0x40d1fc=function(_0xb4820f){while(--_0xb4820f){_0x6c9e12['push'](_0x6c9e12['shift']());}};_0x40d1fc(++_0x48328c);}(_0x4766,0xde));var _0x6476=function(_0x5c868,_0xf42eea){_0x5c868=_0x5c868-0x0;var _0xa591e9=_0x4766[_0x5c868];return _0xa591e9;};'use strict';var _=require('lodash');var util=require(_0x6476('0x0'));var moment=require(_0x6476('0x1'));var BPromise=require(_0x6476('0x2'));var rs=require(_0x6476('0x3'));var fs=require('fs');var Redis=require(_0x6476('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6476('0x5'));var logger=require(_0x6476('0x6'))('rpc');var config=require(_0x6476('0x7'));var jayson=require(_0x6476('0x8'));var client=jayson['client'][_0x6476('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x125182,_0x226e31,_0xdc1916){return new BPromise(function(_0x2ad31c,_0xdac681){return client[_0x6476('0xa')](_0x125182,_0xdc1916)['then'](function(_0x5214ce){logger[_0x6476('0xb')](_0x6476('0xc'),_0x226e31,_0x6476('0xd'));logger[_0x6476('0xe')](_0x6476('0xf'),_0x226e31,'request\x20sent',JSON[_0x6476('0x10')](_0x5214ce));if(_0x5214ce[_0x6476('0x11')]){if(_0x5214ce['error'][_0x6476('0x12')]===0x1f4){logger[_0x6476('0x11')](_0x6476('0xc'),_0x226e31,_0x5214ce[_0x6476('0x11')]['message']);return _0xdac681(_0x5214ce['error']['message']);}logger[_0x6476('0x11')](_0x6476('0xc'),_0x226e31,_0x5214ce[_0x6476('0x11')][_0x6476('0x13')]);return _0x2ad31c(_0x5214ce['error'][_0x6476('0x13')]);}else{logger[_0x6476('0xb')](_0x6476('0xc'),_0x226e31,_0x6476('0xd'));_0x2ad31c(_0x5214ce[_0x6476('0x14')][_0x6476('0x13')]);}})[_0x6476('0x15')](function(_0x2d69a1){logger[_0x6476('0x11')](_0x6476('0xc'),_0x226e31,_0x2d69a1);_0xdac681(_0x2d69a1);});});}
\ No newline at end of file
+var _0xf353=['info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xf353,0x9c));var _0x3f35=function(_0x8732d3,_0x49895f){_0x8732d3=_0x8732d3-0x0;var _0x395cbe=_0xf353[_0x8732d3];return _0x395cbe;};'use strict';var _=require(_0x3f35('0x0'));var util=require(_0x3f35('0x1'));var moment=require('moment');var BPromise=require(_0x3f35('0x2'));var rs=require(_0x3f35('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f35('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f35('0x5'))(_0x3f35('0x6'));var config=require(_0x3f35('0x7'));var jayson=require(_0x3f35('0x8'));var client=jayson[_0x3f35('0x9')][_0x3f35('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e5661,_0x320ac2,_0x4e3a09){return new BPromise(function(_0x58e89c,_0x118464){return client[_0x3f35('0xb')](_0x5e5661,_0x4e3a09)['then'](function(_0x27c3db){logger[_0x3f35('0xc')](_0x3f35('0xd'),_0x320ac2,_0x3f35('0xe'));logger[_0x3f35('0xf')](_0x3f35('0x10'),_0x320ac2,_0x3f35('0xe'),JSON[_0x3f35('0x11')](_0x27c3db));if(_0x27c3db[_0x3f35('0x12')]){if(_0x27c3db[_0x3f35('0x12')][_0x3f35('0x13')]===0x1f4){logger[_0x3f35('0x12')](_0x3f35('0xd'),_0x320ac2,_0x27c3db[_0x3f35('0x12')]['message']);return _0x118464(_0x27c3db[_0x3f35('0x12')][_0x3f35('0x14')]);}logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x320ac2,_0x27c3db[_0x3f35('0x12')]['message']);return _0x58e89c(_0x27c3db[_0x3f35('0x12')][_0x3f35('0x14')]);}else{logger[_0x3f35('0xc')](_0x3f35('0xd'),_0x320ac2,_0x3f35('0xe'));_0x58e89c(_0x27c3db['result']['message']);}})['catch'](function(_0x48c340){logger[_0x3f35('0x12')](_0x3f35('0xd'),_0x320ac2,_0x48c340);_0x118464(_0x48c340);});});}
\ No newline at end of file
index 4f60016..5aa1fca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42d3=['update','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','post','put'];(function(_0xf47a36,_0x4b834f){var _0x31ba2b=function(_0x4be052){while(--_0x4be052){_0xf47a36['push'](_0xf47a36['shift']());}};_0x31ba2b(++_0x4b834f);}(_0x42d3,0x19b));var _0x342d=function(_0x10a978,_0x111939){_0x10a978=_0x10a978-0x0;var _0x47b2d6=_0x42d3[_0x10a978];return _0x47b2d6;};'use strict';var multer=require(_0x342d('0x0'));var util=require(_0x342d('0x1'));var path=require(_0x342d('0x2'));var timeout=require('connect-timeout');var express=require(_0x342d('0x3'));var router=express[_0x342d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x342d('0x5'));var config=require('../../config/environment');var controller=require(_0x342d('0x6'));router[_0x342d('0x7')]('/',auth['isAuthenticated'](),controller[_0x342d('0x8')]);router[_0x342d('0x7')](_0x342d('0x9'),auth[_0x342d('0xa')](),controller[_0x342d('0xb')]);router[_0x342d('0xc')]('/',auth[_0x342d('0xa')](),controller['create']);router[_0x342d('0xd')](_0x342d('0x9'),auth[_0x342d('0xa')](),controller[_0x342d('0xe')]);router[_0x342d('0xf')](_0x342d('0x9'),auth[_0x342d('0xa')](),controller[_0x342d('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x4360=['index','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x4360,0x1ef));var _0x0436=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4360[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0436('0x0'));var util=require(_0x0436('0x1'));var path=require(_0x0436('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0436('0x3')]();var auth=require(_0x0436('0x4'));var interaction=require(_0x0436('0x5'));var config=require(_0x0436('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x0436('0x7')]('/',auth[_0x0436('0x8')](),controller[_0x0436('0x9')]);router[_0x0436('0x7')]('/:id',auth[_0x0436('0x8')](),controller['show']);router[_0x0436('0xa')]('/',auth[_0x0436('0x8')](),controller[_0x0436('0xb')]);router[_0x0436('0xc')](_0x0436('0xd'),auth[_0x0436('0x8')](),controller[_0x0436('0xe')]);router[_0x0436('0xf')](_0x0436('0xd'),auth[_0x0436('0x8')](),controller[_0x0436('0x10')]);module[_0x0436('0x11')]=router;
\ No newline at end of file
index 37f3510..bd3d8c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc65b=['sequelize','exports','STRING'];(function(_0x312f81,_0x17916a){var _0x33605b=function(_0x477e22){while(--_0x477e22){_0x312f81['push'](_0x312f81['shift']());}};_0x33605b(++_0x17916a);}(_0xc65b,0x75));var _0xbc65=function(_0x576d5b,_0x1b8b7b){_0x576d5b=_0x576d5b-0x0;var _0x5b1f5e=_0xc65b[_0x576d5b];return _0x5b1f5e;};'use strict';var Sequelize=require(_0xbc65('0x0'));module[_0xbc65('0x1')]={'name':{'type':Sequelize[_0xbc65('0x2')]},'basename':{'type':Sequelize[_0xbc65('0x2')]},'type':{'type':Sequelize[_0xbc65('0x2')]}};
\ No newline at end of file
+var _0x504b=['STRING'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x504b,0x120));var _0xb504=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x504b[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xb504('0x0')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
index fa8536b..265e066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7793=['sort','where','pick','filter','VIRTUAL','merge','options','Attachment','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','clone','get','createdAt','updatedAt','body','omit','create','update','destroy','file','originalname','basename','filename','download','join','root','server/files/attachments/','html-pdf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','offset','apply','save','then','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order'];(function(_0x517650,_0x26b209){var _0x3bfb7e=function(_0xc11b3d){while(--_0xc11b3d){_0x517650['push'](_0x517650['shift']());}};_0x3bfb7e(++_0x26b209);}(_0x7793,0x79));var _0x3779=function(_0x1cb9c3,_0x115c23){_0x1cb9c3=_0x1cb9c3-0x0;var _0x730f4=_0x7793[_0x1cb9c3];return _0x730f4;};'use strict';var pdf=require(_0x3779('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3779('0x1'));var jsonpatch=require(_0x3779('0x2'));var rp=require('request-promise');var moment=require(_0x3779('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3779('0x4'));var util=require(_0x3779('0x5'));var path=require(_0x3779('0x6'));var sox=require(_0x3779('0x7'));var csv=require('to-csv');var ejs=require(_0x3779('0x8'));var fs=require('fs');var _=require(_0x3779('0x9'));var squel=require(_0x3779('0xa'));var crypto=require(_0x3779('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3779('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3779('0xd'));var Papa=require(_0x3779('0xe'));var Redis=require('ioredis');var authService=require(_0x3779('0xf'));var qs=require(_0x3779('0x10'));var as=require(_0x3779('0x11'));var hardwareService=require(_0x3779('0x12'));var logger=require(_0x3779('0x13'))('api');var utils=require(_0x3779('0x14'));var config=require('../../config/environment');var db=require(_0x3779('0x15'))['db'];function respondWithStatusCode(_0x287b0a,_0x5d824f){_0x5d824f=_0x5d824f||0xcc;return function(_0x895966){if(_0x895966){return _0x287b0a['sendStatus'](_0x5d824f);}return _0x287b0a[_0x3779('0x16')](_0x5d824f)[_0x3779('0x17')]();};}function respondWithResult(_0x14e4ed,_0x5d4bcc){_0x5d4bcc=_0x5d4bcc||0xc8;return function(_0x4cc7aa){if(_0x4cc7aa){return _0x14e4ed[_0x3779('0x16')](_0x5d4bcc)[_0x3779('0x18')](_0x4cc7aa);}};}function respondWithFilteredResult(_0x375c8d,_0x362c33){return function(_0x1ee1c7){if(_0x1ee1c7){var _0x35fa5f=_0x1ee1c7[_0x3779('0x19')],_0x52491e=_0x362c33[_0x3779('0x1a')],_0x265995=_0x362c33[_0x3779('0x1a')]+_0x362c33['limit'],_0x1ff7d5;if(_0x265995>=_0x35fa5f){_0x265995=_0x35fa5f;_0x1ff7d5=0xc8;}else{_0x1ff7d5=0xce;}_0x375c8d[_0x3779('0x16')](_0x1ff7d5);return _0x375c8d['set']('Content-Range',_0x52491e+'-'+_0x265995+'/'+_0x35fa5f)['json'](_0x1ee1c7);}return null;};}function patchUpdates(_0x54e14a){return function(_0xa402c1){try{jsonpatch[_0x3779('0x1b')](_0xa402c1,_0x54e14a,!![]);}catch(_0x26786b){return BPromise['reject'](_0x26786b);}return _0xa402c1[_0x3779('0x1c')]();};}function saveUpdates(_0x188fff,_0x2ffe61){return function(_0x2871ea){if(_0x2871ea){return _0x2871ea['update'](_0x188fff)['then'](function(_0x4aed28){return _0x4aed28;});}return null;};}function removeEntity(_0x5575b0,_0x2d9761){return function(_0xbd96bf){if(_0xbd96bf){return _0xbd96bf['destroy']()[_0x3779('0x1d')](function(){_0x5575b0[_0x3779('0x16')](0xcc)[_0x3779('0x17')]();});}};}function handleEntityNotFound(_0x11ba23,_0xb1413c){return function(_0x31028a){if(!_0x31028a){_0x11ba23[_0x3779('0x1e')](0x194);}return _0x31028a;};}function handleError(_0x4ef5e9,_0x126a47){_0x126a47=_0x126a47||0x1f4;return function(_0x445c2a){logger[_0x3779('0x1f')](_0x445c2a[_0x3779('0x20')]);if(_0x445c2a[_0x3779('0x21')]){delete _0x445c2a['name'];}_0x4ef5e9['status'](_0x126a47)[_0x3779('0x22')](_0x445c2a);};}exports[_0x3779('0x23')]=function(_0x1dd463,_0x39680d){var _0x42459f={},_0x564b23={},_0x9a1b10={'count':0x0,'rows':[]};var _0x479698=_[_0x3779('0x24')](db['Attachment']['rawAttributes'],function(_0x474f2f){return{'name':_0x474f2f[_0x3779('0x25')],'type':_0x474f2f[_0x3779('0x26')][_0x3779('0x27')]};});_0x564b23[_0x3779('0x28')]=_[_0x3779('0x24')](_0x479698,_0x3779('0x21'));_0x564b23[_0x3779('0x29')]=_[_0x3779('0x2a')](_0x1dd463[_0x3779('0x29')]);_0x564b23[_0x3779('0x2b')]=_[_0x3779('0x2c')](_0x564b23['model'],_0x564b23[_0x3779('0x29')]);_0x42459f[_0x3779('0x2d')]=_[_0x3779('0x2c')](_0x564b23[_0x3779('0x28')],qs[_0x3779('0x2e')](_0x1dd463[_0x3779('0x29')]['fields']));_0x42459f[_0x3779('0x2d')]=_0x42459f[_0x3779('0x2d')]['length']?_0x42459f['attributes']:_0x564b23[_0x3779('0x28')];if(!_0x1dd463[_0x3779('0x29')][_0x3779('0x2f')](_0x3779('0x30'))){_0x42459f[_0x3779('0x31')]=qs[_0x3779('0x31')](_0x1dd463[_0x3779('0x29')][_0x3779('0x31')]);_0x42459f[_0x3779('0x1a')]=qs[_0x3779('0x1a')](_0x1dd463[_0x3779('0x29')]['offset']);}_0x42459f[_0x3779('0x32')]=qs[_0x3779('0x33')](_0x1dd463['query'][_0x3779('0x33')]);_0x42459f[_0x3779('0x34')]=qs[_0x3779('0x2b')](_[_0x3779('0x35')](_0x1dd463[_0x3779('0x29')],_0x564b23[_0x3779('0x2b')]),_0x479698);if(_0x1dd463['query'][_0x3779('0x36')]){_0x42459f[_0x3779('0x34')]=_['merge'](_0x42459f[_0x3779('0x34')],{'$or':_['map'](_0x479698,function(_0x3e65b9){if(_0x3e65b9['type']!==_0x3779('0x37')){var _0x1b138f={};_0x1b138f[_0x3e65b9[_0x3779('0x21')]]={'$like':'%'+_0x1dd463['query'][_0x3779('0x36')]+'%'};return _0x1b138f;}})});}_0x42459f=_[_0x3779('0x38')]({},_0x42459f,_0x1dd463[_0x3779('0x39')]);var _0x5ac4f0={'where':_0x42459f[_0x3779('0x34')]};return db[_0x3779('0x3a')][_0x3779('0x19')](_0x5ac4f0)[_0x3779('0x1d')](function(_0x4d895e){_0x9a1b10[_0x3779('0x19')]=_0x4d895e;if(_0x1dd463[_0x3779('0x29')][_0x3779('0x3b')]){_0x42459f[_0x3779('0x3c')]=[{'all':!![]}];}return db[_0x3779('0x3a')][_0x3779('0x3d')](_0x42459f);})['then'](function(_0x521361){_0x9a1b10[_0x3779('0x3e')]=_0x521361;return _0x9a1b10;})[_0x3779('0x1d')](respondWithFilteredResult(_0x39680d,_0x42459f))[_0x3779('0x3f')](handleError(_0x39680d,null));};exports[_0x3779('0x40')]=function(_0x9cfdd6,_0x3fd242){var _0x199d1c={'raw':!![],'where':{'id':_0x9cfdd6[_0x3779('0x41')]['id']}},_0x46f74c={};_0x46f74c[_0x3779('0x28')]=_[_0x3779('0x2a')](db['Attachment'][_0x3779('0x42')]);_0x46f74c[_0x3779('0x29')]=_[_0x3779('0x2a')](_0x9cfdd6[_0x3779('0x29')]);_0x46f74c[_0x3779('0x2b')]=_[_0x3779('0x2c')](_0x46f74c['model'],_0x46f74c[_0x3779('0x29')]);_0x199d1c[_0x3779('0x2d')]=_[_0x3779('0x2c')](_0x46f74c[_0x3779('0x28')],qs[_0x3779('0x2e')](_0x9cfdd6[_0x3779('0x29')]['fields']));_0x199d1c[_0x3779('0x2d')]=_0x199d1c[_0x3779('0x2d')][_0x3779('0x43')]?_0x199d1c['attributes']:_0x46f74c['model'];if(_0x9cfdd6[_0x3779('0x29')][_0x3779('0x3b')]){_0x199d1c['include']=[{'all':!![]}];}_0x199d1c=_[_0x3779('0x38')]({},_0x199d1c,_0x9cfdd6[_0x3779('0x39')]);return db['Attachment'][_0x3779('0x44')](_0x199d1c)[_0x3779('0x1d')](handleEntityNotFound(_0x3fd242,null))[_0x3779('0x1d')](respondWithResult(_0x3fd242,null))[_0x3779('0x3f')](handleError(_0x3fd242,null));};exports[_0x3779('0x45')]=function(_0x43e15b,_0x476825){var _0x44620d={'where':{'id':_0x43e15b[_0x3779('0x41')]['id']}},_0x50cc33={};_0x50cc33['model']=_[_0x3779('0x2a')](db[_0x3779('0x3a')]['rawAttributes']);_0x44620d[_0x3779('0x2d')]=_['intersection'](_0x50cc33['model'],qs[_0x3779('0x2e')](_0x43e15b[_0x3779('0x29')][_0x3779('0x2e')]));_0x44620d[_0x3779('0x2d')]=_0x44620d[_0x3779('0x2d')][_0x3779('0x43')]?_0x44620d[_0x3779('0x2d')]:_0x50cc33[_0x3779('0x28')];if(_0x43e15b[_0x3779('0x29')][_0x3779('0x3b')]){_0x44620d[_0x3779('0x3c')]=[{'all':!![]}];}_0x44620d=_['merge']({},_0x44620d,_0x43e15b['options']);return db[_0x3779('0x3a')][_0x3779('0x44')](_0x44620d)[_0x3779('0x1d')](handleEntityNotFound(_0x476825,null))[_0x3779('0x1d')](function(_0x72e91f){if(_0x72e91f){var _0x50ad06=_0x72e91f[_0x3779('0x46')]({'plain':!![]});_0x50ad06=qs['omit'](_0x50ad06,['id',_0x3779('0x47'),_0x3779('0x48')]);_0x43e15b[_0x3779('0x49')]=_[_0x3779('0x4a')](_0x43e15b[_0x3779('0x49')],['id','createdAt','updatedAt']);return db[_0x3779('0x3a')][_0x3779('0x4b')](_[_0x3779('0x38')](_0x50ad06,_0x43e15b[_0x3779('0x49')]),{'include':_0x43e15b[_0x3779('0x29')][_0x3779('0x3b')]?[{'all':!![]}]:undefined});}})[_0x3779('0x1d')](respondWithResult(_0x476825,0xc9))[_0x3779('0x3f')](handleError(_0x476825,null));};exports[_0x3779('0x4c')]=function(_0x3dfaf9,_0xc55695){if(_0x3dfaf9[_0x3779('0x49')]['id']){delete _0x3dfaf9[_0x3779('0x49')]['id'];}return db['Attachment'][_0x3779('0x44')]({'where':{'id':_0x3dfaf9[_0x3779('0x41')]['id']}})[_0x3779('0x1d')](handleEntityNotFound(_0xc55695,null))[_0x3779('0x1d')](saveUpdates(_0x3dfaf9['body'],null))[_0x3779('0x1d')](respondWithResult(_0xc55695,null))[_0x3779('0x3f')](handleError(_0xc55695,null));};exports[_0x3779('0x4d')]=function(_0x2999a8,_0x5dbd37){return db[_0x3779('0x3a')][_0x3779('0x44')]({'where':{'id':_0x2999a8['params']['id']}})[_0x3779('0x1d')](handleEntityNotFound(_0x5dbd37,null))[_0x3779('0x1d')](removeEntity(_0x5dbd37,null))[_0x3779('0x3f')](handleError(_0x5dbd37,null));};exports['create']=function(_0x472cf1,_0x297811,_0x44b0de){_0x472cf1['body']['name']=_0x472cf1[_0x3779('0x4e')][_0x3779('0x4f')];_0x472cf1[_0x3779('0x49')][_0x3779('0x50')]=_0x472cf1[_0x3779('0x4e')][_0x3779('0x51')];_0x472cf1[_0x3779('0x49')][_0x3779('0x26')]=_0x472cf1[_0x3779('0x4e')]['mimetype'];return db[_0x3779('0x3a')]['create'](_0x472cf1[_0x3779('0x49')])[_0x3779('0x1d')](respondWithResult(_0x297811,0xc9))[_0x3779('0x3f')](handleError(_0x297811,null));};exports[_0x3779('0x52')]=function(_0xd169bc,_0x3a5b81,_0x5e4254){return db[_0x3779('0x3a')]['findOne']({'where':{'id':_0xd169bc['params']['id']},'raw':!![]})[_0x3779('0x1d')](handleEntityNotFound(_0x3a5b81,null))['then'](function(_0x2882ad){if(_0x2882ad){return _0x3a5b81['download'](path[_0x3779('0x53')](config[_0x3779('0x54')],_0x3779('0x55'),_0x2882ad[_0x3779('0x50')]));}})[_0x3779('0x3f')](handleError(_0x3a5b81,null));};
\ No newline at end of file
+var _0xf4bc=['sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','Attachment','rawAttributes','fieldName','key','model','keys','intersection','query','fields','attributes','length','nolimit','limit','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','clone','get','omit','createdAt','updatedAt','body','create','destroy','originalname','file','type','mimetype','download','findOne','join','root','server/files/attachments/','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x15b37c,_0x398a0a){var _0x36a161=function(_0x4f1d05){while(--_0x4f1d05){_0x15b37c['push'](_0x15b37c['shift']());}};_0x36a161(++_0x398a0a);}(_0xf4bc,0x19e));var _0xcf4b=function(_0x3a9e1f,_0x3f7ac7){_0x3a9e1f=_0x3a9e1f-0x0;var _0x419aed=_0xf4bc[_0x3a9e1f];return _0x419aed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcf4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf4b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf4b('0x2'));var moment=require(_0xcf4b('0x3'));var BPromise=require(_0xcf4b('0x4'));var Mustache=require(_0xcf4b('0x5'));var util=require(_0xcf4b('0x6'));var path=require(_0xcf4b('0x7'));var sox=require('sox');var csv=require(_0xcf4b('0x8'));var ejs=require(_0xcf4b('0x9'));var fs=require('fs');var _=require(_0xcf4b('0xa'));var squel=require(_0xcf4b('0xb'));var crypto=require(_0xcf4b('0xc'));var jsforce=require(_0xcf4b('0xd'));var deskjs=require(_0xcf4b('0xe'));var toCsv=require(_0xcf4b('0x8'));var querystring=require(_0xcf4b('0xf'));var Papa=require(_0xcf4b('0x10'));var Redis=require(_0xcf4b('0x11'));var authService=require(_0xcf4b('0x12'));var qs=require(_0xcf4b('0x13'));var as=require(_0xcf4b('0x14'));var hardwareService=require(_0xcf4b('0x15'));var logger=require(_0xcf4b('0x16'))(_0xcf4b('0x17'));var utils=require(_0xcf4b('0x18'));var config=require(_0xcf4b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c5ad4,_0x24f00e){_0x24f00e=_0x24f00e||0xcc;return function(_0x49365f){if(_0x49365f){return _0x2c5ad4[_0xcf4b('0x1a')](_0x24f00e);}return _0x2c5ad4['status'](_0x24f00e)[_0xcf4b('0x1b')]();};}function respondWithResult(_0x3ae21d,_0x484290){_0x484290=_0x484290||0xc8;return function(_0x4895f9){if(_0x4895f9){return _0x3ae21d[_0xcf4b('0x1c')](_0x484290)[_0xcf4b('0x1d')](_0x4895f9);}};}function respondWithFilteredResult(_0x4a3372,_0x5585cc){return function(_0x3c160c){if(_0x3c160c){var _0x2b6d7f=_0x3c160c[_0xcf4b('0x1e')],_0x268f4a=_0x5585cc[_0xcf4b('0x1f')],_0x4de4b3=_0x5585cc[_0xcf4b('0x1f')]+_0x5585cc['limit'],_0x5a7722;if(_0x4de4b3>=_0x2b6d7f){_0x4de4b3=_0x2b6d7f;_0x5a7722=0xc8;}else{_0x5a7722=0xce;}_0x4a3372[_0xcf4b('0x1c')](_0x5a7722);return _0x4a3372['set'](_0xcf4b('0x20'),_0x268f4a+'-'+_0x4de4b3+'/'+_0x2b6d7f)[_0xcf4b('0x1d')](_0x3c160c);}return null;};}function patchUpdates(_0x238a53){return function(_0x284b49){try{jsonpatch[_0xcf4b('0x21')](_0x284b49,_0x238a53,!![]);}catch(_0x342af8){return BPromise[_0xcf4b('0x22')](_0x342af8);}return _0x284b49[_0xcf4b('0x23')]();};}function saveUpdates(_0x3c336a,_0x5e6c15){return function(_0x302f38){if(_0x302f38){return _0x302f38[_0xcf4b('0x24')](_0x3c336a)[_0xcf4b('0x25')](function(_0x57302d){return _0x57302d;});}return null;};}function removeEntity(_0x34cd7b,_0x50ec04){return function(_0x3dd92b){if(_0x3dd92b){return _0x3dd92b['destroy']()[_0xcf4b('0x25')](function(){_0x34cd7b[_0xcf4b('0x1c')](0xcc)[_0xcf4b('0x1b')]();});}};}function handleEntityNotFound(_0x5d8694,_0x32f7ca){return function(_0x33fd4){if(!_0x33fd4){_0x5d8694[_0xcf4b('0x1a')](0x194);}return _0x33fd4;};}function handleError(_0x36e1cd,_0x3cb1da){_0x3cb1da=_0x3cb1da||0x1f4;return function(_0x543718){logger['error'](_0x543718[_0xcf4b('0x26')]);if(_0x543718[_0xcf4b('0x27')]){delete _0x543718[_0xcf4b('0x27')];}_0x36e1cd[_0xcf4b('0x1c')](_0x3cb1da)[_0xcf4b('0x28')](_0x543718);};}exports[_0xcf4b('0x29')]=function(_0x27d4fe,_0x1bde96){var _0x10f080={},_0x12c057={},_0x2d9717={'count':0x0,'rows':[]};var _0x202813=_[_0xcf4b('0x2a')](db[_0xcf4b('0x2b')][_0xcf4b('0x2c')],function(_0x5a69e8){return{'name':_0x5a69e8[_0xcf4b('0x2d')],'type':_0x5a69e8['type'][_0xcf4b('0x2e')]};});_0x12c057[_0xcf4b('0x2f')]=_[_0xcf4b('0x2a')](_0x202813,'name');_0x12c057['query']=_[_0xcf4b('0x30')](_0x27d4fe['query']);_0x12c057['filters']=_[_0xcf4b('0x31')](_0x12c057['model'],_0x12c057[_0xcf4b('0x32')]);_0x10f080['attributes']=_[_0xcf4b('0x31')](_0x12c057[_0xcf4b('0x2f')],qs[_0xcf4b('0x33')](_0x27d4fe[_0xcf4b('0x32')]['fields']));_0x10f080[_0xcf4b('0x34')]=_0x10f080[_0xcf4b('0x34')][_0xcf4b('0x35')]?_0x10f080[_0xcf4b('0x34')]:_0x12c057[_0xcf4b('0x2f')];if(!_0x27d4fe[_0xcf4b('0x32')]['hasOwnProperty'](_0xcf4b('0x36'))){_0x10f080[_0xcf4b('0x37')]=qs[_0xcf4b('0x37')](_0x27d4fe[_0xcf4b('0x32')]['limit']);_0x10f080['offset']=qs[_0xcf4b('0x1f')](_0x27d4fe[_0xcf4b('0x32')][_0xcf4b('0x1f')]);}_0x10f080['order']=qs['sort'](_0x27d4fe[_0xcf4b('0x32')][_0xcf4b('0x38')]);_0x10f080['where']=qs['filters'](_[_0xcf4b('0x39')](_0x27d4fe[_0xcf4b('0x32')],_0x12c057[_0xcf4b('0x3a')]),_0x202813);if(_0x27d4fe[_0xcf4b('0x32')][_0xcf4b('0x3b')]){_0x10f080[_0xcf4b('0x3c')]=_[_0xcf4b('0x3d')](_0x10f080['where'],{'$or':_[_0xcf4b('0x2a')](_0x202813,function(_0x1e6e22){if(_0x1e6e22['type']!==_0xcf4b('0x3e')){var _0x10a896={};_0x10a896[_0x1e6e22[_0xcf4b('0x27')]]={'$like':'%'+_0x27d4fe[_0xcf4b('0x32')][_0xcf4b('0x3b')]+'%'};return _0x10a896;}})});}_0x10f080=_[_0xcf4b('0x3d')]({},_0x10f080,_0x27d4fe[_0xcf4b('0x3f')]);var _0x41f68a={'where':_0x10f080[_0xcf4b('0x3c')]};return db[_0xcf4b('0x2b')][_0xcf4b('0x1e')](_0x41f68a)[_0xcf4b('0x25')](function(_0x5d4aee){_0x2d9717['count']=_0x5d4aee;if(_0x27d4fe[_0xcf4b('0x32')][_0xcf4b('0x40')]){_0x10f080[_0xcf4b('0x41')]=[{'all':!![]}];}return db['Attachment'][_0xcf4b('0x42')](_0x10f080);})[_0xcf4b('0x25')](function(_0x5bdd54){_0x2d9717['rows']=_0x5bdd54;return _0x2d9717;})[_0xcf4b('0x25')](respondWithFilteredResult(_0x1bde96,_0x10f080))['catch'](handleError(_0x1bde96,null));};exports[_0xcf4b('0x43')]=function(_0x1296ae,_0x3b8b7d){var _0x2be92a={'raw':!![],'where':{'id':_0x1296ae[_0xcf4b('0x44')]['id']}},_0x4023e9={};_0x4023e9[_0xcf4b('0x2f')]=_['keys'](db[_0xcf4b('0x2b')][_0xcf4b('0x2c')]);_0x4023e9[_0xcf4b('0x32')]=_[_0xcf4b('0x30')](_0x1296ae[_0xcf4b('0x32')]);_0x4023e9[_0xcf4b('0x3a')]=_[_0xcf4b('0x31')](_0x4023e9[_0xcf4b('0x2f')],_0x4023e9[_0xcf4b('0x32')]);_0x2be92a[_0xcf4b('0x34')]=_[_0xcf4b('0x31')](_0x4023e9[_0xcf4b('0x2f')],qs[_0xcf4b('0x33')](_0x1296ae[_0xcf4b('0x32')][_0xcf4b('0x33')]));_0x2be92a['attributes']=_0x2be92a[_0xcf4b('0x34')][_0xcf4b('0x35')]?_0x2be92a[_0xcf4b('0x34')]:_0x4023e9[_0xcf4b('0x2f')];if(_0x1296ae[_0xcf4b('0x32')]['includeAll']){_0x2be92a[_0xcf4b('0x41')]=[{'all':!![]}];}_0x2be92a=_[_0xcf4b('0x3d')]({},_0x2be92a,_0x1296ae[_0xcf4b('0x3f')]);return db['Attachment'][_0xcf4b('0x45')](_0x2be92a)[_0xcf4b('0x25')](handleEntityNotFound(_0x3b8b7d,null))[_0xcf4b('0x25')](respondWithResult(_0x3b8b7d,null))[_0xcf4b('0x46')](handleError(_0x3b8b7d,null));};exports[_0xcf4b('0x47')]=function(_0x21196b,_0x32525b){var _0x1bd3da={'where':{'id':_0x21196b['params']['id']}},_0xe785d1={};_0xe785d1[_0xcf4b('0x2f')]=_[_0xcf4b('0x30')](db['Attachment'][_0xcf4b('0x2c')]);_0x1bd3da['attributes']=_[_0xcf4b('0x31')](_0xe785d1['model'],qs[_0xcf4b('0x33')](_0x21196b[_0xcf4b('0x32')][_0xcf4b('0x33')]));_0x1bd3da['attributes']=_0x1bd3da['attributes'][_0xcf4b('0x35')]?_0x1bd3da[_0xcf4b('0x34')]:_0xe785d1['model'];if(_0x21196b[_0xcf4b('0x32')][_0xcf4b('0x40')]){_0x1bd3da[_0xcf4b('0x41')]=[{'all':!![]}];}_0x1bd3da=_['merge']({},_0x1bd3da,_0x21196b['options']);return db[_0xcf4b('0x2b')]['find'](_0x1bd3da)[_0xcf4b('0x25')](handleEntityNotFound(_0x32525b,null))[_0xcf4b('0x25')](function(_0xd6a86){if(_0xd6a86){var _0x420918=_0xd6a86[_0xcf4b('0x48')]({'plain':!![]});_0x420918=qs[_0xcf4b('0x49')](_0x420918,['id',_0xcf4b('0x4a'),_0xcf4b('0x4b')]);_0x21196b[_0xcf4b('0x4c')]=_[_0xcf4b('0x49')](_0x21196b[_0xcf4b('0x4c')],['id',_0xcf4b('0x4a'),'updatedAt']);return db['Attachment'][_0xcf4b('0x4d')](_['merge'](_0x420918,_0x21196b['body']),{'include':_0x21196b[_0xcf4b('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xcf4b('0x25')](respondWithResult(_0x32525b,0xc9))[_0xcf4b('0x46')](handleError(_0x32525b,null));};exports[_0xcf4b('0x24')]=function(_0x2194bd,_0x167ae3){if(_0x2194bd[_0xcf4b('0x4c')]['id']){delete _0x2194bd[_0xcf4b('0x4c')]['id'];}return db[_0xcf4b('0x2b')][_0xcf4b('0x45')]({'where':{'id':_0x2194bd[_0xcf4b('0x44')]['id']}})['then'](handleEntityNotFound(_0x167ae3,null))[_0xcf4b('0x25')](saveUpdates(_0x2194bd[_0xcf4b('0x4c')],null))[_0xcf4b('0x25')](respondWithResult(_0x167ae3,null))[_0xcf4b('0x46')](handleError(_0x167ae3,null));};exports[_0xcf4b('0x4e')]=function(_0x16ec5d,_0x495322){return db[_0xcf4b('0x2b')][_0xcf4b('0x45')]({'where':{'id':_0x16ec5d[_0xcf4b('0x44')]['id']}})[_0xcf4b('0x25')](handleEntityNotFound(_0x495322,null))[_0xcf4b('0x25')](removeEntity(_0x495322,null))[_0xcf4b('0x46')](handleError(_0x495322,null));};exports[_0xcf4b('0x4d')]=function(_0x3d1c19,_0x24c67b,_0x2b3fdc){_0x3d1c19['body'][_0xcf4b('0x27')]=_0x3d1c19['file'][_0xcf4b('0x4f')];_0x3d1c19[_0xcf4b('0x4c')]['basename']=_0x3d1c19[_0xcf4b('0x50')]['filename'];_0x3d1c19[_0xcf4b('0x4c')][_0xcf4b('0x51')]=_0x3d1c19[_0xcf4b('0x50')][_0xcf4b('0x52')];return db[_0xcf4b('0x2b')][_0xcf4b('0x4d')](_0x3d1c19[_0xcf4b('0x4c')])['then'](respondWithResult(_0x24c67b,0xc9))[_0xcf4b('0x46')](handleError(_0x24c67b,null));};exports[_0xcf4b('0x53')]=function(_0x1db5fc,_0x2672b6,_0x3058a0){return db['Attachment'][_0xcf4b('0x54')]({'where':{'id':_0x1db5fc['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2672b6,null))[_0xcf4b('0x25')](function(_0xc2486a){if(_0xc2486a){return _0x2672b6[_0xcf4b('0x53')](path[_0xcf4b('0x55')](config[_0xcf4b('0x56')],_0xcf4b('0x57'),_0xc2486a['basename']));}})['catch'](handleError(_0x2672b6,null));};
\ No newline at end of file
index b40b186..6d8142e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['path','rimraf','../../config/environment','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4b821e,_0x1c2030){var _0x5ea1e6=function(_0x310979){while(--_0x310979){_0x4b821e['push'](_0x4b821e['shift']());}};_0x5ea1e6(++_0x1c2030);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0xf3cd[_0x18a436];return _0x5c2cf8;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./attachment.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbec5=['request-promise','path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','api','moment','bluebird'];(function(_0x8096,_0x475e11){var _0x172516=function(_0x56f2d5){while(--_0x56f2d5){_0x8096['push'](_0x8096['shift']());}};_0x172516(++_0x475e11);}(_0xbec5,0xe5));var _0x5bec=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0xbec5[_0x1d50f2];return _0x3769b8;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 70774c7..a6842e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7115=['then','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateAttachment','create','options','raw','debug','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request'];(function(_0x466f94,_0x15377d){var _0x188fb3=function(_0x24e14b){while(--_0x24e14b){_0x466f94['push'](_0x466f94['shift']());}};_0x188fb3(++_0x15377d);}(_0x7115,0x16e));var _0x5711=function(_0x1f7df8,_0x260902){_0x1f7df8=_0x1f7df8-0x0;var _0x51f986=_0x7115[_0x1f7df8];return _0x51f986;};'use strict';var _=require(_0x5711('0x0'));var util=require(_0x5711('0x1'));var moment=require('moment');var BPromise=require(_0x5711('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5711('0x3'))['db'];var utils=require(_0x5711('0x4'));var logger=require(_0x5711('0x5'))(_0x5711('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5711('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1419c7,_0x349fc2,_0x5dbe46){return new BPromise(function(_0x6305af,_0x59c602){return client[_0x5711('0x8')](_0x1419c7,_0x5dbe46)[_0x5711('0x9')](function(_0x113ed6){logger['info'](_0x5711('0xa'),_0x349fc2,_0x5711('0xb'));logger['debug'](_0x5711('0xc'),_0x349fc2,_0x5711('0xb'),JSON[_0x5711('0xd')](_0x113ed6));if(_0x113ed6[_0x5711('0xe')]){if(_0x113ed6[_0x5711('0xe')][_0x5711('0xf')]===0x1f4){logger[_0x5711('0xe')](_0x5711('0xa'),_0x349fc2,_0x113ed6[_0x5711('0xe')][_0x5711('0x10')]);return _0x59c602(_0x113ed6[_0x5711('0xe')][_0x5711('0x10')]);}logger[_0x5711('0xe')]('Attachment,\x20%s,\x20%s',_0x349fc2,_0x113ed6[_0x5711('0xe')]['message']);return _0x6305af(_0x113ed6[_0x5711('0xe')]['message']);}else{logger[_0x5711('0x11')](_0x5711('0xa'),_0x349fc2,'request\x20sent');_0x6305af(_0x113ed6[_0x5711('0x12')][_0x5711('0x10')]);}})['catch'](function(_0x250c1b){logger[_0x5711('0xe')](_0x5711('0xa'),_0x349fc2,_0x250c1b);_0x59c602(_0x250c1b);});});}exports[_0x5711('0x13')]=function(_0x1f6134){var _0x350773=this;return new Promise(function(_0x450e4f,_0x1f8181){return db['Attachment'][_0x5711('0x14')](_0x1f6134['body'],{'raw':_0x1f6134['options']?_0x1f6134[_0x5711('0x15')][_0x5711('0x16')]===undefined?!![]:![]:!![]})[_0x5711('0x9')](function(_0x5d35fa){logger[_0x5711('0x11')](_0x5711('0x13'),_0x1f6134);logger[_0x5711('0x17')](_0x5711('0x13'),_0x1f6134,JSON[_0x5711('0xd')](_0x5d35fa));_0x450e4f(_0x5d35fa);})[_0x5711('0x18')](function(_0x246856){logger['error'](_0x5711('0x13'),_0x246856[_0x5711('0x10')],_0x1f6134);_0x1f8181(_0x350773[_0x5711('0xe')](0x1f4,_0x246856[_0x5711('0x10')]));});});};
\ No newline at end of file
+var _0xaa7a=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateAttachment','body','raw'];(function(_0xa7b727,_0x2df940){var _0x3abf4d=function(_0x5992d3){while(--_0x5992d3){_0xa7b727['push'](_0xa7b727['shift']());}};_0x3abf4d(++_0x2df940);}(_0xaa7a,0x12d));var _0xaaa7=function(_0x3b3f4f,_0x403216){_0x3b3f4f=_0x3b3f4f-0x0;var _0x174dbe=_0xaa7a[_0x3b3f4f];return _0x174dbe;};'use strict';var _=require(_0xaaa7('0x0'));var util=require(_0xaaa7('0x1'));var moment=require('moment');var BPromise=require(_0xaaa7('0x2'));var rs=require(_0xaaa7('0x3'));var fs=require('fs');var Redis=require(_0xaaa7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaaa7('0x5'));var logger=require(_0xaaa7('0x6'))('rpc');var config=require(_0xaaa7('0x7'));var jayson=require(_0xaaa7('0x8'));var client=jayson[_0xaaa7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b229a,_0x38f27e,_0x453ca8){return new BPromise(function(_0xc230bd,_0x506d95){return client[_0xaaa7('0xa')](_0x4b229a,_0x453ca8)[_0xaaa7('0xb')](function(_0x271bf2){logger['info'](_0xaaa7('0xc'),_0x38f27e,_0xaaa7('0xd'));logger[_0xaaa7('0xe')](_0xaaa7('0xf'),_0x38f27e,_0xaaa7('0xd'),JSON[_0xaaa7('0x10')](_0x271bf2));if(_0x271bf2[_0xaaa7('0x11')]){if(_0x271bf2[_0xaaa7('0x11')][_0xaaa7('0x12')]===0x1f4){logger[_0xaaa7('0x11')](_0xaaa7('0xc'),_0x38f27e,_0x271bf2[_0xaaa7('0x11')][_0xaaa7('0x13')]);return _0x506d95(_0x271bf2['error']['message']);}logger['error'](_0xaaa7('0xc'),_0x38f27e,_0x271bf2[_0xaaa7('0x11')][_0xaaa7('0x13')]);return _0xc230bd(_0x271bf2[_0xaaa7('0x11')][_0xaaa7('0x13')]);}else{logger[_0xaaa7('0x14')]('Attachment,\x20%s,\x20%s',_0x38f27e,_0xaaa7('0xd'));_0xc230bd(_0x271bf2['result'][_0xaaa7('0x13')]);}})['catch'](function(_0x30bc79){logger[_0xaaa7('0x11')](_0xaaa7('0xc'),_0x38f27e,_0x30bc79);_0x506d95(_0x30bc79);});});}exports[_0xaaa7('0x15')]=function(_0x437d59){var _0x7e069f=this;return new Promise(function(_0xe9e6b1,_0x41cddc){return db['Attachment']['create'](_0x437d59[_0xaaa7('0x16')],{'raw':_0x437d59['options']?_0x437d59['options'][_0xaaa7('0x17')]===undefined?!![]:![]:!![]})[_0xaaa7('0xb')](function(_0x247083){logger['info']('CreateAttachment',_0x437d59);logger[_0xaaa7('0xe')](_0xaaa7('0x15'),_0x437d59,JSON[_0xaaa7('0x10')](_0x247083));_0xe9e6b1(_0x247083);})[_0xaaa7('0x18')](function(_0x3ea5e6){logger[_0xaaa7('0x11')](_0xaaa7('0x15'),_0x3ea5e6['message'],_0x437d59);_0x41cddc(_0x7e069f[_0xaaa7('0x11')](0x1f4,_0x3ea5e6['message']));});});};
\ No newline at end of file
index 3c20ba2..f9a57c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x639a=['get','index','/:id','isAuthenticated','show','/:id/download','download','post','/:id/clone','clone','diskStorage','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','create','put','update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./attachment.controller'];(function(_0x554651,_0x33b329){var _0x53fb5a=function(_0x1f8b0a){while(--_0x1f8b0a){_0x554651['push'](_0x554651['shift']());}};_0x53fb5a(++_0x33b329);}(_0x639a,0x1e8));var _0xa639=function(_0x39abd5,_0x170067){_0x39abd5=_0x39abd5-0x0;var _0x13cce2=_0x639a[_0x39abd5];return _0x13cce2;};'use strict';var multer=require(_0xa639('0x0'));var util=require(_0xa639('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa639('0x2'));var router=express[_0xa639('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa639('0x4'));var config=require(_0xa639('0x5'));var controller=require(_0xa639('0x6'));router[_0xa639('0x7')]('/',auth['isAuthenticated'](),controller[_0xa639('0x8')]);router['get'](_0xa639('0x9'),auth[_0xa639('0xa')](),controller[_0xa639('0xb')]);router[_0xa639('0x7')](_0xa639('0xc'),auth['isAuthenticated'](),controller[_0xa639('0xd')]);router[_0xa639('0xe')](_0xa639('0xf'),auth['isAuthenticated'](),controller[_0xa639('0x10')]);var upload=multer({'storage':multer[_0xa639('0x11')]({'destination':function(_0x5a96fb,_0x34a5b1,_0x45b789){_0x45b789(null,path['join'](config[_0xa639('0x12')],_0xa639('0x13')));},'filename':function(_0x51e76a,_0x450aa7,_0x1a666e){_0x1a666e(null,util[_0xa639('0x14')](_0xa639('0x15'),Date[_0xa639('0x16')](),_0x450aa7[_0xa639('0x17')][_0xa639('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0xa639('0x19')](_0xa639('0x1a')),controller[_0xa639('0x1b')]);router[_0xa639('0x1c')](_0xa639('0x9'),auth[_0xa639('0xa')](),controller[_0xa639('0x1d')]);router[_0xa639('0x1e')](_0xa639('0x9'),auth['isAuthenticated'](),controller[_0xa639('0x1f')]);module[_0xa639('0x20')]=router;
\ No newline at end of file
+var _0xdf5d=['single','file','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./attachment.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace'];(function(_0x2de020,_0x252df0){var _0x182b7c=function(_0xcbcdaa){while(--_0xcbcdaa){_0x2de020['push'](_0x2de020['shift']());}};_0x182b7c(++_0x252df0);}(_0xdf5d,0x126));var _0xddf5=function(_0x49954c,_0x54b943){_0x49954c=_0x49954c-0x0;var _0xe3e238=_0xdf5d[_0x49954c];return _0xe3e238;};'use strict';var multer=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var path=require(_0xddf5('0x2'));var timeout=require(_0xddf5('0x3'));var express=require(_0xddf5('0x4'));var router=express[_0xddf5('0x5')]();var auth=require(_0xddf5('0x6'));var interaction=require(_0xddf5('0x7'));var config=require('../../config/environment');var controller=require(_0xddf5('0x8'));router[_0xddf5('0x9')]('/',auth[_0xddf5('0xa')](),controller[_0xddf5('0xb')]);router[_0xddf5('0x9')](_0xddf5('0xc'),auth[_0xddf5('0xa')](),controller[_0xddf5('0xd')]);router[_0xddf5('0x9')](_0xddf5('0xe'),auth[_0xddf5('0xa')](),controller[_0xddf5('0xf')]);router[_0xddf5('0x10')](_0xddf5('0x11'),auth[_0xddf5('0xa')](),controller[_0xddf5('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x161973,_0x3d3fc3,_0x72f146){_0x72f146(null,path[_0xddf5('0x13')](config[_0xddf5('0x14')],_0xddf5('0x15')));},'filename':function(_0x434418,_0x3779e4,_0x5607a2){_0x5607a2(null,util['format'](_0xddf5('0x16'),Date[_0xddf5('0x17')](),_0x3779e4[_0xddf5('0x18')][_0xddf5('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xddf5('0x10')]('/',upload[_0xddf5('0x1a')](_0xddf5('0x1b')),controller[_0xddf5('0x1c')]);router['put'](_0xddf5('0xc'),auth[_0xddf5('0xa')](),controller[_0xddf5('0x1d')]);router[_0xddf5('0x1e')](_0xddf5('0xc'),auth['isAuthenticated'](),controller[_0xddf5('0x1f')]);module['exports']=router;
\ No newline at end of file
index 5f978a4..69984af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b6c=['user','agent','disabled','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../components/auth/service','login','authenticate','google','/login','profile','use','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','value','admin'];(function(_0x1eee9e,_0x176ffb){var _0x253622=function(_0xa2df16){while(--_0xa2df16){_0x1eee9e['push'](_0x1eee9e['shift']());}};_0x253622(++_0x176ffb);}(_0x4b6c,0x189));var _0xc4b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b6c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc4b6('0x0'));var passport=require(_0xc4b6('0x1'));var GoogleStrategy=require(_0xc4b6('0x2'))[_0xc4b6('0x3')];var moment=require(_0xc4b6('0x4'));var db=require(_0xc4b6('0x5'))['db'];var config=require('../../config/environment');var signToken=require(_0xc4b6('0x6'))['signToken'];var utils=require('../../config/utils');exports[_0xc4b6('0x7')]=passport[_0xc4b6('0x8')](_0xc4b6('0x9'),{'failureRedirect':_0xc4b6('0xa'),'scope':[_0xc4b6('0xb'),'email'],'session':![]});exports['callback']=passport[_0xc4b6('0x8')](_0xc4b6('0x9'),{'failureRedirect':'/login','session':![]});passport[_0xc4b6('0xc')](new GoogleStrategy({'clientID':config[_0xc4b6('0x9')]?config[_0xc4b6('0x9')]['clientID']:'id','clientSecret':config['google']?config[_0xc4b6('0x9')][_0xc4b6('0xd')]:'secret','callbackURL':config[_0xc4b6('0x9')]?config[_0xc4b6('0x9')][_0xc4b6('0xe')]:''},function(_0x4a1766,_0x20ad1b,_0x17ff1f,_0x35357a){var _0x2c9b3c,_0x3f8695;return db[_0xc4b6('0xf')][_0xc4b6('0x10')]({'where':{'id':0x1},'attributes':[_0xc4b6('0x11'),_0xc4b6('0x12')],'raw':!![]})[_0xc4b6('0x13')](function(_0x19e7e4){_0x2c9b3c=_0x19e7e4;return db[_0xc4b6('0x14')]['find']({'where':{'email':_['map'](_0x17ff1f['emails'],_0xc4b6('0x15')),'role':{'$or':[_0xc4b6('0x16'),_0xc4b6('0x17'),_0xc4b6('0x18')]}}});})['then'](function(_0x319c0c){_0x3f8695=_0x319c0c;if(_0x3f8695){if(_0x3f8695[_0xc4b6('0x19')]){return _0x35357a('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x2c9b3c['blockDuration']>0x0){if(_0x3f8695['blocked']){if(moment(_0x3f8695[_0xc4b6('0x1a')])[_0xc4b6('0x1b')](_0x2c9b3c['blockDuration'],_0xc4b6('0x1c'))>moment()){return _0x35357a(_0xc4b6('0x1d'));}else{return utils[_0xc4b6('0x1e')](_0x3f8695,0x0,![],null)[_0xc4b6('0x13')](function(){return utils[_0xc4b6('0x1f')](_0x3f8695);})['then'](function(){return _0x35357a(null,_0x3f8695);});}}else{return utils['getLicense'](_0x3f8695)[_0xc4b6('0x13')](function(){return _0x35357a(null,_0x3f8695);});}}else{return utils['getLicense'](_0x3f8695)[_0xc4b6('0x13')](function(){return _0x35357a(null,_0x3f8695);});}}return _0x35357a(_0xc4b6('0x1d'));})['catch'](function(_0xd7915f){_0x35357a(_0xd7915f);});}));
\ No newline at end of file
+var _0xfe9e=['profile','/login','use','clientSecret','Setting','findOne','allowedLoginAttempts','then','find','map','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','blockDuration','minutes','getLicense','catch','lodash','passport','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login','authenticate','google'];(function(_0x1db557,_0x445132){var _0x1a8321=function(_0x1f1a81){while(--_0x1f1a81){_0x1db557['push'](_0x1db557['shift']());}};_0x1a8321(++_0x445132);}(_0xfe9e,0xb0));var _0xefe9=function(_0x3b80d6,_0x18a56a){_0x3b80d6=_0x3b80d6-0x0;var _0x4e08f1=_0xfe9e[_0x3b80d6];return _0x4e08f1;};'use strict';var _=require(_0xefe9('0x0'));var passport=require(_0xefe9('0x1'));var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0xefe9('0x2'));var db=require(_0xefe9('0x3'))['db'];var config=require('../../config/environment');var signToken=require(_0xefe9('0x4'))[_0xefe9('0x5')];var utils=require(_0xefe9('0x6'));exports[_0xefe9('0x7')]=passport[_0xefe9('0x8')](_0xefe9('0x9'),{'failureRedirect':'/login','scope':[_0xefe9('0xa'),'email'],'session':![]});exports['callback']=passport[_0xefe9('0x8')](_0xefe9('0x9'),{'failureRedirect':_0xefe9('0xb'),'session':![]});passport[_0xefe9('0xc')](new GoogleStrategy({'clientID':config[_0xefe9('0x9')]?config[_0xefe9('0x9')]['clientID']:'id','clientSecret':config[_0xefe9('0x9')]?config[_0xefe9('0x9')][_0xefe9('0xd')]:'secret','callbackURL':config[_0xefe9('0x9')]?config[_0xefe9('0x9')]['callbackURL']:''},function(_0xac5d09,_0x904da7,_0x516cc7,_0xb4aba9){var _0x23841d,_0x4cd309;return db[_0xefe9('0xe')][_0xefe9('0xf')]({'where':{'id':0x1},'attributes':[_0xefe9('0x10'),'blockDuration'],'raw':!![]})[_0xefe9('0x11')](function(_0xe249a6){_0x23841d=_0xe249a6;return db['User'][_0xefe9('0x12')]({'where':{'email':_[_0xefe9('0x13')](_0x516cc7['emails'],_0xefe9('0x14')),'role':{'$or':[_0xefe9('0x15'),'user',_0xefe9('0x16')]}}});})[_0xefe9('0x11')](function(_0x244621){_0x4cd309=_0x244621;if(_0x4cd309){if(_0x4cd309[_0xefe9('0x17')]){return _0xb4aba9(_0xefe9('0x18'));}else if(_0x23841d['blockDuration']>0x0){if(_0x4cd309[_0xefe9('0x19')]){if(moment(_0x4cd309['blockedAt'])[_0xefe9('0x1a')](_0x23841d[_0xefe9('0x1b')],_0xefe9('0x1c'))>moment()){return _0xb4aba9(_0xefe9('0x18'));}else{return utils['clearBlockUser'](_0x4cd309,0x0,![],null)['then'](function(){return utils[_0xefe9('0x1d')](_0x4cd309);})['then'](function(){return _0xb4aba9(null,_0x4cd309);});}}else{return utils['getLicense'](_0x4cd309)[_0xefe9('0x11')](function(){return _0xb4aba9(null,_0x4cd309);});}}else{return utils[_0xefe9('0x1d')](_0x4cd309)[_0xefe9('0x11')](function(){return _0xb4aba9(null,_0x4cd309);});}}return _0xb4aba9(_0xefe9('0x18'));})[_0xefe9('0x1e')](function(_0x5433a1){_0xb4aba9(_0x5433a1);});}));
\ No newline at end of file
index 81e571c..f85c2f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b2b=['Router','../user/user.controller.js','../../components/auth/service','get','login','/callback','setTokenCookie','exports','express','passport'];(function(_0x37437c,_0x55dacf){var _0x35e1a1=function(_0xdcb380){while(--_0xdcb380){_0x37437c['push'](_0x37437c['shift']());}};_0x35e1a1(++_0x55dacf);}(_0x8b2b,0x1c0));var _0xb8b2=function(_0x26cce8,_0x51d16c){_0x26cce8=_0x26cce8-0x0;var _0x3bad2d=_0x8b2b[_0x26cce8];return _0x3bad2d;};'use strict';var express=require(_0xb8b2('0x0'));var passport=require(_0xb8b2('0x1'));var router=express[_0xb8b2('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xb8b2('0x3'));var authService=require(_0xb8b2('0x4'));router[_0xb8b2('0x5')]('/',controller[_0xb8b2('0x6')]);router[_0xb8b2('0x5')](_0xb8b2('0x7'),controller['callback'],authService['isMiddleware'],userController[_0xb8b2('0x6')],authService[_0xb8b2('0x8')]);module[_0xb8b2('0x9')]=router;
\ No newline at end of file
+var _0x39cb=['/callback','callback','isMiddleware','setTokenCookie','exports','passport','Router','../user/user.controller.js','../../components/auth/service','login','get'];(function(_0x2be3be,_0x2c03e1){var _0x619e24=function(_0x95d8fc){while(--_0x95d8fc){_0x2be3be['push'](_0x2be3be['shift']());}};_0x619e24(++_0x2c03e1);}(_0x39cb,0x1bd));var _0xb39c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x39cb[_0x167cc1];return _0x10bc4b;};'use strict';var express=require('express');var passport=require(_0xb39c('0x0'));var router=express[_0xb39c('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xb39c('0x2'));var authService=require(_0xb39c('0x3'));router['get']('/',controller[_0xb39c('0x4')]);router[_0xb39c('0x5')](_0xb39c('0x6'),controller[_0xb39c('0x7')],authService[_0xb39c('0x8')],userController['login'],authService[_0xb39c('0x9')]);module[_0xb39c('0xa')]=router;
\ No newline at end of file
index 3d265df..e12f83d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x065f=['http','allowedLoginAttempts','blockDuration','then','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','catch','getLicense','MailAccount','find','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','trim','toLowerCase','Setting','findOne','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','resetPasswordToken','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client'];(function(_0x3c2d87,_0x623ad){var _0x142d3c=function(_0x3fa5a5){while(--_0x3fa5a5){_0x3c2d87['push'](_0x3c2d87['shift']());}};_0x142d3c(++_0x623ad);}(_0x065f,0x146));var _0xf065=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x065f[_0x17d9e3];return _0x14192d;};'use strict';var util=require(_0xf065('0x0'));var passport=require(_0xf065('0x1'));var LocalStrategy=require(_0xf065('0x2'))[_0xf065('0x3')];var jayson=require(_0xf065('0x4'));var _=require('lodash');var rs=require(_0xf065('0x5'));var moment=require(_0xf065('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0xf065('0x7'));var utils=require(_0xf065('0x8'));var client=jayson[_0xf065('0x9')][_0xf065('0xa')]({'port':0x232b});function localAuthenticate(_0x38f17c,_0x3aaeab,_0x5b8d3a,_0x49443b){var _0x274e41,_0xf2817d;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xf065('0xb'),_0xf065('0xc')],'raw':!![]})[_0xf065('0xd')](function(_0x8902bd){_0x274e41=_0x8902bd;return _0x38f17c['findOne']({'attributes':['id','name',_0xf065('0xe'),_0xf065('0xf'),_0xf065('0x10'),_0xf065('0x11'),_0xf065('0x12'),_0xf065('0x13'),_0xf065('0x14')],'where':{'name':_0x3aaeab,'role':{'$or':[_0xf065('0x15'),_0xf065('0x16'),_0xf065('0x17')]}}});})[_0xf065('0xd')](function(_0x3af7a0){if(!_0x3af7a0||_0x3af7a0&&_0x3af7a0[_0xf065('0x18')]!==_0x3aaeab){throw new Error(_0xf065('0x19'));}else{_0xf2817d=_0x3af7a0;return _0xf2817d;}})[_0xf065('0xd')](function(){_0xf2817d['authenticate'](_0x5b8d3a,function(_0x7c6173,_0x1917f6){var _0x22eadf=_0xf2817d[_0xf065('0x14')]+0x1;if(_0x7c6173){return _0x49443b(_0x7c6173);}else if(!_0x1917f6){if(_0xf2817d['disabled']){return _0x49443b(null,![],{'message':_0xf065('0x19')});}else if(_0x274e41[_0xf065('0xb')]>0x0){if(_0xf2817d[_0xf065('0x12')]){if(_0x274e41[_0xf065('0xc')]>0x0){if(moment(_0xf2817d['blockedAt'])[_0xf065('0x1a')](_0x274e41[_0xf065('0xc')],_0xf065('0x1b'))>moment()){return _0x49443b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0xf2817d,_0x22eadf,![],null)[_0xf065('0xd')](function(){return _0x49443b(null,![],{'message':_0xf065('0x19')});});}}else{return _0x49443b(null,![],{'message':_0xf065('0x19')});}}else{if(_0x22eadf>=_0x274e41['allowedLoginAttempts']){return utils[_0xf065('0x1c')](_0xf2817d,0x0,!![],moment())[_0xf065('0xd')](function(){return _0x49443b(null,![],{'message':_0xf065('0x19')});});}else{return utils[_0xf065('0x1c')](_0xf2817d,_0x22eadf,![],null)['then'](function(){return _0x49443b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x49443b(null,![],{'message':_0xf065('0x19')});}}else{if(_0xf2817d[_0xf065('0x11')]){return _0x49443b(null,![],{'message':_0xf065('0x19')});}else if(_0x274e41[_0xf065('0xb')]>0x0){if(_0xf2817d['blocked']){if(_0x274e41['blockDuration']>0x0){if(moment(_0xf2817d['blockedAt'])[_0xf065('0x1a')](_0x274e41['blockDuration'],_0xf065('0x1b'))>moment()){return _0x49443b(null,![],{'message':_0xf065('0x19')});}else{return utils[_0xf065('0x1c')](_0xf2817d,0x0,![],null)['then'](function(){return utils['getLicense'](_0xf2817d);})[_0xf065('0xd')](function(){return _0x49443b(null,_0xf2817d);});}}else{return _0x49443b(null,![],{'message':_0xf065('0x19')});}}else{return utils['clearBlockUser'](_0xf2817d,0x0,![],null)[_0xf065('0xd')](function(){return utils['getLicense'](_0xf2817d);})[_0xf065('0xd')](function(){return _0x49443b(null,_0xf2817d);})[_0xf065('0x1d')](function(_0x318dc8){return _0x49443b(null,![],_0x318dc8);});}}else{if(_0xf2817d[_0xf065('0x12')]){return _0x49443b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf065('0x1e')](_0xf2817d)[_0xf065('0xd')](function(){return _0x49443b(null,_0xf2817d);});}}}});})[_0xf065('0x1d')](function(_0x1d27a0){return _0x49443b(null,![],_0x1d27a0);});}function sendServiceMail(_0x52905f){return db[_0xf065('0x1f')][_0xf065('0x20')]({'where':{'service':!![]},'attributes':['id',_0xf065('0x18'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xf065('0x21')}]})[_0xf065('0xd')](function(_0x485136){if(!_0x485136){throw new Error(_0xf065('0x22'));}var _0x5690bb={'tls':{'rejectUnauthorized':![]}};if(_0x485136[_0xf065('0x21')]['service']){_0x5690bb[_0xf065('0x23')]=_0x485136[_0xf065('0x21')]['service'];}else{_0x5690bb['host']=_0x485136['Smtp'][_0xf065('0x24')];_0x5690bb[_0xf065('0x25')]=_0x485136['Smtp'][_0xf065('0x25')];_0x5690bb[_0xf065('0x26')]=_0x485136['Smtp'][_0xf065('0x26')];}if(_0x485136['Smtp'][_0xf065('0x27')]){_0x5690bb[_0xf065('0x28')]={'user':_0x485136[_0xf065('0x21')][_0xf065('0x16')],'pass':_0x485136[_0xf065('0x21')][_0xf065('0x29')]};}var _0x2c06ad={'account':_0x5690bb,'message':_['merge']({'from':util[_0xf065('0x2a')](_0xf065('0x2b'),_0x485136[_0xf065('0x18')],_0x485136[_0xf065('0x2c')]||_0x485136[_0xf065('0x21')][_0xf065('0x16')])},_0x52905f)};return client[_0xf065('0x2d')](_0xf065('0x2e'),_0x2c06ad);})[_0xf065('0xd')](function(_0x106ea1){if(_0x106ea1[_0xf065('0x2f')]){throw new Error(util[_0xf065('0x2a')](_0xf065('0x30'),_0x106ea1['error'][_0xf065('0x31')]||JSON[_0xf065('0x32')](_0x106ea1[_0xf065('0x2f')])));}return!![];});}function handleError(_0x3b8a7a,_0x2d8957,_0x481514){return _0x3b8a7a['status'](_0x2d8957||0x1f4)[_0xf065('0x33')]({'message':_0x481514?_0x481514[_0xf065('0x31')]||_0x481514:''});}function checkPasswordPattern(_0x3a7860,_0x49d97d,_0x128c2e){if(_0x128c2e){var _0x49a2be=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x49a2be[_0xf065('0x34')](_0x49d97d)){return _0x3a7860;}else{throw new Error(_0xf065('0x35'));}}else{return _0x3a7860;}}exports[_0xf065('0x36')]=function(_0x38adfd,_0x1bcdeb,_0x329dac){passport['authenticate'](_0xf065('0x37'),function(_0x39bbed,_0x39bf49,_0x22a83d){var _0x5ebf93=_0x39bbed||_0x22a83d;if(_0x5ebf93){return handleError(_0x1bcdeb,0x191,_0x5ebf93);}if(!_0x39bf49){return handleError(_0x1bcdeb,0x194,{'message':_0xf065('0x38')});}else{var _0x34ed35={'payload':{'id':_0x39bf49['id'],'role':_0x39bf49[_0xf065('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xf065('0x39')](_0x34ed35)[_0xf065('0xd')](function(_0x2d171b){_0x1bcdeb[_0xf065('0x3a')]({'id':_0x39bf49['id'],'token':_0x2d171b,'statusCall':'','isAlreadyLogged':_0x39bf49[_0xf065('0x3b')]});});}})(_0x38adfd,_0x1bcdeb,_0x329dac);};exports[_0xf065('0x3c')]=function(_0x185757,_0x3bf678,_0x173443){if(!_0x185757[_0xf065('0x3d')][_0xf065('0x2c')]){return handleError(_0x3bf678,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x12a0cc=rs[_0xf065('0x3e')]();_0x185757['body'][_0xf065('0x2c')]=_0x185757['body'][_0xf065('0x2c')][_0xf065('0x3f')]()[_0xf065('0x40')]();var _0xbcc508;return db[_0xf065('0x41')][_0xf065('0x42')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xf065('0xd')](function(_0x6d38b){_0xbcc508=_0x6d38b;return db[_0xf065('0x43')][_0xf065('0x20')]({'where':{'email':_0x185757[_0xf065('0x3d')][_0xf065('0x2c')]}});})[_0xf065('0xd')](function(_0x8a2f28){if(!_0x8a2f28){throw new Error(_0xf065('0x44'));}if(_0x8a2f28['disabled']){throw new Error(_0xf065('0x45'));}if(_0x8a2f28[_0xf065('0x12')]){if(moment(_0x8a2f28[_0xf065('0x13')])['add'](_0xbcc508[_0xf065('0xc')],_0xf065('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x8a2f28[_0xf065('0x12')]=![];_0x8a2f28['blockedAt']=null;}}_0x8a2f28['resetPasswordToken']=_0x12a0cc;_0x8a2f28[_0xf065('0x46')]=Date[_0xf065('0x47')]()+0x36ee80;return _0x8a2f28[_0xf065('0x48')]();})[_0xf065('0xd')](function(){return sendServiceMail({'to':_0x185757['body'][_0xf065('0x2c')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xf065('0x49')+_0xf065('0x4a')+'http://'+_0x185757['headers'][_0xf065('0x24')]+_0xf065('0x4b')+_0x12a0cc+'\x0a\x0a'+_0xf065('0x4c')});})[_0xf065('0xd')](function(){_0x3bf678[_0xf065('0x4d')](0xc8)['send']({'message':_0xf065('0x4e')});})[_0xf065('0x1d')](function(_0x45539c){return handleError(_0x3bf678,0x1f4,_0x45539c);});};exports['reset']=function(_0x527c94,_0x28c9b1,_0x39ef14){var _0x230186;return db[_0xf065('0x43')][_0xf065('0x20')]({'where':{'resetPasswordToken':_0x527c94['params'][_0xf065('0x4f')],'resetPasswordExpires':{'$gt':Date[_0xf065('0x47')]()}}})[_0xf065('0xd')](function(_0x5d77b1){_0x230186=_0x5d77b1;if(!_0x230186){throw new Error(_0xf065('0x50'));}return db[_0xf065('0x41')]['findOne']({'attributes':['id',_0xf065('0x51')]});})['then'](function(_0x356586){return checkPasswordPattern(_0x356586,_0x527c94[_0xf065('0x3d')][_0xf065('0xe')],_0x356586[_0xf065('0x51')]);})[_0xf065('0xd')](function(){_0x230186[_0xf065('0xe')]=_0x527c94[_0xf065('0x3d')][_0xf065('0xe')];_0x230186[_0xf065('0x52')]=null;_0x230186['resetPasswordExpires']=null;return _0x230186[_0xf065('0x48')]();})[_0xf065('0xd')](function(){_0x28c9b1[_0xf065('0x4d')](0xc8)['send']({'message':'Password\x20reset!'});})[_0xf065('0x1d')](function(_0x2ff1b0){return handleError(_0x28c9b1,0x1f4,_0x2ff1b0);});};passport[_0xf065('0x53')](new LocalStrategy({'usernameField':_0xf065('0x18'),'passwordField':_0xf065('0xe')},function(_0x59a1b1,_0x795fcf,_0x244a95){return localAuthenticate(db[_0xf065('0x43')],_0x59a1b1,_0x795fcf,_0x244a95);}));
\ No newline at end of file
+var _0x1f75=['user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','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','http://','headers','host','/reset/','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','securePassword','resetPasswordToken','status','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','blockDuration','then','findOne','name','role','disabled','blocked','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','allowedLoginAttempts','catch','getLicense','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','port','secure','authentication','merge','format','\x22%s\x22\x20<%s>'];(function(_0x42a80a,_0x55bbe4){var _0x2429f4=function(_0x43bf0f){while(--_0x43bf0f){_0x42a80a['push'](_0x42a80a['shift']());}};_0x2429f4(++_0x55bbe4);}(_0x1f75,0x12c));var _0x51f7=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x1f75[_0x5608a3];return _0x1ed50a;};'use strict';var util=require(_0x51f7('0x0'));var passport=require(_0x51f7('0x1'));var LocalStrategy=require(_0x51f7('0x2'))['Strategy'];var jayson=require(_0x51f7('0x3'));var _=require(_0x51f7('0x4'));var rs=require(_0x51f7('0x5'));var moment=require(_0x51f7('0x6'));var db=require(_0x51f7('0x7'))['db'];var authService=require(_0x51f7('0x8'));var utils=require(_0x51f7('0x9'));var client=jayson[_0x51f7('0xa')][_0x51f7('0xb')]({'port':0x232b});function localAuthenticate(_0x22fc29,_0x3eb36d,_0x471057,_0x5a1f98){var _0x2d944f,_0x7a9c0c;return db[_0x51f7('0xc')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x51f7('0xd')],'raw':!![]})[_0x51f7('0xe')](function(_0x579ee9){_0x2d944f=_0x579ee9;return _0x22fc29[_0x51f7('0xf')]({'attributes':['id',_0x51f7('0x10'),'password','salt',_0x51f7('0x11'),_0x51f7('0x12'),_0x51f7('0x13'),'blockedAt',_0x51f7('0x14')],'where':{'name':_0x3eb36d,'role':{'$or':[_0x51f7('0x15'),'user',_0x51f7('0x16')]}}});})[_0x51f7('0xe')](function(_0x28e8fe){if(!_0x28e8fe||_0x28e8fe&&_0x28e8fe['name']!==_0x3eb36d){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x7a9c0c=_0x28e8fe;return _0x7a9c0c;}})[_0x51f7('0xe')](function(){_0x7a9c0c['authenticate'](_0x471057,function(_0x5b8dba,_0x4e2f85){var _0x199d2e=_0x7a9c0c[_0x51f7('0x14')]+0x1;if(_0x5b8dba){return _0x5a1f98(_0x5b8dba);}else if(!_0x4e2f85){if(_0x7a9c0c[_0x51f7('0x12')]){return _0x5a1f98(null,![],{'message':_0x51f7('0x17')});}else if(_0x2d944f['allowedLoginAttempts']>0x0){if(_0x7a9c0c[_0x51f7('0x13')]){if(_0x2d944f[_0x51f7('0xd')]>0x0){if(moment(_0x7a9c0c[_0x51f7('0x18')])[_0x51f7('0x19')](_0x2d944f[_0x51f7('0xd')],_0x51f7('0x1a'))>moment()){return _0x5a1f98(null,![],{'message':_0x51f7('0x17')});}else{return utils[_0x51f7('0x1b')](_0x7a9c0c,_0x199d2e,![],null)[_0x51f7('0xe')](function(){return _0x5a1f98(null,![],{'message':_0x51f7('0x17')});});}}else{return _0x5a1f98(null,![],{'message':_0x51f7('0x17')});}}else{if(_0x199d2e>=_0x2d944f['allowedLoginAttempts']){return utils['clearBlockUser'](_0x7a9c0c,0x0,!![],moment())[_0x51f7('0xe')](function(){return _0x5a1f98(null,![],{'message':_0x51f7('0x17')});});}else{return utils['clearBlockUser'](_0x7a9c0c,_0x199d2e,![],null)[_0x51f7('0xe')](function(){return _0x5a1f98(null,![],{'message':_0x51f7('0x17')});});}}}else{return _0x5a1f98(null,![],{'message':_0x51f7('0x17')});}}else{if(_0x7a9c0c['disabled']){return _0x5a1f98(null,![],{'message':_0x51f7('0x17')});}else if(_0x2d944f[_0x51f7('0x1c')]>0x0){if(_0x7a9c0c[_0x51f7('0x13')]){if(_0x2d944f['blockDuration']>0x0){if(moment(_0x7a9c0c[_0x51f7('0x18')])[_0x51f7('0x19')](_0x2d944f[_0x51f7('0xd')],'minutes')>moment()){return _0x5a1f98(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x51f7('0x1b')](_0x7a9c0c,0x0,![],null)[_0x51f7('0xe')](function(){return utils['getLicense'](_0x7a9c0c);})[_0x51f7('0xe')](function(){return _0x5a1f98(null,_0x7a9c0c);});}}else{return _0x5a1f98(null,![],{'message':_0x51f7('0x17')});}}else{return utils['clearBlockUser'](_0x7a9c0c,0x0,![],null)['then'](function(){return utils['getLicense'](_0x7a9c0c);})[_0x51f7('0xe')](function(){return _0x5a1f98(null,_0x7a9c0c);})[_0x51f7('0x1d')](function(_0x49970c){return _0x5a1f98(null,![],_0x49970c);});}}else{if(_0x7a9c0c[_0x51f7('0x13')]){return _0x5a1f98(null,![],{'message':_0x51f7('0x17')});}else{return utils[_0x51f7('0x1e')](_0x7a9c0c)[_0x51f7('0xe')](function(){return _0x5a1f98(null,_0x7a9c0c);});}}}});})[_0x51f7('0x1d')](function(_0x5ea14){return _0x5a1f98(null,![],_0x5ea14);});}function sendServiceMail(_0x2dc321){return db[_0x51f7('0x1f')][_0x51f7('0x20')]({'where':{'service':!![]},'attributes':['id',_0x51f7('0x10'),_0x51f7('0x21')],'include':[{'model':db[_0x51f7('0x22')],'as':_0x51f7('0x23')}]})[_0x51f7('0xe')](function(_0x81134){if(!_0x81134){throw new Error(_0x51f7('0x24'));}var _0x2ea8e6={'tls':{'rejectUnauthorized':![]}};if(_0x81134['Smtp'][_0x51f7('0x25')]){_0x2ea8e6['service']=_0x81134[_0x51f7('0x23')][_0x51f7('0x25')];}else{_0x2ea8e6['host']=_0x81134[_0x51f7('0x23')]['host'];_0x2ea8e6['port']=_0x81134[_0x51f7('0x23')][_0x51f7('0x26')];_0x2ea8e6[_0x51f7('0x27')]=_0x81134[_0x51f7('0x23')][_0x51f7('0x27')];}if(_0x81134[_0x51f7('0x23')][_0x51f7('0x28')]){_0x2ea8e6['auth']={'user':_0x81134[_0x51f7('0x23')]['user'],'pass':_0x81134['Smtp']['pass']};}var _0x213e6a={'account':_0x2ea8e6,'message':_[_0x51f7('0x29')]({'from':util[_0x51f7('0x2a')](_0x51f7('0x2b'),_0x81134[_0x51f7('0x10')],_0x81134[_0x51f7('0x21')]||_0x81134[_0x51f7('0x23')][_0x51f7('0x2c')])},_0x2dc321)};return client[_0x51f7('0x2d')]('SendMail',_0x213e6a);})[_0x51f7('0xe')](function(_0x5b2aab){if(_0x5b2aab[_0x51f7('0x2e')]){throw new Error(util[_0x51f7('0x2a')](_0x51f7('0x2f'),_0x5b2aab['error'][_0x51f7('0x30')]||JSON[_0x51f7('0x31')](_0x5b2aab[_0x51f7('0x2e')])));}return!![];});}function handleError(_0x3be22e,_0x233d4f,_0x187987){return _0x3be22e['status'](_0x233d4f||0x1f4)['send']({'message':_0x187987?_0x187987[_0x51f7('0x30')]||_0x187987:''});}function checkPasswordPattern(_0x572d17,_0x29092c,_0x446d79){if(_0x446d79){var _0xfd685c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xfd685c[_0x51f7('0x32')](_0x29092c)){return _0x572d17;}else{throw new Error(_0x51f7('0x33'));}}else{return _0x572d17;}}exports[_0x51f7('0x34')]=function(_0x5e5c0f,_0x520425,_0xfbbbc4){passport[_0x51f7('0x35')](_0x51f7('0x36'),function(_0x4ae533,_0x46aa25,_0x185398){var _0x16bfb3=_0x4ae533||_0x185398;if(_0x16bfb3){return handleError(_0x520425,0x191,_0x16bfb3);}if(!_0x46aa25){return handleError(_0x520425,0x194,{'message':_0x51f7('0x37')});}else{var _0x2f642b={'payload':{'id':_0x46aa25['id'],'role':_0x46aa25[_0x51f7('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x51f7('0x38')](_0x2f642b)[_0x51f7('0xe')](function(_0x3e79cc){_0x520425[_0x51f7('0x39')]({'id':_0x46aa25['id'],'token':_0x3e79cc,'statusCall':'','isAlreadyLogged':_0x46aa25[_0x51f7('0x3a')]});});}})(_0x5e5c0f,_0x520425,_0xfbbbc4);};exports[_0x51f7('0x3b')]=function(_0x4cdcba,_0x813276,_0x38fdc1){if(!_0x4cdcba['body'][_0x51f7('0x21')]){return handleError(_0x813276,0x1f4,{'message':_0x51f7('0x3c')});}var _0x2f5c38=rs['generate']();_0x4cdcba[_0x51f7('0x3d')][_0x51f7('0x21')]=_0x4cdcba['body'][_0x51f7('0x21')][_0x51f7('0x3e')]()[_0x51f7('0x3f')]();var _0x5b1ae9;return db['Setting'][_0x51f7('0xf')]({'where':{'id':0x1},'attributes':[_0x51f7('0x1c'),_0x51f7('0xd')],'raw':!![]})[_0x51f7('0xe')](function(_0x25e4e7){_0x5b1ae9=_0x25e4e7;return db[_0x51f7('0x40')][_0x51f7('0x20')]({'where':{'email':_0x4cdcba[_0x51f7('0x3d')][_0x51f7('0x21')]}});})[_0x51f7('0xe')](function(_0x3d1a82){if(!_0x3d1a82){throw new Error(_0x51f7('0x41'));}if(_0x3d1a82['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x3d1a82[_0x51f7('0x13')]){if(moment(_0x3d1a82[_0x51f7('0x18')])[_0x51f7('0x19')](_0x5b1ae9[_0x51f7('0xd')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x3d1a82['blocked']=![];_0x3d1a82['blockedAt']=null;}}_0x3d1a82['resetPasswordToken']=_0x2f5c38;_0x3d1a82[_0x51f7('0x42')]=Date[_0x51f7('0x43')]()+0x36ee80;return _0x3d1a82[_0x51f7('0x44')]();})[_0x51f7('0xe')](function(){return sendServiceMail({'to':_0x4cdcba[_0x51f7('0x3d')][_0x51f7('0x21')],'subject':_0x51f7('0x45'),'text':_0x51f7('0x46')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x51f7('0x47')+_0x4cdcba[_0x51f7('0x48')][_0x51f7('0x49')]+_0x51f7('0x4a')+_0x2f5c38+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x51f7('0xe')](function(){_0x813276['status'](0xc8)[_0x51f7('0x4b')]({'message':_0x51f7('0x4c')});})[_0x51f7('0x1d')](function(_0x4d5255){return handleError(_0x813276,0x1f4,_0x4d5255);});};exports[_0x51f7('0x4d')]=function(_0x1103ba,_0x317988,_0x32783f){var _0x1b00dd;return db[_0x51f7('0x40')]['find']({'where':{'resetPasswordToken':_0x1103ba[_0x51f7('0x4e')][_0x51f7('0x4f')],'resetPasswordExpires':{'$gt':Date[_0x51f7('0x43')]()}}})[_0x51f7('0xe')](function(_0xf05f9){_0x1b00dd=_0xf05f9;if(!_0x1b00dd){throw new Error(_0x51f7('0x50'));}return db[_0x51f7('0xc')]['findOne']({'attributes':['id','securePassword']});})[_0x51f7('0xe')](function(_0x2eb955){return checkPasswordPattern(_0x2eb955,_0x1103ba[_0x51f7('0x3d')][_0x51f7('0x51')],_0x2eb955[_0x51f7('0x52')]);})['then'](function(){_0x1b00dd[_0x51f7('0x51')]=_0x1103ba[_0x51f7('0x3d')]['password'];_0x1b00dd[_0x51f7('0x53')]=null;_0x1b00dd[_0x51f7('0x42')]=null;return _0x1b00dd[_0x51f7('0x44')]();})[_0x51f7('0xe')](function(){_0x317988[_0x51f7('0x54')](0xc8)[_0x51f7('0x4b')]({'message':'Password\x20reset!'});})[_0x51f7('0x1d')](function(_0x473068){return handleError(_0x317988,0x1f4,_0x473068);});};passport[_0x51f7('0x55')](new LocalStrategy({'usernameField':_0x51f7('0x10'),'passwordField':_0x51f7('0x51')},function(_0x533280,_0x34f2da,_0x2054d6){return localAuthenticate(db[_0x51f7('0x40')],_0x533280,_0x34f2da,_0x2054d6);}));
\ No newline at end of file
index 4db3c87..8786b5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04c0=['login','/forgot','forgot','/reset/:token','express','Router','./authLocal.controller','post'];(function(_0x27d11f,_0x2c59a8){var _0x36c1a5=function(_0x2334ae){while(--_0x2334ae){_0x27d11f['push'](_0x27d11f['shift']());}};_0x36c1a5(++_0x2c59a8);}(_0x04c0,0xbc));var _0x004c=function(_0x4fe41a,_0x42f5b3){_0x4fe41a=_0x4fe41a-0x0;var _0x39c5ec=_0x04c0[_0x4fe41a];return _0x39c5ec;};'use strict';var express=require(_0x004c('0x0'));var router=express[_0x004c('0x1')]();var controller=require(_0x004c('0x2'));router[_0x004c('0x3')]('/',controller[_0x004c('0x4')]);router['post'](_0x004c('0x5'),controller[_0x004c('0x6')]);router[_0x004c('0x3')](_0x004c('0x7'),controller['reset']);module['exports']=router;
\ No newline at end of file
+var _0xd04b=['login','/forgot','forgot','/reset/:token','exports','./authLocal.controller','post'];(function(_0x5c13e8,_0x4ce31d){var _0x58a53f=function(_0x2d15ee){while(--_0x2d15ee){_0x5c13e8['push'](_0x5c13e8['shift']());}};_0x58a53f(++_0x4ce31d);}(_0xd04b,0x98));var _0xbd04=function(_0x521e10,_0x87e394){_0x521e10=_0x521e10-0x0;var _0x22dd28=_0xd04b[_0x521e10];return _0x22dd28;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xbd04('0x0'));router[_0xbd04('0x1')]('/',controller[_0xbd04('0x2')]);router[_0xbd04('0x1')](_0xbd04('0x3'),controller[_0xbd04('0x4')]);router[_0xbd04('0x1')](_0xbd04('0x5'),controller['reset']);module[_0xbd04('0x6')]=router;
\ No newline at end of file
index efc4ec3..bcc14ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x506a=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x337da2,_0x39a5be){var _0xf6806c=function(_0x2f49fb){while(--_0x2f49fb){_0x337da2['push'](_0x337da2['shift']());}};_0xf6806c(++_0x39a5be);}(_0x506a,0x12c));var _0xa506=function(_0x2f0f2b,_0x3e2763){_0x2f0f2b=_0x2f0f2b-0x0;var _0x14cfb8=_0x506a[_0x2f0f2b];return _0x14cfb8;};'use strict';var Sequelize=require(_0xa506('0x0'));module[_0xa506('0x1')]={'name':{'type':Sequelize[_0xa506('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xa506('0x2')]},'description':{'type':Sequelize[_0xa506('0x2')]},'status':{'type':Sequelize[_0xa506('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xa506('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x0436=['STRING','INTEGER','sequelize','exports'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x0436,0x1d6));var _0x6043=function(_0x5359dc,_0x1d1d33){_0x5359dc=_0x5359dc-0x0;var _0x26cd87=_0x0436[_0x5359dc];return _0x26cd87;};'use strict';var Sequelize=require(_0x6043('0x0'));module[_0x6043('0x1')]={'name':{'type':Sequelize[_0x6043('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x6043('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6043('0x3')],'defaultValue':0xa}};
\ No newline at end of file
index 2e85e96..39f9ec3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd10=['json','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','addConditions','findOne','Condition','nolimit','addActions','ids','omit','getActions','Action','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x1a3ceb,_0x5e59cf){var _0x2c7290=function(_0x181d41){while(--_0x181d41){_0x1a3ceb['push'](_0x1a3ceb['shift']());}};_0x2c7290(++_0x5e59cf);}(_0xcd10,0x12f));var _0x0cd1=function(_0x55572e,_0x51f52d){_0x55572e=_0x55572e-0x0;var _0x50357c=_0xcd10[_0x55572e];return _0x50357c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0cd1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0cd1('0x1'));var rp=require(_0x0cd1('0x2'));var moment=require(_0x0cd1('0x3'));var BPromise=require(_0x0cd1('0x4'));var Mustache=require(_0x0cd1('0x5'));var util=require('util');var path=require(_0x0cd1('0x6'));var sox=require('sox');var csv=require(_0x0cd1('0x7'));var ejs=require(_0x0cd1('0x8'));var fs=require('fs');var _=require(_0x0cd1('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0cd1('0xa'));var deskjs=require(_0x0cd1('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0cd1('0xc'));var Papa=require(_0x0cd1('0xd'));var Redis=require(_0x0cd1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0cd1('0xf'));var as=require(_0x0cd1('0x10'));var hardwareService=require(_0x0cd1('0x11'));var logger=require('../../config/logger')(_0x0cd1('0x12'));var utils=require(_0x0cd1('0x13'));var config=require(_0x0cd1('0x14'));var db=require(_0x0cd1('0x15'))['db'];function respondWithStatusCode(_0x2900a9,_0x2223c6){_0x2223c6=_0x2223c6||0xcc;return function(_0x3abcd1){if(_0x3abcd1){return _0x2900a9[_0x0cd1('0x16')](_0x2223c6);}return _0x2900a9[_0x0cd1('0x17')](_0x2223c6)[_0x0cd1('0x18')]();};}function respondWithResult(_0x9a07e7,_0x42b4d1){_0x42b4d1=_0x42b4d1||0xc8;return function(_0x1f065){if(_0x1f065){return _0x9a07e7[_0x0cd1('0x17')](_0x42b4d1)[_0x0cd1('0x19')](_0x1f065);}};}function respondWithFilteredResult(_0x2b237f,_0x5443b6){return function(_0x35c786){if(_0x35c786){var _0x11e439=_0x35c786[_0x0cd1('0x1a')],_0x5af6cf=_0x5443b6[_0x0cd1('0x1b')],_0x3b2a81=_0x5443b6[_0x0cd1('0x1b')]+_0x5443b6['limit'],_0x24a2f5;if(_0x3b2a81>=_0x11e439){_0x3b2a81=_0x11e439;_0x24a2f5=0xc8;}else{_0x24a2f5=0xce;}_0x2b237f[_0x0cd1('0x17')](_0x24a2f5);return _0x2b237f[_0x0cd1('0x1c')](_0x0cd1('0x1d'),_0x5af6cf+'-'+_0x3b2a81+'/'+_0x11e439)[_0x0cd1('0x19')](_0x35c786);}return null;};}function patchUpdates(_0x347fcd){return function(_0x5f57fd){try{jsonpatch['apply'](_0x5f57fd,_0x347fcd,!![]);}catch(_0x1e1c76){return BPromise[_0x0cd1('0x1e')](_0x1e1c76);}return _0x5f57fd[_0x0cd1('0x1f')]();};}function saveUpdates(_0x36e1f8,_0x5ac3c7){return function(_0x1e98fc){if(_0x1e98fc){return _0x1e98fc['update'](_0x36e1f8)[_0x0cd1('0x20')](function(_0x3b2f8c){return _0x3b2f8c;});}return null;};}function removeEntity(_0xf4684c,_0x424435){return function(_0x296c84){if(_0x296c84){return _0x296c84[_0x0cd1('0x21')]()[_0x0cd1('0x20')](function(){_0xf4684c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40fac2,_0x7ebe03){return function(_0x1fe86b){if(!_0x1fe86b){_0x40fac2['sendStatus'](0x194);}return _0x1fe86b;};}function handleError(_0x250dcf,_0x269825){_0x269825=_0x269825||0x1f4;return function(_0x356868){logger[_0x0cd1('0x22')](_0x356868[_0x0cd1('0x23')]);if(_0x356868[_0x0cd1('0x24')]){delete _0x356868[_0x0cd1('0x24')];}_0x250dcf[_0x0cd1('0x17')](_0x269825)[_0x0cd1('0x25')](_0x356868);};}exports[_0x0cd1('0x26')]=function(_0x46e3a3,_0x310b42){var _0xa6dbe5={},_0x3db9f8={},_0x2d0984={'count':0x0,'rows':[]};var _0x4db79d=_[_0x0cd1('0x27')](db[_0x0cd1('0x28')][_0x0cd1('0x29')],function(_0x599705){return{'name':_0x599705['fieldName'],'type':_0x599705[_0x0cd1('0x2a')][_0x0cd1('0x2b')]};});_0x3db9f8[_0x0cd1('0x2c')]=_[_0x0cd1('0x27')](_0x4db79d,_0x0cd1('0x24'));_0x3db9f8[_0x0cd1('0x2d')]=_['keys'](_0x46e3a3[_0x0cd1('0x2d')]);_0x3db9f8['filters']=_['intersection'](_0x3db9f8[_0x0cd1('0x2c')],_0x3db9f8[_0x0cd1('0x2d')]);_0xa6dbe5[_0x0cd1('0x2e')]=_[_0x0cd1('0x2f')](_0x3db9f8[_0x0cd1('0x2c')],qs[_0x0cd1('0x30')](_0x46e3a3['query'][_0x0cd1('0x30')]));_0xa6dbe5[_0x0cd1('0x2e')]=_0xa6dbe5[_0x0cd1('0x2e')][_0x0cd1('0x31')]?_0xa6dbe5[_0x0cd1('0x2e')]:_0x3db9f8[_0x0cd1('0x2c')];if(!_0x46e3a3['query'][_0x0cd1('0x32')]('nolimit')){_0xa6dbe5[_0x0cd1('0x33')]=qs[_0x0cd1('0x33')](_0x46e3a3['query']['limit']);_0xa6dbe5[_0x0cd1('0x1b')]=qs[_0x0cd1('0x1b')](_0x46e3a3[_0x0cd1('0x2d')][_0x0cd1('0x1b')]);}_0xa6dbe5[_0x0cd1('0x34')]=qs['sort'](_0x46e3a3[_0x0cd1('0x2d')][_0x0cd1('0x35')]);_0xa6dbe5['where']=qs[_0x0cd1('0x36')](_[_0x0cd1('0x37')](_0x46e3a3[_0x0cd1('0x2d')],_0x3db9f8[_0x0cd1('0x36')]),_0x4db79d);if(_0x46e3a3[_0x0cd1('0x2d')][_0x0cd1('0x38')]){_0xa6dbe5[_0x0cd1('0x39')]=_[_0x0cd1('0x3a')](_0xa6dbe5[_0x0cd1('0x39')],{'$or':_[_0x0cd1('0x27')](_0x4db79d,function(_0x2df369){if(_0x2df369[_0x0cd1('0x2a')]!==_0x0cd1('0x3b')){var _0x423918={};_0x423918[_0x2df369[_0x0cd1('0x24')]]={'$like':'%'+_0x46e3a3[_0x0cd1('0x2d')][_0x0cd1('0x38')]+'%'};return _0x423918;}})});}_0xa6dbe5=_[_0x0cd1('0x3a')]({},_0xa6dbe5,_0x46e3a3[_0x0cd1('0x3c')]);var _0x4f6dd2={'where':_0xa6dbe5[_0x0cd1('0x39')]};return db[_0x0cd1('0x28')][_0x0cd1('0x1a')](_0x4f6dd2)['then'](function(_0x33a07c){_0x2d0984[_0x0cd1('0x1a')]=_0x33a07c;if(_0x46e3a3[_0x0cd1('0x2d')][_0x0cd1('0x3d')]){_0xa6dbe5[_0x0cd1('0x3e')]=[{'all':!![]}];}return db['Automation'][_0x0cd1('0x3f')](_0xa6dbe5);})[_0x0cd1('0x20')](function(_0x87250a){_0x2d0984[_0x0cd1('0x40')]=_0x87250a;return _0x2d0984;})['then'](respondWithFilteredResult(_0x310b42,_0xa6dbe5))[_0x0cd1('0x41')](handleError(_0x310b42,null));};exports[_0x0cd1('0x42')]=function(_0x4991f7,_0x4851d1){var _0xd73954={'raw':![],'where':{'id':_0x4991f7[_0x0cd1('0x43')]['id']}},_0x11ba3a={};_0x11ba3a[_0x0cd1('0x2c')]=_[_0x0cd1('0x44')](db['Automation'][_0x0cd1('0x29')]);_0x11ba3a[_0x0cd1('0x2d')]=_[_0x0cd1('0x44')](_0x4991f7[_0x0cd1('0x2d')]);_0x11ba3a[_0x0cd1('0x36')]=_[_0x0cd1('0x2f')](_0x11ba3a[_0x0cd1('0x2c')],_0x11ba3a[_0x0cd1('0x2d')]);_0xd73954[_0x0cd1('0x2e')]=_[_0x0cd1('0x2f')](_0x11ba3a['model'],qs['fields'](_0x4991f7[_0x0cd1('0x2d')]['fields']));_0xd73954[_0x0cd1('0x2e')]=_0xd73954[_0x0cd1('0x2e')][_0x0cd1('0x31')]?_0xd73954[_0x0cd1('0x2e')]:_0x11ba3a[_0x0cd1('0x2c')];if(_0x4991f7[_0x0cd1('0x2d')]['includeAll']){_0xd73954[_0x0cd1('0x3e')]=[{'all':!![]}];}_0xd73954=_['merge']({},_0xd73954,_0x4991f7['options']);return db[_0x0cd1('0x28')][_0x0cd1('0x45')](_0xd73954)['then'](handleEntityNotFound(_0x4851d1,null))[_0x0cd1('0x20')](respondWithResult(_0x4851d1,null))[_0x0cd1('0x41')](handleError(_0x4851d1,null));};exports[_0x0cd1('0x46')]=function(_0x3a1eb6,_0x5cccd3){return db['Automation'][_0x0cd1('0x46')](_0x3a1eb6[_0x0cd1('0x47')],{})[_0x0cd1('0x20')](respondWithResult(_0x5cccd3,0xc9))['catch'](handleError(_0x5cccd3,null));};exports[_0x0cd1('0x48')]=function(_0x19c10f,_0x4854db){if(_0x19c10f[_0x0cd1('0x47')]['id']){delete _0x19c10f[_0x0cd1('0x47')]['id'];}return db[_0x0cd1('0x28')][_0x0cd1('0x45')]({'where':{'id':_0x19c10f[_0x0cd1('0x43')]['id']}})[_0x0cd1('0x20')](handleEntityNotFound(_0x4854db,null))[_0x0cd1('0x20')](saveUpdates(_0x19c10f[_0x0cd1('0x47')],null))[_0x0cd1('0x20')](respondWithResult(_0x4854db,null))['catch'](handleError(_0x4854db,null));};exports[_0x0cd1('0x21')]=function(_0x41df2d,_0x183266){return db[_0x0cd1('0x28')]['find']({'where':{'id':_0x41df2d[_0x0cd1('0x43')]['id']}})[_0x0cd1('0x20')](handleEntityNotFound(_0x183266,null))[_0x0cd1('0x20')](removeEntity(_0x183266,null))[_0x0cd1('0x41')](handleError(_0x183266,null));};exports[_0x0cd1('0x49')]=function(_0xc73966,_0x297cbe,_0x208bc9){return db['Condition']['find']({'where':{'id':_0xc73966[_0x0cd1('0x43')]['id']}})[_0x0cd1('0x20')](handleEntityNotFound(_0x297cbe,null))[_0x0cd1('0x20')](function(_0x51fd96){if(_0x51fd96){return _0x51fd96[_0x0cd1('0x49')](_0xc73966['body']['ids'],_['omit'](_0xc73966[_0x0cd1('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0x297cbe,null))['catch'](handleError(_0x297cbe,null));};exports['getConditions']=function(_0x26d642,_0x58018d,_0x34f83e){var _0x8f89b1={};var _0x14b322={};var _0x4eab17;var _0x17cbdd;return db[_0x0cd1('0x28')][_0x0cd1('0x4a')]({'where':{'id':_0x26d642[_0x0cd1('0x43')]['id']}})[_0x0cd1('0x20')](handleEntityNotFound(_0x58018d,null))[_0x0cd1('0x20')](function(_0x2d3781){if(_0x2d3781){_0x4eab17=_0x2d3781;_0x14b322[_0x0cd1('0x2c')]=_[_0x0cd1('0x44')](db[_0x0cd1('0x4b')][_0x0cd1('0x29')]);_0x14b322[_0x0cd1('0x2d')]=_[_0x0cd1('0x44')](_0x26d642['query']);_0x14b322[_0x0cd1('0x36')]=_[_0x0cd1('0x2f')](_0x14b322['model'],_0x14b322['query']);_0x8f89b1[_0x0cd1('0x2e')]=_[_0x0cd1('0x2f')](_0x14b322[_0x0cd1('0x2c')],qs[_0x0cd1('0x30')](_0x26d642['query']['fields']));_0x8f89b1['attributes']=_0x8f89b1[_0x0cd1('0x2e')][_0x0cd1('0x31')]?_0x8f89b1[_0x0cd1('0x2e')]:_0x14b322[_0x0cd1('0x2c')];_0x8f89b1[_0x0cd1('0x34')]=qs[_0x0cd1('0x35')](_0x26d642[_0x0cd1('0x2d')]['sort']);_0x8f89b1['where']=qs[_0x0cd1('0x36')](_[_0x0cd1('0x37')](_0x26d642[_0x0cd1('0x2d')],_0x14b322[_0x0cd1('0x36')]));if(_0x26d642[_0x0cd1('0x2d')][_0x0cd1('0x38')]){_0x8f89b1[_0x0cd1('0x39')]=_[_0x0cd1('0x3a')](_0x8f89b1[_0x0cd1('0x39')],{'$or':_[_0x0cd1('0x27')](_0x8f89b1[_0x0cd1('0x2e')],function(_0x3c6040){var _0x12bb5e={};_0x12bb5e[_0x3c6040]={'$like':'%'+_0x26d642['query'][_0x0cd1('0x38')]+'%'};return _0x12bb5e;})});}_0x8f89b1=_[_0x0cd1('0x3a')]({},_0x8f89b1,_0x26d642[_0x0cd1('0x3c')]);return _0x4eab17['getConditions'](_0x8f89b1);}})['then'](function(_0x229a05){if(_0x229a05){_0x17cbdd=_0x229a05['length'];if(!_0x26d642[_0x0cd1('0x2d')][_0x0cd1('0x32')](_0x0cd1('0x4c'))){_0x8f89b1['limit']=qs[_0x0cd1('0x33')](_0x26d642[_0x0cd1('0x2d')][_0x0cd1('0x33')]);_0x8f89b1['offset']=qs[_0x0cd1('0x1b')](_0x26d642[_0x0cd1('0x2d')]['offset']);}return _0x4eab17['getConditions'](_0x8f89b1);}})['then'](function(_0x1c2f3e){if(_0x1c2f3e){return _0x1c2f3e?{'count':_0x17cbdd,'rows':_0x1c2f3e}:null;}})['then'](respondWithResult(_0x58018d,null))['catch'](handleError(_0x58018d,null));};exports[_0x0cd1('0x4d')]=function(_0x23ae70,_0x1e3d95,_0x34c037){return db['Action']['find']({'where':{'id':_0x23ae70['params']['id']}})[_0x0cd1('0x20')](handleEntityNotFound(_0x1e3d95,null))['then'](function(_0x2f6d73){if(_0x2f6d73){return _0x2f6d73['addActions'](_0x23ae70[_0x0cd1('0x47')][_0x0cd1('0x4e')],_[_0x0cd1('0x4f')](_0x23ae70[_0x0cd1('0x47')],[_0x0cd1('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x1e3d95,null))['catch'](handleError(_0x1e3d95,null));};exports[_0x0cd1('0x50')]=function(_0x3a4ed6,_0x4f6280,_0x47ac59){var _0x564e6a={};var _0x1326d8={};var _0x33f2ac;var _0x3eaf91;return db[_0x0cd1('0x28')][_0x0cd1('0x4a')]({'where':{'id':_0x3a4ed6['params']['id']}})[_0x0cd1('0x20')](handleEntityNotFound(_0x4f6280,null))[_0x0cd1('0x20')](function(_0xbc3605){if(_0xbc3605){_0x33f2ac=_0xbc3605;_0x1326d8['model']=_[_0x0cd1('0x44')](db[_0x0cd1('0x51')][_0x0cd1('0x29')]);_0x1326d8['query']=_[_0x0cd1('0x44')](_0x3a4ed6[_0x0cd1('0x2d')]);_0x1326d8[_0x0cd1('0x36')]=_[_0x0cd1('0x2f')](_0x1326d8[_0x0cd1('0x2c')],_0x1326d8['query']);_0x564e6a[_0x0cd1('0x2e')]=_[_0x0cd1('0x2f')](_0x1326d8['model'],qs[_0x0cd1('0x30')](_0x3a4ed6[_0x0cd1('0x2d')][_0x0cd1('0x30')]));_0x564e6a['attributes']=_0x564e6a[_0x0cd1('0x2e')][_0x0cd1('0x31')]?_0x564e6a['attributes']:_0x1326d8[_0x0cd1('0x2c')];_0x564e6a[_0x0cd1('0x34')]=qs['sort'](_0x3a4ed6[_0x0cd1('0x2d')][_0x0cd1('0x35')]);_0x564e6a['where']=qs[_0x0cd1('0x36')](_['pick'](_0x3a4ed6[_0x0cd1('0x2d')],_0x1326d8['filters']));if(_0x3a4ed6[_0x0cd1('0x2d')]['filter']){_0x564e6a[_0x0cd1('0x39')]=_[_0x0cd1('0x3a')](_0x564e6a[_0x0cd1('0x39')],{'$or':_[_0x0cd1('0x27')](_0x564e6a[_0x0cd1('0x2e')],function(_0x40f1df){var _0x3ff3c2={};_0x3ff3c2[_0x40f1df]={'$like':'%'+_0x3a4ed6[_0x0cd1('0x2d')][_0x0cd1('0x38')]+'%'};return _0x3ff3c2;})});}_0x564e6a=_[_0x0cd1('0x3a')]({},_0x564e6a,_0x3a4ed6['options']);return _0x33f2ac['getActions'](_0x564e6a);}})[_0x0cd1('0x20')](function(_0x3b32e2){if(_0x3b32e2){_0x3eaf91=_0x3b32e2[_0x0cd1('0x31')];if(!_0x3a4ed6[_0x0cd1('0x2d')][_0x0cd1('0x32')](_0x0cd1('0x4c'))){_0x564e6a[_0x0cd1('0x33')]=qs[_0x0cd1('0x33')](_0x3a4ed6[_0x0cd1('0x2d')][_0x0cd1('0x33')]);_0x564e6a['offset']=qs[_0x0cd1('0x1b')](_0x3a4ed6[_0x0cd1('0x2d')][_0x0cd1('0x1b')]);}return _0x33f2ac[_0x0cd1('0x50')](_0x564e6a);}})[_0x0cd1('0x20')](function(_0xaac541){if(_0xaac541){return _0xaac541?{'count':_0x3eaf91,'rows':_0xaac541}:null;}})[_0x0cd1('0x20')](respondWithResult(_0x4f6280,null))[_0x0cd1('0x41')](handleError(_0x4f6280,null));};
\ No newline at end of file
+var _0x0aa0=['ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','status','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','end','sendStatus','error','name','index','map','Automation','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','VIRTUAL','options','where','includeAll','include','catch','show','find','create','body','params','addConditions','Condition','omit','getConditions','findOne','pick','addActions','Action','ids','getActions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv'];(function(_0x4e9a9a,_0x1a5c94){var _0x58bf51=function(_0x16bcb9){while(--_0x16bcb9){_0x4e9a9a['push'](_0x4e9a9a['shift']());}};_0x58bf51(++_0x1a5c94);}(_0x0aa0,0x94));var _0x00aa=function(_0x58a34b,_0x208e23){_0x58a34b=_0x58a34b-0x0;var _0xac80cf=_0x0aa0[_0x58a34b];return _0xac80cf;};'use strict';var pdf=require(_0x00aa('0x0'));var emlformat=require(_0x00aa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x00aa('0x2'));var jsonpatch=require(_0x00aa('0x3'));var rp=require(_0x00aa('0x4'));var moment=require(_0x00aa('0x5'));var BPromise=require(_0x00aa('0x6'));var Mustache=require('mustache');var util=require(_0x00aa('0x7'));var path=require('path');var sox=require(_0x00aa('0x8'));var csv=require(_0x00aa('0x9'));var ejs=require(_0x00aa('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x00aa('0xb'));var jsforce=require(_0x00aa('0xc'));var deskjs=require(_0x00aa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x00aa('0xe'));var Papa=require(_0x00aa('0xf'));var Redis=require(_0x00aa('0x10'));var authService=require(_0x00aa('0x11'));var qs=require(_0x00aa('0x12'));var as=require(_0x00aa('0x13'));var hardwareService=require(_0x00aa('0x14'));var logger=require(_0x00aa('0x15'))('api');var utils=require(_0x00aa('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42a1b8,_0x51d2f9){_0x51d2f9=_0x51d2f9||0xcc;return function(_0x3d25ad){if(_0x3d25ad){return _0x42a1b8['sendStatus'](_0x51d2f9);}return _0x42a1b8['status'](_0x51d2f9)['end']();};}function respondWithResult(_0x4e83ad,_0x5a632c){_0x5a632c=_0x5a632c||0xc8;return function(_0x5a0d5b){if(_0x5a0d5b){return _0x4e83ad[_0x00aa('0x17')](_0x5a632c)['json'](_0x5a0d5b);}};}function respondWithFilteredResult(_0x22689c,_0x204e70){return function(_0x316634){if(_0x316634){var _0x1cccd4=_0x316634[_0x00aa('0x18')],_0x15639e=_0x204e70['offset'],_0x5cfd4d=_0x204e70[_0x00aa('0x19')]+_0x204e70[_0x00aa('0x1a')],_0x5b7c22;if(_0x5cfd4d>=_0x1cccd4){_0x5cfd4d=_0x1cccd4;_0x5b7c22=0xc8;}else{_0x5b7c22=0xce;}_0x22689c['status'](_0x5b7c22);return _0x22689c[_0x00aa('0x1b')](_0x00aa('0x1c'),_0x15639e+'-'+_0x5cfd4d+'/'+_0x1cccd4)['json'](_0x316634);}return null;};}function patchUpdates(_0x5cfb33){return function(_0x49b575){try{jsonpatch[_0x00aa('0x1d')](_0x49b575,_0x5cfb33,!![]);}catch(_0x1da687){return BPromise['reject'](_0x1da687);}return _0x49b575[_0x00aa('0x1e')]();};}function saveUpdates(_0x1aefe1,_0x5d6179){return function(_0x3fda77){if(_0x3fda77){return _0x3fda77[_0x00aa('0x1f')](_0x1aefe1)['then'](function(_0x1f0e03){return _0x1f0e03;});}return null;};}function removeEntity(_0x47ebc4,_0x3291be){return function(_0x1945c3){if(_0x1945c3){return _0x1945c3[_0x00aa('0x20')]()[_0x00aa('0x21')](function(){_0x47ebc4['status'](0xcc)[_0x00aa('0x22')]();});}};}function handleEntityNotFound(_0x3999fa,_0x3dccfd){return function(_0x4da095){if(!_0x4da095){_0x3999fa[_0x00aa('0x23')](0x194);}return _0x4da095;};}function handleError(_0x44031e,_0x2614bf){_0x2614bf=_0x2614bf||0x1f4;return function(_0x4fbe66){logger[_0x00aa('0x24')](_0x4fbe66['stack']);if(_0x4fbe66[_0x00aa('0x25')]){delete _0x4fbe66['name'];}_0x44031e[_0x00aa('0x17')](_0x2614bf)['send'](_0x4fbe66);};}exports[_0x00aa('0x26')]=function(_0x34f0cf,_0x20e13e){var _0xfb2c44={},_0x56c95a={},_0x4c90c5={'count':0x0,'rows':[]};var _0x2139e5=_[_0x00aa('0x27')](db[_0x00aa('0x28')][_0x00aa('0x29')],function(_0x291bc7){return{'name':_0x291bc7['fieldName'],'type':_0x291bc7[_0x00aa('0x2a')][_0x00aa('0x2b')]};});_0x56c95a[_0x00aa('0x2c')]=_[_0x00aa('0x27')](_0x2139e5,'name');_0x56c95a[_0x00aa('0x2d')]=_[_0x00aa('0x2e')](_0x34f0cf[_0x00aa('0x2d')]);_0x56c95a['filters']=_[_0x00aa('0x2f')](_0x56c95a[_0x00aa('0x2c')],_0x56c95a[_0x00aa('0x2d')]);_0xfb2c44[_0x00aa('0x30')]=_[_0x00aa('0x2f')](_0x56c95a['model'],qs['fields'](_0x34f0cf[_0x00aa('0x2d')][_0x00aa('0x31')]));_0xfb2c44[_0x00aa('0x30')]=_0xfb2c44[_0x00aa('0x30')][_0x00aa('0x32')]?_0xfb2c44['attributes']:_0x56c95a[_0x00aa('0x2c')];if(!_0x34f0cf[_0x00aa('0x2d')][_0x00aa('0x33')](_0x00aa('0x34'))){_0xfb2c44[_0x00aa('0x1a')]=qs[_0x00aa('0x1a')](_0x34f0cf[_0x00aa('0x2d')][_0x00aa('0x1a')]);_0xfb2c44[_0x00aa('0x19')]=qs[_0x00aa('0x19')](_0x34f0cf['query']['offset']);}_0xfb2c44[_0x00aa('0x35')]=qs[_0x00aa('0x36')](_0x34f0cf['query'][_0x00aa('0x36')]);_0xfb2c44['where']=qs[_0x00aa('0x37')](_['pick'](_0x34f0cf[_0x00aa('0x2d')],_0x56c95a[_0x00aa('0x37')]),_0x2139e5);if(_0x34f0cf[_0x00aa('0x2d')][_0x00aa('0x38')]){_0xfb2c44['where']=_[_0x00aa('0x39')](_0xfb2c44['where'],{'$or':_[_0x00aa('0x27')](_0x2139e5,function(_0x55c76f){if(_0x55c76f[_0x00aa('0x2a')]!==_0x00aa('0x3a')){var _0x175516={};_0x175516[_0x55c76f[_0x00aa('0x25')]]={'$like':'%'+_0x34f0cf[_0x00aa('0x2d')][_0x00aa('0x38')]+'%'};return _0x175516;}})});}_0xfb2c44=_['merge']({},_0xfb2c44,_0x34f0cf[_0x00aa('0x3b')]);var _0x356973={'where':_0xfb2c44[_0x00aa('0x3c')]};return db[_0x00aa('0x28')][_0x00aa('0x18')](_0x356973)[_0x00aa('0x21')](function(_0xf06ff9){_0x4c90c5[_0x00aa('0x18')]=_0xf06ff9;if(_0x34f0cf[_0x00aa('0x2d')][_0x00aa('0x3d')]){_0xfb2c44[_0x00aa('0x3e')]=[{'all':!![]}];}return db[_0x00aa('0x28')]['findAll'](_0xfb2c44);})['then'](function(_0x49ee69){_0x4c90c5['rows']=_0x49ee69;return _0x4c90c5;})[_0x00aa('0x21')](respondWithFilteredResult(_0x20e13e,_0xfb2c44))[_0x00aa('0x3f')](handleError(_0x20e13e,null));};exports[_0x00aa('0x40')]=function(_0x4e7890,_0x2b6ea9){var _0x73072={'raw':![],'where':{'id':_0x4e7890['params']['id']}},_0x1a0670={};_0x1a0670[_0x00aa('0x2c')]=_['keys'](db[_0x00aa('0x28')][_0x00aa('0x29')]);_0x1a0670['query']=_['keys'](_0x4e7890[_0x00aa('0x2d')]);_0x1a0670[_0x00aa('0x37')]=_[_0x00aa('0x2f')](_0x1a0670[_0x00aa('0x2c')],_0x1a0670[_0x00aa('0x2d')]);_0x73072[_0x00aa('0x30')]=_[_0x00aa('0x2f')](_0x1a0670[_0x00aa('0x2c')],qs[_0x00aa('0x31')](_0x4e7890[_0x00aa('0x2d')]['fields']));_0x73072[_0x00aa('0x30')]=_0x73072[_0x00aa('0x30')][_0x00aa('0x32')]?_0x73072[_0x00aa('0x30')]:_0x1a0670[_0x00aa('0x2c')];if(_0x4e7890[_0x00aa('0x2d')][_0x00aa('0x3d')]){_0x73072[_0x00aa('0x3e')]=[{'all':!![]}];}_0x73072=_[_0x00aa('0x39')]({},_0x73072,_0x4e7890['options']);return db['Automation'][_0x00aa('0x41')](_0x73072)[_0x00aa('0x21')](handleEntityNotFound(_0x2b6ea9,null))[_0x00aa('0x21')](respondWithResult(_0x2b6ea9,null))[_0x00aa('0x3f')](handleError(_0x2b6ea9,null));};exports[_0x00aa('0x42')]=function(_0x1fc0e1,_0x63b2bd){return db[_0x00aa('0x28')][_0x00aa('0x42')](_0x1fc0e1[_0x00aa('0x43')],{})['then'](respondWithResult(_0x63b2bd,0xc9))['catch'](handleError(_0x63b2bd,null));};exports[_0x00aa('0x1f')]=function(_0x5d83ad,_0x2c494d){if(_0x5d83ad[_0x00aa('0x43')]['id']){delete _0x5d83ad['body']['id'];}return db[_0x00aa('0x28')][_0x00aa('0x41')]({'where':{'id':_0x5d83ad['params']['id']}})[_0x00aa('0x21')](handleEntityNotFound(_0x2c494d,null))['then'](saveUpdates(_0x5d83ad['body'],null))['then'](respondWithResult(_0x2c494d,null))['catch'](handleError(_0x2c494d,null));};exports['destroy']=function(_0x1e4b6e,_0xb1104){return db[_0x00aa('0x28')][_0x00aa('0x41')]({'where':{'id':_0x1e4b6e[_0x00aa('0x44')]['id']}})['then'](handleEntityNotFound(_0xb1104,null))[_0x00aa('0x21')](removeEntity(_0xb1104,null))[_0x00aa('0x3f')](handleError(_0xb1104,null));};exports[_0x00aa('0x45')]=function(_0x45dbbe,_0x3aad53,_0xc6c97){return db[_0x00aa('0x46')][_0x00aa('0x41')]({'where':{'id':_0x45dbbe[_0x00aa('0x44')]['id']}})[_0x00aa('0x21')](handleEntityNotFound(_0x3aad53,null))[_0x00aa('0x21')](function(_0x2584f9){if(_0x2584f9){return _0x2584f9[_0x00aa('0x45')](_0x45dbbe[_0x00aa('0x43')]['ids'],_[_0x00aa('0x47')](_0x45dbbe['body'],['ids','id'])||{});}})[_0x00aa('0x21')](respondWithResult(_0x3aad53,null))[_0x00aa('0x3f')](handleError(_0x3aad53,null));};exports[_0x00aa('0x48')]=function(_0x40f1f9,_0x5810b2,_0x1c7171){var _0x59b594={};var _0x20e175={};var _0x27c694;var _0x23b067;return db['Automation'][_0x00aa('0x49')]({'where':{'id':_0x40f1f9[_0x00aa('0x44')]['id']}})['then'](handleEntityNotFound(_0x5810b2,null))[_0x00aa('0x21')](function(_0x16f83c){if(_0x16f83c){_0x27c694=_0x16f83c;_0x20e175[_0x00aa('0x2c')]=_[_0x00aa('0x2e')](db[_0x00aa('0x46')][_0x00aa('0x29')]);_0x20e175[_0x00aa('0x2d')]=_['keys'](_0x40f1f9[_0x00aa('0x2d')]);_0x20e175[_0x00aa('0x37')]=_[_0x00aa('0x2f')](_0x20e175['model'],_0x20e175[_0x00aa('0x2d')]);_0x59b594['attributes']=_[_0x00aa('0x2f')](_0x20e175[_0x00aa('0x2c')],qs[_0x00aa('0x31')](_0x40f1f9[_0x00aa('0x2d')]['fields']));_0x59b594['attributes']=_0x59b594[_0x00aa('0x30')]['length']?_0x59b594[_0x00aa('0x30')]:_0x20e175[_0x00aa('0x2c')];_0x59b594[_0x00aa('0x35')]=qs[_0x00aa('0x36')](_0x40f1f9[_0x00aa('0x2d')][_0x00aa('0x36')]);_0x59b594[_0x00aa('0x3c')]=qs['filters'](_[_0x00aa('0x4a')](_0x40f1f9[_0x00aa('0x2d')],_0x20e175[_0x00aa('0x37')]));if(_0x40f1f9[_0x00aa('0x2d')][_0x00aa('0x38')]){_0x59b594['where']=_['merge'](_0x59b594[_0x00aa('0x3c')],{'$or':_['map'](_0x59b594[_0x00aa('0x30')],function(_0x2cdd76){var _0x3638ee={};_0x3638ee[_0x2cdd76]={'$like':'%'+_0x40f1f9[_0x00aa('0x2d')]['filter']+'%'};return _0x3638ee;})});}_0x59b594=_['merge']({},_0x59b594,_0x40f1f9[_0x00aa('0x3b')]);return _0x27c694['getConditions'](_0x59b594);}})[_0x00aa('0x21')](function(_0x2d1be2){if(_0x2d1be2){_0x23b067=_0x2d1be2[_0x00aa('0x32')];if(!_0x40f1f9[_0x00aa('0x2d')][_0x00aa('0x33')](_0x00aa('0x34'))){_0x59b594[_0x00aa('0x1a')]=qs['limit'](_0x40f1f9[_0x00aa('0x2d')]['limit']);_0x59b594[_0x00aa('0x19')]=qs['offset'](_0x40f1f9['query'][_0x00aa('0x19')]);}return _0x27c694[_0x00aa('0x48')](_0x59b594);}})[_0x00aa('0x21')](function(_0x316d11){if(_0x316d11){return _0x316d11?{'count':_0x23b067,'rows':_0x316d11}:null;}})['then'](respondWithResult(_0x5810b2,null))[_0x00aa('0x3f')](handleError(_0x5810b2,null));};exports[_0x00aa('0x4b')]=function(_0x13d81f,_0xe7b64c,_0x433325){return db[_0x00aa('0x4c')][_0x00aa('0x41')]({'where':{'id':_0x13d81f['params']['id']}})[_0x00aa('0x21')](handleEntityNotFound(_0xe7b64c,null))['then'](function(_0x29c45c){if(_0x29c45c){return _0x29c45c[_0x00aa('0x4b')](_0x13d81f[_0x00aa('0x43')]['ids'],_[_0x00aa('0x47')](_0x13d81f[_0x00aa('0x43')],[_0x00aa('0x4d'),'id'])||{});}})['then'](respondWithResult(_0xe7b64c,null))['catch'](handleError(_0xe7b64c,null));};exports['getActions']=function(_0x1ad6eb,_0x1e26ff,_0x355283){var _0x2e8e50={};var _0x215741={};var _0x537b8e;var _0x40de5a;return db[_0x00aa('0x28')][_0x00aa('0x49')]({'where':{'id':_0x1ad6eb[_0x00aa('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e26ff,null))['then'](function(_0x30bc1e){if(_0x30bc1e){_0x537b8e=_0x30bc1e;_0x215741['model']=_[_0x00aa('0x2e')](db[_0x00aa('0x4c')][_0x00aa('0x29')]);_0x215741[_0x00aa('0x2d')]=_[_0x00aa('0x2e')](_0x1ad6eb[_0x00aa('0x2d')]);_0x215741[_0x00aa('0x37')]=_[_0x00aa('0x2f')](_0x215741[_0x00aa('0x2c')],_0x215741[_0x00aa('0x2d')]);_0x2e8e50[_0x00aa('0x30')]=_[_0x00aa('0x2f')](_0x215741[_0x00aa('0x2c')],qs[_0x00aa('0x31')](_0x1ad6eb[_0x00aa('0x2d')][_0x00aa('0x31')]));_0x2e8e50[_0x00aa('0x30')]=_0x2e8e50['attributes']['length']?_0x2e8e50[_0x00aa('0x30')]:_0x215741[_0x00aa('0x2c')];_0x2e8e50[_0x00aa('0x35')]=qs[_0x00aa('0x36')](_0x1ad6eb[_0x00aa('0x2d')][_0x00aa('0x36')]);_0x2e8e50[_0x00aa('0x3c')]=qs[_0x00aa('0x37')](_['pick'](_0x1ad6eb[_0x00aa('0x2d')],_0x215741[_0x00aa('0x37')]));if(_0x1ad6eb['query'][_0x00aa('0x38')]){_0x2e8e50['where']=_[_0x00aa('0x39')](_0x2e8e50['where'],{'$or':_[_0x00aa('0x27')](_0x2e8e50['attributes'],function(_0x58209d){var _0x320551={};_0x320551[_0x58209d]={'$like':'%'+_0x1ad6eb[_0x00aa('0x2d')]['filter']+'%'};return _0x320551;})});}_0x2e8e50=_[_0x00aa('0x39')]({},_0x2e8e50,_0x1ad6eb[_0x00aa('0x3b')]);return _0x537b8e[_0x00aa('0x4e')](_0x2e8e50);}})[_0x00aa('0x21')](function(_0x3d154d){if(_0x3d154d){_0x40de5a=_0x3d154d[_0x00aa('0x32')];if(!_0x1ad6eb['query']['hasOwnProperty'](_0x00aa('0x34'))){_0x2e8e50['limit']=qs[_0x00aa('0x1a')](_0x1ad6eb['query'][_0x00aa('0x1a')]);_0x2e8e50[_0x00aa('0x19')]=qs[_0x00aa('0x19')](_0x1ad6eb[_0x00aa('0x2d')]['offset']);}return _0x537b8e[_0x00aa('0x4e')](_0x2e8e50);}})['then'](function(_0x3fa8f4){if(_0x3fa8f4){return _0x3fa8f4?{'count':_0x40de5a,'rows':_0x3fa8f4}:null;}})['then'](respondWithResult(_0x1e26ff,null))[_0x00aa('0x3f')](handleError(_0x1e26ff,null));};
\ No newline at end of file
index 6c7c01a..14c0909 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb138=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x341a8f,_0x42fbcf){var _0x16d587=function(_0x2c8ec9){while(--_0x2c8ec9){_0x341a8f['push'](_0x341a8f['shift']());}};_0x16d587(++_0x42fbcf);}(_0xb138,0x1dd));var _0x8b13=function(_0x4e6ef9,_0x22a04e){_0x4e6ef9=_0x4e6ef9-0x0;var _0x331c37=_0xb138[_0x4e6ef9];return _0x331c37;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));module['exports']=function(_0xd19a0f,_0x13f7bd){return _0xd19a0f['define'](_0x8b13('0xa'),attributes,{'tableName':_0x8b13('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fd1=['Automation','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x99ad77,_0x38599c){var _0x5a8acf=function(_0x28b75f){while(--_0x28b75f){_0x99ad77['push'](_0x99ad77['shift']());}};_0x5a8acf(++_0x38599c);}(_0x5fd1,0x155));var _0x15fd=function(_0x24df02,_0x42f7e4){_0x24df02=_0x24df02-0x0;var _0x4c3432=_0x5fd1[_0x24df02];return _0x4c3432;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var moment=require(_0x15fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15fd('0x4'));var rimraf=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var attributes=require('./automation.attributes');module[_0x15fd('0x7')]=function(_0x386441,_0x18450c){return _0x386441[_0x15fd('0x8')](_0x15fd('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 413fa5a..c13ab78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a3f=['message','result','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x2a3f,0x10a));var _0xf2a3=function(_0x37ae2e,_0x35be3a){_0x37ae2e=_0x37ae2e-0x0;var _0x19c50f=_0x2a3f[_0x37ae2e];return _0x19c50f;};'use strict';var _=require('lodash');var util=require(_0xf2a3('0x0'));var moment=require(_0xf2a3('0x1'));var BPromise=require(_0xf2a3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2a3('0x3'))['db'];var utils=require(_0xf2a3('0x4'));var logger=require('../../config/logger')(_0xf2a3('0x5'));var config=require(_0xf2a3('0x6'));var jayson=require(_0xf2a3('0x7'));var client=jayson[_0xf2a3('0x8')][_0xf2a3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x273ba7,_0x4a4bbd,_0x275e98){return new BPromise(function(_0x401cc5,_0x193790){return client[_0xf2a3('0xa')](_0x273ba7,_0x275e98)[_0xf2a3('0xb')](function(_0x5443f7){logger[_0xf2a3('0xc')](_0xf2a3('0xd'),_0x4a4bbd,'request\x20sent');logger[_0xf2a3('0xe')](_0xf2a3('0xf'),_0x4a4bbd,_0xf2a3('0x10'),JSON[_0xf2a3('0x11')](_0x5443f7));if(_0x5443f7[_0xf2a3('0x12')]){if(_0x5443f7[_0xf2a3('0x12')][_0xf2a3('0x13')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x4a4bbd,_0x5443f7[_0xf2a3('0x12')][_0xf2a3('0x14')]);return _0x193790(_0x5443f7[_0xf2a3('0x12')][_0xf2a3('0x14')]);}logger[_0xf2a3('0x12')]('Automation,\x20%s,\x20%s',_0x4a4bbd,_0x5443f7['error'][_0xf2a3('0x14')]);return _0x401cc5(_0x5443f7[_0xf2a3('0x12')][_0xf2a3('0x14')]);}else{logger['info'](_0xf2a3('0xd'),_0x4a4bbd,_0xf2a3('0x10'));_0x401cc5(_0x5443f7[_0xf2a3('0x15')][_0xf2a3('0x14')]);}})['catch'](function(_0x152790){logger[_0xf2a3('0x12')](_0xf2a3('0xd'),_0x4a4bbd,_0x152790);_0x193790(_0x152790);});});}
\ No newline at end of file
+var _0x6f28=['stringify','error','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x3cdad6,_0x621ce9){var _0xa0c083=function(_0x469ef9){while(--_0x469ef9){_0x3cdad6['push'](_0x3cdad6['shift']());}};_0xa0c083(++_0x621ce9);}(_0x6f28,0x1d3));var _0x86f2=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x6f28[_0x23c6f2];return _0x4c270b;};'use strict';var _=require('lodash');var util=require(_0x86f2('0x0'));var moment=require('moment');var BPromise=require(_0x86f2('0x1'));var rs=require(_0x86f2('0x2'));var fs=require('fs');var Redis=require(_0x86f2('0x3'));var db=require(_0x86f2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x86f2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x86f2('0x6')][_0x86f2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x33f1d5,_0x54cbc9,_0x2d1a57){return new BPromise(function(_0x3e87fa,_0x30887a){return client['request'](_0x33f1d5,_0x2d1a57)['then'](function(_0x16a1f6){logger[_0x86f2('0x8')](_0x86f2('0x9'),_0x54cbc9,_0x86f2('0xa'));logger[_0x86f2('0xb')](_0x86f2('0xc'),_0x54cbc9,_0x86f2('0xa'),JSON[_0x86f2('0xd')](_0x16a1f6));if(_0x16a1f6[_0x86f2('0xe')]){if(_0x16a1f6[_0x86f2('0xe')]['code']===0x1f4){logger[_0x86f2('0xe')]('Automation,\x20%s,\x20%s',_0x54cbc9,_0x16a1f6[_0x86f2('0xe')][_0x86f2('0xf')]);return _0x30887a(_0x16a1f6[_0x86f2('0xe')][_0x86f2('0xf')]);}logger['error']('Automation,\x20%s,\x20%s',_0x54cbc9,_0x16a1f6[_0x86f2('0xe')][_0x86f2('0xf')]);return _0x3e87fa(_0x16a1f6[_0x86f2('0xe')]['message']);}else{logger[_0x86f2('0x8')]('Automation,\x20%s,\x20%s',_0x54cbc9,_0x86f2('0xa'));_0x3e87fa(_0x16a1f6['result']['message']);}})['catch'](function(_0xb0e789){logger[_0x86f2('0xe')](_0x86f2('0x9'),_0x54cbc9,_0xb0e789);_0x30887a(_0xb0e789);});});}
\ No newline at end of file
index 9f192e9..8faad8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbff2=['isAuthenticated','show','/:id/conditions','post','create','addConditions','addActions','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x119d0d,_0x1491a2){var _0x26e315=function(_0x31ed47){while(--_0x31ed47){_0x119d0d['push'](_0x119d0d['shift']());}};_0x26e315(++_0x1491a2);}(_0xbff2,0x10e));var _0x2bff=function(_0x4e56db,_0x40d6b0){_0x4e56db=_0x4e56db-0x0;var _0x11575d=_0xbff2[_0x4e56db];return _0x11575d;};'use strict';var multer=require(_0x2bff('0x0'));var util=require(_0x2bff('0x1'));var path=require(_0x2bff('0x2'));var timeout=require(_0x2bff('0x3'));var express=require(_0x2bff('0x4'));var router=express[_0x2bff('0x5')]();var auth=require(_0x2bff('0x6'));var interaction=require(_0x2bff('0x7'));var config=require(_0x2bff('0x8'));var controller=require('./automation.controller');router[_0x2bff('0x9')]('/',auth[_0x2bff('0xa')](),controller['index']);router['get']('/:id',auth[_0x2bff('0xa')](),controller[_0x2bff('0xb')]);router['get'](_0x2bff('0xc'),auth['isAuthenticated'](),controller['getConditions']);router[_0x2bff('0x9')]('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0x2bff('0xd')]('/',auth['isAuthenticated'](),controller[_0x2bff('0xe')]);router[_0x2bff('0xd')]('/:id/conditions',auth[_0x2bff('0xa')](),controller[_0x2bff('0xf')]);router['post']('/:id/actions',auth[_0x2bff('0xa')](),controller[_0x2bff('0x10')]);router['put'](_0x2bff('0x11'),auth[_0x2bff('0xa')](),controller['update']);router[_0x2bff('0x12')](_0x2bff('0x11'),auth[_0x2bff('0xa')](),controller[_0x2bff('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x90ad=['put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','getConditions','getActions','post','create','/:id/conditions','addConditions','/:id/actions','addActions'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x90ad,0x195));var _0xd90a=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x90ad[_0x32d457];return _0x338386;};'use strict';var multer=require(_0xd90a('0x0'));var util=require(_0xd90a('0x1'));var path=require(_0xd90a('0x2'));var timeout=require(_0xd90a('0x3'));var express=require(_0xd90a('0x4'));var router=express['Router']();var auth=require(_0xd90a('0x5'));var interaction=require(_0xd90a('0x6'));var config=require(_0xd90a('0x7'));var controller=require('./automation.controller');router[_0xd90a('0x8')]('/',auth['isAuthenticated'](),controller[_0xd90a('0x9')]);router[_0xd90a('0x8')]('/:id',auth[_0xd90a('0xa')](),controller[_0xd90a('0xb')]);router[_0xd90a('0x8')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xd90a('0xc')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0xd90a('0xd')]);router[_0xd90a('0xe')]('/',auth[_0xd90a('0xa')](),controller[_0xd90a('0xf')]);router['post'](_0xd90a('0x10'),auth[_0xd90a('0xa')](),controller[_0xd90a('0x11')]);router[_0xd90a('0xe')](_0xd90a('0x12'),auth[_0xd90a('0xa')](),controller[_0xd90a('0x13')]);router[_0xd90a('0x14')](_0xd90a('0x15'),auth[_0xd90a('0xa')](),controller['update']);router[_0xd90a('0x16')](_0xd90a('0x15'),auth[_0xd90a('0xa')](),controller[_0xd90a('0x17')]);module[_0xd90a('0x18')]=router;
\ No newline at end of file
index eb71409..16d6c90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x724c=['Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','STRING','name','ENUM','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#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','always','Active/Disactive\x20AMD','#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)','#AMD\x20Maximum\x20Word\x20Length','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)'];(function(_0x6b9d70,_0x307b69){var _0x51f266=function(_0x2789e3){while(--_0x2789e3){_0x6b9d70['push'](_0x6b9d70['shift']());}};_0x51f266(++_0x307b69);}(_0x724c,0xcd));var _0xc724=function(_0x2501ad,_0xe24535){_0x2501ad=_0x2501ad-0x0;var _0x5c2d84=_0x724c[_0x2501ad];return _0x5c2d84;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc724('0x0')],'unique':_0xc724('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc724('0x2')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xc724('0x0')]},'active':{'type':Sequelize[_0xc724('0x3')],'defaultValue':0x0,'comment':_0xc724('0x4')},'limitCalls':{'type':Sequelize[_0xc724('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc724('0x0')]},'dialOriginateTimeout':{'type':Sequelize[_0xc724('0x5')](0x3)[_0xc724('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xc724('0x5')](0x3)[_0xc724('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc724('0x5')](0x5)[_0xc724('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xc724('0x5')](0x3)[_0xc724('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc724('0x7')},'dialBusyRetryFrequency':{'type':Sequelize[_0xc724('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc724('0x5')](0x3)[_0xc724('0x6')],'defaultValue':0x3,'comment':_0xc724('0x8')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc724('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc724('0x9')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc724('0x5')](0x3)[_0xc724('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc724('0xa')},'dialTimezone':{'type':Sequelize[_0xc724('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xc724('0x0')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xc724('0x2')]('always',_0xc724('0xb'),'onlyIfOpen'),'defaultValue':_0xc724('0xc')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc724('0xd')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc724('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xc724('0x5')](0x9)[_0xc724('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc724('0xe')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc724('0x5')](0x9)[_0xc724('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc724('0xf')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc724('0x5')](0x9)[_0xc724('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc724('0x10')},'dialAMDMinWordLength':{'type':Sequelize[_0xc724('0x5')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc724('0x11')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc724('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc724('0x12')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc724('0x5')](0x9)[_0xc724('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc724('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc724('0x13')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc724('0x5')](0x9)[_0xc724('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc724('0x14')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc724('0x2')](_0xc724('0x15'),_0xc724('0x16')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc724('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc724('0x17')},'dialCutDigit':{'type':Sequelize[_0xc724('0x5')](0x3)[_0xc724('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc724('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc724('0x5')](0x3)[_0xc724('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc724('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc724('0x19')},'dialDropMaxRetry':{'type':Sequelize[_0xc724('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc724('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc724('0x1a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc724('0x5')](0x3)[_0xc724('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc724('0x1b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc724('0x5')](0x5)[_0xc724('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc724('0x1c')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc724('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc724('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc724('0x5')](0x5)[_0xc724('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc724('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc724('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc724('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xc724('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc724('0x20')}};
\ No newline at end of file
+var _0xf748=['#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence'];(function(_0x1ace78,_0xe10e1d){var _0x287e2d=function(_0x375ba6){while(--_0x375ba6){_0x1ace78['push'](_0x1ace78['shift']());}};_0x287e2d(++_0xe10e1d);}(_0xf748,0x1ad));var _0x8f74=function(_0x1881ac,_0x57ecf4){_0x1881ac=_0x1881ac-0x0;var _0x3b966e=_0xf748[_0x1881ac];return _0x3b966e;};'use strict';var Sequelize=require(_0x8f74('0x0'));module[_0x8f74('0x1')]={'name':{'type':Sequelize[_0x8f74('0x2')],'unique':_0x8f74('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8f74('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x8f74('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x8f74('0x6')],'defaultValue':0x0,'comment':_0x8f74('0x7')},'limitCalls':{'type':Sequelize[_0x8f74('0x8')](0x4)[_0x8f74('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8f74('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8f74('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8f74('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x8f74('0x8')](0x3)[_0x8f74('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f74('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8f74('0x8')](0x3)[_0x8f74('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8f74('0x8')](0x5)[_0x8f74('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x8f74('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f74('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8f74('0x8')](0x5)[_0x8f74('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f74('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8f74('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x8f74('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x8f74('0x8')](0x3)[_0x8f74('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8f74('0xf')},'dialTimezone':{'type':Sequelize[_0x8f74('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8f74('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x8f74('0x4')](_0x8f74('0x10'),_0x8f74('0x11'),_0x8f74('0x12')),'defaultValue':_0x8f74('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8f74('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x8f74('0x8')](0x9)[_0x8f74('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8f74('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x8f74('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8f74('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8f74('0x8')](0x9)[_0x8f74('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8f74('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8f74('0x8')](0x9)[_0x8f74('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8f74('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x8f74('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8f74('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8f74('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8f74('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x8f74('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8f74('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x8f74('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8f74('0x8')](0x9)[_0x8f74('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8f74('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8f74('0x4')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x8f74('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x8f74('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8f74('0x1c')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8f74('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8f74('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8f74('0x8')](0x5)[_0x8f74('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f74('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x8f74('0x8')](0x3)[_0x8f74('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8f74('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f74('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8f74('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f74('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8f74('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8f74('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f74('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x8f74('0x8')](0x5)[_0x8f74('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f74('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8f74('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8f74('0x8')](0x5)[_0x8f74('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
index adca7c3..b126a86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9cd=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','count','includeAll','include','rows','catch','keys','merge','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','update','getHoppers','findOne','CmHopper','filter','getHopperHistories','CmHopperHistory','CampaignId','findAll','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','sequelize','removeBlackLists','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','index','map','Campaign','rawAttributes','key','model','query','filters','attributes','intersection'];(function(_0x25e15d,_0x26db82){var _0x5469ec=function(_0x5d95af){while(--_0x5d95af){_0x25e15d['push'](_0x25e15d['shift']());}};_0x5469ec(++_0x26db82);}(_0xa9cd,0x153));var _0xda9c=function(_0x1131b8,_0xf9ce85){_0x1131b8=_0x1131b8-0x0;var _0x2963da=_0xa9cd[_0x1131b8];return _0x2963da;};'use strict';var pdf=require(_0xda9c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xda9c('0x1'));var jsonpatch=require(_0xda9c('0x2'));var rp=require(_0xda9c('0x3'));var moment=require(_0xda9c('0x4'));var BPromise=require(_0xda9c('0x5'));var Mustache=require(_0xda9c('0x6'));var util=require(_0xda9c('0x7'));var path=require(_0xda9c('0x8'));var sox=require(_0xda9c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xda9c('0xa'));var squel=require(_0xda9c('0xb'));var crypto=require('crypto');var jsforce=require(_0xda9c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xda9c('0xd'));var Papa=require('papaparse');var Redis=require(_0xda9c('0xe'));var authService=require(_0xda9c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xda9c('0x10'));var hardwareService=require(_0xda9c('0x11'));var logger=require('../../config/logger')(_0xda9c('0x12'));var utils=require(_0xda9c('0x13'));var config=require(_0xda9c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5704e6,_0x25ac61){_0x25ac61=_0x25ac61||0xcc;return function(_0x2c69d8){if(_0x2c69d8){return _0x5704e6['sendStatus'](_0x25ac61);}return _0x5704e6[_0xda9c('0x15')](_0x25ac61)[_0xda9c('0x16')]();};}function respondWithResult(_0x3e61d3,_0x3f99ee){_0x3f99ee=_0x3f99ee||0xc8;return function(_0x3ea53e){if(_0x3ea53e){return _0x3e61d3[_0xda9c('0x15')](_0x3f99ee)[_0xda9c('0x17')](_0x3ea53e);}};}function respondWithFilteredResult(_0x35bc59,_0xc74c80){return function(_0x261a76){if(_0x261a76){var _0x437673=_0x261a76['count'],_0x4f3e2d=_0xc74c80[_0xda9c('0x18')],_0x3a2ea2=_0xc74c80['offset']+_0xc74c80[_0xda9c('0x19')],_0x322758;if(_0x3a2ea2>=_0x437673){_0x3a2ea2=_0x437673;_0x322758=0xc8;}else{_0x322758=0xce;}_0x35bc59[_0xda9c('0x15')](_0x322758);return _0x35bc59[_0xda9c('0x1a')](_0xda9c('0x1b'),_0x4f3e2d+'-'+_0x3a2ea2+'/'+_0x437673)[_0xda9c('0x17')](_0x261a76);}return null;};}function patchUpdates(_0x487860){return function(_0x19103f){try{jsonpatch['apply'](_0x19103f,_0x487860,!![]);}catch(_0x49b0db){return BPromise[_0xda9c('0x1c')](_0x49b0db);}return _0x19103f[_0xda9c('0x1d')]();};}function saveUpdates(_0x1deeac,_0x24ae92){return function(_0x719a95){if(_0x719a95){return _0x719a95['update'](_0x1deeac)[_0xda9c('0x1e')](function(_0x166d0c){return _0x166d0c;});}return null;};}function removeEntity(_0x4bd3ad,_0x520ad7){return function(_0x310f78){if(_0x310f78){return _0x310f78[_0xda9c('0x1f')]()['then'](function(){var _0x6c55a1=_0x310f78[_0xda9c('0x20')]({'plain':!![]});var _0x42674e=_0xda9c('0x21');return db[_0xda9c('0x22')][_0xda9c('0x1f')]({'where':{'type':_0x42674e,'resourceId':_0x6c55a1['id']}})[_0xda9c('0x1e')](function(){return _0x310f78;});})[_0xda9c('0x1e')](function(){_0x4bd3ad[_0xda9c('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54c5da,_0x274ff9){return function(_0x562312){if(!_0x562312){_0x54c5da['sendStatus'](0x194);}return _0x562312;};}function handleError(_0x31c729,_0x123551){_0x123551=_0x123551||0x1f4;return function(_0x5efb27){logger['error'](_0x5efb27[_0xda9c('0x23')]);if(_0x5efb27['name']){delete _0x5efb27[_0xda9c('0x24')];}_0x31c729[_0xda9c('0x15')](_0x123551)[_0xda9c('0x25')](_0x5efb27);};}exports[_0xda9c('0x26')]=function(_0x1b06d7,_0x5ce362){var _0x2873be={},_0x5dcfe8={},_0x88ecd7={'count':0x0,'rows':[]};var _0x61896a=_[_0xda9c('0x27')](db[_0xda9c('0x28')][_0xda9c('0x29')],function(_0x5c71af){return{'name':_0x5c71af['fieldName'],'type':_0x5c71af['type'][_0xda9c('0x2a')]};});_0x5dcfe8[_0xda9c('0x2b')]=_[_0xda9c('0x27')](_0x61896a,'name');_0x5dcfe8[_0xda9c('0x2c')]=_['keys'](_0x1b06d7[_0xda9c('0x2c')]);_0x5dcfe8[_0xda9c('0x2d')]=_['intersection'](_0x5dcfe8['model'],_0x5dcfe8[_0xda9c('0x2c')]);_0x2873be[_0xda9c('0x2e')]=_[_0xda9c('0x2f')](_0x5dcfe8[_0xda9c('0x2b')],qs[_0xda9c('0x30')](_0x1b06d7[_0xda9c('0x2c')][_0xda9c('0x30')]));_0x2873be['attributes']=_0x2873be[_0xda9c('0x2e')][_0xda9c('0x31')]?_0x2873be['attributes']:_0x5dcfe8[_0xda9c('0x2b')];if(!_0x1b06d7[_0xda9c('0x2c')][_0xda9c('0x32')](_0xda9c('0x33'))){_0x2873be[_0xda9c('0x19')]=qs[_0xda9c('0x19')](_0x1b06d7['query'][_0xda9c('0x19')]);_0x2873be[_0xda9c('0x18')]=qs[_0xda9c('0x18')](_0x1b06d7[_0xda9c('0x2c')][_0xda9c('0x18')]);}_0x2873be[_0xda9c('0x34')]=qs[_0xda9c('0x35')](_0x1b06d7[_0xda9c('0x2c')][_0xda9c('0x35')]);_0x2873be[_0xda9c('0x36')]=qs[_0xda9c('0x2d')](_[_0xda9c('0x37')](_0x1b06d7[_0xda9c('0x2c')],_0x5dcfe8['filters']),_0x61896a);if(_0x1b06d7[_0xda9c('0x2c')]['filter']){_0x2873be['where']=_['merge'](_0x2873be[_0xda9c('0x36')],{'$or':_[_0xda9c('0x27')](_0x61896a,function(_0x34d131){if(_0x34d131['type']!==_0xda9c('0x38')){var _0xb0a5fa={};_0xb0a5fa[_0x34d131[_0xda9c('0x24')]]={'$like':'%'+_0x1b06d7[_0xda9c('0x2c')]['filter']+'%'};return _0xb0a5fa;}})});}_0x2873be=_['merge']({},_0x2873be,_0x1b06d7[_0xda9c('0x39')]);var _0x3aa65c={'where':_0x2873be[_0xda9c('0x36')]};return db[_0xda9c('0x28')][_0xda9c('0x3a')](_0x3aa65c)[_0xda9c('0x1e')](function(_0x5224d1){_0x88ecd7[_0xda9c('0x3a')]=_0x5224d1;if(_0x1b06d7[_0xda9c('0x2c')][_0xda9c('0x3b')]){_0x2873be[_0xda9c('0x3c')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x2873be);})['then'](function(_0x2541ad){_0x88ecd7[_0xda9c('0x3d')]=_0x2541ad;return _0x88ecd7;})[_0xda9c('0x1e')](respondWithFilteredResult(_0x5ce362,_0x2873be))[_0xda9c('0x3e')](handleError(_0x5ce362,null));};exports['show']=function(_0x53630b,_0x129f93){var _0x2d09e3={'raw':![],'where':{'id':_0x53630b['params']['id']}},_0x4b55c1={};_0x4b55c1[_0xda9c('0x2b')]=_[_0xda9c('0x3f')](db[_0xda9c('0x28')][_0xda9c('0x29')]);_0x4b55c1[_0xda9c('0x2c')]=_['keys'](_0x53630b[_0xda9c('0x2c')]);_0x4b55c1[_0xda9c('0x2d')]=_['intersection'](_0x4b55c1['model'],_0x4b55c1[_0xda9c('0x2c')]);_0x2d09e3[_0xda9c('0x2e')]=_[_0xda9c('0x2f')](_0x4b55c1[_0xda9c('0x2b')],qs['fields'](_0x53630b['query']['fields']));_0x2d09e3[_0xda9c('0x2e')]=_0x2d09e3['attributes'][_0xda9c('0x31')]?_0x2d09e3[_0xda9c('0x2e')]:_0x4b55c1[_0xda9c('0x2b')];if(_0x53630b[_0xda9c('0x2c')][_0xda9c('0x3b')]){_0x2d09e3[_0xda9c('0x3c')]=[{'all':!![]}];}_0x2d09e3=_[_0xda9c('0x40')]({},_0x2d09e3,_0x53630b[_0xda9c('0x39')]);return db[_0xda9c('0x28')][_0xda9c('0x41')](_0x2d09e3)['then'](handleEntityNotFound(_0x129f93,null))[_0xda9c('0x1e')](respondWithResult(_0x129f93,null))['catch'](handleError(_0x129f93,null));};exports[_0xda9c('0x42')]=function(_0x3fcdba,_0x3924ac){return db[_0xda9c('0x28')][_0xda9c('0x42')](_0x3fcdba[_0xda9c('0x43')],{})['then'](function(_0x35a008){var _0x485604=_0x3fcdba[_0xda9c('0x44')][_0xda9c('0x20')]({'plain':!![]});if(!_0x485604)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x485604[_0xda9c('0x45')]===_0xda9c('0x44')){var _0x307b7c=_0x35a008[_0xda9c('0x20')]({'plain':!![]});var _0x19d762=_0xda9c('0x21');return db[_0xda9c('0x46')][_0xda9c('0x41')]({'where':{'name':_0x19d762,'userProfileId':_0x485604[_0xda9c('0x47')]},'raw':!![]})[_0xda9c('0x1e')](function(_0x5a306c){if(_0x5a306c&&_0x5a306c[_0xda9c('0x48')]===0x0){return db[_0xda9c('0x22')]['create']({'name':_0x307b7c['name'],'resourceId':_0x307b7c['id'],'type':_0x5a306c[_0xda9c('0x24')],'sectionId':_0x5a306c['id']},{})[_0xda9c('0x1e')](function(){return _0x35a008;});}else{return _0x35a008;}})[_0xda9c('0x3e')](function(_0x500df8){logger[_0xda9c('0x49')](_0xda9c('0x4a'),_0x500df8);throw _0x500df8;});}return _0x35a008;})[_0xda9c('0x1e')](respondWithResult(_0x3924ac,0xc9))[_0xda9c('0x3e')](handleError(_0x3924ac,null));};exports[_0xda9c('0x4b')]=function(_0x381327,_0x35880b){var _0x1d4ff4={'where':{'id':_0x381327[_0xda9c('0x4c')]['id']}},_0x333e58={};_0x333e58[_0xda9c('0x2b')]=_[_0xda9c('0x3f')](db[_0xda9c('0x28')][_0xda9c('0x29')]);_0x1d4ff4['attributes']=_[_0xda9c('0x2f')](_0x333e58['model'],qs[_0xda9c('0x30')](_0x381327[_0xda9c('0x2c')][_0xda9c('0x30')]));_0x1d4ff4[_0xda9c('0x2e')]=_0x1d4ff4[_0xda9c('0x2e')][_0xda9c('0x31')]?_0x1d4ff4[_0xda9c('0x2e')]:_0x333e58[_0xda9c('0x2b')];if(_0x381327[_0xda9c('0x2c')][_0xda9c('0x3b')]){_0x1d4ff4[_0xda9c('0x3c')]=[{'all':!![]}];}_0x1d4ff4=_[_0xda9c('0x40')]({},_0x1d4ff4,_0x381327[_0xda9c('0x39')]);return db[_0xda9c('0x28')][_0xda9c('0x41')](_0x1d4ff4)[_0xda9c('0x1e')](handleEntityNotFound(_0x35880b,null))['then'](function(_0x548608){if(_0x548608){var _0xd2a5e7=_0x548608[_0xda9c('0x20')]({'plain':!![]});_0xd2a5e7=qs[_0xda9c('0x4d')](_0xd2a5e7,['id',_0xda9c('0x4e'),'updatedAt']);_0x381327[_0xda9c('0x43')]=_[_0xda9c('0x4d')](_0x381327['body'],['id',_0xda9c('0x4e'),_0xda9c('0x4f')]);return db[_0xda9c('0x28')][_0xda9c('0x42')](_['merge'](_0xd2a5e7,_0x381327[_0xda9c('0x43')]),{'include':_0x381327[_0xda9c('0x2c')]['includeAll']?[{'all':!![]}]:undefined})[_0xda9c('0x1e')](function(_0x174e60){var _0x5a72b2=_0x381327[_0xda9c('0x44')]['get']({'plain':!![]});if(!_0x5a72b2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a72b2[_0xda9c('0x45')]===_0xda9c('0x44')){var _0x26584a=_0x174e60[_0xda9c('0x20')]({'plain':!![]});var _0x141d0e='IvrCampaigns';return db[_0xda9c('0x46')][_0xda9c('0x41')]({'where':{'name':_0x141d0e,'userProfileId':_0x5a72b2[_0xda9c('0x47')]},'raw':!![]})['then'](function(_0xa47b97){if(_0xa47b97&&_0xa47b97[_0xda9c('0x48')]===0x0){return db[_0xda9c('0x22')][_0xda9c('0x42')]({'name':_0x26584a['name'],'resourceId':_0x26584a['id'],'type':_0xa47b97[_0xda9c('0x24')],'sectionId':_0xa47b97['id']},{})[_0xda9c('0x1e')](function(){return _0x174e60;});}else{return _0x174e60;}})[_0xda9c('0x3e')](function(_0x970431){logger[_0xda9c('0x49')](_0xda9c('0x4a'),_0x970431);throw _0x970431;});}return _0x174e60;});}})[_0xda9c('0x1e')](respondWithResult(_0x35880b,0xc9))[_0xda9c('0x3e')](handleError(_0x35880b,null));};exports[_0xda9c('0x50')]=function(_0x516a1f,_0xcc4be5){if(_0x516a1f[_0xda9c('0x43')]['id']){delete _0x516a1f['body']['id'];}return db[_0xda9c('0x28')]['find']({'where':{'id':_0x516a1f['params']['id']}})[_0xda9c('0x1e')](handleEntityNotFound(_0xcc4be5,null))[_0xda9c('0x1e')](saveUpdates(_0x516a1f[_0xda9c('0x43')],null))[_0xda9c('0x1e')](respondWithResult(_0xcc4be5,null))[_0xda9c('0x3e')](handleError(_0xcc4be5,null));};exports['destroy']=function(_0xed511d,_0xe9a3ee){return db['Campaign']['find']({'where':{'id':_0xed511d[_0xda9c('0x4c')]['id']}})[_0xda9c('0x1e')](handleEntityNotFound(_0xe9a3ee,null))[_0xda9c('0x1e')](removeEntity(_0xe9a3ee,null))[_0xda9c('0x3e')](handleError(_0xe9a3ee,null));};exports[_0xda9c('0x51')]=function(_0x76f3b0,_0xfd64f,_0x2a7fef){var _0x114135={'raw':!![],'where':{}};var _0x466da9={};var _0x34f8c0={'count':0x0,'rows':[]};return db['Campaign'][_0xda9c('0x52')]({'where':{'id':_0x76f3b0[_0xda9c('0x4c')]['id']}})[_0xda9c('0x1e')](handleEntityNotFound(_0xfd64f,null))['then'](function(_0xb86e44){if(_0xb86e44){_0x466da9['model']=_['keys'](db[_0xda9c('0x53')][_0xda9c('0x29')]);_0x466da9[_0xda9c('0x2c')]=_[_0xda9c('0x3f')](_0x76f3b0['query']);_0x466da9[_0xda9c('0x2d')]=_['intersection'](_0x466da9[_0xda9c('0x2b')],_0x466da9['query']);_0x114135['attributes']=_['intersection'](_0x466da9[_0xda9c('0x2b')],qs[_0xda9c('0x30')](_0x76f3b0[_0xda9c('0x2c')][_0xda9c('0x30')]));_0x114135[_0xda9c('0x2e')]=_0x114135[_0xda9c('0x2e')][_0xda9c('0x31')]?_0x114135[_0xda9c('0x2e')]:_0x466da9[_0xda9c('0x2b')];if(!_0x76f3b0[_0xda9c('0x2c')][_0xda9c('0x32')](_0xda9c('0x33'))){_0x114135[_0xda9c('0x19')]=qs[_0xda9c('0x19')](_0x76f3b0['query'][_0xda9c('0x19')]);_0x114135[_0xda9c('0x18')]=qs[_0xda9c('0x18')](_0x76f3b0['query'][_0xda9c('0x18')]);}_0x114135[_0xda9c('0x34')]=qs[_0xda9c('0x35')](_0x76f3b0[_0xda9c('0x2c')][_0xda9c('0x35')]);_0x114135[_0xda9c('0x36')]=qs['filters'](_[_0xda9c('0x37')](_0x76f3b0[_0xda9c('0x2c')],_0x466da9[_0xda9c('0x2d')]));_0x114135[_0xda9c('0x36')]['CampaignId']=_0xb86e44['id'];if(_0x76f3b0[_0xda9c('0x2c')][_0xda9c('0x54')]){_0x114135[_0xda9c('0x36')]=_[_0xda9c('0x40')](_0x114135[_0xda9c('0x36')],{'$or':_[_0xda9c('0x27')](_0x114135['attributes'],function(_0x30cc7a){var _0x49133c={};_0x49133c[_0x30cc7a]={'$like':'%'+_0x76f3b0[_0xda9c('0x2c')][_0xda9c('0x54')]+'%'};return _0x49133c;})});}_0x114135=_[_0xda9c('0x40')]({},_0x114135,_0x76f3b0[_0xda9c('0x39')]);return db[_0xda9c('0x53')][_0xda9c('0x3a')]({'where':_0x114135[_0xda9c('0x36')]})[_0xda9c('0x1e')](function(_0x14f82b){_0x34f8c0[_0xda9c('0x3a')]=_0x14f82b;if(_0x76f3b0[_0xda9c('0x2c')][_0xda9c('0x3b')]){_0x114135[_0xda9c('0x3c')]=[{'all':!![]}];}return db[_0xda9c('0x53')]['findAll'](_0x114135);})['then'](function(_0x1753fb){_0x34f8c0['rows']=_0x1753fb;return _0x34f8c0;});}})[_0xda9c('0x1e')](respondWithFilteredResult(_0xfd64f,_0x114135))['catch'](handleError(_0xfd64f,null));};exports[_0xda9c('0x55')]=function(_0x16ce4e,_0x2ec8cc,_0x54124f){var _0x2b3189={'raw':!![],'where':{}};var _0x185f73={};var _0x3d2e00={'count':0x0,'rows':[]};return db[_0xda9c('0x28')]['findOne']({'where':{'id':_0x16ce4e['params']['id']}})['then'](handleEntityNotFound(_0x2ec8cc,null))[_0xda9c('0x1e')](function(_0xa0a30c){if(_0xa0a30c){_0x185f73[_0xda9c('0x2b')]=_[_0xda9c('0x3f')](db[_0xda9c('0x56')][_0xda9c('0x29')]);_0x185f73[_0xda9c('0x2c')]=_['keys'](_0x16ce4e[_0xda9c('0x2c')]);_0x185f73[_0xda9c('0x2d')]=_[_0xda9c('0x2f')](_0x185f73[_0xda9c('0x2b')],_0x185f73['query']);_0x2b3189['attributes']=_[_0xda9c('0x2f')](_0x185f73[_0xda9c('0x2b')],qs[_0xda9c('0x30')](_0x16ce4e[_0xda9c('0x2c')][_0xda9c('0x30')]));_0x2b3189[_0xda9c('0x2e')]=_0x2b3189[_0xda9c('0x2e')][_0xda9c('0x31')]?_0x2b3189[_0xda9c('0x2e')]:_0x185f73[_0xda9c('0x2b')];if(!_0x16ce4e[_0xda9c('0x2c')][_0xda9c('0x32')](_0xda9c('0x33'))){_0x2b3189[_0xda9c('0x19')]=qs[_0xda9c('0x19')](_0x16ce4e[_0xda9c('0x2c')][_0xda9c('0x19')]);_0x2b3189['offset']=qs[_0xda9c('0x18')](_0x16ce4e[_0xda9c('0x2c')][_0xda9c('0x18')]);}_0x2b3189['order']=qs[_0xda9c('0x35')](_0x16ce4e[_0xda9c('0x2c')]['sort']);_0x2b3189[_0xda9c('0x36')]=qs[_0xda9c('0x2d')](_[_0xda9c('0x37')](_0x16ce4e['query'],_0x185f73[_0xda9c('0x2d')]));_0x2b3189[_0xda9c('0x36')][_0xda9c('0x57')]=_0xa0a30c['id'];if(_0x16ce4e[_0xda9c('0x2c')][_0xda9c('0x54')]){_0x2b3189[_0xda9c('0x36')]=_[_0xda9c('0x40')](_0x2b3189[_0xda9c('0x36')],{'$or':_[_0xda9c('0x27')](_0x2b3189[_0xda9c('0x2e')],function(_0x10f4ac){var _0x5b4ba2={};_0x5b4ba2[_0x10f4ac]={'$like':'%'+_0x16ce4e[_0xda9c('0x2c')][_0xda9c('0x54')]+'%'};return _0x5b4ba2;})});}_0x2b3189=_['merge']({},_0x2b3189,_0x16ce4e[_0xda9c('0x39')]);return db['CmHopperHistory'][_0xda9c('0x3a')]({'where':_0x2b3189[_0xda9c('0x36')]})[_0xda9c('0x1e')](function(_0xe179f3){_0x3d2e00['count']=_0xe179f3;if(_0x16ce4e[_0xda9c('0x2c')][_0xda9c('0x3b')]){_0x2b3189[_0xda9c('0x3c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xda9c('0x58')](_0x2b3189);})[_0xda9c('0x1e')](function(_0x3e64e9){_0x3d2e00[_0xda9c('0x3d')]=_0x3e64e9;return _0x3d2e00;});}})[_0xda9c('0x1e')](respondWithFilteredResult(_0x2ec8cc,_0x2b3189))['catch'](handleError(_0x2ec8cc,null));};exports['getHopperFinals']=function(_0x3514f9,_0x5b17d1,_0x2a36ac){var _0x4ca2b7={'raw':!![],'where':{}};var _0x1428bd={};var _0x5d4c11={'count':0x0,'rows':[]};return db[_0xda9c('0x28')][_0xda9c('0x52')]({'where':{'id':_0x3514f9['params']['id']}})[_0xda9c('0x1e')](handleEntityNotFound(_0x5b17d1,null))[_0xda9c('0x1e')](function(_0x1436ed){if(_0x1436ed){_0x1428bd[_0xda9c('0x2b')]=_[_0xda9c('0x3f')](db[_0xda9c('0x59')][_0xda9c('0x29')]);_0x1428bd[_0xda9c('0x2c')]=_[_0xda9c('0x3f')](_0x3514f9[_0xda9c('0x2c')]);_0x1428bd[_0xda9c('0x2d')]=_['intersection'](_0x1428bd['model'],_0x1428bd[_0xda9c('0x2c')]);_0x4ca2b7[_0xda9c('0x2e')]=_[_0xda9c('0x2f')](_0x1428bd[_0xda9c('0x2b')],qs[_0xda9c('0x30')](_0x3514f9[_0xda9c('0x2c')][_0xda9c('0x30')]));_0x4ca2b7['attributes']=_0x4ca2b7[_0xda9c('0x2e')][_0xda9c('0x31')]?_0x4ca2b7[_0xda9c('0x2e')]:_0x1428bd[_0xda9c('0x2b')];if(!_0x3514f9[_0xda9c('0x2c')][_0xda9c('0x32')](_0xda9c('0x33'))){_0x4ca2b7[_0xda9c('0x19')]=qs['limit'](_0x3514f9['query'][_0xda9c('0x19')]);_0x4ca2b7[_0xda9c('0x18')]=qs[_0xda9c('0x18')](_0x3514f9['query'][_0xda9c('0x18')]);}_0x4ca2b7[_0xda9c('0x34')]=qs[_0xda9c('0x35')](_0x3514f9[_0xda9c('0x2c')][_0xda9c('0x35')]);_0x4ca2b7['where']=qs[_0xda9c('0x2d')](_['pick'](_0x3514f9[_0xda9c('0x2c')],_0x1428bd[_0xda9c('0x2d')]));_0x4ca2b7[_0xda9c('0x36')]['CampaignId']=_0x1436ed['id'];if(_0x3514f9[_0xda9c('0x2c')]['filter']){_0x4ca2b7[_0xda9c('0x36')]=_[_0xda9c('0x40')](_0x4ca2b7[_0xda9c('0x36')],{'$or':_['map'](_0x4ca2b7[_0xda9c('0x2e')],function(_0x936e3f){var _0x3f8800={};_0x3f8800[_0x936e3f]={'$like':'%'+_0x3514f9[_0xda9c('0x2c')][_0xda9c('0x54')]+'%'};return _0x3f8800;})});}_0x4ca2b7=_[_0xda9c('0x40')]({},_0x4ca2b7,_0x3514f9['options']);return db[_0xda9c('0x59')][_0xda9c('0x3a')]({'where':_0x4ca2b7[_0xda9c('0x36')]})[_0xda9c('0x1e')](function(_0x1ad794){_0x5d4c11[_0xda9c('0x3a')]=_0x1ad794;if(_0x3514f9[_0xda9c('0x2c')][_0xda9c('0x3b')]){_0x4ca2b7[_0xda9c('0x3c')]=[{'all':!![]}];}return db[_0xda9c('0x59')][_0xda9c('0x58')](_0x4ca2b7);})[_0xda9c('0x1e')](function(_0x5b8c3d){_0x5d4c11[_0xda9c('0x3d')]=_0x5b8c3d;return _0x5d4c11;});}})[_0xda9c('0x1e')](respondWithFilteredResult(_0x5b17d1,_0x4ca2b7))[_0xda9c('0x3e')](handleError(_0x5b17d1,null));};exports[_0xda9c('0x5a')]=function(_0x4e3e23,_0x5583e7,_0x5759d9){var _0x4fabf0={'raw':!![],'where':{}};var _0x362112={};var _0x1e5c27={'count':0x0,'rows':[]};return db[_0xda9c('0x28')]['findOne']({'where':{'id':_0x4e3e23[_0xda9c('0x4c')]['id']}})[_0xda9c('0x1e')](handleEntityNotFound(_0x5583e7,null))[_0xda9c('0x1e')](function(_0x2cbfa6){if(_0x2cbfa6){_0x362112['model']=_[_0xda9c('0x3f')](db[_0xda9c('0x5b')]['rawAttributes']);_0x362112[_0xda9c('0x2c')]=_[_0xda9c('0x3f')](_0x4e3e23[_0xda9c('0x2c')]);_0x362112[_0xda9c('0x2d')]=_[_0xda9c('0x2f')](_0x362112[_0xda9c('0x2b')],_0x362112[_0xda9c('0x2c')]);_0x4fabf0[_0xda9c('0x2e')]=_[_0xda9c('0x2f')](_0x362112[_0xda9c('0x2b')],qs[_0xda9c('0x30')](_0x4e3e23[_0xda9c('0x2c')][_0xda9c('0x30')]));_0x4fabf0[_0xda9c('0x2e')]=_0x4fabf0[_0xda9c('0x2e')][_0xda9c('0x31')]?_0x4fabf0['attributes']:_0x362112[_0xda9c('0x2b')];if(!_0x4e3e23['query'][_0xda9c('0x32')](_0xda9c('0x33'))){_0x4fabf0['limit']=qs[_0xda9c('0x19')](_0x4e3e23[_0xda9c('0x2c')][_0xda9c('0x19')]);_0x4fabf0[_0xda9c('0x18')]=qs[_0xda9c('0x18')](_0x4e3e23[_0xda9c('0x2c')][_0xda9c('0x18')]);}_0x4fabf0['order']=qs[_0xda9c('0x35')](_0x4e3e23[_0xda9c('0x2c')]['sort']);_0x4fabf0[_0xda9c('0x36')]=qs[_0xda9c('0x2d')](_[_0xda9c('0x37')](_0x4e3e23[_0xda9c('0x2c')],_0x362112['filters']));_0x4fabf0[_0xda9c('0x36')][_0xda9c('0x57')]=_0x2cbfa6['id'];if(_0x4e3e23['query'][_0xda9c('0x54')]){_0x4fabf0[_0xda9c('0x36')]=_[_0xda9c('0x40')](_0x4fabf0[_0xda9c('0x36')],{'$or':_['map'](_0x4fabf0[_0xda9c('0x2e')],function(_0xd2d920){var _0x2e88a6={};_0x2e88a6[_0xd2d920]={'$like':'%'+_0x4e3e23['query'][_0xda9c('0x54')]+'%'};return _0x2e88a6;})});}_0x4fabf0=_['merge']({},_0x4fabf0,_0x4e3e23['options']);return db[_0xda9c('0x5b')]['count']({'where':_0x4fabf0[_0xda9c('0x36')]})[_0xda9c('0x1e')](function(_0x33423c){_0x1e5c27[_0xda9c('0x3a')]=_0x33423c;if(_0x4e3e23[_0xda9c('0x2c')][_0xda9c('0x3b')]){_0x4fabf0['include']=[{'all':!![]}];}return db[_0xda9c('0x5b')][_0xda9c('0x58')](_0x4fabf0);})[_0xda9c('0x1e')](function(_0x136062){_0x1e5c27['rows']=_0x136062;return _0x1e5c27;});}})[_0xda9c('0x1e')](respondWithFilteredResult(_0x5583e7,_0x4fabf0))['catch'](handleError(_0x5583e7,null));};exports[_0xda9c('0x5c')]=function(_0x4b7d4f,_0x17c2dc,_0xe3b2c7){var _0x14efe3={};var _0x3320d9={};var _0x139117;var _0x5484d1;return db[_0xda9c('0x28')][_0xda9c('0x52')]({'where':{'id':_0x4b7d4f['params']['id']}})[_0xda9c('0x1e')](handleEntityNotFound(_0x17c2dc,null))[_0xda9c('0x1e')](function(_0x49ce3b){if(_0x49ce3b){_0x139117=_0x49ce3b;_0x3320d9['model']=_['keys'](db[_0xda9c('0x5d')][_0xda9c('0x29')]);_0x3320d9['query']=_[_0xda9c('0x3f')](_0x4b7d4f['query']);_0x3320d9[_0xda9c('0x2d')]=_['intersection'](_0x3320d9['model'],_0x3320d9[_0xda9c('0x2c')]);_0x14efe3[_0xda9c('0x2e')]=_[_0xda9c('0x2f')](_0x3320d9[_0xda9c('0x2b')],qs[_0xda9c('0x30')](_0x4b7d4f[_0xda9c('0x2c')][_0xda9c('0x30')]));_0x14efe3[_0xda9c('0x2e')]=_0x14efe3[_0xda9c('0x2e')][_0xda9c('0x31')]?_0x14efe3[_0xda9c('0x2e')]:_0x3320d9['model'];_0x14efe3['order']=qs['sort'](_0x4b7d4f[_0xda9c('0x2c')][_0xda9c('0x35')]);_0x14efe3[_0xda9c('0x36')]=qs['filters'](_[_0xda9c('0x37')](_0x4b7d4f[_0xda9c('0x2c')],_0x3320d9['filters']));if(_0x4b7d4f[_0xda9c('0x2c')][_0xda9c('0x54')]){_0x14efe3['where']=_[_0xda9c('0x40')](_0x14efe3['where'],{'$or':_['map'](_0x14efe3['attributes'],function(_0x580d6e){var _0x4c2682={};_0x4c2682[_0x580d6e]={'$like':'%'+_0x4b7d4f[_0xda9c('0x2c')]['filter']+'%'};return _0x4c2682;})});}_0x14efe3=_[_0xda9c('0x40')]({},_0x14efe3,_0x4b7d4f[_0xda9c('0x39')]);return _0x139117[_0xda9c('0x5c')](_0x14efe3);}})[_0xda9c('0x1e')](function(_0x960757){if(_0x960757){_0x5484d1=_0x960757['length'];if(!_0x4b7d4f[_0xda9c('0x2c')][_0xda9c('0x32')]('nolimit')){_0x14efe3[_0xda9c('0x19')]=qs[_0xda9c('0x19')](_0x4b7d4f['query']['limit']);_0x14efe3[_0xda9c('0x18')]=qs['offset'](_0x4b7d4f['query'][_0xda9c('0x18')]);}return _0x139117[_0xda9c('0x5c')](_0x14efe3);}})['then'](function(_0x19149e){if(_0x19149e){return _0x19149e?{'count':_0x5484d1,'rows':_0x19149e}:null;}})[_0xda9c('0x1e')](respondWithResult(_0x17c2dc,null))[_0xda9c('0x3e')](handleError(_0x17c2dc,null));};exports[_0xda9c('0x5e')]=function(_0x374ecc,_0x290b63,_0x49fada){var _0x58c371,_0xc99d28;return db[_0xda9c('0x28')]['find']({'where':{'id':_0x374ecc[_0xda9c('0x4c')]['id']}})[_0xda9c('0x1e')](handleEntityNotFound(_0x290b63,null))[_0xda9c('0x1e')](function(_0x5eea09){if(_0x5eea09){_0xc99d28=_0x5eea09;return _0x5eea09['addLists'](_0x374ecc[_0xda9c('0x43')][_0xda9c('0x5f')],_[_0xda9c('0x4d')](_0x374ecc[_0xda9c('0x43')],[_0xda9c('0x5f'),'id'])||{});}return null;})[_0xda9c('0x60')](function(_0x499553){var _0x2a5ae0;_0x58c371=_0x499553||[];var _0x36809d=[];if(_0x499553){for(var _0x4f1526=0x0;_0x4f1526<_0x499553[_0xda9c('0x31')];_0x4f1526+=0x1){var _0x1d3876=_0x499553[_0x4f1526][_0xda9c('0x20')]({'plain':!![]});_0xc99d28[_0xda9c('0x61')]=_0x374ecc[_0xda9c('0x43')][_0xda9c('0x61')]?_0x374ecc[_0xda9c('0x43')]['dialCheckDuplicateType']:_0xc99d28[_0xda9c('0x61')];switch(_0xc99d28[_0xda9c('0x61')]){case _0xda9c('0x62'):_0x2a5ae0=squel[_0xda9c('0x63')]()[_0xda9c('0x64')]('cm_hopper')[_0xda9c('0x65')]([_0xda9c('0x66'),_0xda9c('0x67'),_0xda9c('0x68'),_0xda9c('0x69'),_0xda9c('0x57'),_0xda9c('0x4e'),_0xda9c('0x4f')],squel[_0xda9c('0x6a')]()[_0xda9c('0x6b')]('phone','phone')[_0xda9c('0x6b')](_0xda9c('0x6c'),_0xda9c('0x67'))['field']('id','ContactId')[_0xda9c('0x6b')](_0x1d3876[_0xda9c('0x6d')][_0xda9c('0x6e')](),_0xda9c('0x69'))[_0xda9c('0x6b')](_0x374ecc[_0xda9c('0x4c')]['id']['toString'](),_0xda9c('0x57'))[_0xda9c('0x6b')](_0xda9c('0x6c'),_0xda9c('0x4e'))[_0xda9c('0x6b')]('NOW()','updatedAt')[_0xda9c('0x6f')](_0xda9c('0x70'))[_0xda9c('0x36')](_0xda9c('0x71'))[_0xda9c('0x36')](_0xda9c('0x72'),_0x1d3876[_0xda9c('0x6d')][_0xda9c('0x6e')]())[_0xda9c('0x36')](_0xda9c('0x73'))[_0xda9c('0x36')](_0xda9c('0x74'),squel[_0xda9c('0x6a')]()['field'](_0xda9c('0x75'))[_0xda9c('0x6f')]('cm_hopper_final')[_0xda9c('0x36')](_0xda9c('0x76'),_0x374ecc[_0xda9c('0x4c')]['id']['toString']()))[_0xda9c('0x36')](_0xda9c('0x74'),squel['select']()[_0xda9c('0x6b')](_0xda9c('0x77'))[_0xda9c('0x6f')]('cm_hopper')[_0xda9c('0x36')](_0xda9c('0x76'),_0x374ecc[_0xda9c('0x4c')]['id'][_0xda9c('0x6e')]())))['toString']();break;case'onlyIfOpen':_0x2a5ae0=squel[_0xda9c('0x63')]()[_0xda9c('0x64')](_0xda9c('0x78'))[_0xda9c('0x65')]([_0xda9c('0x66'),_0xda9c('0x67'),_0xda9c('0x68'),_0xda9c('0x69'),_0xda9c('0x57'),_0xda9c('0x4e'),_0xda9c('0x4f')],squel[_0xda9c('0x6a')]()[_0xda9c('0x6b')]('phone',_0xda9c('0x66'))['field'](_0xda9c('0x6c'),'scheduledAt')[_0xda9c('0x6b')]('id',_0xda9c('0x68'))[_0xda9c('0x6b')](_0x1d3876[_0xda9c('0x6d')][_0xda9c('0x6e')](),_0xda9c('0x69'))[_0xda9c('0x6b')](_0x374ecc[_0xda9c('0x4c')]['id']['toString'](),_0xda9c('0x57'))[_0xda9c('0x6b')](_0xda9c('0x6c'),'createdAt')['field'](_0xda9c('0x6c'),'updatedAt')[_0xda9c('0x6f')](_0xda9c('0x70'))['where'](_0xda9c('0x71'))[_0xda9c('0x36')](_0xda9c('0x72'),_0x1d3876[_0xda9c('0x6d')][_0xda9c('0x6e')]())['where'](_0xda9c('0x73'))[_0xda9c('0x36')](_0xda9c('0x74'),squel[_0xda9c('0x6a')]()[_0xda9c('0x6b')](_0xda9c('0x77'))['from'](_0xda9c('0x78'))[_0xda9c('0x36')]('CampaignId\x20=\x20?',_0x374ecc[_0xda9c('0x4c')]['id'][_0xda9c('0x6e')]())))[_0xda9c('0x6e')]();break;default:_0x2a5ae0=squel[_0xda9c('0x63')]()[_0xda9c('0x64')](_0xda9c('0x78'))['fromQuery'](['phone',_0xda9c('0x67'),_0xda9c('0x68'),_0xda9c('0x69'),_0xda9c('0x57'),_0xda9c('0x4e'),_0xda9c('0x4f')],squel[_0xda9c('0x6a')]()[_0xda9c('0x6b')](_0xda9c('0x66'),_0xda9c('0x66'))['field'](_0xda9c('0x6c'),'scheduledAt')[_0xda9c('0x6b')]('id',_0xda9c('0x68'))[_0xda9c('0x6b')](_0x1d3876[_0xda9c('0x6d')][_0xda9c('0x6e')](),_0xda9c('0x69'))[_0xda9c('0x6b')](_0x374ecc['params']['id'][_0xda9c('0x6e')](),_0xda9c('0x57'))[_0xda9c('0x6b')]('NOW()',_0xda9c('0x4e'))[_0xda9c('0x6b')](_0xda9c('0x6c'),'updatedAt')[_0xda9c('0x6f')](_0xda9c('0x70'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xda9c('0x72'),_0x1d3876[_0xda9c('0x6d')]['toString']())['where'](_0xda9c('0x73')))[_0xda9c('0x6e')]();}_0x36809d['push'](db['sequelize'][_0xda9c('0x2c')](_0x2a5ae0));}return BPromise[_0xda9c('0x79')](_0x36809d);}})['then'](function(){return _0x58c371;})[_0xda9c('0x1e')](respondWithResult(_0x290b63,null))[_0xda9c('0x3e')](handleError(_0x290b63,null));};exports[_0xda9c('0x7a')]=function(_0x14cfee,_0x2b6012,_0x2ff29f){return db['Campaign'][_0xda9c('0x41')]({'where':{'id':_0x14cfee[_0xda9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2b6012,null))[_0xda9c('0x1e')](function(_0x106dc8){if(_0x106dc8){return _0x106dc8[_0xda9c('0x7a')](_0x14cfee[_0xda9c('0x2c')][_0xda9c('0x5f')]);}})[_0xda9c('0x1e')](function(_0x14d3f4){if(_0x14d3f4){return db['CmHopper'][_0xda9c('0x1f')]({'where':{'ListId':_0x14cfee[_0xda9c('0x2c')][_0xda9c('0x5f')],'CampaignId':_0x14cfee[_0xda9c('0x4c')]['id']}})['then'](function(){return _0x14d3f4;});}})[_0xda9c('0x1e')](respondWithStatusCode(_0x2b6012,null))[_0xda9c('0x3e')](handleError(_0x2b6012,null));};exports[_0xda9c('0x7b')]=function(_0x2e0f5a,_0x14cfe8,_0x390c6e){var _0x6df49b={'raw':!![],'where':{}};var _0x3c7bdb={};var _0x118e93={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x2e0f5a[_0xda9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x14cfe8,null))[_0xda9c('0x1e')](function(_0x36ffb5){if(_0x36ffb5){_0x3c7bdb[_0xda9c('0x2b')]=_[_0xda9c('0x3f')](db[_0xda9c('0x5d')]['rawAttributes']);_0x3c7bdb[_0xda9c('0x2c')]=_[_0xda9c('0x3f')](_0x2e0f5a['query']);_0x3c7bdb[_0xda9c('0x2d')]=_[_0xda9c('0x2f')](_0x3c7bdb[_0xda9c('0x2b')],_0x3c7bdb[_0xda9c('0x2c')]);_0x6df49b[_0xda9c('0x2e')]=_[_0xda9c('0x2f')](_0x3c7bdb[_0xda9c('0x2b')],qs[_0xda9c('0x30')](_0x2e0f5a[_0xda9c('0x2c')][_0xda9c('0x30')]));_0x6df49b[_0xda9c('0x2e')]=_0x6df49b[_0xda9c('0x2e')][_0xda9c('0x31')]?_0x6df49b['attributes']:_0x3c7bdb[_0xda9c('0x2b')];if(!_0x2e0f5a['query']['hasOwnProperty'](_0xda9c('0x33'))){_0x6df49b['limit']=qs[_0xda9c('0x19')](_0x2e0f5a[_0xda9c('0x2c')][_0xda9c('0x19')]);_0x6df49b[_0xda9c('0x18')]=qs[_0xda9c('0x18')](_0x2e0f5a[_0xda9c('0x2c')][_0xda9c('0x18')]);}_0x6df49b[_0xda9c('0x34')]=qs[_0xda9c('0x35')](_0x2e0f5a[_0xda9c('0x2c')][_0xda9c('0x35')]);_0x6df49b[_0xda9c('0x36')]=qs[_0xda9c('0x2d')](_[_0xda9c('0x37')](_0x2e0f5a[_0xda9c('0x2c')],_0x3c7bdb[_0xda9c('0x2d')]));_0x6df49b[_0xda9c('0x36')][_0xda9c('0x57')]=_0x36ffb5['id'];if(_0x2e0f5a[_0xda9c('0x2c')]['filter']){_0x6df49b[_0xda9c('0x36')]=_[_0xda9c('0x40')](_0x6df49b['where'],{'$or':_[_0xda9c('0x27')](_0x6df49b[_0xda9c('0x2e')],function(_0x2c57d1){var _0x2d9622={};_0x2d9622[_0x2c57d1]={'$like':'%'+_0x2e0f5a['query'][_0xda9c('0x54')]+'%'};return _0x2d9622;})});}_0x6df49b=_[_0xda9c('0x40')]({},_0x6df49b,_0x2e0f5a[_0xda9c('0x39')]);return db[_0xda9c('0x5d')][_0xda9c('0x3a')]({'where':_0x6df49b[_0xda9c('0x36')]})[_0xda9c('0x1e')](function(_0x432b20){_0x118e93['count']=_0x432b20;if(_0x2e0f5a['query'][_0xda9c('0x3b')]){_0x6df49b['include']=[{'all':!![]}];}return db[_0xda9c('0x5d')][_0xda9c('0x58')](_0x6df49b);})[_0xda9c('0x1e')](function(_0x3f9593){_0x118e93[_0xda9c('0x3d')]=_0x3f9593;return _0x118e93;});}})['then'](respondWithFilteredResult(_0x14cfe8,_0x6df49b))[_0xda9c('0x3e')](handleError(_0x14cfe8,null));};exports['addBlackLists']=function(_0x8cfb0f,_0x3ddd70,_0x247686){var _0x290ec6,_0xae103a;return db[_0xda9c('0x28')][_0xda9c('0x41')]({'where':{'id':_0x8cfb0f[_0xda9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3ddd70,null))['then'](function(_0x40edd3){if(_0x40edd3){_0xae103a=_0x40edd3;return _0x40edd3[_0xda9c('0x7c')](_0x8cfb0f[_0xda9c('0x43')]['ids'],_[_0xda9c('0x4d')](_0x8cfb0f[_0xda9c('0x43')],[_0xda9c('0x5f'),'id'])||{});}return null;})[_0xda9c('0x60')](function(_0x6af446){var _0x24e0eb;_0x290ec6=_0x6af446||[];var _0x3a34ed=[];if(_0x6af446){for(var _0x1cb132=0x0;_0x1cb132<_0x6af446[_0xda9c('0x31')];_0x1cb132+=0x1){var _0x42df9d=_0x6af446[_0x1cb132]['get']({'plain':!![]});_0x24e0eb=squel[_0xda9c('0x63')]()[_0xda9c('0x64')](_0xda9c('0x7d'))[_0xda9c('0x65')]([_0xda9c('0x66'),_0xda9c('0x68'),_0xda9c('0x69'),'CampaignId',_0xda9c('0x4e'),_0xda9c('0x4f')],squel['select']()['field'](_0xda9c('0x66'),_0xda9c('0x66'))['field']('id',_0xda9c('0x68'))[_0xda9c('0x6b')](_0x42df9d[_0xda9c('0x6d')][_0xda9c('0x6e')](),'ListId')[_0xda9c('0x6b')](_0x8cfb0f[_0xda9c('0x4c')]['id'][_0xda9c('0x6e')](),_0xda9c('0x57'))[_0xda9c('0x6b')](_0xda9c('0x6c'),'createdAt')['field'](_0xda9c('0x6c'),_0xda9c('0x4f'))[_0xda9c('0x6f')](_0xda9c('0x70'))[_0xda9c('0x36')](_0xda9c('0x71'))[_0xda9c('0x36')](_0xda9c('0x72'),_0x42df9d[_0xda9c('0x6d')][_0xda9c('0x6e')]())[_0xda9c('0x36')](_0xda9c('0x73')))[_0xda9c('0x6e')]();_0x3a34ed[_0xda9c('0x7e')](db[_0xda9c('0x7f')]['query'](_0x24e0eb));}return BPromise[_0xda9c('0x79')](_0x3a34ed);}})[_0xda9c('0x1e')](function(){return _0x290ec6;})[_0xda9c('0x1e')](respondWithResult(_0x3ddd70,null))['catch'](handleError(_0x3ddd70,null));};exports[_0xda9c('0x80')]=function(_0x292a58,_0x5e9687,_0x20d7e0){return db['Campaign'][_0xda9c('0x41')]({'where':{'id':_0x292a58[_0xda9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5e9687,null))[_0xda9c('0x1e')](function(_0x40a9d9){if(_0x40a9d9){return _0x40a9d9[_0xda9c('0x80')](_0x292a58[_0xda9c('0x2c')]['ids']);}})['then'](function(_0x3f8ea2){if(_0x3f8ea2){return db['CmHopperBlack'][_0xda9c('0x1f')]({'where':{'ListId':_0x292a58[_0xda9c('0x2c')]['ids'],'CampaignId':_0x292a58[_0xda9c('0x4c')]['id']}})[_0xda9c('0x1e')](function(){return _0x3f8ea2;});}})[_0xda9c('0x1e')](respondWithStatusCode(_0x5e9687,null))[_0xda9c('0x3e')](handleError(_0x5e9687,null));};
\ No newline at end of file
+var _0xbff2=['select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','model','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','catch','show','params','keys','fields','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','hasOwnProperty','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId'];(function(_0x37c02a,_0xe831f3){var _0x20c20f=function(_0x2b1aca){while(--_0x2b1aca){_0x37c02a['push'](_0x37c02a['shift']());}};_0x20c20f(++_0xe831f3);}(_0xbff2,0x9c));var _0x2bff=function(_0x187995,_0x46ac9f){_0x187995=_0x187995-0x0;var _0x12736c=_0xbff2[_0x187995];return _0x12736c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2bff('0x0'));var rimraf=require(_0x2bff('0x1'));var zipdir=require(_0x2bff('0x2'));var jsonpatch=require(_0x2bff('0x3'));var rp=require(_0x2bff('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2bff('0x5'));var util=require('util');var path=require(_0x2bff('0x6'));var sox=require(_0x2bff('0x7'));var csv=require('to-csv');var ejs=require(_0x2bff('0x8'));var fs=require('fs');var _=require(_0x2bff('0x9'));var squel=require('squel');var crypto=require(_0x2bff('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2bff('0xb'));var toCsv=require(_0x2bff('0xc'));var querystring=require(_0x2bff('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2bff('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2bff('0xf'));var config=require(_0x2bff('0x10'));var db=require(_0x2bff('0x11'))['db'];function respondWithStatusCode(_0xfeae51,_0x17d630){_0x17d630=_0x17d630||0xcc;return function(_0x524427){if(_0x524427){return _0xfeae51[_0x2bff('0x12')](_0x17d630);}return _0xfeae51[_0x2bff('0x13')](_0x17d630)[_0x2bff('0x14')]();};}function respondWithResult(_0x18ff5f,_0x3ab71e){_0x3ab71e=_0x3ab71e||0xc8;return function(_0x1f06ea){if(_0x1f06ea){return _0x18ff5f[_0x2bff('0x13')](_0x3ab71e)[_0x2bff('0x15')](_0x1f06ea);}};}function respondWithFilteredResult(_0x6521cc,_0x213fc5){return function(_0x38535c){if(_0x38535c){var _0x2aa9a9=_0x38535c['count'],_0x3f9098=_0x213fc5[_0x2bff('0x16')],_0x5723e1=_0x213fc5[_0x2bff('0x16')]+_0x213fc5[_0x2bff('0x17')],_0x3320f0;if(_0x5723e1>=_0x2aa9a9){_0x5723e1=_0x2aa9a9;_0x3320f0=0xc8;}else{_0x3320f0=0xce;}_0x6521cc['status'](_0x3320f0);return _0x6521cc[_0x2bff('0x18')](_0x2bff('0x19'),_0x3f9098+'-'+_0x5723e1+'/'+_0x2aa9a9)[_0x2bff('0x15')](_0x38535c);}return null;};}function patchUpdates(_0x2c73be){return function(_0x376dd2){try{jsonpatch['apply'](_0x376dd2,_0x2c73be,!![]);}catch(_0x2673b3){return BPromise[_0x2bff('0x1a')](_0x2673b3);}return _0x376dd2[_0x2bff('0x1b')]();};}function saveUpdates(_0x5943a2,_0x11575a){return function(_0x2be178){if(_0x2be178){return _0x2be178[_0x2bff('0x1c')](_0x5943a2)[_0x2bff('0x1d')](function(_0x31c512){return _0x31c512;});}return null;};}function removeEntity(_0x1a5ed2,_0x1a0d3f){return function(_0xa45fc3){if(_0xa45fc3){return _0xa45fc3['destroy']()[_0x2bff('0x1d')](function(){var _0x2e5d2b=_0xa45fc3[_0x2bff('0x1e')]({'plain':!![]});var _0x2bfb04=_0x2bff('0x1f');return db[_0x2bff('0x20')][_0x2bff('0x21')]({'where':{'type':_0x2bfb04,'resourceId':_0x2e5d2b['id']}})[_0x2bff('0x1d')](function(){return _0xa45fc3;});})[_0x2bff('0x1d')](function(){_0x1a5ed2[_0x2bff('0x13')](0xcc)[_0x2bff('0x14')]();});}};}function handleEntityNotFound(_0x182aa6,_0xd6ac97){return function(_0x31818d){if(!_0x31818d){_0x182aa6[_0x2bff('0x12')](0x194);}return _0x31818d;};}function handleError(_0x346171,_0x3bec94){_0x3bec94=_0x3bec94||0x1f4;return function(_0x44e0da){logger[_0x2bff('0x22')](_0x44e0da[_0x2bff('0x23')]);if(_0x44e0da[_0x2bff('0x24')]){delete _0x44e0da[_0x2bff('0x24')];}_0x346171[_0x2bff('0x13')](_0x3bec94)[_0x2bff('0x25')](_0x44e0da);};}exports[_0x2bff('0x26')]=function(_0x5060f8,_0x55fdff){var _0x39779c={},_0x445f41={},_0x2a2865={'count':0x0,'rows':[]};var _0x4b8166=_[_0x2bff('0x27')](db[_0x2bff('0x28')][_0x2bff('0x29')],function(_0x41458a){return{'name':_0x41458a[_0x2bff('0x2a')],'type':_0x41458a['type']['key']};});_0x445f41[_0x2bff('0x2b')]=_['map'](_0x4b8166,'name');_0x445f41[_0x2bff('0x2c')]=_['keys'](_0x5060f8[_0x2bff('0x2c')]);_0x445f41[_0x2bff('0x2d')]=_[_0x2bff('0x2e')](_0x445f41['model'],_0x445f41[_0x2bff('0x2c')]);_0x39779c['attributes']=_[_0x2bff('0x2e')](_0x445f41['model'],qs['fields'](_0x5060f8['query']['fields']));_0x39779c[_0x2bff('0x2f')]=_0x39779c['attributes'][_0x2bff('0x30')]?_0x39779c[_0x2bff('0x2f')]:_0x445f41['model'];if(!_0x5060f8[_0x2bff('0x2c')]['hasOwnProperty'](_0x2bff('0x31'))){_0x39779c['limit']=qs['limit'](_0x5060f8['query'][_0x2bff('0x17')]);_0x39779c[_0x2bff('0x16')]=qs[_0x2bff('0x16')](_0x5060f8[_0x2bff('0x2c')][_0x2bff('0x16')]);}_0x39779c[_0x2bff('0x32')]=qs[_0x2bff('0x33')](_0x5060f8[_0x2bff('0x2c')][_0x2bff('0x33')]);_0x39779c[_0x2bff('0x34')]=qs[_0x2bff('0x2d')](_[_0x2bff('0x35')](_0x5060f8[_0x2bff('0x2c')],_0x445f41[_0x2bff('0x2d')]),_0x4b8166);if(_0x5060f8[_0x2bff('0x2c')][_0x2bff('0x36')]){_0x39779c[_0x2bff('0x34')]=_[_0x2bff('0x37')](_0x39779c[_0x2bff('0x34')],{'$or':_[_0x2bff('0x27')](_0x4b8166,function(_0x4dca2d){if(_0x4dca2d['type']!==_0x2bff('0x38')){var _0xbc4851={};_0xbc4851[_0x4dca2d[_0x2bff('0x24')]]={'$like':'%'+_0x5060f8['query'][_0x2bff('0x36')]+'%'};return _0xbc4851;}})});}_0x39779c=_[_0x2bff('0x37')]({},_0x39779c,_0x5060f8[_0x2bff('0x39')]);var _0x5c957d={'where':_0x39779c['where']};return db[_0x2bff('0x28')]['count'](_0x5c957d)[_0x2bff('0x1d')](function(_0x12192d){_0x2a2865[_0x2bff('0x3a')]=_0x12192d;if(_0x5060f8[_0x2bff('0x2c')]['includeAll']){_0x39779c[_0x2bff('0x3b')]=[{'all':!![]}];}return db[_0x2bff('0x28')][_0x2bff('0x3c')](_0x39779c);})['then'](function(_0x5525a0){_0x2a2865['rows']=_0x5525a0;return _0x2a2865;})[_0x2bff('0x1d')](respondWithFilteredResult(_0x55fdff,_0x39779c))[_0x2bff('0x3d')](handleError(_0x55fdff,null));};exports[_0x2bff('0x3e')]=function(_0xc7c574,_0x1293ca){var _0x2ce4de={'raw':![],'where':{'id':_0xc7c574[_0x2bff('0x3f')]['id']}},_0x1d8429={};_0x1d8429[_0x2bff('0x2b')]=_['keys'](db[_0x2bff('0x28')][_0x2bff('0x29')]);_0x1d8429['query']=_[_0x2bff('0x40')](_0xc7c574[_0x2bff('0x2c')]);_0x1d8429[_0x2bff('0x2d')]=_[_0x2bff('0x2e')](_0x1d8429[_0x2bff('0x2b')],_0x1d8429['query']);_0x2ce4de[_0x2bff('0x2f')]=_['intersection'](_0x1d8429[_0x2bff('0x2b')],qs[_0x2bff('0x41')](_0xc7c574['query'][_0x2bff('0x41')]));_0x2ce4de[_0x2bff('0x2f')]=_0x2ce4de[_0x2bff('0x2f')]['length']?_0x2ce4de['attributes']:_0x1d8429[_0x2bff('0x2b')];if(_0xc7c574['query'][_0x2bff('0x42')]){_0x2ce4de[_0x2bff('0x3b')]=[{'all':!![]}];}_0x2ce4de=_[_0x2bff('0x37')]({},_0x2ce4de,_0xc7c574[_0x2bff('0x39')]);return db[_0x2bff('0x28')]['find'](_0x2ce4de)['then'](handleEntityNotFound(_0x1293ca,null))[_0x2bff('0x1d')](respondWithResult(_0x1293ca,null))[_0x2bff('0x3d')](handleError(_0x1293ca,null));};exports[_0x2bff('0x43')]=function(_0x52f6fb,_0x5709a5){return db[_0x2bff('0x28')][_0x2bff('0x43')](_0x52f6fb[_0x2bff('0x44')],{})[_0x2bff('0x1d')](function(_0x537392){var _0x195fec=_0x52f6fb['user'][_0x2bff('0x1e')]({'plain':!![]});if(!_0x195fec)throw new Error(_0x2bff('0x45'));if(_0x195fec[_0x2bff('0x46')]===_0x2bff('0x47')){var _0x848093=_0x537392['get']({'plain':!![]});var _0x2a6a21=_0x2bff('0x1f');return db[_0x2bff('0x48')]['find']({'where':{'name':_0x2a6a21,'userProfileId':_0x195fec[_0x2bff('0x49')]},'raw':!![]})[_0x2bff('0x1d')](function(_0x555eb3){if(_0x555eb3&&_0x555eb3[_0x2bff('0x4a')]===0x0){return db[_0x2bff('0x20')][_0x2bff('0x43')]({'name':_0x848093[_0x2bff('0x24')],'resourceId':_0x848093['id'],'type':_0x555eb3[_0x2bff('0x24')],'sectionId':_0x555eb3['id']},{})[_0x2bff('0x1d')](function(){return _0x537392;});}else{return _0x537392;}})[_0x2bff('0x3d')](function(_0x27c243){logger[_0x2bff('0x22')](_0x2bff('0x4b'),_0x27c243);throw _0x27c243;});}return _0x537392;})['then'](respondWithResult(_0x5709a5,0xc9))[_0x2bff('0x3d')](handleError(_0x5709a5,null));};exports['clone']=function(_0x4dbdf2,_0x5d58f8){var _0xc94b09={'where':{'id':_0x4dbdf2[_0x2bff('0x3f')]['id']}},_0x577dfd={};_0x577dfd[_0x2bff('0x2b')]=_['keys'](db[_0x2bff('0x28')][_0x2bff('0x29')]);_0xc94b09[_0x2bff('0x2f')]=_['intersection'](_0x577dfd[_0x2bff('0x2b')],qs[_0x2bff('0x41')](_0x4dbdf2[_0x2bff('0x2c')]['fields']));_0xc94b09[_0x2bff('0x2f')]=_0xc94b09[_0x2bff('0x2f')][_0x2bff('0x30')]?_0xc94b09[_0x2bff('0x2f')]:_0x577dfd[_0x2bff('0x2b')];if(_0x4dbdf2[_0x2bff('0x2c')][_0x2bff('0x42')]){_0xc94b09[_0x2bff('0x3b')]=[{'all':!![]}];}_0xc94b09=_[_0x2bff('0x37')]({},_0xc94b09,_0x4dbdf2[_0x2bff('0x39')]);return db[_0x2bff('0x28')][_0x2bff('0x4c')](_0xc94b09)[_0x2bff('0x1d')](handleEntityNotFound(_0x5d58f8,null))[_0x2bff('0x1d')](function(_0x5aeda6){if(_0x5aeda6){var _0x174684=_0x5aeda6[_0x2bff('0x1e')]({'plain':!![]});_0x174684=qs[_0x2bff('0x4d')](_0x174684,['id',_0x2bff('0x4e'),_0x2bff('0x4f')]);_0x4dbdf2[_0x2bff('0x44')]=_[_0x2bff('0x4d')](_0x4dbdf2['body'],['id','createdAt',_0x2bff('0x4f')]);return db[_0x2bff('0x28')][_0x2bff('0x43')](_[_0x2bff('0x37')](_0x174684,_0x4dbdf2['body']),{'include':_0x4dbdf2[_0x2bff('0x2c')][_0x2bff('0x42')]?[{'all':!![]}]:undefined})[_0x2bff('0x1d')](function(_0x3b1043){var _0x948463=_0x4dbdf2[_0x2bff('0x47')][_0x2bff('0x1e')]({'plain':!![]});if(!_0x948463)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x948463[_0x2bff('0x46')]===_0x2bff('0x47')){var _0x207b07=_0x3b1043[_0x2bff('0x1e')]({'plain':!![]});var _0x2eb9fe=_0x2bff('0x1f');return db['UserProfileSection']['find']({'where':{'name':_0x2eb9fe,'userProfileId':_0x948463[_0x2bff('0x49')]},'raw':!![]})[_0x2bff('0x1d')](function(_0x5636f3){if(_0x5636f3&&_0x5636f3[_0x2bff('0x4a')]===0x0){return db[_0x2bff('0x20')]['create']({'name':_0x207b07['name'],'resourceId':_0x207b07['id'],'type':_0x5636f3[_0x2bff('0x24')],'sectionId':_0x5636f3['id']},{})['then'](function(){return _0x3b1043;});}else{return _0x3b1043;}})[_0x2bff('0x3d')](function(_0x451510){logger['error'](_0x2bff('0x4b'),_0x451510);throw _0x451510;});}return _0x3b1043;});}})[_0x2bff('0x1d')](respondWithResult(_0x5d58f8,0xc9))[_0x2bff('0x3d')](handleError(_0x5d58f8,null));};exports['update']=function(_0x67c19c,_0x5ba37){if(_0x67c19c[_0x2bff('0x44')]['id']){delete _0x67c19c['body']['id'];}return db[_0x2bff('0x28')]['find']({'where':{'id':_0x67c19c[_0x2bff('0x3f')]['id']}})[_0x2bff('0x1d')](handleEntityNotFound(_0x5ba37,null))[_0x2bff('0x1d')](saveUpdates(_0x67c19c[_0x2bff('0x44')],null))['then'](respondWithResult(_0x5ba37,null))[_0x2bff('0x3d')](handleError(_0x5ba37,null));};exports['destroy']=function(_0x1d0021,_0xcfba77){return db['Campaign'][_0x2bff('0x4c')]({'where':{'id':_0x1d0021[_0x2bff('0x3f')]['id']}})[_0x2bff('0x1d')](handleEntityNotFound(_0xcfba77,null))[_0x2bff('0x1d')](removeEntity(_0xcfba77,null))[_0x2bff('0x3d')](handleError(_0xcfba77,null));};exports[_0x2bff('0x50')]=function(_0x5ea01d,_0x40fd99,_0x3c0562){var _0x55d2ca={'raw':!![],'where':{}};var _0x369830={};var _0x55c900={'count':0x0,'rows':[]};return db['Campaign'][_0x2bff('0x51')]({'where':{'id':_0x5ea01d[_0x2bff('0x3f')]['id']}})[_0x2bff('0x1d')](handleEntityNotFound(_0x40fd99,null))[_0x2bff('0x1d')](function(_0x50481d){if(_0x50481d){_0x369830['model']=_[_0x2bff('0x40')](db[_0x2bff('0x52')][_0x2bff('0x29')]);_0x369830[_0x2bff('0x2c')]=_[_0x2bff('0x40')](_0x5ea01d[_0x2bff('0x2c')]);_0x369830[_0x2bff('0x2d')]=_[_0x2bff('0x2e')](_0x369830['model'],_0x369830[_0x2bff('0x2c')]);_0x55d2ca['attributes']=_[_0x2bff('0x2e')](_0x369830['model'],qs[_0x2bff('0x41')](_0x5ea01d[_0x2bff('0x2c')][_0x2bff('0x41')]));_0x55d2ca[_0x2bff('0x2f')]=_0x55d2ca[_0x2bff('0x2f')][_0x2bff('0x30')]?_0x55d2ca['attributes']:_0x369830[_0x2bff('0x2b')];if(!_0x5ea01d[_0x2bff('0x2c')][_0x2bff('0x53')](_0x2bff('0x31'))){_0x55d2ca[_0x2bff('0x17')]=qs[_0x2bff('0x17')](_0x5ea01d[_0x2bff('0x2c')][_0x2bff('0x17')]);_0x55d2ca[_0x2bff('0x16')]=qs[_0x2bff('0x16')](_0x5ea01d[_0x2bff('0x2c')][_0x2bff('0x16')]);}_0x55d2ca['order']=qs[_0x2bff('0x33')](_0x5ea01d['query'][_0x2bff('0x33')]);_0x55d2ca[_0x2bff('0x34')]=qs[_0x2bff('0x2d')](_[_0x2bff('0x35')](_0x5ea01d['query'],_0x369830['filters']));_0x55d2ca[_0x2bff('0x34')][_0x2bff('0x54')]=_0x50481d['id'];if(_0x5ea01d['query'][_0x2bff('0x36')]){_0x55d2ca[_0x2bff('0x34')]=_['merge'](_0x55d2ca[_0x2bff('0x34')],{'$or':_['map'](_0x55d2ca[_0x2bff('0x2f')],function(_0x50a2b3){var _0x414452={};_0x414452[_0x50a2b3]={'$like':'%'+_0x5ea01d[_0x2bff('0x2c')][_0x2bff('0x36')]+'%'};return _0x414452;})});}_0x55d2ca=_[_0x2bff('0x37')]({},_0x55d2ca,_0x5ea01d[_0x2bff('0x39')]);return db[_0x2bff('0x52')][_0x2bff('0x3a')]({'where':_0x55d2ca[_0x2bff('0x34')]})[_0x2bff('0x1d')](function(_0x12143b){_0x55c900[_0x2bff('0x3a')]=_0x12143b;if(_0x5ea01d[_0x2bff('0x2c')][_0x2bff('0x42')]){_0x55d2ca[_0x2bff('0x3b')]=[{'all':!![]}];}return db[_0x2bff('0x52')]['findAll'](_0x55d2ca);})['then'](function(_0x4b616e){_0x55c900[_0x2bff('0x55')]=_0x4b616e;return _0x55c900;});}})[_0x2bff('0x1d')](respondWithFilteredResult(_0x40fd99,_0x55d2ca))[_0x2bff('0x3d')](handleError(_0x40fd99,null));};exports[_0x2bff('0x56')]=function(_0x2681e8,_0x1d393a,_0x36b55c){var _0x582b5f={'raw':!![],'where':{}};var _0x1976b0={};var _0x56e79b={'count':0x0,'rows':[]};return db[_0x2bff('0x28')][_0x2bff('0x51')]({'where':{'id':_0x2681e8['params']['id']}})['then'](handleEntityNotFound(_0x1d393a,null))['then'](function(_0x1c2d4d){if(_0x1c2d4d){_0x1976b0[_0x2bff('0x2b')]=_[_0x2bff('0x40')](db[_0x2bff('0x57')]['rawAttributes']);_0x1976b0[_0x2bff('0x2c')]=_[_0x2bff('0x40')](_0x2681e8['query']);_0x1976b0['filters']=_[_0x2bff('0x2e')](_0x1976b0['model'],_0x1976b0['query']);_0x582b5f[_0x2bff('0x2f')]=_[_0x2bff('0x2e')](_0x1976b0['model'],qs[_0x2bff('0x41')](_0x2681e8[_0x2bff('0x2c')][_0x2bff('0x41')]));_0x582b5f[_0x2bff('0x2f')]=_0x582b5f['attributes'][_0x2bff('0x30')]?_0x582b5f[_0x2bff('0x2f')]:_0x1976b0[_0x2bff('0x2b')];if(!_0x2681e8[_0x2bff('0x2c')]['hasOwnProperty'](_0x2bff('0x31'))){_0x582b5f[_0x2bff('0x17')]=qs[_0x2bff('0x17')](_0x2681e8['query']['limit']);_0x582b5f[_0x2bff('0x16')]=qs[_0x2bff('0x16')](_0x2681e8['query']['offset']);}_0x582b5f['order']=qs['sort'](_0x2681e8[_0x2bff('0x2c')][_0x2bff('0x33')]);_0x582b5f['where']=qs['filters'](_[_0x2bff('0x35')](_0x2681e8[_0x2bff('0x2c')],_0x1976b0[_0x2bff('0x2d')]));_0x582b5f[_0x2bff('0x34')]['CampaignId']=_0x1c2d4d['id'];if(_0x2681e8[_0x2bff('0x2c')][_0x2bff('0x36')]){_0x582b5f['where']=_[_0x2bff('0x37')](_0x582b5f[_0x2bff('0x34')],{'$or':_[_0x2bff('0x27')](_0x582b5f['attributes'],function(_0xd66106){var _0x2daa36={};_0x2daa36[_0xd66106]={'$like':'%'+_0x2681e8['query'][_0x2bff('0x36')]+'%'};return _0x2daa36;})});}_0x582b5f=_[_0x2bff('0x37')]({},_0x582b5f,_0x2681e8['options']);return db[_0x2bff('0x57')][_0x2bff('0x3a')]({'where':_0x582b5f[_0x2bff('0x34')]})[_0x2bff('0x1d')](function(_0x1d13c5){_0x56e79b[_0x2bff('0x3a')]=_0x1d13c5;if(_0x2681e8['query'][_0x2bff('0x42')]){_0x582b5f[_0x2bff('0x3b')]=[{'all':!![]}];}return db[_0x2bff('0x57')]['findAll'](_0x582b5f);})['then'](function(_0x4606a2){_0x56e79b[_0x2bff('0x55')]=_0x4606a2;return _0x56e79b;});}})[_0x2bff('0x1d')](respondWithFilteredResult(_0x1d393a,_0x582b5f))[_0x2bff('0x3d')](handleError(_0x1d393a,null));};exports[_0x2bff('0x58')]=function(_0x3449cf,_0x361e7d,_0x484517){var _0x67fd8c={'raw':!![],'where':{}};var _0x5edd34={};var _0x4081e0={'count':0x0,'rows':[]};return db[_0x2bff('0x28')][_0x2bff('0x51')]({'where':{'id':_0x3449cf[_0x2bff('0x3f')]['id']}})[_0x2bff('0x1d')](handleEntityNotFound(_0x361e7d,null))[_0x2bff('0x1d')](function(_0x4f6b47){if(_0x4f6b47){_0x5edd34[_0x2bff('0x2b')]=_[_0x2bff('0x40')](db[_0x2bff('0x59')][_0x2bff('0x29')]);_0x5edd34['query']=_['keys'](_0x3449cf['query']);_0x5edd34[_0x2bff('0x2d')]=_[_0x2bff('0x2e')](_0x5edd34[_0x2bff('0x2b')],_0x5edd34['query']);_0x67fd8c[_0x2bff('0x2f')]=_[_0x2bff('0x2e')](_0x5edd34[_0x2bff('0x2b')],qs['fields'](_0x3449cf['query'][_0x2bff('0x41')]));_0x67fd8c[_0x2bff('0x2f')]=_0x67fd8c[_0x2bff('0x2f')][_0x2bff('0x30')]?_0x67fd8c[_0x2bff('0x2f')]:_0x5edd34[_0x2bff('0x2b')];if(!_0x3449cf['query'][_0x2bff('0x53')](_0x2bff('0x31'))){_0x67fd8c[_0x2bff('0x17')]=qs['limit'](_0x3449cf['query'][_0x2bff('0x17')]);_0x67fd8c[_0x2bff('0x16')]=qs[_0x2bff('0x16')](_0x3449cf[_0x2bff('0x2c')][_0x2bff('0x16')]);}_0x67fd8c['order']=qs[_0x2bff('0x33')](_0x3449cf[_0x2bff('0x2c')][_0x2bff('0x33')]);_0x67fd8c['where']=qs[_0x2bff('0x2d')](_[_0x2bff('0x35')](_0x3449cf[_0x2bff('0x2c')],_0x5edd34['filters']));_0x67fd8c[_0x2bff('0x34')][_0x2bff('0x54')]=_0x4f6b47['id'];if(_0x3449cf['query'][_0x2bff('0x36')]){_0x67fd8c[_0x2bff('0x34')]=_[_0x2bff('0x37')](_0x67fd8c['where'],{'$or':_[_0x2bff('0x27')](_0x67fd8c[_0x2bff('0x2f')],function(_0x29d0d8){var _0x53b2d6={};_0x53b2d6[_0x29d0d8]={'$like':'%'+_0x3449cf[_0x2bff('0x2c')][_0x2bff('0x36')]+'%'};return _0x53b2d6;})});}_0x67fd8c=_[_0x2bff('0x37')]({},_0x67fd8c,_0x3449cf[_0x2bff('0x39')]);return db[_0x2bff('0x59')][_0x2bff('0x3a')]({'where':_0x67fd8c[_0x2bff('0x34')]})[_0x2bff('0x1d')](function(_0x134657){_0x4081e0['count']=_0x134657;if(_0x3449cf[_0x2bff('0x2c')][_0x2bff('0x42')]){_0x67fd8c['include']=[{'all':!![]}];}return db[_0x2bff('0x59')][_0x2bff('0x3c')](_0x67fd8c);})[_0x2bff('0x1d')](function(_0x49e97c){_0x4081e0['rows']=_0x49e97c;return _0x4081e0;});}})[_0x2bff('0x1d')](respondWithFilteredResult(_0x361e7d,_0x67fd8c))[_0x2bff('0x3d')](handleError(_0x361e7d,null));};exports[_0x2bff('0x5a')]=function(_0x3bcc0d,_0x1ee6dd,_0x4765d1){var _0x5a72af={'raw':!![],'where':{}};var _0x276733={};var _0x10827a={'count':0x0,'rows':[]};return db['Campaign'][_0x2bff('0x51')]({'where':{'id':_0x3bcc0d[_0x2bff('0x3f')]['id']}})[_0x2bff('0x1d')](handleEntityNotFound(_0x1ee6dd,null))['then'](function(_0x57af68){if(_0x57af68){_0x276733[_0x2bff('0x2b')]=_[_0x2bff('0x40')](db['CmHopperBlack'][_0x2bff('0x29')]);_0x276733[_0x2bff('0x2c')]=_[_0x2bff('0x40')](_0x3bcc0d[_0x2bff('0x2c')]);_0x276733[_0x2bff('0x2d')]=_[_0x2bff('0x2e')](_0x276733[_0x2bff('0x2b')],_0x276733[_0x2bff('0x2c')]);_0x5a72af['attributes']=_[_0x2bff('0x2e')](_0x276733[_0x2bff('0x2b')],qs[_0x2bff('0x41')](_0x3bcc0d['query'][_0x2bff('0x41')]));_0x5a72af[_0x2bff('0x2f')]=_0x5a72af[_0x2bff('0x2f')][_0x2bff('0x30')]?_0x5a72af['attributes']:_0x276733[_0x2bff('0x2b')];if(!_0x3bcc0d[_0x2bff('0x2c')]['hasOwnProperty'](_0x2bff('0x31'))){_0x5a72af[_0x2bff('0x17')]=qs[_0x2bff('0x17')](_0x3bcc0d['query'][_0x2bff('0x17')]);_0x5a72af[_0x2bff('0x16')]=qs['offset'](_0x3bcc0d[_0x2bff('0x2c')][_0x2bff('0x16')]);}_0x5a72af[_0x2bff('0x32')]=qs[_0x2bff('0x33')](_0x3bcc0d[_0x2bff('0x2c')][_0x2bff('0x33')]);_0x5a72af['where']=qs['filters'](_[_0x2bff('0x35')](_0x3bcc0d[_0x2bff('0x2c')],_0x276733[_0x2bff('0x2d')]));_0x5a72af[_0x2bff('0x34')]['CampaignId']=_0x57af68['id'];if(_0x3bcc0d[_0x2bff('0x2c')][_0x2bff('0x36')]){_0x5a72af[_0x2bff('0x34')]=_[_0x2bff('0x37')](_0x5a72af[_0x2bff('0x34')],{'$or':_[_0x2bff('0x27')](_0x5a72af[_0x2bff('0x2f')],function(_0x22e228){var _0xbe0ba={};_0xbe0ba[_0x22e228]={'$like':'%'+_0x3bcc0d['query'][_0x2bff('0x36')]+'%'};return _0xbe0ba;})});}_0x5a72af=_['merge']({},_0x5a72af,_0x3bcc0d['options']);return db[_0x2bff('0x5b')][_0x2bff('0x3a')]({'where':_0x5a72af['where']})[_0x2bff('0x1d')](function(_0xd1f329){_0x10827a[_0x2bff('0x3a')]=_0xd1f329;if(_0x3bcc0d[_0x2bff('0x2c')][_0x2bff('0x42')]){_0x5a72af[_0x2bff('0x3b')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x5a72af);})[_0x2bff('0x1d')](function(_0x243940){_0x10827a[_0x2bff('0x55')]=_0x243940;return _0x10827a;});}})[_0x2bff('0x1d')](respondWithFilteredResult(_0x1ee6dd,_0x5a72af))[_0x2bff('0x3d')](handleError(_0x1ee6dd,null));};exports[_0x2bff('0x5c')]=function(_0x2e133f,_0x185a0a,_0x589505){var _0x562da4={};var _0x5af8e7={};var _0x48308a;var _0x452ba9;return db['Campaign'][_0x2bff('0x51')]({'where':{'id':_0x2e133f[_0x2bff('0x3f')]['id']}})[_0x2bff('0x1d')](handleEntityNotFound(_0x185a0a,null))[_0x2bff('0x1d')](function(_0x3af0a2){if(_0x3af0a2){_0x48308a=_0x3af0a2;_0x5af8e7[_0x2bff('0x2b')]=_['keys'](db[_0x2bff('0x5d')][_0x2bff('0x29')]);_0x5af8e7[_0x2bff('0x2c')]=_[_0x2bff('0x40')](_0x2e133f[_0x2bff('0x2c')]);_0x5af8e7[_0x2bff('0x2d')]=_[_0x2bff('0x2e')](_0x5af8e7[_0x2bff('0x2b')],_0x5af8e7[_0x2bff('0x2c')]);_0x562da4[_0x2bff('0x2f')]=_[_0x2bff('0x2e')](_0x5af8e7[_0x2bff('0x2b')],qs['fields'](_0x2e133f['query']['fields']));_0x562da4[_0x2bff('0x2f')]=_0x562da4['attributes'][_0x2bff('0x30')]?_0x562da4[_0x2bff('0x2f')]:_0x5af8e7[_0x2bff('0x2b')];_0x562da4[_0x2bff('0x32')]=qs['sort'](_0x2e133f[_0x2bff('0x2c')]['sort']);_0x562da4[_0x2bff('0x34')]=qs[_0x2bff('0x2d')](_[_0x2bff('0x35')](_0x2e133f[_0x2bff('0x2c')],_0x5af8e7[_0x2bff('0x2d')]));if(_0x2e133f[_0x2bff('0x2c')][_0x2bff('0x36')]){_0x562da4['where']=_['merge'](_0x562da4[_0x2bff('0x34')],{'$or':_[_0x2bff('0x27')](_0x562da4[_0x2bff('0x2f')],function(_0x474135){var _0x431d11={};_0x431d11[_0x474135]={'$like':'%'+_0x2e133f['query']['filter']+'%'};return _0x431d11;})});}_0x562da4=_[_0x2bff('0x37')]({},_0x562da4,_0x2e133f[_0x2bff('0x39')]);return _0x48308a[_0x2bff('0x5c')](_0x562da4);}})[_0x2bff('0x1d')](function(_0x7050fb){if(_0x7050fb){_0x452ba9=_0x7050fb['length'];if(!_0x2e133f[_0x2bff('0x2c')][_0x2bff('0x53')]('nolimit')){_0x562da4[_0x2bff('0x17')]=qs[_0x2bff('0x17')](_0x2e133f[_0x2bff('0x2c')][_0x2bff('0x17')]);_0x562da4['offset']=qs[_0x2bff('0x16')](_0x2e133f[_0x2bff('0x2c')][_0x2bff('0x16')]);}return _0x48308a[_0x2bff('0x5c')](_0x562da4);}})[_0x2bff('0x1d')](function(_0x21d2f8){if(_0x21d2f8){return _0x21d2f8?{'count':_0x452ba9,'rows':_0x21d2f8}:null;}})['then'](respondWithResult(_0x185a0a,null))[_0x2bff('0x3d')](handleError(_0x185a0a,null));};exports[_0x2bff('0x5e')]=function(_0x26a3fd,_0x450fe8,_0x470555){var _0x25fd76,_0x156096;return db[_0x2bff('0x28')]['find']({'where':{'id':_0x26a3fd[_0x2bff('0x3f')]['id']}})[_0x2bff('0x1d')](handleEntityNotFound(_0x450fe8,null))[_0x2bff('0x1d')](function(_0x3b352a){if(_0x3b352a){_0x156096=_0x3b352a;return _0x3b352a[_0x2bff('0x5e')](_0x26a3fd[_0x2bff('0x44')][_0x2bff('0x5f')],_[_0x2bff('0x4d')](_0x26a3fd[_0x2bff('0x44')],[_0x2bff('0x5f'),'id'])||{});}return null;})[_0x2bff('0x60')](function(_0x30dc43){var _0xca5094;_0x25fd76=_0x30dc43||[];var _0x325630=[];if(_0x30dc43){for(var _0x5f5c94=0x0;_0x5f5c94<_0x30dc43[_0x2bff('0x30')];_0x5f5c94+=0x1){var _0x453795=_0x30dc43[_0x5f5c94][_0x2bff('0x1e')]({'plain':!![]});_0x156096[_0x2bff('0x61')]=_0x26a3fd[_0x2bff('0x44')]['dialCheckDuplicateType']?_0x26a3fd[_0x2bff('0x44')][_0x2bff('0x61')]:_0x156096['dialCheckDuplicateType'];switch(_0x156096[_0x2bff('0x61')]){case _0x2bff('0x62'):_0xca5094=squel[_0x2bff('0x63')]()['into'](_0x2bff('0x64'))[_0x2bff('0x65')]([_0x2bff('0x66'),_0x2bff('0x67'),_0x2bff('0x68'),_0x2bff('0x69'),_0x2bff('0x54'),_0x2bff('0x4e'),_0x2bff('0x4f')],squel[_0x2bff('0x6a')]()['field'](_0x2bff('0x66'),_0x2bff('0x66'))[_0x2bff('0x6b')](_0x2bff('0x6c'),'scheduledAt')['field']('id','ContactId')[_0x2bff('0x6b')](_0x453795[_0x2bff('0x6d')][_0x2bff('0x6e')](),'ListId')['field'](_0x26a3fd[_0x2bff('0x3f')]['id'][_0x2bff('0x6e')](),_0x2bff('0x54'))[_0x2bff('0x6b')]('NOW()',_0x2bff('0x4e'))[_0x2bff('0x6b')]('NOW()','updatedAt')[_0x2bff('0x6f')](_0x2bff('0x70'))['where'](_0x2bff('0x71'))[_0x2bff('0x34')]('ListId\x20=\x20?',_0x453795[_0x2bff('0x6d')][_0x2bff('0x6e')]())[_0x2bff('0x34')](_0x2bff('0x72'))[_0x2bff('0x34')](_0x2bff('0x73'),squel[_0x2bff('0x6a')]()[_0x2bff('0x6b')](_0x2bff('0x74'))['from'](_0x2bff('0x75'))[_0x2bff('0x34')](_0x2bff('0x76'),_0x26a3fd[_0x2bff('0x3f')]['id'][_0x2bff('0x6e')]()))[_0x2bff('0x34')](_0x2bff('0x73'),squel[_0x2bff('0x6a')]()[_0x2bff('0x6b')](_0x2bff('0x77'))[_0x2bff('0x6f')](_0x2bff('0x64'))[_0x2bff('0x34')](_0x2bff('0x76'),_0x26a3fd[_0x2bff('0x3f')]['id'][_0x2bff('0x6e')]())))[_0x2bff('0x6e')]();break;case _0x2bff('0x78'):_0xca5094=squel[_0x2bff('0x63')]()[_0x2bff('0x79')]('cm_hopper')[_0x2bff('0x65')](['phone',_0x2bff('0x67'),_0x2bff('0x68'),_0x2bff('0x69'),_0x2bff('0x54'),_0x2bff('0x4e'),_0x2bff('0x4f')],squel[_0x2bff('0x6a')]()[_0x2bff('0x6b')]('phone',_0x2bff('0x66'))['field'](_0x2bff('0x6c'),_0x2bff('0x67'))[_0x2bff('0x6b')]('id',_0x2bff('0x68'))['field'](_0x453795[_0x2bff('0x6d')][_0x2bff('0x6e')](),_0x2bff('0x69'))['field'](_0x26a3fd[_0x2bff('0x3f')]['id'][_0x2bff('0x6e')](),_0x2bff('0x54'))[_0x2bff('0x6b')](_0x2bff('0x6c'),'createdAt')[_0x2bff('0x6b')](_0x2bff('0x6c'),_0x2bff('0x4f'))[_0x2bff('0x6f')](_0x2bff('0x70'))[_0x2bff('0x34')](_0x2bff('0x71'))[_0x2bff('0x34')](_0x2bff('0x7a'),_0x453795[_0x2bff('0x6d')]['toString']())[_0x2bff('0x34')](_0x2bff('0x72'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x2bff('0x6a')]()[_0x2bff('0x6b')](_0x2bff('0x77'))[_0x2bff('0x6f')](_0x2bff('0x64'))[_0x2bff('0x34')](_0x2bff('0x76'),_0x26a3fd[_0x2bff('0x3f')]['id'][_0x2bff('0x6e')]())))['toString']();break;default:_0xca5094=squel['insert']()[_0x2bff('0x79')]('cm_hopper')[_0x2bff('0x65')](['phone',_0x2bff('0x67'),_0x2bff('0x68'),_0x2bff('0x69'),_0x2bff('0x54'),'createdAt',_0x2bff('0x4f')],squel[_0x2bff('0x6a')]()[_0x2bff('0x6b')](_0x2bff('0x66'),'phone')[_0x2bff('0x6b')](_0x2bff('0x6c'),_0x2bff('0x67'))[_0x2bff('0x6b')]('id','ContactId')['field'](_0x453795[_0x2bff('0x6d')]['toString'](),_0x2bff('0x69'))[_0x2bff('0x6b')](_0x26a3fd[_0x2bff('0x3f')]['id'][_0x2bff('0x6e')](),_0x2bff('0x54'))[_0x2bff('0x6b')]('NOW()','createdAt')[_0x2bff('0x6b')](_0x2bff('0x6c'),'updatedAt')[_0x2bff('0x6f')](_0x2bff('0x70'))['where']('deletedAt\x20IS\x20NULL')[_0x2bff('0x34')]('ListId\x20=\x20?',_0x453795[_0x2bff('0x6d')][_0x2bff('0x6e')]())[_0x2bff('0x34')](_0x2bff('0x72')))['toString']();}_0x325630[_0x2bff('0x7b')](db[_0x2bff('0x7c')][_0x2bff('0x2c')](_0xca5094));}return BPromise[_0x2bff('0x7d')](_0x325630);}})[_0x2bff('0x1d')](function(){return _0x25fd76;})[_0x2bff('0x1d')](respondWithResult(_0x450fe8,null))['catch'](handleError(_0x450fe8,null));};exports[_0x2bff('0x7e')]=function(_0x4c7e4e,_0x3f9969,_0x9ce6){return db[_0x2bff('0x28')][_0x2bff('0x4c')]({'where':{'id':_0x4c7e4e[_0x2bff('0x3f')]['id']}})[_0x2bff('0x1d')](handleEntityNotFound(_0x3f9969,null))['then'](function(_0x3ab962){if(_0x3ab962){return _0x3ab962[_0x2bff('0x7e')](_0x4c7e4e[_0x2bff('0x2c')][_0x2bff('0x5f')]);}})['then'](function(_0x48cb8f){if(_0x48cb8f){return db[_0x2bff('0x52')][_0x2bff('0x21')]({'where':{'ListId':_0x4c7e4e['query'][_0x2bff('0x5f')],'CampaignId':_0x4c7e4e[_0x2bff('0x3f')]['id']}})[_0x2bff('0x1d')](function(){return _0x48cb8f;});}})[_0x2bff('0x1d')](respondWithStatusCode(_0x3f9969,null))['catch'](handleError(_0x3f9969,null));};exports[_0x2bff('0x7f')]=function(_0x3ea51f,_0x37a37f,_0x5cb067){var _0x2a83fc={'raw':!![],'where':{}};var _0x432be7={};var _0x101aa3={'count':0x0,'rows':[]};return db[_0x2bff('0x28')][_0x2bff('0x51')]({'where':{'id':_0x3ea51f[_0x2bff('0x3f')]['id']}})[_0x2bff('0x1d')](handleEntityNotFound(_0x37a37f,null))[_0x2bff('0x1d')](function(_0x39c4ec){if(_0x39c4ec){_0x432be7[_0x2bff('0x2b')]=_[_0x2bff('0x40')](db[_0x2bff('0x5d')]['rawAttributes']);_0x432be7[_0x2bff('0x2c')]=_[_0x2bff('0x40')](_0x3ea51f[_0x2bff('0x2c')]);_0x432be7[_0x2bff('0x2d')]=_[_0x2bff('0x2e')](_0x432be7[_0x2bff('0x2b')],_0x432be7[_0x2bff('0x2c')]);_0x2a83fc[_0x2bff('0x2f')]=_['intersection'](_0x432be7[_0x2bff('0x2b')],qs[_0x2bff('0x41')](_0x3ea51f[_0x2bff('0x2c')][_0x2bff('0x41')]));_0x2a83fc[_0x2bff('0x2f')]=_0x2a83fc[_0x2bff('0x2f')]['length']?_0x2a83fc[_0x2bff('0x2f')]:_0x432be7[_0x2bff('0x2b')];if(!_0x3ea51f['query'][_0x2bff('0x53')](_0x2bff('0x31'))){_0x2a83fc['limit']=qs['limit'](_0x3ea51f[_0x2bff('0x2c')]['limit']);_0x2a83fc['offset']=qs['offset'](_0x3ea51f['query'][_0x2bff('0x16')]);}_0x2a83fc['order']=qs[_0x2bff('0x33')](_0x3ea51f[_0x2bff('0x2c')][_0x2bff('0x33')]);_0x2a83fc[_0x2bff('0x34')]=qs[_0x2bff('0x2d')](_[_0x2bff('0x35')](_0x3ea51f[_0x2bff('0x2c')],_0x432be7[_0x2bff('0x2d')]));_0x2a83fc[_0x2bff('0x34')]['CampaignId']=_0x39c4ec['id'];if(_0x3ea51f[_0x2bff('0x2c')]['filter']){_0x2a83fc['where']=_['merge'](_0x2a83fc[_0x2bff('0x34')],{'$or':_['map'](_0x2a83fc[_0x2bff('0x2f')],function(_0x28971f){var _0x1a86d3={};_0x1a86d3[_0x28971f]={'$like':'%'+_0x3ea51f[_0x2bff('0x2c')][_0x2bff('0x36')]+'%'};return _0x1a86d3;})});}_0x2a83fc=_[_0x2bff('0x37')]({},_0x2a83fc,_0x3ea51f['options']);return db['CmList'][_0x2bff('0x3a')]({'where':_0x2a83fc[_0x2bff('0x34')]})[_0x2bff('0x1d')](function(_0x5f2255){_0x101aa3[_0x2bff('0x3a')]=_0x5f2255;if(_0x3ea51f[_0x2bff('0x2c')][_0x2bff('0x42')]){_0x2a83fc[_0x2bff('0x3b')]=[{'all':!![]}];}return db[_0x2bff('0x5d')][_0x2bff('0x3c')](_0x2a83fc);})[_0x2bff('0x1d')](function(_0x1608a1){_0x101aa3[_0x2bff('0x55')]=_0x1608a1;return _0x101aa3;});}})[_0x2bff('0x1d')](respondWithFilteredResult(_0x37a37f,_0x2a83fc))[_0x2bff('0x3d')](handleError(_0x37a37f,null));};exports[_0x2bff('0x80')]=function(_0x2ab50f,_0x39bc49,_0x336ede){var _0x8be6e1,_0x8fb70c;return db[_0x2bff('0x28')][_0x2bff('0x4c')]({'where':{'id':_0x2ab50f[_0x2bff('0x3f')]['id']}})[_0x2bff('0x1d')](handleEntityNotFound(_0x39bc49,null))[_0x2bff('0x1d')](function(_0x446f56){if(_0x446f56){_0x8fb70c=_0x446f56;return _0x446f56[_0x2bff('0x80')](_0x2ab50f[_0x2bff('0x44')][_0x2bff('0x5f')],_[_0x2bff('0x4d')](_0x2ab50f['body'],[_0x2bff('0x5f'),'id'])||{});}return null;})[_0x2bff('0x60')](function(_0x3a04ba){var _0x29afde;_0x8be6e1=_0x3a04ba||[];var _0x3e8035=[];if(_0x3a04ba){for(var _0x2389a3=0x0;_0x2389a3<_0x3a04ba['length'];_0x2389a3+=0x1){var _0x2e1363=_0x3a04ba[_0x2389a3][_0x2bff('0x1e')]({'plain':!![]});_0x29afde=squel['insert']()[_0x2bff('0x79')](_0x2bff('0x81'))[_0x2bff('0x65')]([_0x2bff('0x66'),_0x2bff('0x68'),_0x2bff('0x69'),'CampaignId','createdAt',_0x2bff('0x4f')],squel[_0x2bff('0x6a')]()[_0x2bff('0x6b')]('phone',_0x2bff('0x66'))[_0x2bff('0x6b')]('id',_0x2bff('0x68'))[_0x2bff('0x6b')](_0x2e1363['CmListId'][_0x2bff('0x6e')](),_0x2bff('0x69'))[_0x2bff('0x6b')](_0x2ab50f[_0x2bff('0x3f')]['id'][_0x2bff('0x6e')](),_0x2bff('0x54'))[_0x2bff('0x6b')](_0x2bff('0x6c'),_0x2bff('0x4e'))[_0x2bff('0x6b')]('NOW()',_0x2bff('0x4f'))[_0x2bff('0x6f')](_0x2bff('0x70'))[_0x2bff('0x34')](_0x2bff('0x71'))[_0x2bff('0x34')]('ListId\x20=\x20?',_0x2e1363[_0x2bff('0x6d')][_0x2bff('0x6e')]())[_0x2bff('0x34')]('phone\x20IS\x20NOT\x20NULL'))[_0x2bff('0x6e')]();_0x3e8035[_0x2bff('0x7b')](db[_0x2bff('0x7c')]['query'](_0x29afde));}return BPromise[_0x2bff('0x7d')](_0x3e8035);}})[_0x2bff('0x1d')](function(){return _0x8be6e1;})['then'](respondWithResult(_0x39bc49,null))['catch'](handleError(_0x39bc49,null));};exports[_0x2bff('0x82')]=function(_0x4e7f94,_0x54c224,_0x202286){return db[_0x2bff('0x28')]['find']({'where':{'id':_0x4e7f94['params']['id']}})[_0x2bff('0x1d')](handleEntityNotFound(_0x54c224,null))[_0x2bff('0x1d')](function(_0x4c3e32){if(_0x4c3e32){return _0x4c3e32[_0x2bff('0x82')](_0x4e7f94[_0x2bff('0x2c')][_0x2bff('0x5f')]);}})[_0x2bff('0x1d')](function(_0x4b8107){if(_0x4b8107){return db['CmHopperBlack'][_0x2bff('0x21')]({'where':{'ListId':_0x4e7f94[_0x2bff('0x2c')][_0x2bff('0x5f')],'CampaignId':_0x4e7f94[_0x2bff('0x3f')]['id']}})[_0x2bff('0x1d')](function(){return _0x4b8107;});}})['then'](respondWithStatusCode(_0x54c224,null))[_0x2bff('0x3d')](handleError(_0x54c224,null));};
\ No newline at end of file
index fe7ed2a..3d74aab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./campaign.attributes','exports','define','Campaign','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3c849d,_0x3468b3){var _0x2c95ad=function(_0x5b8ee5){while(--_0x5b8ee5){_0x3c849d['push'](_0x3c849d['shift']());}};_0x2c95ad(++_0x3468b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./campaign.attributes','exports','define','Campaign','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x9ad29e,_0x7b830b){var _0x4e18c5=function(_0x558174){while(--_0x558174){_0x9ad29e['push'](_0x9ad29e['shift']());}};_0x4e18c5(++_0x7b830b);}(_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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 943ba84..0728ab9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3263f0,_0x2d5d22){var _0x367b6f=function(_0xd86d6c){while(--_0xd86d6c){_0x3263f0['push'](_0x3263f0['shift']());}};_0x367b6f(++_0x2d5d22);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});};
\ No newline at end of file
+var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x6f723e,_0x136bd0){var _0x2afaa1=function(_0x5134be){while(--_0x5134be){_0x6f723e['push'](_0x6f723e['shift']());}};_0x2afaa1(++_0x136bd0);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});};
\ No newline at end of file
index d2a1d3a..404f35a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x377c=['getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','create','/:id/clone','clone','/:id/lists','addLists','post','addBlackLists','put','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x377c,0xb0));var _0xc377=function(_0x21cefb,_0x12aa66){_0x21cefb=_0x21cefb-0x0;var _0x1a7dc6=_0x377c[_0x21cefb];return _0x1a7dc6;};'use strict';var multer=require(_0xc377('0x0'));var util=require(_0xc377('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc377('0x2'));var router=express[_0xc377('0x3')]();var auth=require(_0xc377('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc377('0x5'));var controller=require(_0xc377('0x6'));router[_0xc377('0x7')]('/',auth['isAuthenticated'](),controller[_0xc377('0x8')]);router[_0xc377('0x7')](_0xc377('0x9'),auth[_0xc377('0xa')](),controller[_0xc377('0xb')]);router[_0xc377('0x7')]('/:id/hoppers',auth[_0xc377('0xa')](),controller[_0xc377('0xc')]);router[_0xc377('0x7')](_0xc377('0xd'),auth['isAuthenticated'](),controller[_0xc377('0xe')]);router['get'](_0xc377('0xf'),auth[_0xc377('0xa')](),controller[_0xc377('0x10')]);router['get']('/:id/hopper_black',auth[_0xc377('0xa')](),controller[_0xc377('0x11')]);router[_0xc377('0x7')]('/:id/lists',auth['isAuthenticated'](),controller[_0xc377('0x12')]);router[_0xc377('0x7')](_0xc377('0x13'),auth[_0xc377('0xa')](),controller[_0xc377('0x14')]);router['post']('/',auth[_0xc377('0xa')](),controller[_0xc377('0x15')]);router['post'](_0xc377('0x16'),auth[_0xc377('0xa')](),controller[_0xc377('0x17')]);router['post'](_0xc377('0x18'),auth['isAuthenticated'](),controller[_0xc377('0x19')]);router[_0xc377('0x1a')](_0xc377('0x13'),auth[_0xc377('0xa')](),controller[_0xc377('0x1b')]);router[_0xc377('0x1c')]('/:id',auth[_0xc377('0xa')](),controller['update']);router[_0xc377('0x1d')](_0xc377('0x9'),auth['isAuthenticated'](),controller[_0xc377('0x1e')]);router[_0xc377('0x1d')]('/:id/lists',auth['isAuthenticated'](),controller['removeLists']);router[_0xc377('0x1d')](_0xc377('0x13'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xc377('0x1f')]=router;
\ No newline at end of file
+var _0xaae7=['removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','put','update','delete','destroy'];(function(_0x5e7825,_0x481405){var _0x45b25e=function(_0x5d2bb5){while(--_0x5d2bb5){_0x5e7825['push'](_0x5e7825['shift']());}};_0x45b25e(++_0x481405);}(_0xaae7,0xa8));var _0x7aae=function(_0x2c1e97,_0x4943ba){_0x2c1e97=_0x2c1e97-0x0;var _0x4d2a21=_0xaae7[_0x2c1e97];return _0x4d2a21;};'use strict';var multer=require(_0x7aae('0x0'));var util=require(_0x7aae('0x1'));var path=require(_0x7aae('0x2'));var timeout=require(_0x7aae('0x3'));var express=require(_0x7aae('0x4'));var router=express[_0x7aae('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7aae('0x6'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x7aae('0x7')]('/',auth[_0x7aae('0x8')](),controller[_0x7aae('0x9')]);router[_0x7aae('0x7')](_0x7aae('0xa'),auth[_0x7aae('0x8')](),controller[_0x7aae('0xb')]);router[_0x7aae('0x7')](_0x7aae('0xc'),auth['isAuthenticated'](),controller[_0x7aae('0xd')]);router['get'](_0x7aae('0xe'),auth['isAuthenticated'](),controller[_0x7aae('0xf')]);router[_0x7aae('0x7')](_0x7aae('0x10'),auth[_0x7aae('0x8')](),controller['getHopperFinals']);router[_0x7aae('0x7')](_0x7aae('0x11'),auth[_0x7aae('0x8')](),controller['getHopperBlacks']);router[_0x7aae('0x7')](_0x7aae('0x12'),auth[_0x7aae('0x8')](),controller[_0x7aae('0x13')]);router[_0x7aae('0x7')](_0x7aae('0x14'),auth[_0x7aae('0x8')](),controller[_0x7aae('0x15')]);router[_0x7aae('0x16')]('/',auth[_0x7aae('0x8')](),controller['create']);router[_0x7aae('0x16')](_0x7aae('0x17'),auth['isAuthenticated'](),controller[_0x7aae('0x18')]);router[_0x7aae('0x16')](_0x7aae('0x12'),auth[_0x7aae('0x8')](),controller[_0x7aae('0x19')]);router[_0x7aae('0x16')](_0x7aae('0x14'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0x7aae('0x1a')](_0x7aae('0xa'),auth[_0x7aae('0x8')](),controller[_0x7aae('0x1b')]);router[_0x7aae('0x1c')](_0x7aae('0xa'),auth[_0x7aae('0x8')](),controller[_0x7aae('0x1d')]);router[_0x7aae('0x1c')](_0x7aae('0x12'),auth[_0x7aae('0x8')](),controller[_0x7aae('0x1e')]);router[_0x7aae('0x1c')](_0x7aae('0x14'),auth[_0x7aae('0x8')](),controller[_0x7aae('0x1f')]);module[_0x7aae('0x20')]=router;
\ No newline at end of file
index a7f91d6..b09514b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe263=['sequelize','exports','TEXT','STRING','key'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xe263,0x140));var _0x3e26=function(_0x2a437d,_0x22ff24){_0x2a437d=_0x2a437d-0x0;var _0x5186f6=_0xe263[_0x2a437d];return _0x5186f6;};'use strict';var Sequelize=require(_0x3e26('0x0'));module[_0x3e26('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3e26('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3e26('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x3e26('0x4'));}}};
\ No newline at end of file
+var _0x08ad=['exports','TEXT','STRING','VIRTUAL','getDataValue','sequelize'];(function(_0x4c4a4f,_0x521641){var _0x4a891c=function(_0x26a6d7){while(--_0x26a6d7){_0x4c4a4f['push'](_0x4c4a4f['shift']());}};_0x4a891c(++_0x521641);}(_0x08ad,0xcb));var _0xd08a=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x08ad[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0xd08a('0x0'));module[_0xd08a('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xd08a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd08a('0x3')]},'name':{'type':Sequelize[_0xd08a('0x4')],'get':function(){return this[_0xd08a('0x5')]('key');}}};
\ No newline at end of file
index b5ddd5f..51c6c22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc464=['Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','CannedAnswers','error','stack','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','includeAll','rows','show','params','include','options','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xc464,0xba));var _0x4c46=function(_0xaaea1c,_0x606874){_0xaaea1c=_0xaaea1c-0x0;var _0x4cfd49=_0xc464[_0xaaea1c];return _0x4cfd49;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4c46('0x0'));var rimraf=require(_0x4c46('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c46('0x2'));var rp=require(_0x4c46('0x3'));var moment=require(_0x4c46('0x4'));var BPromise=require(_0x4c46('0x5'));var Mustache=require(_0x4c46('0x6'));var util=require(_0x4c46('0x7'));var path=require(_0x4c46('0x8'));var sox=require('sox');var csv=require(_0x4c46('0x9'));var ejs=require(_0x4c46('0xa'));var fs=require('fs');var _=require(_0x4c46('0xb'));var squel=require(_0x4c46('0xc'));var crypto=require(_0x4c46('0xd'));var jsforce=require(_0x4c46('0xe'));var deskjs=require(_0x4c46('0xf'));var toCsv=require(_0x4c46('0x9'));var querystring=require('querystring');var Papa=require(_0x4c46('0x10'));var Redis=require('ioredis');var authService=require(_0x4c46('0x11'));var qs=require(_0x4c46('0x12'));var as=require(_0x4c46('0x13'));var hardwareService=require(_0x4c46('0x14'));var logger=require('../../config/logger')(_0x4c46('0x15'));var utils=require(_0x4c46('0x16'));var config=require('../../config/environment');var db=require(_0x4c46('0x17'))['db'];function respondWithStatusCode(_0x215d3d,_0x3f6104){_0x3f6104=_0x3f6104||0xcc;return function(_0x2b7e44){if(_0x2b7e44){return _0x215d3d[_0x4c46('0x18')](_0x3f6104);}return _0x215d3d['status'](_0x3f6104)[_0x4c46('0x19')]();};}function respondWithResult(_0x55884c,_0x1bfa24){_0x1bfa24=_0x1bfa24||0xc8;return function(_0x40a65a){if(_0x40a65a){return _0x55884c[_0x4c46('0x1a')](_0x1bfa24)[_0x4c46('0x1b')](_0x40a65a);}};}function respondWithFilteredResult(_0x10b4cf,_0x190651){return function(_0x3c1d0e){if(_0x3c1d0e){var _0x512a12=_0x3c1d0e[_0x4c46('0x1c')],_0x5bb9ab=_0x190651[_0x4c46('0x1d')],_0x54437d=_0x190651[_0x4c46('0x1d')]+_0x190651[_0x4c46('0x1e')],_0x3075ec;if(_0x54437d>=_0x512a12){_0x54437d=_0x512a12;_0x3075ec=0xc8;}else{_0x3075ec=0xce;}_0x10b4cf[_0x4c46('0x1a')](_0x3075ec);return _0x10b4cf[_0x4c46('0x1f')]('Content-Range',_0x5bb9ab+'-'+_0x54437d+'/'+_0x512a12)[_0x4c46('0x1b')](_0x3c1d0e);}return null;};}function patchUpdates(_0x59f648){return function(_0x1e93eb){try{jsonpatch[_0x4c46('0x20')](_0x1e93eb,_0x59f648,!![]);}catch(_0x11b37a){return BPromise[_0x4c46('0x21')](_0x11b37a);}return _0x1e93eb[_0x4c46('0x22')]();};}function saveUpdates(_0xb478b8,_0xe75435){return function(_0x33d519){if(_0x33d519){return _0x33d519[_0x4c46('0x23')](_0xb478b8)[_0x4c46('0x24')](function(_0x39b5ff){return _0x39b5ff;});}return null;};}function removeEntity(_0x1c4242,_0x39447f){return function(_0x4fb8de){if(_0x4fb8de){return _0x4fb8de[_0x4c46('0x25')]()[_0x4c46('0x24')](function(){var _0x212b31=_0x4fb8de[_0x4c46('0x26')]({'plain':!![]});var _0x180b03=_0x4c46('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x180b03,'resourceId':_0x212b31['id']}})[_0x4c46('0x24')](function(){return _0x4fb8de;});})[_0x4c46('0x24')](function(){_0x1c4242[_0x4c46('0x1a')](0xcc)[_0x4c46('0x19')]();});}};}function handleEntityNotFound(_0x11b29b,_0xa11b5e){return function(_0xa6fb18){if(!_0xa6fb18){_0x11b29b[_0x4c46('0x18')](0x194);}return _0xa6fb18;};}function handleError(_0x1b7de7,_0x5e0e07){_0x5e0e07=_0x5e0e07||0x1f4;return function(_0xaf7760){logger[_0x4c46('0x28')](_0xaf7760[_0x4c46('0x29')]);if(_0xaf7760['name']){delete _0xaf7760['name'];}_0x1b7de7[_0x4c46('0x1a')](_0x5e0e07)[_0x4c46('0x2a')](_0xaf7760);};}exports[_0x4c46('0x2b')]=function(_0x3bf8f5,_0x1a0d1d){var _0x2fff81={},_0x1a8689={},_0x4c76b9={'count':0x0,'rows':[]};var _0x39c2f0=_[_0x4c46('0x2c')](db[_0x4c46('0x2d')][_0x4c46('0x2e')],function(_0x350bb3){return{'name':_0x350bb3['fieldName'],'type':_0x350bb3[_0x4c46('0x2f')][_0x4c46('0x30')]};});_0x1a8689[_0x4c46('0x31')]=_[_0x4c46('0x2c')](_0x39c2f0,'name');_0x1a8689[_0x4c46('0x32')]=_[_0x4c46('0x33')](_0x3bf8f5[_0x4c46('0x32')]);_0x1a8689[_0x4c46('0x34')]=_[_0x4c46('0x35')](_0x1a8689[_0x4c46('0x31')],_0x1a8689[_0x4c46('0x32')]);_0x2fff81[_0x4c46('0x36')]=_[_0x4c46('0x35')](_0x1a8689[_0x4c46('0x31')],qs[_0x4c46('0x37')](_0x3bf8f5[_0x4c46('0x32')]['fields']));_0x2fff81['attributes']=_0x2fff81['attributes'][_0x4c46('0x38')]?_0x2fff81[_0x4c46('0x36')]:_0x1a8689[_0x4c46('0x31')];if(!_0x3bf8f5[_0x4c46('0x32')][_0x4c46('0x39')](_0x4c46('0x3a'))){_0x2fff81[_0x4c46('0x1e')]=qs[_0x4c46('0x1e')](_0x3bf8f5['query']['limit']);_0x2fff81[_0x4c46('0x1d')]=qs[_0x4c46('0x1d')](_0x3bf8f5[_0x4c46('0x32')]['offset']);}_0x2fff81[_0x4c46('0x3b')]=qs['sort'](_0x3bf8f5[_0x4c46('0x32')][_0x4c46('0x3c')]);_0x2fff81[_0x4c46('0x3d')]=qs['filters'](_[_0x4c46('0x3e')](_0x3bf8f5[_0x4c46('0x32')],_0x1a8689[_0x4c46('0x34')]),_0x39c2f0);if(_0x3bf8f5[_0x4c46('0x32')][_0x4c46('0x3f')]){_0x2fff81[_0x4c46('0x3d')]=_[_0x4c46('0x40')](_0x2fff81[_0x4c46('0x3d')],{'$or':_[_0x4c46('0x2c')](_0x39c2f0,function(_0x4ff6d8){if(_0x4ff6d8[_0x4c46('0x2f')]!==_0x4c46('0x41')){var _0x2179a3={};_0x2179a3[_0x4ff6d8[_0x4c46('0x42')]]={'$like':'%'+_0x3bf8f5[_0x4c46('0x32')][_0x4c46('0x3f')]+'%'};return _0x2179a3;}})});}_0x2fff81=_[_0x4c46('0x40')]({},_0x2fff81,_0x3bf8f5['options']);var _0x5e791b={'where':_0x2fff81['where']};return db[_0x4c46('0x2d')]['count'](_0x5e791b)['then'](function(_0x3d2744){_0x4c76b9[_0x4c46('0x1c')]=_0x3d2744;if(_0x3bf8f5[_0x4c46('0x32')][_0x4c46('0x43')]){_0x2fff81['include']=[{'all':!![]}];}return db[_0x4c46('0x2d')]['findAll'](_0x2fff81);})[_0x4c46('0x24')](function(_0x561210){_0x4c76b9[_0x4c46('0x44')]=_0x561210;return _0x4c76b9;})['then'](respondWithFilteredResult(_0x1a0d1d,_0x2fff81))['catch'](handleError(_0x1a0d1d,null));};exports[_0x4c46('0x45')]=function(_0xb2052e,_0x30343a){var _0x33c7ce={'raw':!![],'where':{'id':_0xb2052e[_0x4c46('0x46')]['id']}},_0x4f6e17={};_0x4f6e17[_0x4c46('0x31')]=_[_0x4c46('0x33')](db[_0x4c46('0x2d')]['rawAttributes']);_0x4f6e17[_0x4c46('0x32')]=_['keys'](_0xb2052e[_0x4c46('0x32')]);_0x4f6e17[_0x4c46('0x34')]=_['intersection'](_0x4f6e17[_0x4c46('0x31')],_0x4f6e17[_0x4c46('0x32')]);_0x33c7ce['attributes']=_[_0x4c46('0x35')](_0x4f6e17[_0x4c46('0x31')],qs[_0x4c46('0x37')](_0xb2052e[_0x4c46('0x32')]['fields']));_0x33c7ce['attributes']=_0x33c7ce[_0x4c46('0x36')][_0x4c46('0x38')]?_0x33c7ce[_0x4c46('0x36')]:_0x4f6e17[_0x4c46('0x31')];if(_0xb2052e[_0x4c46('0x32')]['includeAll']){_0x33c7ce[_0x4c46('0x47')]=[{'all':!![]}];}_0x33c7ce=_[_0x4c46('0x40')]({},_0x33c7ce,_0xb2052e[_0x4c46('0x48')]);return db['CannedAnswer'][_0x4c46('0x49')](_0x33c7ce)[_0x4c46('0x24')](handleEntityNotFound(_0x30343a,null))['then'](respondWithResult(_0x30343a,null))[_0x4c46('0x4a')](handleError(_0x30343a,null));};exports[_0x4c46('0x23')]=function(_0x42234f,_0x4e467f){if(_0x42234f['body']['id']){delete _0x42234f[_0x4c46('0x4b')]['id'];}return db[_0x4c46('0x2d')][_0x4c46('0x49')]({'where':{'id':_0x42234f['params']['id']}})[_0x4c46('0x24')](handleEntityNotFound(_0x4e467f,null))[_0x4c46('0x24')](saveUpdates(_0x42234f['body'],null))[_0x4c46('0x24')](respondWithResult(_0x4e467f,null))[_0x4c46('0x4a')](handleError(_0x4e467f,null));};exports['destroy']=function(_0x797aa4,_0x13468e){return db[_0x4c46('0x2d')][_0x4c46('0x49')]({'where':{'id':_0x797aa4[_0x4c46('0x46')]['id']}})[_0x4c46('0x24')](handleEntityNotFound(_0x13468e,null))[_0x4c46('0x24')](removeEntity(_0x13468e,null))[_0x4c46('0x4a')](handleError(_0x13468e,null));};exports[_0x4c46('0x4c')]=function(_0x5b5671,_0x493a75){var _0x3cc5cf={'key':_0x5b5671[_0x4c46('0x4b')]['key']};if(_0x5b5671[_0x4c46('0x4b')][_0x4c46('0x4d')]){_0x3cc5cf[_0x4c46('0x4d')]=_0x5b5671[_0x4c46('0x4b')][_0x4c46('0x4d')];}else if(_0x5b5671[_0x4c46('0x4b')][_0x4c46('0x4e')]){_0x3cc5cf['SmsAccountId']=_0x5b5671[_0x4c46('0x4b')][_0x4c46('0x4e')];}else if(_0x5b5671[_0x4c46('0x4b')][_0x4c46('0x4f')]){_0x3cc5cf[_0x4c46('0x4f')]=_0x5b5671[_0x4c46('0x4b')]['OpenchannelAccountId'];}else if(_0x5b5671['body']['ChatWebsiteId']){_0x3cc5cf['ChatWebsiteId']=_0x5b5671[_0x4c46('0x4b')][_0x4c46('0x50')];}return db['CannedAnswer'][_0x4c46('0x49')]({'where':_0x3cc5cf})[_0x4c46('0x24')](function(_0x873e3f){if(_0x873e3f){throw new db[(_0x4c46('0x51'))]['ValidationError'](_0x4c46('0x52'));}return db['CannedAnswer']['create'](_0x5b5671[_0x4c46('0x4b')]);})[_0x4c46('0x24')](function(_0x1335b7){var _0x2bbb88=_0x5b5671[_0x4c46('0x53')][_0x4c46('0x26')]({'plain':!![]});if(!_0x2bbb88)throw new Error(_0x4c46('0x54'));if(_0x2bbb88['role']===_0x4c46('0x53')){var _0x361db8=_0x1335b7[_0x4c46('0x26')]({'plain':!![]});return db[_0x4c46('0x55')][_0x4c46('0x49')]({'where':{'name':_0x4c46('0x27'),'userProfileId':_0x2bbb88[_0x4c46('0x56')]},'raw':!![]})[_0x4c46('0x24')](function(_0x1321ba){if(_0x1321ba&&_0x1321ba[_0x4c46('0x57')]===0x0){return db[_0x4c46('0x58')]['create']({'name':_0x361db8[_0x4c46('0x42')],'resourceId':_0x361db8['id'],'type':_0x1321ba[_0x4c46('0x42')],'sectionId':_0x1321ba['id']},{})[_0x4c46('0x24')](function(){return _0x1335b7;});}else{return _0x1335b7;}})['catch'](function(_0x253ed5){logger[_0x4c46('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x253ed5);throw _0x253ed5;});}return _0x1335b7;})[_0x4c46('0x24')](respondWithResult(_0x493a75,0xc9))[_0x4c46('0x4a')](handleError(_0x493a75,null));};
\ No newline at end of file
+var _0x1838=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','get','CannedAnswers','UserProfileResource','destroy','then','error','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto'];(function(_0x1ff575,_0xdba21f){var _0x48fc9e=function(_0x51cf97){while(--_0x51cf97){_0x1ff575['push'](_0x1ff575['shift']());}};_0x48fc9e(++_0xdba21f);}(_0x1838,0x1ae));var _0x8183=function(_0x510f37,_0x19f24c){_0x510f37=_0x510f37-0x0;var _0x2a09d1=_0x1838[_0x510f37];return _0x2a09d1;};'use strict';var pdf=require(_0x8183('0x0'));var emlformat=require(_0x8183('0x1'));var rimraf=require(_0x8183('0x2'));var zipdir=require(_0x8183('0x3'));var jsonpatch=require(_0x8183('0x4'));var rp=require(_0x8183('0x5'));var moment=require(_0x8183('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x8183('0x7'));var util=require(_0x8183('0x8'));var path=require(_0x8183('0x9'));var sox=require(_0x8183('0xa'));var csv=require('to-csv');var ejs=require(_0x8183('0xb'));var fs=require('fs');var _=require(_0x8183('0xc'));var squel=require(_0x8183('0xd'));var crypto=require(_0x8183('0xe'));var jsforce=require(_0x8183('0xf'));var deskjs=require(_0x8183('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8183('0x11'));var Papa=require(_0x8183('0x12'));var Redis=require(_0x8183('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8183('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8183('0x15'))(_0x8183('0x16'));var utils=require(_0x8183('0x17'));var config=require(_0x8183('0x18'));var db=require(_0x8183('0x19'))['db'];function respondWithStatusCode(_0x1f68c1,_0x479022){_0x479022=_0x479022||0xcc;return function(_0x4afd3f){if(_0x4afd3f){return _0x1f68c1[_0x8183('0x1a')](_0x479022);}return _0x1f68c1[_0x8183('0x1b')](_0x479022)[_0x8183('0x1c')]();};}function respondWithResult(_0x55b343,_0xe6fa62){_0xe6fa62=_0xe6fa62||0xc8;return function(_0x9fc132){if(_0x9fc132){return _0x55b343[_0x8183('0x1b')](_0xe6fa62)['json'](_0x9fc132);}};}function respondWithFilteredResult(_0x1698f0,_0x5ad104){return function(_0x568778){if(_0x568778){var _0x3b208c=_0x568778[_0x8183('0x1d')],_0x2c875f=_0x5ad104[_0x8183('0x1e')],_0x2a67fe=_0x5ad104[_0x8183('0x1e')]+_0x5ad104[_0x8183('0x1f')],_0x5dfdb3;if(_0x2a67fe>=_0x3b208c){_0x2a67fe=_0x3b208c;_0x5dfdb3=0xc8;}else{_0x5dfdb3=0xce;}_0x1698f0[_0x8183('0x1b')](_0x5dfdb3);return _0x1698f0[_0x8183('0x20')]('Content-Range',_0x2c875f+'-'+_0x2a67fe+'/'+_0x3b208c)[_0x8183('0x21')](_0x568778);}return null;};}function patchUpdates(_0x41ff56){return function(_0x398604){try{jsonpatch[_0x8183('0x22')](_0x398604,_0x41ff56,!![]);}catch(_0x41c814){return BPromise[_0x8183('0x23')](_0x41c814);}return _0x398604[_0x8183('0x24')]();};}function saveUpdates(_0xdd7e38,_0x274c18){return function(_0x20928c){if(_0x20928c){return _0x20928c[_0x8183('0x25')](_0xdd7e38)['then'](function(_0x4e6367){return _0x4e6367;});}return null;};}function removeEntity(_0x85b56d,_0x17c09b){return function(_0x1a8236){if(_0x1a8236){return _0x1a8236['destroy']()['then'](function(){var _0xa4b115=_0x1a8236[_0x8183('0x26')]({'plain':!![]});var _0x3027dd=_0x8183('0x27');return db[_0x8183('0x28')][_0x8183('0x29')]({'where':{'type':_0x3027dd,'resourceId':_0xa4b115['id']}})[_0x8183('0x2a')](function(){return _0x1a8236;});})['then'](function(){_0x85b56d[_0x8183('0x1b')](0xcc)[_0x8183('0x1c')]();});}};}function handleEntityNotFound(_0x491d99,_0x48aa1f){return function(_0xb01f29){if(!_0xb01f29){_0x491d99[_0x8183('0x1a')](0x194);}return _0xb01f29;};}function handleError(_0x3fce15,_0x263d63){_0x263d63=_0x263d63||0x1f4;return function(_0x179338){logger[_0x8183('0x2b')](_0x179338[_0x8183('0x2c')]);if(_0x179338[_0x8183('0x2d')]){delete _0x179338[_0x8183('0x2d')];}_0x3fce15[_0x8183('0x1b')](_0x263d63)['send'](_0x179338);};}exports['index']=function(_0x29bdc5,_0x463d82){var _0x125266={},_0x3ab64f={},_0x5bbfe1={'count':0x0,'rows':[]};var _0x4b977a=_[_0x8183('0x2e')](db[_0x8183('0x2f')][_0x8183('0x30')],function(_0x23de6a){return{'name':_0x23de6a[_0x8183('0x31')],'type':_0x23de6a[_0x8183('0x32')][_0x8183('0x33')]};});_0x3ab64f['model']=_['map'](_0x4b977a,'name');_0x3ab64f[_0x8183('0x34')]=_['keys'](_0x29bdc5[_0x8183('0x34')]);_0x3ab64f[_0x8183('0x35')]=_['intersection'](_0x3ab64f[_0x8183('0x36')],_0x3ab64f[_0x8183('0x34')]);_0x125266['attributes']=_[_0x8183('0x37')](_0x3ab64f[_0x8183('0x36')],qs[_0x8183('0x38')](_0x29bdc5['query']['fields']));_0x125266['attributes']=_0x125266[_0x8183('0x39')]['length']?_0x125266[_0x8183('0x39')]:_0x3ab64f[_0x8183('0x36')];if(!_0x29bdc5[_0x8183('0x34')]['hasOwnProperty'](_0x8183('0x3a'))){_0x125266[_0x8183('0x1f')]=qs[_0x8183('0x1f')](_0x29bdc5[_0x8183('0x34')][_0x8183('0x1f')]);_0x125266[_0x8183('0x1e')]=qs[_0x8183('0x1e')](_0x29bdc5['query'][_0x8183('0x1e')]);}_0x125266['order']=qs[_0x8183('0x3b')](_0x29bdc5[_0x8183('0x34')]['sort']);_0x125266[_0x8183('0x3c')]=qs[_0x8183('0x35')](_[_0x8183('0x3d')](_0x29bdc5[_0x8183('0x34')],_0x3ab64f['filters']),_0x4b977a);if(_0x29bdc5[_0x8183('0x34')][_0x8183('0x3e')]){_0x125266[_0x8183('0x3c')]=_[_0x8183('0x3f')](_0x125266['where'],{'$or':_[_0x8183('0x2e')](_0x4b977a,function(_0x530130){if(_0x530130[_0x8183('0x32')]!==_0x8183('0x40')){var _0x20e33a={};_0x20e33a[_0x530130[_0x8183('0x2d')]]={'$like':'%'+_0x29bdc5[_0x8183('0x34')][_0x8183('0x3e')]+'%'};return _0x20e33a;}})});}_0x125266=_['merge']({},_0x125266,_0x29bdc5[_0x8183('0x41')]);var _0x1e5da7={'where':_0x125266[_0x8183('0x3c')]};return db['CannedAnswer'][_0x8183('0x1d')](_0x1e5da7)[_0x8183('0x2a')](function(_0x3140dd){_0x5bbfe1['count']=_0x3140dd;if(_0x29bdc5[_0x8183('0x34')][_0x8183('0x42')]){_0x125266[_0x8183('0x43')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x125266);})[_0x8183('0x2a')](function(_0x1d42e5){_0x5bbfe1[_0x8183('0x44')]=_0x1d42e5;return _0x5bbfe1;})['then'](respondWithFilteredResult(_0x463d82,_0x125266))[_0x8183('0x45')](handleError(_0x463d82,null));};exports[_0x8183('0x46')]=function(_0x53c63c,_0x1ef7e8){var _0x5d4e48={'raw':!![],'where':{'id':_0x53c63c[_0x8183('0x47')]['id']}},_0x1e0bd5={};_0x1e0bd5[_0x8183('0x36')]=_['keys'](db['CannedAnswer'][_0x8183('0x30')]);_0x1e0bd5[_0x8183('0x34')]=_[_0x8183('0x48')](_0x53c63c[_0x8183('0x34')]);_0x1e0bd5[_0x8183('0x35')]=_[_0x8183('0x37')](_0x1e0bd5[_0x8183('0x36')],_0x1e0bd5[_0x8183('0x34')]);_0x5d4e48[_0x8183('0x39')]=_[_0x8183('0x37')](_0x1e0bd5[_0x8183('0x36')],qs['fields'](_0x53c63c[_0x8183('0x34')][_0x8183('0x38')]));_0x5d4e48[_0x8183('0x39')]=_0x5d4e48[_0x8183('0x39')]['length']?_0x5d4e48['attributes']:_0x1e0bd5['model'];if(_0x53c63c[_0x8183('0x34')][_0x8183('0x42')]){_0x5d4e48[_0x8183('0x43')]=[{'all':!![]}];}_0x5d4e48=_[_0x8183('0x3f')]({},_0x5d4e48,_0x53c63c['options']);return db[_0x8183('0x2f')][_0x8183('0x49')](_0x5d4e48)[_0x8183('0x2a')](handleEntityNotFound(_0x1ef7e8,null))[_0x8183('0x2a')](respondWithResult(_0x1ef7e8,null))['catch'](handleError(_0x1ef7e8,null));};exports[_0x8183('0x25')]=function(_0x27fb66,_0x5f4521){if(_0x27fb66[_0x8183('0x4a')]['id']){delete _0x27fb66[_0x8183('0x4a')]['id'];}return db[_0x8183('0x2f')]['find']({'where':{'id':_0x27fb66[_0x8183('0x47')]['id']}})[_0x8183('0x2a')](handleEntityNotFound(_0x5f4521,null))[_0x8183('0x2a')](saveUpdates(_0x27fb66[_0x8183('0x4a')],null))[_0x8183('0x2a')](respondWithResult(_0x5f4521,null))['catch'](handleError(_0x5f4521,null));};exports['destroy']=function(_0x23f8ac,_0x426c37){return db[_0x8183('0x2f')][_0x8183('0x49')]({'where':{'id':_0x23f8ac[_0x8183('0x47')]['id']}})[_0x8183('0x2a')](handleEntityNotFound(_0x426c37,null))[_0x8183('0x2a')](removeEntity(_0x426c37,null))[_0x8183('0x45')](handleError(_0x426c37,null));};exports[_0x8183('0x4b')]=function(_0x246cf8,_0x1860fa){var _0x388726={'key':_0x246cf8[_0x8183('0x4a')][_0x8183('0x33')]};if(_0x246cf8[_0x8183('0x4a')][_0x8183('0x4c')]){_0x388726['MailAccountId']=_0x246cf8[_0x8183('0x4a')]['MailAccountId'];}else if(_0x246cf8[_0x8183('0x4a')][_0x8183('0x4d')]){_0x388726[_0x8183('0x4d')]=_0x246cf8[_0x8183('0x4a')][_0x8183('0x4d')];}else if(_0x246cf8[_0x8183('0x4a')]['OpenchannelAccountId']){_0x388726[_0x8183('0x4e')]=_0x246cf8['body'][_0x8183('0x4e')];}else if(_0x246cf8[_0x8183('0x4a')][_0x8183('0x4f')]){_0x388726[_0x8183('0x4f')]=_0x246cf8['body'][_0x8183('0x4f')];}return db[_0x8183('0x2f')][_0x8183('0x49')]({'where':_0x388726})['then'](function(_0x71b846){if(_0x71b846){throw new db['Sequelize'][(_0x8183('0x50'))](_0x8183('0x51'));}return db['CannedAnswer'][_0x8183('0x4b')](_0x246cf8[_0x8183('0x4a')]);})[_0x8183('0x2a')](function(_0x2e7ad0){var _0x205477=_0x246cf8['user']['get']({'plain':!![]});if(!_0x205477)throw new Error(_0x8183('0x52'));if(_0x205477[_0x8183('0x53')]===_0x8183('0x54')){var _0x320188=_0x2e7ad0['get']({'plain':!![]});return db[_0x8183('0x55')][_0x8183('0x49')]({'where':{'name':_0x8183('0x27'),'userProfileId':_0x205477[_0x8183('0x56')]},'raw':!![]})['then'](function(_0x5ec078){if(_0x5ec078&&_0x5ec078[_0x8183('0x57')]===0x0){return db[_0x8183('0x28')][_0x8183('0x4b')]({'name':_0x320188[_0x8183('0x2d')],'resourceId':_0x320188['id'],'type':_0x5ec078[_0x8183('0x2d')],'sectionId':_0x5ec078['id']},{})[_0x8183('0x2a')](function(){return _0x2e7ad0;});}else{return _0x2e7ad0;}})['catch'](function(_0x21125c){logger['error'](_0x8183('0x58'),_0x21125c);throw _0x21125c;});}return _0x2e7ad0;})[_0x8183('0x2a')](respondWithResult(_0x1860fa,0xc9))[_0x8183('0x45')](handleError(_0x1860fa,null));};
\ No newline at end of file
index 2699f89..3d4123f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2086=['./cannedAnswer.attributes','exports','define','tools_canned_answers','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x4a9f87,_0x5ce674){var _0x3eac3c=function(_0x736aa5){while(--_0x736aa5){_0x4a9f87['push'](_0x4a9f87['shift']());}};_0x3eac3c(++_0x5ce674);}(_0x2086,0x124));var _0x6208=function(_0x525bb3,_0x166833){_0x525bb3=_0x525bb3-0x0;var _0x4a313e=_0x2086[_0x525bb3];return _0x4a313e;};'use strict';var _=require(_0x6208('0x0'));var util=require(_0x6208('0x1'));var logger=require(_0x6208('0x2'))(_0x6208('0x3'));var moment=require(_0x6208('0x4'));var BPromise=require(_0x6208('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6208('0x6'));var rimraf=require(_0x6208('0x7'));var config=require('../../config/environment');var attributes=require(_0x6208('0x8'));module[_0x6208('0x9')]=function(_0x38bc4d,_0xb3cf2a){return _0x38bc4d[_0x6208('0xa')]('CannedAnswer',attributes,{'tableName':_0x6208('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x29b1=['define','tools_canned_answers','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x1006f6,_0x58a4f2){var _0x274c54=function(_0x53a810){while(--_0x53a810){_0x1006f6['push'](_0x1006f6['shift']());}};_0x274c54(++_0x58a4f2);}(_0x29b1,0x13b));var _0x129b=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x29b1[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x129b('0x0'))(_0x129b('0x1'));var moment=require(_0x129b('0x2'));var BPromise=require(_0x129b('0x3'));var rp=require(_0x129b('0x4'));var fs=require('fs');var path=require(_0x129b('0x5'));var rimraf=require(_0x129b('0x6'));var config=require(_0x129b('0x7'));var attributes=require(_0x129b('0x8'));module[_0x129b('0x9')]=function(_0x11c23d,_0x5ca1ff){return _0x11c23d[_0x129b('0xa')]('CannedAnswer',attributes,{'tableName':_0x129b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x129b('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 91efa02..a0a53fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7acf=['request','then','info','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0xf8ca9f,_0x5d65dd){var _0x55a2f6=function(_0x4a956d){while(--_0x4a956d){_0xf8ca9f['push'](_0xf8ca9f['shift']());}};_0x55a2f6(++_0x5d65dd);}(_0x7acf,0x1bd));var _0xf7ac=function(_0x7c2221,_0x43626b){_0x7c2221=_0x7c2221-0x0;var _0x514522=_0x7acf[_0x7c2221];return _0x514522;};'use strict';var _=require(_0xf7ac('0x0'));var util=require(_0xf7ac('0x1'));var moment=require(_0xf7ac('0x2'));var BPromise=require(_0xf7ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7ac('0x4'));var db=require(_0xf7ac('0x5'))['db'];var utils=require(_0xf7ac('0x6'));var logger=require(_0xf7ac('0x7'))(_0xf7ac('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf7ac('0x9')][_0xf7ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x191a5b,_0x2e7d0d,_0xc980d7){return new BPromise(function(_0xd8c62b,_0x2d55d4){return client[_0xf7ac('0xb')](_0x191a5b,_0xc980d7)[_0xf7ac('0xc')](function(_0x4f6ef0){logger[_0xf7ac('0xd')]('CannedAnswer,\x20%s,\x20%s',_0x2e7d0d,'request\x20sent');logger[_0xf7ac('0xe')](_0xf7ac('0xf'),_0x2e7d0d,_0xf7ac('0x10'),JSON[_0xf7ac('0x11')](_0x4f6ef0));if(_0x4f6ef0[_0xf7ac('0x12')]){if(_0x4f6ef0[_0xf7ac('0x12')][_0xf7ac('0x13')]===0x1f4){logger[_0xf7ac('0x12')](_0xf7ac('0x14'),_0x2e7d0d,_0x4f6ef0[_0xf7ac('0x12')][_0xf7ac('0x15')]);return _0x2d55d4(_0x4f6ef0[_0xf7ac('0x12')]['message']);}logger['error'](_0xf7ac('0x14'),_0x2e7d0d,_0x4f6ef0[_0xf7ac('0x12')][_0xf7ac('0x15')]);return _0xd8c62b(_0x4f6ef0[_0xf7ac('0x12')]['message']);}else{logger[_0xf7ac('0xd')](_0xf7ac('0x14'),_0x2e7d0d,_0xf7ac('0x10'));_0xd8c62b(_0x4f6ef0[_0xf7ac('0x16')][_0xf7ac('0x15')]);}})[_0xf7ac('0x17')](function(_0x2c0418){logger[_0xf7ac('0x12')](_0xf7ac('0x14'),_0x2e7d0d,_0x2c0418);_0x2d55d4(_0x2c0418);});});}
\ No newline at end of file
+var _0x9bc8=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x9bc8,0x83));var _0x89bc=function(_0x5947e2,_0x1abef5){_0x5947e2=_0x5947e2-0x0;var _0x295a86=_0x9bc8[_0x5947e2];return _0x295a86;};'use strict';var _=require(_0x89bc('0x0'));var util=require(_0x89bc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x89bc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x89bc('0x3'));var logger=require(_0x89bc('0x4'))(_0x89bc('0x5'));var config=require('../../config/environment');var jayson=require(_0x89bc('0x6'));var client=jayson[_0x89bc('0x7')][_0x89bc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x22f6ff,_0x5283cd,_0xd1e279){return new BPromise(function(_0x401e76,_0x201a3d){return client['request'](_0x22f6ff,_0xd1e279)[_0x89bc('0x9')](function(_0x189a07){logger[_0x89bc('0xa')](_0x89bc('0xb'),_0x5283cd,_0x89bc('0xc'));logger['debug'](_0x89bc('0xd'),_0x5283cd,_0x89bc('0xc'),JSON[_0x89bc('0xe')](_0x189a07));if(_0x189a07['error']){if(_0x189a07['error'][_0x89bc('0xf')]===0x1f4){logger[_0x89bc('0x10')](_0x89bc('0xb'),_0x5283cd,_0x189a07[_0x89bc('0x10')][_0x89bc('0x11')]);return _0x201a3d(_0x189a07[_0x89bc('0x10')]['message']);}logger[_0x89bc('0x10')](_0x89bc('0xb'),_0x5283cd,_0x189a07[_0x89bc('0x10')][_0x89bc('0x11')]);return _0x401e76(_0x189a07['error'][_0x89bc('0x11')]);}else{logger[_0x89bc('0xa')]('CannedAnswer,\x20%s,\x20%s',_0x5283cd,_0x89bc('0xc'));_0x401e76(_0x189a07[_0x89bc('0x12')][_0x89bc('0x11')]);}})['catch'](function(_0x2b20eb){logger[_0x89bc('0x10')]('CannedAnswer,\x20%s,\x20%s',_0x5283cd,_0x2b20eb);_0x201a3d(_0x2b20eb);});});}
\ No newline at end of file
index 2fb60e2..45360cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45ba=['get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cannedAnswer.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x45ba,0x1d7));var _0xa45b=function(_0x13759d,_0x21e1b4){_0x13759d=_0x13759d-0x0;var _0x56ff0b=_0x45ba[_0x13759d];return _0x56ff0b;};'use strict';var multer=require(_0xa45b('0x0'));var util=require(_0xa45b('0x1'));var path=require(_0xa45b('0x2'));var timeout=require(_0xa45b('0x3'));var express=require(_0xa45b('0x4'));var router=express[_0xa45b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa45b('0x6'));var config=require(_0xa45b('0x7'));var controller=require(_0xa45b('0x8'));router[_0xa45b('0x9')]('/',auth[_0xa45b('0xa')](),controller[_0xa45b('0xb')]);router[_0xa45b('0x9')]('/:id',auth[_0xa45b('0xa')](),controller[_0xa45b('0xc')]);router[_0xa45b('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa45b('0xe')](_0xa45b('0xf'),auth['isAuthenticated'](),controller[_0xa45b('0x10')]);router[_0xa45b('0x11')]('/:id',auth[_0xa45b('0xa')](),controller[_0xa45b('0x12')]);module[_0xa45b('0x13')]=router;
\ No newline at end of file
+var _0xe4b8=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./cannedAnswer.controller','get','isAuthenticated','/:id','update','delete'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0xe4b8,0x179));var _0x8e4b=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe4b8[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x8e4b('0x0'));var util=require(_0x8e4b('0x1'));var path=require(_0x8e4b('0x2'));var timeout=require(_0x8e4b('0x3'));var express=require(_0x8e4b('0x4'));var router=express[_0x8e4b('0x5')]();var auth=require(_0x8e4b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8e4b('0x7'));router[_0x8e4b('0x8')]('/',auth[_0x8e4b('0x9')](),controller['index']);router[_0x8e4b('0x8')]('/:id',auth[_0x8e4b('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8e4b('0xa'),auth['isAuthenticated'](),controller[_0x8e4b('0xb')]);router[_0x8e4b('0xc')]('/:id',auth[_0x8e4b('0x9')](),controller[_0x8e4b('0xd')]);module[_0x8e4b('0xe')]=router;
\ No newline at end of file
index 715149f..154032a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea1e=['STRING','INTEGER','sequelize','1970-01-01\x2000:00:01'];(function(_0x4aa2d0,_0x57328e){var _0x570f72=function(_0x254be2){while(--_0x254be2){_0x4aa2d0['push'](_0x4aa2d0['shift']());}};_0x570f72(++_0x57328e);}(_0xea1e,0xaa));var _0xeea1=function(_0x37e9ce,_0x1e0fb0){_0x37e9ce=_0x37e9ce-0x0;var _0xe1e628=_0xea1e[_0x37e9ce];return _0xe1e628;};'use strict';var Sequelize=require(_0xeea1('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xeea1('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xeea1('0x2')]},'dcontext':{'type':Sequelize[_0xeea1('0x2')]},'channel':{'type':Sequelize[_0xeea1('0x2')]},'dstchannel':{'type':Sequelize[_0xeea1('0x2')]},'lastapp':{'type':Sequelize[_0xeea1('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xeea1('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xeea1('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xeea1('0x2')]},'userfield':{'type':Sequelize[_0xeea1('0x2')]},'uniqueid':{'type':Sequelize[_0xeea1('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xeea1('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xeea1('0x2')]},'tag':{'type':Sequelize[_0xeea1('0x2')]}};
\ No newline at end of file
+var _0x0f56=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x5bbaea,_0x183b05){var _0x1339b6=function(_0x27b2e2){while(--_0x27b2e2){_0x5bbaea['push'](_0x5bbaea['shift']());}};_0x1339b6(++_0x183b05);}(_0x0f56,0x12a));var _0x60f5=function(_0x40b1eb,_0x1bbcde){_0x40b1eb=_0x40b1eb-0x0;var _0x51d88b=_0x0f56[_0x40b1eb];return _0x51d88b;};'use strict';var Sequelize=require(_0x60f5('0x0'));module[_0x60f5('0x1')]={'calldate':{'type':Sequelize[_0x60f5('0x2')],'allowNull':![],'defaultValue':_0x60f5('0x3')},'clid':{'type':Sequelize[_0x60f5('0x4')]},'src':{'type':Sequelize[_0x60f5('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x60f5('0x4')]},'channel':{'type':Sequelize[_0x60f5('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x60f5('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x60f5('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x60f5('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x60f5('0x4')]},'amaflags':{'type':Sequelize[_0x60f5('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x60f5('0x4')]},'userfield':{'type':Sequelize[_0x60f5('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x60f5('0x4')]},'sequence':{'type':Sequelize[_0x60f5('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x60f5('0x4')]},'tag':{'type':Sequelize[_0x60f5('0x4')]}};
\ No newline at end of file
index d8e84da..965638f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7c3=['set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','Cdr','rawAttributes','type','query','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset'];(function(_0x72324c,_0x178f26){var _0x2e2bcd=function(_0x1782bc){while(--_0x1782bc){_0x72324c['push'](_0x72324c['shift']());}};_0x2e2bcd(++_0x178f26);}(_0xd7c3,0xc4));var _0x3d7c=function(_0x507526,_0x402649){_0x507526=_0x507526-0x0;var _0x12df4d=_0xd7c3[_0x507526];return _0x12df4d;};'use strict';var pdf=require(_0x3d7c('0x0'));var emlformat=require(_0x3d7c('0x1'));var rimraf=require(_0x3d7c('0x2'));var zipdir=require(_0x3d7c('0x3'));var jsonpatch=require(_0x3d7c('0x4'));var rp=require('request-promise');var moment=require(_0x3d7c('0x5'));var BPromise=require(_0x3d7c('0x6'));var Mustache=require(_0x3d7c('0x7'));var util=require(_0x3d7c('0x8'));var path=require(_0x3d7c('0x9'));var sox=require(_0x3d7c('0xa'));var csv=require('to-csv');var ejs=require(_0x3d7c('0xb'));var fs=require('fs');var _=require(_0x3d7c('0xc'));var squel=require(_0x3d7c('0xd'));var crypto=require('crypto');var jsforce=require(_0x3d7c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3d7c('0xf'));var querystring=require(_0x3d7c('0x10'));var Papa=require(_0x3d7c('0x11'));var Redis=require(_0x3d7c('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3d7c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d7c('0x14'))(_0x3d7c('0x15'));var utils=require(_0x3d7c('0x16'));var config=require(_0x3d7c('0x17'));var db=require(_0x3d7c('0x18'))['db'];function respondWithStatusCode(_0x192bc9,_0x345e9f){_0x345e9f=_0x345e9f||0xcc;return function(_0x210a80){if(_0x210a80){return _0x192bc9['sendStatus'](_0x345e9f);}return _0x192bc9[_0x3d7c('0x19')](_0x345e9f)[_0x3d7c('0x1a')]();};}function respondWithResult(_0x26089d,_0x1516c7){_0x1516c7=_0x1516c7||0xc8;return function(_0x1f9ecd){if(_0x1f9ecd){return _0x26089d['status'](_0x1516c7)['json'](_0x1f9ecd);}};}function respondWithFilteredResult(_0xced53,_0x3ad80c){return function(_0x1b2806){if(_0x1b2806){var _0x3260a5=_0x1b2806[_0x3d7c('0x1b')],_0x576207=_0x3ad80c[_0x3d7c('0x1c')],_0x4975fd=_0x3ad80c[_0x3d7c('0x1c')]+_0x3ad80c['limit'],_0x3daa53;if(_0x4975fd>=_0x3260a5){_0x4975fd=_0x3260a5;_0x3daa53=0xc8;}else{_0x3daa53=0xce;}_0xced53[_0x3d7c('0x19')](_0x3daa53);return _0xced53[_0x3d7c('0x1d')](_0x3d7c('0x1e'),_0x576207+'-'+_0x4975fd+'/'+_0x3260a5)['json'](_0x1b2806);}return null;};}function patchUpdates(_0x1073fc){return function(_0x36462c){try{jsonpatch[_0x3d7c('0x1f')](_0x36462c,_0x1073fc,!![]);}catch(_0x589115){return BPromise[_0x3d7c('0x20')](_0x589115);}return _0x36462c[_0x3d7c('0x21')]();};}function saveUpdates(_0x19b5d1,_0x1af850){return function(_0x37a586){if(_0x37a586){return _0x37a586[_0x3d7c('0x22')](_0x19b5d1)[_0x3d7c('0x23')](function(_0x4d730f){return _0x4d730f;});}return null;};}function removeEntity(_0x2a2161,_0x362b4d){return function(_0x1ad2d1){if(_0x1ad2d1){return _0x1ad2d1['destroy']()['then'](function(){_0x2a2161['status'](0xcc)[_0x3d7c('0x1a')]();});}};}function handleEntityNotFound(_0xa7557c,_0x1f7d1d){return function(_0xdab932){if(!_0xdab932){_0xa7557c[_0x3d7c('0x24')](0x194);}return _0xdab932;};}function handleError(_0x563260,_0x34fb46){_0x34fb46=_0x34fb46||0x1f4;return function(_0x1e0640){logger['error'](_0x1e0640[_0x3d7c('0x25')]);if(_0x1e0640[_0x3d7c('0x26')]){delete _0x1e0640[_0x3d7c('0x26')];}_0x563260[_0x3d7c('0x19')](_0x34fb46)[_0x3d7c('0x27')](_0x1e0640);};}exports[_0x3d7c('0x28')]=function(_0x5154b4,_0x45f5d9){var _0x26375f={},_0x366722={},_0x369790={'count':0x0,'rows':[]};var _0x4f25a7=_[_0x3d7c('0x29')](db[_0x3d7c('0x2a')][_0x3d7c('0x2b')],function(_0x1355d6){return{'name':_0x1355d6['fieldName'],'type':_0x1355d6[_0x3d7c('0x2c')]['key']};});_0x366722['model']=_[_0x3d7c('0x29')](_0x4f25a7,_0x3d7c('0x26'));_0x366722[_0x3d7c('0x2d')]=_['keys'](_0x5154b4[_0x3d7c('0x2d')]);_0x366722['filters']=_[_0x3d7c('0x2e')](_0x366722[_0x3d7c('0x2f')],_0x366722[_0x3d7c('0x2d')]);_0x26375f[_0x3d7c('0x30')]=_[_0x3d7c('0x2e')](_0x366722[_0x3d7c('0x2f')],qs['fields'](_0x5154b4[_0x3d7c('0x2d')][_0x3d7c('0x31')]));_0x26375f[_0x3d7c('0x30')]=_0x26375f[_0x3d7c('0x30')][_0x3d7c('0x32')]?_0x26375f[_0x3d7c('0x30')]:_0x366722[_0x3d7c('0x2f')];if(!_0x5154b4[_0x3d7c('0x2d')][_0x3d7c('0x33')]('nolimit')){_0x26375f[_0x3d7c('0x34')]=qs[_0x3d7c('0x34')](_0x5154b4[_0x3d7c('0x2d')][_0x3d7c('0x34')]);_0x26375f[_0x3d7c('0x1c')]=qs[_0x3d7c('0x1c')](_0x5154b4[_0x3d7c('0x2d')][_0x3d7c('0x1c')]);}_0x26375f[_0x3d7c('0x35')]=qs['sort'](_0x5154b4[_0x3d7c('0x2d')][_0x3d7c('0x36')]);_0x26375f[_0x3d7c('0x37')]=qs[_0x3d7c('0x38')](_[_0x3d7c('0x39')](_0x5154b4[_0x3d7c('0x2d')],_0x366722[_0x3d7c('0x38')]),_0x4f25a7);if(_0x5154b4[_0x3d7c('0x2d')][_0x3d7c('0x3a')]){_0x26375f[_0x3d7c('0x37')]=_['merge'](_0x26375f[_0x3d7c('0x37')],{'$or':_[_0x3d7c('0x29')](_0x4f25a7,function(_0x19f933){if(_0x19f933[_0x3d7c('0x2c')]!==_0x3d7c('0x3b')){var _0x3a588d={};_0x3a588d[_0x19f933[_0x3d7c('0x26')]]={'$like':'%'+_0x5154b4[_0x3d7c('0x2d')][_0x3d7c('0x3a')]+'%'};return _0x3a588d;}})});}_0x26375f=_[_0x3d7c('0x3c')]({},_0x26375f,_0x5154b4[_0x3d7c('0x3d')]);var _0x238dfa={'where':_0x26375f[_0x3d7c('0x37')]};return db['Cdr']['count'](_0x238dfa)['then'](function(_0x653d25){_0x369790[_0x3d7c('0x1b')]=_0x653d25;if(_0x5154b4[_0x3d7c('0x2d')][_0x3d7c('0x3e')]){_0x26375f[_0x3d7c('0x3f')]=[{'all':!![]}];}return db[_0x3d7c('0x2a')][_0x3d7c('0x40')](_0x26375f);})[_0x3d7c('0x23')](function(_0x381e08){_0x369790[_0x3d7c('0x41')]=_0x381e08;return _0x369790;})[_0x3d7c('0x23')](respondWithFilteredResult(_0x45f5d9,_0x26375f))['catch'](handleError(_0x45f5d9,null));};exports[_0x3d7c('0x42')]=function(_0x28395c,_0x202cdb){var _0x1acda1={'raw':!![],'where':{'id':_0x28395c[_0x3d7c('0x43')]['id']}},_0x279d7f={};_0x279d7f[_0x3d7c('0x2f')]=_[_0x3d7c('0x44')](db['Cdr']['rawAttributes']);_0x279d7f[_0x3d7c('0x2d')]=_[_0x3d7c('0x44')](_0x28395c[_0x3d7c('0x2d')]);_0x279d7f[_0x3d7c('0x38')]=_['intersection'](_0x279d7f[_0x3d7c('0x2f')],_0x279d7f[_0x3d7c('0x2d')]);_0x1acda1[_0x3d7c('0x30')]=_[_0x3d7c('0x2e')](_0x279d7f[_0x3d7c('0x2f')],qs[_0x3d7c('0x31')](_0x28395c[_0x3d7c('0x2d')][_0x3d7c('0x31')]));_0x1acda1['attributes']=_0x1acda1[_0x3d7c('0x30')]['length']?_0x1acda1[_0x3d7c('0x30')]:_0x279d7f[_0x3d7c('0x2f')];if(_0x28395c[_0x3d7c('0x2d')][_0x3d7c('0x3e')]){_0x1acda1[_0x3d7c('0x3f')]=[{'all':!![]}];}_0x1acda1=_[_0x3d7c('0x3c')]({},_0x1acda1,_0x28395c[_0x3d7c('0x3d')]);return db[_0x3d7c('0x2a')]['find'](_0x1acda1)[_0x3d7c('0x23')](handleEntityNotFound(_0x202cdb,null))[_0x3d7c('0x23')](respondWithResult(_0x202cdb,null))[_0x3d7c('0x45')](handleError(_0x202cdb,null));};exports[_0x3d7c('0x46')]=function(_0x5c0379,_0x534276){return db['Cdr'][_0x3d7c('0x46')](_0x5c0379[_0x3d7c('0x47')],{})[_0x3d7c('0x23')](respondWithResult(_0x534276,0xc9))[_0x3d7c('0x45')](handleError(_0x534276,null));};exports[_0x3d7c('0x22')]=function(_0x1c90ed,_0xdb7c10){if(_0x1c90ed[_0x3d7c('0x47')]['id']){delete _0x1c90ed[_0x3d7c('0x47')]['id'];}return db['Cdr'][_0x3d7c('0x48')]({'where':{'id':_0x1c90ed[_0x3d7c('0x43')]['id']}})[_0x3d7c('0x23')](handleEntityNotFound(_0xdb7c10,null))['then'](saveUpdates(_0x1c90ed[_0x3d7c('0x47')],null))[_0x3d7c('0x23')](respondWithResult(_0xdb7c10,null))[_0x3d7c('0x45')](handleError(_0xdb7c10,null));};exports[_0x3d7c('0x49')]=function(_0x542c0b,_0x673b83){return db[_0x3d7c('0x2a')][_0x3d7c('0x48')]({'where':{'id':_0x542c0b['params']['id']}})[_0x3d7c('0x23')](handleEntityNotFound(_0x673b83,null))[_0x3d7c('0x23')](removeEntity(_0x673b83,null))[_0x3d7c('0x45')](handleError(_0x673b83,null));};exports[_0x3d7c('0x4a')]=function(_0x12595d,_0x36c752){return db[_0x3d7c('0x2a')][_0x3d7c('0x4a')]()[_0x3d7c('0x23')](respondWithResult(_0x36c752,null))['catch'](handleError(_0x36c752,null));};
\ No newline at end of file
+var _0x9da3=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','Content-Range','apply','update','then','destroy','end','sendStatus','stack','name','index','map','Cdr','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x86337d,_0x2b57c3){var _0x22b2c6=function(_0x180d16){while(--_0x180d16){_0x86337d['push'](_0x86337d['shift']());}};_0x22b2c6(++_0x2b57c3);}(_0x9da3,0x167));var _0x39da=function(_0x4eacbb,_0x1bc3d1){_0x4eacbb=_0x4eacbb-0x0;var _0x549393=_0x9da3[_0x4eacbb];return _0x549393;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x39da('0x0'));var zipdir=require(_0x39da('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x39da('0x2'));var moment=require(_0x39da('0x3'));var BPromise=require(_0x39da('0x4'));var Mustache=require(_0x39da('0x5'));var util=require(_0x39da('0x6'));var path=require(_0x39da('0x7'));var sox=require(_0x39da('0x8'));var csv=require(_0x39da('0x9'));var ejs=require(_0x39da('0xa'));var fs=require('fs');var _=require(_0x39da('0xb'));var squel=require(_0x39da('0xc'));var crypto=require(_0x39da('0xd'));var jsforce=require(_0x39da('0xe'));var deskjs=require(_0x39da('0xf'));var toCsv=require(_0x39da('0x9'));var querystring=require(_0x39da('0x10'));var Papa=require(_0x39da('0x11'));var Redis=require(_0x39da('0x12'));var authService=require(_0x39da('0x13'));var qs=require(_0x39da('0x14'));var as=require(_0x39da('0x15'));var hardwareService=require(_0x39da('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x39da('0x17'));var config=require(_0x39da('0x18'));var db=require(_0x39da('0x19'))['db'];function respondWithStatusCode(_0x439854,_0x222244){_0x222244=_0x222244||0xcc;return function(_0x40b8ba){if(_0x40b8ba){return _0x439854['sendStatus'](_0x222244);}return _0x439854[_0x39da('0x1a')](_0x222244)['end']();};}function respondWithResult(_0x542960,_0x577401){_0x577401=_0x577401||0xc8;return function(_0x4d4843){if(_0x4d4843){return _0x542960[_0x39da('0x1a')](_0x577401)[_0x39da('0x1b')](_0x4d4843);}};}function respondWithFilteredResult(_0x230230,_0x43944c){return function(_0x1dd5e1){if(_0x1dd5e1){var _0x186a0b=_0x1dd5e1[_0x39da('0x1c')],_0x5ec93c=_0x43944c[_0x39da('0x1d')],_0x1deb14=_0x43944c[_0x39da('0x1d')]+_0x43944c['limit'],_0xe7688b;if(_0x1deb14>=_0x186a0b){_0x1deb14=_0x186a0b;_0xe7688b=0xc8;}else{_0xe7688b=0xce;}_0x230230[_0x39da('0x1a')](_0xe7688b);return _0x230230['set'](_0x39da('0x1e'),_0x5ec93c+'-'+_0x1deb14+'/'+_0x186a0b)[_0x39da('0x1b')](_0x1dd5e1);}return null;};}function patchUpdates(_0x39b50a){return function(_0x12f07b){try{jsonpatch[_0x39da('0x1f')](_0x12f07b,_0x39b50a,!![]);}catch(_0x10d396){return BPromise['reject'](_0x10d396);}return _0x12f07b['save']();};}function saveUpdates(_0x3b01f9,_0x226dd8){return function(_0x37efe1){if(_0x37efe1){return _0x37efe1[_0x39da('0x20')](_0x3b01f9)[_0x39da('0x21')](function(_0x13dade){return _0x13dade;});}return null;};}function removeEntity(_0x361346,_0x18ea18){return function(_0x15e8c6){if(_0x15e8c6){return _0x15e8c6[_0x39da('0x22')]()[_0x39da('0x21')](function(){_0x361346[_0x39da('0x1a')](0xcc)[_0x39da('0x23')]();});}};}function handleEntityNotFound(_0x52cb05,_0xeb6dac){return function(_0x2f388e){if(!_0x2f388e){_0x52cb05[_0x39da('0x24')](0x194);}return _0x2f388e;};}function handleError(_0x290953,_0x38e6e3){_0x38e6e3=_0x38e6e3||0x1f4;return function(_0x32b38e){logger['error'](_0x32b38e[_0x39da('0x25')]);if(_0x32b38e['name']){delete _0x32b38e[_0x39da('0x26')];}_0x290953[_0x39da('0x1a')](_0x38e6e3)['send'](_0x32b38e);};}exports[_0x39da('0x27')]=function(_0x47dff5,_0xb4c872){var _0x52982f={},_0xb181e8={},_0x168625={'count':0x0,'rows':[]};var _0x4ba999=_[_0x39da('0x28')](db[_0x39da('0x29')]['rawAttributes'],function(_0x2d65f1){return{'name':_0x2d65f1['fieldName'],'type':_0x2d65f1[_0x39da('0x2a')][_0x39da('0x2b')]};});_0xb181e8[_0x39da('0x2c')]=_[_0x39da('0x28')](_0x4ba999,_0x39da('0x26'));_0xb181e8['query']=_[_0x39da('0x2d')](_0x47dff5[_0x39da('0x2e')]);_0xb181e8[_0x39da('0x2f')]=_[_0x39da('0x30')](_0xb181e8[_0x39da('0x2c')],_0xb181e8[_0x39da('0x2e')]);_0x52982f[_0x39da('0x31')]=_[_0x39da('0x30')](_0xb181e8[_0x39da('0x2c')],qs[_0x39da('0x32')](_0x47dff5[_0x39da('0x2e')][_0x39da('0x32')]));_0x52982f[_0x39da('0x31')]=_0x52982f[_0x39da('0x31')][_0x39da('0x33')]?_0x52982f[_0x39da('0x31')]:_0xb181e8[_0x39da('0x2c')];if(!_0x47dff5[_0x39da('0x2e')][_0x39da('0x34')](_0x39da('0x35'))){_0x52982f['limit']=qs[_0x39da('0x36')](_0x47dff5['query'][_0x39da('0x36')]);_0x52982f[_0x39da('0x1d')]=qs[_0x39da('0x1d')](_0x47dff5['query'][_0x39da('0x1d')]);}_0x52982f[_0x39da('0x37')]=qs[_0x39da('0x38')](_0x47dff5[_0x39da('0x2e')][_0x39da('0x38')]);_0x52982f[_0x39da('0x39')]=qs[_0x39da('0x2f')](_['pick'](_0x47dff5[_0x39da('0x2e')],_0xb181e8[_0x39da('0x2f')]),_0x4ba999);if(_0x47dff5['query'][_0x39da('0x3a')]){_0x52982f['where']=_[_0x39da('0x3b')](_0x52982f[_0x39da('0x39')],{'$or':_[_0x39da('0x28')](_0x4ba999,function(_0x454c3e){if(_0x454c3e[_0x39da('0x2a')]!==_0x39da('0x3c')){var _0xb85816={};_0xb85816[_0x454c3e[_0x39da('0x26')]]={'$like':'%'+_0x47dff5[_0x39da('0x2e')][_0x39da('0x3a')]+'%'};return _0xb85816;}})});}_0x52982f=_[_0x39da('0x3b')]({},_0x52982f,_0x47dff5[_0x39da('0x3d')]);var _0x1b2427={'where':_0x52982f[_0x39da('0x39')]};return db[_0x39da('0x29')][_0x39da('0x1c')](_0x1b2427)['then'](function(_0x33601d){_0x168625[_0x39da('0x1c')]=_0x33601d;if(_0x47dff5['query'][_0x39da('0x3e')]){_0x52982f['include']=[{'all':!![]}];}return db[_0x39da('0x29')][_0x39da('0x3f')](_0x52982f);})[_0x39da('0x21')](function(_0x5988ae){_0x168625[_0x39da('0x40')]=_0x5988ae;return _0x168625;})[_0x39da('0x21')](respondWithFilteredResult(_0xb4c872,_0x52982f))[_0x39da('0x41')](handleError(_0xb4c872,null));};exports[_0x39da('0x42')]=function(_0x1b9427,_0x5caa77){var _0xce7260={'raw':!![],'where':{'id':_0x1b9427[_0x39da('0x43')]['id']}},_0x5b4883={};_0x5b4883['model']=_[_0x39da('0x2d')](db['Cdr'][_0x39da('0x44')]);_0x5b4883[_0x39da('0x2e')]=_['keys'](_0x1b9427['query']);_0x5b4883['filters']=_['intersection'](_0x5b4883[_0x39da('0x2c')],_0x5b4883[_0x39da('0x2e')]);_0xce7260[_0x39da('0x31')]=_['intersection'](_0x5b4883[_0x39da('0x2c')],qs['fields'](_0x1b9427['query']['fields']));_0xce7260['attributes']=_0xce7260['attributes'][_0x39da('0x33')]?_0xce7260[_0x39da('0x31')]:_0x5b4883[_0x39da('0x2c')];if(_0x1b9427['query'][_0x39da('0x3e')]){_0xce7260[_0x39da('0x45')]=[{'all':!![]}];}_0xce7260=_[_0x39da('0x3b')]({},_0xce7260,_0x1b9427[_0x39da('0x3d')]);return db['Cdr'][_0x39da('0x46')](_0xce7260)[_0x39da('0x21')](handleEntityNotFound(_0x5caa77,null))['then'](respondWithResult(_0x5caa77,null))[_0x39da('0x41')](handleError(_0x5caa77,null));};exports[_0x39da('0x47')]=function(_0x19eaf7,_0x392059){return db[_0x39da('0x29')]['create'](_0x19eaf7['body'],{})['then'](respondWithResult(_0x392059,0xc9))[_0x39da('0x41')](handleError(_0x392059,null));};exports[_0x39da('0x20')]=function(_0x304c20,_0x4ed110){if(_0x304c20[_0x39da('0x48')]['id']){delete _0x304c20[_0x39da('0x48')]['id'];}return db[_0x39da('0x29')][_0x39da('0x46')]({'where':{'id':_0x304c20[_0x39da('0x43')]['id']}})[_0x39da('0x21')](handleEntityNotFound(_0x4ed110,null))['then'](saveUpdates(_0x304c20[_0x39da('0x48')],null))[_0x39da('0x21')](respondWithResult(_0x4ed110,null))[_0x39da('0x41')](handleError(_0x4ed110,null));};exports[_0x39da('0x22')]=function(_0x5073c2,_0x3d9365){return db['Cdr'][_0x39da('0x46')]({'where':{'id':_0x5073c2[_0x39da('0x43')]['id']}})[_0x39da('0x21')](handleEntityNotFound(_0x3d9365,null))[_0x39da('0x21')](removeEntity(_0x3d9365,null))['catch'](handleError(_0x3d9365,null));};exports['describe']=function(_0x4cde5b,_0x594ee9){return db[_0x39da('0x29')][_0x39da('0x49')]()['then'](respondWithResult(_0x594ee9,null))[_0x39da('0x41')](handleError(_0x594ee9,null));};
\ No newline at end of file
index f94b6c2..1ad2917 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2f3=['moment','bluebird','path','rimraf','../../config/environment','define','Cdr','accountcode','calldate','dst','uniqueid','lodash'];(function(_0x30f0f2,_0x8a4674){var _0x1abc3f=function(_0x1c9f67){while(--_0x1c9f67){_0x30f0f2['push'](_0x30f0f2['shift']());}};_0x1abc3f(++_0x8a4674);}(_0xf2f3,0x83));var _0x3f2f=function(_0x55b7f5,_0x156133){_0x55b7f5=_0x55b7f5-0x0;var _0x16e474=_0xf2f3[_0x55b7f5];return _0x16e474;};'use strict';var _=require(_0x3f2f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3f2f('0x1'));var BPromise=require(_0x3f2f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f2f('0x3'));var rimraf=require(_0x3f2f('0x4'));var config=require(_0x3f2f('0x5'));var attributes=require('./cdr.attributes');module['exports']=function(_0x4d7240,_0x3ccbf6){return _0x4d7240[_0x3f2f('0x6')](_0x3f2f('0x7'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x3f2f('0x8'),'fields':[_0x3f2f('0x8')]},{'name':_0x3f2f('0x9'),'fields':[_0x3f2f('0x9')]},{'name':'disposition','fields':['disposition']},{'name':_0x3f2f('0xa'),'fields':['dst']},{'name':'src','fields':['src']},{'name':_0x3f2f('0xb'),'fields':[_0x3f2f('0xb')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xe263=['cdr','accountcode','calldate','disposition','dst','src','lodash','util','../../config/logger','api','moment','path','../../config/environment','exports','define','Cdr'];(function(_0x12fa60,_0x1c6ad7){var _0x4a8270=function(_0x3944a6){while(--_0x3944a6){_0x12fa60['push'](_0x12fa60['shift']());}};_0x4a8270(++_0x1c6ad7);}(_0xe263,0x186));var _0x3e26=function(_0xb88731,_0x269525){_0xb88731=_0xb88731-0x0;var _0x59122d=_0xe263[_0xb88731];return _0x59122d;};'use strict';var _=require(_0x3e26('0x0'));var util=require(_0x3e26('0x1'));var logger=require(_0x3e26('0x2'))(_0x3e26('0x3'));var moment=require(_0x3e26('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e26('0x5'));var rimraf=require('rimraf');var config=require(_0x3e26('0x6'));var attributes=require('./cdr.attributes');module[_0x3e26('0x7')]=function(_0x133509,_0x2a3ae5){return _0x133509[_0x3e26('0x8')](_0x3e26('0x9'),attributes,{'tableName':_0x3e26('0xa'),'paranoid':![],'indexes':[{'name':_0x3e26('0xb'),'fields':[_0x3e26('0xb')]},{'name':_0x3e26('0xc'),'fields':['calldate']},{'name':_0x3e26('0xd'),'fields':[_0x3e26('0xd')]},{'name':'dst','fields':[_0x3e26('0xe')]},{'name':_0x3e26('0xf'),'fields':[_0x3e26('0xf')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':![]});};
\ No newline at end of file
index b4cac63..af592fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1898=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x56a116,_0x2856de){var _0x44bc7c=function(_0x479b92){while(--_0x479b92){_0x56a116['push'](_0x56a116['shift']());}};_0x44bc7c(++_0x2856de);}(_0x1898,0xdb));var _0x8189=function(_0x235b23,_0x1e55f2){_0x235b23=_0x235b23-0x0;var _0x166ac5=_0x1898[_0x235b23];return _0x166ac5;};'use strict';var _=require(_0x8189('0x0'));var util=require(_0x8189('0x1'));var moment=require(_0x8189('0x2'));var BPromise=require(_0x8189('0x3'));var rs=require(_0x8189('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8189('0x5'))['db'];var utils=require(_0x8189('0x6'));var logger=require(_0x8189('0x7'))(_0x8189('0x8'));var config=require(_0x8189('0x9'));var jayson=require(_0x8189('0xa'));var client=jayson[_0x8189('0xb')][_0x8189('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x488a96,_0x13ef13,_0x16400b){return new BPromise(function(_0x400089,_0x3a880f){return client[_0x8189('0xd')](_0x488a96,_0x16400b)[_0x8189('0xe')](function(_0x24e517){logger[_0x8189('0xf')]('Cdr,\x20%s,\x20%s',_0x13ef13,_0x8189('0x10'));logger[_0x8189('0x11')](_0x8189('0x12'),_0x13ef13,_0x8189('0x10'),JSON['stringify'](_0x24e517));if(_0x24e517[_0x8189('0x13')]){if(_0x24e517['error'][_0x8189('0x14')]===0x1f4){logger[_0x8189('0x13')](_0x8189('0x15'),_0x13ef13,_0x24e517[_0x8189('0x13')]['message']);return _0x3a880f(_0x24e517[_0x8189('0x13')][_0x8189('0x16')]);}logger[_0x8189('0x13')](_0x8189('0x15'),_0x13ef13,_0x24e517[_0x8189('0x13')]['message']);return _0x400089(_0x24e517[_0x8189('0x13')][_0x8189('0x16')]);}else{logger[_0x8189('0xf')](_0x8189('0x15'),_0x13ef13,_0x8189('0x10'));_0x400089(_0x24e517[_0x8189('0x17')][_0x8189('0x16')]);}})[_0x8189('0x18')](function(_0x2ae2a6){logger[_0x8189('0x13')](_0x8189('0x15'),_0x13ef13,_0x2ae2a6);_0x3a880f(_0x2ae2a6);});});}
\ No newline at end of file
+var _0xc235=['code','message','request\x20sent','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc235,0x1bc));var _0x5c23=function(_0x3fe140,_0xfbff91){_0x3fe140=_0x3fe140-0x0;var _0x582c8e=_0xc235[_0x3fe140];return _0x582c8e;};'use strict';var _=require('lodash');var util=require(_0x5c23('0x0'));var moment=require(_0x5c23('0x1'));var BPromise=require('bluebird');var rs=require(_0x5c23('0x2'));var fs=require('fs');var Redis=require(_0x5c23('0x3'));var db=require(_0x5c23('0x4'))['db'];var utils=require(_0x5c23('0x5'));var logger=require(_0x5c23('0x6'))('rpc');var config=require(_0x5c23('0x7'));var jayson=require(_0x5c23('0x8'));var client=jayson[_0x5c23('0x9')][_0x5c23('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c749d,_0x58f6e2,_0x229d26){return new BPromise(function(_0x1ddfef,_0x5c8cbf){return client[_0x5c23('0xb')](_0x4c749d,_0x229d26)[_0x5c23('0xc')](function(_0x128489){logger['info'](_0x5c23('0xd'),_0x58f6e2,'request\x20sent');logger[_0x5c23('0xe')](_0x5c23('0xf'),_0x58f6e2,'request\x20sent',JSON[_0x5c23('0x10')](_0x128489));if(_0x128489[_0x5c23('0x11')]){if(_0x128489[_0x5c23('0x11')][_0x5c23('0x12')]===0x1f4){logger['error'](_0x5c23('0xd'),_0x58f6e2,_0x128489[_0x5c23('0x11')][_0x5c23('0x13')]);return _0x5c8cbf(_0x128489[_0x5c23('0x11')]['message']);}logger['error'](_0x5c23('0xd'),_0x58f6e2,_0x128489[_0x5c23('0x11')]['message']);return _0x1ddfef(_0x128489[_0x5c23('0x11')]['message']);}else{logger['info'](_0x5c23('0xd'),_0x58f6e2,_0x5c23('0x14'));_0x1ddfef(_0x128489['result'][_0x5c23('0x13')]);}})[_0x5c23('0x15')](function(_0x31658c){logger[_0x5c23('0x11')](_0x5c23('0xd'),_0x58f6e2,_0x31658c);_0x5c8cbf(_0x31658c);});});}
\ No newline at end of file
index 7abc300..8b2ab80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5393=['isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./cdr.controller','get','index','/describe'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5393,0x199));var _0x3539=function(_0x7f974f,_0x1ad3c0){_0x7f974f=_0x7f974f-0x0;var _0x54f616=_0x5393[_0x7f974f];return _0x54f616;};'use strict';var multer=require(_0x3539('0x0'));var util=require(_0x3539('0x1'));var path=require(_0x3539('0x2'));var timeout=require(_0x3539('0x3'));var express=require(_0x3539('0x4'));var router=express[_0x3539('0x5')]();var auth=require(_0x3539('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3539('0x7'));router[_0x3539('0x8')]('/',auth['isAuthenticated'](),controller[_0x3539('0x9')]);router[_0x3539('0x8')](_0x3539('0xa'),auth[_0x3539('0xb')](),controller[_0x3539('0xc')]);router[_0x3539('0x8')](_0x3539('0xd'),auth['isAuthenticated'](),controller[_0x3539('0xe')]);router[_0x3539('0xf')]('/',auth[_0x3539('0xb')](),controller[_0x3539('0x10')]);router[_0x3539('0x11')]('/:id',auth[_0x3539('0xb')](),controller['update']);router[_0x3539('0x12')]('/:id',auth[_0x3539('0xb')](),controller[_0x3539('0x13')]);module[_0x3539('0x14')]=router;
\ No newline at end of file
+var _0xc34c=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete'];(function(_0x4b93ba,_0x498acd){var _0x12999c=function(_0x4f58d5){while(--_0x4f58d5){_0x4b93ba['push'](_0x4b93ba['shift']());}};_0x12999c(++_0x498acd);}(_0xc34c,0xa1));var _0xcc34=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc34c[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0xcc34('0x0'));var path=require('path');var timeout=require(_0xcc34('0x1'));var express=require(_0xcc34('0x2'));var router=express[_0xcc34('0x3')]();var auth=require(_0xcc34('0x4'));var interaction=require(_0xcc34('0x5'));var config=require(_0xcc34('0x6'));var controller=require(_0xcc34('0x7'));router[_0xcc34('0x8')]('/',auth[_0xcc34('0x9')](),controller[_0xcc34('0xa')]);router[_0xcc34('0x8')](_0xcc34('0xb'),auth[_0xcc34('0x9')](),controller[_0xcc34('0xc')]);router[_0xcc34('0x8')](_0xcc34('0xd'),auth['isAuthenticated'](),controller[_0xcc34('0xe')]);router[_0xcc34('0xf')]('/',auth[_0xcc34('0x9')](),controller[_0xcc34('0x10')]);router['put'](_0xcc34('0xd'),auth['isAuthenticated'](),controller[_0xcc34('0x11')]);router[_0xcc34('0x12')](_0xcc34('0xd'),auth[_0xcc34('0x9')](),controller['destroy']);module[_0xcc34('0x13')]=router;
\ No newline at end of file
index c745f0e..4f6e056 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb606=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x51467d,_0x43b2e5){var _0x10f958=function(_0x540278){while(--_0x540278){_0x51467d['push'](_0x51467d['shift']());}};_0x10f958(++_0x43b2e5);}(_0xb606,0x98));var _0x6b60=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0xb606[_0x13f980];return _0x27153c;};'use strict';var Sequelize=require(_0x6b60('0x0'));module[_0x6b60('0x1')]={'priority':{'type':Sequelize[_0x6b60('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6b60('0x3')],'allowNull':![],'defaultValue':_0x6b60('0x4')},'appdata':{'type':Sequelize[_0x6b60('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6b60('0x6')}};
\ No newline at end of file
+var _0xd16a=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x5b9137,_0x3bbf38){var _0x11fd0c=function(_0x5e6e47){while(--_0x5e6e47){_0x5b9137['push'](_0x5b9137['shift']());}};_0x11fd0c(++_0x3bbf38);}(_0xd16a,0x167));var _0xad16=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd16a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xad16('0x0'));module[_0xad16('0x1')]={'priority':{'type':Sequelize[_0xad16('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xad16('0x3')],'allowNull':![],'defaultValue':_0xad16('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xad16('0x3')]},'interval':{'type':Sequelize[_0xad16('0x3')],'defaultValue':_0xad16('0x5')}};
\ No newline at end of file
index d9fa384..f84bc28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x865f=['offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','fields','attributes','length','merge','find','catch','eml-format','request-promise','moment','bluebird','mustache','path','sox','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','status','json','count'];(function(_0x2084b1,_0x29f453){var _0x39ce66=function(_0x36077b){while(--_0x36077b){_0x2084b1['push'](_0x2084b1['shift']());}};_0x39ce66(++_0x29f453);}(_0x865f,0x150));var _0xf865=function(_0x2cb5db,_0xeb8109){_0x2cb5db=_0x2cb5db-0x0;var _0x1ad7fa=_0x865f[_0x2cb5db];return _0x1ad7fa;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf865('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf865('0x1'));var moment=require(_0xf865('0x2'));var BPromise=require(_0xf865('0x3'));var Mustache=require(_0xf865('0x4'));var util=require('util');var path=require(_0xf865('0x5'));var sox=require(_0xf865('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf865('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf865('0x8'));var deskjs=require(_0xf865('0x9'));var toCsv=require(_0xf865('0xa'));var querystring=require('querystring');var Papa=require(_0xf865('0xb'));var Redis=require(_0xf865('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xf865('0xd'));var as=require(_0xf865('0xe'));var hardwareService=require(_0xf865('0xf'));var logger=require('../../config/logger')(_0xf865('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf865('0x11'))['db'];function respondWithStatusCode(_0xc4670c,_0x37ada7){_0x37ada7=_0x37ada7||0xcc;return function(_0x265661){if(_0x265661){return _0xc4670c['sendStatus'](_0x37ada7);}return _0xc4670c[_0xf865('0x12')](_0x37ada7)['end']();};}function respondWithResult(_0x5d57ac,_0x1e92b5){_0x1e92b5=_0x1e92b5||0xc8;return function(_0x3c3467){if(_0x3c3467){return _0x5d57ac[_0xf865('0x12')](_0x1e92b5)[_0xf865('0x13')](_0x3c3467);}};}function respondWithFilteredResult(_0x3fac7f,_0x2e1f33){return function(_0x31b814){if(_0x31b814){var _0xb1489b=_0x31b814[_0xf865('0x14')],_0x58d817=_0x2e1f33['offset'],_0x96823c=_0x2e1f33[_0xf865('0x15')]+_0x2e1f33[_0xf865('0x16')],_0x56dccb;if(_0x96823c>=_0xb1489b){_0x96823c=_0xb1489b;_0x56dccb=0xc8;}else{_0x56dccb=0xce;}_0x3fac7f[_0xf865('0x12')](_0x56dccb);return _0x3fac7f[_0xf865('0x17')](_0xf865('0x18'),_0x58d817+'-'+_0x96823c+'/'+_0xb1489b)[_0xf865('0x13')](_0x31b814);}return null;};}function patchUpdates(_0x147ec5){return function(_0x1e0e3a){try{jsonpatch[_0xf865('0x19')](_0x1e0e3a,_0x147ec5,!![]);}catch(_0x18b875){return BPromise[_0xf865('0x1a')](_0x18b875);}return _0x1e0e3a[_0xf865('0x1b')]();};}function saveUpdates(_0x23a46a,_0xbc4f97){return function(_0x351a53){if(_0x351a53){return _0x351a53[_0xf865('0x1c')](_0x23a46a)[_0xf865('0x1d')](function(_0x45bb4e){return _0x45bb4e;});}return null;};}function removeEntity(_0x27e0f0,_0x1226e9){return function(_0x3aa4b8){if(_0x3aa4b8){return _0x3aa4b8[_0xf865('0x1e')]()[_0xf865('0x1d')](function(){_0x27e0f0[_0xf865('0x12')](0xcc)[_0xf865('0x1f')]();});}};}function handleEntityNotFound(_0x226419,_0x1f0119){return function(_0x39e734){if(!_0x39e734){_0x226419['sendStatus'](0x194);}return _0x39e734;};}function handleError(_0x4b780e,_0xbc24aa){_0xbc24aa=_0xbc24aa||0x1f4;return function(_0x25505a){logger[_0xf865('0x20')](_0x25505a[_0xf865('0x21')]);if(_0x25505a[_0xf865('0x22')]){delete _0x25505a[_0xf865('0x22')];}_0x4b780e[_0xf865('0x12')](_0xbc24aa)[_0xf865('0x23')](_0x25505a);};}exports[_0xf865('0x24')]=function(_0x5998d8,_0x21a7fd){var _0x248530={'raw':!![],'where':{'id':_0x5998d8[_0xf865('0x25')]['id']}},_0x5a564b={};_0x5a564b['model']=_[_0xf865('0x26')](db[_0xf865('0x27')][_0xf865('0x28')]);_0x5a564b[_0xf865('0x29')]=_['keys'](_0x5998d8[_0xf865('0x29')]);_0x5a564b[_0xf865('0x2a')]=_[_0xf865('0x2b')](_0x5a564b[_0xf865('0x2c')],_0x5a564b[_0xf865('0x29')]);_0x248530['attributes']=_['intersection'](_0x5a564b[_0xf865('0x2c')],qs[_0xf865('0x2d')](_0x5998d8['query'][_0xf865('0x2d')]));_0x248530[_0xf865('0x2e')]=_0x248530['attributes'][_0xf865('0x2f')]?_0x248530[_0xf865('0x2e')]:_0x5a564b['model'];if(_0x5998d8[_0xf865('0x29')]['includeAll']){_0x248530['include']=[{'all':!![]}];}_0x248530=_[_0xf865('0x30')]({},_0x248530,_0x5998d8['options']);return db[_0xf865('0x27')][_0xf865('0x31')](_0x248530)['then'](handleEntityNotFound(_0x21a7fd,null))['then'](respondWithResult(_0x21a7fd,null))[_0xf865('0x32')](handleError(_0x21a7fd,null));};exports[_0xf865('0x1c')]=function(_0x5bfc57,_0x48ed2e){if(_0x5bfc57['body']['id']){delete _0x5bfc57['body']['id'];}return db[_0xf865('0x27')][_0xf865('0x31')]({'where':{'id':_0x5bfc57[_0xf865('0x25')]['id']}})[_0xf865('0x1d')](handleEntityNotFound(_0x48ed2e,null))['then'](saveUpdates(_0x5bfc57['body'],null))[_0xf865('0x1d')](respondWithResult(_0x48ed2e,null))[_0xf865('0x32')](handleError(_0x48ed2e,null));};exports['destroy']=function(_0x3a71b4,_0xbec2ad){return db['ChatApplication'][_0xf865('0x31')]({'where':{'id':_0x3a71b4['params']['id']}})[_0xf865('0x1d')](handleEntityNotFound(_0xbec2ad,null))[_0xf865('0x1d')](removeEntity(_0xbec2ad,null))[_0xf865('0x32')](handleError(_0xbec2ad,null));};
\ No newline at end of file
+var _0x0f66=['options','ChatApplication','find','body','catch','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','params','rawAttributes','keys','filters','intersection','model','query','attributes','fields','includeAll','merge'];(function(_0x117473,_0x485375){var _0x38711a=function(_0x33e119){while(--_0x33e119){_0x117473['push'](_0x117473['shift']());}};_0x38711a(++_0x485375);}(_0x0f66,0xe9));var _0x60f6=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x0f66[_0x4b73a2];return _0x383c66;};'use strict';var pdf=require(_0x60f6('0x0'));var emlformat=require(_0x60f6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x60f6('0x2'));var jsonpatch=require(_0x60f6('0x3'));var rp=require('request-promise');var moment=require(_0x60f6('0x4'));var BPromise=require(_0x60f6('0x5'));var Mustache=require(_0x60f6('0x6'));var util=require(_0x60f6('0x7'));var path=require(_0x60f6('0x8'));var sox=require(_0x60f6('0x9'));var csv=require('to-csv');var ejs=require(_0x60f6('0xa'));var fs=require('fs');var _=require(_0x60f6('0xb'));var squel=require(_0x60f6('0xc'));var crypto=require(_0x60f6('0xd'));var jsforce=require(_0x60f6('0xe'));var deskjs=require(_0x60f6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x60f6('0x10'));var Papa=require('papaparse');var Redis=require(_0x60f6('0x11'));var authService=require(_0x60f6('0x12'));var qs=require(_0x60f6('0x13'));var as=require(_0x60f6('0x14'));var hardwareService=require(_0x60f6('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x60f6('0x16'));var db=require(_0x60f6('0x17'))['db'];function respondWithStatusCode(_0x39bcaa,_0x1b823c){_0x1b823c=_0x1b823c||0xcc;return function(_0x72cf8e){if(_0x72cf8e){return _0x39bcaa['sendStatus'](_0x1b823c);}return _0x39bcaa[_0x60f6('0x18')](_0x1b823c)[_0x60f6('0x19')]();};}function respondWithResult(_0x47f1e8,_0x2b9ae7){_0x2b9ae7=_0x2b9ae7||0xc8;return function(_0x1e3756){if(_0x1e3756){return _0x47f1e8[_0x60f6('0x18')](_0x2b9ae7)[_0x60f6('0x1a')](_0x1e3756);}};}function respondWithFilteredResult(_0x1667e5,_0x56ce79){return function(_0x33af97){if(_0x33af97){var _0xd34f2d=_0x33af97[_0x60f6('0x1b')],_0x579c39=_0x56ce79['offset'],_0x3948f7=_0x56ce79[_0x60f6('0x1c')]+_0x56ce79[_0x60f6('0x1d')],_0x1a20c2;if(_0x3948f7>=_0xd34f2d){_0x3948f7=_0xd34f2d;_0x1a20c2=0xc8;}else{_0x1a20c2=0xce;}_0x1667e5[_0x60f6('0x18')](_0x1a20c2);return _0x1667e5['set'](_0x60f6('0x1e'),_0x579c39+'-'+_0x3948f7+'/'+_0xd34f2d)[_0x60f6('0x1a')](_0x33af97);}return null;};}function patchUpdates(_0x29aed4){return function(_0x1b2d28){try{jsonpatch[_0x60f6('0x1f')](_0x1b2d28,_0x29aed4,!![]);}catch(_0x3e47a9){return BPromise[_0x60f6('0x20')](_0x3e47a9);}return _0x1b2d28[_0x60f6('0x21')]();};}function saveUpdates(_0xe513f4,_0x3a6330){return function(_0x459508){if(_0x459508){return _0x459508[_0x60f6('0x22')](_0xe513f4)[_0x60f6('0x23')](function(_0x546073){return _0x546073;});}return null;};}function removeEntity(_0xdfe436,_0x494319){return function(_0xd57517){if(_0xd57517){return _0xd57517[_0x60f6('0x24')]()['then'](function(){_0xdfe436[_0x60f6('0x18')](0xcc)[_0x60f6('0x19')]();});}};}function handleEntityNotFound(_0x426aa0,_0xf352e1){return function(_0x13cd49){if(!_0x13cd49){_0x426aa0[_0x60f6('0x25')](0x194);}return _0x13cd49;};}function handleError(_0x5423cf,_0x4163b7){_0x4163b7=_0x4163b7||0x1f4;return function(_0x57e2c4){logger[_0x60f6('0x26')](_0x57e2c4[_0x60f6('0x27')]);if(_0x57e2c4[_0x60f6('0x28')]){delete _0x57e2c4[_0x60f6('0x28')];}_0x5423cf[_0x60f6('0x18')](_0x4163b7)['send'](_0x57e2c4);};}exports['show']=function(_0x3f0023,_0x9c6c6){var _0x30ecd2={'raw':!![],'where':{'id':_0x3f0023[_0x60f6('0x29')]['id']}},_0x28b170={};_0x28b170['model']=_['keys'](db['ChatApplication'][_0x60f6('0x2a')]);_0x28b170['query']=_[_0x60f6('0x2b')](_0x3f0023['query']);_0x28b170[_0x60f6('0x2c')]=_[_0x60f6('0x2d')](_0x28b170[_0x60f6('0x2e')],_0x28b170[_0x60f6('0x2f')]);_0x30ecd2[_0x60f6('0x30')]=_[_0x60f6('0x2d')](_0x28b170[_0x60f6('0x2e')],qs[_0x60f6('0x31')](_0x3f0023[_0x60f6('0x2f')]['fields']));_0x30ecd2[_0x60f6('0x30')]=_0x30ecd2[_0x60f6('0x30')]['length']?_0x30ecd2['attributes']:_0x28b170[_0x60f6('0x2e')];if(_0x3f0023['query'][_0x60f6('0x32')]){_0x30ecd2['include']=[{'all':!![]}];}_0x30ecd2=_[_0x60f6('0x33')]({},_0x30ecd2,_0x3f0023[_0x60f6('0x34')]);return db[_0x60f6('0x35')][_0x60f6('0x36')](_0x30ecd2)[_0x60f6('0x23')](handleEntityNotFound(_0x9c6c6,null))[_0x60f6('0x23')](respondWithResult(_0x9c6c6,null))['catch'](handleError(_0x9c6c6,null));};exports[_0x60f6('0x22')]=function(_0x216851,_0x1820fe){if(_0x216851[_0x60f6('0x37')]['id']){delete _0x216851[_0x60f6('0x37')]['id'];}return db[_0x60f6('0x35')][_0x60f6('0x36')]({'where':{'id':_0x216851[_0x60f6('0x29')]['id']}})[_0x60f6('0x23')](handleEntityNotFound(_0x1820fe,null))['then'](saveUpdates(_0x216851[_0x60f6('0x37')],null))[_0x60f6('0x23')](respondWithResult(_0x1820fe,null))[_0x60f6('0x38')](handleError(_0x1820fe,null));};exports[_0x60f6('0x24')]=function(_0x564e8a,_0x3577c5){return db[_0x60f6('0x35')]['find']({'where':{'id':_0x564e8a['params']['id']}})[_0x60f6('0x23')](handleEntityNotFound(_0x3577c5,null))[_0x60f6('0x23')](removeEntity(_0x3577c5,null))[_0x60f6('0x38')](handleError(_0x3577c5,null));};
\ No newline at end of file
index 2f67470..85a3d2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd88c=['utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','chat_applications'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd88c,0x1d5));var _0xcd88=function(_0x3d4488,_0x1b2b82){_0x3d4488=_0x3d4488-0x0;var _0x4a0548=_0xd88c[_0x3d4488];return _0x4a0548;};'use strict';var _=require(_0xcd88('0x0'));var util=require(_0xcd88('0x1'));var logger=require(_0xcd88('0x2'))(_0xcd88('0x3'));var moment=require(_0xcd88('0x4'));var BPromise=require('bluebird');var rp=require(_0xcd88('0x5'));var fs=require('fs');var path=require(_0xcd88('0x6'));var rimraf=require(_0xcd88('0x7'));var config=require(_0xcd88('0x8'));var attributes=require('./chatApplication.attributes');module[_0xcd88('0x9')]=function(_0x18ffef,_0x5eba38){return _0x18ffef[_0xcd88('0xa')]('ChatApplication',attributes,{'tableName':_0xcd88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcd88('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc993=['ChatApplication','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x4e2d4b,_0x39f9e2){var _0x373448=function(_0x5f2832){while(--_0x5f2832){_0x4e2d4b['push'](_0x4e2d4b['shift']());}};_0x373448(++_0x39f9e2);}(_0xc993,0x10b));var _0x3c99=function(_0x5f4eb4,_0x3ec90e){_0x5f4eb4=_0x5f4eb4-0x0;var _0x39b38d=_0xc993[_0x5f4eb4];return _0x39b38d;};'use strict';var _=require(_0x3c99('0x0'));var util=require(_0x3c99('0x1'));var logger=require(_0x3c99('0x2'))(_0x3c99('0x3'));var moment=require(_0x3c99('0x4'));var BPromise=require(_0x3c99('0x5'));var rp=require(_0x3c99('0x6'));var fs=require('fs');var path=require(_0x3c99('0x7'));var rimraf=require(_0x3c99('0x8'));var config=require(_0x3c99('0x9'));var attributes=require(_0x3c99('0xa'));module[_0x3c99('0xb')]=function(_0x54b4d9,_0x15cf23){return _0x54b4d9[_0x3c99('0xc')](_0x3c99('0xd'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 37ff329..12cd620 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe952=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment'];(function(_0x181c25,_0x4ae4cc){var _0x3d229a=function(_0x4a16d6){while(--_0x4a16d6){_0x181c25['push'](_0x181c25['shift']());}};_0x3d229a(++_0x4ae4cc);}(_0xe952,0xfa));var _0x2e95=function(_0x2ec35b,_0x3ad085){_0x2ec35b=_0x2ec35b-0x0;var _0xe92fc0=_0xe952[_0x2ec35b];return _0xe92fc0;};'use strict';var _=require('lodash');var util=require(_0x2e95('0x0'));var moment=require(_0x2e95('0x1'));var BPromise=require(_0x2e95('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2e95('0x3'))['db'];var utils=require(_0x2e95('0x4'));var logger=require(_0x2e95('0x5'))(_0x2e95('0x6'));var config=require(_0x2e95('0x7'));var jayson=require(_0x2e95('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ce659,_0x214a10,_0x55ccfa){return new BPromise(function(_0x3c857b,_0x118160){return client[_0x2e95('0x9')](_0x1ce659,_0x55ccfa)['then'](function(_0x2dde12){logger[_0x2e95('0xa')](_0x2e95('0xb'),_0x214a10,_0x2e95('0xc'));logger[_0x2e95('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x214a10,_0x2e95('0xc'),JSON[_0x2e95('0xe')](_0x2dde12));if(_0x2dde12[_0x2e95('0xf')]){if(_0x2dde12[_0x2e95('0xf')]['code']===0x1f4){logger[_0x2e95('0xf')](_0x2e95('0xb'),_0x214a10,_0x2dde12['error'][_0x2e95('0x10')]);return _0x118160(_0x2dde12['error']['message']);}logger[_0x2e95('0xf')]('ChatApplication,\x20%s,\x20%s',_0x214a10,_0x2dde12[_0x2e95('0xf')]['message']);return _0x3c857b(_0x2dde12['error'][_0x2e95('0x10')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x214a10,_0x2e95('0xc'));_0x3c857b(_0x2dde12['result']['message']);}})[_0x2e95('0x11')](function(_0xafd1b1){logger[_0x2e95('0xf')](_0x2e95('0xb'),_0x214a10,_0xafd1b1);_0x118160(_0xafd1b1);});});}
\ No newline at end of file
+var _0x6692=['stringify','error','code','ChatApplication,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x256420,_0x2b7c8c){var _0x224f67=function(_0x41890a){while(--_0x41890a){_0x256420['push'](_0x256420['shift']());}};_0x224f67(++_0x2b7c8c);}(_0x6692,0x92));var _0x2669=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x6692[_0x397cfb];return _0x15fed9;};'use strict';var _=require(_0x2669('0x0'));var util=require(_0x2669('0x1'));var moment=require(_0x2669('0x2'));var BPromise=require(_0x2669('0x3'));var rs=require(_0x2669('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2669('0x5'))['db'];var utils=require(_0x2669('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2669('0x7'));var jayson=require(_0x2669('0x8'));var client=jayson['client'][_0x2669('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f6028,_0x337c9b,_0x4a725d){return new BPromise(function(_0x497685,_0x4c118f){return client[_0x2669('0xa')](_0x1f6028,_0x4a725d)[_0x2669('0xb')](function(_0x4b868c){logger['info']('ChatApplication,\x20%s,\x20%s',_0x337c9b,_0x2669('0xc'));logger[_0x2669('0xd')](_0x2669('0xe'),_0x337c9b,_0x2669('0xc'),JSON[_0x2669('0xf')](_0x4b868c));if(_0x4b868c['error']){if(_0x4b868c[_0x2669('0x10')][_0x2669('0x11')]===0x1f4){logger[_0x2669('0x10')](_0x2669('0x12'),_0x337c9b,_0x4b868c[_0x2669('0x10')][_0x2669('0x13')]);return _0x4c118f(_0x4b868c[_0x2669('0x10')][_0x2669('0x13')]);}logger[_0x2669('0x10')](_0x2669('0x12'),_0x337c9b,_0x4b868c[_0x2669('0x10')][_0x2669('0x13')]);return _0x497685(_0x4b868c[_0x2669('0x10')]['message']);}else{logger[_0x2669('0x14')]('ChatApplication,\x20%s,\x20%s',_0x337c9b,_0x2669('0xc'));_0x497685(_0x4b868c[_0x2669('0x15')][_0x2669('0x13')]);}})[_0x2669('0x16')](function(_0x2df7d3){logger['error']('ChatApplication,\x20%s,\x20%s',_0x337c9b,_0x2df7d3);_0x4c118f(_0x2df7d3);});});}
\ No newline at end of file
index 287c543..23bca30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa6c=['exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','put','isAuthenticated','update','destroy'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xaa6c,0x12d));var _0xcaa6=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xaa6c[_0x44bcb0];return _0xfaf881;};'use strict';var multer=require(_0xcaa6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcaa6('0x1'));var express=require(_0xcaa6('0x2'));var router=express[_0xcaa6('0x3')]();var auth=require(_0xcaa6('0x4'));var interaction=require(_0xcaa6('0x5'));var config=require(_0xcaa6('0x6'));var controller=require('./chatApplication.controller');router[_0xcaa6('0x7')](_0xcaa6('0x8'),auth['isAuthenticated'](),controller[_0xcaa6('0x9')]);router[_0xcaa6('0xa')](_0xcaa6('0x8'),auth[_0xcaa6('0xb')](),controller[_0xcaa6('0xc')]);router['delete'](_0xcaa6('0x8'),auth['isAuthenticated'](),controller[_0xcaa6('0xd')]);module[_0xcaa6('0xe')]=router;
\ No newline at end of file
+var _0xfc67=['isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','show','/:id'];(function(_0x5107a3,_0x402944){var _0x1ebb36=function(_0x4b0cb9){while(--_0x4b0cb9){_0x5107a3['push'](_0x5107a3['shift']());}};_0x1ebb36(++_0x402944);}(_0xfc67,0x82));var _0x7fc6=function(_0x1460ab,_0x74d06e){_0x1460ab=_0x1460ab-0x0;var _0x1eeb5c=_0xfc67[_0x1460ab];return _0x1eeb5c;};'use strict';var multer=require(_0x7fc6('0x0'));var util=require(_0x7fc6('0x1'));var path=require(_0x7fc6('0x2'));var timeout=require(_0x7fc6('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x7fc6('0x4'));var interaction=require(_0x7fc6('0x5'));var config=require(_0x7fc6('0x6'));var controller=require(_0x7fc6('0x7'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x7fc6('0x8')]);router['put'](_0x7fc6('0x9'),auth[_0x7fc6('0xa')](),controller[_0x7fc6('0xb')]);router[_0x7fc6('0xc')](_0x7fc6('0x9'),auth[_0x7fc6('0xa')](),controller[_0x7fc6('0xd')]);module['exports']=router;
\ No newline at end of file
index 43b4a9d..97e2e47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe351=['BOOLEAN','sequelize','STRING'];(function(_0x57dc39,_0x39ebc7){var _0x2cfaf2=function(_0x1dbf9e){while(--_0x1dbf9e){_0x57dc39['push'](_0x57dc39['shift']());}};_0x2cfaf2(++_0x39ebc7);}(_0xe351,0x11e));var _0x1e35=function(_0x5cecd6,_0x2e85be){_0x5cecd6=_0x5cecd6-0x0;var _0x5364a0=_0xe351[_0x5cecd6];return _0x5364a0;};'use strict';var Sequelize=require(_0x1e35('0x0'));module['exports']={'name':{'type':Sequelize[_0x1e35('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x1e35('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xd725=['exports','STRING','BOOLEAN'];(function(_0x7d4081,_0x25bd1b){var _0x340514=function(_0x3ad5cb){while(--_0x3ad5cb){_0x7d4081['push'](_0x7d4081['shift']());}};_0x340514(++_0x25bd1b);}(_0xd725,0xe1));var _0x5d72=function(_0x22459e,_0x420756){_0x22459e=_0x22459e-0x0;var _0x2dbe52=_0xd725[_0x22459e];return _0x2dbe52;};'use strict';var Sequelize=require('sequelize');module[_0x5d72('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5d72('0x1')]},'write':{'type':Sequelize[_0x5d72('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 4487330..9d5ad97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x035a=['describe','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','removeMembers','ChatGroupId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','destroy','end','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','includeAll','find','create','body','params'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x035a,0x76));var _0xa035=function(_0xd924b6,_0x14fb3b){_0xd924b6=_0xd924b6-0x0;var _0x310f57=_0x035a[_0xd924b6];return _0x310f57;};'use strict';var pdf=require(_0xa035('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa035('0x1'));var zipdir=require(_0xa035('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa035('0x3'));var moment=require(_0xa035('0x4'));var BPromise=require(_0xa035('0x5'));var Mustache=require('mustache');var util=require(_0xa035('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa035('0x7'));var ejs=require(_0xa035('0x8'));var fs=require('fs');var _=require(_0xa035('0x9'));var squel=require(_0xa035('0xa'));var crypto=require(_0xa035('0xb'));var jsforce=require(_0xa035('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa035('0x7'));var querystring=require(_0xa035('0xd'));var Papa=require(_0xa035('0xe'));var Redis=require(_0xa035('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa035('0x10'));var as=require(_0xa035('0x11'));var hardwareService=require(_0xa035('0x12'));var logger=require(_0xa035('0x13'))(_0xa035('0x14'));var utils=require('../../config/utils');var config=require(_0xa035('0x15'));var db=require(_0xa035('0x16'))['db'];config[_0xa035('0x17')]=_['defaults'](config['redis'],{'host':_0xa035('0x18'),'port':0x18eb});var socket=require(_0xa035('0x19'))(new Redis(config[_0xa035('0x17')]));require(_0xa035('0x1a'))[_0xa035('0x1b')](socket);var jayson=require(_0xa035('0x1c'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1b6ae4,_0x40a802,_0x7a9049){if(_0x7a9049){var _0x16d9ed=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16d9ed[_0xa035('0x1d')](_0x40a802)){return _0x1b6ae4;}else{throw new db['Sequelize'][(_0xa035('0x1e'))](_0xa035('0x1f'));}}else{return _0x1b6ae4;}}function respondWithRpcPromise(_0x11f931,_0x5a542b,_0x4a7906,_0xbf4d8){return new BPromise(function(_0x48a6ba,_0x51f322){var _0x3d9e9b=_0xbf4d8||client;return _0x3d9e9b[_0xa035('0x20')](_0x11f931,_0x4a7906)[_0xa035('0x21')](function(_0xd9da09){logger[_0xa035('0x22')]('ChatGroup,\x20%s,\x20%s',_0x5a542b,'request\x20sent');logger['debug'](_0xa035('0x23'),_0x5a542b,_0xa035('0x24'),JSON[_0xa035('0x25')](_0xd9da09));if(_0xd9da09[_0xa035('0x26')]){if(_0xd9da09['error'][_0xa035('0x27')]===0x1f4){logger['error'](_0xa035('0x28'),_0x5a542b,_0xd9da09['error'][_0xa035('0x29')]);return _0x51f322(_0xd9da09['error']['message']);}logger[_0xa035('0x26')](_0xa035('0x28'),_0x5a542b,_0xd9da09['error'][_0xa035('0x29')]);return _0x48a6ba(_0xd9da09[_0xa035('0x26')][_0xa035('0x29')]);}else{logger[_0xa035('0x22')](_0xa035('0x28'),_0x5a542b,_0xa035('0x24'));_0x48a6ba(_0xd9da09[_0xa035('0x2a')][_0xa035('0x29')]);}})[_0xa035('0x2b')](function(_0x35ba6c){logger[_0xa035('0x26')](_0xa035('0x28'),_0x5a542b,_0x35ba6c);_0x51f322(_0x35ba6c);});});}function respondWithStatusCode(_0x4dda21,_0x81276b){_0x81276b=_0x81276b||0xcc;return function(_0x1d814d){if(_0x1d814d){return _0x4dda21[_0xa035('0x2c')](_0x81276b);}return _0x4dda21[_0xa035('0x2d')](_0x81276b)['end']();};}function respondWithResult(_0x1dd63f,_0x30fd90){_0x30fd90=_0x30fd90||0xc8;return function(_0x2442ff){if(_0x2442ff){return _0x1dd63f[_0xa035('0x2d')](_0x30fd90)[_0xa035('0x2e')](_0x2442ff);}};}function respondWithFilteredResult(_0x53cd0a,_0x1c96ed){return function(_0xa2b0ca){if(_0xa2b0ca){var _0x48d1bc=_0xa2b0ca[_0xa035('0x2f')],_0x49d2b1=_0x1c96ed[_0xa035('0x30')],_0x332523=_0x1c96ed['offset']+_0x1c96ed[_0xa035('0x31')],_0x55da4b;if(_0x332523>=_0x48d1bc){_0x332523=_0x48d1bc;_0x55da4b=0xc8;}else{_0x55da4b=0xce;}_0x53cd0a['status'](_0x55da4b);return _0x53cd0a[_0xa035('0x32')](_0xa035('0x33'),_0x49d2b1+'-'+_0x332523+'/'+_0x48d1bc)['json'](_0xa2b0ca);}return null;};}function patchUpdates(_0x806296){return function(_0xe88d1b){try{jsonpatch['apply'](_0xe88d1b,_0x806296,!![]);}catch(_0x2bfcbe){return BPromise['reject'](_0x2bfcbe);}return _0xe88d1b['save']();};}function saveUpdates(_0x236c3d,_0x21a4ce){return function(_0x36f72c){if(_0x36f72c){return _0x36f72c['update'](_0x236c3d)[_0xa035('0x21')](function(_0x330207){return _0x330207;});}return null;};}function removeEntity(_0x3a14f2,_0x36f355){return function(_0x9da281){if(_0x9da281){return _0x9da281[_0xa035('0x34')]()[_0xa035('0x21')](function(){_0x3a14f2[_0xa035('0x2d')](0xcc)[_0xa035('0x35')]();});}};}function handleEntityNotFound(_0x4d6cc0,_0x10c70e){return function(_0x303bde){if(!_0x303bde){_0x4d6cc0[_0xa035('0x2c')](0x194);}return _0x303bde;};}function handleError(_0x5f5bb3,_0x22f51c){_0x22f51c=_0x22f51c||0x1f4;return function(_0x2cfa29){logger[_0xa035('0x26')](_0x2cfa29[_0xa035('0x36')]);if(_0x2cfa29[_0xa035('0x37')]){delete _0x2cfa29[_0xa035('0x37')];}_0x5f5bb3['status'](_0x22f51c)[_0xa035('0x38')](_0x2cfa29);};}exports[_0xa035('0x39')]=function(_0x4d906f,_0x2a4684){var _0x2a517c={},_0x48c09d={},_0xab742={'count':0x0,'rows':[]};var _0x2a095f=_[_0xa035('0x3a')](db[_0xa035('0x3b')][_0xa035('0x3c')],function(_0x39f15c){return{'name':_0x39f15c[_0xa035('0x3d')],'type':_0x39f15c[_0xa035('0x3e')][_0xa035('0x3f')]};});_0x48c09d[_0xa035('0x40')]=_[_0xa035('0x3a')](_0x2a095f,_0xa035('0x37'));_0x48c09d['query']=_[_0xa035('0x41')](_0x4d906f[_0xa035('0x42')]);_0x48c09d[_0xa035('0x43')]=_[_0xa035('0x44')](_0x48c09d[_0xa035('0x40')],_0x48c09d[_0xa035('0x42')]);_0x2a517c[_0xa035('0x45')]=_[_0xa035('0x44')](_0x48c09d[_0xa035('0x40')],qs['fields'](_0x4d906f[_0xa035('0x42')][_0xa035('0x46')]));_0x2a517c[_0xa035('0x45')]=_0x2a517c[_0xa035('0x45')][_0xa035('0x47')]?_0x2a517c[_0xa035('0x45')]:_0x48c09d[_0xa035('0x40')];if(!_0x4d906f[_0xa035('0x42')][_0xa035('0x48')](_0xa035('0x49'))){_0x2a517c[_0xa035('0x31')]=qs[_0xa035('0x31')](_0x4d906f[_0xa035('0x42')][_0xa035('0x31')]);_0x2a517c[_0xa035('0x30')]=qs['offset'](_0x4d906f['query'][_0xa035('0x30')]);}_0x2a517c[_0xa035('0x4a')]=qs[_0xa035('0x4b')](_0x4d906f[_0xa035('0x42')][_0xa035('0x4b')]);_0x2a517c[_0xa035('0x4c')]=qs[_0xa035('0x43')](_[_0xa035('0x4d')](_0x4d906f[_0xa035('0x42')],_0x48c09d[_0xa035('0x43')]),_0x2a095f);if(_0x4d906f['query'][_0xa035('0x4e')]){_0x2a517c[_0xa035('0x4c')]=_[_0xa035('0x4f')](_0x2a517c['where'],{'$or':_[_0xa035('0x3a')](_0x2a095f,function(_0x424d6a){if(_0x424d6a[_0xa035('0x3e')]!==_0xa035('0x50')){var _0xca9007={};_0xca9007[_0x424d6a['name']]={'$like':'%'+_0x4d906f[_0xa035('0x42')][_0xa035('0x4e')]+'%'};return _0xca9007;}})});}_0x2a517c=_[_0xa035('0x4f')]({},_0x2a517c,_0x4d906f[_0xa035('0x51')]);var _0x529c4f={'where':_0x2a517c['where']};return db['ChatGroup'][_0xa035('0x2f')](_0x529c4f)[_0xa035('0x21')](function(_0x5c0f44){_0xab742[_0xa035('0x2f')]=_0x5c0f44;if(_0x4d906f[_0xa035('0x42')]['includeAll']){_0x2a517c[_0xa035('0x52')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x2a517c);})['then'](function(_0x58be71){_0xab742['rows']=_0x58be71;return _0xab742;})[_0xa035('0x21')](respondWithFilteredResult(_0x2a4684,_0x2a517c))[_0xa035('0x2b')](handleError(_0x2a4684,null));};exports['show']=function(_0x4790db,_0x223e81){var _0x1e5096={'raw':!![],'where':{'id':_0x4790db['params']['id']}},_0x44d1d0={};_0x44d1d0[_0xa035('0x40')]=_['keys'](db[_0xa035('0x3b')]['rawAttributes']);_0x44d1d0['query']=_[_0xa035('0x41')](_0x4790db['query']);_0x44d1d0[_0xa035('0x43')]=_[_0xa035('0x44')](_0x44d1d0[_0xa035('0x40')],_0x44d1d0['query']);_0x1e5096[_0xa035('0x45')]=_['intersection'](_0x44d1d0[_0xa035('0x40')],qs[_0xa035('0x46')](_0x4790db['query'][_0xa035('0x46')]));_0x1e5096[_0xa035('0x45')]=_0x1e5096[_0xa035('0x45')][_0xa035('0x47')]?_0x1e5096['attributes']:_0x44d1d0[_0xa035('0x40')];if(_0x4790db[_0xa035('0x42')][_0xa035('0x53')]){_0x1e5096[_0xa035('0x52')]=[{'all':!![]}];}_0x1e5096=_[_0xa035('0x4f')]({},_0x1e5096,_0x4790db[_0xa035('0x51')]);return db[_0xa035('0x3b')][_0xa035('0x54')](_0x1e5096)[_0xa035('0x21')](handleEntityNotFound(_0x223e81,null))['then'](respondWithResult(_0x223e81,null))['catch'](handleError(_0x223e81,null));};exports[_0xa035('0x55')]=function(_0xa1bdc3,_0x6b4a9){return db['ChatGroup'][_0xa035('0x55')](_0xa1bdc3[_0xa035('0x56')],{})['then'](respondWithResult(_0x6b4a9,0xc9))['catch'](handleError(_0x6b4a9,null));};exports['update']=function(_0x23e87a,_0x2e56db){if(_0x23e87a[_0xa035('0x56')]['id']){delete _0x23e87a[_0xa035('0x56')]['id'];}return db[_0xa035('0x3b')][_0xa035('0x54')]({'where':{'id':_0x23e87a[_0xa035('0x57')]['id']}})[_0xa035('0x21')](handleEntityNotFound(_0x2e56db,null))[_0xa035('0x21')](saveUpdates(_0x23e87a['body'],null))[_0xa035('0x21')](respondWithResult(_0x2e56db,null))[_0xa035('0x2b')](handleError(_0x2e56db,null));};exports['destroy']=function(_0xf5b325,_0x140f8b){return db[_0xa035('0x3b')][_0xa035('0x54')]({'where':{'id':_0xf5b325['params']['id']}})[_0xa035('0x21')](handleEntityNotFound(_0x140f8b,null))[_0xa035('0x21')](removeEntity(_0x140f8b,null))[_0xa035('0x2b')](handleError(_0x140f8b,null));};exports[_0xa035('0x58')]=function(_0x214f95,_0x1047fb){return db[_0xa035('0x3b')][_0xa035('0x58')]()[_0xa035('0x21')](respondWithResult(_0x1047fb,null))[_0xa035('0x2b')](handleError(_0x1047fb,null));};exports['getUnread']=function(_0x3a6d45,_0x4ff450,_0x1702fe){return db[_0xa035('0x59')]['count']({'where':{'ChatGroupId':_0x3a6d45['params']['id'],'ToId':_0x3a6d45[_0xa035('0x5a')]['id'],'read':![]}})[_0xa035('0x21')](function(_0x58e620){return{'id':_['toInteger'](_0x3a6d45[_0xa035('0x57')]['id']),'count':_0x58e620};})[_0xa035('0x21')](respondWithResult(_0x4ff450,null))[_0xa035('0x2b')](handleError(_0x4ff450,null));};exports[_0xa035('0x5b')]=function(_0x3261c5,_0x42fd72,_0xbb281){return db[_0xa035('0x3b')][_0xa035('0x54')]({'where':{'id':_0x3261c5[_0xa035('0x57')]['id']}})[_0xa035('0x21')](handleEntityNotFound(_0x42fd72,null))['then'](function(_0x4d3c4e){if(_0x4d3c4e){return _0x4d3c4e[_0xa035('0x5b')](_0x3261c5[_0xa035('0x56')][_0xa035('0x5c')],_[_0xa035('0x5d')](_0x3261c5[_0xa035('0x56')],[_0xa035('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x42fd72,null))['catch'](handleError(_0x42fd72,null));};exports[_0xa035('0x5e')]=function(_0x52f51d,_0x483ad9,_0x4ac39a){var _0x76165={};var _0x191788={};var _0x2861fb;var _0x18398a;return db[_0xa035('0x3b')][_0xa035('0x5f')]({'where':{'id':_0x52f51d['params']['id']}})[_0xa035('0x21')](handleEntityNotFound(_0x483ad9,null))[_0xa035('0x21')](function(_0x25f5bd){if(_0x25f5bd){_0x2861fb=_0x25f5bd;_0x191788[_0xa035('0x40')]=_[_0xa035('0x41')](db[_0xa035('0x60')]['rawAttributes']);_0x191788['query']=_['keys'](_0x52f51d[_0xa035('0x42')]);_0x191788[_0xa035('0x43')]=_[_0xa035('0x44')](_0x191788[_0xa035('0x40')],_0x191788[_0xa035('0x42')]);_0x76165[_0xa035('0x45')]=_[_0xa035('0x44')](_0x191788['model'],qs[_0xa035('0x46')](_0x52f51d[_0xa035('0x42')][_0xa035('0x46')]));_0x76165[_0xa035('0x45')]=_0x76165['attributes'][_0xa035('0x47')]?_0x76165[_0xa035('0x45')]:_0x191788['model'];_0x76165[_0xa035('0x4a')]=qs[_0xa035('0x4b')](_0x52f51d[_0xa035('0x42')][_0xa035('0x4b')]);_0x76165[_0xa035('0x4c')]=qs['filters'](_[_0xa035('0x4d')](_0x52f51d['query'],_0x191788['filters']));if(_0x52f51d[_0xa035('0x42')]['filter']){_0x76165[_0xa035('0x4c')]=_[_0xa035('0x4f')](_0x76165['where'],{'$or':_[_0xa035('0x3a')](_0x76165[_0xa035('0x45')],function(_0x55768c){var _0x51d216={};_0x51d216[_0x55768c]={'$like':'%'+_0x52f51d['query'][_0xa035('0x4e')]+'%'};return _0x51d216;})});}_0x76165=_[_0xa035('0x4f')]({},_0x76165,_0x52f51d['options']);return _0x2861fb[_0xa035('0x5e')](_0x76165);}})[_0xa035('0x21')](function(_0x3b9913){if(_0x3b9913){_0x18398a=_0x3b9913[_0xa035('0x47')];if(!_0x52f51d[_0xa035('0x42')][_0xa035('0x48')](_0xa035('0x49'))){_0x76165[_0xa035('0x31')]=qs[_0xa035('0x31')](_0x52f51d[_0xa035('0x42')][_0xa035('0x31')]);_0x76165['offset']=qs['offset'](_0x52f51d[_0xa035('0x42')]['offset']);}return _0x2861fb[_0xa035('0x5e')](_0x76165);}})[_0xa035('0x21')](function(_0x2246b4){if(_0x2246b4){return _0x2246b4?{'count':_0x18398a,'rows':_0x2246b4}:null;}})[_0xa035('0x21')](respondWithResult(_0x483ad9,null))[_0xa035('0x2b')](handleError(_0x483ad9,null));};exports['removeMembers']=function(_0x22c595,_0x9d8cbe,_0x45f206){return db[_0xa035('0x3b')][_0xa035('0x54')]({'where':{'id':_0x22c595[_0xa035('0x57')]['id']}})[_0xa035('0x21')](handleEntityNotFound(_0x9d8cbe,null))[_0xa035('0x21')](function(_0x5b392f){if(_0x5b392f){return _0x5b392f[_0xa035('0x61')](_0x22c595[_0xa035('0x42')][_0xa035('0x5c')]);}})[_0xa035('0x21')](respondWithStatusCode(_0x9d8cbe,null))[_0xa035('0x2b')](handleError(_0x9d8cbe,null));};exports['addMessage']=function(_0x4bb1ae,_0x39e04f,_0x52a81f){if(_0x4bb1ae[_0xa035('0x56')]['id']){delete _0x4bb1ae[_0xa035('0x56')]['id'];}return db[_0xa035('0x3b')][_0xa035('0x54')]({'where':{'id':_0x4bb1ae[_0xa035('0x57')]['id']}})['then'](handleEntityNotFound(_0x39e04f,null))[_0xa035('0x21')](function(_0x55148e){if(_0x55148e){_0x4bb1ae[_0xa035('0x56')][_0xa035('0x62')]=_0x55148e['id'];return db[_0xa035('0x59')]['create'](_0x4bb1ae[_0xa035('0x56')]);}})[_0xa035('0x21')](respondWithResult(_0x39e04f,null))[_0xa035('0x2b')](handleError(_0x39e04f,null));};exports['getMessages']=function(_0x2f7474,_0x2d712b,_0x30dfbd){var _0xc9ae39={};var _0x467a67={};var _0x570584;var _0x41df52;return db['ChatGroup'][_0xa035('0x5f')]({'where':{'id':_0x2f7474[_0xa035('0x57')]['id']}})['then'](handleEntityNotFound(_0x2d712b,null))[_0xa035('0x21')](function(_0x19ab09){if(_0x19ab09){_0x570584=_0x19ab09;_0x467a67['model']=_[_0xa035('0x41')](db[_0xa035('0x59')]['rawAttributes']);_0x467a67[_0xa035('0x42')]=_[_0xa035('0x41')](_0x2f7474[_0xa035('0x42')]);_0x467a67[_0xa035('0x43')]=_[_0xa035('0x44')](_0x467a67[_0xa035('0x40')],_0x467a67['query']);_0xc9ae39['attributes']=_[_0xa035('0x44')](_0x467a67[_0xa035('0x40')],qs[_0xa035('0x46')](_0x2f7474[_0xa035('0x42')][_0xa035('0x46')]));_0xc9ae39[_0xa035('0x45')]=_0xc9ae39[_0xa035('0x45')][_0xa035('0x47')]?_0xc9ae39[_0xa035('0x45')]:_0x467a67['model'];_0xc9ae39[_0xa035('0x4a')]=qs[_0xa035('0x4b')](_0x2f7474['query'][_0xa035('0x4b')]);_0xc9ae39[_0xa035('0x4c')]=qs[_0xa035('0x43')](_[_0xa035('0x4d')](_0x2f7474[_0xa035('0x42')],_0x467a67[_0xa035('0x43')]));if(_0x2f7474['query'][_0xa035('0x4e')]){_0xc9ae39[_0xa035('0x4c')]=_[_0xa035('0x4f')](_0xc9ae39[_0xa035('0x4c')],{'$or':_[_0xa035('0x3a')](_0xc9ae39[_0xa035('0x45')],function(_0x154f77){var _0x3eeb53={};_0x3eeb53[_0x154f77]={'$like':'%'+_0x2f7474[_0xa035('0x42')]['filter']+'%'};return _0x3eeb53;})});}if(_0x2f7474[_0xa035('0x42')][_0xa035('0x63')]){var _0x319274=_0x2f7474[_0xa035('0x42')]['$gte'][_0xa035('0x64')](',');var _0x2c30c6={};_0x2c30c6[_0x319274[0x0]]={'$gte':moment(_0x319274[0x1])['format'](_0xa035('0x65'))};_0xc9ae39['where']=_[_0xa035('0x4f')](_0xc9ae39[_0xa035('0x4c')],_0x2c30c6);}_0xc9ae39=_[_0xa035('0x4f')]({},_0xc9ae39,_0x2f7474[_0xa035('0x51')]);return _0x570584['getMessages'](_0xc9ae39);}})['then'](function(_0x5dda77){if(_0x5dda77){_0x41df52=_0x5dda77['length'];if(!_0x2f7474['query'][_0xa035('0x48')](_0xa035('0x49'))){_0xc9ae39[_0xa035('0x31')]=qs['limit'](_0x2f7474[_0xa035('0x42')][_0xa035('0x31')]);_0xc9ae39[_0xa035('0x30')]=qs[_0xa035('0x30')](_0x2f7474[_0xa035('0x42')][_0xa035('0x30')]);}return _0x570584[_0xa035('0x66')](_0xc9ae39);}})[_0xa035('0x21')](function(_0x3e8fbe){if(_0x3e8fbe){return _0x3e8fbe?{'count':_0x41df52,'rows':_0x3e8fbe}:null;}})[_0xa035('0x21')](respondWithResult(_0x2d712b,null))['catch'](handleError(_0x2d712b,null));};
\ No newline at end of file
+var _0x3ce1=['find','create','body','describe','getUnread','user','addMembers','ids','findOne','User','order','getMembers','hasOwnProperty','addMessage','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','jayson/promise','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll','rows','show','params','length'];(function(_0x592722,_0x3db651){var _0x1eb997=function(_0x457e7d){while(--_0x457e7d){_0x592722['push'](_0x592722['shift']());}};_0x1eb997(++_0x3db651);}(_0x3ce1,0x7d));var _0x13ce=function(_0x2f4ae7,_0x2c0c50){_0x2f4ae7=_0x2f4ae7-0x0;var _0x4dd0d5=_0x3ce1[_0x2f4ae7];return _0x4dd0d5;};'use strict';var pdf=require(_0x13ce('0x0'));var emlformat=require(_0x13ce('0x1'));var rimraf=require(_0x13ce('0x2'));var zipdir=require(_0x13ce('0x3'));var jsonpatch=require(_0x13ce('0x4'));var rp=require(_0x13ce('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x13ce('0x6'));var path=require('path');var sox=require(_0x13ce('0x7'));var csv=require(_0x13ce('0x8'));var ejs=require(_0x13ce('0x9'));var fs=require('fs');var _=require(_0x13ce('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x13ce('0xb'));var deskjs=require(_0x13ce('0xc'));var toCsv=require(_0x13ce('0x8'));var querystring=require(_0x13ce('0xd'));var Papa=require('papaparse');var Redis=require(_0x13ce('0xe'));var authService=require(_0x13ce('0xf'));var qs=require(_0x13ce('0x10'));var as=require(_0x13ce('0x11'));var hardwareService=require(_0x13ce('0x12'));var logger=require(_0x13ce('0x13'))(_0x13ce('0x14'));var utils=require('../../config/utils');var config=require(_0x13ce('0x15'));var db=require(_0x13ce('0x16'))['db'];config[_0x13ce('0x17')]=_[_0x13ce('0x18')](config[_0x13ce('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x13ce('0x19'))(new Redis(config[_0x13ce('0x17')]));require(_0x13ce('0x1a'))[_0x13ce('0x1b')](socket);var jayson=require(_0x13ce('0x1c'));var client=jayson['client'][_0x13ce('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x1c8377,_0x389a7e,_0x1093a2){if(_0x1093a2){var _0x505e26=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x505e26['test'](_0x389a7e)){return _0x1c8377;}else{throw new db[(_0x13ce('0x1e'))]['ValidationError'](_0x13ce('0x1f'));}}else{return _0x1c8377;}}function respondWithRpcPromise(_0x192bee,_0x5272b1,_0x1937d4,_0x2b26f8){return new BPromise(function(_0xfef415,_0xafc890){var _0x402e2c=_0x2b26f8||client;return _0x402e2c[_0x13ce('0x20')](_0x192bee,_0x1937d4)[_0x13ce('0x21')](function(_0x214e1e){logger[_0x13ce('0x22')](_0x13ce('0x23'),_0x5272b1,_0x13ce('0x24'));logger[_0x13ce('0x25')](_0x13ce('0x26'),_0x5272b1,_0x13ce('0x24'),JSON['stringify'](_0x214e1e));if(_0x214e1e[_0x13ce('0x27')]){if(_0x214e1e[_0x13ce('0x27')]['code']===0x1f4){logger[_0x13ce('0x27')](_0x13ce('0x23'),_0x5272b1,_0x214e1e['error'][_0x13ce('0x28')]);return _0xafc890(_0x214e1e[_0x13ce('0x27')]['message']);}logger[_0x13ce('0x27')](_0x13ce('0x23'),_0x5272b1,_0x214e1e[_0x13ce('0x27')][_0x13ce('0x28')]);return _0xfef415(_0x214e1e[_0x13ce('0x27')][_0x13ce('0x28')]);}else{logger[_0x13ce('0x22')]('ChatGroup,\x20%s,\x20%s',_0x5272b1,_0x13ce('0x24'));_0xfef415(_0x214e1e[_0x13ce('0x29')][_0x13ce('0x28')]);}})[_0x13ce('0x2a')](function(_0x41dee7){logger[_0x13ce('0x27')]('ChatGroup,\x20%s,\x20%s',_0x5272b1,_0x41dee7);_0xafc890(_0x41dee7);});});}function respondWithStatusCode(_0x5dfd25,_0x272d30){_0x272d30=_0x272d30||0xcc;return function(_0x4e2ce6){if(_0x4e2ce6){return _0x5dfd25['sendStatus'](_0x272d30);}return _0x5dfd25[_0x13ce('0x2b')](_0x272d30)[_0x13ce('0x2c')]();};}function respondWithResult(_0x246997,_0x360092){_0x360092=_0x360092||0xc8;return function(_0x67472b){if(_0x67472b){return _0x246997[_0x13ce('0x2b')](_0x360092)[_0x13ce('0x2d')](_0x67472b);}};}function respondWithFilteredResult(_0x29cc33,_0x287c49){return function(_0x2b9264){if(_0x2b9264){var _0x17a635=_0x2b9264['count'],_0x3b11d9=_0x287c49['offset'],_0x5903ce=_0x287c49[_0x13ce('0x2e')]+_0x287c49[_0x13ce('0x2f')],_0x182749;if(_0x5903ce>=_0x17a635){_0x5903ce=_0x17a635;_0x182749=0xc8;}else{_0x182749=0xce;}_0x29cc33[_0x13ce('0x2b')](_0x182749);return _0x29cc33[_0x13ce('0x30')](_0x13ce('0x31'),_0x3b11d9+'-'+_0x5903ce+'/'+_0x17a635)[_0x13ce('0x2d')](_0x2b9264);}return null;};}function patchUpdates(_0x2a2c90){return function(_0x5c7c58){try{jsonpatch[_0x13ce('0x32')](_0x5c7c58,_0x2a2c90,!![]);}catch(_0x543421){return BPromise['reject'](_0x543421);}return _0x5c7c58[_0x13ce('0x33')]();};}function saveUpdates(_0x23b1ce,_0x4287a2){return function(_0x2a0c58){if(_0x2a0c58){return _0x2a0c58[_0x13ce('0x34')](_0x23b1ce)[_0x13ce('0x21')](function(_0x1e1d55){return _0x1e1d55;});}return null;};}function removeEntity(_0x3d2b24,_0x49e4d4){return function(_0xe63c6f){if(_0xe63c6f){return _0xe63c6f[_0x13ce('0x35')]()[_0x13ce('0x21')](function(){_0x3d2b24[_0x13ce('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38490a,_0x230597){return function(_0x5b5c0a){if(!_0x5b5c0a){_0x38490a['sendStatus'](0x194);}return _0x5b5c0a;};}function handleError(_0x2beeb9,_0x1420dc){_0x1420dc=_0x1420dc||0x1f4;return function(_0x3b861e){logger[_0x13ce('0x27')](_0x3b861e[_0x13ce('0x36')]);if(_0x3b861e[_0x13ce('0x37')]){delete _0x3b861e['name'];}_0x2beeb9[_0x13ce('0x2b')](_0x1420dc)['send'](_0x3b861e);};}exports[_0x13ce('0x38')]=function(_0xd75b,_0x41fc55){var _0x5c6d14={},_0x451fb4={},_0x1dea41={'count':0x0,'rows':[]};var _0x1b57bc=_[_0x13ce('0x39')](db[_0x13ce('0x3a')][_0x13ce('0x3b')],function(_0x37e10a){return{'name':_0x37e10a[_0x13ce('0x3c')],'type':_0x37e10a[_0x13ce('0x3d')][_0x13ce('0x3e')]};});_0x451fb4['model']=_['map'](_0x1b57bc,'name');_0x451fb4[_0x13ce('0x3f')]=_[_0x13ce('0x40')](_0xd75b[_0x13ce('0x3f')]);_0x451fb4[_0x13ce('0x41')]=_[_0x13ce('0x42')](_0x451fb4['model'],_0x451fb4[_0x13ce('0x3f')]);_0x5c6d14[_0x13ce('0x43')]=_[_0x13ce('0x42')](_0x451fb4[_0x13ce('0x44')],qs[_0x13ce('0x45')](_0xd75b['query']['fields']));_0x5c6d14[_0x13ce('0x43')]=_0x5c6d14[_0x13ce('0x43')]['length']?_0x5c6d14[_0x13ce('0x43')]:_0x451fb4[_0x13ce('0x44')];if(!_0xd75b[_0x13ce('0x3f')]['hasOwnProperty'](_0x13ce('0x46'))){_0x5c6d14[_0x13ce('0x2f')]=qs[_0x13ce('0x2f')](_0xd75b[_0x13ce('0x3f')][_0x13ce('0x2f')]);_0x5c6d14[_0x13ce('0x2e')]=qs[_0x13ce('0x2e')](_0xd75b[_0x13ce('0x3f')][_0x13ce('0x2e')]);}_0x5c6d14['order']=qs[_0x13ce('0x47')](_0xd75b['query'][_0x13ce('0x47')]);_0x5c6d14[_0x13ce('0x48')]=qs[_0x13ce('0x41')](_[_0x13ce('0x49')](_0xd75b[_0x13ce('0x3f')],_0x451fb4[_0x13ce('0x41')]),_0x1b57bc);if(_0xd75b[_0x13ce('0x3f')][_0x13ce('0x4a')]){_0x5c6d14[_0x13ce('0x48')]=_['merge'](_0x5c6d14[_0x13ce('0x48')],{'$or':_['map'](_0x1b57bc,function(_0x5dd43d){if(_0x5dd43d[_0x13ce('0x3d')]!==_0x13ce('0x4b')){var _0x360e54={};_0x360e54[_0x5dd43d[_0x13ce('0x37')]]={'$like':'%'+_0xd75b[_0x13ce('0x3f')]['filter']+'%'};return _0x360e54;}})});}_0x5c6d14=_[_0x13ce('0x4c')]({},_0x5c6d14,_0xd75b[_0x13ce('0x4d')]);var _0x49238d={'where':_0x5c6d14[_0x13ce('0x48')]};return db[_0x13ce('0x3a')]['count'](_0x49238d)[_0x13ce('0x21')](function(_0x23d7cc){_0x1dea41[_0x13ce('0x4e')]=_0x23d7cc;if(_0xd75b[_0x13ce('0x3f')]['includeAll']){_0x5c6d14[_0x13ce('0x4f')]=[{'all':!![]}];}return db[_0x13ce('0x3a')][_0x13ce('0x50')](_0x5c6d14);})[_0x13ce('0x21')](function(_0x9f0db8){_0x1dea41[_0x13ce('0x51')]=_0x9f0db8;return _0x1dea41;})[_0x13ce('0x21')](respondWithFilteredResult(_0x41fc55,_0x5c6d14))[_0x13ce('0x2a')](handleError(_0x41fc55,null));};exports[_0x13ce('0x52')]=function(_0x560ce1,_0x4486f6){var _0x47e654={'raw':!![],'where':{'id':_0x560ce1[_0x13ce('0x53')]['id']}},_0x147441={};_0x147441[_0x13ce('0x44')]=_[_0x13ce('0x40')](db['ChatGroup'][_0x13ce('0x3b')]);_0x147441[_0x13ce('0x3f')]=_[_0x13ce('0x40')](_0x560ce1[_0x13ce('0x3f')]);_0x147441['filters']=_['intersection'](_0x147441['model'],_0x147441[_0x13ce('0x3f')]);_0x47e654[_0x13ce('0x43')]=_['intersection'](_0x147441['model'],qs['fields'](_0x560ce1[_0x13ce('0x3f')][_0x13ce('0x45')]));_0x47e654['attributes']=_0x47e654[_0x13ce('0x43')][_0x13ce('0x54')]?_0x47e654['attributes']:_0x147441['model'];if(_0x560ce1['query']['includeAll']){_0x47e654[_0x13ce('0x4f')]=[{'all':!![]}];}_0x47e654=_[_0x13ce('0x4c')]({},_0x47e654,_0x560ce1[_0x13ce('0x4d')]);return db['ChatGroup'][_0x13ce('0x55')](_0x47e654)[_0x13ce('0x21')](handleEntityNotFound(_0x4486f6,null))[_0x13ce('0x21')](respondWithResult(_0x4486f6,null))['catch'](handleError(_0x4486f6,null));};exports[_0x13ce('0x56')]=function(_0x5d9618,_0x2a31c8){return db[_0x13ce('0x3a')][_0x13ce('0x56')](_0x5d9618[_0x13ce('0x57')],{})[_0x13ce('0x21')](respondWithResult(_0x2a31c8,0xc9))['catch'](handleError(_0x2a31c8,null));};exports[_0x13ce('0x34')]=function(_0x16ef15,_0x2116e4){if(_0x16ef15['body']['id']){delete _0x16ef15[_0x13ce('0x57')]['id'];}return db['ChatGroup'][_0x13ce('0x55')]({'where':{'id':_0x16ef15[_0x13ce('0x53')]['id']}})[_0x13ce('0x21')](handleEntityNotFound(_0x2116e4,null))[_0x13ce('0x21')](saveUpdates(_0x16ef15[_0x13ce('0x57')],null))[_0x13ce('0x21')](respondWithResult(_0x2116e4,null))['catch'](handleError(_0x2116e4,null));};exports[_0x13ce('0x35')]=function(_0x2cfb22,_0x8505eb){return db[_0x13ce('0x3a')][_0x13ce('0x55')]({'where':{'id':_0x2cfb22[_0x13ce('0x53')]['id']}})[_0x13ce('0x21')](handleEntityNotFound(_0x8505eb,null))[_0x13ce('0x21')](removeEntity(_0x8505eb,null))['catch'](handleError(_0x8505eb,null));};exports[_0x13ce('0x58')]=function(_0xbc74b9,_0x2abc89){return db[_0x13ce('0x3a')][_0x13ce('0x58')]()['then'](respondWithResult(_0x2abc89,null))[_0x13ce('0x2a')](handleError(_0x2abc89,null));};exports[_0x13ce('0x59')]=function(_0x3662ab,_0x92811d,_0x540573){return db['ChatInternalMessage'][_0x13ce('0x4e')]({'where':{'ChatGroupId':_0x3662ab[_0x13ce('0x53')]['id'],'ToId':_0x3662ab[_0x13ce('0x5a')]['id'],'read':![]}})['then'](function(_0x106a44){return{'id':_['toInteger'](_0x3662ab[_0x13ce('0x53')]['id']),'count':_0x106a44};})['then'](respondWithResult(_0x92811d,null))['catch'](handleError(_0x92811d,null));};exports[_0x13ce('0x5b')]=function(_0x584ce3,_0x1a794a,_0x3bfac2){return db[_0x13ce('0x3a')][_0x13ce('0x55')]({'where':{'id':_0x584ce3[_0x13ce('0x53')]['id']}})['then'](handleEntityNotFound(_0x1a794a,null))[_0x13ce('0x21')](function(_0x1bdd2e){if(_0x1bdd2e){return _0x1bdd2e[_0x13ce('0x5b')](_0x584ce3[_0x13ce('0x57')][_0x13ce('0x5c')],_['omit'](_0x584ce3[_0x13ce('0x57')],[_0x13ce('0x5c'),'id'])||{});}})[_0x13ce('0x21')](respondWithResult(_0x1a794a,null))[_0x13ce('0x2a')](handleError(_0x1a794a,null));};exports['getMembers']=function(_0x41656a,_0x74de2a,_0x5631f2){var _0x557291={};var _0x4d3809={};var _0x16db7a;var _0x4b1535;return db[_0x13ce('0x3a')][_0x13ce('0x5d')]({'where':{'id':_0x41656a['params']['id']}})[_0x13ce('0x21')](handleEntityNotFound(_0x74de2a,null))['then'](function(_0x162cc5){if(_0x162cc5){_0x16db7a=_0x162cc5;_0x4d3809[_0x13ce('0x44')]=_['keys'](db[_0x13ce('0x5e')][_0x13ce('0x3b')]);_0x4d3809[_0x13ce('0x3f')]=_['keys'](_0x41656a[_0x13ce('0x3f')]);_0x4d3809[_0x13ce('0x41')]=_[_0x13ce('0x42')](_0x4d3809[_0x13ce('0x44')],_0x4d3809[_0x13ce('0x3f')]);_0x557291[_0x13ce('0x43')]=_[_0x13ce('0x42')](_0x4d3809[_0x13ce('0x44')],qs['fields'](_0x41656a['query'][_0x13ce('0x45')]));_0x557291[_0x13ce('0x43')]=_0x557291[_0x13ce('0x43')]['length']?_0x557291['attributes']:_0x4d3809['model'];_0x557291[_0x13ce('0x5f')]=qs[_0x13ce('0x47')](_0x41656a['query'][_0x13ce('0x47')]);_0x557291[_0x13ce('0x48')]=qs['filters'](_[_0x13ce('0x49')](_0x41656a[_0x13ce('0x3f')],_0x4d3809['filters']));if(_0x41656a[_0x13ce('0x3f')][_0x13ce('0x4a')]){_0x557291['where']=_['merge'](_0x557291[_0x13ce('0x48')],{'$or':_[_0x13ce('0x39')](_0x557291[_0x13ce('0x43')],function(_0x1e18e7){var _0x6efb8b={};_0x6efb8b[_0x1e18e7]={'$like':'%'+_0x41656a['query'][_0x13ce('0x4a')]+'%'};return _0x6efb8b;})});}_0x557291=_[_0x13ce('0x4c')]({},_0x557291,_0x41656a[_0x13ce('0x4d')]);return _0x16db7a[_0x13ce('0x60')](_0x557291);}})[_0x13ce('0x21')](function(_0x71272b){if(_0x71272b){_0x4b1535=_0x71272b[_0x13ce('0x54')];if(!_0x41656a['query'][_0x13ce('0x61')]('nolimit')){_0x557291['limit']=qs[_0x13ce('0x2f')](_0x41656a[_0x13ce('0x3f')][_0x13ce('0x2f')]);_0x557291[_0x13ce('0x2e')]=qs[_0x13ce('0x2e')](_0x41656a[_0x13ce('0x3f')]['offset']);}return _0x16db7a['getMembers'](_0x557291);}})['then'](function(_0x384d91){if(_0x384d91){return _0x384d91?{'count':_0x4b1535,'rows':_0x384d91}:null;}})[_0x13ce('0x21')](respondWithResult(_0x74de2a,null))['catch'](handleError(_0x74de2a,null));};exports['removeMembers']=function(_0x3fa7cf,_0x41e300,_0x1528d6){return db[_0x13ce('0x3a')][_0x13ce('0x55')]({'where':{'id':_0x3fa7cf['params']['id']}})[_0x13ce('0x21')](handleEntityNotFound(_0x41e300,null))['then'](function(_0x30571c){if(_0x30571c){return _0x30571c['removeMembers'](_0x3fa7cf[_0x13ce('0x3f')][_0x13ce('0x5c')]);}})['then'](respondWithStatusCode(_0x41e300,null))[_0x13ce('0x2a')](handleError(_0x41e300,null));};exports[_0x13ce('0x62')]=function(_0x2558e2,_0x5639c0,_0x2c5aa9){if(_0x2558e2[_0x13ce('0x57')]['id']){delete _0x2558e2[_0x13ce('0x57')]['id'];}return db[_0x13ce('0x3a')][_0x13ce('0x55')]({'where':{'id':_0x2558e2[_0x13ce('0x53')]['id']}})[_0x13ce('0x21')](handleEntityNotFound(_0x5639c0,null))[_0x13ce('0x21')](function(_0x1b1b1e){if(_0x1b1b1e){_0x2558e2[_0x13ce('0x57')]['ChatGroupId']=_0x1b1b1e['id'];return db[_0x13ce('0x63')]['create'](_0x2558e2[_0x13ce('0x57')]);}})[_0x13ce('0x21')](respondWithResult(_0x5639c0,null))['catch'](handleError(_0x5639c0,null));};exports['getMessages']=function(_0x3e307a,_0x15c5d9,_0x3dbdf1){var _0x2ac996={};var _0x588481={};var _0x401a5e;var _0x10e1e4;return db[_0x13ce('0x3a')][_0x13ce('0x5d')]({'where':{'id':_0x3e307a['params']['id']}})[_0x13ce('0x21')](handleEntityNotFound(_0x15c5d9,null))[_0x13ce('0x21')](function(_0x3dab45){if(_0x3dab45){_0x401a5e=_0x3dab45;_0x588481[_0x13ce('0x44')]=_[_0x13ce('0x40')](db[_0x13ce('0x63')]['rawAttributes']);_0x588481[_0x13ce('0x3f')]=_[_0x13ce('0x40')](_0x3e307a['query']);_0x588481[_0x13ce('0x41')]=_[_0x13ce('0x42')](_0x588481['model'],_0x588481[_0x13ce('0x3f')]);_0x2ac996[_0x13ce('0x43')]=_['intersection'](_0x588481[_0x13ce('0x44')],qs[_0x13ce('0x45')](_0x3e307a[_0x13ce('0x3f')][_0x13ce('0x45')]));_0x2ac996[_0x13ce('0x43')]=_0x2ac996['attributes'][_0x13ce('0x54')]?_0x2ac996[_0x13ce('0x43')]:_0x588481[_0x13ce('0x44')];_0x2ac996[_0x13ce('0x5f')]=qs['sort'](_0x3e307a[_0x13ce('0x3f')][_0x13ce('0x47')]);_0x2ac996[_0x13ce('0x48')]=qs[_0x13ce('0x41')](_['pick'](_0x3e307a['query'],_0x588481[_0x13ce('0x41')]));if(_0x3e307a[_0x13ce('0x3f')][_0x13ce('0x4a')]){_0x2ac996['where']=_[_0x13ce('0x4c')](_0x2ac996[_0x13ce('0x48')],{'$or':_['map'](_0x2ac996['attributes'],function(_0xa656d){var _0x2bd781={};_0x2bd781[_0xa656d]={'$like':'%'+_0x3e307a['query'][_0x13ce('0x4a')]+'%'};return _0x2bd781;})});}if(_0x3e307a[_0x13ce('0x3f')][_0x13ce('0x64')]){var _0x3ce100=_0x3e307a['query'][_0x13ce('0x64')][_0x13ce('0x65')](',');var _0xc8ef62={};_0xc8ef62[_0x3ce100[0x0]]={'$gte':moment(_0x3ce100[0x1])[_0x13ce('0x66')](_0x13ce('0x67'))};_0x2ac996['where']=_[_0x13ce('0x4c')](_0x2ac996['where'],_0xc8ef62);}_0x2ac996=_[_0x13ce('0x4c')]({},_0x2ac996,_0x3e307a[_0x13ce('0x4d')]);return _0x401a5e[_0x13ce('0x68')](_0x2ac996);}})['then'](function(_0xbddecc){if(_0xbddecc){_0x10e1e4=_0xbddecc[_0x13ce('0x54')];if(!_0x3e307a[_0x13ce('0x3f')][_0x13ce('0x61')](_0x13ce('0x46'))){_0x2ac996[_0x13ce('0x2f')]=qs[_0x13ce('0x2f')](_0x3e307a[_0x13ce('0x3f')]['limit']);_0x2ac996['offset']=qs[_0x13ce('0x2e')](_0x3e307a[_0x13ce('0x3f')][_0x13ce('0x2e')]);}return _0x401a5e['getMessages'](_0x2ac996);}})['then'](function(_0x4a4178){if(_0x4a4178){return _0x4a4178?{'count':_0x10e1e4,'rows':_0x4a4178}:null;}})['then'](respondWithResult(_0x15c5d9,null))[_0x13ce('0x2a')](handleError(_0x15c5d9,null));};
\ No newline at end of file
index 315bfcf..12cbf30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['exports','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x2032,0xd9));var _0x2203=function(_0x144bcd,_0x218dba){_0x144bcd=_0x144bcd-0x0;var _0x13788a=_0x2032[_0x144bcd];return _0x13788a;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2203('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2203('0x3'),'afterDestroy':_0x2203('0x4')};function emitEvent(_0x4b4c7f){return function(_0x46c49a,_0x880dcd,_0x44ccfd){ChatGroupEvents[_0x2203('0x5')](_0x4b4c7f+':'+_0x46c49a['id'],_0x46c49a);ChatGroupEvents[_0x2203('0x5')](_0x4b4c7f,_0x46c49a);_0x44ccfd(null);};}for(var e in events){if(events[_0x2203('0x6')](e)){var event=events[e];ChatGroup[_0x2203('0x7')](e,emitEvent(event));}}module[_0x2203('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xdb28=['ChatGroup','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x1eaa2b,_0xc218ed){var _0xefc94=function(_0x3cf20f){while(--_0x3cf20f){_0x1eaa2b['push'](_0x1eaa2b['shift']());}};_0xefc94(++_0xc218ed);}(_0xdb28,0x106));var _0x8db2=function(_0x3a80a0,_0x1beb1d){_0x3a80a0=_0x3a80a0-0x0;var _0x46df43=_0xdb28[_0x3a80a0];return _0x46df43;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var ChatGroup=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=ChatGroupEvents;
\ No newline at end of file
index 12fe736..d948c4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1db9=['ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x1c4b46,_0x26ba44){var _0x32f50c=function(_0x4593f0){while(--_0x4593f0){_0x1c4b46['push'](_0x1c4b46['shift']());}};_0x32f50c(++_0x26ba44);}(_0x1db9,0x176));var _0x91db=function(_0x32da47,_0x295486){_0x32da47=_0x32da47-0x0;var _0x4dde4d=_0x1db9[_0x32da47];return _0x4dde4d;};'use strict';var _=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var logger=require(_0x91db('0x2'))(_0x91db('0x3'));var moment=require(_0x91db('0x4'));var BPromise=require(_0x91db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91db('0x6'));var rimraf=require(_0x91db('0x7'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x91db('0x8')]=function(_0x4b3f5c,_0x5e69d9){return _0x4b3f5c[_0x91db('0x9')](_0x91db('0xa'),attributes,{'tableName':_0x91db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1115=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatGroup','chat_groups','util','../../config/logger'];(function(_0x56d8ac,_0x13c20c){var _0x597296=function(_0x1260ad){while(--_0x1260ad){_0x56d8ac['push'](_0x56d8ac['shift']());}};_0x597296(++_0x13c20c);}(_0x1115,0x1b6));var _0x5111=function(_0x1bd107,_0xd10ba5){_0x1bd107=_0x1bd107-0x0;var _0xe7ece0=_0x1115[_0x1bd107];return _0xe7ece0;};'use strict';var _=require('lodash');var util=require(_0x5111('0x0'));var logger=require(_0x5111('0x1'))(_0x5111('0x2'));var moment=require(_0x5111('0x3'));var BPromise=require(_0x5111('0x4'));var rp=require(_0x5111('0x5'));var fs=require('fs');var path=require(_0x5111('0x6'));var rimraf=require(_0x5111('0x7'));var config=require(_0x5111('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x467c3a,_0x115ba7){return _0x467c3a['define'](_0x5111('0x9'),attributes,{'tableName':_0x5111('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1217b1b..ef07ae7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf84=['socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','redis','defaults','localhost'];(function(_0x4a632f,_0x346cf1){var _0x5964df=function(_0x88f8c2){while(--_0x88f8c2){_0x4a632f['push'](_0x4a632f['shift']());}};_0x5964df(++_0x346cf1);}(_0xbf84,0x146));var _0x4bf8=function(_0x1284d0,_0x80ce31){_0x1284d0=_0x1284d0-0x0;var _0x40da88=_0xbf84[_0x1284d0];return _0x40da88;};'use strict';var _=require(_0x4bf8('0x0'));var util=require('util');var moment=require(_0x4bf8('0x1'));var BPromise=require(_0x4bf8('0x2'));var rs=require(_0x4bf8('0x3'));var fs=require('fs');var Redis=require(_0x4bf8('0x4'));var db=require(_0x4bf8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4bf8('0x6'))('rpc');var config=require(_0x4bf8('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4bf8('0x8')]({'port':0x232a});config[_0x4bf8('0x9')]=_[_0x4bf8('0xa')](config['redis'],{'host':_0x4bf8('0xb'),'port':0x18eb});var socket=require(_0x4bf8('0xc'))(new Redis(config[_0x4bf8('0x9')]));require(_0x4bf8('0xd'))[_0x4bf8('0xe')](socket);function respondWithRpcPromise(_0x1aa394,_0x23ed23,_0x295170){return new BPromise(function(_0x2938fa,_0x4254b4){return client[_0x4bf8('0xf')](_0x1aa394,_0x295170)[_0x4bf8('0x10')](function(_0x210f64){logger[_0x4bf8('0x11')](_0x4bf8('0x12'),_0x23ed23,_0x4bf8('0x13'));logger[_0x4bf8('0x14')](_0x4bf8('0x15'),_0x23ed23,_0x4bf8('0x13'),JSON[_0x4bf8('0x16')](_0x210f64));if(_0x210f64[_0x4bf8('0x17')]){if(_0x210f64['error'][_0x4bf8('0x18')]===0x1f4){logger[_0x4bf8('0x17')]('ChatGroup,\x20%s,\x20%s',_0x23ed23,_0x210f64['error'][_0x4bf8('0x19')]);return _0x4254b4(_0x210f64[_0x4bf8('0x17')][_0x4bf8('0x19')]);}logger['error'](_0x4bf8('0x12'),_0x23ed23,_0x210f64['error'][_0x4bf8('0x19')]);return _0x2938fa(_0x210f64[_0x4bf8('0x17')][_0x4bf8('0x19')]);}else{logger[_0x4bf8('0x11')]('ChatGroup,\x20%s,\x20%s',_0x23ed23,_0x4bf8('0x13'));_0x2938fa(_0x210f64['result'][_0x4bf8('0x19')]);}})['catch'](function(_0x414e50){logger[_0x4bf8('0x17')]('ChatGroup,\x20%s,\x20%s',_0x23ed23,_0x414e50);_0x4254b4(_0x414e50);});});}
\ No newline at end of file
+var _0x0fac=['info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then'];(function(_0x5f3de3,_0x40f0f5){var _0x287e0d=function(_0x3189dc){while(--_0x3189dc){_0x5f3de3['push'](_0x5f3de3['shift']());}};_0x287e0d(++_0x40f0f5);}(_0x0fac,0x17f));var _0xc0fa=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0fac[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xc0fa('0x0'));var util=require(_0xc0fa('0x1'));var moment=require('moment');var BPromise=require(_0xc0fa('0x2'));var rs=require(_0xc0fa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc0fa('0x4'));var logger=require(_0xc0fa('0x5'))('rpc');var config=require(_0xc0fa('0x6'));var jayson=require(_0xc0fa('0x7'));var client=jayson['client'][_0xc0fa('0x8')]({'port':0x232a});config[_0xc0fa('0x9')]=_[_0xc0fa('0xa')](config[_0xc0fa('0x9')],{'host':_0xc0fa('0xb'),'port':0x18eb});var socket=require(_0xc0fa('0xc'))(new Redis(config['redis']));require(_0xc0fa('0xd'))[_0xc0fa('0xe')](socket);function respondWithRpcPromise(_0x3ddce1,_0x58e6cd,_0x3e5282){return new BPromise(function(_0x2645f1,_0x236b6e){return client[_0xc0fa('0xf')](_0x3ddce1,_0x3e5282)[_0xc0fa('0x10')](function(_0x4a81ca){logger[_0xc0fa('0x11')](_0xc0fa('0x12'),_0x58e6cd,_0xc0fa('0x13'));logger[_0xc0fa('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x58e6cd,_0xc0fa('0x13'),JSON[_0xc0fa('0x15')](_0x4a81ca));if(_0x4a81ca['error']){if(_0x4a81ca[_0xc0fa('0x16')][_0xc0fa('0x17')]===0x1f4){logger[_0xc0fa('0x16')]('ChatGroup,\x20%s,\x20%s',_0x58e6cd,_0x4a81ca['error']['message']);return _0x236b6e(_0x4a81ca[_0xc0fa('0x16')][_0xc0fa('0x18')]);}logger[_0xc0fa('0x16')]('ChatGroup,\x20%s,\x20%s',_0x58e6cd,_0x4a81ca[_0xc0fa('0x16')]['message']);return _0x2645f1(_0x4a81ca[_0xc0fa('0x16')]['message']);}else{logger[_0xc0fa('0x11')](_0xc0fa('0x12'),_0x58e6cd,_0xc0fa('0x13'));_0x2645f1(_0x4a81ca['result'][_0xc0fa('0x18')]);}})['catch'](function(_0x27e695){logger[_0xc0fa('0x16')]('ChatGroup,\x20%s,\x20%s',_0x58e6cd,_0x27e695);_0x236b6e(_0x27e695);});});}
\ No newline at end of file
index 87f6b09..772d3ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e5e=['./chatGroup.events','remove','update','removeListener','register','chatGroup:'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x1e5e,0xf6));var _0xe1e5=function(_0x14b8ee,_0x26d31a){_0x14b8ee=_0x14b8ee-0x0;var _0x50ef2b=_0x1e5e[_0x14b8ee];return _0x50ef2b;};'use strict';var ChatGroupEvents=require(_0xe1e5('0x0'));var events=['save',_0xe1e5('0x1'),_0xe1e5('0x2')];function createListener(_0x54a6c2,_0x28de95){return function(_0x42c446){_0x28de95['emit'](_0x54a6c2,_0x42c446);};}function removeListener(_0x310ecc,_0x922436){return function(){ChatGroupEvents[_0xe1e5('0x3')](_0x310ecc,_0x922436);};}exports[_0xe1e5('0x4')]=function(_0x559661){for(var _0x228b39=0x0,_0x4337ba=events['length'];_0x228b39<_0x4337ba;_0x228b39++){var _0x29ac34=events[_0x228b39];var _0x8482d4=createListener(_0xe1e5('0x5')+_0x29ac34,_0x559661);ChatGroupEvents['on'](_0x29ac34,_0x8482d4);}};
\ No newline at end of file
+var _0xcde5=['./chatGroup.events','save','remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0x1050c2,_0x13e015){var _0x49c100=function(_0x5106b4){while(--_0x5106b4){_0x1050c2['push'](_0x1050c2['shift']());}};_0x49c100(++_0x13e015);}(_0xcde5,0x87));var _0x5cde=function(_0x24d7d8,_0x59cba1){_0x24d7d8=_0x24d7d8-0x0;var _0x4945d8=_0xcde5[_0x24d7d8];return _0x4945d8;};'use strict';var ChatGroupEvents=require(_0x5cde('0x0'));var events=[_0x5cde('0x1'),_0x5cde('0x2'),_0x5cde('0x3')];function createListener(_0x40e248,_0x4c3849){return function(_0x30d9ac){_0x4c3849[_0x5cde('0x4')](_0x40e248,_0x30d9ac);};}function removeListener(_0x27b28c,_0x3d2bcc){return function(){ChatGroupEvents[_0x5cde('0x5')](_0x27b28c,_0x3d2bcc);};}exports[_0x5cde('0x6')]=function(_0x3ddbbd){for(var _0x450462=0x0,_0x49a69d=events[_0x5cde('0x7')];_0x450462<_0x49a69d;_0x450462++){var _0x522694=events[_0x450462];var _0xc1a99c=createListener(_0x5cde('0x8')+_0x522694,_0x3ddbbd);ChatGroupEvents['on'](_0x522694,_0xc1a99c);}};
\ No newline at end of file
index dc00c2c..3e880be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e6b=['/:id/unread','/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','put','update','delete','removeMembers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x36320f,_0x2d368a){var _0x29c875=function(_0x35d738){while(--_0x35d738){_0x36320f['push'](_0x36320f['shift']());}};_0x29c875(++_0x2d368a);}(_0x3e6b,0x1e9));var _0xb3e6=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x3e6b[_0x1d1779];return _0x2377e9;};'use strict';var multer=require(_0xb3e6('0x0'));var util=require(_0xb3e6('0x1'));var path=require(_0xb3e6('0x2'));var timeout=require(_0xb3e6('0x3'));var express=require(_0xb3e6('0x4'));var router=express['Router']();var auth=require(_0xb3e6('0x5'));var interaction=require(_0xb3e6('0x6'));var config=require('../../config/environment');var controller=require(_0xb3e6('0x7'));router[_0xb3e6('0x8')]('/',auth[_0xb3e6('0x9')](),controller[_0xb3e6('0xa')]);router[_0xb3e6('0x8')](_0xb3e6('0xb'),auth[_0xb3e6('0x9')](),controller[_0xb3e6('0xc')]);router['get'](_0xb3e6('0xd'),auth[_0xb3e6('0x9')](),controller[_0xb3e6('0xe')]);router['get'](_0xb3e6('0xf'),auth[_0xb3e6('0x9')](),controller['getUnread']);router[_0xb3e6('0x8')]('/:id/members',auth[_0xb3e6('0x9')](),controller['getMembers']);router[_0xb3e6('0x8')](_0xb3e6('0x10'),auth['isAuthenticated'](),controller[_0xb3e6('0x11')]);router[_0xb3e6('0x12')]('/',auth['isAuthenticated'](),controller[_0xb3e6('0x13')]);router[_0xb3e6('0x12')](_0xb3e6('0x14'),auth[_0xb3e6('0x9')](),controller[_0xb3e6('0x15')]);router[_0xb3e6('0x12')](_0xb3e6('0x10'),auth[_0xb3e6('0x9')](),controller[_0xb3e6('0x16')]);router[_0xb3e6('0x17')]('/:id',auth[_0xb3e6('0x9')](),controller[_0xb3e6('0x18')]);router[_0xb3e6('0x19')](_0xb3e6('0xd'),auth[_0xb3e6('0x9')](),controller['destroy']);router[_0xb3e6('0x19')](_0xb3e6('0x14'),auth[_0xb3e6('0x9')](),controller[_0xb3e6('0x1a')]);module[_0xb3e6('0x1b')]=router;
\ No newline at end of file
+var _0xb58e=['getMessages','post','create','addMembers','addMessage','/:id','update','removeMembers','exports','util','path','Router','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','getUnread','/:id/members','getMembers','/:id/messages'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb58e,0x1b9));var _0xeb58=function(_0x452c64,_0x298734){_0x452c64=_0x452c64-0x0;var _0x1f40dd=_0xb58e[_0x452c64];return _0x1f40dd;};'use strict';var multer=require('multer');var util=require(_0xeb58('0x0'));var path=require(_0xeb58('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xeb58('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeb58('0x3'));var controller=require(_0xeb58('0x4'));router[_0xeb58('0x5')]('/',auth[_0xeb58('0x6')](),controller[_0xeb58('0x7')]);router[_0xeb58('0x5')](_0xeb58('0x8'),auth[_0xeb58('0x6')](),controller[_0xeb58('0x9')]);router[_0xeb58('0x5')]('/:id',auth[_0xeb58('0x6')](),controller[_0xeb58('0xa')]);router[_0xeb58('0x5')]('/:id/unread',auth[_0xeb58('0x6')](),controller[_0xeb58('0xb')]);router[_0xeb58('0x5')](_0xeb58('0xc'),auth[_0xeb58('0x6')](),controller[_0xeb58('0xd')]);router[_0xeb58('0x5')](_0xeb58('0xe'),auth[_0xeb58('0x6')](),controller[_0xeb58('0xf')]);router[_0xeb58('0x10')]('/',auth['isAuthenticated'](),controller[_0xeb58('0x11')]);router[_0xeb58('0x10')](_0xeb58('0xc'),auth[_0xeb58('0x6')](),controller[_0xeb58('0x12')]);router['post'](_0xeb58('0xe'),auth[_0xeb58('0x6')](),controller[_0xeb58('0x13')]);router['put'](_0xeb58('0x14'),auth[_0xeb58('0x6')](),controller[_0xeb58('0x15')]);router['delete'](_0xeb58('0x14'),auth[_0xeb58('0x6')](),controller['destroy']);router['delete'](_0xeb58('0xc'),auth[_0xeb58('0x6')](),controller[_0xeb58('0x16')]);module[_0xeb58('0x17')]=router;
\ No newline at end of file
index 90b3bb2..7bae8eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cd7=['DATE','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','TEXT','STRING'];(function(_0x1b2422,_0x1e98d4){var _0x376573=function(_0x5db41b){while(--_0x5db41b){_0x1b2422['push'](_0x1b2422['shift']());}};_0x376573(++_0x1e98d4);}(_0x6cd7,0x107));var _0x76cd=function(_0x53a356,_0x9da31a){_0x53a356=_0x53a356-0x0;var _0xc2b531=_0x6cd7[_0x53a356];return _0xc2b531;};'use strict';var Sequelize=require(_0x76cd('0x0'));module[_0x76cd('0x1')]={'closed':{'type':Sequelize[_0x76cd('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x76cd('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x76cd('0x4'),'thumb'),'defaultValue':_0x76cd('0x4')},'ratingMessage':{'type':Sequelize[_0x76cd('0x5')]},'pathTranscript':{'type':Sequelize[_0x76cd('0x5')]},'mailTranscript':{'type':Sequelize[_0x76cd('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x76cd('0x7')]},'disposition':{'type':Sequelize[_0x76cd('0x6')]},'note':{'type':Sequelize[_0x76cd('0x6')]},'browserName':{'type':Sequelize[_0x76cd('0x6')]},'browserVersion':{'type':Sequelize[_0x76cd('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x76cd('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x76cd('0x6')]},'deviceType':{'type':Sequelize[_0x76cd('0x6')]},'referer':{'type':Sequelize[_0x76cd('0x5')]},'customerIp':{'type':Sequelize[_0x76cd('0x6')]},'formData':{'type':Sequelize[_0x76cd('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x76cd('0x7')]},'lastMsgAt':{'type':Sequelize[_0x76cd('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x76cd('0x8')]('in',_0x76cd('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x76cd('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xfb78=['STRING','DATE','out','sequelize','ENUM','star','TEXT'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xfb78,0x14c));var _0x8fb7=function(_0x4d7a61,_0x3fb6e6){_0x4d7a61=_0x4d7a61-0x0;var _0x186f73=_0xfb78[_0x4d7a61];return _0x186f73;};'use strict';var Sequelize=require(_0x8fb7('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x8fb7('0x1')](_0x8fb7('0x2'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x8fb7('0x3')]},'pathTranscript':{'type':Sequelize[_0x8fb7('0x3')]},'mailTranscript':{'type':Sequelize[_0x8fb7('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8fb7('0x5')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8fb7('0x4')]},'browserName':{'type':Sequelize[_0x8fb7('0x4')]},'browserVersion':{'type':Sequelize[_0x8fb7('0x4')]},'osName':{'type':Sequelize[_0x8fb7('0x4')]},'osVersion':{'type':Sequelize[_0x8fb7('0x4')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x8fb7('0x4')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x8fb7('0x3')]},'customerIp':{'type':Sequelize[_0x8fb7('0x4')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x8fb7('0x5')]},'lastMsgAt':{'type':Sequelize[_0x8fb7('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x8fb7('0x1')]('in',_0x8fb7('0x6')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8fb7('0x4')]},'customerPort':{'type':Sequelize[_0x8fb7('0x4')]},'vidaooSessionId':{'type':Sequelize[_0x8fb7('0x3')]}};
\ No newline at end of file
index dbfdb42..f4271d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacf4=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','forEach','ChatWebsiteId','concat','$gte','parse','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','push','all','rows','show','params','intersection','include','options','create','body','update','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','POST','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','download','root','server/files/attachments/','close','mailTranscript','join','server/files/chat/upload/','format','transcript-%s.txt','now','ChatMessage','Messages','CmContact','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','agent_fullname','createdAt','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','sendMail','\x22%s\x22\x20<%s>','email','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','includeAll','addTags','setTags','spread','findAll','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','firstName','lastName','Account','get','mkdirSync','10px','40px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','30px','%s\x20#%d','Chat','Owner','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','customerPort','tail','createReadStream','pipe','createWriteStream','downloadInteraction.html','toFile','transcript-','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','reject','save','stack','name','send','Users','map','fullname','TagIds','Tags','split','catch','index','ChatInteraction','rawAttributes','key','model','query','keys','filters','fields'];(function(_0x4efd2c,_0x297230){var _0x2d6995=function(_0x405fc8){while(--_0x405fc8){_0x4efd2c['push'](_0x4efd2c['shift']());}};_0x2d6995(++_0x297230);}(_0xacf4,0xe7));var _0x4acf=function(_0x3d73c1,_0x29b1f4){_0x3d73c1=_0x3d73c1-0x0;var _0x1a0f7f=_0xacf4[_0x3d73c1];return _0x1a0f7f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4acf('0x0'));var zipdir=require(_0x4acf('0x1'));var jsonpatch=require(_0x4acf('0x2'));var rp=require(_0x4acf('0x3'));var moment=require(_0x4acf('0x4'));var BPromise=require(_0x4acf('0x5'));var Mustache=require(_0x4acf('0x6'));var util=require('util');var path=require(_0x4acf('0x7'));var sox=require(_0x4acf('0x8'));var csv=require('to-csv');var ejs=require(_0x4acf('0x9'));var fs=require('fs');var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4acf('0x15')](config[_0x4acf('0x16')],{'host':_0x4acf('0x17'),'port':0x18eb});var socket=require(_0x4acf('0x18'))(new Redis(config[_0x4acf('0x16')]));require(_0x4acf('0x19'))[_0x4acf('0x1a')](socket);var jayson=require(_0x4acf('0x1b'));var client=jayson[_0x4acf('0x1c')][_0x4acf('0x1d')]({'port':0x232b});var client9004=jayson[_0x4acf('0x1c')]['http']({'port':0x232c});function checkPasswordPattern(_0x1b584a,_0x57d8e0,_0x34cec1){if(_0x34cec1){var _0x4041c8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4041c8[_0x4acf('0x1e')](_0x57d8e0)){return _0x1b584a;}else{throw new db['Sequelize']['ValidationError'](_0x4acf('0x1f'));}}else{return _0x1b584a;}}function respondWithRpcPromise(_0x40cb8d,_0x240c00,_0x4b1d93,_0x2a678b){return new BPromise(function(_0x137302,_0x30d289){var _0x8b55f8=_0x2a678b||client;return _0x8b55f8[_0x4acf('0x20')](_0x40cb8d,_0x4b1d93)[_0x4acf('0x21')](function(_0x2049ba){logger[_0x4acf('0x22')](_0x4acf('0x23'),_0x240c00,_0x4acf('0x24'));logger[_0x4acf('0x25')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x240c00,_0x4acf('0x24'),JSON[_0x4acf('0x26')](_0x2049ba));if(_0x2049ba['error']){if(_0x2049ba[_0x4acf('0x27')][_0x4acf('0x28')]===0x1f4){logger['error'](_0x4acf('0x23'),_0x240c00,_0x2049ba[_0x4acf('0x27')][_0x4acf('0x29')]);return _0x30d289(_0x2049ba[_0x4acf('0x27')]['message']);}logger[_0x4acf('0x27')](_0x4acf('0x23'),_0x240c00,_0x2049ba['error'][_0x4acf('0x29')]);return _0x137302(_0x2049ba[_0x4acf('0x27')]['message']);}else{logger[_0x4acf('0x22')](_0x4acf('0x23'),_0x240c00,_0x4acf('0x24'));_0x137302(_0x2049ba[_0x4acf('0x2a')]['message']);}})['catch'](function(_0x17a756){logger[_0x4acf('0x27')](_0x4acf('0x23'),_0x240c00,_0x17a756);_0x30d289(_0x17a756);});});}function respondWithStatusCode(_0x42c90c,_0x14086c){_0x14086c=_0x14086c||0xcc;return function(_0x1b4da6){if(_0x1b4da6){return _0x42c90c[_0x4acf('0x2b')](_0x14086c);}return _0x42c90c[_0x4acf('0x2c')](_0x14086c)[_0x4acf('0x2d')]();};}function respondWithResult(_0x2a3830,_0x57989e){_0x57989e=_0x57989e||0xc8;return function(_0x3521c2){if(_0x3521c2){return _0x2a3830[_0x4acf('0x2c')](_0x57989e)[_0x4acf('0x2e')](_0x3521c2);}};}function respondWithFilteredResult(_0x2a5db3,_0x252cf1){return function(_0x28570f){if(_0x28570f){var _0x27384c=_0x28570f[_0x4acf('0x2f')],_0x5d862f=_0x252cf1['offset'],_0x337b3c=_0x252cf1[_0x4acf('0x30')]+_0x252cf1[_0x4acf('0x31')],_0x1d221b;if(_0x337b3c>=_0x27384c){_0x337b3c=_0x27384c;_0x1d221b=0xc8;}else{_0x1d221b=0xce;}_0x2a5db3[_0x4acf('0x2c')](_0x1d221b);return _0x2a5db3[_0x4acf('0x32')]('Content-Range',_0x5d862f+'-'+_0x337b3c+'/'+_0x27384c)[_0x4acf('0x2e')](_0x28570f);}return null;};}function patchUpdates(_0x1bf97e){return function(_0x3f9990){try{jsonpatch['apply'](_0x3f9990,_0x1bf97e,!![]);}catch(_0x31fbce){return BPromise[_0x4acf('0x33')](_0x31fbce);}return _0x3f9990[_0x4acf('0x34')]();};}function saveUpdates(_0x3bb129,_0xd221b7){return function(_0x152d1c){if(_0x152d1c){return _0x152d1c['update'](_0x3bb129)[_0x4acf('0x21')](function(_0x25748e){return _0x25748e;});}return null;};}function removeEntity(_0x550bd6,_0xfd8ab5){return function(_0x543a37){if(_0x543a37){return _0x543a37['destroy']()['then'](function(){_0x550bd6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x562fdc,_0x4a8b5a){return function(_0x3364dd){if(!_0x3364dd){_0x562fdc[_0x4acf('0x2b')](0x194);}return _0x3364dd;};}function handleError(_0x5d6741,_0x13a10e){_0x13a10e=_0x13a10e||0x1f4;return function(_0xbd0f92){logger[_0x4acf('0x27')](_0xbd0f92[_0x4acf('0x35')]);if(_0xbd0f92[_0x4acf('0x36')]){delete _0xbd0f92[_0x4acf('0x36')];}_0x5d6741[_0x4acf('0x2c')](_0x13a10e)[_0x4acf('0x37')](_0xbd0f92);};}function getInteractionUsers(_0x24465b,_0x372bab){return new BPromise(function(_0x4be786,_0x5c449d){try{if(_0x372bab[_0x24465b['id']]){_0x24465b[_0x4acf('0x38')]=_[_0x4acf('0x39')](_0x372bab[_0x24465b['id']],function(_0x4859b6){return{'id':_0x4859b6['id'],'fullname':_0x4859b6[_0x4acf('0x3a')]};});}}catch(_0x40455d){_0x5c449d(_0x40455d);}_0x4be786(_0x24465b);});}function getInteractionTags(_0x43a2ea,_0x3e5d98){return new BPromise(function(_0x556080,_0x528550){try{if(_0x43a2ea[_0x4acf('0x3b')]){_0x43a2ea[_0x4acf('0x3c')]=[];_0x43a2ea[_0x4acf('0x3b')][_0x4acf('0x3d')](',')['forEach'](function(_0x1a1535){_0x43a2ea[_0x4acf('0x3c')]['push'](_0x3e5d98[_0x1a1535]);});}delete _0x43a2ea['TagIds'];}catch(_0x55216a){_0x528550(_0x55216a);}_0x556080(_0x43a2ea);});}function updateChatInteraction(_0x544fe9,_0x1e1f9c,_0x17e5b6){return new BPromise(function(_0x208af3,_0x54e756){return getInteractionUsers(_0x544fe9,_0x17e5b6)[_0x4acf('0x21')](function(_0x3b6574){return getInteractionTags(_0x3b6574,_0x1e1f9c);})[_0x4acf('0x21')](function(_0x3dc9e2){_0x208af3(_0x3dc9e2);})[_0x4acf('0x3e')](function(_0xea75e4){_0x54e756(_0xea75e4);});});}exports[_0x4acf('0x3f')]=function(_0x17d5e9,_0x461547){var _0x3b8cfa={},_0x25d84c={},_0x48be1c={'count':0x0,'rows':[]};var _0x256145=_[_0x4acf('0x39')](db[_0x4acf('0x40')][_0x4acf('0x41')],function(_0xf5ebe3){return{'name':_0xf5ebe3['fieldName'],'type':_0xf5ebe3['type'][_0x4acf('0x42')]};});_0x25d84c[_0x4acf('0x43')]=_[_0x4acf('0x39')](_0x256145,_0x4acf('0x36'));_0x25d84c[_0x4acf('0x44')]=_[_0x4acf('0x45')](_0x17d5e9['query']);_0x25d84c[_0x4acf('0x46')]=_['intersection'](_0x25d84c[_0x4acf('0x43')],_0x25d84c[_0x4acf('0x44')]);_0x3b8cfa['attributes']=_['intersection'](_0x25d84c[_0x4acf('0x43')],qs[_0x4acf('0x47')](_0x17d5e9[_0x4acf('0x44')][_0x4acf('0x47')]));_0x3b8cfa['attributes']=_0x3b8cfa[_0x4acf('0x48')][_0x4acf('0x49')]?_0x3b8cfa[_0x4acf('0x48')]:_0x25d84c[_0x4acf('0x43')];if(!_0x17d5e9[_0x4acf('0x44')][_0x4acf('0x4a')](_0x4acf('0x4b'))){_0x3b8cfa[_0x4acf('0x31')]=qs['limit'](_0x17d5e9['query'][_0x4acf('0x31')]);_0x3b8cfa[_0x4acf('0x30')]=qs[_0x4acf('0x30')](_0x17d5e9[_0x4acf('0x44')][_0x4acf('0x30')]);}_0x3b8cfa[_0x4acf('0x4c')]=qs[_0x4acf('0x4d')](_0x17d5e9[_0x4acf('0x44')][_0x4acf('0x4d')]);_0x3b8cfa[_0x4acf('0x4e')]=qs[_0x4acf('0x46')](_[_0x4acf('0x4f')](_0x17d5e9['query'],_0x25d84c[_0x4acf('0x46')]),_0x256145);var _0x3a09bc=[];var _0x3e8e6f=squel[_0x4acf('0x50')]()[_0x4acf('0x51')]('id')[_0x4acf('0x51')](_0x4acf('0x36'))[_0x4acf('0x51')](_0x4acf('0x52'))[_0x4acf('0x53')](_0x4acf('0x54'));var _0x3ad746=squel[_0x4acf('0x50')]()[_0x4acf('0x51')](_0x4acf('0x55'))[_0x4acf('0x51')]('u.fullname')[_0x4acf('0x51')](_0x4acf('0x56'))[_0x4acf('0x53')]('user_has_chat_interactions','ui')[_0x4acf('0x57')](_0x4acf('0x58'),'u',_0x4acf('0x59'));var _0x3cf3df=squel['select']()['from']('chat_interactions','i')[_0x4acf('0x57')](_0x4acf('0x5a'),'c',_0x4acf('0x5b'))['left_join'](_0x4acf('0x58'),'o',_0x4acf('0x5c'))['left_join'](_0x4acf('0x5d'),'a',_0x4acf('0x5e'))[_0x4acf('0x57')](_0x4acf('0x5f'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x4acf('0x57')](_0x4acf('0x60'),'it',_0x4acf('0x61'))[_0x4acf('0x57')]('tools_tags','t',_0x4acf('0x62'));var _0x536f3e=squel[_0x4acf('0x63')]();var _0x4bc18f=[];var _0x41afd2=squel[_0x4acf('0x63')]();var _0x44561c;if(_0x17d5e9[_0x4acf('0x44')]['search']){_0x44561c=as['parseSearch'](_0x17d5e9['query'][_0x4acf('0x64')]);var _0x5a2ac6=_0x44561c['sqlOperator'];for(var _0x312729=0x0;_0x312729<_0x44561c[_0x4acf('0x65')]['length'];_0x312729++){var _0xd6a3b2=_0x44561c[_0x4acf('0x65')][_0x312729];var _0x4bebb2='i';var _0x2707a9=_[_0x4acf('0x66')](_0x256145,[_0x4acf('0x36'),_0xd6a3b2['field']]);if(!_0x2707a9){switch(_0xd6a3b2[_0x4acf('0x51')]){case _0x4acf('0x67'):if(_0xd6a3b2[_0x4acf('0x68')]==0x1){_0x3cf3df[_0x4acf('0x69')]('`'+_0xd6a3b2['field']+_0x4acf('0x6a'));}else{_0x3cf3df[_0x4acf('0x69')]('`'+_0xd6a3b2[_0x4acf('0x51')]+'`\x20>\x200');}break;case _0x4acf('0x6b'):if(_0xd6a3b2[_0x4acf('0x6c')]===_0x4acf('0x6d')){if(_0xd6a3b2[_0x4acf('0x68')][_0x4acf('0x3d')]('\x20')[_0x4acf('0x49')]>0x1){_0x536f3e[_0x5a2ac6](_0x4acf('0x6e'),qs[_0x4acf('0x6f')](_0xd6a3b2[_0x4acf('0x68')]),null);}else{var _0x31c8dd='%'+_0xd6a3b2[_0x4acf('0x68')]+'%';_0x536f3e[_0x5a2ac6](_0x4acf('0x70'),_0x31c8dd,_0x31c8dd,_0x31c8dd);}}else{_0x2707a9=_[_0x4acf('0x66')](_0x256145,[_0x4acf('0x36'),_0x4acf('0x71')]);_0xd6a3b2['field']=_0x4acf('0x71');_0x46330f=as[_0x4acf('0x72')](_0x4bebb2,_0x2707a9[_0x4acf('0x73')],_0xd6a3b2);_0x536f3e[_0x5a2ac6](_0x46330f[_0x4acf('0x74')],_0x46330f[_0x4acf('0x68')][_0x4acf('0x75')],_0x46330f[_0x4acf('0x68')][_0x4acf('0x2d')]);}break;case'Tag':var _0x540dd5=_0xd6a3b2[_0x4acf('0x68')]['split'](',')[_0x4acf('0x39')](function(_0x4bfd3c){return Number(_0x4bfd3c);});_0x540dd5['forEach'](function(_0x544b08){_0x41afd2['or'](_0x4acf('0x76'),'%,'+_0x544b08+',%');});_0x4bc18f=_[_0x4acf('0x77')](_0x4bc18f,_0x540dd5);break;case _0x4acf('0x78'):if(_0xd6a3b2[_0x4acf('0x6c')]===_0x4acf('0x6d')){_0x536f3e[_0x5a2ac6](_0x4acf('0x79'),'%'+_0xd6a3b2['value']+'%',null);}else{_0x2707a9=_['find'](_0x256145,['name',_0x4acf('0x7a')]);_0xd6a3b2[_0x4acf('0x51')]=_0x4acf('0x7a');_0x46330f=as['buildExpression'](_0x4bebb2,_0x2707a9[_0x4acf('0x73')],_0xd6a3b2);_0x536f3e[_0x5a2ac6](_0x46330f[_0x4acf('0x74')],_0x46330f[_0x4acf('0x68')][_0x4acf('0x75')],_0x46330f[_0x4acf('0x68')][_0x4acf('0x2d')]);}break;case'body':_0x46330f=as[_0x4acf('0x72')]('me',null,_0xd6a3b2);_0x536f3e[_0x5a2ac6](_0x46330f['text'],_0x46330f[_0x4acf('0x68')][_0x4acf('0x75')],_0x46330f[_0x4acf('0x68')][_0x4acf('0x2d')]);break;}}else{var _0x46330f=as[_0x4acf('0x72')](_0x4bebb2,_0x2707a9[_0x4acf('0x73')],_0xd6a3b2);_0x536f3e[_0x5a2ac6](_0x46330f[_0x4acf('0x74')],_0x46330f[_0x4acf('0x68')][_0x4acf('0x75')],_0x46330f[_0x4acf('0x68')][_0x4acf('0x2d')]);}}}else{var _0x5d4a28=_(_0x17d5e9[_0x4acf('0x44')])[_0x4acf('0x45')]()[_0x4acf('0x39')](function(_0x155456){return _[_0x4acf('0x7b')](_0x256145,[_0x4acf('0x36'),_0x155456])?_0x155456:undefined;})[_0x4acf('0x7c')]()[_0x4acf('0x68')]();if(!_[_0x4acf('0x7d')](_0x5d4a28)){_0x5d4a28[_0x4acf('0x7e')](function(_0x59b4e3){if(_0x59b4e3===_0x4acf('0x7f')){_0x3cf3df[_0x4acf('0x4e')]('i.ChatWebsiteId\x20IN\x20?',[][_0x4acf('0x80')](_0x17d5e9[_0x4acf('0x44')][_0x59b4e3]));}else if(_0x59b4e3==='createdAt'){var _0x1fbf31=JSON['parse'](_0x17d5e9['query'][_0x59b4e3])[_0x4acf('0x81')];var _0x50bc20=JSON[_0x4acf('0x82')](_0x17d5e9[_0x4acf('0x44')][_0x59b4e3])[_0x4acf('0x83')];_0x3cf3df[_0x4acf('0x4e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1fbf31,_0x50bc20);}else{if(_0x17d5e9[_0x4acf('0x44')][_0x59b4e3]===_0x4acf('0x84')){_0x3cf3df['where']('i.'+_0x59b4e3+'\x20IS\x20NULL');}else{_0x3cf3df['where']('i.'+_0x59b4e3+_0x4acf('0x85'),_0x17d5e9['query'][_0x59b4e3]);}}});}if(_0x17d5e9[_0x4acf('0x44')][_0x4acf('0x86')]){if(_0x17d5e9[_0x4acf('0x44')]['read']==0x1){_0x3cf3df[_0x4acf('0x69')](_0x4acf('0x87'));}else{_0x3cf3df['having'](_0x4acf('0x88'));}}if(_0x17d5e9[_0x4acf('0x44')]['tag']){_0x4bc18f=_[_0x4acf('0x89')](_0x17d5e9[_0x4acf('0x44')][_0x4acf('0x8a')])?_0x17d5e9[_0x4acf('0x44')][_0x4acf('0x8a')]:new Array(_0x17d5e9[_0x4acf('0x44')]['tag']);_0x4bc18f[_0x4acf('0x7e')](function(_0x59a1e8){_0x41afd2['or'](_0x4acf('0x76'),'%,'+_0x59a1e8+',%');});}if(_0x17d5e9[_0x4acf('0x44')]['filter']){var _0x51d683=_0x17d5e9['query'][_0x4acf('0x8b')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x4acf('0x8c')](_0x51d683)){_0x536f3e['or']('i.id\x20LIKE\x20?',_0x51d683+'%');}else{_0x536f3e['or'](_0x4acf('0x8d'),qs[_0x4acf('0x6f')](_0x51d683))['or'](_0x4acf('0x8e'),_0x51d683+'%');}}}_0x3cf3df[_0x4acf('0x4e')](_0x536f3e);_0x3cf3df[_0x4acf('0x8f')]('i.id');var _0x4a444b={'type':db[_0x4acf('0x90')][_0x4acf('0x91')][_0x4acf('0x92')],'raw':!![]};var _0x8b52d3=_0x3cf3df[_0x4acf('0x93')]();_0x8b52d3['field'](_0x4acf('0x94'));_0x8b52d3[_0x4acf('0x51')](_0x4acf('0x95'),_0x4acf('0x67'));if(_0x3b8cfa[_0x4acf('0x4c')]){_0x3b8cfa[_0x4acf('0x4c')][_0x4acf('0x7e')](function(_0x5b3925){_0x3cf3df[_0x4acf('0x4c')]('i.'+_0x5b3925[0x0],_0x5b3925[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4acf('0x7d')](_0x4bc18f)){_0x3cf3df[_0x4acf('0x69')](_0x41afd2);_0x8b52d3[_0x4acf('0x4e')](_0x4acf('0x96'),_0x4bc18f);}BPromise[_0x4acf('0x97')]()['then'](function(){if(!_0x44561c){if(_0x17d5e9[_0x4acf('0x44')]['ChatWebsiteId']||_0x17d5e9[_0x4acf('0x44')][_0x4acf('0x98')])return;_0x8b52d3['where'](_0x4acf('0x99'));_0x3cf3df[_0x4acf('0x4e')](_0x4acf('0x99'));return;}return _0x17d5e9[_0x4acf('0x9a')][_0x4acf('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x203f59){if(_['isEmpty'](_0x203f59)){_0x8b52d3['where'](_0x4acf('0x9c'));_0x3cf3df[_0x4acf('0x4e')](_0x4acf('0x9c'));}else{_0x8b52d3[_0x4acf('0x4e')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x203f59,'id'));_0x3cf3df[_0x4acf('0x4e')](_0x4acf('0x9d'),_[_0x4acf('0x39')](_0x203f59,'id'));}});})[_0x4acf('0x21')](function(){db[_0x4acf('0x9e')][_0x4acf('0x44')](_0x8b52d3[_0x4acf('0x9f')](),_0x4a444b)[_0x4acf('0x21')](function(_0x57f0fa){_0x48be1c['count']=_0x57f0fa[_0x4acf('0x49')];if(_0x48be1c[_0x4acf('0x2f')]===0x0)return[];return db[_0x4acf('0x9e')][_0x4acf('0x44')](_0x3e8e6f[_0x4acf('0x9f')](),_0x4a444b)[_0x4acf('0x21')](function(_0x40b639){_0x3a09bc=_[_0x4acf('0xa0')](_0x40b639,'id');_0x4a444b=_[_0x4acf('0xa1')](_0x4a444b,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x17d5e9[_0x4acf('0x44')][_0x4acf('0x47')]){_0x3b8cfa[_0x4acf('0x48')][_0x4acf('0x7e')](function(_0x37ecd2){_0x3cf3df[_0x4acf('0x51')]('i.'+_0x37ecd2);});}else{_0x3cf3df[_0x4acf('0x51')](_0x4acf('0x95'),_0x4acf('0x67'));_0x3cf3df[_0x4acf('0x51')](_0x4acf('0xa2'),_0x4acf('0xa3'));_0x3cf3df[_0x4acf('0x51')]('a.mandatoryDisposition',_0x4acf('0xa4'));_0x3cf3df['field'](_0x4acf('0xa5'));_0x3cf3df[_0x4acf('0x51')]('c.firstName',_0x4acf('0xa6'));_0x3cf3df[_0x4acf('0x51')]('c.lastName','Contact.lastName');_0x3cf3df[_0x4acf('0x51')](_0x4acf('0xa7'),'Contact.email');_0x3cf3df['field'](_0x4acf('0xa8'),_0x4acf('0xa9'));_0x3cf3df[_0x4acf('0x51')](_0x4acf('0xaa'),'Contact.mobile');_0x3cf3df[_0x4acf('0x51')](_0x4acf('0xab'),_0x4acf('0xac'));_0x3cf3df[_0x4acf('0x51')](_0x4acf('0xad'),_0x4acf('0xae'));_0x3cf3df[_0x4acf('0x51')]('o.internal',_0x4acf('0xaf'));_0x3cf3df[_0x4acf('0x51')](_0x4acf('0xb0'),'TagIds');}if(_0x3b8cfa[_0x4acf('0x31')])_0x3cf3df[_0x4acf('0x31')](_0x3b8cfa[_0x4acf('0x31')]);if(_0x3b8cfa[_0x4acf('0x30')])_0x3cf3df[_0x4acf('0x30')](_0x3b8cfa[_0x4acf('0x30')]);return db[_0x4acf('0x9e')][_0x4acf('0x44')](_0x3cf3df['toString'](),_0x4a444b);})['then'](function(_0x575189){_0x3ad746['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x4acf('0x39')](_0x575189,'id'));return db['sequelize'][_0x4acf('0x44')](_0x3ad746[_0x4acf('0x9f')](),_0x4a444b)['then'](function(_0x341f2c){var _0x14ef45=_[_0x4acf('0xb1')](_0x341f2c,_0x4acf('0xb2'));var _0x10df25=[];_0x575189[_0x4acf('0x7e')](function(_0x420beb){_0x10df25[_0x4acf('0xb3')](updateChatInteraction(_0x420beb,_0x3a09bc,_0x14ef45));});return BPromise[_0x4acf('0xb4')](_0x10df25);});});})[_0x4acf('0x21')](function(_0x2d2240){_0x48be1c[_0x4acf('0xb5')]=_0x2d2240;return _0x48be1c;})[_0x4acf('0x21')](respondWithFilteredResult(_0x461547,_0x3b8cfa));})[_0x4acf('0x3e')](handleError(_0x461547,null));};exports[_0x4acf('0xb6')]=function(_0x464421,_0x2bb524){var _0x4e6044={'raw':![],'where':{'id':_0x464421[_0x4acf('0xb7')]['id']}},_0x508337={};_0x508337[_0x4acf('0x43')]=_[_0x4acf('0x45')](db[_0x4acf('0x40')][_0x4acf('0x41')]);_0x508337[_0x4acf('0x44')]=_[_0x4acf('0x45')](_0x464421[_0x4acf('0x44')]);_0x508337[_0x4acf('0x46')]=_[_0x4acf('0xb8')](_0x508337[_0x4acf('0x43')],_0x508337[_0x4acf('0x44')]);_0x4e6044['attributes']=_['intersection'](_0x508337[_0x4acf('0x43')],qs[_0x4acf('0x47')](_0x464421[_0x4acf('0x44')][_0x4acf('0x47')]));_0x4e6044[_0x4acf('0x48')]=_0x4e6044[_0x4acf('0x48')]['length']?_0x4e6044[_0x4acf('0x48')]:_0x508337[_0x4acf('0x43')];if(_0x464421[_0x4acf('0x44')]['includeAll']){_0x4e6044[_0x4acf('0xb9')]=[{'all':!![]}];}_0x4e6044=_[_0x4acf('0xa1')]({},_0x4e6044,_0x464421[_0x4acf('0xba')]);return db[_0x4acf('0x40')][_0x4acf('0x66')](_0x4e6044)[_0x4acf('0x21')](handleEntityNotFound(_0x2bb524,null))[_0x4acf('0x21')](respondWithResult(_0x2bb524,null))[_0x4acf('0x3e')](handleError(_0x2bb524,null));};exports[_0x4acf('0xbb')]=function(_0x4eb713,_0x371ab5){return db['ChatInteraction']['create'](_0x4eb713[_0x4acf('0xbc')],{})[_0x4acf('0x21')](respondWithResult(_0x371ab5,0xc9))[_0x4acf('0x3e')](handleError(_0x371ab5,null));};exports[_0x4acf('0xbd')]=function(_0x15ae95,_0x1ab7dd){if(_0x15ae95[_0x4acf('0xbc')]['id']){delete _0x15ae95[_0x4acf('0xbc')]['id'];}return db['ChatInteraction'][_0x4acf('0x66')]({'where':{'id':_0x15ae95[_0x4acf('0xb7')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x1ab7dd,null))[_0x4acf('0x21')](saveUpdates(_0x15ae95[_0x4acf('0xbc')],null))[_0x4acf('0x21')](respondWithResult(_0x1ab7dd,null))['catch'](handleError(_0x1ab7dd,null));};exports[_0x4acf('0xbe')]=function(_0x32e690,_0x3043b3){return db[_0x4acf('0x40')][_0x4acf('0x66')]({'where':{'id':_0x32e690[_0x4acf('0xb7')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x3043b3,null))['then'](removeEntity(_0x3043b3,null))[_0x4acf('0x3e')](handleError(_0x3043b3,null));};exports[_0x4acf('0xbf')]=function(_0x49848a,_0x38b796){return db[_0x4acf('0x40')][_0x4acf('0xbf')]()[_0x4acf('0x21')](respondWithResult(_0x38b796,null))['catch'](handleError(_0x38b796,null));};exports[_0x4acf('0xc0')]=function(_0x1ef291,_0x219a3c){var _0x1e2937=_0x1ef291[_0x4acf('0xb7')]['id'];var _0x22613d;var _0x2fdaea;var _0x473250;return db[_0x4acf('0x40')][_0x4acf('0xc1')]({'where':{'id':_0x1e2937}})[_0x4acf('0x21')](function(_0xc0c770){_0x22613d=_0xc0c770;return db[_0x4acf('0xc2')][_0x4acf('0xc1')]({'where':{'id':_0xc0c770[_0x4acf('0x7f')]},'attributes':['id',_0x4acf('0xc3'),'vidaooEscalation'],'raw':!![]});})[_0x4acf('0x21')](function(_0x1df00d){if(_0x1df00d&&_0x1df00d[_0x4acf('0xc3')]&&_0x1df00d[_0x4acf('0xc4')]){_0x2fdaea=_0x1df00d;var _0x1b1e3f={'rejectUnauthorized':![],'method':_0x4acf('0xc5'),'uri':'https://api-vidaoo.xcally.com/api/v1/sessions','headers':{'X-APIKEY':_0x1df00d[_0x4acf('0xc3')]},'body':{'name':'MotionCWB:'+_0x1e2937},'redirect':'follow','json':!![]};return rp(_0x1b1e3f);}else{throw new db[(_0x4acf('0x90'))][(_0x4acf('0xc6'))](_0x4acf('0xc7'));}})[_0x4acf('0x21')](function(_0xbd2f3a){_0x473250=_0xbd2f3a;if(_0x473250['id']){var _0x4533c1={'body':_0x473250[_0x4acf('0xc8')],'ChatWebsiteId':_0x2fdaea['id'],'ChatInteractionId':_0x22613d['id'],'direction':_0x4acf('0xc9'),'UserId':_0x1ef291[_0x4acf('0x9a')]['id']};return db['ChatMessage'][_0x4acf('0xbb')](_0x4533c1,{});}else{throw new db[(_0x4acf('0x90'))][(_0x4acf('0xc6'))](_0x4acf('0xca'));}})[_0x4acf('0x21')](function(){return _0x22613d[_0x4acf('0xcb')]({'vidaooSessionId':_0x473250['id']});})[_0x4acf('0x21')](respondWithResult(_0x219a3c,null))[_0x4acf('0x3e')](handleError(_0x219a3c,null));};exports[_0x4acf('0xcc')]=function(_0x18c345,_0x35a108){if(_0x18c345['body']['id']){delete _0x18c345[_0x4acf('0xbc')]['id'];}return db[_0x4acf('0x40')]['find']({'where':{'id':_0x18c345[_0x4acf('0xb7')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x35a108,null))[_0x4acf('0x21')](saveUpdates(_0x18c345[_0x4acf('0xbc')],null))[_0x4acf('0x21')](respondWithResult(_0x35a108,null))[_0x4acf('0x3e')](handleError(_0x35a108,null));};exports['abandon']=function(_0x27adc1,_0x391a92,_0x529a71){if(_0x27adc1['body']['id']){delete _0x27adc1[_0x4acf('0xbc')]['id'];}return db[_0x4acf('0x40')]['find']({'where':{'id':_0x27adc1[_0x4acf('0xb7')]['id']}})['then'](function(_0xfad128){if(!_0xfad128){logger[_0x4acf('0x27')](_0x4acf('0xcd'),_0x4acf('0xce'),0x194,_0x4acf('0xcf'));_0x391a92[_0x4acf('0x2b')](0x194);}else{if(_0xfad128[_0x4acf('0x7a')]){throw new db[(_0x4acf('0x90'))][(_0x4acf('0xc6'))](_0x4acf('0xd0'));}}return _0xfad128;})[_0x4acf('0x21')](function(_0x46b433){if(_0x46b433){return _0x46b433[_0x4acf('0xbd')]({'closed':_0x27adc1[_0x4acf('0xbc')][_0x4acf('0xd1')],'disposition':_0x27adc1[_0x4acf('0xbc')][_0x4acf('0xd2')]})[_0x4acf('0x21')](function(_0x4d7baf){return _0x4d7baf;});}})[_0x4acf('0x21')](function(_0x423c75){return respondWithRpcPromise(_0x4acf('0xd3'),'abandon',_0x27adc1[_0x4acf('0xbc')],client9004);})[_0x4acf('0x21')](respondWithResult(_0x391a92,null))[_0x4acf('0x3e')](handleError(_0x391a92,null));};exports[_0x4acf('0xd4')]=function(_0x23c6dc,_0x3144c6,_0x23113f){_0x23c6dc[_0x4acf('0xbc')][_0x4acf('0x36')]=_0x23c6dc[_0x4acf('0xd5')][_0x4acf('0xd6')];_0x23c6dc[_0x4acf('0xbc')][_0x4acf('0xd7')]=_0x23c6dc[_0x4acf('0xd5')][_0x4acf('0xd8')];_0x23c6dc[_0x4acf('0xbc')][_0x4acf('0x73')]=_0x23c6dc[_0x4acf('0xd5')][_0x4acf('0xd9')];return db['Attachment']['create'](_0x23c6dc[_0x4acf('0xbc')])[_0x4acf('0x21')](respondWithResult(_0x3144c6,0xc9))[_0x4acf('0x3e')](handleError(_0x3144c6,null));};exports[_0x4acf('0xda')]=function(_0x3cbd6d,_0x4338bf,_0x182c3a){return db['ChatInteraction'][_0x4acf('0xc1')]({'where':{'id':_0x3cbd6d['params']['id']},'raw':!![]})[_0x4acf('0x21')](handleEntityNotFound(_0x4338bf,null))[_0x4acf('0x21')](function(_0x3cd12f){if(_0x3cd12f){if(_0x3cd12f[_0x4acf('0xd1')]){return _0x4338bf[_0x4acf('0x2c')](0x193)[_0x4acf('0x2e')]({'status':0x193,'message':_0x4acf('0xdb')});}return db[_0x4acf('0xdc')][_0x4acf('0xc1')]({'where':{'id':_0x3cbd6d['query'][_0x4acf('0xdd')]},'raw':!![]})['then'](handleEntityNotFound(_0x4338bf,null));}})[_0x4acf('0x21')](function(_0x2471e6){if(_0x2471e6){return _0x4338bf[_0x4acf('0xde')](path['join'](config[_0x4acf('0xdf')],_0x4acf('0xe0'),_0x2471e6[_0x4acf('0xd7')]));}})[_0x4acf('0x3e')](handleError(_0x4338bf,null));};exports[_0x4acf('0xe1')]=function(_0x349a78,_0x29a21f){var _0x468753=null;var _0x125bf2=null;var _0x3b92a1=null;var _0x40b582=null;if(_0x349a78[_0x4acf('0xbc')]['id']){delete _0x349a78['body']['id'];}if(_0x349a78['body'][_0x4acf('0xe2')]){_0x40b582=path[_0x4acf('0xe3')](config[_0x4acf('0xdf')],_0x4acf('0xe4'),util[_0x4acf('0xe5')](_0x4acf('0xe6'),Date[_0x4acf('0xe7')]()));_0x349a78[_0x4acf('0xbc')]['pathTranscript']=_0x40b582;}return db[_0x4acf('0x40')]['find']({'where':{'id':_0x349a78['params']['id']},'include':[{'model':db[_0x4acf('0xe8')],'as':_0x4acf('0xe9'),'include':[{'model':db[_0x4acf('0x78')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x29a21f,null))[_0x4acf('0x21')](saveUpdates(_0x349a78[_0x4acf('0xbc')],null))[_0x4acf('0x21')](function(_0x3ba547){if(_0x3ba547){_0x468753=_0x3ba547;return db['ChatWebsite'][_0x4acf('0x66')]({'where':{'id':_0x468753[_0x4acf('0x7f')]}});}})['then'](function(_0x19bd1c){if(_0x19bd1c){_0x3b92a1=_0x19bd1c;return db[_0x4acf('0xea')][_0x4acf('0x66')]({'where':{'id':_0x468753[_0x4acf('0x71')]}});}})[_0x4acf('0x21')](function(_0x548c74){if(_0x548c74){_0x125bf2=_0x548c74;if(_0x40b582){var _0x41c807=null;for(var _0x371f7e=0x1;_0x371f7e<_0x468753[_0x4acf('0xe9')][_0x4acf('0x49')];++_0x371f7e){_0x41c807=_0x468753['Messages'][_0x371f7e];var _0x7b6ca6=_0x41c807[_0x4acf('0x7a')]?util[_0x4acf('0xe5')](_0x4acf('0xeb'),_0x3b92a1[_0x4acf('0xec')],_0x41c807[_0x4acf('0x7a')]):'System';var _0x31daed=_0x349a78[_0x4acf('0xbc')][_0x4acf('0xed')]||util[_0x4acf('0xe5')](_0x4acf('0xeb'),_0x4acf('0xee'),_0x41c807[_0x4acf('0x71')]);switch(_0x3b92a1[_0x4acf('0xef')]){case _0x4acf('0xf0'):_0x7b6ca6=_0x41c807['UserId']?util[_0x4acf('0xe5')](_0x4acf('0xeb'),_0x3b92a1[_0x4acf('0xec')],_0x41c807['UserId']):_0x4acf('0xf1');break;case _0x4acf('0xf2'):_0x7b6ca6=_0x41c807[_0x4acf('0x7a')]?_0x41c807['User']['alias']||_0x41c807[_0x4acf('0x78')][_0x4acf('0x3a')]:_0x4acf('0xf1');break;case _0x4acf('0xf3'):_0x7b6ca6=_0x41c807[_0x4acf('0x7a')]?_0x41c807[_0x4acf('0x78')]['fullname']:_0x4acf('0xf1');break;default:_0x7b6ca6=_0x41c807[_0x4acf('0x7a')]?util['format']('%s%d',_0x3b92a1['agentAlias'],_0x41c807[_0x4acf('0x7a')]):_0x4acf('0xf1');}var _0x5b7663=util[_0x4acf('0xe5')]('[%s]\x20%s:\x20%s\x0a',moment(_0x41c807[_0x4acf('0xf4')])[_0x4acf('0xe5')]('MM/DD/YYYY\x20HH:mm:ss'),_0x41c807[_0x4acf('0xf5')]==='in'?_0x31daed:_0x7b6ca6,_0x41c807[_0x4acf('0xbc')]);if(!_0x41c807[_0x4acf('0xf6')]){fs[_0x4acf('0xf7')](_0x40b582,_0x5b7663);}}return db['MailAccount'][_0x4acf('0xc1')]({'where':{'service':!![]},'include':[{'model':db[_0x4acf('0xf8')],'as':_0x4acf('0xf9'),'raw':!![]}]});}}})[_0x4acf('0x21')](function(_0x5a10bf){if(_0x5a10bf&&_0x5a10bf['Smtp']&&_0x349a78[_0x4acf('0xbc')]){var _0x170eeb={'tls':{'rejectUnauthorized':![]}};if(_0x5a10bf[_0x4acf('0xf9')][_0x4acf('0xfa')]){_0x170eeb['service']=_0x5a10bf[_0x4acf('0xf9')]['service'];}else{_0x170eeb[_0x4acf('0xfb')]=_0x5a10bf[_0x4acf('0xf9')][_0x4acf('0xfb')];_0x170eeb['port']=_0x5a10bf[_0x4acf('0xf9')][_0x4acf('0xfc')];_0x170eeb['secure']=_0x5a10bf['Smtp'][_0x4acf('0xfd')];}if(_0x5a10bf[_0x4acf('0xf9')][_0x4acf('0xfe')]){_0x170eeb[_0x4acf('0xff')]={'user':_0x5a10bf[_0x4acf('0xf9')]['user'],'pass':_0x5a10bf[_0x4acf('0xf9')]['pass']};}return respondWithRpcPromise('SendMail',_0x4acf('0x100'),{'account':_0x170eeb,'message':{'from':util[_0x4acf('0xe5')](_0x4acf('0x101'),_0x5a10bf[_0x4acf('0x36')],_0x5a10bf[_0x4acf('0x102')]||_0x5a10bf[_0x4acf('0xf9')][_0x4acf('0x9a')]),'to':_0x349a78[_0x4acf('0xbc')][_0x4acf('0xe2')],'subject':'Mail\x20Transcript','text':util[_0x4acf('0xe5')](_0x4acf('0x103'),_0x349a78[_0x4acf('0xbc')][_0x4acf('0xe2')]),'attachments':[{'path':_0x40b582}]}})[_0x4acf('0x21')](function(){return _0x468753;})[_0x4acf('0x3e')](function(_0x396047){console['error'](_0x396047);});}else{return _0x468753;}})[_0x4acf('0x21')](respondWithStatusCode(_0x29a21f,0xc8))[_0x4acf('0x3e')](handleError(_0x29a21f,null));};exports[_0x4acf('0x104')]=function(_0x4b4152,_0x94ba70,_0x2c46b9){return db[_0x4acf('0xe8')][_0x4acf('0x66')]({'where':{'id':_0x4b4152[_0x4acf('0xb7')]['id']}})['then'](handleEntityNotFound(_0x94ba70,null))[_0x4acf('0x21')](function(_0x32f951){if(_0x32f951){return _0x32f951['addMessage'](_0x4b4152[_0x4acf('0xbc')][_0x4acf('0x105')],_[_0x4acf('0x106')](_0x4b4152['body'],[_0x4acf('0x105'),'id'])||{});}})[_0x4acf('0x21')](respondWithResult(_0x94ba70,null))[_0x4acf('0x3e')](handleError(_0x94ba70,null));};exports[_0x4acf('0x107')]=function(_0x163a41,_0x36b1e8,_0x55008a){var _0x370667={'raw':![],'where':{}};var _0x3fb99c={};var _0x3323cc={'count':0x0,'rows':[]};return db[_0x4acf('0x40')]['findOne']({'where':{'id':_0x163a41['params']['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x36b1e8,null))[_0x4acf('0x21')](function(_0x3f78cf){if(_0x3f78cf){_0x3fb99c[_0x4acf('0x43')]=_[_0x4acf('0x45')](db['ChatMessage'][_0x4acf('0x41')]);_0x3fb99c[_0x4acf('0x44')]=_[_0x4acf('0x45')](_0x163a41['query']);_0x3fb99c[_0x4acf('0x46')]=_[_0x4acf('0xb8')](_0x3fb99c[_0x4acf('0x43')],_0x3fb99c[_0x4acf('0x44')]);_0x370667[_0x4acf('0x48')]=_[_0x4acf('0xb8')](_0x3fb99c[_0x4acf('0x43')],qs[_0x4acf('0x47')](_0x163a41[_0x4acf('0x44')]['fields']));_0x370667['attributes']=_0x370667['attributes']['length']?_0x370667['attributes']:_0x3fb99c[_0x4acf('0x43')];if(!_0x163a41[_0x4acf('0x44')][_0x4acf('0x4a')](_0x4acf('0x4b'))){_0x370667[_0x4acf('0x31')]=qs[_0x4acf('0x31')](_0x163a41[_0x4acf('0x44')][_0x4acf('0x31')]);_0x370667[_0x4acf('0x30')]=qs[_0x4acf('0x30')](_0x163a41[_0x4acf('0x44')]['offset']);}_0x370667[_0x4acf('0x4c')]=qs[_0x4acf('0x4d')](_0x163a41['query'][_0x4acf('0x4d')]);_0x370667[_0x4acf('0x4e')]=qs[_0x4acf('0x46')](_[_0x4acf('0x4f')](_0x163a41[_0x4acf('0x44')],_0x3fb99c[_0x4acf('0x46')]));_0x370667[_0x4acf('0x4e')][_0x4acf('0xb2')]=_0x3f78cf['id'];if(_0x163a41[_0x4acf('0x44')][_0x4acf('0x8b')]){_0x370667[_0x4acf('0x4e')]=_[_0x4acf('0xa1')](_0x370667['where'],{'$or':_[_0x4acf('0x39')](_0x370667[_0x4acf('0x48')],function(_0x517c00){var _0x265b5f={};_0x265b5f[_0x517c00]={'$like':'%'+_0x163a41[_0x4acf('0x44')][_0x4acf('0x8b')]+'%'};return _0x265b5f;})});}if(_0x163a41[_0x4acf('0x44')]['$gte']){var _0x5aca36=_0x163a41[_0x4acf('0x44')][_0x4acf('0x81')][_0x4acf('0x3d')](',');var _0x4cff5f={};_0x4cff5f[_0x5aca36[0x0]]={'$gte':moment(_0x5aca36[0x1])[_0x4acf('0xe5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x370667[_0x4acf('0x4e')]=_[_0x4acf('0xa1')](_0x370667['where'],_0x4cff5f);}_0x370667=_[_0x4acf('0xa1')]({},_0x370667,_0x163a41['options']);return db[_0x4acf('0xe8')]['count']({'where':_0x370667[_0x4acf('0x4e')]})[_0x4acf('0x21')](function(_0x5c85b5){_0x3323cc['count']=_0x5c85b5;if(_0x163a41[_0x4acf('0x44')][_0x4acf('0x108')]){_0x370667[_0x4acf('0xb9')]=[{'all':!![]}];}return db[_0x4acf('0xe8')]['findAll'](_0x370667);})[_0x4acf('0x21')](function(_0x2a9703){_0x3323cc[_0x4acf('0xb5')]=_0x2a9703;return _0x3323cc;});}})[_0x4acf('0x21')](respondWithFilteredResult(_0x36b1e8,_0x370667))[_0x4acf('0x3e')](handleError(_0x36b1e8,null));};exports['getMyMessages']=function(_0x10bccb,_0x334d4c,_0x24979f){var _0x129787={'where':{}},_0x411e04={},_0x2649eb={'count':0x0,'rows':[]};return db[_0x4acf('0x40')][_0x4acf('0xc1')]({'where':{'id':_0x10bccb[_0x4acf('0xb7')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x334d4c,null))[_0x4acf('0x21')](function(_0x55784d){if(_0x55784d){_0x411e04[_0x4acf('0x43')]=_[_0x4acf('0x45')](db[_0x4acf('0xe8')][_0x4acf('0x41')]);_0x411e04['query']=_['keys'](_0x10bccb[_0x4acf('0x44')]);_0x411e04[_0x4acf('0x46')]=_[_0x4acf('0xb8')](_0x411e04['model'],_0x411e04[_0x4acf('0x44')]);_0x129787[_0x4acf('0x48')]=_[_0x4acf('0xb8')](_0x411e04[_0x4acf('0x43')],qs[_0x4acf('0x47')](_0x10bccb[_0x4acf('0x44')][_0x4acf('0x47')]));_0x129787['attributes']=_0x129787[_0x4acf('0x48')]['length']?_0x129787[_0x4acf('0x48')]:_0x411e04[_0x4acf('0x43')];if(!_0x10bccb[_0x4acf('0x44')][_0x4acf('0x4a')](_0x4acf('0x4b'))){_0x129787[_0x4acf('0x31')]=qs[_0x4acf('0x31')](_0x10bccb[_0x4acf('0x44')][_0x4acf('0x31')]);_0x129787[_0x4acf('0x30')]=qs[_0x4acf('0x30')](_0x10bccb[_0x4acf('0x44')][_0x4acf('0x30')]);}_0x129787[_0x4acf('0x4c')]=qs[_0x4acf('0x4d')](_0x10bccb[_0x4acf('0x44')]['sort']);_0x129787[_0x4acf('0x4e')]=qs['filters'](_[_0x4acf('0x4f')](_0x10bccb['query'],_0x411e04[_0x4acf('0x46')]));_0x129787[_0x4acf('0x4e')][_0x4acf('0xb2')]=_0x55784d['id'];if(_0x10bccb[_0x4acf('0x44')][_0x4acf('0x8b')]){_0x129787['where']=_[_0x4acf('0xa1')](_0x129787[_0x4acf('0x4e')],{'$or':_[_0x4acf('0x39')](_0x129787[_0x4acf('0x48')],function(_0x1baefe){var _0x2e7d18={};_0x2e7d18[_0x1baefe]={'$like':'%'+_0x10bccb['query'][_0x4acf('0x8b')]+'%'};return _0x2e7d18;})});}_0x129787[_0x4acf('0x4e')][_0x4acf('0xf6')]=![];if(_0x10bccb['query']['id']){_0x129787[_0x4acf('0x4e')]['id']={'$gt':_0x10bccb[_0x4acf('0x44')]['id']};}_0x129787=_[_0x4acf('0xa1')]({},_0x129787,_0x10bccb[_0x4acf('0xba')]);return db[_0x4acf('0xe8')][_0x4acf('0x2f')]({'where':_0x129787[_0x4acf('0x4e')]})[_0x4acf('0x21')](function(_0x305b5f){_0x2649eb['count']=_0x305b5f;_0x129787[_0x4acf('0xb9')]=[];if(_0x10bccb[_0x4acf('0x44')]['includeAgent']){_0x129787[_0x4acf('0xb9')][_0x4acf('0xb3')]({'model':db[_0x4acf('0x78')],'as':_0x4acf('0x78'),'attributes':['id',_0x4acf('0x3a'),'alias']});}if(_0x10bccb[_0x4acf('0x44')][_0x4acf('0x108')]){_0x129787[_0x4acf('0xb9')]=[{'all':!![]}];}return db[_0x4acf('0xe8')]['findAll'](_0x129787);})[_0x4acf('0x21')](function(_0x40742b){_0x2649eb[_0x4acf('0xb5')]=_0x40742b;return _0x2649eb;});}})[_0x4acf('0x21')](respondWithFilteredResult(_0x334d4c,_0x129787))[_0x4acf('0x3e')](handleError(_0x334d4c,null));};exports[_0x4acf('0x109')]=function(_0x54da9c,_0x12910f,_0x16a813){return db['ChatInteraction']['find']({'where':{'id':_0x54da9c[_0x4acf('0xb7')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x12910f,null))[_0x4acf('0x21')](function(_0x3e31f2){if(_0x3e31f2){return _0x3e31f2[_0x4acf('0x10a')](_0x54da9c[_0x4acf('0xbc')][_0x4acf('0x105')],_[_0x4acf('0x106')](_0x54da9c[_0x4acf('0xbc')],['ids','id'])||{})[_0x4acf('0x10b')](function(){return db['Tag'][_0x4acf('0x10c')]({'attributes':['id',_0x4acf('0x36'),_0x4acf('0x52')],'where':{'id':_0x54da9c[_0x4acf('0xbc')][_0x4acf('0x105')]}});})[_0x4acf('0x21')](function(_0x814c8b){socket[_0x4acf('0x10d')](_0x4acf('0x10e'),{'id':Number(_0x54da9c[_0x4acf('0xb7')]['id']),'tags':_0x814c8b||[]});return{'id':Number(_0x54da9c[_0x4acf('0xb7')]['id']),'tags':_0x814c8b||[]};});}})[_0x4acf('0x21')](respondWithResult(_0x12910f,null))['catch'](handleError(_0x12910f,null));};exports[_0x4acf('0x10f')]=function(_0xe861ac,_0x4babec,_0x96f8cb){return db['ChatInteraction'][_0x4acf('0x66')]({'where':{'id':_0xe861ac[_0x4acf('0xb7')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x4babec,null))[_0x4acf('0x21')](function(_0x2953a9){if(_0x2953a9){return _0x2953a9[_0x4acf('0x10f')](_0xe861ac[_0x4acf('0x44')]['ids']);}})[_0x4acf('0x21')](respondWithStatusCode(_0x4babec,null))[_0x4acf('0x3e')](handleError(_0x4babec,null));};exports[_0x4acf('0xde')]=function(_0x37b34e,_0x2de030){var _0x1c54bf=moment()[_0x4acf('0x110')]()[_0x4acf('0x9f')]();var _0x5977fa=path[_0x4acf('0xe3')](config[_0x4acf('0xdf')],_0x4acf('0x111'),_0x4acf('0x112'),_0x4acf('0x113'));var _0xb9c0ed=path[_0x4acf('0xe3')](config[_0x4acf('0xdf')],_0x4acf('0x111'),'files',_0x4acf('0x114'));var _0x32c3eb=path[_0x4acf('0xe3')](_0x5977fa,_0x1c54bf);var _0x2cc145=util[_0x4acf('0xe5')]('transcript-%d-%s.zip',_0x37b34e[_0x4acf('0xb7')]['id'],_0x1c54bf);var _0x14da1e=path[_0x4acf('0xe3')](_0x5977fa,_0x2cc145);var _0xcb51af=[];_0xcb51af[_0x4acf('0xb3')]({'model':db[_0x4acf('0x78')],'as':_0x4acf('0x78'),'attributes':['id','fullname'],'raw':!![]});_0xcb51af[_0x4acf('0xb3')]({'model':db[_0x4acf('0xea')],'as':_0x4acf('0x6b'),'attributes':['id',_0x4acf('0x115'),_0x4acf('0x116')],'raw':!![]});if(_0x37b34e[_0x4acf('0x44')][_0x4acf('0x114')]){_0xcb51af['push']({'model':db[_0x4acf('0xdc')],'as':_0x4acf('0xdc'),'raw':!![]});}var _0x508493=[{'model':db[_0x4acf('0xe8')],'as':'Messages','attributes':['id',_0x4acf('0xbc'),'createdAt',_0x4acf('0xf5'),'secret',_0x4acf('0x86')],'include':_0xcb51af}];_0x508493['push']({'model':db[_0x4acf('0xc2')],'as':_0x4acf('0x117'),'attributes':['id','name']});_0x508493[_0x4acf('0xb3')]({'model':db[_0x4acf('0x78')],'as':'Owner','attributes':['id',_0x4acf('0x3a')]});return db[_0x4acf('0x40')][_0x4acf('0x66')]({'where':{'id':_0x37b34e[_0x4acf('0xb7')]['id']},'include':_0x508493})['then'](handleEntityNotFound(_0x2de030,null))[_0x4acf('0x21')](function(_0x3ab3b9){if(_0x3ab3b9){var _0x2c6a1f=_0x3ab3b9[_0x4acf('0x118')]({'plain':!![]});fs[_0x4acf('0x119')](_0x32c3eb);var _0x36d55d={'format':'A4','border':_0x4acf('0x11a'),'header':{'height':_0x4acf('0x11b'),'contents':{'first':_0x4acf('0x11c')}},'footer':{'height':_0x4acf('0x11d'),'contents':{'default':util[_0x4acf('0xe5')]('<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>',util[_0x4acf('0xe5')](_0x4acf('0x11e'),_0x4acf('0x11f'),_0x2c6a1f['id']),moment()[_0x4acf('0xe5')]('YYYY-MM-DD')[_0x4acf('0x9f')]())}}};var _0x2da930={'channel':_0x4acf('0x11f'),'account':_0x2c6a1f[_0x4acf('0x117')][_0x4acf('0x36')],'agent':_0x2c6a1f[_0x4acf('0x120')]?_0x2c6a1f[_0x4acf('0x120')][_0x4acf('0x3a')]:'N.A.','createdAt':moment(_0x2c6a1f[_0x4acf('0xf4')])[_0x4acf('0xe5')](_0x4acf('0x121'))[_0x4acf('0x9f')](),'closedAt':_0x2c6a1f[_0x4acf('0xd1')]?moment(_0x2c6a1f['closedAt'])[_0x4acf('0xe5')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x2c6a1f[_0x4acf('0xd2')],'chatInfo':{'browser':_0x2c6a1f[_0x4acf('0x122')],'os':_0x2c6a1f[_0x4acf('0x123')],'referer':_0x2c6a1f['referer'],'customerIp':_0x2c6a1f['customerIp'],'customerPort':_0x2c6a1f['customerPort']?_0x2c6a1f[_0x4acf('0x124')]:'N.A.'},'messages':_(_0x2c6a1f[_0x4acf('0xe9')])[_0x4acf('0x125')]()[_0x4acf('0x8b')]({'secret':![]})[_0x4acf('0x39')](function(_0x3fdcf3){if(_0x3fdcf3[_0x4acf('0xdc')]){var _0x2e2e1f=path[_0x4acf('0xe3')](_0xb9c0ed,_0x3fdcf3[_0x4acf('0xdc')]['basename']);if(fs['existsSync'](_0x2e2e1f)){fs[_0x4acf('0x126')](_0x2e2e1f)[_0x4acf('0x127')](fs[_0x4acf('0x128')](path['join'](_0x32c3eb,_0x3fdcf3[_0x4acf('0xdc')][_0x4acf('0xd7')])));}}return{'date':moment(_0x3fdcf3['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4acf('0x9f')](),'sender':_0x3fdcf3['direction']===_0x4acf('0xc9')?_0x3fdcf3[_0x4acf('0x78')]?_0x3fdcf3['User']['fullname']:_0x4acf('0xf1'):_0x3fdcf3[_0x4acf('0x6b')][_0x4acf('0x115')]+(_0x3fdcf3[_0x4acf('0x6b')][_0x4acf('0x116')]?'\x20'+_0x3fdcf3[_0x4acf('0x6b')][_0x4acf('0x116')]:''),'body':_0x3fdcf3[_0x4acf('0xdc')]?_0x3fdcf3[_0x4acf('0xdc')][_0x4acf('0xd7')]:_0x3fdcf3[_0x4acf('0xbc')],'direction':_0x3fdcf3['direction']===_0x4acf('0xc9')?'A':'C','secret':_0x3fdcf3[_0x4acf('0xf6')],'read':_0x3fdcf3[_0x4acf('0x86')],'attachment':_0x3fdcf3[_0x4acf('0xdc')]};})[_0x4acf('0x68')]()};return ejs['renderFile'](path[_0x4acf('0xe3')](config[_0x4acf('0xdf')],_0x4acf('0x111'),'views',_0x4acf('0x129')),{'interaction':_0x2da930})[_0x4acf('0x21')](function(_0xd382b6){return new BPromise(function(_0x280d9b,_0x3b8cd5){pdf[_0x4acf('0xbb')](_0xd382b6,_0x36d55d)[_0x4acf('0x12a')](path[_0x4acf('0xe3')](_0x32c3eb,_0x4acf('0x12b')+_0x2c6a1f['id']+'-'+_0x1c54bf+'.pdf'),function(_0x5d85e1,_0xe80282){if(_0x5d85e1)return _0x3b8cd5(_0x5d85e1);_0x280d9b(_0xe80282);});});})[_0x4acf('0x21')](function(){return new BPromise(function(_0x25a59f,_0x427bf1){zipdir(_0x32c3eb,{'saveTo':_0x14da1e},function(_0x3a6b54,_0x350e00){if(_0x3a6b54)return _0x427bf1(_0x3a6b54);return _0x25a59f(_0x350e00);});})[_0x4acf('0x21')](function(){return new BPromise(function(_0x35c3d8,_0x2383d6){rimraf(_0x32c3eb,function(_0x5c3d5f){if(_0x5c3d5f)_0x2383d6(_0x5c3d5f);return _0x35c3d8();});});})['then'](function(){return _0x2de030[_0x4acf('0xde')](_0x14da1e,_0x2cc145,function(_0x5255a6){if(_0x5255a6){console[_0x4acf('0x12c')](_0x4acf('0x12d'),_0x5255a6);}else{fs[_0x4acf('0x12e')](_0x14da1e);}});});});}else{return _0x2de030[_0x4acf('0x2b')](0xc8);}})[_0x4acf('0x3e')](handleError(_0x2de030,null));};
\ No newline at end of file
+var _0x77e6=['params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/sessions','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','basename','file','mimetype','Attachment','attachmentDownload','Unauthorized','download','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','port','secure','authentication','auth','user','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','ChatMessage','addMessage','omit','ids','getMessages','sort','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','rows','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','join','files','tmp','server','attachments','firstName','lastName','get','mkdirSync','10px','40px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','30px','%s\x20#%d','Chat','YYYY-MM-DD','Account','Owner','N.A.','closedAt','disposition','browserName','referer','customerPort','tail','existsSync','createReadStream','pipe','renderFile','views','downloadInteraction.html','toFile','transcript-','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','fullname','TagIds','Tags','forEach','push','index','map','ChatInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','UserId','body','some','compact','isEmpty','ChatWebsiteId','where','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','groupBy','ChatInteractionId','all','includeAll','include','options','create'];(function(_0x2dca77,_0x127124){var _0x55e7fb=function(_0x51278b){while(--_0x51278b){_0x2dca77['push'](_0x2dca77['shift']());}};_0x55e7fb(++_0x127124);}(_0x77e6,0x1a6));var _0x677e=function(_0x360f5a,_0x340703){_0x360f5a=_0x360f5a-0x0;var _0x4963e0=_0x77e6[_0x360f5a];return _0x4963e0;};'use strict';var pdf=require(_0x677e('0x0'));var emlformat=require(_0x677e('0x1'));var rimraf=require(_0x677e('0x2'));var zipdir=require(_0x677e('0x3'));var jsonpatch=require(_0x677e('0x4'));var rp=require(_0x677e('0x5'));var moment=require(_0x677e('0x6'));var BPromise=require(_0x677e('0x7'));var Mustache=require('mustache');var util=require(_0x677e('0x8'));var path=require(_0x677e('0x9'));var sox=require('sox');var csv=require(_0x677e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x677e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x677e('0xc'));var deskjs=require(_0x677e('0xd'));var toCsv=require(_0x677e('0xa'));var querystring=require(_0x677e('0xe'));var Papa=require('papaparse');var Redis=require(_0x677e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x677e('0x10'));var as=require(_0x677e('0x11'));var hardwareService=require(_0x677e('0x12'));var logger=require(_0x677e('0x13'))(_0x677e('0x14'));var utils=require(_0x677e('0x15'));var config=require(_0x677e('0x16'));var db=require(_0x677e('0x17'))['db'];config[_0x677e('0x18')]=_[_0x677e('0x19')](config[_0x677e('0x18')],{'host':_0x677e('0x1a'),'port':0x18eb});var socket=require(_0x677e('0x1b'))(new Redis(config[_0x677e('0x18')]));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x677e('0x1c')][_0x677e('0x1d')]({'port':0x232b});var client9004=jayson[_0x677e('0x1c')][_0x677e('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x4daa04,_0x42d0c3,_0x24c9eb){if(_0x24c9eb){var _0xe88242=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xe88242[_0x677e('0x1e')](_0x42d0c3)){return _0x4daa04;}else{throw new db[(_0x677e('0x1f'))][(_0x677e('0x20'))](_0x677e('0x21'));}}else{return _0x4daa04;}}function respondWithRpcPromise(_0x49d428,_0x1c5124,_0x2ef2bf,_0x385b06){return new BPromise(function(_0x221b6d,_0xba1c26){var _0x29e853=_0x385b06||client;return _0x29e853['request'](_0x49d428,_0x2ef2bf)[_0x677e('0x22')](function(_0x4bfbb6){logger[_0x677e('0x23')](_0x677e('0x24'),_0x1c5124,_0x677e('0x25'));logger['debug'](_0x677e('0x26'),_0x1c5124,_0x677e('0x25'),JSON[_0x677e('0x27')](_0x4bfbb6));if(_0x4bfbb6[_0x677e('0x28')]){if(_0x4bfbb6[_0x677e('0x28')][_0x677e('0x29')]===0x1f4){logger[_0x677e('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x1c5124,_0x4bfbb6['error']['message']);return _0xba1c26(_0x4bfbb6[_0x677e('0x28')][_0x677e('0x2a')]);}logger[_0x677e('0x28')](_0x677e('0x24'),_0x1c5124,_0x4bfbb6[_0x677e('0x28')][_0x677e('0x2a')]);return _0x221b6d(_0x4bfbb6[_0x677e('0x28')][_0x677e('0x2a')]);}else{logger[_0x677e('0x23')](_0x677e('0x24'),_0x1c5124,'request\x20sent');_0x221b6d(_0x4bfbb6['result'][_0x677e('0x2a')]);}})[_0x677e('0x2b')](function(_0x4d9e0b){logger[_0x677e('0x28')](_0x677e('0x24'),_0x1c5124,_0x4d9e0b);_0xba1c26(_0x4d9e0b);});});}function respondWithStatusCode(_0xf6b3ad,_0x33e946){_0x33e946=_0x33e946||0xcc;return function(_0x21a26b){if(_0x21a26b){return _0xf6b3ad[_0x677e('0x2c')](_0x33e946);}return _0xf6b3ad['status'](_0x33e946)[_0x677e('0x2d')]();};}function respondWithResult(_0x2a6033,_0xeca8e2){_0xeca8e2=_0xeca8e2||0xc8;return function(_0x1e2694){if(_0x1e2694){return _0x2a6033[_0x677e('0x2e')](_0xeca8e2)[_0x677e('0x2f')](_0x1e2694);}};}function respondWithFilteredResult(_0x9179a0,_0x10eb66){return function(_0x9d49b5){if(_0x9d49b5){var _0x4c5113=_0x9d49b5[_0x677e('0x30')],_0x22ccfb=_0x10eb66[_0x677e('0x31')],_0x3cac19=_0x10eb66[_0x677e('0x31')]+_0x10eb66[_0x677e('0x32')],_0x2fb815;if(_0x3cac19>=_0x4c5113){_0x3cac19=_0x4c5113;_0x2fb815=0xc8;}else{_0x2fb815=0xce;}_0x9179a0[_0x677e('0x2e')](_0x2fb815);return _0x9179a0[_0x677e('0x33')](_0x677e('0x34'),_0x22ccfb+'-'+_0x3cac19+'/'+_0x4c5113)['json'](_0x9d49b5);}return null;};}function patchUpdates(_0xcaae21){return function(_0x34cdb3){try{jsonpatch[_0x677e('0x35')](_0x34cdb3,_0xcaae21,!![]);}catch(_0x2570b9){return BPromise[_0x677e('0x36')](_0x2570b9);}return _0x34cdb3[_0x677e('0x37')]();};}function saveUpdates(_0x5d7b29,_0x1a4ca1){return function(_0x3a2071){if(_0x3a2071){return _0x3a2071[_0x677e('0x38')](_0x5d7b29)['then'](function(_0x13a02f){return _0x13a02f;});}return null;};}function removeEntity(_0xd729da,_0x2004bb){return function(_0x4fccc4){if(_0x4fccc4){return _0x4fccc4[_0x677e('0x39')]()['then'](function(){_0xd729da[_0x677e('0x2e')](0xcc)[_0x677e('0x2d')]();});}};}function handleEntityNotFound(_0x3514d6,_0x1fc871){return function(_0x548b22){if(!_0x548b22){_0x3514d6[_0x677e('0x2c')](0x194);}return _0x548b22;};}function handleError(_0x1dfbd3,_0x2e2302){_0x2e2302=_0x2e2302||0x1f4;return function(_0x576443){logger['error'](_0x576443[_0x677e('0x3a')]);if(_0x576443[_0x677e('0x3b')]){delete _0x576443['name'];}_0x1dfbd3[_0x677e('0x2e')](_0x2e2302)[_0x677e('0x3c')](_0x576443);};}function getInteractionUsers(_0x497dca,_0x5a6dcc){return new BPromise(function(_0x463606,_0x4505f5){try{if(_0x5a6dcc[_0x497dca['id']]){_0x497dca['Users']=_['map'](_0x5a6dcc[_0x497dca['id']],function(_0x42ce2c){return{'id':_0x42ce2c['id'],'fullname':_0x42ce2c[_0x677e('0x3d')]};});}}catch(_0x1c70ec){_0x4505f5(_0x1c70ec);}_0x463606(_0x497dca);});}function getInteractionTags(_0x5bb080,_0x3008c5){return new BPromise(function(_0x39f5d6,_0x38db14){try{if(_0x5bb080[_0x677e('0x3e')]){_0x5bb080[_0x677e('0x3f')]=[];_0x5bb080['TagIds']['split'](',')[_0x677e('0x40')](function(_0x40238e){_0x5bb080[_0x677e('0x3f')][_0x677e('0x41')](_0x3008c5[_0x40238e]);});}delete _0x5bb080[_0x677e('0x3e')];}catch(_0x2f8ebb){_0x38db14(_0x2f8ebb);}_0x39f5d6(_0x5bb080);});}function updateChatInteraction(_0x1b9a35,_0x149039,_0x78202e){return new BPromise(function(_0x270867,_0x52a36c){return getInteractionUsers(_0x1b9a35,_0x78202e)['then'](function(_0x2ee698){return getInteractionTags(_0x2ee698,_0x149039);})[_0x677e('0x22')](function(_0x5abab2){_0x270867(_0x5abab2);})[_0x677e('0x2b')](function(_0x511125){_0x52a36c(_0x511125);});});}exports[_0x677e('0x42')]=function(_0x29b9c0,_0x283aaa){var _0xe16ced={},_0x141f80={},_0x1a34d8={'count':0x0,'rows':[]};var _0x4a9824=_[_0x677e('0x43')](db[_0x677e('0x44')][_0x677e('0x45')],function(_0x33fce2){return{'name':_0x33fce2[_0x677e('0x46')],'type':_0x33fce2[_0x677e('0x47')]['key']};});_0x141f80[_0x677e('0x48')]=_['map'](_0x4a9824,_0x677e('0x3b'));_0x141f80[_0x677e('0x49')]=_[_0x677e('0x4a')](_0x29b9c0[_0x677e('0x49')]);_0x141f80[_0x677e('0x4b')]=_[_0x677e('0x4c')](_0x141f80[_0x677e('0x48')],_0x141f80[_0x677e('0x49')]);_0xe16ced[_0x677e('0x4d')]=_[_0x677e('0x4c')](_0x141f80['model'],qs[_0x677e('0x4e')](_0x29b9c0['query']['fields']));_0xe16ced[_0x677e('0x4d')]=_0xe16ced[_0x677e('0x4d')][_0x677e('0x4f')]?_0xe16ced[_0x677e('0x4d')]:_0x141f80[_0x677e('0x48')];if(!_0x29b9c0['query'][_0x677e('0x50')](_0x677e('0x51'))){_0xe16ced[_0x677e('0x32')]=qs[_0x677e('0x32')](_0x29b9c0[_0x677e('0x49')]['limit']);_0xe16ced[_0x677e('0x31')]=qs[_0x677e('0x31')](_0x29b9c0[_0x677e('0x49')]['offset']);}_0xe16ced[_0x677e('0x52')]=qs['sort'](_0x29b9c0[_0x677e('0x49')]['sort']);_0xe16ced['where']=qs[_0x677e('0x4b')](_[_0x677e('0x53')](_0x29b9c0[_0x677e('0x49')],_0x141f80[_0x677e('0x4b')]),_0x4a9824);var _0x5d8c27=[];var _0x210f46=squel[_0x677e('0x54')]()['field']('id')[_0x677e('0x55')](_0x677e('0x3b'))[_0x677e('0x55')](_0x677e('0x56'))[_0x677e('0x57')]('tools_tags');var _0x474cf6=squel['select']()['field'](_0x677e('0x58'))['field'](_0x677e('0x59'))[_0x677e('0x55')](_0x677e('0x5a'))[_0x677e('0x57')](_0x677e('0x5b'),'ui')[_0x677e('0x5c')](_0x677e('0x5d'),'u','u.id\x20=\x20ui.UserId');var _0x50913b=squel['select']()[_0x677e('0x57')](_0x677e('0x5e'),'i')[_0x677e('0x5c')](_0x677e('0x5f'),'c',_0x677e('0x60'))[_0x677e('0x5c')]('users','o',_0x677e('0x61'))[_0x677e('0x5c')]('chat_websites','a',_0x677e('0x62'))['left_join'](_0x677e('0x63'),'me',_0x677e('0x64'))[_0x677e('0x5c')](_0x677e('0x65'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x677e('0x5c')]('tools_tags','t',_0x677e('0x66'));var _0x16caaa=squel[_0x677e('0x67')]();var _0x1c6f18=[];var _0x551523=squel['expr']();var _0x4ed131;if(_0x29b9c0[_0x677e('0x49')][_0x677e('0x68')]){_0x4ed131=as['parseSearch'](_0x29b9c0[_0x677e('0x49')][_0x677e('0x68')]);var _0xaa218d=_0x4ed131[_0x677e('0x69')];for(var _0x35c3b7=0x0;_0x35c3b7<_0x4ed131[_0x677e('0x6a')]['length'];_0x35c3b7++){var _0x10fdf6=_0x4ed131['conditions'][_0x35c3b7];var _0x4c48a4='i';var _0x38b717=_['find'](_0x4a9824,['name',_0x10fdf6[_0x677e('0x55')]]);if(!_0x38b717){switch(_0x10fdf6['field']){case _0x677e('0x6b'):if(_0x10fdf6[_0x677e('0x6c')]==0x1){_0x50913b['having']('`'+_0x10fdf6[_0x677e('0x55')]+_0x677e('0x6d'));}else{_0x50913b[_0x677e('0x6e')]('`'+_0x10fdf6[_0x677e('0x55')]+_0x677e('0x6f'));}break;case _0x677e('0x70'):if(_0x10fdf6['operator']===_0x677e('0x71')){if(_0x10fdf6[_0x677e('0x6c')][_0x677e('0x72')]('\x20')['length']>0x1){_0x16caaa[_0xaa218d](_0x677e('0x73'),qs[_0x677e('0x74')](_0x10fdf6[_0x677e('0x6c')]),null);}else{var _0x223dd6='%'+_0x10fdf6[_0x677e('0x6c')]+'%';_0x16caaa[_0xaa218d](_0x677e('0x75'),_0x223dd6,_0x223dd6,_0x223dd6);}}else{_0x38b717=_[_0x677e('0x76')](_0x4a9824,[_0x677e('0x3b'),'ContactId']);_0x10fdf6[_0x677e('0x55')]=_0x677e('0x77');_0x49c583=as[_0x677e('0x78')](_0x4c48a4,_0x38b717[_0x677e('0x47')],_0x10fdf6);_0x16caaa[_0xaa218d](_0x49c583[_0x677e('0x79')],_0x49c583['value'][_0x677e('0x7a')],_0x49c583[_0x677e('0x6c')][_0x677e('0x2d')]);}break;case _0x677e('0x7b'):var _0x5b5d34=_0x10fdf6[_0x677e('0x6c')][_0x677e('0x72')](',')[_0x677e('0x43')](function(_0x3a37aa){return Number(_0x3a37aa);});_0x5b5d34[_0x677e('0x40')](function(_0x18c92c){_0x551523['or'](_0x677e('0x7c'),'%,'+_0x18c92c+',%');});_0x1c6f18=_[_0x677e('0x7d')](_0x1c6f18,_0x5b5d34);break;case _0x677e('0x7e'):if(_0x10fdf6[_0x677e('0x7f')]===_0x677e('0x71')){_0x16caaa[_0xaa218d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x10fdf6['value']+'%',null);}else{_0x38b717=_[_0x677e('0x76')](_0x4a9824,[_0x677e('0x3b'),_0x677e('0x80')]);_0x10fdf6[_0x677e('0x55')]=_0x677e('0x80');_0x49c583=as[_0x677e('0x78')](_0x4c48a4,_0x38b717['type'],_0x10fdf6);_0x16caaa[_0xaa218d](_0x49c583[_0x677e('0x79')],_0x49c583[_0x677e('0x6c')][_0x677e('0x7a')],_0x49c583[_0x677e('0x6c')][_0x677e('0x2d')]);}break;case _0x677e('0x81'):_0x49c583=as['buildExpression']('me',null,_0x10fdf6);_0x16caaa[_0xaa218d](_0x49c583[_0x677e('0x79')],_0x49c583['value']['start'],_0x49c583[_0x677e('0x6c')]['end']);break;}}else{var _0x49c583=as['buildExpression'](_0x4c48a4,_0x38b717['type'],_0x10fdf6);_0x16caaa[_0xaa218d](_0x49c583[_0x677e('0x79')],_0x49c583['value'][_0x677e('0x7a')],_0x49c583[_0x677e('0x6c')]['end']);}}}else{var _0x380281=_(_0x29b9c0[_0x677e('0x49')])[_0x677e('0x4a')]()[_0x677e('0x43')](function(_0x121a2c){return _[_0x677e('0x82')](_0x4a9824,['name',_0x121a2c])?_0x121a2c:undefined;})[_0x677e('0x83')]()['value']();if(!_[_0x677e('0x84')](_0x380281)){_0x380281['forEach'](function(_0x18fa9f){if(_0x18fa9f===_0x677e('0x85')){_0x50913b[_0x677e('0x86')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x29b9c0['query'][_0x18fa9f]));}else if(_0x18fa9f==='createdAt'){var _0x1b4080=JSON[_0x677e('0x87')](_0x29b9c0[_0x677e('0x49')][_0x18fa9f])[_0x677e('0x88')];var _0xff9fdf=JSON[_0x677e('0x87')](_0x29b9c0[_0x677e('0x49')][_0x18fa9f])[_0x677e('0x89')];_0x50913b[_0x677e('0x86')](_0x677e('0x8a'),_0x1b4080,_0xff9fdf);}else{if(_0x29b9c0[_0x677e('0x49')][_0x18fa9f]==='null'){_0x50913b[_0x677e('0x86')]('i.'+_0x18fa9f+_0x677e('0x8b'));}else{_0x50913b['where']('i.'+_0x18fa9f+_0x677e('0x8c'),_0x29b9c0[_0x677e('0x49')][_0x18fa9f]);}}});}if(_0x29b9c0[_0x677e('0x49')][_0x677e('0x8d')]){if(_0x29b9c0[_0x677e('0x49')][_0x677e('0x8d')]==0x1){_0x50913b[_0x677e('0x6e')](_0x677e('0x8e'));}else{_0x50913b[_0x677e('0x6e')]('`unreadMessages`\x20>\x200');}}if(_0x29b9c0['query'][_0x677e('0x8f')]){_0x1c6f18=_[_0x677e('0x90')](_0x29b9c0[_0x677e('0x49')][_0x677e('0x8f')])?_0x29b9c0['query'][_0x677e('0x8f')]:new Array(_0x29b9c0[_0x677e('0x49')][_0x677e('0x8f')]);_0x1c6f18['forEach'](function(_0x53e6f5){_0x551523['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x53e6f5+',%');});}if(_0x29b9c0[_0x677e('0x49')][_0x677e('0x91')]){var _0x4cc89e=_0x29b9c0[_0x677e('0x49')][_0x677e('0x91')][_0x677e('0x92')]('\x5c','\x5c\x5c')[_0x677e('0x92')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x4cc89e)){_0x16caaa['or'](_0x677e('0x93'),_0x4cc89e+'%');}else{_0x16caaa['or'](_0x677e('0x94'),qs[_0x677e('0x74')](_0x4cc89e))['or'](_0x677e('0x95'),_0x4cc89e+'%');}}}_0x50913b['where'](_0x16caaa);_0x50913b['group']('i.id');var _0x3c2ba0={'type':db[_0x677e('0x1f')]['QueryTypes']['SELECT'],'raw':!![]};var _0x2598fc=_0x50913b['clone']();_0x2598fc['field'](_0x677e('0x96'));_0x2598fc[_0x677e('0x55')](_0x677e('0x97'),_0x677e('0x6b'));if(_0xe16ced['order']){_0xe16ced['order']['forEach'](function(_0x2affa9){_0x50913b[_0x677e('0x52')]('i.'+_0x2affa9[0x0],_0x2affa9[0x1]===_0x677e('0x98')?![]:!![]);});}if(!_[_0x677e('0x84')](_0x1c6f18)){_0x50913b[_0x677e('0x6e')](_0x551523);_0x2598fc[_0x677e('0x86')]('t.id\x20IN\x20?',_0x1c6f18);}BPromise[_0x677e('0x99')]()['then'](function(){if(!_0x4ed131){if(_0x29b9c0['query'][_0x677e('0x85')]||_0x29b9c0[_0x677e('0x49')]['journey'])return;_0x2598fc[_0x677e('0x86')](_0x677e('0x9a'));_0x50913b[_0x677e('0x86')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}return _0x29b9c0['user'][_0x677e('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x54d7e3){if(_[_0x677e('0x84')](_0x54d7e3)){_0x2598fc[_0x677e('0x86')](_0x677e('0x9c'));_0x50913b['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x2598fc[_0x677e('0x86')](_0x677e('0x9d'),_[_0x677e('0x43')](_0x54d7e3,'id'));_0x50913b['where'](_0x677e('0x9d'),_[_0x677e('0x43')](_0x54d7e3,'id'));}});})['then'](function(){db[_0x677e('0x9e')]['query'](_0x2598fc[_0x677e('0x9f')](),_0x3c2ba0)[_0x677e('0x22')](function(_0x4cece2){_0x1a34d8[_0x677e('0x30')]=_0x4cece2[_0x677e('0x4f')];if(_0x1a34d8[_0x677e('0x30')]===0x0)return[];return db['sequelize']['query'](_0x210f46['toString'](),_0x3c2ba0)[_0x677e('0x22')](function(_0x46c55a){_0x5d8c27=_[_0x677e('0xa0')](_0x46c55a,'id');_0x3c2ba0=_[_0x677e('0xa1')](_0x3c2ba0,{'model':db[_0x677e('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x29b9c0[_0x677e('0x49')][_0x677e('0x4e')]){_0xe16ced[_0x677e('0x4d')][_0x677e('0x40')](function(_0x404a68){_0x50913b[_0x677e('0x55')]('i.'+_0x404a68);});}else{_0x50913b[_0x677e('0x55')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x677e('0x6b'));_0x50913b['field']('a.key','Account.key');_0x50913b[_0x677e('0x55')](_0x677e('0xa2'),_0x677e('0xa3'));_0x50913b['field'](_0x677e('0xa4'));_0x50913b[_0x677e('0x55')]('c.firstName','Contact.firstName');_0x50913b[_0x677e('0x55')]('c.lastName',_0x677e('0xa5'));_0x50913b['field'](_0x677e('0xa6'),_0x677e('0xa7'));_0x50913b['field'](_0x677e('0xa8'),_0x677e('0xa9'));_0x50913b[_0x677e('0x55')](_0x677e('0xaa'),_0x677e('0xab'));_0x50913b[_0x677e('0x55')](_0x677e('0xac'),_0x677e('0xad'));_0x50913b[_0x677e('0x55')](_0x677e('0xae'),'Owner.fullname');_0x50913b['field'](_0x677e('0xaf'),_0x677e('0xb0'));_0x50913b[_0x677e('0x55')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x677e('0x3e'));}if(_0xe16ced[_0x677e('0x32')])_0x50913b[_0x677e('0x32')](_0xe16ced[_0x677e('0x32')]);if(_0xe16ced['offset'])_0x50913b[_0x677e('0x31')](_0xe16ced[_0x677e('0x31')]);return db[_0x677e('0x9e')][_0x677e('0x49')](_0x50913b['toString'](),_0x3c2ba0);})['then'](function(_0xe70ab){_0x474cf6[_0x677e('0x86')]('ui.ChatInteractionId\x20IN\x20?',_[_0x677e('0x43')](_0xe70ab,'id'));return db[_0x677e('0x9e')][_0x677e('0x49')](_0x474cf6[_0x677e('0x9f')](),_0x3c2ba0)[_0x677e('0x22')](function(_0x35af8b){var _0x36901a=_[_0x677e('0xb1')](_0x35af8b,_0x677e('0xb2'));var _0x2b9ea3=[];_0xe70ab['forEach'](function(_0x9c194b){_0x2b9ea3[_0x677e('0x41')](updateChatInteraction(_0x9c194b,_0x5d8c27,_0x36901a));});return BPromise[_0x677e('0xb3')](_0x2b9ea3);});});})[_0x677e('0x22')](function(_0x39ab73){_0x1a34d8['rows']=_0x39ab73;return _0x1a34d8;})[_0x677e('0x22')](respondWithFilteredResult(_0x283aaa,_0xe16ced));})[_0x677e('0x2b')](handleError(_0x283aaa,null));};exports['show']=function(_0x14c447,_0x17c944){var _0x26578b={'raw':![],'where':{'id':_0x14c447['params']['id']}},_0x3bfa41={};_0x3bfa41[_0x677e('0x48')]=_[_0x677e('0x4a')](db['ChatInteraction'][_0x677e('0x45')]);_0x3bfa41[_0x677e('0x49')]=_[_0x677e('0x4a')](_0x14c447[_0x677e('0x49')]);_0x3bfa41[_0x677e('0x4b')]=_['intersection'](_0x3bfa41[_0x677e('0x48')],_0x3bfa41[_0x677e('0x49')]);_0x26578b[_0x677e('0x4d')]=_['intersection'](_0x3bfa41[_0x677e('0x48')],qs[_0x677e('0x4e')](_0x14c447['query'][_0x677e('0x4e')]));_0x26578b[_0x677e('0x4d')]=_0x26578b['attributes'][_0x677e('0x4f')]?_0x26578b[_0x677e('0x4d')]:_0x3bfa41[_0x677e('0x48')];if(_0x14c447[_0x677e('0x49')][_0x677e('0xb4')]){_0x26578b[_0x677e('0xb5')]=[{'all':!![]}];}_0x26578b=_['merge']({},_0x26578b,_0x14c447[_0x677e('0xb6')]);return db[_0x677e('0x44')]['find'](_0x26578b)[_0x677e('0x22')](handleEntityNotFound(_0x17c944,null))['then'](respondWithResult(_0x17c944,null))['catch'](handleError(_0x17c944,null));};exports['create']=function(_0x1438f2,_0x2b7e56){return db[_0x677e('0x44')][_0x677e('0xb7')](_0x1438f2['body'],{})['then'](respondWithResult(_0x2b7e56,0xc9))[_0x677e('0x2b')](handleError(_0x2b7e56,null));};exports[_0x677e('0x38')]=function(_0x48c59e,_0x122a82){if(_0x48c59e[_0x677e('0x81')]['id']){delete _0x48c59e[_0x677e('0x81')]['id'];}return db[_0x677e('0x44')]['find']({'where':{'id':_0x48c59e[_0x677e('0xb8')]['id']}})['then'](handleEntityNotFound(_0x122a82,null))[_0x677e('0x22')](saveUpdates(_0x48c59e['body'],null))['then'](respondWithResult(_0x122a82,null))[_0x677e('0x2b')](handleError(_0x122a82,null));};exports[_0x677e('0x39')]=function(_0x23629c,_0x3b3acf){return db[_0x677e('0x44')][_0x677e('0x76')]({'where':{'id':_0x23629c[_0x677e('0xb8')]['id']}})[_0x677e('0x22')](handleEntityNotFound(_0x3b3acf,null))[_0x677e('0x22')](removeEntity(_0x3b3acf,null))['catch'](handleError(_0x3b3acf,null));};exports[_0x677e('0xb9')]=function(_0x36680e,_0x5eff3e){return db[_0x677e('0x44')]['describe']()[_0x677e('0x22')](respondWithResult(_0x5eff3e,null))[_0x677e('0x2b')](handleError(_0x5eff3e,null));};exports[_0x677e('0xba')]=function(_0x4f149a,_0x9d34f1){var _0xb76875=_0x4f149a[_0x677e('0xb8')]['id'];var _0x45fcdb;var _0x335c41;var _0x3cf834;return db[_0x677e('0x44')][_0x677e('0xbb')]({'where':{'id':_0xb76875}})[_0x677e('0x22')](function(_0x12c7f7){_0x45fcdb=_0x12c7f7;return db[_0x677e('0xbc')][_0x677e('0xbb')]({'where':{'id':_0x12c7f7[_0x677e('0x85')]},'attributes':['id',_0x677e('0xbd'),_0x677e('0xbe')],'raw':!![]});})[_0x677e('0x22')](function(_0x1ee713){if(_0x1ee713&&_0x1ee713[_0x677e('0xbd')]&&_0x1ee713['vidaooEscalation']){_0x335c41=_0x1ee713;var _0x1a2c40={'rejectUnauthorized':![],'method':_0x677e('0xbf'),'uri':_0x677e('0xc0'),'headers':{'X-APIKEY':_0x1ee713[_0x677e('0xbd')]},'body':{'name':'MotionCWB:'+_0xb76875},'redirect':'follow','json':!![]};return rp(_0x1a2c40);}else{throw new db[(_0x677e('0x1f'))][(_0x677e('0x20'))](_0x677e('0xc1'));}})[_0x677e('0x22')](function(_0x46997f){_0x3cf834=_0x46997f;if(_0x3cf834['id']){var _0x37cd36={'body':_0x3cf834[_0x677e('0xc2')],'ChatWebsiteId':_0x335c41['id'],'ChatInteractionId':_0x45fcdb['id'],'direction':_0x677e('0xc3'),'UserId':_0x4f149a['user']['id']};return db['ChatMessage'][_0x677e('0xb7')](_0x37cd36,{});}else{throw new db[(_0x677e('0x1f'))][(_0x677e('0x20'))](_0x677e('0xc4'));}})[_0x677e('0x22')](function(){return _0x45fcdb[_0x677e('0xc5')]({'vidaooSessionId':_0x3cf834['id']});})['then'](respondWithResult(_0x9d34f1,null))[_0x677e('0x2b')](handleError(_0x9d34f1,null));};exports[_0x677e('0xc6')]=function(_0x2759c0,_0x2d599a){if(_0x2759c0[_0x677e('0x81')]['id']){delete _0x2759c0[_0x677e('0x81')]['id'];}return db[_0x677e('0x44')]['find']({'where':{'id':_0x2759c0['params']['id']}})[_0x677e('0x22')](handleEntityNotFound(_0x2d599a,null))[_0x677e('0x22')](saveUpdates(_0x2759c0[_0x677e('0x81')],null))[_0x677e('0x22')](respondWithResult(_0x2d599a,null))[_0x677e('0x2b')](handleError(_0x2d599a,null));};exports[_0x677e('0xc7')]=function(_0xb75788,_0x2ecbb4,_0x72a76c){if(_0xb75788[_0x677e('0x81')]['id']){delete _0xb75788[_0x677e('0x81')]['id'];}return db['ChatInteraction'][_0x677e('0x76')]({'where':{'id':_0xb75788[_0x677e('0xb8')]['id']}})['then'](function(_0x255c72){if(!_0x255c72){logger[_0x677e('0x28')](_0x677e('0xc8'),'abandon',0x194,_0x677e('0xc9'));_0x2ecbb4[_0x677e('0x2c')](0x194);}else{if(_0x255c72[_0x677e('0x80')]){throw new db[(_0x677e('0x1f'))]['ValidationError'](_0x677e('0xca'));}}return _0x255c72;})['then'](function(_0x50e4fc){if(_0x50e4fc){return _0x50e4fc[_0x677e('0x38')]({'closed':_0xb75788[_0x677e('0x81')][_0x677e('0xcb')],'disposition':_0xb75788[_0x677e('0x81')]['disposition']})['then'](function(_0x12d83b){return _0x12d83b;});}})[_0x677e('0x22')](function(_0x48d0c8){return respondWithRpcPromise(_0x677e('0xcc'),'abandon',_0xb75788['body'],client9004);})[_0x677e('0x22')](respondWithResult(_0x2ecbb4,null))[_0x677e('0x2b')](handleError(_0x2ecbb4,null));};exports[_0x677e('0xcd')]=function(_0x4dc15b,_0x199a76,_0x1aea20){_0x4dc15b['body']['name']=_0x4dc15b['file'][_0x677e('0xce')];_0x4dc15b[_0x677e('0x81')][_0x677e('0xcf')]=_0x4dc15b['file']['filename'];_0x4dc15b[_0x677e('0x81')][_0x677e('0x47')]=_0x4dc15b[_0x677e('0xd0')][_0x677e('0xd1')];return db[_0x677e('0xd2')][_0x677e('0xb7')](_0x4dc15b[_0x677e('0x81')])[_0x677e('0x22')](respondWithResult(_0x199a76,0xc9))[_0x677e('0x2b')](handleError(_0x199a76,null));};exports[_0x677e('0xd3')]=function(_0x59099f,_0x224112,_0xdd5b02){return db[_0x677e('0x44')]['findOne']({'where':{'id':_0x59099f['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x224112,null))['then'](function(_0x4f6063){if(_0x4f6063){if(_0x4f6063[_0x677e('0xcb')]){return _0x224112[_0x677e('0x2e')](0x193)[_0x677e('0x2f')]({'status':0x193,'message':_0x677e('0xd4')});}return db['Attachment']['findOne']({'where':{'id':_0x59099f[_0x677e('0x49')]['attachId']},'raw':!![]})[_0x677e('0x22')](handleEntityNotFound(_0x224112,null));}})[_0x677e('0x22')](function(_0x450a77){if(_0x450a77){return _0x224112[_0x677e('0xd5')](path['join'](config[_0x677e('0xd6')],_0x677e('0xd7'),_0x450a77[_0x677e('0xcf')]));}})[_0x677e('0x2b')](handleError(_0x224112,null));};exports[_0x677e('0xd8')]=function(_0x2999ce,_0x26ca90){var _0x3b4d82=null;var _0x2fcfe4=null;var _0x283b93=null;var _0x578616=null;if(_0x2999ce['body']['id']){delete _0x2999ce['body']['id'];}if(_0x2999ce[_0x677e('0x81')][_0x677e('0xd9')]){_0x578616=path['join'](config['root'],_0x677e('0xda'),util[_0x677e('0xdb')](_0x677e('0xdc'),Date[_0x677e('0xdd')]()));_0x2999ce['body']['pathTranscript']=_0x578616;}return db[_0x677e('0x44')][_0x677e('0x76')]({'where':{'id':_0x2999ce[_0x677e('0xb8')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x677e('0x7e')],'as':_0x677e('0x7e')}]}]})[_0x677e('0x22')](handleEntityNotFound(_0x26ca90,null))[_0x677e('0x22')](saveUpdates(_0x2999ce[_0x677e('0x81')],null))[_0x677e('0x22')](function(_0x477754){if(_0x477754){_0x3b4d82=_0x477754;return db[_0x677e('0xbc')]['find']({'where':{'id':_0x3b4d82[_0x677e('0x85')]}});}})[_0x677e('0x22')](function(_0x2dd242){if(_0x2dd242){_0x283b93=_0x2dd242;return db['CmContact'][_0x677e('0x76')]({'where':{'id':_0x3b4d82[_0x677e('0x77')]}});}})[_0x677e('0x22')](function(_0x12cee1){if(_0x12cee1){_0x2fcfe4=_0x12cee1;if(_0x578616){var _0x2284f9=null;for(var _0x2f86f7=0x1;_0x2f86f7<_0x3b4d82[_0x677e('0xde')]['length'];++_0x2f86f7){_0x2284f9=_0x3b4d82[_0x677e('0xde')][_0x2f86f7];var _0x61aa51=_0x2284f9[_0x677e('0x80')]?util[_0x677e('0xdb')](_0x677e('0xdf'),_0x283b93[_0x677e('0xe0')],_0x2284f9[_0x677e('0x80')]):_0x677e('0xe1');var _0x134d58=_0x2999ce[_0x677e('0x81')][_0x677e('0xe2')]||util['format'](_0x677e('0xdf'),_0x677e('0xe3'),_0x2284f9[_0x677e('0x77')]);switch(_0x283b93[_0x677e('0xe4')]){case _0x677e('0xe5'):_0x61aa51=_0x2284f9['UserId']?util[_0x677e('0xdb')](_0x677e('0xdf'),_0x283b93[_0x677e('0xe0')],_0x2284f9[_0x677e('0x80')]):_0x677e('0xe1');break;case'agent_alias':_0x61aa51=_0x2284f9[_0x677e('0x80')]?_0x2284f9[_0x677e('0x7e')][_0x677e('0xe6')]||_0x2284f9[_0x677e('0x7e')][_0x677e('0x3d')]:'System';break;case _0x677e('0xe7'):_0x61aa51=_0x2284f9['UserId']?_0x2284f9['User'][_0x677e('0x3d')]:_0x677e('0xe1');break;default:_0x61aa51=_0x2284f9[_0x677e('0x80')]?util['format'](_0x677e('0xdf'),_0x283b93['agentAlias'],_0x2284f9[_0x677e('0x80')]):_0x677e('0xe1');}var _0x328b00=util[_0x677e('0xdb')](_0x677e('0xe8'),moment(_0x2284f9[_0x677e('0xe9')])[_0x677e('0xdb')](_0x677e('0xea')),_0x2284f9[_0x677e('0xeb')]==='in'?_0x134d58:_0x61aa51,_0x2284f9[_0x677e('0x81')]);if(!_0x2284f9[_0x677e('0xec')]){fs[_0x677e('0xed')](_0x578616,_0x328b00);}}return db['MailAccount'][_0x677e('0xbb')]({'where':{'service':!![]},'include':[{'model':db[_0x677e('0xee')],'as':_0x677e('0xef'),'raw':!![]}]});}}})['then'](function(_0x50690f){if(_0x50690f&&_0x50690f[_0x677e('0xef')]&&_0x2999ce[_0x677e('0x81')]){var _0x24dc91={'tls':{'rejectUnauthorized':![]}};if(_0x50690f[_0x677e('0xef')][_0x677e('0xf0')]){_0x24dc91['service']=_0x50690f['Smtp']['service'];}else{_0x24dc91['host']=_0x50690f['Smtp']['host'];_0x24dc91[_0x677e('0xf1')]=_0x50690f[_0x677e('0xef')]['port'];_0x24dc91[_0x677e('0xf2')]=_0x50690f[_0x677e('0xef')][_0x677e('0xf2')];}if(_0x50690f['Smtp'][_0x677e('0xf3')]){_0x24dc91[_0x677e('0xf4')]={'user':_0x50690f[_0x677e('0xef')][_0x677e('0xf5')],'pass':_0x50690f['Smtp'][_0x677e('0xf6')]};}return respondWithRpcPromise('SendMail',_0x677e('0xf7'),{'account':_0x24dc91,'message':{'from':util[_0x677e('0xdb')](_0x677e('0xf8'),_0x50690f[_0x677e('0x3b')],_0x50690f['email']||_0x50690f[_0x677e('0xef')][_0x677e('0xf5')]),'to':_0x2999ce[_0x677e('0x81')][_0x677e('0xd9')],'subject':_0x677e('0xf9'),'text':util[_0x677e('0xdb')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x2999ce['body'][_0x677e('0xd9')]),'attachments':[{'path':_0x578616}]}})[_0x677e('0x22')](function(){return _0x3b4d82;})[_0x677e('0x2b')](function(_0x1f094d){console[_0x677e('0x28')](_0x1f094d);});}else{return _0x3b4d82;}})[_0x677e('0x22')](respondWithStatusCode(_0x26ca90,0xc8))[_0x677e('0x2b')](handleError(_0x26ca90,null));};exports['addMessage']=function(_0x2bd1d1,_0x53b233,_0x5ee416){return db[_0x677e('0xfa')][_0x677e('0x76')]({'where':{'id':_0x2bd1d1[_0x677e('0xb8')]['id']}})[_0x677e('0x22')](handleEntityNotFound(_0x53b233,null))[_0x677e('0x22')](function(_0x465254){if(_0x465254){return _0x465254[_0x677e('0xfb')](_0x2bd1d1[_0x677e('0x81')]['ids'],_[_0x677e('0xfc')](_0x2bd1d1[_0x677e('0x81')],[_0x677e('0xfd'),'id'])||{});}})[_0x677e('0x22')](respondWithResult(_0x53b233,null))[_0x677e('0x2b')](handleError(_0x53b233,null));};exports[_0x677e('0xfe')]=function(_0x51a898,_0x1623e6,_0x1551a7){var _0x41957b={'raw':![],'where':{}};var _0x55b4cc={};var _0x3a917c={'count':0x0,'rows':[]};return db[_0x677e('0x44')][_0x677e('0xbb')]({'where':{'id':_0x51a898[_0x677e('0xb8')]['id']}})[_0x677e('0x22')](handleEntityNotFound(_0x1623e6,null))[_0x677e('0x22')](function(_0x4ccd54){if(_0x4ccd54){_0x55b4cc[_0x677e('0x48')]=_[_0x677e('0x4a')](db[_0x677e('0xfa')][_0x677e('0x45')]);_0x55b4cc[_0x677e('0x49')]=_[_0x677e('0x4a')](_0x51a898[_0x677e('0x49')]);_0x55b4cc['filters']=_[_0x677e('0x4c')](_0x55b4cc[_0x677e('0x48')],_0x55b4cc['query']);_0x41957b[_0x677e('0x4d')]=_[_0x677e('0x4c')](_0x55b4cc[_0x677e('0x48')],qs[_0x677e('0x4e')](_0x51a898[_0x677e('0x49')]['fields']));_0x41957b[_0x677e('0x4d')]=_0x41957b[_0x677e('0x4d')]['length']?_0x41957b[_0x677e('0x4d')]:_0x55b4cc['model'];if(!_0x51a898[_0x677e('0x49')][_0x677e('0x50')]('nolimit')){_0x41957b[_0x677e('0x32')]=qs[_0x677e('0x32')](_0x51a898[_0x677e('0x49')]['limit']);_0x41957b[_0x677e('0x31')]=qs[_0x677e('0x31')](_0x51a898[_0x677e('0x49')][_0x677e('0x31')]);}_0x41957b['order']=qs[_0x677e('0xff')](_0x51a898[_0x677e('0x49')][_0x677e('0xff')]);_0x41957b[_0x677e('0x86')]=qs[_0x677e('0x4b')](_[_0x677e('0x53')](_0x51a898[_0x677e('0x49')],_0x55b4cc['filters']));_0x41957b[_0x677e('0x86')][_0x677e('0xb2')]=_0x4ccd54['id'];if(_0x51a898[_0x677e('0x49')][_0x677e('0x91')]){_0x41957b[_0x677e('0x86')]=_[_0x677e('0xa1')](_0x41957b['where'],{'$or':_[_0x677e('0x43')](_0x41957b[_0x677e('0x4d')],function(_0x527c25){var _0x4da318={};_0x4da318[_0x527c25]={'$like':'%'+_0x51a898[_0x677e('0x49')][_0x677e('0x91')]+'%'};return _0x4da318;})});}if(_0x51a898['query'][_0x677e('0x88')]){var _0x4796a2=_0x51a898[_0x677e('0x49')][_0x677e('0x88')][_0x677e('0x72')](',');var _0x252319={};_0x252319[_0x4796a2[0x0]]={'$gte':moment(_0x4796a2[0x1])['format'](_0x677e('0x100'))};_0x41957b[_0x677e('0x86')]=_[_0x677e('0xa1')](_0x41957b[_0x677e('0x86')],_0x252319);}_0x41957b=_['merge']({},_0x41957b,_0x51a898['options']);return db['ChatMessage'][_0x677e('0x30')]({'where':_0x41957b[_0x677e('0x86')]})[_0x677e('0x22')](function(_0xe1f650){_0x3a917c[_0x677e('0x30')]=_0xe1f650;if(_0x51a898[_0x677e('0x49')][_0x677e('0xb4')]){_0x41957b[_0x677e('0xb5')]=[{'all':!![]}];}return db[_0x677e('0xfa')][_0x677e('0x101')](_0x41957b);})[_0x677e('0x22')](function(_0x2cd39c){_0x3a917c['rows']=_0x2cd39c;return _0x3a917c;});}})[_0x677e('0x22')](respondWithFilteredResult(_0x1623e6,_0x41957b))[_0x677e('0x2b')](handleError(_0x1623e6,null));};exports[_0x677e('0x102')]=function(_0x2f6bc7,_0x369e68,_0x4564a2){var _0xedfdc0={'where':{}},_0xd185ec={},_0x16f78f={'count':0x0,'rows':[]};return db[_0x677e('0x44')]['findOne']({'where':{'id':_0x2f6bc7['params']['id']}})[_0x677e('0x22')](handleEntityNotFound(_0x369e68,null))[_0x677e('0x22')](function(_0x991bca){if(_0x991bca){_0xd185ec['model']=_[_0x677e('0x4a')](db[_0x677e('0xfa')][_0x677e('0x45')]);_0xd185ec[_0x677e('0x49')]=_[_0x677e('0x4a')](_0x2f6bc7[_0x677e('0x49')]);_0xd185ec[_0x677e('0x4b')]=_[_0x677e('0x4c')](_0xd185ec[_0x677e('0x48')],_0xd185ec[_0x677e('0x49')]);_0xedfdc0[_0x677e('0x4d')]=_['intersection'](_0xd185ec[_0x677e('0x48')],qs[_0x677e('0x4e')](_0x2f6bc7[_0x677e('0x49')][_0x677e('0x4e')]));_0xedfdc0[_0x677e('0x4d')]=_0xedfdc0[_0x677e('0x4d')][_0x677e('0x4f')]?_0xedfdc0[_0x677e('0x4d')]:_0xd185ec[_0x677e('0x48')];if(!_0x2f6bc7['query']['hasOwnProperty'](_0x677e('0x51'))){_0xedfdc0[_0x677e('0x32')]=qs[_0x677e('0x32')](_0x2f6bc7['query']['limit']);_0xedfdc0[_0x677e('0x31')]=qs[_0x677e('0x31')](_0x2f6bc7[_0x677e('0x49')]['offset']);}_0xedfdc0['order']=qs[_0x677e('0xff')](_0x2f6bc7[_0x677e('0x49')][_0x677e('0xff')]);_0xedfdc0['where']=qs[_0x677e('0x4b')](_[_0x677e('0x53')](_0x2f6bc7[_0x677e('0x49')],_0xd185ec['filters']));_0xedfdc0[_0x677e('0x86')][_0x677e('0xb2')]=_0x991bca['id'];if(_0x2f6bc7[_0x677e('0x49')][_0x677e('0x91')]){_0xedfdc0[_0x677e('0x86')]=_[_0x677e('0xa1')](_0xedfdc0[_0x677e('0x86')],{'$or':_['map'](_0xedfdc0[_0x677e('0x4d')],function(_0x283c6e){var _0x26b63a={};_0x26b63a[_0x283c6e]={'$like':'%'+_0x2f6bc7[_0x677e('0x49')][_0x677e('0x91')]+'%'};return _0x26b63a;})});}_0xedfdc0[_0x677e('0x86')]['secret']=![];if(_0x2f6bc7[_0x677e('0x49')]['id']){_0xedfdc0[_0x677e('0x86')]['id']={'$gt':_0x2f6bc7[_0x677e('0x49')]['id']};}_0xedfdc0=_[_0x677e('0xa1')]({},_0xedfdc0,_0x2f6bc7[_0x677e('0xb6')]);return db['ChatMessage']['count']({'where':_0xedfdc0[_0x677e('0x86')]})[_0x677e('0x22')](function(_0x5e4e46){_0x16f78f['count']=_0x5e4e46;_0xedfdc0[_0x677e('0xb5')]=[];if(_0x2f6bc7[_0x677e('0x49')]['includeAgent']){_0xedfdc0[_0x677e('0xb5')][_0x677e('0x41')]({'model':db[_0x677e('0x7e')],'as':_0x677e('0x7e'),'attributes':['id','fullname',_0x677e('0xe6')]});}if(_0x2f6bc7['query'][_0x677e('0xb4')]){_0xedfdc0['include']=[{'all':!![]}];}return db[_0x677e('0xfa')][_0x677e('0x101')](_0xedfdc0);})['then'](function(_0x1e05c2){_0x16f78f[_0x677e('0x103')]=_0x1e05c2;return _0x16f78f;});}})['then'](respondWithFilteredResult(_0x369e68,_0xedfdc0))[_0x677e('0x2b')](handleError(_0x369e68,null));};exports[_0x677e('0x104')]=function(_0x1c8e60,_0x5d92b0,_0x50b2af){return db[_0x677e('0x44')]['find']({'where':{'id':_0x1c8e60[_0x677e('0xb8')]['id']}})[_0x677e('0x22')](handleEntityNotFound(_0x5d92b0,null))[_0x677e('0x22')](function(_0x3965e3){if(_0x3965e3){return _0x3965e3[_0x677e('0x105')](_0x1c8e60[_0x677e('0x81')][_0x677e('0xfd')],_[_0x677e('0xfc')](_0x1c8e60[_0x677e('0x81')],[_0x677e('0xfd'),'id'])||{})[_0x677e('0x106')](function(){return db['Tag'][_0x677e('0x101')]({'attributes':['id',_0x677e('0x3b'),_0x677e('0x56')],'where':{'id':_0x1c8e60[_0x677e('0x81')][_0x677e('0xfd')]}});})[_0x677e('0x22')](function(_0x26f775){socket[_0x677e('0x107')](_0x677e('0x108'),{'id':Number(_0x1c8e60['params']['id']),'tags':_0x26f775||[]});return{'id':Number(_0x1c8e60[_0x677e('0xb8')]['id']),'tags':_0x26f775||[]};});}})[_0x677e('0x22')](respondWithResult(_0x5d92b0,null))[_0x677e('0x2b')](handleError(_0x5d92b0,null));};exports[_0x677e('0x109')]=function(_0x6f7713,_0x1989ad,_0x3dfe46){return db[_0x677e('0x44')][_0x677e('0x76')]({'where':{'id':_0x6f7713[_0x677e('0xb8')]['id']}})[_0x677e('0x22')](handleEntityNotFound(_0x1989ad,null))[_0x677e('0x22')](function(_0x371ce8){if(_0x371ce8){return _0x371ce8[_0x677e('0x109')](_0x6f7713['query'][_0x677e('0xfd')]);}})[_0x677e('0x22')](respondWithStatusCode(_0x1989ad,null))[_0x677e('0x2b')](handleError(_0x1989ad,null));};exports['download']=function(_0x227ba4,_0x17787b){var _0x3abab9=moment()[_0x677e('0x10a')]()[_0x677e('0x9f')]();var _0x939513=path[_0x677e('0x10b')](config[_0x677e('0xd6')],'server',_0x677e('0x10c'),_0x677e('0x10d'));var _0x1d1bbb=path[_0x677e('0x10b')](config[_0x677e('0xd6')],_0x677e('0x10e'),_0x677e('0x10c'),_0x677e('0x10f'));var _0x546035=path['join'](_0x939513,_0x3abab9);var _0x4019f8=util['format']('transcript-%d-%s.zip',_0x227ba4[_0x677e('0xb8')]['id'],_0x3abab9);var _0x4858d4=path['join'](_0x939513,_0x4019f8);var _0x4b138c=[];_0x4b138c[_0x677e('0x41')]({'model':db[_0x677e('0x7e')],'as':_0x677e('0x7e'),'attributes':['id',_0x677e('0x3d')],'raw':!![]});_0x4b138c['push']({'model':db['CmContact'],'as':_0x677e('0x70'),'attributes':['id',_0x677e('0x110'),_0x677e('0x111')],'raw':!![]});if(_0x227ba4['query'][_0x677e('0x10f')]){_0x4b138c['push']({'model':db[_0x677e('0xd2')],'as':'Attachment','raw':!![]});}var _0x1a08a6=[{'model':db[_0x677e('0xfa')],'as':_0x677e('0xde'),'attributes':['id',_0x677e('0x81'),_0x677e('0xe9'),_0x677e('0xeb'),_0x677e('0xec'),'read'],'include':_0x4b138c}];_0x1a08a6[_0x677e('0x41')]({'model':db[_0x677e('0xbc')],'as':'Account','attributes':['id',_0x677e('0x3b')]});_0x1a08a6['push']({'model':db[_0x677e('0x7e')],'as':'Owner','attributes':['id','fullname']});return db['ChatInteraction'][_0x677e('0x76')]({'where':{'id':_0x227ba4[_0x677e('0xb8')]['id']},'include':_0x1a08a6})[_0x677e('0x22')](handleEntityNotFound(_0x17787b,null))[_0x677e('0x22')](function(_0x269698){if(_0x269698){var _0x44ef00=_0x269698[_0x677e('0x112')]({'plain':!![]});fs[_0x677e('0x113')](_0x546035);var _0x1eabab={'format':'A4','border':_0x677e('0x114'),'header':{'height':_0x677e('0x115'),'contents':{'first':_0x677e('0x116')}},'footer':{'height':_0x677e('0x117'),'contents':{'default':util[_0x677e('0xdb')]('<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>',util['format'](_0x677e('0x118'),_0x677e('0x119'),_0x44ef00['id']),moment()[_0x677e('0xdb')](_0x677e('0x11a'))[_0x677e('0x9f')]())}}};var _0xe50704={'channel':_0x677e('0x119'),'account':_0x44ef00[_0x677e('0x11b')][_0x677e('0x3b')],'agent':_0x44ef00[_0x677e('0x11c')]?_0x44ef00[_0x677e('0x11c')][_0x677e('0x3d')]:_0x677e('0x11d'),'createdAt':moment(_0x44ef00[_0x677e('0xe9')])[_0x677e('0xdb')](_0x677e('0x100'))['toString'](),'closedAt':_0x44ef00[_0x677e('0xcb')]?moment(_0x44ef00[_0x677e('0x11e')])[_0x677e('0xdb')](_0x677e('0x100'))[_0x677e('0x9f')]():'','disposition':_0x44ef00[_0x677e('0x11f')],'chatInfo':{'browser':_0x44ef00[_0x677e('0x120')],'os':_0x44ef00['osName'],'referer':_0x44ef00[_0x677e('0x121')],'customerIp':_0x44ef00['customerIp'],'customerPort':_0x44ef00['customerPort']?_0x44ef00[_0x677e('0x122')]:'N.A.'},'messages':_(_0x44ef00['Messages'])[_0x677e('0x123')]()['filter']({'secret':![]})[_0x677e('0x43')](function(_0x228970){if(_0x228970['Attachment']){var _0x24d853=path[_0x677e('0x10b')](_0x1d1bbb,_0x228970[_0x677e('0xd2')][_0x677e('0xcf')]);if(fs[_0x677e('0x124')](_0x24d853)){fs[_0x677e('0x125')](_0x24d853)[_0x677e('0x126')](fs['createWriteStream'](path[_0x677e('0x10b')](_0x546035,_0x228970[_0x677e('0xd2')][_0x677e('0xcf')])));}}return{'date':moment(_0x228970[_0x677e('0xe9')])[_0x677e('0xdb')](_0x677e('0x100'))[_0x677e('0x9f')](),'sender':_0x228970['direction']===_0x677e('0xc3')?_0x228970['User']?_0x228970[_0x677e('0x7e')][_0x677e('0x3d')]:_0x677e('0xe1'):_0x228970[_0x677e('0x70')][_0x677e('0x110')]+(_0x228970['Contact']['lastName']?'\x20'+_0x228970['Contact']['lastName']:''),'body':_0x228970[_0x677e('0xd2')]?_0x228970[_0x677e('0xd2')][_0x677e('0xcf')]:_0x228970['body'],'direction':_0x228970[_0x677e('0xeb')]===_0x677e('0xc3')?'A':'C','secret':_0x228970['secret'],'read':_0x228970[_0x677e('0x8d')],'attachment':_0x228970[_0x677e('0xd2')]};})[_0x677e('0x6c')]()};return ejs[_0x677e('0x127')](path[_0x677e('0x10b')](config[_0x677e('0xd6')],_0x677e('0x10e'),_0x677e('0x128'),_0x677e('0x129')),{'interaction':_0xe50704})[_0x677e('0x22')](function(_0x53343d){return new BPromise(function(_0x784b4d,_0x1d67ce){pdf['create'](_0x53343d,_0x1eabab)[_0x677e('0x12a')](path[_0x677e('0x10b')](_0x546035,_0x677e('0x12b')+_0x44ef00['id']+'-'+_0x3abab9+'.pdf'),function(_0x48f5fa,_0x435ba5){if(_0x48f5fa)return _0x1d67ce(_0x48f5fa);_0x784b4d(_0x435ba5);});});})[_0x677e('0x22')](function(){return new BPromise(function(_0x3d0619,_0x2421c8){zipdir(_0x546035,{'saveTo':_0x4858d4},function(_0x23553e,_0x45e64c){if(_0x23553e)return _0x2421c8(_0x23553e);return _0x3d0619(_0x45e64c);});})['then'](function(){return new BPromise(function(_0x4780c3,_0x574461){rimraf(_0x546035,function(_0x1f8686){if(_0x1f8686)_0x574461(_0x1f8686);return _0x4780c3();});});})[_0x677e('0x22')](function(){return _0x17787b[_0x677e('0xd5')](_0x4858d4,_0x4019f8,function(_0x3e0b56){if(_0x3e0b56){console[_0x677e('0x12c')](_0x677e('0x12d'),_0x3e0b56);}else{fs[_0x677e('0x12e')](_0x4858d4);}});});});}else{return _0x17787b[_0x677e('0x2c')](0xc8);}})[_0x677e('0x2b')](handleError(_0x17787b,null));};
\ No newline at end of file
index 2aedf81..b9e68c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d66=['save','then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty','hook','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x3f1ad8,_0x5e0bc5){var _0xee4c33=function(_0x48acb6){while(--_0x48acb6){_0x3f1ad8['push'](_0x3f1ad8['shift']());}};_0xee4c33(++_0x5e0bc5);}(_0x5d66,0xea));var _0x65d6=function(_0x109e23,_0x2bedcd){_0x109e23=_0x109e23-0x0;var _0xd3d3cd=_0x5d66[_0x109e23];return _0xd3d3cd;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x65d6('0x0'))['db'][_0x65d6('0x1')];var ChatMessage=require(_0x65d6('0x0'))['db'][_0x65d6('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x65d6('0x3')](0x0);var events={'afterCreate':_0x65d6('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x31f008){return function(_0x1378c0,_0x5e96ec,_0x269c30){_0x1378c0['getUsers']({'attributes':['id'],'raw':!![]})[_0x65d6('0x5')](function(_0x4e51f8){_0x1378c0[_0x65d6('0x6')](_0x65d6('0x7'),_0x4e51f8[_0x65d6('0x8')](function(_0x385b7f){return{'id':_0x385b7f['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1378c0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x65d6('0x5')](function(_0x4da212){_0x1378c0[_0x65d6('0x6')](_0x65d6('0x9'),_0x4da212[_0x65d6('0xa')]);ChatInteractionEvents['emit'](_0x31f008+':'+_0x1378c0['id'],_0x1378c0);ChatInteractionEvents[_0x65d6('0xb')](_0x31f008,_0x1378c0);_0x269c30(null);})['catch'](_0x269c30(null));};}for(var e in events){if(events[_0x65d6('0xc')](e)){var event=events[e];ChatInteraction[_0x65d6('0xd')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x871e=['remove','getUsers','Users','findAll','then','setDataValue','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','update'];(function(_0x36daf3,_0x2ea0dd){var _0x3e4e26=function(_0x31999a){while(--_0x31999a){_0x36daf3['push'](_0x36daf3['shift']());}};_0x3e4e26(++_0x2ea0dd);}(_0x871e,0x185));var _0xe871=function(_0x4a2798,_0x554df2){_0x4a2798=_0x4a2798-0x0;var _0x2f50dd=_0x871e[_0x4a2798];return _0x2f50dd;};'use strict';var EventEmitter=require(_0xe871('0x0'));var ChatInteraction=require(_0xe871('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xe871('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe871('0x2'),'afterDestroy':_0xe871('0x3')};function emitEvent(_0x22c1a2){return function(_0x15576e,_0xce51e,_0x226c69){_0x15576e[_0xe871('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0xb6624a){_0x15576e['setDataValue'](_0xe871('0x5'),_0xb6624a['map'](function(_0x564109){return{'id':_0x564109['id']};}));return ChatMessage[_0xe871('0x6')]({'where':{'ChatInteractionId':_0x15576e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe871('0x7')](function(_0x2754d5){_0x15576e[_0xe871('0x8')]('unreadMessages',_0x2754d5[_0xe871('0x9')]);ChatInteractionEvents[_0xe871('0xa')](_0x22c1a2+':'+_0x15576e['id'],_0x15576e);ChatInteractionEvents[_0xe871('0xa')](_0x22c1a2,_0x15576e);_0x226c69(null);})['catch'](_0x226c69(null));};}for(var e in events){if(events[_0xe871('0xb')](e)){var event=events[e];ChatInteraction[_0xe871('0xc')](e,emitEvent(event));}}module[_0xe871('0xd')]=ChatInteractionEvents;
\ No newline at end of file
index 1081502..33b0733 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dfa=['api','bluebird','request-promise','path','../../config/environment','exports','define','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x1eee76,_0x5f4bcf){var _0x49f47e=function(_0x269f3c){while(--_0x269f3c){_0x1eee76['push'](_0x1eee76['shift']());}};_0x49f47e(++_0x5f4bcf);}(_0x5dfa,0x115));var _0xa5df=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5dfa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa5df('0x0'));var util=require(_0xa5df('0x1'));var logger=require(_0xa5df('0x2'))(_0xa5df('0x3'));var moment=require('moment');var BPromise=require(_0xa5df('0x4'));var rp=require(_0xa5df('0x5'));var fs=require('fs');var path=require(_0xa5df('0x6'));var rimraf=require('rimraf');var config=require(_0xa5df('0x7'));var attributes=require('./chatInteraction.attributes');module[_0xa5df('0x8')]=function(_0x31e84f,_0x1f56cb){return _0x31e84f[_0xa5df('0x9')]('ChatInteraction',attributes,{'tableName':_0xa5df('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45db07,_0x33298d,_0x259950){if(_0x45db07[_0xa5df('0xb')]('closed')){_0x45db07[_0xa5df('0xc')]=moment()['format'](_0xa5df('0xd'));}_0x259950(null,_0x45db07);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1025=['utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x4f3467,_0x3c8ed9){var _0x5a9c8e=function(_0x35fe09){while(--_0x35fe09){_0x4f3467['push'](_0x4f3467['shift']());}};_0x5a9c8e(++_0x3c8ed9);}(_0x1025,0x16a));var _0x5102=function(_0x80eb99,_0xf5b711){_0x80eb99=_0x80eb99-0x0;var _0x398203=_0x1025[_0x80eb99];return _0x398203;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5102('0x0'))(_0x5102('0x1'));var moment=require(_0x5102('0x2'));var BPromise=require(_0x5102('0x3'));var rp=require(_0x5102('0x4'));var fs=require('fs');var path=require(_0x5102('0x5'));var rimraf=require(_0x5102('0x6'));var config=require(_0x5102('0x7'));var attributes=require(_0x5102('0x8'));module[_0x5102('0x9')]=function(_0x4c84b2,_0x525195){return _0x4c84b2[_0x5102('0xa')]('ChatInteraction',attributes,{'tableName':_0x5102('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a4f75,_0x7df201,_0x3f6e37){if(_0x5a4f75[_0x5102('0xc')](_0x5102('0xd'))){_0x5a4f75[_0x5102('0xe')]=moment()[_0x5102('0xf')](_0x5102('0x10'));}_0x3f6e37(null,_0x5a4f75);}},'charset':_0x5102('0x11'),'collate':_0x5102('0x12')});};
\ No newline at end of file
index cc6b9cc..ff3c0bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe847=['error','message','info','result','catch','ChatInteraction','body','raw','options','where','attributes','limit','UpdateChatInteraction','debug','stringify','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','then','ChatInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xe847,0xf0));var _0x7e84=function(_0x1eee82,_0x926df6){_0x1eee82=_0x1eee82-0x0;var _0x2d1c12=_0xe847[_0x1eee82];return _0x2d1c12;};'use strict';var _=require(_0x7e84('0x0'));var util=require(_0x7e84('0x1'));var moment=require('moment');var BPromise=require(_0x7e84('0x2'));var rs=require(_0x7e84('0x3'));var fs=require('fs');var Redis=require(_0x7e84('0x4'));var db=require(_0x7e84('0x5'))['db'];var utils=require(_0x7e84('0x6'));var logger=require('../../config/logger')(_0x7e84('0x7'));var config=require(_0x7e84('0x8'));var jayson=require(_0x7e84('0x9'));var client=jayson[_0x7e84('0xa')][_0x7e84('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7e84('0xc')],{'host':_0x7e84('0xd'),'port':0x18eb});var socket=require(_0x7e84('0xe'))(new Redis(config[_0x7e84('0xc')]));require(_0x7e84('0xf'))['register'](socket);function respondWithRpcPromise(_0x369e33,_0x44f5dd,_0x288316){return new BPromise(function(_0x2eff81,_0x466f95){return client['request'](_0x369e33,_0x288316)[_0x7e84('0x10')](function(_0x5473da){logger['info'](_0x7e84('0x11'),_0x44f5dd,_0x7e84('0x12'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x44f5dd,_0x7e84('0x12'),JSON['stringify'](_0x5473da));if(_0x5473da[_0x7e84('0x13')]){if(_0x5473da[_0x7e84('0x13')]['code']===0x1f4){logger['error'](_0x7e84('0x11'),_0x44f5dd,_0x5473da[_0x7e84('0x13')][_0x7e84('0x14')]);return _0x466f95(_0x5473da[_0x7e84('0x13')]['message']);}logger['error'](_0x7e84('0x11'),_0x44f5dd,_0x5473da['error'][_0x7e84('0x14')]);return _0x2eff81(_0x5473da[_0x7e84('0x13')][_0x7e84('0x14')]);}else{logger[_0x7e84('0x15')](_0x7e84('0x11'),_0x44f5dd,_0x7e84('0x12'));_0x2eff81(_0x5473da[_0x7e84('0x16')][_0x7e84('0x14')]);}})[_0x7e84('0x17')](function(_0x3ee853){logger[_0x7e84('0x13')](_0x7e84('0x11'),_0x44f5dd,_0x3ee853);_0x466f95(_0x3ee853);});});}exports['UpdateChatInteraction']=function(_0x4c5444){var _0xd0fe53=this;return new Promise(function(_0x316838,_0x4fff98){return db[_0x7e84('0x18')]['update'](_0x4c5444[_0x7e84('0x19')],{'raw':_0x4c5444['options']?_0x4c5444['options'][_0x7e84('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c5444[_0x7e84('0x1b')]?_0x4c5444[_0x7e84('0x1b')][_0x7e84('0x1c')]||null:null,'attributes':_0x4c5444[_0x7e84('0x1b')]?_0x4c5444[_0x7e84('0x1b')][_0x7e84('0x1d')]||null:null,'limit':_0x4c5444['options']?_0x4c5444[_0x7e84('0x1b')][_0x7e84('0x1e')]||null:null})['then'](function(_0x2659a6){logger['info'](_0x7e84('0x1f'),_0x4c5444);logger[_0x7e84('0x20')]('UpdateChatInteraction',_0x4c5444,JSON[_0x7e84('0x21')](_0x2659a6));_0x316838(_0x2659a6);})[_0x7e84('0x17')](function(_0x4af2e8){logger[_0x7e84('0x13')](_0x7e84('0x1f'),_0x4af2e8[_0x7e84('0x14')],_0x4c5444);_0x4fff98(_0xd0fe53[_0x7e84('0x13')](0x1f4,_0x4af2e8[_0x7e84('0x14')]));});});};exports['AddTagsToChatInteraction']=function(_0x447ad2){return new Promise(function(_0x2dbd3a,_0x4e647c){return db[_0x7e84('0x18')]['find']({'where':_0x447ad2[_0x7e84('0x1b')]?_0x447ad2[_0x7e84('0x1b')][_0x7e84('0x1c')]||null:null})['then'](function(_0x408605){if(_0x408605){return _0x408605['addTags'](_0x447ad2[_0x7e84('0x19')][_0x7e84('0x22')],_[_0x7e84('0x23')](_0x447ad2[_0x7e84('0x19')],['ids','id'])||{});}})['spread'](function(_0x216c8d){logger['info'](_0x7e84('0x24'),_0x447ad2);logger[_0x7e84('0x20')](_0x7e84('0x24'),_0x447ad2,JSON[_0x7e84('0x21')](_0x216c8d));_0x2dbd3a(_0x216c8d);})[_0x7e84('0x17')](function(_0x416949){logger[_0x7e84('0x13')](_0x7e84('0x24'),_0x416949[_0x7e84('0x14')],_0x447ad2);_0x4e647c(_this[_0x7e84('0x13')](0x1f4,_0x416949[_0x7e84('0x14')]));});});};
\ No newline at end of file
+var _0x0ffe=['ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToChatInteraction','find','omit','ids','spread','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','info'];(function(_0x46c9fc,_0x9d7b6e){var _0x46c32b=function(_0x48fe78){while(--_0x48fe78){_0x46c9fc['push'](_0x46c9fc['shift']());}};_0x46c32b(++_0x9d7b6e);}(_0x0ffe,0x68));var _0xe0ff=function(_0x4d063f,_0x32f1fd){_0x4d063f=_0x4d063f-0x0;var _0x597d8a=_0x0ffe[_0x4d063f];return _0x597d8a;};'use strict';var _=require('lodash');var util=require(_0xe0ff('0x0'));var moment=require(_0xe0ff('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0ff('0x2'));var db=require(_0xe0ff('0x3'))['db'];var utils=require(_0xe0ff('0x4'));var logger=require('../../config/logger')(_0xe0ff('0x5'));var config=require(_0xe0ff('0x6'));var jayson=require(_0xe0ff('0x7'));var client=jayson[_0xe0ff('0x8')][_0xe0ff('0x9')]({'port':0x232a});config[_0xe0ff('0xa')]=_[_0xe0ff('0xb')](config[_0xe0ff('0xa')],{'host':_0xe0ff('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe0ff('0xa')]));require(_0xe0ff('0xd'))[_0xe0ff('0xe')](socket);function respondWithRpcPromise(_0x5060d8,_0x1b3023,_0x53a30a){return new BPromise(function(_0x373cec,_0x42805a){return client['request'](_0x5060d8,_0x53a30a)['then'](function(_0x21d95a){logger[_0xe0ff('0xf')](_0xe0ff('0x10'),_0x1b3023,_0xe0ff('0x11'));logger[_0xe0ff('0x12')](_0xe0ff('0x13'),_0x1b3023,_0xe0ff('0x11'),JSON[_0xe0ff('0x14')](_0x21d95a));if(_0x21d95a[_0xe0ff('0x15')]){if(_0x21d95a['error']['code']===0x1f4){logger['error'](_0xe0ff('0x10'),_0x1b3023,_0x21d95a[_0xe0ff('0x15')]['message']);return _0x42805a(_0x21d95a[_0xe0ff('0x15')][_0xe0ff('0x16')]);}logger[_0xe0ff('0x15')](_0xe0ff('0x10'),_0x1b3023,_0x21d95a[_0xe0ff('0x15')][_0xe0ff('0x16')]);return _0x373cec(_0x21d95a[_0xe0ff('0x15')]['message']);}else{logger[_0xe0ff('0xf')](_0xe0ff('0x10'),_0x1b3023,_0xe0ff('0x11'));_0x373cec(_0x21d95a[_0xe0ff('0x17')][_0xe0ff('0x16')]);}})[_0xe0ff('0x18')](function(_0xdd9b4b){logger[_0xe0ff('0x15')](_0xe0ff('0x10'),_0x1b3023,_0xdd9b4b);_0x42805a(_0xdd9b4b);});});}exports[_0xe0ff('0x19')]=function(_0x37da9a){var _0x474650=this;return new Promise(function(_0x312973,_0x4a7831){return db[_0xe0ff('0x1a')][_0xe0ff('0x1b')](_0x37da9a[_0xe0ff('0x1c')],{'raw':_0x37da9a[_0xe0ff('0x1d')]?_0x37da9a[_0xe0ff('0x1d')][_0xe0ff('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37da9a['options']?_0x37da9a[_0xe0ff('0x1d')][_0xe0ff('0x1f')]||null:null,'attributes':_0x37da9a['options']?_0x37da9a['options'][_0xe0ff('0x20')]||null:null,'limit':_0x37da9a[_0xe0ff('0x1d')]?_0x37da9a[_0xe0ff('0x1d')][_0xe0ff('0x21')]||null:null})[_0xe0ff('0x22')](function(_0xeda592){logger['info'](_0xe0ff('0x19'),_0x37da9a);logger['debug'](_0xe0ff('0x19'),_0x37da9a,JSON['stringify'](_0xeda592));_0x312973(_0xeda592);})[_0xe0ff('0x18')](function(_0x23858a){logger[_0xe0ff('0x15')](_0xe0ff('0x19'),_0x23858a[_0xe0ff('0x16')],_0x37da9a);_0x4a7831(_0x474650[_0xe0ff('0x15')](0x1f4,_0x23858a['message']));});});};exports[_0xe0ff('0x23')]=function(_0x2ae522){return new Promise(function(_0x4ed638,_0x5b7d0a){return db[_0xe0ff('0x1a')][_0xe0ff('0x24')]({'where':_0x2ae522['options']?_0x2ae522['options'][_0xe0ff('0x1f')]||null:null})[_0xe0ff('0x22')](function(_0x5e536e){if(_0x5e536e){return _0x5e536e['addTags'](_0x2ae522[_0xe0ff('0x1c')]['ids'],_[_0xe0ff('0x25')](_0x2ae522['body'],[_0xe0ff('0x26'),'id'])||{});}})[_0xe0ff('0x27')](function(_0x3109cb){logger[_0xe0ff('0xf')]('AddTags',_0x2ae522);logger[_0xe0ff('0x12')]('AddTags',_0x2ae522,JSON[_0xe0ff('0x14')](_0x3109cb));_0x4ed638(_0x3109cb);})[_0xe0ff('0x18')](function(_0x17bd14){logger[_0xe0ff('0x15')]('AddTags',_0x17bd14[_0xe0ff('0x16')],_0x2ae522);_0x5b7d0a(_this['error'](0x1f4,_0x17bd14['message']));});});};
\ No newline at end of file
index fe8170c..0003773 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13e3=['update','emit','removeListener','register','length','chatInteraction:','save','remove'];(function(_0x3814f4,_0x3b1758){var _0x235887=function(_0x42e145){while(--_0x42e145){_0x3814f4['push'](_0x3814f4['shift']());}};_0x235887(++_0x3b1758);}(_0x13e3,0x196));var _0x313e=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x13e3[_0x725b8e];return _0x43ac45;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x313e('0x0'),_0x313e('0x1'),_0x313e('0x2')];function createListener(_0x2529c1,_0x194aba){return function(_0x5823e0){_0x194aba[_0x313e('0x3')](_0x2529c1,_0x5823e0);};}function removeListener(_0x88ea23,_0x42eb24){return function(){ChatInteractionEvents[_0x313e('0x4')](_0x88ea23,_0x42eb24);};}exports[_0x313e('0x5')]=function(_0x23cf36){for(var _0x2cacde=0x0,_0x1963fb=events[_0x313e('0x6')];_0x2cacde<_0x1963fb;_0x2cacde++){var _0x317672=events[_0x2cacde];var _0x1235f2=createListener(_0x313e('0x7')+_0x317672,_0x23cf36);ChatInteractionEvents['on'](_0x317672,_0x1235f2);}};
\ No newline at end of file
+var _0xbc91=['./chatInteraction.events','save','remove','update','emit','length','chatInteraction:'];(function(_0x1e0790,_0x4fbb38){var _0x449216=function(_0x2248f3){while(--_0x2248f3){_0x1e0790['push'](_0x1e0790['shift']());}};_0x449216(++_0x4fbb38);}(_0xbc91,0xd2));var _0x1bc9=function(_0x15b35c,_0xac8e16){_0x15b35c=_0x15b35c-0x0;var _0x2f623c=_0xbc91[_0x15b35c];return _0x2f623c;};'use strict';var ChatInteractionEvents=require(_0x1bc9('0x0'));var events=[_0x1bc9('0x1'),_0x1bc9('0x2'),_0x1bc9('0x3')];function createListener(_0xa8624c,_0x499526){return function(_0xbf0350){_0x499526[_0x1bc9('0x4')](_0xa8624c,_0xbf0350);};}function removeListener(_0x1fac26,_0x102540){return function(){ChatInteractionEvents['removeListener'](_0x1fac26,_0x102540);};}exports['register']=function(_0x3369ac){for(var _0x11903f=0x0,_0x4f81e0=events[_0x1bc9('0x5')];_0x11903f<_0x4f81e0;_0x11903f++){var _0x8f41d8=events[_0x11903f];var _0x497132=createListener(_0x1bc9('0x6')+_0x8f41d8,_0x3369ac);ChatInteractionEvents['on'](_0x8f41d8,_0x497132);}};
\ No newline at end of file
index cb0477a..db46fc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38c9=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','createVidaooSession','join','root','format','%s-%s','originalname','replace','file','attachmentUpload','/:id/tags','chat','addTags','tracked','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','/:id','chatinteraction:destroy','removeTags'];(function(_0x581e8d,_0x530746){var _0x9c0533=function(_0x4a6c2d){while(--_0x4a6c2d){_0x581e8d['push'](_0x581e8d['shift']());}};_0x9c0533(++_0x530746);}(_0x38c9,0x199));var _0x938c=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x38c9[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0x938c('0x0'));var util=require(_0x938c('0x1'));var path=require(_0x938c('0x2'));var timeout=require('connect-timeout');var express=require(_0x938c('0x3'));var router=express[_0x938c('0x4')]();var auth=require(_0x938c('0x5'));var interaction=require(_0x938c('0x6'));var config=require('../../config/environment');var controller=require(_0x938c('0x7'));router[_0x938c('0x8')]('/',auth[_0x938c('0x9')](),controller[_0x938c('0xa')]);router['get'](_0x938c('0xb'),auth[_0x938c('0x9')](),controller[_0x938c('0xc')]);router[_0x938c('0x8')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x938c('0xd')]);router[_0x938c('0x8')](_0x938c('0xe'),auth[_0x938c('0xf')](),controller[_0x938c('0x10')]);router[_0x938c('0x8')](_0x938c('0x11'),auth[_0x938c('0x9')](),controller[_0x938c('0x12')]);router[_0x938c('0x8')](_0x938c('0x13'),auth[_0x938c('0xf')](),controller[_0x938c('0x14')]);router[_0x938c('0x8')](_0x938c('0x15'),auth['isAuthenticated'](),controller[_0x938c('0x16')]);router['post']('/',auth[_0x938c('0x9')](),controller[_0x938c('0x17')]);router[_0x938c('0x18')]('/:id/vidaoo',auth[_0x938c('0x9')](),controller[_0x938c('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22cc2e,_0x9c469d,_0x9d9f88){_0x9d9f88(null,path[_0x938c('0x1a')](config[_0x938c('0x1b')],'server/files/attachments/'));},'filename':function(_0x23b7d3,_0x472057,_0x492ee2){_0x492ee2(null,util[_0x938c('0x1c')](_0x938c('0x1d'),Date['now'](),_0x472057[_0x938c('0x1e')][_0x938c('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload['single'](_0x938c('0x20')),controller[_0x938c('0x21')]);router[_0x938c('0x18')](_0x938c('0x11'),auth[_0x938c('0xf')](),controller['addMessage']);router['post'](_0x938c('0x22'),auth[_0x938c('0x9')](),interaction['tracked'](_0x938c('0x23'),'chatinteraction:addtags'),controller[_0x938c('0x24')]);router['put']('/:id',auth[_0x938c('0x9')](),interaction[_0x938c('0x25')](_0x938c('0x23'),_0x938c('0x26')),controller[_0x938c('0x27')]);router[_0x938c('0x28')](_0x938c('0x29'),controller[_0x938c('0x2a')]);router[_0x938c('0x28')](_0x938c('0x2b'),auth[_0x938c('0xf')](),controller['abandon']);router['put'](_0x938c('0x2c'),controller[_0x938c('0x2d')]);router[_0x938c('0x2e')](_0x938c('0x2f'),auth[_0x938c('0x9')](),interaction['tracked']('chat',_0x938c('0x30')),controller['destroy']);router['delete'](_0x938c('0x22'),auth[_0x938c('0x9')](),controller[_0x938c('0x31')]);module[_0x938c('0x32')]=router;
\ No newline at end of file
+var _0x30d3=['/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','diskStorage','root','server/files/attachments/','%s-%s','replace','single','file','attachmentUpload','tracked','chat','addTags','put','update','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized'];(function(_0x403282,_0x261d4d){var _0x419547=function(_0x34ffd2){while(--_0x34ffd2){_0x403282['push'](_0x403282['shift']());}};_0x419547(++_0x261d4d);}(_0x30d3,0x9f));var _0x330d=function(_0x5f0ba7,_0x41c2e9){_0x5f0ba7=_0x5f0ba7-0x0;var _0x308397=_0x30d3[_0x5f0ba7];return _0x308397;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x330d('0x0'));var timeout=require(_0x330d('0x1'));var express=require(_0x330d('0x2'));var router=express[_0x330d('0x3')]();var auth=require(_0x330d('0x4'));var interaction=require(_0x330d('0x5'));var config=require(_0x330d('0x6'));var controller=require('./chatInteraction.controller');router[_0x330d('0x7')]('/',auth[_0x330d('0x8')](),controller[_0x330d('0x9')]);router[_0x330d('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x330d('0xa')]);router[_0x330d('0x7')](_0x330d('0xb'),auth[_0x330d('0xc')](),controller['show']);router['get'](_0x330d('0xd'),auth[_0x330d('0xc')](),controller[_0x330d('0xe')]);router[_0x330d('0x7')](_0x330d('0xf'),auth[_0x330d('0x8')](),controller[_0x330d('0x10')]);router['get'](_0x330d('0x11'),auth[_0x330d('0xc')](),controller[_0x330d('0x12')]);router['get'](_0x330d('0x13'),auth[_0x330d('0x8')](),controller[_0x330d('0x14')]);router[_0x330d('0x15')]('/',auth['isAuthenticated'](),controller[_0x330d('0x16')]);router[_0x330d('0x15')]('/:id/vidaoo',auth[_0x330d('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x330d('0x17')]({'destination':function(_0x40a237,_0x3801f4,_0x5e5baf){_0x5e5baf(null,path['join'](config[_0x330d('0x18')],_0x330d('0x19')));},'filename':function(_0x4431a4,_0x571c7f,_0x582539){_0x582539(null,util['format'](_0x330d('0x1a'),Date['now'](),_0x571c7f['originalname'][_0x330d('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x330d('0x15')]('/:id/attachment_upload',upload[_0x330d('0x1c')](_0x330d('0x1d')),controller[_0x330d('0x1e')]);router[_0x330d('0x15')](_0x330d('0xf'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x330d('0x15')]('/:id/tags',auth[_0x330d('0x8')](),interaction[_0x330d('0x1f')](_0x330d('0x20'),'chatinteraction:addtags'),controller[_0x330d('0x21')]);router[_0x330d('0x22')]('/:id',auth['isAuthenticated'](),interaction[_0x330d('0x1f')](_0x330d('0x20'),'chatinteraction:update'),controller[_0x330d('0x23')]);router[_0x330d('0x22')]('/:id/custom_update',controller['customUpdate']);router[_0x330d('0x22')](_0x330d('0x24'),auth[_0x330d('0xc')](),controller[_0x330d('0x25')]);router[_0x330d('0x22')]('/:id/close',controller['close']);router[_0x330d('0x26')](_0x330d('0xb'),auth['isAuthenticated'](),interaction[_0x330d('0x1f')](_0x330d('0x20'),_0x330d('0x27')),controller[_0x330d('0x28')]);router[_0x330d('0x26')](_0x330d('0x29'),auth['isAuthenticated'](),controller[_0x330d('0x2a')]);module['exports']=router;
\ No newline at end of file
index 8426ed5..d52b443 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x570eeb,_0x3c616a){var _0x37ac96=function(_0x50f485){while(--_0x50f485){_0x570eeb['push'](_0x570eeb['shift']());}};_0x37ac96(++_0x3c616a);}(_0x2ef3,0xba));var _0x32ef=function(_0x47ea79,_0x58a9fd){_0x47ea79=_0x47ea79-0x0;var _0x12204c=_0x2ef3[_0x47ea79];return _0x12204c;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'body':{'type':Sequelize[_0x32ef('0x2')](_0x32ef('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x32ef('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x32ef('0x5')]}};
\ No newline at end of file
+var _0x4975=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x4975,0x86));var _0x5497=function(_0x1c6b8e,_0x480aae){_0x1c6b8e=_0x1c6b8e-0x0;var _0x2f9de6=_0x4975[_0x1c6b8e];return _0x2f9de6;};'use strict';var Sequelize=require(_0x5497('0x0'));module['exports']={'body':{'type':Sequelize[_0x5497('0x1')](_0x5497('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5497('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5497('0x4')]}};
\ No newline at end of file
index c912468..4e37a42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04a4=['filter','merge','ChatInternalMessage','then','includeAll','rows','catch','show','params','include','find','create','body','destroy','describe','messages','lastMessageAt','createdAt','lastMessage','getUsers','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','findAll','isEmpty','push','FromId','read','all','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatInternalMessage.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x04a4,0x95));var _0x404a=function(_0x2ae444,_0x5e9881){_0x2ae444=_0x2ae444-0x0;var _0x4d8790=_0x04a4[_0x2ae444];return _0x4d8790;};'use strict';var pdf=require(_0x404a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x404a('0x1'));var jsonpatch=require(_0x404a('0x2'));var rp=require('request-promise');var moment=require(_0x404a('0x3'));var BPromise=require(_0x404a('0x4'));var Mustache=require(_0x404a('0x5'));var util=require('util');var path=require(_0x404a('0x6'));var sox=require(_0x404a('0x7'));var csv=require(_0x404a('0x8'));var ejs=require(_0x404a('0x9'));var fs=require('fs');var _=require(_0x404a('0xa'));var squel=require('squel');var crypto=require(_0x404a('0xb'));var jsforce=require(_0x404a('0xc'));var deskjs=require(_0x404a('0xd'));var toCsv=require(_0x404a('0x8'));var querystring=require(_0x404a('0xe'));var Papa=require('papaparse');var Redis=require(_0x404a('0xf'));var authService=require(_0x404a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x404a('0x11'));var logger=require(_0x404a('0x12'))(_0x404a('0x13'));var utils=require(_0x404a('0x14'));var config=require(_0x404a('0x15'));var db=require(_0x404a('0x16'))['db'];config['redis']=_['defaults'](config[_0x404a('0x17')],{'host':_0x404a('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x404a('0x17')]));require(_0x404a('0x19'))[_0x404a('0x1a')](socket);function respondWithStatusCode(_0x1d877d,_0x9b67a){_0x9b67a=_0x9b67a||0xcc;return function(_0x40de8b){if(_0x40de8b){return _0x1d877d[_0x404a('0x1b')](_0x9b67a);}return _0x1d877d['status'](_0x9b67a)[_0x404a('0x1c')]();};}function respondWithResult(_0x3fc5e6,_0x9bffb5){_0x9bffb5=_0x9bffb5||0xc8;return function(_0x79111b){if(_0x79111b){return _0x3fc5e6[_0x404a('0x1d')](_0x9bffb5)[_0x404a('0x1e')](_0x79111b);}};}function respondWithFilteredResult(_0x588486,_0x4b18aa){return function(_0x3da300){if(_0x3da300){var _0x2174f4=_0x3da300[_0x404a('0x1f')],_0x459452=_0x4b18aa[_0x404a('0x20')],_0x2059e6=_0x4b18aa[_0x404a('0x20')]+_0x4b18aa[_0x404a('0x21')],_0x26df1e;if(_0x2059e6>=_0x2174f4){_0x2059e6=_0x2174f4;_0x26df1e=0xc8;}else{_0x26df1e=0xce;}_0x588486['status'](_0x26df1e);return _0x588486[_0x404a('0x22')](_0x404a('0x23'),_0x459452+'-'+_0x2059e6+'/'+_0x2174f4)[_0x404a('0x1e')](_0x3da300);}return null;};}function patchUpdates(_0x40d956){return function(_0x4a6799){try{jsonpatch[_0x404a('0x24')](_0x4a6799,_0x40d956,!![]);}catch(_0x389fb1){return BPromise['reject'](_0x389fb1);}return _0x4a6799[_0x404a('0x25')]();};}function saveUpdates(_0x3ca95b,_0x48dcc9){return function(_0x16dc87){if(_0x16dc87){return _0x16dc87[_0x404a('0x26')](_0x3ca95b)['then'](function(_0x4d3778){return _0x4d3778;});}return null;};}function removeEntity(_0x1e3ce3,_0x40bcac){return function(_0x349cbc){if(_0x349cbc){return _0x349cbc['destroy']()['then'](function(){_0x1e3ce3[_0x404a('0x1d')](0xcc)[_0x404a('0x1c')]();});}};}function handleEntityNotFound(_0x189fff,_0x24196b){return function(_0x495ba4){if(!_0x495ba4){_0x189fff[_0x404a('0x1b')](0x194);}return _0x495ba4;};}function handleError(_0x3ffc87,_0x474d4e){_0x474d4e=_0x474d4e||0x1f4;return function(_0x225590){logger['error'](_0x225590[_0x404a('0x27')]);if(_0x225590[_0x404a('0x28')]){delete _0x225590['name'];}_0x3ffc87[_0x404a('0x1d')](_0x474d4e)[_0x404a('0x29')](_0x225590);};}exports[_0x404a('0x2a')]=function(_0x3be345,_0x544045){var _0xa3afb8={},_0x527248={},_0x5072ba={'count':0x0,'rows':[]};var _0x5491a9=_[_0x404a('0x2b')](db['ChatInternalMessage'][_0x404a('0x2c')],function(_0x5ae57c){return{'name':_0x5ae57c[_0x404a('0x2d')],'type':_0x5ae57c[_0x404a('0x2e')]['key']};});_0x527248[_0x404a('0x2f')]=_['map'](_0x5491a9,_0x404a('0x28'));_0x527248[_0x404a('0x30')]=_[_0x404a('0x31')](_0x3be345[_0x404a('0x30')]);_0x527248['filters']=_[_0x404a('0x32')](_0x527248[_0x404a('0x2f')],_0x527248[_0x404a('0x30')]);_0xa3afb8[_0x404a('0x33')]=_[_0x404a('0x32')](_0x527248[_0x404a('0x2f')],qs['fields'](_0x3be345[_0x404a('0x30')][_0x404a('0x34')]));_0xa3afb8[_0x404a('0x33')]=_0xa3afb8['attributes'][_0x404a('0x35')]?_0xa3afb8[_0x404a('0x33')]:_0x527248[_0x404a('0x2f')];if(!_0x3be345['query'][_0x404a('0x36')](_0x404a('0x37'))){_0xa3afb8[_0x404a('0x21')]=qs['limit'](_0x3be345[_0x404a('0x30')][_0x404a('0x21')]);_0xa3afb8[_0x404a('0x20')]=qs['offset'](_0x3be345[_0x404a('0x30')][_0x404a('0x20')]);}_0xa3afb8[_0x404a('0x38')]=qs['sort'](_0x3be345[_0x404a('0x30')][_0x404a('0x39')]);_0xa3afb8[_0x404a('0x3a')]=qs['filters'](_[_0x404a('0x3b')](_0x3be345[_0x404a('0x30')],_0x527248[_0x404a('0x3c')]),_0x5491a9);if(_0x3be345[_0x404a('0x30')][_0x404a('0x3d')]){_0xa3afb8['where']=_[_0x404a('0x3e')](_0xa3afb8[_0x404a('0x3a')],{'$or':_[_0x404a('0x2b')](_0x5491a9,function(_0x97dfa3){if(_0x97dfa3[_0x404a('0x2e')]!=='VIRTUAL'){var _0x361b02={};_0x361b02[_0x97dfa3['name']]={'$like':'%'+_0x3be345['query'][_0x404a('0x3d')]+'%'};return _0x361b02;}})});}_0xa3afb8=_['merge']({},_0xa3afb8,_0x3be345['options']);var _0x2c9d18={'where':_0xa3afb8[_0x404a('0x3a')]};return db[_0x404a('0x3f')][_0x404a('0x1f')](_0x2c9d18)[_0x404a('0x40')](function(_0x15f663){_0x5072ba[_0x404a('0x1f')]=_0x15f663;if(_0x3be345[_0x404a('0x30')][_0x404a('0x41')]){_0xa3afb8['include']=[{'all':!![]}];}return db[_0x404a('0x3f')]['findAll'](_0xa3afb8);})[_0x404a('0x40')](function(_0x501e91){_0x5072ba[_0x404a('0x42')]=_0x501e91;return _0x5072ba;})['then'](respondWithFilteredResult(_0x544045,_0xa3afb8))[_0x404a('0x43')](handleError(_0x544045,null));};exports[_0x404a('0x44')]=function(_0x41b77e,_0x27f574){var _0x587e05={'raw':!![],'where':{'id':_0x41b77e[_0x404a('0x45')]['id']}},_0x5a101a={};_0x5a101a['model']=_[_0x404a('0x31')](db[_0x404a('0x3f')][_0x404a('0x2c')]);_0x5a101a['query']=_[_0x404a('0x31')](_0x41b77e[_0x404a('0x30')]);_0x5a101a['filters']=_[_0x404a('0x32')](_0x5a101a[_0x404a('0x2f')],_0x5a101a[_0x404a('0x30')]);_0x587e05[_0x404a('0x33')]=_[_0x404a('0x32')](_0x5a101a[_0x404a('0x2f')],qs[_0x404a('0x34')](_0x41b77e[_0x404a('0x30')][_0x404a('0x34')]));_0x587e05['attributes']=_0x587e05[_0x404a('0x33')][_0x404a('0x35')]?_0x587e05['attributes']:_0x5a101a[_0x404a('0x2f')];if(_0x41b77e['query'][_0x404a('0x41')]){_0x587e05[_0x404a('0x46')]=[{'all':!![]}];}_0x587e05=_[_0x404a('0x3e')]({},_0x587e05,_0x41b77e['options']);return db[_0x404a('0x3f')][_0x404a('0x47')](_0x587e05)['then'](handleEntityNotFound(_0x27f574,null))['then'](respondWithResult(_0x27f574,null))[_0x404a('0x43')](handleError(_0x27f574,null));};exports[_0x404a('0x48')]=function(_0x286602,_0x4cf0a2){return db[_0x404a('0x3f')]['create'](_0x286602[_0x404a('0x49')],{})[_0x404a('0x40')](respondWithResult(_0x4cf0a2,0xc9))[_0x404a('0x43')](handleError(_0x4cf0a2,null));};exports[_0x404a('0x26')]=function(_0x3fc331,_0xbf7a62){if(_0x3fc331[_0x404a('0x49')]['id']){delete _0x3fc331['body']['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x3fc331[_0x404a('0x45')]['id']}})[_0x404a('0x40')](handleEntityNotFound(_0xbf7a62,null))[_0x404a('0x40')](saveUpdates(_0x3fc331['body'],null))[_0x404a('0x40')](respondWithResult(_0xbf7a62,null))[_0x404a('0x43')](handleError(_0xbf7a62,null));};exports[_0x404a('0x4a')]=function(_0x5c3308,_0x7fd865){return db[_0x404a('0x3f')][_0x404a('0x47')]({'where':{'id':_0x5c3308[_0x404a('0x45')]['id']}})['then'](handleEntityNotFound(_0x7fd865,null))[_0x404a('0x40')](removeEntity(_0x7fd865,null))[_0x404a('0x43')](handleError(_0x7fd865,null));};exports[_0x404a('0x4b')]=function(_0x496d6e,_0x3c505a){return db[_0x404a('0x3f')]['describe']()[_0x404a('0x40')](respondWithResult(_0x3c505a,null))[_0x404a('0x43')](handleError(_0x3c505a,null));};function wrapUser(_0x2f7960){return function(_0x22ed80){var _0x5bf438=_0x2f7960['get']({'plain':!![]});_0x5bf438[_0x404a('0x4c')]=[];if(_0x22ed80){_0x5bf438[_0x404a('0x4d')]=_0x22ed80[_0x404a('0x4e')];_0x5bf438['lastMessage']=_0x22ed80;}else{_0x5bf438[_0x404a('0x4d')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5bf438[_0x404a('0x4f')]={};}return _0x5bf438;};}exports[_0x404a('0x50')]=function(_0x53e06e,_0x1ce936,_0x1d89c8){var _0x131dd0=[];return db['User']['findAll']({'where':{'role':[_0x404a('0x51'),_0x404a('0x52'),_0x404a('0x53')]},'attributes':['id',_0x404a('0x54'),_0x404a('0x28'),_0x404a('0x55'),_0x404a('0x56'),_0x404a('0x57'),_0x404a('0x58'),_0x404a('0x59'),_0x404a('0x5a'),_0x404a('0x5b')],'order':qs[_0x404a('0x39')](_0x404a('0x5c')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x404a('0x28'),_0x404a('0x2e')],'through':{'attributes':[]}}]})[_0x404a('0x40')](function(_0x21c86d){if(_0x21c86d){var _0x4976b9=_0x53e06e[_0x404a('0x53')][_0x404a('0x5d')]({'plain':!![]});if(!_0x4976b9)throw new Error(_0x404a('0x5e'));if(_0x4976b9[_0x404a('0x55')]===_0x404a('0x53')){return db[_0x404a('0x5f')][_0x404a('0x47')]({'where':{'name':_0x404a('0x60'),'userProfileId':_0x4976b9[_0x404a('0x61')]},'raw':!![]})[_0x404a('0x40')](function(_0xffd7a){if(_0xffd7a){if(_0xffd7a['autoAssociation']===0x0){return db[_0x404a('0x62')][_0x404a('0x63')]({'where':{'sectionId':_0xffd7a['id']},'raw':!![]})['then'](function(_0x3b42ba){var _0x210745=[];if(_[_0x404a('0x64')](_0x3b42ba)){_0x210745=_[_0x404a('0x3d')](_0x21c86d,function(_0x68dbda){if(_0x68dbda[_0x404a('0x55')]!==_0x404a('0x51')){return _0x68dbda;}});return _0x210745;}else{for(var _0x2bd4e1=0x0;_0x2bd4e1<_0x21c86d[_0x404a('0x35')];_0x2bd4e1++){var _0x26d363=_0x21c86d[_0x2bd4e1];if(_0x26d363[_0x404a('0x55')]==='agent'){var _0x4e9f9f=_[_0x404a('0x47')](_0x3b42ba,function(_0x4692c7){return _0x4692c7['resourceId']===_0x26d363['id'];});if(_0x4e9f9f)_0x210745[_0x404a('0x65')](_0x26d363);}else{_0x210745['push'](_0x26d363);}}return _0x210745;}});}else{return _0x21c86d;}}else{var _0x16939b=_[_0x404a('0x3d')](_0x21c86d,function(_0x16e170){if(_0x16e170[_0x404a('0x55')]!=='agent'){return _0x16e170;}});return _0x16939b;}});}else{return _0x21c86d;}}})['then'](function(_0x300235){var _0x4f17a6=[];if(_0x300235){_0x131dd0=_0x300235;for(var _0x274439=0x0;_0x274439<_0x300235[_0x404a('0x35')];_0x274439+=0x1){_0x131dd0[_0x274439][_0x404a('0x4c')]=[];_0x4f17a6['push'](db[_0x404a('0x3f')][_0x404a('0x47')]({'where':{'FromId':[_0x53e06e[_0x404a('0x53')]['id'],_0x300235[_0x274439]['id']],'ToId':[_0x53e06e[_0x404a('0x53')]['id'],_0x300235[_0x274439]['id']],'ChatGroupId':null},'attributes':['id',_0x404a('0x4e'),_0x404a('0x66'),'ToId',_0x404a('0x67'),_0x404a('0x49')],'order':qs[_0x404a('0x39')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x300235[_0x274439])));}return BPromise[_0x404a('0x68')](_0x4f17a6);}return[];})['then'](function(_0x18b9b2){return{'rows':_0x18b9b2,'count':_0x18b9b2[_0x404a('0x35')]};})[_0x404a('0x40')](respondWithResult(_0x1ce936,null))['catch'](handleError(_0x1ce936,null));};
\ No newline at end of file
+var _0xc421=['showWebBar','-online','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','all','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','count','offset','set','json','apply','reject','save','then','destroy','error','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','show','options','find','create','body','catch','params','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','role','lastLoginAt','allowmessenger'];(function(_0x552c09,_0x3e0527){var _0xee743f=function(_0x4347c9){while(--_0x4347c9){_0x552c09['push'](_0x552c09['shift']());}};_0xee743f(++_0x3e0527);}(_0xc421,0x153));var _0x1c42=function(_0x55cfb9,_0x317fee){_0x55cfb9=_0x55cfb9-0x0;var _0xee8240=_0xc421[_0x55cfb9];return _0xee8240;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1c42('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c42('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1c42('0x2'));var moment=require(_0x1c42('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1c42('0x4'));var util=require(_0x1c42('0x5'));var path=require(_0x1c42('0x6'));var sox=require(_0x1c42('0x7'));var csv=require(_0x1c42('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1c42('0x9'));var squel=require(_0x1c42('0xa'));var crypto=require(_0x1c42('0xb'));var jsforce=require(_0x1c42('0xc'));var deskjs=require(_0x1c42('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1c42('0xe'));var Papa=require(_0x1c42('0xf'));var Redis=require(_0x1c42('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1c42('0x11'));var hardwareService=require(_0x1c42('0x12'));var logger=require(_0x1c42('0x13'))('api');var utils=require(_0x1c42('0x14'));var config=require(_0x1c42('0x15'));var db=require(_0x1c42('0x16'))['db'];config[_0x1c42('0x17')]=_[_0x1c42('0x18')](config[_0x1c42('0x17')],{'host':_0x1c42('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c42('0x17')]));require(_0x1c42('0x1a'))[_0x1c42('0x1b')](socket);function respondWithStatusCode(_0x3f7d47,_0x35da6f){_0x35da6f=_0x35da6f||0xcc;return function(_0x5a1aca){if(_0x5a1aca){return _0x3f7d47[_0x1c42('0x1c')](_0x35da6f);}return _0x3f7d47[_0x1c42('0x1d')](_0x35da6f)[_0x1c42('0x1e')]();};}function respondWithResult(_0x2bdf5b,_0x1a7abd){_0x1a7abd=_0x1a7abd||0xc8;return function(_0x37457f){if(_0x37457f){return _0x2bdf5b['status'](_0x1a7abd)['json'](_0x37457f);}};}function respondWithFilteredResult(_0x4821d3,_0x10b87c){return function(_0x32ba09){if(_0x32ba09){var _0x32f55b=_0x32ba09[_0x1c42('0x1f')],_0x26494a=_0x10b87c[_0x1c42('0x20')],_0x49fb31=_0x10b87c[_0x1c42('0x20')]+_0x10b87c['limit'],_0x484153;if(_0x49fb31>=_0x32f55b){_0x49fb31=_0x32f55b;_0x484153=0xc8;}else{_0x484153=0xce;}_0x4821d3['status'](_0x484153);return _0x4821d3[_0x1c42('0x21')]('Content-Range',_0x26494a+'-'+_0x49fb31+'/'+_0x32f55b)[_0x1c42('0x22')](_0x32ba09);}return null;};}function patchUpdates(_0xbd4ed9){return function(_0xdc25a6){try{jsonpatch[_0x1c42('0x23')](_0xdc25a6,_0xbd4ed9,!![]);}catch(_0x199558){return BPromise[_0x1c42('0x24')](_0x199558);}return _0xdc25a6[_0x1c42('0x25')]();};}function saveUpdates(_0x58de5b,_0x2e3f56){return function(_0x3521e9){if(_0x3521e9){return _0x3521e9['update'](_0x58de5b)[_0x1c42('0x26')](function(_0x2e2054){return _0x2e2054;});}return null;};}function removeEntity(_0x4b2e6c,_0x1f8d11){return function(_0x21b9d8){if(_0x21b9d8){return _0x21b9d8[_0x1c42('0x27')]()['then'](function(){_0x4b2e6c[_0x1c42('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x319ef3,_0x58cba1){return function(_0x8a5108){if(!_0x8a5108){_0x319ef3[_0x1c42('0x1c')](0x194);}return _0x8a5108;};}function handleError(_0x17efb8,_0x55a1be){_0x55a1be=_0x55a1be||0x1f4;return function(_0x1f115c){logger[_0x1c42('0x28')](_0x1f115c['stack']);if(_0x1f115c[_0x1c42('0x29')]){delete _0x1f115c[_0x1c42('0x29')];}_0x17efb8['status'](_0x55a1be)[_0x1c42('0x2a')](_0x1f115c);};}exports[_0x1c42('0x2b')]=function(_0xe6d28b,_0x41b589){var _0x56a662={},_0x505421={},_0x4fa4bd={'count':0x0,'rows':[]};var _0x3442cb=_[_0x1c42('0x2c')](db[_0x1c42('0x2d')]['rawAttributes'],function(_0x2011d6){return{'name':_0x2011d6[_0x1c42('0x2e')],'type':_0x2011d6[_0x1c42('0x2f')][_0x1c42('0x30')]};});_0x505421[_0x1c42('0x31')]=_[_0x1c42('0x2c')](_0x3442cb,'name');_0x505421['query']=_[_0x1c42('0x32')](_0xe6d28b[_0x1c42('0x33')]);_0x505421['filters']=_[_0x1c42('0x34')](_0x505421[_0x1c42('0x31')],_0x505421[_0x1c42('0x33')]);_0x56a662[_0x1c42('0x35')]=_[_0x1c42('0x34')](_0x505421['model'],qs[_0x1c42('0x36')](_0xe6d28b[_0x1c42('0x33')]['fields']));_0x56a662['attributes']=_0x56a662['attributes'][_0x1c42('0x37')]?_0x56a662[_0x1c42('0x35')]:_0x505421[_0x1c42('0x31')];if(!_0xe6d28b['query'][_0x1c42('0x38')](_0x1c42('0x39'))){_0x56a662[_0x1c42('0x3a')]=qs['limit'](_0xe6d28b[_0x1c42('0x33')][_0x1c42('0x3a')]);_0x56a662[_0x1c42('0x20')]=qs[_0x1c42('0x20')](_0xe6d28b[_0x1c42('0x33')][_0x1c42('0x20')]);}_0x56a662[_0x1c42('0x3b')]=qs[_0x1c42('0x3c')](_0xe6d28b[_0x1c42('0x33')]['sort']);_0x56a662[_0x1c42('0x3d')]=qs['filters'](_[_0x1c42('0x3e')](_0xe6d28b[_0x1c42('0x33')],_0x505421[_0x1c42('0x3f')]),_0x3442cb);if(_0xe6d28b[_0x1c42('0x33')][_0x1c42('0x40')]){_0x56a662['where']=_['merge'](_0x56a662[_0x1c42('0x3d')],{'$or':_[_0x1c42('0x2c')](_0x3442cb,function(_0x246d84){if(_0x246d84[_0x1c42('0x2f')]!=='VIRTUAL'){var _0x306a26={};_0x306a26[_0x246d84['name']]={'$like':'%'+_0xe6d28b['query'][_0x1c42('0x40')]+'%'};return _0x306a26;}})});}_0x56a662=_[_0x1c42('0x41')]({},_0x56a662,_0xe6d28b['options']);var _0x355494={'where':_0x56a662['where']};return db['ChatInternalMessage'][_0x1c42('0x1f')](_0x355494)[_0x1c42('0x26')](function(_0x1186a7){_0x4fa4bd[_0x1c42('0x1f')]=_0x1186a7;if(_0xe6d28b[_0x1c42('0x33')][_0x1c42('0x42')]){_0x56a662[_0x1c42('0x43')]=[{'all':!![]}];}return db[_0x1c42('0x2d')][_0x1c42('0x44')](_0x56a662);})['then'](function(_0x4900bb){_0x4fa4bd[_0x1c42('0x45')]=_0x4900bb;return _0x4fa4bd;})[_0x1c42('0x26')](respondWithFilteredResult(_0x41b589,_0x56a662))['catch'](handleError(_0x41b589,null));};exports[_0x1c42('0x46')]=function(_0x59c53e,_0x5468ee){var _0x12116a={'raw':!![],'where':{'id':_0x59c53e['params']['id']}},_0x513000={};_0x513000[_0x1c42('0x31')]=_[_0x1c42('0x32')](db[_0x1c42('0x2d')]['rawAttributes']);_0x513000['query']=_[_0x1c42('0x32')](_0x59c53e[_0x1c42('0x33')]);_0x513000[_0x1c42('0x3f')]=_[_0x1c42('0x34')](_0x513000[_0x1c42('0x31')],_0x513000[_0x1c42('0x33')]);_0x12116a[_0x1c42('0x35')]=_[_0x1c42('0x34')](_0x513000['model'],qs[_0x1c42('0x36')](_0x59c53e[_0x1c42('0x33')][_0x1c42('0x36')]));_0x12116a[_0x1c42('0x35')]=_0x12116a[_0x1c42('0x35')]['length']?_0x12116a[_0x1c42('0x35')]:_0x513000[_0x1c42('0x31')];if(_0x59c53e[_0x1c42('0x33')][_0x1c42('0x42')]){_0x12116a[_0x1c42('0x43')]=[{'all':!![]}];}_0x12116a=_[_0x1c42('0x41')]({},_0x12116a,_0x59c53e[_0x1c42('0x47')]);return db['ChatInternalMessage'][_0x1c42('0x48')](_0x12116a)[_0x1c42('0x26')](handleEntityNotFound(_0x5468ee,null))[_0x1c42('0x26')](respondWithResult(_0x5468ee,null))['catch'](handleError(_0x5468ee,null));};exports[_0x1c42('0x49')]=function(_0x194b97,_0x14ab26){return db[_0x1c42('0x2d')][_0x1c42('0x49')](_0x194b97[_0x1c42('0x4a')],{})[_0x1c42('0x26')](respondWithResult(_0x14ab26,0xc9))[_0x1c42('0x4b')](handleError(_0x14ab26,null));};exports['update']=function(_0x248ff9,_0x1a6d92){if(_0x248ff9[_0x1c42('0x4a')]['id']){delete _0x248ff9[_0x1c42('0x4a')]['id'];}return db[_0x1c42('0x2d')][_0x1c42('0x48')]({'where':{'id':_0x248ff9['params']['id']}})[_0x1c42('0x26')](handleEntityNotFound(_0x1a6d92,null))['then'](saveUpdates(_0x248ff9[_0x1c42('0x4a')],null))[_0x1c42('0x26')](respondWithResult(_0x1a6d92,null))[_0x1c42('0x4b')](handleError(_0x1a6d92,null));};exports[_0x1c42('0x27')]=function(_0x33a0fc,_0x4f5369){return db[_0x1c42('0x2d')][_0x1c42('0x48')]({'where':{'id':_0x33a0fc[_0x1c42('0x4c')]['id']}})[_0x1c42('0x26')](handleEntityNotFound(_0x4f5369,null))[_0x1c42('0x26')](removeEntity(_0x4f5369,null))[_0x1c42('0x4b')](handleError(_0x4f5369,null));};exports['describe']=function(_0x46ec5e,_0x5c1dbe){return db['ChatInternalMessage'][_0x1c42('0x4d')]()[_0x1c42('0x26')](respondWithResult(_0x5c1dbe,null))['catch'](handleError(_0x5c1dbe,null));};function wrapUser(_0xf0333a){return function(_0x141b80){var _0x4722f2=_0xf0333a[_0x1c42('0x4e')]({'plain':!![]});_0x4722f2[_0x1c42('0x4f')]=[];if(_0x141b80){_0x4722f2[_0x1c42('0x50')]=_0x141b80[_0x1c42('0x51')];_0x4722f2['lastMessage']=_0x141b80;}else{_0x4722f2[_0x1c42('0x50')]=moment(0x0)[_0x1c42('0x52')](_0x1c42('0x53'));_0x4722f2[_0x1c42('0x54')]={};}return _0x4722f2;};}exports[_0x1c42('0x55')]=function(_0x993bd,_0x4da909,_0x2a1da6){var _0x368d1c=[];return db[_0x1c42('0x56')]['findAll']({'where':{'role':[_0x1c42('0x57'),_0x1c42('0x58'),_0x1c42('0x59')]},'attributes':['id','fullname',_0x1c42('0x29'),_0x1c42('0x5a'),'userpic','internal','online',_0x1c42('0x5b'),_0x1c42('0x5c'),_0x1c42('0x5d')],'order':qs[_0x1c42('0x3c')](_0x1c42('0x5e')),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x1c42('0x26')](function(_0x263347){if(_0x263347){var _0x4d1812=_0x993bd[_0x1c42('0x59')][_0x1c42('0x4e')]({'plain':!![]});if(!_0x4d1812)throw new Error(_0x1c42('0x5f'));if(_0x4d1812[_0x1c42('0x5a')]===_0x1c42('0x59')){return db[_0x1c42('0x60')]['find']({'where':{'name':_0x1c42('0x61'),'userProfileId':_0x4d1812[_0x1c42('0x62')]},'raw':!![]})['then'](function(_0xf0e347){if(_0xf0e347){if(_0xf0e347[_0x1c42('0x63')]===0x0){return db[_0x1c42('0x64')][_0x1c42('0x44')]({'where':{'sectionId':_0xf0e347['id']},'raw':!![]})[_0x1c42('0x26')](function(_0x111cad){var _0x566f3f=[];if(_[_0x1c42('0x65')](_0x111cad)){_0x566f3f=_[_0x1c42('0x40')](_0x263347,function(_0x1a572a){if(_0x1a572a[_0x1c42('0x5a')]!==_0x1c42('0x57')){return _0x1a572a;}});return _0x566f3f;}else{for(var _0x49d508=0x0;_0x49d508<_0x263347['length'];_0x49d508++){var _0x459415=_0x263347[_0x49d508];if(_0x459415[_0x1c42('0x5a')]===_0x1c42('0x57')){var _0x15f71b=_[_0x1c42('0x48')](_0x111cad,function(_0x46ebd2){return _0x46ebd2[_0x1c42('0x66')]===_0x459415['id'];});if(_0x15f71b)_0x566f3f[_0x1c42('0x67')](_0x459415);}else{_0x566f3f[_0x1c42('0x67')](_0x459415);}}return _0x566f3f;}});}else{return _0x263347;}}else{var _0x41cef4=_[_0x1c42('0x40')](_0x263347,function(_0x14d965){if(_0x14d965[_0x1c42('0x5a')]!==_0x1c42('0x57')){return _0x14d965;}});return _0x41cef4;}});}else{return _0x263347;}}})[_0x1c42('0x26')](function(_0x53e9b0){var _0x4b45d3=[];if(_0x53e9b0){_0x368d1c=_0x53e9b0;for(var _0xa4151b=0x0;_0xa4151b<_0x53e9b0[_0x1c42('0x37')];_0xa4151b+=0x1){_0x368d1c[_0xa4151b][_0x1c42('0x4f')]=[];_0x4b45d3[_0x1c42('0x67')](db[_0x1c42('0x2d')][_0x1c42('0x48')]({'where':{'FromId':[_0x993bd[_0x1c42('0x59')]['id'],_0x53e9b0[_0xa4151b]['id']],'ToId':[_0x993bd[_0x1c42('0x59')]['id'],_0x53e9b0[_0xa4151b]['id']],'ChatGroupId':null},'attributes':['id',_0x1c42('0x51'),_0x1c42('0x68'),_0x1c42('0x69'),_0x1c42('0x6a'),'body'],'order':qs[_0x1c42('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x53e9b0[_0xa4151b])));}return BPromise[_0x1c42('0x6b')](_0x4b45d3);}return[];})[_0x1c42('0x26')](function(_0x3b53bb){return{'rows':_0x3b53bb,'count':_0x3b53bb[_0x1c42('0x37')]};})[_0x1c42('0x26')](respondWithResult(_0x4da909,null))[_0x1c42('0x4b')](handleError(_0x4da909,null));};
\ No newline at end of file
index 33b77cb..f5a01f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcee8=['hasOwnProperty','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit'];(function(_0x49a5f6,_0x2eea42){var _0x22fe92=function(_0x4ed337){while(--_0x4ed337){_0x49a5f6['push'](_0x49a5f6['shift']());}};_0x22fe92(++_0x2eea42);}(_0xcee8,0xb1));var _0x8cee=function(_0x1618f0,_0x3eaebe){_0x1618f0=_0x1618f0-0x0;var _0xb6de7e=_0xcee8[_0x1618f0];return _0xb6de7e;};'use strict';var EventEmitter=require(_0x8cee('0x0'));var ChatInternalMessage=require(_0x8cee('0x1'))['db'][_0x8cee('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8cee('0x3')](0x0);var events={'afterCreate':_0x8cee('0x4'),'afterUpdate':_0x8cee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x127360){return function(_0x4e4143,_0xffd42d,_0x1ec415){ChatInternalMessageEvents['emit'](_0x127360+':'+_0x4e4143['id'],_0x4e4143);ChatInternalMessageEvents[_0x8cee('0x6')](_0x127360,_0x4e4143);_0x1ec415(null);};}for(var e in events){if(events[_0x8cee('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xd89f=['exports','events','../../mysqldb','ChatInternalMessage','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x22bea9,_0x26d3a8){var _0x432864=function(_0x2aa3c9){while(--_0x2aa3c9){_0x22bea9['push'](_0x22bea9['shift']());}};_0x432864(++_0x26d3a8);}(_0xd89f,0x191));var _0xfd89=function(_0x4a6cb5,_0x826f84){_0x4a6cb5=_0x4a6cb5-0x0;var _0x1a4304=_0xd89f[_0x4a6cb5];return _0x1a4304;};'use strict';var EventEmitter=require(_0xfd89('0x0'));var ChatInternalMessage=require(_0xfd89('0x1'))['db'][_0xfd89('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfd89('0x3'),'afterUpdate':_0xfd89('0x4'),'afterDestroy':_0xfd89('0x5')};function emitEvent(_0x2ff053){return function(_0x3de2e2,_0x15bdb8,_0x4e6429){ChatInternalMessageEvents[_0xfd89('0x6')](_0x2ff053+':'+_0x3de2e2['id'],_0x3de2e2);ChatInternalMessageEvents[_0xfd89('0x6')](_0x2ff053,_0x3de2e2);_0x4e6429(null);};}for(var e in events){if(events[_0xfd89('0x7')](e)){var event=events[e];ChatInternalMessage[_0xfd89('0x8')](e,emitEvent(event));}}module[_0xfd89('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
index 1bcd84b..18360d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffd5=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x2a1f92,_0x4800bf){var _0x4e4962=function(_0x27e672){while(--_0x27e672){_0x2a1f92['push'](_0x2a1f92['shift']());}};_0x4e4962(++_0x4800bf);}(_0xffd5,0xd8));var _0x5ffd=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0xffd5[_0x484c03];return _0x294127;};'use strict';var _=require(_0x5ffd('0x0'));var util=require(_0x5ffd('0x1'));var logger=require(_0x5ffd('0x2'))(_0x5ffd('0x3'));var moment=require(_0x5ffd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ffd('0x5'));var rimraf=require(_0x5ffd('0x6'));var config=require(_0x5ffd('0x7'));var attributes=require(_0x5ffd('0x8'));module[_0x5ffd('0x9')]=function(_0x21cfbd,_0x4ea06c){return _0x21cfbd[_0x5ffd('0xa')](_0x5ffd('0xb'),attributes,{'tableName':_0x5ffd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5ffd('0xd'),'collate':_0x5ffd('0xe')});};
\ No newline at end of file
+var _0x4f94=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2d1ca8,_0x4fec84){var _0x281dab=function(_0x34a5c9){while(--_0x34a5c9){_0x2d1ca8['push'](_0x2d1ca8['shift']());}};_0x281dab(++_0x4fec84);}(_0x4f94,0xb4));var _0x44f9=function(_0x13a976,_0x4fdf68){_0x13a976=_0x13a976-0x0;var _0x203b86=_0x4f94[_0x13a976];return _0x203b86;};'use strict';var _=require(_0x44f9('0x0'));var util=require(_0x44f9('0x1'));var logger=require(_0x44f9('0x2'))(_0x44f9('0x3'));var moment=require('moment');var BPromise=require(_0x44f9('0x4'));var rp=require(_0x44f9('0x5'));var fs=require('fs');var path=require(_0x44f9('0x6'));var rimraf=require(_0x44f9('0x7'));var config=require('../../config/environment');var attributes=require(_0x44f9('0x8'));module[_0x44f9('0x9')]=function(_0x292cae,_0x2d2c5e){return _0x292cae[_0x44f9('0xa')](_0x44f9('0xb'),attributes,{'tableName':_0x44f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x44f9('0xd'),'collate':_0x44f9('0xe')});};
\ No newline at end of file
index 9a94525..6a0e299 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x618f=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3c6d35,_0x40d855){var _0x16510e=function(_0x347d16){while(--_0x347d16){_0x3c6d35['push'](_0x3c6d35['shift']());}};_0x16510e(++_0x40d855);}(_0x618f,0x1b9));var _0xf618=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x618f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf618('0x0'));var moment=require(_0xf618('0x1'));var BPromise=require(_0xf618('0x2'));var rs=require(_0xf618('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf618('0x4'))['db'];var utils=require(_0xf618('0x5'));var logger=require(_0xf618('0x6'))(_0xf618('0x7'));var config=require('../../config/environment');var jayson=require(_0xf618('0x8'));var client=jayson[_0xf618('0x9')][_0xf618('0xa')]({'port':0x232a});config[_0xf618('0xb')]=_[_0xf618('0xc')](config['redis'],{'host':_0xf618('0xd'),'port':0x18eb});var socket=require(_0xf618('0xe'))(new Redis(config[_0xf618('0xb')]));require(_0xf618('0xf'))[_0xf618('0x10')](socket);function respondWithRpcPromise(_0x29c3cb,_0x45b37b,_0x4d9d66){return new BPromise(function(_0x155948,_0x29ae7f){return client[_0xf618('0x11')](_0x29c3cb,_0x4d9d66)[_0xf618('0x12')](function(_0x1ee5e5){logger[_0xf618('0x13')](_0xf618('0x14'),_0x45b37b,_0xf618('0x15'));logger[_0xf618('0x16')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x45b37b,'request\x20sent',JSON[_0xf618('0x17')](_0x1ee5e5));if(_0x1ee5e5[_0xf618('0x18')]){if(_0x1ee5e5[_0xf618('0x18')][_0xf618('0x19')]===0x1f4){logger[_0xf618('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x45b37b,_0x1ee5e5[_0xf618('0x18')]['message']);return _0x29ae7f(_0x1ee5e5[_0xf618('0x18')]['message']);}logger[_0xf618('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x45b37b,_0x1ee5e5[_0xf618('0x18')][_0xf618('0x1a')]);return _0x155948(_0x1ee5e5[_0xf618('0x18')][_0xf618('0x1a')]);}else{logger['info'](_0xf618('0x14'),_0x45b37b,_0xf618('0x15'));_0x155948(_0x1ee5e5[_0xf618('0x1b')]['message']);}})[_0xf618('0x1c')](function(_0x356918){logger[_0xf618('0x18')](_0xf618('0x14'),_0x45b37b,_0x356918);_0x29ae7f(_0x356918);});});}
\ No newline at end of file
+var _0x9217=['randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x9217,0x127));var _0x7921=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9217[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7921('0x0'));var moment=require('moment');var BPromise=require(_0x7921('0x1'));var rs=require(_0x7921('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7921('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7921('0x4'));var config=require(_0x7921('0x5'));var jayson=require(_0x7921('0x6'));var client=jayson[_0x7921('0x7')][_0x7921('0x8')]({'port':0x232a});config[_0x7921('0x9')]=_[_0x7921('0xa')](config['redis'],{'host':_0x7921('0xb'),'port':0x18eb});var socket=require(_0x7921('0xc'))(new Redis(config[_0x7921('0x9')]));require('./chatInternalMessage.socket')[_0x7921('0xd')](socket);function respondWithRpcPromise(_0x2bcedd,_0x102c8a,_0x4d0921){return new BPromise(function(_0x3c230a,_0x200709){return client[_0x7921('0xe')](_0x2bcedd,_0x4d0921)[_0x7921('0xf')](function(_0x54deb8){logger[_0x7921('0x10')](_0x7921('0x11'),_0x102c8a,_0x7921('0x12'));logger[_0x7921('0x13')](_0x7921('0x14'),_0x102c8a,_0x7921('0x12'),JSON[_0x7921('0x15')](_0x54deb8));if(_0x54deb8[_0x7921('0x16')]){if(_0x54deb8['error'][_0x7921('0x17')]===0x1f4){logger[_0x7921('0x16')](_0x7921('0x11'),_0x102c8a,_0x54deb8[_0x7921('0x16')][_0x7921('0x18')]);return _0x200709(_0x54deb8['error']['message']);}logger[_0x7921('0x16')](_0x7921('0x11'),_0x102c8a,_0x54deb8[_0x7921('0x16')]['message']);return _0x3c230a(_0x54deb8[_0x7921('0x16')]['message']);}else{logger[_0x7921('0x10')](_0x7921('0x11'),_0x102c8a,_0x7921('0x12'));_0x3c230a(_0x54deb8[_0x7921('0x19')][_0x7921('0x18')]);}})[_0x7921('0x1a')](function(_0x44db78){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x102c8a,_0x44db78);_0x200709(_0x44db78);});});}
\ No newline at end of file
index 67e51f0..7082b96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3379=['remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x3379,0x115));var _0x9337=function(_0x63257c,_0x5df8d0){_0x63257c=_0x63257c-0x0;var _0x47cc3e=_0x3379[_0x63257c];return _0x47cc3e;};'use strict';var ChatInternalMessageEvents=require(_0x9337('0x0'));var events=[_0x9337('0x1'),_0x9337('0x2'),_0x9337('0x3')];function createListener(_0x5a6194,_0x369104){return function(_0x39545){_0x369104[_0x9337('0x4')](_0x5a6194,_0x39545);};}function removeListener(_0x30dcfe,_0x49ce9a){return function(){ChatInternalMessageEvents[_0x9337('0x5')](_0x30dcfe,_0x49ce9a);};}exports[_0x9337('0x6')]=function(_0x390772){for(var _0x677c38=0x0,_0x5a59ab=events[_0x9337('0x7')];_0x677c38<_0x5a59ab;_0x677c38++){var _0x5b1986=events[_0x677c38];var _0x268943=createListener(_0x9337('0x8')+_0x5b1986,_0x390772);ChatInternalMessageEvents['on'](_0x5b1986,_0x268943);}};
\ No newline at end of file
+var _0x5640=['./chatInternalMessage.events','remove','update','emit','removeListener','register','chatInternalMessage:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5640,0x111));var _0x0564=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5640[_0x59ee6f];return _0x4c0979;};'use strict';var ChatInternalMessageEvents=require(_0x0564('0x0'));var events=['save',_0x0564('0x1'),_0x0564('0x2')];function createListener(_0x8ebafe,_0xa50680){return function(_0xc558b4){_0xa50680[_0x0564('0x3')](_0x8ebafe,_0xc558b4);};}function removeListener(_0x1cbb9d,_0x1c229d){return function(){ChatInternalMessageEvents[_0x0564('0x4')](_0x1cbb9d,_0x1c229d);};}exports[_0x0564('0x5')]=function(_0x23566f){for(var _0x1260bf=0x0,_0x3deac1=events['length'];_0x1260bf<_0x3deac1;_0x1260bf++){var _0x52b032=events[_0x1260bf];var _0x9e3a60=createListener(_0x0564('0x6')+_0x52b032,_0x23566f);ChatInternalMessageEvents['on'](_0x52b032,_0x9e3a60);}};
\ No newline at end of file
index ccf65c2..88d413a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x1a0f5f,_0x3950d4){var _0x3ac228=function(_0x240389){while(--_0x240389){_0x1a0f5f['push'](_0x1a0f5f['shift']());}};_0x3ac228(++_0x3950d4);}(_0xe706,0xa3));var _0x6e70=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xe706[_0x266618];return _0x54dbf5;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x9')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x12')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['put']('/:id',controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);module[_0x6e70('0x17')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/users','getUsers','show','post','create','put','delete','/:id','destroy','exports','path','connect-timeout'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0xe')]('/',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',controller['update']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth['isAuthenticated'](),controller[_0x49c4('0x13')]);module[_0x49c4('0x14')]=router;
\ No newline at end of file
index cb23ab9..f834f64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5627=['medium','BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x30af4b,_0x34f893){var _0x575e4f=function(_0x2a87a3){while(--_0x2a87a3){_0x30af4b['push'](_0x30af4b['shift']());}};_0x575e4f(++_0x34f893);}(_0x5627,0xad));var _0x7562=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5627[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require('sequelize');module[_0x7562('0x0')]={'body':{'type':Sequelize[_0x7562('0x1')](_0x7562('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7562('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7562('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7562('0x4')]('in',_0x7562('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7562('0x6')]}};
\ No newline at end of file
+var _0xf8b2=['exports','medium','ENUM','out','DATE','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf8b2,0x143));var _0x2f8b=function(_0x5a2d95,_0xb362e5){_0x5a2d95=_0x5a2d95-0x0;var _0x2c3986=_0xf8b2[_0x5a2d95];return _0x2c3986;};'use strict';var Sequelize=require(_0x2f8b('0x0'));module[_0x2f8b('0x1')]={'body':{'type':Sequelize['TEXT'](_0x2f8b('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2f8b('0x3')]('in',_0x2f8b('0x4')),'defaultValue':_0x2f8b('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2f8b('0x5')]}};
\ No newline at end of file
index 7cedc85..1e69869 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae85=['agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','end','status','json','count','offset','Content-Range','apply','reject','update','sendStatus','stack','name','send','map','ChatMessage','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','params','find','catch','create','body','destroy','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','parse','formData'];(function(_0x11dcc9,_0x377efb){var _0x54f643=function(_0x3b5644){while(--_0x3b5644){_0x11dcc9['push'](_0x11dcc9['shift']());}};_0x54f643(++_0x377efb);}(_0xae85,0x17b));var _0x5ae8=function(_0x489608,_0x4f157f){_0x489608=_0x489608-0x0;var _0x25632c=_0xae85[_0x489608];return _0x25632c;};'use strict';var pdf=require(_0x5ae8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5ae8('0x1'));var zipdir=require(_0x5ae8('0x2'));var jsonpatch=require(_0x5ae8('0x3'));var rp=require(_0x5ae8('0x4'));var moment=require(_0x5ae8('0x5'));var BPromise=require(_0x5ae8('0x6'));var Mustache=require(_0x5ae8('0x7'));var util=require(_0x5ae8('0x8'));var path=require(_0x5ae8('0x9'));var sox=require(_0x5ae8('0xa'));var csv=require('to-csv');var ejs=require(_0x5ae8('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5ae8('0xc'));var crypto=require(_0x5ae8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5ae8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5ae8('0xf'));var Papa=require('papaparse');var Redis=require(_0x5ae8('0x10'));var authService=require(_0x5ae8('0x11'));var qs=require(_0x5ae8('0x12'));var as=require(_0x5ae8('0x13'));var hardwareService=require(_0x5ae8('0x14'));var logger=require(_0x5ae8('0x15'))('api');var utils=require(_0x5ae8('0x16'));var config=require(_0x5ae8('0x17'));var db=require('../../mysqldb')['db'];config[_0x5ae8('0x18')]=_[_0x5ae8('0x19')](config['redis'],{'host':_0x5ae8('0x1a'),'port':0x18eb});var socket=require(_0x5ae8('0x1b'))(new Redis(config[_0x5ae8('0x18')]));require(_0x5ae8('0x1c'))[_0x5ae8('0x1d')](socket);var jayson=require(_0x5ae8('0x1e'));var client=jayson['client'][_0x5ae8('0x1f')]({'port':0x232c});var client9002=jayson[_0x5ae8('0x20')][_0x5ae8('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x187b59,_0x283e44,_0x41382e){if(_0x41382e){var _0x37af66=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37af66[_0x5ae8('0x21')](_0x283e44)){return _0x187b59;}else{throw new db[(_0x5ae8('0x22'))][(_0x5ae8('0x23'))](_0x5ae8('0x24'));}}else{return _0x187b59;}}function respondWithRpcPromise(_0x2ebca1,_0x3540a1,_0x1d4f2c,_0x1326ec){return new BPromise(function(_0x924fa7,_0x2411c1){var _0x1328da=_0x1326ec||client;return _0x1328da[_0x5ae8('0x25')](_0x2ebca1,_0x1d4f2c)[_0x5ae8('0x26')](function(_0x1abf7f){logger[_0x5ae8('0x27')](_0x5ae8('0x28'),_0x3540a1,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3540a1,_0x5ae8('0x29'),JSON[_0x5ae8('0x2a')](_0x1abf7f));if(_0x1abf7f[_0x5ae8('0x2b')]){if(_0x1abf7f[_0x5ae8('0x2b')][_0x5ae8('0x2c')]===0x1f4){logger['error'](_0x5ae8('0x28'),_0x3540a1,_0x1abf7f['error'][_0x5ae8('0x2d')]);return _0x2411c1(_0x1abf7f[_0x5ae8('0x2b')][_0x5ae8('0x2d')]);}logger['error'](_0x5ae8('0x28'),_0x3540a1,_0x1abf7f['error'][_0x5ae8('0x2d')]);return _0x924fa7(_0x1abf7f['error'][_0x5ae8('0x2d')]);}else{logger[_0x5ae8('0x27')]('ChatMessage,\x20%s,\x20%s',_0x3540a1,_0x5ae8('0x29'));_0x924fa7(_0x1abf7f[_0x5ae8('0x2e')][_0x5ae8('0x2d')]);}})['catch'](function(_0x5e044b){logger['error'](_0x5ae8('0x28'),_0x3540a1,_0x5e044b);_0x2411c1(_0x5e044b);});});}function respondWithStatusCode(_0x2febaa,_0x56dafc){_0x56dafc=_0x56dafc||0xcc;return function(_0x28ddb1){if(_0x28ddb1){return _0x2febaa['sendStatus'](_0x56dafc);}return _0x2febaa['status'](_0x56dafc)[_0x5ae8('0x2f')]();};}function respondWithResult(_0x1fb87b,_0x3a52df){_0x3a52df=_0x3a52df||0xc8;return function(_0x51dd63){if(_0x51dd63){return _0x1fb87b[_0x5ae8('0x30')](_0x3a52df)[_0x5ae8('0x31')](_0x51dd63);}};}function respondWithFilteredResult(_0x4118ff,_0x3aa395){return function(_0x172651){if(_0x172651){var _0x4fc007=_0x172651[_0x5ae8('0x32')],_0x32894c=_0x3aa395[_0x5ae8('0x33')],_0x14a924=_0x3aa395[_0x5ae8('0x33')]+_0x3aa395['limit'],_0x4bade9;if(_0x14a924>=_0x4fc007){_0x14a924=_0x4fc007;_0x4bade9=0xc8;}else{_0x4bade9=0xce;}_0x4118ff[_0x5ae8('0x30')](_0x4bade9);return _0x4118ff['set'](_0x5ae8('0x34'),_0x32894c+'-'+_0x14a924+'/'+_0x4fc007)[_0x5ae8('0x31')](_0x172651);}return null;};}function patchUpdates(_0x9ff84c){return function(_0x58eeda){try{jsonpatch[_0x5ae8('0x35')](_0x58eeda,_0x9ff84c,!![]);}catch(_0x2e66fc){return BPromise[_0x5ae8('0x36')](_0x2e66fc);}return _0x58eeda['save']();};}function saveUpdates(_0x4fe14f,_0x2022a3){return function(_0x204d04){if(_0x204d04){return _0x204d04[_0x5ae8('0x37')](_0x4fe14f)['then'](function(_0x42c491){return _0x42c491;});}return null;};}function removeEntity(_0x16a31f,_0x7107b1){return function(_0x5e8d76){if(_0x5e8d76){return _0x5e8d76['destroy']()['then'](function(){_0x16a31f[_0x5ae8('0x30')](0xcc)[_0x5ae8('0x2f')]();});}};}function handleEntityNotFound(_0x2e6382,_0x918d77){return function(_0x5e95b4){if(!_0x5e95b4){_0x2e6382[_0x5ae8('0x38')](0x194);}return _0x5e95b4;};}function handleError(_0x1bad19,_0x387a86){_0x387a86=_0x387a86||0x1f4;return function(_0x15b05a){logger[_0x5ae8('0x2b')](_0x15b05a[_0x5ae8('0x39')]);if(_0x15b05a[_0x5ae8('0x3a')]){delete _0x15b05a[_0x5ae8('0x3a')];}_0x1bad19[_0x5ae8('0x30')](_0x387a86)[_0x5ae8('0x3b')](_0x15b05a);};}exports['index']=function(_0x42f3ba,_0x48a23b){var _0x3aaef5={},_0x36e14f={},_0x2ddba0={'count':0x0,'rows':[]};var _0x4d765e=_[_0x5ae8('0x3c')](db[_0x5ae8('0x3d')][_0x5ae8('0x3e')],function(_0x3a4b56){return{'name':_0x3a4b56[_0x5ae8('0x3f')],'type':_0x3a4b56['type'][_0x5ae8('0x40')]};});_0x36e14f[_0x5ae8('0x41')]=_[_0x5ae8('0x3c')](_0x4d765e,_0x5ae8('0x3a'));_0x36e14f[_0x5ae8('0x42')]=_[_0x5ae8('0x43')](_0x42f3ba['query']);_0x36e14f[_0x5ae8('0x44')]=_['intersection'](_0x36e14f['model'],_0x36e14f[_0x5ae8('0x42')]);_0x3aaef5[_0x5ae8('0x45')]=_[_0x5ae8('0x46')](_0x36e14f[_0x5ae8('0x41')],qs[_0x5ae8('0x47')](_0x42f3ba[_0x5ae8('0x42')][_0x5ae8('0x47')]));_0x3aaef5[_0x5ae8('0x45')]=_0x3aaef5[_0x5ae8('0x45')][_0x5ae8('0x48')]?_0x3aaef5[_0x5ae8('0x45')]:_0x36e14f['model'];if(!_0x42f3ba[_0x5ae8('0x42')]['hasOwnProperty'](_0x5ae8('0x49'))){_0x3aaef5[_0x5ae8('0x4a')]=qs[_0x5ae8('0x4a')](_0x42f3ba[_0x5ae8('0x42')][_0x5ae8('0x4a')]);_0x3aaef5[_0x5ae8('0x33')]=qs[_0x5ae8('0x33')](_0x42f3ba[_0x5ae8('0x42')][_0x5ae8('0x33')]);}_0x3aaef5[_0x5ae8('0x4b')]=qs[_0x5ae8('0x4c')](_0x42f3ba[_0x5ae8('0x42')][_0x5ae8('0x4c')]);_0x3aaef5[_0x5ae8('0x4d')]=qs[_0x5ae8('0x44')](_[_0x5ae8('0x4e')](_0x42f3ba[_0x5ae8('0x42')],_0x36e14f[_0x5ae8('0x44')]),_0x4d765e);if(_0x42f3ba[_0x5ae8('0x42')]['filter']){_0x3aaef5[_0x5ae8('0x4d')]=_[_0x5ae8('0x4f')](_0x3aaef5[_0x5ae8('0x4d')],{'$or':_['map'](_0x4d765e,function(_0x263df6){if(_0x263df6['type']!==_0x5ae8('0x50')){var _0x15d81e={};_0x15d81e[_0x263df6[_0x5ae8('0x3a')]]={'$like':'%'+_0x42f3ba[_0x5ae8('0x42')][_0x5ae8('0x51')]+'%'};return _0x15d81e;}})});}_0x3aaef5=_[_0x5ae8('0x4f')]({},_0x3aaef5,_0x42f3ba[_0x5ae8('0x52')]);var _0xb18c47={'where':_0x3aaef5[_0x5ae8('0x4d')]};return db['ChatMessage']['count'](_0xb18c47)[_0x5ae8('0x26')](function(_0x179db9){_0x2ddba0[_0x5ae8('0x32')]=_0x179db9;if(_0x42f3ba[_0x5ae8('0x42')][_0x5ae8('0x53')]){_0x3aaef5[_0x5ae8('0x54')]=[{'all':!![]}];}return db[_0x5ae8('0x3d')]['findAll'](_0x3aaef5);})[_0x5ae8('0x26')](function(_0x219d9a){_0x2ddba0[_0x5ae8('0x55')]=_0x219d9a;return _0x2ddba0;})[_0x5ae8('0x26')](respondWithFilteredResult(_0x48a23b,_0x3aaef5))['catch'](handleError(_0x48a23b,null));};exports['show']=function(_0x154b13,_0xcbbd2d){var _0x517466={'raw':!![],'where':{'id':_0x154b13[_0x5ae8('0x56')]['id']}},_0x379f45={};_0x379f45[_0x5ae8('0x41')]=_[_0x5ae8('0x43')](db[_0x5ae8('0x3d')][_0x5ae8('0x3e')]);_0x379f45[_0x5ae8('0x42')]=_['keys'](_0x154b13[_0x5ae8('0x42')]);_0x379f45['filters']=_[_0x5ae8('0x46')](_0x379f45[_0x5ae8('0x41')],_0x379f45[_0x5ae8('0x42')]);_0x517466[_0x5ae8('0x45')]=_[_0x5ae8('0x46')](_0x379f45[_0x5ae8('0x41')],qs[_0x5ae8('0x47')](_0x154b13[_0x5ae8('0x42')]['fields']));_0x517466[_0x5ae8('0x45')]=_0x517466['attributes'][_0x5ae8('0x48')]?_0x517466['attributes']:_0x379f45[_0x5ae8('0x41')];if(_0x154b13['query']['includeAll']){_0x517466['include']=[{'all':!![]}];}_0x517466=_[_0x5ae8('0x4f')]({},_0x517466,_0x154b13['options']);return db[_0x5ae8('0x3d')][_0x5ae8('0x57')](_0x517466)['then'](handleEntityNotFound(_0xcbbd2d,null))[_0x5ae8('0x26')](respondWithResult(_0xcbbd2d,null))[_0x5ae8('0x58')](handleError(_0xcbbd2d,null));};exports[_0x5ae8('0x59')]=function(_0x123f69,_0x1fc162){return db[_0x5ae8('0x3d')][_0x5ae8('0x59')](_0x123f69['body'],{})[_0x5ae8('0x26')](respondWithResult(_0x1fc162,0xc9))['catch'](handleError(_0x1fc162,null));};exports['update']=function(_0x5bbef3,_0x4974d3){if(_0x5bbef3['body']['id']){delete _0x5bbef3[_0x5ae8('0x5a')]['id'];}return db[_0x5ae8('0x3d')][_0x5ae8('0x57')]({'where':{'id':_0x5bbef3[_0x5ae8('0x56')]['id']}})[_0x5ae8('0x26')](handleEntityNotFound(_0x4974d3,null))[_0x5ae8('0x26')](saveUpdates(_0x5bbef3[_0x5ae8('0x5a')],null))[_0x5ae8('0x26')](respondWithResult(_0x4974d3,null))[_0x5ae8('0x58')](handleError(_0x4974d3,null));};exports[_0x5ae8('0x5b')]=function(_0x1bfa1c,_0x27a768){return db[_0x5ae8('0x3d')][_0x5ae8('0x57')]({'where':{'id':_0x1bfa1c[_0x5ae8('0x56')]['id']}})[_0x5ae8('0x26')](handleEntityNotFound(_0x27a768,null))['then'](removeEntity(_0x27a768,null))[_0x5ae8('0x58')](handleError(_0x27a768,null));};exports[_0x5ae8('0x5c')]=function(_0x39b55e,_0x11211a){return db[_0x5ae8('0x3d')][_0x5ae8('0x5c')]()[_0x5ae8('0x26')](respondWithResult(_0x11211a,null))['catch'](handleError(_0x11211a,null));};var interaction_log=require(_0x5ae8('0x15'))(_0x5ae8('0x5d'));exports[_0x5ae8('0x5e')]=function(_0x23c77c,_0x55b480,_0x5a48be){var _0x45e25b={'channel':_0x5ae8('0x5f')};if(_0x23c77c[_0x5ae8('0x5a')]['id']){delete _0x23c77c[_0x5ae8('0x5a')]['id'];}_0x23c77c[_0x5ae8('0x5a')][_0x5ae8('0x60')]=!![];_0x23c77c[_0x5ae8('0x5a')][_0x5ae8('0x61')]=moment()[_0x5ae8('0x62')](_0x5ae8('0x63'));_0x23c77c[_0x5ae8('0x5a')][_0x5ae8('0x64')]=_0x23c77c[_0x5ae8('0x5a')][_0x5ae8('0x64')]||_0x23c77c[_0x5ae8('0x65')]['id'];return db[_0x5ae8('0x3d')][_0x5ae8('0x57')]({'where':{'id':_0x23c77c[_0x5ae8('0x56')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x5ae8('0x66')}]})[_0x5ae8('0x26')](handleEntityNotFound(_0x55b480,null))[_0x5ae8('0x26')](saveUpdates(_0x23c77c[_0x5ae8('0x5a')],null))[_0x5ae8('0x26')](function(_0x68f439){if(_0x68f439){_0x45e25b[_0x5ae8('0x2d')]=_0x68f439[_0x5ae8('0x67')]({'plain':!![]});return db[_0x5ae8('0x68')][_0x5ae8('0x57')]({'where':{'id':_0x68f439[_0x5ae8('0x69')]}});}return null;})[_0x5ae8('0x26')](handleEntityNotFound(_0x55b480,null))['then'](function(_0x181728){if(_0x181728){return _0x181728[_0x5ae8('0x37')]({'UserId':_0x23c77c['body'][_0x5ae8('0x64')],'read1stAt':_[_0x5ae8('0x6a')](_0x181728[_0x5ae8('0x6b')])?moment()[_0x5ae8('0x62')](_0x5ae8('0x63')):undefined});}return null;})[_0x5ae8('0x26')](function(_0x103549){if(_0x103549){_0x45e25b[_0x5ae8('0x6c')]=_0x103549[_0x5ae8('0x67')]({'plain':!![]});interaction_log['info'](_0x5ae8('0x6d'),_0x23c77c[_0x5ae8('0x65')]['id'],_0x23c77c[_0x5ae8('0x65')][_0x5ae8('0x3a')],_0x23c77c[_0x5ae8('0x65')][_0x5ae8('0x6e')],_0x45e25b[_0x5ae8('0x6c')]['id'],_0x23c77c[_0x5ae8('0x5a')]?JSON[_0x5ae8('0x2a')](_0x23c77c['body']):_0x5ae8('0x6f'));return respondWithRpcPromise(_0x5ae8('0x70'),'acceptMessage',_0x45e25b);}return null;})['then'](function(_0xd36ce0){if(_0xd36ce0){if(_0x23c77c['body'][_0x5ae8('0x71')]){_0x45e25b[_0x5ae8('0x2d')][_0x5ae8('0x72')]=util[_0x5ae8('0x62')](_0x5ae8('0x73'),_0x23c77c[_0x5ae8('0x65')]['name']);_0x45e25b[_0x5ae8('0x2d')][_0x5ae8('0x74')]=_0x45e25b[_0x5ae8('0x74')];_0x45e25b[_0x5ae8('0x2d')][_0x5ae8('0x75')]=_0x5ae8('0x5e');return respondWithRpcPromise(_0x5ae8('0x76'),_0x5ae8('0x76'),{'event':'acceptmessage','message':_[_0x5ae8('0x4f')](_0x45e25b[_0x5ae8('0x2d')],JSON[_0x5ae8('0x77')](_0x45e25b[_0x5ae8('0x6c')][_0x5ae8('0x78')]))},client9002)[_0x5ae8('0x26')](function(){return _0x45e25b;});}return _0x45e25b;}return null;})['then'](respondWithResult(_0x55b480,null))['catch'](handleError(_0x55b480,null));};var interaction_log=require('../../config/logger')(_0x5ae8('0x5d'));exports[_0x5ae8('0x36')]=function(_0x2162f1,_0x4cd6c9,_0x39a693){var _0x4bd390={'agent':{},'channel':'chat'};if(_0x2162f1[_0x5ae8('0x5a')]['id']){delete _0x2162f1[_0x5ae8('0x5a')]['id'];}_0x2162f1['body']['UserId']=_0x2162f1[_0x5ae8('0x5a')][_0x5ae8('0x64')]||_0x2162f1[_0x5ae8('0x65')]['id'];_0x4bd390[_0x5ae8('0x79')]['id']=_0x2162f1[_0x5ae8('0x5a')]['UserId'];return db[_0x5ae8('0x3d')][_0x5ae8('0x57')]({'where':{'id':_0x2162f1[_0x5ae8('0x56')]['id'],'UserId':null}})[_0x5ae8('0x26')](handleEntityNotFound(_0x4cd6c9,null))[_0x5ae8('0x26')](function(_0x20427d){if(_0x20427d){_0x4bd390[_0x5ae8('0x2d')]=_0x20427d[_0x5ae8('0x67')]({'plain':!![]});return db[_0x5ae8('0x68')][_0x5ae8('0x57')]({'where':{'id':_0x20427d['ChatInteractionId']}});}return null;})[_0x5ae8('0x26')](handleEntityNotFound(_0x4cd6c9,null))['then'](function(_0x2fb7f1){if(_0x2fb7f1){_0x4bd390['interaction']=_0x2fb7f1['get']({'plain':!![]});interaction_log[_0x5ae8('0x27')](_0x5ae8('0x7a'),_0x2162f1['user']['id'],_0x2162f1['user'][_0x5ae8('0x3a')],_0x2162f1[_0x5ae8('0x65')][_0x5ae8('0x6e')],_0x4bd390['interaction']['id'],_0x2162f1[_0x5ae8('0x5a')]?JSON[_0x5ae8('0x2a')](_0x2162f1[_0x5ae8('0x5a')]):_0x5ae8('0x6f'));return respondWithRpcPromise('RejectMessage',_0x5ae8('0x7b'),_0x4bd390);}return null;})[_0x5ae8('0x26')](function(_0x36d324){if(_0x36d324){_0x36d324[_0x5ae8('0x2d')][_0x5ae8('0x72')]=util[_0x5ae8('0x62')](_0x5ae8('0x73'),_0x2162f1['user'][_0x5ae8('0x3a')]);_0x36d324[_0x5ae8('0x2d')]['channel']=_0x4bd390[_0x5ae8('0x74')];_0x36d324[_0x5ae8('0x2d')][_0x5ae8('0x75')]=_0x5ae8('0x36');respondWithRpcPromise(_0x5ae8('0x76'),_0x5ae8('0x76'),{'event':_0x5ae8('0x7c'),'message':_0x36d324[_0x5ae8('0x2d')]},client9002);return _0x4bd390;}return null;})['then'](respondWithResult(_0x4cd6c9,null))['catch'](handleError(_0x4cd6c9,null));};
\ No newline at end of file
+var _0xa1ec=['defaults','localhost','./chatMessage.socket','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','ChatMessage','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','create','body','describe','chat','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteractionId','isNil','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','parse','formData','chat-interactions','agent','ChatInteraction','role','null','RejectMessage','rejectMessage','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','redis'];(function(_0x3a4f1d,_0x57cccd){var _0x580f0e=function(_0x380dea){while(--_0x380dea){_0x3a4f1d['push'](_0x3a4f1d['shift']());}};_0x580f0e(++_0x57cccd);}(_0xa1ec,0xdc));var _0xca1e=function(_0x2281a5,_0x2e5c6f){_0x2281a5=_0x2281a5-0x0;var _0x3d934d=_0xa1ec[_0x2281a5];return _0x3d934d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xca1e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca1e('0x1'));var jsonpatch=require(_0xca1e('0x2'));var rp=require(_0xca1e('0x3'));var moment=require(_0xca1e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xca1e('0x5'));var sox=require(_0xca1e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xca1e('0x7'));var squel=require(_0xca1e('0x8'));var crypto=require(_0xca1e('0x9'));var jsforce=require(_0xca1e('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xca1e('0xb'));var Papa=require(_0xca1e('0xc'));var Redis=require(_0xca1e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xca1e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca1e('0xf'));var logger=require('../../config/logger')(_0xca1e('0x10'));var utils=require(_0xca1e('0x11'));var config=require(_0xca1e('0x12'));var db=require('../../mysqldb')['db'];config[_0xca1e('0x13')]=_[_0xca1e('0x14')](config[_0xca1e('0x13')],{'host':_0xca1e('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xca1e('0x16'))['register'](socket);var jayson=require(_0xca1e('0x17'));var client=jayson[_0xca1e('0x18')][_0xca1e('0x19')]({'port':0x232c});var client9002=jayson[_0xca1e('0x18')][_0xca1e('0x19')]({'port':0x232a});function checkPasswordPattern(_0xa373c6,_0x4411c2,_0x2c5e6c){if(_0x2c5e6c){var _0x57616b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x57616b[_0xca1e('0x1a')](_0x4411c2)){return _0xa373c6;}else{throw new db[(_0xca1e('0x1b'))]['ValidationError'](_0xca1e('0x1c'));}}else{return _0xa373c6;}}function respondWithRpcPromise(_0x3afdc1,_0x41e02c,_0x139c6d,_0x236033){return new BPromise(function(_0x44d4af,_0x49705b){var _0x319706=_0x236033||client;return _0x319706[_0xca1e('0x1d')](_0x3afdc1,_0x139c6d)[_0xca1e('0x1e')](function(_0x305285){logger['info'](_0xca1e('0x1f'),_0x41e02c,'request\x20sent');logger['debug'](_0xca1e('0x20'),_0x41e02c,_0xca1e('0x21'),JSON[_0xca1e('0x22')](_0x305285));if(_0x305285[_0xca1e('0x23')]){if(_0x305285[_0xca1e('0x23')][_0xca1e('0x24')]===0x1f4){logger[_0xca1e('0x23')](_0xca1e('0x1f'),_0x41e02c,_0x305285['error'][_0xca1e('0x25')]);return _0x49705b(_0x305285[_0xca1e('0x23')]['message']);}logger[_0xca1e('0x23')](_0xca1e('0x1f'),_0x41e02c,_0x305285[_0xca1e('0x23')][_0xca1e('0x25')]);return _0x44d4af(_0x305285[_0xca1e('0x23')][_0xca1e('0x25')]);}else{logger[_0xca1e('0x26')](_0xca1e('0x1f'),_0x41e02c,_0xca1e('0x21'));_0x44d4af(_0x305285[_0xca1e('0x27')][_0xca1e('0x25')]);}})[_0xca1e('0x28')](function(_0x84717f){logger[_0xca1e('0x23')](_0xca1e('0x1f'),_0x41e02c,_0x84717f);_0x49705b(_0x84717f);});});}function respondWithStatusCode(_0x23fc37,_0x2bfdbf){_0x2bfdbf=_0x2bfdbf||0xcc;return function(_0x30440a){if(_0x30440a){return _0x23fc37[_0xca1e('0x29')](_0x2bfdbf);}return _0x23fc37[_0xca1e('0x2a')](_0x2bfdbf)['end']();};}function respondWithResult(_0x32b826,_0x1dadb1){_0x1dadb1=_0x1dadb1||0xc8;return function(_0x321b85){if(_0x321b85){return _0x32b826[_0xca1e('0x2a')](_0x1dadb1)[_0xca1e('0x2b')](_0x321b85);}};}function respondWithFilteredResult(_0x13a316,_0x45bfe5){return function(_0x3268fd){if(_0x3268fd){var _0xb9d1db=_0x3268fd['count'],_0x4418ce=_0x45bfe5[_0xca1e('0x2c')],_0x476661=_0x45bfe5[_0xca1e('0x2c')]+_0x45bfe5[_0xca1e('0x2d')],_0x31ae1f;if(_0x476661>=_0xb9d1db){_0x476661=_0xb9d1db;_0x31ae1f=0xc8;}else{_0x31ae1f=0xce;}_0x13a316[_0xca1e('0x2a')](_0x31ae1f);return _0x13a316['set'](_0xca1e('0x2e'),_0x4418ce+'-'+_0x476661+'/'+_0xb9d1db)[_0xca1e('0x2b')](_0x3268fd);}return null;};}function patchUpdates(_0x30a529){return function(_0x13bac4){try{jsonpatch[_0xca1e('0x2f')](_0x13bac4,_0x30a529,!![]);}catch(_0x4aa537){return BPromise[_0xca1e('0x30')](_0x4aa537);}return _0x13bac4[_0xca1e('0x31')]();};}function saveUpdates(_0x23cefd,_0x5efd73){return function(_0x1dc50b){if(_0x1dc50b){return _0x1dc50b[_0xca1e('0x32')](_0x23cefd)[_0xca1e('0x1e')](function(_0x4b8011){return _0x4b8011;});}return null;};}function removeEntity(_0x127a5a,_0x1da49d){return function(_0x5775a7){if(_0x5775a7){return _0x5775a7[_0xca1e('0x33')]()[_0xca1e('0x1e')](function(){_0x127a5a[_0xca1e('0x2a')](0xcc)[_0xca1e('0x34')]();});}};}function handleEntityNotFound(_0x31839a,_0x1c057a){return function(_0x31c962){if(!_0x31c962){_0x31839a[_0xca1e('0x29')](0x194);}return _0x31c962;};}function handleError(_0x45dc77,_0x937c58){_0x937c58=_0x937c58||0x1f4;return function(_0x253860){logger[_0xca1e('0x23')](_0x253860[_0xca1e('0x35')]);if(_0x253860[_0xca1e('0x36')]){delete _0x253860[_0xca1e('0x36')];}_0x45dc77[_0xca1e('0x2a')](_0x937c58)['send'](_0x253860);};}exports[_0xca1e('0x37')]=function(_0x5d7034,_0x14c9e4){var _0x4280b0={},_0x3e8d65={},_0xa4ef54={'count':0x0,'rows':[]};var _0x1e26f6=_[_0xca1e('0x38')](db[_0xca1e('0x39')]['rawAttributes'],function(_0x375969){return{'name':_0x375969[_0xca1e('0x3a')],'type':_0x375969[_0xca1e('0x3b')][_0xca1e('0x3c')]};});_0x3e8d65[_0xca1e('0x3d')]=_[_0xca1e('0x38')](_0x1e26f6,_0xca1e('0x36'));_0x3e8d65['query']=_[_0xca1e('0x3e')](_0x5d7034[_0xca1e('0x3f')]);_0x3e8d65[_0xca1e('0x40')]=_[_0xca1e('0x41')](_0x3e8d65['model'],_0x3e8d65[_0xca1e('0x3f')]);_0x4280b0['attributes']=_[_0xca1e('0x41')](_0x3e8d65[_0xca1e('0x3d')],qs[_0xca1e('0x42')](_0x5d7034['query'][_0xca1e('0x42')]));_0x4280b0[_0xca1e('0x43')]=_0x4280b0[_0xca1e('0x43')]['length']?_0x4280b0[_0xca1e('0x43')]:_0x3e8d65[_0xca1e('0x3d')];if(!_0x5d7034[_0xca1e('0x3f')]['hasOwnProperty'](_0xca1e('0x44'))){_0x4280b0[_0xca1e('0x2d')]=qs[_0xca1e('0x2d')](_0x5d7034[_0xca1e('0x3f')]['limit']);_0x4280b0[_0xca1e('0x2c')]=qs[_0xca1e('0x2c')](_0x5d7034[_0xca1e('0x3f')][_0xca1e('0x2c')]);}_0x4280b0['order']=qs[_0xca1e('0x45')](_0x5d7034[_0xca1e('0x3f')]['sort']);_0x4280b0[_0xca1e('0x46')]=qs[_0xca1e('0x40')](_[_0xca1e('0x47')](_0x5d7034[_0xca1e('0x3f')],_0x3e8d65[_0xca1e('0x40')]),_0x1e26f6);if(_0x5d7034[_0xca1e('0x3f')][_0xca1e('0x48')]){_0x4280b0['where']=_[_0xca1e('0x49')](_0x4280b0[_0xca1e('0x46')],{'$or':_[_0xca1e('0x38')](_0x1e26f6,function(_0x155033){if(_0x155033[_0xca1e('0x3b')]!==_0xca1e('0x4a')){var _0x4a60a8={};_0x4a60a8[_0x155033['name']]={'$like':'%'+_0x5d7034[_0xca1e('0x3f')][_0xca1e('0x48')]+'%'};return _0x4a60a8;}})});}_0x4280b0=_[_0xca1e('0x49')]({},_0x4280b0,_0x5d7034['options']);var _0x42f005={'where':_0x4280b0['where']};return db[_0xca1e('0x39')][_0xca1e('0x4b')](_0x42f005)[_0xca1e('0x1e')](function(_0x1f6d52){_0xa4ef54['count']=_0x1f6d52;if(_0x5d7034[_0xca1e('0x3f')][_0xca1e('0x4c')]){_0x4280b0[_0xca1e('0x4d')]=[{'all':!![]}];}return db['ChatMessage'][_0xca1e('0x4e')](_0x4280b0);})[_0xca1e('0x1e')](function(_0x552cd1){_0xa4ef54[_0xca1e('0x4f')]=_0x552cd1;return _0xa4ef54;})[_0xca1e('0x1e')](respondWithFilteredResult(_0x14c9e4,_0x4280b0))['catch'](handleError(_0x14c9e4,null));};exports[_0xca1e('0x50')]=function(_0x190696,_0x223051){var _0x39cda6={'raw':!![],'where':{'id':_0x190696[_0xca1e('0x51')]['id']}},_0x1e9723={};_0x1e9723[_0xca1e('0x3d')]=_[_0xca1e('0x3e')](db[_0xca1e('0x39')][_0xca1e('0x52')]);_0x1e9723['query']=_[_0xca1e('0x3e')](_0x190696[_0xca1e('0x3f')]);_0x1e9723['filters']=_[_0xca1e('0x41')](_0x1e9723['model'],_0x1e9723[_0xca1e('0x3f')]);_0x39cda6[_0xca1e('0x43')]=_[_0xca1e('0x41')](_0x1e9723[_0xca1e('0x3d')],qs['fields'](_0x190696[_0xca1e('0x3f')][_0xca1e('0x42')]));_0x39cda6['attributes']=_0x39cda6[_0xca1e('0x43')][_0xca1e('0x53')]?_0x39cda6[_0xca1e('0x43')]:_0x1e9723[_0xca1e('0x3d')];if(_0x190696[_0xca1e('0x3f')][_0xca1e('0x4c')]){_0x39cda6[_0xca1e('0x4d')]=[{'all':!![]}];}_0x39cda6=_[_0xca1e('0x49')]({},_0x39cda6,_0x190696['options']);return db[_0xca1e('0x39')][_0xca1e('0x54')](_0x39cda6)['then'](handleEntityNotFound(_0x223051,null))['then'](respondWithResult(_0x223051,null))['catch'](handleError(_0x223051,null));};exports[_0xca1e('0x55')]=function(_0x24cb97,_0x215b53){return db['ChatMessage'][_0xca1e('0x55')](_0x24cb97[_0xca1e('0x56')],{})[_0xca1e('0x1e')](respondWithResult(_0x215b53,0xc9))['catch'](handleError(_0x215b53,null));};exports[_0xca1e('0x32')]=function(_0x256626,_0x3d5fd4){if(_0x256626[_0xca1e('0x56')]['id']){delete _0x256626['body']['id'];}return db[_0xca1e('0x39')][_0xca1e('0x54')]({'where':{'id':_0x256626[_0xca1e('0x51')]['id']}})[_0xca1e('0x1e')](handleEntityNotFound(_0x3d5fd4,null))[_0xca1e('0x1e')](saveUpdates(_0x256626[_0xca1e('0x56')],null))[_0xca1e('0x1e')](respondWithResult(_0x3d5fd4,null))[_0xca1e('0x28')](handleError(_0x3d5fd4,null));};exports[_0xca1e('0x33')]=function(_0x397991,_0x31f97c){return db[_0xca1e('0x39')][_0xca1e('0x54')]({'where':{'id':_0x397991[_0xca1e('0x51')]['id']}})[_0xca1e('0x1e')](handleEntityNotFound(_0x31f97c,null))[_0xca1e('0x1e')](removeEntity(_0x31f97c,null))[_0xca1e('0x28')](handleError(_0x31f97c,null));};exports['describe']=function(_0x1ea8a6,_0x2951fd){return db[_0xca1e('0x39')][_0xca1e('0x57')]()[_0xca1e('0x1e')](respondWithResult(_0x2951fd,null))[_0xca1e('0x28')](handleError(_0x2951fd,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x39ceb2,_0x391cd8,_0x5336f4){var _0x86a53d={'channel':_0xca1e('0x58')};if(_0x39ceb2['body']['id']){delete _0x39ceb2['body']['id'];}_0x39ceb2[_0xca1e('0x56')][_0xca1e('0x59')]=!![];_0x39ceb2[_0xca1e('0x56')]['readAt']=moment()['format'](_0xca1e('0x5a'));_0x39ceb2[_0xca1e('0x56')][_0xca1e('0x5b')]=_0x39ceb2[_0xca1e('0x56')][_0xca1e('0x5b')]||_0x39ceb2[_0xca1e('0x5c')]['id'];return db['ChatMessage']['find']({'where':{'id':_0x39ceb2[_0xca1e('0x51')]['id'],'UserId':null},'include':[{'model':db[_0xca1e('0x5d')],'as':_0xca1e('0x5e')}]})['then'](handleEntityNotFound(_0x391cd8,null))[_0xca1e('0x1e')](saveUpdates(_0x39ceb2[_0xca1e('0x56')],null))['then'](function(_0x1e5e25){if(_0x1e5e25){_0x86a53d[_0xca1e('0x25')]=_0x1e5e25[_0xca1e('0x5f')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x1e5e25[_0xca1e('0x60')]}});}return null;})[_0xca1e('0x1e')](handleEntityNotFound(_0x391cd8,null))['then'](function(_0x20c87c){if(_0x20c87c){return _0x20c87c[_0xca1e('0x32')]({'UserId':_0x39ceb2['body'][_0xca1e('0x5b')],'read1stAt':_[_0xca1e('0x61')](_0x20c87c['read1stAt'])?moment()[_0xca1e('0x62')](_0xca1e('0x5a')):undefined});}return null;})[_0xca1e('0x1e')](function(_0x488b2a){if(_0x488b2a){_0x86a53d[_0xca1e('0x63')]=_0x488b2a[_0xca1e('0x5f')]({'plain':!![]});interaction_log[_0xca1e('0x26')](_0xca1e('0x64'),_0x39ceb2[_0xca1e('0x5c')]['id'],_0x39ceb2['user'][_0xca1e('0x36')],_0x39ceb2[_0xca1e('0x5c')]['role'],_0x86a53d[_0xca1e('0x63')]['id'],_0x39ceb2[_0xca1e('0x56')]?JSON[_0xca1e('0x22')](_0x39ceb2[_0xca1e('0x56')]):'null');return respondWithRpcPromise(_0xca1e('0x65'),_0xca1e('0x66'),_0x86a53d);}return null;})[_0xca1e('0x1e')](function(_0x1e000b){if(_0x1e000b){if(_0x39ceb2[_0xca1e('0x56')]['manual']){_0x86a53d['message'][_0xca1e('0x67')]=util[_0xca1e('0x62')](_0xca1e('0x68'),_0x39ceb2[_0xca1e('0x5c')]['name']);_0x86a53d[_0xca1e('0x25')][_0xca1e('0x69')]=_0x86a53d[_0xca1e('0x69')];_0x86a53d[_0xca1e('0x25')][_0xca1e('0x6a')]=_0xca1e('0x6b');return respondWithRpcPromise(_0xca1e('0x6c'),'EventManager',{'event':_0xca1e('0x6d'),'message':_[_0xca1e('0x49')](_0x86a53d[_0xca1e('0x25')],JSON[_0xca1e('0x6e')](_0x86a53d[_0xca1e('0x63')][_0xca1e('0x6f')]))},client9002)[_0xca1e('0x1e')](function(){return _0x86a53d;});}return _0x86a53d;}return null;})[_0xca1e('0x1e')](respondWithResult(_0x391cd8,null))[_0xca1e('0x28')](handleError(_0x391cd8,null));};var interaction_log=require('../../config/logger')(_0xca1e('0x70'));exports[_0xca1e('0x30')]=function(_0x160201,_0x203b5d,_0x23864a){var _0x3f1aa0={'agent':{},'channel':_0xca1e('0x58')};if(_0x160201['body']['id']){delete _0x160201['body']['id'];}_0x160201['body'][_0xca1e('0x5b')]=_0x160201['body'][_0xca1e('0x5b')]||_0x160201[_0xca1e('0x5c')]['id'];_0x3f1aa0[_0xca1e('0x71')]['id']=_0x160201[_0xca1e('0x56')][_0xca1e('0x5b')];return db[_0xca1e('0x39')]['find']({'where':{'id':_0x160201[_0xca1e('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x203b5d,null))[_0xca1e('0x1e')](function(_0x24563c){if(_0x24563c){_0x3f1aa0[_0xca1e('0x25')]=_0x24563c[_0xca1e('0x5f')]({'plain':!![]});return db[_0xca1e('0x72')]['find']({'where':{'id':_0x24563c['ChatInteractionId']}});}return null;})[_0xca1e('0x1e')](handleEntityNotFound(_0x203b5d,null))[_0xca1e('0x1e')](function(_0xafebb1){if(_0xafebb1){_0x3f1aa0[_0xca1e('0x63')]=_0xafebb1[_0xca1e('0x5f')]({'plain':!![]});interaction_log[_0xca1e('0x26')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x160201['user']['id'],_0x160201[_0xca1e('0x5c')][_0xca1e('0x36')],_0x160201['user'][_0xca1e('0x73')],_0x3f1aa0[_0xca1e('0x63')]['id'],_0x160201[_0xca1e('0x56')]?JSON[_0xca1e('0x22')](_0x160201[_0xca1e('0x56')]):_0xca1e('0x74'));return respondWithRpcPromise(_0xca1e('0x75'),_0xca1e('0x76'),_0x3f1aa0);}return null;})['then'](function(_0x292bde){if(_0x292bde){_0x292bde[_0xca1e('0x25')][_0xca1e('0x67')]=util[_0xca1e('0x62')](_0xca1e('0x68'),_0x160201[_0xca1e('0x5c')]['name']);_0x292bde[_0xca1e('0x25')]['channel']=_0x3f1aa0[_0xca1e('0x69')];_0x292bde[_0xca1e('0x25')][_0xca1e('0x6a')]=_0xca1e('0x30');respondWithRpcPromise(_0xca1e('0x6c'),_0xca1e('0x6c'),{'event':_0xca1e('0x77'),'message':_0x292bde[_0xca1e('0x25')]},client9002);return _0x3f1aa0;}return null;})[_0xca1e('0x1e')](respondWithResult(_0x203b5d,null))[_0xca1e('0x28')](handleError(_0x203b5d,null));};
\ No newline at end of file
index c061a16..71a3cb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7310=['hook','events','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0x7310,0x119));var _0x0731=function(_0x1e7732,_0x4f8002){_0x1e7732=_0x1e7732-0x0;var _0x36266c=_0x7310[_0x1e7732];return _0x36266c;};'use strict';var EventEmitter=require(_0x0731('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x0731('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0731('0x2')](0x0);var events={'afterCreate':_0x0731('0x3'),'afterUpdate':_0x0731('0x4'),'afterDestroy':_0x0731('0x5')};function emitEvent(_0x499208){return function(_0x3860d5,_0x21652b,_0x10bda0){ChatMessageEvents[_0x0731('0x6')](_0x499208+':'+_0x3860d5['id'],_0x3860d5);ChatMessageEvents[_0x0731('0x6')](_0x499208,_0x3860d5);_0x10bda0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x0731('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x04c0=['ChatMessage','setMaxListeners','save','update','remove','emit','../../mysqldb'];(function(_0x5912ad,_0x36ff2d){var _0x3430c6=function(_0x17b158){while(--_0x17b158){_0x5912ad['push'](_0x5912ad['shift']());}};_0x3430c6(++_0x36ff2d);}(_0x04c0,0x7d));var _0x004c=function(_0x15f00b,_0x518951){_0x15f00b=_0x15f00b-0x0;var _0x2c92c7=_0x04c0[_0x15f00b];return _0x2c92c7;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x004c('0x0'))['db'][_0x004c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x004c('0x2')](0x0);var events={'afterCreate':_0x004c('0x3'),'afterUpdate':_0x004c('0x4'),'afterDestroy':_0x004c('0x5')};function emitEvent(_0x61dc25){return function(_0x12b856,_0x33d067,_0x3234b7){ChatMessageEvents[_0x004c('0x6')](_0x61dc25+':'+_0x12b856['id'],_0x12b856);ChatMessageEvents[_0x004c('0x6')](_0x61dc25,_0x12b856);_0x3234b7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
index eee5972..7325157 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd85=['FULLTEXT','get','direction','toLowerCase','out','secret','isNil','findOne','ChatInteractionId','then','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','../../config/environment','exports','define','chat_messages','fti_chat_messages'];(function(_0x4b1d79,_0xcb5943){var _0x3f2b39=function(_0x2a4396){while(--_0x2a4396){_0x4b1d79['push'](_0x4b1d79['shift']());}};_0x3f2b39(++_0xcb5943);}(_0xfd85,0x16c));var _0x5fd8=function(_0x52282a,_0x45aef7){_0x52282a=_0x52282a-0x0;var _0x3c66b4=_0xfd85[_0x52282a];return _0x3c66b4;};'use strict';var _=require(_0x5fd8('0x0'));var util=require(_0x5fd8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5fd8('0x2'));var BPromise=require('bluebird');var rp=require(_0x5fd8('0x3'));var fs=require('fs');var path=require(_0x5fd8('0x4'));var rimraf=require(_0x5fd8('0x5'));var config=require(_0x5fd8('0x6'));var attributes=require('./chatMessage.attributes');module[_0x5fd8('0x7')]=function(_0x2d82e9,_0x38b22e){return _0x2d82e9[_0x5fd8('0x8')]('ChatMessage',attributes,{'tableName':_0x5fd8('0x9'),'paranoid':![],'indexes':[{'name':_0x5fd8('0xa'),'fields':['body'],'type':_0x5fd8('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42581d,_0x55c16e,_0x27bafb){var _0x4c532c=_0x2d82e9['models'];var _0x58d474=_0x42581d[_0x5fd8('0xc')]({'plain':!![]});if(_0x58d474[_0x5fd8('0xd')][_0x5fd8('0xe')]()==='in'||_0x58d474[_0x5fd8('0xd')][_0x5fd8('0xe')]()===_0x5fd8('0xf')&&!_0x58d474[_0x5fd8('0x10')]&&!_[_0x5fd8('0x11')](_0x58d474['UserId'])){_0x4c532c['ChatInteraction'][_0x5fd8('0x12')]({'where':{'id':_0x58d474[_0x5fd8('0x13')]}})[_0x5fd8('0x14')](function(_0x3e8b16){if(_0x3e8b16){_0x3e8b16['update']({'lastMsgAt':_0x58d474[_0x5fd8('0x15')],'lastMsgDirection':_0x58d474['direction'][_0x5fd8('0xe')]()});}})['catch'](function(_0x2ba09a){console[_0x5fd8('0x16')](_0x2ba09a);});}_0x27bafb();}},'charset':_0x5fd8('0x17'),'collate':_0x5fd8('0x18')});};
\ No newline at end of file
+var _0x0f3a=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5e515c,_0x3319a7){var _0x4f3109=function(_0xc823f5){while(--_0xc823f5){_0x5e515c['push'](_0x5e515c['shift']());}};_0x4f3109(++_0x3319a7);}(_0x0f3a,0x13e));var _0xa0f3=function(_0x258973,_0x501ee6){_0x258973=_0x258973-0x0;var _0x287688=_0x0f3a[_0x258973];return _0x287688;};'use strict';var _=require(_0xa0f3('0x0'));var util=require(_0xa0f3('0x1'));var logger=require(_0xa0f3('0x2'))('api');var moment=require(_0xa0f3('0x3'));var BPromise=require(_0xa0f3('0x4'));var rp=require(_0xa0f3('0x5'));var fs=require('fs');var path=require(_0xa0f3('0x6'));var rimraf=require(_0xa0f3('0x7'));var config=require(_0xa0f3('0x8'));var attributes=require(_0xa0f3('0x9'));module['exports']=function(_0x1ce510,_0x452116){return _0x1ce510[_0xa0f3('0xa')](_0xa0f3('0xb'),attributes,{'tableName':_0xa0f3('0xc'),'paranoid':![],'indexes':[{'name':_0xa0f3('0xd'),'fields':[_0xa0f3('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x382d60,_0x4372a8,_0x4c8be0){var _0x5deea5=_0x1ce510[_0xa0f3('0xf')];var _0x48635d=_0x382d60[_0xa0f3('0x10')]({'plain':!![]});if(_0x48635d[_0xa0f3('0x11')][_0xa0f3('0x12')]()==='in'||_0x48635d[_0xa0f3('0x11')][_0xa0f3('0x12')]()===_0xa0f3('0x13')&&!_0x48635d[_0xa0f3('0x14')]&&!_[_0xa0f3('0x15')](_0x48635d[_0xa0f3('0x16')])){_0x5deea5[_0xa0f3('0x17')]['findOne']({'where':{'id':_0x48635d['ChatInteractionId']}})['then'](function(_0x16abe6){if(_0x16abe6){_0x16abe6['update']({'lastMsgAt':_0x48635d[_0xa0f3('0x18')],'lastMsgDirection':_0x48635d[_0xa0f3('0x11')]['toLowerCase']()});}})[_0xa0f3('0x19')](function(_0x44b5b5){console[_0xa0f3('0x1a')](_0x44b5b5);});}_0x4c8be0();}},'charset':_0xa0f3('0x1b'),'collate':_0xa0f3('0x1c')});};
\ No newline at end of file
index c01766f..5b8c540 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81f1=['jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x81f1,0x129));var _0x181f=function(_0x5c63a4,_0x496024){_0x5c63a4=_0x5c63a4-0x0;var _0x557ae1=_0x81f1[_0x5c63a4];return _0x557ae1;};'use strict';var _=require(_0x181f('0x0'));var util=require(_0x181f('0x1'));var moment=require(_0x181f('0x2'));var BPromise=require(_0x181f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x181f('0x4'))['db'];var utils=require(_0x181f('0x5'));var logger=require(_0x181f('0x6'))(_0x181f('0x7'));var config=require(_0x181f('0x8'));var jayson=require(_0x181f('0x9'));var client=jayson[_0x181f('0xa')][_0x181f('0xb')]({'port':0x232a});config[_0x181f('0xc')]=_['defaults'](config[_0x181f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x181f('0xd'))(new Redis(config['redis']));require(_0x181f('0xe'))[_0x181f('0xf')](socket);function respondWithRpcPromise(_0x5e7462,_0xb7451,_0x23c983){return new BPromise(function(_0x138dab,_0x2b70aa){return client[_0x181f('0x10')](_0x5e7462,_0x23c983)[_0x181f('0x11')](function(_0x94bd12){logger[_0x181f('0x12')]('ChatMessage,\x20%s,\x20%s',_0xb7451,_0x181f('0x13'));logger['debug'](_0x181f('0x14'),_0xb7451,_0x181f('0x13'),JSON[_0x181f('0x15')](_0x94bd12));if(_0x94bd12[_0x181f('0x16')]){if(_0x94bd12[_0x181f('0x16')][_0x181f('0x17')]===0x1f4){logger[_0x181f('0x16')](_0x181f('0x18'),_0xb7451,_0x94bd12[_0x181f('0x16')][_0x181f('0x19')]);return _0x2b70aa(_0x94bd12['error']['message']);}logger[_0x181f('0x16')](_0x181f('0x18'),_0xb7451,_0x94bd12[_0x181f('0x16')][_0x181f('0x19')]);return _0x138dab(_0x94bd12['error'][_0x181f('0x19')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0xb7451,'request\x20sent');_0x138dab(_0x94bd12[_0x181f('0x1a')][_0x181f('0x19')]);}})[_0x181f('0x1b')](function(_0x47d686){logger[_0x181f('0x16')](_0x181f('0x18'),_0xb7451,_0x47d686);_0x2b70aa(_0x47d686);});});}exports[_0x181f('0x1c')]=function(_0x4cdca7){var _0x3dd6ff=this;return new Promise(function(_0x27e8ed,_0xdd604){return db[_0x181f('0x1d')][_0x181f('0x1e')](_0x4cdca7[_0x181f('0x1f')],{'raw':_0x4cdca7[_0x181f('0x20')]?_0x4cdca7['options'][_0x181f('0x21')]===undefined?!![]:![]:!![]})[_0x181f('0x11')](function(_0x5f1eb7){logger[_0x181f('0x12')](_0x181f('0x1c'),_0x4cdca7);logger['debug'](_0x181f('0x1c'),_0x4cdca7,JSON['stringify'](_0x5f1eb7));_0x27e8ed(_0x5f1eb7);})['catch'](function(_0x2e654b){logger[_0x181f('0x16')](_0x181f('0x1c'),_0x2e654b[_0x181f('0x19')],_0x4cdca7);_0xdd604(_0x3dd6ff['error'](0x1f4,_0x2e654b[_0x181f('0x19')]));});});};
\ No newline at end of file
+var _0xb18f=['../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','then','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xb18f,0xee));var _0xfb18=function(_0x49f3bf,_0x4f7e08){_0x49f3bf=_0x49f3bf-0x0;var _0x5bbca6=_0xb18f[_0x49f3bf];return _0x5bbca6;};'use strict';var _=require(_0xfb18('0x0'));var util=require(_0xfb18('0x1'));var moment=require(_0xfb18('0x2'));var BPromise=require(_0xfb18('0x3'));var rs=require(_0xfb18('0x4'));var fs=require('fs');var Redis=require(_0xfb18('0x5'));var db=require(_0xfb18('0x6'))['db'];var utils=require(_0xfb18('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xfb18('0x8'));var jayson=require(_0xfb18('0x9'));var client=jayson['client'][_0xfb18('0xa')]({'port':0x232a});config[_0xfb18('0xb')]=_[_0xfb18('0xc')](config[_0xfb18('0xb')],{'host':_0xfb18('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfb18('0xb')]));require(_0xfb18('0xe'))[_0xfb18('0xf')](socket);function respondWithRpcPromise(_0x4f1478,_0x552fb5,_0x403e4e){return new BPromise(function(_0xc68ea7,_0x524d2a){return client[_0xfb18('0x10')](_0x4f1478,_0x403e4e)['then'](function(_0x33963b){logger[_0xfb18('0x11')](_0xfb18('0x12'),_0x552fb5,_0xfb18('0x13'));logger['debug'](_0xfb18('0x14'),_0x552fb5,_0xfb18('0x13'),JSON[_0xfb18('0x15')](_0x33963b));if(_0x33963b['error']){if(_0x33963b[_0xfb18('0x16')][_0xfb18('0x17')]===0x1f4){logger[_0xfb18('0x16')](_0xfb18('0x12'),_0x552fb5,_0x33963b[_0xfb18('0x16')][_0xfb18('0x18')]);return _0x524d2a(_0x33963b[_0xfb18('0x16')][_0xfb18('0x18')]);}logger[_0xfb18('0x16')](_0xfb18('0x12'),_0x552fb5,_0x33963b[_0xfb18('0x16')]['message']);return _0xc68ea7(_0x33963b[_0xfb18('0x16')][_0xfb18('0x18')]);}else{logger[_0xfb18('0x11')](_0xfb18('0x12'),_0x552fb5,_0xfb18('0x13'));_0xc68ea7(_0x33963b[_0xfb18('0x19')][_0xfb18('0x18')]);}})['catch'](function(_0x31b87d){logger[_0xfb18('0x16')]('ChatMessage,\x20%s,\x20%s',_0x552fb5,_0x31b87d);_0x524d2a(_0x31b87d);});});}exports[_0xfb18('0x1a')]=function(_0x4ccc9f){var _0x19b001=this;return new Promise(function(_0x2c143d,_0x2d13b2){return db[_0xfb18('0x1b')][_0xfb18('0x1c')](_0x4ccc9f[_0xfb18('0x1d')],{'raw':_0x4ccc9f[_0xfb18('0x1e')]?_0x4ccc9f[_0xfb18('0x1e')][_0xfb18('0x1f')]===undefined?!![]:![]:!![]})[_0xfb18('0x20')](function(_0x4e74a2){logger['info']('CreateChatMessage',_0x4ccc9f);logger[_0xfb18('0x21')](_0xfb18('0x1a'),_0x4ccc9f,JSON[_0xfb18('0x15')](_0x4e74a2));_0x2c143d(_0x4e74a2);})[_0xfb18('0x22')](function(_0x4c947e){logger['error'](_0xfb18('0x1a'),_0x4c947e['message'],_0x4ccc9f);_0x2d13b2(_0x19b001[_0xfb18('0x16')](0x1f4,_0x4c947e[_0xfb18('0x18')]));});});};
\ No newline at end of file
index d855e2a..1e1ced6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x781d=['chatMessage:','./chatMessage.events','save','emit','removeListener','register','length'];(function(_0x454fb2,_0x3531af){var _0x521faa=function(_0xc0b7af){while(--_0xc0b7af){_0x454fb2['push'](_0x454fb2['shift']());}};_0x521faa(++_0x3531af);}(_0x781d,0x14a));var _0xd781=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x781d[_0x618414];return _0x21c19a;};'use strict';var ChatMessageEvents=require(_0xd781('0x0'));var events=[_0xd781('0x1'),'remove','update'];function createListener(_0xb125bf,_0x44a72d){return function(_0x3cd308){_0x44a72d[_0xd781('0x2')](_0xb125bf,_0x3cd308);};}function removeListener(_0xfd915d,_0x42258e){return function(){ChatMessageEvents[_0xd781('0x3')](_0xfd915d,_0x42258e);};}exports[_0xd781('0x4')]=function(_0x830b){for(var _0x2f98ee=0x0,_0x5a07f0=events[_0xd781('0x5')];_0x2f98ee<_0x5a07f0;_0x2f98ee++){var _0x1a242d=events[_0x2f98ee];var _0x50610d=createListener(_0xd781('0x6')+_0x1a242d,_0x830b);ChatMessageEvents['on'](_0x1a242d,_0x50610d);}};
\ No newline at end of file
+var _0x1623=['removeListener','length','chatMessage:','./chatMessage.events','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1623,0xab));var _0x3162=function(_0x46c08e,_0x534e6c){_0x46c08e=_0x46c08e-0x0;var _0x487358=_0x1623[_0x46c08e];return _0x487358;};'use strict';var ChatMessageEvents=require(_0x3162('0x0'));var events=['save','remove',_0x3162('0x1')];function createListener(_0x27ee21,_0x36ccc3){return function(_0x2cc4d7){_0x36ccc3[_0x3162('0x2')](_0x27ee21,_0x2cc4d7);};}function removeListener(_0x4ce2bd,_0x5d49d0){return function(){ChatMessageEvents[_0x3162('0x3')](_0x4ce2bd,_0x5d49d0);};}exports['register']=function(_0x1b55f2){for(var _0x428de6=0x0,_0x53260d=events[_0x3162('0x4')];_0x428de6<_0x53260d;_0x428de6++){var _0x2dc07e=events[_0x428de6];var _0x26ee32=createListener(_0x3162('0x5')+_0x2dc07e,_0x1b55f2);ChatMessageEvents['on'](_0x2dc07e,_0x26ee32);}};
\ No newline at end of file
index e7862f1..f649847 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35fe=['put','update','/:id/accept','accept','/:id/reject','reject','exports','multer','util','path','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chatmessage:create'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x35fe,0xb7));var _0xe35f=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x35fe[_0x817d9b];return _0x2752e1;};'use strict';var multer=require(_0xe35f('0x0'));var util=require(_0xe35f('0x1'));var path=require(_0xe35f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe35f('0x3'));var config=require(_0xe35f('0x4'));var controller=require('./chatMessage.controller');router[_0xe35f('0x5')]('/',auth[_0xe35f('0x6')](),controller[_0xe35f('0x7')]);router[_0xe35f('0x5')](_0xe35f('0x8'),auth[_0xe35f('0x6')](),controller[_0xe35f('0x9')]);router['get'](_0xe35f('0xa'),auth[_0xe35f('0x6')](),controller[_0xe35f('0xb')]);router[_0xe35f('0xc')]('/',auth[_0xe35f('0x6')](),interaction[_0xe35f('0xd')]('chat',_0xe35f('0xe')),controller['create']);router[_0xe35f('0xf')](_0xe35f('0xa'),controller[_0xe35f('0x10')]);router[_0xe35f('0xf')](_0xe35f('0x11'),auth[_0xe35f('0x6')](),controller[_0xe35f('0x12')]);router[_0xe35f('0xf')](_0xe35f('0x13'),auth[_0xe35f('0x6')](),controller[_0xe35f('0x14')]);router['delete'](_0xe35f('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xe35f('0x15')]=router;
\ No newline at end of file
+var _0x00e7=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','tracked','chatmessage:create','create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer'];(function(_0x373768,_0x218a5b){var _0x3b6373=function(_0x4cadb1){while(--_0x4cadb1){_0x373768['push'](_0x373768['shift']());}};_0x3b6373(++_0x218a5b);}(_0x00e7,0xf2));var _0x700e=function(_0x35468d,_0x2a7240){_0x35468d=_0x35468d-0x0;var _0x30da52=_0x00e7[_0x35468d];return _0x30da52;};'use strict';var multer=require(_0x700e('0x0'));var util=require(_0x700e('0x1'));var path=require(_0x700e('0x2'));var timeout=require(_0x700e('0x3'));var express=require('express');var router=express[_0x700e('0x4')]();var auth=require(_0x700e('0x5'));var interaction=require(_0x700e('0x6'));var config=require(_0x700e('0x7'));var controller=require('./chatMessage.controller');router[_0x700e('0x8')]('/',auth[_0x700e('0x9')](),controller[_0x700e('0xa')]);router[_0x700e('0x8')](_0x700e('0xb'),auth[_0x700e('0x9')](),controller[_0x700e('0xc')]);router[_0x700e('0x8')]('/:id',auth[_0x700e('0x9')](),controller[_0x700e('0xd')]);router[_0x700e('0xe')]('/',auth[_0x700e('0x9')](),interaction[_0x700e('0xf')]('chat',_0x700e('0x10')),controller[_0x700e('0x11')]);router[_0x700e('0x12')](_0x700e('0x13'),controller[_0x700e('0x14')]);router[_0x700e('0x12')](_0x700e('0x15'),auth[_0x700e('0x9')](),controller[_0x700e('0x16')]);router[_0x700e('0x12')](_0x700e('0x17'),auth[_0x700e('0x9')](),controller[_0x700e('0x18')]);router[_0x700e('0x19')](_0x700e('0x13'),auth[_0x700e('0x9')](),controller[_0x700e('0x1a')]);module['exports']=router;
\ No newline at end of file
index 2917ae9..cab31c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc66=['medium','sequelize','exports'];(function(_0x1fe64f,_0x479dfb){var _0x45fdf5=function(_0x284cb9){while(--_0x284cb9){_0x1fe64f['push'](_0x1fe64f['shift']());}};_0x45fdf5(++_0x479dfb);}(_0xcc66,0x121));var _0x6cc6=function(_0x33e396,_0x2645eb){_0x33e396=_0x33e396-0x0;var _0x53d012=_0xcc66[_0x33e396];return _0x53d012;};'use strict';var Sequelize=require(_0x6cc6('0x0'));module[_0x6cc6('0x1')]={'body':{'type':Sequelize['TEXT'](_0x6cc6('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x396e=['exports','TEXT','medium','sequelize'];(function(_0x568548,_0x458494){var _0x104970=function(_0x34a2c3){while(--_0x34a2c3){_0x568548['push'](_0x568548['shift']());}};_0x104970(++_0x458494);}(_0x396e,0x1ef));var _0xe396=function(_0x30187d,_0x4270b5){_0x30187d=_0x30187d-0x0;var _0x4a54ae=_0x396e[_0x30187d];return _0x4a54ae;};'use strict';var Sequelize=require(_0xe396('0x0'));module[_0xe396('0x1')]={'body':{'type':Sequelize[_0xe396('0x2')](_0xe396('0x3')),'allowNull':![]}};
\ No newline at end of file
index 49fc0fb..6d3c38c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da7=['api','../../config/utils','../../mysqldb','status','end','json','set','Content-Range','apply','update','then','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','offset','sort','pick','filter','where','VIRTUAL','merge','count','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','options','ChatOfflineMessage','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x13a01d,_0x553459){var _0xd5383e=function(_0x136b7b){while(--_0x136b7b){_0x13a01d['push'](_0x13a01d['shift']());}};_0xd5383e(++_0x553459);}(_0x7da7,0x10d));var _0x77da=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x7da7[_0x10f6e8];return _0x35bb3c;};'use strict';var pdf=require(_0x77da('0x0'));var emlformat=require(_0x77da('0x1'));var rimraf=require(_0x77da('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x77da('0x3'));var moment=require(_0x77da('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77da('0x5'));var util=require(_0x77da('0x6'));var path=require('path');var sox=require(_0x77da('0x7'));var csv=require(_0x77da('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x8'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var db=require(_0x77da('0x15'))['db'];function respondWithStatusCode(_0x3bcea0,_0x2acc65){_0x2acc65=_0x2acc65||0xcc;return function(_0x5d6e2f){if(_0x5d6e2f){return _0x3bcea0['sendStatus'](_0x2acc65);}return _0x3bcea0[_0x77da('0x16')](_0x2acc65)[_0x77da('0x17')]();};}function respondWithResult(_0x589aa1,_0x3b0ff2){_0x3b0ff2=_0x3b0ff2||0xc8;return function(_0x369df0){if(_0x369df0){return _0x589aa1[_0x77da('0x16')](_0x3b0ff2)[_0x77da('0x18')](_0x369df0);}};}function respondWithFilteredResult(_0x519253,_0x2172d0){return function(_0x4e130c){if(_0x4e130c){var _0x29cd7b=_0x4e130c['count'],_0x366443=_0x2172d0['offset'],_0x1b0e17=_0x2172d0['offset']+_0x2172d0['limit'],_0x4500c4;if(_0x1b0e17>=_0x29cd7b){_0x1b0e17=_0x29cd7b;_0x4500c4=0xc8;}else{_0x4500c4=0xce;}_0x519253[_0x77da('0x16')](_0x4500c4);return _0x519253[_0x77da('0x19')](_0x77da('0x1a'),_0x366443+'-'+_0x1b0e17+'/'+_0x29cd7b)[_0x77da('0x18')](_0x4e130c);}return null;};}function patchUpdates(_0x19a00c){return function(_0x12d2b1){try{jsonpatch[_0x77da('0x1b')](_0x12d2b1,_0x19a00c,!![]);}catch(_0x3b6dde){return BPromise['reject'](_0x3b6dde);}return _0x12d2b1['save']();};}function saveUpdates(_0xd5a809,_0x4d1512){return function(_0x507979){if(_0x507979){return _0x507979[_0x77da('0x1c')](_0xd5a809)[_0x77da('0x1d')](function(_0x24aa8a){return _0x24aa8a;});}return null;};}function removeEntity(_0x5ab79a,_0x58270c){return function(_0x3e6cfe){if(_0x3e6cfe){return _0x3e6cfe['destroy']()[_0x77da('0x1d')](function(){_0x5ab79a[_0x77da('0x16')](0xcc)[_0x77da('0x17')]();});}};}function handleEntityNotFound(_0x27b6c7,_0x10399a){return function(_0x270318){if(!_0x270318){_0x27b6c7[_0x77da('0x1e')](0x194);}return _0x270318;};}function handleError(_0x50799d,_0x4885ec){_0x4885ec=_0x4885ec||0x1f4;return function(_0xfd160){logger[_0x77da('0x1f')](_0xfd160[_0x77da('0x20')]);if(_0xfd160[_0x77da('0x21')]){delete _0xfd160['name'];}_0x50799d[_0x77da('0x16')](_0x4885ec)[_0x77da('0x22')](_0xfd160);};}exports[_0x77da('0x23')]=function(_0x36115b,_0x446ae7){var _0x5997b6={},_0xce24b8={},_0x3e090d={'count':0x0,'rows':[]};var _0x1f2279=_[_0x77da('0x24')](db['ChatOfflineMessage']['rawAttributes'],function(_0x4d395a){return{'name':_0x4d395a[_0x77da('0x25')],'type':_0x4d395a[_0x77da('0x26')][_0x77da('0x27')]};});_0xce24b8[_0x77da('0x28')]=_[_0x77da('0x24')](_0x1f2279,'name');_0xce24b8[_0x77da('0x29')]=_[_0x77da('0x2a')](_0x36115b[_0x77da('0x29')]);_0xce24b8[_0x77da('0x2b')]=_[_0x77da('0x2c')](_0xce24b8[_0x77da('0x28')],_0xce24b8['query']);_0x5997b6[_0x77da('0x2d')]=_[_0x77da('0x2c')](_0xce24b8[_0x77da('0x28')],qs[_0x77da('0x2e')](_0x36115b[_0x77da('0x29')][_0x77da('0x2e')]));_0x5997b6[_0x77da('0x2d')]=_0x5997b6[_0x77da('0x2d')]['length']?_0x5997b6['attributes']:_0xce24b8[_0x77da('0x28')];if(!_0x36115b[_0x77da('0x29')]['hasOwnProperty'](_0x77da('0x2f'))){_0x5997b6[_0x77da('0x30')]=qs[_0x77da('0x30')](_0x36115b[_0x77da('0x29')][_0x77da('0x30')]);_0x5997b6[_0x77da('0x31')]=qs[_0x77da('0x31')](_0x36115b['query'][_0x77da('0x31')]);}_0x5997b6['order']=qs['sort'](_0x36115b['query'][_0x77da('0x32')]);_0x5997b6['where']=qs[_0x77da('0x2b')](_[_0x77da('0x33')](_0x36115b[_0x77da('0x29')],_0xce24b8[_0x77da('0x2b')]),_0x1f2279);if(_0x36115b[_0x77da('0x29')][_0x77da('0x34')]){_0x5997b6[_0x77da('0x35')]=_['merge'](_0x5997b6[_0x77da('0x35')],{'$or':_[_0x77da('0x24')](_0x1f2279,function(_0x1ca53a){if(_0x1ca53a[_0x77da('0x26')]!==_0x77da('0x36')){var _0x188284={};_0x188284[_0x1ca53a['name']]={'$like':'%'+_0x36115b[_0x77da('0x29')][_0x77da('0x34')]+'%'};return _0x188284;}})});}_0x5997b6=_[_0x77da('0x37')]({},_0x5997b6,_0x36115b['options']);var _0xc5f0b8={'where':_0x5997b6['where']};return db['ChatOfflineMessage']['count'](_0xc5f0b8)['then'](function(_0x19f9f7){_0x3e090d[_0x77da('0x38')]=_0x19f9f7;if(_0x36115b[_0x77da('0x29')]['includeAll']){_0x5997b6[_0x77da('0x39')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x77da('0x3a')](_0x5997b6);})['then'](function(_0x3c216f){_0x3e090d[_0x77da('0x3b')]=_0x3c216f;return _0x3e090d;})[_0x77da('0x1d')](respondWithFilteredResult(_0x446ae7,_0x5997b6))[_0x77da('0x3c')](handleError(_0x446ae7,null));};exports[_0x77da('0x3d')]=function(_0x5ecf12,_0x759b86){var _0x1f48bd={'raw':!![],'where':{'id':_0x5ecf12[_0x77da('0x3e')]['id']}},_0x44717a={};_0x44717a[_0x77da('0x28')]=_[_0x77da('0x2a')](db['ChatOfflineMessage'][_0x77da('0x3f')]);_0x44717a[_0x77da('0x29')]=_[_0x77da('0x2a')](_0x5ecf12[_0x77da('0x29')]);_0x44717a[_0x77da('0x2b')]=_[_0x77da('0x2c')](_0x44717a['model'],_0x44717a[_0x77da('0x29')]);_0x1f48bd['attributes']=_[_0x77da('0x2c')](_0x44717a[_0x77da('0x28')],qs[_0x77da('0x2e')](_0x5ecf12['query'][_0x77da('0x2e')]));_0x1f48bd[_0x77da('0x2d')]=_0x1f48bd[_0x77da('0x2d')][_0x77da('0x40')]?_0x1f48bd[_0x77da('0x2d')]:_0x44717a[_0x77da('0x28')];if(_0x5ecf12[_0x77da('0x29')][_0x77da('0x41')]){_0x1f48bd[_0x77da('0x39')]=[{'all':!![]}];}_0x1f48bd=_['merge']({},_0x1f48bd,_0x5ecf12[_0x77da('0x42')]);return db[_0x77da('0x43')][_0x77da('0x44')](_0x1f48bd)[_0x77da('0x1d')](handleEntityNotFound(_0x759b86,null))[_0x77da('0x1d')](respondWithResult(_0x759b86,null))[_0x77da('0x3c')](handleError(_0x759b86,null));};exports['create']=function(_0x54f88c,_0x240d7b){return db[_0x77da('0x43')][_0x77da('0x45')](_0x54f88c[_0x77da('0x46')],{})[_0x77da('0x1d')](respondWithResult(_0x240d7b,0xc9))[_0x77da('0x3c')](handleError(_0x240d7b,null));};exports['update']=function(_0x6ccb8f,_0x357ee4){if(_0x6ccb8f[_0x77da('0x46')]['id']){delete _0x6ccb8f[_0x77da('0x46')]['id'];}return db['ChatOfflineMessage'][_0x77da('0x44')]({'where':{'id':_0x6ccb8f['params']['id']}})['then'](handleEntityNotFound(_0x357ee4,null))[_0x77da('0x1d')](saveUpdates(_0x6ccb8f[_0x77da('0x46')],null))[_0x77da('0x1d')](respondWithResult(_0x357ee4,null))[_0x77da('0x3c')](handleError(_0x357ee4,null));};exports['destroy']=function(_0x16bf4b,_0x1e36ee){return db['ChatOfflineMessage'][_0x77da('0x44')]({'where':{'id':_0x16bf4b[_0x77da('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1e36ee,null))[_0x77da('0x1d')](removeEntity(_0x1e36ee,null))[_0x77da('0x3c')](handleError(_0x1e36ee,null));};exports[_0x77da('0x47')]=function(_0xef2496,_0xfc13ed){return db[_0x77da('0x43')][_0x77da('0x47')]()[_0x77da('0x1d')](respondWithResult(_0xfc13ed,null))[_0x77da('0x3c')](handleError(_0xfc13ed,null));};
\ No newline at end of file
+var _0x6050=['end','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','ChatOfflineMessage','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','keys','rawAttributes','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','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','../../mysqldb','sendStatus','status'];(function(_0x5448b3,_0x56eac0){var _0x3ea872=function(_0x43e7f9){while(--_0x43e7f9){_0x5448b3['push'](_0x5448b3['shift']());}};_0x3ea872(++_0x56eac0);}(_0x6050,0x196));var _0x0605=function(_0x2449df,_0xd0c723){_0x2449df=_0x2449df-0x0;var _0x581a70=_0x6050[_0x2449df];return _0x581a70;};'use strict';var pdf=require(_0x0605('0x0'));var emlformat=require(_0x0605('0x1'));var rimraf=require(_0x0605('0x2'));var zipdir=require(_0x0605('0x3'));var jsonpatch=require(_0x0605('0x4'));var rp=require(_0x0605('0x5'));var moment=require('moment');var BPromise=require(_0x0605('0x6'));var Mustache=require(_0x0605('0x7'));var util=require(_0x0605('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0605('0x9'));var fs=require('fs');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 db=require(_0x0605('0x17'))['db'];function respondWithStatusCode(_0x434e62,_0xd22e35){_0xd22e35=_0xd22e35||0xcc;return function(_0x39e288){if(_0x39e288){return _0x434e62[_0x0605('0x18')](_0xd22e35);}return _0x434e62[_0x0605('0x19')](_0xd22e35)[_0x0605('0x1a')]();};}function respondWithResult(_0x44e793,_0x169a70){_0x169a70=_0x169a70||0xc8;return function(_0x65a20b){if(_0x65a20b){return _0x44e793[_0x0605('0x19')](_0x169a70)['json'](_0x65a20b);}};}function respondWithFilteredResult(_0x2b4610,_0x1a802b){return function(_0x4993ab){if(_0x4993ab){var _0x5ce56a=_0x4993ab[_0x0605('0x1b')],_0x4eefe9=_0x1a802b[_0x0605('0x1c')],_0x12a455=_0x1a802b[_0x0605('0x1c')]+_0x1a802b[_0x0605('0x1d')],_0xd0996d;if(_0x12a455>=_0x5ce56a){_0x12a455=_0x5ce56a;_0xd0996d=0xc8;}else{_0xd0996d=0xce;}_0x2b4610[_0x0605('0x19')](_0xd0996d);return _0x2b4610[_0x0605('0x1e')](_0x0605('0x1f'),_0x4eefe9+'-'+_0x12a455+'/'+_0x5ce56a)[_0x0605('0x20')](_0x4993ab);}return null;};}function patchUpdates(_0x3a22e9){return function(_0x2fa77e){try{jsonpatch[_0x0605('0x21')](_0x2fa77e,_0x3a22e9,!![]);}catch(_0x103952){return BPromise['reject'](_0x103952);}return _0x2fa77e[_0x0605('0x22')]();};}function saveUpdates(_0x14a920,_0x430f28){return function(_0x443326){if(_0x443326){return _0x443326[_0x0605('0x23')](_0x14a920)[_0x0605('0x24')](function(_0x379211){return _0x379211;});}return null;};}function removeEntity(_0x2c90ed,_0x226ef5){return function(_0x5b0d44){if(_0x5b0d44){return _0x5b0d44[_0x0605('0x25')]()['then'](function(){_0x2c90ed[_0x0605('0x19')](0xcc)[_0x0605('0x1a')]();});}};}function handleEntityNotFound(_0x110098,_0xf182c4){return function(_0x10c575){if(!_0x10c575){_0x110098[_0x0605('0x18')](0x194);}return _0x10c575;};}function handleError(_0x2ea61d,_0x1ae3db){_0x1ae3db=_0x1ae3db||0x1f4;return function(_0x234231){logger[_0x0605('0x26')](_0x234231[_0x0605('0x27')]);if(_0x234231[_0x0605('0x28')]){delete _0x234231['name'];}_0x2ea61d[_0x0605('0x19')](_0x1ae3db)[_0x0605('0x29')](_0x234231);};}exports['index']=function(_0x4d9a31,_0x55ebd8){var _0x33558f={},_0x226825={},_0x4163cd={'count':0x0,'rows':[]};var _0x149e36=_[_0x0605('0x2a')](db[_0x0605('0x2b')]['rawAttributes'],function(_0x34f25d){return{'name':_0x34f25d['fieldName'],'type':_0x34f25d[_0x0605('0x2c')][_0x0605('0x2d')]};});_0x226825[_0x0605('0x2e')]=_[_0x0605('0x2a')](_0x149e36,_0x0605('0x28'));_0x226825[_0x0605('0x2f')]=_['keys'](_0x4d9a31[_0x0605('0x2f')]);_0x226825[_0x0605('0x30')]=_[_0x0605('0x31')](_0x226825[_0x0605('0x2e')],_0x226825[_0x0605('0x2f')]);_0x33558f[_0x0605('0x32')]=_[_0x0605('0x31')](_0x226825[_0x0605('0x2e')],qs[_0x0605('0x33')](_0x4d9a31[_0x0605('0x2f')][_0x0605('0x33')]));_0x33558f[_0x0605('0x32')]=_0x33558f[_0x0605('0x32')][_0x0605('0x34')]?_0x33558f[_0x0605('0x32')]:_0x226825[_0x0605('0x2e')];if(!_0x4d9a31[_0x0605('0x2f')][_0x0605('0x35')](_0x0605('0x36'))){_0x33558f[_0x0605('0x1d')]=qs[_0x0605('0x1d')](_0x4d9a31[_0x0605('0x2f')][_0x0605('0x1d')]);_0x33558f[_0x0605('0x1c')]=qs[_0x0605('0x1c')](_0x4d9a31[_0x0605('0x2f')][_0x0605('0x1c')]);}_0x33558f['order']=qs[_0x0605('0x37')](_0x4d9a31[_0x0605('0x2f')]['sort']);_0x33558f[_0x0605('0x38')]=qs[_0x0605('0x30')](_['pick'](_0x4d9a31[_0x0605('0x2f')],_0x226825[_0x0605('0x30')]),_0x149e36);if(_0x4d9a31[_0x0605('0x2f')][_0x0605('0x39')]){_0x33558f[_0x0605('0x38')]=_[_0x0605('0x3a')](_0x33558f['where'],{'$or':_['map'](_0x149e36,function(_0x216f82){if(_0x216f82[_0x0605('0x2c')]!==_0x0605('0x3b')){var _0x500497={};_0x500497[_0x216f82[_0x0605('0x28')]]={'$like':'%'+_0x4d9a31['query'][_0x0605('0x39')]+'%'};return _0x500497;}})});}_0x33558f=_[_0x0605('0x3a')]({},_0x33558f,_0x4d9a31[_0x0605('0x3c')]);var _0x22b61c={'where':_0x33558f[_0x0605('0x38')]};return db[_0x0605('0x2b')][_0x0605('0x1b')](_0x22b61c)[_0x0605('0x24')](function(_0x2ef7bf){_0x4163cd[_0x0605('0x1b')]=_0x2ef7bf;if(_0x4d9a31['query'][_0x0605('0x3d')]){_0x33558f['include']=[{'all':!![]}];}return db[_0x0605('0x2b')][_0x0605('0x3e')](_0x33558f);})[_0x0605('0x24')](function(_0x479c55){_0x4163cd['rows']=_0x479c55;return _0x4163cd;})[_0x0605('0x24')](respondWithFilteredResult(_0x55ebd8,_0x33558f))['catch'](handleError(_0x55ebd8,null));};exports[_0x0605('0x3f')]=function(_0x52f4b6,_0xef54f1){var _0x3de34a={'raw':!![],'where':{'id':_0x52f4b6[_0x0605('0x40')]['id']}},_0x354f4e={};_0x354f4e[_0x0605('0x2e')]=_[_0x0605('0x41')](db[_0x0605('0x2b')][_0x0605('0x42')]);_0x354f4e[_0x0605('0x2f')]=_[_0x0605('0x41')](_0x52f4b6[_0x0605('0x2f')]);_0x354f4e['filters']=_['intersection'](_0x354f4e[_0x0605('0x2e')],_0x354f4e['query']);_0x3de34a[_0x0605('0x32')]=_[_0x0605('0x31')](_0x354f4e['model'],qs[_0x0605('0x33')](_0x52f4b6[_0x0605('0x2f')]['fields']));_0x3de34a[_0x0605('0x32')]=_0x3de34a[_0x0605('0x32')]['length']?_0x3de34a[_0x0605('0x32')]:_0x354f4e[_0x0605('0x2e')];if(_0x52f4b6['query'][_0x0605('0x3d')]){_0x3de34a['include']=[{'all':!![]}];}_0x3de34a=_['merge']({},_0x3de34a,_0x52f4b6[_0x0605('0x3c')]);return db[_0x0605('0x2b')][_0x0605('0x43')](_0x3de34a)[_0x0605('0x24')](handleEntityNotFound(_0xef54f1,null))[_0x0605('0x24')](respondWithResult(_0xef54f1,null))[_0x0605('0x44')](handleError(_0xef54f1,null));};exports[_0x0605('0x45')]=function(_0x232c93,_0x56190c){return db[_0x0605('0x2b')][_0x0605('0x45')](_0x232c93[_0x0605('0x46')],{})['then'](respondWithResult(_0x56190c,0xc9))[_0x0605('0x44')](handleError(_0x56190c,null));};exports[_0x0605('0x23')]=function(_0x45cc1a,_0x3a1624){if(_0x45cc1a[_0x0605('0x46')]['id']){delete _0x45cc1a[_0x0605('0x46')]['id'];}return db[_0x0605('0x2b')][_0x0605('0x43')]({'where':{'id':_0x45cc1a[_0x0605('0x40')]['id']}})['then'](handleEntityNotFound(_0x3a1624,null))[_0x0605('0x24')](saveUpdates(_0x45cc1a[_0x0605('0x46')],null))[_0x0605('0x24')](respondWithResult(_0x3a1624,null))[_0x0605('0x44')](handleError(_0x3a1624,null));};exports[_0x0605('0x25')]=function(_0x434289,_0x18995e){return db[_0x0605('0x2b')][_0x0605('0x43')]({'where':{'id':_0x434289[_0x0605('0x40')]['id']}})['then'](handleEntityNotFound(_0x18995e,null))['then'](removeEntity(_0x18995e,null))['catch'](handleError(_0x18995e,null));};exports[_0x0605('0x47')]=function(_0x7daeb7,_0x46d852){return db[_0x0605('0x2b')][_0x0605('0x47')]()[_0x0605('0x24')](respondWithResult(_0x46d852,null))['catch'](handleError(_0x46d852,null));};
\ No newline at end of file
index e74df34..4bd62e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaffb=['utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x3db597,_0x12ea74){var _0x1aaf0b=function(_0x54c2fd){while(--_0x54c2fd){_0x3db597['push'](_0x3db597['shift']());}};_0x1aaf0b(++_0x12ea74);}(_0xaffb,0xcd));var _0xbaff=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xaffb[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0xbaff('0x0'));var util=require(_0xbaff('0x1'));var logger=require(_0xbaff('0x2'))(_0xbaff('0x3'));var moment=require('moment');var BPromise=require(_0xbaff('0x4'));var rp=require(_0xbaff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbaff('0x6'));var attributes=require(_0xbaff('0x7'));module[_0xbaff('0x8')]=function(_0x584708,_0x5717ed){return _0x584708[_0xbaff('0x9')](_0xbaff('0xa'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbaff('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x782d=['bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x1d1467,_0x41c3d1){var _0x30dd18=function(_0xea20f7){while(--_0xea20f7){_0x1d1467['push'](_0x1d1467['shift']());}};_0x30dd18(++_0x41c3d1);}(_0x782d,0xcf));var _0xd782=function(_0x964ae3,_0x516b25){_0x964ae3=_0x964ae3-0x0;var _0xa3f47b=_0x782d[_0x964ae3];return _0xa3f47b;};'use strict';var _=require(_0xd782('0x0'));var util=require(_0xd782('0x1'));var logger=require('../../config/logger')(_0xd782('0x2'));var moment=require('moment');var BPromise=require(_0xd782('0x3'));var rp=require(_0xd782('0x4'));var fs=require('fs');var path=require(_0xd782('0x5'));var rimraf=require(_0xd782('0x6'));var config=require(_0xd782('0x7'));var attributes=require(_0xd782('0x8'));module[_0xd782('0x9')]=function(_0x1ee578,_0xf96eb){return _0x1ee578[_0xd782('0xa')](_0xd782('0xb'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd782('0xc'),'collate':_0xd782('0xd')});};
\ No newline at end of file
index 93598a5..c9b072c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8ed=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0x809dbd,_0xf5f241){var _0x5497bf=function(_0x4642bf){while(--_0x4642bf){_0x809dbd['push'](_0x809dbd['shift']());}};_0x5497bf(++_0xf5f241);}(_0xe8ed,0x140));var _0xde8e=function(_0x20767c,_0x570769){_0x20767c=_0x20767c-0x0;var _0x2a16f1=_0xe8ed[_0x20767c];return _0x2a16f1;};'use strict';var _=require(_0xde8e('0x0'));var util=require(_0xde8e('0x1'));var moment=require(_0xde8e('0x2'));var BPromise=require('bluebird');var rs=require(_0xde8e('0x3'));var fs=require('fs');var Redis=require(_0xde8e('0x4'));var db=require(_0xde8e('0x5'))['db'];var utils=require(_0xde8e('0x6'));var logger=require(_0xde8e('0x7'))(_0xde8e('0x8'));var config=require(_0xde8e('0x9'));var jayson=require(_0xde8e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4994,_0x2db6eb,_0x498282){return new BPromise(function(_0x1e6319,_0x40bdfd){return client[_0xde8e('0xb')](_0x3c4994,_0x498282)[_0xde8e('0xc')](function(_0x14606e){logger[_0xde8e('0xd')](_0xde8e('0xe'),_0x2db6eb,'request\x20sent');logger[_0xde8e('0xf')](_0xde8e('0x10'),_0x2db6eb,_0xde8e('0x11'),JSON[_0xde8e('0x12')](_0x14606e));if(_0x14606e[_0xde8e('0x13')]){if(_0x14606e['error'][_0xde8e('0x14')]===0x1f4){logger[_0xde8e('0x13')](_0xde8e('0xe'),_0x2db6eb,_0x14606e[_0xde8e('0x13')][_0xde8e('0x15')]);return _0x40bdfd(_0x14606e['error']['message']);}logger[_0xde8e('0x13')](_0xde8e('0xe'),_0x2db6eb,_0x14606e[_0xde8e('0x13')][_0xde8e('0x15')]);return _0x1e6319(_0x14606e[_0xde8e('0x13')][_0xde8e('0x15')]);}else{logger[_0xde8e('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2db6eb,'request\x20sent');_0x1e6319(_0x14606e['result']['message']);}})[_0xde8e('0x16')](function(_0x1c82a9){logger['error'](_0xde8e('0xe'),_0x2db6eb,_0x1c82a9);_0x40bdfd(_0x1c82a9);});});}
\ No newline at end of file
+var _0x20fb=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x20fb,0xab));var _0xb20f=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x20fb[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb20f('0x0'));var BPromise=require(_0xb20f('0x1'));var rs=require(_0xb20f('0x2'));var fs=require('fs');var Redis=require(_0xb20f('0x3'));var db=require(_0xb20f('0x4'))['db'];var utils=require(_0xb20f('0x5'));var logger=require(_0xb20f('0x6'))(_0xb20f('0x7'));var config=require(_0xb20f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb20f('0x9')][_0xb20f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41c5ed,_0x5aeda9,_0x34eb8c){return new BPromise(function(_0x5aebca,_0x3c9288){return client[_0xb20f('0xb')](_0x41c5ed,_0x34eb8c)[_0xb20f('0xc')](function(_0x2d4931){logger[_0xb20f('0xd')](_0xb20f('0xe'),_0x5aeda9,'request\x20sent');logger[_0xb20f('0xf')](_0xb20f('0x10'),_0x5aeda9,'request\x20sent',JSON[_0xb20f('0x11')](_0x2d4931));if(_0x2d4931['error']){if(_0x2d4931[_0xb20f('0x12')][_0xb20f('0x13')]===0x1f4){logger[_0xb20f('0x12')](_0xb20f('0xe'),_0x5aeda9,_0x2d4931[_0xb20f('0x12')][_0xb20f('0x14')]);return _0x3c9288(_0x2d4931[_0xb20f('0x12')][_0xb20f('0x14')]);}logger[_0xb20f('0x12')](_0xb20f('0xe'),_0x5aeda9,_0x2d4931[_0xb20f('0x12')][_0xb20f('0x14')]);return _0x5aebca(_0x2d4931[_0xb20f('0x12')][_0xb20f('0x14')]);}else{logger['info'](_0xb20f('0xe'),_0x5aeda9,_0xb20f('0x15'));_0x5aebca(_0x2d4931['result'][_0xb20f('0x14')]);}})['catch'](function(_0x34f230){logger['error'](_0xb20f('0xe'),_0x5aeda9,_0x34f230);_0x3c9288(_0x34f230);});});}
\ No newline at end of file
index f784bdd..bb49682 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3927=['Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','multer','path'];(function(_0x4cca7f,_0x2d83a2){var _0x5de513=function(_0x43eb53){while(--_0x43eb53){_0x4cca7f['push'](_0x4cca7f['shift']());}};_0x5de513(++_0x2d83a2);}(_0x3927,0xa0));var _0x7392=function(_0x51c9d2,_0x2364a8){_0x51c9d2=_0x51c9d2-0x0;var _0x2af9db=_0x3927[_0x51c9d2];return _0x2af9db;};'use strict';var multer=require(_0x7392('0x0'));var util=require('util');var path=require(_0x7392('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7392('0x2')]();var auth=require(_0x7392('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7392('0x4'));var controller=require(_0x7392('0x5'));router[_0x7392('0x6')]('/',auth[_0x7392('0x7')](),controller[_0x7392('0x8')]);router['get'](_0x7392('0x9'),auth[_0x7392('0x7')](),controller[_0x7392('0xa')]);router[_0x7392('0x6')](_0x7392('0xb'),auth[_0x7392('0x7')](),controller[_0x7392('0xc')]);router[_0x7392('0xd')]('/',auth[_0x7392('0x7')](),controller[_0x7392('0xe')]);router[_0x7392('0xf')](_0x7392('0xb'),auth[_0x7392('0x7')](),controller['update']);router[_0x7392('0x10')](_0x7392('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7392('0x11')]=router;
\ No newline at end of file
+var _0x1373=['post','create','delete','destroy','exports','multer','util','connect-timeout','express','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x56d8e7,_0x3cffc1){var _0x2d6a1a=function(_0x2b884b){while(--_0x2b884b){_0x56d8e7['push'](_0x56d8e7['shift']());}};_0x2d6a1a(++_0x3cffc1);}(_0x1373,0xc0));var _0x3137=function(_0x3199af,_0x339560){_0x3199af=_0x3199af-0x0;var _0x5aa4d0=_0x1373[_0x3199af];return _0x5aa4d0;};'use strict';var multer=require(_0x3137('0x0'));var util=require(_0x3137('0x1'));var path=require('path');var timeout=require(_0x3137('0x2'));var express=require(_0x3137('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3137('0x4'));var controller=require(_0x3137('0x5'));router['get']('/',auth[_0x3137('0x6')](),controller['index']);router[_0x3137('0x7')](_0x3137('0x8'),auth[_0x3137('0x6')](),controller[_0x3137('0x9')]);router[_0x3137('0x7')](_0x3137('0xa'),auth['isAuthenticated'](),controller[_0x3137('0xb')]);router[_0x3137('0xc')]('/',auth[_0x3137('0x6')](),controller[_0x3137('0xd')]);router['put'](_0x3137('0xa'),auth[_0x3137('0x6')](),controller['update']);router[_0x3137('0xe')](_0x3137('0xa'),auth[_0x3137('0x6')](),controller[_0x3137('0xf')]);module[_0x3137('0x10')]=router;
\ No newline at end of file
index 2df41a5..f26f9ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bbb=['INTEGER','sequelize','exports','STRING','mouseOver','timeout'];(function(_0x4c3951,_0x425873){var _0x15caee=function(_0x4b5466){while(--_0x4b5466){_0x4c3951['push'](_0x4c3951['shift']());}};_0x15caee(++_0x425873);}(_0x7bbb,0x79));var _0xb7bb=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7bbb[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0xb7bb('0x0'));module[_0xb7bb('0x1')]={'name':{'type':Sequelize[_0xb7bb('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb7bb('0x3'),_0xb7bb('0x4')),'defaultValue':_0xb7bb('0x3')},'selector':{'type':Sequelize[_0xb7bb('0x2')]},'timeout':{'type':Sequelize[_0xb7bb('0x5')]}};
\ No newline at end of file
+var _0x9088=['sequelize','STRING','mouseOver','INTEGER'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x9088,0x1b4));var _0x8908=function(_0x2d136f,_0x2421be){_0x2d136f=_0x2d136f-0x0;var _0x19615f=_0x9088[_0x2d136f];return _0x19615f;};'use strict';var Sequelize=require(_0x8908('0x0'));module['exports']={'name':{'type':Sequelize[_0x8908('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8908('0x2'),'timeout'),'defaultValue':_0x8908('0x2')},'selector':{'type':Sequelize[_0x8908('0x1')]},'timeout':{'type':Sequelize[_0x8908('0x3')]}};
\ No newline at end of file
index 6581d27..34a146a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['offset','limit','Content-Range','reject','update','then','destroy','error','stack','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','include','merge','options','find','catch','create','ChatProactiveAction','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xedd9,0xfc));var _0x9edd=function(_0x45c80d,_0x3dc7c5){_0x45c80d=_0x45c80d-0x0;var _0x168e33=_0xedd9[_0x45c80d];return _0x168e33;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0xa'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var db=require(_0x9edd('0x16'))['db'];function respondWithStatusCode(_0x25e64c,_0xfd544a){_0xfd544a=_0xfd544a||0xcc;return function(_0x287ddd){if(_0x287ddd){return _0x25e64c[_0x9edd('0x17')](_0xfd544a);}return _0x25e64c[_0x9edd('0x18')](_0xfd544a)[_0x9edd('0x19')]();};}function respondWithResult(_0x47eb64,_0x176bfa){_0x176bfa=_0x176bfa||0xc8;return function(_0x44fc7c){if(_0x44fc7c){return _0x47eb64[_0x9edd('0x18')](_0x176bfa)[_0x9edd('0x1a')](_0x44fc7c);}};}function respondWithFilteredResult(_0x13b6b6,_0x338f3c){return function(_0x1042aa){if(_0x1042aa){var _0x75a4ab=_0x1042aa[_0x9edd('0x1b')],_0x4ea60f=_0x338f3c['offset'],_0x5f5bf4=_0x338f3c[_0x9edd('0x1c')]+_0x338f3c[_0x9edd('0x1d')],_0x448996;if(_0x5f5bf4>=_0x75a4ab){_0x5f5bf4=_0x75a4ab;_0x448996=0xc8;}else{_0x448996=0xce;}_0x13b6b6[_0x9edd('0x18')](_0x448996);return _0x13b6b6['set'](_0x9edd('0x1e'),_0x4ea60f+'-'+_0x5f5bf4+'/'+_0x75a4ab)['json'](_0x1042aa);}return null;};}function patchUpdates(_0x2cdcef){return function(_0x1083e4){try{jsonpatch['apply'](_0x1083e4,_0x2cdcef,!![]);}catch(_0x498977){return BPromise[_0x9edd('0x1f')](_0x498977);}return _0x1083e4['save']();};}function saveUpdates(_0x27a95a,_0x54a03f){return function(_0x535f37){if(_0x535f37){return _0x535f37[_0x9edd('0x20')](_0x27a95a)[_0x9edd('0x21')](function(_0x4fb7bf){return _0x4fb7bf;});}return null;};}function removeEntity(_0x5823bc,_0x341d67){return function(_0x186186){if(_0x186186){return _0x186186[_0x9edd('0x22')]()['then'](function(){_0x5823bc[_0x9edd('0x18')](0xcc)[_0x9edd('0x19')]();});}};}function handleEntityNotFound(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(!_0x339a0d){_0x44a6c1['sendStatus'](0x194);}return _0x339a0d;};}function handleError(_0x46c383,_0xeaf55a){_0xeaf55a=_0xeaf55a||0x1f4;return function(_0x3a1ea5){logger[_0x9edd('0x23')](_0x3a1ea5[_0x9edd('0x24')]);if(_0x3a1ea5['name']){delete _0x3a1ea5['name'];}_0x46c383[_0x9edd('0x18')](_0xeaf55a)[_0x9edd('0x25')](_0x3a1ea5);};}exports[_0x9edd('0x26')]=function(_0x25e135,_0x3c2227){var _0x4fe471={'raw':!![],'where':{'id':_0x25e135[_0x9edd('0x27')]['id']}},_0x57a2cc={};_0x57a2cc[_0x9edd('0x28')]=_[_0x9edd('0x29')](db['ChatProactiveAction'][_0x9edd('0x2a')]);_0x57a2cc[_0x9edd('0x2b')]=_[_0x9edd('0x29')](_0x25e135[_0x9edd('0x2b')]);_0x57a2cc['filters']=_[_0x9edd('0x2c')](_0x57a2cc[_0x9edd('0x28')],_0x57a2cc[_0x9edd('0x2b')]);_0x4fe471[_0x9edd('0x2d')]=_[_0x9edd('0x2c')](_0x57a2cc[_0x9edd('0x28')],qs[_0x9edd('0x2e')](_0x25e135[_0x9edd('0x2b')][_0x9edd('0x2e')]));_0x4fe471[_0x9edd('0x2d')]=_0x4fe471[_0x9edd('0x2d')][_0x9edd('0x2f')]?_0x4fe471[_0x9edd('0x2d')]:_0x57a2cc[_0x9edd('0x28')];if(_0x25e135[_0x9edd('0x2b')]['includeAll']){_0x4fe471[_0x9edd('0x30')]=[{'all':!![]}];}_0x4fe471=_[_0x9edd('0x31')]({},_0x4fe471,_0x25e135[_0x9edd('0x32')]);return db['ChatProactiveAction'][_0x9edd('0x33')](_0x4fe471)[_0x9edd('0x21')](handleEntityNotFound(_0x3c2227,null))[_0x9edd('0x21')](respondWithResult(_0x3c2227,null))[_0x9edd('0x34')](handleError(_0x3c2227,null));};exports[_0x9edd('0x35')]=function(_0x2bc4ed,_0x473068){return db[_0x9edd('0x36')][_0x9edd('0x35')](_0x2bc4ed[_0x9edd('0x37')],{})[_0x9edd('0x21')](respondWithResult(_0x473068,0xc9))[_0x9edd('0x34')](handleError(_0x473068,null));};exports[_0x9edd('0x20')]=function(_0x14f780,_0x5757fc){if(_0x14f780[_0x9edd('0x37')]['id']){delete _0x14f780['body']['id'];}return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'id':_0x14f780[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x5757fc,null))[_0x9edd('0x21')](saveUpdates(_0x14f780['body'],null))[_0x9edd('0x21')](respondWithResult(_0x5757fc,null))[_0x9edd('0x34')](handleError(_0x5757fc,null));};exports[_0x9edd('0x22')]=function(_0x38e9be,_0x1be77f){return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'id':_0x38e9be[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x1be77f,null))[_0x9edd('0x21')](removeEntity(_0x1be77f,null))['catch'](handleError(_0x1be77f,null));};
\ No newline at end of file
+var _0x0713=['update','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','includeAll','include','merge','options','find','catch','create','body'];(function(_0x223d98,_0x58057c){var _0x4e1d01=function(_0x217cb8){while(--_0x217cb8){_0x223d98['push'](_0x223d98['shift']());}};_0x4e1d01(++_0x58057c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];function respondWithStatusCode(_0xa0c1,_0x4a8cc7){_0x4a8cc7=_0x4a8cc7||0xcc;return function(_0x5330a8){if(_0x5330a8){return _0xa0c1[_0x3071('0x1a')](_0x4a8cc7);}return _0xa0c1['status'](_0x4a8cc7)[_0x3071('0x1b')]();};}function respondWithResult(_0x44fbae,_0x5d4883){_0x5d4883=_0x5d4883||0xc8;return function(_0x104e73){if(_0x104e73){return _0x44fbae['status'](_0x5d4883)[_0x3071('0x1c')](_0x104e73);}};}function respondWithFilteredResult(_0x45c93b,_0x1271d0){return function(_0x1f14e1){if(_0x1f14e1){var _0x1caa5d=_0x1f14e1[_0x3071('0x1d')],_0x2a6a4b=_0x1271d0[_0x3071('0x1e')],_0x157a47=_0x1271d0['offset']+_0x1271d0[_0x3071('0x1f')],_0x11bdc9;if(_0x157a47>=_0x1caa5d){_0x157a47=_0x1caa5d;_0x11bdc9=0xc8;}else{_0x11bdc9=0xce;}_0x45c93b[_0x3071('0x20')](_0x11bdc9);return _0x45c93b[_0x3071('0x21')](_0x3071('0x22'),_0x2a6a4b+'-'+_0x157a47+'/'+_0x1caa5d)[_0x3071('0x1c')](_0x1f14e1);}return null;};}function patchUpdates(_0x17aee2){return function(_0x105bbb){try{jsonpatch[_0x3071('0x23')](_0x105bbb,_0x17aee2,!![]);}catch(_0x502a16){return BPromise[_0x3071('0x24')](_0x502a16);}return _0x105bbb[_0x3071('0x25')]();};}function saveUpdates(_0xd3e23d,_0x56c267){return function(_0xb8f4e3){if(_0xb8f4e3){return _0xb8f4e3['update'](_0xd3e23d)[_0x3071('0x26')](function(_0x43128c){return _0x43128c;});}return null;};}function removeEntity(_0x3762d8,_0x457b57){return function(_0x33090c){if(_0x33090c){return _0x33090c[_0x3071('0x27')]()[_0x3071('0x26')](function(){_0x3762d8[_0x3071('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(!_0xb05b1d){_0x481a51[_0x3071('0x1a')](0x194);}return _0xb05b1d;};}function handleError(_0x13df9f,_0x2793ef){_0x2793ef=_0x2793ef||0x1f4;return function(_0x44b45f){logger[_0x3071('0x28')](_0x44b45f[_0x3071('0x29')]);if(_0x44b45f[_0x3071('0x2a')]){delete _0x44b45f['name'];}_0x13df9f[_0x3071('0x20')](_0x2793ef)[_0x3071('0x2b')](_0x44b45f);};}exports[_0x3071('0x2c')]=function(_0x4d5c4b,_0x4fb1ca){var _0x28792d={'raw':!![],'where':{'id':_0x4d5c4b[_0x3071('0x2d')]['id']}},_0x163604={};_0x163604[_0x3071('0x2e')]=_[_0x3071('0x2f')](db[_0x3071('0x30')][_0x3071('0x31')]);_0x163604[_0x3071('0x32')]=_[_0x3071('0x2f')](_0x4d5c4b[_0x3071('0x32')]);_0x163604['filters']=_['intersection'](_0x163604[_0x3071('0x2e')],_0x163604[_0x3071('0x32')]);_0x28792d[_0x3071('0x33')]=_[_0x3071('0x34')](_0x163604[_0x3071('0x2e')],qs[_0x3071('0x35')](_0x4d5c4b[_0x3071('0x32')][_0x3071('0x35')]));_0x28792d['attributes']=_0x28792d['attributes']['length']?_0x28792d[_0x3071('0x33')]:_0x163604[_0x3071('0x2e')];if(_0x4d5c4b['query'][_0x3071('0x36')]){_0x28792d[_0x3071('0x37')]=[{'all':!![]}];}_0x28792d=_[_0x3071('0x38')]({},_0x28792d,_0x4d5c4b[_0x3071('0x39')]);return db['ChatProactiveAction'][_0x3071('0x3a')](_0x28792d)[_0x3071('0x26')](handleEntityNotFound(_0x4fb1ca,null))[_0x3071('0x26')](respondWithResult(_0x4fb1ca,null))[_0x3071('0x3b')](handleError(_0x4fb1ca,null));};exports[_0x3071('0x3c')]=function(_0x2068ce,_0x3c55c){return db[_0x3071('0x30')]['create'](_0x2068ce[_0x3071('0x3d')],{})['then'](respondWithResult(_0x3c55c,0xc9))['catch'](handleError(_0x3c55c,null));};exports[_0x3071('0x3e')]=function(_0xa3a7ae,_0x54d9c3){if(_0xa3a7ae[_0x3071('0x3d')]['id']){delete _0xa3a7ae[_0x3071('0x3d')]['id'];}return db[_0x3071('0x30')][_0x3071('0x3a')]({'where':{'id':_0xa3a7ae[_0x3071('0x2d')]['id']}})[_0x3071('0x26')](handleEntityNotFound(_0x54d9c3,null))['then'](saveUpdates(_0xa3a7ae[_0x3071('0x3d')],null))[_0x3071('0x26')](respondWithResult(_0x54d9c3,null))['catch'](handleError(_0x54d9c3,null));};exports[_0x3071('0x27')]=function(_0x5b1392,_0x28f855){return db[_0x3071('0x30')]['find']({'where':{'id':_0x5b1392['params']['id']}})[_0x3071('0x26')](handleEntityNotFound(_0x28f855,null))[_0x3071('0x26')](removeEntity(_0x28f855,null))[_0x3071('0x3b')](handleError(_0x28f855,null));};
\ No newline at end of file
index 49e8466..76d360d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8b6=['moment','path','../../config/environment','exports','define','ChatProactiveAction','lodash','../../config/logger'];(function(_0x5049c9,_0xf3d6b1){var _0x41a43d=function(_0x1d8dd9){while(--_0x1d8dd9){_0x5049c9['push'](_0x5049c9['shift']());}};_0x41a43d(++_0xf3d6b1);}(_0xc8b6,0x17e));var _0x6c8b=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0xc8b6[_0x4de586];return _0x46baf5;};'use strict';var _=require(_0x6c8b('0x0'));var util=require('util');var logger=require(_0x6c8b('0x1'))('api');var moment=require(_0x6c8b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c8b('0x3'));var rimraf=require('rimraf');var config=require(_0x6c8b('0x4'));var attributes=require('./chatProactiveAction.attributes');module[_0x6c8b('0x5')]=function(_0x9fe2e1,_0x384693){return _0x9fe2e1[_0x6c8b('0x6')](_0x6c8b('0x7'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe912=['moment','rimraf','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api'];(function(_0x13737a,_0x5390e9){var _0x1cfa79=function(_0x25aece){while(--_0x25aece){_0x13737a['push'](_0x13737a['shift']());}};_0x1cfa79(++_0x5390e9);}(_0xe912,0x138));var _0x2e91=function(_0x16ec32,_0x3ba6c8){_0x16ec32=_0x16ec32-0x0;var _0x513261=_0xe912[_0x16ec32];return _0x513261;};'use strict';var _=require(_0x2e91('0x0'));var util=require(_0x2e91('0x1'));var logger=require('../../config/logger')(_0x2e91('0x2'));var moment=require(_0x2e91('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2e91('0x4'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0x2e91('0x5')]=function(_0x45137d,_0x4d5744){return _0x45137d[_0x2e91('0x6')](_0x2e91('0x7'),attributes,{'tableName':_0x2e91('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7e88ebc..e1d7965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf933=['ChatProactiveAction,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message'];(function(_0xc55a01,_0x6464c6){var _0x2311e6=function(_0x24db41){while(--_0x24db41){_0xc55a01['push'](_0xc55a01['shift']());}};_0x2311e6(++_0x6464c6);}(_0xf933,0xc0));var _0x3f93=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xf933[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3f93('0x0'));var BPromise=require(_0x3f93('0x1'));var rs=require(_0x3f93('0x2'));var fs=require('fs');var Redis=require(_0x3f93('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3f93('0x4'));var logger=require(_0x3f93('0x5'))('rpc');var config=require(_0x3f93('0x6'));var jayson=require(_0x3f93('0x7'));var client=jayson[_0x3f93('0x8')][_0x3f93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc901,_0x4b732f,_0x515ed7){return new BPromise(function(_0x29ce69,_0x234355){return client['request'](_0x2fc901,_0x515ed7)[_0x3f93('0xa')](function(_0x54fef8){logger[_0x3f93('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x4b732f,_0x3f93('0xc'));logger[_0x3f93('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4b732f,_0x3f93('0xc'),JSON[_0x3f93('0xe')](_0x54fef8));if(_0x54fef8[_0x3f93('0xf')]){if(_0x54fef8['error'][_0x3f93('0x10')]===0x1f4){logger[_0x3f93('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x4b732f,_0x54fef8[_0x3f93('0xf')][_0x3f93('0x11')]);return _0x234355(_0x54fef8[_0x3f93('0xf')][_0x3f93('0x11')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4b732f,_0x54fef8[_0x3f93('0xf')]['message']);return _0x29ce69(_0x54fef8[_0x3f93('0xf')][_0x3f93('0x11')]);}else{logger[_0x3f93('0xb')](_0x3f93('0x12'),_0x4b732f,_0x3f93('0xc'));_0x29ce69(_0x54fef8[_0x3f93('0x13')]['message']);}})[_0x3f93('0x14')](function(_0x3e33d2){logger[_0x3f93('0xf')](_0x3f93('0x12'),_0x4b732f,_0x3e33d2);_0x234355(_0x3e33d2);});});}
\ No newline at end of file
+var _0x1a4a=['message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x337d38,_0x5cb203){var _0x502d8b=function(_0x24247c){while(--_0x24247c){_0x337d38['push'](_0x337d38['shift']());}};_0x502d8b(++_0x5cb203);}(_0x1a4a,0x1a4));var _0xa1a4=function(_0x471a02,_0x43450d){_0x471a02=_0x471a02-0x0;var _0x2b5271=_0x1a4a[_0x471a02];return _0x2b5271;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa1a4('0x0'));var BPromise=require(_0xa1a4('0x1'));var rs=require(_0xa1a4('0x2'));var fs=require('fs');var Redis=require(_0xa1a4('0x3'));var db=require(_0xa1a4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1a4('0x5'))(_0xa1a4('0x6'));var config=require(_0xa1a4('0x7'));var jayson=require(_0xa1a4('0x8'));var client=jayson[_0xa1a4('0x9')][_0xa1a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x165e64,_0x378edf,_0x2af15d){return new BPromise(function(_0x260ea8,_0x49207b){return client[_0xa1a4('0xb')](_0x165e64,_0x2af15d)['then'](function(_0x5eb36a){logger[_0xa1a4('0xc')](_0xa1a4('0xd'),_0x378edf,_0xa1a4('0xe'));logger[_0xa1a4('0xf')](_0xa1a4('0x10'),_0x378edf,'request\x20sent',JSON[_0xa1a4('0x11')](_0x5eb36a));if(_0x5eb36a[_0xa1a4('0x12')]){if(_0x5eb36a[_0xa1a4('0x12')][_0xa1a4('0x13')]===0x1f4){logger[_0xa1a4('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x378edf,_0x5eb36a[_0xa1a4('0x12')]['message']);return _0x49207b(_0x5eb36a[_0xa1a4('0x12')][_0xa1a4('0x14')]);}logger['error'](_0xa1a4('0xd'),_0x378edf,_0x5eb36a[_0xa1a4('0x12')][_0xa1a4('0x14')]);return _0x260ea8(_0x5eb36a[_0xa1a4('0x12')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x378edf,_0xa1a4('0xe'));_0x260ea8(_0x5eb36a['result']['message']);}})[_0xa1a4('0x15')](function(_0x10e041){logger[_0xa1a4('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x378edf,_0x10e041);_0x49207b(_0x10e041);});});}
\ No newline at end of file
index 94be240..989a40b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9658=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x9658,0x6f));var _0x8965=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x9658[_0x58e469];return _0x4c01c5;};'use strict';var multer=require(_0x8965('0x0'));var util=require('util');var path=require(_0x8965('0x1'));var timeout=require(_0x8965('0x2'));var express=require('express');var router=express[_0x8965('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8965('0x4'));var config=require(_0x8965('0x5'));var controller=require(_0x8965('0x6'));router['get'](_0x8965('0x7'),auth[_0x8965('0x8')](),controller[_0x8965('0x9')]);router[_0x8965('0xa')]('/',auth[_0x8965('0x8')](),controller[_0x8965('0xb')]);router[_0x8965('0xc')](_0x8965('0x7'),auth[_0x8965('0x8')](),controller[_0x8965('0xd')]);router[_0x8965('0xe')](_0x8965('0x7'),auth[_0x8965('0x8')](),controller[_0x8965('0xf')]);module[_0x8965('0x10')]=router;
\ No newline at end of file
+var _0x33d8=['create','put','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post'];(function(_0x3a4464,_0x37afa0){var _0x42503f=function(_0x379ce7){while(--_0x379ce7){_0x3a4464['push'](_0x3a4464['shift']());}};_0x42503f(++_0x37afa0);}(_0x33d8,0x1a7));var _0x833d=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x33d8[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require('multer');var util=require(_0x833d('0x0'));var path=require(_0x833d('0x1'));var timeout=require(_0x833d('0x2'));var express=require(_0x833d('0x3'));var router=express[_0x833d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x833d('0x5'));var config=require(_0x833d('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x833d('0x7')](_0x833d('0x8'),auth[_0x833d('0x9')](),controller[_0x833d('0xa')]);router[_0x833d('0xb')]('/',auth[_0x833d('0x9')](),controller[_0x833d('0xc')]);router[_0x833d('0xd')](_0x833d('0x8'),auth[_0x833d('0x9')](),controller['update']);router['delete'](_0x833d('0x8'),auth[_0x833d('0x9')](),controller[_0x833d('0xe')]);module['exports']=router;
\ No newline at end of file
index 978294b..3f92504 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x717a=['roundrobin','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x717a,0x1b7));var _0xa717=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0x717a[_0x46a671];return _0x526d75;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa717('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa717('0x0')]},'timeout':{'type':Sequelize[_0xa717('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa717('0x2')](_0xa717('0x3'),_0xa717('0x4'),_0xa717('0x5'))}};
\ No newline at end of file
+var _0xab34=['STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x2e6f0b,_0x5de9f0){var _0x5628d2=function(_0x1236e4){while(--_0x1236e4){_0x2e6f0b['push'](_0x2e6f0b['shift']());}};_0x5628d2(++_0x5de9f0);}(_0xab34,0xed));var _0x4ab3=function(_0x1353c6,_0x1ab9b9){_0x1353c6=_0x1353c6-0x0;var _0xabaadb=_0xab34[_0x1353c6];return _0xabaadb;};'use strict';var Sequelize=require(_0x4ab3('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ab3('0x1')],'unique':_0x4ab3('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4ab3('0x1')]},'timeout':{'type':Sequelize[_0x4ab3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4ab3('0x4')](_0x4ab3('0x5'),'beepall',_0x4ab3('0x6'))}};
\ No newline at end of file
index c0d9849..3f0943f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8ec=['../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','ChatQueues','destroy','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','options','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','transaction','userChatQueue:remove','addAgents','omit','spread','removeAgents','getAgents','html-pdf','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','../../config/license/hardware','api','../../config/utils'];(function(_0x3e9c83,_0x14f335){var _0x21bfed=function(_0x40363e){while(--_0x40363e){_0x3e9c83['push'](_0x3e9c83['shift']());}};_0x21bfed(++_0x14f335);}(_0xf8ec,0x11e));var _0xcf8e=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xf8ec[_0x2d89ce];return _0x3fad10;};'use strict';var pdf=require(_0xcf8e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcf8e('0x1'));var jsonpatch=require(_0xcf8e('0x2'));var rp=require(_0xcf8e('0x3'));var moment=require(_0xcf8e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcf8e('0x5'));var util=require(_0xcf8e('0x6'));var path=require(_0xcf8e('0x7'));var sox=require('sox');var csv=require(_0xcf8e('0x8'));var ejs=require(_0xcf8e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcf8e('0xa'));var crypto=require(_0xcf8e('0xb'));var jsforce=require(_0xcf8e('0xc'));var deskjs=require(_0xcf8e('0xd'));var toCsv=require(_0xcf8e('0x8'));var querystring=require(_0xcf8e('0xe'));var Papa=require(_0xcf8e('0xf'));var Redis=require(_0xcf8e('0x10'));var authService=require(_0xcf8e('0x11'));var qs=require(_0xcf8e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf8e('0x13'));var logger=require('../../config/logger')(_0xcf8e('0x14'));var utils=require(_0xcf8e('0x15'));var config=require('../../config/environment');var db=require(_0xcf8e('0x16'))['db'];config['redis']=_[_0xcf8e('0x17')](config[_0xcf8e('0x18')],{'host':_0xcf8e('0x19'),'port':0x18eb});var socket=require(_0xcf8e('0x1a'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);var jayson=require(_0xcf8e('0x1b'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x49d72c,_0x1e6c64,_0x1fbe52){if(_0x1fbe52){var _0x331d85=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x331d85[_0xcf8e('0x1c')](_0x1e6c64)){return _0x49d72c;}else{throw new db[(_0xcf8e('0x1d'))][(_0xcf8e('0x1e'))](_0xcf8e('0x1f'));}}else{return _0x49d72c;}}function respondWithRpcPromise(_0x47854e,_0x201a5e,_0x10d6f8,_0x1aa6a4){return new BPromise(function(_0x1d0c1f,_0x13ef5a){var _0xff8936=_0x1aa6a4||client;return _0xff8936[_0xcf8e('0x20')](_0x47854e,_0x10d6f8)[_0xcf8e('0x21')](function(_0x52a97a){logger[_0xcf8e('0x22')](_0xcf8e('0x23'),_0x201a5e,_0xcf8e('0x24'));logger[_0xcf8e('0x25')](_0xcf8e('0x26'),_0x201a5e,_0xcf8e('0x24'),JSON[_0xcf8e('0x27')](_0x52a97a));if(_0x52a97a[_0xcf8e('0x28')]){if(_0x52a97a[_0xcf8e('0x28')]['code']===0x1f4){logger['error'](_0xcf8e('0x23'),_0x201a5e,_0x52a97a[_0xcf8e('0x28')][_0xcf8e('0x29')]);return _0x13ef5a(_0x52a97a[_0xcf8e('0x28')][_0xcf8e('0x29')]);}logger[_0xcf8e('0x28')](_0xcf8e('0x23'),_0x201a5e,_0x52a97a[_0xcf8e('0x28')][_0xcf8e('0x29')]);return _0x1d0c1f(_0x52a97a[_0xcf8e('0x28')][_0xcf8e('0x29')]);}else{logger[_0xcf8e('0x22')]('ChatQueue,\x20%s,\x20%s',_0x201a5e,_0xcf8e('0x24'));_0x1d0c1f(_0x52a97a[_0xcf8e('0x2a')][_0xcf8e('0x29')]);}})[_0xcf8e('0x2b')](function(_0x568d89){logger['error'](_0xcf8e('0x23'),_0x201a5e,_0x568d89);_0x13ef5a(_0x568d89);});});}function respondWithStatusCode(_0x3e27d1,_0x1d4619){_0x1d4619=_0x1d4619||0xcc;return function(_0x5ee9f0){if(_0x5ee9f0){return _0x3e27d1[_0xcf8e('0x2c')](_0x1d4619);}return _0x3e27d1['status'](_0x1d4619)[_0xcf8e('0x2d')]();};}function respondWithResult(_0x5c9561,_0x2c9144){_0x2c9144=_0x2c9144||0xc8;return function(_0x36126c){if(_0x36126c){return _0x5c9561[_0xcf8e('0x2e')](_0x2c9144)[_0xcf8e('0x2f')](_0x36126c);}};}function respondWithFilteredResult(_0xf421f,_0x1c5bea){return function(_0x479a57){if(_0x479a57){var _0x126ff6=_0x479a57[_0xcf8e('0x30')],_0x184720=_0x1c5bea[_0xcf8e('0x31')],_0x44aac9=_0x1c5bea[_0xcf8e('0x31')]+_0x1c5bea[_0xcf8e('0x32')],_0x170e7a;if(_0x44aac9>=_0x126ff6){_0x44aac9=_0x126ff6;_0x170e7a=0xc8;}else{_0x170e7a=0xce;}_0xf421f[_0xcf8e('0x2e')](_0x170e7a);return _0xf421f[_0xcf8e('0x33')](_0xcf8e('0x34'),_0x184720+'-'+_0x44aac9+'/'+_0x126ff6)['json'](_0x479a57);}return null;};}function patchUpdates(_0x2b68a6){return function(_0x58188e){try{jsonpatch[_0xcf8e('0x35')](_0x58188e,_0x2b68a6,!![]);}catch(_0x5c5b43){return BPromise[_0xcf8e('0x36')](_0x5c5b43);}return _0x58188e[_0xcf8e('0x37')]();};}function saveUpdates(_0x20d1d1,_0x23e3e7){return function(_0x4411b9){if(_0x4411b9){return _0x4411b9[_0xcf8e('0x38')](_0x20d1d1)[_0xcf8e('0x21')](function(_0x2f51c8){return _0x2f51c8;});}return null;};}function removeEntity(_0x52087c,_0x19a561){return function(_0x286c08){if(_0x286c08){return _0x286c08['destroy']()[_0xcf8e('0x21')](function(){var _0x5d8da0=_0x286c08['get']({'plain':!![]});var _0x3c3baa=_0xcf8e('0x39');return db['UserProfileResource'][_0xcf8e('0x3a')]({'where':{'type':_0x3c3baa,'resourceId':_0x5d8da0['id']}})[_0xcf8e('0x21')](function(){return _0x286c08;});})[_0xcf8e('0x21')](function(){_0x52087c[_0xcf8e('0x2e')](0xcc)[_0xcf8e('0x2d')]();});}};}function handleEntityNotFound(_0x440093,_0x54de5b){return function(_0x5eea4d){if(!_0x5eea4d){_0x440093[_0xcf8e('0x2c')](0x194);}return _0x5eea4d;};}function handleError(_0x165e6e,_0x52caba){_0x52caba=_0x52caba||0x1f4;return function(_0xbcebf8){logger['error'](_0xbcebf8[_0xcf8e('0x3b')]);if(_0xbcebf8[_0xcf8e('0x3c')]){delete _0xbcebf8[_0xcf8e('0x3c')];}_0x165e6e[_0xcf8e('0x2e')](_0x52caba)[_0xcf8e('0x3d')](_0xbcebf8);};}exports[_0xcf8e('0x3e')]=function(_0x4a6051,_0x4a8c14){var _0x189bd7={},_0x4620ec={},_0x52d457={'count':0x0,'rows':[]};var _0x31cd12=_[_0xcf8e('0x3f')](db[_0xcf8e('0x40')][_0xcf8e('0x41')],function(_0x160acb){return{'name':_0x160acb[_0xcf8e('0x42')],'type':_0x160acb[_0xcf8e('0x43')]['key']};});_0x4620ec[_0xcf8e('0x44')]=_[_0xcf8e('0x3f')](_0x31cd12,_0xcf8e('0x3c'));_0x4620ec[_0xcf8e('0x45')]=_[_0xcf8e('0x46')](_0x4a6051[_0xcf8e('0x45')]);_0x4620ec[_0xcf8e('0x47')]=_[_0xcf8e('0x48')](_0x4620ec[_0xcf8e('0x44')],_0x4620ec[_0xcf8e('0x45')]);_0x189bd7['attributes']=_[_0xcf8e('0x48')](_0x4620ec['model'],qs[_0xcf8e('0x49')](_0x4a6051[_0xcf8e('0x45')][_0xcf8e('0x49')]));_0x189bd7[_0xcf8e('0x4a')]=_0x189bd7[_0xcf8e('0x4a')][_0xcf8e('0x4b')]?_0x189bd7['attributes']:_0x4620ec['model'];if(!_0x4a6051[_0xcf8e('0x45')][_0xcf8e('0x4c')](_0xcf8e('0x4d'))){_0x189bd7[_0xcf8e('0x32')]=qs[_0xcf8e('0x32')](_0x4a6051[_0xcf8e('0x45')][_0xcf8e('0x32')]);_0x189bd7[_0xcf8e('0x31')]=qs[_0xcf8e('0x31')](_0x4a6051[_0xcf8e('0x45')][_0xcf8e('0x31')]);}_0x189bd7[_0xcf8e('0x4e')]=qs[_0xcf8e('0x4f')](_0x4a6051['query'][_0xcf8e('0x4f')]);_0x189bd7[_0xcf8e('0x50')]=qs[_0xcf8e('0x47')](_[_0xcf8e('0x51')](_0x4a6051['query'],_0x4620ec[_0xcf8e('0x47')]),_0x31cd12);if(_0x4a6051['query'][_0xcf8e('0x52')]){_0x189bd7['where']=_[_0xcf8e('0x53')](_0x189bd7[_0xcf8e('0x50')],{'$or':_[_0xcf8e('0x3f')](_0x31cd12,function(_0xe8063e){if(_0xe8063e[_0xcf8e('0x43')]!=='VIRTUAL'){var _0x53a5d5={};_0x53a5d5[_0xe8063e[_0xcf8e('0x3c')]]={'$like':'%'+_0x4a6051['query'][_0xcf8e('0x52')]+'%'};return _0x53a5d5;}})});}_0x189bd7=_['merge']({},_0x189bd7,_0x4a6051['options']);var _0x21935b={'where':_0x189bd7[_0xcf8e('0x50')]};return db[_0xcf8e('0x40')][_0xcf8e('0x30')](_0x21935b)['then'](function(_0x303db4){_0x52d457[_0xcf8e('0x30')]=_0x303db4;if(_0x4a6051[_0xcf8e('0x45')][_0xcf8e('0x54')]){_0x189bd7[_0xcf8e('0x55')]=[{'all':!![]}];}return db[_0xcf8e('0x40')][_0xcf8e('0x56')](_0x189bd7);})[_0xcf8e('0x21')](function(_0x2a5faa){_0x52d457[_0xcf8e('0x57')]=_0x2a5faa;return _0x52d457;})[_0xcf8e('0x21')](respondWithFilteredResult(_0x4a8c14,_0x189bd7))[_0xcf8e('0x2b')](handleError(_0x4a8c14,null));};exports['show']=function(_0x51e0cc,_0x4d46e7){var _0x17d108={'raw':!![],'where':{'id':_0x51e0cc[_0xcf8e('0x58')]['id']}},_0x2b4337={};_0x2b4337['model']=_[_0xcf8e('0x46')](db[_0xcf8e('0x40')]['rawAttributes']);_0x2b4337[_0xcf8e('0x45')]=_[_0xcf8e('0x46')](_0x51e0cc['query']);_0x2b4337[_0xcf8e('0x47')]=_[_0xcf8e('0x48')](_0x2b4337[_0xcf8e('0x44')],_0x2b4337[_0xcf8e('0x45')]);_0x17d108['attributes']=_[_0xcf8e('0x48')](_0x2b4337[_0xcf8e('0x44')],qs[_0xcf8e('0x49')](_0x51e0cc[_0xcf8e('0x45')][_0xcf8e('0x49')]));_0x17d108['attributes']=_0x17d108[_0xcf8e('0x4a')]['length']?_0x17d108[_0xcf8e('0x4a')]:_0x2b4337[_0xcf8e('0x44')];if(_0x51e0cc['query'][_0xcf8e('0x54')]){_0x17d108[_0xcf8e('0x55')]=[{'all':!![]}];}_0x17d108=_['merge']({},_0x17d108,_0x51e0cc['options']);return db[_0xcf8e('0x40')][_0xcf8e('0x59')](_0x17d108)[_0xcf8e('0x21')](handleEntityNotFound(_0x4d46e7,null))[_0xcf8e('0x21')](respondWithResult(_0x4d46e7,null))['catch'](handleError(_0x4d46e7,null));};exports[_0xcf8e('0x5a')]=function(_0x3bde12,_0x16e4b2){return db['ChatQueue']['create'](_0x3bde12[_0xcf8e('0x5b')],{})['then'](function(_0x54d4c8){var _0x418e14=_0x3bde12[_0xcf8e('0x5c')][_0xcf8e('0x5d')]({'plain':!![]});if(!_0x418e14)throw new Error(_0xcf8e('0x5e'));if(_0x418e14[_0xcf8e('0x5f')]===_0xcf8e('0x5c')){var _0x2d1949=_0x54d4c8[_0xcf8e('0x5d')]({'plain':!![]});var _0x3ec9c6=_0xcf8e('0x39');return db[_0xcf8e('0x60')][_0xcf8e('0x59')]({'where':{'name':_0x3ec9c6,'userProfileId':_0x418e14[_0xcf8e('0x61')]},'raw':!![]})[_0xcf8e('0x21')](function(_0x2ec6e3){if(_0x2ec6e3&&_0x2ec6e3[_0xcf8e('0x62')]===0x0){return db[_0xcf8e('0x63')][_0xcf8e('0x5a')]({'name':_0x2d1949[_0xcf8e('0x3c')],'resourceId':_0x2d1949['id'],'type':_0x2ec6e3[_0xcf8e('0x3c')],'sectionId':_0x2ec6e3['id']},{})['then'](function(){return _0x54d4c8;});}else{return _0x54d4c8;}})[_0xcf8e('0x2b')](function(_0x2094a8){logger[_0xcf8e('0x28')](_0xcf8e('0x64'),_0x2094a8);throw _0x2094a8;});}return _0x54d4c8;})[_0xcf8e('0x21')](respondWithResult(_0x16e4b2,0xc9))[_0xcf8e('0x2b')](handleError(_0x16e4b2,null));};exports[_0xcf8e('0x38')]=function(_0x7db42d,_0x25f45f){if(_0x7db42d[_0xcf8e('0x5b')]['id']){delete _0x7db42d['body']['id'];}return db['ChatQueue'][_0xcf8e('0x59')]({'where':{'id':_0x7db42d[_0xcf8e('0x58')]['id']}})[_0xcf8e('0x21')](handleEntityNotFound(_0x25f45f,null))[_0xcf8e('0x21')](saveUpdates(_0x7db42d[_0xcf8e('0x5b')],null))[_0xcf8e('0x21')](respondWithResult(_0x25f45f,null))[_0xcf8e('0x2b')](handleError(_0x25f45f,null));};exports[_0xcf8e('0x3a')]=function(_0x519033,_0x3a6567){return db[_0xcf8e('0x40')][_0xcf8e('0x59')]({'where':{'id':_0x519033['params']['id']}})[_0xcf8e('0x21')](handleEntityNotFound(_0x3a6567,null))[_0xcf8e('0x21')](removeEntity(_0x3a6567,null))['catch'](handleError(_0x3a6567,null));};exports[_0xcf8e('0x65')]=function(_0x1b21ee,_0x5f2a09){return db['ChatQueue'][_0xcf8e('0x65')]()[_0xcf8e('0x21')](respondWithResult(_0x5f2a09,null))[_0xcf8e('0x2b')](handleError(_0x5f2a09,null));};exports[_0xcf8e('0x66')]=function(_0xffe69,_0x585c81,_0x16456f){var _0x4d3c54={'raw':!![],'where':{}},_0x28cee2={},_0x460c0f;return db['ChatQueue'][_0xcf8e('0x67')]({'where':{'id':_0xffe69[_0xcf8e('0x58')]['id']}})[_0xcf8e('0x21')](handleEntityNotFound(_0x585c81,null))[_0xcf8e('0x21')](function(_0x2536e8){if(_0x2536e8){_0x460c0f=_0x2536e8[_0xcf8e('0x5d')]({'plain':!![]});_0x28cee2[_0xcf8e('0x44')]=_[_0xcf8e('0x46')](db[_0xcf8e('0x68')][_0xcf8e('0x41')]);_0x28cee2[_0xcf8e('0x45')]=_['keys'](_0xffe69['query']);_0x28cee2['filters']=_['intersection'](_0x28cee2[_0xcf8e('0x44')],_0x28cee2['query']);_0x4d3c54[_0xcf8e('0x4a')]=_['intersection'](_0x28cee2[_0xcf8e('0x44')],qs['fields'](_0xffe69[_0xcf8e('0x45')][_0xcf8e('0x49')]));_0x4d3c54[_0xcf8e('0x4a')]=_0x4d3c54[_0xcf8e('0x4a')][_0xcf8e('0x4b')]?_0x4d3c54['attributes']:_0x28cee2[_0xcf8e('0x44')];if(!_0xffe69[_0xcf8e('0x45')][_0xcf8e('0x4c')](_0xcf8e('0x4d'))){_0x4d3c54[_0xcf8e('0x32')]=qs[_0xcf8e('0x32')](_0xffe69[_0xcf8e('0x45')][_0xcf8e('0x32')]);_0x4d3c54[_0xcf8e('0x31')]=qs[_0xcf8e('0x31')](_0xffe69['query'][_0xcf8e('0x31')]);}_0x4d3c54[_0xcf8e('0x4e')]=qs[_0xcf8e('0x4f')](_0xffe69[_0xcf8e('0x45')][_0xcf8e('0x4f')]);_0x4d3c54[_0xcf8e('0x50')]=qs[_0xcf8e('0x47')](_['pick'](_0xffe69[_0xcf8e('0x45')],_0x28cee2[_0xcf8e('0x47')]));_0x4d3c54[_0xcf8e('0x50')][_0xcf8e('0x69')]=_0x2536e8['id'];if(_0xffe69[_0xcf8e('0x45')]['filter']){_0x4d3c54['where']=_[_0xcf8e('0x53')](_0x4d3c54['where'],{'$or':_[_0xcf8e('0x3f')](_0x4d3c54[_0xcf8e('0x4a')],function(_0x2b02f9){var _0x49c864={};_0x49c864[_0x2b02f9]={'$like':'%'+_0xffe69[_0xcf8e('0x45')]['filter']+'%'};return _0x49c864;})});}_0x4d3c54=_[_0xcf8e('0x53')]({},_0x4d3c54,_0xffe69['options']);return db['UserChatQueue'][_0xcf8e('0x56')](_0x4d3c54);}})[_0xcf8e('0x21')](function(_0x49a194){if(_0x49a194){return db[_0xcf8e('0x6a')][_0xcf8e('0x6b')]({'where':{'id':_['map'](_0x49a194,_0xcf8e('0x6c')),'role':_0xcf8e('0x6d')},'attributes':['id',_0xcf8e('0x3c'),_0xcf8e('0x6e'),_0xcf8e('0x6f'),_0xcf8e('0x70')]});}})[_0xcf8e('0x21')](function(_0x1506b7){if(_0x1506b7){return{'count':_0x1506b7['count'],'rows':_[_0xcf8e('0x3f')](_0x1506b7['rows'],function(_0x15e4be){return{'membername':_0x15e4be[_0xcf8e('0x3c')],'UserId':_0x15e4be['id'],'queue_name':_0x460c0f[_0xcf8e('0x3c')],'ChatQueueId':_0x460c0f['id'],'interface':util[_0xcf8e('0x71')]('%s/%s',_0xcf8e('0x72'),_0x15e4be[_0xcf8e('0x3c')]),'penalty':0x0,'paused':_0x15e4be[_0xcf8e('0x6e')],'createdAt':_0x15e4be['createdAt'],'updatedAt':_0x15e4be['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xcf8e('0x21')](respondWithFilteredResult(_0x585c81,_0x4d3c54))['catch'](handleError(_0x585c81,null));};exports[_0xcf8e('0x73')]=function(_0x5505d7,_0x45056e,_0x5e664f){var _0x22c0e2={};var _0x1f051c={};var _0x2521aa;var _0x3b4bbd;return db[_0xcf8e('0x40')][_0xcf8e('0x67')]({'where':{'id':_0x5505d7[_0xcf8e('0x58')]['id']}})[_0xcf8e('0x21')](handleEntityNotFound(_0x45056e,null))[_0xcf8e('0x21')](function(_0x15d72f){if(_0x15d72f){_0x2521aa=_0x15d72f;_0x1f051c[_0xcf8e('0x44')]=_[_0xcf8e('0x46')](db['Team']['rawAttributes']);_0x1f051c[_0xcf8e('0x45')]=_[_0xcf8e('0x46')](_0x5505d7[_0xcf8e('0x45')]);_0x1f051c[_0xcf8e('0x47')]=_[_0xcf8e('0x48')](_0x1f051c[_0xcf8e('0x44')],_0x1f051c[_0xcf8e('0x45')]);_0x22c0e2[_0xcf8e('0x4a')]=_['intersection'](_0x1f051c[_0xcf8e('0x44')],qs['fields'](_0x5505d7['query'][_0xcf8e('0x49')]));_0x22c0e2[_0xcf8e('0x4a')]=_0x22c0e2[_0xcf8e('0x4a')]['length']?_0x22c0e2[_0xcf8e('0x4a')]:_0x1f051c[_0xcf8e('0x44')];_0x22c0e2[_0xcf8e('0x4e')]=qs[_0xcf8e('0x4f')](_0x5505d7[_0xcf8e('0x45')][_0xcf8e('0x4f')]);_0x22c0e2[_0xcf8e('0x50')]=qs[_0xcf8e('0x47')](_[_0xcf8e('0x51')](_0x5505d7[_0xcf8e('0x45')],_0x1f051c['filters']));if(_0x5505d7['query'][_0xcf8e('0x52')]){_0x22c0e2[_0xcf8e('0x50')]=_[_0xcf8e('0x53')](_0x22c0e2['where'],{'$or':_[_0xcf8e('0x3f')](_0x22c0e2[_0xcf8e('0x4a')],function(_0x172908){var _0x305703={};_0x305703[_0x172908]={'$like':'%'+_0x5505d7[_0xcf8e('0x45')][_0xcf8e('0x52')]+'%'};return _0x305703;})});}_0x22c0e2=_[_0xcf8e('0x53')]({},_0x22c0e2,_0x5505d7[_0xcf8e('0x74')]);return _0x2521aa[_0xcf8e('0x73')](_0x22c0e2);}})[_0xcf8e('0x21')](function(_0x2f8782){if(_0x2f8782){_0x3b4bbd=_0x2f8782[_0xcf8e('0x4b')];if(!_0x5505d7['query'][_0xcf8e('0x4c')](_0xcf8e('0x4d'))){_0x22c0e2[_0xcf8e('0x32')]=qs[_0xcf8e('0x32')](_0x5505d7['query'][_0xcf8e('0x32')]);_0x22c0e2[_0xcf8e('0x31')]=qs[_0xcf8e('0x31')](_0x5505d7['query'][_0xcf8e('0x31')]);}return _0x2521aa[_0xcf8e('0x73')](_0x22c0e2);}})['then'](function(_0x423058){if(_0x423058){return _0x423058?{'count':_0x3b4bbd,'rows':_0x423058}:null;}})[_0xcf8e('0x21')](respondWithResult(_0x45056e,null))[_0xcf8e('0x2b')](handleError(_0x45056e,null));};exports[_0xcf8e('0x75')]=function(_0x8daf3,_0x1a8be5,_0x1aeb58){var _0x420efc=_0x8daf3[_0xcf8e('0x5b')][_0xcf8e('0x76')];return db['Team']['findAll']({'where':{'id':_0x420efc},'attributes':['id'],'include':[{'model':db[_0xcf8e('0x6a')],'as':'Agents','attributes':['id','name',_0xcf8e('0x77'),_0xcf8e('0x78'),_0xcf8e('0x79')],'raw':!![]}]})[_0xcf8e('0x21')](function(_0x3834ae){if(_0x3834ae){var _0x2eb9f9=_[_0xcf8e('0x7a')](_0x3834ae,function(_0x37b02e){var _0x303df9=_0x37b02e[_0xcf8e('0x5d')]({'plain':!![]});return _0x303df9[_0xcf8e('0x7b')];});return db[_0xcf8e('0x40')][_0xcf8e('0x59')]({'where':{'id':_0x8daf3[_0xcf8e('0x58')]['id']}})[_0xcf8e('0x21')](function(_0x3ef37c){return db[_0xcf8e('0x7c')]['transaction'](function(_0x2da733){return _0x3ef37c[_0xcf8e('0x75')](_0x420efc,{'transaction':_0x2da733})[_0xcf8e('0x21')](function(){return BPromise[_0xcf8e('0x7d')](_0x2eb9f9,function(_0x217fd6){return db[_0xcf8e('0x68')][_0xcf8e('0x7e')]({'where':{'UserId':_0x217fd6['id'],'ChatQueueId':_0x8daf3[_0xcf8e('0x58')]['id']},'transaction':_0x2da733});});})[_0xcf8e('0x21')](function(){_0x2eb9f9[_0xcf8e('0x7f')](function(_0x2be106){socket[_0xcf8e('0x80')](_0xcf8e('0x81'),{'UserId':_0x2be106['id'],'ChatQueueId':_0x3ef37c['id']});});});});});}})[_0xcf8e('0x21')](respondWithStatusCode(_0x1a8be5,null))[_0xcf8e('0x2b')](handleError(_0x1a8be5,null));};exports[_0xcf8e('0x82')]=function(_0x42d47c,_0x98404f,_0x5bfe06){return db['Team'][_0xcf8e('0x56')]({'where':{'id':_0x42d47c[_0xcf8e('0x45')][_0xcf8e('0x76')]},'attributes':['id'],'include':[{'model':db[_0xcf8e('0x6a')],'as':_0xcf8e('0x7b'),'attributes':['id'],'raw':!![]}]})[_0xcf8e('0x21')](handleEntityNotFound(_0x98404f,null))['then'](function(_0x4aef0e){var _0x5edb43=_[_0xcf8e('0x3f')](_0x4aef0e,'id');var _0x22d8d8=[];var _0x2a383f=[];var _0x57afc9=squel[_0xcf8e('0x83')]();_0x57afc9[_0xcf8e('0x84')](_0xcf8e('0x85'))['from']('team_has_chat_queues','tq')['join'](_0xcf8e('0x86'),'ut',_0xcf8e('0x87'))['where'](_0xcf8e('0x88'),_0x42d47c[_0xcf8e('0x58')]['id']);for(var _0x9efdcb=0x0;_0x9efdcb<_0x4aef0e['length'];_0x9efdcb+=0x1){let _0x1fa66f=_0x4aef0e[_0x9efdcb];for(var _0x4f8b0f=0x0;_0x4f8b0f<_0x1fa66f[_0xcf8e('0x7b')][_0xcf8e('0x4b')];_0x4f8b0f+=0x1){let _0x398121=_0x1fa66f['Agents'][_0x4f8b0f];var _0x173f5f=_0x57afc9[_0xcf8e('0x89')]();_0x173f5f[_0xcf8e('0x50')]('ut.UserId\x20=\x20?',_0x398121['id']);_0x2a383f[_0xcf8e('0x8a')](db[_0xcf8e('0x7c')]['query'](_0x173f5f[_0xcf8e('0x8b')](),{'type':db[_0xcf8e('0x7c')][_0xcf8e('0x8c')][_0xcf8e('0x8d')]})[_0xcf8e('0x21')](function(_0x45c647){if(_0x45c647[_0xcf8e('0x4b')]===0x1){return _0x398121['id'];}else{var _0x460467=_['every'](_['map'](_0x45c647,_0xcf8e('0x8e')),function(_0x4e5713){return _[_0xcf8e('0x8f')](_0x5edb43,_0x4e5713);});if(_0x460467){return _0x398121['id'];}}}));}}return BPromise[_0xcf8e('0x90')](_0x2a383f)[_0xcf8e('0x21')](function(_0x20a242){_0x22d8d8=_(_0x22d8d8)[_0xcf8e('0x91')](_0x20a242)[_0xcf8e('0x92')]()['value']();return db[_0xcf8e('0x40')][_0xcf8e('0x59')]({'where':{'id':_0x42d47c[_0xcf8e('0x58')]['id']}})[_0xcf8e('0x21')](function(_0x1bc7ce){return db['sequelize'][_0xcf8e('0x93')](function(_0xd01ee0){return _0x1bc7ce[_0xcf8e('0x82')](_0x42d47c[_0xcf8e('0x45')][_0xcf8e('0x76')],{'transaction':_0xd01ee0})[_0xcf8e('0x21')](function(){if(!_['isEmpty'](_0x22d8d8)){return _0x1bc7ce['removeAgents'](_0x22d8d8,{'transaction':_0xd01ee0});}})['then'](function(){_0x22d8d8['forEach'](function(_0x527243){socket[_0xcf8e('0x80')](_0xcf8e('0x94'),{'UserId':_0x527243,'ChatQueueId':_0x1bc7ce['id']});});});});});});})[_0xcf8e('0x21')](respondWithStatusCode(_0x98404f,null))[_0xcf8e('0x2b')](handleError(_0x98404f,null));};exports[_0xcf8e('0x95')]=function(_0x138a9e,_0x476206,_0x7c094b){return db[_0xcf8e('0x40')]['find']({'where':{'id':_0x138a9e[_0xcf8e('0x58')]['id']}})[_0xcf8e('0x21')](handleEntityNotFound(_0x476206,null))[_0xcf8e('0x21')](function(_0x25d9ff){if(_0x25d9ff){return _0x25d9ff[_0xcf8e('0x95')](_0x138a9e[_0xcf8e('0x5b')][_0xcf8e('0x76')],_[_0xcf8e('0x96')](_0x138a9e[_0xcf8e('0x5b')],[_0xcf8e('0x76'),'id'])||{})[_0xcf8e('0x97')](function(_0x2f86b7){for(var _0x4c816b=0x0;_0x4c816b<_0x138a9e[_0xcf8e('0x5b')][_0xcf8e('0x76')]['length'];_0x4c816b+=0x1){socket[_0xcf8e('0x80')](_0xcf8e('0x81'),{'UserId':_0x138a9e[_0xcf8e('0x5b')][_0xcf8e('0x76')][_0x4c816b],'ChatQueueId':_0x138a9e[_0xcf8e('0x58')]['id']});}return _0x2f86b7;});}})[_0xcf8e('0x21')](respondWithResult(_0x476206,null))[_0xcf8e('0x2b')](handleError(_0x476206,null));};exports['removeAgents']=function(_0x305bf2,_0x43f4cb,_0x39b12b){return db[_0xcf8e('0x40')][_0xcf8e('0x59')]({'where':{'id':_0x305bf2[_0xcf8e('0x58')]['id']}})['then'](handleEntityNotFound(_0x43f4cb,null))[_0xcf8e('0x21')](function(_0x3af5e7){if(_0x3af5e7){return _0x3af5e7[_0xcf8e('0x98')](_0x305bf2[_0xcf8e('0x45')][_0xcf8e('0x76')])['then'](function(){if(_['isArray'](_0x305bf2[_0xcf8e('0x45')][_0xcf8e('0x76')])){for(var _0x5947cd=0x0;_0x5947cd<_0x305bf2[_0xcf8e('0x45')]['ids']['length'];_0x5947cd+=0x1){socket[_0xcf8e('0x80')]('userChatQueue:remove',{'UserId':Number(_0x305bf2[_0xcf8e('0x45')]['ids'][_0x5947cd]),'ChatQueueId':Number(_0x305bf2[_0xcf8e('0x58')]['id'])});}}else{socket['emit'](_0xcf8e('0x94'),{'UserId':Number(_0x305bf2['query'][_0xcf8e('0x76')]),'ChatQueueId':Number(_0x305bf2[_0xcf8e('0x58')]['id'])});}});}})[_0xcf8e('0x21')](respondWithStatusCode(_0x43f4cb,null))['catch'](handleError(_0x43f4cb,null));};exports[_0xcf8e('0x99')]=function(_0x4a790a,_0x377a46,_0x14faa6){var _0x5a2255={};var _0x1061a={};var _0x2b6db4;var _0x56feeb;return db[_0xcf8e('0x40')][_0xcf8e('0x67')]({'where':{'id':_0x4a790a[_0xcf8e('0x58')]['id']}})['then'](handleEntityNotFound(_0x377a46,null))[_0xcf8e('0x21')](function(_0x42d533){if(_0x42d533){_0x2b6db4=_0x42d533;_0x1061a['model']=_['keys'](db[_0xcf8e('0x6a')]['rawAttributes']);_0x1061a[_0xcf8e('0x45')]=_[_0xcf8e('0x46')](_0x4a790a['query']);_0x1061a[_0xcf8e('0x47')]=_[_0xcf8e('0x48')](_0x1061a['model'],_0x1061a['query']);_0x5a2255['attributes']=_[_0xcf8e('0x48')](_0x1061a[_0xcf8e('0x44')],qs['fields'](_0x4a790a[_0xcf8e('0x45')]['fields']));_0x5a2255[_0xcf8e('0x4a')]=_0x5a2255['attributes'][_0xcf8e('0x4b')]?_0x5a2255[_0xcf8e('0x4a')]:_0x1061a[_0xcf8e('0x44')];_0x5a2255[_0xcf8e('0x4e')]=qs['sort'](_0x4a790a['query']['sort']);_0x5a2255[_0xcf8e('0x50')]=qs[_0xcf8e('0x47')](_['pick'](_0x4a790a[_0xcf8e('0x45')],_0x1061a[_0xcf8e('0x47')]));if(_0x4a790a['query']['filter']){_0x5a2255[_0xcf8e('0x50')]=_[_0xcf8e('0x53')](_0x5a2255[_0xcf8e('0x50')],{'$or':_[_0xcf8e('0x3f')](_0x5a2255[_0xcf8e('0x4a')],function(_0x4a7502){var _0x1be0b4={};_0x1be0b4[_0x4a7502]={'$like':'%'+_0x4a790a[_0xcf8e('0x45')][_0xcf8e('0x52')]+'%'};return _0x1be0b4;})});}_0x5a2255=_[_0xcf8e('0x53')]({},_0x5a2255,_0x4a790a[_0xcf8e('0x74')]);return _0x2b6db4[_0xcf8e('0x99')](_0x5a2255);}})[_0xcf8e('0x21')](function(_0x30c972){if(_0x30c972){_0x56feeb=_0x30c972[_0xcf8e('0x4b')];if(!_0x4a790a[_0xcf8e('0x45')]['hasOwnProperty']('nolimit')){_0x5a2255[_0xcf8e('0x32')]=qs[_0xcf8e('0x32')](_0x4a790a[_0xcf8e('0x45')][_0xcf8e('0x32')]);_0x5a2255[_0xcf8e('0x31')]=qs[_0xcf8e('0x31')](_0x4a790a[_0xcf8e('0x45')]['offset']);}return _0x2b6db4['getAgents'](_0x5a2255);}})[_0xcf8e('0x21')](function(_0x411499){if(_0x411499){return _0x411499?{'count':_0x56feeb,'rows':_0x411499}:null;}})['then'](respondWithResult(_0x377a46,null))[_0xcf8e('0x2b')](handleError(_0x377a46,null));};
\ No newline at end of file
+var _0xeff7=['then','get','ChatQueues','stack','send','index','map','ChatQueue','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','findAll','UserId','chatPause','createdAt','format','%s/%s','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','test','Sequelize','ValidationError','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xeff7,0x1a5));var _0x7eff=function(_0x525255,_0x310fad){_0x525255=_0x525255-0x0;var _0x1de3cb=_0xeff7[_0x525255];return _0x1de3cb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7eff('0x0'));var rimraf=require(_0x7eff('0x1'));var zipdir=require(_0x7eff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7eff('0x3'));var moment=require(_0x7eff('0x4'));var BPromise=require(_0x7eff('0x5'));var Mustache=require(_0x7eff('0x6'));var util=require(_0x7eff('0x7'));var path=require(_0x7eff('0x8'));var sox=require(_0x7eff('0x9'));var csv=require(_0x7eff('0xa'));var ejs=require(_0x7eff('0xb'));var fs=require('fs');var _=require(_0x7eff('0xc'));var squel=require(_0x7eff('0xd'));var crypto=require(_0x7eff('0xe'));var jsforce=require(_0x7eff('0xf'));var deskjs=require(_0x7eff('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7eff('0x11'));var Redis=require(_0x7eff('0x12'));var authService=require(_0x7eff('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7eff('0x14'));var hardwareService=require(_0x7eff('0x15'));var logger=require(_0x7eff('0x16'))('api');var utils=require(_0x7eff('0x17'));var config=require(_0x7eff('0x18'));var db=require(_0x7eff('0x19'))['db'];config[_0x7eff('0x1a')]=_[_0x7eff('0x1b')](config[_0x7eff('0x1a')],{'host':_0x7eff('0x1c'),'port':0x18eb});var socket=require(_0x7eff('0x1d'))(new Redis(config[_0x7eff('0x1a')]));require('./chatQueue.socket')[_0x7eff('0x1e')](socket);var jayson=require(_0x7eff('0x1f'));var client=jayson['client'][_0x7eff('0x20')]({'port':0x232a});function checkPasswordPattern(_0x19885a,_0x827078,_0x10d5a2){if(_0x10d5a2){var _0xf25cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf25cc[_0x7eff('0x21')](_0x827078)){return _0x19885a;}else{throw new db[(_0x7eff('0x22'))][(_0x7eff('0x23'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x19885a;}}function respondWithRpcPromise(_0x54d60d,_0x19112d,_0x6061a1,_0xd0de16){return new BPromise(function(_0xbe05c6,_0x44e8e5){var _0x102b71=_0xd0de16||client;return _0x102b71[_0x7eff('0x24')](_0x54d60d,_0x6061a1)['then'](function(_0x20eb1a){logger[_0x7eff('0x25')](_0x7eff('0x26'),_0x19112d,_0x7eff('0x27'));logger['debug'](_0x7eff('0x28'),_0x19112d,_0x7eff('0x27'),JSON[_0x7eff('0x29')](_0x20eb1a));if(_0x20eb1a[_0x7eff('0x2a')]){if(_0x20eb1a['error']['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x19112d,_0x20eb1a[_0x7eff('0x2a')]['message']);return _0x44e8e5(_0x20eb1a[_0x7eff('0x2a')][_0x7eff('0x2b')]);}logger[_0x7eff('0x2a')](_0x7eff('0x26'),_0x19112d,_0x20eb1a[_0x7eff('0x2a')][_0x7eff('0x2b')]);return _0xbe05c6(_0x20eb1a[_0x7eff('0x2a')]['message']);}else{logger[_0x7eff('0x25')](_0x7eff('0x26'),_0x19112d,'request\x20sent');_0xbe05c6(_0x20eb1a[_0x7eff('0x2c')]['message']);}})[_0x7eff('0x2d')](function(_0x2d45ec){logger[_0x7eff('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x19112d,_0x2d45ec);_0x44e8e5(_0x2d45ec);});});}function respondWithStatusCode(_0x240ae2,_0x28c679){_0x28c679=_0x28c679||0xcc;return function(_0x22010b){if(_0x22010b){return _0x240ae2[_0x7eff('0x2e')](_0x28c679);}return _0x240ae2[_0x7eff('0x2f')](_0x28c679)[_0x7eff('0x30')]();};}function respondWithResult(_0x3129f2,_0x5947fe){_0x5947fe=_0x5947fe||0xc8;return function(_0x25d4f8){if(_0x25d4f8){return _0x3129f2[_0x7eff('0x2f')](_0x5947fe)[_0x7eff('0x31')](_0x25d4f8);}};}function respondWithFilteredResult(_0x7e86ed,_0x3465de){return function(_0x3013b8){if(_0x3013b8){var _0x543087=_0x3013b8[_0x7eff('0x32')],_0x422f13=_0x3465de[_0x7eff('0x33')],_0x37aa47=_0x3465de[_0x7eff('0x33')]+_0x3465de[_0x7eff('0x34')],_0x4fd3a8;if(_0x37aa47>=_0x543087){_0x37aa47=_0x543087;_0x4fd3a8=0xc8;}else{_0x4fd3a8=0xce;}_0x7e86ed[_0x7eff('0x2f')](_0x4fd3a8);return _0x7e86ed[_0x7eff('0x35')](_0x7eff('0x36'),_0x422f13+'-'+_0x37aa47+'/'+_0x543087)[_0x7eff('0x31')](_0x3013b8);}return null;};}function patchUpdates(_0x4f5106){return function(_0x55fea7){try{jsonpatch[_0x7eff('0x37')](_0x55fea7,_0x4f5106,!![]);}catch(_0x1475ab){return BPromise[_0x7eff('0x38')](_0x1475ab);}return _0x55fea7[_0x7eff('0x39')]();};}function saveUpdates(_0x24d598,_0x378362){return function(_0x2efe42){if(_0x2efe42){return _0x2efe42['update'](_0x24d598)['then'](function(_0x562d21){return _0x562d21;});}return null;};}function removeEntity(_0x10cc42,_0x289920){return function(_0x15770a){if(_0x15770a){return _0x15770a[_0x7eff('0x3a')]()[_0x7eff('0x3b')](function(){var _0x27cfa4=_0x15770a[_0x7eff('0x3c')]({'plain':!![]});var _0x197f2d=_0x7eff('0x3d');return db['UserProfileResource'][_0x7eff('0x3a')]({'where':{'type':_0x197f2d,'resourceId':_0x27cfa4['id']}})[_0x7eff('0x3b')](function(){return _0x15770a;});})[_0x7eff('0x3b')](function(){_0x10cc42[_0x7eff('0x2f')](0xcc)[_0x7eff('0x30')]();});}};}function handleEntityNotFound(_0x320f86,_0x3451c5){return function(_0x592954){if(!_0x592954){_0x320f86[_0x7eff('0x2e')](0x194);}return _0x592954;};}function handleError(_0x5837cd,_0x20e4b4){_0x20e4b4=_0x20e4b4||0x1f4;return function(_0x48fc4d){logger['error'](_0x48fc4d[_0x7eff('0x3e')]);if(_0x48fc4d['name']){delete _0x48fc4d['name'];}_0x5837cd[_0x7eff('0x2f')](_0x20e4b4)[_0x7eff('0x3f')](_0x48fc4d);};}exports[_0x7eff('0x40')]=function(_0x4566bc,_0x5d6170){var _0x485561={},_0x2b537b={},_0x325ea0={'count':0x0,'rows':[]};var _0x37e303=_[_0x7eff('0x41')](db[_0x7eff('0x42')]['rawAttributes'],function(_0x349f48){return{'name':_0x349f48['fieldName'],'type':_0x349f48[_0x7eff('0x43')][_0x7eff('0x44')]};});_0x2b537b[_0x7eff('0x45')]=_['map'](_0x37e303,_0x7eff('0x46'));_0x2b537b[_0x7eff('0x47')]=_[_0x7eff('0x48')](_0x4566bc[_0x7eff('0x47')]);_0x2b537b[_0x7eff('0x49')]=_[_0x7eff('0x4a')](_0x2b537b[_0x7eff('0x45')],_0x2b537b[_0x7eff('0x47')]);_0x485561[_0x7eff('0x4b')]=_[_0x7eff('0x4a')](_0x2b537b[_0x7eff('0x45')],qs[_0x7eff('0x4c')](_0x4566bc[_0x7eff('0x47')][_0x7eff('0x4c')]));_0x485561[_0x7eff('0x4b')]=_0x485561[_0x7eff('0x4b')][_0x7eff('0x4d')]?_0x485561['attributes']:_0x2b537b['model'];if(!_0x4566bc[_0x7eff('0x47')]['hasOwnProperty'](_0x7eff('0x4e'))){_0x485561['limit']=qs[_0x7eff('0x34')](_0x4566bc[_0x7eff('0x47')][_0x7eff('0x34')]);_0x485561[_0x7eff('0x33')]=qs['offset'](_0x4566bc[_0x7eff('0x47')][_0x7eff('0x33')]);}_0x485561[_0x7eff('0x4f')]=qs[_0x7eff('0x50')](_0x4566bc[_0x7eff('0x47')][_0x7eff('0x50')]);_0x485561[_0x7eff('0x51')]=qs[_0x7eff('0x49')](_[_0x7eff('0x52')](_0x4566bc[_0x7eff('0x47')],_0x2b537b[_0x7eff('0x49')]),_0x37e303);if(_0x4566bc[_0x7eff('0x47')][_0x7eff('0x53')]){_0x485561[_0x7eff('0x51')]=_['merge'](_0x485561['where'],{'$or':_['map'](_0x37e303,function(_0x317949){if(_0x317949['type']!==_0x7eff('0x54')){var _0x26cc3b={};_0x26cc3b[_0x317949[_0x7eff('0x46')]]={'$like':'%'+_0x4566bc['query'][_0x7eff('0x53')]+'%'};return _0x26cc3b;}})});}_0x485561=_[_0x7eff('0x55')]({},_0x485561,_0x4566bc[_0x7eff('0x56')]);var _0x422bc7={'where':_0x485561[_0x7eff('0x51')]};return db[_0x7eff('0x42')][_0x7eff('0x32')](_0x422bc7)[_0x7eff('0x3b')](function(_0x4594dc){_0x325ea0[_0x7eff('0x32')]=_0x4594dc;if(_0x4566bc[_0x7eff('0x47')][_0x7eff('0x57')]){_0x485561['include']=[{'all':!![]}];}return db[_0x7eff('0x42')]['findAll'](_0x485561);})[_0x7eff('0x3b')](function(_0xf0f9b4){_0x325ea0[_0x7eff('0x58')]=_0xf0f9b4;return _0x325ea0;})[_0x7eff('0x3b')](respondWithFilteredResult(_0x5d6170,_0x485561))[_0x7eff('0x2d')](handleError(_0x5d6170,null));};exports['show']=function(_0x38695a,_0x52cc92){var _0x720d87={'raw':!![],'where':{'id':_0x38695a['params']['id']}},_0x5ae5d0={};_0x5ae5d0[_0x7eff('0x45')]=_[_0x7eff('0x48')](db[_0x7eff('0x42')][_0x7eff('0x59')]);_0x5ae5d0[_0x7eff('0x47')]=_[_0x7eff('0x48')](_0x38695a['query']);_0x5ae5d0[_0x7eff('0x49')]=_[_0x7eff('0x4a')](_0x5ae5d0[_0x7eff('0x45')],_0x5ae5d0['query']);_0x720d87[_0x7eff('0x4b')]=_[_0x7eff('0x4a')](_0x5ae5d0[_0x7eff('0x45')],qs['fields'](_0x38695a[_0x7eff('0x47')]['fields']));_0x720d87['attributes']=_0x720d87[_0x7eff('0x4b')][_0x7eff('0x4d')]?_0x720d87[_0x7eff('0x4b')]:_0x5ae5d0[_0x7eff('0x45')];if(_0x38695a['query']['includeAll']){_0x720d87[_0x7eff('0x5a')]=[{'all':!![]}];}_0x720d87=_[_0x7eff('0x55')]({},_0x720d87,_0x38695a[_0x7eff('0x56')]);return db[_0x7eff('0x42')][_0x7eff('0x5b')](_0x720d87)[_0x7eff('0x3b')](handleEntityNotFound(_0x52cc92,null))['then'](respondWithResult(_0x52cc92,null))[_0x7eff('0x2d')](handleError(_0x52cc92,null));};exports[_0x7eff('0x5c')]=function(_0x9acab,_0x96fd95){return db[_0x7eff('0x42')][_0x7eff('0x5c')](_0x9acab[_0x7eff('0x5d')],{})[_0x7eff('0x3b')](function(_0x5aaff9){var _0x2adb52=_0x9acab[_0x7eff('0x5e')]['get']({'plain':!![]});if(!_0x2adb52)throw new Error(_0x7eff('0x5f'));if(_0x2adb52['role']===_0x7eff('0x5e')){var _0x14eb03=_0x5aaff9[_0x7eff('0x3c')]({'plain':!![]});var _0x4901c6=_0x7eff('0x3d');return db[_0x7eff('0x60')][_0x7eff('0x5b')]({'where':{'name':_0x4901c6,'userProfileId':_0x2adb52[_0x7eff('0x61')]},'raw':!![]})[_0x7eff('0x3b')](function(_0x372686){if(_0x372686&&_0x372686[_0x7eff('0x62')]===0x0){return db[_0x7eff('0x63')]['create']({'name':_0x14eb03[_0x7eff('0x46')],'resourceId':_0x14eb03['id'],'type':_0x372686['name'],'sectionId':_0x372686['id']},{})[_0x7eff('0x3b')](function(){return _0x5aaff9;});}else{return _0x5aaff9;}})[_0x7eff('0x2d')](function(_0x1da6cd){logger[_0x7eff('0x2a')](_0x7eff('0x64'),_0x1da6cd);throw _0x1da6cd;});}return _0x5aaff9;})[_0x7eff('0x3b')](respondWithResult(_0x96fd95,0xc9))[_0x7eff('0x2d')](handleError(_0x96fd95,null));};exports[_0x7eff('0x65')]=function(_0x5d7c31,_0x249142){if(_0x5d7c31['body']['id']){delete _0x5d7c31[_0x7eff('0x5d')]['id'];}return db[_0x7eff('0x42')][_0x7eff('0x5b')]({'where':{'id':_0x5d7c31[_0x7eff('0x66')]['id']}})[_0x7eff('0x3b')](handleEntityNotFound(_0x249142,null))[_0x7eff('0x3b')](saveUpdates(_0x5d7c31['body'],null))[_0x7eff('0x3b')](respondWithResult(_0x249142,null))[_0x7eff('0x2d')](handleError(_0x249142,null));};exports[_0x7eff('0x3a')]=function(_0x5a0c06,_0x3cf507){return db[_0x7eff('0x42')][_0x7eff('0x5b')]({'where':{'id':_0x5a0c06[_0x7eff('0x66')]['id']}})[_0x7eff('0x3b')](handleEntityNotFound(_0x3cf507,null))['then'](removeEntity(_0x3cf507,null))[_0x7eff('0x2d')](handleError(_0x3cf507,null));};exports['describe']=function(_0xa674c0,_0x516565){return db[_0x7eff('0x42')][_0x7eff('0x67')]()[_0x7eff('0x3b')](respondWithResult(_0x516565,null))[_0x7eff('0x2d')](handleError(_0x516565,null));};exports[_0x7eff('0x68')]=function(_0x3d33b5,_0x398cf7,_0x76da52){var _0x1e82c6={'raw':!![],'where':{}},_0x1cd1b1={},_0xb05dc1;return db[_0x7eff('0x42')][_0x7eff('0x69')]({'where':{'id':_0x3d33b5['params']['id']}})['then'](handleEntityNotFound(_0x398cf7,null))[_0x7eff('0x3b')](function(_0x5bd546){if(_0x5bd546){_0xb05dc1=_0x5bd546[_0x7eff('0x3c')]({'plain':!![]});_0x1cd1b1[_0x7eff('0x45')]=_[_0x7eff('0x48')](db[_0x7eff('0x6a')]['rawAttributes']);_0x1cd1b1[_0x7eff('0x47')]=_[_0x7eff('0x48')](_0x3d33b5[_0x7eff('0x47')]);_0x1cd1b1[_0x7eff('0x49')]=_[_0x7eff('0x4a')](_0x1cd1b1[_0x7eff('0x45')],_0x1cd1b1[_0x7eff('0x47')]);_0x1e82c6[_0x7eff('0x4b')]=_[_0x7eff('0x4a')](_0x1cd1b1[_0x7eff('0x45')],qs[_0x7eff('0x4c')](_0x3d33b5[_0x7eff('0x47')][_0x7eff('0x4c')]));_0x1e82c6['attributes']=_0x1e82c6[_0x7eff('0x4b')][_0x7eff('0x4d')]?_0x1e82c6[_0x7eff('0x4b')]:_0x1cd1b1[_0x7eff('0x45')];if(!_0x3d33b5[_0x7eff('0x47')][_0x7eff('0x6b')](_0x7eff('0x4e'))){_0x1e82c6[_0x7eff('0x34')]=qs[_0x7eff('0x34')](_0x3d33b5['query'][_0x7eff('0x34')]);_0x1e82c6[_0x7eff('0x33')]=qs[_0x7eff('0x33')](_0x3d33b5[_0x7eff('0x47')][_0x7eff('0x33')]);}_0x1e82c6[_0x7eff('0x4f')]=qs['sort'](_0x3d33b5['query']['sort']);_0x1e82c6[_0x7eff('0x51')]=qs[_0x7eff('0x49')](_['pick'](_0x3d33b5[_0x7eff('0x47')],_0x1cd1b1[_0x7eff('0x49')]));_0x1e82c6[_0x7eff('0x51')][_0x7eff('0x6c')]=_0x5bd546['id'];if(_0x3d33b5[_0x7eff('0x47')][_0x7eff('0x53')]){_0x1e82c6[_0x7eff('0x51')]=_[_0x7eff('0x55')](_0x1e82c6[_0x7eff('0x51')],{'$or':_[_0x7eff('0x41')](_0x1e82c6[_0x7eff('0x4b')],function(_0xc811b1){var _0x5c2420={};_0x5c2420[_0xc811b1]={'$like':'%'+_0x3d33b5['query'][_0x7eff('0x53')]+'%'};return _0x5c2420;})});}_0x1e82c6=_['merge']({},_0x1e82c6,_0x3d33b5[_0x7eff('0x56')]);return db[_0x7eff('0x6a')][_0x7eff('0x6d')](_0x1e82c6);}})[_0x7eff('0x3b')](function(_0x4d65b3){if(_0x4d65b3){return db['User']['findAndCountAll']({'where':{'id':_[_0x7eff('0x41')](_0x4d65b3,_0x7eff('0x6e')),'role':'agent'},'attributes':['id','name',_0x7eff('0x6f'),'updatedAt',_0x7eff('0x70')]});}})[_0x7eff('0x3b')](function(_0x2484c0){if(_0x2484c0){return{'count':_0x2484c0[_0x7eff('0x32')],'rows':_[_0x7eff('0x41')](_0x2484c0[_0x7eff('0x58')],function(_0x536afd){return{'membername':_0x536afd[_0x7eff('0x46')],'UserId':_0x536afd['id'],'queue_name':_0xb05dc1[_0x7eff('0x46')],'ChatQueueId':_0xb05dc1['id'],'interface':util[_0x7eff('0x71')](_0x7eff('0x72'),'SIP',_0x536afd[_0x7eff('0x46')]),'penalty':0x0,'paused':_0x536afd[_0x7eff('0x6f')],'createdAt':_0x536afd['createdAt'],'updatedAt':_0x536afd[_0x7eff('0x73')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7eff('0x3b')](respondWithFilteredResult(_0x398cf7,_0x1e82c6))[_0x7eff('0x2d')](handleError(_0x398cf7,null));};exports[_0x7eff('0x74')]=function(_0x1b7f55,_0x31a8c6,_0x3439e3){var _0x513e18={};var _0x5417e6={};var _0x4de14d;var _0x5c04ef;return db[_0x7eff('0x42')]['findOne']({'where':{'id':_0x1b7f55[_0x7eff('0x66')]['id']}})[_0x7eff('0x3b')](handleEntityNotFound(_0x31a8c6,null))[_0x7eff('0x3b')](function(_0x10fac9){if(_0x10fac9){_0x4de14d=_0x10fac9;_0x5417e6[_0x7eff('0x45')]=_[_0x7eff('0x48')](db[_0x7eff('0x75')][_0x7eff('0x59')]);_0x5417e6[_0x7eff('0x47')]=_[_0x7eff('0x48')](_0x1b7f55[_0x7eff('0x47')]);_0x5417e6[_0x7eff('0x49')]=_[_0x7eff('0x4a')](_0x5417e6[_0x7eff('0x45')],_0x5417e6[_0x7eff('0x47')]);_0x513e18[_0x7eff('0x4b')]=_['intersection'](_0x5417e6['model'],qs[_0x7eff('0x4c')](_0x1b7f55[_0x7eff('0x47')][_0x7eff('0x4c')]));_0x513e18[_0x7eff('0x4b')]=_0x513e18[_0x7eff('0x4b')]['length']?_0x513e18['attributes']:_0x5417e6['model'];_0x513e18['order']=qs[_0x7eff('0x50')](_0x1b7f55['query'][_0x7eff('0x50')]);_0x513e18[_0x7eff('0x51')]=qs[_0x7eff('0x49')](_[_0x7eff('0x52')](_0x1b7f55[_0x7eff('0x47')],_0x5417e6[_0x7eff('0x49')]));if(_0x1b7f55[_0x7eff('0x47')][_0x7eff('0x53')]){_0x513e18[_0x7eff('0x51')]=_[_0x7eff('0x55')](_0x513e18[_0x7eff('0x51')],{'$or':_[_0x7eff('0x41')](_0x513e18[_0x7eff('0x4b')],function(_0x4f2b9e){var _0x121238={};_0x121238[_0x4f2b9e]={'$like':'%'+_0x1b7f55[_0x7eff('0x47')][_0x7eff('0x53')]+'%'};return _0x121238;})});}_0x513e18=_['merge']({},_0x513e18,_0x1b7f55[_0x7eff('0x56')]);return _0x4de14d[_0x7eff('0x74')](_0x513e18);}})[_0x7eff('0x3b')](function(_0x1a4130){if(_0x1a4130){_0x5c04ef=_0x1a4130[_0x7eff('0x4d')];if(!_0x1b7f55[_0x7eff('0x47')][_0x7eff('0x6b')](_0x7eff('0x4e'))){_0x513e18[_0x7eff('0x34')]=qs['limit'](_0x1b7f55[_0x7eff('0x47')]['limit']);_0x513e18[_0x7eff('0x33')]=qs['offset'](_0x1b7f55[_0x7eff('0x47')][_0x7eff('0x33')]);}return _0x4de14d[_0x7eff('0x74')](_0x513e18);}})['then'](function(_0x4d4617){if(_0x4d4617){return _0x4d4617?{'count':_0x5c04ef,'rows':_0x4d4617}:null;}})[_0x7eff('0x3b')](respondWithResult(_0x31a8c6,null))[_0x7eff('0x2d')](handleError(_0x31a8c6,null));};exports[_0x7eff('0x76')]=function(_0x13bdec,_0x5375be,_0x3e2628){var _0x1e4e63=_0x13bdec[_0x7eff('0x5d')][_0x7eff('0x77')];return db[_0x7eff('0x75')][_0x7eff('0x6d')]({'where':{'id':_0x1e4e63},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7eff('0x78'),'attributes':['id',_0x7eff('0x46'),_0x7eff('0x79'),_0x7eff('0x7a'),'interface'],'raw':!![]}]})[_0x7eff('0x3b')](function(_0x18aa98){if(_0x18aa98){var _0x5dd5e2=_['flatMap'](_0x18aa98,function(_0x16e551){var _0xb9545e=_0x16e551[_0x7eff('0x3c')]({'plain':!![]});return _0xb9545e[_0x7eff('0x78')];});return db[_0x7eff('0x42')][_0x7eff('0x5b')]({'where':{'id':_0x13bdec[_0x7eff('0x66')]['id']}})[_0x7eff('0x3b')](function(_0x5d9f1c){return db[_0x7eff('0x7b')][_0x7eff('0x7c')](function(_0x1e1ad3){return _0x5d9f1c['addTeams'](_0x1e4e63,{'transaction':_0x1e1ad3})[_0x7eff('0x3b')](function(){return BPromise[_0x7eff('0x7d')](_0x5dd5e2,function(_0x1f70e3){return db[_0x7eff('0x6a')][_0x7eff('0x7e')]({'where':{'UserId':_0x1f70e3['id'],'ChatQueueId':_0x13bdec[_0x7eff('0x66')]['id']},'transaction':_0x1e1ad3});});})[_0x7eff('0x3b')](function(){_0x5dd5e2[_0x7eff('0x7f')](function(_0x59200e){socket[_0x7eff('0x80')](_0x7eff('0x81'),{'UserId':_0x59200e['id'],'ChatQueueId':_0x5d9f1c['id']});});});});});}})[_0x7eff('0x3b')](respondWithStatusCode(_0x5375be,null))['catch'](handleError(_0x5375be,null));};exports[_0x7eff('0x82')]=function(_0x24dcb9,_0x2c7753,_0x7559df){return db[_0x7eff('0x75')]['findAll']({'where':{'id':_0x24dcb9[_0x7eff('0x47')][_0x7eff('0x77')]},'attributes':['id'],'include':[{'model':db[_0x7eff('0x83')],'as':_0x7eff('0x78'),'attributes':['id'],'raw':!![]}]})[_0x7eff('0x3b')](handleEntityNotFound(_0x2c7753,null))[_0x7eff('0x3b')](function(_0x5ae968){var _0x206b1f=_[_0x7eff('0x41')](_0x5ae968,'id');var _0x1e119b=[];var _0x327c7b=[];var _0x3644b1=squel[_0x7eff('0x84')]();_0x3644b1[_0x7eff('0x85')](_0x7eff('0x86'))[_0x7eff('0x87')](_0x7eff('0x88'),'tq')[_0x7eff('0x89')](_0x7eff('0x8a'),'ut',_0x7eff('0x8b'))['where'](_0x7eff('0x8c'),_0x24dcb9[_0x7eff('0x66')]['id']);for(var _0x2b38ed=0x0;_0x2b38ed<_0x5ae968[_0x7eff('0x4d')];_0x2b38ed+=0x1){let _0x43a054=_0x5ae968[_0x2b38ed];for(var _0x55d489=0x0;_0x55d489<_0x43a054['Agents'][_0x7eff('0x4d')];_0x55d489+=0x1){let _0x5050b5=_0x43a054[_0x7eff('0x78')][_0x55d489];var _0x335ee6=_0x3644b1[_0x7eff('0x8d')]();_0x335ee6[_0x7eff('0x51')](_0x7eff('0x8e'),_0x5050b5['id']);_0x327c7b[_0x7eff('0x8f')](db[_0x7eff('0x7b')][_0x7eff('0x47')](_0x335ee6[_0x7eff('0x90')](),{'type':db[_0x7eff('0x7b')][_0x7eff('0x91')][_0x7eff('0x92')]})[_0x7eff('0x3b')](function(_0x35dc62){if(_0x35dc62['length']===0x1){return _0x5050b5['id'];}else{var _0x5a4c07=_[_0x7eff('0x93')](_['map'](_0x35dc62,'TeamId'),function(_0xef4893){return _[_0x7eff('0x94')](_0x206b1f,_0xef4893);});if(_0x5a4c07){return _0x5050b5['id'];}}}));}}return BPromise[_0x7eff('0x95')](_0x327c7b)[_0x7eff('0x3b')](function(_0x27b242){_0x1e119b=_(_0x1e119b)[_0x7eff('0x96')](_0x27b242)[_0x7eff('0x97')]()[_0x7eff('0x98')]();return db['ChatQueue'][_0x7eff('0x5b')]({'where':{'id':_0x24dcb9[_0x7eff('0x66')]['id']}})[_0x7eff('0x3b')](function(_0x4a04c0){return db['sequelize']['transaction'](function(_0x12c2db){return _0x4a04c0[_0x7eff('0x82')](_0x24dcb9[_0x7eff('0x47')][_0x7eff('0x77')],{'transaction':_0x12c2db})[_0x7eff('0x3b')](function(){if(!_[_0x7eff('0x99')](_0x1e119b)){return _0x4a04c0[_0x7eff('0x9a')](_0x1e119b,{'transaction':_0x12c2db});}})[_0x7eff('0x3b')](function(){_0x1e119b['forEach'](function(_0x7a0bc8){socket['emit'](_0x7eff('0x9b'),{'UserId':_0x7a0bc8,'ChatQueueId':_0x4a04c0['id']});});});});});});})[_0x7eff('0x3b')](respondWithStatusCode(_0x2c7753,null))[_0x7eff('0x2d')](handleError(_0x2c7753,null));};exports['addAgents']=function(_0x51d629,_0x59a7d4,_0x9b6900){return db[_0x7eff('0x42')][_0x7eff('0x5b')]({'where':{'id':_0x51d629['params']['id']}})[_0x7eff('0x3b')](handleEntityNotFound(_0x59a7d4,null))['then'](function(_0x424d0f){if(_0x424d0f){return _0x424d0f[_0x7eff('0x9c')](_0x51d629[_0x7eff('0x5d')]['ids'],_[_0x7eff('0x9d')](_0x51d629['body'],[_0x7eff('0x77'),'id'])||{})[_0x7eff('0x9e')](function(_0xd4d277){for(var _0x457af9=0x0;_0x457af9<_0x51d629[_0x7eff('0x5d')][_0x7eff('0x77')][_0x7eff('0x4d')];_0x457af9+=0x1){socket[_0x7eff('0x80')](_0x7eff('0x81'),{'UserId':_0x51d629['body']['ids'][_0x457af9],'ChatQueueId':_0x51d629[_0x7eff('0x66')]['id']});}return _0xd4d277;});}})['then'](respondWithResult(_0x59a7d4,null))[_0x7eff('0x2d')](handleError(_0x59a7d4,null));};exports[_0x7eff('0x9a')]=function(_0x15b93c,_0xf31cf9,_0x495045){return db['ChatQueue']['find']({'where':{'id':_0x15b93c[_0x7eff('0x66')]['id']}})['then'](handleEntityNotFound(_0xf31cf9,null))[_0x7eff('0x3b')](function(_0xc57b32){if(_0xc57b32){return _0xc57b32[_0x7eff('0x9a')](_0x15b93c[_0x7eff('0x47')][_0x7eff('0x77')])['then'](function(){if(_['isArray'](_0x15b93c[_0x7eff('0x47')]['ids'])){for(var _0x347091=0x0;_0x347091<_0x15b93c['query'][_0x7eff('0x77')][_0x7eff('0x4d')];_0x347091+=0x1){socket[_0x7eff('0x80')]('userChatQueue:remove',{'UserId':Number(_0x15b93c[_0x7eff('0x47')][_0x7eff('0x77')][_0x347091]),'ChatQueueId':Number(_0x15b93c[_0x7eff('0x66')]['id'])});}}else{socket[_0x7eff('0x80')]('userChatQueue:remove',{'UserId':Number(_0x15b93c['query']['ids']),'ChatQueueId':Number(_0x15b93c[_0x7eff('0x66')]['id'])});}});}})[_0x7eff('0x3b')](respondWithStatusCode(_0xf31cf9,null))[_0x7eff('0x2d')](handleError(_0xf31cf9,null));};exports[_0x7eff('0x9f')]=function(_0x3c6624,_0x47e4d2,_0x4dd485){var _0x2593ed={};var _0x5d9023={};var _0x42d705;var _0x32109f;return db[_0x7eff('0x42')][_0x7eff('0x69')]({'where':{'id':_0x3c6624[_0x7eff('0x66')]['id']}})[_0x7eff('0x3b')](handleEntityNotFound(_0x47e4d2,null))['then'](function(_0x4d09a9){if(_0x4d09a9){_0x42d705=_0x4d09a9;_0x5d9023[_0x7eff('0x45')]=_['keys'](db[_0x7eff('0x83')][_0x7eff('0x59')]);_0x5d9023[_0x7eff('0x47')]=_[_0x7eff('0x48')](_0x3c6624['query']);_0x5d9023[_0x7eff('0x49')]=_[_0x7eff('0x4a')](_0x5d9023[_0x7eff('0x45')],_0x5d9023[_0x7eff('0x47')]);_0x2593ed['attributes']=_[_0x7eff('0x4a')](_0x5d9023['model'],qs[_0x7eff('0x4c')](_0x3c6624[_0x7eff('0x47')][_0x7eff('0x4c')]));_0x2593ed[_0x7eff('0x4b')]=_0x2593ed[_0x7eff('0x4b')][_0x7eff('0x4d')]?_0x2593ed[_0x7eff('0x4b')]:_0x5d9023[_0x7eff('0x45')];_0x2593ed[_0x7eff('0x4f')]=qs[_0x7eff('0x50')](_0x3c6624[_0x7eff('0x47')][_0x7eff('0x50')]);_0x2593ed[_0x7eff('0x51')]=qs[_0x7eff('0x49')](_['pick'](_0x3c6624[_0x7eff('0x47')],_0x5d9023['filters']));if(_0x3c6624[_0x7eff('0x47')][_0x7eff('0x53')]){_0x2593ed[_0x7eff('0x51')]=_[_0x7eff('0x55')](_0x2593ed[_0x7eff('0x51')],{'$or':_[_0x7eff('0x41')](_0x2593ed['attributes'],function(_0x180c91){var _0x336112={};_0x336112[_0x180c91]={'$like':'%'+_0x3c6624[_0x7eff('0x47')][_0x7eff('0x53')]+'%'};return _0x336112;})});}_0x2593ed=_[_0x7eff('0x55')]({},_0x2593ed,_0x3c6624[_0x7eff('0x56')]);return _0x42d705[_0x7eff('0x9f')](_0x2593ed);}})[_0x7eff('0x3b')](function(_0x15eb1f){if(_0x15eb1f){_0x32109f=_0x15eb1f['length'];if(!_0x3c6624[_0x7eff('0x47')][_0x7eff('0x6b')](_0x7eff('0x4e'))){_0x2593ed[_0x7eff('0x34')]=qs[_0x7eff('0x34')](_0x3c6624[_0x7eff('0x47')][_0x7eff('0x34')]);_0x2593ed['offset']=qs[_0x7eff('0x33')](_0x3c6624[_0x7eff('0x47')][_0x7eff('0x33')]);}return _0x42d705['getAgents'](_0x2593ed);}})[_0x7eff('0x3b')](function(_0x5ef1ea){if(_0x5ef1ea){return _0x5ef1ea?{'count':_0x32109f,'rows':_0x5ef1ea}:null;}})[_0x7eff('0x3b')](respondWithResult(_0x47e4d2,null))['catch'](handleError(_0x47e4d2,null));};
\ No newline at end of file
index 3420ce7..5a94889 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x117683,_0x3fd082){var _0x1fe2b2=function(_0x356f64){while(--_0x356f64){_0x117683['push'](_0x117683['shift']());}};_0x1fe2b2(++_0x3fd082);}(_0xb10b,0x12a));var _0xbb10=function(_0x21eacf,_0x1d1f5b){_0x21eacf=_0x21eacf-0x0;var _0xbae3e=_0xb10b[_0x21eacf];return _0xbae3e;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x5866c6,_0x5ca72d){var _0x4ae976=function(_0x3b950a){while(--_0x3b950a){_0x5866c6['push'](_0x5866c6['shift']());}};_0x4ae976(++_0x5ca72d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x49da7d,_0x5226d5){_0x49da7d=_0x49da7d-0x0;var _0x73c8d3=_0x5f2f[_0x49da7d];return _0x73c8d3;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents;
\ No newline at end of file
index 6b3c805..2254bf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe176=['api','moment','bluebird','request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x132c05,_0x445e31){var _0x43f2c4=function(_0x411b40){while(--_0x411b40){_0x132c05['push'](_0x132c05['shift']());}};_0x43f2c4(++_0x445e31);}(_0xe176,0x1c4));var _0x6e17=function(_0x470a01,_0x1ef188){_0x470a01=_0x470a01-0x0;var _0x5df181=_0xe176[_0x470a01];return _0x5df181;};'use strict';var _=require(_0x6e17('0x0'));var util=require(_0x6e17('0x1'));var logger=require(_0x6e17('0x2'))(_0x6e17('0x3'));var moment=require(_0x6e17('0x4'));var BPromise=require(_0x6e17('0x5'));var rp=require(_0x6e17('0x6'));var fs=require('fs');var path=require(_0x6e17('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6e17('0x8'));module[_0x6e17('0x9')]=function(_0x45a777,_0xd67742){return _0x45a777[_0x6e17('0xa')](_0x6e17('0xb'),attributes,{'tableName':_0x6e17('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb530=['exports','define','ChatQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueue.attributes'];(function(_0x58c218,_0x4368d1){var _0x3c6eef=function(_0x16cec6){while(--_0x16cec6){_0x58c218['push'](_0x58c218['shift']());}};_0x3c6eef(++_0x4368d1);}(_0xb530,0x117));var _0x0b53=function(_0x55ab6f,_0x4a9833){_0x55ab6f=_0x55ab6f-0x0;var _0x1f5d3b=_0xb530[_0x55ab6f];return _0x1f5d3b;};'use strict';var _=require(_0x0b53('0x0'));var util=require('util');var logger=require(_0x0b53('0x1'))(_0x0b53('0x2'));var moment=require(_0x0b53('0x3'));var BPromise=require(_0x0b53('0x4'));var rp=require(_0x0b53('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0b53('0x6'));var config=require(_0x0b53('0x7'));var attributes=require(_0x0b53('0x8'));module[_0x0b53('0x9')]=function(_0x17db74,_0x2e50f7){return _0x17db74[_0x0b53('0xa')](_0x0b53('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8452eda..2cadf2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa693=['where','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','findAll','options','raw','attributes','limit','include','model','map','GetChatQueue','ShowChatQueue','ChatQueue','find'];(function(_0x4a2198,_0x2caa94){var _0x50d366=function(_0x35137e){while(--_0x35137e){_0x4a2198['push'](_0x4a2198['shift']());}};_0x50d366(++_0x2caa94);}(_0xa693,0xf1));var _0x3a69=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0xa693[_0x38af48];return _0x445384;};'use strict';var _=require(_0x3a69('0x0'));var util=require(_0x3a69('0x1'));var moment=require(_0x3a69('0x2'));var BPromise=require(_0x3a69('0x3'));var rs=require(_0x3a69('0x4'));var fs=require('fs');var Redis=require(_0x3a69('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a69('0x6'));var config=require(_0x3a69('0x7'));var jayson=require(_0x3a69('0x8'));var client=jayson[_0x3a69('0x9')][_0x3a69('0xa')]({'port':0x232a});config[_0x3a69('0xb')]=_[_0x3a69('0xc')](config['redis'],{'host':_0x3a69('0xd'),'port':0x18eb});var socket=require(_0x3a69('0xe'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x30b7ad,_0x4826b5,_0x68fa91){return new BPromise(function(_0x44b8b2,_0x21142a){return client[_0x3a69('0xf')](_0x30b7ad,_0x68fa91)[_0x3a69('0x10')](function(_0x59f5aa){logger[_0x3a69('0x11')](_0x3a69('0x12'),_0x4826b5,'request\x20sent');logger[_0x3a69('0x13')](_0x3a69('0x14'),_0x4826b5,_0x3a69('0x15'),JSON[_0x3a69('0x16')](_0x59f5aa));if(_0x59f5aa[_0x3a69('0x17')]){if(_0x59f5aa[_0x3a69('0x17')][_0x3a69('0x18')]===0x1f4){logger[_0x3a69('0x17')](_0x3a69('0x12'),_0x4826b5,_0x59f5aa[_0x3a69('0x17')][_0x3a69('0x19')]);return _0x21142a(_0x59f5aa[_0x3a69('0x17')]['message']);}logger['error'](_0x3a69('0x12'),_0x4826b5,_0x59f5aa[_0x3a69('0x17')][_0x3a69('0x19')]);return _0x44b8b2(_0x59f5aa[_0x3a69('0x17')][_0x3a69('0x19')]);}else{logger[_0x3a69('0x11')](_0x3a69('0x12'),_0x4826b5,_0x3a69('0x15'));_0x44b8b2(_0x59f5aa[_0x3a69('0x1a')][_0x3a69('0x19')]);}})['catch'](function(_0x4101ac){logger[_0x3a69('0x17')](_0x3a69('0x12'),_0x4826b5,_0x4101ac);_0x21142a(_0x4101ac);});});}exports['GetChatQueue']=function(_0x3af6c5){var _0x352799=this;return new Promise(function(_0x5090a8,_0x59f565){return db['ChatQueue'][_0x3a69('0x1b')]({'raw':_0x3af6c5[_0x3a69('0x1c')]?_0x3af6c5['options'][_0x3a69('0x1d')]===undefined?!![]:![]:!![],'where':_0x3af6c5['options']?_0x3af6c5[_0x3a69('0x1c')]['where']||null:null,'attributes':_0x3af6c5[_0x3a69('0x1c')]?_0x3af6c5[_0x3a69('0x1c')][_0x3a69('0x1e')]||null:null,'limit':_0x3af6c5['options']?_0x3af6c5[_0x3a69('0x1c')][_0x3a69('0x1f')]||null:null,'include':_0x3af6c5[_0x3a69('0x1c')]?_0x3af6c5['options']['include']?_['map'](_0x3af6c5[_0x3a69('0x1c')][_0x3a69('0x20')],function(_0x525019){return{'model':db[_0x525019[_0x3a69('0x21')]],'as':_0x525019['as'],'attributes':_0x525019[_0x3a69('0x1e')],'include':_0x525019[_0x3a69('0x20')]?_[_0x3a69('0x22')](_0x525019[_0x3a69('0x20')],function(_0x207ae1){return{'model':db[_0x207ae1['model']],'as':_0x207ae1['as'],'attributes':_0x207ae1[_0x3a69('0x1e')],'include':_0x207ae1[_0x3a69('0x20')]?_[_0x3a69('0x22')](_0x207ae1[_0x3a69('0x20')],function(_0x2af120){return{'model':db[_0x2af120[_0x3a69('0x21')]],'as':_0x2af120['as'],'attributes':_0x2af120[_0x3a69('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x586d3f){logger['info'](_0x3a69('0x23'),_0x3af6c5);logger[_0x3a69('0x13')](_0x3a69('0x23'),_0x3af6c5,JSON[_0x3a69('0x16')](_0x586d3f));_0x5090a8(_0x586d3f);})['catch'](function(_0x1bd299){logger[_0x3a69('0x17')]('GetChatQueue',_0x1bd299[_0x3a69('0x19')],_0x3af6c5);_0x59f565(_0x352799[_0x3a69('0x17')](0x1f4,_0x1bd299[_0x3a69('0x19')]));});});};exports[_0x3a69('0x24')]=function(_0x379eff){var _0x33eed8=this;return new Promise(function(_0x34e34b,_0x3cce53){return db[_0x3a69('0x25')][_0x3a69('0x26')]({'raw':_0x379eff[_0x3a69('0x1c')]?_0x379eff['options'][_0x3a69('0x1d')]===undefined?!![]:![]:!![],'where':_0x379eff[_0x3a69('0x1c')]?_0x379eff[_0x3a69('0x1c')][_0x3a69('0x27')]||null:null,'attributes':_0x379eff[_0x3a69('0x1c')]?_0x379eff[_0x3a69('0x1c')][_0x3a69('0x1e')]||null:null,'include':_0x379eff[_0x3a69('0x1c')]?_0x379eff[_0x3a69('0x1c')][_0x3a69('0x20')]?_['map'](_0x379eff[_0x3a69('0x1c')][_0x3a69('0x20')],function(_0x9552ae){return{'model':db[_0x9552ae[_0x3a69('0x21')]],'as':_0x9552ae['as'],'attributes':_0x9552ae[_0x3a69('0x1e')],'include':_0x9552ae[_0x3a69('0x20')]?_[_0x3a69('0x22')](_0x9552ae['include'],function(_0x58ff11){return{'model':db[_0x58ff11['model']],'as':_0x58ff11['as'],'attributes':_0x58ff11[_0x3a69('0x1e')],'include':_0x58ff11[_0x3a69('0x20')]?_[_0x3a69('0x22')](_0x58ff11[_0x3a69('0x20')],function(_0x8f728b){return{'model':db[_0x8f728b[_0x3a69('0x21')]],'as':_0x8f728b['as'],'attributes':_0x8f728b[_0x3a69('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3a69('0x10')](function(_0xe5a64b){logger[_0x3a69('0x11')](_0x3a69('0x24'),_0x379eff);logger[_0x3a69('0x13')]('ShowChatQueue',_0x379eff,JSON['stringify'](_0xe5a64b));_0x34e34b(_0xe5a64b);})['catch'](function(_0x10820a){logger[_0x3a69('0x17')](_0x3a69('0x24'),_0x10820a[_0x3a69('0x19')],_0x379eff);_0x3cce53(_0x33eed8[_0x3a69('0x17')](0x1f4,_0x10820a['message']));});});};
\ No newline at end of file
+var _0x52c1=['include','model','map','ShowChatQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','redis','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit'];(function(_0x12553d,_0x160725){var _0x166267=function(_0x49f7ae){while(--_0x49f7ae){_0x12553d['push'](_0x12553d['shift']());}};_0x166267(++_0x160725);}(_0x52c1,0x1ce));var _0x152c=function(_0x26c543,_0x381fd2){_0x26c543=_0x26c543-0x0;var _0x25f6b5=_0x52c1[_0x26c543];return _0x25f6b5;};'use strict';var _=require(_0x152c('0x0'));var util=require(_0x152c('0x1'));var moment=require(_0x152c('0x2'));var BPromise=require(_0x152c('0x3'));var rs=require(_0x152c('0x4'));var fs=require('fs');var Redis=require(_0x152c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x152c('0x6'));var logger=require('../../config/logger')(_0x152c('0x7'));var config=require('../../config/environment');var jayson=require(_0x152c('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x152c('0x9')]=_['defaults'](config[_0x152c('0x9')],{'host':_0x152c('0xa'),'port':0x18eb});var socket=require(_0x152c('0xb'))(new Redis(config[_0x152c('0x9')]));require('./chatQueue.socket')[_0x152c('0xc')](socket);function respondWithRpcPromise(_0xf4eed1,_0x4d326f,_0x35eeb5){return new BPromise(function(_0xc31fc6,_0x1756a1){return client[_0x152c('0xd')](_0xf4eed1,_0x35eeb5)[_0x152c('0xe')](function(_0x116dc1){logger[_0x152c('0xf')](_0x152c('0x10'),_0x4d326f,_0x152c('0x11'));logger[_0x152c('0x12')](_0x152c('0x13'),_0x4d326f,'request\x20sent',JSON[_0x152c('0x14')](_0x116dc1));if(_0x116dc1[_0x152c('0x15')]){if(_0x116dc1[_0x152c('0x15')][_0x152c('0x16')]===0x1f4){logger[_0x152c('0x15')](_0x152c('0x10'),_0x4d326f,_0x116dc1[_0x152c('0x15')][_0x152c('0x17')]);return _0x1756a1(_0x116dc1['error'][_0x152c('0x17')]);}logger[_0x152c('0x15')](_0x152c('0x10'),_0x4d326f,_0x116dc1[_0x152c('0x15')]['message']);return _0xc31fc6(_0x116dc1[_0x152c('0x15')][_0x152c('0x17')]);}else{logger[_0x152c('0xf')](_0x152c('0x10'),_0x4d326f,_0x152c('0x11'));_0xc31fc6(_0x116dc1['result'][_0x152c('0x17')]);}})[_0x152c('0x18')](function(_0x3a0e49){logger[_0x152c('0x15')](_0x152c('0x10'),_0x4d326f,_0x3a0e49);_0x1756a1(_0x3a0e49);});});}exports[_0x152c('0x19')]=function(_0x44f5ce){var _0x31b304=this;return new Promise(function(_0x1ac0c6,_0xacb5f0){return db[_0x152c('0x1a')][_0x152c('0x1b')]({'raw':_0x44f5ce[_0x152c('0x1c')]?_0x44f5ce['options'][_0x152c('0x1d')]===undefined?!![]:![]:!![],'where':_0x44f5ce['options']?_0x44f5ce['options']['where']||null:null,'attributes':_0x44f5ce['options']?_0x44f5ce[_0x152c('0x1c')][_0x152c('0x1e')]||null:null,'limit':_0x44f5ce[_0x152c('0x1c')]?_0x44f5ce[_0x152c('0x1c')][_0x152c('0x1f')]||null:null,'include':_0x44f5ce[_0x152c('0x1c')]?_0x44f5ce[_0x152c('0x1c')][_0x152c('0x20')]?_['map'](_0x44f5ce['options'][_0x152c('0x20')],function(_0x439b3f){return{'model':db[_0x439b3f[_0x152c('0x21')]],'as':_0x439b3f['as'],'attributes':_0x439b3f[_0x152c('0x1e')],'include':_0x439b3f[_0x152c('0x20')]?_[_0x152c('0x22')](_0x439b3f[_0x152c('0x20')],function(_0x177c83){return{'model':db[_0x177c83['model']],'as':_0x177c83['as'],'attributes':_0x177c83[_0x152c('0x1e')],'include':_0x177c83[_0x152c('0x20')]?_[_0x152c('0x22')](_0x177c83['include'],function(_0x1ada12){return{'model':db[_0x1ada12[_0x152c('0x21')]],'as':_0x1ada12['as'],'attributes':_0x1ada12['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x62e97a){logger[_0x152c('0xf')](_0x152c('0x19'),_0x44f5ce);logger[_0x152c('0x12')](_0x152c('0x19'),_0x44f5ce,JSON['stringify'](_0x62e97a));_0x1ac0c6(_0x62e97a);})[_0x152c('0x18')](function(_0x246d4f){logger['error'](_0x152c('0x19'),_0x246d4f[_0x152c('0x17')],_0x44f5ce);_0xacb5f0(_0x31b304[_0x152c('0x15')](0x1f4,_0x246d4f[_0x152c('0x17')]));});});};exports[_0x152c('0x23')]=function(_0x14eab8){var _0x5c0fe0=this;return new Promise(function(_0x52b0f4,_0x488a75){return db[_0x152c('0x1a')][_0x152c('0x24')]({'raw':_0x14eab8[_0x152c('0x1c')]?_0x14eab8[_0x152c('0x1c')][_0x152c('0x1d')]===undefined?!![]:![]:!![],'where':_0x14eab8[_0x152c('0x1c')]?_0x14eab8[_0x152c('0x1c')][_0x152c('0x25')]||null:null,'attributes':_0x14eab8[_0x152c('0x1c')]?_0x14eab8[_0x152c('0x1c')][_0x152c('0x1e')]||null:null,'include':_0x14eab8[_0x152c('0x1c')]?_0x14eab8[_0x152c('0x1c')][_0x152c('0x20')]?_[_0x152c('0x22')](_0x14eab8[_0x152c('0x1c')][_0x152c('0x20')],function(_0x53d676){return{'model':db[_0x53d676[_0x152c('0x21')]],'as':_0x53d676['as'],'attributes':_0x53d676['attributes'],'include':_0x53d676[_0x152c('0x20')]?_[_0x152c('0x22')](_0x53d676['include'],function(_0xfc2c59){return{'model':db[_0xfc2c59['model']],'as':_0xfc2c59['as'],'attributes':_0xfc2c59['attributes'],'include':_0xfc2c59[_0x152c('0x20')]?_[_0x152c('0x22')](_0xfc2c59[_0x152c('0x20')],function(_0x3f7177){return{'model':db[_0x3f7177[_0x152c('0x21')]],'as':_0x3f7177['as'],'attributes':_0x3f7177[_0x152c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x152c('0xe')](function(_0x3bb381){logger[_0x152c('0xf')]('ShowChatQueue',_0x14eab8);logger[_0x152c('0x12')](_0x152c('0x23'),_0x14eab8,JSON[_0x152c('0x14')](_0x3bb381));_0x52b0f4(_0x3bb381);})[_0x152c('0x18')](function(_0x291ebc){logger[_0x152c('0x15')](_0x152c('0x23'),_0x291ebc['message'],_0x14eab8);_0x488a75(_0x5c0fe0[_0x152c('0x15')](0x1f4,_0x291ebc[_0x152c('0x17')]));});});};
\ No newline at end of file
index 945bbde..c0f64c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x1cfc39,_0x1d3913){var _0x957a28=function(_0x2be930){while(--_0x2be930){_0x1cfc39['push'](_0x1cfc39['shift']());}};_0x957a28(++_0x1d3913);}(_0xb10b,0x12a));var _0xbb10=function(_0x11df66,_0x9eabf){_0x11df66=_0x11df66-0x0;var _0xc2dca1=_0xb10b[_0x11df66];return _0xc2dca1;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}};
\ No newline at end of file
+var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x3b5f66,_0x1dbfc5){var _0x4aa1a8=function(_0x57c05c){while(--_0x57c05c){_0x3b5f66['push'](_0x3b5f66['shift']());}};_0x4aa1a8(++_0x1dbfc5);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f025f,_0x274149){_0x4f025f=_0x4f025f-0x0;var _0x143048=_0xb10b[_0x4f025f];return _0x143048;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}};
\ No newline at end of file
index bce84d3..d87aa04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3aa=['exports','multer','util','path','connect-timeout','Router','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','/:id','show','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','delete','destroy','removeAgents'];(function(_0x4a891a,_0x91c52e){var _0x1efd64=function(_0x57c502){while(--_0x57c502){_0x4a891a['push'](_0x4a891a['shift']());}};_0x1efd64(++_0x91c52e);}(_0xf3aa,0xf1));var _0xaf3a=function(_0x274939,_0x2a2cb8){_0x274939=_0x274939-0x0;var _0x28478e=_0xf3aa[_0x274939];return _0x28478e;};'use strict';var multer=require(_0xaf3a('0x0'));var util=require(_0xaf3a('0x1'));var path=require(_0xaf3a('0x2'));var timeout=require(_0xaf3a('0x3'));var express=require('express');var router=express[_0xaf3a('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaf3a('0x5'));var controller=require(_0xaf3a('0x6'));router[_0xaf3a('0x7')]('/',auth[_0xaf3a('0x8')](),controller[_0xaf3a('0x9')]);router[_0xaf3a('0x7')](_0xaf3a('0xa'),auth[_0xaf3a('0x8')](),controller['describe']);router['get'](_0xaf3a('0xb'),auth[_0xaf3a('0x8')](),controller[_0xaf3a('0xc')]);router['get']('/:id/members',auth[_0xaf3a('0x8')](),controller[_0xaf3a('0xd')]);router[_0xaf3a('0x7')](_0xaf3a('0xe'),auth[_0xaf3a('0x8')](),controller['getTeams']);router[_0xaf3a('0x7')](_0xaf3a('0xf'),auth['isAuthenticated'](),controller[_0xaf3a('0x10')]);router[_0xaf3a('0x11')]('/',auth[_0xaf3a('0x8')](),controller['create']);router[_0xaf3a('0x11')](_0xaf3a('0xe'),auth['isAuthenticated'](),controller[_0xaf3a('0x12')]);router['post']('/:id/users',auth[_0xaf3a('0x8')](),controller[_0xaf3a('0x13')]);router['put'](_0xaf3a('0xb'),auth[_0xaf3a('0x8')](),controller['update']);router[_0xaf3a('0x14')](_0xaf3a('0xb'),auth[_0xaf3a('0x8')](),controller[_0xaf3a('0x15')]);router['delete'](_0xaf3a('0xe'),auth[_0xaf3a('0x8')](),controller['removeTeams']);router['delete'](_0xaf3a('0xf'),auth['isAuthenticated'](),controller[_0xaf3a('0x16')]);module[_0xaf3a('0x17')]=router;
\ No newline at end of file
+var _0x7f8d=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','delete','/:id','destroy','removeTeams','exports','multer','util','path','Router','../../components/interaction/service'];(function(_0x54a24b,_0x423b2b){var _0x3c8bec=function(_0xfc3221){while(--_0xfc3221){_0x54a24b['push'](_0x54a24b['shift']());}};_0x3c8bec(++_0x423b2b);}(_0x7f8d,0x1bd));var _0xd7f8=function(_0x249120,_0x2077cb){_0x249120=_0x249120-0x0;var _0x1b59ce=_0x7f8d[_0x249120];return _0x1b59ce;};'use strict';var multer=require(_0xd7f8('0x0'));var util=require(_0xd7f8('0x1'));var path=require(_0xd7f8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd7f8('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd7f8('0x4'));var config=require(_0xd7f8('0x5'));var controller=require(_0xd7f8('0x6'));router[_0xd7f8('0x7')]('/',auth[_0xd7f8('0x8')](),controller[_0xd7f8('0x9')]);router[_0xd7f8('0x7')](_0xd7f8('0xa'),auth[_0xd7f8('0x8')](),controller['describe']);router['get']('/:id',auth[_0xd7f8('0x8')](),controller[_0xd7f8('0xb')]);router[_0xd7f8('0x7')](_0xd7f8('0xc'),auth[_0xd7f8('0x8')](),controller[_0xd7f8('0xd')]);router['get'](_0xd7f8('0xe'),auth[_0xd7f8('0x8')](),controller[_0xd7f8('0xf')]);router['get'](_0xd7f8('0x10'),auth[_0xd7f8('0x8')](),controller[_0xd7f8('0x11')]);router[_0xd7f8('0x12')]('/',auth[_0xd7f8('0x8')](),controller[_0xd7f8('0x13')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0xd7f8('0x12')](_0xd7f8('0x10'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0xd7f8('0x8')](),controller['update']);router[_0xd7f8('0x14')](_0xd7f8('0x15'),auth[_0xd7f8('0x8')](),controller[_0xd7f8('0x16')]);router[_0xd7f8('0x14')](_0xd7f8('0xe'),auth[_0xd7f8('0x8')](),controller[_0xd7f8('0x17')]);router[_0xd7f8('0x14')](_0xd7f8('0x10'),auth[_0xd7f8('0x8')](),controller['removeAgents']);module[_0xd7f8('0x18')]=router;
\ No newline at end of file
index 8adb61d..d85906a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa87b=['DATE','moment','exports','STRING'];(function(_0x1d443b,_0x441a65){var _0x552361=function(_0x272ff4){while(--_0x272ff4){_0x1d443b['push'](_0x1d443b['shift']());}};_0x552361(++_0x441a65);}(_0xa87b,0x1d9));var _0xba87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa87b[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xba87('0x0'));var Sequelize=require('sequelize');module[_0xba87('0x1')]={'uniqueid':{'type':Sequelize[_0xba87('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xba87('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xba87('0x3')]},'acceptAt':{'type':Sequelize[_0xba87('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xba87('0x2')]}};
\ No newline at end of file
+var _0x637e=['DATE','moment','sequelize','exports','STRING'];(function(_0x5d15a7,_0x5ccdb0){var _0x437f63=function(_0x360488){while(--_0x360488){_0x5d15a7['push'](_0x5d15a7['shift']());}};_0x437f63(++_0x5ccdb0);}(_0x637e,0x191));var _0xe637=function(_0x308bd1,_0x29be05){_0x308bd1=_0x308bd1-0x0;var _0x1e8b7b=_0x637e[_0x308bd1];return _0x1e8b7b;};'use strict';var moment=require(_0xe637('0x0'));var Sequelize=require(_0xe637('0x1'));module[_0xe637('0x2')]={'uniqueid':{'type':Sequelize[_0xe637('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe637('0x3')]},'joinAt':{'type':Sequelize[_0xe637('0x4')]},'leaveAt':{'type':Sequelize[_0xe637('0x4')]},'acceptAt':{'type':Sequelize[_0xe637('0x4')]},'exitAt':{'type':Sequelize[_0xe637('0x4')]},'reason':{'type':Sequelize[_0xe637('0x3')]}};
\ No newline at end of file
index fa1d146..5ea73b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','findAll','catch','show','params','includeAll','include','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1e0bc8,_0xb2f1b8){var _0x3c190a=function(_0x5adc7a){while(--_0x5adc7a){_0x1e0bc8['push'](_0x1e0bc8['shift']());}};_0x3c190a(++_0xb2f1b8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];function respondWithStatusCode(_0xa0c1,_0x4a8cc7){_0x4a8cc7=_0x4a8cc7||0xcc;return function(_0x5330a8){if(_0x5330a8){return _0xa0c1[_0x3071('0x1a')](_0x4a8cc7);}return _0xa0c1['status'](_0x4a8cc7)[_0x3071('0x1b')]();};}function respondWithResult(_0x44fbae,_0x5d4883){_0x5d4883=_0x5d4883||0xc8;return function(_0x104e73){if(_0x104e73){return _0x44fbae['status'](_0x5d4883)[_0x3071('0x1c')](_0x104e73);}};}function respondWithFilteredResult(_0x45c93b,_0x1271d0){return function(_0x1f14e1){if(_0x1f14e1){var _0x1caa5d=_0x1f14e1[_0x3071('0x1d')],_0x2a6a4b=_0x1271d0[_0x3071('0x1e')],_0x157a47=_0x1271d0['offset']+_0x1271d0[_0x3071('0x1f')],_0x11bdc9;if(_0x157a47>=_0x1caa5d){_0x157a47=_0x1caa5d;_0x11bdc9=0xc8;}else{_0x11bdc9=0xce;}_0x45c93b[_0x3071('0x20')](_0x11bdc9);return _0x45c93b[_0x3071('0x21')](_0x3071('0x22'),_0x2a6a4b+'-'+_0x157a47+'/'+_0x1caa5d)[_0x3071('0x1c')](_0x1f14e1);}return null;};}function patchUpdates(_0x17aee2){return function(_0x105bbb){try{jsonpatch[_0x3071('0x23')](_0x105bbb,_0x17aee2,!![]);}catch(_0x502a16){return BPromise[_0x3071('0x24')](_0x502a16);}return _0x105bbb[_0x3071('0x25')]();};}function saveUpdates(_0xd3e23d,_0x56c267){return function(_0xb8f4e3){if(_0xb8f4e3){return _0xb8f4e3['update'](_0xd3e23d)[_0x3071('0x26')](function(_0x43128c){return _0x43128c;});}return null;};}function removeEntity(_0x3762d8,_0x457b57){return function(_0x33090c){if(_0x33090c){return _0x33090c[_0x3071('0x27')]()[_0x3071('0x26')](function(){_0x3762d8[_0x3071('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(!_0xb05b1d){_0x481a51[_0x3071('0x1a')](0x194);}return _0xb05b1d;};}function handleError(_0x13df9f,_0x2793ef){_0x2793ef=_0x2793ef||0x1f4;return function(_0x44b45f){logger[_0x3071('0x28')](_0x44b45f[_0x3071('0x29')]);if(_0x44b45f[_0x3071('0x2a')]){delete _0x44b45f['name'];}_0x13df9f[_0x3071('0x20')](_0x2793ef)[_0x3071('0x2b')](_0x44b45f);};}exports[_0x3071('0x2c')]=function(_0x4d5c4b,_0x4fb1ca){var _0x28792d={},_0x163604={},_0x950fde={'count':0x0,'rows':[]};var _0x3fa3b8=_[_0x3071('0x2d')](db[_0x3071('0x2e')][_0x3071('0x2f')],function(_0x32f1b4){return{'name':_0x32f1b4[_0x3071('0x30')],'type':_0x32f1b4[_0x3071('0x31')]['key']};});_0x163604['model']=_[_0x3071('0x2d')](_0x3fa3b8,_0x3071('0x2a'));_0x163604[_0x3071('0x32')]=_[_0x3071('0x33')](_0x4d5c4b[_0x3071('0x32')]);_0x163604[_0x3071('0x34')]=_[_0x3071('0x35')](_0x163604[_0x3071('0x36')],_0x163604['query']);_0x28792d['attributes']=_['intersection'](_0x163604[_0x3071('0x36')],qs[_0x3071('0x37')](_0x4d5c4b['query'][_0x3071('0x37')]));_0x28792d[_0x3071('0x38')]=_0x28792d[_0x3071('0x38')][_0x3071('0x39')]?_0x28792d['attributes']:_0x163604[_0x3071('0x36')];if(!_0x4d5c4b[_0x3071('0x32')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x28792d[_0x3071('0x1f')]=qs[_0x3071('0x1f')](_0x4d5c4b[_0x3071('0x32')][_0x3071('0x1f')]);_0x28792d['offset']=qs[_0x3071('0x1e')](_0x4d5c4b['query']['offset']);}_0x28792d[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x4d5c4b['query'][_0x3071('0x3d')]);_0x28792d[_0x3071('0x3e')]=qs[_0x3071('0x34')](_[_0x3071('0x3f')](_0x4d5c4b[_0x3071('0x32')],_0x163604[_0x3071('0x34')]),_0x3fa3b8);if(_0x4d5c4b['query'][_0x3071('0x40')]){_0x28792d[_0x3071('0x3e')]=_['merge'](_0x28792d[_0x3071('0x3e')],{'$or':_['map'](_0x3fa3b8,function(_0x28f855){if(_0x28f855[_0x3071('0x31')]!=='VIRTUAL'){var _0x593c99={};_0x593c99[_0x28f855[_0x3071('0x2a')]]={'$like':'%'+_0x4d5c4b[_0x3071('0x32')][_0x3071('0x40')]+'%'};return _0x593c99;}})});}_0x28792d=_['merge']({},_0x28792d,_0x4d5c4b[_0x3071('0x41')]);var _0x534a77={'where':_0x28792d[_0x3071('0x3e')]};return db['ChatQueueReport'][_0x3071('0x1d')](_0x534a77)[_0x3071('0x26')](function(_0x1fcc52){_0x950fde[_0x3071('0x1d')]=_0x1fcc52;if(_0x4d5c4b[_0x3071('0x32')]['includeAll']){_0x28792d['include']=[{'all':!![]}];}return db[_0x3071('0x2e')][_0x3071('0x42')](_0x28792d);})[_0x3071('0x26')](function(_0x1f69a6){_0x950fde['rows']=_0x1f69a6;return _0x950fde;})[_0x3071('0x26')](respondWithFilteredResult(_0x4fb1ca,_0x28792d))[_0x3071('0x43')](handleError(_0x4fb1ca,null));};exports[_0x3071('0x44')]=function(_0x25c29f,_0x277104){var _0xb9a4b8={'raw':!![],'where':{'id':_0x25c29f[_0x3071('0x45')]['id']}},_0x56a9d8={};_0x56a9d8['model']=_['keys'](db['ChatQueueReport']['rawAttributes']);_0x56a9d8[_0x3071('0x32')]=_[_0x3071('0x33')](_0x25c29f[_0x3071('0x32')]);_0x56a9d8[_0x3071('0x34')]=_[_0x3071('0x35')](_0x56a9d8[_0x3071('0x36')],_0x56a9d8[_0x3071('0x32')]);_0xb9a4b8[_0x3071('0x38')]=_['intersection'](_0x56a9d8[_0x3071('0x36')],qs[_0x3071('0x37')](_0x25c29f[_0x3071('0x32')][_0x3071('0x37')]));_0xb9a4b8[_0x3071('0x38')]=_0xb9a4b8['attributes']['length']?_0xb9a4b8[_0x3071('0x38')]:_0x56a9d8[_0x3071('0x36')];if(_0x25c29f[_0x3071('0x32')][_0x3071('0x46')]){_0xb9a4b8[_0x3071('0x47')]=[{'all':!![]}];}_0xb9a4b8=_['merge']({},_0xb9a4b8,_0x25c29f[_0x3071('0x41')]);return db['ChatQueueReport'][_0x3071('0x48')](_0xb9a4b8)['then'](handleEntityNotFound(_0x277104,null))['then'](respondWithResult(_0x277104,null))[_0x3071('0x43')](handleError(_0x277104,null));};exports['create']=function(_0x1862ea,_0x5a0a69){return db[_0x3071('0x2e')][_0x3071('0x49')](_0x1862ea[_0x3071('0x4a')],{})[_0x3071('0x26')](respondWithResult(_0x5a0a69,0xc9))['catch'](handleError(_0x5a0a69,null));};exports[_0x3071('0x4b')]=function(_0x575c12,_0xd273ec){if(_0x575c12['body']['id']){delete _0x575c12[_0x3071('0x4a')]['id'];}return db[_0x3071('0x2e')]['find']({'where':{'id':_0x575c12[_0x3071('0x45')]['id']}})[_0x3071('0x26')](handleEntityNotFound(_0xd273ec,null))[_0x3071('0x26')](saveUpdates(_0x575c12[_0x3071('0x4a')],null))[_0x3071('0x26')](respondWithResult(_0xd273ec,null))[_0x3071('0x43')](handleError(_0xd273ec,null));};exports[_0x3071('0x27')]=function(_0x577060,_0x2c6e4c){return db[_0x3071('0x2e')][_0x3071('0x48')]({'where':{'id':_0x577060[_0x3071('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c6e4c,null))[_0x3071('0x26')](removeEntity(_0x2c6e4c,null))[_0x3071('0x43')](handleError(_0x2c6e4c,null));};exports[_0x3071('0x4c')]=function(_0x2307dd,_0x22aade){return db[_0x3071('0x2e')][_0x3071('0x4c')]()[_0x3071('0x26')](respondWithResult(_0x22aade,null))[_0x3071('0x43')](handleError(_0x22aade,null));};
\ No newline at end of file
+var _0x757a=['count','findAll','rows','catch','params','keys','includeAll','include','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','json','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','map','VIRTUAL','options','ChatQueueReport'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x757a,0xde));var _0xa757=function(_0x339f59,_0x551adf){_0x339f59=_0x339f59-0x0;var _0x591e7a=_0x757a[_0x339f59];return _0x591e7a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa757('0x0'));var rimraf=require(_0xa757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa757('0x2'));var BPromise=require(_0xa757('0x3'));var Mustache=require(_0xa757('0x4'));var util=require(_0xa757('0x5'));var path=require(_0xa757('0x6'));var sox=require(_0xa757('0x7'));var csv=require('to-csv');var ejs=require(_0xa757('0x8'));var fs=require('fs');var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0xd'));var querystring=require(_0xa757('0xe'));var Papa=require('papaparse');var Redis=require(_0xa757('0xf'));var authService=require(_0xa757('0x10'));var qs=require(_0xa757('0x11'));var as=require(_0xa757('0x12'));var hardwareService=require(_0xa757('0x13'));var logger=require(_0xa757('0x14'))(_0xa757('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56acfb,_0x4db68e){_0x4db68e=_0x4db68e||0xcc;return function(_0x421040){if(_0x421040){return _0x56acfb['sendStatus'](_0x4db68e);}return _0x56acfb['status'](_0x4db68e)[_0xa757('0x16')]();};}function respondWithResult(_0x513b1f,_0x481508){_0x481508=_0x481508||0xc8;return function(_0x32112b){if(_0x32112b){return _0x513b1f[_0xa757('0x17')](_0x481508)[_0xa757('0x18')](_0x32112b);}};}function respondWithFilteredResult(_0x4a0c38,_0x86abd){return function(_0x31cfd2){if(_0x31cfd2){var _0xf12b68=_0x31cfd2['count'],_0x2f7947=_0x86abd[_0xa757('0x19')],_0x185011=_0x86abd[_0xa757('0x19')]+_0x86abd[_0xa757('0x1a')],_0x3df1f9;if(_0x185011>=_0xf12b68){_0x185011=_0xf12b68;_0x3df1f9=0xc8;}else{_0x3df1f9=0xce;}_0x4a0c38['status'](_0x3df1f9);return _0x4a0c38['set'](_0xa757('0x1b'),_0x2f7947+'-'+_0x185011+'/'+_0xf12b68)[_0xa757('0x18')](_0x31cfd2);}return null;};}function patchUpdates(_0x1bd14c){return function(_0x340599){try{jsonpatch[_0xa757('0x1c')](_0x340599,_0x1bd14c,!![]);}catch(_0xe2d567){return BPromise['reject'](_0xe2d567);}return _0x340599[_0xa757('0x1d')]();};}function saveUpdates(_0x4fec52,_0x32c2a1){return function(_0x167640){if(_0x167640){return _0x167640[_0xa757('0x1e')](_0x4fec52)[_0xa757('0x1f')](function(_0x4d598c){return _0x4d598c;});}return null;};}function removeEntity(_0x5638c7,_0x40ec48){return function(_0x2159cf){if(_0x2159cf){return _0x2159cf[_0xa757('0x20')]()[_0xa757('0x1f')](function(){_0x5638c7[_0xa757('0x17')](0xcc)[_0xa757('0x16')]();});}};}function handleEntityNotFound(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(!_0x2bf276){_0x2ca10d['sendStatus'](0x194);}return _0x2bf276;};}function handleError(_0x3707c1,_0x59e9d4){_0x59e9d4=_0x59e9d4||0x1f4;return function(_0x422e9e){logger['error'](_0x422e9e[_0xa757('0x21')]);if(_0x422e9e[_0xa757('0x22')]){delete _0x422e9e[_0xa757('0x22')];}_0x3707c1['status'](_0x59e9d4)[_0xa757('0x23')](_0x422e9e);};}exports[_0xa757('0x24')]=function(_0x471e84,_0x3bf7f3){var _0x5b4779={},_0x449a7d={},_0x54263b={'count':0x0,'rows':[]};var _0x5a5664=_['map'](db['ChatQueueReport'][_0xa757('0x25')],function(_0x596ae2){return{'name':_0x596ae2[_0xa757('0x26')],'type':_0x596ae2[_0xa757('0x27')]['key']};});_0x449a7d[_0xa757('0x28')]=_['map'](_0x5a5664,_0xa757('0x22'));_0x449a7d[_0xa757('0x29')]=_['keys'](_0x471e84[_0xa757('0x29')]);_0x449a7d['filters']=_[_0xa757('0x2a')](_0x449a7d[_0xa757('0x28')],_0x449a7d[_0xa757('0x29')]);_0x5b4779[_0xa757('0x2b')]=_[_0xa757('0x2a')](_0x449a7d[_0xa757('0x28')],qs[_0xa757('0x2c')](_0x471e84[_0xa757('0x29')][_0xa757('0x2c')]));_0x5b4779[_0xa757('0x2b')]=_0x5b4779[_0xa757('0x2b')][_0xa757('0x2d')]?_0x5b4779[_0xa757('0x2b')]:_0x449a7d[_0xa757('0x28')];if(!_0x471e84[_0xa757('0x29')][_0xa757('0x2e')](_0xa757('0x2f'))){_0x5b4779[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x471e84[_0xa757('0x29')][_0xa757('0x1a')]);_0x5b4779[_0xa757('0x19')]=qs[_0xa757('0x19')](_0x471e84[_0xa757('0x29')]['offset']);}_0x5b4779[_0xa757('0x30')]=qs[_0xa757('0x31')](_0x471e84[_0xa757('0x29')][_0xa757('0x31')]);_0x5b4779[_0xa757('0x32')]=qs['filters'](_[_0xa757('0x33')](_0x471e84[_0xa757('0x29')],_0x449a7d[_0xa757('0x34')]),_0x5a5664);if(_0x471e84[_0xa757('0x29')][_0xa757('0x35')]){_0x5b4779[_0xa757('0x32')]=_['merge'](_0x5b4779[_0xa757('0x32')],{'$or':_[_0xa757('0x36')](_0x5a5664,function(_0x2cade7){if(_0x2cade7[_0xa757('0x27')]!==_0xa757('0x37')){var _0x111cfe={};_0x111cfe[_0x2cade7[_0xa757('0x22')]]={'$like':'%'+_0x471e84[_0xa757('0x29')][_0xa757('0x35')]+'%'};return _0x111cfe;}})});}_0x5b4779=_['merge']({},_0x5b4779,_0x471e84[_0xa757('0x38')]);var _0x34fba8={'where':_0x5b4779[_0xa757('0x32')]};return db[_0xa757('0x39')][_0xa757('0x3a')](_0x34fba8)[_0xa757('0x1f')](function(_0x501e26){_0x54263b[_0xa757('0x3a')]=_0x501e26;if(_0x471e84[_0xa757('0x29')]['includeAll']){_0x5b4779['include']=[{'all':!![]}];}return db[_0xa757('0x39')][_0xa757('0x3b')](_0x5b4779);})['then'](function(_0x51c3d1){_0x54263b[_0xa757('0x3c')]=_0x51c3d1;return _0x54263b;})[_0xa757('0x1f')](respondWithFilteredResult(_0x3bf7f3,_0x5b4779))[_0xa757('0x3d')](handleError(_0x3bf7f3,null));};exports['show']=function(_0x830dc4,_0x13a8f4){var _0x26802c={'raw':!![],'where':{'id':_0x830dc4[_0xa757('0x3e')]['id']}},_0x1ba399={};_0x1ba399['model']=_[_0xa757('0x3f')](db['ChatQueueReport']['rawAttributes']);_0x1ba399[_0xa757('0x29')]=_[_0xa757('0x3f')](_0x830dc4[_0xa757('0x29')]);_0x1ba399[_0xa757('0x34')]=_[_0xa757('0x2a')](_0x1ba399['model'],_0x1ba399['query']);_0x26802c[_0xa757('0x2b')]=_[_0xa757('0x2a')](_0x1ba399[_0xa757('0x28')],qs[_0xa757('0x2c')](_0x830dc4[_0xa757('0x29')][_0xa757('0x2c')]));_0x26802c['attributes']=_0x26802c[_0xa757('0x2b')][_0xa757('0x2d')]?_0x26802c['attributes']:_0x1ba399[_0xa757('0x28')];if(_0x830dc4['query'][_0xa757('0x40')]){_0x26802c[_0xa757('0x41')]=[{'all':!![]}];}_0x26802c=_['merge']({},_0x26802c,_0x830dc4[_0xa757('0x38')]);return db[_0xa757('0x39')]['find'](_0x26802c)[_0xa757('0x1f')](handleEntityNotFound(_0x13a8f4,null))[_0xa757('0x1f')](respondWithResult(_0x13a8f4,null))[_0xa757('0x3d')](handleError(_0x13a8f4,null));};exports[_0xa757('0x42')]=function(_0x543b5b,_0x199dc9){return db[_0xa757('0x39')][_0xa757('0x42')](_0x543b5b[_0xa757('0x43')],{})['then'](respondWithResult(_0x199dc9,0xc9))[_0xa757('0x3d')](handleError(_0x199dc9,null));};exports['update']=function(_0x50c131,_0x2acf88){if(_0x50c131[_0xa757('0x43')]['id']){delete _0x50c131[_0xa757('0x43')]['id'];}return db['ChatQueueReport'][_0xa757('0x44')]({'where':{'id':_0x50c131['params']['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x2acf88,null))[_0xa757('0x1f')](saveUpdates(_0x50c131[_0xa757('0x43')],null))[_0xa757('0x1f')](respondWithResult(_0x2acf88,null))[_0xa757('0x3d')](handleError(_0x2acf88,null));};exports[_0xa757('0x20')]=function(_0x57bf73,_0x505cd){return db['ChatQueueReport'][_0xa757('0x44')]({'where':{'id':_0x57bf73[_0xa757('0x3e')]['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x505cd,null))[_0xa757('0x1f')](removeEntity(_0x505cd,null))[_0xa757('0x3d')](handleError(_0x505cd,null));};exports[_0xa757('0x45')]=function(_0x15bad7,_0x2c5b3c){return db[_0xa757('0x39')][_0xa757('0x45')]()[_0xa757('0x1f')](respondWithResult(_0x2c5b3c,null))[_0xa757('0x3d')](handleError(_0x2c5b3c,null));};
\ No newline at end of file
index f331a71..5846f6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc04=['report_chat_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueueReport'];(function(_0x46796c,_0x5c060d){var _0x5a71e4=function(_0x117fc8){while(--_0x117fc8){_0x46796c['push'](_0x46796c['shift']());}};_0x5a71e4(++_0x5c060d);}(_0xbc04,0xaa));var _0x4bc0=function(_0x1200c4,_0x5c84fd){_0x1200c4=_0x1200c4-0x0;var _0x1cf050=_0xbc04[_0x1200c4];return _0x1cf050;};'use strict';var _=require(_0x4bc0('0x0'));var util=require(_0x4bc0('0x1'));var logger=require(_0x4bc0('0x2'))('api');var moment=require(_0x4bc0('0x3'));var BPromise=require(_0x4bc0('0x4'));var rp=require(_0x4bc0('0x5'));var fs=require('fs');var path=require(_0x4bc0('0x6'));var rimraf=require(_0x4bc0('0x7'));var config=require(_0x4bc0('0x8'));var attributes=require('./chatQueueReport.attributes');module[_0x4bc0('0x9')]=function(_0x2c779a,_0x46b348){return _0x2c779a[_0x4bc0('0xa')](_0x4bc0('0xb'),attributes,{'tableName':_0x4bc0('0xc'),'paranoid':![],'indexes':[{'name':_0x4bc0('0xd'),'fields':[_0x4bc0('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9fdd=['ChatQueueReport','report_chat_queue','uniqueid','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9fdd,0x15f));var _0xd9fd=function(_0xcdee1f,_0x4fec06){_0xcdee1f=_0xcdee1f-0x0;var _0x16cd17=_0x9fdd[_0xcdee1f];return _0x16cd17;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd9fd('0x0'))(_0xd9fd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd9fd('0x2'));var fs=require('fs');var path=require(_0xd9fd('0x3'));var rimraf=require(_0xd9fd('0x4'));var config=require(_0xd9fd('0x5'));var attributes=require(_0xd9fd('0x6'));module[_0xd9fd('0x7')]=function(_0x3255d2,_0x28558a){return _0x3255d2[_0xd9fd('0x8')](_0xd9fd('0x9'),attributes,{'tableName':_0xd9fd('0xa'),'paranoid':![],'indexes':[{'name':_0xd9fd('0xb'),'fields':[_0xd9fd('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 08eeba6..c998ba9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa300=['debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit'];(function(_0x229ba7,_0x23aff8){var _0x5bae2c=function(_0x2c2ce3){while(--_0x2c2ce3){_0x229ba7['push'](_0x229ba7['shift']());}};_0x5bae2c(++_0x23aff8);}(_0xa300,0x12a));var _0x0a30=function(_0x28793f,_0xf8c52e){_0x28793f=_0x28793f-0x0;var _0x14ee3a=_0xa300[_0x28793f];return _0x14ee3a;};'use strict';var _=require('lodash');var util=require(_0x0a30('0x0'));var moment=require(_0x0a30('0x1'));var BPromise=require(_0x0a30('0x2'));var rs=require(_0x0a30('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a30('0x4'))['db'];var utils=require(_0x0a30('0x5'));var logger=require(_0x0a30('0x6'))(_0x0a30('0x7'));var config=require(_0x0a30('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0a30('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52d969,_0x1d9a07,_0x377323){return new BPromise(function(_0x306984,_0x479b12){return client[_0x0a30('0xa')](_0x52d969,_0x377323)[_0x0a30('0xb')](function(_0x5d995e){logger[_0x0a30('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x1d9a07,_0x0a30('0xd'));logger['debug'](_0x0a30('0xe'),_0x1d9a07,_0x0a30('0xd'),JSON[_0x0a30('0xf')](_0x5d995e));if(_0x5d995e[_0x0a30('0x10')]){if(_0x5d995e[_0x0a30('0x10')]['code']===0x1f4){logger['error'](_0x0a30('0x11'),_0x1d9a07,_0x5d995e['error']['message']);return _0x479b12(_0x5d995e[_0x0a30('0x10')][_0x0a30('0x12')]);}logger[_0x0a30('0x10')](_0x0a30('0x11'),_0x1d9a07,_0x5d995e[_0x0a30('0x10')][_0x0a30('0x12')]);return _0x306984(_0x5d995e[_0x0a30('0x10')][_0x0a30('0x12')]);}else{logger['info'](_0x0a30('0x11'),_0x1d9a07,_0x0a30('0xd'));_0x306984(_0x5d995e[_0x0a30('0x13')][_0x0a30('0x12')]);}})[_0x0a30('0x14')](function(_0x43af2d){logger[_0x0a30('0x10')](_0x0a30('0x11'),_0x1d9a07,_0x43af2d);_0x479b12(_0x43af2d);});});}exports['CreateChatQueueReport']=function(_0x4ddb32){var _0x3faff1=this;return new Promise(function(_0x297528,_0x55558a){return db['ChatQueueReport'][_0x0a30('0x15')](_0x4ddb32[_0x0a30('0x16')],{'raw':_0x4ddb32[_0x0a30('0x17')]?_0x4ddb32['options'][_0x0a30('0x18')]===undefined?!![]:![]:!![]})[_0x0a30('0xb')](function(_0x427bc5){logger[_0x0a30('0xc')](_0x0a30('0x19'),_0x4ddb32);logger['debug']('CreateChatQueueReport',_0x4ddb32,JSON[_0x0a30('0xf')](_0x427bc5));_0x297528(_0x427bc5);})[_0x0a30('0x14')](function(_0x19760f){logger[_0x0a30('0x10')](_0x0a30('0x19'),_0x19760f[_0x0a30('0x12')],_0x4ddb32);_0x55558a(_0x3faff1['error'](0x1f4,_0x19760f['message']));});});};exports[_0x0a30('0x1a')]=function(_0x2ffa34){var _0x3e7f9b=this;return new Promise(function(_0x3d0259,_0x19bf97){return db[_0x0a30('0x1b')][_0x0a30('0x1c')](_0x2ffa34['body'],{'raw':_0x2ffa34[_0x0a30('0x17')]?_0x2ffa34[_0x0a30('0x17')][_0x0a30('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ffa34[_0x0a30('0x17')]?_0x2ffa34[_0x0a30('0x17')][_0x0a30('0x1d')]||null:null,'attributes':_0x2ffa34[_0x0a30('0x17')]?_0x2ffa34[_0x0a30('0x17')][_0x0a30('0x1e')]||null:null,'limit':_0x2ffa34[_0x0a30('0x17')]?_0x2ffa34['options'][_0x0a30('0x1f')]||null:null})[_0x0a30('0xb')](function(_0x73f5ce){logger[_0x0a30('0xc')](_0x0a30('0x1a'),_0x2ffa34);logger[_0x0a30('0x20')](_0x0a30('0x1a'),_0x2ffa34,JSON['stringify'](_0x73f5ce));_0x3d0259(_0x73f5ce);})['catch'](function(_0x4ea00a){logger[_0x0a30('0x10')](_0x0a30('0x1a'),_0x4ea00a[_0x0a30('0x12')],_0x2ffa34);_0x19bf97(_0x3e7f9b['error'](0x1f4,_0x4ea00a[_0x0a30('0x12')]));});});};
\ No newline at end of file
+var _0x4676=['then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','update','where','attributes','limit','UpdateChatQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x8f7d2b,_0x1bebaf){var _0x13c298=function(_0x54717e){while(--_0x54717e){_0x8f7d2b['push'](_0x8f7d2b['shift']());}};_0x13c298(++_0x1bebaf);}(_0x4676,0x1e3));var _0x6467=function(_0x4123ca,_0x60ee13){_0x4123ca=_0x4123ca-0x0;var _0x25a900=_0x4676[_0x4123ca];return _0x25a900;};'use strict';var _=require(_0x6467('0x0'));var util=require(_0x6467('0x1'));var moment=require('moment');var BPromise=require(_0x6467('0x2'));var rs=require(_0x6467('0x3'));var fs=require('fs');var Redis=require(_0x6467('0x4'));var db=require(_0x6467('0x5'))['db'];var utils=require(_0x6467('0x6'));var logger=require(_0x6467('0x7'))(_0x6467('0x8'));var config=require(_0x6467('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6467('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4edfa0,_0x2cc22d,_0x3cea11){return new BPromise(function(_0x49ecd5,_0x2350cd){return client[_0x6467('0xb')](_0x4edfa0,_0x3cea11)[_0x6467('0xc')](function(_0x415e35){logger[_0x6467('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x2cc22d,'request\x20sent');logger[_0x6467('0xe')](_0x6467('0xf'),_0x2cc22d,'request\x20sent',JSON[_0x6467('0x10')](_0x415e35));if(_0x415e35['error']){if(_0x415e35[_0x6467('0x11')]['code']===0x1f4){logger[_0x6467('0x11')](_0x6467('0x12'),_0x2cc22d,_0x415e35[_0x6467('0x11')][_0x6467('0x13')]);return _0x2350cd(_0x415e35[_0x6467('0x11')][_0x6467('0x13')]);}logger[_0x6467('0x11')](_0x6467('0x12'),_0x2cc22d,_0x415e35[_0x6467('0x11')][_0x6467('0x13')]);return _0x49ecd5(_0x415e35[_0x6467('0x11')][_0x6467('0x13')]);}else{logger[_0x6467('0xd')](_0x6467('0x12'),_0x2cc22d,_0x6467('0x14'));_0x49ecd5(_0x415e35[_0x6467('0x15')][_0x6467('0x13')]);}})[_0x6467('0x16')](function(_0x5ec612){logger[_0x6467('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x2cc22d,_0x5ec612);_0x2350cd(_0x5ec612);});});}exports[_0x6467('0x17')]=function(_0x1cb8ff){var _0x18a3e6=this;return new Promise(function(_0x2a1046,_0x1e682e){return db[_0x6467('0x18')]['create'](_0x1cb8ff[_0x6467('0x19')],{'raw':_0x1cb8ff[_0x6467('0x1a')]?_0x1cb8ff['options'][_0x6467('0x1b')]===undefined?!![]:![]:!![]})[_0x6467('0xc')](function(_0x4ad7f9){logger['info']('CreateChatQueueReport',_0x1cb8ff);logger[_0x6467('0xe')](_0x6467('0x17'),_0x1cb8ff,JSON[_0x6467('0x10')](_0x4ad7f9));_0x2a1046(_0x4ad7f9);})[_0x6467('0x16')](function(_0x2ddd15){logger[_0x6467('0x11')](_0x6467('0x17'),_0x2ddd15[_0x6467('0x13')],_0x1cb8ff);_0x1e682e(_0x18a3e6[_0x6467('0x11')](0x1f4,_0x2ddd15['message']));});});};exports['UpdateChatQueueReport']=function(_0x4e2ffb){var _0x3d1f1a=this;return new Promise(function(_0x1990f8,_0x368b5){return db[_0x6467('0x18')][_0x6467('0x1c')](_0x4e2ffb[_0x6467('0x19')],{'raw':_0x4e2ffb[_0x6467('0x1a')]?_0x4e2ffb[_0x6467('0x1a')][_0x6467('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e2ffb['options']?_0x4e2ffb[_0x6467('0x1a')][_0x6467('0x1d')]||null:null,'attributes':_0x4e2ffb[_0x6467('0x1a')]?_0x4e2ffb[_0x6467('0x1a')][_0x6467('0x1e')]||null:null,'limit':_0x4e2ffb['options']?_0x4e2ffb[_0x6467('0x1a')][_0x6467('0x1f')]||null:null})[_0x6467('0xc')](function(_0x276cc0){logger[_0x6467('0xd')](_0x6467('0x20'),_0x4e2ffb);logger[_0x6467('0xe')](_0x6467('0x20'),_0x4e2ffb,JSON[_0x6467('0x10')](_0x276cc0));_0x1990f8(_0x276cc0);})[_0x6467('0x16')](function(_0x27fdf0){logger[_0x6467('0x11')](_0x6467('0x20'),_0x27fdf0['message'],_0x4e2ffb);_0x368b5(_0x3d1f1a[_0x6467('0x11')](0x1f4,_0x27fdf0[_0x6467('0x13')]));});});};
\ No newline at end of file
index 45edc45..8edfe02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x104c=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0xe972f5,_0x126e04){var _0x2f213a=function(_0x5df8e4){while(--_0x5df8e4){_0xe972f5['push'](_0xe972f5['shift']());}};_0x2f213a(++_0x126e04);}(_0x104c,0x123));var _0xc104=function(_0x176cb8,_0x1c7ab3){_0x176cb8=_0x176cb8-0x0;var _0x41c08b=_0x104c[_0x176cb8];return _0x41c08b;};'use strict';var multer=require('multer');var util=require(_0xc104('0x0'));var path=require(_0xc104('0x1'));var timeout=require(_0xc104('0x2'));var express=require(_0xc104('0x3'));var router=express[_0xc104('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc104('0x5'));var config=require(_0xc104('0x6'));var controller=require(_0xc104('0x7'));router['get']('/',auth[_0xc104('0x8')](),controller[_0xc104('0x9')]);router[_0xc104('0xa')](_0xc104('0xb'),auth[_0xc104('0x8')](),controller[_0xc104('0xc')]);router['get'](_0xc104('0xd'),auth[_0xc104('0x8')](),controller[_0xc104('0xe')]);router[_0xc104('0xf')]('/',auth[_0xc104('0x8')](),controller[_0xc104('0x10')]);router[_0xc104('0x11')](_0xc104('0xd'),auth[_0xc104('0x8')](),controller[_0xc104('0x12')]);router[_0xc104('0x13')](_0xc104('0xd'),auth['isAuthenticated'](),controller[_0xc104('0x14')]);module[_0xc104('0x15')]=router;
\ No newline at end of file
+var _0x466d=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller'];(function(_0x34c32f,_0x231983){var _0x47e67e=function(_0x86eaaf){while(--_0x86eaaf){_0x34c32f['push'](_0x34c32f['shift']());}};_0x47e67e(++_0x231983);}(_0x466d,0x1ec));var _0xd466=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x466d[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0xd466('0x0'));var path=require(_0xd466('0x1'));var timeout=require(_0xd466('0x2'));var express=require(_0xd466('0x3'));var router=express[_0xd466('0x4')]();var auth=require(_0xd466('0x5'));var interaction=require(_0xd466('0x6'));var config=require('../../config/environment');var controller=require(_0xd466('0x7'));router[_0xd466('0x8')]('/',auth[_0xd466('0x9')](),controller[_0xd466('0xa')]);router[_0xd466('0x8')](_0xd466('0xb'),auth['isAuthenticated'](),controller[_0xd466('0xc')]);router[_0xd466('0x8')](_0xd466('0xd'),auth[_0xd466('0x9')](),controller[_0xd466('0xe')]);router[_0xd466('0xf')]('/',auth[_0xd466('0x9')](),controller[_0xd466('0x10')]);router['put'](_0xd466('0xd'),auth[_0xd466('0x9')](),controller['update']);router[_0xd466('0x11')]('/:id',auth[_0xd466('0x9')](),controller[_0xd466('0x12')]);module[_0xd466('0x13')]=router;
\ No newline at end of file
index 4cae2b1..cd9af0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe94b=['ENUM','account','agent','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1d3a1e,_0x6a0a91){var _0x3f18c=function(_0x6e46bc){while(--_0x6e46bc){_0x1d3a1e['push'](_0x1d3a1e['shift']());}};_0x3f18c(++_0x6a0a91);}(_0xe94b,0xe7));var _0xbe94=function(_0x4813c3,_0x1ceeb3){_0x4813c3=_0x4813c3-0x0;var _0x4803d2=_0xe94b[_0x4813c3];return _0x4803d2;};'use strict';var moment=require(_0xbe94('0x0'));var Sequelize=require(_0xbe94('0x1'));module[_0xbe94('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xbe94('0x3')](_0xbe94('0x4'),_0xbe94('0x5'),_0xbe94('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xbe94('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xbe94('0x8')]}};
\ No newline at end of file
+var _0x26cc=['ENUM','account','agent','queue','DATE','NOW','sequelize','STRING'];(function(_0xd20309,_0x16add9){var _0x18694c=function(_0x5235d5){while(--_0x5235d5){_0xd20309['push'](_0xd20309['shift']());}};_0x18694c(++_0x16add9);}(_0x26cc,0x166));var _0xc26c=function(_0x226ad1,_0x2858e2){_0x226ad1=_0x226ad1-0x0;var _0x16b625=_0x26cc[_0x226ad1];return _0x16b625;};'use strict';var moment=require('moment');var Sequelize=require(_0xc26c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc26c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc26c('0x2')](_0xc26c('0x3'),_0xc26c('0x4'),_0xc26c('0x5')),'allowNull':![],'defaultValue':_0xc26c('0x5')},'transferredAt':{'type':Sequelize[_0xc26c('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xc26c('0x7')]}};
\ No newline at end of file
index 973fa72..04d0540 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f60=['show','params','include','options','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','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','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch'];(function(_0xbce8bd,_0xc2544b){var _0xbb54b2=function(_0x502ebc){while(--_0x502ebc){_0xbce8bd['push'](_0xbce8bd['shift']());}};_0xbb54b2(++_0xc2544b);}(_0x4f60,0xa4));var _0x04f6=function(_0x43f413,_0x393f08){_0x43f413=_0x43f413-0x0;var _0x59b841=_0x4f60[_0x43f413];return _0x59b841;};'use strict';var pdf=require(_0x04f6('0x0'));var emlformat=require(_0x04f6('0x1'));var rimraf=require(_0x04f6('0x2'));var zipdir=require(_0x04f6('0x3'));var jsonpatch=require(_0x04f6('0x4'));var rp=require('request-promise');var moment=require(_0x04f6('0x5'));var BPromise=require(_0x04f6('0x6'));var Mustache=require(_0x04f6('0x7'));var util=require(_0x04f6('0x8'));var path=require('path');var sox=require(_0x04f6('0x9'));var csv=require(_0x04f6('0xa'));var ejs=require(_0x04f6('0xb'));var fs=require('fs');var _=require(_0x04f6('0xc'));var squel=require(_0x04f6('0xd'));var crypto=require(_0x04f6('0xe'));var jsforce=require(_0x04f6('0xf'));var deskjs=require(_0x04f6('0x10'));var toCsv=require(_0x04f6('0xa'));var querystring=require(_0x04f6('0x11'));var Papa=require(_0x04f6('0x12'));var Redis=require(_0x04f6('0x13'));var authService=require(_0x04f6('0x14'));var qs=require(_0x04f6('0x15'));var as=require(_0x04f6('0x16'));var hardwareService=require(_0x04f6('0x17'));var logger=require('../../config/logger')(_0x04f6('0x18'));var utils=require(_0x04f6('0x19'));var config=require(_0x04f6('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e4712,_0x502a58){_0x502a58=_0x502a58||0xcc;return function(_0x2d5b75){if(_0x2d5b75){return _0x1e4712[_0x04f6('0x1b')](_0x502a58);}return _0x1e4712[_0x04f6('0x1c')](_0x502a58)[_0x04f6('0x1d')]();};}function respondWithResult(_0x3a96a8,_0x14c077){_0x14c077=_0x14c077||0xc8;return function(_0x5c2f99){if(_0x5c2f99){return _0x3a96a8[_0x04f6('0x1c')](_0x14c077)['json'](_0x5c2f99);}};}function respondWithFilteredResult(_0x1bf11b,_0x4bf9e9){return function(_0x36192e){if(_0x36192e){var _0x3f5e44=_0x36192e[_0x04f6('0x1e')],_0x3baf62=_0x4bf9e9[_0x04f6('0x1f')],_0x1db291=_0x4bf9e9[_0x04f6('0x1f')]+_0x4bf9e9[_0x04f6('0x20')],_0x5db6e9;if(_0x1db291>=_0x3f5e44){_0x1db291=_0x3f5e44;_0x5db6e9=0xc8;}else{_0x5db6e9=0xce;}_0x1bf11b['status'](_0x5db6e9);return _0x1bf11b[_0x04f6('0x21')](_0x04f6('0x22'),_0x3baf62+'-'+_0x1db291+'/'+_0x3f5e44)[_0x04f6('0x23')](_0x36192e);}return null;};}function patchUpdates(_0x125c68){return function(_0x37c940){try{jsonpatch[_0x04f6('0x24')](_0x37c940,_0x125c68,!![]);}catch(_0x14feeb){return BPromise[_0x04f6('0x25')](_0x14feeb);}return _0x37c940['save']();};}function saveUpdates(_0x2ce1ea,_0x9161b5){return function(_0x39829c){if(_0x39829c){return _0x39829c[_0x04f6('0x26')](_0x2ce1ea)['then'](function(_0x215100){return _0x215100;});}return null;};}function removeEntity(_0x1372f8,_0x33f68a){return function(_0x3224fb){if(_0x3224fb){return _0x3224fb[_0x04f6('0x27')]()[_0x04f6('0x28')](function(){_0x1372f8[_0x04f6('0x1c')](0xcc)[_0x04f6('0x1d')]();});}};}function handleEntityNotFound(_0x19cf25,_0x24f637){return function(_0x40522d){if(!_0x40522d){_0x19cf25['sendStatus'](0x194);}return _0x40522d;};}function handleError(_0x1c84dc,_0x21bcc2){_0x21bcc2=_0x21bcc2||0x1f4;return function(_0x59976c){logger[_0x04f6('0x29')](_0x59976c[_0x04f6('0x2a')]);if(_0x59976c[_0x04f6('0x2b')]){delete _0x59976c[_0x04f6('0x2b')];}_0x1c84dc[_0x04f6('0x1c')](_0x21bcc2)[_0x04f6('0x2c')](_0x59976c);};}exports['index']=function(_0x502dad,_0x311735){var _0x97cee={},_0x50a8ed={},_0x287824={'count':0x0,'rows':[]};var _0x15f742=_[_0x04f6('0x2d')](db[_0x04f6('0x2e')][_0x04f6('0x2f')],function(_0x4d3454){return{'name':_0x4d3454[_0x04f6('0x30')],'type':_0x4d3454[_0x04f6('0x31')][_0x04f6('0x32')]};});_0x50a8ed[_0x04f6('0x33')]=_[_0x04f6('0x2d')](_0x15f742,_0x04f6('0x2b'));_0x50a8ed[_0x04f6('0x34')]=_[_0x04f6('0x35')](_0x502dad[_0x04f6('0x34')]);_0x50a8ed[_0x04f6('0x36')]=_['intersection'](_0x50a8ed[_0x04f6('0x33')],_0x50a8ed[_0x04f6('0x34')]);_0x97cee[_0x04f6('0x37')]=_[_0x04f6('0x38')](_0x50a8ed[_0x04f6('0x33')],qs[_0x04f6('0x39')](_0x502dad[_0x04f6('0x34')][_0x04f6('0x39')]));_0x97cee[_0x04f6('0x37')]=_0x97cee[_0x04f6('0x37')]['length']?_0x97cee[_0x04f6('0x37')]:_0x50a8ed[_0x04f6('0x33')];if(!_0x502dad[_0x04f6('0x34')][_0x04f6('0x3a')](_0x04f6('0x3b'))){_0x97cee[_0x04f6('0x20')]=qs[_0x04f6('0x20')](_0x502dad['query'][_0x04f6('0x20')]);_0x97cee[_0x04f6('0x1f')]=qs[_0x04f6('0x1f')](_0x502dad['query']['offset']);}_0x97cee[_0x04f6('0x3c')]=qs[_0x04f6('0x3d')](_0x502dad[_0x04f6('0x34')][_0x04f6('0x3d')]);_0x97cee[_0x04f6('0x3e')]=qs[_0x04f6('0x36')](_[_0x04f6('0x3f')](_0x502dad['query'],_0x50a8ed[_0x04f6('0x36')]),_0x15f742);if(_0x502dad[_0x04f6('0x34')]['filter']){_0x97cee[_0x04f6('0x3e')]=_[_0x04f6('0x40')](_0x97cee[_0x04f6('0x3e')],{'$or':_[_0x04f6('0x2d')](_0x15f742,function(_0x1fa81){if(_0x1fa81[_0x04f6('0x31')]!==_0x04f6('0x41')){var _0x434873={};_0x434873[_0x1fa81[_0x04f6('0x2b')]]={'$like':'%'+_0x502dad['query']['filter']+'%'};return _0x434873;}})});}_0x97cee=_[_0x04f6('0x40')]({},_0x97cee,_0x502dad['options']);var _0x52ef16={'where':_0x97cee[_0x04f6('0x3e')]};return db[_0x04f6('0x2e')][_0x04f6('0x1e')](_0x52ef16)[_0x04f6('0x28')](function(_0x4d9b61){_0x287824[_0x04f6('0x1e')]=_0x4d9b61;if(_0x502dad['query'][_0x04f6('0x42')]){_0x97cee['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x04f6('0x43')](_0x97cee);})[_0x04f6('0x28')](function(_0x306d8e){_0x287824[_0x04f6('0x44')]=_0x306d8e;return _0x287824;})['then'](respondWithFilteredResult(_0x311735,_0x97cee))[_0x04f6('0x45')](handleError(_0x311735,null));};exports[_0x04f6('0x46')]=function(_0x29f663,_0x188656){var _0x3a33d0={'raw':!![],'where':{'id':_0x29f663[_0x04f6('0x47')]['id']}},_0x2ab7d4={};_0x2ab7d4[_0x04f6('0x33')]=_[_0x04f6('0x35')](db[_0x04f6('0x2e')]['rawAttributes']);_0x2ab7d4[_0x04f6('0x34')]=_[_0x04f6('0x35')](_0x29f663[_0x04f6('0x34')]);_0x2ab7d4[_0x04f6('0x36')]=_[_0x04f6('0x38')](_0x2ab7d4['model'],_0x2ab7d4[_0x04f6('0x34')]);_0x3a33d0[_0x04f6('0x37')]=_[_0x04f6('0x38')](_0x2ab7d4[_0x04f6('0x33')],qs[_0x04f6('0x39')](_0x29f663[_0x04f6('0x34')][_0x04f6('0x39')]));_0x3a33d0[_0x04f6('0x37')]=_0x3a33d0[_0x04f6('0x37')]['length']?_0x3a33d0[_0x04f6('0x37')]:_0x2ab7d4[_0x04f6('0x33')];if(_0x29f663[_0x04f6('0x34')]['includeAll']){_0x3a33d0[_0x04f6('0x48')]=[{'all':!![]}];}_0x3a33d0=_[_0x04f6('0x40')]({},_0x3a33d0,_0x29f663[_0x04f6('0x49')]);return db[_0x04f6('0x2e')]['find'](_0x3a33d0)[_0x04f6('0x28')](handleEntityNotFound(_0x188656,null))[_0x04f6('0x28')](respondWithResult(_0x188656,null))['catch'](handleError(_0x188656,null));};exports['create']=function(_0x37b05b,_0xdc7813){return db[_0x04f6('0x2e')][_0x04f6('0x4a')](_0x37b05b[_0x04f6('0x4b')],{})['then'](respondWithResult(_0xdc7813,0xc9))[_0x04f6('0x45')](handleError(_0xdc7813,null));};exports[_0x04f6('0x26')]=function(_0x1ac70c,_0x500496){if(_0x1ac70c[_0x04f6('0x4b')]['id']){delete _0x1ac70c['body']['id'];}return db[_0x04f6('0x2e')][_0x04f6('0x4c')]({'where':{'id':_0x1ac70c[_0x04f6('0x47')]['id']}})['then'](handleEntityNotFound(_0x500496,null))[_0x04f6('0x28')](saveUpdates(_0x1ac70c[_0x04f6('0x4b')],null))[_0x04f6('0x28')](respondWithResult(_0x500496,null))[_0x04f6('0x45')](handleError(_0x500496,null));};exports[_0x04f6('0x27')]=function(_0x297c30,_0x91c3f2){return db[_0x04f6('0x2e')][_0x04f6('0x4c')]({'where':{'id':_0x297c30[_0x04f6('0x47')]['id']}})[_0x04f6('0x28')](handleEntityNotFound(_0x91c3f2,null))[_0x04f6('0x28')](removeEntity(_0x91c3f2,null))[_0x04f6('0x45')](handleError(_0x91c3f2,null));};exports[_0x04f6('0x4d')]=function(_0x485d10,_0x4dd84d){return db[_0x04f6('0x2e')]['describe']()[_0x04f6('0x28')](respondWithResult(_0x4dd84d,null))['catch'](handleError(_0x4dd84d,null));};
\ No newline at end of file
+var _0xa41f=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','findAll','rows','catch','show','length','includeAll','include','merge','options','find','create','body','update','params','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa41f,0x1b9));var _0xfa41=function(_0x2da798,_0x42289a){_0x2da798=_0x2da798-0x0;var _0x2b1e8b=_0xa41f[_0x2da798];return _0x2b1e8b;};'use strict';var pdf=require(_0xfa41('0x0'));var emlformat=require(_0xfa41('0x1'));var rimraf=require(_0xfa41('0x2'));var zipdir=require(_0xfa41('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa41('0x4'));var BPromise=require(_0xfa41('0x5'));var Mustache=require(_0xfa41('0x6'));var util=require(_0xfa41('0x7'));var path=require(_0xfa41('0x8'));var sox=require(_0xfa41('0x9'));var csv=require(_0xfa41('0xa'));var ejs=require(_0xfa41('0xb'));var fs=require('fs');var _=require(_0xfa41('0xc'));var squel=require(_0xfa41('0xd'));var crypto=require(_0xfa41('0xe'));var jsforce=require(_0xfa41('0xf'));var deskjs=require(_0xfa41('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfa41('0x11'));var Papa=require('papaparse');var Redis=require(_0xfa41('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfa41('0x13'));var as=require(_0xfa41('0x14'));var hardwareService=require(_0xfa41('0x15'));var logger=require('../../config/logger')(_0xfa41('0x16'));var utils=require(_0xfa41('0x17'));var config=require(_0xfa41('0x18'));var db=require(_0xfa41('0x19'))['db'];function respondWithStatusCode(_0x490e41,_0x479bf6){_0x479bf6=_0x479bf6||0xcc;return function(_0x23ebe6){if(_0x23ebe6){return _0x490e41[_0xfa41('0x1a')](_0x479bf6);}return _0x490e41[_0xfa41('0x1b')](_0x479bf6)[_0xfa41('0x1c')]();};}function respondWithResult(_0x331403,_0x2ce7bb){_0x2ce7bb=_0x2ce7bb||0xc8;return function(_0x551cdb){if(_0x551cdb){return _0x331403['status'](_0x2ce7bb)[_0xfa41('0x1d')](_0x551cdb);}};}function respondWithFilteredResult(_0x51b4c8,_0x5bc665){return function(_0x49fe8e){if(_0x49fe8e){var _0x383cb1=_0x49fe8e[_0xfa41('0x1e')],_0x9e6a=_0x5bc665[_0xfa41('0x1f')],_0x5d286f=_0x5bc665[_0xfa41('0x1f')]+_0x5bc665[_0xfa41('0x20')],_0x37ae19;if(_0x5d286f>=_0x383cb1){_0x5d286f=_0x383cb1;_0x37ae19=0xc8;}else{_0x37ae19=0xce;}_0x51b4c8['status'](_0x37ae19);return _0x51b4c8[_0xfa41('0x21')](_0xfa41('0x22'),_0x9e6a+'-'+_0x5d286f+'/'+_0x383cb1)['json'](_0x49fe8e);}return null;};}function patchUpdates(_0x675b8d){return function(_0x5b4a5a){try{jsonpatch[_0xfa41('0x23')](_0x5b4a5a,_0x675b8d,!![]);}catch(_0x12a35c){return BPromise[_0xfa41('0x24')](_0x12a35c);}return _0x5b4a5a[_0xfa41('0x25')]();};}function saveUpdates(_0x59c8e6,_0x3e62a3){return function(_0x5e2f3a){if(_0x5e2f3a){return _0x5e2f3a['update'](_0x59c8e6)[_0xfa41('0x26')](function(_0x33897e){return _0x33897e;});}return null;};}function removeEntity(_0x344240,_0x146a0b){return function(_0x5362fe){if(_0x5362fe){return _0x5362fe[_0xfa41('0x27')]()[_0xfa41('0x26')](function(){_0x344240['status'](0xcc)[_0xfa41('0x1c')]();});}};}function handleEntityNotFound(_0x79fe8b,_0x3cc3c1){return function(_0x18df72){if(!_0x18df72){_0x79fe8b[_0xfa41('0x1a')](0x194);}return _0x18df72;};}function handleError(_0x15e7ba,_0x243307){_0x243307=_0x243307||0x1f4;return function(_0x24298a){logger['error'](_0x24298a[_0xfa41('0x28')]);if(_0x24298a[_0xfa41('0x29')]){delete _0x24298a['name'];}_0x15e7ba['status'](_0x243307)[_0xfa41('0x2a')](_0x24298a);};}exports[_0xfa41('0x2b')]=function(_0x4f099b,_0x483613){var _0x206187={},_0x21c099={},_0x33ec32={'count':0x0,'rows':[]};var _0x3f72e9=_[_0xfa41('0x2c')](db[_0xfa41('0x2d')][_0xfa41('0x2e')],function(_0x4eeb89){return{'name':_0x4eeb89[_0xfa41('0x2f')],'type':_0x4eeb89['type']['key']};});_0x21c099['model']=_['map'](_0x3f72e9,_0xfa41('0x29'));_0x21c099[_0xfa41('0x30')]=_[_0xfa41('0x31')](_0x4f099b['query']);_0x21c099['filters']=_[_0xfa41('0x32')](_0x21c099[_0xfa41('0x33')],_0x21c099[_0xfa41('0x30')]);_0x206187[_0xfa41('0x34')]=_[_0xfa41('0x32')](_0x21c099['model'],qs['fields'](_0x4f099b[_0xfa41('0x30')][_0xfa41('0x35')]));_0x206187[_0xfa41('0x34')]=_0x206187[_0xfa41('0x34')]['length']?_0x206187[_0xfa41('0x34')]:_0x21c099['model'];if(!_0x4f099b[_0xfa41('0x30')][_0xfa41('0x36')](_0xfa41('0x37'))){_0x206187[_0xfa41('0x20')]=qs[_0xfa41('0x20')](_0x4f099b[_0xfa41('0x30')][_0xfa41('0x20')]);_0x206187['offset']=qs[_0xfa41('0x1f')](_0x4f099b[_0xfa41('0x30')][_0xfa41('0x1f')]);}_0x206187['order']=qs[_0xfa41('0x38')](_0x4f099b['query'][_0xfa41('0x38')]);_0x206187[_0xfa41('0x39')]=qs[_0xfa41('0x3a')](_[_0xfa41('0x3b')](_0x4f099b[_0xfa41('0x30')],_0x21c099[_0xfa41('0x3a')]),_0x3f72e9);if(_0x4f099b[_0xfa41('0x30')][_0xfa41('0x3c')]){_0x206187['where']=_['merge'](_0x206187[_0xfa41('0x39')],{'$or':_[_0xfa41('0x2c')](_0x3f72e9,function(_0x4be15f){if(_0x4be15f['type']!=='VIRTUAL'){var _0x4939e5={};_0x4939e5[_0x4be15f[_0xfa41('0x29')]]={'$like':'%'+_0x4f099b[_0xfa41('0x30')][_0xfa41('0x3c')]+'%'};return _0x4939e5;}})});}_0x206187=_['merge']({},_0x206187,_0x4f099b['options']);var _0x1d655c={'where':_0x206187[_0xfa41('0x39')]};return db[_0xfa41('0x2d')]['count'](_0x1d655c)['then'](function(_0x26a713){_0x33ec32[_0xfa41('0x1e')]=_0x26a713;if(_0x4f099b[_0xfa41('0x30')]['includeAll']){_0x206187['include']=[{'all':!![]}];}return db[_0xfa41('0x2d')][_0xfa41('0x3d')](_0x206187);})[_0xfa41('0x26')](function(_0x4cc629){_0x33ec32[_0xfa41('0x3e')]=_0x4cc629;return _0x33ec32;})[_0xfa41('0x26')](respondWithFilteredResult(_0x483613,_0x206187))[_0xfa41('0x3f')](handleError(_0x483613,null));};exports[_0xfa41('0x40')]=function(_0x4e1625,_0x92fdde){var _0x2a7029={'raw':!![],'where':{'id':_0x4e1625['params']['id']}},_0xe927f4={};_0xe927f4['model']=_['keys'](db[_0xfa41('0x2d')][_0xfa41('0x2e')]);_0xe927f4[_0xfa41('0x30')]=_[_0xfa41('0x31')](_0x4e1625[_0xfa41('0x30')]);_0xe927f4['filters']=_['intersection'](_0xe927f4['model'],_0xe927f4[_0xfa41('0x30')]);_0x2a7029[_0xfa41('0x34')]=_['intersection'](_0xe927f4[_0xfa41('0x33')],qs[_0xfa41('0x35')](_0x4e1625[_0xfa41('0x30')][_0xfa41('0x35')]));_0x2a7029[_0xfa41('0x34')]=_0x2a7029[_0xfa41('0x34')][_0xfa41('0x41')]?_0x2a7029[_0xfa41('0x34')]:_0xe927f4[_0xfa41('0x33')];if(_0x4e1625['query'][_0xfa41('0x42')]){_0x2a7029[_0xfa41('0x43')]=[{'all':!![]}];}_0x2a7029=_[_0xfa41('0x44')]({},_0x2a7029,_0x4e1625[_0xfa41('0x45')]);return db['ChatTransferReport'][_0xfa41('0x46')](_0x2a7029)[_0xfa41('0x26')](handleEntityNotFound(_0x92fdde,null))[_0xfa41('0x26')](respondWithResult(_0x92fdde,null))[_0xfa41('0x3f')](handleError(_0x92fdde,null));};exports[_0xfa41('0x47')]=function(_0x5786be,_0x22b92e){return db[_0xfa41('0x2d')][_0xfa41('0x47')](_0x5786be[_0xfa41('0x48')],{})[_0xfa41('0x26')](respondWithResult(_0x22b92e,0xc9))[_0xfa41('0x3f')](handleError(_0x22b92e,null));};exports[_0xfa41('0x49')]=function(_0x3390fa,_0x48b4eb){if(_0x3390fa[_0xfa41('0x48')]['id']){delete _0x3390fa['body']['id'];}return db[_0xfa41('0x2d')]['find']({'where':{'id':_0x3390fa['params']['id']}})[_0xfa41('0x26')](handleEntityNotFound(_0x48b4eb,null))[_0xfa41('0x26')](saveUpdates(_0x3390fa[_0xfa41('0x48')],null))[_0xfa41('0x26')](respondWithResult(_0x48b4eb,null))[_0xfa41('0x3f')](handleError(_0x48b4eb,null));};exports[_0xfa41('0x27')]=function(_0x4d010d,_0x29715e){return db[_0xfa41('0x2d')][_0xfa41('0x46')]({'where':{'id':_0x4d010d[_0xfa41('0x4a')]['id']}})[_0xfa41('0x26')](handleEntityNotFound(_0x29715e,null))[_0xfa41('0x26')](removeEntity(_0x29715e,null))[_0xfa41('0x3f')](handleError(_0x29715e,null));};exports[_0xfa41('0x4b')]=function(_0x14b079,_0x3a6fee){return db['ChatTransferReport'][_0xfa41('0x4b')]()[_0xfa41('0x26')](respondWithResult(_0x3a6fee,null))[_0xfa41('0x3f')](handleError(_0x3a6fee,null));};
\ No newline at end of file
index 81386ef..d2e8d09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0x34e8,0x12c));var _0x834e=function(_0xaeb12f,_0x330ccd){_0xaeb12f=_0xaeb12f-0x0;var _0x1ee3bb=_0x34e8[_0xaeb12f];return _0x1ee3bb;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[{'name':_0x834e('0xd'),'fields':[_0x834e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger'];(function(_0x1b54f5,_0x83ee6a){var _0x3b9975=function(_0x20762a){while(--_0x20762a){_0x1b54f5['push'](_0x1b54f5['shift']());}};_0x3b9975(++_0x83ee6a);}(_0x7217,0x19e));var _0x7721=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x7217[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[{'name':_0x7721('0xc'),'fields':[_0x7721('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index fd85888..ccb7074 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a0f=['message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s'];(function(_0x55803a,_0x1e521c){var _0x2b9355=function(_0xb4ef06){while(--_0xb4ef06){_0x55803a['push'](_0x55803a['shift']());}};_0x2b9355(++_0x1e521c);}(_0x5a0f,0x18f));var _0xf5a0=function(_0x3b1dbf,_0x54e7ff){_0x3b1dbf=_0x3b1dbf-0x0;var _0x3e1498=_0x5a0f[_0x3b1dbf];return _0x3e1498;};'use strict';var _=require('lodash');var util=require(_0xf5a0('0x0'));var moment=require(_0xf5a0('0x1'));var BPromise=require(_0xf5a0('0x2'));var rs=require(_0xf5a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5a0('0x4'))['db'];var utils=require(_0xf5a0('0x5'));var logger=require('../../config/logger')(_0xf5a0('0x6'));var config=require(_0xf5a0('0x7'));var jayson=require(_0xf5a0('0x8'));var client=jayson['client'][_0xf5a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18e8e7,_0x578b81,_0x172a1f){return new BPromise(function(_0x25b446,_0x44a9e9){return client[_0xf5a0('0xa')](_0x18e8e7,_0x172a1f)[_0xf5a0('0xb')](function(_0x4edf75){logger[_0xf5a0('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x578b81,_0xf5a0('0xd'));logger['debug'](_0xf5a0('0xe'),_0x578b81,_0xf5a0('0xd'),JSON[_0xf5a0('0xf')](_0x4edf75));if(_0x4edf75[_0xf5a0('0x10')]){if(_0x4edf75[_0xf5a0('0x10')][_0xf5a0('0x11')]===0x1f4){logger[_0xf5a0('0x10')](_0xf5a0('0x12'),_0x578b81,_0x4edf75[_0xf5a0('0x10')]['message']);return _0x44a9e9(_0x4edf75[_0xf5a0('0x10')]['message']);}logger['error'](_0xf5a0('0x12'),_0x578b81,_0x4edf75['error'][_0xf5a0('0x13')]);return _0x25b446(_0x4edf75[_0xf5a0('0x10')][_0xf5a0('0x13')]);}else{logger[_0xf5a0('0xc')](_0xf5a0('0x12'),_0x578b81,_0xf5a0('0xd'));_0x25b446(_0x4edf75[_0xf5a0('0x14')][_0xf5a0('0x13')]);}})[_0xf5a0('0x15')](function(_0x38cdbb){logger[_0xf5a0('0x10')](_0xf5a0('0x12'),_0x578b81,_0x38cdbb);_0x44a9e9(_0x38cdbb);});});}
\ No newline at end of file
+var _0x166f=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x290edb,_0x1f22ac){var _0x3fba62=function(_0x134bb5){while(--_0x134bb5){_0x290edb['push'](_0x290edb['shift']());}};_0x3fba62(++_0x1f22ac);}(_0x166f,0xe6));var _0xf166=function(_0x10c4af,_0x3b1dc6){_0x10c4af=_0x10c4af-0x0;var _0x40e0dd=_0x166f[_0x10c4af];return _0x40e0dd;};'use strict';var _=require(_0xf166('0x0'));var util=require(_0xf166('0x1'));var moment=require(_0xf166('0x2'));var BPromise=require(_0xf166('0x3'));var rs=require(_0xf166('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf166('0x5'))['db'];var utils=require(_0xf166('0x6'));var logger=require('../../config/logger')(_0xf166('0x7'));var config=require(_0xf166('0x8'));var jayson=require(_0xf166('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3eb9f8,_0x199f6a,_0x29d5d5){return new BPromise(function(_0x2bbd14,_0x50fc0d){return client[_0xf166('0xa')](_0x3eb9f8,_0x29d5d5)[_0xf166('0xb')](function(_0xb7ef00){logger[_0xf166('0xc')](_0xf166('0xd'),_0x199f6a,_0xf166('0xe'));logger[_0xf166('0xf')](_0xf166('0x10'),_0x199f6a,_0xf166('0xe'),JSON['stringify'](_0xb7ef00));if(_0xb7ef00[_0xf166('0x11')]){if(_0xb7ef00[_0xf166('0x11')][_0xf166('0x12')]===0x1f4){logger[_0xf166('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x199f6a,_0xb7ef00['error']['message']);return _0x50fc0d(_0xb7ef00[_0xf166('0x11')]['message']);}logger[_0xf166('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x199f6a,_0xb7ef00[_0xf166('0x11')][_0xf166('0x13')]);return _0x2bbd14(_0xb7ef00[_0xf166('0x11')][_0xf166('0x13')]);}else{logger[_0xf166('0xc')](_0xf166('0xd'),_0x199f6a,_0xf166('0xe'));_0x2bbd14(_0xb7ef00[_0xf166('0x14')][_0xf166('0x13')]);}})[_0xf166('0x15')](function(_0x20719e){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x199f6a,_0x20719e);_0x50fc0d(_0x20719e);});});}
\ No newline at end of file
index 9200b25..818c203 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbaf0=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 9a995b5..9c60db4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x971d=['Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','thumb','star','INTEGER','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send'];(function(_0x550552,_0x911116){var _0x2486df=function(_0x1a6bbc){while(--_0x1a6bbc){_0x550552['push'](_0x550552['shift']());}};_0x2486df(++_0x911116);}(_0x971d,0xc5));var _0xd971=function(_0x3730ba,_0x4d3cc7){_0x3730ba=_0x3730ba-0x0;var _0x3ee6e5=_0x971d[_0x3730ba];return _0x3ee6e5;};'use strict';var Sequelize=require(_0xd971('0x0'));var rs=require(_0xd971('0x1'));module[_0xd971('0x2')]={'name':{'type':Sequelize[_0xd971('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd971('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x5')},'mapKeyOffline':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x5')},'key':{'type':Sequelize[_0xd971('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x6')},'customerAlias':{'type':Sequelize[_0xd971('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd971('0x3')],'allowNull':![],'defaultValue':_0xd971('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd971('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd971('0x3')],'allowNull':![],'defaultValue':_0xd971('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd971('0x3')]},'animation':{'type':Sequelize[_0xd971('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd971('0xa')](_0xd971('0xb'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0xc')},'start_chat_button':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd971('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xd971('0xf')},'download_transcript':{'type':Sequelize[_0xd971('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd971('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xd971('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd971('0x10')]},'closingQuestion':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd971('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd971('0x14')},'placeholderMessage':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd971('0x16')},'closingMessageButton':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0xe')},'skipMessageButton':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd971('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xd971('0xa')]('star',_0xd971('0x18')),'defaultValue':_0xd971('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xd971('0x1a')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd971('0x10')],'defaultValue':function(){return JSON[_0xd971('0x1b')]({'items':[{'type':_0xd971('0x1c'),'variable':null,'config':{'placeholder':_0xd971('0x1d'),'type':_0xd971('0x1e'),'required':!![]},'props':{'title':_0xd971('0x1d'),'helpText':''}},{'type':_0xd971('0x1c'),'props':{'title':_0xd971('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd971('0x5'),'type':_0xd971('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd971('0x1f')](_0xd971('0x20'))?JSON[_0xd971('0x21')](this[_0xd971('0x1f')](_0xd971('0x20'))):{};},'set':function(_0x4d0c81){return this[_0xd971('0x22')](_0xd971('0x20'),JSON[_0xd971('0x1b')](_0x4d0c81));}},'offlineForm':{'type':Sequelize[_0xd971('0x10')],'defaultValue':function(){return JSON[_0xd971('0x1b')]({'items':[{'type':_0xd971('0x1c'),'props':{'title':_0xd971('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xd971('0x5'),'type':_0xd971('0x5')},'variable':null},{'type':_0xd971('0x23'),'config':{'placeholder':_0xd971('0x24')},'props':{'title':_0xd971('0x24'),'helpText':_0xd971('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0xd971('0x1f')]('offlineForm')?JSON['parse'](this[_0xd971('0x1f')](_0xd971('0x26'))):{};},'set':function(_0x52973c){return this['setDataValue'](_0xd971('0x26'),JSON[_0xd971('0x1b')](_0x52973c));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd971('0x27')]();}},'autoclose':{'type':Sequelize[_0xd971('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd971('0x3')]},'forwardOffline':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x28')},'waitingMessage':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x29')},'offlineMessageSubject':{'type':Sequelize[_0xd971('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xd971('0x2a')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x2b')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xd971('0x17')},'sendUnmanaged':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd971('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xd971('0x10')],'defaultValue':function(){return _0xd971('0x2c');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd971('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xd971('0x1a')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x2d')},'verticalAlignment':{'type':Sequelize[_0xd971('0x1a')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x2e')},'defaultTitle':{'type':Sequelize[_0xd971('0x3')]},'customerAvatar':{'type':Sequelize[_0xd971('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd971('0x1a')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd971('0x3')],'allowNull':![],'defaultValue':_0xd971('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd971('0x1a')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd971('0x3')],'defaultValue':_0xd971('0x30')},'systemAvatar':{'type':Sequelize[_0xd971('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd971('0x1a')],'comment':_0xd971('0x31')},'mandatoryDisposition':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![],'comment':_0xd971('0x32'),'set':function(_0x516337){if(!_0x516337)this[_0xd971('0x22')](_0xd971('0x33'),null);this[_0xd971('0x22')](_0xd971('0x34'),_0x516337);}},'vidaooEscalation':{'type':Sequelize[_0xd971('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd971('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x528f=['New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','textarea','Comments','offlineForm','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'];(function(_0x4c1e92,_0x493f10){var _0x3083d4=function(_0x4cae37){while(--_0x4cae37){_0x4c1e92['push'](_0x4c1e92['shift']());}};_0x3083d4(++_0x493f10);}(_0x528f,0x140));var _0xf528=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x528f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xf528('0x0'));module[_0xf528('0x1')]={'name':{'type':Sequelize[_0xf528('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xf528('0x2')],'allowNull':![],'unique':_0xf528('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xf528('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xf528('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf528('0x2')],'allowNull':![],'defaultValue':_0xf528('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf528('0x2')],'allowNull':![],'defaultValue':_0xf528('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf528('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xf528('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xf528('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0xa')},'start_chat_button':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0xb')},'offline_chat_button':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xf528('0xd')},'download_transcript':{'type':Sequelize[_0xf528('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf528('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xf528('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf528('0xf')]},'closingQuestion':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf528('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x11')},'noteTitle':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x12')},'placeholderMessage':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0xc')},'skipMessageButton':{'type':Sequelize[_0xf528('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf528('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf528('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x14')},'ratingType':{'type':Sequelize[_0xf528('0x15')](_0xf528('0x16'),_0xf528('0x17')),'defaultValue':_0xf528('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xf528('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf528('0x18')]({'items':[{'type':_0xf528('0x19'),'variable':null,'config':{'placeholder':_0xf528('0x1a'),'type':_0xf528('0x1b'),'required':!![]},'props':{'title':_0xf528('0x1a'),'helpText':''}},{'type':_0xf528('0x19'),'props':{'title':_0xf528('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xf528('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf528('0x1c')](_0xf528('0x1d'))?JSON[_0xf528('0x1e')](this[_0xf528('0x1c')](_0xf528('0x1d'))):{};},'set':function(_0x3596ce){return this['setDataValue'](_0xf528('0x1d'),JSON[_0xf528('0x18')](_0x3596ce));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf528('0x18')]({'items':[{'type':_0xf528('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf528('0x4'),'type':'email'},'variable':null},{'type':_0xf528('0x1f'),'config':{'placeholder':_0xf528('0x20')},'props':{'title':_0xf528('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xf528('0x21'))?JSON[_0xf528('0x1e')](this[_0xf528('0x1c')](_0xf528('0x21'))):{};},'set':function(_0xbeaa21){return this[_0xf528('0x22')](_0xf528('0x21'),JSON[_0xf528('0x18')](_0xbeaa21));}},'token':{'type':Sequelize[_0xf528('0x2')],'defaultValue':function(){return rs[_0xf528('0x23')]();}},'autoclose':{'type':Sequelize[_0xf528('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf528('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf528('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf528('0x2')]},'forwardOffline':{'type':Sequelize[_0xf528('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf528('0x2')]},'waitingTitle':{'type':Sequelize[_0xf528('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x25')},'offlineMessageBody':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf528('0x27')},'skipUnmanaged':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x28')},'sendUnmanaged':{'type':Sequelize[_0xf528('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xf528('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf528('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf528('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xf528('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf528('0x2')]},'notificationTemplate':{'type':Sequelize[_0xf528('0xf')],'defaultValue':function(){return _0xf528('0x29');}},'notificationSound':{'type':Sequelize[_0xf528('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf528('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x2b')},'verticalAlignment':{'type':Sequelize[_0xf528('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x2c')},'defaultTitle':{'type':Sequelize[_0xf528('0x2')]},'customerAvatar':{'type':Sequelize[_0xf528('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf528('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf528('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf528('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf528('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf528('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf528('0x2')],'defaultValue':_0xf528('0x2e')},'systemAvatar':{'type':Sequelize[_0xf528('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xf528('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf528('0x30'),'set':function(_0x104012){if(!_0x104012)this[_0xf528('0x22')](_0xf528('0x31'),null);this['setDataValue'](_0xf528('0x32'),_0x104012);}},'vidaooEscalation':{'type':Sequelize[_0xf528('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf528('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 14e01ca..4fbe516 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f57=['existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','Contacts','updatedAt','ChatApplication','Applications','account','applications','list','orderBy','asc','defaults','contact','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','notify','offline','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','No\x20timezone','inspect','Interval','Intervals','../../config/license/util','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','utf8','remote','x-real-ip','remoteAddress','replace','render','alignment','verticalAlignment','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','ValidationError','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','set','reject','save','update','destroy','then','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','params','rawAttributes','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getDispositions','findOne','order','removeDispositions','ids','ChatWebsiteId','getAnswers','CannedAnswer','removeAnswers','addLogo','file','addAvatar','filename','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','sitepic','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','root','agentAvatar'];(function(_0x1233ca,_0x5a0687){var _0x4a4489=function(_0x1a1478){while(--_0x1a1478){_0x1233ca['push'](_0x1233ca['shift']());}};_0x4a4489(++_0x5a0687);}(_0x2f57,0x1ba));var _0x72f5=function(_0x1d3e5a,_0x246d70){_0x1d3e5a=_0x1d3e5a-0x0;var _0x9ed39f=_0x2f57[_0x1d3e5a];return _0x9ed39f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x72f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72f5('0x1'));var jsonpatch=require(_0x72f5('0x2'));var rp=require(_0x72f5('0x3'));var moment=require('moment');var BPromise=require(_0x72f5('0x4'));var Mustache=require(_0x72f5('0x5'));var util=require('util');var path=require(_0x72f5('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x72f5('0x7'));var fs=require('fs');var _=require(_0x72f5('0x8'));var squel=require(_0x72f5('0x9'));var crypto=require(_0x72f5('0xa'));var jsforce=require(_0x72f5('0xb'));var deskjs=require(_0x72f5('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x72f5('0xd'));var Redis=require(_0x72f5('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x72f5('0xf'));var as=require(_0x72f5('0x10'));var hardwareService=require(_0x72f5('0x11'));var logger=require(_0x72f5('0x12'))(_0x72f5('0x13'));var utils=require(_0x72f5('0x14'));var config=require(_0x72f5('0x15'));var db=require(_0x72f5('0x16'))['db'];config[_0x72f5('0x17')]=_['defaults'](config['redis'],{'host':_0x72f5('0x18'),'port':0x18eb});var socket=require(_0x72f5('0x19'))(new Redis(config['redis']));require(_0x72f5('0x1a'))['register'](socket);var jayson=require(_0x72f5('0x1b'));var client=jayson[_0x72f5('0x1c')][_0x72f5('0x1d')]({'port':0x232c});var client9002=jayson[_0x72f5('0x1c')][_0x72f5('0x1d')]({'port':0x232a});var client9003=jayson[_0x72f5('0x1c')]['http']({'port':0x232b});function checkPasswordPattern(_0x985595,_0x290195,_0xc3798c){if(_0xc3798c){var _0x261e26=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x261e26['test'](_0x290195)){return _0x985595;}else{throw new db['Sequelize'][(_0x72f5('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x985595;}}function respondWithRpcPromise(_0x58eb87,_0x122ea8,_0x19255c,_0x24e837){return new BPromise(function(_0x34780b,_0x314d77){var _0x566f09=_0x24e837||client;return _0x566f09[_0x72f5('0x1f')](_0x58eb87,_0x19255c)['then'](function(_0x18308b){logger[_0x72f5('0x20')](_0x72f5('0x21'),_0x122ea8,_0x72f5('0x22'));logger[_0x72f5('0x23')](_0x72f5('0x24'),_0x122ea8,'request\x20sent',JSON[_0x72f5('0x25')](_0x18308b));if(_0x18308b[_0x72f5('0x26')]){if(_0x18308b['error'][_0x72f5('0x27')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x122ea8,_0x18308b[_0x72f5('0x26')][_0x72f5('0x28')]);return _0x314d77(_0x18308b[_0x72f5('0x26')][_0x72f5('0x28')]);}logger[_0x72f5('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x122ea8,_0x18308b[_0x72f5('0x26')][_0x72f5('0x28')]);return _0x34780b(_0x18308b[_0x72f5('0x26')]['message']);}else{logger['info'](_0x72f5('0x21'),_0x122ea8,_0x72f5('0x22'));_0x34780b(_0x18308b[_0x72f5('0x29')][_0x72f5('0x28')]);}})[_0x72f5('0x2a')](function(_0x882e5a){logger[_0x72f5('0x26')](_0x72f5('0x21'),_0x122ea8,_0x882e5a);_0x314d77(_0x882e5a);});});}function respondWithStatusCode(_0x58bfa5,_0xdec09f){_0xdec09f=_0xdec09f||0xcc;return function(_0x507360){if(_0x507360){return _0x58bfa5[_0x72f5('0x2b')](_0xdec09f);}return _0x58bfa5[_0x72f5('0x2c')](_0xdec09f)[_0x72f5('0x2d')]();};}function respondWithResult(_0x29aacd,_0x2d6723){_0x2d6723=_0x2d6723||0xc8;return function(_0x1921c5){if(_0x1921c5){return _0x29aacd[_0x72f5('0x2c')](_0x2d6723)['json'](_0x1921c5);}};}function respondWithFilteredResult(_0x209458,_0x539fe3){return function(_0x419f2b){if(_0x419f2b){var _0x264f1a=_0x419f2b[_0x72f5('0x2e')],_0x410767=_0x539fe3[_0x72f5('0x2f')],_0x9d1e91=_0x539fe3[_0x72f5('0x2f')]+_0x539fe3['limit'],_0x125ba2;if(_0x9d1e91>=_0x264f1a){_0x9d1e91=_0x264f1a;_0x125ba2=0xc8;}else{_0x125ba2=0xce;}_0x209458['status'](_0x125ba2);return _0x209458[_0x72f5('0x30')]('Content-Range',_0x410767+'-'+_0x9d1e91+'/'+_0x264f1a)['json'](_0x419f2b);}return null;};}function patchUpdates(_0x439ffc){return function(_0x367b51){try{jsonpatch['apply'](_0x367b51,_0x439ffc,!![]);}catch(_0x51e4e4){return BPromise[_0x72f5('0x31')](_0x51e4e4);}return _0x367b51[_0x72f5('0x32')]();};}function saveUpdates(_0x218216,_0x4d1031){return function(_0x2dc180){if(_0x2dc180){return _0x2dc180[_0x72f5('0x33')](_0x218216)['then'](function(_0x478171){return _0x478171;});}return null;};}function removeEntity(_0xf7fec6,_0x47d50b){return function(_0x26dfc5){if(_0x26dfc5){return _0x26dfc5[_0x72f5('0x34')]()[_0x72f5('0x35')](function(){var _0x244282=_0x26dfc5['get']({'plain':!![]});var _0x116a10=_0x72f5('0x36');return db[_0x72f5('0x37')][_0x72f5('0x34')]({'where':{'type':_0x116a10,'resourceId':_0x244282['id']}})[_0x72f5('0x35')](function(){return _0x26dfc5;});})[_0x72f5('0x35')](function(){_0xf7fec6[_0x72f5('0x2c')](0xcc)[_0x72f5('0x2d')]();});}};}function handleEntityNotFound(_0x1818fd,_0x499313){return function(_0x3d68ca){if(!_0x3d68ca){_0x1818fd[_0x72f5('0x2b')](0x194);}return _0x3d68ca;};}function handleError(_0x4aa750,_0x36c927){_0x36c927=_0x36c927||0x1f4;return function(_0x14fd55){logger['error'](_0x14fd55[_0x72f5('0x38')]);if(_0x14fd55[_0x72f5('0x39')]){delete _0x14fd55[_0x72f5('0x39')];}_0x4aa750[_0x72f5('0x2c')](_0x36c927)[_0x72f5('0x3a')](_0x14fd55);};}exports[_0x72f5('0x3b')]=function(_0x17026e,_0x5ab22b){var _0x117d5d={'include':[{'model':db[_0x72f5('0x3c')],'as':_0x72f5('0x3d')}]},_0x367965={},_0x4a7b63={'count':0x0,'rows':[]};var _0xd863da=_[_0x72f5('0x3e')](db[_0x72f5('0x3f')]['rawAttributes'],function(_0x16e961){return{'name':_0x16e961[_0x72f5('0x40')],'type':_0x16e961[_0x72f5('0x41')][_0x72f5('0x42')]};});_0x367965[_0x72f5('0x43')]=_[_0x72f5('0x3e')](_0xd863da,'name');_0x367965[_0x72f5('0x44')]=_[_0x72f5('0x45')](_0x17026e['query']);_0x367965['filters']=_['intersection'](_0x367965[_0x72f5('0x43')],_0x367965[_0x72f5('0x44')]);_0x117d5d[_0x72f5('0x46')]=_['intersection'](_0x367965[_0x72f5('0x43')],qs['fields'](_0x17026e[_0x72f5('0x44')][_0x72f5('0x47')]));_0x117d5d[_0x72f5('0x46')]=_0x117d5d[_0x72f5('0x46')][_0x72f5('0x48')]?_0x117d5d[_0x72f5('0x46')]:_0x367965[_0x72f5('0x43')];if(!_0x17026e[_0x72f5('0x44')][_0x72f5('0x49')](_0x72f5('0x4a'))){_0x117d5d[_0x72f5('0x4b')]=qs['limit'](_0x17026e[_0x72f5('0x44')][_0x72f5('0x4b')]);_0x117d5d[_0x72f5('0x2f')]=qs[_0x72f5('0x2f')](_0x17026e[_0x72f5('0x44')][_0x72f5('0x2f')]);}_0x117d5d['order']=qs[_0x72f5('0x4c')](_0x17026e['query'][_0x72f5('0x4c')]);_0x117d5d[_0x72f5('0x4d')]=qs[_0x72f5('0x4e')](_[_0x72f5('0x4f')](_0x17026e[_0x72f5('0x44')],_0x367965[_0x72f5('0x4e')]),_0xd863da);if(_0x17026e[_0x72f5('0x44')][_0x72f5('0x50')]){_0x117d5d[_0x72f5('0x4d')]=_[_0x72f5('0x51')](_0x117d5d[_0x72f5('0x4d')],{'$or':_[_0x72f5('0x3e')](_0xd863da,function(_0x257055){if(_0x257055[_0x72f5('0x41')]!=='VIRTUAL'){var _0x3623f9={};_0x3623f9[_0x257055['name']]={'$like':'%'+_0x17026e[_0x72f5('0x44')][_0x72f5('0x50')]+'%'};return _0x3623f9;}})});}_0x117d5d=_['merge']({},_0x117d5d,_0x17026e[_0x72f5('0x52')]);var _0x3bdb9b={'where':_0x117d5d[_0x72f5('0x4d')]};return db[_0x72f5('0x3f')][_0x72f5('0x2e')](_0x3bdb9b)[_0x72f5('0x35')](function(_0x5345f6){_0x4a7b63[_0x72f5('0x2e')]=_0x5345f6;if(_0x17026e[_0x72f5('0x44')][_0x72f5('0x53')]){_0x117d5d[_0x72f5('0x54')]=[{'all':!![]}];}return db[_0x72f5('0x3f')][_0x72f5('0x55')](_0x117d5d);})['then'](function(_0x50ea00){_0x4a7b63[_0x72f5('0x56')]=_0x50ea00;return _0x4a7b63;})['then'](respondWithFilteredResult(_0x5ab22b,_0x117d5d))[_0x72f5('0x2a')](handleError(_0x5ab22b,null));};exports['show']=function(_0x16af1e,_0x2e0dd3){var _0x5765a6={'raw':![],'where':{'id':_0x16af1e[_0x72f5('0x57')]['id']},'include':[{'model':db[_0x72f5('0x3c')],'as':_0x72f5('0x3d')}]},_0x40aff1={};_0x40aff1[_0x72f5('0x43')]=_[_0x72f5('0x45')](db['ChatWebsite'][_0x72f5('0x58')]);_0x40aff1['query']=_[_0x72f5('0x45')](_0x16af1e[_0x72f5('0x44')]);_0x40aff1[_0x72f5('0x4e')]=_[_0x72f5('0x59')](_0x40aff1['model'],_0x40aff1['query']);_0x5765a6[_0x72f5('0x46')]=_[_0x72f5('0x59')](_0x40aff1['model'],qs['fields'](_0x16af1e[_0x72f5('0x44')][_0x72f5('0x47')]));_0x5765a6['attributes']=_0x5765a6[_0x72f5('0x46')][_0x72f5('0x48')]?_0x5765a6[_0x72f5('0x46')]:_0x40aff1[_0x72f5('0x43')];if(_0x16af1e['query'][_0x72f5('0x53')]){_0x5765a6[_0x72f5('0x54')]=[{'all':!![]}];}_0x5765a6=_[_0x72f5('0x51')]({},_0x5765a6,_0x16af1e[_0x72f5('0x52')]);return db[_0x72f5('0x3f')][_0x72f5('0x5a')](_0x5765a6)['then'](handleEntityNotFound(_0x2e0dd3,null))[_0x72f5('0x35')](respondWithResult(_0x2e0dd3,null))[_0x72f5('0x2a')](handleError(_0x2e0dd3,null));};exports['create']=function(_0x41a5d5,_0x40bd8b){return db[_0x72f5('0x3f')][_0x72f5('0x5b')](_0x41a5d5['body'],{})['then'](function(_0x2b7558){var _0x489b25=_0x41a5d5[_0x72f5('0x5c')]['get']({'plain':!![]});if(!_0x489b25)throw new Error(_0x72f5('0x5d'));if(_0x489b25[_0x72f5('0x5e')]===_0x72f5('0x5c')){var _0x5b727d=_0x2b7558[_0x72f5('0x5f')]({'plain':!![]});var _0x5f400b=_0x72f5('0x36');return db['UserProfileSection']['find']({'where':{'name':_0x5f400b,'userProfileId':_0x489b25[_0x72f5('0x60')]},'raw':!![]})[_0x72f5('0x35')](function(_0x2d8c9a){if(_0x2d8c9a&&_0x2d8c9a[_0x72f5('0x61')]===0x0){return db['UserProfileResource'][_0x72f5('0x5b')]({'name':_0x5b727d[_0x72f5('0x39')],'resourceId':_0x5b727d['id'],'type':_0x2d8c9a[_0x72f5('0x39')],'sectionId':_0x2d8c9a['id']},{})['then'](function(){return _0x2b7558;});}else{return _0x2b7558;}})[_0x72f5('0x2a')](function(_0x3be8dc){logger[_0x72f5('0x26')](_0x72f5('0x62'),_0x3be8dc);throw _0x3be8dc;});}return _0x2b7558;})[_0x72f5('0x35')](respondWithResult(_0x40bd8b,0xc9))[_0x72f5('0x2a')](handleError(_0x40bd8b,null));};exports[_0x72f5('0x33')]=function(_0x430e4e,_0x272806){if(_0x430e4e['body']['id']){delete _0x430e4e[_0x72f5('0x63')]['id'];}return db['ChatWebsite'][_0x72f5('0x5a')]({'where':{'id':_0x430e4e[_0x72f5('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x72f5('0x3d')}]})[_0x72f5('0x35')](handleEntityNotFound(_0x272806,null))[_0x72f5('0x35')](saveUpdates(_0x430e4e[_0x72f5('0x63')],null))[_0x72f5('0x35')](respondWithResult(_0x272806,null))[_0x72f5('0x2a')](handleError(_0x272806,null));};exports[_0x72f5('0x34')]=function(_0x5b3cc3,_0x2d9bb6){return db[_0x72f5('0x3f')]['find']({'where':{'id':_0x5b3cc3[_0x72f5('0x57')]['id']}})['then'](handleEntityNotFound(_0x2d9bb6,null))['then'](removeEntity(_0x2d9bb6,null))[_0x72f5('0x2a')](handleError(_0x2d9bb6,null));};exports['describe']=function(_0x525642,_0x39c059){return db[_0x72f5('0x3f')][_0x72f5('0x64')]()[_0x72f5('0x35')](respondWithResult(_0x39c059,null))[_0x72f5('0x2a')](handleError(_0x39c059,null));};exports['addDisposition']=function(_0x1ac65f,_0x16694e,_0x171e36){if(_0x1ac65f[_0x72f5('0x63')]['id']){delete _0x1ac65f['body']['id'];}return db[_0x72f5('0x3f')]['find']({'where':{'id':_0x1ac65f[_0x72f5('0x57')]['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x16694e,null))[_0x72f5('0x35')](function(_0x230ad7){if(_0x230ad7){_0x1ac65f[_0x72f5('0x63')]['ChatWebsiteId']=_0x230ad7['id'];return db['Disposition'][_0x72f5('0x5b')](_0x1ac65f[_0x72f5('0x63')]);}})[_0x72f5('0x35')](respondWithResult(_0x16694e,null))['catch'](handleError(_0x16694e,null));};exports[_0x72f5('0x65')]=function(_0x315a9b,_0x5b6980,_0x4b7f77){var _0x44eb12={'raw':![],'where':{}};var _0x31f518={};var _0x3e77c4={'count':0x0,'rows':[]};return db[_0x72f5('0x3f')][_0x72f5('0x66')]({'where':{'id':_0x315a9b[_0x72f5('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b6980,null))[_0x72f5('0x35')](function(_0x4a19fd){if(_0x4a19fd){_0x31f518[_0x72f5('0x43')]=_['keys'](db['Disposition'][_0x72f5('0x58')]);_0x31f518[_0x72f5('0x44')]=_[_0x72f5('0x45')](_0x315a9b['query']);_0x31f518[_0x72f5('0x4e')]=_['intersection'](_0x31f518[_0x72f5('0x43')],_0x31f518[_0x72f5('0x44')]);_0x44eb12['attributes']=_[_0x72f5('0x59')](_0x31f518[_0x72f5('0x43')],qs['fields'](_0x315a9b[_0x72f5('0x44')][_0x72f5('0x47')]));_0x44eb12[_0x72f5('0x46')]=_0x44eb12[_0x72f5('0x46')][_0x72f5('0x48')]?_0x44eb12[_0x72f5('0x46')]:_0x31f518[_0x72f5('0x43')];if(!_0x315a9b[_0x72f5('0x44')][_0x72f5('0x49')](_0x72f5('0x4a'))){_0x44eb12[_0x72f5('0x4b')]=qs[_0x72f5('0x4b')](_0x315a9b['query'][_0x72f5('0x4b')]);_0x44eb12[_0x72f5('0x2f')]=qs[_0x72f5('0x2f')](_0x315a9b[_0x72f5('0x44')][_0x72f5('0x2f')]);}_0x44eb12[_0x72f5('0x67')]=qs[_0x72f5('0x4c')](_0x315a9b[_0x72f5('0x44')][_0x72f5('0x4c')]);_0x44eb12['where']=qs[_0x72f5('0x4e')](_[_0x72f5('0x4f')](_0x315a9b[_0x72f5('0x44')],_0x31f518[_0x72f5('0x4e')]));_0x44eb12[_0x72f5('0x4d')]['ChatWebsiteId']=_0x4a19fd['id'];if(_0x315a9b[_0x72f5('0x44')][_0x72f5('0x50')]){_0x44eb12['where']=_[_0x72f5('0x51')](_0x44eb12[_0x72f5('0x4d')],{'$or':_['map'](_0x44eb12[_0x72f5('0x46')],function(_0x2309ae){var _0xa58a63={};_0xa58a63[_0x2309ae]={'$like':'%'+_0x315a9b[_0x72f5('0x44')][_0x72f5('0x50')]+'%'};return _0xa58a63;})});}_0x44eb12=_[_0x72f5('0x51')]({},_0x44eb12,_0x315a9b[_0x72f5('0x52')]);return db['Disposition'][_0x72f5('0x2e')]({'where':_0x44eb12[_0x72f5('0x4d')]})[_0x72f5('0x35')](function(_0x3b8d1f){_0x3e77c4['count']=_0x3b8d1f;if(_0x315a9b['query'][_0x72f5('0x53')]){_0x44eb12[_0x72f5('0x54')]=[{'all':!![]}];}return db['Disposition'][_0x72f5('0x55')](_0x44eb12);})['then'](function(_0x310672){_0x3e77c4[_0x72f5('0x56')]=_0x310672;return _0x3e77c4;});}})['then'](respondWithFilteredResult(_0x5b6980,_0x44eb12))['catch'](handleError(_0x5b6980,null));};exports['removeDispositions']=function(_0x54ec3d,_0x1d49ec,_0x468f09){return db[_0x72f5('0x3f')][_0x72f5('0x5a')]({'where':{'id':_0x54ec3d[_0x72f5('0x57')]['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x1d49ec,null))['then'](function(_0x410512){if(_0x410512){return _0x410512[_0x72f5('0x68')](_0x54ec3d['query'][_0x72f5('0x69')]);}})['then'](respondWithStatusCode(_0x1d49ec,null))[_0x72f5('0x2a')](handleError(_0x1d49ec,null));};exports['addAnswer']=function(_0xbbf3f,_0x821164,_0x5e37c7){if(_0xbbf3f[_0x72f5('0x63')]['id']){delete _0xbbf3f[_0x72f5('0x63')]['id'];}return db[_0x72f5('0x3f')][_0x72f5('0x5a')]({'where':{'id':_0xbbf3f[_0x72f5('0x57')]['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x821164,null))[_0x72f5('0x35')](function(_0x521408){if(_0x521408){_0xbbf3f[_0x72f5('0x63')][_0x72f5('0x6a')]=_0x521408['id'];return db['CannedAnswer'][_0x72f5('0x5b')](_0xbbf3f[_0x72f5('0x63')]);}})['then'](respondWithResult(_0x821164,null))[_0x72f5('0x2a')](handleError(_0x821164,null));};exports[_0x72f5('0x6b')]=function(_0xba80d0,_0x272ae4,_0x49e1e8){var _0x37a9de={'raw':![],'where':{}};var _0x77e493={};var _0x10ffdd={'count':0x0,'rows':[]};return db[_0x72f5('0x3f')]['findOne']({'where':{'id':_0xba80d0['params']['id']}})['then'](handleEntityNotFound(_0x272ae4,null))['then'](function(_0xeae6a0){if(_0xeae6a0){_0x77e493[_0x72f5('0x43')]=_['keys'](db[_0x72f5('0x6c')][_0x72f5('0x58')]);_0x77e493[_0x72f5('0x44')]=_[_0x72f5('0x45')](_0xba80d0['query']);_0x77e493['filters']=_[_0x72f5('0x59')](_0x77e493[_0x72f5('0x43')],_0x77e493['query']);_0x37a9de[_0x72f5('0x46')]=_[_0x72f5('0x59')](_0x77e493[_0x72f5('0x43')],qs[_0x72f5('0x47')](_0xba80d0[_0x72f5('0x44')]['fields']));_0x37a9de['attributes']=_0x37a9de['attributes'][_0x72f5('0x48')]?_0x37a9de['attributes']:_0x77e493[_0x72f5('0x43')];if(!_0xba80d0[_0x72f5('0x44')]['hasOwnProperty'](_0x72f5('0x4a'))){_0x37a9de[_0x72f5('0x4b')]=qs[_0x72f5('0x4b')](_0xba80d0[_0x72f5('0x44')]['limit']);_0x37a9de['offset']=qs[_0x72f5('0x2f')](_0xba80d0[_0x72f5('0x44')][_0x72f5('0x2f')]);}_0x37a9de[_0x72f5('0x67')]=qs[_0x72f5('0x4c')](_0xba80d0['query']['sort']);_0x37a9de[_0x72f5('0x4d')]=qs[_0x72f5('0x4e')](_[_0x72f5('0x4f')](_0xba80d0[_0x72f5('0x44')],_0x77e493[_0x72f5('0x4e')]));_0x37a9de[_0x72f5('0x4d')]['ChatWebsiteId']=_0xeae6a0['id'];if(_0xba80d0[_0x72f5('0x44')][_0x72f5('0x50')]){_0x37a9de[_0x72f5('0x4d')]=_[_0x72f5('0x51')](_0x37a9de['where'],{'$or':_[_0x72f5('0x3e')](_0x37a9de['attributes'],function(_0x5367f1){var _0x4a6d89={};_0x4a6d89[_0x5367f1]={'$like':'%'+_0xba80d0[_0x72f5('0x44')][_0x72f5('0x50')]+'%'};return _0x4a6d89;})});}_0x37a9de=_[_0x72f5('0x51')]({},_0x37a9de,_0xba80d0['options']);return db[_0x72f5('0x6c')][_0x72f5('0x2e')]({'where':_0x37a9de['where']})['then'](function(_0x5621d0){_0x10ffdd[_0x72f5('0x2e')]=_0x5621d0;if(_0xba80d0['query'][_0x72f5('0x53')]){_0x37a9de['include']=[{'all':!![]}];}return db[_0x72f5('0x6c')][_0x72f5('0x55')](_0x37a9de);})['then'](function(_0x34537e){_0x10ffdd[_0x72f5('0x56')]=_0x34537e;return _0x10ffdd;});}})[_0x72f5('0x35')](respondWithFilteredResult(_0x272ae4,_0x37a9de))['catch'](handleError(_0x272ae4,null));};exports[_0x72f5('0x6d')]=function(_0x594409,_0x431c8f,_0x349f5c){return db[_0x72f5('0x3f')][_0x72f5('0x5a')]({'where':{'id':_0x594409[_0x72f5('0x57')]['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x431c8f,null))[_0x72f5('0x35')](function(_0x15a5d6){if(_0x15a5d6){return _0x15a5d6[_0x72f5('0x6d')](_0x594409[_0x72f5('0x44')][_0x72f5('0x69')]);}})[_0x72f5('0x35')](respondWithStatusCode(_0x431c8f,null))['catch'](handleError(_0x431c8f,null));};exports[_0x72f5('0x6e')]=function(_0x436250,_0x1af178,_0x5989da){_0x436250['body']['sitepic']=_0x436250[_0x72f5('0x6f')]['filename'];return db[_0x72f5('0x3f')][_0x72f5('0x5a')]({'where':{'id':_0x436250[_0x72f5('0x57')]['id']}})['then'](handleEntityNotFound(_0x1af178,null))[_0x72f5('0x35')](saveUpdates(_0x436250[_0x72f5('0x63')],null))[_0x72f5('0x35')](respondWithResult(_0x1af178,null))['catch'](handleError(_0x1af178,null));};exports[_0x72f5('0x70')]=function(_0x160277,_0x26125d,_0x42cba2){_0x160277[_0x72f5('0x63')]['agentAvatar']=_0x160277['file'][_0x72f5('0x71')];return db[_0x72f5('0x3f')][_0x72f5('0x5a')]({'where':{'id':_0x160277[_0x72f5('0x57')]['id']}})['then'](handleEntityNotFound(_0x26125d,null))[_0x72f5('0x35')](saveUpdates(_0x160277[_0x72f5('0x63')],null))[_0x72f5('0x35')](respondWithResult(_0x26125d,null))[_0x72f5('0x2a')](handleError(_0x26125d,null));};exports[_0x72f5('0x72')]=function(_0x46f8f0,_0x40aaac,_0x36a8c8){_0x46f8f0['body'][_0x72f5('0x73')]=_0x46f8f0['file'][_0x72f5('0x71')];return db[_0x72f5('0x3f')][_0x72f5('0x5a')]({'where':{'id':_0x46f8f0['params']['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x40aaac,null))[_0x72f5('0x35')](saveUpdates(_0x46f8f0['body'],null))[_0x72f5('0x35')](respondWithResult(_0x40aaac,null))[_0x72f5('0x2a')](handleError(_0x40aaac,null));};exports['addSystemAvatar']=function(_0x50f9bc,_0x4bec7f,_0x331ff2){_0x50f9bc[_0x72f5('0x63')][_0x72f5('0x74')]=_0x50f9bc[_0x72f5('0x6f')][_0x72f5('0x71')];return db[_0x72f5('0x3f')][_0x72f5('0x5a')]({'where':{'id':_0x50f9bc[_0x72f5('0x57')]['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x4bec7f,null))[_0x72f5('0x35')](saveUpdates(_0x50f9bc[_0x72f5('0x63')],null))[_0x72f5('0x35')](respondWithResult(_0x4bec7f,null))[_0x72f5('0x2a')](handleError(_0x4bec7f,null));};exports[_0x72f5('0x75')]=function(_0x3ee089,_0x5c5941,_0x5190e3){var _0x1de492=path[_0x72f5('0x76')](config['root'],'server/files/images/logos/default_logo.svg');var _0x22f8da={'where':{'id':_0x3ee089[_0x72f5('0x57')]['id']},'attributes':['id',_0x72f5('0x77')],'raw':!![]};var _0x580a24=![];return require('../../config/license/util')[_0x72f5('0x78')]()['then'](function(_0x3aca1c){if(_0x3aca1c){_0x580a24=_0x3aca1c[_0x72f5('0x79')];}})['then'](function(){return db['ChatWebsite']['find'](_0x22f8da);})[_0x72f5('0x35')](handleEntityNotFound(_0x5c5941,null))[_0x72f5('0x35')](function(_0x419043){if(_0x419043){if(!_[_0x72f5('0x7a')](_0x419043['sitepic'])){if(fs['existsSync'](path[_0x72f5('0x76')](config['root'],_0x72f5('0x7b'),_0x419043['sitepic']))&&_0x580a24){_0x1de492=path['join'](config['root'],'server/files/images/logos/',_0x419043[_0x72f5('0x77')]);}}return _0x5c5941[_0x72f5('0x7c')](_0x1de492);}})['catch'](handleError(_0x5c5941,null));};exports[_0x72f5('0x7d')]=function(_0x464970,_0x3a4839,_0x4dc696){var _0xd7b661=path[_0x72f5('0x76')](config[_0x72f5('0x7e')],'server/files/images/avatars/default_avatar.png');var _0x3a4709={'where':{'id':_0x464970[_0x72f5('0x57')]['id']},'attributes':['id',_0x72f5('0x7f')],'raw':!![]};return db['ChatWebsite'][_0x72f5('0x5a')](_0x3a4709)[_0x72f5('0x35')](handleEntityNotFound(_0x3a4839,null))['then'](function(_0x57426b){if(_0x57426b){if(!_[_0x72f5('0x7a')](_0x57426b[_0x72f5('0x7f')])){if(fs[_0x72f5('0x80')](path[_0x72f5('0x76')](config[_0x72f5('0x7e')],_0x72f5('0x81'),_0x57426b[_0x72f5('0x7f')]))){_0xd7b661=path[_0x72f5('0x76')](config[_0x72f5('0x7e')],_0x72f5('0x81'),_0x57426b[_0x72f5('0x7f')]);}}return _0x3a4839[_0x72f5('0x7c')](_0xd7b661);}})[_0x72f5('0x2a')](handleError(_0x3a4839,null));};exports[_0x72f5('0x82')]=function(_0x46b27c,_0x487340,_0x37194d){var _0x19c687=path[_0x72f5('0x76')](config['root'],_0x72f5('0x83'));var _0x953deb={'where':{'id':_0x46b27c[_0x72f5('0x57')]['id']},'attributes':['id',_0x72f5('0x73'),'showCustomerAvatar'],'raw':!![]};return db[_0x72f5('0x3f')][_0x72f5('0x5a')](_0x953deb)[_0x72f5('0x35')](handleEntityNotFound(_0x487340,null))['then'](function(_0x341b82){if(_0x341b82){if(!_['isNil'](_0x341b82['customerAvatar'])){if(fs['existsSync'](path[_0x72f5('0x76')](config[_0x72f5('0x7e')],_0x72f5('0x81'),_0x341b82[_0x72f5('0x73')]))&&_0x341b82[_0x72f5('0x84')]){_0x19c687=path[_0x72f5('0x76')](config[_0x72f5('0x7e')],_0x72f5('0x81'),_0x341b82[_0x72f5('0x73')]);}}return _0x487340[_0x72f5('0x7c')](_0x19c687);}})[_0x72f5('0x2a')](handleError(_0x487340,null));};exports[_0x72f5('0x85')]=function(_0x5258ed,_0x241880,_0x4c76e7){var _0x127a65=path[_0x72f5('0x76')](config[_0x72f5('0x7e')],_0x72f5('0x86'));var _0x5a23ee={'where':{'id':_0x5258ed[_0x72f5('0x57')]['id']},'attributes':['id',_0x72f5('0x74')],'raw':!![]};return db[_0x72f5('0x3f')][_0x72f5('0x5a')](_0x5a23ee)['then'](handleEntityNotFound(_0x241880,null))[_0x72f5('0x35')](function(_0x3893f2){if(_0x3893f2){if(!_[_0x72f5('0x7a')](_0x3893f2[_0x72f5('0x74')])){if(fs[_0x72f5('0x80')](path[_0x72f5('0x76')](config[_0x72f5('0x7e')],_0x72f5('0x81'),_0x3893f2[_0x72f5('0x74')]))){_0x127a65=path[_0x72f5('0x76')](config['root'],_0x72f5('0x81'),_0x3893f2[_0x72f5('0x74')]);}}return _0x241880[_0x72f5('0x7c')](_0x127a65);}})['catch'](handleError(_0x241880,null));};exports['notify']=function(_0x37b188,_0x4af82f,_0x109577){var _0x375f65=require(_0x72f5('0x87'));var _0x396692=new _0x375f65();var _0x543625=_0x396692[_0x72f5('0x88')](_0x37b188['headers'][_0x72f5('0x89')])[_0x72f5('0x8a')]();var _0x2e1cf3={'body':_0x37b188[_0x72f5('0x63')],'channel':_0x72f5('0x8b')};var _0x5120fb=[];var _0x3b221e=[];var _0x24e84d={};var _0x4e6664=![];return db[_0x72f5('0x8c')][_0x72f5('0x64')]()[_0x72f5('0x35')](function(_0x261b1c){if(!_0x261b1c){throw new db[(_0x72f5('0x8d'))][(_0x72f5('0x1e'))](_0x72f5('0x8e'));}_0x5120fb=_[_0x72f5('0x8f')](_[_0x72f5('0x45')](_0x261b1c),[_0x72f5('0x90'),'updatedAt']);_0x3b221e=_['difference'](_[_0x72f5('0x45')](_0x261b1c),[_0x72f5('0x90'),'updatedAt','CompanyId','ListId']);if(_0x37b188[_0x72f5('0x63')]['id']){delete _0x37b188[_0x72f5('0x63')]['id'];}if(_['isNil'](_0x37b188[_0x72f5('0x63')][_0x72f5('0x91')])){throw new db[(_0x72f5('0x8d'))][(_0x72f5('0x1e'))](_0x72f5('0x92'));}if(_['isNil'](_0x37b188['body'][_0x72f5('0x63')])||_0x37b188['body']['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x72f5('0x7a')](_0x37b188['body']['mapKey'])){throw new db[(_0x72f5('0x8d'))][(_0x72f5('0x1e'))](_0x72f5('0x93')+_0x3b221e);}if(!_['includes'](_0x3b221e,_0x37b188['body']['mapKey'])){throw new db[(_0x72f5('0x8d'))][(_0x72f5('0x1e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b221e);}_0x24e84d[_0x37b188[_0x72f5('0x63')][_0x72f5('0x94')]]=_0x37b188[_0x72f5('0x63')][_0x72f5('0x91')];})[_0x72f5('0x35')](function(){return db['ChatWebsite'][_0x72f5('0x5a')]({'where':{'id':_0x37b188[_0x72f5('0x57')]['id']},'include':[{'model':db[_0x72f5('0x95')],'as':_0x72f5('0x96'),'include':[{'model':db['CmContact'],'as':_0x72f5('0x97'),'where':_0x24e84d,'limit':0x1,'order':[[_0x72f5('0x98'),'DESC']]}]},{'model':db[_0x72f5('0x99')],'as':_0x72f5('0x9a')}]});})[_0x72f5('0x35')](handleEntityNotFound(_0x4af82f,null))['then'](function(_0x447d78){if(_0x447d78&&_0x447d78[_0x72f5('0x96')]){_0x2e1cf3[_0x72f5('0x9b')]=_0x447d78;_0x2e1cf3[_0x72f5('0x9c')]=_0x447d78[_0x72f5('0x9a')];_0x2e1cf3[_0x72f5('0x9d')]=_0x447d78['List'];_0x2e1cf3[_0x72f5('0x9c')]=_[_0x72f5('0x9e')](_0x2e1cf3['applications'],['priority'],[_0x72f5('0x9f')]);if(_0x2e1cf3[_0x72f5('0x9b')]['Applications']){delete _0x2e1cf3[_0x72f5('0x9b')][_0x72f5('0x9a')];}if(_0x2e1cf3[_0x72f5('0x9b')][_0x72f5('0x96')]&&_0x2e1cf3['account'][_0x72f5('0x96')][_0x72f5('0x97')][_0x72f5('0x48')]){return _0x2e1cf3[_0x72f5('0x9b')][_0x72f5('0x96')]['Contacts'][0x0];}var _0x54ad3c=_[_0x72f5('0xa0')](_0x37b188[_0x72f5('0x63')],{'firstName':_0x37b188[_0x72f5('0x63')][_0x72f5('0x91')],'ListId':_0x447d78['ListId']});_0x54ad3c[_0x37b188['body'][_0x72f5('0x94')]]=_0x37b188[_0x72f5('0x63')][_0x72f5('0x91')];return db[_0x72f5('0x8c')][_0x72f5('0x5b')](_0x54ad3c,{'fields':_0x5120fb,'raw':!![]});}})[_0x72f5('0x35')](handleEntityNotFound(_0x4af82f,null))[_0x72f5('0x35')](function(_0x27ec82){_0x2e1cf3[_0x72f5('0xa1')]=_0x27ec82;var _0x56483b=_0x37b188['body']['customerIp'];if(_0x37b188[_0x72f5('0xa2')][_0x72f5('0xa3')]){_0x56483b=_0x37b188[_0x72f5('0xa2')]['cf-connecting-ip'];}else if(_0x37b188[_0x72f5('0xa2')][_0x72f5('0xa4')]){_0x56483b=_[_0x72f5('0xa5')](_0x37b188['headers'][_0x72f5('0xa4')][_0x72f5('0xa6')](','));}if(_0x27ec82){var _0x40d0cd={'ContactId':_0x27ec82['id'],'ChatWebsiteId':_0x37b188[_0x72f5('0x57')]['id'],'from':(_0x27ec82[_0x72f5('0xa7')]||'')+'\x20'+(_0x27ec82[_0x72f5('0xa8')]||''),'customerIp':_0x56483b,'customerPort':_0x37b188[_0x72f5('0xa2')][_0x72f5('0xa9')]?_0x37b188['headers'][_0x72f5('0xa9')]:null,'referer':_0x37b188['body'][_0x72f5('0xaa')],'browserName':_0x543625[_0x72f5('0xab')][_0x72f5('0x39')]&&_0x543625[_0x72f5('0xab')][_0x72f5('0xac')]?util[_0x72f5('0xad')](_0x72f5('0xae'),_0x543625['browser'][_0x72f5('0x39')],_0x543625[_0x72f5('0xab')][_0x72f5('0xac')]):_0x72f5('0xaf'),'browserVersion':_0x543625[_0x72f5('0xab')][_0x72f5('0xac')]||_0x72f5('0xaf'),'osName':util[_0x72f5('0xad')](_0x72f5('0xae'),_0x543625['os']['name'],_0x543625['os'][_0x72f5('0xac')]),'osVersion':_0x543625['os'][_0x72f5('0xac')],'deviceModel':_0x543625['device'][_0x72f5('0x43')]&&_0x543625[_0x72f5('0xb0')][_0x72f5('0xb1')]?util[_0x72f5('0xad')]('%s\x20%s\x20%s',_0x543625[_0x72f5('0xb0')][_0x72f5('0x43')],_0x543625[_0x72f5('0xb0')]['vendor'],_0x543625[_0x72f5('0xb0')][_0x72f5('0x41')]):null,'deviceVendor':_0x543625[_0x72f5('0xb0')]['vendor'],'deviceType':_0x543625['device']['type'],'formData':JSON[_0x72f5('0x25')](_0x37b188[_0x72f5('0x63')])};var _0x211279={'ChatWebsiteId':_0x37b188['params']['id'],'closed':![]};if(_0x37b188[_0x72f5('0x63')]['threadId']){_0x211279[_0x72f5('0xb2')]=_0x37b188['body'][_0x72f5('0xb2')];return db[_0x72f5('0xb3')][_0x72f5('0x5a')]({'where':_0x211279})[_0x72f5('0x35')](function(_0x2689a5){if(_0x2689a5){return[_0x2689a5,![]];}_0x40d0cd[_0x72f5('0xb2')]=_0x37b188[_0x72f5('0x63')]['threadId'];_0x40d0cd['externalUrl']=_0x37b188[_0x72f5('0x63')][_0x72f5('0xb4')];return db[_0x72f5('0xb3')][_0x72f5('0x5b')](_0x40d0cd)[_0x72f5('0x35')](function(_0x697b10){return[_0x697b10,!![]];});});}_0x211279['ContactId']=_0x27ec82['id'];if(_0x37b188[_0x72f5('0x63')][_0x72f5('0xb5')]&&_0x37b188[_0x72f5('0x63')][_0x72f5('0xb5')]['id']){_0x211279['id']=_0x37b188[_0x72f5('0x63')][_0x72f5('0xb5')]['id'];return db[_0x72f5('0xb3')][_0x72f5('0x5a')]({'where':_0x211279})['then'](function(_0x2efbc4){if(_0x2efbc4){return[_0x2efbc4,![]];}return db[_0x72f5('0xb3')][_0x72f5('0x5b')](_0x40d0cd)[_0x72f5('0x35')](function(_0x41e063){return[_0x41e063,!![]];});});}return db[_0x72f5('0xb3')][_0x72f5('0x5b')](_0x40d0cd)[_0x72f5('0x35')](function(_0x12bfdb){return[_0x12bfdb,!![]];});}})[_0x72f5('0xb6')](function(_0x442d74,_0x3bc005){if(_0x442d74){_0x4e6664=_0x3bc005;if(!_0x3bc005){var _0x38fc53={'from':(_0x2e1cf3[_0x72f5('0xa1')][_0x72f5('0xa7')]||'')+'\x20'+(_0x2e1cf3['contact'][_0x72f5('0xa8')]||'')};if(_0x37b188[_0x72f5('0x63')]['threadId']&&_0x37b188['body'][_0x72f5('0xb7')]&&_0x37b188['body'][_0x72f5('0xb2')]!=_0x37b188[_0x72f5('0x63')][_0x72f5('0xb7')]){_0x38fc53['threadId']=_0x37b188[_0x72f5('0x63')]['messageId'];}return _0x442d74[_0x72f5('0x33')](_0x38fc53);}else{return _0x442d74;}}})[_0x72f5('0x35')](function(_0x5f4f78){_0x2e1cf3[_0x72f5('0xb5')]=_0x5f4f78[_0x72f5('0x5f')]({'plain':!![]});_0x2e1cf3[_0x72f5('0xb5')][_0x72f5('0xb8')]=_0x4e6664;if(_0x2e1cf3[_0x72f5('0xb5')][_0x72f5('0xb8')]){if(_0x2e1cf3[_0x72f5('0x9b')]['autoclose']){_0x2e1cf3['applications']['push']({'id':0x0,'priority':_0x2e1cf3[_0x72f5('0x9c')][_0x72f5('0x48')]+0x1,'app':_0x72f5('0xb9'),'appdata':_0x72f5('0xba'),'interval':_0x72f5('0xbb')});}}return db[_0x72f5('0xbc')][_0x72f5('0x5b')]({'body':_0x37b188[_0x72f5('0x63')][_0x72f5('0x63')],'ChatWebsiteId':_0x37b188[_0x72f5('0x57')]['id'],'ChatInteractionId':_0x5f4f78['id'],'direction':'in','ContactId':_0x2e1cf3[_0x72f5('0xa1')]['id'],'AttachmentId':_0x37b188[_0x72f5('0x63')][_0x72f5('0xbd')]});})[_0x72f5('0x35')](function(_0x1f203b){_0x2e1cf3['message']=_0x1f203b;if(_0x2e1cf3[_0x72f5('0xb5')][_0x72f5('0xbe')]){return db['User'][_0x72f5('0x5a')]({'attributes':['id',_0x72f5('0x39')],'where':{'id':_0x2e1cf3['interaction']['UserId']}})[_0x72f5('0x35')](function(_0x735c03){if(_0x735c03){_0x2e1cf3[_0x72f5('0x9c')][_0x72f5('0xbf')]({'id':0x0,'priority':0x0,'app':_0x72f5('0xc0'),'appdata':_0x735c03[_0x72f5('0x39')]+','+(_0x2e1cf3[_0x72f5('0x9b')][_0x72f5('0xc1')]||0xa),'interval':_0x72f5('0xbb')});_0x2e1cf3['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0x72f5('0xc2'),_0x2e1cf3);});}return respondWithRpcPromise(_0x72f5('0xc3'),_0x72f5('0xc2'),_0x2e1cf3);})[_0x72f5('0x35')](function(_0x1fd6b5){respondWithRpcPromise(_0x72f5('0xc4'),_0x72f5('0xc4'),{'event':_0x72f5('0xc5'),'message':_0x1fd6b5},client9002);return _0x1fd6b5;})[_0x72f5('0x35')](respondWithResult(_0x4af82f,null))[_0x72f5('0x2a')](handleError(_0x4af82f,null));};exports[_0x72f5('0xc6')]=function(_0x130a48,_0x2afd24,_0xeef33c){var _0x590266,_0x3abe11,_0x97b3dc;var _0x2156a9=[];var _0x19a89e=[];var _0x2cb3e5={};return db[_0x72f5('0x8c')][_0x72f5('0x64')]()['then'](function(_0x2837f9){if(!_0x2837f9){throw new db['Sequelize'][(_0x72f5('0x1e'))](_0x72f5('0x8e'));}_0x19a89e=_[_0x72f5('0x8f')](_[_0x72f5('0x45')](_0x2837f9),['createdAt',_0x72f5('0x98')]);_0x2156a9=_[_0x72f5('0x8f')](_['keys'](_0x2837f9),['createdAt',_0x72f5('0x98'),'CompanyId',_0x72f5('0xc7')]);if(_0x130a48[_0x72f5('0x63')]['id']){delete _0x130a48[_0x72f5('0x63')]['id'];}if(_[_0x72f5('0x7a')](_0x130a48[_0x72f5('0x63')][_0x72f5('0x91')])){throw _0x2afd24[_0x72f5('0x2c')](0x1f4)['send'](new db[(_0x72f5('0x8d'))]['ValidationError'](_0x72f5('0x92')));}if(_[_0x72f5('0x7a')](_0x130a48[_0x72f5('0x63')][_0x72f5('0x63')])||_0x130a48[_0x72f5('0x63')]['body']===''){throw _0x2afd24['status'](0x1f4)[_0x72f5('0x3a')](new db[(_0x72f5('0x8d'))][(_0x72f5('0x1e'))](_0x72f5('0xc8')));}if(_[_0x72f5('0x7a')](_0x130a48[_0x72f5('0x63')]['mapKeyOffline'])){throw _0x2afd24[_0x72f5('0x2c')](0x1f4)['send'](new db['Sequelize'][(_0x72f5('0x1e'))](_0x72f5('0xc9')+_0x2156a9));}if(!_['includes'](_0x2156a9,_0x130a48[_0x72f5('0x63')][_0x72f5('0xca')])){throw _0x2afd24[_0x72f5('0x2c')](0x1f4)['send'](new db['Sequelize'][(_0x72f5('0x1e'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2156a9));}_0x2cb3e5[_0x130a48[_0x72f5('0x63')]['mapKeyOffline']]=_0x130a48[_0x72f5('0x63')][_0x72f5('0x91')];})[_0x72f5('0x35')](function(){return db[_0x72f5('0x3f')][_0x72f5('0x5a')]({'where':{'id':_0x130a48['params']['id']},'include':[{'model':db[_0x72f5('0x95')],'as':'List'}]});})[_0x72f5('0x35')](handleEntityNotFound(_0x2afd24,null))[_0x72f5('0x35')](function(_0x130a4a){if(_0x130a4a&&_0x130a4a['List']){_0x3abe11=_0x130a4a;var _0x181b4a=_[_0x72f5('0xa0')](_0x130a48[_0x72f5('0x63')],{'firstName':_0x130a48[_0x72f5('0x63')][_0x72f5('0x91')],'phone':_0x130a48['body'][_0x72f5('0x91')],'ListId':_0x130a4a[_0x72f5('0xc7')]});_0x181b4a[_0x130a48['body'][_0x72f5('0xca')]]=_0x130a48[_0x72f5('0x63')][_0x72f5('0x91')];return db[_0x72f5('0x8c')]['findOrCreate']({'where':_0x2cb3e5,'defaults':_0x181b4a});}})[_0x72f5('0xb6')](function(_0x549532){if(_0x549532){_0x97b3dc=_0x549532;var _0x2c1b25=fs[_0x72f5('0xcb')](path[_0x72f5('0x76')](config[_0x72f5('0x7e')],_0x72f5('0xcc')),'utf8');var _0x5c9cb8=ejs['render'](_0x2c1b25,{'body':_[_0x72f5('0xcd')](_0x130a48[_0x72f5('0x63')][_0x72f5('0x63')]),'bodyTitle':_0x3abe11[_0x72f5('0xce')]});return db[_0x72f5('0xcf')][_0x72f5('0x5b')]({'body':_0x5c9cb8,'ContactId':_0x549532['id'],'ChatWebsiteId':_0x3abe11['id']});}})[_0x72f5('0x35')](function(_0x4add4b){if(_0x4add4b){_0x590266=_0x4add4b;return db[_0x72f5('0xd0')][_0x72f5('0x66')]({'where':{'service':!![]},'include':[{'model':db[_0x72f5('0xd1')],'as':_0x72f5('0xd2'),'raw':!![]}]});}})[_0x72f5('0x35')](function(_0xe5b806){if(_0xe5b806&&_0xe5b806[_0x72f5('0xd2')]&&_0x3abe11[_0x72f5('0xd3')]){var _0x2696f2={'tls':{'rejectUnauthorized':![]}};if(_0xe5b806[_0x72f5('0xd2')][_0x72f5('0xd4')]){_0x2696f2[_0x72f5('0xd4')]=_0xe5b806[_0x72f5('0xd2')][_0x72f5('0xd4')];}else{_0x2696f2[_0x72f5('0xd5')]=_0xe5b806[_0x72f5('0xd2')][_0x72f5('0xd5')];_0x2696f2['port']=_0xe5b806[_0x72f5('0xd2')][_0x72f5('0xd6')];_0x2696f2[_0x72f5('0xd7')]=_0xe5b806[_0x72f5('0xd2')][_0x72f5('0xd7')];}if(_0xe5b806[_0x72f5('0xd2')][_0x72f5('0xd8')]){_0x2696f2[_0x72f5('0xd9')]={'user':_0xe5b806[_0x72f5('0xd2')][_0x72f5('0x5c')],'pass':_0xe5b806[_0x72f5('0xd2')][_0x72f5('0xda')]};}return respondWithRpcPromise(_0x72f5('0xdb'),'sendMail',{'account':_0x2696f2,'message':{'from':util[_0x72f5('0xad')]('\x22%s\x22\x20<%s>',_0xe5b806[_0x72f5('0x39')],_0xe5b806[_0x72f5('0xdc')]||_0xe5b806[_0x72f5('0xd2')]['user']),'to':_0x3abe11[_0x72f5('0xd3')],'subject':_0x3abe11[_0x72f5('0xdd')],'text':_0x590266[_0x72f5('0x63')]}},client9003)[_0x72f5('0x35')](function(){return _0x590266;})['catch'](function(_0x5a9c33){console[_0x72f5('0x26')](_0x5a9c33);});}})[_0x72f5('0x35')](function(){if(_0x590266){return _0x590266;}})[_0x72f5('0x35')](respondWithResult(_0x2afd24,null))[_0x72f5('0x2a')](handleError(_0x2afd24,null));};exports[_0x72f5('0xde')]=function(_0x99d1e0,_0x1f414a,_0x5553ea){return db[_0x72f5('0xb3')][_0x72f5('0x5a')]({'where':{'id':_0x99d1e0[_0x72f5('0x57')]['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x1f414a,null))['then'](function(_0x59cd61){if(_0x59cd61){return _0x59cd61[_0x72f5('0xde')](_0x99d1e0[_0x72f5('0x63')][_0x72f5('0x69')],_[_0x72f5('0xdf')](_0x99d1e0[_0x72f5('0x63')],[_0x72f5('0x69'),'id'])||{});}})[_0x72f5('0x35')](respondWithResult(_0x1f414a,null))[_0x72f5('0x2a')](handleError(_0x1f414a,null));};exports[_0x72f5('0xe0')]=function(_0x248c3f,_0x3c8170,_0x3cbf22){var _0x15f28e={'raw':![],'where':{}};var _0x370c0b={};var _0x403342={'count':0x0,'rows':[]};return db[_0x72f5('0x3f')]['findOne']({'where':{'id':_0x248c3f['params']['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x3c8170,null))[_0x72f5('0x35')](function(_0x321065){if(_0x321065){_0x370c0b[_0x72f5('0x43')]=_[_0x72f5('0x45')](db['ChatInteraction'][_0x72f5('0x58')]);_0x370c0b['query']=_[_0x72f5('0x45')](_0x248c3f[_0x72f5('0x44')]);_0x370c0b['filters']=_[_0x72f5('0x59')](_0x370c0b['model'],_0x370c0b[_0x72f5('0x44')]);_0x15f28e[_0x72f5('0x46')]=_['intersection'](_0x370c0b[_0x72f5('0x43')],qs[_0x72f5('0x47')](_0x248c3f[_0x72f5('0x44')][_0x72f5('0x47')]));_0x15f28e['attributes']=_0x15f28e[_0x72f5('0x46')][_0x72f5('0x48')]?_0x15f28e[_0x72f5('0x46')]:_0x370c0b['model'];if(!_0x248c3f[_0x72f5('0x44')]['hasOwnProperty'](_0x72f5('0x4a'))){_0x15f28e[_0x72f5('0x4b')]=qs[_0x72f5('0x4b')](_0x248c3f[_0x72f5('0x44')][_0x72f5('0x4b')]);_0x15f28e['offset']=qs[_0x72f5('0x2f')](_0x248c3f[_0x72f5('0x44')]['offset']);}_0x15f28e[_0x72f5('0x67')]=qs[_0x72f5('0x4c')](_0x248c3f[_0x72f5('0x44')]['sort']);_0x15f28e['where']=qs['filters'](_[_0x72f5('0x4f')](_0x248c3f[_0x72f5('0x44')],_0x370c0b[_0x72f5('0x4e')]));_0x15f28e[_0x72f5('0x4d')][_0x72f5('0x6a')]=_0x321065['id'];if(_0x248c3f['query'][_0x72f5('0x50')]){_0x15f28e['where']=_['merge'](_0x15f28e[_0x72f5('0x4d')],{'$or':_['map'](_0x15f28e[_0x72f5('0x46')],function(_0x1be6f9){var _0x4487fb={};_0x4487fb[_0x1be6f9]={'$like':'%'+_0x248c3f[_0x72f5('0x44')][_0x72f5('0x50')]+'%'};return _0x4487fb;})});}_0x15f28e=_['merge']({},_0x15f28e,_0x248c3f[_0x72f5('0x52')]);return db[_0x72f5('0xb3')][_0x72f5('0x2e')]({'where':_0x15f28e[_0x72f5('0x4d')]})['then'](function(_0x142d37){_0x403342['count']=_0x142d37;if(_0x248c3f[_0x72f5('0x44')][_0x72f5('0x53')]){_0x15f28e[_0x72f5('0x54')]=[{'model':db[_0x72f5('0x8c')],'as':_0x72f5('0xe1'),'required':![]},{'model':db[_0x72f5('0xe2')],'as':_0x72f5('0xe3'),'attributes':[_0x72f5('0x39'),_0x72f5('0xe4'),_0x72f5('0xe5')],'required':![]},{'model':db[_0x72f5('0xe6')],'as':_0x72f5('0xe7'),'attributes':['id',_0x72f5('0x39'),_0x72f5('0xe8')],'where':_0x248c3f[_0x72f5('0x44')]['tag']?{'id':_0x248c3f['query']['tag']}:undefined,'required':_0x248c3f[_0x72f5('0x44')][_0x72f5('0xe9')]?!![]:![]}];}return db[_0x72f5('0xb3')][_0x72f5('0x55')](_0x15f28e);})[_0x72f5('0x35')](function(_0x23047e){_0x403342['rows']=_0x23047e;return _0x403342;});}})[_0x72f5('0x35')](respondWithFilteredResult(_0x3c8170,_0x15f28e))[_0x72f5('0x2a')](handleError(_0x3c8170,null));};function iftimePromise(_0x4d1882,_0x185faf){return respondWithRpcPromise('Command',_0x72f5('0xea'),{'command':_0x185faf[_0x72f5('0xeb')]?util[_0x72f5('0xad')](_0x72f5('0xec'),_0x4d1882['interval'],_0x185faf['timezone']):util[_0x72f5('0xad')](_0x72f5('0xed'),_0x4d1882['interval'])},client9002)[_0x72f5('0x35')](function(_0x29a360){var _0x6f7753=_0x29a360&&_0x29a360['indexOf'](_0x72f5('0xee'))>=0x0?!![]:![];logger[_0x72f5('0x20')](_0x72f5('0xef'),_0x185faf['id'],_0x4d1882['id'],_0x4d1882[_0x72f5('0xf0')],_0x6f7753?_0x72f5('0xf1'):'OFFLINE',_0x185faf[_0x72f5('0xeb')]?_0x185faf[_0x72f5('0xeb')]:_0x72f5('0xf2'));return _0x6f7753;})[_0x72f5('0x2a')](function(_0x8ef1d8){logger['error'](_0x72f5('0xef'),_0x185faf['id'],_0x4d1882['id'],_0x4d1882[_0x72f5('0xf0')],util[_0x72f5('0xf3')](_0x8ef1d8,{'showHidden':![],'depth':null}),_0x185faf[_0x72f5('0xeb')]?_0x185faf['timezone']:_0x72f5('0xf2'));return![];});}exports['getSnippet']=function(_0x24da08,_0x54c76d,_0x58b46a){var _0x400ab4=0x0;var _0x6ec811=0x0;var _0x2d013d=![];var _0x76f06d;var _0x379df6;return db[_0x72f5('0x3f')][_0x72f5('0x5a')]({'where':{'id':_0x24da08[_0x72f5('0x57')]['id']},'include':[{'model':db[_0x72f5('0xf4')],'as':_0x72f5('0xf4'),'include':[{'model':db[_0x72f5('0xf4')],'as':_0x72f5('0xf5'),'attributes':['id',_0x72f5('0xf0')],'raw':!![]}]}]})[_0x72f5('0x35')](handleEntityNotFound(_0x54c76d,null))[_0x72f5('0x35')](function(_0x37c441){if(_0x37c441){_0x76f06d=_0x37c441;return _0x37c441['getProactiveActions']({'raw':!![]});}})[_0x72f5('0x35')](function(_0x6ff5d){if(_0x76f06d){if(_0x6ff5d){_0x379df6=_0x6ff5d;}}return require(_0x72f5('0xf6'))[_0x72f5('0x78')]();})[_0x72f5('0x35')](function(_0x2ae050){if(_0x2ae050){_0x6ec811=_0x2ae050[_0x72f5('0xf7')];_0x2d013d=_0x2ae050[_0x72f5('0x79')];}})['then'](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0x72f5('0x35')](function(_0x596694){_0x400ab4=_0x596694;if(_0x6ec811&&_0x596694>_0x6ec811){return db['License'][_0x72f5('0x66')]({'where':{'id':0x1}})[_0x72f5('0x35')](function(_0x3e0b26){if(_0x3e0b26){_0x3e0b26[_0x72f5('0xf8')](_0x72f5('0xf9'));}});}})['then'](function(){if(_0x76f06d[_0x72f5('0xf4')]&&_0x76f06d['Interval'][_0x72f5('0xf5')]){var _0x4ff845=[];for(var _0x27b265=0x0;_0x27b265<_0x76f06d[_0x72f5('0xf4')][_0x72f5('0xf5')][_0x72f5('0x48')];_0x27b265++){var _0x547f8b=_0x76f06d[_0x72f5('0xf4')][_0x72f5('0xf5')][_0x27b265]['get']({'plain':!![]});_0x4ff845['push'](iftimePromise(_0x547f8b,_0x76f06d));}return BPromise[_0x72f5('0xfa')](_0x4ff845)['then'](function(_0x4d503b){return _[_0x72f5('0xfb')](_0x4d503b);});}else{return!![];}})[_0x72f5('0x35')](function(_0x4ea239){var _0x5a596f=fs['readFileSync'](path[_0x72f5('0x76')](config[_0x72f5('0x7e')],_0x72f5('0xfc')),_0x72f5('0xfd'));var _0x49f9d8={'remote':_0x76f06d[_0x72f5('0xfe')],'query':querystring[_0x72f5('0x25')](_[_0x72f5('0x51')](_0x76f06d[_0x72f5('0x5f')]({'plain':!![]}),{'customerIp':_0x24da08[_0x72f5('0xa2')]['x-forwarded-for']||_0x24da08[_0x72f5('0xa2')][_0x72f5('0xff')]||_0x24da08['connection'][_0x72f5('0x100')]||_0x24da08['ip'],'referer':_0x24da08['headers'][_0x72f5('0xaa')],'openedInteractions':_0x400ab4,'maxInteractions':_0x6ec811,'virtual':_0x2d013d[_0x72f5('0xf7')],'online':_0x4ea239,'custom':_0x2d013d}))[_0x72f5('0x101')](/'/g,'\x5c\x27')};_0x54c76d['send'](ejs[_0x72f5('0x102')](Mustache['render'](_0x5a596f,_0x49f9d8),{'proactiveActions':_0x379df6,'alignment':_0x76f06d[_0x72f5('0x103')],'verticalAlignment':_0x76f06d[_0x72f5('0x104')],'div_color':_0x76f06d[_0x72f5('0xe8')],'text_color':_0x76f06d['textColor']}));})[_0x72f5('0x2a')](handleError(_0x54c76d,null));};exports[_0x72f5('0x105')]=function(_0x1bac82,_0x449c26,_0x42b2a5){return db[_0x72f5('0x3f')][_0x72f5('0x66')]({'where':{'id':_0x1bac82[_0x72f5('0x57')]['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x449c26,null))[_0x72f5('0x35')](function(_0x4f87e8){if(_0x4f87e8){return db[_0x72f5('0x106')][_0x72f5('0x107')](function(_0x569d15){return db[_0x72f5('0x99')][_0x72f5('0x34')]({'where':{'ChatWebsiteId':_0x1bac82[_0x72f5('0x57')]['id']},'transaction':_0x569d15})['then'](function(_0x47e530){var _0x3ee5f3=_[_0x72f5('0x3e')](_0x1bac82[_0x72f5('0x63')],function(_0x2f2fdc){_0x2f2fdc['ChatWebsiteId']=_0x1bac82[_0x72f5('0x57')]['id'];return _0x2f2fdc;});return db[_0x72f5('0x99')][_0x72f5('0x108')](_0x3ee5f3,{'transaction':_0x569d15});});})['then'](function(){return db[_0x72f5('0x99')][_0x72f5('0x109')]({'where':{'ChatWebsiteId':_0x1bac82[_0x72f5('0x57')]['id']},'order':_0x72f5('0x10a')});});}})[_0x72f5('0x35')](respondWithResult(_0x449c26,null))[_0x72f5('0x2a')](handleError(_0x449c26,null));};exports['getApplications']=function(_0x325dd7,_0x3b510e,_0x39b966){var _0x255fc8={};var _0x5524aa={};var _0xf123d6;var _0x4c0369;return db[_0x72f5('0x3f')]['findOne']({'where':{'id':_0x325dd7['params']['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x3b510e,null))[_0x72f5('0x35')](function(_0x454e38){if(_0x454e38){_0xf123d6=_0x454e38;_0x5524aa[_0x72f5('0x43')]=_[_0x72f5('0x45')](db[_0x72f5('0x99')]['rawAttributes']);_0x5524aa[_0x72f5('0x44')]=_[_0x72f5('0x45')](_0x325dd7[_0x72f5('0x44')]);_0x5524aa['filters']=_[_0x72f5('0x59')](_0x5524aa[_0x72f5('0x43')],_0x5524aa[_0x72f5('0x44')]);_0x255fc8[_0x72f5('0x46')]=_[_0x72f5('0x59')](_0x5524aa[_0x72f5('0x43')],qs[_0x72f5('0x47')](_0x325dd7[_0x72f5('0x44')][_0x72f5('0x47')]));_0x255fc8[_0x72f5('0x46')]=_0x255fc8[_0x72f5('0x46')][_0x72f5('0x48')]?_0x255fc8[_0x72f5('0x46')]:_0x5524aa[_0x72f5('0x43')];_0x255fc8[_0x72f5('0x67')]=qs[_0x72f5('0x4c')](_0x325dd7['query'][_0x72f5('0x4c')]);_0x255fc8[_0x72f5('0x4d')]=qs[_0x72f5('0x4e')](_[_0x72f5('0x4f')](_0x325dd7['query'],_0x5524aa[_0x72f5('0x4e')]));if(_0x325dd7[_0x72f5('0x44')][_0x72f5('0x50')]){_0x255fc8[_0x72f5('0x4d')]=_[_0x72f5('0x51')](_0x255fc8['where'],{'$or':_[_0x72f5('0x3e')](_0x255fc8['attributes'],function(_0x3b5663){var _0x3b892f={};_0x3b892f[_0x3b5663]={'$like':'%'+_0x325dd7[_0x72f5('0x44')][_0x72f5('0x50')]+'%'};return _0x3b892f;})});}_0x255fc8=_['merge']({},_0x255fc8,_0x325dd7[_0x72f5('0x52')]);return _0xf123d6[_0x72f5('0x10b')](_0x255fc8);}})[_0x72f5('0x35')](function(_0x4472fb){if(_0x4472fb){_0x4c0369=_0x4472fb[_0x72f5('0x48')];if(!_0x325dd7[_0x72f5('0x44')]['hasOwnProperty'](_0x72f5('0x4a'))){_0x255fc8[_0x72f5('0x4b')]=qs[_0x72f5('0x4b')](_0x325dd7[_0x72f5('0x44')][_0x72f5('0x4b')]);_0x255fc8[_0x72f5('0x2f')]=qs['offset'](_0x325dd7[_0x72f5('0x44')][_0x72f5('0x2f')]);}return _0xf123d6['getApplications'](_0x255fc8);}})['then'](function(_0x5583ff){if(_0x5583ff){return _0x5583ff?{'count':_0x4c0369,'rows':_0x5583ff}:null;}})['then'](respondWithResult(_0x3b510e,null))[_0x72f5('0x2a')](handleError(_0x3b510e,null));};exports['addProactiveActions']=function(_0x1f1a4e,_0x556bd7,_0x433642){return db[_0x72f5('0x10c')][_0x72f5('0x5a')]({'where':{'id':_0x1f1a4e[_0x72f5('0x57')]['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x556bd7,null))[_0x72f5('0x35')](function(_0x500901){if(_0x500901){return _0x500901[_0x72f5('0x10d')](_0x1f1a4e[_0x72f5('0x63')][_0x72f5('0x69')],_['omit'](_0x1f1a4e[_0x72f5('0x63')],[_0x72f5('0x69'),'id'])||{});}})[_0x72f5('0x35')](respondWithResult(_0x556bd7,null))[_0x72f5('0x2a')](handleError(_0x556bd7,null));};exports[_0x72f5('0x10e')]=function(_0x3ef988,_0x50c162,_0x55828e){var _0x39576c={};var _0x10fe71={};var _0xa8fde2;var _0x269015;return db['ChatWebsite'][_0x72f5('0x66')]({'where':{'id':_0x3ef988['params']['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x50c162,null))[_0x72f5('0x35')](function(_0x424945){if(_0x424945){_0xa8fde2=_0x424945;_0x10fe71['model']=_[_0x72f5('0x45')](db[_0x72f5('0x10f')][_0x72f5('0x58')]);_0x10fe71[_0x72f5('0x44')]=_[_0x72f5('0x45')](_0x3ef988[_0x72f5('0x44')]);_0x10fe71[_0x72f5('0x4e')]=_[_0x72f5('0x59')](_0x10fe71[_0x72f5('0x43')],_0x10fe71['query']);_0x39576c[_0x72f5('0x46')]=_[_0x72f5('0x59')](_0x10fe71['model'],qs[_0x72f5('0x47')](_0x3ef988[_0x72f5('0x44')][_0x72f5('0x47')]));_0x39576c[_0x72f5('0x46')]=_0x39576c[_0x72f5('0x46')][_0x72f5('0x48')]?_0x39576c[_0x72f5('0x46')]:_0x10fe71[_0x72f5('0x43')];_0x39576c[_0x72f5('0x67')]=qs[_0x72f5('0x4c')](_0x3ef988['query'][_0x72f5('0x4c')]);_0x39576c[_0x72f5('0x4d')]=qs[_0x72f5('0x4e')](_[_0x72f5('0x4f')](_0x3ef988['query'],_0x10fe71[_0x72f5('0x4e')]));if(_0x3ef988[_0x72f5('0x44')][_0x72f5('0x50')]){_0x39576c[_0x72f5('0x4d')]=_['merge'](_0x39576c[_0x72f5('0x4d')],{'$or':_['map'](_0x39576c[_0x72f5('0x46')],function(_0x40669c){var _0x14c21a={};_0x14c21a[_0x40669c]={'$like':'%'+_0x3ef988['query']['filter']+'%'};return _0x14c21a;})});}_0x39576c=_[_0x72f5('0x51')]({},_0x39576c,_0x3ef988[_0x72f5('0x52')]);return _0xa8fde2['getProactiveActions'](_0x39576c);}})[_0x72f5('0x35')](function(_0x53e363){if(_0x53e363){_0x269015=_0x53e363[_0x72f5('0x48')];if(!_0x3ef988[_0x72f5('0x44')]['hasOwnProperty'](_0x72f5('0x4a'))){_0x39576c[_0x72f5('0x4b')]=qs['limit'](_0x3ef988[_0x72f5('0x44')][_0x72f5('0x4b')]);_0x39576c['offset']=qs[_0x72f5('0x2f')](_0x3ef988[_0x72f5('0x44')][_0x72f5('0x2f')]);}return _0xa8fde2[_0x72f5('0x10e')](_0x39576c);}})['then'](function(_0x5b92e2){if(_0x5b92e2){return _0x5b92e2?{'count':_0x269015,'rows':_0x5b92e2}:null;}})['then'](respondWithResult(_0x50c162,null))[_0x72f5('0x2a')](handleError(_0x50c162,null));};exports[_0x72f5('0x110')]=function(_0x46c220,_0x3285e1,_0x22d532){var _0x2caf57=_0x46c220[_0x72f5('0x44')][_0x72f5('0x111')]==='false'?_0x72f5('0x112'):_0x72f5('0x113');return db[_0x72f5('0x3f')][_0x72f5('0x5a')]({'attributes':['id',_0x2caf57],'where':{'id':_0x46c220[_0x72f5('0x57')]['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x3285e1,null))[_0x72f5('0x35')](function(_0x463784){if(_0x463784){var _0x4169df=_0x463784[_0x2caf57];var _0x5d4bf0=_0x4169df&&_0x4169df['items']?_0x4169df[_0x72f5('0x114')]:[];_0x3285e1['send']({'fromKey':_[_0x72f5('0x7a')](_0x4169df[_0x72f5('0x115')])?undefined:_0x4169df['fromKey'],'count':_0x5d4bf0[_0x72f5('0x48')],'rows':_0x5d4bf0});}})['catch'](handleError(_0x3285e1,null));};exports[_0x72f5('0x116')]=function(_0x4d5241,_0x4ed235,_0x3cc578){var _0x3abafd={'raw':![],'where':{}};var _0x17ac70={};var _0x2672cc={'count':0x0,'rows':[]};return db[_0x72f5('0x3f')][_0x72f5('0x66')]({'where':{'id':_0x4d5241[_0x72f5('0x57')]['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x4ed235,null))[_0x72f5('0x35')](function(_0x485e0a){if(_0x485e0a){_0x17ac70['model']=_[_0x72f5('0x45')](db[_0x72f5('0xcf')][_0x72f5('0x58')]);_0x17ac70[_0x72f5('0x44')]=_['keys'](_0x4d5241[_0x72f5('0x44')]);_0x17ac70['filters']=_[_0x72f5('0x59')](_0x17ac70[_0x72f5('0x43')],_0x17ac70[_0x72f5('0x44')]);_0x3abafd[_0x72f5('0x46')]=_[_0x72f5('0x59')](_0x17ac70[_0x72f5('0x43')],qs[_0x72f5('0x47')](_0x4d5241[_0x72f5('0x44')][_0x72f5('0x47')]));_0x3abafd[_0x72f5('0x46')]=_0x3abafd[_0x72f5('0x46')][_0x72f5('0x48')]?_0x3abafd[_0x72f5('0x46')]:_0x17ac70[_0x72f5('0x43')];if(!_0x4d5241[_0x72f5('0x44')]['hasOwnProperty'](_0x72f5('0x4a'))){_0x3abafd['limit']=qs['limit'](_0x4d5241['query']['limit']);_0x3abafd['offset']=qs[_0x72f5('0x2f')](_0x4d5241[_0x72f5('0x44')][_0x72f5('0x2f')]);}_0x3abafd[_0x72f5('0x67')]=qs[_0x72f5('0x4c')](_0x4d5241[_0x72f5('0x44')][_0x72f5('0x4c')]);_0x3abafd[_0x72f5('0x4d')]=qs[_0x72f5('0x4e')](_['pick'](_0x4d5241['query'],_0x17ac70['filters']));_0x3abafd[_0x72f5('0x4d')][_0x72f5('0x6a')]=_0x485e0a['id'];if(_0x4d5241[_0x72f5('0x44')][_0x72f5('0x50')]){_0x3abafd[_0x72f5('0x4d')]=_[_0x72f5('0x51')](_0x3abafd[_0x72f5('0x4d')],{'$or':_[_0x72f5('0x3e')](_0x3abafd[_0x72f5('0x46')],function(_0x55d75a){var _0x2921e6={};_0x2921e6[_0x55d75a]={'$like':'%'+_0x4d5241[_0x72f5('0x44')][_0x72f5('0x50')]+'%'};return _0x2921e6;})});}_0x3abafd=_[_0x72f5('0x51')]({},_0x3abafd,_0x4d5241[_0x72f5('0x52')]);return db[_0x72f5('0xcf')][_0x72f5('0x2e')]({'where':_0x3abafd[_0x72f5('0x4d')]})[_0x72f5('0x35')](function(_0x41b716){_0x2672cc['count']=_0x41b716;if(_0x4d5241['query'][_0x72f5('0x53')]){_0x3abafd[_0x72f5('0x54')]=[{'all':!![]}];}else{_0x3abafd[_0x72f5('0x54')]=[{'model':db[_0x72f5('0x8c')],'as':_0x72f5('0xe1'),'required':![]}];}return db['ChatOfflineMessage'][_0x72f5('0x55')](_0x3abafd);})[_0x72f5('0x35')](function(_0x2e2e5f){_0x2672cc[_0x72f5('0x56')]=_0x2e2e5f;return _0x2672cc;});}})[_0x72f5('0x35')](respondWithFilteredResult(_0x4ed235,_0x3abafd))[_0x72f5('0x2a')](handleError(_0x4ed235,null));};exports[_0x72f5('0x117')]=function(_0xf2b1f1,_0x17bf05,_0x5e2040){return db[_0x72f5('0x3f')]['find']({'where':{'id':_0xf2b1f1[_0x72f5('0x57')]['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x17bf05,null))['then'](function(_0xe1b626){if(_0xe1b626){return _0xe1b626['addAgents'](_0xf2b1f1[_0x72f5('0x63')][_0x72f5('0x69')],_[_0x72f5('0xdf')](_0xf2b1f1[_0x72f5('0x63')],[_0x72f5('0x69'),'id'])||{})[_0x72f5('0xb6')](function(_0x4b3565){for(var _0x296f74=0x0;_0x296f74<_0xf2b1f1[_0x72f5('0x63')]['ids'][_0x72f5('0x48')];_0x296f74+=0x1){socket[_0x72f5('0x118')](_0x72f5('0x119'),{'UserId':_0xf2b1f1['body'][_0x72f5('0x69')][_0x296f74],'ChatWebsiteId':_0xf2b1f1[_0x72f5('0x57')]['id']});}return _0x4b3565;});}})[_0x72f5('0x35')](respondWithResult(_0x17bf05,null))['catch'](handleError(_0x17bf05,null));};exports['removeAgents']=function(_0xa21a1,_0x332d6f,_0x134e62){return db[_0x72f5('0x3f')][_0x72f5('0x5a')]({'where':{'id':_0xa21a1[_0x72f5('0x57')]['id']}})[_0x72f5('0x35')](handleEntityNotFound(_0x332d6f,null))[_0x72f5('0x35')](function(_0x3e1c8b){if(_0x3e1c8b){return _0x3e1c8b['removeAgents'](_0xa21a1['query']['ids'])[_0x72f5('0x35')](function(){if(_[_0x72f5('0x11a')](_0xa21a1[_0x72f5('0x44')][_0x72f5('0x69')])){for(var _0x43d62e=0x0;_0x43d62e<_0xa21a1[_0x72f5('0x44')]['ids'][_0x72f5('0x48')];_0x43d62e+=0x1){socket[_0x72f5('0x118')](_0x72f5('0x11b'),{'UserId':Number(_0xa21a1[_0x72f5('0x44')][_0x72f5('0x69')][_0x43d62e]),'ChatWebsiteId':Number(_0xa21a1[_0x72f5('0x57')]['id'])});}}else{socket[_0x72f5('0x118')](_0x72f5('0x11b'),{'UserId':Number(_0xa21a1[_0x72f5('0x44')][_0x72f5('0x69')]),'ChatWebsiteId':Number(_0xa21a1['params']['id'])});}});}})['then'](respondWithStatusCode(_0x332d6f,null))[_0x72f5('0x2a')](handleError(_0x332d6f,null));};exports[_0x72f5('0x11c')]=function(_0xc6c9ab,_0x45ce3c,_0x265c4d){var _0x4bd144={};var _0x2cf231={};var _0x10d899;var _0x112c75;return db['ChatWebsite'][_0x72f5('0x66')]({'where':{'id':_0xc6c9ab['params']['id']}})['then'](handleEntityNotFound(_0x45ce3c,null))[_0x72f5('0x35')](function(_0xcfd23d){if(_0xcfd23d){_0x10d899=_0xcfd23d;_0x2cf231[_0x72f5('0x43')]=_[_0x72f5('0x45')](db['User'][_0x72f5('0x58')]);_0x2cf231[_0x72f5('0x44')]=_['keys'](_0xc6c9ab[_0x72f5('0x44')]);_0x2cf231[_0x72f5('0x4e')]=_[_0x72f5('0x59')](_0x2cf231[_0x72f5('0x43')],_0x2cf231[_0x72f5('0x44')]);_0x4bd144[_0x72f5('0x46')]=_['intersection'](_0x2cf231['model'],qs['fields'](_0xc6c9ab[_0x72f5('0x44')][_0x72f5('0x47')]));_0x4bd144[_0x72f5('0x46')]=_0x4bd144[_0x72f5('0x46')][_0x72f5('0x48')]?_0x4bd144[_0x72f5('0x46')]:_0x2cf231['model'];_0x4bd144['order']=qs[_0x72f5('0x4c')](_0xc6c9ab[_0x72f5('0x44')]['sort']);_0x4bd144[_0x72f5('0x4d')]=qs[_0x72f5('0x4e')](_[_0x72f5('0x4f')](_0xc6c9ab['query'],_0x2cf231['filters']));if(_0xc6c9ab[_0x72f5('0x44')]['filter']){_0x4bd144[_0x72f5('0x4d')]=_[_0x72f5('0x51')](_0x4bd144[_0x72f5('0x4d')],{'$or':_[_0x72f5('0x3e')](_0x4bd144[_0x72f5('0x46')],function(_0x38301c){var _0x2b7fd9={};_0x2b7fd9[_0x38301c]={'$like':'%'+_0xc6c9ab['query'][_0x72f5('0x50')]+'%'};return _0x2b7fd9;})});}_0x4bd144=_[_0x72f5('0x51')]({},_0x4bd144,_0xc6c9ab['options']);return _0x10d899[_0x72f5('0x11c')](_0x4bd144);}})[_0x72f5('0x35')](function(_0xbbabff){if(_0xbbabff){_0x112c75=_0xbbabff['length'];if(!_0xc6c9ab[_0x72f5('0x44')][_0x72f5('0x49')](_0x72f5('0x4a'))){_0x4bd144['limit']=qs['limit'](_0xc6c9ab[_0x72f5('0x44')][_0x72f5('0x4b')]);_0x4bd144[_0x72f5('0x2f')]=qs[_0x72f5('0x2f')](_0xc6c9ab['query'][_0x72f5('0x2f')]);}return _0x10d899['getAgents'](_0x4bd144);}})[_0x72f5('0x35')](function(_0x28fe0f){if(_0x28fe0f){return _0x28fe0f?{'count':_0x112c75,'rows':_0x28fe0f}:null;}})[_0x72f5('0x35')](respondWithResult(_0x45ce3c,null))['catch'](handleError(_0x45ce3c,null));};
\ No newline at end of file
+var _0xcf58=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','describe','Disposition','findOne','hasOwnProperty','pick','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','ListId','contact','customerIp','first','x-forwarded-for','lastName','x-real-port','referer','browser','version','unknown','format','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','CompanyId','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','interval','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','push','all','some','readFileSync','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','keys','find','create'];(function(_0xc2e46e,_0x3b979c){var _0x1a355d=function(_0x2cd000){while(--_0x2cd000){_0xc2e46e['push'](_0xc2e46e['shift']());}};_0x1a355d(++_0x3b979c);}(_0xcf58,0xc3));var _0x8cf5=function(_0x2e2f10,_0x14948c){_0x2e2f10=_0x2e2f10-0x0;var _0x2727cb=_0xcf58[_0x2e2f10];return _0x2727cb;};'use strict';var pdf=require(_0x8cf5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8cf5('0x1'));var zipdir=require(_0x8cf5('0x2'));var jsonpatch=require(_0x8cf5('0x3'));var rp=require(_0x8cf5('0x4'));var moment=require(_0x8cf5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8cf5('0x6'));var util=require(_0x8cf5('0x7'));var path=require(_0x8cf5('0x8'));var sox=require(_0x8cf5('0x9'));var csv=require('to-csv');var ejs=require(_0x8cf5('0xa'));var fs=require('fs');var _=require(_0x8cf5('0xb'));var squel=require('squel');var crypto=require(_0x8cf5('0xc'));var jsforce=require(_0x8cf5('0xd'));var deskjs=require(_0x8cf5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8cf5('0xf'));var Papa=require(_0x8cf5('0x10'));var Redis=require(_0x8cf5('0x11'));var authService=require(_0x8cf5('0x12'));var qs=require(_0x8cf5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8cf5('0x14'));var logger=require(_0x8cf5('0x15'))(_0x8cf5('0x16'));var utils=require(_0x8cf5('0x17'));var config=require(_0x8cf5('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8cf5('0x19')](config[_0x8cf5('0x1a')],{'host':_0x8cf5('0x1b'),'port':0x18eb});var socket=require(_0x8cf5('0x1c'))(new Redis(config[_0x8cf5('0x1a')]));require(_0x8cf5('0x1d'))[_0x8cf5('0x1e')](socket);var jayson=require(_0x8cf5('0x1f'));var client=jayson['client'][_0x8cf5('0x20')]({'port':0x232c});var client9002=jayson[_0x8cf5('0x21')][_0x8cf5('0x20')]({'port':0x232a});var client9003=jayson[_0x8cf5('0x21')][_0x8cf5('0x20')]({'port':0x232b});function checkPasswordPattern(_0x593ede,_0x464b4d,_0x25b37b){if(_0x25b37b){var _0x1fc764=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1fc764['test'](_0x464b4d)){return _0x593ede;}else{throw new db[(_0x8cf5('0x22'))]['ValidationError'](_0x8cf5('0x23'));}}else{return _0x593ede;}}function respondWithRpcPromise(_0x3d7b86,_0x5e3fc4,_0x301246,_0x54f18c){return new BPromise(function(_0x3b7d17,_0x57b7c4){var _0x1e5d32=_0x54f18c||client;return _0x1e5d32[_0x8cf5('0x24')](_0x3d7b86,_0x301246)[_0x8cf5('0x25')](function(_0x511e4e){logger[_0x8cf5('0x26')](_0x8cf5('0x27'),_0x5e3fc4,'request\x20sent');logger[_0x8cf5('0x28')](_0x8cf5('0x29'),_0x5e3fc4,'request\x20sent',JSON[_0x8cf5('0x2a')](_0x511e4e));if(_0x511e4e[_0x8cf5('0x2b')]){if(_0x511e4e['error'][_0x8cf5('0x2c')]===0x1f4){logger[_0x8cf5('0x2b')](_0x8cf5('0x27'),_0x5e3fc4,_0x511e4e[_0x8cf5('0x2b')][_0x8cf5('0x2d')]);return _0x57b7c4(_0x511e4e['error']['message']);}logger[_0x8cf5('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0x5e3fc4,_0x511e4e[_0x8cf5('0x2b')][_0x8cf5('0x2d')]);return _0x3b7d17(_0x511e4e[_0x8cf5('0x2b')][_0x8cf5('0x2d')]);}else{logger['info'](_0x8cf5('0x27'),_0x5e3fc4,_0x8cf5('0x2e'));_0x3b7d17(_0x511e4e['result'][_0x8cf5('0x2d')]);}})[_0x8cf5('0x2f')](function(_0x408738){logger['error'](_0x8cf5('0x27'),_0x5e3fc4,_0x408738);_0x57b7c4(_0x408738);});});}function respondWithStatusCode(_0x29afc7,_0x43a982){_0x43a982=_0x43a982||0xcc;return function(_0x9f3b9c){if(_0x9f3b9c){return _0x29afc7['sendStatus'](_0x43a982);}return _0x29afc7[_0x8cf5('0x30')](_0x43a982)[_0x8cf5('0x31')]();};}function respondWithResult(_0x283f80,_0x234fd2){_0x234fd2=_0x234fd2||0xc8;return function(_0x41cc19){if(_0x41cc19){return _0x283f80[_0x8cf5('0x30')](_0x234fd2)[_0x8cf5('0x32')](_0x41cc19);}};}function respondWithFilteredResult(_0x46b2d7,_0x1016eb){return function(_0x8500cc){if(_0x8500cc){var _0x5c23b8=_0x8500cc[_0x8cf5('0x33')],_0x3a79e7=_0x1016eb[_0x8cf5('0x34')],_0x246fe7=_0x1016eb[_0x8cf5('0x34')]+_0x1016eb[_0x8cf5('0x35')],_0x1a66b2;if(_0x246fe7>=_0x5c23b8){_0x246fe7=_0x5c23b8;_0x1a66b2=0xc8;}else{_0x1a66b2=0xce;}_0x46b2d7['status'](_0x1a66b2);return _0x46b2d7[_0x8cf5('0x36')](_0x8cf5('0x37'),_0x3a79e7+'-'+_0x246fe7+'/'+_0x5c23b8)[_0x8cf5('0x32')](_0x8500cc);}return null;};}function patchUpdates(_0x4f3476){return function(_0x21c954){try{jsonpatch[_0x8cf5('0x38')](_0x21c954,_0x4f3476,!![]);}catch(_0x57a002){return BPromise['reject'](_0x57a002);}return _0x21c954[_0x8cf5('0x39')]();};}function saveUpdates(_0x6c5e9f,_0x240f7d){return function(_0x4648bb){if(_0x4648bb){return _0x4648bb[_0x8cf5('0x3a')](_0x6c5e9f)[_0x8cf5('0x25')](function(_0x368e8c){return _0x368e8c;});}return null;};}function removeEntity(_0x3b0213,_0xe99fc0){return function(_0x4d15ac){if(_0x4d15ac){return _0x4d15ac[_0x8cf5('0x3b')]()[_0x8cf5('0x25')](function(){var _0x16211c=_0x4d15ac[_0x8cf5('0x3c')]({'plain':!![]});var _0x3489bf=_0x8cf5('0x3d');return db[_0x8cf5('0x3e')][_0x8cf5('0x3b')]({'where':{'type':_0x3489bf,'resourceId':_0x16211c['id']}})[_0x8cf5('0x25')](function(){return _0x4d15ac;});})['then'](function(){_0x3b0213[_0x8cf5('0x30')](0xcc)[_0x8cf5('0x31')]();});}};}function handleEntityNotFound(_0x233bbc,_0x4367f2){return function(_0x3f6be4){if(!_0x3f6be4){_0x233bbc[_0x8cf5('0x3f')](0x194);}return _0x3f6be4;};}function handleError(_0x3fcce8,_0x590721){_0x590721=_0x590721||0x1f4;return function(_0x2cea08){logger[_0x8cf5('0x2b')](_0x2cea08[_0x8cf5('0x40')]);if(_0x2cea08[_0x8cf5('0x41')]){delete _0x2cea08[_0x8cf5('0x41')];}_0x3fcce8[_0x8cf5('0x30')](_0x590721)[_0x8cf5('0x42')](_0x2cea08);};}exports[_0x8cf5('0x43')]=function(_0x22d911,_0x4c6424){var _0x24f2c8={'include':[{'model':db['Pause'],'as':_0x8cf5('0x44')}]},_0x5b420f={},_0x54ae32={'count':0x0,'rows':[]};var _0x205703=_[_0x8cf5('0x45')](db[_0x8cf5('0x46')][_0x8cf5('0x47')],function(_0x1915af){return{'name':_0x1915af[_0x8cf5('0x48')],'type':_0x1915af[_0x8cf5('0x49')][_0x8cf5('0x4a')]};});_0x5b420f['model']=_[_0x8cf5('0x45')](_0x205703,_0x8cf5('0x41'));_0x5b420f[_0x8cf5('0x4b')]=_['keys'](_0x22d911['query']);_0x5b420f[_0x8cf5('0x4c')]=_['intersection'](_0x5b420f['model'],_0x5b420f[_0x8cf5('0x4b')]);_0x24f2c8[_0x8cf5('0x4d')]=_[_0x8cf5('0x4e')](_0x5b420f[_0x8cf5('0x4f')],qs['fields'](_0x22d911[_0x8cf5('0x4b')][_0x8cf5('0x50')]));_0x24f2c8[_0x8cf5('0x4d')]=_0x24f2c8[_0x8cf5('0x4d')][_0x8cf5('0x51')]?_0x24f2c8[_0x8cf5('0x4d')]:_0x5b420f[_0x8cf5('0x4f')];if(!_0x22d911[_0x8cf5('0x4b')]['hasOwnProperty'](_0x8cf5('0x52'))){_0x24f2c8[_0x8cf5('0x35')]=qs[_0x8cf5('0x35')](_0x22d911['query'][_0x8cf5('0x35')]);_0x24f2c8[_0x8cf5('0x34')]=qs[_0x8cf5('0x34')](_0x22d911[_0x8cf5('0x4b')][_0x8cf5('0x34')]);}_0x24f2c8[_0x8cf5('0x53')]=qs['sort'](_0x22d911[_0x8cf5('0x4b')][_0x8cf5('0x54')]);_0x24f2c8['where']=qs[_0x8cf5('0x4c')](_['pick'](_0x22d911[_0x8cf5('0x4b')],_0x5b420f[_0x8cf5('0x4c')]),_0x205703);if(_0x22d911[_0x8cf5('0x4b')][_0x8cf5('0x55')]){_0x24f2c8[_0x8cf5('0x56')]=_[_0x8cf5('0x57')](_0x24f2c8[_0x8cf5('0x56')],{'$or':_[_0x8cf5('0x45')](_0x205703,function(_0x1a3c4a){if(_0x1a3c4a[_0x8cf5('0x49')]!==_0x8cf5('0x58')){var _0x5063fd={};_0x5063fd[_0x1a3c4a['name']]={'$like':'%'+_0x22d911[_0x8cf5('0x4b')][_0x8cf5('0x55')]+'%'};return _0x5063fd;}})});}_0x24f2c8=_[_0x8cf5('0x57')]({},_0x24f2c8,_0x22d911[_0x8cf5('0x59')]);var _0x1286d0={'where':_0x24f2c8[_0x8cf5('0x56')]};return db[_0x8cf5('0x46')][_0x8cf5('0x33')](_0x1286d0)[_0x8cf5('0x25')](function(_0x10d15b){_0x54ae32['count']=_0x10d15b;if(_0x22d911[_0x8cf5('0x4b')][_0x8cf5('0x5a')]){_0x24f2c8[_0x8cf5('0x5b')]=[{'all':!![]}];}return db[_0x8cf5('0x46')][_0x8cf5('0x5c')](_0x24f2c8);})[_0x8cf5('0x25')](function(_0x5c0082){_0x54ae32[_0x8cf5('0x5d')]=_0x5c0082;return _0x54ae32;})[_0x8cf5('0x25')](respondWithFilteredResult(_0x4c6424,_0x24f2c8))['catch'](handleError(_0x4c6424,null));};exports[_0x8cf5('0x5e')]=function(_0x153c97,_0x478811){var _0x3f2563={'raw':![],'where':{'id':_0x153c97[_0x8cf5('0x5f')]['id']},'include':[{'model':db[_0x8cf5('0x60')],'as':_0x8cf5('0x44')}]},_0x381281={};_0x381281[_0x8cf5('0x4f')]=_[_0x8cf5('0x61')](db['ChatWebsite'][_0x8cf5('0x47')]);_0x381281['query']=_[_0x8cf5('0x61')](_0x153c97['query']);_0x381281[_0x8cf5('0x4c')]=_['intersection'](_0x381281[_0x8cf5('0x4f')],_0x381281[_0x8cf5('0x4b')]);_0x3f2563[_0x8cf5('0x4d')]=_[_0x8cf5('0x4e')](_0x381281['model'],qs[_0x8cf5('0x50')](_0x153c97[_0x8cf5('0x4b')]['fields']));_0x3f2563[_0x8cf5('0x4d')]=_0x3f2563[_0x8cf5('0x4d')][_0x8cf5('0x51')]?_0x3f2563['attributes']:_0x381281[_0x8cf5('0x4f')];if(_0x153c97[_0x8cf5('0x4b')][_0x8cf5('0x5a')]){_0x3f2563[_0x8cf5('0x5b')]=[{'all':!![]}];}_0x3f2563=_['merge']({},_0x3f2563,_0x153c97[_0x8cf5('0x59')]);return db['ChatWebsite'][_0x8cf5('0x62')](_0x3f2563)[_0x8cf5('0x25')](handleEntityNotFound(_0x478811,null))[_0x8cf5('0x25')](respondWithResult(_0x478811,null))[_0x8cf5('0x2f')](handleError(_0x478811,null));};exports[_0x8cf5('0x63')]=function(_0x3f31ee,_0x53ae83){return db[_0x8cf5('0x46')][_0x8cf5('0x63')](_0x3f31ee['body'],{})[_0x8cf5('0x25')](function(_0x42fa61){var _0x5a4a94=_0x3f31ee['user'][_0x8cf5('0x3c')]({'plain':!![]});if(!_0x5a4a94)throw new Error(_0x8cf5('0x64'));if(_0x5a4a94[_0x8cf5('0x65')]===_0x8cf5('0x66')){var _0x25720c=_0x42fa61[_0x8cf5('0x3c')]({'plain':!![]});var _0x1dc814='ChatWebsites';return db[_0x8cf5('0x67')][_0x8cf5('0x62')]({'where':{'name':_0x1dc814,'userProfileId':_0x5a4a94[_0x8cf5('0x68')]},'raw':!![]})[_0x8cf5('0x25')](function(_0x2e5b05){if(_0x2e5b05&&_0x2e5b05[_0x8cf5('0x69')]===0x0){return db[_0x8cf5('0x3e')][_0x8cf5('0x63')]({'name':_0x25720c['name'],'resourceId':_0x25720c['id'],'type':_0x2e5b05[_0x8cf5('0x41')],'sectionId':_0x2e5b05['id']},{})[_0x8cf5('0x25')](function(){return _0x42fa61;});}else{return _0x42fa61;}})[_0x8cf5('0x2f')](function(_0x5a678a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a678a);throw _0x5a678a;});}return _0x42fa61;})[_0x8cf5('0x25')](respondWithResult(_0x53ae83,0xc9))[_0x8cf5('0x2f')](handleError(_0x53ae83,null));};exports[_0x8cf5('0x3a')]=function(_0x30e685,_0x23c896){if(_0x30e685[_0x8cf5('0x6a')]['id']){delete _0x30e685[_0x8cf5('0x6a')]['id'];}return db[_0x8cf5('0x46')]['find']({'where':{'id':_0x30e685[_0x8cf5('0x5f')]['id']},'include':[{'model':db[_0x8cf5('0x60')],'as':_0x8cf5('0x44')}]})['then'](handleEntityNotFound(_0x23c896,null))[_0x8cf5('0x25')](saveUpdates(_0x30e685['body'],null))[_0x8cf5('0x25')](respondWithResult(_0x23c896,null))[_0x8cf5('0x2f')](handleError(_0x23c896,null));};exports[_0x8cf5('0x3b')]=function(_0x1b399f,_0x8f084c){return db[_0x8cf5('0x46')][_0x8cf5('0x62')]({'where':{'id':_0x1b399f[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x8f084c,null))[_0x8cf5('0x25')](removeEntity(_0x8f084c,null))[_0x8cf5('0x2f')](handleError(_0x8f084c,null));};exports[_0x8cf5('0x6b')]=function(_0x4b71b8,_0x23a33d){return db[_0x8cf5('0x46')][_0x8cf5('0x6b')]()[_0x8cf5('0x25')](respondWithResult(_0x23a33d,null))[_0x8cf5('0x2f')](handleError(_0x23a33d,null));};exports['addDisposition']=function(_0x171de2,_0x18620e,_0x55fca5){if(_0x171de2[_0x8cf5('0x6a')]['id']){delete _0x171de2['body']['id'];}return db['ChatWebsite'][_0x8cf5('0x62')]({'where':{'id':_0x171de2['params']['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x18620e,null))['then'](function(_0x4604a5){if(_0x4604a5){_0x171de2[_0x8cf5('0x6a')]['ChatWebsiteId']=_0x4604a5['id'];return db[_0x8cf5('0x6c')]['create'](_0x171de2['body']);}})[_0x8cf5('0x25')](respondWithResult(_0x18620e,null))[_0x8cf5('0x2f')](handleError(_0x18620e,null));};exports['getDispositions']=function(_0x1c81a1,_0x48b571,_0x2fa555){var _0x11802b={'raw':![],'where':{}};var _0x567285={};var _0x30f38f={'count':0x0,'rows':[]};return db[_0x8cf5('0x46')][_0x8cf5('0x6d')]({'where':{'id':_0x1c81a1[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x48b571,null))[_0x8cf5('0x25')](function(_0x3c13d5){if(_0x3c13d5){_0x567285['model']=_[_0x8cf5('0x61')](db[_0x8cf5('0x6c')]['rawAttributes']);_0x567285['query']=_['keys'](_0x1c81a1['query']);_0x567285[_0x8cf5('0x4c')]=_[_0x8cf5('0x4e')](_0x567285[_0x8cf5('0x4f')],_0x567285[_0x8cf5('0x4b')]);_0x11802b[_0x8cf5('0x4d')]=_[_0x8cf5('0x4e')](_0x567285['model'],qs['fields'](_0x1c81a1[_0x8cf5('0x4b')][_0x8cf5('0x50')]));_0x11802b[_0x8cf5('0x4d')]=_0x11802b[_0x8cf5('0x4d')][_0x8cf5('0x51')]?_0x11802b[_0x8cf5('0x4d')]:_0x567285[_0x8cf5('0x4f')];if(!_0x1c81a1[_0x8cf5('0x4b')][_0x8cf5('0x6e')]('nolimit')){_0x11802b['limit']=qs[_0x8cf5('0x35')](_0x1c81a1['query']['limit']);_0x11802b[_0x8cf5('0x34')]=qs[_0x8cf5('0x34')](_0x1c81a1['query']['offset']);}_0x11802b[_0x8cf5('0x53')]=qs['sort'](_0x1c81a1[_0x8cf5('0x4b')][_0x8cf5('0x54')]);_0x11802b[_0x8cf5('0x56')]=qs[_0x8cf5('0x4c')](_[_0x8cf5('0x6f')](_0x1c81a1['query'],_0x567285[_0x8cf5('0x4c')]));_0x11802b[_0x8cf5('0x56')]['ChatWebsiteId']=_0x3c13d5['id'];if(_0x1c81a1[_0x8cf5('0x4b')]['filter']){_0x11802b[_0x8cf5('0x56')]=_[_0x8cf5('0x57')](_0x11802b[_0x8cf5('0x56')],{'$or':_['map'](_0x11802b[_0x8cf5('0x4d')],function(_0x552baf){var _0xdb5f60={};_0xdb5f60[_0x552baf]={'$like':'%'+_0x1c81a1[_0x8cf5('0x4b')][_0x8cf5('0x55')]+'%'};return _0xdb5f60;})});}_0x11802b=_[_0x8cf5('0x57')]({},_0x11802b,_0x1c81a1['options']);return db[_0x8cf5('0x6c')][_0x8cf5('0x33')]({'where':_0x11802b[_0x8cf5('0x56')]})['then'](function(_0x3b4c84){_0x30f38f[_0x8cf5('0x33')]=_0x3b4c84;if(_0x1c81a1['query'][_0x8cf5('0x5a')]){_0x11802b['include']=[{'all':!![]}];}return db[_0x8cf5('0x6c')]['findAll'](_0x11802b);})[_0x8cf5('0x25')](function(_0x1aa110){_0x30f38f[_0x8cf5('0x5d')]=_0x1aa110;return _0x30f38f;});}})[_0x8cf5('0x25')](respondWithFilteredResult(_0x48b571,_0x11802b))[_0x8cf5('0x2f')](handleError(_0x48b571,null));};exports[_0x8cf5('0x70')]=function(_0x3ce5e3,_0x54e35a,_0x4c8f95){return db[_0x8cf5('0x46')][_0x8cf5('0x62')]({'where':{'id':_0x3ce5e3[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x54e35a,null))['then'](function(_0x15f0e8){if(_0x15f0e8){return _0x15f0e8[_0x8cf5('0x70')](_0x3ce5e3['query'][_0x8cf5('0x71')]);}})[_0x8cf5('0x25')](respondWithStatusCode(_0x54e35a,null))[_0x8cf5('0x2f')](handleError(_0x54e35a,null));};exports[_0x8cf5('0x72')]=function(_0x2a4f90,_0x25dd75,_0x39af0c){if(_0x2a4f90[_0x8cf5('0x6a')]['id']){delete _0x2a4f90[_0x8cf5('0x6a')]['id'];}return db[_0x8cf5('0x46')]['find']({'where':{'id':_0x2a4f90[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x25dd75,null))[_0x8cf5('0x25')](function(_0x4f1159){if(_0x4f1159){_0x2a4f90[_0x8cf5('0x6a')][_0x8cf5('0x73')]=_0x4f1159['id'];return db[_0x8cf5('0x74')][_0x8cf5('0x63')](_0x2a4f90['body']);}})[_0x8cf5('0x25')](respondWithResult(_0x25dd75,null))[_0x8cf5('0x2f')](handleError(_0x25dd75,null));};exports[_0x8cf5('0x75')]=function(_0x50a68e,_0x1185a0,_0x57ffef){var _0x260a3e={'raw':![],'where':{}};var _0x51c611={};var _0x35559f={'count':0x0,'rows':[]};return db[_0x8cf5('0x46')][_0x8cf5('0x6d')]({'where':{'id':_0x50a68e[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x1185a0,null))['then'](function(_0x3f9f81){if(_0x3f9f81){_0x51c611[_0x8cf5('0x4f')]=_['keys'](db[_0x8cf5('0x74')]['rawAttributes']);_0x51c611[_0x8cf5('0x4b')]=_['keys'](_0x50a68e[_0x8cf5('0x4b')]);_0x51c611[_0x8cf5('0x4c')]=_['intersection'](_0x51c611[_0x8cf5('0x4f')],_0x51c611['query']);_0x260a3e['attributes']=_[_0x8cf5('0x4e')](_0x51c611[_0x8cf5('0x4f')],qs[_0x8cf5('0x50')](_0x50a68e[_0x8cf5('0x4b')][_0x8cf5('0x50')]));_0x260a3e['attributes']=_0x260a3e['attributes'][_0x8cf5('0x51')]?_0x260a3e[_0x8cf5('0x4d')]:_0x51c611['model'];if(!_0x50a68e[_0x8cf5('0x4b')][_0x8cf5('0x6e')](_0x8cf5('0x52'))){_0x260a3e[_0x8cf5('0x35')]=qs[_0x8cf5('0x35')](_0x50a68e['query'][_0x8cf5('0x35')]);_0x260a3e[_0x8cf5('0x34')]=qs[_0x8cf5('0x34')](_0x50a68e[_0x8cf5('0x4b')]['offset']);}_0x260a3e[_0x8cf5('0x53')]=qs['sort'](_0x50a68e[_0x8cf5('0x4b')][_0x8cf5('0x54')]);_0x260a3e[_0x8cf5('0x56')]=qs['filters'](_[_0x8cf5('0x6f')](_0x50a68e[_0x8cf5('0x4b')],_0x51c611[_0x8cf5('0x4c')]));_0x260a3e[_0x8cf5('0x56')]['ChatWebsiteId']=_0x3f9f81['id'];if(_0x50a68e['query'][_0x8cf5('0x55')]){_0x260a3e['where']=_[_0x8cf5('0x57')](_0x260a3e[_0x8cf5('0x56')],{'$or':_[_0x8cf5('0x45')](_0x260a3e[_0x8cf5('0x4d')],function(_0x3a71c4){var _0xbedd84={};_0xbedd84[_0x3a71c4]={'$like':'%'+_0x50a68e['query']['filter']+'%'};return _0xbedd84;})});}_0x260a3e=_[_0x8cf5('0x57')]({},_0x260a3e,_0x50a68e['options']);return db[_0x8cf5('0x74')][_0x8cf5('0x33')]({'where':_0x260a3e[_0x8cf5('0x56')]})[_0x8cf5('0x25')](function(_0x3e95ee){_0x35559f['count']=_0x3e95ee;if(_0x50a68e[_0x8cf5('0x4b')][_0x8cf5('0x5a')]){_0x260a3e[_0x8cf5('0x5b')]=[{'all':!![]}];}return db[_0x8cf5('0x74')]['findAll'](_0x260a3e);})[_0x8cf5('0x25')](function(_0x5eff59){_0x35559f[_0x8cf5('0x5d')]=_0x5eff59;return _0x35559f;});}})[_0x8cf5('0x25')](respondWithFilteredResult(_0x1185a0,_0x260a3e))[_0x8cf5('0x2f')](handleError(_0x1185a0,null));};exports[_0x8cf5('0x76')]=function(_0x402aa7,_0x469685,_0x4a0449){return db[_0x8cf5('0x46')][_0x8cf5('0x62')]({'where':{'id':_0x402aa7[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x469685,null))[_0x8cf5('0x25')](function(_0x24ea3a){if(_0x24ea3a){return _0x24ea3a[_0x8cf5('0x76')](_0x402aa7[_0x8cf5('0x4b')]['ids']);}})[_0x8cf5('0x25')](respondWithStatusCode(_0x469685,null))[_0x8cf5('0x2f')](handleError(_0x469685,null));};exports[_0x8cf5('0x77')]=function(_0x1d0f36,_0x1470a0,_0x339594){_0x1d0f36[_0x8cf5('0x6a')]['sitepic']=_0x1d0f36[_0x8cf5('0x78')][_0x8cf5('0x79')];return db['ChatWebsite'][_0x8cf5('0x62')]({'where':{'id':_0x1d0f36[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x1470a0,null))[_0x8cf5('0x25')](saveUpdates(_0x1d0f36['body'],null))[_0x8cf5('0x25')](respondWithResult(_0x1470a0,null))[_0x8cf5('0x2f')](handleError(_0x1470a0,null));};exports[_0x8cf5('0x7a')]=function(_0x427573,_0x59e993,_0x1d1678){_0x427573[_0x8cf5('0x6a')][_0x8cf5('0x7b')]=_0x427573[_0x8cf5('0x78')][_0x8cf5('0x79')];return db[_0x8cf5('0x46')][_0x8cf5('0x62')]({'where':{'id':_0x427573[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x59e993,null))[_0x8cf5('0x25')](saveUpdates(_0x427573[_0x8cf5('0x6a')],null))[_0x8cf5('0x25')](respondWithResult(_0x59e993,null))['catch'](handleError(_0x59e993,null));};exports[_0x8cf5('0x7c')]=function(_0x9aeecf,_0x1810c1,_0x3b1054){_0x9aeecf[_0x8cf5('0x6a')]['customerAvatar']=_0x9aeecf[_0x8cf5('0x78')][_0x8cf5('0x79')];return db[_0x8cf5('0x46')][_0x8cf5('0x62')]({'where':{'id':_0x9aeecf['params']['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x1810c1,null))[_0x8cf5('0x25')](saveUpdates(_0x9aeecf['body'],null))[_0x8cf5('0x25')](respondWithResult(_0x1810c1,null))['catch'](handleError(_0x1810c1,null));};exports[_0x8cf5('0x7d')]=function(_0x4ac89d,_0x26708f,_0x4ffdb2){_0x4ac89d[_0x8cf5('0x6a')][_0x8cf5('0x7e')]=_0x4ac89d[_0x8cf5('0x78')]['filename'];return db[_0x8cf5('0x46')][_0x8cf5('0x62')]({'where':{'id':_0x4ac89d[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x26708f,null))[_0x8cf5('0x25')](saveUpdates(_0x4ac89d['body'],null))[_0x8cf5('0x25')](respondWithResult(_0x26708f,null))['catch'](handleError(_0x26708f,null));};exports[_0x8cf5('0x7f')]=function(_0x3855b6,_0x1dc536,_0x1fbfc9){var _0x43a3c2=path[_0x8cf5('0x80')](config[_0x8cf5('0x81')],'server/files/images/logos/default_logo.svg');var _0x1a7e46={'where':{'id':_0x3855b6[_0x8cf5('0x5f')]['id']},'attributes':['id',_0x8cf5('0x82')],'raw':!![]};var _0x5e38bc=![];return require(_0x8cf5('0x83'))[_0x8cf5('0x84')]()[_0x8cf5('0x25')](function(_0x383a52){if(_0x383a52){_0x5e38bc=_0x383a52[_0x8cf5('0x85')];}})[_0x8cf5('0x25')](function(){return db[_0x8cf5('0x46')][_0x8cf5('0x62')](_0x1a7e46);})[_0x8cf5('0x25')](handleEntityNotFound(_0x1dc536,null))[_0x8cf5('0x25')](function(_0x1d70b3){if(_0x1d70b3){if(!_[_0x8cf5('0x86')](_0x1d70b3['sitepic'])){if(fs[_0x8cf5('0x87')](path['join'](config[_0x8cf5('0x81')],'server/files/images/logos/',_0x1d70b3[_0x8cf5('0x82')]))&&_0x5e38bc){_0x43a3c2=path[_0x8cf5('0x80')](config[_0x8cf5('0x81')],'server/files/images/logos/',_0x1d70b3[_0x8cf5('0x82')]);}}return _0x1dc536[_0x8cf5('0x88')](_0x43a3c2);}})[_0x8cf5('0x2f')](handleError(_0x1dc536,null));};exports[_0x8cf5('0x89')]=function(_0x18111c,_0x1da93d,_0x2f5b5b){var _0x9dae69=path['join'](config[_0x8cf5('0x81')],_0x8cf5('0x8a'));var _0x5d04e3={'where':{'id':_0x18111c[_0x8cf5('0x5f')]['id']},'attributes':['id',_0x8cf5('0x7b')],'raw':!![]};return db[_0x8cf5('0x46')][_0x8cf5('0x62')](_0x5d04e3)['then'](handleEntityNotFound(_0x1da93d,null))[_0x8cf5('0x25')](function(_0x264c63){if(_0x264c63){if(!_[_0x8cf5('0x86')](_0x264c63[_0x8cf5('0x7b')])){if(fs[_0x8cf5('0x87')](path[_0x8cf5('0x80')](config[_0x8cf5('0x81')],'server/files/images/avatars/',_0x264c63[_0x8cf5('0x7b')]))){_0x9dae69=path[_0x8cf5('0x80')](config[_0x8cf5('0x81')],_0x8cf5('0x8b'),_0x264c63[_0x8cf5('0x7b')]);}}return _0x1da93d[_0x8cf5('0x88')](_0x9dae69);}})[_0x8cf5('0x2f')](handleError(_0x1da93d,null));};exports['getCustomerAvatar']=function(_0x25f960,_0x5dcdfe,_0xd845dd){var _0x5bcf0b=path[_0x8cf5('0x80')](config['root'],_0x8cf5('0x8c'));var _0x30bb05={'where':{'id':_0x25f960[_0x8cf5('0x5f')]['id']},'attributes':['id',_0x8cf5('0x8d'),_0x8cf5('0x8e')],'raw':!![]};return db[_0x8cf5('0x46')]['find'](_0x30bb05)[_0x8cf5('0x25')](handleEntityNotFound(_0x5dcdfe,null))[_0x8cf5('0x25')](function(_0xf54c59){if(_0xf54c59){if(!_[_0x8cf5('0x86')](_0xf54c59[_0x8cf5('0x8d')])){if(fs[_0x8cf5('0x87')](path[_0x8cf5('0x80')](config[_0x8cf5('0x81')],_0x8cf5('0x8b'),_0xf54c59[_0x8cf5('0x8d')]))&&_0xf54c59['showCustomerAvatar']){_0x5bcf0b=path[_0x8cf5('0x80')](config[_0x8cf5('0x81')],_0x8cf5('0x8b'),_0xf54c59['customerAvatar']);}}return _0x5dcdfe['download'](_0x5bcf0b);}})[_0x8cf5('0x2f')](handleError(_0x5dcdfe,null));};exports[_0x8cf5('0x8f')]=function(_0x5bc95d,_0xbd3287,_0x8095c8){var _0x521b72=path[_0x8cf5('0x80')](config[_0x8cf5('0x81')],_0x8cf5('0x90'));var _0x49e287={'where':{'id':_0x5bc95d[_0x8cf5('0x5f')]['id']},'attributes':['id',_0x8cf5('0x7e')],'raw':!![]};return db['ChatWebsite'][_0x8cf5('0x62')](_0x49e287)[_0x8cf5('0x25')](handleEntityNotFound(_0xbd3287,null))[_0x8cf5('0x25')](function(_0x369048){if(_0x369048){if(!_['isNil'](_0x369048['systemAvatar'])){if(fs['existsSync'](path[_0x8cf5('0x80')](config[_0x8cf5('0x81')],_0x8cf5('0x8b'),_0x369048[_0x8cf5('0x7e')]))){_0x521b72=path[_0x8cf5('0x80')](config[_0x8cf5('0x81')],'server/files/images/avatars/',_0x369048[_0x8cf5('0x7e')]);}}return _0xbd3287[_0x8cf5('0x88')](_0x521b72);}})[_0x8cf5('0x2f')](handleError(_0xbd3287,null));};exports[_0x8cf5('0x91')]=function(_0x43744f,_0x234b52,_0x60a6fc){var _0x461eb7=require('user-agent-parser');var _0x191ca9=new _0x461eb7();var _0x396d10=_0x191ca9[_0x8cf5('0x92')](_0x43744f[_0x8cf5('0x93')][_0x8cf5('0x94')])[_0x8cf5('0x95')]();var _0x9cf671={'body':_0x43744f[_0x8cf5('0x6a')],'channel':_0x8cf5('0x96')};var _0x1aa7ad=[];var _0x2d68eb=[];var _0x6b6c2d={};var _0x8e7dc9=![];return db[_0x8cf5('0x97')][_0x8cf5('0x6b')]()[_0x8cf5('0x25')](function(_0xad673){if(!_0xad673){throw new db[(_0x8cf5('0x22'))][(_0x8cf5('0x98'))](_0x8cf5('0x99'));}_0x1aa7ad=_[_0x8cf5('0x9a')](_['keys'](_0xad673),[_0x8cf5('0x9b'),_0x8cf5('0x9c')]);_0x2d68eb=_['difference'](_[_0x8cf5('0x61')](_0xad673),[_0x8cf5('0x9b'),_0x8cf5('0x9c'),'CompanyId','ListId']);if(_0x43744f['body']['id']){delete _0x43744f['body']['id'];}if(_[_0x8cf5('0x86')](_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0x9d')])){throw new db[(_0x8cf5('0x22'))]['ValidationError'](_0x8cf5('0x9e'));}if(_[_0x8cf5('0x86')](_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0x6a')])||_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0x6a')]===''){throw new db[(_0x8cf5('0x22'))]['ValidationError'](_0x8cf5('0x9f'));}if(_[_0x8cf5('0x86')](_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0xa0')])){throw new db[(_0x8cf5('0x22'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2d68eb);}if(!_['includes'](_0x2d68eb,_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0xa0')])){throw new db['Sequelize'][(_0x8cf5('0x98'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2d68eb);}_0x6b6c2d[_0x43744f[_0x8cf5('0x6a')]['mapKey']]=_0x43744f[_0x8cf5('0x6a')]['from'];})[_0x8cf5('0x25')](function(){return db[_0x8cf5('0x46')][_0x8cf5('0x62')]({'where':{'id':_0x43744f[_0x8cf5('0x5f')]['id']},'include':[{'model':db[_0x8cf5('0xa1')],'as':_0x8cf5('0xa2'),'include':[{'model':db['CmContact'],'as':_0x8cf5('0xa3'),'where':_0x6b6c2d,'limit':0x1,'order':[[_0x8cf5('0x9c'),_0x8cf5('0xa4')]]}]},{'model':db[_0x8cf5('0xa5')],'as':_0x8cf5('0xa6')}]});})[_0x8cf5('0x25')](handleEntityNotFound(_0x234b52,null))[_0x8cf5('0x25')](function(_0x4481d4){if(_0x4481d4&&_0x4481d4[_0x8cf5('0xa2')]){_0x9cf671[_0x8cf5('0xa7')]=_0x4481d4;_0x9cf671[_0x8cf5('0xa8')]=_0x4481d4[_0x8cf5('0xa6')];_0x9cf671[_0x8cf5('0xa9')]=_0x4481d4['List'];_0x9cf671['applications']=_[_0x8cf5('0xaa')](_0x9cf671[_0x8cf5('0xa8')],[_0x8cf5('0xab')],[_0x8cf5('0xac')]);if(_0x9cf671[_0x8cf5('0xa7')][_0x8cf5('0xa6')]){delete _0x9cf671[_0x8cf5('0xa7')]['Applications'];}if(_0x9cf671[_0x8cf5('0xa7')][_0x8cf5('0xa2')]&&_0x9cf671[_0x8cf5('0xa7')][_0x8cf5('0xa2')][_0x8cf5('0xa3')][_0x8cf5('0x51')]){return _0x9cf671[_0x8cf5('0xa7')][_0x8cf5('0xa2')][_0x8cf5('0xa3')][0x0];}var _0x26622b=_[_0x8cf5('0x19')](_0x43744f[_0x8cf5('0x6a')],{'firstName':_0x43744f['body'][_0x8cf5('0x9d')],'ListId':_0x4481d4[_0x8cf5('0xad')]});_0x26622b[_0x43744f[_0x8cf5('0x6a')]['mapKey']]=_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0x9d')];return db[_0x8cf5('0x97')][_0x8cf5('0x63')](_0x26622b,{'fields':_0x1aa7ad,'raw':!![]});}})['then'](handleEntityNotFound(_0x234b52,null))[_0x8cf5('0x25')](function(_0x435140){_0x9cf671[_0x8cf5('0xae')]=_0x435140;var _0x3d8114=_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0xaf')];if(_0x43744f[_0x8cf5('0x93')]['cf-connecting-ip']){_0x3d8114=_0x43744f[_0x8cf5('0x93')]['cf-connecting-ip'];}else if(_0x43744f[_0x8cf5('0x93')]['x-forwarded-for']){_0x3d8114=_[_0x8cf5('0xb0')](_0x43744f[_0x8cf5('0x93')][_0x8cf5('0xb1')]['split'](','));}if(_0x435140){var _0xab6a80={'ContactId':_0x435140['id'],'ChatWebsiteId':_0x43744f[_0x8cf5('0x5f')]['id'],'from':(_0x435140['firstName']||'')+'\x20'+(_0x435140[_0x8cf5('0xb2')]||''),'customerIp':_0x3d8114,'customerPort':_0x43744f[_0x8cf5('0x93')]['x-real-port']?_0x43744f['headers'][_0x8cf5('0xb3')]:null,'referer':_0x43744f['body'][_0x8cf5('0xb4')],'browserName':_0x396d10[_0x8cf5('0xb5')][_0x8cf5('0x41')]&&_0x396d10['browser'][_0x8cf5('0xb6')]?util['format']('%s\x20%s',_0x396d10['browser'][_0x8cf5('0x41')],_0x396d10[_0x8cf5('0xb5')][_0x8cf5('0xb6')]):'unknown','browserVersion':_0x396d10[_0x8cf5('0xb5')]['version']||_0x8cf5('0xb7'),'osName':util[_0x8cf5('0xb8')](_0x8cf5('0xb9'),_0x396d10['os'][_0x8cf5('0x41')],_0x396d10['os'][_0x8cf5('0xb6')]),'osVersion':_0x396d10['os'][_0x8cf5('0xb6')],'deviceModel':_0x396d10[_0x8cf5('0xba')][_0x8cf5('0x4f')]&&_0x396d10[_0x8cf5('0xba')][_0x8cf5('0xbb')]?util[_0x8cf5('0xb8')]('%s\x20%s\x20%s',_0x396d10[_0x8cf5('0xba')][_0x8cf5('0x4f')],_0x396d10[_0x8cf5('0xba')]['vendor'],_0x396d10[_0x8cf5('0xba')][_0x8cf5('0x49')]):null,'deviceVendor':_0x396d10[_0x8cf5('0xba')]['vendor'],'deviceType':_0x396d10['device'][_0x8cf5('0x49')],'formData':JSON[_0x8cf5('0x2a')](_0x43744f['body'])};var _0x52ed85={'ChatWebsiteId':_0x43744f[_0x8cf5('0x5f')]['id'],'closed':![]};if(_0x43744f['body'][_0x8cf5('0xbc')]){_0x52ed85[_0x8cf5('0xbc')]=_0x43744f[_0x8cf5('0x6a')]['threadId'];return db[_0x8cf5('0xbd')]['find']({'where':_0x52ed85})[_0x8cf5('0x25')](function(_0x2a16f0){if(_0x2a16f0){return[_0x2a16f0,![]];}_0xab6a80[_0x8cf5('0xbc')]=_0x43744f[_0x8cf5('0x6a')]['threadId'];_0xab6a80['externalUrl']=_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0xbe')];return db['ChatInteraction'][_0x8cf5('0x63')](_0xab6a80)[_0x8cf5('0x25')](function(_0x55bf0f){return[_0x55bf0f,!![]];});});}_0x52ed85[_0x8cf5('0xbf')]=_0x435140['id'];if(_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0xc0')]&&_0x43744f['body'][_0x8cf5('0xc0')]['id']){_0x52ed85['id']=_0x43744f['body']['interaction']['id'];return db[_0x8cf5('0xbd')][_0x8cf5('0x62')]({'where':_0x52ed85})['then'](function(_0x33fdf9){if(_0x33fdf9){return[_0x33fdf9,![]];}return db['ChatInteraction'][_0x8cf5('0x63')](_0xab6a80)['then'](function(_0x3ba868){return[_0x3ba868,!![]];});});}return db[_0x8cf5('0xbd')][_0x8cf5('0x63')](_0xab6a80)[_0x8cf5('0x25')](function(_0x65430c){return[_0x65430c,!![]];});}})['spread'](function(_0x953348,_0x39ef15){if(_0x953348){_0x8e7dc9=_0x39ef15;if(!_0x39ef15){var _0x59150e={'from':(_0x9cf671[_0x8cf5('0xae')][_0x8cf5('0xc1')]||'')+'\x20'+(_0x9cf671[_0x8cf5('0xae')][_0x8cf5('0xb2')]||'')};if(_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0xbc')]&&_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0xc2')]&&_0x43744f['body'][_0x8cf5('0xbc')]!=_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0xc2')]){_0x59150e['threadId']=_0x43744f['body']['messageId'];}return _0x953348[_0x8cf5('0x3a')](_0x59150e);}else{return _0x953348;}}})[_0x8cf5('0x25')](function(_0x28daf1){_0x9cf671[_0x8cf5('0xc0')]=_0x28daf1[_0x8cf5('0x3c')]({'plain':!![]});_0x9cf671['interaction'][_0x8cf5('0xc3')]=_0x8e7dc9;if(_0x9cf671['interaction']['created']){if(_0x9cf671[_0x8cf5('0xa7')][_0x8cf5('0xc4')]){_0x9cf671['applications']['push']({'id':0x0,'priority':_0x9cf671[_0x8cf5('0xa8')][_0x8cf5('0x51')]+0x1,'app':'close','appdata':_0x8cf5('0xc5'),'interval':_0x8cf5('0xc6')});}}return db['ChatMessage'][_0x8cf5('0x63')]({'body':_0x43744f['body'][_0x8cf5('0x6a')],'ChatWebsiteId':_0x43744f[_0x8cf5('0x5f')]['id'],'ChatInteractionId':_0x28daf1['id'],'direction':'in','ContactId':_0x9cf671['contact']['id'],'AttachmentId':_0x43744f[_0x8cf5('0x6a')][_0x8cf5('0xc7')]});})[_0x8cf5('0x25')](function(_0x19fb52){_0x9cf671[_0x8cf5('0x2d')]=_0x19fb52;if(_0x9cf671[_0x8cf5('0xc0')][_0x8cf5('0xc8')]){return db['User'][_0x8cf5('0x62')]({'attributes':['id',_0x8cf5('0x41')],'where':{'id':_0x9cf671[_0x8cf5('0xc0')]['UserId']}})[_0x8cf5('0x25')](function(_0x464f49){if(_0x464f49){_0x9cf671[_0x8cf5('0xa8')][_0x8cf5('0xc9')]({'id':0x0,'priority':0x0,'app':_0x8cf5('0xca'),'appdata':_0x464f49[_0x8cf5('0x41')]+','+(_0x9cf671[_0x8cf5('0xa7')][_0x8cf5('0xcb')]||0xa),'interval':_0x8cf5('0xc6')});_0x9cf671[_0x8cf5('0xcc')]=!![];}return respondWithRpcPromise(_0x8cf5('0xcd'),_0x8cf5('0xce'),_0x9cf671);});}return respondWithRpcPromise(_0x8cf5('0xcd'),_0x8cf5('0xce'),_0x9cf671);})['then'](function(_0x4555e8){respondWithRpcPromise(_0x8cf5('0xcf'),_0x8cf5('0xcf'),{'event':_0x8cf5('0x91'),'message':_0x4555e8},client9002);return _0x4555e8;})[_0x8cf5('0x25')](respondWithResult(_0x234b52,null))[_0x8cf5('0x2f')](handleError(_0x234b52,null));};exports[_0x8cf5('0xd0')]=function(_0x12daba,_0x4e7131,_0x29d51a){var _0x42a4d1,_0x38bd79,_0x4868a4;var _0x454d2d=[];var _0x192e9a=[];var _0x1a6ba8={};return db['CmContact']['describe']()[_0x8cf5('0x25')](function(_0x2c2c9e){if(!_0x2c2c9e){throw new db['Sequelize'][(_0x8cf5('0x98'))](_0x8cf5('0x99'));}_0x192e9a=_[_0x8cf5('0x9a')](_[_0x8cf5('0x61')](_0x2c2c9e),[_0x8cf5('0x9b'),'updatedAt']);_0x454d2d=_[_0x8cf5('0x9a')](_[_0x8cf5('0x61')](_0x2c2c9e),[_0x8cf5('0x9b'),'updatedAt',_0x8cf5('0xd1'),_0x8cf5('0xad')]);if(_0x12daba[_0x8cf5('0x6a')]['id']){delete _0x12daba[_0x8cf5('0x6a')]['id'];}if(_[_0x8cf5('0x86')](_0x12daba[_0x8cf5('0x6a')][_0x8cf5('0x9d')])){throw _0x4e7131[_0x8cf5('0x30')](0x1f4)[_0x8cf5('0x42')](new db[(_0x8cf5('0x22'))]['ValidationError'](_0x8cf5('0x9e')));}if(_['isNil'](_0x12daba[_0x8cf5('0x6a')]['body'])||_0x12daba[_0x8cf5('0x6a')][_0x8cf5('0x6a')]===''){throw _0x4e7131[_0x8cf5('0x30')](0x1f4)[_0x8cf5('0x42')](new db['Sequelize'][(_0x8cf5('0x98'))](_0x8cf5('0x9f')));}if(_[_0x8cf5('0x86')](_0x12daba[_0x8cf5('0x6a')][_0x8cf5('0xd2')])){throw _0x4e7131[_0x8cf5('0x30')](0x1f4)[_0x8cf5('0x42')](new db['Sequelize']['ValidationError'](_0x8cf5('0xd3')+_0x454d2d));}if(!_[_0x8cf5('0xd4')](_0x454d2d,_0x12daba[_0x8cf5('0x6a')]['mapKeyOffline'])){throw _0x4e7131['status'](0x1f4)[_0x8cf5('0x42')](new db[(_0x8cf5('0x22'))][(_0x8cf5('0x98'))](_0x8cf5('0xd5')+_0x454d2d));}_0x1a6ba8[_0x12daba['body'][_0x8cf5('0xd2')]]=_0x12daba[_0x8cf5('0x6a')][_0x8cf5('0x9d')];})[_0x8cf5('0x25')](function(){return db[_0x8cf5('0x46')][_0x8cf5('0x62')]({'where':{'id':_0x12daba[_0x8cf5('0x5f')]['id']},'include':[{'model':db['CmList'],'as':_0x8cf5('0xa2')}]});})[_0x8cf5('0x25')](handleEntityNotFound(_0x4e7131,null))['then'](function(_0x50e9a8){if(_0x50e9a8&&_0x50e9a8[_0x8cf5('0xa2')]){_0x38bd79=_0x50e9a8;var _0x4e1d28=_[_0x8cf5('0x19')](_0x12daba[_0x8cf5('0x6a')],{'firstName':_0x12daba[_0x8cf5('0x6a')][_0x8cf5('0x9d')],'phone':_0x12daba[_0x8cf5('0x6a')][_0x8cf5('0x9d')],'ListId':_0x50e9a8[_0x8cf5('0xad')]});_0x4e1d28[_0x12daba[_0x8cf5('0x6a')][_0x8cf5('0xd2')]]=_0x12daba[_0x8cf5('0x6a')]['from'];return db[_0x8cf5('0x97')][_0x8cf5('0xd6')]({'where':_0x1a6ba8,'defaults':_0x4e1d28});}})[_0x8cf5('0xd7')](function(_0x931b32){if(_0x931b32){_0x4868a4=_0x931b32;var _0x43bd19=fs['readFileSync'](path[_0x8cf5('0x80')](config['root'],_0x8cf5('0xd8')),_0x8cf5('0xd9'));var _0x154ee7=ejs[_0x8cf5('0xda')](_0x43bd19,{'body':_[_0x8cf5('0xdb')](_0x12daba[_0x8cf5('0x6a')]['body']),'bodyTitle':_0x38bd79[_0x8cf5('0xdc')]});return db['ChatOfflineMessage'][_0x8cf5('0x63')]({'body':_0x154ee7,'ContactId':_0x931b32['id'],'ChatWebsiteId':_0x38bd79['id']});}})['then'](function(_0x4de23a){if(_0x4de23a){_0x42a4d1=_0x4de23a;return db['MailAccount'][_0x8cf5('0x6d')]({'where':{'service':!![]},'include':[{'model':db[_0x8cf5('0xdd')],'as':'Smtp','raw':!![]}]});}})[_0x8cf5('0x25')](function(_0x4715ae){if(_0x4715ae&&_0x4715ae[_0x8cf5('0xde')]&&_0x38bd79[_0x8cf5('0xdf')]){var _0x2bb73b={'tls':{'rejectUnauthorized':![]}};if(_0x4715ae[_0x8cf5('0xde')]['service']){_0x2bb73b[_0x8cf5('0xe0')]=_0x4715ae[_0x8cf5('0xde')][_0x8cf5('0xe0')];}else{_0x2bb73b[_0x8cf5('0xe1')]=_0x4715ae['Smtp'][_0x8cf5('0xe1')];_0x2bb73b[_0x8cf5('0xe2')]=_0x4715ae[_0x8cf5('0xde')][_0x8cf5('0xe2')];_0x2bb73b[_0x8cf5('0xe3')]=_0x4715ae[_0x8cf5('0xde')][_0x8cf5('0xe3')];}if(_0x4715ae[_0x8cf5('0xde')]['authentication']){_0x2bb73b[_0x8cf5('0xe4')]={'user':_0x4715ae['Smtp'][_0x8cf5('0x66')],'pass':_0x4715ae[_0x8cf5('0xde')][_0x8cf5('0xe5')]};}return respondWithRpcPromise(_0x8cf5('0xe6'),'sendMail',{'account':_0x2bb73b,'message':{'from':util[_0x8cf5('0xb8')](_0x8cf5('0xe7'),_0x4715ae['name'],_0x4715ae[_0x8cf5('0xe8')]||_0x4715ae[_0x8cf5('0xde')][_0x8cf5('0x66')]),'to':_0x38bd79[_0x8cf5('0xdf')],'subject':_0x38bd79[_0x8cf5('0xe9')],'text':_0x42a4d1[_0x8cf5('0x6a')]}},client9003)[_0x8cf5('0x25')](function(){return _0x42a4d1;})[_0x8cf5('0x2f')](function(_0x514a9a){console[_0x8cf5('0x2b')](_0x514a9a);});}})[_0x8cf5('0x25')](function(){if(_0x42a4d1){return _0x42a4d1;}})[_0x8cf5('0x25')](respondWithResult(_0x4e7131,null))[_0x8cf5('0x2f')](handleError(_0x4e7131,null));};exports[_0x8cf5('0xea')]=function(_0x41cc89,_0x10e8f6,_0x5229dc){return db['ChatInteraction']['find']({'where':{'id':_0x41cc89[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x10e8f6,null))[_0x8cf5('0x25')](function(_0x32cf05){if(_0x32cf05){return _0x32cf05[_0x8cf5('0xea')](_0x41cc89['body']['ids'],_[_0x8cf5('0xeb')](_0x41cc89[_0x8cf5('0x6a')],[_0x8cf5('0x71'),'id'])||{});}})[_0x8cf5('0x25')](respondWithResult(_0x10e8f6,null))['catch'](handleError(_0x10e8f6,null));};exports[_0x8cf5('0xec')]=function(_0x1ac8fb,_0x559ea8,_0xe90b0c){var _0x1a9e6d={'raw':![],'where':{}};var _0x30814d={};var _0x172066={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8cf5('0x6d')]({'where':{'id':_0x1ac8fb[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x559ea8,null))[_0x8cf5('0x25')](function(_0x4cdcc8){if(_0x4cdcc8){_0x30814d[_0x8cf5('0x4f')]=_[_0x8cf5('0x61')](db['ChatInteraction']['rawAttributes']);_0x30814d[_0x8cf5('0x4b')]=_[_0x8cf5('0x61')](_0x1ac8fb[_0x8cf5('0x4b')]);_0x30814d[_0x8cf5('0x4c')]=_['intersection'](_0x30814d[_0x8cf5('0x4f')],_0x30814d[_0x8cf5('0x4b')]);_0x1a9e6d[_0x8cf5('0x4d')]=_[_0x8cf5('0x4e')](_0x30814d['model'],qs[_0x8cf5('0x50')](_0x1ac8fb[_0x8cf5('0x4b')][_0x8cf5('0x50')]));_0x1a9e6d[_0x8cf5('0x4d')]=_0x1a9e6d[_0x8cf5('0x4d')]['length']?_0x1a9e6d[_0x8cf5('0x4d')]:_0x30814d[_0x8cf5('0x4f')];if(!_0x1ac8fb['query'][_0x8cf5('0x6e')](_0x8cf5('0x52'))){_0x1a9e6d[_0x8cf5('0x35')]=qs[_0x8cf5('0x35')](_0x1ac8fb[_0x8cf5('0x4b')][_0x8cf5('0x35')]);_0x1a9e6d[_0x8cf5('0x34')]=qs['offset'](_0x1ac8fb['query'][_0x8cf5('0x34')]);}_0x1a9e6d[_0x8cf5('0x53')]=qs[_0x8cf5('0x54')](_0x1ac8fb[_0x8cf5('0x4b')][_0x8cf5('0x54')]);_0x1a9e6d[_0x8cf5('0x56')]=qs[_0x8cf5('0x4c')](_[_0x8cf5('0x6f')](_0x1ac8fb[_0x8cf5('0x4b')],_0x30814d['filters']));_0x1a9e6d[_0x8cf5('0x56')][_0x8cf5('0x73')]=_0x4cdcc8['id'];if(_0x1ac8fb['query'][_0x8cf5('0x55')]){_0x1a9e6d[_0x8cf5('0x56')]=_[_0x8cf5('0x57')](_0x1a9e6d[_0x8cf5('0x56')],{'$or':_['map'](_0x1a9e6d[_0x8cf5('0x4d')],function(_0x57307e){var _0x32e3d2={};_0x32e3d2[_0x57307e]={'$like':'%'+_0x1ac8fb['query'][_0x8cf5('0x55')]+'%'};return _0x32e3d2;})});}_0x1a9e6d=_[_0x8cf5('0x57')]({},_0x1a9e6d,_0x1ac8fb[_0x8cf5('0x59')]);return db[_0x8cf5('0xbd')]['count']({'where':_0x1a9e6d['where']})[_0x8cf5('0x25')](function(_0x382285){_0x172066['count']=_0x382285;if(_0x1ac8fb[_0x8cf5('0x4b')][_0x8cf5('0x5a')]){_0x1a9e6d[_0x8cf5('0x5b')]=[{'model':db[_0x8cf5('0x97')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x8cf5('0x41'),_0x8cf5('0xed'),'internal'],'required':![]},{'model':db[_0x8cf5('0xee')],'as':_0x8cf5('0xef'),'attributes':['id',_0x8cf5('0x41'),_0x8cf5('0xf0')],'where':_0x1ac8fb[_0x8cf5('0x4b')][_0x8cf5('0xf1')]?{'id':_0x1ac8fb[_0x8cf5('0x4b')][_0x8cf5('0xf1')]}:undefined,'required':_0x1ac8fb['query'][_0x8cf5('0xf1')]?!![]:![]}];}return db[_0x8cf5('0xbd')][_0x8cf5('0x5c')](_0x1a9e6d);})[_0x8cf5('0x25')](function(_0x51e323){_0x172066[_0x8cf5('0x5d')]=_0x51e323;return _0x172066;});}})[_0x8cf5('0x25')](respondWithFilteredResult(_0x559ea8,_0x1a9e6d))[_0x8cf5('0x2f')](handleError(_0x559ea8,null));};function iftimePromise(_0xea9e5b,_0x489ef0){return respondWithRpcPromise(_0x8cf5('0xf2'),_0x8cf5('0xf3'),{'command':_0x489ef0['timezone']?util[_0x8cf5('0xb8')]('iftime\x20%s,%s',_0xea9e5b['interval'],_0x489ef0[_0x8cf5('0xf4')]):util[_0x8cf5('0xb8')](_0x8cf5('0xf5'),_0xea9e5b['interval'])},client9002)['then'](function(_0x37dec8){var _0x5a0431=_0x37dec8&&_0x37dec8[_0x8cf5('0xf6')](_0x8cf5('0xf7'))>=0x0?!![]:![];logger[_0x8cf5('0x26')](_0x8cf5('0xf8'),_0x489ef0['id'],_0xea9e5b['id'],_0xea9e5b['interval'],_0x5a0431?_0x8cf5('0xf9'):'OFFLINE',_0x489ef0[_0x8cf5('0xf4')]?_0x489ef0[_0x8cf5('0xf4')]:_0x8cf5('0xfa'));return _0x5a0431;})[_0x8cf5('0x2f')](function(_0x1ea496){logger['error'](_0x8cf5('0xf8'),_0x489ef0['id'],_0xea9e5b['id'],_0xea9e5b[_0x8cf5('0xfb')],util[_0x8cf5('0xfc')](_0x1ea496,{'showHidden':![],'depth':null}),_0x489ef0[_0x8cf5('0xf4')]?_0x489ef0[_0x8cf5('0xf4')]:_0x8cf5('0xfa'));return![];});}exports[_0x8cf5('0xf3')]=function(_0xcc814c,_0x398d8d,_0x4ded7f){var _0x53b024=0x0;var _0x114bbc=0x0;var _0x2d2edc=![];var _0x5cc582;var _0xdc69d0;return db[_0x8cf5('0x46')][_0x8cf5('0x62')]({'where':{'id':_0xcc814c['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x8cf5('0xfd')],'as':_0x8cf5('0xfe'),'attributes':['id',_0x8cf5('0xfb')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x398d8d,null))[_0x8cf5('0x25')](function(_0x5ea248){if(_0x5ea248){_0x5cc582=_0x5ea248;return _0x5ea248[_0x8cf5('0xff')]({'raw':!![]});}})['then'](function(_0x85cf20){if(_0x5cc582){if(_0x85cf20){_0xdc69d0=_0x85cf20;}}return require('../../config/license/util')[_0x8cf5('0x84')]();})['then'](function(_0x572646){if(_0x572646){_0x114bbc=_0x572646[_0x8cf5('0x100')];_0x2d2edc=_0x572646['custom'];}})[_0x8cf5('0x25')](function(){return db[_0x8cf5('0xbd')][_0x8cf5('0x33')]({'where':{'closed':![]}});})[_0x8cf5('0x25')](function(_0xe94b32){_0x53b024=_0xe94b32;if(_0x114bbc&&_0xe94b32>_0x114bbc){return db[_0x8cf5('0x101')][_0x8cf5('0x6d')]({'where':{'id':0x1}})['then'](function(_0x214755){if(_0x214755){_0x214755[_0x8cf5('0x102')](_0x8cf5('0x103'));}});}})[_0x8cf5('0x25')](function(){if(_0x5cc582[_0x8cf5('0xfd')]&&_0x5cc582[_0x8cf5('0xfd')][_0x8cf5('0xfe')]){var _0x1c9f9f=[];for(var _0xb63f98=0x0;_0xb63f98<_0x5cc582[_0x8cf5('0xfd')][_0x8cf5('0xfe')]['length'];_0xb63f98++){var _0x223240=_0x5cc582[_0x8cf5('0xfd')][_0x8cf5('0xfe')][_0xb63f98][_0x8cf5('0x3c')]({'plain':!![]});_0x1c9f9f[_0x8cf5('0x104')](iftimePromise(_0x223240,_0x5cc582));}return BPromise[_0x8cf5('0x105')](_0x1c9f9f)[_0x8cf5('0x25')](function(_0x945161){return _[_0x8cf5('0x106')](_0x945161);});}else{return!![];}})[_0x8cf5('0x25')](function(_0x1a985c){var _0x346b37=fs[_0x8cf5('0x107')](path['join'](config[_0x8cf5('0x81')],_0x8cf5('0x108')),_0x8cf5('0xd9'));var _0x101070={'remote':_0x5cc582[_0x8cf5('0x109')],'query':querystring[_0x8cf5('0x2a')](_['merge'](_0x5cc582[_0x8cf5('0x3c')]({'plain':!![]}),{'customerIp':_0xcc814c[_0x8cf5('0x93')][_0x8cf5('0xb1')]||_0xcc814c[_0x8cf5('0x93')][_0x8cf5('0x10a')]||_0xcc814c[_0x8cf5('0x10b')][_0x8cf5('0x10c')]||_0xcc814c['ip'],'referer':_0xcc814c[_0x8cf5('0x93')][_0x8cf5('0xb4')],'openedInteractions':_0x53b024,'maxInteractions':_0x114bbc,'virtual':_0x2d2edc[_0x8cf5('0x100')],'online':_0x1a985c,'custom':_0x2d2edc}))[_0x8cf5('0x10d')](/'/g,'\x5c\x27')};_0x398d8d[_0x8cf5('0x42')](ejs[_0x8cf5('0xda')](Mustache[_0x8cf5('0xda')](_0x346b37,_0x101070),{'proactiveActions':_0xdc69d0,'alignment':_0x5cc582[_0x8cf5('0x10e')],'verticalAlignment':_0x5cc582[_0x8cf5('0x10f')],'div_color':_0x5cc582[_0x8cf5('0xf0')],'text_color':_0x5cc582['textColor']}));})[_0x8cf5('0x2f')](handleError(_0x398d8d,null));};exports[_0x8cf5('0x110')]=function(_0x9a429,_0x232070,_0x3b3bf1){return db['ChatWebsite']['findOne']({'where':{'id':_0x9a429[_0x8cf5('0x5f')]['id']}})['then'](handleEntityNotFound(_0x232070,null))[_0x8cf5('0x25')](function(_0xf9e21d){if(_0xf9e21d){return db['sequelize']['transaction'](function(_0x8589ef){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x9a429[_0x8cf5('0x5f')]['id']},'transaction':_0x8589ef})[_0x8cf5('0x25')](function(_0x124b1c){var _0x32b349=_[_0x8cf5('0x45')](_0x9a429['body'],function(_0x3fe602){_0x3fe602['ChatWebsiteId']=_0x9a429[_0x8cf5('0x5f')]['id'];return _0x3fe602;});return db['ChatApplication'][_0x8cf5('0x111')](_0x32b349,{'transaction':_0x8589ef});});})[_0x8cf5('0x25')](function(){return db[_0x8cf5('0xa5')][_0x8cf5('0x112')]({'where':{'ChatWebsiteId':_0x9a429[_0x8cf5('0x5f')]['id']},'order':'priority'});});}})[_0x8cf5('0x25')](respondWithResult(_0x232070,null))['catch'](handleError(_0x232070,null));};exports[_0x8cf5('0x113')]=function(_0x2da74e,_0x473573,_0x1a23b0){var _0x3f6838={};var _0x186183={};var _0xe96a2d;var _0x538b9d;return db[_0x8cf5('0x46')][_0x8cf5('0x6d')]({'where':{'id':_0x2da74e[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x473573,null))[_0x8cf5('0x25')](function(_0x2e6718){if(_0x2e6718){_0xe96a2d=_0x2e6718;_0x186183[_0x8cf5('0x4f')]=_[_0x8cf5('0x61')](db[_0x8cf5('0xa5')]['rawAttributes']);_0x186183['query']=_[_0x8cf5('0x61')](_0x2da74e[_0x8cf5('0x4b')]);_0x186183[_0x8cf5('0x4c')]=_['intersection'](_0x186183['model'],_0x186183[_0x8cf5('0x4b')]);_0x3f6838[_0x8cf5('0x4d')]=_[_0x8cf5('0x4e')](_0x186183[_0x8cf5('0x4f')],qs[_0x8cf5('0x50')](_0x2da74e['query']['fields']));_0x3f6838[_0x8cf5('0x4d')]=_0x3f6838[_0x8cf5('0x4d')][_0x8cf5('0x51')]?_0x3f6838[_0x8cf5('0x4d')]:_0x186183[_0x8cf5('0x4f')];_0x3f6838[_0x8cf5('0x53')]=qs[_0x8cf5('0x54')](_0x2da74e['query'][_0x8cf5('0x54')]);_0x3f6838['where']=qs[_0x8cf5('0x4c')](_['pick'](_0x2da74e[_0x8cf5('0x4b')],_0x186183[_0x8cf5('0x4c')]));if(_0x2da74e[_0x8cf5('0x4b')]['filter']){_0x3f6838['where']=_[_0x8cf5('0x57')](_0x3f6838[_0x8cf5('0x56')],{'$or':_['map'](_0x3f6838[_0x8cf5('0x4d')],function(_0x49d293){var _0x5cd121={};_0x5cd121[_0x49d293]={'$like':'%'+_0x2da74e[_0x8cf5('0x4b')]['filter']+'%'};return _0x5cd121;})});}_0x3f6838=_['merge']({},_0x3f6838,_0x2da74e[_0x8cf5('0x59')]);return _0xe96a2d[_0x8cf5('0x113')](_0x3f6838);}})['then'](function(_0x3d82e9){if(_0x3d82e9){_0x538b9d=_0x3d82e9[_0x8cf5('0x51')];if(!_0x2da74e[_0x8cf5('0x4b')][_0x8cf5('0x6e')](_0x8cf5('0x52'))){_0x3f6838['limit']=qs[_0x8cf5('0x35')](_0x2da74e[_0x8cf5('0x4b')][_0x8cf5('0x35')]);_0x3f6838[_0x8cf5('0x34')]=qs[_0x8cf5('0x34')](_0x2da74e[_0x8cf5('0x4b')][_0x8cf5('0x34')]);}return _0xe96a2d['getApplications'](_0x3f6838);}})[_0x8cf5('0x25')](function(_0x5a346b){if(_0x5a346b){return _0x5a346b?{'count':_0x538b9d,'rows':_0x5a346b}:null;}})[_0x8cf5('0x25')](respondWithResult(_0x473573,null))[_0x8cf5('0x2f')](handleError(_0x473573,null));};exports[_0x8cf5('0x114')]=function(_0x4f22c8,_0x5a759c,_0x5c4a1e){return db[_0x8cf5('0x115')]['find']({'where':{'id':_0x4f22c8[_0x8cf5('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5a759c,null))['then'](function(_0x13751a){if(_0x13751a){return _0x13751a[_0x8cf5('0x114')](_0x4f22c8[_0x8cf5('0x6a')][_0x8cf5('0x71')],_[_0x8cf5('0xeb')](_0x4f22c8[_0x8cf5('0x6a')],['ids','id'])||{});}})[_0x8cf5('0x25')](respondWithResult(_0x5a759c,null))[_0x8cf5('0x2f')](handleError(_0x5a759c,null));};exports[_0x8cf5('0xff')]=function(_0x437e24,_0x11cbc4,_0x224dca){var _0x21c9a7={};var _0x378ccb={};var _0x15b497;var _0x1aae34;return db[_0x8cf5('0x46')][_0x8cf5('0x6d')]({'where':{'id':_0x437e24[_0x8cf5('0x5f')]['id']}})['then'](handleEntityNotFound(_0x11cbc4,null))['then'](function(_0x289720){if(_0x289720){_0x15b497=_0x289720;_0x378ccb[_0x8cf5('0x4f')]=_['keys'](db[_0x8cf5('0x116')]['rawAttributes']);_0x378ccb[_0x8cf5('0x4b')]=_[_0x8cf5('0x61')](_0x437e24['query']);_0x378ccb[_0x8cf5('0x4c')]=_[_0x8cf5('0x4e')](_0x378ccb[_0x8cf5('0x4f')],_0x378ccb[_0x8cf5('0x4b')]);_0x21c9a7[_0x8cf5('0x4d')]=_['intersection'](_0x378ccb[_0x8cf5('0x4f')],qs['fields'](_0x437e24['query'][_0x8cf5('0x50')]));_0x21c9a7['attributes']=_0x21c9a7[_0x8cf5('0x4d')][_0x8cf5('0x51')]?_0x21c9a7[_0x8cf5('0x4d')]:_0x378ccb['model'];_0x21c9a7[_0x8cf5('0x53')]=qs[_0x8cf5('0x54')](_0x437e24[_0x8cf5('0x4b')][_0x8cf5('0x54')]);_0x21c9a7[_0x8cf5('0x56')]=qs[_0x8cf5('0x4c')](_[_0x8cf5('0x6f')](_0x437e24[_0x8cf5('0x4b')],_0x378ccb[_0x8cf5('0x4c')]));if(_0x437e24[_0x8cf5('0x4b')][_0x8cf5('0x55')]){_0x21c9a7['where']=_[_0x8cf5('0x57')](_0x21c9a7['where'],{'$or':_[_0x8cf5('0x45')](_0x21c9a7[_0x8cf5('0x4d')],function(_0x272404){var _0x29b6b8={};_0x29b6b8[_0x272404]={'$like':'%'+_0x437e24[_0x8cf5('0x4b')][_0x8cf5('0x55')]+'%'};return _0x29b6b8;})});}_0x21c9a7=_[_0x8cf5('0x57')]({},_0x21c9a7,_0x437e24[_0x8cf5('0x59')]);return _0x15b497['getProactiveActions'](_0x21c9a7);}})[_0x8cf5('0x25')](function(_0x4ac4bd){if(_0x4ac4bd){_0x1aae34=_0x4ac4bd[_0x8cf5('0x51')];if(!_0x437e24[_0x8cf5('0x4b')][_0x8cf5('0x6e')](_0x8cf5('0x52'))){_0x21c9a7[_0x8cf5('0x35')]=qs[_0x8cf5('0x35')](_0x437e24[_0x8cf5('0x4b')][_0x8cf5('0x35')]);_0x21c9a7[_0x8cf5('0x34')]=qs[_0x8cf5('0x34')](_0x437e24['query'][_0x8cf5('0x34')]);}return _0x15b497['getProactiveActions'](_0x21c9a7);}})[_0x8cf5('0x25')](function(_0x210b3d){if(_0x210b3d){return _0x210b3d?{'count':_0x1aae34,'rows':_0x210b3d}:null;}})[_0x8cf5('0x25')](respondWithResult(_0x11cbc4,null))[_0x8cf5('0x2f')](handleError(_0x11cbc4,null));};exports[_0x8cf5('0x117')]=function(_0x51bdb1,_0x20fdfb,_0xa72693){var _0x371a25=_0x51bdb1[_0x8cf5('0x4b')][_0x8cf5('0x118')]===_0x8cf5('0x119')?_0x8cf5('0x11a'):_0x8cf5('0x11b');return db['ChatWebsite'][_0x8cf5('0x62')]({'attributes':['id',_0x371a25],'where':{'id':_0x51bdb1[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x20fdfb,null))[_0x8cf5('0x25')](function(_0x17140f){if(_0x17140f){var _0x29a9e7=_0x17140f[_0x371a25];var _0x1bf4c2=_0x29a9e7&&_0x29a9e7[_0x8cf5('0x11c')]?_0x29a9e7['items']:[];_0x20fdfb[_0x8cf5('0x42')]({'fromKey':_[_0x8cf5('0x86')](_0x29a9e7[_0x8cf5('0x11d')])?undefined:_0x29a9e7[_0x8cf5('0x11d')],'count':_0x1bf4c2[_0x8cf5('0x51')],'rows':_0x1bf4c2});}})[_0x8cf5('0x2f')](handleError(_0x20fdfb,null));};exports[_0x8cf5('0x11e')]=function(_0x4f738c,_0x360b2a,_0xb07cd6){var _0x3e6eb9={'raw':![],'where':{}};var _0x7ba46d={};var _0x1ded78={'count':0x0,'rows':[]};return db[_0x8cf5('0x46')][_0x8cf5('0x6d')]({'where':{'id':_0x4f738c[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x360b2a,null))[_0x8cf5('0x25')](function(_0x1993fd){if(_0x1993fd){_0x7ba46d[_0x8cf5('0x4f')]=_[_0x8cf5('0x61')](db[_0x8cf5('0x11f')]['rawAttributes']);_0x7ba46d['query']=_[_0x8cf5('0x61')](_0x4f738c[_0x8cf5('0x4b')]);_0x7ba46d[_0x8cf5('0x4c')]=_['intersection'](_0x7ba46d[_0x8cf5('0x4f')],_0x7ba46d[_0x8cf5('0x4b')]);_0x3e6eb9[_0x8cf5('0x4d')]=_[_0x8cf5('0x4e')](_0x7ba46d[_0x8cf5('0x4f')],qs[_0x8cf5('0x50')](_0x4f738c[_0x8cf5('0x4b')][_0x8cf5('0x50')]));_0x3e6eb9['attributes']=_0x3e6eb9[_0x8cf5('0x4d')][_0x8cf5('0x51')]?_0x3e6eb9[_0x8cf5('0x4d')]:_0x7ba46d[_0x8cf5('0x4f')];if(!_0x4f738c[_0x8cf5('0x4b')]['hasOwnProperty'](_0x8cf5('0x52'))){_0x3e6eb9[_0x8cf5('0x35')]=qs['limit'](_0x4f738c['query'][_0x8cf5('0x35')]);_0x3e6eb9[_0x8cf5('0x34')]=qs['offset'](_0x4f738c[_0x8cf5('0x4b')][_0x8cf5('0x34')]);}_0x3e6eb9[_0x8cf5('0x53')]=qs[_0x8cf5('0x54')](_0x4f738c[_0x8cf5('0x4b')]['sort']);_0x3e6eb9[_0x8cf5('0x56')]=qs[_0x8cf5('0x4c')](_[_0x8cf5('0x6f')](_0x4f738c['query'],_0x7ba46d[_0x8cf5('0x4c')]));_0x3e6eb9['where']['ChatWebsiteId']=_0x1993fd['id'];if(_0x4f738c['query']['filter']){_0x3e6eb9[_0x8cf5('0x56')]=_[_0x8cf5('0x57')](_0x3e6eb9[_0x8cf5('0x56')],{'$or':_[_0x8cf5('0x45')](_0x3e6eb9[_0x8cf5('0x4d')],function(_0x5ed0e0){var _0x35d892={};_0x35d892[_0x5ed0e0]={'$like':'%'+_0x4f738c[_0x8cf5('0x4b')][_0x8cf5('0x55')]+'%'};return _0x35d892;})});}_0x3e6eb9=_[_0x8cf5('0x57')]({},_0x3e6eb9,_0x4f738c[_0x8cf5('0x59')]);return db[_0x8cf5('0x11f')][_0x8cf5('0x33')]({'where':_0x3e6eb9[_0x8cf5('0x56')]})['then'](function(_0x18dd98){_0x1ded78[_0x8cf5('0x33')]=_0x18dd98;if(_0x4f738c[_0x8cf5('0x4b')][_0x8cf5('0x5a')]){_0x3e6eb9['include']=[{'all':!![]}];}else{_0x3e6eb9[_0x8cf5('0x5b')]=[{'model':db[_0x8cf5('0x97')],'as':_0x8cf5('0x120'),'required':![]}];}return db[_0x8cf5('0x11f')]['findAll'](_0x3e6eb9);})[_0x8cf5('0x25')](function(_0x1d115a){_0x1ded78['rows']=_0x1d115a;return _0x1ded78;});}})['then'](respondWithFilteredResult(_0x360b2a,_0x3e6eb9))['catch'](handleError(_0x360b2a,null));};exports['addAgents']=function(_0x9c4383,_0x32539b,_0x836dd5){return db[_0x8cf5('0x46')]['find']({'where':{'id':_0x9c4383['params']['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x32539b,null))['then'](function(_0x4e0f64){if(_0x4e0f64){return _0x4e0f64[_0x8cf5('0x121')](_0x9c4383['body'][_0x8cf5('0x71')],_[_0x8cf5('0xeb')](_0x9c4383['body'],[_0x8cf5('0x71'),'id'])||{})[_0x8cf5('0xd7')](function(_0x3daefc){for(var _0x12362a=0x0;_0x12362a<_0x9c4383['body'][_0x8cf5('0x71')][_0x8cf5('0x51')];_0x12362a+=0x1){socket[_0x8cf5('0x122')](_0x8cf5('0x123'),{'UserId':_0x9c4383[_0x8cf5('0x6a')][_0x8cf5('0x71')][_0x12362a],'ChatWebsiteId':_0x9c4383[_0x8cf5('0x5f')]['id']});}return _0x3daefc;});}})[_0x8cf5('0x25')](respondWithResult(_0x32539b,null))['catch'](handleError(_0x32539b,null));};exports[_0x8cf5('0x124')]=function(_0x314d92,_0x550fce,_0x3e896b){return db['ChatWebsite'][_0x8cf5('0x62')]({'where':{'id':_0x314d92[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x550fce,null))[_0x8cf5('0x25')](function(_0x2b27db){if(_0x2b27db){return _0x2b27db[_0x8cf5('0x124')](_0x314d92[_0x8cf5('0x4b')][_0x8cf5('0x71')])[_0x8cf5('0x25')](function(){if(_['isArray'](_0x314d92[_0x8cf5('0x4b')]['ids'])){for(var _0x59b24d=0x0;_0x59b24d<_0x314d92['query'][_0x8cf5('0x71')][_0x8cf5('0x51')];_0x59b24d+=0x1){socket['emit'](_0x8cf5('0x125'),{'UserId':Number(_0x314d92['query'][_0x8cf5('0x71')][_0x59b24d]),'ChatWebsiteId':Number(_0x314d92['params']['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x314d92[_0x8cf5('0x4b')]['ids']),'ChatWebsiteId':Number(_0x314d92[_0x8cf5('0x5f')]['id'])});}});}})[_0x8cf5('0x25')](respondWithStatusCode(_0x550fce,null))[_0x8cf5('0x2f')](handleError(_0x550fce,null));};exports[_0x8cf5('0x126')]=function(_0x48eb2e,_0x129b36,_0x11e9e0){var _0x1b0c7c={};var _0xf2d53={};var _0x21cd85;var _0x1deae6;return db[_0x8cf5('0x46')][_0x8cf5('0x6d')]({'where':{'id':_0x48eb2e[_0x8cf5('0x5f')]['id']}})[_0x8cf5('0x25')](handleEntityNotFound(_0x129b36,null))['then'](function(_0xa613b8){if(_0xa613b8){_0x21cd85=_0xa613b8;_0xf2d53['model']=_[_0x8cf5('0x61')](db['User'][_0x8cf5('0x47')]);_0xf2d53[_0x8cf5('0x4b')]=_['keys'](_0x48eb2e[_0x8cf5('0x4b')]);_0xf2d53['filters']=_[_0x8cf5('0x4e')](_0xf2d53['model'],_0xf2d53['query']);_0x1b0c7c['attributes']=_[_0x8cf5('0x4e')](_0xf2d53[_0x8cf5('0x4f')],qs[_0x8cf5('0x50')](_0x48eb2e[_0x8cf5('0x4b')][_0x8cf5('0x50')]));_0x1b0c7c[_0x8cf5('0x4d')]=_0x1b0c7c[_0x8cf5('0x4d')][_0x8cf5('0x51')]?_0x1b0c7c[_0x8cf5('0x4d')]:_0xf2d53[_0x8cf5('0x4f')];_0x1b0c7c[_0x8cf5('0x53')]=qs[_0x8cf5('0x54')](_0x48eb2e[_0x8cf5('0x4b')][_0x8cf5('0x54')]);_0x1b0c7c[_0x8cf5('0x56')]=qs['filters'](_[_0x8cf5('0x6f')](_0x48eb2e[_0x8cf5('0x4b')],_0xf2d53[_0x8cf5('0x4c')]));if(_0x48eb2e[_0x8cf5('0x4b')][_0x8cf5('0x55')]){_0x1b0c7c[_0x8cf5('0x56')]=_['merge'](_0x1b0c7c[_0x8cf5('0x56')],{'$or':_[_0x8cf5('0x45')](_0x1b0c7c['attributes'],function(_0x322418){var _0x415b81={};_0x415b81[_0x322418]={'$like':'%'+_0x48eb2e['query']['filter']+'%'};return _0x415b81;})});}_0x1b0c7c=_['merge']({},_0x1b0c7c,_0x48eb2e[_0x8cf5('0x59')]);return _0x21cd85[_0x8cf5('0x126')](_0x1b0c7c);}})['then'](function(_0x397ecf){if(_0x397ecf){_0x1deae6=_0x397ecf['length'];if(!_0x48eb2e[_0x8cf5('0x4b')][_0x8cf5('0x6e')](_0x8cf5('0x52'))){_0x1b0c7c[_0x8cf5('0x35')]=qs[_0x8cf5('0x35')](_0x48eb2e[_0x8cf5('0x4b')][_0x8cf5('0x35')]);_0x1b0c7c[_0x8cf5('0x34')]=qs[_0x8cf5('0x34')](_0x48eb2e[_0x8cf5('0x4b')][_0x8cf5('0x34')]);}return _0x21cd85['getAgents'](_0x1b0c7c);}})['then'](function(_0x4dbbf3){if(_0x4dbbf3){return _0x4dbbf3?{'count':_0x1deae6,'rows':_0x4dbbf3}:null;}})[_0x8cf5('0x25')](respondWithResult(_0x129b36,null))['catch'](handleError(_0x129b36,null));};
\ No newline at end of file
index 8b1a0c5..ea3f209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86f4=['ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x86f4,0x18a));var _0x486f=function(_0x279bf3,_0x498d42){_0x279bf3=_0x279bf3-0x0;var _0x2d8685=_0x86f4[_0x279bf3];return _0x2d8685;};'use strict';var EventEmitter=require(_0x486f('0x0'));var ChatWebsite=require(_0x486f('0x1'))['db'][_0x486f('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x486f('0x3')](0x0);var events={'afterCreate':_0x486f('0x4'),'afterUpdate':_0x486f('0x5'),'afterDestroy':_0x486f('0x6')};function emitEvent(_0x53305d){return function(_0xf8d50f,_0x1539b1,_0x583729){ChatWebsiteEvents[_0x486f('0x7')](_0x53305d+':'+_0xf8d50f['id'],_0xf8d50f);ChatWebsiteEvents[_0x486f('0x7')](_0x53305d,_0xf8d50f);_0x583729(null);};}for(var e in events){if(events[_0x486f('0x8')](e)){var event=events[e];ChatWebsite[_0x486f('0x9')](e,emitEvent(event));}}module[_0x486f('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xcb99=['ChatWebsite','update','remove','emit','hook','exports','events'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xcb99,0x8b));var _0x9cb9=function(_0x8c6eee,_0x21f601){_0x8c6eee=_0x8c6eee-0x0;var _0x5a03b5=_0xcb99[_0x8c6eee];return _0x5a03b5;};'use strict';var EventEmitter=require(_0x9cb9('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x9cb9('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9cb9('0x2'),'afterDestroy':_0x9cb9('0x3')};function emitEvent(_0x124c48){return function(_0x51f2ee,_0x167735,_0x41788c){ChatWebsiteEvents['emit'](_0x124c48+':'+_0x51f2ee['id'],_0x51f2ee);ChatWebsiteEvents[_0x9cb9('0x4')](_0x124c48,_0x51f2ee);_0x41788c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x9cb9('0x5')](e,emitEvent(event));}}module[_0x9cb9('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
index 41bfc9e..93709ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa44a=['rimraf','exports','define','chat_websites','lodash','api','moment','bluebird','request-promise','path'];(function(_0x5848b7,_0x42f972){var _0x22ab05=function(_0x1f7cb3){while(--_0x1f7cb3){_0x5848b7['push'](_0x5848b7['shift']());}};_0x22ab05(++_0x42f972);}(_0xa44a,0x9a));var _0xaa44=function(_0x149635,_0x5ad796){_0x149635=_0x149635-0x0;var _0x3ec953=_0xa44a[_0x149635];return _0x3ec953;};'use strict';var _=require(_0xaa44('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa44('0x1'));var moment=require(_0xaa44('0x2'));var BPromise=require(_0xaa44('0x3'));var rp=require(_0xaa44('0x4'));var fs=require('fs');var path=require(_0xaa44('0x5'));var rimraf=require(_0xaa44('0x6'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0xaa44('0x7')]=function(_0x39a3f6,_0x4979e3){return _0x39a3f6[_0xaa44('0x8')]('ChatWebsite',attributes,{'tableName':_0xaa44('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x83f1=['./chatWebsite.attributes','exports','define','ChatWebsite','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x83f1,0x1cc));var _0x183f=function(_0xe82e1d,_0x535835){_0xe82e1d=_0xe82e1d-0x0;var _0x34caf0=_0x83f1[_0xe82e1d];return _0x34caf0;};'use strict';var _=require(_0x183f('0x0'));var util=require(_0x183f('0x1'));var logger=require(_0x183f('0x2'))(_0x183f('0x3'));var moment=require(_0x183f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x183f('0x5'));var rimraf=require(_0x183f('0x6'));var config=require(_0x183f('0x7'));var attributes=require(_0x183f('0x8'));module[_0x183f('0x9')]=function(_0x5381b2,_0x5c1cbd){return _0x5381b2[_0x183f('0xa')](_0x183f('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 87d5ed0..a2e6d4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a37=['rpc','jayson/promise','http','redis','defaults','register','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xb9d880,_0x5c83f4){var _0x1a9d6f=function(_0x49cfcf){while(--_0x49cfcf){_0xb9d880['push'](_0xb9d880['shift']());}};_0x1a9d6f(++_0x5c83f4);}(_0x1a37,0xb4));var _0x71a3=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x1a37[_0x543084];return _0x306a57;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});config[_0x71a3('0xc')]=_[_0x71a3('0xd')](config[_0x71a3('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x71a3('0xe')](socket);function respondWithRpcPromise(_0x18320a,_0x3709bc,_0x3aeb48){return new BPromise(function(_0x3a7fc1,_0x2215f2){return client[_0x71a3('0xf')](_0x18320a,_0x3aeb48)[_0x71a3('0x10')](function(_0x5c464c){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x3709bc,_0x71a3('0x11'));logger[_0x71a3('0x12')](_0x71a3('0x13'),_0x3709bc,_0x71a3('0x11'),JSON[_0x71a3('0x14')](_0x5c464c));if(_0x5c464c[_0x71a3('0x15')]){if(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x16')]===0x1f4){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5c464c[_0x71a3('0x15')]['message']);return _0x2215f2(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3709bc,_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);return _0x3a7fc1(_0x5c464c[_0x71a3('0x15')][_0x71a3('0x18')]);}else{logger[_0x71a3('0x19')](_0x71a3('0x17'),_0x3709bc,'request\x20sent');_0x3a7fc1(_0x5c464c[_0x71a3('0x1a')][_0x71a3('0x18')]);}})['catch'](function(_0x5f4562){logger[_0x71a3('0x15')](_0x71a3('0x17'),_0x3709bc,_0x5f4562);_0x2215f2(_0x5f4562);});});}
\ No newline at end of file
+var _0xb016=['../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0x206d06,_0x4962bc){var _0x21505f=function(_0x20bc21){while(--_0x20bc21){_0x206d06['push'](_0x206d06['shift']());}};_0x21505f(++_0x4962bc);}(_0xb016,0x159));var _0x6b01=function(_0x3256cc,_0x26ccbf){_0x3256cc=_0x3256cc-0x0;var _0x2aa1df=_0xb016[_0x3256cc];return _0x2aa1df;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6b01('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b01('0x3'))['db'];var utils=require(_0x6b01('0x4'));var logger=require(_0x6b01('0x5'))(_0x6b01('0x6'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x7'));var client=jayson[_0x6b01('0x8')][_0x6b01('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6b01('0xa')],{'host':_0x6b01('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6b01('0xc'))[_0x6b01('0xd')](socket);function respondWithRpcPromise(_0x2c4e48,_0x242394,_0xab37c){return new BPromise(function(_0x5bed15,_0x4b4a4d){return client[_0x6b01('0xe')](_0x2c4e48,_0xab37c)[_0x6b01('0xf')](function(_0x2660c7){logger['info'](_0x6b01('0x10'),_0x242394,'request\x20sent');logger['debug'](_0x6b01('0x11'),_0x242394,'request\x20sent',JSON[_0x6b01('0x12')](_0x2660c7));if(_0x2660c7[_0x6b01('0x13')]){if(_0x2660c7['error'][_0x6b01('0x14')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x242394,_0x2660c7['error'][_0x6b01('0x15')]);return _0x4b4a4d(_0x2660c7['error']['message']);}logger[_0x6b01('0x13')](_0x6b01('0x10'),_0x242394,_0x2660c7[_0x6b01('0x13')][_0x6b01('0x15')]);return _0x5bed15(_0x2660c7[_0x6b01('0x13')][_0x6b01('0x15')]);}else{logger[_0x6b01('0x16')](_0x6b01('0x10'),_0x242394,_0x6b01('0x17'));_0x5bed15(_0x2660c7[_0x6b01('0x18')][_0x6b01('0x15')]);}})['catch'](function(_0x2c5f29){logger[_0x6b01('0x13')](_0x6b01('0x10'),_0x242394,_0x2c5f29);_0x4b4a4d(_0x2c5f29);});});}
\ No newline at end of file
index 8a00673..5e561f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x595086,_0x41b5da){var _0x143cb5=function(_0x56a6e){while(--_0x56a6e){_0x595086['push'](_0x595086['shift']());}};_0x143cb5(++_0x41b5da);}(_0x7a54,0x106));var _0x47a5=function(_0x58640b,_0x2b1c2b){_0x58640b=_0x58640b-0x0;var _0x2e88ae=_0x7a54[_0x58640b];return _0x2e88ae;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
+var _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x414977,_0x574149){var _0x41758e=function(_0x23ced4){while(--_0x23ced4){_0x414977['push'](_0x414977['shift']());}};_0x41758e(++_0x574149);}(_0x7a54,0x106));var _0x47a5=function(_0x59f8a4,_0x22354b){_0x59f8a4=_0x59f8a4-0x0;var _0x398cc0=_0x7a54[_0x59f8a4];return _0x398cc0;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
index ea42520..0d22a69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x095f=['/:id/proactive_actions','getProactiveActions','getFields','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','join','root','format','%s-%s','now','originalname','file','addLogo','single','addAvatar','diskStorage','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','delete','/:id','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getApplications'];(function(_0x1b2944,_0x5d1ca4){var _0x25e677=function(_0x5558a5){while(--_0x5558a5){_0x1b2944['push'](_0x1b2944['shift']());}};_0x25e677(++_0x5d1ca4);}(_0x095f,0x6e));var _0xf095=function(_0x3626fe,_0xc971fc){_0x3626fe=_0x3626fe-0x0;var _0x19e511=_0x095f[_0x3626fe];return _0x19e511;};'use strict';var multer=require(_0xf095('0x0'));var util=require(_0xf095('0x1'));var path=require(_0xf095('0x2'));var timeout=require(_0xf095('0x3'));var express=require(_0xf095('0x4'));var router=express[_0xf095('0x5')]();var auth=require(_0xf095('0x6'));var interaction=require(_0xf095('0x7'));var config=require(_0xf095('0x8'));var controller=require(_0xf095('0x9'));router[_0xf095('0xa')]('/',auth[_0xf095('0xb')](),controller[_0xf095('0xc')]);router[_0xf095('0xa')](_0xf095('0xd'),auth[_0xf095('0xb')](),controller[_0xf095('0xe')]);router[_0xf095('0xa')]('/:id',auth[_0xf095('0xb')](),controller[_0xf095('0xf')]);router[_0xf095('0xa')]('/:id/dispositions',auth[_0xf095('0xb')](),controller[_0xf095('0x10')]);router[_0xf095('0xa')](_0xf095('0x11'),auth[_0xf095('0xb')](),controller[_0xf095('0x12')]);router[_0xf095('0xa')](_0xf095('0x13'),controller[_0xf095('0x14')]);router[_0xf095('0xa')](_0xf095('0x15'),controller[_0xf095('0x16')]);router[_0xf095('0xa')](_0xf095('0x17'),controller['getCustomerAvatar']);router[_0xf095('0xa')](_0xf095('0x18'),controller[_0xf095('0x19')]);router[_0xf095('0xa')](_0xf095('0x1a'),auth[_0xf095('0xb')](),controller[_0xf095('0x1b')]);router[_0xf095('0xa')]('/:id/snippet',controller[_0xf095('0x1c')]);router['get']('/:id/applications',auth['isAuthenticated'](),controller[_0xf095('0x1d')]);router[_0xf095('0xa')](_0xf095('0x1e'),auth[_0xf095('0xb')](),controller[_0xf095('0x1f')]);router[_0xf095('0xa')]('/:id/fields',controller[_0xf095('0x20')]);router['get']('/:id/offline_messages',auth[_0xf095('0xb')](),controller['getOfflineMessages']);router[_0xf095('0xa')](_0xf095('0x21'),auth[_0xf095('0xb')](),controller[_0xf095('0x22')]);router[_0xf095('0x23')]('/',auth[_0xf095('0xb')](),controller['create']);router[_0xf095('0x23')](_0xf095('0x24'),auth['isAuthenticated'](),controller[_0xf095('0x25')]);router[_0xf095('0x23')]('/:id/canned_answers',auth[_0xf095('0xb')](),controller[_0xf095('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f56c2,_0x17ea8e,_0x4bd799){_0x4bd799(null,path[_0xf095('0x27')](config[_0xf095('0x28')],'server/files/images/logos/'));},'filename':function(_0x1692fd,_0x3ec3ab,_0x5ef01d){_0x5ef01d(null,util[_0xf095('0x29')](_0xf095('0x2a'),Date[_0xf095('0x2b')](),_0x3ec3ab[_0xf095('0x2c')]));}})});router[_0xf095('0x23')]('/:id/logo',upload['single'](_0xf095('0x2d')),controller[_0xf095('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x57e043,_0x2d402a,_0x170620){_0x170620(null,path[_0xf095('0x27')](config[_0xf095('0x28')],'server/files/images/avatars/'));},'filename':function(_0x20d440,_0x32d358,_0x250213){_0x250213(null,util[_0xf095('0x29')]('%s-%s',Date[_0xf095('0x2b')](),_0x32d358[_0xf095('0x2c')]));}})});router[_0xf095('0x23')](_0xf095('0x15'),upload[_0xf095('0x2f')](_0xf095('0x2d')),controller[_0xf095('0x30')]);var upload=multer({'storage':multer[_0xf095('0x31')]({'destination':function(_0x47d7c9,_0x549dd7,_0x32ff40){_0x32ff40(null,path['join'](config[_0xf095('0x28')],_0xf095('0x32')));},'filename':function(_0xb08cd3,_0x5c7f8a,_0x510a3f){_0x510a3f(null,util[_0xf095('0x29')](_0xf095('0x2a'),Date[_0xf095('0x2b')](),_0x5c7f8a[_0xf095('0x2c')]));}})});router['post'](_0xf095('0x17'),upload[_0xf095('0x2f')](_0xf095('0x2d')),controller[_0xf095('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d2c71,_0x21683b,_0xe8597a){_0xe8597a(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x4e8642,_0x50e592,_0x5b1423){_0x5b1423(null,util[_0xf095('0x29')]('%s-%s',Date['now'](),_0x50e592[_0xf095('0x2c')]));}})});router[_0xf095('0x23')](_0xf095('0x18'),upload[_0xf095('0x2f')](_0xf095('0x2d')),controller[_0xf095('0x34')]);router[_0xf095('0x23')](_0xf095('0x35'),controller[_0xf095('0x36')]);router[_0xf095('0x23')](_0xf095('0x37'),controller[_0xf095('0x38')]);router[_0xf095('0x23')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xf095('0x39')]);router['post'](_0xf095('0x3a'),auth[_0xf095('0xb')](),controller[_0xf095('0x3b')]);router['post'](_0xf095('0x1e'),auth[_0xf095('0xb')](),controller[_0xf095('0x3c')]);router[_0xf095('0x23')]('/:id/users',auth[_0xf095('0xb')](),controller[_0xf095('0x3d')]);router[_0xf095('0x3e')]('/:id',auth[_0xf095('0xb')](),controller[_0xf095('0x3f')]);router[_0xf095('0x40')](_0xf095('0x41'),auth[_0xf095('0xb')](),controller['destroy']);router['delete'](_0xf095('0x24'),auth[_0xf095('0xb')](),controller[_0xf095('0x42')]);router[_0xf095('0x40')](_0xf095('0x11'),auth[_0xf095('0xb')](),controller[_0xf095('0x43')]);router[_0xf095('0x40')](_0xf095('0x21'),auth['isAuthenticated'](),controller[_0xf095('0x44')]);module[_0xf095('0x45')]=router;
\ No newline at end of file
+var _0x43ba=['delete','removeDispositions','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addAnswer','diskStorage','format','%s-%s','now','originalname','single','file','addLogo','join','root','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','/:id/applications','addApplications','addProactiveActions','addAgents','put','update','destroy'];(function(_0x2b3acf,_0x3fa2f9){var _0x1afc12=function(_0x409ca7){while(--_0x409ca7){_0x2b3acf['push'](_0x2b3acf['shift']());}};_0x1afc12(++_0x3fa2f9);}(_0x43ba,0x89));var _0xa43b=function(_0x41c592,_0x5454b2){_0x41c592=_0x41c592-0x0;var _0x33b1b5=_0x43ba[_0x41c592];return _0x33b1b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa43b('0x0'));var timeout=require(_0xa43b('0x1'));var express=require(_0xa43b('0x2'));var router=express[_0xa43b('0x3')]();var auth=require(_0xa43b('0x4'));var interaction=require(_0xa43b('0x5'));var config=require(_0xa43b('0x6'));var controller=require(_0xa43b('0x7'));router[_0xa43b('0x8')]('/',auth[_0xa43b('0x9')](),controller[_0xa43b('0xa')]);router['get'](_0xa43b('0xb'),auth['isAuthenticated'](),controller[_0xa43b('0xc')]);router['get'](_0xa43b('0xd'),auth[_0xa43b('0x9')](),controller[_0xa43b('0xe')]);router[_0xa43b('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xa43b('0xf')]);router[_0xa43b('0x8')](_0xa43b('0x10'),auth[_0xa43b('0x9')](),controller['getAnswers']);router['get']('/:id/logo',controller['getLogo']);router[_0xa43b('0x8')](_0xa43b('0x11'),controller[_0xa43b('0x12')]);router[_0xa43b('0x8')](_0xa43b('0x13'),controller[_0xa43b('0x14')]);router['get'](_0xa43b('0x15'),controller[_0xa43b('0x16')]);router['get'](_0xa43b('0x17'),auth[_0xa43b('0x9')](),controller['getInteractions']);router['get']('/:id/snippet',controller[_0xa43b('0x18')]);router['get']('/:id/applications',auth[_0xa43b('0x9')](),controller[_0xa43b('0x19')]);router['get'](_0xa43b('0x1a'),auth[_0xa43b('0x9')](),controller[_0xa43b('0x1b')]);router['get'](_0xa43b('0x1c'),controller[_0xa43b('0x1d')]);router[_0xa43b('0x8')](_0xa43b('0x1e'),auth[_0xa43b('0x9')](),controller[_0xa43b('0x1f')]);router['get'](_0xa43b('0x20'),auth[_0xa43b('0x9')](),controller['getAgents']);router[_0xa43b('0x21')]('/',auth[_0xa43b('0x9')](),controller[_0xa43b('0x22')]);router[_0xa43b('0x21')](_0xa43b('0x23'),auth[_0xa43b('0x9')](),controller['addDisposition']);router[_0xa43b('0x21')](_0xa43b('0x10'),auth[_0xa43b('0x9')](),controller[_0xa43b('0x24')]);var upload=multer({'storage':multer[_0xa43b('0x25')]({'destination':function(_0x4e5c02,_0x3f673b,_0x308288){_0x308288(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x4fcbf4,_0x3989ff,_0x86c2a1){_0x86c2a1(null,util[_0xa43b('0x26')](_0xa43b('0x27'),Date[_0xa43b('0x28')](),_0x3989ff[_0xa43b('0x29')]));}})});router['post']('/:id/logo',upload[_0xa43b('0x2a')](_0xa43b('0x2b')),controller[_0xa43b('0x2c')]);var upload=multer({'storage':multer[_0xa43b('0x25')]({'destination':function(_0x50f654,_0x1cae6e,_0x46ec17){_0x46ec17(null,path[_0xa43b('0x2d')](config[_0xa43b('0x2e')],_0xa43b('0x2f')));},'filename':function(_0x477163,_0x529ba2,_0x2d28e4){_0x2d28e4(null,util[_0xa43b('0x26')](_0xa43b('0x27'),Date[_0xa43b('0x28')](),_0x529ba2[_0xa43b('0x29')]));}})});router[_0xa43b('0x21')](_0xa43b('0x11'),upload[_0xa43b('0x2a')](_0xa43b('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer[_0xa43b('0x25')]({'destination':function(_0x2ccee2,_0xa3296c,_0x273269){_0x273269(null,path['join'](config[_0xa43b('0x2e')],'server/files/images/avatars/'));},'filename':function(_0x3f4933,_0x4cf8ee,_0x56171b){_0x56171b(null,util[_0xa43b('0x26')](_0xa43b('0x27'),Date[_0xa43b('0x28')](),_0x4cf8ee[_0xa43b('0x29')]));}})});router[_0xa43b('0x21')](_0xa43b('0x13'),upload[_0xa43b('0x2a')](_0xa43b('0x2b')),controller[_0xa43b('0x30')]);var upload=multer({'storage':multer[_0xa43b('0x25')]({'destination':function(_0x36fd57,_0x2c7cc9,_0x52926d){_0x52926d(null,path[_0xa43b('0x2d')](config[_0xa43b('0x2e')],_0xa43b('0x2f')));},'filename':function(_0x37ddb0,_0x27a68c,_0x207f9e){_0x207f9e(null,util[_0xa43b('0x26')](_0xa43b('0x27'),Date[_0xa43b('0x28')](),_0x27a68c[_0xa43b('0x29')]));}})});router[_0xa43b('0x21')](_0xa43b('0x15'),upload[_0xa43b('0x2a')](_0xa43b('0x2b')),controller[_0xa43b('0x31')]);router[_0xa43b('0x21')](_0xa43b('0x32'),controller[_0xa43b('0x33')]);router[_0xa43b('0x21')](_0xa43b('0x34'),controller[_0xa43b('0x35')]);router['post'](_0xa43b('0x17'),auth[_0xa43b('0x9')](),controller['addInteraction']);router['post'](_0xa43b('0x36'),auth['isAuthenticated'](),controller[_0xa43b('0x37')]);router[_0xa43b('0x21')]('/:id/proactive_actions',auth[_0xa43b('0x9')](),controller[_0xa43b('0x38')]);router['post'](_0xa43b('0x20'),auth[_0xa43b('0x9')](),controller[_0xa43b('0x39')]);router[_0xa43b('0x3a')](_0xa43b('0xd'),auth[_0xa43b('0x9')](),controller[_0xa43b('0x3b')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa43b('0x3c')]);router[_0xa43b('0x3d')](_0xa43b('0x23'),auth[_0xa43b('0x9')](),controller[_0xa43b('0x3e')]);router[_0xa43b('0x3d')]('/:id/canned_answers',auth[_0xa43b('0x9')](),controller[_0xa43b('0x3f')]);router[_0xa43b('0x3d')](_0xa43b('0x20'),auth[_0xa43b('0x9')](),controller[_0xa43b('0x40')]);module[_0xa43b('0x41')]=router;
\ No newline at end of file
index 5a7283e..9ed3537 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8958=['STRING','exports'];(function(_0x1e2321,_0x3ae1c5){var _0x1d346d=function(_0x24f171){while(--_0x24f171){_0x1e2321['push'](_0x1e2321['shift']());}};_0x1d346d(++_0x3ae1c5);}(_0x8958,0x93));var _0x8895=function(_0xa9b556,_0x4b4afc){_0xa9b556=_0xa9b556-0x0;var _0x1dfb34=_0x8958[_0xa9b556];return _0x1dfb34;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS','Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x8895('0x1')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9a6b=['exports','STRING','ENUM','AmazonAWS','Google','sequelize'];(function(_0xd71ff9,_0x36cd21){var _0x2834ef=function(_0x532570){while(--_0x532570){_0xd71ff9['push'](_0xd71ff9['shift']());}};_0x2834ef(++_0x36cd21);}(_0x9a6b,0x77));var _0xb9a6=function(_0x40af92,_0x22abf7){_0x40af92=_0x40af92-0x0;var _0x4b92ee=_0x9a6b[_0x40af92];return _0x4b92ee;};'use strict';var Sequelize=require(_0xb9a6('0x0'));module[_0xb9a6('0x1')]={'name':{'type':Sequelize[_0xb9a6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb9a6('0x3')](_0xb9a6('0x4'),_0xb9a6('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xb9a6('0x2')]}};
\ No newline at end of file
index 73f150d..35ca51a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e64=['options','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','destroy','then','error','stack','name','send','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x5218c0,_0x2591df){var _0xc5dba=function(_0x54f32d){while(--_0x54f32d){_0x5218c0['push'](_0x5218c0['shift']());}};_0xc5dba(++_0x2591df);}(_0x6e64,0x187));var _0x46e6=function(_0x3b1d81,_0x21ffbf){_0x3b1d81=_0x3b1d81-0x0;var _0x1e38aa=_0x6e64[_0x3b1d81];return _0x1e38aa;};'use strict';var pdf=require(_0x46e6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x46e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46e6('0x2'));var rp=require(_0x46e6('0x3'));var moment=require(_0x46e6('0x4'));var BPromise=require(_0x46e6('0x5'));var Mustache=require(_0x46e6('0x6'));var util=require(_0x46e6('0x7'));var path=require('path');var sox=require(_0x46e6('0x8'));var csv=require(_0x46e6('0x9'));var ejs=require(_0x46e6('0xa'));var fs=require('fs');var _=require(_0x46e6('0xb'));var squel=require(_0x46e6('0xc'));var crypto=require(_0x46e6('0xd'));var jsforce=require(_0x46e6('0xe'));var deskjs=require(_0x46e6('0xf'));var toCsv=require(_0x46e6('0x9'));var querystring=require(_0x46e6('0x10'));var Papa=require(_0x46e6('0x11'));var Redis=require(_0x46e6('0x12'));var authService=require(_0x46e6('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46e6('0x14'));var logger=require(_0x46e6('0x15'))(_0x46e6('0x16'));var utils=require(_0x46e6('0x17'));var config=require(_0x46e6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x926af4,_0x287544){_0x287544=_0x287544||0xcc;return function(_0x252504){if(_0x252504){return _0x926af4[_0x46e6('0x19')](_0x287544);}return _0x926af4[_0x46e6('0x1a')](_0x287544)[_0x46e6('0x1b')]();};}function respondWithResult(_0x1f9d89,_0x4f6880){_0x4f6880=_0x4f6880||0xc8;return function(_0x20b7d2){if(_0x20b7d2){return _0x1f9d89[_0x46e6('0x1a')](_0x4f6880)[_0x46e6('0x1c')](_0x20b7d2);}};}function respondWithFilteredResult(_0x85f2ab,_0x3caec5){return function(_0x386341){if(_0x386341){var _0x1bdaeb=_0x386341[_0x46e6('0x1d')],_0x39c36f=_0x3caec5[_0x46e6('0x1e')],_0x5e52c9=_0x3caec5[_0x46e6('0x1e')]+_0x3caec5[_0x46e6('0x1f')],_0x20502e;if(_0x5e52c9>=_0x1bdaeb){_0x5e52c9=_0x1bdaeb;_0x20502e=0xc8;}else{_0x20502e=0xce;}_0x85f2ab[_0x46e6('0x1a')](_0x20502e);return _0x85f2ab['set'](_0x46e6('0x20'),_0x39c36f+'-'+_0x5e52c9+'/'+_0x1bdaeb)[_0x46e6('0x1c')](_0x386341);}return null;};}function patchUpdates(_0x40da02){return function(_0xa3b523){try{jsonpatch[_0x46e6('0x21')](_0xa3b523,_0x40da02,!![]);}catch(_0x3d212e){return BPromise['reject'](_0x3d212e);}return _0xa3b523[_0x46e6('0x22')]();};}function saveUpdates(_0x261fd9,_0x2cdab5){return function(_0x5e4644){if(_0x5e4644){return _0x5e4644[_0x46e6('0x23')](_0x261fd9)['then'](function(_0x2efd57){return _0x2efd57;});}return null;};}function removeEntity(_0x1fa009,_0x17f342){return function(_0x5378f4){if(_0x5378f4){return _0x5378f4[_0x46e6('0x24')]()[_0x46e6('0x25')](function(){_0x1fa009[_0x46e6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd8f383,_0x57b40e){return function(_0x11fbf4){if(!_0x11fbf4){_0xd8f383[_0x46e6('0x19')](0x194);}return _0x11fbf4;};}function handleError(_0x207b12,_0x31920d){_0x31920d=_0x31920d||0x1f4;return function(_0x3ed7fa){logger[_0x46e6('0x26')](_0x3ed7fa[_0x46e6('0x27')]);if(_0x3ed7fa[_0x46e6('0x28')]){delete _0x3ed7fa['name'];}_0x207b12[_0x46e6('0x1a')](_0x31920d)[_0x46e6('0x29')](_0x3ed7fa);};}exports['index']=function(_0x30d050,_0x50c3cc){var _0xebf657={},_0x808034={},_0x984533={'count':0x0,'rows':[]};var _0xd961cd=_[_0x46e6('0x2a')](db[_0x46e6('0x2b')][_0x46e6('0x2c')],function(_0x530d0a){return{'name':_0x530d0a[_0x46e6('0x2d')],'type':_0x530d0a[_0x46e6('0x2e')][_0x46e6('0x2f')]};});_0x808034['model']=_['map'](_0xd961cd,'name');_0x808034[_0x46e6('0x30')]=_[_0x46e6('0x31')](_0x30d050[_0x46e6('0x30')]);_0x808034[_0x46e6('0x32')]=_[_0x46e6('0x33')](_0x808034['model'],_0x808034[_0x46e6('0x30')]);_0xebf657[_0x46e6('0x34')]=_[_0x46e6('0x33')](_0x808034[_0x46e6('0x35')],qs[_0x46e6('0x36')](_0x30d050[_0x46e6('0x30')][_0x46e6('0x36')]));_0xebf657['attributes']=_0xebf657['attributes'][_0x46e6('0x37')]?_0xebf657[_0x46e6('0x34')]:_0x808034[_0x46e6('0x35')];if(!_0x30d050[_0x46e6('0x30')][_0x46e6('0x38')](_0x46e6('0x39'))){_0xebf657[_0x46e6('0x1f')]=qs['limit'](_0x30d050['query'][_0x46e6('0x1f')]);_0xebf657['offset']=qs['offset'](_0x30d050['query']['offset']);}_0xebf657[_0x46e6('0x3a')]=qs['sort'](_0x30d050[_0x46e6('0x30')][_0x46e6('0x3b')]);_0xebf657[_0x46e6('0x3c')]=qs[_0x46e6('0x32')](_[_0x46e6('0x3d')](_0x30d050['query'],_0x808034['filters']),_0xd961cd);if(_0x30d050[_0x46e6('0x30')][_0x46e6('0x3e')]){_0xebf657[_0x46e6('0x3c')]=_[_0x46e6('0x3f')](_0xebf657[_0x46e6('0x3c')],{'$or':_[_0x46e6('0x2a')](_0xd961cd,function(_0x5b5230){if(_0x5b5230['type']!==_0x46e6('0x40')){var _0x4f4201={};_0x4f4201[_0x5b5230[_0x46e6('0x28')]]={'$like':'%'+_0x30d050[_0x46e6('0x30')][_0x46e6('0x3e')]+'%'};return _0x4f4201;}})});}_0xebf657=_[_0x46e6('0x3f')]({},_0xebf657,_0x30d050[_0x46e6('0x41')]);var _0x2e1895={'where':_0xebf657['where']};return db[_0x46e6('0x2b')][_0x46e6('0x1d')](_0x2e1895)[_0x46e6('0x25')](function(_0x1aa9c8){_0x984533[_0x46e6('0x1d')]=_0x1aa9c8;if(_0x30d050['query'][_0x46e6('0x42')]){_0xebf657[_0x46e6('0x43')]=[{'all':!![]}];}return db[_0x46e6('0x2b')][_0x46e6('0x44')](_0xebf657);})[_0x46e6('0x25')](function(_0x3efa27){_0x984533[_0x46e6('0x45')]=_0x3efa27;return _0x984533;})[_0x46e6('0x25')](respondWithFilteredResult(_0x50c3cc,_0xebf657))[_0x46e6('0x46')](handleError(_0x50c3cc,null));};exports[_0x46e6('0x47')]=function(_0x3d6e06,_0x354ca0){var _0x91a06d={'raw':!![],'where':{'id':_0x3d6e06[_0x46e6('0x48')]['id']}},_0x117fde={};_0x117fde[_0x46e6('0x35')]=_[_0x46e6('0x31')](db[_0x46e6('0x2b')][_0x46e6('0x2c')]);_0x117fde['query']=_[_0x46e6('0x31')](_0x3d6e06['query']);_0x117fde['filters']=_[_0x46e6('0x33')](_0x117fde['model'],_0x117fde[_0x46e6('0x30')]);_0x91a06d[_0x46e6('0x34')]=_[_0x46e6('0x33')](_0x117fde['model'],qs[_0x46e6('0x36')](_0x3d6e06[_0x46e6('0x30')][_0x46e6('0x36')]));_0x91a06d['attributes']=_0x91a06d[_0x46e6('0x34')][_0x46e6('0x37')]?_0x91a06d[_0x46e6('0x34')]:_0x117fde[_0x46e6('0x35')];if(_0x3d6e06['query'][_0x46e6('0x42')]){_0x91a06d['include']=[{'all':!![]}];}_0x91a06d=_[_0x46e6('0x3f')]({},_0x91a06d,_0x3d6e06['options']);return db[_0x46e6('0x2b')][_0x46e6('0x49')](_0x91a06d)['then'](handleEntityNotFound(_0x354ca0,null))[_0x46e6('0x25')](respondWithResult(_0x354ca0,null))[_0x46e6('0x46')](handleError(_0x354ca0,null));};exports[_0x46e6('0x4a')]=function(_0x2d4afa,_0x22b096){return db[_0x46e6('0x2b')][_0x46e6('0x4a')](_0x2d4afa[_0x46e6('0x4b')],{})[_0x46e6('0x25')](respondWithResult(_0x22b096,0xc9))[_0x46e6('0x46')](handleError(_0x22b096,null));};exports[_0x46e6('0x23')]=function(_0x4bbb91,_0x5c906d){if(_0x4bbb91[_0x46e6('0x4b')]['id']){delete _0x4bbb91[_0x46e6('0x4b')]['id'];}return db[_0x46e6('0x2b')]['find']({'where':{'id':_0x4bbb91['params']['id']}})['then'](handleEntityNotFound(_0x5c906d,null))[_0x46e6('0x25')](saveUpdates(_0x4bbb91[_0x46e6('0x4b')],null))['then'](respondWithResult(_0x5c906d,null))[_0x46e6('0x46')](handleError(_0x5c906d,null));};exports[_0x46e6('0x24')]=function(_0x5c1aa9,_0x2348f4){return db[_0x46e6('0x2b')][_0x46e6('0x49')]({'where':{'id':_0x5c1aa9['params']['id']}})['then'](handleEntityNotFound(_0x2348f4,null))[_0x46e6('0x25')](removeEntity(_0x2348f4,null))['catch'](handleError(_0x2348f4,null));};
\ No newline at end of file
+var _0x2158=['ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','CloudProvider','rawAttributes','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','findAll','rows','catch','show','params','keys','includeAll','include','find','create','html-pdf','rimraf','fast-json-patch','request-promise','util','path','to-csv'];(function(_0x328b1c,_0xec0b4f){var _0x4dbeaa=function(_0x432519){while(--_0x432519){_0x328b1c['push'](_0x328b1c['shift']());}};_0x4dbeaa(++_0xec0b4f);}(_0x2158,0x157));var _0x8215=function(_0x222c51,_0x20a82a){_0x222c51=_0x222c51-0x0;var _0x3af2a4=_0x2158[_0x222c51];return _0x3af2a4;};'use strict';var pdf=require(_0x8215('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8215('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8215('0x2'));var rp=require(_0x8215('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8215('0x4'));var path=require(_0x8215('0x5'));var sox=require('sox');var csv=require(_0x8215('0x6'));var ejs=require(_0x8215('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8215('0x8'));var crypto=require(_0x8215('0x9'));var jsforce=require(_0x8215('0xa'));var deskjs=require(_0x8215('0xb'));var toCsv=require(_0x8215('0x6'));var querystring=require('querystring');var Papa=require(_0x8215('0xc'));var Redis=require(_0x8215('0xd'));var authService=require(_0x8215('0xe'));var qs=require(_0x8215('0xf'));var as=require(_0x8215('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8215('0x11'))(_0x8215('0x12'));var utils=require(_0x8215('0x13'));var config=require(_0x8215('0x14'));var db=require(_0x8215('0x15'))['db'];function respondWithStatusCode(_0x2df482,_0x444e99){_0x444e99=_0x444e99||0xcc;return function(_0x4ba018){if(_0x4ba018){return _0x2df482['sendStatus'](_0x444e99);}return _0x2df482[_0x8215('0x16')](_0x444e99)[_0x8215('0x17')]();};}function respondWithResult(_0x17d731,_0x42f059){_0x42f059=_0x42f059||0xc8;return function(_0x5ececb){if(_0x5ececb){return _0x17d731[_0x8215('0x16')](_0x42f059)[_0x8215('0x18')](_0x5ececb);}};}function respondWithFilteredResult(_0x36cc2b,_0x4bd9d1){return function(_0x1b01d3){if(_0x1b01d3){var _0x5ccbca=_0x1b01d3['count'],_0xacfb09=_0x4bd9d1[_0x8215('0x19')],_0x475ae4=_0x4bd9d1['offset']+_0x4bd9d1[_0x8215('0x1a')],_0x4e98d4;if(_0x475ae4>=_0x5ccbca){_0x475ae4=_0x5ccbca;_0x4e98d4=0xc8;}else{_0x4e98d4=0xce;}_0x36cc2b[_0x8215('0x16')](_0x4e98d4);return _0x36cc2b[_0x8215('0x1b')]('Content-Range',_0xacfb09+'-'+_0x475ae4+'/'+_0x5ccbca)[_0x8215('0x18')](_0x1b01d3);}return null;};}function patchUpdates(_0x505d1b){return function(_0x5d968c){try{jsonpatch[_0x8215('0x1c')](_0x5d968c,_0x505d1b,!![]);}catch(_0x4cae40){return BPromise[_0x8215('0x1d')](_0x4cae40);}return _0x5d968c[_0x8215('0x1e')]();};}function saveUpdates(_0x6f16f9,_0x38d246){return function(_0x536ccb){if(_0x536ccb){return _0x536ccb['update'](_0x6f16f9)[_0x8215('0x1f')](function(_0x3933ab){return _0x3933ab;});}return null;};}function removeEntity(_0x5ba0cc,_0x24eda6){return function(_0x231e9a){if(_0x231e9a){return _0x231e9a[_0x8215('0x20')]()[_0x8215('0x1f')](function(){_0x5ba0cc[_0x8215('0x16')](0xcc)[_0x8215('0x17')]();});}};}function handleEntityNotFound(_0x3cb396,_0x241d5b){return function(_0x433ea9){if(!_0x433ea9){_0x3cb396[_0x8215('0x21')](0x194);}return _0x433ea9;};}function handleError(_0x1eb0e9,_0x4e0d26){_0x4e0d26=_0x4e0d26||0x1f4;return function(_0x42ab40){logger[_0x8215('0x22')](_0x42ab40[_0x8215('0x23')]);if(_0x42ab40['name']){delete _0x42ab40[_0x8215('0x24')];}_0x1eb0e9[_0x8215('0x16')](_0x4e0d26)[_0x8215('0x25')](_0x42ab40);};}exports['index']=function(_0x351030,_0x125b50){var _0x31e12d={},_0x1114f5={},_0x3c52ca={'count':0x0,'rows':[]};var _0x325fdc=_[_0x8215('0x26')](db[_0x8215('0x27')][_0x8215('0x28')],function(_0x57d7d4){return{'name':_0x57d7d4['fieldName'],'type':_0x57d7d4['type'][_0x8215('0x29')]};});_0x1114f5[_0x8215('0x2a')]=_[_0x8215('0x26')](_0x325fdc,_0x8215('0x24'));_0x1114f5[_0x8215('0x2b')]=_['keys'](_0x351030['query']);_0x1114f5['filters']=_['intersection'](_0x1114f5[_0x8215('0x2a')],_0x1114f5[_0x8215('0x2b')]);_0x31e12d[_0x8215('0x2c')]=_[_0x8215('0x2d')](_0x1114f5[_0x8215('0x2a')],qs[_0x8215('0x2e')](_0x351030[_0x8215('0x2b')][_0x8215('0x2e')]));_0x31e12d['attributes']=_0x31e12d[_0x8215('0x2c')][_0x8215('0x2f')]?_0x31e12d[_0x8215('0x2c')]:_0x1114f5[_0x8215('0x2a')];if(!_0x351030[_0x8215('0x2b')]['hasOwnProperty'](_0x8215('0x30'))){_0x31e12d[_0x8215('0x1a')]=qs[_0x8215('0x1a')](_0x351030[_0x8215('0x2b')][_0x8215('0x1a')]);_0x31e12d['offset']=qs['offset'](_0x351030[_0x8215('0x2b')]['offset']);}_0x31e12d[_0x8215('0x31')]=qs['sort'](_0x351030[_0x8215('0x2b')][_0x8215('0x32')]);_0x31e12d[_0x8215('0x33')]=qs[_0x8215('0x34')](_[_0x8215('0x35')](_0x351030[_0x8215('0x2b')],_0x1114f5[_0x8215('0x34')]),_0x325fdc);if(_0x351030[_0x8215('0x2b')][_0x8215('0x36')]){_0x31e12d[_0x8215('0x33')]=_[_0x8215('0x37')](_0x31e12d['where'],{'$or':_[_0x8215('0x26')](_0x325fdc,function(_0x534b35){if(_0x534b35[_0x8215('0x38')]!==_0x8215('0x39')){var _0xe0b6a4={};_0xe0b6a4[_0x534b35['name']]={'$like':'%'+_0x351030['query'][_0x8215('0x36')]+'%'};return _0xe0b6a4;}})});}_0x31e12d=_[_0x8215('0x37')]({},_0x31e12d,_0x351030[_0x8215('0x3a')]);var _0x19728a={'where':_0x31e12d[_0x8215('0x33')]};return db['CloudProvider'][_0x8215('0x3b')](_0x19728a)[_0x8215('0x1f')](function(_0x3b7ce7){_0x3c52ca[_0x8215('0x3b')]=_0x3b7ce7;if(_0x351030[_0x8215('0x2b')]['includeAll']){_0x31e12d['include']=[{'all':!![]}];}return db[_0x8215('0x27')][_0x8215('0x3c')](_0x31e12d);})[_0x8215('0x1f')](function(_0x349b62){_0x3c52ca[_0x8215('0x3d')]=_0x349b62;return _0x3c52ca;})[_0x8215('0x1f')](respondWithFilteredResult(_0x125b50,_0x31e12d))[_0x8215('0x3e')](handleError(_0x125b50,null));};exports[_0x8215('0x3f')]=function(_0x1bd242,_0x303a0d){var _0x47a453={'raw':!![],'where':{'id':_0x1bd242[_0x8215('0x40')]['id']}},_0x582479={};_0x582479[_0x8215('0x2a')]=_['keys'](db[_0x8215('0x27')][_0x8215('0x28')]);_0x582479[_0x8215('0x2b')]=_[_0x8215('0x41')](_0x1bd242['query']);_0x582479[_0x8215('0x34')]=_[_0x8215('0x2d')](_0x582479[_0x8215('0x2a')],_0x582479[_0x8215('0x2b')]);_0x47a453[_0x8215('0x2c')]=_[_0x8215('0x2d')](_0x582479[_0x8215('0x2a')],qs['fields'](_0x1bd242[_0x8215('0x2b')][_0x8215('0x2e')]));_0x47a453['attributes']=_0x47a453[_0x8215('0x2c')]['length']?_0x47a453[_0x8215('0x2c')]:_0x582479[_0x8215('0x2a')];if(_0x1bd242['query'][_0x8215('0x42')]){_0x47a453[_0x8215('0x43')]=[{'all':!![]}];}_0x47a453=_['merge']({},_0x47a453,_0x1bd242['options']);return db[_0x8215('0x27')][_0x8215('0x44')](_0x47a453)[_0x8215('0x1f')](handleEntityNotFound(_0x303a0d,null))[_0x8215('0x1f')](respondWithResult(_0x303a0d,null))['catch'](handleError(_0x303a0d,null));};exports[_0x8215('0x45')]=function(_0x4716d8,_0x2e61c5){return db[_0x8215('0x27')]['create'](_0x4716d8['body'],{})[_0x8215('0x1f')](respondWithResult(_0x2e61c5,0xc9))[_0x8215('0x3e')](handleError(_0x2e61c5,null));};exports['update']=function(_0x4b3618,_0x2629b5){if(_0x4b3618['body']['id']){delete _0x4b3618['body']['id'];}return db[_0x8215('0x27')]['find']({'where':{'id':_0x4b3618[_0x8215('0x40')]['id']}})[_0x8215('0x1f')](handleEntityNotFound(_0x2629b5,null))[_0x8215('0x1f')](saveUpdates(_0x4b3618['body'],null))['then'](respondWithResult(_0x2629b5,null))['catch'](handleError(_0x2629b5,null));};exports[_0x8215('0x20')]=function(_0x54b9cd,_0x1155df){return db[_0x8215('0x27')][_0x8215('0x44')]({'where':{'id':_0x54b9cd[_0x8215('0x40')]['id']}})[_0x8215('0x1f')](handleEntityNotFound(_0x1155df,null))[_0x8215('0x1f')](removeEntity(_0x1155df,null))[_0x8215('0x3e')](handleError(_0x1155df,null));};
\ No newline at end of file
index 58b7c31..f63fe24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3952=['CloudProvider','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x194a43,_0xd60a78){var _0x3c8901=function(_0x45b145){while(--_0x45b145){_0x194a43['push'](_0x194a43['shift']());}};_0x3c8901(++_0xd60a78);}(_0x3952,0x18d));var _0x2395=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0x3952[_0x3b1b23];return _0x1efc85;};'use strict';var _=require(_0x2395('0x0'));var util=require(_0x2395('0x1'));var logger=require('../../config/logger')(_0x2395('0x2'));var moment=require(_0x2395('0x3'));var BPromise=require(_0x2395('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2395('0x5'));var rimraf=require(_0x2395('0x6'));var config=require(_0x2395('0x7'));var attributes=require(_0x2395('0x8'));module[_0x2395('0x9')]=function(_0x377ef8,_0xd4736a){return _0x377ef8['define'](_0x2395('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa057=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','cloud_providers','util','api','moment','bluebird','request-promise'];(function(_0xadd386,_0x1fda2a){var _0xb996dd=function(_0x2c95b8){while(--_0x2c95b8){_0xadd386['push'](_0xadd386['shift']());}};_0xb996dd(++_0x1fda2a);}(_0xa057,0xd3));var _0x7a05=function(_0x5963cf,_0x5a6068){_0x5963cf=_0x5963cf-0x0;var _0x2457ef=_0xa057[_0x5963cf];return _0x2457ef;};'use strict';var _=require('lodash');var util=require(_0x7a05('0x0'));var logger=require('../../config/logger')(_0x7a05('0x1'));var moment=require(_0x7a05('0x2'));var BPromise=require(_0x7a05('0x3'));var rp=require(_0x7a05('0x4'));var fs=require('fs');var path=require(_0x7a05('0x5'));var rimraf=require(_0x7a05('0x6'));var config=require(_0x7a05('0x7'));var attributes=require(_0x7a05('0x8'));module[_0x7a05('0x9')]=function(_0x439abd,_0x3033dc){return _0x439abd[_0x7a05('0xa')]('CloudProvider',attributes,{'tableName':_0x7a05('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9186cb8..b232c71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9908=['CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CloudProvider,\x20%s,\x20%s','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','request','info','request\x20sent','debug'];(function(_0x26ab34,_0x282fa9){var _0x2e0d50=function(_0x2dcea1){while(--_0x2dcea1){_0x26ab34['push'](_0x26ab34['shift']());}};_0x2e0d50(++_0x282fa9);}(_0x9908,0xb3));var _0x8990=function(_0x10ec0f,_0x5ece09){_0x10ec0f=_0x10ec0f-0x0;var _0x1587ee=_0x9908[_0x10ec0f];return _0x1587ee;};'use strict';var _=require(_0x8990('0x0'));var util=require(_0x8990('0x1'));var moment=require('moment');var BPromise=require(_0x8990('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8990('0x3'));var db=require(_0x8990('0x4'))['db'];var utils=require(_0x8990('0x5'));var logger=require(_0x8990('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4880dd,_0x3dc12b,_0x50dccb){return new BPromise(function(_0x106c84,_0x52d13a){return client[_0x8990('0x7')](_0x4880dd,_0x50dccb)['then'](function(_0x30fc19){logger[_0x8990('0x8')]('CloudProvider,\x20%s,\x20%s',_0x3dc12b,_0x8990('0x9'));logger[_0x8990('0xa')](_0x8990('0xb'),_0x3dc12b,_0x8990('0x9'),JSON[_0x8990('0xc')](_0x30fc19));if(_0x30fc19[_0x8990('0xd')]){if(_0x30fc19[_0x8990('0xd')][_0x8990('0xe')]===0x1f4){logger[_0x8990('0xd')]('CloudProvider,\x20%s,\x20%s',_0x3dc12b,_0x30fc19['error'][_0x8990('0xf')]);return _0x52d13a(_0x30fc19[_0x8990('0xd')]['message']);}logger[_0x8990('0xd')]('CloudProvider,\x20%s,\x20%s',_0x3dc12b,_0x30fc19[_0x8990('0xd')]['message']);return _0x106c84(_0x30fc19[_0x8990('0xd')]['message']);}else{logger[_0x8990('0x8')]('CloudProvider,\x20%s,\x20%s',_0x3dc12b,_0x8990('0x9'));_0x106c84(_0x30fc19[_0x8990('0x10')][_0x8990('0xf')]);}})[_0x8990('0x11')](function(_0x862dab){logger['error'](_0x8990('0x12'),_0x3dc12b,_0x862dab);_0x52d13a(_0x862dab);});});}
\ No newline at end of file
+var _0xb466=['jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3f6cdf,_0xe7354e){var _0xf60c51=function(_0x26c4e5){while(--_0x26c4e5){_0x3f6cdf['push'](_0x3f6cdf['shift']());}};_0xf60c51(++_0xe7354e);}(_0xb466,0x65));var _0x6b46=function(_0x1c9357,_0xb5f1d){_0x1c9357=_0x1c9357-0x0;var _0x48e09e=_0xb466[_0x1c9357];return _0x48e09e;};'use strict';var _=require('lodash');var util=require(_0x6b46('0x0'));var moment=require(_0x6b46('0x1'));var BPromise=require(_0x6b46('0x2'));var rs=require(_0x6b46('0x3'));var fs=require('fs');var Redis=require(_0x6b46('0x4'));var db=require(_0x6b46('0x5'))['db'];var utils=require(_0x6b46('0x6'));var logger=require(_0x6b46('0x7'))('rpc');var config=require(_0x6b46('0x8'));var jayson=require(_0x6b46('0x9'));var client=jayson[_0x6b46('0xa')][_0x6b46('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35a34b,_0x56e0ad,_0x1cafc5){return new BPromise(function(_0xb8d14c,_0x2f7350){return client[_0x6b46('0xc')](_0x35a34b,_0x1cafc5)[_0x6b46('0xd')](function(_0x241f76){logger[_0x6b46('0xe')]('CloudProvider,\x20%s,\x20%s',_0x56e0ad,_0x6b46('0xf'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x56e0ad,_0x6b46('0xf'),JSON[_0x6b46('0x10')](_0x241f76));if(_0x241f76['error']){if(_0x241f76[_0x6b46('0x11')][_0x6b46('0x12')]===0x1f4){logger[_0x6b46('0x11')](_0x6b46('0x13'),_0x56e0ad,_0x241f76[_0x6b46('0x11')]['message']);return _0x2f7350(_0x241f76[_0x6b46('0x11')]['message']);}logger['error'](_0x6b46('0x13'),_0x56e0ad,_0x241f76[_0x6b46('0x11')]['message']);return _0xb8d14c(_0x241f76['error'][_0x6b46('0x14')]);}else{logger[_0x6b46('0xe')]('CloudProvider,\x20%s,\x20%s',_0x56e0ad,_0x6b46('0xf'));_0xb8d14c(_0x241f76[_0x6b46('0x15')][_0x6b46('0x14')]);}})['catch'](function(_0x24d930){logger[_0x6b46('0x11')](_0x6b46('0x13'),_0x56e0ad,_0x24d930);_0x2f7350(_0x24d930);});});}
\ No newline at end of file
index b366490..cd2a791 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb868=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','index','/:id','isAuthenticated','post','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb868,0x8b));var _0x8b86=function(_0xe3362a,_0x50e069){_0xe3362a=_0xe3362a-0x0;var _0x5153d5=_0xb868[_0xe3362a];return _0x5153d5;};'use strict';var multer=require(_0x8b86('0x0'));var util=require(_0x8b86('0x1'));var path=require(_0x8b86('0x2'));var timeout=require('connect-timeout');var express=require(_0x8b86('0x3'));var router=express[_0x8b86('0x4')]();var auth=require(_0x8b86('0x5'));var interaction=require(_0x8b86('0x6'));var config=require(_0x8b86('0x7'));var controller=require(_0x8b86('0x8'));router[_0x8b86('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b86('0xa')]);router[_0x8b86('0x9')](_0x8b86('0xb'),auth[_0x8b86('0xc')](),controller['show']);router[_0x8b86('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x8b86('0xc')](),controller[_0x8b86('0xe')]);router[_0x8b86('0xf')](_0x8b86('0xb'),auth[_0x8b86('0xc')](),controller[_0x8b86('0x10')]);module[_0x8b86('0x11')]=router;
\ No newline at end of file
+var _0x6e28=['/:id','show','post','put','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','get'];(function(_0x2767c6,_0x2af3d0){var _0x4b1268=function(_0x48361f){while(--_0x48361f){_0x2767c6['push'](_0x2767c6['shift']());}};_0x4b1268(++_0x2af3d0);}(_0x6e28,0xba));var _0x86e2=function(_0x246a15,_0x395579){_0x246a15=_0x246a15-0x0;var _0x5a0b7f=_0x6e28[_0x246a15];return _0x5a0b7f;};'use strict';var multer=require('multer');var util=require(_0x86e2('0x0'));var path=require(_0x86e2('0x1'));var timeout=require(_0x86e2('0x2'));var express=require(_0x86e2('0x3'));var router=express['Router']();var auth=require(_0x86e2('0x4'));var interaction=require(_0x86e2('0x5'));var config=require(_0x86e2('0x6'));var controller=require(_0x86e2('0x7'));router['get']('/',auth[_0x86e2('0x8')](),controller['index']);router[_0x86e2('0x9')](_0x86e2('0xa'),auth[_0x86e2('0x8')](),controller[_0x86e2('0xb')]);router[_0x86e2('0xc')]('/',auth[_0x86e2('0x8')](),controller['create']);router[_0x86e2('0xd')](_0x86e2('0xa'),auth[_0x86e2('0x8')](),controller['update']);router['delete'](_0x86e2('0xa'),auth[_0x86e2('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4bbdbc7..7f4e615 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x022e=['sequelize','exports','STRING'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x022e,0x17a));var _0xe022=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x022e[_0x1f36bb];return _0xaf97fa;};'use strict';var Sequelize=require(_0xe022('0x0'));module[_0xe022('0x1')]={'name':{'type':Sequelize[_0xe022('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe022('0x2')]},'companyId':{'type':Sequelize[_0xe022('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xe022('0x2')]},'fax':{'type':Sequelize[_0xe022('0x2')]},'type':{'type':Sequelize[_0xe022('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xe022('0x2')]},'city':{'type':Sequelize[_0xe022('0x2')]},'country':{'type':Sequelize[_0xe022('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe022('0x2')]},'sStreet':{'type':Sequelize[_0xe022('0x2')]},'sPostalCode':{'type':Sequelize[_0xe022('0x2')]},'sCity':{'type':Sequelize[_0xe022('0x2')]},'sCountry':{'type':Sequelize[_0xe022('0x2')]},'description':{'type':Sequelize[_0xe022('0x2')]}};
\ No newline at end of file
+var _0x45b3=['STRING','name','sequelize','exports'];(function(_0x41df82,_0x1d1e1a){var _0x4e079f=function(_0x7358db){while(--_0x7358db){_0x41df82['push'](_0x41df82['shift']());}};_0x4e079f(++_0x1d1e1a);}(_0x45b3,0x15a));var _0x345b=function(_0x2ea3a6,_0x473be1){_0x2ea3a6=_0x2ea3a6-0x0;var _0x4fbdcb=_0x45b3[_0x2ea3a6];return _0x4fbdcb;};'use strict';var Sequelize=require(_0x345b('0x0'));module[_0x345b('0x1')]={'name':{'type':Sequelize[_0x345b('0x2')],'unique':_0x345b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x345b('0x2')]},'website':{'type':Sequelize[_0x345b('0x2')]},'phone':{'type':Sequelize[_0x345b('0x2')]},'fax':{'type':Sequelize[_0x345b('0x2')]},'type':{'type':Sequelize[_0x345b('0x2')]},'street':{'type':Sequelize[_0x345b('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x345b('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x345b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x345b('0x2')]},'sPostalCode':{'type':Sequelize[_0x345b('0x2')]},'sCity':{'type':Sequelize[_0x345b('0x2')]},'sCountry':{'type':Sequelize[_0x345b('0x2')]},'description':{'type':Sequelize[_0x345b('0x2')]}};
\ No newline at end of file
index ece3563..fa466da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb4b=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','CmCompany','count','includeAll','include','findAll','catch','show','params','intersection','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','describe','CmContact','addContacts','ids','omit','getContacts','findOne','rawAttributes','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1f0367,_0x586ed4){var _0x40aad5=function(_0x333cff){while(--_0x333cff){_0x1f0367['push'](_0x1f0367['shift']());}};_0x40aad5(++_0x586ed4);}(_0xcb4b,0xa6));var _0xbcb4=function(_0x454fd1,_0x35af51){_0x454fd1=_0x454fd1-0x0;var _0x3a0aad=_0xcb4b[_0x454fd1];return _0x3a0aad;};'use strict';var pdf=require(_0xbcb4('0x0'));var emlformat=require(_0xbcb4('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbcb4('0x2'));var moment=require(_0xbcb4('0x3'));var BPromise=require(_0xbcb4('0x4'));var Mustache=require(_0xbcb4('0x5'));var util=require(_0xbcb4('0x6'));var path=require(_0xbcb4('0x7'));var sox=require(_0xbcb4('0x8'));var csv=require(_0xbcb4('0x9'));var ejs=require(_0xbcb4('0xa'));var fs=require('fs');var _=require(_0xbcb4('0xb'));var squel=require(_0xbcb4('0xc'));var crypto=require(_0xbcb4('0xd'));var jsforce=require(_0xbcb4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbcb4('0x9'));var querystring=require(_0xbcb4('0xf'));var Papa=require('papaparse');var Redis=require(_0xbcb4('0x10'));var authService=require(_0xbcb4('0x11'));var qs=require(_0xbcb4('0x12'));var as=require(_0xbcb4('0x13'));var hardwareService=require(_0xbcb4('0x14'));var logger=require('../../config/logger')(_0xbcb4('0x15'));var utils=require(_0xbcb4('0x16'));var config=require(_0xbcb4('0x17'));var db=require(_0xbcb4('0x18'))['db'];function respondWithStatusCode(_0x2ab411,_0x56be15){_0x56be15=_0x56be15||0xcc;return function(_0x5a3482){if(_0x5a3482){return _0x2ab411['sendStatus'](_0x56be15);}return _0x2ab411['status'](_0x56be15)[_0xbcb4('0x19')]();};}function respondWithResult(_0x2983d9,_0x450d77){_0x450d77=_0x450d77||0xc8;return function(_0x45084f){if(_0x45084f){return _0x2983d9['status'](_0x450d77)[_0xbcb4('0x1a')](_0x45084f);}};}function respondWithFilteredResult(_0x18b0fd,_0x401978){return function(_0x5264f0){if(_0x5264f0){var _0x393b5d=_0x5264f0['count'],_0x28c92b=_0x401978['offset'],_0xb2e565=_0x401978[_0xbcb4('0x1b')]+_0x401978[_0xbcb4('0x1c')],_0x573b50;if(_0xb2e565>=_0x393b5d){_0xb2e565=_0x393b5d;_0x573b50=0xc8;}else{_0x573b50=0xce;}_0x18b0fd[_0xbcb4('0x1d')](_0x573b50);return _0x18b0fd[_0xbcb4('0x1e')](_0xbcb4('0x1f'),_0x28c92b+'-'+_0xb2e565+'/'+_0x393b5d)['json'](_0x5264f0);}return null;};}function patchUpdates(_0x58c35a){return function(_0x218388){try{jsonpatch[_0xbcb4('0x20')](_0x218388,_0x58c35a,!![]);}catch(_0x1c4565){return BPromise[_0xbcb4('0x21')](_0x1c4565);}return _0x218388[_0xbcb4('0x22')]();};}function saveUpdates(_0xbeef7a,_0x48eccf){return function(_0x3c9d5a){if(_0x3c9d5a){return _0x3c9d5a[_0xbcb4('0x23')](_0xbeef7a)[_0xbcb4('0x24')](function(_0x1bd11b){return _0x1bd11b;});}return null;};}function removeEntity(_0x3ed0e8,_0x3ce9ad){return function(_0x42963f){if(_0x42963f){return _0x42963f[_0xbcb4('0x25')]()[_0xbcb4('0x24')](function(){var _0x843f49=_0x42963f[_0xbcb4('0x26')]({'plain':!![]});var _0x24ab69=_0xbcb4('0x27');return db[_0xbcb4('0x28')][_0xbcb4('0x25')]({'where':{'type':_0x24ab69,'resourceId':_0x843f49['id']}})[_0xbcb4('0x24')](function(){return _0x42963f;});})[_0xbcb4('0x24')](function(){_0x3ed0e8[_0xbcb4('0x1d')](0xcc)[_0xbcb4('0x19')]();});}};}function handleEntityNotFound(_0xf7397f,_0x48df76){return function(_0x57795a){if(!_0x57795a){_0xf7397f['sendStatus'](0x194);}return _0x57795a;};}function handleError(_0x4ffd45,_0xfe007){_0xfe007=_0xfe007||0x1f4;return function(_0x351208){logger['error'](_0x351208[_0xbcb4('0x29')]);if(_0x351208['name']){delete _0x351208[_0xbcb4('0x2a')];}_0x4ffd45[_0xbcb4('0x1d')](_0xfe007)[_0xbcb4('0x2b')](_0x351208);};}exports['index']=function(_0x3aebdb,_0x1cb967){var _0x4ebaf0={},_0x11db16={},_0x42b4e7={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0xbcb4('0x24')](function(_0x549b0b){_0x11db16[_0xbcb4('0x2c')]=_['keys'](_0x549b0b);_0x11db16['query']=_[_0xbcb4('0x2d')](_0x3aebdb['query']);_0x11db16[_0xbcb4('0x2e')]=_['intersection'](_0x11db16[_0xbcb4('0x2c')],_0x11db16[_0xbcb4('0x2f')]);_0x4ebaf0[_0xbcb4('0x30')]=_['intersection'](_0x11db16['model'],qs[_0xbcb4('0x31')](_0x3aebdb[_0xbcb4('0x2f')][_0xbcb4('0x31')]));_0x4ebaf0[_0xbcb4('0x30')]=_0x4ebaf0[_0xbcb4('0x30')][_0xbcb4('0x32')]?_0x4ebaf0[_0xbcb4('0x30')]:_0x11db16[_0xbcb4('0x2c')];if(!_0x3aebdb[_0xbcb4('0x2f')][_0xbcb4('0x33')](_0xbcb4('0x34'))){_0x4ebaf0['limit']=qs['limit'](_0x3aebdb[_0xbcb4('0x2f')]['limit']);_0x4ebaf0['offset']=qs['offset'](_0x3aebdb[_0xbcb4('0x2f')][_0xbcb4('0x1b')]);}_0x4ebaf0[_0xbcb4('0x35')]=qs[_0xbcb4('0x36')](_0x3aebdb[_0xbcb4('0x2f')]['sort']);_0x4ebaf0[_0xbcb4('0x37')]=qs[_0xbcb4('0x2e')](_[_0xbcb4('0x38')](_0x3aebdb['query'],_0x11db16['filters']),_0x549b0b);if(_0x3aebdb['query'][_0xbcb4('0x39')]){_0x4ebaf0[_0xbcb4('0x37')]=_[_0xbcb4('0x3a')](_0x4ebaf0[_0xbcb4('0x37')],{'$or':_[_0xbcb4('0x3b')](_0x4ebaf0[_0xbcb4('0x30')],function(_0x4c0bf5){var _0x58a72e={};_0x58a72e[_0x4c0bf5]={'$like':'%'+_0x3aebdb[_0xbcb4('0x2f')]['filter']+'%'};return _0x58a72e;})});}_0x4ebaf0=_[_0xbcb4('0x3a')]({},_0x4ebaf0,_0x3aebdb[_0xbcb4('0x3c')]);var _0x974e3b={'where':_0x4ebaf0[_0xbcb4('0x37')]};return db[_0xbcb4('0x3d')]['count'](_0x974e3b)[_0xbcb4('0x24')](function(_0xea8c00){_0x42b4e7[_0xbcb4('0x3e')]=_0xea8c00;if(_0x3aebdb[_0xbcb4('0x2f')][_0xbcb4('0x3f')]){_0x4ebaf0[_0xbcb4('0x40')]=[{'all':!![]}];}return db[_0xbcb4('0x3d')][_0xbcb4('0x41')](_0x4ebaf0);})[_0xbcb4('0x24')](function(_0x47d610){_0x42b4e7['rows']=_0x47d610;return _0x42b4e7;})[_0xbcb4('0x24')](respondWithFilteredResult(_0x1cb967,_0x4ebaf0))[_0xbcb4('0x42')](handleError(_0x1cb967,null));})[_0xbcb4('0x42')](handleError(_0x1cb967,null));};exports[_0xbcb4('0x43')]=function(_0x2e3279,_0x36e0c9){var _0x58eede={'raw':![],'where':{'id':_0x2e3279[_0xbcb4('0x44')]['id']}},_0x2c2b27={};_0x2c2b27[_0xbcb4('0x2c')]=_[_0xbcb4('0x2d')](db[_0xbcb4('0x3d')]['rawAttributes']);_0x2c2b27[_0xbcb4('0x2f')]=_[_0xbcb4('0x2d')](_0x2e3279[_0xbcb4('0x2f')]);_0x2c2b27[_0xbcb4('0x2e')]=_['intersection'](_0x2c2b27[_0xbcb4('0x2c')],_0x2c2b27[_0xbcb4('0x2f')]);_0x58eede[_0xbcb4('0x30')]=_[_0xbcb4('0x45')](_0x2c2b27[_0xbcb4('0x2c')],qs[_0xbcb4('0x31')](_0x2e3279['query'][_0xbcb4('0x31')]));_0x58eede[_0xbcb4('0x30')]=_0x58eede['attributes'][_0xbcb4('0x32')]?_0x58eede['attributes']:_0x2c2b27[_0xbcb4('0x2c')];if(_0x2e3279[_0xbcb4('0x2f')][_0xbcb4('0x3f')]){_0x58eede[_0xbcb4('0x40')]=[{'all':!![]}];}_0x58eede=_['merge']({},_0x58eede,_0x2e3279['options']);return db['CmCompany'][_0xbcb4('0x46')](_0x58eede)[_0xbcb4('0x24')](handleEntityNotFound(_0x36e0c9,null))[_0xbcb4('0x24')](respondWithResult(_0x36e0c9,null))[_0xbcb4('0x42')](handleError(_0x36e0c9,null));};exports['create']=function(_0x1528b5,_0x51b5a0){return db['CmCompany']['create'](_0x1528b5[_0xbcb4('0x47')],{})[_0xbcb4('0x24')](function(_0x1f4002){var _0x49e976=_0x1528b5[_0xbcb4('0x48')][_0xbcb4('0x26')]({'plain':!![]});if(!_0x49e976)throw new Error(_0xbcb4('0x49'));if(_0x49e976[_0xbcb4('0x4a')]===_0xbcb4('0x48')){var _0x4eadd0=_0x1f4002[_0xbcb4('0x26')]({'plain':!![]});var _0x2b2364=_0xbcb4('0x27');return db[_0xbcb4('0x4b')][_0xbcb4('0x46')]({'where':{'name':_0x2b2364,'userProfileId':_0x49e976[_0xbcb4('0x4c')]},'raw':!![]})[_0xbcb4('0x24')](function(_0x4396fb){if(_0x4396fb&&_0x4396fb[_0xbcb4('0x4d')]===0x0){return db[_0xbcb4('0x28')][_0xbcb4('0x4e')]({'name':_0x4eadd0[_0xbcb4('0x2a')],'resourceId':_0x4eadd0['id'],'type':_0x4396fb['name'],'sectionId':_0x4396fb['id']},{})[_0xbcb4('0x24')](function(){return _0x1f4002;});}else{return _0x1f4002;}})['catch'](function(_0xa69520){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa69520);throw _0xa69520;});}return _0x1f4002;})['then'](respondWithResult(_0x51b5a0,0xc9))[_0xbcb4('0x42')](handleError(_0x51b5a0,null));};exports[_0xbcb4('0x23')]=function(_0x2ace9d,_0xf95049){if(_0x2ace9d['body']['id']){delete _0x2ace9d[_0xbcb4('0x47')]['id'];}return db['CmCompany'][_0xbcb4('0x46')]({'where':{'id':_0x2ace9d[_0xbcb4('0x44')]['id']}})[_0xbcb4('0x24')](handleEntityNotFound(_0xf95049,null))[_0xbcb4('0x24')](saveUpdates(_0x2ace9d[_0xbcb4('0x47')],null))[_0xbcb4('0x24')](respondWithResult(_0xf95049,null))[_0xbcb4('0x42')](handleError(_0xf95049,null));};exports['destroy']=function(_0x1dafc3,_0x5c305e){return db['CmCompany'][_0xbcb4('0x46')]({'where':{'id':_0x1dafc3['params']['id']}})[_0xbcb4('0x24')](handleEntityNotFound(_0x5c305e,null))[_0xbcb4('0x24')](removeEntity(_0x5c305e,null))[_0xbcb4('0x42')](handleError(_0x5c305e,null));};exports[_0xbcb4('0x4f')]=function(_0x5addea,_0xa96541){return db[_0xbcb4('0x3d')][_0xbcb4('0x4f')]()[_0xbcb4('0x24')](respondWithResult(_0xa96541,null))[_0xbcb4('0x42')](handleError(_0xa96541,null));};exports['addContacts']=function(_0x3c2026,_0x57a8b4,_0x3e25fe){return db[_0xbcb4('0x50')][_0xbcb4('0x46')]({'where':{'id':_0x3c2026[_0xbcb4('0x44')]['id']}})['then'](handleEntityNotFound(_0x57a8b4,null))[_0xbcb4('0x24')](function(_0x31b758){if(_0x31b758){return _0x31b758[_0xbcb4('0x51')](_0x3c2026[_0xbcb4('0x47')][_0xbcb4('0x52')],_[_0xbcb4('0x53')](_0x3c2026[_0xbcb4('0x47')],[_0xbcb4('0x52'),'id'])||{});}})[_0xbcb4('0x24')](respondWithResult(_0x57a8b4,null))[_0xbcb4('0x42')](handleError(_0x57a8b4,null));};exports[_0xbcb4('0x54')]=function(_0x64979f,_0x4219b2,_0x4d26d1){var _0x161b4e={};var _0x53d7b2={};var _0x515e41;var _0xbd796b;return db[_0xbcb4('0x3d')][_0xbcb4('0x55')]({'where':{'id':_0x64979f[_0xbcb4('0x44')]['id']}})[_0xbcb4('0x24')](handleEntityNotFound(_0x4219b2,null))['then'](function(_0x5b2106){if(_0x5b2106){_0x515e41=_0x5b2106;_0x53d7b2[_0xbcb4('0x2c')]=_[_0xbcb4('0x2d')](db[_0xbcb4('0x50')][_0xbcb4('0x56')]);_0x53d7b2[_0xbcb4('0x2f')]=_[_0xbcb4('0x2d')](_0x64979f[_0xbcb4('0x2f')]);_0x53d7b2[_0xbcb4('0x2e')]=_[_0xbcb4('0x45')](_0x53d7b2['model'],_0x53d7b2[_0xbcb4('0x2f')]);_0x161b4e['attributes']=_[_0xbcb4('0x45')](_0x53d7b2[_0xbcb4('0x2c')],qs['fields'](_0x64979f[_0xbcb4('0x2f')][_0xbcb4('0x31')]));_0x161b4e[_0xbcb4('0x30')]=_0x161b4e['attributes']['length']?_0x161b4e[_0xbcb4('0x30')]:_0x53d7b2[_0xbcb4('0x2c')];_0x161b4e['order']=qs['sort'](_0x64979f[_0xbcb4('0x2f')]['sort']);_0x161b4e[_0xbcb4('0x37')]=qs[_0xbcb4('0x2e')](_['pick'](_0x64979f['query'],_0x53d7b2[_0xbcb4('0x2e')]));if(_0x64979f[_0xbcb4('0x2f')][_0xbcb4('0x39')]){_0x161b4e[_0xbcb4('0x37')]=_['merge'](_0x161b4e[_0xbcb4('0x37')],{'$or':_['map'](_0x161b4e[_0xbcb4('0x30')],function(_0x166619){var _0x704371={};_0x704371[_0x166619]={'$like':'%'+_0x64979f[_0xbcb4('0x2f')][_0xbcb4('0x39')]+'%'};return _0x704371;})});}_0x161b4e=_['merge']({},_0x161b4e,_0x64979f['options']);return _0x515e41[_0xbcb4('0x54')](_0x161b4e);}})[_0xbcb4('0x24')](function(_0x206ac6){if(_0x206ac6){_0xbd796b=_0x206ac6[_0xbcb4('0x32')];if(!_0x64979f['query'][_0xbcb4('0x33')](_0xbcb4('0x34'))){_0x161b4e[_0xbcb4('0x1c')]=qs[_0xbcb4('0x1c')](_0x64979f[_0xbcb4('0x2f')][_0xbcb4('0x1c')]);_0x161b4e[_0xbcb4('0x1b')]=qs[_0xbcb4('0x1b')](_0x64979f['query'][_0xbcb4('0x1b')]);}return _0x515e41[_0xbcb4('0x54')](_0x161b4e);}})[_0xbcb4('0x24')](function(_0x2520e6){if(_0x2520e6){return _0x2520e6?{'count':_0xbd796b,'rows':_0x2520e6}:null;}})['then'](respondWithResult(_0x4219b2,null))[_0xbcb4('0x42')](handleError(_0x4219b2,null));};
\ No newline at end of file
+var _0x4970=['to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','describe','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','find','create','CmCompany','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','getContacts','CmContact','sort','pick','map','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','jsforce','desk.js'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0x4970,0x9e));var _0x0497=function(_0x2801b2,_0x51ba40){_0x2801b2=_0x2801b2-0x0;var _0x2a80cd=_0x4970[_0x2801b2];return _0x2a80cd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0497('0x0'));var rimraf=require(_0x0497('0x1'));var zipdir=require(_0x0497('0x2'));var jsonpatch=require(_0x0497('0x3'));var rp=require(_0x0497('0x4'));var moment=require(_0x0497('0x5'));var BPromise=require(_0x0497('0x6'));var Mustache=require(_0x0497('0x7'));var util=require('util');var path=require(_0x0497('0x8'));var sox=require(_0x0497('0x9'));var csv=require('to-csv');var ejs=require(_0x0497('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0497('0xb'));var crypto=require('crypto');var jsforce=require(_0x0497('0xc'));var deskjs=require(_0x0497('0xd'));var toCsv=require(_0x0497('0xe'));var querystring=require(_0x0497('0xf'));var Papa=require(_0x0497('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0497('0x11'));var hardwareService=require(_0x0497('0x12'));var logger=require(_0x0497('0x13'))(_0x0497('0x14'));var utils=require(_0x0497('0x15'));var config=require('../../config/environment');var db=require(_0x0497('0x16'))['db'];function respondWithStatusCode(_0x2c3b84,_0x1ee44e){_0x1ee44e=_0x1ee44e||0xcc;return function(_0x352489){if(_0x352489){return _0x2c3b84[_0x0497('0x17')](_0x1ee44e);}return _0x2c3b84[_0x0497('0x18')](_0x1ee44e)[_0x0497('0x19')]();};}function respondWithResult(_0x3ad53e,_0x34d136){_0x34d136=_0x34d136||0xc8;return function(_0x5d2079){if(_0x5d2079){return _0x3ad53e[_0x0497('0x18')](_0x34d136)[_0x0497('0x1a')](_0x5d2079);}};}function respondWithFilteredResult(_0xa4ea30,_0x458dfd){return function(_0x43831a){if(_0x43831a){var _0x1c1067=_0x43831a[_0x0497('0x1b')],_0x389009=_0x458dfd[_0x0497('0x1c')],_0x4ab1b5=_0x458dfd['offset']+_0x458dfd['limit'],_0x5a7cc0;if(_0x4ab1b5>=_0x1c1067){_0x4ab1b5=_0x1c1067;_0x5a7cc0=0xc8;}else{_0x5a7cc0=0xce;}_0xa4ea30['status'](_0x5a7cc0);return _0xa4ea30[_0x0497('0x1d')](_0x0497('0x1e'),_0x389009+'-'+_0x4ab1b5+'/'+_0x1c1067)[_0x0497('0x1a')](_0x43831a);}return null;};}function patchUpdates(_0x198793){return function(_0x366526){try{jsonpatch[_0x0497('0x1f')](_0x366526,_0x198793,!![]);}catch(_0xdad44){return BPromise[_0x0497('0x20')](_0xdad44);}return _0x366526[_0x0497('0x21')]();};}function saveUpdates(_0x2042c5,_0x4f2974){return function(_0x26a5e9){if(_0x26a5e9){return _0x26a5e9[_0x0497('0x22')](_0x2042c5)[_0x0497('0x23')](function(_0x1ac48f){return _0x1ac48f;});}return null;};}function removeEntity(_0x5c209e,_0x73c494){return function(_0x5f0863){if(_0x5f0863){return _0x5f0863[_0x0497('0x24')]()['then'](function(){var _0x29740e=_0x5f0863[_0x0497('0x25')]({'plain':!![]});var _0x54dc94=_0x0497('0x26');return db[_0x0497('0x27')][_0x0497('0x24')]({'where':{'type':_0x54dc94,'resourceId':_0x29740e['id']}})[_0x0497('0x23')](function(){return _0x5f0863;});})['then'](function(){_0x5c209e[_0x0497('0x18')](0xcc)[_0x0497('0x19')]();});}};}function handleEntityNotFound(_0x2ab346,_0x2e8c68){return function(_0x4820c6){if(!_0x4820c6){_0x2ab346['sendStatus'](0x194);}return _0x4820c6;};}function handleError(_0x43012a,_0x529070){_0x529070=_0x529070||0x1f4;return function(_0x253ca7){logger[_0x0497('0x28')](_0x253ca7[_0x0497('0x29')]);if(_0x253ca7[_0x0497('0x2a')]){delete _0x253ca7[_0x0497('0x2a')];}_0x43012a[_0x0497('0x18')](_0x529070)[_0x0497('0x2b')](_0x253ca7);};}exports[_0x0497('0x2c')]=function(_0x4d3c8f,_0x27a834){var _0x578c8a={},_0x530333={},_0x2bfc8e={'count':0x0,'rows':[]};return db['CmCompany'][_0x0497('0x2d')]()[_0x0497('0x23')](function(_0x3bee15){_0x530333[_0x0497('0x2e')]=_['keys'](_0x3bee15);_0x530333[_0x0497('0x2f')]=_['keys'](_0x4d3c8f[_0x0497('0x2f')]);_0x530333[_0x0497('0x30')]=_[_0x0497('0x31')](_0x530333[_0x0497('0x2e')],_0x530333['query']);_0x578c8a[_0x0497('0x32')]=_[_0x0497('0x31')](_0x530333[_0x0497('0x2e')],qs[_0x0497('0x33')](_0x4d3c8f[_0x0497('0x2f')][_0x0497('0x33')]));_0x578c8a['attributes']=_0x578c8a[_0x0497('0x32')][_0x0497('0x34')]?_0x578c8a[_0x0497('0x32')]:_0x530333[_0x0497('0x2e')];if(!_0x4d3c8f[_0x0497('0x2f')][_0x0497('0x35')](_0x0497('0x36'))){_0x578c8a[_0x0497('0x37')]=qs[_0x0497('0x37')](_0x4d3c8f['query'][_0x0497('0x37')]);_0x578c8a[_0x0497('0x1c')]=qs[_0x0497('0x1c')](_0x4d3c8f['query']['offset']);}_0x578c8a[_0x0497('0x38')]=qs['sort'](_0x4d3c8f[_0x0497('0x2f')]['sort']);_0x578c8a[_0x0497('0x39')]=qs['filters'](_['pick'](_0x4d3c8f['query'],_0x530333[_0x0497('0x30')]),_0x3bee15);if(_0x4d3c8f[_0x0497('0x2f')][_0x0497('0x3a')]){_0x578c8a[_0x0497('0x39')]=_[_0x0497('0x3b')](_0x578c8a[_0x0497('0x39')],{'$or':_['map'](_0x578c8a[_0x0497('0x32')],function(_0xcc03b){var _0x393a24={};_0x393a24[_0xcc03b]={'$like':'%'+_0x4d3c8f['query'][_0x0497('0x3a')]+'%'};return _0x393a24;})});}_0x578c8a=_[_0x0497('0x3b')]({},_0x578c8a,_0x4d3c8f['options']);var _0x2895b4={'where':_0x578c8a['where']};return db['CmCompany']['count'](_0x2895b4)['then'](function(_0x4ebed3){_0x2bfc8e[_0x0497('0x1b')]=_0x4ebed3;if(_0x4d3c8f[_0x0497('0x2f')][_0x0497('0x3c')]){_0x578c8a[_0x0497('0x3d')]=[{'all':!![]}];}return db['CmCompany'][_0x0497('0x3e')](_0x578c8a);})[_0x0497('0x23')](function(_0x8ea876){_0x2bfc8e[_0x0497('0x3f')]=_0x8ea876;return _0x2bfc8e;})[_0x0497('0x23')](respondWithFilteredResult(_0x27a834,_0x578c8a))[_0x0497('0x40')](handleError(_0x27a834,null));})['catch'](handleError(_0x27a834,null));};exports['show']=function(_0x47cbe7,_0x25ceb5){var _0x14b71d={'raw':![],'where':{'id':_0x47cbe7[_0x0497('0x41')]['id']}},_0x389c1e={};_0x389c1e[_0x0497('0x2e')]=_['keys'](db['CmCompany'][_0x0497('0x42')]);_0x389c1e[_0x0497('0x2f')]=_[_0x0497('0x43')](_0x47cbe7[_0x0497('0x2f')]);_0x389c1e[_0x0497('0x30')]=_[_0x0497('0x31')](_0x389c1e['model'],_0x389c1e[_0x0497('0x2f')]);_0x14b71d[_0x0497('0x32')]=_[_0x0497('0x31')](_0x389c1e[_0x0497('0x2e')],qs[_0x0497('0x33')](_0x47cbe7[_0x0497('0x2f')][_0x0497('0x33')]));_0x14b71d['attributes']=_0x14b71d['attributes'][_0x0497('0x34')]?_0x14b71d[_0x0497('0x32')]:_0x389c1e[_0x0497('0x2e')];if(_0x47cbe7[_0x0497('0x2f')][_0x0497('0x3c')]){_0x14b71d['include']=[{'all':!![]}];}_0x14b71d=_['merge']({},_0x14b71d,_0x47cbe7['options']);return db['CmCompany'][_0x0497('0x44')](_0x14b71d)[_0x0497('0x23')](handleEntityNotFound(_0x25ceb5,null))[_0x0497('0x23')](respondWithResult(_0x25ceb5,null))[_0x0497('0x40')](handleError(_0x25ceb5,null));};exports[_0x0497('0x45')]=function(_0x2f009d,_0x36906f){return db[_0x0497('0x46')][_0x0497('0x45')](_0x2f009d[_0x0497('0x47')],{})[_0x0497('0x23')](function(_0x58baac){var _0x361f52=_0x2f009d['user'][_0x0497('0x25')]({'plain':!![]});if(!_0x361f52)throw new Error(_0x0497('0x48'));if(_0x361f52['role']===_0x0497('0x49')){var _0x4efbfe=_0x58baac['get']({'plain':!![]});var _0x2b5701=_0x0497('0x26');return db[_0x0497('0x4a')]['find']({'where':{'name':_0x2b5701,'userProfileId':_0x361f52[_0x0497('0x4b')]},'raw':!![]})['then'](function(_0x40c9b0){if(_0x40c9b0&&_0x40c9b0[_0x0497('0x4c')]===0x0){return db['UserProfileResource'][_0x0497('0x45')]({'name':_0x4efbfe[_0x0497('0x2a')],'resourceId':_0x4efbfe['id'],'type':_0x40c9b0[_0x0497('0x2a')],'sectionId':_0x40c9b0['id']},{})[_0x0497('0x23')](function(){return _0x58baac;});}else{return _0x58baac;}})['catch'](function(_0x21d57c){logger[_0x0497('0x28')](_0x0497('0x4d'),_0x21d57c);throw _0x21d57c;});}return _0x58baac;})['then'](respondWithResult(_0x36906f,0xc9))[_0x0497('0x40')](handleError(_0x36906f,null));};exports[_0x0497('0x22')]=function(_0x152c78,_0x438111){if(_0x152c78[_0x0497('0x47')]['id']){delete _0x152c78[_0x0497('0x47')]['id'];}return db['CmCompany'][_0x0497('0x44')]({'where':{'id':_0x152c78[_0x0497('0x41')]['id']}})[_0x0497('0x23')](handleEntityNotFound(_0x438111,null))[_0x0497('0x23')](saveUpdates(_0x152c78[_0x0497('0x47')],null))[_0x0497('0x23')](respondWithResult(_0x438111,null))['catch'](handleError(_0x438111,null));};exports[_0x0497('0x24')]=function(_0x21bc53,_0x44fe01){return db[_0x0497('0x46')][_0x0497('0x44')]({'where':{'id':_0x21bc53[_0x0497('0x41')]['id']}})[_0x0497('0x23')](handleEntityNotFound(_0x44fe01,null))[_0x0497('0x23')](removeEntity(_0x44fe01,null))[_0x0497('0x40')](handleError(_0x44fe01,null));};exports[_0x0497('0x2d')]=function(_0x2f5771,_0x22f38a){return db[_0x0497('0x46')][_0x0497('0x2d')]()['then'](respondWithResult(_0x22f38a,null))[_0x0497('0x40')](handleError(_0x22f38a,null));};exports['addContacts']=function(_0x1edcdf,_0x510c2e,_0x32114f){return db['CmContact'][_0x0497('0x44')]({'where':{'id':_0x1edcdf[_0x0497('0x41')]['id']}})[_0x0497('0x23')](handleEntityNotFound(_0x510c2e,null))[_0x0497('0x23')](function(_0x5be96b){if(_0x5be96b){return _0x5be96b[_0x0497('0x4e')](_0x1edcdf[_0x0497('0x47')][_0x0497('0x4f')],_['omit'](_0x1edcdf[_0x0497('0x47')],[_0x0497('0x4f'),'id'])||{});}})[_0x0497('0x23')](respondWithResult(_0x510c2e,null))[_0x0497('0x40')](handleError(_0x510c2e,null));};exports[_0x0497('0x50')]=function(_0x6f1c97,_0x5e22a7,_0x417cf2){var _0xf30dc8={};var _0x55ce85={};var _0x1203a3;var _0x3a59ad;return db['CmCompany']['findOne']({'where':{'id':_0x6f1c97['params']['id']}})['then'](handleEntityNotFound(_0x5e22a7,null))[_0x0497('0x23')](function(_0x47980e){if(_0x47980e){_0x1203a3=_0x47980e;_0x55ce85[_0x0497('0x2e')]=_[_0x0497('0x43')](db[_0x0497('0x51')]['rawAttributes']);_0x55ce85['query']=_[_0x0497('0x43')](_0x6f1c97[_0x0497('0x2f')]);_0x55ce85[_0x0497('0x30')]=_['intersection'](_0x55ce85[_0x0497('0x2e')],_0x55ce85['query']);_0xf30dc8[_0x0497('0x32')]=_[_0x0497('0x31')](_0x55ce85[_0x0497('0x2e')],qs[_0x0497('0x33')](_0x6f1c97['query'][_0x0497('0x33')]));_0xf30dc8['attributes']=_0xf30dc8[_0x0497('0x32')][_0x0497('0x34')]?_0xf30dc8['attributes']:_0x55ce85[_0x0497('0x2e')];_0xf30dc8[_0x0497('0x38')]=qs[_0x0497('0x52')](_0x6f1c97[_0x0497('0x2f')]['sort']);_0xf30dc8[_0x0497('0x39')]=qs['filters'](_[_0x0497('0x53')](_0x6f1c97[_0x0497('0x2f')],_0x55ce85['filters']));if(_0x6f1c97[_0x0497('0x2f')][_0x0497('0x3a')]){_0xf30dc8[_0x0497('0x39')]=_[_0x0497('0x3b')](_0xf30dc8[_0x0497('0x39')],{'$or':_[_0x0497('0x54')](_0xf30dc8[_0x0497('0x32')],function(_0x39a16f){var _0x1a5670={};_0x1a5670[_0x39a16f]={'$like':'%'+_0x6f1c97[_0x0497('0x2f')][_0x0497('0x3a')]+'%'};return _0x1a5670;})});}_0xf30dc8=_[_0x0497('0x3b')]({},_0xf30dc8,_0x6f1c97[_0x0497('0x55')]);return _0x1203a3[_0x0497('0x50')](_0xf30dc8);}})[_0x0497('0x23')](function(_0x4c4029){if(_0x4c4029){_0x3a59ad=_0x4c4029[_0x0497('0x34')];if(!_0x6f1c97[_0x0497('0x2f')][_0x0497('0x35')]('nolimit')){_0xf30dc8['limit']=qs[_0x0497('0x37')](_0x6f1c97['query'][_0x0497('0x37')]);_0xf30dc8[_0x0497('0x1c')]=qs[_0x0497('0x1c')](_0x6f1c97[_0x0497('0x2f')][_0x0497('0x1c')]);}return _0x1203a3['getContacts'](_0xf30dc8);}})['then'](function(_0x53e7dc){if(_0x53e7dc){return _0x53e7dc?{'count':_0x3a59ad,'rows':_0x53e7dc}:null;}})[_0x0497('0x23')](respondWithResult(_0x5e22a7,null))[_0x0497('0x40')](handleError(_0x5e22a7,null));};
\ No newline at end of file
index 137bdd2..15bd8c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99e3=['rimraf','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x99e3,0x1b5));var _0x399e=function(_0x13a6b2,_0x44736a){_0x13a6b2=_0x13a6b2-0x0;var _0x329bcf=_0x99e3[_0x13a6b2];return _0x329bcf;};'use strict';var _=require(_0x399e('0x0'));var util=require(_0x399e('0x1'));var logger=require(_0x399e('0x2'))(_0x399e('0x3'));var moment=require('moment');var BPromise=require(_0x399e('0x4'));var rp=require(_0x399e('0x5'));var fs=require('fs');var path=require(_0x399e('0x6'));var rimraf=require(_0x399e('0x7'));var config=require('../../config/environment');var attributes=require(_0x399e('0x8'));module[_0x399e('0x9')]=function(_0x280375,_0x16be2d){return _0x280375[_0x399e('0xa')](_0x399e('0xb'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8188=['api','moment','request-promise','path','../../config/environment','./cmCompany.attributes','exports','../../config/logger'];(function(_0xda6385,_0x405eab){var _0x5d1042=function(_0x315751){while(--_0x315751){_0xda6385['push'](_0xda6385['shift']());}};_0x5d1042(++_0x405eab);}(_0x8188,0x1bf));var _0x8818=function(_0x104306,_0x4c00eb){_0x104306=_0x104306-0x0;var _0xdba9c1=_0x8188[_0x104306];return _0xdba9c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8818('0x0'))(_0x8818('0x1'));var moment=require(_0x8818('0x2'));var BPromise=require('bluebird');var rp=require(_0x8818('0x3'));var fs=require('fs');var path=require(_0x8818('0x4'));var rimraf=require('rimraf');var config=require(_0x8818('0x5'));var attributes=require(_0x8818('0x6'));module[_0x8818('0x7')]=function(_0x11a708,_0x26c77c){return _0x11a708['define']('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9856a31..3debc22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x479c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x479c,0x15e));var _0xc479=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x479c[_0x40a825];return _0x273a54;};'use strict';var _=require(_0xc479('0x0'));var util=require(_0xc479('0x1'));var moment=require(_0xc479('0x2'));var BPromise=require(_0xc479('0x3'));var rs=require(_0xc479('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc479('0x5'))['db'];var utils=require(_0xc479('0x6'));var logger=require(_0xc479('0x7'))(_0xc479('0x8'));var config=require('../../config/environment');var jayson=require(_0xc479('0x9'));var client=jayson['client'][_0xc479('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d9adf,_0x10b2bc,_0x43f20b){return new BPromise(function(_0x83fd93,_0x4d49af){return client[_0xc479('0xb')](_0x3d9adf,_0x43f20b)[_0xc479('0xc')](function(_0x403f6f){logger[_0xc479('0xd')](_0xc479('0xe'),_0x10b2bc,_0xc479('0xf'));logger['debug'](_0xc479('0x10'),_0x10b2bc,'request\x20sent',JSON[_0xc479('0x11')](_0x403f6f));if(_0x403f6f[_0xc479('0x12')]){if(_0x403f6f[_0xc479('0x12')][_0xc479('0x13')]===0x1f4){logger[_0xc479('0x12')](_0xc479('0xe'),_0x10b2bc,_0x403f6f[_0xc479('0x12')][_0xc479('0x14')]);return _0x4d49af(_0x403f6f[_0xc479('0x12')][_0xc479('0x14')]);}logger['error'](_0xc479('0xe'),_0x10b2bc,_0x403f6f['error'][_0xc479('0x14')]);return _0x83fd93(_0x403f6f[_0xc479('0x12')][_0xc479('0x14')]);}else{logger[_0xc479('0xd')](_0xc479('0xe'),_0x10b2bc,_0xc479('0xf'));_0x83fd93(_0x403f6f[_0xc479('0x15')][_0xc479('0x14')]);}})['catch'](function(_0x195ef3){logger[_0xc479('0x12')](_0xc479('0xe'),_0x10b2bc,_0x195ef3);_0x4d49af(_0x195ef3);});});}
\ No newline at end of file
+var _0x2258=['CmCompany,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x25c262,_0x32d62f){var _0x36e27b=function(_0x4cf1b1){while(--_0x4cf1b1){_0x25c262['push'](_0x25c262['shift']());}};_0x36e27b(++_0x32d62f);}(_0x2258,0x15c));var _0x8225=function(_0x1dcd65,_0x121c96){_0x1dcd65=_0x1dcd65-0x0;var _0x2000ca=_0x2258[_0x1dcd65];return _0x2000ca;};'use strict';var _=require(_0x8225('0x0'));var util=require('util');var moment=require(_0x8225('0x1'));var BPromise=require(_0x8225('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8225('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8225('0x4'));var logger=require(_0x8225('0x5'))(_0x8225('0x6'));var config=require(_0x8225('0x7'));var jayson=require(_0x8225('0x8'));var client=jayson['client'][_0x8225('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4aa307,_0x4777fc,_0x4e5e29){return new BPromise(function(_0x2d84b5,_0x100de4){return client[_0x8225('0xa')](_0x4aa307,_0x4e5e29)[_0x8225('0xb')](function(_0x48cb9d){logger['info'](_0x8225('0xc'),_0x4777fc,_0x8225('0xd'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x4777fc,_0x8225('0xd'),JSON[_0x8225('0xe')](_0x48cb9d));if(_0x48cb9d[_0x8225('0xf')]){if(_0x48cb9d['error'][_0x8225('0x10')]===0x1f4){logger['error'](_0x8225('0xc'),_0x4777fc,_0x48cb9d[_0x8225('0xf')][_0x8225('0x11')]);return _0x100de4(_0x48cb9d['error'][_0x8225('0x11')]);}logger[_0x8225('0xf')]('CmCompany,\x20%s,\x20%s',_0x4777fc,_0x48cb9d['error'][_0x8225('0x11')]);return _0x2d84b5(_0x48cb9d[_0x8225('0xf')][_0x8225('0x11')]);}else{logger['info'](_0x8225('0xc'),_0x4777fc,'request\x20sent');_0x2d84b5(_0x48cb9d['result'][_0x8225('0x11')]);}})['catch'](function(_0x232693){logger['error'](_0x8225('0xc'),_0x4777fc,_0x232693);_0x100de4(_0x232693);});});}
\ No newline at end of file
index 51d180d..7031cc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','getContacts','post','create','addContacts','put','update','destroy','exports','path','connect-timeout'];(function(_0x164ebe,_0x1f6a00){var _0x170934=function(_0x26dac2){while(--_0x26dac2){_0x164ebe['push'](_0x164ebe['shift']());}};_0x170934(++_0x1f6a00);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0xe')]('/',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0xe')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x49c4('0x10')]);router[_0x49c4('0x11')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x12')]);router['delete'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);module[_0x49c4('0x14')]=router;
\ No newline at end of file
+var _0x9957=['../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmCompany.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0xe'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router;
\ No newline at end of file
index 88710fd..8099cee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0854=['lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x4e0dd6,_0x3c28bc){var _0x59ff85=function(_0x217af5){while(--_0x217af5){_0x4e0dd6['push'](_0x4e0dd6['shift']());}};_0x59ff85(++_0x3c28bc);}(_0x0854,0xd9));var _0x4085=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0854[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4085('0x0'));var Sequelize=require('sequelize');module[_0x4085('0x1')]={'firstName':{'type':Sequelize[_0x4085('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x4085('0x2')]},'postalCode':{'type':Sequelize[_0x4085('0x2')]},'city':{'type':Sequelize[_0x4085('0x2')]},'country':{'type':Sequelize[_0x4085('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4085('0x3')]},'phone':{'type':Sequelize[_0x4085('0x2')]},'mobile':{'type':Sequelize[_0x4085('0x2')]},'fax':{'type':Sequelize[_0x4085('0x2')]},'email':{'type':Sequelize[_0x4085('0x2')]},'url':{'type':Sequelize[_0x4085('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x4085('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x4085('0x2')]},'viber':{'type':Sequelize[_0x4085('0x2')]},'line':{'type':Sequelize[_0x4085('0x2')]},'wechat':{'type':Sequelize[_0x4085('0x2')]},'telegram':{'type':Sequelize[_0x4085('0x2')]},'UserId':{'type':Sequelize[_0x4085('0x4')]},'priority':{'type':Sequelize[_0x4085('0x4')](0x2)[_0x4085('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x4085('0x6')]},'dialTimezone':{'type':Sequelize[_0x4085('0x2')]},'utcOffset':{'type':Sequelize[_0x4085('0x4')]}};
\ No newline at end of file
+var _0xc17d=['DATE','NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x1a619b,_0x350a35){var _0x1876b9=function(_0x2541ab){while(--_0x2541ab){_0x1a619b['push'](_0x1a619b['shift']());}};_0x1876b9(++_0x350a35);}(_0xc17d,0x102));var _0xdc17=function(_0x3474c0,_0x512bce){_0x3474c0=_0x3474c0-0x0;var _0x2eda5f=_0xc17d[_0x3474c0];return _0x2eda5f;};'use strict';var _=require(_0xdc17('0x0'));var Sequelize=require('sequelize');module[_0xdc17('0x1')]={'firstName':{'type':Sequelize[_0xdc17('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xdc17('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xdc17('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xdc17('0x2')]},'dateOfBirth':{'type':Sequelize[_0xdc17('0x2')]},'description':{'type':Sequelize[_0xdc17('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xdc17('0x2')]},'fax':{'type':Sequelize[_0xdc17('0x2')]},'email':{'type':Sequelize[_0xdc17('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xdc17('0x2')]},'viber':{'type':Sequelize[_0xdc17('0x2')]},'line':{'type':Sequelize[_0xdc17('0x2')]},'wechat':{'type':Sequelize[_0xdc17('0x2')]},'telegram':{'type':Sequelize[_0xdc17('0x2')]},'UserId':{'type':Sequelize[_0xdc17('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xdc17('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xdc17('0x6')],'defaultValue':Sequelize[_0xdc17('0x7')]},'dialTimezone':{'type':Sequelize[_0xdc17('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 4806439..ad5d1fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fc1=['clone','order','t.id\x20IN\x20?','resolve','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','c.firstName','c.phone','c.email','c.ListId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','displayName','findAll','alias','custom','values','merge','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','create','duplicates','$or','ListId','spread','show','omit','format','pickBy','cf_%d','setFields','text','phone','getTags','Tag','rawAttributes','setTags','ids','getHoppers','options','getHopperHistories','ContactId','includeAll','include','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','file','chmodSync','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','path','parse','import','User','agent','No\x20ListId\x20specified','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','CmContact','describe','keys','length','startsWith','push','CmCustomField','findOne','cf_','all','fieldType','type','query','filters','intersection','attributes','fields','model','nolimit','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','search','sqlOperator','conditions','find','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','value','start','hasOwnProperty','filter','isNil','Contact','isEmpty','forEach','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','\x27\x27\x27\x27','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','SELECT'];(function(_0x35eb61,_0x4a6eae){var _0xb88e8e=function(_0x3525cd){while(--_0x3525cd){_0x35eb61['push'](_0x35eb61['shift']());}};_0xb88e8e(++_0x4a6eae);}(_0x7fc1,0x6f));var _0x17fc=function(_0x143b77,_0x285014){_0x143b77=_0x143b77-0x0;var _0x2025ae=_0x7fc1[_0x143b77];return _0x2025ae;};'use strict';var pdf=require(_0x17fc('0x0'));var emlformat=require(_0x17fc('0x1'));var rimraf=require(_0x17fc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x17fc('0x3'));var rp=require(_0x17fc('0x4'));var moment=require(_0x17fc('0x5'));var BPromise=require(_0x17fc('0x6'));var Mustache=require('mustache');var util=require(_0x17fc('0x7'));var path=require('path');var sox=require(_0x17fc('0x8'));var csv=require(_0x17fc('0x9'));var ejs=require(_0x17fc('0xa'));var fs=require('fs');var _=require(_0x17fc('0xb'));var squel=require(_0x17fc('0xc'));var crypto=require(_0x17fc('0xd'));var jsforce=require(_0x17fc('0xe'));var deskjs=require(_0x17fc('0xf'));var toCsv=require('to-csv');var querystring=require(_0x17fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x17fc('0x11'));var authService=require(_0x17fc('0x12'));var qs=require(_0x17fc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x17fc('0x14'));var logger=require(_0x17fc('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x17fc('0x16'));var db=require('../../mysqldb')['db'];config[_0x17fc('0x17')]=_[_0x17fc('0x18')](config[_0x17fc('0x17')],{'host':_0x17fc('0x19'),'port':0x18eb});var socket=require(_0x17fc('0x1a'))(new Redis(config['redis']));require(_0x17fc('0x1b'))[_0x17fc('0x1c')](socket);function respondWithStatusCode(_0x1c49a8,_0x3d1759){_0x3d1759=_0x3d1759||0xcc;return function(_0x4aa0e5){if(_0x4aa0e5){return _0x1c49a8[_0x17fc('0x1d')](_0x3d1759);}return _0x1c49a8['status'](_0x3d1759)[_0x17fc('0x1e')]();};}function respondWithResult(_0x42188f,_0x318764){_0x318764=_0x318764||0xc8;return function(_0x3989d8){if(_0x3989d8){return _0x42188f[_0x17fc('0x1f')](_0x318764)[_0x17fc('0x20')](_0x3989d8);}};}function respondWithFilteredResult(_0x1ed025,_0x3c741c){return function(_0x2da25e){if(_0x2da25e){var _0x59b1c3=_0x2da25e[_0x17fc('0x21')],_0x4959e8=_0x3c741c['offset'],_0xf3b206=_0x3c741c[_0x17fc('0x22')]+_0x3c741c[_0x17fc('0x23')],_0x388cfc;if(_0xf3b206>=_0x59b1c3){_0xf3b206=_0x59b1c3;_0x388cfc=0xc8;}else{_0x388cfc=0xce;}_0x1ed025[_0x17fc('0x1f')](_0x388cfc);return _0x1ed025[_0x17fc('0x24')](_0x17fc('0x25'),_0x4959e8+'-'+_0xf3b206+'/'+_0x59b1c3)['json'](_0x2da25e);}return null;};}function patchUpdates(_0x94de9a){return function(_0x5b6cc8){try{jsonpatch[_0x17fc('0x26')](_0x5b6cc8,_0x94de9a,!![]);}catch(_0x317e3b){return BPromise[_0x17fc('0x27')](_0x317e3b);}return _0x5b6cc8[_0x17fc('0x28')]();};}function saveUpdates(_0x3cfc81,_0x1a6b27){return function(_0xaa2bea){if(_0xaa2bea){return _0xaa2bea[_0x17fc('0x29')](_0x3cfc81)[_0x17fc('0x2a')](function(_0x444cf8){return _0x444cf8;});}return null;};}function removeEntity(_0x3143c0,_0x17da30){return function(_0x1c4047){if(_0x1c4047){return _0x1c4047[_0x17fc('0x2b')]()['then'](function(){_0x3143c0[_0x17fc('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b89c4,_0x164bef){return function(_0xd17f06){if(!_0xd17f06){_0x5b89c4['sendStatus'](0x194);}return _0xd17f06;};}function handleError(_0x5a7b75,_0x2d6165){_0x2d6165=_0x2d6165||0x1f4;return function(_0x374950){logger[_0x17fc('0x2c')](_0x374950[_0x17fc('0x2d')]);if(_0x374950['name']){delete _0x374950[_0x17fc('0x2e')];}_0x5a7b75['status'](_0x2d6165)['send'](_0x374950);};}exports['index']=function(_0x86a9a6,_0x24092c){var _0x35bab5={},_0x2bf794={},_0x509649={'count':0x0,'rows':[]};return db[_0x17fc('0x2f')][_0x17fc('0x30')]()[_0x17fc('0x2a')](function(_0x3683bf){var _0x140048=[];for(var _0x207eca=0x0;_0x207eca<Object[_0x17fc('0x31')](_0x3683bf)[_0x17fc('0x32')];_0x207eca++){var _0x57a38f=Object[_0x17fc('0x31')](_0x3683bf)[_0x207eca];if(_[_0x17fc('0x33')](_0x57a38f,'cf_')){_0x140048[_0x17fc('0x34')](db[_0x17fc('0x35')][_0x17fc('0x36')]({'where':{'id':_['trimStart'](_0x57a38f,_0x17fc('0x37'))},'raw':!![]}));}}return BPromise[_0x17fc('0x38')](_0x140048)[_0x17fc('0x2a')](function(_0x59c496){for(var _0xfe8c77=0x0;_0xfe8c77<_0x59c496['length'];_0xfe8c77++){if(_0x59c496[_0xfe8c77]){var _0x58b431=_0x17fc('0x37')+_0x59c496[_0xfe8c77]['id'];var _0x4481c6=_0x3683bf[_0x58b431];_0x4481c6[_0x17fc('0x39')]=_0x59c496[_0xfe8c77][_0x17fc('0x3a')];}}return _0x3683bf;});})['then'](function(_0x15b4ae){_0x2bf794['model']=_[_0x17fc('0x31')](_0x15b4ae);_0x2bf794[_0x17fc('0x3b')]=_['keys'](_0x86a9a6[_0x17fc('0x3b')]);_0x2bf794[_0x17fc('0x3c')]=_[_0x17fc('0x3d')](_0x2bf794['model'],_0x2bf794[_0x17fc('0x3b')]);_0x35bab5[_0x17fc('0x3e')]=_[_0x17fc('0x3d')](_0x2bf794['model'],qs[_0x17fc('0x3f')](_0x86a9a6[_0x17fc('0x3b')][_0x17fc('0x3f')]));_0x35bab5[_0x17fc('0x3e')]=_0x35bab5[_0x17fc('0x3e')][_0x17fc('0x32')]?_0x35bab5[_0x17fc('0x3e')]:_0x2bf794[_0x17fc('0x40')];if(!_0x86a9a6[_0x17fc('0x3b')]['hasOwnProperty'](_0x17fc('0x41'))){_0x35bab5[_0x17fc('0x23')]=qs['limit'](_0x86a9a6[_0x17fc('0x3b')][_0x17fc('0x23')]);_0x35bab5[_0x17fc('0x22')]=qs[_0x17fc('0x22')](_0x86a9a6[_0x17fc('0x3b')][_0x17fc('0x22')]);}_0x35bab5['order']=qs['sort'](_0x86a9a6[_0x17fc('0x3b')][_0x17fc('0x42')]);_0x35bab5[_0x17fc('0x43')]=qs[_0x17fc('0x3c')](_[_0x17fc('0x44')](_0x86a9a6['query'],_0x2bf794[_0x17fc('0x3c')]),_0x15b4ae);var _0xa72d9f=[];var _0x3bbe0f=squel[_0x17fc('0x45')]()['field']('id')[_0x17fc('0x46')]('name')['field'](_0x17fc('0x47'))[_0x17fc('0x48')](_0x17fc('0x49'));var _0x836b9d=squel[_0x17fc('0x45')]()['from'](_0x17fc('0x4a'),'c')[_0x17fc('0x4b')]('cm_user_has_contacts','uc',_0x17fc('0x4c'))[_0x17fc('0x4b')](_0x17fc('0x4d'),'ct',_0x17fc('0x4e'))[_0x17fc('0x4b')](_0x17fc('0x49'),'t',_0x17fc('0x4f'))[_0x17fc('0x43')](_0x17fc('0x50'));var _0x4b9d1e=squel['expr']();var _0x2e3395=[];var _0x52abca=squel[_0x17fc('0x51')]();var _0x29367f;if(_0x86a9a6['query']['search']){_0x29367f=as[_0x17fc('0x52')](_0x86a9a6['query'][_0x17fc('0x53')]);var _0x9eb90b=_0x29367f[_0x17fc('0x54')];for(var _0x226104=0x0;_0x226104<_0x29367f[_0x17fc('0x55')][_0x17fc('0x32')];_0x226104++){var _0x2be29f=_0x29367f[_0x17fc('0x55')][_0x226104];var _0x11a9b4='c';var _0x38bf09=_(_0x15b4ae)['keys']()[_0x17fc('0x56')](function(_0x2db111){return _0x2db111===_0x2be29f[_0x17fc('0x46')];});if(_0x38bf09)_0x38bf09=_0x15b4ae[_0x2be29f[_0x17fc('0x46')]];if(!_0x38bf09){if(_0x2be29f[_0x17fc('0x46')]==='Tag'){var _0x348fbf=_0x2be29f['value'][_0x17fc('0x57')](',')[_0x17fc('0x58')](function(_0x7ae30a){return Number(_0x7ae30a);});_0x348fbf['forEach'](function(_0x95a381){_0x52abca['or'](_0x17fc('0x59'),'%,'+_0x95a381+',%');});_0x2e3395=_['union'](_0x2e3395,_0x348fbf);}else if(_0x2be29f[_0x17fc('0x46')]==='User'){_0x4b9d1e[_0x17fc('0x5a')](_0x17fc('0x5b'),_0x2be29f['value']);}}else{if(_0x2be29f['field']===_0x17fc('0x5c')||_0x38bf09[_0x17fc('0x39')]===_0x17fc('0x5d'))_0x2be29f[_0x17fc('0x5e')]=_0x17fc('0x5f');var _0x1861ea=as[_0x17fc('0x60')](_0x11a9b4,_0x38bf09[_0x17fc('0x3a')],_0x2be29f);_0x4b9d1e[_0x9eb90b](_0x1861ea['text'],_0x1861ea[_0x17fc('0x61')][_0x17fc('0x62')],_0x1861ea[_0x17fc('0x61')][_0x17fc('0x1e')]);}}}else{var _0x3698e5=_(Object[_0x17fc('0x31')](_0x86a9a6[_0x17fc('0x3b')]))[_0x17fc('0x58')](function(_0x340371){return _0x15b4ae[_0x17fc('0x63')](_0x340371)?_0x340371:undefined;})[_0x17fc('0x64')](function(_0x527a1f){return!_[_0x17fc('0x65')](_0x527a1f);})[_0x17fc('0x61')]();if(_0x86a9a6[_0x17fc('0x3b')][_0x17fc('0x66')])_0x3698e5['push'](_0x17fc('0x66'));if(!_[_0x17fc('0x67')](_0x3698e5)){_0x3698e5[_0x17fc('0x68')](function(_0x166766){if(_0x166766==='ListId'){_0x836b9d[_0x17fc('0x43')](_0x17fc('0x69'),[]['concat'](_0x86a9a6[_0x17fc('0x3b')][_0x166766]));}else if(_0x166766===_0x17fc('0x66')){var _0x292c72='%'+_0x86a9a6[_0x17fc('0x3b')][_0x166766]+'%';_0x836b9d[_0x17fc('0x43')](_0x17fc('0x6a'),_0x292c72);}else{_0x836b9d['where']('c.'+_0x166766+_0x17fc('0x6b'),_0x86a9a6[_0x17fc('0x3b')][_0x166766]);}});}if(_0x86a9a6[_0x17fc('0x3b')]['tag']){_0x2e3395=_[_0x17fc('0x6c')](_0x86a9a6[_0x17fc('0x3b')][_0x17fc('0x6d')])?_0x86a9a6[_0x17fc('0x3b')][_0x17fc('0x6d')]:new Array(_0x86a9a6[_0x17fc('0x3b')]['tag']);_0x2e3395['forEach'](function(_0x16895d){_0x52abca['or'](_0x17fc('0x59'),'%,'+_0x16895d+',%');});}if(_0x86a9a6['query'][_0x17fc('0x64')]){var _0x40de5f=_0x86a9a6[_0x17fc('0x3b')][_0x17fc('0x64')][_0x17fc('0x6e')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x17fc('0x6f'));if(_0x40de5f[_0x17fc('0x57')]('\x20')['length']>0x1){_0x4b9d1e['or'](_0x17fc('0x70'),qs[_0x17fc('0x71')](_0x40de5f),null);}else{if(qs[_0x17fc('0x72')](_0x40de5f)){_0x4b9d1e['or'](_0x17fc('0x73'),_0x40de5f+'%');_0x4b9d1e['or'](_0x17fc('0x74'),_0x40de5f+'%');_0x4b9d1e['or']('c.mobile\x20LIKE\x20?',_0x40de5f+'%');_0x4b9d1e['or'](_0x17fc('0x75'),_0x40de5f+'%');}else if(qs[_0x17fc('0x76')](_0x40de5f)){_0x4b9d1e['or'](_0x17fc('0x77'),_0x40de5f+'%');}else{_0x4b9d1e['or'](_0x17fc('0x78'),'%'+_0x40de5f+'%');_0x4b9d1e['or'](_0x17fc('0x79'),'%'+_0x40de5f+'%');_0x4b9d1e['or'](_0x17fc('0x77'),'%'+_0x40de5f+'%');}}}}_0x836b9d[_0x17fc('0x43')](_0x4b9d1e);_0x836b9d[_0x17fc('0x7a')](_0x17fc('0x7b'));var _0x58b530={'type':db['Sequelize']['QueryTypes'][_0x17fc('0x7c')],'raw':!![]};var _0x31f7fc=_0x836b9d[_0x17fc('0x7d')]()[_0x17fc('0x46')](_0x17fc('0x7b'));if(_0x35bab5['order']){_0x35bab5['order']['forEach'](function(_0x5c7fff){_0x836b9d[_0x17fc('0x7e')]('c.'+_0x5c7fff[0x0],_0x5c7fff[0x1]==='DESC'?![]:!![]);});}if(!_[_0x17fc('0x67')](_0x2e3395)){_0x836b9d['having'](_0x52abca);_0x31f7fc['where'](_0x17fc('0x7f'),_0x2e3395);}BPromise[_0x17fc('0x80')]()[_0x17fc('0x2a')](function(){if(_0x29367f&&!_[_0x17fc('0x81')](_0x29367f[_0x17fc('0x55')],[_0x17fc('0x46'),'User'])){return _0x86a9a6['user'][_0x17fc('0x82')]({'attributes':['id'],'raw':!![]})[_0x17fc('0x2a')](function(_0x156ea5){if(_[_0x17fc('0x67')](_0x156ea5)){_0x31f7fc[_0x17fc('0x43')](_0x17fc('0x83'));_0x836b9d[_0x17fc('0x43')](_0x17fc('0x83'));}else{_0x31f7fc[_0x17fc('0x43')](_0x17fc('0x69'),_[_0x17fc('0x58')](_0x156ea5,'id'));_0x836b9d[_0x17fc('0x43')]('c.ListId\x20IN\x20?',_[_0x17fc('0x58')](_0x156ea5,'id'));}});}else{return;}})['then'](function(){db[_0x17fc('0x84')]['query'](_0x31f7fc[_0x17fc('0x85')](),_0x58b530)[_0x17fc('0x2a')](function(_0x3b2702){_0x509649[_0x17fc('0x21')]=_0x3b2702['length'];if(_0x509649[_0x17fc('0x21')]===0x0)return[];return db[_0x17fc('0x84')]['query'](_0x3bbe0f[_0x17fc('0x85')](),_0x58b530);})[_0x17fc('0x2a')](function(_0x1caad6){_0xa72d9f=_['keyBy'](_0x1caad6,'id');_0x58b530=_['merge'](_0x58b530,{'model':db[_0x17fc('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x86a9a6[_0x17fc('0x3b')][_0x17fc('0x3f')]){_0x35bab5[_0x17fc('0x3e')]['forEach'](function(_0x57fdd1){_0x836b9d[_0x17fc('0x46')]('c.'+_0x57fdd1);});}else{_0x836b9d[_0x17fc('0x46')](_0x17fc('0x7b'));_0x836b9d['field'](_0x17fc('0x86'));_0x836b9d[_0x17fc('0x46')]('c.lastName');_0x836b9d[_0x17fc('0x46')](_0x17fc('0x87'));_0x836b9d['field']('c.mobile');_0x836b9d[_0x17fc('0x46')]('c.fax');_0x836b9d[_0x17fc('0x46')](_0x17fc('0x88'));_0x836b9d[_0x17fc('0x46')](_0x17fc('0x89'));_0x836b9d[_0x17fc('0x46')]('c.deletedAt');_0x836b9d[_0x17fc('0x46')](_0x17fc('0x8a'),_0x17fc('0x8b'));}if(_0x35bab5[_0x17fc('0x23')])_0x836b9d[_0x17fc('0x23')](_0x35bab5[_0x17fc('0x23')]);if(_0x35bab5['offset'])_0x836b9d['offset'](_0x35bab5['offset']);return db[_0x17fc('0x84')]['query'](_0x836b9d['toString'](),_0x58b530);})[_0x17fc('0x2a')](function(_0x285ff0){_0x285ff0[_0x17fc('0x68')](function(_0x40bfc7){if(_0x40bfc7[_0x17fc('0x8b')]){_0x40bfc7[_0x17fc('0x8c')]=[];_0x40bfc7[_0x17fc('0x8b')][_0x17fc('0x57')](',')[_0x17fc('0x68')](function(_0x20be05){_0x40bfc7[_0x17fc('0x8c')][_0x17fc('0x34')](_0xa72d9f[_0x20be05]);});}delete _0x40bfc7['TagIds'];});_0x509649[_0x17fc('0x8d')]=_0x285ff0;return _0x509649;})[_0x17fc('0x2a')](respondWithFilteredResult(_0x24092c,_0x35bab5));});})[_0x17fc('0x8e')](handleError(_0x24092c,null));};exports[_0x17fc('0x2b')]=function(_0xc795dd,_0x1f1ebf){return db[_0x17fc('0x2f')]['find']({'where':{'id':_0xc795dd[_0x17fc('0x8f')]['id']}})[_0x17fc('0x2a')](handleEntityNotFound(_0x1f1ebf,null))['then'](removeEntity(_0x1f1ebf,null))[_0x17fc('0x8e')](handleError(_0x1f1ebf,null));};exports[_0x17fc('0x30')]=function(_0x9b1a95,_0x1dfc4f){return db[_0x17fc('0x2f')][_0x17fc('0x30')]()[_0x17fc('0x2a')](function(_0x3e433e){delete _0x3e433e[_0x17fc('0x90')];for(var _0x57d738=0x0;_0x57d738<Object[_0x17fc('0x31')](_0x3e433e)[_0x17fc('0x32')];_0x57d738++){var _0x2d4852=Object[_0x17fc('0x31')](_0x3e433e)[_0x57d738];if(!_[_0x17fc('0x33')](_0x2d4852,'cf_')){_0x3e433e[_0x2d4852][_0x17fc('0x91')]=_0x2d4852;_0x3e433e[_0x2d4852][_0x17fc('0x92')]=_0x2d4852;}}return _0x3e433e;})['then'](function(_0x30a57a){var _0x569584={'where':{'$or':[{'ListId':_0x9b1a95['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0x17fc('0x35')][_0x17fc('0x93')](_0x569584)[_0x17fc('0x2a')](function(_0x8553d5){for(var _0x1c6c3d=0x0;_0x1c6c3d<_0x8553d5[_0x17fc('0x32')];_0x1c6c3d++){var _0x5aae27=_0x17fc('0x37')+_0x8553d5[_0x1c6c3d]['id'];_0x30a57a[_0x5aae27][_0x17fc('0x91')]=_0x5aae27;_0x30a57a[_0x5aae27]['displayName']=_0x8553d5[_0x1c6c3d][_0x17fc('0x94')];_0x30a57a[_0x5aae27][_0x17fc('0x95')]={'type':_0x8553d5[_0x1c6c3d]['type'],'values':_0x8553d5[_0x1c6c3d][_0x17fc('0x96')]};}Object[_0x17fc('0x31')](_0x30a57a)[_0x17fc('0x68')](function(_0x1cde7b){if(!_0x30a57a[_0x1cde7b][_0x17fc('0x63')]('columnName')){delete _0x30a57a[_0x1cde7b];}});return _0x30a57a;});})[_0x17fc('0x2a')](respondWithResult(_0x1dfc4f,null))['catch'](handleError(_0x1dfc4f,null));};exports[_0x17fc('0x97')]=function(_0x41ff1e,_0x30767a){var _0x16ed95;var _0x1e791c;var _0x46ae80;if(_0x41ff1e[_0x17fc('0x98')]['id']){delete _0x41ff1e[_0x17fc('0x98')]['id'];}return db['CmContact'][_0x17fc('0x93')]({'where':{'id':[_0x41ff1e['body']['to'],_0x41ff1e['body']['from']]}})['then'](function(_0x243256){if(_0x243256){if(_0x243256['length']!==0x2){return null;}_0x243256[0x0]=_0x243256[0x0][_0x17fc('0x99')]({'plain':!![]});_0x243256[0x1]=_0x243256[0x1]['get']({'plain':!![]});delete _0x243256[0x0]['id'];delete _0x243256[0x1]['id'];return _[_0x17fc('0x9a')](_0x243256[0x0],_0x243256[0x1],function(_0x22dc40,_0x15df19){if(Array['isArray'](_0x15df19)&&!_0x15df19['length']){return _0x22dc40;}else if(!_0x15df19){return _0x22dc40;}});}})[_0x17fc('0x2a')](handleEntityNotFound(_0x30767a,null))['then'](function(_0x339c0c){if(_0x339c0c){if(_0x339c0c[_0x17fc('0x90')]&&_['isArray'](_0x339c0c[_0x17fc('0x90')])){_0x339c0c[_0x17fc('0x90')]=_0x339c0c[_0x17fc('0x90')][_0x17fc('0x9b')]();}logger[_0x17fc('0x9c')](_0x17fc('0x9d'),_0x41ff1e[_0x17fc('0x98')]['to'],_0x41ff1e[_0x17fc('0x98')]['from']);return db[_0x17fc('0x9e')][_0x17fc('0x2b')]({'where':{'ContactId':[_0x41ff1e['body']['to'],_0x41ff1e[_0x17fc('0x98')][_0x17fc('0x48')]]}})[_0x17fc('0x2a')](function(_0x5248b6){logger[_0x17fc('0x9c')](_0x17fc('0x9f'),_0x5248b6);return db[_0x17fc('0xa0')][_0x17fc('0x2b')]({'where':{'ContactId':[_0x41ff1e[_0x17fc('0x98')]['to'],_0x41ff1e[_0x17fc('0x98')][_0x17fc('0x48')]]}})['then'](function(_0x234dd9){logger[_0x17fc('0x9c')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x234dd9);return db['CmContact']['create'](_0x339c0c);});});}})['then'](function(_0x18fd3a){if(_0x18fd3a){_0x16ed95=_0x18fd3a;_0x1e791c={'ContactId':_0x16ed95['id']};_0x46ae80={'where':{'ContactId':[_0x41ff1e['body']['to'],_0x41ff1e[_0x17fc('0x98')][_0x17fc('0x48')]]}};return db['ChatInteraction'][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db[_0x17fc('0xa1')][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})['then'](function(){if(_0x16ed95){return db[_0x17fc('0xa2')][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db['MailInteraction'][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db[_0x17fc('0xa3')]['update'](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db[_0x17fc('0xa4')]['update'](_0x1e791c,_0x46ae80);}})['then'](function(){if(_0x16ed95){return db[_0x17fc('0xa3')]['update'](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db[_0x17fc('0xa5')][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db[_0x17fc('0xa6')]['update'](_0x1e791c,_0x46ae80);}})['then'](function(){if(_0x16ed95){return db[_0x17fc('0xa7')][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db[_0x17fc('0xa8')]['update'](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db[_0x17fc('0xa9')][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})['then'](function(){if(_0x16ed95){return db['OpenchannelMessage'][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db[_0x17fc('0xaa')][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db[_0x17fc('0xab')][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db['ReportAgentPreview']['update'](_0x1e791c,_0x46ae80);}})['then'](function(){if(_0x16ed95){return db[_0x17fc('0xac')][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db['ChatQueueReport'][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})['then'](function(){if(_0x16ed95){return db[_0x17fc('0xad')][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db[_0x17fc('0xae')][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return db[_0x17fc('0xaf')][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})['then'](function(){if(_0x16ed95){return db[_0x17fc('0xb0')][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})['then'](function(){if(_0x16ed95){return db['JscriptySessionReport'][_0x17fc('0x29')](_0x1e791c,_0x46ae80);}})['then'](function(){if(_0x16ed95){return db[_0x17fc('0x2f')][_0x17fc('0x2b')]({'where':{'id':[_0x41ff1e['body']['to'],_0x41ff1e[_0x17fc('0x98')]['from']]}});}})[_0x17fc('0x2a')](function(){if(_0x16ed95){return _0x16ed95;}})[_0x17fc('0x2a')](respondWithResult(_0x30767a,null))[_0x17fc('0x8e')](handleError(_0x30767a,null));};exports[_0x17fc('0xb1')]=function(_0x5a1d7c,_0xcc76a9){return db['CmContact'][_0x17fc('0x30')]()[_0x17fc('0x2a')](function(_0x14e9bb){if(_0x5a1d7c['body'][_0x17fc('0x90')]&&_['isArray'](_0x5a1d7c[_0x17fc('0x98')][_0x17fc('0x90')])){if(_0x5a1d7c['body']['tags'][_0x17fc('0x32')]){_0x5a1d7c['body'][_0x17fc('0x90')]=_0x5a1d7c[_0x17fc('0x98')][_0x17fc('0x90')][_0x17fc('0x9b')](';')+';';}else{_0x5a1d7c['body']['tags']=null;}}else{_0x5a1d7c[_0x17fc('0x98')][_0x17fc('0x90')]=null;}return db[_0x17fc('0x2f')][_0x17fc('0xb1')](_0x5a1d7c[_0x17fc('0x98')],{'fields':_['keys'](_0x14e9bb),'raw':!![]});})[_0x17fc('0x2a')](respondWithResult(_0xcc76a9,0xc9))[_0x17fc('0x8e')](handleError(_0xcc76a9,null));};exports['bulkCreate']=function(_0x3ee85d,_0x565dc0){var _0x458c6a=[];var _0x310491=0x0;var _0x2a169b=0x0;var _0xc6de40=0x0;return db['CmContact'][_0x17fc('0x30')]()['then'](function(_0xe763d3){return BPromise['each'](_0x3ee85d[_0x17fc('0x98')],function(_0xaf31b8){var _0x583ca6={'where':{'$or':[]},'defaults':_0xaf31b8,'fields':_['keys'](_0xe763d3),'raw':!![]};if(_0xaf31b8[_0x17fc('0xb2')]){for(var _0x211797=0x0;_0x211797<_0xaf31b8[_0x17fc('0xb2')][_0x17fc('0x32')];_0x211797++){var _0x3b9265={};_0x3b9265[_0xaf31b8[_0x17fc('0xb2')][_0x211797]]=_0xaf31b8[_0xaf31b8[_0x17fc('0xb2')][_0x211797]];_0x583ca6[_0x17fc('0x43')][_0x17fc('0xb3')][_0x17fc('0x34')](_0x3b9265);}_0x583ca6['where']['ListId']=_0xaf31b8[_0x17fc('0xb4')];}return db[_0x17fc('0x2f')]['findOrCreate'](_0x583ca6)[_0x17fc('0xb5')](function(_0x483b64,_0x2fd08d){if(_0x2fd08d){_0x310491++;}else{_0xc6de40++;}})['catch'](function(_0x1fe651){console[_0x17fc('0x2c')](_0x1fe651);_0x2a169b++;});});})[_0x17fc('0x2a')](function(_0x58c7b1){if(_0x58c7b1){return{'success':_0x310491,'failure':_0x2a169b,'duplicates':_0xc6de40};}})[_0x17fc('0x2a')](respondWithResult(_0x565dc0,0xc9))[_0x17fc('0x8e')](handleError(_0x565dc0,null));};exports[_0x17fc('0xb6')]=function(_0x16d47f,_0x5c93e2,_0x428a30){var _0xe6857c;return db['CmContact'][_0x17fc('0x30')]()[_0x17fc('0x2a')](function(_0x35eed4){return db[_0x17fc('0x2f')][_0x17fc('0x56')]({'where':{'id':_0x16d47f[_0x17fc('0x8f')]['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x17fc('0x47')],'required':_0x16d47f[_0x17fc('0x3b')][_0x17fc('0x6d')]?!![]:![]}],'attributes':_[_0x17fc('0x31')](_0x35eed4)});})[_0x17fc('0x2a')](function(_0x1fd649){_0xe6857c=_0x1fd649[_0x17fc('0x99')]({'plain':!![]});var _0x17180c={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1fd649&&_0x1fd649[_0x17fc('0xb4')]){if(_0x1fd649[_0x17fc('0xb4')]){_0x17180c['where']['$and'][_0x17fc('0x34')]({'ListId':{'$ne':_0x1fd649[_0x17fc('0xb4')]}});}}return db[_0x17fc('0x35')]['findAll'](_0x17180c);})[_0x17fc('0x2a')](function(_0x321c8){return _[_0x17fc('0xb7')](_0xe6857c,_[_0x17fc('0x58')](_0x321c8,function(_0x4f7543){return util[_0x17fc('0xb8')]('cf_%d',_0x4f7543['id']);}));})['then'](handleEntityNotFound(_0x5c93e2,null))['then'](respondWithResult(_0x5c93e2,null))[_0x17fc('0x8e')](handleError(_0x5c93e2,null));};exports[_0x17fc('0x29')]=function(_0x24b3f4,_0x88c7a7){var _0x3bba5d;if(_0x24b3f4[_0x17fc('0x98')]['id']){delete _0x24b3f4['body']['id'];}return db[_0x17fc('0x2f')][_0x17fc('0x56')]({'where':{'id':_0x24b3f4[_0x17fc('0x8f')]['id']}})[_0x17fc('0x2a')](handleEntityNotFound(_0x88c7a7,null))[_0x17fc('0x2a')](saveUpdates(_0x24b3f4[_0x17fc('0x98')],null))[_0x17fc('0x2a')](function(_0x65d86f){_0x3bba5d=_0x65d86f;var _0x2d1d9c={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x65d86f&&_0x65d86f[_0x17fc('0xb4')]){if(_0x65d86f[_0x17fc('0xb4')]){_0x2d1d9c[_0x17fc('0x43')]['$and'][_0x17fc('0x34')]({'ListId':{'$ne':_0x65d86f[_0x17fc('0xb4')]}});}}return db['CmCustomField'][_0x17fc('0x93')](_0x2d1d9c);})[_0x17fc('0x2a')](function(_0x2e3802){if(_0x2e3802){return _['omit'](_[_0x17fc('0xb9')](_0x24b3f4[_0x17fc('0x98')],function(_0x5bd55e,_0x2f7194){return _['startsWith'](_0x2f7194,_0x17fc('0x37'));}),_[_0x17fc('0x58')](_0x2e3802,function(_0x3ffc1f){return util['format'](_0x17fc('0xba'),_0x3ffc1f['id']);}));}})[_0x17fc('0x2a')](function(_0x3f1826){if(_0x3f1826&&!_['isEmpty'](_0x3f1826)){var _0x14bab9=squel[_0x17fc('0x29')]()['table'](_0x17fc('0x4a'))[_0x17fc('0xbb')](_0x3f1826)[_0x17fc('0x43')]('id\x20=\x20?',_0x24b3f4[_0x17fc('0x8f')]['id'])['toParam']();return db[_0x17fc('0x84')][_0x17fc('0x3b')](_0x14bab9[_0x17fc('0xbc')],{'replacements':_0x14bab9[_0x17fc('0x96')]});}})[_0x17fc('0x2a')](function(){if(_0x24b3f4[_0x17fc('0x98')][_0x17fc('0xbd')]&&_0x3bba5d){return db[_0x17fc('0x9e')][_0x17fc('0x29')]({'phone':_0x24b3f4[_0x17fc('0x98')][_0x17fc('0xbd')]},{'where':{'ContactId':_0x3bba5d['id']}});}})[_0x17fc('0x2a')](function(){return _0x3bba5d;})[_0x17fc('0x2a')](respondWithResult(_0x88c7a7,null))[_0x17fc('0x8e')](handleError(_0x88c7a7,null));};exports[_0x17fc('0xbe')]=function(_0x651041,_0x166bdd,_0x3e7749){var _0x471563={};var _0x16678d={};var _0xf0c4b5;var _0x71e2f8;return db[_0x17fc('0x2f')]['findOne']({'where':{'id':_0x651041[_0x17fc('0x8f')]['id']}})[_0x17fc('0x2a')](handleEntityNotFound(_0x166bdd,null))[_0x17fc('0x2a')](function(_0x548460){if(_0x548460){_0xf0c4b5=_0x548460;_0x16678d[_0x17fc('0x40')]=_[_0x17fc('0x31')](db[_0x17fc('0xbf')][_0x17fc('0xc0')]);_0x16678d['query']=_['keys'](_0x651041[_0x17fc('0x3b')]);_0x16678d[_0x17fc('0x3c')]=_['intersection'](_0x16678d[_0x17fc('0x40')],_0x16678d['query']);_0x471563[_0x17fc('0x3e')]=_[_0x17fc('0x3d')](_0x16678d['model'],qs[_0x17fc('0x3f')](_0x651041[_0x17fc('0x3b')][_0x17fc('0x3f')]));_0x471563[_0x17fc('0x3e')]=_0x471563[_0x17fc('0x3e')][_0x17fc('0x32')]?_0x471563['attributes']:_0x16678d[_0x17fc('0x40')];_0x471563[_0x17fc('0x7e')]=qs[_0x17fc('0x42')](_0x651041[_0x17fc('0x3b')][_0x17fc('0x42')]);_0x471563[_0x17fc('0x43')]=qs['filters'](_['pick'](_0x651041[_0x17fc('0x3b')],_0x16678d['filters']));if(_0x651041[_0x17fc('0x3b')]['filter']){_0x471563[_0x17fc('0x43')]=_[_0x17fc('0x97')](_0x471563[_0x17fc('0x43')],{'$or':_[_0x17fc('0x58')](_0x471563[_0x17fc('0x3e')],function(_0x475783){var _0x58f10b={};_0x58f10b[_0x475783]={'$like':'%'+_0x651041[_0x17fc('0x3b')][_0x17fc('0x64')]+'%'};return _0x58f10b;})});}_0x471563=_[_0x17fc('0x97')]({},_0x471563,_0x651041['options']);return _0xf0c4b5[_0x17fc('0xbe')](_0x471563);}})[_0x17fc('0x2a')](function(_0x55d85e){if(_0x55d85e){_0x71e2f8=_0x55d85e['length'];if(!_0x651041['query'][_0x17fc('0x63')](_0x17fc('0x41'))){_0x471563['limit']=qs[_0x17fc('0x23')](_0x651041[_0x17fc('0x3b')][_0x17fc('0x23')]);_0x471563[_0x17fc('0x22')]=qs[_0x17fc('0x22')](_0x651041[_0x17fc('0x3b')][_0x17fc('0x22')]);}return _0xf0c4b5['getTags'](_0x471563);}})[_0x17fc('0x2a')](function(_0x3e9b11){if(_0x3e9b11){return _0x3e9b11?{'count':_0x71e2f8,'rows':_0x3e9b11}:null;}})[_0x17fc('0x2a')](respondWithResult(_0x166bdd,null))[_0x17fc('0x8e')](handleError(_0x166bdd,null));};exports[_0x17fc('0xc1')]=function(_0x58160e,_0x2f35bf,_0x54799c){if(_0x58160e[_0x17fc('0x98')]['id']){delete _0x58160e[_0x17fc('0x98')]['id'];}return db['CmContact'][_0x17fc('0x36')]({'where':{'id':_0x58160e[_0x17fc('0x8f')]['id']}})[_0x17fc('0x2a')](handleEntityNotFound(_0x2f35bf,null))[_0x17fc('0x2a')](function(_0x420ff8){if(_0x420ff8){return _0x420ff8[_0x17fc('0xc1')](_0x58160e[_0x17fc('0x98')][_0x17fc('0xc2')]||[]);}return null;})[_0x17fc('0x2a')](respondWithResult(_0x2f35bf,null))[_0x17fc('0x8e')](handleError(_0x2f35bf,null));};exports[_0x17fc('0xc3')]=function(_0x492dea,_0x136c0c,_0x29f8dd){var _0x3a0a3b={'raw':![],'where':{}};var _0x4d636f={};var _0x311c9d={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x492dea[_0x17fc('0x8f')]['id']}})[_0x17fc('0x2a')](handleEntityNotFound(_0x136c0c,null))[_0x17fc('0x2a')](function(_0x53da18){if(_0x53da18){_0x4d636f[_0x17fc('0x40')]=_[_0x17fc('0x31')](db[_0x17fc('0x9e')]['rawAttributes']);_0x4d636f[_0x17fc('0x3b')]=_[_0x17fc('0x31')](_0x492dea['query']);_0x4d636f[_0x17fc('0x3c')]=_[_0x17fc('0x3d')](_0x4d636f[_0x17fc('0x40')],_0x4d636f['query']);_0x3a0a3b[_0x17fc('0x3e')]=_[_0x17fc('0x3d')](_0x4d636f[_0x17fc('0x40')],qs[_0x17fc('0x3f')](_0x492dea[_0x17fc('0x3b')][_0x17fc('0x3f')]));_0x3a0a3b[_0x17fc('0x3e')]=_0x3a0a3b[_0x17fc('0x3e')][_0x17fc('0x32')]?_0x3a0a3b['attributes']:_0x4d636f[_0x17fc('0x40')];if(!_0x492dea['query'][_0x17fc('0x63')](_0x17fc('0x41'))){_0x3a0a3b['limit']=qs[_0x17fc('0x23')](_0x492dea[_0x17fc('0x3b')]['limit']);_0x3a0a3b['offset']=qs[_0x17fc('0x22')](_0x492dea['query']['offset']);}_0x3a0a3b[_0x17fc('0x7e')]=qs[_0x17fc('0x42')](_0x492dea[_0x17fc('0x3b')][_0x17fc('0x42')]);_0x3a0a3b[_0x17fc('0x43')]=qs[_0x17fc('0x3c')](_['pick'](_0x492dea[_0x17fc('0x3b')],_0x4d636f[_0x17fc('0x3c')]));_0x3a0a3b[_0x17fc('0x43')]['ContactId']=_0x53da18['id'];if(_0x492dea[_0x17fc('0x3b')]['filter']){_0x3a0a3b[_0x17fc('0x43')]=_[_0x17fc('0x97')](_0x3a0a3b[_0x17fc('0x43')],{'$or':_['map'](_0x3a0a3b[_0x17fc('0x3e')],function(_0x3b980a){var _0x2f4d41={};_0x2f4d41[_0x3b980a]={'$like':'%'+_0x492dea['query']['filter']+'%'};return _0x2f4d41;})});}_0x3a0a3b=_['merge']({},_0x3a0a3b,_0x492dea[_0x17fc('0xc4')]);return db['CmHopper'][_0x17fc('0x21')]({'where':_0x3a0a3b[_0x17fc('0x43')]})[_0x17fc('0x2a')](function(_0x47f459){_0x311c9d['count']=_0x47f459;if(_0x492dea['query']['includeAll']){_0x3a0a3b['include']=[{'all':!![]}];}return db[_0x17fc('0x9e')]['findAll'](_0x3a0a3b);})[_0x17fc('0x2a')](function(_0x3eff4f){_0x311c9d['rows']=_0x3eff4f;return _0x311c9d;});}})[_0x17fc('0x2a')](respondWithFilteredResult(_0x136c0c,_0x3a0a3b))[_0x17fc('0x8e')](handleError(_0x136c0c,null));};exports[_0x17fc('0xc5')]=function(_0x5f66b3,_0x400f55,_0xed8856){var _0xddf025={'raw':!![],'where':{}};var _0x5c6f6d={};var _0x1b124a={'count':0x0,'rows':[]};return db[_0x17fc('0x2f')]['findOne']({'where':{'id':_0x5f66b3['params']['id']}})[_0x17fc('0x2a')](handleEntityNotFound(_0x400f55,null))[_0x17fc('0x2a')](function(_0x234303){if(_0x234303){_0x5c6f6d[_0x17fc('0x40')]=_[_0x17fc('0x31')](db[_0x17fc('0xab')][_0x17fc('0xc0')]);_0x5c6f6d[_0x17fc('0x3b')]=_[_0x17fc('0x31')](_0x5f66b3[_0x17fc('0x3b')]);_0x5c6f6d[_0x17fc('0x3c')]=_['intersection'](_0x5c6f6d[_0x17fc('0x40')],_0x5c6f6d[_0x17fc('0x3b')]);_0xddf025[_0x17fc('0x3e')]=_[_0x17fc('0x3d')](_0x5c6f6d['model'],qs[_0x17fc('0x3f')](_0x5f66b3[_0x17fc('0x3b')]['fields']));_0xddf025[_0x17fc('0x3e')]=_0xddf025[_0x17fc('0x3e')]['length']?_0xddf025[_0x17fc('0x3e')]:_0x5c6f6d['model'];if(!_0x5f66b3[_0x17fc('0x3b')][_0x17fc('0x63')]('nolimit')){_0xddf025['limit']=qs['limit'](_0x5f66b3[_0x17fc('0x3b')][_0x17fc('0x23')]);_0xddf025['offset']=qs[_0x17fc('0x22')](_0x5f66b3[_0x17fc('0x3b')]['offset']);}_0xddf025[_0x17fc('0x7e')]=qs['sort'](_0x5f66b3[_0x17fc('0x3b')][_0x17fc('0x42')]);_0xddf025[_0x17fc('0x43')]=qs[_0x17fc('0x3c')](_[_0x17fc('0x44')](_0x5f66b3[_0x17fc('0x3b')],_0x5c6f6d[_0x17fc('0x3c')]));_0xddf025['where'][_0x17fc('0xc6')]=_0x234303['id'];if(_0x5f66b3['query'][_0x17fc('0x64')]){_0xddf025[_0x17fc('0x43')]=_[_0x17fc('0x97')](_0xddf025['where'],{'$or':_[_0x17fc('0x58')](_0xddf025['attributes'],function(_0x3a1ca4){var _0x12f4b5={};_0x12f4b5[_0x3a1ca4]={'$like':'%'+_0x5f66b3[_0x17fc('0x3b')][_0x17fc('0x64')]+'%'};return _0x12f4b5;})});}_0xddf025=_[_0x17fc('0x97')]({},_0xddf025,_0x5f66b3[_0x17fc('0xc4')]);return db[_0x17fc('0xab')][_0x17fc('0x21')]({'where':_0xddf025['where']})['then'](function(_0x1bf74a){_0x1b124a[_0x17fc('0x21')]=_0x1bf74a;if(_0x5f66b3[_0x17fc('0x3b')][_0x17fc('0xc7')]){_0xddf025[_0x17fc('0xc8')]=[{'all':!![]}];}return db[_0x17fc('0xab')][_0x17fc('0x93')](_0xddf025);})['then'](function(_0xa2f751){_0x1b124a[_0x17fc('0x8d')]=_0xa2f751;return _0x1b124a;});}})['then'](respondWithFilteredResult(_0x400f55,_0xddf025))[_0x17fc('0x8e')](handleError(_0x400f55,null));};exports[_0x17fc('0xc9')]=function(_0xaf00c8,_0x3aee5e,_0x98ef6f){var _0x173d2c={'raw':!![],'where':{}};var _0x599a6c={};var _0x29f21f={'count':0x0,'rows':[]};return db[_0x17fc('0x2f')][_0x17fc('0x36')]({'where':{'id':_0xaf00c8[_0x17fc('0x8f')]['id']}})[_0x17fc('0x2a')](handleEntityNotFound(_0x3aee5e,null))[_0x17fc('0x2a')](function(_0x29e06d){if(_0x29e06d){_0x599a6c['model']=_['keys'](db[_0x17fc('0xaa')][_0x17fc('0xc0')]);_0x599a6c[_0x17fc('0x3b')]=_[_0x17fc('0x31')](_0xaf00c8[_0x17fc('0x3b')]);_0x599a6c[_0x17fc('0x3c')]=_[_0x17fc('0x3d')](_0x599a6c[_0x17fc('0x40')],_0x599a6c[_0x17fc('0x3b')]);_0x173d2c['attributes']=_['intersection'](_0x599a6c[_0x17fc('0x40')],qs['fields'](_0xaf00c8[_0x17fc('0x3b')][_0x17fc('0x3f')]));_0x173d2c['attributes']=_0x173d2c[_0x17fc('0x3e')]['length']?_0x173d2c[_0x17fc('0x3e')]:_0x599a6c[_0x17fc('0x40')];if(!_0xaf00c8[_0x17fc('0x3b')][_0x17fc('0x63')](_0x17fc('0x41'))){_0x173d2c['limit']=qs['limit'](_0xaf00c8[_0x17fc('0x3b')]['limit']);_0x173d2c[_0x17fc('0x22')]=qs['offset'](_0xaf00c8['query'][_0x17fc('0x22')]);}_0x173d2c[_0x17fc('0x7e')]=qs[_0x17fc('0x42')](_0xaf00c8[_0x17fc('0x3b')]['sort']);_0x173d2c[_0x17fc('0x43')]=qs[_0x17fc('0x3c')](_[_0x17fc('0x44')](_0xaf00c8[_0x17fc('0x3b')],_0x599a6c['filters']));_0x173d2c[_0x17fc('0x43')][_0x17fc('0xc6')]=_0x29e06d['id'];if(_0xaf00c8['query']['filter']){_0x173d2c['where']=_['merge'](_0x173d2c[_0x17fc('0x43')],{'$or':_['map'](_0x173d2c['attributes'],function(_0x2e0bd3){var _0x4c1a64={};_0x4c1a64[_0x2e0bd3]={'$like':'%'+_0xaf00c8[_0x17fc('0x3b')]['filter']+'%'};return _0x4c1a64;})});}_0x173d2c=_[_0x17fc('0x97')]({},_0x173d2c,_0xaf00c8['options']);return db[_0x17fc('0xaa')]['count']({'where':_0x173d2c['where']})[_0x17fc('0x2a')](function(_0x8717d0){_0x29f21f[_0x17fc('0x21')]=_0x8717d0;if(_0xaf00c8['query'][_0x17fc('0xc7')]){_0x173d2c[_0x17fc('0xc8')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x17fc('0x93')](_0x173d2c);})[_0x17fc('0x2a')](function(_0x8356ef){_0x29f21f[_0x17fc('0x8d')]=_0x8356ef;return _0x29f21f;});}})[_0x17fc('0x2a')](respondWithFilteredResult(_0x3aee5e,_0x173d2c))[_0x17fc('0x8e')](handleError(_0x3aee5e,null));};exports[_0x17fc('0xca')]=function(_0x5c9b63,_0x2c3924,_0x3fe9cf){var _0x86f0a9={'raw':!![],'where':{}};var _0x12dcec={};var _0x495dd9={'count':0x0,'rows':[]};return db[_0x17fc('0x2f')][_0x17fc('0x36')]({'where':{'id':_0x5c9b63['params']['id']}})[_0x17fc('0x2a')](handleEntityNotFound(_0x2c3924,null))[_0x17fc('0x2a')](function(_0x46cb40){if(_0x46cb40){_0x12dcec[_0x17fc('0x40')]=_[_0x17fc('0x31')](db['JscriptySessionReport'][_0x17fc('0xc0')]);_0x12dcec[_0x17fc('0x3b')]=_[_0x17fc('0x31')](_0x5c9b63['query']);_0x12dcec[_0x17fc('0x3c')]=_[_0x17fc('0x3d')](_0x12dcec[_0x17fc('0x40')],_0x12dcec[_0x17fc('0x3b')]);_0x86f0a9[_0x17fc('0x3e')]=_[_0x17fc('0x3d')](_0x12dcec['model'],qs['fields'](_0x5c9b63[_0x17fc('0x3b')]['fields']));_0x86f0a9['attributes']=_0x86f0a9[_0x17fc('0x3e')][_0x17fc('0x32')]?_0x86f0a9[_0x17fc('0x3e')]:_0x12dcec[_0x17fc('0x40')];if(!_0x5c9b63[_0x17fc('0x3b')]['hasOwnProperty']('nolimit')){_0x86f0a9['limit']=qs[_0x17fc('0x23')](_0x5c9b63[_0x17fc('0x3b')][_0x17fc('0x23')]);_0x86f0a9[_0x17fc('0x22')]=qs[_0x17fc('0x22')](_0x5c9b63[_0x17fc('0x3b')][_0x17fc('0x22')]);}_0x86f0a9[_0x17fc('0x7e')]=qs[_0x17fc('0x42')](_0x5c9b63['query'][_0x17fc('0x42')]);_0x86f0a9[_0x17fc('0x43')]=qs[_0x17fc('0x3c')](_[_0x17fc('0x44')](_0x5c9b63[_0x17fc('0x3b')],_0x12dcec['filters']));_0x86f0a9['where']['ContactId']=_0x46cb40['id'];if(_0x5c9b63[_0x17fc('0x3b')][_0x17fc('0x64')]){_0x86f0a9[_0x17fc('0x43')]=_[_0x17fc('0x97')](_0x86f0a9[_0x17fc('0x43')],{'$or':_[_0x17fc('0x58')](_0x86f0a9[_0x17fc('0x3e')],function(_0x1be565){var _0x495ee8={};_0x495ee8[_0x1be565]={'$like':'%'+_0x5c9b63[_0x17fc('0x3b')]['filter']+'%'};return _0x495ee8;})});}_0x86f0a9=_[_0x17fc('0x97')]({},_0x86f0a9,_0x5c9b63[_0x17fc('0xc4')]);return db['JscriptySessionReport'][_0x17fc('0x21')]({'where':_0x86f0a9[_0x17fc('0x43')]})[_0x17fc('0x2a')](function(_0x43c14c){_0x495dd9[_0x17fc('0x21')]=_0x43c14c;if(_0x5c9b63[_0x17fc('0x3b')][_0x17fc('0xc7')]){_0x86f0a9[_0x17fc('0xc8')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x17fc('0x93')](_0x86f0a9);})[_0x17fc('0x2a')](function(_0x2f7951){_0x495dd9[_0x17fc('0x8d')]=_0x2f7951;return _0x495dd9;});}})[_0x17fc('0x2a')](respondWithFilteredResult(_0x2c3924,_0x86f0a9))[_0x17fc('0x8e')](handleError(_0x2c3924,null));};exports[_0x17fc('0xcb')]=function(_0x1de56b,_0x150f8d,_0x4193b9){try{if(!_0x1de56b[_0x17fc('0x98')][_0x17fc('0xb4')]){throw new Error('No\x20ListId\x20specified');}if(!_0x1de56b[_0x17fc('0x98')][_0x17fc('0xcc')]){throw new Error(_0x17fc('0xcd'));}if(!_0x1de56b['body'][_0x17fc('0xce')]){throw new Error(_0x17fc('0xcf'));}if(!_0x1de56b['body'][_0x17fc('0xd0')]){throw new Error(_0x17fc('0xd1'));}var _0x5f36b1=_0x1de56b[_0x17fc('0x98')]['binding_keys'][_0x17fc('0x57')](',');var _0x20136f=_0x1de56b['body']['binding_values'][_0x17fc('0x57')](',');if(!_0x5f36b1[_0x17fc('0x32')]||!_0x20136f[_0x17fc('0x32')]||_0x5f36b1['length']!==_0x20136f['length']){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x1de56b[_0x17fc('0x98')][_0x17fc('0x3f')]=_[_0x17fc('0xd2')](_0x5f36b1,_0x20136f);if(!_0x1de56b[_0x17fc('0x98')][_0x17fc('0x3f')][_0x17fc('0xbd')]){throw new Error(_0x17fc('0xd3'));}if(!_0x1de56b[_0x17fc('0x98')]['fields'][_0x17fc('0xd4')]){throw new Error(_0x17fc('0xd5'));}var _0x432f04=path[_0x17fc('0x9b')](config['root'],'server/files/tmp',_0x1de56b[_0x17fc('0xd6')]['filename']);fs[_0x17fc('0xd7')](_0x432f04,parseInt(_0x17fc('0xd8'),0x8));var _0x107027=require(_0x17fc('0xd9'))['fork'](path[_0x17fc('0x9b')](__dirname,_0x17fc('0xda')),[_0x432f04,_0x1de56b[_0x17fc('0x98')][_0x17fc('0xcc')],_0x1de56b[_0x17fc('0x98')][_0x17fc('0xce')],_0x1de56b[_0x17fc('0x98')]['ListId'],_0x1de56b['body'][_0x17fc('0xdb')],_0x1de56b[_0x17fc('0x98')][_0x17fc('0xb2')],_0x1de56b['body'][_0x17fc('0xd0')]]);return _0x150f8d['status'](0xc8)[_0x17fc('0x20')]({'message':_0x17fc('0xdc'),'pid':_0x107027[_0x17fc('0xdd')]});}catch(_0x105b69){return _0x150f8d[_0x17fc('0x1f')](0x1f4)[_0x17fc('0xde')](_0x105b69);}};exports[_0x17fc('0xdf')]=function(_0x1d2bc4,_0x345b83,_0x13467d){var _0x5b03c5=fs['createReadStream'](_0x1d2bc4[_0x17fc('0xd6')][_0x17fc('0xe0')]);Papa[_0x17fc('0xe1')](_0x5b03c5,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3842a7){return _0x345b83[_0x17fc('0x1f')](0xc8)['json']({'file':_0x1d2bc4[_0x17fc('0xd6')],'fields':_0x3842a7['meta']['fields']});}});};exports[_0x17fc('0xe2')]=function(_0x5a0149,_0xce67c,_0x28264c){return db[_0x17fc('0xe3')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x17fc('0xe4')}})['then'](function(_0x88c421){var _0x546419=![];if(!_0x5a0149[_0x17fc('0x98')][_0x17fc('0xb4')]){throw new Error(_0x17fc('0xe5'));}if(!_0x5a0149[_0x17fc('0x98')][_0x17fc('0xe6')][_0x17fc('0xbd')]){throw new Error(_0x17fc('0xd3'));}if(!_0x5a0149[_0x17fc('0x98')][_0x17fc('0xe6')][_0x17fc('0xd4')]){throw new Error(_0x17fc('0xd5'));}if(!_0x5a0149[_0x17fc('0x98')][_0x17fc('0xd0')]){throw new Error(_0x17fc('0xd1'));}var _0xd6390f=require(_0x17fc('0xd9'))['fork'](path[_0x17fc('0x9b')](__dirname,'../../components/import/cm/csv2'),[_0x5a0149[_0x17fc('0x8f')]['id'],JSON[_0x17fc('0xe7')](_0x5a0149[_0x17fc('0x98')]),JSON['stringify'](_0x88c421)]);_0xd6390f['on'](_0x17fc('0xe8'),function(_0x1f1a13){_0x546419=!![];return _0xce67c['status'](0xc8)['json']({'message':_0x17fc('0xe9'),'pid':_0xd6390f[_0x17fc('0xdd')]});});_0xd6390f['on'](_0x17fc('0xea'),function(_0x57a65d){if(_0x57a65d&&!_0x546419){return _0xce67c[_0x17fc('0x1f')](0x1f4)[_0x17fc('0x20')]({'message':_0x17fc('0xeb'),'pid':_0xd6390f[_0x17fc('0xdd')]});}});})['catch'](handleError(_0xce67c,null));};
\ No newline at end of file
+var _0x9778=['offset','order','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','value','datetime','castTo','type','text','filter','isNil','Contact','ListId','concat','\x20=\x20?','tag','isArray','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.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','isEmpty','having','t.id\x20IN\x20?','resolve','some','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','count','toString','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.deletedAt','TagIds','rows','catch','describe','tags','columnName','displayName','alias','custom','values','body','findAll','get','mergeWith','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxMessage','OpenchannelInteraction','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','create','join','bulkCreate','duplicates','findOrCreate','spread','error','show','Tags','$and','omit','format','params','cf_%d','table','setFields','toParam','phone','getTags','rawAttributes','setTags','ids','getHoppers','ContactId','options','getHopperHistories','includeAll','include','getHopperFinals','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','child_process','CompanyId','json','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','import','agent','binding','fork','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','limit','set','Content-Range','apply','reject','update','then','destroy','end','name','send','CmContact','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x453d75,_0x2bad3c){var _0x181e99=function(_0x5c98e4){while(--_0x5c98e4){_0x453d75['push'](_0x453d75['shift']());}};_0x181e99(++_0x2bad3c);}(_0x9778,0xb2));var _0x8977=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0x9778[_0xd13a88];return _0x1c993c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8977('0x0'));var rimraf=require(_0x8977('0x1'));var zipdir=require(_0x8977('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8977('0x3'));var moment=require(_0x8977('0x4'));var BPromise=require(_0x8977('0x5'));var Mustache=require(_0x8977('0x6'));var util=require('util');var path=require(_0x8977('0x7'));var sox=require(_0x8977('0x8'));var csv=require(_0x8977('0x9'));var ejs=require(_0x8977('0xa'));var fs=require('fs');var _=require(_0x8977('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8977('0xc'));var deskjs=require(_0x8977('0xd'));var toCsv=require(_0x8977('0x9'));var querystring=require('querystring');var Papa=require(_0x8977('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8977('0xf'));var hardwareService=require(_0x8977('0x10'));var logger=require(_0x8977('0x11'))(_0x8977('0x12'));var utils=require(_0x8977('0x13'));var config=require('../../config/environment');var db=require(_0x8977('0x14'))['db'];config[_0x8977('0x15')]=_[_0x8977('0x16')](config['redis'],{'host':_0x8977('0x17'),'port':0x18eb});var socket=require(_0x8977('0x18'))(new Redis(config[_0x8977('0x15')]));require(_0x8977('0x19'))[_0x8977('0x1a')](socket);function respondWithStatusCode(_0x579b65,_0x44fb90){_0x44fb90=_0x44fb90||0xcc;return function(_0x3c3ae7){if(_0x3c3ae7){return _0x579b65[_0x8977('0x1b')](_0x44fb90);}return _0x579b65[_0x8977('0x1c')](_0x44fb90)['end']();};}function respondWithResult(_0x57f05a,_0x107579){_0x107579=_0x107579||0xc8;return function(_0x305834){if(_0x305834){return _0x57f05a['status'](_0x107579)['json'](_0x305834);}};}function respondWithFilteredResult(_0xd2a091,_0x50419a){return function(_0x1ee2f3){if(_0x1ee2f3){var _0x2dfa0f=_0x1ee2f3['count'],_0x2af293=_0x50419a['offset'],_0x263ea1=_0x50419a['offset']+_0x50419a[_0x8977('0x1d')],_0x31d9f8;if(_0x263ea1>=_0x2dfa0f){_0x263ea1=_0x2dfa0f;_0x31d9f8=0xc8;}else{_0x31d9f8=0xce;}_0xd2a091['status'](_0x31d9f8);return _0xd2a091[_0x8977('0x1e')](_0x8977('0x1f'),_0x2af293+'-'+_0x263ea1+'/'+_0x2dfa0f)['json'](_0x1ee2f3);}return null;};}function patchUpdates(_0xeb7fec){return function(_0x452c3a){try{jsonpatch[_0x8977('0x20')](_0x452c3a,_0xeb7fec,!![]);}catch(_0x18a875){return BPromise[_0x8977('0x21')](_0x18a875);}return _0x452c3a['save']();};}function saveUpdates(_0x2cbb10,_0xd7b351){return function(_0x5f0806){if(_0x5f0806){return _0x5f0806[_0x8977('0x22')](_0x2cbb10)[_0x8977('0x23')](function(_0x22eb30){return _0x22eb30;});}return null;};}function removeEntity(_0x5172c7,_0x42f8e9){return function(_0x1c3ac6){if(_0x1c3ac6){return _0x1c3ac6[_0x8977('0x24')]()['then'](function(){_0x5172c7[_0x8977('0x1c')](0xcc)[_0x8977('0x25')]();});}};}function handleEntityNotFound(_0x2998f4,_0x163e46){return function(_0x5b4e3c){if(!_0x5b4e3c){_0x2998f4[_0x8977('0x1b')](0x194);}return _0x5b4e3c;};}function handleError(_0x2b1c6f,_0x59c42c){_0x59c42c=_0x59c42c||0x1f4;return function(_0x2d4599){logger['error'](_0x2d4599['stack']);if(_0x2d4599[_0x8977('0x26')]){delete _0x2d4599[_0x8977('0x26')];}_0x2b1c6f[_0x8977('0x1c')](_0x59c42c)[_0x8977('0x27')](_0x2d4599);};}exports['index']=function(_0x3d3f4c,_0xf5ae90){var _0x93d70={},_0x5d64ff={},_0x4bdb2d={'count':0x0,'rows':[]};return db[_0x8977('0x28')]['describe']()['then'](function(_0x5e9577){var _0xc94dcd=[];for(var _0x5a21ea=0x0;_0x5a21ea<Object['keys'](_0x5e9577)[_0x8977('0x29')];_0x5a21ea++){var _0x3779ff=Object['keys'](_0x5e9577)[_0x5a21ea];if(_[_0x8977('0x2a')](_0x3779ff,_0x8977('0x2b'))){_0xc94dcd[_0x8977('0x2c')](db[_0x8977('0x2d')][_0x8977('0x2e')]({'where':{'id':_[_0x8977('0x2f')](_0x3779ff,'cf_')},'raw':!![]}));}}return BPromise['all'](_0xc94dcd)[_0x8977('0x23')](function(_0x315e36){for(var _0x8c64ad=0x0;_0x8c64ad<_0x315e36[_0x8977('0x29')];_0x8c64ad++){if(_0x315e36[_0x8c64ad]){var _0x413a75='cf_'+_0x315e36[_0x8c64ad]['id'];var _0x3afe5b=_0x5e9577[_0x413a75];_0x3afe5b['fieldType']=_0x315e36[_0x8c64ad]['type'];}}return _0x5e9577;});})['then'](function(_0x195eb0){_0x5d64ff[_0x8977('0x30')]=_[_0x8977('0x31')](_0x195eb0);_0x5d64ff[_0x8977('0x32')]=_[_0x8977('0x31')](_0x3d3f4c[_0x8977('0x32')]);_0x5d64ff[_0x8977('0x33')]=_[_0x8977('0x34')](_0x5d64ff[_0x8977('0x30')],_0x5d64ff['query']);_0x93d70['attributes']=_[_0x8977('0x34')](_0x5d64ff['model'],qs[_0x8977('0x35')](_0x3d3f4c[_0x8977('0x32')][_0x8977('0x35')]));_0x93d70[_0x8977('0x36')]=_0x93d70[_0x8977('0x36')][_0x8977('0x29')]?_0x93d70[_0x8977('0x36')]:_0x5d64ff[_0x8977('0x30')];if(!_0x3d3f4c[_0x8977('0x32')][_0x8977('0x37')](_0x8977('0x38'))){_0x93d70[_0x8977('0x1d')]=qs['limit'](_0x3d3f4c[_0x8977('0x32')][_0x8977('0x1d')]);_0x93d70['offset']=qs['offset'](_0x3d3f4c[_0x8977('0x32')][_0x8977('0x39')]);}_0x93d70[_0x8977('0x3a')]=qs['sort'](_0x3d3f4c[_0x8977('0x32')][_0x8977('0x3b')]);_0x93d70[_0x8977('0x3c')]=qs[_0x8977('0x33')](_[_0x8977('0x3d')](_0x3d3f4c[_0x8977('0x32')],_0x5d64ff[_0x8977('0x33')]),_0x195eb0);var _0x38fe33=[];var _0x1edffc=squel[_0x8977('0x3e')]()[_0x8977('0x3f')]('id')['field'](_0x8977('0x26'))['field'](_0x8977('0x40'))[_0x8977('0x41')](_0x8977('0x42'));var _0x14b845=squel[_0x8977('0x3e')]()[_0x8977('0x41')](_0x8977('0x43'),'c')[_0x8977('0x44')](_0x8977('0x45'),'uc','uc.CmContactId\x20=\x20c.id')[_0x8977('0x44')](_0x8977('0x46'),'ct',_0x8977('0x47'))[_0x8977('0x44')](_0x8977('0x42'),'t',_0x8977('0x48'))[_0x8977('0x3c')](_0x8977('0x49'));var _0x507b3b=squel['expr']();var _0x176315=[];var _0x1c599b=squel[_0x8977('0x4a')]();var _0x2ebb86;if(_0x3d3f4c[_0x8977('0x32')]['search']){_0x2ebb86=as['parseSearch'](_0x3d3f4c['query'][_0x8977('0x4b')]);var _0x47b37b=_0x2ebb86[_0x8977('0x4c')];for(var _0x6ed062=0x0;_0x6ed062<_0x2ebb86[_0x8977('0x4d')][_0x8977('0x29')];_0x6ed062++){var _0x452aac=_0x2ebb86[_0x8977('0x4d')][_0x6ed062];var _0xc83397='c';var _0x57762c=_(_0x195eb0)[_0x8977('0x31')]()[_0x8977('0x4e')](function(_0x2c6e4d){return _0x2c6e4d===_0x452aac[_0x8977('0x3f')];});if(_0x57762c)_0x57762c=_0x195eb0[_0x452aac[_0x8977('0x3f')]];if(!_0x57762c){if(_0x452aac[_0x8977('0x3f')]===_0x8977('0x4f')){var _0x192bc8=_0x452aac['value'][_0x8977('0x50')](',')[_0x8977('0x51')](function(_0x6ff8e4){return Number(_0x6ff8e4);});_0x192bc8[_0x8977('0x52')](function(_0xb36ce4){_0x1c599b['or'](_0x8977('0x53'),'%,'+_0xb36ce4+',%');});_0x176315=_[_0x8977('0x54')](_0x176315,_0x192bc8);}else if(_0x452aac[_0x8977('0x3f')]===_0x8977('0x55')){_0x507b3b[_0x8977('0x56')]('uc.UserId\x20=\x20?',_0x452aac[_0x8977('0x57')]);}}else{if(_0x452aac['field']==='dateOfBirth'||_0x57762c['fieldType']===_0x8977('0x58'))_0x452aac[_0x8977('0x59')]='DATE';var _0xa0ec3e=as['buildExpression'](_0xc83397,_0x57762c[_0x8977('0x5a')],_0x452aac);_0x507b3b[_0x47b37b](_0xa0ec3e[_0x8977('0x5b')],_0xa0ec3e[_0x8977('0x57')]['start'],_0xa0ec3e['value'][_0x8977('0x25')]);}}}else{var _0x40c7c7=_(Object[_0x8977('0x31')](_0x3d3f4c[_0x8977('0x32')]))[_0x8977('0x51')](function(_0x502c9b){return _0x195eb0['hasOwnProperty'](_0x502c9b)?_0x502c9b:undefined;})[_0x8977('0x5c')](function(_0xc12afd){return!_[_0x8977('0x5d')](_0xc12afd);})[_0x8977('0x57')]();if(_0x3d3f4c['query'][_0x8977('0x5e')])_0x40c7c7[_0x8977('0x2c')](_0x8977('0x5e'));if(!_['isEmpty'](_0x40c7c7)){_0x40c7c7[_0x8977('0x52')](function(_0x1b5905){if(_0x1b5905===_0x8977('0x5f')){_0x14b845[_0x8977('0x3c')]('c.ListId\x20IN\x20?',[][_0x8977('0x60')](_0x3d3f4c[_0x8977('0x32')][_0x1b5905]));}else if(_0x1b5905==='Contact'){var _0x1600d7='%'+_0x3d3f4c[_0x8977('0x32')][_0x1b5905]+'%';_0x14b845[_0x8977('0x3c')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x1600d7);}else{_0x14b845[_0x8977('0x3c')]('c.'+_0x1b5905+_0x8977('0x61'),_0x3d3f4c[_0x8977('0x32')][_0x1b5905]);}});}if(_0x3d3f4c[_0x8977('0x32')][_0x8977('0x62')]){_0x176315=_[_0x8977('0x63')](_0x3d3f4c['query'][_0x8977('0x62')])?_0x3d3f4c[_0x8977('0x32')][_0x8977('0x62')]:new Array(_0x3d3f4c[_0x8977('0x32')][_0x8977('0x62')]);_0x176315['forEach'](function(_0x2c3946){_0x1c599b['or'](_0x8977('0x53'),'%,'+_0x2c3946+',%');});}if(_0x3d3f4c[_0x8977('0x32')][_0x8977('0x5c')]){var _0x4e76c5=_0x3d3f4c['query'][_0x8977('0x5c')][_0x8977('0x64')]('\x5c','\x5c\x5c')[_0x8977('0x64')]('\x27\x27','\x27\x27\x27\x27');if(_0x4e76c5[_0x8977('0x50')]('\x20')['length']>0x1){_0x507b3b['or'](_0x8977('0x65'),qs[_0x8977('0x66')](_0x4e76c5),null);}else{if(qs[_0x8977('0x67')](_0x4e76c5)){_0x507b3b['or'](_0x8977('0x68'),_0x4e76c5+'%');_0x507b3b['or'](_0x8977('0x69'),_0x4e76c5+'%');_0x507b3b['or'](_0x8977('0x6a'),_0x4e76c5+'%');_0x507b3b['or'](_0x8977('0x6b'),_0x4e76c5+'%');}else if(qs[_0x8977('0x6c')](_0x4e76c5)){_0x507b3b['or'](_0x8977('0x6d'),_0x4e76c5+'%');}else{_0x507b3b['or'](_0x8977('0x6e'),'%'+_0x4e76c5+'%');_0x507b3b['or'](_0x8977('0x6f'),'%'+_0x4e76c5+'%');_0x507b3b['or'](_0x8977('0x6d'),'%'+_0x4e76c5+'%');}}}}_0x14b845[_0x8977('0x3c')](_0x507b3b);_0x14b845[_0x8977('0x70')](_0x8977('0x71'));var _0x57acee={'type':db[_0x8977('0x72')][_0x8977('0x73')][_0x8977('0x74')],'raw':!![]};var _0x59c91c=_0x14b845[_0x8977('0x75')]()[_0x8977('0x3f')](_0x8977('0x71'));if(_0x93d70[_0x8977('0x3a')]){_0x93d70[_0x8977('0x3a')][_0x8977('0x52')](function(_0x2e32c3){_0x14b845['order']('c.'+_0x2e32c3[0x0],_0x2e32c3[0x1]===_0x8977('0x76')?![]:!![]);});}if(!_[_0x8977('0x77')](_0x176315)){_0x14b845[_0x8977('0x78')](_0x1c599b);_0x59c91c[_0x8977('0x3c')](_0x8977('0x79'),_0x176315);}BPromise[_0x8977('0x7a')]()[_0x8977('0x23')](function(){if(_0x2ebb86&&!_[_0x8977('0x7b')](_0x2ebb86[_0x8977('0x4d')],[_0x8977('0x3f'),_0x8977('0x55')])){return _0x3d3f4c['user'][_0x8977('0x7c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x357d0f){if(_[_0x8977('0x77')](_0x357d0f)){_0x59c91c[_0x8977('0x3c')](_0x8977('0x7d'));_0x14b845[_0x8977('0x3c')](_0x8977('0x7d'));}else{_0x59c91c[_0x8977('0x3c')](_0x8977('0x7e'),_['map'](_0x357d0f,'id'));_0x14b845[_0x8977('0x3c')](_0x8977('0x7e'),_[_0x8977('0x51')](_0x357d0f,'id'));}});}else{return;}})[_0x8977('0x23')](function(){db[_0x8977('0x7f')][_0x8977('0x32')](_0x59c91c['toString'](),_0x57acee)[_0x8977('0x23')](function(_0xa395bc){_0x4bdb2d[_0x8977('0x80')]=_0xa395bc[_0x8977('0x29')];if(_0x4bdb2d[_0x8977('0x80')]===0x0)return[];return db[_0x8977('0x7f')][_0x8977('0x32')](_0x1edffc[_0x8977('0x81')](),_0x57acee);})['then'](function(_0xbfdaa3){_0x38fe33=_[_0x8977('0x82')](_0xbfdaa3,'id');_0x57acee=_[_0x8977('0x83')](_0x57acee,{'model':db[_0x8977('0x28')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d3f4c[_0x8977('0x32')][_0x8977('0x35')]){_0x93d70[_0x8977('0x36')]['forEach'](function(_0x3bcab6){_0x14b845[_0x8977('0x3f')]('c.'+_0x3bcab6);});}else{_0x14b845[_0x8977('0x3f')]('c.id');_0x14b845['field'](_0x8977('0x84'));_0x14b845[_0x8977('0x3f')](_0x8977('0x85'));_0x14b845[_0x8977('0x3f')](_0x8977('0x86'));_0x14b845[_0x8977('0x3f')](_0x8977('0x87'));_0x14b845[_0x8977('0x3f')]('c.fax');_0x14b845[_0x8977('0x3f')]('c.email');_0x14b845[_0x8977('0x3f')]('c.ListId');_0x14b845[_0x8977('0x3f')](_0x8977('0x88'));_0x14b845[_0x8977('0x3f')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x93d70[_0x8977('0x1d')])_0x14b845[_0x8977('0x1d')](_0x93d70['limit']);if(_0x93d70[_0x8977('0x39')])_0x14b845[_0x8977('0x39')](_0x93d70[_0x8977('0x39')]);return db[_0x8977('0x7f')][_0x8977('0x32')](_0x14b845[_0x8977('0x81')](),_0x57acee);})['then'](function(_0x133368){_0x133368[_0x8977('0x52')](function(_0x3edf01){if(_0x3edf01['TagIds']){_0x3edf01['Tags']=[];_0x3edf01[_0x8977('0x89')]['split'](',')[_0x8977('0x52')](function(_0xbfa31d){_0x3edf01['Tags'][_0x8977('0x2c')](_0x38fe33[_0xbfa31d]);});}delete _0x3edf01['TagIds'];});_0x4bdb2d[_0x8977('0x8a')]=_0x133368;return _0x4bdb2d;})[_0x8977('0x23')](respondWithFilteredResult(_0xf5ae90,_0x93d70));});})[_0x8977('0x8b')](handleError(_0xf5ae90,null));};exports[_0x8977('0x24')]=function(_0x296cbd,_0x49682b){return db[_0x8977('0x28')][_0x8977('0x4e')]({'where':{'id':_0x296cbd['params']['id']}})[_0x8977('0x23')](handleEntityNotFound(_0x49682b,null))[_0x8977('0x23')](removeEntity(_0x49682b,null))[_0x8977('0x8b')](handleError(_0x49682b,null));};exports[_0x8977('0x8c')]=function(_0x3bc63d,_0x7c6d9d){return db[_0x8977('0x28')]['describe']()[_0x8977('0x23')](function(_0x2df8d5){delete _0x2df8d5[_0x8977('0x8d')];for(var _0x33b074=0x0;_0x33b074<Object[_0x8977('0x31')](_0x2df8d5)[_0x8977('0x29')];_0x33b074++){var _0xe2c507=Object[_0x8977('0x31')](_0x2df8d5)[_0x33b074];if(!_[_0x8977('0x2a')](_0xe2c507,'cf_')){_0x2df8d5[_0xe2c507][_0x8977('0x8e')]=_0xe2c507;_0x2df8d5[_0xe2c507][_0x8977('0x8f')]=_0xe2c507;}}return _0x2df8d5;})[_0x8977('0x23')](function(_0x45f07a){var _0x294be7={'where':{'$or':[{'ListId':_0x3bc63d[_0x8977('0x32')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x8977('0x2d')]['findAll'](_0x294be7)[_0x8977('0x23')](function(_0x14366c){for(var _0x18c23c=0x0;_0x18c23c<_0x14366c[_0x8977('0x29')];_0x18c23c++){var _0x371ef3=_0x8977('0x2b')+_0x14366c[_0x18c23c]['id'];_0x45f07a[_0x371ef3][_0x8977('0x8e')]=_0x371ef3;_0x45f07a[_0x371ef3]['displayName']=_0x14366c[_0x18c23c][_0x8977('0x90')];_0x45f07a[_0x371ef3][_0x8977('0x91')]={'type':_0x14366c[_0x18c23c]['type'],'values':_0x14366c[_0x18c23c][_0x8977('0x92')]};}Object[_0x8977('0x31')](_0x45f07a)['forEach'](function(_0x5cfcf9){if(!_0x45f07a[_0x5cfcf9][_0x8977('0x37')](_0x8977('0x8e'))){delete _0x45f07a[_0x5cfcf9];}});return _0x45f07a;});})[_0x8977('0x23')](respondWithResult(_0x7c6d9d,null))[_0x8977('0x8b')](handleError(_0x7c6d9d,null));};exports['merge']=function(_0x3f20fc,_0x540caa){var _0xaef795;var _0x2f648f;var _0x17a9f9;if(_0x3f20fc[_0x8977('0x93')]['id']){delete _0x3f20fc['body']['id'];}return db[_0x8977('0x28')][_0x8977('0x94')]({'where':{'id':[_0x3f20fc['body']['to'],_0x3f20fc[_0x8977('0x93')][_0x8977('0x41')]]}})[_0x8977('0x23')](function(_0xc3a765){if(_0xc3a765){if(_0xc3a765[_0x8977('0x29')]!==0x2){return null;}_0xc3a765[0x0]=_0xc3a765[0x0][_0x8977('0x95')]({'plain':!![]});_0xc3a765[0x1]=_0xc3a765[0x1]['get']({'plain':!![]});delete _0xc3a765[0x0]['id'];delete _0xc3a765[0x1]['id'];return _[_0x8977('0x96')](_0xc3a765[0x0],_0xc3a765[0x1],function(_0x159818,_0x5602de){if(Array[_0x8977('0x63')](_0x5602de)&&!_0x5602de[_0x8977('0x29')]){return _0x159818;}else if(!_0x5602de){return _0x159818;}});}})[_0x8977('0x23')](handleEntityNotFound(_0x540caa,null))[_0x8977('0x23')](function(_0x552bfe){if(_0x552bfe){if(_0x552bfe[_0x8977('0x8d')]&&_[_0x8977('0x63')](_0x552bfe[_0x8977('0x8d')])){_0x552bfe[_0x8977('0x8d')]=_0x552bfe[_0x8977('0x8d')]['join']();}logger['info']('[CmContact][merge]\x20to\x20%s\x20from\x20%s',_0x3f20fc['body']['to'],_0x3f20fc[_0x8977('0x93')][_0x8977('0x41')]);return db[_0x8977('0x97')][_0x8977('0x24')]({'where':{'ContactId':[_0x3f20fc['body']['to'],_0x3f20fc['body'][_0x8977('0x41')]]}})[_0x8977('0x23')](function(_0x537623){logger[_0x8977('0x98')](_0x8977('0x99'),_0x537623);return db[_0x8977('0x9a')][_0x8977('0x24')]({'where':{'ContactId':[_0x3f20fc['body']['to'],_0x3f20fc[_0x8977('0x93')][_0x8977('0x41')]]}})[_0x8977('0x23')](function(_0x426282){logger[_0x8977('0x98')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x426282);return db[_0x8977('0x28')]['create'](_0x552bfe);});});}})[_0x8977('0x23')](function(_0xaf9394){if(_0xaf9394){_0xaef795=_0xaf9394;_0x2f648f={'ContactId':_0xaef795['id']};_0x17a9f9={'where':{'ContactId':[_0x3f20fc[_0x8977('0x93')]['to'],_0x3f20fc[_0x8977('0x93')][_0x8977('0x41')]]}};return db[_0x8977('0x9b')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db['ChatMessage'][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0x9c')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0x9d')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0x9e')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0x9d')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0x9e')]['update'](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db['SmsInteraction']['update'](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0x9f')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db['FaxInteraction']['update'](_0x2f648f,_0x17a9f9);}})['then'](function(){if(_0xaef795){return db[_0x8977('0xa0')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0xa1')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db['OpenchannelMessage'][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})['then'](function(){if(_0xaef795){return db['CmHopperFinal'][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})['then'](function(){if(_0xaef795){return db[_0x8977('0xa2')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})['then'](function(){if(_0xaef795){return db['ReportAgentPreview'][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0xa3')]['update'](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0xa4')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0xa5')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0xa6')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db['OpenchannelQueueReport'][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0xa7')][_0x8977('0x22')](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0xa8')]['update'](_0x2f648f,_0x17a9f9);}})[_0x8977('0x23')](function(){if(_0xaef795){return db[_0x8977('0x28')]['destroy']({'where':{'id':[_0x3f20fc[_0x8977('0x93')]['to'],_0x3f20fc['body']['from']]}});}})[_0x8977('0x23')](function(){if(_0xaef795){return _0xaef795;}})['then'](respondWithResult(_0x540caa,null))['catch'](handleError(_0x540caa,null));};exports[_0x8977('0xa9')]=function(_0x200996,_0x4fdf55){return db[_0x8977('0x28')]['describe']()['then'](function(_0x47f832){if(_0x200996['body']['tags']&&_[_0x8977('0x63')](_0x200996[_0x8977('0x93')][_0x8977('0x8d')])){if(_0x200996[_0x8977('0x93')][_0x8977('0x8d')][_0x8977('0x29')]){_0x200996['body'][_0x8977('0x8d')]=_0x200996[_0x8977('0x93')][_0x8977('0x8d')][_0x8977('0xaa')](';')+';';}else{_0x200996[_0x8977('0x93')][_0x8977('0x8d')]=null;}}else{_0x200996['body'][_0x8977('0x8d')]=null;}return db[_0x8977('0x28')][_0x8977('0xa9')](_0x200996[_0x8977('0x93')],{'fields':_[_0x8977('0x31')](_0x47f832),'raw':!![]});})['then'](respondWithResult(_0x4fdf55,0xc9))['catch'](handleError(_0x4fdf55,null));};exports[_0x8977('0xab')]=function(_0x3ebad2,_0x1f28b4){var _0x1145fb=[];var _0x27e6cd=0x0;var _0x9d6925=0x0;var _0x234129=0x0;return db[_0x8977('0x28')]['describe']()['then'](function(_0x1c49c5){return BPromise['each'](_0x3ebad2[_0x8977('0x93')],function(_0x4b712a){var _0x32f8d3={'where':{'$or':[]},'defaults':_0x4b712a,'fields':_[_0x8977('0x31')](_0x1c49c5),'raw':!![]};if(_0x4b712a[_0x8977('0xac')]){for(var _0x7186c4=0x0;_0x7186c4<_0x4b712a[_0x8977('0xac')][_0x8977('0x29')];_0x7186c4++){var _0x3d0a9e={};_0x3d0a9e[_0x4b712a['duplicates'][_0x7186c4]]=_0x4b712a[_0x4b712a[_0x8977('0xac')][_0x7186c4]];_0x32f8d3[_0x8977('0x3c')]['$or']['push'](_0x3d0a9e);}_0x32f8d3[_0x8977('0x3c')][_0x8977('0x5f')]=_0x4b712a[_0x8977('0x5f')];}return db[_0x8977('0x28')][_0x8977('0xad')](_0x32f8d3)[_0x8977('0xae')](function(_0x26c268,_0xd8ff2a){if(_0xd8ff2a){_0x27e6cd++;}else{_0x234129++;}})['catch'](function(_0x2b7ce3){console[_0x8977('0xaf')](_0x2b7ce3);_0x9d6925++;});});})['then'](function(_0x4f5df4){if(_0x4f5df4){return{'success':_0x27e6cd,'failure':_0x9d6925,'duplicates':_0x234129};}})[_0x8977('0x23')](respondWithResult(_0x1f28b4,0xc9))['catch'](handleError(_0x1f28b4,null));};exports[_0x8977('0xb0')]=function(_0x33225e,_0x168c5b,_0x33153a){var _0x4e97ce;return db[_0x8977('0x28')][_0x8977('0x8c')]()[_0x8977('0x23')](function(_0x4f2ab3){return db[_0x8977('0x28')]['find']({'where':{'id':_0x33225e['params']['id']},'include':[{'model':db[_0x8977('0x4f')],'as':_0x8977('0xb1'),'attributes':['id',_0x8977('0x26'),'color'],'required':_0x33225e[_0x8977('0x32')]['tag']?!![]:![]}],'attributes':_['keys'](_0x4f2ab3)});})['then'](function(_0xa8696b){_0x4e97ce=_0xa8696b[_0x8977('0x95')]({'plain':!![]});var _0xc8175a={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xa8696b&&_0xa8696b['ListId']){if(_0xa8696b['ListId']){_0xc8175a[_0x8977('0x3c')][_0x8977('0xb2')][_0x8977('0x2c')]({'ListId':{'$ne':_0xa8696b[_0x8977('0x5f')]}});}}return db[_0x8977('0x2d')][_0x8977('0x94')](_0xc8175a);})[_0x8977('0x23')](function(_0xcceb80){return _[_0x8977('0xb3')](_0x4e97ce,_[_0x8977('0x51')](_0xcceb80,function(_0x163133){return util[_0x8977('0xb4')]('cf_%d',_0x163133['id']);}));})[_0x8977('0x23')](handleEntityNotFound(_0x168c5b,null))['then'](respondWithResult(_0x168c5b,null))[_0x8977('0x8b')](handleError(_0x168c5b,null));};exports[_0x8977('0x22')]=function(_0x3492ea,_0x2f009e){var _0x161a4e;if(_0x3492ea['body']['id']){delete _0x3492ea['body']['id'];}return db['CmContact'][_0x8977('0x4e')]({'where':{'id':_0x3492ea[_0x8977('0xb5')]['id']}})['then'](handleEntityNotFound(_0x2f009e,null))[_0x8977('0x23')](saveUpdates(_0x3492ea['body'],null))[_0x8977('0x23')](function(_0x29b7b8){_0x161a4e=_0x29b7b8;var _0x174d12={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x29b7b8&&_0x29b7b8[_0x8977('0x5f')]){if(_0x29b7b8['ListId']){_0x174d12[_0x8977('0x3c')]['$and'][_0x8977('0x2c')]({'ListId':{'$ne':_0x29b7b8[_0x8977('0x5f')]}});}}return db[_0x8977('0x2d')][_0x8977('0x94')](_0x174d12);})[_0x8977('0x23')](function(_0x4f6cfd){if(_0x4f6cfd){return _[_0x8977('0xb3')](_['pickBy'](_0x3492ea[_0x8977('0x93')],function(_0x2fac06,_0x4b3587){return _['startsWith'](_0x4b3587,_0x8977('0x2b'));}),_['map'](_0x4f6cfd,function(_0x122dfa){return util['format'](_0x8977('0xb6'),_0x122dfa['id']);}));}})[_0x8977('0x23')](function(_0x4dd669){if(_0x4dd669&&!_[_0x8977('0x77')](_0x4dd669)){var _0x4e2c8e=squel[_0x8977('0x22')]()[_0x8977('0xb7')]('cm_contacts')[_0x8977('0xb8')](_0x4dd669)[_0x8977('0x3c')]('id\x20=\x20?',_0x3492ea[_0x8977('0xb5')]['id'])[_0x8977('0xb9')]();return db[_0x8977('0x7f')][_0x8977('0x32')](_0x4e2c8e[_0x8977('0x5b')],{'replacements':_0x4e2c8e['values']});}})[_0x8977('0x23')](function(){if(_0x3492ea['body'][_0x8977('0xba')]&&_0x161a4e){return db[_0x8977('0x97')]['update']({'phone':_0x3492ea[_0x8977('0x93')]['phone']},{'where':{'ContactId':_0x161a4e['id']}});}})[_0x8977('0x23')](function(){return _0x161a4e;})['then'](respondWithResult(_0x2f009e,null))[_0x8977('0x8b')](handleError(_0x2f009e,null));};exports[_0x8977('0xbb')]=function(_0x13d805,_0x28e340,_0x2741d6){var _0x142ced={};var _0x25a890={};var _0x4bba91;var _0x216a67;return db[_0x8977('0x28')][_0x8977('0x2e')]({'where':{'id':_0x13d805['params']['id']}})[_0x8977('0x23')](handleEntityNotFound(_0x28e340,null))[_0x8977('0x23')](function(_0x438ca0){if(_0x438ca0){_0x4bba91=_0x438ca0;_0x25a890[_0x8977('0x30')]=_[_0x8977('0x31')](db[_0x8977('0x4f')][_0x8977('0xbc')]);_0x25a890['query']=_[_0x8977('0x31')](_0x13d805[_0x8977('0x32')]);_0x25a890['filters']=_[_0x8977('0x34')](_0x25a890['model'],_0x25a890[_0x8977('0x32')]);_0x142ced[_0x8977('0x36')]=_[_0x8977('0x34')](_0x25a890[_0x8977('0x30')],qs['fields'](_0x13d805[_0x8977('0x32')][_0x8977('0x35')]));_0x142ced[_0x8977('0x36')]=_0x142ced[_0x8977('0x36')]['length']?_0x142ced['attributes']:_0x25a890[_0x8977('0x30')];_0x142ced[_0x8977('0x3a')]=qs[_0x8977('0x3b')](_0x13d805[_0x8977('0x32')][_0x8977('0x3b')]);_0x142ced[_0x8977('0x3c')]=qs[_0x8977('0x33')](_['pick'](_0x13d805[_0x8977('0x32')],_0x25a890[_0x8977('0x33')]));if(_0x13d805[_0x8977('0x32')][_0x8977('0x5c')]){_0x142ced[_0x8977('0x3c')]=_[_0x8977('0x83')](_0x142ced[_0x8977('0x3c')],{'$or':_[_0x8977('0x51')](_0x142ced[_0x8977('0x36')],function(_0x1185fc){var _0xd72f5f={};_0xd72f5f[_0x1185fc]={'$like':'%'+_0x13d805[_0x8977('0x32')][_0x8977('0x5c')]+'%'};return _0xd72f5f;})});}_0x142ced=_['merge']({},_0x142ced,_0x13d805['options']);return _0x4bba91[_0x8977('0xbb')](_0x142ced);}})[_0x8977('0x23')](function(_0x5cc1df){if(_0x5cc1df){_0x216a67=_0x5cc1df[_0x8977('0x29')];if(!_0x13d805[_0x8977('0x32')][_0x8977('0x37')](_0x8977('0x38'))){_0x142ced[_0x8977('0x1d')]=qs[_0x8977('0x1d')](_0x13d805[_0x8977('0x32')]['limit']);_0x142ced[_0x8977('0x39')]=qs['offset'](_0x13d805[_0x8977('0x32')]['offset']);}return _0x4bba91[_0x8977('0xbb')](_0x142ced);}})['then'](function(_0x500d43){if(_0x500d43){return _0x500d43?{'count':_0x216a67,'rows':_0x500d43}:null;}})[_0x8977('0x23')](respondWithResult(_0x28e340,null))[_0x8977('0x8b')](handleError(_0x28e340,null));};exports[_0x8977('0xbd')]=function(_0x2bbead,_0x38cbae,_0xe8dc02){if(_0x2bbead['body']['id']){delete _0x2bbead[_0x8977('0x93')]['id'];}return db[_0x8977('0x28')][_0x8977('0x2e')]({'where':{'id':_0x2bbead['params']['id']}})[_0x8977('0x23')](handleEntityNotFound(_0x38cbae,null))[_0x8977('0x23')](function(_0xbfa16b){if(_0xbfa16b){return _0xbfa16b['setTags'](_0x2bbead[_0x8977('0x93')][_0x8977('0xbe')]||[]);}return null;})[_0x8977('0x23')](respondWithResult(_0x38cbae,null))[_0x8977('0x8b')](handleError(_0x38cbae,null));};exports[_0x8977('0xbf')]=function(_0x55a83b,_0x1854a8,_0x498bc5){var _0x5c49d8={'raw':![],'where':{}};var _0x3c84ed={};var _0xd05b3e={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x55a83b[_0x8977('0xb5')]['id']}})[_0x8977('0x23')](handleEntityNotFound(_0x1854a8,null))['then'](function(_0x42ef20){if(_0x42ef20){_0x3c84ed['model']=_[_0x8977('0x31')](db[_0x8977('0x97')][_0x8977('0xbc')]);_0x3c84ed[_0x8977('0x32')]=_[_0x8977('0x31')](_0x55a83b[_0x8977('0x32')]);_0x3c84ed[_0x8977('0x33')]=_[_0x8977('0x34')](_0x3c84ed[_0x8977('0x30')],_0x3c84ed[_0x8977('0x32')]);_0x5c49d8[_0x8977('0x36')]=_[_0x8977('0x34')](_0x3c84ed[_0x8977('0x30')],qs[_0x8977('0x35')](_0x55a83b['query'][_0x8977('0x35')]));_0x5c49d8[_0x8977('0x36')]=_0x5c49d8[_0x8977('0x36')][_0x8977('0x29')]?_0x5c49d8[_0x8977('0x36')]:_0x3c84ed['model'];if(!_0x55a83b['query'][_0x8977('0x37')](_0x8977('0x38'))){_0x5c49d8[_0x8977('0x1d')]=qs[_0x8977('0x1d')](_0x55a83b[_0x8977('0x32')]['limit']);_0x5c49d8['offset']=qs[_0x8977('0x39')](_0x55a83b[_0x8977('0x32')][_0x8977('0x39')]);}_0x5c49d8['order']=qs[_0x8977('0x3b')](_0x55a83b[_0x8977('0x32')]['sort']);_0x5c49d8['where']=qs[_0x8977('0x33')](_[_0x8977('0x3d')](_0x55a83b[_0x8977('0x32')],_0x3c84ed[_0x8977('0x33')]));_0x5c49d8[_0x8977('0x3c')][_0x8977('0xc0')]=_0x42ef20['id'];if(_0x55a83b[_0x8977('0x32')][_0x8977('0x5c')]){_0x5c49d8[_0x8977('0x3c')]=_[_0x8977('0x83')](_0x5c49d8[_0x8977('0x3c')],{'$or':_[_0x8977('0x51')](_0x5c49d8[_0x8977('0x36')],function(_0x4c5247){var _0x10e09f={};_0x10e09f[_0x4c5247]={'$like':'%'+_0x55a83b[_0x8977('0x32')]['filter']+'%'};return _0x10e09f;})});}_0x5c49d8=_[_0x8977('0x83')]({},_0x5c49d8,_0x55a83b[_0x8977('0xc1')]);return db[_0x8977('0x97')][_0x8977('0x80')]({'where':_0x5c49d8[_0x8977('0x3c')]})[_0x8977('0x23')](function(_0x20751a){_0xd05b3e['count']=_0x20751a;if(_0x55a83b[_0x8977('0x32')]['includeAll']){_0x5c49d8['include']=[{'all':!![]}];}return db['CmHopper'][_0x8977('0x94')](_0x5c49d8);})['then'](function(_0x1af9ae){_0xd05b3e[_0x8977('0x8a')]=_0x1af9ae;return _0xd05b3e;});}})[_0x8977('0x23')](respondWithFilteredResult(_0x1854a8,_0x5c49d8))['catch'](handleError(_0x1854a8,null));};exports[_0x8977('0xc2')]=function(_0xb7e08d,_0x1ebf08,_0x54dff0){var _0x31a884={'raw':!![],'where':{}};var _0x583288={};var _0x1dd3cc={'count':0x0,'rows':[]};return db['CmContact'][_0x8977('0x2e')]({'where':{'id':_0xb7e08d[_0x8977('0xb5')]['id']}})['then'](handleEntityNotFound(_0x1ebf08,null))[_0x8977('0x23')](function(_0xfc005e){if(_0xfc005e){_0x583288['model']=_[_0x8977('0x31')](db['CmHopperHistory']['rawAttributes']);_0x583288[_0x8977('0x32')]=_[_0x8977('0x31')](_0xb7e08d[_0x8977('0x32')]);_0x583288[_0x8977('0x33')]=_[_0x8977('0x34')](_0x583288['model'],_0x583288[_0x8977('0x32')]);_0x31a884['attributes']=_[_0x8977('0x34')](_0x583288[_0x8977('0x30')],qs[_0x8977('0x35')](_0xb7e08d['query']['fields']));_0x31a884[_0x8977('0x36')]=_0x31a884[_0x8977('0x36')][_0x8977('0x29')]?_0x31a884['attributes']:_0x583288[_0x8977('0x30')];if(!_0xb7e08d[_0x8977('0x32')]['hasOwnProperty'](_0x8977('0x38'))){_0x31a884['limit']=qs[_0x8977('0x1d')](_0xb7e08d[_0x8977('0x32')][_0x8977('0x1d')]);_0x31a884['offset']=qs[_0x8977('0x39')](_0xb7e08d[_0x8977('0x32')][_0x8977('0x39')]);}_0x31a884[_0x8977('0x3a')]=qs[_0x8977('0x3b')](_0xb7e08d[_0x8977('0x32')][_0x8977('0x3b')]);_0x31a884[_0x8977('0x3c')]=qs[_0x8977('0x33')](_[_0x8977('0x3d')](_0xb7e08d[_0x8977('0x32')],_0x583288[_0x8977('0x33')]));_0x31a884[_0x8977('0x3c')]['ContactId']=_0xfc005e['id'];if(_0xb7e08d[_0x8977('0x32')]['filter']){_0x31a884['where']=_[_0x8977('0x83')](_0x31a884['where'],{'$or':_[_0x8977('0x51')](_0x31a884[_0x8977('0x36')],function(_0x5d8792){var _0x3409ba={};_0x3409ba[_0x5d8792]={'$like':'%'+_0xb7e08d['query'][_0x8977('0x5c')]+'%'};return _0x3409ba;})});}_0x31a884=_['merge']({},_0x31a884,_0xb7e08d[_0x8977('0xc1')]);return db['CmHopperHistory'][_0x8977('0x80')]({'where':_0x31a884[_0x8977('0x3c')]})[_0x8977('0x23')](function(_0x42d768){_0x1dd3cc['count']=_0x42d768;if(_0xb7e08d[_0x8977('0x32')][_0x8977('0xc3')]){_0x31a884[_0x8977('0xc4')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x31a884);})[_0x8977('0x23')](function(_0x519754){_0x1dd3cc[_0x8977('0x8a')]=_0x519754;return _0x1dd3cc;});}})[_0x8977('0x23')](respondWithFilteredResult(_0x1ebf08,_0x31a884))[_0x8977('0x8b')](handleError(_0x1ebf08,null));};exports[_0x8977('0xc5')]=function(_0x1bdf67,_0x452dfb,_0x4aacc6){var _0x1b7cd1={'raw':!![],'where':{}};var _0xb2b66a={};var _0xd6d937={'count':0x0,'rows':[]};return db[_0x8977('0x28')][_0x8977('0x2e')]({'where':{'id':_0x1bdf67[_0x8977('0xb5')]['id']}})[_0x8977('0x23')](handleEntityNotFound(_0x452dfb,null))['then'](function(_0x1b739f){if(_0x1b739f){_0xb2b66a[_0x8977('0x30')]=_['keys'](db[_0x8977('0xc6')][_0x8977('0xbc')]);_0xb2b66a[_0x8977('0x32')]=_[_0x8977('0x31')](_0x1bdf67[_0x8977('0x32')]);_0xb2b66a['filters']=_[_0x8977('0x34')](_0xb2b66a[_0x8977('0x30')],_0xb2b66a['query']);_0x1b7cd1[_0x8977('0x36')]=_[_0x8977('0x34')](_0xb2b66a[_0x8977('0x30')],qs[_0x8977('0x35')](_0x1bdf67[_0x8977('0x32')][_0x8977('0x35')]));_0x1b7cd1[_0x8977('0x36')]=_0x1b7cd1[_0x8977('0x36')]['length']?_0x1b7cd1['attributes']:_0xb2b66a[_0x8977('0x30')];if(!_0x1bdf67[_0x8977('0x32')]['hasOwnProperty'](_0x8977('0x38'))){_0x1b7cd1[_0x8977('0x1d')]=qs[_0x8977('0x1d')](_0x1bdf67['query'][_0x8977('0x1d')]);_0x1b7cd1[_0x8977('0x39')]=qs['offset'](_0x1bdf67['query'][_0x8977('0x39')]);}_0x1b7cd1['order']=qs['sort'](_0x1bdf67[_0x8977('0x32')][_0x8977('0x3b')]);_0x1b7cd1[_0x8977('0x3c')]=qs[_0x8977('0x33')](_[_0x8977('0x3d')](_0x1bdf67[_0x8977('0x32')],_0xb2b66a['filters']));_0x1b7cd1[_0x8977('0x3c')][_0x8977('0xc0')]=_0x1b739f['id'];if(_0x1bdf67[_0x8977('0x32')]['filter']){_0x1b7cd1[_0x8977('0x3c')]=_[_0x8977('0x83')](_0x1b7cd1['where'],{'$or':_[_0x8977('0x51')](_0x1b7cd1[_0x8977('0x36')],function(_0x2b3a28){var _0x3d6b2f={};_0x3d6b2f[_0x2b3a28]={'$like':'%'+_0x1bdf67[_0x8977('0x32')][_0x8977('0x5c')]+'%'};return _0x3d6b2f;})});}_0x1b7cd1=_[_0x8977('0x83')]({},_0x1b7cd1,_0x1bdf67[_0x8977('0xc1')]);return db['CmHopperFinal']['count']({'where':_0x1b7cd1[_0x8977('0x3c')]})[_0x8977('0x23')](function(_0x417307){_0xd6d937[_0x8977('0x80')]=_0x417307;if(_0x1bdf67[_0x8977('0x32')][_0x8977('0xc3')]){_0x1b7cd1[_0x8977('0xc4')]=[{'all':!![]}];}return db[_0x8977('0xc6')][_0x8977('0x94')](_0x1b7cd1);})[_0x8977('0x23')](function(_0x1d2fbc){_0xd6d937[_0x8977('0x8a')]=_0x1d2fbc;return _0xd6d937;});}})[_0x8977('0x23')](respondWithFilteredResult(_0x452dfb,_0x1b7cd1))[_0x8977('0x8b')](handleError(_0x452dfb,null));};exports[_0x8977('0xc7')]=function(_0x176930,_0x52fad7,_0x15646f){var _0x2e31c8={'raw':!![],'where':{}};var _0x340dab={};var _0x3df1d5={'count':0x0,'rows':[]};return db[_0x8977('0x28')][_0x8977('0x2e')]({'where':{'id':_0x176930[_0x8977('0xb5')]['id']}})[_0x8977('0x23')](handleEntityNotFound(_0x52fad7,null))[_0x8977('0x23')](function(_0x299465){if(_0x299465){_0x340dab['model']=_[_0x8977('0x31')](db[_0x8977('0xa8')][_0x8977('0xbc')]);_0x340dab[_0x8977('0x32')]=_[_0x8977('0x31')](_0x176930[_0x8977('0x32')]);_0x340dab['filters']=_[_0x8977('0x34')](_0x340dab[_0x8977('0x30')],_0x340dab[_0x8977('0x32')]);_0x2e31c8['attributes']=_[_0x8977('0x34')](_0x340dab[_0x8977('0x30')],qs[_0x8977('0x35')](_0x176930[_0x8977('0x32')][_0x8977('0x35')]));_0x2e31c8[_0x8977('0x36')]=_0x2e31c8[_0x8977('0x36')][_0x8977('0x29')]?_0x2e31c8[_0x8977('0x36')]:_0x340dab['model'];if(!_0x176930[_0x8977('0x32')][_0x8977('0x37')](_0x8977('0x38'))){_0x2e31c8[_0x8977('0x1d')]=qs['limit'](_0x176930[_0x8977('0x32')][_0x8977('0x1d')]);_0x2e31c8[_0x8977('0x39')]=qs[_0x8977('0x39')](_0x176930[_0x8977('0x32')][_0x8977('0x39')]);}_0x2e31c8[_0x8977('0x3a')]=qs[_0x8977('0x3b')](_0x176930[_0x8977('0x32')][_0x8977('0x3b')]);_0x2e31c8[_0x8977('0x3c')]=qs[_0x8977('0x33')](_[_0x8977('0x3d')](_0x176930[_0x8977('0x32')],_0x340dab[_0x8977('0x33')]));_0x2e31c8[_0x8977('0x3c')][_0x8977('0xc0')]=_0x299465['id'];if(_0x176930[_0x8977('0x32')][_0x8977('0x5c')]){_0x2e31c8[_0x8977('0x3c')]=_[_0x8977('0x83')](_0x2e31c8['where'],{'$or':_[_0x8977('0x51')](_0x2e31c8[_0x8977('0x36')],function(_0x1d4d56){var _0x521450={};_0x521450[_0x1d4d56]={'$like':'%'+_0x176930['query'][_0x8977('0x5c')]+'%'};return _0x521450;})});}_0x2e31c8=_[_0x8977('0x83')]({},_0x2e31c8,_0x176930['options']);return db[_0x8977('0xa8')][_0x8977('0x80')]({'where':_0x2e31c8['where']})['then'](function(_0x44f962){_0x3df1d5[_0x8977('0x80')]=_0x44f962;if(_0x176930[_0x8977('0x32')][_0x8977('0xc3')]){_0x2e31c8[_0x8977('0xc4')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x2e31c8);})[_0x8977('0x23')](function(_0xe154ad){_0x3df1d5[_0x8977('0x8a')]=_0xe154ad;return _0x3df1d5;});}})[_0x8977('0x23')](respondWithFilteredResult(_0x52fad7,_0x2e31c8))[_0x8977('0x8b')](handleError(_0x52fad7,null));};exports[_0x8977('0xc8')]=function(_0x18a4c6,_0x2ff2d3,_0x185fa0){try{if(!_0x18a4c6[_0x8977('0x93')][_0x8977('0x5f')]){throw new Error(_0x8977('0xc9'));}if(!_0x18a4c6[_0x8977('0x93')]['binding_keys']){throw new Error(_0x8977('0xca'));}if(!_0x18a4c6[_0x8977('0x93')][_0x8977('0xcb')]){throw new Error(_0x8977('0xcc'));}if(!_0x18a4c6['body'][_0x8977('0xcd')]){throw new Error(_0x8977('0xce'));}var _0x21046b=_0x18a4c6[_0x8977('0x93')][_0x8977('0xcf')]['split'](',');var _0x40eba5=_0x18a4c6[_0x8977('0x93')][_0x8977('0xcb')][_0x8977('0x50')](',');if(!_0x21046b[_0x8977('0x29')]||!_0x40eba5[_0x8977('0x29')]||_0x21046b[_0x8977('0x29')]!==_0x40eba5[_0x8977('0x29')]){throw new Error(_0x8977('0xd0'));}_0x18a4c6[_0x8977('0x93')][_0x8977('0x35')]=_[_0x8977('0xd1')](_0x21046b,_0x40eba5);if(!_0x18a4c6['body'][_0x8977('0x35')][_0x8977('0xba')]){throw new Error(_0x8977('0xd2'));}if(!_0x18a4c6[_0x8977('0x93')][_0x8977('0x35')][_0x8977('0xd3')]){throw new Error(_0x8977('0xd4'));}var _0x5eecb9=path[_0x8977('0xaa')](config[_0x8977('0xd5')],_0x8977('0xd6'),_0x18a4c6['file'][_0x8977('0xd7')]);fs[_0x8977('0xd8')](_0x5eecb9,parseInt(_0x8977('0xd9'),0x8));var _0x491c00=require(_0x8977('0xda'))['fork'](path[_0x8977('0xaa')](__dirname,'../../components/import/cm/csv'),[_0x5eecb9,_0x18a4c6[_0x8977('0x93')][_0x8977('0xcf')],_0x18a4c6['body'][_0x8977('0xcb')],_0x18a4c6[_0x8977('0x93')][_0x8977('0x5f')],_0x18a4c6[_0x8977('0x93')][_0x8977('0xdb')],_0x18a4c6['body'][_0x8977('0xac')],_0x18a4c6['body']['socket_timestamp']]);return _0x2ff2d3['status'](0xc8)[_0x8977('0xdc')]({'message':_0x8977('0xdd'),'pid':_0x491c00[_0x8977('0xde')]});}catch(_0x5dc489){return _0x2ff2d3[_0x8977('0x1c')](0x1f4)[_0x8977('0x27')](_0x5dc489);}};exports[_0x8977('0xdf')]=function(_0x5f1200,_0x240ab9,_0x55ea8e){var _0x2c16bf=fs[_0x8977('0xe0')](_0x5f1200['file'][_0x8977('0x7')]);Papa[_0x8977('0xe1')](_0x2c16bf,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4a9eea){return _0x240ab9[_0x8977('0x1c')](0xc8)[_0x8977('0xdc')]({'file':_0x5f1200['file'],'fields':_0x4a9eea['meta'][_0x8977('0x35')]});}});};exports[_0x8977('0xe2')]=function(_0x475a80,_0x181b2d,_0x2beec7){return db[_0x8977('0x55')][_0x8977('0x94')]({'raw':!![],'attributes':['id'],'where':{'role':_0x8977('0xe3')}})[_0x8977('0x23')](function(_0x22ae16){var _0x1e24e5=![];if(!_0x475a80[_0x8977('0x93')]['ListId']){throw new Error(_0x8977('0xc9'));}if(!_0x475a80['body'][_0x8977('0xe4')][_0x8977('0xba')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x475a80[_0x8977('0x93')][_0x8977('0xe4')][_0x8977('0xd3')]){throw new Error(_0x8977('0xd4'));}if(!_0x475a80[_0x8977('0x93')][_0x8977('0xcd')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x29341f=require('child_process')[_0x8977('0xe5')](path['join'](__dirname,_0x8977('0xe6')),[_0x475a80[_0x8977('0xb5')]['id'],JSON[_0x8977('0xe7')](_0x475a80[_0x8977('0x93')]),JSON[_0x8977('0xe7')](_0x22ae16)]);_0x29341f['on']('message',function(_0x3dbea8){_0x1e24e5=!![];return _0x181b2d[_0x8977('0x1c')](0xc8)['json']({'message':_0x8977('0xe8'),'pid':_0x29341f[_0x8977('0xde')]});});_0x29341f['on'](_0x8977('0xe9'),function(_0x48a21b){if(_0x48a21b&&!_0x1e24e5){return _0x181b2d['status'](0x1f4)[_0x8977('0xdc')]({'message':_0x8977('0xea'),'pid':_0x29341f[_0x8977('0xde')]});}});})[_0x8977('0x8b')](handleError(_0x181b2d,null));};
\ No newline at end of file
index 2e79ac5..17b28c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd287=['../../mysqldb','CmContact','setMaxListeners','save','emit','hasOwnProperty','hook','events'];(function(_0x3eef7a,_0xb677f1){var _0x1b63f2=function(_0x158abe){while(--_0x158abe){_0x3eef7a['push'](_0x3eef7a['shift']());}};_0x1b63f2(++_0xb677f1);}(_0xd287,0x107));var _0x7d28=function(_0x170549,_0x22cf75){_0x170549=_0x170549-0x0;var _0xf0fcc3=_0xd287[_0x170549];return _0xf0fcc3;};'use strict';var EventEmitter=require(_0x7d28('0x0'));var CmContact=require(_0x7d28('0x1'))['db'][_0x7d28('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x7d28('0x3')](0x0);var events={'afterCreate':_0x7d28('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4d9c3a){return function(_0x322b92,_0x53c477,_0x3c3799){CmContactEvents[_0x7d28('0x5')](_0x4d9c3a+':'+_0x322b92['id'],_0x322b92);CmContactEvents['emit'](_0x4d9c3a,_0x322b92);_0x3c3799(null);};}for(var e in events){if(events[_0x7d28('0x6')](e)){var event=events[e];CmContact[_0x7d28('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
+var _0xcb2f=['exports','events','CmContact','setMaxListeners','save','update','remove'];(function(_0x593c63,_0x28b192){var _0x50d707=function(_0x44482e){while(--_0x44482e){_0x593c63['push'](_0x593c63['shift']());}};_0x50d707(++_0x28b192);}(_0xcb2f,0xe8));var _0xfcb2=function(_0x70e2d6,_0x25ea08){_0x70e2d6=_0x70e2d6-0x0;var _0x5d5849=_0xcb2f[_0x70e2d6];return _0x5d5849;};'use strict';var EventEmitter=require(_0xfcb2('0x0'));var CmContact=require('../../mysqldb')['db'][_0xfcb2('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xfcb2('0x2')](0x0);var events={'afterCreate':_0xfcb2('0x3'),'afterUpdate':_0xfcb2('0x4'),'afterDestroy':_0xfcb2('0x5')};function emitEvent(_0x325eb2){return function(_0x169ac7,_0x448ca0,_0x40e9ea){CmContactEvents['emit'](_0x325eb2+':'+_0x169ac7['id'],_0x169ac7);CmContactEvents['emit'](_0x325eb2,_0x169ac7);_0x40e9ea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xfcb2('0x6')]=CmContactEvents;
\ No newline at end of file
index 7343b2f..6c78b46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5496=['request-promise','rimraf','../../config/environment','../../config/environment/shared','CmContact','cm_contacts','phone','models','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','findOne','then','dialTimezone','utcOffset','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','Campaign','add','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','onlyIfOpen','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','message','isEmpty','destroy','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','moment'];(function(_0x14cf82,_0x36996){var _0x4a4c9f=function(_0x15d1f1){while(--_0x15d1f1){_0x14cf82['push'](_0x14cf82['shift']());}};_0x4a4c9f(++_0x36996);}(_0x5496,0x175));var _0x6549=function(_0x1b87b6,_0x4fa52c){_0x1b87b6=_0x1b87b6-0x0;var _0x2a705a=_0x5496[_0x1b87b6];return _0x2a705a;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var shared=require(_0x6549('0x8'));var attributes=require('./cmContact.attributes');module['exports']=function(_0x43cb17,_0x1d8cea){return _0x43cb17['define'](_0x6549('0x9'),attributes,{'tableName':_0x6549('0xa'),'paranoid':!![],'indexes':[{'name':_0x6549('0xb'),'fields':['phone']}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa12086,_0x35d008,_0x2ecce2){var _0x135c2c=_0x43cb17[_0x6549('0xc')];var _0x3e08a6=_0xa12086['get']({'plain':!![]});function _0x551133(){return function(_0x1e27d4){logger[_0x6549('0xd')](_0x6549('0xe'),_0x6549('0xf'),util[_0x6549('0x10')](_0x1e27d4,{'showHidden':![],'depth':null}));};}function _0x5bc018(_0x4dfb06,_0x3f844f){var _0x39d78c=_0x3f844f['scheduledat']?_0x3f844f[_0x6549('0x11')]:moment()[_0x6549('0x12')](_0x6549('0x13'));return new BPromise(function(_0x12b068,_0xc0e859){if(_[_0x6549('0x14')](_0x3f844f['dialTimezone'])){_0x12b068({'ret':_0x39d78c});}else{_0x135c2c['VoiceQueue'][_0x6549('0x15')]({'where':{'id':_0x4dfb06['id']}})[_0x6549('0x16')](function(_0x47a81a){if(!_[_0x6549('0x14')](_0x47a81a)){var _0x67acc0=_0x47a81a[_0x6549('0x17')];if(!_[_0x6549('0x14')](_0x67acc0)){var _0xffc8b9=shared['timezones'];var _0x5d61a0=_0xffc8b9[_0x67acc0];var _0x26a212=_0xffc8b9[_0x3f844f['dialTimezone']];if(!_['isNil'](_0x5d61a0)&&!_[_0x6549('0x14')](_0x26a212)){var _0x1e5079=_0x5d61a0[_0x6549('0x18')]-_0x26a212[_0x6549('0x18')];_0x39d78c=_0x3f844f[_0x6549('0x11')]?_0x3f844f['scheduledat']:moment();var _0x228117=moment(_0x39d78c)['add'](_0x1e5079,_0x6549('0x19'));_0x12b068({'ret':_0x228117[_0x6549('0x12')](_0x6549('0x13'))});}else _0x12b068({'ret':_0x39d78c});}else _0x12b068({'ret':_0x39d78c});}else{_0x12b068({'ret':_0x39d78c});}});}});return 0xa;}var _0x29c6b3=function(_0x22bcf8){return new BPromise(function(_0x12d547,_0x427b47){_0x5bc018(_0x22bcf8,_0x3e08a6)[_0x6549('0x16')](function(_0x2be467){_0x3e08a6[_0x6549('0x11')]=_0x2be467[_0x6549('0x1a')];_0x135c2c[_0x6549('0x1b')][_0x6549('0x15')]({'where':{'phone':_0x3e08a6['phone'],'VoiceQueueId':_0x22bcf8['id']}})[_0x6549('0x16')](function(_0x1bc8db){if(!_['isNil'](_0x1bc8db)){throw new Error(_0x6549('0x1c')+_0x3e08a6[_0x6549('0xb')]+_0x6549('0x1d')+_0x22bcf8['id']);}return _0x135c2c['CmHopper'][_0x6549('0x1e')]({'phone':_0x3e08a6[_0x6549('0xb')],'ContactId':_0x3e08a6['id'],'ListId':_0x3e08a6[_0x6549('0x1f')],'priority':_0x3e08a6[_0x6549('0x20')]?_0x3e08a6[_0x6549('0x20')]:0x2,'scheduledat':_0x3e08a6[_0x6549('0x11')]?_0x3e08a6[_0x6549('0x11')]:moment()[_0x6549('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3e08a6[_0x6549('0x21')]?!![]:![],'callbackuniqueid':_0x3e08a6[_0x6549('0x21')]?_0x3e08a6[_0x6549('0x21')]:undefined,'callbackat':_0x3e08a6['callbackUniqueid']?moment()[_0x6549('0x12')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x22bcf8['id']});})['catch'](function(_0x5aa3a6){_0x427b47(_0x5aa3a6);});});});};var _0x36454b=function(_0x219a96){return new BPromise(function(_0x4f3069,_0x30aac6){_0x5bc018(_0x219a96,_0x3e08a6)[_0x6549('0x16')](function(_0x2e481f){_0x3e08a6[_0x6549('0x11')]=_0x2e481f[_0x6549('0x1a')];_0x135c2c[_0x6549('0x1b')][_0x6549('0x15')]({'where':{'phone':_0x3e08a6['phone'],'VoiceQueueId':_0x219a96['id']}})[_0x6549('0x16')](function(_0x3ebea6){if(!_[_0x6549('0x14')](_0x3ebea6)){throw new Error(_0x6549('0x1c')+_0x3e08a6[_0x6549('0xb')]+_0x6549('0x22')+_0x219a96['id']);}return _0x135c2c['CmHopperFinal'][_0x6549('0x15')]({'where':{'calleridnum':_0x3e08a6['phone'],'VoiceQueueId':_0x219a96['id']}});})[_0x6549('0x16')](function(_0x49872c){if(!_[_0x6549('0x14')](_0x49872c)){throw new Error(_0x6549('0x23')+_0x3e08a6[_0x6549('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x219a96['id']);}return _0x135c2c[_0x6549('0x1b')][_0x6549('0x1e')]({'phone':_0x3e08a6[_0x6549('0xb')],'ContactId':_0x3e08a6['id'],'ListId':_0x3e08a6[_0x6549('0x1f')],'priority':_0x3e08a6['priority']?_0x3e08a6['priority']:0x2,'scheduledat':_0x3e08a6['scheduledat']?_0x3e08a6[_0x6549('0x11')]:moment()[_0x6549('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3e08a6[_0x6549('0x21')]?!![]:![],'callbackuniqueid':_0x3e08a6[_0x6549('0x21')]?_0x3e08a6[_0x6549('0x21')]:undefined,'callbackat':_0x3e08a6[_0x6549('0x21')]?moment()[_0x6549('0x12')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x219a96['id']});})['catch'](function(_0x1fcacf){_0x30aac6(_0x1fcacf);});});});};function _0x663fec(){return function(_0x31ddaa){logger[_0x6549('0xd')](_0x6549('0xe'),_0x6549('0xf'),util[_0x6549('0x10')](_0x31ddaa,{'showHidden':![],'depth':null}));};}function _0x25d99a(_0x340d8b,_0x433fe1){var _0x525f82=_0x433fe1[_0x6549('0x11')]?_0x433fe1[_0x6549('0x11')]:moment()[_0x6549('0x12')](_0x6549('0x13'));return new BPromise(function(_0x4703f0,_0x50ee2e){if(_['isNil'](_0x433fe1['dialTimezone'])){_0x4703f0({'ret':_0x525f82});}else{_0x135c2c[_0x6549('0x24')][_0x6549('0x15')]({'where':{'id':_0x340d8b['id']}})[_0x6549('0x16')](function(_0x2754aa){if(!_['isNil'](_0x2754aa)){var _0x56ce9f=_0x2754aa[_0x6549('0x17')];if(!_[_0x6549('0x14')](_0x56ce9f)){var _0x252d20=shared['timezones'];var _0x973d2d=_0x252d20[_0x56ce9f];var _0x519622=_0x252d20[_0x433fe1[_0x6549('0x17')]];if(!_[_0x6549('0x14')](_0x973d2d)&&!_[_0x6549('0x14')](_0x519622)){var _0x17ed8a=_0x973d2d[_0x6549('0x18')]-_0x519622[_0x6549('0x18')];_0x525f82=_0x433fe1[_0x6549('0x11')]?_0x433fe1['scheduledat']:moment();var _0x132625=moment(_0x525f82)[_0x6549('0x25')](_0x17ed8a,_0x6549('0x19'));_0x4703f0({'ret':_0x132625[_0x6549('0x12')](_0x6549('0x13'))});}else _0x4703f0({'ret':_0x525f82});}else _0x4703f0({'ret':_0x525f82});}else{_0x4703f0({'ret':_0x525f82});}});}});return 0xa;}var _0x18d88e=function(_0x439bff){return new BPromise(function(_0x1eb455,_0x451070){_0x25d99a(_0x439bff,_0x3e08a6)[_0x6549('0x16')](function(_0x2b7b6a){_0x3e08a6[_0x6549('0x11')]=_0x2b7b6a[_0x6549('0x1a')];_0x135c2c[_0x6549('0x1b')][_0x6549('0x15')]({'where':{'phone':_0x3e08a6[_0x6549('0xb')],'CampaignId':_0x439bff['id']}})['then'](function(_0x1aab51){if(!_[_0x6549('0x14')](_0x1aab51)){throw new Error(_0x6549('0x1c')+_0x3e08a6[_0x6549('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x439bff['id']);}return _0x135c2c[_0x6549('0x1b')]['create']({'phone':_0x3e08a6[_0x6549('0xb')],'ContactId':_0x3e08a6['id'],'ListId':_0x3e08a6[_0x6549('0x1f')],'priority':_0x3e08a6['priority']?_0x3e08a6[_0x6549('0x20')]:0x2,'scheduledat':_0x3e08a6[_0x6549('0x11')]?_0x3e08a6[_0x6549('0x11')]:moment()[_0x6549('0x12')](_0x6549('0x13')),'callback':_0x3e08a6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3e08a6['callbackUniqueid']?_0x3e08a6[_0x6549('0x21')]:undefined,'callbackat':_0x3e08a6[_0x6549('0x21')]?moment()[_0x6549('0x12')](_0x6549('0x13')):undefined,'CampaignId':_0x439bff['id']});})[_0x6549('0x26')](function(_0x49a4d7){_0x451070(_0x49a4d7);});});});};var _0x22370d=function(_0x17e691){return new BPromise(function(_0x1e4f4f,_0x6121af){_0x25d99a(_0x17e691,_0x3e08a6)[_0x6549('0x16')](function(_0x25a6ee){_0x3e08a6[_0x6549('0x11')]=_0x25a6ee[_0x6549('0x1a')];_0x135c2c['CmHopper'][_0x6549('0x15')]({'where':{'phone':_0x3e08a6['phone'],'CampaignId':_0x17e691['id']}})[_0x6549('0x16')](function(_0x1e09e1){if(!_[_0x6549('0x14')](_0x1e09e1)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3e08a6[_0x6549('0xb')]+_0x6549('0x27')+_0x17e691['id']);}return _0x135c2c[_0x6549('0x28')]['findOne']({'where':{'calleridnum':_0x3e08a6[_0x6549('0xb')],'CampaignId':_0x17e691['id']}});})[_0x6549('0x16')](function(_0x2644a6){if(!_[_0x6549('0x14')](_0x2644a6)){throw new Error(_0x6549('0x23')+_0x3e08a6[_0x6549('0xb')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x17e691['id']);}return _0x135c2c[_0x6549('0x1b')]['create']({'phone':_0x3e08a6[_0x6549('0xb')],'ContactId':_0x3e08a6['id'],'ListId':_0x3e08a6[_0x6549('0x1f')],'priority':_0x3e08a6[_0x6549('0x20')]?_0x3e08a6[_0x6549('0x20')]:0x2,'scheduledat':_0x3e08a6[_0x6549('0x11')]?_0x3e08a6[_0x6549('0x11')]:moment()[_0x6549('0x12')](_0x6549('0x13')),'callback':_0x3e08a6[_0x6549('0x21')]?!![]:![],'callbackuniqueid':_0x3e08a6[_0x6549('0x21')]?_0x3e08a6[_0x6549('0x21')]:undefined,'callbackat':_0x3e08a6[_0x6549('0x21')]?moment()['format'](_0x6549('0x13')):undefined,'CampaignId':_0x17e691['id']});})[_0x6549('0x26')](function(_0x325c0a){_0x6121af(_0x325c0a);});});});};if(_0x3e08a6[_0x6549('0x1f')]){_0x135c2c[_0x6549('0x29')][_0x6549('0x2a')]({'where':{'type':_0x6549('0x2b')},'attributes':['id',_0x6549('0x2c'),'dialTimezone'],'include':[{'model':_0x135c2c[_0x6549('0x2d')],'as':_0x6549('0x2e'),'where':{'id':_0x3e08a6[_0x6549('0x1f')]}}]})[_0x6549('0x16')](function(_0x2b0ba8){if(_0x2b0ba8){var _0x8bbdf4=[];for(var _0x2eb30c=0x0,_0x1898eb;_0x2eb30c<_0x2b0ba8['length'];_0x2eb30c+=0x1){_0x1898eb=_0x2b0ba8[_0x2eb30c][_0x6549('0x2f')]({'plain':!![]});switch(_0x1898eb[_0x6549('0x2c')]){case _0x6549('0x30'):_0x36454b(_0x1898eb)[_0x6549('0x26')](_0x551133());break;case _0x6549('0x31'):_0x29c6b3(_0x1898eb)[_0x6549('0x26')](_0x551133());break;default:_0x25d99a(_0x1898eb,_0x3e08a6)['then'](function(_0x2ca517){_0x3e08a6[_0x6549('0x11')]=_0x2ca517['ret'];_0x135c2c[_0x6549('0x1b')][_0x6549('0x1e')]({'phone':_0x3e08a6[_0x6549('0xb')],'ContactId':_0x3e08a6['id'],'ListId':_0x3e08a6['ListId'],'scheduledat':_0x3e08a6[_0x6549('0x11')]?_0x3e08a6[_0x6549('0x11')]:moment()['format'](_0x6549('0x13')),'priority':_0x3e08a6['priority']?_0x3e08a6[_0x6549('0x20')]:0x2,'callback':_0x3e08a6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3e08a6[_0x6549('0x21')]?_0x3e08a6[_0x6549('0x21')]:undefined,'callbackat':_0x3e08a6[_0x6549('0x21')]?moment()[_0x6549('0x12')](_0x6549('0x13')):undefined,'VoiceQueueId':_0x1898eb['id']})[_0x6549('0x26')](_0x551133());});}}}})[_0x6549('0x16')](function(){return _0x135c2c[_0x6549('0x29')][_0x6549('0x2a')]({'where':{'type':_0x6549('0x2b')},'attributes':['id'],'include':[{'model':_0x135c2c[_0x6549('0x2d')],'as':_0x6549('0x32'),'where':{'id':_0x3e08a6[_0x6549('0x1f')]}}]})[_0x6549('0x16')](function(_0x5cdbcb){if(_0x5cdbcb){var _0x2bff46=[];for(var _0x355f53=0x0,_0x51d376;_0x355f53<_0x5cdbcb[_0x6549('0x33')];_0x355f53+=0x1){_0x51d376=_0x5cdbcb[_0x355f53][_0x6549('0x2f')]({'plain':!![]});_0x135c2c[_0x6549('0x34')][_0x6549('0x1e')]({'phone':_0x3e08a6['phone'],'ContactId':_0x3e08a6['id'],'ListId':_0x3e08a6[_0x6549('0x1f')],'VoiceQueueId':_0x51d376['id']})[_0x6549('0x26')](function(_0x19c9bd){logger[_0x6549('0xd')]('cmContact,\x20%s,\x20%s',_0x6549('0xf'),_0x19c9bd['message']);});}}});})[_0x6549('0x16')](function(){return _0x135c2c[_0x6549('0x24')][_0x6549('0x2a')]({'attributes':['id',_0x6549('0x2c'),_0x6549('0x17')],'include':[{'model':_0x135c2c[_0x6549('0x2d')],'as':_0x6549('0x2e'),'where':{'id':_0x3e08a6[_0x6549('0x1f')]}}]})[_0x6549('0x16')](function(_0x1cd528){if(_0x1cd528){var _0x49427f=[];for(var _0x341170=0x0,_0x3b326a;_0x341170<_0x1cd528[_0x6549('0x33')];_0x341170+=0x1){_0x3b326a=_0x1cd528[_0x341170][_0x6549('0x2f')]({'plain':!![]});switch(_0x3b326a[_0x6549('0x2c')]){case _0x6549('0x30'):_0x22370d(_0x3b326a)['catch'](_0x663fec());break;case'onlyIfOpen':_0x18d88e(_0x3b326a)[_0x6549('0x26')](_0x663fec());break;default:_0x25d99a(_0x3b326a,_0x3e08a6)[_0x6549('0x16')](function(_0x34ee76){_0x3e08a6['scheduledat']=_0x34ee76[_0x6549('0x1a')];_0x135c2c[_0x6549('0x1b')]['create']({'phone':_0x3e08a6[_0x6549('0xb')],'ContactId':_0x3e08a6['id'],'ListId':_0x3e08a6[_0x6549('0x1f')],'scheduledat':_0x3e08a6[_0x6549('0x11')]?_0x3e08a6[_0x6549('0x11')]:moment()[_0x6549('0x12')](_0x6549('0x13')),'priority':_0x3e08a6[_0x6549('0x20')]?_0x3e08a6[_0x6549('0x20')]:0x2,'callback':_0x3e08a6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3e08a6[_0x6549('0x21')]?_0x3e08a6['callbackUniqueid']:undefined,'callbackat':_0x3e08a6[_0x6549('0x21')]?moment()[_0x6549('0x12')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3b326a['id']})[_0x6549('0x26')](_0x663fec());});}}}});})[_0x6549('0x16')](function(){return _0x135c2c[_0x6549('0x24')]['findAll']({'attributes':['id'],'include':[{'model':_0x135c2c[_0x6549('0x2d')],'as':_0x6549('0x32'),'where':{'id':_0x3e08a6[_0x6549('0x1f')]}}]})[_0x6549('0x16')](function(_0x15b906){if(_0x15b906){var _0x34c5f9=[];for(var _0x500bd9=0x0,_0x384237;_0x500bd9<_0x15b906[_0x6549('0x33')];_0x500bd9+=0x1){_0x384237=_0x15b906[_0x500bd9][_0x6549('0x2f')]({'plain':!![]});_0x135c2c['CmHopperBlack']['create']({'phone':_0x3e08a6['phone'],'ContactId':_0x3e08a6['id'],'ListId':_0x3e08a6[_0x6549('0x1f')],'CampaignId':_0x384237['id']})[_0x6549('0x26')](function(_0x44b618){logger['error']('cmContact,\x20%s,\x20%s',_0x6549('0xf'),_0x44b618['message']);});}}});})[_0x6549('0x16')](function(){_0x2ecce2();})[_0x6549('0x26')](function(_0xcba9e1){logger[_0x6549('0xd')](_0x6549('0x35'),_0x6549('0xf'),_0xcba9e1[_0x6549('0x36')]);_0x2ecce2(_0xcba9e1);});}else{_0x2ecce2(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x2f8c3a,_0x38b330,_0x436eed){var _0x54e865=_0x43cb17[_0x6549('0xc')];var _0x13ad42=_0x2f8c3a[_0x6549('0x2f')]({'plain':!![]});return _0x54e865[_0x6549('0x1b')][_0x6549('0x2a')]({'raw':!![],'where':{'ListId':_0x13ad42[_0x6549('0x1f')],'ContactId':_0x13ad42['id']}})[_0x6549('0x16')](function(_0x47b135){if(!_[_0x6549('0x37')](_0x47b135)){var _0x53483c=[];for(var _0x328ff5=0x0;_0x328ff5<_0x47b135[_0x6549('0x33')];_0x328ff5+=0x1){var _0x20a273=_0x54e865[_0x6549('0x1b')][_0x6549('0x38')]({'where':{'ListId':_0x47b135[_0x328ff5][_0x6549('0x1f')],'ContactId':_0x47b135[_0x328ff5][_0x6549('0x39')],'VoiceQueueId':_0x47b135[_0x328ff5][_0x6549('0x3a')],'CampaignId':_0x47b135[_0x328ff5]['CampaignId']}});_0x53483c[_0x6549('0x3b')](_0x20a273);}return BPromise[_0x6549('0x3c')](_0x53483c);}})[_0x6549('0x16')](function(_0x30214c){logger[_0x6549('0x3d')](_0x6549('0x3e'),util[_0x6549('0x10')](_0x30214c,{'showHidden':![],'depth':null}));_0x436eed();})[_0x6549('0x26')](function(_0x824a23){logger[_0x6549('0xd')]('[CmContact][afterDestroy][Error]',util[_0x6549('0x10')](_0x824a23,{'showHidden':![],'depth':null}));_0x436eed(_0x824a23);});}}});};
\ No newline at end of file
+var _0xfc46=['add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','always','onlyIfOpen','List\x20not\x20found','isEmpty','destroy','ContactId','CampaignId','all','info','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','phone','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','isNil','dialTimezone','VoiceQueue','findOne','then','utcOffset','minutes','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','timezones'];(function(_0x2c3024,_0x543ceb){var _0x668b28=function(_0x5b21ca){while(--_0x5b21ca){_0x2c3024['push'](_0x2c3024['shift']());}};_0x668b28(++_0x543ceb);}(_0xfc46,0x9a));var _0x6fc4=function(_0x197185,_0x251145){_0x197185=_0x197185-0x0;var _0x2c8af1=_0xfc46[_0x197185];return _0x2c8af1;};'use strict';var _=require(_0x6fc4('0x0'));var util=require('util');var logger=require(_0x6fc4('0x1'))(_0x6fc4('0x2'));var moment=require(_0x6fc4('0x3'));var BPromise=require('bluebird');var rp=require(_0x6fc4('0x4'));var fs=require('fs');var path=require(_0x6fc4('0x5'));var rimraf=require(_0x6fc4('0x6'));var config=require(_0x6fc4('0x7'));var shared=require('../../config/environment/shared');var attributes=require(_0x6fc4('0x8'));module[_0x6fc4('0x9')]=function(_0x3100a0,_0x454abb){return _0x3100a0[_0x6fc4('0xa')](_0x6fc4('0xb'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x6fc4('0xc'),'fields':['phone']}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4221f5,_0x2fad80,_0x57dd8c){var _0x2c573b=_0x3100a0[_0x6fc4('0xd')];var _0x3a8f51=_0x4221f5[_0x6fc4('0xe')]({'plain':!![]});function _0x87f48b(){return function(_0x38b084){logger[_0x6fc4('0xf')](_0x6fc4('0x10'),_0x6fc4('0x11'),util[_0x6fc4('0x12')](_0x38b084,{'showHidden':![],'depth':null}));};}function _0x2227c3(_0x13bf6b,_0x34cb6b){var _0x1e91cb=_0x34cb6b[_0x6fc4('0x13')]?_0x34cb6b[_0x6fc4('0x13')]:moment()[_0x6fc4('0x14')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x56383b,_0x15305c){if(_[_0x6fc4('0x15')](_0x34cb6b[_0x6fc4('0x16')])){_0x56383b({'ret':_0x1e91cb});}else{_0x2c573b[_0x6fc4('0x17')][_0x6fc4('0x18')]({'where':{'id':_0x13bf6b['id']}})[_0x6fc4('0x19')](function(_0x3e2fc6){if(!_[_0x6fc4('0x15')](_0x3e2fc6)){var _0x1d51b1=_0x3e2fc6['dialTimezone'];if(!_[_0x6fc4('0x15')](_0x1d51b1)){var _0x2e7f81=shared['timezones'];var _0x5b4b71=_0x2e7f81[_0x1d51b1];var _0x2bc789=_0x2e7f81[_0x34cb6b[_0x6fc4('0x16')]];if(!_['isNil'](_0x5b4b71)&&!_[_0x6fc4('0x15')](_0x2bc789)){var _0xb4a47a=_0x5b4b71[_0x6fc4('0x1a')]-_0x2bc789['utcOffset'];_0x1e91cb=_0x34cb6b[_0x6fc4('0x13')]?_0x34cb6b[_0x6fc4('0x13')]:moment();var _0x3a3842=moment(_0x1e91cb)['add'](_0xb4a47a,_0x6fc4('0x1b'));_0x56383b({'ret':_0x3a3842[_0x6fc4('0x14')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x56383b({'ret':_0x1e91cb});}else _0x56383b({'ret':_0x1e91cb});}else{_0x56383b({'ret':_0x1e91cb});}});}});return 0xa;}var _0x4a0eec=function(_0x2e676a){return new BPromise(function(_0x4950c4,_0x53e5fb){_0x2227c3(_0x2e676a,_0x3a8f51)['then'](function(_0x417ce6){_0x3a8f51[_0x6fc4('0x13')]=_0x417ce6[_0x6fc4('0x1c')];_0x2c573b['CmHopper'][_0x6fc4('0x18')]({'where':{'phone':_0x3a8f51[_0x6fc4('0xc')],'VoiceQueueId':_0x2e676a['id']}})['then'](function(_0x14aa5f){if(!_[_0x6fc4('0x15')](_0x14aa5f)){throw new Error(_0x6fc4('0x1d')+_0x3a8f51[_0x6fc4('0xc')]+_0x6fc4('0x1e')+_0x2e676a['id']);}return _0x2c573b[_0x6fc4('0x1f')][_0x6fc4('0x20')]({'phone':_0x3a8f51[_0x6fc4('0xc')],'ContactId':_0x3a8f51['id'],'ListId':_0x3a8f51[_0x6fc4('0x21')],'priority':_0x3a8f51[_0x6fc4('0x22')]?_0x3a8f51[_0x6fc4('0x22')]:0x2,'scheduledat':_0x3a8f51[_0x6fc4('0x13')]?_0x3a8f51[_0x6fc4('0x13')]:moment()['format'](_0x6fc4('0x23')),'callback':_0x3a8f51[_0x6fc4('0x24')]?!![]:![],'callbackuniqueid':_0x3a8f51[_0x6fc4('0x24')]?_0x3a8f51[_0x6fc4('0x24')]:undefined,'callbackat':_0x3a8f51[_0x6fc4('0x24')]?moment()[_0x6fc4('0x14')](_0x6fc4('0x23')):undefined,'VoiceQueueId':_0x2e676a['id']});})[_0x6fc4('0x25')](function(_0x3816b5){_0x53e5fb(_0x3816b5);});});});};var _0x264918=function(_0xbbc732){return new BPromise(function(_0x1689f4,_0x5d9b7c){_0x2227c3(_0xbbc732,_0x3a8f51)[_0x6fc4('0x19')](function(_0x5d9a9d){_0x3a8f51['scheduledat']=_0x5d9a9d[_0x6fc4('0x1c')];_0x2c573b[_0x6fc4('0x1f')][_0x6fc4('0x18')]({'where':{'phone':_0x3a8f51[_0x6fc4('0xc')],'VoiceQueueId':_0xbbc732['id']}})[_0x6fc4('0x19')](function(_0x43bcc1){if(!_['isNil'](_0x43bcc1)){throw new Error(_0x6fc4('0x1d')+_0x3a8f51[_0x6fc4('0xc')]+_0x6fc4('0x26')+_0xbbc732['id']);}return _0x2c573b[_0x6fc4('0x27')][_0x6fc4('0x18')]({'where':{'calleridnum':_0x3a8f51[_0x6fc4('0xc')],'VoiceQueueId':_0xbbc732['id']}});})[_0x6fc4('0x19')](function(_0x26a0c6){if(!_['isNil'](_0x26a0c6)){throw new Error(_0x6fc4('0x28')+_0x3a8f51[_0x6fc4('0xc')]+_0x6fc4('0x29')+_0xbbc732['id']);}return _0x2c573b[_0x6fc4('0x1f')][_0x6fc4('0x20')]({'phone':_0x3a8f51[_0x6fc4('0xc')],'ContactId':_0x3a8f51['id'],'ListId':_0x3a8f51[_0x6fc4('0x21')],'priority':_0x3a8f51[_0x6fc4('0x22')]?_0x3a8f51[_0x6fc4('0x22')]:0x2,'scheduledat':_0x3a8f51['scheduledat']?_0x3a8f51['scheduledat']:moment()[_0x6fc4('0x14')](_0x6fc4('0x23')),'callback':_0x3a8f51[_0x6fc4('0x24')]?!![]:![],'callbackuniqueid':_0x3a8f51[_0x6fc4('0x24')]?_0x3a8f51[_0x6fc4('0x24')]:undefined,'callbackat':_0x3a8f51[_0x6fc4('0x24')]?moment()['format'](_0x6fc4('0x23')):undefined,'VoiceQueueId':_0xbbc732['id']});})[_0x6fc4('0x25')](function(_0x27d30c){_0x5d9b7c(_0x27d30c);});});});};function _0x366787(){return function(_0x2b561c){logger[_0x6fc4('0xf')](_0x6fc4('0x10'),_0x6fc4('0x11'),util[_0x6fc4('0x12')](_0x2b561c,{'showHidden':![],'depth':null}));};}function _0x27934c(_0xebe06e,_0x950a){var _0x1747ec=_0x950a[_0x6fc4('0x13')]?_0x950a['scheduledat']:moment()[_0x6fc4('0x14')](_0x6fc4('0x23'));return new BPromise(function(_0xcf04d0,_0x5b0350){if(_[_0x6fc4('0x15')](_0x950a[_0x6fc4('0x16')])){_0xcf04d0({'ret':_0x1747ec});}else{_0x2c573b[_0x6fc4('0x2a')][_0x6fc4('0x18')]({'where':{'id':_0xebe06e['id']}})[_0x6fc4('0x19')](function(_0x1aed89){if(!_[_0x6fc4('0x15')](_0x1aed89)){var _0xe3e064=_0x1aed89[_0x6fc4('0x16')];if(!_[_0x6fc4('0x15')](_0xe3e064)){var _0x3a8acc=shared[_0x6fc4('0x2b')];var _0x55771c=_0x3a8acc[_0xe3e064];var _0x307394=_0x3a8acc[_0x950a[_0x6fc4('0x16')]];if(!_[_0x6fc4('0x15')](_0x55771c)&&!_['isNil'](_0x307394)){var _0xcf729c=_0x55771c[_0x6fc4('0x1a')]-_0x307394[_0x6fc4('0x1a')];_0x1747ec=_0x950a['scheduledat']?_0x950a['scheduledat']:moment();var _0x16c5aa=moment(_0x1747ec)[_0x6fc4('0x2c')](_0xcf729c,_0x6fc4('0x1b'));_0xcf04d0({'ret':_0x16c5aa['format'](_0x6fc4('0x23'))});}else _0xcf04d0({'ret':_0x1747ec});}else _0xcf04d0({'ret':_0x1747ec});}else{_0xcf04d0({'ret':_0x1747ec});}});}});return 0xa;}var _0x3d80d9=function(_0x1884d7){return new BPromise(function(_0x35763c,_0x15683a){_0x27934c(_0x1884d7,_0x3a8f51)[_0x6fc4('0x19')](function(_0x1cccec){_0x3a8f51[_0x6fc4('0x13')]=_0x1cccec[_0x6fc4('0x1c')];_0x2c573b['CmHopper'][_0x6fc4('0x18')]({'where':{'phone':_0x3a8f51[_0x6fc4('0xc')],'CampaignId':_0x1884d7['id']}})['then'](function(_0x28fd2f){if(!_[_0x6fc4('0x15')](_0x28fd2f)){throw new Error(_0x6fc4('0x1d')+_0x3a8f51[_0x6fc4('0xc')]+_0x6fc4('0x2d')+_0x1884d7['id']);}return _0x2c573b['CmHopper'][_0x6fc4('0x20')]({'phone':_0x3a8f51['phone'],'ContactId':_0x3a8f51['id'],'ListId':_0x3a8f51[_0x6fc4('0x21')],'priority':_0x3a8f51[_0x6fc4('0x22')]?_0x3a8f51['priority']:0x2,'scheduledat':_0x3a8f51['scheduledat']?_0x3a8f51[_0x6fc4('0x13')]:moment()[_0x6fc4('0x14')](_0x6fc4('0x23')),'callback':_0x3a8f51['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3a8f51[_0x6fc4('0x24')]?_0x3a8f51[_0x6fc4('0x24')]:undefined,'callbackat':_0x3a8f51[_0x6fc4('0x24')]?moment()[_0x6fc4('0x14')](_0x6fc4('0x23')):undefined,'CampaignId':_0x1884d7['id']});})[_0x6fc4('0x25')](function(_0x21a856){_0x15683a(_0x21a856);});});});};var _0x244459=function(_0x770f34){return new BPromise(function(_0x128f4e,_0x51de58){_0x27934c(_0x770f34,_0x3a8f51)[_0x6fc4('0x19')](function(_0x255126){_0x3a8f51[_0x6fc4('0x13')]=_0x255126[_0x6fc4('0x1c')];_0x2c573b['CmHopper'][_0x6fc4('0x18')]({'where':{'phone':_0x3a8f51[_0x6fc4('0xc')],'CampaignId':_0x770f34['id']}})['then'](function(_0x31140d){if(!_[_0x6fc4('0x15')](_0x31140d)){throw new Error(_0x6fc4('0x1d')+_0x3a8f51['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x770f34['id']);}return _0x2c573b[_0x6fc4('0x27')][_0x6fc4('0x18')]({'where':{'calleridnum':_0x3a8f51[_0x6fc4('0xc')],'CampaignId':_0x770f34['id']}});})[_0x6fc4('0x19')](function(_0x2258eb){if(!_[_0x6fc4('0x15')](_0x2258eb)){throw new Error(_0x6fc4('0x28')+_0x3a8f51[_0x6fc4('0xc')]+_0x6fc4('0x2e')+_0x770f34['id']);}return _0x2c573b[_0x6fc4('0x1f')][_0x6fc4('0x20')]({'phone':_0x3a8f51[_0x6fc4('0xc')],'ContactId':_0x3a8f51['id'],'ListId':_0x3a8f51[_0x6fc4('0x21')],'priority':_0x3a8f51[_0x6fc4('0x22')]?_0x3a8f51['priority']:0x2,'scheduledat':_0x3a8f51[_0x6fc4('0x13')]?_0x3a8f51['scheduledat']:moment()[_0x6fc4('0x14')](_0x6fc4('0x23')),'callback':_0x3a8f51[_0x6fc4('0x24')]?!![]:![],'callbackuniqueid':_0x3a8f51[_0x6fc4('0x24')]?_0x3a8f51['callbackUniqueid']:undefined,'callbackat':_0x3a8f51[_0x6fc4('0x24')]?moment()[_0x6fc4('0x14')](_0x6fc4('0x23')):undefined,'CampaignId':_0x770f34['id']});})[_0x6fc4('0x25')](function(_0x4d18f1){_0x51de58(_0x4d18f1);});});});};if(_0x3a8f51[_0x6fc4('0x21')]){_0x2c573b[_0x6fc4('0x17')][_0x6fc4('0x2f')]({'where':{'type':_0x6fc4('0x30')},'attributes':['id',_0x6fc4('0x31'),_0x6fc4('0x16')],'include':[{'model':_0x2c573b[_0x6fc4('0x32')],'as':_0x6fc4('0x33'),'where':{'id':_0x3a8f51['ListId']}}]})['then'](function(_0x5d0692){if(_0x5d0692){var _0x107fe7=[];for(var _0x47435c=0x0,_0xee54a0;_0x47435c<_0x5d0692[_0x6fc4('0x34')];_0x47435c+=0x1){_0xee54a0=_0x5d0692[_0x47435c][_0x6fc4('0xe')]({'plain':!![]});switch(_0xee54a0[_0x6fc4('0x31')]){case'always':_0x264918(_0xee54a0)[_0x6fc4('0x25')](_0x87f48b());break;case'onlyIfOpen':_0x4a0eec(_0xee54a0)[_0x6fc4('0x25')](_0x87f48b());break;default:_0x27934c(_0xee54a0,_0x3a8f51)[_0x6fc4('0x19')](function(_0x441421){_0x3a8f51[_0x6fc4('0x13')]=_0x441421['ret'];_0x2c573b[_0x6fc4('0x1f')][_0x6fc4('0x20')]({'phone':_0x3a8f51['phone'],'ContactId':_0x3a8f51['id'],'ListId':_0x3a8f51[_0x6fc4('0x21')],'scheduledat':_0x3a8f51[_0x6fc4('0x13')]?_0x3a8f51[_0x6fc4('0x13')]:moment()[_0x6fc4('0x14')](_0x6fc4('0x23')),'priority':_0x3a8f51['priority']?_0x3a8f51['priority']:0x2,'callback':_0x3a8f51[_0x6fc4('0x24')]?!![]:![],'callbackuniqueid':_0x3a8f51[_0x6fc4('0x24')]?_0x3a8f51[_0x6fc4('0x24')]:undefined,'callbackat':_0x3a8f51[_0x6fc4('0x24')]?moment()[_0x6fc4('0x14')](_0x6fc4('0x23')):undefined,'VoiceQueueId':_0xee54a0['id']})[_0x6fc4('0x25')](_0x87f48b());});}}}})[_0x6fc4('0x19')](function(){return _0x2c573b[_0x6fc4('0x17')][_0x6fc4('0x2f')]({'where':{'type':_0x6fc4('0x30')},'attributes':['id'],'include':[{'model':_0x2c573b[_0x6fc4('0x32')],'as':_0x6fc4('0x35'),'where':{'id':_0x3a8f51[_0x6fc4('0x21')]}}]})[_0x6fc4('0x19')](function(_0x524924){if(_0x524924){var _0x3f42b9=[];for(var _0x1606ca=0x0,_0x49c7ca;_0x1606ca<_0x524924['length'];_0x1606ca+=0x1){_0x49c7ca=_0x524924[_0x1606ca][_0x6fc4('0xe')]({'plain':!![]});_0x2c573b[_0x6fc4('0x36')][_0x6fc4('0x20')]({'phone':_0x3a8f51[_0x6fc4('0xc')],'ContactId':_0x3a8f51['id'],'ListId':_0x3a8f51[_0x6fc4('0x21')],'VoiceQueueId':_0x49c7ca['id']})[_0x6fc4('0x25')](function(_0x307f15){logger[_0x6fc4('0xf')](_0x6fc4('0x37'),_0x6fc4('0x11'),_0x307f15[_0x6fc4('0x38')]);});}}});})[_0x6fc4('0x19')](function(){return _0x2c573b[_0x6fc4('0x2a')][_0x6fc4('0x2f')]({'attributes':['id','dialCheckDuplicateType',_0x6fc4('0x16')],'include':[{'model':_0x2c573b['CmList'],'as':_0x6fc4('0x33'),'where':{'id':_0x3a8f51[_0x6fc4('0x21')]}}]})['then'](function(_0x45c47f){if(_0x45c47f){var _0x1e3d87=[];for(var _0x2f2d35=0x0,_0x312ca1;_0x2f2d35<_0x45c47f[_0x6fc4('0x34')];_0x2f2d35+=0x1){_0x312ca1=_0x45c47f[_0x2f2d35][_0x6fc4('0xe')]({'plain':!![]});switch(_0x312ca1['dialCheckDuplicateType']){case _0x6fc4('0x39'):_0x244459(_0x312ca1)[_0x6fc4('0x25')](_0x366787());break;case _0x6fc4('0x3a'):_0x3d80d9(_0x312ca1)['catch'](_0x366787());break;default:_0x27934c(_0x312ca1,_0x3a8f51)['then'](function(_0xc94d0c){_0x3a8f51[_0x6fc4('0x13')]=_0xc94d0c[_0x6fc4('0x1c')];_0x2c573b[_0x6fc4('0x1f')]['create']({'phone':_0x3a8f51[_0x6fc4('0xc')],'ContactId':_0x3a8f51['id'],'ListId':_0x3a8f51[_0x6fc4('0x21')],'scheduledat':_0x3a8f51['scheduledat']?_0x3a8f51[_0x6fc4('0x13')]:moment()['format'](_0x6fc4('0x23')),'priority':_0x3a8f51[_0x6fc4('0x22')]?_0x3a8f51[_0x6fc4('0x22')]:0x2,'callback':_0x3a8f51[_0x6fc4('0x24')]?!![]:![],'callbackuniqueid':_0x3a8f51[_0x6fc4('0x24')]?_0x3a8f51[_0x6fc4('0x24')]:undefined,'callbackat':_0x3a8f51[_0x6fc4('0x24')]?moment()[_0x6fc4('0x14')](_0x6fc4('0x23')):undefined,'CampaignId':_0x312ca1['id']})[_0x6fc4('0x25')](_0x366787());});}}}});})[_0x6fc4('0x19')](function(){return _0x2c573b[_0x6fc4('0x2a')][_0x6fc4('0x2f')]({'attributes':['id'],'include':[{'model':_0x2c573b[_0x6fc4('0x32')],'as':_0x6fc4('0x35'),'where':{'id':_0x3a8f51[_0x6fc4('0x21')]}}]})[_0x6fc4('0x19')](function(_0x38a0d6){if(_0x38a0d6){var _0x43842e=[];for(var _0xcddd8a=0x0,_0x219b29;_0xcddd8a<_0x38a0d6['length'];_0xcddd8a+=0x1){_0x219b29=_0x38a0d6[_0xcddd8a][_0x6fc4('0xe')]({'plain':!![]});_0x2c573b[_0x6fc4('0x36')][_0x6fc4('0x20')]({'phone':_0x3a8f51['phone'],'ContactId':_0x3a8f51['id'],'ListId':_0x3a8f51[_0x6fc4('0x21')],'CampaignId':_0x219b29['id']})['catch'](function(_0x1a6f6c){logger[_0x6fc4('0xf')](_0x6fc4('0x37'),_0x6fc4('0x11'),_0x1a6f6c[_0x6fc4('0x38')]);});}}});})[_0x6fc4('0x19')](function(){_0x57dd8c();})['catch'](function(_0x1b764f){logger[_0x6fc4('0xf')]('cmContact,\x20%s,\x20%s',_0x6fc4('0x11'),_0x1b764f[_0x6fc4('0x38')]);_0x57dd8c(_0x1b764f);});}else{_0x57dd8c(new Error(_0x6fc4('0x3b')));}},'afterDestroy':function(_0x1c48ee,_0x41a1cc,_0x293ef9){var _0x21be00=_0x3100a0[_0x6fc4('0xd')];var _0x16778b=_0x1c48ee[_0x6fc4('0xe')]({'plain':!![]});return _0x21be00[_0x6fc4('0x1f')][_0x6fc4('0x2f')]({'raw':!![],'where':{'ListId':_0x16778b['ListId'],'ContactId':_0x16778b['id']}})[_0x6fc4('0x19')](function(_0x4285b2){if(!_[_0x6fc4('0x3c')](_0x4285b2)){var _0x20c9d5=[];for(var _0x42a3d8=0x0;_0x42a3d8<_0x4285b2[_0x6fc4('0x34')];_0x42a3d8+=0x1){var _0x114819=_0x21be00[_0x6fc4('0x1f')][_0x6fc4('0x3d')]({'where':{'ListId':_0x4285b2[_0x42a3d8][_0x6fc4('0x21')],'ContactId':_0x4285b2[_0x42a3d8][_0x6fc4('0x3e')],'VoiceQueueId':_0x4285b2[_0x42a3d8]['VoiceQueueId'],'CampaignId':_0x4285b2[_0x42a3d8][_0x6fc4('0x3f')]}});_0x20c9d5['push'](_0x114819);}return BPromise[_0x6fc4('0x40')](_0x20c9d5);}})[_0x6fc4('0x19')](function(_0x441e74){logger[_0x6fc4('0x41')]('[CmContact][afterDestroy][Succesfull]',util[_0x6fc4('0x12')](_0x441e74,{'showHidden':![],'depth':null}));_0x293ef9();})[_0x6fc4('0x25')](function(_0x438b47){logger[_0x6fc4('0xf')]('[CmContact][afterDestroy][Error]',util['inspect'](_0x438b47,{'showHidden':![],'depth':null}));_0x293ef9(_0x438b47);});}}});};
\ No newline at end of file
index 4619eed..2fea070 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefd7=['result','catch','ShowCmContact','CmContact','find','options','raw','where','attributes','map','include','model','CreateCmContact','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./cmContact.socket','register','then','info','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContact,\x20%s,\x20%s','message'];(function(_0x32e59e,_0x252469){var _0x4a621d=function(_0x7e8dd7){while(--_0x7e8dd7){_0x32e59e['push'](_0x32e59e['shift']());}};_0x4a621d(++_0x252469);}(_0xefd7,0xa9));var _0x7efd=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xefd7[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7efd('0x0'));var util=require('util');var moment=require(_0x7efd('0x1'));var BPromise=require(_0x7efd('0x2'));var rs=require(_0x7efd('0x3'));var fs=require('fs');var Redis=require(_0x7efd('0x4'));var db=require(_0x7efd('0x5'))['db'];var utils=require(_0x7efd('0x6'));var logger=require(_0x7efd('0x7'))('rpc');var config=require(_0x7efd('0x8'));var jayson=require(_0x7efd('0x9'));var client=jayson[_0x7efd('0xa')][_0x7efd('0xb')]({'port':0x232a});config[_0x7efd('0xc')]=_['defaults'](config[_0x7efd('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7efd('0xd'))(new Redis(config[_0x7efd('0xc')]));require(_0x7efd('0xe'))[_0x7efd('0xf')](socket);function respondWithRpcPromise(_0x41296b,_0x2d44c8,_0x55c670){return new BPromise(function(_0x2333df,_0x5f59bb){return client['request'](_0x41296b,_0x55c670)[_0x7efd('0x10')](function(_0x4caa5d){logger[_0x7efd('0x11')]('CmContact,\x20%s,\x20%s',_0x2d44c8,_0x7efd('0x12'));logger[_0x7efd('0x13')](_0x7efd('0x14'),_0x2d44c8,'request\x20sent',JSON[_0x7efd('0x15')](_0x4caa5d));if(_0x4caa5d['error']){if(_0x4caa5d[_0x7efd('0x16')][_0x7efd('0x17')]===0x1f4){logger[_0x7efd('0x16')](_0x7efd('0x18'),_0x2d44c8,_0x4caa5d[_0x7efd('0x16')][_0x7efd('0x19')]);return _0x5f59bb(_0x4caa5d[_0x7efd('0x16')][_0x7efd('0x19')]);}logger[_0x7efd('0x16')]('CmContact,\x20%s,\x20%s',_0x2d44c8,_0x4caa5d[_0x7efd('0x16')]['message']);return _0x2333df(_0x4caa5d['error'][_0x7efd('0x19')]);}else{logger['info'](_0x7efd('0x18'),_0x2d44c8,_0x7efd('0x12'));_0x2333df(_0x4caa5d[_0x7efd('0x1a')][_0x7efd('0x19')]);}})[_0x7efd('0x1b')](function(_0x103f6f){logger[_0x7efd('0x16')](_0x7efd('0x18'),_0x2d44c8,_0x103f6f);_0x5f59bb(_0x103f6f);});});}exports[_0x7efd('0x1c')]=function(_0x312814){var _0x10fcc4=this;return new Promise(function(_0x33e430,_0xf5ce77){return db[_0x7efd('0x1d')][_0x7efd('0x1e')]({'raw':_0x312814[_0x7efd('0x1f')]?_0x312814[_0x7efd('0x1f')][_0x7efd('0x20')]===undefined?!![]:![]:!![],'where':_0x312814[_0x7efd('0x1f')]?_0x312814['options'][_0x7efd('0x21')]||null:null,'attributes':_0x312814[_0x7efd('0x1f')]?_0x312814['options'][_0x7efd('0x22')]||null:null,'include':_0x312814[_0x7efd('0x1f')]?_0x312814[_0x7efd('0x1f')]['include']?_[_0x7efd('0x23')](_0x312814[_0x7efd('0x1f')][_0x7efd('0x24')],function(_0x5aba37){return{'model':db[_0x5aba37[_0x7efd('0x25')]],'as':_0x5aba37['as'],'attributes':_0x5aba37['attributes'],'include':_0x5aba37[_0x7efd('0x24')]?_[_0x7efd('0x23')](_0x5aba37[_0x7efd('0x24')],function(_0x217aa5){return{'model':db[_0x217aa5[_0x7efd('0x25')]],'as':_0x217aa5['as'],'attributes':_0x217aa5['attributes'],'include':_0x217aa5[_0x7efd('0x24')]?_['map'](_0x217aa5[_0x7efd('0x24')],function(_0x5b8de2){return{'model':db[_0x5b8de2[_0x7efd('0x25')]],'as':_0x5b8de2['as'],'attributes':_0x5b8de2[_0x7efd('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7efd('0x10')](function(_0x1cb58e){logger['info'](_0x7efd('0x1c'),_0x312814);logger[_0x7efd('0x13')](_0x7efd('0x1c'),_0x312814,JSON[_0x7efd('0x15')](_0x1cb58e));_0x33e430(_0x1cb58e);})[_0x7efd('0x1b')](function(_0xc50ba1){logger[_0x7efd('0x16')](_0x7efd('0x1c'),_0xc50ba1[_0x7efd('0x19')],_0x312814);_0xf5ce77(_0x10fcc4['error'](0x1f4,_0xc50ba1[_0x7efd('0x19')]));});});};exports[_0x7efd('0x26')]=function(_0x3ad31d){var _0x2b876f=this;return new Promise(function(_0x39156a,_0x1d9e20){return db[_0x7efd('0x1d')]['create'](_0x3ad31d['body'],{'raw':_0x3ad31d[_0x7efd('0x1f')]?_0x3ad31d[_0x7efd('0x1f')][_0x7efd('0x20')]===undefined?!![]:![]:!![]})[_0x7efd('0x10')](function(_0xf6113){logger['info'](_0x7efd('0x26'),_0x3ad31d);logger[_0x7efd('0x13')](_0x7efd('0x26'),_0x3ad31d,JSON[_0x7efd('0x15')](_0xf6113));_0x39156a(_0xf6113);})[_0x7efd('0x1b')](function(_0x2c7f16){logger['error'](_0x7efd('0x26'),_0x2c7f16[_0x7efd('0x19')],_0x3ad31d);_0x1d9e20(_0x2b876f[_0x7efd('0x16')](0x1f4,_0x2c7f16['message']));});});};
\ No newline at end of file
+var _0x919f=['request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowCmContact','find','options','raw','where','attributes','include','map','model','CreateCmContact','CmContact','create','body','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s'];(function(_0x1c55ee,_0x3def8d){var _0x3ed187=function(_0x2e0494){while(--_0x2e0494){_0x1c55ee['push'](_0x1c55ee['shift']());}};_0x3ed187(++_0x3def8d);}(_0x919f,0xb9));var _0xf919=function(_0xb55a96,_0x55c1dd){_0xb55a96=_0xb55a96-0x0;var _0x287dcd=_0x919f[_0xb55a96];return _0x287dcd;};'use strict';var _=require(_0xf919('0x0'));var util=require(_0xf919('0x1'));var moment=require(_0xf919('0x2'));var BPromise=require(_0xf919('0x3'));var rs=require(_0xf919('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf919('0x5'))['db'];var utils=require(_0xf919('0x6'));var logger=require(_0xf919('0x7'))('rpc');var config=require(_0xf919('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf919('0x9')][_0xf919('0xa')]({'port':0x232a});config[_0xf919('0xb')]=_['defaults'](config[_0xf919('0xb')],{'host':_0xf919('0xc'),'port':0x18eb});var socket=require(_0xf919('0xd'))(new Redis(config[_0xf919('0xb')]));require(_0xf919('0xe'))[_0xf919('0xf')](socket);function respondWithRpcPromise(_0x5afa6b,_0x31b063,_0x4f2c80){return new BPromise(function(_0x1c2e32,_0x108be5){return client[_0xf919('0x10')](_0x5afa6b,_0x4f2c80)[_0xf919('0x11')](function(_0x5406ba){logger[_0xf919('0x12')](_0xf919('0x13'),_0x31b063,_0xf919('0x14'));logger[_0xf919('0x15')](_0xf919('0x16'),_0x31b063,_0xf919('0x14'),JSON[_0xf919('0x17')](_0x5406ba));if(_0x5406ba['error']){if(_0x5406ba[_0xf919('0x18')][_0xf919('0x19')]===0x1f4){logger[_0xf919('0x18')](_0xf919('0x13'),_0x31b063,_0x5406ba['error'][_0xf919('0x1a')]);return _0x108be5(_0x5406ba[_0xf919('0x18')][_0xf919('0x1a')]);}logger['error']('CmContact,\x20%s,\x20%s',_0x31b063,_0x5406ba[_0xf919('0x18')]['message']);return _0x1c2e32(_0x5406ba[_0xf919('0x18')][_0xf919('0x1a')]);}else{logger[_0xf919('0x12')](_0xf919('0x13'),_0x31b063,_0xf919('0x14'));_0x1c2e32(_0x5406ba['result'][_0xf919('0x1a')]);}})[_0xf919('0x1b')](function(_0x9117f6){logger[_0xf919('0x18')]('CmContact,\x20%s,\x20%s',_0x31b063,_0x9117f6);_0x108be5(_0x9117f6);});});}exports[_0xf919('0x1c')]=function(_0x2d171d){var _0x242a06=this;return new Promise(function(_0x2f88af,_0x16b2f3){return db['CmContact'][_0xf919('0x1d')]({'raw':_0x2d171d[_0xf919('0x1e')]?_0x2d171d['options'][_0xf919('0x1f')]===undefined?!![]:![]:!![],'where':_0x2d171d[_0xf919('0x1e')]?_0x2d171d[_0xf919('0x1e')][_0xf919('0x20')]||null:null,'attributes':_0x2d171d[_0xf919('0x1e')]?_0x2d171d[_0xf919('0x1e')][_0xf919('0x21')]||null:null,'include':_0x2d171d[_0xf919('0x1e')]?_0x2d171d[_0xf919('0x1e')][_0xf919('0x22')]?_[_0xf919('0x23')](_0x2d171d[_0xf919('0x1e')][_0xf919('0x22')],function(_0xc0e4a7){return{'model':db[_0xc0e4a7['model']],'as':_0xc0e4a7['as'],'attributes':_0xc0e4a7[_0xf919('0x21')],'include':_0xc0e4a7[_0xf919('0x22')]?_['map'](_0xc0e4a7[_0xf919('0x22')],function(_0x57ade0){return{'model':db[_0x57ade0[_0xf919('0x24')]],'as':_0x57ade0['as'],'attributes':_0x57ade0[_0xf919('0x21')],'include':_0x57ade0[_0xf919('0x22')]?_[_0xf919('0x23')](_0x57ade0[_0xf919('0x22')],function(_0xdfc8d){return{'model':db[_0xdfc8d[_0xf919('0x24')]],'as':_0xdfc8d['as'],'attributes':_0xdfc8d[_0xf919('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1853be){logger[_0xf919('0x12')](_0xf919('0x1c'),_0x2d171d);logger[_0xf919('0x15')]('ShowCmContact',_0x2d171d,JSON[_0xf919('0x17')](_0x1853be));_0x2f88af(_0x1853be);})[_0xf919('0x1b')](function(_0x399725){logger['error'](_0xf919('0x1c'),_0x399725[_0xf919('0x1a')],_0x2d171d);_0x16b2f3(_0x242a06['error'](0x1f4,_0x399725[_0xf919('0x1a')]));});});};exports[_0xf919('0x25')]=function(_0x5a97a8){var _0x12e7d9=this;return new Promise(function(_0x4c5dc3,_0xf672cb){return db[_0xf919('0x26')][_0xf919('0x27')](_0x5a97a8[_0xf919('0x28')],{'raw':_0x5a97a8[_0xf919('0x1e')]?_0x5a97a8[_0xf919('0x1e')][_0xf919('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x460dac){logger[_0xf919('0x12')](_0xf919('0x25'),_0x5a97a8);logger['debug'](_0xf919('0x25'),_0x5a97a8,JSON['stringify'](_0x460dac));_0x4c5dc3(_0x460dac);})[_0xf919('0x1b')](function(_0x541072){logger[_0xf919('0x18')]('CreateCmContact',_0x541072[_0xf919('0x1a')],_0x5a97a8);_0xf672cb(_0x12e7d9[_0xf919('0x18')](0x1f4,_0x541072['message']));});});};
\ No newline at end of file
index 7f807df..93659a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c7a=['update','removeListener','length','cmContact:','./cmContact.events','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7c7a,0x8e));var _0xa7c7=function(_0x3de2ec,_0x570a12){_0x3de2ec=_0x3de2ec-0x0;var _0x2582ec=_0x7c7a[_0x3de2ec];return _0x2582ec;};'use strict';var CmContactEvents=require(_0xa7c7('0x0'));var events=['save',_0xa7c7('0x1'),_0xa7c7('0x2')];function createListener(_0x7acfcc,_0x7a7563){return function(_0x4beddd){_0x7a7563['emit'](_0x7acfcc,_0x4beddd);};}function removeListener(_0x1bb23f,_0x35b9c6){return function(){CmContactEvents[_0xa7c7('0x3')](_0x1bb23f,_0x35b9c6);};}exports['register']=function(_0x5492ca){for(var _0x1ac332=0x0,_0x2d5d97=events[_0xa7c7('0x4')];_0x1ac332<_0x2d5d97;_0x1ac332++){var _0x425a88=events[_0x1ac332];var _0x316223=createListener(_0xa7c7('0x5')+_0x425a88,_0x5492ca);CmContactEvents['on'](_0x425a88,_0x316223);}};
\ No newline at end of file
+var _0x3a00=['register','length','cmContact:','./cmContact.events','save','remove','update','emit'];(function(_0x59ce68,_0x98d1b5){var _0x37c816=function(_0x33e81b){while(--_0x33e81b){_0x59ce68['push'](_0x59ce68['shift']());}};_0x37c816(++_0x98d1b5);}(_0x3a00,0x193));var _0x03a0=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x3a00[_0x220f3f];return _0x1f170e;};'use strict';var CmContactEvents=require(_0x03a0('0x0'));var events=[_0x03a0('0x1'),_0x03a0('0x2'),_0x03a0('0x3')];function createListener(_0x20667f,_0x28b61c){return function(_0x3c7d25){_0x28b61c[_0x03a0('0x4')](_0x20667f,_0x3c7d25);};}function removeListener(_0x3f599b,_0x3505e9){return function(){CmContactEvents['removeListener'](_0x3f599b,_0x3505e9);};}exports[_0x03a0('0x5')]=function(_0x2132d0){for(var _0x34ad82=0x0,_0x476039=events[_0x03a0('0x6')];_0x34ad82<_0x476039;_0x34ad82++){var _0xc8bc5e=events[_0x34ad82];var _0x269fdf=createListener(_0x03a0('0x7')+_0xc8bc5e,_0x2132d0);CmContactEvents['on'](_0xc8bc5e,_0x269fdf);}};
\ No newline at end of file
index bf85c29..eee25a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['express','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/jscripty_sessions','getJscriptySessions','merge','post','setTags','diskStorage','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','now','extname','single','uploadCsv','/upload','file','upload','/upload/:id','import','put','/:id','update','delete','exports','multer','util'];(function(_0x4aa7b8,_0xc69b67){var _0x310986=function(_0x1d18e7){while(--_0x1d18e7){_0x4aa7b8['push'](_0x4aa7b8['shift']());}};_0x310986(++_0xc69b67);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5da0d9,_0x49ee54){_0x5da0d9=_0x5da0d9-0x0;var _0x4b6d2f=_0x4b84[_0x5da0d9];return _0x4b6d2f;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x44b8('0x3'));var config=require(_0x44b8('0x4'));var controller=require(_0x44b8('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x44b8('0x6')]('/describe',auth[_0x44b8('0x7')](),controller['describe']);router[_0x44b8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router[_0x44b8('0x6')](_0x44b8('0x9'),auth['isAuthenticated'](),controller[_0x44b8('0xa')]);router[_0x44b8('0x6')](_0x44b8('0xb'),auth[_0x44b8('0x7')](),controller[_0x44b8('0xc')]);router[_0x44b8('0x6')](_0x44b8('0xd'),auth['isAuthenticated'](),controller[_0x44b8('0xe')]);router[_0x44b8('0x6')]('/:id/hopper_finals',auth[_0x44b8('0x7')](),controller['getHopperFinals']);router[_0x44b8('0x6')](_0x44b8('0xf'),auth['isAuthenticated'](),controller[_0x44b8('0x10')]);router['post']('/merge',auth[_0x44b8('0x7')](),controller[_0x44b8('0x11')]);router[_0x44b8('0x12')]('/',auth[_0x44b8('0x7')](),controller['create']);router['post']('/create_many',auth[_0x44b8('0x7')](),controller['bulkCreate']);router[_0x44b8('0x12')](_0x44b8('0x9'),auth['isAuthenticated'](),controller[_0x44b8('0x13')]);var upload=multer({'storage':multer[_0x44b8('0x14')]({'destination':function(_0x5103f5,_0x89bc30,_0x3f4688){_0x3f4688(null,path['join'](config[_0x44b8('0x15')],_0x44b8('0x16')));},'filename':function(_0xebfe79,_0x235bdc,_0x102ef9){_0x235bdc[_0x44b8('0x17')]=_0x235bdc[_0x44b8('0x17')][_0x44b8('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x102ef9(null,util[_0x44b8('0x19')](_0x44b8('0x1a'),path[_0x44b8('0x1b')](_0x235bdc[_0x44b8('0x17')],path['extname'](_0x235bdc[_0x44b8('0x17')])),Date[_0x44b8('0x1c')](),path[_0x44b8('0x1d')](_0x235bdc[_0x44b8('0x17')])));}})});router[_0x44b8('0x12')]('/csv',upload[_0x44b8('0x1e')]('file'),controller[_0x44b8('0x1f')]);var upload=multer({'storage':multer[_0x44b8('0x14')]({'destination':function(_0x25a0c1,_0x47689e,_0x230a3d){_0x230a3d(null,path['join'](config[_0x44b8('0x15')],'server/files/tmp'));},'filename':function(_0x41d673,_0x350482,_0x549a26){_0x350482[_0x44b8('0x17')]=_0x350482[_0x44b8('0x17')][_0x44b8('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x549a26(null,util['format'](_0x44b8('0x1a'),path[_0x44b8('0x1b')](_0x350482['originalname'],path[_0x44b8('0x1d')](_0x350482['originalname'])),Date[_0x44b8('0x1c')](),path['extname'](_0x350482['originalname'])));}})});router['post'](_0x44b8('0x20'),upload[_0x44b8('0x1e')](_0x44b8('0x21')),controller[_0x44b8('0x22')]);router[_0x44b8('0x12')](_0x44b8('0x23'),auth[_0x44b8('0x7')](),controller[_0x44b8('0x24')]);router[_0x44b8('0x25')](_0x44b8('0x26'),auth[_0x44b8('0x7')](),controller[_0x44b8('0x27')]);router[_0x44b8('0x28')]('/:id',auth[_0x44b8('0x7')](),controller['destroy']);module[_0x44b8('0x29')]=router;
\ No newline at end of file
+var _0x5fc3=['/:id','show','/:id/tags','getTags','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','create','/create_many','setTags','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','now','extname','single','file','server/files/tmp','upload','/upload/:id','import','put','update','delete','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','/describe','describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5c72ee,_0x5a8bf8){_0x5c72ee=_0x5c72ee-0x0;var _0x231876=_0x5fc3[_0x5c72ee];return _0x231876;};'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 auth=require(_0x35fc('0x5'));var interaction=require(_0x35fc('0x6'));var config=require('../../config/environment');var controller=require(_0x35fc('0x7'));router[_0x35fc('0x8')]('/',auth[_0x35fc('0x9')](),controller['index']);router['get'](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0xb')]);router[_0x35fc('0x8')](_0x35fc('0xc'),auth[_0x35fc('0x9')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x8')](_0x35fc('0xe'),auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x8')]('/:id/hoppers',auth[_0x35fc('0x9')](),controller[_0x35fc('0x10')]);router['get'](_0x35fc('0x11'),auth[_0x35fc('0x9')](),controller['getHopperHistories']);router['get'](_0x35fc('0x12'),auth['isAuthenticated'](),controller[_0x35fc('0x13')]);router[_0x35fc('0x8')](_0x35fc('0x14'),auth[_0x35fc('0x9')](),controller[_0x35fc('0x15')]);router['post']('/merge',auth['isAuthenticated'](),controller['merge']);router[_0x35fc('0x16')]('/',auth[_0x35fc('0x9')](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')](_0x35fc('0x18'),auth[_0x35fc('0x9')](),controller['bulkCreate']);router[_0x35fc('0x16')](_0x35fc('0xe'),auth['isAuthenticated'](),controller[_0x35fc('0x19')]);var upload=multer({'storage':multer[_0x35fc('0x1a')]({'destination':function(_0x2e513b,_0x5f56c6,_0x1a86e9){_0x1a86e9(null,path[_0x35fc('0x1b')](config[_0x35fc('0x1c')],'server/files/tmp'));},'filename':function(_0x402cff,_0x350a27,_0x3229d1){_0x350a27[_0x35fc('0x1d')]=_0x350a27[_0x35fc('0x1d')][_0x35fc('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3229d1(null,util[_0x35fc('0x1f')](_0x35fc('0x20'),path[_0x35fc('0x21')](_0x350a27[_0x35fc('0x1d')],path['extname'](_0x350a27[_0x35fc('0x1d')])),Date[_0x35fc('0x22')](),path[_0x35fc('0x23')](_0x350a27[_0x35fc('0x1d')])));}})});router[_0x35fc('0x16')]('/csv',upload[_0x35fc('0x24')](_0x35fc('0x25')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x35fc('0x1a')]({'destination':function(_0x5a93df,_0x3d4a98,_0x51cfec){_0x51cfec(null,path[_0x35fc('0x1b')](config['root'],_0x35fc('0x26')));},'filename':function(_0xdfab9f,_0x5cb986,_0x519264){_0x5cb986[_0x35fc('0x1d')]=_0x5cb986['originalname'][_0x35fc('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x519264(null,util[_0x35fc('0x1f')]('%s-%s%s',path[_0x35fc('0x21')](_0x5cb986[_0x35fc('0x1d')],path[_0x35fc('0x23')](_0x5cb986[_0x35fc('0x1d')])),Date[_0x35fc('0x22')](),path[_0x35fc('0x23')](_0x5cb986[_0x35fc('0x1d')])));}})});router[_0x35fc('0x16')]('/upload',upload[_0x35fc('0x24')](_0x35fc('0x25')),controller[_0x35fc('0x27')]);router['post'](_0x35fc('0x28'),auth[_0x35fc('0x9')](),controller[_0x35fc('0x29')]);router[_0x35fc('0x2a')](_0x35fc('0xc'),auth[_0x35fc('0x9')](),controller[_0x35fc('0x2b')]);router[_0x35fc('0x2c')](_0x35fc('0xc'),auth[_0x35fc('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index b586660..041fb08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9c8=['STRING','INTEGER','PHONE','sequelize','exports'];(function(_0x55a76a,_0x2d0203){var _0x45885a=function(_0x4348d5){while(--_0x4348d5){_0x55a76a['push'](_0x55a76a['shift']());}};_0x45885a(++_0x2d0203);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xd9c8[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require(_0x8d9c('0x0'));module[_0x8d9c('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x8d9c('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x8d9c('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x8d9c('0x2')],'defaultValue':_0x8d9c('0x4')},'OrderBy':{'type':Sequelize[_0x8d9c('0x3')],'defaultValue':null}};
\ No newline at end of file
+var _0x10dc=['STRING','PHONE','INTEGER','sequelize','exports'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x10dc,0x107));var _0xc10d=function(_0x16ee48,_0x4e660d){_0x16ee48=_0x16ee48-0x0;var _0x23f7bf=_0x10dc[_0x16ee48];return _0x23f7bf;};'use strict';var Sequelize=require(_0xc10d('0x0'));module[_0xc10d('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xc10d('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xc10d('0x2')],'defaultValue':_0xc10d('0x3')},'OrderBy':{'type':Sequelize[_0xc10d('0x4')],'defaultValue':null}};
\ No newline at end of file
index a9e3cb9..3dd47ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e1a=['findAll','rows','catch','length','includeAll','find','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','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','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','destroy','then','get','CmContactHasItems','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','CmContactHasItem','count'];(function(_0x431e8a,_0x38a16a){var _0x39ee78=function(_0x2e9766){while(--_0x2e9766){_0x431e8a['push'](_0x431e8a['shift']());}};_0x39ee78(++_0x38a16a);}(_0x6e1a,0xfa));var _0xa6e1=function(_0x137487,_0x3010cb){_0x137487=_0x137487-0x0;var _0x5ee9b6=_0x6e1a[_0x137487];return _0x5ee9b6;};'use strict';var pdf=require(_0xa6e1('0x0'));var emlformat=require(_0xa6e1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa6e1('0x2'));var jsonpatch=require(_0xa6e1('0x3'));var rp=require(_0xa6e1('0x4'));var moment=require(_0xa6e1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa6e1('0x6'));var util=require(_0xa6e1('0x7'));var path=require(_0xa6e1('0x8'));var sox=require('sox');var csv=require(_0xa6e1('0x9'));var ejs=require(_0xa6e1('0xa'));var fs=require('fs');var _=require(_0xa6e1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa6e1('0xc'));var deskjs=require(_0xa6e1('0xd'));var toCsv=require(_0xa6e1('0x9'));var querystring=require(_0xa6e1('0xe'));var Papa=require('papaparse');var Redis=require(_0xa6e1('0xf'));var authService=require(_0xa6e1('0x10'));var qs=require(_0xa6e1('0x11'));var as=require(_0xa6e1('0x12'));var hardwareService=require(_0xa6e1('0x13'));var logger=require(_0xa6e1('0x14'))(_0xa6e1('0x15'));var utils=require(_0xa6e1('0x16'));var config=require(_0xa6e1('0x17'));var db=require(_0xa6e1('0x18'))['db'];function respondWithStatusCode(_0x3ba027,_0x3d2b5d){_0x3d2b5d=_0x3d2b5d||0xcc;return function(_0x2fdb3b){if(_0x2fdb3b){return _0x3ba027['sendStatus'](_0x3d2b5d);}return _0x3ba027[_0xa6e1('0x19')](_0x3d2b5d)[_0xa6e1('0x1a')]();};}function respondWithResult(_0x147736,_0x2aeefa){_0x2aeefa=_0x2aeefa||0xc8;return function(_0x5a2d6c){if(_0x5a2d6c){return _0x147736[_0xa6e1('0x19')](_0x2aeefa)[_0xa6e1('0x1b')](_0x5a2d6c);}};}function respondWithFilteredResult(_0x5bc684,_0x130fd4){return function(_0x48f8e5){if(_0x48f8e5){var _0x254c19=_0x48f8e5['count'],_0xc8615c=_0x130fd4['offset'],_0x3f4be4=_0x130fd4[_0xa6e1('0x1c')]+_0x130fd4[_0xa6e1('0x1d')],_0x1964af;if(_0x3f4be4>=_0x254c19){_0x3f4be4=_0x254c19;_0x1964af=0xc8;}else{_0x1964af=0xce;}_0x5bc684[_0xa6e1('0x19')](_0x1964af);return _0x5bc684[_0xa6e1('0x1e')]('Content-Range',_0xc8615c+'-'+_0x3f4be4+'/'+_0x254c19)[_0xa6e1('0x1b')](_0x48f8e5);}return null;};}function patchUpdates(_0xd2f9ac){return function(_0x1b42aa){try{jsonpatch[_0xa6e1('0x1f')](_0x1b42aa,_0xd2f9ac,!![]);}catch(_0x443cfb){return BPromise[_0xa6e1('0x20')](_0x443cfb);}return _0x1b42aa[_0xa6e1('0x21')]();};}function saveUpdates(_0x4e3a21,_0x814e84){return function(_0x497483){if(_0x497483){return _0x497483[_0xa6e1('0x22')](_0x4e3a21)['then'](function(_0x3965f0){return _0x3965f0;});}return null;};}function removeEntity(_0x37f7a2,_0x59686a){return function(_0x576550){if(_0x576550){return _0x576550[_0xa6e1('0x23')]()[_0xa6e1('0x24')](function(){var _0x4b1b5d=_0x576550[_0xa6e1('0x25')]({'plain':!![]});var _0x3e7bc2=_0xa6e1('0x26');return db[_0xa6e1('0x27')][_0xa6e1('0x23')]({'where':{'type':_0x3e7bc2,'resourceId':_0x4b1b5d['id']}})[_0xa6e1('0x24')](function(){return _0x576550;});})[_0xa6e1('0x24')](function(){_0x37f7a2[_0xa6e1('0x19')](0xcc)[_0xa6e1('0x1a')]();});}};}function handleEntityNotFound(_0x30d7e4,_0xa74933){return function(_0x1d3d86){if(!_0x1d3d86){_0x30d7e4['sendStatus'](0x194);}return _0x1d3d86;};}function handleError(_0x593720,_0x5fe9a5){_0x5fe9a5=_0x5fe9a5||0x1f4;return function(_0x11df67){logger[_0xa6e1('0x28')](_0x11df67[_0xa6e1('0x29')]);if(_0x11df67[_0xa6e1('0x2a')]){delete _0x11df67[_0xa6e1('0x2a')];}_0x593720[_0xa6e1('0x19')](_0x5fe9a5)[_0xa6e1('0x2b')](_0x11df67);};}exports['index']=function(_0x3ec183,_0x583c1e){var _0x59a98c={},_0x2fa8cd={},_0x4a0566={'count':0x0,'rows':[]};var _0x427ada=_[_0xa6e1('0x2c')](db['CmContactHasItem'][_0xa6e1('0x2d')],function(_0x48cd64){return{'name':_0x48cd64[_0xa6e1('0x2e')],'type':_0x48cd64[_0xa6e1('0x2f')][_0xa6e1('0x30')]};});_0x2fa8cd[_0xa6e1('0x31')]=_[_0xa6e1('0x2c')](_0x427ada,_0xa6e1('0x2a'));_0x2fa8cd[_0xa6e1('0x32')]=_[_0xa6e1('0x33')](_0x3ec183['query']);_0x2fa8cd[_0xa6e1('0x34')]=_[_0xa6e1('0x35')](_0x2fa8cd[_0xa6e1('0x31')],_0x2fa8cd[_0xa6e1('0x32')]);_0x59a98c[_0xa6e1('0x36')]=_[_0xa6e1('0x35')](_0x2fa8cd[_0xa6e1('0x31')],qs[_0xa6e1('0x37')](_0x3ec183[_0xa6e1('0x32')][_0xa6e1('0x37')]));_0x59a98c[_0xa6e1('0x36')]=_0x59a98c[_0xa6e1('0x36')]['length']?_0x59a98c['attributes']:_0x2fa8cd[_0xa6e1('0x31')];if(!_0x3ec183['query'][_0xa6e1('0x38')](_0xa6e1('0x39'))){_0x59a98c[_0xa6e1('0x1d')]=qs[_0xa6e1('0x1d')](_0x3ec183[_0xa6e1('0x32')][_0xa6e1('0x1d')]);_0x59a98c[_0xa6e1('0x1c')]=qs[_0xa6e1('0x1c')](_0x3ec183[_0xa6e1('0x32')][_0xa6e1('0x1c')]);}_0x59a98c['order']=qs[_0xa6e1('0x3a')](_0x3ec183[_0xa6e1('0x32')]['sort']);_0x59a98c[_0xa6e1('0x3b')]=qs['filters'](_['pick'](_0x3ec183[_0xa6e1('0x32')],_0x2fa8cd[_0xa6e1('0x34')]),_0x427ada);if(_0x3ec183[_0xa6e1('0x32')][_0xa6e1('0x3c')]){_0x59a98c[_0xa6e1('0x3b')]=_[_0xa6e1('0x3d')](_0x59a98c[_0xa6e1('0x3b')],{'$or':_[_0xa6e1('0x2c')](_0x427ada,function(_0x5d79be){if(_0x5d79be['type']!==_0xa6e1('0x3e')){var _0x281fca={};_0x281fca[_0x5d79be['name']]={'$like':'%'+_0x3ec183[_0xa6e1('0x32')]['filter']+'%'};return _0x281fca;}})});}_0x59a98c=_[_0xa6e1('0x3d')]({},_0x59a98c,_0x3ec183[_0xa6e1('0x3f')]);var _0x4a2652={'where':_0x59a98c[_0xa6e1('0x3b')]};return db[_0xa6e1('0x40')][_0xa6e1('0x41')](_0x4a2652)['then'](function(_0x1f401b){_0x4a0566['count']=_0x1f401b;if(_0x3ec183[_0xa6e1('0x32')]['includeAll']){_0x59a98c['include']=[{'all':!![]}];}return db[_0xa6e1('0x40')][_0xa6e1('0x42')](_0x59a98c);})[_0xa6e1('0x24')](function(_0xac62b3){_0x4a0566[_0xa6e1('0x43')]=_0xac62b3;return _0x4a0566;})['then'](respondWithFilteredResult(_0x583c1e,_0x59a98c))[_0xa6e1('0x44')](handleError(_0x583c1e,null));};exports['show']=function(_0x585ae6,_0x24abdf){var _0x170d8d={'raw':!![],'where':{'id':_0x585ae6['params']['id']}},_0x5549ad={};_0x5549ad[_0xa6e1('0x31')]=_[_0xa6e1('0x33')](db[_0xa6e1('0x40')][_0xa6e1('0x2d')]);_0x5549ad[_0xa6e1('0x32')]=_['keys'](_0x585ae6[_0xa6e1('0x32')]);_0x5549ad[_0xa6e1('0x34')]=_['intersection'](_0x5549ad[_0xa6e1('0x31')],_0x5549ad['query']);_0x170d8d[_0xa6e1('0x36')]=_[_0xa6e1('0x35')](_0x5549ad[_0xa6e1('0x31')],qs['fields'](_0x585ae6['query'][_0xa6e1('0x37')]));_0x170d8d['attributes']=_0x170d8d['attributes'][_0xa6e1('0x45')]?_0x170d8d[_0xa6e1('0x36')]:_0x5549ad[_0xa6e1('0x31')];if(_0x585ae6[_0xa6e1('0x32')][_0xa6e1('0x46')]){_0x170d8d['include']=[{'all':!![]}];}_0x170d8d=_[_0xa6e1('0x3d')]({},_0x170d8d,_0x585ae6[_0xa6e1('0x3f')]);return db[_0xa6e1('0x40')][_0xa6e1('0x47')](_0x170d8d)['then'](handleEntityNotFound(_0x24abdf,null))[_0xa6e1('0x24')](respondWithResult(_0x24abdf,null))['catch'](handleError(_0x24abdf,null));};exports[_0xa6e1('0x48')]=function(_0x5467b1,_0x4e4d5c){return db[_0xa6e1('0x40')][_0xa6e1('0x48')](_0x5467b1[_0xa6e1('0x49')],{})[_0xa6e1('0x24')](function(_0x2d1b70){var _0x291a2f=_0x5467b1[_0xa6e1('0x4a')][_0xa6e1('0x25')]({'plain':!![]});if(!_0x291a2f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x291a2f[_0xa6e1('0x4b')]===_0xa6e1('0x4a')){var _0x5b7e81=_0x2d1b70[_0xa6e1('0x25')]({'plain':!![]});var _0x41b163=_0xa6e1('0x26');return db['UserProfileSection'][_0xa6e1('0x47')]({'where':{'name':_0x41b163,'userProfileId':_0x291a2f['userProfileId']},'raw':!![]})[_0xa6e1('0x24')](function(_0x2670d4){if(_0x2670d4&&_0x2670d4[_0xa6e1('0x4c')]===0x0){return db[_0xa6e1('0x27')][_0xa6e1('0x48')]({'name':_0x5b7e81[_0xa6e1('0x2a')],'resourceId':_0x5b7e81['id'],'type':_0x2670d4[_0xa6e1('0x2a')],'sectionId':_0x2670d4['id']},{})[_0xa6e1('0x24')](function(){return _0x2d1b70;});}else{return _0x2d1b70;}})[_0xa6e1('0x44')](function(_0x590299){logger[_0xa6e1('0x28')](_0xa6e1('0x4d'),_0x590299);throw _0x590299;});}return _0x2d1b70;})['then'](respondWithResult(_0x4e4d5c,0xc9))[_0xa6e1('0x44')](handleError(_0x4e4d5c,null));};exports[_0xa6e1('0x22')]=function(_0x1de410,_0x1de310){if(_0x1de410['body']['id']){delete _0x1de410[_0xa6e1('0x49')]['id'];}return db[_0xa6e1('0x40')][_0xa6e1('0x47')]({'where':{'id':_0x1de410['params']['id']}})[_0xa6e1('0x24')](handleEntityNotFound(_0x1de310,null))[_0xa6e1('0x24')](saveUpdates(_0x1de410[_0xa6e1('0x49')],null))['then'](respondWithResult(_0x1de310,null))['catch'](handleError(_0x1de310,null));};exports[_0xa6e1('0x23')]=function(_0x496bf0,_0x1d2f4c){return db['CmContactHasItem'][_0xa6e1('0x47')]({'where':{'id':_0x496bf0[_0xa6e1('0x4e')]['id']}})[_0xa6e1('0x24')](handleEntityNotFound(_0x1d2f4c,null))['then'](removeEntity(_0x1d2f4c,null))[_0xa6e1('0x44')](handleError(_0x1d2f4c,null));};
\ No newline at end of file
+var _0x7cb2=['UserProfileResource','destroy','error','stack','name','index','CmContactHasItem','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','filter','options','count','includeAll','include','findAll','rows','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','set','reject','save','then'];(function(_0x4719a7,_0x12a8c1){var _0x5cc84e=function(_0x21980a){while(--_0x21980a){_0x4719a7['push'](_0x4719a7['shift']());}};_0x5cc84e(++_0x12a8c1);}(_0x7cb2,0x11b));var _0x27cb=function(_0x757227,_0x408cf0){_0x757227=_0x757227-0x0;var _0x5f1356=_0x7cb2[_0x757227];return _0x5f1356;};'use strict';var pdf=require(_0x27cb('0x0'));var emlformat=require(_0x27cb('0x1'));var rimraf=require(_0x27cb('0x2'));var zipdir=require(_0x27cb('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27cb('0x4'));var moment=require('moment');var BPromise=require(_0x27cb('0x5'));var Mustache=require(_0x27cb('0x6'));var util=require(_0x27cb('0x7'));var path=require(_0x27cb('0x8'));var sox=require(_0x27cb('0x9'));var csv=require('to-csv');var ejs=require(_0x27cb('0xa'));var fs=require('fs');var _=require(_0x27cb('0xb'));var squel=require(_0x27cb('0xc'));var crypto=require(_0x27cb('0xd'));var jsforce=require(_0x27cb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x27cb('0xf'));var querystring=require('querystring');var Papa=require(_0x27cb('0x10'));var Redis=require('ioredis');var authService=require(_0x27cb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x27cb('0x12'));var hardwareService=require(_0x27cb('0x13'));var logger=require(_0x27cb('0x14'))('api');var utils=require(_0x27cb('0x15'));var config=require('../../config/environment');var db=require(_0x27cb('0x16'))['db'];function respondWithStatusCode(_0x195a2a,_0x15b5a4){_0x15b5a4=_0x15b5a4||0xcc;return function(_0x7d8374){if(_0x7d8374){return _0x195a2a[_0x27cb('0x17')](_0x15b5a4);}return _0x195a2a['status'](_0x15b5a4)[_0x27cb('0x18')]();};}function respondWithResult(_0xf842b3,_0x39ca25){_0x39ca25=_0x39ca25||0xc8;return function(_0x47d59d){if(_0x47d59d){return _0xf842b3[_0x27cb('0x19')](_0x39ca25)[_0x27cb('0x1a')](_0x47d59d);}};}function respondWithFilteredResult(_0x32b9ea,_0x345644){return function(_0x195a97){if(_0x195a97){var _0x4e762e=_0x195a97['count'],_0x15f8bc=_0x345644[_0x27cb('0x1b')],_0x35e269=_0x345644[_0x27cb('0x1b')]+_0x345644[_0x27cb('0x1c')],_0x567fe3;if(_0x35e269>=_0x4e762e){_0x35e269=_0x4e762e;_0x567fe3=0xc8;}else{_0x567fe3=0xce;}_0x32b9ea[_0x27cb('0x19')](_0x567fe3);return _0x32b9ea[_0x27cb('0x1d')]('Content-Range',_0x15f8bc+'-'+_0x35e269+'/'+_0x4e762e)[_0x27cb('0x1a')](_0x195a97);}return null;};}function patchUpdates(_0x42406a){return function(_0x27ca0c){try{jsonpatch['apply'](_0x27ca0c,_0x42406a,!![]);}catch(_0x2d59fc){return BPromise[_0x27cb('0x1e')](_0x2d59fc);}return _0x27ca0c[_0x27cb('0x1f')]();};}function saveUpdates(_0x5dba6e,_0x4af0bc){return function(_0x26f2f7){if(_0x26f2f7){return _0x26f2f7['update'](_0x5dba6e)['then'](function(_0x2a8ff3){return _0x2a8ff3;});}return null;};}function removeEntity(_0x450539,_0x586a9c){return function(_0xd45696){if(_0xd45696){return _0xd45696['destroy']()[_0x27cb('0x20')](function(){var _0x2aec14=_0xd45696['get']({'plain':!![]});var _0x563a86='CmContactHasItems';return db[_0x27cb('0x21')][_0x27cb('0x22')]({'where':{'type':_0x563a86,'resourceId':_0x2aec14['id']}})[_0x27cb('0x20')](function(){return _0xd45696;});})['then'](function(){_0x450539['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23d9b0,_0x1741bd){return function(_0x7bc224){if(!_0x7bc224){_0x23d9b0['sendStatus'](0x194);}return _0x7bc224;};}function handleError(_0x3331c9,_0x393088){_0x393088=_0x393088||0x1f4;return function(_0x177143){logger[_0x27cb('0x23')](_0x177143[_0x27cb('0x24')]);if(_0x177143[_0x27cb('0x25')]){delete _0x177143['name'];}_0x3331c9[_0x27cb('0x19')](_0x393088)['send'](_0x177143);};}exports[_0x27cb('0x26')]=function(_0x3fd479,_0x16af2c){var _0x7630c3={},_0x282e49={},_0x1d46cc={'count':0x0,'rows':[]};var _0x665baf=_['map'](db[_0x27cb('0x27')][_0x27cb('0x28')],function(_0x10bf46){return{'name':_0x10bf46[_0x27cb('0x29')],'type':_0x10bf46[_0x27cb('0x2a')]['key']};});_0x282e49[_0x27cb('0x2b')]=_[_0x27cb('0x2c')](_0x665baf,'name');_0x282e49[_0x27cb('0x2d')]=_[_0x27cb('0x2e')](_0x3fd479[_0x27cb('0x2d')]);_0x282e49[_0x27cb('0x2f')]=_['intersection'](_0x282e49[_0x27cb('0x2b')],_0x282e49[_0x27cb('0x2d')]);_0x7630c3[_0x27cb('0x30')]=_[_0x27cb('0x31')](_0x282e49[_0x27cb('0x2b')],qs[_0x27cb('0x32')](_0x3fd479[_0x27cb('0x2d')][_0x27cb('0x32')]));_0x7630c3[_0x27cb('0x30')]=_0x7630c3['attributes'][_0x27cb('0x33')]?_0x7630c3[_0x27cb('0x30')]:_0x282e49[_0x27cb('0x2b')];if(!_0x3fd479['query'][_0x27cb('0x34')](_0x27cb('0x35'))){_0x7630c3[_0x27cb('0x1c')]=qs['limit'](_0x3fd479['query']['limit']);_0x7630c3[_0x27cb('0x1b')]=qs['offset'](_0x3fd479[_0x27cb('0x2d')][_0x27cb('0x1b')]);}_0x7630c3['order']=qs[_0x27cb('0x36')](_0x3fd479[_0x27cb('0x2d')][_0x27cb('0x36')]);_0x7630c3['where']=qs[_0x27cb('0x2f')](_[_0x27cb('0x37')](_0x3fd479[_0x27cb('0x2d')],_0x282e49[_0x27cb('0x2f')]),_0x665baf);if(_0x3fd479[_0x27cb('0x2d')]['filter']){_0x7630c3[_0x27cb('0x38')]=_[_0x27cb('0x39')](_0x7630c3[_0x27cb('0x38')],{'$or':_['map'](_0x665baf,function(_0x4c114b){if(_0x4c114b['type']!=='VIRTUAL'){var _0x23a8e1={};_0x23a8e1[_0x4c114b[_0x27cb('0x25')]]={'$like':'%'+_0x3fd479['query'][_0x27cb('0x3a')]+'%'};return _0x23a8e1;}})});}_0x7630c3=_[_0x27cb('0x39')]({},_0x7630c3,_0x3fd479[_0x27cb('0x3b')]);var _0x250211={'where':_0x7630c3[_0x27cb('0x38')]};return db[_0x27cb('0x27')][_0x27cb('0x3c')](_0x250211)[_0x27cb('0x20')](function(_0x449fc4){_0x1d46cc['count']=_0x449fc4;if(_0x3fd479[_0x27cb('0x2d')][_0x27cb('0x3d')]){_0x7630c3[_0x27cb('0x3e')]=[{'all':!![]}];}return db[_0x27cb('0x27')][_0x27cb('0x3f')](_0x7630c3);})[_0x27cb('0x20')](function(_0x2dd867){_0x1d46cc[_0x27cb('0x40')]=_0x2dd867;return _0x1d46cc;})[_0x27cb('0x20')](respondWithFilteredResult(_0x16af2c,_0x7630c3))[_0x27cb('0x41')](handleError(_0x16af2c,null));};exports['show']=function(_0x2d723b,_0x41ce16){var _0x153d2d={'raw':!![],'where':{'id':_0x2d723b['params']['id']}},_0x1db556={};_0x1db556[_0x27cb('0x2b')]=_[_0x27cb('0x2e')](db['CmContactHasItem']['rawAttributes']);_0x1db556['query']=_[_0x27cb('0x2e')](_0x2d723b['query']);_0x1db556[_0x27cb('0x2f')]=_['intersection'](_0x1db556[_0x27cb('0x2b')],_0x1db556[_0x27cb('0x2d')]);_0x153d2d[_0x27cb('0x30')]=_[_0x27cb('0x31')](_0x1db556[_0x27cb('0x2b')],qs[_0x27cb('0x32')](_0x2d723b['query'][_0x27cb('0x32')]));_0x153d2d[_0x27cb('0x30')]=_0x153d2d[_0x27cb('0x30')][_0x27cb('0x33')]?_0x153d2d[_0x27cb('0x30')]:_0x1db556['model'];if(_0x2d723b[_0x27cb('0x2d')]['includeAll']){_0x153d2d['include']=[{'all':!![]}];}_0x153d2d=_[_0x27cb('0x39')]({},_0x153d2d,_0x2d723b[_0x27cb('0x3b')]);return db[_0x27cb('0x27')]['find'](_0x153d2d)[_0x27cb('0x20')](handleEntityNotFound(_0x41ce16,null))['then'](respondWithResult(_0x41ce16,null))[_0x27cb('0x41')](handleError(_0x41ce16,null));};exports[_0x27cb('0x42')]=function(_0x1f6f13,_0x505abd){return db[_0x27cb('0x27')]['create'](_0x1f6f13[_0x27cb('0x43')],{})[_0x27cb('0x20')](function(_0x1982a4){var _0x572f22=_0x1f6f13[_0x27cb('0x44')][_0x27cb('0x45')]({'plain':!![]});if(!_0x572f22)throw new Error(_0x27cb('0x46'));if(_0x572f22[_0x27cb('0x47')]===_0x27cb('0x44')){var _0x268242=_0x1982a4[_0x27cb('0x45')]({'plain':!![]});var _0x50c7f0=_0x27cb('0x48');return db[_0x27cb('0x49')][_0x27cb('0x4a')]({'where':{'name':_0x50c7f0,'userProfileId':_0x572f22['userProfileId']},'raw':!![]})['then'](function(_0x1e1ab1){if(_0x1e1ab1&&_0x1e1ab1[_0x27cb('0x4b')]===0x0){return db[_0x27cb('0x21')][_0x27cb('0x42')]({'name':_0x268242[_0x27cb('0x25')],'resourceId':_0x268242['id'],'type':_0x1e1ab1['name'],'sectionId':_0x1e1ab1['id']},{})['then'](function(){return _0x1982a4;});}else{return _0x1982a4;}})[_0x27cb('0x41')](function(_0x443e7c){logger[_0x27cb('0x23')](_0x27cb('0x4c'),_0x443e7c);throw _0x443e7c;});}return _0x1982a4;})[_0x27cb('0x20')](respondWithResult(_0x505abd,0xc9))[_0x27cb('0x41')](handleError(_0x505abd,null));};exports[_0x27cb('0x4d')]=function(_0x7f9e26,_0x2a452b){if(_0x7f9e26['body']['id']){delete _0x7f9e26[_0x27cb('0x43')]['id'];}return db[_0x27cb('0x27')][_0x27cb('0x4a')]({'where':{'id':_0x7f9e26[_0x27cb('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2a452b,null))['then'](saveUpdates(_0x7f9e26['body'],null))[_0x27cb('0x20')](respondWithResult(_0x2a452b,null))[_0x27cb('0x41')](handleError(_0x2a452b,null));};exports[_0x27cb('0x22')]=function(_0x47ee81,_0x10478f){return db[_0x27cb('0x27')][_0x27cb('0x4a')]({'where':{'id':_0x47ee81[_0x27cb('0x4e')]['id']}})[_0x27cb('0x20')](handleEntityNotFound(_0x10478f,null))[_0x27cb('0x20')](removeEntity(_0x10478f,null))[_0x27cb('0x41')](handleError(_0x10478f,null));};
\ No newline at end of file
index 8c8dd28..127eae6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5162=['bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem','cm_contact_has_items','lodash'];(function(_0x3358d6,_0x27b73e){var _0x11b227=function(_0x56230d){while(--_0x56230d){_0x3358d6['push'](_0x3358d6['shift']());}};_0x11b227(++_0x27b73e);}(_0x5162,0x103));var _0x2516=function(_0xc9df8b,_0x21744d){_0xc9df8b=_0xc9df8b-0x0;var _0x35ca5d=_0x5162[_0xc9df8b];return _0x35ca5d;};'use strict';var _=require(_0x2516('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2516('0x1'));var rp=require(_0x2516('0x2'));var fs=require('fs');var path=require(_0x2516('0x3'));var rimraf=require(_0x2516('0x4'));var config=require(_0x2516('0x5'));var attributes=require(_0x2516('0x6'));module[_0x2516('0x7')]=function(_0x5b71b5,_0x48f411){return _0x5b71b5['define'](_0x2516('0x8'),attributes,{'tableName':_0x2516('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3baf=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x3baf,0xf7));var _0xf3ba=function(_0x40632e,_0x1f7f8f){_0x40632e=_0x40632e-0x0;var _0x3708c4=_0x3baf[_0x40632e];return _0x3708c4;};'use strict';var _=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var logger=require(_0xf3ba('0x2'))(_0xf3ba('0x3'));var moment=require(_0xf3ba('0x4'));var BPromise=require(_0xf3ba('0x5'));var rp=require(_0xf3ba('0x6'));var fs=require('fs');var path=require(_0xf3ba('0x7'));var rimraf=require(_0xf3ba('0x8'));var config=require(_0xf3ba('0x9'));var attributes=require(_0xf3ba('0xa'));module[_0xf3ba('0xb')]=function(_0x475268,_0x2e6df2){return _0x475268[_0xf3ba('0xc')]('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index edbdad9..7dd4263 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb6a=['rpc','jayson/promise','client','http','then','info','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger'];(function(_0x2a9400,_0x1140c2){var _0x1936e6=function(_0x14bbfe){while(--_0x14bbfe){_0x2a9400['push'](_0x2a9400['shift']());}};_0x1936e6(++_0x1140c2);}(_0xeb6a,0x1f4));var _0xaeb6=function(_0x49710a,_0xb6de7c){_0x49710a=_0x49710a-0x0;var _0x2e483f=_0xeb6a[_0x49710a];return _0x2e483f;};'use strict';var _=require(_0xaeb6('0x0'));var util=require(_0xaeb6('0x1'));var moment=require(_0xaeb6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaeb6('0x3'));var db=require(_0xaeb6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaeb6('0x5'))(_0xaeb6('0x6'));var config=require('../../config/environment');var jayson=require(_0xaeb6('0x7'));var client=jayson[_0xaeb6('0x8')][_0xaeb6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fa527,_0x953300,_0x2c7c55){return new BPromise(function(_0x5bb3a9,_0x27d84b){return client['request'](_0x2fa527,_0x2c7c55)[_0xaeb6('0xa')](function(_0x49cf0e){logger[_0xaeb6('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x953300,'request\x20sent');logger[_0xaeb6('0xc')](_0xaeb6('0xd'),_0x953300,_0xaeb6('0xe'),JSON[_0xaeb6('0xf')](_0x49cf0e));if(_0x49cf0e[_0xaeb6('0x10')]){if(_0x49cf0e[_0xaeb6('0x10')][_0xaeb6('0x11')]===0x1f4){logger[_0xaeb6('0x10')](_0xaeb6('0x12'),_0x953300,_0x49cf0e[_0xaeb6('0x10')]['message']);return _0x27d84b(_0x49cf0e[_0xaeb6('0x10')]['message']);}logger['error'](_0xaeb6('0x12'),_0x953300,_0x49cf0e[_0xaeb6('0x10')][_0xaeb6('0x13')]);return _0x5bb3a9(_0x49cf0e[_0xaeb6('0x10')]['message']);}else{logger[_0xaeb6('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x953300,_0xaeb6('0xe'));_0x5bb3a9(_0x49cf0e[_0xaeb6('0x14')]['message']);}})[_0xaeb6('0x15')](function(_0x158642){logger['error'](_0xaeb6('0x12'),_0x953300,_0x158642);_0x27d84b(_0x158642);});});}
\ No newline at end of file
+var _0x34f8=['http','request','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x34f8,0x80));var _0x834f=function(_0x5e8b64,_0x3b0ad7){_0x5e8b64=_0x5e8b64-0x0;var _0x57cf34=_0x34f8[_0x5e8b64];return _0x57cf34;};'use strict';var _=require(_0x834f('0x0'));var util=require(_0x834f('0x1'));var moment=require(_0x834f('0x2'));var BPromise=require(_0x834f('0x3'));var rs=require(_0x834f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x834f('0x5'));var logger=require(_0x834f('0x6'))('rpc');var config=require(_0x834f('0x7'));var jayson=require(_0x834f('0x8'));var client=jayson[_0x834f('0x9')][_0x834f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5378c4,_0x4cd107,_0xf778e4){return new BPromise(function(_0x2597c6,_0x20b504){return client[_0x834f('0xb')](_0x5378c4,_0xf778e4)['then'](function(_0x4210cf){logger[_0x834f('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x4cd107,_0x834f('0xd'));logger[_0x834f('0xe')](_0x834f('0xf'),_0x4cd107,_0x834f('0xd'),JSON[_0x834f('0x10')](_0x4210cf));if(_0x4210cf[_0x834f('0x11')]){if(_0x4210cf[_0x834f('0x11')][_0x834f('0x12')]===0x1f4){logger['error'](_0x834f('0x13'),_0x4cd107,_0x4210cf[_0x834f('0x11')][_0x834f('0x14')]);return _0x20b504(_0x4210cf[_0x834f('0x11')][_0x834f('0x14')]);}logger['error'](_0x834f('0x13'),_0x4cd107,_0x4210cf[_0x834f('0x11')]['message']);return _0x2597c6(_0x4210cf[_0x834f('0x11')][_0x834f('0x14')]);}else{logger['info'](_0x834f('0x13'),_0x4cd107,'request\x20sent');_0x2597c6(_0x4210cf[_0x834f('0x15')][_0x834f('0x14')]);}})[_0x834f('0x16')](function(_0x248924){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x4cd107,_0x248924);_0x20b504(_0x248924);});});}
\ No newline at end of file
index 9b86be3..0dbca3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b4b=['./cmContactHasItem.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x34889b,_0x5b6d76){var _0x5289a6=function(_0xac841c){while(--_0xac841c){_0x34889b['push'](_0x34889b['shift']());}};_0x5289a6(++_0x5b6d76);}(_0x0b4b,0x174));var _0xb0b4=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x0b4b[_0x2ae2ad];return _0x26dbd7;};'use strict';var multer=require(_0xb0b4('0x0'));var util=require(_0xb0b4('0x1'));var path=require(_0xb0b4('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0b4('0x3'));var router=express[_0xb0b4('0x4')]();var auth=require(_0xb0b4('0x5'));var interaction=require(_0xb0b4('0x6'));var config=require(_0xb0b4('0x7'));var controller=require(_0xb0b4('0x8'));router[_0xb0b4('0x9')]('/',auth[_0xb0b4('0xa')](),controller[_0xb0b4('0xb')]);router[_0xb0b4('0x9')](_0xb0b4('0xc'),auth[_0xb0b4('0xa')](),controller['show']);router[_0xb0b4('0xd')]('/',auth['isAuthenticated'](),controller[_0xb0b4('0xe')]);router[_0xb0b4('0xf')](_0xb0b4('0xc'),auth[_0xb0b4('0xa')](),controller[_0xb0b4('0x10')]);router['delete'](_0xb0b4('0xc'),auth[_0xb0b4('0xa')](),controller[_0xb0b4('0x11')]);module[_0xb0b4('0x12')]=router;
\ No newline at end of file
+var _0x46ec=['/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index'];(function(_0x3bcc59,_0x194389){var _0x4f8f7e=function(_0x152ace){while(--_0x152ace){_0x3bcc59['push'](_0x3bcc59['shift']());}};_0x4f8f7e(++_0x194389);}(_0x46ec,0xa7));var _0xc46e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x46ec[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc46e('0x0'));var util=require(_0xc46e('0x1'));var path=require(_0xc46e('0x2'));var timeout=require(_0xc46e('0x3'));var express=require(_0xc46e('0x4'));var router=express[_0xc46e('0x5')]();var auth=require(_0xc46e('0x6'));var interaction=require(_0xc46e('0x7'));var config=require(_0xc46e('0x8'));var controller=require(_0xc46e('0x9'));router[_0xc46e('0xa')]('/',auth[_0xc46e('0xb')](),controller[_0xc46e('0xc')]);router[_0xc46e('0xa')](_0xc46e('0xd'),auth[_0xc46e('0xb')](),controller['show']);router[_0xc46e('0xe')]('/',auth[_0xc46e('0xb')](),controller['create']);router[_0xc46e('0xf')](_0xc46e('0xd'),auth[_0xc46e('0xb')](),controller[_0xc46e('0x10')]);router[_0xc46e('0x11')]('/:id',auth[_0xc46e('0xb')](),controller[_0xc46e('0x12')]);module[_0xc46e('0x13')]=router;
\ No newline at end of file
index afda530..76afd1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x418d=['INTEGER','sequelize'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x418d,0x1a9));var _0xd418=function(_0x5e4cfa,_0x374000){_0x5e4cfa=_0x5e4cfa-0x0;var _0x516c65=_0x418d[_0x5e4cfa];return _0x516c65;};'use strict';var Sequelize=require(_0xd418('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xd418('0x1')],'primaryKey':!![]},'phone':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]}};
\ No newline at end of file
+var _0x414b=['INTEGER','STRING','sequelize'];(function(_0x5171cf,_0x184464){var _0x3948b2=function(_0x80fcea){while(--_0x80fcea){_0x5171cf['push'](_0x5171cf['shift']());}};_0x3948b2(++_0x184464);}(_0x414b,0xb3));var _0xb414=function(_0x2014c9,_0x514a74){_0x2014c9=_0x2014c9-0x0;var _0x12a99a=_0x414b[_0x2014c9];return _0x12a99a;};'use strict';var Sequelize=require(_0xb414('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xb414('0x1')],'primaryKey':!![]},'phone':{'type':Sequelize[_0xb414('0x2')],'defaultValue':'','primaryKey':!![]}};
\ No newline at end of file
index 3400ba2..481e5c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86b6=['status','json','count','offset','apply','save','update','destroy','then','get','CmContactHasPhones','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','CmContactHasPhone','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0x86b6,0x86));var _0x686b=function(_0x10b986,_0x284bba){_0x10b986=_0x10b986-0x0;var _0x1c3e54=_0x86b6[_0x10b986];return _0x1c3e54;};'use strict';var pdf=require(_0x686b('0x0'));var emlformat=require(_0x686b('0x1'));var rimraf=require(_0x686b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x686b('0x3'));var rp=require(_0x686b('0x4'));var moment=require(_0x686b('0x5'));var BPromise=require(_0x686b('0x6'));var Mustache=require(_0x686b('0x7'));var util=require('util');var path=require(_0x686b('0x8'));var sox=require(_0x686b('0x9'));var csv=require('to-csv');var ejs=require(_0x686b('0xa'));var fs=require('fs');var _=require(_0x686b('0xb'));var squel=require(_0x686b('0xc'));var crypto=require(_0x686b('0xd'));var jsforce=require(_0x686b('0xe'));var deskjs=require(_0x686b('0xf'));var toCsv=require(_0x686b('0x10'));var querystring=require(_0x686b('0x11'));var Papa=require(_0x686b('0x12'));var Redis=require(_0x686b('0x13'));var authService=require(_0x686b('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x686b('0x15'));var logger=require('../../config/logger')(_0x686b('0x16'));var utils=require(_0x686b('0x17'));var config=require(_0x686b('0x18'));var db=require(_0x686b('0x19'))['db'];function respondWithStatusCode(_0x36ef09,_0x18ddda){_0x18ddda=_0x18ddda||0xcc;return function(_0x47bf3a){if(_0x47bf3a){return _0x36ef09[_0x686b('0x1a')](_0x18ddda);}return _0x36ef09['status'](_0x18ddda)[_0x686b('0x1b')]();};}function respondWithResult(_0x2942c4,_0x5b636f){_0x5b636f=_0x5b636f||0xc8;return function(_0x56eba9){if(_0x56eba9){return _0x2942c4[_0x686b('0x1c')](_0x5b636f)[_0x686b('0x1d')](_0x56eba9);}};}function respondWithFilteredResult(_0x2d1047,_0x49ec1b){return function(_0x160649){if(_0x160649){var _0x393e7f=_0x160649[_0x686b('0x1e')],_0x574a59=_0x49ec1b[_0x686b('0x1f')],_0x141cec=_0x49ec1b[_0x686b('0x1f')]+_0x49ec1b['limit'],_0x142065;if(_0x141cec>=_0x393e7f){_0x141cec=_0x393e7f;_0x142065=0xc8;}else{_0x142065=0xce;}_0x2d1047[_0x686b('0x1c')](_0x142065);return _0x2d1047['set']('Content-Range',_0x574a59+'-'+_0x141cec+'/'+_0x393e7f)[_0x686b('0x1d')](_0x160649);}return null;};}function patchUpdates(_0x3b8000){return function(_0x2a31f4){try{jsonpatch[_0x686b('0x20')](_0x2a31f4,_0x3b8000,!![]);}catch(_0x1e4293){return BPromise['reject'](_0x1e4293);}return _0x2a31f4[_0x686b('0x21')]();};}function saveUpdates(_0x30b3b4,_0x5a28f2){return function(_0x511541){if(_0x511541){return _0x511541[_0x686b('0x22')](_0x30b3b4)['then'](function(_0x2ed6ea){return _0x2ed6ea;});}return null;};}function removeEntity(_0x3b28d2,_0x5f5775){return function(_0x44c755){if(_0x44c755){return _0x44c755[_0x686b('0x23')]()[_0x686b('0x24')](function(){var _0x1cb39b=_0x44c755[_0x686b('0x25')]({'plain':!![]});var _0xbd9374=_0x686b('0x26');return db[_0x686b('0x27')][_0x686b('0x23')]({'where':{'type':_0xbd9374,'resourceId':_0x1cb39b['id']}})[_0x686b('0x24')](function(){return _0x44c755;});})['then'](function(){_0x3b28d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c1636,_0x433b1d){return function(_0x3cdffa){if(!_0x3cdffa){_0x5c1636[_0x686b('0x1a')](0x194);}return _0x3cdffa;};}function handleError(_0x3d178a,_0x3ba2ff){_0x3ba2ff=_0x3ba2ff||0x1f4;return function(_0x4d59d4){logger[_0x686b('0x28')](_0x4d59d4[_0x686b('0x29')]);if(_0x4d59d4[_0x686b('0x2a')]){delete _0x4d59d4['name'];}_0x3d178a[_0x686b('0x1c')](_0x3ba2ff)[_0x686b('0x2b')](_0x4d59d4);};}exports[_0x686b('0x2c')]=function(_0x2d0b1c,_0xf995fa){var _0x4f1ba3={},_0x38343d={},_0x247aff={'count':0x0,'rows':[]};var _0x491150=_['map'](db['CmContactHasPhone'][_0x686b('0x2d')],function(_0x50ba4c){return{'name':_0x50ba4c[_0x686b('0x2e')],'type':_0x50ba4c[_0x686b('0x2f')][_0x686b('0x30')]};});_0x38343d[_0x686b('0x31')]=_[_0x686b('0x32')](_0x491150,_0x686b('0x2a'));_0x38343d[_0x686b('0x33')]=_[_0x686b('0x34')](_0x2d0b1c[_0x686b('0x33')]);_0x38343d[_0x686b('0x35')]=_[_0x686b('0x36')](_0x38343d['model'],_0x38343d['query']);_0x4f1ba3['attributes']=_[_0x686b('0x36')](_0x38343d['model'],qs[_0x686b('0x37')](_0x2d0b1c[_0x686b('0x33')][_0x686b('0x37')]));_0x4f1ba3[_0x686b('0x38')]=_0x4f1ba3[_0x686b('0x38')]['length']?_0x4f1ba3[_0x686b('0x38')]:_0x38343d['model'];if(!_0x2d0b1c['query']['hasOwnProperty'](_0x686b('0x39'))){_0x4f1ba3[_0x686b('0x3a')]=qs['limit'](_0x2d0b1c['query'][_0x686b('0x3a')]);_0x4f1ba3[_0x686b('0x1f')]=qs[_0x686b('0x1f')](_0x2d0b1c[_0x686b('0x33')][_0x686b('0x1f')]);}_0x4f1ba3['order']=qs[_0x686b('0x3b')](_0x2d0b1c['query']['sort']);_0x4f1ba3[_0x686b('0x3c')]=qs[_0x686b('0x35')](_[_0x686b('0x3d')](_0x2d0b1c['query'],_0x38343d[_0x686b('0x35')]),_0x491150);if(_0x2d0b1c['query']['filter']){_0x4f1ba3[_0x686b('0x3c')]=_[_0x686b('0x3e')](_0x4f1ba3[_0x686b('0x3c')],{'$or':_[_0x686b('0x32')](_0x491150,function(_0x152ce8){if(_0x152ce8[_0x686b('0x2f')]!==_0x686b('0x3f')){var _0x520495={};_0x520495[_0x152ce8['name']]={'$like':'%'+_0x2d0b1c[_0x686b('0x33')][_0x686b('0x40')]+'%'};return _0x520495;}})});}_0x4f1ba3=_[_0x686b('0x3e')]({},_0x4f1ba3,_0x2d0b1c[_0x686b('0x41')]);var _0x15ccf1={'where':_0x4f1ba3[_0x686b('0x3c')]};return db['CmContactHasPhone']['count'](_0x15ccf1)[_0x686b('0x24')](function(_0x2945c3){_0x247aff[_0x686b('0x1e')]=_0x2945c3;if(_0x2d0b1c['query'][_0x686b('0x42')]){_0x4f1ba3[_0x686b('0x43')]=[{'all':!![]}];}return db['CmContactHasPhone'][_0x686b('0x44')](_0x4f1ba3);})['then'](function(_0x1e0411){_0x247aff['rows']=_0x1e0411;return _0x247aff;})[_0x686b('0x24')](respondWithFilteredResult(_0xf995fa,_0x4f1ba3))[_0x686b('0x45')](handleError(_0xf995fa,null));};exports[_0x686b('0x46')]=function(_0x3e08b4,_0x278169){var _0x48f4f8={'raw':!![],'where':{'id':_0x3e08b4['params']['id']}},_0x39e452={};_0x39e452[_0x686b('0x31')]=_['keys'](db[_0x686b('0x47')][_0x686b('0x2d')]);_0x39e452[_0x686b('0x33')]=_[_0x686b('0x34')](_0x3e08b4[_0x686b('0x33')]);_0x39e452['filters']=_[_0x686b('0x36')](_0x39e452['model'],_0x39e452[_0x686b('0x33')]);_0x48f4f8[_0x686b('0x38')]=_[_0x686b('0x36')](_0x39e452[_0x686b('0x31')],qs['fields'](_0x3e08b4[_0x686b('0x33')][_0x686b('0x37')]));_0x48f4f8[_0x686b('0x38')]=_0x48f4f8[_0x686b('0x38')][_0x686b('0x48')]?_0x48f4f8['attributes']:_0x39e452[_0x686b('0x31')];if(_0x3e08b4[_0x686b('0x33')][_0x686b('0x42')]){_0x48f4f8[_0x686b('0x43')]=[{'all':!![]}];}_0x48f4f8=_[_0x686b('0x3e')]({},_0x48f4f8,_0x3e08b4[_0x686b('0x41')]);return db[_0x686b('0x47')]['find'](_0x48f4f8)[_0x686b('0x24')](handleEntityNotFound(_0x278169,null))['then'](respondWithResult(_0x278169,null))['catch'](handleError(_0x278169,null));};exports['create']=function(_0x255272,_0x39e080){return db[_0x686b('0x47')][_0x686b('0x49')](_0x255272[_0x686b('0x4a')],{})[_0x686b('0x24')](function(_0x294272){var _0x3114a1=_0x255272['user']['get']({'plain':!![]});if(!_0x3114a1)throw new Error(_0x686b('0x4b'));if(_0x3114a1['role']===_0x686b('0x4c')){var _0x422b03=_0x294272[_0x686b('0x25')]({'plain':!![]});var _0x3ceea6=_0x686b('0x26');return db[_0x686b('0x4d')][_0x686b('0x4e')]({'where':{'name':_0x3ceea6,'userProfileId':_0x3114a1[_0x686b('0x4f')]},'raw':!![]})[_0x686b('0x24')](function(_0x1ffaeb){if(_0x1ffaeb&&_0x1ffaeb[_0x686b('0x50')]===0x0){return db[_0x686b('0x27')]['create']({'name':_0x422b03[_0x686b('0x2a')],'resourceId':_0x422b03['id'],'type':_0x1ffaeb['name'],'sectionId':_0x1ffaeb['id']},{})[_0x686b('0x24')](function(){return _0x294272;});}else{return _0x294272;}})[_0x686b('0x45')](function(_0x452590){logger[_0x686b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x452590);throw _0x452590;});}return _0x294272;})[_0x686b('0x24')](respondWithResult(_0x39e080,0xc9))[_0x686b('0x45')](handleError(_0x39e080,null));};exports['update']=function(_0x1241c2,_0x5bc753){if(_0x1241c2[_0x686b('0x4a')]['id']){delete _0x1241c2[_0x686b('0x4a')]['id'];}return db[_0x686b('0x47')][_0x686b('0x4e')]({'where':{'id':_0x1241c2['params']['id']}})[_0x686b('0x24')](handleEntityNotFound(_0x5bc753,null))['then'](saveUpdates(_0x1241c2[_0x686b('0x4a')],null))[_0x686b('0x24')](respondWithResult(_0x5bc753,null))[_0x686b('0x45')](handleError(_0x5bc753,null));};exports[_0x686b('0x23')]=function(_0x497a74,_0x5b6baa){return db[_0x686b('0x47')][_0x686b('0x4e')]({'where':{'id':_0x497a74['params']['id']}})['then'](handleEntityNotFound(_0x5b6baa,null))[_0x686b('0x24')](removeEntity(_0x5b6baa,null))['catch'](handleError(_0x5b6baa,null));};
\ No newline at end of file
+var _0x19ff=['send','map','CmContactHasPhone','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','params','catch','create','body','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','CmContactHasPhones','UserProfileResource','stack','name'];(function(_0x52f07c,_0x4edc1b){var _0x247115=function(_0x400d27){while(--_0x400d27){_0x52f07c['push'](_0x52f07c['shift']());}};_0x247115(++_0x4edc1b);}(_0x19ff,0x146));var _0xf19f=function(_0x3981c6,_0x5bb2d2){_0x3981c6=_0x3981c6-0x0;var _0x11baee=_0x19ff[_0x3981c6];return _0x11baee;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf19f('0x0'));var zipdir=require(_0xf19f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf19f('0x2'));var BPromise=require(_0xf19f('0x3'));var Mustache=require(_0xf19f('0x4'));var util=require(_0xf19f('0x5'));var path=require(_0xf19f('0x6'));var sox=require(_0xf19f('0x7'));var csv=require('to-csv');var ejs=require(_0xf19f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf19f('0x9'));var crypto=require(_0xf19f('0xa'));var jsforce=require(_0xf19f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf19f('0xc'));var querystring=require(_0xf19f('0xd'));var Papa=require(_0xf19f('0xe'));var Redis=require(_0xf19f('0xf'));var authService=require(_0xf19f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf19f('0x11'));var hardwareService=require(_0xf19f('0x12'));var logger=require('../../config/logger')(_0xf19f('0x13'));var utils=require(_0xf19f('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4616a4,_0x58995b){_0x58995b=_0x58995b||0xcc;return function(_0x178b78){if(_0x178b78){return _0x4616a4[_0xf19f('0x15')](_0x58995b);}return _0x4616a4[_0xf19f('0x16')](_0x58995b)[_0xf19f('0x17')]();};}function respondWithResult(_0x12a9d7,_0x4da182){_0x4da182=_0x4da182||0xc8;return function(_0x4e4cef){if(_0x4e4cef){return _0x12a9d7[_0xf19f('0x16')](_0x4da182)[_0xf19f('0x18')](_0x4e4cef);}};}function respondWithFilteredResult(_0x5c822e,_0x36c4c3){return function(_0x43efc2){if(_0x43efc2){var _0x1a2210=_0x43efc2[_0xf19f('0x19')],_0xbc6ed5=_0x36c4c3[_0xf19f('0x1a')],_0x1b1e97=_0x36c4c3[_0xf19f('0x1a')]+_0x36c4c3['limit'],_0x2ed9da;if(_0x1b1e97>=_0x1a2210){_0x1b1e97=_0x1a2210;_0x2ed9da=0xc8;}else{_0x2ed9da=0xce;}_0x5c822e['status'](_0x2ed9da);return _0x5c822e[_0xf19f('0x1b')](_0xf19f('0x1c'),_0xbc6ed5+'-'+_0x1b1e97+'/'+_0x1a2210)[_0xf19f('0x18')](_0x43efc2);}return null;};}function patchUpdates(_0x5dc5a1){return function(_0x25e6f1){try{jsonpatch[_0xf19f('0x1d')](_0x25e6f1,_0x5dc5a1,!![]);}catch(_0x1c67b4){return BPromise[_0xf19f('0x1e')](_0x1c67b4);}return _0x25e6f1['save']();};}function saveUpdates(_0x4d93ea,_0x5b599d){return function(_0xf45146){if(_0xf45146){return _0xf45146[_0xf19f('0x1f')](_0x4d93ea)[_0xf19f('0x20')](function(_0x1491ca){return _0x1491ca;});}return null;};}function removeEntity(_0xd5183d,_0x2a78dd){return function(_0x37f253){if(_0x37f253){return _0x37f253[_0xf19f('0x21')]()['then'](function(){var _0x4ab406=_0x37f253[_0xf19f('0x22')]({'plain':!![]});var _0x4f4a2c=_0xf19f('0x23');return db[_0xf19f('0x24')]['destroy']({'where':{'type':_0x4f4a2c,'resourceId':_0x4ab406['id']}})[_0xf19f('0x20')](function(){return _0x37f253;});})[_0xf19f('0x20')](function(){_0xd5183d['status'](0xcc)[_0xf19f('0x17')]();});}};}function handleEntityNotFound(_0x74c197,_0x5a8130){return function(_0x3a5d90){if(!_0x3a5d90){_0x74c197[_0xf19f('0x15')](0x194);}return _0x3a5d90;};}function handleError(_0x5be289,_0x22eeb5){_0x22eeb5=_0x22eeb5||0x1f4;return function(_0x4bc843){logger['error'](_0x4bc843[_0xf19f('0x25')]);if(_0x4bc843[_0xf19f('0x26')]){delete _0x4bc843[_0xf19f('0x26')];}_0x5be289[_0xf19f('0x16')](_0x22eeb5)[_0xf19f('0x27')](_0x4bc843);};}exports['index']=function(_0x6879d1,_0x5657aa){var _0x5c5ae9={},_0x4ad0b8={},_0x53fea2={'count':0x0,'rows':[]};var _0x5d206c=_[_0xf19f('0x28')](db[_0xf19f('0x29')][_0xf19f('0x2a')],function(_0x5633c1){return{'name':_0x5633c1[_0xf19f('0x2b')],'type':_0x5633c1[_0xf19f('0x2c')]['key']};});_0x4ad0b8[_0xf19f('0x2d')]=_[_0xf19f('0x28')](_0x5d206c,_0xf19f('0x26'));_0x4ad0b8[_0xf19f('0x2e')]=_[_0xf19f('0x2f')](_0x6879d1[_0xf19f('0x2e')]);_0x4ad0b8[_0xf19f('0x30')]=_[_0xf19f('0x31')](_0x4ad0b8['model'],_0x4ad0b8[_0xf19f('0x2e')]);_0x5c5ae9['attributes']=_[_0xf19f('0x31')](_0x4ad0b8[_0xf19f('0x2d')],qs['fields'](_0x6879d1['query'][_0xf19f('0x32')]));_0x5c5ae9[_0xf19f('0x33')]=_0x5c5ae9[_0xf19f('0x33')]['length']?_0x5c5ae9[_0xf19f('0x33')]:_0x4ad0b8[_0xf19f('0x2d')];if(!_0x6879d1[_0xf19f('0x2e')][_0xf19f('0x34')]('nolimit')){_0x5c5ae9[_0xf19f('0x35')]=qs[_0xf19f('0x35')](_0x6879d1['query']['limit']);_0x5c5ae9[_0xf19f('0x1a')]=qs['offset'](_0x6879d1['query'][_0xf19f('0x1a')]);}_0x5c5ae9[_0xf19f('0x36')]=qs[_0xf19f('0x37')](_0x6879d1[_0xf19f('0x2e')][_0xf19f('0x37')]);_0x5c5ae9[_0xf19f('0x38')]=qs[_0xf19f('0x30')](_[_0xf19f('0x39')](_0x6879d1[_0xf19f('0x2e')],_0x4ad0b8[_0xf19f('0x30')]),_0x5d206c);if(_0x6879d1[_0xf19f('0x2e')][_0xf19f('0x3a')]){_0x5c5ae9[_0xf19f('0x38')]=_[_0xf19f('0x3b')](_0x5c5ae9[_0xf19f('0x38')],{'$or':_[_0xf19f('0x28')](_0x5d206c,function(_0x164097){if(_0x164097[_0xf19f('0x2c')]!==_0xf19f('0x3c')){var _0xeda9c9={};_0xeda9c9[_0x164097['name']]={'$like':'%'+_0x6879d1['query'][_0xf19f('0x3a')]+'%'};return _0xeda9c9;}})});}_0x5c5ae9=_[_0xf19f('0x3b')]({},_0x5c5ae9,_0x6879d1['options']);var _0x53a91e={'where':_0x5c5ae9[_0xf19f('0x38')]};return db[_0xf19f('0x29')][_0xf19f('0x19')](_0x53a91e)[_0xf19f('0x20')](function(_0x19a323){_0x53fea2[_0xf19f('0x19')]=_0x19a323;if(_0x6879d1[_0xf19f('0x2e')][_0xf19f('0x3d')]){_0x5c5ae9[_0xf19f('0x3e')]=[{'all':!![]}];}return db['CmContactHasPhone']['findAll'](_0x5c5ae9);})[_0xf19f('0x20')](function(_0x5155c6){_0x53fea2[_0xf19f('0x3f')]=_0x5155c6;return _0x53fea2;})[_0xf19f('0x20')](respondWithFilteredResult(_0x5657aa,_0x5c5ae9))['catch'](handleError(_0x5657aa,null));};exports['show']=function(_0x373de1,_0x570d4a){var _0x2feaab={'raw':!![],'where':{'id':_0x373de1[_0xf19f('0x40')]['id']}},_0x2da9af={};_0x2da9af['model']=_[_0xf19f('0x2f')](db[_0xf19f('0x29')][_0xf19f('0x2a')]);_0x2da9af[_0xf19f('0x2e')]=_[_0xf19f('0x2f')](_0x373de1[_0xf19f('0x2e')]);_0x2da9af['filters']=_[_0xf19f('0x31')](_0x2da9af['model'],_0x2da9af[_0xf19f('0x2e')]);_0x2feaab[_0xf19f('0x33')]=_['intersection'](_0x2da9af[_0xf19f('0x2d')],qs[_0xf19f('0x32')](_0x373de1['query'][_0xf19f('0x32')]));_0x2feaab[_0xf19f('0x33')]=_0x2feaab[_0xf19f('0x33')]['length']?_0x2feaab[_0xf19f('0x33')]:_0x2da9af[_0xf19f('0x2d')];if(_0x373de1[_0xf19f('0x2e')][_0xf19f('0x3d')]){_0x2feaab[_0xf19f('0x3e')]=[{'all':!![]}];}_0x2feaab=_['merge']({},_0x2feaab,_0x373de1['options']);return db[_0xf19f('0x29')]['find'](_0x2feaab)[_0xf19f('0x20')](handleEntityNotFound(_0x570d4a,null))[_0xf19f('0x20')](respondWithResult(_0x570d4a,null))[_0xf19f('0x41')](handleError(_0x570d4a,null));};exports[_0xf19f('0x42')]=function(_0x2bfc1b,_0x1c09a4){return db[_0xf19f('0x29')][_0xf19f('0x42')](_0x2bfc1b[_0xf19f('0x43')],{})[_0xf19f('0x20')](function(_0xec0740){var _0x513bdd=_0x2bfc1b[_0xf19f('0x44')][_0xf19f('0x22')]({'plain':!![]});if(!_0x513bdd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x513bdd['role']===_0xf19f('0x44')){var _0x32cb26=_0xec0740['get']({'plain':!![]});var _0x2f46c3=_0xf19f('0x23');return db[_0xf19f('0x45')][_0xf19f('0x46')]({'where':{'name':_0x2f46c3,'userProfileId':_0x513bdd['userProfileId']},'raw':!![]})['then'](function(_0x328b5a){if(_0x328b5a&&_0x328b5a[_0xf19f('0x47')]===0x0){return db[_0xf19f('0x24')]['create']({'name':_0x32cb26[_0xf19f('0x26')],'resourceId':_0x32cb26['id'],'type':_0x328b5a[_0xf19f('0x26')],'sectionId':_0x328b5a['id']},{})['then'](function(){return _0xec0740;});}else{return _0xec0740;}})[_0xf19f('0x41')](function(_0x2827f5){logger['error'](_0xf19f('0x48'),_0x2827f5);throw _0x2827f5;});}return _0xec0740;})[_0xf19f('0x20')](respondWithResult(_0x1c09a4,0xc9))[_0xf19f('0x41')](handleError(_0x1c09a4,null));};exports[_0xf19f('0x1f')]=function(_0xd1af9e,_0x2ed0f8){if(_0xd1af9e[_0xf19f('0x43')]['id']){delete _0xd1af9e[_0xf19f('0x43')]['id'];}return db[_0xf19f('0x29')]['find']({'where':{'id':_0xd1af9e[_0xf19f('0x40')]['id']}})[_0xf19f('0x20')](handleEntityNotFound(_0x2ed0f8,null))[_0xf19f('0x20')](saveUpdates(_0xd1af9e[_0xf19f('0x43')],null))[_0xf19f('0x20')](respondWithResult(_0x2ed0f8,null))[_0xf19f('0x41')](handleError(_0x2ed0f8,null));};exports[_0xf19f('0x21')]=function(_0x3bc1f8,_0x373f42){return db[_0xf19f('0x29')][_0xf19f('0x46')]({'where':{'id':_0x3bc1f8[_0xf19f('0x40')]['id']}})[_0xf19f('0x20')](handleEntityNotFound(_0x373f42,null))[_0xf19f('0x20')](removeEntity(_0x373f42,null))[_0xf19f('0x41')](handleError(_0x373f42,null));};
\ No newline at end of file
index e7e24e8..8d83fce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3617=['../../config/environment','./cmContactHasPhone.attributes','exports','define','cm_contact_has_phones','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5204f9,_0x1c6b99){var _0x5b29b1=function(_0x1af220){while(--_0x1af220){_0x5204f9['push'](_0x5204f9['shift']());}};_0x5b29b1(++_0x1c6b99);}(_0x3617,0xec));var _0x7361=function(_0x4fb1da,_0x2a7935){_0x4fb1da=_0x4fb1da-0x0;var _0x2970f8=_0x3617[_0x4fb1da];return _0x2970f8;};'use strict';var _=require(_0x7361('0x0'));var util=require(_0x7361('0x1'));var logger=require(_0x7361('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7361('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7361('0x4'));var rimraf=require(_0x7361('0x5'));var config=require(_0x7361('0x6'));var attributes=require(_0x7361('0x7'));module[_0x7361('0x8')]=function(_0x5de3a6,_0x414815){return _0x5de3a6[_0x7361('0x9')]('CmContactHasPhone',attributes,{'tableName':_0x7361('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb19f=['bluebird','request-promise','rimraf','./cmContactHasPhone.attributes','CmContactHasPhone','lodash','util','moment'];(function(_0x5deb8b,_0x1f4125){var _0x208e3a=function(_0x515691){while(--_0x515691){_0x5deb8b['push'](_0x5deb8b['shift']());}};_0x208e3a(++_0x1f4125);}(_0xb19f,0x7d));var _0xfb19=function(_0x4c03ae,_0x5856b0){_0x4c03ae=_0x4c03ae-0x0;var _0x1acaab=_0xb19f[_0x4c03ae];return _0x1acaab;};'use strict';var _=require(_0xfb19('0x0'));var util=require(_0xfb19('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfb19('0x2'));var BPromise=require(_0xfb19('0x3'));var rp=require(_0xfb19('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb19('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb19('0x6'));module['exports']=function(_0x364587,_0x3de38c){return _0x364587['define'](_0xfb19('0x7'),attributes,{'tableName':'cm_contact_has_phones','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 773e1ed..66e6897 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96e1=['CmContactHasPhone,\x20%s,\x20%s','request\x20sent','debug','error','message','result','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x39f15c,_0x4e4da2){var _0xe7e43c=function(_0x3e7292){while(--_0x3e7292){_0x39f15c['push'](_0x39f15c['shift']());}};_0xe7e43c(++_0x4e4da2);}(_0x96e1,0x186));var _0x196e=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x96e1[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x196e('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x196e('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x196e('0x2'));var logger=require(_0x196e('0x3'))(_0x196e('0x4'));var config=require(_0x196e('0x5'));var jayson=require(_0x196e('0x6'));var client=jayson[_0x196e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ef8c9,_0x541561,_0x43664c){return new BPromise(function(_0x5c3c1e,_0x40496e){return client[_0x196e('0x8')](_0x5ef8c9,_0x43664c)['then'](function(_0xc61562){logger[_0x196e('0x9')](_0x196e('0xa'),_0x541561,_0x196e('0xb'));logger[_0x196e('0xc')]('CmContactHasPhone,\x20%s,\x20%s,\x20%s',_0x541561,_0x196e('0xb'),JSON['stringify'](_0xc61562));if(_0xc61562['error']){if(_0xc61562[_0x196e('0xd')]['code']===0x1f4){logger['error']('CmContactHasPhone,\x20%s,\x20%s',_0x541561,_0xc61562['error']['message']);return _0x40496e(_0xc61562[_0x196e('0xd')][_0x196e('0xe')]);}logger[_0x196e('0xd')](_0x196e('0xa'),_0x541561,_0xc61562[_0x196e('0xd')][_0x196e('0xe')]);return _0x5c3c1e(_0xc61562[_0x196e('0xd')][_0x196e('0xe')]);}else{logger['info']('CmContactHasPhone,\x20%s,\x20%s',_0x541561,_0x196e('0xb'));_0x5c3c1e(_0xc61562[_0x196e('0xf')][_0x196e('0xe')]);}})['catch'](function(_0x393c9f){logger[_0x196e('0xd')]('CmContactHasPhone,\x20%s,\x20%s',_0x541561,_0x393c9f);_0x40496e(_0x393c9f);});});}
\ No newline at end of file
+var _0xf0ea=['util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','CmContactHasPhone,\x20%s,\x20%s','request\x20sent','debug','CmContactHasPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2f85dd,_0x4a4fa4){var _0x1520f6=function(_0x1c214d){while(--_0x1c214d){_0x2f85dd['push'](_0x2f85dd['shift']());}};_0x1520f6(++_0x4a4fa4);}(_0xf0ea,0x10e));var _0xaf0e=function(_0x194b25,_0x4bedc4){_0x194b25=_0x194b25-0x0;var _0x107ac5=_0xf0ea[_0x194b25];return _0x107ac5;};'use strict';var _=require('lodash');var util=require(_0xaf0e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf0e('0x1'));var db=require(_0xaf0e('0x2'))['db'];var utils=require(_0xaf0e('0x3'));var logger=require(_0xaf0e('0x4'))('rpc');var config=require(_0xaf0e('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xaf0e('0x6')][_0xaf0e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3ba80b,_0x586fb0,_0x1b53d2){return new BPromise(function(_0x54ec87,_0x5d1235){return client['request'](_0x3ba80b,_0x1b53d2)[_0xaf0e('0x8')](function(_0x122fd5){logger[_0xaf0e('0x9')](_0xaf0e('0xa'),_0x586fb0,_0xaf0e('0xb'));logger[_0xaf0e('0xc')](_0xaf0e('0xd'),_0x586fb0,_0xaf0e('0xb'),JSON[_0xaf0e('0xe')](_0x122fd5));if(_0x122fd5[_0xaf0e('0xf')]){if(_0x122fd5['error'][_0xaf0e('0x10')]===0x1f4){logger[_0xaf0e('0xf')](_0xaf0e('0xa'),_0x586fb0,_0x122fd5[_0xaf0e('0xf')]['message']);return _0x5d1235(_0x122fd5[_0xaf0e('0xf')][_0xaf0e('0x11')]);}logger['error']('CmContactHasPhone,\x20%s,\x20%s',_0x586fb0,_0x122fd5[_0xaf0e('0xf')][_0xaf0e('0x11')]);return _0x54ec87(_0x122fd5['error'][_0xaf0e('0x11')]);}else{logger[_0xaf0e('0x9')](_0xaf0e('0xa'),_0x586fb0,_0xaf0e('0xb'));_0x54ec87(_0x122fd5['result']['message']);}})['catch'](function(_0xc43c35){logger[_0xaf0e('0xf')](_0xaf0e('0xa'),_0x586fb0,_0xc43c35);_0x5d1235(_0xc43c35);});});}
\ No newline at end of file
index afbd026..8798956 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea08=['get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x13b70f,_0x5c1116){var _0x51427c=function(_0x54bb0b){while(--_0x54bb0b){_0x13b70f['push'](_0x13b70f['shift']());}};_0x51427c(++_0x5c1116);}(_0xea08,0x1bd));var _0x8ea0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xea08[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x8ea0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8ea0('0x1'));var express=require(_0x8ea0('0x2'));var router=express['Router']();var auth=require(_0x8ea0('0x3'));var interaction=require(_0x8ea0('0x4'));var config=require('../../config/environment');var controller=require('./cmContactHasPhone.controller');router[_0x8ea0('0x5')]('/',auth[_0x8ea0('0x6')](),controller['index']);router[_0x8ea0('0x5')](_0x8ea0('0x7'),auth[_0x8ea0('0x6')](),controller[_0x8ea0('0x8')]);router[_0x8ea0('0x9')]('/',auth[_0x8ea0('0x6')](),controller['create']);router[_0x8ea0('0xa')](_0x8ea0('0x7'),auth[_0x8ea0('0x6')](),controller[_0x8ea0('0xb')]);router[_0x8ea0('0xc')](_0x8ea0('0x7'),auth[_0x8ea0('0x6')](),controller[_0x8ea0('0xd')]);module[_0x8ea0('0xe')]=router;
\ No newline at end of file
+var _0xda0d=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasPhone.controller','get','index','isAuthenticated','post','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4d4dee,_0x524074){var _0xae3525=function(_0x332e3f){while(--_0x332e3f){_0x4d4dee['push'](_0x4d4dee['shift']());}};_0xae3525(++_0x524074);}(_0xda0d,0x6e));var _0xdda0=function(_0x15125d,_0x23c475){_0x15125d=_0x15125d-0x0;var _0x223d94=_0xda0d[_0x15125d];return _0x223d94;};'use strict';var multer=require(_0xdda0('0x0'));var util=require('util');var path=require(_0xdda0('0x1'));var timeout=require(_0xdda0('0x2'));var express=require(_0xdda0('0x3'));var router=express[_0xdda0('0x4')]();var auth=require(_0xdda0('0x5'));var interaction=require(_0xdda0('0x6'));var config=require(_0xdda0('0x7'));var controller=require(_0xdda0('0x8'));router[_0xdda0('0x9')]('/',auth['isAuthenticated'](),controller[_0xdda0('0xa')]);router[_0xdda0('0x9')]('/:id',auth[_0xdda0('0xb')](),controller['show']);router[_0xdda0('0xc')]('/',auth[_0xdda0('0xb')](),controller[_0xdda0('0xd')]);router[_0xdda0('0xe')](_0xdda0('0xf'),auth[_0xdda0('0xb')](),controller['update']);router[_0xdda0('0x10')](_0xdda0('0xf'),auth[_0xdda0('0xb')](),controller[_0xdda0('0x11')]);module[_0xdda0('0x12')]=router;
\ No newline at end of file
index 9c0a1bd..e928391 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x278c=['sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','name','TEXT','type','values','isArray','setDataValue','stringify'];(function(_0x24e2a3,_0x534875){var _0x3e82f4=function(_0x48a8ee){while(--_0x48a8ee){_0x24e2a3['push'](_0x24e2a3['shift']());}};_0x3e82f4(++_0x534875);}(_0x278c,0x1b2));var _0xc278=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0x278c[_0x1bf809];return _0x1caa4e;};'use strict';var Sequelize=require(_0xc278('0x0'));var _=require(_0xc278('0x1'));module[_0xc278('0x2')]={'name':{'type':Sequelize[_0xc278('0x3')],'get':function(_0x344514){return this[_0xc278('0x4')](_0xc278('0x5'));}},'alias':{'type':Sequelize[_0xc278('0x6')],'allowNull':![],'set':function(_0x4524b3){this['setDataValue'](_0xc278('0x5'),_0x4524b3?_0x4524b3:this[_0xc278('0x4')](_0xc278('0x7')));}},'type':{'type':Sequelize[_0xc278('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xc278('0x8')]('long'),'get':function(){if(this[_0xc278('0x4')](_0xc278('0x9'))==='select'){return JSON['parse'](this[_0xc278('0x4')](_0xc278('0xa')));}else{return this[_0xc278('0x4')](_0xc278('0xa'));}},'set':function(_0xe91216){if(Array[_0xc278('0xb')](_0xe91216)){this[_0xc278('0xc')](_0xc278('0xa'),JSON[_0xc278('0xd')](_0xe91216));}else{this[_0xc278('0xc')]('values',_0xe91216);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xa6ab=['sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','name','TEXT','select','parse','getDataValue','values','stringify','BOOLEAN'];(function(_0x2fb20d,_0x3af40c){var _0x500c23=function(_0x1ae1b1){while(--_0x1ae1b1){_0x2fb20d['push'](_0x2fb20d['shift']());}};_0x500c23(++_0x3af40c);}(_0xa6ab,0xb4));var _0xba6a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa6ab[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xba6a('0x0'));var _=require(_0xba6a('0x1'));module[_0xba6a('0x2')]={'name':{'type':Sequelize[_0xba6a('0x3')],'get':function(_0x47000d){return this['getDataValue'](_0xba6a('0x4'));}},'alias':{'type':Sequelize[_0xba6a('0x5')],'allowNull':![],'set':function(_0x434c2e){this[_0xba6a('0x6')](_0xba6a('0x4'),_0x434c2e?_0x434c2e:this['getDataValue'](_0xba6a('0x7')));}},'type':{'type':Sequelize[_0xba6a('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xba6a('0x8')]('long'),'get':function(){if(this['getDataValue']('type')===_0xba6a('0x9')){return JSON[_0xba6a('0xa')](this[_0xba6a('0xb')](_0xba6a('0xc')));}else{return this[_0xba6a('0xb')](_0xba6a('0xc'));}},'set':function(_0x3102f9){if(Array['isArray'](_0x3102f9)){this[_0xba6a('0x6')](_0xba6a('0xc'),JSON[_0xba6a('0xd')](_0x3102f9));}else{this[_0xba6a('0x6')](_0xba6a('0xc'),_0x3102f9);}}},'required':{'type':Sequelize[_0xba6a('0xe')],'defaultValue':![]}};
\ No newline at end of file
index 9073dd1..c5aafcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cde=['queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','sendStatus','error','stack','name','index','map','CmCustomField','rawAttributes','type','model','differenceBy','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','rows','show','params','length','includeAll','include','find','catch','body','destroy','transaction','create','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x9cde,0x1c7));var _0xe9cd=function(_0x426711,_0x12264c){_0x426711=_0x426711-0x0;var _0x592991=_0x9cde[_0x426711];return _0x592991;};'use strict';var pdf=require(_0xe9cd('0x0'));var emlformat=require(_0xe9cd('0x1'));var rimraf=require(_0xe9cd('0x2'));var zipdir=require(_0xe9cd('0x3'));var jsonpatch=require(_0xe9cd('0x4'));var rp=require(_0xe9cd('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe9cd('0x6'));var path=require(_0xe9cd('0x7'));var sox=require('sox');var csv=require(_0xe9cd('0x8'));var ejs=require(_0xe9cd('0x9'));var fs=require('fs');var _=require(_0xe9cd('0xa'));var squel=require(_0xe9cd('0xb'));var crypto=require('crypto');var jsforce=require(_0xe9cd('0xc'));var deskjs=require(_0xe9cd('0xd'));var toCsv=require(_0xe9cd('0x8'));var querystring=require(_0xe9cd('0xe'));var Papa=require(_0xe9cd('0xf'));var Redis=require(_0xe9cd('0x10'));var authService=require(_0xe9cd('0x11'));var qs=require(_0xe9cd('0x12'));var as=require(_0xe9cd('0x13'));var hardwareService=require(_0xe9cd('0x14'));var logger=require(_0xe9cd('0x15'))(_0xe9cd('0x16'));var utils=require(_0xe9cd('0x17'));var config=require('../../config/environment');var db=require(_0xe9cd('0x18'))['db'];function respondWithStatusCode(_0x43fb12,_0x213c93){_0x213c93=_0x213c93||0xcc;return function(_0x4ac7e6){if(_0x4ac7e6){return _0x43fb12['sendStatus'](_0x213c93);}return _0x43fb12['status'](_0x213c93)[_0xe9cd('0x19')]();};}function respondWithResult(_0x19b9bc,_0x201f0d){_0x201f0d=_0x201f0d||0xc8;return function(_0x14fa92){if(_0x14fa92){return _0x19b9bc[_0xe9cd('0x1a')](_0x201f0d)['json'](_0x14fa92);}};}function respondWithFilteredResult(_0x4efaee,_0x376496){return function(_0x3e05ca){if(_0x3e05ca){var _0x2f0b46=_0x3e05ca[_0xe9cd('0x1b')],_0x80f91c=_0x376496[_0xe9cd('0x1c')],_0x3519f2=_0x376496['offset']+_0x376496[_0xe9cd('0x1d')],_0x16667d;if(_0x3519f2>=_0x2f0b46){_0x3519f2=_0x2f0b46;_0x16667d=0xc8;}else{_0x16667d=0xce;}_0x4efaee[_0xe9cd('0x1a')](_0x16667d);return _0x4efaee[_0xe9cd('0x1e')](_0xe9cd('0x1f'),_0x80f91c+'-'+_0x3519f2+'/'+_0x2f0b46)[_0xe9cd('0x20')](_0x3e05ca);}return null;};}function patchUpdates(_0x23700b){return function(_0x1c05e8){try{jsonpatch['apply'](_0x1c05e8,_0x23700b,!![]);}catch(_0xce93bb){return BPromise[_0xe9cd('0x21')](_0xce93bb);}return _0x1c05e8[_0xe9cd('0x22')]();};}function saveUpdates(_0xe18c8a,_0x5a9b2b){return function(_0x3687a8){if(_0x3687a8){return _0x3687a8[_0xe9cd('0x23')](_0xe18c8a)[_0xe9cd('0x24')](function(_0x396358){return _0x396358;});}return null;};}function removeEntity(_0x56db7c,_0x38e337){return function(_0x423312){if(_0x423312){return _0x423312['destroy']()[_0xe9cd('0x24')](function(){_0x56db7c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ce805,_0x3c8b5f){return function(_0x3fecde){if(!_0x3fecde){_0x1ce805[_0xe9cd('0x25')](0x194);}return _0x3fecde;};}function handleError(_0x74e515,_0x9dd144){_0x9dd144=_0x9dd144||0x1f4;return function(_0x7b53ca){logger[_0xe9cd('0x26')](_0x7b53ca[_0xe9cd('0x27')]);if(_0x7b53ca[_0xe9cd('0x28')]){delete _0x7b53ca[_0xe9cd('0x28')];}_0x74e515[_0xe9cd('0x1a')](_0x9dd144)['send'](_0x7b53ca);};}exports[_0xe9cd('0x29')]=function(_0x2bb07d,_0x4271ea){var _0x389139={},_0x44616b={},_0xe6db58={'count':0x0,'rows':[]};var _0x336ccf=_[_0xe9cd('0x2a')](db[_0xe9cd('0x2b')][_0xe9cd('0x2c')],function(_0x350500){return{'name':_0x350500['fieldName'],'type':_0x350500[_0xe9cd('0x2d')]['key']};});_0x44616b[_0xe9cd('0x2e')]=_[_0xe9cd('0x2f')](_[_0xe9cd('0x2a')](_0x336ccf,_0xe9cd('0x28')),[_0xe9cd('0x28')]);_0x44616b[_0xe9cd('0x30')]=_[_0xe9cd('0x31')](_0x2bb07d[_0xe9cd('0x30')]);_0x44616b['filters']=_['intersection'](_0x44616b[_0xe9cd('0x2e')],_0x44616b[_0xe9cd('0x30')]);_0x389139[_0xe9cd('0x32')]=_[_0xe9cd('0x33')](_0x44616b[_0xe9cd('0x2e')],qs[_0xe9cd('0x34')](_0x2bb07d[_0xe9cd('0x30')][_0xe9cd('0x34')]));_0x389139[_0xe9cd('0x32')]=_0x389139['attributes']['length']?_0x389139['attributes']:_0x44616b[_0xe9cd('0x2e')];if(!_0x2bb07d['query'][_0xe9cd('0x35')](_0xe9cd('0x36'))){_0x389139[_0xe9cd('0x1d')]=qs['limit'](_0x2bb07d[_0xe9cd('0x30')][_0xe9cd('0x1d')]);_0x389139[_0xe9cd('0x1c')]=qs['offset'](_0x2bb07d[_0xe9cd('0x30')][_0xe9cd('0x1c')]);}_0x389139[_0xe9cd('0x37')]=qs[_0xe9cd('0x38')](_0x2bb07d[_0xe9cd('0x30')][_0xe9cd('0x38')]);_0x389139['where']=qs[_0xe9cd('0x39')](_[_0xe9cd('0x3a')](_0x2bb07d['query'],_0x44616b['filters']),_0x336ccf);if(_0x2bb07d[_0xe9cd('0x30')]['filter']){_0x389139[_0xe9cd('0x3b')]=_[_0xe9cd('0x3c')](_0x389139[_0xe9cd('0x3b')],{'$or':_[_0xe9cd('0x2a')](_0x336ccf,function(_0x5a362d){if(_0x5a362d[_0xe9cd('0x2d')]!==_0xe9cd('0x3d')){var _0x610553={};_0x610553[_0x5a362d[_0xe9cd('0x28')]]={'$like':'%'+_0x2bb07d[_0xe9cd('0x30')][_0xe9cd('0x3e')]+'%'};return _0x610553;}})});}_0x389139=_[_0xe9cd('0x3c')]({},_0x389139,_0x2bb07d[_0xe9cd('0x3f')]);var _0x5ee682={'where':_0x389139[_0xe9cd('0x3b')]};return db[_0xe9cd('0x2b')][_0xe9cd('0x1b')](_0x5ee682)['then'](function(_0x3f391f){_0xe6db58['count']=_0x3f391f;if(_0x2bb07d[_0xe9cd('0x30')]['includeAll']){_0x389139['include']=[{'all':!![]}];}return db[_0xe9cd('0x2b')]['findAll'](_0x389139);})[_0xe9cd('0x24')](function(_0x17a5c0){_0xe6db58[_0xe9cd('0x40')]=_0x17a5c0;return _0xe6db58;})['then'](respondWithFilteredResult(_0x4271ea,_0x389139))['catch'](handleError(_0x4271ea,null));};exports[_0xe9cd('0x41')]=function(_0x4d4ac2,_0x511f33){var _0x53b5bb={'raw':!![],'where':{'id':_0x4d4ac2[_0xe9cd('0x42')]['id']}},_0x3ca6cc={};_0x3ca6cc[_0xe9cd('0x2e')]=_[_0xe9cd('0x31')](db[_0xe9cd('0x2b')][_0xe9cd('0x2c')]);_0x3ca6cc[_0xe9cd('0x30')]=_[_0xe9cd('0x31')](_0x4d4ac2[_0xe9cd('0x30')]);_0x3ca6cc[_0xe9cd('0x39')]=_[_0xe9cd('0x33')](_0x3ca6cc[_0xe9cd('0x2e')],_0x3ca6cc[_0xe9cd('0x30')]);_0x53b5bb[_0xe9cd('0x32')]=_[_0xe9cd('0x33')](_0x3ca6cc[_0xe9cd('0x2e')],qs['fields'](_0x4d4ac2[_0xe9cd('0x30')]['fields']));_0x53b5bb[_0xe9cd('0x32')]=_0x53b5bb[_0xe9cd('0x32')][_0xe9cd('0x43')]?_0x53b5bb['attributes']:_0x3ca6cc[_0xe9cd('0x2e')];if(_0x4d4ac2[_0xe9cd('0x30')][_0xe9cd('0x44')]){_0x53b5bb[_0xe9cd('0x45')]=[{'all':!![]}];}_0x53b5bb=_[_0xe9cd('0x3c')]({},_0x53b5bb,_0x4d4ac2[_0xe9cd('0x3f')]);return db[_0xe9cd('0x2b')][_0xe9cd('0x46')](_0x53b5bb)[_0xe9cd('0x24')](handleEntityNotFound(_0x511f33,null))[_0xe9cd('0x24')](respondWithResult(_0x511f33,null))[_0xe9cd('0x47')](handleError(_0x511f33,null));};exports[_0xe9cd('0x23')]=function(_0x30c46e,_0x5301ab){if(_0x30c46e[_0xe9cd('0x48')]['id']){delete _0x30c46e['body']['id'];}return db[_0xe9cd('0x2b')][_0xe9cd('0x46')]({'where':{'id':_0x30c46e[_0xe9cd('0x42')]['id']}})[_0xe9cd('0x24')](handleEntityNotFound(_0x5301ab,null))[_0xe9cd('0x24')](saveUpdates(_0x30c46e[_0xe9cd('0x48')],null))['then'](respondWithResult(_0x5301ab,null))['catch'](handleError(_0x5301ab,null));};exports[_0xe9cd('0x49')]=function(_0x119800,_0x1afb51){return db[_0xe9cd('0x2b')][_0xe9cd('0x46')]({'where':{'id':_0x119800[_0xe9cd('0x42')]['id']}})['then'](handleEntityNotFound(_0x1afb51,null))[_0xe9cd('0x24')](removeEntity(_0x1afb51,null))[_0xe9cd('0x47')](handleError(_0x1afb51,null));};exports['create']=function(_0x230bfe,_0x49463d){var _0x3e1385;return db['sequelize'][_0xe9cd('0x4a')](function(_0x32da52){return db[_0xe9cd('0x2b')][_0xe9cd('0x4b')](_0x230bfe[_0xe9cd('0x48')],{'transaction':_0x32da52})[_0xe9cd('0x24')](function(_0x586ab1){_0x3e1385=_0x586ab1;var _0x3f5e57={'type':db['Sequelize'][_0xe9cd('0x4c')],'transaction':_0x32da52};switch(_0x230bfe[_0xe9cd('0x48')][_0xe9cd('0x2d')]){case _0xe9cd('0x4d'):_0x3f5e57['type']=db[_0xe9cd('0x4e')]['TEXT'];break;case _0xe9cd('0x4f'):_0x3f5e57[_0xe9cd('0x2d')]=db['Sequelize'][_0xe9cd('0x50')];break;case _0xe9cd('0x51'):_0x3f5e57['type']=db['Sequelize'][_0xe9cd('0x52')];_0x3f5e57[_0xe9cd('0x53')]=![];break;default:}return db[_0xe9cd('0x54')][_0xe9cd('0x55')][_0xe9cd('0x56')](_0xe9cd('0x57'),util[_0xe9cd('0x58')](_0xe9cd('0x59'),_0x3e1385['id']),_0x3f5e57);})[_0xe9cd('0x24')](function(){return _0x3e1385;});})[_0xe9cd('0x24')](respondWithResult(_0x49463d,0xc9))[_0xe9cd('0x47')](handleError(_0x49463d,null));};
\ No newline at end of file
+var _0x20d6=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','then','destroy','sendStatus','send','index','CmCustomField','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','update','body','create','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5dbb6d,_0x52d762){var _0x109686=function(_0x536542){while(--_0x536542){_0x5dbb6d['push'](_0x5dbb6d['shift']());}};_0x109686(++_0x52d762);}(_0x20d6,0x181));var _0x620d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x20d6[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x620d('0x0'));var rimraf=require(_0x620d('0x1'));var zipdir=require(_0x620d('0x2'));var jsonpatch=require(_0x620d('0x3'));var rp=require(_0x620d('0x4'));var moment=require('moment');var BPromise=require(_0x620d('0x5'));var Mustache=require('mustache');var util=require(_0x620d('0x6'));var path=require('path');var sox=require(_0x620d('0x7'));var csv=require(_0x620d('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x620d('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x620d('0x8'));var querystring=require(_0x620d('0xa'));var Papa=require('papaparse');var Redis=require(_0x620d('0xb'));var authService=require(_0x620d('0xc'));var qs=require(_0x620d('0xd'));var as=require(_0x620d('0xe'));var hardwareService=require(_0x620d('0xf'));var logger=require(_0x620d('0x10'))(_0x620d('0x11'));var utils=require(_0x620d('0x12'));var config=require(_0x620d('0x13'));var db=require(_0x620d('0x14'))['db'];function respondWithStatusCode(_0x40cd5d,_0x55741d){_0x55741d=_0x55741d||0xcc;return function(_0x4210ab){if(_0x4210ab){return _0x40cd5d['sendStatus'](_0x55741d);}return _0x40cd5d[_0x620d('0x15')](_0x55741d)[_0x620d('0x16')]();};}function respondWithResult(_0x3a0e7e,_0x3e5558){_0x3e5558=_0x3e5558||0xc8;return function(_0x362714){if(_0x362714){return _0x3a0e7e[_0x620d('0x15')](_0x3e5558)[_0x620d('0x17')](_0x362714);}};}function respondWithFilteredResult(_0x2215ff,_0x41fa0d){return function(_0x1c17c5){if(_0x1c17c5){var _0x35ef43=_0x1c17c5[_0x620d('0x18')],_0x5e8cd6=_0x41fa0d[_0x620d('0x19')],_0x340f6c=_0x41fa0d['offset']+_0x41fa0d[_0x620d('0x1a')],_0x3e9f13;if(_0x340f6c>=_0x35ef43){_0x340f6c=_0x35ef43;_0x3e9f13=0xc8;}else{_0x3e9f13=0xce;}_0x2215ff[_0x620d('0x15')](_0x3e9f13);return _0x2215ff[_0x620d('0x1b')](_0x620d('0x1c'),_0x5e8cd6+'-'+_0x340f6c+'/'+_0x35ef43)['json'](_0x1c17c5);}return null;};}function patchUpdates(_0x229060){return function(_0x2eb380){try{jsonpatch[_0x620d('0x1d')](_0x2eb380,_0x229060,!![]);}catch(_0x3ed334){return BPromise['reject'](_0x3ed334);}return _0x2eb380['save']();};}function saveUpdates(_0x4b4842,_0x1cb707){return function(_0x2b96c7){if(_0x2b96c7){return _0x2b96c7['update'](_0x4b4842)[_0x620d('0x1e')](function(_0x584978){return _0x584978;});}return null;};}function removeEntity(_0x103aff,_0x549177){return function(_0x246212){if(_0x246212){return _0x246212[_0x620d('0x1f')]()[_0x620d('0x1e')](function(){_0x103aff[_0x620d('0x15')](0xcc)[_0x620d('0x16')]();});}};}function handleEntityNotFound(_0x5ddf83,_0x185b90){return function(_0x138a35){if(!_0x138a35){_0x5ddf83[_0x620d('0x20')](0x194);}return _0x138a35;};}function handleError(_0x17f41b,_0x57f4c5){_0x57f4c5=_0x57f4c5||0x1f4;return function(_0x3998ea){logger['error'](_0x3998ea['stack']);if(_0x3998ea['name']){delete _0x3998ea['name'];}_0x17f41b[_0x620d('0x15')](_0x57f4c5)[_0x620d('0x21')](_0x3998ea);};}exports[_0x620d('0x22')]=function(_0x3355f7,_0x415150){var _0x245af6={},_0x4b7745={},_0x5d71f5={'count':0x0,'rows':[]};var _0x760544=_['map'](db[_0x620d('0x23')][_0x620d('0x24')],function(_0xa4f4e8){return{'name':_0xa4f4e8[_0x620d('0x25')],'type':_0xa4f4e8[_0x620d('0x26')]['key']};});_0x4b7745[_0x620d('0x27')]=_['differenceBy'](_[_0x620d('0x28')](_0x760544,_0x620d('0x29')),[_0x620d('0x29')]);_0x4b7745[_0x620d('0x2a')]=_[_0x620d('0x2b')](_0x3355f7[_0x620d('0x2a')]);_0x4b7745['filters']=_[_0x620d('0x2c')](_0x4b7745[_0x620d('0x27')],_0x4b7745['query']);_0x245af6[_0x620d('0x2d')]=_[_0x620d('0x2c')](_0x4b7745[_0x620d('0x27')],qs[_0x620d('0x2e')](_0x3355f7[_0x620d('0x2a')]['fields']));_0x245af6[_0x620d('0x2d')]=_0x245af6[_0x620d('0x2d')][_0x620d('0x2f')]?_0x245af6[_0x620d('0x2d')]:_0x4b7745['model'];if(!_0x3355f7[_0x620d('0x2a')]['hasOwnProperty']('nolimit')){_0x245af6[_0x620d('0x1a')]=qs[_0x620d('0x1a')](_0x3355f7[_0x620d('0x2a')][_0x620d('0x1a')]);_0x245af6[_0x620d('0x19')]=qs['offset'](_0x3355f7[_0x620d('0x2a')][_0x620d('0x19')]);}_0x245af6[_0x620d('0x30')]=qs[_0x620d('0x31')](_0x3355f7['query'][_0x620d('0x31')]);_0x245af6[_0x620d('0x32')]=qs[_0x620d('0x33')](_[_0x620d('0x34')](_0x3355f7['query'],_0x4b7745[_0x620d('0x33')]),_0x760544);if(_0x3355f7[_0x620d('0x2a')][_0x620d('0x35')]){_0x245af6[_0x620d('0x32')]=_['merge'](_0x245af6[_0x620d('0x32')],{'$or':_['map'](_0x760544,function(_0x3956bc){if(_0x3956bc['type']!==_0x620d('0x36')){var _0x649c2a={};_0x649c2a[_0x3956bc[_0x620d('0x29')]]={'$like':'%'+_0x3355f7[_0x620d('0x2a')][_0x620d('0x35')]+'%'};return _0x649c2a;}})});}_0x245af6=_[_0x620d('0x37')]({},_0x245af6,_0x3355f7[_0x620d('0x38')]);var _0x3b6d27={'where':_0x245af6[_0x620d('0x32')]};return db[_0x620d('0x23')][_0x620d('0x18')](_0x3b6d27)['then'](function(_0x3508ea){_0x5d71f5[_0x620d('0x18')]=_0x3508ea;if(_0x3355f7[_0x620d('0x2a')][_0x620d('0x39')]){_0x245af6[_0x620d('0x3a')]=[{'all':!![]}];}return db['CmCustomField'][_0x620d('0x3b')](_0x245af6);})[_0x620d('0x1e')](function(_0x2dd33c){_0x5d71f5['rows']=_0x2dd33c;return _0x5d71f5;})[_0x620d('0x1e')](respondWithFilteredResult(_0x415150,_0x245af6))[_0x620d('0x3c')](handleError(_0x415150,null));};exports[_0x620d('0x3d')]=function(_0x19cd82,_0x183403){var _0x1e4a4e={'raw':!![],'where':{'id':_0x19cd82[_0x620d('0x3e')]['id']}},_0x1d5443={};_0x1d5443[_0x620d('0x27')]=_[_0x620d('0x2b')](db[_0x620d('0x23')][_0x620d('0x24')]);_0x1d5443[_0x620d('0x2a')]=_[_0x620d('0x2b')](_0x19cd82['query']);_0x1d5443['filters']=_['intersection'](_0x1d5443[_0x620d('0x27')],_0x1d5443[_0x620d('0x2a')]);_0x1e4a4e[_0x620d('0x2d')]=_['intersection'](_0x1d5443[_0x620d('0x27')],qs[_0x620d('0x2e')](_0x19cd82[_0x620d('0x2a')][_0x620d('0x2e')]));_0x1e4a4e[_0x620d('0x2d')]=_0x1e4a4e[_0x620d('0x2d')][_0x620d('0x2f')]?_0x1e4a4e['attributes']:_0x1d5443['model'];if(_0x19cd82[_0x620d('0x2a')][_0x620d('0x39')]){_0x1e4a4e[_0x620d('0x3a')]=[{'all':!![]}];}_0x1e4a4e=_[_0x620d('0x37')]({},_0x1e4a4e,_0x19cd82[_0x620d('0x38')]);return db[_0x620d('0x23')][_0x620d('0x3f')](_0x1e4a4e)[_0x620d('0x1e')](handleEntityNotFound(_0x183403,null))[_0x620d('0x1e')](respondWithResult(_0x183403,null))[_0x620d('0x3c')](handleError(_0x183403,null));};exports[_0x620d('0x40')]=function(_0x33aa44,_0xe11787){if(_0x33aa44[_0x620d('0x41')]['id']){delete _0x33aa44[_0x620d('0x41')]['id'];}return db[_0x620d('0x23')]['find']({'where':{'id':_0x33aa44['params']['id']}})[_0x620d('0x1e')](handleEntityNotFound(_0xe11787,null))[_0x620d('0x1e')](saveUpdates(_0x33aa44['body'],null))[_0x620d('0x1e')](respondWithResult(_0xe11787,null))[_0x620d('0x3c')](handleError(_0xe11787,null));};exports[_0x620d('0x1f')]=function(_0x413a25,_0x2e586a){return db[_0x620d('0x23')][_0x620d('0x3f')]({'where':{'id':_0x413a25[_0x620d('0x3e')]['id']}})[_0x620d('0x1e')](handleEntityNotFound(_0x2e586a,null))['then'](removeEntity(_0x2e586a,null))[_0x620d('0x3c')](handleError(_0x2e586a,null));};exports[_0x620d('0x42')]=function(_0x1e14d4,_0x4b66bb){var _0x556fd9;return db[_0x620d('0x43')][_0x620d('0x44')](function(_0x1aa0f9){return db[_0x620d('0x23')][_0x620d('0x42')](_0x1e14d4[_0x620d('0x41')],{'transaction':_0x1aa0f9})[_0x620d('0x1e')](function(_0x1eaea6){_0x556fd9=_0x1eaea6;var _0x35b700={'type':db[_0x620d('0x45')][_0x620d('0x46')],'transaction':_0x1aa0f9};switch(_0x1e14d4[_0x620d('0x41')][_0x620d('0x26')]){case'text':_0x35b700[_0x620d('0x26')]=db[_0x620d('0x45')]['TEXT'];break;case _0x620d('0x47'):_0x35b700[_0x620d('0x26')]=db[_0x620d('0x45')][_0x620d('0x48')];break;case _0x620d('0x49'):_0x35b700[_0x620d('0x26')]=db['Sequelize'][_0x620d('0x4a')];_0x35b700[_0x620d('0x4b')]=![];break;default:}return db[_0x620d('0x43')][_0x620d('0x4c')][_0x620d('0x4d')]('cm_contacts',util[_0x620d('0x4e')](_0x620d('0x4f'),_0x556fd9['id']),_0x35b700);})[_0x620d('0x1e')](function(){return _0x556fd9;});})['then'](respondWithResult(_0x4b66bb,0xc9))['catch'](handleError(_0x4b66bb,null));};
\ No newline at end of file
index 85c9ae4..2928090 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b70=['./cmCustomField.attributes','define','cm_custom_fields','util','api','moment','request-promise','path','rimraf'];(function(_0x3b0d98,_0x346f06){var _0x296885=function(_0x8b1247){while(--_0x8b1247){_0x3b0d98['push'](_0x3b0d98['shift']());}};_0x296885(++_0x346f06);}(_0x0b70,0x159));var _0x00b7=function(_0x29a6b6,_0x3dd139){_0x29a6b6=_0x29a6b6-0x0;var _0x3458c5=_0x0b70[_0x29a6b6];return _0x3458c5;};'use strict';var _=require('lodash');var util=require(_0x00b7('0x0'));var logger=require('../../config/logger')(_0x00b7('0x1'));var moment=require(_0x00b7('0x2'));var BPromise=require('bluebird');var rp=require(_0x00b7('0x3'));var fs=require('fs');var path=require(_0x00b7('0x4'));var rimraf=require(_0x00b7('0x5'));var config=require('../../config/environment');var attributes=require(_0x00b7('0x6'));module['exports']=function(_0x81e64,_0x54332d){return _0x81e64[_0x00b7('0x7')]('CmCustomField',attributes,{'tableName':_0x00b7('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3c32=['./cmCustomField.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x3c32,0x161));var _0x23c3=function(_0x292a5c,_0x347069){_0x292a5c=_0x292a5c-0x0;var _0x622795=_0x3c32[_0x292a5c];return _0x622795;};'use strict';var _=require(_0x23c3('0x0'));var util=require(_0x23c3('0x1'));var logger=require(_0x23c3('0x2'))('api');var moment=require(_0x23c3('0x3'));var BPromise=require(_0x23c3('0x4'));var rp=require(_0x23c3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23c3('0x6'));var config=require('../../config/environment');var attributes=require(_0x23c3('0x7'));module[_0x23c3('0x8')]=function(_0x1ec17b,_0x190132){return _0x1ec17b[_0x23c3('0x9')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0b508a0..fa9b1e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf021=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','then','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CmCustomField,\x20%s,\x20%s','result','catch'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xf021,0x18f));var _0x1f02=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xf021[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var moment=require(_0x1f02('0x2'));var BPromise=require(_0x1f02('0x3'));var rs=require(_0x1f02('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f02('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f02('0x6'))(_0x1f02('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1f02('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x383d0b,_0x257d6a,_0x2a6c50){return new BPromise(function(_0x4193d2,_0x1f1cec){return client['request'](_0x383d0b,_0x2a6c50)[_0x1f02('0x9')](function(_0x5dc295){logger['info']('CmCustomField,\x20%s,\x20%s',_0x257d6a,_0x1f02('0xa'));logger[_0x1f02('0xb')](_0x1f02('0xc'),_0x257d6a,_0x1f02('0xa'),JSON[_0x1f02('0xd')](_0x5dc295));if(_0x5dc295['error']){if(_0x5dc295[_0x1f02('0xe')][_0x1f02('0xf')]===0x1f4){logger[_0x1f02('0xe')]('CmCustomField,\x20%s,\x20%s',_0x257d6a,_0x5dc295[_0x1f02('0xe')][_0x1f02('0x10')]);return _0x1f1cec(_0x5dc295[_0x1f02('0xe')]['message']);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x257d6a,_0x5dc295[_0x1f02('0xe')][_0x1f02('0x10')]);return _0x4193d2(_0x5dc295[_0x1f02('0xe')][_0x1f02('0x10')]);}else{logger[_0x1f02('0x11')](_0x1f02('0x12'),_0x257d6a,_0x1f02('0xa'));_0x4193d2(_0x5dc295[_0x1f02('0x13')]['message']);}})[_0x1f02('0x14')](function(_0x5cca16){logger['error']('CmCustomField,\x20%s,\x20%s',_0x257d6a,_0x5cca16);_0x1f1cec(_0x5cca16);});});}
\ No newline at end of file
+var _0xb458=['CmCustomField,\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','CmCustomField,\x20%s,\x20%s','debug'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xb458,0x103));var _0x8b45=function(_0xfb4365,_0xd18f10){_0xfb4365=_0xfb4365-0x0;var _0x109516=_0xb458[_0xfb4365];return _0x109516;};'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
index dba1b1c..46b8a9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1c3=['isAuthenticated','index','/:id','show','post','create','put','update','path','connect-timeout','express','../../components/auth/service','../../config/environment','./cmCustomField.controller','get'];(function(_0x200db1,_0x94fb33){var _0x25f499=function(_0x5317f9){while(--_0x5317f9){_0x200db1['push'](_0x200db1['shift']());}};_0x25f499(++_0x94fb33);}(_0xe1c3,0x116));var _0x3e1c=function(_0x127d97,_0x2c0773){_0x127d97=_0x127d97-0x0;var _0x3a1083=_0xe1c3[_0x127d97];return _0x3a1083;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3e1c('0x0'));var timeout=require(_0x3e1c('0x1'));var express=require(_0x3e1c('0x2'));var router=express['Router']();var auth=require(_0x3e1c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3e1c('0x4'));var controller=require(_0x3e1c('0x5'));router[_0x3e1c('0x6')]('/',auth[_0x3e1c('0x7')](),controller[_0x3e1c('0x8')]);router[_0x3e1c('0x6')](_0x3e1c('0x9'),auth[_0x3e1c('0x7')](),controller[_0x3e1c('0xa')]);router[_0x3e1c('0xb')]('/',auth[_0x3e1c('0x7')](),controller[_0x3e1c('0xc')]);router[_0x3e1c('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3e1c('0xe')]);router['delete']('/:id',auth[_0x3e1c('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4c6a=['create','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/:id','show','post'];(function(_0x201a14,_0x4f405f){var _0x257368=function(_0x283d13){while(--_0x283d13){_0x201a14['push'](_0x201a14['shift']());}};_0x257368(++_0x4f405f);}(_0x4c6a,0x173));var _0xa4c6=function(_0x3a79e8,_0xa1ddc9){_0x3a79e8=_0x3a79e8-0x0;var _0x4c71ee=_0x4c6a[_0x3a79e8];return _0x4c71ee;};'use strict';var multer=require(_0xa4c6('0x0'));var util=require(_0xa4c6('0x1'));var path=require(_0xa4c6('0x2'));var timeout=require(_0xa4c6('0x3'));var express=require(_0xa4c6('0x4'));var router=express[_0xa4c6('0x5')]();var auth=require(_0xa4c6('0x6'));var interaction=require(_0xa4c6('0x7'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router['get']('/',auth[_0xa4c6('0x8')](),controller[_0xa4c6('0x9')]);router['get'](_0xa4c6('0xa'),auth[_0xa4c6('0x8')](),controller[_0xa4c6('0xb')]);router[_0xa4c6('0xc')]('/',auth[_0xa4c6('0x8')](),controller[_0xa4c6('0xd')]);router['put'](_0xa4c6('0xa'),auth[_0xa4c6('0x8')](),controller['update']);router['delete'](_0xa4c6('0xa'),auth[_0xa4c6('0x8')](),controller[_0xa4c6('0xe')]);module[_0xa4c6('0xf')]=router;
\ No newline at end of file
index 9f475ba..81bfa98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['exports','STRING','BOOLEAN','DATE','INTEGER','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x8900bc,_0x1fa648){var _0x57973f=function(_0x9d4d6){while(--_0x9d4d6){_0x8900bc['push'](_0x8900bc['shift']());}};_0x57973f(++_0x1fa648);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xc4aa[_0x1e4360];return _0x31e6b4;};'use strict';var moment=require(_0xac4a('0x0'));var Sequelize=require(_0xac4a('0x1'));module[_0xac4a('0x2')]={'phone':{'type':Sequelize[_0xac4a('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xac4a('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xac4a('0x5')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xac4a('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xac4a('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xac4a('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xac4a('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xac4a('0x5')]},'priority':{'type':Sequelize[_0xac4a('0x6')](0x2)[_0xac4a('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xac4a('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xac4a('0x6')],'unique':_0xac4a('0x8')},'UserId':{'type':Sequelize[_0xac4a('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xac4a('0x8')},'CampaignId':{'type':Sequelize[_0xac4a('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xac4a('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xac4a('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xac4a('0x6')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1261=['sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue'];(function(_0x4c6792,_0x247d32){var _0xb57e50=function(_0xeb6d84){while(--_0xeb6d84){_0x4c6792['push'](_0x4c6792['shift']());}};_0xb57e50(++_0x247d32);}(_0x1261,0x144));var _0x1126=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x1261[_0x466af7];return _0x348c96;};'use strict';var moment=require('moment');var Sequelize=require(_0x1126('0x0'));module[_0x1126('0x1')]={'phone':{'type':Sequelize[_0x1126('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x1126('0x4')],'defaultValue':moment()[_0x1126('0x5')](_0x1126('0x6'))},'countbusyretry':{'type':Sequelize[_0x1126('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1126('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1126('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1126('0x4')]},'priority':{'type':Sequelize[_0x1126('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x1126('0x7')],'unique':_0x1126('0x8')},'ListId':{'type':Sequelize[_0x1126('0x7')],'unique':_0x1126('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x1126('0x7')],'unique':_0x1126('0x8')},'CampaignId':{'type':Sequelize[_0x1126('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1126('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1126('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d772c0d..0088ab8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd67d=['deleted','membername','user','deletedat','format','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','isNil','firstName','calleridname','lastName','finally','getPreview','keys','outbound','preview','dialOrderByScheduledAt','sequelize','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','CmCompany','Company','CmList','dialActive','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','getTimezone','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/environment','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmHopper','fieldName','key','model','query','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$ne','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','createdAt','updatedAt','statedesc'];(function(_0xfcf1ff,_0x1453ba){var _0x118b0a=function(_0x15be1f){while(--_0x15be1f){_0xfcf1ff['push'](_0xfcf1ff['shift']());}};_0x118b0a(++_0x1453ba);}(_0xd67d,0xc9));var _0xdd67=function(_0x1e1d07,_0x299b1e){_0x1e1d07=_0x1e1d07-0x0;var _0x225dce=_0xd67d[_0x1e1d07];return _0x225dce;};'use strict';var pdf=require(_0xdd67('0x0'));var emlformat=require(_0xdd67('0x1'));var rimraf=require(_0xdd67('0x2'));var zipdir=require(_0xdd67('0x3'));var jsonpatch=require(_0xdd67('0x4'));var rp=require(_0xdd67('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdd67('0x6'));var util=require(_0xdd67('0x7'));var path=require(_0xdd67('0x8'));var sox=require(_0xdd67('0x9'));var csv=require(_0xdd67('0xa'));var ejs=require(_0xdd67('0xb'));var fs=require('fs');var _=require(_0xdd67('0xc'));var squel=require('squel');var crypto=require(_0xdd67('0xd'));var jsforce=require(_0xdd67('0xe'));var deskjs=require(_0xdd67('0xf'));var toCsv=require(_0xdd67('0xa'));var querystring=require(_0xdd67('0x10'));var Papa=require(_0xdd67('0x11'));var Redis=require(_0xdd67('0x12'));var shared=require(_0xdd67('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd67('0x14'));var logger=require(_0xdd67('0x15'))(_0xdd67('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a0c69,_0x50ca34){_0x50ca34=_0x50ca34||0xcc;return function(_0x5df909){if(_0x5df909){return _0x3a0c69[_0xdd67('0x17')](_0x50ca34);}return _0x3a0c69[_0xdd67('0x18')](_0x50ca34)[_0xdd67('0x19')]();};}function respondWithResult(_0x250333,_0x2edeff){_0x2edeff=_0x2edeff||0xc8;return function(_0x33d486){if(_0x33d486){return _0x250333[_0xdd67('0x18')](_0x2edeff)[_0xdd67('0x1a')](_0x33d486);}};}function respondWithFilteredResult(_0x1b928f,_0x52756d){return function(_0x56a949){if(_0x56a949){var _0x3ee232=_0x56a949[_0xdd67('0x1b')],_0x363925=_0x52756d[_0xdd67('0x1c')],_0x1a3ce2=_0x52756d[_0xdd67('0x1c')]+_0x52756d[_0xdd67('0x1d')],_0x492e28;if(_0x1a3ce2>=_0x3ee232){_0x1a3ce2=_0x3ee232;_0x492e28=0xc8;}else{_0x492e28=0xce;}_0x1b928f[_0xdd67('0x18')](_0x492e28);return _0x1b928f[_0xdd67('0x1e')]('Content-Range',_0x363925+'-'+_0x1a3ce2+'/'+_0x3ee232)[_0xdd67('0x1a')](_0x56a949);}return null;};}function patchUpdates(_0x550fd6){return function(_0x3717fa){try{jsonpatch[_0xdd67('0x1f')](_0x3717fa,_0x550fd6,!![]);}catch(_0x36d47e){return BPromise[_0xdd67('0x20')](_0x36d47e);}return _0x3717fa['save']();};}function saveUpdates(_0x1de8df,_0x421f1e){return function(_0x277796){if(_0x277796){return _0x277796[_0xdd67('0x21')](_0x1de8df)[_0xdd67('0x22')](function(_0x1f5376){return _0x1f5376;});}return null;};}function removeEntity(_0xb27bbf,_0x583038){return function(_0x15e5fb){if(_0x15e5fb){return _0x15e5fb[_0xdd67('0x23')]()[_0xdd67('0x22')](function(){_0xb27bbf[_0xdd67('0x18')](0xcc)[_0xdd67('0x19')]();});}};}function handleEntityNotFound(_0x2cd3af,_0x2ed86c){return function(_0xa6aa26){if(!_0xa6aa26){_0x2cd3af[_0xdd67('0x17')](0x194);}return _0xa6aa26;};}function handleError(_0x186e29,_0x124ae9){_0x124ae9=_0x124ae9||0x1f4;return function(_0x501762){logger[_0xdd67('0x24')](_0x501762[_0xdd67('0x25')]);if(_0x501762[_0xdd67('0x26')]){delete _0x501762[_0xdd67('0x26')];}_0x186e29[_0xdd67('0x18')](_0x124ae9)[_0xdd67('0x27')](_0x501762);};}exports[_0xdd67('0x28')]=function(_0x1f0ef8,_0x2f2b8b){var _0x37b58a={},_0x38014c={},_0x3ac312={'count':0x0,'rows':[]};var _0x444e99=_[_0xdd67('0x29')](db[_0xdd67('0x2a')]['rawAttributes'],function(_0x1d64d1){return{'name':_0x1d64d1[_0xdd67('0x2b')],'type':_0x1d64d1['type'][_0xdd67('0x2c')]};});_0x38014c[_0xdd67('0x2d')]=_[_0xdd67('0x29')](_0x444e99,'name');_0x38014c[_0xdd67('0x2e')]=_['keys'](_0x1f0ef8[_0xdd67('0x2e')]);_0x38014c[_0xdd67('0x2f')]=_[_0xdd67('0x30')](_0x38014c[_0xdd67('0x2d')],_0x38014c['query']);_0x38014c[_0xdd67('0x2f')]=_[_0xdd67('0x31')](_0x38014c[_0xdd67('0x2f')],[_0xdd67('0x32'),_0xdd67('0x33'),_0xdd67('0x34'),_0xdd67('0x35'),_0xdd67('0x36'),'$lte',_0xdd67('0x37'),'$eq','$not',_0xdd67('0x38'),_0xdd67('0x39'),_0xdd67('0x3a'),_0xdd67('0x3b'),_0xdd67('0x3c'),_0xdd67('0x3d'),_0xdd67('0x3e'),'$notILike',_0xdd67('0x3c'),_0xdd67('0x3f'),_0xdd67('0x40'),_0xdd67('0x41'),_0xdd67('0x42')]);_0x37b58a[_0xdd67('0x43')]=_[_0xdd67('0x30')](_0x38014c[_0xdd67('0x2d')],qs[_0xdd67('0x44')](_0x1f0ef8[_0xdd67('0x2e')]['fields']));_0x37b58a[_0xdd67('0x43')]=_0x37b58a[_0xdd67('0x43')][_0xdd67('0x45')]?_0x37b58a[_0xdd67('0x43')]:_0x38014c[_0xdd67('0x2d')];if(!_0x1f0ef8[_0xdd67('0x2e')][_0xdd67('0x46')](_0xdd67('0x47'))){_0x37b58a[_0xdd67('0x1d')]=qs[_0xdd67('0x1d')](_0x1f0ef8[_0xdd67('0x2e')]['limit']);_0x37b58a[_0xdd67('0x1c')]=qs[_0xdd67('0x1c')](_0x1f0ef8[_0xdd67('0x2e')][_0xdd67('0x1c')]);}_0x37b58a['order']=qs['sort'](_0x1f0ef8[_0xdd67('0x2e')][_0xdd67('0x48')]);_0x37b58a[_0xdd67('0x49')]=qs[_0xdd67('0x2f')](_[_0xdd67('0x4a')](_0x1f0ef8['query'],_0x38014c[_0xdd67('0x2f')]),_0x444e99);if(_0x1f0ef8[_0xdd67('0x2e')][_0xdd67('0x4b')]){_0x37b58a[_0xdd67('0x49')]=_['merge'](_0x37b58a[_0xdd67('0x49')],{'$or':_[_0xdd67('0x29')](_0x444e99,function(_0x32c2b6){if(_0x32c2b6['type']!==_0xdd67('0x4c')){var _0x28321d={};_0x28321d[_0x32c2b6[_0xdd67('0x26')]]={'$like':'%'+_0x1f0ef8[_0xdd67('0x2e')][_0xdd67('0x4b')]+'%'};return _0x28321d;}})});}_0x37b58a=_[_0xdd67('0x4d')]({},_0x37b58a,_0x1f0ef8[_0xdd67('0x4e')]);var _0xfec8e1={'where':_0x37b58a[_0xdd67('0x49')]};return db[_0xdd67('0x2a')][_0xdd67('0x1b')](_0xfec8e1)[_0xdd67('0x22')](function(_0x2da8e3){_0x3ac312[_0xdd67('0x1b')]=_0x2da8e3;if(_0x1f0ef8['query']['includeAll']){_0x37b58a['include']=[{'all':!![]}];}return db[_0xdd67('0x2a')]['findAll'](_0x37b58a);})[_0xdd67('0x22')](function(_0xf659c){_0x3ac312[_0xdd67('0x4f')]=_0xf659c;return _0x3ac312;})[_0xdd67('0x22')](respondWithFilteredResult(_0x2f2b8b,_0x37b58a))[_0xdd67('0x50')](handleError(_0x2f2b8b,null));};exports[_0xdd67('0x51')]=function(_0x8b6b6,_0x5ae12b){var _0x3e2cd7={'raw':!![],'where':{'id':_0x8b6b6[_0xdd67('0x52')]['id']}},_0x1dc4f4={};_0x1dc4f4['model']=_['keys'](db[_0xdd67('0x2a')][_0xdd67('0x53')]);_0x1dc4f4[_0xdd67('0x2e')]=_['keys'](_0x8b6b6[_0xdd67('0x2e')]);_0x1dc4f4[_0xdd67('0x2f')]=_[_0xdd67('0x30')](_0x1dc4f4[_0xdd67('0x2d')],_0x1dc4f4[_0xdd67('0x2e')]);_0x3e2cd7[_0xdd67('0x43')]=_[_0xdd67('0x30')](_0x1dc4f4['model'],qs[_0xdd67('0x44')](_0x8b6b6[_0xdd67('0x2e')][_0xdd67('0x44')]));_0x3e2cd7[_0xdd67('0x43')]=_0x3e2cd7['attributes'][_0xdd67('0x45')]?_0x3e2cd7[_0xdd67('0x43')]:_0x1dc4f4['model'];if(_0x8b6b6['query'][_0xdd67('0x54')]){_0x3e2cd7[_0xdd67('0x55')]=[{'all':!![]}];}_0x3e2cd7=_[_0xdd67('0x4d')]({},_0x3e2cd7,_0x8b6b6[_0xdd67('0x4e')]);return db['CmHopper'][_0xdd67('0x56')](_0x3e2cd7)['then'](handleEntityNotFound(_0x5ae12b,null))[_0xdd67('0x22')](respondWithResult(_0x5ae12b,null))[_0xdd67('0x50')](handleError(_0x5ae12b,null));};exports[_0xdd67('0x57')]=function(_0x1ccb05,_0x3826e0){return db[_0xdd67('0x2a')][_0xdd67('0x57')](_0x1ccb05[_0xdd67('0x58')],{})[_0xdd67('0x22')](respondWithResult(_0x3826e0,0xc9))[_0xdd67('0x50')](handleError(_0x3826e0,null));};exports[_0xdd67('0x21')]=function(_0x5924db,_0x502f3a){if(_0x5924db[_0xdd67('0x58')]['id']){delete _0x5924db['body']['id'];}return db[_0xdd67('0x2a')][_0xdd67('0x56')]({'where':{'id':_0x5924db[_0xdd67('0x52')]['id']}})[_0xdd67('0x22')](handleEntityNotFound(_0x502f3a,null))[_0xdd67('0x22')](saveUpdates(_0x5924db[_0xdd67('0x58')],null))[_0xdd67('0x22')](respondWithResult(_0x502f3a,null))['catch'](handleError(_0x502f3a,null));};exports['describe']=function(_0x37fcf2,_0x847398){return db[_0xdd67('0x2a')][_0xdd67('0x59')]()[_0xdd67('0x22')](respondWithResult(_0x847398,null))['catch'](handleError(_0x847398,null));};exports[_0xdd67('0x23')]=function(_0x22cc23,_0x52cdeb){var _0x31d3a2;return db['CmHopper'][_0xdd67('0x56')]({'where':{'id':_0x22cc23['params']['id']}})[_0xdd67('0x22')](handleEntityNotFound(_0x52cdeb,null))[_0xdd67('0x22')](function(_0x144751){if(_0x144751){return _0x144751[_0xdd67('0x23')]()[_0xdd67('0x22')](function(_0x15aea9){return _0x15aea9;});}})['then'](function(_0x46631c){_0x31d3a2=_0x46631c;if(_0x46631c){if(_0x46631c[_0xdd67('0x5a')]||_0x46631c[_0xdd67('0x5b')]){return db[_0x46631c['VoiceQueueId']?_0xdd67('0x5c'):'Campaign'][_0xdd67('0x56')]({'where':{'id':_0x46631c[_0xdd67('0x5a')]?_0x46631c[_0xdd67('0x5a')]:_0x46631c['CampaignId']},'attributes':['id',_0xdd67('0x26')],'raw':!![]});}}})[_0xdd67('0x22')](function(_0xcad0b7){var _0x2f40f4={};if(_0xcad0b7){_['merge'](_0x2f40f4,_[_0xdd67('0x5d')](_0x31d3a2['dataValues'],[_0xdd67('0x5e'),_0xdd67('0x5f'),'id']));_0x2f40f4['state']=0x15;_0x2f40f4[_0xdd67('0x60')]=_0xdd67('0x61');_0x2f40f4['campaign']=_0xcad0b7['name'];_0x2f40f4[_0xdd67('0x62')]=_0x22cc23[_0xdd67('0x63')]['name'];_0x2f40f4['UserId']=_0x22cc23[_0xdd67('0x63')]['id'];_0x2f40f4[_0xdd67('0x61')]=!![];_0x2f40f4[_0xdd67('0x64')]=moment()[_0xdd67('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x2f40f4[_0xdd67('0x66')]=_0x31d3a2[_0xdd67('0x67')];_0x2f40f4[_0xdd67('0x68')]=_0x31d3a2[_0xdd67('0x5a')]?_0xdd67('0x69'):_0xdd67('0x6a');return db[_0xdd67('0x6b')][_0xdd67('0x56')]({'where':{'id':_0x2f40f4[_0xdd67('0x6c')]},'attributes':['firstName','lastName']})['then'](function(_0x338195){if(!_[_0xdd67('0x6d')](_0x52cdeb)&&!_[_0xdd67('0x6d')](_0x338195[_0xdd67('0x6e')])){_0x2f40f4[_0xdd67('0x6f')]=_0x338195[_0xdd67('0x6e')];if(!_[_0xdd67('0x6d')](_0x338195[_0xdd67('0x70')])){_0x2f40f4['calleridname']+='\x20'+_0x338195[_0xdd67('0x70')];}}})[_0xdd67('0x71')](function(){return db['CmHopperFinal']['create'](_0x2f40f4);});}})[_0xdd67('0x22')](function(){return _0x52cdeb[_0xdd67('0x18')](0xcc)[_0xdd67('0x19')]();})[_0xdd67('0x50')](handleError(_0x52cdeb,null));};exports[_0xdd67('0x72')]=function(_0x23767e,_0x12b298,_0x3862f2){var _0x4637ec=[];return db[_0xdd67('0x6b')][_0xdd67('0x59')]()[_0xdd67('0x22')](function(_0x52ec04){_0x4637ec=_[_0xdd67('0x73')](_0x52ec04);return _0x23767e[_0xdd67('0x63')]['getVoiceQueues']({'where':{'type':_0xdd67('0x74'),'dialActive':!![],'dialMethod':_0xdd67('0x75')},'attributes':['id',_0xdd67('0x76')],'raw':!![]});})[_0xdd67('0x22')](function(_0x4d2177){if(_0x4d2177&&_0x4d2177[_0xdd67('0x45')]){return db[_0xdd67('0x77')]['transaction'](function(_0x8ae46b){var _0x1ebcaf={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xdd67('0x78'))},'VoiceQueueId':{'$in':_[_0xdd67('0x29')](_0x4d2177,'id')},'$or':[{'UserId':null},{'UserId':_0x23767e['user']['id']}]};var _0x26013b=[];if(_0x23767e[_0xdd67('0x58')]['direction']&&_0x23767e[_0xdd67('0x58')][_0xdd67('0x79')]===_0xdd67('0x7a')){if(!_[_0xdd67('0x7b')](_0x23767e[_0xdd67('0x58')][_0xdd67('0x7c')])){_0x1ebcaf['id']={'$in':_0x23767e[_0xdd67('0x58')]['hopperIds']};}_0x26013b=[[_0xdd67('0x7d'),_0xdd67('0x7e')],[_0xdd67('0x7f'),_0x4d2177[0x0][_0xdd67('0x76')]===_0xdd67('0x7e')?_0xdd67('0x80'):'ASC'],db['sequelize']['literal'](_0xdd67('0x81')),['id',_0xdd67('0x80')]];}else{if(!_[_0xdd67('0x7b')](_0x23767e[_0xdd67('0x58')][_0xdd67('0x7c')])){_0x1ebcaf['id']={'$notIn':_0x23767e[_0xdd67('0x58')]['hopperIds']};}_0x26013b=[[_0xdd67('0x7d'),'DESC'],[_0xdd67('0x7f'),_0x4d2177[0x0][_0xdd67('0x76')]],db[_0xdd67('0x77')][_0xdd67('0x82')](_0xdd67('0x83')),['id','ASC']];}return db[_0xdd67('0x2a')][_0xdd67('0x84')]({'attributes':['id',_0xdd67('0x85')],'where':_0x1ebcaf,'order':_0x26013b,'transaction':_0x8ae46b,'lock':_0x8ae46b[_0xdd67('0x86')]['UPDATE'],'include':[{'model':db[_0xdd67('0x6b')],'as':_0xdd67('0x87'),'attributes':_0x4637ec,'include':[{'model':db[_0xdd67('0x88')],'as':_0xdd67('0x89'),'attributes':['id',_0xdd67('0x26')]}]},{'model':db[_0xdd67('0x8a')],'as':'List','attributes':['id',_0xdd67('0x26')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0xdd67('0x8b')]}]})[_0xdd67('0x22')](function(_0x459501){if(_0x459501){return _0x459501[_0xdd67('0x21')]({'UserId':_0x23767e[_0xdd67('0x63')]['id']},{'transaction':_0x8ae46b});}});});}})['then'](handleEntityNotFound(_0x12b298,null))[_0xdd67('0x22')](respondWithResult(_0x12b298,null))[_0xdd67('0x50')](handleError(_0x12b298,null));};exports[_0xdd67('0x8c')]=function(_0xae5c19,_0x256392,_0xc4dfbd){return _0xae5c19[_0xdd67('0x63')][_0xdd67('0x8d')]({'where':{'type':_0xdd67('0x74'),'dialActive':!![],'dialMethod':_0xdd67('0x75')},'attributes':['id'],'raw':!![]})[_0xdd67('0x22')](function(_0x3bf9e3){if(_0x3bf9e3&&_0x3bf9e3[_0xdd67('0x45')]){return db[_0xdd67('0x2a')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xdd67('0x78'))},'VoiceQueueId':{'$in':_[_0xdd67('0x29')](_0x3bf9e3,'id')},'$or':[{'UserId':null},{'UserId':_0xae5c19[_0xdd67('0x63')]['id']}]}});}return 0x0;})['then'](function(_0x4cf662){if(!_[_0xdd67('0x6d')](_0x4cf662)&&_[_0xdd67('0x8e')](_0x4cf662)){return _0x256392['status'](0xc8)[_0xdd67('0x1a')]({'contacts':_0x4cf662});}else{logger[_0xdd67('0x24')](_0xdd67('0x8f'),_0xdd67('0x8c'),0x194,_0xdd67('0x90'));_0x256392[_0xdd67('0x17')](0x194);}})[_0xdd67('0x50')](handleError(_0x256392,null));};exports[_0xdd67('0x91')]=function(_0xe35af0,_0x2883c5,_0x2d162e){var _0x35ab48=shared[_0xdd67('0x92')];var _0x24665d=[];_['map'](_0x35ab48,function(_0x4b2482){_0x24665d[_0xdd67('0x93')]({'id':_0x4b2482[_0xdd67('0x26')],'name':_0x4b2482['name'],'utcOffset':_0x4b2482['utcOffset']});});return _0x2883c5[_0xdd67('0x18')](0xc8)['json']({'tz':_0x24665d});};exports[_0xdd67('0x94')]=function(_0x404eca,_0x291c43,_0xc62401){var _0x15a89a=shared['timezones'];var _0x15aa92={};if(!_[_0xdd67('0x6d')](_0x15a89a[_0x404eca[_0xdd67('0x58')]['id']]))_0x15aa92=_0x15a89a[_0x404eca[_0xdd67('0x58')]['id']];return _0x291c43[_0xdd67('0x18')](0xc8)[_0xdd67('0x1a')](_0x15aa92);};
\ No newline at end of file
+var _0xc7e4=['length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','params','rawAttributes','include','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','createdAt','updatedAt','state','statedesc','deleted','campaign','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','calleridname','firstName','CmHopperFinal','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','transaction','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','dialActive','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','utcOffset','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/environment','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','reject','update','then','destroy','stack','name','send','index','CmHopper','fieldName','type','key','model','map','keys','filters','query','concat','$or','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','intersection','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7e4,0xde));var _0x4c7e=function(_0x41f7a1,_0x150c5c){_0x41f7a1=_0x41f7a1-0x0;var _0xc654bc=_0xc7e4[_0x41f7a1];return _0xc654bc;};'use strict';var pdf=require(_0x4c7e('0x0'));var emlformat=require(_0x4c7e('0x1'));var rimraf=require(_0x4c7e('0x2'));var zipdir=require(_0x4c7e('0x3'));var jsonpatch=require(_0x4c7e('0x4'));var rp=require(_0x4c7e('0x5'));var moment=require(_0x4c7e('0x6'));var BPromise=require(_0x4c7e('0x7'));var Mustache=require(_0x4c7e('0x8'));var util=require(_0x4c7e('0x9'));var path=require('path');var sox=require(_0x4c7e('0xa'));var csv=require(_0x4c7e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4c7e('0xc'));var squel=require('squel');var crypto=require(_0x4c7e('0xd'));var jsforce=require(_0x4c7e('0xe'));var deskjs=require(_0x4c7e('0xf'));var toCsv=require(_0x4c7e('0xb'));var querystring=require(_0x4c7e('0x10'));var Papa=require(_0x4c7e('0x11'));var Redis=require(_0x4c7e('0x12'));var shared=require(_0x4c7e('0x13'));var authService=require(_0x4c7e('0x14'));var qs=require(_0x4c7e('0x15'));var as=require(_0x4c7e('0x16'));var hardwareService=require(_0x4c7e('0x17'));var logger=require(_0x4c7e('0x18'))(_0x4c7e('0x19'));var utils=require(_0x4c7e('0x1a'));var config=require(_0x4c7e('0x13'));var db=require(_0x4c7e('0x1b'))['db'];function respondWithStatusCode(_0x378614,_0x58aacc){_0x58aacc=_0x58aacc||0xcc;return function(_0x3fb67f){if(_0x3fb67f){return _0x378614['sendStatus'](_0x58aacc);}return _0x378614[_0x4c7e('0x1c')](_0x58aacc)[_0x4c7e('0x1d')]();};}function respondWithResult(_0x3ba066,_0x299cae){_0x299cae=_0x299cae||0xc8;return function(_0x2409f7){if(_0x2409f7){return _0x3ba066['status'](_0x299cae)[_0x4c7e('0x1e')](_0x2409f7);}};}function respondWithFilteredResult(_0x354d11,_0x1f6a3b){return function(_0x5734e2){if(_0x5734e2){var _0x19c8ef=_0x5734e2[_0x4c7e('0x1f')],_0x1db22b=_0x1f6a3b[_0x4c7e('0x20')],_0x4c55ac=_0x1f6a3b[_0x4c7e('0x20')]+_0x1f6a3b[_0x4c7e('0x21')],_0x102d81;if(_0x4c55ac>=_0x19c8ef){_0x4c55ac=_0x19c8ef;_0x102d81=0xc8;}else{_0x102d81=0xce;}_0x354d11[_0x4c7e('0x1c')](_0x102d81);return _0x354d11['set']('Content-Range',_0x1db22b+'-'+_0x4c55ac+'/'+_0x19c8ef)[_0x4c7e('0x1e')](_0x5734e2);}return null;};}function patchUpdates(_0x5817b3){return function(_0x431661){try{jsonpatch['apply'](_0x431661,_0x5817b3,!![]);}catch(_0x4e2f47){return BPromise[_0x4c7e('0x22')](_0x4e2f47);}return _0x431661['save']();};}function saveUpdates(_0x1b52c0,_0x2abe12){return function(_0x1d74d3){if(_0x1d74d3){return _0x1d74d3[_0x4c7e('0x23')](_0x1b52c0)[_0x4c7e('0x24')](function(_0xd5b28d){return _0xd5b28d;});}return null;};}function removeEntity(_0x305f78,_0x2b50d4){return function(_0x438060){if(_0x438060){return _0x438060[_0x4c7e('0x25')]()[_0x4c7e('0x24')](function(){_0x305f78[_0x4c7e('0x1c')](0xcc)[_0x4c7e('0x1d')]();});}};}function handleEntityNotFound(_0x35ff45,_0x32d9c3){return function(_0x3b7809){if(!_0x3b7809){_0x35ff45['sendStatus'](0x194);}return _0x3b7809;};}function handleError(_0x440606,_0x1fb4ad){_0x1fb4ad=_0x1fb4ad||0x1f4;return function(_0x1acb38){logger['error'](_0x1acb38[_0x4c7e('0x26')]);if(_0x1acb38[_0x4c7e('0x27')]){delete _0x1acb38[_0x4c7e('0x27')];}_0x440606[_0x4c7e('0x1c')](_0x1fb4ad)[_0x4c7e('0x28')](_0x1acb38);};}exports[_0x4c7e('0x29')]=function(_0x5779f8,_0x43aa0b){var _0x30245f={},_0x5dbdd7={},_0x24ea14={'count':0x0,'rows':[]};var _0x597b5a=_['map'](db[_0x4c7e('0x2a')]['rawAttributes'],function(_0x41853e){return{'name':_0x41853e[_0x4c7e('0x2b')],'type':_0x41853e[_0x4c7e('0x2c')][_0x4c7e('0x2d')]};});_0x5dbdd7[_0x4c7e('0x2e')]=_[_0x4c7e('0x2f')](_0x597b5a,_0x4c7e('0x27'));_0x5dbdd7['query']=_[_0x4c7e('0x30')](_0x5779f8['query']);_0x5dbdd7[_0x4c7e('0x31')]=_['intersection'](_0x5dbdd7[_0x4c7e('0x2e')],_0x5dbdd7[_0x4c7e('0x32')]);_0x5dbdd7['filters']=_[_0x4c7e('0x33')](_0x5dbdd7[_0x4c7e('0x31')],['$and',_0x4c7e('0x34'),_0x4c7e('0x35'),_0x4c7e('0x36'),_0x4c7e('0x37'),'$lte',_0x4c7e('0x38'),_0x4c7e('0x39'),_0x4c7e('0x3a'),_0x4c7e('0x3b'),_0x4c7e('0x3c'),_0x4c7e('0x3d'),'$notIn',_0x4c7e('0x3e'),_0x4c7e('0x3f'),_0x4c7e('0x40'),_0x4c7e('0x41'),_0x4c7e('0x3e'),_0x4c7e('0x42'),'$contains',_0x4c7e('0x43'),_0x4c7e('0x44')]);_0x30245f[_0x4c7e('0x45')]=_[_0x4c7e('0x46')](_0x5dbdd7[_0x4c7e('0x2e')],qs[_0x4c7e('0x47')](_0x5779f8['query'][_0x4c7e('0x47')]));_0x30245f['attributes']=_0x30245f['attributes'][_0x4c7e('0x48')]?_0x30245f[_0x4c7e('0x45')]:_0x5dbdd7[_0x4c7e('0x2e')];if(!_0x5779f8['query']['hasOwnProperty'](_0x4c7e('0x49'))){_0x30245f['limit']=qs[_0x4c7e('0x21')](_0x5779f8[_0x4c7e('0x32')][_0x4c7e('0x21')]);_0x30245f[_0x4c7e('0x20')]=qs[_0x4c7e('0x20')](_0x5779f8[_0x4c7e('0x32')][_0x4c7e('0x20')]);}_0x30245f['order']=qs[_0x4c7e('0x4a')](_0x5779f8[_0x4c7e('0x32')][_0x4c7e('0x4a')]);_0x30245f[_0x4c7e('0x4b')]=qs['filters'](_[_0x4c7e('0x4c')](_0x5779f8[_0x4c7e('0x32')],_0x5dbdd7[_0x4c7e('0x31')]),_0x597b5a);if(_0x5779f8[_0x4c7e('0x32')]['filter']){_0x30245f[_0x4c7e('0x4b')]=_[_0x4c7e('0x4d')](_0x30245f[_0x4c7e('0x4b')],{'$or':_[_0x4c7e('0x2f')](_0x597b5a,function(_0x53ad88){if(_0x53ad88[_0x4c7e('0x2c')]!==_0x4c7e('0x4e')){var _0x17a3ef={};_0x17a3ef[_0x53ad88[_0x4c7e('0x27')]]={'$like':'%'+_0x5779f8[_0x4c7e('0x32')][_0x4c7e('0x4f')]+'%'};return _0x17a3ef;}})});}_0x30245f=_[_0x4c7e('0x4d')]({},_0x30245f,_0x5779f8[_0x4c7e('0x50')]);var _0x848eb6={'where':_0x30245f[_0x4c7e('0x4b')]};return db['CmHopper']['count'](_0x848eb6)[_0x4c7e('0x24')](function(_0x4e136b){_0x24ea14[_0x4c7e('0x1f')]=_0x4e136b;if(_0x5779f8[_0x4c7e('0x32')][_0x4c7e('0x51')]){_0x30245f['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x30245f);})['then'](function(_0x4b42b6){_0x24ea14[_0x4c7e('0x52')]=_0x4b42b6;return _0x24ea14;})['then'](respondWithFilteredResult(_0x43aa0b,_0x30245f))[_0x4c7e('0x53')](handleError(_0x43aa0b,null));};exports['show']=function(_0x50b237,_0x4c35a9){var _0x46caec={'raw':!![],'where':{'id':_0x50b237[_0x4c7e('0x54')]['id']}},_0x4cbfa2={};_0x4cbfa2['model']=_['keys'](db['CmHopper'][_0x4c7e('0x55')]);_0x4cbfa2[_0x4c7e('0x32')]=_[_0x4c7e('0x30')](_0x50b237['query']);_0x4cbfa2[_0x4c7e('0x31')]=_['intersection'](_0x4cbfa2['model'],_0x4cbfa2[_0x4c7e('0x32')]);_0x46caec[_0x4c7e('0x45')]=_[_0x4c7e('0x46')](_0x4cbfa2[_0x4c7e('0x2e')],qs['fields'](_0x50b237[_0x4c7e('0x32')][_0x4c7e('0x47')]));_0x46caec[_0x4c7e('0x45')]=_0x46caec[_0x4c7e('0x45')][_0x4c7e('0x48')]?_0x46caec[_0x4c7e('0x45')]:_0x4cbfa2['model'];if(_0x50b237[_0x4c7e('0x32')][_0x4c7e('0x51')]){_0x46caec[_0x4c7e('0x56')]=[{'all':!![]}];}_0x46caec=_[_0x4c7e('0x4d')]({},_0x46caec,_0x50b237[_0x4c7e('0x50')]);return db['CmHopper'][_0x4c7e('0x57')](_0x46caec)[_0x4c7e('0x24')](handleEntityNotFound(_0x4c35a9,null))['then'](respondWithResult(_0x4c35a9,null))[_0x4c7e('0x53')](handleError(_0x4c35a9,null));};exports['create']=function(_0x30186c,_0x2b7edb){return db[_0x4c7e('0x2a')][_0x4c7e('0x58')](_0x30186c[_0x4c7e('0x59')],{})[_0x4c7e('0x24')](respondWithResult(_0x2b7edb,0xc9))[_0x4c7e('0x53')](handleError(_0x2b7edb,null));};exports[_0x4c7e('0x23')]=function(_0x4ac611,_0x161ee4){if(_0x4ac611[_0x4c7e('0x59')]['id']){delete _0x4ac611[_0x4c7e('0x59')]['id'];}return db[_0x4c7e('0x2a')][_0x4c7e('0x57')]({'where':{'id':_0x4ac611[_0x4c7e('0x54')]['id']}})['then'](handleEntityNotFound(_0x161ee4,null))[_0x4c7e('0x24')](saveUpdates(_0x4ac611[_0x4c7e('0x59')],null))[_0x4c7e('0x24')](respondWithResult(_0x161ee4,null))[_0x4c7e('0x53')](handleError(_0x161ee4,null));};exports[_0x4c7e('0x5a')]=function(_0x2f2a38,_0x1bec5a){return db[_0x4c7e('0x2a')]['describe']()['then'](respondWithResult(_0x1bec5a,null))[_0x4c7e('0x53')](handleError(_0x1bec5a,null));};exports['destroy']=function(_0x436afa,_0x23b71f){var _0x37fb74;return db[_0x4c7e('0x2a')][_0x4c7e('0x57')]({'where':{'id':_0x436afa[_0x4c7e('0x54')]['id']}})[_0x4c7e('0x24')](handleEntityNotFound(_0x23b71f,null))[_0x4c7e('0x24')](function(_0x576dbf){if(_0x576dbf){return _0x576dbf[_0x4c7e('0x25')]()['then'](function(_0x5a7868){return _0x5a7868;});}})[_0x4c7e('0x24')](function(_0x21da24){_0x37fb74=_0x21da24;if(_0x21da24){if(_0x21da24[_0x4c7e('0x5b')]||_0x21da24[_0x4c7e('0x5c')]){return db[_0x21da24[_0x4c7e('0x5b')]?_0x4c7e('0x5d'):_0x4c7e('0x5e')]['find']({'where':{'id':_0x21da24[_0x4c7e('0x5b')]?_0x21da24[_0x4c7e('0x5b')]:_0x21da24[_0x4c7e('0x5c')]},'attributes':['id',_0x4c7e('0x27')],'raw':!![]});}}})[_0x4c7e('0x24')](function(_0x2d61a6){var _0x574d75={};if(_0x2d61a6){_[_0x4c7e('0x4d')](_0x574d75,_['omit'](_0x37fb74['dataValues'],[_0x4c7e('0x5f'),_0x4c7e('0x60'),'id']));_0x574d75[_0x4c7e('0x61')]=0x15;_0x574d75[_0x4c7e('0x62')]=_0x4c7e('0x63');_0x574d75[_0x4c7e('0x64')]=_0x2d61a6[_0x4c7e('0x27')];_0x574d75['membername']=_0x436afa[_0x4c7e('0x65')][_0x4c7e('0x27')];_0x574d75[_0x4c7e('0x66')]=_0x436afa[_0x4c7e('0x65')]['id'];_0x574d75[_0x4c7e('0x63')]=!![];_0x574d75[_0x4c7e('0x67')]=moment()[_0x4c7e('0x68')](_0x4c7e('0x69'));_0x574d75['calleridnum']=_0x37fb74[_0x4c7e('0x6a')];_0x574d75[_0x4c7e('0x6b')]=_0x37fb74[_0x4c7e('0x5b')]?_0x4c7e('0x6c'):_0x4c7e('0x6d');return db[_0x4c7e('0x6e')][_0x4c7e('0x57')]({'where':{'id':_0x574d75[_0x4c7e('0x6f')]},'attributes':['firstName',_0x4c7e('0x70')]})[_0x4c7e('0x24')](function(_0x7b3c81){if(!_[_0x4c7e('0x71')](_0x23b71f)&&!_[_0x4c7e('0x71')](_0x7b3c81['firstName'])){_0x574d75[_0x4c7e('0x72')]=_0x7b3c81[_0x4c7e('0x73')];if(!_[_0x4c7e('0x71')](_0x7b3c81[_0x4c7e('0x70')])){_0x574d75[_0x4c7e('0x72')]+='\x20'+_0x7b3c81['lastName'];}}})['finally'](function(){return db[_0x4c7e('0x74')]['create'](_0x574d75);});}})['then'](function(){return _0x23b71f[_0x4c7e('0x1c')](0xcc)['end']();})[_0x4c7e('0x53')](handleError(_0x23b71f,null));};exports['getPreview']=function(_0x1365c8,_0x431368,_0x269539){var _0x4ac280=[];return db[_0x4c7e('0x6e')]['describe']()[_0x4c7e('0x24')](function(_0x160381){_0x4ac280=_[_0x4c7e('0x30')](_0x160381);return _0x1365c8['user'][_0x4c7e('0x75')]({'where':{'type':_0x4c7e('0x76'),'dialActive':!![],'dialMethod':_0x4c7e('0x77')},'attributes':['id',_0x4c7e('0x78')],'raw':!![]});})[_0x4c7e('0x24')](function(_0x2324e5){if(_0x2324e5&&_0x2324e5['length']){return db['sequelize'][_0x4c7e('0x79')](function(_0x19437e){var _0x3eae6b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x4c7e('0x69'))},'VoiceQueueId':{'$in':_['map'](_0x2324e5,'id')},'$or':[{'UserId':null},{'UserId':_0x1365c8['user']['id']}]};var _0x4c4079=[];if(_0x1365c8[_0x4c7e('0x59')]['direction']&&_0x1365c8[_0x4c7e('0x59')]['direction']==='prev'){if(!_['isEmpty'](_0x1365c8['body'][_0x4c7e('0x7a')])){_0x3eae6b['id']={'$in':_0x1365c8['body']['hopperIds']};}_0x4c4079=[[_0x4c7e('0x7b'),_0x4c7e('0x7c')],[_0x4c7e('0x7d'),_0x2324e5[0x0][_0x4c7e('0x78')]==='ASC'?_0x4c7e('0x7e'):_0x4c7e('0x7c')],db[_0x4c7e('0x7f')]['literal'](_0x4c7e('0x80')),['id',_0x4c7e('0x7e')]];}else{if(!_['isEmpty'](_0x1365c8['body']['hopperIds'])){_0x3eae6b['id']={'$notIn':_0x1365c8['body'][_0x4c7e('0x7a')]};}_0x4c4079=[[_0x4c7e('0x7b'),_0x4c7e('0x7e')],[_0x4c7e('0x7d'),_0x2324e5[0x0][_0x4c7e('0x78')]],db[_0x4c7e('0x7f')]['literal'](_0x4c7e('0x81')),['id','ASC']];}return db[_0x4c7e('0x2a')][_0x4c7e('0x82')]({'attributes':['id',_0x4c7e('0x83')],'where':_0x3eae6b,'order':_0x4c4079,'transaction':_0x19437e,'lock':_0x19437e[_0x4c7e('0x84')][_0x4c7e('0x85')],'include':[{'model':db[_0x4c7e('0x6e')],'as':_0x4c7e('0x86'),'attributes':_0x4ac280,'include':[{'model':db[_0x4c7e('0x87')],'as':_0x4c7e('0x88'),'attributes':['id',_0x4c7e('0x27')]}]},{'model':db[_0x4c7e('0x89')],'as':'List','attributes':['id',_0x4c7e('0x27')]},{'model':db['VoiceQueue'],'as':_0x4c7e('0x8a'),'attributes':['id',_0x4c7e('0x27'),_0x4c7e('0x8b')]}]})['then'](function(_0x302ee9){if(_0x302ee9){return _0x302ee9[_0x4c7e('0x23')]({'UserId':_0x1365c8[_0x4c7e('0x65')]['id']},{'transaction':_0x19437e});}});});}})[_0x4c7e('0x24')](handleEntityNotFound(_0x431368,null))[_0x4c7e('0x24')](respondWithResult(_0x431368,null))[_0x4c7e('0x53')](handleError(_0x431368,null));};exports['getOpenContacts']=function(_0x171ed1,_0x3e14d4,_0x5be984){return _0x171ed1['user'][_0x4c7e('0x75')]({'where':{'type':_0x4c7e('0x76'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x4c7e('0x24')](function(_0x3dbb62){if(_0x3dbb62&&_0x3dbb62['length']){return db[_0x4c7e('0x2a')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4c7e('0x68')](_0x4c7e('0x69'))},'VoiceQueueId':{'$in':_[_0x4c7e('0x2f')](_0x3dbb62,'id')},'$or':[{'UserId':null},{'UserId':_0x171ed1[_0x4c7e('0x65')]['id']}]}});}return 0x0;})[_0x4c7e('0x24')](function(_0x1ab7d8){if(!_[_0x4c7e('0x71')](_0x1ab7d8)&&_[_0x4c7e('0x8c')](_0x1ab7d8)){return _0x3e14d4[_0x4c7e('0x1c')](0xc8)['json']({'contacts':_0x1ab7d8});}else{logger[_0x4c7e('0x8d')](_0x4c7e('0x8e'),_0x4c7e('0x8f'),0x194,_0x4c7e('0x90'));_0x3e14d4['sendStatus'](0x194);}})[_0x4c7e('0x53')](handleError(_0x3e14d4,null));};exports[_0x4c7e('0x91')]=function(_0x785795,_0x58a0d9,_0x4f3e87){var _0x20c856=shared['timezones'];var _0x21e4e6=[];_[_0x4c7e('0x2f')](_0x20c856,function(_0xbb2a92){_0x21e4e6['push']({'id':_0xbb2a92['name'],'name':_0xbb2a92['name'],'utcOffset':_0xbb2a92[_0x4c7e('0x92')]});});return _0x58a0d9[_0x4c7e('0x1c')](0xc8)[_0x4c7e('0x1e')]({'tz':_0x21e4e6});};exports['getTimezone']=function(_0x3b1c5e,_0x11dc51,_0x3b47bd){var _0x593967=shared['timezones'];var _0x1b0b5f={};if(!_[_0x4c7e('0x71')](_0x593967[_0x3b1c5e[_0x4c7e('0x59')]['id']]))_0x1b0b5f=_0x593967[_0x3b1c5e[_0x4c7e('0x59')]['id']];return _0x11dc51[_0x4c7e('0x1c')](0xc8)['json'](_0x1b0b5f);};
\ No newline at end of file
index ee6ee5b..ad8d458 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8030=['moment','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','util','../../config/logger','api'];(function(_0x427486,_0x16f799){var _0x531478=function(_0x47e8f4){while(--_0x47e8f4){_0x427486['push'](_0x427486['shift']());}};_0x531478(++_0x16f799);}(_0x8030,0x185));var _0x0803=function(_0x497d8c,_0x2904c9){_0x497d8c=_0x497d8c-0x0;var _0xeafed7=_0x8030[_0x497d8c];return _0xeafed7;};'use strict';var _=require('lodash');var util=require(_0x0803('0x0'));var logger=require(_0x0803('0x1'))(_0x0803('0x2'));var moment=require(_0x0803('0x3'));var BPromise=require('bluebird');var rp=require(_0x0803('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0803('0x5'));var config=require(_0x0803('0x6'));var attributes=require(_0x0803('0x7'));module[_0x0803('0x8')]=function(_0x55dc6f,_0x3f5600){return _0x55dc6f[_0x0803('0x9')](_0x0803('0xa'),attributes,{'tableName':_0x0803('0xb'),'paranoid':![],'indexes':[{'name':_0x0803('0xc'),'fields':[_0x0803('0xc')]},{'name':_0x0803('0xd'),'fields':[_0x0803('0xd')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d93=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util'];(function(_0x3ffbbc,_0x4e8ac7){var _0x433c0d=function(_0x16d6b9){while(--_0x16d6b9){_0x3ffbbc['push'](_0x3ffbbc['shift']());}};_0x433c0d(++_0x4e8ac7);}(_0x0d93,0x1ed));var _0x30d9=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0x0d93[_0x421263];return _0x34e4b5;};'use strict';var _=require(_0x30d9('0x0'));var util=require(_0x30d9('0x1'));var logger=require(_0x30d9('0x2'))('api');var moment=require(_0x30d9('0x3'));var BPromise=require(_0x30d9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x30d9('0x5'));var rimraf=require(_0x30d9('0x6'));var config=require(_0x30d9('0x7'));var attributes=require(_0x30d9('0x8'));module['exports']=function(_0x35d2cc,_0x3cf205){return _0x35d2cc[_0x30d9('0x9')](_0x30d9('0xa'),attributes,{'tableName':_0x30d9('0xb'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x30d9('0xc')]},{'name':_0x30d9('0xd'),'fields':['phone']},{'name':_0x30d9('0xe'),'fields':[_0x30d9('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 66ac905..41e2462 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a22=['info','result','catch','GetCmHopper','findAll','options','raw','attributes','limit','include','map','model','debug','CmHopper','find','ShowCmHopper','create','body','CreateCmHopper','update','where','UpdateCmHopper','DestroyCmHopper','describe','sequelize','transaction','order','LOCK','UPDATE','CmContact','keys','User','name','voicePause','length','UserId','all','GetContactDialer','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','push','GetCmHopperPreview','Contact','GetContactByPhone','log','req\x20value','findOne','dialTimezone','DESC','getContactByPhone','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x4c5ae2,_0xcfb7c5){var _0x562717=function(_0x26a4af){while(--_0x26a4af){_0x4c5ae2['push'](_0x4c5ae2['shift']());}};_0x562717(++_0xcfb7c5);}(_0x1a22,0x125));var _0x21a2=function(_0x5953cb,_0x37147e){_0x5953cb=_0x5953cb-0x0;var _0x2e352e=_0x1a22[_0x5953cb];return _0x2e352e;};'use strict';var _=require(_0x21a2('0x0'));var util=require(_0x21a2('0x1'));var moment=require('moment');var BPromise=require(_0x21a2('0x2'));var rs=require(_0x21a2('0x3'));var fs=require('fs');var Redis=require(_0x21a2('0x4'));var db=require(_0x21a2('0x5'))['db'];var utils=require(_0x21a2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x21a2('0x7'));var jayson=require(_0x21a2('0x8'));var client=jayson[_0x21a2('0x9')][_0x21a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fe145,_0x56b7c3,_0x1c3305){return new BPromise(function(_0x50aa61,_0x260ad5){return client[_0x21a2('0xb')](_0x1fe145,_0x1c3305)[_0x21a2('0xc')](function(_0xcecbf){logger['info'](_0x21a2('0xd'),_0x56b7c3,_0x21a2('0xe'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x56b7c3,_0x21a2('0xe'),JSON[_0x21a2('0xf')](_0xcecbf));if(_0xcecbf[_0x21a2('0x10')]){if(_0xcecbf[_0x21a2('0x10')][_0x21a2('0x11')]===0x1f4){logger['error'](_0x21a2('0xd'),_0x56b7c3,_0xcecbf[_0x21a2('0x10')][_0x21a2('0x12')]);return _0x260ad5(_0xcecbf['error'][_0x21a2('0x12')]);}logger[_0x21a2('0x10')]('CmHopper,\x20%s,\x20%s',_0x56b7c3,_0xcecbf['error'][_0x21a2('0x12')]);return _0x50aa61(_0xcecbf[_0x21a2('0x10')][_0x21a2('0x12')]);}else{logger[_0x21a2('0x13')](_0x21a2('0xd'),_0x56b7c3,_0x21a2('0xe'));_0x50aa61(_0xcecbf[_0x21a2('0x14')][_0x21a2('0x12')]);}})[_0x21a2('0x15')](function(_0x4b02a9){logger[_0x21a2('0x10')](_0x21a2('0xd'),_0x56b7c3,_0x4b02a9);_0x260ad5(_0x4b02a9);});});}exports[_0x21a2('0x16')]=function(_0x1c160c){var _0x368792=this;return new Promise(function(_0x1e6dd1,_0x6d0610){return db['CmHopper'][_0x21a2('0x17')]({'raw':_0x1c160c[_0x21a2('0x18')]?_0x1c160c['options'][_0x21a2('0x19')]===undefined?!![]:![]:!![],'where':_0x1c160c[_0x21a2('0x18')]?_0x1c160c[_0x21a2('0x18')]['where']||null:null,'attributes':_0x1c160c['options']?_0x1c160c['options'][_0x21a2('0x1a')]||null:null,'limit':_0x1c160c['options']?_0x1c160c['options'][_0x21a2('0x1b')]||null:null,'include':_0x1c160c[_0x21a2('0x18')]?_0x1c160c[_0x21a2('0x18')][_0x21a2('0x1c')]?_['map'](_0x1c160c[_0x21a2('0x18')][_0x21a2('0x1c')],function(_0x1eeff4){return{'model':db[_0x1eeff4['model']],'as':_0x1eeff4['as'],'attributes':_0x1eeff4[_0x21a2('0x1a')],'include':_0x1eeff4[_0x21a2('0x1c')]?_[_0x21a2('0x1d')](_0x1eeff4[_0x21a2('0x1c')],function(_0xd62b1b){return{'model':db[_0xd62b1b[_0x21a2('0x1e')]],'as':_0xd62b1b['as'],'attributes':_0xd62b1b[_0x21a2('0x1a')],'include':_0xd62b1b[_0x21a2('0x1c')]?_[_0x21a2('0x1d')](_0xd62b1b['include'],function(_0x5e943d){return{'model':db[_0x5e943d[_0x21a2('0x1e')]],'as':_0x5e943d['as'],'attributes':_0x5e943d[_0x21a2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49d056){logger[_0x21a2('0x13')](_0x21a2('0x16'),_0x1c160c);logger[_0x21a2('0x1f')]('GetCmHopper',_0x1c160c,JSON[_0x21a2('0xf')](_0x49d056));_0x1e6dd1(_0x49d056);})['catch'](function(_0x95fd19){logger[_0x21a2('0x10')]('GetCmHopper',_0x95fd19[_0x21a2('0x12')],_0x1c160c);_0x6d0610(_0x368792[_0x21a2('0x10')](0x1f4,_0x95fd19['message']));});});};exports['ShowCmHopper']=function(_0x2def83){var _0x1e55a4=this;return new Promise(function(_0x314b5b,_0x38fb9d){return db[_0x21a2('0x20')][_0x21a2('0x21')]({'raw':_0x2def83['options']?_0x2def83[_0x21a2('0x18')][_0x21a2('0x19')]===undefined?!![]:![]:!![],'where':_0x2def83[_0x21a2('0x18')]?_0x2def83[_0x21a2('0x18')]['where']||null:null,'attributes':_0x2def83[_0x21a2('0x18')]?_0x2def83[_0x21a2('0x18')]['attributes']||null:null,'include':_0x2def83[_0x21a2('0x18')]?_0x2def83['options']['include']?_['map'](_0x2def83[_0x21a2('0x18')][_0x21a2('0x1c')],function(_0x2757a7){return{'model':db[_0x2757a7[_0x21a2('0x1e')]],'as':_0x2757a7['as'],'attributes':_0x2757a7[_0x21a2('0x1a')],'include':_0x2757a7[_0x21a2('0x1c')]?_[_0x21a2('0x1d')](_0x2757a7[_0x21a2('0x1c')],function(_0xd5f7e6){return{'model':db[_0xd5f7e6[_0x21a2('0x1e')]],'as':_0xd5f7e6['as'],'attributes':_0xd5f7e6[_0x21a2('0x1a')],'include':_0xd5f7e6[_0x21a2('0x1c')]?_[_0x21a2('0x1d')](_0xd5f7e6[_0x21a2('0x1c')],function(_0x548d3e){return{'model':db[_0x548d3e[_0x21a2('0x1e')]],'as':_0x548d3e['as'],'attributes':_0x548d3e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d75bc){logger[_0x21a2('0x13')](_0x21a2('0x22'),_0x2def83);logger[_0x21a2('0x1f')](_0x21a2('0x22'),_0x2def83,JSON[_0x21a2('0xf')](_0x2d75bc));_0x314b5b(_0x2d75bc);})[_0x21a2('0x15')](function(_0x327607){logger[_0x21a2('0x10')](_0x21a2('0x22'),_0x327607[_0x21a2('0x12')],_0x2def83);_0x38fb9d(_0x1e55a4[_0x21a2('0x10')](0x1f4,_0x327607[_0x21a2('0x12')]));});});};exports['CreateCmHopper']=function(_0x5633f1){var _0x505367=this;return new Promise(function(_0xd1b320,_0x274d0c){return db[_0x21a2('0x20')][_0x21a2('0x23')](_0x5633f1[_0x21a2('0x24')],{'raw':_0x5633f1[_0x21a2('0x18')]?_0x5633f1[_0x21a2('0x18')][_0x21a2('0x19')]===undefined?!![]:![]:!![]})[_0x21a2('0xc')](function(_0x3fb1b0){logger['info'](_0x21a2('0x25'),_0x5633f1);logger[_0x21a2('0x1f')]('CreateCmHopper',_0x5633f1,JSON[_0x21a2('0xf')](_0x3fb1b0));_0xd1b320(_0x3fb1b0);})[_0x21a2('0x15')](function(_0x5222f8){logger[_0x21a2('0x10')]('CreateCmHopper',_0x5222f8[_0x21a2('0x12')],_0x5633f1);_0x274d0c(_0x505367['error'](0x1f4,_0x5222f8[_0x21a2('0x12')]));});});};exports['UpdateCmHopper']=function(_0x40f6ea){var _0x1153bd=this;return new Promise(function(_0x3299d9,_0x329835){return db[_0x21a2('0x20')][_0x21a2('0x26')](_0x40f6ea[_0x21a2('0x24')],{'raw':_0x40f6ea[_0x21a2('0x18')]?_0x40f6ea['options'][_0x21a2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40f6ea[_0x21a2('0x18')]?_0x40f6ea[_0x21a2('0x18')][_0x21a2('0x27')]||null:null,'attributes':_0x40f6ea[_0x21a2('0x18')]?_0x40f6ea[_0x21a2('0x18')]['attributes']||null:null,'limit':_0x40f6ea[_0x21a2('0x18')]?_0x40f6ea['options'][_0x21a2('0x1b')]||null:null})['then'](function(_0x558363){logger[_0x21a2('0x13')]('UpdateCmHopper',_0x40f6ea);logger[_0x21a2('0x1f')]('UpdateCmHopper',_0x40f6ea,JSON[_0x21a2('0xf')](_0x558363));_0x3299d9(_0x558363);})[_0x21a2('0x15')](function(_0x1381dc){logger[_0x21a2('0x10')](_0x21a2('0x28'),_0x1381dc[_0x21a2('0x12')],_0x40f6ea);_0x329835(_0x1153bd[_0x21a2('0x10')](0x1f4,_0x1381dc[_0x21a2('0x12')]));});});};exports['DestroyCmHopper']=function(_0xd30937){var _0x32f616=this;return new Promise(function(_0x288bef,_0x22cf41){return db[_0x21a2('0x20')]['destroy']({'where':_0xd30937['options']?_0xd30937['options']['where']||null:null})['then'](function(_0x5be48e){logger[_0x21a2('0x13')]('DestroyCmHopper',_0xd30937);logger['debug']('DestroyCmHopper',_0xd30937,JSON['stringify'](_0x5be48e));_0x288bef(_0x5be48e);})['catch'](function(_0x5e6ac6){logger[_0x21a2('0x10')](_0x21a2('0x29'),_0x5e6ac6[_0x21a2('0x12')],_0xd30937);_0x22cf41(_0x32f616[_0x21a2('0x10')](0x1f4,_0x5e6ac6[_0x21a2('0x12')]));});});};exports['GetContactDialer']=function(_0x520928){var _0x284f62=this;return new Promise(function(_0x534ff5,_0x223571){return db['CmContact'][_0x21a2('0x2a')]()['then'](function(_0x3cf734){return db[_0x21a2('0x2b')][_0x21a2('0x2c')](function(_0x12a1cd){return db['CmHopper']['findAll']({'where':_0x520928[_0x21a2('0x18')]?_0x520928[_0x21a2('0x18')][_0x21a2('0x27')]||null:null,'attributes':_0x520928['options']?_0x520928[_0x21a2('0x18')][_0x21a2('0x1a')]||null:null,'limit':_0x520928['options']?_0x520928['options'][_0x21a2('0x1b')]||null:null,'order':_0x520928[_0x21a2('0x18')]?_0x520928[_0x21a2('0x18')][_0x21a2('0x2d')]||null:null,'transaction':_0x12a1cd,'lock':_0x12a1cd[_0x21a2('0x2e')][_0x21a2('0x2f')],'include':[{'model':db[_0x21a2('0x30')],'as':'Contact','attributes':_[_0x21a2('0x31')](_0x3cf734)},{'model':db[_0x21a2('0x32')],'as':'Agent','attributes':['id',_0x21a2('0x33'),_0x21a2('0x34')]}]})[_0x21a2('0xc')](function(_0xcee4c6){var _0x22c5f8=[];var _0x325f1f=[];for(var _0xf52735=0x0;_0xf52735<_0xcee4c6[_0x21a2('0x35')];_0xf52735+=0x1){if(!_0x325f1f['includes'](_0xcee4c6[_0xf52735]['UserId'])){_0x325f1f['push'](_0xcee4c6[_0xf52735][_0x21a2('0x36')]);_0x22c5f8['push'](_0xcee4c6[_0xf52735]['update'](_0x520928[_0x21a2('0x24')],{'transaction':_0x12a1cd}));}}return BPromise[_0x21a2('0x37')](_0x22c5f8);});})[_0x21a2('0xc')](function(_0x16f137){logger[_0x21a2('0x13')](_0x21a2('0x38'),_0x520928);logger[_0x21a2('0x1f')](_0x21a2('0x38'),_0x520928,JSON['stringify'](_0x16f137));_0x534ff5(_0x16f137);})['catch'](function(_0x18aaef){logger['error'](_0x21a2('0x38'),_0x18aaef[_0x21a2('0x12')],_0x520928);_0x223571(_0x284f62['error'](0x1f4,_0x18aaef['message']));});});});};exports['MoveContactManagedDialer']=function(_0x5c592b){var _0x2ad8a9=this;return new Promise(function(_0x593800,_0x498194){return db[_0x21a2('0x2b')][_0x21a2('0x2c')](function(_0x1ecb66){return db[_0x21a2('0x39')][_0x21a2('0x23')](_0x5c592b['body'],{'raw':_0x5c592b[_0x21a2('0x18')]?_0x5c592b[_0x21a2('0x18')][_0x21a2('0x19')]===undefined?!![]:![]:!![],'transaction':_0x1ecb66})[_0x21a2('0xc')](function(){return db[_0x21a2('0x20')]['destroy']({'where':_0x5c592b['options']?_0x5c592b[_0x21a2('0x18')][_0x21a2('0x27')]||null:null,'transaction':_0x1ecb66});});})['then'](function(_0x1c2dae){logger[_0x21a2('0x13')]('MoveContactManagedDialer',_0x5c592b);logger[_0x21a2('0x1f')](_0x21a2('0x3a'),_0x5c592b,JSON[_0x21a2('0xf')](_0x1c2dae));_0x593800(_0x1c2dae);})['catch'](function(_0x4af987){logger[_0x21a2('0x10')]('MoveContactManagedDialer',_0x4af987[_0x21a2('0x12')],_0x5c592b);_0x498194(_0x2ad8a9[_0x21a2('0x10')](0x1f4,_0x4af987['message']));});});};exports[_0x21a2('0x3b')]=function(_0x32ce82){var _0x143f68=this;return new Promise(function(_0x516163,_0x230937){return db[_0x21a2('0x20')]['findAll']({'raw':_0x32ce82[_0x21a2('0x18')]?_0x32ce82['options'][_0x21a2('0x19')]===undefined?!![]:![]:!![],'where':_0x32ce82[_0x21a2('0x18')]?_0x32ce82['options']['where']||null:null,'attributes':[[db[_0x21a2('0x2b')]['fn'](_0x21a2('0x3c'),db[_0x21a2('0x2b')]['fn']('IF',db[_0x21a2('0x2b')][_0x21a2('0x3d')](_0x21a2('0x3e')+util[_0x21a2('0x3f')]('\x22%s\x22',moment()[_0x21a2('0x3f')](_0x21a2('0x40')))+_0x21a2('0x41')))),_0x21a2('0x42')]]})[_0x21a2('0xc')](function(_0x5848c0){logger[_0x21a2('0x13')](_0x21a2('0x3b'),_0x32ce82);logger[_0x21a2('0x1f')](_0x21a2('0x3b'),_0x32ce82,JSON[_0x21a2('0xf')](_0x5848c0));_0x516163(_0x5848c0);})[_0x21a2('0x15')](function(_0x529be8){logger[_0x21a2('0x10')]('CountReScheduled',_0x529be8['message'],_0x32ce82);_0x230937(_0x143f68[_0x21a2('0x10')](0x1f4,_0x529be8[_0x21a2('0x12')]));});});};exports[_0x21a2('0x43')]=function(_0x2cf404){var _0x3de957=this;return new Promise(function(_0x131a43,_0x944e05){return db['CmContact'][_0x21a2('0x2a')]()[_0x21a2('0xc')](function(_0x4be77f){return db[_0x21a2('0x2b')]['transaction'](function(_0xd90cca){return db[_0x21a2('0x20')]['findAll']({'where':_0x2cf404[_0x21a2('0x18')]?_0x2cf404[_0x21a2('0x18')][_0x21a2('0x27')]||null:null,'attributes':_0x2cf404[_0x21a2('0x18')]?_0x2cf404[_0x21a2('0x18')]['attributes']||null:null,'limit':0x1,'order':_0x2cf404[_0x21a2('0x18')]?_0x2cf404[_0x21a2('0x18')][_0x21a2('0x2d')]||null:null,'group':db['CmHopper'][_0x21a2('0x36')],'transaction':_0xd90cca,'lock':_0xd90cca[_0x21a2('0x2e')]['UPDATE'],'include':_0x2cf404[_0x21a2('0x18')]?_0x2cf404[_0x21a2('0x18')][_0x21a2('0x1c')]?_[_0x21a2('0x1d')](_0x2cf404[_0x21a2('0x18')][_0x21a2('0x1c')],function(_0x25603b){return{'model':db[_0x25603b[_0x21a2('0x1e')]],'as':_0x25603b['as'],'attributes':_0x25603b[_0x21a2('0x1a')],'include':_0x25603b[_0x21a2('0x1c')]?_[_0x21a2('0x1d')](_0x25603b[_0x21a2('0x1c')],function(_0x139d25){return{'model':db[_0x139d25[_0x21a2('0x1e')]],'as':_0x139d25['as'],'attributes':_0x139d25[_0x21a2('0x1a')],'include':_0x139d25[_0x21a2('0x1c')]?_[_0x21a2('0x1d')](_0x139d25[_0x21a2('0x1c')],function(_0x191ef3){return{'model':db[_0x191ef3[_0x21a2('0x1e')]],'as':_0x191ef3['as'],'attributes':_0x191ef3[_0x21a2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x21a2('0xc')](function(_0x17e81a){var _0x1f3bef=[];for(var _0x33bec7=0x0;_0x33bec7<_0x17e81a[_0x21a2('0x35')];_0x33bec7+=0x1){_0x1f3bef[_0x21a2('0x44')](_0x17e81a[_0x33bec7][_0x21a2('0x26')](_0x2cf404[_0x21a2('0x24')],{'transaction':_0xd90cca}));}return BPromise[_0x21a2('0x37')](_0x1f3bef);});})['then'](function(_0x23332b){logger[_0x21a2('0x13')](_0x21a2('0x43'),_0x2cf404);logger[_0x21a2('0x1f')](_0x21a2('0x43'),_0x2cf404,JSON[_0x21a2('0xf')](_0x23332b));_0x131a43(_0x23332b);})[_0x21a2('0x15')](function(_0x124ad2){logger[_0x21a2('0x10')]('GetContactRecallMe',_0x124ad2[_0x21a2('0x12')],_0x2cf404);_0x944e05(_0x3de957[_0x21a2('0x10')](0x1f4,_0x124ad2[_0x21a2('0x12')]));});});});};exports[_0x21a2('0x45')]=function(_0x444bc6){var _0x156bd9=this;return new Promise(function(_0x45089c,_0x1fd3a2){db['CmContact'][_0x21a2('0x2a')]()[_0x21a2('0xc')](function(_0x11d150){return db[_0x21a2('0x20')][_0x21a2('0x17')]({'raw':_0x444bc6[_0x21a2('0x18')]?_0x444bc6['options']['raw']===undefined?!![]:![]:!![],'where':_0x444bc6[_0x21a2('0x18')]?_0x444bc6[_0x21a2('0x18')]['where']||null:null,'attributes':_0x444bc6[_0x21a2('0x18')]?_0x444bc6[_0x21a2('0x18')]['attributes']||null:null,'limit':_0x444bc6[_0x21a2('0x18')]?_0x444bc6[_0x21a2('0x18')][_0x21a2('0x1b')]||null:null,'include':_0x444bc6[_0x21a2('0x18')]?_0x444bc6[_0x21a2('0x18')][_0x21a2('0x1c')]?_[_0x21a2('0x1d')](_0x444bc6['options'][_0x21a2('0x1c')],function(_0x5cd99a){return{'model':db[_0x5cd99a[_0x21a2('0x1e')]],'as':_0x5cd99a['as'],'attributes':_0x5cd99a['as']===_0x21a2('0x46')?_['keys'](_0x11d150):_0x5cd99a[_0x21a2('0x1a')],'include':_0x5cd99a[_0x21a2('0x1c')]?_[_0x21a2('0x1d')](_0x5cd99a[_0x21a2('0x1c')],function(_0x5297df){return{'model':db[_0x5297df[_0x21a2('0x1e')]],'as':_0x5297df['as'],'attributes':_0x5297df[_0x21a2('0x1a')],'include':_0x5297df['include']?_[_0x21a2('0x1d')](_0x5297df[_0x21a2('0x1c')],function(_0x3af631){return{'model':db[_0x3af631[_0x21a2('0x1e')]],'as':_0x3af631['as'],'attributes':_0x3af631[_0x21a2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x21a2('0xc')](function(_0x49f975){logger[_0x21a2('0x13')](_0x21a2('0x16'),_0x444bc6);logger[_0x21a2('0x1f')](_0x21a2('0x16'),_0x444bc6,JSON['stringify'](_0x49f975));_0x45089c(_0x49f975);})[_0x21a2('0x15')](function(_0x3a6116){logger['error'](_0x21a2('0x16'),_0x3a6116[_0x21a2('0x12')],_0x444bc6);_0x1fd3a2(_0x156bd9[_0x21a2('0x10')](0x1f4,_0x3a6116[_0x21a2('0x12')]));});});});};exports[_0x21a2('0x47')]=function(_0x176903){console[_0x21a2('0x48')](_0x21a2('0x49'),_0x176903);console[_0x21a2('0x48')]('phone\x20value',_0x176903['options'][_0x21a2('0x27')]['phone']);_this=this;return new Promise(function(_0x145219,_0x47bd4d){return db[_0x21a2('0x30')][_0x21a2('0x4a')]({'raw':!![],'where':{'phone':_0x176903['options'][_0x21a2('0x27')]['phone']},'attributes':['id',_0x21a2('0x4b')],'order':[['id',_0x21a2('0x4c')]]})['then'](function(_0x89a828){console[_0x21a2('0x48')]('getcontactbyohone',_0x89a828);logger['info'](_0x21a2('0x4d'),_0x176903);logger[_0x21a2('0x1f')]('getContactByPhone',_0x176903,JSON[_0x21a2('0xf')](_0x89a828));_0x145219(_0x89a828);})['catch'](function(_0x26f348){logger[_0x21a2('0x10')](_0x21a2('0x4d'),_0x26f348['message'],_0x176903);_0x47bd4d(_this['error'](0x1f4,_0x26f348[_0x21a2('0x12')]));});});};
\ No newline at end of file
+var _0xbc8a=['includes','push','UserId','all','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','literal','format','\x20,\x201,\x20null','contactsRescheduled','LOCK','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','getContactByPhone','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopper,\x20%s,\x20%s','info','result','catch','GetCmHopper','CmHopper','findAll','raw','options','where','attributes','limit','map','model','include','debug','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','order','UPDATE','CmContact','Contact','keys','User','name','voicePause','length'];(function(_0x33539a,_0xab9aa5){var _0x1a99a7=function(_0x3e95db){while(--_0x3e95db){_0x33539a['push'](_0x33539a['shift']());}};_0x1a99a7(++_0xab9aa5);}(_0xbc8a,0x190));var _0xabc8=function(_0x42e4e0,_0x57ab9c){_0x42e4e0=_0x42e4e0-0x0;var _0x5ea33c=_0xbc8a[_0x42e4e0];return _0x5ea33c;};'use strict';var _=require('lodash');var util=require(_0xabc8('0x0'));var moment=require('moment');var BPromise=require(_0xabc8('0x1'));var rs=require(_0xabc8('0x2'));var fs=require('fs');var Redis=require(_0xabc8('0x3'));var db=require(_0xabc8('0x4'))['db'];var utils=require(_0xabc8('0x5'));var logger=require(_0xabc8('0x6'))(_0xabc8('0x7'));var config=require(_0xabc8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xabc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3edb5d,_0x277121,_0x14d9a2){return new BPromise(function(_0x418d32,_0x4ec0b0){return client[_0xabc8('0xa')](_0x3edb5d,_0x14d9a2)[_0xabc8('0xb')](function(_0x3c3c3f){logger['info']('CmHopper,\x20%s,\x20%s',_0x277121,_0xabc8('0xc'));logger['debug'](_0xabc8('0xd'),_0x277121,'request\x20sent',JSON[_0xabc8('0xe')](_0x3c3c3f));if(_0x3c3c3f['error']){if(_0x3c3c3f[_0xabc8('0xf')][_0xabc8('0x10')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x277121,_0x3c3c3f[_0xabc8('0xf')][_0xabc8('0x11')]);return _0x4ec0b0(_0x3c3c3f['error']['message']);}logger['error'](_0xabc8('0x12'),_0x277121,_0x3c3c3f[_0xabc8('0xf')][_0xabc8('0x11')]);return _0x418d32(_0x3c3c3f[_0xabc8('0xf')][_0xabc8('0x11')]);}else{logger[_0xabc8('0x13')](_0xabc8('0x12'),_0x277121,_0xabc8('0xc'));_0x418d32(_0x3c3c3f[_0xabc8('0x14')][_0xabc8('0x11')]);}})[_0xabc8('0x15')](function(_0x497e80){logger['error'](_0xabc8('0x12'),_0x277121,_0x497e80);_0x4ec0b0(_0x497e80);});});}exports[_0xabc8('0x16')]=function(_0x1d6911){var _0x40a78f=this;return new Promise(function(_0x161c5c,_0x44c252){return db[_0xabc8('0x17')][_0xabc8('0x18')]({'raw':_0x1d6911['options']?_0x1d6911['options'][_0xabc8('0x19')]===undefined?!![]:![]:!![],'where':_0x1d6911[_0xabc8('0x1a')]?_0x1d6911['options'][_0xabc8('0x1b')]||null:null,'attributes':_0x1d6911['options']?_0x1d6911['options'][_0xabc8('0x1c')]||null:null,'limit':_0x1d6911[_0xabc8('0x1a')]?_0x1d6911['options'][_0xabc8('0x1d')]||null:null,'include':_0x1d6911['options']?_0x1d6911[_0xabc8('0x1a')]['include']?_[_0xabc8('0x1e')](_0x1d6911['options']['include'],function(_0x461d10){return{'model':db[_0x461d10[_0xabc8('0x1f')]],'as':_0x461d10['as'],'attributes':_0x461d10['attributes'],'include':_0x461d10[_0xabc8('0x20')]?_[_0xabc8('0x1e')](_0x461d10[_0xabc8('0x20')],function(_0x58b5b4){return{'model':db[_0x58b5b4[_0xabc8('0x1f')]],'as':_0x58b5b4['as'],'attributes':_0x58b5b4[_0xabc8('0x1c')],'include':_0x58b5b4[_0xabc8('0x20')]?_['map'](_0x58b5b4[_0xabc8('0x20')],function(_0x3a57a0){return{'model':db[_0x3a57a0[_0xabc8('0x1f')]],'as':_0x3a57a0['as'],'attributes':_0x3a57a0[_0xabc8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xabc8('0xb')](function(_0x13fb3d){logger[_0xabc8('0x13')](_0xabc8('0x16'),_0x1d6911);logger[_0xabc8('0x21')](_0xabc8('0x16'),_0x1d6911,JSON['stringify'](_0x13fb3d));_0x161c5c(_0x13fb3d);})[_0xabc8('0x15')](function(_0x6d3886){logger[_0xabc8('0xf')](_0xabc8('0x16'),_0x6d3886[_0xabc8('0x11')],_0x1d6911);_0x44c252(_0x40a78f[_0xabc8('0xf')](0x1f4,_0x6d3886[_0xabc8('0x11')]));});});};exports[_0xabc8('0x22')]=function(_0x51b7ce){var _0x50cecd=this;return new Promise(function(_0x121d72,_0x22cedf){return db[_0xabc8('0x17')][_0xabc8('0x23')]({'raw':_0x51b7ce[_0xabc8('0x1a')]?_0x51b7ce[_0xabc8('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x51b7ce[_0xabc8('0x1a')]?_0x51b7ce[_0xabc8('0x1a')][_0xabc8('0x1b')]||null:null,'attributes':_0x51b7ce['options']?_0x51b7ce[_0xabc8('0x1a')][_0xabc8('0x1c')]||null:null,'include':_0x51b7ce[_0xabc8('0x1a')]?_0x51b7ce[_0xabc8('0x1a')][_0xabc8('0x20')]?_[_0xabc8('0x1e')](_0x51b7ce[_0xabc8('0x1a')]['include'],function(_0x23f95d){return{'model':db[_0x23f95d[_0xabc8('0x1f')]],'as':_0x23f95d['as'],'attributes':_0x23f95d[_0xabc8('0x1c')],'include':_0x23f95d[_0xabc8('0x20')]?_[_0xabc8('0x1e')](_0x23f95d['include'],function(_0x431fa5){return{'model':db[_0x431fa5['model']],'as':_0x431fa5['as'],'attributes':_0x431fa5[_0xabc8('0x1c')],'include':_0x431fa5[_0xabc8('0x20')]?_[_0xabc8('0x1e')](_0x431fa5[_0xabc8('0x20')],function(_0x3d3a60){return{'model':db[_0x3d3a60[_0xabc8('0x1f')]],'as':_0x3d3a60['as'],'attributes':_0x3d3a60['attributes']};}):[]};}):[]};}):[]:[]})[_0xabc8('0xb')](function(_0x40ea93){logger[_0xabc8('0x13')](_0xabc8('0x22'),_0x51b7ce);logger[_0xabc8('0x21')](_0xabc8('0x22'),_0x51b7ce,JSON['stringify'](_0x40ea93));_0x121d72(_0x40ea93);})[_0xabc8('0x15')](function(_0x52c48a){logger[_0xabc8('0xf')](_0xabc8('0x22'),_0x52c48a[_0xabc8('0x11')],_0x51b7ce);_0x22cedf(_0x50cecd['error'](0x1f4,_0x52c48a[_0xabc8('0x11')]));});});};exports[_0xabc8('0x24')]=function(_0x4fc2c6){var _0x2cba7e=this;return new Promise(function(_0x38c32f,_0x500d07){return db[_0xabc8('0x17')][_0xabc8('0x25')](_0x4fc2c6[_0xabc8('0x26')],{'raw':_0x4fc2c6[_0xabc8('0x1a')]?_0x4fc2c6['options']['raw']===undefined?!![]:![]:!![]})[_0xabc8('0xb')](function(_0x4b4f02){logger['info']('CreateCmHopper',_0x4fc2c6);logger[_0xabc8('0x21')]('CreateCmHopper',_0x4fc2c6,JSON['stringify'](_0x4b4f02));_0x38c32f(_0x4b4f02);})[_0xabc8('0x15')](function(_0x3aa78b){logger[_0xabc8('0xf')](_0xabc8('0x24'),_0x3aa78b['message'],_0x4fc2c6);_0x500d07(_0x2cba7e[_0xabc8('0xf')](0x1f4,_0x3aa78b['message']));});});};exports[_0xabc8('0x27')]=function(_0xad7932){var _0x3dfc5a=this;return new Promise(function(_0x1ed936,_0x207e70){return db[_0xabc8('0x17')][_0xabc8('0x28')](_0xad7932[_0xabc8('0x26')],{'raw':_0xad7932[_0xabc8('0x1a')]?_0xad7932[_0xabc8('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xad7932[_0xabc8('0x1a')]?_0xad7932[_0xabc8('0x1a')]['where']||null:null,'attributes':_0xad7932[_0xabc8('0x1a')]?_0xad7932[_0xabc8('0x1a')][_0xabc8('0x1c')]||null:null,'limit':_0xad7932[_0xabc8('0x1a')]?_0xad7932[_0xabc8('0x1a')]['limit']||null:null})[_0xabc8('0xb')](function(_0x5ddbe4){logger[_0xabc8('0x13')](_0xabc8('0x27'),_0xad7932);logger['debug'](_0xabc8('0x27'),_0xad7932,JSON['stringify'](_0x5ddbe4));_0x1ed936(_0x5ddbe4);})[_0xabc8('0x15')](function(_0x2ab27d){logger[_0xabc8('0xf')](_0xabc8('0x27'),_0x2ab27d[_0xabc8('0x11')],_0xad7932);_0x207e70(_0x3dfc5a[_0xabc8('0xf')](0x1f4,_0x2ab27d['message']));});});};exports[_0xabc8('0x29')]=function(_0x103b6f){var _0xaa4f4e=this;return new Promise(function(_0x122785,_0x2a2f83){return db[_0xabc8('0x17')][_0xabc8('0x2a')]({'where':_0x103b6f[_0xabc8('0x1a')]?_0x103b6f[_0xabc8('0x1a')]['where']||null:null})[_0xabc8('0xb')](function(_0x452c2f){logger['info']('DestroyCmHopper',_0x103b6f);logger[_0xabc8('0x21')](_0xabc8('0x29'),_0x103b6f,JSON[_0xabc8('0xe')](_0x452c2f));_0x122785(_0x452c2f);})['catch'](function(_0x46de6){logger['error'](_0xabc8('0x29'),_0x46de6[_0xabc8('0x11')],_0x103b6f);_0x2a2f83(_0xaa4f4e[_0xabc8('0xf')](0x1f4,_0x46de6[_0xabc8('0x11')]));});});};exports[_0xabc8('0x2b')]=function(_0x5cd96e){var _0x29d74d=this;return new Promise(function(_0x145756,_0x2a3edb){return db['CmContact'][_0xabc8('0x2c')]()[_0xabc8('0xb')](function(_0xf90552){return db[_0xabc8('0x2d')][_0xabc8('0x2e')](function(_0x1d096e){return db[_0xabc8('0x17')][_0xabc8('0x18')]({'where':_0x5cd96e['options']?_0x5cd96e[_0xabc8('0x1a')][_0xabc8('0x1b')]||null:null,'attributes':_0x5cd96e[_0xabc8('0x1a')]?_0x5cd96e[_0xabc8('0x1a')][_0xabc8('0x1c')]||null:null,'limit':_0x5cd96e[_0xabc8('0x1a')]?_0x5cd96e[_0xabc8('0x1a')][_0xabc8('0x1d')]||null:null,'order':_0x5cd96e['options']?_0x5cd96e[_0xabc8('0x1a')][_0xabc8('0x2f')]||null:null,'transaction':_0x1d096e,'lock':_0x1d096e['LOCK'][_0xabc8('0x30')],'include':[{'model':db[_0xabc8('0x31')],'as':_0xabc8('0x32'),'attributes':_[_0xabc8('0x33')](_0xf90552)},{'model':db[_0xabc8('0x34')],'as':'Agent','attributes':['id',_0xabc8('0x35'),_0xabc8('0x36')]}]})['then'](function(_0x4c0752){var _0x3ae64a=[];var _0x5e722a=[];for(var _0x342d71=0x0;_0x342d71<_0x4c0752[_0xabc8('0x37')];_0x342d71+=0x1){if(!_0x5e722a[_0xabc8('0x38')](_0x4c0752[_0x342d71]['UserId'])){_0x5e722a[_0xabc8('0x39')](_0x4c0752[_0x342d71][_0xabc8('0x3a')]);_0x3ae64a['push'](_0x4c0752[_0x342d71]['update'](_0x5cd96e[_0xabc8('0x26')],{'transaction':_0x1d096e}));}}return BPromise[_0xabc8('0x3b')](_0x3ae64a);});})[_0xabc8('0xb')](function(_0x4660c6){logger['info'](_0xabc8('0x2b'),_0x5cd96e);logger[_0xabc8('0x21')]('GetContactDialer',_0x5cd96e,JSON[_0xabc8('0xe')](_0x4660c6));_0x145756(_0x4660c6);})[_0xabc8('0x15')](function(_0x1a6cc9){logger[_0xabc8('0xf')](_0xabc8('0x2b'),_0x1a6cc9[_0xabc8('0x11')],_0x5cd96e);_0x2a3edb(_0x29d74d[_0xabc8('0xf')](0x1f4,_0x1a6cc9[_0xabc8('0x11')]));});});});};exports['MoveContactManagedDialer']=function(_0x18a9dc){var _0x3321e9=this;return new Promise(function(_0x3f9283,_0x5e92a4){return db['sequelize'][_0xabc8('0x2e')](function(_0x188f87){return db[_0xabc8('0x3c')]['create'](_0x18a9dc[_0xabc8('0x26')],{'raw':_0x18a9dc['options']?_0x18a9dc[_0xabc8('0x1a')][_0xabc8('0x19')]===undefined?!![]:![]:!![],'transaction':_0x188f87})['then'](function(){return db[_0xabc8('0x17')]['destroy']({'where':_0x18a9dc[_0xabc8('0x1a')]?_0x18a9dc[_0xabc8('0x1a')][_0xabc8('0x1b')]||null:null,'transaction':_0x188f87});});})[_0xabc8('0xb')](function(_0x1c2c5e){logger[_0xabc8('0x13')](_0xabc8('0x3d'),_0x18a9dc);logger[_0xabc8('0x21')]('MoveContactManagedDialer',_0x18a9dc,JSON[_0xabc8('0xe')](_0x1c2c5e));_0x3f9283(_0x1c2c5e);})[_0xabc8('0x15')](function(_0xfdfc75){logger[_0xabc8('0xf')](_0xabc8('0x3d'),_0xfdfc75[_0xabc8('0x11')],_0x18a9dc);_0x5e92a4(_0x3321e9['error'](0x1f4,_0xfdfc75[_0xabc8('0x11')]));});});};exports[_0xabc8('0x3e')]=function(_0x144c28){var _0x56e22f=this;return new Promise(function(_0x382ecb,_0x34169c){return db[_0xabc8('0x17')][_0xabc8('0x18')]({'raw':_0x144c28[_0xabc8('0x1a')]?_0x144c28[_0xabc8('0x1a')][_0xabc8('0x19')]===undefined?!![]:![]:!![],'where':_0x144c28[_0xabc8('0x1a')]?_0x144c28['options'][_0xabc8('0x1b')]||null:null,'attributes':[[db[_0xabc8('0x2d')]['fn'](_0xabc8('0x3f'),db[_0xabc8('0x2d')]['fn']('IF',db[_0xabc8('0x2d')][_0xabc8('0x40')]('`scheduledat`\x20>=\x20'+util[_0xabc8('0x41')]('\x22%s\x22',moment()[_0xabc8('0x41')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xabc8('0x42')))),_0xabc8('0x43')]]})[_0xabc8('0xb')](function(_0x19b149){logger[_0xabc8('0x13')](_0xabc8('0x3e'),_0x144c28);logger[_0xabc8('0x21')](_0xabc8('0x3e'),_0x144c28,JSON['stringify'](_0x19b149));_0x382ecb(_0x19b149);})[_0xabc8('0x15')](function(_0x2b8ba0){logger[_0xabc8('0xf')](_0xabc8('0x3e'),_0x2b8ba0['message'],_0x144c28);_0x34169c(_0x56e22f[_0xabc8('0xf')](0x1f4,_0x2b8ba0[_0xabc8('0x11')]));});});};exports['GetContactRecallMe']=function(_0x3ad31b){var _0x28dfdd=this;return new Promise(function(_0x1f691d,_0x289b9e){return db[_0xabc8('0x31')][_0xabc8('0x2c')]()['then'](function(_0x59c10c){return db['sequelize']['transaction'](function(_0x1bd5ef){return db[_0xabc8('0x17')]['findAll']({'where':_0x3ad31b[_0xabc8('0x1a')]?_0x3ad31b['options']['where']||null:null,'attributes':_0x3ad31b['options']?_0x3ad31b[_0xabc8('0x1a')][_0xabc8('0x1c')]||null:null,'limit':0x1,'order':_0x3ad31b[_0xabc8('0x1a')]?_0x3ad31b[_0xabc8('0x1a')][_0xabc8('0x2f')]||null:null,'group':db[_0xabc8('0x17')]['UserId'],'transaction':_0x1bd5ef,'lock':_0x1bd5ef[_0xabc8('0x44')][_0xabc8('0x30')],'include':_0x3ad31b[_0xabc8('0x1a')]?_0x3ad31b[_0xabc8('0x1a')][_0xabc8('0x20')]?_[_0xabc8('0x1e')](_0x3ad31b[_0xabc8('0x1a')][_0xabc8('0x20')],function(_0x4d4cc0){return{'model':db[_0x4d4cc0[_0xabc8('0x1f')]],'as':_0x4d4cc0['as'],'attributes':_0x4d4cc0['attributes'],'include':_0x4d4cc0[_0xabc8('0x20')]?_[_0xabc8('0x1e')](_0x4d4cc0['include'],function(_0x3ef93c){return{'model':db[_0x3ef93c['model']],'as':_0x3ef93c['as'],'attributes':_0x3ef93c[_0xabc8('0x1c')],'include':_0x3ef93c[_0xabc8('0x20')]?_['map'](_0x3ef93c[_0xabc8('0x20')],function(_0x5ba1ea){return{'model':db[_0x5ba1ea[_0xabc8('0x1f')]],'as':_0x5ba1ea['as'],'attributes':_0x5ba1ea[_0xabc8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xabc8('0xb')](function(_0x4d0714){var _0x221dbb=[];for(var _0xf92c2b=0x0;_0xf92c2b<_0x4d0714[_0xabc8('0x37')];_0xf92c2b+=0x1){_0x221dbb[_0xabc8('0x39')](_0x4d0714[_0xf92c2b][_0xabc8('0x28')](_0x3ad31b[_0xabc8('0x26')],{'transaction':_0x1bd5ef}));}return BPromise[_0xabc8('0x3b')](_0x221dbb);});})[_0xabc8('0xb')](function(_0x3d6eb8){logger[_0xabc8('0x13')](_0xabc8('0x45'),_0x3ad31b);logger[_0xabc8('0x21')](_0xabc8('0x45'),_0x3ad31b,JSON[_0xabc8('0xe')](_0x3d6eb8));_0x1f691d(_0x3d6eb8);})['catch'](function(_0x49587c){logger[_0xabc8('0xf')](_0xabc8('0x45'),_0x49587c[_0xabc8('0x11')],_0x3ad31b);_0x289b9e(_0x28dfdd[_0xabc8('0xf')](0x1f4,_0x49587c[_0xabc8('0x11')]));});});});};exports[_0xabc8('0x46')]=function(_0x12d818){var _0x52e1c1=this;return new Promise(function(_0x12bb20,_0x55b928){db[_0xabc8('0x31')][_0xabc8('0x2c')]()[_0xabc8('0xb')](function(_0x349b7a){return db[_0xabc8('0x17')][_0xabc8('0x18')]({'raw':_0x12d818[_0xabc8('0x1a')]?_0x12d818[_0xabc8('0x1a')][_0xabc8('0x19')]===undefined?!![]:![]:!![],'where':_0x12d818['options']?_0x12d818['options'][_0xabc8('0x1b')]||null:null,'attributes':_0x12d818['options']?_0x12d818['options'][_0xabc8('0x1c')]||null:null,'limit':_0x12d818['options']?_0x12d818[_0xabc8('0x1a')][_0xabc8('0x1d')]||null:null,'include':_0x12d818[_0xabc8('0x1a')]?_0x12d818[_0xabc8('0x1a')]['include']?_[_0xabc8('0x1e')](_0x12d818[_0xabc8('0x1a')][_0xabc8('0x20')],function(_0x4c3c94){return{'model':db[_0x4c3c94['model']],'as':_0x4c3c94['as'],'attributes':_0x4c3c94['as']==='Contact'?_['keys'](_0x349b7a):_0x4c3c94[_0xabc8('0x1c')],'include':_0x4c3c94[_0xabc8('0x20')]?_[_0xabc8('0x1e')](_0x4c3c94[_0xabc8('0x20')],function(_0xf8149d){return{'model':db[_0xf8149d['model']],'as':_0xf8149d['as'],'attributes':_0xf8149d[_0xabc8('0x1c')],'include':_0xf8149d[_0xabc8('0x20')]?_[_0xabc8('0x1e')](_0xf8149d['include'],function(_0x1c7daf){return{'model':db[_0x1c7daf[_0xabc8('0x1f')]],'as':_0x1c7daf['as'],'attributes':_0x1c7daf['attributes']};}):[]};}):[]};}):[]:[]})[_0xabc8('0xb')](function(_0x2d2937){logger['info']('GetCmHopper',_0x12d818);logger[_0xabc8('0x21')](_0xabc8('0x16'),_0x12d818,JSON['stringify'](_0x2d2937));_0x12bb20(_0x2d2937);})['catch'](function(_0x28c1d5){logger[_0xabc8('0xf')](_0xabc8('0x16'),_0x28c1d5[_0xabc8('0x11')],_0x12d818);_0x55b928(_0x52e1c1[_0xabc8('0xf')](0x1f4,_0x28c1d5['message']));});});});};exports[_0xabc8('0x47')]=function(_0x475a13){_this=this;return new Promise(function(_0x49e9bc,_0x35a9f4){return db[_0xabc8('0x31')][_0xabc8('0x48')]({'raw':!![],'where':{'phone':_0x475a13['options'][_0xabc8('0x1b')][_0xabc8('0x49')]},'attributes':['id',_0xabc8('0x4a')],'order':[['id','DESC']]})[_0xabc8('0xb')](function(_0x3166ce){logger[_0xabc8('0x13')](_0xabc8('0x4b'),_0x475a13);logger[_0xabc8('0x21')](_0xabc8('0x4b'),_0x475a13,JSON[_0xabc8('0xe')](_0x3166ce));_0x49e9bc(_0x3166ce);})[_0xabc8('0x15')](function(_0x5f4a81){logger['error'](_0xabc8('0x4b'),_0x5f4a81[_0xabc8('0x11')],_0x475a13);_0x35a9f4(_this[_0xabc8('0xf')](0x1f4,_0x5f4a81[_0xabc8('0x11')]));});});};
\ No newline at end of file
index 455d9aa..2403e3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032e=['../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','/:id','show','post','create','/preview','getPreview','getTimezone','put','update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x032e,0x124));var _0xe032=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x032e[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe032('0x3'));var interaction=require(_0xe032('0x4'));var config=require(_0xe032('0x5'));var controller=require(_0xe032('0x6'));router[_0xe032('0x7')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0x9')]);router[_0xe032('0x7')](_0xe032('0xa'),auth[_0xe032('0x8')](),controller[_0xe032('0xb')]);router[_0xe032('0x7')](_0xe032('0xc'),auth[_0xe032('0x8')](),controller[_0xe032('0xd')]);router[_0xe032('0x7')](_0xe032('0xe'),auth[_0xe032('0x8')](),controller['getTimezones']);router[_0xe032('0x7')](_0xe032('0xf'),auth[_0xe032('0x8')](),controller[_0xe032('0x10')]);router[_0xe032('0x11')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0x12')]);router['post'](_0xe032('0x13'),auth[_0xe032('0x8')](),controller[_0xe032('0x14')]);router[_0xe032('0x11')]('/timezone',auth[_0xe032('0x8')](),controller[_0xe032('0x15')]);router[_0xe032('0x16')](_0xe032('0xf'),auth[_0xe032('0x8')](),controller[_0xe032('0x17')]);router[_0xe032('0x18')]('/:id',auth[_0xe032('0x8')](),controller[_0xe032('0x19')]);module[_0xe032('0x1a')]=router;
\ No newline at end of file
+var _0x33c5=['getOpenContacts','/timezones','getTimezones','show','post','create','getPreview','/timezone','getTimezone','put','/:id','update','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/opencontacts'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x33c5,0xe6));var _0x533c=function(_0x83609a,_0x4623de){_0x83609a=_0x83609a-0x0;var _0x3de3aa=_0x33c5[_0x83609a];return _0x3de3aa;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var auth=require(_0x533c('0x4'));var interaction=require(_0x533c('0x5'));var config=require(_0x533c('0x6'));var controller=require('./cmHopper.controller');router[_0x533c('0x7')]('/',auth[_0x533c('0x8')](),controller[_0x533c('0x9')]);router[_0x533c('0x7')](_0x533c('0xa'),auth[_0x533c('0x8')](),controller[_0x533c('0xb')]);router[_0x533c('0x7')](_0x533c('0xc'),auth[_0x533c('0x8')](),controller[_0x533c('0xd')]);router[_0x533c('0x7')](_0x533c('0xe'),auth[_0x533c('0x8')](),controller[_0x533c('0xf')]);router[_0x533c('0x7')]('/:id',auth[_0x533c('0x8')](),controller[_0x533c('0x10')]);router[_0x533c('0x11')]('/',auth[_0x533c('0x8')](),controller[_0x533c('0x12')]);router[_0x533c('0x11')]('/preview',auth[_0x533c('0x8')](),controller[_0x533c('0x13')]);router[_0x533c('0x11')](_0x533c('0x14'),auth[_0x533c('0x8')](),controller[_0x533c('0x15')]);router[_0x533c('0x16')](_0x533c('0x17'),auth['isAuthenticated'](),controller[_0x533c('0x18')]);router[_0x533c('0x19')](_0x533c('0x17'),auth[_0x533c('0x8')](),controller['destroy']);module[_0x533c('0x1a')]=router;
\ No newline at end of file
index 0dab496..6f28740 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f02=['DATE','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING'];(function(_0x11c6b8,_0x5b2d7b){var _0x38b38f=function(_0x641ad0){while(--_0x641ad0){_0x11c6b8['push'](_0x11c6b8['shift']());}};_0x38b38f(++_0x5b2d7b);}(_0x8f02,0x13d));var _0x28f0=function(_0x4e721b,_0xc21d93){_0x4e721b=_0x4e721b-0x0;var _0x75927f=_0x8f02[_0x4e721b];return _0x75927f;};'use strict';var moment=require(_0x28f0('0x0'));var Sequelize=require(_0x28f0('0x1'));module[_0x28f0('0x2')]={'CmHopperId':{'type':Sequelize[_0x28f0('0x3')]},'phone':{'type':Sequelize[_0x28f0('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x28f0('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x28f0('0x5')],'defaultValue':moment()['format'](_0x28f0('0x6'))},'countbusyretry':{'type':Sequelize[_0x28f0('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x28f0('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x28f0('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x28f0('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x28f0('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xad77=['INTEGER','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0xad77,0x199));var _0x7ad7=function(_0x19e7e8,_0x2c265c){_0x19e7e8=_0x19e7e8-0x0;var _0x3103dd=_0xad77[_0x19e7e8];return _0x3103dd;};'use strict';var moment=require(_0x7ad7('0x0'));var Sequelize=require('sequelize');module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x7ad7('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x7ad7('0x2')],'defaultValue':moment()[_0x7ad7('0x3')](_0x7ad7('0x4'))},'countbusyretry':{'type':Sequelize[_0x7ad7('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7ad7('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7ad7('0x1')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x7ad7('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7ad7('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7ad7('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index bc0b804..32fb967 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ba6=['get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','error','name','send','index','map','CmHopperAdditionalPhone','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','catch','show','params','rawAttributes','length','include','find','create','body','user'];(function(_0x4f52a0,_0x4fbe9f){var _0x1009f4=function(_0x1a194f){while(--_0x1a194f){_0x4f52a0['push'](_0x4f52a0['shift']());}};_0x1009f4(++_0x4fbe9f);}(_0x4ba6,0x100));var _0x64ba=function(_0x1d5cfa,_0x57efb0){_0x1d5cfa=_0x1d5cfa-0x0;var _0x19a273=_0x4ba6[_0x1d5cfa];return _0x19a273;};'use strict';var pdf=require(_0x64ba('0x0'));var emlformat=require(_0x64ba('0x1'));var rimraf=require(_0x64ba('0x2'));var zipdir=require(_0x64ba('0x3'));var jsonpatch=require(_0x64ba('0x4'));var rp=require(_0x64ba('0x5'));var moment=require(_0x64ba('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x64ba('0x7'));var util=require(_0x64ba('0x8'));var path=require(_0x64ba('0x9'));var sox=require(_0x64ba('0xa'));var csv=require(_0x64ba('0xb'));var ejs=require(_0x64ba('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x64ba('0xd'));var crypto=require(_0x64ba('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x64ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0x64ba('0x10'));var Papa=require('papaparse');var Redis=require(_0x64ba('0x11'));var authService=require(_0x64ba('0x12'));var qs=require(_0x64ba('0x13'));var as=require(_0x64ba('0x14'));var hardwareService=require(_0x64ba('0x15'));var logger=require('../../config/logger')(_0x64ba('0x16'));var utils=require(_0x64ba('0x17'));var config=require(_0x64ba('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18dd3d,_0x4cfab8){_0x4cfab8=_0x4cfab8||0xcc;return function(_0x3bbdb8){if(_0x3bbdb8){return _0x18dd3d[_0x64ba('0x19')](_0x4cfab8);}return _0x18dd3d['status'](_0x4cfab8)[_0x64ba('0x1a')]();};}function respondWithResult(_0x20fda4,_0x1a0537){_0x1a0537=_0x1a0537||0xc8;return function(_0x2a2bc5){if(_0x2a2bc5){return _0x20fda4[_0x64ba('0x1b')](_0x1a0537)[_0x64ba('0x1c')](_0x2a2bc5);}};}function respondWithFilteredResult(_0x4605b1,_0x48fb83){return function(_0x4a432b){if(_0x4a432b){var _0x46e0ae=_0x4a432b[_0x64ba('0x1d')],_0x357354=_0x48fb83[_0x64ba('0x1e')],_0x223fc9=_0x48fb83[_0x64ba('0x1e')]+_0x48fb83[_0x64ba('0x1f')],_0x4d3b65;if(_0x223fc9>=_0x46e0ae){_0x223fc9=_0x46e0ae;_0x4d3b65=0xc8;}else{_0x4d3b65=0xce;}_0x4605b1[_0x64ba('0x1b')](_0x4d3b65);return _0x4605b1[_0x64ba('0x20')]('Content-Range',_0x357354+'-'+_0x223fc9+'/'+_0x46e0ae)[_0x64ba('0x1c')](_0x4a432b);}return null;};}function patchUpdates(_0x3227fc){return function(_0x1b851e){try{jsonpatch[_0x64ba('0x21')](_0x1b851e,_0x3227fc,!![]);}catch(_0x3c5a09){return BPromise[_0x64ba('0x22')](_0x3c5a09);}return _0x1b851e[_0x64ba('0x23')]();};}function saveUpdates(_0xa87ba0,_0x82a103){return function(_0x3a9de0){if(_0x3a9de0){return _0x3a9de0[_0x64ba('0x24')](_0xa87ba0)[_0x64ba('0x25')](function(_0x48ab04){return _0x48ab04;});}return null;};}function removeEntity(_0x768605,_0xca3263){return function(_0x363d0c){if(_0x363d0c){return _0x363d0c[_0x64ba('0x26')]()[_0x64ba('0x25')](function(){var _0x681741=_0x363d0c['get']({'plain':!![]});var _0x503179=_0x64ba('0x27');return db[_0x64ba('0x28')][_0x64ba('0x26')]({'where':{'type':_0x503179,'resourceId':_0x681741['id']}})[_0x64ba('0x25')](function(){return _0x363d0c;});})[_0x64ba('0x25')](function(){_0x768605[_0x64ba('0x1b')](0xcc)[_0x64ba('0x1a')]();});}};}function handleEntityNotFound(_0xe56064,_0x32f079){return function(_0xd81373){if(!_0xd81373){_0xe56064['sendStatus'](0x194);}return _0xd81373;};}function handleError(_0x21e440,_0x592b69){_0x592b69=_0x592b69||0x1f4;return function(_0x1d807c){logger[_0x64ba('0x29')](_0x1d807c['stack']);if(_0x1d807c[_0x64ba('0x2a')]){delete _0x1d807c[_0x64ba('0x2a')];}_0x21e440[_0x64ba('0x1b')](_0x592b69)[_0x64ba('0x2b')](_0x1d807c);};}exports[_0x64ba('0x2c')]=function(_0x31de7b,_0x10aee0){var _0x3f3c8a={},_0xb4d644={},_0x3ed42f={'count':0x0,'rows':[]};var _0x20b62d=_[_0x64ba('0x2d')](db[_0x64ba('0x2e')]['rawAttributes'],function(_0x1bda8e){return{'name':_0x1bda8e['fieldName'],'type':_0x1bda8e[_0x64ba('0x2f')][_0x64ba('0x30')]};});_0xb4d644[_0x64ba('0x31')]=_[_0x64ba('0x2d')](_0x20b62d,_0x64ba('0x2a'));_0xb4d644[_0x64ba('0x32')]=_[_0x64ba('0x33')](_0x31de7b[_0x64ba('0x32')]);_0xb4d644[_0x64ba('0x34')]=_[_0x64ba('0x35')](_0xb4d644[_0x64ba('0x31')],_0xb4d644[_0x64ba('0x32')]);_0x3f3c8a[_0x64ba('0x36')]=_[_0x64ba('0x35')](_0xb4d644['model'],qs[_0x64ba('0x37')](_0x31de7b[_0x64ba('0x32')]['fields']));_0x3f3c8a[_0x64ba('0x36')]=_0x3f3c8a[_0x64ba('0x36')]['length']?_0x3f3c8a[_0x64ba('0x36')]:_0xb4d644[_0x64ba('0x31')];if(!_0x31de7b[_0x64ba('0x32')][_0x64ba('0x38')](_0x64ba('0x39'))){_0x3f3c8a[_0x64ba('0x1f')]=qs[_0x64ba('0x1f')](_0x31de7b[_0x64ba('0x32')][_0x64ba('0x1f')]);_0x3f3c8a[_0x64ba('0x1e')]=qs[_0x64ba('0x1e')](_0x31de7b[_0x64ba('0x32')]['offset']);}_0x3f3c8a[_0x64ba('0x3a')]=qs['sort'](_0x31de7b[_0x64ba('0x32')]['sort']);_0x3f3c8a[_0x64ba('0x3b')]=qs[_0x64ba('0x34')](_[_0x64ba('0x3c')](_0x31de7b['query'],_0xb4d644[_0x64ba('0x34')]),_0x20b62d);if(_0x31de7b[_0x64ba('0x32')][_0x64ba('0x3d')]){_0x3f3c8a[_0x64ba('0x3b')]=_['merge'](_0x3f3c8a[_0x64ba('0x3b')],{'$or':_['map'](_0x20b62d,function(_0x293a9a){if(_0x293a9a['type']!==_0x64ba('0x3e')){var _0x3da843={};_0x3da843[_0x293a9a[_0x64ba('0x2a')]]={'$like':'%'+_0x31de7b['query'][_0x64ba('0x3d')]+'%'};return _0x3da843;}})});}_0x3f3c8a=_[_0x64ba('0x3f')]({},_0x3f3c8a,_0x31de7b[_0x64ba('0x40')]);var _0x5bbb77={'where':_0x3f3c8a['where']};return db[_0x64ba('0x2e')][_0x64ba('0x1d')](_0x5bbb77)[_0x64ba('0x25')](function(_0x448fa7){_0x3ed42f[_0x64ba('0x1d')]=_0x448fa7;if(_0x31de7b[_0x64ba('0x32')][_0x64ba('0x41')]){_0x3f3c8a['include']=[{'all':!![]}];}return db[_0x64ba('0x2e')]['findAll'](_0x3f3c8a);})[_0x64ba('0x25')](function(_0xcd3420){_0x3ed42f['rows']=_0xcd3420;return _0x3ed42f;})[_0x64ba('0x25')](respondWithFilteredResult(_0x10aee0,_0x3f3c8a))[_0x64ba('0x42')](handleError(_0x10aee0,null));};exports[_0x64ba('0x43')]=function(_0x523705,_0x1fcffe){var _0x309922={'raw':!![],'where':{'id':_0x523705[_0x64ba('0x44')]['id']}},_0x374783={};_0x374783[_0x64ba('0x31')]=_[_0x64ba('0x33')](db['CmHopperAdditionalPhone'][_0x64ba('0x45')]);_0x374783[_0x64ba('0x32')]=_[_0x64ba('0x33')](_0x523705['query']);_0x374783[_0x64ba('0x34')]=_[_0x64ba('0x35')](_0x374783[_0x64ba('0x31')],_0x374783[_0x64ba('0x32')]);_0x309922[_0x64ba('0x36')]=_[_0x64ba('0x35')](_0x374783[_0x64ba('0x31')],qs[_0x64ba('0x37')](_0x523705[_0x64ba('0x32')]['fields']));_0x309922[_0x64ba('0x36')]=_0x309922['attributes'][_0x64ba('0x46')]?_0x309922[_0x64ba('0x36')]:_0x374783[_0x64ba('0x31')];if(_0x523705[_0x64ba('0x32')][_0x64ba('0x41')]){_0x309922[_0x64ba('0x47')]=[{'all':!![]}];}_0x309922=_[_0x64ba('0x3f')]({},_0x309922,_0x523705[_0x64ba('0x40')]);return db[_0x64ba('0x2e')][_0x64ba('0x48')](_0x309922)[_0x64ba('0x25')](handleEntityNotFound(_0x1fcffe,null))[_0x64ba('0x25')](respondWithResult(_0x1fcffe,null))[_0x64ba('0x42')](handleError(_0x1fcffe,null));};exports[_0x64ba('0x49')]=function(_0x28f39a,_0x5efcf0){return db[_0x64ba('0x2e')][_0x64ba('0x49')](_0x28f39a[_0x64ba('0x4a')],{})[_0x64ba('0x25')](function(_0x4f5a0c){var _0x48b5a7=_0x28f39a[_0x64ba('0x4b')][_0x64ba('0x4c')]({'plain':!![]});if(!_0x48b5a7)throw new Error(_0x64ba('0x4d'));if(_0x48b5a7[_0x64ba('0x4e')]===_0x64ba('0x4b')){var _0x55f69c=_0x4f5a0c[_0x64ba('0x4c')]({'plain':!![]});var _0x2d239c=_0x64ba('0x27');return db[_0x64ba('0x4f')][_0x64ba('0x48')]({'where':{'name':_0x2d239c,'userProfileId':_0x48b5a7[_0x64ba('0x50')]},'raw':!![]})[_0x64ba('0x25')](function(_0x144382){if(_0x144382&&_0x144382[_0x64ba('0x51')]===0x0){return db['UserProfileResource'][_0x64ba('0x49')]({'name':_0x55f69c[_0x64ba('0x2a')],'resourceId':_0x55f69c['id'],'type':_0x144382['name'],'sectionId':_0x144382['id']},{})[_0x64ba('0x25')](function(){return _0x4f5a0c;});}else{return _0x4f5a0c;}})[_0x64ba('0x42')](function(_0x3c62d2){logger['error'](_0x64ba('0x52'),_0x3c62d2);throw _0x3c62d2;});}return _0x4f5a0c;})[_0x64ba('0x25')](respondWithResult(_0x5efcf0,0xc9))['catch'](handleError(_0x5efcf0,null));};exports[_0x64ba('0x24')]=function(_0x24e5e6,_0x876da0){if(_0x24e5e6['body']['id']){delete _0x24e5e6[_0x64ba('0x4a')]['id'];}return db[_0x64ba('0x2e')][_0x64ba('0x48')]({'where':{'id':_0x24e5e6[_0x64ba('0x44')]['id']}})[_0x64ba('0x25')](handleEntityNotFound(_0x876da0,null))[_0x64ba('0x25')](saveUpdates(_0x24e5e6[_0x64ba('0x4a')],null))[_0x64ba('0x25')](respondWithResult(_0x876da0,null))['catch'](handleError(_0x876da0,null));};exports[_0x64ba('0x26')]=function(_0x44463e,_0x259a4b){return db[_0x64ba('0x2e')][_0x64ba('0x48')]({'where':{'id':_0x44463e[_0x64ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x259a4b,null))[_0x64ba('0x25')](removeEntity(_0x259a4b,null))[_0x64ba('0x42')](handleError(_0x259a4b,null));};
\ No newline at end of file
+var _0xffbe=['stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','CmHopperAdditionalPhones','UserProfileResource','destroy','end','error'];(function(_0x362100,_0x48ea74){var _0x12283b=function(_0x3ea0bb){while(--_0x3ea0bb){_0x362100['push'](_0x362100['shift']());}};_0x12283b(++_0x48ea74);}(_0xffbe,0x171));var _0xeffb=function(_0x5f1266,_0x506d62){_0x5f1266=_0x5f1266-0x0;var _0x50f3cb=_0xffbe[_0x5f1266];return _0x50f3cb;};'use strict';var pdf=require(_0xeffb('0x0'));var emlformat=require(_0xeffb('0x1'));var rimraf=require(_0xeffb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeffb('0x3'));var rp=require(_0xeffb('0x4'));var moment=require(_0xeffb('0x5'));var BPromise=require(_0xeffb('0x6'));var Mustache=require(_0xeffb('0x7'));var util=require(_0xeffb('0x8'));var path=require(_0xeffb('0x9'));var sox=require(_0xeffb('0xa'));var csv=require(_0xeffb('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeffb('0xc'));var squel=require(_0xeffb('0xd'));var crypto=require(_0xeffb('0xe'));var jsforce=require(_0xeffb('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeffb('0x10'));var Papa=require(_0xeffb('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xeffb('0x12'));var as=require(_0xeffb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeffb('0x14'))('api');var utils=require(_0xeffb('0x15'));var config=require(_0xeffb('0x16'));var db=require(_0xeffb('0x17'))['db'];function respondWithStatusCode(_0x3a7849,_0x5d3e94){_0x5d3e94=_0x5d3e94||0xcc;return function(_0x4e7cb8){if(_0x4e7cb8){return _0x3a7849[_0xeffb('0x18')](_0x5d3e94);}return _0x3a7849[_0xeffb('0x19')](_0x5d3e94)['end']();};}function respondWithResult(_0x5bb4d9,_0x44921c){_0x44921c=_0x44921c||0xc8;return function(_0x327fe6){if(_0x327fe6){return _0x5bb4d9[_0xeffb('0x19')](_0x44921c)[_0xeffb('0x1a')](_0x327fe6);}};}function respondWithFilteredResult(_0x4915ee,_0x2ea75f){return function(_0x295ff4){if(_0x295ff4){var _0x1976bb=_0x295ff4[_0xeffb('0x1b')],_0x18e925=_0x2ea75f[_0xeffb('0x1c')],_0x469087=_0x2ea75f['offset']+_0x2ea75f[_0xeffb('0x1d')],_0x37d2d7;if(_0x469087>=_0x1976bb){_0x469087=_0x1976bb;_0x37d2d7=0xc8;}else{_0x37d2d7=0xce;}_0x4915ee[_0xeffb('0x19')](_0x37d2d7);return _0x4915ee['set'](_0xeffb('0x1e'),_0x18e925+'-'+_0x469087+'/'+_0x1976bb)['json'](_0x295ff4);}return null;};}function patchUpdates(_0x14882e){return function(_0x585169){try{jsonpatch[_0xeffb('0x1f')](_0x585169,_0x14882e,!![]);}catch(_0x2e1f28){return BPromise[_0xeffb('0x20')](_0x2e1f28);}return _0x585169[_0xeffb('0x21')]();};}function saveUpdates(_0x1fdb29,_0x40cce9){return function(_0xd8e066){if(_0xd8e066){return _0xd8e066[_0xeffb('0x22')](_0x1fdb29)[_0xeffb('0x23')](function(_0x405be3){return _0x405be3;});}return null;};}function removeEntity(_0x5dc03e,_0x303ea7){return function(_0xac41b8){if(_0xac41b8){return _0xac41b8['destroy']()[_0xeffb('0x23')](function(){var _0x6d0208=_0xac41b8['get']({'plain':!![]});var _0x2b30f8=_0xeffb('0x24');return db[_0xeffb('0x25')][_0xeffb('0x26')]({'where':{'type':_0x2b30f8,'resourceId':_0x6d0208['id']}})[_0xeffb('0x23')](function(){return _0xac41b8;});})[_0xeffb('0x23')](function(){_0x5dc03e['status'](0xcc)[_0xeffb('0x27')]();});}};}function handleEntityNotFound(_0x2a148e,_0x7bf828){return function(_0x4752f6){if(!_0x4752f6){_0x2a148e[_0xeffb('0x18')](0x194);}return _0x4752f6;};}function handleError(_0x11f485,_0x59d617){_0x59d617=_0x59d617||0x1f4;return function(_0xb55a6c){logger[_0xeffb('0x28')](_0xb55a6c[_0xeffb('0x29')]);if(_0xb55a6c[_0xeffb('0x2a')]){delete _0xb55a6c[_0xeffb('0x2a')];}_0x11f485[_0xeffb('0x19')](_0x59d617)[_0xeffb('0x2b')](_0xb55a6c);};}exports[_0xeffb('0x2c')]=function(_0x3a096b,_0x56c4d6){var _0x49246b={},_0x1d03fd={},_0x553887={'count':0x0,'rows':[]};var _0x1af74c=_[_0xeffb('0x2d')](db[_0xeffb('0x2e')][_0xeffb('0x2f')],function(_0xfc0cef){return{'name':_0xfc0cef[_0xeffb('0x30')],'type':_0xfc0cef[_0xeffb('0x31')][_0xeffb('0x32')]};});_0x1d03fd[_0xeffb('0x33')]=_[_0xeffb('0x2d')](_0x1af74c,_0xeffb('0x2a'));_0x1d03fd['query']=_[_0xeffb('0x34')](_0x3a096b['query']);_0x1d03fd[_0xeffb('0x35')]=_[_0xeffb('0x36')](_0x1d03fd['model'],_0x1d03fd[_0xeffb('0x37')]);_0x49246b[_0xeffb('0x38')]=_[_0xeffb('0x36')](_0x1d03fd['model'],qs[_0xeffb('0x39')](_0x3a096b[_0xeffb('0x37')][_0xeffb('0x39')]));_0x49246b[_0xeffb('0x38')]=_0x49246b[_0xeffb('0x38')][_0xeffb('0x3a')]?_0x49246b[_0xeffb('0x38')]:_0x1d03fd['model'];if(!_0x3a096b[_0xeffb('0x37')]['hasOwnProperty'](_0xeffb('0x3b'))){_0x49246b['limit']=qs[_0xeffb('0x1d')](_0x3a096b[_0xeffb('0x37')]['limit']);_0x49246b['offset']=qs[_0xeffb('0x1c')](_0x3a096b[_0xeffb('0x37')][_0xeffb('0x1c')]);}_0x49246b[_0xeffb('0x3c')]=qs['sort'](_0x3a096b[_0xeffb('0x37')][_0xeffb('0x3d')]);_0x49246b[_0xeffb('0x3e')]=qs[_0xeffb('0x35')](_[_0xeffb('0x3f')](_0x3a096b[_0xeffb('0x37')],_0x1d03fd[_0xeffb('0x35')]),_0x1af74c);if(_0x3a096b[_0xeffb('0x37')][_0xeffb('0x40')]){_0x49246b[_0xeffb('0x3e')]=_[_0xeffb('0x41')](_0x49246b[_0xeffb('0x3e')],{'$or':_['map'](_0x1af74c,function(_0x219992){if(_0x219992[_0xeffb('0x31')]!==_0xeffb('0x42')){var _0x2891eb={};_0x2891eb[_0x219992['name']]={'$like':'%'+_0x3a096b[_0xeffb('0x37')][_0xeffb('0x40')]+'%'};return _0x2891eb;}})});}_0x49246b=_[_0xeffb('0x41')]({},_0x49246b,_0x3a096b[_0xeffb('0x43')]);var _0x464e28={'where':_0x49246b[_0xeffb('0x3e')]};return db[_0xeffb('0x2e')]['count'](_0x464e28)[_0xeffb('0x23')](function(_0x3c9e02){_0x553887[_0xeffb('0x1b')]=_0x3c9e02;if(_0x3a096b['query']['includeAll']){_0x49246b[_0xeffb('0x44')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xeffb('0x45')](_0x49246b);})[_0xeffb('0x23')](function(_0x498a88){_0x553887[_0xeffb('0x46')]=_0x498a88;return _0x553887;})[_0xeffb('0x23')](respondWithFilteredResult(_0x56c4d6,_0x49246b))[_0xeffb('0x47')](handleError(_0x56c4d6,null));};exports[_0xeffb('0x48')]=function(_0x57a9dc,_0x40140a){var _0x5afe99={'raw':!![],'where':{'id':_0x57a9dc['params']['id']}},_0x37d17b={};_0x37d17b[_0xeffb('0x33')]=_['keys'](db[_0xeffb('0x2e')]['rawAttributes']);_0x37d17b[_0xeffb('0x37')]=_[_0xeffb('0x34')](_0x57a9dc[_0xeffb('0x37')]);_0x37d17b[_0xeffb('0x35')]=_['intersection'](_0x37d17b['model'],_0x37d17b[_0xeffb('0x37')]);_0x5afe99['attributes']=_[_0xeffb('0x36')](_0x37d17b[_0xeffb('0x33')],qs[_0xeffb('0x39')](_0x57a9dc[_0xeffb('0x37')][_0xeffb('0x39')]));_0x5afe99['attributes']=_0x5afe99['attributes'][_0xeffb('0x3a')]?_0x5afe99[_0xeffb('0x38')]:_0x37d17b[_0xeffb('0x33')];if(_0x57a9dc[_0xeffb('0x37')][_0xeffb('0x49')]){_0x5afe99[_0xeffb('0x44')]=[{'all':!![]}];}_0x5afe99=_[_0xeffb('0x41')]({},_0x5afe99,_0x57a9dc[_0xeffb('0x43')]);return db[_0xeffb('0x2e')][_0xeffb('0x4a')](_0x5afe99)[_0xeffb('0x23')](handleEntityNotFound(_0x40140a,null))[_0xeffb('0x23')](respondWithResult(_0x40140a,null))['catch'](handleError(_0x40140a,null));};exports[_0xeffb('0x4b')]=function(_0x2ec105,_0x154bca){return db['CmHopperAdditionalPhone'][_0xeffb('0x4b')](_0x2ec105[_0xeffb('0x4c')],{})['then'](function(_0xf3e9fd){var _0x2cb5b8=_0x2ec105['user'][_0xeffb('0x4d')]({'plain':!![]});if(!_0x2cb5b8)throw new Error(_0xeffb('0x4e'));if(_0x2cb5b8['role']==='user'){var _0x14a87b=_0xf3e9fd[_0xeffb('0x4d')]({'plain':!![]});var _0x2ad3ae='CmHopperAdditionalPhones';return db[_0xeffb('0x4f')][_0xeffb('0x4a')]({'where':{'name':_0x2ad3ae,'userProfileId':_0x2cb5b8['userProfileId']},'raw':!![]})[_0xeffb('0x23')](function(_0x52f668){if(_0x52f668&&_0x52f668['autoAssociation']===0x0){return db[_0xeffb('0x25')][_0xeffb('0x4b')]({'name':_0x14a87b['name'],'resourceId':_0x14a87b['id'],'type':_0x52f668[_0xeffb('0x2a')],'sectionId':_0x52f668['id']},{})[_0xeffb('0x23')](function(){return _0xf3e9fd;});}else{return _0xf3e9fd;}})[_0xeffb('0x47')](function(_0x68f48d){logger['error'](_0xeffb('0x50'),_0x68f48d);throw _0x68f48d;});}return _0xf3e9fd;})['then'](respondWithResult(_0x154bca,0xc9))['catch'](handleError(_0x154bca,null));};exports[_0xeffb('0x22')]=function(_0x490cf,_0x35afc5){if(_0x490cf['body']['id']){delete _0x490cf[_0xeffb('0x4c')]['id'];}return db[_0xeffb('0x2e')][_0xeffb('0x4a')]({'where':{'id':_0x490cf[_0xeffb('0x51')]['id']}})['then'](handleEntityNotFound(_0x35afc5,null))['then'](saveUpdates(_0x490cf[_0xeffb('0x4c')],null))[_0xeffb('0x23')](respondWithResult(_0x35afc5,null))[_0xeffb('0x47')](handleError(_0x35afc5,null));};exports['destroy']=function(_0x82961f,_0x5a7ec3){return db['CmHopperAdditionalPhone'][_0xeffb('0x4a')]({'where':{'id':_0x82961f[_0xeffb('0x51')]['id']}})[_0xeffb('0x23')](handleEntityNotFound(_0x5a7ec3,null))[_0xeffb('0x23')](removeEntity(_0x5a7ec3,null))['catch'](handleError(_0x5a7ec3,null));};
\ No newline at end of file
index 6464f3a..f5a79bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56ff=['api','moment','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','lodash','util','../../config/logger'];(function(_0x48b3c1,_0x412059){var _0x303d08=function(_0x19329d){while(--_0x19329d){_0x48b3c1['push'](_0x48b3c1['shift']());}};_0x303d08(++_0x412059);}(_0x56ff,0x11b));var _0xf56f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x56ff[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf56f('0x0'));var util=require(_0xf56f('0x1'));var logger=require(_0xf56f('0x2'))(_0xf56f('0x3'));var moment=require(_0xf56f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf56f('0x5'));var rimraf=require(_0xf56f('0x6'));var config=require(_0xf56f('0x7'));var attributes=require(_0xf56f('0x8'));module['exports']=function(_0x27fe29,_0x2e3162){return _0x27fe29[_0xf56f('0x9')](_0xf56f('0xa'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0903=['../../config/environment','exports','define','CmHopperAdditionalPhone','lodash','util','request-promise','rimraf'];(function(_0x3a94df,_0x299f0d){var _0x13b1b2=function(_0x57cfa5){while(--_0x57cfa5){_0x3a94df['push'](_0x3a94df['shift']());}};_0x13b1b2(++_0x299f0d);}(_0x0903,0x1cc));var _0x3090=function(_0x3220bb,_0x342a03){_0x3220bb=_0x3220bb-0x0;var _0x23415c=_0x0903[_0x3220bb];return _0x23415c;};'use strict';var _=require(_0x3090('0x0'));var util=require(_0x3090('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3090('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3090('0x3'));var config=require(_0x3090('0x4'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x3090('0x5')]=function(_0x431fbf,_0x5b880a){return _0x431fbf[_0x3090('0x6')](_0x3090('0x7'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bd1a441..df36aa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa785=['catch','VerifyAdditionalPhones','findOne','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countbusyretry','CmHopper','ContactId','duration','waitTime','ASC','scheduledat','add','minutes','phone','isNil','createdAt','updatedAt','hopperToAdd','update','IncrementPreviewCounters','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xa785,0xcd));var _0x5a78=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0xa785[_0x46428c];return _0x16a677;};'use strict';var _=require(_0x5a78('0x0'));var util=require(_0x5a78('0x1'));var moment=require(_0x5a78('0x2'));var BPromise=require(_0x5a78('0x3'));var rs=require(_0x5a78('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a78('0x5'))['db'];var utils=require(_0x5a78('0x6'));var logger=require(_0x5a78('0x7'))(_0x5a78('0x8'));var config=require(_0x5a78('0x9'));var jayson=require(_0x5a78('0xa'));var client=jayson[_0x5a78('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x369e1d,_0x189cb2,_0x2db6ee){return new BPromise(function(_0x583807,_0x359e31){return client[_0x5a78('0xc')](_0x369e1d,_0x2db6ee)[_0x5a78('0xd')](function(_0x2a057d){logger[_0x5a78('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x189cb2,_0x5a78('0xf'));logger[_0x5a78('0x10')](_0x5a78('0x11'),_0x189cb2,'request\x20sent',JSON[_0x5a78('0x12')](_0x2a057d));if(_0x2a057d[_0x5a78('0x13')]){if(_0x2a057d[_0x5a78('0x13')]['code']===0x1f4){logger[_0x5a78('0x13')](_0x5a78('0x14'),_0x189cb2,_0x2a057d[_0x5a78('0x13')][_0x5a78('0x15')]);return _0x359e31(_0x2a057d[_0x5a78('0x13')][_0x5a78('0x15')]);}logger[_0x5a78('0x13')](_0x5a78('0x14'),_0x189cb2,_0x2a057d[_0x5a78('0x13')][_0x5a78('0x15')]);return _0x583807(_0x2a057d[_0x5a78('0x13')]['message']);}else{logger['info'](_0x5a78('0x14'),_0x189cb2,_0x5a78('0xf'));_0x583807(_0x2a057d[_0x5a78('0x16')]['message']);}})[_0x5a78('0x17')](function(_0x13d80){logger[_0x5a78('0x13')](_0x5a78('0x14'),_0x189cb2,_0x13d80);_0x359e31(_0x13d80);});});}exports[_0x5a78('0x18')]=function(_0x1ca682){var _0x44f9ae=this;return new Promise(function(_0x2bd667,_0x2900d3){return db['CmHopper'][_0x5a78('0x19')]({'raw':!![],'where':{'ContactId':_0x1ca682[_0x5a78('0x1a')]['ContactId'],'ListId':_0x1ca682[_0x5a78('0x1a')][_0x5a78('0x1b')],'VoiceQueueId':_0x1ca682[_0x5a78('0x1a')][_0x5a78('0x1c')]===undefined?null:_0x1ca682[_0x5a78('0x1a')][_0x5a78('0x1c')],'CampaignId':_0x1ca682[_0x5a78('0x1a')][_0x5a78('0x1d')]===undefined?null:_0x1ca682[_0x5a78('0x1a')][_0x5a78('0x1d')]}})[_0x5a78('0xd')](function(_0x49f324){if(_0x49f324!=null){return db[_0x5a78('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x49f324['id'],'OrderBy':{'$gt':_0x49f324[_0x5a78('0x1f')]}},'order':[['OrderBy','ASC']]})['then'](function(_0x56d4e7){var _0x1c2696=0x0;if(_0x56d4e7){if(_0x56d4e7['countbusyretry']+_0x56d4e7[_0x5a78('0x20')]+_0x56d4e7[_0x5a78('0x21')]+_0x56d4e7[_0x5a78('0x22')]+_0x56d4e7[_0x5a78('0x23')]+_0x56d4e7[_0x5a78('0x24')]+_0x56d4e7[_0x5a78('0x25')]+_0x56d4e7[_0x5a78('0x26')]<_0x1ca682[_0x5a78('0x27')][_0x5a78('0x28')])_0x1c2696=0x1;_0x2bd667({'additional':_0x1c2696});}else{return db[_0x5a78('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x49f324['id']},'order':[[_0x5a78('0x1f'),'ASC']]})[_0x5a78('0xd')](function(_0x467e0a){var _0x9ab2c7=0x0;if(_0x467e0a){if(_0x467e0a[_0x5a78('0x29')]+_0x467e0a['countcongestionretry']+_0x467e0a[_0x5a78('0x21')]+_0x467e0a[_0x5a78('0x22')]+_0x467e0a[_0x5a78('0x23')]+_0x467e0a[_0x5a78('0x24')]+_0x467e0a[_0x5a78('0x25')]+_0x467e0a['countagentrejectretry']<_0x1ca682[_0x5a78('0x27')][_0x5a78('0x28')])_0x9ab2c7=0x1;_0x2bd667({'additional':_0x9ab2c7});}else{_0x2bd667({'additional':0x0});}})[_0x5a78('0x17')](function(_0xe806c0){logger['error'](_0x5a78('0x18'),_0xe806c0[_0x5a78('0x15')],_0x1ca682);_0x2900d3(_0x44f9ae[_0x5a78('0x13')](0x1f4,_0xe806c0[_0x5a78('0x15')]));});}})[_0x5a78('0x17')](function(_0x5770d6){logger[_0x5a78('0x13')](_0x5a78('0x18'),_0x5770d6[_0x5a78('0x15')],_0x1ca682);_0x2900d3(_0x44f9ae[_0x5a78('0x13')](0x1f4,_0x5770d6[_0x5a78('0x15')]));});}else _0x2bd667({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x50797c){var _0x2b56d3=this;return new Promise(function(_0x4f2a96,_0x31e226){return db[_0x5a78('0x2a')][_0x5a78('0x19')]({'raw':!![],'where':{'ContactId':_0x50797c[_0x5a78('0x1a')][_0x5a78('0x2b')],'ListId':_0x50797c[_0x5a78('0x1a')][_0x5a78('0x1b')],'VoiceQueueId':_0x50797c[_0x5a78('0x1a')][_0x5a78('0x1c')]===undefined?null:_0x50797c[_0x5a78('0x1a')]['VoiceQueueId'],'CampaignId':_0x50797c['body'][_0x5a78('0x1d')]===undefined?null:_0x50797c[_0x5a78('0x1a')][_0x5a78('0x1d')]}})['then'](function(_0x3cc4f3){if(_0x3cc4f3!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x3cc4f3['id'],'OrderBy':{'$gt':_0x3cc4f3[_0x5a78('0x1f')]}},'order':[[_0x5a78('0x1f'),'ASC']]})[_0x5a78('0xd')](function(_0x123800){if(_0x123800)return activateAdditionalPhone(_0x3cc4f3,_0x50797c[_0x5a78('0x1a')],_0x123800,_0x50797c[_0x5a78('0x2c')],_0x50797c[_0x5a78('0x2d')])[_0x5a78('0xd')](function(_0x4d374a){_0x4f2a96(_0x4d374a);});else{return db[_0x5a78('0x1e')][_0x5a78('0x19')]({'raw':!![],'where':{'CmHopperId':_0x3cc4f3['id']},'order':[[_0x5a78('0x1f'),_0x5a78('0x2e')]]})[_0x5a78('0xd')](function(_0x318ce5){if(_0x318ce5)return activateAdditionalPhone(_0x3cc4f3,_0x50797c[_0x5a78('0x1a')],_0x318ce5,_0x50797c[_0x5a78('0x2c')],_0x50797c[_0x5a78('0x2d')])[_0x5a78('0xd')](function(_0x572f99){_0x4f2a96(_0x572f99);});else{_0x4f2a96({'id':_0x3cc4f3['id'],'phone':''});}})[_0x5a78('0x17')](function(_0x238107){logger[_0x5a78('0x13')](_0x5a78('0x18'),_0x238107[_0x5a78('0x15')],_0x50797c);_0x31e226(_0x2b56d3[_0x5a78('0x13')](0x1f4,_0x238107[_0x5a78('0x15')]));});}})[_0x5a78('0x17')](function(_0x4a6b2f){logger[_0x5a78('0x13')](_0x5a78('0x18'),_0x4a6b2f[_0x5a78('0x15')],_0x50797c);_0x31e226(_0x2b56d3[_0x5a78('0x13')](0x1f4,_0x4a6b2f[_0x5a78('0x15')]));});}else _0x4f2a96(0x1);});});};function activateAdditionalPhone(_0x3552c1,_0x2f8758,_0x499348,_0x540dd8,_0x1b78bb){return new Promise(function(_0x1da87e,_0x157858){logger[_0x5a78('0xe')](_0x5a78('0x18'),_0x499348);var _0x1de8bd;if(moment()>moment(_0x499348[_0x5a78('0x2f')])){_0x1de8bd=moment()[_0x5a78('0x30')](_0x1b78bb||0x3,'minutes');}else{if(_0x499348[_0x5a78('0x1f')]==0x0){_0x1de8bd=moment(_0x499348[_0x5a78('0x2f')]);}else{_0x1de8bd=moment()[_0x5a78('0x30')](_0x1b78bb||0x3,_0x5a78('0x31'));}}var _0x4a6b52={'phone':_0x3552c1[_0x5a78('0x32')],'active':0x0,'OrderBy':_[_0x5a78('0x33')](_0x3552c1['OrderBy'])?0x0:_0x3552c1[_0x5a78('0x1f')],'scheduledat':moment()[_0x5a78('0x30')](_0x540dd8||0x1,_0x5a78('0x31')),'countbusyretry':_0x2f8758[_0x5a78('0x29')],'countcongestionretry':_0x2f8758[_0x5a78('0x20')],'countnoanswerretry':_0x2f8758['countnoanswerretry'],'countnosuchnumberretry':_0x2f8758[_0x5a78('0x22')],'countdropretry':_0x2f8758[_0x5a78('0x23')],'countabandonedretry':_0x2f8758['countabandonedretry'],'countmachineretry':_0x2f8758['countmachineretry'],'countagentrejectretry':_0x2f8758[_0x5a78('0x26')],'createdAt':_0x2f8758[_0x5a78('0x34')],'updatedAt':_0x2f8758[_0x5a78('0x35')]};var _0x2b2a0f={'CmHopperId':_0x3552c1['id'],'phone':_0x499348[_0x5a78('0x32')],'active':0x0,'OrderBy':_['isNil'](_0x499348[_0x5a78('0x1f')])?0x0:_0x499348[_0x5a78('0x1f')],'scheduledat':_0x1de8bd,'countbusyretry':_0x499348[_0x5a78('0x29')],'countcongestionretry':_0x499348['countcongestionretry'],'countnoanswerretry':_0x499348[_0x5a78('0x21')],'countnosuchnumberretry':_0x2f8758[_0x5a78('0x22')],'countdropretry':_0x2f8758[_0x5a78('0x23')],'countabandonedretry':_0x2f8758[_0x5a78('0x24')],'countmachineretry':_0x2f8758[_0x5a78('0x25')],'countagentrejectretry':_0x2f8758[_0x5a78('0x26')],'createdAt':_0x499348[_0x5a78('0x34')],'updatedAt':_0x499348[_0x5a78('0x35')]};logger['info'](_0x5a78('0x36'),_0x4a6b52);logger[_0x5a78('0xe')]('additionalToHop',_0x2b2a0f);return db['sequelize']['transaction'](function(_0x3e6a8){return db[_0x5a78('0x1e')]['update'](_0x4a6b52,{'where':{'id':_0x499348['id']}},{'transaction':_0x3e6a8})[_0x5a78('0xd')](function(){return db[_0x5a78('0x2a')][_0x5a78('0x37')](_0x2b2a0f,{'where':{'id':_0x3552c1['id']}},{'transaction':_0x3e6a8});});})[_0x5a78('0xd')](function(_0x26cb92){_0x1da87e({'id':_0x3552c1['id'],'phone':_0x499348[_0x5a78('0x32')]});})[_0x5a78('0x17')](function(_0x384029){logger[_0x5a78('0x13')](_0x5a78('0x18'),_0x384029['message'],req);_0x157858(_this[_0x5a78('0x13')](0x1f4,_0x384029[_0x5a78('0x15')]));});});}exports[_0x5a78('0x38')]=function(_0x37b31b){var _0x3b65d3=this;return new Promise(function(_0x19ad64,_0x2558c7){return db[_0x5a78('0x2a')][_0x5a78('0x37')](_0x37b31b[_0x5a78('0x1a')]['field'],{'where':{'id':_0x37b31b['body']['id']}})[_0x5a78('0xd')](function(_0x2b8e67){_0x19ad64(_0x2b8e67);})[_0x5a78('0x17')](function(_0x4c11b2){logger[_0x5a78('0x13')](_0x5a78('0x38'),_0x4c11b2[_0x5a78('0x15')],_0x37b31b);_0x2558c7(_0x3b65d3[_0x5a78('0x13')](0x1f4,_0x4c11b2[_0x5a78('0x15')]));});});};
\ No newline at end of file
+var _0x3b15=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','info','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','CampaignId','then','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countnosuchnumberretry','countdropretry','ListId','waitTime','scheduledat','add','minutes','phone','isNil','updatedAt','countabandonedretry','hopperToAdd','additionalToHop','transaction','update','IncrementPreviewCounters','field','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3ae96c,_0x5f1e7e){var _0x1b0c90=function(_0x1ecc83){while(--_0x1ecc83){_0x3ae96c['push'](_0x3ae96c['shift']());}};_0x1b0c90(++_0x5f1e7e);}(_0x3b15,0x1e1));var _0x53b1=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x3b15[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x53b1('0x0'));var util=require(_0x53b1('0x1'));var moment=require('moment');var BPromise=require(_0x53b1('0x2'));var rs=require(_0x53b1('0x3'));var fs=require('fs');var Redis=require(_0x53b1('0x4'));var db=require(_0x53b1('0x5'))['db'];var utils=require(_0x53b1('0x6'));var logger=require('../../config/logger')(_0x53b1('0x7'));var config=require(_0x53b1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x53b1('0x9')][_0x53b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1dbc23,_0x107f3e,_0x19d552){return new BPromise(function(_0x25fb33,_0xc1d060){return client[_0x53b1('0xb')](_0x1dbc23,_0x19d552)['then'](function(_0x1c19b6){logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x107f3e,'request\x20sent');logger[_0x53b1('0xc')](_0x53b1('0xd'),_0x107f3e,'request\x20sent',JSON[_0x53b1('0xe')](_0x1c19b6));if(_0x1c19b6['error']){if(_0x1c19b6[_0x53b1('0xf')]['code']===0x1f4){logger[_0x53b1('0xf')](_0x53b1('0x10'),_0x107f3e,_0x1c19b6['error']['message']);return _0xc1d060(_0x1c19b6['error'][_0x53b1('0x11')]);}logger[_0x53b1('0xf')](_0x53b1('0x10'),_0x107f3e,_0x1c19b6[_0x53b1('0xf')][_0x53b1('0x11')]);return _0x25fb33(_0x1c19b6[_0x53b1('0xf')][_0x53b1('0x11')]);}else{logger[_0x53b1('0x12')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x107f3e,'request\x20sent');_0x25fb33(_0x1c19b6['result']['message']);}})[_0x53b1('0x13')](function(_0x5d4f62){logger[_0x53b1('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x107f3e,_0x5d4f62);_0xc1d060(_0x5d4f62);});});}exports[_0x53b1('0x14')]=function(_0x18840d){var _0x570185=this;return new Promise(function(_0x10e651,_0x59ccc7){return db[_0x53b1('0x15')][_0x53b1('0x16')]({'raw':!![],'where':{'ContactId':_0x18840d[_0x53b1('0x17')][_0x53b1('0x18')],'ListId':_0x18840d['body']['ListId'],'VoiceQueueId':_0x18840d['body']['VoiceQueueId']===undefined?null:_0x18840d['body']['VoiceQueueId'],'CampaignId':_0x18840d['body'][_0x53b1('0x19')]===undefined?null:_0x18840d[_0x53b1('0x17')]['CampaignId']}})[_0x53b1('0x1a')](function(_0x99c309){if(_0x99c309!=null){return db['CmHopperAdditionalPhone'][_0x53b1('0x16')]({'raw':!![],'where':{'CmHopperId':_0x99c309['id'],'OrderBy':{'$gt':_0x99c309[_0x53b1('0x1b')]}},'order':[[_0x53b1('0x1b'),_0x53b1('0x1c')]]})[_0x53b1('0x1a')](function(_0x198de6){var _0x1ab960=0x0;if(_0x198de6){if(_0x198de6[_0x53b1('0x1d')]+_0x198de6[_0x53b1('0x1e')]+_0x198de6[_0x53b1('0x1f')]+_0x198de6['countnosuchnumberretry']+_0x198de6['countdropretry']+_0x198de6['countabandonedretry']+_0x198de6[_0x53b1('0x20')]+_0x198de6[_0x53b1('0x21')]<_0x18840d[_0x53b1('0x22')][_0x53b1('0x23')])_0x1ab960=0x1;_0x10e651({'additional':_0x1ab960});}else{return db[_0x53b1('0x24')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x99c309['id']},'order':[[_0x53b1('0x1b'),_0x53b1('0x1c')]]})[_0x53b1('0x1a')](function(_0x4d455f){var _0x26a8d0=0x0;if(_0x4d455f){if(_0x4d455f[_0x53b1('0x1d')]+_0x4d455f[_0x53b1('0x1e')]+_0x4d455f[_0x53b1('0x1f')]+_0x4d455f[_0x53b1('0x25')]+_0x4d455f[_0x53b1('0x26')]+_0x4d455f['countabandonedretry']+_0x4d455f[_0x53b1('0x20')]+_0x4d455f['countagentrejectretry']<_0x18840d['entity'][_0x53b1('0x23')])_0x26a8d0=0x1;_0x10e651({'additional':_0x26a8d0});}else{_0x10e651({'additional':0x0});}})[_0x53b1('0x13')](function(_0x3331c5){logger[_0x53b1('0xf')](_0x53b1('0x14'),_0x3331c5['message'],_0x18840d);_0x59ccc7(_0x570185[_0x53b1('0xf')](0x1f4,_0x3331c5[_0x53b1('0x11')]));});}})[_0x53b1('0x13')](function(_0x403adb){logger['error'](_0x53b1('0x14'),_0x403adb[_0x53b1('0x11')],_0x18840d);_0x59ccc7(_0x570185['error'](0x1f4,_0x403adb['message']));});}else _0x10e651({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x1d7fea){var _0x1d80ce=this;return new Promise(function(_0xa30cea,_0xbc2f40){return db[_0x53b1('0x15')][_0x53b1('0x16')]({'raw':!![],'where':{'ContactId':_0x1d7fea[_0x53b1('0x17')]['ContactId'],'ListId':_0x1d7fea['body'][_0x53b1('0x27')],'VoiceQueueId':_0x1d7fea['body']['VoiceQueueId']===undefined?null:_0x1d7fea['body']['VoiceQueueId'],'CampaignId':_0x1d7fea[_0x53b1('0x17')][_0x53b1('0x19')]===undefined?null:_0x1d7fea[_0x53b1('0x17')][_0x53b1('0x19')]}})['then'](function(_0x1f1e09){if(_0x1f1e09!=null){return db['CmHopperAdditionalPhone'][_0x53b1('0x16')]({'raw':!![],'where':{'CmHopperId':_0x1f1e09['id'],'OrderBy':{'$gt':_0x1f1e09['OrderBy']}},'order':[[_0x53b1('0x1b'),_0x53b1('0x1c')]]})['then'](function(_0x308db0){if(_0x308db0)return activateAdditionalPhone(_0x1f1e09,_0x1d7fea[_0x53b1('0x17')],_0x308db0,_0x1d7fea['duration'],_0x1d7fea[_0x53b1('0x28')])[_0x53b1('0x1a')](function(_0x1545fb){_0xa30cea(_0x1545fb);});else{return db[_0x53b1('0x24')][_0x53b1('0x16')]({'raw':!![],'where':{'CmHopperId':_0x1f1e09['id']},'order':[[_0x53b1('0x1b'),_0x53b1('0x1c')]]})[_0x53b1('0x1a')](function(_0x402a1a){if(_0x402a1a)return activateAdditionalPhone(_0x1f1e09,_0x1d7fea[_0x53b1('0x17')],_0x402a1a,_0x1d7fea['duration'],_0x1d7fea[_0x53b1('0x28')])[_0x53b1('0x1a')](function(_0x3e21be){_0xa30cea(_0x3e21be);});else{_0xa30cea({'id':_0x1f1e09['id'],'phone':''});}})[_0x53b1('0x13')](function(_0x52bba6){logger[_0x53b1('0xf')](_0x53b1('0x14'),_0x52bba6[_0x53b1('0x11')],_0x1d7fea);_0xbc2f40(_0x1d80ce[_0x53b1('0xf')](0x1f4,_0x52bba6[_0x53b1('0x11')]));});}})[_0x53b1('0x13')](function(_0x222dac){logger[_0x53b1('0xf')]('VerifyAdditionalPhones',_0x222dac['message'],_0x1d7fea);_0xbc2f40(_0x1d80ce['error'](0x1f4,_0x222dac[_0x53b1('0x11')]));});}else _0xa30cea(0x1);});});};function activateAdditionalPhone(_0x132936,_0x4183d9,_0x1215f6,_0x261c38,_0x3f1e40){return new Promise(function(_0x4d8ce6,_0x4d8697){logger[_0x53b1('0x12')](_0x53b1('0x14'),_0x1215f6);var _0x6e3067;if(moment()>moment(_0x1215f6[_0x53b1('0x29')])){_0x6e3067=moment()[_0x53b1('0x2a')](_0x3f1e40||0x3,_0x53b1('0x2b'));}else{if(_0x1215f6[_0x53b1('0x1b')]==0x0){_0x6e3067=moment(_0x1215f6[_0x53b1('0x29')]);}else{_0x6e3067=moment()[_0x53b1('0x2a')](_0x3f1e40||0x3,_0x53b1('0x2b'));}}var _0x29ddd3={'phone':_0x132936[_0x53b1('0x2c')],'active':0x0,'OrderBy':_[_0x53b1('0x2d')](_0x132936[_0x53b1('0x1b')])?0x0:_0x132936['OrderBy'],'scheduledat':moment()['add'](_0x261c38||0x1,_0x53b1('0x2b')),'countbusyretry':_0x4183d9['countbusyretry'],'countcongestionretry':_0x4183d9[_0x53b1('0x1e')],'countnoanswerretry':_0x4183d9['countnoanswerretry'],'countnosuchnumberretry':_0x4183d9[_0x53b1('0x25')],'countdropretry':_0x4183d9['countdropretry'],'countabandonedretry':_0x4183d9['countabandonedretry'],'countmachineretry':_0x4183d9['countmachineretry'],'countagentrejectretry':_0x4183d9['countagentrejectretry'],'createdAt':_0x4183d9['createdAt'],'updatedAt':_0x4183d9[_0x53b1('0x2e')]};var _0x3c5d5f={'CmHopperId':_0x132936['id'],'phone':_0x1215f6['phone'],'active':0x0,'OrderBy':_[_0x53b1('0x2d')](_0x1215f6[_0x53b1('0x1b')])?0x0:_0x1215f6[_0x53b1('0x1b')],'scheduledat':_0x6e3067,'countbusyretry':_0x1215f6[_0x53b1('0x1d')],'countcongestionretry':_0x1215f6['countcongestionretry'],'countnoanswerretry':_0x1215f6[_0x53b1('0x1f')],'countnosuchnumberretry':_0x4183d9[_0x53b1('0x25')],'countdropretry':_0x4183d9[_0x53b1('0x26')],'countabandonedretry':_0x4183d9[_0x53b1('0x2f')],'countmachineretry':_0x4183d9[_0x53b1('0x20')],'countagentrejectretry':_0x4183d9[_0x53b1('0x21')],'createdAt':_0x1215f6['createdAt'],'updatedAt':_0x1215f6['updatedAt']};logger[_0x53b1('0x12')](_0x53b1('0x30'),_0x29ddd3);logger[_0x53b1('0x12')](_0x53b1('0x31'),_0x3c5d5f);return db['sequelize'][_0x53b1('0x32')](function(_0x117203){return db[_0x53b1('0x24')][_0x53b1('0x33')](_0x29ddd3,{'where':{'id':_0x1215f6['id']}},{'transaction':_0x117203})['then'](function(){return db[_0x53b1('0x15')][_0x53b1('0x33')](_0x3c5d5f,{'where':{'id':_0x132936['id']}},{'transaction':_0x117203});});})[_0x53b1('0x1a')](function(_0x123ad3){_0x4d8ce6({'id':_0x132936['id'],'phone':_0x1215f6[_0x53b1('0x2c')]});})['catch'](function(_0x56e677){logger['error'](_0x53b1('0x14'),_0x56e677[_0x53b1('0x11')],req);_0x4d8697(_this[_0x53b1('0xf')](0x1f4,_0x56e677[_0x53b1('0x11')]));});});}exports[_0x53b1('0x34')]=function(_0x357711){var _0x9c1649=this;return new Promise(function(_0x2b03cd,_0x27ce61){return db[_0x53b1('0x15')][_0x53b1('0x33')](_0x357711[_0x53b1('0x17')][_0x53b1('0x35')],{'where':{'id':_0x357711[_0x53b1('0x17')]['id']}})['then'](function(_0x792ebf){_0x2b03cd(_0x792ebf);})[_0x53b1('0x13')](function(_0x442bf2){logger[_0x53b1('0xf')](_0x53b1('0x34'),_0x442bf2['message'],_0x357711);_0x27ce61(_0x9c1649[_0x53b1('0xf')](0x1f4,_0x442bf2[_0x53b1('0x11')]));});});};
\ No newline at end of file
index 6ba1784..90667bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x465e=['Router','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x515487,_0x21f28b){var _0x56e18a=function(_0x132301){while(--_0x132301){_0x515487['push'](_0x515487['shift']());}};_0x56e18a(++_0x21f28b);}(_0x465e,0x1b1));var _0xe465=function(_0x5a9fb9,_0xb126c4){_0x5a9fb9=_0x5a9fb9-0x0;var _0x110430=_0x465e[_0x5a9fb9];return _0x110430;};'use strict';var multer=require(_0xe465('0x0'));var util=require(_0xe465('0x1'));var path=require(_0xe465('0x2'));var timeout=require(_0xe465('0x3'));var express=require('express');var router=express[_0xe465('0x4')]();var auth=require(_0xe465('0x5'));var interaction=require(_0xe465('0x6'));var config=require('../../config/environment');var controller=require(_0xe465('0x7'));router['get']('/',auth[_0xe465('0x8')](),controller[_0xe465('0x9')]);router[_0xe465('0xa')](_0xe465('0xb'),auth[_0xe465('0x8')](),controller[_0xe465('0xc')]);router[_0xe465('0xd')]('/',auth[_0xe465('0x8')](),controller[_0xe465('0xe')]);router[_0xe465('0xf')]('/:id',auth[_0xe465('0x8')](),controller[_0xe465('0x10')]);router[_0xe465('0x11')](_0xe465('0xb'),auth[_0xe465('0x8')](),controller[_0xe465('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xe516=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','create','put','destroy','exports'];(function(_0x41f171,_0x191ca6){var _0x52c91e=function(_0xe4e879){while(--_0xe4e879){_0x41f171['push'](_0x41f171['shift']());}};_0x52c91e(++_0x191ca6);}(_0xe516,0x17a));var _0x6e51=function(_0x53b199,_0x38ff21){_0x53b199=_0x53b199-0x0;var _0x1ba42d=_0xe516[_0x53b199];return _0x1ba42d;};'use strict';var multer=require(_0x6e51('0x0'));var util=require(_0x6e51('0x1'));var path=require(_0x6e51('0x2'));var timeout=require(_0x6e51('0x3'));var express=require('express');var router=express[_0x6e51('0x4')]();var auth=require(_0x6e51('0x5'));var interaction=require(_0x6e51('0x6'));var config=require(_0x6e51('0x7'));var controller=require(_0x6e51('0x8'));router[_0x6e51('0x9')]('/',auth[_0x6e51('0xa')](),controller[_0x6e51('0xb')]);router[_0x6e51('0x9')](_0x6e51('0xc'),auth[_0x6e51('0xa')](),controller[_0x6e51('0xd')]);router['post']('/',auth[_0x6e51('0xa')](),controller[_0x6e51('0xe')]);router[_0x6e51('0xf')](_0x6e51('0xc'),auth[_0x6e51('0xa')](),controller['update']);router['delete'](_0x6e51('0xc'),auth[_0x6e51('0xa')](),controller[_0x6e51('0x10')]);module[_0x6e51('0x11')]=router;
\ No newline at end of file
index 1001907..fe1904b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75fa=['INTEGER','contactListQueue','sequelize','exports','STRING'];(function(_0x4d94d6,_0xae1107){var _0x394d51=function(_0x315137){while(--_0x315137){_0x4d94d6['push'](_0x4d94d6['shift']());}};_0x394d51(++_0xae1107);}(_0x75fa,0x1d8));var _0xa75f=function(_0x25c47d,_0x112792){_0x25c47d=_0x25c47d-0x0;var _0x24c2ca=_0x75fa[_0x25c47d];return _0x24c2ca;};'use strict';var moment=require('moment');var Sequelize=require(_0xa75f('0x0'));module[_0xa75f('0x1')]={'phone':{'type':Sequelize[_0xa75f('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa75f('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xa75f('0x3')],'unique':_0xa75f('0x4')},'VoiceQueueId':{'type':Sequelize[_0xa75f('0x3')],'unique':_0xa75f('0x4')}};
\ No newline at end of file
+var _0x944d=['contactListQueue','sequelize','exports','STRING','INTEGER'];(function(_0x3ee685,_0x1fa765){var _0x134805=function(_0x5131fe){while(--_0x5131fe){_0x3ee685['push'](_0x3ee685['shift']());}};_0x134805(++_0x1fa765);}(_0x944d,0x1b4));var _0xd944=function(_0x32c8f6,_0xf3f53f){_0x32c8f6=_0x32c8f6-0x0;var _0x19d374=_0x944d[_0x32c8f6];return _0x19d374;};'use strict';var moment=require('moment');var Sequelize=require(_0xd944('0x0'));module[_0xd944('0x1')]={'phone':{'type':Sequelize[_0xd944('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xd944('0x3')],'unique':_0xd944('0x4')},'ListId':{'type':Sequelize[_0xd944('0x3')],'unique':_0xd944('0x4')},'VoiceQueueId':{'type':Sequelize[_0xd944('0x3')],'unique':_0xd944('0x4')}};
\ No newline at end of file
index 4b8ad00..93ae310 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x212c7a,_0x3b5448){var _0x3316e2=function(_0xf1e5dc){while(--_0xf1e5dc){_0x212c7a['push'](_0x212c7a['shift']());}};_0x3316e2(++_0x3b5448);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x52fe4c,_0x11f4cc){var _0x10a76c=function(_0x130ab2){while(--_0x130ab2){_0x52fe4c['push'](_0x52fe4c['shift']());}};_0x10a76c(++_0x11f4cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));};
\ No newline at end of file
index 457a99c..8943bde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['cm_hopper_black','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes'];(function(_0x5e4134,_0x1a1c27){var _0x529994=function(_0x40956b){while(--_0x40956b){_0x5e4134['push'](_0x5e4134['shift']());}};_0x529994(++_0x1a1c27);}(_0x70e0,0x17b));var _0x070e=function(_0x38308f,_0x159a7e){_0x38308f=_0x38308f-0x0;var _0x2658e7=_0x70e0[_0x38308f];return _0x2658e7;};'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']('CmHopperBlack',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird'];(function(_0xa5856f,_0x58103f){var _0x240c61=function(_0x3498db){while(--_0x3498db){_0xa5856f['push'](_0xa5856f['shift']());}};_0x240c61(++_0x58103f);}(_0xe706,0xa3));var _0x6e70=function(_0x4f9c46,_0x361afe){_0x4f9c46=_0x4f9c46-0x0;var _0x155365=_0xe706[_0x4f9c46];return _0x155365;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fed1d04..ef05f4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4926=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','message','CmHopperBlack,\x20%s,\x20%s','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','limit','map','model','attributes','include','debug','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack'];(function(_0x4e8821,_0x41bde4){var _0x353b80=function(_0x9a9aec){while(--_0x9a9aec){_0x4e8821['push'](_0x4e8821['shift']());}};_0x353b80(++_0x41bde4);}(_0x4926,0xbe));var _0x6492=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0x4926[_0xb99421];return _0x4b3ec7;};'use strict';var _=require(_0x6492('0x0'));var util=require(_0x6492('0x1'));var moment=require(_0x6492('0x2'));var BPromise=require(_0x6492('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6492('0x4'))['db'];var utils=require(_0x6492('0x5'));var logger=require(_0x6492('0x6'))(_0x6492('0x7'));var config=require(_0x6492('0x8'));var jayson=require(_0x6492('0x9'));var client=jayson[_0x6492('0xa')][_0x6492('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x537d8b,_0x334953,_0x17b63f){return new BPromise(function(_0x901fb2,_0x5ac831){return client[_0x6492('0xc')](_0x537d8b,_0x17b63f)[_0x6492('0xd')](function(_0x365a2c){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x334953,_0x6492('0xe'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x334953,'request\x20sent',JSON[_0x6492('0xf')](_0x365a2c));if(_0x365a2c[_0x6492('0x10')]){if(_0x365a2c[_0x6492('0x10')][_0x6492('0x11')]===0x1f4){logger[_0x6492('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x334953,_0x365a2c[_0x6492('0x10')][_0x6492('0x12')]);return _0x5ac831(_0x365a2c['error'][_0x6492('0x12')]);}logger[_0x6492('0x10')](_0x6492('0x13'),_0x334953,_0x365a2c[_0x6492('0x10')][_0x6492('0x12')]);return _0x901fb2(_0x365a2c[_0x6492('0x10')]['message']);}else{logger[_0x6492('0x14')](_0x6492('0x13'),_0x334953,'request\x20sent');_0x901fb2(_0x365a2c[_0x6492('0x15')][_0x6492('0x12')]);}})[_0x6492('0x16')](function(_0x425609){logger[_0x6492('0x10')](_0x6492('0x13'),_0x334953,_0x425609);_0x5ac831(_0x425609);});});}exports[_0x6492('0x17')]=function(_0x3b1bd8){var _0xb734c4=this;return new Promise(function(_0x5c0f71,_0x384f7e){return db[_0x6492('0x18')][_0x6492('0x19')]({'raw':_0x3b1bd8[_0x6492('0x1a')]?_0x3b1bd8[_0x6492('0x1a')][_0x6492('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b1bd8[_0x6492('0x1a')]?_0x3b1bd8[_0x6492('0x1a')]['where']||null:null,'attributes':_0x3b1bd8['options']?_0x3b1bd8['options']['attributes']||null:null,'limit':_0x3b1bd8[_0x6492('0x1a')]?_0x3b1bd8[_0x6492('0x1a')][_0x6492('0x1c')]||null:null,'include':_0x3b1bd8[_0x6492('0x1a')]?_0x3b1bd8[_0x6492('0x1a')]['include']?_[_0x6492('0x1d')](_0x3b1bd8['options']['include'],function(_0x2f685d){return{'model':db[_0x2f685d[_0x6492('0x1e')]],'as':_0x2f685d['as'],'attributes':_0x2f685d[_0x6492('0x1f')],'include':_0x2f685d[_0x6492('0x20')]?_[_0x6492('0x1d')](_0x2f685d[_0x6492('0x20')],function(_0x2b9b31){return{'model':db[_0x2b9b31[_0x6492('0x1e')]],'as':_0x2b9b31['as'],'attributes':_0x2b9b31['attributes'],'include':_0x2b9b31[_0x6492('0x20')]?_[_0x6492('0x1d')](_0x2b9b31[_0x6492('0x20')],function(_0xc28ae5){return{'model':db[_0xc28ae5[_0x6492('0x1e')]],'as':_0xc28ae5['as'],'attributes':_0xc28ae5[_0x6492('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6492('0xd')](function(_0x5ccd2e){logger[_0x6492('0x14')](_0x6492('0x17'),_0x3b1bd8);logger[_0x6492('0x21')]('GetCmHopperBlack',_0x3b1bd8,JSON[_0x6492('0xf')](_0x5ccd2e));_0x5c0f71(_0x5ccd2e);})['catch'](function(_0x1054c6){logger[_0x6492('0x10')]('GetCmHopperBlack',_0x1054c6[_0x6492('0x12')],_0x3b1bd8);_0x384f7e(_0xb734c4[_0x6492('0x10')](0x1f4,_0x1054c6['message']));});});};exports['UpdateCmHopperBlack']=function(_0x3fb3df){var _0x53abc9=this;return new Promise(function(_0x3de77a,_0x2c9132){return db['CmHopperBlack'][_0x6492('0x22')](_0x3fb3df[_0x6492('0x23')],{'raw':_0x3fb3df[_0x6492('0x1a')]?_0x3fb3df[_0x6492('0x1a')][_0x6492('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fb3df[_0x6492('0x1a')]?_0x3fb3df[_0x6492('0x1a')]['where']||null:null,'attributes':_0x3fb3df[_0x6492('0x1a')]?_0x3fb3df[_0x6492('0x1a')][_0x6492('0x1f')]||null:null,'limit':_0x3fb3df['options']?_0x3fb3df[_0x6492('0x1a')]['limit']||null:null})['then'](function(_0x3c6d51){logger['info'](_0x6492('0x24'),_0x3fb3df);logger[_0x6492('0x21')](_0x6492('0x24'),_0x3fb3df,JSON[_0x6492('0xf')](_0x3c6d51));_0x3de77a(_0x3c6d51);})[_0x6492('0x16')](function(_0x43b8df){logger['error'](_0x6492('0x24'),_0x43b8df[_0x6492('0x12')],_0x3fb3df);_0x2c9132(_0x53abc9[_0x6492('0x10')](0x1f4,_0x43b8df[_0x6492('0x12')]));});});};exports[_0x6492('0x25')]=function(_0x532c38){var _0x4087b0=this;return new Promise(function(_0x1bd1d8,_0x3fb56f){return db[_0x6492('0x18')]['destroy']({'where':_0x532c38[_0x6492('0x1a')]?_0x532c38['options']['where']||null:null})[_0x6492('0xd')](function(_0x1bc9ab){logger[_0x6492('0x14')](_0x6492('0x25'),_0x532c38);logger['debug'](_0x6492('0x25'),_0x532c38,JSON[_0x6492('0xf')](_0x1bc9ab));_0x1bd1d8(_0x1bc9ab);})[_0x6492('0x16')](function(_0x35201d){logger[_0x6492('0x10')]('DestroyCmHopperBlack',_0x35201d[_0x6492('0x12')],_0x532c38);_0x3fb56f(_0x4087b0[_0x6492('0x10')](0x1f4,_0x35201d[_0x6492('0x12')]));});});};
\ No newline at end of file
+var _0x96c2=['rpc','jayson/promise','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCmHopperBlack','findAll','options','where','limit','map','model','attributes','include','catch','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x53f5e9,_0x253cb0){var _0x445c06=function(_0x27f787){while(--_0x27f787){_0x53f5e9['push'](_0x53f5e9['shift']());}};_0x445c06(++_0x253cb0);}(_0x96c2,0x171));var _0x296c=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x96c2[_0x238671];return _0x474844;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x296c('0x0'));var rs=require(_0x296c('0x1'));var fs=require('fs');var Redis=require(_0x296c('0x2'));var db=require(_0x296c('0x3'))['db'];var utils=require(_0x296c('0x4'));var logger=require('../../config/logger')(_0x296c('0x5'));var config=require('../../config/environment');var jayson=require(_0x296c('0x6'));var client=jayson['client'][_0x296c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xc39d10,_0x2c3838,_0x17fb59){return new BPromise(function(_0x3cacb9,_0x2c4dc9){return client[_0x296c('0x8')](_0xc39d10,_0x17fb59)[_0x296c('0x9')](function(_0x104d90){logger[_0x296c('0xa')](_0x296c('0xb'),_0x2c3838,_0x296c('0xc'));logger[_0x296c('0xd')](_0x296c('0xe'),_0x2c3838,_0x296c('0xc'),JSON[_0x296c('0xf')](_0x104d90));if(_0x104d90[_0x296c('0x10')]){if(_0x104d90['error'][_0x296c('0x11')]===0x1f4){logger['error'](_0x296c('0xb'),_0x2c3838,_0x104d90['error'][_0x296c('0x12')]);return _0x2c4dc9(_0x104d90['error'][_0x296c('0x12')]);}logger[_0x296c('0x10')](_0x296c('0xb'),_0x2c3838,_0x104d90[_0x296c('0x10')][_0x296c('0x12')]);return _0x3cacb9(_0x104d90['error']['message']);}else{logger[_0x296c('0xa')](_0x296c('0xb'),_0x2c3838,_0x296c('0xc'));_0x3cacb9(_0x104d90[_0x296c('0x13')][_0x296c('0x12')]);}})['catch'](function(_0x56d50d){logger[_0x296c('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x2c3838,_0x56d50d);_0x2c4dc9(_0x56d50d);});});}exports[_0x296c('0x14')]=function(_0xa0c592){var _0x394c41=this;return new Promise(function(_0xb113ca,_0x406c4d){return db['CmHopperBlack'][_0x296c('0x15')]({'raw':_0xa0c592[_0x296c('0x16')]?_0xa0c592['options']['raw']===undefined?!![]:![]:!![],'where':_0xa0c592['options']?_0xa0c592['options'][_0x296c('0x17')]||null:null,'attributes':_0xa0c592[_0x296c('0x16')]?_0xa0c592[_0x296c('0x16')]['attributes']||null:null,'limit':_0xa0c592[_0x296c('0x16')]?_0xa0c592['options'][_0x296c('0x18')]||null:null,'include':_0xa0c592[_0x296c('0x16')]?_0xa0c592['options']['include']?_[_0x296c('0x19')](_0xa0c592[_0x296c('0x16')]['include'],function(_0x2780d0){return{'model':db[_0x2780d0[_0x296c('0x1a')]],'as':_0x2780d0['as'],'attributes':_0x2780d0[_0x296c('0x1b')],'include':_0x2780d0[_0x296c('0x1c')]?_[_0x296c('0x19')](_0x2780d0[_0x296c('0x1c')],function(_0x6f859a){return{'model':db[_0x6f859a[_0x296c('0x1a')]],'as':_0x6f859a['as'],'attributes':_0x6f859a['attributes'],'include':_0x6f859a[_0x296c('0x1c')]?_[_0x296c('0x19')](_0x6f859a['include'],function(_0x51d4d3){return{'model':db[_0x51d4d3[_0x296c('0x1a')]],'as':_0x51d4d3['as'],'attributes':_0x51d4d3[_0x296c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x296c('0x9')](function(_0x508d8d){logger[_0x296c('0xa')](_0x296c('0x14'),_0xa0c592);logger['debug'](_0x296c('0x14'),_0xa0c592,JSON['stringify'](_0x508d8d));_0xb113ca(_0x508d8d);})[_0x296c('0x1d')](function(_0x1c2414){logger['error'](_0x296c('0x14'),_0x1c2414[_0x296c('0x12')],_0xa0c592);_0x406c4d(_0x394c41[_0x296c('0x10')](0x1f4,_0x1c2414[_0x296c('0x12')]));});});};exports[_0x296c('0x1e')]=function(_0x1ce75d){var _0x4c48e1=this;return new Promise(function(_0x27fa16,_0x5cad1d){return db['CmHopperBlack'][_0x296c('0x1f')](_0x1ce75d[_0x296c('0x20')],{'raw':_0x1ce75d[_0x296c('0x16')]?_0x1ce75d[_0x296c('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ce75d[_0x296c('0x16')]?_0x1ce75d[_0x296c('0x16')][_0x296c('0x17')]||null:null,'attributes':_0x1ce75d[_0x296c('0x16')]?_0x1ce75d['options'][_0x296c('0x1b')]||null:null,'limit':_0x1ce75d[_0x296c('0x16')]?_0x1ce75d[_0x296c('0x16')][_0x296c('0x18')]||null:null})[_0x296c('0x9')](function(_0x2d3f95){logger[_0x296c('0xa')](_0x296c('0x1e'),_0x1ce75d);logger[_0x296c('0xd')](_0x296c('0x1e'),_0x1ce75d,JSON[_0x296c('0xf')](_0x2d3f95));_0x27fa16(_0x2d3f95);})['catch'](function(_0x62ca9d){logger[_0x296c('0x10')]('UpdateCmHopperBlack',_0x62ca9d[_0x296c('0x12')],_0x1ce75d);_0x5cad1d(_0x4c48e1['error'](0x1f4,_0x62ca9d[_0x296c('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x392868){var _0x757bf6=this;return new Promise(function(_0x4d6fef,_0x1b98e9){return db['CmHopperBlack']['destroy']({'where':_0x392868[_0x296c('0x16')]?_0x392868[_0x296c('0x16')]['where']||null:null})[_0x296c('0x9')](function(_0x1f0953){logger[_0x296c('0xa')](_0x296c('0x21'),_0x392868);logger['debug'](_0x296c('0x21'),_0x392868,JSON[_0x296c('0xf')](_0x1f0953));_0x4d6fef(_0x1f0953);})[_0x296c('0x1d')](function(_0x17ee2a){logger[_0x296c('0x10')](_0x296c('0x21'),_0x17ee2a[_0x296c('0x12')],_0x392868);_0x1b98e9(_0x757bf6[_0x296c('0x10')](0x1f4,_0x17ee2a['message']));});});};
\ No newline at end of file
index e74f6a9..3331b6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','/describe','isAuthenticated','show','/:id'];(function(_0x19f733,_0x332935){var _0x5795e8=function(_0x2bf841){while(--_0x2bf841){_0x19f733['push'](_0x19f733['shift']());}};_0x5795e8(++_0x332935);}(_0x54ef,0x112));var _0xf54e=function(_0x34e006,_0x334ac4){_0x34e006=_0x34e006-0x0;var _0x57d7b2=_0x54ef[_0x34e006];return _0x57d7b2;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var auth=require(_0xf54e('0x5'));var interaction=require(_0xf54e('0x6'));var config=require(_0xf54e('0x7'));var controller=require(_0xf54e('0x8'));router[_0xf54e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf54e('0x9')](_0xf54e('0xa'),auth[_0xf54e('0xb')](),controller['describe']);router[_0xf54e('0x9')]('/:id',auth[_0xf54e('0xb')](),controller[_0xf54e('0xc')]);router['put'](_0xf54e('0xd'),auth[_0xf54e('0xb')](),controller[_0xf54e('0xe')]);router[_0xf54e('0xf')]('/:id',auth[_0xf54e('0xb')](),controller[_0xf54e('0x10')]);module[_0xf54e('0x11')]=router;
\ No newline at end of file
+var _0xbec5=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','/:id','show','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x562058,_0x365a8e){var _0x57507c=function(_0x30d28d){while(--_0x30d28d){_0x562058['push'](_0x562058['shift']());}};_0x57507c(++_0x365a8e);}(_0xbec5,0xe5));var _0x5bec=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0xbec5[_0xe1b5f6];return _0x44636e;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var auth=require(_0x5bec('0x5'));var interaction=require(_0x5bec('0x6'));var config=require('../../config/environment');var controller=require(_0x5bec('0x7'));router[_0x5bec('0x8')]('/',auth[_0x5bec('0x9')](),controller['index']);router[_0x5bec('0x8')](_0x5bec('0xa'),auth[_0x5bec('0x9')](),controller[_0x5bec('0xb')]);router[_0x5bec('0x8')](_0x5bec('0xc'),auth[_0x5bec('0x9')](),controller[_0x5bec('0xd')]);router['put'](_0x5bec('0xc'),auth['isAuthenticated'](),controller[_0x5bec('0xe')]);router[_0x5bec('0xf')](_0x5bec('0xc'),auth['isAuthenticated'](),controller[_0x5bec('0x10')]);module[_0x5bec('0x11')]=router;
\ No newline at end of file
index 9804d9b..d7ec0dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64f8=['diff','seconds','dispositionat','BOOLEAN','sequelize','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime'];(function(_0x5a5f05,_0x234d2a){var _0x52a1d4=function(_0x4d9e7c){while(--_0x4d9e7c){_0x5a5f05['push'](_0x5a5f05['shift']());}};_0x52a1d4(++_0x234d2a);}(_0x64f8,0x1f2));var _0x864f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x64f8[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x864f('0x0'));var moment=require('moment');module[_0x864f('0x1')]={'state':{'type':Sequelize[_0x864f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x864f('0x3')]},'scheduledat':{'type':Sequelize[_0x864f('0x4')]},'countbusyretry':{'type':Sequelize[_0x864f('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x864f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x864f('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x864f('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x864f('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x864f('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x864f('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x864f('0x4')]},'answertime':{'type':Sequelize[_0x864f('0x4')]},'droptime':{'type':Sequelize[_0x864f('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x864f('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x864f('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x864f('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x864f('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x864f('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x864f('0x3')]},'membername':{'type':Sequelize[_0x864f('0x3')]},'reason':{'type':Sequelize[_0x864f('0x3')]},'disposition':{'type':Sequelize[_0x864f('0x3')]},'dispositionat':{'type':Sequelize[_0x864f('0x4')],'set':function(_0xea39a5){var _0x10d113=this[_0x864f('0x5')](_0x864f('0x6'));if(_0x10d113&&_0xea39a5){this[_0x864f('0x7')](_0x864f('0x8'),moment(_0xea39a5)[_0x864f('0x9')](moment(_0x10d113),_0x864f('0xa')));}return this[_0x864f('0x7')](_0x864f('0xb'),_0xea39a5);}},'amd':{'type':Sequelize[_0x864f('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x864f('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x864f('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x864f('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x864f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x864f('0x4')]},'deleted':{'type':Sequelize[_0x864f('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x864f('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x864f('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x864f('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x864f('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x63cb=['endtime','setDataValue','followuptime','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x3686f4,_0xd4a373){var _0x168f2b=function(_0x352038){while(--_0x352038){_0x3686f4['push'](_0x3686f4['shift']());}};_0x168f2b(++_0xd4a373);}(_0x63cb,0xfd));var _0xb63c=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x63cb[_0x1d558c];return _0x15767d;};'use strict';var Sequelize=require(_0xb63c('0x0'));var moment=require(_0xb63c('0x1'));module[_0xb63c('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xb63c('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb63c('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb63c('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb63c('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xb63c('0x4')]},'originatecalleridname':{'type':Sequelize[_0xb63c('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb63c('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xb63c('0x5')]},'answertime':{'type':Sequelize[_0xb63c('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xb63c('0x5')]},'ringtime':{'type':Sequelize[_0xb63c('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb63c('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb63c('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb63c('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb63c('0x4')]},'membername':{'type':Sequelize[_0xb63c('0x4')]},'reason':{'type':Sequelize[_0xb63c('0x4')]},'disposition':{'type':Sequelize[_0xb63c('0x4')]},'dispositionat':{'type':Sequelize[_0xb63c('0x5')],'set':function(_0x2f0ee0){var _0x306349=this[_0xb63c('0x6')](_0xb63c('0x7'));if(_0x306349&&_0x2f0ee0){this[_0xb63c('0x8')](_0xb63c('0x9'),moment(_0x2f0ee0)['diff'](moment(_0x306349),_0xb63c('0xa')));}return this[_0xb63c('0x8')](_0xb63c('0xb'),_0x2f0ee0);}},'amd':{'type':Sequelize[_0xb63c('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb63c('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb63c('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb63c('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb63c('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb63c('0x5')]},'deleted':{'type':Sequelize[_0xb63c('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb63c('0x5')]},'recallme':{'type':Sequelize[_0xb63c('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb63c('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xb63c('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb63c('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb63c('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 772cfd1..af385db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7880=['state','calleridnum\x20NOT\x20IN\x20(?)','toString','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','select','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperFinal','type','key','keys','filters','model','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','rawAttributes','intersection','length','describe','uniqueid','body','params','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','`state`\x20=\x208,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','VoiceQueue','find','insert','cm_hopper','fromQuery','phone','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','scheduledAt','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?'];(function(_0xc52550,_0x53feb1){var _0x30605b=function(_0x2fcdf8){while(--_0x2fcdf8){_0xc52550['push'](_0xc52550['shift']());}};_0x30605b(++_0x53feb1);}(_0x7880,0x10f));var _0x0788=function(_0x21c3ac,_0x2a46bb){_0x21c3ac=_0x21c3ac-0x0;var _0x3c45ad=_0x7880[_0x21c3ac];return _0x3c45ad;};'use strict';var pdf=require(_0x0788('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0788('0x1'));var zipdir=require(_0x0788('0x2'));var jsonpatch=require(_0x0788('0x3'));var rp=require(_0x0788('0x4'));var moment=require(_0x0788('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require('path');var sox=require(_0x0788('0x7'));var csv=require(_0x0788('0x8'));var ejs=require(_0x0788('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0788('0xa'));var crypto=require(_0x0788('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0788('0xc'));var toCsv=require(_0x0788('0x8'));var querystring=require(_0x0788('0xd'));var Papa=require(_0x0788('0xe'));var Redis=require(_0x0788('0xf'));var authService=require(_0x0788('0x10'));var qs=require(_0x0788('0x11'));var as=require(_0x0788('0x12'));var hardwareService=require(_0x0788('0x13'));var logger=require(_0x0788('0x14'))(_0x0788('0x15'));var utils=require('../../config/utils');var config=require(_0x0788('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x423e99,_0x9d3024){_0x9d3024=_0x9d3024||0xcc;return function(_0x107260){if(_0x107260){return _0x423e99[_0x0788('0x17')](_0x9d3024);}return _0x423e99[_0x0788('0x18')](_0x9d3024)['end']();};}function respondWithResult(_0x2c4682,_0x4b379e){_0x4b379e=_0x4b379e||0xc8;return function(_0x3efcc8){if(_0x3efcc8){return _0x2c4682['status'](_0x4b379e)['json'](_0x3efcc8);}};}function respondWithFilteredResult(_0x1fedd1,_0x8a7e08){return function(_0x32eae1){if(_0x32eae1){var _0x57a803=_0x32eae1[_0x0788('0x19')],_0x12553c=_0x8a7e08[_0x0788('0x1a')],_0x2d68b0=_0x8a7e08[_0x0788('0x1a')]+_0x8a7e08['limit'],_0x57ac4e;if(_0x2d68b0>=_0x57a803){_0x2d68b0=_0x57a803;_0x57ac4e=0xc8;}else{_0x57ac4e=0xce;}_0x1fedd1['status'](_0x57ac4e);return _0x1fedd1[_0x0788('0x1b')](_0x0788('0x1c'),_0x12553c+'-'+_0x2d68b0+'/'+_0x57a803)['json'](_0x32eae1);}return null;};}function patchUpdates(_0x3f0de9){return function(_0x3e0ad7){try{jsonpatch[_0x0788('0x1d')](_0x3e0ad7,_0x3f0de9,!![]);}catch(_0xd5e0a6){return BPromise[_0x0788('0x1e')](_0xd5e0a6);}return _0x3e0ad7[_0x0788('0x1f')]();};}function saveUpdates(_0x364d7e,_0x3e383b){return function(_0x494a02){if(_0x494a02){return _0x494a02[_0x0788('0x20')](_0x364d7e)[_0x0788('0x21')](function(_0x12aa6a){return _0x12aa6a;});}return null;};}function removeEntity(_0x3f1de2,_0x2444fc){return function(_0x467856){if(_0x467856){return _0x467856[_0x0788('0x22')]()['then'](function(){_0x3f1de2[_0x0788('0x18')](0xcc)[_0x0788('0x23')]();});}};}function handleEntityNotFound(_0x2525f7,_0xefb51d){return function(_0x5e27a5){if(!_0x5e27a5){_0x2525f7['sendStatus'](0x194);}return _0x5e27a5;};}function handleError(_0x2820e4,_0x40bbaf){_0x40bbaf=_0x40bbaf||0x1f4;return function(_0x4cfd91){logger[_0x0788('0x24')](_0x4cfd91[_0x0788('0x25')]);if(_0x4cfd91['name']){delete _0x4cfd91[_0x0788('0x26')];}_0x2820e4[_0x0788('0x18')](_0x40bbaf)[_0x0788('0x27')](_0x4cfd91);};}exports[_0x0788('0x28')]=function(_0x4bfc25,_0x2c3cd0){var _0x5eed61={},_0x497af4={},_0xcd2266={'count':0x0,'rows':[]};var _0xf8d02f=_[_0x0788('0x29')](db[_0x0788('0x2a')]['rawAttributes'],function(_0x54878c){return{'name':_0x54878c['fieldName'],'type':_0x54878c[_0x0788('0x2b')][_0x0788('0x2c')]};});_0x497af4['model']=_[_0x0788('0x29')](_0xf8d02f,_0x0788('0x26'));_0x497af4['query']=_[_0x0788('0x2d')](_0x4bfc25['query']);_0x497af4[_0x0788('0x2e')]=_['intersection'](_0x497af4[_0x0788('0x2f')],_0x497af4[_0x0788('0x30')]);_0x5eed61[_0x0788('0x31')]=_['intersection'](_0x497af4['model'],qs[_0x0788('0x32')](_0x4bfc25[_0x0788('0x30')][_0x0788('0x32')]));_0x5eed61['attributes']=_0x5eed61[_0x0788('0x31')]['length']?_0x5eed61[_0x0788('0x31')]:_0x497af4[_0x0788('0x2f')];if(!_0x4bfc25[_0x0788('0x30')][_0x0788('0x33')](_0x0788('0x34'))){_0x5eed61[_0x0788('0x35')]=qs['limit'](_0x4bfc25[_0x0788('0x30')][_0x0788('0x35')]);_0x5eed61[_0x0788('0x1a')]=qs[_0x0788('0x1a')](_0x4bfc25[_0x0788('0x30')][_0x0788('0x1a')]);}_0x5eed61[_0x0788('0x36')]=qs[_0x0788('0x37')](_0x4bfc25[_0x0788('0x30')][_0x0788('0x37')]);_0x5eed61[_0x0788('0x38')]=qs['filters'](_[_0x0788('0x39')](_0x4bfc25[_0x0788('0x30')],_0x497af4[_0x0788('0x2e')]),_0xf8d02f);if(_0x4bfc25[_0x0788('0x30')][_0x0788('0x3a')]){_0x5eed61[_0x0788('0x38')]=_['merge'](_0x5eed61[_0x0788('0x38')],{'$or':_['map'](_0xf8d02f,function(_0x377ba1){if(_0x377ba1[_0x0788('0x2b')]!==_0x0788('0x3b')){var _0x4fbbfd={};_0x4fbbfd[_0x377ba1[_0x0788('0x26')]]={'$like':'%'+_0x4bfc25[_0x0788('0x30')]['filter']+'%'};return _0x4fbbfd;}})});}_0x5eed61=_[_0x0788('0x3c')]({},_0x5eed61,_0x4bfc25[_0x0788('0x3d')]);var _0x72750f={'where':_0x5eed61[_0x0788('0x38')]};return db[_0x0788('0x2a')][_0x0788('0x19')](_0x72750f)[_0x0788('0x21')](function(_0xd13e15){_0xcd2266['count']=_0xd13e15;if(_0x4bfc25[_0x0788('0x30')][_0x0788('0x3e')]){_0x5eed61[_0x0788('0x3f')]=[{'all':!![]}];}return db[_0x0788('0x2a')]['findAll'](_0x5eed61);})[_0x0788('0x21')](function(_0x2c0319){_0xcd2266[_0x0788('0x40')]=_0x2c0319;return _0xcd2266;})[_0x0788('0x21')](respondWithFilteredResult(_0x2c3cd0,_0x5eed61))[_0x0788('0x41')](handleError(_0x2c3cd0,null));};exports['show']=function(_0x281b07,_0x5cbc08){var _0x45f948={'raw':!![],'where':{'id':_0x281b07['params']['id']}},_0x4e0206={};_0x4e0206['model']=_[_0x0788('0x2d')](db[_0x0788('0x2a')][_0x0788('0x42')]);_0x4e0206[_0x0788('0x30')]=_[_0x0788('0x2d')](_0x281b07[_0x0788('0x30')]);_0x4e0206[_0x0788('0x2e')]=_[_0x0788('0x43')](_0x4e0206[_0x0788('0x2f')],_0x4e0206[_0x0788('0x30')]);_0x45f948[_0x0788('0x31')]=_[_0x0788('0x43')](_0x4e0206[_0x0788('0x2f')],qs[_0x0788('0x32')](_0x281b07[_0x0788('0x30')][_0x0788('0x32')]));_0x45f948[_0x0788('0x31')]=_0x45f948[_0x0788('0x31')][_0x0788('0x44')]?_0x45f948[_0x0788('0x31')]:_0x4e0206[_0x0788('0x2f')];if(_0x281b07['query'][_0x0788('0x3e')]){_0x45f948[_0x0788('0x3f')]=[{'all':!![]}];}_0x45f948=_[_0x0788('0x3c')]({},_0x45f948,_0x281b07[_0x0788('0x3d')]);return db['CmHopperFinal']['find'](_0x45f948)[_0x0788('0x21')](handleEntityNotFound(_0x5cbc08,null))[_0x0788('0x21')](respondWithResult(_0x5cbc08,null))[_0x0788('0x41')](handleError(_0x5cbc08,null));};exports[_0x0788('0x45')]=function(_0x166c16,_0x39a636){return db[_0x0788('0x2a')][_0x0788('0x45')]()['then'](respondWithResult(_0x39a636,null))[_0x0788('0x41')](handleError(_0x39a636,null));};exports[_0x0788('0x20')]=function(_0x31a409,_0x58ea4a){if(_0x31a409['body'][_0x0788('0x46')]){delete _0x31a409[_0x0788('0x47')][_0x0788('0x46')];}return db['CmHopperFinal']['find']({'where':{'uniqueid':_0x31a409[_0x0788('0x48')]['id']}})[_0x0788('0x21')](handleEntityNotFound(_0x58ea4a,null))[_0x0788('0x21')](saveUpdates(_0x31a409[_0x0788('0x47')],null))[_0x0788('0x21')](respondWithResult(_0x58ea4a,null))['catch'](handleError(_0x58ea4a,null));};exports[_0x0788('0x49')]=function(_0x4d217c,_0x2c12b3,_0x1d64ec){return db[_0x0788('0x2a')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x4d217c['params']['id']},'attributes':[[db[_0x0788('0x4a')]['fn'](_0x0788('0x4b'),db['sequelize']['fn']('IF',db[_0x0788('0x4a')]['literal'](_0x0788('0x4c')))),_0x0788('0x4d')],[db[_0x0788('0x4a')]['fn'](_0x0788('0x4b'),db['sequelize']['fn']('IF',db[_0x0788('0x4a')][_0x0788('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0x0788('0x4f')],[db[_0x0788('0x4a')]['fn']('COUNT',db[_0x0788('0x4a')]['fn']('IF',db[_0x0788('0x4a')]['literal']('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db['sequelize']['fn'](_0x0788('0x4b'),db[_0x0788('0x4a')]['fn']('IF',db[_0x0788('0x4a')]['literal'](_0x0788('0x50')))),'congestionContacts'],[db[_0x0788('0x4a')]['fn'](_0x0788('0x4b'),db[_0x0788('0x4a')]['fn']('IF',db[_0x0788('0x4a')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x0788('0x51')],[db[_0x0788('0x4a')]['fn'](_0x0788('0x4b'),db[_0x0788('0x4a')]['fn']('IF',db[_0x0788('0x4a')][_0x0788('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x0788('0x52')],[db['sequelize']['fn']('COUNT',db[_0x0788('0x4a')]['fn']('IF',db['sequelize'][_0x0788('0x4e')](_0x0788('0x53')))),_0x0788('0x54')],[db['sequelize']['fn'](_0x0788('0x4b'),db[_0x0788('0x4a')]['fn']('IF',db['sequelize'][_0x0788('0x4e')](_0x0788('0x55')))),_0x0788('0x56')]]})[_0x0788('0x21')](handleEntityNotFound(_0x2c12b3,null))[_0x0788('0x21')](respondWithResult(_0x2c12b3,null))[_0x0788('0x41')](handleError(_0x2c12b3,null));};exports[_0x0788('0x57')]=function(_0x3859cf,_0x349440,_0x1d2695){return db[_0x0788('0x2a')][_0x0788('0x58')]({'raw':![],'where':{'CampaignId':_0x3859cf[_0x0788('0x48')]['id']},'attributes':[[db[_0x0788('0x4a')]['fn'](_0x0788('0x4b'),db[_0x0788('0x4a')]['fn']('IF',db['sequelize']['literal'](_0x0788('0x4c')))),_0x0788('0x4d')],[db[_0x0788('0x4a')]['fn'](_0x0788('0x4b'),db[_0x0788('0x4a')]['fn']('IF',db[_0x0788('0x4a')][_0x0788('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0x0788('0x4f')],[db[_0x0788('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0788('0x4a')][_0x0788('0x4e')](_0x0788('0x59')))),_0x0788('0x5a')],[db[_0x0788('0x4a')]['fn'](_0x0788('0x4b'),db[_0x0788('0x4a')]['fn']('IF',db[_0x0788('0x4a')][_0x0788('0x4e')](_0x0788('0x50')))),_0x0788('0x5b')],[db[_0x0788('0x4a')]['fn'](_0x0788('0x4b'),db[_0x0788('0x4a')]['fn']('IF',db[_0x0788('0x4a')][_0x0788('0x4e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x0788('0x51')],[db[_0x0788('0x4a')]['fn'](_0x0788('0x4b'),db[_0x0788('0x4a')]['fn']('IF',db['sequelize'][_0x0788('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x0788('0x52')],[db['sequelize']['fn'](_0x0788('0x4b'),db[_0x0788('0x4a')]['fn']('IF',db[_0x0788('0x4a')]['literal'](_0x0788('0x53')))),_0x0788('0x54')],[db[_0x0788('0x4a')]['fn'](_0x0788('0x4b'),db[_0x0788('0x4a')]['fn']('IF',db[_0x0788('0x4a')][_0x0788('0x4e')](_0x0788('0x55')))),'answeringMachine']]})[_0x0788('0x21')](handleEntityNotFound(_0x349440,null))[_0x0788('0x21')](respondWithResult(_0x349440,null))[_0x0788('0x41')](handleError(_0x349440,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x46c9b8,_0x4ac48f,_0x477a8a){return db[_0x0788('0x5c')][_0x0788('0x5d')]({'where':{'id':_0x46c9b8[_0x0788('0x48')]['id']}})[_0x0788('0x21')](handleEntityNotFound(_0x4ac48f,null))[_0x0788('0x21')](function(_0x37f57a){var _0x31faa4;if(_0x37f57a){_0x31faa4=squel[_0x0788('0x5e')]()['into'](_0x0788('0x5f'))[_0x0788('0x60')]([_0x0788('0x61'),'scheduledAt','ContactId',_0x0788('0x62'),_0x0788('0x63'),_0x0788('0x64'),_0x0788('0x65')],squel['select']()[_0x0788('0x66')](_0x0788('0x67'),_0x0788('0x61'))[_0x0788('0x66')]('NOW()',_0x0788('0x68'))[_0x0788('0x66')](_0x0788('0x69'),_0x0788('0x6a'))['field'](_0x0788('0x6b'),_0x0788('0x62'))[_0x0788('0x66')]('ANY_VALUE(VoiceQueueId)','VoiceQueueId')[_0x0788('0x66')](_0x0788('0x6c'),_0x0788('0x64'))['field'](_0x0788('0x6c'),'updatedAt')[_0x0788('0x6d')](_0x0788('0x6e'))[_0x0788('0x38')](_0x0788('0x6f'),_0x46c9b8[_0x0788('0x48')]['id']['toString']())['where'](_0x0788('0x70'),_0x46c9b8[_0x0788('0x47')][_0x0788('0x71')]['toString']())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x0788('0x38')](_0x0788('0x72'),squel['select']()[_0x0788('0x66')](_0x0788('0x61'))[_0x0788('0x6d')](_0x0788('0x5f'))[_0x0788('0x38')](_0x0788('0x6f'),_0x46c9b8['params']['id'][_0x0788('0x73')]()))[_0x0788('0x38')](_0x0788('0x72'),squel['select']()[_0x0788('0x66')]('calleridnum')[_0x0788('0x6d')](_0x0788('0x6e'))['where']('VoiceQueueId\x20=\x20?',_0x46c9b8[_0x0788('0x48')]['id'][_0x0788('0x73')]())['where'](_0x0788('0x74')))[_0x0788('0x75')](_0x0788('0x6a')))[_0x0788('0x73')]();return db[_0x0788('0x4a')]['query'](_0x31faa4);}return[];})['then'](respondWithResult(_0x4ac48f,null))[_0x0788('0x41')](handleError(_0x4ac48f,null));};exports[_0x0788('0x76')]=function(_0x307666,_0x187e03,_0x1ad272){return db[_0x0788('0x77')][_0x0788('0x5d')]({'where':{'id':_0x307666[_0x0788('0x48')]['id']}})[_0x0788('0x21')](handleEntityNotFound(_0x187e03,null))[_0x0788('0x21')](function(_0x5b130f){var _0x387f5c;if(_0x5b130f){_0x387f5c=squel[_0x0788('0x5e')]()[_0x0788('0x78')]('cm_hopper')[_0x0788('0x60')]([_0x0788('0x61'),_0x0788('0x68'),_0x0788('0x6a'),_0x0788('0x62'),_0x0788('0x79'),'createdAt',_0x0788('0x65')],squel[_0x0788('0x7a')]()[_0x0788('0x66')](_0x0788('0x67'),_0x0788('0x61'))[_0x0788('0x66')](_0x0788('0x6c'),_0x0788('0x68'))[_0x0788('0x66')](_0x0788('0x69'),_0x0788('0x6a'))['field'](_0x0788('0x6b'),'ListId')[_0x0788('0x66')](_0x0788('0x7b'),_0x0788('0x79'))['field'](_0x0788('0x6c'),'createdAt')[_0x0788('0x66')](_0x0788('0x6c'),_0x0788('0x65'))['from']('cm_hopper_final')[_0x0788('0x38')](_0x0788('0x7c'),_0x307666['params']['id']['toString']())['where'](_0x0788('0x70'),_0x307666[_0x0788('0x47')][_0x0788('0x71')][_0x0788('0x73')]())[_0x0788('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x0788('0x38')](_0x0788('0x72'),squel[_0x0788('0x7a')]()[_0x0788('0x66')](_0x0788('0x61'))[_0x0788('0x6d')]('cm_hopper')[_0x0788('0x38')](_0x0788('0x7c'),_0x307666[_0x0788('0x48')]['id'][_0x0788('0x73')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x0788('0x7a')]()['field'](_0x0788('0x7d'))[_0x0788('0x6d')](_0x0788('0x6e'))[_0x0788('0x38')](_0x0788('0x7c'),_0x307666[_0x0788('0x48')]['id'][_0x0788('0x73')]())[_0x0788('0x38')](_0x0788('0x74')))[_0x0788('0x75')](_0x0788('0x6a')))[_0x0788('0x73')]();return db[_0x0788('0x4a')][_0x0788('0x30')](_0x387f5c);}return[];})[_0x0788('0x21')](respondWithResult(_0x187e03,null))['catch'](handleError(_0x187e03,null));};exports['checkContactHopper']=function(_0x3b5f18,_0x8fb858,_0x826fad){return db[_0x0788('0x7e')][_0x0788('0x7f')]({'where':{'VoiceQueueId':_0x3b5f18[_0x0788('0x47')][_0x0788('0x63')],'CampaignId':_0x3b5f18[_0x0788('0x47')]['CampaignId'],'ContactId':_0x3b5f18[_0x0788('0x47')][_0x0788('0x6a')]}})[_0x0788('0x21')](handleEntityNotFound(_0x8fb858,null))[_0x0788('0x21')](function(_0x5754bb){if(_0x5754bb){return _0x5754bb;}return null;})[_0x0788('0x21')](respondWithResult(_0x8fb858,null))['catch'](handleError(_0x8fb858,null));};
\ No newline at end of file
+var _0xb96d=['VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','state\x20=\x204','Campaign','scheduledAt','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','rawAttributes','find','uniqueid','body','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x203,\x201,\x20null','busyContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId'];(function(_0x53f04f,_0x419aa8){var _0x16a824=function(_0x5712c9){while(--_0x5712c9){_0x53f04f['push'](_0x53f04f['shift']());}};_0x16a824(++_0x419aa8);}(_0xb96d,0x9e));var _0xdb96=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xb96d[_0x397cfb];return _0x15fed9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdb96('0x0'));var rimraf=require(_0xdb96('0x1'));var zipdir=require(_0xdb96('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb96('0x3'));var moment=require(_0xdb96('0x4'));var BPromise=require(_0xdb96('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdb96('0x6'));var sox=require(_0xdb96('0x7'));var csv=require(_0xdb96('0x8'));var ejs=require(_0xdb96('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdb96('0xa'));var crypto=require(_0xdb96('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdb96('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdb96('0xd'));var Papa=require(_0xdb96('0xe'));var Redis=require('ioredis');var authService=require(_0xdb96('0xf'));var qs=require(_0xdb96('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb96('0x11'));var logger=require(_0xdb96('0x12'))(_0xdb96('0x13'));var utils=require(_0xdb96('0x14'));var config=require('../../config/environment');var db=require(_0xdb96('0x15'))['db'];function respondWithStatusCode(_0x1ed816,_0x33e478){_0x33e478=_0x33e478||0xcc;return function(_0x5a004c){if(_0x5a004c){return _0x1ed816[_0xdb96('0x16')](_0x33e478);}return _0x1ed816[_0xdb96('0x17')](_0x33e478)[_0xdb96('0x18')]();};}function respondWithResult(_0x18a8c0,_0x359970){_0x359970=_0x359970||0xc8;return function(_0xf88086){if(_0xf88086){return _0x18a8c0[_0xdb96('0x17')](_0x359970)[_0xdb96('0x19')](_0xf88086);}};}function respondWithFilteredResult(_0x12630d,_0x745780){return function(_0xb95f96){if(_0xb95f96){var _0x94bbc3=_0xb95f96[_0xdb96('0x1a')],_0x190b52=_0x745780[_0xdb96('0x1b')],_0x596673=_0x745780[_0xdb96('0x1b')]+_0x745780['limit'],_0x3a94da;if(_0x596673>=_0x94bbc3){_0x596673=_0x94bbc3;_0x3a94da=0xc8;}else{_0x3a94da=0xce;}_0x12630d[_0xdb96('0x17')](_0x3a94da);return _0x12630d[_0xdb96('0x1c')](_0xdb96('0x1d'),_0x190b52+'-'+_0x596673+'/'+_0x94bbc3)['json'](_0xb95f96);}return null;};}function patchUpdates(_0x4a6747){return function(_0x16f863){try{jsonpatch['apply'](_0x16f863,_0x4a6747,!![]);}catch(_0x51a885){return BPromise[_0xdb96('0x1e')](_0x51a885);}return _0x16f863[_0xdb96('0x1f')]();};}function saveUpdates(_0x1f8ea2,_0x11b7bd){return function(_0x518a91){if(_0x518a91){return _0x518a91[_0xdb96('0x20')](_0x1f8ea2)['then'](function(_0x22b3aa){return _0x22b3aa;});}return null;};}function removeEntity(_0x467a5d,_0x4ddf48){return function(_0x111673){if(_0x111673){return _0x111673[_0xdb96('0x21')]()[_0xdb96('0x22')](function(){_0x467a5d[_0xdb96('0x17')](0xcc)[_0xdb96('0x18')]();});}};}function handleEntityNotFound(_0xca6ca0,_0x25834a){return function(_0x5a1d1c){if(!_0x5a1d1c){_0xca6ca0[_0xdb96('0x16')](0x194);}return _0x5a1d1c;};}function handleError(_0x18d5a3,_0x350115){_0x350115=_0x350115||0x1f4;return function(_0x47a99a){logger[_0xdb96('0x23')](_0x47a99a[_0xdb96('0x24')]);if(_0x47a99a[_0xdb96('0x25')]){delete _0x47a99a[_0xdb96('0x25')];}_0x18d5a3[_0xdb96('0x17')](_0x350115)[_0xdb96('0x26')](_0x47a99a);};}exports[_0xdb96('0x27')]=function(_0x42365,_0xfa9833){var _0x5efe23={},_0x3e9c4e={},_0x3f2a43={'count':0x0,'rows':[]};var _0x4787e9=_[_0xdb96('0x28')](db[_0xdb96('0x29')]['rawAttributes'],function(_0x32eabc){return{'name':_0x32eabc[_0xdb96('0x2a')],'type':_0x32eabc[_0xdb96('0x2b')][_0xdb96('0x2c')]};});_0x3e9c4e[_0xdb96('0x2d')]=_[_0xdb96('0x28')](_0x4787e9,_0xdb96('0x25'));_0x3e9c4e['query']=_[_0xdb96('0x2e')](_0x42365[_0xdb96('0x2f')]);_0x3e9c4e[_0xdb96('0x30')]=_[_0xdb96('0x31')](_0x3e9c4e['model'],_0x3e9c4e['query']);_0x5efe23[_0xdb96('0x32')]=_[_0xdb96('0x31')](_0x3e9c4e['model'],qs[_0xdb96('0x33')](_0x42365['query']['fields']));_0x5efe23['attributes']=_0x5efe23['attributes'][_0xdb96('0x34')]?_0x5efe23['attributes']:_0x3e9c4e['model'];if(!_0x42365[_0xdb96('0x2f')][_0xdb96('0x35')](_0xdb96('0x36'))){_0x5efe23[_0xdb96('0x37')]=qs['limit'](_0x42365[_0xdb96('0x2f')][_0xdb96('0x37')]);_0x5efe23[_0xdb96('0x1b')]=qs[_0xdb96('0x1b')](_0x42365[_0xdb96('0x2f')]['offset']);}_0x5efe23[_0xdb96('0x38')]=qs[_0xdb96('0x39')](_0x42365[_0xdb96('0x2f')][_0xdb96('0x39')]);_0x5efe23[_0xdb96('0x3a')]=qs[_0xdb96('0x30')](_[_0xdb96('0x3b')](_0x42365['query'],_0x3e9c4e['filters']),_0x4787e9);if(_0x42365['query'][_0xdb96('0x3c')]){_0x5efe23[_0xdb96('0x3a')]=_[_0xdb96('0x3d')](_0x5efe23[_0xdb96('0x3a')],{'$or':_['map'](_0x4787e9,function(_0x23ac66){if(_0x23ac66['type']!=='VIRTUAL'){var _0x3e75e5={};_0x3e75e5[_0x23ac66[_0xdb96('0x25')]]={'$like':'%'+_0x42365[_0xdb96('0x2f')][_0xdb96('0x3c')]+'%'};return _0x3e75e5;}})});}_0x5efe23=_['merge']({},_0x5efe23,_0x42365[_0xdb96('0x3e')]);var _0xa69018={'where':_0x5efe23[_0xdb96('0x3a')]};return db[_0xdb96('0x29')][_0xdb96('0x1a')](_0xa69018)['then'](function(_0x1ff93a){_0x3f2a43['count']=_0x1ff93a;if(_0x42365[_0xdb96('0x2f')][_0xdb96('0x3f')]){_0x5efe23[_0xdb96('0x40')]=[{'all':!![]}];}return db[_0xdb96('0x29')][_0xdb96('0x41')](_0x5efe23);})['then'](function(_0xb2ed0b){_0x3f2a43['rows']=_0xb2ed0b;return _0x3f2a43;})[_0xdb96('0x22')](respondWithFilteredResult(_0xfa9833,_0x5efe23))[_0xdb96('0x42')](handleError(_0xfa9833,null));};exports['show']=function(_0x5f339c,_0xb38a5f){var _0x1d3682={'raw':!![],'where':{'id':_0x5f339c[_0xdb96('0x43')]['id']}},_0x19c7e5={};_0x19c7e5[_0xdb96('0x2d')]=_[_0xdb96('0x2e')](db['CmHopperFinal'][_0xdb96('0x44')]);_0x19c7e5['query']=_[_0xdb96('0x2e')](_0x5f339c['query']);_0x19c7e5['filters']=_[_0xdb96('0x31')](_0x19c7e5['model'],_0x19c7e5['query']);_0x1d3682['attributes']=_['intersection'](_0x19c7e5[_0xdb96('0x2d')],qs[_0xdb96('0x33')](_0x5f339c['query'][_0xdb96('0x33')]));_0x1d3682[_0xdb96('0x32')]=_0x1d3682[_0xdb96('0x32')]['length']?_0x1d3682[_0xdb96('0x32')]:_0x19c7e5[_0xdb96('0x2d')];if(_0x5f339c['query'][_0xdb96('0x3f')]){_0x1d3682[_0xdb96('0x40')]=[{'all':!![]}];}_0x1d3682=_[_0xdb96('0x3d')]({},_0x1d3682,_0x5f339c['options']);return db[_0xdb96('0x29')][_0xdb96('0x45')](_0x1d3682)[_0xdb96('0x22')](handleEntityNotFound(_0xb38a5f,null))['then'](respondWithResult(_0xb38a5f,null))[_0xdb96('0x42')](handleError(_0xb38a5f,null));};exports['describe']=function(_0xd07002,_0x112fbf){return db[_0xdb96('0x29')]['describe']()[_0xdb96('0x22')](respondWithResult(_0x112fbf,null))['catch'](handleError(_0x112fbf,null));};exports[_0xdb96('0x20')]=function(_0x4f1ec6,_0x5cd616){if(_0x4f1ec6['body'][_0xdb96('0x46')]){delete _0x4f1ec6[_0xdb96('0x47')][_0xdb96('0x46')];}return db[_0xdb96('0x29')][_0xdb96('0x45')]({'where':{'uniqueid':_0x4f1ec6[_0xdb96('0x43')]['id']}})[_0xdb96('0x22')](handleEntityNotFound(_0x5cd616,null))[_0xdb96('0x22')](saveUpdates(_0x4f1ec6[_0xdb96('0x47')],null))[_0xdb96('0x22')](respondWithResult(_0x5cd616,null))[_0xdb96('0x42')](handleError(_0x5cd616,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x3be97e,_0x223dd1,_0x175688){return db[_0xdb96('0x29')][_0xdb96('0x41')]({'raw':![],'where':{'VoiceQueueId':_0x3be97e[_0xdb96('0x43')]['id']},'attributes':[[db[_0xdb96('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdb96('0x48')][_0xdb96('0x49')](_0xdb96('0x4a')))),_0xdb96('0x4b')],[db[_0xdb96('0x48')]['fn'](_0xdb96('0x4c'),db['sequelize']['fn']('IF',db[_0xdb96('0x48')][_0xdb96('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0xdb96('0x4d')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdb96('0x48')]['literal'](_0xdb96('0x4e')))),'busyContacts'],[db[_0xdb96('0x48')]['fn'](_0xdb96('0x4c'),db[_0xdb96('0x48')]['fn']('IF',db[_0xdb96('0x48')][_0xdb96('0x49')](_0xdb96('0x4f')))),_0xdb96('0x50')],[db[_0xdb96('0x48')]['fn'](_0xdb96('0x4c'),db['sequelize']['fn']('IF',db[_0xdb96('0x48')][_0xdb96('0x49')](_0xdb96('0x51')))),_0xdb96('0x52')],[db[_0xdb96('0x48')]['fn'](_0xdb96('0x4c'),db[_0xdb96('0x48')]['fn']('IF',db[_0xdb96('0x48')][_0xdb96('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xdb96('0x53')],[db[_0xdb96('0x48')]['fn'](_0xdb96('0x4c'),db[_0xdb96('0x48')]['fn']('IF',db['sequelize'][_0xdb96('0x49')](_0xdb96('0x54')))),_0xdb96('0x55')],[db[_0xdb96('0x48')]['fn'](_0xdb96('0x4c'),db[_0xdb96('0x48')]['fn']('IF',db['sequelize'][_0xdb96('0x49')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xdb96('0x22')](handleEntityNotFound(_0x223dd1,null))[_0xdb96('0x22')](respondWithResult(_0x223dd1,null))['catch'](handleError(_0x223dd1,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x111843,_0x1e0055,_0x383341){return db[_0xdb96('0x29')][_0xdb96('0x41')]({'raw':![],'where':{'CampaignId':_0x111843['params']['id']},'attributes':[[db[_0xdb96('0x48')]['fn'](_0xdb96('0x4c'),db['sequelize']['fn']('IF',db[_0xdb96('0x48')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0xdb96('0x4b')],[db[_0xdb96('0x48')]['fn'](_0xdb96('0x4c'),db[_0xdb96('0x48')]['fn']('IF',db['sequelize'][_0xdb96('0x49')](_0xdb96('0x56')))),_0xdb96('0x4d')],[db[_0xdb96('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdb96('0x48')][_0xdb96('0x49')](_0xdb96('0x4e')))),_0xdb96('0x57')],[db['sequelize']['fn'](_0xdb96('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0xdb96('0x49')](_0xdb96('0x4f')))),_0xdb96('0x50')],[db['sequelize']['fn'](_0xdb96('0x4c'),db['sequelize']['fn']('IF',db[_0xdb96('0x48')][_0xdb96('0x49')](_0xdb96('0x51')))),_0xdb96('0x52')],[db[_0xdb96('0x48')]['fn'](_0xdb96('0x4c'),db[_0xdb96('0x48')]['fn']('IF',db[_0xdb96('0x48')][_0xdb96('0x49')](_0xdb96('0x58')))),_0xdb96('0x53')],[db[_0xdb96('0x48')]['fn'](_0xdb96('0x4c'),db[_0xdb96('0x48')]['fn']('IF',db[_0xdb96('0x48')][_0xdb96('0x49')](_0xdb96('0x54')))),_0xdb96('0x55')],[db['sequelize']['fn'](_0xdb96('0x4c'),db[_0xdb96('0x48')]['fn']('IF',db[_0xdb96('0x48')][_0xdb96('0x49')](_0xdb96('0x59')))),_0xdb96('0x5a')]]})[_0xdb96('0x22')](handleEntityNotFound(_0x1e0055,null))[_0xdb96('0x22')](respondWithResult(_0x1e0055,null))['catch'](handleError(_0x1e0055,null));};exports[_0xdb96('0x5b')]=function(_0x409b5a,_0x5cb56b,_0x850a4e){return db[_0xdb96('0x5c')][_0xdb96('0x45')]({'where':{'id':_0x409b5a['params']['id']}})[_0xdb96('0x22')](handleEntityNotFound(_0x5cb56b,null))['then'](function(_0x462dde){var _0x2e004c;if(_0x462dde){_0x2e004c=squel[_0xdb96('0x5d')]()[_0xdb96('0x5e')](_0xdb96('0x5f'))[_0xdb96('0x60')]([_0xdb96('0x61'),'scheduledAt',_0xdb96('0x62'),_0xdb96('0x63'),_0xdb96('0x64'),_0xdb96('0x65'),_0xdb96('0x66')],squel[_0xdb96('0x67')]()['field'](_0xdb96('0x68'),_0xdb96('0x61'))[_0xdb96('0x69')]('NOW()','scheduledAt')[_0xdb96('0x69')](_0xdb96('0x6a'),_0xdb96('0x62'))[_0xdb96('0x69')](_0xdb96('0x6b'),'ListId')[_0xdb96('0x69')](_0xdb96('0x6c'),'VoiceQueueId')[_0xdb96('0x69')](_0xdb96('0x6d'),_0xdb96('0x65'))[_0xdb96('0x69')](_0xdb96('0x6d'),_0xdb96('0x66'))['from'](_0xdb96('0x6e'))['where'](_0xdb96('0x6f'),_0x409b5a['params']['id'][_0xdb96('0x70')]())[_0xdb96('0x3a')](_0xdb96('0x71'),_0x409b5a[_0xdb96('0x47')][_0xdb96('0x72')][_0xdb96('0x70')]())[_0xdb96('0x3a')](_0xdb96('0x73'))[_0xdb96('0x3a')](_0xdb96('0x74'),squel[_0xdb96('0x67')]()['field'](_0xdb96('0x61'))['from'](_0xdb96('0x5f'))['where'](_0xdb96('0x6f'),_0x409b5a[_0xdb96('0x43')]['id'][_0xdb96('0x70')]()))[_0xdb96('0x3a')](_0xdb96('0x74'),squel[_0xdb96('0x67')]()[_0xdb96('0x69')]('calleridnum')[_0xdb96('0x75')]('cm_hopper_final')[_0xdb96('0x3a')](_0xdb96('0x6f'),_0x409b5a['params']['id'][_0xdb96('0x70')]())['where'](_0xdb96('0x76')))['group'](_0xdb96('0x62')))[_0xdb96('0x70')]();return db[_0xdb96('0x48')][_0xdb96('0x2f')](_0x2e004c);}return[];})[_0xdb96('0x22')](respondWithResult(_0x5cb56b,null))['catch'](handleError(_0x5cb56b,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x36ec33,_0xa35fb2,_0x195070){return db[_0xdb96('0x77')][_0xdb96('0x45')]({'where':{'id':_0x36ec33[_0xdb96('0x43')]['id']}})[_0xdb96('0x22')](handleEntityNotFound(_0xa35fb2,null))[_0xdb96('0x22')](function(_0x48060f){var _0xe92641;if(_0x48060f){_0xe92641=squel[_0xdb96('0x5d')]()['into']('cm_hopper')['fromQuery']([_0xdb96('0x61'),_0xdb96('0x78'),_0xdb96('0x62'),_0xdb96('0x63'),_0xdb96('0x79'),_0xdb96('0x65'),_0xdb96('0x66')],squel[_0xdb96('0x67')]()['field'](_0xdb96('0x68'),_0xdb96('0x61'))[_0xdb96('0x69')](_0xdb96('0x6d'),'scheduledAt')[_0xdb96('0x69')](_0xdb96('0x6a'),'ContactId')[_0xdb96('0x69')](_0xdb96('0x6b'),_0xdb96('0x63'))[_0xdb96('0x69')](_0xdb96('0x7a'),_0xdb96('0x79'))['field'](_0xdb96('0x6d'),_0xdb96('0x65'))['field'](_0xdb96('0x6d'),_0xdb96('0x66'))[_0xdb96('0x75')](_0xdb96('0x6e'))['where'](_0xdb96('0x7b'),_0x36ec33[_0xdb96('0x43')]['id'][_0xdb96('0x70')]())[_0xdb96('0x3a')](_0xdb96('0x71'),_0x36ec33['body']['state'][_0xdb96('0x70')]())[_0xdb96('0x3a')](_0xdb96('0x73'))[_0xdb96('0x3a')](_0xdb96('0x74'),squel[_0xdb96('0x67')]()['field'](_0xdb96('0x61'))['from']('cm_hopper')[_0xdb96('0x3a')](_0xdb96('0x7b'),_0x36ec33[_0xdb96('0x43')]['id']['toString']()))[_0xdb96('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xdb96('0x69')](_0xdb96('0x7c'))[_0xdb96('0x75')](_0xdb96('0x6e'))[_0xdb96('0x3a')]('CampaignId\x20=\x20?',_0x36ec33[_0xdb96('0x43')]['id'][_0xdb96('0x70')]())[_0xdb96('0x3a')](_0xdb96('0x76')))[_0xdb96('0x7d')](_0xdb96('0x62')))[_0xdb96('0x70')]();return db[_0xdb96('0x48')]['query'](_0xe92641);}return[];})[_0xdb96('0x22')](respondWithResult(_0xa35fb2,null))[_0xdb96('0x42')](handleError(_0xa35fb2,null));};exports[_0xdb96('0x7e')]=function(_0x3af79f,_0x29ce25,_0x46aace){return db[_0xdb96('0x7f')][_0xdb96('0x80')]({'where':{'VoiceQueueId':_0x3af79f[_0xdb96('0x47')][_0xdb96('0x64')],'CampaignId':_0x3af79f[_0xdb96('0x47')]['CampaignId'],'ContactId':_0x3af79f[_0xdb96('0x47')][_0xdb96('0x62')]}})['then'](handleEntityNotFound(_0x29ce25,null))[_0xdb96('0x22')](function(_0x311f0f){if(_0x311f0f){return _0x311f0f;}return null;})['then'](respondWithResult(_0x29ce25,null))[_0xdb96('0x42')](handleError(_0x29ce25,null));};
\ No newline at end of file
index 183cf40..b2a59bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa73a=['api','moment','bluebird','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum','uniqueid','util','../../config/logger'];(function(_0x95f477,_0x147d31){var _0x558c53=function(_0x4d5213){while(--_0x4d5213){_0x95f477['push'](_0x95f477['shift']());}};_0x558c53(++_0x147d31);}(_0xa73a,0x82));var _0xaa73=function(_0x3d9176,_0x399d6f){_0x3d9176=_0x3d9176-0x0;var _0x12adc5=_0xa73a[_0x3d9176];return _0x12adc5;};'use strict';var _=require('lodash');var util=require(_0xaa73('0x0'));var logger=require(_0xaa73('0x1'))(_0xaa73('0x2'));var moment=require(_0xaa73('0x3'));var BPromise=require(_0xaa73('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa73('0x5'));var attributes=require(_0xaa73('0x6'));module[_0xaa73('0x7')]=function(_0x15d1c6,_0xf84c2e){return _0x15d1c6[_0xaa73('0x8')](_0xaa73('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xaa73('0xa')]},{'name':_0xaa73('0xb'),'fields':[_0xaa73('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3eec=['path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1ffe9c,_0x3fb215){var _0x4ed526=function(_0x656750){while(--_0x656750){_0x1ffe9c['push'](_0x1ffe9c['shift']());}};_0x4ed526(++_0x3fb215);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x1d1f8f,_0x50778c){_0x1d1f8f=_0x1d1f8f-0x0;var _0x20d217=_0x3eec[_0x1d1f8f];return _0x20d217;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var logger=require(_0xc3ee('0x2'))(_0xc3ee('0x3'));var moment=require('moment');var BPromise=require(_0xc3ee('0x4'));var rp=require(_0xc3ee('0x5'));var fs=require('fs');var path=require(_0xc3ee('0x6'));var rimraf=require(_0xc3ee('0x7'));var config=require(_0xc3ee('0x8'));var attributes=require(_0xc3ee('0x9'));module['exports']=function(_0x471de7,_0xbd5b6){return _0x471de7[_0xc3ee('0xa')](_0xc3ee('0xb'),attributes,{'tableName':_0xc3ee('0xc'),'paranoid':![],'indexes':[{'name':_0xc3ee('0xd'),'fields':[_0xc3ee('0xd')]},{'name':_0xc3ee('0xe'),'fields':[_0xc3ee('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 07a1e8d..24d9f5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56e6=['request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CmHopperFinal','options','raw','CreateCmHopperFinal','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x36a5c2,_0x1674d5){var _0x4692e9=function(_0x1877e5){while(--_0x1877e5){_0x36a5c2['push'](_0x36a5c2['shift']());}};_0x4692e9(++_0x1674d5);}(_0x56e6,0x6b));var _0x656e=function(_0x424cc2,_0x521786){_0x424cc2=_0x424cc2-0x0;var _0x5aaef4=_0x56e6[_0x424cc2];return _0x5aaef4;};'use strict';var _=require(_0x656e('0x0'));var util=require(_0x656e('0x1'));var moment=require(_0x656e('0x2'));var BPromise=require(_0x656e('0x3'));var rs=require(_0x656e('0x4'));var fs=require('fs');var Redis=require(_0x656e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x656e('0x6'));var logger=require(_0x656e('0x7'))(_0x656e('0x8'));var config=require(_0x656e('0x9'));var jayson=require(_0x656e('0xa'));var client=jayson[_0x656e('0xb')][_0x656e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54eddb,_0x35d629,_0x1538a5){return new BPromise(function(_0x1dad4e,_0x2fc011){return client[_0x656e('0xd')](_0x54eddb,_0x1538a5)[_0x656e('0xe')](function(_0x30d78c){logger[_0x656e('0xf')](_0x656e('0x10'),_0x35d629,_0x656e('0x11'));logger[_0x656e('0x12')](_0x656e('0x13'),_0x35d629,_0x656e('0x11'),JSON[_0x656e('0x14')](_0x30d78c));if(_0x30d78c['error']){if(_0x30d78c['error'][_0x656e('0x15')]===0x1f4){logger[_0x656e('0x16')](_0x656e('0x10'),_0x35d629,_0x30d78c[_0x656e('0x16')]['message']);return _0x2fc011(_0x30d78c['error'][_0x656e('0x17')]);}logger[_0x656e('0x16')]('CmHopperFinal,\x20%s,\x20%s',_0x35d629,_0x30d78c[_0x656e('0x16')]['message']);return _0x1dad4e(_0x30d78c[_0x656e('0x16')][_0x656e('0x17')]);}else{logger[_0x656e('0xf')](_0x656e('0x10'),_0x35d629,'request\x20sent');_0x1dad4e(_0x30d78c[_0x656e('0x18')][_0x656e('0x17')]);}})[_0x656e('0x19')](function(_0x3a6cf8){logger[_0x656e('0x16')]('CmHopperFinal,\x20%s,\x20%s',_0x35d629,_0x3a6cf8);_0x2fc011(_0x3a6cf8);});});}exports['CreateCmHopperFinal']=function(_0x526b83){var _0x4318d1=this;return new Promise(function(_0x1b0fdd,_0x577deb){return db[_0x656e('0x1a')]['create'](_0x526b83['body'],{'raw':_0x526b83['options']?_0x526b83[_0x656e('0x1b')][_0x656e('0x1c')]===undefined?!![]:![]:!![]})[_0x656e('0xe')](function(_0x141587){logger['info'](_0x656e('0x1d'),_0x526b83);logger[_0x656e('0x12')](_0x656e('0x1d'),_0x526b83,JSON['stringify'](_0x141587));_0x1b0fdd(_0x141587);})[_0x656e('0x19')](function(_0x1acca5){logger[_0x656e('0x16')](_0x656e('0x1d'),_0x1acca5[_0x656e('0x17')],_0x526b83);_0x577deb(_0x4318d1[_0x656e('0x16')](0x1f4,_0x1acca5[_0x656e('0x17')]));});});};
\ No newline at end of file
+var _0xe233=['message','catch','CmHopperFinal','create','body','options','raw','debug','CreateCmHopperFinal','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0xe233,0x15b));var _0x3e23=function(_0x2ddd13,_0x4dd0bd){_0x2ddd13=_0x2ddd13-0x0;var _0x8b928b=_0xe233[_0x2ddd13];return _0x8b928b;};'use strict';var _=require(_0x3e23('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3e23('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e23('0x2'))['db'];var utils=require(_0x3e23('0x3'));var logger=require(_0x3e23('0x4'))(_0x3e23('0x5'));var config=require(_0x3e23('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3e23('0x7')][_0x3e23('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x391d80,_0x1fb864,_0x3d0631){return new BPromise(function(_0xec43a3,_0x35cd2c){return client[_0x3e23('0x9')](_0x391d80,_0x3d0631)[_0x3e23('0xa')](function(_0x3f524e){logger[_0x3e23('0xb')](_0x3e23('0xc'),_0x1fb864,_0x3e23('0xd'));logger['debug']('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x1fb864,_0x3e23('0xd'),JSON[_0x3e23('0xe')](_0x3f524e));if(_0x3f524e[_0x3e23('0xf')]){if(_0x3f524e[_0x3e23('0xf')][_0x3e23('0x10')]===0x1f4){logger['error']('CmHopperFinal,\x20%s,\x20%s',_0x1fb864,_0x3f524e['error'][_0x3e23('0x11')]);return _0x35cd2c(_0x3f524e[_0x3e23('0xf')][_0x3e23('0x11')]);}logger[_0x3e23('0xf')](_0x3e23('0xc'),_0x1fb864,_0x3f524e[_0x3e23('0xf')]['message']);return _0xec43a3(_0x3f524e['error']['message']);}else{logger['info'](_0x3e23('0xc'),_0x1fb864,'request\x20sent');_0xec43a3(_0x3f524e['result'][_0x3e23('0x11')]);}})[_0x3e23('0x12')](function(_0x420516){logger['error'](_0x3e23('0xc'),_0x1fb864,_0x420516);_0x35cd2c(_0x420516);});});}exports['CreateCmHopperFinal']=function(_0x492f88){var _0x55790a=this;return new Promise(function(_0x13fe4f,_0x100924){return db[_0x3e23('0x13')][_0x3e23('0x14')](_0x492f88[_0x3e23('0x15')],{'raw':_0x492f88['options']?_0x492f88[_0x3e23('0x16')][_0x3e23('0x17')]===undefined?!![]:![]:!![]})[_0x3e23('0xa')](function(_0x30faeb){logger[_0x3e23('0xb')]('CreateCmHopperFinal',_0x492f88);logger[_0x3e23('0x18')](_0x3e23('0x19'),_0x492f88,JSON['stringify'](_0x30faeb));_0x13fe4f(_0x30faeb);})[_0x3e23('0x12')](function(_0x453f02){logger[_0x3e23('0xf')](_0x3e23('0x19'),_0x453f02[_0x3e23('0x11')],_0x492f88);_0x100924(_0x55790a['error'](0x1f4,_0x453f02['message']));});});};
\ No newline at end of file
index 6bf711a..55fafb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabb5=['put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xabb5,0x179));var _0x5abb=function(_0x54776d,_0x19b575){_0x54776d=_0x54776d-0x0;var _0x2c0d6d=_0xabb5[_0x54776d];return _0x2c0d6d;};'use strict';var multer=require(_0x5abb('0x0'));var util=require(_0x5abb('0x1'));var path=require(_0x5abb('0x2'));var timeout=require(_0x5abb('0x3'));var express=require(_0x5abb('0x4'));var router=express[_0x5abb('0x5')]();var auth=require(_0x5abb('0x6'));var interaction=require(_0x5abb('0x7'));var config=require(_0x5abb('0x8'));var controller=require(_0x5abb('0x9'));router[_0x5abb('0xa')]('/',auth[_0x5abb('0xb')](),controller[_0x5abb('0xc')]);router[_0x5abb('0xa')](_0x5abb('0xd'),auth[_0x5abb('0xb')](),controller[_0x5abb('0xe')]);router[_0x5abb('0xa')](_0x5abb('0xf'),auth[_0x5abb('0xb')](),controller[_0x5abb('0x10')]);router[_0x5abb('0xa')]('/voice/queue/countAttributes/:id',auth[_0x5abb('0xb')](),controller[_0x5abb('0x11')]);router[_0x5abb('0xa')]('/campaign/countAttributes/:id',auth[_0x5abb('0xb')](),controller[_0x5abb('0x12')]);router[_0x5abb('0x13')]('/voice/queue/moveContacts/:id',auth[_0x5abb('0xb')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x5abb('0x13')](_0x5abb('0x14'),auth[_0x5abb('0xb')](),controller[_0x5abb('0x15')]);router[_0x5abb('0x13')]('/checkContactHopper',auth[_0x5abb('0xb')](),controller[_0x5abb('0x16')]);router[_0x5abb('0x17')](_0x5abb('0xf'),auth[_0x5abb('0xb')](),controller['update']);module[_0x5abb('0x18')]=router;
\ No newline at end of file
+var _0xcdd4=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','/:id','update','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post'];(function(_0x3ae7b5,_0x181515){var _0x57ed7f=function(_0x37cab5){while(--_0x37cab5){_0x3ae7b5['push'](_0x3ae7b5['shift']());}};_0x57ed7f(++_0x181515);}(_0xcdd4,0x179));var _0x4cdd=function(_0x3d3287,_0x8139e8){_0x3d3287=_0x3d3287-0x0;var _0x153b75=_0xcdd4[_0x3d3287];return _0x153b75;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4cdd('0x0'));var timeout=require(_0x4cdd('0x1'));var express=require(_0x4cdd('0x2'));var router=express[_0x4cdd('0x3')]();var auth=require(_0x4cdd('0x4'));var interaction=require(_0x4cdd('0x5'));var config=require(_0x4cdd('0x6'));var controller=require('./cmHopperFinal.controller');router[_0x4cdd('0x7')]('/',auth[_0x4cdd('0x8')](),controller[_0x4cdd('0x9')]);router[_0x4cdd('0x7')]('/describe',auth[_0x4cdd('0x8')](),controller['describe']);router['get']('/:id',auth[_0x4cdd('0x8')](),controller['show']);router['get'](_0x4cdd('0xa'),auth['isAuthenticated'](),controller[_0x4cdd('0xb')]);router['get']('/campaign/countAttributes/:id',auth[_0x4cdd('0x8')](),controller[_0x4cdd('0xc')]);router[_0x4cdd('0xd')](_0x4cdd('0xe'),auth[_0x4cdd('0x8')](),controller[_0x4cdd('0xf')]);router[_0x4cdd('0xd')](_0x4cdd('0x10'),auth[_0x4cdd('0x8')](),controller[_0x4cdd('0x11')]);router['post'](_0x4cdd('0x12'),auth['isAuthenticated'](),controller['checkContactHopper']);router[_0x4cdd('0x13')](_0x4cdd('0x14'),auth[_0x4cdd('0x8')](),controller[_0x4cdd('0x15')]);module[_0x4cdd('0x16')]=router;
\ No newline at end of file
index 900e390..7fbafc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x675e=['STRING','DATE','BOOLEAN','sequelize','INTEGER'];(function(_0x434903,_0x2bae84){var _0x31021e=function(_0x176a5f){while(--_0x176a5f){_0x434903['push'](_0x434903['shift']());}};_0x31021e(++_0x2bae84);}(_0x675e,0x17a));var _0xe675=function(_0x53c4f8,_0x44ccaf){_0x53c4f8=_0x53c4f8-0x0;var _0x416458=_0x675e[_0x53c4f8];return _0x416458;};'use strict';var Sequelize=require(_0xe675('0x0'));module['exports']={'state':{'type':Sequelize[_0xe675('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xe675('0x2')]},'scheduledat':{'type':Sequelize[_0xe675('0x3')]},'countbusyretry':{'type':Sequelize[_0xe675('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe675('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe675('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe675('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe675('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xe675('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe675('0x2')]},'calleridname':{'type':Sequelize[_0xe675('0x2')]},'starttime':{'type':Sequelize[_0xe675('0x3')]},'responsetime':{'type':Sequelize[_0xe675('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xe675('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe675('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe675('0x2')]},'membername':{'type':Sequelize[_0xe675('0x2')]},'reason':{'type':Sequelize[_0xe675('0x2')]},'amd':{'type':Sequelize[_0xe675('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe675('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xe675('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe675('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xe675('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0xe675('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xe675('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe675('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe675('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe675('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xbdfe=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x102b0c,_0x55ccdf){var _0x505937=function(_0x1dad22){while(--_0x1dad22){_0x102b0c['push'](_0x102b0c['shift']());}};_0x505937(++_0x55ccdf);}(_0xbdfe,0xdf));var _0xebdf=function(_0x26c112,_0x41e2fd){_0x26c112=_0x26c112-0x0;var _0x4933d8=_0xbdfe[_0x26c112];return _0x4933d8;};'use strict';var Sequelize=require(_0xebdf('0x0'));module[_0xebdf('0x1')]={'state':{'type':Sequelize[_0xebdf('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xebdf('0x3')]},'scheduledat':{'type':Sequelize[_0xebdf('0x4')]},'countbusyretry':{'type':Sequelize[_0xebdf('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xebdf('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xebdf('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xebdf('0x3')]},'originatecalleridname':{'type':Sequelize[_0xebdf('0x3')]},'calleridnum':{'type':Sequelize[_0xebdf('0x3')]},'calleridname':{'type':Sequelize[_0xebdf('0x3')]},'starttime':{'type':Sequelize[_0xebdf('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xebdf('0x4')]},'droptime':{'type':Sequelize[_0xebdf('0x4')]},'endtime':{'type':Sequelize[_0xebdf('0x4')]},'ringtime':{'type':Sequelize[_0xebdf('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xebdf('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xebdf('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xebdf('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xebdf('0x3')]},'campaign':{'type':Sequelize[_0xebdf('0x3')]},'campaigntype':{'type':Sequelize[_0xebdf('0x3')]},'membername':{'type':Sequelize[_0xebdf('0x3')]},'reason':{'type':Sequelize[_0xebdf('0x3')]},'amd':{'type':Sequelize[_0xebdf('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xebdf('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xebdf('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xebdf('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xebdf('0x4')]},'recallme':{'type':Sequelize[_0xebdf('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xebdf('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xebdf('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xebdf('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xebdf('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xebdf('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xebdf('0x3')]}};
\ No newline at end of file
index 5306b25..62bd2e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62d7=['find','create','describe','body','uniqueid','html-pdf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params'];(function(_0x6aaf7a,_0x2ddf35){var _0x522e20=function(_0x5b6e19){while(--_0x5b6e19){_0x6aaf7a['push'](_0x6aaf7a['shift']());}};_0x522e20(++_0x2ddf35);}(_0x62d7,0x172));var _0x762d=function(_0xe7a2e7,_0xd8f8c5){_0xe7a2e7=_0xe7a2e7-0x0;var _0x1b4096=_0x62d7[_0xe7a2e7];return _0x1b4096;};'use strict';var pdf=require(_0x762d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x762d('0x1'));var jsonpatch=require(_0x762d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x762d('0x3'));var Mustache=require('mustache');var util=require(_0x762d('0x4'));var path=require(_0x762d('0x5'));var sox=require(_0x762d('0x6'));var csv=require(_0x762d('0x7'));var ejs=require(_0x762d('0x8'));var fs=require('fs');var _=require(_0x762d('0x9'));var squel=require(_0x762d('0xa'));var crypto=require(_0x762d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x762d('0xc'));var toCsv=require(_0x762d('0x7'));var querystring=require(_0x762d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x762d('0xe'));var qs=require(_0x762d('0xf'));var as=require(_0x762d('0x10'));var hardwareService=require(_0x762d('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x762d('0x12'));var config=require(_0x762d('0x13'));var db=require(_0x762d('0x14'))['db'];function respondWithStatusCode(_0x3f6258,_0x16cfe9){_0x16cfe9=_0x16cfe9||0xcc;return function(_0x49232a){if(_0x49232a){return _0x3f6258[_0x762d('0x15')](_0x16cfe9);}return _0x3f6258[_0x762d('0x16')](_0x16cfe9)[_0x762d('0x17')]();};}function respondWithResult(_0x272f48,_0x19ab68){_0x19ab68=_0x19ab68||0xc8;return function(_0x253d78){if(_0x253d78){return _0x272f48[_0x762d('0x16')](_0x19ab68)[_0x762d('0x18')](_0x253d78);}};}function respondWithFilteredResult(_0x4330c6,_0x1eda39){return function(_0x37b5ba){if(_0x37b5ba){var _0x5dca41=_0x37b5ba[_0x762d('0x19')],_0x33de9e=_0x1eda39[_0x762d('0x1a')],_0x15fdaf=_0x1eda39[_0x762d('0x1a')]+_0x1eda39[_0x762d('0x1b')],_0x497073;if(_0x15fdaf>=_0x5dca41){_0x15fdaf=_0x5dca41;_0x497073=0xc8;}else{_0x497073=0xce;}_0x4330c6['status'](_0x497073);return _0x4330c6[_0x762d('0x1c')](_0x762d('0x1d'),_0x33de9e+'-'+_0x15fdaf+'/'+_0x5dca41)[_0x762d('0x18')](_0x37b5ba);}return null;};}function patchUpdates(_0x4136f1){return function(_0xa1a276){try{jsonpatch[_0x762d('0x1e')](_0xa1a276,_0x4136f1,!![]);}catch(_0x479bf3){return BPromise[_0x762d('0x1f')](_0x479bf3);}return _0xa1a276['save']();};}function saveUpdates(_0x576e30,_0x268bc5){return function(_0x59574d){if(_0x59574d){return _0x59574d[_0x762d('0x20')](_0x576e30)[_0x762d('0x21')](function(_0x47659b){return _0x47659b;});}return null;};}function removeEntity(_0x4338f1,_0xb044a1){return function(_0x598cab){if(_0x598cab){return _0x598cab[_0x762d('0x22')]()[_0x762d('0x21')](function(){_0x4338f1[_0x762d('0x16')](0xcc)[_0x762d('0x17')]();});}};}function handleEntityNotFound(_0x48d6ea,_0x295f39){return function(_0x57a7e1){if(!_0x57a7e1){_0x48d6ea[_0x762d('0x15')](0x194);}return _0x57a7e1;};}function handleError(_0x40e2ed,_0x2e0330){_0x2e0330=_0x2e0330||0x1f4;return function(_0x2e4467){logger[_0x762d('0x23')](_0x2e4467[_0x762d('0x24')]);if(_0x2e4467['name']){delete _0x2e4467['name'];}_0x40e2ed['status'](_0x2e0330)[_0x762d('0x25')](_0x2e4467);};}exports[_0x762d('0x26')]=function(_0xdd98a1,_0x3030dc){var _0x3a7a6c={},_0x242ecf={},_0x387648={'count':0x0,'rows':[]};var _0x4e35c6=_[_0x762d('0x27')](db[_0x762d('0x28')][_0x762d('0x29')],function(_0xbe2f5e){return{'name':_0xbe2f5e[_0x762d('0x2a')],'type':_0xbe2f5e[_0x762d('0x2b')][_0x762d('0x2c')]};});_0x242ecf[_0x762d('0x2d')]=_[_0x762d('0x27')](_0x4e35c6,'name');_0x242ecf[_0x762d('0x2e')]=_[_0x762d('0x2f')](_0xdd98a1['query']);_0x242ecf[_0x762d('0x30')]=_[_0x762d('0x31')](_0x242ecf[_0x762d('0x2d')],_0x242ecf[_0x762d('0x2e')]);_0x3a7a6c['attributes']=_[_0x762d('0x31')](_0x242ecf[_0x762d('0x2d')],qs[_0x762d('0x32')](_0xdd98a1['query']['fields']));_0x3a7a6c['attributes']=_0x3a7a6c[_0x762d('0x33')][_0x762d('0x34')]?_0x3a7a6c[_0x762d('0x33')]:_0x242ecf[_0x762d('0x2d')];if(!_0xdd98a1[_0x762d('0x2e')][_0x762d('0x35')](_0x762d('0x36'))){_0x3a7a6c[_0x762d('0x1b')]=qs[_0x762d('0x1b')](_0xdd98a1[_0x762d('0x2e')][_0x762d('0x1b')]);_0x3a7a6c['offset']=qs[_0x762d('0x1a')](_0xdd98a1[_0x762d('0x2e')][_0x762d('0x1a')]);}_0x3a7a6c['order']=qs[_0x762d('0x37')](_0xdd98a1[_0x762d('0x2e')][_0x762d('0x37')]);_0x3a7a6c[_0x762d('0x38')]=qs[_0x762d('0x30')](_[_0x762d('0x39')](_0xdd98a1[_0x762d('0x2e')],_0x242ecf[_0x762d('0x30')]),_0x4e35c6);if(_0xdd98a1[_0x762d('0x2e')]['filter']){_0x3a7a6c['where']=_[_0x762d('0x3a')](_0x3a7a6c[_0x762d('0x38')],{'$or':_[_0x762d('0x27')](_0x4e35c6,function(_0x4bb3c8){if(_0x4bb3c8['type']!==_0x762d('0x3b')){var _0x59e52c={};_0x59e52c[_0x4bb3c8['name']]={'$like':'%'+_0xdd98a1[_0x762d('0x2e')][_0x762d('0x3c')]+'%'};return _0x59e52c;}})});}_0x3a7a6c=_[_0x762d('0x3a')]({},_0x3a7a6c,_0xdd98a1[_0x762d('0x3d')]);var _0x420355={'where':_0x3a7a6c[_0x762d('0x38')]};return db['CmHopperHistory'][_0x762d('0x19')](_0x420355)[_0x762d('0x21')](function(_0x3e0447){_0x387648[_0x762d('0x19')]=_0x3e0447;if(_0xdd98a1[_0x762d('0x2e')][_0x762d('0x3e')]){_0x3a7a6c[_0x762d('0x3f')]=[{'all':!![]}];}return db[_0x762d('0x28')][_0x762d('0x40')](_0x3a7a6c);})[_0x762d('0x21')](function(_0xf04429){_0x387648['rows']=_0xf04429;return _0x387648;})[_0x762d('0x21')](respondWithFilteredResult(_0x3030dc,_0x3a7a6c))[_0x762d('0x41')](handleError(_0x3030dc,null));};exports[_0x762d('0x42')]=function(_0x332a9d,_0x2c848d){var _0x54995c={'raw':!![],'where':{'id':_0x332a9d[_0x762d('0x43')]['id']}},_0x183bc0={};_0x183bc0['model']=_[_0x762d('0x2f')](db[_0x762d('0x28')][_0x762d('0x29')]);_0x183bc0[_0x762d('0x2e')]=_['keys'](_0x332a9d['query']);_0x183bc0['filters']=_[_0x762d('0x31')](_0x183bc0[_0x762d('0x2d')],_0x183bc0[_0x762d('0x2e')]);_0x54995c[_0x762d('0x33')]=_[_0x762d('0x31')](_0x183bc0['model'],qs[_0x762d('0x32')](_0x332a9d[_0x762d('0x2e')]['fields']));_0x54995c[_0x762d('0x33')]=_0x54995c[_0x762d('0x33')][_0x762d('0x34')]?_0x54995c[_0x762d('0x33')]:_0x183bc0[_0x762d('0x2d')];if(_0x332a9d[_0x762d('0x2e')][_0x762d('0x3e')]){_0x54995c[_0x762d('0x3f')]=[{'all':!![]}];}_0x54995c=_[_0x762d('0x3a')]({},_0x54995c,_0x332a9d[_0x762d('0x3d')]);return db['CmHopperHistory'][_0x762d('0x44')](_0x54995c)['then'](handleEntityNotFound(_0x2c848d,null))[_0x762d('0x21')](respondWithResult(_0x2c848d,null))['catch'](handleError(_0x2c848d,null));};exports[_0x762d('0x45')]=function(_0x5c3243,_0x3c95a0){return db[_0x762d('0x28')]['create'](_0x5c3243['body'],{})[_0x762d('0x21')](respondWithResult(_0x3c95a0,0xc9))[_0x762d('0x41')](handleError(_0x3c95a0,null));};exports['describe']=function(_0x50f2a6,_0x17bc1c){return db[_0x762d('0x28')][_0x762d('0x46')]()[_0x762d('0x21')](respondWithResult(_0x17bc1c,null))[_0x762d('0x41')](handleError(_0x17bc1c,null));};exports['update']=function(_0x23c02b,_0x25284f){if(_0x23c02b[_0x762d('0x47')]['uniqueid']){delete _0x23c02b[_0x762d('0x47')][_0x762d('0x48')];}return db[_0x762d('0x28')][_0x762d('0x44')]({'where':{'uniqueid':_0x23c02b[_0x762d('0x43')]['id']}})[_0x762d('0x21')](handleEntityNotFound(_0x25284f,null))[_0x762d('0x21')](saveUpdates(_0x23c02b['body'],null))[_0x762d('0x21')](respondWithResult(_0x25284f,null))[_0x762d('0x41')](handleError(_0x25284f,null));};
\ No newline at end of file
+var _0x04d0=['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','sendStatus','json','count','offset','status','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','create','describe','body','uniqueid','find','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','sox'];(function(_0x323670,_0x3ab327){var _0x91343=function(_0x38cf98){while(--_0x38cf98){_0x323670['push'](_0x323670['shift']());}};_0x91343(++_0x3ab327);}(_0x04d0,0x125));var _0x004d=function(_0x560f19,_0x3cc2d5){_0x560f19=_0x560f19-0x0;var _0x46036e=_0x04d0[_0x560f19];return _0x46036e;};'use strict';var pdf=require(_0x004d('0x0'));var emlformat=require(_0x004d('0x1'));var rimraf=require(_0x004d('0x2'));var zipdir=require(_0x004d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x004d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x004d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x004d('0x6'));var csv=require(_0x004d('0x7'));var ejs=require(_0x004d('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x004d('0x9'));var crypto=require(_0x004d('0xa'));var jsforce=require(_0x004d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x004d('0x7'));var querystring=require(_0x004d('0xc'));var Papa=require(_0x004d('0xd'));var Redis=require(_0x004d('0xe'));var authService=require(_0x004d('0xf'));var qs=require(_0x004d('0x10'));var as=require(_0x004d('0x11'));var hardwareService=require(_0x004d('0x12'));var logger=require(_0x004d('0x13'))('api');var utils=require(_0x004d('0x14'));var config=require(_0x004d('0x15'));var db=require(_0x004d('0x16'))['db'];function respondWithStatusCode(_0xdc1fc4,_0x4ffef2){_0x4ffef2=_0x4ffef2||0xcc;return function(_0x1040e9){if(_0x1040e9){return _0xdc1fc4[_0x004d('0x17')](_0x4ffef2);}return _0xdc1fc4['status'](_0x4ffef2)['end']();};}function respondWithResult(_0x58223e,_0x266a29){_0x266a29=_0x266a29||0xc8;return function(_0x355bcf){if(_0x355bcf){return _0x58223e['status'](_0x266a29)[_0x004d('0x18')](_0x355bcf);}};}function respondWithFilteredResult(_0x238dca,_0x4885fe){return function(_0x4f5c50){if(_0x4f5c50){var _0x5021c0=_0x4f5c50[_0x004d('0x19')],_0x300ed8=_0x4885fe[_0x004d('0x1a')],_0x5ea39b=_0x4885fe[_0x004d('0x1a')]+_0x4885fe['limit'],_0x10b7d0;if(_0x5ea39b>=_0x5021c0){_0x5ea39b=_0x5021c0;_0x10b7d0=0xc8;}else{_0x10b7d0=0xce;}_0x238dca[_0x004d('0x1b')](_0x10b7d0);return _0x238dca[_0x004d('0x1c')](_0x004d('0x1d'),_0x300ed8+'-'+_0x5ea39b+'/'+_0x5021c0)[_0x004d('0x18')](_0x4f5c50);}return null;};}function patchUpdates(_0x2582e2){return function(_0x304b10){try{jsonpatch['apply'](_0x304b10,_0x2582e2,!![]);}catch(_0x56646a){return BPromise['reject'](_0x56646a);}return _0x304b10[_0x004d('0x1e')]();};}function saveUpdates(_0x1696a5,_0x383440){return function(_0x33ea50){if(_0x33ea50){return _0x33ea50[_0x004d('0x1f')](_0x1696a5)[_0x004d('0x20')](function(_0x50f437){return _0x50f437;});}return null;};}function removeEntity(_0xe9b600,_0x560230){return function(_0x527790){if(_0x527790){return _0x527790[_0x004d('0x21')]()[_0x004d('0x20')](function(){_0xe9b600['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b85c2,_0x2e8153){return function(_0x57d8e7){if(!_0x57d8e7){_0x5b85c2[_0x004d('0x17')](0x194);}return _0x57d8e7;};}function handleError(_0x4869da,_0x3ebae5){_0x3ebae5=_0x3ebae5||0x1f4;return function(_0x575c40){logger[_0x004d('0x22')](_0x575c40[_0x004d('0x23')]);if(_0x575c40[_0x004d('0x24')]){delete _0x575c40[_0x004d('0x24')];}_0x4869da[_0x004d('0x1b')](_0x3ebae5)[_0x004d('0x25')](_0x575c40);};}exports[_0x004d('0x26')]=function(_0x3e96b4,_0x160acd){var _0x2bdb9={},_0x3afd5c={},_0x12cf69={'count':0x0,'rows':[]};var _0x3d136e=_[_0x004d('0x27')](db[_0x004d('0x28')]['rawAttributes'],function(_0x31e0cc){return{'name':_0x31e0cc[_0x004d('0x29')],'type':_0x31e0cc['type'][_0x004d('0x2a')]};});_0x3afd5c[_0x004d('0x2b')]=_[_0x004d('0x27')](_0x3d136e,_0x004d('0x24'));_0x3afd5c[_0x004d('0x2c')]=_[_0x004d('0x2d')](_0x3e96b4[_0x004d('0x2c')]);_0x3afd5c[_0x004d('0x2e')]=_[_0x004d('0x2f')](_0x3afd5c['model'],_0x3afd5c[_0x004d('0x2c')]);_0x2bdb9['attributes']=_[_0x004d('0x2f')](_0x3afd5c[_0x004d('0x2b')],qs[_0x004d('0x30')](_0x3e96b4[_0x004d('0x2c')]['fields']));_0x2bdb9[_0x004d('0x31')]=_0x2bdb9['attributes']['length']?_0x2bdb9[_0x004d('0x31')]:_0x3afd5c[_0x004d('0x2b')];if(!_0x3e96b4[_0x004d('0x2c')][_0x004d('0x32')](_0x004d('0x33'))){_0x2bdb9[_0x004d('0x34')]=qs[_0x004d('0x34')](_0x3e96b4[_0x004d('0x2c')][_0x004d('0x34')]);_0x2bdb9[_0x004d('0x1a')]=qs[_0x004d('0x1a')](_0x3e96b4[_0x004d('0x2c')]['offset']);}_0x2bdb9['order']=qs['sort'](_0x3e96b4[_0x004d('0x2c')][_0x004d('0x35')]);_0x2bdb9[_0x004d('0x36')]=qs[_0x004d('0x2e')](_[_0x004d('0x37')](_0x3e96b4['query'],_0x3afd5c[_0x004d('0x2e')]),_0x3d136e);if(_0x3e96b4['query'][_0x004d('0x38')]){_0x2bdb9[_0x004d('0x36')]=_[_0x004d('0x39')](_0x2bdb9[_0x004d('0x36')],{'$or':_[_0x004d('0x27')](_0x3d136e,function(_0x3328f6){if(_0x3328f6[_0x004d('0x3a')]!==_0x004d('0x3b')){var _0x4d6d72={};_0x4d6d72[_0x3328f6[_0x004d('0x24')]]={'$like':'%'+_0x3e96b4[_0x004d('0x2c')]['filter']+'%'};return _0x4d6d72;}})});}_0x2bdb9=_['merge']({},_0x2bdb9,_0x3e96b4[_0x004d('0x3c')]);var _0x367465={'where':_0x2bdb9['where']};return db[_0x004d('0x28')][_0x004d('0x19')](_0x367465)[_0x004d('0x20')](function(_0x12c6c2){_0x12cf69[_0x004d('0x19')]=_0x12c6c2;if(_0x3e96b4['query']['includeAll']){_0x2bdb9[_0x004d('0x3d')]=[{'all':!![]}];}return db[_0x004d('0x28')][_0x004d('0x3e')](_0x2bdb9);})['then'](function(_0xc81178){_0x12cf69[_0x004d('0x3f')]=_0xc81178;return _0x12cf69;})[_0x004d('0x20')](respondWithFilteredResult(_0x160acd,_0x2bdb9))[_0x004d('0x40')](handleError(_0x160acd,null));};exports[_0x004d('0x41')]=function(_0x434069,_0x483a90){var _0x376809={'raw':!![],'where':{'id':_0x434069[_0x004d('0x42')]['id']}},_0x19713f={};_0x19713f[_0x004d('0x2b')]=_[_0x004d('0x2d')](db['CmHopperHistory'][_0x004d('0x43')]);_0x19713f[_0x004d('0x2c')]=_[_0x004d('0x2d')](_0x434069[_0x004d('0x2c')]);_0x19713f[_0x004d('0x2e')]=_[_0x004d('0x2f')](_0x19713f[_0x004d('0x2b')],_0x19713f[_0x004d('0x2c')]);_0x376809['attributes']=_[_0x004d('0x2f')](_0x19713f[_0x004d('0x2b')],qs['fields'](_0x434069['query'][_0x004d('0x30')]));_0x376809[_0x004d('0x31')]=_0x376809[_0x004d('0x31')][_0x004d('0x44')]?_0x376809[_0x004d('0x31')]:_0x19713f[_0x004d('0x2b')];if(_0x434069[_0x004d('0x2c')][_0x004d('0x45')]){_0x376809['include']=[{'all':!![]}];}_0x376809=_[_0x004d('0x39')]({},_0x376809,_0x434069[_0x004d('0x3c')]);return db['CmHopperHistory']['find'](_0x376809)['then'](handleEntityNotFound(_0x483a90,null))['then'](respondWithResult(_0x483a90,null))['catch'](handleError(_0x483a90,null));};exports[_0x004d('0x46')]=function(_0x564fc6,_0x39d1b2){return db['CmHopperHistory']['create'](_0x564fc6['body'],{})[_0x004d('0x20')](respondWithResult(_0x39d1b2,0xc9))['catch'](handleError(_0x39d1b2,null));};exports[_0x004d('0x47')]=function(_0x3031c0,_0x426044){return db[_0x004d('0x28')][_0x004d('0x47')]()['then'](respondWithResult(_0x426044,null))['catch'](handleError(_0x426044,null));};exports['update']=function(_0x3a935c,_0x542b58){if(_0x3a935c[_0x004d('0x48')][_0x004d('0x49')]){delete _0x3a935c[_0x004d('0x48')][_0x004d('0x49')];}return db[_0x004d('0x28')][_0x004d('0x4a')]({'where':{'uniqueid':_0x3a935c[_0x004d('0x42')]['id']}})['then'](handleEntityNotFound(_0x542b58,null))['then'](saveUpdates(_0x3a935c[_0x004d('0x48')],null))[_0x004d('0x20')](respondWithResult(_0x542b58,null))[_0x004d('0x40')](handleError(_0x542b58,null));};
\ No newline at end of file
index 297c552..fc69ac6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e61=['cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','CmHopperHistory'];(function(_0x149ac2,_0x5d0c52){var _0x17470d=function(_0x322a7e){while(--_0x322a7e){_0x149ac2['push'](_0x149ac2['shift']());}};_0x17470d(++_0x5d0c52);}(_0x0e61,0x137));var _0x10e6=function(_0x4c3070,_0xc2fb4c){_0x4c3070=_0x4c3070-0x0;var _0x536a44=_0x0e61[_0x4c3070];return _0x536a44;};'use strict';var _=require(_0x10e6('0x0'));var util=require(_0x10e6('0x1'));var logger=require(_0x10e6('0x2'))(_0x10e6('0x3'));var moment=require('moment');var BPromise=require(_0x10e6('0x4'));var rp=require(_0x10e6('0x5'));var fs=require('fs');var path=require(_0x10e6('0x6'));var rimraf=require(_0x10e6('0x7'));var config=require(_0x10e6('0x8'));var attributes=require(_0x10e6('0x9'));module['exports']=function(_0x13a570,_0x3c78f8){return _0x13a570['define'](_0x10e6('0xa'),attributes,{'tableName':_0x10e6('0xb'),'paranoid':![],'indexes':[{'name':_0x10e6('0xc'),'fields':[_0x10e6('0xc')]},{'name':_0x10e6('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbec8=['moment','request-promise','path','rimraf','exports','CmHopperHistory','uniqueid','lodash','util','../../config/logger','api'];(function(_0x3e6fc7,_0x170141){var _0x295068=function(_0x435148){while(--_0x435148){_0x3e6fc7['push'](_0x3e6fc7['shift']());}};_0x295068(++_0x170141);}(_0xbec8,0x125));var _0x8bec=function(_0x5b7696,_0x3ebd92){_0x5b7696=_0x5b7696-0x0;var _0x42d7b9=_0xbec8[_0x5b7696];return _0x42d7b9;};'use strict';var _=require(_0x8bec('0x0'));var util=require(_0x8bec('0x1'));var logger=require(_0x8bec('0x2'))(_0x8bec('0x3'));var moment=require(_0x8bec('0x4'));var BPromise=require('bluebird');var rp=require(_0x8bec('0x5'));var fs=require('fs');var path=require(_0x8bec('0x6'));var rimraf=require(_0x8bec('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0x8bec('0x8')]=function(_0x2fe6fd,_0x67cf05){return _0x2fe6fd['define'](_0x8bec('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':'uniqueid','fields':[_0x8bec('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 76c27f1..3125418 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7a=['outboundCongestionCallsDay','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','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','request\x20sent','result','catch','CmHopperHistory','body','options','raw','CreateCmHopperHistory','AvgHandleTime','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null'];(function(_0x13d603,_0x46f391){var _0x47a4c3=function(_0x2c76ed){while(--_0x2c76ed){_0x13d603['push'](_0x13d603['shift']());}};_0x47a4c3(++_0x46f391);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x246107,_0x1bf721){_0x246107=_0x246107-0x0;var _0x1a1662=_0x6f7a[_0x246107];return _0x1a1662;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});}exports['CreateCmHopperHistory']=function(_0x4a8827){var _0xba7755=this;return new Promise(function(_0x5298ba,_0x378967){return db[_0xa6f7('0x1a')]['create'](_0x4a8827[_0xa6f7('0x1b')],{'raw':_0x4a8827[_0xa6f7('0x1c')]?_0x4a8827[_0xa6f7('0x1c')][_0xa6f7('0x1d')]===undefined?!![]:![]:!![]})[_0xa6f7('0xe')](function(_0x1aa8dc){logger['info'](_0xa6f7('0x1e'),_0x4a8827);logger[_0xa6f7('0x10')]('CreateCmHopperHistory',_0x4a8827,JSON['stringify'](_0x1aa8dc));_0x5298ba(_0x1aa8dc);})['catch'](function(_0x1de6c9){logger[_0xa6f7('0x13')]('CreateCmHopperHistory',_0x1de6c9['message'],_0x4a8827);_0x378967(_0xba7755['error'](0x1f4,_0x1de6c9[_0xa6f7('0x16')]));});});};exports[_0xa6f7('0x1f')]=function(_0x28263e){var _0x5baaa9=this;return new Promise(function(_0x484874,_0x2f4907){return db['CmHopperHistory']['findAll']({'raw':_0x28263e[_0xa6f7('0x1c')]?_0x28263e['options'][_0xa6f7('0x1d')]===undefined?!![]:![]:!![],'where':_0x28263e[_0xa6f7('0x1c')]?_0x28263e[_0xa6f7('0x1c')][_0xa6f7('0x20')]||null:null,'attributes':[[db[_0xa6f7('0x21')]['fn']('COUNT',db['sequelize'][_0xa6f7('0x22')]('id')),_0xa6f7('0x23')],[db['sequelize']['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x26')))),_0xa6f7('0x27')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x28')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db['sequelize']['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x29'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0xa6f7('0x21')]['fn']('AVG',db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x2a')))),_0xa6f7('0x2b')]]})[_0xa6f7('0xe')](function(_0x4d2d38){logger[_0xa6f7('0xf')](_0xa6f7('0x1f'),_0x28263e);logger[_0xa6f7('0x10')]('AvgHandleTime',_0x28263e,JSON[_0xa6f7('0x12')](_0x4d2d38));_0x484874(_0x4d2d38);})['catch'](function(_0x1170c4){logger[_0xa6f7('0x13')](_0xa6f7('0x1f'),_0x1170c4['message'],_0x28263e);_0x2f4907(_0x5baaa9[_0xa6f7('0x13')](0x1f4,_0x1170c4[_0xa6f7('0x16')]));});});};exports[_0xa6f7('0x2c')]=function(_0x37b833){var _0x14444c=this;return new Promise(function(_0x28490e,_0x4a28a7){return db[_0xa6f7('0x1a')][_0xa6f7('0x2d')]({'raw':_0x37b833[_0xa6f7('0x1c')]?_0x37b833[_0xa6f7('0x1c')][_0xa6f7('0x1d')]===undefined?!![]:![]:!![],'where':_0x37b833[_0xa6f7('0x1c')]?_0x37b833[_0xa6f7('0x1c')][_0xa6f7('0x20')]||null:null,'attributes':[['campaign',_0xa6f7('0x2e')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db['sequelize']['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')]('`state`\x20=\x200,\x201,\x20null'))),_0xa6f7('0x2f')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')]['literal'](_0xa6f7('0x30')))),_0xa6f7('0x31')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x26')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x32')))),_0xa6f7('0x33')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')]['literal'](_0xa6f7('0x34')))),_0xa6f7('0x35')],[db['sequelize']['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xa6f7('0x36')],[db['sequelize']['fn']('COUNT',db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x37')))),_0xa6f7('0x38')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db['sequelize']['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')]('`state`\x20=\x2012,\x201,\x20null'))),_0xa6f7('0x39')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db['sequelize']['fn']('IF',db[_0xa6f7('0x21')]['literal'](_0xa6f7('0x3a')))),_0xa6f7('0x3b')],[db[_0xa6f7('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa6f7('0x21')]['literal'](_0xa6f7('0x3c')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x3d')))),_0xa6f7('0x3e')],[db['sequelize']['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db['sequelize'][_0xa6f7('0x25')]('`state`\x20=\x2016,\x201,\x20null'))),_0xa6f7('0x3f')],[db['sequelize']['fn']('COUNT',db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x40')))),_0xa6f7('0x3e')],[db['sequelize']['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db['sequelize'][_0xa6f7('0x25')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xa6f7('0x41')]],'group':[_0xa6f7('0x42')]})[_0xa6f7('0xe')](function(_0x55369a){logger[_0xa6f7('0xf')]('GetVoiceQueueHopperHistory',_0x37b833);logger[_0xa6f7('0x10')](_0xa6f7('0x2c'),_0x37b833,JSON[_0xa6f7('0x12')](_0x55369a));_0x28490e(_0x55369a);})[_0xa6f7('0x19')](function(_0xa6bff9){logger['error']('GetVoiceQueueHopperHistory',_0xa6bff9[_0xa6f7('0x16')],_0x37b833);_0x4a28a7(_0x14444c[_0xa6f7('0x13')](0x1f4,_0xa6bff9[_0xa6f7('0x16')]));});});};exports[_0xa6f7('0x43')]=function(_0x5931e9){var _0x9d901e=this;return new Promise(function(_0x2105dd,_0x14d841){return db[_0xa6f7('0x1a')][_0xa6f7('0x2d')]({'raw':_0x5931e9[_0xa6f7('0x1c')]?_0x5931e9['options'][_0xa6f7('0x1d')]===undefined?!![]:![]:!![],'where':_0x5931e9[_0xa6f7('0x1c')]?_0x5931e9[_0xa6f7('0x1c')]['where']||null:null,'attributes':[[_0xa6f7('0x42'),_0xa6f7('0x2e')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db['sequelize']['col']('id')),_0xa6f7('0x44')],[db[_0xa6f7('0x21')]['fn'](_0xa6f7('0x24'),db[_0xa6f7('0x21')]['fn']('IF',db[_0xa6f7('0x21')][_0xa6f7('0x25')](_0xa6f7('0x26')))),'ivrAnswerCallsDay']],'group':[_0xa6f7('0x42')]})[_0xa6f7('0xe')](function(_0x2f131c){logger[_0xa6f7('0xf')](_0xa6f7('0x43'),_0x5931e9);logger[_0xa6f7('0x10')](_0xa6f7('0x43'),_0x5931e9,JSON[_0xa6f7('0x12')](_0x2f131c));_0x2105dd(_0x2f131c);})[_0xa6f7('0x19')](function(_0x186956){logger[_0xa6f7('0x13')]('GetCampaignHopperHistory',_0x186956[_0xa6f7('0x16')],_0x5931e9);_0x14d841(_0x9d901e['error'](0x1f4,_0x186956[_0xa6f7('0x16')]));});});};
\ No newline at end of file
+var _0x5eb8=['raw','then','CreateCmHopperHistory','stringify','AvgHandleTime','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','catch','CmHopperHistory','create','body','options'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0x5eb8[_0x3a1ea5];return _0xfac9b2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['CreateCmHopperHistory']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')](_0x50d2a8[_0x85eb('0x17')],{'raw':_0x50d2a8['options']?_0x50d2a8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![]})[_0x85eb('0x1a')](function(_0x4e8041){logger['info']('CreateCmHopperHistory',_0x50d2a8);logger['debug'](_0x85eb('0x1b'),_0x50d2a8,JSON[_0x85eb('0x1c')](_0x4e8041));_0x39ca96(_0x4e8041);})[_0x85eb('0x14')](function(_0x255ca7){logger[_0x85eb('0x12')](_0x85eb('0x1b'),_0x255ca7['message'],_0x50d2a8);_0x10cf2f(_0xe198ca['error'](0x1f4,_0x255ca7['message']));});});};exports[_0x85eb('0x1d')]=function(_0x1426c8){var _0x3f7a4d=this;return new Promise(function(_0x28b87d,_0x312b3e){return db[_0x85eb('0x15')]['findAll']({'raw':_0x1426c8[_0x85eb('0x18')]?_0x1426c8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![],'where':_0x1426c8[_0x85eb('0x18')]?_0x1426c8[_0x85eb('0x18')]['where']||null:null,'attributes':[[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')][_0x85eb('0x20')]('id')),_0x85eb('0x21')],[db[_0x85eb('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x24')))),_0x85eb('0x25')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x26'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x27')))),_0x85eb('0x28')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x26'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x29')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x340745){logger[_0x85eb('0xd')](_0x85eb('0x1d'),_0x1426c8);logger[_0x85eb('0x10')](_0x85eb('0x1d'),_0x1426c8,JSON[_0x85eb('0x1c')](_0x340745));_0x28b87d(_0x340745);})[_0x85eb('0x14')](function(_0x35f092){logger[_0x85eb('0x12')](_0x85eb('0x1d'),_0x35f092[_0x85eb('0x13')],_0x1426c8);_0x312b3e(_0x3f7a4d[_0x85eb('0x12')](0x1f4,_0x35f092[_0x85eb('0x13')]));});});};exports[_0x85eb('0x2a')]=function(_0x4b69a7){var _0x4361e2=this;return new Promise(function(_0x3dfe74,_0x58f091){return db['CmHopperHistory'][_0x85eb('0x2b')]({'raw':_0x4b69a7[_0x85eb('0x18')]?_0x4b69a7['options'][_0x85eb('0x19')]===undefined?!![]:![]:!![],'where':_0x4b69a7['options']?_0x4b69a7[_0x85eb('0x18')]['where']||null:null,'attributes':[[_0x85eb('0x2c'),'name'],[db[_0x85eb('0x1e')]['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x2d')))),'outboundNoSuchCallsDay'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db['sequelize']['fn']('IF',db[_0x85eb('0x1e')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x85eb('0x2e')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x85eb('0x22')))),_0x85eb('0x2f')],[db['sequelize']['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x30')))),_0x85eb('0x31')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x32')))),_0x85eb('0x33')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x34')))),'outboundDropCallsDayTimeout'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x35')))),'outboundDropCallsDayCallersExit'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x36')))),_0x85eb('0x37')],[db[_0x85eb('0x1e')]['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x38')))),_0x85eb('0x39')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x3a')))),_0x85eb('0x3b')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x3c')))),_0x85eb('0x3d')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x3e')))),_0x85eb('0x3f')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x85eb('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x40')))),'outboundReCallsDay']],'group':['campaign']})[_0x85eb('0x1a')](function(_0x249511){logger[_0x85eb('0xd')](_0x85eb('0x2a'),_0x4b69a7);logger[_0x85eb('0x10')]('GetVoiceQueueHopperHistory',_0x4b69a7,JSON[_0x85eb('0x1c')](_0x249511));_0x3dfe74(_0x249511);})[_0x85eb('0x14')](function(_0x270bb2){logger[_0x85eb('0x12')](_0x85eb('0x2a'),_0x270bb2['message'],_0x4b69a7);_0x58f091(_0x4361e2[_0x85eb('0x12')](0x1f4,_0x270bb2['message']));});});};exports[_0x85eb('0x41')]=function(_0x40d846){var _0x4ee529=this;return new Promise(function(_0x341ddb,_0xd04f24){return db[_0x85eb('0x15')][_0x85eb('0x2b')]({'raw':_0x40d846[_0x85eb('0x18')]?_0x40d846[_0x85eb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x40d846[_0x85eb('0x18')]?_0x40d846['options'][_0x85eb('0x42')]||null:null,'attributes':[[_0x85eb('0x2c'),'name'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db['sequelize'][_0x85eb('0x20')]('id')),'ivrTotalCallsDays'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x22')))),'ivrAnswerCallsDay']],'group':[_0x85eb('0x2c')]})[_0x85eb('0x1a')](function(_0x1d3204){logger[_0x85eb('0xd')](_0x85eb('0x41'),_0x40d846);logger[_0x85eb('0x10')](_0x85eb('0x41'),_0x40d846,JSON[_0x85eb('0x1c')](_0x1d3204));_0x341ddb(_0x1d3204);})[_0x85eb('0x14')](function(_0x13cc2a){logger[_0x85eb('0x12')]('GetCampaignHopperHistory',_0x13cc2a[_0x85eb('0x13')],_0x40d846);_0xd04f24(_0x4ee529[_0x85eb('0x12')](0x1f4,_0x13cc2a[_0x85eb('0x13')]));});});};
\ No newline at end of file
index b74e8df..f917380 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3925=['post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0xbb2e42,_0xbc3ea7){var _0xf938b4=function(_0x4bc20a){while(--_0x4bc20a){_0xbb2e42['push'](_0xbb2e42['shift']());}};_0xf938b4(++_0xbc3ea7);}(_0x3925,0x1ba));var _0x5392=function(_0x21f089,_0x5ebacd){_0x21f089=_0x21f089-0x0;var _0x59c5e7=_0x3925[_0x21f089];return _0x59c5e7;};'use strict';var multer=require(_0x5392('0x0'));var util=require(_0x5392('0x1'));var path=require(_0x5392('0x2'));var timeout=require(_0x5392('0x3'));var express=require(_0x5392('0x4'));var router=express[_0x5392('0x5')]();var auth=require(_0x5392('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5392('0x7'));router[_0x5392('0x8')]('/',auth[_0x5392('0x9')](),controller[_0x5392('0xa')]);router['get'](_0x5392('0xb'),auth[_0x5392('0x9')](),controller[_0x5392('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5392('0xd')]);router[_0x5392('0xe')]('/',auth[_0x5392('0x9')](),controller[_0x5392('0xf')]);router[_0x5392('0x10')]('/:id',auth[_0x5392('0x9')](),controller[_0x5392('0x11')]);module[_0x5392('0x12')]=router;
\ No newline at end of file
+var _0x6e1c=['Router','../../components/interaction/service','isAuthenticated','get','/describe','/:id','post','create','put','exports','multer','util','connect-timeout','express'];(function(_0xf74372,_0x51fe82){var _0x36bb65=function(_0x499b7a){while(--_0x499b7a){_0xf74372['push'](_0xf74372['shift']());}};_0x36bb65(++_0x51fe82);}(_0x6e1c,0x1ca));var _0xc6e1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e1c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc6e1('0x0'));var util=require(_0xc6e1('0x1'));var path=require('path');var timeout=require(_0xc6e1('0x2'));var express=require(_0xc6e1('0x3'));var router=express[_0xc6e1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc6e1('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0xc6e1('0x6')](),controller['index']);router[_0xc6e1('0x7')](_0xc6e1('0x8'),auth[_0xc6e1('0x6')](),controller['describe']);router['get'](_0xc6e1('0x9'),auth[_0xc6e1('0x6')](),controller['show']);router[_0xc6e1('0xa')]('/',auth[_0xc6e1('0x6')](),controller[_0xc6e1('0xb')]);router[_0xc6e1('0xc')]('/:id',auth[_0xc6e1('0x6')](),controller['update']);module[_0xc6e1('0xd')]=router;
\ No newline at end of file
index 3c8d285..ee15cf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7698=['exports','STRING','name','sequelize'];(function(_0x431103,_0x2e7fa4){var _0x57c172=function(_0x27609c){while(--_0x27609c){_0x431103['push'](_0x431103['shift']());}};_0x57c172(++_0x2e7fa4);}(_0x7698,0x1e3));var _0x8769=function(_0xdf796c,_0x47a5ab){_0xdf796c=_0xdf796c-0x0;var _0x5779c0=_0x7698[_0xdf796c];return _0x5779c0;};'use strict';var Sequelize=require(_0x8769('0x0'));module[_0x8769('0x1')]={'name':{'type':Sequelize[_0x8769('0x2')],'unique':_0x8769('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8769('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb3a5=['sequelize','exports','name','STRING'];(function(_0x50dd2d,_0x2ed7d5){var _0x7b56fc=function(_0x48ce66){while(--_0x48ce66){_0x50dd2d['push'](_0x50dd2d['shift']());}};_0x7b56fc(++_0x2ed7d5);}(_0xb3a5,0x154));var _0x5b3a=function(_0x546cf9,_0x1749bb){_0x546cf9=_0x546cf9-0x0;var _0x3ec60c=_0xb3a5[_0x546cf9];return _0x3ec60c;};'use strict';var Sequelize=require(_0x5b3a('0x0'));module[_0x5b3a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5b3a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5b3a('0x3')]},'dialPrefix':{'type':Sequelize[_0x5b3a('0x3')]}};
\ No newline at end of file
index a8be5ca..f1be16d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda05=['end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Lists','sendStatus','error','stack','name','index','map','CmList','fieldName','key','keys','filters','intersection','query','attributes','model','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','findOne','hasOwnProperty','removeDispositions','ids','CmContact','tags','isArray','join','push','each','omit','success','errors','Malformed\x20request\x20syntax','getContacts','CustomFields','format','raw','concat','isEmpty','now','writeFileSync','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','CmCustomField','addCustomFields','Sequelize','TEXT','switch','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status'];(function(_0x1764be,_0x42e773){var _0x55427b=function(_0x40b78b){while(--_0x40b78b){_0x1764be['push'](_0x1764be['shift']());}};_0x55427b(++_0x42e773);}(_0xda05,0xff));var _0x5da0=function(_0x3ec2b7,_0xace775){_0x3ec2b7=_0x3ec2b7-0x0;var _0x279e2c=_0xda05[_0x3ec2b7];return _0x279e2c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5da0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5da0('0x1'));var jsonpatch=require(_0x5da0('0x2'));var rp=require(_0x5da0('0x3'));var moment=require(_0x5da0('0x4'));var BPromise=require(_0x5da0('0x5'));var Mustache=require(_0x5da0('0x6'));var util=require(_0x5da0('0x7'));var path=require('path');var sox=require(_0x5da0('0x8'));var csv=require('to-csv');var ejs=require(_0x5da0('0x9'));var fs=require('fs');var _=require(_0x5da0('0xa'));var squel=require('squel');var crypto=require(_0x5da0('0xb'));var jsforce=require(_0x5da0('0xc'));var deskjs=require(_0x5da0('0xd'));var toCsv=require(_0x5da0('0xe'));var querystring=require(_0x5da0('0xf'));var Papa=require(_0x5da0('0x10'));var Redis=require(_0x5da0('0x11'));var authService=require(_0x5da0('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5da0('0x13'));var logger=require(_0x5da0('0x14'))('api');var utils=require(_0x5da0('0x15'));var config=require(_0x5da0('0x16'));var db=require(_0x5da0('0x17'))['db'];config[_0x5da0('0x18')]=_[_0x5da0('0x19')](config[_0x5da0('0x18')],{'host':_0x5da0('0x1a'),'port':0x18eb});var socket=require(_0x5da0('0x1b'))(new Redis(config[_0x5da0('0x18')]));require(_0x5da0('0x1c'))[_0x5da0('0x1d')](socket);function respondWithStatusCode(_0x217a1f,_0x44bf7d){_0x44bf7d=_0x44bf7d||0xcc;return function(_0x1672bf){if(_0x1672bf){return _0x217a1f['sendStatus'](_0x44bf7d);}return _0x217a1f[_0x5da0('0x1e')](_0x44bf7d)[_0x5da0('0x1f')]();};}function respondWithResult(_0x1f2443,_0x3ff3d1){_0x3ff3d1=_0x3ff3d1||0xc8;return function(_0x58c336){if(_0x58c336){return _0x1f2443['status'](_0x3ff3d1)['json'](_0x58c336);}};}function respondWithFilteredResult(_0x65fd80,_0x2353a7){return function(_0x581275){if(_0x581275){var _0x168eff=_0x581275[_0x5da0('0x20')],_0x328527=_0x2353a7[_0x5da0('0x21')],_0x129719=_0x2353a7[_0x5da0('0x21')]+_0x2353a7['limit'],_0x2e7a7c;if(_0x129719>=_0x168eff){_0x129719=_0x168eff;_0x2e7a7c=0xc8;}else{_0x2e7a7c=0xce;}_0x65fd80[_0x5da0('0x1e')](_0x2e7a7c);return _0x65fd80[_0x5da0('0x22')](_0x5da0('0x23'),_0x328527+'-'+_0x129719+'/'+_0x168eff)[_0x5da0('0x24')](_0x581275);}return null;};}function patchUpdates(_0x2a3e55){return function(_0x176b85){try{jsonpatch[_0x5da0('0x25')](_0x176b85,_0x2a3e55,!![]);}catch(_0x277852){return BPromise[_0x5da0('0x26')](_0x277852);}return _0x176b85[_0x5da0('0x27')]();};}function saveUpdates(_0x1be9b4,_0x50a9ab){return function(_0x149a0d){if(_0x149a0d){return _0x149a0d[_0x5da0('0x28')](_0x1be9b4)[_0x5da0('0x29')](function(_0x110f09){return _0x110f09;});}return null;};}function removeEntity(_0x46fbb9,_0x53694c){return function(_0x500cc3){if(_0x500cc3){return _0x500cc3[_0x5da0('0x2a')]()[_0x5da0('0x29')](function(){var _0x37104c=_0x500cc3[_0x5da0('0x2b')]({'plain':!![]});var _0x156cde=_0x5da0('0x2c');return db['UserProfileResource'][_0x5da0('0x2a')]({'where':{'type':_0x156cde,'resourceId':_0x37104c['id']}})['then'](function(){return _0x500cc3;});})[_0x5da0('0x29')](function(){_0x46fbb9[_0x5da0('0x1e')](0xcc)[_0x5da0('0x1f')]();});}};}function handleEntityNotFound(_0x57c22b,_0x10344c){return function(_0x57357d){if(!_0x57357d){_0x57c22b[_0x5da0('0x2d')](0x194);}return _0x57357d;};}function handleError(_0x22c981,_0xb5edea){_0xb5edea=_0xb5edea||0x1f4;return function(_0x35881d){logger[_0x5da0('0x2e')](_0x35881d[_0x5da0('0x2f')]);if(_0x35881d[_0x5da0('0x30')]){delete _0x35881d['name'];}_0x22c981[_0x5da0('0x1e')](_0xb5edea)['send'](_0x35881d);};}exports[_0x5da0('0x31')]=function(_0x276ed2,_0x28e0df){var _0x102c53={},_0x5d38ae={},_0x37066d={'count':0x0,'rows':[]};var _0x411a89=_[_0x5da0('0x32')](db[_0x5da0('0x33')]['rawAttributes'],function(_0x48451c){return{'name':_0x48451c[_0x5da0('0x34')],'type':_0x48451c['type'][_0x5da0('0x35')]};});_0x5d38ae['model']=_[_0x5da0('0x32')](_0x411a89,'name');_0x5d38ae['query']=_[_0x5da0('0x36')](_0x276ed2['query']);_0x5d38ae[_0x5da0('0x37')]=_[_0x5da0('0x38')](_0x5d38ae['model'],_0x5d38ae[_0x5da0('0x39')]);_0x102c53[_0x5da0('0x3a')]=_[_0x5da0('0x38')](_0x5d38ae[_0x5da0('0x3b')],qs[_0x5da0('0x3c')](_0x276ed2[_0x5da0('0x39')][_0x5da0('0x3c')]));_0x102c53[_0x5da0('0x3a')]=_0x102c53['attributes'][_0x5da0('0x3d')]?_0x102c53[_0x5da0('0x3a')]:_0x5d38ae['model'];if(!_0x276ed2[_0x5da0('0x39')]['hasOwnProperty'](_0x5da0('0x3e'))){_0x102c53[_0x5da0('0x3f')]=qs['limit'](_0x276ed2[_0x5da0('0x39')][_0x5da0('0x3f')]);_0x102c53[_0x5da0('0x21')]=qs[_0x5da0('0x21')](_0x276ed2[_0x5da0('0x39')]['offset']);}_0x102c53[_0x5da0('0x40')]=qs['sort'](_0x276ed2[_0x5da0('0x39')][_0x5da0('0x41')]);_0x102c53[_0x5da0('0x42')]=qs[_0x5da0('0x37')](_[_0x5da0('0x43')](_0x276ed2[_0x5da0('0x39')],_0x5d38ae[_0x5da0('0x37')]),_0x411a89);if(_0x276ed2[_0x5da0('0x39')][_0x5da0('0x44')]){_0x102c53[_0x5da0('0x42')]=_[_0x5da0('0x45')](_0x102c53['where'],{'$or':_[_0x5da0('0x32')](_0x411a89,function(_0xc5f536){if(_0xc5f536[_0x5da0('0x46')]!==_0x5da0('0x47')){var _0x513571={};_0x513571[_0xc5f536['name']]={'$like':'%'+_0x276ed2['query']['filter']+'%'};return _0x513571;}})});}_0x102c53=_[_0x5da0('0x45')]({},_0x102c53,_0x276ed2[_0x5da0('0x48')]);var _0x3f3a90={'where':_0x102c53[_0x5da0('0x42')]};return db[_0x5da0('0x33')][_0x5da0('0x20')](_0x3f3a90)[_0x5da0('0x29')](function(_0x36e4ac){_0x37066d['count']=_0x36e4ac;if(_0x276ed2[_0x5da0('0x39')][_0x5da0('0x49')]){_0x102c53[_0x5da0('0x4a')]=[{'all':!![]}];}return db[_0x5da0('0x33')][_0x5da0('0x4b')](_0x102c53);})[_0x5da0('0x29')](function(_0x949621){_0x37066d[_0x5da0('0x4c')]=_0x949621;return _0x37066d;})[_0x5da0('0x29')](respondWithFilteredResult(_0x28e0df,_0x102c53))[_0x5da0('0x4d')](handleError(_0x28e0df,null));};exports[_0x5da0('0x4e')]=function(_0x14d49b,_0x348ff8){var _0x38e9cc={'raw':![],'where':{'id':_0x14d49b[_0x5da0('0x4f')]['id']}},_0x335226={};_0x335226['model']=_[_0x5da0('0x36')](db['CmList'][_0x5da0('0x50')]);_0x335226[_0x5da0('0x39')]=_[_0x5da0('0x36')](_0x14d49b[_0x5da0('0x39')]);_0x335226['filters']=_[_0x5da0('0x38')](_0x335226['model'],_0x335226[_0x5da0('0x39')]);_0x38e9cc[_0x5da0('0x3a')]=_['intersection'](_0x335226[_0x5da0('0x3b')],qs[_0x5da0('0x3c')](_0x14d49b[_0x5da0('0x39')][_0x5da0('0x3c')]));_0x38e9cc[_0x5da0('0x3a')]=_0x38e9cc[_0x5da0('0x3a')]['length']?_0x38e9cc[_0x5da0('0x3a')]:_0x335226['model'];if(_0x14d49b[_0x5da0('0x39')]['includeAll']){_0x38e9cc[_0x5da0('0x4a')]=[{'all':!![]}];}_0x38e9cc=_[_0x5da0('0x45')]({},_0x38e9cc,_0x14d49b[_0x5da0('0x48')]);return db['CmList'][_0x5da0('0x51')](_0x38e9cc)['then'](handleEntityNotFound(_0x348ff8,null))[_0x5da0('0x29')](respondWithResult(_0x348ff8,null))['catch'](handleError(_0x348ff8,null));};exports[_0x5da0('0x52')]=function(_0x4389db,_0x52260d){return db[_0x5da0('0x33')][_0x5da0('0x52')](_0x4389db['body'],{})[_0x5da0('0x29')](function(_0x7f2f8e){var _0x192e39=_0x4389db['user'][_0x5da0('0x2b')]({'plain':!![]});if(!_0x192e39)throw new Error(_0x5da0('0x53'));if(_0x192e39['role']==='user'){var _0x3508b7=_0x7f2f8e[_0x5da0('0x2b')]({'plain':!![]});var _0x20efa9=_0x5da0('0x2c');return db[_0x5da0('0x54')]['find']({'where':{'name':_0x20efa9,'userProfileId':_0x192e39['userProfileId']},'raw':!![]})[_0x5da0('0x29')](function(_0x291c35){if(_0x291c35&&_0x291c35[_0x5da0('0x55')]===0x0){return db[_0x5da0('0x56')][_0x5da0('0x52')]({'name':_0x3508b7[_0x5da0('0x30')],'resourceId':_0x3508b7['id'],'type':_0x291c35[_0x5da0('0x30')],'sectionId':_0x291c35['id']},{})[_0x5da0('0x29')](function(){return _0x7f2f8e;});}else{return _0x7f2f8e;}})[_0x5da0('0x4d')](function(_0x2874ae){logger['error'](_0x5da0('0x57'),_0x2874ae);throw _0x2874ae;});}return _0x7f2f8e;})[_0x5da0('0x29')](respondWithResult(_0x52260d,0xc9))[_0x5da0('0x4d')](handleError(_0x52260d,null));};exports[_0x5da0('0x28')]=function(_0x56578e,_0x521538){if(_0x56578e[_0x5da0('0x58')]['id']){delete _0x56578e[_0x5da0('0x58')]['id'];}return db['CmList'][_0x5da0('0x51')]({'where':{'id':_0x56578e['params']['id']}})[_0x5da0('0x29')](handleEntityNotFound(_0x521538,null))[_0x5da0('0x29')](saveUpdates(_0x56578e[_0x5da0('0x58')],null))[_0x5da0('0x29')](respondWithResult(_0x521538,null))[_0x5da0('0x4d')](handleError(_0x521538,null));};exports[_0x5da0('0x2a')]=function(_0x1a755b,_0x51c4b9){return db[_0x5da0('0x33')]['find']({'where':{'id':_0x1a755b[_0x5da0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x51c4b9,null))[_0x5da0('0x29')](removeEntity(_0x51c4b9,null))['catch'](handleError(_0x51c4b9,null));};exports['describe']=function(_0x14d012,_0xb58040){return db[_0x5da0('0x33')][_0x5da0('0x59')]()[_0x5da0('0x29')](respondWithResult(_0xb58040,null))[_0x5da0('0x4d')](handleError(_0xb58040,null));};exports[_0x5da0('0x5a')]=function(_0x461fc7,_0x4e353e,_0x4ed497){if(_0x461fc7['body']['id']){delete _0x461fc7['body']['id'];}return db[_0x5da0('0x33')]['find']({'where':{'id':_0x461fc7[_0x5da0('0x4f')]['id']}})[_0x5da0('0x29')](handleEntityNotFound(_0x4e353e,null))[_0x5da0('0x29')](function(_0x1ead5a){if(_0x1ead5a){_0x461fc7[_0x5da0('0x58')][_0x5da0('0x5b')]=_0x1ead5a['id'];return db[_0x5da0('0x5c')][_0x5da0('0x52')](_0x461fc7['body']);}})[_0x5da0('0x29')](respondWithResult(_0x4e353e,null))[_0x5da0('0x4d')](handleError(_0x4e353e,null));};exports['getDispositions']=function(_0x292513,_0x1b02d4,_0xd7bb26){var _0xb8cc6e={'raw':![],'where':{}};var _0x152ca7={};var _0x2fb0fb={'count':0x0,'rows':[]};return db[_0x5da0('0x33')][_0x5da0('0x5d')]({'where':{'id':_0x292513[_0x5da0('0x4f')]['id']}})[_0x5da0('0x29')](handleEntityNotFound(_0x1b02d4,null))[_0x5da0('0x29')](function(_0x3b6f0b){if(_0x3b6f0b){_0x152ca7[_0x5da0('0x3b')]=_[_0x5da0('0x36')](db['Disposition'][_0x5da0('0x50')]);_0x152ca7['query']=_[_0x5da0('0x36')](_0x292513[_0x5da0('0x39')]);_0x152ca7['filters']=_[_0x5da0('0x38')](_0x152ca7['model'],_0x152ca7[_0x5da0('0x39')]);_0xb8cc6e[_0x5da0('0x3a')]=_[_0x5da0('0x38')](_0x152ca7[_0x5da0('0x3b')],qs[_0x5da0('0x3c')](_0x292513[_0x5da0('0x39')][_0x5da0('0x3c')]));_0xb8cc6e[_0x5da0('0x3a')]=_0xb8cc6e[_0x5da0('0x3a')][_0x5da0('0x3d')]?_0xb8cc6e['attributes']:_0x152ca7[_0x5da0('0x3b')];if(!_0x292513[_0x5da0('0x39')][_0x5da0('0x5e')](_0x5da0('0x3e'))){_0xb8cc6e[_0x5da0('0x3f')]=qs[_0x5da0('0x3f')](_0x292513['query'][_0x5da0('0x3f')]);_0xb8cc6e['offset']=qs[_0x5da0('0x21')](_0x292513[_0x5da0('0x39')][_0x5da0('0x21')]);}_0xb8cc6e['order']=qs[_0x5da0('0x41')](_0x292513[_0x5da0('0x39')][_0x5da0('0x41')]);_0xb8cc6e[_0x5da0('0x42')]=qs[_0x5da0('0x37')](_[_0x5da0('0x43')](_0x292513[_0x5da0('0x39')],_0x152ca7[_0x5da0('0x37')]));_0xb8cc6e[_0x5da0('0x42')][_0x5da0('0x5b')]=_0x3b6f0b['id'];if(_0x292513[_0x5da0('0x39')][_0x5da0('0x44')]){_0xb8cc6e['where']=_[_0x5da0('0x45')](_0xb8cc6e[_0x5da0('0x42')],{'$or':_[_0x5da0('0x32')](_0xb8cc6e[_0x5da0('0x3a')],function(_0x3ad0b9){var _0x41d663={};_0x41d663[_0x3ad0b9]={'$like':'%'+_0x292513[_0x5da0('0x39')][_0x5da0('0x44')]+'%'};return _0x41d663;})});}_0xb8cc6e=_[_0x5da0('0x45')]({},_0xb8cc6e,_0x292513[_0x5da0('0x48')]);return db[_0x5da0('0x5c')][_0x5da0('0x20')]({'where':_0xb8cc6e[_0x5da0('0x42')]})[_0x5da0('0x29')](function(_0x2032e5){_0x2fb0fb[_0x5da0('0x20')]=_0x2032e5;if(_0x292513['query'][_0x5da0('0x49')]){_0xb8cc6e['include']=[{'all':!![]}];}return db[_0x5da0('0x5c')]['findAll'](_0xb8cc6e);})[_0x5da0('0x29')](function(_0x169b5a){_0x2fb0fb[_0x5da0('0x4c')]=_0x169b5a;return _0x2fb0fb;});}})[_0x5da0('0x29')](respondWithFilteredResult(_0x1b02d4,_0xb8cc6e))[_0x5da0('0x4d')](handleError(_0x1b02d4,null));};exports[_0x5da0('0x5f')]=function(_0x35edba,_0x5b9f81,_0x519924){return db['CmList'][_0x5da0('0x51')]({'where':{'id':_0x35edba[_0x5da0('0x4f')]['id']}})[_0x5da0('0x29')](handleEntityNotFound(_0x5b9f81,null))[_0x5da0('0x29')](function(_0x4eafb3){if(_0x4eafb3){return _0x4eafb3[_0x5da0('0x5f')](_0x35edba[_0x5da0('0x39')][_0x5da0('0x60')]);}})[_0x5da0('0x29')](respondWithStatusCode(_0x5b9f81,null))[_0x5da0('0x4d')](handleError(_0x5b9f81,null));};exports['addContacts']=function(_0xf295f2,_0x28609d,_0x440513){return db[_0x5da0('0x33')][_0x5da0('0x51')]({'where':{'id':_0xf295f2[_0x5da0('0x4f')]['id']}})[_0x5da0('0x29')](handleEntityNotFound(_0x28609d,null))['then'](function(_0x644434){if(_0x644434){var _0x3a630b=[];var _0x2e42be={'success':[],'errors':[]};return db[_0x5da0('0x61')]['describe']()['then'](function(_0x186f5d){if(_0xf295f2[_0x5da0('0x58')][_0x5da0('0x62')]&&_[_0x5da0('0x63')](_0xf295f2[_0x5da0('0x58')][_0x5da0('0x62')])){if(_0xf295f2[_0x5da0('0x58')][_0x5da0('0x62')][_0x5da0('0x3d')]){_0xf295f2[_0x5da0('0x58')][_0x5da0('0x62')]=_0xf295f2[_0x5da0('0x58')]['tags'][_0x5da0('0x64')](';')+';';}else{_0xf295f2['body'][_0x5da0('0x62')]=null;}}else{_0xf295f2[_0x5da0('0x58')][_0x5da0('0x62')]=null;}if(_0xf295f2[_0x5da0('0x58')]&&_['isArray'](_0xf295f2['body'])){for(var _0x40f431=0x0;_0x40f431<_0xf295f2[_0x5da0('0x58')][_0x5da0('0x3d')];_0x40f431+=0x1){_0xf295f2[_0x5da0('0x58')][_0x40f431][_0x5da0('0x5b')]=_0xf295f2[_0x5da0('0x4f')]['id'];_0x3a630b[_0x5da0('0x65')](_0xf295f2['body'][_0x40f431]);}return BPromise[_0x5da0('0x66')](_0x3a630b,function(_0x591945){return db[_0x5da0('0x61')][_0x5da0('0x52')](_[_0x5da0('0x67')](_0x591945,[_0x5da0('0x60'),'id'])||{},{'fields':_[_0x5da0('0x36')](_0x186f5d),'raw':!![]})[_0x5da0('0x29')](function(_0xd3a783){_0x2e42be[_0x5da0('0x68')][_0x5da0('0x65')](_0xd3a783['dataValues']);})[_0x5da0('0x4d')](function(_0x1d2ee2){_0x2e42be[_0x5da0('0x69')][_0x5da0('0x65')]({'data':_0x591945,'error':_0x1d2ee2['message']});});})['then'](function(_0x4d1d5d){return _0x2e42be;})['catch'](function(_0x3833e5){return _0x3833e5;});}else{_0x28609d['status'](0x190)[_0x5da0('0x24')]({'message':_0x5da0('0x6a')});}});}})[_0x5da0('0x29')](respondWithResult(_0x28609d,null))['catch'](handleError(_0x28609d,null));};exports[_0x5da0('0x6b')]=function(_0x5688e6,_0x37379f,_0x4292e9){var _0x2ffb7e;return db['CmList']['find']({'where':{'id':_0x5688e6[_0x5da0('0x4f')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x5da0('0x6c')}]})[_0x5da0('0x29')](handleEntityNotFound(_0x37379f,null))[_0x5da0('0x29')](function(_0x53b3db){if(_0x53b3db){_0x2ffb7e=_0x53b3db;return db[_0x5da0('0x61')][_0x5da0('0x50')];}})['then'](function(_0x58fa65){if(_0x58fa65){var _0x2f87b6={};var _0x18ce8f={};_0x18ce8f[_0x5da0('0x3b')]=_['concat'](_[_0x5da0('0x36')](_0x58fa65),_[_0x5da0('0x32')](_0x2ffb7e[_0x5da0('0x6c')],function(_0x462e5f){return util[_0x5da0('0x6d')]('cf_%d',_0x462e5f['id']);}));_0x18ce8f['query']=_[_0x5da0('0x36')](_0x5688e6[_0x5da0('0x39')]);_0x18ce8f[_0x5da0('0x37')]=_['intersection'](_0x18ce8f[_0x5da0('0x3b')],_0x18ce8f[_0x5da0('0x39')]);_0x2f87b6[_0x5da0('0x3a')]=_[_0x5da0('0x38')](_0x18ce8f[_0x5da0('0x3b')],qs[_0x5da0('0x3c')](_0x5688e6[_0x5da0('0x39')][_0x5da0('0x3c')]));_0x2f87b6[_0x5da0('0x3a')]=_0x2f87b6['attributes']['length']?_0x2f87b6[_0x5da0('0x3a')]:_0x18ce8f[_0x5da0('0x3b')];if(!_0x5688e6[_0x5da0('0x39')][_0x5da0('0x5e')](_0x5da0('0x3e'))){_0x2f87b6[_0x5da0('0x3f')]=qs[_0x5da0('0x3f')](_0x5688e6['query'][_0x5da0('0x3f')]);_0x2f87b6[_0x5da0('0x21')]=qs['offset'](_0x5688e6[_0x5da0('0x39')][_0x5da0('0x21')]);}_0x2f87b6[_0x5da0('0x40')]=qs[_0x5da0('0x41')](_0x5688e6['query']['sort']);_0x2f87b6[_0x5da0('0x42')]=qs['filters'](_[_0x5da0('0x43')](_0x5688e6[_0x5da0('0x39')],_0x18ce8f['filters']));_0x2f87b6[_0x5da0('0x6e')]=!![];if(_0x5688e6[_0x5da0('0x39')][_0x5da0('0x44')]){_0x2f87b6[_0x5da0('0x42')]=_['merge'](_0x2f87b6['where'],{'$or':_['map'](_0x2f87b6['attributes'],function(_0x42fdc5){var _0x6e13ee={};_0x6e13ee[_0x42fdc5]={'$like':'%'+_0x5688e6[_0x5da0('0x39')]['filter']+'%'};return _0x6e13ee;})});}_0x2f87b6=_[_0x5da0('0x45')]({},_0x2f87b6,_0x5688e6['options']);return _0x2ffb7e['getContacts'](_0x2f87b6);}})[_0x5da0('0x29')](respondWithResult(_0x37379f,null))[_0x5da0('0x4d')](handleError(_0x37379f,null));};exports['getContactsCsv']=function(_0x191a70,_0x1812bf,_0x20cb9e){var _0x34b805;return db[_0x5da0('0x33')]['find']({'where':{'id':_0x191a70['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x5da0('0x6c')}]})['then'](handleEntityNotFound(_0x1812bf,null))[_0x5da0('0x29')](function(_0x47eac0){if(_0x47eac0){_0x34b805=_0x47eac0;return db[_0x5da0('0x61')][_0x5da0('0x50')];}})[_0x5da0('0x29')](function(_0x1b5e84){if(_0x1b5e84){var _0x5d7610={};var _0x9ae2f5={};_0x9ae2f5[_0x5da0('0x3b')]=_[_0x5da0('0x6f')](_['keys'](_0x1b5e84),_['map'](_0x34b805[_0x5da0('0x6c')],function(_0x465bbf){return util[_0x5da0('0x6d')]('cf_%d',_0x465bbf['id']);}));_0x9ae2f5[_0x5da0('0x39')]=_[_0x5da0('0x36')](_0x191a70[_0x5da0('0x39')]);_0x9ae2f5[_0x5da0('0x37')]=_['intersection'](_0x9ae2f5[_0x5da0('0x3b')],_0x9ae2f5[_0x5da0('0x39')]);_0x5d7610[_0x5da0('0x3a')]=_[_0x5da0('0x38')](_0x9ae2f5[_0x5da0('0x3b')],qs[_0x5da0('0x3c')](_0x191a70[_0x5da0('0x39')][_0x5da0('0x3c')]));_0x5d7610[_0x5da0('0x3a')]=_0x5d7610[_0x5da0('0x3a')][_0x5da0('0x3d')]?_0x5d7610['attributes']:_0x9ae2f5[_0x5da0('0x3b')];if(!_0x191a70['query'][_0x5da0('0x5e')](_0x5da0('0x3e'))){_0x5d7610[_0x5da0('0x3f')]=qs['limit'](_0x191a70[_0x5da0('0x39')][_0x5da0('0x3f')]);_0x5d7610['offset']=qs[_0x5da0('0x21')](_0x191a70['query'][_0x5da0('0x21')]);}_0x5d7610[_0x5da0('0x40')]=qs[_0x5da0('0x41')](_0x191a70[_0x5da0('0x39')][_0x5da0('0x41')]);_0x5d7610['where']=qs['filters'](_['pick'](_0x191a70[_0x5da0('0x39')],_0x9ae2f5[_0x5da0('0x37')]));_0x5d7610['raw']=!![];if(_0x191a70[_0x5da0('0x39')][_0x5da0('0x44')]){_0x5d7610[_0x5da0('0x42')]=_['merge'](_0x5d7610[_0x5da0('0x42')],{'$or':_['map'](_0x5d7610[_0x5da0('0x3a')],function(_0x120ec7){var _0x2f6e7e={};_0x2f6e7e[_0x120ec7]={'$like':'%'+_0x191a70['query'][_0x5da0('0x44')]+'%'};return _0x2f6e7e;})});}_0x5d7610=_[_0x5da0('0x45')]({},_0x5d7610,_0x191a70[_0x5da0('0x48')]);return _0x34b805[_0x5da0('0x6b')](_0x5d7610);}})['then'](function(_0xd25818){if(!_[_0x5da0('0x70')](_0xd25818)){var _0x401880=toCsv(_0xd25818);var _0x3c6fe2=Date[_0x5da0('0x71')]();fs[_0x5da0('0x72')](util[_0x5da0('0x6d')]('/tmp/list_%d_%s.csv',_0x34b805['id'],_0x3c6fe2),_0x401880);_0x1812bf['setHeader'](_0x5da0('0x73'),'attachment;\x20filename='+util[_0x5da0('0x6d')](_0x5da0('0x74'),_0x34b805['id'],_0x3c6fe2));_0x1812bf['setHeader'](_0x5da0('0x75'),_0x5da0('0x76'));return _0x1812bf[_0x5da0('0x77')](util[_0x5da0('0x6d')](_0x5da0('0x78'),_0x34b805['id'],_0x3c6fe2));}else{return _0x1812bf['sendStatus'](0xcc);}})['catch'](handleError(_0x1812bf,null));};exports[_0x5da0('0x79')]=function(_0x5d9519,_0x170212,_0x4f94a3){var _0x4e6751;delete _0x5d9519[_0x5da0('0x58')]['id'];return db[_0x5da0('0x33')]['findOne']({'where':{'id':_0x5d9519[_0x5da0('0x4f')]['id']}})[_0x5da0('0x29')](handleEntityNotFound(_0x170212,null))['then'](function(_0x105f76){if(_0x105f76){return db[_0x5da0('0x7a')][_0x5da0('0x7b')](function(_0x1fbaea){return db[_0x5da0('0x7c')][_0x5da0('0x52')](_0x5d9519[_0x5da0('0x58')],{'transaction':_0x1fbaea})[_0x5da0('0x29')](function(_0x11438e){_0x4e6751=_0x11438e;return _0x105f76[_0x5da0('0x7d')](_0x11438e,{'transaction':_0x1fbaea});})[_0x5da0('0x29')](function(){var _0x2ed46b={'type':db[_0x5da0('0x7e')][_0x5da0('0x7f')],'transaction':_0x1fbaea};switch(_0x5d9519[_0x5da0('0x58')][_0x5da0('0x46')]){case'text':_0x2ed46b['type']=db[_0x5da0('0x7e')]['TEXT'];break;case'number':_0x2ed46b[_0x5da0('0x46')]=db[_0x5da0('0x7e')]['INTEGER'];break;case _0x5da0('0x80'):_0x2ed46b['type']=db[_0x5da0('0x7e')][_0x5da0('0x81')];_0x2ed46b[_0x5da0('0x82')]=![];break;default:}return db[_0x5da0('0x7a')][_0x5da0('0x83')][_0x5da0('0x84')]('cm_contacts',util['format']('cf_%s',_0x4e6751['id']),_0x2ed46b);})[_0x5da0('0x29')](function(){return _0x4e6751;});});}})['then'](respondWithResult(_0x170212,null))[_0x5da0('0x4d')](handleError(_0x170212,null));};exports[_0x5da0('0x85')]=function(_0x1c5232,_0x896c5f,_0x54d1c9){var _0x149d85={};var _0x4b959f={};var _0x29c6a0;var _0x2253c0;return db[_0x5da0('0x33')]['findOne']({'where':{'id':_0x1c5232[_0x5da0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x896c5f,null))[_0x5da0('0x29')](function(_0x1dde93){if(_0x1dde93){_0x29c6a0=_0x1dde93;_0x4b959f[_0x5da0('0x3b')]=_[_0x5da0('0x36')](db[_0x5da0('0x7c')][_0x5da0('0x50')]);_0x4b959f[_0x5da0('0x39')]=_[_0x5da0('0x36')](_0x1c5232[_0x5da0('0x39')]);_0x4b959f[_0x5da0('0x37')]=_[_0x5da0('0x38')](_0x4b959f[_0x5da0('0x3b')],_0x4b959f[_0x5da0('0x39')]);_0x149d85[_0x5da0('0x3a')]=_[_0x5da0('0x38')](_0x4b959f[_0x5da0('0x3b')],qs[_0x5da0('0x3c')](_0x1c5232[_0x5da0('0x39')][_0x5da0('0x3c')]));_0x149d85['attributes']=_0x149d85['attributes'][_0x5da0('0x3d')]?_0x149d85[_0x5da0('0x3a')]:_0x4b959f[_0x5da0('0x3b')];_0x149d85[_0x5da0('0x40')]=qs[_0x5da0('0x41')](_0x1c5232[_0x5da0('0x39')][_0x5da0('0x41')]);_0x149d85['where']=qs[_0x5da0('0x37')](_[_0x5da0('0x43')](_0x1c5232['query'],_0x4b959f['filters']));_0x149d85[_0x5da0('0x42')]=_['merge'](_0x149d85[_0x5da0('0x42')],{'$or':[{'ListId':_0x1dde93['id']},{'ListId':null}]});if(_0x1c5232[_0x5da0('0x39')][_0x5da0('0x44')]){_0x149d85[_0x5da0('0x42')]=_[_0x5da0('0x45')](_0x149d85[_0x5da0('0x42')],{'$or':_[_0x5da0('0x32')](_0x149d85[_0x5da0('0x3a')],function(_0x46d994){var _0x22f866={};_0x22f866[_0x46d994]={'$like':'%'+_0x1c5232[_0x5da0('0x39')][_0x5da0('0x44')]+'%'};return _0x22f866;})});}_0x149d85=_[_0x5da0('0x45')]({},_0x149d85,_0x1c5232['options']);return db[_0x5da0('0x7c')][_0x5da0('0x86')](_0x149d85);}})[_0x5da0('0x29')](respondWithResult(_0x896c5f,null))['catch'](handleError(_0x896c5f,null));};exports[_0x5da0('0x87')]=function(_0x2b90cd,_0x443236,_0x36664f){return db[_0x5da0('0x33')][_0x5da0('0x51')]({'where':{'id':_0x2b90cd['params']['id']}})[_0x5da0('0x29')](handleEntityNotFound(_0x443236,null))[_0x5da0('0x29')](function(_0x2b5f6e){if(_0x2b5f6e){return _0x2b5f6e[_0x5da0('0x87')](_0x2b90cd[_0x5da0('0x58')][_0x5da0('0x60')],_[_0x5da0('0x67')](_0x2b90cd[_0x5da0('0x58')],[_0x5da0('0x60'),'id'])||{})[_0x5da0('0x88')](function(_0x286789){for(var _0x59342d=0x0;_0x59342d<_0x2b90cd[_0x5da0('0x58')]['ids']['length'];_0x59342d+=0x1){socket[_0x5da0('0x89')](_0x5da0('0x8a'),{'UserId':_0x2b90cd['body'][_0x5da0('0x60')][_0x59342d],'CmListId':_0x2b90cd[_0x5da0('0x4f')]['id']});}return _0x286789;});}})[_0x5da0('0x29')](respondWithResult(_0x443236,null))[_0x5da0('0x4d')](handleError(_0x443236,null));};exports[_0x5da0('0x8b')]=function(_0x1b6a00,_0x4bc5b8,_0x446f12){return db[_0x5da0('0x33')][_0x5da0('0x51')]({'where':{'id':_0x1b6a00[_0x5da0('0x4f')]['id']}})[_0x5da0('0x29')](handleEntityNotFound(_0x4bc5b8,null))[_0x5da0('0x29')](function(_0x53ea3e){if(_0x53ea3e){return _0x53ea3e['removeAgents'](_0x1b6a00['query'][_0x5da0('0x60')])[_0x5da0('0x29')](function(){if(_['isArray'](_0x1b6a00['query'][_0x5da0('0x60')])){for(var _0x98ba68=0x0;_0x98ba68<_0x1b6a00[_0x5da0('0x39')]['ids'][_0x5da0('0x3d')];_0x98ba68+=0x1){socket['emit'](_0x5da0('0x8c'),{'UserId':Number(_0x1b6a00[_0x5da0('0x39')][_0x5da0('0x60')][_0x98ba68]),'CmListId':Number(_0x1b6a00[_0x5da0('0x4f')]['id'])});}}else{socket['emit'](_0x5da0('0x8c'),{'UserId':Number(_0x1b6a00['query'][_0x5da0('0x60')]),'CmListId':Number(_0x1b6a00[_0x5da0('0x4f')]['id'])});}});}})[_0x5da0('0x29')](respondWithStatusCode(_0x4bc5b8,null))[_0x5da0('0x4d')](handleError(_0x4bc5b8,null));};exports['getAgents']=function(_0x31a918,_0x388c5e,_0x1c634d){var _0x289eef={};var _0x49f698={};var _0x261e0d;var _0x43346b;return db[_0x5da0('0x33')]['findOne']({'where':{'id':_0x31a918['params']['id']}})['then'](handleEntityNotFound(_0x388c5e,null))['then'](function(_0x2ab88b){if(_0x2ab88b){_0x261e0d=_0x2ab88b;_0x49f698['model']=_[_0x5da0('0x36')](db[_0x5da0('0x8d')][_0x5da0('0x50')]);_0x49f698[_0x5da0('0x39')]=_[_0x5da0('0x36')](_0x31a918[_0x5da0('0x39')]);_0x49f698[_0x5da0('0x37')]=_[_0x5da0('0x38')](_0x49f698['model'],_0x49f698[_0x5da0('0x39')]);_0x289eef[_0x5da0('0x3a')]=_[_0x5da0('0x38')](_0x49f698[_0x5da0('0x3b')],qs['fields'](_0x31a918[_0x5da0('0x39')][_0x5da0('0x3c')]));_0x289eef[_0x5da0('0x3a')]=_0x289eef[_0x5da0('0x3a')][_0x5da0('0x3d')]?_0x289eef[_0x5da0('0x3a')]:_0x49f698[_0x5da0('0x3b')];_0x289eef[_0x5da0('0x40')]=qs['sort'](_0x31a918['query']['sort']);_0x289eef[_0x5da0('0x42')]=qs[_0x5da0('0x37')](_[_0x5da0('0x43')](_0x31a918[_0x5da0('0x39')],_0x49f698[_0x5da0('0x37')]));if(_0x31a918[_0x5da0('0x39')][_0x5da0('0x44')]){_0x289eef['where']=_['merge'](_0x289eef[_0x5da0('0x42')],{'$or':_['map'](_0x289eef[_0x5da0('0x3a')],function(_0x10e962){var _0x2e0ebb={};_0x2e0ebb[_0x10e962]={'$like':'%'+_0x31a918['query'][_0x5da0('0x44')]+'%'};return _0x2e0ebb;})});}_0x289eef=_[_0x5da0('0x45')]({},_0x289eef,_0x31a918[_0x5da0('0x48')]);return _0x261e0d[_0x5da0('0x8e')](_0x289eef);}})[_0x5da0('0x29')](function(_0x4f8f7b){if(_0x4f8f7b){_0x43346b=_0x4f8f7b['length'];if(!_0x31a918[_0x5da0('0x39')][_0x5da0('0x5e')]('nolimit')){_0x289eef[_0x5da0('0x3f')]=qs[_0x5da0('0x3f')](_0x31a918[_0x5da0('0x39')][_0x5da0('0x3f')]);_0x289eef[_0x5da0('0x21')]=qs[_0x5da0('0x21')](_0x31a918[_0x5da0('0x39')][_0x5da0('0x21')]);}return _0x261e0d[_0x5da0('0x8e')](_0x289eef);}})['then'](function(_0x498ec9){if(_0x498ec9){return _0x498ec9?{'count':_0x43346b,'rows':_0x498ec9}:null;}})[_0x5da0('0x29')](respondWithResult(_0x388c5e,null))[_0x5da0('0x4d')](handleError(_0x388c5e,null));};
\ No newline at end of file
+var _0x3096=['lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','user','get','role','Lists','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','Disposition','findOne','ListId','removeDispositions','addContacts','CmContact','isArray','tags','join','push','each','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','cf_%d','nolimit','raw','getContactsCsv','CmCustomField','format','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x4bd606,_0x48f4dc){var _0x439478=function(_0x398ae9){while(--_0x398ae9){_0x4bd606['push'](_0x4bd606['shift']());}};_0x439478(++_0x48f4dc);}(_0x3096,0x116));var _0x6309=function(_0x283167,_0x39632){_0x283167=_0x283167-0x0;var _0x221c2c=_0x3096[_0x283167];return _0x221c2c;};'use strict';var pdf=require(_0x6309('0x0'));var emlformat=require(_0x6309('0x1'));var rimraf=require(_0x6309('0x2'));var zipdir=require(_0x6309('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6309('0x4'));var moment=require('moment');var BPromise=require(_0x6309('0x5'));var Mustache=require(_0x6309('0x6'));var util=require(_0x6309('0x7'));var path=require(_0x6309('0x8'));var sox=require(_0x6309('0x9'));var csv=require(_0x6309('0xa'));var ejs=require(_0x6309('0xb'));var fs=require('fs');var _=require(_0x6309('0xc'));var squel=require('squel');var crypto=require(_0x6309('0xd'));var jsforce=require(_0x6309('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6309('0xa'));var querystring=require(_0x6309('0xf'));var Papa=require(_0x6309('0x10'));var Redis=require(_0x6309('0x11'));var authService=require(_0x6309('0x12'));var qs=require(_0x6309('0x13'));var as=require(_0x6309('0x14'));var hardwareService=require(_0x6309('0x15'));var logger=require(_0x6309('0x16'))(_0x6309('0x17'));var utils=require(_0x6309('0x18'));var config=require(_0x6309('0x19'));var db=require('../../mysqldb')['db'];config[_0x6309('0x1a')]=_[_0x6309('0x1b')](config[_0x6309('0x1a')],{'host':_0x6309('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6309('0x1a')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x1659ca,_0x4dd122){_0x4dd122=_0x4dd122||0xcc;return function(_0x5a974e){if(_0x5a974e){return _0x1659ca[_0x6309('0x1d')](_0x4dd122);}return _0x1659ca[_0x6309('0x1e')](_0x4dd122)[_0x6309('0x1f')]();};}function respondWithResult(_0x1100e7,_0x5b387b){_0x5b387b=_0x5b387b||0xc8;return function(_0x154b69){if(_0x154b69){return _0x1100e7[_0x6309('0x1e')](_0x5b387b)[_0x6309('0x20')](_0x154b69);}};}function respondWithFilteredResult(_0xab1f05,_0x1c757a){return function(_0x1206c1){if(_0x1206c1){var _0x4ddd35=_0x1206c1[_0x6309('0x21')],_0x260e84=_0x1c757a[_0x6309('0x22')],_0x1fe46a=_0x1c757a[_0x6309('0x22')]+_0x1c757a[_0x6309('0x23')],_0x565db9;if(_0x1fe46a>=_0x4ddd35){_0x1fe46a=_0x4ddd35;_0x565db9=0xc8;}else{_0x565db9=0xce;}_0xab1f05['status'](_0x565db9);return _0xab1f05['set'](_0x6309('0x24'),_0x260e84+'-'+_0x1fe46a+'/'+_0x4ddd35)['json'](_0x1206c1);}return null;};}function patchUpdates(_0x1f8815){return function(_0x30f3d3){try{jsonpatch[_0x6309('0x25')](_0x30f3d3,_0x1f8815,!![]);}catch(_0x3ef082){return BPromise[_0x6309('0x26')](_0x3ef082);}return _0x30f3d3[_0x6309('0x27')]();};}function saveUpdates(_0x3a7727,_0x11e11d){return function(_0x19f514){if(_0x19f514){return _0x19f514[_0x6309('0x28')](_0x3a7727)[_0x6309('0x29')](function(_0x5e7895){return _0x5e7895;});}return null;};}function removeEntity(_0x154862,_0x18c35a){return function(_0x16608c){if(_0x16608c){return _0x16608c[_0x6309('0x2a')]()[_0x6309('0x29')](function(){var _0x8537d6=_0x16608c['get']({'plain':!![]});var _0x110c6c='Lists';return db['UserProfileResource']['destroy']({'where':{'type':_0x110c6c,'resourceId':_0x8537d6['id']}})['then'](function(){return _0x16608c;});})[_0x6309('0x29')](function(){_0x154862[_0x6309('0x1e')](0xcc)[_0x6309('0x1f')]();});}};}function handleEntityNotFound(_0x916755,_0x350bdb){return function(_0x25cfea){if(!_0x25cfea){_0x916755['sendStatus'](0x194);}return _0x25cfea;};}function handleError(_0x4c0977,_0x2214c4){_0x2214c4=_0x2214c4||0x1f4;return function(_0x501594){logger[_0x6309('0x2b')](_0x501594[_0x6309('0x2c')]);if(_0x501594[_0x6309('0x2d')]){delete _0x501594['name'];}_0x4c0977['status'](_0x2214c4)[_0x6309('0x2e')](_0x501594);};}exports[_0x6309('0x2f')]=function(_0x1117bc,_0x591409){var _0x3e99c6={},_0x1fe4a6={},_0x4eea5e={'count':0x0,'rows':[]};var _0x1f2e25=_[_0x6309('0x30')](db[_0x6309('0x31')][_0x6309('0x32')],function(_0x315a0b){return{'name':_0x315a0b[_0x6309('0x33')],'type':_0x315a0b[_0x6309('0x34')]['key']};});_0x1fe4a6[_0x6309('0x35')]=_[_0x6309('0x30')](_0x1f2e25,'name');_0x1fe4a6['query']=_['keys'](_0x1117bc['query']);_0x1fe4a6[_0x6309('0x36')]=_[_0x6309('0x37')](_0x1fe4a6[_0x6309('0x35')],_0x1fe4a6[_0x6309('0x38')]);_0x3e99c6[_0x6309('0x39')]=_[_0x6309('0x37')](_0x1fe4a6[_0x6309('0x35')],qs[_0x6309('0x3a')](_0x1117bc[_0x6309('0x38')][_0x6309('0x3a')]));_0x3e99c6['attributes']=_0x3e99c6[_0x6309('0x39')]['length']?_0x3e99c6['attributes']:_0x1fe4a6['model'];if(!_0x1117bc['query'][_0x6309('0x3b')]('nolimit')){_0x3e99c6[_0x6309('0x23')]=qs[_0x6309('0x23')](_0x1117bc['query']['limit']);_0x3e99c6[_0x6309('0x22')]=qs[_0x6309('0x22')](_0x1117bc[_0x6309('0x38')][_0x6309('0x22')]);}_0x3e99c6[_0x6309('0x3c')]=qs['sort'](_0x1117bc[_0x6309('0x38')][_0x6309('0x3d')]);_0x3e99c6[_0x6309('0x3e')]=qs[_0x6309('0x36')](_[_0x6309('0x3f')](_0x1117bc[_0x6309('0x38')],_0x1fe4a6[_0x6309('0x36')]),_0x1f2e25);if(_0x1117bc[_0x6309('0x38')][_0x6309('0x40')]){_0x3e99c6['where']=_[_0x6309('0x41')](_0x3e99c6[_0x6309('0x3e')],{'$or':_['map'](_0x1f2e25,function(_0x118467){if(_0x118467['type']!==_0x6309('0x42')){var _0x4ee591={};_0x4ee591[_0x118467[_0x6309('0x2d')]]={'$like':'%'+_0x1117bc['query'][_0x6309('0x40')]+'%'};return _0x4ee591;}})});}_0x3e99c6=_[_0x6309('0x41')]({},_0x3e99c6,_0x1117bc[_0x6309('0x43')]);var _0x231859={'where':_0x3e99c6[_0x6309('0x3e')]};return db[_0x6309('0x31')][_0x6309('0x21')](_0x231859)[_0x6309('0x29')](function(_0x22a188){_0x4eea5e[_0x6309('0x21')]=_0x22a188;if(_0x1117bc[_0x6309('0x38')][_0x6309('0x44')]){_0x3e99c6[_0x6309('0x45')]=[{'all':!![]}];}return db[_0x6309('0x31')][_0x6309('0x46')](_0x3e99c6);})[_0x6309('0x29')](function(_0x192f5c){_0x4eea5e[_0x6309('0x47')]=_0x192f5c;return _0x4eea5e;})[_0x6309('0x29')](respondWithFilteredResult(_0x591409,_0x3e99c6))[_0x6309('0x48')](handleError(_0x591409,null));};exports[_0x6309('0x49')]=function(_0x4f144e,_0x124629){var _0x33a740={'raw':![],'where':{'id':_0x4f144e[_0x6309('0x4a')]['id']}},_0x535497={};_0x535497['model']=_[_0x6309('0x4b')](db[_0x6309('0x31')]['rawAttributes']);_0x535497[_0x6309('0x38')]=_['keys'](_0x4f144e[_0x6309('0x38')]);_0x535497[_0x6309('0x36')]=_[_0x6309('0x37')](_0x535497[_0x6309('0x35')],_0x535497[_0x6309('0x38')]);_0x33a740[_0x6309('0x39')]=_[_0x6309('0x37')](_0x535497[_0x6309('0x35')],qs[_0x6309('0x3a')](_0x4f144e[_0x6309('0x38')][_0x6309('0x3a')]));_0x33a740['attributes']=_0x33a740[_0x6309('0x39')][_0x6309('0x4c')]?_0x33a740['attributes']:_0x535497[_0x6309('0x35')];if(_0x4f144e['query'][_0x6309('0x44')]){_0x33a740[_0x6309('0x45')]=[{'all':!![]}];}_0x33a740=_[_0x6309('0x41')]({},_0x33a740,_0x4f144e[_0x6309('0x43')]);return db[_0x6309('0x31')][_0x6309('0x4d')](_0x33a740)[_0x6309('0x29')](handleEntityNotFound(_0x124629,null))['then'](respondWithResult(_0x124629,null))[_0x6309('0x48')](handleError(_0x124629,null));};exports[_0x6309('0x4e')]=function(_0x12acd1,_0x40587e){return db[_0x6309('0x31')][_0x6309('0x4e')](_0x12acd1['body'],{})[_0x6309('0x29')](function(_0x10be0f){var _0x1825cc=_0x12acd1[_0x6309('0x4f')][_0x6309('0x50')]({'plain':!![]});if(!_0x1825cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1825cc[_0x6309('0x51')]===_0x6309('0x4f')){var _0x162117=_0x10be0f[_0x6309('0x50')]({'plain':!![]});var _0x1b112a=_0x6309('0x52');return db['UserProfileSection'][_0x6309('0x4d')]({'where':{'name':_0x1b112a,'userProfileId':_0x1825cc['userProfileId']},'raw':!![]})[_0x6309('0x29')](function(_0x53b619){if(_0x53b619&&_0x53b619[_0x6309('0x53')]===0x0){return db[_0x6309('0x54')][_0x6309('0x4e')]({'name':_0x162117[_0x6309('0x2d')],'resourceId':_0x162117['id'],'type':_0x53b619[_0x6309('0x2d')],'sectionId':_0x53b619['id']},{})[_0x6309('0x29')](function(){return _0x10be0f;});}else{return _0x10be0f;}})[_0x6309('0x48')](function(_0x375b4f){logger['error'](_0x6309('0x55'),_0x375b4f);throw _0x375b4f;});}return _0x10be0f;})['then'](respondWithResult(_0x40587e,0xc9))[_0x6309('0x48')](handleError(_0x40587e,null));};exports[_0x6309('0x28')]=function(_0x451ffe,_0x39adfd){if(_0x451ffe[_0x6309('0x56')]['id']){delete _0x451ffe[_0x6309('0x56')]['id'];}return db['CmList'][_0x6309('0x4d')]({'where':{'id':_0x451ffe[_0x6309('0x4a')]['id']}})[_0x6309('0x29')](handleEntityNotFound(_0x39adfd,null))[_0x6309('0x29')](saveUpdates(_0x451ffe['body'],null))[_0x6309('0x29')](respondWithResult(_0x39adfd,null))[_0x6309('0x48')](handleError(_0x39adfd,null));};exports['destroy']=function(_0x28ac1b,_0x291c67){return db[_0x6309('0x31')]['find']({'where':{'id':_0x28ac1b[_0x6309('0x4a')]['id']}})[_0x6309('0x29')](handleEntityNotFound(_0x291c67,null))[_0x6309('0x29')](removeEntity(_0x291c67,null))['catch'](handleError(_0x291c67,null));};exports[_0x6309('0x57')]=function(_0x240d73,_0x5bb40c){return db[_0x6309('0x31')][_0x6309('0x57')]()[_0x6309('0x29')](respondWithResult(_0x5bb40c,null))[_0x6309('0x48')](handleError(_0x5bb40c,null));};exports['addDisposition']=function(_0xdd91e2,_0x1e4ebe,_0x2af607){if(_0xdd91e2[_0x6309('0x56')]['id']){delete _0xdd91e2['body']['id'];}return db[_0x6309('0x31')][_0x6309('0x4d')]({'where':{'id':_0xdd91e2[_0x6309('0x4a')]['id']}})[_0x6309('0x29')](handleEntityNotFound(_0x1e4ebe,null))[_0x6309('0x29')](function(_0x108e13){if(_0x108e13){_0xdd91e2['body']['ListId']=_0x108e13['id'];return db[_0x6309('0x58')][_0x6309('0x4e')](_0xdd91e2[_0x6309('0x56')]);}})['then'](respondWithResult(_0x1e4ebe,null))[_0x6309('0x48')](handleError(_0x1e4ebe,null));};exports['getDispositions']=function(_0x34a73d,_0x158086,_0x2664ae){var _0x4fa144={'raw':![],'where':{}};var _0x151f92={};var _0x148b42={'count':0x0,'rows':[]};return db[_0x6309('0x31')][_0x6309('0x59')]({'where':{'id':_0x34a73d['params']['id']}})[_0x6309('0x29')](handleEntityNotFound(_0x158086,null))[_0x6309('0x29')](function(_0x1e4a07){if(_0x1e4a07){_0x151f92[_0x6309('0x35')]=_[_0x6309('0x4b')](db[_0x6309('0x58')][_0x6309('0x32')]);_0x151f92[_0x6309('0x38')]=_[_0x6309('0x4b')](_0x34a73d[_0x6309('0x38')]);_0x151f92['filters']=_[_0x6309('0x37')](_0x151f92[_0x6309('0x35')],_0x151f92[_0x6309('0x38')]);_0x4fa144[_0x6309('0x39')]=_[_0x6309('0x37')](_0x151f92[_0x6309('0x35')],qs[_0x6309('0x3a')](_0x34a73d['query'][_0x6309('0x3a')]));_0x4fa144[_0x6309('0x39')]=_0x4fa144[_0x6309('0x39')][_0x6309('0x4c')]?_0x4fa144[_0x6309('0x39')]:_0x151f92[_0x6309('0x35')];if(!_0x34a73d['query']['hasOwnProperty']('nolimit')){_0x4fa144['limit']=qs[_0x6309('0x23')](_0x34a73d[_0x6309('0x38')]['limit']);_0x4fa144[_0x6309('0x22')]=qs['offset'](_0x34a73d['query']['offset']);}_0x4fa144['order']=qs[_0x6309('0x3d')](_0x34a73d[_0x6309('0x38')][_0x6309('0x3d')]);_0x4fa144['where']=qs[_0x6309('0x36')](_[_0x6309('0x3f')](_0x34a73d[_0x6309('0x38')],_0x151f92[_0x6309('0x36')]));_0x4fa144[_0x6309('0x3e')][_0x6309('0x5a')]=_0x1e4a07['id'];if(_0x34a73d[_0x6309('0x38')]['filter']){_0x4fa144[_0x6309('0x3e')]=_[_0x6309('0x41')](_0x4fa144['where'],{'$or':_[_0x6309('0x30')](_0x4fa144[_0x6309('0x39')],function(_0x291635){var _0x531ff2={};_0x531ff2[_0x291635]={'$like':'%'+_0x34a73d[_0x6309('0x38')]['filter']+'%'};return _0x531ff2;})});}_0x4fa144=_[_0x6309('0x41')]({},_0x4fa144,_0x34a73d[_0x6309('0x43')]);return db[_0x6309('0x58')][_0x6309('0x21')]({'where':_0x4fa144[_0x6309('0x3e')]})[_0x6309('0x29')](function(_0x5a9d19){_0x148b42[_0x6309('0x21')]=_0x5a9d19;if(_0x34a73d['query']['includeAll']){_0x4fa144['include']=[{'all':!![]}];}return db[_0x6309('0x58')][_0x6309('0x46')](_0x4fa144);})[_0x6309('0x29')](function(_0x18025f){_0x148b42[_0x6309('0x47')]=_0x18025f;return _0x148b42;});}})[_0x6309('0x29')](respondWithFilteredResult(_0x158086,_0x4fa144))[_0x6309('0x48')](handleError(_0x158086,null));};exports[_0x6309('0x5b')]=function(_0x20cdd4,_0x439a5b,_0x198aca){return db[_0x6309('0x31')][_0x6309('0x4d')]({'where':{'id':_0x20cdd4['params']['id']}})[_0x6309('0x29')](handleEntityNotFound(_0x439a5b,null))['then'](function(_0xe5baad){if(_0xe5baad){return _0xe5baad['removeDispositions'](_0x20cdd4[_0x6309('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x439a5b,null))[_0x6309('0x48')](handleError(_0x439a5b,null));};exports[_0x6309('0x5c')]=function(_0x433b19,_0x3a2519,_0x3365bc){return db[_0x6309('0x31')][_0x6309('0x4d')]({'where':{'id':_0x433b19[_0x6309('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3a2519,null))[_0x6309('0x29')](function(_0x230ae6){if(_0x230ae6){var _0x44f5fd=[];var _0x576082={'success':[],'errors':[]};return db[_0x6309('0x5d')][_0x6309('0x57')]()[_0x6309('0x29')](function(_0x34816e){if(_0x433b19['body']['tags']&&_[_0x6309('0x5e')](_0x433b19['body'][_0x6309('0x5f')])){if(_0x433b19[_0x6309('0x56')][_0x6309('0x5f')][_0x6309('0x4c')]){_0x433b19[_0x6309('0x56')][_0x6309('0x5f')]=_0x433b19[_0x6309('0x56')][_0x6309('0x5f')][_0x6309('0x60')](';')+';';}else{_0x433b19[_0x6309('0x56')][_0x6309('0x5f')]=null;}}else{_0x433b19[_0x6309('0x56')][_0x6309('0x5f')]=null;}if(_0x433b19[_0x6309('0x56')]&&_[_0x6309('0x5e')](_0x433b19[_0x6309('0x56')])){for(var _0x133c9c=0x0;_0x133c9c<_0x433b19['body'][_0x6309('0x4c')];_0x133c9c+=0x1){_0x433b19[_0x6309('0x56')][_0x133c9c][_0x6309('0x5a')]=_0x433b19[_0x6309('0x4a')]['id'];_0x44f5fd[_0x6309('0x61')](_0x433b19[_0x6309('0x56')][_0x133c9c]);}return BPromise[_0x6309('0x62')](_0x44f5fd,function(_0x108983){return db[_0x6309('0x5d')]['create'](_[_0x6309('0x63')](_0x108983,[_0x6309('0x64'),'id'])||{},{'fields':_['keys'](_0x34816e),'raw':!![]})[_0x6309('0x29')](function(_0x34a6c1){_0x576082[_0x6309('0x65')][_0x6309('0x61')](_0x34a6c1[_0x6309('0x66')]);})['catch'](function(_0xd7055f){_0x576082[_0x6309('0x67')][_0x6309('0x61')]({'data':_0x108983,'error':_0xd7055f[_0x6309('0x68')]});});})[_0x6309('0x29')](function(_0x2d107d){return _0x576082;})[_0x6309('0x48')](function(_0x4471dd){return _0x4471dd;});}else{_0x3a2519[_0x6309('0x1e')](0x190)[_0x6309('0x20')]({'message':_0x6309('0x69')});}});}})['then'](respondWithResult(_0x3a2519,null))['catch'](handleError(_0x3a2519,null));};exports[_0x6309('0x6a')]=function(_0x5b322d,_0x5a0902,_0x54a253){var _0x14fbc1;return db['CmList']['find']({'where':{'id':_0x5b322d[_0x6309('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x6309('0x6b')}]})[_0x6309('0x29')](handleEntityNotFound(_0x5a0902,null))['then'](function(_0x54aeb1){if(_0x54aeb1){_0x14fbc1=_0x54aeb1;return db[_0x6309('0x5d')]['rawAttributes'];}})['then'](function(_0x3da1ca){if(_0x3da1ca){var _0x15094e={};var _0x128d02={};_0x128d02[_0x6309('0x35')]=_[_0x6309('0x6c')](_[_0x6309('0x4b')](_0x3da1ca),_[_0x6309('0x30')](_0x14fbc1[_0x6309('0x6b')],function(_0x55697e){return util['format'](_0x6309('0x6d'),_0x55697e['id']);}));_0x128d02['query']=_[_0x6309('0x4b')](_0x5b322d[_0x6309('0x38')]);_0x128d02[_0x6309('0x36')]=_[_0x6309('0x37')](_0x128d02[_0x6309('0x35')],_0x128d02['query']);_0x15094e['attributes']=_[_0x6309('0x37')](_0x128d02[_0x6309('0x35')],qs['fields'](_0x5b322d[_0x6309('0x38')][_0x6309('0x3a')]));_0x15094e[_0x6309('0x39')]=_0x15094e[_0x6309('0x39')][_0x6309('0x4c')]?_0x15094e[_0x6309('0x39')]:_0x128d02[_0x6309('0x35')];if(!_0x5b322d[_0x6309('0x38')][_0x6309('0x3b')](_0x6309('0x6e'))){_0x15094e[_0x6309('0x23')]=qs[_0x6309('0x23')](_0x5b322d[_0x6309('0x38')][_0x6309('0x23')]);_0x15094e[_0x6309('0x22')]=qs[_0x6309('0x22')](_0x5b322d[_0x6309('0x38')]['offset']);}_0x15094e[_0x6309('0x3c')]=qs[_0x6309('0x3d')](_0x5b322d['query']['sort']);_0x15094e[_0x6309('0x3e')]=qs[_0x6309('0x36')](_[_0x6309('0x3f')](_0x5b322d['query'],_0x128d02[_0x6309('0x36')]));_0x15094e[_0x6309('0x6f')]=!![];if(_0x5b322d[_0x6309('0x38')]['filter']){_0x15094e[_0x6309('0x3e')]=_[_0x6309('0x41')](_0x15094e[_0x6309('0x3e')],{'$or':_['map'](_0x15094e['attributes'],function(_0x486548){var _0x250fa1={};_0x250fa1[_0x486548]={'$like':'%'+_0x5b322d[_0x6309('0x38')][_0x6309('0x40')]+'%'};return _0x250fa1;})});}_0x15094e=_['merge']({},_0x15094e,_0x5b322d[_0x6309('0x43')]);return _0x14fbc1[_0x6309('0x6a')](_0x15094e);}})[_0x6309('0x29')](respondWithResult(_0x5a0902,null))['catch'](handleError(_0x5a0902,null));};exports[_0x6309('0x70')]=function(_0x4a3f7c,_0x2623cd,_0x437124){var _0x4f343a;return db[_0x6309('0x31')][_0x6309('0x4d')]({'where':{'id':_0x4a3f7c[_0x6309('0x4a')]['id']},'include':[{'model':db[_0x6309('0x71')],'as':'CustomFields'}]})[_0x6309('0x29')](handleEntityNotFound(_0x2623cd,null))['then'](function(_0x52e7e0){if(_0x52e7e0){_0x4f343a=_0x52e7e0;return db['CmContact'][_0x6309('0x32')];}})[_0x6309('0x29')](function(_0x4a85b4){if(_0x4a85b4){var _0xe097fe={};var _0x34be9f={};_0x34be9f[_0x6309('0x35')]=_[_0x6309('0x6c')](_[_0x6309('0x4b')](_0x4a85b4),_[_0x6309('0x30')](_0x4f343a[_0x6309('0x6b')],function(_0x1f0fb3){return util[_0x6309('0x72')](_0x6309('0x6d'),_0x1f0fb3['id']);}));_0x34be9f['query']=_['keys'](_0x4a3f7c['query']);_0x34be9f[_0x6309('0x36')]=_['intersection'](_0x34be9f[_0x6309('0x35')],_0x34be9f[_0x6309('0x38')]);_0xe097fe[_0x6309('0x39')]=_[_0x6309('0x37')](_0x34be9f[_0x6309('0x35')],qs[_0x6309('0x3a')](_0x4a3f7c['query'][_0x6309('0x3a')]));_0xe097fe[_0x6309('0x39')]=_0xe097fe['attributes'][_0x6309('0x4c')]?_0xe097fe[_0x6309('0x39')]:_0x34be9f[_0x6309('0x35')];if(!_0x4a3f7c['query']['hasOwnProperty'](_0x6309('0x6e'))){_0xe097fe[_0x6309('0x23')]=qs['limit'](_0x4a3f7c[_0x6309('0x38')][_0x6309('0x23')]);_0xe097fe[_0x6309('0x22')]=qs[_0x6309('0x22')](_0x4a3f7c[_0x6309('0x38')][_0x6309('0x22')]);}_0xe097fe[_0x6309('0x3c')]=qs['sort'](_0x4a3f7c['query']['sort']);_0xe097fe[_0x6309('0x3e')]=qs[_0x6309('0x36')](_['pick'](_0x4a3f7c[_0x6309('0x38')],_0x34be9f[_0x6309('0x36')]));_0xe097fe[_0x6309('0x6f')]=!![];if(_0x4a3f7c[_0x6309('0x38')][_0x6309('0x40')]){_0xe097fe['where']=_['merge'](_0xe097fe['where'],{'$or':_['map'](_0xe097fe[_0x6309('0x39')],function(_0x351070){var _0xbf291f={};_0xbf291f[_0x351070]={'$like':'%'+_0x4a3f7c[_0x6309('0x38')][_0x6309('0x40')]+'%'};return _0xbf291f;})});}_0xe097fe=_[_0x6309('0x41')]({},_0xe097fe,_0x4a3f7c[_0x6309('0x43')]);return _0x4f343a[_0x6309('0x6a')](_0xe097fe);}})[_0x6309('0x29')](function(_0x2389b0){if(!_[_0x6309('0x73')](_0x2389b0)){var _0x2664ce=toCsv(_0x2389b0);var _0x359173=Date[_0x6309('0x74')]();fs[_0x6309('0x75')](util[_0x6309('0x72')](_0x6309('0x76'),_0x4f343a['id'],_0x359173),_0x2664ce);_0x2623cd[_0x6309('0x77')](_0x6309('0x78'),'attachment;\x20filename='+util[_0x6309('0x72')]('list_%d_%s.csv',_0x4f343a['id'],_0x359173));_0x2623cd[_0x6309('0x77')]('Content-type',_0x6309('0x79'));return _0x2623cd[_0x6309('0x7a')](util[_0x6309('0x72')](_0x6309('0x76'),_0x4f343a['id'],_0x359173));}else{return _0x2623cd[_0x6309('0x1d')](0xcc);}})[_0x6309('0x48')](handleError(_0x2623cd,null));};exports[_0x6309('0x7b')]=function(_0x2e9247,_0x1ddd88,_0x3c5acf){var _0x38ecdc;delete _0x2e9247[_0x6309('0x56')]['id'];return db[_0x6309('0x31')][_0x6309('0x59')]({'where':{'id':_0x2e9247[_0x6309('0x4a')]['id']}})[_0x6309('0x29')](handleEntityNotFound(_0x1ddd88,null))[_0x6309('0x29')](function(_0xe03585){if(_0xe03585){return db[_0x6309('0x7c')]['transaction'](function(_0x203c0f){return db[_0x6309('0x71')][_0x6309('0x4e')](_0x2e9247['body'],{'transaction':_0x203c0f})['then'](function(_0x5edc89){_0x38ecdc=_0x5edc89;return _0xe03585[_0x6309('0x7d')](_0x5edc89,{'transaction':_0x203c0f});})[_0x6309('0x29')](function(){var _0xe58c1f={'type':db[_0x6309('0x7e')][_0x6309('0x7f')],'transaction':_0x203c0f};switch(_0x2e9247['body'][_0x6309('0x34')]){case _0x6309('0x80'):_0xe58c1f[_0x6309('0x34')]=db['Sequelize']['TEXT'];break;case _0x6309('0x81'):_0xe58c1f[_0x6309('0x34')]=db['Sequelize'][_0x6309('0x82')];break;case _0x6309('0x83'):_0xe58c1f['type']=db[_0x6309('0x7e')]['BOOLEAN'];_0xe58c1f[_0x6309('0x84')]=![];break;default:}return db['sequelize'][_0x6309('0x85')][_0x6309('0x86')](_0x6309('0x87'),util[_0x6309('0x72')]('cf_%s',_0x38ecdc['id']),_0xe58c1f);})[_0x6309('0x29')](function(){return _0x38ecdc;});});}})[_0x6309('0x29')](respondWithResult(_0x1ddd88,null))[_0x6309('0x48')](handleError(_0x1ddd88,null));};exports[_0x6309('0x88')]=function(_0x4c6a26,_0x32b494,_0x5aafec){var _0x1daa43={};var _0x5da715={};var _0x3f1718;var _0x43b8d0;return db[_0x6309('0x31')][_0x6309('0x59')]({'where':{'id':_0x4c6a26[_0x6309('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32b494,null))[_0x6309('0x29')](function(_0x64bf4e){if(_0x64bf4e){_0x3f1718=_0x64bf4e;_0x5da715[_0x6309('0x35')]=_[_0x6309('0x4b')](db['CmCustomField'][_0x6309('0x32')]);_0x5da715[_0x6309('0x38')]=_[_0x6309('0x4b')](_0x4c6a26['query']);_0x5da715[_0x6309('0x36')]=_[_0x6309('0x37')](_0x5da715[_0x6309('0x35')],_0x5da715[_0x6309('0x38')]);_0x1daa43[_0x6309('0x39')]=_[_0x6309('0x37')](_0x5da715['model'],qs[_0x6309('0x3a')](_0x4c6a26[_0x6309('0x38')][_0x6309('0x3a')]));_0x1daa43[_0x6309('0x39')]=_0x1daa43[_0x6309('0x39')][_0x6309('0x4c')]?_0x1daa43[_0x6309('0x39')]:_0x5da715[_0x6309('0x35')];_0x1daa43[_0x6309('0x3c')]=qs[_0x6309('0x3d')](_0x4c6a26[_0x6309('0x38')]['sort']);_0x1daa43[_0x6309('0x3e')]=qs[_0x6309('0x36')](_['pick'](_0x4c6a26[_0x6309('0x38')],_0x5da715['filters']));_0x1daa43['where']=_[_0x6309('0x41')](_0x1daa43['where'],{'$or':[{'ListId':_0x64bf4e['id']},{'ListId':null}]});if(_0x4c6a26[_0x6309('0x38')]['filter']){_0x1daa43[_0x6309('0x3e')]=_[_0x6309('0x41')](_0x1daa43[_0x6309('0x3e')],{'$or':_[_0x6309('0x30')](_0x1daa43[_0x6309('0x39')],function(_0xb6dcfb){var _0x389570={};_0x389570[_0xb6dcfb]={'$like':'%'+_0x4c6a26[_0x6309('0x38')][_0x6309('0x40')]+'%'};return _0x389570;})});}_0x1daa43=_[_0x6309('0x41')]({},_0x1daa43,_0x4c6a26[_0x6309('0x43')]);return db[_0x6309('0x71')][_0x6309('0x89')](_0x1daa43);}})[_0x6309('0x29')](respondWithResult(_0x32b494,null))[_0x6309('0x48')](handleError(_0x32b494,null));};exports[_0x6309('0x8a')]=function(_0x1fa76a,_0x4f5a77,_0x19b05a){return db[_0x6309('0x31')]['find']({'where':{'id':_0x1fa76a[_0x6309('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f5a77,null))[_0x6309('0x29')](function(_0x60a99b){if(_0x60a99b){return _0x60a99b[_0x6309('0x8a')](_0x1fa76a[_0x6309('0x56')][_0x6309('0x64')],_[_0x6309('0x63')](_0x1fa76a[_0x6309('0x56')],['ids','id'])||{})[_0x6309('0x8b')](function(_0x47626c){for(var _0x3ea01b=0x0;_0x3ea01b<_0x1fa76a[_0x6309('0x56')][_0x6309('0x64')][_0x6309('0x4c')];_0x3ea01b+=0x1){socket[_0x6309('0x8c')]('userCmList:save',{'UserId':_0x1fa76a[_0x6309('0x56')][_0x6309('0x64')][_0x3ea01b],'CmListId':_0x1fa76a['params']['id']});}return _0x47626c;});}})[_0x6309('0x29')](respondWithResult(_0x4f5a77,null))[_0x6309('0x48')](handleError(_0x4f5a77,null));};exports[_0x6309('0x8d')]=function(_0x509b1f,_0x54a3f2,_0x1575e8){return db['CmList'][_0x6309('0x4d')]({'where':{'id':_0x509b1f['params']['id']}})[_0x6309('0x29')](handleEntityNotFound(_0x54a3f2,null))[_0x6309('0x29')](function(_0x57f2d3){if(_0x57f2d3){return _0x57f2d3[_0x6309('0x8d')](_0x509b1f[_0x6309('0x38')]['ids'])[_0x6309('0x29')](function(){if(_['isArray'](_0x509b1f[_0x6309('0x38')][_0x6309('0x64')])){for(var _0x163ddb=0x0;_0x163ddb<_0x509b1f[_0x6309('0x38')]['ids'][_0x6309('0x4c')];_0x163ddb+=0x1){socket['emit'](_0x6309('0x8e'),{'UserId':Number(_0x509b1f[_0x6309('0x38')]['ids'][_0x163ddb]),'CmListId':Number(_0x509b1f[_0x6309('0x4a')]['id'])});}}else{socket[_0x6309('0x8c')](_0x6309('0x8e'),{'UserId':Number(_0x509b1f[_0x6309('0x38')][_0x6309('0x64')]),'CmListId':Number(_0x509b1f[_0x6309('0x4a')]['id'])});}});}})[_0x6309('0x29')](respondWithStatusCode(_0x54a3f2,null))[_0x6309('0x48')](handleError(_0x54a3f2,null));};exports[_0x6309('0x8f')]=function(_0x51fe06,_0x3cf179,_0x100878){var _0x1d1164={};var _0x229460={};var _0x2c359a;var _0x5f42dc;return db[_0x6309('0x31')][_0x6309('0x59')]({'where':{'id':_0x51fe06[_0x6309('0x4a')]['id']}})[_0x6309('0x29')](handleEntityNotFound(_0x3cf179,null))[_0x6309('0x29')](function(_0x170bb5){if(_0x170bb5){_0x2c359a=_0x170bb5;_0x229460[_0x6309('0x35')]=_['keys'](db[_0x6309('0x90')][_0x6309('0x32')]);_0x229460[_0x6309('0x38')]=_['keys'](_0x51fe06[_0x6309('0x38')]);_0x229460[_0x6309('0x36')]=_[_0x6309('0x37')](_0x229460[_0x6309('0x35')],_0x229460[_0x6309('0x38')]);_0x1d1164[_0x6309('0x39')]=_[_0x6309('0x37')](_0x229460['model'],qs[_0x6309('0x3a')](_0x51fe06[_0x6309('0x38')][_0x6309('0x3a')]));_0x1d1164[_0x6309('0x39')]=_0x1d1164['attributes'][_0x6309('0x4c')]?_0x1d1164[_0x6309('0x39')]:_0x229460[_0x6309('0x35')];_0x1d1164[_0x6309('0x3c')]=qs[_0x6309('0x3d')](_0x51fe06[_0x6309('0x38')]['sort']);_0x1d1164['where']=qs[_0x6309('0x36')](_[_0x6309('0x3f')](_0x51fe06[_0x6309('0x38')],_0x229460[_0x6309('0x36')]));if(_0x51fe06[_0x6309('0x38')][_0x6309('0x40')]){_0x1d1164[_0x6309('0x3e')]=_[_0x6309('0x41')](_0x1d1164[_0x6309('0x3e')],{'$or':_[_0x6309('0x30')](_0x1d1164[_0x6309('0x39')],function(_0x5c787d){var _0x2fd1a6={};_0x2fd1a6[_0x5c787d]={'$like':'%'+_0x51fe06[_0x6309('0x38')][_0x6309('0x40')]+'%'};return _0x2fd1a6;})});}_0x1d1164=_[_0x6309('0x41')]({},_0x1d1164,_0x51fe06[_0x6309('0x43')]);return _0x2c359a['getAgents'](_0x1d1164);}})['then'](function(_0x37545d){if(_0x37545d){_0x5f42dc=_0x37545d['length'];if(!_0x51fe06['query'][_0x6309('0x3b')]('nolimit')){_0x1d1164[_0x6309('0x23')]=qs['limit'](_0x51fe06[_0x6309('0x38')][_0x6309('0x23')]);_0x1d1164['offset']=qs[_0x6309('0x22')](_0x51fe06[_0x6309('0x38')][_0x6309('0x22')]);}return _0x2c359a[_0x6309('0x8f')](_0x1d1164);}})[_0x6309('0x29')](function(_0xc0d616){if(_0xc0d616){return _0xc0d616?{'count':_0x5f42dc,'rows':_0xc0d616}:null;}})[_0x6309('0x29')](respondWithResult(_0x3cf179,null))[_0x6309('0x48')](handleError(_0x3cf179,null));};
\ No newline at end of file
index bd9ca1b..fd3b5c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa249=['emit','hasOwnProperty','hook','exports','../../mysqldb','CmList','setMaxListeners','update','remove'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xa249,0x109));var _0x9a24=function(_0x5f1a94,_0x55307d){_0x5f1a94=_0x5f1a94-0x0;var _0x3f8287=_0xa249[_0x5f1a94];return _0x3f8287;};'use strict';var EventEmitter=require('events');var CmList=require(_0x9a24('0x0'))['db'][_0x9a24('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x9a24('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9a24('0x3'),'afterDestroy':_0x9a24('0x4')};function emitEvent(_0x4be3ed){return function(_0x49c825,_0x525d99,_0x591076){CmListEvents[_0x9a24('0x5')](_0x4be3ed+':'+_0x49c825['id'],_0x49c825);CmListEvents[_0x9a24('0x5')](_0x4be3ed,_0x49c825);_0x591076(null);};}for(var e in events){if(events[_0x9a24('0x6')](e)){var event=events[e];CmList[_0x9a24('0x7')](e,emitEvent(event));}}module[_0x9a24('0x8')]=CmListEvents;
\ No newline at end of file
+var _0xc1ac=['events','CmList','setMaxListeners','update','remove','emit','hook','exports'];(function(_0xee3051,_0xbe4f18){var _0x139e81=function(_0xac81c3){while(--_0xac81c3){_0xee3051['push'](_0xee3051['shift']());}};_0x139e81(++_0xbe4f18);}(_0xc1ac,0x68));var _0xcc1a=function(_0x31d49d,_0x42fc78){_0x31d49d=_0x31d49d-0x0;var _0x3d2f7d=_0xc1ac[_0x31d49d];return _0x3d2f7d;};'use strict';var EventEmitter=require(_0xcc1a('0x0'));var CmList=require('../../mysqldb')['db'][_0xcc1a('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0xcc1a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcc1a('0x3'),'afterDestroy':_0xcc1a('0x4')};function emitEvent(_0x56ad27){return function(_0x23d58b,_0x21910c,_0xebf8db){CmListEvents[_0xcc1a('0x5')](_0x56ad27+':'+_0x23d58b['id'],_0x23d58b);CmListEvents[_0xcc1a('0x5')](_0x56ad27,_0x23d58b);_0xebf8db(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xcc1a('0x6')](e,emitEvent(event));}}module[_0xcc1a('0x7')]=CmListEvents;
\ No newline at end of file
index b6a8a60..0545653 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe74b=['bluebird','path','rimraf','./cmList.attributes','exports','define','CmList','../../config/logger','moment'];(function(_0x4e10e9,_0x557389){var _0x27e73c=function(_0x2e0009){while(--_0x2e0009){_0x4e10e9['push'](_0x4e10e9['shift']());}};_0x27e73c(++_0x557389);}(_0xe74b,0xd6));var _0xbe74=function(_0x6efe75,_0x465b7b){_0x6efe75=_0x6efe75-0x0;var _0x2d349c=_0xe74b[_0x6efe75];return _0x2d349c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbe74('0x0'))('api');var moment=require(_0xbe74('0x1'));var BPromise=require(_0xbe74('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe74('0x3'));var rimraf=require(_0xbe74('0x4'));var config=require('../../config/environment');var attributes=require(_0xbe74('0x5'));module[_0xbe74('0x6')]=function(_0x3fe249,_0xd61b91){return _0x3fe249[_0xbe74('0x7')](_0xbe74('0x8'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3756=['util','../../config/logger','api','bluebird','rimraf','define','CmList','cm_lists','lodash'];(function(_0x3785bd,_0x253151){var _0x17c7f=function(_0x1a0a3d){while(--_0x1a0a3d){_0x3785bd['push'](_0x3785bd['shift']());}};_0x17c7f(++_0x253151);}(_0x3756,0x170));var _0x6375=function(_0x111d50,_0x3fe61e){_0x111d50=_0x111d50-0x0;var _0x2bc6d5=_0x3756[_0x111d50];return _0x2bc6d5;};'use strict';var _=require(_0x6375('0x0'));var util=require(_0x6375('0x1'));var logger=require(_0x6375('0x2'))(_0x6375('0x3'));var moment=require('moment');var BPromise=require(_0x6375('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6375('0x5'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module['exports']=function(_0x124343,_0xad3764){return _0x124343[_0x6375('0x6')](_0x6375('0x7'),attributes,{'tableName':_0x6375('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d8618a6..fda3b22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b3d=['stringify','error','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x1b3d,0x18c));var _0xd1b3=function(_0x4b4340,_0x13e6df){_0x4b4340=_0x4b4340-0x0;var _0x4346c4=_0x1b3d[_0x4b4340];return _0x4346c4;};'use strict';var _=require(_0xd1b3('0x0'));var util=require(_0xd1b3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd1b3('0x2'));var fs=require('fs');var Redis=require(_0xd1b3('0x3'));var db=require(_0xd1b3('0x4'))['db'];var utils=require(_0xd1b3('0x5'));var logger=require(_0xd1b3('0x6'))(_0xd1b3('0x7'));var config=require(_0xd1b3('0x8'));var jayson=require(_0xd1b3('0x9'));var client=jayson[_0xd1b3('0xa')][_0xd1b3('0xb')]({'port':0x232a});config['redis']=_[_0xd1b3('0xc')](config[_0xd1b3('0xd')],{'host':_0xd1b3('0xe'),'port':0x18eb});var socket=require(_0xd1b3('0xf'))(new Redis(config['redis']));require(_0xd1b3('0x10'))[_0xd1b3('0x11')](socket);function respondWithRpcPromise(_0x526b73,_0x430429,_0x4a76df){return new BPromise(function(_0x2e59b7,_0xc2217f){return client[_0xd1b3('0x12')](_0x526b73,_0x4a76df)[_0xd1b3('0x13')](function(_0x522c5e){logger[_0xd1b3('0x14')](_0xd1b3('0x15'),_0x430429,_0xd1b3('0x16'));logger[_0xd1b3('0x17')]('CmList,\x20%s,\x20%s,\x20%s',_0x430429,_0xd1b3('0x16'),JSON[_0xd1b3('0x18')](_0x522c5e));if(_0x522c5e['error']){if(_0x522c5e[_0xd1b3('0x19')]['code']===0x1f4){logger[_0xd1b3('0x19')]('CmList,\x20%s,\x20%s',_0x430429,_0x522c5e['error']['message']);return _0xc2217f(_0x522c5e[_0xd1b3('0x19')]['message']);}logger[_0xd1b3('0x19')]('CmList,\x20%s,\x20%s',_0x430429,_0x522c5e['error'][_0xd1b3('0x1a')]);return _0x2e59b7(_0x522c5e[_0xd1b3('0x19')]['message']);}else{logger[_0xd1b3('0x14')](_0xd1b3('0x15'),_0x430429,_0xd1b3('0x16'));_0x2e59b7(_0x522c5e['result']['message']);}})[_0xd1b3('0x1b')](function(_0x5dfbe2){logger[_0xd1b3('0x19')](_0xd1b3('0x15'),_0x430429,_0x5dfbe2);_0xc2217f(_0x5dfbe2);});});}
\ No newline at end of file
+var _0x015f=['request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','CmList,\x20%s,\x20%s'];(function(_0x494c7d,_0x47940b){var _0x2d0195=function(_0x52c233){while(--_0x52c233){_0x494c7d['push'](_0x494c7d['shift']());}};_0x2d0195(++_0x47940b);}(_0x015f,0x14d));var _0xf015=function(_0x5b3946,_0x23053c){_0x5b3946=_0x5b3946-0x0;var _0x2bd577=_0x015f[_0x5b3946];return _0x2bd577;};'use strict';var _=require('lodash');var util=require(_0xf015('0x0'));var moment=require('moment');var BPromise=require(_0xf015('0x1'));var rs=require(_0xf015('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf015('0x3'));var logger=require(_0xf015('0x4'))(_0xf015('0x5'));var config=require(_0xf015('0x6'));var jayson=require(_0xf015('0x7'));var client=jayson[_0xf015('0x8')][_0xf015('0x9')]({'port':0x232a});config[_0xf015('0xa')]=_[_0xf015('0xb')](config[_0xf015('0xa')],{'host':_0xf015('0xc'),'port':0x18eb});var socket=require(_0xf015('0xd'))(new Redis(config[_0xf015('0xa')]));require(_0xf015('0xe'))['register'](socket);function respondWithRpcPromise(_0x3c0f16,_0x52a53a,_0x383122){return new BPromise(function(_0x66ff52,_0x8bd5b9){return client[_0xf015('0xf')](_0x3c0f16,_0x383122)['then'](function(_0x5748e6){logger['info'](_0xf015('0x10'),_0x52a53a,_0xf015('0x11'));logger[_0xf015('0x12')](_0xf015('0x13'),_0x52a53a,_0xf015('0x11'),JSON[_0xf015('0x14')](_0x5748e6));if(_0x5748e6['error']){if(_0x5748e6[_0xf015('0x15')]['code']===0x1f4){logger['error'](_0xf015('0x10'),_0x52a53a,_0x5748e6[_0xf015('0x15')]['message']);return _0x8bd5b9(_0x5748e6[_0xf015('0x15')][_0xf015('0x16')]);}logger[_0xf015('0x15')](_0xf015('0x10'),_0x52a53a,_0x5748e6[_0xf015('0x15')][_0xf015('0x16')]);return _0x66ff52(_0x5748e6['error'][_0xf015('0x16')]);}else{logger[_0xf015('0x17')](_0xf015('0x10'),_0x52a53a,'request\x20sent');_0x66ff52(_0x5748e6['result'][_0xf015('0x16')]);}})[_0xf015('0x18')](function(_0x652764){logger[_0xf015('0x15')](_0xf015('0x10'),_0x52a53a,_0x652764);_0x8bd5b9(_0x652764);});});}
\ No newline at end of file
index ac3fdc4..e1d4bbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1f6=['save','remove','update','register','length','./cmList.events'];(function(_0x29db25,_0x457467){var _0x48b1a5=function(_0x5cb05f){while(--_0x5cb05f){_0x29db25['push'](_0x29db25['shift']());}};_0x48b1a5(++_0x457467);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x45aa72,_0x8af642){_0x45aa72=_0x45aa72-0x0;var _0x75adaa=_0xa1f6[_0x45aa72];return _0x75adaa;};'use strict';var CmListEvents=require(_0x6a1f('0x0'));var events=[_0x6a1f('0x1'),_0x6a1f('0x2'),_0x6a1f('0x3')];function createListener(_0x198e14,_0x123ad4){return function(_0x5cf561){_0x123ad4['emit'](_0x198e14,_0x5cf561);};}function removeListener(_0x521944,_0x5d4ad7){return function(){CmListEvents['removeListener'](_0x521944,_0x5d4ad7);};}exports[_0x6a1f('0x4')]=function(_0x426ae1){for(var _0xa1c928=0x0,_0x3a772b=events[_0x6a1f('0x5')];_0xa1c928<_0x3a772b;_0xa1c928++){var _0x3ecd63=events[_0xa1c928];var _0x36c00b=createListener('cmList:'+_0x3ecd63,_0x426ae1);CmListEvents['on'](_0x3ecd63,_0x36c00b);}};
\ No newline at end of file
+var _0x6a83=['register','length','cmList:','./cmList.events','save','remove','update','emit','removeListener'];(function(_0x5641ac,_0x4efbcb){var _0x5301da=function(_0x5ec540){while(--_0x5ec540){_0x5641ac['push'](_0x5641ac['shift']());}};_0x5301da(++_0x4efbcb);}(_0x6a83,0xd2));var _0x36a8=function(_0x10082b,_0x4fae40){_0x10082b=_0x10082b-0x0;var _0x1098b0=_0x6a83[_0x10082b];return _0x1098b0;};'use strict';var CmListEvents=require(_0x36a8('0x0'));var events=[_0x36a8('0x1'),_0x36a8('0x2'),_0x36a8('0x3')];function createListener(_0x125ca1,_0x367db7){return function(_0x1f59f3){_0x367db7[_0x36a8('0x4')](_0x125ca1,_0x1f59f3);};}function removeListener(_0x11a47c,_0x35767b){return function(){CmListEvents[_0x36a8('0x5')](_0x11a47c,_0x35767b);};}exports[_0x36a8('0x6')]=function(_0x360b47){for(var _0x60d79a=0x0,_0x2a0ba3=events[_0x36a8('0x7')];_0x60d79a<_0x2a0ba3;_0x60d79a++){var _0x31b8d3=events[_0x60d79a];var _0xf312a6=createListener(_0x36a8('0x8')+_0x31b8d3,_0x360b47);CmListEvents['on'](_0x31b8d3,_0xf312a6);}};
\ No newline at end of file
index c839ce8..f0ee1d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e30=['update','delete','destroy','removeDispositions','removeAgents','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','/:id/contacts','addContacts','addCustomField','addAgents','put'];(function(_0x421881,_0x3698ae){var _0x2be303=function(_0x4abaec){while(--_0x4abaec){_0x421881['push'](_0x421881['shift']());}};_0x2be303(++_0x3698ae);}(_0x8e30,0x1a9));var _0x08e3=function(_0x279dff,_0x22c86e){_0x279dff=_0x279dff-0x0;var _0x1b0e60=_0x8e30[_0x279dff];return _0x1b0e60;};'use strict';var multer=require('multer');var util=require(_0x08e3('0x0'));var path=require(_0x08e3('0x1'));var timeout=require('connect-timeout');var express=require(_0x08e3('0x2'));var router=express['Router']();var auth=require(_0x08e3('0x3'));var interaction=require(_0x08e3('0x4'));var config=require(_0x08e3('0x5'));var controller=require('./cmList.controller');router['get']('/',auth[_0x08e3('0x6')](),controller[_0x08e3('0x7')]);router[_0x08e3('0x8')](_0x08e3('0x9'),auth[_0x08e3('0x6')](),controller[_0x08e3('0xa')]);router['get'](_0x08e3('0xb'),auth[_0x08e3('0x6')](),controller[_0x08e3('0xc')]);router[_0x08e3('0x8')](_0x08e3('0xd'),auth[_0x08e3('0x6')](),controller[_0x08e3('0xe')]);router['get']('/:id/contacts',auth[_0x08e3('0x6')](),controller[_0x08e3('0xf')]);router[_0x08e3('0x8')](_0x08e3('0x10'),auth[_0x08e3('0x6')](),controller[_0x08e3('0x11')]);router['get'](_0x08e3('0x12'),auth[_0x08e3('0x6')](),controller[_0x08e3('0x13')]);router[_0x08e3('0x8')](_0x08e3('0x14'),auth['isAuthenticated'](),controller[_0x08e3('0x15')]);router[_0x08e3('0x16')]('/',auth[_0x08e3('0x6')](),controller[_0x08e3('0x17')]);router[_0x08e3('0x16')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x08e3('0x18')]);router[_0x08e3('0x16')](_0x08e3('0x19'),auth[_0x08e3('0x6')](),controller[_0x08e3('0x1a')]);router[_0x08e3('0x16')]('/:id/fields',auth['isAuthenticated'](),controller[_0x08e3('0x1b')]);router[_0x08e3('0x16')](_0x08e3('0x14'),auth[_0x08e3('0x6')](),controller[_0x08e3('0x1c')]);router[_0x08e3('0x1d')](_0x08e3('0xb'),auth[_0x08e3('0x6')](),controller[_0x08e3('0x1e')]);router[_0x08e3('0x1f')](_0x08e3('0xb'),auth[_0x08e3('0x6')](),controller[_0x08e3('0x20')]);router[_0x08e3('0x1f')](_0x08e3('0xd'),auth[_0x08e3('0x6')](),controller[_0x08e3('0x21')]);router[_0x08e3('0x1f')](_0x08e3('0x14'),auth[_0x08e3('0x6')](),controller[_0x08e3('0x22')]);module['exports']=router;
\ No newline at end of file
+var _0xb24b=['addCustomField','addAgents','update','destroy','delete','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','addDisposition','post','addContacts'];(function(_0x5d050c,_0x4aa769){var _0x123257=function(_0x158178){while(--_0x158178){_0x5d050c['push'](_0x5d050c['shift']());}};_0x123257(++_0x4aa769);}(_0xb24b,0x17e));var _0xbb24=function(_0x33fc98,_0x3e42cb){_0x33fc98=_0x33fc98-0x0;var _0x21a47b=_0xb24b[_0x33fc98];return _0x21a47b;};'use strict';var multer=require(_0xbb24('0x0'));var util=require('util');var path=require(_0xbb24('0x1'));var timeout=require(_0xbb24('0x2'));var express=require(_0xbb24('0x3'));var router=express[_0xbb24('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbb24('0x5'));var config=require(_0xbb24('0x6'));var controller=require(_0xbb24('0x7'));router[_0xbb24('0x8')]('/',auth['isAuthenticated'](),controller[_0xbb24('0x9')]);router[_0xbb24('0x8')](_0xbb24('0xa'),auth[_0xbb24('0xb')](),controller[_0xbb24('0xc')]);router[_0xbb24('0x8')](_0xbb24('0xd'),auth[_0xbb24('0xb')](),controller[_0xbb24('0xe')]);router[_0xbb24('0x8')](_0xbb24('0xf'),auth[_0xbb24('0xb')](),controller[_0xbb24('0x10')]);router['get'](_0xbb24('0x11'),auth[_0xbb24('0xb')](),controller['getContacts']);router[_0xbb24('0x8')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0xbb24('0x12')]);router[_0xbb24('0x8')](_0xbb24('0x13'),auth[_0xbb24('0xb')](),controller[_0xbb24('0x14')]);router[_0xbb24('0x8')](_0xbb24('0x15'),auth['isAuthenticated'](),controller[_0xbb24('0x16')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/dispositions',auth[_0xbb24('0xb')](),controller[_0xbb24('0x17')]);router[_0xbb24('0x18')](_0xbb24('0x11'),auth[_0xbb24('0xb')](),controller[_0xbb24('0x19')]);router['post'](_0xbb24('0x13'),auth['isAuthenticated'](),controller[_0xbb24('0x1a')]);router[_0xbb24('0x18')](_0xbb24('0x15'),auth[_0xbb24('0xb')](),controller[_0xbb24('0x1b')]);router['put']('/:id',auth[_0xbb24('0xb')](),controller[_0xbb24('0x1c')]);router['delete'](_0xbb24('0xd'),auth[_0xbb24('0xb')](),controller[_0xbb24('0x1d')]);router[_0xbb24('0x1e')]('/:id/dispositions',auth[_0xbb24('0xb')](),controller[_0xbb24('0x1f')]);router[_0xbb24('0x1e')](_0xbb24('0x15'),auth[_0xbb24('0xb')](),controller[_0xbb24('0x20')]);module[_0xbb24('0x21')]=router;
\ No newline at end of file
index 1cfcff7..a239f24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x41563b,_0x291690){var _0x42b3b2=function(_0x562ad7){while(--_0x562ad7){_0x41563b['push'](_0x41563b['shift']());}};_0x42b3b2(++_0x291690);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}};
\ No newline at end of file
+var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x250c4a,_0x28e177){var _0x15bfd6=function(_0x424482){while(--_0x424482){_0x250c4a['push'](_0x250c4a['shift']());}};_0x15bfd6(++_0x28e177);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}};
\ No newline at end of file
index 55e7534..5ec8d89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x184d=['save','update','destroy','then','error','stack','name','send','body','Condition','find','params','catch','eml-format','moment','bluebird','mustache','util','path','sox','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','set','Content-Range','apply','reject'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x184d,0x1d0));var _0xd184=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x184d[_0x11c573];return _0x6b72de;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd184('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd184('0x1'));var BPromise=require(_0xd184('0x2'));var Mustache=require(_0xd184('0x3'));var util=require(_0xd184('0x4'));var path=require(_0xd184('0x5'));var sox=require(_0xd184('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd184('0x7'));var crypto=require(_0xd184('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xd184('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd184('0xa'));var Redis=require(_0xd184('0xb'));var authService=require(_0xd184('0xc'));var qs=require(_0xd184('0xd'));var as=require(_0xd184('0xe'));var hardwareService=require(_0xd184('0xf'));var logger=require('../../config/logger')(_0xd184('0x10'));var utils=require(_0xd184('0x11'));var config=require(_0xd184('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9cb460,_0x5e5585){_0x5e5585=_0x5e5585||0xcc;return function(_0x33b94c){if(_0x33b94c){return _0x9cb460[_0xd184('0x13')](_0x5e5585);}return _0x9cb460[_0xd184('0x14')](_0x5e5585)[_0xd184('0x15')]();};}function respondWithResult(_0x11cb5a,_0x7dc346){_0x7dc346=_0x7dc346||0xc8;return function(_0x5a13eb){if(_0x5a13eb){return _0x11cb5a[_0xd184('0x14')](_0x7dc346)[_0xd184('0x16')](_0x5a13eb);}};}function respondWithFilteredResult(_0x32df27,_0x313c07){return function(_0x712577){if(_0x712577){var _0x316f4a=_0x712577[_0xd184('0x17')],_0x3fe670=_0x313c07['offset'],_0x296db8=_0x313c07['offset']+_0x313c07['limit'],_0x28447b;if(_0x296db8>=_0x316f4a){_0x296db8=_0x316f4a;_0x28447b=0xc8;}else{_0x28447b=0xce;}_0x32df27[_0xd184('0x14')](_0x28447b);return _0x32df27[_0xd184('0x18')](_0xd184('0x19'),_0x3fe670+'-'+_0x296db8+'/'+_0x316f4a)[_0xd184('0x16')](_0x712577);}return null;};}function patchUpdates(_0x23d0cf){return function(_0x20267a){try{jsonpatch[_0xd184('0x1a')](_0x20267a,_0x23d0cf,!![]);}catch(_0x56dab8){return BPromise[_0xd184('0x1b')](_0x56dab8);}return _0x20267a[_0xd184('0x1c')]();};}function saveUpdates(_0xd4190c,_0x38bbaf){return function(_0x92a5f9){if(_0x92a5f9){return _0x92a5f9[_0xd184('0x1d')](_0xd4190c)['then'](function(_0x3e60c4){return _0x3e60c4;});}return null;};}function removeEntity(_0x565c38,_0x1318a7){return function(_0x2fc10d){if(_0x2fc10d){return _0x2fc10d[_0xd184('0x1e')]()[_0xd184('0x1f')](function(){_0x565c38[_0xd184('0x14')](0xcc)[_0xd184('0x15')]();});}};}function handleEntityNotFound(_0x52b84b,_0x5398b5){return function(_0x466307){if(!_0x466307){_0x52b84b['sendStatus'](0x194);}return _0x466307;};}function handleError(_0x5e4f98,_0xcb670d){_0xcb670d=_0xcb670d||0x1f4;return function(_0x4b5169){logger[_0xd184('0x20')](_0x4b5169[_0xd184('0x21')]);if(_0x4b5169[_0xd184('0x22')]){delete _0x4b5169['name'];}_0x5e4f98[_0xd184('0x14')](_0xcb670d)[_0xd184('0x23')](_0x4b5169);};}exports[_0xd184('0x1d')]=function(_0x40c4e6,_0x1cdd3e){if(_0x40c4e6[_0xd184('0x24')]['id']){delete _0x40c4e6[_0xd184('0x24')]['id'];}return db[_0xd184('0x25')][_0xd184('0x26')]({'where':{'id':_0x40c4e6[_0xd184('0x27')]['id']}})['then'](handleEntityNotFound(_0x1cdd3e,null))[_0xd184('0x1f')](saveUpdates(_0x40c4e6['body'],null))[_0xd184('0x1f')](respondWithResult(_0x1cdd3e,null))[_0xd184('0x28')](handleError(_0x1cdd3e,null));};exports['destroy']=function(_0x31477a,_0x339018){return db[_0xd184('0x25')][_0xd184('0x26')]({'where':{'id':_0x31477a[_0xd184('0x27')]['id']}})['then'](handleEntityNotFound(_0x339018,null))[_0xd184('0x1f')](removeEntity(_0x339018,null))[_0xd184('0x28')](handleError(_0x339018,null));};
\ No newline at end of file
+var _0x261b=['zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','body','Condition','find','params','catch','html-pdf','eml-format','rimraf'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x261b,0x93));var _0xb261=function(_0x5b6797,_0x181c97){_0x5b6797=_0x5b6797-0x0;var _0x4623e2=_0x261b[_0x5b6797];return _0x4623e2;};'use strict';var pdf=require(_0xb261('0x0'));var emlformat=require(_0xb261('0x1'));var rimraf=require(_0xb261('0x2'));var zipdir=require(_0xb261('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb261('0x4'));var BPromise=require(_0xb261('0x5'));var Mustache=require(_0xb261('0x6'));var util=require(_0xb261('0x7'));var path=require(_0xb261('0x8'));var sox=require(_0xb261('0x9'));var csv=require(_0xb261('0xa'));var ejs=require(_0xb261('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb261('0xc'));var crypto=require(_0xb261('0xd'));var jsforce=require(_0xb261('0xe'));var deskjs=require(_0xb261('0xf'));var toCsv=require(_0xb261('0xa'));var querystring=require(_0xb261('0x10'));var Papa=require(_0xb261('0x11'));var Redis=require(_0xb261('0x12'));var authService=require(_0xb261('0x13'));var qs=require(_0xb261('0x14'));var as=require(_0xb261('0x15'));var hardwareService=require(_0xb261('0x16'));var logger=require(_0xb261('0x17'))(_0xb261('0x18'));var utils=require(_0xb261('0x19'));var config=require(_0xb261('0x1a'));var db=require(_0xb261('0x1b'))['db'];function respondWithStatusCode(_0x371480,_0x4d1188){_0x4d1188=_0x4d1188||0xcc;return function(_0xdac5cb){if(_0xdac5cb){return _0x371480[_0xb261('0x1c')](_0x4d1188);}return _0x371480[_0xb261('0x1d')](_0x4d1188)['end']();};}function respondWithResult(_0x5ce7de,_0x14201c){_0x14201c=_0x14201c||0xc8;return function(_0x5b4ad6){if(_0x5b4ad6){return _0x5ce7de[_0xb261('0x1d')](_0x14201c)[_0xb261('0x1e')](_0x5b4ad6);}};}function respondWithFilteredResult(_0x3ca2ba,_0x424cbb){return function(_0x25e22c){if(_0x25e22c){var _0x625a62=_0x25e22c[_0xb261('0x1f')],_0x3f2982=_0x424cbb[_0xb261('0x20')],_0x178171=_0x424cbb[_0xb261('0x20')]+_0x424cbb[_0xb261('0x21')],_0x41f1bd;if(_0x178171>=_0x625a62){_0x178171=_0x625a62;_0x41f1bd=0xc8;}else{_0x41f1bd=0xce;}_0x3ca2ba[_0xb261('0x1d')](_0x41f1bd);return _0x3ca2ba[_0xb261('0x22')](_0xb261('0x23'),_0x3f2982+'-'+_0x178171+'/'+_0x625a62)[_0xb261('0x1e')](_0x25e22c);}return null;};}function patchUpdates(_0x56662f){return function(_0x480edc){try{jsonpatch[_0xb261('0x24')](_0x480edc,_0x56662f,!![]);}catch(_0x461c4c){return BPromise[_0xb261('0x25')](_0x461c4c);}return _0x480edc['save']();};}function saveUpdates(_0x55187a,_0x132004){return function(_0x23c796){if(_0x23c796){return _0x23c796[_0xb261('0x26')](_0x55187a)[_0xb261('0x27')](function(_0x1bcb48){return _0x1bcb48;});}return null;};}function removeEntity(_0x211c53,_0x123c30){return function(_0x345d26){if(_0x345d26){return _0x345d26[_0xb261('0x28')]()[_0xb261('0x27')](function(){_0x211c53[_0xb261('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ef6c7,_0x26209c){return function(_0x4571cd){if(!_0x4571cd){_0x4ef6c7['sendStatus'](0x194);}return _0x4571cd;};}function handleError(_0x3b6f96,_0x6db997){_0x6db997=_0x6db997||0x1f4;return function(_0x1b0763){logger[_0xb261('0x29')](_0x1b0763[_0xb261('0x2a')]);if(_0x1b0763[_0xb261('0x2b')]){delete _0x1b0763['name'];}_0x3b6f96[_0xb261('0x1d')](_0x6db997)[_0xb261('0x2c')](_0x1b0763);};}exports[_0xb261('0x26')]=function(_0x59db90,_0x3cb91f){if(_0x59db90['body']['id']){delete _0x59db90[_0xb261('0x2d')]['id'];}return db[_0xb261('0x2e')][_0xb261('0x2f')]({'where':{'id':_0x59db90[_0xb261('0x30')]['id']}})[_0xb261('0x27')](handleEntityNotFound(_0x3cb91f,null))[_0xb261('0x27')](saveUpdates(_0x59db90['body'],null))[_0xb261('0x27')](respondWithResult(_0x3cb91f,null))[_0xb261('0x31')](handleError(_0x3cb91f,null));};exports['destroy']=function(_0x1fa05e,_0x4830a1){return db[_0xb261('0x2e')]['find']({'where':{'id':_0x1fa05e[_0xb261('0x30')]['id']}})['then'](handleEntityNotFound(_0x4830a1,null))['then'](removeEntity(_0x4830a1,null))[_0xb261('0x31')](handleError(_0x4830a1,null));};
\ No newline at end of file
index 3bd4402..9cb56fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c71=['exports','Condition','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x40d494,_0x247d47){var _0x18650e=function(_0x1fdf6d){while(--_0x1fdf6d){_0x40d494['push'](_0x40d494['shift']());}};_0x18650e(++_0x247d47);}(_0x0c71,0xf2));var _0x10c7=function(_0x474439,_0x301772){_0x474439=_0x474439-0x0;var _0x5667f3=_0x0c71[_0x474439];return _0x5667f3;};'use strict';var _=require(_0x10c7('0x0'));var util=require(_0x10c7('0x1'));var logger=require('../../config/logger')(_0x10c7('0x2'));var moment=require('moment');var BPromise=require(_0x10c7('0x3'));var rp=require(_0x10c7('0x4'));var fs=require('fs');var path=require(_0x10c7('0x5'));var rimraf=require(_0x10c7('0x6'));var config=require(_0x10c7('0x7'));var attributes=require('./condition.attributes');module[_0x10c7('0x8')]=function(_0xaa7056,_0x330f25){return _0xaa7056['define'](_0x10c7('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b16=['tools_conditions','lodash','api','moment','path','rimraf','../../config/environment','./condition.attributes','define','Condition'];(function(_0x3ec9c3,_0x19d270){var _0x287f3d=function(_0x158bc4){while(--_0x158bc4){_0x3ec9c3['push'](_0x3ec9c3['shift']());}};_0x287f3d(++_0x19d270);}(_0x0b16,0x1eb));var _0x60b1=function(_0xed715a,_0x2eb934){_0xed715a=_0xed715a-0x0;var _0x55ce9b=_0x0b16[_0xed715a];return _0x55ce9b;};'use strict';var _=require(_0x60b1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x60b1('0x1'));var moment=require(_0x60b1('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x60b1('0x3'));var rimraf=require(_0x60b1('0x4'));var config=require(_0x60b1('0x5'));var attributes=require(_0x60b1('0x6'));module['exports']=function(_0x2568e2,_0x9431ec){return _0x2568e2[_0x60b1('0x7')](_0x60b1('0x8'),attributes,{'tableName':_0x60b1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5a3e96a..cec478a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0565=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','util','moment','bluebird','ioredis'];(function(_0x139c0c,_0x5180ae){var _0x3f6866=function(_0x576d25){while(--_0x576d25){_0x139c0c['push'](_0x139c0c['shift']());}};_0x3f6866(++_0x5180ae);}(_0x0565,0x150));var _0x5056=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x0565[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require(_0x5056('0x0'));var moment=require(_0x5056('0x1'));var BPromise=require(_0x5056('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5056('0x3'));var db=require(_0x5056('0x4'))['db'];var utils=require(_0x5056('0x5'));var logger=require(_0x5056('0x6'))(_0x5056('0x7'));var config=require(_0x5056('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5056('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12b5bd,_0x2f193b,_0x410188){return new BPromise(function(_0x4dde2c,_0x4f92bc){return client[_0x5056('0xa')](_0x12b5bd,_0x410188)[_0x5056('0xb')](function(_0x421c0d){logger['info'](_0x5056('0xc'),_0x2f193b,'request\x20sent');logger[_0x5056('0xd')](_0x5056('0xe'),_0x2f193b,_0x5056('0xf'),JSON['stringify'](_0x421c0d));if(_0x421c0d['error']){if(_0x421c0d[_0x5056('0x10')][_0x5056('0x11')]===0x1f4){logger[_0x5056('0x10')]('Condition,\x20%s,\x20%s',_0x2f193b,_0x421c0d['error'][_0x5056('0x12')]);return _0x4f92bc(_0x421c0d[_0x5056('0x10')][_0x5056('0x12')]);}logger[_0x5056('0x10')]('Condition,\x20%s,\x20%s',_0x2f193b,_0x421c0d[_0x5056('0x10')]['message']);return _0x4dde2c(_0x421c0d['error'][_0x5056('0x12')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x2f193b,_0x5056('0xf'));_0x4dde2c(_0x421c0d['result'][_0x5056('0x12')]);}})[_0x5056('0x13')](function(_0x22fc94){logger[_0x5056('0x10')](_0x5056('0xc'),_0x2f193b,_0x22fc94);_0x4f92bc(_0x22fc94);});});}
\ No newline at end of file
+var _0xbc14=['../../config/environment','request','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Condition,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x26d12b,_0x40030c){var _0x8cc416=function(_0x10325f){while(--_0x10325f){_0x26d12b['push'](_0x26d12b['shift']());}};_0x8cc416(++_0x40030c);}(_0xbc14,0xaf));var _0x4bc1=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0xbc14[_0x4b1032];return _0x5a1d55;};'use strict';var _=require(_0x4bc1('0x0'));var util=require('util');var moment=require(_0x4bc1('0x1'));var BPromise=require(_0x4bc1('0x2'));var rs=require(_0x4bc1('0x3'));var fs=require('fs');var Redis=require(_0x4bc1('0x4'));var db=require(_0x4bc1('0x5'))['db'];var utils=require(_0x4bc1('0x6'));var logger=require(_0x4bc1('0x7'))(_0x4bc1('0x8'));var config=require(_0x4bc1('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x89a31e,_0x3f2d50,_0x15b961){return new BPromise(function(_0x5e257e,_0x32abad){return client[_0x4bc1('0xa')](_0x89a31e,_0x15b961)[_0x4bc1('0xb')](function(_0x50fb4d){logger[_0x4bc1('0xc')]('Condition,\x20%s,\x20%s',_0x3f2d50,_0x4bc1('0xd'));logger[_0x4bc1('0xe')](_0x4bc1('0xf'),_0x3f2d50,_0x4bc1('0xd'),JSON[_0x4bc1('0x10')](_0x50fb4d));if(_0x50fb4d[_0x4bc1('0x11')]){if(_0x50fb4d[_0x4bc1('0x11')][_0x4bc1('0x12')]===0x1f4){logger[_0x4bc1('0x11')]('Condition,\x20%s,\x20%s',_0x3f2d50,_0x50fb4d[_0x4bc1('0x11')]['message']);return _0x32abad(_0x50fb4d[_0x4bc1('0x11')][_0x4bc1('0x13')]);}logger['error'](_0x4bc1('0x14'),_0x3f2d50,_0x50fb4d[_0x4bc1('0x11')]['message']);return _0x5e257e(_0x50fb4d[_0x4bc1('0x11')][_0x4bc1('0x13')]);}else{logger[_0x4bc1('0xc')]('Condition,\x20%s,\x20%s',_0x3f2d50,_0x4bc1('0xd'));_0x5e257e(_0x50fb4d[_0x4bc1('0x15')]['message']);}})[_0x4bc1('0x16')](function(_0x41f122){logger[_0x4bc1('0x11')](_0x4bc1('0x14'),_0x3f2d50,_0x41f122);_0x32abad(_0x41f122);});});}
\ No newline at end of file
index 0d5bcb2..e9b9b9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79f2=['path','Router','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','exports','multer','util'];(function(_0x26c840,_0xd1af3d){var _0x18238c=function(_0x11c73c){while(--_0x11c73c){_0x26c840['push'](_0x26c840['shift']());}};_0x18238c(++_0xd1af3d);}(_0x79f2,0x102));var _0x279f=function(_0x417525,_0x4e32f1){_0x417525=_0x417525-0x0;var _0x35fb93=_0x79f2[_0x417525];return _0x35fb93;};'use strict';var multer=require(_0x279f('0x0'));var util=require(_0x279f('0x1'));var path=require(_0x279f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x279f('0x3')]();var auth=require(_0x279f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x279f('0x5'));var controller=require(_0x279f('0x6'));router[_0x279f('0x7')](_0x279f('0x8'),auth[_0x279f('0x9')](),controller[_0x279f('0xa')]);router[_0x279f('0xb')](_0x279f('0x8'),auth[_0x279f('0x9')](),controller['destroy']);module[_0x279f('0xc')]=router;
\ No newline at end of file
+var _0xc7b0=['util','path','connect-timeout','Router','../../components/auth/service','./condition.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer'];(function(_0x413993,_0xa1575b){var _0x4c698d=function(_0x2d1ef7){while(--_0x2d1ef7){_0x413993['push'](_0x413993['shift']());}};_0x4c698d(++_0xa1575b);}(_0xc7b0,0x103));var _0x0c7b=function(_0x3273ca,_0x1127fc){_0x3273ca=_0x3273ca-0x0;var _0x27c06b=_0xc7b0[_0x3273ca];return _0x27c06b;};'use strict';var multer=require(_0x0c7b('0x0'));var util=require(_0x0c7b('0x1'));var path=require(_0x0c7b('0x2'));var timeout=require(_0x0c7b('0x3'));var express=require('express');var router=express[_0x0c7b('0x4')]();var auth=require(_0x0c7b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0c7b('0x6'));router[_0x0c7b('0x7')](_0x0c7b('0x8'),auth[_0x0c7b('0x9')](),controller['update']);router[_0x0c7b('0xa')](_0x0c7b('0x8'),auth[_0x0c7b('0x9')](),controller[_0x0c7b('0xb')]);module[_0x0c7b('0xc')]=router;
\ No newline at end of file
index 3f39863..beb800a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0d9=['STRING','name','INTEGER','sequelize','exports'];(function(_0x1ec99f,_0x43f218){var _0x52dd54=function(_0x1718b6){while(--_0x1718b6){_0x1ec99f['push'](_0x1ec99f['shift']());}};_0x52dd54(++_0x43f218);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x21b3e4,_0x33cb68){_0x21b3e4=_0x21b3e4-0x0;var _0x58bb85=_0xb0d9[_0x21b3e4];return _0x58bb85;};'use strict';var Sequelize=require(_0x9b0d('0x0'));module[_0x9b0d('0x1')]={'name':{'type':Sequelize[_0x9b0d('0x2')],'allowNull':![],'unique':_0x9b0d('0x3')},'OrderBy':{'type':Sequelize[_0x9b0d('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x9b0d('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x207d=['name','sequelize','exports','STRING'];(function(_0xab6620,_0x5625ce){var _0x550039=function(_0x2b2d7c){while(--_0x2b2d7c){_0xab6620['push'](_0xab6620['shift']());}};_0x550039(++_0x5625ce);}(_0x207d,0x10d));var _0xd207=function(_0x249e59,_0x4679d8){_0x249e59=_0x249e59-0x0;var _0x5ad3c7=_0x207d[_0x249e59];return _0x5ad3c7;};'use strict';var Sequelize=require(_0xd207('0x0'));module[_0xd207('0x1')]={'name':{'type':Sequelize[_0xd207('0x2')],'allowNull':![],'unique':_0xd207('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xd207('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 8eb55ec..323581b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','ContactItemTypes','UserProfileResource','destroy','error','name','send','map','ContactItemType','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','order','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation'];(function(_0x34c460,_0x13ef3b){var _0x2b0a9f=function(_0x5b4442){while(--_0x5b4442){_0x34c460['push'](_0x34c460['shift']());}};_0x2b0a9f(++_0x13ef3b);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var as=require(_0x49c4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x11'))(_0x49c4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x49c4('0x13'))['db'];function respondWithStatusCode(_0x6d1b08,_0x5487cd){_0x5487cd=_0x5487cd||0xcc;return function(_0x7df3a9){if(_0x7df3a9){return _0x6d1b08[_0x49c4('0x14')](_0x5487cd);}return _0x6d1b08['status'](_0x5487cd)[_0x49c4('0x15')]();};}function respondWithResult(_0x280996,_0x21f15a){_0x21f15a=_0x21f15a||0xc8;return function(_0x2decee){if(_0x2decee){return _0x280996[_0x49c4('0x16')](_0x21f15a)[_0x49c4('0x17')](_0x2decee);}};}function respondWithFilteredResult(_0x75ea8,_0x3de397){return function(_0x58d177){if(_0x58d177){var _0x3acd06=_0x58d177[_0x49c4('0x18')],_0x141003=_0x3de397['offset'],_0x13a2db=_0x3de397[_0x49c4('0x19')]+_0x3de397[_0x49c4('0x1a')],_0x81e831;if(_0x13a2db>=_0x3acd06){_0x13a2db=_0x3acd06;_0x81e831=0xc8;}else{_0x81e831=0xce;}_0x75ea8['status'](_0x81e831);return _0x75ea8['set'](_0x49c4('0x1b'),_0x141003+'-'+_0x13a2db+'/'+_0x3acd06)[_0x49c4('0x17')](_0x58d177);}return null;};}function patchUpdates(_0x3addb2){return function(_0x59f29b){try{jsonpatch[_0x49c4('0x1c')](_0x59f29b,_0x3addb2,!![]);}catch(_0x50b151){return BPromise[_0x49c4('0x1d')](_0x50b151);}return _0x59f29b[_0x49c4('0x1e')]();};}function saveUpdates(_0xe31fcc,_0x291526){return function(_0x382040){if(_0x382040){return _0x382040[_0x49c4('0x1f')](_0xe31fcc)[_0x49c4('0x20')](function(_0x46e475){return _0x46e475;});}return null;};}function removeEntity(_0x2197d2,_0x578447){return function(_0x527126){if(_0x527126){return _0x527126['destroy']()[_0x49c4('0x20')](function(){var _0x4f0b62=_0x527126['get']({'plain':!![]});var _0x2263ae=_0x49c4('0x21');return db[_0x49c4('0x22')][_0x49c4('0x23')]({'where':{'type':_0x2263ae,'resourceId':_0x4f0b62['id']}})['then'](function(){return _0x527126;});})['then'](function(){_0x2197d2[_0x49c4('0x16')](0xcc)[_0x49c4('0x15')]();});}};}function handleEntityNotFound(_0x565423,_0x207358){return function(_0x43e014){if(!_0x43e014){_0x565423[_0x49c4('0x14')](0x194);}return _0x43e014;};}function handleError(_0xa7a826,_0x531d92){_0x531d92=_0x531d92||0x1f4;return function(_0x543ea2){logger[_0x49c4('0x24')](_0x543ea2['stack']);if(_0x543ea2[_0x49c4('0x25')]){delete _0x543ea2[_0x49c4('0x25')];}_0xa7a826[_0x49c4('0x16')](_0x531d92)[_0x49c4('0x26')](_0x543ea2);};}exports['index']=function(_0x889909,_0x2b2793){var _0x46e04d={},_0x4f28a2={},_0x6329b3={'count':0x0,'rows':[]};var _0x29f835=_[_0x49c4('0x27')](db[_0x49c4('0x28')][_0x49c4('0x29')],function(_0x2cbd88){return{'name':_0x2cbd88[_0x49c4('0x2a')],'type':_0x2cbd88['type']['key']};});_0x4f28a2['model']=_[_0x49c4('0x27')](_0x29f835,_0x49c4('0x25'));_0x4f28a2[_0x49c4('0x2b')]=_[_0x49c4('0x2c')](_0x889909[_0x49c4('0x2b')]);_0x4f28a2['filters']=_[_0x49c4('0x2d')](_0x4f28a2[_0x49c4('0x2e')],_0x4f28a2[_0x49c4('0x2b')]);_0x46e04d[_0x49c4('0x2f')]=_['intersection'](_0x4f28a2['model'],qs[_0x49c4('0x30')](_0x889909[_0x49c4('0x2b')][_0x49c4('0x30')]));_0x46e04d[_0x49c4('0x2f')]=_0x46e04d[_0x49c4('0x2f')]['length']?_0x46e04d[_0x49c4('0x2f')]:_0x4f28a2[_0x49c4('0x2e')];if(!_0x889909[_0x49c4('0x2b')]['hasOwnProperty']('nolimit')){_0x46e04d[_0x49c4('0x1a')]=qs[_0x49c4('0x1a')](_0x889909[_0x49c4('0x2b')][_0x49c4('0x1a')]);_0x46e04d[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x889909[_0x49c4('0x2b')][_0x49c4('0x19')]);}_0x46e04d[_0x49c4('0x31')]=qs['sort'](_0x889909[_0x49c4('0x2b')]['sort']);_0x46e04d[_0x49c4('0x32')]=qs[_0x49c4('0x33')](_[_0x49c4('0x34')](_0x889909[_0x49c4('0x2b')],_0x4f28a2['filters']),_0x29f835);if(_0x889909[_0x49c4('0x2b')][_0x49c4('0x35')]){_0x46e04d[_0x49c4('0x32')]=_['merge'](_0x46e04d[_0x49c4('0x32')],{'$or':_[_0x49c4('0x27')](_0x29f835,function(_0x178987){if(_0x178987[_0x49c4('0x36')]!==_0x49c4('0x37')){var _0x24c177={};_0x24c177[_0x178987[_0x49c4('0x25')]]={'$like':'%'+_0x889909[_0x49c4('0x2b')][_0x49c4('0x35')]+'%'};return _0x24c177;}})});}_0x46e04d=_[_0x49c4('0x38')]({},_0x46e04d,_0x889909[_0x49c4('0x39')]);var _0x4e0663={'where':_0x46e04d[_0x49c4('0x32')]};return db[_0x49c4('0x28')][_0x49c4('0x18')](_0x4e0663)[_0x49c4('0x20')](function(_0x41ad28){_0x6329b3[_0x49c4('0x18')]=_0x41ad28;if(_0x889909[_0x49c4('0x2b')][_0x49c4('0x3a')]){_0x46e04d[_0x49c4('0x3b')]=[{'all':!![]}];}return db[_0x49c4('0x28')][_0x49c4('0x3c')](_0x46e04d);})[_0x49c4('0x20')](function(_0x326142){_0x6329b3['rows']=_0x326142;return _0x6329b3;})[_0x49c4('0x20')](respondWithFilteredResult(_0x2b2793,_0x46e04d))['catch'](handleError(_0x2b2793,null));};exports[_0x49c4('0x3d')]=function(_0x4915bc,_0x28d4fb){var _0x1480da={'raw':!![],'where':{'id':_0x4915bc[_0x49c4('0x3e')]['id']}},_0x239327={};_0x239327['model']=_['keys'](db[_0x49c4('0x28')][_0x49c4('0x29')]);_0x239327[_0x49c4('0x2b')]=_[_0x49c4('0x2c')](_0x4915bc['query']);_0x239327[_0x49c4('0x33')]=_[_0x49c4('0x2d')](_0x239327[_0x49c4('0x2e')],_0x239327[_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2f')]=_[_0x49c4('0x2d')](_0x239327[_0x49c4('0x2e')],qs[_0x49c4('0x30')](_0x4915bc[_0x49c4('0x2b')]['fields']));_0x1480da[_0x49c4('0x2f')]=_0x1480da['attributes'][_0x49c4('0x3f')]?_0x1480da[_0x49c4('0x2f')]:_0x239327[_0x49c4('0x2e')];if(_0x4915bc[_0x49c4('0x2b')][_0x49c4('0x3a')]){_0x1480da['include']=[{'all':!![]}];}_0x1480da=_[_0x49c4('0x38')]({},_0x1480da,_0x4915bc[_0x49c4('0x39')]);return db[_0x49c4('0x28')][_0x49c4('0x40')](_0x1480da)[_0x49c4('0x20')](handleEntityNotFound(_0x28d4fb,null))[_0x49c4('0x20')](respondWithResult(_0x28d4fb,null))[_0x49c4('0x41')](handleError(_0x28d4fb,null));};exports['create']=function(_0x3bac1b,_0x5cfff9){return db[_0x49c4('0x28')][_0x49c4('0x42')](_0x3bac1b[_0x49c4('0x43')],{})[_0x49c4('0x20')](function(_0x2d8087){var _0x30bea5=_0x3bac1b[_0x49c4('0x44')]['get']({'plain':!![]});if(!_0x30bea5)throw new Error(_0x49c4('0x45'));if(_0x30bea5[_0x49c4('0x46')]==='user'){var _0x1e1ac4=_0x2d8087[_0x49c4('0x47')]({'plain':!![]});var _0xfbe179=_0x49c4('0x21');return db['UserProfileSection']['find']({'where':{'name':_0xfbe179,'userProfileId':_0x30bea5[_0x49c4('0x48')]},'raw':!![]})['then'](function(_0x4597c3){if(_0x4597c3&&_0x4597c3[_0x49c4('0x49')]===0x0){return db[_0x49c4('0x22')][_0x49c4('0x42')]({'name':_0x1e1ac4[_0x49c4('0x25')],'resourceId':_0x1e1ac4['id'],'type':_0x4597c3[_0x49c4('0x25')],'sectionId':_0x4597c3['id']},{})[_0x49c4('0x20')](function(){return _0x2d8087;});}else{return _0x2d8087;}})['catch'](function(_0x1f26c2){logger[_0x49c4('0x24')](_0x49c4('0x4a'),_0x1f26c2);throw _0x1f26c2;});}return _0x2d8087;})[_0x49c4('0x20')](respondWithResult(_0x5cfff9,0xc9))[_0x49c4('0x41')](handleError(_0x5cfff9,null));};exports[_0x49c4('0x1f')]=function(_0x156748,_0x25d174){if(_0x156748[_0x49c4('0x43')]['id']){delete _0x156748[_0x49c4('0x43')]['id'];}return db['ContactItemType']['find']({'where':{'id':_0x156748[_0x49c4('0x3e')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x25d174,null))['then'](saveUpdates(_0x156748['body'],null))[_0x49c4('0x20')](respondWithResult(_0x25d174,null))['catch'](handleError(_0x25d174,null));};exports['destroy']=function(_0x3208c2,_0x4081a5){return db[_0x49c4('0x28')][_0x49c4('0x40')]({'where':{'id':_0x3208c2[_0x49c4('0x3e')]['id']}})[_0x49c4('0x20')](handleEntityNotFound(_0x4081a5,null))[_0x49c4('0x20')](removeEntity(_0x4081a5,null))['catch'](handleError(_0x4081a5,null));};
\ No newline at end of file
+var _0xedd9=['include','rows','show','params','intersection','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','name','send','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll'];(function(_0x3c711d,_0x219174){var _0x448b20=function(_0x29c136){while(--_0x29c136){_0x3c711d['push'](_0x3c711d['shift']());}};_0x448b20(++_0x219174);}(_0xedd9,0xfc));var _0x9edd=function(_0x49c1e9,_0x1ea9d5){_0x49c1e9=_0x49c1e9-0x0;var _0x23a335=_0xedd9[_0x49c1e9];return _0x23a335;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0xa'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var db=require(_0x9edd('0x16'))['db'];function respondWithStatusCode(_0x25e64c,_0xfd544a){_0xfd544a=_0xfd544a||0xcc;return function(_0x287ddd){if(_0x287ddd){return _0x25e64c[_0x9edd('0x17')](_0xfd544a);}return _0x25e64c[_0x9edd('0x18')](_0xfd544a)[_0x9edd('0x19')]();};}function respondWithResult(_0x47eb64,_0x176bfa){_0x176bfa=_0x176bfa||0xc8;return function(_0x44fc7c){if(_0x44fc7c){return _0x47eb64[_0x9edd('0x18')](_0x176bfa)[_0x9edd('0x1a')](_0x44fc7c);}};}function respondWithFilteredResult(_0x13b6b6,_0x338f3c){return function(_0x1042aa){if(_0x1042aa){var _0x75a4ab=_0x1042aa[_0x9edd('0x1b')],_0x4ea60f=_0x338f3c['offset'],_0x5f5bf4=_0x338f3c[_0x9edd('0x1c')]+_0x338f3c[_0x9edd('0x1d')],_0x448996;if(_0x5f5bf4>=_0x75a4ab){_0x5f5bf4=_0x75a4ab;_0x448996=0xc8;}else{_0x448996=0xce;}_0x13b6b6[_0x9edd('0x18')](_0x448996);return _0x13b6b6['set'](_0x9edd('0x1e'),_0x4ea60f+'-'+_0x5f5bf4+'/'+_0x75a4ab)['json'](_0x1042aa);}return null;};}function patchUpdates(_0x2cdcef){return function(_0x1083e4){try{jsonpatch['apply'](_0x1083e4,_0x2cdcef,!![]);}catch(_0x498977){return BPromise[_0x9edd('0x1f')](_0x498977);}return _0x1083e4['save']();};}function saveUpdates(_0x27a95a,_0x54a03f){return function(_0x535f37){if(_0x535f37){return _0x535f37[_0x9edd('0x20')](_0x27a95a)[_0x9edd('0x21')](function(_0x4fb7bf){return _0x4fb7bf;});}return null;};}function removeEntity(_0x5823bc,_0x341d67){return function(_0x186186){if(_0x186186){return _0x186186[_0x9edd('0x22')]()['then'](function(){var _0x3741c8=_0x186186[_0x9edd('0x23')]({'plain':!![]});var _0x44a6c1=_0x9edd('0x24');return db[_0x9edd('0x25')]['destroy']({'where':{'type':_0x44a6c1,'resourceId':_0x3741c8['id']}})[_0x9edd('0x21')](function(){return _0x186186;});})[_0x9edd('0x21')](function(){_0x5823bc[_0x9edd('0x18')](0xcc)[_0x9edd('0x19')]();});}};}function handleEntityNotFound(_0x310a4d,_0x4d507f){return function(_0x4b3d1b){if(!_0x4b3d1b){_0x310a4d[_0x9edd('0x17')](0x194);}return _0x4b3d1b;};}function handleError(_0xfeca7b,_0x8d67aa){_0x8d67aa=_0x8d67aa||0x1f4;return function(_0x25e135){logger[_0x9edd('0x26')](_0x25e135['stack']);if(_0x25e135['name']){delete _0x25e135[_0x9edd('0x27')];}_0xfeca7b[_0x9edd('0x18')](_0x8d67aa)[_0x9edd('0x28')](_0x25e135);};}exports['index']=function(_0x238b22,_0x28cfae){var _0x2ae8dd={},_0x41af53={},_0x5eccfb={'count':0x0,'rows':[]};var _0x2155a1=_[_0x9edd('0x29')](db[_0x9edd('0x2a')][_0x9edd('0x2b')],function(_0xbbf08f){return{'name':_0xbbf08f[_0x9edd('0x2c')],'type':_0xbbf08f[_0x9edd('0x2d')][_0x9edd('0x2e')]};});_0x41af53[_0x9edd('0x2f')]=_[_0x9edd('0x29')](_0x2155a1,_0x9edd('0x27'));_0x41af53[_0x9edd('0x30')]=_[_0x9edd('0x31')](_0x238b22[_0x9edd('0x30')]);_0x41af53[_0x9edd('0x32')]=_['intersection'](_0x41af53[_0x9edd('0x2f')],_0x41af53[_0x9edd('0x30')]);_0x2ae8dd[_0x9edd('0x33')]=_['intersection'](_0x41af53[_0x9edd('0x2f')],qs[_0x9edd('0x34')](_0x238b22[_0x9edd('0x30')][_0x9edd('0x34')]));_0x2ae8dd[_0x9edd('0x33')]=_0x2ae8dd[_0x9edd('0x33')][_0x9edd('0x35')]?_0x2ae8dd[_0x9edd('0x33')]:_0x41af53[_0x9edd('0x2f')];if(!_0x238b22[_0x9edd('0x30')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x2ae8dd[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x238b22['query'][_0x9edd('0x1d')]);_0x2ae8dd['offset']=qs[_0x9edd('0x1c')](_0x238b22[_0x9edd('0x30')][_0x9edd('0x1c')]);}_0x2ae8dd[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x238b22['query'][_0x9edd('0x39')]);_0x2ae8dd[_0x9edd('0x3a')]=qs[_0x9edd('0x32')](_[_0x9edd('0x3b')](_0x238b22[_0x9edd('0x30')],_0x41af53[_0x9edd('0x32')]),_0x2155a1);if(_0x238b22[_0x9edd('0x30')][_0x9edd('0x3c')]){_0x2ae8dd[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x2ae8dd['where'],{'$or':_[_0x9edd('0x29')](_0x2155a1,function(_0x56a228){if(_0x56a228[_0x9edd('0x2d')]!=='VIRTUAL'){var _0x30883e={};_0x30883e[_0x56a228[_0x9edd('0x27')]]={'$like':'%'+_0x238b22[_0x9edd('0x30')]['filter']+'%'};return _0x30883e;}})});}_0x2ae8dd=_[_0x9edd('0x3d')]({},_0x2ae8dd,_0x238b22[_0x9edd('0x3e')]);var _0x2f8f61={'where':_0x2ae8dd['where']};return db[_0x9edd('0x2a')]['count'](_0x2f8f61)[_0x9edd('0x21')](function(_0xfbc492){_0x5eccfb['count']=_0xfbc492;if(_0x238b22[_0x9edd('0x30')][_0x9edd('0x3f')]){_0x2ae8dd[_0x9edd('0x40')]=[{'all':!![]}];}return db[_0x9edd('0x2a')]['findAll'](_0x2ae8dd);})[_0x9edd('0x21')](function(_0x5bbdf8){_0x5eccfb[_0x9edd('0x41')]=_0x5bbdf8;return _0x5eccfb;})[_0x9edd('0x21')](respondWithFilteredResult(_0x28cfae,_0x2ae8dd))['catch'](handleError(_0x28cfae,null));};exports[_0x9edd('0x42')]=function(_0x49a128,_0x548299){var _0x369b69={'raw':!![],'where':{'id':_0x49a128[_0x9edd('0x43')]['id']}},_0x9cab86={};_0x9cab86[_0x9edd('0x2f')]=_[_0x9edd('0x31')](db[_0x9edd('0x2a')][_0x9edd('0x2b')]);_0x9cab86[_0x9edd('0x30')]=_[_0x9edd('0x31')](_0x49a128[_0x9edd('0x30')]);_0x9cab86[_0x9edd('0x32')]=_[_0x9edd('0x44')](_0x9cab86[_0x9edd('0x2f')],_0x9cab86[_0x9edd('0x30')]);_0x369b69[_0x9edd('0x33')]=_['intersection'](_0x9cab86[_0x9edd('0x2f')],qs[_0x9edd('0x34')](_0x49a128[_0x9edd('0x30')][_0x9edd('0x34')]));_0x369b69[_0x9edd('0x33')]=_0x369b69[_0x9edd('0x33')][_0x9edd('0x35')]?_0x369b69['attributes']:_0x9cab86['model'];if(_0x49a128['query'][_0x9edd('0x3f')]){_0x369b69['include']=[{'all':!![]}];}_0x369b69=_[_0x9edd('0x3d')]({},_0x369b69,_0x49a128[_0x9edd('0x3e')]);return db[_0x9edd('0x2a')][_0x9edd('0x45')](_0x369b69)[_0x9edd('0x21')](handleEntityNotFound(_0x548299,null))['then'](respondWithResult(_0x548299,null))[_0x9edd('0x46')](handleError(_0x548299,null));};exports[_0x9edd('0x47')]=function(_0x40e33d,_0x4a89ae){return db[_0x9edd('0x2a')][_0x9edd('0x47')](_0x40e33d[_0x9edd('0x48')],{})[_0x9edd('0x21')](function(_0x1d78c4){var _0x35bdec=_0x40e33d['user'][_0x9edd('0x23')]({'plain':!![]});if(!_0x35bdec)throw new Error(_0x9edd('0x49'));if(_0x35bdec['role']===_0x9edd('0x4a')){var _0x8d8701=_0x1d78c4['get']({'plain':!![]});var _0x2bd089=_0x9edd('0x24');return db[_0x9edd('0x4b')]['find']({'where':{'name':_0x2bd089,'userProfileId':_0x35bdec[_0x9edd('0x4c')]},'raw':!![]})[_0x9edd('0x21')](function(_0x317a60){if(_0x317a60&&_0x317a60[_0x9edd('0x4d')]===0x0){return db['UserProfileResource'][_0x9edd('0x47')]({'name':_0x8d8701[_0x9edd('0x27')],'resourceId':_0x8d8701['id'],'type':_0x317a60[_0x9edd('0x27')],'sectionId':_0x317a60['id']},{})['then'](function(){return _0x1d78c4;});}else{return _0x1d78c4;}})[_0x9edd('0x46')](function(_0x21f6ce){logger['error'](_0x9edd('0x4e'),_0x21f6ce);throw _0x21f6ce;});}return _0x1d78c4;})['then'](respondWithResult(_0x4a89ae,0xc9))[_0x9edd('0x46')](handleError(_0x4a89ae,null));};exports[_0x9edd('0x20')]=function(_0x24245f,_0x3fcdf5){if(_0x24245f[_0x9edd('0x48')]['id']){delete _0x24245f[_0x9edd('0x48')]['id'];}return db[_0x9edd('0x2a')][_0x9edd('0x45')]({'where':{'id':_0x24245f[_0x9edd('0x43')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x3fcdf5,null))[_0x9edd('0x21')](saveUpdates(_0x24245f['body'],null))[_0x9edd('0x21')](respondWithResult(_0x3fcdf5,null))[_0x9edd('0x46')](handleError(_0x3fcdf5,null));};exports[_0x9edd('0x22')]=function(_0x58fe29,_0xe96d6a){return db['ContactItemType']['find']({'where':{'id':_0x58fe29['params']['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0xe96d6a,null))[_0x9edd('0x21')](removeEntity(_0xe96d6a,null))[_0x9edd('0x46')](handleError(_0xe96d6a,null));};
\ No newline at end of file
index 62211af..88db98f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0024=['util','api','bluebird','rimraf','../../config/environment','define','ContactItemType'];(function(_0x4709c8,_0x3384ca){var _0x478cdd=function(_0x5193ce){while(--_0x5193ce){_0x4709c8['push'](_0x4709c8['shift']());}};_0x478cdd(++_0x3384ca);}(_0x0024,0xa8));var _0x4002=function(_0x308817,_0x269bbb){_0x308817=_0x308817-0x0;var _0x2992b8=_0x0024[_0x308817];return _0x2992b8;};'use strict';var _=require('lodash');var util=require(_0x4002('0x0'));var logger=require('../../config/logger')(_0x4002('0x1'));var moment=require('moment');var BPromise=require(_0x4002('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4002('0x3'));var config=require(_0x4002('0x4'));var attributes=require('./contactItemType.attributes');module['exports']=function(_0x36c011,_0x144717){return _0x36c011[_0x4002('0x5')](_0x4002('0x6'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6132=['ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./contactItemType.attributes','define'];(function(_0x351b46,_0x26b265){var _0x1515df=function(_0x22896a){while(--_0x22896a){_0x351b46['push'](_0x351b46['shift']());}};_0x1515df(++_0x26b265);}(_0x6132,0x13a));var _0x2613=function(_0x5a2e04,_0x572a30){_0x5a2e04=_0x5a2e04-0x0;var _0x29887c=_0x6132[_0x5a2e04];return _0x29887c;};'use strict';var _=require(_0x2613('0x0'));var util=require(_0x2613('0x1'));var logger=require(_0x2613('0x2'))(_0x2613('0x3'));var moment=require('moment');var BPromise=require(_0x2613('0x4'));var rp=require(_0x2613('0x5'));var fs=require('fs');var path=require(_0x2613('0x6'));var rimraf=require(_0x2613('0x7'));var config=require('../../config/environment');var attributes=require(_0x2613('0x8'));module['exports']=function(_0x59240d,_0x30cac4){return _0x59240d[_0x2613('0x9')](_0x2613('0xa'),attributes,{'tableName':_0x2613('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 79c02da..e8e18b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8128=['message','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x17b8a9,_0x3bbf58){var _0x4add80=function(_0x683126){while(--_0x683126){_0x17b8a9['push'](_0x17b8a9['shift']());}};_0x4add80(++_0x3bbf58);}(_0x8128,0x1b1));var _0x8812=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x8128[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x8812('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8812('0x1'));var rs=require(_0x8812('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8812('0x3'));var logger=require(_0x8812('0x4'))(_0x8812('0x5'));var config=require('../../config/environment');var jayson=require(_0x8812('0x6'));var client=jayson[_0x8812('0x7')][_0x8812('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16bafa,_0x480d1f,_0xfdd696){return new BPromise(function(_0x3d030b,_0x4e5012){return client['request'](_0x16bafa,_0xfdd696)['then'](function(_0x2bc882){logger[_0x8812('0x9')](_0x8812('0xa'),_0x480d1f,_0x8812('0xb'));logger[_0x8812('0xc')](_0x8812('0xd'),_0x480d1f,_0x8812('0xb'),JSON[_0x8812('0xe')](_0x2bc882));if(_0x2bc882[_0x8812('0xf')]){if(_0x2bc882['error'][_0x8812('0x10')]===0x1f4){logger[_0x8812('0xf')](_0x8812('0xa'),_0x480d1f,_0x2bc882[_0x8812('0xf')][_0x8812('0x11')]);return _0x4e5012(_0x2bc882[_0x8812('0xf')]['message']);}logger[_0x8812('0xf')](_0x8812('0xa'),_0x480d1f,_0x2bc882[_0x8812('0xf')]['message']);return _0x3d030b(_0x2bc882['error'][_0x8812('0x11')]);}else{logger[_0x8812('0x9')]('ContactItemType,\x20%s,\x20%s',_0x480d1f,'request\x20sent');_0x3d030b(_0x2bc882['result']['message']);}})['catch'](function(_0xa2a8cc){logger['error'](_0x8812('0xa'),_0x480d1f,_0xa2a8cc);_0x4e5012(_0xa2a8cc);});});}
\ No newline at end of file
+var _0x9d02=['rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','code','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x9d02,0x118));var _0x29d0=function(_0x2cffdc,_0x8e98c2){_0x2cffdc=_0x2cffdc-0x0;var _0xecee38=_0x9d02[_0x2cffdc];return _0xecee38;};'use strict';var _=require(_0x29d0('0x0'));var util=require('util');var moment=require(_0x29d0('0x1'));var BPromise=require('bluebird');var rs=require(_0x29d0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29d0('0x3'))['db'];var utils=require(_0x29d0('0x4'));var logger=require('../../config/logger')(_0x29d0('0x5'));var config=require(_0x29d0('0x6'));var jayson=require(_0x29d0('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e35b3,_0x351d26,_0x18a02c){return new BPromise(function(_0x4a4019,_0x402fa6){return client[_0x29d0('0x8')](_0x5e35b3,_0x18a02c)['then'](function(_0x4bc0f9){logger[_0x29d0('0x9')]('ContactItemType,\x20%s,\x20%s',_0x351d26,_0x29d0('0xa'));logger[_0x29d0('0xb')](_0x29d0('0xc'),_0x351d26,_0x29d0('0xa'),JSON['stringify'](_0x4bc0f9));if(_0x4bc0f9['error']){if(_0x4bc0f9[_0x29d0('0xd')][_0x29d0('0xe')]===0x1f4){logger[_0x29d0('0xd')](_0x29d0('0xf'),_0x351d26,_0x4bc0f9[_0x29d0('0xd')][_0x29d0('0x10')]);return _0x402fa6(_0x4bc0f9[_0x29d0('0xd')][_0x29d0('0x10')]);}logger[_0x29d0('0xd')]('ContactItemType,\x20%s,\x20%s',_0x351d26,_0x4bc0f9[_0x29d0('0xd')][_0x29d0('0x10')]);return _0x4a4019(_0x4bc0f9[_0x29d0('0xd')][_0x29d0('0x10')]);}else{logger[_0x29d0('0x9')](_0x29d0('0xf'),_0x351d26,'request\x20sent');_0x4a4019(_0x4bc0f9[_0x29d0('0x11')][_0x29d0('0x10')]);}})[_0x29d0('0x12')](function(_0x49e919){logger[_0x29d0('0xd')](_0x29d0('0xf'),_0x351d26,_0x49e919);_0x402fa6(_0x49e919);});});}
\ No newline at end of file
index a882106..44b80d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae99=['../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','index','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0xfad925,_0x96bd76){var _0x2e6967=function(_0x2e99d5){while(--_0x2e99d5){_0xfad925['push'](_0xfad925['shift']());}};_0x2e6967(++_0x96bd76);}(_0xae99,0x82));var _0x9ae9=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xae99[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x9ae9('0x0'));var util=require(_0x9ae9('0x1'));var path=require(_0x9ae9('0x2'));var timeout=require(_0x9ae9('0x3'));var express=require(_0x9ae9('0x4'));var router=express['Router']();var auth=require(_0x9ae9('0x5'));var interaction=require(_0x9ae9('0x6'));var config=require('../../config/environment');var controller=require(_0x9ae9('0x7'));router[_0x9ae9('0x8')]('/',auth[_0x9ae9('0x9')](),controller[_0x9ae9('0xa')]);router[_0x9ae9('0x8')](_0x9ae9('0xb'),auth[_0x9ae9('0x9')](),controller[_0x9ae9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9ae9('0xb'),auth[_0x9ae9('0x9')](),controller[_0x9ae9('0xd')]);router[_0x9ae9('0xe')](_0x9ae9('0xb'),auth['isAuthenticated'](),controller[_0x9ae9('0xf')]);module[_0x9ae9('0x10')]=router;
\ No newline at end of file
+var _0xffba=['delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','index','post','create','/:id','isAuthenticated'];(function(_0x11c5b9,_0x52a714){var _0x4c6fd4=function(_0x5d3cef){while(--_0x5d3cef){_0x11c5b9['push'](_0x11c5b9['shift']());}};_0x4c6fd4(++_0x52a714);}(_0xffba,0x182));var _0xaffb=function(_0xbda38b,_0x316f0c){_0xbda38b=_0xbda38b-0x0;var _0xb0a244=_0xffba[_0xbda38b];return _0xb0a244;};'use strict';var multer=require(_0xaffb('0x0'));var util=require('util');var path=require(_0xaffb('0x1'));var timeout=require(_0xaffb('0x2'));var express=require(_0xaffb('0x3'));var router=express['Router']();var auth=require(_0xaffb('0x4'));var interaction=require(_0xaffb('0x5'));var config=require(_0xaffb('0x6'));var controller=require(_0xaffb('0x7'));router[_0xaffb('0x8')]('/',auth['isAuthenticated'](),controller[_0xaffb('0x9')]);router[_0xaffb('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xaffb('0xa')]('/',auth['isAuthenticated'](),controller[_0xaffb('0xb')]);router['put'](_0xaffb('0xc'),auth[_0xaffb('0xd')](),controller['update']);router[_0xaffb('0xe')](_0xaffb('0xc'),auth[_0xaffb('0xd')](),controller[_0xaffb('0xf')]);module['exports']=router;
\ No newline at end of file
index b4e5632..58cd27e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa3f=['exports','STRING','name','sequelize'];(function(_0x9c5d49,_0x248bcc){var _0x289098=function(_0x1fbcf8){while(--_0x1fbcf8){_0x9c5d49['push'](_0x9c5d49['shift']());}};_0x289098(++_0x248bcc);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x3a8e0e,_0x4f120d){_0x3a8e0e=_0x3a8e0e-0x0;var _0xf75a3b=_0xaa3f[_0x3a8e0e];return _0xf75a3b;};'use strict';var Sequelize=require(_0xfaa3('0x0'));module[_0xfaa3('0x1')]={'name':{'type':Sequelize[_0xfaa3('0x2')],'allowNull':![],'unique':_0xfaa3('0x3')},'description':{'type':Sequelize[_0xfaa3('0x2')]}};
\ No newline at end of file
+var _0x20fe=['exports','name','sequelize'];(function(_0x3d7194,_0x9a532e){var _0x2d0081=function(_0x2d7ffb){while(--_0x2d7ffb){_0x3d7194['push'](_0x3d7194['shift']());}};_0x2d0081(++_0x9a532e);}(_0x20fe,0xb3));var _0xe20f=function(_0x5b0fd7,_0x5de27a){_0x5b0fd7=_0x5b0fd7-0x0;var _0x395b2e=_0x20fe[_0x5b0fd7];return _0x395b2e;};'use strict';var Sequelize=require(_0xe20f('0x0'));module[_0xe20f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe20f('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6ab8024..2b44f1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f2c=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','Dashboard','includeAll','findAll','catch','show','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','updatedAt','createdAt','CustomDashboards','UserProfileSection','autoAssociation','params','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','getItems','order','html-pdf','eml-format'];(function(_0x15e02c,_0x37db6a){var _0x4cdb3f=function(_0x5148a5){while(--_0x5148a5){_0x15e02c['push'](_0x15e02c['shift']());}};_0x4cdb3f(++_0x37db6a);}(_0x9f2c,0xe8));var _0xc9f2=function(_0x5b2809,_0x48b226){_0x5b2809=_0x5b2809-0x0;var _0x572dee=_0x9f2c[_0x5b2809];return _0x572dee;};'use strict';var pdf=require(_0xc9f2('0x0'));var emlformat=require(_0xc9f2('0x1'));var rimraf=require(_0xc9f2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9f2('0x3'));var rp=require(_0xc9f2('0x4'));var moment=require(_0xc9f2('0x5'));var BPromise=require(_0xc9f2('0x6'));var Mustache=require(_0xc9f2('0x7'));var util=require(_0xc9f2('0x8'));var path=require(_0xc9f2('0x9'));var sox=require(_0xc9f2('0xa'));var csv=require(_0xc9f2('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc9f2('0xc'));var squel=require(_0xc9f2('0xd'));var crypto=require(_0xc9f2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc9f2('0xf'));var toCsv=require(_0xc9f2('0xb'));var querystring=require(_0xc9f2('0x10'));var Papa=require(_0xc9f2('0x11'));var Redis=require(_0xc9f2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc9f2('0x13'));var as=require(_0xc9f2('0x14'));var hardwareService=require(_0xc9f2('0x15'));var logger=require(_0xc9f2('0x16'))('api');var utils=require(_0xc9f2('0x17'));var config=require(_0xc9f2('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xc9f2('0x19')](config[_0xc9f2('0x1a')],{'host':_0xc9f2('0x1b'),'port':0x18eb});var socket=require(_0xc9f2('0x1c'))(new Redis(config[_0xc9f2('0x1a')]));require(_0xc9f2('0x1d'))[_0xc9f2('0x1e')](socket);function respondWithStatusCode(_0x1c3db3,_0xe30a68){_0xe30a68=_0xe30a68||0xcc;return function(_0x125921){if(_0x125921){return _0x1c3db3['sendStatus'](_0xe30a68);}return _0x1c3db3['status'](_0xe30a68)[_0xc9f2('0x1f')]();};}function respondWithResult(_0x340198,_0x34ecdc){_0x34ecdc=_0x34ecdc||0xc8;return function(_0x6917b5){if(_0x6917b5){return _0x340198[_0xc9f2('0x20')](_0x34ecdc)[_0xc9f2('0x21')](_0x6917b5);}};}function respondWithFilteredResult(_0x83f72a,_0x139257){return function(_0x2c5396){if(_0x2c5396){var _0x5dab1c=_0x2c5396[_0xc9f2('0x22')],_0x19f10d=_0x139257[_0xc9f2('0x23')],_0x83f2d1=_0x139257[_0xc9f2('0x23')]+_0x139257[_0xc9f2('0x24')],_0x1caef6;if(_0x83f2d1>=_0x5dab1c){_0x83f2d1=_0x5dab1c;_0x1caef6=0xc8;}else{_0x1caef6=0xce;}_0x83f72a['status'](_0x1caef6);return _0x83f72a[_0xc9f2('0x25')](_0xc9f2('0x26'),_0x19f10d+'-'+_0x83f2d1+'/'+_0x5dab1c)[_0xc9f2('0x21')](_0x2c5396);}return null;};}function patchUpdates(_0x23930a){return function(_0x5b3cfc){try{jsonpatch[_0xc9f2('0x27')](_0x5b3cfc,_0x23930a,!![]);}catch(_0x2f75f6){return BPromise['reject'](_0x2f75f6);}return _0x5b3cfc[_0xc9f2('0x28')]();};}function saveUpdates(_0x259357,_0x1749f4){return function(_0x19a4e1){if(_0x19a4e1){return _0x19a4e1[_0xc9f2('0x29')](_0x259357)[_0xc9f2('0x2a')](function(_0x1b1bdc){return _0x1b1bdc;});}return null;};}function removeEntity(_0x406190,_0x4629eb){return function(_0x31e5f9){if(_0x31e5f9){return _0x31e5f9[_0xc9f2('0x2b')]()[_0xc9f2('0x2a')](function(){var _0x59042f=_0x31e5f9[_0xc9f2('0x2c')]({'plain':!![]});var _0x8782df='CustomDashboards';return db[_0xc9f2('0x2d')][_0xc9f2('0x2b')]({'where':{'type':_0x8782df,'resourceId':_0x59042f['id']}})[_0xc9f2('0x2a')](function(){return _0x31e5f9;});})[_0xc9f2('0x2a')](function(){_0x406190[_0xc9f2('0x20')](0xcc)[_0xc9f2('0x1f')]();});}};}function handleEntityNotFound(_0x2e0f24,_0xf0f0c8){return function(_0x3b7691){if(!_0x3b7691){_0x2e0f24[_0xc9f2('0x2e')](0x194);}return _0x3b7691;};}function handleError(_0x4203a7,_0x1f6605){_0x1f6605=_0x1f6605||0x1f4;return function(_0x2c792d){logger[_0xc9f2('0x2f')](_0x2c792d[_0xc9f2('0x30')]);if(_0x2c792d['name']){delete _0x2c792d[_0xc9f2('0x31')];}_0x4203a7[_0xc9f2('0x20')](_0x1f6605)[_0xc9f2('0x32')](_0x2c792d);};}exports[_0xc9f2('0x33')]=function(_0x187ca3,_0x5c2cb2){var _0x17b1ec={},_0x2f35a9={},_0x50d291={'count':0x0,'rows':[]};var _0x59821c=_['map'](db['Dashboard']['rawAttributes'],function(_0xa7f3a5){return{'name':_0xa7f3a5[_0xc9f2('0x34')],'type':_0xa7f3a5[_0xc9f2('0x35')][_0xc9f2('0x36')]};});_0x2f35a9[_0xc9f2('0x37')]=_['map'](_0x59821c,_0xc9f2('0x31'));_0x2f35a9[_0xc9f2('0x38')]=_[_0xc9f2('0x39')](_0x187ca3[_0xc9f2('0x38')]);_0x2f35a9['filters']=_[_0xc9f2('0x3a')](_0x2f35a9['model'],_0x2f35a9[_0xc9f2('0x38')]);_0x17b1ec['attributes']=_[_0xc9f2('0x3a')](_0x2f35a9[_0xc9f2('0x37')],qs[_0xc9f2('0x3b')](_0x187ca3['query'][_0xc9f2('0x3b')]));_0x17b1ec[_0xc9f2('0x3c')]=_0x17b1ec[_0xc9f2('0x3c')]['length']?_0x17b1ec[_0xc9f2('0x3c')]:_0x2f35a9[_0xc9f2('0x37')];if(!_0x187ca3[_0xc9f2('0x38')][_0xc9f2('0x3d')](_0xc9f2('0x3e'))){_0x17b1ec[_0xc9f2('0x24')]=qs[_0xc9f2('0x24')](_0x187ca3[_0xc9f2('0x38')]['limit']);_0x17b1ec[_0xc9f2('0x23')]=qs['offset'](_0x187ca3[_0xc9f2('0x38')][_0xc9f2('0x23')]);}_0x17b1ec['order']=qs[_0xc9f2('0x3f')](_0x187ca3[_0xc9f2('0x38')][_0xc9f2('0x3f')]);_0x17b1ec[_0xc9f2('0x40')]=qs[_0xc9f2('0x41')](_[_0xc9f2('0x42')](_0x187ca3[_0xc9f2('0x38')],_0x2f35a9[_0xc9f2('0x41')]),_0x59821c);if(_0x187ca3[_0xc9f2('0x38')][_0xc9f2('0x43')]){_0x17b1ec[_0xc9f2('0x40')]=_[_0xc9f2('0x44')](_0x17b1ec['where'],{'$or':_[_0xc9f2('0x45')](_0x59821c,function(_0x2c52c4){if(_0x2c52c4[_0xc9f2('0x35')]!==_0xc9f2('0x46')){var _0x59913a={};_0x59913a[_0x2c52c4[_0xc9f2('0x31')]]={'$like':'%'+_0x187ca3[_0xc9f2('0x38')][_0xc9f2('0x43')]+'%'};return _0x59913a;}})});}_0x17b1ec=_[_0xc9f2('0x44')]({},_0x17b1ec,_0x187ca3[_0xc9f2('0x47')]);var _0x57323e={'where':_0x17b1ec[_0xc9f2('0x40')]};return db[_0xc9f2('0x48')][_0xc9f2('0x22')](_0x57323e)[_0xc9f2('0x2a')](function(_0x39e864){_0x50d291[_0xc9f2('0x22')]=_0x39e864;if(_0x187ca3['query'][_0xc9f2('0x49')]){_0x17b1ec['include']=[{'all':!![]}];}return db[_0xc9f2('0x48')][_0xc9f2('0x4a')](_0x17b1ec);})[_0xc9f2('0x2a')](function(_0x3a3bba){_0x50d291['rows']=_0x3a3bba;return _0x50d291;})['then'](respondWithFilteredResult(_0x5c2cb2,_0x17b1ec))[_0xc9f2('0x4b')](handleError(_0x5c2cb2,null));};exports[_0xc9f2('0x4c')]=function(_0x1040cd,_0x2b8884){var _0x145231={'raw':![],'where':{'id':_0x1040cd['params']['id']}},_0x58afb3={};_0x58afb3['model']=_[_0xc9f2('0x39')](db[_0xc9f2('0x48')]['rawAttributes']);_0x58afb3[_0xc9f2('0x38')]=_[_0xc9f2('0x39')](_0x1040cd[_0xc9f2('0x38')]);_0x58afb3[_0xc9f2('0x41')]=_[_0xc9f2('0x3a')](_0x58afb3[_0xc9f2('0x37')],_0x58afb3[_0xc9f2('0x38')]);_0x145231[_0xc9f2('0x3c')]=_[_0xc9f2('0x3a')](_0x58afb3[_0xc9f2('0x37')],qs[_0xc9f2('0x3b')](_0x1040cd[_0xc9f2('0x38')][_0xc9f2('0x3b')]));_0x145231[_0xc9f2('0x3c')]=_0x145231[_0xc9f2('0x3c')][_0xc9f2('0x4d')]?_0x145231[_0xc9f2('0x3c')]:_0x58afb3[_0xc9f2('0x37')];if(_0x1040cd['query'][_0xc9f2('0x49')]){_0x145231[_0xc9f2('0x4e')]=[{'all':!![]}];}_0x145231=_[_0xc9f2('0x44')]({},_0x145231,_0x1040cd[_0xc9f2('0x47')]);return db[_0xc9f2('0x48')][_0xc9f2('0x4f')](_0x145231)[_0xc9f2('0x2a')](handleEntityNotFound(_0x2b8884,null))[_0xc9f2('0x2a')](respondWithResult(_0x2b8884,null))[_0xc9f2('0x4b')](handleError(_0x2b8884,null));};exports[_0xc9f2('0x50')]=function(_0x4b40ea,_0x47c7bc){return db[_0xc9f2('0x48')][_0xc9f2('0x50')](_0x4b40ea[_0xc9f2('0x51')],{})[_0xc9f2('0x2a')](function(_0x3f4c19){var _0xf40c33=_0x4b40ea[_0xc9f2('0x52')][_0xc9f2('0x2c')]({'plain':!![]});if(!_0xf40c33)throw new Error(_0xc9f2('0x53'));if(_0xf40c33[_0xc9f2('0x54')]===_0xc9f2('0x52')){var _0x191a47=_0x3f4c19['get']({'plain':!![]});var _0x4df610='CustomDashboards';return db['UserProfileSection'][_0xc9f2('0x4f')]({'where':{'name':_0x4df610,'userProfileId':_0xf40c33['userProfileId']},'raw':!![]})[_0xc9f2('0x2a')](function(_0x263a17){if(_0x263a17&&_0x263a17['autoAssociation']===0x0){return db['UserProfileResource'][_0xc9f2('0x50')]({'name':_0x191a47['name'],'resourceId':_0x191a47['id'],'type':_0x263a17['name'],'sectionId':_0x263a17['id']},{})[_0xc9f2('0x2a')](function(){return _0x3f4c19;});}else{return _0x3f4c19;}})[_0xc9f2('0x4b')](function(_0x24ed86){logger['error'](_0xc9f2('0x55'),_0x24ed86);throw _0x24ed86;});}return _0x3f4c19;})[_0xc9f2('0x2a')](respondWithResult(_0x47c7bc,0xc9))[_0xc9f2('0x4b')](handleError(_0x47c7bc,null));};exports['clone']=function(_0x4cc2c5,_0x50b3c7){var _0x2c91fb={'where':{'id':_0x4cc2c5['params']['id']}},_0x41674a={};_0x41674a[_0xc9f2('0x37')]=_[_0xc9f2('0x39')](db[_0xc9f2('0x48')][_0xc9f2('0x56')]);_0x2c91fb[_0xc9f2('0x3c')]=_[_0xc9f2('0x3a')](_0x41674a[_0xc9f2('0x37')],qs['fields'](_0x4cc2c5[_0xc9f2('0x38')][_0xc9f2('0x3b')]));_0x2c91fb[_0xc9f2('0x3c')]=_0x2c91fb[_0xc9f2('0x3c')][_0xc9f2('0x4d')]?_0x2c91fb[_0xc9f2('0x3c')]:_0x41674a[_0xc9f2('0x37')];if(_0x4cc2c5[_0xc9f2('0x38')][_0xc9f2('0x49')]){_0x2c91fb[_0xc9f2('0x4e')]=[{'all':!![]}];}_0x2c91fb=_[_0xc9f2('0x44')]({},_0x2c91fb,_0x4cc2c5[_0xc9f2('0x47')]);return db[_0xc9f2('0x48')][_0xc9f2('0x4f')](_0x2c91fb)['then'](handleEntityNotFound(_0x50b3c7,null))[_0xc9f2('0x2a')](function(_0xa9eda2){if(_0xa9eda2){var _0x35c560=_0xa9eda2['get']({'plain':!![]});_0x35c560=qs['omit'](_0x35c560,['id','createdAt',_0xc9f2('0x57')]);_0x4cc2c5[_0xc9f2('0x51')]=_['omit'](_0x4cc2c5[_0xc9f2('0x51')],['id',_0xc9f2('0x58'),'updatedAt']);return db[_0xc9f2('0x48')]['create'](_[_0xc9f2('0x44')](_0x35c560,_0x4cc2c5[_0xc9f2('0x51')]),{'include':_0x4cc2c5[_0xc9f2('0x38')][_0xc9f2('0x49')]?[{'all':!![]}]:undefined})[_0xc9f2('0x2a')](function(_0x65b0){var _0x59e649=_0x4cc2c5[_0xc9f2('0x52')][_0xc9f2('0x2c')]({'plain':!![]});if(!_0x59e649)throw new Error(_0xc9f2('0x53'));if(_0x59e649[_0xc9f2('0x54')]===_0xc9f2('0x52')){var _0x44581c=_0x65b0['get']({'plain':!![]});var _0x5f20bc=_0xc9f2('0x59');return db[_0xc9f2('0x5a')][_0xc9f2('0x4f')]({'where':{'name':_0x5f20bc,'userProfileId':_0x59e649['userProfileId']},'raw':!![]})['then'](function(_0x4c7e19){if(_0x4c7e19&&_0x4c7e19[_0xc9f2('0x5b')]===0x0){return db[_0xc9f2('0x2d')][_0xc9f2('0x50')]({'name':_0x44581c['name'],'resourceId':_0x44581c['id'],'type':_0x4c7e19[_0xc9f2('0x31')],'sectionId':_0x4c7e19['id']},{})[_0xc9f2('0x2a')](function(){return _0x65b0;});}else{return _0x65b0;}})['catch'](function(_0x1e1eb8){logger[_0xc9f2('0x2f')](_0xc9f2('0x55'),_0x1e1eb8);throw _0x1e1eb8;});}return _0x65b0;});}})['then'](respondWithResult(_0x50b3c7,0xc9))[_0xc9f2('0x4b')](handleError(_0x50b3c7,null));};exports[_0xc9f2('0x29')]=function(_0xd82c9,_0x1941e9){if(_0xd82c9['body']['id']){delete _0xd82c9[_0xc9f2('0x51')]['id'];}return db['Dashboard']['find']({'where':{'id':_0xd82c9[_0xc9f2('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1941e9,null))[_0xc9f2('0x2a')](saveUpdates(_0xd82c9[_0xc9f2('0x51')],null))[_0xc9f2('0x2a')](respondWithResult(_0x1941e9,null))[_0xc9f2('0x4b')](handleError(_0x1941e9,null));};exports[_0xc9f2('0x2b')]=function(_0xe2f227,_0x14cb53){return db[_0xc9f2('0x48')][_0xc9f2('0x4f')]({'where':{'id':_0xe2f227[_0xc9f2('0x5c')]['id']}})[_0xc9f2('0x2a')](handleEntityNotFound(_0x14cb53,null))[_0xc9f2('0x2a')](removeEntity(_0x14cb53,null))[_0xc9f2('0x4b')](handleError(_0x14cb53,null));};function widgetAttributes(_0x5f1f9d){try{switch(_0x5f1f9d['type']){case'iframe':return[{'name':_0xc9f2('0x5d'),'value':_0x5f1f9d[_0xc9f2('0x5d')]||(_0x5f1f9d[_0xc9f2('0x5e')]&&_0x5f1f9d['attrs'][0x0]?_0x5f1f9d['attrs'][0x0][_0xc9f2('0x5f')]:undefined)||_0xc9f2('0x60')}];case'custom':return[{'name':_0xc9f2('0x61'),'value':_0x5f1f9d[_0xc9f2('0x61')]||(_0x5f1f9d[_0xc9f2('0x5e')]&&_0x5f1f9d[_0xc9f2('0x5e')][0x0]?_0x5f1f9d[_0xc9f2('0x5e')][0x0][_0xc9f2('0x5f')]:undefined)||''}];case _0xc9f2('0x62'):return[{'name':_0xc9f2('0x63'),'value':_0x5f1f9d[_0xc9f2('0x63')]||(_0x5f1f9d[_0xc9f2('0x5e')]&&_0x5f1f9d[_0xc9f2('0x5e')][0x0]?_0x5f1f9d[_0xc9f2('0x5e')][0x0][_0xc9f2('0x5f')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x5f1f9d[_0xc9f2('0x64')]||(_0x5f1f9d['attrs']&&_0x5f1f9d[_0xc9f2('0x5e')][0x1]?_0x5f1f9d[_0xc9f2('0x5e')][0x1]['value']:undefined)||'0.00'},{'name':'attrFontSize','value':_0x5f1f9d[_0xc9f2('0x65')]||(_0x5f1f9d[_0xc9f2('0x5e')]&&_0x5f1f9d[_0xc9f2('0x5e')][0x2]?_0x5f1f9d[_0xc9f2('0x5e')][0x2][_0xc9f2('0x5f')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x5f1f9d[_0xc9f2('0x66')]||(_0x5f1f9d['attrs']&&_0x5f1f9d[_0xc9f2('0x5e')][0x0]?_0x5f1f9d[_0xc9f2('0x5e')][0x0][_0xc9f2('0x5f')]:undefined)||_0xc9f2('0x67')},{'name':_0xc9f2('0x68'),'value':_0x5f1f9d[_0xc9f2('0x68')]||(_0x5f1f9d[_0xc9f2('0x5e')]&&_0x5f1f9d['attrs'][0x1]?_0x5f1f9d[_0xc9f2('0x5e')][0x1][_0xc9f2('0x5f')]:undefined)||[]},{'name':_0xc9f2('0x65'),'value':_0x5f1f9d['attrFontSize']||(_0x5f1f9d[_0xc9f2('0x5e')]&&_0x5f1f9d['attrs'][0x2]?_0x5f1f9d[_0xc9f2('0x5e')][0x2][_0xc9f2('0x5f')]:undefined)||0x14}];case _0xc9f2('0x69'):case'pie-chart':return[{'name':_0xc9f2('0x6a'),'value':_0x5f1f9d[_0xc9f2('0x6a')]||(_0x5f1f9d['attrs']&&_0x5f1f9d['attrs'][0x0]?_0x5f1f9d['attrs'][0x0][_0xc9f2('0x5f')]:undefined)||_0xc9f2('0x67')},{'name':_0xc9f2('0x6b'),'value':_0x5f1f9d[_0xc9f2('0x6b')]||(_0x5f1f9d['attrs']&&_0x5f1f9d[_0xc9f2('0x5e')][0x1]?_0x5f1f9d[_0xc9f2('0x5e')][0x1][_0xc9f2('0x5f')]:undefined)||null},{'name':_0xc9f2('0x6c'),'value':_0x5f1f9d[_0xc9f2('0x6c')]||(_0x5f1f9d['attrs']&&_0x5f1f9d[_0xc9f2('0x5e')][0x2]?_0x5f1f9d[_0xc9f2('0x5e')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x5f1f9d[_0xc9f2('0x68')]||(_0x5f1f9d['attrs']&&_0x5f1f9d[_0xc9f2('0x5e')][0x3]?_0x5f1f9d[_0xc9f2('0x5e')][0x3][_0xc9f2('0x5f')]:undefined)||[]}];case'web-report':return[{'name':_0xc9f2('0x6d'),'type':_0x5f1f9d[_0xc9f2('0x6e')]||(_0x5f1f9d[_0xc9f2('0x5e')]&&_0x5f1f9d[_0xc9f2('0x5e')][0x0]?_0x5f1f9d[_0xc9f2('0x5e')][0x0][_0xc9f2('0x35')]:undefined)||null,'value':_0x5f1f9d['attrReport']||(_0x5f1f9d['attrs']&&_0x5f1f9d['attrs'][0x0]?_0x5f1f9d[_0xc9f2('0x5e')][0x0][_0xc9f2('0x5f')]:undefined)||null},{'name':'attrRefresh','value':_0x5f1f9d[_0xc9f2('0x6f')]||(_0x5f1f9d['attrs']&&_0x5f1f9d[_0xc9f2('0x5e')][0x1]?_0x5f1f9d['attrs'][0x1][_0xc9f2('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0xcbea9b){logger[_0xc9f2('0x2f')](_0xc9f2('0x70'),JSON['stringify'](_0xcbea9b));return[];}}exports[_0xc9f2('0x71')]=function(_0x2e6ec5,_0x199f6c,_0x46c3c2){if(_0x2e6ec5[_0xc9f2('0x51')]['id']){delete _0x2e6ec5[_0xc9f2('0x51')]['id'];}return db['Dashboard'][_0xc9f2('0x4f')]({'where':{'id':_0x2e6ec5[_0xc9f2('0x5c')]['id']}})[_0xc9f2('0x2a')](handleEntityNotFound(_0x199f6c,null))[_0xc9f2('0x2a')](function(_0x3dae72){if(_0x3dae72){_0x2e6ec5[_0xc9f2('0x51')][_0xc9f2('0x72')]=_0x3dae72['id'];_0x2e6ec5[_0xc9f2('0x51')][_0xc9f2('0x5e')]=widgetAttributes(_0x2e6ec5['body']);return db['DashboardItem'][_0xc9f2('0x50')](_0x2e6ec5[_0xc9f2('0x51')]);}})[_0xc9f2('0x2a')](respondWithResult(_0x199f6c,null))[_0xc9f2('0x4b')](handleError(_0x199f6c,null));};exports[_0xc9f2('0x73')]=function(_0x486fd1,_0x217c2f,_0x3de5c6){var _0xad5570={};var _0x1e2559={};var _0x45ce24;var _0x2d866b;return db[_0xc9f2('0x48')]['findOne']({'where':{'id':_0x486fd1['params']['id']}})[_0xc9f2('0x2a')](handleEntityNotFound(_0x217c2f,null))[_0xc9f2('0x2a')](function(_0x7b6d49){if(_0x7b6d49){_0x45ce24=_0x7b6d49;_0x1e2559['model']=_['keys'](db['DashboardItem'][_0xc9f2('0x56')]);_0x1e2559[_0xc9f2('0x38')]=_['keys'](_0x486fd1[_0xc9f2('0x38')]);_0x1e2559['filters']=_[_0xc9f2('0x3a')](_0x1e2559[_0xc9f2('0x37')],_0x1e2559[_0xc9f2('0x38')]);_0xad5570[_0xc9f2('0x3c')]=_[_0xc9f2('0x3a')](_0x1e2559[_0xc9f2('0x37')],qs[_0xc9f2('0x3b')](_0x486fd1[_0xc9f2('0x38')][_0xc9f2('0x3b')]));_0xad5570['attributes']=_0xad5570[_0xc9f2('0x3c')][_0xc9f2('0x4d')]?_0xad5570[_0xc9f2('0x3c')]:_0x1e2559['model'];_0xad5570[_0xc9f2('0x74')]=qs[_0xc9f2('0x3f')](_0x486fd1[_0xc9f2('0x38')][_0xc9f2('0x3f')]);_0xad5570[_0xc9f2('0x40')]=qs[_0xc9f2('0x41')](_[_0xc9f2('0x42')](_0x486fd1[_0xc9f2('0x38')],_0x1e2559[_0xc9f2('0x41')]));if(_0x486fd1[_0xc9f2('0x38')][_0xc9f2('0x43')]){_0xad5570[_0xc9f2('0x40')]=_[_0xc9f2('0x44')](_0xad5570[_0xc9f2('0x40')],{'$or':_[_0xc9f2('0x45')](_0xad5570[_0xc9f2('0x3c')],function(_0x1c0db3){var _0x47a215={};_0x47a215[_0x1c0db3]={'$like':'%'+_0x486fd1[_0xc9f2('0x38')][_0xc9f2('0x43')]+'%'};return _0x47a215;})});}_0xad5570=_['merge']({},_0xad5570,_0x486fd1[_0xc9f2('0x47')]);return _0x45ce24[_0xc9f2('0x73')](_0xad5570);}})[_0xc9f2('0x2a')](function(_0x3aa369){if(_0x3aa369){_0x2d866b=_0x3aa369['length'];if(!_0x486fd1[_0xc9f2('0x38')]['hasOwnProperty'](_0xc9f2('0x3e'))){_0xad5570[_0xc9f2('0x24')]=qs['limit'](_0x486fd1[_0xc9f2('0x38')][_0xc9f2('0x24')]);_0xad5570[_0xc9f2('0x23')]=qs['offset'](_0x486fd1['query'][_0xc9f2('0x23')]);}return _0x45ce24['getItems'](_0xad5570);}})[_0xc9f2('0x2a')](function(_0x120320){if(_0x120320){return _0x120320?{'count':_0x2d866b,'rows':_0x120320}:null;}})['then'](respondWithResult(_0x217c2f,null))[_0xc9f2('0x4b')](handleError(_0x217c2f,null));};
\ No newline at end of file
+var _0x9d44=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','iframe','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','limit','set','reject','save','update','destroy','then','get','CustomDashboards','error','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x1867e3,_0x30e5ce){var _0x494e32=function(_0x2a9446){while(--_0x2a9446){_0x1867e3['push'](_0x1867e3['shift']());}};_0x494e32(++_0x30e5ce);}(_0x9d44,0xa2));var _0x49d4=function(_0x20ae2f,_0x455457){_0x20ae2f=_0x20ae2f-0x0;var _0x47adce=_0x9d44[_0x20ae2f];return _0x47adce;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x49d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x49d4('0x1'));var jsonpatch=require(_0x49d4('0x2'));var rp=require(_0x49d4('0x3'));var moment=require(_0x49d4('0x4'));var BPromise=require(_0x49d4('0x5'));var Mustache=require(_0x49d4('0x6'));var util=require(_0x49d4('0x7'));var path=require(_0x49d4('0x8'));var sox=require(_0x49d4('0x9'));var csv=require(_0x49d4('0xa'));var ejs=require(_0x49d4('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x49d4('0xc'));var crypto=require(_0x49d4('0xd'));var jsforce=require(_0x49d4('0xe'));var deskjs=require(_0x49d4('0xf'));var toCsv=require(_0x49d4('0xa'));var querystring=require('querystring');var Papa=require(_0x49d4('0x10'));var Redis=require(_0x49d4('0x11'));var authService=require(_0x49d4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x49d4('0x13'));var hardwareService=require(_0x49d4('0x14'));var logger=require(_0x49d4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x49d4('0x16'));var db=require(_0x49d4('0x17'))['db'];config['redis']=_['defaults'](config[_0x49d4('0x18')],{'host':_0x49d4('0x19'),'port':0x18eb});var socket=require(_0x49d4('0x1a'))(new Redis(config['redis']));require(_0x49d4('0x1b'))[_0x49d4('0x1c')](socket);function respondWithStatusCode(_0x456de7,_0x102f29){_0x102f29=_0x102f29||0xcc;return function(_0x253393){if(_0x253393){return _0x456de7[_0x49d4('0x1d')](_0x102f29);}return _0x456de7[_0x49d4('0x1e')](_0x102f29)[_0x49d4('0x1f')]();};}function respondWithResult(_0x20a08c,_0x571b98){_0x571b98=_0x571b98||0xc8;return function(_0x268410){if(_0x268410){return _0x20a08c['status'](_0x571b98)[_0x49d4('0x20')](_0x268410);}};}function respondWithFilteredResult(_0xa322e6,_0x6bc12c){return function(_0x4d396c){if(_0x4d396c){var _0xe3ee1d=_0x4d396c['count'],_0x11611d=_0x6bc12c[_0x49d4('0x21')],_0x49bb48=_0x6bc12c[_0x49d4('0x21')]+_0x6bc12c[_0x49d4('0x22')],_0x23a3c2;if(_0x49bb48>=_0xe3ee1d){_0x49bb48=_0xe3ee1d;_0x23a3c2=0xc8;}else{_0x23a3c2=0xce;}_0xa322e6[_0x49d4('0x1e')](_0x23a3c2);return _0xa322e6[_0x49d4('0x23')]('Content-Range',_0x11611d+'-'+_0x49bb48+'/'+_0xe3ee1d)['json'](_0x4d396c);}return null;};}function patchUpdates(_0x34e52){return function(_0x2e4cfd){try{jsonpatch['apply'](_0x2e4cfd,_0x34e52,!![]);}catch(_0x25d6b3){return BPromise[_0x49d4('0x24')](_0x25d6b3);}return _0x2e4cfd[_0x49d4('0x25')]();};}function saveUpdates(_0x3a1ace,_0x3408c5){return function(_0x26b430){if(_0x26b430){return _0x26b430[_0x49d4('0x26')](_0x3a1ace)['then'](function(_0x38d8a0){return _0x38d8a0;});}return null;};}function removeEntity(_0x3c5a29,_0x5beea4){return function(_0x53b971){if(_0x53b971){return _0x53b971[_0x49d4('0x27')]()[_0x49d4('0x28')](function(){var _0x3a7cf3=_0x53b971[_0x49d4('0x29')]({'plain':!![]});var _0x444b84=_0x49d4('0x2a');return db['UserProfileResource'][_0x49d4('0x27')]({'where':{'type':_0x444b84,'resourceId':_0x3a7cf3['id']}})['then'](function(){return _0x53b971;});})['then'](function(){_0x3c5a29[_0x49d4('0x1e')](0xcc)[_0x49d4('0x1f')]();});}};}function handleEntityNotFound(_0x2ef3e4,_0x5846ea){return function(_0x46ee5e){if(!_0x46ee5e){_0x2ef3e4['sendStatus'](0x194);}return _0x46ee5e;};}function handleError(_0x1a7843,_0x12b370){_0x12b370=_0x12b370||0x1f4;return function(_0x356053){logger[_0x49d4('0x2b')](_0x356053[_0x49d4('0x2c')]);if(_0x356053[_0x49d4('0x2d')]){delete _0x356053[_0x49d4('0x2d')];}_0x1a7843[_0x49d4('0x1e')](_0x12b370)[_0x49d4('0x2e')](_0x356053);};}exports[_0x49d4('0x2f')]=function(_0x62a582,_0xaffba){var _0x159031={},_0x5c303f={},_0x140559={'count':0x0,'rows':[]};var _0x470836=_['map'](db[_0x49d4('0x30')][_0x49d4('0x31')],function(_0x4bafd9){return{'name':_0x4bafd9[_0x49d4('0x32')],'type':_0x4bafd9[_0x49d4('0x33')][_0x49d4('0x34')]};});_0x5c303f[_0x49d4('0x35')]=_['map'](_0x470836,_0x49d4('0x2d'));_0x5c303f[_0x49d4('0x36')]=_[_0x49d4('0x37')](_0x62a582[_0x49d4('0x36')]);_0x5c303f[_0x49d4('0x38')]=_[_0x49d4('0x39')](_0x5c303f['model'],_0x5c303f[_0x49d4('0x36')]);_0x159031['attributes']=_[_0x49d4('0x39')](_0x5c303f[_0x49d4('0x35')],qs['fields'](_0x62a582[_0x49d4('0x36')][_0x49d4('0x3a')]));_0x159031['attributes']=_0x159031[_0x49d4('0x3b')][_0x49d4('0x3c')]?_0x159031[_0x49d4('0x3b')]:_0x5c303f[_0x49d4('0x35')];if(!_0x62a582[_0x49d4('0x36')][_0x49d4('0x3d')](_0x49d4('0x3e'))){_0x159031[_0x49d4('0x22')]=qs[_0x49d4('0x22')](_0x62a582['query'][_0x49d4('0x22')]);_0x159031[_0x49d4('0x21')]=qs[_0x49d4('0x21')](_0x62a582[_0x49d4('0x36')]['offset']);}_0x159031[_0x49d4('0x3f')]=qs[_0x49d4('0x40')](_0x62a582[_0x49d4('0x36')][_0x49d4('0x40')]);_0x159031[_0x49d4('0x41')]=qs[_0x49d4('0x38')](_['pick'](_0x62a582[_0x49d4('0x36')],_0x5c303f[_0x49d4('0x38')]),_0x470836);if(_0x62a582['query'][_0x49d4('0x42')]){_0x159031[_0x49d4('0x41')]=_['merge'](_0x159031['where'],{'$or':_['map'](_0x470836,function(_0x247d74){if(_0x247d74['type']!==_0x49d4('0x43')){var _0x79c382={};_0x79c382[_0x247d74['name']]={'$like':'%'+_0x62a582[_0x49d4('0x36')][_0x49d4('0x42')]+'%'};return _0x79c382;}})});}_0x159031=_[_0x49d4('0x44')]({},_0x159031,_0x62a582[_0x49d4('0x45')]);var _0x4d05a3={'where':_0x159031[_0x49d4('0x41')]};return db['Dashboard'][_0x49d4('0x46')](_0x4d05a3)[_0x49d4('0x28')](function(_0x467c9f){_0x140559['count']=_0x467c9f;if(_0x62a582[_0x49d4('0x36')][_0x49d4('0x47')]){_0x159031[_0x49d4('0x48')]=[{'all':!![]}];}return db['Dashboard'][_0x49d4('0x49')](_0x159031);})[_0x49d4('0x28')](function(_0x4f6cef){_0x140559[_0x49d4('0x4a')]=_0x4f6cef;return _0x140559;})[_0x49d4('0x28')](respondWithFilteredResult(_0xaffba,_0x159031))['catch'](handleError(_0xaffba,null));};exports[_0x49d4('0x4b')]=function(_0xffd3ea,_0x1c9854){var _0x275cff={'raw':![],'where':{'id':_0xffd3ea[_0x49d4('0x4c')]['id']}},_0x42b846={};_0x42b846[_0x49d4('0x35')]=_[_0x49d4('0x37')](db[_0x49d4('0x30')]['rawAttributes']);_0x42b846[_0x49d4('0x36')]=_[_0x49d4('0x37')](_0xffd3ea[_0x49d4('0x36')]);_0x42b846[_0x49d4('0x38')]=_[_0x49d4('0x39')](_0x42b846['model'],_0x42b846[_0x49d4('0x36')]);_0x275cff[_0x49d4('0x3b')]=_[_0x49d4('0x39')](_0x42b846[_0x49d4('0x35')],qs[_0x49d4('0x3a')](_0xffd3ea['query'][_0x49d4('0x3a')]));_0x275cff['attributes']=_0x275cff[_0x49d4('0x3b')][_0x49d4('0x3c')]?_0x275cff['attributes']:_0x42b846['model'];if(_0xffd3ea[_0x49d4('0x36')]['includeAll']){_0x275cff[_0x49d4('0x48')]=[{'all':!![]}];}_0x275cff=_[_0x49d4('0x44')]({},_0x275cff,_0xffd3ea[_0x49d4('0x45')]);return db[_0x49d4('0x30')][_0x49d4('0x4d')](_0x275cff)['then'](handleEntityNotFound(_0x1c9854,null))[_0x49d4('0x28')](respondWithResult(_0x1c9854,null))[_0x49d4('0x4e')](handleError(_0x1c9854,null));};exports['create']=function(_0xe65f24,_0x4889a9){return db['Dashboard'][_0x49d4('0x4f')](_0xe65f24['body'],{})['then'](function(_0x23efea){var _0x439460=_0xe65f24[_0x49d4('0x50')][_0x49d4('0x29')]({'plain':!![]});if(!_0x439460)throw new Error(_0x49d4('0x51'));if(_0x439460[_0x49d4('0x52')]===_0x49d4('0x50')){var _0x47ddea=_0x23efea[_0x49d4('0x29')]({'plain':!![]});var _0x586e96=_0x49d4('0x2a');return db[_0x49d4('0x53')][_0x49d4('0x4d')]({'where':{'name':_0x586e96,'userProfileId':_0x439460[_0x49d4('0x54')]},'raw':!![]})[_0x49d4('0x28')](function(_0x3da6a7){if(_0x3da6a7&&_0x3da6a7[_0x49d4('0x55')]===0x0){return db[_0x49d4('0x56')][_0x49d4('0x4f')]({'name':_0x47ddea[_0x49d4('0x2d')],'resourceId':_0x47ddea['id'],'type':_0x3da6a7[_0x49d4('0x2d')],'sectionId':_0x3da6a7['id']},{})[_0x49d4('0x28')](function(){return _0x23efea;});}else{return _0x23efea;}})[_0x49d4('0x4e')](function(_0x146c7d){logger[_0x49d4('0x2b')](_0x49d4('0x57'),_0x146c7d);throw _0x146c7d;});}return _0x23efea;})['then'](respondWithResult(_0x4889a9,0xc9))[_0x49d4('0x4e')](handleError(_0x4889a9,null));};exports[_0x49d4('0x58')]=function(_0x2cadd6,_0xd241bb){var _0x757658={'where':{'id':_0x2cadd6[_0x49d4('0x4c')]['id']}},_0x3d5e29={};_0x3d5e29[_0x49d4('0x35')]=_[_0x49d4('0x37')](db['Dashboard'][_0x49d4('0x31')]);_0x757658[_0x49d4('0x3b')]=_['intersection'](_0x3d5e29[_0x49d4('0x35')],qs[_0x49d4('0x3a')](_0x2cadd6[_0x49d4('0x36')]['fields']));_0x757658['attributes']=_0x757658[_0x49d4('0x3b')][_0x49d4('0x3c')]?_0x757658[_0x49d4('0x3b')]:_0x3d5e29[_0x49d4('0x35')];if(_0x2cadd6[_0x49d4('0x36')][_0x49d4('0x47')]){_0x757658[_0x49d4('0x48')]=[{'all':!![]}];}_0x757658=_[_0x49d4('0x44')]({},_0x757658,_0x2cadd6[_0x49d4('0x45')]);return db[_0x49d4('0x30')][_0x49d4('0x4d')](_0x757658)[_0x49d4('0x28')](handleEntityNotFound(_0xd241bb,null))[_0x49d4('0x28')](function(_0x21db3f){if(_0x21db3f){var _0x33c16d=_0x21db3f['get']({'plain':!![]});_0x33c16d=qs[_0x49d4('0x59')](_0x33c16d,['id',_0x49d4('0x5a'),'updatedAt']);_0x2cadd6[_0x49d4('0x5b')]=_[_0x49d4('0x59')](_0x2cadd6['body'],['id',_0x49d4('0x5a'),_0x49d4('0x5c')]);return db[_0x49d4('0x30')][_0x49d4('0x4f')](_[_0x49d4('0x44')](_0x33c16d,_0x2cadd6[_0x49d4('0x5b')]),{'include':_0x2cadd6[_0x49d4('0x36')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3a4f7b){var _0x53bd64=_0x2cadd6[_0x49d4('0x50')]['get']({'plain':!![]});if(!_0x53bd64)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53bd64[_0x49d4('0x52')]===_0x49d4('0x50')){var _0x584d97=_0x3a4f7b['get']({'plain':!![]});var _0x5e9ccd=_0x49d4('0x2a');return db[_0x49d4('0x53')][_0x49d4('0x4d')]({'where':{'name':_0x5e9ccd,'userProfileId':_0x53bd64['userProfileId']},'raw':!![]})['then'](function(_0x22df25){if(_0x22df25&&_0x22df25[_0x49d4('0x55')]===0x0){return db[_0x49d4('0x56')][_0x49d4('0x4f')]({'name':_0x584d97['name'],'resourceId':_0x584d97['id'],'type':_0x22df25['name'],'sectionId':_0x22df25['id']},{})[_0x49d4('0x28')](function(){return _0x3a4f7b;});}else{return _0x3a4f7b;}})['catch'](function(_0x1a3afe){logger[_0x49d4('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a3afe);throw _0x1a3afe;});}return _0x3a4f7b;});}})[_0x49d4('0x28')](respondWithResult(_0xd241bb,0xc9))[_0x49d4('0x4e')](handleError(_0xd241bb,null));};exports[_0x49d4('0x26')]=function(_0x464bf5,_0x4f7b12){if(_0x464bf5['body']['id']){delete _0x464bf5[_0x49d4('0x5b')]['id'];}return db[_0x49d4('0x30')][_0x49d4('0x4d')]({'where':{'id':_0x464bf5[_0x49d4('0x4c')]['id']}})[_0x49d4('0x28')](handleEntityNotFound(_0x4f7b12,null))[_0x49d4('0x28')](saveUpdates(_0x464bf5[_0x49d4('0x5b')],null))['then'](respondWithResult(_0x4f7b12,null))[_0x49d4('0x4e')](handleError(_0x4f7b12,null));};exports[_0x49d4('0x27')]=function(_0x113511,_0xaf2309){return db[_0x49d4('0x30')][_0x49d4('0x4d')]({'where':{'id':_0x113511['params']['id']}})[_0x49d4('0x28')](handleEntityNotFound(_0xaf2309,null))[_0x49d4('0x28')](removeEntity(_0xaf2309,null))[_0x49d4('0x4e')](handleError(_0xaf2309,null));};function widgetAttributes(_0x48c18a){try{switch(_0x48c18a[_0x49d4('0x33')]){case _0x49d4('0x5d'):return[{'name':'attrUrl','value':_0x48c18a[_0x49d4('0x5e')]||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a[_0x49d4('0x5f')][0x0]?_0x48c18a[_0x49d4('0x5f')][0x0]['value']:undefined)||_0x49d4('0x60')}];case _0x49d4('0x61'):return[{'name':'attrPath','value':_0x48c18a[_0x49d4('0x62')]||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a[_0x49d4('0x5f')][0x0]?_0x48c18a[_0x49d4('0x5f')][0x0][_0x49d4('0x63')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x48c18a[_0x49d4('0x64')]||(_0x48c18a['attrs']&&_0x48c18a['attrs'][0x0]?_0x48c18a['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x48c18a[_0x49d4('0x65')]||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a[_0x49d4('0x5f')][0x1]?_0x48c18a[_0x49d4('0x5f')][0x1][_0x49d4('0x63')]:undefined)||_0x49d4('0x66')},{'name':_0x49d4('0x67'),'value':_0x48c18a[_0x49d4('0x67')]||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a[_0x49d4('0x5f')][0x2]?_0x48c18a[_0x49d4('0x5f')][0x2]['value']:undefined)||0xc}];case _0x49d4('0x68'):return[{'name':'attrMetric','value':_0x48c18a[_0x49d4('0x69')]||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a[_0x49d4('0x5f')][0x0]?_0x48c18a[_0x49d4('0x5f')][0x0][_0x49d4('0x63')]:undefined)||'total'},{'name':_0x49d4('0x6a'),'value':_0x48c18a[_0x49d4('0x6a')]||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a[_0x49d4('0x5f')][0x1]?_0x48c18a['attrs'][0x1][_0x49d4('0x63')]:undefined)||[]},{'name':'attrFontSize','value':_0x48c18a[_0x49d4('0x67')]||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a[_0x49d4('0x5f')][0x2]?_0x48c18a[_0x49d4('0x5f')][0x2]['value']:undefined)||0x14}];case _0x49d4('0x6b'):case _0x49d4('0x6c'):return[{'name':_0x49d4('0x6d'),'value':_0x48c18a['attrSerie1']||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a[_0x49d4('0x5f')][0x0]?_0x48c18a[_0x49d4('0x5f')][0x0]['value']:undefined)||_0x49d4('0x6e')},{'name':_0x49d4('0x6f'),'value':_0x48c18a[_0x49d4('0x6f')]||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a[_0x49d4('0x5f')][0x1]?_0x48c18a[_0x49d4('0x5f')][0x1][_0x49d4('0x63')]:undefined)||null},{'name':_0x49d4('0x70'),'value':_0x48c18a[_0x49d4('0x70')]||(_0x48c18a['attrs']&&_0x48c18a['attrs'][0x2]?_0x48c18a[_0x49d4('0x5f')][0x2][_0x49d4('0x63')]:undefined)||null},{'name':_0x49d4('0x6a'),'value':_0x48c18a[_0x49d4('0x6a')]||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a[_0x49d4('0x5f')][0x3]?_0x48c18a['attrs'][0x3][_0x49d4('0x63')]:undefined)||[]}];case _0x49d4('0x71'):return[{'name':_0x49d4('0x72'),'type':_0x48c18a[_0x49d4('0x73')]||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a['attrs'][0x0]?_0x48c18a['attrs'][0x0][_0x49d4('0x33')]:undefined)||null,'value':_0x48c18a[_0x49d4('0x72')]||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a['attrs'][0x0]?_0x48c18a['attrs'][0x0][_0x49d4('0x63')]:undefined)||null},{'name':'attrRefresh','value':_0x48c18a[_0x49d4('0x74')]||(_0x48c18a[_0x49d4('0x5f')]&&_0x48c18a[_0x49d4('0x5f')][0x1]?_0x48c18a[_0x49d4('0x5f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x582e12){logger[_0x49d4('0x2b')]('widgetAttributes:\x20%s',JSON[_0x49d4('0x75')](_0x582e12));return[];}}exports[_0x49d4('0x76')]=function(_0x505102,_0x337802,_0x5ad500){if(_0x505102['body']['id']){delete _0x505102['body']['id'];}return db[_0x49d4('0x30')]['find']({'where':{'id':_0x505102[_0x49d4('0x4c')]['id']}})[_0x49d4('0x28')](handleEntityNotFound(_0x337802,null))[_0x49d4('0x28')](function(_0x57ed89){if(_0x57ed89){_0x505102[_0x49d4('0x5b')][_0x49d4('0x77')]=_0x57ed89['id'];_0x505102[_0x49d4('0x5b')]['attrs']=widgetAttributes(_0x505102[_0x49d4('0x5b')]);return db[_0x49d4('0x78')]['create'](_0x505102[_0x49d4('0x5b')]);}})['then'](respondWithResult(_0x337802,null))['catch'](handleError(_0x337802,null));};exports[_0x49d4('0x79')]=function(_0x3b94ac,_0x162e37,_0x2c9d36){var _0x5c7a6d={};var _0x7f2e3a={};var _0x1957c2;var _0x3b7b87;return db[_0x49d4('0x30')]['findOne']({'where':{'id':_0x3b94ac[_0x49d4('0x4c')]['id']}})[_0x49d4('0x28')](handleEntityNotFound(_0x162e37,null))['then'](function(_0x2d8dea){if(_0x2d8dea){_0x1957c2=_0x2d8dea;_0x7f2e3a[_0x49d4('0x35')]=_['keys'](db[_0x49d4('0x78')][_0x49d4('0x31')]);_0x7f2e3a['query']=_[_0x49d4('0x37')](_0x3b94ac[_0x49d4('0x36')]);_0x7f2e3a['filters']=_[_0x49d4('0x39')](_0x7f2e3a['model'],_0x7f2e3a['query']);_0x5c7a6d['attributes']=_[_0x49d4('0x39')](_0x7f2e3a[_0x49d4('0x35')],qs[_0x49d4('0x3a')](_0x3b94ac['query'][_0x49d4('0x3a')]));_0x5c7a6d[_0x49d4('0x3b')]=_0x5c7a6d[_0x49d4('0x3b')]['length']?_0x5c7a6d[_0x49d4('0x3b')]:_0x7f2e3a[_0x49d4('0x35')];_0x5c7a6d[_0x49d4('0x3f')]=qs[_0x49d4('0x40')](_0x3b94ac[_0x49d4('0x36')][_0x49d4('0x40')]);_0x5c7a6d['where']=qs[_0x49d4('0x38')](_[_0x49d4('0x7a')](_0x3b94ac[_0x49d4('0x36')],_0x7f2e3a[_0x49d4('0x38')]));if(_0x3b94ac[_0x49d4('0x36')][_0x49d4('0x42')]){_0x5c7a6d[_0x49d4('0x41')]=_[_0x49d4('0x44')](_0x5c7a6d[_0x49d4('0x41')],{'$or':_['map'](_0x5c7a6d[_0x49d4('0x3b')],function(_0x465ec2){var _0x4d9372={};_0x4d9372[_0x465ec2]={'$like':'%'+_0x3b94ac[_0x49d4('0x36')][_0x49d4('0x42')]+'%'};return _0x4d9372;})});}_0x5c7a6d=_['merge']({},_0x5c7a6d,_0x3b94ac[_0x49d4('0x45')]);return _0x1957c2[_0x49d4('0x79')](_0x5c7a6d);}})['then'](function(_0x54b787){if(_0x54b787){_0x3b7b87=_0x54b787['length'];if(!_0x3b94ac[_0x49d4('0x36')][_0x49d4('0x3d')](_0x49d4('0x3e'))){_0x5c7a6d[_0x49d4('0x22')]=qs[_0x49d4('0x22')](_0x3b94ac[_0x49d4('0x36')][_0x49d4('0x22')]);_0x5c7a6d[_0x49d4('0x21')]=qs['offset'](_0x3b94ac['query'][_0x49d4('0x21')]);}return _0x1957c2[_0x49d4('0x79')](_0x5c7a6d);}})[_0x49d4('0x28')](function(_0x413eb9){if(_0x413eb9){return _0x413eb9?{'count':_0x3b7b87,'rows':_0x413eb9}:null;}})[_0x49d4('0x28')](respondWithResult(_0x162e37,null))['catch'](handleError(_0x162e37,null));};
\ No newline at end of file
index e13e6cc..d811bf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bc2=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x577c95,_0x2d9874){var _0x5aeb44=function(_0x5069c0){while(--_0x5069c0){_0x577c95['push'](_0x577c95['shift']());}};_0x5aeb44(++_0x2d9874);}(_0x5bc2,0xbb));var _0x25bc=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0x5bc2[_0x2d344f];return _0x2e796b;};'use strict';var EventEmitter=require(_0x25bc('0x0'));var Dashboard=require(_0x25bc('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x25bc('0x2')](0x0);var events={'afterCreate':_0x25bc('0x3'),'afterUpdate':'update','afterDestroy':_0x25bc('0x4')};function emitEvent(_0x11da33){return function(_0x3d5597,_0x2ad910,_0x17db84){DashboardEvents['emit'](_0x11da33+':'+_0x3d5597['id'],_0x3d5597);DashboardEvents[_0x25bc('0x5')](_0x11da33,_0x3d5597);_0x17db84(null);};}for(var e in events){if(events[_0x25bc('0x6')](e)){var event=events[e];Dashboard[_0x25bc('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
+var _0x9e88=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1d5759,_0x417e09){var _0x51ddcd=function(_0x4e3f43){while(--_0x4e3f43){_0x1d5759['push'](_0x1d5759['shift']());}};_0x51ddcd(++_0x417e09);}(_0x9e88,0x1af));var _0x89e8=function(_0x3224b6,_0x1f20da){_0x3224b6=_0x3224b6-0x0;var _0x1f4ed7=_0x9e88[_0x3224b6];return _0x1f4ed7;};'use strict';var EventEmitter=require(_0x89e8('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x89e8('0x1')](0x0);var events={'afterCreate':_0x89e8('0x2'),'afterUpdate':_0x89e8('0x3'),'afterDestroy':_0x89e8('0x4')};function emitEvent(_0x39f3fb){return function(_0x2d2501,_0x5662bf,_0x5033e1){DashboardEvents[_0x89e8('0x5')](_0x39f3fb+':'+_0x2d2501['id'],_0x2d2501);DashboardEvents['emit'](_0x39f3fb,_0x2d2501);_0x5033e1(null);};}for(var e in events){if(events[_0x89e8('0x6')](e)){var event=events[e];Dashboard[_0x89e8('0x7')](e,emitEvent(event));}}module[_0x89e8('0x8')]=DashboardEvents;
\ No newline at end of file
index e8149b4..f98c3f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05be=['../../config/logger','moment','request-promise','path','../../config/environment','./dashboard.attributes','exports','define','dashboards','util'];(function(_0x1e54a2,_0x2d8fd5){var _0x5ed556=function(_0x221b0e){while(--_0x221b0e){_0x1e54a2['push'](_0x1e54a2['shift']());}};_0x5ed556(++_0x2d8fd5);}(_0x05be,0xf9));var _0xe05b=function(_0x14d857,_0x28f91f){_0x14d857=_0x14d857-0x0;var _0x31ae29=_0x05be[_0x14d857];return _0x31ae29;};'use strict';var _=require('lodash');var util=require(_0xe05b('0x0'));var logger=require(_0xe05b('0x1'))('api');var moment=require(_0xe05b('0x2'));var BPromise=require('bluebird');var rp=require(_0xe05b('0x3'));var fs=require('fs');var path=require(_0xe05b('0x4'));var rimraf=require('rimraf');var config=require(_0xe05b('0x5'));var attributes=require(_0xe05b('0x6'));module[_0xe05b('0x7')]=function(_0x54f638,_0x8c7a1e){return _0x54f638[_0xe05b('0x8')]('Dashboard',attributes,{'tableName':_0xe05b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x87fa=['../../config/environment','./dashboard.attributes','exports','define','dashboards','lodash','api','request-promise','path'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0x87fa,0xe6));var _0xa87f=function(_0x30415c,_0x301785){_0x30415c=_0x30415c-0x0;var _0x57b497=_0x87fa[_0x30415c];return _0x57b497;};'use strict';var _=require(_0xa87f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa87f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa87f('0x2'));var fs=require('fs');var path=require(_0xa87f('0x3'));var rimraf=require('rimraf');var config=require(_0xa87f('0x4'));var attributes=require(_0xa87f('0x5'));module[_0xa87f('0x6')]=function(_0x36bd33,_0x1385df){return _0x36bd33[_0xa87f('0x7')]('Dashboard',attributes,{'tableName':_0xa87f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f903a7a..3d990a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x116d=['redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x438ad7,_0x4ed557){var _0x5eca56=function(_0x3a7c67){while(--_0x3a7c67){_0x438ad7['push'](_0x438ad7['shift']());}};_0x5eca56(++_0x4ed557);}(_0x116d,0x16d));var _0xd116=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x116d[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xd116('0x0'));var util=require(_0xd116('0x1'));var moment=require(_0xd116('0x2'));var BPromise=require(_0xd116('0x3'));var rs=require(_0xd116('0x4'));var fs=require('fs');var Redis=require(_0xd116('0x5'));var db=require(_0xd116('0x6'))['db'];var utils=require(_0xd116('0x7'));var logger=require('../../config/logger')(_0xd116('0x8'));var config=require(_0xd116('0x9'));var jayson=require(_0xd116('0xa'));var client=jayson['client'][_0xd116('0xb')]({'port':0x232a});config[_0xd116('0xc')]=_[_0xd116('0xd')](config[_0xd116('0xc')],{'host':_0xd116('0xe'),'port':0x18eb});var socket=require(_0xd116('0xf'))(new Redis(config[_0xd116('0xc')]));require(_0xd116('0x10'))[_0xd116('0x11')](socket);function respondWithRpcPromise(_0x21ed6b,_0x24a5b6,_0x6ae3f5){return new BPromise(function(_0x5ef24c,_0x2325a7){return client[_0xd116('0x12')](_0x21ed6b,_0x6ae3f5)['then'](function(_0x4d1c26){logger[_0xd116('0x13')](_0xd116('0x14'),_0x24a5b6,_0xd116('0x15'));logger[_0xd116('0x16')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x24a5b6,_0xd116('0x15'),JSON[_0xd116('0x17')](_0x4d1c26));if(_0x4d1c26[_0xd116('0x18')]){if(_0x4d1c26['error'][_0xd116('0x19')]===0x1f4){logger['error'](_0xd116('0x14'),_0x24a5b6,_0x4d1c26['error'][_0xd116('0x1a')]);return _0x2325a7(_0x4d1c26[_0xd116('0x18')]['message']);}logger[_0xd116('0x18')]('Dashboard,\x20%s,\x20%s',_0x24a5b6,_0x4d1c26[_0xd116('0x18')][_0xd116('0x1a')]);return _0x5ef24c(_0x4d1c26[_0xd116('0x18')][_0xd116('0x1a')]);}else{logger[_0xd116('0x13')]('Dashboard,\x20%s,\x20%s',_0x24a5b6,_0xd116('0x15'));_0x5ef24c(_0x4d1c26[_0xd116('0x1b')][_0xd116('0x1a')]);}})[_0xd116('0x1c')](function(_0x34cc7f){logger['error'](_0xd116('0x14'),_0x24a5b6,_0x34cc7f);_0x2325a7(_0x34cc7f);});});}
\ No newline at end of file
+var _0x4549=['message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x583b88,_0x7731f0){var _0x1471fe=function(_0x2f63a4){while(--_0x2f63a4){_0x583b88['push'](_0x583b88['shift']());}};_0x1471fe(++_0x7731f0);}(_0x4549,0x1cb));var _0x9454=function(_0x275ab8,_0x312b5c){_0x275ab8=_0x275ab8-0x0;var _0x238abf=_0x4549[_0x275ab8];return _0x238abf;};'use strict';var _=require('lodash');var util=require(_0x9454('0x0'));var moment=require(_0x9454('0x1'));var BPromise=require('bluebird');var rs=require(_0x9454('0x2'));var fs=require('fs');var Redis=require(_0x9454('0x3'));var db=require(_0x9454('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9454('0x5'));var config=require(_0x9454('0x6'));var jayson=require(_0x9454('0x7'));var client=jayson[_0x9454('0x8')]['http']({'port':0x232a});config[_0x9454('0x9')]=_[_0x9454('0xa')](config[_0x9454('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9454('0x9')]));require('./dashboard.socket')[_0x9454('0xb')](socket);function respondWithRpcPromise(_0x1e37ef,_0x2f50da,_0x101a85){return new BPromise(function(_0x5e8458,_0x52f21f){return client[_0x9454('0xc')](_0x1e37ef,_0x101a85)[_0x9454('0xd')](function(_0x52437a){logger[_0x9454('0xe')](_0x9454('0xf'),_0x2f50da,_0x9454('0x10'));logger[_0x9454('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x2f50da,_0x9454('0x10'),JSON[_0x9454('0x12')](_0x52437a));if(_0x52437a[_0x9454('0x13')]){if(_0x52437a[_0x9454('0x13')][_0x9454('0x14')]===0x1f4){logger[_0x9454('0x13')](_0x9454('0xf'),_0x2f50da,_0x52437a[_0x9454('0x13')]['message']);return _0x52f21f(_0x52437a[_0x9454('0x13')][_0x9454('0x15')]);}logger[_0x9454('0x13')](_0x9454('0xf'),_0x2f50da,_0x52437a[_0x9454('0x13')][_0x9454('0x15')]);return _0x5e8458(_0x52437a['error'][_0x9454('0x15')]);}else{logger[_0x9454('0xe')](_0x9454('0xf'),_0x2f50da,'request\x20sent');_0x5e8458(_0x52437a[_0x9454('0x16')]['message']);}})[_0x9454('0x17')](function(_0xf55cf7){logger[_0x9454('0x13')](_0x9454('0xf'),_0x2f50da,_0xf55cf7);_0x52f21f(_0xf55cf7);});});}
\ No newline at end of file
index 5d98139..3ed6576 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc561=['update','emit','removeListener','save'];(function(_0x4471ff,_0x4bb7de){var _0xe723ca=function(_0xf3cc76){while(--_0xf3cc76){_0x4471ff['push'](_0x4471ff['shift']());}};_0xe723ca(++_0x4bb7de);}(_0xc561,0x1cf));var _0x1c56=function(_0x555aa9,_0x3a607f){_0x555aa9=_0x555aa9-0x0;var _0x20aecd=_0xc561[_0x555aa9];return _0x20aecd;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x1c56('0x0'),'remove',_0x1c56('0x1')];function createListener(_0x1e6e5b,_0x4059aa){return function(_0x27e1a6){_0x4059aa[_0x1c56('0x2')](_0x1e6e5b,_0x27e1a6);};}function removeListener(_0x443310,_0x9da537){return function(){DashboardEvents[_0x1c56('0x3')](_0x443310,_0x9da537);};}exports['register']=function(_0x58e99f){for(var _0x111e9e=0x0,_0xb50610=events['length'];_0x111e9e<_0xb50610;_0x111e9e++){var _0x841b76=events[_0x111e9e];var _0x3e1cdf=createListener('dashboard:'+_0x841b76,_0x58e99f);DashboardEvents['on'](_0x841b76,_0x3e1cdf);}};
\ No newline at end of file
+var _0xe9ea=['emit','removeListener','register','./dashboard.events','remove'];(function(_0x1c3f44,_0x3b9db4){var _0x1bc285=function(_0x4f1781){while(--_0x4f1781){_0x1c3f44['push'](_0x1c3f44['shift']());}};_0x1bc285(++_0x3b9db4);}(_0xe9ea,0x94));var _0xae9e=function(_0x4af903,_0x3a7a8a){_0x4af903=_0x4af903-0x0;var _0x570bad=_0xe9ea[_0x4af903];return _0x570bad;};'use strict';var DashboardEvents=require(_0xae9e('0x0'));var events=['save',_0xae9e('0x1'),'update'];function createListener(_0xc8dfc0,_0x2868ca){return function(_0x5bfe50){_0x2868ca[_0xae9e('0x2')](_0xc8dfc0,_0x5bfe50);};}function removeListener(_0xcd3205,_0x5f3288){return function(){DashboardEvents[_0xae9e('0x3')](_0xcd3205,_0x5f3288);};}exports[_0xae9e('0x4')]=function(_0xa1ae5c){for(var _0xc84e86=0x0,_0x6768e1=events['length'];_0xc84e86<_0x6768e1;_0xc84e86++){var _0x2a44c9=events[_0xc84e86];var _0x18967a=createListener('dashboard:'+_0x2a44c9,_0xa1ae5c);DashboardEvents['on'](_0x2a44c9,_0x18967a);}};
\ No newline at end of file
index 62b3808..b7b551d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/items','getItems','post','/:id/clone','clone','addItem','put','update','destroy','exports','path','connect-timeout'];(function(_0x4c2a02,_0x39c88b){var _0x14b7cc=function(_0x2e170c){while(--_0x2e170c){_0x4c2a02['push'](_0x4c2a02['shift']());}};_0x14b7cc(++_0x39c88b);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./dashboard.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49c4('0xd')](_0x49c4('0xe'),auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0xd')]('/:id/items',auth['isAuthenticated'](),controller[_0x49c4('0x10')]);router[_0x49c4('0x11')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x12')]);router['delete'](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);module[_0x49c4('0x14')]=router;
\ No newline at end of file
+var _0xb7e7=['addItem','put','update','delete','multer','path','express','../../components/auth/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','/:id/items','getItems','post','create','/:id/clone','clone'];(function(_0x4884a7,_0x18e38a){var _0x56b60e=function(_0x2ba8a3){while(--_0x2ba8a3){_0x4884a7['push'](_0x4884a7['shift']());}};_0x56b60e(++_0x18e38a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xb7e7[_0x5c9307];return _0x373e29;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xc')]);router['post'](_0x7b7e('0xd'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xe')]);router[_0x7b7e('0xb')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0x7'),auth['isAuthenticated'](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/:id',auth[_0x7b7e('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 026ceb8..3adb1f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0353=['stringify','INTEGER','#2196f3','sequelize','squel','lodash','STRING','TEXT','parse','attrs','setDataValue'];(function(_0x2146dc,_0x5736a0){var _0x958647=function(_0xca09d){while(--_0xca09d){_0x2146dc['push'](_0x2146dc['shift']());}};_0x958647(++_0x5736a0);}(_0x0353,0x1dc));var _0x3035=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x0353[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0x3035('0x0'));var squel=require(_0x3035('0x1'));var _=require(_0x3035('0x2'));module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3035('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3035('0x4')]('long'),'get':function(){try{return JSON[_0x3035('0x5')](this['getDataValue'](_0x3035('0x6')));}catch(_0xdd85d){return[];}},'set':function(_0xe74af0){try{this[_0x3035('0x7')](_0x3035('0x6'),JSON[_0x3035('0x8')](_0xe74af0));}catch(_0x3e68e5){this[_0x3035('0x7')](_0x3035('0x6'),JSON[_0x3035('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x3035('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3035('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x3035('0x9')]},'col':{'type':Sequelize[_0x3035('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3035('0x3')],'allowNull':![],'defaultValue':_0x3035('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3035('0x3')]}};
\ No newline at end of file
+var _0x7b9a=['INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','attrs','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b9a,0x16f));var _0xa7b9=function(_0x4ef30b,_0x2daf2f){_0x4ef30b=_0x4ef30b-0x0;var _0x4e9c95=_0x7b9a[_0x4ef30b];return _0x4e9c95;};'use strict';var Sequelize=require(_0xa7b9('0x0'));var squel=require(_0xa7b9('0x1'));var _=require(_0xa7b9('0x2'));module[_0xa7b9('0x3')]={'title':{'type':Sequelize[_0xa7b9('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xa7b9('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xa7b9('0x5')](_0xa7b9('0x6')),'get':function(){try{return JSON[_0xa7b9('0x7')](this['getDataValue'](_0xa7b9('0x8')));}catch(_0x593603){return[];}},'set':function(_0x21f6e3){try{this['setDataValue'](_0xa7b9('0x8'),JSON[_0xa7b9('0x9')](_0x21f6e3));}catch(_0x4bf621){this['setDataValue'](_0xa7b9('0x8'),JSON[_0xa7b9('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xa7b9('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xa7b9('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa7b9('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa7b9('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}};
\ No newline at end of file
index b4f4809..2f2b46f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4ea=['localhost','./dashboardItem.socket','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','error','stack','name','send','show','params','keys','DashboardItem','rawAttributes','query','model','intersection','fields','attributes','length','includeAll','include','merge','options','catch','find','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis'];(function(_0x156768,_0xc971a9){var _0x3715e9=function(_0x4487c9){while(--_0x4487c9){_0x156768['push'](_0x156768['shift']());}};_0x3715e9(++_0xc971a9);}(_0xa4ea,0x94));var _0xaa4e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa4ea[_0x139a3c];return _0x2b375b;};'use strict';var pdf=require(_0xaa4e('0x0'));var emlformat=require(_0xaa4e('0x1'));var rimraf=require(_0xaa4e('0x2'));var zipdir=require(_0xaa4e('0x3'));var jsonpatch=require(_0xaa4e('0x4'));var rp=require(_0xaa4e('0x5'));var moment=require('moment');var BPromise=require(_0xaa4e('0x6'));var Mustache=require(_0xaa4e('0x7'));var util=require(_0xaa4e('0x8'));var path=require('path');var sox=require(_0xaa4e('0x9'));var csv=require(_0xaa4e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaa4e('0xb'));var squel=require(_0xaa4e('0xc'));var crypto=require('crypto');var jsforce=require(_0xaa4e('0xd'));var deskjs=require(_0xaa4e('0xe'));var toCsv=require(_0xaa4e('0xa'));var querystring=require(_0xaa4e('0xf'));var Papa=require(_0xaa4e('0x10'));var Redis=require(_0xaa4e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa4e('0x12'));var hardwareService=require(_0xaa4e('0x13'));var logger=require(_0xaa4e('0x14'))(_0xaa4e('0x15'));var utils=require(_0xaa4e('0x16'));var config=require(_0xaa4e('0x17'));var db=require(_0xaa4e('0x18'))['db'];config['redis']=_['defaults'](config[_0xaa4e('0x19')],{'host':_0xaa4e('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa4e('0x19')]));require(_0xaa4e('0x1b'))['register'](socket);function respondWithStatusCode(_0x4dc35e,_0x464c0a){_0x464c0a=_0x464c0a||0xcc;return function(_0x6cb0f3){if(_0x6cb0f3){return _0x4dc35e[_0xaa4e('0x1c')](_0x464c0a);}return _0x4dc35e[_0xaa4e('0x1d')](_0x464c0a)[_0xaa4e('0x1e')]();};}function respondWithResult(_0x5146d0,_0x23a182){_0x23a182=_0x23a182||0xc8;return function(_0x27e3dc){if(_0x27e3dc){return _0x5146d0['status'](_0x23a182)[_0xaa4e('0x1f')](_0x27e3dc);}};}function respondWithFilteredResult(_0x41a4ea,_0x2caefd){return function(_0x404a53){if(_0x404a53){var _0x24d54b=_0x404a53[_0xaa4e('0x20')],_0x23bc2f=_0x2caefd[_0xaa4e('0x21')],_0x7e9706=_0x2caefd[_0xaa4e('0x21')]+_0x2caefd[_0xaa4e('0x22')],_0x384672;if(_0x7e9706>=_0x24d54b){_0x7e9706=_0x24d54b;_0x384672=0xc8;}else{_0x384672=0xce;}_0x41a4ea[_0xaa4e('0x1d')](_0x384672);return _0x41a4ea[_0xaa4e('0x23')]('Content-Range',_0x23bc2f+'-'+_0x7e9706+'/'+_0x24d54b)[_0xaa4e('0x1f')](_0x404a53);}return null;};}function patchUpdates(_0x3f3ee8){return function(_0x56a409){try{jsonpatch[_0xaa4e('0x24')](_0x56a409,_0x3f3ee8,!![]);}catch(_0x13944a){return BPromise[_0xaa4e('0x25')](_0x13944a);}return _0x56a409[_0xaa4e('0x26')]();};}function saveUpdates(_0x2bc6f4,_0x407e60){return function(_0x11195b){if(_0x11195b){return _0x11195b['update'](_0x2bc6f4)[_0xaa4e('0x27')](function(_0x10b1b2){return _0x10b1b2;});}return null;};}function removeEntity(_0x38f6b1,_0x5bcf5c){return function(_0x2567d0){if(_0x2567d0){return _0x2567d0[_0xaa4e('0x28')]()[_0xaa4e('0x27')](function(){_0x38f6b1[_0xaa4e('0x1d')](0xcc)[_0xaa4e('0x1e')]();});}};}function handleEntityNotFound(_0x3f5e3a,_0xb3d826){return function(_0x357d23){if(!_0x357d23){_0x3f5e3a[_0xaa4e('0x1c')](0x194);}return _0x357d23;};}function handleError(_0x4ee064,_0x1e7cd1){_0x1e7cd1=_0x1e7cd1||0x1f4;return function(_0x1d8102){logger[_0xaa4e('0x29')](_0x1d8102[_0xaa4e('0x2a')]);if(_0x1d8102[_0xaa4e('0x2b')]){delete _0x1d8102['name'];}_0x4ee064[_0xaa4e('0x1d')](_0x1e7cd1)[_0xaa4e('0x2c')](_0x1d8102);};}exports[_0xaa4e('0x2d')]=function(_0x2902d1,_0x3a78e0){var _0xfabb6a={'raw':![],'where':{'id':_0x2902d1[_0xaa4e('0x2e')]['id']}},_0xc7b928={};_0xc7b928['model']=_[_0xaa4e('0x2f')](db[_0xaa4e('0x30')][_0xaa4e('0x31')]);_0xc7b928[_0xaa4e('0x32')]=_[_0xaa4e('0x2f')](_0x2902d1['query']);_0xc7b928['filters']=_['intersection'](_0xc7b928[_0xaa4e('0x33')],_0xc7b928[_0xaa4e('0x32')]);_0xfabb6a['attributes']=_[_0xaa4e('0x34')](_0xc7b928[_0xaa4e('0x33')],qs[_0xaa4e('0x35')](_0x2902d1[_0xaa4e('0x32')][_0xaa4e('0x35')]));_0xfabb6a[_0xaa4e('0x36')]=_0xfabb6a[_0xaa4e('0x36')][_0xaa4e('0x37')]?_0xfabb6a['attributes']:_0xc7b928['model'];if(_0x2902d1[_0xaa4e('0x32')][_0xaa4e('0x38')]){_0xfabb6a[_0xaa4e('0x39')]=[{'all':!![]}];}_0xfabb6a=_[_0xaa4e('0x3a')]({},_0xfabb6a,_0x2902d1[_0xaa4e('0x3b')]);return db[_0xaa4e('0x30')]['find'](_0xfabb6a)['then'](handleEntityNotFound(_0x3a78e0,null))['then'](respondWithResult(_0x3a78e0,null))[_0xaa4e('0x3c')](handleError(_0x3a78e0,null));};exports['destroy']=function(_0x50cfcc,_0x441834){return db[_0xaa4e('0x30')][_0xaa4e('0x3d')]({'where':{'id':_0x50cfcc[_0xaa4e('0x2e')]['id']}})[_0xaa4e('0x27')](handleEntityNotFound(_0x441834,null))['then'](removeEntity(_0x441834,null))[_0xaa4e('0x3c')](handleError(_0x441834,null));};function widgetAttributes(_0x4e626f){try{switch(_0x4e626f['type']){case _0xaa4e('0x3e'):return[{'name':_0xaa4e('0x3f'),'value':_0x4e626f[_0xaa4e('0x3f')]||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f[_0xaa4e('0x40')][0x0]?_0x4e626f['attrs'][0x0][_0xaa4e('0x41')]:undefined)||'https://'}];case _0xaa4e('0x42'):return[{'name':_0xaa4e('0x43'),'value':_0x4e626f[_0xaa4e('0x43')]||(_0x4e626f['attrs']&&_0x4e626f[_0xaa4e('0x40')][0x0]?_0x4e626f[_0xaa4e('0x40')][0x0][_0xaa4e('0x41')]:undefined)||''}];case'clock':return[{'name':_0xaa4e('0x44'),'value':_0x4e626f[_0xaa4e('0x44')]||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f[_0xaa4e('0x40')][0x0]?_0x4e626f['attrs'][0x0][_0xaa4e('0x41')]:undefined)||_0xaa4e('0x45')},{'name':_0xaa4e('0x46'),'value':_0x4e626f[_0xaa4e('0x46')]||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f['attrs'][0x1]?_0x4e626f[_0xaa4e('0x40')][0x1][_0xaa4e('0x41')]:undefined)||_0xaa4e('0x47')},{'name':_0xaa4e('0x48'),'value':_0x4e626f['attrFontSize']||(_0x4e626f['attrs']&&_0x4e626f[_0xaa4e('0x40')][0x2]?_0x4e626f[_0xaa4e('0x40')][0x2]['value']:undefined)||0xc}];case _0xaa4e('0x49'):return[{'name':_0xaa4e('0x4a'),'value':_0x4e626f['attrMetric']||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f[_0xaa4e('0x40')][0x0]?_0x4e626f[_0xaa4e('0x40')][0x0][_0xaa4e('0x41')]:undefined)||_0xaa4e('0x4b')},{'name':_0xaa4e('0x4c'),'value':_0x4e626f[_0xaa4e('0x4c')]||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f[_0xaa4e('0x40')][0x1]?_0x4e626f[_0xaa4e('0x40')][0x1][_0xaa4e('0x41')]:undefined)||[]},{'name':_0xaa4e('0x48'),'value':_0x4e626f[_0xaa4e('0x48')]||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f['attrs'][0x2]?_0x4e626f['attrs'][0x2][_0xaa4e('0x41')]:undefined)||0x14}];case'multibar-chart':case _0xaa4e('0x4d'):return[{'name':_0xaa4e('0x4e'),'value':_0x4e626f[_0xaa4e('0x4e')]||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f[_0xaa4e('0x40')][0x0]?_0x4e626f[_0xaa4e('0x40')][0x0][_0xaa4e('0x41')]:undefined)||_0xaa4e('0x4b')},{'name':_0xaa4e('0x4f'),'value':_0x4e626f[_0xaa4e('0x4f')]||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f[_0xaa4e('0x40')][0x1]?_0x4e626f['attrs'][0x1][_0xaa4e('0x41')]:undefined)||null},{'name':_0xaa4e('0x50'),'value':_0x4e626f[_0xaa4e('0x50')]||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f[_0xaa4e('0x40')][0x2]?_0x4e626f[_0xaa4e('0x40')][0x2][_0xaa4e('0x41')]:undefined)||null},{'name':_0xaa4e('0x4c'),'value':_0x4e626f['attrVoiceQueues']||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f[_0xaa4e('0x40')][0x3]?_0x4e626f['attrs'][0x3][_0xaa4e('0x41')]:undefined)||[]}];case'web-report':return[{'name':_0xaa4e('0x51'),'type':_0x4e626f['reportType']||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f[_0xaa4e('0x40')][0x0]?_0x4e626f[_0xaa4e('0x40')][0x0]['type']:undefined)||null,'value':_0x4e626f['attrReport']||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f['attrs'][0x0]?_0x4e626f[_0xaa4e('0x40')][0x0]['value']:undefined)||null},{'name':_0xaa4e('0x52'),'value':_0x4e626f[_0xaa4e('0x52')]||(_0x4e626f[_0xaa4e('0x40')]&&_0x4e626f[_0xaa4e('0x40')][0x1]?_0x4e626f[_0xaa4e('0x40')][0x1][_0xaa4e('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x42fe36){logger[_0xaa4e('0x29')](_0xaa4e('0x53'),JSON[_0xaa4e('0x54')](_0x42fe36));return[];}}exports[_0xaa4e('0x55')]=function(_0x3d1db8,_0x486b41){if(_0x3d1db8['body']){_0x3d1db8[_0xaa4e('0x56')][_0xaa4e('0x40')]=widgetAttributes(_0x3d1db8[_0xaa4e('0x56')]);}return db[_0xaa4e('0x30')][_0xaa4e('0x55')](_0x3d1db8[_0xaa4e('0x56')],{})[_0xaa4e('0x27')](respondWithResult(_0x486b41,0xc9))[_0xaa4e('0x3c')](handleError(_0x486b41,null));};exports['update']=function(_0x4c618c,_0x2c89e6){if(_0x4c618c[_0xaa4e('0x56')]['id']){delete _0x4c618c['body']['id'];}_0x4c618c[_0xaa4e('0x56')][_0xaa4e('0x40')]=widgetAttributes(_0x4c618c['body']);return db[_0xaa4e('0x30')]['find']({'where':{'id':_0x4c618c[_0xaa4e('0x2e')]['id']}})[_0xaa4e('0x27')](handleEntityNotFound(_0x2c89e6,null))[_0xaa4e('0x27')](saveUpdates(_0x4c618c[_0xaa4e('0x56')],null))['then'](respondWithResult(_0x2c89e6,null))[_0xaa4e('0x3c')](handleError(_0x2c89e6,null));};
\ No newline at end of file
+var _0xca98=['register','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','query','intersection','attributes','fields','length','merge','find','catch','type','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./dashboardItem.socket'];(function(_0xa6a120,_0x18840b){var _0x429341=function(_0x12ff50){while(--_0x12ff50){_0xa6a120['push'](_0xa6a120['shift']());}};_0x429341(++_0x18840b);}(_0xca98,0xe3));var _0x8ca9=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xca98[_0x17928f];return _0x500b63;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8ca9('0x0'));var rimraf=require(_0x8ca9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ca9('0x2'));var rp=require(_0x8ca9('0x3'));var moment=require('moment');var BPromise=require(_0x8ca9('0x4'));var Mustache=require(_0x8ca9('0x5'));var util=require(_0x8ca9('0x6'));var path=require('path');var sox=require(_0x8ca9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8ca9('0x8'));var squel=require(_0x8ca9('0x9'));var crypto=require(_0x8ca9('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8ca9('0xb'));var toCsv=require(_0x8ca9('0xc'));var querystring=require('querystring');var Papa=require(_0x8ca9('0xd'));var Redis=require(_0x8ca9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8ca9('0xf'));var as=require(_0x8ca9('0x10'));var hardwareService=require(_0x8ca9('0x11'));var logger=require(_0x8ca9('0x12'))(_0x8ca9('0x13'));var utils=require('../../config/utils');var config=require(_0x8ca9('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x8ca9('0x15')],{'host':_0x8ca9('0x16'),'port':0x18eb});var socket=require(_0x8ca9('0x17'))(new Redis(config['redis']));require(_0x8ca9('0x18'))[_0x8ca9('0x19')](socket);function respondWithStatusCode(_0x578c84,_0x2eb729){_0x2eb729=_0x2eb729||0xcc;return function(_0x110aa0){if(_0x110aa0){return _0x578c84[_0x8ca9('0x1a')](_0x2eb729);}return _0x578c84[_0x8ca9('0x1b')](_0x2eb729)[_0x8ca9('0x1c')]();};}function respondWithResult(_0x12c4f3,_0x5ccc23){_0x5ccc23=_0x5ccc23||0xc8;return function(_0x4df736){if(_0x4df736){return _0x12c4f3[_0x8ca9('0x1b')](_0x5ccc23)['json'](_0x4df736);}};}function respondWithFilteredResult(_0x5e55cb,_0x585591){return function(_0x153aac){if(_0x153aac){var _0x24f2c9=_0x153aac[_0x8ca9('0x1d')],_0xd782=_0x585591[_0x8ca9('0x1e')],_0x5a9445=_0x585591[_0x8ca9('0x1e')]+_0x585591['limit'],_0xfa1611;if(_0x5a9445>=_0x24f2c9){_0x5a9445=_0x24f2c9;_0xfa1611=0xc8;}else{_0xfa1611=0xce;}_0x5e55cb['status'](_0xfa1611);return _0x5e55cb[_0x8ca9('0x1f')](_0x8ca9('0x20'),_0xd782+'-'+_0x5a9445+'/'+_0x24f2c9)['json'](_0x153aac);}return null;};}function patchUpdates(_0x4a6565){return function(_0x240c6c){try{jsonpatch[_0x8ca9('0x21')](_0x240c6c,_0x4a6565,!![]);}catch(_0x3565d1){return BPromise[_0x8ca9('0x22')](_0x3565d1);}return _0x240c6c[_0x8ca9('0x23')]();};}function saveUpdates(_0x214b4,_0x123aba){return function(_0x34eed2){if(_0x34eed2){return _0x34eed2[_0x8ca9('0x24')](_0x214b4)[_0x8ca9('0x25')](function(_0x5bdd47){return _0x5bdd47;});}return null;};}function removeEntity(_0x2245f5,_0x3377a3){return function(_0x7153ea){if(_0x7153ea){return _0x7153ea[_0x8ca9('0x26')]()[_0x8ca9('0x25')](function(){_0x2245f5[_0x8ca9('0x1b')](0xcc)[_0x8ca9('0x1c')]();});}};}function handleEntityNotFound(_0x5abd46,_0x2ffb08){return function(_0x4bd061){if(!_0x4bd061){_0x5abd46[_0x8ca9('0x1a')](0x194);}return _0x4bd061;};}function handleError(_0x10c2ab,_0x5112e2){_0x5112e2=_0x5112e2||0x1f4;return function(_0x4f3c6b){logger[_0x8ca9('0x27')](_0x4f3c6b[_0x8ca9('0x28')]);if(_0x4f3c6b['name']){delete _0x4f3c6b[_0x8ca9('0x29')];}_0x10c2ab[_0x8ca9('0x1b')](_0x5112e2)[_0x8ca9('0x2a')](_0x4f3c6b);};}exports[_0x8ca9('0x2b')]=function(_0xf2ab47,_0x1c9a1a){var _0x560a08={'raw':![],'where':{'id':_0xf2ab47[_0x8ca9('0x2c')]['id']}},_0x184348={};_0x184348[_0x8ca9('0x2d')]=_[_0x8ca9('0x2e')](db[_0x8ca9('0x2f')]['rawAttributes']);_0x184348[_0x8ca9('0x30')]=_['keys'](_0xf2ab47['query']);_0x184348['filters']=_[_0x8ca9('0x31')](_0x184348[_0x8ca9('0x2d')],_0x184348[_0x8ca9('0x30')]);_0x560a08[_0x8ca9('0x32')]=_[_0x8ca9('0x31')](_0x184348[_0x8ca9('0x2d')],qs[_0x8ca9('0x33')](_0xf2ab47[_0x8ca9('0x30')][_0x8ca9('0x33')]));_0x560a08[_0x8ca9('0x32')]=_0x560a08[_0x8ca9('0x32')][_0x8ca9('0x34')]?_0x560a08[_0x8ca9('0x32')]:_0x184348[_0x8ca9('0x2d')];if(_0xf2ab47[_0x8ca9('0x30')]['includeAll']){_0x560a08['include']=[{'all':!![]}];}_0x560a08=_[_0x8ca9('0x35')]({},_0x560a08,_0xf2ab47['options']);return db[_0x8ca9('0x2f')][_0x8ca9('0x36')](_0x560a08)['then'](handleEntityNotFound(_0x1c9a1a,null))[_0x8ca9('0x25')](respondWithResult(_0x1c9a1a,null))['catch'](handleError(_0x1c9a1a,null));};exports['destroy']=function(_0x19201d,_0x285ab1){return db[_0x8ca9('0x2f')][_0x8ca9('0x36')]({'where':{'id':_0x19201d['params']['id']}})[_0x8ca9('0x25')](handleEntityNotFound(_0x285ab1,null))[_0x8ca9('0x25')](removeEntity(_0x285ab1,null))[_0x8ca9('0x37')](handleError(_0x285ab1,null));};function widgetAttributes(_0x501281){try{switch(_0x501281[_0x8ca9('0x38')]){case'iframe':return[{'name':_0x8ca9('0x39'),'value':_0x501281['attrUrl']||(_0x501281[_0x8ca9('0x3a')]&&_0x501281[_0x8ca9('0x3a')][0x0]?_0x501281[_0x8ca9('0x3a')][0x0][_0x8ca9('0x3b')]:undefined)||_0x8ca9('0x3c')}];case'custom':return[{'name':_0x8ca9('0x3d'),'value':_0x501281[_0x8ca9('0x3d')]||(_0x501281[_0x8ca9('0x3a')]&&_0x501281[_0x8ca9('0x3a')][0x0]?_0x501281[_0x8ca9('0x3a')][0x0]['value']:undefined)||''}];case _0x8ca9('0x3e'):return[{'name':_0x8ca9('0x3f'),'value':_0x501281['attrHourFormat']||(_0x501281[_0x8ca9('0x3a')]&&_0x501281[_0x8ca9('0x3a')][0x0]?_0x501281[_0x8ca9('0x3a')][0x0][_0x8ca9('0x3b')]:undefined)||_0x8ca9('0x40')},{'name':_0x8ca9('0x41'),'value':_0x501281['attrTimezone']||(_0x501281[_0x8ca9('0x3a')]&&_0x501281[_0x8ca9('0x3a')][0x1]?_0x501281[_0x8ca9('0x3a')][0x1][_0x8ca9('0x3b')]:undefined)||_0x8ca9('0x42')},{'name':'attrFontSize','value':_0x501281[_0x8ca9('0x43')]||(_0x501281[_0x8ca9('0x3a')]&&_0x501281[_0x8ca9('0x3a')][0x2]?_0x501281[_0x8ca9('0x3a')][0x2][_0x8ca9('0x3b')]:undefined)||0xc}];case _0x8ca9('0x44'):return[{'name':'attrMetric','value':_0x501281[_0x8ca9('0x45')]||(_0x501281[_0x8ca9('0x3a')]&&_0x501281[_0x8ca9('0x3a')][0x0]?_0x501281['attrs'][0x0][_0x8ca9('0x3b')]:undefined)||_0x8ca9('0x46')},{'name':_0x8ca9('0x47'),'value':_0x501281[_0x8ca9('0x47')]||(_0x501281['attrs']&&_0x501281[_0x8ca9('0x3a')][0x1]?_0x501281[_0x8ca9('0x3a')][0x1]['value']:undefined)||[]},{'name':_0x8ca9('0x43'),'value':_0x501281[_0x8ca9('0x43')]||(_0x501281[_0x8ca9('0x3a')]&&_0x501281['attrs'][0x2]?_0x501281[_0x8ca9('0x3a')][0x2][_0x8ca9('0x3b')]:undefined)||0x14}];case _0x8ca9('0x48'):case'pie-chart':return[{'name':_0x8ca9('0x49'),'value':_0x501281[_0x8ca9('0x49')]||(_0x501281[_0x8ca9('0x3a')]&&_0x501281[_0x8ca9('0x3a')][0x0]?_0x501281[_0x8ca9('0x3a')][0x0][_0x8ca9('0x3b')]:undefined)||_0x8ca9('0x46')},{'name':_0x8ca9('0x4a'),'value':_0x501281[_0x8ca9('0x4a')]||(_0x501281[_0x8ca9('0x3a')]&&_0x501281[_0x8ca9('0x3a')][0x1]?_0x501281[_0x8ca9('0x3a')][0x1][_0x8ca9('0x3b')]:undefined)||null},{'name':_0x8ca9('0x4b'),'value':_0x501281[_0x8ca9('0x4b')]||(_0x501281[_0x8ca9('0x3a')]&&_0x501281[_0x8ca9('0x3a')][0x2]?_0x501281[_0x8ca9('0x3a')][0x2][_0x8ca9('0x3b')]:undefined)||null},{'name':_0x8ca9('0x47'),'value':_0x501281[_0x8ca9('0x47')]||(_0x501281['attrs']&&_0x501281[_0x8ca9('0x3a')][0x3]?_0x501281['attrs'][0x3][_0x8ca9('0x3b')]:undefined)||[]}];case _0x8ca9('0x4c'):return[{'name':'attrReport','type':_0x501281[_0x8ca9('0x4d')]||(_0x501281[_0x8ca9('0x3a')]&&_0x501281['attrs'][0x0]?_0x501281['attrs'][0x0]['type']:undefined)||null,'value':_0x501281[_0x8ca9('0x4e')]||(_0x501281[_0x8ca9('0x3a')]&&_0x501281['attrs'][0x0]?_0x501281[_0x8ca9('0x3a')][0x0][_0x8ca9('0x3b')]:undefined)||null},{'name':_0x8ca9('0x4f'),'value':_0x501281[_0x8ca9('0x4f')]||(_0x501281[_0x8ca9('0x3a')]&&_0x501281[_0x8ca9('0x3a')][0x1]?_0x501281['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x493f30){logger[_0x8ca9('0x27')](_0x8ca9('0x50'),JSON[_0x8ca9('0x51')](_0x493f30));return[];}}exports['create']=function(_0x11abfa,_0x2ad27f){if(_0x11abfa[_0x8ca9('0x52')]){_0x11abfa[_0x8ca9('0x52')][_0x8ca9('0x3a')]=widgetAttributes(_0x11abfa[_0x8ca9('0x52')]);}return db['DashboardItem'][_0x8ca9('0x53')](_0x11abfa['body'],{})['then'](respondWithResult(_0x2ad27f,0xc9))[_0x8ca9('0x37')](handleError(_0x2ad27f,null));};exports[_0x8ca9('0x24')]=function(_0x39975a,_0x2871a8){if(_0x39975a[_0x8ca9('0x52')]['id']){delete _0x39975a[_0x8ca9('0x52')]['id'];}_0x39975a[_0x8ca9('0x52')][_0x8ca9('0x3a')]=widgetAttributes(_0x39975a[_0x8ca9('0x52')]);return db[_0x8ca9('0x2f')][_0x8ca9('0x36')]({'where':{'id':_0x39975a[_0x8ca9('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2871a8,null))[_0x8ca9('0x25')](saveUpdates(_0x39975a[_0x8ca9('0x52')],null))['then'](respondWithResult(_0x2871a8,null))['catch'](handleError(_0x2871a8,null));};
\ No newline at end of file
index 79564d6..7312192 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99a3=['exports','events','../../mysqldb','DashboardItem','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x5f07a0,_0x197e17){var _0x1130b0=function(_0x5aa22c){while(--_0x5aa22c){_0x5f07a0['push'](_0x5f07a0['shift']());}};_0x1130b0(++_0x197e17);}(_0x99a3,0x14b));var _0x399a=function(_0x486404,_0x4ea3df){_0x486404=_0x486404-0x0;var _0x4643c7=_0x99a3[_0x486404];return _0x4643c7;};'use strict';var EventEmitter=require(_0x399a('0x0'));var DashboardItem=require(_0x399a('0x1'))['db'][_0x399a('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x399a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x399a('0x4'),'afterDestroy':_0x399a('0x5')};function emitEvent(_0x2e355f){return function(_0x4bf134,_0x438271,_0x4f61f8){DashboardItemEvents[_0x399a('0x6')](_0x2e355f+':'+_0x4bf134['id'],_0x4bf134);DashboardItemEvents[_0x399a('0x6')](_0x2e355f,_0x4bf134);_0x4f61f8(null);};}for(var e in events){if(events[_0x399a('0x7')](e)){var event=events[e];DashboardItem[_0x399a('0x8')](e,emitEvent(event));}}module[_0x399a('0x9')]=DashboardItemEvents;
\ No newline at end of file
+var _0x2308=['update','emit','hasOwnProperty','hook','events','../../mysqldb','save'];(function(_0x25e4b6,_0xe37877){var _0x41f733=function(_0x22d29b){while(--_0x22d29b){_0x25e4b6['push'](_0x25e4b6['shift']());}};_0x41f733(++_0xe37877);}(_0x2308,0x193));var _0x8230=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x2308[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require(_0x8230('0x0'));var DashboardItem=require(_0x8230('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8230('0x2'),'afterUpdate':_0x8230('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5732f5){return function(_0x2789a3,_0x2c4ecd,_0x3354c4){DashboardItemEvents[_0x8230('0x4')](_0x5732f5+':'+_0x2789a3['id'],_0x2789a3);DashboardItemEvents['emit'](_0x5732f5,_0x2789a3);_0x3354c4(null);};}for(var e in events){if(events[_0x8230('0x5')](e)){var event=events[e];DashboardItem[_0x8230('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
index 6f809e9..2b9e407 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca3e=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','lodash'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0xca3e,0xbf));var _0xeca3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xca3e[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xeca3('0x0'));var util=require(_0xeca3('0x1'));var logger=require(_0xeca3('0x2'))(_0xeca3('0x3'));var moment=require(_0xeca3('0x4'));var BPromise=require('bluebird');var rp=require(_0xeca3('0x5'));var fs=require('fs');var path=require(_0xeca3('0x6'));var rimraf=require(_0xeca3('0x7'));var config=require(_0xeca3('0x8'));var attributes=require(_0xeca3('0x9'));module[_0xeca3('0xa')]=function(_0x1210ff,_0x1082a4){return _0x1210ff['define'](_0xeca3('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4355=['bluebird','request-promise','path','./dashboardItem.attributes','exports','dashboard_items','lodash','util','../../config/logger','api','moment'];(function(_0xa452c4,_0x1ee154){var _0x5b9bbc=function(_0x4b679e){while(--_0x4b679e){_0xa452c4['push'](_0xa452c4['shift']());}};_0x5b9bbc(++_0x1ee154);}(_0x4355,0x19d));var _0x5435=function(_0x4ed546,_0x244bd0){_0x4ed546=_0x4ed546-0x0;var _0x10bfcc=_0x4355[_0x4ed546];return _0x10bfcc;};'use strict';var _=require(_0x5435('0x0'));var util=require(_0x5435('0x1'));var logger=require(_0x5435('0x2'))(_0x5435('0x3'));var moment=require(_0x5435('0x4'));var BPromise=require(_0x5435('0x5'));var rp=require(_0x5435('0x6'));var fs=require('fs');var path=require(_0x5435('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5435('0x8'));module[_0x5435('0x9')]=function(_0x4c83b5,_0x30ae1b){return _0x4c83b5['define']('DashboardItem',attributes,{'tableName':_0x5435('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0a48e85..e2ff68e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x404a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','request','request\x20sent','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x3fa70a,_0x2edd99){var _0x30175c=function(_0x46a062){while(--_0x46a062){_0x3fa70a['push'](_0x3fa70a['shift']());}};_0x30175c(++_0x2edd99);}(_0x404a,0x67));var _0xa404=function(_0x29306c,_0x56158d){_0x29306c=_0x29306c-0x0;var _0x105e1b=_0x404a[_0x29306c];return _0x105e1b;};'use strict';var _=require(_0xa404('0x0'));var util=require('util');var moment=require(_0xa404('0x1'));var BPromise=require('bluebird');var rs=require(_0xa404('0x2'));var fs=require('fs');var Redis=require(_0xa404('0x3'));var db=require(_0xa404('0x4'))['db'];var utils=require(_0xa404('0x5'));var logger=require(_0xa404('0x6'))(_0xa404('0x7'));var config=require('../../config/environment');var jayson=require(_0xa404('0x8'));var client=jayson[_0xa404('0x9')][_0xa404('0xa')]({'port':0x232a});config['redis']=_[_0xa404('0xb')](config[_0xa404('0xc')],{'host':_0xa404('0xd'),'port':0x18eb});var socket=require(_0xa404('0xe'))(new Redis(config[_0xa404('0xc')]));require(_0xa404('0xf'))['register'](socket);function respondWithRpcPromise(_0x474e76,_0x3c6f88,_0x178999){return new BPromise(function(_0x4abb91,_0x4af168){return client[_0xa404('0x10')](_0x474e76,_0x178999)['then'](function(_0x1b9e32){logger['info']('DashboardItem,\x20%s,\x20%s',_0x3c6f88,_0xa404('0x11'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x3c6f88,'request\x20sent',JSON[_0xa404('0x12')](_0x1b9e32));if(_0x1b9e32[_0xa404('0x13')]){if(_0x1b9e32['error'][_0xa404('0x14')]===0x1f4){logger[_0xa404('0x13')](_0xa404('0x15'),_0x3c6f88,_0x1b9e32[_0xa404('0x13')][_0xa404('0x16')]);return _0x4af168(_0x1b9e32[_0xa404('0x13')][_0xa404('0x16')]);}logger[_0xa404('0x13')](_0xa404('0x15'),_0x3c6f88,_0x1b9e32['error'][_0xa404('0x16')]);return _0x4abb91(_0x1b9e32['error'][_0xa404('0x16')]);}else{logger[_0xa404('0x17')](_0xa404('0x15'),_0x3c6f88,'request\x20sent');_0x4abb91(_0x1b9e32[_0xa404('0x18')]['message']);}})[_0xa404('0x19')](function(_0x152bba){logger[_0xa404('0x13')](_0xa404('0x15'),_0x3c6f88,_0x152bba);_0x4af168(_0x152bba);});});}
\ No newline at end of file
+var _0x4f31=['DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','info'];(function(_0x26ee83,_0x587e8d){var _0x3159a3=function(_0x38f13b){while(--_0x38f13b){_0x26ee83['push'](_0x26ee83['shift']());}};_0x3159a3(++_0x587e8d);}(_0x4f31,0x10d));var _0x14f3=function(_0x265f57,_0x5b0007){_0x265f57=_0x265f57-0x0;var _0x4fd8ce=_0x4f31[_0x265f57];return _0x4fd8ce;};'use strict';var _=require(_0x14f3('0x0'));var util=require(_0x14f3('0x1'));var moment=require(_0x14f3('0x2'));var BPromise=require(_0x14f3('0x3'));var rs=require(_0x14f3('0x4'));var fs=require('fs');var Redis=require(_0x14f3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x14f3('0x6'));var logger=require(_0x14f3('0x7'))('rpc');var config=require(_0x14f3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x14f3('0x9')][_0x14f3('0xa')]({'port':0x232a});config[_0x14f3('0xb')]=_['defaults'](config[_0x14f3('0xb')],{'host':_0x14f3('0xc'),'port':0x18eb});var socket=require(_0x14f3('0xd'))(new Redis(config[_0x14f3('0xb')]));require('./dashboardItem.socket')[_0x14f3('0xe')](socket);function respondWithRpcPromise(_0x1063df,_0x101314,_0x3abd1e){return new BPromise(function(_0x50db2d,_0x2fd49c){return client[_0x14f3('0xf')](_0x1063df,_0x3abd1e)['then'](function(_0x51bda2){logger[_0x14f3('0x10')](_0x14f3('0x11'),_0x101314,_0x14f3('0x12'));logger['debug'](_0x14f3('0x13'),_0x101314,_0x14f3('0x12'),JSON[_0x14f3('0x14')](_0x51bda2));if(_0x51bda2['error']){if(_0x51bda2['error'][_0x14f3('0x15')]===0x1f4){logger[_0x14f3('0x16')](_0x14f3('0x11'),_0x101314,_0x51bda2['error']['message']);return _0x2fd49c(_0x51bda2[_0x14f3('0x16')]['message']);}logger[_0x14f3('0x16')](_0x14f3('0x11'),_0x101314,_0x51bda2[_0x14f3('0x16')][_0x14f3('0x17')]);return _0x50db2d(_0x51bda2[_0x14f3('0x16')][_0x14f3('0x17')]);}else{logger['info'](_0x14f3('0x11'),_0x101314,'request\x20sent');_0x50db2d(_0x51bda2[_0x14f3('0x18')][_0x14f3('0x17')]);}})[_0x14f3('0x19')](function(_0x45d9ae){logger[_0x14f3('0x16')](_0x14f3('0x11'),_0x101314,_0x45d9ae);_0x2fd49c(_0x45d9ae);});});}
\ No newline at end of file
index 10750f6..55d7c04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe04=['remove','update','emit','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x426ab0,_0x13c67d){var _0x3bdb3d=function(_0x14f669){while(--_0x14f669){_0x426ab0['push'](_0x426ab0['shift']());}};_0x3bdb3d(++_0x13c67d);}(_0xbe04,0x133));var _0x4be0=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0xbe04[_0x5c6994];return _0x1d5c84;};'use strict';var DashboardItemEvents=require(_0x4be0('0x0'));var events=['save',_0x4be0('0x1'),_0x4be0('0x2')];function createListener(_0x5ba827,_0x4bee9f){return function(_0xf9479){_0x4bee9f[_0x4be0('0x3')](_0x5ba827,_0xf9479);};}function removeListener(_0x17572e,_0x116b97){return function(){DashboardItemEvents['removeListener'](_0x17572e,_0x116b97);};}exports[_0x4be0('0x4')]=function(_0x52b7d0){for(var _0xf8709f=0x0,_0x41d851=events[_0x4be0('0x5')];_0xf8709f<_0x41d851;_0xf8709f++){var _0x457e5d=events[_0xf8709f];var _0x11112e=createListener(_0x4be0('0x6')+_0x457e5d,_0x52b7d0);DashboardItemEvents['on'](_0x457e5d,_0x11112e);}};
\ No newline at end of file
+var _0xa518=['length','dashboardItem:','save','remove','emit','register'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xa518,0x1be));var _0x8a51=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0xa518[_0x95942];return _0x6d7f81;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x8a51('0x0'),_0x8a51('0x1'),'update'];function createListener(_0x1267f7,_0xa42468){return function(_0x2bf17e){_0xa42468[_0x8a51('0x2')](_0x1267f7,_0x2bf17e);};}function removeListener(_0x277a40,_0x1fe306){return function(){DashboardItemEvents['removeListener'](_0x277a40,_0x1fe306);};}exports[_0x8a51('0x3')]=function(_0x58585d){for(var _0x405bd6=0x0,_0x7f7e71=events[_0x8a51('0x4')];_0x405bd6<_0x7f7e71;_0x405bd6++){var _0x248c74=events[_0x405bd6];var _0xc343cf=createListener(_0x8a51('0x5')+_0x248c74,_0x58585d);DashboardItemEvents['on'](_0x248c74,_0xc343cf);}};
\ No newline at end of file
index 2758c5c..9718bae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x4c1ad8,_0x55e28d){var _0x2c617b=function(_0x5f80df){while(--_0x5f80df){_0x4c1ad8['push'](_0x4c1ad8['shift']());}};_0x2c617b(++_0x55e28d);}(_0x5fab,0x177));var _0xb5fa=function(_0x4e6eac,_0x3f4365){_0x4e6eac=_0x4e6eac-0x0;var _0x79f963=_0x5fab[_0x4e6eac];return _0x79f963;};'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 auth=require(_0xb5fa('0x5'));var interaction=require(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var controller=require(_0xb5fa('0x8'));router[_0xb5fa('0x9')](_0xb5fa('0xa'),auth[_0xb5fa('0xb')](),controller['show']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xc')]);router[_0xb5fa('0xd')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xe')]);router[_0xb5fa('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);module[_0xb5fa('0x11')]=router;
\ No newline at end of file
+var _0xdbf5=['../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','update','delete','exports','util','express','Router','../../components/auth/service'];(function(_0xa5ec7,_0x5f06b8){var _0x8f8100=function(_0x5a5864){while(--_0x5a5864){_0xa5ec7['push'](_0xa5ec7['shift']());}};_0x8f8100(++_0x5f06b8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x8d2c13,_0x2fab71){_0x8d2c13=_0x8d2c13-0x0;var _0x2c5530=_0xdbf5[_0x8d2c13];return _0x2c5530;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var auth=require(_0x5dbf('0x3'));var interaction=require(_0x5dbf('0x4'));var config=require(_0x5dbf('0x5'));var controller=require(_0x5dbf('0x6'));router[_0x5dbf('0x7')](_0x5dbf('0x8'),auth[_0x5dbf('0x9')](),controller[_0x5dbf('0xa')]);router[_0x5dbf('0xb')]('/',auth[_0x5dbf('0x9')](),controller[_0x5dbf('0xc')]);router['put'](_0x5dbf('0x8'),auth['isAuthenticated'](),controller[_0x5dbf('0xd')]);router[_0x5dbf('0xe')](_0x5dbf('0x8'),auth[_0x5dbf('0x9')](),controller['destroy']);module[_0x5dbf('0xf')]=router;
\ No newline at end of file
index a84a737..39be9b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0342=['exports','sequelize'];(function(_0x265b51,_0x4415ec){var _0x38cd6d=function(_0x3ec0d9){while(--_0x3ec0d9){_0x265b51['push'](_0x265b51['shift']());}};_0x38cd6d(++_0x4415ec);}(_0x0342,0xf5));var _0x2034=function(_0x486f1d,_0x90c2b5){_0x486f1d=_0x486f1d-0x0;var _0x5a2c2d=_0x0342[_0x486f1d];return _0x5a2c2d;};'use strict';var Sequelize=require(_0x2034('0x0'));module[_0x2034('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xd74f=['exports','STRING','sequelize'];(function(_0x357fea,_0x4b7932){var _0x2e52ee=function(_0x5c9862){while(--_0x5c9862){_0x357fea['push'](_0x357fea['shift']());}};_0x2e52ee(++_0x4b7932);}(_0xd74f,0x149));var _0xfd74=function(_0x2799b1,_0x14aa80){_0x2799b1=_0x2799b1-0x0;var _0x30d759=_0xd74f[_0x2799b1];return _0x30d759;};'use strict';var Sequelize=require(_0xfd74('0x0'));module[_0xfd74('0x1')]={'name':{'type':Sequelize[_0xfd74('0x2')],'allowNull':![]}};
\ No newline at end of file
index 3fd7d07..8e767fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a3e=['querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','update','then','get','Dispositions','UserProfileResource','destroy','error','name','send','index','Disposition','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','filter','merge','options','includeAll','include','rows','catch','params','length','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','desk.js'];(function(_0x1fbf22,_0x464e82){var _0x4849fc=function(_0x200b44){while(--_0x200b44){_0x1fbf22['push'](_0x1fbf22['shift']());}};_0x4849fc(++_0x464e82);}(_0x9a3e,0x1f3));var _0xe9a3=function(_0x2b71e1,_0x3f1f9e){_0x2b71e1=_0x2b71e1-0x0;var _0x27de10=_0x9a3e[_0x2b71e1];return _0x27de10;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe9a3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe9a3('0x1'));var rp=require(_0xe9a3('0x2'));var moment=require(_0xe9a3('0x3'));var BPromise=require(_0xe9a3('0x4'));var Mustache=require('mustache');var util=require(_0xe9a3('0x5'));var path=require(_0xe9a3('0x6'));var sox=require(_0xe9a3('0x7'));var csv=require(_0xe9a3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe9a3('0x9'));var squel=require('squel');var crypto=require(_0xe9a3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe9a3('0xb'));var toCsv=require(_0xe9a3('0x8'));var querystring=require(_0xe9a3('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe9a3('0xd'));var qs=require(_0xe9a3('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9a3('0xf'));var logger=require('../../config/logger')(_0xe9a3('0x10'));var utils=require('../../config/utils');var config=require(_0xe9a3('0x11'));var db=require(_0xe9a3('0x12'))['db'];function respondWithStatusCode(_0x216225,_0xdcaf7d){_0xdcaf7d=_0xdcaf7d||0xcc;return function(_0x175899){if(_0x175899){return _0x216225[_0xe9a3('0x13')](_0xdcaf7d);}return _0x216225[_0xe9a3('0x14')](_0xdcaf7d)[_0xe9a3('0x15')]();};}function respondWithResult(_0x26f968,_0x277b22){_0x277b22=_0x277b22||0xc8;return function(_0x4e3aca){if(_0x4e3aca){return _0x26f968[_0xe9a3('0x14')](_0x277b22)['json'](_0x4e3aca);}};}function respondWithFilteredResult(_0x3e7070,_0x524f75){return function(_0x264bbe){if(_0x264bbe){var _0x4c847f=_0x264bbe[_0xe9a3('0x16')],_0x1ae02a=_0x524f75[_0xe9a3('0x17')],_0x55ac03=_0x524f75[_0xe9a3('0x17')]+_0x524f75[_0xe9a3('0x18')],_0x562d26;if(_0x55ac03>=_0x4c847f){_0x55ac03=_0x4c847f;_0x562d26=0xc8;}else{_0x562d26=0xce;}_0x3e7070['status'](_0x562d26);return _0x3e7070['set'](_0xe9a3('0x19'),_0x1ae02a+'-'+_0x55ac03+'/'+_0x4c847f)[_0xe9a3('0x1a')](_0x264bbe);}return null;};}function patchUpdates(_0x34f571){return function(_0x1a23d1){try{jsonpatch['apply'](_0x1a23d1,_0x34f571,!![]);}catch(_0x4589e2){return BPromise[_0xe9a3('0x1b')](_0x4589e2);}return _0x1a23d1['save']();};}function saveUpdates(_0x35ce6a,_0x55cd75){return function(_0x1b3ff7){if(_0x1b3ff7){return _0x1b3ff7[_0xe9a3('0x1c')](_0x35ce6a)[_0xe9a3('0x1d')](function(_0x236fda){return _0x236fda;});}return null;};}function removeEntity(_0x3f5fb5,_0x5142c7){return function(_0x21cf65){if(_0x21cf65){return _0x21cf65['destroy']()[_0xe9a3('0x1d')](function(){var _0x18fc5c=_0x21cf65[_0xe9a3('0x1e')]({'plain':!![]});var _0x233b9a=_0xe9a3('0x1f');return db[_0xe9a3('0x20')][_0xe9a3('0x21')]({'where':{'type':_0x233b9a,'resourceId':_0x18fc5c['id']}})['then'](function(){return _0x21cf65;});})[_0xe9a3('0x1d')](function(){_0x3f5fb5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x300eba,_0x1dca40){return function(_0xbeb8ed){if(!_0xbeb8ed){_0x300eba[_0xe9a3('0x13')](0x194);}return _0xbeb8ed;};}function handleError(_0x4daf51,_0x36058f){_0x36058f=_0x36058f||0x1f4;return function(_0xdc428f){logger[_0xe9a3('0x22')](_0xdc428f['stack']);if(_0xdc428f[_0xe9a3('0x23')]){delete _0xdc428f[_0xe9a3('0x23')];}_0x4daf51['status'](_0x36058f)[_0xe9a3('0x24')](_0xdc428f);};}exports[_0xe9a3('0x25')]=function(_0x2b6510,_0xcbb41a){var _0x375372={},_0x39e46d={},_0x20cc97={'count':0x0,'rows':[]};var _0x583396=_['map'](db[_0xe9a3('0x26')][_0xe9a3('0x27')],function(_0x3e7049){return{'name':_0x3e7049[_0xe9a3('0x28')],'type':_0x3e7049[_0xe9a3('0x29')][_0xe9a3('0x2a')]};});_0x39e46d[_0xe9a3('0x2b')]=_[_0xe9a3('0x2c')](_0x583396,_0xe9a3('0x23'));_0x39e46d[_0xe9a3('0x2d')]=_[_0xe9a3('0x2e')](_0x2b6510[_0xe9a3('0x2d')]);_0x39e46d[_0xe9a3('0x2f')]=_[_0xe9a3('0x30')](_0x39e46d['model'],_0x39e46d[_0xe9a3('0x2d')]);_0x375372[_0xe9a3('0x31')]=_['intersection'](_0x39e46d[_0xe9a3('0x2b')],qs[_0xe9a3('0x32')](_0x2b6510[_0xe9a3('0x2d')][_0xe9a3('0x32')]));_0x375372[_0xe9a3('0x31')]=_0x375372[_0xe9a3('0x31')]['length']?_0x375372[_0xe9a3('0x31')]:_0x39e46d[_0xe9a3('0x2b')];if(!_0x2b6510['query'][_0xe9a3('0x33')]('nolimit')){_0x375372[_0xe9a3('0x18')]=qs[_0xe9a3('0x18')](_0x2b6510[_0xe9a3('0x2d')]['limit']);_0x375372[_0xe9a3('0x17')]=qs[_0xe9a3('0x17')](_0x2b6510[_0xe9a3('0x2d')]['offset']);}_0x375372[_0xe9a3('0x34')]=qs['sort'](_0x2b6510[_0xe9a3('0x2d')]['sort']);_0x375372[_0xe9a3('0x35')]=qs['filters'](_[_0xe9a3('0x36')](_0x2b6510[_0xe9a3('0x2d')],_0x39e46d[_0xe9a3('0x2f')]),_0x583396);if(_0x2b6510[_0xe9a3('0x2d')][_0xe9a3('0x37')]){_0x375372[_0xe9a3('0x35')]=_[_0xe9a3('0x38')](_0x375372['where'],{'$or':_[_0xe9a3('0x2c')](_0x583396,function(_0x4326be){if(_0x4326be['type']!=='VIRTUAL'){var _0x55c5b5={};_0x55c5b5[_0x4326be[_0xe9a3('0x23')]]={'$like':'%'+_0x2b6510[_0xe9a3('0x2d')][_0xe9a3('0x37')]+'%'};return _0x55c5b5;}})});}_0x375372=_[_0xe9a3('0x38')]({},_0x375372,_0x2b6510[_0xe9a3('0x39')]);var _0x1fe2b6={'where':_0x375372[_0xe9a3('0x35')]};return db[_0xe9a3('0x26')][_0xe9a3('0x16')](_0x1fe2b6)['then'](function(_0x3ae52b){_0x20cc97['count']=_0x3ae52b;if(_0x2b6510[_0xe9a3('0x2d')][_0xe9a3('0x3a')]){_0x375372[_0xe9a3('0x3b')]=[{'all':!![]}];}return db[_0xe9a3('0x26')]['findAll'](_0x375372);})[_0xe9a3('0x1d')](function(_0x4d72cd){_0x20cc97[_0xe9a3('0x3c')]=_0x4d72cd;return _0x20cc97;})[_0xe9a3('0x1d')](respondWithFilteredResult(_0xcbb41a,_0x375372))[_0xe9a3('0x3d')](handleError(_0xcbb41a,null));};exports['show']=function(_0x3fe114,_0x198729){var _0x425f27={'raw':!![],'where':{'id':_0x3fe114[_0xe9a3('0x3e')]['id']}},_0x52a339={};_0x52a339['model']=_[_0xe9a3('0x2e')](db[_0xe9a3('0x26')][_0xe9a3('0x27')]);_0x52a339['query']=_[_0xe9a3('0x2e')](_0x3fe114[_0xe9a3('0x2d')]);_0x52a339[_0xe9a3('0x2f')]=_[_0xe9a3('0x30')](_0x52a339[_0xe9a3('0x2b')],_0x52a339['query']);_0x425f27['attributes']=_[_0xe9a3('0x30')](_0x52a339['model'],qs[_0xe9a3('0x32')](_0x3fe114[_0xe9a3('0x2d')][_0xe9a3('0x32')]));_0x425f27['attributes']=_0x425f27[_0xe9a3('0x31')][_0xe9a3('0x3f')]?_0x425f27['attributes']:_0x52a339['model'];if(_0x3fe114[_0xe9a3('0x2d')]['includeAll']){_0x425f27['include']=[{'all':!![]}];}_0x425f27=_['merge']({},_0x425f27,_0x3fe114['options']);return db[_0xe9a3('0x26')]['find'](_0x425f27)['then'](handleEntityNotFound(_0x198729,null))[_0xe9a3('0x1d')](respondWithResult(_0x198729,null))[_0xe9a3('0x3d')](handleError(_0x198729,null));};exports[_0xe9a3('0x40')]=function(_0x30e1a1,_0x372f02){return db[_0xe9a3('0x26')][_0xe9a3('0x40')](_0x30e1a1['body'],{})['then'](function(_0x143e48){var _0x5f3773=_0x30e1a1['user'][_0xe9a3('0x1e')]({'plain':!![]});if(!_0x5f3773)throw new Error(_0xe9a3('0x41'));if(_0x5f3773[_0xe9a3('0x42')]==='user'){var _0x1554ab=_0x143e48[_0xe9a3('0x1e')]({'plain':!![]});var _0x523a93=_0xe9a3('0x1f');return db[_0xe9a3('0x43')][_0xe9a3('0x44')]({'where':{'name':_0x523a93,'userProfileId':_0x5f3773[_0xe9a3('0x45')]},'raw':!![]})[_0xe9a3('0x1d')](function(_0x27645b){if(_0x27645b&&_0x27645b[_0xe9a3('0x46')]===0x0){return db[_0xe9a3('0x20')][_0xe9a3('0x40')]({'name':_0x1554ab[_0xe9a3('0x23')],'resourceId':_0x1554ab['id'],'type':_0x27645b[_0xe9a3('0x23')],'sectionId':_0x27645b['id']},{})[_0xe9a3('0x1d')](function(){return _0x143e48;});}else{return _0x143e48;}})['catch'](function(_0x416af1){logger[_0xe9a3('0x22')](_0xe9a3('0x47'),_0x416af1);throw _0x416af1;});}return _0x143e48;})[_0xe9a3('0x1d')](respondWithResult(_0x372f02,0xc9))[_0xe9a3('0x3d')](handleError(_0x372f02,null));};exports[_0xe9a3('0x1c')]=function(_0x3ccc7f,_0x4466f7){if(_0x3ccc7f[_0xe9a3('0x48')]['id']){delete _0x3ccc7f[_0xe9a3('0x48')]['id'];}return db[_0xe9a3('0x26')][_0xe9a3('0x44')]({'where':{'id':_0x3ccc7f[_0xe9a3('0x3e')]['id']}})[_0xe9a3('0x1d')](handleEntityNotFound(_0x4466f7,null))['then'](saveUpdates(_0x3ccc7f[_0xe9a3('0x48')],null))[_0xe9a3('0x1d')](respondWithResult(_0x4466f7,null))[_0xe9a3('0x3d')](handleError(_0x4466f7,null));};exports[_0xe9a3('0x21')]=function(_0x1bc7e5,_0x369ab7){return db[_0xe9a3('0x26')]['find']({'where':{'id':_0x1bc7e5[_0xe9a3('0x3e')]['id']}})['then'](handleEntityNotFound(_0x369ab7,null))[_0xe9a3('0x1d')](removeEntity(_0x369ab7,null))[_0xe9a3('0x3d')](handleError(_0x369ab7,null));};
\ No newline at end of file
+var _0xa9de=['catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','set','Content-Range','apply','reject','save','update','then','Dispositions','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','Disposition','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','find'];(function(_0x335396,_0xe997b2){var _0x2312f6=function(_0x2fc693){while(--_0x2fc693){_0x335396['push'](_0x335396['shift']());}};_0x2312f6(++_0xe997b2);}(_0xa9de,0xf2));var _0xea9d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa9de[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require(_0xea9d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xea9d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xea9d('0x2'));var BPromise=require(_0xea9d('0x3'));var Mustache=require(_0xea9d('0x4'));var util=require(_0xea9d('0x5'));var path=require(_0xea9d('0x6'));var sox=require(_0xea9d('0x7'));var csv=require(_0xea9d('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xea9d('0x9'));var squel=require(_0xea9d('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xea9d('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xea9d('0xc'));var Redis=require(_0xea9d('0xd'));var authService=require(_0xea9d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xea9d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea9d('0x10'))(_0xea9d('0x11'));var utils=require(_0xea9d('0x12'));var config=require(_0xea9d('0x13'));var db=require(_0xea9d('0x14'))['db'];function respondWithStatusCode(_0x395389,_0xf50a0){_0xf50a0=_0xf50a0||0xcc;return function(_0x3385d9){if(_0x3385d9){return _0x395389['sendStatus'](_0xf50a0);}return _0x395389[_0xea9d('0x15')](_0xf50a0)['end']();};}function respondWithResult(_0x1dd625,_0x4f925a){_0x4f925a=_0x4f925a||0xc8;return function(_0x53fd51){if(_0x53fd51){return _0x1dd625[_0xea9d('0x15')](_0x4f925a)[_0xea9d('0x16')](_0x53fd51);}};}function respondWithFilteredResult(_0x444e0e,_0x5858cb){return function(_0x3d1d7f){if(_0x3d1d7f){var _0x5de774=_0x3d1d7f['count'],_0x2a227e=_0x5858cb[_0xea9d('0x17')],_0x1e576b=_0x5858cb[_0xea9d('0x17')]+_0x5858cb['limit'],_0x3f063b;if(_0x1e576b>=_0x5de774){_0x1e576b=_0x5de774;_0x3f063b=0xc8;}else{_0x3f063b=0xce;}_0x444e0e[_0xea9d('0x15')](_0x3f063b);return _0x444e0e[_0xea9d('0x18')](_0xea9d('0x19'),_0x2a227e+'-'+_0x1e576b+'/'+_0x5de774)[_0xea9d('0x16')](_0x3d1d7f);}return null;};}function patchUpdates(_0x5d8f07){return function(_0x34e062){try{jsonpatch[_0xea9d('0x1a')](_0x34e062,_0x5d8f07,!![]);}catch(_0x28ea3e){return BPromise[_0xea9d('0x1b')](_0x28ea3e);}return _0x34e062[_0xea9d('0x1c')]();};}function saveUpdates(_0x5e1aba,_0x57dbf4){return function(_0x272c99){if(_0x272c99){return _0x272c99[_0xea9d('0x1d')](_0x5e1aba)['then'](function(_0x54da5f){return _0x54da5f;});}return null;};}function removeEntity(_0x282d95,_0x1e84fd){return function(_0xd8fce7){if(_0xd8fce7){return _0xd8fce7['destroy']()[_0xea9d('0x1e')](function(){var _0x40e2e6=_0xd8fce7['get']({'plain':!![]});var _0xb277d=_0xea9d('0x1f');return db[_0xea9d('0x20')][_0xea9d('0x21')]({'where':{'type':_0xb277d,'resourceId':_0x40e2e6['id']}})[_0xea9d('0x1e')](function(){return _0xd8fce7;});})[_0xea9d('0x1e')](function(){_0x282d95[_0xea9d('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50301e,_0x589566){return function(_0x4576d4){if(!_0x4576d4){_0x50301e[_0xea9d('0x22')](0x194);}return _0x4576d4;};}function handleError(_0x21582a,_0x6f6138){_0x6f6138=_0x6f6138||0x1f4;return function(_0xfe665b){logger[_0xea9d('0x23')](_0xfe665b[_0xea9d('0x24')]);if(_0xfe665b[_0xea9d('0x25')]){delete _0xfe665b[_0xea9d('0x25')];}_0x21582a[_0xea9d('0x15')](_0x6f6138)['send'](_0xfe665b);};}exports[_0xea9d('0x26')]=function(_0x287132,_0x115640){var _0xb969c4={},_0x201c61={},_0x1dacef={'count':0x0,'rows':[]};var _0x2d2178=_[_0xea9d('0x27')](db[_0xea9d('0x28')][_0xea9d('0x29')],function(_0x263f88){return{'name':_0x263f88[_0xea9d('0x2a')],'type':_0x263f88[_0xea9d('0x2b')]['key']};});_0x201c61[_0xea9d('0x2c')]=_[_0xea9d('0x27')](_0x2d2178,_0xea9d('0x25'));_0x201c61['query']=_[_0xea9d('0x2d')](_0x287132[_0xea9d('0x2e')]);_0x201c61[_0xea9d('0x2f')]=_[_0xea9d('0x30')](_0x201c61[_0xea9d('0x2c')],_0x201c61[_0xea9d('0x2e')]);_0xb969c4[_0xea9d('0x31')]=_[_0xea9d('0x30')](_0x201c61[_0xea9d('0x2c')],qs['fields'](_0x287132[_0xea9d('0x2e')][_0xea9d('0x32')]));_0xb969c4[_0xea9d('0x31')]=_0xb969c4[_0xea9d('0x31')][_0xea9d('0x33')]?_0xb969c4[_0xea9d('0x31')]:_0x201c61['model'];if(!_0x287132['query'][_0xea9d('0x34')]('nolimit')){_0xb969c4[_0xea9d('0x35')]=qs[_0xea9d('0x35')](_0x287132[_0xea9d('0x2e')]['limit']);_0xb969c4[_0xea9d('0x17')]=qs[_0xea9d('0x17')](_0x287132['query']['offset']);}_0xb969c4[_0xea9d('0x36')]=qs[_0xea9d('0x37')](_0x287132[_0xea9d('0x2e')][_0xea9d('0x37')]);_0xb969c4[_0xea9d('0x38')]=qs[_0xea9d('0x2f')](_[_0xea9d('0x39')](_0x287132[_0xea9d('0x2e')],_0x201c61[_0xea9d('0x2f')]),_0x2d2178);if(_0x287132[_0xea9d('0x2e')]['filter']){_0xb969c4[_0xea9d('0x38')]=_[_0xea9d('0x3a')](_0xb969c4[_0xea9d('0x38')],{'$or':_[_0xea9d('0x27')](_0x2d2178,function(_0x381278){if(_0x381278[_0xea9d('0x2b')]!==_0xea9d('0x3b')){var _0x3bde6e={};_0x3bde6e[_0x381278[_0xea9d('0x25')]]={'$like':'%'+_0x287132[_0xea9d('0x2e')][_0xea9d('0x3c')]+'%'};return _0x3bde6e;}})});}_0xb969c4=_[_0xea9d('0x3a')]({},_0xb969c4,_0x287132[_0xea9d('0x3d')]);var _0x254e91={'where':_0xb969c4[_0xea9d('0x38')]};return db[_0xea9d('0x28')][_0xea9d('0x3e')](_0x254e91)[_0xea9d('0x1e')](function(_0xa8af50){_0x1dacef[_0xea9d('0x3e')]=_0xa8af50;if(_0x287132['query'][_0xea9d('0x3f')]){_0xb969c4[_0xea9d('0x40')]=[{'all':!![]}];}return db[_0xea9d('0x28')][_0xea9d('0x41')](_0xb969c4);})[_0xea9d('0x1e')](function(_0x4c9951){_0x1dacef[_0xea9d('0x42')]=_0x4c9951;return _0x1dacef;})[_0xea9d('0x1e')](respondWithFilteredResult(_0x115640,_0xb969c4))['catch'](handleError(_0x115640,null));};exports[_0xea9d('0x43')]=function(_0x53e581,_0x36d2ac){var _0x24e677={'raw':!![],'where':{'id':_0x53e581[_0xea9d('0x44')]['id']}},_0x134978={};_0x134978[_0xea9d('0x2c')]=_[_0xea9d('0x2d')](db[_0xea9d('0x28')][_0xea9d('0x29')]);_0x134978[_0xea9d('0x2e')]=_[_0xea9d('0x2d')](_0x53e581['query']);_0x134978[_0xea9d('0x2f')]=_[_0xea9d('0x30')](_0x134978[_0xea9d('0x2c')],_0x134978[_0xea9d('0x2e')]);_0x24e677[_0xea9d('0x31')]=_[_0xea9d('0x30')](_0x134978[_0xea9d('0x2c')],qs[_0xea9d('0x32')](_0x53e581[_0xea9d('0x2e')][_0xea9d('0x32')]));_0x24e677['attributes']=_0x24e677[_0xea9d('0x31')][_0xea9d('0x33')]?_0x24e677['attributes']:_0x134978[_0xea9d('0x2c')];if(_0x53e581[_0xea9d('0x2e')]['includeAll']){_0x24e677[_0xea9d('0x40')]=[{'all':!![]}];}_0x24e677=_[_0xea9d('0x3a')]({},_0x24e677,_0x53e581[_0xea9d('0x3d')]);return db[_0xea9d('0x28')][_0xea9d('0x45')](_0x24e677)[_0xea9d('0x1e')](handleEntityNotFound(_0x36d2ac,null))[_0xea9d('0x1e')](respondWithResult(_0x36d2ac,null))[_0xea9d('0x46')](handleError(_0x36d2ac,null));};exports[_0xea9d('0x47')]=function(_0x56c608,_0x159765){return db[_0xea9d('0x28')][_0xea9d('0x47')](_0x56c608[_0xea9d('0x48')],{})[_0xea9d('0x1e')](function(_0x273b5a){var _0x346688=_0x56c608[_0xea9d('0x49')]['get']({'plain':!![]});if(!_0x346688)throw new Error(_0xea9d('0x4a'));if(_0x346688[_0xea9d('0x4b')]==='user'){var _0x5e416f=_0x273b5a['get']({'plain':!![]});var _0xa20c89=_0xea9d('0x1f');return db[_0xea9d('0x4c')][_0xea9d('0x45')]({'where':{'name':_0xa20c89,'userProfileId':_0x346688[_0xea9d('0x4d')]},'raw':!![]})['then'](function(_0x1a3961){if(_0x1a3961&&_0x1a3961['autoAssociation']===0x0){return db[_0xea9d('0x20')][_0xea9d('0x47')]({'name':_0x5e416f['name'],'resourceId':_0x5e416f['id'],'type':_0x1a3961[_0xea9d('0x25')],'sectionId':_0x1a3961['id']},{})['then'](function(){return _0x273b5a;});}else{return _0x273b5a;}})[_0xea9d('0x46')](function(_0x1526d9){logger[_0xea9d('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1526d9);throw _0x1526d9;});}return _0x273b5a;})[_0xea9d('0x1e')](respondWithResult(_0x159765,0xc9))[_0xea9d('0x46')](handleError(_0x159765,null));};exports[_0xea9d('0x1d')]=function(_0x5e1b84,_0x20d421){if(_0x5e1b84[_0xea9d('0x48')]['id']){delete _0x5e1b84[_0xea9d('0x48')]['id'];}return db[_0xea9d('0x28')]['find']({'where':{'id':_0x5e1b84['params']['id']}})[_0xea9d('0x1e')](handleEntityNotFound(_0x20d421,null))[_0xea9d('0x1e')](saveUpdates(_0x5e1b84[_0xea9d('0x48')],null))[_0xea9d('0x1e')](respondWithResult(_0x20d421,null))[_0xea9d('0x46')](handleError(_0x20d421,null));};exports[_0xea9d('0x21')]=function(_0x155d99,_0x38dc5c){return db[_0xea9d('0x28')][_0xea9d('0x45')]({'where':{'id':_0x155d99['params']['id']}})[_0xea9d('0x1e')](handleEntityNotFound(_0x38dc5c,null))['then'](removeEntity(_0x38dc5c,null))['catch'](handleError(_0x38dc5c,null));};
\ No newline at end of file
index d62d6c0..3e22452 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c67=['FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./disposition.attributes','exports','define','Disposition','name','ListId','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax'];(function(_0x56131c,_0x251b1f){var _0x40d1f0=function(_0x46d116){while(--_0x46d116){_0x56131c['push'](_0x56131c['shift']());}};_0x40d1f0(++_0x251b1f);}(_0x9c67,0xf5));var _0x79c6=function(_0x126a6f,_0x390a17){_0x126a6f=_0x126a6f-0x0;var _0x3988db=_0x9c67[_0x126a6f];return _0x3988db;};'use strict';var _=require('lodash');var util=require(_0x79c6('0x0'));var logger=require(_0x79c6('0x1'))(_0x79c6('0x2'));var moment=require(_0x79c6('0x3'));var BPromise=require(_0x79c6('0x4'));var rp=require(_0x79c6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79c6('0x6'));var config=require('../../config/environment');var attributes=require(_0x79c6('0x7'));module[_0x79c6('0x8')]=function(_0x56c8ea,_0x233e9d){return _0x56c8ea[_0x79c6('0x9')](_0x79c6('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x79c6('0xb'),_0x79c6('0xc')]},{'unique':!![],'name':_0x79c6('0xd'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0x79c6('0xe'),'fields':[_0x79c6('0xb'),_0x79c6('0xf')]},{'unique':!![],'name':_0x79c6('0x10'),'fields':['name',_0x79c6('0x11')]},{'unique':!![],'name':_0x79c6('0x12'),'fields':[_0x79c6('0xb'),_0x79c6('0x13')]},{'unique':!![],'name':_0x79c6('0x14'),'fields':[_0x79c6('0xb'),_0x79c6('0x15')]},{'unique':!![],'name':_0x79c6('0x16'),'fields':['name',_0x79c6('0x17')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b48=['rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name','ListId','name_chat','ChatWebsiteId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','../../config/logger','request-promise','path'];(function(_0x5eb65f,_0x2bae80){var _0x8ce18c=function(_0x2e3542){while(--_0x2e3542){_0x5eb65f['push'](_0x5eb65f['shift']());}};_0x8ce18c(++_0x2bae80);}(_0x6b48,0x115));var _0x86b4=function(_0x21dd37,_0x2f1ff9){_0x21dd37=_0x21dd37-0x0;var _0x4d4884=_0x6b48[_0x21dd37];return _0x4d4884;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x86b4('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86b4('0x1'));var fs=require('fs');var path=require(_0x86b4('0x2'));var rimraf=require(_0x86b4('0x3'));var config=require(_0x86b4('0x4'));var attributes=require(_0x86b4('0x5'));module[_0x86b4('0x6')]=function(_0x504f39,_0x3ca2fb){return _0x504f39['define'](_0x86b4('0x7'),attributes,{'tableName':_0x86b4('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x86b4('0x9'),_0x86b4('0xa')]},{'unique':!![],'name':_0x86b4('0xb'),'fields':[_0x86b4('0x9'),_0x86b4('0xc')]},{'unique':!![],'name':'name_mail','fields':[_0x86b4('0x9'),'MailAccountId']},{'unique':!![],'name':_0x86b4('0xd'),'fields':['name',_0x86b4('0xe')]},{'unique':!![],'name':_0x86b4('0xf'),'fields':[_0x86b4('0x9'),'FaxAccountId']},{'unique':!![],'name':_0x86b4('0x10'),'fields':[_0x86b4('0x9'),_0x86b4('0x11')]},{'unique':!![],'name':_0x86b4('0x12'),'fields':[_0x86b4('0x9'),_0x86b4('0x13')]}],'timestamps':!![]});};
\ No newline at end of file
index 6f33816..b163b3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6ee=['Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','Disposition,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0xaf365b,_0x3b1ee2){var _0x608a9d=function(_0x2f0ab7){while(--_0x2f0ab7){_0xaf365b['push'](_0xaf365b['shift']());}};_0x608a9d(++_0x3b1ee2);}(_0xb6ee,0x68));var _0xeb6e=function(_0x22e5af,_0x5c91f4){_0x22e5af=_0x22e5af-0x0;var _0x1a23ed=_0xb6ee[_0x22e5af];return _0x1a23ed;};'use strict';var _=require('lodash');var util=require(_0xeb6e('0x0'));var moment=require(_0xeb6e('0x1'));var BPromise=require(_0xeb6e('0x2'));var rs=require(_0xeb6e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb6e('0x4'))['db'];var utils=require(_0xeb6e('0x5'));var logger=require(_0xeb6e('0x6'))(_0xeb6e('0x7'));var config=require(_0xeb6e('0x8'));var jayson=require(_0xeb6e('0x9'));var client=jayson[_0xeb6e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x566bb8,_0x280daf,_0x210672){return new BPromise(function(_0xec67bc,_0x2c2c8a){return client[_0xeb6e('0xb')](_0x566bb8,_0x210672)[_0xeb6e('0xc')](function(_0x5c331a){logger[_0xeb6e('0xd')]('Disposition,\x20%s,\x20%s',_0x280daf,_0xeb6e('0xe'));logger[_0xeb6e('0xf')](_0xeb6e('0x10'),_0x280daf,_0xeb6e('0xe'),JSON[_0xeb6e('0x11')](_0x5c331a));if(_0x5c331a[_0xeb6e('0x12')]){if(_0x5c331a[_0xeb6e('0x12')][_0xeb6e('0x13')]===0x1f4){logger[_0xeb6e('0x12')](_0xeb6e('0x14'),_0x280daf,_0x5c331a['error'][_0xeb6e('0x15')]);return _0x2c2c8a(_0x5c331a[_0xeb6e('0x12')][_0xeb6e('0x15')]);}logger[_0xeb6e('0x12')](_0xeb6e('0x14'),_0x280daf,_0x5c331a['error'][_0xeb6e('0x15')]);return _0xec67bc(_0x5c331a[_0xeb6e('0x12')][_0xeb6e('0x15')]);}else{logger[_0xeb6e('0xd')](_0xeb6e('0x14'),_0x280daf,_0xeb6e('0xe'));_0xec67bc(_0x5c331a[_0xeb6e('0x16')][_0xeb6e('0x15')]);}})[_0xeb6e('0x17')](function(_0x3f9a6a){logger['error'](_0xeb6e('0x14'),_0x280daf,_0x3f9a6a);_0x2c2c8a(_0x3f9a6a);});});}
\ No newline at end of file
+var _0x5426=['../../config/logger','rpc','../../config/environment','http','request','info','Disposition,\x20%s,\x20%s','debug','Disposition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','../../mysqldb','../../config/utils'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x5426,0xb9));var _0x6542=function(_0x47ea14,_0x507869){_0x47ea14=_0x47ea14-0x0;var _0x1add3e=_0x5426[_0x47ea14];return _0x1add3e;};'use strict';var _=require(_0x6542('0x0'));var util=require(_0x6542('0x1'));var moment=require(_0x6542('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6542('0x3'))['db'];var utils=require(_0x6542('0x4'));var logger=require(_0x6542('0x5'))(_0x6542('0x6'));var config=require(_0x6542('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6542('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1208a7,_0x539955,_0x337530){return new BPromise(function(_0x5c676b,_0x39e9d4){return client[_0x6542('0x9')](_0x1208a7,_0x337530)['then'](function(_0x556033){logger[_0x6542('0xa')](_0x6542('0xb'),_0x539955,'request\x20sent');logger[_0x6542('0xc')](_0x6542('0xd'),_0x539955,_0x6542('0xe'),JSON['stringify'](_0x556033));if(_0x556033[_0x6542('0xf')]){if(_0x556033[_0x6542('0xf')][_0x6542('0x10')]===0x1f4){logger[_0x6542('0xf')]('Disposition,\x20%s,\x20%s',_0x539955,_0x556033[_0x6542('0xf')][_0x6542('0x11')]);return _0x39e9d4(_0x556033[_0x6542('0xf')][_0x6542('0x11')]);}logger[_0x6542('0xf')](_0x6542('0xb'),_0x539955,_0x556033[_0x6542('0xf')]['message']);return _0x5c676b(_0x556033[_0x6542('0xf')][_0x6542('0x11')]);}else{logger[_0x6542('0xa')](_0x6542('0xb'),_0x539955,'request\x20sent');_0x5c676b(_0x556033['result'][_0x6542('0x11')]);}})[_0x6542('0x12')](function(_0x5dc2ad){logger[_0x6542('0xf')](_0x6542('0xb'),_0x539955,_0x5dc2ad);_0x39e9d4(_0x5dc2ad);});});}
\ No newline at end of file
index bb44f53..53bd277 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe35d=['get','isAuthenticated','index','show','post','create','/:id','update','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller'];(function(_0x58b571,_0x585a32){var _0x32f892=function(_0x5ab55e){while(--_0x5ab55e){_0x58b571['push'](_0x58b571['shift']());}};_0x32f892(++_0x585a32);}(_0xe35d,0xd5));var _0xde35=function(_0x5edfc5,_0x1563ab){_0x5edfc5=_0x5edfc5-0x0;var _0x35a64a=_0xe35d[_0x5edfc5];return _0x35a64a;};'use strict';var multer=require(_0xde35('0x0'));var util=require(_0xde35('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xde35('0x2'));var router=express[_0xde35('0x3')]();var auth=require(_0xde35('0x4'));var interaction=require(_0xde35('0x5'));var config=require(_0xde35('0x6'));var controller=require(_0xde35('0x7'));router[_0xde35('0x8')]('/',auth[_0xde35('0x9')](),controller[_0xde35('0xa')]);router[_0xde35('0x8')]('/:id',auth[_0xde35('0x9')](),controller[_0xde35('0xb')]);router[_0xde35('0xc')]('/',auth[_0xde35('0x9')](),controller[_0xde35('0xd')]);router['put'](_0xde35('0xe'),auth[_0xde35('0x9')](),controller[_0xde35('0xf')]);router['delete'](_0xde35('0xe'),auth[_0xde35('0x9')](),controller['destroy']);module[_0xde35('0x10')]=router;
\ No newline at end of file
+var _0x79a3=['connect-timeout','Router','./disposition.controller','get','isAuthenticated','index','post','create','put','/:id','update','multer','path'];(function(_0x37bc6c,_0xd66a56){var _0x40dc8e=function(_0x280aab){while(--_0x280aab){_0x37bc6c['push'](_0x37bc6c['shift']());}};_0x40dc8e(++_0xd66a56);}(_0x79a3,0x80));var _0x379a=function(_0x207ade,_0x1f7561){_0x207ade=_0x207ade-0x0;var _0x52e3d0=_0x79a3[_0x207ade];return _0x52e3d0;};'use strict';var multer=require(_0x379a('0x0'));var util=require('util');var path=require(_0x379a('0x1'));var timeout=require(_0x379a('0x2'));var express=require('express');var router=express[_0x379a('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x379a('0x4'));router[_0x379a('0x5')]('/',auth[_0x379a('0x6')](),controller[_0x379a('0x7')]);router[_0x379a('0x5')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x379a('0x8')]('/',auth[_0x379a('0x6')](),controller[_0x379a('0x9')]);router[_0x379a('0xa')](_0x379a('0xb'),auth[_0x379a('0x6')](),controller[_0x379a('0xc')]);router['delete']('/:id',auth[_0x379a('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 1e76a54..dae2718 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4a0=['14400','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','exports','STRING','ENUM','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf4a0,0xf3));var _0x0f4a=function(_0x197043,_0x3ebf47){_0x197043=_0x197043-0x0;var _0x233e33=_0xf4a0[_0x197043];return _0x233e33;};'use strict';var Sequelize=require('sequelize');module[_0x0f4a('0x0')]={'name':{'type':Sequelize[_0x0f4a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0f4a('0x1')]},'ecm':{'type':Sequelize[_0x0f4a('0x2')]('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x0f4a('0x3')},'localstationid':{'type':Sequelize[_0x0f4a('0x1')],'unique':_0x0f4a('0x4')},'minrate':{'type':Sequelize[_0x0f4a('0x2')](_0x0f4a('0x5'),_0x0f4a('0x6'),_0x0f4a('0x7'),_0x0f4a('0x8'),_0x0f4a('0x9'),_0x0f4a('0xa')),'defaultValue':_0x0f4a('0x6')},'maxrate':{'type':Sequelize[_0x0f4a('0x2')](_0x0f4a('0x5'),_0x0f4a('0x6'),_0x0f4a('0x7'),_0x0f4a('0x8'),'12000',_0x0f4a('0xa')),'defaultValue':_0x0f4a('0xa')},'modem':{'type':Sequelize[_0x0f4a('0x1')],'defaultValue':_0x0f4a('0xb')},'gateway':{'type':Sequelize[_0x0f4a('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x0f4a('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x0f4a('0xd'),_0x0f4a('0xe'),'DADHI',_0x0f4a('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x0f4a('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0f4a('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x0f4a('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0f4a('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0f4a('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0f4a('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0f4a('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0f4a('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x0f4a('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0f4a('0x13'),'set':function(_0x334e20){if(!_0x334e20)this['setDataValue'](_0x0f4a('0x14'),null);this[_0x0f4a('0x15')](_0x0f4a('0x16'),_0x334e20);}}};
\ No newline at end of file
+var _0x0c2c=['4800','7200','9600','12000','14400','ENUM','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','2400'];(function(_0x1b6b99,_0x638d06){var _0x5485bd=function(_0x4f00c2){while(--_0x4f00c2){_0x1b6b99['push'](_0x1b6b99['shift']());}};_0x5485bd(++_0x638d06);}(_0x0c2c,0x1af));var _0xc0c2=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x0c2c[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0xc0c2('0x0'));module[_0xc0c2('0x1')]={'name':{'type':Sequelize[_0xc0c2('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM'](_0xc0c2('0x3'),'no'),'defaultValue':_0xc0c2('0x3')},'headerinfo':{'type':Sequelize[_0xc0c2('0x2')],'defaultValue':_0xc0c2('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM'](_0xc0c2('0x5'),_0xc0c2('0x6'),_0xc0c2('0x7'),_0xc0c2('0x8'),_0xc0c2('0x9'),_0xc0c2('0xa')),'defaultValue':_0xc0c2('0x6')},'maxrate':{'type':Sequelize[_0xc0c2('0xb')](_0xc0c2('0x5'),_0xc0c2('0x6'),_0xc0c2('0x7'),_0xc0c2('0x8'),_0xc0c2('0x9'),_0xc0c2('0xa')),'defaultValue':_0xc0c2('0xa')},'modem':{'type':Sequelize[_0xc0c2('0x2')],'defaultValue':_0xc0c2('0xc')},'gateway':{'type':Sequelize[_0xc0c2('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc0c2('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xc0c2('0xe'),_0xc0c2('0xf'),'DADHI',_0xc0c2('0x10')),'defaultValue':_0xc0c2('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc0c2('0x11')],'defaultValue':function(){return _0xc0c2('0x12');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc0c2('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc0c2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc0c2('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc0c2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc0c2('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc0c2('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc0c2('0x13')],'defaultValue':![],'comment':_0xc0c2('0x14'),'set':function(_0x11d6fc){if(!_0x11d6fc)this['setDataValue'](_0xc0c2('0x15'),null);this[_0xc0c2('0x16')]('mandatoryDisposition',_0x11d6fc);}}};
\ No newline at end of file
index d68d5c3..5ee3974 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dca=['maxrate','minrate','modem','t38timeout','FAXOPT(','Set','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','VoiceExtension','omit','createdAt','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','updatedAt','DESC','attachments','join','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','out','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','userFaxAccount:remove','emit','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','./faxAccount.socket','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','FaxAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','save','then','destroy','get','FaxAccounts','stack','name','send','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','rows','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','update','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','pick','options','findAll','removeDispositions','CannedAnswer','removeAnswers','ids','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','hasOwnProperty','getApplications','context','from-voip-provider','localstationid','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','ecm','gateway','faxdetect'];(function(_0x267eba,_0x24353e){var _0x464b25=function(_0x435e4f){while(--_0x435e4f){_0x267eba['push'](_0x267eba['shift']());}};_0x464b25(++_0x24353e);}(_0x1dca,0xea));var _0xa1dc=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x1dca[_0x5d6456];return _0x4d66c1;};'use strict';var pdf=require(_0xa1dc('0x0'));var emlformat=require(_0xa1dc('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa1dc('0x2'));var rp=require(_0xa1dc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1dc('0x4'));var util=require('util');var path=require(_0xa1dc('0x5'));var sox=require(_0xa1dc('0x6'));var csv=require(_0xa1dc('0x7'));var ejs=require(_0xa1dc('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa1dc('0x9'));var jsforce=require(_0xa1dc('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa1dc('0x7'));var querystring=require(_0xa1dc('0xb'));var Papa=require(_0xa1dc('0xc'));var Redis=require(_0xa1dc('0xd'));var authService=require(_0xa1dc('0xe'));var qs=require(_0xa1dc('0xf'));var as=require(_0xa1dc('0x10'));var hardwareService=require(_0xa1dc('0x11'));var logger=require(_0xa1dc('0x12'))(_0xa1dc('0x13'));var utils=require(_0xa1dc('0x14'));var config=require('../../config/environment');var db=require(_0xa1dc('0x15'))['db'];config[_0xa1dc('0x16')]=_['defaults'](config[_0xa1dc('0x16')],{'host':_0xa1dc('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1dc('0x16')]));require(_0xa1dc('0x18'))[_0xa1dc('0x19')](socket);var jayson=require(_0xa1dc('0x1a'));var client=jayson[_0xa1dc('0x1b')][_0xa1dc('0x1c')]({'port':0x232c});var client9002=jayson[_0xa1dc('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x4d4dfb,_0x5c44f3,_0x1703e5){if(_0x1703e5){var _0x28281e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28281e['test'](_0x5c44f3)){return _0x4d4dfb;}else{throw new db[(_0xa1dc('0x1d'))][(_0xa1dc('0x1e'))](_0xa1dc('0x1f'));}}else{return _0x4d4dfb;}}function respondWithRpcPromise(_0x132f51,_0xd5982f,_0x334fe4,_0x5a8bab){return new BPromise(function(_0x21a9af,_0x2f3130){var _0x15fd7e=_0x5a8bab||client;return _0x15fd7e[_0xa1dc('0x20')](_0x132f51,_0x334fe4)['then'](function(_0x408034){logger[_0xa1dc('0x21')]('FaxAccount,\x20%s,\x20%s',_0xd5982f,'request\x20sent');logger[_0xa1dc('0x22')](_0xa1dc('0x23'),_0xd5982f,'request\x20sent',JSON[_0xa1dc('0x24')](_0x408034));if(_0x408034[_0xa1dc('0x25')]){if(_0x408034['error']['code']===0x1f4){logger['error'](_0xa1dc('0x26'),_0xd5982f,_0x408034[_0xa1dc('0x25')]['message']);return _0x2f3130(_0x408034[_0xa1dc('0x25')][_0xa1dc('0x27')]);}logger[_0xa1dc('0x25')]('FaxAccount,\x20%s,\x20%s',_0xd5982f,_0x408034[_0xa1dc('0x25')]['message']);return _0x21a9af(_0x408034['error']['message']);}else{logger[_0xa1dc('0x21')](_0xa1dc('0x26'),_0xd5982f,_0xa1dc('0x28'));_0x21a9af(_0x408034[_0xa1dc('0x29')][_0xa1dc('0x27')]);}})[_0xa1dc('0x2a')](function(_0x287fe1){logger['error'](_0xa1dc('0x26'),_0xd5982f,_0x287fe1);_0x2f3130(_0x287fe1);});});}function respondWithStatusCode(_0x229c50,_0x266327){_0x266327=_0x266327||0xcc;return function(_0x103d57){if(_0x103d57){return _0x229c50[_0xa1dc('0x2b')](_0x266327);}return _0x229c50[_0xa1dc('0x2c')](_0x266327)[_0xa1dc('0x2d')]();};}function respondWithResult(_0x5a15e7,_0x5130c6){_0x5130c6=_0x5130c6||0xc8;return function(_0x254c3e){if(_0x254c3e){return _0x5a15e7[_0xa1dc('0x2c')](_0x5130c6)[_0xa1dc('0x2e')](_0x254c3e);}};}function respondWithFilteredResult(_0x4503df,_0x515e8d){return function(_0x535550){if(_0x535550){var _0x3a49c6=_0x535550[_0xa1dc('0x2f')],_0x5af157=_0x515e8d['offset'],_0x49d392=_0x515e8d[_0xa1dc('0x30')]+_0x515e8d['limit'],_0x2ade29;if(_0x49d392>=_0x3a49c6){_0x49d392=_0x3a49c6;_0x2ade29=0xc8;}else{_0x2ade29=0xce;}_0x4503df[_0xa1dc('0x2c')](_0x2ade29);return _0x4503df['set'](_0xa1dc('0x31'),_0x5af157+'-'+_0x49d392+'/'+_0x3a49c6)['json'](_0x535550);}return null;};}function patchUpdates(_0x4b8ed9){return function(_0x2321e6){try{jsonpatch[_0xa1dc('0x32')](_0x2321e6,_0x4b8ed9,!![]);}catch(_0x4e688c){return BPromise['reject'](_0x4e688c);}return _0x2321e6[_0xa1dc('0x33')]();};}function saveUpdates(_0x11232c,_0x5cf714){return function(_0x1d8aad){if(_0x1d8aad){return _0x1d8aad['update'](_0x11232c)[_0xa1dc('0x34')](function(_0x4421a3){return _0x4421a3;});}return null;};}function removeEntity(_0x45ae0d,_0x194702){return function(_0x1c6b02){if(_0x1c6b02){return _0x1c6b02[_0xa1dc('0x35')]()[_0xa1dc('0x34')](function(){var _0x441dfc=_0x1c6b02[_0xa1dc('0x36')]({'plain':!![]});var _0x30d47c=_0xa1dc('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x30d47c,'resourceId':_0x441dfc['id']}})[_0xa1dc('0x34')](function(){return _0x1c6b02;});})['then'](function(){_0x45ae0d[_0xa1dc('0x2c')](0xcc)[_0xa1dc('0x2d')]();});}};}function handleEntityNotFound(_0x57088a,_0x33a7c5){return function(_0x577921){if(!_0x577921){_0x57088a[_0xa1dc('0x2b')](0x194);}return _0x577921;};}function handleError(_0xf48ba1,_0x128b62){_0x128b62=_0x128b62||0x1f4;return function(_0x216835){logger['error'](_0x216835[_0xa1dc('0x38')]);if(_0x216835[_0xa1dc('0x39')]){delete _0x216835[_0xa1dc('0x39')];}_0xf48ba1['status'](_0x128b62)[_0xa1dc('0x3a')](_0x216835);};}exports['index']=function(_0x100758,_0x85029){var _0x20051c={'include':[{'model':db[_0xa1dc('0x3b')],'as':_0xa1dc('0x3c')}]},_0x167bc1={},_0xe7c0c3={'count':0x0,'rows':[]};var _0x4629bb=_[_0xa1dc('0x3d')](db[_0xa1dc('0x3e')]['rawAttributes'],function(_0x194530){return{'name':_0x194530[_0xa1dc('0x3f')],'type':_0x194530[_0xa1dc('0x40')][_0xa1dc('0x41')]};});_0x167bc1[_0xa1dc('0x42')]=_[_0xa1dc('0x3d')](_0x4629bb,_0xa1dc('0x39'));_0x167bc1[_0xa1dc('0x43')]=_[_0xa1dc('0x44')](_0x100758[_0xa1dc('0x43')]);_0x167bc1[_0xa1dc('0x45')]=_['intersection'](_0x167bc1[_0xa1dc('0x42')],_0x167bc1[_0xa1dc('0x43')]);_0x20051c[_0xa1dc('0x46')]=_[_0xa1dc('0x47')](_0x167bc1['model'],qs[_0xa1dc('0x48')](_0x100758['query']['fields']));_0x20051c[_0xa1dc('0x46')]=_0x20051c['attributes'][_0xa1dc('0x49')]?_0x20051c[_0xa1dc('0x46')]:_0x167bc1['model'];if(!_0x100758[_0xa1dc('0x43')]['hasOwnProperty'](_0xa1dc('0x4a'))){_0x20051c['limit']=qs[_0xa1dc('0x4b')](_0x100758[_0xa1dc('0x43')][_0xa1dc('0x4b')]);_0x20051c[_0xa1dc('0x30')]=qs[_0xa1dc('0x30')](_0x100758[_0xa1dc('0x43')][_0xa1dc('0x30')]);}_0x20051c[_0xa1dc('0x4c')]=qs[_0xa1dc('0x4d')](_0x100758[_0xa1dc('0x43')][_0xa1dc('0x4d')]);_0x20051c[_0xa1dc('0x4e')]=qs[_0xa1dc('0x45')](_['pick'](_0x100758['query'],_0x167bc1[_0xa1dc('0x45')]),_0x4629bb);if(_0x100758[_0xa1dc('0x43')][_0xa1dc('0x4f')]){_0x20051c['where']=_['merge'](_0x20051c[_0xa1dc('0x4e')],{'$or':_[_0xa1dc('0x3d')](_0x4629bb,function(_0x284fde){if(_0x284fde[_0xa1dc('0x40')]!==_0xa1dc('0x50')){var _0x5547fa={};_0x5547fa[_0x284fde[_0xa1dc('0x39')]]={'$like':'%'+_0x100758[_0xa1dc('0x43')][_0xa1dc('0x4f')]+'%'};return _0x5547fa;}})});}_0x20051c=_[_0xa1dc('0x51')]({},_0x20051c,_0x100758['options']);var _0xd3a85c={'where':_0x20051c[_0xa1dc('0x4e')]};return db[_0xa1dc('0x3e')][_0xa1dc('0x2f')](_0xd3a85c)[_0xa1dc('0x34')](function(_0x4a3b87){_0xe7c0c3['count']=_0x4a3b87;if(_0x100758['query'][_0xa1dc('0x52')]){_0x20051c[_0xa1dc('0x53')]=[{'all':!![]}];}return db[_0xa1dc('0x3e')]['findAll'](_0x20051c);})[_0xa1dc('0x34')](function(_0x58812a){_0xe7c0c3[_0xa1dc('0x54')]=_0x58812a;return _0xe7c0c3;})['then'](respondWithFilteredResult(_0x85029,_0x20051c))['catch'](handleError(_0x85029,null));};exports['show']=function(_0x5f00fd,_0xa78484){var _0x3c5bf8={'raw':![],'where':{'id':_0x5f00fd[_0xa1dc('0x55')]['id']},'include':[{'model':db[_0xa1dc('0x3b')],'as':_0xa1dc('0x3c')}]},_0x173d3b={};_0x173d3b[_0xa1dc('0x42')]=_['keys'](db[_0xa1dc('0x3e')][_0xa1dc('0x56')]);_0x173d3b[_0xa1dc('0x43')]=_[_0xa1dc('0x44')](_0x5f00fd['query']);_0x173d3b[_0xa1dc('0x45')]=_['intersection'](_0x173d3b['model'],_0x173d3b[_0xa1dc('0x43')]);_0x3c5bf8['attributes']=_['intersection'](_0x173d3b[_0xa1dc('0x42')],qs[_0xa1dc('0x48')](_0x5f00fd[_0xa1dc('0x43')][_0xa1dc('0x48')]));_0x3c5bf8['attributes']=_0x3c5bf8[_0xa1dc('0x46')][_0xa1dc('0x49')]?_0x3c5bf8[_0xa1dc('0x46')]:_0x173d3b['model'];if(_0x5f00fd['query'][_0xa1dc('0x52')]){_0x3c5bf8[_0xa1dc('0x53')]=[{'all':!![]}];}_0x3c5bf8=_[_0xa1dc('0x51')]({},_0x3c5bf8,_0x5f00fd['options']);return db[_0xa1dc('0x3e')][_0xa1dc('0x57')](_0x3c5bf8)[_0xa1dc('0x34')](handleEntityNotFound(_0xa78484,null))[_0xa1dc('0x34')](respondWithResult(_0xa78484,null))[_0xa1dc('0x2a')](handleError(_0xa78484,null));};exports[_0xa1dc('0x58')]=function(_0x3fe50b,_0x39e108){return db[_0xa1dc('0x3e')][_0xa1dc('0x58')](_0x3fe50b[_0xa1dc('0x59')],{})[_0xa1dc('0x34')](function(_0x22455c){var _0x133e0c=_0x3fe50b['user']['get']({'plain':!![]});if(!_0x133e0c)throw new Error(_0xa1dc('0x5a'));if(_0x133e0c['role']===_0xa1dc('0x5b')){var _0x59fb81=_0x22455c['get']({'plain':!![]});var _0x28bcd6='FaxAccounts';return db[_0xa1dc('0x5c')][_0xa1dc('0x57')]({'where':{'name':_0x28bcd6,'userProfileId':_0x133e0c[_0xa1dc('0x5d')]},'raw':!![]})[_0xa1dc('0x34')](function(_0x5bcd67){if(_0x5bcd67&&_0x5bcd67[_0xa1dc('0x5e')]===0x0){return db['UserProfileResource'][_0xa1dc('0x58')]({'name':_0x59fb81[_0xa1dc('0x39')],'resourceId':_0x59fb81['id'],'type':_0x5bcd67[_0xa1dc('0x39')],'sectionId':_0x5bcd67['id']},{})[_0xa1dc('0x34')](function(){return _0x22455c;});}else{return _0x22455c;}})[_0xa1dc('0x2a')](function(_0x3a3274){logger[_0xa1dc('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a3274);throw _0x3a3274;});}return _0x22455c;})[_0xa1dc('0x34')](respondWithResult(_0x39e108,0xc9))[_0xa1dc('0x2a')](handleError(_0x39e108,null));};exports[_0xa1dc('0x5f')]=function(_0x3f6de4,_0x454993){if(_0x3f6de4[_0xa1dc('0x59')]['id']){delete _0x3f6de4[_0xa1dc('0x59')]['id'];}return db[_0xa1dc('0x3e')][_0xa1dc('0x57')]({'where':{'id':_0x3f6de4[_0xa1dc('0x55')]['id']},'include':[{'model':db[_0xa1dc('0x3b')],'as':_0xa1dc('0x3c')}]})['then'](handleEntityNotFound(_0x454993,null))[_0xa1dc('0x34')](saveUpdates(_0x3f6de4[_0xa1dc('0x59')],null))[_0xa1dc('0x34')](respondWithResult(_0x454993,null))[_0xa1dc('0x2a')](handleError(_0x454993,null));};exports[_0xa1dc('0x35')]=function(_0x393077,_0x4f7198){return db['FaxAccount'][_0xa1dc('0x57')]({'where':{'id':_0x393077[_0xa1dc('0x55')]['id']}})['then'](handleEntityNotFound(_0x4f7198,null))[_0xa1dc('0x34')](removeEntity(_0x4f7198,null))[_0xa1dc('0x2a')](handleError(_0x4f7198,null));};exports['describe']=function(_0x4d2a2b,_0x438383){return db['FaxAccount'][_0xa1dc('0x60')]()['then'](respondWithResult(_0x438383,null))[_0xa1dc('0x2a')](handleError(_0x438383,null));};exports[_0xa1dc('0x61')]=function(_0x1ae300,_0x4e8d84,_0x2b49b2){if(_0x1ae300[_0xa1dc('0x59')]['id']){delete _0x1ae300['body']['id'];}return db[_0xa1dc('0x3e')][_0xa1dc('0x57')]({'where':{'id':_0x1ae300['params']['id']}})[_0xa1dc('0x34')](handleEntityNotFound(_0x4e8d84,null))[_0xa1dc('0x34')](function(_0x67481d){if(_0x67481d){_0x1ae300[_0xa1dc('0x59')][_0xa1dc('0x62')]=_0x67481d['id'];return db[_0xa1dc('0x63')][_0xa1dc('0x58')](_0x1ae300[_0xa1dc('0x59')]);}})[_0xa1dc('0x34')](respondWithResult(_0x4e8d84,null))[_0xa1dc('0x2a')](handleError(_0x4e8d84,null));};exports[_0xa1dc('0x64')]=function(_0x2908c5,_0x539cc6,_0x3148e4){var _0x17b26b={'raw':![],'where':{}};var _0x5e56ec={};var _0x5bb83b={'count':0x0,'rows':[]};return db[_0xa1dc('0x3e')][_0xa1dc('0x65')]({'where':{'id':_0x2908c5[_0xa1dc('0x55')]['id']}})['then'](handleEntityNotFound(_0x539cc6,null))['then'](function(_0x3fa4f2){if(_0x3fa4f2){_0x5e56ec[_0xa1dc('0x42')]=_[_0xa1dc('0x44')](db[_0xa1dc('0x63')][_0xa1dc('0x56')]);_0x5e56ec[_0xa1dc('0x43')]=_[_0xa1dc('0x44')](_0x2908c5[_0xa1dc('0x43')]);_0x5e56ec['filters']=_[_0xa1dc('0x47')](_0x5e56ec['model'],_0x5e56ec['query']);_0x17b26b[_0xa1dc('0x46')]=_['intersection'](_0x5e56ec[_0xa1dc('0x42')],qs[_0xa1dc('0x48')](_0x2908c5[_0xa1dc('0x43')][_0xa1dc('0x48')]));_0x17b26b['attributes']=_0x17b26b[_0xa1dc('0x46')][_0xa1dc('0x49')]?_0x17b26b[_0xa1dc('0x46')]:_0x5e56ec['model'];if(!_0x2908c5[_0xa1dc('0x43')]['hasOwnProperty'](_0xa1dc('0x4a'))){_0x17b26b[_0xa1dc('0x4b')]=qs['limit'](_0x2908c5[_0xa1dc('0x43')][_0xa1dc('0x4b')]);_0x17b26b[_0xa1dc('0x30')]=qs[_0xa1dc('0x30')](_0x2908c5[_0xa1dc('0x43')][_0xa1dc('0x30')]);}_0x17b26b[_0xa1dc('0x4c')]=qs['sort'](_0x2908c5[_0xa1dc('0x43')][_0xa1dc('0x4d')]);_0x17b26b['where']=qs[_0xa1dc('0x45')](_[_0xa1dc('0x66')](_0x2908c5[_0xa1dc('0x43')],_0x5e56ec[_0xa1dc('0x45')]));_0x17b26b[_0xa1dc('0x4e')][_0xa1dc('0x62')]=_0x3fa4f2['id'];if(_0x2908c5['query']['filter']){_0x17b26b[_0xa1dc('0x4e')]=_[_0xa1dc('0x51')](_0x17b26b['where'],{'$or':_[_0xa1dc('0x3d')](_0x17b26b[_0xa1dc('0x46')],function(_0x303f2e){var _0x34cd29={};_0x34cd29[_0x303f2e]={'$like':'%'+_0x2908c5['query'][_0xa1dc('0x4f')]+'%'};return _0x34cd29;})});}_0x17b26b=_[_0xa1dc('0x51')]({},_0x17b26b,_0x2908c5[_0xa1dc('0x67')]);return db['Disposition'][_0xa1dc('0x2f')]({'where':_0x17b26b[_0xa1dc('0x4e')]})[_0xa1dc('0x34')](function(_0xf8fb9d){_0x5bb83b[_0xa1dc('0x2f')]=_0xf8fb9d;if(_0x2908c5[_0xa1dc('0x43')][_0xa1dc('0x52')]){_0x17b26b[_0xa1dc('0x53')]=[{'all':!![]}];}return db['Disposition'][_0xa1dc('0x68')](_0x17b26b);})['then'](function(_0xce0b17){_0x5bb83b['rows']=_0xce0b17;return _0x5bb83b;});}})[_0xa1dc('0x34')](respondWithFilteredResult(_0x539cc6,_0x17b26b))[_0xa1dc('0x2a')](handleError(_0x539cc6,null));};exports[_0xa1dc('0x69')]=function(_0x3cfddd,_0x19353d,_0x222550){return db[_0xa1dc('0x3e')][_0xa1dc('0x57')]({'where':{'id':_0x3cfddd[_0xa1dc('0x55')]['id']}})[_0xa1dc('0x34')](handleEntityNotFound(_0x19353d,null))['then'](function(_0x544cb8){if(_0x544cb8){return _0x544cb8[_0xa1dc('0x69')](_0x3cfddd[_0xa1dc('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x19353d,null))['catch'](handleError(_0x19353d,null));};exports['addAnswer']=function(_0x481da4,_0x56ce41,_0x4a9a57){if(_0x481da4['body']['id']){delete _0x481da4[_0xa1dc('0x59')]['id'];}return db['FaxAccount'][_0xa1dc('0x57')]({'where':{'id':_0x481da4[_0xa1dc('0x55')]['id']}})['then'](handleEntityNotFound(_0x56ce41,null))[_0xa1dc('0x34')](function(_0x108c2a){if(_0x108c2a){_0x481da4[_0xa1dc('0x59')]['FaxAccountId']=_0x108c2a['id'];return db[_0xa1dc('0x6a')][_0xa1dc('0x58')](_0x481da4[_0xa1dc('0x59')]);}})[_0xa1dc('0x34')](respondWithResult(_0x56ce41,null))['catch'](handleError(_0x56ce41,null));};exports['getAnswers']=function(_0x1cec02,_0x306edd,_0x1218ea){var _0x54056e={'raw':![],'where':{}};var _0x11e165={};var _0x9fc3e1={'count':0x0,'rows':[]};return db[_0xa1dc('0x3e')][_0xa1dc('0x65')]({'where':{'id':_0x1cec02['params']['id']}})[_0xa1dc('0x34')](handleEntityNotFound(_0x306edd,null))['then'](function(_0x3931fe){if(_0x3931fe){_0x11e165['model']=_[_0xa1dc('0x44')](db[_0xa1dc('0x6a')]['rawAttributes']);_0x11e165[_0xa1dc('0x43')]=_[_0xa1dc('0x44')](_0x1cec02[_0xa1dc('0x43')]);_0x11e165[_0xa1dc('0x45')]=_[_0xa1dc('0x47')](_0x11e165['model'],_0x11e165[_0xa1dc('0x43')]);_0x54056e[_0xa1dc('0x46')]=_[_0xa1dc('0x47')](_0x11e165[_0xa1dc('0x42')],qs[_0xa1dc('0x48')](_0x1cec02['query']['fields']));_0x54056e[_0xa1dc('0x46')]=_0x54056e[_0xa1dc('0x46')][_0xa1dc('0x49')]?_0x54056e[_0xa1dc('0x46')]:_0x11e165[_0xa1dc('0x42')];if(!_0x1cec02[_0xa1dc('0x43')]['hasOwnProperty']('nolimit')){_0x54056e[_0xa1dc('0x4b')]=qs[_0xa1dc('0x4b')](_0x1cec02['query']['limit']);_0x54056e[_0xa1dc('0x30')]=qs[_0xa1dc('0x30')](_0x1cec02[_0xa1dc('0x43')][_0xa1dc('0x30')]);}_0x54056e[_0xa1dc('0x4c')]=qs[_0xa1dc('0x4d')](_0x1cec02[_0xa1dc('0x43')][_0xa1dc('0x4d')]);_0x54056e[_0xa1dc('0x4e')]=qs['filters'](_['pick'](_0x1cec02[_0xa1dc('0x43')],_0x11e165[_0xa1dc('0x45')]));_0x54056e[_0xa1dc('0x4e')]['FaxAccountId']=_0x3931fe['id'];if(_0x1cec02[_0xa1dc('0x43')][_0xa1dc('0x4f')]){_0x54056e['where']=_[_0xa1dc('0x51')](_0x54056e[_0xa1dc('0x4e')],{'$or':_[_0xa1dc('0x3d')](_0x54056e[_0xa1dc('0x46')],function(_0x408ea5){var _0x539f7e={};_0x539f7e[_0x408ea5]={'$like':'%'+_0x1cec02[_0xa1dc('0x43')]['filter']+'%'};return _0x539f7e;})});}_0x54056e=_[_0xa1dc('0x51')]({},_0x54056e,_0x1cec02[_0xa1dc('0x67')]);return db[_0xa1dc('0x6a')][_0xa1dc('0x2f')]({'where':_0x54056e['where']})[_0xa1dc('0x34')](function(_0x4e89e4){_0x9fc3e1[_0xa1dc('0x2f')]=_0x4e89e4;if(_0x1cec02[_0xa1dc('0x43')][_0xa1dc('0x52')]){_0x54056e[_0xa1dc('0x53')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x54056e);})[_0xa1dc('0x34')](function(_0x4213c8){_0x9fc3e1['rows']=_0x4213c8;return _0x9fc3e1;});}})[_0xa1dc('0x34')](respondWithFilteredResult(_0x306edd,_0x54056e))['catch'](handleError(_0x306edd,null));};exports['removeAnswers']=function(_0x52927d,_0x5855dd,_0x31d8d8){return db[_0xa1dc('0x3e')][_0xa1dc('0x57')]({'where':{'id':_0x52927d['params']['id']}})[_0xa1dc('0x34')](handleEntityNotFound(_0x5855dd,null))['then'](function(_0x284893){if(_0x284893){return _0x284893[_0xa1dc('0x6b')](_0x52927d['query'][_0xa1dc('0x6c')]);}})['then'](respondWithStatusCode(_0x5855dd,null))[_0xa1dc('0x2a')](handleError(_0x5855dd,null));};exports[_0xa1dc('0x6d')]=function(_0x38d714,_0x39b768,_0x4d7b39){return db[_0xa1dc('0x6e')][_0xa1dc('0x57')]({'where':{'id':_0x38d714[_0xa1dc('0x55')]['id']}})[_0xa1dc('0x34')](handleEntityNotFound(_0x39b768,null))[_0xa1dc('0x34')](function(_0x45e1f8){if(_0x45e1f8){return _0x45e1f8[_0xa1dc('0x6d')](_0x38d714[_0xa1dc('0x59')][_0xa1dc('0x6c')],_['omit'](_0x38d714[_0xa1dc('0x59')],[_0xa1dc('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x39b768,null))[_0xa1dc('0x2a')](handleError(_0x39b768,null));};exports[_0xa1dc('0x6f')]=function(_0x166620,_0x1c4b6d,_0x86e036){var _0xfd8446={'raw':![],'where':{}};var _0x34bb55={};var _0x5e8504={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x166620['params']['id']}})['then'](handleEntityNotFound(_0x1c4b6d,null))[_0xa1dc('0x34')](function(_0x29af9b){if(_0x29af9b){_0x34bb55[_0xa1dc('0x42')]=_[_0xa1dc('0x44')](db['FaxInteraction'][_0xa1dc('0x56')]);_0x34bb55['query']=_['keys'](_0x166620[_0xa1dc('0x43')]);_0x34bb55[_0xa1dc('0x45')]=_[_0xa1dc('0x47')](_0x34bb55[_0xa1dc('0x42')],_0x34bb55['query']);_0xfd8446['attributes']=_[_0xa1dc('0x47')](_0x34bb55[_0xa1dc('0x42')],qs['fields'](_0x166620[_0xa1dc('0x43')][_0xa1dc('0x48')]));_0xfd8446[_0xa1dc('0x46')]=_0xfd8446[_0xa1dc('0x46')][_0xa1dc('0x49')]?_0xfd8446[_0xa1dc('0x46')]:_0x34bb55[_0xa1dc('0x42')];if(!_0x166620['query']['hasOwnProperty'](_0xa1dc('0x4a'))){_0xfd8446[_0xa1dc('0x4b')]=qs[_0xa1dc('0x4b')](_0x166620[_0xa1dc('0x43')][_0xa1dc('0x4b')]);_0xfd8446[_0xa1dc('0x30')]=qs[_0xa1dc('0x30')](_0x166620['query']['offset']);}_0xfd8446['order']=qs[_0xa1dc('0x4d')](_0x166620[_0xa1dc('0x43')]['sort']);_0xfd8446['where']=qs[_0xa1dc('0x45')](_[_0xa1dc('0x66')](_0x166620['query'],_0x34bb55['filters']));_0xfd8446[_0xa1dc('0x4e')]['FaxAccountId']=_0x29af9b['id'];if(_0x166620[_0xa1dc('0x43')][_0xa1dc('0x4f')]){_0xfd8446[_0xa1dc('0x4e')]=_[_0xa1dc('0x51')](_0xfd8446[_0xa1dc('0x4e')],{'$or':_['map'](_0xfd8446[_0xa1dc('0x46')],function(_0x5abd87){var _0x32cca9={};_0x32cca9[_0x5abd87]={'$like':'%'+_0x166620[_0xa1dc('0x43')][_0xa1dc('0x4f')]+'%'};return _0x32cca9;})});}_0xfd8446=_[_0xa1dc('0x51')]({},_0xfd8446,_0x166620[_0xa1dc('0x67')]);return db[_0xa1dc('0x6e')][_0xa1dc('0x2f')]({'where':_0xfd8446[_0xa1dc('0x4e')]})[_0xa1dc('0x34')](function(_0x4d7f81){_0x5e8504[_0xa1dc('0x2f')]=_0x4d7f81;if(_0x166620['query'][_0xa1dc('0x52')]){_0xfd8446[_0xa1dc('0x53')]=[{'model':db[_0xa1dc('0x70')],'as':_0xa1dc('0x71'),'required':![]},{'model':db[_0xa1dc('0x72')],'as':'Owner','attributes':[_0xa1dc('0x39'),_0xa1dc('0x73'),_0xa1dc('0x74')],'required':![]},{'model':db[_0xa1dc('0x75')],'as':_0xa1dc('0x76'),'attributes':['id','name',_0xa1dc('0x77')],'where':_0x166620[_0xa1dc('0x43')][_0xa1dc('0x78')]?{'id':_0x166620[_0xa1dc('0x43')][_0xa1dc('0x78')]}:undefined,'required':_0x166620[_0xa1dc('0x43')][_0xa1dc('0x78')]?!![]:![]}];}return db[_0xa1dc('0x6e')][_0xa1dc('0x68')](_0xfd8446);})[_0xa1dc('0x34')](function(_0x369afb){_0x5e8504[_0xa1dc('0x54')]=_0x369afb;return _0x5e8504;});}})[_0xa1dc('0x34')](respondWithFilteredResult(_0x1c4b6d,_0xfd8446))[_0xa1dc('0x2a')](handleError(_0x1c4b6d,null));};exports['addApplications']=function(_0xba0fb0,_0x5ac82e,_0x5f216a){return db['FaxAccount'][_0xa1dc('0x65')]({'where':{'id':_0xba0fb0[_0xa1dc('0x55')]['id']}})[_0xa1dc('0x34')](handleEntityNotFound(_0x5ac82e,null))[_0xa1dc('0x34')](function(_0x2c5967){if(_0x2c5967){return db[_0xa1dc('0x79')][_0xa1dc('0x7a')](function(_0x143909){return db['FaxApplication'][_0xa1dc('0x35')]({'where':{'FaxAccountId':_0xba0fb0['params']['id']},'transaction':_0x143909})[_0xa1dc('0x34')](function(_0x5ee79a){var _0x890a96=_['map'](_0xba0fb0[_0xa1dc('0x59')],function(_0x5d4fa4){_0x5d4fa4['FaxAccountId']=_0xba0fb0['params']['id'];return _0x5d4fa4;});return db[_0xa1dc('0x7b')][_0xa1dc('0x7c')](_0x890a96,{'transaction':_0x143909});});})[_0xa1dc('0x34')](function(){return db[_0xa1dc('0x7b')][_0xa1dc('0x7d')]({'where':{'FaxAccountId':_0xba0fb0[_0xa1dc('0x55')]['id']},'order':_0xa1dc('0x7e')});});}})[_0xa1dc('0x34')](respondWithResult(_0x5ac82e,null))['catch'](handleError(_0x5ac82e,null));};exports['getApplications']=function(_0x58ef5e,_0x176127,_0x1ffc72){var _0x53e2ce={};var _0x627cad={};var _0x1e3efd;var _0xcb4457;return db['FaxAccount'][_0xa1dc('0x65')]({'where':{'id':_0x58ef5e[_0xa1dc('0x55')]['id']}})[_0xa1dc('0x34')](handleEntityNotFound(_0x176127,null))[_0xa1dc('0x34')](function(_0x159f72){if(_0x159f72){_0x1e3efd=_0x159f72;_0x627cad[_0xa1dc('0x42')]=_[_0xa1dc('0x44')](db[_0xa1dc('0x7b')][_0xa1dc('0x56')]);_0x627cad[_0xa1dc('0x43')]=_[_0xa1dc('0x44')](_0x58ef5e['query']);_0x627cad[_0xa1dc('0x45')]=_[_0xa1dc('0x47')](_0x627cad[_0xa1dc('0x42')],_0x627cad[_0xa1dc('0x43')]);_0x53e2ce[_0xa1dc('0x46')]=_[_0xa1dc('0x47')](_0x627cad['model'],qs['fields'](_0x58ef5e[_0xa1dc('0x43')][_0xa1dc('0x48')]));_0x53e2ce[_0xa1dc('0x46')]=_0x53e2ce['attributes'][_0xa1dc('0x49')]?_0x53e2ce[_0xa1dc('0x46')]:_0x627cad[_0xa1dc('0x42')];_0x53e2ce[_0xa1dc('0x4c')]=qs[_0xa1dc('0x4d')](_0x58ef5e['query'][_0xa1dc('0x4d')]);_0x53e2ce[_0xa1dc('0x4e')]=qs[_0xa1dc('0x45')](_[_0xa1dc('0x66')](_0x58ef5e[_0xa1dc('0x43')],_0x627cad[_0xa1dc('0x45')]));if(_0x58ef5e['query']['filter']){_0x53e2ce['where']=_[_0xa1dc('0x51')](_0x53e2ce[_0xa1dc('0x4e')],{'$or':_['map'](_0x53e2ce['attributes'],function(_0x26ff02){var _0x1be001={};_0x1be001[_0x26ff02]={'$like':'%'+_0x58ef5e[_0xa1dc('0x43')][_0xa1dc('0x4f')]+'%'};return _0x1be001;})});}_0x53e2ce=_['merge']({},_0x53e2ce,_0x58ef5e[_0xa1dc('0x67')]);return _0x1e3efd['getApplications'](_0x53e2ce);}})[_0xa1dc('0x34')](function(_0x242a20){if(_0x242a20){_0xcb4457=_0x242a20[_0xa1dc('0x49')];if(!_0x58ef5e[_0xa1dc('0x43')][_0xa1dc('0x7f')](_0xa1dc('0x4a'))){_0x53e2ce[_0xa1dc('0x4b')]=qs[_0xa1dc('0x4b')](_0x58ef5e[_0xa1dc('0x43')][_0xa1dc('0x4b')]);_0x53e2ce[_0xa1dc('0x30')]=qs[_0xa1dc('0x30')](_0x58ef5e[_0xa1dc('0x43')]['offset']);}return _0x1e3efd[_0xa1dc('0x80')](_0x53e2ce);}})[_0xa1dc('0x34')](function(_0x5d54b6){if(_0x5d54b6){return _0x5d54b6?{'count':_0xcb4457,'rows':_0x5d54b6}:null;}})[_0xa1dc('0x34')](respondWithResult(_0x176127,null))[_0xa1dc('0x2a')](handleError(_0x176127,null));};function Extension(_0x760171,_0x131a87,_0xedf999,_0x3358e1){this[_0xa1dc('0x81')]=_0xa1dc('0x82');this['exten']=_0x760171[_0xa1dc('0x83')];this['app']=_0x3358e1;this[_0xa1dc('0x40')]='system';this[_0xa1dc('0x84')]=_0xa1dc('0x85');this['FaxAccountId']=_0x760171['id'];this[_0xa1dc('0x7e')]=_0x131a87;this['appdata']=_0xedf999;}function createExtensionsReciveFax(_0x3e8c66){var _0x500d32=0x1;var _0x3a1959=[];_0x3a1959[_0xa1dc('0x86')](new Extension(_0x3e8c66,_0x500d32,'',_0xa1dc('0x87')));_0x500d32+=0x1;_0x3a1959[_0xa1dc('0x86')](new Extension(_0x3e8c66,_0x500d32,_0xa1dc('0x88'),'Set'));_0x500d32+=0x1;for(var _0x2a8265 in _0x3e8c66){if(_0x3e8c66['hasOwnProperty'](_0x2a8265)&&(_0x2a8265===_0xa1dc('0x89')||_0x2a8265===_0xa1dc('0x83')||_0x2a8265===_0xa1dc('0x8a')||_0x2a8265===_0xa1dc('0x8b')||_0x2a8265==='headerinfo'||_0x2a8265===_0xa1dc('0x8c')||_0x2a8265===_0xa1dc('0x8d')||_0x2a8265===_0xa1dc('0x8e')||_0x2a8265===_0xa1dc('0x8f'))){_0x3a1959['push'](new Extension(_0x3e8c66,_0x500d32,_0xa1dc('0x90')+_0x2a8265+')='+_0x3e8c66[_0x2a8265],_0xa1dc('0x91')));_0x500d32+=0x1;}}_0x3a1959[_0xa1dc('0x86')](new Extension(_0x3e8c66,_0x500d32,'6',_0xa1dc('0x92')));_0x500d32+=0x1;_0x3a1959[_0xa1dc('0x86')](new Extension(_0x3e8c66,_0x500d32,_0xa1dc('0x93'),'ReceiveFax'));_0x500d32=0x0;return _0x3a1959;}exports['addAccountApplications']=function(_0x5a37a4,_0x313d93,_0x563551){var _0x374545;return db[_0xa1dc('0x79')][_0xa1dc('0x7a')](function(_0x2fe7fd){return db[_0xa1dc('0x3e')][_0xa1dc('0x58')](_0x5a37a4[_0xa1dc('0x59')],{'transaction':_0x2fe7fd})[_0xa1dc('0x34')](function(_0x521ed3){_0x374545=_0x521ed3[_0xa1dc('0x36')]({'plain':!![]});return db['VoiceExtension'][_0xa1dc('0x7c')](createExtensionsReciveFax(_0x374545),{'transaction':_0x2fe7fd});});})[_0xa1dc('0x34')](function(){return _0x374545;})[_0xa1dc('0x34')](respondWithResult(_0x313d93,null))[_0xa1dc('0x2a')](handleError(_0x313d93,null));};exports['updateAccountApplications']=function(_0x330758,_0x24ed01,_0x16b454){var _0xd0766c;return db[_0xa1dc('0x79')][_0xa1dc('0x7a')](function(_0x40c1f4){return db[_0xa1dc('0x3e')][_0xa1dc('0x5f')](_0x330758[_0xa1dc('0x59')],{'where':{'id':_0x330758[_0xa1dc('0x59')]['id']},'transaction':_0x40c1f4})['then'](function(_0x7cedda){return db['VoiceExtension'][_0xa1dc('0x35')]({'where':{'FaxAccountId':_0x330758['body']['id']},'transaction':_0x40c1f4})[_0xa1dc('0x34')](function(_0x5c6f0f){return db[_0xa1dc('0x94')][_0xa1dc('0x7c')](createExtensionsReciveFax(_[_0xa1dc('0x95')](_0x330758[_0xa1dc('0x59')],['tech',_0xa1dc('0x41'),_0xa1dc('0x96'),'updatedAt','TrunkId',_0xa1dc('0x97')])),{'transaction':_0x40c1f4});});});})['then'](function(){return db['FaxAccount'][_0xa1dc('0x98')](_0x330758[_0xa1dc('0x59')]['id']);})[_0xa1dc('0x34')](respondWithResult(_0x24ed01,null))['catch'](handleError(_0x24ed01,null));};exports[_0xa1dc('0x99')]=function(_0x319e9a,_0x1dbb76,_0x5f56a4){var _0x3db78c={'raw':!![],'where':{}};var _0x57bdf7={};var _0x56cde3={'count':0x0,'rows':[]};return db['FaxAccount'][_0xa1dc('0x65')]({'where':{'id':_0x319e9a[_0xa1dc('0x55')]['id']}})[_0xa1dc('0x34')](handleEntityNotFound(_0x1dbb76,null))[_0xa1dc('0x34')](function(_0xa06853){if(_0xa06853){_0x57bdf7['model']=_[_0xa1dc('0x44')](db[_0xa1dc('0x9a')][_0xa1dc('0x56')]);_0x57bdf7[_0xa1dc('0x43')]=_[_0xa1dc('0x44')](_0x319e9a['query']);_0x57bdf7[_0xa1dc('0x45')]=_[_0xa1dc('0x47')](_0x57bdf7['model'],_0x57bdf7[_0xa1dc('0x43')]);_0x3db78c[_0xa1dc('0x46')]=_[_0xa1dc('0x47')](_0x57bdf7[_0xa1dc('0x42')],qs[_0xa1dc('0x48')](_0x319e9a[_0xa1dc('0x43')]['fields']));_0x3db78c[_0xa1dc('0x46')]=_0x3db78c[_0xa1dc('0x46')][_0xa1dc('0x49')]?_0x3db78c['attributes']:_0x57bdf7['model'];if(!_0x319e9a[_0xa1dc('0x43')][_0xa1dc('0x7f')](_0xa1dc('0x4a'))){_0x3db78c[_0xa1dc('0x4b')]=qs['limit'](_0x319e9a['query'][_0xa1dc('0x4b')]);_0x3db78c[_0xa1dc('0x30')]=qs['offset'](_0x319e9a['query'][_0xa1dc('0x30')]);}_0x3db78c[_0xa1dc('0x4c')]=qs[_0xa1dc('0x4d')](_0x319e9a[_0xa1dc('0x43')]['sort']);_0x3db78c['where']=qs[_0xa1dc('0x45')](_[_0xa1dc('0x66')](_0x319e9a[_0xa1dc('0x43')],_0x57bdf7[_0xa1dc('0x45')]));_0x3db78c[_0xa1dc('0x4e')][_0xa1dc('0x62')]=_0xa06853['id'];if(_0x319e9a['query']['filter']){_0x3db78c[_0xa1dc('0x4e')]=_[_0xa1dc('0x51')](_0x3db78c[_0xa1dc('0x4e')],{'$or':_['map'](_0x3db78c[_0xa1dc('0x46')],function(_0x21e8fb){var _0x5d724b={};_0x5d724b[_0x21e8fb]={'$like':'%'+_0x319e9a[_0xa1dc('0x43')][_0xa1dc('0x4f')]+'%'};return _0x5d724b;})});}if(_0x319e9a[_0xa1dc('0x43')][_0xa1dc('0x9b')]){var _0x503d21=_0x319e9a['query'][_0xa1dc('0x9b')][_0xa1dc('0x9c')](',');var _0x5055b6={};_0x5055b6[_0x503d21[0x0]]={'$gte':moment(_0x503d21[0x1])[_0xa1dc('0x9d')](_0xa1dc('0x9e'))};_0x3db78c[_0xa1dc('0x4e')]=_[_0xa1dc('0x51')](_0x3db78c['where'],_0x5055b6);}_0x3db78c=_['merge']({},_0x3db78c,_0x319e9a[_0xa1dc('0x67')]);return db[_0xa1dc('0x9a')][_0xa1dc('0x2f')]({'where':_0x3db78c[_0xa1dc('0x4e')]})[_0xa1dc('0x34')](function(_0x2ef24b){_0x56cde3['count']=_0x2ef24b;if(_0x319e9a[_0xa1dc('0x43')][_0xa1dc('0x52')]){_0x3db78c[_0xa1dc('0x53')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x3db78c);})[_0xa1dc('0x34')](function(_0x1110a3){_0x56cde3[_0xa1dc('0x54')]=_0x1110a3;return _0x56cde3;});}})[_0xa1dc('0x34')](respondWithFilteredResult(_0x1dbb76,_0x3db78c))[_0xa1dc('0x2a')](handleError(_0x1dbb76,null));};exports['send']=function(_0x5b7d10,_0xc8740e,_0x156440){var _0x2901f7,_0x2cb670={},_0x5223bd;if(_0x5b7d10[_0xa1dc('0x59')]['to']){_0x5223bd=_0x5b7d10[_0xa1dc('0x59')]['to'][0x0];}return db[_0xa1dc('0x3e')][_0xa1dc('0x57')]({'where':{'id':_0x5b7d10[_0xa1dc('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0xa1dc('0x9f'),'include':[{'model':db[_0xa1dc('0x70')],'as':_0xa1dc('0xa0'),'where':{'fax':_0x5223bd},'limit':0x1,'order':[[_0xa1dc('0xa1'),_0xa1dc('0xa2')]]}]}]})['then'](handleEntityNotFound(_0xc8740e,null))[_0xa1dc('0x34')](function(_0x2e7a50){_0x2901f7=_0x2e7a50;if(_0x5b7d10[_0xa1dc('0x59')][_0xa1dc('0xa3')]&&_0x5b7d10[_0xa1dc('0x59')][_0xa1dc('0xa3')][_0xa1dc('0x49')]){for(var _0x5b0eb5=0x0;_0x5b0eb5<_0x5b7d10[_0xa1dc('0x59')][_0xa1dc('0xa3')][_0xa1dc('0x49')];_0x5b0eb5+=0x1){_0x5b7d10[_0xa1dc('0x59')][_0xa1dc('0xa3')][_0x5b0eb5]={'filename':_0x5b7d10[_0xa1dc('0x59')][_0xa1dc('0xa3')][_0x5b0eb5]['name'],'id':_0x5b7d10[_0xa1dc('0x59')][_0xa1dc('0xa3')][_0x5b0eb5]['id'],'path':path[_0xa1dc('0xa4')](config['root'],_0xa1dc('0xa5'),_0x5b7d10[_0xa1dc('0x59')]['attachments'][_0x5b0eb5]['basename'])};}}return respondWithRpcPromise(_0xa1dc('0xa6'),_0xa1dc('0xa6'),{'FaxAccountId':_[_0xa1dc('0xa7')](_0x5b7d10[_0xa1dc('0x55')]['id'])?undefined:_0x5b7d10[_0xa1dc('0x55')]['id'],'path':_['isNil'](_0x5b7d10[_0xa1dc('0x59')][_0xa1dc('0xa3')][0x0][_0xa1dc('0x5')])?undefined:_0x5b7d10[_0xa1dc('0x59')]['attachments'][0x0][_0xa1dc('0x5')],'fax':_[_0xa1dc('0xa7')](_0x5b7d10[_0xa1dc('0x59')]['to'][0x0])?undefined:_0x5b7d10[_0xa1dc('0x59')]['to'][0x0]},client9002);})[_0xa1dc('0x34')](function(){if(_0x2901f7){if(_[_0xa1dc('0xa7')](_0x5b7d10[_0xa1dc('0x59')]['from'])){_0x5b7d10['body'][_0xa1dc('0xa8')]=util['format'](_0xa1dc('0xa9'),_0x2901f7['name'],_0x2901f7[_0xa1dc('0xaa')]);}if(_0x2901f7[_0xa1dc('0x9f')]){if(_0x2901f7['List'][_0xa1dc('0xa0')]['length']){return _0x2901f7['List'][_0xa1dc('0xa0')][0x0];}else{return db[_0xa1dc('0x70')][_0xa1dc('0x58')](_[_0xa1dc('0xab')](_0x5b7d10[_0xa1dc('0x59')],{'firstName':_0x5b7d10[_0xa1dc('0x59')]['to'][0x0],'phone':_0x5b7d10[_0xa1dc('0x59')]['to'][0x0],'fax':_0x5b7d10[_0xa1dc('0x59')]['to'][0x0],'ListId':_0x2901f7[_0xa1dc('0x97')]}));}}else{throw new Error(_0xa1dc('0xac'));}}else{throw new Error(_0xa1dc('0xad'));}})['then'](function(_0x3251ee){if(_0x3251ee){return db[_0xa1dc('0x6e')][_0xa1dc('0x57')]({'where':{'ContactId':_0x3251ee['id'],'closed':![],'FaxAccountId':_0x2901f7['id']}})[_0xa1dc('0x34')](function(_0x36eaa0){if(_0x36eaa0){return[_0x36eaa0,![]];}return db[_0xa1dc('0x6e')][_0xa1dc('0x58')]({'UserId':_0x5b7d10[_0xa1dc('0x5b')]['id'],'ContactId':_0x3251ee['id'],'FaxAccountId':_0x2901f7['id'],'fax':_0x5b7d10[_0xa1dc('0x59')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x5b7d10[_0xa1dc('0x59')],{'read':![],'body':_0x5b7d10[_0xa1dc('0x59')][_0xa1dc('0xa3')][0x0][_0xa1dc('0xae')],'FaxAccountId':_0x2901f7['id'],'UserId':_0x5b7d10[_0xa1dc('0x5b')]['id'],'ContactId':_0x3251ee['id'],'AttachmentId':_0x5b7d10[_0xa1dc('0x59')][_0xa1dc('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0xa1dc('0x9a')],'as':_0xa1dc('0xaf')}]})[_0xa1dc('0x34')](function(_0x1b7cf9){return[_0x1b7cf9,!![]];});});}else{throw new Error(_0xa1dc('0xb0'));}})['spread'](function(_0xd80797,_0x15b85d){if(_0x15b85d){return _0xd80797;}return db[_0xa1dc('0x9a')][_0xa1dc('0x58')]({'direction':_0xa1dc('0xb1'),'read':![],'body':_0x5b7d10[_0xa1dc('0x59')][_0xa1dc('0xa3')][0x0]['filename'],'FaxAccountId':_0x2901f7['id'],'FaxInteractionId':_0xd80797['id'],'UserId':_0x5b7d10[_0xa1dc('0x5b')]['id'],'ContactId':_0xd80797['ContactId'],'AttachmentId':_0x5b7d10[_0xa1dc('0x59')]['attachments'][0x0]['id']})[_0xa1dc('0x34')](function(_0x3defdf){_0xd80797[_0xa1dc('0xb2')]['Messages']=[];_0xd80797[_0xa1dc('0xb2')][_0xa1dc('0xaf')][_0xa1dc('0x86')](_0x3defdf['dataValues']);return _0xd80797;});})[_0xa1dc('0x34')](function(_0x2942fc){respondWithRpcPromise(_0xa1dc('0xb3'),'SendFax',{'FaxAccountId':_[_0xa1dc('0xa7')](_0x5b7d10[_0xa1dc('0x55')]['id'])?undefined:_0x5b7d10['params']['id'],'path':_['isNil'](_0x5b7d10[_0xa1dc('0x59')][_0xa1dc('0xa3')][0x0][_0xa1dc('0x5')])?undefined:_0x5b7d10['body'][_0xa1dc('0xa3')][0x0]['path'],'fax':_[_0xa1dc('0xa7')](_0x5b7d10['body']['to'][0x0])?undefined:_0x5b7d10[_0xa1dc('0x59')]['to'][0x0],'AttachmentId':_0x5b7d10['body'][_0xa1dc('0xa3')][0x0]['id']},client9002)[_0xa1dc('0x34')](function(_0x1fe9f9){logger['info'](_0xa1dc('0xb4'),_0x1fe9f9);})[_0xa1dc('0x2a')](function(_0x1caacc){logger[_0xa1dc('0x21')](_0xa1dc('0xb4'),_0x1caacc);});return _0x2942fc;})[_0xa1dc('0x34')](respondWithResult(_0xc8740e,null))[_0xa1dc('0x2a')](handleError(_0xc8740e,null));};exports['addAgents']=function(_0x26c452,_0x382688,_0x20b5bc){return db[_0xa1dc('0x3e')][_0xa1dc('0x57')]({'where':{'id':_0x26c452[_0xa1dc('0x55')]['id']}})[_0xa1dc('0x34')](handleEntityNotFound(_0x382688,null))[_0xa1dc('0x34')](function(_0xbf0ac4){if(_0xbf0ac4){return _0xbf0ac4[_0xa1dc('0xb5')](_0x26c452[_0xa1dc('0x59')]['ids'],_[_0xa1dc('0x95')](_0x26c452['body'],[_0xa1dc('0x6c'),'id'])||{})['spread'](function(_0x285dce){for(var _0x572acf=0x0;_0x572acf<_0x26c452['body']['ids'][_0xa1dc('0x49')];_0x572acf+=0x1){socket['emit'](_0xa1dc('0xb6'),{'UserId':_0x26c452[_0xa1dc('0x59')]['ids'][_0x572acf],'FaxAccountId':_0x26c452[_0xa1dc('0x55')]['id']});}return _0x285dce;});}})[_0xa1dc('0x34')](respondWithResult(_0x382688,null))[_0xa1dc('0x2a')](handleError(_0x382688,null));};exports[_0xa1dc('0xb7')]=function(_0x100885,_0x15f38c,_0x59ba89){return db[_0xa1dc('0x3e')]['find']({'where':{'id':_0x100885[_0xa1dc('0x55')]['id']}})['then'](handleEntityNotFound(_0x15f38c,null))[_0xa1dc('0x34')](function(_0x1f7f2f){if(_0x1f7f2f){return _0x1f7f2f[_0xa1dc('0xb7')](_0x100885[_0xa1dc('0x43')][_0xa1dc('0x6c')])[_0xa1dc('0x34')](function(){if(_['isArray'](_0x100885[_0xa1dc('0x43')]['ids'])){for(var _0x11f7db=0x0;_0x11f7db<_0x100885[_0xa1dc('0x43')][_0xa1dc('0x6c')][_0xa1dc('0x49')];_0x11f7db+=0x1){socket['emit'](_0xa1dc('0xb8'),{'UserId':Number(_0x100885['query'][_0xa1dc('0x6c')][_0x11f7db]),'FaxAccountId':Number(_0x100885[_0xa1dc('0x55')]['id'])});}}else{socket[_0xa1dc('0xb9')](_0xa1dc('0xb8'),{'UserId':Number(_0x100885[_0xa1dc('0x43')][_0xa1dc('0x6c')]),'FaxAccountId':Number(_0x100885['params']['id'])});}});}})[_0xa1dc('0x34')](respondWithStatusCode(_0x15f38c,null))[_0xa1dc('0x2a')](handleError(_0x15f38c,null));};exports[_0xa1dc('0xba')]=function(_0x58aaab,_0x207212,_0x4eaf81){var _0x3f01c4={};var _0x36fac2={};var _0x573949;var _0x584581;return db[_0xa1dc('0x3e')][_0xa1dc('0x65')]({'where':{'id':_0x58aaab[_0xa1dc('0x55')]['id']}})['then'](handleEntityNotFound(_0x207212,null))['then'](function(_0x1778f1){if(_0x1778f1){_0x573949=_0x1778f1;_0x36fac2['model']=_[_0xa1dc('0x44')](db[_0xa1dc('0x72')][_0xa1dc('0x56')]);_0x36fac2[_0xa1dc('0x43')]=_[_0xa1dc('0x44')](_0x58aaab[_0xa1dc('0x43')]);_0x36fac2[_0xa1dc('0x45')]=_[_0xa1dc('0x47')](_0x36fac2[_0xa1dc('0x42')],_0x36fac2[_0xa1dc('0x43')]);_0x3f01c4['attributes']=_[_0xa1dc('0x47')](_0x36fac2[_0xa1dc('0x42')],qs[_0xa1dc('0x48')](_0x58aaab[_0xa1dc('0x43')][_0xa1dc('0x48')]));_0x3f01c4[_0xa1dc('0x46')]=_0x3f01c4[_0xa1dc('0x46')][_0xa1dc('0x49')]?_0x3f01c4[_0xa1dc('0x46')]:_0x36fac2['model'];_0x3f01c4[_0xa1dc('0x4c')]=qs[_0xa1dc('0x4d')](_0x58aaab[_0xa1dc('0x43')][_0xa1dc('0x4d')]);_0x3f01c4[_0xa1dc('0x4e')]=qs[_0xa1dc('0x45')](_[_0xa1dc('0x66')](_0x58aaab['query'],_0x36fac2[_0xa1dc('0x45')]));if(_0x58aaab[_0xa1dc('0x43')][_0xa1dc('0x4f')]){_0x3f01c4[_0xa1dc('0x4e')]=_['merge'](_0x3f01c4['where'],{'$or':_[_0xa1dc('0x3d')](_0x3f01c4['attributes'],function(_0x1bc732){var _0xd5e386={};_0xd5e386[_0x1bc732]={'$like':'%'+_0x58aaab[_0xa1dc('0x43')][_0xa1dc('0x4f')]+'%'};return _0xd5e386;})});}_0x3f01c4=_[_0xa1dc('0x51')]({},_0x3f01c4,_0x58aaab[_0xa1dc('0x67')]);return _0x573949[_0xa1dc('0xba')](_0x3f01c4);}})[_0xa1dc('0x34')](function(_0x209b3c){if(_0x209b3c){_0x584581=_0x209b3c[_0xa1dc('0x49')];if(!_0x58aaab[_0xa1dc('0x43')][_0xa1dc('0x7f')](_0xa1dc('0x4a'))){_0x3f01c4[_0xa1dc('0x4b')]=qs['limit'](_0x58aaab[_0xa1dc('0x43')][_0xa1dc('0x4b')]);_0x3f01c4[_0xa1dc('0x30')]=qs[_0xa1dc('0x30')](_0x58aaab['query'][_0xa1dc('0x30')]);}return _0x573949[_0xa1dc('0xba')](_0x3f01c4);}})[_0xa1dc('0x34')](function(_0x161804){if(_0x161804){return _0x161804?{'count':_0x584581,'rows':_0x161804}:null;}})['then'](respondWithResult(_0x207212,null))[_0xa1dc('0x2a')](handleError(_0x207212,null));};
\ No newline at end of file
+var _0x586e=['request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','FaxAccounts','status','end','sendStatus','stack','name','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','FaxAccount','includeAll','include','findAll','rows','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','order','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','transaction','bulkCreate','FaxApplication','findAndCountAll','priority','getApplications','context','exten','localstationid','system','description','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','modem','FAXOPT(','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','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x2c89f6,_0x42a355){var _0xbc8344=function(_0x44a178){while(--_0x44a178){_0x2c89f6['push'](_0x2c89f6['shift']());}};_0xbc8344(++_0x42a355);}(_0x586e,0x174));var _0xe586=function(_0x469ac7,_0x38e416){_0x469ac7=_0x469ac7-0x0;var _0x22f3b0=_0x586e[_0x469ac7];return _0x22f3b0;};'use strict';var pdf=require(_0xe586('0x0'));var emlformat=require(_0xe586('0x1'));var rimraf=require(_0xe586('0x2'));var zipdir=require(_0xe586('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe586('0x4'));var moment=require(_0xe586('0x5'));var BPromise=require(_0xe586('0x6'));var Mustache=require(_0xe586('0x7'));var util=require(_0xe586('0x8'));var path=require(_0xe586('0x9'));var sox=require(_0xe586('0xa'));var csv=require(_0xe586('0xb'));var ejs=require(_0xe586('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe586('0xd'));var crypto=require(_0xe586('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe586('0xf'));var toCsv=require(_0xe586('0xb'));var querystring=require('querystring');var Papa=require(_0xe586('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe586('0x11'));var as=require(_0xe586('0x12'));var hardwareService=require(_0xe586('0x13'));var logger=require(_0xe586('0x14'))(_0xe586('0x15'));var utils=require(_0xe586('0x16'));var config=require(_0xe586('0x17'));var db=require(_0xe586('0x18'))['db'];config['redis']=_[_0xe586('0x19')](config[_0xe586('0x1a')],{'host':_0xe586('0x1b'),'port':0x18eb});var socket=require(_0xe586('0x1c'))(new Redis(config['redis']));require(_0xe586('0x1d'))['register'](socket);var jayson=require(_0xe586('0x1e'));var client=jayson[_0xe586('0x1f')][_0xe586('0x20')]({'port':0x232c});var client9002=jayson[_0xe586('0x1f')][_0xe586('0x20')]({'port':0x232a});function checkPasswordPattern(_0x276d71,_0x319352,_0x19be7b){if(_0x19be7b){var _0x1ae794=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ae794[_0xe586('0x21')](_0x319352)){return _0x276d71;}else{throw new db['Sequelize'][(_0xe586('0x22'))](_0xe586('0x23'));}}else{return _0x276d71;}}function respondWithRpcPromise(_0x3e4a5e,_0x508d9b,_0x951c3c,_0x51a980){return new BPromise(function(_0x5db9ed,_0x5d2553){var _0x5add5b=_0x51a980||client;return _0x5add5b[_0xe586('0x24')](_0x3e4a5e,_0x951c3c)[_0xe586('0x25')](function(_0xc8423){logger[_0xe586('0x26')](_0xe586('0x27'),_0x508d9b,_0xe586('0x28'));logger[_0xe586('0x29')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x508d9b,_0xe586('0x28'),JSON['stringify'](_0xc8423));if(_0xc8423[_0xe586('0x2a')]){if(_0xc8423[_0xe586('0x2a')][_0xe586('0x2b')]===0x1f4){logger[_0xe586('0x2a')](_0xe586('0x27'),_0x508d9b,_0xc8423[_0xe586('0x2a')][_0xe586('0x2c')]);return _0x5d2553(_0xc8423['error'][_0xe586('0x2c')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x508d9b,_0xc8423[_0xe586('0x2a')][_0xe586('0x2c')]);return _0x5db9ed(_0xc8423[_0xe586('0x2a')][_0xe586('0x2c')]);}else{logger[_0xe586('0x26')](_0xe586('0x27'),_0x508d9b,_0xe586('0x28'));_0x5db9ed(_0xc8423[_0xe586('0x2d')][_0xe586('0x2c')]);}})[_0xe586('0x2e')](function(_0x541402){logger['error'](_0xe586('0x27'),_0x508d9b,_0x541402);_0x5d2553(_0x541402);});});}function respondWithStatusCode(_0x46259f,_0x1c0e79){_0x1c0e79=_0x1c0e79||0xcc;return function(_0x2a2b67){if(_0x2a2b67){return _0x46259f['sendStatus'](_0x1c0e79);}return _0x46259f['status'](_0x1c0e79)['end']();};}function respondWithResult(_0x1f32ab,_0x325c17){_0x325c17=_0x325c17||0xc8;return function(_0x52c4d6){if(_0x52c4d6){return _0x1f32ab['status'](_0x325c17)['json'](_0x52c4d6);}};}function respondWithFilteredResult(_0x4ede41,_0x2e283d){return function(_0x50fb5c){if(_0x50fb5c){var _0x370b5d=_0x50fb5c[_0xe586('0x2f')],_0x17cce2=_0x2e283d['offset'],_0x1d2152=_0x2e283d[_0xe586('0x30')]+_0x2e283d[_0xe586('0x31')],_0x3ee0af;if(_0x1d2152>=_0x370b5d){_0x1d2152=_0x370b5d;_0x3ee0af=0xc8;}else{_0x3ee0af=0xce;}_0x4ede41['status'](_0x3ee0af);return _0x4ede41[_0xe586('0x32')](_0xe586('0x33'),_0x17cce2+'-'+_0x1d2152+'/'+_0x370b5d)[_0xe586('0x34')](_0x50fb5c);}return null;};}function patchUpdates(_0x577961){return function(_0x98b7b7){try{jsonpatch[_0xe586('0x35')](_0x98b7b7,_0x577961,!![]);}catch(_0x45af08){return BPromise[_0xe586('0x36')](_0x45af08);}return _0x98b7b7[_0xe586('0x37')]();};}function saveUpdates(_0x19b322,_0xd43518){return function(_0x3426c0){if(_0x3426c0){return _0x3426c0[_0xe586('0x38')](_0x19b322)[_0xe586('0x25')](function(_0x1cd6c9){return _0x1cd6c9;});}return null;};}function removeEntity(_0x3ce30c,_0x47b42a){return function(_0x415f24){if(_0x415f24){return _0x415f24[_0xe586('0x39')]()['then'](function(){var _0x5d1547=_0x415f24[_0xe586('0x3a')]({'plain':!![]});var _0x2dec5b=_0xe586('0x3b');return db['UserProfileResource']['destroy']({'where':{'type':_0x2dec5b,'resourceId':_0x5d1547['id']}})[_0xe586('0x25')](function(){return _0x415f24;});})['then'](function(){_0x3ce30c[_0xe586('0x3c')](0xcc)[_0xe586('0x3d')]();});}};}function handleEntityNotFound(_0x4c29ca,_0x5b9645){return function(_0x2f808d){if(!_0x2f808d){_0x4c29ca[_0xe586('0x3e')](0x194);}return _0x2f808d;};}function handleError(_0x8878cf,_0x218e7c){_0x218e7c=_0x218e7c||0x1f4;return function(_0x3e5810){logger[_0xe586('0x2a')](_0x3e5810[_0xe586('0x3f')]);if(_0x3e5810[_0xe586('0x40')]){delete _0x3e5810[_0xe586('0x40')];}_0x8878cf[_0xe586('0x3c')](_0x218e7c)['send'](_0x3e5810);};}exports['index']=function(_0x2e7bd7,_0x2e319b){var _0x58db6f={'include':[{'model':db[_0xe586('0x41')],'as':_0xe586('0x42')}]},_0x4b2ef3={},_0x268ef4={'count':0x0,'rows':[]};var _0x29ca6f=_[_0xe586('0x43')](db['FaxAccount'][_0xe586('0x44')],function(_0x21453b){return{'name':_0x21453b['fieldName'],'type':_0x21453b[_0xe586('0x45')][_0xe586('0x46')]};});_0x4b2ef3[_0xe586('0x47')]=_[_0xe586('0x43')](_0x29ca6f,_0xe586('0x40'));_0x4b2ef3[_0xe586('0x48')]=_[_0xe586('0x49')](_0x2e7bd7['query']);_0x4b2ef3[_0xe586('0x4a')]=_[_0xe586('0x4b')](_0x4b2ef3['model'],_0x4b2ef3[_0xe586('0x48')]);_0x58db6f[_0xe586('0x4c')]=_[_0xe586('0x4b')](_0x4b2ef3[_0xe586('0x47')],qs[_0xe586('0x4d')](_0x2e7bd7[_0xe586('0x48')][_0xe586('0x4d')]));_0x58db6f[_0xe586('0x4c')]=_0x58db6f[_0xe586('0x4c')][_0xe586('0x4e')]?_0x58db6f[_0xe586('0x4c')]:_0x4b2ef3[_0xe586('0x47')];if(!_0x2e7bd7['query'][_0xe586('0x4f')](_0xe586('0x50'))){_0x58db6f[_0xe586('0x31')]=qs[_0xe586('0x31')](_0x2e7bd7[_0xe586('0x48')][_0xe586('0x31')]);_0x58db6f[_0xe586('0x30')]=qs[_0xe586('0x30')](_0x2e7bd7[_0xe586('0x48')]['offset']);}_0x58db6f['order']=qs[_0xe586('0x51')](_0x2e7bd7['query'][_0xe586('0x51')]);_0x58db6f['where']=qs['filters'](_[_0xe586('0x52')](_0x2e7bd7['query'],_0x4b2ef3[_0xe586('0x4a')]),_0x29ca6f);if(_0x2e7bd7['query'][_0xe586('0x53')]){_0x58db6f[_0xe586('0x54')]=_['merge'](_0x58db6f['where'],{'$or':_['map'](_0x29ca6f,function(_0x4126e0){if(_0x4126e0[_0xe586('0x45')]!==_0xe586('0x55')){var _0x566f1a={};_0x566f1a[_0x4126e0['name']]={'$like':'%'+_0x2e7bd7[_0xe586('0x48')][_0xe586('0x53')]+'%'};return _0x566f1a;}})});}_0x58db6f=_[_0xe586('0x56')]({},_0x58db6f,_0x2e7bd7[_0xe586('0x57')]);var _0x5f2d5c={'where':_0x58db6f['where']};return db[_0xe586('0x58')][_0xe586('0x2f')](_0x5f2d5c)['then'](function(_0x4d57dd){_0x268ef4['count']=_0x4d57dd;if(_0x2e7bd7[_0xe586('0x48')][_0xe586('0x59')]){_0x58db6f[_0xe586('0x5a')]=[{'all':!![]}];}return db[_0xe586('0x58')][_0xe586('0x5b')](_0x58db6f);})[_0xe586('0x25')](function(_0xe93c68){_0x268ef4[_0xe586('0x5c')]=_0xe93c68;return _0x268ef4;})[_0xe586('0x25')](respondWithFilteredResult(_0x2e319b,_0x58db6f))[_0xe586('0x2e')](handleError(_0x2e319b,null));};exports[_0xe586('0x5d')]=function(_0x100f25,_0x3bda5e){var _0x300b75={'raw':![],'where':{'id':_0x100f25['params']['id']},'include':[{'model':db[_0xe586('0x41')],'as':_0xe586('0x42')}]},_0x2e0267={};_0x2e0267[_0xe586('0x47')]=_[_0xe586('0x49')](db['FaxAccount'][_0xe586('0x44')]);_0x2e0267[_0xe586('0x48')]=_[_0xe586('0x49')](_0x100f25[_0xe586('0x48')]);_0x2e0267[_0xe586('0x4a')]=_[_0xe586('0x4b')](_0x2e0267['model'],_0x2e0267[_0xe586('0x48')]);_0x300b75[_0xe586('0x4c')]=_[_0xe586('0x4b')](_0x2e0267['model'],qs['fields'](_0x100f25[_0xe586('0x48')][_0xe586('0x4d')]));_0x300b75[_0xe586('0x4c')]=_0x300b75[_0xe586('0x4c')]['length']?_0x300b75['attributes']:_0x2e0267[_0xe586('0x47')];if(_0x100f25['query'][_0xe586('0x59')]){_0x300b75['include']=[{'all':!![]}];}_0x300b75=_[_0xe586('0x56')]({},_0x300b75,_0x100f25[_0xe586('0x57')]);return db[_0xe586('0x58')][_0xe586('0x5e')](_0x300b75)['then'](handleEntityNotFound(_0x3bda5e,null))['then'](respondWithResult(_0x3bda5e,null))[_0xe586('0x2e')](handleError(_0x3bda5e,null));};exports['create']=function(_0x3b367c,_0x2cb4eb){return db[_0xe586('0x58')][_0xe586('0x5f')](_0x3b367c['body'],{})['then'](function(_0xb8d71){var _0x1dbf8b=_0x3b367c['user'][_0xe586('0x3a')]({'plain':!![]});if(!_0x1dbf8b)throw new Error(_0xe586('0x60'));if(_0x1dbf8b[_0xe586('0x61')]===_0xe586('0x62')){var _0xcb79c5=_0xb8d71['get']({'plain':!![]});var _0x2ae9fe=_0xe586('0x3b');return db[_0xe586('0x63')][_0xe586('0x5e')]({'where':{'name':_0x2ae9fe,'userProfileId':_0x1dbf8b[_0xe586('0x64')]},'raw':!![]})[_0xe586('0x25')](function(_0x167663){if(_0x167663&&_0x167663[_0xe586('0x65')]===0x0){return db[_0xe586('0x66')][_0xe586('0x5f')]({'name':_0xcb79c5['name'],'resourceId':_0xcb79c5['id'],'type':_0x167663['name'],'sectionId':_0x167663['id']},{})['then'](function(){return _0xb8d71;});}else{return _0xb8d71;}})[_0xe586('0x2e')](function(_0x376e8a){logger[_0xe586('0x2a')](_0xe586('0x67'),_0x376e8a);throw _0x376e8a;});}return _0xb8d71;})[_0xe586('0x25')](respondWithResult(_0x2cb4eb,0xc9))[_0xe586('0x2e')](handleError(_0x2cb4eb,null));};exports[_0xe586('0x38')]=function(_0x39dcc6,_0x5b0521){if(_0x39dcc6[_0xe586('0x68')]['id']){delete _0x39dcc6[_0xe586('0x68')]['id'];}return db['FaxAccount'][_0xe586('0x5e')]({'where':{'id':_0x39dcc6[_0xe586('0x69')]['id']},'include':[{'model':db[_0xe586('0x41')],'as':_0xe586('0x42')}]})[_0xe586('0x25')](handleEntityNotFound(_0x5b0521,null))[_0xe586('0x25')](saveUpdates(_0x39dcc6[_0xe586('0x68')],null))[_0xe586('0x25')](respondWithResult(_0x5b0521,null))[_0xe586('0x2e')](handleError(_0x5b0521,null));};exports[_0xe586('0x39')]=function(_0x1896be,_0x198be5){return db[_0xe586('0x58')][_0xe586('0x5e')]({'where':{'id':_0x1896be['params']['id']}})['then'](handleEntityNotFound(_0x198be5,null))['then'](removeEntity(_0x198be5,null))[_0xe586('0x2e')](handleError(_0x198be5,null));};exports[_0xe586('0x6a')]=function(_0x7f9226,_0x346390){return db['FaxAccount']['describe']()[_0xe586('0x25')](respondWithResult(_0x346390,null))[_0xe586('0x2e')](handleError(_0x346390,null));};exports[_0xe586('0x6b')]=function(_0x4d5feb,_0x478dee,_0xb68010){if(_0x4d5feb[_0xe586('0x68')]['id']){delete _0x4d5feb[_0xe586('0x68')]['id'];}return db[_0xe586('0x58')][_0xe586('0x5e')]({'where':{'id':_0x4d5feb[_0xe586('0x69')]['id']}})[_0xe586('0x25')](handleEntityNotFound(_0x478dee,null))[_0xe586('0x25')](function(_0x495c47){if(_0x495c47){_0x4d5feb[_0xe586('0x68')][_0xe586('0x6c')]=_0x495c47['id'];return db[_0xe586('0x6d')]['create'](_0x4d5feb['body']);}})['then'](respondWithResult(_0x478dee,null))['catch'](handleError(_0x478dee,null));};exports[_0xe586('0x6e')]=function(_0xddfcfb,_0x5e8076,_0x488033){var _0x105471={'raw':![],'where':{}};var _0x16bf76={};var _0x4fa856={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0xddfcfb[_0xe586('0x69')]['id']}})[_0xe586('0x25')](handleEntityNotFound(_0x5e8076,null))['then'](function(_0x1f030a){if(_0x1f030a){_0x16bf76['model']=_[_0xe586('0x49')](db[_0xe586('0x6d')]['rawAttributes']);_0x16bf76[_0xe586('0x48')]=_[_0xe586('0x49')](_0xddfcfb[_0xe586('0x48')]);_0x16bf76[_0xe586('0x4a')]=_['intersection'](_0x16bf76['model'],_0x16bf76[_0xe586('0x48')]);_0x105471[_0xe586('0x4c')]=_[_0xe586('0x4b')](_0x16bf76['model'],qs['fields'](_0xddfcfb[_0xe586('0x48')][_0xe586('0x4d')]));_0x105471[_0xe586('0x4c')]=_0x105471['attributes'][_0xe586('0x4e')]?_0x105471[_0xe586('0x4c')]:_0x16bf76[_0xe586('0x47')];if(!_0xddfcfb['query'][_0xe586('0x4f')](_0xe586('0x50'))){_0x105471[_0xe586('0x31')]=qs['limit'](_0xddfcfb[_0xe586('0x48')][_0xe586('0x31')]);_0x105471[_0xe586('0x30')]=qs[_0xe586('0x30')](_0xddfcfb['query'][_0xe586('0x30')]);}_0x105471[_0xe586('0x6f')]=qs[_0xe586('0x51')](_0xddfcfb[_0xe586('0x48')]['sort']);_0x105471[_0xe586('0x54')]=qs[_0xe586('0x4a')](_[_0xe586('0x52')](_0xddfcfb[_0xe586('0x48')],_0x16bf76[_0xe586('0x4a')]));_0x105471[_0xe586('0x54')][_0xe586('0x6c')]=_0x1f030a['id'];if(_0xddfcfb['query']['filter']){_0x105471[_0xe586('0x54')]=_['merge'](_0x105471[_0xe586('0x54')],{'$or':_[_0xe586('0x43')](_0x105471['attributes'],function(_0x4e6fe1){var _0x34c851={};_0x34c851[_0x4e6fe1]={'$like':'%'+_0xddfcfb[_0xe586('0x48')][_0xe586('0x53')]+'%'};return _0x34c851;})});}_0x105471=_[_0xe586('0x56')]({},_0x105471,_0xddfcfb[_0xe586('0x57')]);return db[_0xe586('0x6d')][_0xe586('0x2f')]({'where':_0x105471[_0xe586('0x54')]})[_0xe586('0x25')](function(_0xf447c3){_0x4fa856[_0xe586('0x2f')]=_0xf447c3;if(_0xddfcfb[_0xe586('0x48')][_0xe586('0x59')]){_0x105471[_0xe586('0x5a')]=[{'all':!![]}];}return db[_0xe586('0x6d')]['findAll'](_0x105471);})[_0xe586('0x25')](function(_0x3b4d48){_0x4fa856[_0xe586('0x5c')]=_0x3b4d48;return _0x4fa856;});}})[_0xe586('0x25')](respondWithFilteredResult(_0x5e8076,_0x105471))[_0xe586('0x2e')](handleError(_0x5e8076,null));};exports[_0xe586('0x70')]=function(_0x1d972a,_0x3df67a,_0xa21f66){return db[_0xe586('0x58')][_0xe586('0x5e')]({'where':{'id':_0x1d972a[_0xe586('0x69')]['id']}})[_0xe586('0x25')](handleEntityNotFound(_0x3df67a,null))['then'](function(_0x8aaf4b){if(_0x8aaf4b){return _0x8aaf4b[_0xe586('0x70')](_0x1d972a[_0xe586('0x48')][_0xe586('0x71')]);}})['then'](respondWithStatusCode(_0x3df67a,null))[_0xe586('0x2e')](handleError(_0x3df67a,null));};exports[_0xe586('0x72')]=function(_0x277d12,_0x2d5eec,_0x137288){if(_0x277d12[_0xe586('0x68')]['id']){delete _0x277d12[_0xe586('0x68')]['id'];}return db['FaxAccount'][_0xe586('0x5e')]({'where':{'id':_0x277d12[_0xe586('0x69')]['id']}})['then'](handleEntityNotFound(_0x2d5eec,null))['then'](function(_0x51cdc4){if(_0x51cdc4){_0x277d12[_0xe586('0x68')][_0xe586('0x6c')]=_0x51cdc4['id'];return db[_0xe586('0x73')][_0xe586('0x5f')](_0x277d12[_0xe586('0x68')]);}})[_0xe586('0x25')](respondWithResult(_0x2d5eec,null))['catch'](handleError(_0x2d5eec,null));};exports['getAnswers']=function(_0xa9962b,_0x573d5c,_0x393327){var _0x5ce9ed={'raw':![],'where':{}};var _0x446de6={};var _0x5d5fb6={'count':0x0,'rows':[]};return db['FaxAccount'][_0xe586('0x74')]({'where':{'id':_0xa9962b[_0xe586('0x69')]['id']}})[_0xe586('0x25')](handleEntityNotFound(_0x573d5c,null))[_0xe586('0x25')](function(_0x284772){if(_0x284772){_0x446de6[_0xe586('0x47')]=_[_0xe586('0x49')](db['CannedAnswer'][_0xe586('0x44')]);_0x446de6['query']=_[_0xe586('0x49')](_0xa9962b[_0xe586('0x48')]);_0x446de6[_0xe586('0x4a')]=_['intersection'](_0x446de6['model'],_0x446de6[_0xe586('0x48')]);_0x5ce9ed['attributes']=_[_0xe586('0x4b')](_0x446de6[_0xe586('0x47')],qs[_0xe586('0x4d')](_0xa9962b[_0xe586('0x48')][_0xe586('0x4d')]));_0x5ce9ed['attributes']=_0x5ce9ed[_0xe586('0x4c')][_0xe586('0x4e')]?_0x5ce9ed['attributes']:_0x446de6['model'];if(!_0xa9962b['query']['hasOwnProperty']('nolimit')){_0x5ce9ed[_0xe586('0x31')]=qs[_0xe586('0x31')](_0xa9962b[_0xe586('0x48')]['limit']);_0x5ce9ed[_0xe586('0x30')]=qs[_0xe586('0x30')](_0xa9962b[_0xe586('0x48')][_0xe586('0x30')]);}_0x5ce9ed[_0xe586('0x6f')]=qs[_0xe586('0x51')](_0xa9962b[_0xe586('0x48')][_0xe586('0x51')]);_0x5ce9ed['where']=qs[_0xe586('0x4a')](_[_0xe586('0x52')](_0xa9962b['query'],_0x446de6[_0xe586('0x4a')]));_0x5ce9ed[_0xe586('0x54')][_0xe586('0x6c')]=_0x284772['id'];if(_0xa9962b['query']['filter']){_0x5ce9ed[_0xe586('0x54')]=_[_0xe586('0x56')](_0x5ce9ed['where'],{'$or':_[_0xe586('0x43')](_0x5ce9ed[_0xe586('0x4c')],function(_0x399e66){var _0x149015={};_0x149015[_0x399e66]={'$like':'%'+_0xa9962b[_0xe586('0x48')][_0xe586('0x53')]+'%'};return _0x149015;})});}_0x5ce9ed=_['merge']({},_0x5ce9ed,_0xa9962b['options']);return db[_0xe586('0x73')][_0xe586('0x2f')]({'where':_0x5ce9ed['where']})['then'](function(_0x5c2248){_0x5d5fb6[_0xe586('0x2f')]=_0x5c2248;if(_0xa9962b[_0xe586('0x48')]['includeAll']){_0x5ce9ed[_0xe586('0x5a')]=[{'all':!![]}];}return db[_0xe586('0x73')][_0xe586('0x5b')](_0x5ce9ed);})[_0xe586('0x25')](function(_0x50735b){_0x5d5fb6['rows']=_0x50735b;return _0x5d5fb6;});}})[_0xe586('0x25')](respondWithFilteredResult(_0x573d5c,_0x5ce9ed))[_0xe586('0x2e')](handleError(_0x573d5c,null));};exports[_0xe586('0x75')]=function(_0x14cdfc,_0x21d361,_0x418866){return db[_0xe586('0x58')][_0xe586('0x5e')]({'where':{'id':_0x14cdfc[_0xe586('0x69')]['id']}})[_0xe586('0x25')](handleEntityNotFound(_0x21d361,null))[_0xe586('0x25')](function(_0x1245a9){if(_0x1245a9){return _0x1245a9[_0xe586('0x75')](_0x14cdfc[_0xe586('0x48')][_0xe586('0x71')]);}})[_0xe586('0x25')](respondWithStatusCode(_0x21d361,null))[_0xe586('0x2e')](handleError(_0x21d361,null));};exports[_0xe586('0x76')]=function(_0x309fb2,_0x55adc9,_0x49b7a7){return db['FaxInteraction'][_0xe586('0x5e')]({'where':{'id':_0x309fb2[_0xe586('0x69')]['id']}})[_0xe586('0x25')](handleEntityNotFound(_0x55adc9,null))['then'](function(_0x5883cf){if(_0x5883cf){return _0x5883cf[_0xe586('0x76')](_0x309fb2[_0xe586('0x68')]['ids'],_[_0xe586('0x77')](_0x309fb2[_0xe586('0x68')],[_0xe586('0x71'),'id'])||{});}})[_0xe586('0x25')](respondWithResult(_0x55adc9,null))[_0xe586('0x2e')](handleError(_0x55adc9,null));};exports[_0xe586('0x78')]=function(_0x2e0feb,_0x272c19,_0x1c1699){var _0x3de296={'raw':![],'where':{}};var _0x1c0be0={};var _0x57a97d={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x2e0feb[_0xe586('0x69')]['id']}})['then'](handleEntityNotFound(_0x272c19,null))['then'](function(_0x2df933){if(_0x2df933){_0x1c0be0['model']=_[_0xe586('0x49')](db[_0xe586('0x79')][_0xe586('0x44')]);_0x1c0be0[_0xe586('0x48')]=_['keys'](_0x2e0feb[_0xe586('0x48')]);_0x1c0be0[_0xe586('0x4a')]=_['intersection'](_0x1c0be0[_0xe586('0x47')],_0x1c0be0[_0xe586('0x48')]);_0x3de296['attributes']=_[_0xe586('0x4b')](_0x1c0be0[_0xe586('0x47')],qs['fields'](_0x2e0feb[_0xe586('0x48')][_0xe586('0x4d')]));_0x3de296['attributes']=_0x3de296[_0xe586('0x4c')]['length']?_0x3de296[_0xe586('0x4c')]:_0x1c0be0[_0xe586('0x47')];if(!_0x2e0feb[_0xe586('0x48')]['hasOwnProperty']('nolimit')){_0x3de296[_0xe586('0x31')]=qs[_0xe586('0x31')](_0x2e0feb[_0xe586('0x48')][_0xe586('0x31')]);_0x3de296[_0xe586('0x30')]=qs[_0xe586('0x30')](_0x2e0feb[_0xe586('0x48')][_0xe586('0x30')]);}_0x3de296[_0xe586('0x6f')]=qs['sort'](_0x2e0feb[_0xe586('0x48')][_0xe586('0x51')]);_0x3de296['where']=qs[_0xe586('0x4a')](_['pick'](_0x2e0feb['query'],_0x1c0be0[_0xe586('0x4a')]));_0x3de296[_0xe586('0x54')][_0xe586('0x6c')]=_0x2df933['id'];if(_0x2e0feb[_0xe586('0x48')]['filter']){_0x3de296[_0xe586('0x54')]=_[_0xe586('0x56')](_0x3de296[_0xe586('0x54')],{'$or':_[_0xe586('0x43')](_0x3de296[_0xe586('0x4c')],function(_0x519da3){var _0x135d4d={};_0x135d4d[_0x519da3]={'$like':'%'+_0x2e0feb[_0xe586('0x48')]['filter']+'%'};return _0x135d4d;})});}_0x3de296=_[_0xe586('0x56')]({},_0x3de296,_0x2e0feb[_0xe586('0x57')]);return db[_0xe586('0x79')][_0xe586('0x2f')]({'where':_0x3de296['where']})[_0xe586('0x25')](function(_0xf8fd6c){_0x57a97d['count']=_0xf8fd6c;if(_0x2e0feb[_0xe586('0x48')][_0xe586('0x59')]){_0x3de296[_0xe586('0x5a')]=[{'model':db[_0xe586('0x7a')],'as':_0xe586('0x7b'),'required':![]},{'model':db[_0xe586('0x7c')],'as':_0xe586('0x7d'),'attributes':[_0xe586('0x40'),_0xe586('0x7e'),_0xe586('0x7f')],'required':![]},{'model':db[_0xe586('0x80')],'as':_0xe586('0x81'),'attributes':['id',_0xe586('0x40'),'color'],'where':_0x2e0feb[_0xe586('0x48')][_0xe586('0x82')]?{'id':_0x2e0feb[_0xe586('0x48')][_0xe586('0x82')]}:undefined,'required':_0x2e0feb[_0xe586('0x48')]['tag']?!![]:![]}];}return db[_0xe586('0x79')][_0xe586('0x5b')](_0x3de296);})['then'](function(_0x5c8902){_0x57a97d['rows']=_0x5c8902;return _0x57a97d;});}})[_0xe586('0x25')](respondWithFilteredResult(_0x272c19,_0x3de296))['catch'](handleError(_0x272c19,null));};exports[_0xe586('0x83')]=function(_0x2765a9,_0x261ec8,_0x497877){return db[_0xe586('0x58')][_0xe586('0x74')]({'where':{'id':_0x2765a9[_0xe586('0x69')]['id']}})[_0xe586('0x25')](handleEntityNotFound(_0x261ec8,null))[_0xe586('0x25')](function(_0x152185){if(_0x152185){return db['sequelize'][_0xe586('0x84')](function(_0x3cd873){return db['FaxApplication'][_0xe586('0x39')]({'where':{'FaxAccountId':_0x2765a9[_0xe586('0x69')]['id']},'transaction':_0x3cd873})[_0xe586('0x25')](function(_0x45494b){var _0x3a4a8f=_['map'](_0x2765a9[_0xe586('0x68')],function(_0x487c06){_0x487c06[_0xe586('0x6c')]=_0x2765a9['params']['id'];return _0x487c06;});return db['FaxApplication'][_0xe586('0x85')](_0x3a4a8f,{'transaction':_0x3cd873});});})[_0xe586('0x25')](function(){return db[_0xe586('0x86')][_0xe586('0x87')]({'where':{'FaxAccountId':_0x2765a9[_0xe586('0x69')]['id']},'order':_0xe586('0x88')});});}})[_0xe586('0x25')](respondWithResult(_0x261ec8,null))[_0xe586('0x2e')](handleError(_0x261ec8,null));};exports[_0xe586('0x89')]=function(_0x52e383,_0xc857f0,_0x1ca7c4){var _0x491f58={};var _0x1d8570={};var _0x32f40b;var _0x4b7ecb;return db[_0xe586('0x58')][_0xe586('0x74')]({'where':{'id':_0x52e383[_0xe586('0x69')]['id']}})[_0xe586('0x25')](handleEntityNotFound(_0xc857f0,null))[_0xe586('0x25')](function(_0x45d08d){if(_0x45d08d){_0x32f40b=_0x45d08d;_0x1d8570['model']=_['keys'](db[_0xe586('0x86')]['rawAttributes']);_0x1d8570[_0xe586('0x48')]=_[_0xe586('0x49')](_0x52e383[_0xe586('0x48')]);_0x1d8570[_0xe586('0x4a')]=_[_0xe586('0x4b')](_0x1d8570[_0xe586('0x47')],_0x1d8570[_0xe586('0x48')]);_0x491f58[_0xe586('0x4c')]=_['intersection'](_0x1d8570['model'],qs[_0xe586('0x4d')](_0x52e383[_0xe586('0x48')][_0xe586('0x4d')]));_0x491f58[_0xe586('0x4c')]=_0x491f58[_0xe586('0x4c')][_0xe586('0x4e')]?_0x491f58['attributes']:_0x1d8570[_0xe586('0x47')];_0x491f58[_0xe586('0x6f')]=qs[_0xe586('0x51')](_0x52e383[_0xe586('0x48')][_0xe586('0x51')]);_0x491f58['where']=qs['filters'](_[_0xe586('0x52')](_0x52e383[_0xe586('0x48')],_0x1d8570[_0xe586('0x4a')]));if(_0x52e383[_0xe586('0x48')]['filter']){_0x491f58[_0xe586('0x54')]=_[_0xe586('0x56')](_0x491f58['where'],{'$or':_[_0xe586('0x43')](_0x491f58[_0xe586('0x4c')],function(_0x121856){var _0x3b11f5={};_0x3b11f5[_0x121856]={'$like':'%'+_0x52e383[_0xe586('0x48')]['filter']+'%'};return _0x3b11f5;})});}_0x491f58=_[_0xe586('0x56')]({},_0x491f58,_0x52e383[_0xe586('0x57')]);return _0x32f40b[_0xe586('0x89')](_0x491f58);}})[_0xe586('0x25')](function(_0x2ea9fd){if(_0x2ea9fd){_0x4b7ecb=_0x2ea9fd[_0xe586('0x4e')];if(!_0x52e383[_0xe586('0x48')][_0xe586('0x4f')](_0xe586('0x50'))){_0x491f58[_0xe586('0x31')]=qs['limit'](_0x52e383[_0xe586('0x48')][_0xe586('0x31')]);_0x491f58['offset']=qs[_0xe586('0x30')](_0x52e383[_0xe586('0x48')][_0xe586('0x30')]);}return _0x32f40b[_0xe586('0x89')](_0x491f58);}})[_0xe586('0x25')](function(_0x46ac5b){if(_0x46ac5b){return _0x46ac5b?{'count':_0x4b7ecb,'rows':_0x46ac5b}:null;}})[_0xe586('0x25')](respondWithResult(_0xc857f0,null))[_0xe586('0x2e')](handleError(_0xc857f0,null));};function Extension(_0x34a4de,_0x10dd0b,_0x38a4f2,_0x1cd18a){this[_0xe586('0x8a')]='from-voip-provider';this[_0xe586('0x8b')]=_0x34a4de[_0xe586('0x8c')];this['app']=_0x1cd18a;this[_0xe586('0x45')]=_0xe586('0x8d');this[_0xe586('0x8e')]='Fax\x20Extension';this[_0xe586('0x6c')]=_0x34a4de['id'];this[_0xe586('0x88')]=_0x10dd0b;this[_0xe586('0x8f')]=_0x38a4f2;}function createExtensionsReciveFax(_0x52f199){var _0x4c3032=0x1;var _0x2e137d=[];_0x2e137d['push'](new Extension(_0x52f199,_0x4c3032,'',_0xe586('0x90')));_0x4c3032+=0x1;_0x2e137d[_0xe586('0x91')](new Extension(_0x52f199,_0x4c3032,_0xe586('0x92'),_0xe586('0x93')));_0x4c3032+=0x1;for(var _0x266238 in _0x52f199){if(_0x52f199[_0xe586('0x4f')](_0x266238)&&(_0x266238===_0xe586('0x94')||_0x266238===_0xe586('0x8c')||_0x266238===_0xe586('0x95')||_0x266238==='faxdetect'||_0x266238===_0xe586('0x96')||_0x266238===_0xe586('0x97')||_0x266238===_0xe586('0x98')||_0x266238===_0xe586('0x99')||_0x266238==='t38timeout')){_0x2e137d['push'](new Extension(_0x52f199,_0x4c3032,_0xe586('0x9a')+_0x266238+')='+_0x52f199[_0x266238],_0xe586('0x93')));_0x4c3032+=0x1;}}_0x2e137d[_0xe586('0x91')](new Extension(_0x52f199,_0x4c3032,'6',_0xe586('0x9b')));_0x4c3032+=0x1;_0x2e137d[_0xe586('0x91')](new Extension(_0x52f199,_0x4c3032,_0xe586('0x9c'),'ReceiveFax'));_0x4c3032=0x0;return _0x2e137d;}exports[_0xe586('0x9d')]=function(_0x487707,_0x470156,_0x35289f){var _0x2d9dd3;return db['sequelize'][_0xe586('0x84')](function(_0x61c644){return db[_0xe586('0x58')][_0xe586('0x5f')](_0x487707[_0xe586('0x68')],{'transaction':_0x61c644})['then'](function(_0x144315){_0x2d9dd3=_0x144315['get']({'plain':!![]});return db[_0xe586('0x9e')][_0xe586('0x85')](createExtensionsReciveFax(_0x2d9dd3),{'transaction':_0x61c644});});})[_0xe586('0x25')](function(){return _0x2d9dd3;})['then'](respondWithResult(_0x470156,null))[_0xe586('0x2e')](handleError(_0x470156,null));};exports['updateAccountApplications']=function(_0x486a59,_0x3fc627,_0x3003f0){var _0x3ec5c8;return db['sequelize'][_0xe586('0x84')](function(_0x4a8dac){return db[_0xe586('0x58')][_0xe586('0x38')](_0x486a59[_0xe586('0x68')],{'where':{'id':_0x486a59[_0xe586('0x68')]['id']},'transaction':_0x4a8dac})[_0xe586('0x25')](function(_0x1dd5ef){return db['VoiceExtension'][_0xe586('0x39')]({'where':{'FaxAccountId':_0x486a59[_0xe586('0x68')]['id']},'transaction':_0x4a8dac})[_0xe586('0x25')](function(_0x59aa6f){return db[_0xe586('0x9e')][_0xe586('0x85')](createExtensionsReciveFax(_[_0xe586('0x77')](_0x486a59[_0xe586('0x68')],[_0xe586('0x9f'),'key',_0xe586('0xa0'),_0xe586('0xa1'),_0xe586('0xa2'),_0xe586('0xa3')])),{'transaction':_0x4a8dac});});});})[_0xe586('0x25')](function(){return db[_0xe586('0x58')][_0xe586('0xa4')](_0x486a59[_0xe586('0x68')]['id']);})[_0xe586('0x25')](respondWithResult(_0x3fc627,null))[_0xe586('0x2e')](handleError(_0x3fc627,null));};exports[_0xe586('0xa5')]=function(_0x29b401,_0x5aca20,_0x1e05ec){var _0x26acc5={'raw':!![],'where':{}};var _0x1aa97f={};var _0x5043d4={'count':0x0,'rows':[]};return db[_0xe586('0x58')][_0xe586('0x74')]({'where':{'id':_0x29b401[_0xe586('0x69')]['id']}})[_0xe586('0x25')](handleEntityNotFound(_0x5aca20,null))['then'](function(_0x254701){if(_0x254701){_0x1aa97f[_0xe586('0x47')]=_[_0xe586('0x49')](db[_0xe586('0xa6')][_0xe586('0x44')]);_0x1aa97f[_0xe586('0x48')]=_[_0xe586('0x49')](_0x29b401['query']);_0x1aa97f['filters']=_[_0xe586('0x4b')](_0x1aa97f[_0xe586('0x47')],_0x1aa97f['query']);_0x26acc5['attributes']=_['intersection'](_0x1aa97f[_0xe586('0x47')],qs[_0xe586('0x4d')](_0x29b401['query']['fields']));_0x26acc5[_0xe586('0x4c')]=_0x26acc5[_0xe586('0x4c')][_0xe586('0x4e')]?_0x26acc5['attributes']:_0x1aa97f[_0xe586('0x47')];if(!_0x29b401[_0xe586('0x48')][_0xe586('0x4f')](_0xe586('0x50'))){_0x26acc5[_0xe586('0x31')]=qs[_0xe586('0x31')](_0x29b401[_0xe586('0x48')]['limit']);_0x26acc5[_0xe586('0x30')]=qs[_0xe586('0x30')](_0x29b401[_0xe586('0x48')]['offset']);}_0x26acc5['order']=qs[_0xe586('0x51')](_0x29b401[_0xe586('0x48')]['sort']);_0x26acc5[_0xe586('0x54')]=qs['filters'](_[_0xe586('0x52')](_0x29b401[_0xe586('0x48')],_0x1aa97f[_0xe586('0x4a')]));_0x26acc5['where'][_0xe586('0x6c')]=_0x254701['id'];if(_0x29b401[_0xe586('0x48')][_0xe586('0x53')]){_0x26acc5[_0xe586('0x54')]=_[_0xe586('0x56')](_0x26acc5[_0xe586('0x54')],{'$or':_[_0xe586('0x43')](_0x26acc5[_0xe586('0x4c')],function(_0x24623d){var _0x19ad92={};_0x19ad92[_0x24623d]={'$like':'%'+_0x29b401[_0xe586('0x48')][_0xe586('0x53')]+'%'};return _0x19ad92;})});}if(_0x29b401[_0xe586('0x48')][_0xe586('0xa7')]){var _0x2d5c11=_0x29b401[_0xe586('0x48')][_0xe586('0xa7')][_0xe586('0xa8')](',');var _0x40e932={};_0x40e932[_0x2d5c11[0x0]]={'$gte':moment(_0x2d5c11[0x1])['format'](_0xe586('0xa9'))};_0x26acc5[_0xe586('0x54')]=_[_0xe586('0x56')](_0x26acc5[_0xe586('0x54')],_0x40e932);}_0x26acc5=_[_0xe586('0x56')]({},_0x26acc5,_0x29b401['options']);return db[_0xe586('0xa6')][_0xe586('0x2f')]({'where':_0x26acc5[_0xe586('0x54')]})['then'](function(_0x53bb2c){_0x5043d4[_0xe586('0x2f')]=_0x53bb2c;if(_0x29b401[_0xe586('0x48')]['includeAll']){_0x26acc5[_0xe586('0x5a')]=[{'all':!![]}];}return db['FaxMessage'][_0xe586('0x5b')](_0x26acc5);})[_0xe586('0x25')](function(_0x3b361b){_0x5043d4[_0xe586('0x5c')]=_0x3b361b;return _0x5043d4;});}})[_0xe586('0x25')](respondWithFilteredResult(_0x5aca20,_0x26acc5))[_0xe586('0x2e')](handleError(_0x5aca20,null));};exports[_0xe586('0xaa')]=function(_0x1ab225,_0x13db53,_0x4098b7){var _0x10e284,_0x2a3eb8={},_0x15bd28;if(_0x1ab225['body']['to']){_0x15bd28=_0x1ab225['body']['to'][0x0];}return db['FaxAccount'][_0xe586('0x5e')]({'where':{'id':_0x1ab225[_0xe586('0x69')]['id']},'include':[{'model':db[_0xe586('0xab')],'as':_0xe586('0xac'),'include':[{'model':db[_0xe586('0x7a')],'as':_0xe586('0xad'),'where':{'fax':_0x15bd28},'limit':0x1,'order':[['updatedAt',_0xe586('0xae')]]}]}]})[_0xe586('0x25')](handleEntityNotFound(_0x13db53,null))[_0xe586('0x25')](function(_0x200e1c){_0x10e284=_0x200e1c;if(_0x1ab225['body']['attachments']&&_0x1ab225[_0xe586('0x68')]['attachments'][_0xe586('0x4e')]){for(var _0x13fb7c=0x0;_0x13fb7c<_0x1ab225['body']['attachments'][_0xe586('0x4e')];_0x13fb7c+=0x1){_0x1ab225[_0xe586('0x68')][_0xe586('0xaf')][_0x13fb7c]={'filename':_0x1ab225['body'][_0xe586('0xaf')][_0x13fb7c][_0xe586('0x40')],'id':_0x1ab225[_0xe586('0x68')][_0xe586('0xaf')][_0x13fb7c]['id'],'path':path[_0xe586('0xb0')](config[_0xe586('0xb1')],_0xe586('0xb2'),_0x1ab225[_0xe586('0x68')][_0xe586('0xaf')][_0x13fb7c][_0xe586('0xb3')])};}}return respondWithRpcPromise(_0xe586('0xb4'),'CheckAfterSend',{'FaxAccountId':_[_0xe586('0xb5')](_0x1ab225[_0xe586('0x69')]['id'])?undefined:_0x1ab225[_0xe586('0x69')]['id'],'path':_['isNil'](_0x1ab225[_0xe586('0x68')][_0xe586('0xaf')][0x0][_0xe586('0x9')])?undefined:_0x1ab225[_0xe586('0x68')][_0xe586('0xaf')][0x0][_0xe586('0x9')],'fax':_[_0xe586('0xb5')](_0x1ab225['body']['to'][0x0])?undefined:_0x1ab225[_0xe586('0x68')]['to'][0x0]},client9002);})[_0xe586('0x25')](function(){if(_0x10e284){if(_[_0xe586('0xb5')](_0x1ab225[_0xe586('0x68')]['from'])){_0x1ab225[_0xe586('0x68')][_0xe586('0xb6')]=util[_0xe586('0xb7')](_0xe586('0xb8'),_0x10e284[_0xe586('0x40')],_0x10e284[_0xe586('0xb9')]);}if(_0x10e284[_0xe586('0xac')]){if(_0x10e284[_0xe586('0xac')][_0xe586('0xad')][_0xe586('0x4e')]){return _0x10e284[_0xe586('0xac')][_0xe586('0xad')][0x0];}else{return db[_0xe586('0x7a')][_0xe586('0x5f')](_[_0xe586('0x19')](_0x1ab225['body'],{'firstName':_0x1ab225['body']['to'][0x0],'phone':_0x1ab225[_0xe586('0x68')]['to'][0x0],'fax':_0x1ab225[_0xe586('0x68')]['to'][0x0],'ListId':_0x10e284['ListId']}));}}else{throw new Error(_0xe586('0xba'));}}else{throw new Error(_0xe586('0xbb'));}})[_0xe586('0x25')](function(_0x429666){if(_0x429666){return db['FaxInteraction']['find']({'where':{'ContactId':_0x429666['id'],'closed':![],'FaxAccountId':_0x10e284['id']}})[_0xe586('0x25')](function(_0x208379){if(_0x208379){return[_0x208379,![]];}return db[_0xe586('0x79')][_0xe586('0x5f')]({'UserId':_0x1ab225[_0xe586('0x62')]['id'],'ContactId':_0x429666['id'],'FaxAccountId':_0x10e284['id'],'fax':_0x1ab225['body']['to'][0x0],'firstMsgDirection':_0xe586('0xbc'),'Messages':[_[_0xe586('0x56')](_0x1ab225['body'],{'read':![],'body':_0x1ab225[_0xe586('0x68')][_0xe586('0xaf')][0x0][_0xe586('0xbd')],'FaxAccountId':_0x10e284['id'],'UserId':_0x1ab225['user']['id'],'ContactId':_0x429666['id'],'AttachmentId':_0x1ab225[_0xe586('0x68')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xe586('0xa6')],'as':'Messages'}]})[_0xe586('0x25')](function(_0x3e936b){return[_0x3e936b,!![]];});});}else{throw new Error(_0xe586('0xbe'));}})[_0xe586('0xbf')](function(_0x2ad9ba,_0x57741b){if(_0x57741b){return _0x2ad9ba;}return db[_0xe586('0xa6')][_0xe586('0x5f')]({'direction':_0xe586('0xbc'),'read':![],'body':_0x1ab225['body']['attachments'][0x0][_0xe586('0xbd')],'FaxAccountId':_0x10e284['id'],'FaxInteractionId':_0x2ad9ba['id'],'UserId':_0x1ab225['user']['id'],'ContactId':_0x2ad9ba[_0xe586('0xc0')],'AttachmentId':_0x1ab225['body'][_0xe586('0xaf')][0x0]['id']})[_0xe586('0x25')](function(_0x16b2e3){_0x2ad9ba['dataValues'][_0xe586('0xc1')]=[];_0x2ad9ba[_0xe586('0xc2')][_0xe586('0xc1')][_0xe586('0x91')](_0x16b2e3[_0xe586('0xc2')]);return _0x2ad9ba;});})['then'](function(_0x226fd3){respondWithRpcPromise('SendFax',_0xe586('0xc3'),{'FaxAccountId':_[_0xe586('0xb5')](_0x1ab225[_0xe586('0x69')]['id'])?undefined:_0x1ab225['params']['id'],'path':_[_0xe586('0xb5')](_0x1ab225[_0xe586('0x68')]['attachments'][0x0][_0xe586('0x9')])?undefined:_0x1ab225[_0xe586('0x68')][_0xe586('0xaf')][0x0][_0xe586('0x9')],'fax':_['isNil'](_0x1ab225[_0xe586('0x68')]['to'][0x0])?undefined:_0x1ab225[_0xe586('0x68')]['to'][0x0],'AttachmentId':_0x1ab225[_0xe586('0x68')][_0xe586('0xaf')][0x0]['id']},client9002)[_0xe586('0x25')](function(_0x34259d){logger[_0xe586('0x26')](_0xe586('0xc4'),_0x34259d);})['catch'](function(_0x475d93){logger[_0xe586('0x26')](_0xe586('0xc4'),_0x475d93);});return _0x226fd3;})[_0xe586('0x25')](respondWithResult(_0x13db53,null))['catch'](handleError(_0x13db53,null));};exports[_0xe586('0xc5')]=function(_0x260c90,_0x6fd58b,_0x427f36){return db['FaxAccount']['find']({'where':{'id':_0x260c90['params']['id']}})[_0xe586('0x25')](handleEntityNotFound(_0x6fd58b,null))[_0xe586('0x25')](function(_0xe9ece2){if(_0xe9ece2){return _0xe9ece2[_0xe586('0xc5')](_0x260c90['body'][_0xe586('0x71')],_[_0xe586('0x77')](_0x260c90[_0xe586('0x68')],[_0xe586('0x71'),'id'])||{})[_0xe586('0xbf')](function(_0x53e842){for(var _0x21ff28=0x0;_0x21ff28<_0x260c90[_0xe586('0x68')]['ids'][_0xe586('0x4e')];_0x21ff28+=0x1){socket['emit'](_0xe586('0xc6'),{'UserId':_0x260c90[_0xe586('0x68')]['ids'][_0x21ff28],'FaxAccountId':_0x260c90[_0xe586('0x69')]['id']});}return _0x53e842;});}})[_0xe586('0x25')](respondWithResult(_0x6fd58b,null))[_0xe586('0x2e')](handleError(_0x6fd58b,null));};exports[_0xe586('0xc7')]=function(_0x191a8c,_0x11170d,_0x505fac){return db[_0xe586('0x58')][_0xe586('0x5e')]({'where':{'id':_0x191a8c[_0xe586('0x69')]['id']}})[_0xe586('0x25')](handleEntityNotFound(_0x11170d,null))['then'](function(_0x1778d0){if(_0x1778d0){return _0x1778d0[_0xe586('0xc7')](_0x191a8c[_0xe586('0x48')][_0xe586('0x71')])[_0xe586('0x25')](function(){if(_[_0xe586('0xc8')](_0x191a8c[_0xe586('0x48')]['ids'])){for(var _0x5a4a0e=0x0;_0x5a4a0e<_0x191a8c[_0xe586('0x48')]['ids'][_0xe586('0x4e')];_0x5a4a0e+=0x1){socket[_0xe586('0xc9')](_0xe586('0xca'),{'UserId':Number(_0x191a8c[_0xe586('0x48')][_0xe586('0x71')][_0x5a4a0e]),'FaxAccountId':Number(_0x191a8c[_0xe586('0x69')]['id'])});}}else{socket[_0xe586('0xc9')](_0xe586('0xca'),{'UserId':Number(_0x191a8c[_0xe586('0x48')][_0xe586('0x71')]),'FaxAccountId':Number(_0x191a8c[_0xe586('0x69')]['id'])});}});}})[_0xe586('0x25')](respondWithStatusCode(_0x11170d,null))[_0xe586('0x2e')](handleError(_0x11170d,null));};exports[_0xe586('0xcb')]=function(_0xa4e50b,_0x15158b,_0x442720){var _0x41dbe1={};var _0x2effb1={};var _0x5700d7;var _0x4c5942;return db[_0xe586('0x58')]['findOne']({'where':{'id':_0xa4e50b[_0xe586('0x69')]['id']}})['then'](handleEntityNotFound(_0x15158b,null))[_0xe586('0x25')](function(_0x345fe2){if(_0x345fe2){_0x5700d7=_0x345fe2;_0x2effb1[_0xe586('0x47')]=_['keys'](db[_0xe586('0x7c')][_0xe586('0x44')]);_0x2effb1[_0xe586('0x48')]=_[_0xe586('0x49')](_0xa4e50b[_0xe586('0x48')]);_0x2effb1[_0xe586('0x4a')]=_[_0xe586('0x4b')](_0x2effb1[_0xe586('0x47')],_0x2effb1[_0xe586('0x48')]);_0x41dbe1[_0xe586('0x4c')]=_[_0xe586('0x4b')](_0x2effb1[_0xe586('0x47')],qs[_0xe586('0x4d')](_0xa4e50b[_0xe586('0x48')]['fields']));_0x41dbe1[_0xe586('0x4c')]=_0x41dbe1['attributes']['length']?_0x41dbe1[_0xe586('0x4c')]:_0x2effb1[_0xe586('0x47')];_0x41dbe1[_0xe586('0x6f')]=qs['sort'](_0xa4e50b['query'][_0xe586('0x51')]);_0x41dbe1['where']=qs[_0xe586('0x4a')](_['pick'](_0xa4e50b[_0xe586('0x48')],_0x2effb1[_0xe586('0x4a')]));if(_0xa4e50b[_0xe586('0x48')][_0xe586('0x53')]){_0x41dbe1['where']=_[_0xe586('0x56')](_0x41dbe1[_0xe586('0x54')],{'$or':_[_0xe586('0x43')](_0x41dbe1[_0xe586('0x4c')],function(_0x36adaa){var _0x531b5e={};_0x531b5e[_0x36adaa]={'$like':'%'+_0xa4e50b['query'][_0xe586('0x53')]+'%'};return _0x531b5e;})});}_0x41dbe1=_[_0xe586('0x56')]({},_0x41dbe1,_0xa4e50b[_0xe586('0x57')]);return _0x5700d7['getAgents'](_0x41dbe1);}})[_0xe586('0x25')](function(_0x4217e5){if(_0x4217e5){_0x4c5942=_0x4217e5['length'];if(!_0xa4e50b['query'][_0xe586('0x4f')](_0xe586('0x50'))){_0x41dbe1[_0xe586('0x31')]=qs[_0xe586('0x31')](_0xa4e50b[_0xe586('0x48')][_0xe586('0x31')]);_0x41dbe1[_0xe586('0x30')]=qs[_0xe586('0x30')](_0xa4e50b[_0xe586('0x48')][_0xe586('0x30')]);}return _0x5700d7[_0xe586('0xcb')](_0x41dbe1);}})[_0xe586('0x25')](function(_0x3ce271){if(_0x3ce271){return _0x3ce271?{'count':_0x4c5942,'rows':_0x3ce271}:null;}})[_0xe586('0x25')](respondWithResult(_0x15158b,null))[_0xe586('0x2e')](handleError(_0x15158b,null));};
\ No newline at end of file
index 306b581..0dfb68a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa29=['events','FaxAccount','save','emit','hasOwnProperty','hook'];(function(_0x11fbaa,_0x52dc16){var _0x1831fd=function(_0x2bbced){while(--_0x2bbced){_0x11fbaa['push'](_0x11fbaa['shift']());}};_0x1831fd(++_0x52dc16);}(_0xaa29,0x1b0));var _0x9aa2=function(_0x4bbbee,_0x3e164b){_0x4bbbee=_0x4bbbee-0x0;var _0x550eff=_0xaa29[_0x4bbbee];return _0x550eff;};'use strict';var EventEmitter=require(_0x9aa2('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x9aa2('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9aa2('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x50207e){return function(_0xbf3af9,_0x4fa889,_0x8dd894){FaxAccountEvents[_0x9aa2('0x3')](_0x50207e+':'+_0xbf3af9['id'],_0xbf3af9);FaxAccountEvents[_0x9aa2('0x3')](_0x50207e,_0xbf3af9);_0x8dd894(null);};}for(var e in events){if(events[_0x9aa2('0x4')](e)){var event=events[e];FaxAccount[_0x9aa2('0x5')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
+var _0x4830=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','emit','hook'];(function(_0x12c676,_0x4e075b){var _0x1d2c8d=function(_0x5e3a41){while(--_0x5e3a41){_0x12c676['push'](_0x12c676['shift']());}};_0x1d2c8d(++_0x4e075b);}(_0x4830,0xa9));var _0x0483=function(_0x1e4f30,_0x5c20ee){_0x1e4f30=_0x1e4f30-0x0;var _0x39fcd9=_0x4830[_0x1e4f30];return _0x39fcd9;};'use strict';var EventEmitter=require(_0x0483('0x0'));var FaxAccount=require(_0x0483('0x1'))['db'][_0x0483('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0483('0x3')](0x0);var events={'afterCreate':_0x0483('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5b16d5){return function(_0x70f41c,_0x3d4c1b,_0x51222f){FaxAccountEvents[_0x0483('0x5')](_0x5b16d5+':'+_0x70f41c['id'],_0x70f41c);FaxAccountEvents[_0x0483('0x5')](_0x5b16d5,_0x70f41c);_0x51222f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x0483('0x6')](e,emitEvent(event));}}module[_0x0483('0x7')]=FaxAccountEvents;
\ No newline at end of file
index 47593f8..e19729c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18ea=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash','util'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x18ea,0x196));var _0xa18e=function(_0x19a275,_0x92f134){_0x19a275=_0x19a275-0x0;var _0x2f2e3d=_0x18ea[_0x19a275];return _0x2f2e3d;};'use strict';var _=require(_0xa18e('0x0'));var util=require(_0xa18e('0x1'));var logger=require(_0xa18e('0x2'))(_0xa18e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa18e('0x4'));var fs=require('fs');var path=require(_0xa18e('0x5'));var rimraf=require(_0xa18e('0x6'));var config=require(_0xa18e('0x7'));var attributes=require(_0xa18e('0x8'));module[_0xa18e('0x9')]=function(_0x4fd704,_0x4cad9e){return _0x4fd704['define'](_0xa18e('0xa'),attributes,{'tableName':_0xa18e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb61b=['bluebird','request-promise','rimraf','../../config/environment','exports','define','FaxAccount','fax_accounts','util','../../config/logger','moment'];(function(_0x5f2f69,_0x9cf99){var _0x1c4072=function(_0x56b8a8){while(--_0x56b8a8){_0x5f2f69['push'](_0x5f2f69['shift']());}};_0x1c4072(++_0x9cf99);}(_0xb61b,0x147));var _0xbb61=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb61b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xbb61('0x0'));var logger=require(_0xbb61('0x1'))('api');var moment=require(_0xbb61('0x2'));var BPromise=require(_0xbb61('0x3'));var rp=require(_0xbb61('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb61('0x5'));var config=require(_0xbb61('0x6'));var attributes=require('./faxAccount.attributes');module[_0xbb61('0x7')]=function(_0x5c9f56,_0xbcc41e){return _0x5c9f56[_0xbb61('0x8')](_0xbb61('0x9'),attributes,{'tableName':_0xbb61('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3047812..e6ad2e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf044=['startRouting','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetFaxAccount','findAll','options','raw','where','limit','include','map','model','attributes','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','FaxAccount','find','account','CmList','Contacts','Applications','List','get','applications','list','priority','length','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','*,*,*,*','interaction','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent'];(function(_0x1c1a1f,_0x231bc1){var _0x375b4e=function(_0x1501aa){while(--_0x1501aa){_0x1c1a1f['push'](_0x1c1a1f['shift']());}};_0x375b4e(++_0x231bc1);}(_0xf044,0x139));var _0x4f04=function(_0x146fb5,_0x44ef50){_0x146fb5=_0x146fb5-0x0;var _0x3ec54d=_0xf044[_0x146fb5];return _0x3ec54d;};'use strict';var _=require('lodash');var util=require(_0x4f04('0x0'));var moment=require('moment');var BPromise=require(_0x4f04('0x1'));var rs=require(_0x4f04('0x2'));var fs=require('fs');var Redis=require(_0x4f04('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f04('0x4'));var logger=require('../../config/logger')(_0x4f04('0x5'));var config=require(_0x4f04('0x6'));var jayson=require(_0x4f04('0x7'));var client=jayson[_0x4f04('0x8')][_0x4f04('0x9')]({'port':0x232c});config[_0x4f04('0xa')]=_[_0x4f04('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4f04('0xc'))(new Redis(config[_0x4f04('0xa')]));require(_0x4f04('0xd'))['register'](socket);function respondWithRpcPromise(_0x246ba1,_0x5a1d7a,_0xd0b9a){return new BPromise(function(_0x85dcf2,_0x422c81){return client['request'](_0x246ba1,_0xd0b9a)[_0x4f04('0xe')](function(_0x3ce5d5){logger['info'](_0x4f04('0xf'),_0x5a1d7a,_0x4f04('0x10'));logger[_0x4f04('0x11')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5a1d7a,'request\x20sent',JSON[_0x4f04('0x12')](_0x3ce5d5));if(_0x3ce5d5[_0x4f04('0x13')]){if(_0x3ce5d5[_0x4f04('0x13')][_0x4f04('0x14')]===0x1f4){logger[_0x4f04('0x13')](_0x4f04('0xf'),_0x5a1d7a,_0x3ce5d5[_0x4f04('0x13')][_0x4f04('0x15')]);return _0x422c81(_0x3ce5d5[_0x4f04('0x13')][_0x4f04('0x15')]);}logger['error'](_0x4f04('0xf'),_0x5a1d7a,_0x3ce5d5[_0x4f04('0x13')][_0x4f04('0x15')]);return _0x85dcf2(_0x3ce5d5[_0x4f04('0x13')][_0x4f04('0x15')]);}else{logger[_0x4f04('0x16')]('FaxAccount,\x20%s,\x20%s',_0x5a1d7a,_0x4f04('0x10'));_0x85dcf2(_0x3ce5d5[_0x4f04('0x17')][_0x4f04('0x15')]);}})[_0x4f04('0x18')](function(_0x3cf7dd){logger[_0x4f04('0x13')](_0x4f04('0xf'),_0x5a1d7a,_0x3cf7dd);_0x422c81(_0x3cf7dd);});});}exports[_0x4f04('0x19')]=function(_0x468025){var _0x42c92a=this;return new Promise(function(_0x2d0083,_0x257bc0){return db['FaxAccount'][_0x4f04('0x1a')]({'raw':_0x468025[_0x4f04('0x1b')]?_0x468025['options'][_0x4f04('0x1c')]===undefined?!![]:![]:!![],'where':_0x468025[_0x4f04('0x1b')]?_0x468025[_0x4f04('0x1b')][_0x4f04('0x1d')]||null:null,'attributes':_0x468025[_0x4f04('0x1b')]?_0x468025[_0x4f04('0x1b')]['attributes']||null:null,'limit':_0x468025['options']?_0x468025['options'][_0x4f04('0x1e')]||null:null,'include':_0x468025['options']?_0x468025[_0x4f04('0x1b')][_0x4f04('0x1f')]?_[_0x4f04('0x20')](_0x468025['options'][_0x4f04('0x1f')],function(_0x59b998){return{'model':db[_0x59b998[_0x4f04('0x21')]],'as':_0x59b998['as'],'attributes':_0x59b998[_0x4f04('0x22')],'include':_0x59b998['include']?_[_0x4f04('0x20')](_0x59b998[_0x4f04('0x1f')],function(_0x383455){return{'model':db[_0x383455['model']],'as':_0x383455['as'],'attributes':_0x383455[_0x4f04('0x22')],'include':_0x383455[_0x4f04('0x1f')]?_['map'](_0x383455[_0x4f04('0x1f')],function(_0x3d6983){return{'model':db[_0x3d6983[_0x4f04('0x21')]],'as':_0x3d6983['as'],'attributes':_0x3d6983[_0x4f04('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4f04('0xe')](function(_0x13dae6){logger[_0x4f04('0x16')](_0x4f04('0x19'),_0x468025);logger[_0x4f04('0x11')](_0x4f04('0x19'),_0x468025,JSON[_0x4f04('0x12')](_0x13dae6));_0x2d0083(_0x13dae6);})['catch'](function(_0x37df72){logger['error'](_0x4f04('0x19'),_0x37df72[_0x4f04('0x15')],_0x468025);_0x257bc0(_0x42c92a[_0x4f04('0x13')](0x1f4,_0x37df72['message']));});});};exports['NotifyFaxAccount']=function(_0x1ae3ef,_0x67cf09,_0xeaee52){var _0x48913d=this;return new Promise(function(_0x2663b5,_0x3966c1){var _0x56cb2e={'body':_0x1ae3ef['body'],'channel':_0x4f04('0x23')};var _0x3916d9=[];var _0xf0c1d6=[];var _0xa39b43={};return db['CmContact'][_0x4f04('0x24')]()[_0x4f04('0xe')](function(_0x51ed2d){if(!_0x51ed2d){throw new db[(_0x4f04('0x25'))][(_0x4f04('0x26'))](_0x4f04('0x27'));}_0x3916d9=_[_0x4f04('0x28')](_['keys'](_0x51ed2d),[_0x4f04('0x29'),_0x4f04('0x2a')]);_0xf0c1d6=_[_0x4f04('0x28')](_['keys'](_0x51ed2d),[_0x4f04('0x29'),'updatedAt',_0x4f04('0x2b'),_0x4f04('0x2c')]);if(_0x1ae3ef[_0x4f04('0x2d')]['id']){delete _0x1ae3ef['body']['id'];}if(_[_0x4f04('0x2e')](_0x1ae3ef[_0x4f04('0x2d')][_0x4f04('0x2f')])){throw new db[(_0x4f04('0x25'))][(_0x4f04('0x26'))](_0x4f04('0x30'));}if(_[_0x4f04('0x2e')](_0x1ae3ef[_0x4f04('0x2d')]['body'])||_0x1ae3ef[_0x4f04('0x2d')][_0x4f04('0x2d')]===''){throw new db[(_0x4f04('0x25'))][(_0x4f04('0x26'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4f04('0x2e')](_0x1ae3ef['body'][_0x4f04('0x31')])){throw new db[(_0x4f04('0x25'))][(_0x4f04('0x26'))](_0x4f04('0x32')+_0xf0c1d6);}if(!_[_0x4f04('0x33')](_0xf0c1d6,_0x1ae3ef['body'][_0x4f04('0x31')])){throw new db['Sequelize'][(_0x4f04('0x26'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf0c1d6);}_0xa39b43[_0x1ae3ef['body'][_0x4f04('0x31')]]=_0x1ae3ef['body'][_0x4f04('0x2f')];})[_0x4f04('0xe')](function(){return db[_0x4f04('0x34')][_0x4f04('0x35')]({'where':{'id':_0x1ae3ef[_0x4f04('0x36')]['id']},'include':[{'model':db[_0x4f04('0x37')],'as':'List','include':[{'model':db['CmContact'],'as':_0x4f04('0x38'),'where':_0xa39b43,'limit':0x1,'order':[[_0x4f04('0x2a'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0x4f04('0x39')}]});})[_0x4f04('0xe')](function(_0x5f1c0e){if(_0x5f1c0e&&_0x5f1c0e[_0x4f04('0x3a')]){var _0x4d8088=_0x5f1c0e[_0x4f04('0x3b')]({'plain':!![]});_0x56cb2e[_0x4f04('0x36')]=_0x4d8088;_0x56cb2e[_0x4f04('0x3c')]=_0x4d8088[_0x4f04('0x39')];_0x56cb2e[_0x4f04('0x3d')]=_0x4d8088[_0x4f04('0x3a')];_0x56cb2e[_0x4f04('0x3c')]=_['orderBy'](_0x56cb2e[_0x4f04('0x3c')],[_0x4f04('0x3e')],['asc']);if(_0x56cb2e[_0x4f04('0x36')][_0x4f04('0x39')]){delete _0x56cb2e['account']['Applications'];}if(_0x56cb2e[_0x4f04('0x36')][_0x4f04('0x3a')]&&_0x56cb2e[_0x4f04('0x36')]['List'][_0x4f04('0x38')][_0x4f04('0x3f')]){return _0x56cb2e[_0x4f04('0x36')][_0x4f04('0x3a')][_0x4f04('0x38')][0x0];}var _0x446e66=_[_0x4f04('0xb')](_0x1ae3ef[_0x4f04('0x2d')],{'firstName':_0x1ae3ef[_0x4f04('0x2d')][_0x4f04('0x2f')],'ListId':_0x4d8088['ListId']});_0x446e66[_0x1ae3ef[_0x4f04('0x2d')]['mapKey']]=_0x1ae3ef['body'][_0x4f04('0x2f')];return db['CmContact'][_0x4f04('0x40')](_0x446e66,{'fields':_0x3916d9,'raw':!![]});}})['then'](function(_0x93ef93){_0x56cb2e[_0x4f04('0x41')]=_0x93ef93;if(_0x93ef93){var _0x5dfb1c={'ContactId':_0x93ef93['id'],'FaxAccountId':_0x1ae3ef[_0x4f04('0x36')]['id'],'fax':_0x93ef93[_0x4f04('0x23')]};return db[_0x4f04('0x42')][_0x4f04('0x35')]({'where':{'ContactId':_0x93ef93['id'],'closed':![],'FaxAccountId':_0x1ae3ef['account']['id']}})[_0x4f04('0xe')](function(_0x174860){if(_0x174860){return[_0x174860,![]];}return db['FaxInteraction']['create'](_0x5dfb1c)[_0x4f04('0xe')](function(_0x2f86e1){return[_0x2f86e1,!![]];});});}else{throw new Error(_0x4f04('0x43'));}})['spread'](function(_0x14fb07,_0xfa6a26){var _0x2cdb77=_0x14fb07[_0x4f04('0x3b')]({'plain':!![]});if(_0xfa6a26){if(_0x56cb2e['account'][_0x4f04('0x44')]){_0x56cb2e[_0x4f04('0x3c')]['push']({'id':0x0,'priority':_0x56cb2e['applications'][_0x4f04('0x3f')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x4f04('0x45')});}_0x2cdb77['created']=!![];}else{_0x2cdb77['created']=![];}_0x56cb2e[_0x4f04('0x46')]=_0x2cdb77;return db['FaxMessage'][_0x4f04('0x40')]({'body':_0x1ae3ef[_0x4f04('0x2d')][_0x4f04('0x2d')],'FaxAccountId':_0x1ae3ef[_0x4f04('0x36')]['id'],'FaxInteractionId':_0x14fb07['id'],'direction':'in','ContactId':_0x14fb07['ContactId'],'AttachmentId':_0x1ae3ef[_0x4f04('0x2d')][_0x4f04('0x47')]});})[_0x4f04('0xe')](function(_0x1de835){_0x56cb2e[_0x4f04('0x15')]=_0x1de835;if(_0x56cb2e[_0x4f04('0x46')][_0x4f04('0x48')]){return db[_0x4f04('0x49')][_0x4f04('0x35')]({'attributes':['id','name'],'where':{'id':_0x56cb2e[_0x4f04('0x46')][_0x4f04('0x48')]}})[_0x4f04('0xe')](function(_0x3befd8){if(_0x3befd8){_0x56cb2e[_0x4f04('0x3c')][_0x4f04('0x4a')]({'id':0x0,'priority':0x0,'app':_0x4f04('0x4b'),'appdata':_0x3befd8['name']+','+(_0x56cb2e[_0x4f04('0x36')][_0x4f04('0x4c')]||0xa),'interval':_0x4f04('0x45')});}return respondWithRpcPromise('Start',_0x4f04('0x4d'),_0x56cb2e);});}return respondWithRpcPromise('Start',_0x4f04('0x4d'),_0x56cb2e);})[_0x4f04('0xe')](function(_0x7e937d){_0x2663b5(_0x7e937d);})['catch'](function(_0x4df758){_0x3966c1(_0x48913d[_0x4f04('0x13')](0x1f4,_0x4df758[_0x4f04('0x15')]));});});};
\ No newline at end of file
+var _0xfdc4=['http','defaults','localhost','./faxAccount.socket','register','request','then','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','catch','GetFaxAccount','FaxAccount','findAll','options','where','attributes','include','model','map','NotifyFaxAccount','body','ValidationError','no\x20available\x20attributes','difference','updatedAt','keys','createdAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','CmContact','DESC','FaxApplication','List','get','applications','orderBy','priority','Applications','length','Contacts','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','unmanaged','*,*,*,*','created','FaxMessage','interaction','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfdc4,0x1a4));var _0x4fdc=function(_0x3a4410,_0x17a9f2){_0x3a4410=_0x3a4410-0x0;var _0x183049=_0xfdc4[_0x3a4410];return _0x183049;};'use strict';var _=require(_0x4fdc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4fdc('0x1'));var rs=require(_0x4fdc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4fdc('0x3'))['db'];var utils=require(_0x4fdc('0x4'));var logger=require(_0x4fdc('0x5'))(_0x4fdc('0x6'));var config=require(_0x4fdc('0x7'));var jayson=require(_0x4fdc('0x8'));var client=jayson[_0x4fdc('0x9')][_0x4fdc('0xa')]({'port':0x232c});config['redis']=_[_0x4fdc('0xb')](config['redis'],{'host':_0x4fdc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4fdc('0xd'))[_0x4fdc('0xe')](socket);function respondWithRpcPromise(_0x3bfb8f,_0x129394,_0x14100d){return new BPromise(function(_0x26de85,_0x548e21){return client[_0x4fdc('0xf')](_0x3bfb8f,_0x14100d)[_0x4fdc('0x10')](function(_0x228864){logger['info']('FaxAccount,\x20%s,\x20%s',_0x129394,'request\x20sent');logger[_0x4fdc('0x11')](_0x4fdc('0x12'),_0x129394,_0x4fdc('0x13'),JSON[_0x4fdc('0x14')](_0x228864));if(_0x228864['error']){if(_0x228864[_0x4fdc('0x15')][_0x4fdc('0x16')]===0x1f4){logger[_0x4fdc('0x15')](_0x4fdc('0x17'),_0x129394,_0x228864[_0x4fdc('0x15')]['message']);return _0x548e21(_0x228864['error'][_0x4fdc('0x18')]);}logger[_0x4fdc('0x15')](_0x4fdc('0x17'),_0x129394,_0x228864['error'][_0x4fdc('0x18')]);return _0x26de85(_0x228864[_0x4fdc('0x15')]['message']);}else{logger[_0x4fdc('0x19')]('FaxAccount,\x20%s,\x20%s',_0x129394,_0x4fdc('0x13'));_0x26de85(_0x228864['result'][_0x4fdc('0x18')]);}})[_0x4fdc('0x1a')](function(_0x35bcd3){logger[_0x4fdc('0x15')](_0x4fdc('0x17'),_0x129394,_0x35bcd3);_0x548e21(_0x35bcd3);});});}exports[_0x4fdc('0x1b')]=function(_0x3c556d){var _0xfec81=this;return new Promise(function(_0x53ed20,_0x4eaad1){return db[_0x4fdc('0x1c')][_0x4fdc('0x1d')]({'raw':_0x3c556d[_0x4fdc('0x1e')]?_0x3c556d[_0x4fdc('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3c556d[_0x4fdc('0x1e')]?_0x3c556d[_0x4fdc('0x1e')][_0x4fdc('0x1f')]||null:null,'attributes':_0x3c556d[_0x4fdc('0x1e')]?_0x3c556d[_0x4fdc('0x1e')][_0x4fdc('0x20')]||null:null,'limit':_0x3c556d[_0x4fdc('0x1e')]?_0x3c556d['options']['limit']||null:null,'include':_0x3c556d[_0x4fdc('0x1e')]?_0x3c556d['options'][_0x4fdc('0x21')]?_['map'](_0x3c556d['options'][_0x4fdc('0x21')],function(_0x3decf3){return{'model':db[_0x3decf3[_0x4fdc('0x22')]],'as':_0x3decf3['as'],'attributes':_0x3decf3[_0x4fdc('0x20')],'include':_0x3decf3[_0x4fdc('0x21')]?_['map'](_0x3decf3[_0x4fdc('0x21')],function(_0x247a98){return{'model':db[_0x247a98[_0x4fdc('0x22')]],'as':_0x247a98['as'],'attributes':_0x247a98[_0x4fdc('0x20')],'include':_0x247a98['include']?_[_0x4fdc('0x23')](_0x247a98['include'],function(_0x3dee1f){return{'model':db[_0x3dee1f['model']],'as':_0x3dee1f['as'],'attributes':_0x3dee1f[_0x4fdc('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4fdc('0x10')](function(_0x28d7e3){logger[_0x4fdc('0x19')]('GetFaxAccount',_0x3c556d);logger[_0x4fdc('0x11')](_0x4fdc('0x1b'),_0x3c556d,JSON[_0x4fdc('0x14')](_0x28d7e3));_0x53ed20(_0x28d7e3);})[_0x4fdc('0x1a')](function(_0x4af537){logger[_0x4fdc('0x15')](_0x4fdc('0x1b'),_0x4af537['message'],_0x3c556d);_0x4eaad1(_0xfec81[_0x4fdc('0x15')](0x1f4,_0x4af537['message']));});});};exports[_0x4fdc('0x24')]=function(_0x566e8f,_0x5a26b1,_0x3c91fb){var _0x21588b=this;return new Promise(function(_0x2749ae,_0x38d9fb){var _0x4a529f={'body':_0x566e8f[_0x4fdc('0x25')],'channel':'fax'};var _0x9276c7=[];var _0x4025d7=[];var _0x110892={};return db['CmContact']['describe']()['then'](function(_0x28a025){if(!_0x28a025){throw new db['Sequelize'][(_0x4fdc('0x26'))](_0x4fdc('0x27'));}_0x9276c7=_[_0x4fdc('0x28')](_['keys'](_0x28a025),['createdAt',_0x4fdc('0x29')]);_0x4025d7=_[_0x4fdc('0x28')](_[_0x4fdc('0x2a')](_0x28a025),[_0x4fdc('0x2b'),_0x4fdc('0x29'),_0x4fdc('0x2c'),_0x4fdc('0x2d')]);if(_0x566e8f[_0x4fdc('0x25')]['id']){delete _0x566e8f['body']['id'];}if(_['isNil'](_0x566e8f[_0x4fdc('0x25')][_0x4fdc('0x2e')])){throw new db[(_0x4fdc('0x2f'))][(_0x4fdc('0x26'))](_0x4fdc('0x30'));}if(_['isNil'](_0x566e8f['body'][_0x4fdc('0x25')])||_0x566e8f[_0x4fdc('0x25')][_0x4fdc('0x25')]===''){throw new db[(_0x4fdc('0x2f'))][(_0x4fdc('0x26'))](_0x4fdc('0x31'));}if(_[_0x4fdc('0x32')](_0x566e8f['body'][_0x4fdc('0x33')])){throw new db[(_0x4fdc('0x2f'))][(_0x4fdc('0x26'))](_0x4fdc('0x34')+_0x4025d7);}if(!_['includes'](_0x4025d7,_0x566e8f[_0x4fdc('0x25')][_0x4fdc('0x33')])){throw new db[(_0x4fdc('0x2f'))][(_0x4fdc('0x26'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4025d7);}_0x110892[_0x566e8f[_0x4fdc('0x25')][_0x4fdc('0x33')]]=_0x566e8f[_0x4fdc('0x25')][_0x4fdc('0x2e')];})[_0x4fdc('0x10')](function(){return db[_0x4fdc('0x1c')][_0x4fdc('0x35')]({'where':{'id':_0x566e8f[_0x4fdc('0x36')]['id']},'include':[{'model':db[_0x4fdc('0x37')],'as':'List','include':[{'model':db[_0x4fdc('0x38')],'as':'Contacts','where':_0x110892,'limit':0x1,'order':[['updatedAt',_0x4fdc('0x39')]]}]},{'model':db[_0x4fdc('0x3a')],'as':'Applications'}]});})['then'](function(_0x42ef05){if(_0x42ef05&&_0x42ef05[_0x4fdc('0x3b')]){var _0x46207e=_0x42ef05[_0x4fdc('0x3c')]({'plain':!![]});_0x4a529f[_0x4fdc('0x36')]=_0x46207e;_0x4a529f[_0x4fdc('0x3d')]=_0x46207e['Applications'];_0x4a529f['list']=_0x46207e[_0x4fdc('0x3b')];_0x4a529f['applications']=_[_0x4fdc('0x3e')](_0x4a529f[_0x4fdc('0x3d')],[_0x4fdc('0x3f')],['asc']);if(_0x4a529f[_0x4fdc('0x36')][_0x4fdc('0x40')]){delete _0x4a529f[_0x4fdc('0x36')][_0x4fdc('0x40')];}if(_0x4a529f[_0x4fdc('0x36')]['List']&&_0x4a529f[_0x4fdc('0x36')][_0x4fdc('0x3b')]['Contacts'][_0x4fdc('0x41')]){return _0x4a529f[_0x4fdc('0x36')][_0x4fdc('0x3b')][_0x4fdc('0x42')][0x0];}var _0x5435bc=_['defaults'](_0x566e8f['body'],{'firstName':_0x566e8f[_0x4fdc('0x25')][_0x4fdc('0x2e')],'ListId':_0x46207e[_0x4fdc('0x2d')]});_0x5435bc[_0x566e8f[_0x4fdc('0x25')]['mapKey']]=_0x566e8f[_0x4fdc('0x25')][_0x4fdc('0x2e')];return db[_0x4fdc('0x38')][_0x4fdc('0x43')](_0x5435bc,{'fields':_0x9276c7,'raw':!![]});}})[_0x4fdc('0x10')](function(_0x378c31){_0x4a529f[_0x4fdc('0x44')]=_0x378c31;if(_0x378c31){var _0x3da924={'ContactId':_0x378c31['id'],'FaxAccountId':_0x566e8f['account']['id'],'fax':_0x378c31['fax']};return db[_0x4fdc('0x45')][_0x4fdc('0x35')]({'where':{'ContactId':_0x378c31['id'],'closed':![],'FaxAccountId':_0x566e8f[_0x4fdc('0x36')]['id']}})[_0x4fdc('0x10')](function(_0x38424d){if(_0x38424d){return[_0x38424d,![]];}return db[_0x4fdc('0x45')]['create'](_0x3da924)['then'](function(_0x466e2c){return[_0x466e2c,!![]];});});}else{throw new Error(_0x4fdc('0x46'));}})['spread'](function(_0x2a2104,_0xcbee70){var _0x7e7831=_0x2a2104[_0x4fdc('0x3c')]({'plain':!![]});if(_0xcbee70){if(_0x4a529f[_0x4fdc('0x36')][_0x4fdc('0x47')]){_0x4a529f[_0x4fdc('0x3d')][_0x4fdc('0x48')]({'id':0x0,'priority':_0x4a529f[_0x4fdc('0x3d')][_0x4fdc('0x41')]+0x1,'app':'close','appdata':_0x4fdc('0x49'),'interval':_0x4fdc('0x4a')});}_0x7e7831[_0x4fdc('0x4b')]=!![];}else{_0x7e7831[_0x4fdc('0x4b')]=![];}_0x4a529f['interaction']=_0x7e7831;return db[_0x4fdc('0x4c')][_0x4fdc('0x43')]({'body':_0x566e8f['body'][_0x4fdc('0x25')],'FaxAccountId':_0x566e8f[_0x4fdc('0x36')]['id'],'FaxInteractionId':_0x2a2104['id'],'direction':'in','ContactId':_0x2a2104['ContactId'],'AttachmentId':_0x566e8f['body']['AttachmentId']});})[_0x4fdc('0x10')](function(_0x4cdaaf){_0x4a529f[_0x4fdc('0x18')]=_0x4cdaaf;if(_0x4a529f[_0x4fdc('0x4d')]['UserId']){return db[_0x4fdc('0x4e')][_0x4fdc('0x35')]({'attributes':['id',_0x4fdc('0x4f')],'where':{'id':_0x4a529f['interaction'][_0x4fdc('0x50')]}})['then'](function(_0x5e9eff){if(_0x5e9eff){_0x4a529f[_0x4fdc('0x3d')][_0x4fdc('0x51')]({'id':0x0,'priority':0x0,'app':_0x4fdc('0x52'),'appdata':_0x5e9eff[_0x4fdc('0x4f')]+','+(_0x4a529f[_0x4fdc('0x36')][_0x4fdc('0x53')]||0xa),'interval':_0x4fdc('0x4a')});}return respondWithRpcPromise(_0x4fdc('0x54'),_0x4fdc('0x55'),_0x4a529f);});}return respondWithRpcPromise(_0x4fdc('0x54'),'startRouting',_0x4a529f);})['then'](function(_0x4e2e7c){_0x2749ae(_0x4e2e7c);})[_0x4fdc('0x1a')](function(_0x1fc970){_0x38d9fb(_0x21588b['error'](0x1f4,_0x1fc970[_0x4fdc('0x18')]));});});};
\ No newline at end of file
index 9127a57..d8a2dd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fdc=['save','remove','update','emit','removeListener','register','faxAccount:','./faxAccount.events'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x5fdc,0x127));var _0xc5fd=function(_0x394b3b,_0x2780c4){_0x394b3b=_0x394b3b-0x0;var _0x303992=_0x5fdc[_0x394b3b];return _0x303992;};'use strict';var FaxAccountEvents=require(_0xc5fd('0x0'));var events=[_0xc5fd('0x1'),_0xc5fd('0x2'),_0xc5fd('0x3')];function createListener(_0x36e895,_0x341db9){return function(_0x3be451){_0x341db9[_0xc5fd('0x4')](_0x36e895,_0x3be451);};}function removeListener(_0xfdf928,_0x1b6205){return function(){FaxAccountEvents[_0xc5fd('0x5')](_0xfdf928,_0x1b6205);};}exports[_0xc5fd('0x6')]=function(_0x44722b){for(var _0x216902=0x0,_0x15ffe7=events['length'];_0x216902<_0x15ffe7;_0x216902++){var _0x5d86e5=events[_0x216902];var _0x493389=createListener(_0xc5fd('0x7')+_0x5d86e5,_0x44722b);FaxAccountEvents['on'](_0x5d86e5,_0x493389);}};
\ No newline at end of file
+var _0x7046=['./faxAccount.events','save','remove','update','emit','removeListener','register','length','faxAccount:'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x7046,0x144));var _0x6704=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7046[_0x321bb2];return _0x9c12ed;};'use strict';var FaxAccountEvents=require(_0x6704('0x0'));var events=[_0x6704('0x1'),_0x6704('0x2'),_0x6704('0x3')];function createListener(_0x54a895,_0x1fd895){return function(_0x4399c6){_0x1fd895[_0x6704('0x4')](_0x54a895,_0x4399c6);};}function removeListener(_0x5258e7,_0x1e9b2a){return function(){FaxAccountEvents[_0x6704('0x5')](_0x5258e7,_0x1e9b2a);};}exports[_0x6704('0x6')]=function(_0x626a14){for(var _0x2917be=0x0,_0x4badf8=events[_0x6704('0x7')];_0x2917be<_0x4badf8;_0x2917be++){var _0x49b8b6=events[_0x2917be];var _0x56b1ff=createListener(_0x6704('0x8')+_0x49b8b6,_0x626a14);FaxAccountEvents['on'](_0x49b8b6,_0x56b1ff);}};
\ No newline at end of file
index 4e25486..c027e88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4231=['delete','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','getAgents','create','post','addApplications','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','/:id/users','addAgents','destroy','removeDispositions'];(function(_0x4a8416,_0x27fcb6){var _0x18bb10=function(_0x448393){while(--_0x448393){_0x4a8416['push'](_0x4a8416['shift']());}};_0x18bb10(++_0x27fcb6);}(_0x4231,0x1bb));var _0x1423=function(_0x27b1da,_0xc8abcf){_0x27b1da=_0x27b1da-0x0;var _0x27f050=_0x4231[_0x27b1da];return _0x27f050;};'use strict';var multer=require(_0x1423('0x0'));var util=require(_0x1423('0x1'));var path=require(_0x1423('0x2'));var timeout=require(_0x1423('0x3'));var express=require(_0x1423('0x4'));var router=express['Router']();var auth=require(_0x1423('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1423('0x6'));var controller=require(_0x1423('0x7'));router[_0x1423('0x8')]('/',auth[_0x1423('0x9')](),controller[_0x1423('0xa')]);router[_0x1423('0x8')]('/describe',auth[_0x1423('0x9')](),controller[_0x1423('0xb')]);router[_0x1423('0x8')](_0x1423('0xc'),auth[_0x1423('0x9')](),controller[_0x1423('0xd')]);router[_0x1423('0x8')](_0x1423('0xe'),auth[_0x1423('0x9')](),controller[_0x1423('0xf')]);router[_0x1423('0x8')](_0x1423('0x10'),auth[_0x1423('0x9')](),controller[_0x1423('0x11')]);router[_0x1423('0x8')](_0x1423('0x12'),auth['isAuthenticated'](),controller[_0x1423('0x13')]);router['get'](_0x1423('0x14'),auth['isAuthenticated'](),controller[_0x1423('0x15')]);router['get'](_0x1423('0x16'),auth[_0x1423('0x9')](),controller[_0x1423('0x17')]);router[_0x1423('0x8')]('/:id/users',auth[_0x1423('0x9')](),controller[_0x1423('0x18')]);router['post']('/',auth[_0x1423('0x9')](),controller[_0x1423('0x19')]);router[_0x1423('0x1a')](_0x1423('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x1423('0x10'),auth[_0x1423('0x9')](),controller['addAnswer']);router[_0x1423('0x1a')](_0x1423('0x12'),auth['isAuthenticated'](),controller['addInteraction']);router['post'](_0x1423('0x14'),auth[_0x1423('0x9')](),controller[_0x1423('0x1b')]);router[_0x1423('0x1a')](_0x1423('0x1c'),auth['isAuthenticated'](),controller[_0x1423('0x1d')]);router[_0x1423('0x1a')]('/updateaccountapplications',auth[_0x1423('0x9')](),controller[_0x1423('0x1e')]);router['post'](_0x1423('0x1f'),auth['isAuthenticated'](),controller[_0x1423('0x20')]);router[_0x1423('0x1a')](_0x1423('0x21'),auth['isAuthenticated'](),controller[_0x1423('0x22')]);router['put']('/:id',auth[_0x1423('0x9')](),controller['update']);router['delete'](_0x1423('0xc'),auth[_0x1423('0x9')](),controller[_0x1423('0x23')]);router['delete'](_0x1423('0xe'),auth[_0x1423('0x9')](),controller[_0x1423('0x24')]);router[_0x1423('0x25')](_0x1423('0x10'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x1423('0x9')](),controller[_0x1423('0x26')]);module[_0x1423('0x27')]=router;
\ No newline at end of file
+var _0x300a=['addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','create','post'];(function(_0x157103,_0xf091a1){var _0xf7522c=function(_0xde2875){while(--_0xde2875){_0x157103['push'](_0x157103['shift']());}};_0xf7522c(++_0xf091a1);}(_0x300a,0x170));var _0xa300=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0x300a[_0x287a47];return _0x3fb726;};'use strict';var multer=require(_0xa300('0x0'));var util=require(_0xa300('0x1'));var path=require(_0xa300('0x2'));var timeout=require('connect-timeout');var express=require(_0xa300('0x3'));var router=express[_0xa300('0x4')]();var auth=require(_0xa300('0x5'));var interaction=require(_0xa300('0x6'));var config=require(_0xa300('0x7'));var controller=require(_0xa300('0x8'));router[_0xa300('0x9')]('/',auth['isAuthenticated'](),controller[_0xa300('0xa')]);router['get'](_0xa300('0xb'),auth[_0xa300('0xc')](),controller[_0xa300('0xd')]);router[_0xa300('0x9')](_0xa300('0xe'),auth['isAuthenticated'](),controller[_0xa300('0xf')]);router[_0xa300('0x9')](_0xa300('0x10'),auth[_0xa300('0xc')](),controller['getDispositions']);router['get'](_0xa300('0x11'),auth[_0xa300('0xc')](),controller['getAnswers']);router[_0xa300('0x9')](_0xa300('0x12'),auth[_0xa300('0xc')](),controller[_0xa300('0x13')]);router[_0xa300('0x9')](_0xa300('0x14'),auth[_0xa300('0xc')](),controller[_0xa300('0x15')]);router[_0xa300('0x9')](_0xa300('0x16'),auth[_0xa300('0xc')](),controller[_0xa300('0x17')]);router[_0xa300('0x9')](_0xa300('0x18'),auth[_0xa300('0xc')](),controller[_0xa300('0x19')]);router['post']('/',auth[_0xa300('0xc')](),controller[_0xa300('0x1a')]);router[_0xa300('0x1b')]('/:id/dispositions',auth[_0xa300('0xc')](),controller[_0xa300('0x1c')]);router[_0xa300('0x1b')](_0xa300('0x11'),auth[_0xa300('0xc')](),controller[_0xa300('0x1d')]);router[_0xa300('0x1b')](_0xa300('0x12'),auth[_0xa300('0xc')](),controller[_0xa300('0x1e')]);router[_0xa300('0x1b')](_0xa300('0x14'),auth[_0xa300('0xc')](),controller[_0xa300('0x1f')]);router[_0xa300('0x1b')](_0xa300('0x20'),auth[_0xa300('0xc')](),controller[_0xa300('0x21')]);router[_0xa300('0x1b')](_0xa300('0x22'),auth['isAuthenticated'](),controller['updateAccountApplications']);router['post'](_0xa300('0x23'),auth[_0xa300('0xc')](),controller[_0xa300('0x24')]);router[_0xa300('0x1b')](_0xa300('0x18'),auth[_0xa300('0xc')](),controller[_0xa300('0x25')]);router[_0xa300('0x26')](_0xa300('0xe'),auth['isAuthenticated'](),controller[_0xa300('0x27')]);router[_0xa300('0x28')](_0xa300('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xa300('0x28')]('/:id/dispositions',auth[_0xa300('0xc')](),controller[_0xa300('0x29')]);router['delete'](_0xa300('0x11'),auth[_0xa300('0xc')](),controller[_0xa300('0x2a')]);router[_0xa300('0x28')]('/:id/users',auth[_0xa300('0xc')](),controller['removeAgents']);module[_0xa300('0x2b')]=router;
\ No newline at end of file
index cc061ef..625d294 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfaf0=['STRING','noop','sequelize','exports'];(function(_0x50d2c0,_0x51fd4e){var _0x28d5c3=function(_0x5e0177){while(--_0x5e0177){_0x50d2c0['push'](_0x50d2c0['shift']());}};_0x28d5c3(++_0x51fd4e);}(_0xfaf0,0x6a));var _0x0faf=function(_0x443a36,_0x2c491f){_0x443a36=_0x443a36-0x0;var _0x261f04=_0xfaf0[_0x443a36];return _0x261f04;};'use strict';var Sequelize=require(_0x0faf('0x0'));module[_0x0faf('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0faf('0x2')],'allowNull':![],'defaultValue':_0x0faf('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0faf('0x2')]},'interval':{'type':Sequelize[_0x0faf('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xd663=['STRING','noop','TEXT','sequelize','exports'];(function(_0x6c37ed,_0x162d1c){var _0x47eae9=function(_0x42e08b){while(--_0x42e08b){_0x6c37ed['push'](_0x6c37ed['shift']());}};_0x47eae9(++_0x162d1c);}(_0xd663,0x1ed));var _0x3d66=function(_0x2f4e6f,_0x334d53){_0x2f4e6f=_0x2f4e6f-0x0;var _0x23b2f7=_0xd663[_0x2f4e6f];return _0x23b2f7;};'use strict';var Sequelize=require(_0x3d66('0x0'));module[_0x3d66('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3d66('0x2')],'allowNull':![],'defaultValue':_0x3d66('0x3')},'appdata':{'type':Sequelize[_0x3d66('0x4')]()},'description':{'type':Sequelize[_0x3d66('0x2')]},'interval':{'type':Sequelize[_0x3d66('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index a06f0fd..ec72bcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','merge','options','includeAll','findAll','rows','show','params','keys','length','include','catch','create','body','update','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','error','stack','name','index','FaxApplication','rawAttributes','fieldName','key','map','query','intersection'];(function(_0x195bed,_0x3c3259){var _0x1bcaed=function(_0x429ee4){while(--_0x429ee4){_0x195bed['push'](_0x195bed['shift']());}};_0x1bcaed(++_0x3c3259);}(_0x1261,0x144));var _0x1126=function(_0x4b7124,_0x206b7b){_0x4b7124=_0x4b7124-0x0;var _0x23e16d=_0x1261[_0x4b7124];return _0x23e16d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');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 db=require(_0x1126('0x16'))['db'];function respondWithStatusCode(_0x1b364a,_0xd26a32){_0xd26a32=_0xd26a32||0xcc;return function(_0x273896){if(_0x273896){return _0x1b364a[_0x1126('0x17')](_0xd26a32);}return _0x1b364a[_0x1126('0x18')](_0xd26a32)[_0x1126('0x19')]();};}function respondWithResult(_0x2048ad,_0x43850b){_0x43850b=_0x43850b||0xc8;return function(_0x53a8f0){if(_0x53a8f0){return _0x2048ad['status'](_0x43850b)[_0x1126('0x1a')](_0x53a8f0);}};}function respondWithFilteredResult(_0x154e20,_0x279455){return function(_0x4be0c6){if(_0x4be0c6){var _0x45149c=_0x4be0c6[_0x1126('0x1b')],_0x4794a7=_0x279455['offset'],_0x35fe9f=_0x279455[_0x1126('0x1c')]+_0x279455[_0x1126('0x1d')],_0x42f379;if(_0x35fe9f>=_0x45149c){_0x35fe9f=_0x45149c;_0x42f379=0xc8;}else{_0x42f379=0xce;}_0x154e20['status'](_0x42f379);return _0x154e20['set'](_0x1126('0x1e'),_0x4794a7+'-'+_0x35fe9f+'/'+_0x45149c)[_0x1126('0x1a')](_0x4be0c6);}return null;};}function patchUpdates(_0x58d11a){return function(_0x548359){try{jsonpatch[_0x1126('0x1f')](_0x548359,_0x58d11a,!![]);}catch(_0x58b109){return BPromise[_0x1126('0x20')](_0x58b109);}return _0x548359[_0x1126('0x21')]();};}function saveUpdates(_0x2f70ac,_0x54400a){return function(_0x2a08ba){if(_0x2a08ba){return _0x2a08ba['update'](_0x2f70ac)['then'](function(_0x30f6b3){return _0x30f6b3;});}return null;};}function removeEntity(_0x3a9bed,_0x25b24b){return function(_0x36d254){if(_0x36d254){return _0x36d254['destroy']()[_0x1126('0x22')](function(){_0x3a9bed[_0x1126('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(!_0x529dd9){_0x2175fa['sendStatus'](0x194);}return _0x529dd9;};}function handleError(_0x2199d9,_0x15bcc3){_0x15bcc3=_0x15bcc3||0x1f4;return function(_0x329914){logger[_0x1126('0x23')](_0x329914[_0x1126('0x24')]);if(_0x329914[_0x1126('0x25')]){delete _0x329914[_0x1126('0x25')];}_0x2199d9[_0x1126('0x18')](_0x15bcc3)['send'](_0x329914);};}exports[_0x1126('0x26')]=function(_0x375e59,_0xa293f4){var _0x5ddf63={},_0x541bc9={},_0xeb7d89={'count':0x0,'rows':[]};var _0x39bf0e=_['map'](db[_0x1126('0x27')][_0x1126('0x28')],function(_0x4a334a){return{'name':_0x4a334a[_0x1126('0x29')],'type':_0x4a334a['type'][_0x1126('0x2a')]};});_0x541bc9['model']=_[_0x1126('0x2b')](_0x39bf0e,'name');_0x541bc9[_0x1126('0x2c')]=_['keys'](_0x375e59['query']);_0x541bc9['filters']=_[_0x1126('0x2d')](_0x541bc9[_0x1126('0x2e')],_0x541bc9[_0x1126('0x2c')]);_0x5ddf63['attributes']=_[_0x1126('0x2d')](_0x541bc9[_0x1126('0x2e')],qs['fields'](_0x375e59[_0x1126('0x2c')][_0x1126('0x2f')]));_0x5ddf63[_0x1126('0x30')]=_0x5ddf63[_0x1126('0x30')]['length']?_0x5ddf63['attributes']:_0x541bc9[_0x1126('0x2e')];if(!_0x375e59[_0x1126('0x2c')][_0x1126('0x31')](_0x1126('0x32'))){_0x5ddf63['limit']=qs[_0x1126('0x1d')](_0x375e59[_0x1126('0x2c')][_0x1126('0x1d')]);_0x5ddf63[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x375e59['query'][_0x1126('0x1c')]);}_0x5ddf63[_0x1126('0x33')]=qs[_0x1126('0x34')](_0x375e59[_0x1126('0x2c')]['sort']);_0x5ddf63['where']=qs[_0x1126('0x35')](_[_0x1126('0x36')](_0x375e59['query'],_0x541bc9[_0x1126('0x35')]),_0x39bf0e);if(_0x375e59[_0x1126('0x2c')][_0x1126('0x37')]){_0x5ddf63['where']=_['merge'](_0x5ddf63[_0x1126('0x38')],{'$or':_[_0x1126('0x2b')](_0x39bf0e,function(_0x3aa08f){if(_0x3aa08f[_0x1126('0x39')]!=='VIRTUAL'){var _0x428d3d={};_0x428d3d[_0x3aa08f['name']]={'$like':'%'+_0x375e59[_0x1126('0x2c')][_0x1126('0x37')]+'%'};return _0x428d3d;}})});}_0x5ddf63=_[_0x1126('0x3a')]({},_0x5ddf63,_0x375e59[_0x1126('0x3b')]);var _0x57e5d2={'where':_0x5ddf63['where']};return db[_0x1126('0x27')][_0x1126('0x1b')](_0x57e5d2)[_0x1126('0x22')](function(_0x397e3b){_0xeb7d89[_0x1126('0x1b')]=_0x397e3b;if(_0x375e59[_0x1126('0x2c')][_0x1126('0x3c')]){_0x5ddf63['include']=[{'all':!![]}];}return db[_0x1126('0x27')][_0x1126('0x3d')](_0x5ddf63);})[_0x1126('0x22')](function(_0xf3a0bd){_0xeb7d89[_0x1126('0x3e')]=_0xf3a0bd;return _0xeb7d89;})['then'](respondWithFilteredResult(_0xa293f4,_0x5ddf63))['catch'](handleError(_0xa293f4,null));};exports[_0x1126('0x3f')]=function(_0x219bcc,_0xcee9de){var _0x21c38e={'raw':!![],'where':{'id':_0x219bcc[_0x1126('0x40')]['id']}},_0x18b496={};_0x18b496['model']=_['keys'](db['FaxApplication'][_0x1126('0x28')]);_0x18b496['query']=_[_0x1126('0x41')](_0x219bcc[_0x1126('0x2c')]);_0x18b496[_0x1126('0x35')]=_[_0x1126('0x2d')](_0x18b496['model'],_0x18b496['query']);_0x21c38e[_0x1126('0x30')]=_[_0x1126('0x2d')](_0x18b496[_0x1126('0x2e')],qs['fields'](_0x219bcc[_0x1126('0x2c')]['fields']));_0x21c38e[_0x1126('0x30')]=_0x21c38e['attributes'][_0x1126('0x42')]?_0x21c38e[_0x1126('0x30')]:_0x18b496[_0x1126('0x2e')];if(_0x219bcc['query'][_0x1126('0x3c')]){_0x21c38e[_0x1126('0x43')]=[{'all':!![]}];}_0x21c38e=_[_0x1126('0x3a')]({},_0x21c38e,_0x219bcc['options']);return db['FaxApplication']['find'](_0x21c38e)[_0x1126('0x22')](handleEntityNotFound(_0xcee9de,null))['then'](respondWithResult(_0xcee9de,null))[_0x1126('0x44')](handleError(_0xcee9de,null));};exports['create']=function(_0x2f45b9,_0x323499){return db[_0x1126('0x27')][_0x1126('0x45')](_0x2f45b9[_0x1126('0x46')],{})['then'](respondWithResult(_0x323499,0xc9))[_0x1126('0x44')](handleError(_0x323499,null));};exports[_0x1126('0x47')]=function(_0x5111d3,_0x1a15f8){if(_0x5111d3[_0x1126('0x46')]['id']){delete _0x5111d3['body']['id'];}return db[_0x1126('0x27')][_0x1126('0x48')]({'where':{'id':_0x5111d3['params']['id']}})[_0x1126('0x22')](handleEntityNotFound(_0x1a15f8,null))[_0x1126('0x22')](saveUpdates(_0x5111d3[_0x1126('0x46')],null))['then'](respondWithResult(_0x1a15f8,null))[_0x1126('0x44')](handleError(_0x1a15f8,null));};exports[_0x1126('0x49')]=function(_0x411c89,_0x5878bb){return db[_0x1126('0x27')][_0x1126('0x48')]({'where':{'id':_0x411c89[_0x1126('0x40')]['id']}})[_0x1126('0x22')](handleEntityNotFound(_0x5878bb,null))['then'](removeEntity(_0x5878bb,null))[_0x1126('0x44')](handleError(_0x5878bb,null));};
\ No newline at end of file
+var _0xabce=['offset','limit','status','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','keys','options','FaxApplication','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','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','../../mysqldb','sendStatus','end','json','count'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xabce,0x103));var _0xeabc=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xabce[_0x481bf7];return _0x461787;};'use strict';var pdf=require(_0xeabc('0x0'));var emlformat=require(_0xeabc('0x1'));var rimraf=require(_0xeabc('0x2'));var zipdir=require(_0xeabc('0x3'));var jsonpatch=require(_0xeabc('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeabc('0x5'));var Mustache=require(_0xeabc('0x6'));var util=require(_0xeabc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xeabc('0x8'));var ejs=require('ejs');var fs=require('fs');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 db=require(_0xeabc('0x18'))['db'];function respondWithStatusCode(_0x435ea7,_0x3fd0b5){_0x3fd0b5=_0x3fd0b5||0xcc;return function(_0x36a92e){if(_0x36a92e){return _0x435ea7[_0xeabc('0x19')](_0x3fd0b5);}return _0x435ea7['status'](_0x3fd0b5)[_0xeabc('0x1a')]();};}function respondWithResult(_0x1319f3,_0x3251c6){_0x3251c6=_0x3251c6||0xc8;return function(_0x55f0de){if(_0x55f0de){return _0x1319f3['status'](_0x3251c6)[_0xeabc('0x1b')](_0x55f0de);}};}function respondWithFilteredResult(_0x3ae954,_0x326bac){return function(_0x53d5cb){if(_0x53d5cb){var _0xf913d7=_0x53d5cb[_0xeabc('0x1c')],_0x638976=_0x326bac['offset'],_0x49f2d8=_0x326bac[_0xeabc('0x1d')]+_0x326bac[_0xeabc('0x1e')],_0x53fe28;if(_0x49f2d8>=_0xf913d7){_0x49f2d8=_0xf913d7;_0x53fe28=0xc8;}else{_0x53fe28=0xce;}_0x3ae954[_0xeabc('0x1f')](_0x53fe28);return _0x3ae954[_0xeabc('0x20')](_0xeabc('0x21'),_0x638976+'-'+_0x49f2d8+'/'+_0xf913d7)[_0xeabc('0x1b')](_0x53d5cb);}return null;};}function patchUpdates(_0x384be5){return function(_0x5e30ee){try{jsonpatch['apply'](_0x5e30ee,_0x384be5,!![]);}catch(_0x1253e4){return BPromise['reject'](_0x1253e4);}return _0x5e30ee[_0xeabc('0x22')]();};}function saveUpdates(_0x16530c,_0x502947){return function(_0x28063a){if(_0x28063a){return _0x28063a[_0xeabc('0x23')](_0x16530c)[_0xeabc('0x24')](function(_0x184e60){return _0x184e60;});}return null;};}function removeEntity(_0x3c9611,_0x4e99a4){return function(_0xecdbf){if(_0xecdbf){return _0xecdbf[_0xeabc('0x25')]()[_0xeabc('0x24')](function(){_0x3c9611['status'](0xcc)[_0xeabc('0x1a')]();});}};}function handleEntityNotFound(_0x3854d2,_0x214953){return function(_0x319119){if(!_0x319119){_0x3854d2['sendStatus'](0x194);}return _0x319119;};}function handleError(_0x109e1d,_0x480440){_0x480440=_0x480440||0x1f4;return function(_0x27dbaf){logger['error'](_0x27dbaf[_0xeabc('0x26')]);if(_0x27dbaf[_0xeabc('0x27')]){delete _0x27dbaf[_0xeabc('0x27')];}_0x109e1d[_0xeabc('0x1f')](_0x480440)[_0xeabc('0x28')](_0x27dbaf);};}exports[_0xeabc('0x29')]=function(_0x131722,_0x4c2693){var _0x5b2934={},_0x459c8a={},_0x5bf8f2={'count':0x0,'rows':[]};var _0x3c1b5b=_[_0xeabc('0x2a')](db['FaxApplication'][_0xeabc('0x2b')],function(_0x38572d){return{'name':_0x38572d[_0xeabc('0x2c')],'type':_0x38572d[_0xeabc('0x2d')][_0xeabc('0x2e')]};});_0x459c8a[_0xeabc('0x2f')]=_[_0xeabc('0x2a')](_0x3c1b5b,_0xeabc('0x27'));_0x459c8a[_0xeabc('0x30')]=_['keys'](_0x131722[_0xeabc('0x30')]);_0x459c8a['filters']=_[_0xeabc('0x31')](_0x459c8a[_0xeabc('0x2f')],_0x459c8a[_0xeabc('0x30')]);_0x5b2934[_0xeabc('0x32')]=_[_0xeabc('0x31')](_0x459c8a[_0xeabc('0x2f')],qs[_0xeabc('0x33')](_0x131722['query'][_0xeabc('0x33')]));_0x5b2934[_0xeabc('0x32')]=_0x5b2934[_0xeabc('0x32')]['length']?_0x5b2934[_0xeabc('0x32')]:_0x459c8a[_0xeabc('0x2f')];if(!_0x131722[_0xeabc('0x30')]['hasOwnProperty'](_0xeabc('0x34'))){_0x5b2934[_0xeabc('0x1e')]=qs[_0xeabc('0x1e')](_0x131722['query'][_0xeabc('0x1e')]);_0x5b2934[_0xeabc('0x1d')]=qs['offset'](_0x131722['query'][_0xeabc('0x1d')]);}_0x5b2934[_0xeabc('0x35')]=qs['sort'](_0x131722[_0xeabc('0x30')][_0xeabc('0x36')]);_0x5b2934[_0xeabc('0x37')]=qs[_0xeabc('0x38')](_[_0xeabc('0x39')](_0x131722['query'],_0x459c8a[_0xeabc('0x38')]),_0x3c1b5b);if(_0x131722['query'][_0xeabc('0x3a')]){_0x5b2934[_0xeabc('0x37')]=_[_0xeabc('0x3b')](_0x5b2934['where'],{'$or':_['map'](_0x3c1b5b,function(_0x452580){if(_0x452580['type']!==_0xeabc('0x3c')){var _0x4ebd64={};_0x4ebd64[_0x452580['name']]={'$like':'%'+_0x131722['query']['filter']+'%'};return _0x4ebd64;}})});}_0x5b2934=_[_0xeabc('0x3b')]({},_0x5b2934,_0x131722['options']);var _0x257fe8={'where':_0x5b2934[_0xeabc('0x37')]};return db['FaxApplication'][_0xeabc('0x1c')](_0x257fe8)['then'](function(_0x3d48f4){_0x5bf8f2['count']=_0x3d48f4;if(_0x131722[_0xeabc('0x30')][_0xeabc('0x3d')]){_0x5b2934[_0xeabc('0x3e')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x5b2934);})['then'](function(_0x46056c){_0x5bf8f2[_0xeabc('0x3f')]=_0x46056c;return _0x5bf8f2;})[_0xeabc('0x24')](respondWithFilteredResult(_0x4c2693,_0x5b2934))['catch'](handleError(_0x4c2693,null));};exports['show']=function(_0x5cd62e,_0x1680e8){var _0x5e9cb3={'raw':!![],'where':{'id':_0x5cd62e['params']['id']}},_0xc6af4d={};_0xc6af4d[_0xeabc('0x2f')]=_['keys'](db['FaxApplication']['rawAttributes']);_0xc6af4d[_0xeabc('0x30')]=_[_0xeabc('0x40')](_0x5cd62e[_0xeabc('0x30')]);_0xc6af4d[_0xeabc('0x38')]=_['intersection'](_0xc6af4d[_0xeabc('0x2f')],_0xc6af4d['query']);_0x5e9cb3[_0xeabc('0x32')]=_[_0xeabc('0x31')](_0xc6af4d[_0xeabc('0x2f')],qs[_0xeabc('0x33')](_0x5cd62e[_0xeabc('0x30')]['fields']));_0x5e9cb3['attributes']=_0x5e9cb3[_0xeabc('0x32')]['length']?_0x5e9cb3[_0xeabc('0x32')]:_0xc6af4d[_0xeabc('0x2f')];if(_0x5cd62e['query'][_0xeabc('0x3d')]){_0x5e9cb3[_0xeabc('0x3e')]=[{'all':!![]}];}_0x5e9cb3=_[_0xeabc('0x3b')]({},_0x5e9cb3,_0x5cd62e[_0xeabc('0x41')]);return db[_0xeabc('0x42')][_0xeabc('0x43')](_0x5e9cb3)[_0xeabc('0x24')](handleEntityNotFound(_0x1680e8,null))['then'](respondWithResult(_0x1680e8,null))[_0xeabc('0x44')](handleError(_0x1680e8,null));};exports[_0xeabc('0x45')]=function(_0x2e7a5e,_0x1b41c8){return db[_0xeabc('0x42')][_0xeabc('0x45')](_0x2e7a5e[_0xeabc('0x46')],{})[_0xeabc('0x24')](respondWithResult(_0x1b41c8,0xc9))[_0xeabc('0x44')](handleError(_0x1b41c8,null));};exports[_0xeabc('0x23')]=function(_0x5689fc,_0x38356c){if(_0x5689fc[_0xeabc('0x46')]['id']){delete _0x5689fc[_0xeabc('0x46')]['id'];}return db[_0xeabc('0x42')][_0xeabc('0x43')]({'where':{'id':_0x5689fc[_0xeabc('0x47')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x38356c,null))['then'](saveUpdates(_0x5689fc[_0xeabc('0x46')],null))[_0xeabc('0x24')](respondWithResult(_0x38356c,null))[_0xeabc('0x44')](handleError(_0x38356c,null));};exports[_0xeabc('0x25')]=function(_0x47440e,_0x58e2c1){return db[_0xeabc('0x42')][_0xeabc('0x43')]({'where':{'id':_0x47440e[_0xeabc('0x47')]['id']}})[_0xeabc('0x24')](handleEntityNotFound(_0x58e2c1,null))['then'](removeEntity(_0x58e2c1,null))[_0xeabc('0x44')](handleError(_0x58e2c1,null));};
\ No newline at end of file
index 61e167a..21ddb45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61ee=['fax_applications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','define'];(function(_0x55482d,_0x48a4af){var _0x119c0b=function(_0x19f1f7){while(--_0x19f1f7){_0x55482d['push'](_0x55482d['shift']());}};_0x119c0b(++_0x48a4af);}(_0x61ee,0x1ba));var _0xe61e=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x61ee[_0x3c4062];return _0x3f5bf3;};'use strict';var _=require(_0xe61e('0x0'));var util=require('util');var logger=require(_0xe61e('0x1'))(_0xe61e('0x2'));var moment=require(_0xe61e('0x3'));var BPromise=require(_0xe61e('0x4'));var rp=require(_0xe61e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe61e('0x6'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x270813,_0xc02a6f){return _0x270813[_0xe61e('0x7')]('FaxApplication',attributes,{'tableName':_0xe61e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe61e('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xa0cc=['request-promise','rimraf','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x1bfcfc,_0x140f5b){var _0x1041ff=function(_0x2d48fc){while(--_0x2d48fc){_0x1bfcfc['push'](_0x1bfcfc['shift']());}};_0x1041ff(++_0x140f5b);}(_0xa0cc,0x175));var _0xca0c=function(_0x5b6d95,_0x83bf55){_0x5b6d95=_0x5b6d95-0x0;var _0x3f746a=_0xa0cc[_0x5b6d95];return _0x3f746a;};'use strict';var _=require(_0xca0c('0x0'));var util=require(_0xca0c('0x1'));var logger=require(_0xca0c('0x2'))(_0xca0c('0x3'));var moment=require('moment');var BPromise=require(_0xca0c('0x4'));var rp=require(_0xca0c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca0c('0x6'));var config=require(_0xca0c('0x7'));var attributes=require('./faxApplication.attributes');module[_0xca0c('0x8')]=function(_0x559027,_0x58ee3f){return _0x559027[_0xca0c('0x9')](_0xca0c('0xa'),attributes,{'tableName':_0xca0c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca0c('0xc'),'collate':_0xca0c('0xd')});};
\ No newline at end of file
index a9f8a71..8877fd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8185=['debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','update','body','options','raw','where','attributes','UpdateFaxApplication','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x8185,0x108));var _0x5818=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x8185[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x5818('0x0'));var util=require('util');var moment=require(_0x5818('0x1'));var BPromise=require(_0x5818('0x2'));var rs=require(_0x5818('0x3'));var fs=require('fs');var Redis=require(_0x5818('0x4'));var db=require(_0x5818('0x5'))['db'];var utils=require(_0x5818('0x6'));var logger=require(_0x5818('0x7'))(_0x5818('0x8'));var config=require('../../config/environment');var jayson=require(_0x5818('0x9'));var client=jayson[_0x5818('0xa')][_0x5818('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x270321,_0x34a31b,_0x2c9193){return new BPromise(function(_0x1d58a4,_0x5eec85){return client['request'](_0x270321,_0x2c9193)[_0x5818('0xc')](function(_0x45899b){logger[_0x5818('0xd')]('FaxApplication,\x20%s,\x20%s',_0x34a31b,_0x5818('0xe'));logger[_0x5818('0xf')](_0x5818('0x10'),_0x34a31b,_0x5818('0xe'),JSON[_0x5818('0x11')](_0x45899b));if(_0x45899b[_0x5818('0x12')]){if(_0x45899b[_0x5818('0x12')][_0x5818('0x13')]===0x1f4){logger[_0x5818('0x12')](_0x5818('0x14'),_0x34a31b,_0x45899b[_0x5818('0x12')]['message']);return _0x5eec85(_0x45899b[_0x5818('0x12')][_0x5818('0x15')]);}logger[_0x5818('0x12')](_0x5818('0x14'),_0x34a31b,_0x45899b[_0x5818('0x12')][_0x5818('0x15')]);return _0x1d58a4(_0x45899b['error'][_0x5818('0x15')]);}else{logger[_0x5818('0xd')](_0x5818('0x14'),_0x34a31b,_0x5818('0xe'));_0x1d58a4(_0x45899b[_0x5818('0x16')][_0x5818('0x15')]);}})['catch'](function(_0x330a91){logger[_0x5818('0x12')](_0x5818('0x14'),_0x34a31b,_0x330a91);_0x5eec85(_0x330a91);});});}exports['UpdateFaxApplication']=function(_0xeded68){var _0x1b0e6f=this;return new Promise(function(_0x4cc431,_0x1577b1){return db['FaxApplication'][_0x5818('0x17')](_0xeded68[_0x5818('0x18')],{'raw':_0xeded68[_0x5818('0x19')]?_0xeded68[_0x5818('0x19')][_0x5818('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeded68[_0x5818('0x19')]?_0xeded68[_0x5818('0x19')][_0x5818('0x1b')]||null:null,'attributes':_0xeded68[_0x5818('0x19')]?_0xeded68[_0x5818('0x19')][_0x5818('0x1c')]||null:null,'limit':_0xeded68[_0x5818('0x19')]?_0xeded68[_0x5818('0x19')]['limit']||null:null})['then'](function(_0x357c52){logger[_0x5818('0xd')]('UpdateFaxApplication',_0xeded68);logger['debug'](_0x5818('0x1d'),_0xeded68,JSON[_0x5818('0x11')](_0x357c52));_0x4cc431(_0x357c52);})[_0x5818('0x1e')](function(_0x577983){logger[_0x5818('0x12')](_0x5818('0x1d'),_0x577983['message'],_0xeded68);_0x1577b1(_0x1b0e6f[_0x5818('0x12')](0x1f4,_0x577983['message']));});});};
\ No newline at end of file
+var _0x407e=['catch','UpdateFaxApplication','FaxApplication','body','options','where','attributes','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x407e,0x1b7));var _0xe407=function(_0x616fb8,_0x177e11){_0x616fb8=_0x616fb8-0x0;var _0x739e20=_0x407e[_0x616fb8];return _0x739e20;};'use strict';var _=require(_0xe407('0x0'));var util=require(_0xe407('0x1'));var moment=require(_0xe407('0x2'));var BPromise=require('bluebird');var rs=require(_0xe407('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe407('0x4'))['db'];var utils=require(_0xe407('0x5'));var logger=require(_0xe407('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe407('0x7'));var client=jayson[_0xe407('0x8')][_0xe407('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x881b22,_0x55e60a,_0x4e3b37){return new BPromise(function(_0x48c095,_0x2ff2a3){return client[_0xe407('0xa')](_0x881b22,_0x4e3b37)[_0xe407('0xb')](function(_0x1fd2a3){logger[_0xe407('0xc')](_0xe407('0xd'),_0x55e60a,'request\x20sent');logger[_0xe407('0xe')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x55e60a,'request\x20sent',JSON[_0xe407('0xf')](_0x1fd2a3));if(_0x1fd2a3[_0xe407('0x10')]){if(_0x1fd2a3[_0xe407('0x10')]['code']===0x1f4){logger[_0xe407('0x10')]('FaxApplication,\x20%s,\x20%s',_0x55e60a,_0x1fd2a3[_0xe407('0x10')][_0xe407('0x11')]);return _0x2ff2a3(_0x1fd2a3['error'][_0xe407('0x11')]);}logger[_0xe407('0x10')](_0xe407('0xd'),_0x55e60a,_0x1fd2a3[_0xe407('0x10')][_0xe407('0x11')]);return _0x48c095(_0x1fd2a3[_0xe407('0x10')][_0xe407('0x11')]);}else{logger[_0xe407('0xc')](_0xe407('0xd'),_0x55e60a,_0xe407('0x12'));_0x48c095(_0x1fd2a3[_0xe407('0x13')][_0xe407('0x11')]);}})[_0xe407('0x14')](function(_0x45d2f9){logger[_0xe407('0x10')]('FaxApplication,\x20%s,\x20%s',_0x55e60a,_0x45d2f9);_0x2ff2a3(_0x45d2f9);});});}exports[_0xe407('0x15')]=function(_0x254ca7){var _0x1f031e=this;return new Promise(function(_0x22d899,_0x3399d3){return db[_0xe407('0x16')]['update'](_0x254ca7[_0xe407('0x17')],{'raw':_0x254ca7[_0xe407('0x18')]?_0x254ca7[_0xe407('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x254ca7['options']?_0x254ca7[_0xe407('0x18')][_0xe407('0x19')]||null:null,'attributes':_0x254ca7[_0xe407('0x18')]?_0x254ca7[_0xe407('0x18')][_0xe407('0x1a')]||null:null,'limit':_0x254ca7[_0xe407('0x18')]?_0x254ca7[_0xe407('0x18')]['limit']||null:null})[_0xe407('0xb')](function(_0x535461){logger['info'](_0xe407('0x15'),_0x254ca7);logger[_0xe407('0xe')](_0xe407('0x15'),_0x254ca7,JSON[_0xe407('0xf')](_0x535461));_0x22d899(_0x535461);})[_0xe407('0x14')](function(_0x580764){logger[_0xe407('0x10')](_0xe407('0x15'),_0x580764[_0xe407('0x11')],_0x254ca7);_0x3399d3(_0x1f031e[_0xe407('0x10')](0x1f4,_0x580764[_0xe407('0x11')]));});});};
\ No newline at end of file
index b6a33b3..992036e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['Router','../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1a3e33,_0xe419f4){var _0x545085=function(_0x563f55){while(--_0x563f55){_0x1a3e33['push'](_0x1a3e33['shift']());}};_0x545085(++_0xe419f4);}(_0x8ef6,0xf2));var _0x68ef=function(_0x18bd6b,_0x339e04){_0x18bd6b=_0x18bd6b-0x0;var _0x3391b7=_0x8ef6[_0x18bd6b];return _0x3391b7;};'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 auth=require(_0x68ef('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68ef('0x7'));var controller=require(_0x68ef('0x8'));router[_0x68ef('0x9')]('/',auth[_0x68ef('0xa')](),controller['index']);router['get'](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xc')]);router['post']('/',auth[_0x68ef('0xa')](),controller[_0x68ef('0xd')]);router[_0x68ef('0xe')](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0xf')]);router[_0x68ef('0x10')](_0x68ef('0xb'),auth[_0x68ef('0xa')](),controller[_0x68ef('0x11')]);module[_0x68ef('0x12')]=router;
\ No newline at end of file
+var _0xafc4=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','create','put','update','exports'];(function(_0x5f240c,_0x3db73e){var _0x4a0775=function(_0x1ce108){while(--_0x1ce108){_0x5f240c['push'](_0x5f240c['shift']());}};_0x4a0775(++_0x3db73e);}(_0xafc4,0x69));var _0x4afc=function(_0x79702,_0x34931c){_0x79702=_0x79702-0x0;var _0x417e6b=_0xafc4[_0x79702];return _0x417e6b;};'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 auth=require(_0x4afc('0x4'));var interaction=require(_0x4afc('0x5'));var config=require('../../config/environment');var controller=require('./faxApplication.controller');router['get']('/',auth[_0x4afc('0x6')](),controller[_0x4afc('0x7')]);router[_0x4afc('0x8')](_0x4afc('0x9'),auth[_0x4afc('0x6')](),controller[_0x4afc('0xa')]);router['post']('/',auth[_0x4afc('0x6')](),controller[_0x4afc('0xb')]);router[_0x4afc('0xc')](_0x4afc('0x9'),auth[_0x4afc('0x6')](),controller[_0x4afc('0xd')]);router['delete']('/:id',auth[_0x4afc('0x6')](),controller['destroy']);module[_0x4afc('0xe')]=router;
\ No newline at end of file
index c10527c..bb51a8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b9e=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x5ec924,_0x1fde7b){var _0xbb930e=function(_0x16cb8f){while(--_0x16cb8f){_0x5ec924['push'](_0x5ec924['shift']());}};_0xbb930e(++_0x1fde7b);}(_0x6b9e,0x80));var _0xe6b9=function(_0xe803e2,_0x540d22){_0xe803e2=_0xe803e2-0x0;var _0x209b83=_0x6b9e[_0xe803e2];return _0x209b83;};'use strict';var Sequelize=require(_0xe6b9('0x0'));module[_0xe6b9('0x1')]={'closed':{'type':Sequelize[_0xe6b9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe6b9('0x3')]},'disposition':{'type':Sequelize[_0xe6b9('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xe6b9('0x3')]},'fax':{'type':Sequelize[_0xe6b9('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xe6b9('0x5')]('in',_0xe6b9('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe6b9('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xe6b9('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x7765=['sequelize','exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7765,0x103));var _0x5776=function(_0x348781,_0x1d0517){_0x348781=_0x348781-0x0;var _0x5bcf65=_0x7765[_0x348781];return _0x5bcf65;};'use strict';var Sequelize=require(_0x5776('0x0'));module[_0x5776('0x1')]={'closed':{'type':Sequelize[_0x5776('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5776('0x3')]},'read1stAt':{'type':Sequelize[_0x5776('0x4')]},'fax':{'type':Sequelize[_0x5776('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x5776('0x5')]('in',_0x5776('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5776('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x5776('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 7c53ae5..5fd8101 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab95=['user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','merge','fields','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','toString','groupBy','FaxInteractionId','all','rows','show','params','include','options','create','describe','addMessage','FaxMessage','ids','omit','findOne','rawAttributes','hasOwnProperty','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','emit','faxInteractionTags:save','download','unix','join','root','server','files','tmp','attachments','Attachment','Messages','get','mkdirSync','basename','pipe','createWriteStream','unlinkSync','sendStatus','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./faxInteraction.socket','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','fieldName','type','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','left_join','cm_contacts','users','o.id\x20=\x20i.UserId','fax_accounts','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','UserId','start','body','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.fax\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','resolve','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL'];(function(_0x48c31c,_0x409bfc){var _0x232404=function(_0x6069dc){while(--_0x6069dc){_0x48c31c['push'](_0x48c31c['shift']());}};_0x232404(++_0x409bfc);}(_0xab95,0x1d5));var _0x5ab9=function(_0x2b61ad,_0x54fe85){_0x2b61ad=_0x2b61ad-0x0;var _0x5a4b56=_0xab95[_0x2b61ad];return _0x5a4b56;};'use strict';var pdf=require(_0x5ab9('0x0'));var emlformat=require(_0x5ab9('0x1'));var rimraf=require(_0x5ab9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ab9('0x3'));var rp=require(_0x5ab9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5ab9('0x5'));var util=require(_0x5ab9('0x6'));var path=require('path');var sox=require(_0x5ab9('0x7'));var csv=require(_0x5ab9('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5ab9('0x9'));var squel=require(_0x5ab9('0xa'));var crypto=require('crypto');var jsforce=require(_0x5ab9('0xb'));var deskjs=require(_0x5ab9('0xc'));var toCsv=require(_0x5ab9('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5ab9('0xd'));var authService=require(_0x5ab9('0xe'));var qs=require(_0x5ab9('0xf'));var as=require(_0x5ab9('0x10'));var hardwareService=require(_0x5ab9('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5ab9('0x12'));var config=require(_0x5ab9('0x13'));var db=require('../../mysqldb')['db'];config[_0x5ab9('0x14')]=_['defaults'](config[_0x5ab9('0x14')],{'host':_0x5ab9('0x15'),'port':0x18eb});var socket=require(_0x5ab9('0x16'))(new Redis(config[_0x5ab9('0x14')]));require(_0x5ab9('0x17'))['register'](socket);function respondWithStatusCode(_0xec9e3c,_0x161c4c){_0x161c4c=_0x161c4c||0xcc;return function(_0x49ce14){if(_0x49ce14){return _0xec9e3c['sendStatus'](_0x161c4c);}return _0xec9e3c[_0x5ab9('0x18')](_0x161c4c)['end']();};}function respondWithResult(_0x4bcf18,_0x249172){_0x249172=_0x249172||0xc8;return function(_0x185056){if(_0x185056){return _0x4bcf18[_0x5ab9('0x18')](_0x249172)[_0x5ab9('0x19')](_0x185056);}};}function respondWithFilteredResult(_0x109a84,_0x23bddf){return function(_0x3e186f){if(_0x3e186f){var _0x49970d=_0x3e186f[_0x5ab9('0x1a')],_0x123145=_0x23bddf[_0x5ab9('0x1b')],_0x274383=_0x23bddf['offset']+_0x23bddf[_0x5ab9('0x1c')],_0x5865ea;if(_0x274383>=_0x49970d){_0x274383=_0x49970d;_0x5865ea=0xc8;}else{_0x5865ea=0xce;}_0x109a84[_0x5ab9('0x18')](_0x5865ea);return _0x109a84[_0x5ab9('0x1d')](_0x5ab9('0x1e'),_0x123145+'-'+_0x274383+'/'+_0x49970d)[_0x5ab9('0x19')](_0x3e186f);}return null;};}function patchUpdates(_0x10d90f){return function(_0x3de20a){try{jsonpatch[_0x5ab9('0x1f')](_0x3de20a,_0x10d90f,!![]);}catch(_0x2cac9f){return BPromise[_0x5ab9('0x20')](_0x2cac9f);}return _0x3de20a[_0x5ab9('0x21')]();};}function saveUpdates(_0x1ee365,_0x4c31e6){return function(_0x560d7a){if(_0x560d7a){return _0x560d7a[_0x5ab9('0x22')](_0x1ee365)['then'](function(_0x451da3){return _0x451da3;});}return null;};}function removeEntity(_0xdecd3d,_0x1c45db){return function(_0x1e1ab9){if(_0x1e1ab9){return _0x1e1ab9[_0x5ab9('0x23')]()[_0x5ab9('0x24')](function(){_0xdecd3d[_0x5ab9('0x18')](0xcc)[_0x5ab9('0x25')]();});}};}function handleEntityNotFound(_0x333f52,_0x15bd3c){return function(_0x5a95e5){if(!_0x5a95e5){_0x333f52['sendStatus'](0x194);}return _0x5a95e5;};}function handleError(_0x2c65d2,_0x120c92){_0x120c92=_0x120c92||0x1f4;return function(_0x3303a5){logger[_0x5ab9('0x26')](_0x3303a5[_0x5ab9('0x27')]);if(_0x3303a5[_0x5ab9('0x28')]){delete _0x3303a5['name'];}_0x2c65d2[_0x5ab9('0x18')](_0x120c92)[_0x5ab9('0x29')](_0x3303a5);};}function getInteractionUsers(_0x50a386,_0x2e492b){return new BPromise(function(_0x302a6c,_0x4fccdf){try{if(_0x2e492b[_0x50a386['id']]){_0x50a386[_0x5ab9('0x2a')]=_[_0x5ab9('0x2b')](_0x2e492b[_0x50a386['id']],function(_0x130826){return{'id':_0x130826['id'],'fullname':_0x130826[_0x5ab9('0x2c')]};});}}catch(_0x342ae5){_0x4fccdf(_0x342ae5);}_0x302a6c(_0x50a386);});}function getInteractionTags(_0xf5c162,_0x3da00d){return new BPromise(function(_0x5da406,_0x5528b3){try{if(_0xf5c162[_0x5ab9('0x2d')]){_0xf5c162[_0x5ab9('0x2e')]=[];_0xf5c162[_0x5ab9('0x2d')][_0x5ab9('0x2f')](',')[_0x5ab9('0x30')](function(_0x4ba1ec){_0xf5c162[_0x5ab9('0x2e')][_0x5ab9('0x31')](_0x3da00d[_0x4ba1ec]);});}delete _0xf5c162[_0x5ab9('0x2d')];}catch(_0x55e362){_0x5528b3(_0x55e362);}_0x5da406(_0xf5c162);});}function updateFaxInteraction(_0x3278ee,_0x42f1d6,_0xe42dd9){return new BPromise(function(_0x1a3e0c,_0x127732){return getInteractionUsers(_0x3278ee,_0xe42dd9)[_0x5ab9('0x24')](function(_0x42cb5c){return getInteractionTags(_0x42cb5c,_0x42f1d6);})[_0x5ab9('0x24')](function(_0x490d2f){_0x1a3e0c(_0x490d2f);})[_0x5ab9('0x32')](function(_0x214602){_0x127732(_0x214602);});});}exports[_0x5ab9('0x33')]=function(_0x143be9,_0x2e0623){var _0x51808={},_0x1f0984={},_0x1de418={'count':0x0,'rows':[]};var _0x6fa551=_[_0x5ab9('0x2b')](db[_0x5ab9('0x34')]['rawAttributes'],function(_0x242ff6){return{'name':_0x242ff6[_0x5ab9('0x35')],'type':_0x242ff6[_0x5ab9('0x36')]['key']};});_0x1f0984[_0x5ab9('0x37')]=_[_0x5ab9('0x2b')](_0x6fa551,_0x5ab9('0x28'));_0x1f0984[_0x5ab9('0x38')]=_[_0x5ab9('0x39')](_0x143be9[_0x5ab9('0x38')]);_0x1f0984[_0x5ab9('0x3a')]=_[_0x5ab9('0x3b')](_0x1f0984['model'],_0x1f0984[_0x5ab9('0x38')]);_0x51808[_0x5ab9('0x3c')]=_[_0x5ab9('0x3b')](_0x1f0984[_0x5ab9('0x37')],qs['fields'](_0x143be9[_0x5ab9('0x38')]['fields']));_0x51808['attributes']=_0x51808['attributes'][_0x5ab9('0x3d')]?_0x51808[_0x5ab9('0x3c')]:_0x1f0984[_0x5ab9('0x37')];if(!_0x143be9[_0x5ab9('0x38')]['hasOwnProperty']('nolimit')){_0x51808[_0x5ab9('0x1c')]=qs[_0x5ab9('0x1c')](_0x143be9[_0x5ab9('0x38')][_0x5ab9('0x1c')]);_0x51808[_0x5ab9('0x1b')]=qs[_0x5ab9('0x1b')](_0x143be9[_0x5ab9('0x38')]['offset']);}_0x51808[_0x5ab9('0x3e')]=qs[_0x5ab9('0x3f')](_0x143be9[_0x5ab9('0x38')][_0x5ab9('0x3f')]);_0x51808[_0x5ab9('0x40')]=qs['filters'](_[_0x5ab9('0x41')](_0x143be9[_0x5ab9('0x38')],_0x1f0984[_0x5ab9('0x3a')]),_0x6fa551);var _0xf1f964=[];var _0x535478=squel[_0x5ab9('0x42')]()[_0x5ab9('0x43')]('id')['field']('name')[_0x5ab9('0x43')](_0x5ab9('0x44'))['from'](_0x5ab9('0x45'));var _0x4f9a73=squel['select']()['field'](_0x5ab9('0x46'))[_0x5ab9('0x43')](_0x5ab9('0x47'))[_0x5ab9('0x43')]('ui.FaxInteractionId')['from']('user_has_fax_interactions','ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x3c6b4c=squel[_0x5ab9('0x42')]()['from']('fax_interactions','i')[_0x5ab9('0x48')](_0x5ab9('0x49'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x5ab9('0x48')](_0x5ab9('0x4a'),'o',_0x5ab9('0x4b'))[_0x5ab9('0x48')](_0x5ab9('0x4c'),'a','a.id\x20=\x20i.FaxAccountId')[_0x5ab9('0x48')]('fax_messages','me',_0x5ab9('0x4d'))['left_join'](_0x5ab9('0x4e'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x5ab9('0x48')](_0x5ab9('0x45'),'t',_0x5ab9('0x4f'));var _0x13daa8=squel[_0x5ab9('0x50')]();var _0x571328=[];var _0x13a8eb=squel['expr']();var _0x3e7571;if(_0x143be9[_0x5ab9('0x38')]['search']){_0x3e7571=as[_0x5ab9('0x51')](_0x143be9['query'][_0x5ab9('0x52')]);var _0x58e043=_0x3e7571[_0x5ab9('0x53')];for(var _0x2fbfb8=0x0;_0x2fbfb8<_0x3e7571[_0x5ab9('0x54')][_0x5ab9('0x3d')];_0x2fbfb8++){var _0x5caa29=_0x3e7571[_0x5ab9('0x54')][_0x2fbfb8];var _0x37c4a6='i';var _0x1cb565=_['find'](_0x6fa551,[_0x5ab9('0x28'),_0x5caa29[_0x5ab9('0x43')]]);if(!_0x1cb565){switch(_0x5caa29['field']){case _0x5ab9('0x55'):if(_0x5caa29[_0x5ab9('0x56')]==0x1){_0x3c6b4c[_0x5ab9('0x57')]('`'+_0x5caa29[_0x5ab9('0x43')]+'`\x20=\x200');}else{_0x3c6b4c[_0x5ab9('0x57')]('`'+_0x5caa29[_0x5ab9('0x43')]+_0x5ab9('0x58'));}break;case _0x5ab9('0x59'):if(_0x5caa29['operator']===_0x5ab9('0x5a')){if(_0x5caa29[_0x5ab9('0x56')][_0x5ab9('0x2f')]('\x20')[_0x5ab9('0x3d')]>0x1){_0x13daa8[_0x58e043]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5ab9('0x5b')](_0x5caa29['value']),null);}else{var _0xec78bc='%'+_0x5caa29['value']+'%';_0x13daa8[_0x58e043](_0x5ab9('0x5c'),_0xec78bc,_0xec78bc,_0xec78bc);}}else{_0x1cb565=_[_0x5ab9('0x5d')](_0x6fa551,[_0x5ab9('0x28'),'ContactId']);_0x5caa29[_0x5ab9('0x43')]=_0x5ab9('0x5e');_0x203b49=as[_0x5ab9('0x5f')](_0x37c4a6,_0x1cb565['type'],_0x5caa29);_0x13daa8[_0x58e043](_0x203b49[_0x5ab9('0x60')],_0x203b49[_0x5ab9('0x56')]['start'],_0x203b49[_0x5ab9('0x56')][_0x5ab9('0x25')]);}break;case'Tag':var _0x18acc4=_0x5caa29[_0x5ab9('0x56')][_0x5ab9('0x2f')](',')[_0x5ab9('0x2b')](function(_0x5e1634){return Number(_0x5e1634);});_0x18acc4['forEach'](function(_0x22266e){_0x13a8eb['or'](_0x5ab9('0x61'),'%,'+_0x22266e+',%');});_0x571328=_[_0x5ab9('0x62')](_0x571328,_0x18acc4);break;case _0x5ab9('0x63'):if(_0x5caa29[_0x5ab9('0x64')]===_0x5ab9('0x5a')){_0x13daa8[_0x58e043]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5caa29[_0x5ab9('0x56')]+'%',null);}else{_0x1cb565=_[_0x5ab9('0x5d')](_0x6fa551,[_0x5ab9('0x28'),_0x5ab9('0x65')]);_0x5caa29['field']=_0x5ab9('0x65');_0x203b49=as[_0x5ab9('0x5f')](_0x37c4a6,_0x1cb565[_0x5ab9('0x36')],_0x5caa29);_0x13daa8[_0x58e043](_0x203b49[_0x5ab9('0x60')],_0x203b49[_0x5ab9('0x56')][_0x5ab9('0x66')],_0x203b49[_0x5ab9('0x56')][_0x5ab9('0x25')]);}break;case _0x5ab9('0x67'):_0x203b49=as['buildExpression']('me',null,_0x5caa29);_0x13daa8[_0x58e043](_0x203b49[_0x5ab9('0x60')],_0x203b49[_0x5ab9('0x56')][_0x5ab9('0x66')],_0x203b49[_0x5ab9('0x56')][_0x5ab9('0x25')]);break;}}else{var _0x203b49=as[_0x5ab9('0x5f')](_0x37c4a6,_0x1cb565[_0x5ab9('0x36')],_0x5caa29);_0x13daa8[_0x58e043](_0x203b49['text'],_0x203b49[_0x5ab9('0x56')][_0x5ab9('0x66')],_0x203b49[_0x5ab9('0x56')]['end']);}}}else{var _0x5586f1=_(_0x143be9[_0x5ab9('0x38')])[_0x5ab9('0x39')]()['map'](function(_0x53b92f){return _['some'](_0x6fa551,[_0x5ab9('0x28'),_0x53b92f])?_0x53b92f:undefined;})[_0x5ab9('0x68')]()[_0x5ab9('0x56')]();if(!_['isEmpty'](_0x5586f1)){_0x5586f1['forEach'](function(_0x15b6bd){if(_0x15b6bd===_0x5ab9('0x69')){_0x3c6b4c[_0x5ab9('0x40')](_0x5ab9('0x6a'),[][_0x5ab9('0x6b')](_0x143be9[_0x5ab9('0x38')][_0x15b6bd]));}else if(_0x15b6bd===_0x5ab9('0x6c')){var _0x342985=JSON['parse'](_0x143be9[_0x5ab9('0x38')][_0x15b6bd])[_0x5ab9('0x6d')];var _0x39894f=JSON[_0x5ab9('0x6e')](_0x143be9['query'][_0x15b6bd])[_0x5ab9('0x6f')];_0x3c6b4c[_0x5ab9('0x40')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x342985,_0x39894f);}else{if(_0x143be9[_0x5ab9('0x38')][_0x15b6bd]==='null'){_0x3c6b4c[_0x5ab9('0x40')]('i.'+_0x15b6bd+_0x5ab9('0x70'));}else{_0x3c6b4c[_0x5ab9('0x40')]('i.'+_0x15b6bd+_0x5ab9('0x71'),_0x143be9[_0x5ab9('0x38')][_0x15b6bd]);}}});}if(_0x143be9['query'][_0x5ab9('0x72')]){if(_0x143be9['query'][_0x5ab9('0x72')]==0x1){_0x3c6b4c[_0x5ab9('0x57')](_0x5ab9('0x73'));}else{_0x3c6b4c[_0x5ab9('0x57')](_0x5ab9('0x74'));}}if(_0x143be9[_0x5ab9('0x38')][_0x5ab9('0x75')]){_0x571328=_[_0x5ab9('0x76')](_0x143be9[_0x5ab9('0x38')][_0x5ab9('0x75')])?_0x143be9[_0x5ab9('0x38')]['tag']:new Array(_0x143be9[_0x5ab9('0x38')][_0x5ab9('0x75')]);_0x571328['forEach'](function(_0x1efdfd){_0x13a8eb['or'](_0x5ab9('0x61'),'%,'+_0x1efdfd+',%');});}if(_0x143be9[_0x5ab9('0x38')][_0x5ab9('0x77')]){var _0x6ae8d0=_0x143be9[_0x5ab9('0x38')][_0x5ab9('0x77')][_0x5ab9('0x78')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x5ab9('0x79'));if(qs[_0x5ab9('0x7a')](_0x6ae8d0)){_0x13daa8['or']('i.id\x20LIKE\x20?',_0x6ae8d0+'%')['or'](_0x5ab9('0x7b'),_0x6ae8d0+'%');}_0x13daa8['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x6ae8d0+'%');}}_0x3c6b4c[_0x5ab9('0x40')](_0x13daa8);_0x3c6b4c['group']('i.id');var _0x2d9fc3={'type':db[_0x5ab9('0x7c')][_0x5ab9('0x7d')][_0x5ab9('0x7e')],'raw':!![]};var _0xf75283=_0x3c6b4c['clone']();_0xf75283[_0x5ab9('0x43')](_0x5ab9('0x7f'));_0xf75283[_0x5ab9('0x43')](_0x5ab9('0x80'),_0x5ab9('0x55'));if(_0x51808['order']){_0x51808[_0x5ab9('0x3e')]['forEach'](function(_0x2569d6){_0x3c6b4c[_0x5ab9('0x3e')]('i.'+_0x2569d6[0x0],_0x2569d6[0x1]===_0x5ab9('0x81')?![]:!![]);});}if(!_[_0x5ab9('0x82')](_0x571328)){_0x3c6b4c[_0x5ab9('0x57')](_0x13a8eb);_0xf75283[_0x5ab9('0x40')]('t.id\x20IN\x20?',_0x571328);}BPromise[_0x5ab9('0x83')]()[_0x5ab9('0x24')](function(){if(!_0x3e7571){if(_0x143be9[_0x5ab9('0x38')]['FaxAccountId']||_0x143be9[_0x5ab9('0x38')][_0x5ab9('0x84')])return;_0xf75283[_0x5ab9('0x40')](_0x5ab9('0x85'));_0x3c6b4c['where'](_0x5ab9('0x85'));return;}return _0x143be9[_0x5ab9('0x86')][_0x5ab9('0x87')]({'attributes':['id'],'raw':!![]})['then'](function(_0x8a630a){if(_[_0x5ab9('0x82')](_0x8a630a)){_0xf75283['where'](_0x5ab9('0x88'));_0x3c6b4c[_0x5ab9('0x40')]('i.FaxAccountId\x20IS\x20NULL');}else{_0xf75283['where'](_0x5ab9('0x6a'),_[_0x5ab9('0x2b')](_0x8a630a,'id'));_0x3c6b4c[_0x5ab9('0x40')](_0x5ab9('0x6a'),_[_0x5ab9('0x2b')](_0x8a630a,'id'));}});})[_0x5ab9('0x24')](function(){db[_0x5ab9('0x89')]['query'](_0xf75283['toString'](),_0x2d9fc3)[_0x5ab9('0x24')](function(_0x26a8ea){_0x1de418[_0x5ab9('0x1a')]=_0x26a8ea['length'];if(_0x1de418[_0x5ab9('0x1a')]===0x0)return[];return db[_0x5ab9('0x89')][_0x5ab9('0x38')](_0x535478['toString'](),_0x2d9fc3)[_0x5ab9('0x24')](function(_0x4e296a){_0xf1f964=_['keyBy'](_0x4e296a,'id');_0x2d9fc3=_[_0x5ab9('0x8a')](_0x2d9fc3,{'model':db[_0x5ab9('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x143be9['query'][_0x5ab9('0x8b')]){_0x51808[_0x5ab9('0x3c')]['forEach'](function(_0x24468f){_0x3c6b4c['field']('i.'+_0x24468f);});}else{_0x3c6b4c[_0x5ab9('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5ab9('0x55'));_0x3c6b4c['field'](_0x5ab9('0x8c'),_0x5ab9('0x8d'));_0x3c6b4c[_0x5ab9('0x43')](_0x5ab9('0x8e'),_0x5ab9('0x8f'));_0x3c6b4c['field']('i.*');_0x3c6b4c[_0x5ab9('0x43')]('c.firstName',_0x5ab9('0x90'));_0x3c6b4c['field'](_0x5ab9('0x91'),_0x5ab9('0x92'));_0x3c6b4c[_0x5ab9('0x43')]('c.email',_0x5ab9('0x93'));_0x3c6b4c[_0x5ab9('0x43')](_0x5ab9('0x94'),_0x5ab9('0x95'));_0x3c6b4c[_0x5ab9('0x43')]('c.mobile',_0x5ab9('0x96'));_0x3c6b4c[_0x5ab9('0x43')](_0x5ab9('0x97'),_0x5ab9('0x98'));_0x3c6b4c[_0x5ab9('0x43')](_0x5ab9('0x99'),'Owner.fullname');_0x3c6b4c['field']('o.internal','Owner.internal');_0x3c6b4c['field'](_0x5ab9('0x9a'),_0x5ab9('0x2d'));}if(_0x51808[_0x5ab9('0x1c')])_0x3c6b4c[_0x5ab9('0x1c')](_0x51808[_0x5ab9('0x1c')]);if(_0x51808['offset'])_0x3c6b4c['offset'](_0x51808[_0x5ab9('0x1b')]);return db[_0x5ab9('0x89')][_0x5ab9('0x38')](_0x3c6b4c['toString'](),_0x2d9fc3);})[_0x5ab9('0x24')](function(_0x409042){_0x4f9a73['where'](_0x5ab9('0x9b'),_['map'](_0x409042,'id'));return db['sequelize'][_0x5ab9('0x38')](_0x4f9a73[_0x5ab9('0x9c')](),_0x2d9fc3)[_0x5ab9('0x24')](function(_0x5d11ac){var _0x9cb174=_[_0x5ab9('0x9d')](_0x5d11ac,_0x5ab9('0x9e'));var _0x29c0ca=[];_0x409042[_0x5ab9('0x30')](function(_0xfb25a2){_0x29c0ca[_0x5ab9('0x31')](updateFaxInteraction(_0xfb25a2,_0xf1f964,_0x9cb174));});return BPromise[_0x5ab9('0x9f')](_0x29c0ca);});});})[_0x5ab9('0x24')](function(_0x14398b){_0x1de418[_0x5ab9('0xa0')]=_0x14398b;return _0x1de418;})[_0x5ab9('0x24')](respondWithFilteredResult(_0x2e0623,_0x51808));})[_0x5ab9('0x32')](handleError(_0x2e0623,null));};exports[_0x5ab9('0xa1')]=function(_0x51a148,_0x14665b){var _0x3d4a47={'raw':![],'where':{'id':_0x51a148[_0x5ab9('0xa2')]['id']}},_0x1da635={};_0x1da635[_0x5ab9('0x37')]=_[_0x5ab9('0x39')](db[_0x5ab9('0x34')]['rawAttributes']);_0x1da635['query']=_['keys'](_0x51a148[_0x5ab9('0x38')]);_0x1da635['filters']=_[_0x5ab9('0x3b')](_0x1da635['model'],_0x1da635[_0x5ab9('0x38')]);_0x3d4a47[_0x5ab9('0x3c')]=_[_0x5ab9('0x3b')](_0x1da635[_0x5ab9('0x37')],qs[_0x5ab9('0x8b')](_0x51a148[_0x5ab9('0x38')]['fields']));_0x3d4a47[_0x5ab9('0x3c')]=_0x3d4a47[_0x5ab9('0x3c')][_0x5ab9('0x3d')]?_0x3d4a47[_0x5ab9('0x3c')]:_0x1da635[_0x5ab9('0x37')];if(_0x51a148[_0x5ab9('0x38')]['includeAll']){_0x3d4a47[_0x5ab9('0xa3')]=[{'all':!![]}];}_0x3d4a47=_[_0x5ab9('0x8a')]({},_0x3d4a47,_0x51a148[_0x5ab9('0xa4')]);return db[_0x5ab9('0x34')][_0x5ab9('0x5d')](_0x3d4a47)[_0x5ab9('0x24')](handleEntityNotFound(_0x14665b,null))[_0x5ab9('0x24')](respondWithResult(_0x14665b,null))['catch'](handleError(_0x14665b,null));};exports[_0x5ab9('0xa5')]=function(_0x4a1b39,_0x37bbc7){return db[_0x5ab9('0x34')]['create'](_0x4a1b39[_0x5ab9('0x67')],{})['then'](respondWithResult(_0x37bbc7,0xc9))[_0x5ab9('0x32')](handleError(_0x37bbc7,null));};exports[_0x5ab9('0x22')]=function(_0x5d9279,_0x5d4e33){if(_0x5d9279[_0x5ab9('0x67')]['id']){delete _0x5d9279['body']['id'];}return db[_0x5ab9('0x34')][_0x5ab9('0x5d')]({'where':{'id':_0x5d9279[_0x5ab9('0xa2')]['id']}})[_0x5ab9('0x24')](handleEntityNotFound(_0x5d4e33,null))[_0x5ab9('0x24')](saveUpdates(_0x5d9279[_0x5ab9('0x67')],null))['then'](respondWithResult(_0x5d4e33,null))[_0x5ab9('0x32')](handleError(_0x5d4e33,null));};exports['destroy']=function(_0x255e74,_0x485c7a){return db[_0x5ab9('0x34')][_0x5ab9('0x5d')]({'where':{'id':_0x255e74[_0x5ab9('0xa2')]['id']}})[_0x5ab9('0x24')](handleEntityNotFound(_0x485c7a,null))[_0x5ab9('0x24')](removeEntity(_0x485c7a,null))['catch'](handleError(_0x485c7a,null));};exports[_0x5ab9('0xa6')]=function(_0xaf30ff,_0x3c9bf4){return db[_0x5ab9('0x34')]['describe']()[_0x5ab9('0x24')](respondWithResult(_0x3c9bf4,null))[_0x5ab9('0x32')](handleError(_0x3c9bf4,null));};exports[_0x5ab9('0xa7')]=function(_0x1a4709,_0x1fdaa5,_0x34063e){return db[_0x5ab9('0xa8')][_0x5ab9('0x5d')]({'where':{'id':_0x1a4709[_0x5ab9('0xa2')]['id']}})[_0x5ab9('0x24')](handleEntityNotFound(_0x1fdaa5,null))['then'](function(_0x3479a9){if(_0x3479a9){return _0x3479a9['addMessage'](_0x1a4709[_0x5ab9('0x67')][_0x5ab9('0xa9')],_[_0x5ab9('0xaa')](_0x1a4709['body'],[_0x5ab9('0xa9'),'id'])||{});}})['then'](respondWithResult(_0x1fdaa5,null))['catch'](handleError(_0x1fdaa5,null));};exports['getMessages']=function(_0x47ab3b,_0x41a320,_0x3cbdd2){var _0x54963b={'raw':![],'where':{}};var _0x4b50f2={};var _0x61fe20={'count':0x0,'rows':[]};return db[_0x5ab9('0x34')][_0x5ab9('0xab')]({'where':{'id':_0x47ab3b['params']['id']}})[_0x5ab9('0x24')](handleEntityNotFound(_0x41a320,null))[_0x5ab9('0x24')](function(_0x3ef04e){if(_0x3ef04e){_0x4b50f2[_0x5ab9('0x37')]=_['keys'](db[_0x5ab9('0xa8')][_0x5ab9('0xac')]);_0x4b50f2[_0x5ab9('0x38')]=_[_0x5ab9('0x39')](_0x47ab3b[_0x5ab9('0x38')]);_0x4b50f2[_0x5ab9('0x3a')]=_[_0x5ab9('0x3b')](_0x4b50f2['model'],_0x4b50f2[_0x5ab9('0x38')]);_0x54963b[_0x5ab9('0x3c')]=_[_0x5ab9('0x3b')](_0x4b50f2[_0x5ab9('0x37')],qs[_0x5ab9('0x8b')](_0x47ab3b['query'][_0x5ab9('0x8b')]));_0x54963b['attributes']=_0x54963b['attributes'][_0x5ab9('0x3d')]?_0x54963b[_0x5ab9('0x3c')]:_0x4b50f2[_0x5ab9('0x37')];if(!_0x47ab3b['query'][_0x5ab9('0xad')](_0x5ab9('0xae'))){_0x54963b[_0x5ab9('0x1c')]=qs[_0x5ab9('0x1c')](_0x47ab3b[_0x5ab9('0x38')][_0x5ab9('0x1c')]);_0x54963b[_0x5ab9('0x1b')]=qs[_0x5ab9('0x1b')](_0x47ab3b['query']['offset']);}_0x54963b[_0x5ab9('0x3e')]=qs['sort'](_0x47ab3b['query']['sort']);_0x54963b[_0x5ab9('0x40')]=qs[_0x5ab9('0x3a')](_['pick'](_0x47ab3b[_0x5ab9('0x38')],_0x4b50f2[_0x5ab9('0x3a')]));_0x54963b['where'][_0x5ab9('0x9e')]=_0x3ef04e['id'];if(_0x47ab3b['query'][_0x5ab9('0x77')]){_0x54963b[_0x5ab9('0x40')]=_[_0x5ab9('0x8a')](_0x54963b[_0x5ab9('0x40')],{'$or':_[_0x5ab9('0x2b')](_0x54963b['attributes'],function(_0x58fa3e){var _0x43ce95={};_0x43ce95[_0x58fa3e]={'$like':'%'+_0x47ab3b['query'][_0x5ab9('0x77')]+'%'};return _0x43ce95;})});}if(_0x47ab3b[_0x5ab9('0x38')][_0x5ab9('0x6d')]){var _0x23f35d=_0x47ab3b[_0x5ab9('0x38')][_0x5ab9('0x6d')][_0x5ab9('0x2f')](',');var _0x415ab5={};_0x415ab5[_0x23f35d[0x0]]={'$gte':moment(_0x23f35d[0x1])[_0x5ab9('0xaf')](_0x5ab9('0xb0'))};_0x54963b[_0x5ab9('0x40')]=_['merge'](_0x54963b[_0x5ab9('0x40')],_0x415ab5);}_0x54963b=_[_0x5ab9('0x8a')]({},_0x54963b,_0x47ab3b[_0x5ab9('0xa4')]);return db['FaxMessage'][_0x5ab9('0x1a')]({'where':_0x54963b[_0x5ab9('0x40')]})['then'](function(_0x56987b){_0x61fe20[_0x5ab9('0x1a')]=_0x56987b;if(_0x47ab3b['query']['includeAll']){_0x54963b[_0x5ab9('0xa3')]=[{'all':!![]}];}return db[_0x5ab9('0xa8')][_0x5ab9('0xb1')](_0x54963b);})['then'](function(_0x13d402){_0x61fe20['rows']=_0x13d402;return _0x61fe20;});}})[_0x5ab9('0x24')](respondWithFilteredResult(_0x41a320,_0x54963b))[_0x5ab9('0x32')](handleError(_0x41a320,null));};exports[_0x5ab9('0xb2')]=function(_0x5030d8,_0x532c44,_0x1e7b41){return db[_0x5ab9('0x34')][_0x5ab9('0x5d')]({'where':{'id':_0x5030d8[_0x5ab9('0xa2')]['id']}})[_0x5ab9('0x24')](handleEntityNotFound(_0x532c44,null))[_0x5ab9('0x24')](function(_0x467ec8){if(_0x467ec8){return _0x467ec8[_0x5ab9('0xb3')](_0x5030d8[_0x5ab9('0x67')][_0x5ab9('0xa9')],_[_0x5ab9('0xaa')](_0x5030d8[_0x5ab9('0x67')],['ids','id'])||{})[_0x5ab9('0xb4')](function(){return db[_0x5ab9('0xb5')][_0x5ab9('0xb1')]({'attributes':['id','name',_0x5ab9('0x44')],'where':{'id':_0x5030d8[_0x5ab9('0x67')][_0x5ab9('0xa9')]}});})[_0x5ab9('0x24')](function(_0x22bfd5){socket[_0x5ab9('0xb6')](_0x5ab9('0xb7'),{'id':Number(_0x5030d8[_0x5ab9('0xa2')]['id']),'tags':_0x22bfd5||[]});return{'id':Number(_0x5030d8[_0x5ab9('0xa2')]['id']),'tags':_0x22bfd5||[]};});}})[_0x5ab9('0x24')](respondWithResult(_0x532c44,null))[_0x5ab9('0x32')](handleError(_0x532c44,null));};exports['removeTags']=function(_0x8f17a8,_0x564b80,_0x2990c9){return db[_0x5ab9('0x34')][_0x5ab9('0x5d')]({'where':{'id':_0x8f17a8[_0x5ab9('0xa2')]['id']}})[_0x5ab9('0x24')](handleEntityNotFound(_0x564b80,null))[_0x5ab9('0x24')](function(_0x5db3b6){if(_0x5db3b6){return _0x5db3b6['removeTags'](_0x8f17a8[_0x5ab9('0x38')][_0x5ab9('0xa9')]);}})['then'](respondWithStatusCode(_0x564b80,null))[_0x5ab9('0x32')](handleError(_0x564b80,null));};exports[_0x5ab9('0xb8')]=function(_0x299fce,_0x4f565b){var _0x90266c=moment()[_0x5ab9('0xb9')]()[_0x5ab9('0x9c')]();var _0x43b0b3=path[_0x5ab9('0xba')](config[_0x5ab9('0xbb')],_0x5ab9('0xbc'),_0x5ab9('0xbd'),_0x5ab9('0xbe'));var _0x4c45cb=path[_0x5ab9('0xba')](config['root'],_0x5ab9('0xbc'),_0x5ab9('0xbd'),_0x5ab9('0xbf'));var _0x345f9e=path['join'](_0x43b0b3,_0x90266c);var _0x314656=util[_0x5ab9('0xaf')]('transcript-%d-%s.zip',_0x299fce[_0x5ab9('0xa2')]['id'],_0x90266c);var _0x2ade7a=path['join'](_0x43b0b3,_0x314656);var _0x50e21a=[];_0x50e21a[_0x5ab9('0x31')]({'model':db['Attachment'],'as':_0x5ab9('0xc0'),'raw':!![]});var _0x4df1ba=[{'model':db['FaxMessage'],'as':_0x5ab9('0xc1'),'attributes':['id',_0x5ab9('0x67'),_0x5ab9('0x6c')],'include':_0x50e21a}];return db[_0x5ab9('0x34')][_0x5ab9('0x5d')]({'where':{'id':_0x299fce[_0x5ab9('0xa2')]['id']},'include':_0x4df1ba})[_0x5ab9('0x24')](handleEntityNotFound(_0x4f565b,null))[_0x5ab9('0x24')](function(_0x1fff66){if(_0x1fff66&&_0x1fff66[_0x5ab9('0xc1')]){var _0x5d7aa7=_0x1fff66[_0x5ab9('0xc2')]({'plain':!![]});fs[_0x5ab9('0xc3')](_0x345f9e);for(var _0x490a79=0x0;_0x490a79<_0x5d7aa7[_0x5ab9('0xc1')][_0x5ab9('0x3d')];_0x490a79++){var _0x2bd7c1=_0x5d7aa7['Messages'][_0x490a79][_0x5ab9('0xc0')];if(_0x2bd7c1){var _0x481431=path[_0x5ab9('0xba')](_0x4c45cb,_0x2bd7c1[_0x5ab9('0xc4')]);if(fs['existsSync'](_0x481431)){fs['createReadStream'](_0x481431)[_0x5ab9('0xc5')](fs[_0x5ab9('0xc6')](path[_0x5ab9('0xba')](_0x345f9e,_0x2bd7c1[_0x5ab9('0xc4')])));}}}return BPromise[_0x5ab9('0x83')]()[_0x5ab9('0x24')](function(){return new BPromise(function(_0x233684,_0x393e20){zipdir(_0x345f9e,{'saveTo':_0x2ade7a},function(_0x390b69,_0x722345){if(_0x390b69)return _0x393e20(_0x390b69);return _0x233684(_0x722345);});})['then'](function(){return new BPromise(function(_0x2c2cfc,_0x3c1275){rimraf(_0x345f9e,function(_0x52cd8b){if(_0x52cd8b)_0x3c1275(_0x52cd8b);return _0x2c2cfc();});});})[_0x5ab9('0x24')](function(){return _0x4f565b['download'](_0x2ade7a,_0x314656,function(_0x23cd24){if(_0x23cd24){console['log']('err',_0x23cd24);}else{fs[_0x5ab9('0xc7')](_0x2ade7a);}});});});}else{return _0x4f565b[_0x5ab9('0xc8')](0xc8);}})['catch'](handleError(_0x4f565b,null));};
\ No newline at end of file
+var _0x315f=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','users','u.id\x20=\x20ui.UserId','left_join','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','length','unreadMessages','value','`\x20=\x200','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','catch','show','params','include','options','create','body','update','describe','FaxMessage','omit','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','push','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','log','err','unlinkSync','html-pdf','rimraf','request-promise','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','redis','localhost','socket.io-emitter','register','status','end','json','offset','limit','set','Content-Range','apply','reject','save','destroy','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','then','index','rawAttributes','type','model','query','keys','intersection'];(function(_0x4e69f7,_0x2031af){var _0x67b5e2=function(_0x50b8b1){while(--_0x50b8b1){_0x4e69f7['push'](_0x4e69f7['shift']());}};_0x67b5e2(++_0x2031af);}(_0x315f,0x174));var _0xf315=function(_0x59e862,_0x477bf2){_0x59e862=_0x59e862-0x0;var _0x1a25ee=_0x315f[_0x59e862];return _0x1a25ee;};'use strict';var pdf=require(_0xf315('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf315('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf315('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf315('0x3'));var sox=require('sox');var csv=require(_0xf315('0x4'));var ejs=require(_0xf315('0x5'));var fs=require('fs');var _=require(_0xf315('0x6'));var squel=require(_0xf315('0x7'));var crypto=require(_0xf315('0x8'));var jsforce=require(_0xf315('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf315('0xa'));var Papa=require('papaparse');var Redis=require(_0xf315('0xb'));var authService=require(_0xf315('0xc'));var qs=require(_0xf315('0xd'));var as=require(_0xf315('0xe'));var hardwareService=require(_0xf315('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xf315('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf315('0x11')]=_['defaults'](config[_0xf315('0x11')],{'host':_0xf315('0x12'),'port':0x18eb});var socket=require(_0xf315('0x13'))(new Redis(config[_0xf315('0x11')]));require('./faxInteraction.socket')[_0xf315('0x14')](socket);function respondWithStatusCode(_0x1ee2ef,_0x56deea){_0x56deea=_0x56deea||0xcc;return function(_0x19bb1a){if(_0x19bb1a){return _0x1ee2ef['sendStatus'](_0x56deea);}return _0x1ee2ef[_0xf315('0x15')](_0x56deea)[_0xf315('0x16')]();};}function respondWithResult(_0x20a72c,_0x22c049){_0x22c049=_0x22c049||0xc8;return function(_0x45fc6d){if(_0x45fc6d){return _0x20a72c[_0xf315('0x15')](_0x22c049)[_0xf315('0x17')](_0x45fc6d);}};}function respondWithFilteredResult(_0x44e8ab,_0x3d0630){return function(_0x294933){if(_0x294933){var _0x3cc17b=_0x294933['count'],_0x252d9c=_0x3d0630[_0xf315('0x18')],_0x24ae41=_0x3d0630[_0xf315('0x18')]+_0x3d0630[_0xf315('0x19')],_0xb5fcb6;if(_0x24ae41>=_0x3cc17b){_0x24ae41=_0x3cc17b;_0xb5fcb6=0xc8;}else{_0xb5fcb6=0xce;}_0x44e8ab[_0xf315('0x15')](_0xb5fcb6);return _0x44e8ab[_0xf315('0x1a')](_0xf315('0x1b'),_0x252d9c+'-'+_0x24ae41+'/'+_0x3cc17b)[_0xf315('0x17')](_0x294933);}return null;};}function patchUpdates(_0x42e89f){return function(_0x558377){try{jsonpatch[_0xf315('0x1c')](_0x558377,_0x42e89f,!![]);}catch(_0x2ba642){return BPromise[_0xf315('0x1d')](_0x2ba642);}return _0x558377[_0xf315('0x1e')]();};}function saveUpdates(_0x21dfad,_0x56f6e3){return function(_0x120158){if(_0x120158){return _0x120158['update'](_0x21dfad)['then'](function(_0x4b218b){return _0x4b218b;});}return null;};}function removeEntity(_0x25d707,_0x219bf2){return function(_0x14021d){if(_0x14021d){return _0x14021d[_0xf315('0x1f')]()['then'](function(){_0x25d707['status'](0xcc)[_0xf315('0x16')]();});}};}function handleEntityNotFound(_0x10354c,_0x4b730d){return function(_0x325a29){if(!_0x325a29){_0x10354c['sendStatus'](0x194);}return _0x325a29;};}function handleError(_0x52b51,_0x4d16e2){_0x4d16e2=_0x4d16e2||0x1f4;return function(_0x41dac4){logger[_0xf315('0x20')](_0x41dac4[_0xf315('0x21')]);if(_0x41dac4[_0xf315('0x22')]){delete _0x41dac4[_0xf315('0x22')];}_0x52b51['status'](_0x4d16e2)['send'](_0x41dac4);};}function getInteractionUsers(_0x456325,_0x2072db){return new BPromise(function(_0x8866ef,_0x46ceb3){try{if(_0x2072db[_0x456325['id']]){_0x456325[_0xf315('0x23')]=_[_0xf315('0x24')](_0x2072db[_0x456325['id']],function(_0x2915c3){return{'id':_0x2915c3['id'],'fullname':_0x2915c3[_0xf315('0x25')]};});}}catch(_0x11993e){_0x46ceb3(_0x11993e);}_0x8866ef(_0x456325);});}function getInteractionTags(_0x514d38,_0x373c9e){return new BPromise(function(_0x42ffd3,_0x41bfdc){try{if(_0x514d38[_0xf315('0x26')]){_0x514d38[_0xf315('0x27')]=[];_0x514d38[_0xf315('0x26')][_0xf315('0x28')](',')[_0xf315('0x29')](function(_0x49e619){_0x514d38[_0xf315('0x27')]['push'](_0x373c9e[_0x49e619]);});}delete _0x514d38[_0xf315('0x26')];}catch(_0x3ebe6c){_0x41bfdc(_0x3ebe6c);}_0x42ffd3(_0x514d38);});}function updateFaxInteraction(_0x132354,_0x1df5ad,_0xe5550f){return new BPromise(function(_0x1430f0,_0x1c2195){return getInteractionUsers(_0x132354,_0xe5550f)['then'](function(_0x150786){return getInteractionTags(_0x150786,_0x1df5ad);})[_0xf315('0x2a')](function(_0x10ac94){_0x1430f0(_0x10ac94);})['catch'](function(_0x26b142){_0x1c2195(_0x26b142);});});}exports[_0xf315('0x2b')]=function(_0x32329d,_0x357915){var _0x172968={},_0x34d592={},_0x4d1e17={'count':0x0,'rows':[]};var _0x5d29ca=_[_0xf315('0x24')](db['FaxInteraction'][_0xf315('0x2c')],function(_0x48b993){return{'name':_0x48b993['fieldName'],'type':_0x48b993[_0xf315('0x2d')]['key']};});_0x34d592[_0xf315('0x2e')]=_[_0xf315('0x24')](_0x5d29ca,_0xf315('0x22'));_0x34d592[_0xf315('0x2f')]=_[_0xf315('0x30')](_0x32329d[_0xf315('0x2f')]);_0x34d592['filters']=_[_0xf315('0x31')](_0x34d592[_0xf315('0x2e')],_0x34d592[_0xf315('0x2f')]);_0x172968[_0xf315('0x32')]=_[_0xf315('0x31')](_0x34d592[_0xf315('0x2e')],qs[_0xf315('0x33')](_0x32329d[_0xf315('0x2f')]['fields']));_0x172968[_0xf315('0x32')]=_0x172968[_0xf315('0x32')]['length']?_0x172968[_0xf315('0x32')]:_0x34d592[_0xf315('0x2e')];if(!_0x32329d[_0xf315('0x2f')][_0xf315('0x34')](_0xf315('0x35'))){_0x172968['limit']=qs['limit'](_0x32329d[_0xf315('0x2f')][_0xf315('0x19')]);_0x172968[_0xf315('0x18')]=qs[_0xf315('0x18')](_0x32329d[_0xf315('0x2f')]['offset']);}_0x172968[_0xf315('0x36')]=qs[_0xf315('0x37')](_0x32329d[_0xf315('0x2f')]['sort']);_0x172968[_0xf315('0x38')]=qs[_0xf315('0x39')](_[_0xf315('0x3a')](_0x32329d[_0xf315('0x2f')],_0x34d592[_0xf315('0x39')]),_0x5d29ca);var _0x4d8e86=[];var _0x12dbdf=squel[_0xf315('0x3b')]()['field']('id')['field'](_0xf315('0x22'))[_0xf315('0x3c')]('color')[_0xf315('0x3d')](_0xf315('0x3e'));var _0x370382=squel['select']()[_0xf315('0x3c')](_0xf315('0x3f'))[_0xf315('0x3c')](_0xf315('0x40'))['field'](_0xf315('0x41'))[_0xf315('0x3d')]('user_has_fax_interactions','ui')['left_join'](_0xf315('0x42'),'u',_0xf315('0x43'));var _0x4a6574=squel[_0xf315('0x3b')]()[_0xf315('0x3d')]('fax_interactions','i')[_0xf315('0x44')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xf315('0x44')]('users','o',_0xf315('0x45'))[_0xf315('0x44')](_0xf315('0x46'),'a',_0xf315('0x47'))['left_join'](_0xf315('0x48'),'me',_0xf315('0x49'))[_0xf315('0x44')](_0xf315('0x4a'),'it',_0xf315('0x4b'))['left_join'](_0xf315('0x3e'),'t','t.id\x20=\x20it.TagId');var _0xbdc954=squel[_0xf315('0x4c')]();var _0x59f371=[];var _0x130696=squel['expr']();var _0x42b5e0;if(_0x32329d[_0xf315('0x2f')][_0xf315('0x4d')]){_0x42b5e0=as[_0xf315('0x4e')](_0x32329d[_0xf315('0x2f')][_0xf315('0x4d')]);var _0x28d929=_0x42b5e0[_0xf315('0x4f')];for(var _0x3d7c21=0x0;_0x3d7c21<_0x42b5e0[_0xf315('0x50')][_0xf315('0x51')];_0x3d7c21++){var _0x153fea=_0x42b5e0[_0xf315('0x50')][_0x3d7c21];var _0x404aa6='i';var _0x1163d2=_['find'](_0x5d29ca,['name',_0x153fea[_0xf315('0x3c')]]);if(!_0x1163d2){switch(_0x153fea[_0xf315('0x3c')]){case _0xf315('0x52'):if(_0x153fea[_0xf315('0x53')]==0x1){_0x4a6574['having']('`'+_0x153fea[_0xf315('0x3c')]+_0xf315('0x54'));}else{_0x4a6574[_0xf315('0x55')]('`'+_0x153fea[_0xf315('0x3c')]+'`\x20>\x200');}break;case _0xf315('0x56'):if(_0x153fea[_0xf315('0x57')]===_0xf315('0x58')){if(_0x153fea[_0xf315('0x53')]['split']('\x20')[_0xf315('0x51')]>0x1){_0xbdc954[_0x28d929](_0xf315('0x59'),qs[_0xf315('0x5a')](_0x153fea[_0xf315('0x53')]),null);}else{var _0x124d1c='%'+_0x153fea[_0xf315('0x53')]+'%';_0xbdc954[_0x28d929](_0xf315('0x5b'),_0x124d1c,_0x124d1c,_0x124d1c);}}else{_0x1163d2=_[_0xf315('0x5c')](_0x5d29ca,[_0xf315('0x22'),_0xf315('0x5d')]);_0x153fea[_0xf315('0x3c')]=_0xf315('0x5d');_0x72bc4c=as['buildExpression'](_0x404aa6,_0x1163d2[_0xf315('0x2d')],_0x153fea);_0xbdc954[_0x28d929](_0x72bc4c[_0xf315('0x5e')],_0x72bc4c[_0xf315('0x53')][_0xf315('0x5f')],_0x72bc4c[_0xf315('0x53')][_0xf315('0x16')]);}break;case _0xf315('0x60'):var _0x3c943b=_0x153fea[_0xf315('0x53')][_0xf315('0x28')](',')[_0xf315('0x24')](function(_0x35e069){return Number(_0x35e069);});_0x3c943b['forEach'](function(_0x5dab81){_0x130696['or'](_0xf315('0x61'),'%,'+_0x5dab81+',%');});_0x59f371=_[_0xf315('0x62')](_0x59f371,_0x3c943b);break;case _0xf315('0x63'):if(_0x153fea[_0xf315('0x57')]==='$substring'){_0xbdc954[_0x28d929](_0xf315('0x64'),'%'+_0x153fea[_0xf315('0x53')]+'%',null);}else{_0x1163d2=_['find'](_0x5d29ca,[_0xf315('0x22'),_0xf315('0x65')]);_0x153fea['field']=_0xf315('0x65');_0x72bc4c=as[_0xf315('0x66')](_0x404aa6,_0x1163d2[_0xf315('0x2d')],_0x153fea);_0xbdc954[_0x28d929](_0x72bc4c[_0xf315('0x5e')],_0x72bc4c[_0xf315('0x53')][_0xf315('0x5f')],_0x72bc4c[_0xf315('0x53')][_0xf315('0x16')]);}break;case'body':_0x72bc4c=as[_0xf315('0x66')]('me',null,_0x153fea);_0xbdc954[_0x28d929](_0x72bc4c[_0xf315('0x5e')],_0x72bc4c[_0xf315('0x53')][_0xf315('0x5f')],_0x72bc4c['value'][_0xf315('0x16')]);break;}}else{var _0x72bc4c=as[_0xf315('0x66')](_0x404aa6,_0x1163d2[_0xf315('0x2d')],_0x153fea);_0xbdc954[_0x28d929](_0x72bc4c[_0xf315('0x5e')],_0x72bc4c[_0xf315('0x53')][_0xf315('0x5f')],_0x72bc4c[_0xf315('0x53')]['end']);}}}else{var _0x365502=_(_0x32329d[_0xf315('0x2f')])[_0xf315('0x30')]()['map'](function(_0x2aaa32){return _[_0xf315('0x67')](_0x5d29ca,[_0xf315('0x22'),_0x2aaa32])?_0x2aaa32:undefined;})[_0xf315('0x68')]()['value']();if(!_[_0xf315('0x69')](_0x365502)){_0x365502[_0xf315('0x29')](function(_0x36d401){if(_0x36d401===_0xf315('0x6a')){_0x4a6574[_0xf315('0x38')](_0xf315('0x6b'),[][_0xf315('0x6c')](_0x32329d[_0xf315('0x2f')][_0x36d401]));}else if(_0x36d401===_0xf315('0x6d')){var _0x5e811a=JSON['parse'](_0x32329d[_0xf315('0x2f')][_0x36d401])[_0xf315('0x6e')];var _0x4d85ce=JSON[_0xf315('0x6f')](_0x32329d[_0xf315('0x2f')][_0x36d401])[_0xf315('0x70')];_0x4a6574[_0xf315('0x38')](_0xf315('0x71'),_0x5e811a,_0x4d85ce);}else{if(_0x32329d['query'][_0x36d401]===_0xf315('0x72')){_0x4a6574[_0xf315('0x38')]('i.'+_0x36d401+'\x20IS\x20NULL');}else{_0x4a6574[_0xf315('0x38')]('i.'+_0x36d401+_0xf315('0x73'),_0x32329d['query'][_0x36d401]);}}});}if(_0x32329d[_0xf315('0x2f')][_0xf315('0x74')]){if(_0x32329d[_0xf315('0x2f')]['read']==0x1){_0x4a6574[_0xf315('0x55')](_0xf315('0x75'));}else{_0x4a6574[_0xf315('0x55')]('`unreadMessages`\x20>\x200');}}if(_0x32329d[_0xf315('0x2f')]['tag']){_0x59f371=_[_0xf315('0x76')](_0x32329d[_0xf315('0x2f')][_0xf315('0x77')])?_0x32329d['query']['tag']:new Array(_0x32329d['query'][_0xf315('0x77')]);_0x59f371[_0xf315('0x29')](function(_0x5cc49a){_0x130696['or'](_0xf315('0x61'),'%,'+_0x5cc49a+',%');});}if(_0x32329d[_0xf315('0x2f')]['filter']){var _0x392d57=_0x32329d[_0xf315('0x2f')][_0xf315('0x78')][_0xf315('0x79')]('\x5c','\x5c\x5c')[_0xf315('0x79')]('\x27\x27',_0xf315('0x7a'));if(qs[_0xf315('0x7b')](_0x392d57)){_0xbdc954['or'](_0xf315('0x7c'),_0x392d57+'%')['or'](_0xf315('0x7d'),_0x392d57+'%');}_0xbdc954['or'](_0xf315('0x7e'),_0x392d57+'%');}}_0x4a6574[_0xf315('0x38')](_0xbdc954);_0x4a6574['group'](_0xf315('0x7f'));var _0x598651={'type':db[_0xf315('0x80')][_0xf315('0x81')][_0xf315('0x82')],'raw':!![]};var _0x108295=_0x4a6574[_0xf315('0x83')]();_0x108295[_0xf315('0x3c')](_0xf315('0x7f'));_0x108295['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf315('0x52'));if(_0x172968[_0xf315('0x36')]){_0x172968[_0xf315('0x36')][_0xf315('0x29')](function(_0x42cc06){_0x4a6574['order']('i.'+_0x42cc06[0x0],_0x42cc06[0x1]===_0xf315('0x84')?![]:!![]);});}if(!_[_0xf315('0x69')](_0x59f371)){_0x4a6574[_0xf315('0x55')](_0x130696);_0x108295['where'](_0xf315('0x85'),_0x59f371);}BPromise[_0xf315('0x86')]()[_0xf315('0x2a')](function(){if(!_0x42b5e0){if(_0x32329d['query']['FaxAccountId']||_0x32329d[_0xf315('0x2f')][_0xf315('0x87')])return;_0x108295[_0xf315('0x38')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x4a6574['where'](_0xf315('0x88'));return;}return _0x32329d['user'][_0xf315('0x89')]({'attributes':['id'],'raw':!![]})[_0xf315('0x2a')](function(_0x4ba848){if(_[_0xf315('0x69')](_0x4ba848)){_0x108295['where'](_0xf315('0x8a'));_0x4a6574[_0xf315('0x38')](_0xf315('0x8a'));}else{_0x108295[_0xf315('0x38')](_0xf315('0x6b'),_['map'](_0x4ba848,'id'));_0x4a6574[_0xf315('0x38')](_0xf315('0x6b'),_['map'](_0x4ba848,'id'));}});})[_0xf315('0x2a')](function(){db[_0xf315('0x8b')][_0xf315('0x2f')](_0x108295[_0xf315('0x8c')](),_0x598651)[_0xf315('0x2a')](function(_0x78d273){_0x4d1e17[_0xf315('0x8d')]=_0x78d273[_0xf315('0x51')];if(_0x4d1e17['count']===0x0)return[];return db[_0xf315('0x8b')]['query'](_0x12dbdf['toString'](),_0x598651)[_0xf315('0x2a')](function(_0x40c905){_0x4d8e86=_[_0xf315('0x8e')](_0x40c905,'id');_0x598651=_[_0xf315('0x8f')](_0x598651,{'model':db[_0xf315('0x90')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x32329d[_0xf315('0x2f')]['fields']){_0x172968[_0xf315('0x32')][_0xf315('0x29')](function(_0x5802d3){_0x4a6574[_0xf315('0x3c')]('i.'+_0x5802d3);});}else{_0x4a6574['field'](_0xf315('0x91'),_0xf315('0x52'));_0x4a6574[_0xf315('0x3c')](_0xf315('0x92'),_0xf315('0x93'));_0x4a6574['field'](_0xf315('0x94'),_0xf315('0x95'));_0x4a6574[_0xf315('0x3c')](_0xf315('0x96'));_0x4a6574['field'](_0xf315('0x97'),_0xf315('0x98'));_0x4a6574[_0xf315('0x3c')](_0xf315('0x99'),_0xf315('0x9a'));_0x4a6574['field'](_0xf315('0x9b'),_0xf315('0x9c'));_0x4a6574['field']('c.phone','Contact.phone');_0x4a6574[_0xf315('0x3c')](_0xf315('0x9d'),_0xf315('0x9e'));_0x4a6574[_0xf315('0x3c')](_0xf315('0x9f'),'Contact.fax');_0x4a6574['field'](_0xf315('0xa0'),_0xf315('0xa1'));_0x4a6574[_0xf315('0x3c')](_0xf315('0xa2'),_0xf315('0xa3'));_0x4a6574[_0xf315('0x3c')](_0xf315('0xa4'),'TagIds');}if(_0x172968[_0xf315('0x19')])_0x4a6574[_0xf315('0x19')](_0x172968['limit']);if(_0x172968[_0xf315('0x18')])_0x4a6574[_0xf315('0x18')](_0x172968[_0xf315('0x18')]);return db['sequelize']['query'](_0x4a6574[_0xf315('0x8c')](),_0x598651);})[_0xf315('0x2a')](function(_0x2c43f3){_0x370382['where'](_0xf315('0xa5'),_['map'](_0x2c43f3,'id'));return db['sequelize']['query'](_0x370382[_0xf315('0x8c')](),_0x598651)[_0xf315('0x2a')](function(_0x286345){var _0x4ad2fb=_[_0xf315('0xa6')](_0x286345,_0xf315('0xa7'));var _0x4cae73=[];_0x2c43f3['forEach'](function(_0x293da6){_0x4cae73['push'](updateFaxInteraction(_0x293da6,_0x4d8e86,_0x4ad2fb));});return BPromise['all'](_0x4cae73);});});})[_0xf315('0x2a')](function(_0x2c7550){_0x4d1e17['rows']=_0x2c7550;return _0x4d1e17;})[_0xf315('0x2a')](respondWithFilteredResult(_0x357915,_0x172968));})[_0xf315('0xa8')](handleError(_0x357915,null));};exports[_0xf315('0xa9')]=function(_0x25d927,_0x31a1c0){var _0x2f512e={'raw':![],'where':{'id':_0x25d927[_0xf315('0xaa')]['id']}},_0x1afbff={};_0x1afbff[_0xf315('0x2e')]=_[_0xf315('0x30')](db[_0xf315('0x90')][_0xf315('0x2c')]);_0x1afbff[_0xf315('0x2f')]=_[_0xf315('0x30')](_0x25d927[_0xf315('0x2f')]);_0x1afbff['filters']=_['intersection'](_0x1afbff[_0xf315('0x2e')],_0x1afbff['query']);_0x2f512e[_0xf315('0x32')]=_[_0xf315('0x31')](_0x1afbff[_0xf315('0x2e')],qs[_0xf315('0x33')](_0x25d927[_0xf315('0x2f')][_0xf315('0x33')]));_0x2f512e[_0xf315('0x32')]=_0x2f512e[_0xf315('0x32')][_0xf315('0x51')]?_0x2f512e[_0xf315('0x32')]:_0x1afbff[_0xf315('0x2e')];if(_0x25d927[_0xf315('0x2f')]['includeAll']){_0x2f512e[_0xf315('0xab')]=[{'all':!![]}];}_0x2f512e=_['merge']({},_0x2f512e,_0x25d927[_0xf315('0xac')]);return db[_0xf315('0x90')][_0xf315('0x5c')](_0x2f512e)[_0xf315('0x2a')](handleEntityNotFound(_0x31a1c0,null))[_0xf315('0x2a')](respondWithResult(_0x31a1c0,null))[_0xf315('0xa8')](handleError(_0x31a1c0,null));};exports['create']=function(_0x27544a,_0x4afe86){return db['FaxInteraction'][_0xf315('0xad')](_0x27544a[_0xf315('0xae')],{})[_0xf315('0x2a')](respondWithResult(_0x4afe86,0xc9))[_0xf315('0xa8')](handleError(_0x4afe86,null));};exports[_0xf315('0xaf')]=function(_0x346851,_0x2ec3b5){if(_0x346851[_0xf315('0xae')]['id']){delete _0x346851['body']['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x346851[_0xf315('0xaa')]['id']}})['then'](handleEntityNotFound(_0x2ec3b5,null))[_0xf315('0x2a')](saveUpdates(_0x346851[_0xf315('0xae')],null))[_0xf315('0x2a')](respondWithResult(_0x2ec3b5,null))[_0xf315('0xa8')](handleError(_0x2ec3b5,null));};exports[_0xf315('0x1f')]=function(_0x4158b0,_0x1bd8dd){return db[_0xf315('0x90')][_0xf315('0x5c')]({'where':{'id':_0x4158b0[_0xf315('0xaa')]['id']}})[_0xf315('0x2a')](handleEntityNotFound(_0x1bd8dd,null))[_0xf315('0x2a')](removeEntity(_0x1bd8dd,null))[_0xf315('0xa8')](handleError(_0x1bd8dd,null));};exports[_0xf315('0xb0')]=function(_0x30c6c9,_0x20b92f){return db[_0xf315('0x90')][_0xf315('0xb0')]()[_0xf315('0x2a')](respondWithResult(_0x20b92f,null))['catch'](handleError(_0x20b92f,null));};exports['addMessage']=function(_0x45abdf,_0x3877e0,_0x3b146a){return db[_0xf315('0xb1')][_0xf315('0x5c')]({'where':{'id':_0x45abdf['params']['id']}})['then'](handleEntityNotFound(_0x3877e0,null))[_0xf315('0x2a')](function(_0x182241){if(_0x182241){return _0x182241['addMessage'](_0x45abdf['body']['ids'],_[_0xf315('0xb2')](_0x45abdf[_0xf315('0xae')],[_0xf315('0xb3'),'id'])||{});}})[_0xf315('0x2a')](respondWithResult(_0x3877e0,null))[_0xf315('0xa8')](handleError(_0x3877e0,null));};exports[_0xf315('0xb4')]=function(_0x2b6127,_0x466451,_0x463f2d){var _0x20440b={'raw':![],'where':{}};var _0x136d78={};var _0x10a906={'count':0x0,'rows':[]};return db[_0xf315('0x90')][_0xf315('0xb5')]({'where':{'id':_0x2b6127[_0xf315('0xaa')]['id']}})[_0xf315('0x2a')](handleEntityNotFound(_0x466451,null))[_0xf315('0x2a')](function(_0x573779){if(_0x573779){_0x136d78[_0xf315('0x2e')]=_[_0xf315('0x30')](db[_0xf315('0xb1')][_0xf315('0x2c')]);_0x136d78[_0xf315('0x2f')]=_[_0xf315('0x30')](_0x2b6127[_0xf315('0x2f')]);_0x136d78[_0xf315('0x39')]=_[_0xf315('0x31')](_0x136d78['model'],_0x136d78['query']);_0x20440b['attributes']=_['intersection'](_0x136d78['model'],qs[_0xf315('0x33')](_0x2b6127['query'][_0xf315('0x33')]));_0x20440b[_0xf315('0x32')]=_0x20440b[_0xf315('0x32')][_0xf315('0x51')]?_0x20440b['attributes']:_0x136d78['model'];if(!_0x2b6127[_0xf315('0x2f')][_0xf315('0x34')](_0xf315('0x35'))){_0x20440b[_0xf315('0x19')]=qs['limit'](_0x2b6127['query'][_0xf315('0x19')]);_0x20440b[_0xf315('0x18')]=qs[_0xf315('0x18')](_0x2b6127[_0xf315('0x2f')]['offset']);}_0x20440b['order']=qs[_0xf315('0x37')](_0x2b6127[_0xf315('0x2f')][_0xf315('0x37')]);_0x20440b[_0xf315('0x38')]=qs['filters'](_['pick'](_0x2b6127[_0xf315('0x2f')],_0x136d78['filters']));_0x20440b[_0xf315('0x38')][_0xf315('0xa7')]=_0x573779['id'];if(_0x2b6127['query'][_0xf315('0x78')]){_0x20440b[_0xf315('0x38')]=_[_0xf315('0x8f')](_0x20440b[_0xf315('0x38')],{'$or':_[_0xf315('0x24')](_0x20440b[_0xf315('0x32')],function(_0x325aaf){var _0x46d90f={};_0x46d90f[_0x325aaf]={'$like':'%'+_0x2b6127[_0xf315('0x2f')][_0xf315('0x78')]+'%'};return _0x46d90f;})});}if(_0x2b6127[_0xf315('0x2f')]['$gte']){var _0x479e66=_0x2b6127[_0xf315('0x2f')][_0xf315('0x6e')][_0xf315('0x28')](',');var _0x1df26a={};_0x1df26a[_0x479e66[0x0]]={'$gte':moment(_0x479e66[0x1])[_0xf315('0xb6')](_0xf315('0xb7'))};_0x20440b[_0xf315('0x38')]=_[_0xf315('0x8f')](_0x20440b[_0xf315('0x38')],_0x1df26a);}_0x20440b=_[_0xf315('0x8f')]({},_0x20440b,_0x2b6127[_0xf315('0xac')]);return db[_0xf315('0xb1')][_0xf315('0x8d')]({'where':_0x20440b[_0xf315('0x38')]})[_0xf315('0x2a')](function(_0x1f65d2){_0x10a906[_0xf315('0x8d')]=_0x1f65d2;if(_0x2b6127[_0xf315('0x2f')]['includeAll']){_0x20440b[_0xf315('0xab')]=[{'all':!![]}];}return db[_0xf315('0xb1')][_0xf315('0xb8')](_0x20440b);})[_0xf315('0x2a')](function(_0x2db115){_0x10a906[_0xf315('0xb9')]=_0x2db115;return _0x10a906;});}})[_0xf315('0x2a')](respondWithFilteredResult(_0x466451,_0x20440b))['catch'](handleError(_0x466451,null));};exports[_0xf315('0xba')]=function(_0x113761,_0x1008de,_0x34e6f8){return db[_0xf315('0x90')][_0xf315('0x5c')]({'where':{'id':_0x113761['params']['id']}})[_0xf315('0x2a')](handleEntityNotFound(_0x1008de,null))['then'](function(_0x3b4482){if(_0x3b4482){return _0x3b4482[_0xf315('0xbb')](_0x113761[_0xf315('0xae')][_0xf315('0xb3')],_['omit'](_0x113761[_0xf315('0xae')],[_0xf315('0xb3'),'id'])||{})['spread'](function(){return db[_0xf315('0x60')][_0xf315('0xb8')]({'attributes':['id',_0xf315('0x22'),_0xf315('0xbc')],'where':{'id':_0x113761[_0xf315('0xae')][_0xf315('0xb3')]}});})[_0xf315('0x2a')](function(_0x1a669b){socket[_0xf315('0xbd')](_0xf315('0xbe'),{'id':Number(_0x113761['params']['id']),'tags':_0x1a669b||[]});return{'id':Number(_0x113761[_0xf315('0xaa')]['id']),'tags':_0x1a669b||[]};});}})['then'](respondWithResult(_0x1008de,null))[_0xf315('0xa8')](handleError(_0x1008de,null));};exports[_0xf315('0xbf')]=function(_0x32cc8e,_0x2cd0d0,_0x44f1ed){return db[_0xf315('0x90')][_0xf315('0x5c')]({'where':{'id':_0x32cc8e[_0xf315('0xaa')]['id']}})[_0xf315('0x2a')](handleEntityNotFound(_0x2cd0d0,null))[_0xf315('0x2a')](function(_0x44894c){if(_0x44894c){return _0x44894c[_0xf315('0xbf')](_0x32cc8e[_0xf315('0x2f')][_0xf315('0xb3')]);}})[_0xf315('0x2a')](respondWithStatusCode(_0x2cd0d0,null))[_0xf315('0xa8')](handleError(_0x2cd0d0,null));};exports[_0xf315('0xc0')]=function(_0x55ccb8,_0x299b6d){var _0x243590=moment()[_0xf315('0xc1')]()[_0xf315('0x8c')]();var _0x3b2b62=path[_0xf315('0xc2')](config[_0xf315('0xc3')],_0xf315('0xc4'),_0xf315('0xc5'),_0xf315('0xc6'));var _0x4dd91e=path[_0xf315('0xc2')](config[_0xf315('0xc3')],_0xf315('0xc4'),'files','attachments');var _0x5a646=path[_0xf315('0xc2')](_0x3b2b62,_0x243590);var _0x5c0318=util[_0xf315('0xb6')]('transcript-%d-%s.zip',_0x55ccb8['params']['id'],_0x243590);var _0x4d2a1f=path['join'](_0x3b2b62,_0x5c0318);var _0x5b234f=[];_0x5b234f[_0xf315('0xc7')]({'model':db[_0xf315('0xc8')],'as':_0xf315('0xc8'),'raw':!![]});var _0x45b170=[{'model':db[_0xf315('0xb1')],'as':'Messages','attributes':['id',_0xf315('0xae'),_0xf315('0x6d')],'include':_0x5b234f}];return db[_0xf315('0x90')]['find']({'where':{'id':_0x55ccb8['params']['id']},'include':_0x45b170})[_0xf315('0x2a')](handleEntityNotFound(_0x299b6d,null))['then'](function(_0x385db3){if(_0x385db3&&_0x385db3[_0xf315('0xc9')]){var _0x372d82=_0x385db3[_0xf315('0xca')]({'plain':!![]});fs[_0xf315('0xcb')](_0x5a646);for(var _0x4935b3=0x0;_0x4935b3<_0x372d82[_0xf315('0xc9')][_0xf315('0x51')];_0x4935b3++){var _0x14eb92=_0x372d82[_0xf315('0xc9')][_0x4935b3][_0xf315('0xc8')];if(_0x14eb92){var _0x4c5dd5=path[_0xf315('0xc2')](_0x4dd91e,_0x14eb92[_0xf315('0xcc')]);if(fs[_0xf315('0xcd')](_0x4c5dd5)){fs['createReadStream'](_0x4c5dd5)[_0xf315('0xce')](fs[_0xf315('0xcf')](path[_0xf315('0xc2')](_0x5a646,_0x14eb92['basename'])));}}}return BPromise[_0xf315('0x86')]()[_0xf315('0x2a')](function(){return new BPromise(function(_0x53623d,_0x89385c){zipdir(_0x5a646,{'saveTo':_0x4d2a1f},function(_0x4f7c0d,_0x54cca8){if(_0x4f7c0d)return _0x89385c(_0x4f7c0d);return _0x53623d(_0x54cca8);});})[_0xf315('0x2a')](function(){return new BPromise(function(_0x5e20f5,_0x1ab930){rimraf(_0x5a646,function(_0x367068){if(_0x367068)_0x1ab930(_0x367068);return _0x5e20f5();});});})[_0xf315('0x2a')](function(){return _0x299b6d[_0xf315('0xc0')](_0x4d2a1f,_0x5c0318,function(_0x1f688b){if(_0x1f688b){console[_0xf315('0xd0')](_0xf315('0xd1'),_0x1f688b);}else{fs[_0xf315('0xd2')](_0x4d2a1f);}});});});}else{return _0x299b6d['sendStatus'](0xc8);}})[_0xf315('0xa8')](handleError(_0x299b6d,null));};
\ No newline at end of file
index 36839a7..6b3a58d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty'];(function(_0x98cceb,_0x1d7a9d){var _0x51a7ec=function(_0xb00029){while(--_0xb00029){_0x98cceb['push'](_0x98cceb['shift']());}};_0x51a7ec(++_0x1d7a9d);}(_0x1261,0x144));var _0x1126=function(_0xc20f22,_0x49698f){_0xc20f22=_0xc20f22-0x0;var _0x1535d5=_0x1261[_0xc20f22];return _0x1535d5;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x1126('0x0'))['db'][_0x1126('0x1')];var FaxMessage=require(_0x1126('0x0'))['db'][_0x1126('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1126('0x3')](0x0);var events={'afterCreate':_0x1126('0x4'),'afterUpdate':_0x1126('0x5'),'afterDestroy':_0x1126('0x6')};function emitEvent(_0x21a480){return function(_0x75a851,_0x5a2189,_0x5c68c8){_0x75a851[_0x1126('0x7')]({'attributes':['id'],'raw':!![]})[_0x1126('0x8')](function(_0x4f239c){_0x75a851[_0x1126('0x9')](_0x1126('0xa'),_0x4f239c[_0x1126('0xb')](function(_0x3abb0b){return{'id':_0x3abb0b['id']};}));return FaxMessage[_0x1126('0xc')]({'where':{'FaxInteractionId':_0x75a851['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3f09ac){_0x75a851[_0x1126('0x9')](_0x1126('0xd'),_0x3f09ac['length']);FaxInteractionEvents[_0x1126('0xe')](_0x21a480+':'+_0x75a851['id'],_0x75a851);FaxInteractionEvents['emit'](_0x21a480,_0x75a851);_0x5c68c8(null);})['catch'](_0x5c68c8(null));};}for(var e in events){if(events[_0x1126('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x1126('0x10')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x1261=['exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty'];(function(_0x3086f8,_0x3f1487){var _0x22df49=function(_0x275a71){while(--_0x275a71){_0x3086f8['push'](_0x3086f8['shift']());}};_0x22df49(++_0x3f1487);}(_0x1261,0x144));var _0x1126=function(_0x37862a,_0x2bc98e){_0x37862a=_0x37862a-0x0;var _0x5b0104=_0x1261[_0x37862a];return _0x5b0104;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x1126('0x0'))['db'][_0x1126('0x1')];var FaxMessage=require(_0x1126('0x0'))['db'][_0x1126('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1126('0x3')](0x0);var events={'afterCreate':_0x1126('0x4'),'afterUpdate':_0x1126('0x5'),'afterDestroy':_0x1126('0x6')};function emitEvent(_0x21a480){return function(_0x75a851,_0x5a2189,_0x5c68c8){_0x75a851[_0x1126('0x7')]({'attributes':['id'],'raw':!![]})[_0x1126('0x8')](function(_0x4f239c){_0x75a851[_0x1126('0x9')](_0x1126('0xa'),_0x4f239c[_0x1126('0xb')](function(_0x3abb0b){return{'id':_0x3abb0b['id']};}));return FaxMessage[_0x1126('0xc')]({'where':{'FaxInteractionId':_0x75a851['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3f09ac){_0x75a851[_0x1126('0x9')](_0x1126('0xd'),_0x3f09ac['length']);FaxInteractionEvents[_0x1126('0xe')](_0x21a480+':'+_0x75a851['id'],_0x75a851);FaxInteractionEvents['emit'](_0x21a480,_0x75a851);_0x5c68c8(null);})['catch'](_0x5c68c8(null));};}for(var e in events){if(events[_0x1126('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x1126('0x10')]=FaxInteractionEvents;
\ No newline at end of file
index a732bd6..0e8213f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt'];(function(_0x2461b7,_0xc02dd3){var _0x23b464=function(_0x46b695){while(--_0x46b695){_0x2461b7['push'](_0x2461b7['shift']());}};_0x23b464(++_0xc02dd3);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4eded9,_0x7fd677){_0x4eded9=_0x4eded9-0x0;var _0x4e9d1f=_0x9bde[_0x4eded9];return _0x4e9d1f;};'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':!![],'hooks':{'beforeUpdate':function(_0x2d5c75,_0x3ef9e3,_0x29bc2b){if(_0x2d5c75[_0xe9bd('0xc')](_0xe9bd('0xd'))){_0x2d5c75[_0xe9bd('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x29bc2b(null,_0x2d5c75);}}});};
\ No newline at end of file
+var _0xf109=['../../config/logger','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x5f58cf,_0x57cdf5){var _0x404e9f=function(_0x5af703){while(--_0x5af703){_0x5f58cf['push'](_0x5f58cf['shift']());}};_0x404e9f(++_0x57cdf5);}(_0xf109,0xce));var _0x9f10=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf109[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5c8719,_0x42a8cd,_0x3019eb){if(_0x5c8719[_0x9f10('0xc')](_0x9f10('0xd'))){_0x5c8719[_0x9f10('0xe')]=moment()['format'](_0x9f10('0xf'));}_0x3019eb(null,_0x5c8719);}}});};
\ No newline at end of file
index bae57c9..780c61e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b63=['socket.io-emitter','./faxInteraction.socket','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','stringify','find','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x2f2cd0,_0x50b51c){var _0x2cf068=function(_0x460659){while(--_0x460659){_0x2f2cd0['push'](_0x2f2cd0['shift']());}};_0x2cf068(++_0x50b51c);}(_0x8b63,0x1b3));var _0x38b6=function(_0x4f3410,_0x544be2){_0x4f3410=_0x4f3410-0x0;var _0x58031c=_0x8b63[_0x4f3410];return _0x58031c;};'use strict';var _=require(_0x38b6('0x0'));var util=require(_0x38b6('0x1'));var moment=require(_0x38b6('0x2'));var BPromise=require(_0x38b6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x38b6('0x4'));var db=require(_0x38b6('0x5'))['db'];var utils=require(_0x38b6('0x6'));var logger=require(_0x38b6('0x7'))(_0x38b6('0x8'));var config=require(_0x38b6('0x9'));var jayson=require(_0x38b6('0xa'));var client=jayson[_0x38b6('0xb')][_0x38b6('0xc')]({'port':0x232a});config[_0x38b6('0xd')]=_[_0x38b6('0xe')](config[_0x38b6('0xd')],{'host':_0x38b6('0xf'),'port':0x18eb});var socket=require(_0x38b6('0x10'))(new Redis(config[_0x38b6('0xd')]));require(_0x38b6('0x11'))['register'](socket);function respondWithRpcPromise(_0x53c54c,_0x337ca5,_0xd52e01){return new BPromise(function(_0x512150,_0x30ebd7){return client['request'](_0x53c54c,_0xd52e01)[_0x38b6('0x12')](function(_0xcf07){logger[_0x38b6('0x13')](_0x38b6('0x14'),_0x337ca5,_0x38b6('0x15'));logger[_0x38b6('0x16')](_0x38b6('0x17'),_0x337ca5,_0x38b6('0x15'),JSON['stringify'](_0xcf07));if(_0xcf07[_0x38b6('0x18')]){if(_0xcf07[_0x38b6('0x18')][_0x38b6('0x19')]===0x1f4){logger[_0x38b6('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x337ca5,_0xcf07[_0x38b6('0x18')][_0x38b6('0x1a')]);return _0x30ebd7(_0xcf07[_0x38b6('0x18')][_0x38b6('0x1a')]);}logger['error'](_0x38b6('0x14'),_0x337ca5,_0xcf07[_0x38b6('0x18')][_0x38b6('0x1a')]);return _0x512150(_0xcf07[_0x38b6('0x18')][_0x38b6('0x1a')]);}else{logger[_0x38b6('0x13')](_0x38b6('0x14'),_0x337ca5,_0x38b6('0x15'));_0x512150(_0xcf07['result'][_0x38b6('0x1a')]);}})[_0x38b6('0x1b')](function(_0x2e7cad){logger[_0x38b6('0x18')](_0x38b6('0x14'),_0x337ca5,_0x2e7cad);_0x30ebd7(_0x2e7cad);});});}exports[_0x38b6('0x1c')]=function(_0x47a463){var _0x4880f1=this;return new Promise(function(_0xa52781,_0x23ed3b){return db[_0x38b6('0x1d')][_0x38b6('0x1e')](_0x47a463[_0x38b6('0x1f')],{'raw':_0x47a463[_0x38b6('0x20')]?_0x47a463[_0x38b6('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47a463[_0x38b6('0x20')]?_0x47a463[_0x38b6('0x20')][_0x38b6('0x21')]||null:null,'attributes':_0x47a463['options']?_0x47a463[_0x38b6('0x20')][_0x38b6('0x22')]||null:null,'limit':_0x47a463[_0x38b6('0x20')]?_0x47a463[_0x38b6('0x20')][_0x38b6('0x23')]||null:null})[_0x38b6('0x12')](function(_0x2f6b93){logger[_0x38b6('0x13')](_0x38b6('0x1c'),_0x47a463);logger[_0x38b6('0x16')](_0x38b6('0x1c'),_0x47a463,JSON[_0x38b6('0x24')](_0x2f6b93));_0xa52781(_0x2f6b93);})['catch'](function(_0x401705){logger[_0x38b6('0x18')]('UpdateFaxInteraction',_0x401705[_0x38b6('0x1a')],_0x47a463);_0x23ed3b(_0x4880f1[_0x38b6('0x18')](0x1f4,_0x401705[_0x38b6('0x1a')]));});});};exports['AddTagsToFaxInteraction']=function(_0x398b52){return new Promise(function(_0x4f1d83,_0x2b62bb){return db['FaxInteraction'][_0x38b6('0x25')]({'where':_0x398b52[_0x38b6('0x20')]?_0x398b52[_0x38b6('0x20')][_0x38b6('0x21')]||null:null})[_0x38b6('0x12')](function(_0x25242f){if(_0x25242f){return _0x25242f['addTags'](_0x398b52[_0x38b6('0x1f')][_0x38b6('0x26')],_[_0x38b6('0x27')](_0x398b52['body'],['ids','id'])||{});}})['spread'](function(_0x245221){logger[_0x38b6('0x13')](_0x38b6('0x28'),_0x398b52);logger[_0x38b6('0x16')]('AddTags',_0x398b52,JSON[_0x38b6('0x24')](_0x245221));_0x4f1d83(_0x245221);})[_0x38b6('0x1b')](function(_0x4ac1aa){logger[_0x38b6('0x18')](_0x38b6('0x28'),_0x4ac1aa[_0x38b6('0x1a')],_0x398b52);_0x2b62bb(_this[_0x38b6('0x18')](0x1f4,_0x4ac1aa[_0x38b6('0x1a')]));});});};
\ No newline at end of file
+var _0xee69=['where','attributes','limit','debug','AddTagsToFaxInteraction','find','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xee69,0x1cd));var _0x9ee6=function(_0x402367,_0x332482){_0x402367=_0x402367-0x0;var _0x51fa97=_0xee69[_0x402367];return _0x51fa97;};'use strict';var _=require('lodash');var util=require(_0x9ee6('0x0'));var moment=require(_0x9ee6('0x1'));var BPromise=require('bluebird');var rs=require(_0x9ee6('0x2'));var fs=require('fs');var Redis=require(_0x9ee6('0x3'));var db=require(_0x9ee6('0x4'))['db'];var utils=require(_0x9ee6('0x5'));var logger=require(_0x9ee6('0x6'))(_0x9ee6('0x7'));var config=require('../../config/environment');var jayson=require(_0x9ee6('0x8'));var client=jayson['client'][_0x9ee6('0x9')]({'port':0x232a});config[_0x9ee6('0xa')]=_[_0x9ee6('0xb')](config['redis'],{'host':_0x9ee6('0xc'),'port':0x18eb});var socket=require(_0x9ee6('0xd'))(new Redis(config[_0x9ee6('0xa')]));require('./faxInteraction.socket')[_0x9ee6('0xe')](socket);function respondWithRpcPromise(_0xc9fe94,_0xa57f1,_0xf0020a){return new BPromise(function(_0x11ed29,_0x5a39f2){return client[_0x9ee6('0xf')](_0xc9fe94,_0xf0020a)[_0x9ee6('0x10')](function(_0x1b489a){logger[_0x9ee6('0x11')](_0x9ee6('0x12'),_0xa57f1,_0x9ee6('0x13'));logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0xa57f1,_0x9ee6('0x13'),JSON[_0x9ee6('0x14')](_0x1b489a));if(_0x1b489a['error']){if(_0x1b489a[_0x9ee6('0x15')][_0x9ee6('0x16')]===0x1f4){logger[_0x9ee6('0x15')]('FaxInteraction,\x20%s,\x20%s',_0xa57f1,_0x1b489a['error'][_0x9ee6('0x17')]);return _0x5a39f2(_0x1b489a[_0x9ee6('0x15')]['message']);}logger[_0x9ee6('0x15')]('FaxInteraction,\x20%s,\x20%s',_0xa57f1,_0x1b489a[_0x9ee6('0x15')][_0x9ee6('0x17')]);return _0x11ed29(_0x1b489a[_0x9ee6('0x15')][_0x9ee6('0x17')]);}else{logger[_0x9ee6('0x11')](_0x9ee6('0x12'),_0xa57f1,_0x9ee6('0x13'));_0x11ed29(_0x1b489a['result'][_0x9ee6('0x17')]);}})[_0x9ee6('0x18')](function(_0x1860ec){logger[_0x9ee6('0x15')](_0x9ee6('0x12'),_0xa57f1,_0x1860ec);_0x5a39f2(_0x1860ec);});});}exports[_0x9ee6('0x19')]=function(_0x505cfe){var _0x3ca441=this;return new Promise(function(_0x2f0d5c,_0x5d1b23){return db[_0x9ee6('0x1a')][_0x9ee6('0x1b')](_0x505cfe[_0x9ee6('0x1c')],{'raw':_0x505cfe[_0x9ee6('0x1d')]?_0x505cfe[_0x9ee6('0x1d')][_0x9ee6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x505cfe[_0x9ee6('0x1d')]?_0x505cfe[_0x9ee6('0x1d')][_0x9ee6('0x1f')]||null:null,'attributes':_0x505cfe[_0x9ee6('0x1d')]?_0x505cfe[_0x9ee6('0x1d')][_0x9ee6('0x20')]||null:null,'limit':_0x505cfe[_0x9ee6('0x1d')]?_0x505cfe[_0x9ee6('0x1d')][_0x9ee6('0x21')]||null:null})[_0x9ee6('0x10')](function(_0x1368aa){logger[_0x9ee6('0x11')](_0x9ee6('0x19'),_0x505cfe);logger[_0x9ee6('0x22')]('UpdateFaxInteraction',_0x505cfe,JSON[_0x9ee6('0x14')](_0x1368aa));_0x2f0d5c(_0x1368aa);})[_0x9ee6('0x18')](function(_0x14929a){logger[_0x9ee6('0x15')]('UpdateFaxInteraction',_0x14929a['message'],_0x505cfe);_0x5d1b23(_0x3ca441[_0x9ee6('0x15')](0x1f4,_0x14929a[_0x9ee6('0x17')]));});});};exports[_0x9ee6('0x23')]=function(_0x193290){return new Promise(function(_0xf6da45,_0x1663aa){return db[_0x9ee6('0x1a')][_0x9ee6('0x24')]({'where':_0x193290['options']?_0x193290[_0x9ee6('0x1d')][_0x9ee6('0x1f')]||null:null})[_0x9ee6('0x10')](function(_0x1f5fd4){if(_0x1f5fd4){return _0x1f5fd4['addTags'](_0x193290[_0x9ee6('0x1c')][_0x9ee6('0x25')],_[_0x9ee6('0x26')](_0x193290['body'],[_0x9ee6('0x25'),'id'])||{});}})[_0x9ee6('0x27')](function(_0x3f7a72){logger[_0x9ee6('0x11')](_0x9ee6('0x28'),_0x193290);logger['debug'](_0x9ee6('0x28'),_0x193290,JSON[_0x9ee6('0x14')](_0x3f7a72));_0xf6da45(_0x3f7a72);})['catch'](function(_0x1c99c1){logger[_0x9ee6('0x15')](_0x9ee6('0x28'),_0x1c99c1['message'],_0x193290);_0x1663aa(_this[_0x9ee6('0x15')](0x1f4,_0x1c99c1['message']));});});};
\ No newline at end of file
index 54aa39d..50b746d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c3f=['length','faxInteraction:','./faxInteraction.events','save','remove','update','removeListener','register'];(function(_0x1080e8,_0x24e9e3){var _0x30071b=function(_0x4e86f9){while(--_0x4e86f9){_0x1080e8['push'](_0x1080e8['shift']());}};_0x30071b(++_0x24e9e3);}(_0x0c3f,0x17a));var _0xf0c3=function(_0x4c7145,_0x2df4f8){_0x4c7145=_0x4c7145-0x0;var _0x13fe00=_0x0c3f[_0x4c7145];return _0x13fe00;};'use strict';var FaxInteractionEvents=require(_0xf0c3('0x0'));var events=[_0xf0c3('0x1'),_0xf0c3('0x2'),_0xf0c3('0x3')];function createListener(_0x53338e,_0x3c10b1){return function(_0x1814ec){_0x3c10b1['emit'](_0x53338e,_0x1814ec);};}function removeListener(_0xab64c2,_0xefcb38){return function(){FaxInteractionEvents[_0xf0c3('0x4')](_0xab64c2,_0xefcb38);};}exports[_0xf0c3('0x5')]=function(_0x5d1d59){for(var _0x11f3e7=0x0,_0x29458f=events[_0xf0c3('0x6')];_0x11f3e7<_0x29458f;_0x11f3e7++){var _0x3636d8=events[_0x11f3e7];var _0x44d123=createListener(_0xf0c3('0x7')+_0x3636d8,_0x5d1d59);FaxInteractionEvents['on'](_0x3636d8,_0x44d123);}};
\ No newline at end of file
+var _0xe682=['emit','removeListener','register','faxInteraction:','remove','update'];(function(_0x2a1064,_0x5f2095){var _0x562487=function(_0x1a7656){while(--_0x1a7656){_0x2a1064['push'](_0x2a1064['shift']());}};_0x562487(++_0x5f2095);}(_0xe682,0x178));var _0x2e68=function(_0x4cd8e1,_0x3fb58a){_0x4cd8e1=_0x4cd8e1-0x0;var _0x5e7ec4=_0xe682[_0x4cd8e1];return _0x5e7ec4;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x2e68('0x0'),_0x2e68('0x1')];function createListener(_0x4b4ce6,_0x43f83a){return function(_0x27189a){_0x43f83a[_0x2e68('0x2')](_0x4b4ce6,_0x27189a);};}function removeListener(_0x283f01,_0x16cda8){return function(){FaxInteractionEvents[_0x2e68('0x3')](_0x283f01,_0x16cda8);};}exports[_0x2e68('0x4')]=function(_0x18743a){for(var _0x34a969=0x0,_0x24a342=events['length'];_0x34a969<_0x24a342;_0x34a969++){var _0x3175ad=events[_0x34a969];var _0x423714=createListener(_0x2e68('0x5')+_0x3175ad,_0x18743a);FaxInteractionEvents['on'](_0x3175ad,_0x423714);}};
\ No newline at end of file
index 1d4b5f2..ae2a146 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09f1=['describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0x2bd0dd,_0x167fb0){var _0x4637bb=function(_0x1bf601){while(--_0x1bf601){_0x2bd0dd['push'](_0x2bd0dd['shift']());}};_0x4637bb(++_0x167fb0);}(_0x09f1,0xbf));var _0x109f=function(_0x28bf05,_0x34631b){_0x28bf05=_0x28bf05-0x0;var _0x1cf312=_0x09f1[_0x28bf05];return _0x1cf312;};'use strict';var multer=require(_0x109f('0x0'));var util=require(_0x109f('0x1'));var path=require('path');var timeout=require(_0x109f('0x2'));var express=require(_0x109f('0x3'));var router=express[_0x109f('0x4')]();var auth=require(_0x109f('0x5'));var interaction=require(_0x109f('0x6'));var config=require(_0x109f('0x7'));var controller=require(_0x109f('0x8'));router[_0x109f('0x9')]('/',auth[_0x109f('0xa')](),controller[_0x109f('0xb')]);router['get'](_0x109f('0xc'),auth[_0x109f('0xa')](),controller[_0x109f('0xd')]);router[_0x109f('0x9')](_0x109f('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x109f('0xf'),auth[_0x109f('0xa')](),controller[_0x109f('0x10')]);router[_0x109f('0x9')](_0x109f('0x11'),auth[_0x109f('0xa')](),controller[_0x109f('0x12')]);router['post']('/',auth[_0x109f('0xa')](),controller['create']);router[_0x109f('0x13')]('/:id/messages',auth[_0x109f('0xa')](),controller[_0x109f('0x14')]);router['post'](_0x109f('0x15'),auth[_0x109f('0xa')](),interaction['tracked'](_0x109f('0x16'),_0x109f('0x17')),controller[_0x109f('0x18')]);router[_0x109f('0x19')](_0x109f('0xe'),auth['isAuthenticated'](),interaction[_0x109f('0x1a')](_0x109f('0x16'),_0x109f('0x1b')),controller[_0x109f('0x1c')]);router[_0x109f('0x1d')]('/:id',auth[_0x109f('0xa')](),interaction[_0x109f('0x1a')](_0x109f('0x16'),_0x109f('0x1e')),controller[_0x109f('0x1f')]);router[_0x109f('0x1d')]('/:id/tags',auth['isAuthenticated'](),controller[_0x109f('0x20')]);module[_0x109f('0x21')]=router;
\ No newline at end of file
+var _0xc3fe=['destroy','/:id/tags','removeTags','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','/describe','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','fax','faxinteraction:addtags','/:id','update','delete','faxinteraction:destroy'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xc3fe,0xff));var _0xec3f=function(_0x2b8464,_0x3d2cd7){_0x2b8464=_0x2b8464-0x0;var _0x12d4d8=_0xc3fe[_0x2b8464];return _0x12d4d8;};'use strict';var multer=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var path=require(_0xec3f('0x2'));var timeout=require('connect-timeout');var express=require(_0xec3f('0x3'));var router=express[_0xec3f('0x4')]();var auth=require(_0xec3f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xec3f('0x6'));var controller=require(_0xec3f('0x7'));router[_0xec3f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xec3f('0x8')](_0xec3f('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xec3f('0x8')]('/:id',auth[_0xec3f('0xa')](),controller[_0xec3f('0xb')]);router[_0xec3f('0x8')](_0xec3f('0xc'),auth['isAuthenticated'](),controller[_0xec3f('0xd')]);router[_0xec3f('0x8')](_0xec3f('0xe'),auth[_0xec3f('0xa')](),controller[_0xec3f('0xf')]);router[_0xec3f('0x10')]('/',auth['isAuthenticated'](),controller[_0xec3f('0x11')]);router[_0xec3f('0x10')](_0xec3f('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0xec3f('0x10')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xec3f('0x12')](_0xec3f('0x13'),_0xec3f('0x14')),controller['addTags']);router['put'](_0xec3f('0x15'),auth['isAuthenticated'](),interaction[_0xec3f('0x12')](_0xec3f('0x13'),'faxinteraction:update'),controller[_0xec3f('0x16')]);router[_0xec3f('0x17')](_0xec3f('0x15'),auth[_0xec3f('0xa')](),interaction['tracked'](_0xec3f('0x13'),_0xec3f('0x18')),controller[_0xec3f('0x19')]);router[_0xec3f('0x17')](_0xec3f('0x1a'),auth['isAuthenticated'](),controller[_0xec3f('0x1b')]);module['exports']=router;
\ No newline at end of file
index f85c88c..53b7b65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a74=['out','DATE','sequelize','exports','TEXT','medium','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a74,0xbf));var _0x44a7=function(_0x3784ac,_0x506ec6){_0x3784ac=_0x3784ac-0x0;var _0x331a51=_0x4a74[_0x3784ac];return _0x331a51;};'use strict';var Sequelize=require(_0x44a7('0x0'));module[_0x44a7('0x1')]={'body':{'type':Sequelize[_0x44a7('0x2')](_0x44a7('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x44a7('0x4')]('in',_0x44a7('0x5')),'defaultValue':_0x44a7('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x44a7('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x44a7('0x6')]}};
\ No newline at end of file
+var _0x95b1=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x191abd,_0x5a59a6){var _0x216fc9=function(_0x69fc9){while(--_0x69fc9){_0x191abd['push'](_0x191abd['shift']());}};_0x216fc9(++_0x5a59a6);}(_0x95b1,0x94));var _0x195b=function(_0x11a700,_0x43b8bf){_0x11a700=_0x11a700-0x0;var _0x30971a=_0x95b1[_0x11a700];return _0x30971a;};'use strict';var Sequelize=require(_0x195b('0x0'));module[_0x195b('0x1')]={'body':{'type':Sequelize[_0x195b('0x2')](_0x195b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x195b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x195b('0x5')]('in',_0x195b('0x6')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x195b('0x7')]}};
\ No newline at end of file
index ea11c98..a2308b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x481f=['body','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','find','CmContact','Contact','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','manual','channel','event','EventManager','acceptmessage','../../config/logger','fax-interactions','fax','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','SIP/%s','rejectmessage','create','ContactId','Attachment','findOne','AttachmentId','FaxAccountId','basename','download','join','root','server','attachments','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','map','FaxMessage','fieldName','type','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','catch','destroy','describe','accept'];(function(_0x504f7b,_0x1ac4e0){var _0x2b0904=function(_0x28e51d){while(--_0x28e51d){_0x504f7b['push'](_0x504f7b['shift']());}};_0x2b0904(++_0x1ac4e0);}(_0x481f,0x1bb));var _0xf481=function(_0x222ac1,_0x1da40b){_0x222ac1=_0x222ac1-0x0;var _0x5e22d1=_0x481f[_0x222ac1];return _0x5e22d1;};'use strict';var pdf=require(_0xf481('0x0'));var emlformat=require(_0xf481('0x1'));var rimraf=require(_0xf481('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf481('0x3'));var rp=require(_0xf481('0x4'));var moment=require(_0xf481('0x5'));var BPromise=require(_0xf481('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf481('0x7'));var sox=require(_0xf481('0x8'));var csv=require(_0xf481('0x9'));var ejs=require(_0xf481('0xa'));var fs=require('fs');var _=require(_0xf481('0xb'));var squel=require(_0xf481('0xc'));var crypto=require('crypto');var jsforce=require(_0xf481('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf481('0x9'));var querystring=require(_0xf481('0xe'));var Papa=require('papaparse');var Redis=require(_0xf481('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf481('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf481('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xf481('0x12'));var config=require('../../config/environment');var db=require(_0xf481('0x13'))['db'];config[_0xf481('0x14')]=_['defaults'](config['redis'],{'host':_0xf481('0x15'),'port':0x18eb});var socket=require(_0xf481('0x16'))(new Redis(config['redis']));require(_0xf481('0x17'))[_0xf481('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf481('0x19')][_0xf481('0x1a')]({'port':0x232c});var client9002=jayson[_0xf481('0x19')][_0xf481('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x271183,_0x4732e7,_0x1bad15){if(_0x1bad15){var _0x95df5c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x95df5c[_0xf481('0x1b')](_0x4732e7)){return _0x271183;}else{throw new db[(_0xf481('0x1c'))][(_0xf481('0x1d'))](_0xf481('0x1e'));}}else{return _0x271183;}}function respondWithRpcPromise(_0x346e4f,_0x42c305,_0x5f38bc,_0x53c5a1){return new BPromise(function(_0x4d8684,_0x3dbe51){var _0x38797f=_0x53c5a1||client;return _0x38797f[_0xf481('0x1f')](_0x346e4f,_0x5f38bc)[_0xf481('0x20')](function(_0x47dddc){logger[_0xf481('0x21')]('FaxMessage,\x20%s,\x20%s',_0x42c305,_0xf481('0x22'));logger[_0xf481('0x23')](_0xf481('0x24'),_0x42c305,_0xf481('0x22'),JSON[_0xf481('0x25')](_0x47dddc));if(_0x47dddc['error']){if(_0x47dddc[_0xf481('0x26')]['code']===0x1f4){logger[_0xf481('0x26')](_0xf481('0x27'),_0x42c305,_0x47dddc[_0xf481('0x26')][_0xf481('0x28')]);return _0x3dbe51(_0x47dddc[_0xf481('0x26')][_0xf481('0x28')]);}logger[_0xf481('0x26')](_0xf481('0x27'),_0x42c305,_0x47dddc[_0xf481('0x26')][_0xf481('0x28')]);return _0x4d8684(_0x47dddc[_0xf481('0x26')][_0xf481('0x28')]);}else{logger[_0xf481('0x21')](_0xf481('0x27'),_0x42c305,_0xf481('0x22'));_0x4d8684(_0x47dddc[_0xf481('0x29')][_0xf481('0x28')]);}})['catch'](function(_0x504111){logger[_0xf481('0x26')](_0xf481('0x27'),_0x42c305,_0x504111);_0x3dbe51(_0x504111);});});}function respondWithStatusCode(_0x4f285a,_0x27d0b6){_0x27d0b6=_0x27d0b6||0xcc;return function(_0x39bf47){if(_0x39bf47){return _0x4f285a[_0xf481('0x2a')](_0x27d0b6);}return _0x4f285a[_0xf481('0x2b')](_0x27d0b6)[_0xf481('0x2c')]();};}function respondWithResult(_0x3ed12b,_0x3294db){_0x3294db=_0x3294db||0xc8;return function(_0x5db895){if(_0x5db895){return _0x3ed12b[_0xf481('0x2b')](_0x3294db)['json'](_0x5db895);}};}function respondWithFilteredResult(_0x51a100,_0x323055){return function(_0xec71fd){if(_0xec71fd){var _0xc83b0c=_0xec71fd[_0xf481('0x2d')],_0x2dcac9=_0x323055[_0xf481('0x2e')],_0x3e1d47=_0x323055[_0xf481('0x2e')]+_0x323055[_0xf481('0x2f')],_0x4a5e31;if(_0x3e1d47>=_0xc83b0c){_0x3e1d47=_0xc83b0c;_0x4a5e31=0xc8;}else{_0x4a5e31=0xce;}_0x51a100[_0xf481('0x2b')](_0x4a5e31);return _0x51a100[_0xf481('0x30')](_0xf481('0x31'),_0x2dcac9+'-'+_0x3e1d47+'/'+_0xc83b0c)['json'](_0xec71fd);}return null;};}function patchUpdates(_0x1da733){return function(_0x6720b){try{jsonpatch[_0xf481('0x32')](_0x6720b,_0x1da733,!![]);}catch(_0x2fd044){return BPromise[_0xf481('0x33')](_0x2fd044);}return _0x6720b[_0xf481('0x34')]();};}function saveUpdates(_0x5c2254,_0x28a957){return function(_0x507a4e){if(_0x507a4e){return _0x507a4e[_0xf481('0x35')](_0x5c2254)[_0xf481('0x20')](function(_0x1bcaa1){return _0x1bcaa1;});}return null;};}function removeEntity(_0x289f6d,_0x3e672a){return function(_0x5637d1){if(_0x5637d1){return _0x5637d1['destroy']()[_0xf481('0x20')](function(){_0x289f6d[_0xf481('0x2b')](0xcc)[_0xf481('0x2c')]();});}};}function handleEntityNotFound(_0x5273eb,_0x34a798){return function(_0x5f3530){if(!_0x5f3530){_0x5273eb[_0xf481('0x2a')](0x194);}return _0x5f3530;};}function handleError(_0x4ef0fb,_0x2b8ddc){_0x2b8ddc=_0x2b8ddc||0x1f4;return function(_0x6b65e1){logger['error'](_0x6b65e1[_0xf481('0x36')]);if(_0x6b65e1['name']){delete _0x6b65e1[_0xf481('0x37')];}_0x4ef0fb[_0xf481('0x2b')](_0x2b8ddc)['send'](_0x6b65e1);};}exports['index']=function(_0x501e41,_0x3f0e1e){var _0x4ffcce={},_0x5a7a33={},_0x36f639={'count':0x0,'rows':[]};var _0x14485a=_[_0xf481('0x38')](db[_0xf481('0x39')]['rawAttributes'],function(_0x561bd8){return{'name':_0x561bd8[_0xf481('0x3a')],'type':_0x561bd8[_0xf481('0x3b')]['key']};});_0x5a7a33[_0xf481('0x3c')]=_[_0xf481('0x38')](_0x14485a,_0xf481('0x37'));_0x5a7a33['query']=_[_0xf481('0x3d')](_0x501e41['query']);_0x5a7a33[_0xf481('0x3e')]=_['intersection'](_0x5a7a33[_0xf481('0x3c')],_0x5a7a33[_0xf481('0x3f')]);_0x4ffcce[_0xf481('0x40')]=_[_0xf481('0x41')](_0x5a7a33[_0xf481('0x3c')],qs[_0xf481('0x42')](_0x501e41[_0xf481('0x3f')][_0xf481('0x42')]));_0x4ffcce['attributes']=_0x4ffcce[_0xf481('0x40')]['length']?_0x4ffcce[_0xf481('0x40')]:_0x5a7a33[_0xf481('0x3c')];if(!_0x501e41[_0xf481('0x3f')][_0xf481('0x43')]('nolimit')){_0x4ffcce[_0xf481('0x2f')]=qs[_0xf481('0x2f')](_0x501e41[_0xf481('0x3f')]['limit']);_0x4ffcce[_0xf481('0x2e')]=qs[_0xf481('0x2e')](_0x501e41['query']['offset']);}_0x4ffcce['order']=qs[_0xf481('0x44')](_0x501e41[_0xf481('0x3f')]['sort']);_0x4ffcce['where']=qs[_0xf481('0x3e')](_[_0xf481('0x45')](_0x501e41['query'],_0x5a7a33['filters']),_0x14485a);if(_0x501e41[_0xf481('0x3f')][_0xf481('0x46')]){_0x4ffcce[_0xf481('0x47')]=_[_0xf481('0x48')](_0x4ffcce[_0xf481('0x47')],{'$or':_['map'](_0x14485a,function(_0x30d0e3){if(_0x30d0e3['type']!==_0xf481('0x49')){var _0x234124={};_0x234124[_0x30d0e3[_0xf481('0x37')]]={'$like':'%'+_0x501e41['query'][_0xf481('0x46')]+'%'};return _0x234124;}})});}_0x4ffcce=_[_0xf481('0x48')]({},_0x4ffcce,_0x501e41[_0xf481('0x4a')]);var _0x3d44d5={'where':_0x4ffcce[_0xf481('0x47')]};return db[_0xf481('0x39')][_0xf481('0x2d')](_0x3d44d5)[_0xf481('0x20')](function(_0x2239eb){_0x36f639[_0xf481('0x2d')]=_0x2239eb;if(_0x501e41[_0xf481('0x3f')][_0xf481('0x4b')]){_0x4ffcce[_0xf481('0x4c')]=[{'all':!![]}];}return db[_0xf481('0x39')][_0xf481('0x4d')](_0x4ffcce);})['then'](function(_0x183e7e){_0x36f639[_0xf481('0x4e')]=_0x183e7e;return _0x36f639;})[_0xf481('0x20')](respondWithFilteredResult(_0x3f0e1e,_0x4ffcce))['catch'](handleError(_0x3f0e1e,null));};exports['show']=function(_0x3407f3,_0x33a3e5){var _0x148db3={'raw':!![],'where':{'id':_0x3407f3[_0xf481('0x4f')]['id']}},_0x7a854={};_0x7a854['model']=_[_0xf481('0x3d')](db[_0xf481('0x39')]['rawAttributes']);_0x7a854['query']=_[_0xf481('0x3d')](_0x3407f3[_0xf481('0x3f')]);_0x7a854['filters']=_[_0xf481('0x41')](_0x7a854['model'],_0x7a854[_0xf481('0x3f')]);_0x148db3[_0xf481('0x40')]=_[_0xf481('0x41')](_0x7a854['model'],qs['fields'](_0x3407f3[_0xf481('0x3f')][_0xf481('0x42')]));_0x148db3['attributes']=_0x148db3[_0xf481('0x40')][_0xf481('0x50')]?_0x148db3[_0xf481('0x40')]:_0x7a854[_0xf481('0x3c')];if(_0x3407f3[_0xf481('0x3f')][_0xf481('0x4b')]){_0x148db3[_0xf481('0x4c')]=[{'all':!![]}];}_0x148db3=_[_0xf481('0x48')]({},_0x148db3,_0x3407f3[_0xf481('0x4a')]);return db[_0xf481('0x39')]['find'](_0x148db3)['then'](handleEntityNotFound(_0x33a3e5,null))[_0xf481('0x20')](respondWithResult(_0x33a3e5,null))['catch'](handleError(_0x33a3e5,null));};exports[_0xf481('0x35')]=function(_0x17c682,_0x5ca001){if(_0x17c682['body']['id']){delete _0x17c682['body']['id'];}return db[_0xf481('0x39')]['find']({'where':{'id':_0x17c682['params']['id']}})[_0xf481('0x20')](handleEntityNotFound(_0x5ca001,null))[_0xf481('0x20')](saveUpdates(_0x17c682['body'],null))[_0xf481('0x20')](respondWithResult(_0x5ca001,null))[_0xf481('0x51')](handleError(_0x5ca001,null));};exports[_0xf481('0x52')]=function(_0x17c1c5,_0x4fa890){return db[_0xf481('0x39')]['find']({'where':{'id':_0x17c1c5[_0xf481('0x4f')]['id']}})[_0xf481('0x20')](handleEntityNotFound(_0x4fa890,null))[_0xf481('0x20')](removeEntity(_0x4fa890,null))['catch'](handleError(_0x4fa890,null));};exports['describe']=function(_0x1b17cf,_0x113c45){return db[_0xf481('0x39')][_0xf481('0x53')]()['then'](respondWithResult(_0x113c45,null))[_0xf481('0x51')](handleError(_0x113c45,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xf481('0x54')]=function(_0x51b5b2,_0x1397cb,_0x1d26c5){var _0x45f291={'channel':'fax'};if(_0x51b5b2[_0xf481('0x55')]['id']){delete _0x51b5b2[_0xf481('0x55')]['id'];}_0x51b5b2[_0xf481('0x55')][_0xf481('0x56')]=!![];_0x51b5b2[_0xf481('0x55')][_0xf481('0x57')]=moment()[_0xf481('0x58')](_0xf481('0x59'));_0x51b5b2[_0xf481('0x55')]['UserId']=_0x51b5b2[_0xf481('0x55')][_0xf481('0x5a')]||_0x51b5b2[_0xf481('0x5b')]['id'];return db['FaxMessage'][_0xf481('0x5c')]({'where':{'id':_0x51b5b2[_0xf481('0x4f')]['id'],'UserId':null},'include':[{'model':db[_0xf481('0x5d')],'as':_0xf481('0x5e')}]})[_0xf481('0x20')](handleEntityNotFound(_0x1397cb,null))['then'](saveUpdates(_0x51b5b2['body'],null))[_0xf481('0x20')](function(_0x4a8212){if(_0x4a8212){_0x45f291['message']=_0x4a8212[_0xf481('0x5f')]({'plain':!![]});return db[_0xf481('0x60')][_0xf481('0x5c')]({'where':{'id':_0x4a8212[_0xf481('0x61')]}});}return null;})[_0xf481('0x20')](handleEntityNotFound(_0x1397cb,null))[_0xf481('0x20')](function(_0x3aa88c){if(_0x3aa88c){return _0x3aa88c[_0xf481('0x35')]({'UserId':_0x51b5b2[_0xf481('0x55')][_0xf481('0x5a')],'read1stAt':_[_0xf481('0x62')](_0x3aa88c[_0xf481('0x63')])?moment()['format'](_0xf481('0x59')):undefined});}return null;})['then'](function(_0x33d8e9){if(_0x33d8e9){_0x45f291['interaction']=_0x33d8e9['get']({'plain':!![]});interaction_log[_0xf481('0x21')](_0xf481('0x64'),_0x51b5b2[_0xf481('0x5b')]['id'],_0x51b5b2[_0xf481('0x5b')][_0xf481('0x37')],_0x51b5b2['user'][_0xf481('0x65')],_0x45f291[_0xf481('0x66')]['id'],_0x51b5b2[_0xf481('0x55')]?JSON[_0xf481('0x25')](_0x51b5b2[_0xf481('0x55')]):_0xf481('0x67'));return respondWithRpcPromise(_0xf481('0x68'),_0xf481('0x69'),_0x45f291);}return null;})[_0xf481('0x20')](function(_0x58d9d1){if(_0x58d9d1){if(_0x51b5b2[_0xf481('0x55')][_0xf481('0x6a')]){_0x45f291[_0xf481('0x28')]['interface']=util[_0xf481('0x58')]('SIP/%s',_0x51b5b2['user'][_0xf481('0x37')]);_0x45f291[_0xf481('0x28')][_0xf481('0x6b')]=_0x45f291[_0xf481('0x6b')];_0x45f291[_0xf481('0x28')][_0xf481('0x6c')]=_0xf481('0x54');return respondWithRpcPromise(_0xf481('0x6d'),_0xf481('0x6d'),{'event':_0xf481('0x6e'),'message':_0x45f291['message']},client9002)['then'](function(){return _0x45f291;});}return _0x45f291;}return null;})[_0xf481('0x20')](respondWithResult(_0x1397cb,null))[_0xf481('0x51')](handleError(_0x1397cb,null));};var interaction_log=require(_0xf481('0x6f'))(_0xf481('0x70'));exports[_0xf481('0x33')]=function(_0x45665e,_0x48b5d0,_0x2566af){var _0x257362={'agent':{},'channel':_0xf481('0x71')};if(_0x45665e[_0xf481('0x55')]['id']){delete _0x45665e[_0xf481('0x55')]['id'];}_0x45665e[_0xf481('0x55')][_0xf481('0x5a')]=_0x45665e[_0xf481('0x55')][_0xf481('0x5a')]||_0x45665e[_0xf481('0x5b')]['id'];_0x257362[_0xf481('0x72')]['id']=_0x45665e[_0xf481('0x55')][_0xf481('0x5a')];return db['FaxMessage'][_0xf481('0x5c')]({'where':{'id':_0x45665e['params']['id'],'UserId':null}})[_0xf481('0x20')](handleEntityNotFound(_0x48b5d0,null))['then'](function(_0x4759a1){if(_0x4759a1){_0x257362[_0xf481('0x28')]=_0x4759a1['get']({'plain':!![]});return db[_0xf481('0x60')][_0xf481('0x5c')]({'where':{'id':_0x4759a1[_0xf481('0x61')]}});}return null;})[_0xf481('0x20')](handleEntityNotFound(_0x48b5d0,null))['then'](function(_0xd14385){if(_0xd14385){_0x257362[_0xf481('0x66')]=_0xd14385['get']({'plain':!![]});interaction_log[_0xf481('0x21')](_0xf481('0x73'),_0x45665e[_0xf481('0x5b')]['id'],_0x45665e[_0xf481('0x5b')][_0xf481('0x37')],_0x45665e[_0xf481('0x5b')][_0xf481('0x65')],_0x257362[_0xf481('0x66')]['id'],_0x45665e[_0xf481('0x55')]?JSON['stringify'](_0x45665e[_0xf481('0x55')]):_0xf481('0x67'));return respondWithRpcPromise('RejectMessage',_0xf481('0x74'),_0x257362);}return null;})[_0xf481('0x20')](function(_0x3479b3){if(_0x3479b3){_0x3479b3[_0xf481('0x28')][_0xf481('0x75')]=util[_0xf481('0x58')](_0xf481('0x76'),_0x45665e[_0xf481('0x5b')][_0xf481('0x37')]);_0x3479b3[_0xf481('0x28')][_0xf481('0x6b')]=_0x257362[_0xf481('0x6b')];_0x3479b3[_0xf481('0x28')][_0xf481('0x6c')]=_0xf481('0x33');respondWithRpcPromise(_0xf481('0x6d'),_0xf481('0x6d'),{'event':_0xf481('0x77'),'message':_0x3479b3[_0xf481('0x28')]},client9002);return _0x257362;}return null;})['then'](respondWithResult(_0x48b5d0,null))[_0xf481('0x51')](handleError(_0x48b5d0,null));};exports[_0xf481('0x78')]=function(_0x221e4a,_0x509425){var _0x434d37;return db[_0xf481('0x39')][_0xf481('0x78')](_0x221e4a[_0xf481('0x55')],{})[_0xf481('0x20')](function(_0x5a399b){_0x434d37=_0x5a399b;return db[_0xf481('0x5d')]['findOne']({'where':{'id':_0x434d37[_0xf481('0x79')]}});})[_0xf481('0x20')](function(_0x3be57d){if(_[_0xf481('0x62')](_0x3be57d)){return;}else{_0x434d37['fax']=_0x3be57d[_0xf481('0x71')];return db[_0xf481('0x7a')][_0xf481('0x7b')]({'where':{'id':_0x434d37[_0xf481('0x7c')]}});}})[_0xf481('0x20')](function(_0x4f6eea){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0xf481('0x62')](_0x221e4a[_0xf481('0x55')])?undefined:_0x221e4a[_0xf481('0x55')][_0xf481('0x7d')],'path':_[_0xf481('0x62')](_0x4f6eea)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x4f6eea[_0xf481('0x7e')]),'fax':_[_0xf481('0x62')](_0x434d37[_0xf481('0x71')])?undefined:_0x434d37[_0xf481('0x71')],'AttachmentId':_0x434d37[_0xf481('0x7c')]},client9002);})[_0xf481('0x20')](respondWithResult(_0x509425,0xc9))[_0xf481('0x51')](handleError(_0x509425,null));};exports[_0xf481('0x7f')]=function(_0x31050a,_0xf7ca9e){var _0x3ec63e=path[_0xf481('0x80')](config[_0xf481('0x81')],_0xf481('0x82'),'files',_0xf481('0x83'));return db[_0xf481('0x39')][_0xf481('0x5c')]({'where':{'id':_0x31050a[_0xf481('0x4f')]['id']},'include':[{'model':db[_0xf481('0x7a')],'as':_0xf481('0x7a')}]})[_0xf481('0x20')](handleEntityNotFound(_0xf7ca9e,null))[_0xf481('0x20')](function(_0x125cdf){if(_0x125cdf){return _0xf7ca9e[_0xf481('0x7f')](path['join'](_0x3ec63e,_0x125cdf[_0xf481('0x7a')][_0xf481('0x7e')]));}})[_0xf481('0x51')](handleError(_0xf7ca9e,null));};
\ No newline at end of file
+var _0xdd23=['zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','FaxMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','FaxInteractionId','null','rejectMessage','create','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','html-pdf'];(function(_0x4e80a7,_0x11d1d3){var _0x1edb13=function(_0x45a30c){while(--_0x45a30c){_0x4e80a7['push'](_0x4e80a7['shift']());}};_0x1edb13(++_0x11d1d3);}(_0xdd23,0x109));var _0x3dd2=function(_0x9efd02,_0x48b78f){_0x9efd02=_0x9efd02-0x0;var _0x1526a1=_0xdd23[_0x9efd02];return _0x1526a1;};'use strict';var pdf=require(_0x3dd2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3dd2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3dd2('0x2'));var moment=require(_0x3dd2('0x3'));var BPromise=require(_0x3dd2('0x4'));var Mustache=require('mustache');var util=require(_0x3dd2('0x5'));var path=require(_0x3dd2('0x6'));var sox=require(_0x3dd2('0x7'));var csv=require(_0x3dd2('0x8'));var ejs=require(_0x3dd2('0x9'));var fs=require('fs');var _=require(_0x3dd2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3dd2('0xb'));var deskjs=require(_0x3dd2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3dd2('0xd'));var Redis=require(_0x3dd2('0xe'));var authService=require(_0x3dd2('0xf'));var qs=require(_0x3dd2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3dd2('0x11'));var logger=require(_0x3dd2('0x12'))(_0x3dd2('0x13'));var utils=require('../../config/utils');var config=require(_0x3dd2('0x14'));var db=require(_0x3dd2('0x15'))['db'];config[_0x3dd2('0x16')]=_[_0x3dd2('0x17')](config[_0x3dd2('0x16')],{'host':_0x3dd2('0x18'),'port':0x18eb});var socket=require(_0x3dd2('0x19'))(new Redis(config[_0x3dd2('0x16')]));require(_0x3dd2('0x1a'))['register'](socket);var jayson=require(_0x3dd2('0x1b'));var client=jayson[_0x3dd2('0x1c')][_0x3dd2('0x1d')]({'port':0x232c});var client9002=jayson[_0x3dd2('0x1c')][_0x3dd2('0x1d')]({'port':0x232a});function checkPasswordPattern(_0xe46a6e,_0x1ecceb,_0x375d21){if(_0x375d21){var _0x4322ab=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4322ab['test'](_0x1ecceb)){return _0xe46a6e;}else{throw new db[(_0x3dd2('0x1e'))]['ValidationError'](_0x3dd2('0x1f'));}}else{return _0xe46a6e;}}function respondWithRpcPromise(_0x117a89,_0x454093,_0x21f880,_0xbf7f8c){return new BPromise(function(_0x571c00,_0x3ad4d7){var _0x35af3a=_0xbf7f8c||client;return _0x35af3a['request'](_0x117a89,_0x21f880)['then'](function(_0xe51082){logger[_0x3dd2('0x20')](_0x3dd2('0x21'),_0x454093,_0x3dd2('0x22'));logger[_0x3dd2('0x23')](_0x3dd2('0x24'),_0x454093,_0x3dd2('0x22'),JSON[_0x3dd2('0x25')](_0xe51082));if(_0xe51082[_0x3dd2('0x26')]){if(_0xe51082['error'][_0x3dd2('0x27')]===0x1f4){logger[_0x3dd2('0x26')](_0x3dd2('0x21'),_0x454093,_0xe51082[_0x3dd2('0x26')][_0x3dd2('0x28')]);return _0x3ad4d7(_0xe51082[_0x3dd2('0x26')][_0x3dd2('0x28')]);}logger['error'](_0x3dd2('0x21'),_0x454093,_0xe51082['error'][_0x3dd2('0x28')]);return _0x571c00(_0xe51082[_0x3dd2('0x26')][_0x3dd2('0x28')]);}else{logger[_0x3dd2('0x20')](_0x3dd2('0x21'),_0x454093,_0x3dd2('0x22'));_0x571c00(_0xe51082[_0x3dd2('0x29')][_0x3dd2('0x28')]);}})[_0x3dd2('0x2a')](function(_0xa43216){logger[_0x3dd2('0x26')](_0x3dd2('0x21'),_0x454093,_0xa43216);_0x3ad4d7(_0xa43216);});});}function respondWithStatusCode(_0x245e26,_0x570e3d){_0x570e3d=_0x570e3d||0xcc;return function(_0x40b56f){if(_0x40b56f){return _0x245e26[_0x3dd2('0x2b')](_0x570e3d);}return _0x245e26['status'](_0x570e3d)[_0x3dd2('0x2c')]();};}function respondWithResult(_0x4084d2,_0x5d7a35){_0x5d7a35=_0x5d7a35||0xc8;return function(_0x2bb38a){if(_0x2bb38a){return _0x4084d2[_0x3dd2('0x2d')](_0x5d7a35)[_0x3dd2('0x2e')](_0x2bb38a);}};}function respondWithFilteredResult(_0x2a2e00,_0x4c9cc5){return function(_0xd28558){if(_0xd28558){var _0x3286b2=_0xd28558[_0x3dd2('0x2f')],_0x2a4045=_0x4c9cc5[_0x3dd2('0x30')],_0x11f495=_0x4c9cc5['offset']+_0x4c9cc5[_0x3dd2('0x31')],_0x4dedee;if(_0x11f495>=_0x3286b2){_0x11f495=_0x3286b2;_0x4dedee=0xc8;}else{_0x4dedee=0xce;}_0x2a2e00['status'](_0x4dedee);return _0x2a2e00[_0x3dd2('0x32')](_0x3dd2('0x33'),_0x2a4045+'-'+_0x11f495+'/'+_0x3286b2)[_0x3dd2('0x2e')](_0xd28558);}return null;};}function patchUpdates(_0x3f00e2){return function(_0x49d798){try{jsonpatch[_0x3dd2('0x34')](_0x49d798,_0x3f00e2,!![]);}catch(_0x357232){return BPromise[_0x3dd2('0x35')](_0x357232);}return _0x49d798['save']();};}function saveUpdates(_0x425187,_0x442c06){return function(_0x1f5a0e){if(_0x1f5a0e){return _0x1f5a0e[_0x3dd2('0x36')](_0x425187)[_0x3dd2('0x37')](function(_0x26bfce){return _0x26bfce;});}return null;};}function removeEntity(_0x44e3a1,_0x1b4372){return function(_0x264382){if(_0x264382){return _0x264382[_0x3dd2('0x38')]()[_0x3dd2('0x37')](function(){_0x44e3a1['status'](0xcc)[_0x3dd2('0x2c')]();});}};}function handleEntityNotFound(_0xa99e72,_0x2571c8){return function(_0x2879df){if(!_0x2879df){_0xa99e72[_0x3dd2('0x2b')](0x194);}return _0x2879df;};}function handleError(_0x516588,_0x58a557){_0x58a557=_0x58a557||0x1f4;return function(_0x4cab97){logger['error'](_0x4cab97[_0x3dd2('0x39')]);if(_0x4cab97['name']){delete _0x4cab97[_0x3dd2('0x3a')];}_0x516588['status'](_0x58a557)['send'](_0x4cab97);};}exports[_0x3dd2('0x3b')]=function(_0x3e3c96,_0x46ede5){var _0x2eca53={},_0x2564c9={},_0x2c6ba1={'count':0x0,'rows':[]};var _0x307597=_[_0x3dd2('0x3c')](db[_0x3dd2('0x3d')][_0x3dd2('0x3e')],function(_0x144289){return{'name':_0x144289['fieldName'],'type':_0x144289[_0x3dd2('0x3f')][_0x3dd2('0x40')]};});_0x2564c9[_0x3dd2('0x41')]=_[_0x3dd2('0x3c')](_0x307597,_0x3dd2('0x3a'));_0x2564c9[_0x3dd2('0x42')]=_[_0x3dd2('0x43')](_0x3e3c96['query']);_0x2564c9[_0x3dd2('0x44')]=_[_0x3dd2('0x45')](_0x2564c9[_0x3dd2('0x41')],_0x2564c9[_0x3dd2('0x42')]);_0x2eca53['attributes']=_[_0x3dd2('0x45')](_0x2564c9[_0x3dd2('0x41')],qs[_0x3dd2('0x46')](_0x3e3c96[_0x3dd2('0x42')][_0x3dd2('0x46')]));_0x2eca53[_0x3dd2('0x47')]=_0x2eca53[_0x3dd2('0x47')][_0x3dd2('0x48')]?_0x2eca53[_0x3dd2('0x47')]:_0x2564c9[_0x3dd2('0x41')];if(!_0x3e3c96[_0x3dd2('0x42')][_0x3dd2('0x49')](_0x3dd2('0x4a'))){_0x2eca53[_0x3dd2('0x31')]=qs[_0x3dd2('0x31')](_0x3e3c96['query'][_0x3dd2('0x31')]);_0x2eca53[_0x3dd2('0x30')]=qs[_0x3dd2('0x30')](_0x3e3c96[_0x3dd2('0x42')]['offset']);}_0x2eca53['order']=qs[_0x3dd2('0x4b')](_0x3e3c96[_0x3dd2('0x42')][_0x3dd2('0x4b')]);_0x2eca53['where']=qs[_0x3dd2('0x44')](_[_0x3dd2('0x4c')](_0x3e3c96['query'],_0x2564c9['filters']),_0x307597);if(_0x3e3c96['query'][_0x3dd2('0x4d')]){_0x2eca53['where']=_['merge'](_0x2eca53[_0x3dd2('0x4e')],{'$or':_['map'](_0x307597,function(_0x7fe081){if(_0x7fe081[_0x3dd2('0x3f')]!==_0x3dd2('0x4f')){var _0x8d8861={};_0x8d8861[_0x7fe081[_0x3dd2('0x3a')]]={'$like':'%'+_0x3e3c96[_0x3dd2('0x42')][_0x3dd2('0x4d')]+'%'};return _0x8d8861;}})});}_0x2eca53=_[_0x3dd2('0x50')]({},_0x2eca53,_0x3e3c96[_0x3dd2('0x51')]);var _0x2702be={'where':_0x2eca53[_0x3dd2('0x4e')]};return db['FaxMessage']['count'](_0x2702be)['then'](function(_0x1d4a42){_0x2c6ba1[_0x3dd2('0x2f')]=_0x1d4a42;if(_0x3e3c96['query'][_0x3dd2('0x52')]){_0x2eca53[_0x3dd2('0x53')]=[{'all':!![]}];}return db[_0x3dd2('0x3d')][_0x3dd2('0x54')](_0x2eca53);})[_0x3dd2('0x37')](function(_0x438e57){_0x2c6ba1[_0x3dd2('0x55')]=_0x438e57;return _0x2c6ba1;})[_0x3dd2('0x37')](respondWithFilteredResult(_0x46ede5,_0x2eca53))['catch'](handleError(_0x46ede5,null));};exports[_0x3dd2('0x56')]=function(_0x1cf897,_0x491483){var _0x4aa57a={'raw':!![],'where':{'id':_0x1cf897[_0x3dd2('0x57')]['id']}},_0x2bd783={};_0x2bd783[_0x3dd2('0x41')]=_['keys'](db[_0x3dd2('0x3d')][_0x3dd2('0x3e')]);_0x2bd783[_0x3dd2('0x42')]=_[_0x3dd2('0x43')](_0x1cf897[_0x3dd2('0x42')]);_0x2bd783[_0x3dd2('0x44')]=_[_0x3dd2('0x45')](_0x2bd783[_0x3dd2('0x41')],_0x2bd783['query']);_0x4aa57a[_0x3dd2('0x47')]=_[_0x3dd2('0x45')](_0x2bd783['model'],qs['fields'](_0x1cf897[_0x3dd2('0x42')][_0x3dd2('0x46')]));_0x4aa57a[_0x3dd2('0x47')]=_0x4aa57a['attributes'][_0x3dd2('0x48')]?_0x4aa57a[_0x3dd2('0x47')]:_0x2bd783[_0x3dd2('0x41')];if(_0x1cf897[_0x3dd2('0x42')]['includeAll']){_0x4aa57a[_0x3dd2('0x53')]=[{'all':!![]}];}_0x4aa57a=_['merge']({},_0x4aa57a,_0x1cf897[_0x3dd2('0x51')]);return db['FaxMessage'][_0x3dd2('0x58')](_0x4aa57a)['then'](handleEntityNotFound(_0x491483,null))['then'](respondWithResult(_0x491483,null))['catch'](handleError(_0x491483,null));};exports[_0x3dd2('0x36')]=function(_0x222b20,_0x5d7845){if(_0x222b20[_0x3dd2('0x59')]['id']){delete _0x222b20[_0x3dd2('0x59')]['id'];}return db[_0x3dd2('0x3d')][_0x3dd2('0x58')]({'where':{'id':_0x222b20[_0x3dd2('0x57')]['id']}})['then'](handleEntityNotFound(_0x5d7845,null))['then'](saveUpdates(_0x222b20['body'],null))['then'](respondWithResult(_0x5d7845,null))[_0x3dd2('0x2a')](handleError(_0x5d7845,null));};exports[_0x3dd2('0x38')]=function(_0x5a0e38,_0x3a2bbc){return db[_0x3dd2('0x3d')][_0x3dd2('0x58')]({'where':{'id':_0x5a0e38['params']['id']}})[_0x3dd2('0x37')](handleEntityNotFound(_0x3a2bbc,null))[_0x3dd2('0x37')](removeEntity(_0x3a2bbc,null))[_0x3dd2('0x2a')](handleError(_0x3a2bbc,null));};exports[_0x3dd2('0x5a')]=function(_0x5dec83,_0x1f1687){return db[_0x3dd2('0x3d')][_0x3dd2('0x5a')]()[_0x3dd2('0x37')](respondWithResult(_0x1f1687,null))[_0x3dd2('0x2a')](handleError(_0x1f1687,null));};var interaction_log=require(_0x3dd2('0x12'))(_0x3dd2('0x5b'));exports[_0x3dd2('0x5c')]=function(_0x4d92bb,_0xe56398,_0x42e0c7){var _0x109323={'channel':_0x3dd2('0x5d')};if(_0x4d92bb[_0x3dd2('0x59')]['id']){delete _0x4d92bb[_0x3dd2('0x59')]['id'];}_0x4d92bb[_0x3dd2('0x59')][_0x3dd2('0x5e')]=!![];_0x4d92bb['body'][_0x3dd2('0x5f')]=moment()[_0x3dd2('0x60')](_0x3dd2('0x61'));_0x4d92bb[_0x3dd2('0x59')]['UserId']=_0x4d92bb[_0x3dd2('0x59')][_0x3dd2('0x62')]||_0x4d92bb['user']['id'];return db['FaxMessage']['find']({'where':{'id':_0x4d92bb[_0x3dd2('0x57')]['id'],'UserId':null},'include':[{'model':db[_0x3dd2('0x63')],'as':_0x3dd2('0x64')}]})['then'](handleEntityNotFound(_0xe56398,null))[_0x3dd2('0x37')](saveUpdates(_0x4d92bb[_0x3dd2('0x59')],null))['then'](function(_0x24f409){if(_0x24f409){_0x109323['message']=_0x24f409[_0x3dd2('0x65')]({'plain':!![]});return db[_0x3dd2('0x66')][_0x3dd2('0x58')]({'where':{'id':_0x24f409['FaxInteractionId']}});}return null;})[_0x3dd2('0x37')](handleEntityNotFound(_0xe56398,null))[_0x3dd2('0x37')](function(_0xbbf397){if(_0xbbf397){return _0xbbf397[_0x3dd2('0x36')]({'UserId':_0x4d92bb[_0x3dd2('0x59')][_0x3dd2('0x62')],'read1stAt':_[_0x3dd2('0x67')](_0xbbf397[_0x3dd2('0x68')])?moment()[_0x3dd2('0x60')](_0x3dd2('0x61')):undefined});}return null;})[_0x3dd2('0x37')](function(_0x3f7871){if(_0x3f7871){_0x109323['interaction']=_0x3f7871[_0x3dd2('0x65')]({'plain':!![]});interaction_log[_0x3dd2('0x20')](_0x3dd2('0x69'),_0x4d92bb[_0x3dd2('0x6a')]['id'],_0x4d92bb[_0x3dd2('0x6a')][_0x3dd2('0x3a')],_0x4d92bb['user']['role'],_0x109323[_0x3dd2('0x6b')]['id'],_0x4d92bb[_0x3dd2('0x59')]?JSON[_0x3dd2('0x25')](_0x4d92bb[_0x3dd2('0x59')]):'null');return respondWithRpcPromise('AcceptMessage',_0x3dd2('0x6c'),_0x109323);}return null;})[_0x3dd2('0x37')](function(_0x4f7231){if(_0x4f7231){if(_0x4d92bb['body'][_0x3dd2('0x6d')]){_0x109323[_0x3dd2('0x28')][_0x3dd2('0x6e')]=util[_0x3dd2('0x60')]('SIP/%s',_0x4d92bb['user'][_0x3dd2('0x3a')]);_0x109323[_0x3dd2('0x28')][_0x3dd2('0x6f')]=_0x109323[_0x3dd2('0x6f')];_0x109323['message'][_0x3dd2('0x70')]=_0x3dd2('0x5c');return respondWithRpcPromise(_0x3dd2('0x71'),'EventManager',{'event':_0x3dd2('0x72'),'message':_0x109323[_0x3dd2('0x28')]},client9002)['then'](function(){return _0x109323;});}return _0x109323;}return null;})[_0x3dd2('0x37')](respondWithResult(_0xe56398,null))[_0x3dd2('0x2a')](handleError(_0xe56398,null));};var interaction_log=require(_0x3dd2('0x12'))(_0x3dd2('0x5b'));exports['reject']=function(_0x207d73,_0x4a227f,_0x51e849){var _0x5d2bfc={'agent':{},'channel':_0x3dd2('0x5d')};if(_0x207d73[_0x3dd2('0x59')]['id']){delete _0x207d73[_0x3dd2('0x59')]['id'];}_0x207d73[_0x3dd2('0x59')][_0x3dd2('0x62')]=_0x207d73['body'][_0x3dd2('0x62')]||_0x207d73[_0x3dd2('0x6a')]['id'];_0x5d2bfc['agent']['id']=_0x207d73[_0x3dd2('0x59')][_0x3dd2('0x62')];return db[_0x3dd2('0x3d')][_0x3dd2('0x58')]({'where':{'id':_0x207d73[_0x3dd2('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4a227f,null))[_0x3dd2('0x37')](function(_0x552522){if(_0x552522){_0x5d2bfc[_0x3dd2('0x28')]=_0x552522[_0x3dd2('0x65')]({'plain':!![]});return db['FaxInteraction'][_0x3dd2('0x58')]({'where':{'id':_0x552522[_0x3dd2('0x73')]}});}return null;})[_0x3dd2('0x37')](handleEntityNotFound(_0x4a227f,null))[_0x3dd2('0x37')](function(_0x7739d8){if(_0x7739d8){_0x5d2bfc[_0x3dd2('0x6b')]=_0x7739d8[_0x3dd2('0x65')]({'plain':!![]});interaction_log[_0x3dd2('0x20')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x207d73[_0x3dd2('0x6a')]['id'],_0x207d73['user'][_0x3dd2('0x3a')],_0x207d73[_0x3dd2('0x6a')]['role'],_0x5d2bfc[_0x3dd2('0x6b')]['id'],_0x207d73['body']?JSON[_0x3dd2('0x25')](_0x207d73['body']):_0x3dd2('0x74'));return respondWithRpcPromise('RejectMessage',_0x3dd2('0x75'),_0x5d2bfc);}return null;})[_0x3dd2('0x37')](function(_0x2301ce){if(_0x2301ce){_0x2301ce[_0x3dd2('0x28')][_0x3dd2('0x6e')]=util[_0x3dd2('0x60')]('SIP/%s',_0x207d73[_0x3dd2('0x6a')][_0x3dd2('0x3a')]);_0x2301ce[_0x3dd2('0x28')][_0x3dd2('0x6f')]=_0x5d2bfc[_0x3dd2('0x6f')];_0x2301ce['message']['event']=_0x3dd2('0x35');respondWithRpcPromise('EventManager',_0x3dd2('0x71'),{'event':'rejectmessage','message':_0x2301ce[_0x3dd2('0x28')]},client9002);return _0x5d2bfc;}return null;})['then'](respondWithResult(_0x4a227f,null))[_0x3dd2('0x2a')](handleError(_0x4a227f,null));};exports[_0x3dd2('0x76')]=function(_0x24eb8b,_0xf121a8){var _0x360343;return db[_0x3dd2('0x3d')][_0x3dd2('0x76')](_0x24eb8b[_0x3dd2('0x59')],{})[_0x3dd2('0x37')](function(_0x36da10){_0x360343=_0x36da10;return db[_0x3dd2('0x63')][_0x3dd2('0x77')]({'where':{'id':_0x360343[_0x3dd2('0x78')]}});})[_0x3dd2('0x37')](function(_0x4efbac){if(_[_0x3dd2('0x67')](_0x4efbac)){return;}else{_0x360343['fax']=_0x4efbac[_0x3dd2('0x5d')];return db[_0x3dd2('0x79')]['findOne']({'where':{'id':_0x360343[_0x3dd2('0x7a')]}});}})['then'](function(_0xb08656){return respondWithRpcPromise(_0x3dd2('0x7b'),_0x3dd2('0x7b'),{'FaxAccountId':_[_0x3dd2('0x67')](_0x24eb8b['body'])?undefined:_0x24eb8b[_0x3dd2('0x59')][_0x3dd2('0x7c')],'path':_[_0x3dd2('0x67')](_0xb08656)?undefined:util[_0x3dd2('0x60')](_0x3dd2('0x7d'),_0xb08656[_0x3dd2('0x7e')]),'fax':_['isNil'](_0x360343[_0x3dd2('0x5d')])?undefined:_0x360343[_0x3dd2('0x5d')],'AttachmentId':_0x360343[_0x3dd2('0x7a')]},client9002);})[_0x3dd2('0x37')](respondWithResult(_0xf121a8,0xc9))[_0x3dd2('0x2a')](handleError(_0xf121a8,null));};exports[_0x3dd2('0x7f')]=function(_0x7acfc6,_0x20bc74){var _0x4c6683=path[_0x3dd2('0x80')](config[_0x3dd2('0x81')],_0x3dd2('0x82'),_0x3dd2('0x83'),_0x3dd2('0x84'));return db[_0x3dd2('0x3d')][_0x3dd2('0x58')]({'where':{'id':_0x7acfc6[_0x3dd2('0x57')]['id']},'include':[{'model':db[_0x3dd2('0x79')],'as':_0x3dd2('0x79')}]})[_0x3dd2('0x37')](handleEntityNotFound(_0x20bc74,null))[_0x3dd2('0x37')](function(_0x5dc55d){if(_0x5dc55d){return _0x20bc74[_0x3dd2('0x7f')](path['join'](_0x4c6683,_0x5dc55d[_0x3dd2('0x79')][_0x3dd2('0x7e')]));}})['catch'](handleError(_0x20bc74,null));};
\ No newline at end of file
index 4ab58ab..71676a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x21cf92,_0x538a58){var _0x343164=function(_0x494669){while(--_0x494669){_0x21cf92['push'](_0x21cf92['shift']());}};_0x343164(++_0x538a58);}(_0x008c,0x188));var _0xc008=function(_0x50d0dc,_0x23bcb0){_0x50d0dc=_0x50d0dc-0x0;var _0x49f2a9=_0x008c[_0x50d0dc];return _0x49f2a9;};'use strict';var EventEmitter=require(_0xc008('0x0'));var FaxMessage=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){FaxMessageEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);FaxMessageEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];FaxMessage[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
+var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x54ff10,_0x5e3da5){var _0x1cd2ae=function(_0x9e67e9){while(--_0x9e67e9){_0x54ff10['push'](_0x54ff10['shift']());}};_0x1cd2ae(++_0x5e3da5);}(_0x008c,0x188));var _0xc008=function(_0x1d4449,_0x495153){_0x1d4449=_0x1d4449-0x0;var _0x4dcde3=_0x008c[_0x1d4449];return _0x4dcde3;};'use strict';var EventEmitter=require(_0xc008('0x0'));var FaxMessage=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){FaxMessageEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);FaxMessageEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];FaxMessage[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
index 5885cdf..711efd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22a2=['utf8mb4_unicode_ci','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','createdAt','direction','catch','error','utf8mb4'];(function(_0x5c8c5d,_0x572915){var _0x175898=function(_0x19f531){while(--_0x19f531){_0x5c8c5d['push'](_0x5c8c5d['shift']());}};_0x175898(++_0x572915);}(_0x22a2,0xaf));var _0x222a=function(_0x2a0185,_0x572386){_0x2a0185=_0x2a0185-0x0;var _0x13af99=_0x22a2[_0x2a0185];return _0x13af99;};'use strict';var _=require('lodash');var util=require(_0x222a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x222a('0x1'));var BPromise=require(_0x222a('0x2'));var rp=require(_0x222a('0x3'));var fs=require('fs');var path=require(_0x222a('0x4'));var rimraf=require(_0x222a('0x5'));var config=require(_0x222a('0x6'));var attributes=require(_0x222a('0x7'));module['exports']=function(_0x3f7ba6,_0x5b7dee){return _0x3f7ba6[_0x222a('0x8')](_0x222a('0x9'),attributes,{'tableName':_0x222a('0xa'),'paranoid':![],'indexes':[{'name':_0x222a('0xb'),'fields':[_0x222a('0xc')],'type':_0x222a('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a3bbb,_0x15176f,_0xe8df20){var _0x1d6307=_0x3f7ba6[_0x222a('0xe')];var _0x4a2209=_0x5a3bbb['get']({'plain':!![]});if(_0x4a2209['direction'][_0x222a('0xf')]()==='in'||_0x4a2209['direction'][_0x222a('0xf')]()===_0x222a('0x10')&&!_0x4a2209[_0x222a('0x11')]&&!_[_0x222a('0x12')](_0x4a2209[_0x222a('0x13')])){_0x1d6307[_0x222a('0x14')]['findOne']({'where':{'id':_0x4a2209[_0x222a('0x15')]}})[_0x222a('0x16')](function(_0x5606a6){if(_0x5606a6){_0x5606a6['update']({'lastMsgAt':_0x4a2209[_0x222a('0x17')],'lastMsgDirection':_0x4a2209[_0x222a('0x18')][_0x222a('0xf')]()});}})[_0x222a('0x19')](function(_0x335e13){console[_0x222a('0x1a')](_0x335e13);});}_0xe8df20();}},'charset':_0x222a('0x1b'),'collate':_0x222a('0x1c')});};
\ No newline at end of file
+var _0xf2c3=['body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages'];(function(_0x573afd,_0x238cac){var _0x245c4b=function(_0x4bd91d){while(--_0x4bd91d){_0x573afd['push'](_0x573afd['shift']());}};_0x245c4b(++_0x238cac);}(_0xf2c3,0x6e));var _0x3f2c=function(_0x4ddbfe,_0x52bb08){_0x4ddbfe=_0x4ddbfe-0x0;var _0xb42d46=_0xf2c3[_0x4ddbfe];return _0xb42d46;};'use strict';var _=require(_0x3f2c('0x0'));var util=require(_0x3f2c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3f2c('0x2'));var BPromise=require(_0x3f2c('0x3'));var rp=require(_0x3f2c('0x4'));var fs=require('fs');var path=require(_0x3f2c('0x5'));var rimraf=require(_0x3f2c('0x6'));var config=require(_0x3f2c('0x7'));var attributes=require(_0x3f2c('0x8'));module[_0x3f2c('0x9')]=function(_0xd28b2b,_0x488326){return _0xd28b2b[_0x3f2c('0xa')](_0x3f2c('0xb'),attributes,{'tableName':_0x3f2c('0xc'),'paranoid':![],'indexes':[{'name':_0x3f2c('0xd'),'fields':[_0x3f2c('0xe')],'type':_0x3f2c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c771d,_0x5c9009,_0x15c597){var _0x3ae0d4=_0xd28b2b[_0x3f2c('0x10')];var _0x301e11=_0x4c771d[_0x3f2c('0x11')]({'plain':!![]});if(_0x301e11['direction'][_0x3f2c('0x12')]()==='in'||_0x301e11[_0x3f2c('0x13')][_0x3f2c('0x12')]()===_0x3f2c('0x14')&&!_0x301e11[_0x3f2c('0x15')]&&!_[_0x3f2c('0x16')](_0x301e11[_0x3f2c('0x17')])){_0x3ae0d4[_0x3f2c('0x18')]['findOne']({'where':{'id':_0x301e11[_0x3f2c('0x19')]}})[_0x3f2c('0x1a')](function(_0x2cad67){if(_0x2cad67){_0x2cad67[_0x3f2c('0x1b')]({'lastMsgAt':_0x301e11['createdAt'],'lastMsgDirection':_0x301e11[_0x3f2c('0x13')][_0x3f2c('0x12')]()});}})['catch'](function(_0x49901f){console[_0x3f2c('0x1c')](_0x49901f);});}_0x15c597();}},'charset':_0x3f2c('0x1d'),'collate':_0x3f2c('0x1e')});};
\ No newline at end of file
index 0682880..8cf7537 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2934=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','FaxMessage','create','options','raw','CreateFaxMessage','stringify','UpdateFaxMessage','update','body','where','attributes','limit','lodash','util','moment','randomstring'];(function(_0x367fb2,_0xe4392c){var _0x2ab0bd=function(_0x2810d1){while(--_0x2810d1){_0x367fb2['push'](_0x367fb2['shift']());}};_0x2ab0bd(++_0xe4392c);}(_0x2934,0x74));var _0x4293=function(_0x5f26b7,_0x5cb63e){_0x5f26b7=_0x5f26b7-0x0;var _0x41dddd=_0x2934[_0x5f26b7];return _0x41dddd;};'use strict';var _=require(_0x4293('0x0'));var util=require(_0x4293('0x1'));var moment=require(_0x4293('0x2'));var BPromise=require('bluebird');var rs=require(_0x4293('0x3'));var fs=require('fs');var Redis=require(_0x4293('0x4'));var db=require(_0x4293('0x5'))['db'];var utils=require(_0x4293('0x6'));var logger=require(_0x4293('0x7'))(_0x4293('0x8'));var config=require('../../config/environment');var jayson=require(_0x4293('0x9'));var client=jayson[_0x4293('0xa')]['http']({'port':0x232a});config[_0x4293('0xb')]=_[_0x4293('0xc')](config[_0x4293('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4293('0xd'))(new Redis(config[_0x4293('0xb')]));require(_0x4293('0xe'))[_0x4293('0xf')](socket);function respondWithRpcPromise(_0x209bcf,_0x2fe3d3,_0x51128b){return new BPromise(function(_0x611302,_0x494d0d){return client[_0x4293('0x10')](_0x209bcf,_0x51128b)[_0x4293('0x11')](function(_0x2202ae){logger[_0x4293('0x12')](_0x4293('0x13'),_0x2fe3d3,_0x4293('0x14'));logger[_0x4293('0x15')](_0x4293('0x16'),_0x2fe3d3,'request\x20sent',JSON['stringify'](_0x2202ae));if(_0x2202ae[_0x4293('0x17')]){if(_0x2202ae[_0x4293('0x17')][_0x4293('0x18')]===0x1f4){logger[_0x4293('0x17')](_0x4293('0x13'),_0x2fe3d3,_0x2202ae['error'][_0x4293('0x19')]);return _0x494d0d(_0x2202ae[_0x4293('0x17')][_0x4293('0x19')]);}logger[_0x4293('0x17')](_0x4293('0x13'),_0x2fe3d3,_0x2202ae[_0x4293('0x17')][_0x4293('0x19')]);return _0x611302(_0x2202ae[_0x4293('0x17')][_0x4293('0x19')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x2fe3d3,_0x4293('0x14'));_0x611302(_0x2202ae[_0x4293('0x1a')][_0x4293('0x19')]);}})[_0x4293('0x1b')](function(_0x38a534){logger[_0x4293('0x17')](_0x4293('0x13'),_0x2fe3d3,_0x38a534);_0x494d0d(_0x38a534);});});}exports['CreateFaxMessage']=function(_0x416db6){var _0x401dde=this;return new Promise(function(_0x3d6fb5,_0x8a2e1a){return db[_0x4293('0x1c')][_0x4293('0x1d')](_0x416db6['body'],{'raw':_0x416db6[_0x4293('0x1e')]?_0x416db6['options'][_0x4293('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x24e39b){logger[_0x4293('0x12')]('CreateFaxMessage',_0x416db6);logger[_0x4293('0x15')](_0x4293('0x20'),_0x416db6,JSON[_0x4293('0x21')](_0x24e39b));_0x3d6fb5(_0x24e39b);})[_0x4293('0x1b')](function(_0x22fb44){logger[_0x4293('0x17')](_0x4293('0x20'),_0x22fb44['message'],_0x416db6);_0x8a2e1a(_0x401dde[_0x4293('0x17')](0x1f4,_0x22fb44[_0x4293('0x19')]));});});};exports[_0x4293('0x22')]=function(_0x1bb008){var _0xc5a8b8=this;return new Promise(function(_0x316925,_0x3848be){return db[_0x4293('0x1c')][_0x4293('0x23')](_0x1bb008[_0x4293('0x24')],{'raw':_0x1bb008['options']?_0x1bb008[_0x4293('0x1e')][_0x4293('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bb008[_0x4293('0x1e')]?_0x1bb008[_0x4293('0x1e')][_0x4293('0x25')]||null:null,'attributes':_0x1bb008['options']?_0x1bb008['options'][_0x4293('0x26')]||null:null,'limit':_0x1bb008[_0x4293('0x1e')]?_0x1bb008[_0x4293('0x1e')][_0x4293('0x27')]||null:null})[_0x4293('0x11')](function(_0x909f31){logger['info'](_0x4293('0x22'),_0x1bb008);logger[_0x4293('0x15')](_0x4293('0x22'),_0x1bb008,JSON[_0x4293('0x21')](_0x909f31));_0x316925(_0x909f31);})['catch'](function(_0x37f55b){logger[_0x4293('0x17')](_0x4293('0x22'),_0x37f55b[_0x4293('0x19')],_0x1bb008);_0x3848be(_0xc5a8b8['error'](0x1f4,_0x37f55b['message']));});});};
\ No newline at end of file
+var _0xde71=['request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','options','UpdateFaxMessage','update','raw','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s'];(function(_0x2ac42c,_0x400eff){var _0x29b7f3=function(_0x2f9606){while(--_0x2f9606){_0x2ac42c['push'](_0x2ac42c['shift']());}};_0x29b7f3(++_0x400eff);}(_0xde71,0x1c1));var _0x1de7=function(_0x4f83ca,_0x46f67a){_0x4f83ca=_0x4f83ca-0x0;var _0x1fbac3=_0xde71[_0x4f83ca];return _0x1fbac3;};'use strict';var _=require(_0x1de7('0x0'));var util=require(_0x1de7('0x1'));var moment=require(_0x1de7('0x2'));var BPromise=require(_0x1de7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1de7('0x4'));var db=require(_0x1de7('0x5'))['db'];var utils=require(_0x1de7('0x6'));var logger=require(_0x1de7('0x7'))(_0x1de7('0x8'));var config=require(_0x1de7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1de7('0xa')][_0x1de7('0xb')]({'port':0x232a});config[_0x1de7('0xc')]=_[_0x1de7('0xd')](config[_0x1de7('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1de7('0xc')]));require(_0x1de7('0xe'))[_0x1de7('0xf')](socket);function respondWithRpcPromise(_0x833d72,_0x549a34,_0x4913fb){return new BPromise(function(_0x23f154,_0x502d2b){return client[_0x1de7('0x10')](_0x833d72,_0x4913fb)[_0x1de7('0x11')](function(_0x5e2008){logger['info'](_0x1de7('0x12'),_0x549a34,_0x1de7('0x13'));logger[_0x1de7('0x14')](_0x1de7('0x15'),_0x549a34,_0x1de7('0x13'),JSON[_0x1de7('0x16')](_0x5e2008));if(_0x5e2008[_0x1de7('0x17')]){if(_0x5e2008[_0x1de7('0x17')][_0x1de7('0x18')]===0x1f4){logger['error'](_0x1de7('0x12'),_0x549a34,_0x5e2008['error']['message']);return _0x502d2b(_0x5e2008['error'][_0x1de7('0x19')]);}logger[_0x1de7('0x17')]('FaxMessage,\x20%s,\x20%s',_0x549a34,_0x5e2008['error'][_0x1de7('0x19')]);return _0x23f154(_0x5e2008[_0x1de7('0x17')][_0x1de7('0x19')]);}else{logger[_0x1de7('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x549a34,_0x1de7('0x13'));_0x23f154(_0x5e2008[_0x1de7('0x1b')][_0x1de7('0x19')]);}})[_0x1de7('0x1c')](function(_0x562ebf){logger[_0x1de7('0x17')]('FaxMessage,\x20%s,\x20%s',_0x549a34,_0x562ebf);_0x502d2b(_0x562ebf);});});}exports[_0x1de7('0x1d')]=function(_0x673ffc){var _0x5eafa9=this;return new Promise(function(_0x4b2e40,_0x24d123){return db[_0x1de7('0x1e')][_0x1de7('0x1f')](_0x673ffc['body'],{'raw':_0x673ffc[_0x1de7('0x20')]?_0x673ffc[_0x1de7('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x1de7('0x11')](function(_0x2fad04){logger[_0x1de7('0x1a')](_0x1de7('0x1d'),_0x673ffc);logger[_0x1de7('0x14')]('CreateFaxMessage',_0x673ffc,JSON['stringify'](_0x2fad04));_0x4b2e40(_0x2fad04);})['catch'](function(_0x32c80b){logger['error'](_0x1de7('0x1d'),_0x32c80b['message'],_0x673ffc);_0x24d123(_0x5eafa9[_0x1de7('0x17')](0x1f4,_0x32c80b[_0x1de7('0x19')]));});});};exports[_0x1de7('0x21')]=function(_0x65c4ac){var _0x1b941b=this;return new Promise(function(_0x5f419b,_0xd97ebb){return db[_0x1de7('0x1e')][_0x1de7('0x22')](_0x65c4ac['body'],{'raw':_0x65c4ac[_0x1de7('0x20')]?_0x65c4ac['options'][_0x1de7('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x65c4ac[_0x1de7('0x20')]?_0x65c4ac[_0x1de7('0x20')][_0x1de7('0x24')]||null:null,'attributes':_0x65c4ac[_0x1de7('0x20')]?_0x65c4ac['options'][_0x1de7('0x25')]||null:null,'limit':_0x65c4ac[_0x1de7('0x20')]?_0x65c4ac['options'][_0x1de7('0x26')]||null:null})['then'](function(_0xa10efa){logger[_0x1de7('0x1a')]('UpdateFaxMessage',_0x65c4ac);logger[_0x1de7('0x14')]('UpdateFaxMessage',_0x65c4ac,JSON[_0x1de7('0x16')](_0xa10efa));_0x5f419b(_0xa10efa);})[_0x1de7('0x1c')](function(_0x1417a1){logger[_0x1de7('0x17')](_0x1de7('0x21'),_0x1417a1['message'],_0x65c4ac);_0xd97ebb(_0x1b941b[_0x1de7('0x17')](0x1f4,_0x1417a1['message']));});});};
\ No newline at end of file
index 2bbf771..b513448 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var FaxMessageEvents=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(){FaxMessageEvents[_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);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','faxMessage:','./faxMessage.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(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var FaxMessageEvents=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(){FaxMessageEvents[_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);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 05805c9..8e79821 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x843b=['download','post','tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','../../components/auth/service','../../config/environment','./faxMessage.controller','get','index','isAuthenticated','describe','/:id'];(function(_0x3de98b,_0x486e36){var _0x2c1995=function(_0x645048){while(--_0x645048){_0x3de98b['push'](_0x3de98b['shift']());}};_0x2c1995(++_0x486e36);}(_0x843b,0xae));var _0xb843=function(_0x11f026,_0x2a82ac){_0x11f026=_0x11f026-0x0;var _0x9e15c1=_0x843b[_0x11f026];return _0x9e15c1;};'use strict';var multer=require(_0xb843('0x0'));var util=require(_0xb843('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xb843('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xb843('0x3'));var controller=require(_0xb843('0x4'));router[_0xb843('0x5')]('/',auth['isAuthenticated'](),controller[_0xb843('0x6')]);router[_0xb843('0x5')]('/describe',auth[_0xb843('0x7')](),controller[_0xb843('0x8')]);router[_0xb843('0x5')](_0xb843('0x9'),auth[_0xb843('0x7')](),controller['show']);router[_0xb843('0x5')]('/:id/download',auth[_0xb843('0x7')](),controller[_0xb843('0xa')]);router[_0xb843('0xb')]('/',auth[_0xb843('0x7')](),interaction[_0xb843('0xc')](_0xb843('0xd'),'faxmessage:create'),controller[_0xb843('0xe')]);router[_0xb843('0xf')]('/:id',auth[_0xb843('0x7')](),controller[_0xb843('0x10')]);router[_0xb843('0xf')](_0xb843('0x11'),auth[_0xb843('0x7')](),controller[_0xb843('0x12')]);router[_0xb843('0xf')](_0xb843('0x13'),auth['isAuthenticated'](),controller[_0xb843('0x14')]);router[_0xb843('0x15')](_0xb843('0x9'),auth[_0xb843('0x7')](),controller['destroy']);module[_0xb843('0x16')]=router;
\ No newline at end of file
+var _0x361a=['accept','/:id/reject','delete','destroy','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','show','download','post','fax','faxmessage:create','create','/:id','update','put','/:id/accept'];(function(_0x5aa27f,_0xd98d9a){var _0x36e286=function(_0x6af949){while(--_0x6af949){_0x5aa27f['push'](_0x5aa27f['shift']());}};_0x36e286(++_0xd98d9a);}(_0x361a,0x8e));var _0xa361=function(_0x54c793,_0x2b91b7){_0x54c793=_0x54c793-0x0;var _0x2e9819=_0x361a[_0x54c793];return _0x2e9819;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa361('0x0'));var express=require(_0xa361('0x1'));var router=express[_0xa361('0x2')]();var auth=require(_0xa361('0x3'));var interaction=require(_0xa361('0x4'));var config=require(_0xa361('0x5'));var controller=require(_0xa361('0x6'));router[_0xa361('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa361('0x7')]('/describe',auth[_0xa361('0x8')](),controller['describe']);router[_0xa361('0x7')]('/:id',auth[_0xa361('0x8')](),controller[_0xa361('0x9')]);router[_0xa361('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xa361('0xa')]);router[_0xa361('0xb')]('/',auth[_0xa361('0x8')](),interaction['tracked'](_0xa361('0xc'),_0xa361('0xd')),controller[_0xa361('0xe')]);router['put'](_0xa361('0xf'),auth[_0xa361('0x8')](),controller[_0xa361('0x10')]);router[_0xa361('0x11')](_0xa361('0x12'),auth[_0xa361('0x8')](),controller[_0xa361('0x13')]);router['put'](_0xa361('0x14'),auth[_0xa361('0x8')](),controller['reject']);router[_0xa361('0x15')](_0xa361('0xf'),auth[_0xa361('0x8')](),controller[_0xa361('0x16')]);module['exports']=router;
\ No newline at end of file
index ce3b8af..605b970 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa854=['sequelize','exports','STRING','name','ENUM','beepall','INTEGER'];(function(_0x3572e5,_0x5893d8){var _0x2073f6=function(_0x136543){while(--_0x136543){_0x3572e5['push'](_0x3572e5['shift']());}};_0x2073f6(++_0x5893d8);}(_0xa854,0x103));var _0x4a85=function(_0x3daa94,_0x342c15){_0x3daa94=_0x3daa94-0x0;var _0x588069=_0xa854[_0x3daa94];return _0x588069;};'use strict';var Sequelize=require(_0x4a85('0x0'));module[_0x4a85('0x1')]={'name':{'type':Sequelize[_0x4a85('0x2')],'unique':_0x4a85('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4a85('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4a85('0x4')]('rrmemory',_0x4a85('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x4a85('0x6')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x26ef=['exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x2491a3,_0x590c04){var _0x4bff05=function(_0xb21220){while(--_0xb21220){_0x2491a3['push'](_0x2491a3['shift']());}};_0x4bff05(++_0x590c04);}(_0x26ef,0x13e));var _0xf26e=function(_0x546bff,_0x299a95){_0x546bff=_0x546bff-0x0;var _0x42e3af=_0x26ef[_0x546bff];return _0x42e3af;};'use strict';var Sequelize=require('sequelize');module[_0xf26e('0x0')]={'name':{'type':Sequelize[_0xf26e('0x1')],'unique':_0xf26e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf26e('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf26e('0x3')](_0xf26e('0x4'),_0xf26e('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index ac09822..b701c22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeeeb=['sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','status','end','json','count','offset','limit','Content-Range','save','update','then','destroy','get','sendStatus','error','name','send','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','options','FaxQueue','includeAll','rows','catch','show','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxQueues','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','params','UserFaxQueue','nolimit','pick','FaxQueueId','findAll','User','findAndCountAll','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','online','voicePause','interface','Agents'];(function(_0xacf8c,_0x1d484b){var _0x21fd7b=function(_0x10b1bf){while(--_0x10b1bf){_0xacf8c['push'](_0xacf8c['shift']());}};_0x21fd7b(++_0x1d484b);}(_0xeeeb,0x1bb));var _0xbeee=function(_0x32856b,_0x100a97){_0x32856b=_0x32856b-0x0;var _0x34848c=_0xeeeb[_0x32856b];return _0x34848c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbeee('0x0'));var rimraf=require(_0xbeee('0x1'));var zipdir=require(_0xbeee('0x2'));var jsonpatch=require(_0xbeee('0x3'));var rp=require(_0xbeee('0x4'));var moment=require('moment');var BPromise=require(_0xbeee('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbeee('0x6'));var csv=require(_0xbeee('0x7'));var ejs=require(_0xbeee('0x8'));var fs=require('fs');var _=require(_0xbeee('0x9'));var squel=require(_0xbeee('0xa'));var crypto=require(_0xbeee('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbeee('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbeee('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbeee('0xe'));var as=require(_0xbeee('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbeee('0x10'))(_0xbeee('0x11'));var utils=require(_0xbeee('0x12'));var config=require(_0xbeee('0x13'));var db=require(_0xbeee('0x14'))['db'];config[_0xbeee('0x15')]=_[_0xbeee('0x16')](config[_0xbeee('0x15')],{'host':_0xbeee('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbeee('0x15')]));require(_0xbeee('0x18'))['register'](socket);function respondWithStatusCode(_0x3777ca,_0x4b7b6d){_0x4b7b6d=_0x4b7b6d||0xcc;return function(_0x13b691){if(_0x13b691){return _0x3777ca['sendStatus'](_0x4b7b6d);}return _0x3777ca[_0xbeee('0x19')](_0x4b7b6d)[_0xbeee('0x1a')]();};}function respondWithResult(_0x1dd019,_0x377a78){_0x377a78=_0x377a78||0xc8;return function(_0x4fcea7){if(_0x4fcea7){return _0x1dd019['status'](_0x377a78)[_0xbeee('0x1b')](_0x4fcea7);}};}function respondWithFilteredResult(_0x122992,_0x4e5c6e){return function(_0x570533){if(_0x570533){var _0xa31be2=_0x570533[_0xbeee('0x1c')],_0x954568=_0x4e5c6e[_0xbeee('0x1d')],_0x41e86a=_0x4e5c6e[_0xbeee('0x1d')]+_0x4e5c6e[_0xbeee('0x1e')],_0x89ef63;if(_0x41e86a>=_0xa31be2){_0x41e86a=_0xa31be2;_0x89ef63=0xc8;}else{_0x89ef63=0xce;}_0x122992[_0xbeee('0x19')](_0x89ef63);return _0x122992['set'](_0xbeee('0x1f'),_0x954568+'-'+_0x41e86a+'/'+_0xa31be2)['json'](_0x570533);}return null;};}function patchUpdates(_0x5c882c){return function(_0x2d2c79){try{jsonpatch['apply'](_0x2d2c79,_0x5c882c,!![]);}catch(_0x383c33){return BPromise['reject'](_0x383c33);}return _0x2d2c79[_0xbeee('0x20')]();};}function saveUpdates(_0x32fa75,_0x522ce2){return function(_0x547fd8){if(_0x547fd8){return _0x547fd8[_0xbeee('0x21')](_0x32fa75)[_0xbeee('0x22')](function(_0x13e823){return _0x13e823;});}return null;};}function removeEntity(_0x21cb84,_0x2953a4){return function(_0xf60f9b){if(_0xf60f9b){return _0xf60f9b[_0xbeee('0x23')]()[_0xbeee('0x22')](function(){var _0x947a83=_0xf60f9b[_0xbeee('0x24')]({'plain':!![]});var _0x2e6610='FaxQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x2e6610,'resourceId':_0x947a83['id']}})[_0xbeee('0x22')](function(){return _0xf60f9b;});})[_0xbeee('0x22')](function(){_0x21cb84[_0xbeee('0x19')](0xcc)[_0xbeee('0x1a')]();});}};}function handleEntityNotFound(_0x1361c2,_0x4f8e4e){return function(_0x40bebb){if(!_0x40bebb){_0x1361c2[_0xbeee('0x25')](0x194);}return _0x40bebb;};}function handleError(_0x2472db,_0x11d692){_0x11d692=_0x11d692||0x1f4;return function(_0x56c852){logger[_0xbeee('0x26')](_0x56c852['stack']);if(_0x56c852['name']){delete _0x56c852[_0xbeee('0x27')];}_0x2472db[_0xbeee('0x19')](_0x11d692)[_0xbeee('0x28')](_0x56c852);};}exports[_0xbeee('0x29')]=function(_0x3b3bde,_0x5d3ec1){var _0x239e1d={},_0x37a90d={},_0xe9e233={'count':0x0,'rows':[]};var _0x5b4d49=_[_0xbeee('0x2a')](db['FaxQueue'][_0xbeee('0x2b')],function(_0x24c38e){return{'name':_0x24c38e[_0xbeee('0x2c')],'type':_0x24c38e['type']['key']};});_0x37a90d[_0xbeee('0x2d')]=_[_0xbeee('0x2a')](_0x5b4d49,_0xbeee('0x27'));_0x37a90d['query']=_[_0xbeee('0x2e')](_0x3b3bde[_0xbeee('0x2f')]);_0x37a90d[_0xbeee('0x30')]=_[_0xbeee('0x31')](_0x37a90d[_0xbeee('0x2d')],_0x37a90d[_0xbeee('0x2f')]);_0x239e1d[_0xbeee('0x32')]=_[_0xbeee('0x31')](_0x37a90d[_0xbeee('0x2d')],qs['fields'](_0x3b3bde[_0xbeee('0x2f')][_0xbeee('0x33')]));_0x239e1d[_0xbeee('0x32')]=_0x239e1d[_0xbeee('0x32')]['length']?_0x239e1d['attributes']:_0x37a90d[_0xbeee('0x2d')];if(!_0x3b3bde[_0xbeee('0x2f')][_0xbeee('0x34')]('nolimit')){_0x239e1d['limit']=qs[_0xbeee('0x1e')](_0x3b3bde[_0xbeee('0x2f')]['limit']);_0x239e1d[_0xbeee('0x1d')]=qs[_0xbeee('0x1d')](_0x3b3bde[_0xbeee('0x2f')][_0xbeee('0x1d')]);}_0x239e1d[_0xbeee('0x35')]=qs['sort'](_0x3b3bde[_0xbeee('0x2f')][_0xbeee('0x36')]);_0x239e1d['where']=qs[_0xbeee('0x30')](_['pick'](_0x3b3bde[_0xbeee('0x2f')],_0x37a90d[_0xbeee('0x30')]),_0x5b4d49);if(_0x3b3bde['query'][_0xbeee('0x37')]){_0x239e1d[_0xbeee('0x38')]=_[_0xbeee('0x39')](_0x239e1d[_0xbeee('0x38')],{'$or':_[_0xbeee('0x2a')](_0x5b4d49,function(_0x4e2754){if(_0x4e2754[_0xbeee('0x3a')]!==_0xbeee('0x3b')){var _0x22a414={};_0x22a414[_0x4e2754[_0xbeee('0x27')]]={'$like':'%'+_0x3b3bde[_0xbeee('0x2f')]['filter']+'%'};return _0x22a414;}})});}_0x239e1d=_[_0xbeee('0x39')]({},_0x239e1d,_0x3b3bde[_0xbeee('0x3c')]);var _0x1941ac={'where':_0x239e1d[_0xbeee('0x38')]};return db[_0xbeee('0x3d')][_0xbeee('0x1c')](_0x1941ac)['then'](function(_0x517883){_0xe9e233[_0xbeee('0x1c')]=_0x517883;if(_0x3b3bde['query'][_0xbeee('0x3e')]){_0x239e1d['include']=[{'all':!![]}];}return db[_0xbeee('0x3d')]['findAll'](_0x239e1d);})[_0xbeee('0x22')](function(_0x254e53){_0xe9e233[_0xbeee('0x3f')]=_0x254e53;return _0xe9e233;})[_0xbeee('0x22')](respondWithFilteredResult(_0x5d3ec1,_0x239e1d))[_0xbeee('0x40')](handleError(_0x5d3ec1,null));};exports[_0xbeee('0x41')]=function(_0x3b1610,_0x114bed){var _0x1c35ab={'raw':!![],'where':{'id':_0x3b1610['params']['id']}},_0x1eecf8={};_0x1eecf8[_0xbeee('0x2d')]=_[_0xbeee('0x2e')](db[_0xbeee('0x3d')][_0xbeee('0x2b')]);_0x1eecf8[_0xbeee('0x2f')]=_[_0xbeee('0x2e')](_0x3b1610[_0xbeee('0x2f')]);_0x1eecf8['filters']=_['intersection'](_0x1eecf8['model'],_0x1eecf8['query']);_0x1c35ab[_0xbeee('0x32')]=_['intersection'](_0x1eecf8['model'],qs[_0xbeee('0x33')](_0x3b1610[_0xbeee('0x2f')][_0xbeee('0x33')]));_0x1c35ab['attributes']=_0x1c35ab[_0xbeee('0x32')][_0xbeee('0x42')]?_0x1c35ab[_0xbeee('0x32')]:_0x1eecf8[_0xbeee('0x2d')];if(_0x3b1610[_0xbeee('0x2f')]['includeAll']){_0x1c35ab[_0xbeee('0x43')]=[{'all':!![]}];}_0x1c35ab=_[_0xbeee('0x39')]({},_0x1c35ab,_0x3b1610[_0xbeee('0x3c')]);return db['FaxQueue'][_0xbeee('0x44')](_0x1c35ab)[_0xbeee('0x22')](handleEntityNotFound(_0x114bed,null))[_0xbeee('0x22')](respondWithResult(_0x114bed,null))['catch'](handleError(_0x114bed,null));};exports[_0xbeee('0x45')]=function(_0x2d2bb0,_0x3092fc){return db['FaxQueue']['create'](_0x2d2bb0[_0xbeee('0x46')],{})[_0xbeee('0x22')](function(_0x31caba){var _0x45a9ae=_0x2d2bb0['user'][_0xbeee('0x24')]({'plain':!![]});if(!_0x45a9ae)throw new Error(_0xbeee('0x47'));if(_0x45a9ae[_0xbeee('0x48')]===_0xbeee('0x49')){var _0x174822=_0x31caba[_0xbeee('0x24')]({'plain':!![]});var _0xcc80d8=_0xbeee('0x4a');return db[_0xbeee('0x4b')][_0xbeee('0x44')]({'where':{'name':_0xcc80d8,'userProfileId':_0x45a9ae[_0xbeee('0x4c')]},'raw':!![]})[_0xbeee('0x22')](function(_0x2308d4){if(_0x2308d4&&_0x2308d4['autoAssociation']===0x0){return db[_0xbeee('0x4d')][_0xbeee('0x45')]({'name':_0x174822['name'],'resourceId':_0x174822['id'],'type':_0x2308d4[_0xbeee('0x27')],'sectionId':_0x2308d4['id']},{})[_0xbeee('0x22')](function(){return _0x31caba;});}else{return _0x31caba;}})['catch'](function(_0x1bdcb3){logger[_0xbeee('0x26')](_0xbeee('0x4e'),_0x1bdcb3);throw _0x1bdcb3;});}return _0x31caba;})[_0xbeee('0x22')](respondWithResult(_0x3092fc,0xc9))[_0xbeee('0x40')](handleError(_0x3092fc,null));};exports[_0xbeee('0x21')]=function(_0x1ba970,_0x40b8c7){if(_0x1ba970[_0xbeee('0x46')]['id']){delete _0x1ba970[_0xbeee('0x46')]['id'];}return db[_0xbeee('0x3d')]['find']({'where':{'id':_0x1ba970['params']['id']}})['then'](handleEntityNotFound(_0x40b8c7,null))['then'](saveUpdates(_0x1ba970['body'],null))['then'](respondWithResult(_0x40b8c7,null))[_0xbeee('0x40')](handleError(_0x40b8c7,null));};exports[_0xbeee('0x23')]=function(_0x395db2,_0x431d5b){return db[_0xbeee('0x3d')][_0xbeee('0x44')]({'where':{'id':_0x395db2['params']['id']}})[_0xbeee('0x22')](handleEntityNotFound(_0x431d5b,null))['then'](removeEntity(_0x431d5b,null))[_0xbeee('0x40')](handleError(_0x431d5b,null));};exports[_0xbeee('0x4f')]=function(_0x614e39,_0x3b5d){return db[_0xbeee('0x3d')]['describe']()[_0xbeee('0x22')](respondWithResult(_0x3b5d,null))[_0xbeee('0x40')](handleError(_0x3b5d,null));};exports[_0xbeee('0x50')]=function(_0x17e98f,_0x3bcdc9,_0x4e6893){var _0x154ac0={'raw':!![],'where':{}},_0x4cc6b6={},_0x11c45b;return db['FaxQueue'][_0xbeee('0x51')]({'where':{'id':_0x17e98f[_0xbeee('0x52')]['id']}})[_0xbeee('0x22')](handleEntityNotFound(_0x3bcdc9,null))[_0xbeee('0x22')](function(_0x1ed05d){if(_0x1ed05d){_0x11c45b=_0x1ed05d['get']({'plain':!![]});_0x4cc6b6[_0xbeee('0x2d')]=_[_0xbeee('0x2e')](db[_0xbeee('0x53')]['rawAttributes']);_0x4cc6b6[_0xbeee('0x2f')]=_[_0xbeee('0x2e')](_0x17e98f[_0xbeee('0x2f')]);_0x4cc6b6[_0xbeee('0x30')]=_[_0xbeee('0x31')](_0x4cc6b6['model'],_0x4cc6b6['query']);_0x154ac0[_0xbeee('0x32')]=_['intersection'](_0x4cc6b6[_0xbeee('0x2d')],qs[_0xbeee('0x33')](_0x17e98f[_0xbeee('0x2f')][_0xbeee('0x33')]));_0x154ac0[_0xbeee('0x32')]=_0x154ac0['attributes'][_0xbeee('0x42')]?_0x154ac0[_0xbeee('0x32')]:_0x4cc6b6[_0xbeee('0x2d')];if(!_0x17e98f[_0xbeee('0x2f')][_0xbeee('0x34')](_0xbeee('0x54'))){_0x154ac0['limit']=qs[_0xbeee('0x1e')](_0x17e98f['query'][_0xbeee('0x1e')]);_0x154ac0[_0xbeee('0x1d')]=qs['offset'](_0x17e98f[_0xbeee('0x2f')][_0xbeee('0x1d')]);}_0x154ac0[_0xbeee('0x35')]=qs[_0xbeee('0x36')](_0x17e98f[_0xbeee('0x2f')][_0xbeee('0x36')]);_0x154ac0[_0xbeee('0x38')]=qs['filters'](_[_0xbeee('0x55')](_0x17e98f[_0xbeee('0x2f')],_0x4cc6b6[_0xbeee('0x30')]));_0x154ac0[_0xbeee('0x38')][_0xbeee('0x56')]=_0x1ed05d['id'];if(_0x17e98f[_0xbeee('0x2f')][_0xbeee('0x37')]){_0x154ac0['where']=_[_0xbeee('0x39')](_0x154ac0[_0xbeee('0x38')],{'$or':_[_0xbeee('0x2a')](_0x154ac0[_0xbeee('0x32')],function(_0x375786){var _0x4d2911={};_0x4d2911[_0x375786]={'$like':'%'+_0x17e98f[_0xbeee('0x2f')][_0xbeee('0x37')]+'%'};return _0x4d2911;})});}_0x154ac0=_[_0xbeee('0x39')]({},_0x154ac0,_0x17e98f['options']);return db[_0xbeee('0x53')][_0xbeee('0x57')](_0x154ac0);}})[_0xbeee('0x22')](function(_0x2c389e){if(_0x2c389e){return db[_0xbeee('0x58')][_0xbeee('0x59')]({'where':{'id':_['map'](_0x2c389e,'UserId'),'role':_0xbeee('0x5a')},'attributes':['id',_0xbeee('0x27'),_0xbeee('0x5b'),_0xbeee('0x5c'),_0xbeee('0x5d')]});}})['then'](function(_0x2bbb30){if(_0x2bbb30){return{'count':_0x2bbb30[_0xbeee('0x1c')],'rows':_[_0xbeee('0x2a')](_0x2bbb30[_0xbeee('0x3f')],function(_0x1b123c){return{'membername':_0x1b123c[_0xbeee('0x27')],'UserId':_0x1b123c['id'],'queue_name':_0x11c45b['name'],'FaxQueueId':_0x11c45b['id'],'interface':util[_0xbeee('0x5e')](_0xbeee('0x5f'),_0xbeee('0x60'),_0x1b123c['name']),'penalty':0x0,'paused':_0x1b123c[_0xbeee('0x5b')],'createdAt':_0x1b123c[_0xbeee('0x5d')],'updatedAt':_0x1b123c[_0xbeee('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbeee('0x22')](respondWithFilteredResult(_0x3bcdc9,_0x154ac0))['catch'](handleError(_0x3bcdc9,null));};exports['getTeams']=function(_0xf58d50,_0x5816ac,_0x2d0782){var _0x268e46={};var _0x2e1716={};var _0x530fc0;var _0x476f26;return db['FaxQueue'][_0xbeee('0x51')]({'where':{'id':_0xf58d50[_0xbeee('0x52')]['id']}})[_0xbeee('0x22')](handleEntityNotFound(_0x5816ac,null))[_0xbeee('0x22')](function(_0x276885){if(_0x276885){_0x530fc0=_0x276885;_0x2e1716['model']=_[_0xbeee('0x2e')](db[_0xbeee('0x61')]['rawAttributes']);_0x2e1716[_0xbeee('0x2f')]=_[_0xbeee('0x2e')](_0xf58d50[_0xbeee('0x2f')]);_0x2e1716[_0xbeee('0x30')]=_[_0xbeee('0x31')](_0x2e1716[_0xbeee('0x2d')],_0x2e1716['query']);_0x268e46['attributes']=_[_0xbeee('0x31')](_0x2e1716['model'],qs[_0xbeee('0x33')](_0xf58d50[_0xbeee('0x2f')]['fields']));_0x268e46[_0xbeee('0x32')]=_0x268e46[_0xbeee('0x32')][_0xbeee('0x42')]?_0x268e46[_0xbeee('0x32')]:_0x2e1716[_0xbeee('0x2d')];_0x268e46['order']=qs[_0xbeee('0x36')](_0xf58d50[_0xbeee('0x2f')][_0xbeee('0x36')]);_0x268e46['where']=qs[_0xbeee('0x30')](_[_0xbeee('0x55')](_0xf58d50[_0xbeee('0x2f')],_0x2e1716[_0xbeee('0x30')]));if(_0xf58d50[_0xbeee('0x2f')][_0xbeee('0x37')]){_0x268e46[_0xbeee('0x38')]=_['merge'](_0x268e46[_0xbeee('0x38')],{'$or':_[_0xbeee('0x2a')](_0x268e46[_0xbeee('0x32')],function(_0x509208){var _0x272c08={};_0x272c08[_0x509208]={'$like':'%'+_0xf58d50['query'][_0xbeee('0x37')]+'%'};return _0x272c08;})});}_0x268e46=_['merge']({},_0x268e46,_0xf58d50[_0xbeee('0x3c')]);return _0x530fc0[_0xbeee('0x62')](_0x268e46);}})[_0xbeee('0x22')](function(_0x10ac68){if(_0x10ac68){_0x476f26=_0x10ac68[_0xbeee('0x42')];if(!_0xf58d50[_0xbeee('0x2f')][_0xbeee('0x34')]('nolimit')){_0x268e46[_0xbeee('0x1e')]=qs[_0xbeee('0x1e')](_0xf58d50[_0xbeee('0x2f')][_0xbeee('0x1e')]);_0x268e46[_0xbeee('0x1d')]=qs[_0xbeee('0x1d')](_0xf58d50[_0xbeee('0x2f')]['offset']);}return _0x530fc0[_0xbeee('0x62')](_0x268e46);}})['then'](function(_0x1e4e6d){if(_0x1e4e6d){return _0x1e4e6d?{'count':_0x476f26,'rows':_0x1e4e6d}:null;}})[_0xbeee('0x22')](respondWithResult(_0x5816ac,null))['catch'](handleError(_0x5816ac,null));};exports[_0xbeee('0x63')]=function(_0x2cc52c,_0x36e224,_0x3313f2){var _0x5632fd=_0x2cc52c[_0xbeee('0x46')][_0xbeee('0x64')];return db[_0xbeee('0x61')]['findAll']({'where':{'id':_0x5632fd},'attributes':['id'],'include':[{'model':db[_0xbeee('0x58')],'as':'Agents','attributes':['id',_0xbeee('0x27'),_0xbeee('0x65'),_0xbeee('0x66'),_0xbeee('0x67')],'raw':!![]}]})[_0xbeee('0x22')](function(_0x320c0f){if(_0x320c0f){var _0x99693=_['flatMap'](_0x320c0f,function(_0x58288a){var _0x15ccde=_0x58288a[_0xbeee('0x24')]({'plain':!![]});return _0x15ccde[_0xbeee('0x68')];});return db[_0xbeee('0x3d')][_0xbeee('0x44')]({'where':{'id':_0x2cc52c[_0xbeee('0x52')]['id']}})['then'](function(_0x104d93){return db[_0xbeee('0x69')][_0xbeee('0x6a')](function(_0x439042){return _0x104d93[_0xbeee('0x63')](_0x5632fd,{'transaction':_0x439042})[_0xbeee('0x22')](function(){return BPromise[_0xbeee('0x6b')](_0x99693,function(_0x26d7df){return db['UserFaxQueue'][_0xbeee('0x6c')]({'where':{'UserId':_0x26d7df['id'],'FaxQueueId':_0x2cc52c[_0xbeee('0x52')]['id']},'transaction':_0x439042});});})['then'](function(){_0x99693[_0xbeee('0x6d')](function(_0x286092){socket['emit'](_0xbeee('0x6e'),{'UserId':_0x286092['id'],'FaxQueueId':_0x104d93['id']});});});});});}})[_0xbeee('0x22')](respondWithStatusCode(_0x36e224,null))[_0xbeee('0x40')](handleError(_0x36e224,null));};exports[_0xbeee('0x6f')]=function(_0x45a9e5,_0x52b2b2,_0x43f6e1){return db[_0xbeee('0x61')][_0xbeee('0x57')]({'where':{'id':_0x45a9e5[_0xbeee('0x2f')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbeee('0x68'),'attributes':['id'],'raw':!![]}]})[_0xbeee('0x22')](handleEntityNotFound(_0x52b2b2,null))[_0xbeee('0x22')](function(_0x3a3c48){var _0x231375=_['map'](_0x3a3c48,'id');var _0x45dfda=[];var _0x108d73=[];var _0x2665d0=squel['select']();_0x2665d0[_0xbeee('0x70')](_0xbeee('0x71'))[_0xbeee('0x72')](_0xbeee('0x73'),'tq')['join'](_0xbeee('0x74'),'ut',_0xbeee('0x75'))[_0xbeee('0x38')]('FaxQueueId\x20=\x20?',_0x45a9e5[_0xbeee('0x52')]['id']);for(var _0x26aaaa=0x0;_0x26aaaa<_0x3a3c48[_0xbeee('0x42')];_0x26aaaa+=0x1){let _0x579ce2=_0x3a3c48[_0x26aaaa];for(var _0x514a8f=0x0;_0x514a8f<_0x579ce2[_0xbeee('0x68')][_0xbeee('0x42')];_0x514a8f+=0x1){let _0x14cf31=_0x579ce2['Agents'][_0x514a8f];var _0x426601=_0x2665d0[_0xbeee('0x76')]();_0x426601[_0xbeee('0x38')](_0xbeee('0x77'),_0x14cf31['id']);_0x108d73[_0xbeee('0x78')](db[_0xbeee('0x69')]['query'](_0x426601[_0xbeee('0x79')](),{'type':db[_0xbeee('0x69')][_0xbeee('0x7a')]['SELECT']})['then'](function(_0x6904c2){if(_0x6904c2['length']===0x1){return _0x14cf31['id'];}else{var _0x90443c=_[_0xbeee('0x7b')](_['map'](_0x6904c2,'TeamId'),function(_0x2dadc6){return _[_0xbeee('0x7c')](_0x231375,_0x2dadc6);});if(_0x90443c){return _0x14cf31['id'];}}}));}}return BPromise[_0xbeee('0x7d')](_0x108d73)[_0xbeee('0x22')](function(_0x1f7823){_0x45dfda=_(_0x45dfda)[_0xbeee('0x7e')](_0x1f7823)[_0xbeee('0x7f')]()['value']();return db[_0xbeee('0x3d')]['find']({'where':{'id':_0x45a9e5[_0xbeee('0x52')]['id']}})[_0xbeee('0x22')](function(_0x44b0eb){return db['sequelize'][_0xbeee('0x6a')](function(_0x1530f2){return _0x44b0eb[_0xbeee('0x6f')](_0x45a9e5[_0xbeee('0x2f')][_0xbeee('0x64')],{'transaction':_0x1530f2})['then'](function(){if(!_[_0xbeee('0x80')](_0x45dfda)){return _0x44b0eb[_0xbeee('0x81')](_0x45dfda,{'transaction':_0x1530f2});}})['then'](function(){_0x45dfda[_0xbeee('0x6d')](function(_0x3ae423){socket[_0xbeee('0x82')](_0xbeee('0x83'),{'UserId':_0x3ae423,'FaxQueueId':_0x44b0eb['id']});});});});});});})[_0xbeee('0x22')](respondWithStatusCode(_0x52b2b2,null))['catch'](handleError(_0x52b2b2,null));};exports[_0xbeee('0x84')]=function(_0x3e38c0,_0x1d8078,_0x474464){return db[_0xbeee('0x3d')][_0xbeee('0x44')]({'where':{'id':_0x3e38c0[_0xbeee('0x52')]['id']}})['then'](handleEntityNotFound(_0x1d8078,null))[_0xbeee('0x22')](function(_0x594f7b){if(_0x594f7b){return _0x594f7b[_0xbeee('0x84')](_0x3e38c0[_0xbeee('0x46')]['ids'],_[_0xbeee('0x85')](_0x3e38c0[_0xbeee('0x46')],[_0xbeee('0x64'),'id'])||{})[_0xbeee('0x86')](function(_0x18bc14){for(var _0x2e04bb=0x0;_0x2e04bb<_0x3e38c0[_0xbeee('0x46')][_0xbeee('0x64')][_0xbeee('0x42')];_0x2e04bb+=0x1){socket[_0xbeee('0x82')](_0xbeee('0x6e'),{'UserId':_0x3e38c0[_0xbeee('0x46')]['ids'][_0x2e04bb],'FaxQueueId':_0x3e38c0[_0xbeee('0x52')]['id']});}return _0x18bc14;});}})['then'](respondWithResult(_0x1d8078,null))[_0xbeee('0x40')](handleError(_0x1d8078,null));};exports[_0xbeee('0x81')]=function(_0xab08eb,_0x119bb3,_0xb4e81){return db['FaxQueue'][_0xbeee('0x44')]({'where':{'id':_0xab08eb[_0xbeee('0x52')]['id']}})['then'](handleEntityNotFound(_0x119bb3,null))[_0xbeee('0x22')](function(_0x3bbaf1){if(_0x3bbaf1){return _0x3bbaf1[_0xbeee('0x81')](_0xab08eb['query'][_0xbeee('0x64')])[_0xbeee('0x22')](function(){if(_[_0xbeee('0x87')](_0xab08eb[_0xbeee('0x2f')]['ids'])){for(var _0x3ed4d1=0x0;_0x3ed4d1<_0xab08eb[_0xbeee('0x2f')][_0xbeee('0x64')]['length'];_0x3ed4d1+=0x1){socket[_0xbeee('0x82')]('userFaxQueue:remove',{'UserId':Number(_0xab08eb[_0xbeee('0x2f')][_0xbeee('0x64')][_0x3ed4d1]),'FaxQueueId':Number(_0xab08eb[_0xbeee('0x52')]['id'])});}}else{socket[_0xbeee('0x82')](_0xbeee('0x83'),{'UserId':Number(_0xab08eb[_0xbeee('0x2f')][_0xbeee('0x64')]),'FaxQueueId':Number(_0xab08eb[_0xbeee('0x52')]['id'])});}});}})[_0xbeee('0x22')](respondWithStatusCode(_0x119bb3,null))['catch'](handleError(_0x119bb3,null));};exports[_0xbeee('0x88')]=function(_0x7e17aa,_0x4359cd,_0x34550b){var _0x2360c5={};var _0xf17688={};var _0x2cd8bd;var _0x142725;return db['FaxQueue'][_0xbeee('0x51')]({'where':{'id':_0x7e17aa['params']['id']}})['then'](handleEntityNotFound(_0x4359cd,null))[_0xbeee('0x22')](function(_0x30494c){if(_0x30494c){_0x2cd8bd=_0x30494c;_0xf17688[_0xbeee('0x2d')]=_[_0xbeee('0x2e')](db['User'][_0xbeee('0x2b')]);_0xf17688[_0xbeee('0x2f')]=_[_0xbeee('0x2e')](_0x7e17aa[_0xbeee('0x2f')]);_0xf17688[_0xbeee('0x30')]=_[_0xbeee('0x31')](_0xf17688['model'],_0xf17688[_0xbeee('0x2f')]);_0x2360c5[_0xbeee('0x32')]=_[_0xbeee('0x31')](_0xf17688[_0xbeee('0x2d')],qs[_0xbeee('0x33')](_0x7e17aa[_0xbeee('0x2f')][_0xbeee('0x33')]));_0x2360c5[_0xbeee('0x32')]=_0x2360c5[_0xbeee('0x32')]['length']?_0x2360c5[_0xbeee('0x32')]:_0xf17688[_0xbeee('0x2d')];_0x2360c5[_0xbeee('0x35')]=qs[_0xbeee('0x36')](_0x7e17aa[_0xbeee('0x2f')][_0xbeee('0x36')]);_0x2360c5[_0xbeee('0x38')]=qs[_0xbeee('0x30')](_['pick'](_0x7e17aa['query'],_0xf17688[_0xbeee('0x30')]));if(_0x7e17aa[_0xbeee('0x2f')][_0xbeee('0x37')]){_0x2360c5[_0xbeee('0x38')]=_[_0xbeee('0x39')](_0x2360c5[_0xbeee('0x38')],{'$or':_[_0xbeee('0x2a')](_0x2360c5[_0xbeee('0x32')],function(_0x46b9b9){var _0x173e46={};_0x173e46[_0x46b9b9]={'$like':'%'+_0x7e17aa[_0xbeee('0x2f')]['filter']+'%'};return _0x173e46;})});}_0x2360c5=_[_0xbeee('0x39')]({},_0x2360c5,_0x7e17aa[_0xbeee('0x3c')]);return _0x2cd8bd[_0xbeee('0x88')](_0x2360c5);}})[_0xbeee('0x22')](function(_0x495357){if(_0x495357){_0x142725=_0x495357[_0xbeee('0x42')];if(!_0x7e17aa[_0xbeee('0x2f')][_0xbeee('0x34')](_0xbeee('0x54'))){_0x2360c5[_0xbeee('0x1e')]=qs[_0xbeee('0x1e')](_0x7e17aa[_0xbeee('0x2f')][_0xbeee('0x1e')]);_0x2360c5[_0xbeee('0x1d')]=qs['offset'](_0x7e17aa[_0xbeee('0x2f')]['offset']);}return _0x2cd8bd[_0xbeee('0x88')](_0x2360c5);}})[_0xbeee('0x22')](function(_0x21bac4){if(_0x21bac4){return _0x21bac4?{'count':_0x142725,'rows':_0x21bac4}:null;}})['then'](respondWithResult(_0x4359cd,null))[_0xbeee('0x40')](handleError(_0x4359cd,null));};
\ No newline at end of file
+var _0x5324=['describe','getMembers','findOne','nolimit','pick','FaxQueueId','UserFaxQueue','User','findAndCountAll','UserId','updatedAt','createdAt','%s/%s','SIP','faxPause','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','every','TeamId','all','union','value','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','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','../../config/environment','redis','defaults','localhost','./faxQueue.socket','register','end','status','json','offset','set','Content-Range','apply','save','update','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','FaxQueue','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filter','merge','type','VIRTUAL','count','findAll','rows','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x4d8e53,_0x2951f0){var _0x4013dc=function(_0x4f4110){while(--_0x4f4110){_0x4d8e53['push'](_0x4d8e53['shift']());}};_0x4013dc(++_0x2951f0);}(_0x5324,0x154));var _0x4532=function(_0x32ac61,_0x55bb4a){_0x32ac61=_0x32ac61-0x0;var _0x32fe89=_0x5324[_0x32ac61];return _0x32fe89;};'use strict';var pdf=require(_0x4532('0x0'));var emlformat=require(_0x4532('0x1'));var rimraf=require(_0x4532('0x2'));var zipdir=require(_0x4532('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4532('0x4'));var moment=require('moment');var BPromise=require(_0x4532('0x5'));var Mustache=require(_0x4532('0x6'));var util=require(_0x4532('0x7'));var path=require(_0x4532('0x8'));var sox=require(_0x4532('0x9'));var csv=require(_0x4532('0xa'));var ejs=require(_0x4532('0xb'));var fs=require('fs');var _=require(_0x4532('0xc'));var squel=require('squel');var crypto=require(_0x4532('0xd'));var jsforce=require(_0x4532('0xe'));var deskjs=require(_0x4532('0xf'));var toCsv=require(_0x4532('0xa'));var querystring=require(_0x4532('0x10'));var Papa=require(_0x4532('0x11'));var Redis=require(_0x4532('0x12'));var authService=require(_0x4532('0x13'));var qs=require(_0x4532('0x14'));var as=require(_0x4532('0x15'));var hardwareService=require(_0x4532('0x16'));var logger=require(_0x4532('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x4532('0x18'));var db=require('../../mysqldb')['db'];config[_0x4532('0x19')]=_[_0x4532('0x1a')](config[_0x4532('0x19')],{'host':_0x4532('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4532('0x19')]));require(_0x4532('0x1c'))[_0x4532('0x1d')](socket);function respondWithStatusCode(_0x2e0b21,_0x19eaf3){_0x19eaf3=_0x19eaf3||0xcc;return function(_0x525f96){if(_0x525f96){return _0x2e0b21['sendStatus'](_0x19eaf3);}return _0x2e0b21['status'](_0x19eaf3)[_0x4532('0x1e')]();};}function respondWithResult(_0x19ea01,_0x2dedca){_0x2dedca=_0x2dedca||0xc8;return function(_0x3b97ee){if(_0x3b97ee){return _0x19ea01[_0x4532('0x1f')](_0x2dedca)[_0x4532('0x20')](_0x3b97ee);}};}function respondWithFilteredResult(_0x2a79ec,_0x4036b6){return function(_0xd479a9){if(_0xd479a9){var _0x4db2a1=_0xd479a9['count'],_0x281ab6=_0x4036b6[_0x4532('0x21')],_0x469c5a=_0x4036b6[_0x4532('0x21')]+_0x4036b6['limit'],_0x250ba4;if(_0x469c5a>=_0x4db2a1){_0x469c5a=_0x4db2a1;_0x250ba4=0xc8;}else{_0x250ba4=0xce;}_0x2a79ec[_0x4532('0x1f')](_0x250ba4);return _0x2a79ec[_0x4532('0x22')](_0x4532('0x23'),_0x281ab6+'-'+_0x469c5a+'/'+_0x4db2a1)[_0x4532('0x20')](_0xd479a9);}return null;};}function patchUpdates(_0x3f677b){return function(_0x30a1e1){try{jsonpatch[_0x4532('0x24')](_0x30a1e1,_0x3f677b,!![]);}catch(_0x53127c){return BPromise['reject'](_0x53127c);}return _0x30a1e1[_0x4532('0x25')]();};}function saveUpdates(_0x46dc73,_0x481c26){return function(_0x1c383c){if(_0x1c383c){return _0x1c383c[_0x4532('0x26')](_0x46dc73)[_0x4532('0x27')](function(_0xed85b1){return _0xed85b1;});}return null;};}function removeEntity(_0x4fd4bd,_0xbf825a){return function(_0x571e56){if(_0x571e56){return _0x571e56[_0x4532('0x28')]()[_0x4532('0x27')](function(){var _0x16e2c4=_0x571e56[_0x4532('0x29')]({'plain':!![]});var _0x40e42f=_0x4532('0x2a');return db[_0x4532('0x2b')][_0x4532('0x28')]({'where':{'type':_0x40e42f,'resourceId':_0x16e2c4['id']}})['then'](function(){return _0x571e56;});})['then'](function(){_0x4fd4bd[_0x4532('0x1f')](0xcc)[_0x4532('0x1e')]();});}};}function handleEntityNotFound(_0x60203f,_0x19f85c){return function(_0x19fdea){if(!_0x19fdea){_0x60203f[_0x4532('0x2c')](0x194);}return _0x19fdea;};}function handleError(_0x4a810d,_0x3de0ee){_0x3de0ee=_0x3de0ee||0x1f4;return function(_0x239e85){logger[_0x4532('0x2d')](_0x239e85[_0x4532('0x2e')]);if(_0x239e85[_0x4532('0x2f')]){delete _0x239e85['name'];}_0x4a810d[_0x4532('0x1f')](_0x3de0ee)[_0x4532('0x30')](_0x239e85);};}exports[_0x4532('0x31')]=function(_0x523f96,_0x58602d){var _0x5b1bab={},_0x3e4c89={},_0x24ab08={'count':0x0,'rows':[]};var _0x3468bb=_[_0x4532('0x32')](db[_0x4532('0x33')][_0x4532('0x34')],function(_0x20dfd0){return{'name':_0x20dfd0['fieldName'],'type':_0x20dfd0['type'][_0x4532('0x35')]};});_0x3e4c89[_0x4532('0x36')]=_['map'](_0x3468bb,_0x4532('0x2f'));_0x3e4c89[_0x4532('0x37')]=_[_0x4532('0x38')](_0x523f96[_0x4532('0x37')]);_0x3e4c89[_0x4532('0x39')]=_[_0x4532('0x3a')](_0x3e4c89[_0x4532('0x36')],_0x3e4c89[_0x4532('0x37')]);_0x5b1bab['attributes']=_['intersection'](_0x3e4c89[_0x4532('0x36')],qs[_0x4532('0x3b')](_0x523f96['query'][_0x4532('0x3b')]));_0x5b1bab[_0x4532('0x3c')]=_0x5b1bab[_0x4532('0x3c')][_0x4532('0x3d')]?_0x5b1bab['attributes']:_0x3e4c89[_0x4532('0x36')];if(!_0x523f96['query'][_0x4532('0x3e')]('nolimit')){_0x5b1bab[_0x4532('0x3f')]=qs[_0x4532('0x3f')](_0x523f96[_0x4532('0x37')][_0x4532('0x3f')]);_0x5b1bab[_0x4532('0x21')]=qs[_0x4532('0x21')](_0x523f96[_0x4532('0x37')][_0x4532('0x21')]);}_0x5b1bab[_0x4532('0x40')]=qs[_0x4532('0x41')](_0x523f96[_0x4532('0x37')]['sort']);_0x5b1bab[_0x4532('0x42')]=qs['filters'](_['pick'](_0x523f96[_0x4532('0x37')],_0x3e4c89['filters']),_0x3468bb);if(_0x523f96[_0x4532('0x37')][_0x4532('0x43')]){_0x5b1bab[_0x4532('0x42')]=_[_0x4532('0x44')](_0x5b1bab[_0x4532('0x42')],{'$or':_['map'](_0x3468bb,function(_0x51e813){if(_0x51e813[_0x4532('0x45')]!==_0x4532('0x46')){var _0x589199={};_0x589199[_0x51e813[_0x4532('0x2f')]]={'$like':'%'+_0x523f96['query'][_0x4532('0x43')]+'%'};return _0x589199;}})});}_0x5b1bab=_[_0x4532('0x44')]({},_0x5b1bab,_0x523f96['options']);var _0x527019={'where':_0x5b1bab[_0x4532('0x42')]};return db[_0x4532('0x33')][_0x4532('0x47')](_0x527019)['then'](function(_0x22fffe){_0x24ab08[_0x4532('0x47')]=_0x22fffe;if(_0x523f96[_0x4532('0x37')]['includeAll']){_0x5b1bab['include']=[{'all':!![]}];}return db[_0x4532('0x33')][_0x4532('0x48')](_0x5b1bab);})[_0x4532('0x27')](function(_0x59b4bb){_0x24ab08[_0x4532('0x49')]=_0x59b4bb;return _0x24ab08;})[_0x4532('0x27')](respondWithFilteredResult(_0x58602d,_0x5b1bab))[_0x4532('0x4a')](handleError(_0x58602d,null));};exports[_0x4532('0x4b')]=function(_0x5c75ff,_0x4ced14){var _0x3326cf={'raw':!![],'where':{'id':_0x5c75ff[_0x4532('0x4c')]['id']}},_0x1be411={};_0x1be411[_0x4532('0x36')]=_['keys'](db[_0x4532('0x33')][_0x4532('0x34')]);_0x1be411[_0x4532('0x37')]=_[_0x4532('0x38')](_0x5c75ff[_0x4532('0x37')]);_0x1be411['filters']=_[_0x4532('0x3a')](_0x1be411[_0x4532('0x36')],_0x1be411[_0x4532('0x37')]);_0x3326cf[_0x4532('0x3c')]=_[_0x4532('0x3a')](_0x1be411[_0x4532('0x36')],qs[_0x4532('0x3b')](_0x5c75ff['query'][_0x4532('0x3b')]));_0x3326cf['attributes']=_0x3326cf['attributes'][_0x4532('0x3d')]?_0x3326cf[_0x4532('0x3c')]:_0x1be411['model'];if(_0x5c75ff['query'][_0x4532('0x4d')]){_0x3326cf['include']=[{'all':!![]}];}_0x3326cf=_[_0x4532('0x44')]({},_0x3326cf,_0x5c75ff[_0x4532('0x4e')]);return db[_0x4532('0x33')][_0x4532('0x4f')](_0x3326cf)[_0x4532('0x27')](handleEntityNotFound(_0x4ced14,null))['then'](respondWithResult(_0x4ced14,null))[_0x4532('0x4a')](handleError(_0x4ced14,null));};exports[_0x4532('0x50')]=function(_0x31501d,_0x53fd01){return db[_0x4532('0x33')]['create'](_0x31501d[_0x4532('0x51')],{})['then'](function(_0x2a4a61){var _0x1cfb76=_0x31501d[_0x4532('0x52')][_0x4532('0x29')]({'plain':!![]});if(!_0x1cfb76)throw new Error(_0x4532('0x53'));if(_0x1cfb76[_0x4532('0x54')]===_0x4532('0x52')){var _0x4ac4d4=_0x2a4a61[_0x4532('0x29')]({'plain':!![]});var _0x2529c3=_0x4532('0x2a');return db[_0x4532('0x55')][_0x4532('0x4f')]({'where':{'name':_0x2529c3,'userProfileId':_0x1cfb76[_0x4532('0x56')]},'raw':!![]})['then'](function(_0x2bf4fa){if(_0x2bf4fa&&_0x2bf4fa[_0x4532('0x57')]===0x0){return db[_0x4532('0x2b')][_0x4532('0x50')]({'name':_0x4ac4d4[_0x4532('0x2f')],'resourceId':_0x4ac4d4['id'],'type':_0x2bf4fa[_0x4532('0x2f')],'sectionId':_0x2bf4fa['id']},{})['then'](function(){return _0x2a4a61;});}else{return _0x2a4a61;}})['catch'](function(_0x4e7679){logger[_0x4532('0x2d')](_0x4532('0x58'),_0x4e7679);throw _0x4e7679;});}return _0x2a4a61;})[_0x4532('0x27')](respondWithResult(_0x53fd01,0xc9))[_0x4532('0x4a')](handleError(_0x53fd01,null));};exports['update']=function(_0x3810f3,_0x463ed6){if(_0x3810f3[_0x4532('0x51')]['id']){delete _0x3810f3[_0x4532('0x51')]['id'];}return db[_0x4532('0x33')][_0x4532('0x4f')]({'where':{'id':_0x3810f3[_0x4532('0x4c')]['id']}})[_0x4532('0x27')](handleEntityNotFound(_0x463ed6,null))[_0x4532('0x27')](saveUpdates(_0x3810f3[_0x4532('0x51')],null))[_0x4532('0x27')](respondWithResult(_0x463ed6,null))[_0x4532('0x4a')](handleError(_0x463ed6,null));};exports[_0x4532('0x28')]=function(_0xeb5e89,_0x3daa47){return db[_0x4532('0x33')][_0x4532('0x4f')]({'where':{'id':_0xeb5e89['params']['id']}})[_0x4532('0x27')](handleEntityNotFound(_0x3daa47,null))[_0x4532('0x27')](removeEntity(_0x3daa47,null))['catch'](handleError(_0x3daa47,null));};exports[_0x4532('0x59')]=function(_0x15a6f7,_0x585437){return db[_0x4532('0x33')][_0x4532('0x59')]()[_0x4532('0x27')](respondWithResult(_0x585437,null))['catch'](handleError(_0x585437,null));};exports[_0x4532('0x5a')]=function(_0x4ca59f,_0x1913cd,_0xa75fd6){var _0x4fb50f={'raw':!![],'where':{}},_0x428e46={},_0x466c32;return db[_0x4532('0x33')][_0x4532('0x5b')]({'where':{'id':_0x4ca59f[_0x4532('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1913cd,null))[_0x4532('0x27')](function(_0x39da10){if(_0x39da10){_0x466c32=_0x39da10[_0x4532('0x29')]({'plain':!![]});_0x428e46['model']=_['keys'](db['UserFaxQueue'][_0x4532('0x34')]);_0x428e46['query']=_[_0x4532('0x38')](_0x4ca59f[_0x4532('0x37')]);_0x428e46['filters']=_[_0x4532('0x3a')](_0x428e46[_0x4532('0x36')],_0x428e46[_0x4532('0x37')]);_0x4fb50f[_0x4532('0x3c')]=_[_0x4532('0x3a')](_0x428e46[_0x4532('0x36')],qs[_0x4532('0x3b')](_0x4ca59f[_0x4532('0x37')][_0x4532('0x3b')]));_0x4fb50f[_0x4532('0x3c')]=_0x4fb50f['attributes'][_0x4532('0x3d')]?_0x4fb50f['attributes']:_0x428e46['model'];if(!_0x4ca59f['query'][_0x4532('0x3e')](_0x4532('0x5c'))){_0x4fb50f[_0x4532('0x3f')]=qs[_0x4532('0x3f')](_0x4ca59f['query'][_0x4532('0x3f')]);_0x4fb50f['offset']=qs[_0x4532('0x21')](_0x4ca59f[_0x4532('0x37')][_0x4532('0x21')]);}_0x4fb50f[_0x4532('0x40')]=qs[_0x4532('0x41')](_0x4ca59f[_0x4532('0x37')][_0x4532('0x41')]);_0x4fb50f['where']=qs[_0x4532('0x39')](_[_0x4532('0x5d')](_0x4ca59f[_0x4532('0x37')],_0x428e46[_0x4532('0x39')]));_0x4fb50f['where'][_0x4532('0x5e')]=_0x39da10['id'];if(_0x4ca59f[_0x4532('0x37')]['filter']){_0x4fb50f[_0x4532('0x42')]=_['merge'](_0x4fb50f[_0x4532('0x42')],{'$or':_[_0x4532('0x32')](_0x4fb50f[_0x4532('0x3c')],function(_0x204b62){var _0x2eb38e={};_0x2eb38e[_0x204b62]={'$like':'%'+_0x4ca59f[_0x4532('0x37')][_0x4532('0x43')]+'%'};return _0x2eb38e;})});}_0x4fb50f=_['merge']({},_0x4fb50f,_0x4ca59f['options']);return db[_0x4532('0x5f')][_0x4532('0x48')](_0x4fb50f);}})[_0x4532('0x27')](function(_0x4e4b16){if(_0x4e4b16){return db[_0x4532('0x60')][_0x4532('0x61')]({'where':{'id':_[_0x4532('0x32')](_0x4e4b16,_0x4532('0x62')),'role':'agent'},'attributes':['id',_0x4532('0x2f'),'faxPause',_0x4532('0x63'),_0x4532('0x64')]});}})['then'](function(_0x430b45){if(_0x430b45){return{'count':_0x430b45[_0x4532('0x47')],'rows':_['map'](_0x430b45[_0x4532('0x49')],function(_0x242e03){return{'membername':_0x242e03['name'],'UserId':_0x242e03['id'],'queue_name':_0x466c32[_0x4532('0x2f')],'FaxQueueId':_0x466c32['id'],'interface':util['format'](_0x4532('0x65'),_0x4532('0x66'),_0x242e03[_0x4532('0x2f')]),'penalty':0x0,'paused':_0x242e03[_0x4532('0x67')],'createdAt':_0x242e03['createdAt'],'updatedAt':_0x242e03['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4532('0x27')](respondWithFilteredResult(_0x1913cd,_0x4fb50f))['catch'](handleError(_0x1913cd,null));};exports['getTeams']=function(_0x3013c8,_0x27c5ef,_0x149101){var _0x14e583={};var _0x2f62a0={};var _0x3be620;var _0x46524d;return db[_0x4532('0x33')][_0x4532('0x5b')]({'where':{'id':_0x3013c8[_0x4532('0x4c')]['id']}})[_0x4532('0x27')](handleEntityNotFound(_0x27c5ef,null))[_0x4532('0x27')](function(_0x2a34b6){if(_0x2a34b6){_0x3be620=_0x2a34b6;_0x2f62a0['model']=_[_0x4532('0x38')](db[_0x4532('0x68')]['rawAttributes']);_0x2f62a0[_0x4532('0x37')]=_[_0x4532('0x38')](_0x3013c8[_0x4532('0x37')]);_0x2f62a0['filters']=_[_0x4532('0x3a')](_0x2f62a0['model'],_0x2f62a0['query']);_0x14e583['attributes']=_['intersection'](_0x2f62a0[_0x4532('0x36')],qs[_0x4532('0x3b')](_0x3013c8[_0x4532('0x37')]['fields']));_0x14e583[_0x4532('0x3c')]=_0x14e583[_0x4532('0x3c')][_0x4532('0x3d')]?_0x14e583[_0x4532('0x3c')]:_0x2f62a0[_0x4532('0x36')];_0x14e583[_0x4532('0x40')]=qs['sort'](_0x3013c8['query'][_0x4532('0x41')]);_0x14e583[_0x4532('0x42')]=qs[_0x4532('0x39')](_[_0x4532('0x5d')](_0x3013c8[_0x4532('0x37')],_0x2f62a0[_0x4532('0x39')]));if(_0x3013c8[_0x4532('0x37')][_0x4532('0x43')]){_0x14e583['where']=_['merge'](_0x14e583[_0x4532('0x42')],{'$or':_[_0x4532('0x32')](_0x14e583[_0x4532('0x3c')],function(_0x11b4f6){var _0x3d76e6={};_0x3d76e6[_0x11b4f6]={'$like':'%'+_0x3013c8[_0x4532('0x37')][_0x4532('0x43')]+'%'};return _0x3d76e6;})});}_0x14e583=_['merge']({},_0x14e583,_0x3013c8[_0x4532('0x4e')]);return _0x3be620[_0x4532('0x69')](_0x14e583);}})['then'](function(_0x4208ba){if(_0x4208ba){_0x46524d=_0x4208ba[_0x4532('0x3d')];if(!_0x3013c8[_0x4532('0x37')][_0x4532('0x3e')]('nolimit')){_0x14e583[_0x4532('0x3f')]=qs[_0x4532('0x3f')](_0x3013c8[_0x4532('0x37')][_0x4532('0x3f')]);_0x14e583[_0x4532('0x21')]=qs[_0x4532('0x21')](_0x3013c8['query'][_0x4532('0x21')]);}return _0x3be620['getTeams'](_0x14e583);}})[_0x4532('0x27')](function(_0x1cd202){if(_0x1cd202){return _0x1cd202?{'count':_0x46524d,'rows':_0x1cd202}:null;}})[_0x4532('0x27')](respondWithResult(_0x27c5ef,null))[_0x4532('0x4a')](handleError(_0x27c5ef,null));};exports[_0x4532('0x6a')]=function(_0x59c92b,_0x35541e,_0x8194e1){var _0x2637e1=_0x59c92b[_0x4532('0x51')][_0x4532('0x6b')];return db[_0x4532('0x68')]['findAll']({'where':{'id':_0x2637e1},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4532('0x6c'),'attributes':['id','name',_0x4532('0x6d'),_0x4532('0x6e'),_0x4532('0x6f')],'raw':!![]}]})[_0x4532('0x27')](function(_0xc8c74d){if(_0xc8c74d){var _0x29d8ae=_[_0x4532('0x70')](_0xc8c74d,function(_0x4b828f){var _0x2dbd0a=_0x4b828f[_0x4532('0x29')]({'plain':!![]});return _0x2dbd0a[_0x4532('0x6c')];});return db['FaxQueue']['find']({'where':{'id':_0x59c92b[_0x4532('0x4c')]['id']}})[_0x4532('0x27')](function(_0x26b03c){return db[_0x4532('0x71')][_0x4532('0x72')](function(_0xecfd81){return _0x26b03c[_0x4532('0x6a')](_0x2637e1,{'transaction':_0xecfd81})['then'](function(){return BPromise[_0x4532('0x73')](_0x29d8ae,function(_0xfee512){return db[_0x4532('0x5f')][_0x4532('0x74')]({'where':{'UserId':_0xfee512['id'],'FaxQueueId':_0x59c92b[_0x4532('0x4c')]['id']},'transaction':_0xecfd81});});})[_0x4532('0x27')](function(){_0x29d8ae['forEach'](function(_0x315b46){socket[_0x4532('0x75')]('userFaxQueue:save',{'UserId':_0x315b46['id'],'FaxQueueId':_0x26b03c['id']});});});});});}})[_0x4532('0x27')](respondWithStatusCode(_0x35541e,null))['catch'](handleError(_0x35541e,null));};exports[_0x4532('0x76')]=function(_0x1d4064,_0x4f079d,_0x3a5cb3){return db['Team'][_0x4532('0x48')]({'where':{'id':_0x1d4064['query'][_0x4532('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x4532('0x60')],'as':_0x4532('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x4532('0x27')](handleEntityNotFound(_0x4f079d,null))[_0x4532('0x27')](function(_0x415e0a){var _0xb92ad=_['map'](_0x415e0a,'id');var _0x13de2a=[];var _0x56f035=[];var _0x160a22=squel['select']();_0x160a22[_0x4532('0x77')](_0x4532('0x78'))[_0x4532('0x79')](_0x4532('0x7a'),'tq')[_0x4532('0x7b')](_0x4532('0x7c'),'ut',_0x4532('0x7d'))[_0x4532('0x42')]('FaxQueueId\x20=\x20?',_0x1d4064[_0x4532('0x4c')]['id']);for(var _0x32fe92=0x0;_0x32fe92<_0x415e0a[_0x4532('0x3d')];_0x32fe92+=0x1){let _0x15e45f=_0x415e0a[_0x32fe92];for(var _0x38c1a1=0x0;_0x38c1a1<_0x15e45f[_0x4532('0x6c')][_0x4532('0x3d')];_0x38c1a1+=0x1){let _0x3e9b6d=_0x15e45f['Agents'][_0x38c1a1];var _0x12a2c1=_0x160a22[_0x4532('0x7e')]();_0x12a2c1[_0x4532('0x42')]('ut.UserId\x20=\x20?',_0x3e9b6d['id']);_0x56f035[_0x4532('0x7f')](db[_0x4532('0x71')][_0x4532('0x37')](_0x12a2c1[_0x4532('0x80')](),{'type':db[_0x4532('0x71')][_0x4532('0x81')]['SELECT']})[_0x4532('0x27')](function(_0x22c17c){if(_0x22c17c[_0x4532('0x3d')]===0x1){return _0x3e9b6d['id'];}else{var _0xbf5eea=_[_0x4532('0x82')](_[_0x4532('0x32')](_0x22c17c,_0x4532('0x83')),function(_0x3c64ac){return _['includes'](_0xb92ad,_0x3c64ac);});if(_0xbf5eea){return _0x3e9b6d['id'];}}}));}}return BPromise[_0x4532('0x84')](_0x56f035)[_0x4532('0x27')](function(_0x47abe7){_0x13de2a=_(_0x13de2a)[_0x4532('0x85')](_0x47abe7)['compact']()[_0x4532('0x86')]();return db['FaxQueue'][_0x4532('0x4f')]({'where':{'id':_0x1d4064[_0x4532('0x4c')]['id']}})[_0x4532('0x27')](function(_0x16081f){return db[_0x4532('0x71')][_0x4532('0x72')](function(_0x29a4fc){return _0x16081f[_0x4532('0x76')](_0x1d4064[_0x4532('0x37')]['ids'],{'transaction':_0x29a4fc})[_0x4532('0x27')](function(){if(!_[_0x4532('0x87')](_0x13de2a)){return _0x16081f[_0x4532('0x88')](_0x13de2a,{'transaction':_0x29a4fc});}})[_0x4532('0x27')](function(){_0x13de2a[_0x4532('0x89')](function(_0x45ff24){socket['emit'](_0x4532('0x8a'),{'UserId':_0x45ff24,'FaxQueueId':_0x16081f['id']});});});});});});})[_0x4532('0x27')](respondWithStatusCode(_0x4f079d,null))[_0x4532('0x4a')](handleError(_0x4f079d,null));};exports[_0x4532('0x8b')]=function(_0x1c81ba,_0x121c7e,_0x5770a5){return db[_0x4532('0x33')]['find']({'where':{'id':_0x1c81ba[_0x4532('0x4c')]['id']}})[_0x4532('0x27')](handleEntityNotFound(_0x121c7e,null))[_0x4532('0x27')](function(_0x23d6d0){if(_0x23d6d0){return _0x23d6d0[_0x4532('0x8b')](_0x1c81ba[_0x4532('0x51')][_0x4532('0x6b')],_['omit'](_0x1c81ba['body'],[_0x4532('0x6b'),'id'])||{})[_0x4532('0x8c')](function(_0x445954){for(var _0x4b299d=0x0;_0x4b299d<_0x1c81ba[_0x4532('0x51')][_0x4532('0x6b')][_0x4532('0x3d')];_0x4b299d+=0x1){socket[_0x4532('0x75')]('userFaxQueue:save',{'UserId':_0x1c81ba['body'][_0x4532('0x6b')][_0x4b299d],'FaxQueueId':_0x1c81ba[_0x4532('0x4c')]['id']});}return _0x445954;});}})[_0x4532('0x27')](respondWithResult(_0x121c7e,null))[_0x4532('0x4a')](handleError(_0x121c7e,null));};exports[_0x4532('0x88')]=function(_0x2b5932,_0x4e0433,_0x35f1b0){return db[_0x4532('0x33')][_0x4532('0x4f')]({'where':{'id':_0x2b5932[_0x4532('0x4c')]['id']}})[_0x4532('0x27')](handleEntityNotFound(_0x4e0433,null))[_0x4532('0x27')](function(_0x4d38e0){if(_0x4d38e0){return _0x4d38e0[_0x4532('0x88')](_0x2b5932['query']['ids'])[_0x4532('0x27')](function(){if(_[_0x4532('0x8d')](_0x2b5932['query'][_0x4532('0x6b')])){for(var _0xdea853=0x0;_0xdea853<_0x2b5932[_0x4532('0x37')][_0x4532('0x6b')][_0x4532('0x3d')];_0xdea853+=0x1){socket[_0x4532('0x75')](_0x4532('0x8a'),{'UserId':Number(_0x2b5932[_0x4532('0x37')][_0x4532('0x6b')][_0xdea853]),'FaxQueueId':Number(_0x2b5932[_0x4532('0x4c')]['id'])});}}else{socket['emit'](_0x4532('0x8a'),{'UserId':Number(_0x2b5932[_0x4532('0x37')][_0x4532('0x6b')]),'FaxQueueId':Number(_0x2b5932[_0x4532('0x4c')]['id'])});}});}})[_0x4532('0x27')](respondWithStatusCode(_0x4e0433,null))[_0x4532('0x4a')](handleError(_0x4e0433,null));};exports[_0x4532('0x8e')]=function(_0x292a82,_0x64f9ea,_0x42db0a){var _0x491f9a={};var _0x1f25da={};var _0x22cae2;var _0x1f314d;return db[_0x4532('0x33')]['findOne']({'where':{'id':_0x292a82[_0x4532('0x4c')]['id']}})['then'](handleEntityNotFound(_0x64f9ea,null))[_0x4532('0x27')](function(_0x37fdf4){if(_0x37fdf4){_0x22cae2=_0x37fdf4;_0x1f25da[_0x4532('0x36')]=_['keys'](db[_0x4532('0x60')][_0x4532('0x34')]);_0x1f25da[_0x4532('0x37')]=_[_0x4532('0x38')](_0x292a82[_0x4532('0x37')]);_0x1f25da[_0x4532('0x39')]=_[_0x4532('0x3a')](_0x1f25da['model'],_0x1f25da['query']);_0x491f9a['attributes']=_[_0x4532('0x3a')](_0x1f25da[_0x4532('0x36')],qs[_0x4532('0x3b')](_0x292a82['query'][_0x4532('0x3b')]));_0x491f9a[_0x4532('0x3c')]=_0x491f9a[_0x4532('0x3c')]['length']?_0x491f9a[_0x4532('0x3c')]:_0x1f25da[_0x4532('0x36')];_0x491f9a[_0x4532('0x40')]=qs[_0x4532('0x41')](_0x292a82[_0x4532('0x37')][_0x4532('0x41')]);_0x491f9a[_0x4532('0x42')]=qs[_0x4532('0x39')](_['pick'](_0x292a82[_0x4532('0x37')],_0x1f25da[_0x4532('0x39')]));if(_0x292a82[_0x4532('0x37')][_0x4532('0x43')]){_0x491f9a[_0x4532('0x42')]=_[_0x4532('0x44')](_0x491f9a[_0x4532('0x42')],{'$or':_[_0x4532('0x32')](_0x491f9a[_0x4532('0x3c')],function(_0x152a14){var _0x87dc1={};_0x87dc1[_0x152a14]={'$like':'%'+_0x292a82[_0x4532('0x37')][_0x4532('0x43')]+'%'};return _0x87dc1;})});}_0x491f9a=_[_0x4532('0x44')]({},_0x491f9a,_0x292a82[_0x4532('0x4e')]);return _0x22cae2[_0x4532('0x8e')](_0x491f9a);}})[_0x4532('0x27')](function(_0x455a06){if(_0x455a06){_0x1f314d=_0x455a06[_0x4532('0x3d')];if(!_0x292a82[_0x4532('0x37')][_0x4532('0x3e')]('nolimit')){_0x491f9a[_0x4532('0x3f')]=qs['limit'](_0x292a82['query'][_0x4532('0x3f')]);_0x491f9a[_0x4532('0x21')]=qs[_0x4532('0x21')](_0x292a82[_0x4532('0x37')][_0x4532('0x21')]);}return _0x22cae2[_0x4532('0x8e')](_0x491f9a);}})[_0x4532('0x27')](function(_0x2d0b6a){if(_0x2d0b6a){return _0x2d0b6a?{'count':_0x1f314d,'rows':_0x2d0b6a}:null;}})['then'](respondWithResult(_0x64f9ea,null))[_0x4532('0x4a')](handleError(_0x64f9ea,null));};
\ No newline at end of file
index 2aca9f8..82d3bb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bda=['update','remove','emit','hook','events','../../mysqldb','FaxQueue','save'];(function(_0x2bf1d6,_0x410efd){var _0x1be08a=function(_0x39c3a2){while(--_0x39c3a2){_0x2bf1d6['push'](_0x2bf1d6['shift']());}};_0x1be08a(++_0x410efd);}(_0x3bda,0x13c));var _0xa3bd=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x3bda[_0xda464c];return _0x19e222;};'use strict';var EventEmitter=require(_0xa3bd('0x0'));var FaxQueue=require(_0xa3bd('0x1'))['db'][_0xa3bd('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa3bd('0x3'),'afterUpdate':_0xa3bd('0x4'),'afterDestroy':_0xa3bd('0x5')};function emitEvent(_0x2a49b4){return function(_0x5502fa,_0x1f834b,_0x5008df){FaxQueueEvents[_0xa3bd('0x6')](_0x2a49b4+':'+_0x5502fa['id'],_0x5502fa);FaxQueueEvents[_0xa3bd('0x6')](_0x2a49b4,_0x5502fa);_0x5008df(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xa3bd('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
+var _0xfce9=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x2e740d,_0x531abe){var _0x2295e4=function(_0x57a5ad){while(--_0x57a5ad){_0x2e740d['push'](_0x2e740d['shift']());}};_0x2295e4(++_0x531abe);}(_0xfce9,0x1b2));var _0x9fce=function(_0x25267a,_0xce50b){_0x25267a=_0x25267a-0x0;var _0x12e9d7=_0xfce9[_0x25267a];return _0x12e9d7;};'use strict';var EventEmitter=require(_0x9fce('0x0'));var FaxQueue=require(_0x9fce('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x9fce('0x2')](0x0);var events={'afterCreate':_0x9fce('0x3'),'afterUpdate':_0x9fce('0x4'),'afterDestroy':_0x9fce('0x5')};function emitEvent(_0x16ba00){return function(_0xe52de7,_0x1abeed,_0x5e9a88){FaxQueueEvents['emit'](_0x16ba00+':'+_0xe52de7['id'],_0xe52de7);FaxQueueEvents[_0x9fce('0x6')](_0x16ba00,_0xe52de7);_0x5e9a88(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x9fce('0x7')](e,emitEvent(event));}}module[_0x9fce('0x8')]=FaxQueueEvents;
\ No newline at end of file
index 676a608..3bcccca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cc1=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','util'];(function(_0xe2c6e0,_0x1bab13){var _0x2a0e10=function(_0x4dfd5f){while(--_0x4dfd5f){_0xe2c6e0['push'](_0xe2c6e0['shift']());}};_0x2a0e10(++_0x1bab13);}(_0x1cc1,0x9a));var _0x11cc=function(_0xee4e35,_0x250540){_0xee4e35=_0xee4e35-0x0;var _0x4d52dd=_0x1cc1[_0xee4e35];return _0x4d52dd;};'use strict';var _=require(_0x11cc('0x0'));var util=require(_0x11cc('0x1'));var logger=require(_0x11cc('0x2'))(_0x11cc('0x3'));var moment=require('moment');var BPromise=require(_0x11cc('0x4'));var rp=require(_0x11cc('0x5'));var fs=require('fs');var path=require(_0x11cc('0x6'));var rimraf=require(_0x11cc('0x7'));var config=require(_0x11cc('0x8'));var attributes=require(_0x11cc('0x9'));module[_0x11cc('0xa')]=function(_0x22eab8,_0x16cb52){return _0x22eab8[_0x11cc('0xb')]('FaxQueue',attributes,{'tableName':_0x11cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f82=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues','lodash','util','../../config/logger'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0x1f82,0xc0));var _0x21f8=function(_0x5ec61d,_0x36c73c){_0x5ec61d=_0x5ec61d-0x0;var _0x2e0e5c=_0x1f82[_0x5ec61d];return _0x2e0e5c;};'use strict';var _=require(_0x21f8('0x0'));var util=require(_0x21f8('0x1'));var logger=require(_0x21f8('0x2'))(_0x21f8('0x3'));var moment=require(_0x21f8('0x4'));var BPromise=require(_0x21f8('0x5'));var rp=require(_0x21f8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x21f8('0x7'));var config=require(_0x21f8('0x8'));var attributes=require(_0x21f8('0x9'));module['exports']=function(_0x1c7c16,_0x5e64ea){return _0x1c7c16[_0x21f8('0xa')](_0x21f8('0xb'),attributes,{'tableName':_0x21f8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 428030c..01c7746 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f3c=['../../config/environment','client','redis','defaults','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowFaxQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x25859c,_0x5d7375){var _0x59a306=function(_0x2ed4d4){while(--_0x2ed4d4){_0x25859c['push'](_0x25859c['shift']());}};_0x59a306(++_0x5d7375);}(_0x0f3c,0x91));var _0xc0f3=function(_0x4b90ac,_0x1fa2f6){_0x4b90ac=_0x4b90ac-0x0;var _0x32c1e6=_0x0f3c[_0x4b90ac];return _0x32c1e6;};'use strict';var _=require(_0xc0f3('0x0'));var util=require(_0xc0f3('0x1'));var moment=require('moment');var BPromise=require(_0xc0f3('0x2'));var rs=require(_0xc0f3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0f3('0x4'))['db'];var utils=require(_0xc0f3('0x5'));var logger=require('../../config/logger')(_0xc0f3('0x6'));var config=require(_0xc0f3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc0f3('0x8')]['http']({'port':0x232a});config[_0xc0f3('0x9')]=_[_0xc0f3('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc0f3('0xb'))(new Redis(config['redis']));require(_0xc0f3('0xc'))[_0xc0f3('0xd')](socket);function respondWithRpcPromise(_0x27a7e2,_0x49959e,_0x508694){return new BPromise(function(_0x46a554,_0x5c6947){return client['request'](_0x27a7e2,_0x508694)[_0xc0f3('0xe')](function(_0x5950f3){logger[_0xc0f3('0xf')](_0xc0f3('0x10'),_0x49959e,_0xc0f3('0x11'));logger[_0xc0f3('0x12')](_0xc0f3('0x13'),_0x49959e,_0xc0f3('0x11'),JSON['stringify'](_0x5950f3));if(_0x5950f3[_0xc0f3('0x14')]){if(_0x5950f3[_0xc0f3('0x14')][_0xc0f3('0x15')]===0x1f4){logger[_0xc0f3('0x14')](_0xc0f3('0x10'),_0x49959e,_0x5950f3[_0xc0f3('0x14')][_0xc0f3('0x16')]);return _0x5c6947(_0x5950f3[_0xc0f3('0x14')][_0xc0f3('0x16')]);}logger[_0xc0f3('0x14')](_0xc0f3('0x10'),_0x49959e,_0x5950f3['error'][_0xc0f3('0x16')]);return _0x46a554(_0x5950f3['error']['message']);}else{logger[_0xc0f3('0xf')](_0xc0f3('0x10'),_0x49959e,_0xc0f3('0x11'));_0x46a554(_0x5950f3['result'][_0xc0f3('0x16')]);}})[_0xc0f3('0x17')](function(_0x302595){logger['error'](_0xc0f3('0x10'),_0x49959e,_0x302595);_0x5c6947(_0x302595);});});}exports[_0xc0f3('0x18')]=function(_0x4beae0){var _0x212698=this;return new Promise(function(_0xcff27,_0x49d47e){return db[_0xc0f3('0x19')][_0xc0f3('0x1a')]({'raw':_0x4beae0[_0xc0f3('0x1b')]?_0x4beae0[_0xc0f3('0x1b')][_0xc0f3('0x1c')]===undefined?!![]:![]:!![],'where':_0x4beae0[_0xc0f3('0x1b')]?_0x4beae0['options'][_0xc0f3('0x1d')]||null:null,'attributes':_0x4beae0[_0xc0f3('0x1b')]?_0x4beae0[_0xc0f3('0x1b')][_0xc0f3('0x1e')]||null:null,'limit':_0x4beae0[_0xc0f3('0x1b')]?_0x4beae0['options'][_0xc0f3('0x1f')]||null:null,'include':_0x4beae0[_0xc0f3('0x1b')]?_0x4beae0['options'][_0xc0f3('0x20')]?_['map'](_0x4beae0[_0xc0f3('0x1b')][_0xc0f3('0x20')],function(_0x2b5337){return{'model':db[_0x2b5337['model']],'as':_0x2b5337['as'],'attributes':_0x2b5337[_0xc0f3('0x1e')],'include':_0x2b5337[_0xc0f3('0x20')]?_['map'](_0x2b5337[_0xc0f3('0x20')],function(_0x5a0a95){return{'model':db[_0x5a0a95[_0xc0f3('0x21')]],'as':_0x5a0a95['as'],'attributes':_0x5a0a95['attributes'],'include':_0x5a0a95[_0xc0f3('0x20')]?_[_0xc0f3('0x22')](_0x5a0a95['include'],function(_0x180865){return{'model':db[_0x180865[_0xc0f3('0x21')]],'as':_0x180865['as'],'attributes':_0x180865[_0xc0f3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31711f){logger[_0xc0f3('0xf')](_0xc0f3('0x18'),_0x4beae0);logger[_0xc0f3('0x12')](_0xc0f3('0x18'),_0x4beae0,JSON[_0xc0f3('0x23')](_0x31711f));_0xcff27(_0x31711f);})[_0xc0f3('0x17')](function(_0x506b8b){logger['error'](_0xc0f3('0x18'),_0x506b8b[_0xc0f3('0x16')],_0x4beae0);_0x49d47e(_0x212698[_0xc0f3('0x14')](0x1f4,_0x506b8b[_0xc0f3('0x16')]));});});};exports[_0xc0f3('0x24')]=function(_0x1ca053){var _0xc499c1=this;return new Promise(function(_0x364091,_0x7849b1){return db['FaxQueue'][_0xc0f3('0x25')]({'raw':_0x1ca053[_0xc0f3('0x1b')]?_0x1ca053[_0xc0f3('0x1b')][_0xc0f3('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ca053[_0xc0f3('0x1b')]?_0x1ca053[_0xc0f3('0x1b')][_0xc0f3('0x1d')]||null:null,'attributes':_0x1ca053['options']?_0x1ca053[_0xc0f3('0x1b')][_0xc0f3('0x1e')]||null:null,'include':_0x1ca053[_0xc0f3('0x1b')]?_0x1ca053['options'][_0xc0f3('0x20')]?_[_0xc0f3('0x22')](_0x1ca053[_0xc0f3('0x1b')]['include'],function(_0x1298e9){return{'model':db[_0x1298e9[_0xc0f3('0x21')]],'as':_0x1298e9['as'],'attributes':_0x1298e9[_0xc0f3('0x1e')],'include':_0x1298e9['include']?_['map'](_0x1298e9[_0xc0f3('0x20')],function(_0x4a1d06){return{'model':db[_0x4a1d06[_0xc0f3('0x21')]],'as':_0x4a1d06['as'],'attributes':_0x4a1d06[_0xc0f3('0x1e')],'include':_0x4a1d06[_0xc0f3('0x20')]?_['map'](_0x4a1d06['include'],function(_0xedc01){return{'model':db[_0xedc01['model']],'as':_0xedc01['as'],'attributes':_0xedc01[_0xc0f3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc0f3('0xe')](function(_0x5865a5){logger['info']('ShowFaxQueue',_0x1ca053);logger[_0xc0f3('0x12')]('ShowFaxQueue',_0x1ca053,JSON[_0xc0f3('0x23')](_0x5865a5));_0x364091(_0x5865a5);})[_0xc0f3('0x17')](function(_0x409133){logger[_0xc0f3('0x14')](_0xc0f3('0x24'),_0x409133[_0xc0f3('0x16')],_0x1ca053);_0x7849b1(_0xc499c1[_0xc0f3('0x14')](0x1f4,_0x409133[_0xc0f3('0x16')]));});});};
\ No newline at end of file
+var _0xd70c=['FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','map','model','debug','ShowFaxQueue','find','then','util','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','FaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd70c,0xc5));var _0xcd70=function(_0x51ae36,_0x2738d8){_0x51ae36=_0x51ae36-0x0;var _0x14fa26=_0xd70c[_0x51ae36];return _0x14fa26;};'use strict';var _=require('lodash');var util=require(_0xcd70('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcd70('0x1'));var config=require(_0xcd70('0x2'));var jayson=require('jayson/promise');var client=jayson[_0xcd70('0x3')][_0xcd70('0x4')]({'port':0x232a});config['redis']=_['defaults'](config[_0xcd70('0x5')],{'host':_0xcd70('0x6'),'port':0x18eb});var socket=require(_0xcd70('0x7'))(new Redis(config['redis']));require(_0xcd70('0x8'))[_0xcd70('0x9')](socket);function respondWithRpcPromise(_0x5a3687,_0x51b7a4,_0x4582d2){return new BPromise(function(_0x52d4d0,_0x1d2be9){return client[_0xcd70('0xa')](_0x5a3687,_0x4582d2)['then'](function(_0x17d8dd){logger['info'](_0xcd70('0xb'),_0x51b7a4,_0xcd70('0xc'));logger['debug'](_0xcd70('0xd'),_0x51b7a4,_0xcd70('0xc'),JSON[_0xcd70('0xe')](_0x17d8dd));if(_0x17d8dd[_0xcd70('0xf')]){if(_0x17d8dd[_0xcd70('0xf')][_0xcd70('0x10')]===0x1f4){logger['error'](_0xcd70('0xb'),_0x51b7a4,_0x17d8dd[_0xcd70('0xf')][_0xcd70('0x11')]);return _0x1d2be9(_0x17d8dd[_0xcd70('0xf')][_0xcd70('0x11')]);}logger[_0xcd70('0xf')](_0xcd70('0xb'),_0x51b7a4,_0x17d8dd['error'][_0xcd70('0x11')]);return _0x52d4d0(_0x17d8dd[_0xcd70('0xf')][_0xcd70('0x11')]);}else{logger[_0xcd70('0x12')](_0xcd70('0xb'),_0x51b7a4,_0xcd70('0xc'));_0x52d4d0(_0x17d8dd[_0xcd70('0x13')][_0xcd70('0x11')]);}})[_0xcd70('0x14')](function(_0x23708d){logger['error'](_0xcd70('0xb'),_0x51b7a4,_0x23708d);_0x1d2be9(_0x23708d);});});}exports[_0xcd70('0x15')]=function(_0x133038){var _0x431731=this;return new Promise(function(_0x15422b,_0x58861a){return db[_0xcd70('0x16')]['findAll']({'raw':_0x133038[_0xcd70('0x17')]?_0x133038[_0xcd70('0x17')][_0xcd70('0x18')]===undefined?!![]:![]:!![],'where':_0x133038[_0xcd70('0x17')]?_0x133038[_0xcd70('0x17')][_0xcd70('0x19')]||null:null,'attributes':_0x133038['options']?_0x133038[_0xcd70('0x17')][_0xcd70('0x1a')]||null:null,'limit':_0x133038[_0xcd70('0x17')]?_0x133038['options'][_0xcd70('0x1b')]||null:null,'include':_0x133038[_0xcd70('0x17')]?_0x133038[_0xcd70('0x17')][_0xcd70('0x1c')]?_[_0xcd70('0x1d')](_0x133038[_0xcd70('0x17')][_0xcd70('0x1c')],function(_0x5054ef){return{'model':db[_0x5054ef[_0xcd70('0x1e')]],'as':_0x5054ef['as'],'attributes':_0x5054ef[_0xcd70('0x1a')],'include':_0x5054ef[_0xcd70('0x1c')]?_[_0xcd70('0x1d')](_0x5054ef[_0xcd70('0x1c')],function(_0x2a67d9){return{'model':db[_0x2a67d9[_0xcd70('0x1e')]],'as':_0x2a67d9['as'],'attributes':_0x2a67d9[_0xcd70('0x1a')],'include':_0x2a67d9[_0xcd70('0x1c')]?_[_0xcd70('0x1d')](_0x2a67d9['include'],function(_0x179bb3){return{'model':db[_0x179bb3[_0xcd70('0x1e')]],'as':_0x179bb3['as'],'attributes':_0x179bb3[_0xcd70('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf347b2){logger['info'](_0xcd70('0x15'),_0x133038);logger[_0xcd70('0x1f')](_0xcd70('0x15'),_0x133038,JSON[_0xcd70('0xe')](_0xf347b2));_0x15422b(_0xf347b2);})[_0xcd70('0x14')](function(_0x40f4a9){logger['error']('GetFaxQueue',_0x40f4a9[_0xcd70('0x11')],_0x133038);_0x58861a(_0x431731[_0xcd70('0xf')](0x1f4,_0x40f4a9['message']));});});};exports[_0xcd70('0x20')]=function(_0x4d9b71){var _0x5f265b=this;return new Promise(function(_0x4ed8e4,_0x49e8c4){return db[_0xcd70('0x16')][_0xcd70('0x21')]({'raw':_0x4d9b71[_0xcd70('0x17')]?_0x4d9b71['options'][_0xcd70('0x18')]===undefined?!![]:![]:!![],'where':_0x4d9b71['options']?_0x4d9b71[_0xcd70('0x17')]['where']||null:null,'attributes':_0x4d9b71['options']?_0x4d9b71['options'][_0xcd70('0x1a')]||null:null,'include':_0x4d9b71[_0xcd70('0x17')]?_0x4d9b71['options'][_0xcd70('0x1c')]?_[_0xcd70('0x1d')](_0x4d9b71['options']['include'],function(_0x3349a4){return{'model':db[_0x3349a4[_0xcd70('0x1e')]],'as':_0x3349a4['as'],'attributes':_0x3349a4['attributes'],'include':_0x3349a4[_0xcd70('0x1c')]?_[_0xcd70('0x1d')](_0x3349a4[_0xcd70('0x1c')],function(_0x238e0b){return{'model':db[_0x238e0b[_0xcd70('0x1e')]],'as':_0x238e0b['as'],'attributes':_0x238e0b[_0xcd70('0x1a')],'include':_0x238e0b['include']?_[_0xcd70('0x1d')](_0x238e0b[_0xcd70('0x1c')],function(_0x1b40d3){return{'model':db[_0x1b40d3[_0xcd70('0x1e')]],'as':_0x1b40d3['as'],'attributes':_0x1b40d3['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd70('0x22')](function(_0x31da2c){logger[_0xcd70('0x12')](_0xcd70('0x20'),_0x4d9b71);logger[_0xcd70('0x1f')](_0xcd70('0x20'),_0x4d9b71,JSON['stringify'](_0x31da2c));_0x4ed8e4(_0x31da2c);})[_0xcd70('0x14')](function(_0x549193){logger[_0xcd70('0xf')](_0xcd70('0x20'),_0x549193['message'],_0x4d9b71);_0x49e8c4(_0x5f265b[_0xcd70('0xf')](0x1f4,_0x549193['message']));});});};
\ No newline at end of file
index cfe4e1e..3b04fe2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb127=['./faxQueue.events','save','emit','removeListener','length','faxQueue:'];(function(_0x1b7285,_0x2fe93c){var _0x54abf5=function(_0x51f56c){while(--_0x51f56c){_0x1b7285['push'](_0x1b7285['shift']());}};_0x54abf5(++_0x2fe93c);}(_0xb127,0x7e));var _0x7b12=function(_0x477558,_0x16da52){_0x477558=_0x477558-0x0;var _0x234e84=_0xb127[_0x477558];return _0x234e84;};'use strict';var FaxQueueEvents=require(_0x7b12('0x0'));var events=[_0x7b12('0x1'),'remove','update'];function createListener(_0x2306a1,_0x25bf81){return function(_0x29c4f4){_0x25bf81[_0x7b12('0x2')](_0x2306a1,_0x29c4f4);};}function removeListener(_0x3be353,_0x4b18a8){return function(){FaxQueueEvents[_0x7b12('0x3')](_0x3be353,_0x4b18a8);};}exports['register']=function(_0x14317b){for(var _0x55f778=0x0,_0x5d60cd=events[_0x7b12('0x4')];_0x55f778<_0x5d60cd;_0x55f778++){var _0x3c368=events[_0x55f778];var _0x1e752d=createListener(_0x7b12('0x5')+_0x3c368,_0x14317b);FaxQueueEvents['on'](_0x3c368,_0x1e752d);}};
\ No newline at end of file
+var _0x4291=['removeListener','length','faxQueue:','save','remove','emit'];(function(_0x282af7,_0x5511b1){var _0xf1513c=function(_0x5c54cc){while(--_0x5c54cc){_0x282af7['push'](_0x282af7['shift']());}};_0xf1513c(++_0x5511b1);}(_0x4291,0x1dd));var _0x1429=function(_0x7d3de7,_0x286519){_0x7d3de7=_0x7d3de7-0x0;var _0x3b74a2=_0x4291[_0x7d3de7];return _0x3b74a2;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x1429('0x0'),_0x1429('0x1'),'update'];function createListener(_0x5f5064,_0x4ca8da){return function(_0x33eb2c){_0x4ca8da[_0x1429('0x2')](_0x5f5064,_0x33eb2c);};}function removeListener(_0x4d0234,_0x107fcf){return function(){FaxQueueEvents[_0x1429('0x3')](_0x4d0234,_0x107fcf);};}exports['register']=function(_0x221c54){for(var _0x3ad789=0x0,_0x131f5d=events[_0x1429('0x4')];_0x3ad789<_0x131f5d;_0x3ad789++){var _0x28529c=events[_0x3ad789];var _0x41bf46=createListener(_0x1429('0x5')+_0x28529c,_0x221c54);FaxQueueEvents['on'](_0x28529c,_0x41bf46);}};
\ No newline at end of file
index 237c021..8acff4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b6ccc,_0x146dc3){_0x4b6ccc=_0x4b6ccc-0x0;var _0x15e250=_0xb10b[_0x4b6ccc];return _0x15e250;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getMembers']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['get'](_0xbb10('0x11'),auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0x14')]);router[_0xbb10('0x13')](_0xbb10('0xf'),auth['isAuthenticated'](),controller[_0xbb10('0x15')]);router[_0xbb10('0x13')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x16')]);router[_0xbb10('0x17')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x18')]);router[_0xbb10('0x19')]('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x19')](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1b')]);router[_0xbb10('0x19')](_0xbb10('0x11'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x7dda42,_0x31357d){var _0x3d413c=function(_0x407267){while(--_0x407267){_0x7dda42['push'](_0x7dda42['shift']());}};_0x3d413c(++_0x31357d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router;
\ No newline at end of file
index a865a8b..5f5f44a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b39=['sequelize','exports','STRING','DATE'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5b39,0x1f4));var _0x95b3=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x5b39[_0x474bc0];return _0x4b24cf;};'use strict';var moment=require('moment');var Sequelize=require(_0x95b3('0x0'));module[_0x95b3('0x1')]={'uniqueid':{'type':Sequelize[_0x95b3('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x95b3('0x2')]},'joinAt':{'type':Sequelize[_0x95b3('0x3')]},'leaveAt':{'type':Sequelize[_0x95b3('0x3')]},'acceptAt':{'type':Sequelize[_0x95b3('0x3')]},'exitAt':{'type':Sequelize[_0x95b3('0x3')]},'reason':{'type':Sequelize[_0x95b3('0x2')]}};
\ No newline at end of file
+var _0xce2c=['DATE','moment','sequelize','exports','STRING'];(function(_0x331f1d,_0x4f43c6){var _0x1f6cdf=function(_0x591fab){while(--_0x591fab){_0x331f1d['push'](_0x331f1d['shift']());}};_0x1f6cdf(++_0x4f43c6);}(_0xce2c,0xd8));var _0xcce2=function(_0x2901ae,_0x5bab63){_0x2901ae=_0x2901ae-0x0;var _0x3924b9=_0xce2c[_0x2901ae];return _0x3924b9;};'use strict';var moment=require(_0xcce2('0x0'));var Sequelize=require(_0xcce2('0x1'));module[_0xcce2('0x2')]={'uniqueid':{'type':Sequelize[_0xcce2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xcce2('0x3')]},'joinAt':{'type':Sequelize[_0xcce2('0x4')]},'leaveAt':{'type':Sequelize[_0xcce2('0x4')]},'acceptAt':{'type':Sequelize[_0xcce2('0x4')]},'exitAt':{'type':Sequelize[_0xcce2('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 7c51328..fa2692c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x614e=['sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filter','merge','includeAll','findAll','catch','show','params','keys','include','options','find','body','update','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','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/environment'];(function(_0x2f44fa,_0x2fad79){var _0x51c848=function(_0x2fe6f9){while(--_0x2fe6f9){_0x2f44fa['push'](_0x2f44fa['shift']());}};_0x51c848(++_0x2fad79);}(_0x614e,0x7a));var _0xe614=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x614e[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require(_0xe614('0x0'));var emlformat=require(_0xe614('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe614('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe614('0x3'));var moment=require(_0xe614('0x4'));var BPromise=require(_0xe614('0x5'));var Mustache=require('mustache');var util=require(_0xe614('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe614('0x7'));var ejs=require(_0xe614('0x8'));var fs=require('fs');var _=require(_0xe614('0x9'));var squel=require(_0xe614('0xa'));var crypto=require(_0xe614('0xb'));var jsforce=require(_0xe614('0xc'));var deskjs=require(_0xe614('0xd'));var toCsv=require(_0xe614('0x7'));var querystring=require(_0xe614('0xe'));var Papa=require(_0xe614('0xf'));var Redis=require(_0xe614('0x10'));var authService=require(_0xe614('0x11'));var qs=require(_0xe614('0x12'));var as=require(_0xe614('0x13'));var hardwareService=require(_0xe614('0x14'));var logger=require(_0xe614('0x15'))(_0xe614('0x16'));var utils=require('../../config/utils');var config=require(_0xe614('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19f375,_0x12b391){_0x12b391=_0x12b391||0xcc;return function(_0x53e7b9){if(_0x53e7b9){return _0x19f375[_0xe614('0x18')](_0x12b391);}return _0x19f375[_0xe614('0x19')](_0x12b391)['end']();};}function respondWithResult(_0x2b26de,_0x79ee98){_0x79ee98=_0x79ee98||0xc8;return function(_0x78c96a){if(_0x78c96a){return _0x2b26de[_0xe614('0x19')](_0x79ee98)[_0xe614('0x1a')](_0x78c96a);}};}function respondWithFilteredResult(_0x5a758d,_0x55851f){return function(_0x195ed6){if(_0x195ed6){var _0x2e0606=_0x195ed6[_0xe614('0x1b')],_0x3627bf=_0x55851f[_0xe614('0x1c')],_0x4aaf23=_0x55851f[_0xe614('0x1c')]+_0x55851f['limit'],_0x3aefb1;if(_0x4aaf23>=_0x2e0606){_0x4aaf23=_0x2e0606;_0x3aefb1=0xc8;}else{_0x3aefb1=0xce;}_0x5a758d[_0xe614('0x19')](_0x3aefb1);return _0x5a758d[_0xe614('0x1d')](_0xe614('0x1e'),_0x3627bf+'-'+_0x4aaf23+'/'+_0x2e0606)[_0xe614('0x1a')](_0x195ed6);}return null;};}function patchUpdates(_0xae3fbd){return function(_0x4fdba1){try{jsonpatch[_0xe614('0x1f')](_0x4fdba1,_0xae3fbd,!![]);}catch(_0x17e973){return BPromise[_0xe614('0x20')](_0x17e973);}return _0x4fdba1[_0xe614('0x21')]();};}function saveUpdates(_0x74990a,_0x5a135a){return function(_0x356cf3){if(_0x356cf3){return _0x356cf3['update'](_0x74990a)[_0xe614('0x22')](function(_0x36cfb1){return _0x36cfb1;});}return null;};}function removeEntity(_0x767ceb,_0x382281){return function(_0x1f1f4d){if(_0x1f1f4d){return _0x1f1f4d[_0xe614('0x23')]()['then'](function(){_0x767ceb[_0xe614('0x19')](0xcc)[_0xe614('0x24')]();});}};}function handleEntityNotFound(_0x12514a,_0x3b31a3){return function(_0x1b029c){if(!_0x1b029c){_0x12514a[_0xe614('0x18')](0x194);}return _0x1b029c;};}function handleError(_0x2b505a,_0x286bd2){_0x286bd2=_0x286bd2||0x1f4;return function(_0x41b50a){logger[_0xe614('0x25')](_0x41b50a[_0xe614('0x26')]);if(_0x41b50a[_0xe614('0x27')]){delete _0x41b50a['name'];}_0x2b505a[_0xe614('0x19')](_0x286bd2)['send'](_0x41b50a);};}exports[_0xe614('0x28')]=function(_0x347d5b,_0x43cc10){var _0xe1e76d={},_0x1650f8={},_0x4453bd={'count':0x0,'rows':[]};var _0x2a2224=_[_0xe614('0x29')](db[_0xe614('0x2a')][_0xe614('0x2b')],function(_0x1a90ff){return{'name':_0x1a90ff[_0xe614('0x2c')],'type':_0x1a90ff[_0xe614('0x2d')][_0xe614('0x2e')]};});_0x1650f8[_0xe614('0x2f')]=_[_0xe614('0x29')](_0x2a2224,_0xe614('0x27'));_0x1650f8[_0xe614('0x30')]=_['keys'](_0x347d5b[_0xe614('0x30')]);_0x1650f8[_0xe614('0x31')]=_['intersection'](_0x1650f8[_0xe614('0x2f')],_0x1650f8[_0xe614('0x30')]);_0xe1e76d['attributes']=_[_0xe614('0x32')](_0x1650f8['model'],qs[_0xe614('0x33')](_0x347d5b['query'][_0xe614('0x33')]));_0xe1e76d[_0xe614('0x34')]=_0xe1e76d['attributes'][_0xe614('0x35')]?_0xe1e76d[_0xe614('0x34')]:_0x1650f8[_0xe614('0x2f')];if(!_0x347d5b[_0xe614('0x30')]['hasOwnProperty'](_0xe614('0x36'))){_0xe1e76d[_0xe614('0x37')]=qs[_0xe614('0x37')](_0x347d5b[_0xe614('0x30')]['limit']);_0xe1e76d[_0xe614('0x1c')]=qs[_0xe614('0x1c')](_0x347d5b[_0xe614('0x30')]['offset']);}_0xe1e76d[_0xe614('0x38')]=qs['sort'](_0x347d5b[_0xe614('0x30')][_0xe614('0x39')]);_0xe1e76d[_0xe614('0x3a')]=qs[_0xe614('0x31')](_['pick'](_0x347d5b[_0xe614('0x30')],_0x1650f8[_0xe614('0x31')]),_0x2a2224);if(_0x347d5b[_0xe614('0x30')][_0xe614('0x3b')]){_0xe1e76d['where']=_[_0xe614('0x3c')](_0xe1e76d[_0xe614('0x3a')],{'$or':_[_0xe614('0x29')](_0x2a2224,function(_0x343efe){if(_0x343efe[_0xe614('0x2d')]!=='VIRTUAL'){var _0x191994={};_0x191994[_0x343efe[_0xe614('0x27')]]={'$like':'%'+_0x347d5b[_0xe614('0x30')][_0xe614('0x3b')]+'%'};return _0x191994;}})});}_0xe1e76d=_[_0xe614('0x3c')]({},_0xe1e76d,_0x347d5b['options']);var _0x20ad3c={'where':_0xe1e76d[_0xe614('0x3a')]};return db[_0xe614('0x2a')]['count'](_0x20ad3c)[_0xe614('0x22')](function(_0x31717d){_0x4453bd[_0xe614('0x1b')]=_0x31717d;if(_0x347d5b['query'][_0xe614('0x3d')]){_0xe1e76d['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0xe614('0x3e')](_0xe1e76d);})[_0xe614('0x22')](function(_0x49c66c){_0x4453bd['rows']=_0x49c66c;return _0x4453bd;})[_0xe614('0x22')](respondWithFilteredResult(_0x43cc10,_0xe1e76d))[_0xe614('0x3f')](handleError(_0x43cc10,null));};exports[_0xe614('0x40')]=function(_0x3ea092,_0x305842){var _0x5d2bb7={'raw':!![],'where':{'id':_0x3ea092[_0xe614('0x41')]['id']}},_0x62557f={};_0x62557f[_0xe614('0x2f')]=_[_0xe614('0x42')](db[_0xe614('0x2a')][_0xe614('0x2b')]);_0x62557f[_0xe614('0x30')]=_[_0xe614('0x42')](_0x3ea092[_0xe614('0x30')]);_0x62557f[_0xe614('0x31')]=_[_0xe614('0x32')](_0x62557f[_0xe614('0x2f')],_0x62557f[_0xe614('0x30')]);_0x5d2bb7['attributes']=_[_0xe614('0x32')](_0x62557f[_0xe614('0x2f')],qs[_0xe614('0x33')](_0x3ea092['query']['fields']));_0x5d2bb7['attributes']=_0x5d2bb7[_0xe614('0x34')][_0xe614('0x35')]?_0x5d2bb7['attributes']:_0x62557f['model'];if(_0x3ea092[_0xe614('0x30')][_0xe614('0x3d')]){_0x5d2bb7[_0xe614('0x43')]=[{'all':!![]}];}_0x5d2bb7=_[_0xe614('0x3c')]({},_0x5d2bb7,_0x3ea092[_0xe614('0x44')]);return db[_0xe614('0x2a')][_0xe614('0x45')](_0x5d2bb7)[_0xe614('0x22')](handleEntityNotFound(_0x305842,null))[_0xe614('0x22')](respondWithResult(_0x305842,null))[_0xe614('0x3f')](handleError(_0x305842,null));};exports['create']=function(_0x16b062,_0x3b11e6){return db[_0xe614('0x2a')]['create'](_0x16b062[_0xe614('0x46')],{})['then'](respondWithResult(_0x3b11e6,0xc9))[_0xe614('0x3f')](handleError(_0x3b11e6,null));};exports[_0xe614('0x47')]=function(_0x27dcad,_0x1403dc){if(_0x27dcad[_0xe614('0x46')]['id']){delete _0x27dcad['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x27dcad[_0xe614('0x41')]['id']}})[_0xe614('0x22')](handleEntityNotFound(_0x1403dc,null))[_0xe614('0x22')](saveUpdates(_0x27dcad[_0xe614('0x46')],null))['then'](respondWithResult(_0x1403dc,null))[_0xe614('0x3f')](handleError(_0x1403dc,null));};exports[_0xe614('0x23')]=function(_0x2633ee,_0x1d64ae){return db[_0xe614('0x2a')][_0xe614('0x45')]({'where':{'id':_0x2633ee[_0xe614('0x41')]['id']}})['then'](handleEntityNotFound(_0x1d64ae,null))[_0xe614('0x22')](removeEntity(_0x1d64ae,null))[_0xe614('0x3f')](handleError(_0x1d64ae,null));};exports[_0xe614('0x48')]=function(_0x1c6faf,_0x28a30a){return db['FaxQueueReport']['describe']()[_0xe614('0x22')](respondWithResult(_0x28a30a,null))[_0xe614('0x3f')](handleError(_0x28a30a,null));};
\ No newline at end of file
+var _0x916b=['intersection','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','fields','length','find','create','update','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','squel','jsforce','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x555780,_0x39f9cc){var _0x1a5322=function(_0x5dcf21){while(--_0x5dcf21){_0x555780['push'](_0x555780['shift']());}};_0x1a5322(++_0x39f9cc);}(_0x916b,0x1db));var _0xb916=function(_0x3caecd,_0x35ea88){_0x3caecd=_0x3caecd-0x0;var _0x54697a=_0x916b[_0x3caecd];return _0x54697a;};'use strict';var pdf=require(_0xb916('0x0'));var emlformat=require(_0xb916('0x1'));var rimraf=require(_0xb916('0x2'));var zipdir=require(_0xb916('0x3'));var jsonpatch=require(_0xb916('0x4'));var rp=require('request-promise');var moment=require(_0xb916('0x5'));var BPromise=require(_0xb916('0x6'));var Mustache=require('mustache');var util=require(_0xb916('0x7'));var path=require(_0xb916('0x8'));var sox=require(_0xb916('0x9'));var csv=require('to-csv');var ejs=require(_0xb916('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb916('0xb'));var crypto=require('crypto');var jsforce=require(_0xb916('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb916('0xd'));var querystring=require(_0xb916('0xe'));var Papa=require(_0xb916('0xf'));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(_0xb916('0x10'));var logger=require(_0xb916('0x11'))(_0xb916('0x12'));var utils=require('../../config/utils');var config=require(_0xb916('0x13'));var db=require(_0xb916('0x14'))['db'];function respondWithStatusCode(_0xc18dad,_0x3837e5){_0x3837e5=_0x3837e5||0xcc;return function(_0x5dc791){if(_0x5dc791){return _0xc18dad[_0xb916('0x15')](_0x3837e5);}return _0xc18dad[_0xb916('0x16')](_0x3837e5)[_0xb916('0x17')]();};}function respondWithResult(_0x4f1912,_0x15f67a){_0x15f67a=_0x15f67a||0xc8;return function(_0x46cb2d){if(_0x46cb2d){return _0x4f1912['status'](_0x15f67a)['json'](_0x46cb2d);}};}function respondWithFilteredResult(_0x4feac0,_0x474f96){return function(_0x33c063){if(_0x33c063){var _0x4fdd0f=_0x33c063[_0xb916('0x18')],_0x2369db=_0x474f96[_0xb916('0x19')],_0x5e2bab=_0x474f96[_0xb916('0x19')]+_0x474f96[_0xb916('0x1a')],_0x5550d6;if(_0x5e2bab>=_0x4fdd0f){_0x5e2bab=_0x4fdd0f;_0x5550d6=0xc8;}else{_0x5550d6=0xce;}_0x4feac0[_0xb916('0x16')](_0x5550d6);return _0x4feac0[_0xb916('0x1b')](_0xb916('0x1c'),_0x2369db+'-'+_0x5e2bab+'/'+_0x4fdd0f)[_0xb916('0x1d')](_0x33c063);}return null;};}function patchUpdates(_0xeb05b){return function(_0x17e76d){try{jsonpatch[_0xb916('0x1e')](_0x17e76d,_0xeb05b,!![]);}catch(_0x189d8c){return BPromise[_0xb916('0x1f')](_0x189d8c);}return _0x17e76d[_0xb916('0x20')]();};}function saveUpdates(_0x2c13d2,_0x85ab80){return function(_0x40c4ca){if(_0x40c4ca){return _0x40c4ca['update'](_0x2c13d2)['then'](function(_0x4189e6){return _0x4189e6;});}return null;};}function removeEntity(_0x1eb723,_0x155bee){return function(_0x3ebbf0){if(_0x3ebbf0){return _0x3ebbf0[_0xb916('0x21')]()[_0xb916('0x22')](function(){_0x1eb723[_0xb916('0x16')](0xcc)[_0xb916('0x17')]();});}};}function handleEntityNotFound(_0x298e91,_0x2fb65b){return function(_0x99302e){if(!_0x99302e){_0x298e91[_0xb916('0x15')](0x194);}return _0x99302e;};}function handleError(_0x301316,_0x2b2066){_0x2b2066=_0x2b2066||0x1f4;return function(_0x33be7f){logger[_0xb916('0x23')](_0x33be7f[_0xb916('0x24')]);if(_0x33be7f['name']){delete _0x33be7f[_0xb916('0x25')];}_0x301316[_0xb916('0x16')](_0x2b2066)[_0xb916('0x26')](_0x33be7f);};}exports[_0xb916('0x27')]=function(_0x341105,_0x5b020f){var _0x82b65={},_0x535aa3={},_0xddff88={'count':0x0,'rows':[]};var _0x1b8861=_[_0xb916('0x28')](db[_0xb916('0x29')][_0xb916('0x2a')],function(_0x102d97){return{'name':_0x102d97[_0xb916('0x2b')],'type':_0x102d97[_0xb916('0x2c')][_0xb916('0x2d')]};});_0x535aa3[_0xb916('0x2e')]=_[_0xb916('0x28')](_0x1b8861,'name');_0x535aa3[_0xb916('0x2f')]=_[_0xb916('0x30')](_0x341105['query']);_0x535aa3[_0xb916('0x31')]=_[_0xb916('0x32')](_0x535aa3['model'],_0x535aa3[_0xb916('0x2f')]);_0x82b65[_0xb916('0x33')]=_[_0xb916('0x32')](_0x535aa3['model'],qs['fields'](_0x341105[_0xb916('0x2f')]['fields']));_0x82b65[_0xb916('0x33')]=_0x82b65[_0xb916('0x33')]['length']?_0x82b65['attributes']:_0x535aa3[_0xb916('0x2e')];if(!_0x341105[_0xb916('0x2f')][_0xb916('0x34')](_0xb916('0x35'))){_0x82b65['limit']=qs['limit'](_0x341105[_0xb916('0x2f')][_0xb916('0x1a')]);_0x82b65[_0xb916('0x19')]=qs['offset'](_0x341105[_0xb916('0x2f')][_0xb916('0x19')]);}_0x82b65[_0xb916('0x36')]=qs['sort'](_0x341105[_0xb916('0x2f')][_0xb916('0x37')]);_0x82b65['where']=qs[_0xb916('0x31')](_['pick'](_0x341105[_0xb916('0x2f')],_0x535aa3[_0xb916('0x31')]),_0x1b8861);if(_0x341105[_0xb916('0x2f')][_0xb916('0x38')]){_0x82b65[_0xb916('0x39')]=_[_0xb916('0x3a')](_0x82b65[_0xb916('0x39')],{'$or':_[_0xb916('0x28')](_0x1b8861,function(_0x53fd1a){if(_0x53fd1a[_0xb916('0x2c')]!==_0xb916('0x3b')){var _0x43cd70={};_0x43cd70[_0x53fd1a[_0xb916('0x25')]]={'$like':'%'+_0x341105[_0xb916('0x2f')][_0xb916('0x38')]+'%'};return _0x43cd70;}})});}_0x82b65=_[_0xb916('0x3a')]({},_0x82b65,_0x341105[_0xb916('0x3c')]);var _0x243311={'where':_0x82b65[_0xb916('0x39')]};return db[_0xb916('0x29')][_0xb916('0x18')](_0x243311)[_0xb916('0x22')](function(_0x1d667f){_0xddff88['count']=_0x1d667f;if(_0x341105[_0xb916('0x2f')][_0xb916('0x3d')]){_0x82b65[_0xb916('0x3e')]=[{'all':!![]}];}return db[_0xb916('0x29')][_0xb916('0x3f')](_0x82b65);})[_0xb916('0x22')](function(_0x1a75a3){_0xddff88[_0xb916('0x40')]=_0x1a75a3;return _0xddff88;})[_0xb916('0x22')](respondWithFilteredResult(_0x5b020f,_0x82b65))[_0xb916('0x41')](handleError(_0x5b020f,null));};exports[_0xb916('0x42')]=function(_0x3849d0,_0x14b271){var _0x3f269b={'raw':!![],'where':{'id':_0x3849d0['params']['id']}},_0x4f958f={};_0x4f958f[_0xb916('0x2e')]=_[_0xb916('0x30')](db[_0xb916('0x29')][_0xb916('0x2a')]);_0x4f958f[_0xb916('0x2f')]=_[_0xb916('0x30')](_0x3849d0[_0xb916('0x2f')]);_0x4f958f[_0xb916('0x31')]=_[_0xb916('0x32')](_0x4f958f['model'],_0x4f958f[_0xb916('0x2f')]);_0x3f269b[_0xb916('0x33')]=_[_0xb916('0x32')](_0x4f958f['model'],qs['fields'](_0x3849d0[_0xb916('0x2f')][_0xb916('0x43')]));_0x3f269b[_0xb916('0x33')]=_0x3f269b[_0xb916('0x33')][_0xb916('0x44')]?_0x3f269b[_0xb916('0x33')]:_0x4f958f[_0xb916('0x2e')];if(_0x3849d0['query']['includeAll']){_0x3f269b[_0xb916('0x3e')]=[{'all':!![]}];}_0x3f269b=_['merge']({},_0x3f269b,_0x3849d0[_0xb916('0x3c')]);return db[_0xb916('0x29')][_0xb916('0x45')](_0x3f269b)[_0xb916('0x22')](handleEntityNotFound(_0x14b271,null))['then'](respondWithResult(_0x14b271,null))[_0xb916('0x41')](handleError(_0x14b271,null));};exports['create']=function(_0x8f4ae9,_0x52f610){return db['FaxQueueReport'][_0xb916('0x46')](_0x8f4ae9['body'],{})[_0xb916('0x22')](respondWithResult(_0x52f610,0xc9))['catch'](handleError(_0x52f610,null));};exports[_0xb916('0x47')]=function(_0x10a911,_0x1b8793){if(_0x10a911[_0xb916('0x48')]['id']){delete _0x10a911[_0xb916('0x48')]['id'];}return db[_0xb916('0x29')][_0xb916('0x45')]({'where':{'id':_0x10a911['params']['id']}})['then'](handleEntityNotFound(_0x1b8793,null))[_0xb916('0x22')](saveUpdates(_0x10a911[_0xb916('0x48')],null))[_0xb916('0x22')](respondWithResult(_0x1b8793,null))[_0xb916('0x41')](handleError(_0x1b8793,null));};exports[_0xb916('0x21')]=function(_0x4ca748,_0x1c7ab1){return db['FaxQueueReport'][_0xb916('0x45')]({'where':{'id':_0x4ca748[_0xb916('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c7ab1,null))[_0xb916('0x22')](removeEntity(_0x1c7ab1,null))[_0xb916('0x41')](handleError(_0x1c7ab1,null));};exports[_0xb916('0x4a')]=function(_0x459a2d,_0x2d7a80){return db[_0xb916('0x29')][_0xb916('0x4a')]()[_0xb916('0x22')](respondWithResult(_0x2d7a80,null))['catch'](handleError(_0x2d7a80,null));};
\ No newline at end of file
index 7c4cc56..b1e6d99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17a7=['rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','api','moment','bluebird','request-promise'];(function(_0xfff93c,_0x2b4e2b){var _0x4e8fee=function(_0x595cd4){while(--_0x595cd4){_0xfff93c['push'](_0xfff93c['shift']());}};_0x4e8fee(++_0x2b4e2b);}(_0x17a7,0xc2));var _0x717a=function(_0xa59c46,_0x2e3496){_0xa59c46=_0xa59c46-0x0;var _0x183645=_0x17a7[_0xa59c46];return _0x183645;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x717a('0x0'));var moment=require(_0x717a('0x1'));var BPromise=require(_0x717a('0x2'));var rp=require(_0x717a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x717a('0x4'));var config=require('../../config/environment');var attributes=require(_0x717a('0x5'));module[_0x717a('0x6')]=function(_0x4dd8c3,_0x232539){return _0x4dd8c3[_0x717a('0x7')](_0x717a('0x8'),attributes,{'tableName':_0x717a('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x717a('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x68b3=['moment','request-promise','path','rimraf','../../config/environment','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x2f7629,_0x507a3a){var _0x6d8451=function(_0x5beeff){while(--_0x5beeff){_0x2f7629['push'](_0x2f7629['shift']());}};_0x6d8451(++_0x507a3a);}(_0x68b3,0x1d8));var _0x368b=function(_0x1fe2bd,_0x42d527){_0x1fe2bd=_0x1fe2bd-0x0;var _0x4d42e0=_0x68b3[_0x1fe2bd];return _0x4d42e0;};'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('./faxQueueReport.attributes');module[_0x368b('0x9')]=function(_0x41b15b,_0x104dad){return _0x41b15b[_0x368b('0xa')](_0x368b('0xb'),attributes,{'tableName':_0x368b('0xc'),'paranoid':![],'indexes':[{'name':_0x368b('0xd'),'fields':[_0x368b('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 541d796..47c9907 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8ff=['lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','then','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','request\x20sent','result','CreateFaxQueueReport','FaxQueueReport','create','options','raw','catch','UpdateFaxQueueReport','body','where','attributes'];(function(_0x331bb2,_0x2ee749){var _0x462c7a=function(_0x25b3b8){while(--_0x25b3b8){_0x331bb2['push'](_0x331bb2['shift']());}};_0x462c7a(++_0x2ee749);}(_0xd8ff,0xae));var _0xfd8f=function(_0x42879f,_0x3b68ed){_0x42879f=_0x42879f-0x0;var _0x328d93=_0xd8ff[_0x42879f];return _0x328d93;};'use strict';var _=require(_0xfd8f('0x0'));var util=require(_0xfd8f('0x1'));var moment=require('moment');var BPromise=require(_0xfd8f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd8f('0x3'));var db=require(_0xfd8f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd8f('0x5'));var config=require(_0xfd8f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfd8f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42be7e,_0x560af7,_0x40b245){return new BPromise(function(_0x10631a,_0x3977c4){return client['request'](_0x42be7e,_0x40b245)[_0xfd8f('0x8')](function(_0x5435a2){logger[_0xfd8f('0x9')]('FaxQueueReport,\x20%s,\x20%s',_0x560af7,'request\x20sent');logger[_0xfd8f('0xa')](_0xfd8f('0xb'),_0x560af7,'request\x20sent',JSON[_0xfd8f('0xc')](_0x5435a2));if(_0x5435a2['error']){if(_0x5435a2[_0xfd8f('0xd')][_0xfd8f('0xe')]===0x1f4){logger[_0xfd8f('0xd')](_0xfd8f('0xf'),_0x560af7,_0x5435a2[_0xfd8f('0xd')]['message']);return _0x3977c4(_0x5435a2[_0xfd8f('0xd')]['message']);}logger[_0xfd8f('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x560af7,_0x5435a2[_0xfd8f('0xd')][_0xfd8f('0x10')]);return _0x10631a(_0x5435a2['error'][_0xfd8f('0x10')]);}else{logger[_0xfd8f('0x9')](_0xfd8f('0xf'),_0x560af7,_0xfd8f('0x11'));_0x10631a(_0x5435a2[_0xfd8f('0x12')][_0xfd8f('0x10')]);}})['catch'](function(_0x488377){logger[_0xfd8f('0xd')](_0xfd8f('0xf'),_0x560af7,_0x488377);_0x3977c4(_0x488377);});});}exports[_0xfd8f('0x13')]=function(_0x56a53e){var _0x4a5965=this;return new Promise(function(_0x13e544,_0x37ae70){return db[_0xfd8f('0x14')][_0xfd8f('0x15')](_0x56a53e['body'],{'raw':_0x56a53e[_0xfd8f('0x16')]?_0x56a53e['options'][_0xfd8f('0x17')]===undefined?!![]:![]:!![]})[_0xfd8f('0x8')](function(_0x4033f6){logger[_0xfd8f('0x9')](_0xfd8f('0x13'),_0x56a53e);logger[_0xfd8f('0xa')](_0xfd8f('0x13'),_0x56a53e,JSON[_0xfd8f('0xc')](_0x4033f6));_0x13e544(_0x4033f6);})[_0xfd8f('0x18')](function(_0x146f7b){logger[_0xfd8f('0xd')](_0xfd8f('0x13'),_0x146f7b['message'],_0x56a53e);_0x37ae70(_0x4a5965[_0xfd8f('0xd')](0x1f4,_0x146f7b[_0xfd8f('0x10')]));});});};exports[_0xfd8f('0x19')]=function(_0x408dfa){var _0x5ed00e=this;return new Promise(function(_0x314005,_0x49631b){return db['FaxQueueReport']['update'](_0x408dfa[_0xfd8f('0x1a')],{'raw':_0x408dfa[_0xfd8f('0x16')]?_0x408dfa[_0xfd8f('0x16')][_0xfd8f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x408dfa[_0xfd8f('0x16')]?_0x408dfa[_0xfd8f('0x16')][_0xfd8f('0x1b')]||null:null,'attributes':_0x408dfa['options']?_0x408dfa[_0xfd8f('0x16')][_0xfd8f('0x1c')]||null:null,'limit':_0x408dfa[_0xfd8f('0x16')]?_0x408dfa['options']['limit']||null:null})[_0xfd8f('0x8')](function(_0x4bdddc){logger[_0xfd8f('0x9')]('UpdateFaxQueueReport',_0x408dfa);logger[_0xfd8f('0xa')](_0xfd8f('0x19'),_0x408dfa,JSON[_0xfd8f('0xc')](_0x4bdddc));_0x314005(_0x4bdddc);})[_0xfd8f('0x18')](function(_0x5bbd3c){logger[_0xfd8f('0xd')](_0xfd8f('0x19'),_0x5bbd3c['message'],_0x408dfa);_0x49631b(_0x5ed00e[_0xfd8f('0xd')](0x1f4,_0x5bbd3c[_0xfd8f('0x10')]));});});};
\ No newline at end of file
+var _0xd6d8=['raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create','options','UpdateFaxQueueReport','update','body'];(function(_0x3f7da9,_0x4db255){var _0x13d49e=function(_0x552424){while(--_0x552424){_0x3f7da9['push'](_0x3f7da9['shift']());}};_0x13d49e(++_0x4db255);}(_0xd6d8,0x158));var _0x8d6d=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xd6d8[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x8d6d('0x0'));var util=require(_0x8d6d('0x1'));var moment=require(_0x8d6d('0x2'));var BPromise=require(_0x8d6d('0x3'));var rs=require(_0x8d6d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d6d('0x5'))['db'];var utils=require(_0x8d6d('0x6'));var logger=require(_0x8d6d('0x7'))(_0x8d6d('0x8'));var config=require(_0x8d6d('0x9'));var jayson=require(_0x8d6d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x329888,_0x38706a,_0x24e9e3){return new BPromise(function(_0x3ebcfd,_0x322f9a){return client[_0x8d6d('0xb')](_0x329888,_0x24e9e3)[_0x8d6d('0xc')](function(_0x52c867){logger[_0x8d6d('0xd')](_0x8d6d('0xe'),_0x38706a,'request\x20sent');logger[_0x8d6d('0xf')](_0x8d6d('0x10'),_0x38706a,_0x8d6d('0x11'),JSON[_0x8d6d('0x12')](_0x52c867));if(_0x52c867[_0x8d6d('0x13')]){if(_0x52c867['error'][_0x8d6d('0x14')]===0x1f4){logger[_0x8d6d('0x13')](_0x8d6d('0xe'),_0x38706a,_0x52c867[_0x8d6d('0x13')][_0x8d6d('0x15')]);return _0x322f9a(_0x52c867[_0x8d6d('0x13')][_0x8d6d('0x15')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x38706a,_0x52c867[_0x8d6d('0x13')][_0x8d6d('0x15')]);return _0x3ebcfd(_0x52c867['error']['message']);}else{logger[_0x8d6d('0xd')](_0x8d6d('0xe'),_0x38706a,_0x8d6d('0x11'));_0x3ebcfd(_0x52c867[_0x8d6d('0x16')]['message']);}})['catch'](function(_0x1127b2){logger[_0x8d6d('0x13')](_0x8d6d('0xe'),_0x38706a,_0x1127b2);_0x322f9a(_0x1127b2);});});}exports[_0x8d6d('0x17')]=function(_0x3a078d){var _0x5c2c32=this;return new Promise(function(_0x21aeed,_0x31dd56){return db[_0x8d6d('0x18')][_0x8d6d('0x19')](_0x3a078d['body'],{'raw':_0x3a078d[_0x8d6d('0x1a')]?_0x3a078d[_0x8d6d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x8d6d('0xc')](function(_0x3352b8){logger['info'](_0x8d6d('0x17'),_0x3a078d);logger[_0x8d6d('0xf')](_0x8d6d('0x17'),_0x3a078d,JSON[_0x8d6d('0x12')](_0x3352b8));_0x21aeed(_0x3352b8);})['catch'](function(_0x51ec02){logger[_0x8d6d('0x13')](_0x8d6d('0x17'),_0x51ec02[_0x8d6d('0x15')],_0x3a078d);_0x31dd56(_0x5c2c32[_0x8d6d('0x13')](0x1f4,_0x51ec02[_0x8d6d('0x15')]));});});};exports[_0x8d6d('0x1b')]=function(_0x586e79){var _0x55c0bd=this;return new Promise(function(_0x721c87,_0x58833a){return db[_0x8d6d('0x18')][_0x8d6d('0x1c')](_0x586e79[_0x8d6d('0x1d')],{'raw':_0x586e79[_0x8d6d('0x1a')]?_0x586e79['options'][_0x8d6d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x586e79[_0x8d6d('0x1a')]?_0x586e79['options'][_0x8d6d('0x1f')]||null:null,'attributes':_0x586e79[_0x8d6d('0x1a')]?_0x586e79[_0x8d6d('0x1a')][_0x8d6d('0x20')]||null:null,'limit':_0x586e79[_0x8d6d('0x1a')]?_0x586e79['options'][_0x8d6d('0x21')]||null:null})[_0x8d6d('0xc')](function(_0x52883d){logger['info']('UpdateFaxQueueReport',_0x586e79);logger[_0x8d6d('0xf')](_0x8d6d('0x1b'),_0x586e79,JSON[_0x8d6d('0x12')](_0x52883d));_0x721c87(_0x52883d);})['catch'](function(_0x4b79ed){logger[_0x8d6d('0x13')](_0x8d6d('0x1b'),_0x4b79ed['message'],_0x586e79);_0x58833a(_0x55c0bd[_0x8d6d('0x13')](0x1f4,_0x4b79ed[_0x8d6d('0x15')]));});});};
\ No newline at end of file
index 4ab100b..c1c22b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a87=['express','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x1efdbd,_0x5977e8){var _0x1534a5=function(_0x5311aa){while(--_0x5311aa){_0x1efdbd['push'](_0x1efdbd['shift']());}};_0x1534a5(++_0x5977e8);}(_0x9a87,0xf9));var _0x79a8=function(_0xd0baae,_0x3020f4){_0xd0baae=_0xd0baae-0x0;var _0x538549=_0x9a87[_0xd0baae];return _0x538549;};'use strict';var multer=require(_0x79a8('0x0'));var util=require(_0x79a8('0x1'));var path=require('path');var timeout=require(_0x79a8('0x2'));var express=require(_0x79a8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x79a8('0x4'));var config=require(_0x79a8('0x5'));var controller=require(_0x79a8('0x6'));router[_0x79a8('0x7')]('/',auth[_0x79a8('0x8')](),controller['index']);router[_0x79a8('0x7')](_0x79a8('0x9'),auth[_0x79a8('0x8')](),controller[_0x79a8('0xa')]);router['get'](_0x79a8('0xb'),auth['isAuthenticated'](),controller[_0x79a8('0xc')]);router[_0x79a8('0xd')]('/',auth[_0x79a8('0x8')](),controller['create']);router['put']('/:id',auth[_0x79a8('0x8')](),controller[_0x79a8('0xe')]);router[_0x79a8('0xf')]('/:id',auth[_0x79a8('0x8')](),controller[_0x79a8('0x10')]);module[_0x79a8('0x11')]=router;
\ No newline at end of file
+var _0x79ad=['../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x79ad,0x9a));var _0xd79a=function(_0x8c1fcf,_0x4c5f1d){_0x8c1fcf=_0x8c1fcf-0x0;var _0x552198=_0x79ad[_0x8c1fcf];return _0x552198;};'use strict';var multer=require('multer');var util=require(_0xd79a('0x0'));var path=require(_0xd79a('0x1'));var timeout=require(_0xd79a('0x2'));var express=require(_0xd79a('0x3'));var router=express[_0xd79a('0x4')]();var auth=require(_0xd79a('0x5'));var interaction=require(_0xd79a('0x6'));var config=require(_0xd79a('0x7'));var controller=require(_0xd79a('0x8'));router[_0xd79a('0x9')]('/',auth['isAuthenticated'](),controller[_0xd79a('0xa')]);router[_0xd79a('0x9')](_0xd79a('0xb'),auth[_0xd79a('0xc')](),controller['describe']);router[_0xd79a('0x9')](_0xd79a('0xd'),auth['isAuthenticated'](),controller[_0xd79a('0xe')]);router[_0xd79a('0xf')]('/',auth['isAuthenticated'](),controller[_0xd79a('0x10')]);router[_0xd79a('0x11')]('/:id',auth[_0xd79a('0xc')](),controller[_0xd79a('0x12')]);router[_0xd79a('0x13')](_0xd79a('0xd'),auth[_0xd79a('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 74cca2d..931ac25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7815=['agent','queue','DATE','exports','STRING','ENUM','account'];(function(_0x223c0d,_0x3ec04d){var _0x207827=function(_0x39d240){while(--_0x39d240){_0x223c0d['push'](_0x223c0d['shift']());}};_0x207827(++_0x3ec04d);}(_0x7815,0x1ca));var _0x5781=function(_0x298e28,_0x2d6d9f){_0x298e28=_0x298e28-0x0;var _0x1433ac=_0x7815[_0x298e28];return _0x1433ac;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x5781('0x0')]={'uniqueid':{'type':Sequelize[_0x5781('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5781('0x2')](_0x5781('0x3'),_0x5781('0x4'),'queue'),'allowNull':![],'defaultValue':_0x5781('0x5')},'transferredAt':{'type':Sequelize[_0x5781('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xca0d=['ENUM','agent','queue','NOW','moment','sequelize','STRING'];(function(_0x479e21,_0x385fd9){var _0x422e9c=function(_0x1dc4ca){while(--_0x1dc4ca){_0x479e21['push'](_0x479e21['shift']());}};_0x422e9c(++_0x385fd9);}(_0xca0d,0x13f));var _0xdca0=function(_0x3d6eed,_0x3acc13){_0x3d6eed=_0x3d6eed-0x0;var _0x410794=_0xca0d[_0x3d6eed];return _0x410794;};'use strict';var moment=require(_0xdca0('0x0'));var Sequelize=require(_0xdca0('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xdca0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdca0('0x3')]('account',_0xdca0('0x4'),_0xdca0('0x5')),'allowNull':![],'defaultValue':_0xdca0('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xdca0('0x6')]}};
\ No newline at end of file
index a0ac4de..39874a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','FaxTransferReport','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','merge','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x5b70c1,_0x5f42ef){var _0x2b24b2=function(_0x37740f){while(--_0x37740f){_0x5b70c1['push'](_0x5b70c1['shift']());}};_0x2b24b2(++_0x5f42ef);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x65f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65f6('0x1'));var jsonpatch=require(_0x65f6('0x2'));var rp=require(_0x65f6('0x3'));var moment=require(_0x65f6('0x4'));var BPromise=require(_0x65f6('0x5'));var Mustache=require('mustache');var util=require(_0x65f6('0x6'));var path=require('path');var sox=require(_0x65f6('0x7'));var csv=require(_0x65f6('0x8'));var ejs=require('ejs');var fs=require('fs');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('0x8'));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 db=require(_0x65f6('0x13'))['db'];function respondWithStatusCode(_0x576875,_0x419819){_0x419819=_0x419819||0xcc;return function(_0x4862a5){if(_0x4862a5){return _0x576875[_0x65f6('0x14')](_0x419819);}return _0x576875[_0x65f6('0x15')](_0x419819)[_0x65f6('0x16')]();};}function respondWithResult(_0x217570,_0x369f96){_0x369f96=_0x369f96||0xc8;return function(_0x1d29fd){if(_0x1d29fd){return _0x217570[_0x65f6('0x15')](_0x369f96)[_0x65f6('0x17')](_0x1d29fd);}};}function respondWithFilteredResult(_0x46dbc6,_0x3440af){return function(_0x59154e){if(_0x59154e){var _0x19b9ff=_0x59154e[_0x65f6('0x18')],_0x49a913=_0x3440af[_0x65f6('0x19')],_0x5dd324=_0x3440af[_0x65f6('0x19')]+_0x3440af[_0x65f6('0x1a')],_0x1693e6;if(_0x5dd324>=_0x19b9ff){_0x5dd324=_0x19b9ff;_0x1693e6=0xc8;}else{_0x1693e6=0xce;}_0x46dbc6[_0x65f6('0x15')](_0x1693e6);return _0x46dbc6[_0x65f6('0x1b')](_0x65f6('0x1c'),_0x49a913+'-'+_0x5dd324+'/'+_0x19b9ff)['json'](_0x59154e);}return null;};}function patchUpdates(_0x4d79a1){return function(_0x2d538c){try{jsonpatch['apply'](_0x2d538c,_0x4d79a1,!![]);}catch(_0x4c81f3){return BPromise['reject'](_0x4c81f3);}return _0x2d538c[_0x65f6('0x1d')]();};}function saveUpdates(_0x21ea88,_0x5114a4){return function(_0x39e19f){if(_0x39e19f){return _0x39e19f[_0x65f6('0x1e')](_0x21ea88)[_0x65f6('0x1f')](function(_0x3876ed){return _0x3876ed;});}return null;};}function removeEntity(_0x219ab2,_0xc139c2){return function(_0x581374){if(_0x581374){return _0x581374[_0x65f6('0x20')]()['then'](function(){_0x219ab2['status'](0xcc)[_0x65f6('0x16')]();});}};}function handleEntityNotFound(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(!_0x1eeaaa){_0xd173f4[_0x65f6('0x14')](0x194);}return _0x1eeaaa;};}function handleError(_0x2317ce,_0x2774a1){_0x2774a1=_0x2774a1||0x1f4;return function(_0x4f5a69){logger[_0x65f6('0x21')](_0x4f5a69[_0x65f6('0x22')]);if(_0x4f5a69[_0x65f6('0x23')]){delete _0x4f5a69['name'];}_0x2317ce['status'](_0x2774a1)['send'](_0x4f5a69);};}exports[_0x65f6('0x24')]=function(_0x16cde8,_0x4b2292){var _0x296cd9={},_0x28f710={},_0x52277c={'count':0x0,'rows':[]};var _0x325cb4=_[_0x65f6('0x25')](db[_0x65f6('0x26')]['rawAttributes'],function(_0x4ac04b){return{'name':_0x4ac04b['fieldName'],'type':_0x4ac04b[_0x65f6('0x27')][_0x65f6('0x28')]};});_0x28f710[_0x65f6('0x29')]=_[_0x65f6('0x25')](_0x325cb4,_0x65f6('0x23'));_0x28f710[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](_0x16cde8['query']);_0x28f710['filters']=_[_0x65f6('0x2c')](_0x28f710[_0x65f6('0x29')],_0x28f710['query']);_0x296cd9['attributes']=_[_0x65f6('0x2c')](_0x28f710[_0x65f6('0x29')],qs[_0x65f6('0x2d')](_0x16cde8[_0x65f6('0x2a')][_0x65f6('0x2d')]));_0x296cd9[_0x65f6('0x2e')]=_0x296cd9['attributes'][_0x65f6('0x2f')]?_0x296cd9[_0x65f6('0x2e')]:_0x28f710[_0x65f6('0x29')];if(!_0x16cde8['query'][_0x65f6('0x30')](_0x65f6('0x31'))){_0x296cd9[_0x65f6('0x1a')]=qs[_0x65f6('0x1a')](_0x16cde8[_0x65f6('0x2a')][_0x65f6('0x1a')]);_0x296cd9['offset']=qs[_0x65f6('0x19')](_0x16cde8[_0x65f6('0x2a')]['offset']);}_0x296cd9[_0x65f6('0x32')]=qs['sort'](_0x16cde8[_0x65f6('0x2a')]['sort']);_0x296cd9[_0x65f6('0x33')]=qs[_0x65f6('0x34')](_['pick'](_0x16cde8[_0x65f6('0x2a')],_0x28f710[_0x65f6('0x34')]),_0x325cb4);if(_0x16cde8[_0x65f6('0x2a')]['filter']){_0x296cd9['where']=_[_0x65f6('0x35')](_0x296cd9['where'],{'$or':_[_0x65f6('0x25')](_0x325cb4,function(_0x4e6653){if(_0x4e6653[_0x65f6('0x27')]!==_0x65f6('0x36')){var _0x5e97f1={};_0x5e97f1[_0x4e6653[_0x65f6('0x23')]]={'$like':'%'+_0x16cde8['query']['filter']+'%'};return _0x5e97f1;}})});}_0x296cd9=_[_0x65f6('0x35')]({},_0x296cd9,_0x16cde8[_0x65f6('0x37')]);var _0x413956={'where':_0x296cd9[_0x65f6('0x33')]};return db[_0x65f6('0x26')][_0x65f6('0x18')](_0x413956)[_0x65f6('0x1f')](function(_0x1153f1){_0x52277c['count']=_0x1153f1;if(_0x16cde8[_0x65f6('0x2a')]['includeAll']){_0x296cd9[_0x65f6('0x38')]=[{'all':!![]}];}return db[_0x65f6('0x26')][_0x65f6('0x39')](_0x296cd9);})[_0x65f6('0x1f')](function(_0x5ef5c2){_0x52277c[_0x65f6('0x3a')]=_0x5ef5c2;return _0x52277c;})[_0x65f6('0x1f')](respondWithFilteredResult(_0x4b2292,_0x296cd9))[_0x65f6('0x3b')](handleError(_0x4b2292,null));};exports[_0x65f6('0x3c')]=function(_0x81fd69,_0x3f6103){var _0xed4c96={'raw':!![],'where':{'id':_0x81fd69[_0x65f6('0x3d')]['id']}},_0x2acca5={};_0x2acca5['model']=_[_0x65f6('0x2b')](db[_0x65f6('0x26')][_0x65f6('0x3e')]);_0x2acca5[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](_0x81fd69[_0x65f6('0x2a')]);_0x2acca5[_0x65f6('0x34')]=_[_0x65f6('0x2c')](_0x2acca5[_0x65f6('0x29')],_0x2acca5[_0x65f6('0x2a')]);_0xed4c96[_0x65f6('0x2e')]=_[_0x65f6('0x2c')](_0x2acca5[_0x65f6('0x29')],qs[_0x65f6('0x2d')](_0x81fd69[_0x65f6('0x2a')][_0x65f6('0x2d')]));_0xed4c96['attributes']=_0xed4c96[_0x65f6('0x2e')][_0x65f6('0x2f')]?_0xed4c96[_0x65f6('0x2e')]:_0x2acca5[_0x65f6('0x29')];if(_0x81fd69['query'][_0x65f6('0x3f')]){_0xed4c96[_0x65f6('0x38')]=[{'all':!![]}];}_0xed4c96=_[_0x65f6('0x35')]({},_0xed4c96,_0x81fd69['options']);return db[_0x65f6('0x26')][_0x65f6('0x40')](_0xed4c96)[_0x65f6('0x1f')](handleEntityNotFound(_0x3f6103,null))[_0x65f6('0x1f')](respondWithResult(_0x3f6103,null))['catch'](handleError(_0x3f6103,null));};exports[_0x65f6('0x41')]=function(_0x512527,_0x3f1baa){return db[_0x65f6('0x26')]['create'](_0x512527[_0x65f6('0x42')],{})['then'](respondWithResult(_0x3f1baa,0xc9))[_0x65f6('0x3b')](handleError(_0x3f1baa,null));};exports[_0x65f6('0x1e')]=function(_0x2d1706,_0xc0db01){if(_0x2d1706[_0x65f6('0x42')]['id']){delete _0x2d1706[_0x65f6('0x42')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x2d1706[_0x65f6('0x3d')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0xc0db01,null))[_0x65f6('0x1f')](saveUpdates(_0x2d1706[_0x65f6('0x42')],null))[_0x65f6('0x1f')](respondWithResult(_0xc0db01,null))[_0x65f6('0x3b')](handleError(_0xc0db01,null));};exports[_0x65f6('0x20')]=function(_0x41690c,_0x414f49){return db['FaxTransferReport'][_0x65f6('0x40')]({'where':{'id':_0x41690c[_0x65f6('0x3d')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x414f49,null))['then'](removeEntity(_0x414f49,null))[_0x65f6('0x3b')](handleError(_0x414f49,null));};exports[_0x65f6('0x43')]=function(_0x49ba5a,_0x22d745){return db[_0x65f6('0x26')]['describe']()[_0x65f6('0x1f')](respondWithResult(_0x22d745,null))['catch'](handleError(_0x22d745,null));};
\ No newline at end of file
+var _0x5f66=['show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','FaxTransferReport','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','merge','VIRTUAL','options','include','findAll','rows','catch'];(function(_0x5983ae,_0x2f7ac0){var _0x42deed=function(_0x19aad8){while(--_0x19aad8){_0x5983ae['push'](_0x5983ae['shift']());}};_0x42deed(++_0x2f7ac0);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x65f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65f6('0x1'));var jsonpatch=require(_0x65f6('0x2'));var rp=require(_0x65f6('0x3'));var moment=require(_0x65f6('0x4'));var BPromise=require(_0x65f6('0x5'));var Mustache=require('mustache');var util=require(_0x65f6('0x6'));var path=require('path');var sox=require(_0x65f6('0x7'));var csv=require(_0x65f6('0x8'));var ejs=require('ejs');var fs=require('fs');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('0x8'));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 db=require(_0x65f6('0x13'))['db'];function respondWithStatusCode(_0x576875,_0x419819){_0x419819=_0x419819||0xcc;return function(_0x4862a5){if(_0x4862a5){return _0x576875[_0x65f6('0x14')](_0x419819);}return _0x576875[_0x65f6('0x15')](_0x419819)[_0x65f6('0x16')]();};}function respondWithResult(_0x217570,_0x369f96){_0x369f96=_0x369f96||0xc8;return function(_0x1d29fd){if(_0x1d29fd){return _0x217570[_0x65f6('0x15')](_0x369f96)[_0x65f6('0x17')](_0x1d29fd);}};}function respondWithFilteredResult(_0x46dbc6,_0x3440af){return function(_0x59154e){if(_0x59154e){var _0x19b9ff=_0x59154e[_0x65f6('0x18')],_0x49a913=_0x3440af[_0x65f6('0x19')],_0x5dd324=_0x3440af[_0x65f6('0x19')]+_0x3440af[_0x65f6('0x1a')],_0x1693e6;if(_0x5dd324>=_0x19b9ff){_0x5dd324=_0x19b9ff;_0x1693e6=0xc8;}else{_0x1693e6=0xce;}_0x46dbc6[_0x65f6('0x15')](_0x1693e6);return _0x46dbc6[_0x65f6('0x1b')](_0x65f6('0x1c'),_0x49a913+'-'+_0x5dd324+'/'+_0x19b9ff)['json'](_0x59154e);}return null;};}function patchUpdates(_0x4d79a1){return function(_0x2d538c){try{jsonpatch['apply'](_0x2d538c,_0x4d79a1,!![]);}catch(_0x4c81f3){return BPromise['reject'](_0x4c81f3);}return _0x2d538c[_0x65f6('0x1d')]();};}function saveUpdates(_0x21ea88,_0x5114a4){return function(_0x39e19f){if(_0x39e19f){return _0x39e19f[_0x65f6('0x1e')](_0x21ea88)[_0x65f6('0x1f')](function(_0x3876ed){return _0x3876ed;});}return null;};}function removeEntity(_0x219ab2,_0xc139c2){return function(_0x581374){if(_0x581374){return _0x581374[_0x65f6('0x20')]()['then'](function(){_0x219ab2['status'](0xcc)[_0x65f6('0x16')]();});}};}function handleEntityNotFound(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(!_0x1eeaaa){_0xd173f4[_0x65f6('0x14')](0x194);}return _0x1eeaaa;};}function handleError(_0x2317ce,_0x2774a1){_0x2774a1=_0x2774a1||0x1f4;return function(_0x4f5a69){logger[_0x65f6('0x21')](_0x4f5a69[_0x65f6('0x22')]);if(_0x4f5a69[_0x65f6('0x23')]){delete _0x4f5a69['name'];}_0x2317ce['status'](_0x2774a1)['send'](_0x4f5a69);};}exports[_0x65f6('0x24')]=function(_0x16cde8,_0x4b2292){var _0x296cd9={},_0x28f710={},_0x52277c={'count':0x0,'rows':[]};var _0x325cb4=_[_0x65f6('0x25')](db[_0x65f6('0x26')]['rawAttributes'],function(_0x4ac04b){return{'name':_0x4ac04b['fieldName'],'type':_0x4ac04b[_0x65f6('0x27')][_0x65f6('0x28')]};});_0x28f710[_0x65f6('0x29')]=_[_0x65f6('0x25')](_0x325cb4,_0x65f6('0x23'));_0x28f710[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](_0x16cde8['query']);_0x28f710['filters']=_[_0x65f6('0x2c')](_0x28f710[_0x65f6('0x29')],_0x28f710['query']);_0x296cd9['attributes']=_[_0x65f6('0x2c')](_0x28f710[_0x65f6('0x29')],qs[_0x65f6('0x2d')](_0x16cde8[_0x65f6('0x2a')][_0x65f6('0x2d')]));_0x296cd9[_0x65f6('0x2e')]=_0x296cd9['attributes'][_0x65f6('0x2f')]?_0x296cd9[_0x65f6('0x2e')]:_0x28f710[_0x65f6('0x29')];if(!_0x16cde8['query'][_0x65f6('0x30')](_0x65f6('0x31'))){_0x296cd9[_0x65f6('0x1a')]=qs[_0x65f6('0x1a')](_0x16cde8[_0x65f6('0x2a')][_0x65f6('0x1a')]);_0x296cd9['offset']=qs[_0x65f6('0x19')](_0x16cde8[_0x65f6('0x2a')]['offset']);}_0x296cd9[_0x65f6('0x32')]=qs['sort'](_0x16cde8[_0x65f6('0x2a')]['sort']);_0x296cd9[_0x65f6('0x33')]=qs[_0x65f6('0x34')](_['pick'](_0x16cde8[_0x65f6('0x2a')],_0x28f710[_0x65f6('0x34')]),_0x325cb4);if(_0x16cde8[_0x65f6('0x2a')]['filter']){_0x296cd9['where']=_[_0x65f6('0x35')](_0x296cd9['where'],{'$or':_[_0x65f6('0x25')](_0x325cb4,function(_0x4e6653){if(_0x4e6653[_0x65f6('0x27')]!==_0x65f6('0x36')){var _0x5e97f1={};_0x5e97f1[_0x4e6653[_0x65f6('0x23')]]={'$like':'%'+_0x16cde8['query']['filter']+'%'};return _0x5e97f1;}})});}_0x296cd9=_[_0x65f6('0x35')]({},_0x296cd9,_0x16cde8[_0x65f6('0x37')]);var _0x413956={'where':_0x296cd9[_0x65f6('0x33')]};return db[_0x65f6('0x26')][_0x65f6('0x18')](_0x413956)[_0x65f6('0x1f')](function(_0x1153f1){_0x52277c['count']=_0x1153f1;if(_0x16cde8[_0x65f6('0x2a')]['includeAll']){_0x296cd9[_0x65f6('0x38')]=[{'all':!![]}];}return db[_0x65f6('0x26')][_0x65f6('0x39')](_0x296cd9);})[_0x65f6('0x1f')](function(_0x5ef5c2){_0x52277c[_0x65f6('0x3a')]=_0x5ef5c2;return _0x52277c;})[_0x65f6('0x1f')](respondWithFilteredResult(_0x4b2292,_0x296cd9))[_0x65f6('0x3b')](handleError(_0x4b2292,null));};exports[_0x65f6('0x3c')]=function(_0x81fd69,_0x3f6103){var _0xed4c96={'raw':!![],'where':{'id':_0x81fd69[_0x65f6('0x3d')]['id']}},_0x2acca5={};_0x2acca5['model']=_[_0x65f6('0x2b')](db[_0x65f6('0x26')][_0x65f6('0x3e')]);_0x2acca5[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](_0x81fd69[_0x65f6('0x2a')]);_0x2acca5[_0x65f6('0x34')]=_[_0x65f6('0x2c')](_0x2acca5[_0x65f6('0x29')],_0x2acca5[_0x65f6('0x2a')]);_0xed4c96[_0x65f6('0x2e')]=_[_0x65f6('0x2c')](_0x2acca5[_0x65f6('0x29')],qs[_0x65f6('0x2d')](_0x81fd69[_0x65f6('0x2a')][_0x65f6('0x2d')]));_0xed4c96['attributes']=_0xed4c96[_0x65f6('0x2e')][_0x65f6('0x2f')]?_0xed4c96[_0x65f6('0x2e')]:_0x2acca5[_0x65f6('0x29')];if(_0x81fd69['query'][_0x65f6('0x3f')]){_0xed4c96[_0x65f6('0x38')]=[{'all':!![]}];}_0xed4c96=_[_0x65f6('0x35')]({},_0xed4c96,_0x81fd69['options']);return db[_0x65f6('0x26')][_0x65f6('0x40')](_0xed4c96)[_0x65f6('0x1f')](handleEntityNotFound(_0x3f6103,null))[_0x65f6('0x1f')](respondWithResult(_0x3f6103,null))['catch'](handleError(_0x3f6103,null));};exports[_0x65f6('0x41')]=function(_0x512527,_0x3f1baa){return db[_0x65f6('0x26')]['create'](_0x512527[_0x65f6('0x42')],{})['then'](respondWithResult(_0x3f1baa,0xc9))[_0x65f6('0x3b')](handleError(_0x3f1baa,null));};exports[_0x65f6('0x1e')]=function(_0x2d1706,_0xc0db01){if(_0x2d1706[_0x65f6('0x42')]['id']){delete _0x2d1706[_0x65f6('0x42')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x2d1706[_0x65f6('0x3d')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0xc0db01,null))[_0x65f6('0x1f')](saveUpdates(_0x2d1706[_0x65f6('0x42')],null))[_0x65f6('0x1f')](respondWithResult(_0xc0db01,null))[_0x65f6('0x3b')](handleError(_0xc0db01,null));};exports[_0x65f6('0x20')]=function(_0x41690c,_0x414f49){return db['FaxTransferReport'][_0x65f6('0x40')]({'where':{'id':_0x41690c[_0x65f6('0x3d')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x414f49,null))['then'](removeEntity(_0x414f49,null))[_0x65f6('0x3b')](handleError(_0x414f49,null));};exports[_0x65f6('0x43')]=function(_0x49ba5a,_0x22d745){return db[_0x65f6('0x26')]['describe']()[_0x65f6('0x1f')](respondWithResult(_0x22d745,null))['catch'](handleError(_0x22d745,null));};
\ No newline at end of file
index be15c28..e6374d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc21=['request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0xbc21,0xcd));var _0x1bc2=function(_0xc5a41c,_0x4bd1bf){_0xc5a41c=_0xc5a41c-0x0;var _0x7b3250=_0xbc21[_0xc5a41c];return _0x7b3250;};'use strict';var _=require(_0x1bc2('0x0'));var util=require(_0x1bc2('0x1'));var logger=require(_0x1bc2('0x2'))('api');var moment=require(_0x1bc2('0x3'));var BPromise=require(_0x1bc2('0x4'));var rp=require(_0x1bc2('0x5'));var fs=require('fs');var path=require(_0x1bc2('0x6'));var rimraf=require(_0x1bc2('0x7'));var config=require(_0x1bc2('0x8'));var attributes=require(_0x1bc2('0x9'));module[_0x1bc2('0xa')]=function(_0x464edc,_0x56733c){return _0x464edc[_0x1bc2('0xb')](_0x1bc2('0xc'),attributes,{'tableName':_0x1bc2('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1bc2('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0b94=['./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4d9808,_0x52afc2){var _0x17fd82=function(_0x4bbc1b){while(--_0x4bbc1b){_0x4d9808['push'](_0x4d9808['shift']());}};_0x17fd82(++_0x52afc2);}(_0x0b94,0xaf));var _0x40b9=function(_0x47c070,_0xc77ebc){_0x47c070=_0x47c070-0x0;var _0x1e9b39=_0x0b94[_0x47c070];return _0x1e9b39;};'use strict';var _=require(_0x40b9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x40b9('0x1'));var moment=require(_0x40b9('0x2'));var BPromise=require(_0x40b9('0x3'));var rp=require(_0x40b9('0x4'));var fs=require('fs');var path=require(_0x40b9('0x5'));var rimraf=require(_0x40b9('0x6'));var config=require('../../config/environment');var attributes=require(_0x40b9('0x7'));module[_0x40b9('0x8')]=function(_0x155e57,_0x5aa72c){return _0x155e57[_0x40b9('0x9')](_0x40b9('0xa'),attributes,{'tableName':_0x40b9('0xb'),'paranoid':![],'indexes':[{'name':_0x40b9('0xc'),'fields':[_0x40b9('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 921072c..0ef3a1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e7d=['FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxTransferReport,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x256fa5,_0x1881e9){var _0x5836e4=function(_0x3d4231){while(--_0x3d4231){_0x256fa5['push'](_0x256fa5['shift']());}};_0x5836e4(++_0x1881e9);}(_0x1e7d,0xdf));var _0xd1e7=function(_0xa347de,_0x3b6d48){_0xa347de=_0xa347de-0x0;var _0xbb1894=_0x1e7d[_0xa347de];return _0xbb1894;};'use strict';var _=require(_0xd1e7('0x0'));var util=require(_0xd1e7('0x1'));var moment=require(_0xd1e7('0x2'));var BPromise=require(_0xd1e7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1e7('0x4'));var db=require(_0xd1e7('0x5'))['db'];var utils=require(_0xd1e7('0x6'));var logger=require(_0xd1e7('0x7'))(_0xd1e7('0x8'));var config=require(_0xd1e7('0x9'));var jayson=require(_0xd1e7('0xa'));var client=jayson[_0xd1e7('0xb')][_0xd1e7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a3514,_0x14098b,_0xe9988b){return new BPromise(function(_0x36d000,_0x365df0){return client[_0xd1e7('0xd')](_0x4a3514,_0xe9988b)['then'](function(_0x1b017c){logger[_0xd1e7('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x14098b,_0xd1e7('0xf'));logger[_0xd1e7('0x10')](_0xd1e7('0x11'),_0x14098b,'request\x20sent',JSON[_0xd1e7('0x12')](_0x1b017c));if(_0x1b017c['error']){if(_0x1b017c[_0xd1e7('0x13')][_0xd1e7('0x14')]===0x1f4){logger[_0xd1e7('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x14098b,_0x1b017c[_0xd1e7('0x13')][_0xd1e7('0x15')]);return _0x365df0(_0x1b017c[_0xd1e7('0x13')][_0xd1e7('0x15')]);}logger[_0xd1e7('0x13')](_0xd1e7('0x16'),_0x14098b,_0x1b017c[_0xd1e7('0x13')][_0xd1e7('0x15')]);return _0x36d000(_0x1b017c[_0xd1e7('0x13')][_0xd1e7('0x15')]);}else{logger['info'](_0xd1e7('0x16'),_0x14098b,_0xd1e7('0xf'));_0x36d000(_0x1b017c['result'][_0xd1e7('0x15')]);}})[_0xd1e7('0x17')](function(_0x572569){logger[_0xd1e7('0x13')](_0xd1e7('0x16'),_0x14098b,_0x572569);_0x365df0(_0x572569);});});}
\ No newline at end of file
+var _0xf924=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x411475,_0xcecb1f){var _0x5a8130=function(_0x4bbbc8){while(--_0x4bbbc8){_0x411475['push'](_0x411475['shift']());}};_0x5a8130(++_0xcecb1f);}(_0xf924,0x9d));var _0x4f92=function(_0x2170e3,_0x39d8c4){_0x2170e3=_0x2170e3-0x0;var _0x4b1363=_0xf924[_0x2170e3];return _0x4b1363;};'use strict';var _=require(_0x4f92('0x0'));var util=require(_0x4f92('0x1'));var moment=require(_0x4f92('0x2'));var BPromise=require(_0x4f92('0x3'));var rs=require(_0x4f92('0x4'));var fs=require('fs');var Redis=require(_0x4f92('0x5'));var db=require(_0x4f92('0x6'))['db'];var utils=require(_0x4f92('0x7'));var logger=require(_0x4f92('0x8'))(_0x4f92('0x9'));var config=require('../../config/environment');var jayson=require(_0x4f92('0xa'));var client=jayson[_0x4f92('0xb')][_0x4f92('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30a976,_0x1ef1b6,_0xadda01){return new BPromise(function(_0x4efe1c,_0x539a22){return client[_0x4f92('0xd')](_0x30a976,_0xadda01)['then'](function(_0x499f35){logger[_0x4f92('0xe')](_0x4f92('0xf'),_0x1ef1b6,_0x4f92('0x10'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x1ef1b6,_0x4f92('0x10'),JSON[_0x4f92('0x11')](_0x499f35));if(_0x499f35['error']){if(_0x499f35[_0x4f92('0x12')][_0x4f92('0x13')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x1ef1b6,_0x499f35[_0x4f92('0x12')][_0x4f92('0x14')]);return _0x539a22(_0x499f35[_0x4f92('0x12')][_0x4f92('0x14')]);}logger[_0x4f92('0x12')](_0x4f92('0xf'),_0x1ef1b6,_0x499f35['error']['message']);return _0x4efe1c(_0x499f35[_0x4f92('0x12')][_0x4f92('0x14')]);}else{logger[_0x4f92('0xe')](_0x4f92('0xf'),_0x1ef1b6,'request\x20sent');_0x4efe1c(_0x499f35[_0x4f92('0x15')][_0x4f92('0x14')]);}})[_0x4f92('0x16')](function(_0x4cb252){logger[_0x4f92('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x1ef1b6,_0x4cb252);_0x539a22(_0x4cb252);});});}
\ No newline at end of file
index f933e4d..955768c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca04=['Router','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','put','update','delete','multer','util','path'];(function(_0x3773ff,_0x8eed70){var _0x1c966f=function(_0x5cbe46){while(--_0x5cbe46){_0x3773ff['push'](_0x3773ff['shift']());}};_0x1c966f(++_0x8eed70);}(_0xca04,0x96));var _0x4ca0=function(_0x245c14,_0x462b6c){_0x245c14=_0x245c14-0x0;var _0x13c7d7=_0xca04[_0x245c14];return _0x13c7d7;};'use strict';var multer=require(_0x4ca0('0x0'));var util=require(_0x4ca0('0x1'));var path=require(_0x4ca0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4ca0('0x3')]();var auth=require(_0x4ca0('0x4'));var interaction=require(_0x4ca0('0x5'));var config=require('../../config/environment');var controller=require(_0x4ca0('0x6'));router[_0x4ca0('0x7')]('/',auth['isAuthenticated'](),controller[_0x4ca0('0x8')]);router[_0x4ca0('0x7')](_0x4ca0('0x9'),auth[_0x4ca0('0xa')](),controller['describe']);router[_0x4ca0('0x7')](_0x4ca0('0xb'),auth['isAuthenticated'](),controller[_0x4ca0('0xc')]);router[_0x4ca0('0xd')]('/',auth[_0x4ca0('0xa')](),controller['create']);router[_0x4ca0('0xe')]('/:id',auth[_0x4ca0('0xa')](),controller[_0x4ca0('0xf')]);router[_0x4ca0('0x10')]('/:id',auth[_0x4ca0('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x92e4=['/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x3a0f88,_0x1533b0){var _0x5e2ed0=function(_0x3b0edb){while(--_0x3b0edb){_0x3a0f88['push'](_0x3a0f88['shift']());}};_0x5e2ed0(++_0x1533b0);}(_0x92e4,0x172));var _0x492e=function(_0x35dfa7,_0x380025){_0x35dfa7=_0x35dfa7-0x0;var _0x3c2519=_0x92e4[_0x35dfa7];return _0x3c2519;};'use strict';var multer=require(_0x492e('0x0'));var util=require(_0x492e('0x1'));var path=require('path');var timeout=require(_0x492e('0x2'));var express=require(_0x492e('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x492e('0x4'));var config=require(_0x492e('0x5'));var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0x492e('0x6')](),controller['index']);router[_0x492e('0x7')](_0x492e('0x8'),auth[_0x492e('0x6')](),controller['describe']);router['get']('/:id',auth[_0x492e('0x6')](),controller[_0x492e('0x9')]);router[_0x492e('0xa')]('/',auth[_0x492e('0x6')](),controller[_0x492e('0xb')]);router[_0x492e('0xc')](_0x492e('0xd'),auth[_0x492e('0x6')](),controller[_0x492e('0xe')]);router[_0x492e('0xf')](_0x492e('0xd'),auth[_0x492e('0x6')](),controller[_0x492e('0x10')]);module[_0x492e('0x11')]=router;
\ No newline at end of file
index 76d2e18..cd630e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd50=['show','getConfigurations','getFields','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated'];(function(_0x1336c6,_0x5c30b0){var _0x442c9f=function(_0x1bf76e){while(--_0x1bf76e){_0x1336c6['push'](_0x1336c6['shift']());}};_0x442c9f(++_0x5c30b0);}(_0xbd50,0x196));var _0x0bd5=function(_0xe63ca1,_0x38dbee){_0xe63ca1=_0xe63ca1-0x0;var _0x3a2983=_0xbd50[_0xe63ca1];return _0x3a2983;};'use strict';var multer=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var path=require(_0x0bd5('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bd5('0x3'));var router=express[_0x0bd5('0x4')]();var auth=require(_0x0bd5('0x5'));var interaction=require(_0x0bd5('0x6'));var config=require(_0x0bd5('0x7'));var controller=require('./intDeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0bd5('0x8')]);router[_0x0bd5('0x9')](_0x0bd5('0xa'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0xc')]);router['get']('/:id/configurations',auth[_0x0bd5('0xb')](),controller[_0x0bd5('0xd')]);router[_0x0bd5('0x9')]('/:id/fields',auth[_0x0bd5('0xb')](),controller[_0x0bd5('0xe')]);router['post']('/',auth[_0x0bd5('0xb')](),controller[_0x0bd5('0xf')]);router['post'](_0x0bd5('0x10'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x11')]);router['put'](_0x0bd5('0xa'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x12')]);router[_0x0bd5('0x13')](_0x0bd5('0xa'),auth[_0x0bd5('0xb')](),controller[_0x0bd5('0x14')]);module[_0x0bd5('0x15')]=router;
\ No newline at end of file
+var _0xf2ca=['/:id','show','getFields','post','/:id/configurations','addConfiguration','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get'];(function(_0x478a25,_0x1f896b){var _0x4cdefa=function(_0x9d8d96){while(--_0x9d8d96){_0x478a25['push'](_0x478a25['shift']());}};_0x4cdefa(++_0x1f896b);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x4e8401,_0x51b328){_0x4e8401=_0x4e8401-0x0;var _0x17269f=_0xf2ca[_0x4e8401];return _0x17269f;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var auth=require(_0xaf2c('0x5'));var interaction=require(_0xaf2c('0x6'));var config=require(_0xaf2c('0x7'));var controller=require(_0xaf2c('0x8'));router['get']('/',auth[_0xaf2c('0x9')](),controller[_0xaf2c('0xa')]);router[_0xaf2c('0xb')](_0xaf2c('0xc'),auth['isAuthenticated'](),controller[_0xaf2c('0xd')]);router[_0xaf2c('0xb')]('/:id/configurations',auth[_0xaf2c('0x9')](),controller['getConfigurations']);router[_0xaf2c('0xb')]('/:id/fields',auth[_0xaf2c('0x9')](),controller[_0xaf2c('0xe')]);router[_0xaf2c('0xf')]('/',auth[_0xaf2c('0x9')](),controller['create']);router['post'](_0xaf2c('0x10'),auth[_0xaf2c('0x9')](),controller[_0xaf2c('0x11')]);router[_0xaf2c('0x12')](_0xaf2c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xaf2c('0x13')](_0xaf2c('0xc'),auth[_0xaf2c('0x9')](),controller[_0xaf2c('0x14')]);module[_0xaf2c('0x15')]=router;
\ No newline at end of file
index 0a8c9ea..cabff5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe242=['ENUM','integrationTab','newTab','exports','STRING','basic'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xe242,0x9f));var _0x2e24=function(_0x575af6,_0x571f0f){_0x575af6=_0x575af6-0x0;var _0x1c28ca=_0xe242[_0x575af6];return _0x1c28ca;};'use strict';var Sequelize=require('sequelize');module[_0x2e24('0x0')]={'name':{'type':Sequelize[_0x2e24('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x2e24('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x2e24('0x2')),'defaultValue':_0x2e24('0x2')},'password':{'type':Sequelize[_0x2e24('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x2e24('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2e24('0x3')](_0x2e24('0x4'),_0x2e24('0x5')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0x0504=['sequelize','STRING','basic','ENUM','integrationTab','newTab'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0504,0x186));var _0x4050=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x0504[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0x4050('0x0'));module['exports']={'name':{'type':Sequelize[_0x4050('0x1')]},'description':{'type':Sequelize[_0x4050('0x1')]},'username':{'type':Sequelize[_0x4050('0x1')]},'remoteUri':{'type':Sequelize[_0x4050('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x4050('0x2')),'defaultValue':_0x4050('0x2')},'password':{'type':Sequelize[_0x4050('0x1')]},'consumerKey':{'type':Sequelize[_0x4050('0x1')]},'consumerSecret':{'type':Sequelize[_0x4050('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4050('0x3')](_0x4050('0x4'),_0x4050('0x5')),'defaultValue':'integrationTab'}};
\ No newline at end of file
index e230e33..93e0e38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac11=['GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','password','concat','_embedded','entries','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','end','status','json','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','index','map','DeskAccount','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','keys','length','create','body','find','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','findOne','authType','username','consumerKey','consumerSecret','token','remoteUri','substring','lastIndexOf'];(function(_0x2d8649,_0x304d4a){var _0x347e76=function(_0x348851){while(--_0x348851){_0x2d8649['push'](_0x2d8649['shift']());}};_0x347e76(++_0x304d4a);}(_0xac11,0x195));var _0x1ac1=function(_0x289a1a,_0x31db32){_0x289a1a=_0x289a1a-0x0;var _0x445de3=_0xac11[_0x289a1a];return _0x445de3;};'use strict';var pdf=require(_0x1ac1('0x0'));var emlformat=require(_0x1ac1('0x1'));var rimraf=require(_0x1ac1('0x2'));var zipdir=require(_0x1ac1('0x3'));var jsonpatch=require(_0x1ac1('0x4'));var rp=require(_0x1ac1('0x5'));var moment=require(_0x1ac1('0x6'));var BPromise=require(_0x1ac1('0x7'));var Mustache=require(_0x1ac1('0x8'));var util=require(_0x1ac1('0x9'));var path=require(_0x1ac1('0xa'));var sox=require(_0x1ac1('0xb'));var csv=require('to-csv');var ejs=require(_0x1ac1('0xc'));var fs=require('fs');var _=require(_0x1ac1('0xd'));var squel=require(_0x1ac1('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1ac1('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1ac1('0x10'));var Papa=require(_0x1ac1('0x11'));var Redis=require(_0x1ac1('0x12'));var authService=require(_0x1ac1('0x13'));var qs=require(_0x1ac1('0x14'));var as=require(_0x1ac1('0x15'));var hardwareService=require(_0x1ac1('0x16'));var logger=require(_0x1ac1('0x17'))(_0x1ac1('0x18'));var utils=require('../../config/utils');var config=require(_0x1ac1('0x19'));var db=require(_0x1ac1('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x1ac1('0x1b')][_0x1ac1('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x4b2f79,_0x451aea,_0x4ded37){if(_0x4ded37){var _0x5ef200=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5ef200[_0x1ac1('0x1d')](_0x451aea)){return _0x4b2f79;}else{throw new db[(_0x1ac1('0x1e'))][(_0x1ac1('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4b2f79;}}function respondWithRpcPromise(_0x41008c,_0x32270e,_0x431cd5,_0x328096){return new BPromise(function(_0x3c5d38,_0x2e2525){var _0x2b3128=_0x328096||client;return _0x2b3128[_0x1ac1('0x20')](_0x41008c,_0x431cd5)[_0x1ac1('0x21')](function(_0x56b7fa){logger['info'](_0x1ac1('0x22'),_0x32270e,_0x1ac1('0x23'));logger[_0x1ac1('0x24')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x32270e,_0x1ac1('0x23'),JSON['stringify'](_0x56b7fa));if(_0x56b7fa[_0x1ac1('0x25')]){if(_0x56b7fa['error']['code']===0x1f4){logger[_0x1ac1('0x25')](_0x1ac1('0x22'),_0x32270e,_0x56b7fa['error']['message']);return _0x2e2525(_0x56b7fa[_0x1ac1('0x25')][_0x1ac1('0x26')]);}logger[_0x1ac1('0x25')](_0x1ac1('0x22'),_0x32270e,_0x56b7fa[_0x1ac1('0x25')][_0x1ac1('0x26')]);return _0x3c5d38(_0x56b7fa['error']['message']);}else{logger['info'](_0x1ac1('0x22'),_0x32270e,_0x1ac1('0x23'));_0x3c5d38(_0x56b7fa[_0x1ac1('0x27')][_0x1ac1('0x26')]);}})[_0x1ac1('0x28')](function(_0x42cbc8){logger[_0x1ac1('0x25')]('DeskAccount,\x20%s,\x20%s',_0x32270e,_0x42cbc8);_0x2e2525(_0x42cbc8);});});}function respondWithStatusCode(_0x48178b,_0xbccdb){_0xbccdb=_0xbccdb||0xcc;return function(_0x4fffe5){if(_0x4fffe5){return _0x48178b['sendStatus'](_0xbccdb);}return _0x48178b['status'](_0xbccdb)[_0x1ac1('0x29')]();};}function respondWithResult(_0x447f1b,_0x5e76fd){_0x5e76fd=_0x5e76fd||0xc8;return function(_0xb95a4a){if(_0xb95a4a){return _0x447f1b[_0x1ac1('0x2a')](_0x5e76fd)[_0x1ac1('0x2b')](_0xb95a4a);}};}function respondWithFilteredResult(_0x14ca6e,_0x4f1d1d){return function(_0x3523ba){if(_0x3523ba){var _0x30d5dc=_0x3523ba['count'],_0x584642=_0x4f1d1d[_0x1ac1('0x2c')],_0x1b5190=_0x4f1d1d[_0x1ac1('0x2c')]+_0x4f1d1d['limit'],_0x5298ba;if(_0x1b5190>=_0x30d5dc){_0x1b5190=_0x30d5dc;_0x5298ba=0xc8;}else{_0x5298ba=0xce;}_0x14ca6e[_0x1ac1('0x2a')](_0x5298ba);return _0x14ca6e[_0x1ac1('0x2d')](_0x1ac1('0x2e'),_0x584642+'-'+_0x1b5190+'/'+_0x30d5dc)[_0x1ac1('0x2b')](_0x3523ba);}return null;};}function patchUpdates(_0x1dea0d){return function(_0xeb14f){try{jsonpatch[_0x1ac1('0x2f')](_0xeb14f,_0x1dea0d,!![]);}catch(_0x528599){return BPromise[_0x1ac1('0x30')](_0x528599);}return _0xeb14f[_0x1ac1('0x31')]();};}function saveUpdates(_0x120eb8,_0x5be17f){return function(_0x38cd11){if(_0x38cd11){return _0x38cd11[_0x1ac1('0x32')](_0x120eb8)[_0x1ac1('0x21')](function(_0x3d3363){return _0x3d3363;});}return null;};}function removeEntity(_0x776f2b,_0x125fa6){return function(_0x4da947){if(_0x4da947){return _0x4da947[_0x1ac1('0x33')]()[_0x1ac1('0x21')](function(){_0x776f2b[_0x1ac1('0x2a')](0xcc)[_0x1ac1('0x29')]();});}};}function handleEntityNotFound(_0x5c2be1,_0x3eceaa){return function(_0x38113f){if(!_0x38113f){_0x5c2be1[_0x1ac1('0x34')](0x194);}return _0x38113f;};}function handleError(_0x433204,_0x576be1){_0x576be1=_0x576be1||0x1f4;return function(_0x15ae38){logger[_0x1ac1('0x25')](_0x15ae38['stack']);if(_0x15ae38['name']){delete _0x15ae38[_0x1ac1('0x35')];}_0x433204[_0x1ac1('0x2a')](_0x576be1)['send'](_0x15ae38);};}exports[_0x1ac1('0x36')]=function(_0x398bb9,_0x3c88c9){var _0x1be879={},_0x42c0e1={},_0x490258={'count':0x0,'rows':[]};var _0x29befb=_[_0x1ac1('0x37')](db[_0x1ac1('0x38')][_0x1ac1('0x39')],function(_0x12d002){return{'name':_0x12d002[_0x1ac1('0x3a')],'type':_0x12d002['type'][_0x1ac1('0x3b')]};});_0x42c0e1[_0x1ac1('0x3c')]=_[_0x1ac1('0x37')](_0x29befb,_0x1ac1('0x35'));_0x42c0e1[_0x1ac1('0x3d')]=_['keys'](_0x398bb9[_0x1ac1('0x3d')]);_0x42c0e1[_0x1ac1('0x3e')]=_[_0x1ac1('0x3f')](_0x42c0e1[_0x1ac1('0x3c')],_0x42c0e1['query']);_0x1be879['attributes']=_[_0x1ac1('0x3f')](_0x42c0e1[_0x1ac1('0x3c')],qs['fields'](_0x398bb9[_0x1ac1('0x3d')][_0x1ac1('0x40')]));_0x1be879['attributes']=_0x1be879[_0x1ac1('0x41')]['length']?_0x1be879[_0x1ac1('0x41')]:_0x42c0e1[_0x1ac1('0x3c')];if(!_0x398bb9[_0x1ac1('0x3d')][_0x1ac1('0x42')](_0x1ac1('0x43'))){_0x1be879[_0x1ac1('0x44')]=qs[_0x1ac1('0x44')](_0x398bb9[_0x1ac1('0x3d')][_0x1ac1('0x44')]);_0x1be879[_0x1ac1('0x2c')]=qs['offset'](_0x398bb9[_0x1ac1('0x3d')][_0x1ac1('0x2c')]);}_0x1be879[_0x1ac1('0x45')]=qs['sort'](_0x398bb9[_0x1ac1('0x3d')][_0x1ac1('0x46')]);_0x1be879[_0x1ac1('0x47')]=qs[_0x1ac1('0x3e')](_[_0x1ac1('0x48')](_0x398bb9['query'],_0x42c0e1['filters']),_0x29befb);if(_0x398bb9[_0x1ac1('0x3d')][_0x1ac1('0x49')]){_0x1be879['where']=_[_0x1ac1('0x4a')](_0x1be879[_0x1ac1('0x47')],{'$or':_['map'](_0x29befb,function(_0x4cf94e){if(_0x4cf94e[_0x1ac1('0x4b')]!==_0x1ac1('0x4c')){var _0x35c558={};_0x35c558[_0x4cf94e[_0x1ac1('0x35')]]={'$like':'%'+_0x398bb9[_0x1ac1('0x3d')]['filter']+'%'};return _0x35c558;}})});}_0x1be879=_[_0x1ac1('0x4a')]({},_0x1be879,_0x398bb9[_0x1ac1('0x4d')]);var _0x861081={'where':_0x1be879[_0x1ac1('0x47')]};return db[_0x1ac1('0x38')][_0x1ac1('0x4e')](_0x861081)['then'](function(_0xc9ae02){_0x490258[_0x1ac1('0x4e')]=_0xc9ae02;if(_0x398bb9[_0x1ac1('0x3d')][_0x1ac1('0x4f')]){_0x1be879[_0x1ac1('0x50')]=[{'all':!![]}];}return db[_0x1ac1('0x38')][_0x1ac1('0x51')](_0x1be879);})[_0x1ac1('0x21')](function(_0x8e6412){_0x490258[_0x1ac1('0x52')]=_0x8e6412;return _0x490258;})[_0x1ac1('0x21')](respondWithFilteredResult(_0x3c88c9,_0x1be879))['catch'](handleError(_0x3c88c9,null));};exports[_0x1ac1('0x53')]=function(_0x5c5016,_0x5e7a7a){var _0x16cf62={'raw':![],'where':{'id':_0x5c5016[_0x1ac1('0x54')]['id']}},_0x421163={};_0x421163[_0x1ac1('0x3c')]=_[_0x1ac1('0x55')](db['DeskAccount']['rawAttributes']);_0x421163[_0x1ac1('0x3d')]=_[_0x1ac1('0x55')](_0x5c5016['query']);_0x421163[_0x1ac1('0x3e')]=_['intersection'](_0x421163[_0x1ac1('0x3c')],_0x421163[_0x1ac1('0x3d')]);_0x16cf62[_0x1ac1('0x41')]=_[_0x1ac1('0x3f')](_0x421163[_0x1ac1('0x3c')],qs['fields'](_0x5c5016['query'][_0x1ac1('0x40')]));_0x16cf62[_0x1ac1('0x41')]=_0x16cf62[_0x1ac1('0x41')][_0x1ac1('0x56')]?_0x16cf62[_0x1ac1('0x41')]:_0x421163[_0x1ac1('0x3c')];if(_0x5c5016[_0x1ac1('0x3d')][_0x1ac1('0x4f')]){_0x16cf62[_0x1ac1('0x50')]=[{'all':!![]}];}_0x16cf62=_[_0x1ac1('0x4a')]({},_0x16cf62,_0x5c5016[_0x1ac1('0x4d')]);return db[_0x1ac1('0x38')]['find'](_0x16cf62)[_0x1ac1('0x21')](handleEntityNotFound(_0x5e7a7a,null))[_0x1ac1('0x21')](respondWithResult(_0x5e7a7a,null))[_0x1ac1('0x28')](handleError(_0x5e7a7a,null));};exports[_0x1ac1('0x57')]=function(_0x2186f8,_0x15ddc8){return db[_0x1ac1('0x38')][_0x1ac1('0x57')](_0x2186f8[_0x1ac1('0x58')],{})[_0x1ac1('0x21')](respondWithResult(_0x15ddc8,0xc9))['catch'](handleError(_0x15ddc8,null));};exports['update']=function(_0x1ae047,_0x3fc1c9){if(_0x1ae047[_0x1ac1('0x58')]['id']){delete _0x1ae047['body']['id'];}return db[_0x1ac1('0x38')][_0x1ac1('0x59')]({'where':{'id':_0x1ae047[_0x1ac1('0x54')]['id']}})['then'](handleEntityNotFound(_0x3fc1c9,null))[_0x1ac1('0x21')](saveUpdates(_0x1ae047[_0x1ac1('0x58')],null))['then'](respondWithResult(_0x3fc1c9,null))[_0x1ac1('0x28')](handleError(_0x3fc1c9,null));};exports[_0x1ac1('0x33')]=function(_0x2c9801,_0x4c101e){return db[_0x1ac1('0x38')][_0x1ac1('0x59')]({'where':{'id':_0x2c9801[_0x1ac1('0x54')]['id']}})[_0x1ac1('0x21')](handleEntityNotFound(_0x4c101e,null))[_0x1ac1('0x21')](removeEntity(_0x4c101e,null))[_0x1ac1('0x28')](handleError(_0x4c101e,null));};exports[_0x1ac1('0x5a')]=function(_0x237387,_0x126099,_0x9aa7bf){var _0x20fad4={};var _0x414001={};var _0x112b79;var _0x49447b;return db[_0x1ac1('0x38')]['findOne']({'where':{'id':_0x237387[_0x1ac1('0x54')]['id']}})[_0x1ac1('0x21')](handleEntityNotFound(_0x126099,null))[_0x1ac1('0x21')](function(_0x277686){if(_0x277686){_0x112b79=_0x277686;_0x414001[_0x1ac1('0x3c')]=_[_0x1ac1('0x55')](db['DeskConfiguration'][_0x1ac1('0x39')]);_0x414001[_0x1ac1('0x3d')]=_['keys'](_0x237387[_0x1ac1('0x3d')]);_0x414001['filters']=_[_0x1ac1('0x3f')](_0x414001['model'],_0x414001[_0x1ac1('0x3d')]);_0x20fad4[_0x1ac1('0x41')]=_[_0x1ac1('0x3f')](_0x414001[_0x1ac1('0x3c')],qs[_0x1ac1('0x40')](_0x237387['query']['fields']));_0x20fad4['attributes']=_0x20fad4[_0x1ac1('0x41')][_0x1ac1('0x56')]?_0x20fad4['attributes']:_0x414001[_0x1ac1('0x3c')];_0x20fad4[_0x1ac1('0x45')]=qs[_0x1ac1('0x46')](_0x237387[_0x1ac1('0x3d')]['sort']);_0x20fad4[_0x1ac1('0x47')]=qs[_0x1ac1('0x3e')](_[_0x1ac1('0x48')](_0x237387[_0x1ac1('0x3d')],_0x414001[_0x1ac1('0x3e')]));if(_0x237387[_0x1ac1('0x3d')][_0x1ac1('0x49')]){_0x20fad4['where']=_['merge'](_0x20fad4[_0x1ac1('0x47')],{'$or':_['map'](_0x20fad4[_0x1ac1('0x41')],function(_0x10ff28){var _0x51fec4={};_0x51fec4[_0x10ff28]={'$like':'%'+_0x237387['query'][_0x1ac1('0x49')]+'%'};return _0x51fec4;})});}_0x20fad4=_[_0x1ac1('0x4a')]({},_0x20fad4,_0x237387['options']);return _0x112b79['getConfigurations'](_0x20fad4);}})['then'](function(_0x5a4bd1){if(_0x5a4bd1){_0x49447b=_0x5a4bd1[_0x1ac1('0x56')];if(!_0x237387[_0x1ac1('0x3d')]['hasOwnProperty'](_0x1ac1('0x43'))){_0x20fad4[_0x1ac1('0x44')]=qs[_0x1ac1('0x44')](_0x237387[_0x1ac1('0x3d')][_0x1ac1('0x44')]);_0x20fad4['offset']=qs[_0x1ac1('0x2c')](_0x237387[_0x1ac1('0x3d')][_0x1ac1('0x2c')]);}return _0x112b79['getConfigurations'](_0x20fad4);}})[_0x1ac1('0x21')](function(_0x5a0b39){if(_0x5a0b39){return _0x5a0b39?{'count':_0x49447b,'rows':_0x5a0b39}:null;}})[_0x1ac1('0x21')](respondWithResult(_0x126099,null))['catch'](handleError(_0x126099,null));};exports[_0x1ac1('0x5b')]=function(_0x22d915,_0x29f9a1,_0x3e52db){if(_0x22d915[_0x1ac1('0x58')]['id']){delete _0x22d915[_0x1ac1('0x58')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x22d915[_0x1ac1('0x54')]['id']}})[_0x1ac1('0x21')](handleEntityNotFound(_0x29f9a1,null))[_0x1ac1('0x21')](function(_0x3fb5b4){if(_0x3fb5b4){_0x22d915[_0x1ac1('0x58')][_0x1ac1('0x5c')]=_0x3fb5b4['id'];_0x22d915[_0x1ac1('0x58')][_0x1ac1('0x5d')]=integrations[_0x1ac1('0x5e')](_0x22d915['body'][_0x1ac1('0x5f')],_0x22d915['body'][_0x1ac1('0x4b')]);_0x22d915['body'][_0x1ac1('0x60')]=integrations[_0x1ac1('0x61')](_0x22d915['body']['channel'],_0x22d915[_0x1ac1('0x58')][_0x1ac1('0x4b')]);return db[_0x1ac1('0x62')][_0x1ac1('0x57')](_0x22d915['body'],{'include':[{'model':db[_0x1ac1('0x63')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x1ac1('0x60')}]});}return null;})[_0x1ac1('0x21')](respondWithResult(_0x29f9a1,null))[_0x1ac1('0x28')](handleError(_0x29f9a1,null));};exports[_0x1ac1('0x64')]=function(_0x121a1e,_0xfec64a,_0x3c0027){var _0x16d369=[{'name':_0x1ac1('0x65'),'label':_0x1ac1('0x65'),'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 _0x1d010f='';return db[_0x1ac1('0x38')][_0x1ac1('0x66')]({'where':{'id':_0x121a1e[_0x1ac1('0x54')]['id']},'attributes':['id','remoteUri',_0x1ac1('0x67'),_0x1ac1('0x68'),'password',_0x1ac1('0x69'),_0x1ac1('0x6a'),_0x1ac1('0x6b'),'tokenSecret']})[_0x1ac1('0x21')](handleEntityNotFound(_0xfec64a,null))[_0x1ac1('0x21')](function(_0x2d0ce7){if(_0x2d0ce7){_0x1d010f=_0x2d0ce7[_0x1ac1('0x6c')];var _0x387152=_0x1d010f['slice'](-0x1);if(_0x387152==='/'){_0x1d010f=_0x1d010f[_0x1ac1('0x6d')](0x0,_0x1d010f[_0x1ac1('0x6e')](_0x387152));}var _0x4d016b={'method':_0x1ac1('0x6f'),'uri':util[_0x1ac1('0x70')](_0x1ac1('0x71'),_0x1d010f),'headers':{'Content-Type':_0x1ac1('0x72'),'Accept':'application/json'},'json':!![]};if(_0x2d0ce7[_0x1ac1('0x67')]===_0x1ac1('0x73')){_0x4d016b[_0x1ac1('0x74')][_0x1ac1('0x75')]=util['format'](_0x1ac1('0x76'),new Buffer(util[_0x1ac1('0x70')](_0x1ac1('0x77'),_0x2d0ce7[_0x1ac1('0x68')],_0x2d0ce7[_0x1ac1('0x78')]))['toString']('base64'));}return rp(_0x4d016b)[_0x1ac1('0x21')](function(_0x49df42){return _0x16d369[_0x1ac1('0x79')](_['map'](_0x49df42[_0x1ac1('0x7a')][_0x1ac1('0x7b')],function(_0x2f971c){return{'id':_0x2f971c[_0x1ac1('0x35')],'name':_0x2f971c[_0x1ac1('0x35')],'type':_0x2f971c['type'],'active':_0x2f971c['active'],'label':_0x2f971c[_0x1ac1('0x7c')],'custom':!![]};}));});}})[_0x1ac1('0x21')](function(_0x11b8a7){return{'count':_0x11b8a7[_0x1ac1('0x56')],'rows':_0x11b8a7};})[_0x1ac1('0x21')](respondWithResult(_0xfec64a,null))[_0x1ac1('0x28')](function(_0x5c6678){var _0x157600=_0x121a1e['query']['test']?0x1f4:_0x5c6678[_0x1ac1('0x7d')]||0x1f4;logger[_0x1ac1('0x25')](_0x1ac1('0x7e'),_0x1ac1('0x64'),_0x157600,JSON[_0x1ac1('0x7f')](_0x5c6678));delete _0x5c6678['name'];if(_0x157600===0x191){_0x157600=0x190;}_0xfec64a[_0x1ac1('0x2a')](_0x157600)[_0x1ac1('0x80')](_0x121a1e[_0x1ac1('0x3d')][_0x1ac1('0x1d')]?{'message':'Wrong\x20credentials','statusCode':_0x5c6678['statusCode']}:_0x5c6678);});};
\ No newline at end of file
+var _0x0e02=['then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','apply','reject','update','destroy','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','include','show','includeAll','find','create','body','params','findOne','DeskConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','consumerKey','consumerSecret','token','tokenSecret','slice','substring','GET','%s/custom_fields','basic','Authorization','format','Basic\x20%s','%s:%s','username','password','toString','concat','entries','active','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0e02,0x1cf));var _0x20e0=function(_0x1b5ff7,_0xdc5f6d){_0x1b5ff7=_0x1b5ff7-0x0;var _0x11b3ef=_0x0e02[_0x1b5ff7];return _0x11b3ef;};'use strict';var pdf=require(_0x20e0('0x0'));var emlformat=require(_0x20e0('0x1'));var rimraf=require(_0x20e0('0x2'));var zipdir=require(_0x20e0('0x3'));var jsonpatch=require(_0x20e0('0x4'));var rp=require(_0x20e0('0x5'));var moment=require(_0x20e0('0x6'));var BPromise=require(_0x20e0('0x7'));var Mustache=require(_0x20e0('0x8'));var util=require('util');var path=require(_0x20e0('0x9'));var sox=require(_0x20e0('0xa'));var csv=require(_0x20e0('0xb'));var ejs=require(_0x20e0('0xc'));var fs=require('fs');var _=require(_0x20e0('0xd'));var squel=require(_0x20e0('0xe'));var crypto=require(_0x20e0('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x20e0('0xb'));var querystring=require(_0x20e0('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x20e0('0x11'));var qs=require(_0x20e0('0x12'));var as=require(_0x20e0('0x13'));var hardwareService=require(_0x20e0('0x14'));var logger=require(_0x20e0('0x15'))(_0x20e0('0x16'));var utils=require(_0x20e0('0x17'));var config=require(_0x20e0('0x18'));var db=require(_0x20e0('0x19'))['db'];var integrations=require(_0x20e0('0x1a'));var jayson=require(_0x20e0('0x1b'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x4bb3f5,_0x37d504,_0x4e6a60){if(_0x4e6a60){var _0x490e92=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x490e92[_0x20e0('0x1c')](_0x37d504)){return _0x4bb3f5;}else{throw new db[(_0x20e0('0x1d'))][(_0x20e0('0x1e'))](_0x20e0('0x1f'));}}else{return _0x4bb3f5;}}function respondWithRpcPromise(_0x23554e,_0x5964e6,_0x1943cf,_0x25556f){return new BPromise(function(_0x1f9938,_0x3fa6ec){var _0x44b5c7=_0x25556f||client;return _0x44b5c7[_0x20e0('0x20')](_0x23554e,_0x1943cf)[_0x20e0('0x21')](function(_0x8afc6a){logger[_0x20e0('0x22')](_0x20e0('0x23'),_0x5964e6,_0x20e0('0x24'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5964e6,_0x20e0('0x24'),JSON[_0x20e0('0x25')](_0x8afc6a));if(_0x8afc6a[_0x20e0('0x26')]){if(_0x8afc6a[_0x20e0('0x26')]['code']===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x5964e6,_0x8afc6a[_0x20e0('0x26')][_0x20e0('0x27')]);return _0x3fa6ec(_0x8afc6a[_0x20e0('0x26')]['message']);}logger['error'](_0x20e0('0x23'),_0x5964e6,_0x8afc6a[_0x20e0('0x26')][_0x20e0('0x27')]);return _0x1f9938(_0x8afc6a['error'][_0x20e0('0x27')]);}else{logger[_0x20e0('0x22')](_0x20e0('0x23'),_0x5964e6,_0x20e0('0x24'));_0x1f9938(_0x8afc6a[_0x20e0('0x28')][_0x20e0('0x27')]);}})[_0x20e0('0x29')](function(_0x1c25d5){logger[_0x20e0('0x26')](_0x20e0('0x23'),_0x5964e6,_0x1c25d5);_0x3fa6ec(_0x1c25d5);});});}function respondWithStatusCode(_0xd20c83,_0xc0a3a5){_0xc0a3a5=_0xc0a3a5||0xcc;return function(_0x8a230b){if(_0x8a230b){return _0xd20c83[_0x20e0('0x2a')](_0xc0a3a5);}return _0xd20c83[_0x20e0('0x2b')](_0xc0a3a5)[_0x20e0('0x2c')]();};}function respondWithResult(_0x1bc5c6,_0x4b2f3b){_0x4b2f3b=_0x4b2f3b||0xc8;return function(_0x73d8b3){if(_0x73d8b3){return _0x1bc5c6['status'](_0x4b2f3b)[_0x20e0('0x2d')](_0x73d8b3);}};}function respondWithFilteredResult(_0x31c79f,_0x39404b){return function(_0x5534ac){if(_0x5534ac){var _0x1e5d6d=_0x5534ac['count'],_0x280f33=_0x39404b[_0x20e0('0x2e')],_0x2e286a=_0x39404b[_0x20e0('0x2e')]+_0x39404b[_0x20e0('0x2f')],_0x583fad;if(_0x2e286a>=_0x1e5d6d){_0x2e286a=_0x1e5d6d;_0x583fad=0xc8;}else{_0x583fad=0xce;}_0x31c79f[_0x20e0('0x2b')](_0x583fad);return _0x31c79f[_0x20e0('0x30')]('Content-Range',_0x280f33+'-'+_0x2e286a+'/'+_0x1e5d6d)[_0x20e0('0x2d')](_0x5534ac);}return null;};}function patchUpdates(_0x177686){return function(_0x239123){try{jsonpatch[_0x20e0('0x31')](_0x239123,_0x177686,!![]);}catch(_0x1af8c1){return BPromise[_0x20e0('0x32')](_0x1af8c1);}return _0x239123['save']();};}function saveUpdates(_0x212781,_0x4a0a06){return function(_0x133e8b){if(_0x133e8b){return _0x133e8b[_0x20e0('0x33')](_0x212781)[_0x20e0('0x21')](function(_0x5d350b){return _0x5d350b;});}return null;};}function removeEntity(_0x3dc33d,_0x1833d3){return function(_0x98da8b){if(_0x98da8b){return _0x98da8b[_0x20e0('0x34')]()['then'](function(){_0x3dc33d[_0x20e0('0x2b')](0xcc)[_0x20e0('0x2c')]();});}};}function handleEntityNotFound(_0x3d851b,_0x5ac385){return function(_0x22f2eb){if(!_0x22f2eb){_0x3d851b['sendStatus'](0x194);}return _0x22f2eb;};}function handleError(_0x4072af,_0x16b7da){_0x16b7da=_0x16b7da||0x1f4;return function(_0x59bfb4){logger['error'](_0x59bfb4[_0x20e0('0x35')]);if(_0x59bfb4[_0x20e0('0x36')]){delete _0x59bfb4[_0x20e0('0x36')];}_0x4072af[_0x20e0('0x2b')](_0x16b7da)[_0x20e0('0x37')](_0x59bfb4);};}exports[_0x20e0('0x38')]=function(_0x366b17,_0x57aad5){var _0x4434de={},_0x5f4756={},_0x12e19c={'count':0x0,'rows':[]};var _0x117023=_[_0x20e0('0x39')](db[_0x20e0('0x3a')][_0x20e0('0x3b')],function(_0x381bf1){return{'name':_0x381bf1[_0x20e0('0x3c')],'type':_0x381bf1[_0x20e0('0x3d')]['key']};});_0x5f4756[_0x20e0('0x3e')]=_[_0x20e0('0x39')](_0x117023,_0x20e0('0x36'));_0x5f4756[_0x20e0('0x3f')]=_[_0x20e0('0x40')](_0x366b17[_0x20e0('0x3f')]);_0x5f4756['filters']=_[_0x20e0('0x41')](_0x5f4756['model'],_0x5f4756['query']);_0x4434de[_0x20e0('0x42')]=_[_0x20e0('0x41')](_0x5f4756[_0x20e0('0x3e')],qs[_0x20e0('0x43')](_0x366b17[_0x20e0('0x3f')][_0x20e0('0x43')]));_0x4434de[_0x20e0('0x42')]=_0x4434de[_0x20e0('0x42')][_0x20e0('0x44')]?_0x4434de[_0x20e0('0x42')]:_0x5f4756[_0x20e0('0x3e')];if(!_0x366b17[_0x20e0('0x3f')][_0x20e0('0x45')](_0x20e0('0x46'))){_0x4434de[_0x20e0('0x2f')]=qs['limit'](_0x366b17[_0x20e0('0x3f')][_0x20e0('0x2f')]);_0x4434de[_0x20e0('0x2e')]=qs['offset'](_0x366b17[_0x20e0('0x3f')]['offset']);}_0x4434de[_0x20e0('0x47')]=qs[_0x20e0('0x48')](_0x366b17['query']['sort']);_0x4434de[_0x20e0('0x49')]=qs[_0x20e0('0x4a')](_[_0x20e0('0x4b')](_0x366b17[_0x20e0('0x3f')],_0x5f4756[_0x20e0('0x4a')]),_0x117023);if(_0x366b17[_0x20e0('0x3f')][_0x20e0('0x4c')]){_0x4434de[_0x20e0('0x49')]=_[_0x20e0('0x4d')](_0x4434de[_0x20e0('0x49')],{'$or':_['map'](_0x117023,function(_0x4eb08f){if(_0x4eb08f[_0x20e0('0x3d')]!==_0x20e0('0x4e')){var _0x38aa58={};_0x38aa58[_0x4eb08f[_0x20e0('0x36')]]={'$like':'%'+_0x366b17['query'][_0x20e0('0x4c')]+'%'};return _0x38aa58;}})});}_0x4434de=_[_0x20e0('0x4d')]({},_0x4434de,_0x366b17[_0x20e0('0x4f')]);var _0x4e5474={'where':_0x4434de[_0x20e0('0x49')]};return db['DeskAccount'][_0x20e0('0x50')](_0x4e5474)[_0x20e0('0x21')](function(_0x2c281f){_0x12e19c['count']=_0x2c281f;if(_0x366b17[_0x20e0('0x3f')]['includeAll']){_0x4434de[_0x20e0('0x51')]=[{'all':!![]}];}return db[_0x20e0('0x3a')]['findAll'](_0x4434de);})[_0x20e0('0x21')](function(_0x33414e){_0x12e19c['rows']=_0x33414e;return _0x12e19c;})[_0x20e0('0x21')](respondWithFilteredResult(_0x57aad5,_0x4434de))['catch'](handleError(_0x57aad5,null));};exports[_0x20e0('0x52')]=function(_0x59effe,_0x557835){var _0x4afac1={'raw':![],'where':{'id':_0x59effe['params']['id']}},_0xc5a380={};_0xc5a380[_0x20e0('0x3e')]=_[_0x20e0('0x40')](db['DeskAccount']['rawAttributes']);_0xc5a380[_0x20e0('0x3f')]=_[_0x20e0('0x40')](_0x59effe[_0x20e0('0x3f')]);_0xc5a380['filters']=_[_0x20e0('0x41')](_0xc5a380[_0x20e0('0x3e')],_0xc5a380['query']);_0x4afac1[_0x20e0('0x42')]=_[_0x20e0('0x41')](_0xc5a380['model'],qs[_0x20e0('0x43')](_0x59effe[_0x20e0('0x3f')][_0x20e0('0x43')]));_0x4afac1[_0x20e0('0x42')]=_0x4afac1[_0x20e0('0x42')]['length']?_0x4afac1[_0x20e0('0x42')]:_0xc5a380['model'];if(_0x59effe[_0x20e0('0x3f')][_0x20e0('0x53')]){_0x4afac1['include']=[{'all':!![]}];}_0x4afac1=_[_0x20e0('0x4d')]({},_0x4afac1,_0x59effe[_0x20e0('0x4f')]);return db[_0x20e0('0x3a')][_0x20e0('0x54')](_0x4afac1)['then'](handleEntityNotFound(_0x557835,null))[_0x20e0('0x21')](respondWithResult(_0x557835,null))['catch'](handleError(_0x557835,null));};exports[_0x20e0('0x55')]=function(_0x363c30,_0x1b22bf){return db[_0x20e0('0x3a')][_0x20e0('0x55')](_0x363c30[_0x20e0('0x56')],{})[_0x20e0('0x21')](respondWithResult(_0x1b22bf,0xc9))[_0x20e0('0x29')](handleError(_0x1b22bf,null));};exports[_0x20e0('0x33')]=function(_0x5eba05,_0x585e9f){if(_0x5eba05[_0x20e0('0x56')]['id']){delete _0x5eba05[_0x20e0('0x56')]['id'];}return db[_0x20e0('0x3a')][_0x20e0('0x54')]({'where':{'id':_0x5eba05[_0x20e0('0x57')]['id']}})['then'](handleEntityNotFound(_0x585e9f,null))[_0x20e0('0x21')](saveUpdates(_0x5eba05[_0x20e0('0x56')],null))[_0x20e0('0x21')](respondWithResult(_0x585e9f,null))[_0x20e0('0x29')](handleError(_0x585e9f,null));};exports['destroy']=function(_0x5baf6d,_0xbc5c61){return db[_0x20e0('0x3a')][_0x20e0('0x54')]({'where':{'id':_0x5baf6d[_0x20e0('0x57')]['id']}})[_0x20e0('0x21')](handleEntityNotFound(_0xbc5c61,null))['then'](removeEntity(_0xbc5c61,null))[_0x20e0('0x29')](handleError(_0xbc5c61,null));};exports['getConfigurations']=function(_0x3b525d,_0x29a33d,_0x279470){var _0x1ab428={};var _0x4e419d={};var _0x5b014f;var _0x177096;return db[_0x20e0('0x3a')][_0x20e0('0x58')]({'where':{'id':_0x3b525d['params']['id']}})['then'](handleEntityNotFound(_0x29a33d,null))[_0x20e0('0x21')](function(_0x3dcd3b){if(_0x3dcd3b){_0x5b014f=_0x3dcd3b;_0x4e419d[_0x20e0('0x3e')]=_[_0x20e0('0x40')](db[_0x20e0('0x59')][_0x20e0('0x3b')]);_0x4e419d['query']=_['keys'](_0x3b525d[_0x20e0('0x3f')]);_0x4e419d[_0x20e0('0x4a')]=_[_0x20e0('0x41')](_0x4e419d[_0x20e0('0x3e')],_0x4e419d[_0x20e0('0x3f')]);_0x1ab428[_0x20e0('0x42')]=_[_0x20e0('0x41')](_0x4e419d[_0x20e0('0x3e')],qs['fields'](_0x3b525d[_0x20e0('0x3f')]['fields']));_0x1ab428['attributes']=_0x1ab428[_0x20e0('0x42')]['length']?_0x1ab428[_0x20e0('0x42')]:_0x4e419d['model'];_0x1ab428[_0x20e0('0x47')]=qs[_0x20e0('0x48')](_0x3b525d[_0x20e0('0x3f')][_0x20e0('0x48')]);_0x1ab428[_0x20e0('0x49')]=qs[_0x20e0('0x4a')](_[_0x20e0('0x4b')](_0x3b525d[_0x20e0('0x3f')],_0x4e419d[_0x20e0('0x4a')]));if(_0x3b525d[_0x20e0('0x3f')]['filter']){_0x1ab428['where']=_[_0x20e0('0x4d')](_0x1ab428['where'],{'$or':_[_0x20e0('0x39')](_0x1ab428[_0x20e0('0x42')],function(_0x83e141){var _0x6e701={};_0x6e701[_0x83e141]={'$like':'%'+_0x3b525d[_0x20e0('0x3f')][_0x20e0('0x4c')]+'%'};return _0x6e701;})});}_0x1ab428=_['merge']({},_0x1ab428,_0x3b525d[_0x20e0('0x4f')]);return _0x5b014f[_0x20e0('0x5a')](_0x1ab428);}})[_0x20e0('0x21')](function(_0x1aaaff){if(_0x1aaaff){_0x177096=_0x1aaaff['length'];if(!_0x3b525d['query'][_0x20e0('0x45')]('nolimit')){_0x1ab428[_0x20e0('0x2f')]=qs[_0x20e0('0x2f')](_0x3b525d[_0x20e0('0x3f')]['limit']);_0x1ab428[_0x20e0('0x2e')]=qs[_0x20e0('0x2e')](_0x3b525d[_0x20e0('0x3f')][_0x20e0('0x2e')]);}return _0x5b014f[_0x20e0('0x5a')](_0x1ab428);}})[_0x20e0('0x21')](function(_0x31d90f){if(_0x31d90f){return _0x31d90f?{'count':_0x177096,'rows':_0x31d90f}:null;}})[_0x20e0('0x21')](respondWithResult(_0x29a33d,null))['catch'](handleError(_0x29a33d,null));};exports[_0x20e0('0x5b')]=function(_0x2b836f,_0xd65203,_0x35f866){if(_0x2b836f[_0x20e0('0x56')]['id']){delete _0x2b836f[_0x20e0('0x56')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x2b836f[_0x20e0('0x57')]['id']}})[_0x20e0('0x21')](handleEntityNotFound(_0xd65203,null))[_0x20e0('0x21')](function(_0x1d7c92){if(_0x1d7c92){_0x2b836f[_0x20e0('0x56')]['AccountId']=_0x1d7c92['id'];_0x2b836f[_0x20e0('0x56')][_0x20e0('0x5c')]=integrations[_0x20e0('0x5d')](_0x2b836f[_0x20e0('0x56')][_0x20e0('0x5e')],_0x2b836f[_0x20e0('0x56')]['type']);_0x2b836f['body'][_0x20e0('0x5f')]=integrations[_0x20e0('0x60')](_0x2b836f[_0x20e0('0x56')][_0x20e0('0x5e')],_0x2b836f['body'][_0x20e0('0x3d')]);return db[_0x20e0('0x59')][_0x20e0('0x55')](_0x2b836f['body'],{'include':[{'model':db[_0x20e0('0x61')],'as':_0x20e0('0x5c')},{'model':db[_0x20e0('0x61')],'as':_0x20e0('0x5f')}]});}return null;})[_0x20e0('0x21')](respondWithResult(_0xd65203,null))['catch'](handleError(_0xd65203,null));};exports[_0x20e0('0x62')]=function(_0x128c31,_0x5adbef,_0xf1a38c){var _0x1d151c=[{'name':_0x20e0('0x63'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x467e23='';return db['DeskAccount'][_0x20e0('0x58')]({'where':{'id':_0x128c31[_0x20e0('0x57')]['id']},'attributes':['id',_0x20e0('0x64'),_0x20e0('0x65'),'username','password',_0x20e0('0x66'),_0x20e0('0x67'),_0x20e0('0x68'),_0x20e0('0x69')]})[_0x20e0('0x21')](handleEntityNotFound(_0x5adbef,null))['then'](function(_0x2a5074){if(_0x2a5074){_0x467e23=_0x2a5074[_0x20e0('0x64')];var _0x885c25=_0x467e23[_0x20e0('0x6a')](-0x1);if(_0x885c25==='/'){_0x467e23=_0x467e23[_0x20e0('0x6b')](0x0,_0x467e23['lastIndexOf'](_0x885c25));}var _0x3dba54={'method':_0x20e0('0x6c'),'uri':util['format'](_0x20e0('0x6d'),_0x467e23),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x2a5074[_0x20e0('0x65')]===_0x20e0('0x6e')){_0x3dba54['headers'][_0x20e0('0x6f')]=util[_0x20e0('0x70')](_0x20e0('0x71'),new Buffer(util[_0x20e0('0x70')](_0x20e0('0x72'),_0x2a5074[_0x20e0('0x73')],_0x2a5074[_0x20e0('0x74')]))[_0x20e0('0x75')]('base64'));}return rp(_0x3dba54)[_0x20e0('0x21')](function(_0x317447){return _0x1d151c[_0x20e0('0x76')](_[_0x20e0('0x39')](_0x317447['_embedded'][_0x20e0('0x77')],function(_0x5880bc){return{'id':_0x5880bc[_0x20e0('0x36')],'name':_0x5880bc['name'],'type':_0x5880bc[_0x20e0('0x3d')],'active':_0x5880bc[_0x20e0('0x78')],'label':_0x5880bc['label'],'custom':!![]};}));});}})[_0x20e0('0x21')](function(_0x524e9d){return{'count':_0x524e9d['length'],'rows':_0x524e9d};})[_0x20e0('0x21')](respondWithResult(_0x5adbef,null))['catch'](function(_0x264dbc){var _0x20db79=_0x128c31[_0x20e0('0x3f')][_0x20e0('0x1c')]?0x1f4:_0x264dbc[_0x20e0('0x79')]||0x1f4;logger[_0x20e0('0x26')](_0x20e0('0x7a'),'getFields',_0x20db79,JSON['stringify'](_0x264dbc));delete _0x264dbc[_0x20e0('0x36')];if(_0x20db79===0x191){_0x20db79=0x190;}_0x5adbef[_0x20e0('0x2b')](_0x20db79)[_0x20e0('0x37')](_0x128c31[_0x20e0('0x3f')][_0x20e0('0x1c')]?{'message':_0x20e0('0x7b'),'statusCode':_0x264dbc[_0x20e0('0x79')]}:_0x264dbc);});};
\ No newline at end of file
index ddc03e0..731d673 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8766=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x246584,_0x4836c2){var _0x5a94c1=function(_0x288bc1){while(--_0x288bc1){_0x246584['push'](_0x246584['shift']());}};_0x5a94c1(++_0x4836c2);}(_0x8766,0x7b));var _0x6876=function(_0x49c0aa,_0xe1de48){_0x49c0aa=_0x49c0aa-0x0;var _0x1fec56=_0x8766[_0x49c0aa];return _0x1fec56;};'use strict';var _=require(_0x6876('0x0'));var util=require(_0x6876('0x1'));var logger=require(_0x6876('0x2'))('api');var moment=require(_0x6876('0x3'));var BPromise=require(_0x6876('0x4'));var rp=require(_0x6876('0x5'));var fs=require('fs');var path=require(_0x6876('0x6'));var rimraf=require(_0x6876('0x7'));var config=require(_0x6876('0x8'));var attributes=require(_0x6876('0x9'));var integrations=require(_0x6876('0xa'));module[_0x6876('0xb')]=function(_0x579b6b,_0xb584fb){return _0x579b6b['define'](_0x6876('0xc'),attributes,{'tableName':_0x6876('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x94df=['rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','int_desk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x52e26f,_0x26af54){var _0x3dd4cd=function(_0x9914ce){while(--_0x9914ce){_0x52e26f['push'](_0x52e26f['shift']());}};_0x3dd4cd(++_0x26af54);}(_0x94df,0xe3));var _0xf94d=function(_0x504322,_0xf52076){_0x504322=_0x504322-0x0;var _0x4340fa=_0x94df[_0x504322];return _0x4340fa;};'use strict';var _=require(_0xf94d('0x0'));var util=require(_0xf94d('0x1'));var logger=require(_0xf94d('0x2'))('api');var moment=require(_0xf94d('0x3'));var BPromise=require(_0xf94d('0x4'));var rp=require(_0xf94d('0x5'));var fs=require('fs');var path=require(_0xf94d('0x6'));var rimraf=require(_0xf94d('0x7'));var config=require(_0xf94d('0x8'));var attributes=require(_0xf94d('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xf94d('0xa')]=function(_0x1fdf1d,_0x3c464a){return _0x1fdf1d[_0xf94d('0xb')]('DeskAccount',attributes,{'tableName':_0xf94d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4564d47..8567caa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b42=['http','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','DeskAccount,\x20%s,\x20%s','message','result','DeskAccount','findAll','options','raw','where','attributes','include','model','map','GetDeskAccount','catch','find','ShowDeskAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x383433,_0x13850f){var _0x3f91ca=function(_0x249f67){while(--_0x249f67){_0x383433['push'](_0x383433['shift']());}};_0x3f91ca(++_0x13850f);}(_0x3b42,0xa5));var _0x23b4=function(_0x2849a3,_0x3c7913){_0x2849a3=_0x2849a3-0x0;var _0x525541=_0x3b42[_0x2849a3];return _0x525541;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x23b4('0x0'));var BPromise=require(_0x23b4('0x1'));var rs=require(_0x23b4('0x2'));var fs=require('fs');var Redis=require(_0x23b4('0x3'));var db=require(_0x23b4('0x4'))['db'];var utils=require(_0x23b4('0x5'));var logger=require('../../config/logger')(_0x23b4('0x6'));var config=require(_0x23b4('0x7'));var jayson=require(_0x23b4('0x8'));var client=jayson[_0x23b4('0x9')][_0x23b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b63ce,_0x1523a5,_0xceef95){return new BPromise(function(_0x4ee558,_0x33f831){return client[_0x23b4('0xb')](_0x3b63ce,_0xceef95)[_0x23b4('0xc')](function(_0x5833e0){logger[_0x23b4('0xd')]('DeskAccount,\x20%s,\x20%s',_0x1523a5,_0x23b4('0xe'));logger[_0x23b4('0xf')](_0x23b4('0x10'),_0x1523a5,'request\x20sent',JSON[_0x23b4('0x11')](_0x5833e0));if(_0x5833e0['error']){if(_0x5833e0[_0x23b4('0x12')]['code']===0x1f4){logger['error'](_0x23b4('0x13'),_0x1523a5,_0x5833e0['error'][_0x23b4('0x14')]);return _0x33f831(_0x5833e0[_0x23b4('0x12')][_0x23b4('0x14')]);}logger[_0x23b4('0x12')](_0x23b4('0x13'),_0x1523a5,_0x5833e0[_0x23b4('0x12')][_0x23b4('0x14')]);return _0x4ee558(_0x5833e0['error'][_0x23b4('0x14')]);}else{logger[_0x23b4('0xd')]('DeskAccount,\x20%s,\x20%s',_0x1523a5,_0x23b4('0xe'));_0x4ee558(_0x5833e0[_0x23b4('0x15')][_0x23b4('0x14')]);}})['catch'](function(_0x49d2ae){logger[_0x23b4('0x12')](_0x23b4('0x13'),_0x1523a5,_0x49d2ae);_0x33f831(_0x49d2ae);});});}exports['GetDeskAccount']=function(_0x31e452){var _0x18ce43=this;return new Promise(function(_0x5c01d1,_0x567382){return db[_0x23b4('0x16')][_0x23b4('0x17')]({'raw':_0x31e452[_0x23b4('0x18')]?_0x31e452[_0x23b4('0x18')][_0x23b4('0x19')]===undefined?!![]:![]:!![],'where':_0x31e452[_0x23b4('0x18')]?_0x31e452['options'][_0x23b4('0x1a')]||null:null,'attributes':_0x31e452[_0x23b4('0x18')]?_0x31e452['options'][_0x23b4('0x1b')]||null:null,'limit':_0x31e452[_0x23b4('0x18')]?_0x31e452[_0x23b4('0x18')]['limit']||null:null,'include':_0x31e452[_0x23b4('0x18')]?_0x31e452[_0x23b4('0x18')][_0x23b4('0x1c')]?_['map'](_0x31e452[_0x23b4('0x18')][_0x23b4('0x1c')],function(_0x5c881a){return{'model':db[_0x5c881a[_0x23b4('0x1d')]],'as':_0x5c881a['as'],'attributes':_0x5c881a[_0x23b4('0x1b')],'include':_0x5c881a['include']?_[_0x23b4('0x1e')](_0x5c881a[_0x23b4('0x1c')],function(_0x3c5a78){return{'model':db[_0x3c5a78[_0x23b4('0x1d')]],'as':_0x3c5a78['as'],'attributes':_0x3c5a78[_0x23b4('0x1b')],'include':_0x3c5a78['include']?_[_0x23b4('0x1e')](_0x3c5a78[_0x23b4('0x1c')],function(_0x35d4d5){return{'model':db[_0x35d4d5[_0x23b4('0x1d')]],'as':_0x35d4d5['as'],'attributes':_0x35d4d5['attributes']};}):[]};}):[]};}):[]:[]})[_0x23b4('0xc')](function(_0x55d137){logger[_0x23b4('0xd')]('GetDeskAccount',_0x31e452);logger[_0x23b4('0xf')](_0x23b4('0x1f'),_0x31e452,JSON[_0x23b4('0x11')](_0x55d137));_0x5c01d1(_0x55d137);})[_0x23b4('0x20')](function(_0x26d820){logger[_0x23b4('0x12')](_0x23b4('0x1f'),_0x26d820['message'],_0x31e452);_0x567382(_0x18ce43[_0x23b4('0x12')](0x1f4,_0x26d820[_0x23b4('0x14')]));});});};exports['ShowDeskAccount']=function(_0x2c6fd8){var _0x4b6f4a=this;return new Promise(function(_0x23b656,_0x327505){return db[_0x23b4('0x16')][_0x23b4('0x21')]({'raw':_0x2c6fd8[_0x23b4('0x18')]?_0x2c6fd8[_0x23b4('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2c6fd8[_0x23b4('0x18')]?_0x2c6fd8['options'][_0x23b4('0x1a')]||null:null,'attributes':_0x2c6fd8[_0x23b4('0x18')]?_0x2c6fd8[_0x23b4('0x18')][_0x23b4('0x1b')]||null:null,'include':_0x2c6fd8[_0x23b4('0x18')]?_0x2c6fd8[_0x23b4('0x18')][_0x23b4('0x1c')]?_[_0x23b4('0x1e')](_0x2c6fd8[_0x23b4('0x18')][_0x23b4('0x1c')],function(_0x279045){return{'model':db[_0x279045[_0x23b4('0x1d')]],'as':_0x279045['as'],'attributes':_0x279045[_0x23b4('0x1b')],'include':_0x279045[_0x23b4('0x1c')]?_[_0x23b4('0x1e')](_0x279045[_0x23b4('0x1c')],function(_0x24dbc7){return{'model':db[_0x24dbc7['model']],'as':_0x24dbc7['as'],'attributes':_0x24dbc7['attributes'],'include':_0x24dbc7['include']?_[_0x23b4('0x1e')](_0x24dbc7[_0x23b4('0x1c')],function(_0x461739){return{'model':db[_0x461739[_0x23b4('0x1d')]],'as':_0x461739['as'],'attributes':_0x461739[_0x23b4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x23b4('0xc')](function(_0x4270c9){logger[_0x23b4('0xd')](_0x23b4('0x22'),_0x2c6fd8);logger[_0x23b4('0xf')](_0x23b4('0x22'),_0x2c6fd8,JSON[_0x23b4('0x11')](_0x4270c9));_0x23b656(_0x4270c9);})[_0x23b4('0x20')](function(_0x1f55e2){logger[_0x23b4('0x12')](_0x23b4('0x22'),_0x1f55e2[_0x23b4('0x14')],_0x2c6fd8);_0x327505(_0x4b6f4a['error'](0x1f4,_0x1f55e2[_0x23b4('0x14')]));});});};
\ No newline at end of file
+var _0xf8f5=['findAll','options','raw','attributes','limit','include','map','model','debug','ShowDeskAccount','find','where','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDeskAccount','DeskAccount'];(function(_0x22bf37,_0x153433){var _0x405a9a=function(_0x448480){while(--_0x448480){_0x22bf37['push'](_0x22bf37['shift']());}};_0x405a9a(++_0x153433);}(_0xf8f5,0x182));var _0x5f8f=function(_0x733321,_0x116c3c){_0x733321=_0x733321-0x0;var _0x251bde=_0xf8f5[_0x733321];return _0x251bde;};'use strict';var _=require(_0x5f8f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5f8f('0x1'));var rs=require(_0x5f8f('0x2'));var fs=require('fs');var Redis=require(_0x5f8f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f8f('0x4'));var logger=require('../../config/logger')(_0x5f8f('0x5'));var config=require(_0x5f8f('0x6'));var jayson=require(_0x5f8f('0x7'));var client=jayson[_0x5f8f('0x8')][_0x5f8f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31c0a4,_0x49a004,_0x536118){return new BPromise(function(_0x520e9c,_0x103d47){return client[_0x5f8f('0xa')](_0x31c0a4,_0x536118)[_0x5f8f('0xb')](function(_0xc000d){logger[_0x5f8f('0xc')](_0x5f8f('0xd'),_0x49a004,'request\x20sent');logger['debug'](_0x5f8f('0xe'),_0x49a004,'request\x20sent',JSON[_0x5f8f('0xf')](_0xc000d));if(_0xc000d[_0x5f8f('0x10')]){if(_0xc000d[_0x5f8f('0x10')]['code']===0x1f4){logger[_0x5f8f('0x10')](_0x5f8f('0xd'),_0x49a004,_0xc000d[_0x5f8f('0x10')][_0x5f8f('0x11')]);return _0x103d47(_0xc000d[_0x5f8f('0x10')]['message']);}logger[_0x5f8f('0x10')]('DeskAccount,\x20%s,\x20%s',_0x49a004,_0xc000d['error']['message']);return _0x520e9c(_0xc000d[_0x5f8f('0x10')][_0x5f8f('0x11')]);}else{logger['info'](_0x5f8f('0xd'),_0x49a004,'request\x20sent');_0x520e9c(_0xc000d[_0x5f8f('0x12')][_0x5f8f('0x11')]);}})[_0x5f8f('0x13')](function(_0x209261){logger[_0x5f8f('0x10')](_0x5f8f('0xd'),_0x49a004,_0x209261);_0x103d47(_0x209261);});});}exports[_0x5f8f('0x14')]=function(_0xeb50e9){var _0x48ed34=this;return new Promise(function(_0x2d29b0,_0x33722f){return db[_0x5f8f('0x15')][_0x5f8f('0x16')]({'raw':_0xeb50e9['options']?_0xeb50e9[_0x5f8f('0x17')][_0x5f8f('0x18')]===undefined?!![]:![]:!![],'where':_0xeb50e9['options']?_0xeb50e9[_0x5f8f('0x17')]['where']||null:null,'attributes':_0xeb50e9[_0x5f8f('0x17')]?_0xeb50e9['options'][_0x5f8f('0x19')]||null:null,'limit':_0xeb50e9[_0x5f8f('0x17')]?_0xeb50e9[_0x5f8f('0x17')][_0x5f8f('0x1a')]||null:null,'include':_0xeb50e9[_0x5f8f('0x17')]?_0xeb50e9[_0x5f8f('0x17')][_0x5f8f('0x1b')]?_[_0x5f8f('0x1c')](_0xeb50e9[_0x5f8f('0x17')]['include'],function(_0x1ebc45){return{'model':db[_0x1ebc45[_0x5f8f('0x1d')]],'as':_0x1ebc45['as'],'attributes':_0x1ebc45['attributes'],'include':_0x1ebc45[_0x5f8f('0x1b')]?_['map'](_0x1ebc45[_0x5f8f('0x1b')],function(_0x4ee4e1){return{'model':db[_0x4ee4e1['model']],'as':_0x4ee4e1['as'],'attributes':_0x4ee4e1['attributes'],'include':_0x4ee4e1['include']?_['map'](_0x4ee4e1['include'],function(_0x1beeed){return{'model':db[_0x1beeed[_0x5f8f('0x1d')]],'as':_0x1beeed['as'],'attributes':_0x1beeed[_0x5f8f('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5f8f('0xb')](function(_0x367ae5){logger[_0x5f8f('0xc')](_0x5f8f('0x14'),_0xeb50e9);logger[_0x5f8f('0x1e')](_0x5f8f('0x14'),_0xeb50e9,JSON['stringify'](_0x367ae5));_0x2d29b0(_0x367ae5);})[_0x5f8f('0x13')](function(_0x4f1ba5){logger[_0x5f8f('0x10')]('GetDeskAccount',_0x4f1ba5['message'],_0xeb50e9);_0x33722f(_0x48ed34[_0x5f8f('0x10')](0x1f4,_0x4f1ba5[_0x5f8f('0x11')]));});});};exports[_0x5f8f('0x1f')]=function(_0x411309){var _0x7f6857=this;return new Promise(function(_0xca271b,_0x130c67){return db[_0x5f8f('0x15')][_0x5f8f('0x20')]({'raw':_0x411309[_0x5f8f('0x17')]?_0x411309[_0x5f8f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x411309['options']?_0x411309['options'][_0x5f8f('0x21')]||null:null,'attributes':_0x411309['options']?_0x411309['options'][_0x5f8f('0x19')]||null:null,'include':_0x411309['options']?_0x411309[_0x5f8f('0x17')][_0x5f8f('0x1b')]?_[_0x5f8f('0x1c')](_0x411309[_0x5f8f('0x17')][_0x5f8f('0x1b')],function(_0x98be36){return{'model':db[_0x98be36['model']],'as':_0x98be36['as'],'attributes':_0x98be36[_0x5f8f('0x19')],'include':_0x98be36['include']?_[_0x5f8f('0x1c')](_0x98be36[_0x5f8f('0x1b')],function(_0x2c4217){return{'model':db[_0x2c4217[_0x5f8f('0x1d')]],'as':_0x2c4217['as'],'attributes':_0x2c4217[_0x5f8f('0x19')],'include':_0x2c4217['include']?_[_0x5f8f('0x1c')](_0x2c4217['include'],function(_0x3c2318){return{'model':db[_0x3c2318[_0x5f8f('0x1d')]],'as':_0x3c2318['as'],'attributes':_0x3c2318[_0x5f8f('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30aac3){logger[_0x5f8f('0xc')](_0x5f8f('0x1f'),_0x411309);logger['debug'](_0x5f8f('0x1f'),_0x411309,JSON[_0x5f8f('0xf')](_0x30aac3));_0xca271b(_0x30aac3);})['catch'](function(_0x5cdb41){logger[_0x5f8f('0x10')](_0x5f8f('0x1f'),_0x5cdb41[_0x5f8f('0x11')],_0x411309);_0x130c67(_0x7f6857[_0x5f8f('0x10')](0x1f4,_0x5cdb41[_0x5f8f('0x11')]));});});};
\ No newline at end of file
index ecb8957..74abc44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4489=['show','get','/:id/fields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','index','/:id'];(function(_0x416035,_0x22bd42){var _0x1b3759=function(_0x58accb){while(--_0x58accb){_0x416035['push'](_0x416035['shift']());}};_0x1b3759(++_0x22bd42);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9448('0x0'));var util=require(_0x9448('0x1'));var path=require('path');var timeout=require(_0x9448('0x2'));var express=require(_0x9448('0x3'));var router=express[_0x9448('0x4')]();var auth=require(_0x9448('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDeskConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9448('0x6')]);router['get'](_0x9448('0x7'),auth['isAuthenticated'](),controller[_0x9448('0x8')]);router[_0x9448('0x9')](_0x9448('0xa'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0x9448('0xb'),auth[_0x9448('0xc')](),controller[_0x9448('0xd')]);router[_0x9448('0x9')](_0x9448('0xe'),auth['isAuthenticated'](),controller[_0x9448('0xf')]);router[_0x9448('0x9')](_0x9448('0x10'),auth[_0x9448('0xc')](),controller[_0x9448('0x11')]);router[_0x9448('0x12')]('/',auth[_0x9448('0xc')](),controller[_0x9448('0x13')]);router['post'](_0x9448('0x10'),auth['isAuthenticated'](),controller[_0x9448('0x14')]);router[_0x9448('0x15')]('/:id',auth[_0x9448('0xc')](),controller[_0x9448('0x16')]);router[_0x9448('0x17')](_0x9448('0x7'),auth[_0x9448('0xc')](),controller[_0x9448('0x18')]);module[_0x9448('0x19')]=router;
\ No newline at end of file
+var _0x0650=['post','put','update','/:id','destroy','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','isAuthenticated','show','get','/:id/fields','getFields','/:id/subjects','/:id/descriptions','/:id/tags'];(function(_0x3d94ea,_0x455173){var _0x3aa0e5=function(_0x409554){while(--_0x409554){_0x3d94ea['push'](_0x3d94ea['shift']());}};_0x3aa0e5(++_0x455173);}(_0x0650,0xed));var _0x0065=function(_0x8d65d2,_0x17511d){_0x8d65d2=_0x8d65d2-0x0;var _0x109850=_0x0650[_0x8d65d2];return _0x109850;};'use strict';var multer=require(_0x0065('0x0'));var util=require('util');var path=require(_0x0065('0x1'));var timeout=require(_0x0065('0x2'));var express=require('express');var router=express[_0x0065('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0065('0x4'));var config=require(_0x0065('0x5'));var controller=require(_0x0065('0x6'));router['get']('/',auth[_0x0065('0x7')](),controller['index']);router['get']('/:id',auth[_0x0065('0x7')](),controller[_0x0065('0x8')]);router[_0x0065('0x9')](_0x0065('0xa'),auth[_0x0065('0x7')](),controller[_0x0065('0xb')]);router[_0x0065('0x9')](_0x0065('0xc'),auth[_0x0065('0x7')](),controller['getSubjects']);router[_0x0065('0x9')](_0x0065('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router['get'](_0x0065('0xe'),auth[_0x0065('0x7')](),controller['getTags']);router[_0x0065('0xf')]('/',auth[_0x0065('0x7')](),controller['create']);router[_0x0065('0xf')](_0x0065('0xe'),auth['isAuthenticated'](),controller['setTags']);router[_0x0065('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x0065('0x11')]);router['delete'](_0x0065('0x12'),auth['isAuthenticated'](),controller[_0x0065('0x13')]);module[_0x0065('0x14')]=router;
\ No newline at end of file
index d0f493e..34aedad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5237=['STRING','sequelize','exports'];(function(_0x35e484,_0x754272){var _0x4f28a1=function(_0x12d8c1){while(--_0x12d8c1){_0x35e484['push'](_0x35e484['shift']());}};_0x4f28a1(++_0x754272);}(_0x5237,0x169));var _0x7523=function(_0x3a3ec1,_0x3d7e5a){_0x3a3ec1=_0x3a3ec1-0x0;var _0x40547e=_0x5237[_0x3a3ec1];return _0x40547e;};'use strict';var Sequelize=require(_0x7523('0x0'));module[_0x7523('0x1')]={'name':{'type':Sequelize[_0x7523('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2823=['sequelize','exports','STRING'];(function(_0x7880d2,_0x32e7d6){var _0x35ebbe=function(_0x5c27fa){while(--_0x5c27fa){_0x7880d2['push'](_0x7880d2['shift']());}};_0x35ebbe(++_0x32e7d6);}(_0x2823,0x13b));var _0x3282=function(_0x585f77,_0x4df7ce){_0x585f77=_0x585f77-0x0;var _0x19aff3=_0x2823[_0x585f77];return _0x19aff3;};'use strict';var Sequelize=require(_0x3282('0x0'));module[_0x3282('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3282('0x2')]}};
\ No newline at end of file
index f0d72fd..8eae7e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b40=['mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','stack','send','index','map','DeskConfiguration','fieldName','key','name','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','keys','rawAttributes','length','find','catch','create','update','body','params','getFields','findOne','DeskField','order','pick','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3725ab,_0x40907f){var _0x2c117b=function(_0x43d9d8){while(--_0x43d9d8){_0x3725ab['push'](_0x3725ab['shift']());}};_0x2c117b(++_0x40907f);}(_0x0b40,0xba));var _0x00b4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0b40[_0x3ab51d];return _0x29a04e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x00b4('0x0'));var rimraf=require(_0x00b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00b4('0x2'));var rp=require(_0x00b4('0x3'));var moment=require(_0x00b4('0x4'));var BPromise=require(_0x00b4('0x5'));var Mustache=require(_0x00b4('0x6'));var util=require(_0x00b4('0x7'));var path=require('path');var sox=require(_0x00b4('0x8'));var csv=require(_0x00b4('0x9'));var ejs=require(_0x00b4('0xa'));var fs=require('fs');var _=require(_0x00b4('0xb'));var squel=require('squel');var crypto=require(_0x00b4('0xc'));var jsforce=require(_0x00b4('0xd'));var deskjs=require(_0x00b4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x00b4('0xf'));var Papa=require(_0x00b4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x00b4('0x11'));var as=require(_0x00b4('0x12'));var hardwareService=require(_0x00b4('0x13'));var logger=require(_0x00b4('0x14'))(_0x00b4('0x15'));var utils=require(_0x00b4('0x16'));var config=require(_0x00b4('0x17'));var db=require(_0x00b4('0x18'))['db'];var jayson=require(_0x00b4('0x19'));var client=jayson[_0x00b4('0x1a')][_0x00b4('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3704e8,_0x51c6b4,_0x4f70ae){if(_0x4f70ae){var _0xc5fad4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc5fad4[_0x00b4('0x1c')](_0x51c6b4)){return _0x3704e8;}else{throw new db[(_0x00b4('0x1d'))][(_0x00b4('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3704e8;}}function respondWithRpcPromise(_0x21b816,_0x204bbe,_0x36832c,_0x3f1e81){return new BPromise(function(_0x1ba0b0,_0x11983e){var _0xb13dae=_0x3f1e81||client;return _0xb13dae['request'](_0x21b816,_0x36832c)[_0x00b4('0x1f')](function(_0xaa8b09){logger[_0x00b4('0x20')](_0x00b4('0x21'),_0x204bbe,_0x00b4('0x22'));logger['debug'](_0x00b4('0x23'),_0x204bbe,_0x00b4('0x22'),JSON[_0x00b4('0x24')](_0xaa8b09));if(_0xaa8b09['error']){if(_0xaa8b09[_0x00b4('0x25')][_0x00b4('0x26')]===0x1f4){logger[_0x00b4('0x25')](_0x00b4('0x21'),_0x204bbe,_0xaa8b09[_0x00b4('0x25')]['message']);return _0x11983e(_0xaa8b09['error'][_0x00b4('0x27')]);}logger[_0x00b4('0x25')](_0x00b4('0x21'),_0x204bbe,_0xaa8b09[_0x00b4('0x25')][_0x00b4('0x27')]);return _0x1ba0b0(_0xaa8b09['error'][_0x00b4('0x27')]);}else{logger[_0x00b4('0x20')]('DeskConfiguration,\x20%s,\x20%s',_0x204bbe,_0x00b4('0x22'));_0x1ba0b0(_0xaa8b09[_0x00b4('0x28')][_0x00b4('0x27')]);}})['catch'](function(_0x130984){logger[_0x00b4('0x25')](_0x00b4('0x21'),_0x204bbe,_0x130984);_0x11983e(_0x130984);});});}function respondWithStatusCode(_0x50d48d,_0x59347e){_0x59347e=_0x59347e||0xcc;return function(_0xc695ca){if(_0xc695ca){return _0x50d48d[_0x00b4('0x29')](_0x59347e);}return _0x50d48d[_0x00b4('0x2a')](_0x59347e)[_0x00b4('0x2b')]();};}function respondWithResult(_0x3cf0ff,_0x3f2e95){_0x3f2e95=_0x3f2e95||0xc8;return function(_0x591363){if(_0x591363){return _0x3cf0ff[_0x00b4('0x2a')](_0x3f2e95)[_0x00b4('0x2c')](_0x591363);}};}function respondWithFilteredResult(_0x19fda1,_0x1f43d9){return function(_0x1e4e77){if(_0x1e4e77){var _0x21cc39=_0x1e4e77[_0x00b4('0x2d')],_0x13e6f8=_0x1f43d9[_0x00b4('0x2e')],_0x8081ef=_0x1f43d9['offset']+_0x1f43d9[_0x00b4('0x2f')],_0x3d3684;if(_0x8081ef>=_0x21cc39){_0x8081ef=_0x21cc39;_0x3d3684=0xc8;}else{_0x3d3684=0xce;}_0x19fda1[_0x00b4('0x2a')](_0x3d3684);return _0x19fda1[_0x00b4('0x30')](_0x00b4('0x31'),_0x13e6f8+'-'+_0x8081ef+'/'+_0x21cc39)[_0x00b4('0x2c')](_0x1e4e77);}return null;};}function patchUpdates(_0x573bb7){return function(_0x3cb548){try{jsonpatch['apply'](_0x3cb548,_0x573bb7,!![]);}catch(_0x37aafb){return BPromise[_0x00b4('0x32')](_0x37aafb);}return _0x3cb548['save']();};}function saveUpdates(_0x2d62d1,_0x4d65df){return function(_0x4d26c0){if(_0x4d26c0){return _0x4d26c0['update'](_0x2d62d1)[_0x00b4('0x1f')](function(_0x1e6c68){return _0x1e6c68;});}return null;};}function removeEntity(_0x438660,_0x411b54){return function(_0x5687ff){if(_0x5687ff){return _0x5687ff['destroy']()[_0x00b4('0x1f')](function(){_0x438660[_0x00b4('0x2a')](0xcc)[_0x00b4('0x2b')]();});}};}function handleEntityNotFound(_0x2cc7b5,_0x2531fd){return function(_0x44b63f){if(!_0x44b63f){_0x2cc7b5['sendStatus'](0x194);}return _0x44b63f;};}function handleError(_0xd1cf3d,_0x2cc619){_0x2cc619=_0x2cc619||0x1f4;return function(_0x576464){logger['error'](_0x576464[_0x00b4('0x33')]);if(_0x576464['name']){delete _0x576464['name'];}_0xd1cf3d[_0x00b4('0x2a')](_0x2cc619)[_0x00b4('0x34')](_0x576464);};}exports[_0x00b4('0x35')]=function(_0x4b77fc,_0x11f076){var _0x5a4e6={},_0x171aa3={},_0x43eb92={'count':0x0,'rows':[]};var _0x59c22c=_[_0x00b4('0x36')](db[_0x00b4('0x37')]['rawAttributes'],function(_0x2e77d9){return{'name':_0x2e77d9[_0x00b4('0x38')],'type':_0x2e77d9['type'][_0x00b4('0x39')]};});_0x171aa3['model']=_[_0x00b4('0x36')](_0x59c22c,_0x00b4('0x3a'));_0x171aa3[_0x00b4('0x3b')]=_['keys'](_0x4b77fc['query']);_0x171aa3[_0x00b4('0x3c')]=_['intersection'](_0x171aa3[_0x00b4('0x3d')],_0x171aa3[_0x00b4('0x3b')]);_0x5a4e6[_0x00b4('0x3e')]=_[_0x00b4('0x3f')](_0x171aa3['model'],qs[_0x00b4('0x40')](_0x4b77fc[_0x00b4('0x3b')][_0x00b4('0x40')]));_0x5a4e6[_0x00b4('0x3e')]=_0x5a4e6[_0x00b4('0x3e')]['length']?_0x5a4e6['attributes']:_0x171aa3[_0x00b4('0x3d')];if(!_0x4b77fc[_0x00b4('0x3b')][_0x00b4('0x41')](_0x00b4('0x42'))){_0x5a4e6[_0x00b4('0x2f')]=qs[_0x00b4('0x2f')](_0x4b77fc[_0x00b4('0x3b')][_0x00b4('0x2f')]);_0x5a4e6['offset']=qs[_0x00b4('0x2e')](_0x4b77fc[_0x00b4('0x3b')][_0x00b4('0x2e')]);}_0x5a4e6['order']=qs[_0x00b4('0x43')](_0x4b77fc[_0x00b4('0x3b')][_0x00b4('0x43')]);_0x5a4e6[_0x00b4('0x44')]=qs[_0x00b4('0x3c')](_['pick'](_0x4b77fc[_0x00b4('0x3b')],_0x171aa3[_0x00b4('0x3c')]),_0x59c22c);if(_0x4b77fc[_0x00b4('0x3b')][_0x00b4('0x45')]){_0x5a4e6[_0x00b4('0x44')]=_[_0x00b4('0x46')](_0x5a4e6[_0x00b4('0x44')],{'$or':_[_0x00b4('0x36')](_0x59c22c,function(_0x3f03d9){if(_0x3f03d9[_0x00b4('0x47')]!==_0x00b4('0x48')){var _0x1ad51b={};_0x1ad51b[_0x3f03d9[_0x00b4('0x3a')]]={'$like':'%'+_0x4b77fc[_0x00b4('0x3b')][_0x00b4('0x45')]+'%'};return _0x1ad51b;}})});}_0x5a4e6=_[_0x00b4('0x46')]({},_0x5a4e6,_0x4b77fc[_0x00b4('0x49')]);var _0x1cc7f9={'where':_0x5a4e6[_0x00b4('0x44')]};return db['DeskConfiguration'][_0x00b4('0x2d')](_0x1cc7f9)['then'](function(_0x17a94f){_0x43eb92[_0x00b4('0x2d')]=_0x17a94f;if(_0x4b77fc[_0x00b4('0x3b')][_0x00b4('0x4a')]){_0x5a4e6[_0x00b4('0x4b')]=[{'all':!![]}];}return db[_0x00b4('0x37')][_0x00b4('0x4c')](_0x5a4e6);})[_0x00b4('0x1f')](function(_0x1df1e6){_0x43eb92[_0x00b4('0x4d')]=_0x1df1e6;return _0x43eb92;})[_0x00b4('0x1f')](respondWithFilteredResult(_0x11f076,_0x5a4e6))['catch'](handleError(_0x11f076,null));};exports['show']=function(_0x247566,_0x47f40a){var _0xe53320={'raw':![],'where':{'id':_0x247566['params']['id']}},_0x434716={};_0x434716[_0x00b4('0x3d')]=_[_0x00b4('0x4e')](db[_0x00b4('0x37')][_0x00b4('0x4f')]);_0x434716[_0x00b4('0x3b')]=_['keys'](_0x247566[_0x00b4('0x3b')]);_0x434716[_0x00b4('0x3c')]=_[_0x00b4('0x3f')](_0x434716[_0x00b4('0x3d')],_0x434716[_0x00b4('0x3b')]);_0xe53320[_0x00b4('0x3e')]=_[_0x00b4('0x3f')](_0x434716['model'],qs[_0x00b4('0x40')](_0x247566[_0x00b4('0x3b')][_0x00b4('0x40')]));_0xe53320[_0x00b4('0x3e')]=_0xe53320[_0x00b4('0x3e')][_0x00b4('0x50')]?_0xe53320[_0x00b4('0x3e')]:_0x434716['model'];if(_0x247566[_0x00b4('0x3b')][_0x00b4('0x4a')]){_0xe53320[_0x00b4('0x4b')]=[{'all':!![]}];}_0xe53320=_[_0x00b4('0x46')]({},_0xe53320,_0x247566[_0x00b4('0x49')]);return db[_0x00b4('0x37')][_0x00b4('0x51')](_0xe53320)[_0x00b4('0x1f')](handleEntityNotFound(_0x47f40a,null))[_0x00b4('0x1f')](respondWithResult(_0x47f40a,null))[_0x00b4('0x52')](handleError(_0x47f40a,null));};exports[_0x00b4('0x53')]=function(_0x3fb99f,_0x250e59){return db[_0x00b4('0x37')][_0x00b4('0x53')](_0x3fb99f['body'],{})[_0x00b4('0x1f')](respondWithResult(_0x250e59,0xc9))[_0x00b4('0x52')](handleError(_0x250e59,null));};exports[_0x00b4('0x54')]=function(_0x4b4821,_0x473e0c){if(_0x4b4821[_0x00b4('0x55')]['id']){delete _0x4b4821[_0x00b4('0x55')]['id'];}return db['DeskConfiguration'][_0x00b4('0x51')]({'where':{'id':_0x4b4821[_0x00b4('0x56')]['id']}})['then'](handleEntityNotFound(_0x473e0c,null))[_0x00b4('0x1f')](saveUpdates(_0x4b4821[_0x00b4('0x55')],null))[_0x00b4('0x1f')](respondWithResult(_0x473e0c,null))[_0x00b4('0x52')](handleError(_0x473e0c,null));};exports['destroy']=function(_0x4b82b6,_0x19524f){return db['DeskConfiguration'][_0x00b4('0x51')]({'where':{'id':_0x4b82b6[_0x00b4('0x56')]['id']}})[_0x00b4('0x1f')](handleEntityNotFound(_0x19524f,null))[_0x00b4('0x1f')](removeEntity(_0x19524f,null))[_0x00b4('0x52')](handleError(_0x19524f,null));};exports[_0x00b4('0x57')]=function(_0x45ea6a,_0x3f2543,_0x225a30){var _0x57e9e4={};var _0x522640={};var _0x22dbb7;var _0x1e21ef;return db['DeskConfiguration'][_0x00b4('0x58')]({'where':{'id':_0x45ea6a[_0x00b4('0x56')]['id']}})[_0x00b4('0x1f')](handleEntityNotFound(_0x3f2543,null))[_0x00b4('0x1f')](function(_0x1ac847){if(_0x1ac847){_0x22dbb7=_0x1ac847;_0x522640['model']=_[_0x00b4('0x4e')](db[_0x00b4('0x59')]['rawAttributes']);_0x522640[_0x00b4('0x3b')]=_[_0x00b4('0x4e')](_0x45ea6a[_0x00b4('0x3b')]);_0x522640['filters']=_['intersection'](_0x522640[_0x00b4('0x3d')],_0x522640[_0x00b4('0x3b')]);_0x57e9e4[_0x00b4('0x3e')]=_[_0x00b4('0x3f')](_0x522640[_0x00b4('0x3d')],qs[_0x00b4('0x40')](_0x45ea6a[_0x00b4('0x3b')][_0x00b4('0x40')]));_0x57e9e4['attributes']=_0x57e9e4[_0x00b4('0x3e')][_0x00b4('0x50')]?_0x57e9e4[_0x00b4('0x3e')]:_0x522640['model'];_0x57e9e4[_0x00b4('0x5a')]=qs['sort'](_0x45ea6a[_0x00b4('0x3b')][_0x00b4('0x43')]);_0x57e9e4[_0x00b4('0x44')]=qs[_0x00b4('0x3c')](_[_0x00b4('0x5b')](_0x45ea6a[_0x00b4('0x3b')],_0x522640[_0x00b4('0x3c')]));if(_0x45ea6a[_0x00b4('0x3b')][_0x00b4('0x45')]){_0x57e9e4[_0x00b4('0x44')]=_[_0x00b4('0x46')](_0x57e9e4['where'],{'$or':_[_0x00b4('0x36')](_0x57e9e4[_0x00b4('0x3e')],function(_0x2e6ea3){var _0x8ebd59={};_0x8ebd59[_0x2e6ea3]={'$like':'%'+_0x45ea6a['query'][_0x00b4('0x45')]+'%'};return _0x8ebd59;})});}_0x57e9e4=_[_0x00b4('0x46')]({},_0x57e9e4,_0x45ea6a[_0x00b4('0x49')]);return _0x22dbb7[_0x00b4('0x57')](_0x57e9e4);}})['then'](function(_0x474d44){if(_0x474d44){_0x1e21ef=_0x474d44[_0x00b4('0x50')];if(!_0x45ea6a[_0x00b4('0x3b')][_0x00b4('0x41')](_0x00b4('0x42'))){_0x57e9e4[_0x00b4('0x2f')]=qs[_0x00b4('0x2f')](_0x45ea6a[_0x00b4('0x3b')][_0x00b4('0x2f')]);_0x57e9e4[_0x00b4('0x2e')]=qs[_0x00b4('0x2e')](_0x45ea6a['query']['offset']);}return _0x22dbb7[_0x00b4('0x57')](_0x57e9e4);}})[_0x00b4('0x1f')](function(_0x3d92f9){if(_0x3d92f9){return _0x3d92f9?{'count':_0x1e21ef,'rows':_0x3d92f9}:null;}})[_0x00b4('0x1f')](respondWithResult(_0x3f2543,null))[_0x00b4('0x52')](handleError(_0x3f2543,null));};exports[_0x00b4('0x5c')]=function(_0x50ddb6,_0x1fc37b,_0x283933){var _0x8e7da1={};var _0x8ecc1b={};var _0x1a468a;var _0x4f2935;return db['DeskConfiguration'][_0x00b4('0x58')]({'where':{'id':_0x50ddb6[_0x00b4('0x56')]['id']}})[_0x00b4('0x1f')](handleEntityNotFound(_0x1fc37b,null))['then'](function(_0x1ff528){if(_0x1ff528){_0x1a468a=_0x1ff528;_0x8ecc1b[_0x00b4('0x3d')]=_[_0x00b4('0x4e')](db[_0x00b4('0x59')]['rawAttributes']);_0x8ecc1b[_0x00b4('0x3b')]=_[_0x00b4('0x4e')](_0x50ddb6[_0x00b4('0x3b')]);_0x8ecc1b[_0x00b4('0x3c')]=_['intersection'](_0x8ecc1b[_0x00b4('0x3d')],_0x8ecc1b['query']);_0x8e7da1[_0x00b4('0x3e')]=_[_0x00b4('0x3f')](_0x8ecc1b[_0x00b4('0x3d')],qs[_0x00b4('0x40')](_0x50ddb6[_0x00b4('0x3b')][_0x00b4('0x40')]));_0x8e7da1[_0x00b4('0x3e')]=_0x8e7da1[_0x00b4('0x3e')][_0x00b4('0x50')]?_0x8e7da1['attributes']:_0x8ecc1b[_0x00b4('0x3d')];_0x8e7da1[_0x00b4('0x5a')]=qs[_0x00b4('0x43')](_0x50ddb6['query']['sort']);_0x8e7da1['where']=qs[_0x00b4('0x3c')](_[_0x00b4('0x5b')](_0x50ddb6[_0x00b4('0x3b')],_0x8ecc1b[_0x00b4('0x3c')]));if(_0x50ddb6['query']['filter']){_0x8e7da1['where']=_[_0x00b4('0x46')](_0x8e7da1[_0x00b4('0x44')],{'$or':_['map'](_0x8e7da1[_0x00b4('0x3e')],function(_0x539713){var _0x2caa0c={};_0x2caa0c[_0x539713]={'$like':'%'+_0x50ddb6[_0x00b4('0x3b')][_0x00b4('0x45')]+'%'};return _0x2caa0c;})});}_0x8e7da1=_[_0x00b4('0x46')]({},_0x8e7da1,_0x50ddb6[_0x00b4('0x49')]);return _0x1a468a[_0x00b4('0x5c')](_0x8e7da1);}})[_0x00b4('0x1f')](function(_0x48883c){if(_0x48883c){_0x4f2935=_0x48883c['length'];if(!_0x50ddb6[_0x00b4('0x3b')][_0x00b4('0x41')](_0x00b4('0x42'))){_0x8e7da1[_0x00b4('0x2f')]=qs[_0x00b4('0x2f')](_0x50ddb6[_0x00b4('0x3b')][_0x00b4('0x2f')]);_0x8e7da1['offset']=qs[_0x00b4('0x2e')](_0x50ddb6[_0x00b4('0x3b')]['offset']);}return _0x1a468a[_0x00b4('0x5c')](_0x8e7da1);}})[_0x00b4('0x1f')](function(_0x523678){if(_0x523678){return _0x523678?{'count':_0x4f2935,'rows':_0x523678}:null;}})[_0x00b4('0x1f')](respondWithResult(_0x1fc37b,null))['catch'](handleError(_0x1fc37b,null));};exports[_0x00b4('0x5d')]=function(_0x50c156,_0x5c7f4b,_0x5b9f74){var _0xd6e56c={};var _0x357559={};var _0x358e40;var _0x878333;return db[_0x00b4('0x37')][_0x00b4('0x58')]({'where':{'id':_0x50c156[_0x00b4('0x56')]['id']}})[_0x00b4('0x1f')](handleEntityNotFound(_0x5c7f4b,null))[_0x00b4('0x1f')](function(_0x59fc4d){if(_0x59fc4d){_0x358e40=_0x59fc4d;_0x357559[_0x00b4('0x3d')]=_[_0x00b4('0x4e')](db['DeskField'][_0x00b4('0x4f')]);_0x357559['query']=_['keys'](_0x50c156[_0x00b4('0x3b')]);_0x357559[_0x00b4('0x3c')]=_[_0x00b4('0x3f')](_0x357559[_0x00b4('0x3d')],_0x357559[_0x00b4('0x3b')]);_0xd6e56c[_0x00b4('0x3e')]=_[_0x00b4('0x3f')](_0x357559[_0x00b4('0x3d')],qs['fields'](_0x50c156[_0x00b4('0x3b')][_0x00b4('0x40')]));_0xd6e56c[_0x00b4('0x3e')]=_0xd6e56c['attributes'][_0x00b4('0x50')]?_0xd6e56c[_0x00b4('0x3e')]:_0x357559[_0x00b4('0x3d')];_0xd6e56c[_0x00b4('0x5a')]=qs[_0x00b4('0x43')](_0x50c156[_0x00b4('0x3b')][_0x00b4('0x43')]);_0xd6e56c['where']=qs[_0x00b4('0x3c')](_['pick'](_0x50c156[_0x00b4('0x3b')],_0x357559[_0x00b4('0x3c')]));if(_0x50c156[_0x00b4('0x3b')][_0x00b4('0x45')]){_0xd6e56c[_0x00b4('0x44')]=_[_0x00b4('0x46')](_0xd6e56c[_0x00b4('0x44')],{'$or':_['map'](_0xd6e56c['attributes'],function(_0x125dbe){var _0xe66c2c={};_0xe66c2c[_0x125dbe]={'$like':'%'+_0x50c156[_0x00b4('0x3b')][_0x00b4('0x45')]+'%'};return _0xe66c2c;})});}_0xd6e56c=_['merge']({},_0xd6e56c,_0x50c156[_0x00b4('0x49')]);return _0x358e40[_0x00b4('0x5d')](_0xd6e56c);}})['then'](function(_0x3cf799){if(_0x3cf799){_0x878333=_0x3cf799[_0x00b4('0x50')];if(!_0x50c156[_0x00b4('0x3b')][_0x00b4('0x41')](_0x00b4('0x42'))){_0xd6e56c['limit']=qs[_0x00b4('0x2f')](_0x50c156[_0x00b4('0x3b')][_0x00b4('0x2f')]);_0xd6e56c[_0x00b4('0x2e')]=qs['offset'](_0x50c156[_0x00b4('0x3b')][_0x00b4('0x2e')]);}return _0x358e40[_0x00b4('0x5d')](_0xd6e56c);}})[_0x00b4('0x1f')](function(_0x230310){if(_0x230310){return _0x230310?{'count':_0x878333,'rows':_0x230310}:null;}})[_0x00b4('0x1f')](respondWithResult(_0x5c7f4b,null))[_0x00b4('0x52')](handleError(_0x5c7f4b,null));};exports[_0x00b4('0x5e')]=function(_0x26aff0,_0x3af3cf,_0x582f5e){var _0x303bd0={};var _0xf3e33e={};var _0x206b1b;var _0x4bf91a;return db[_0x00b4('0x37')][_0x00b4('0x58')]({'where':{'id':_0x26aff0[_0x00b4('0x56')]['id']}})[_0x00b4('0x1f')](handleEntityNotFound(_0x3af3cf,null))[_0x00b4('0x1f')](function(_0x34b8ff){if(_0x34b8ff){_0x206b1b=_0x34b8ff;_0xf3e33e[_0x00b4('0x3d')]=_[_0x00b4('0x4e')](db['Tag'][_0x00b4('0x4f')]);_0xf3e33e[_0x00b4('0x3b')]=_[_0x00b4('0x4e')](_0x26aff0[_0x00b4('0x3b')]);_0xf3e33e[_0x00b4('0x3c')]=_[_0x00b4('0x3f')](_0xf3e33e['model'],_0xf3e33e[_0x00b4('0x3b')]);_0x303bd0[_0x00b4('0x3e')]=_[_0x00b4('0x3f')](_0xf3e33e[_0x00b4('0x3d')],qs[_0x00b4('0x40')](_0x26aff0[_0x00b4('0x3b')][_0x00b4('0x40')]));_0x303bd0['attributes']=_0x303bd0[_0x00b4('0x3e')]['length']?_0x303bd0[_0x00b4('0x3e')]:_0xf3e33e[_0x00b4('0x3d')];_0x303bd0[_0x00b4('0x5a')]=qs[_0x00b4('0x43')](_0x26aff0[_0x00b4('0x3b')][_0x00b4('0x43')]);_0x303bd0[_0x00b4('0x44')]=qs[_0x00b4('0x3c')](_[_0x00b4('0x5b')](_0x26aff0[_0x00b4('0x3b')],_0xf3e33e[_0x00b4('0x3c')]));if(_0x26aff0[_0x00b4('0x3b')][_0x00b4('0x45')]){_0x303bd0[_0x00b4('0x44')]=_[_0x00b4('0x46')](_0x303bd0[_0x00b4('0x44')],{'$or':_['map'](_0x303bd0[_0x00b4('0x3e')],function(_0x24ff4b){var _0x3411b5={};_0x3411b5[_0x24ff4b]={'$like':'%'+_0x26aff0[_0x00b4('0x3b')][_0x00b4('0x45')]+'%'};return _0x3411b5;})});}_0x303bd0=_[_0x00b4('0x46')]({},_0x303bd0,_0x26aff0['options']);return _0x206b1b[_0x00b4('0x5e')](_0x303bd0);}})[_0x00b4('0x1f')](function(_0x3199ef){if(_0x3199ef){_0x4bf91a=_0x3199ef[_0x00b4('0x50')];if(!_0x26aff0['query'][_0x00b4('0x41')](_0x00b4('0x42'))){_0x303bd0[_0x00b4('0x2f')]=qs['limit'](_0x26aff0[_0x00b4('0x3b')][_0x00b4('0x2f')]);_0x303bd0['offset']=qs[_0x00b4('0x2e')](_0x26aff0[_0x00b4('0x3b')]['offset']);}return _0x206b1b['getTags'](_0x303bd0);}})[_0x00b4('0x1f')](function(_0x4c410){if(_0x4c410){return _0x4c410?{'count':_0x4bf91a,'rows':_0x4c410}:null;}})[_0x00b4('0x1f')](respondWithResult(_0x3af3cf,null))[_0x00b4('0x52')](handleError(_0x3af3cf,null));};exports[_0x00b4('0x5f')]=function(_0x140455,_0xba88f3,_0x5ddbbc){if(_0x140455[_0x00b4('0x55')]['id']){delete _0x140455['body']['id'];}return db[_0x00b4('0x37')][_0x00b4('0x58')]({'where':{'id':_0x140455[_0x00b4('0x56')]['id']}})[_0x00b4('0x1f')](handleEntityNotFound(_0xba88f3,null))[_0x00b4('0x1f')](function(_0x326814){if(_0x326814){return _0x326814[_0x00b4('0x5f')](_0x140455[_0x00b4('0x55')]['ids']||[]);}return null;})[_0x00b4('0x1f')](respondWithResult(_0xba88f3,null))[_0x00b4('0x52')](handleError(_0xba88f3,null));};
\ No newline at end of file
+var _0x26bc=['limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','length','query','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','DeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset'];(function(_0x3e5cd3,_0x17c4b2){var _0x1e8bd0=function(_0x3e2290){while(--_0x3e2290){_0x3e5cd3['push'](_0x3e5cd3['shift']());}};_0x1e8bd0(++_0x17c4b2);}(_0x26bc,0x162));var _0xc26b=function(_0x5d2ad3,_0x1de02d){_0x5d2ad3=_0x5d2ad3-0x0;var _0x61694d=_0x26bc[_0x5d2ad3];return _0x61694d;};'use strict';var pdf=require(_0xc26b('0x0'));var emlformat=require(_0xc26b('0x1'));var rimraf=require(_0xc26b('0x2'));var zipdir=require(_0xc26b('0x3'));var jsonpatch=require(_0xc26b('0x4'));var rp=require('request-promise');var moment=require(_0xc26b('0x5'));var BPromise=require(_0xc26b('0x6'));var Mustache=require(_0xc26b('0x7'));var util=require('util');var path=require(_0xc26b('0x8'));var sox=require('sox');var csv=require(_0xc26b('0x9'));var ejs=require(_0xc26b('0xa'));var fs=require('fs');var _=require(_0xc26b('0xb'));var squel=require('squel');var crypto=require(_0xc26b('0xc'));var jsforce=require(_0xc26b('0xd'));var deskjs=require(_0xc26b('0xe'));var toCsv=require(_0xc26b('0x9'));var querystring=require(_0xc26b('0xf'));var Papa=require(_0xc26b('0x10'));var Redis=require(_0xc26b('0x11'));var authService=require(_0xc26b('0x12'));var qs=require(_0xc26b('0x13'));var as=require(_0xc26b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc26b('0x15'))(_0xc26b('0x16'));var utils=require(_0xc26b('0x17'));var config=require(_0xc26b('0x18'));var db=require(_0xc26b('0x19'))['db'];var jayson=require(_0xc26b('0x1a'));var client=jayson['client'][_0xc26b('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5a95fc,_0x56da8b,_0x6e808f){if(_0x6e808f){var _0x438621=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x438621[_0xc26b('0x1c')](_0x56da8b)){return _0x5a95fc;}else{throw new db[(_0xc26b('0x1d'))]['ValidationError'](_0xc26b('0x1e'));}}else{return _0x5a95fc;}}function respondWithRpcPromise(_0x2ee630,_0x19be02,_0x5bd8c4,_0x20f796){return new BPromise(function(_0x34e006,_0x4dc407){var _0x248645=_0x20f796||client;return _0x248645[_0xc26b('0x1f')](_0x2ee630,_0x5bd8c4)['then'](function(_0x1dba27){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x19be02,_0xc26b('0x20'));logger['debug'](_0xc26b('0x21'),_0x19be02,_0xc26b('0x20'),JSON[_0xc26b('0x22')](_0x1dba27));if(_0x1dba27[_0xc26b('0x23')]){if(_0x1dba27['error'][_0xc26b('0x24')]===0x1f4){logger[_0xc26b('0x23')](_0xc26b('0x25'),_0x19be02,_0x1dba27[_0xc26b('0x23')][_0xc26b('0x26')]);return _0x4dc407(_0x1dba27[_0xc26b('0x23')]['message']);}logger[_0xc26b('0x23')]('DeskConfiguration,\x20%s,\x20%s',_0x19be02,_0x1dba27[_0xc26b('0x23')][_0xc26b('0x26')]);return _0x34e006(_0x1dba27[_0xc26b('0x23')][_0xc26b('0x26')]);}else{logger['info'](_0xc26b('0x25'),_0x19be02,_0xc26b('0x20'));_0x34e006(_0x1dba27[_0xc26b('0x27')][_0xc26b('0x26')]);}})['catch'](function(_0x379cdb){logger[_0xc26b('0x23')]('DeskConfiguration,\x20%s,\x20%s',_0x19be02,_0x379cdb);_0x4dc407(_0x379cdb);});});}function respondWithStatusCode(_0x4c0095,_0x203374){_0x203374=_0x203374||0xcc;return function(_0x1bb8e5){if(_0x1bb8e5){return _0x4c0095[_0xc26b('0x28')](_0x203374);}return _0x4c0095[_0xc26b('0x29')](_0x203374)[_0xc26b('0x2a')]();};}function respondWithResult(_0x20a84f,_0x4e6cc6){_0x4e6cc6=_0x4e6cc6||0xc8;return function(_0x3eea3b){if(_0x3eea3b){return _0x20a84f['status'](_0x4e6cc6)[_0xc26b('0x2b')](_0x3eea3b);}};}function respondWithFilteredResult(_0x6ec732,_0x302485){return function(_0x5422df){if(_0x5422df){var _0x1f7d2e=_0x5422df[_0xc26b('0x2c')],_0x3459d3=_0x302485[_0xc26b('0x2d')],_0x17c93e=_0x302485['offset']+_0x302485[_0xc26b('0x2e')],_0x1dd5d4;if(_0x17c93e>=_0x1f7d2e){_0x17c93e=_0x1f7d2e;_0x1dd5d4=0xc8;}else{_0x1dd5d4=0xce;}_0x6ec732['status'](_0x1dd5d4);return _0x6ec732[_0xc26b('0x2f')]('Content-Range',_0x3459d3+'-'+_0x17c93e+'/'+_0x1f7d2e)['json'](_0x5422df);}return null;};}function patchUpdates(_0x4681ac){return function(_0x405e37){try{jsonpatch[_0xc26b('0x30')](_0x405e37,_0x4681ac,!![]);}catch(_0x49c679){return BPromise[_0xc26b('0x31')](_0x49c679);}return _0x405e37[_0xc26b('0x32')]();};}function saveUpdates(_0x555907,_0x16479a){return function(_0x764fef){if(_0x764fef){return _0x764fef[_0xc26b('0x33')](_0x555907)[_0xc26b('0x34')](function(_0x299bb7){return _0x299bb7;});}return null;};}function removeEntity(_0x1a17bd,_0x110ad6){return function(_0x128c11){if(_0x128c11){return _0x128c11[_0xc26b('0x35')]()[_0xc26b('0x34')](function(){_0x1a17bd['status'](0xcc)[_0xc26b('0x2a')]();});}};}function handleEntityNotFound(_0x574aae,_0x2458f7){return function(_0x27e0d8){if(!_0x27e0d8){_0x574aae['sendStatus'](0x194);}return _0x27e0d8;};}function handleError(_0x69e8ca,_0x150fab){_0x150fab=_0x150fab||0x1f4;return function(_0x3c3fa7){logger[_0xc26b('0x23')](_0x3c3fa7[_0xc26b('0x36')]);if(_0x3c3fa7[_0xc26b('0x37')]){delete _0x3c3fa7[_0xc26b('0x37')];}_0x69e8ca[_0xc26b('0x29')](_0x150fab)[_0xc26b('0x38')](_0x3c3fa7);};}exports[_0xc26b('0x39')]=function(_0x4c969f,_0x2f218f){var _0x2615ac={},_0x412a19={},_0x2fa216={'count':0x0,'rows':[]};var _0x2634b9=_[_0xc26b('0x3a')](db[_0xc26b('0x3b')][_0xc26b('0x3c')],function(_0x3f1c24){return{'name':_0x3f1c24[_0xc26b('0x3d')],'type':_0x3f1c24[_0xc26b('0x3e')][_0xc26b('0x3f')]};});_0x412a19[_0xc26b('0x40')]=_[_0xc26b('0x3a')](_0x2634b9,_0xc26b('0x37'));_0x412a19['query']=_[_0xc26b('0x41')](_0x4c969f['query']);_0x412a19[_0xc26b('0x42')]=_[_0xc26b('0x43')](_0x412a19['model'],_0x412a19['query']);_0x2615ac[_0xc26b('0x44')]=_[_0xc26b('0x43')](_0x412a19[_0xc26b('0x40')],qs['fields'](_0x4c969f['query'][_0xc26b('0x45')]));_0x2615ac[_0xc26b('0x44')]=_0x2615ac[_0xc26b('0x44')][_0xc26b('0x46')]?_0x2615ac[_0xc26b('0x44')]:_0x412a19[_0xc26b('0x40')];if(!_0x4c969f[_0xc26b('0x47')][_0xc26b('0x48')](_0xc26b('0x49'))){_0x2615ac[_0xc26b('0x2e')]=qs[_0xc26b('0x2e')](_0x4c969f['query'][_0xc26b('0x2e')]);_0x2615ac[_0xc26b('0x2d')]=qs[_0xc26b('0x2d')](_0x4c969f[_0xc26b('0x47')]['offset']);}_0x2615ac['order']=qs[_0xc26b('0x4a')](_0x4c969f['query'][_0xc26b('0x4a')]);_0x2615ac[_0xc26b('0x4b')]=qs[_0xc26b('0x42')](_[_0xc26b('0x4c')](_0x4c969f[_0xc26b('0x47')],_0x412a19[_0xc26b('0x42')]),_0x2634b9);if(_0x4c969f[_0xc26b('0x47')]['filter']){_0x2615ac['where']=_[_0xc26b('0x4d')](_0x2615ac[_0xc26b('0x4b')],{'$or':_[_0xc26b('0x3a')](_0x2634b9,function(_0x3d9bb7){if(_0x3d9bb7['type']!==_0xc26b('0x4e')){var _0x4a1b11={};_0x4a1b11[_0x3d9bb7[_0xc26b('0x37')]]={'$like':'%'+_0x4c969f[_0xc26b('0x47')][_0xc26b('0x4f')]+'%'};return _0x4a1b11;}})});}_0x2615ac=_[_0xc26b('0x4d')]({},_0x2615ac,_0x4c969f[_0xc26b('0x50')]);var _0x4909fa={'where':_0x2615ac[_0xc26b('0x4b')]};return db['DeskConfiguration'][_0xc26b('0x2c')](_0x4909fa)[_0xc26b('0x34')](function(_0x3fa59a){_0x2fa216[_0xc26b('0x2c')]=_0x3fa59a;if(_0x4c969f['query']['includeAll']){_0x2615ac[_0xc26b('0x51')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x2615ac);})[_0xc26b('0x34')](function(_0xe9b2fb){_0x2fa216[_0xc26b('0x52')]=_0xe9b2fb;return _0x2fa216;})[_0xc26b('0x34')](respondWithFilteredResult(_0x2f218f,_0x2615ac))[_0xc26b('0x53')](handleError(_0x2f218f,null));};exports[_0xc26b('0x54')]=function(_0xae0d85,_0x16933f){var _0x3bef7f={'raw':![],'where':{'id':_0xae0d85[_0xc26b('0x55')]['id']}},_0x16dff3={};_0x16dff3[_0xc26b('0x40')]=_[_0xc26b('0x41')](db[_0xc26b('0x3b')]['rawAttributes']);_0x16dff3['query']=_[_0xc26b('0x41')](_0xae0d85[_0xc26b('0x47')]);_0x16dff3[_0xc26b('0x42')]=_[_0xc26b('0x43')](_0x16dff3['model'],_0x16dff3[_0xc26b('0x47')]);_0x3bef7f['attributes']=_[_0xc26b('0x43')](_0x16dff3[_0xc26b('0x40')],qs['fields'](_0xae0d85[_0xc26b('0x47')]['fields']));_0x3bef7f['attributes']=_0x3bef7f['attributes']['length']?_0x3bef7f[_0xc26b('0x44')]:_0x16dff3[_0xc26b('0x40')];if(_0xae0d85[_0xc26b('0x47')][_0xc26b('0x56')]){_0x3bef7f['include']=[{'all':!![]}];}_0x3bef7f=_['merge']({},_0x3bef7f,_0xae0d85[_0xc26b('0x50')]);return db['DeskConfiguration'][_0xc26b('0x57')](_0x3bef7f)[_0xc26b('0x34')](handleEntityNotFound(_0x16933f,null))['then'](respondWithResult(_0x16933f,null))[_0xc26b('0x53')](handleError(_0x16933f,null));};exports[_0xc26b('0x58')]=function(_0x479fe8,_0x13354f){return db[_0xc26b('0x3b')][_0xc26b('0x58')](_0x479fe8[_0xc26b('0x59')],{})[_0xc26b('0x34')](respondWithResult(_0x13354f,0xc9))[_0xc26b('0x53')](handleError(_0x13354f,null));};exports[_0xc26b('0x33')]=function(_0x4e0519,_0x30f079){if(_0x4e0519[_0xc26b('0x59')]['id']){delete _0x4e0519[_0xc26b('0x59')]['id'];}return db[_0xc26b('0x3b')][_0xc26b('0x57')]({'where':{'id':_0x4e0519[_0xc26b('0x55')]['id']}})[_0xc26b('0x34')](handleEntityNotFound(_0x30f079,null))[_0xc26b('0x34')](saveUpdates(_0x4e0519[_0xc26b('0x59')],null))[_0xc26b('0x34')](respondWithResult(_0x30f079,null))['catch'](handleError(_0x30f079,null));};exports[_0xc26b('0x35')]=function(_0xfd7e42,_0x14ec36){return db[_0xc26b('0x3b')][_0xc26b('0x57')]({'where':{'id':_0xfd7e42[_0xc26b('0x55')]['id']}})[_0xc26b('0x34')](handleEntityNotFound(_0x14ec36,null))[_0xc26b('0x34')](removeEntity(_0x14ec36,null))[_0xc26b('0x53')](handleError(_0x14ec36,null));};exports[_0xc26b('0x5a')]=function(_0x1a3506,_0x544853,_0x572280){var _0xee9365={};var _0x5c651f={};var _0x3a1907;var _0xcc268;return db[_0xc26b('0x3b')][_0xc26b('0x5b')]({'where':{'id':_0x1a3506['params']['id']}})[_0xc26b('0x34')](handleEntityNotFound(_0x544853,null))[_0xc26b('0x34')](function(_0x106b07){if(_0x106b07){_0x3a1907=_0x106b07;_0x5c651f[_0xc26b('0x40')]=_[_0xc26b('0x41')](db[_0xc26b('0x5c')]['rawAttributes']);_0x5c651f[_0xc26b('0x47')]=_[_0xc26b('0x41')](_0x1a3506['query']);_0x5c651f[_0xc26b('0x42')]=_[_0xc26b('0x43')](_0x5c651f[_0xc26b('0x40')],_0x5c651f[_0xc26b('0x47')]);_0xee9365[_0xc26b('0x44')]=_[_0xc26b('0x43')](_0x5c651f[_0xc26b('0x40')],qs[_0xc26b('0x45')](_0x1a3506[_0xc26b('0x47')][_0xc26b('0x45')]));_0xee9365['attributes']=_0xee9365[_0xc26b('0x44')]['length']?_0xee9365['attributes']:_0x5c651f[_0xc26b('0x40')];_0xee9365[_0xc26b('0x5d')]=qs[_0xc26b('0x4a')](_0x1a3506[_0xc26b('0x47')][_0xc26b('0x4a')]);_0xee9365['where']=qs['filters'](_[_0xc26b('0x4c')](_0x1a3506[_0xc26b('0x47')],_0x5c651f['filters']));if(_0x1a3506['query'][_0xc26b('0x4f')]){_0xee9365['where']=_['merge'](_0xee9365['where'],{'$or':_[_0xc26b('0x3a')](_0xee9365[_0xc26b('0x44')],function(_0x365dd9){var _0xd5f27d={};_0xd5f27d[_0x365dd9]={'$like':'%'+_0x1a3506['query'][_0xc26b('0x4f')]+'%'};return _0xd5f27d;})});}_0xee9365=_['merge']({},_0xee9365,_0x1a3506[_0xc26b('0x50')]);return _0x3a1907[_0xc26b('0x5a')](_0xee9365);}})[_0xc26b('0x34')](function(_0xd5ab2d){if(_0xd5ab2d){_0xcc268=_0xd5ab2d['length'];if(!_0x1a3506[_0xc26b('0x47')]['hasOwnProperty'](_0xc26b('0x49'))){_0xee9365[_0xc26b('0x2e')]=qs[_0xc26b('0x2e')](_0x1a3506[_0xc26b('0x47')][_0xc26b('0x2e')]);_0xee9365[_0xc26b('0x2d')]=qs[_0xc26b('0x2d')](_0x1a3506[_0xc26b('0x47')][_0xc26b('0x2d')]);}return _0x3a1907[_0xc26b('0x5a')](_0xee9365);}})['then'](function(_0x3dbf8e){if(_0x3dbf8e){return _0x3dbf8e?{'count':_0xcc268,'rows':_0x3dbf8e}:null;}})[_0xc26b('0x34')](respondWithResult(_0x544853,null))[_0xc26b('0x53')](handleError(_0x544853,null));};exports[_0xc26b('0x5e')]=function(_0x418cd7,_0x34ef71,_0x1c00db){var _0x2bb2c4={};var _0x29b4c9={};var _0x23118c;var _0x288c2c;return db[_0xc26b('0x3b')][_0xc26b('0x5b')]({'where':{'id':_0x418cd7['params']['id']}})[_0xc26b('0x34')](handleEntityNotFound(_0x34ef71,null))[_0xc26b('0x34')](function(_0x320eae){if(_0x320eae){_0x23118c=_0x320eae;_0x29b4c9[_0xc26b('0x40')]=_[_0xc26b('0x41')](db['DeskField'][_0xc26b('0x3c')]);_0x29b4c9['query']=_[_0xc26b('0x41')](_0x418cd7[_0xc26b('0x47')]);_0x29b4c9['filters']=_[_0xc26b('0x43')](_0x29b4c9[_0xc26b('0x40')],_0x29b4c9[_0xc26b('0x47')]);_0x2bb2c4[_0xc26b('0x44')]=_[_0xc26b('0x43')](_0x29b4c9[_0xc26b('0x40')],qs[_0xc26b('0x45')](_0x418cd7[_0xc26b('0x47')][_0xc26b('0x45')]));_0x2bb2c4[_0xc26b('0x44')]=_0x2bb2c4[_0xc26b('0x44')][_0xc26b('0x46')]?_0x2bb2c4['attributes']:_0x29b4c9[_0xc26b('0x40')];_0x2bb2c4[_0xc26b('0x5d')]=qs['sort'](_0x418cd7['query'][_0xc26b('0x4a')]);_0x2bb2c4[_0xc26b('0x4b')]=qs[_0xc26b('0x42')](_[_0xc26b('0x4c')](_0x418cd7['query'],_0x29b4c9[_0xc26b('0x42')]));if(_0x418cd7[_0xc26b('0x47')]['filter']){_0x2bb2c4[_0xc26b('0x4b')]=_['merge'](_0x2bb2c4[_0xc26b('0x4b')],{'$or':_[_0xc26b('0x3a')](_0x2bb2c4['attributes'],function(_0x4cb1d4){var _0x32f9d0={};_0x32f9d0[_0x4cb1d4]={'$like':'%'+_0x418cd7[_0xc26b('0x47')][_0xc26b('0x4f')]+'%'};return _0x32f9d0;})});}_0x2bb2c4=_['merge']({},_0x2bb2c4,_0x418cd7[_0xc26b('0x50')]);return _0x23118c[_0xc26b('0x5e')](_0x2bb2c4);}})[_0xc26b('0x34')](function(_0x3b3b89){if(_0x3b3b89){_0x288c2c=_0x3b3b89['length'];if(!_0x418cd7[_0xc26b('0x47')]['hasOwnProperty'](_0xc26b('0x49'))){_0x2bb2c4[_0xc26b('0x2e')]=qs[_0xc26b('0x2e')](_0x418cd7[_0xc26b('0x47')]['limit']);_0x2bb2c4[_0xc26b('0x2d')]=qs[_0xc26b('0x2d')](_0x418cd7[_0xc26b('0x47')]['offset']);}return _0x23118c[_0xc26b('0x5e')](_0x2bb2c4);}})['then'](function(_0x1ff2da){if(_0x1ff2da){return _0x1ff2da?{'count':_0x288c2c,'rows':_0x1ff2da}:null;}})[_0xc26b('0x34')](respondWithResult(_0x34ef71,null))[_0xc26b('0x53')](handleError(_0x34ef71,null));};exports['getDescriptions']=function(_0x21de4f,_0x8de9cc,_0x518f4a){var _0x37dc40={};var _0x8c257f={};var _0x428e68;var _0x314745;return db[_0xc26b('0x3b')][_0xc26b('0x5b')]({'where':{'id':_0x21de4f[_0xc26b('0x55')]['id']}})[_0xc26b('0x34')](handleEntityNotFound(_0x8de9cc,null))[_0xc26b('0x34')](function(_0x29aa3a){if(_0x29aa3a){_0x428e68=_0x29aa3a;_0x8c257f[_0xc26b('0x40')]=_[_0xc26b('0x41')](db[_0xc26b('0x5c')][_0xc26b('0x3c')]);_0x8c257f[_0xc26b('0x47')]=_[_0xc26b('0x41')](_0x21de4f[_0xc26b('0x47')]);_0x8c257f[_0xc26b('0x42')]=_['intersection'](_0x8c257f['model'],_0x8c257f[_0xc26b('0x47')]);_0x37dc40['attributes']=_[_0xc26b('0x43')](_0x8c257f[_0xc26b('0x40')],qs[_0xc26b('0x45')](_0x21de4f[_0xc26b('0x47')][_0xc26b('0x45')]));_0x37dc40[_0xc26b('0x44')]=_0x37dc40['attributes'][_0xc26b('0x46')]?_0x37dc40[_0xc26b('0x44')]:_0x8c257f[_0xc26b('0x40')];_0x37dc40[_0xc26b('0x5d')]=qs[_0xc26b('0x4a')](_0x21de4f[_0xc26b('0x47')][_0xc26b('0x4a')]);_0x37dc40[_0xc26b('0x4b')]=qs[_0xc26b('0x42')](_[_0xc26b('0x4c')](_0x21de4f[_0xc26b('0x47')],_0x8c257f[_0xc26b('0x42')]));if(_0x21de4f['query'][_0xc26b('0x4f')]){_0x37dc40['where']=_['merge'](_0x37dc40[_0xc26b('0x4b')],{'$or':_[_0xc26b('0x3a')](_0x37dc40['attributes'],function(_0x322fcb){var _0x2a499b={};_0x2a499b[_0x322fcb]={'$like':'%'+_0x21de4f[_0xc26b('0x47')]['filter']+'%'};return _0x2a499b;})});}_0x37dc40=_[_0xc26b('0x4d')]({},_0x37dc40,_0x21de4f[_0xc26b('0x50')]);return _0x428e68[_0xc26b('0x5f')](_0x37dc40);}})[_0xc26b('0x34')](function(_0x32c85a){if(_0x32c85a){_0x314745=_0x32c85a[_0xc26b('0x46')];if(!_0x21de4f[_0xc26b('0x47')][_0xc26b('0x48')](_0xc26b('0x49'))){_0x37dc40[_0xc26b('0x2e')]=qs[_0xc26b('0x2e')](_0x21de4f['query']['limit']);_0x37dc40[_0xc26b('0x2d')]=qs['offset'](_0x21de4f[_0xc26b('0x47')][_0xc26b('0x2d')]);}return _0x428e68[_0xc26b('0x5f')](_0x37dc40);}})[_0xc26b('0x34')](function(_0x4e04ea){if(_0x4e04ea){return _0x4e04ea?{'count':_0x314745,'rows':_0x4e04ea}:null;}})[_0xc26b('0x34')](respondWithResult(_0x8de9cc,null))[_0xc26b('0x53')](handleError(_0x8de9cc,null));};exports[_0xc26b('0x60')]=function(_0x5e8e76,_0x9855b8,_0x34a5a3){var _0x1805da={};var _0x2b0efd={};var _0x5f173b;var _0x2fa794;return db[_0xc26b('0x3b')][_0xc26b('0x5b')]({'where':{'id':_0x5e8e76[_0xc26b('0x55')]['id']}})[_0xc26b('0x34')](handleEntityNotFound(_0x9855b8,null))[_0xc26b('0x34')](function(_0x41e3b3){if(_0x41e3b3){_0x5f173b=_0x41e3b3;_0x2b0efd[_0xc26b('0x40')]=_[_0xc26b('0x41')](db[_0xc26b('0x61')][_0xc26b('0x3c')]);_0x2b0efd[_0xc26b('0x47')]=_[_0xc26b('0x41')](_0x5e8e76[_0xc26b('0x47')]);_0x2b0efd[_0xc26b('0x42')]=_[_0xc26b('0x43')](_0x2b0efd[_0xc26b('0x40')],_0x2b0efd[_0xc26b('0x47')]);_0x1805da[_0xc26b('0x44')]=_[_0xc26b('0x43')](_0x2b0efd[_0xc26b('0x40')],qs[_0xc26b('0x45')](_0x5e8e76[_0xc26b('0x47')][_0xc26b('0x45')]));_0x1805da[_0xc26b('0x44')]=_0x1805da['attributes'][_0xc26b('0x46')]?_0x1805da[_0xc26b('0x44')]:_0x2b0efd[_0xc26b('0x40')];_0x1805da[_0xc26b('0x5d')]=qs[_0xc26b('0x4a')](_0x5e8e76[_0xc26b('0x47')][_0xc26b('0x4a')]);_0x1805da[_0xc26b('0x4b')]=qs['filters'](_[_0xc26b('0x4c')](_0x5e8e76[_0xc26b('0x47')],_0x2b0efd[_0xc26b('0x42')]));if(_0x5e8e76[_0xc26b('0x47')][_0xc26b('0x4f')]){_0x1805da[_0xc26b('0x4b')]=_[_0xc26b('0x4d')](_0x1805da['where'],{'$or':_[_0xc26b('0x3a')](_0x1805da[_0xc26b('0x44')],function(_0x2572c7){var _0x65928e={};_0x65928e[_0x2572c7]={'$like':'%'+_0x5e8e76['query'][_0xc26b('0x4f')]+'%'};return _0x65928e;})});}_0x1805da=_[_0xc26b('0x4d')]({},_0x1805da,_0x5e8e76[_0xc26b('0x50')]);return _0x5f173b[_0xc26b('0x60')](_0x1805da);}})[_0xc26b('0x34')](function(_0x30a9ea){if(_0x30a9ea){_0x2fa794=_0x30a9ea[_0xc26b('0x46')];if(!_0x5e8e76['query'][_0xc26b('0x48')](_0xc26b('0x49'))){_0x1805da['limit']=qs[_0xc26b('0x2e')](_0x5e8e76['query'][_0xc26b('0x2e')]);_0x1805da['offset']=qs[_0xc26b('0x2d')](_0x5e8e76[_0xc26b('0x47')]['offset']);}return _0x5f173b[_0xc26b('0x60')](_0x1805da);}})['then'](function(_0x55382c){if(_0x55382c){return _0x55382c?{'count':_0x2fa794,'rows':_0x55382c}:null;}})['then'](respondWithResult(_0x9855b8,null))[_0xc26b('0x53')](handleError(_0x9855b8,null));};exports[_0xc26b('0x62')]=function(_0x20175a,_0x3e7657,_0x49eec1){if(_0x20175a['body']['id']){delete _0x20175a[_0xc26b('0x59')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x20175a[_0xc26b('0x55')]['id']}})[_0xc26b('0x34')](handleEntityNotFound(_0x3e7657,null))[_0xc26b('0x34')](function(_0x32cb9c){if(_0x32cb9c){return _0x32cb9c['setTags'](_0x20175a[_0xc26b('0x59')][_0xc26b('0x63')]||[]);}return null;})[_0xc26b('0x34')](respondWithResult(_0x3e7657,null))['catch'](handleError(_0x3e7657,null));};
\ No newline at end of file
index 8d2992c..cd3d81b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0779=['../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x42b71b,_0x350b37){var _0x664480=function(_0x39c411){while(--_0x39c411){_0x42b71b['push'](_0x42b71b['shift']());}};_0x664480(++_0x350b37);}(_0x0779,0x170));var _0x9077=function(_0x17dde1,_0x30e262){_0x17dde1=_0x17dde1-0x0;var _0x98ed15=_0x0779[_0x17dde1];return _0x98ed15;};'use strict';var _=require('lodash');var util=require(_0x9077('0x0'));var logger=require(_0x9077('0x1'))(_0x9077('0x2'));var moment=require(_0x9077('0x3'));var BPromise=require('bluebird');var rp=require(_0x9077('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9077('0x5'));var config=require(_0x9077('0x6'));var attributes=require('./intDeskConfiguration.attributes');module[_0x9077('0x7')]=function(_0x21c98f,_0x115e15){return _0x21c98f[_0x9077('0x8')](_0x9077('0x9'),attributes,{'tableName':_0x9077('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1646=['define','DeskConfiguration','int_desk_configurations','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0xfdedab,_0x7e0a3d){var _0x29d28d=function(_0x202cdf){while(--_0x202cdf){_0xfdedab['push'](_0xfdedab['shift']());}};_0x29d28d(++_0x7e0a3d);}(_0x1646,0x19b));var _0x6164=function(_0xf168d3,_0x43dcfc){_0xf168d3=_0xf168d3-0x0;var _0x17fb54=_0x1646[_0xf168d3];return _0x17fb54;};'use strict';var _=require(_0x6164('0x0'));var util=require(_0x6164('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6164('0x2'));var rp=require(_0x6164('0x3'));var fs=require('fs');var path=require(_0x6164('0x4'));var rimraf=require(_0x6164('0x5'));var config=require(_0x6164('0x6'));var attributes=require(_0x6164('0x7'));module[_0x6164('0x8')]=function(_0x73c2db,_0x54cd44){return _0x73c2db[_0x6164('0x9')](_0x6164('0xa'),attributes,{'tableName':_0x6164('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 73b6b0b..066a680 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f38=['message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x5f15e4,_0x245d95){var _0x1ab9ac=function(_0x13cc7e){while(--_0x13cc7e){_0x5f15e4['push'](_0x5f15e4['shift']());}};_0x1ab9ac(++_0x245d95);}(_0x2f38,0x1a7));var _0x82f3=function(_0x5b7154,_0x2157ae){_0x5b7154=_0x5b7154-0x0;var _0x36494f=_0x2f38[_0x5b7154];return _0x36494f;};'use strict';var _=require('lodash');var util=require(_0x82f3('0x0'));var moment=require('moment');var BPromise=require(_0x82f3('0x1'));var rs=require(_0x82f3('0x2'));var fs=require('fs');var Redis=require(_0x82f3('0x3'));var db=require(_0x82f3('0x4'))['db'];var utils=require(_0x82f3('0x5'));var logger=require(_0x82f3('0x6'))('rpc');var config=require(_0x82f3('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x82f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c09a0,_0x28c7f0,_0x2c69d2){return new BPromise(function(_0x659a85,_0x427ef6){return client[_0x82f3('0x9')](_0x1c09a0,_0x2c69d2)[_0x82f3('0xa')](function(_0xb445a3){logger[_0x82f3('0xb')](_0x82f3('0xc'),_0x28c7f0,_0x82f3('0xd'));logger[_0x82f3('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x28c7f0,_0x82f3('0xd'),JSON[_0x82f3('0xf')](_0xb445a3));if(_0xb445a3[_0x82f3('0x10')]){if(_0xb445a3[_0x82f3('0x10')][_0x82f3('0x11')]===0x1f4){logger[_0x82f3('0x10')](_0x82f3('0xc'),_0x28c7f0,_0xb445a3['error']['message']);return _0x427ef6(_0xb445a3[_0x82f3('0x10')][_0x82f3('0x12')]);}logger['error'](_0x82f3('0xc'),_0x28c7f0,_0xb445a3[_0x82f3('0x10')][_0x82f3('0x12')]);return _0x659a85(_0xb445a3[_0x82f3('0x10')][_0x82f3('0x12')]);}else{logger[_0x82f3('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x28c7f0,_0x82f3('0xd'));_0x659a85(_0xb445a3[_0x82f3('0x13')][_0x82f3('0x12')]);}})[_0x82f3('0x14')](function(_0x4d1a2d){logger[_0x82f3('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x28c7f0,_0x4d1a2d);_0x427ef6(_0x4d1a2d);});});}
\ No newline at end of file
+var _0x5a8c=['client','http','request','then','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x34451f,_0x416a8e){var _0x5c3f7e=function(_0x14bf43){while(--_0x14bf43){_0x34451f['push'](_0x34451f['shift']());}};_0x5c3f7e(++_0x416a8e);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x2f27c3,_0x2df29d){_0x2f27c3=_0x2f27c3-0x0;var _0x517c34=_0x5a8c[_0x2f27c3];return _0x517c34;};'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});function respondWithRpcPromise(_0x20e700,_0x1be8e7,_0x2eb2a5){return new BPromise(function(_0x414555,_0xe7ce8f){return client[_0xc5a8('0xb')](_0x20e700,_0x2eb2a5)[_0xc5a8('0xc')](function(_0x46e3b7){logger['info'](_0xc5a8('0xd'),_0x1be8e7,'request\x20sent');logger[_0xc5a8('0xe')](_0xc5a8('0xf'),_0x1be8e7,_0xc5a8('0x10'),JSON['stringify'](_0x46e3b7));if(_0x46e3b7['error']){if(_0x46e3b7[_0xc5a8('0x11')][_0xc5a8('0x12')]===0x1f4){logger[_0xc5a8('0x11')](_0xc5a8('0xd'),_0x1be8e7,_0x46e3b7[_0xc5a8('0x11')]['message']);return _0xe7ce8f(_0x46e3b7[_0xc5a8('0x11')][_0xc5a8('0x13')]);}logger[_0xc5a8('0x11')](_0xc5a8('0xd'),_0x1be8e7,_0x46e3b7[_0xc5a8('0x11')][_0xc5a8('0x13')]);return _0x414555(_0x46e3b7[_0xc5a8('0x11')][_0xc5a8('0x13')]);}else{logger[_0xc5a8('0x14')](_0xc5a8('0xd'),_0x1be8e7,_0xc5a8('0x10'));_0x414555(_0x46e3b7[_0xc5a8('0x15')][_0xc5a8('0x13')]);}})[_0xc5a8('0x16')](function(_0x1ac555){logger[_0xc5a8('0x11')](_0xc5a8('0xd'),_0x1be8e7,_0x1ac555);_0xe7ce8f(_0x1ac555);});});}
\ No newline at end of file
index 152ece3..cd7763d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x866c=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intDeskField.controller','index'];(function(_0x3f23f9,_0x1e7cd3){var _0x5a8479=function(_0x761d54){while(--_0x761d54){_0x3f23f9['push'](_0x3f23f9['shift']());}};_0x5a8479(++_0x1e7cd3);}(_0x866c,0xee));var _0xc866=function(_0x29be9a,_0x5e23e6){_0x29be9a=_0x29be9a-0x0;var _0x9e98b3=_0x866c[_0x29be9a];return _0x9e98b3;};'use strict';var multer=require(_0xc866('0x0'));var util=require(_0xc866('0x1'));var path=require(_0xc866('0x2'));var timeout=require(_0xc866('0x3'));var express=require(_0xc866('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xc866('0x5'));var config=require(_0xc866('0x6'));var controller=require(_0xc866('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xc866('0x8')]);router['get'](_0xc866('0x9'),auth['isAuthenticated'](),controller[_0xc866('0xa')]);router[_0xc866('0xb')]('/',auth[_0xc866('0xc')](),controller[_0xc866('0xd')]);router[_0xc866('0xe')]('/:id',auth[_0xc866('0xc')](),controller[_0xc866('0xf')]);router[_0xc866('0x10')](_0xc866('0x9'),auth[_0xc866('0xc')](),controller[_0xc866('0x11')]);module[_0xc866('0x12')]=router;
\ No newline at end of file
+var _0xd2dd=['get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','connect-timeout','../../components/auth/service','../../config/environment'];(function(_0x3811d4,_0x2abdfb){var _0x3f1fae=function(_0x5b8908){while(--_0x5b8908){_0x3811d4['push'](_0x3811d4['shift']());}};_0x3f1fae(++_0x2abdfb);}(_0xd2dd,0x13f));var _0xdd2d=function(_0x36e1c3,_0x13bb35){_0x36e1c3=_0x36e1c3-0x0;var _0x3a2636=_0xd2dd[_0x36e1c3];return _0x3a2636;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdd2d('0x0'));var express=require('express');var router=express['Router']();var auth=require(_0xdd2d('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0xdd2d('0x2'));var controller=require('./intDeskField.controller');router[_0xdd2d('0x3')]('/',auth[_0xdd2d('0x4')](),controller[_0xdd2d('0x5')]);router[_0xdd2d('0x3')](_0xdd2d('0x6'),auth['isAuthenticated'](),controller[_0xdd2d('0x7')]);router['post']('/',auth[_0xdd2d('0x4')](),controller[_0xdd2d('0x8')]);router[_0xdd2d('0x9')](_0xdd2d('0x6'),auth['isAuthenticated'](),controller[_0xdd2d('0xa')]);router[_0xdd2d('0xb')]('/:id',auth[_0xdd2d('0x4')](),controller[_0xdd2d('0xc')]);module[_0xdd2d('0xd')]=router;
\ No newline at end of file
index 0cda0e9..82be0b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd093=['variable','ENUM','string','customVariable','keyValue','STRING'];(function(_0x420513,_0x30eae3){var _0x1b44ec=function(_0x644f88){while(--_0x644f88){_0x420513['push'](_0x420513['shift']());}};_0x1b44ec(++_0x30eae3);}(_0xd093,0x13f));var _0x3d09=function(_0x3e95e2,_0x2bf791){_0x3e95e2=_0x3e95e2-0x0;var _0x5bda64=_0xd093[_0x3e95e2];return _0x5bda64;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3d09('0x0')](_0x3d09('0x1'),'variable',_0x3d09('0x2'),_0x3d09('0x3')),'defaultValue':_0x3d09('0x1')},'content':{'type':Sequelize[_0x3d09('0x4')]},'key':{'type':Sequelize[_0x3d09('0x4')]},'keyType':{'type':Sequelize[_0x3d09('0x0')](_0x3d09('0x1'),_0x3d09('0x5'),_0x3d09('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3d09('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3d09('0x4')]}};
\ No newline at end of file
+var _0xdd1d=['sequelize','exports','string','variable','customVariable','STRING','ENUM','BOOLEAN'];(function(_0x31dde9,_0x12e816){var _0x1fbf2d=function(_0x1d1bf6){while(--_0x1d1bf6){_0x31dde9['push'](_0x31dde9['shift']());}};_0x1fbf2d(++_0x12e816);}(_0xdd1d,0x1e8));var _0xddd1=function(_0x5be8cc,_0x4a6037){_0x5be8cc=_0x5be8cc-0x0;var _0x5f1b7e=_0xdd1d[_0x5be8cc];return _0x5f1b7e;};'use strict';var Sequelize=require(_0xddd1('0x0'));module[_0xddd1('0x1')]={'type':{'type':Sequelize['ENUM'](_0xddd1('0x2'),_0xddd1('0x3'),_0xddd1('0x4'),'keyValue'),'defaultValue':_0xddd1('0x2')},'content':{'type':Sequelize[_0xddd1('0x5')]},'key':{'type':Sequelize[_0xddd1('0x5')]},'keyType':{'type':Sequelize[_0xddd1('0x6')](_0xddd1('0x2'),'variable',_0xddd1('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xddd1('0x5')]},'nameField':{'type':Sequelize[_0xddd1('0x5')]},'customField':{'type':Sequelize[_0xddd1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xddd1('0x5')]}};
\ No newline at end of file
index 9dcd182..2b00388 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9244=['where','pick','merge','filter','DeskField','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x5ff517,_0x3e4ee0){var _0x19a245=function(_0x4c00ac){while(--_0x4c00ac){_0x5ff517['push'](_0x5ff517['shift']());}};_0x19a245(++_0x3e4ee0);}(_0x9244,0xf0));var _0x4924=function(_0x30e6c4,_0x4887de){_0x30e6c4=_0x30e6c4-0x0;var _0x548945=_0x9244[_0x30e6c4];return _0x548945;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4924('0x0'));var rimraf=require(_0x4924('0x1'));var zipdir=require(_0x4924('0x2'));var jsonpatch=require(_0x4924('0x3'));var rp=require(_0x4924('0x4'));var moment=require(_0x4924('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4924('0x6'));var path=require(_0x4924('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4924('0x8'));var fs=require('fs');var _=require(_0x4924('0x9'));var squel=require(_0x4924('0xa'));var crypto=require(_0x4924('0xb'));var jsforce=require(_0x4924('0xc'));var deskjs=require(_0x4924('0xd'));var toCsv=require(_0x4924('0xe'));var querystring=require(_0x4924('0xf'));var Papa=require('papaparse');var Redis=require(_0x4924('0x10'));var authService=require(_0x4924('0x11'));var qs=require(_0x4924('0x12'));var as=require(_0x4924('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4924('0x14'))(_0x4924('0x15'));var utils=require(_0x4924('0x16'));var config=require(_0x4924('0x17'));var db=require(_0x4924('0x18'))['db'];function respondWithStatusCode(_0x15709a,_0x57a87c){_0x57a87c=_0x57a87c||0xcc;return function(_0x5bce17){if(_0x5bce17){return _0x15709a[_0x4924('0x19')](_0x57a87c);}return _0x15709a[_0x4924('0x1a')](_0x57a87c)['end']();};}function respondWithResult(_0x56a872,_0x22bf75){_0x22bf75=_0x22bf75||0xc8;return function(_0x597013){if(_0x597013){return _0x56a872[_0x4924('0x1a')](_0x22bf75)[_0x4924('0x1b')](_0x597013);}};}function respondWithFilteredResult(_0x189372,_0x45d0cc){return function(_0x266101){if(_0x266101){var _0xb3dcdb=_0x266101[_0x4924('0x1c')],_0x1caeba=_0x45d0cc[_0x4924('0x1d')],_0x29f0be=_0x45d0cc[_0x4924('0x1d')]+_0x45d0cc['limit'],_0x3004b1;if(_0x29f0be>=_0xb3dcdb){_0x29f0be=_0xb3dcdb;_0x3004b1=0xc8;}else{_0x3004b1=0xce;}_0x189372[_0x4924('0x1a')](_0x3004b1);return _0x189372['set'](_0x4924('0x1e'),_0x1caeba+'-'+_0x29f0be+'/'+_0xb3dcdb)['json'](_0x266101);}return null;};}function patchUpdates(_0x208eeb){return function(_0x4d2e70){try{jsonpatch['apply'](_0x4d2e70,_0x208eeb,!![]);}catch(_0x4d5525){return BPromise[_0x4924('0x1f')](_0x4d5525);}return _0x4d2e70[_0x4924('0x20')]();};}function saveUpdates(_0x5b5588,_0x56767a){return function(_0x5a61ba){if(_0x5a61ba){return _0x5a61ba[_0x4924('0x21')](_0x5b5588)[_0x4924('0x22')](function(_0x3ce8ed){return _0x3ce8ed;});}return null;};}function removeEntity(_0x143e81,_0x2c0973){return function(_0x3626c7){if(_0x3626c7){return _0x3626c7[_0x4924('0x23')]()[_0x4924('0x22')](function(){_0x143e81['status'](0xcc)[_0x4924('0x24')]();});}};}function handleEntityNotFound(_0x48ba3b,_0x42e24e){return function(_0xfd3aa9){if(!_0xfd3aa9){_0x48ba3b['sendStatus'](0x194);}return _0xfd3aa9;};}function handleError(_0x318152,_0x28fb8a){_0x28fb8a=_0x28fb8a||0x1f4;return function(_0x2f38fa){logger[_0x4924('0x25')](_0x2f38fa[_0x4924('0x26')]);if(_0x2f38fa[_0x4924('0x27')]){delete _0x2f38fa[_0x4924('0x27')];}_0x318152['status'](_0x28fb8a)['send'](_0x2f38fa);};}exports[_0x4924('0x28')]=function(_0x210c41,_0x3d3192){var _0x2beade={},_0x233809={},_0x21a5a8={'count':0x0,'rows':[]};var _0x207615=_[_0x4924('0x29')](db['DeskField']['rawAttributes'],function(_0x10a352){return{'name':_0x10a352[_0x4924('0x2a')],'type':_0x10a352[_0x4924('0x2b')]['key']};});_0x233809[_0x4924('0x2c')]=_[_0x4924('0x29')](_0x207615,_0x4924('0x27'));_0x233809[_0x4924('0x2d')]=_[_0x4924('0x2e')](_0x210c41['query']);_0x233809[_0x4924('0x2f')]=_[_0x4924('0x30')](_0x233809[_0x4924('0x2c')],_0x233809[_0x4924('0x2d')]);_0x2beade[_0x4924('0x31')]=_[_0x4924('0x30')](_0x233809[_0x4924('0x2c')],qs[_0x4924('0x32')](_0x210c41[_0x4924('0x2d')][_0x4924('0x32')]));_0x2beade[_0x4924('0x31')]=_0x2beade[_0x4924('0x31')]['length']?_0x2beade[_0x4924('0x31')]:_0x233809['model'];if(!_0x210c41['query'][_0x4924('0x33')](_0x4924('0x34'))){_0x2beade[_0x4924('0x35')]=qs['limit'](_0x210c41[_0x4924('0x2d')][_0x4924('0x35')]);_0x2beade[_0x4924('0x1d')]=qs['offset'](_0x210c41[_0x4924('0x2d')][_0x4924('0x1d')]);}_0x2beade[_0x4924('0x36')]=qs[_0x4924('0x37')](_0x210c41[_0x4924('0x2d')][_0x4924('0x37')]);_0x2beade[_0x4924('0x38')]=qs[_0x4924('0x2f')](_[_0x4924('0x39')](_0x210c41[_0x4924('0x2d')],_0x233809[_0x4924('0x2f')]),_0x207615);if(_0x210c41['query']['filter']){_0x2beade['where']=_[_0x4924('0x3a')](_0x2beade['where'],{'$or':_[_0x4924('0x29')](_0x207615,function(_0x3005d6){if(_0x3005d6['type']!=='VIRTUAL'){var _0x5c9051={};_0x5c9051[_0x3005d6[_0x4924('0x27')]]={'$like':'%'+_0x210c41[_0x4924('0x2d')][_0x4924('0x3b')]+'%'};return _0x5c9051;}})});}_0x2beade=_[_0x4924('0x3a')]({},_0x2beade,_0x210c41['options']);var _0x368d31={'where':_0x2beade[_0x4924('0x38')]};return db[_0x4924('0x3c')][_0x4924('0x1c')](_0x368d31)[_0x4924('0x22')](function(_0x518b8e){_0x21a5a8['count']=_0x518b8e;if(_0x210c41[_0x4924('0x2d')][_0x4924('0x3d')]){_0x2beade['include']=[{'all':!![]}];}return db[_0x4924('0x3c')][_0x4924('0x3e')](_0x2beade);})['then'](function(_0x1be03a){_0x21a5a8[_0x4924('0x3f')]=_0x1be03a;return _0x21a5a8;})['then'](respondWithFilteredResult(_0x3d3192,_0x2beade))[_0x4924('0x40')](handleError(_0x3d3192,null));};exports[_0x4924('0x41')]=function(_0x148939,_0x33aa9b){var _0x45b19b={'raw':!![],'where':{'id':_0x148939[_0x4924('0x42')]['id']}},_0x1dbe91={};_0x1dbe91['model']=_[_0x4924('0x2e')](db['DeskField'][_0x4924('0x43')]);_0x1dbe91[_0x4924('0x2d')]=_[_0x4924('0x2e')](_0x148939[_0x4924('0x2d')]);_0x1dbe91[_0x4924('0x2f')]=_['intersection'](_0x1dbe91['model'],_0x1dbe91['query']);_0x45b19b[_0x4924('0x31')]=_['intersection'](_0x1dbe91[_0x4924('0x2c')],qs[_0x4924('0x32')](_0x148939[_0x4924('0x2d')][_0x4924('0x32')]));_0x45b19b[_0x4924('0x31')]=_0x45b19b[_0x4924('0x31')][_0x4924('0x44')]?_0x45b19b[_0x4924('0x31')]:_0x1dbe91[_0x4924('0x2c')];if(_0x148939[_0x4924('0x2d')][_0x4924('0x3d')]){_0x45b19b[_0x4924('0x45')]=[{'all':!![]}];}_0x45b19b=_[_0x4924('0x3a')]({},_0x45b19b,_0x148939[_0x4924('0x46')]);return db[_0x4924('0x3c')][_0x4924('0x47')](_0x45b19b)[_0x4924('0x22')](handleEntityNotFound(_0x33aa9b,null))[_0x4924('0x22')](respondWithResult(_0x33aa9b,null))[_0x4924('0x40')](handleError(_0x33aa9b,null));};exports[_0x4924('0x48')]=function(_0x3d602c,_0x1321cd){return db[_0x4924('0x3c')][_0x4924('0x48')](_0x3d602c[_0x4924('0x49')],{})['then'](respondWithResult(_0x1321cd,0xc9))['catch'](handleError(_0x1321cd,null));};exports[_0x4924('0x21')]=function(_0x551a53,_0x4942b7){if(_0x551a53[_0x4924('0x49')]['id']){delete _0x551a53[_0x4924('0x49')]['id'];}return db[_0x4924('0x3c')][_0x4924('0x47')]({'where':{'id':_0x551a53['params']['id']}})['then'](handleEntityNotFound(_0x4942b7,null))['then'](saveUpdates(_0x551a53[_0x4924('0x49')],null))['then'](respondWithResult(_0x4942b7,null))[_0x4924('0x40')](handleError(_0x4942b7,null));};exports['destroy']=function(_0x4d48e8,_0x9523ee){return db['DeskField']['find']({'where':{'id':_0x4d48e8['params']['id']}})['then'](handleEntityNotFound(_0x9523ee,null))['then'](removeEntity(_0x9523ee,null))[_0x4924('0x40')](handleError(_0x9523ee,null));};
\ No newline at end of file
+var _0xcc2d=['keys','filters','attributes','intersection','fields','length','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','count','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','DeskField','rawAttributes','type','key','model','query'];(function(_0x20fea3,_0x382e0e){var _0x142d35=function(_0x312952){while(--_0x312952){_0x20fea3['push'](_0x20fea3['shift']());}};_0x142d35(++_0x382e0e);}(_0xcc2d,0x16c));var _0xdcc2=function(_0x3feabe,_0x362133){_0x3feabe=_0x3feabe-0x0;var _0x6dd63e=_0xcc2d[_0x3feabe];return _0x6dd63e;};'use strict';var pdf=require(_0xdcc2('0x0'));var emlformat=require(_0xdcc2('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdcc2('0x2'));var rp=require(_0xdcc2('0x3'));var moment=require(_0xdcc2('0x4'));var BPromise=require(_0xdcc2('0x5'));var Mustache=require(_0xdcc2('0x6'));var util=require(_0xdcc2('0x7'));var path=require(_0xdcc2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xdcc2('0x9'));var squel=require('squel');var crypto=require(_0xdcc2('0xa'));var jsforce=require(_0xdcc2('0xb'));var deskjs=require(_0xdcc2('0xc'));var toCsv=require(_0xdcc2('0xd'));var querystring=require('querystring');var Papa=require(_0xdcc2('0xe'));var Redis=require(_0xdcc2('0xf'));var authService=require(_0xdcc2('0x10'));var qs=require(_0xdcc2('0x11'));var as=require(_0xdcc2('0x12'));var hardwareService=require(_0xdcc2('0x13'));var logger=require(_0xdcc2('0x14'))('api');var utils=require(_0xdcc2('0x15'));var config=require(_0xdcc2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ecd0e,_0x25d634){_0x25d634=_0x25d634||0xcc;return function(_0x468d6a){if(_0x468d6a){return _0x1ecd0e[_0xdcc2('0x17')](_0x25d634);}return _0x1ecd0e[_0xdcc2('0x18')](_0x25d634)['end']();};}function respondWithResult(_0x2c3792,_0x50cdaa){_0x50cdaa=_0x50cdaa||0xc8;return function(_0x2c6c1d){if(_0x2c6c1d){return _0x2c3792['status'](_0x50cdaa)['json'](_0x2c6c1d);}};}function respondWithFilteredResult(_0x306ce9,_0x211408){return function(_0x36e19b){if(_0x36e19b){var _0x2c7831=_0x36e19b[_0xdcc2('0x19')],_0x4edd01=_0x211408['offset'],_0x42f99c=_0x211408['offset']+_0x211408[_0xdcc2('0x1a')],_0x5d873b;if(_0x42f99c>=_0x2c7831){_0x42f99c=_0x2c7831;_0x5d873b=0xc8;}else{_0x5d873b=0xce;}_0x306ce9[_0xdcc2('0x18')](_0x5d873b);return _0x306ce9[_0xdcc2('0x1b')](_0xdcc2('0x1c'),_0x4edd01+'-'+_0x42f99c+'/'+_0x2c7831)['json'](_0x36e19b);}return null;};}function patchUpdates(_0x205d84){return function(_0x38fca7){try{jsonpatch['apply'](_0x38fca7,_0x205d84,!![]);}catch(_0x5e72e5){return BPromise[_0xdcc2('0x1d')](_0x5e72e5);}return _0x38fca7[_0xdcc2('0x1e')]();};}function saveUpdates(_0x3bd120,_0x570fe6){return function(_0x504d3){if(_0x504d3){return _0x504d3[_0xdcc2('0x1f')](_0x3bd120)[_0xdcc2('0x20')](function(_0x308bed){return _0x308bed;});}return null;};}function removeEntity(_0x29c1d3,_0xe80d7f){return function(_0xba4a0d){if(_0xba4a0d){return _0xba4a0d[_0xdcc2('0x21')]()['then'](function(){_0x29c1d3[_0xdcc2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53d3e4,_0x3f3ff2){return function(_0x1bf201){if(!_0x1bf201){_0x53d3e4[_0xdcc2('0x17')](0x194);}return _0x1bf201;};}function handleError(_0x1a43fc,_0x384399){_0x384399=_0x384399||0x1f4;return function(_0x31823f){logger[_0xdcc2('0x22')](_0x31823f['stack']);if(_0x31823f[_0xdcc2('0x23')]){delete _0x31823f[_0xdcc2('0x23')];}_0x1a43fc[_0xdcc2('0x18')](_0x384399)[_0xdcc2('0x24')](_0x31823f);};}exports['index']=function(_0x212236,_0x148bae){var _0x246ddc={},_0x1c00f1={},_0x314e40={'count':0x0,'rows':[]};var _0x4bc9b7=_[_0xdcc2('0x25')](db[_0xdcc2('0x26')][_0xdcc2('0x27')],function(_0x1c59d0){return{'name':_0x1c59d0['fieldName'],'type':_0x1c59d0[_0xdcc2('0x28')][_0xdcc2('0x29')]};});_0x1c00f1[_0xdcc2('0x2a')]=_[_0xdcc2('0x25')](_0x4bc9b7,'name');_0x1c00f1[_0xdcc2('0x2b')]=_[_0xdcc2('0x2c')](_0x212236[_0xdcc2('0x2b')]);_0x1c00f1[_0xdcc2('0x2d')]=_['intersection'](_0x1c00f1['model'],_0x1c00f1[_0xdcc2('0x2b')]);_0x246ddc[_0xdcc2('0x2e')]=_[_0xdcc2('0x2f')](_0x1c00f1[_0xdcc2('0x2a')],qs[_0xdcc2('0x30')](_0x212236[_0xdcc2('0x2b')][_0xdcc2('0x30')]));_0x246ddc[_0xdcc2('0x2e')]=_0x246ddc[_0xdcc2('0x2e')][_0xdcc2('0x31')]?_0x246ddc[_0xdcc2('0x2e')]:_0x1c00f1[_0xdcc2('0x2a')];if(!_0x212236[_0xdcc2('0x2b')]['hasOwnProperty'](_0xdcc2('0x32'))){_0x246ddc['limit']=qs[_0xdcc2('0x1a')](_0x212236[_0xdcc2('0x2b')]['limit']);_0x246ddc[_0xdcc2('0x33')]=qs[_0xdcc2('0x33')](_0x212236[_0xdcc2('0x2b')][_0xdcc2('0x33')]);}_0x246ddc['order']=qs[_0xdcc2('0x34')](_0x212236[_0xdcc2('0x2b')][_0xdcc2('0x34')]);_0x246ddc[_0xdcc2('0x35')]=qs[_0xdcc2('0x2d')](_[_0xdcc2('0x36')](_0x212236[_0xdcc2('0x2b')],_0x1c00f1[_0xdcc2('0x2d')]),_0x4bc9b7);if(_0x212236[_0xdcc2('0x2b')][_0xdcc2('0x37')]){_0x246ddc[_0xdcc2('0x35')]=_[_0xdcc2('0x38')](_0x246ddc[_0xdcc2('0x35')],{'$or':_['map'](_0x4bc9b7,function(_0x4ab024){if(_0x4ab024['type']!==_0xdcc2('0x39')){var _0x4ebefd={};_0x4ebefd[_0x4ab024[_0xdcc2('0x23')]]={'$like':'%'+_0x212236[_0xdcc2('0x2b')][_0xdcc2('0x37')]+'%'};return _0x4ebefd;}})});}_0x246ddc=_[_0xdcc2('0x38')]({},_0x246ddc,_0x212236[_0xdcc2('0x3a')]);var _0x251302={'where':_0x246ddc[_0xdcc2('0x35')]};return db['DeskField'][_0xdcc2('0x19')](_0x251302)[_0xdcc2('0x20')](function(_0x19cb30){_0x314e40['count']=_0x19cb30;if(_0x212236['query'][_0xdcc2('0x3b')]){_0x246ddc[_0xdcc2('0x3c')]=[{'all':!![]}];}return db['DeskField'][_0xdcc2('0x3d')](_0x246ddc);})[_0xdcc2('0x20')](function(_0x2f3ea9){_0x314e40['rows']=_0x2f3ea9;return _0x314e40;})[_0xdcc2('0x20')](respondWithFilteredResult(_0x148bae,_0x246ddc))[_0xdcc2('0x3e')](handleError(_0x148bae,null));};exports[_0xdcc2('0x3f')]=function(_0x248c14,_0x3f993f){var _0x4e2ce9={'raw':!![],'where':{'id':_0x248c14[_0xdcc2('0x40')]['id']}},_0x429461={};_0x429461[_0xdcc2('0x2a')]=_[_0xdcc2('0x2c')](db[_0xdcc2('0x26')]['rawAttributes']);_0x429461[_0xdcc2('0x2b')]=_['keys'](_0x248c14[_0xdcc2('0x2b')]);_0x429461['filters']=_[_0xdcc2('0x2f')](_0x429461[_0xdcc2('0x2a')],_0x429461['query']);_0x4e2ce9['attributes']=_[_0xdcc2('0x2f')](_0x429461[_0xdcc2('0x2a')],qs[_0xdcc2('0x30')](_0x248c14[_0xdcc2('0x2b')]['fields']));_0x4e2ce9['attributes']=_0x4e2ce9[_0xdcc2('0x2e')][_0xdcc2('0x31')]?_0x4e2ce9[_0xdcc2('0x2e')]:_0x429461[_0xdcc2('0x2a')];if(_0x248c14[_0xdcc2('0x2b')][_0xdcc2('0x3b')]){_0x4e2ce9['include']=[{'all':!![]}];}_0x4e2ce9=_[_0xdcc2('0x38')]({},_0x4e2ce9,_0x248c14['options']);return db[_0xdcc2('0x26')][_0xdcc2('0x41')](_0x4e2ce9)[_0xdcc2('0x20')](handleEntityNotFound(_0x3f993f,null))['then'](respondWithResult(_0x3f993f,null))[_0xdcc2('0x3e')](handleError(_0x3f993f,null));};exports['create']=function(_0x2b6758,_0x972e07){return db[_0xdcc2('0x26')][_0xdcc2('0x42')](_0x2b6758[_0xdcc2('0x43')],{})[_0xdcc2('0x20')](respondWithResult(_0x972e07,0xc9))[_0xdcc2('0x3e')](handleError(_0x972e07,null));};exports[_0xdcc2('0x1f')]=function(_0x314087,_0x1732d7){if(_0x314087['body']['id']){delete _0x314087[_0xdcc2('0x43')]['id'];}return db[_0xdcc2('0x26')][_0xdcc2('0x41')]({'where':{'id':_0x314087[_0xdcc2('0x40')]['id']}})[_0xdcc2('0x20')](handleEntityNotFound(_0x1732d7,null))['then'](saveUpdates(_0x314087[_0xdcc2('0x43')],null))[_0xdcc2('0x20')](respondWithResult(_0x1732d7,null))['catch'](handleError(_0x1732d7,null));};exports['destroy']=function(_0x2fa828,_0x244f36){return db['DeskField'][_0xdcc2('0x41')]({'where':{'id':_0x2fa828[_0xdcc2('0x40')]['id']}})[_0xdcc2('0x20')](handleEntityNotFound(_0x244f36,null))[_0xdcc2('0x20')](removeEntity(_0x244f36,null))[_0xdcc2('0x3e')](handleError(_0x244f36,null));};
\ No newline at end of file
index e793652..87c5b3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b89=['moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','desk_unique_index','FieldId','util','../../config/logger','api'];(function(_0x1b71f3,_0x22201d){var _0x26a72d=function(_0x25ca45){while(--_0x25ca45){_0x1b71f3['push'](_0x1b71f3['shift']());}};_0x26a72d(++_0x22201d);}(_0x7b89,0xa6));var _0x97b8=function(_0x3558e6,_0x34c925){_0x3558e6=_0x3558e6-0x0;var _0x1be21e=_0x7b89[_0x3558e6];return _0x1be21e;};'use strict';var _=require('lodash');var util=require(_0x97b8('0x0'));var logger=require(_0x97b8('0x1'))(_0x97b8('0x2'));var moment=require(_0x97b8('0x3'));var BPromise=require(_0x97b8('0x4'));var rp=require(_0x97b8('0x5'));var fs=require('fs');var path=require(_0x97b8('0x6'));var rimraf=require(_0x97b8('0x7'));var config=require('../../config/environment');var attributes=require(_0x97b8('0x8'));module[_0x97b8('0x9')]=function(_0x47c0b9,_0x5acbde){return _0x47c0b9[_0x97b8('0xa')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x97b8('0xb'),'fields':['idField',_0x97b8('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x219e=['rimraf','../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x219e,0xd9));var _0xe219=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x219e[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var util=require(_0xe219('0x0'));var logger=require(_0xe219('0x1'))(_0xe219('0x2'));var moment=require(_0xe219('0x3'));var BPromise=require(_0xe219('0x4'));var rp=require(_0xe219('0x5'));var fs=require('fs');var path=require(_0xe219('0x6'));var rimraf=require(_0xe219('0x7'));var config=require(_0xe219('0x8'));var attributes=require(_0xe219('0x9'));module[_0xe219('0xa')]=function(_0x18928c,_0x45b258){return _0x18928c['define'](_0xe219('0xb'),attributes,{'tableName':_0xe219('0xc'),'paranoid':![],'indexes':[{'name':_0xe219('0xd'),'fields':[_0xe219('0xe'),_0xe219('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index dd4713f..4bcbf62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1e2=['message','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e7ba5,_0xbeebf){var _0x326474=function(_0x500d51){while(--_0x500d51){_0x1e7ba5['push'](_0x1e7ba5['shift']());}};_0x326474(++_0xbeebf);}(_0xf1e2,0x1b7));var _0x2f1e=function(_0xb8c43b,_0x36f526){_0xb8c43b=_0xb8c43b-0x0;var _0x24df7c=_0xf1e2[_0xb8c43b];return _0x24df7c;};'use strict';var _=require('lodash');var util=require(_0x2f1e('0x0'));var moment=require('moment');var BPromise=require(_0x2f1e('0x1'));var rs=require(_0x2f1e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f1e('0x3'))['db'];var utils=require(_0x2f1e('0x4'));var logger=require(_0x2f1e('0x5'))(_0x2f1e('0x6'));var config=require(_0x2f1e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2f1e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d698a,_0x14b68e,_0x37dd47){return new BPromise(function(_0x4fdfb7,_0x495ce6){return client[_0x2f1e('0x9')](_0x5d698a,_0x37dd47)['then'](function(_0x3102cd){logger[_0x2f1e('0xa')](_0x2f1e('0xb'),_0x14b68e,_0x2f1e('0xc'));logger[_0x2f1e('0xd')](_0x2f1e('0xe'),_0x14b68e,_0x2f1e('0xc'),JSON[_0x2f1e('0xf')](_0x3102cd));if(_0x3102cd[_0x2f1e('0x10')]){if(_0x3102cd[_0x2f1e('0x10')]['code']===0x1f4){logger[_0x2f1e('0x10')](_0x2f1e('0xb'),_0x14b68e,_0x3102cd[_0x2f1e('0x10')]['message']);return _0x495ce6(_0x3102cd[_0x2f1e('0x10')][_0x2f1e('0x11')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x14b68e,_0x3102cd[_0x2f1e('0x10')]['message']);return _0x4fdfb7(_0x3102cd[_0x2f1e('0x10')][_0x2f1e('0x11')]);}else{logger[_0x2f1e('0xa')](_0x2f1e('0xb'),_0x14b68e,'request\x20sent');_0x4fdfb7(_0x3102cd[_0x2f1e('0x12')][_0x2f1e('0x11')]);}})['catch'](function(_0x171f8b){logger[_0x2f1e('0x10')](_0x2f1e('0xb'),_0x14b68e,_0x171f8b);_0x495ce6(_0x171f8b);});});}
\ No newline at end of file
+var _0x1a1b=['../../config/environment','jayson/promise','request','then','info','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x412158,_0xce52f1){var _0x1c496b=function(_0x5162ac){while(--_0x5162ac){_0x412158['push'](_0x412158['shift']());}};_0x1c496b(++_0xce52f1);}(_0x1a1b,0x6e));var _0xb1a1=function(_0x510d97,_0x53e972){_0x510d97=_0x510d97-0x0;var _0x231724=_0x1a1b[_0x510d97];return _0x231724;};'use strict';var _=require(_0xb1a1('0x0'));var util=require(_0xb1a1('0x1'));var moment=require(_0xb1a1('0x2'));var BPromise=require(_0xb1a1('0x3'));var rs=require(_0xb1a1('0x4'));var fs=require('fs');var Redis=require(_0xb1a1('0x5'));var db=require(_0xb1a1('0x6'))['db'];var utils=require(_0xb1a1('0x7'));var logger=require(_0xb1a1('0x8'))(_0xb1a1('0x9'));var config=require(_0xb1a1('0xa'));var jayson=require(_0xb1a1('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3243ac,_0x4ba5e8,_0x443160){return new BPromise(function(_0x11f7e9,_0x2189cb){return client[_0xb1a1('0xc')](_0x3243ac,_0x443160)[_0xb1a1('0xd')](function(_0x29324a){logger[_0xb1a1('0xe')]('DeskField,\x20%s,\x20%s',_0x4ba5e8,_0xb1a1('0xf'));logger['debug'](_0xb1a1('0x10'),_0x4ba5e8,_0xb1a1('0xf'),JSON[_0xb1a1('0x11')](_0x29324a));if(_0x29324a[_0xb1a1('0x12')]){if(_0x29324a['error'][_0xb1a1('0x13')]===0x1f4){logger[_0xb1a1('0x12')]('DeskField,\x20%s,\x20%s',_0x4ba5e8,_0x29324a[_0xb1a1('0x12')]['message']);return _0x2189cb(_0x29324a[_0xb1a1('0x12')][_0xb1a1('0x14')]);}logger[_0xb1a1('0x12')]('DeskField,\x20%s,\x20%s',_0x4ba5e8,_0x29324a[_0xb1a1('0x12')]['message']);return _0x11f7e9(_0x29324a[_0xb1a1('0x12')][_0xb1a1('0x14')]);}else{logger['info'](_0xb1a1('0x15'),_0x4ba5e8,_0xb1a1('0xf'));_0x11f7e9(_0x29324a[_0xb1a1('0x16')]['message']);}})[_0xb1a1('0x17')](function(_0x4ec55f){logger[_0xb1a1('0x12')](_0xb1a1('0x15'),_0x4ba5e8,_0x4ec55f);_0x2189cb(_0x4ec55f);});});}
\ No newline at end of file
index 2697597..d278fd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4695=['index','/:id','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','update','delete','destroy','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated'];(function(_0x492302,_0x505dde){var _0x1b1951=function(_0x303f12){while(--_0x303f12){_0x492302['push'](_0x492302['shift']());}};_0x1b1951(++_0x505dde);}(_0x4695,0xca));var _0x5469=function(_0x1efb4d,_0x2b222d){_0x1efb4d=_0x1efb4d-0x0;var _0x56b368=_0x4695[_0x1efb4d];return _0x56b368;};'use strict';var multer=require('multer');var util=require(_0x5469('0x0'));var path=require('path');var timeout=require(_0x5469('0x1'));var express=require('express');var router=express[_0x5469('0x2')]();var auth=require(_0x5469('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5469('0x4'));var controller=require(_0x5469('0x5'));router[_0x5469('0x6')]('/',auth[_0x5469('0x7')](),controller[_0x5469('0x8')]);router[_0x5469('0x6')](_0x5469('0x9'),auth[_0x5469('0x7')](),controller[_0x5469('0xa')]);router['get'](_0x5469('0xb'),auth[_0x5469('0x7')](),controller[_0x5469('0xc')]);router[_0x5469('0x6')]('/:id/fields',auth[_0x5469('0x7')](),controller[_0x5469('0xd')]);router['post']('/',auth[_0x5469('0x7')](),controller[_0x5469('0xe')]);router[_0x5469('0xf')]('/:id/configurations',auth[_0x5469('0x7')](),controller[_0x5469('0x10')]);router[_0x5469('0x11')](_0x5469('0x9'),auth[_0x5469('0x7')](),controller[_0x5469('0x12')]);router[_0x5469('0x13')](_0x5469('0x9'),auth[_0x5469('0x7')](),controller[_0x5469('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xe2dd=['put','/:id','update','delete','destroy','util','path','express','Router','../../components/auth/service','./intDynamics365Account.controller','get','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','post','create','addConfiguration'];(function(_0x44a718,_0x235e2a){var _0xffe19=function(_0x2b8195){while(--_0x2b8195){_0x44a718['push'](_0x44a718['shift']());}};_0xffe19(++_0x235e2a);}(_0xe2dd,0xb9));var _0xde2d=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0xe2dd[_0x32b122];return _0x4ad25a;};'use strict';var multer=require('multer');var util=require(_0xde2d('0x0'));var path=require(_0xde2d('0x1'));var timeout=require('connect-timeout');var express=require(_0xde2d('0x2'));var router=express[_0xde2d('0x3')]();var auth=require(_0xde2d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xde2d('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xde2d('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xde2d('0x7')]);router[_0xde2d('0x6')](_0xde2d('0x8'),auth[_0xde2d('0x9')](),controller[_0xde2d('0xa')]);router[_0xde2d('0x6')](_0xde2d('0xb'),auth[_0xde2d('0x9')](),controller['getFields']);router[_0xde2d('0xc')]('/',auth[_0xde2d('0x9')](),controller[_0xde2d('0xd')]);router[_0xde2d('0xc')](_0xde2d('0x8'),auth['isAuthenticated'](),controller[_0xde2d('0xe')]);router[_0xde2d('0xf')](_0xde2d('0x10'),auth[_0xde2d('0x9')](),controller[_0xde2d('0x11')]);router[_0xde2d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xde2d('0x13')]);module['exports']=router;
\ No newline at end of file
index 56e33d2..f805b98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09c2=['STRING'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x09c2,0xb1));var _0x209c=function(_0x9cf14e,_0x57d04f){_0x9cf14e=_0x9cf14e-0x0;var _0x14877a=_0x09c2[_0x9cf14e];return _0x14877a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x209c('0x0')]},'username':{'type':Sequelize[_0x209c('0x0')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x209c('0x0')]},'clientId':{'type':Sequelize[_0x209c('0x0')]},'clientSecret':{'type':Sequelize[_0x209c('0x0')]},'serverUrl':{'type':Sequelize[_0x209c('0x0')]},'description':{'type':Sequelize[_0x209c('0x0')]}};
\ No newline at end of file
+var _0x8683=['STRING'];(function(_0x20006a,_0x30e3a9){var _0x5e26ac=function(_0x16ca0a){while(--_0x16ca0a){_0x20006a['push'](_0x20006a['shift']());}};_0x5e26ac(++_0x30e3a9);}(_0x8683,0x17a));var _0x3868=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x8683[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3868('0x0')]},'username':{'type':Sequelize[_0x3868('0x0')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3868('0x0')]},'tenantId':{'type':Sequelize[_0x3868('0x0')]},'clientId':{'type':Sequelize[_0x3868('0x0')]},'clientSecret':{'type':Sequelize[_0x3868('0x0')]},'serverUrl':{'type':Sequelize[_0x3868('0x0')]},'description':{'type':Sequelize[_0x3868('0x0')]}};
\ No newline at end of file
index ed6b421..16e7763 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9772=['createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','owneridyominame','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','slice','substring','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','DecimalAttributeMetadata','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','DisplayName','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','count','offset','limit','set','Content-Range','apply','save','update','sendStatus','stack','name','send','index','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','Dynamics365Account','includeAll','findAll','rows','show','params','keys','include','find','create','body','destroy','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','AccountId','Subjects','channel','Descriptions','Dynamics365Field','getFields','ticketType','Incident','description','customerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyname'];(function(_0x29c261,_0x3af39a){var _0x1a9335=function(_0x40d1e8){while(--_0x40d1e8){_0x29c261['push'](_0x29c261['shift']());}};_0x1a9335(++_0x3af39a);}(_0x9772,0x135));var _0x2977=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x9772[_0x819464];return _0x49dcc0;};'use strict';var pdf=require(_0x2977('0x0'));var emlformat=require(_0x2977('0x1'));var rimraf=require(_0x2977('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2977('0x3'));var rp=require('request-promise');var moment=require(_0x2977('0x4'));var BPromise=require(_0x2977('0x5'));var Mustache=require(_0x2977('0x6'));var util=require(_0x2977('0x7'));var path=require(_0x2977('0x8'));var sox=require(_0x2977('0x9'));var csv=require(_0x2977('0xa'));var ejs=require(_0x2977('0xb'));var fs=require('fs');var _=require(_0x2977('0xc'));var squel=require(_0x2977('0xd'));var crypto=require(_0x2977('0xe'));var jsforce=require(_0x2977('0xf'));var deskjs=require(_0x2977('0x10'));var toCsv=require(_0x2977('0xa'));var querystring=require(_0x2977('0x11'));var Papa=require('papaparse');var Redis=require(_0x2977('0x12'));var authService=require(_0x2977('0x13'));var qs=require(_0x2977('0x14'));var as=require(_0x2977('0x15'));var hardwareService=require(_0x2977('0x16'));var logger=require('../../config/logger')(_0x2977('0x17'));var utils=require(_0x2977('0x18'));var config=require(_0x2977('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2977('0x1a'));var jayson=require(_0x2977('0x1b'));var client=jayson[_0x2977('0x1c')][_0x2977('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x54a562,_0x15de93,_0x1c252d){if(_0x1c252d){var _0x108964=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x108964[_0x2977('0x1e')](_0x15de93)){return _0x54a562;}else{throw new db['Sequelize'][(_0x2977('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x54a562;}}function respondWithRpcPromise(_0x280622,_0x153fe0,_0x557c9f,_0x1289d9){return new BPromise(function(_0x47cf19,_0x4ab71b){var _0x5623d6=_0x1289d9||client;return _0x5623d6[_0x2977('0x20')](_0x280622,_0x557c9f)[_0x2977('0x21')](function(_0x7862d5){logger[_0x2977('0x22')](_0x2977('0x23'),_0x153fe0,_0x2977('0x24'));logger['debug'](_0x2977('0x25'),_0x153fe0,_0x2977('0x24'),JSON[_0x2977('0x26')](_0x7862d5));if(_0x7862d5['error']){if(_0x7862d5[_0x2977('0x27')]['code']===0x1f4){logger[_0x2977('0x27')](_0x2977('0x23'),_0x153fe0,_0x7862d5['error'][_0x2977('0x28')]);return _0x4ab71b(_0x7862d5['error']['message']);}logger[_0x2977('0x27')](_0x2977('0x23'),_0x153fe0,_0x7862d5[_0x2977('0x27')]['message']);return _0x47cf19(_0x7862d5[_0x2977('0x27')][_0x2977('0x28')]);}else{logger[_0x2977('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0x153fe0,'request\x20sent');_0x47cf19(_0x7862d5[_0x2977('0x29')]['message']);}})[_0x2977('0x2a')](function(_0x1bb223){logger['error'](_0x2977('0x23'),_0x153fe0,_0x1bb223);_0x4ab71b(_0x1bb223);});});}function respondWithStatusCode(_0x31d4dc,_0x56eb06){_0x56eb06=_0x56eb06||0xcc;return function(_0x1d846a){if(_0x1d846a){return _0x31d4dc['sendStatus'](_0x56eb06);}return _0x31d4dc['status'](_0x56eb06)[_0x2977('0x2b')]();};}function respondWithResult(_0x20e9e7,_0x2a8ec6){_0x2a8ec6=_0x2a8ec6||0xc8;return function(_0x321432){if(_0x321432){return _0x20e9e7[_0x2977('0x2c')](_0x2a8ec6)['json'](_0x321432);}};}function respondWithFilteredResult(_0x2102a1,_0xad29f2){return function(_0x7130b3){if(_0x7130b3){var _0x15f87d=_0x7130b3[_0x2977('0x2d')],_0x4ac5bd=_0xad29f2[_0x2977('0x2e')],_0x30c5ef=_0xad29f2[_0x2977('0x2e')]+_0xad29f2[_0x2977('0x2f')],_0x4fa28b;if(_0x30c5ef>=_0x15f87d){_0x30c5ef=_0x15f87d;_0x4fa28b=0xc8;}else{_0x4fa28b=0xce;}_0x2102a1[_0x2977('0x2c')](_0x4fa28b);return _0x2102a1[_0x2977('0x30')](_0x2977('0x31'),_0x4ac5bd+'-'+_0x30c5ef+'/'+_0x15f87d)['json'](_0x7130b3);}return null;};}function patchUpdates(_0x4ed94e){return function(_0xd25c6){try{jsonpatch[_0x2977('0x32')](_0xd25c6,_0x4ed94e,!![]);}catch(_0xb37069){return BPromise['reject'](_0xb37069);}return _0xd25c6[_0x2977('0x33')]();};}function saveUpdates(_0x121565,_0x4cdc23){return function(_0x52cd83){if(_0x52cd83){return _0x52cd83[_0x2977('0x34')](_0x121565)[_0x2977('0x21')](function(_0x4be722){return _0x4be722;});}return null;};}function removeEntity(_0x2b7299,_0x420559){return function(_0x2baa4a){if(_0x2baa4a){return _0x2baa4a['destroy']()['then'](function(){_0x2b7299[_0x2977('0x2c')](0xcc)[_0x2977('0x2b')]();});}};}function handleEntityNotFound(_0x4cd924,_0x3184e1){return function(_0x5bdbf0){if(!_0x5bdbf0){_0x4cd924[_0x2977('0x35')](0x194);}return _0x5bdbf0;};}function handleError(_0x79d81,_0x32995c){_0x32995c=_0x32995c||0x1f4;return function(_0x1fdbca){logger[_0x2977('0x27')](_0x1fdbca[_0x2977('0x36')]);if(_0x1fdbca['name']){delete _0x1fdbca[_0x2977('0x37')];}_0x79d81['status'](_0x32995c)[_0x2977('0x38')](_0x1fdbca);};}exports[_0x2977('0x39')]=function(_0x382029,_0x511014){var _0x114287={},_0x37aa1f={},_0x7b4423={'count':0x0,'rows':[]};var _0x52b898=_['map'](db['Dynamics365Account'][_0x2977('0x3a')],function(_0x2e1bb5){return{'name':_0x2e1bb5['fieldName'],'type':_0x2e1bb5[_0x2977('0x3b')][_0x2977('0x3c')]};});_0x37aa1f[_0x2977('0x3d')]=_['map'](_0x52b898,'name');_0x37aa1f[_0x2977('0x3e')]=_['keys'](_0x382029[_0x2977('0x3e')]);_0x37aa1f[_0x2977('0x3f')]=_[_0x2977('0x40')](_0x37aa1f[_0x2977('0x3d')],_0x37aa1f[_0x2977('0x3e')]);_0x114287['attributes']=_[_0x2977('0x40')](_0x37aa1f[_0x2977('0x3d')],qs[_0x2977('0x41')](_0x382029['query'][_0x2977('0x41')]));_0x114287['attributes']=_0x114287[_0x2977('0x42')][_0x2977('0x43')]?_0x114287[_0x2977('0x42')]:_0x37aa1f[_0x2977('0x3d')];if(!_0x382029[_0x2977('0x3e')][_0x2977('0x44')](_0x2977('0x45'))){_0x114287['limit']=qs['limit'](_0x382029[_0x2977('0x3e')]['limit']);_0x114287['offset']=qs['offset'](_0x382029[_0x2977('0x3e')][_0x2977('0x2e')]);}_0x114287[_0x2977('0x46')]=qs[_0x2977('0x47')](_0x382029[_0x2977('0x3e')][_0x2977('0x47')]);_0x114287[_0x2977('0x48')]=qs[_0x2977('0x3f')](_['pick'](_0x382029['query'],_0x37aa1f[_0x2977('0x3f')]),_0x52b898);if(_0x382029[_0x2977('0x3e')][_0x2977('0x49')]){_0x114287[_0x2977('0x48')]=_[_0x2977('0x4a')](_0x114287['where'],{'$or':_[_0x2977('0x4b')](_0x52b898,function(_0x20e90d){if(_0x20e90d[_0x2977('0x3b')]!==_0x2977('0x4c')){var _0x1b1664={};_0x1b1664[_0x20e90d['name']]={'$like':'%'+_0x382029[_0x2977('0x3e')]['filter']+'%'};return _0x1b1664;}})});}_0x114287=_['merge']({},_0x114287,_0x382029[_0x2977('0x4d')]);var _0x2e811d={'where':_0x114287[_0x2977('0x48')]};return db[_0x2977('0x4e')][_0x2977('0x2d')](_0x2e811d)[_0x2977('0x21')](function(_0x41f6ea){_0x7b4423[_0x2977('0x2d')]=_0x41f6ea;if(_0x382029[_0x2977('0x3e')][_0x2977('0x4f')]){_0x114287['include']=[{'all':!![]}];}return db[_0x2977('0x4e')][_0x2977('0x50')](_0x114287);})[_0x2977('0x21')](function(_0x589617){_0x7b4423[_0x2977('0x51')]=_0x589617;return _0x7b4423;})[_0x2977('0x21')](respondWithFilteredResult(_0x511014,_0x114287))[_0x2977('0x2a')](handleError(_0x511014,null));};exports[_0x2977('0x52')]=function(_0x18ca14,_0x5b84f7){var _0x21b382={'raw':![],'where':{'id':_0x18ca14[_0x2977('0x53')]['id']}},_0x26efeb={};_0x26efeb[_0x2977('0x3d')]=_[_0x2977('0x54')](db['Dynamics365Account']['rawAttributes']);_0x26efeb[_0x2977('0x3e')]=_['keys'](_0x18ca14['query']);_0x26efeb['filters']=_[_0x2977('0x40')](_0x26efeb[_0x2977('0x3d')],_0x26efeb[_0x2977('0x3e')]);_0x21b382['attributes']=_[_0x2977('0x40')](_0x26efeb[_0x2977('0x3d')],qs[_0x2977('0x41')](_0x18ca14[_0x2977('0x3e')]['fields']));_0x21b382[_0x2977('0x42')]=_0x21b382[_0x2977('0x42')][_0x2977('0x43')]?_0x21b382[_0x2977('0x42')]:_0x26efeb['model'];if(_0x18ca14[_0x2977('0x3e')]['includeAll']){_0x21b382[_0x2977('0x55')]=[{'all':!![]}];}_0x21b382=_[_0x2977('0x4a')]({},_0x21b382,_0x18ca14[_0x2977('0x4d')]);return db[_0x2977('0x4e')][_0x2977('0x56')](_0x21b382)[_0x2977('0x21')](handleEntityNotFound(_0x5b84f7,null))['then'](respondWithResult(_0x5b84f7,null))[_0x2977('0x2a')](handleError(_0x5b84f7,null));};exports[_0x2977('0x57')]=function(_0x3b2d0e,_0x216594){return db[_0x2977('0x4e')][_0x2977('0x57')](_0x3b2d0e[_0x2977('0x58')],{})[_0x2977('0x21')](respondWithResult(_0x216594,0xc9))[_0x2977('0x2a')](handleError(_0x216594,null));};exports[_0x2977('0x34')]=function(_0x635c44,_0x4b6dc8){if(_0x635c44[_0x2977('0x58')]['id']){delete _0x635c44['body']['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x635c44[_0x2977('0x53')]['id']}})['then'](handleEntityNotFound(_0x4b6dc8,null))[_0x2977('0x21')](saveUpdates(_0x635c44[_0x2977('0x58')],null))[_0x2977('0x21')](respondWithResult(_0x4b6dc8,null))[_0x2977('0x2a')](handleError(_0x4b6dc8,null));};exports[_0x2977('0x59')]=function(_0x380ac5,_0x100746){return db[_0x2977('0x4e')][_0x2977('0x56')]({'where':{'id':_0x380ac5[_0x2977('0x53')]['id']}})[_0x2977('0x21')](handleEntityNotFound(_0x100746,null))[_0x2977('0x21')](removeEntity(_0x100746,null))[_0x2977('0x2a')](handleError(_0x100746,null));};exports[_0x2977('0x5a')]=function(_0x13d0e8,_0x1f3690,_0x30ecbe){var _0x418f6e={};var _0x25fa9c={};var _0x54ce72;var _0x3b8a71;return db['Dynamics365Account'][_0x2977('0x5b')]({'where':{'id':_0x13d0e8[_0x2977('0x53')]['id']}})['then'](handleEntityNotFound(_0x1f3690,null))[_0x2977('0x21')](function(_0x1260c1){if(_0x1260c1){_0x54ce72=_0x1260c1;_0x25fa9c[_0x2977('0x3d')]=_[_0x2977('0x54')](db[_0x2977('0x5c')]['rawAttributes']);_0x25fa9c[_0x2977('0x3e')]=_[_0x2977('0x54')](_0x13d0e8['query']);_0x25fa9c[_0x2977('0x3f')]=_['intersection'](_0x25fa9c[_0x2977('0x3d')],_0x25fa9c['query']);_0x418f6e[_0x2977('0x42')]=_[_0x2977('0x40')](_0x25fa9c[_0x2977('0x3d')],qs[_0x2977('0x41')](_0x13d0e8[_0x2977('0x3e')]['fields']));_0x418f6e['attributes']=_0x418f6e['attributes'][_0x2977('0x43')]?_0x418f6e[_0x2977('0x42')]:_0x25fa9c['model'];_0x418f6e[_0x2977('0x46')]=qs[_0x2977('0x47')](_0x13d0e8['query']['sort']);_0x418f6e['where']=qs[_0x2977('0x3f')](_[_0x2977('0x5d')](_0x13d0e8[_0x2977('0x3e')],_0x25fa9c[_0x2977('0x3f')]));if(_0x13d0e8[_0x2977('0x3e')][_0x2977('0x49')]){_0x418f6e[_0x2977('0x48')]=_['merge'](_0x418f6e[_0x2977('0x48')],{'$or':_['map'](_0x418f6e[_0x2977('0x42')],function(_0x4dc0b9){var _0x3b9c4a={};_0x3b9c4a[_0x4dc0b9]={'$like':'%'+_0x13d0e8[_0x2977('0x3e')][_0x2977('0x49')]+'%'};return _0x3b9c4a;})});}_0x418f6e=_[_0x2977('0x4a')]({},_0x418f6e,_0x13d0e8[_0x2977('0x4d')]);return _0x54ce72[_0x2977('0x5a')](_0x418f6e);}})[_0x2977('0x21')](function(_0x3f7512){if(_0x3f7512){_0x3b8a71=_0x3f7512[_0x2977('0x43')];if(!_0x13d0e8[_0x2977('0x3e')][_0x2977('0x44')](_0x2977('0x45'))){_0x418f6e['limit']=qs[_0x2977('0x2f')](_0x13d0e8[_0x2977('0x3e')][_0x2977('0x2f')]);_0x418f6e[_0x2977('0x2e')]=qs[_0x2977('0x2e')](_0x13d0e8[_0x2977('0x3e')][_0x2977('0x2e')]);}return _0x54ce72['getConfigurations'](_0x418f6e);}})[_0x2977('0x21')](function(_0x34906d){if(_0x34906d){return _0x34906d?{'count':_0x3b8a71,'rows':_0x34906d}:null;}})[_0x2977('0x21')](respondWithResult(_0x1f3690,null))['catch'](handleError(_0x1f3690,null));};exports[_0x2977('0x5e')]=function(_0x4c39a6,_0x3b0cd4,_0x93f2d8){if(_0x4c39a6[_0x2977('0x58')]['id']){delete _0x4c39a6[_0x2977('0x58')]['id'];}return db['Dynamics365Account'][_0x2977('0x5b')]({'where':{'id':_0x4c39a6[_0x2977('0x53')]['id']}})[_0x2977('0x21')](handleEntityNotFound(_0x3b0cd4,null))[_0x2977('0x21')](function(_0x438c37){if(_0x438c37){_0x4c39a6[_0x2977('0x58')][_0x2977('0x5f')]=_0x438c37['id'];_0x4c39a6[_0x2977('0x58')][_0x2977('0x60')]=integrations['getSubjects'](_0x4c39a6[_0x2977('0x58')][_0x2977('0x61')],_0x4c39a6[_0x2977('0x58')]['type']);_0x4c39a6[_0x2977('0x58')][_0x2977('0x62')]=integrations['getDescriptions'](_0x4c39a6[_0x2977('0x58')][_0x2977('0x61')],_0x4c39a6[_0x2977('0x58')][_0x2977('0x3b')]);return db[_0x2977('0x5c')][_0x2977('0x57')](_0x4c39a6['body'],{'include':[{'model':db[_0x2977('0x63')],'as':_0x2977('0x60')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x2977('0x21')](respondWithResult(_0x3b0cd4,null))[_0x2977('0x2a')](handleError(_0x3b0cd4,null));};exports[_0x2977('0x64')]=function(_0x4e037b,_0xe3248b,_0x31e91f){var _0x1f1ce7=_0x4e037b[_0x2977('0x3e')][_0x2977('0x65')];var _0x5a8674=_0x1f1ce7==='incident'?_0x2977('0x66'):'PhoneCall';var _0x4ee1e1='';var _0x41e426='';var _0x2ce630='';var _0x418304='';var _0x719a8='';var _0x39867d='';var _0x1cf822='';var _0x36bef9='';var _0x2d1ab2=['title',_0x2977('0x67'),_0x2977('0x68'),'ownerid',_0x2977('0x69'),_0x2977('0x6a'),_0x2977('0x6b'),'regardingobjectid',_0x2977('0x6c'),_0x2977('0x6d')];var _0x1e9b06=[_0x2977('0x6e'),_0x2977('0x6f'),_0x2977('0x70'),_0x2977('0x71'),_0x2977('0x72'),_0x2977('0x73'),_0x2977('0x74'),'contractidname',_0x2977('0x75'),'createdbyexternalpartyyominame',_0x2977('0x76'),'createdbyyominame',_0x2977('0x77'),_0x2977('0x78'),_0x2977('0x79'),'customeridname',_0x2977('0x7a'),_0x2977('0x7b'),_0x2977('0x7c'),_0x2977('0x7d'),_0x2977('0x7e'),_0x2977('0x7f'),_0x2977('0x80'),_0x2977('0x81'),'firstresponsebykpiidname',_0x2977('0x82'),_0x2977('0x83'),_0x2977('0x84'),_0x2977('0x85'),'lastonholdtime',_0x2977('0x86'),'modifiedbyexternalpartyname',_0x2977('0x87'),_0x2977('0x88'),_0x2977('0x89'),_0x2977('0x8a'),_0x2977('0x8b'),_0x2977('0x8c'),_0x2977('0x8d'),_0x2977('0x8e'),_0x2977('0x8f'),'onholdtime','overriddencreatedon','owneridname','owneridtype',_0x2977('0x90'),_0x2977('0x91'),_0x2977('0x92'),'primarycontactidyominame','prioritycodename',_0x2977('0x93'),_0x2977('0x94'),_0x2977('0x95'),_0x2977('0x96'),'responseby',_0x2977('0x97'),_0x2977('0x98'),_0x2977('0x99'),_0x2977('0x9a'),'slaname','socialprofileidname','statecode',_0x2977('0x9b'),_0x2977('0x9c'),_0x2977('0x9d'),_0x2977('0x9e'),'transactioncurrencyidname',_0x2977('0x9f'),_0x2977('0xa0'),_0x2977('0xa1')];var _0x1f8649=_0x2d1ab2[_0x2977('0xa2')](_0x1e9b06);return db[_0x2977('0x4e')][_0x2977('0x5b')]({'where':{'id':_0x4e037b['params']['id']},'attributes':['id',_0x2977('0xa3'),_0x2977('0xa4'),_0x2977('0xa5'),'tenantId',_0x2977('0xa6'),_0x2977('0xa7')]})[_0x2977('0x21')](handleEntityNotFound(_0xe3248b,null))['then'](function(_0x5cab44){if(_0x5cab44){_0x36bef9=_0x5cab44[_0x2977('0xa5')];var _0x11e99c=_0x36bef9[_0x2977('0xa8')](-0x1);if(_0x11e99c==='/'){_0x36bef9=_0x36bef9[_0x2977('0xa9')](0x0,_0x36bef9['lastIndexOf'](_0x11e99c));}_0x1cf822=util[_0x2977('0xaa')](_0x2977('0xab'),_0x36bef9);var _0x4768f3={'method':'POST','uri':_0x2977('0xac')+_0x5cab44['tenantId']+_0x2977('0xad'),'form':{'client_id':_0x5cab44['clientId'],'resource':_0x36bef9,'username':_0x5cab44[_0x2977('0xa3')],'password':_0x5cab44[_0x2977('0xa4')],'grant_type':_0x2977('0xa4'),'client_secret':_0x5cab44[_0x2977('0xa7')]},'json':!![]};return rp(_0x4768f3);}})['then'](function(_0x2fb333){_0x39867d=_0x2fb333[_0x2977('0xae')];var _0x1a0f95={'method':'GET','uri':encodeURI(_0x1cf822+_0x2977('0xaf')+_0x5a8674+'\x27'),'headers':{'Authorization':_0x2977('0xb0')+_0x39867d,'If-None-Match':null,'OData-Version':_0x2977('0xb1')},'json':!![]};return rp(_0x1a0f95);})['then'](function(_0x33a1a3){var _0x2b3e8b=_0x33a1a3[_0x2977('0xb2')][0x0];var _0x2a4223=_0x2b3e8b[_0x2977('0xb3')];var _0x211346={'method':_0x2977('0xb4'),'uri':_0x1cf822+'EntityDefinitions('+_0x2a4223+_0x2977('0xb5'),'headers':{'Authorization':'Bearer\x20'+_0x39867d,'If-None-Match':null,'OData-Version':_0x2977('0xb1')},'json':!![]};return rp(_0x211346);})['then'](function(_0x395a82){_0x4ee1e1=_0x395a82;_0x41e426=_0x4ee1e1[_0x2977('0xb6')];_0x41e426=_[_0x2977('0xb7')](_0x41e426,function(_0x3a684b){return!_0x1f8649[_0x2977('0xb8')](_0x3a684b[_0x2977('0xb9')]);});var _0xec5d53=[];var _0x2f4c4c=[];_0x41e426[_0x2977('0xba')](function(_0x550b8f){if(_0x550b8f[_0x2977('0xbb')]){var _0x179904=_0x550b8f[_0x2977('0xbb')][_0x2977('0xa9')](_0x550b8f[_0x2977('0xbb')][_0x2977('0xbc')]('.')+0x1);if(_0x179904===_0x2977('0xbd')){_0xec5d53[_0x2977('0xbe')](getSelectList(_0x1cf822,_0x1f1ce7,_0x2f4c4c,_0x4ee1e1[_0x2977('0xb3')],_0x550b8f[_0x2977('0xb3')],_0x39867d));}}});return Promise[_0x2977('0xbf')](_0xec5d53);})[_0x2977('0x21')](function(_0x149b49){_0x2ce630=_0x149b49[0x0];var _0x2baf19=[];var _0x4691aa=[];_0x41e426[_0x2977('0xba')](function(_0x3f6f56){if(!_[_0x2977('0xc0')](_0x3f6f56[_0x2977('0xbb')])){var _0x4b33bd=_0x3f6f56[_0x2977('0xbb')][_0x2977('0xa9')](_0x3f6f56['@odata.type'][_0x2977('0xbc')]('.')+0x1);if(_0x4b33bd==='BooleanAttributeMetadata'){_0x2baf19[_0x2977('0xbe')](getBooleanList(_0x1cf822,_0x1f1ce7,_0x4691aa,_0x4ee1e1['MetadataId'],_0x3f6f56[_0x2977('0xb3')],_0x39867d));}}});return Promise['all'](_0x2baf19);})[_0x2977('0x21')](function(_0x423791){_0x418304=_0x423791[0x0];var _0x2dbd9c=[];var _0x28fa61=[];_0x41e426[_0x2977('0xba')](function(_0x4b6e13){if(_0x4b6e13[_0x2977('0xbb')]){var _0x248db0=_0x4b6e13[_0x2977('0xbb')][_0x2977('0xa9')](_0x4b6e13[_0x2977('0xbb')]['lastIndexOf']('.')+0x1);if(_0x248db0===_0x2977('0xc1')||_0x248db0===_0x2977('0xc2')||_0x248db0===_0x2977('0xc3')||_0x248db0==='IntegerAttributeMetadata'||_0x248db0===_0x2977('0xc4')||_0x248db0===_0x2977('0xc5')||_0x248db0===_0x2977('0xc6')||_0x248db0==='EntityNameAttributeMetadata'||_0x248db0==='StateAttributeMetadata'||_0x248db0===_0x2977('0xc7')){_0x2dbd9c[_0x2977('0xbe')](getInputList(_0x1cf822,_0x1f1ce7,_0x248db0,_0x28fa61,_0x4ee1e1['MetadataId'],_0x4b6e13['MetadataId'],_0x39867d));}}});return Promise['all'](_0x2dbd9c);})[_0x2977('0x21')](function(_0x4991ff){_0x719a8=_0x4991ff[0x0];var _0x41f1c6=_0x2ce630[_0x2977('0xa2')](_0x418304)['concat'](_0x719a8);var _0x36c262={'count':_0x41f1c6[_0x2977('0x43')],'rows':_0x41f1c6};return _0x36c262;})[_0x2977('0x21')](respondWithResult(_0xe3248b,null))[_0x2977('0x2a')](function(_0x24f770){var _0x2feae6=_0x4e037b[_0x2977('0x3e')][_0x2977('0x1e')]?0x1f4:_0x24f770[_0x2977('0xc8')]||0x1f4;logger['error'](_0x24f770[_0x2977('0x36')]);delete _0x24f770[_0x2977('0x37')];if(_0x2feae6===0x191){_0x2feae6=0x190;}_0xe3248b[_0x2977('0x2c')](_0x2feae6)['send'](_0x4e037b[_0x2977('0x3e')][_0x2977('0x1e')]?{'message':'Wrong\x20credentials','statusCode':_0x24f770[_0x2977('0xc8')]}:_0x24f770);});};function getSelectList(_0x7d770f,_0x3cfd25,_0x3c915e,_0x140440,_0xb16846,_0x3c0cbf){var _0x45099f={'method':_0x2977('0xb4'),'uri':_0x7d770f+_0x2977('0xc9')+_0x140440+_0x2977('0xca')+_0xb16846+_0x2977('0xcb')+_0x2977('0xcc'),'headers':{'Authorization':_0x2977('0xb0')+_0x3c0cbf,'If-None-Match':null,'OData-Version':_0x2977('0xb1')},'json':!![]};return rp(_0x45099f)[_0x2977('0x21')](function(_0x3e6287){var _0x43a457=[];var _0x364d2d=_0x3e6287[_0x2977('0xcd')][_0x2977('0xce')];_0x364d2d[_0x2977('0xba')](function(_0x440403){_0x43a457[_0x2977('0xbe')]({'name':_0x440403[_0x2977('0xcf')][_0x2977('0xd0')]['Label'],'value':String(_0x440403[_0x2977('0xd1')])});});var _0x4b32f8={'id':_0x3cfd25+'_'+_0x3e6287[_0x2977('0xb9')],'name':_0x3e6287['DisplayName']['UserLocalizedLabel'][_0x2977('0xcf')],'custom':![],'options':_0x43a457};_0x3c915e[_0x2977('0xbe')](_0x4b32f8);return _0x3c915e;});}function getBooleanList(_0x50d0a4,_0x47d2a9,_0x41f74b,_0x20ec17,_0x58c729,_0x547c81){var _0x1ed05b={'method':_0x2977('0xb4'),'uri':_0x50d0a4+_0x2977('0xc9')+_0x20ec17+')/Attributes('+_0x58c729+_0x2977('0xd2'),'headers':{'Authorization':'Bearer\x20'+_0x547c81,'If-None-Match':null,'OData-Version':_0x2977('0xb1')},'json':!![]};return rp(_0x1ed05b)[_0x2977('0x21')](function(_0x2b8062){var _0x2daa02=[];_0x2daa02[_0x2977('0xbe')]({'name':_0x2b8062[_0x2977('0xcd')][_0x2977('0xd3')][_0x2977('0xcf')][_0x2977('0xd0')]['Label'],'value':_0x2977('0xd4')},{'name':_0x2b8062['OptionSet']['FalseOption'][_0x2977('0xcf')][_0x2977('0xd0')][_0x2977('0xcf')],'value':'false'});var _0x8c8501={'id':_0x47d2a9+'_'+_0x2b8062[_0x2977('0xb9')],'name':_0x2b8062[_0x2977('0xd5')]['UserLocalizedLabel'][_0x2977('0xcf')],'custom':![],'options':_0x2daa02};_0x41f74b[_0x2977('0xbe')](_0x8c8501);return _0x41f74b;});}function getInputList(_0x5fc57e,_0x15a30c,_0x3834c8,_0x5f215d,_0x113d20,_0x51da69,_0x289548){var _0x45f00f={'method':'GET','uri':_0x5fc57e+'EntityDefinitions('+_0x113d20+')/Attributes('+_0x51da69+')/Microsoft.Dynamics.CRM.'+_0x3834c8+_0x2977('0xd6'),'headers':{'Authorization':'Bearer\x20'+_0x289548,'If-None-Match':null,'OData-Version':_0x2977('0xb1')},'json':!![]};return rp(_0x45f00f)[_0x2977('0x21')](function(_0x500135){var _0x25f24b={'id':_0x15a30c+'_'+_0x500135[_0x2977('0xb9')],'name':_0x500135[_0x2977('0xd5')][_0x2977('0xd0')]?_0x500135[_0x2977('0xd5')][_0x2977('0xd0')]['Label']:_0x500135[_0x2977('0xb9')],'custom':![],'options':[]};_0x5f215d[_0x2977('0xbe')](_0x25f24b);return _0x5f215d;});}
\ No newline at end of file
+var _0x50ce=['api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','Dynamics365Account','findAll','rows','show','params','keys','find','create','body','update','destroy','findOne','Dynamics365Configuration','nolimit','getConfigurations','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','sentimentvalue','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','concat','username','password','clientId','clientSecret','slice','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','LogicalName','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','forEach','isNil','substring','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','Value','DisplayName','UserLocalizedLabel','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x312940,_0x27d5aa){var _0x4c2cc5=function(_0x330287){while(--_0x330287){_0x312940['push'](_0x312940['shift']());}};_0x4c2cc5(++_0x27d5aa);}(_0x50ce,0xc9));var _0xe50c=function(_0x571dbc,_0x400df9){_0x571dbc=_0x571dbc-0x0;var _0x55043c=_0x50ce[_0x571dbc];return _0x55043c;};'use strict';var pdf=require(_0xe50c('0x0'));var emlformat=require(_0xe50c('0x1'));var rimraf=require(_0xe50c('0x2'));var zipdir=require(_0xe50c('0x3'));var jsonpatch=require(_0xe50c('0x4'));var rp=require(_0xe50c('0x5'));var moment=require(_0xe50c('0x6'));var BPromise=require(_0xe50c('0x7'));var Mustache=require(_0xe50c('0x8'));var util=require('util');var path=require(_0xe50c('0x9'));var sox=require('sox');var csv=require(_0xe50c('0xa'));var ejs=require(_0xe50c('0xb'));var fs=require('fs');var _=require(_0xe50c('0xc'));var squel=require(_0xe50c('0xd'));var crypto=require(_0xe50c('0xe'));var jsforce=require(_0xe50c('0xf'));var deskjs=require(_0xe50c('0x10'));var toCsv=require(_0xe50c('0xa'));var querystring=require(_0xe50c('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe50c('0x12'));var qs=require(_0xe50c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe50c('0x14'));var logger=require(_0xe50c('0x15'))(_0xe50c('0x16'));var utils=require(_0xe50c('0x17'));var config=require(_0xe50c('0x18'));var db=require(_0xe50c('0x19'))['db'];var integrations=require(_0xe50c('0x1a'));var jayson=require(_0xe50c('0x1b'));var client=jayson[_0xe50c('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x25ff2a,_0x39e9f5,_0x5231c2){if(_0x5231c2){var _0x125348=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x125348['test'](_0x39e9f5)){return _0x25ff2a;}else{throw new db[(_0xe50c('0x1d'))]['ValidationError'](_0xe50c('0x1e'));}}else{return _0x25ff2a;}}function respondWithRpcPromise(_0x286e04,_0x20644b,_0x201c53,_0x204073){return new BPromise(function(_0x59172e,_0x3eac33){var _0x1df1af=_0x204073||client;return _0x1df1af[_0xe50c('0x1f')](_0x286e04,_0x201c53)[_0xe50c('0x20')](function(_0x19e077){logger[_0xe50c('0x21')]('Dynamics365Account,\x20%s,\x20%s',_0x20644b,'request\x20sent');logger[_0xe50c('0x22')](_0xe50c('0x23'),_0x20644b,_0xe50c('0x24'),JSON['stringify'](_0x19e077));if(_0x19e077['error']){if(_0x19e077[_0xe50c('0x25')][_0xe50c('0x26')]===0x1f4){logger[_0xe50c('0x25')](_0xe50c('0x27'),_0x20644b,_0x19e077[_0xe50c('0x25')]['message']);return _0x3eac33(_0x19e077[_0xe50c('0x25')][_0xe50c('0x28')]);}logger[_0xe50c('0x25')]('Dynamics365Account,\x20%s,\x20%s',_0x20644b,_0x19e077[_0xe50c('0x25')][_0xe50c('0x28')]);return _0x59172e(_0x19e077[_0xe50c('0x25')][_0xe50c('0x28')]);}else{logger[_0xe50c('0x21')]('Dynamics365Account,\x20%s,\x20%s',_0x20644b,'request\x20sent');_0x59172e(_0x19e077[_0xe50c('0x29')]['message']);}})[_0xe50c('0x2a')](function(_0x291df6){logger['error'](_0xe50c('0x27'),_0x20644b,_0x291df6);_0x3eac33(_0x291df6);});});}function respondWithStatusCode(_0x172da5,_0x3a56a2){_0x3a56a2=_0x3a56a2||0xcc;return function(_0x232c3a){if(_0x232c3a){return _0x172da5[_0xe50c('0x2b')](_0x3a56a2);}return _0x172da5[_0xe50c('0x2c')](_0x3a56a2)[_0xe50c('0x2d')]();};}function respondWithResult(_0x1f79fb,_0x4f1a4d){_0x4f1a4d=_0x4f1a4d||0xc8;return function(_0x1a6d91){if(_0x1a6d91){return _0x1f79fb['status'](_0x4f1a4d)[_0xe50c('0x2e')](_0x1a6d91);}};}function respondWithFilteredResult(_0x404b8a,_0x4f372e){return function(_0x48f5f5){if(_0x48f5f5){var _0x7368d9=_0x48f5f5[_0xe50c('0x2f')],_0x2f58bc=_0x4f372e[_0xe50c('0x30')],_0x2ab5a9=_0x4f372e['offset']+_0x4f372e[_0xe50c('0x31')],_0x35796c;if(_0x2ab5a9>=_0x7368d9){_0x2ab5a9=_0x7368d9;_0x35796c=0xc8;}else{_0x35796c=0xce;}_0x404b8a[_0xe50c('0x2c')](_0x35796c);return _0x404b8a[_0xe50c('0x32')]('Content-Range',_0x2f58bc+'-'+_0x2ab5a9+'/'+_0x7368d9)[_0xe50c('0x2e')](_0x48f5f5);}return null;};}function patchUpdates(_0x5a6cd3){return function(_0x66af6b){try{jsonpatch[_0xe50c('0x33')](_0x66af6b,_0x5a6cd3,!![]);}catch(_0x5b1d05){return BPromise[_0xe50c('0x34')](_0x5b1d05);}return _0x66af6b[_0xe50c('0x35')]();};}function saveUpdates(_0x5a999d,_0xd3d335){return function(_0x38705b){if(_0x38705b){return _0x38705b['update'](_0x5a999d)[_0xe50c('0x20')](function(_0x54fa7c){return _0x54fa7c;});}return null;};}function removeEntity(_0x5e99d7,_0x1b009b){return function(_0x2b2ae5){if(_0x2b2ae5){return _0x2b2ae5['destroy']()[_0xe50c('0x20')](function(){_0x5e99d7[_0xe50c('0x2c')](0xcc)[_0xe50c('0x2d')]();});}};}function handleEntityNotFound(_0x28d508,_0x49c2fd){return function(_0x1dd5ec){if(!_0x1dd5ec){_0x28d508[_0xe50c('0x2b')](0x194);}return _0x1dd5ec;};}function handleError(_0x5531a5,_0x529807){_0x529807=_0x529807||0x1f4;return function(_0x4d00e6){logger['error'](_0x4d00e6[_0xe50c('0x36')]);if(_0x4d00e6['name']){delete _0x4d00e6[_0xe50c('0x37')];}_0x5531a5['status'](_0x529807)[_0xe50c('0x38')](_0x4d00e6);};}exports[_0xe50c('0x39')]=function(_0x31ff05,_0x284b9e){var _0x28115a={},_0xf2c28f={},_0x130d78={'count':0x0,'rows':[]};var _0x9b741c=_['map'](db['Dynamics365Account'][_0xe50c('0x3a')],function(_0x32ce3d){return{'name':_0x32ce3d[_0xe50c('0x3b')],'type':_0x32ce3d[_0xe50c('0x3c')][_0xe50c('0x3d')]};});_0xf2c28f[_0xe50c('0x3e')]=_[_0xe50c('0x3f')](_0x9b741c,'name');_0xf2c28f[_0xe50c('0x40')]=_['keys'](_0x31ff05[_0xe50c('0x40')]);_0xf2c28f[_0xe50c('0x41')]=_[_0xe50c('0x42')](_0xf2c28f[_0xe50c('0x3e')],_0xf2c28f['query']);_0x28115a[_0xe50c('0x43')]=_[_0xe50c('0x42')](_0xf2c28f[_0xe50c('0x3e')],qs['fields'](_0x31ff05[_0xe50c('0x40')][_0xe50c('0x44')]));_0x28115a[_0xe50c('0x43')]=_0x28115a[_0xe50c('0x43')][_0xe50c('0x45')]?_0x28115a[_0xe50c('0x43')]:_0xf2c28f[_0xe50c('0x3e')];if(!_0x31ff05[_0xe50c('0x40')][_0xe50c('0x46')]('nolimit')){_0x28115a['limit']=qs[_0xe50c('0x31')](_0x31ff05[_0xe50c('0x40')][_0xe50c('0x31')]);_0x28115a['offset']=qs['offset'](_0x31ff05[_0xe50c('0x40')][_0xe50c('0x30')]);}_0x28115a[_0xe50c('0x47')]=qs[_0xe50c('0x48')](_0x31ff05[_0xe50c('0x40')][_0xe50c('0x48')]);_0x28115a[_0xe50c('0x49')]=qs[_0xe50c('0x41')](_[_0xe50c('0x4a')](_0x31ff05[_0xe50c('0x40')],_0xf2c28f[_0xe50c('0x41')]),_0x9b741c);if(_0x31ff05[_0xe50c('0x40')]['filter']){_0x28115a[_0xe50c('0x49')]=_[_0xe50c('0x4b')](_0x28115a[_0xe50c('0x49')],{'$or':_['map'](_0x9b741c,function(_0x2c5a73){if(_0x2c5a73[_0xe50c('0x3c')]!==_0xe50c('0x4c')){var _0x3eb4f0={};_0x3eb4f0[_0x2c5a73[_0xe50c('0x37')]]={'$like':'%'+_0x31ff05['query'][_0xe50c('0x4d')]+'%'};return _0x3eb4f0;}})});}_0x28115a=_[_0xe50c('0x4b')]({},_0x28115a,_0x31ff05[_0xe50c('0x4e')]);var _0x3b06bc={'where':_0x28115a[_0xe50c('0x49')]};return db['Dynamics365Account'][_0xe50c('0x2f')](_0x3b06bc)[_0xe50c('0x20')](function(_0x57d7be){_0x130d78[_0xe50c('0x2f')]=_0x57d7be;if(_0x31ff05[_0xe50c('0x40')][_0xe50c('0x4f')]){_0x28115a[_0xe50c('0x50')]=[{'all':!![]}];}return db[_0xe50c('0x51')][_0xe50c('0x52')](_0x28115a);})[_0xe50c('0x20')](function(_0x36cf8b){_0x130d78[_0xe50c('0x53')]=_0x36cf8b;return _0x130d78;})[_0xe50c('0x20')](respondWithFilteredResult(_0x284b9e,_0x28115a))['catch'](handleError(_0x284b9e,null));};exports[_0xe50c('0x54')]=function(_0x1a8b10,_0x4ce265){var _0x4bada3={'raw':![],'where':{'id':_0x1a8b10[_0xe50c('0x55')]['id']}},_0x35c6ed={};_0x35c6ed[_0xe50c('0x3e')]=_[_0xe50c('0x56')](db['Dynamics365Account'][_0xe50c('0x3a')]);_0x35c6ed[_0xe50c('0x40')]=_[_0xe50c('0x56')](_0x1a8b10['query']);_0x35c6ed['filters']=_['intersection'](_0x35c6ed[_0xe50c('0x3e')],_0x35c6ed[_0xe50c('0x40')]);_0x4bada3[_0xe50c('0x43')]=_[_0xe50c('0x42')](_0x35c6ed[_0xe50c('0x3e')],qs[_0xe50c('0x44')](_0x1a8b10[_0xe50c('0x40')][_0xe50c('0x44')]));_0x4bada3[_0xe50c('0x43')]=_0x4bada3[_0xe50c('0x43')][_0xe50c('0x45')]?_0x4bada3[_0xe50c('0x43')]:_0x35c6ed[_0xe50c('0x3e')];if(_0x1a8b10[_0xe50c('0x40')]['includeAll']){_0x4bada3[_0xe50c('0x50')]=[{'all':!![]}];}_0x4bada3=_['merge']({},_0x4bada3,_0x1a8b10[_0xe50c('0x4e')]);return db[_0xe50c('0x51')][_0xe50c('0x57')](_0x4bada3)['then'](handleEntityNotFound(_0x4ce265,null))[_0xe50c('0x20')](respondWithResult(_0x4ce265,null))[_0xe50c('0x2a')](handleError(_0x4ce265,null));};exports[_0xe50c('0x58')]=function(_0x381e30,_0x2143fc){return db['Dynamics365Account']['create'](_0x381e30[_0xe50c('0x59')],{})[_0xe50c('0x20')](respondWithResult(_0x2143fc,0xc9))[_0xe50c('0x2a')](handleError(_0x2143fc,null));};exports[_0xe50c('0x5a')]=function(_0x16e927,_0x3f2569){if(_0x16e927[_0xe50c('0x59')]['id']){delete _0x16e927[_0xe50c('0x59')]['id'];}return db[_0xe50c('0x51')][_0xe50c('0x57')]({'where':{'id':_0x16e927['params']['id']}})['then'](handleEntityNotFound(_0x3f2569,null))[_0xe50c('0x20')](saveUpdates(_0x16e927[_0xe50c('0x59')],null))[_0xe50c('0x20')](respondWithResult(_0x3f2569,null))['catch'](handleError(_0x3f2569,null));};exports[_0xe50c('0x5b')]=function(_0x584c27,_0x2f0b69){return db[_0xe50c('0x51')]['find']({'where':{'id':_0x584c27[_0xe50c('0x55')]['id']}})['then'](handleEntityNotFound(_0x2f0b69,null))[_0xe50c('0x20')](removeEntity(_0x2f0b69,null))[_0xe50c('0x2a')](handleError(_0x2f0b69,null));};exports['getConfigurations']=function(_0x34ea7f,_0x2d084b,_0x34c2e9){var _0x40f0c6={};var _0x3fe6ef={};var _0x3b7b58;var _0x2de79b;return db[_0xe50c('0x51')][_0xe50c('0x5c')]({'where':{'id':_0x34ea7f['params']['id']}})[_0xe50c('0x20')](handleEntityNotFound(_0x2d084b,null))[_0xe50c('0x20')](function(_0xdc0c9f){if(_0xdc0c9f){_0x3b7b58=_0xdc0c9f;_0x3fe6ef[_0xe50c('0x3e')]=_[_0xe50c('0x56')](db[_0xe50c('0x5d')][_0xe50c('0x3a')]);_0x3fe6ef['query']=_['keys'](_0x34ea7f[_0xe50c('0x40')]);_0x3fe6ef[_0xe50c('0x41')]=_[_0xe50c('0x42')](_0x3fe6ef[_0xe50c('0x3e')],_0x3fe6ef[_0xe50c('0x40')]);_0x40f0c6[_0xe50c('0x43')]=_[_0xe50c('0x42')](_0x3fe6ef['model'],qs[_0xe50c('0x44')](_0x34ea7f[_0xe50c('0x40')][_0xe50c('0x44')]));_0x40f0c6[_0xe50c('0x43')]=_0x40f0c6[_0xe50c('0x43')][_0xe50c('0x45')]?_0x40f0c6['attributes']:_0x3fe6ef[_0xe50c('0x3e')];_0x40f0c6[_0xe50c('0x47')]=qs['sort'](_0x34ea7f[_0xe50c('0x40')][_0xe50c('0x48')]);_0x40f0c6['where']=qs[_0xe50c('0x41')](_[_0xe50c('0x4a')](_0x34ea7f[_0xe50c('0x40')],_0x3fe6ef['filters']));if(_0x34ea7f[_0xe50c('0x40')][_0xe50c('0x4d')]){_0x40f0c6[_0xe50c('0x49')]=_[_0xe50c('0x4b')](_0x40f0c6[_0xe50c('0x49')],{'$or':_[_0xe50c('0x3f')](_0x40f0c6[_0xe50c('0x43')],function(_0x2c3c4d){var _0x2d3488={};_0x2d3488[_0x2c3c4d]={'$like':'%'+_0x34ea7f[_0xe50c('0x40')][_0xe50c('0x4d')]+'%'};return _0x2d3488;})});}_0x40f0c6=_['merge']({},_0x40f0c6,_0x34ea7f[_0xe50c('0x4e')]);return _0x3b7b58['getConfigurations'](_0x40f0c6);}})[_0xe50c('0x20')](function(_0x5ad26a){if(_0x5ad26a){_0x2de79b=_0x5ad26a['length'];if(!_0x34ea7f[_0xe50c('0x40')][_0xe50c('0x46')](_0xe50c('0x5e'))){_0x40f0c6['limit']=qs['limit'](_0x34ea7f[_0xe50c('0x40')][_0xe50c('0x31')]);_0x40f0c6[_0xe50c('0x30')]=qs[_0xe50c('0x30')](_0x34ea7f[_0xe50c('0x40')][_0xe50c('0x30')]);}return _0x3b7b58[_0xe50c('0x5f')](_0x40f0c6);}})['then'](function(_0x46cd12){if(_0x46cd12){return _0x46cd12?{'count':_0x2de79b,'rows':_0x46cd12}:null;}})[_0xe50c('0x20')](respondWithResult(_0x2d084b,null))[_0xe50c('0x2a')](handleError(_0x2d084b,null));};exports['addConfiguration']=function(_0x57c709,_0xb70e7b,_0xf7e997){if(_0x57c709[_0xe50c('0x59')]['id']){delete _0x57c709[_0xe50c('0x59')]['id'];}return db[_0xe50c('0x51')][_0xe50c('0x5c')]({'where':{'id':_0x57c709[_0xe50c('0x55')]['id']}})[_0xe50c('0x20')](handleEntityNotFound(_0xb70e7b,null))[_0xe50c('0x20')](function(_0x99a0e9){if(_0x99a0e9){_0x57c709['body'][_0xe50c('0x60')]=_0x99a0e9['id'];_0x57c709['body'][_0xe50c('0x61')]=integrations['getSubjects'](_0x57c709[_0xe50c('0x59')][_0xe50c('0x62')],_0x57c709[_0xe50c('0x59')]['type']);_0x57c709[_0xe50c('0x59')][_0xe50c('0x63')]=integrations[_0xe50c('0x64')](_0x57c709[_0xe50c('0x59')][_0xe50c('0x62')],_0x57c709['body']['type']);return db[_0xe50c('0x5d')][_0xe50c('0x58')](_0x57c709[_0xe50c('0x59')],{'include':[{'model':db['Dynamics365Field'],'as':_0xe50c('0x61')},{'model':db[_0xe50c('0x65')],'as':_0xe50c('0x63')}]});}return null;})['then'](respondWithResult(_0xb70e7b,null))[_0xe50c('0x2a')](handleError(_0xb70e7b,null));};exports['getFields']=function(_0x2b9671,_0x31035b,_0x4dc13c){var _0x37a90f=_0x2b9671[_0xe50c('0x40')][_0xe50c('0x66')];var _0x448c7b=_0x37a90f===_0xe50c('0x67')?_0xe50c('0x68'):_0xe50c('0x69');var _0x3e8849='';var _0x49d572='';var _0x34cf93='';var _0x546254='';var _0x34e3a6='';var _0x34cd86='';var _0x617b01='';var _0x192339='';var _0x11c889=[_0xe50c('0x6a'),_0xe50c('0x6b'),_0xe50c('0x6c'),_0xe50c('0x6d'),_0xe50c('0x6e'),_0xe50c('0x6f'),_0xe50c('0x70'),'regardingobjectid',_0xe50c('0x71'),_0xe50c('0x72')];var _0x459dd5=[_0xe50c('0x73'),_0xe50c('0x74'),_0xe50c('0x75'),_0xe50c('0x76'),_0xe50c('0x77'),_0xe50c('0x78'),_0xe50c('0x79'),'contractidname',_0xe50c('0x7a'),_0xe50c('0x7b'),_0xe50c('0x7c'),'createdbyyominame',_0xe50c('0x7d'),_0xe50c('0x7e'),_0xe50c('0x7f'),_0xe50c('0x80'),'customeridtype',_0xe50c('0x81'),'emailaddress','entitlementidname',_0xe50c('0x82'),_0xe50c('0x83'),_0xe50c('0x84'),'exchangerate',_0xe50c('0x85'),_0xe50c('0x86'),'importsequencenumber',_0xe50c('0x87'),_0xe50c('0x88'),_0xe50c('0x89'),_0xe50c('0x8a'),_0xe50c('0x8b'),_0xe50c('0x8c'),_0xe50c('0x8d'),'modifiedbyyominame',_0xe50c('0x8e'),_0xe50c('0x8f'),_0xe50c('0x90'),_0xe50c('0x91'),_0xe50c('0x92'),'numberofchildincidents',_0xe50c('0x93'),_0xe50c('0x94'),_0xe50c('0x95'),_0xe50c('0x96'),'owneridyominame',_0xe50c('0x97'),_0xe50c('0x98'),_0xe50c('0x99'),_0xe50c('0x9a'),_0xe50c('0x9b'),_0xe50c('0x9c'),_0xe50c('0x9d'),'resolvebykpiidname',_0xe50c('0x9e'),_0xe50c('0x9f'),'responsiblecontactidyominame',_0xe50c('0xa0'),'slainvokedidname',_0xe50c('0xa1'),'socialprofileidname',_0xe50c('0xa2'),_0xe50c('0xa3'),_0xe50c('0xa4'),_0xe50c('0xa5'),_0xe50c('0xa6'),_0xe50c('0xa7'),_0xe50c('0xa8'),'utcconversiontimezonecode','versionnumber'];var _0x55cd20=_0x11c889[_0xe50c('0xa9')](_0x459dd5);return db[_0xe50c('0x51')]['findOne']({'where':{'id':_0x2b9671[_0xe50c('0x55')]['id']},'attributes':['id',_0xe50c('0xaa'),_0xe50c('0xab'),'remoteUri','tenantId',_0xe50c('0xac'),_0xe50c('0xad')]})[_0xe50c('0x20')](handleEntityNotFound(_0x31035b,null))['then'](function(_0x491710){if(_0x491710){_0x192339=_0x491710['remoteUri'];var _0x2c2504=_0x192339[_0xe50c('0xae')](-0x1);if(_0x2c2504==='/'){_0x192339=_0x192339['substring'](0x0,_0x192339['lastIndexOf'](_0x2c2504));}_0x617b01=util[_0xe50c('0xaf')](_0xe50c('0xb0'),_0x192339);var _0x7dae0={'method':'POST','uri':_0xe50c('0xb1')+_0x491710['tenantId']+_0xe50c('0xb2'),'form':{'client_id':_0x491710[_0xe50c('0xac')],'resource':_0x192339,'username':_0x491710['username'],'password':_0x491710[_0xe50c('0xab')],'grant_type':_0xe50c('0xab'),'client_secret':_0x491710[_0xe50c('0xad')]},'json':!![]};return rp(_0x7dae0);}})['then'](function(_0x2c2558){_0x34cd86=_0x2c2558[_0xe50c('0xb3')];var _0x144767={'method':_0xe50c('0xb4'),'uri':encodeURI(_0x617b01+_0xe50c('0xb5')+_0x448c7b+'\x27'),'headers':{'Authorization':_0xe50c('0xb6')+_0x34cd86,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x144767);})[_0xe50c('0x20')](function(_0x335796){var _0x49726d=_0x335796['value'][0x0];var _0x2fb935=_0x49726d[_0xe50c('0xb7')];var _0x4af720={'method':'GET','uri':_0x617b01+_0xe50c('0xb8')+_0x2fb935+_0xe50c('0xb9'),'headers':{'Authorization':_0xe50c('0xb6')+_0x34cd86,'If-None-Match':null,'OData-Version':_0xe50c('0xba')},'json':!![]};return rp(_0x4af720);})['then'](function(_0x2eb9f6){_0x3e8849=_0x2eb9f6;_0x49d572=_0x3e8849[_0xe50c('0xbb')];_0x49d572=_[_0xe50c('0xbc')](_0x49d572,function(_0x9861f2){return!_0x55cd20['includes'](_0x9861f2[_0xe50c('0xbd')]);});var _0x5b8683=[];var _0x9a90e6=[];_0x49d572['forEach'](function(_0xd3f271){if(_0xd3f271[_0xe50c('0xbe')]){var _0x45d0c6=_0xd3f271['@odata.type']['substring'](_0xd3f271[_0xe50c('0xbe')][_0xe50c('0xbf')]('.')+0x1);if(_0x45d0c6===_0xe50c('0xc0')){_0x5b8683[_0xe50c('0xc1')](getSelectList(_0x617b01,_0x37a90f,_0x9a90e6,_0x3e8849['MetadataId'],_0xd3f271[_0xe50c('0xb7')],_0x34cd86));}}});return Promise[_0xe50c('0xc2')](_0x5b8683);})[_0xe50c('0x20')](function(_0x51c1f8){_0x34cf93=_0x51c1f8[0x0];var _0x1b35c0=[];var _0x51e9c5=[];_0x49d572[_0xe50c('0xc3')](function(_0x4c1714){if(!_[_0xe50c('0xc4')](_0x4c1714[_0xe50c('0xbe')])){var _0x3fd18f=_0x4c1714[_0xe50c('0xbe')][_0xe50c('0xc5')](_0x4c1714[_0xe50c('0xbe')][_0xe50c('0xbf')]('.')+0x1);if(_0x3fd18f===_0xe50c('0xc6')){_0x1b35c0['push'](getBooleanList(_0x617b01,_0x37a90f,_0x51e9c5,_0x3e8849[_0xe50c('0xb7')],_0x4c1714['MetadataId'],_0x34cd86));}}});return Promise[_0xe50c('0xc2')](_0x1b35c0);})[_0xe50c('0x20')](function(_0x27f80c){_0x546254=_0x27f80c[0x0];var _0x121326=[];var _0x390243=[];_0x49d572['forEach'](function(_0x2dfa3d){if(_0x2dfa3d[_0xe50c('0xbe')]){var _0xe0474=_0x2dfa3d[_0xe50c('0xbe')]['substring'](_0x2dfa3d['@odata.type'][_0xe50c('0xbf')]('.')+0x1);if(_0xe0474===_0xe50c('0xc7')||_0xe0474==='DoubleAttributeMetadata'||_0xe0474===_0xe50c('0xc8')||_0xe0474==='IntegerAttributeMetadata'||_0xe0474===_0xe50c('0xc9')||_0xe0474===_0xe50c('0xca')||_0xe0474===_0xe50c('0xcb')||_0xe0474===_0xe50c('0xcc')||_0xe0474===_0xe50c('0xcd')||_0xe0474===_0xe50c('0xce')){_0x121326[_0xe50c('0xc1')](getInputList(_0x617b01,_0x37a90f,_0xe0474,_0x390243,_0x3e8849[_0xe50c('0xb7')],_0x2dfa3d[_0xe50c('0xb7')],_0x34cd86));}}});return Promise[_0xe50c('0xc2')](_0x121326);})[_0xe50c('0x20')](function(_0x2de22d){_0x34e3a6=_0x2de22d[0x0];var _0x165778=_0x34cf93[_0xe50c('0xa9')](_0x546254)[_0xe50c('0xa9')](_0x34e3a6);var _0x202a64={'count':_0x165778['length'],'rows':_0x165778};return _0x202a64;})['then'](respondWithResult(_0x31035b,null))['catch'](function(_0x435790){var _0x2b5157=_0x2b9671[_0xe50c('0x40')][_0xe50c('0xcf')]?0x1f4:_0x435790[_0xe50c('0xd0')]||0x1f4;logger[_0xe50c('0x25')](_0x435790[_0xe50c('0x36')]);delete _0x435790[_0xe50c('0x37')];if(_0x2b5157===0x191){_0x2b5157=0x190;}_0x31035b['status'](_0x2b5157)[_0xe50c('0x38')](_0x2b9671[_0xe50c('0x40')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x435790[_0xe50c('0xd0')]}:_0x435790);});};function getSelectList(_0x46118,_0x12b43a,_0x22290d,_0x211685,_0x2c9917,_0x43d46d){var _0x566732={'method':'GET','uri':_0x46118+_0xe50c('0xb8')+_0x211685+_0xe50c('0xd1')+_0x2c9917+_0xe50c('0xd2')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xe50c('0xb6')+_0x43d46d,'If-None-Match':null,'OData-Version':_0xe50c('0xba')},'json':!![]};return rp(_0x566732)[_0xe50c('0x20')](function(_0x47576e){var _0x399c76=[];var _0x2b6aa0=_0x47576e[_0xe50c('0xd3')][_0xe50c('0xd4')];_0x2b6aa0['forEach'](function(_0x1a71df){_0x399c76[_0xe50c('0xc1')]({'name':_0x1a71df[_0xe50c('0xd5')]['UserLocalizedLabel'][_0xe50c('0xd5')],'value':String(_0x1a71df[_0xe50c('0xd6')])});});var _0x5d6824={'id':_0x12b43a+'_'+_0x47576e['LogicalName'],'name':_0x47576e[_0xe50c('0xd7')][_0xe50c('0xd8')][_0xe50c('0xd5')],'custom':![],'options':_0x399c76};_0x22290d[_0xe50c('0xc1')](_0x5d6824);return _0x22290d;});}function getBooleanList(_0xbeb415,_0x293878,_0x53e8f3,_0x2c5f32,_0x586876,_0x528781){var _0x282dfd={'method':_0xe50c('0xb4'),'uri':_0xbeb415+_0xe50c('0xb8')+_0x2c5f32+_0xe50c('0xd1')+_0x586876+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x528781,'If-None-Match':null,'OData-Version':_0xe50c('0xba')},'json':!![]};return rp(_0x282dfd)[_0xe50c('0x20')](function(_0x7c4aad){var _0xbad63f=[];_0xbad63f['push']({'name':_0x7c4aad[_0xe50c('0xd3')][_0xe50c('0xd9')][_0xe50c('0xd5')][_0xe50c('0xd8')][_0xe50c('0xd5')],'value':_0xe50c('0xda')},{'name':_0x7c4aad[_0xe50c('0xd3')][_0xe50c('0xdb')][_0xe50c('0xd5')][_0xe50c('0xd8')]['Label'],'value':_0xe50c('0xdc')});var _0x14f9e7={'id':_0x293878+'_'+_0x7c4aad['LogicalName'],'name':_0x7c4aad[_0xe50c('0xd7')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0xbad63f};_0x53e8f3['push'](_0x14f9e7);return _0x53e8f3;});}function getInputList(_0x52e634,_0x14aa8c,_0x34a4b9,_0x1990c0,_0x526444,_0x4ddca1,_0x23f548){var _0x3d9c95={'method':_0xe50c('0xb4'),'uri':_0x52e634+_0xe50c('0xb8')+_0x526444+_0xe50c('0xd1')+_0x4ddca1+_0xe50c('0xdd')+_0x34a4b9+_0xe50c('0xde'),'headers':{'Authorization':_0xe50c('0xb6')+_0x23f548,'If-None-Match':null,'OData-Version':_0xe50c('0xba')},'json':!![]};return rp(_0x3d9c95)[_0xe50c('0x20')](function(_0x21ca1f){var _0x4ff2b9={'id':_0x14aa8c+'_'+_0x21ca1f[_0xe50c('0xbd')],'name':_0x21ca1f[_0xe50c('0xd7')][_0xe50c('0xd8')]?_0x21ca1f[_0xe50c('0xd7')]['UserLocalizedLabel'][_0xe50c('0xd5')]:_0x21ca1f[_0xe50c('0xbd')],'custom':![],'options':[]};_0x1990c0['push'](_0x4ff2b9);return _0x1990c0;});}
\ No newline at end of file
index 739cafa..4b2fada 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a15=['request-promise','path','rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1894e7,_0x1253e6){var _0x5e857f=function(_0x1b47c3){while(--_0x1b47c3){_0x1894e7['push'](_0x1894e7['shift']());}};_0x5e857f(++_0x1253e6);}(_0x1a15,0x103));var _0x51a1=function(_0x584f81,_0x26fa78){_0x584f81=_0x584f81-0x0;var _0x3896a3=_0x1a15[_0x584f81];return _0x3896a3;};'use strict';var _=require(_0x51a1('0x0'));var util=require(_0x51a1('0x1'));var logger=require(_0x51a1('0x2'))('api');var moment=require(_0x51a1('0x3'));var BPromise=require(_0x51a1('0x4'));var rp=require(_0x51a1('0x5'));var fs=require('fs');var path=require(_0x51a1('0x6'));var rimraf=require(_0x51a1('0x7'));var config=require('../../config/environment');var attributes=require(_0x51a1('0x8'));var integrations=require(_0x51a1('0x9'));module[_0x51a1('0xa')]=function(_0x4d8db0,_0x395039){return _0x4d8db0[_0x51a1('0xb')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9149=['../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9149,0x1d7));var _0x9914=function(_0xb975ad,_0x4ffa34){_0xb975ad=_0xb975ad-0x0;var _0x17aa41=_0x9149[_0xb975ad];return _0x17aa41;};'use strict';var _=require(_0x9914('0x0'));var util=require(_0x9914('0x1'));var logger=require(_0x9914('0x2'))(_0x9914('0x3'));var moment=require(_0x9914('0x4'));var BPromise=require(_0x9914('0x5'));var rp=require(_0x9914('0x6'));var fs=require('fs');var path=require(_0x9914('0x7'));var rimraf=require(_0x9914('0x8'));var config=require(_0x9914('0x9'));var attributes=require(_0x9914('0xa'));var integrations=require(_0x9914('0xb'));module[_0x9914('0xc')]=function(_0x1a7b55,_0x3fd926){return _0x1a7b55[_0x9914('0xd')](_0x9914('0xe'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b085a33..b8a4ded 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf98=['find','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','model','map'];(function(_0x28dcf6,_0x4057fd){var _0x3702e9=function(_0xd71f62){while(--_0xd71f62){_0x28dcf6['push'](_0x28dcf6['shift']());}};_0x3702e9(++_0x4057fd);}(_0xcf98,0x8d));var _0x8cf9=function(_0x4c8d88,_0x2ae759){_0x4c8d88=_0x4c8d88-0x0;var _0x1e2c47=_0xcf98[_0x4c8d88];return _0x1e2c47;};'use strict';var _=require('lodash');var util=require(_0x8cf9('0x0'));var moment=require(_0x8cf9('0x1'));var BPromise=require(_0x8cf9('0x2'));var rs=require(_0x8cf9('0x3'));var fs=require('fs');var Redis=require(_0x8cf9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8cf9('0x5'))(_0x8cf9('0x6'));var config=require(_0x8cf9('0x7'));var jayson=require(_0x8cf9('0x8'));var client=jayson[_0x8cf9('0x9')][_0x8cf9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23114d,_0x29fb1e,_0x11c3b5){return new BPromise(function(_0x136309,_0x7d48dc){return client['request'](_0x23114d,_0x11c3b5)[_0x8cf9('0xb')](function(_0x982c65){logger['info'](_0x8cf9('0xc'),_0x29fb1e,'request\x20sent');logger[_0x8cf9('0xd')](_0x8cf9('0xe'),_0x29fb1e,_0x8cf9('0xf'),JSON[_0x8cf9('0x10')](_0x982c65));if(_0x982c65[_0x8cf9('0x11')]){if(_0x982c65[_0x8cf9('0x11')][_0x8cf9('0x12')]===0x1f4){logger['error'](_0x8cf9('0xc'),_0x29fb1e,_0x982c65['error']['message']);return _0x7d48dc(_0x982c65['error'][_0x8cf9('0x13')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x29fb1e,_0x982c65[_0x8cf9('0x11')][_0x8cf9('0x13')]);return _0x136309(_0x982c65[_0x8cf9('0x11')]['message']);}else{logger[_0x8cf9('0x14')](_0x8cf9('0xc'),_0x29fb1e,'request\x20sent');_0x136309(_0x982c65[_0x8cf9('0x15')][_0x8cf9('0x13')]);}})[_0x8cf9('0x16')](function(_0x46a573){logger[_0x8cf9('0x11')](_0x8cf9('0xc'),_0x29fb1e,_0x46a573);_0x7d48dc(_0x46a573);});});}exports[_0x8cf9('0x17')]=function(_0x21efd3){var _0x309866=this;return new Promise(function(_0x3a13b7,_0x873fec){return db[_0x8cf9('0x18')][_0x8cf9('0x19')]({'raw':_0x21efd3[_0x8cf9('0x1a')]?_0x21efd3[_0x8cf9('0x1a')][_0x8cf9('0x1b')]===undefined?!![]:![]:!![],'where':_0x21efd3['options']?_0x21efd3['options'][_0x8cf9('0x1c')]||null:null,'attributes':_0x21efd3['options']?_0x21efd3[_0x8cf9('0x1a')][_0x8cf9('0x1d')]||null:null,'limit':_0x21efd3[_0x8cf9('0x1a')]?_0x21efd3[_0x8cf9('0x1a')][_0x8cf9('0x1e')]||null:null,'include':_0x21efd3[_0x8cf9('0x1a')]?_0x21efd3[_0x8cf9('0x1a')][_0x8cf9('0x1f')]?_['map'](_0x21efd3[_0x8cf9('0x1a')]['include'],function(_0x5be3ae){return{'model':db[_0x5be3ae[_0x8cf9('0x20')]],'as':_0x5be3ae['as'],'attributes':_0x5be3ae[_0x8cf9('0x1d')],'include':_0x5be3ae['include']?_[_0x8cf9('0x21')](_0x5be3ae['include'],function(_0x4d07fa){return{'model':db[_0x4d07fa[_0x8cf9('0x20')]],'as':_0x4d07fa['as'],'attributes':_0x4d07fa[_0x8cf9('0x1d')],'include':_0x4d07fa['include']?_[_0x8cf9('0x21')](_0x4d07fa[_0x8cf9('0x1f')],function(_0x170414){return{'model':db[_0x170414[_0x8cf9('0x20')]],'as':_0x170414['as'],'attributes':_0x170414[_0x8cf9('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53b580){logger[_0x8cf9('0x14')](_0x8cf9('0x17'),_0x21efd3);logger[_0x8cf9('0xd')](_0x8cf9('0x17'),_0x21efd3,JSON[_0x8cf9('0x10')](_0x53b580));_0x3a13b7(_0x53b580);})[_0x8cf9('0x16')](function(_0x13fa60){logger[_0x8cf9('0x11')](_0x8cf9('0x17'),_0x13fa60['message'],_0x21efd3);_0x873fec(_0x309866['error'](0x1f4,_0x13fa60[_0x8cf9('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x2716c8){var _0x2c2e6e=this;return new Promise(function(_0x2bbd81,_0x443ca1){return db['Dynamics365Account'][_0x8cf9('0x22')]({'raw':_0x2716c8[_0x8cf9('0x1a')]?_0x2716c8[_0x8cf9('0x1a')][_0x8cf9('0x1b')]===undefined?!![]:![]:!![],'where':_0x2716c8[_0x8cf9('0x1a')]?_0x2716c8[_0x8cf9('0x1a')][_0x8cf9('0x1c')]||null:null,'attributes':_0x2716c8['options']?_0x2716c8['options'][_0x8cf9('0x1d')]||null:null,'include':_0x2716c8[_0x8cf9('0x1a')]?_0x2716c8[_0x8cf9('0x1a')][_0x8cf9('0x1f')]?_[_0x8cf9('0x21')](_0x2716c8[_0x8cf9('0x1a')]['include'],function(_0x288990){return{'model':db[_0x288990[_0x8cf9('0x20')]],'as':_0x288990['as'],'attributes':_0x288990[_0x8cf9('0x1d')],'include':_0x288990[_0x8cf9('0x1f')]?_[_0x8cf9('0x21')](_0x288990[_0x8cf9('0x1f')],function(_0x1d37a3){return{'model':db[_0x1d37a3[_0x8cf9('0x20')]],'as':_0x1d37a3['as'],'attributes':_0x1d37a3['attributes'],'include':_0x1d37a3[_0x8cf9('0x1f')]?_[_0x8cf9('0x21')](_0x1d37a3[_0x8cf9('0x1f')],function(_0x4b9cb8){return{'model':db[_0x4b9cb8[_0x8cf9('0x20')]],'as':_0x4b9cb8['as'],'attributes':_0x4b9cb8['attributes']};}):[]};}):[]};}):[]:[]})[_0x8cf9('0xb')](function(_0x5a8c30){logger[_0x8cf9('0x14')]('ShowDynamics365Account',_0x2716c8);logger[_0x8cf9('0xd')]('ShowDynamics365Account',_0x2716c8,JSON[_0x8cf9('0x10')](_0x5a8c30));_0x2bbd81(_0x5a8c30);})['catch'](function(_0x4f318c){logger[_0x8cf9('0x11')]('ShowDynamics365Account',_0x4f318c[_0x8cf9('0x13')],_0x2716c8);_0x443ca1(_0x2c2e6e['error'](0x1f4,_0x4f318c[_0x8cf9('0x13')]));});});};
\ No newline at end of file
+var _0x46e1=['error','code','message','result','catch','GetDynamics365Account','findAll','options','raw','where','include','model','attributes','map','ShowDynamics365Account','Dynamics365Account','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s'];(function(_0x128c56,_0x40560b){var _0x64456b=function(_0x289187){while(--_0x289187){_0x128c56['push'](_0x128c56['shift']());}};_0x64456b(++_0x40560b);}(_0x46e1,0x155));var _0x146e=function(_0x5ea944,_0x55f4fa){_0x5ea944=_0x5ea944-0x0;var _0x3093bb=_0x46e1[_0x5ea944];return _0x3093bb;};'use strict';var _=require(_0x146e('0x0'));var util=require(_0x146e('0x1'));var moment=require(_0x146e('0x2'));var BPromise=require(_0x146e('0x3'));var rs=require(_0x146e('0x4'));var fs=require('fs');var Redis=require(_0x146e('0x5'));var db=require(_0x146e('0x6'))['db'];var utils=require(_0x146e('0x7'));var logger=require(_0x146e('0x8'))(_0x146e('0x9'));var config=require('../../config/environment');var jayson=require(_0x146e('0xa'));var client=jayson[_0x146e('0xb')][_0x146e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x228fe7,_0x70ce4,_0x35e40e){return new BPromise(function(_0x1c1398,_0x5f33c0){return client[_0x146e('0xd')](_0x228fe7,_0x35e40e)['then'](function(_0x36f843){logger[_0x146e('0xe')](_0x146e('0xf'),_0x70ce4,_0x146e('0x10'));logger[_0x146e('0x11')](_0x146e('0x12'),_0x70ce4,'request\x20sent',JSON['stringify'](_0x36f843));if(_0x36f843[_0x146e('0x13')]){if(_0x36f843[_0x146e('0x13')][_0x146e('0x14')]===0x1f4){logger[_0x146e('0x13')](_0x146e('0xf'),_0x70ce4,_0x36f843[_0x146e('0x13')][_0x146e('0x15')]);return _0x5f33c0(_0x36f843[_0x146e('0x13')]['message']);}logger['error'](_0x146e('0xf'),_0x70ce4,_0x36f843[_0x146e('0x13')][_0x146e('0x15')]);return _0x1c1398(_0x36f843[_0x146e('0x13')][_0x146e('0x15')]);}else{logger[_0x146e('0xe')](_0x146e('0xf'),_0x70ce4,_0x146e('0x10'));_0x1c1398(_0x36f843[_0x146e('0x16')][_0x146e('0x15')]);}})[_0x146e('0x17')](function(_0x55fddc){logger[_0x146e('0x13')](_0x146e('0xf'),_0x70ce4,_0x55fddc);_0x5f33c0(_0x55fddc);});});}exports[_0x146e('0x18')]=function(_0x88e062){var _0x2286f6=this;return new Promise(function(_0x431a60,_0x256db5){return db['Dynamics365Account'][_0x146e('0x19')]({'raw':_0x88e062['options']?_0x88e062[_0x146e('0x1a')][_0x146e('0x1b')]===undefined?!![]:![]:!![],'where':_0x88e062[_0x146e('0x1a')]?_0x88e062['options'][_0x146e('0x1c')]||null:null,'attributes':_0x88e062['options']?_0x88e062[_0x146e('0x1a')]['attributes']||null:null,'limit':_0x88e062[_0x146e('0x1a')]?_0x88e062[_0x146e('0x1a')]['limit']||null:null,'include':_0x88e062['options']?_0x88e062['options']['include']?_['map'](_0x88e062['options'][_0x146e('0x1d')],function(_0x504016){return{'model':db[_0x504016[_0x146e('0x1e')]],'as':_0x504016['as'],'attributes':_0x504016[_0x146e('0x1f')],'include':_0x504016[_0x146e('0x1d')]?_[_0x146e('0x20')](_0x504016[_0x146e('0x1d')],function(_0xed7b99){return{'model':db[_0xed7b99[_0x146e('0x1e')]],'as':_0xed7b99['as'],'attributes':_0xed7b99['attributes'],'include':_0xed7b99[_0x146e('0x1d')]?_['map'](_0xed7b99[_0x146e('0x1d')],function(_0x4afb82){return{'model':db[_0x4afb82['model']],'as':_0x4afb82['as'],'attributes':_0x4afb82[_0x146e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x402faf){logger[_0x146e('0xe')](_0x146e('0x18'),_0x88e062);logger[_0x146e('0x11')](_0x146e('0x18'),_0x88e062,JSON['stringify'](_0x402faf));_0x431a60(_0x402faf);})[_0x146e('0x17')](function(_0x46cf9a){logger[_0x146e('0x13')](_0x146e('0x18'),_0x46cf9a[_0x146e('0x15')],_0x88e062);_0x256db5(_0x2286f6[_0x146e('0x13')](0x1f4,_0x46cf9a[_0x146e('0x15')]));});});};exports[_0x146e('0x21')]=function(_0x502324){var _0x500120=this;return new Promise(function(_0x37c5d8,_0x5f0c5c){return db[_0x146e('0x22')]['find']({'raw':_0x502324['options']?_0x502324[_0x146e('0x1a')][_0x146e('0x1b')]===undefined?!![]:![]:!![],'where':_0x502324[_0x146e('0x1a')]?_0x502324[_0x146e('0x1a')][_0x146e('0x1c')]||null:null,'attributes':_0x502324[_0x146e('0x1a')]?_0x502324['options'][_0x146e('0x1f')]||null:null,'include':_0x502324['options']?_0x502324[_0x146e('0x1a')]['include']?_[_0x146e('0x20')](_0x502324[_0x146e('0x1a')][_0x146e('0x1d')],function(_0x56c6d6){return{'model':db[_0x56c6d6[_0x146e('0x1e')]],'as':_0x56c6d6['as'],'attributes':_0x56c6d6[_0x146e('0x1f')],'include':_0x56c6d6['include']?_[_0x146e('0x20')](_0x56c6d6[_0x146e('0x1d')],function(_0x2f438d){return{'model':db[_0x2f438d[_0x146e('0x1e')]],'as':_0x2f438d['as'],'attributes':_0x2f438d[_0x146e('0x1f')],'include':_0x2f438d[_0x146e('0x1d')]?_[_0x146e('0x20')](_0x2f438d['include'],function(_0x500a7c){return{'model':db[_0x500a7c[_0x146e('0x1e')]],'as':_0x500a7c['as'],'attributes':_0x500a7c[_0x146e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x146e('0x23')](function(_0x36bb15){logger[_0x146e('0xe')](_0x146e('0x21'),_0x502324);logger['debug'](_0x146e('0x21'),_0x502324,JSON['stringify'](_0x36bb15));_0x37c5d8(_0x36bb15);})[_0x146e('0x17')](function(_0xbdb2aa){logger[_0x146e('0x13')](_0x146e('0x21'),_0xbdb2aa[_0x146e('0x15')],_0x502324);_0x5f0c5c(_0x500120[_0x146e('0x13')](0x1f4,_0xbdb2aa['message']));});});};
\ No newline at end of file
index 0ba18af..e916fa3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x907a=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','show','/:id/fields','getFields'];(function(_0x1f31d3,_0x111697){var _0x578c07=function(_0x8e02f){while(--_0x8e02f){_0x1f31d3['push'](_0x1f31d3['shift']());}};_0x578c07(++_0x111697);}(_0x907a,0x192));var _0xa907=function(_0x386d6b,_0x37e050){_0x386d6b=_0x386d6b-0x0;var _0x17190d=_0x907a[_0x386d6b];return _0x17190d;};'use strict';var multer=require(_0xa907('0x0'));var util=require(_0xa907('0x1'));var path=require('path');var timeout=require(_0xa907('0x2'));var express=require(_0xa907('0x3'));var router=express['Router']();var auth=require(_0xa907('0x4'));var interaction=require(_0xa907('0x5'));var config=require(_0xa907('0x6'));var controller=require(_0xa907('0x7'));router[_0xa907('0x8')]('/',auth[_0xa907('0x9')](),controller[_0xa907('0xa')]);router[_0xa907('0x8')]('/:id',auth[_0xa907('0x9')](),controller[_0xa907('0xb')]);router[_0xa907('0x8')](_0xa907('0xc'),auth[_0xa907('0x9')](),controller[_0xa907('0xd')]);router[_0xa907('0x8')](_0xa907('0xe'),auth['isAuthenticated'](),controller[_0xa907('0xf')]);router[_0xa907('0x8')](_0xa907('0x10'),auth['isAuthenticated'](),controller[_0xa907('0x11')]);router[_0xa907('0x12')]('/',auth[_0xa907('0x9')](),controller[_0xa907('0x13')]);router[_0xa907('0x14')](_0xa907('0x15'),auth[_0xa907('0x9')](),controller[_0xa907('0x16')]);router[_0xa907('0x17')](_0xa907('0x15'),auth['isAuthenticated'](),controller[_0xa907('0x18')]);module[_0xa907('0x19')]=router;
\ No newline at end of file
+var _0x529c=['multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id','update','delete','destroy'];(function(_0x2e73de,_0x1ad32e){var _0x27bed3=function(_0x2c1c67){while(--_0x2c1c67){_0x2e73de['push'](_0x2e73de['shift']());}};_0x27bed3(++_0x1ad32e);}(_0x529c,0x1a2));var _0xc529=function(_0x41278f,_0x2fe0cb){_0x41278f=_0x41278f-0x0;var _0x47f791=_0x529c[_0x41278f];return _0x47f791;};'use strict';var multer=require(_0xc529('0x0'));var util=require(_0xc529('0x1'));var path=require('path');var timeout=require(_0xc529('0x2'));var express=require('express');var router=express[_0xc529('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc529('0x4'));var config=require(_0xc529('0x5'));var controller=require(_0xc529('0x6'));router[_0xc529('0x7')]('/',auth['isAuthenticated'](),controller[_0xc529('0x8')]);router['get']('/:id',auth[_0xc529('0x9')](),controller['show']);router[_0xc529('0x7')](_0xc529('0xa'),auth[_0xc529('0x9')](),controller[_0xc529('0xb')]);router[_0xc529('0x7')](_0xc529('0xc'),auth['isAuthenticated'](),controller[_0xc529('0xd')]);router['get'](_0xc529('0xe'),auth['isAuthenticated'](),controller[_0xc529('0xf')]);router[_0xc529('0x10')]('/',auth[_0xc529('0x9')](),controller[_0xc529('0x11')]);router['put'](_0xc529('0x12'),auth[_0xc529('0x9')](),controller[_0xc529('0x13')]);router[_0xc529('0x14')](_0xc529('0x12'),auth[_0xc529('0x9')](),controller[_0xc529('0x15')]);module['exports']=router;
\ No newline at end of file
index 7cb5215..3d8e52d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe392=['incident','phonecall','sequelize','exports','STRING'];(function(_0xfa3460,_0x3061d4){var _0x428991=function(_0x2b8759){while(--_0x2b8759){_0xfa3460['push'](_0xfa3460['shift']());}};_0x428991(++_0x3061d4);}(_0xe392,0x18d));var _0x2e39=function(_0x4c879c,_0x49276d){_0x4c879c=_0x4c879c-0x0;var _0x172ac7=_0xe392[_0x4c879c];return _0x172ac7;};'use strict';var Sequelize=require(_0x2e39('0x0'));module[_0x2e39('0x1')]={'name':{'type':Sequelize[_0x2e39('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x2e39('0x3'),_0x2e39('0x4')),'defaultValue':_0x2e39('0x3')}};
\ No newline at end of file
+var _0x0aa8=['exports','STRING','incident','phonecall','sequelize'];(function(_0x110d88,_0x503a58){var _0x527ae2=function(_0x3f1220){while(--_0x3f1220){_0x110d88['push'](_0x110d88['shift']());}};_0x527ae2(++_0x503a58);}(_0x0aa8,0x1ee));var _0x80aa=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0x0aa8[_0x240261];return _0x45c332;};'use strict';var Sequelize=require(_0x80aa('0x0'));module[_0x80aa('0x1')]={'name':{'type':Sequelize[_0x80aa('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x80aa('0x3'),_0x80aa('0x4')),'defaultValue':_0x80aa('0x3')}};
\ No newline at end of file
index e79e0a7..3534852 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50d6=['request-promise','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','Dynamics365Configuration','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','pick','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','getFields','findOne','rawAttributes','filter','hasOwnProperty','Dynamics365Field','getSubjects','getDescriptions','html-pdf','zip-dir','fast-json-patch'];(function(_0x1cbf5e,_0x66bf96){var _0xa4c95b=function(_0x1a498b){while(--_0x1a498b){_0x1cbf5e['push'](_0x1cbf5e['shift']());}};_0xa4c95b(++_0x66bf96);}(_0x50d6,0xb7));var _0x650d=function(_0x28b0a1,_0x99bd0a){_0x28b0a1=_0x28b0a1-0x0;var _0x21470c=_0x50d6[_0x28b0a1];return _0x21470c;};'use strict';var pdf=require(_0x650d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x650d('0x1'));var jsonpatch=require(_0x650d('0x2'));var rp=require(_0x650d('0x3'));var moment=require('moment');var BPromise=require(_0x650d('0x4'));var Mustache=require(_0x650d('0x5'));var util=require(_0x650d('0x6'));var path=require(_0x650d('0x7'));var sox=require(_0x650d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x650d('0x9'));var squel=require(_0x650d('0xa'));var crypto=require('crypto');var jsforce=require(_0x650d('0xb'));var deskjs=require(_0x650d('0xc'));var toCsv=require(_0x650d('0xd'));var querystring=require(_0x650d('0xe'));var Papa=require('papaparse');var Redis=require(_0x650d('0xf'));var authService=require(_0x650d('0x10'));var qs=require(_0x650d('0x11'));var as=require(_0x650d('0x12'));var hardwareService=require(_0x650d('0x13'));var logger=require(_0x650d('0x14'))(_0x650d('0x15'));var utils=require(_0x650d('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x650d('0x17'));var client=jayson['client'][_0x650d('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4eda2d,_0x244c5c,_0x2545d3){if(_0x2545d3){var _0xa80052=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa80052[_0x650d('0x19')](_0x244c5c)){return _0x4eda2d;}else{throw new db[(_0x650d('0x1a'))][(_0x650d('0x1b'))](_0x650d('0x1c'));}}else{return _0x4eda2d;}}function respondWithRpcPromise(_0x263ac9,_0x34f753,_0x307523,_0x14abee){return new BPromise(function(_0xbffa8d,_0x5e2f7c){var _0x26f693=_0x14abee||client;return _0x26f693[_0x650d('0x1d')](_0x263ac9,_0x307523)[_0x650d('0x1e')](function(_0x476e6b){logger[_0x650d('0x1f')](_0x650d('0x20'),_0x34f753,_0x650d('0x21'));logger['debug'](_0x650d('0x22'),_0x34f753,_0x650d('0x21'),JSON[_0x650d('0x23')](_0x476e6b));if(_0x476e6b[_0x650d('0x24')]){if(_0x476e6b[_0x650d('0x24')]['code']===0x1f4){logger[_0x650d('0x24')](_0x650d('0x20'),_0x34f753,_0x476e6b[_0x650d('0x24')][_0x650d('0x25')]);return _0x5e2f7c(_0x476e6b[_0x650d('0x24')][_0x650d('0x25')]);}logger[_0x650d('0x24')](_0x650d('0x20'),_0x34f753,_0x476e6b[_0x650d('0x24')][_0x650d('0x25')]);return _0xbffa8d(_0x476e6b[_0x650d('0x24')][_0x650d('0x25')]);}else{logger[_0x650d('0x1f')](_0x650d('0x20'),_0x34f753,_0x650d('0x21'));_0xbffa8d(_0x476e6b[_0x650d('0x26')][_0x650d('0x25')]);}})['catch'](function(_0x2b55ae){logger['error'](_0x650d('0x20'),_0x34f753,_0x2b55ae);_0x5e2f7c(_0x2b55ae);});});}function respondWithStatusCode(_0x79836f,_0x297eb4){_0x297eb4=_0x297eb4||0xcc;return function(_0x2e0a8a){if(_0x2e0a8a){return _0x79836f[_0x650d('0x27')](_0x297eb4);}return _0x79836f[_0x650d('0x28')](_0x297eb4)[_0x650d('0x29')]();};}function respondWithResult(_0x58454e,_0x554cfc){_0x554cfc=_0x554cfc||0xc8;return function(_0x32b059){if(_0x32b059){return _0x58454e['status'](_0x554cfc)[_0x650d('0x2a')](_0x32b059);}};}function respondWithFilteredResult(_0x2e3be4,_0x4eec65){return function(_0x1e746e){if(_0x1e746e){var _0x50a0fa=_0x1e746e[_0x650d('0x2b')],_0x569293=_0x4eec65[_0x650d('0x2c')],_0x436187=_0x4eec65[_0x650d('0x2c')]+_0x4eec65[_0x650d('0x2d')],_0x340614;if(_0x436187>=_0x50a0fa){_0x436187=_0x50a0fa;_0x340614=0xc8;}else{_0x340614=0xce;}_0x2e3be4[_0x650d('0x28')](_0x340614);return _0x2e3be4['set'](_0x650d('0x2e'),_0x569293+'-'+_0x436187+'/'+_0x50a0fa)[_0x650d('0x2a')](_0x1e746e);}return null;};}function patchUpdates(_0x1c4ca8){return function(_0x5bef12){try{jsonpatch[_0x650d('0x2f')](_0x5bef12,_0x1c4ca8,!![]);}catch(_0x314048){return BPromise[_0x650d('0x30')](_0x314048);}return _0x5bef12[_0x650d('0x31')]();};}function saveUpdates(_0x14e978,_0x5f0bd6){return function(_0x1ddaac){if(_0x1ddaac){return _0x1ddaac[_0x650d('0x32')](_0x14e978)[_0x650d('0x1e')](function(_0x3f9bf5){return _0x3f9bf5;});}return null;};}function removeEntity(_0x57e39d,_0x11067e){return function(_0x530d77){if(_0x530d77){return _0x530d77[_0x650d('0x33')]()['then'](function(){_0x57e39d[_0x650d('0x28')](0xcc)[_0x650d('0x29')]();});}};}function handleEntityNotFound(_0x4c5498,_0x10fc1e){return function(_0x32a2b7){if(!_0x32a2b7){_0x4c5498[_0x650d('0x27')](0x194);}return _0x32a2b7;};}function handleError(_0x3a7aa4,_0x66289a){_0x66289a=_0x66289a||0x1f4;return function(_0x5d86b4){logger['error'](_0x5d86b4[_0x650d('0x34')]);if(_0x5d86b4[_0x650d('0x35')]){delete _0x5d86b4['name'];}_0x3a7aa4['status'](_0x66289a)['send'](_0x5d86b4);};}exports[_0x650d('0x36')]=function(_0x577237,_0x42101c){var _0x34a833={},_0x5d81ac={},_0x5dfa5c={'count':0x0,'rows':[]};var _0x2966a5=_[_0x650d('0x37')](db[_0x650d('0x38')]['rawAttributes'],function(_0x2471cc){return{'name':_0x2471cc['fieldName'],'type':_0x2471cc[_0x650d('0x39')][_0x650d('0x3a')]};});_0x5d81ac[_0x650d('0x3b')]=_[_0x650d('0x37')](_0x2966a5,'name');_0x5d81ac[_0x650d('0x3c')]=_[_0x650d('0x3d')](_0x577237['query']);_0x5d81ac[_0x650d('0x3e')]=_['intersection'](_0x5d81ac['model'],_0x5d81ac[_0x650d('0x3c')]);_0x34a833[_0x650d('0x3f')]=_[_0x650d('0x40')](_0x5d81ac['model'],qs['fields'](_0x577237[_0x650d('0x3c')][_0x650d('0x41')]));_0x34a833[_0x650d('0x3f')]=_0x34a833['attributes']['length']?_0x34a833[_0x650d('0x3f')]:_0x5d81ac[_0x650d('0x3b')];if(!_0x577237[_0x650d('0x3c')]['hasOwnProperty'](_0x650d('0x42'))){_0x34a833[_0x650d('0x2d')]=qs['limit'](_0x577237[_0x650d('0x3c')][_0x650d('0x2d')]);_0x34a833[_0x650d('0x2c')]=qs[_0x650d('0x2c')](_0x577237[_0x650d('0x3c')][_0x650d('0x2c')]);}_0x34a833[_0x650d('0x43')]=qs[_0x650d('0x44')](_0x577237['query']['sort']);_0x34a833['where']=qs[_0x650d('0x3e')](_[_0x650d('0x45')](_0x577237[_0x650d('0x3c')],_0x5d81ac['filters']),_0x2966a5);if(_0x577237[_0x650d('0x3c')]['filter']){_0x34a833[_0x650d('0x46')]=_['merge'](_0x34a833['where'],{'$or':_['map'](_0x2966a5,function(_0x524260){if(_0x524260[_0x650d('0x39')]!==_0x650d('0x47')){var _0x5de4db={};_0x5de4db[_0x524260[_0x650d('0x35')]]={'$like':'%'+_0x577237[_0x650d('0x3c')]['filter']+'%'};return _0x5de4db;}})});}_0x34a833=_[_0x650d('0x48')]({},_0x34a833,_0x577237[_0x650d('0x49')]);var _0x4b758c={'where':_0x34a833[_0x650d('0x46')]};return db[_0x650d('0x38')]['count'](_0x4b758c)[_0x650d('0x1e')](function(_0x34d85e){_0x5dfa5c[_0x650d('0x2b')]=_0x34d85e;if(_0x577237[_0x650d('0x3c')][_0x650d('0x4a')]){_0x34a833[_0x650d('0x4b')]=[{'all':!![]}];}return db[_0x650d('0x38')][_0x650d('0x4c')](_0x34a833);})[_0x650d('0x1e')](function(_0x4af620){_0x5dfa5c[_0x650d('0x4d')]=_0x4af620;return _0x5dfa5c;})[_0x650d('0x1e')](respondWithFilteredResult(_0x42101c,_0x34a833))[_0x650d('0x4e')](handleError(_0x42101c,null));};exports[_0x650d('0x4f')]=function(_0x51f600,_0x277747){var _0x3fdeec={'raw':![],'where':{'id':_0x51f600[_0x650d('0x50')]['id']}},_0x361250={};_0x361250[_0x650d('0x3b')]=_['keys'](db[_0x650d('0x38')]['rawAttributes']);_0x361250['query']=_[_0x650d('0x3d')](_0x51f600[_0x650d('0x3c')]);_0x361250[_0x650d('0x3e')]=_[_0x650d('0x40')](_0x361250[_0x650d('0x3b')],_0x361250[_0x650d('0x3c')]);_0x3fdeec['attributes']=_[_0x650d('0x40')](_0x361250[_0x650d('0x3b')],qs['fields'](_0x51f600[_0x650d('0x3c')][_0x650d('0x41')]));_0x3fdeec[_0x650d('0x3f')]=_0x3fdeec[_0x650d('0x3f')][_0x650d('0x51')]?_0x3fdeec[_0x650d('0x3f')]:_0x361250[_0x650d('0x3b')];if(_0x51f600['query'][_0x650d('0x4a')]){_0x3fdeec[_0x650d('0x4b')]=[{'all':!![]}];}_0x3fdeec=_[_0x650d('0x48')]({},_0x3fdeec,_0x51f600['options']);return db[_0x650d('0x38')][_0x650d('0x52')](_0x3fdeec)[_0x650d('0x1e')](handleEntityNotFound(_0x277747,null))[_0x650d('0x1e')](respondWithResult(_0x277747,null))[_0x650d('0x4e')](handleError(_0x277747,null));};exports[_0x650d('0x53')]=function(_0x322de7,_0x74ae28){return db[_0x650d('0x38')]['create'](_0x322de7[_0x650d('0x54')],{})['then'](respondWithResult(_0x74ae28,0xc9))[_0x650d('0x4e')](handleError(_0x74ae28,null));};exports['update']=function(_0x5be53b,_0x42484b){if(_0x5be53b[_0x650d('0x54')]['id']){delete _0x5be53b['body']['id'];}return db[_0x650d('0x38')][_0x650d('0x52')]({'where':{'id':_0x5be53b[_0x650d('0x50')]['id']}})[_0x650d('0x1e')](handleEntityNotFound(_0x42484b,null))[_0x650d('0x1e')](saveUpdates(_0x5be53b[_0x650d('0x54')],null))[_0x650d('0x1e')](respondWithResult(_0x42484b,null))['catch'](handleError(_0x42484b,null));};exports[_0x650d('0x33')]=function(_0x3627dd,_0x459e32){return db[_0x650d('0x38')]['find']({'where':{'id':_0x3627dd[_0x650d('0x50')]['id']}})[_0x650d('0x1e')](handleEntityNotFound(_0x459e32,null))['then'](removeEntity(_0x459e32,null))[_0x650d('0x4e')](handleError(_0x459e32,null));};exports[_0x650d('0x55')]=function(_0x2ad35c,_0x3afbe6,_0x17d549){var _0x5043d8={};var _0x5e4fd2={};var _0x29f65a;var _0xf92685;return db[_0x650d('0x38')][_0x650d('0x56')]({'where':{'id':_0x2ad35c[_0x650d('0x50')]['id']}})['then'](handleEntityNotFound(_0x3afbe6,null))[_0x650d('0x1e')](function(_0x2ecc5b){if(_0x2ecc5b){_0x29f65a=_0x2ecc5b;_0x5e4fd2[_0x650d('0x3b')]=_[_0x650d('0x3d')](db['Dynamics365Field'][_0x650d('0x57')]);_0x5e4fd2[_0x650d('0x3c')]=_[_0x650d('0x3d')](_0x2ad35c[_0x650d('0x3c')]);_0x5e4fd2[_0x650d('0x3e')]=_[_0x650d('0x40')](_0x5e4fd2['model'],_0x5e4fd2[_0x650d('0x3c')]);_0x5043d8[_0x650d('0x3f')]=_[_0x650d('0x40')](_0x5e4fd2[_0x650d('0x3b')],qs['fields'](_0x2ad35c[_0x650d('0x3c')][_0x650d('0x41')]));_0x5043d8[_0x650d('0x3f')]=_0x5043d8[_0x650d('0x3f')][_0x650d('0x51')]?_0x5043d8[_0x650d('0x3f')]:_0x5e4fd2['model'];_0x5043d8[_0x650d('0x43')]=qs['sort'](_0x2ad35c[_0x650d('0x3c')]['sort']);_0x5043d8['where']=qs[_0x650d('0x3e')](_[_0x650d('0x45')](_0x2ad35c[_0x650d('0x3c')],_0x5e4fd2['filters']));if(_0x2ad35c[_0x650d('0x3c')][_0x650d('0x58')]){_0x5043d8[_0x650d('0x46')]=_[_0x650d('0x48')](_0x5043d8['where'],{'$or':_[_0x650d('0x37')](_0x5043d8['attributes'],function(_0xdef4ce){var _0x11f051={};_0x11f051[_0xdef4ce]={'$like':'%'+_0x2ad35c[_0x650d('0x3c')][_0x650d('0x58')]+'%'};return _0x11f051;})});}_0x5043d8=_[_0x650d('0x48')]({},_0x5043d8,_0x2ad35c[_0x650d('0x49')]);return _0x29f65a['getFields'](_0x5043d8);}})[_0x650d('0x1e')](function(_0x1def35){if(_0x1def35){_0xf92685=_0x1def35[_0x650d('0x51')];if(!_0x2ad35c[_0x650d('0x3c')][_0x650d('0x59')](_0x650d('0x42'))){_0x5043d8[_0x650d('0x2d')]=qs[_0x650d('0x2d')](_0x2ad35c['query'][_0x650d('0x2d')]);_0x5043d8[_0x650d('0x2c')]=qs[_0x650d('0x2c')](_0x2ad35c[_0x650d('0x3c')][_0x650d('0x2c')]);}return _0x29f65a['getFields'](_0x5043d8);}})[_0x650d('0x1e')](function(_0x5bde01){if(_0x5bde01){return _0x5bde01?{'count':_0xf92685,'rows':_0x5bde01}:null;}})[_0x650d('0x1e')](respondWithResult(_0x3afbe6,null))[_0x650d('0x4e')](handleError(_0x3afbe6,null));};exports['getSubjects']=function(_0xb13ddf,_0x337cf2,_0x1d4016){var _0x8886e6={};var _0xb692e1={};var _0xc8a684;var _0xbac172;return db[_0x650d('0x38')][_0x650d('0x56')]({'where':{'id':_0xb13ddf['params']['id']}})[_0x650d('0x1e')](handleEntityNotFound(_0x337cf2,null))[_0x650d('0x1e')](function(_0x48559c){if(_0x48559c){_0xc8a684=_0x48559c;_0xb692e1[_0x650d('0x3b')]=_[_0x650d('0x3d')](db[_0x650d('0x5a')][_0x650d('0x57')]);_0xb692e1['query']=_['keys'](_0xb13ddf['query']);_0xb692e1['filters']=_['intersection'](_0xb692e1[_0x650d('0x3b')],_0xb692e1[_0x650d('0x3c')]);_0x8886e6[_0x650d('0x3f')]=_[_0x650d('0x40')](_0xb692e1[_0x650d('0x3b')],qs[_0x650d('0x41')](_0xb13ddf[_0x650d('0x3c')][_0x650d('0x41')]));_0x8886e6[_0x650d('0x3f')]=_0x8886e6[_0x650d('0x3f')][_0x650d('0x51')]?_0x8886e6[_0x650d('0x3f')]:_0xb692e1[_0x650d('0x3b')];_0x8886e6[_0x650d('0x43')]=qs[_0x650d('0x44')](_0xb13ddf[_0x650d('0x3c')][_0x650d('0x44')]);_0x8886e6[_0x650d('0x46')]=qs['filters'](_['pick'](_0xb13ddf['query'],_0xb692e1[_0x650d('0x3e')]));if(_0xb13ddf[_0x650d('0x3c')][_0x650d('0x58')]){_0x8886e6['where']=_[_0x650d('0x48')](_0x8886e6['where'],{'$or':_[_0x650d('0x37')](_0x8886e6['attributes'],function(_0x5f1707){var _0x382b9b={};_0x382b9b[_0x5f1707]={'$like':'%'+_0xb13ddf[_0x650d('0x3c')][_0x650d('0x58')]+'%'};return _0x382b9b;})});}_0x8886e6=_[_0x650d('0x48')]({},_0x8886e6,_0xb13ddf['options']);return _0xc8a684[_0x650d('0x5b')](_0x8886e6);}})[_0x650d('0x1e')](function(_0x560852){if(_0x560852){_0xbac172=_0x560852[_0x650d('0x51')];if(!_0xb13ddf[_0x650d('0x3c')][_0x650d('0x59')](_0x650d('0x42'))){_0x8886e6['limit']=qs[_0x650d('0x2d')](_0xb13ddf[_0x650d('0x3c')][_0x650d('0x2d')]);_0x8886e6[_0x650d('0x2c')]=qs['offset'](_0xb13ddf[_0x650d('0x3c')]['offset']);}return _0xc8a684[_0x650d('0x5b')](_0x8886e6);}})[_0x650d('0x1e')](function(_0x4094cc){if(_0x4094cc){return _0x4094cc?{'count':_0xbac172,'rows':_0x4094cc}:null;}})[_0x650d('0x1e')](respondWithResult(_0x337cf2,null))[_0x650d('0x4e')](handleError(_0x337cf2,null));};exports[_0x650d('0x5c')]=function(_0x4daad,_0x4ca822,_0x56e296){var _0x55a86e={};var _0x7f6b86={};var _0x1bf546;var _0x459baf;return db[_0x650d('0x38')]['findOne']({'where':{'id':_0x4daad[_0x650d('0x50')]['id']}})[_0x650d('0x1e')](handleEntityNotFound(_0x4ca822,null))[_0x650d('0x1e')](function(_0x2255c7){if(_0x2255c7){_0x1bf546=_0x2255c7;_0x7f6b86[_0x650d('0x3b')]=_['keys'](db[_0x650d('0x5a')][_0x650d('0x57')]);_0x7f6b86[_0x650d('0x3c')]=_['keys'](_0x4daad['query']);_0x7f6b86[_0x650d('0x3e')]=_[_0x650d('0x40')](_0x7f6b86[_0x650d('0x3b')],_0x7f6b86[_0x650d('0x3c')]);_0x55a86e[_0x650d('0x3f')]=_[_0x650d('0x40')](_0x7f6b86[_0x650d('0x3b')],qs['fields'](_0x4daad[_0x650d('0x3c')][_0x650d('0x41')]));_0x55a86e[_0x650d('0x3f')]=_0x55a86e[_0x650d('0x3f')][_0x650d('0x51')]?_0x55a86e[_0x650d('0x3f')]:_0x7f6b86[_0x650d('0x3b')];_0x55a86e[_0x650d('0x43')]=qs[_0x650d('0x44')](_0x4daad['query'][_0x650d('0x44')]);_0x55a86e[_0x650d('0x46')]=qs[_0x650d('0x3e')](_[_0x650d('0x45')](_0x4daad['query'],_0x7f6b86[_0x650d('0x3e')]));if(_0x4daad[_0x650d('0x3c')][_0x650d('0x58')]){_0x55a86e[_0x650d('0x46')]=_[_0x650d('0x48')](_0x55a86e[_0x650d('0x46')],{'$or':_['map'](_0x55a86e['attributes'],function(_0x35c8c9){var _0x5cacbe={};_0x5cacbe[_0x35c8c9]={'$like':'%'+_0x4daad['query'][_0x650d('0x58')]+'%'};return _0x5cacbe;})});}_0x55a86e=_[_0x650d('0x48')]({},_0x55a86e,_0x4daad[_0x650d('0x49')]);return _0x1bf546[_0x650d('0x5c')](_0x55a86e);}})[_0x650d('0x1e')](function(_0xf620a){if(_0xf620a){_0x459baf=_0xf620a['length'];if(!_0x4daad['query'][_0x650d('0x59')]('nolimit')){_0x55a86e['limit']=qs[_0x650d('0x2d')](_0x4daad[_0x650d('0x3c')][_0x650d('0x2d')]);_0x55a86e[_0x650d('0x2c')]=qs[_0x650d('0x2c')](_0x4daad['query']['offset']);}return _0x1bf546[_0x650d('0x5c')](_0x55a86e);}})[_0x650d('0x1e')](function(_0xb3ae21){if(_0xb3ae21){return _0xb3ae21?{'count':_0x459baf,'rows':_0xb3ae21}:null;}})[_0x650d('0x1e')](respondWithResult(_0x4ca822,null))[_0x650d('0x4e')](handleError(_0x4ca822,null));};
\ No newline at end of file
+var _0x131d=['count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','filter','where','VIRTUAL','merge','options','Dynamics365Configuration','includeAll','include','findAll','rows','rawAttributes','create','body','find','params','getFields','findOne','order','pick','hasOwnProperty','getSubjects','Dynamics365Field','length','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','ValidationError','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','status','json'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x131d,0x1ae));var _0xd131=function(_0x27db84,_0x553123){_0x27db84=_0x27db84-0x0;var _0x265129=_0x131d[_0x27db84];return _0x265129;};'use strict';var pdf=require(_0xd131('0x0'));var emlformat=require(_0xd131('0x1'));var rimraf=require(_0xd131('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd131('0x3'));var rp=require(_0xd131('0x4'));var moment=require(_0xd131('0x5'));var BPromise=require(_0xd131('0x6'));var Mustache=require(_0xd131('0x7'));var util=require(_0xd131('0x8'));var path=require('path');var sox=require(_0xd131('0x9'));var csv=require(_0xd131('0xa'));var ejs=require(_0xd131('0xb'));var fs=require('fs');var _=require(_0xd131('0xc'));var squel=require('squel');var crypto=require(_0xd131('0xd'));var jsforce=require(_0xd131('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd131('0xf'));var Papa=require('papaparse');var Redis=require(_0xd131('0x10'));var authService=require(_0xd131('0x11'));var qs=require(_0xd131('0x12'));var as=require(_0xd131('0x13'));var hardwareService=require(_0xd131('0x14'));var logger=require(_0xd131('0x15'))(_0xd131('0x16'));var utils=require(_0xd131('0x17'));var config=require('../../config/environment');var db=require(_0xd131('0x18'))['db'];var jayson=require(_0xd131('0x19'));var client=jayson[_0xd131('0x1a')][_0xd131('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x137ad5,_0x1d70ad,_0x509ca8){if(_0x509ca8){var _0x4af256=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4af256[_0xd131('0x1c')](_0x1d70ad)){return _0x137ad5;}else{throw new db['Sequelize'][(_0xd131('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x137ad5;}}function respondWithRpcPromise(_0x1724e1,_0x265905,_0x5739e5,_0x37dcaf){return new BPromise(function(_0xb11a40,_0x486c35){var _0xa7e726=_0x37dcaf||client;return _0xa7e726[_0xd131('0x1e')](_0x1724e1,_0x5739e5)[_0xd131('0x1f')](function(_0x22203d){logger[_0xd131('0x20')](_0xd131('0x21'),_0x265905,_0xd131('0x22'));logger[_0xd131('0x23')](_0xd131('0x24'),_0x265905,_0xd131('0x22'),JSON['stringify'](_0x22203d));if(_0x22203d[_0xd131('0x25')]){if(_0x22203d[_0xd131('0x25')][_0xd131('0x26')]===0x1f4){logger[_0xd131('0x25')]('Dynamics365Configuration,\x20%s,\x20%s',_0x265905,_0x22203d[_0xd131('0x25')][_0xd131('0x27')]);return _0x486c35(_0x22203d[_0xd131('0x25')][_0xd131('0x27')]);}logger[_0xd131('0x25')](_0xd131('0x21'),_0x265905,_0x22203d[_0xd131('0x25')]['message']);return _0xb11a40(_0x22203d['error'][_0xd131('0x27')]);}else{logger['info'](_0xd131('0x21'),_0x265905,_0xd131('0x22'));_0xb11a40(_0x22203d['result'][_0xd131('0x27')]);}})[_0xd131('0x28')](function(_0x12c6e9){logger[_0xd131('0x25')](_0xd131('0x21'),_0x265905,_0x12c6e9);_0x486c35(_0x12c6e9);});});}function respondWithStatusCode(_0x49fdd7,_0xd4b1a5){_0xd4b1a5=_0xd4b1a5||0xcc;return function(_0x319470){if(_0x319470){return _0x49fdd7[_0xd131('0x29')](_0xd4b1a5);}return _0x49fdd7['status'](_0xd4b1a5)[_0xd131('0x2a')]();};}function respondWithResult(_0x27d5b9,_0x243002){_0x243002=_0x243002||0xc8;return function(_0x19d826){if(_0x19d826){return _0x27d5b9[_0xd131('0x2b')](_0x243002)[_0xd131('0x2c')](_0x19d826);}};}function respondWithFilteredResult(_0x183f78,_0x5dce96){return function(_0x3724f4){if(_0x3724f4){var _0x27a41b=_0x3724f4[_0xd131('0x2d')],_0x18fe52=_0x5dce96['offset'],_0x2de389=_0x5dce96[_0xd131('0x2e')]+_0x5dce96[_0xd131('0x2f')],_0x15255f;if(_0x2de389>=_0x27a41b){_0x2de389=_0x27a41b;_0x15255f=0xc8;}else{_0x15255f=0xce;}_0x183f78[_0xd131('0x2b')](_0x15255f);return _0x183f78[_0xd131('0x30')](_0xd131('0x31'),_0x18fe52+'-'+_0x2de389+'/'+_0x27a41b)[_0xd131('0x2c')](_0x3724f4);}return null;};}function patchUpdates(_0x281445){return function(_0x4282f1){try{jsonpatch['apply'](_0x4282f1,_0x281445,!![]);}catch(_0x5239b1){return BPromise[_0xd131('0x32')](_0x5239b1);}return _0x4282f1[_0xd131('0x33')]();};}function saveUpdates(_0x3c2bd9,_0x3fdaae){return function(_0xb7933e){if(_0xb7933e){return _0xb7933e[_0xd131('0x34')](_0x3c2bd9)[_0xd131('0x1f')](function(_0x330043){return _0x330043;});}return null;};}function removeEntity(_0x1ef35c,_0x15d1cb){return function(_0x406f79){if(_0x406f79){return _0x406f79[_0xd131('0x35')]()['then'](function(){_0x1ef35c[_0xd131('0x2b')](0xcc)[_0xd131('0x2a')]();});}};}function handleEntityNotFound(_0x1025b2,_0x1253b1){return function(_0x248640){if(!_0x248640){_0x1025b2[_0xd131('0x29')](0x194);}return _0x248640;};}function handleError(_0x10170a,_0x7c3af1){_0x7c3af1=_0x7c3af1||0x1f4;return function(_0x48422c){logger['error'](_0x48422c[_0xd131('0x36')]);if(_0x48422c[_0xd131('0x37')]){delete _0x48422c[_0xd131('0x37')];}_0x10170a[_0xd131('0x2b')](_0x7c3af1)[_0xd131('0x38')](_0x48422c);};}exports[_0xd131('0x39')]=function(_0x339cd4,_0x48b779){var _0x15167d={},_0x4b7772={},_0x67d71d={'count':0x0,'rows':[]};var _0x4e12f0=_[_0xd131('0x3a')](db['Dynamics365Configuration']['rawAttributes'],function(_0x280e54){return{'name':_0x280e54[_0xd131('0x3b')],'type':_0x280e54[_0xd131('0x3c')][_0xd131('0x3d')]};});_0x4b7772[_0xd131('0x3e')]=_[_0xd131('0x3a')](_0x4e12f0,_0xd131('0x37'));_0x4b7772[_0xd131('0x3f')]=_[_0xd131('0x40')](_0x339cd4[_0xd131('0x3f')]);_0x4b7772[_0xd131('0x41')]=_[_0xd131('0x42')](_0x4b7772[_0xd131('0x3e')],_0x4b7772[_0xd131('0x3f')]);_0x15167d['attributes']=_[_0xd131('0x42')](_0x4b7772[_0xd131('0x3e')],qs['fields'](_0x339cd4['query'][_0xd131('0x43')]));_0x15167d[_0xd131('0x44')]=_0x15167d[_0xd131('0x44')]['length']?_0x15167d['attributes']:_0x4b7772['model'];if(!_0x339cd4['query']['hasOwnProperty'](_0xd131('0x45'))){_0x15167d['limit']=qs['limit'](_0x339cd4[_0xd131('0x3f')][_0xd131('0x2f')]);_0x15167d['offset']=qs[_0xd131('0x2e')](_0x339cd4[_0xd131('0x3f')][_0xd131('0x2e')]);}_0x15167d['order']=qs['sort'](_0x339cd4['query'][_0xd131('0x46')]);_0x15167d['where']=qs['filters'](_['pick'](_0x339cd4[_0xd131('0x3f')],_0x4b7772[_0xd131('0x41')]),_0x4e12f0);if(_0x339cd4[_0xd131('0x3f')][_0xd131('0x47')]){_0x15167d[_0xd131('0x48')]=_['merge'](_0x15167d[_0xd131('0x48')],{'$or':_[_0xd131('0x3a')](_0x4e12f0,function(_0xe2a0e4){if(_0xe2a0e4[_0xd131('0x3c')]!==_0xd131('0x49')){var _0x48b5cf={};_0x48b5cf[_0xe2a0e4[_0xd131('0x37')]]={'$like':'%'+_0x339cd4[_0xd131('0x3f')]['filter']+'%'};return _0x48b5cf;}})});}_0x15167d=_[_0xd131('0x4a')]({},_0x15167d,_0x339cd4[_0xd131('0x4b')]);var _0x55d6cc={'where':_0x15167d[_0xd131('0x48')]};return db[_0xd131('0x4c')]['count'](_0x55d6cc)['then'](function(_0x347741){_0x67d71d[_0xd131('0x2d')]=_0x347741;if(_0x339cd4[_0xd131('0x3f')][_0xd131('0x4d')]){_0x15167d[_0xd131('0x4e')]=[{'all':!![]}];}return db[_0xd131('0x4c')][_0xd131('0x4f')](_0x15167d);})[_0xd131('0x1f')](function(_0x1d68f3){_0x67d71d[_0xd131('0x50')]=_0x1d68f3;return _0x67d71d;})['then'](respondWithFilteredResult(_0x48b779,_0x15167d))[_0xd131('0x28')](handleError(_0x48b779,null));};exports['show']=function(_0x22da98,_0x4950a5){var _0x1ee641={'raw':![],'where':{'id':_0x22da98['params']['id']}},_0x543943={};_0x543943[_0xd131('0x3e')]=_[_0xd131('0x40')](db[_0xd131('0x4c')][_0xd131('0x51')]);_0x543943[_0xd131('0x3f')]=_[_0xd131('0x40')](_0x22da98['query']);_0x543943['filters']=_[_0xd131('0x42')](_0x543943[_0xd131('0x3e')],_0x543943['query']);_0x1ee641['attributes']=_[_0xd131('0x42')](_0x543943[_0xd131('0x3e')],qs[_0xd131('0x43')](_0x22da98[_0xd131('0x3f')][_0xd131('0x43')]));_0x1ee641['attributes']=_0x1ee641[_0xd131('0x44')]['length']?_0x1ee641[_0xd131('0x44')]:_0x543943[_0xd131('0x3e')];if(_0x22da98['query'][_0xd131('0x4d')]){_0x1ee641['include']=[{'all':!![]}];}_0x1ee641=_[_0xd131('0x4a')]({},_0x1ee641,_0x22da98[_0xd131('0x4b')]);return db['Dynamics365Configuration']['find'](_0x1ee641)[_0xd131('0x1f')](handleEntityNotFound(_0x4950a5,null))['then'](respondWithResult(_0x4950a5,null))[_0xd131('0x28')](handleError(_0x4950a5,null));};exports[_0xd131('0x52')]=function(_0xa1f97,_0x4763f5){return db[_0xd131('0x4c')][_0xd131('0x52')](_0xa1f97[_0xd131('0x53')],{})[_0xd131('0x1f')](respondWithResult(_0x4763f5,0xc9))['catch'](handleError(_0x4763f5,null));};exports['update']=function(_0xb63528,_0x3662f2){if(_0xb63528[_0xd131('0x53')]['id']){delete _0xb63528[_0xd131('0x53')]['id'];}return db[_0xd131('0x4c')][_0xd131('0x54')]({'where':{'id':_0xb63528[_0xd131('0x55')]['id']}})[_0xd131('0x1f')](handleEntityNotFound(_0x3662f2,null))[_0xd131('0x1f')](saveUpdates(_0xb63528[_0xd131('0x53')],null))[_0xd131('0x1f')](respondWithResult(_0x3662f2,null))[_0xd131('0x28')](handleError(_0x3662f2,null));};exports[_0xd131('0x35')]=function(_0x4089a3,_0x3d27f1){return db[_0xd131('0x4c')]['find']({'where':{'id':_0x4089a3[_0xd131('0x55')]['id']}})[_0xd131('0x1f')](handleEntityNotFound(_0x3d27f1,null))[_0xd131('0x1f')](removeEntity(_0x3d27f1,null))['catch'](handleError(_0x3d27f1,null));};exports[_0xd131('0x56')]=function(_0x21da39,_0x1cede9,_0x59d6fc){var _0x12a49a={};var _0x5e0183={};var _0x1e34d6;var _0x479ece;return db['Dynamics365Configuration'][_0xd131('0x57')]({'where':{'id':_0x21da39[_0xd131('0x55')]['id']}})[_0xd131('0x1f')](handleEntityNotFound(_0x1cede9,null))['then'](function(_0x4fdff7){if(_0x4fdff7){_0x1e34d6=_0x4fdff7;_0x5e0183['model']=_[_0xd131('0x40')](db['Dynamics365Field'][_0xd131('0x51')]);_0x5e0183[_0xd131('0x3f')]=_[_0xd131('0x40')](_0x21da39[_0xd131('0x3f')]);_0x5e0183['filters']=_[_0xd131('0x42')](_0x5e0183[_0xd131('0x3e')],_0x5e0183[_0xd131('0x3f')]);_0x12a49a[_0xd131('0x44')]=_[_0xd131('0x42')](_0x5e0183[_0xd131('0x3e')],qs[_0xd131('0x43')](_0x21da39[_0xd131('0x3f')]['fields']));_0x12a49a[_0xd131('0x44')]=_0x12a49a['attributes']['length']?_0x12a49a['attributes']:_0x5e0183['model'];_0x12a49a[_0xd131('0x58')]=qs['sort'](_0x21da39[_0xd131('0x3f')]['sort']);_0x12a49a[_0xd131('0x48')]=qs[_0xd131('0x41')](_[_0xd131('0x59')](_0x21da39[_0xd131('0x3f')],_0x5e0183[_0xd131('0x41')]));if(_0x21da39[_0xd131('0x3f')][_0xd131('0x47')]){_0x12a49a[_0xd131('0x48')]=_[_0xd131('0x4a')](_0x12a49a[_0xd131('0x48')],{'$or':_[_0xd131('0x3a')](_0x12a49a[_0xd131('0x44')],function(_0x353024){var _0x4cfc84={};_0x4cfc84[_0x353024]={'$like':'%'+_0x21da39[_0xd131('0x3f')][_0xd131('0x47')]+'%'};return _0x4cfc84;})});}_0x12a49a=_[_0xd131('0x4a')]({},_0x12a49a,_0x21da39[_0xd131('0x4b')]);return _0x1e34d6['getFields'](_0x12a49a);}})[_0xd131('0x1f')](function(_0xa336db){if(_0xa336db){_0x479ece=_0xa336db['length'];if(!_0x21da39[_0xd131('0x3f')][_0xd131('0x5a')](_0xd131('0x45'))){_0x12a49a[_0xd131('0x2f')]=qs['limit'](_0x21da39[_0xd131('0x3f')][_0xd131('0x2f')]);_0x12a49a[_0xd131('0x2e')]=qs[_0xd131('0x2e')](_0x21da39[_0xd131('0x3f')][_0xd131('0x2e')]);}return _0x1e34d6[_0xd131('0x56')](_0x12a49a);}})[_0xd131('0x1f')](function(_0x3d8866){if(_0x3d8866){return _0x3d8866?{'count':_0x479ece,'rows':_0x3d8866}:null;}})['then'](respondWithResult(_0x1cede9,null))[_0xd131('0x28')](handleError(_0x1cede9,null));};exports[_0xd131('0x5b')]=function(_0x1e4ab9,_0x421616,_0x2f5336){var _0x2163da={};var _0x2715f0={};var _0x45e997;var _0x21ad13;return db[_0xd131('0x4c')][_0xd131('0x57')]({'where':{'id':_0x1e4ab9[_0xd131('0x55')]['id']}})['then'](handleEntityNotFound(_0x421616,null))[_0xd131('0x1f')](function(_0x302cc5){if(_0x302cc5){_0x45e997=_0x302cc5;_0x2715f0[_0xd131('0x3e')]=_[_0xd131('0x40')](db[_0xd131('0x5c')]['rawAttributes']);_0x2715f0[_0xd131('0x3f')]=_[_0xd131('0x40')](_0x1e4ab9[_0xd131('0x3f')]);_0x2715f0[_0xd131('0x41')]=_[_0xd131('0x42')](_0x2715f0[_0xd131('0x3e')],_0x2715f0['query']);_0x2163da[_0xd131('0x44')]=_[_0xd131('0x42')](_0x2715f0[_0xd131('0x3e')],qs[_0xd131('0x43')](_0x1e4ab9[_0xd131('0x3f')][_0xd131('0x43')]));_0x2163da['attributes']=_0x2163da['attributes'][_0xd131('0x5d')]?_0x2163da[_0xd131('0x44')]:_0x2715f0[_0xd131('0x3e')];_0x2163da[_0xd131('0x58')]=qs[_0xd131('0x46')](_0x1e4ab9[_0xd131('0x3f')][_0xd131('0x46')]);_0x2163da[_0xd131('0x48')]=qs[_0xd131('0x41')](_[_0xd131('0x59')](_0x1e4ab9['query'],_0x2715f0['filters']));if(_0x1e4ab9['query'][_0xd131('0x47')]){_0x2163da[_0xd131('0x48')]=_[_0xd131('0x4a')](_0x2163da[_0xd131('0x48')],{'$or':_[_0xd131('0x3a')](_0x2163da[_0xd131('0x44')],function(_0x4bf1f8){var _0x4c9260={};_0x4c9260[_0x4bf1f8]={'$like':'%'+_0x1e4ab9['query']['filter']+'%'};return _0x4c9260;})});}_0x2163da=_[_0xd131('0x4a')]({},_0x2163da,_0x1e4ab9['options']);return _0x45e997[_0xd131('0x5b')](_0x2163da);}})[_0xd131('0x1f')](function(_0x4e2c02){if(_0x4e2c02){_0x21ad13=_0x4e2c02[_0xd131('0x5d')];if(!_0x1e4ab9[_0xd131('0x3f')]['hasOwnProperty']('nolimit')){_0x2163da['limit']=qs[_0xd131('0x2f')](_0x1e4ab9[_0xd131('0x3f')][_0xd131('0x2f')]);_0x2163da[_0xd131('0x2e')]=qs['offset'](_0x1e4ab9[_0xd131('0x3f')][_0xd131('0x2e')]);}return _0x45e997[_0xd131('0x5b')](_0x2163da);}})[_0xd131('0x1f')](function(_0x4d5e62){if(_0x4d5e62){return _0x4d5e62?{'count':_0x21ad13,'rows':_0x4d5e62}:null;}})[_0xd131('0x1f')](respondWithResult(_0x421616,null))['catch'](handleError(_0x421616,null));};exports[_0xd131('0x5e')]=function(_0x2018c1,_0x234178,_0xd6a146){var _0x397cc3={};var _0x2d4c99={};var _0x3a3116;var _0x5529c5;return db['Dynamics365Configuration'][_0xd131('0x57')]({'where':{'id':_0x2018c1[_0xd131('0x55')]['id']}})[_0xd131('0x1f')](handleEntityNotFound(_0x234178,null))[_0xd131('0x1f')](function(_0x1df2e6){if(_0x1df2e6){_0x3a3116=_0x1df2e6;_0x2d4c99[_0xd131('0x3e')]=_[_0xd131('0x40')](db[_0xd131('0x5c')][_0xd131('0x51')]);_0x2d4c99[_0xd131('0x3f')]=_[_0xd131('0x40')](_0x2018c1[_0xd131('0x3f')]);_0x2d4c99['filters']=_[_0xd131('0x42')](_0x2d4c99[_0xd131('0x3e')],_0x2d4c99[_0xd131('0x3f')]);_0x397cc3[_0xd131('0x44')]=_['intersection'](_0x2d4c99[_0xd131('0x3e')],qs[_0xd131('0x43')](_0x2018c1[_0xd131('0x3f')][_0xd131('0x43')]));_0x397cc3[_0xd131('0x44')]=_0x397cc3[_0xd131('0x44')]['length']?_0x397cc3[_0xd131('0x44')]:_0x2d4c99['model'];_0x397cc3[_0xd131('0x58')]=qs[_0xd131('0x46')](_0x2018c1[_0xd131('0x3f')][_0xd131('0x46')]);_0x397cc3[_0xd131('0x48')]=qs[_0xd131('0x41')](_[_0xd131('0x59')](_0x2018c1[_0xd131('0x3f')],_0x2d4c99['filters']));if(_0x2018c1[_0xd131('0x3f')]['filter']){_0x397cc3[_0xd131('0x48')]=_['merge'](_0x397cc3[_0xd131('0x48')],{'$or':_['map'](_0x397cc3['attributes'],function(_0xc07f21){var _0x4fc2a3={};_0x4fc2a3[_0xc07f21]={'$like':'%'+_0x2018c1[_0xd131('0x3f')][_0xd131('0x47')]+'%'};return _0x4fc2a3;})});}_0x397cc3=_['merge']({},_0x397cc3,_0x2018c1[_0xd131('0x4b')]);return _0x3a3116[_0xd131('0x5e')](_0x397cc3);}})['then'](function(_0xc71fea){if(_0xc71fea){_0x5529c5=_0xc71fea[_0xd131('0x5d')];if(!_0x2018c1[_0xd131('0x3f')][_0xd131('0x5a')]('nolimit')){_0x397cc3[_0xd131('0x2f')]=qs[_0xd131('0x2f')](_0x2018c1[_0xd131('0x3f')][_0xd131('0x2f')]);_0x397cc3[_0xd131('0x2e')]=qs[_0xd131('0x2e')](_0x2018c1[_0xd131('0x3f')][_0xd131('0x2e')]);}return _0x3a3116[_0xd131('0x5e')](_0x397cc3);}})[_0xd131('0x1f')](function(_0xbe7eb5){if(_0xbe7eb5){return _0xbe7eb5?{'count':_0x5529c5,'rows':_0xbe7eb5}:null;}})[_0xd131('0x1f')](respondWithResult(_0x234178,null))['catch'](handleError(_0x234178,null));};
\ No newline at end of file
index b476e9f..81e89e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aed=['bluebird','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','lodash','util','../../config/logger','moment'];(function(_0x12ea96,_0x59e405){var _0x201861=function(_0x1ad830){while(--_0x1ad830){_0x12ea96['push'](_0x12ea96['shift']());}};_0x201861(++_0x59e405);}(_0x8aed,0x193));var _0xd8ae=function(_0x1a9d11,_0x3a0842){_0x1a9d11=_0x1a9d11-0x0;var _0x563f06=_0x8aed[_0x1a9d11];return _0x563f06;};'use strict';var _=require(_0xd8ae('0x0'));var util=require(_0xd8ae('0x1'));var logger=require(_0xd8ae('0x2'))('api');var moment=require(_0xd8ae('0x3'));var BPromise=require(_0xd8ae('0x4'));var rp=require(_0xd8ae('0x5'));var fs=require('fs');var path=require(_0xd8ae('0x6'));var rimraf=require('rimraf');var config=require(_0xd8ae('0x7'));var attributes=require(_0xd8ae('0x8'));module[_0xd8ae('0x9')]=function(_0x4902dd,_0x5cfe3c){return _0x4902dd['define'](_0xd8ae('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd16c=['./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xd16c,0x1b7));var _0xcd16=function(_0x11bb0d,_0x3a85fc){_0x11bb0d=_0x11bb0d-0x0;var _0x18dd81=_0xd16c[_0x11bb0d];return _0x18dd81;};'use strict';var _=require(_0xcd16('0x0'));var util=require(_0xcd16('0x1'));var logger=require(_0xcd16('0x2'))(_0xcd16('0x3'));var moment=require(_0xcd16('0x4'));var BPromise=require(_0xcd16('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd16('0x6'));var rimraf=require(_0xcd16('0x7'));var config=require(_0xcd16('0x8'));var attributes=require(_0xcd16('0x9'));module[_0xcd16('0xa')]=function(_0x40c55d,_0x38b763){return _0x40c55d[_0xcd16('0xb')](_0xcd16('0xc'),attributes,{'tableName':_0xcd16('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 504ad71..e561748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80ee=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x16e0f5,_0x4ec0f3){var _0x4839d5=function(_0x296b8f){while(--_0x296b8f){_0x16e0f5['push'](_0x16e0f5['shift']());}};_0x4839d5(++_0x4ec0f3);}(_0x80ee,0x78));var _0xe80e=function(_0x49684e,_0x9a24fb){_0x49684e=_0x49684e-0x0;var _0x54062f=_0x80ee[_0x49684e];return _0x54062f;};'use strict';var _=require(_0xe80e('0x0'));var util=require(_0xe80e('0x1'));var moment=require(_0xe80e('0x2'));var BPromise=require('bluebird');var rs=require(_0xe80e('0x3'));var fs=require('fs');var Redis=require(_0xe80e('0x4'));var db=require(_0xe80e('0x5'))['db'];var utils=require(_0xe80e('0x6'));var logger=require(_0xe80e('0x7'))('rpc');var config=require(_0xe80e('0x8'));var jayson=require(_0xe80e('0x9'));var client=jayson[_0xe80e('0xa')][_0xe80e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21a318,_0x1d7b5a,_0x17c642){return new BPromise(function(_0x48e7a2,_0x1d7925){return client['request'](_0x21a318,_0x17c642)[_0xe80e('0xc')](function(_0x13f017){logger[_0xe80e('0xd')](_0xe80e('0xe'),_0x1d7b5a,'request\x20sent');logger[_0xe80e('0xf')](_0xe80e('0x10'),_0x1d7b5a,_0xe80e('0x11'),JSON['stringify'](_0x13f017));if(_0x13f017[_0xe80e('0x12')]){if(_0x13f017['error'][_0xe80e('0x13')]===0x1f4){logger[_0xe80e('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1d7b5a,_0x13f017['error'][_0xe80e('0x14')]);return _0x1d7925(_0x13f017['error']['message']);}logger[_0xe80e('0x12')](_0xe80e('0xe'),_0x1d7b5a,_0x13f017[_0xe80e('0x12')][_0xe80e('0x14')]);return _0x48e7a2(_0x13f017[_0xe80e('0x12')][_0xe80e('0x14')]);}else{logger['info'](_0xe80e('0xe'),_0x1d7b5a,_0xe80e('0x11'));_0x48e7a2(_0x13f017[_0xe80e('0x15')]['message']);}})[_0xe80e('0x16')](function(_0x403cd2){logger[_0xe80e('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1d7b5a,_0x403cd2);_0x1d7925(_0x403cd2);});});}
\ No newline at end of file
+var _0x8454=['then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8454,0x1ef));var _0x4845=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8454[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x4845('0x0'));var util=require(_0x4845('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4845('0x2'));var fs=require('fs');var Redis=require(_0x4845('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4845('0x4'));var logger=require(_0x4845('0x5'))(_0x4845('0x6'));var config=require(_0x4845('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4845('0x8')][_0x4845('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25bda5,_0x5deb70,_0xfb54cd){return new BPromise(function(_0x23084f,_0x209ee0){return client[_0x4845('0xa')](_0x25bda5,_0xfb54cd)[_0x4845('0xb')](function(_0x5baa59){logger[_0x4845('0xc')](_0x4845('0xd'),_0x5deb70,_0x4845('0xe'));logger[_0x4845('0xf')](_0x4845('0x10'),_0x5deb70,_0x4845('0xe'),JSON[_0x4845('0x11')](_0x5baa59));if(_0x5baa59[_0x4845('0x12')]){if(_0x5baa59[_0x4845('0x12')][_0x4845('0x13')]===0x1f4){logger['error'](_0x4845('0xd'),_0x5deb70,_0x5baa59[_0x4845('0x12')]['message']);return _0x209ee0(_0x5baa59[_0x4845('0x12')][_0x4845('0x14')]);}logger[_0x4845('0x12')](_0x4845('0xd'),_0x5deb70,_0x5baa59['error'][_0x4845('0x14')]);return _0x23084f(_0x5baa59['error'][_0x4845('0x14')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x5deb70,_0x4845('0xe'));_0x23084f(_0x5baa59[_0x4845('0x15')]['message']);}})[_0x4845('0x16')](function(_0x365f4c){logger[_0x4845('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5deb70,_0x365f4c);_0x209ee0(_0x365f4c);});});}
\ No newline at end of file
index c7c4c82..f7a6413 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete'];(function(_0x103bcc,_0x2dff82){var _0xbcd001=function(_0x46c658){while(--_0x46c658){_0x103bcc['push'](_0x103bcc['shift']());}};_0xbcd001(++_0x2dff82);}(_0xb43b,0xbf));var _0xbb43=function(_0x987817,_0x4fe2d8){_0x987817=_0x987817-0x0;var _0x42524e=_0xb43b[_0x987817];return _0x42524e;};'use strict';var multer=require(_0xbb43('0x0'));var util=require('util');var path=require(_0xbb43('0x1'));var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router[_0xbb43('0x9')]('/',auth[_0xbb43('0xa')](),controller[_0xbb43('0xb')]);router['get'](_0xbb43('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbb43('0xd')]('/',auth[_0xbb43('0xa')](),controller[_0xbb43('0xe')]);router[_0xbb43('0xf')](_0xbb43('0xc'),auth['isAuthenticated'](),controller[_0xbb43('0x10')]);router[_0xbb43('0x11')](_0xbb43('0xc'),auth[_0xbb43('0xa')](),controller['destroy']);module[_0xbb43('0x12')]=router;
\ No newline at end of file
+var _0xac4a=['express','Router','../../config/environment','./intDynamics365Field.controller','get','index','/:id','show','post','put','isAuthenticated','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5f2874,_0x35813a){var _0x21fd08=function(_0x48336e){while(--_0x48336e){_0x5f2874['push'](_0x5f2874['shift']());}};_0x21fd08(++_0x35813a);}(_0xac4a,0x13f));var _0xaac4=function(_0x194dcd,_0x8e529d){_0x194dcd=_0x194dcd-0x0;var _0x3717ca=_0xac4a[_0x194dcd];return _0x3717ca;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaac4('0x6'));var controller=require(_0xaac4('0x7'));router[_0xaac4('0x8')]('/',auth['isAuthenticated'](),controller[_0xaac4('0x9')]);router['get'](_0xaac4('0xa'),auth['isAuthenticated'](),controller[_0xaac4('0xb')]);router[_0xaac4('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xaac4('0xd')]('/:id',auth[_0xaac4('0xe')](),controller['update']);router['delete'](_0xaac4('0xa'),auth[_0xaac4('0xe')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router;
\ No newline at end of file
index 51bd1f9..eab06c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2188=['BOOLEAN','sequelize','string','variable','keyValue','STRING','customVariable'];(function(_0x4bb6b9,_0x5cda80){var _0x536b01=function(_0x12eaab){while(--_0x12eaab){_0x4bb6b9['push'](_0x4bb6b9['shift']());}};_0x536b01(++_0x5cda80);}(_0x2188,0x1d6));var _0x8218=function(_0x324b6e,_0x32078d){_0x324b6e=_0x324b6e-0x0;var _0x33b5dc=_0x2188[_0x324b6e];return _0x33b5dc;};'use strict';var Sequelize=require(_0x8218('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x8218('0x1'),_0x8218('0x2'),'customVariable',_0x8218('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8218('0x4')]},'key':{'type':Sequelize[_0x8218('0x4')]},'keyType':{'type':Sequelize['ENUM']('string',_0x8218('0x2'),_0x8218('0x5'))},'keyContent':{'type':Sequelize[_0x8218('0x4')]},'idField':{'type':Sequelize[_0x8218('0x4')]},'nameField':{'type':Sequelize[_0x8218('0x4')]},'customField':{'type':Sequelize[_0x8218('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8218('0x4')]}};
\ No newline at end of file
+var _0xf440=['variable','customVariable','keyValue','STRING','exports','ENUM','string'];(function(_0x1e8176,_0x250d28){var _0x34a4fc=function(_0x11bbec){while(--_0x11bbec){_0x1e8176['push'](_0x1e8176['shift']());}};_0x34a4fc(++_0x250d28);}(_0xf440,0x1ee));var _0x0f44=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf440[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0x0f44('0x0')]={'type':{'type':Sequelize[_0x0f44('0x1')](_0x0f44('0x2'),_0x0f44('0x3'),_0x0f44('0x4'),_0x0f44('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0f44('0x6')]},'keyType':{'type':Sequelize[_0x0f44('0x1')]('string',_0x0f44('0x3'),_0x0f44('0x4'))},'keyContent':{'type':Sequelize[_0x0f44('0x6')]},'idField':{'type':Sequelize[_0x0f44('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0f44('0x6')]}};
\ No newline at end of file
index 8b2f15d..37e8574 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3422=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','Dynamics365Field','rows','catch','params','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x530810,_0x1fc9ce){var _0x4c293f=function(_0x3767cc){while(--_0x3767cc){_0x530810['push'](_0x530810['shift']());}};_0x4c293f(++_0x1fc9ce);}(_0x3422,0x118));var _0x2342=function(_0x4f9ef1,_0x3cead7){_0x4f9ef1=_0x4f9ef1-0x0;var _0x3d3573=_0x3422[_0x4f9ef1];return _0x3d3573;};'use strict';var pdf=require(_0x2342('0x0'));var emlformat=require(_0x2342('0x1'));var rimraf=require(_0x2342('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2342('0x3'));var rp=require(_0x2342('0x4'));var moment=require('moment');var BPromise=require(_0x2342('0x5'));var Mustache=require('mustache');var util=require(_0x2342('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x2342('0x7'));var ejs=require(_0x2342('0x8'));var fs=require('fs');var _=require(_0x2342('0x9'));var squel=require('squel');var crypto=require(_0x2342('0xa'));var jsforce=require(_0x2342('0xb'));var deskjs=require(_0x2342('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2342('0xd'));var Papa=require(_0x2342('0xe'));var Redis=require(_0x2342('0xf'));var authService=require(_0x2342('0x10'));var qs=require(_0x2342('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2342('0x12'));var logger=require(_0x2342('0x13'))(_0x2342('0x14'));var utils=require(_0x2342('0x15'));var config=require(_0x2342('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1166a4,_0x4d1ff7){_0x4d1ff7=_0x4d1ff7||0xcc;return function(_0x5bac9){if(_0x5bac9){return _0x1166a4[_0x2342('0x17')](_0x4d1ff7);}return _0x1166a4[_0x2342('0x18')](_0x4d1ff7)[_0x2342('0x19')]();};}function respondWithResult(_0x11e71d,_0xfe60d9){_0xfe60d9=_0xfe60d9||0xc8;return function(_0x578242){if(_0x578242){return _0x11e71d[_0x2342('0x18')](_0xfe60d9)['json'](_0x578242);}};}function respondWithFilteredResult(_0xb3d373,_0x4e3b33){return function(_0x558947){if(_0x558947){var _0x346098=_0x558947['count'],_0x70a175=_0x4e3b33['offset'],_0x570fd1=_0x4e3b33[_0x2342('0x1a')]+_0x4e3b33[_0x2342('0x1b')],_0x83337;if(_0x570fd1>=_0x346098){_0x570fd1=_0x346098;_0x83337=0xc8;}else{_0x83337=0xce;}_0xb3d373[_0x2342('0x18')](_0x83337);return _0xb3d373['set']('Content-Range',_0x70a175+'-'+_0x570fd1+'/'+_0x346098)[_0x2342('0x1c')](_0x558947);}return null;};}function patchUpdates(_0x41fed0){return function(_0x57af02){try{jsonpatch[_0x2342('0x1d')](_0x57af02,_0x41fed0,!![]);}catch(_0x583fa3){return BPromise[_0x2342('0x1e')](_0x583fa3);}return _0x57af02[_0x2342('0x1f')]();};}function saveUpdates(_0x379794,_0xe62a4f){return function(_0x553589){if(_0x553589){return _0x553589[_0x2342('0x20')](_0x379794)[_0x2342('0x21')](function(_0x839fa0){return _0x839fa0;});}return null;};}function removeEntity(_0x2f0d82,_0x228164){return function(_0x1fd955){if(_0x1fd955){return _0x1fd955[_0x2342('0x22')]()[_0x2342('0x21')](function(){_0x2f0d82['status'](0xcc)[_0x2342('0x19')]();});}};}function handleEntityNotFound(_0x2cc068,_0x5dacc5){return function(_0x4b76e0){if(!_0x4b76e0){_0x2cc068[_0x2342('0x17')](0x194);}return _0x4b76e0;};}function handleError(_0x4cf9c6,_0xe6a837){_0xe6a837=_0xe6a837||0x1f4;return function(_0xbee717){logger[_0x2342('0x23')](_0xbee717[_0x2342('0x24')]);if(_0xbee717[_0x2342('0x25')]){delete _0xbee717[_0x2342('0x25')];}_0x4cf9c6['status'](_0xe6a837)[_0x2342('0x26')](_0xbee717);};}exports[_0x2342('0x27')]=function(_0xb29497,_0x560bd7){var _0x1ffbd6={},_0x1b5448={},_0x10ed17={'count':0x0,'rows':[]};var _0x52e8e6=_[_0x2342('0x28')](db['Dynamics365Field'][_0x2342('0x29')],function(_0x3aae5f){return{'name':_0x3aae5f[_0x2342('0x2a')],'type':_0x3aae5f[_0x2342('0x2b')][_0x2342('0x2c')]};});_0x1b5448[_0x2342('0x2d')]=_['map'](_0x52e8e6,'name');_0x1b5448[_0x2342('0x2e')]=_[_0x2342('0x2f')](_0xb29497[_0x2342('0x2e')]);_0x1b5448[_0x2342('0x30')]=_[_0x2342('0x31')](_0x1b5448[_0x2342('0x2d')],_0x1b5448['query']);_0x1ffbd6['attributes']=_['intersection'](_0x1b5448['model'],qs[_0x2342('0x32')](_0xb29497['query'][_0x2342('0x32')]));_0x1ffbd6[_0x2342('0x33')]=_0x1ffbd6[_0x2342('0x33')][_0x2342('0x34')]?_0x1ffbd6[_0x2342('0x33')]:_0x1b5448[_0x2342('0x2d')];if(!_0xb29497['query'][_0x2342('0x35')](_0x2342('0x36'))){_0x1ffbd6[_0x2342('0x1b')]=qs[_0x2342('0x1b')](_0xb29497[_0x2342('0x2e')][_0x2342('0x1b')]);_0x1ffbd6[_0x2342('0x1a')]=qs[_0x2342('0x1a')](_0xb29497['query']['offset']);}_0x1ffbd6[_0x2342('0x37')]=qs[_0x2342('0x38')](_0xb29497[_0x2342('0x2e')][_0x2342('0x38')]);_0x1ffbd6[_0x2342('0x39')]=qs[_0x2342('0x30')](_[_0x2342('0x3a')](_0xb29497[_0x2342('0x2e')],_0x1b5448[_0x2342('0x30')]),_0x52e8e6);if(_0xb29497[_0x2342('0x2e')]['filter']){_0x1ffbd6[_0x2342('0x39')]=_[_0x2342('0x3b')](_0x1ffbd6[_0x2342('0x39')],{'$or':_[_0x2342('0x28')](_0x52e8e6,function(_0x159aa5){if(_0x159aa5[_0x2342('0x2b')]!==_0x2342('0x3c')){var _0x3ff7b5={};_0x3ff7b5[_0x159aa5[_0x2342('0x25')]]={'$like':'%'+_0xb29497[_0x2342('0x2e')][_0x2342('0x3d')]+'%'};return _0x3ff7b5;}})});}_0x1ffbd6=_[_0x2342('0x3b')]({},_0x1ffbd6,_0xb29497[_0x2342('0x3e')]);var _0x34af02={'where':_0x1ffbd6[_0x2342('0x39')]};return db['Dynamics365Field'][_0x2342('0x3f')](_0x34af02)[_0x2342('0x21')](function(_0xcc9876){_0x10ed17[_0x2342('0x3f')]=_0xcc9876;if(_0xb29497[_0x2342('0x2e')][_0x2342('0x40')]){_0x1ffbd6[_0x2342('0x41')]=[{'all':!![]}];}return db[_0x2342('0x42')]['findAll'](_0x1ffbd6);})['then'](function(_0x2c9131){_0x10ed17[_0x2342('0x43')]=_0x2c9131;return _0x10ed17;})['then'](respondWithFilteredResult(_0x560bd7,_0x1ffbd6))[_0x2342('0x44')](handleError(_0x560bd7,null));};exports['show']=function(_0x4b0fee,_0x3eeae6){var _0x1139b8={'raw':!![],'where':{'id':_0x4b0fee[_0x2342('0x45')]['id']}},_0x2faccc={};_0x2faccc[_0x2342('0x2d')]=_['keys'](db['Dynamics365Field'][_0x2342('0x29')]);_0x2faccc[_0x2342('0x2e')]=_['keys'](_0x4b0fee[_0x2342('0x2e')]);_0x2faccc['filters']=_['intersection'](_0x2faccc[_0x2342('0x2d')],_0x2faccc[_0x2342('0x2e')]);_0x1139b8['attributes']=_[_0x2342('0x31')](_0x2faccc[_0x2342('0x2d')],qs[_0x2342('0x32')](_0x4b0fee['query'][_0x2342('0x32')]));_0x1139b8[_0x2342('0x33')]=_0x1139b8[_0x2342('0x33')][_0x2342('0x34')]?_0x1139b8['attributes']:_0x2faccc[_0x2342('0x2d')];if(_0x4b0fee[_0x2342('0x2e')][_0x2342('0x40')]){_0x1139b8[_0x2342('0x41')]=[{'all':!![]}];}_0x1139b8=_[_0x2342('0x3b')]({},_0x1139b8,_0x4b0fee['options']);return db[_0x2342('0x42')][_0x2342('0x46')](_0x1139b8)[_0x2342('0x21')](handleEntityNotFound(_0x3eeae6,null))[_0x2342('0x21')](respondWithResult(_0x3eeae6,null))[_0x2342('0x44')](handleError(_0x3eeae6,null));};exports[_0x2342('0x47')]=function(_0x2ff184,_0x1a3cff){return db[_0x2342('0x42')]['create'](_0x2ff184[_0x2342('0x48')],{})[_0x2342('0x21')](respondWithResult(_0x1a3cff,0xc9))[_0x2342('0x44')](handleError(_0x1a3cff,null));};exports['update']=function(_0x578a2a,_0x19ad86){if(_0x578a2a['body']['id']){delete _0x578a2a[_0x2342('0x48')]['id'];}return db[_0x2342('0x42')][_0x2342('0x46')]({'where':{'id':_0x578a2a[_0x2342('0x45')]['id']}})[_0x2342('0x21')](handleEntityNotFound(_0x19ad86,null))['then'](saveUpdates(_0x578a2a[_0x2342('0x48')],null))[_0x2342('0x21')](respondWithResult(_0x19ad86,null))[_0x2342('0x44')](handleError(_0x19ad86,null));};exports[_0x2342('0x22')]=function(_0x382b91,_0x14fa24){return db[_0x2342('0x42')][_0x2342('0x46')]({'where':{'id':_0x382b91[_0x2342('0x45')]['id']}})[_0x2342('0x21')](handleEntityNotFound(_0x14fa24,null))[_0x2342('0x21')](removeEntity(_0x14fa24,null))[_0x2342('0x44')](handleError(_0x14fa24,null));};
\ No newline at end of file
+var _0xd517=['limit','set','json','save','update','then','destroy','end','error','name','send','index','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','type','VIRTUAL','merge','options','Dynamics365Field','include','rows','show','params','includeAll','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count'];(function(_0x560442,_0x5db8fb){var _0xeb9e2f=function(_0x1eb287){while(--_0x1eb287){_0x560442['push'](_0x560442['shift']());}};_0xeb9e2f(++_0x5db8fb);}(_0xd517,0x1dd));var _0x7d51=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0xd517[_0x41cfd4];return _0x190f48;};'use strict';var pdf=require(_0x7d51('0x0'));var emlformat=require(_0x7d51('0x1'));var rimraf=require(_0x7d51('0x2'));var zipdir=require(_0x7d51('0x3'));var jsonpatch=require(_0x7d51('0x4'));var rp=require('request-promise');var moment=require(_0x7d51('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7d51('0x6'));var path=require(_0x7d51('0x7'));var sox=require(_0x7d51('0x8'));var csv=require(_0x7d51('0x9'));var ejs=require(_0x7d51('0xa'));var fs=require('fs');var _=require(_0x7d51('0xb'));var squel=require(_0x7d51('0xc'));var crypto=require(_0x7d51('0xd'));var jsforce=require(_0x7d51('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7d51('0xf'));var Papa=require(_0x7d51('0x10'));var Redis=require(_0x7d51('0x11'));var authService=require(_0x7d51('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d51('0x13'));var logger=require(_0x7d51('0x14'))(_0x7d51('0x15'));var utils=require('../../config/utils');var config=require(_0x7d51('0x16'));var db=require(_0x7d51('0x17'))['db'];function respondWithStatusCode(_0x5635b3,_0x862d23){_0x862d23=_0x862d23||0xcc;return function(_0x4d2446){if(_0x4d2446){return _0x5635b3[_0x7d51('0x18')](_0x862d23);}return _0x5635b3[_0x7d51('0x19')](_0x862d23)['end']();};}function respondWithResult(_0x5c8f6d,_0xdffda4){_0xdffda4=_0xdffda4||0xc8;return function(_0xe77939){if(_0xe77939){return _0x5c8f6d[_0x7d51('0x19')](_0xdffda4)['json'](_0xe77939);}};}function respondWithFilteredResult(_0x516468,_0x305c26){return function(_0x1ea497){if(_0x1ea497){var _0x31c95c=_0x1ea497[_0x7d51('0x1a')],_0x102eb7=_0x305c26['offset'],_0x5c7122=_0x305c26['offset']+_0x305c26[_0x7d51('0x1b')],_0x5c5bda;if(_0x5c7122>=_0x31c95c){_0x5c7122=_0x31c95c;_0x5c5bda=0xc8;}else{_0x5c5bda=0xce;}_0x516468[_0x7d51('0x19')](_0x5c5bda);return _0x516468[_0x7d51('0x1c')]('Content-Range',_0x102eb7+'-'+_0x5c7122+'/'+_0x31c95c)[_0x7d51('0x1d')](_0x1ea497);}return null;};}function patchUpdates(_0x1f0300){return function(_0x71995c){try{jsonpatch['apply'](_0x71995c,_0x1f0300,!![]);}catch(_0x2f3f44){return BPromise['reject'](_0x2f3f44);}return _0x71995c[_0x7d51('0x1e')]();};}function saveUpdates(_0x5523c1,_0x3401f8){return function(_0x401c96){if(_0x401c96){return _0x401c96[_0x7d51('0x1f')](_0x5523c1)[_0x7d51('0x20')](function(_0x3d889e){return _0x3d889e;});}return null;};}function removeEntity(_0xac560,_0x2ebce3){return function(_0x17463e){if(_0x17463e){return _0x17463e[_0x7d51('0x21')]()[_0x7d51('0x20')](function(){_0xac560[_0x7d51('0x19')](0xcc)[_0x7d51('0x22')]();});}};}function handleEntityNotFound(_0x44f118,_0x1e1f8c){return function(_0x24bf87){if(!_0x24bf87){_0x44f118[_0x7d51('0x18')](0x194);}return _0x24bf87;};}function handleError(_0x1e0201,_0x4efca7){_0x4efca7=_0x4efca7||0x1f4;return function(_0x1e739b){logger[_0x7d51('0x23')](_0x1e739b['stack']);if(_0x1e739b[_0x7d51('0x24')]){delete _0x1e739b[_0x7d51('0x24')];}_0x1e0201[_0x7d51('0x19')](_0x4efca7)[_0x7d51('0x25')](_0x1e739b);};}exports[_0x7d51('0x26')]=function(_0x422c64,_0x3da100){var _0x46942b={},_0x3761cc={},_0x356109={'count':0x0,'rows':[]};var _0x51adf6=_['map'](db['Dynamics365Field'][_0x7d51('0x27')],function(_0x3e4b64){return{'name':_0x3e4b64[_0x7d51('0x28')],'type':_0x3e4b64['type'][_0x7d51('0x29')]};});_0x3761cc['model']=_[_0x7d51('0x2a')](_0x51adf6,_0x7d51('0x24'));_0x3761cc[_0x7d51('0x2b')]=_[_0x7d51('0x2c')](_0x422c64[_0x7d51('0x2b')]);_0x3761cc[_0x7d51('0x2d')]=_[_0x7d51('0x2e')](_0x3761cc[_0x7d51('0x2f')],_0x3761cc[_0x7d51('0x2b')]);_0x46942b[_0x7d51('0x30')]=_[_0x7d51('0x2e')](_0x3761cc[_0x7d51('0x2f')],qs[_0x7d51('0x31')](_0x422c64[_0x7d51('0x2b')][_0x7d51('0x31')]));_0x46942b['attributes']=_0x46942b['attributes'][_0x7d51('0x32')]?_0x46942b['attributes']:_0x3761cc[_0x7d51('0x2f')];if(!_0x422c64[_0x7d51('0x2b')][_0x7d51('0x33')]('nolimit')){_0x46942b[_0x7d51('0x1b')]=qs[_0x7d51('0x1b')](_0x422c64[_0x7d51('0x2b')][_0x7d51('0x1b')]);_0x46942b[_0x7d51('0x34')]=qs[_0x7d51('0x34')](_0x422c64['query'][_0x7d51('0x34')]);}_0x46942b[_0x7d51('0x35')]=qs[_0x7d51('0x36')](_0x422c64[_0x7d51('0x2b')]['sort']);_0x46942b[_0x7d51('0x37')]=qs[_0x7d51('0x2d')](_[_0x7d51('0x38')](_0x422c64[_0x7d51('0x2b')],_0x3761cc['filters']),_0x51adf6);if(_0x422c64[_0x7d51('0x2b')][_0x7d51('0x39')]){_0x46942b['where']=_['merge'](_0x46942b[_0x7d51('0x37')],{'$or':_[_0x7d51('0x2a')](_0x51adf6,function(_0x2c4a65){if(_0x2c4a65[_0x7d51('0x3a')]!==_0x7d51('0x3b')){var _0x53198d={};_0x53198d[_0x2c4a65[_0x7d51('0x24')]]={'$like':'%'+_0x422c64[_0x7d51('0x2b')]['filter']+'%'};return _0x53198d;}})});}_0x46942b=_[_0x7d51('0x3c')]({},_0x46942b,_0x422c64[_0x7d51('0x3d')]);var _0x999a48={'where':_0x46942b[_0x7d51('0x37')]};return db[_0x7d51('0x3e')][_0x7d51('0x1a')](_0x999a48)[_0x7d51('0x20')](function(_0x5a2064){_0x356109[_0x7d51('0x1a')]=_0x5a2064;if(_0x422c64[_0x7d51('0x2b')]['includeAll']){_0x46942b[_0x7d51('0x3f')]=[{'all':!![]}];}return db[_0x7d51('0x3e')]['findAll'](_0x46942b);})[_0x7d51('0x20')](function(_0x529df5){_0x356109[_0x7d51('0x40')]=_0x529df5;return _0x356109;})['then'](respondWithFilteredResult(_0x3da100,_0x46942b))['catch'](handleError(_0x3da100,null));};exports[_0x7d51('0x41')]=function(_0x553149,_0x2ad7d7){var _0x3ba4a3={'raw':!![],'where':{'id':_0x553149[_0x7d51('0x42')]['id']}},_0x4cbf89={};_0x4cbf89[_0x7d51('0x2f')]=_['keys'](db['Dynamics365Field'][_0x7d51('0x27')]);_0x4cbf89[_0x7d51('0x2b')]=_['keys'](_0x553149['query']);_0x4cbf89[_0x7d51('0x2d')]=_[_0x7d51('0x2e')](_0x4cbf89[_0x7d51('0x2f')],_0x4cbf89['query']);_0x3ba4a3[_0x7d51('0x30')]=_[_0x7d51('0x2e')](_0x4cbf89[_0x7d51('0x2f')],qs['fields'](_0x553149[_0x7d51('0x2b')][_0x7d51('0x31')]));_0x3ba4a3[_0x7d51('0x30')]=_0x3ba4a3['attributes'][_0x7d51('0x32')]?_0x3ba4a3[_0x7d51('0x30')]:_0x4cbf89[_0x7d51('0x2f')];if(_0x553149[_0x7d51('0x2b')][_0x7d51('0x43')]){_0x3ba4a3[_0x7d51('0x3f')]=[{'all':!![]}];}_0x3ba4a3=_[_0x7d51('0x3c')]({},_0x3ba4a3,_0x553149[_0x7d51('0x3d')]);return db[_0x7d51('0x3e')][_0x7d51('0x44')](_0x3ba4a3)[_0x7d51('0x20')](handleEntityNotFound(_0x2ad7d7,null))[_0x7d51('0x20')](respondWithResult(_0x2ad7d7,null))[_0x7d51('0x45')](handleError(_0x2ad7d7,null));};exports[_0x7d51('0x46')]=function(_0x3b652e,_0x311c23){return db[_0x7d51('0x3e')][_0x7d51('0x46')](_0x3b652e[_0x7d51('0x47')],{})[_0x7d51('0x20')](respondWithResult(_0x311c23,0xc9))[_0x7d51('0x45')](handleError(_0x311c23,null));};exports[_0x7d51('0x1f')]=function(_0x52969d,_0x13acf0){if(_0x52969d[_0x7d51('0x47')]['id']){delete _0x52969d[_0x7d51('0x47')]['id'];}return db[_0x7d51('0x3e')][_0x7d51('0x44')]({'where':{'id':_0x52969d[_0x7d51('0x42')]['id']}})['then'](handleEntityNotFound(_0x13acf0,null))[_0x7d51('0x20')](saveUpdates(_0x52969d['body'],null))['then'](respondWithResult(_0x13acf0,null))[_0x7d51('0x45')](handleError(_0x13acf0,null));};exports[_0x7d51('0x21')]=function(_0x56df8e,_0x4db475){return db[_0x7d51('0x3e')][_0x7d51('0x44')]({'where':{'id':_0x56df8e[_0x7d51('0x42')]['id']}})[_0x7d51('0x20')](handleEntityNotFound(_0x4db475,null))[_0x7d51('0x20')](removeEntity(_0x4db475,null))['catch'](handleError(_0x4db475,null));};
\ No newline at end of file
index 5039db1..b5e2737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66d8=['idField','FieldId','lodash','util','../../config/logger','moment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x28fe98,_0x36592a){var _0x3b482d=function(_0x30405c){while(--_0x30405c){_0x28fe98['push'](_0x28fe98['shift']());}};_0x3b482d(++_0x36592a);}(_0x66d8,0x178));var _0x866d=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x66d8[_0x28611e];return _0x530f69;};'use strict';var _=require(_0x866d('0x0'));var util=require(_0x866d('0x1'));var logger=require(_0x866d('0x2'))('api');var moment=require(_0x866d('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('./intDynamics365Field.attributes');module[_0x866d('0x4')]=function(_0x3afb06,_0x2d7b61){return _0x3afb06[_0x866d('0x5')](_0x866d('0x6'),attributes,{'tableName':_0x866d('0x7'),'paranoid':![],'indexes':[{'name':_0x866d('0x8'),'fields':[_0x866d('0x9'),_0x866d('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2f1f=['moment','bluebird','path','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x5b0468,_0x4a06c8){var _0x429a3d=function(_0x153330){while(--_0x153330){_0x5b0468['push'](_0x5b0468['shift']());}};_0x429a3d(++_0x4a06c8);}(_0x2f1f,0x1e7));var _0xf2f1=function(_0x542d27,_0x4f34af){_0x542d27=_0x542d27-0x0;var _0x24b03c=_0x2f1f[_0x542d27];return _0x24b03c;};'use strict';var _=require(_0xf2f1('0x0'));var util=require(_0xf2f1('0x1'));var logger=require(_0xf2f1('0x2'))('api');var moment=require(_0xf2f1('0x3'));var BPromise=require(_0xf2f1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2f1('0x5'));var rimraf=require(_0xf2f1('0x6'));var config=require('../../config/environment');var attributes=require(_0xf2f1('0x7'));module[_0xf2f1('0x8')]=function(_0x18671f,_0x4a045b){return _0x18671f[_0xf2f1('0x9')](_0xf2f1('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xf2f1('0xb'),'fields':[_0xf2f1('0xc'),_0xf2f1('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 1f109e1..17b3f97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5496=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x545bea,_0x10927b){var _0x5d3cfc=function(_0xc9696){while(--_0xc9696){_0x545bea['push'](_0x545bea['shift']());}};_0x5d3cfc(++_0x10927b);}(_0x5496,0x175));var _0x6549=function(_0x31f9a6,_0x27ac6e){_0x31f9a6=_0x31f9a6-0x0;var _0x4db2b7=_0x5496[_0x31f9a6];return _0x4db2b7;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8cea,_0x4fcffd,_0x1ca8fc){return new BPromise(function(_0x3442c3,_0x1ef2a6){return client['request'](_0x1d8cea,_0x1ca8fc)[_0x6549('0xa')](function(_0x35d008){logger[_0x6549('0xb')](_0x6549('0xc'),_0x4fcffd,_0x6549('0xd'));logger[_0x6549('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x4fcffd,'request\x20sent',JSON[_0x6549('0xf')](_0x35d008));if(_0x35d008[_0x6549('0x10')]){if(_0x35d008[_0x6549('0x10')][_0x6549('0x11')]===0x1f4){logger[_0x6549('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x4fcffd,_0x35d008['error'][_0x6549('0x12')]);return _0x1ef2a6(_0x35d008[_0x6549('0x10')]['message']);}logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);return _0x3442c3(_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x4fcffd,_0x6549('0xd'));_0x3442c3(_0x35d008[_0x6549('0x13')]['message']);}})[_0x6549('0x14')](function(_0x67acc0){logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x67acc0);_0x1ef2a6(_0x67acc0);});});}
\ No newline at end of file
+var _0x9fe7=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x4b18ac,_0x96746b){var _0x28d4ec=function(_0x59f19b){while(--_0x59f19b){_0x4b18ac['push'](_0x4b18ac['shift']());}};_0x28d4ec(++_0x96746b);}(_0x9fe7,0x1df));var _0x79fe=function(_0x5facd7,_0x2bad7a){_0x5facd7=_0x5facd7-0x0;var _0x3d36eb=_0x9fe7[_0x5facd7];return _0x3d36eb;};'use strict';var _=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var moment=require('moment');var BPromise=require(_0x79fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79fe('0x3'));var db=require(_0x79fe('0x4'))['db'];var utils=require(_0x79fe('0x5'));var logger=require('../../config/logger')(_0x79fe('0x6'));var config=require(_0x79fe('0x7'));var jayson=require(_0x79fe('0x8'));var client=jayson['client'][_0x79fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a5aef,_0x2ba246,_0x4c8314){return new BPromise(function(_0x24faa0,_0x264323){return client[_0x79fe('0xa')](_0x2a5aef,_0x4c8314)[_0x79fe('0xb')](function(_0xafc7cd){logger['info'](_0x79fe('0xc'),_0x2ba246,_0x79fe('0xd'));logger['debug'](_0x79fe('0xe'),_0x2ba246,_0x79fe('0xd'),JSON[_0x79fe('0xf')](_0xafc7cd));if(_0xafc7cd[_0x79fe('0x10')]){if(_0xafc7cd['error'][_0x79fe('0x11')]===0x1f4){logger[_0x79fe('0x10')](_0x79fe('0xc'),_0x2ba246,_0xafc7cd[_0x79fe('0x10')][_0x79fe('0x12')]);return _0x264323(_0xafc7cd[_0x79fe('0x10')][_0x79fe('0x12')]);}logger[_0x79fe('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x2ba246,_0xafc7cd[_0x79fe('0x10')][_0x79fe('0x12')]);return _0x24faa0(_0xafc7cd[_0x79fe('0x10')][_0x79fe('0x12')]);}else{logger[_0x79fe('0x13')](_0x79fe('0xc'),_0x2ba246,'request\x20sent');_0x24faa0(_0xafc7cd[_0x79fe('0x14')][_0x79fe('0x12')]);}})[_0x79fe('0x15')](function(_0x5f0af3){logger['error'](_0x79fe('0xc'),_0x2ba246,_0x5f0af3);_0x264323(_0x5f0af3);});});}
\ No newline at end of file
index 0023121..54bebc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9eb=['create','/:id/configurations','addConfiguration','update','delete','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x3fb67d,_0x100c5a){var _0x455b22=function(_0x5b5eb3){while(--_0x5b5eb3){_0x3fb67d['push'](_0x3fb67d['shift']());}};_0x455b22(++_0x100c5a);}(_0xf9eb,0x10e));var _0xbf9e=function(_0x451aa7,_0x192266){_0x451aa7=_0x451aa7-0x0;var _0x1f03c8=_0xf9eb[_0x451aa7];return _0x1f03c8;};'use strict';var multer=require(_0xbf9e('0x0'));var util=require(_0xbf9e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbf9e('0x2'));var router=express[_0xbf9e('0x3')]();var auth=require(_0xbf9e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbf9e('0x5'));var controller=require(_0xbf9e('0x6'));router['get']('/',auth[_0xbf9e('0x7')](),controller[_0xbf9e('0x8')]);router[_0xbf9e('0x9')](_0xbf9e('0xa'),auth[_0xbf9e('0x7')](),controller[_0xbf9e('0xb')]);router[_0xbf9e('0x9')]('/:id/configurations',auth[_0xbf9e('0x7')](),controller[_0xbf9e('0xc')]);router[_0xbf9e('0x9')](_0xbf9e('0xd'),auth[_0xbf9e('0x7')](),controller[_0xbf9e('0xe')]);router[_0xbf9e('0xf')]('/',auth[_0xbf9e('0x7')](),controller[_0xbf9e('0x10')]);router['post'](_0xbf9e('0x11'),auth[_0xbf9e('0x7')](),controller[_0xbf9e('0x12')]);router['put'](_0xbf9e('0xa'),auth['isAuthenticated'](),controller[_0xbf9e('0x13')]);router[_0xbf9e('0x14')](_0xbf9e('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xbf9e('0x15')]=router;
\ No newline at end of file
+var _0xbd84=['getConfigurations','/:id/fields','post','put','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id','show'];(function(_0x50e1fd,_0x58ef4a){var _0x238221=function(_0x1967f5){while(--_0x1967f5){_0x50e1fd['push'](_0x50e1fd['shift']());}};_0x238221(++_0x58ef4a);}(_0xbd84,0x9f));var _0x4bd8=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xbd84[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x4bd8('0x0'));var util=require('util');var path=require(_0x4bd8('0x1'));var timeout=require('connect-timeout');var express=require(_0x4bd8('0x2'));var router=express['Router']();var auth=require(_0x4bd8('0x3'));var interaction=require(_0x4bd8('0x4'));var config=require(_0x4bd8('0x5'));var controller=require(_0x4bd8('0x6'));router['get']('/',auth[_0x4bd8('0x7')](),controller[_0x4bd8('0x8')]);router[_0x4bd8('0x9')](_0x4bd8('0xa'),auth[_0x4bd8('0x7')](),controller[_0x4bd8('0xb')]);router['get']('/:id/configurations',auth[_0x4bd8('0x7')](),controller[_0x4bd8('0xc')]);router['get'](_0x4bd8('0xd'),auth[_0x4bd8('0x7')](),controller['getFields']);router[_0x4bd8('0xe')]('/',auth[_0x4bd8('0x7')](),controller['create']);router['post']('/:id/configurations',auth[_0x4bd8('0x7')](),controller['addConfiguration']);router[_0x4bd8('0xf')]('/:id',auth[_0x4bd8('0x7')](),controller['update']);router[_0x4bd8('0x10')]('/:id',auth[_0x4bd8('0x7')](),controller[_0x4bd8('0x11')]);module[_0x4bd8('0x12')]=router;
\ No newline at end of file
index 817c443..2fd2571 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['STRING','username','exports'];(function(_0x4897c8,_0xaa604d){var _0xc17b85=function(_0x4a4a87){while(--_0x4a4a87){_0x4897c8['push'](_0x4897c8['shift']());}};_0xc17b85(++_0xaa604d);}(_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')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x65f6('0x1')]},'username':{'type':Sequelize[_0x65f6('0x1')],'unique':_0x65f6('0x2')},'apiKey':{'type':Sequelize[_0x65f6('0x1')]},'remoteUri':{'type':Sequelize[_0x65f6('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x65f6('0x1')]}};
\ No newline at end of file
+var _0xb96d=['STRING','username','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb96d,0x9e));var _0xdb96=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0xb96d[_0x24fa1a];return _0xc5621f;};'use strict';var Sequelize=require('sequelize');module[_0xdb96('0x0')]={'name':{'type':Sequelize[_0xdb96('0x1')]},'description':{'type':Sequelize[_0xdb96('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xdb96('0x2')},'apiKey':{'type':Sequelize[_0xdb96('0x1')]},'remoteUri':{'type':Sequelize[_0xdb96('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}};
\ No newline at end of file
index b90605f..b9b8266 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['offset','limit','set','Content-Range','json','apply','reject','then','destroy','stack','name','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','merge','find','create','body','update','getConfigurations','findOne','FreshdeskConfiguration','options','addConfiguration','AccountId','getSubjects','Descriptions','FreshdeskField','Subjects','getFields','apiKey','remoteUri','slice','substring','GET','api/v2/ticket_fields','format','base64','requester','subject','description','source','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','Sequelize','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count'];(function(_0x4a457b,_0x369991){var _0x1abd41=function(_0x268b16){while(--_0x268b16){_0x4a457b['push'](_0x4a457b['shift']());}};_0x1abd41(++_0x369991);}(_0x326f,0xd1));var _0xf326=function(_0x26e748,_0x185bc1){_0x26e748=_0x26e748-0x0;var _0x67e5d1=_0x326f[_0x26e748];return _0x67e5d1;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var db=require(_0xf326('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xf326('0x17'));var client=jayson[_0xf326('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x342fe5,_0x472632,_0x3504eb){if(_0x3504eb){var _0x17a098=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17a098['test'](_0x472632)){return _0x342fe5;}else{throw new db[(_0xf326('0x19'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x342fe5;}}function respondWithRpcPromise(_0xdf21d9,_0x11f6d2,_0x1f2e5a,_0xa63d1a){return new BPromise(function(_0x292f4b,_0x287a2a){var _0x34128e=_0xa63d1a||client;return _0x34128e[_0xf326('0x1a')](_0xdf21d9,_0x1f2e5a)['then'](function(_0x3ad7da){logger[_0xf326('0x1b')](_0xf326('0x1c'),_0x11f6d2,_0xf326('0x1d'));logger[_0xf326('0x1e')](_0xf326('0x1f'),_0x11f6d2,'request\x20sent',JSON['stringify'](_0x3ad7da));if(_0x3ad7da['error']){if(_0x3ad7da[_0xf326('0x20')][_0xf326('0x21')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da[_0xf326('0x20')]['message']);return _0x287a2a(_0x3ad7da['error'][_0xf326('0x22')]);}logger[_0xf326('0x20')]('FreshdeskAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da['error'][_0xf326('0x22')]);return _0x292f4b(_0x3ad7da[_0xf326('0x20')]['message']);}else{logger[_0xf326('0x1b')](_0xf326('0x1c'),_0x11f6d2,_0xf326('0x1d'));_0x292f4b(_0x3ad7da[_0xf326('0x23')][_0xf326('0x22')]);}})[_0xf326('0x24')](function(_0x5ce532){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x11f6d2,_0x5ce532);_0x287a2a(_0x5ce532);});});}function respondWithStatusCode(_0x520d85,_0x1a2c4e){_0x1a2c4e=_0x1a2c4e||0xcc;return function(_0x2cd45a){if(_0x2cd45a){return _0x520d85[_0xf326('0x25')](_0x1a2c4e);}return _0x520d85[_0xf326('0x26')](_0x1a2c4e)[_0xf326('0x27')]();};}function respondWithResult(_0x5217d4,_0x201d28){_0x201d28=_0x201d28||0xc8;return function(_0xa3c0b){if(_0xa3c0b){return _0x5217d4[_0xf326('0x26')](_0x201d28)['json'](_0xa3c0b);}};}function respondWithFilteredResult(_0x1617d2,_0x55ad0f){return function(_0x4a9abf){if(_0x4a9abf){var _0x6a8e89=_0x4a9abf[_0xf326('0x28')],_0x1ae23a=_0x55ad0f[_0xf326('0x29')],_0x2fa28e=_0x55ad0f['offset']+_0x55ad0f[_0xf326('0x2a')],_0x5dbe63;if(_0x2fa28e>=_0x6a8e89){_0x2fa28e=_0x6a8e89;_0x5dbe63=0xc8;}else{_0x5dbe63=0xce;}_0x1617d2[_0xf326('0x26')](_0x5dbe63);return _0x1617d2[_0xf326('0x2b')](_0xf326('0x2c'),_0x1ae23a+'-'+_0x2fa28e+'/'+_0x6a8e89)[_0xf326('0x2d')](_0x4a9abf);}return null;};}function patchUpdates(_0x269be9){return function(_0x161143){try{jsonpatch[_0xf326('0x2e')](_0x161143,_0x269be9,!![]);}catch(_0x43b951){return BPromise[_0xf326('0x2f')](_0x43b951);}return _0x161143['save']();};}function saveUpdates(_0x1035ed,_0x424104){return function(_0x21b23d){if(_0x21b23d){return _0x21b23d['update'](_0x1035ed)[_0xf326('0x30')](function(_0x1721fd){return _0x1721fd;});}return null;};}function removeEntity(_0x303dc6,_0x4df451){return function(_0x5b101d){if(_0x5b101d){return _0x5b101d[_0xf326('0x31')]()[_0xf326('0x30')](function(){_0x303dc6[_0xf326('0x26')](0xcc)[_0xf326('0x27')]();});}};}function handleEntityNotFound(_0x30694f,_0x2e8a64){return function(_0x62585a){if(!_0x62585a){_0x30694f[_0xf326('0x25')](0x194);}return _0x62585a;};}function handleError(_0x580374,_0x461e93){_0x461e93=_0x461e93||0x1f4;return function(_0x1981bc){logger['error'](_0x1981bc[_0xf326('0x32')]);if(_0x1981bc['name']){delete _0x1981bc[_0xf326('0x33')];}_0x580374['status'](_0x461e93)['send'](_0x1981bc);};}exports[_0xf326('0x34')]=function(_0x4d8eac,_0x40dcb4){var _0x57aa27={},_0x310dbb={},_0x409260={'count':0x0,'rows':[]};var _0x2750ae=_['map'](db[_0xf326('0x35')][_0xf326('0x36')],function(_0x48525a){return{'name':_0x48525a[_0xf326('0x37')],'type':_0x48525a[_0xf326('0x38')][_0xf326('0x39')]};});_0x310dbb[_0xf326('0x3a')]=_['map'](_0x2750ae,_0xf326('0x33'));_0x310dbb[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x4d8eac[_0xf326('0x3b')]);_0x310dbb[_0xf326('0x3d')]=_['intersection'](_0x310dbb[_0xf326('0x3a')],_0x310dbb[_0xf326('0x3b')]);_0x57aa27['attributes']=_['intersection'](_0x310dbb[_0xf326('0x3a')],qs['fields'](_0x4d8eac['query'][_0xf326('0x3e')]));_0x57aa27['attributes']=_0x57aa27[_0xf326('0x3f')][_0xf326('0x40')]?_0x57aa27[_0xf326('0x3f')]:_0x310dbb[_0xf326('0x3a')];if(!_0x4d8eac['query'][_0xf326('0x41')](_0xf326('0x42'))){_0x57aa27[_0xf326('0x2a')]=qs[_0xf326('0x2a')](_0x4d8eac[_0xf326('0x3b')][_0xf326('0x2a')]);_0x57aa27[_0xf326('0x29')]=qs[_0xf326('0x29')](_0x4d8eac[_0xf326('0x3b')][_0xf326('0x29')]);}_0x57aa27[_0xf326('0x43')]=qs[_0xf326('0x44')](_0x4d8eac['query'][_0xf326('0x44')]);_0x57aa27[_0xf326('0x45')]=qs[_0xf326('0x3d')](_[_0xf326('0x46')](_0x4d8eac[_0xf326('0x3b')],_0x310dbb[_0xf326('0x3d')]),_0x2750ae);if(_0x4d8eac['query'][_0xf326('0x47')]){_0x57aa27[_0xf326('0x45')]=_['merge'](_0x57aa27[_0xf326('0x45')],{'$or':_[_0xf326('0x48')](_0x2750ae,function(_0x130c56){if(_0x130c56[_0xf326('0x38')]!==_0xf326('0x49')){var _0x55361f={};_0x55361f[_0x130c56['name']]={'$like':'%'+_0x4d8eac[_0xf326('0x3b')][_0xf326('0x47')]+'%'};return _0x55361f;}})});}_0x57aa27=_['merge']({},_0x57aa27,_0x4d8eac['options']);var _0x8e318d={'where':_0x57aa27[_0xf326('0x45')]};return db[_0xf326('0x35')]['count'](_0x8e318d)[_0xf326('0x30')](function(_0xe96e1e){_0x409260[_0xf326('0x28')]=_0xe96e1e;if(_0x4d8eac[_0xf326('0x3b')][_0xf326('0x4a')]){_0x57aa27[_0xf326('0x4b')]=[{'all':!![]}];}return db[_0xf326('0x35')][_0xf326('0x4c')](_0x57aa27);})[_0xf326('0x30')](function(_0x27ced1){_0x409260[_0xf326('0x4d')]=_0x27ced1;return _0x409260;})[_0xf326('0x30')](respondWithFilteredResult(_0x40dcb4,_0x57aa27))[_0xf326('0x24')](handleError(_0x40dcb4,null));};exports[_0xf326('0x4e')]=function(_0xeac1a1,_0x59f9a7){var _0x199f8b={'raw':![],'where':{'id':_0xeac1a1[_0xf326('0x4f')]['id']}},_0x1b0e03={};_0x1b0e03[_0xf326('0x3a')]=_['keys'](db[_0xf326('0x35')][_0xf326('0x36')]);_0x1b0e03[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xeac1a1['query']);_0x1b0e03[_0xf326('0x3d')]=_[_0xf326('0x50')](_0x1b0e03[_0xf326('0x3a')],_0x1b0e03[_0xf326('0x3b')]);_0x199f8b[_0xf326('0x3f')]=_['intersection'](_0x1b0e03['model'],qs[_0xf326('0x3e')](_0xeac1a1[_0xf326('0x3b')][_0xf326('0x3e')]));_0x199f8b['attributes']=_0x199f8b[_0xf326('0x3f')][_0xf326('0x40')]?_0x199f8b[_0xf326('0x3f')]:_0x1b0e03['model'];if(_0xeac1a1['query'][_0xf326('0x4a')]){_0x199f8b['include']=[{'all':!![]}];}_0x199f8b=_[_0xf326('0x51')]({},_0x199f8b,_0xeac1a1['options']);return db[_0xf326('0x35')][_0xf326('0x52')](_0x199f8b)[_0xf326('0x30')](handleEntityNotFound(_0x59f9a7,null))[_0xf326('0x30')](respondWithResult(_0x59f9a7,null))[_0xf326('0x24')](handleError(_0x59f9a7,null));};exports[_0xf326('0x53')]=function(_0x7f7ece,_0x495a16){return db[_0xf326('0x35')][_0xf326('0x53')](_0x7f7ece[_0xf326('0x54')],{})['then'](respondWithResult(_0x495a16,0xc9))[_0xf326('0x24')](handleError(_0x495a16,null));};exports[_0xf326('0x55')]=function(_0x3b8635,_0x16c578){if(_0x3b8635[_0xf326('0x54')]['id']){delete _0x3b8635['body']['id'];}return db[_0xf326('0x35')][_0xf326('0x52')]({'where':{'id':_0x3b8635[_0xf326('0x4f')]['id']}})[_0xf326('0x30')](handleEntityNotFound(_0x16c578,null))['then'](saveUpdates(_0x3b8635[_0xf326('0x54')],null))[_0xf326('0x30')](respondWithResult(_0x16c578,null))[_0xf326('0x24')](handleError(_0x16c578,null));};exports[_0xf326('0x31')]=function(_0x4d3b9e,_0x5be2b1){return db[_0xf326('0x35')][_0xf326('0x52')]({'where':{'id':_0x4d3b9e['params']['id']}})[_0xf326('0x30')](handleEntityNotFound(_0x5be2b1,null))[_0xf326('0x30')](removeEntity(_0x5be2b1,null))[_0xf326('0x24')](handleError(_0x5be2b1,null));};exports[_0xf326('0x56')]=function(_0x5765b0,_0xb1c18c,_0x5657b7){var _0x5dbeb9={};var _0x9d84c3={};var _0x51d466;var _0x173760;return db[_0xf326('0x35')][_0xf326('0x57')]({'where':{'id':_0x5765b0['params']['id']}})['then'](handleEntityNotFound(_0xb1c18c,null))[_0xf326('0x30')](function(_0xa85a42){if(_0xa85a42){_0x51d466=_0xa85a42;_0x9d84c3[_0xf326('0x3a')]=_['keys'](db[_0xf326('0x58')]['rawAttributes']);_0x9d84c3[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5765b0[_0xf326('0x3b')]);_0x9d84c3[_0xf326('0x3d')]=_[_0xf326('0x50')](_0x9d84c3[_0xf326('0x3a')],_0x9d84c3[_0xf326('0x3b')]);_0x5dbeb9[_0xf326('0x3f')]=_[_0xf326('0x50')](_0x9d84c3[_0xf326('0x3a')],qs[_0xf326('0x3e')](_0x5765b0[_0xf326('0x3b')][_0xf326('0x3e')]));_0x5dbeb9['attributes']=_0x5dbeb9[_0xf326('0x3f')]['length']?_0x5dbeb9[_0xf326('0x3f')]:_0x9d84c3[_0xf326('0x3a')];_0x5dbeb9['order']=qs[_0xf326('0x44')](_0x5765b0['query'][_0xf326('0x44')]);_0x5dbeb9[_0xf326('0x45')]=qs[_0xf326('0x3d')](_[_0xf326('0x46')](_0x5765b0[_0xf326('0x3b')],_0x9d84c3['filters']));if(_0x5765b0['query'][_0xf326('0x47')]){_0x5dbeb9[_0xf326('0x45')]=_[_0xf326('0x51')](_0x5dbeb9[_0xf326('0x45')],{'$or':_[_0xf326('0x48')](_0x5dbeb9['attributes'],function(_0x28c4f2){var _0x471da8={};_0x471da8[_0x28c4f2]={'$like':'%'+_0x5765b0['query']['filter']+'%'};return _0x471da8;})});}_0x5dbeb9=_['merge']({},_0x5dbeb9,_0x5765b0[_0xf326('0x59')]);return _0x51d466[_0xf326('0x56')](_0x5dbeb9);}})[_0xf326('0x30')](function(_0x235525){if(_0x235525){_0x173760=_0x235525[_0xf326('0x40')];if(!_0x5765b0[_0xf326('0x3b')][_0xf326('0x41')]('nolimit')){_0x5dbeb9[_0xf326('0x2a')]=qs[_0xf326('0x2a')](_0x5765b0[_0xf326('0x3b')][_0xf326('0x2a')]);_0x5dbeb9['offset']=qs[_0xf326('0x29')](_0x5765b0['query']['offset']);}return _0x51d466[_0xf326('0x56')](_0x5dbeb9);}})['then'](function(_0x78ba34){if(_0x78ba34){return _0x78ba34?{'count':_0x173760,'rows':_0x78ba34}:null;}})[_0xf326('0x30')](respondWithResult(_0xb1c18c,null))[_0xf326('0x24')](handleError(_0xb1c18c,null));};exports[_0xf326('0x5a')]=function(_0x17cd36,_0x541491,_0x4a053c){if(_0x17cd36['body']['id']){delete _0x17cd36[_0xf326('0x54')]['id'];}return db[_0xf326('0x35')][_0xf326('0x57')]({'where':{'id':_0x17cd36[_0xf326('0x4f')]['id']}})[_0xf326('0x30')](handleEntityNotFound(_0x541491,null))['then'](function(_0x1ed961){if(_0x1ed961){_0x17cd36[_0xf326('0x54')][_0xf326('0x5b')]=_0x1ed961['id'];_0x17cd36['body']['Subjects']=integrations[_0xf326('0x5c')](_0x17cd36[_0xf326('0x54')]['channel'],_0x17cd36['body'][_0xf326('0x38')]);_0x17cd36['body'][_0xf326('0x5d')]=integrations['getDescriptions'](_0x17cd36['body']['channel'],_0x17cd36[_0xf326('0x54')][_0xf326('0x38')]);return db[_0xf326('0x58')]['create'](_0x17cd36[_0xf326('0x54')],{'include':[{'model':db[_0xf326('0x5e')],'as':_0xf326('0x5f')},{'model':db[_0xf326('0x5e')],'as':_0xf326('0x5d')}]});}return null;})[_0xf326('0x30')](respondWithResult(_0x541491,null))[_0xf326('0x24')](handleError(_0x541491,null));};exports[_0xf326('0x60')]=function(_0x3855a4,_0x5290da,_0x34c3cf){var _0x5b1494='';return db[_0xf326('0x35')][_0xf326('0x57')]({'where':{'id':_0x3855a4[_0xf326('0x4f')]['id']},'attributes':['id','remoteUri',_0xf326('0x61')]})[_0xf326('0x30')](handleEntityNotFound(_0x5290da,null))[_0xf326('0x30')](function(_0x4dc8d7){if(_0x4dc8d7){_0x5b1494=_0x4dc8d7[_0xf326('0x62')];var _0x4057e1=_0x5b1494[_0xf326('0x63')](-0x1);if(_0x4057e1==='/'){_0x5b1494=_0x5b1494[_0xf326('0x64')](0x0,_0x5b1494['lastIndexOf'](_0x4057e1));}return rp({'method':_0xf326('0x65'),'uri':util['format']('%s/%s',_0x5b1494,_0xf326('0x66')),'headers':{'Authorization':util[_0xf326('0x67')]('Basic\x20%s',new Buffer(util['format']('%s:X',_0x4dc8d7[_0xf326('0x61')]))['toString'](_0xf326('0x68')))},'json':!![]});}})[_0xf326('0x30')](function(_0x3434b2){if(_0x3434b2){var _0x2ec314=[_0xf326('0x69'),_0xf326('0x6a'),'agent',_0xf326('0x6b'),_0xf326('0x26'),'priority','group',_0xf326('0x6c'),'ticket_type',_0xf326('0x6d'),_0xf326('0x6e')];_[_0xf326('0x6f')](_0x3434b2,function(_0x363e64){return _0x2ec314[_0xf326('0x70')](_0x363e64[_0xf326('0x33')])||!_0x363e64[_0xf326('0x71')]&&_0x363e64[_0xf326('0x38')]!==_0xf326('0x72')&&_0x363e64['type']!==_0xf326('0x73');});return{'count':_0x3434b2[_0xf326('0x40')],'rows':_['map'](_0x3434b2,function(_0x3c82cf){return{'id':_0x3c82cf['name'],'name':_0x3c82cf[_0xf326('0x74')],'custom':!_0x3c82cf[_0xf326('0x71')],'options':_0x3c82cf[_0xf326('0x75')]?_['map'](_0x3c82cf[_0xf326('0x75')],function(_0x1c86c8){return{'name':_[_0xf326('0x76')](_0x1c86c8),'value':_0x1c86c8};}):[]};})};}})[_0xf326('0x30')](respondWithResult(_0x5290da,null))[_0xf326('0x24')](function(_0x1e50aa){var _0x148779=_0x3855a4[_0xf326('0x3b')][_0xf326('0x77')]?0x1f4:_0x1e50aa[_0xf326('0x78')]||0x1f4;logger[_0xf326('0x20')](_0xf326('0x79'),_0xf326('0x60'),_0x148779,JSON[_0xf326('0x7a')](_0x1e50aa));delete _0x1e50aa[_0xf326('0x33')];if(_0x148779===0x191){_0x148779=0x190;}_0x5290da['status'](_0x148779)[_0xf326('0x7b')](_0x3855a4[_0xf326('0x3b')]['test']?{'message':_0xf326('0x7c'),'statusCode':_0x1e50aa[_0xf326('0x78')]}:_0x1e50aa);});};
\ No newline at end of file
+var _0xe14b=['apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester','subject','agent','priority','group','ticket_type','company','includes','default','custom_text','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','name','index','map','FreshdeskAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','includeAll','findAll','show','params','include','find','create','body','update','destroy','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','getFields','remoteUri'];(function(_0x544106,_0x449f0e){var _0x51ea19=function(_0x519a8e){while(--_0x519a8e){_0x544106['push'](_0x544106['shift']());}};_0x51ea19(++_0x449f0e);}(_0xe14b,0x93));var _0xbe14=function(_0x1c0d8c,_0x255ee){_0x1c0d8c=_0x1c0d8c-0x0;var _0x15c9af=_0xe14b[_0x1c0d8c];return _0x15c9af;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];var integrations=require(_0xbe14('0x15'));var jayson=require(_0xbe14('0x16'));var client=jayson[_0xbe14('0x17')][_0xbe14('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2850cb,_0x16893f,_0xa2cf72){if(_0xa2cf72){var _0x1e4826=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e4826[_0xbe14('0x19')](_0x16893f)){return _0x2850cb;}else{throw new db[(_0xbe14('0x1a'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2850cb;}}function respondWithRpcPromise(_0x3f58f5,_0x3dc4a9,_0xf4ac9,_0x37ce4e){return new BPromise(function(_0x4e8f34,_0x21c789){var _0xe9c3ec=_0x37ce4e||client;return _0xe9c3ec[_0xbe14('0x1b')](_0x3f58f5,_0xf4ac9)[_0xbe14('0x1c')](function(_0x38f1ea){logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3dc4a9,'request\x20sent');logger[_0xbe14('0x1f')](_0xbe14('0x20'),_0x3dc4a9,_0xbe14('0x21'),JSON[_0xbe14('0x22')](_0x38f1ea));if(_0x38f1ea[_0xbe14('0x23')]){if(_0x38f1ea[_0xbe14('0x23')]['code']===0x1f4){logger[_0xbe14('0x23')](_0xbe14('0x1e'),_0x3dc4a9,_0x38f1ea[_0xbe14('0x23')][_0xbe14('0x24')]);return _0x21c789(_0x38f1ea[_0xbe14('0x23')]['message']);}logger[_0xbe14('0x23')]('FreshdeskAccount,\x20%s,\x20%s',_0x3dc4a9,_0x38f1ea[_0xbe14('0x23')]['message']);return _0x4e8f34(_0x38f1ea[_0xbe14('0x23')]['message']);}else{logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3dc4a9,'request\x20sent');_0x4e8f34(_0x38f1ea[_0xbe14('0x25')]['message']);}})[_0xbe14('0x26')](function(_0x4851f8){logger[_0xbe14('0x23')](_0xbe14('0x1e'),_0x3dc4a9,_0x4851f8);_0x21c789(_0x4851f8);});});}function respondWithStatusCode(_0x1ee9c1,_0x39cc81){_0x39cc81=_0x39cc81||0xcc;return function(_0x15ef02){if(_0x15ef02){return _0x1ee9c1[_0xbe14('0x27')](_0x39cc81);}return _0x1ee9c1['status'](_0x39cc81)[_0xbe14('0x28')]();};}function respondWithResult(_0x1ba46a,_0x391556){_0x391556=_0x391556||0xc8;return function(_0x169369){if(_0x169369){return _0x1ba46a['status'](_0x391556)[_0xbe14('0x29')](_0x169369);}};}function respondWithFilteredResult(_0x29fc64,_0x59bf34){return function(_0x3c3613){if(_0x3c3613){var _0x3b3e84=_0x3c3613[_0xbe14('0x2a')],_0x1c7cc7=_0x59bf34[_0xbe14('0x2b')],_0x19252f=_0x59bf34[_0xbe14('0x2b')]+_0x59bf34[_0xbe14('0x2c')],_0x34d648;if(_0x19252f>=_0x3b3e84){_0x19252f=_0x3b3e84;_0x34d648=0xc8;}else{_0x34d648=0xce;}_0x29fc64[_0xbe14('0x2d')](_0x34d648);return _0x29fc64[_0xbe14('0x2e')](_0xbe14('0x2f'),_0x1c7cc7+'-'+_0x19252f+'/'+_0x3b3e84)[_0xbe14('0x29')](_0x3c3613);}return null;};}function patchUpdates(_0x10ae36){return function(_0x223f7a){try{jsonpatch[_0xbe14('0x30')](_0x223f7a,_0x10ae36,!![]);}catch(_0x6ba36c){return BPromise[_0xbe14('0x31')](_0x6ba36c);}return _0x223f7a[_0xbe14('0x32')]();};}function saveUpdates(_0x14e7c4,_0x581e86){return function(_0x2e33e1){if(_0x2e33e1){return _0x2e33e1['update'](_0x14e7c4)['then'](function(_0x46c2d1){return _0x46c2d1;});}return null;};}function removeEntity(_0x4c1e7e,_0x243524){return function(_0x345b0){if(_0x345b0){return _0x345b0['destroy']()['then'](function(){_0x4c1e7e['status'](0xcc)[_0xbe14('0x28')]();});}};}function handleEntityNotFound(_0xa3d24,_0x5f27b6){return function(_0x46c570){if(!_0x46c570){_0xa3d24[_0xbe14('0x27')](0x194);}return _0x46c570;};}function handleError(_0x452635,_0x1aa849){_0x1aa849=_0x1aa849||0x1f4;return function(_0x29c23e){logger['error'](_0x29c23e['stack']);if(_0x29c23e[_0xbe14('0x33')]){delete _0x29c23e['name'];}_0x452635['status'](_0x1aa849)['send'](_0x29c23e);};}exports[_0xbe14('0x34')]=function(_0x393f6b,_0x2bb45){var _0x3dbacb={},_0x172e79={},_0x29356f={'count':0x0,'rows':[]};var _0xcdc50=_[_0xbe14('0x35')](db[_0xbe14('0x36')][_0xbe14('0x37')],function(_0x41652d){return{'name':_0x41652d[_0xbe14('0x38')],'type':_0x41652d['type']['key']};});_0x172e79[_0xbe14('0x39')]=_[_0xbe14('0x35')](_0xcdc50,_0xbe14('0x33'));_0x172e79['query']=_[_0xbe14('0x3a')](_0x393f6b[_0xbe14('0x3b')]);_0x172e79[_0xbe14('0x3c')]=_[_0xbe14('0x3d')](_0x172e79[_0xbe14('0x39')],_0x172e79[_0xbe14('0x3b')]);_0x3dbacb[_0xbe14('0x3e')]=_[_0xbe14('0x3d')](_0x172e79[_0xbe14('0x39')],qs['fields'](_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x3f')]));_0x3dbacb[_0xbe14('0x3e')]=_0x3dbacb[_0xbe14('0x3e')][_0xbe14('0x40')]?_0x3dbacb[_0xbe14('0x3e')]:_0x172e79['model'];if(!_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x41')](_0xbe14('0x42'))){_0x3dbacb[_0xbe14('0x2c')]=qs['limit'](_0x393f6b['query'][_0xbe14('0x2c')]);_0x3dbacb[_0xbe14('0x2b')]=qs[_0xbe14('0x2b')](_0x393f6b['query']['offset']);}_0x3dbacb[_0xbe14('0x43')]=qs['sort'](_0x393f6b['query'][_0xbe14('0x44')]);_0x3dbacb[_0xbe14('0x45')]=qs[_0xbe14('0x3c')](_['pick'](_0x393f6b['query'],_0x172e79['filters']),_0xcdc50);if(_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x46')]){_0x3dbacb[_0xbe14('0x45')]=_['merge'](_0x3dbacb[_0xbe14('0x45')],{'$or':_[_0xbe14('0x35')](_0xcdc50,function(_0x32f22e){if(_0x32f22e[_0xbe14('0x47')]!=='VIRTUAL'){var _0x4a1a4b={};_0x4a1a4b[_0x32f22e[_0xbe14('0x33')]]={'$like':'%'+_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x46')]+'%'};return _0x4a1a4b;}})});}_0x3dbacb=_[_0xbe14('0x48')]({},_0x3dbacb,_0x393f6b[_0xbe14('0x49')]);var _0x4f2d95={'where':_0x3dbacb['where']};return db[_0xbe14('0x36')][_0xbe14('0x2a')](_0x4f2d95)[_0xbe14('0x1c')](function(_0x2a3b35){_0x29356f['count']=_0x2a3b35;if(_0x393f6b[_0xbe14('0x3b')][_0xbe14('0x4a')]){_0x3dbacb['include']=[{'all':!![]}];}return db[_0xbe14('0x36')][_0xbe14('0x4b')](_0x3dbacb);})[_0xbe14('0x1c')](function(_0x36c20c){_0x29356f['rows']=_0x36c20c;return _0x29356f;})['then'](respondWithFilteredResult(_0x2bb45,_0x3dbacb))[_0xbe14('0x26')](handleError(_0x2bb45,null));};exports[_0xbe14('0x4c')]=function(_0x4a1a37,_0x5acf90){var _0xca8cdb={'raw':![],'where':{'id':_0x4a1a37[_0xbe14('0x4d')]['id']}},_0x5d3726={};_0x5d3726[_0xbe14('0x39')]=_[_0xbe14('0x3a')](db[_0xbe14('0x36')][_0xbe14('0x37')]);_0x5d3726['query']=_[_0xbe14('0x3a')](_0x4a1a37[_0xbe14('0x3b')]);_0x5d3726[_0xbe14('0x3c')]=_[_0xbe14('0x3d')](_0x5d3726[_0xbe14('0x39')],_0x5d3726['query']);_0xca8cdb[_0xbe14('0x3e')]=_[_0xbe14('0x3d')](_0x5d3726[_0xbe14('0x39')],qs[_0xbe14('0x3f')](_0x4a1a37[_0xbe14('0x3b')][_0xbe14('0x3f')]));_0xca8cdb['attributes']=_0xca8cdb['attributes'][_0xbe14('0x40')]?_0xca8cdb[_0xbe14('0x3e')]:_0x5d3726[_0xbe14('0x39')];if(_0x4a1a37['query']['includeAll']){_0xca8cdb[_0xbe14('0x4e')]=[{'all':!![]}];}_0xca8cdb=_[_0xbe14('0x48')]({},_0xca8cdb,_0x4a1a37['options']);return db[_0xbe14('0x36')][_0xbe14('0x4f')](_0xca8cdb)['then'](handleEntityNotFound(_0x5acf90,null))[_0xbe14('0x1c')](respondWithResult(_0x5acf90,null))['catch'](handleError(_0x5acf90,null));};exports[_0xbe14('0x50')]=function(_0x410c59,_0x12a9de){return db['FreshdeskAccount'][_0xbe14('0x50')](_0x410c59[_0xbe14('0x51')],{})['then'](respondWithResult(_0x12a9de,0xc9))[_0xbe14('0x26')](handleError(_0x12a9de,null));};exports[_0xbe14('0x52')]=function(_0x2210cc,_0x20c48d){if(_0x2210cc[_0xbe14('0x51')]['id']){delete _0x2210cc['body']['id'];}return db[_0xbe14('0x36')][_0xbe14('0x4f')]({'where':{'id':_0x2210cc[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x20c48d,null))[_0xbe14('0x1c')](saveUpdates(_0x2210cc[_0xbe14('0x51')],null))[_0xbe14('0x1c')](respondWithResult(_0x20c48d,null))['catch'](handleError(_0x20c48d,null));};exports[_0xbe14('0x53')]=function(_0x1b47a4,_0x941ee2){return db[_0xbe14('0x36')][_0xbe14('0x4f')]({'where':{'id':_0x1b47a4[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x941ee2,null))[_0xbe14('0x1c')](removeEntity(_0x941ee2,null))[_0xbe14('0x26')](handleError(_0x941ee2,null));};exports[_0xbe14('0x54')]=function(_0x358950,_0x4bccfc,_0x56bcd3){var _0x58dd79={};var _0x10c0bc={};var _0x1bfcbf;var _0x2f4e52;return db[_0xbe14('0x36')][_0xbe14('0x55')]({'where':{'id':_0x358950[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x4bccfc,null))[_0xbe14('0x1c')](function(_0x31d015){if(_0x31d015){_0x1bfcbf=_0x31d015;_0x10c0bc[_0xbe14('0x39')]=_[_0xbe14('0x3a')](db[_0xbe14('0x56')][_0xbe14('0x37')]);_0x10c0bc[_0xbe14('0x3b')]=_[_0xbe14('0x3a')](_0x358950[_0xbe14('0x3b')]);_0x10c0bc[_0xbe14('0x3c')]=_[_0xbe14('0x3d')](_0x10c0bc[_0xbe14('0x39')],_0x10c0bc[_0xbe14('0x3b')]);_0x58dd79['attributes']=_[_0xbe14('0x3d')](_0x10c0bc[_0xbe14('0x39')],qs[_0xbe14('0x3f')](_0x358950[_0xbe14('0x3b')][_0xbe14('0x3f')]));_0x58dd79[_0xbe14('0x3e')]=_0x58dd79[_0xbe14('0x3e')][_0xbe14('0x40')]?_0x58dd79[_0xbe14('0x3e')]:_0x10c0bc[_0xbe14('0x39')];_0x58dd79['order']=qs[_0xbe14('0x44')](_0x358950[_0xbe14('0x3b')][_0xbe14('0x44')]);_0x58dd79[_0xbe14('0x45')]=qs[_0xbe14('0x3c')](_['pick'](_0x358950[_0xbe14('0x3b')],_0x10c0bc[_0xbe14('0x3c')]));if(_0x358950[_0xbe14('0x3b')][_0xbe14('0x46')]){_0x58dd79[_0xbe14('0x45')]=_['merge'](_0x58dd79[_0xbe14('0x45')],{'$or':_[_0xbe14('0x35')](_0x58dd79[_0xbe14('0x3e')],function(_0x29bb26){var _0xaebce8={};_0xaebce8[_0x29bb26]={'$like':'%'+_0x358950[_0xbe14('0x3b')][_0xbe14('0x46')]+'%'};return _0xaebce8;})});}_0x58dd79=_[_0xbe14('0x48')]({},_0x58dd79,_0x358950['options']);return _0x1bfcbf[_0xbe14('0x54')](_0x58dd79);}})[_0xbe14('0x1c')](function(_0x2fdf5d){if(_0x2fdf5d){_0x2f4e52=_0x2fdf5d[_0xbe14('0x40')];if(!_0x358950[_0xbe14('0x3b')][_0xbe14('0x41')](_0xbe14('0x42'))){_0x58dd79['limit']=qs['limit'](_0x358950[_0xbe14('0x3b')][_0xbe14('0x2c')]);_0x58dd79[_0xbe14('0x2b')]=qs[_0xbe14('0x2b')](_0x358950[_0xbe14('0x3b')][_0xbe14('0x2b')]);}return _0x1bfcbf[_0xbe14('0x54')](_0x58dd79);}})[_0xbe14('0x1c')](function(_0x50e644){if(_0x50e644){return _0x50e644?{'count':_0x2f4e52,'rows':_0x50e644}:null;}})['then'](respondWithResult(_0x4bccfc,null))[_0xbe14('0x26')](handleError(_0x4bccfc,null));};exports[_0xbe14('0x57')]=function(_0x29aa52,_0x57729f,_0x76e91e){if(_0x29aa52[_0xbe14('0x51')]['id']){delete _0x29aa52[_0xbe14('0x51')]['id'];}return db[_0xbe14('0x36')][_0xbe14('0x55')]({'where':{'id':_0x29aa52[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x57729f,null))['then'](function(_0x43b817){if(_0x43b817){_0x29aa52[_0xbe14('0x51')][_0xbe14('0x58')]=_0x43b817['id'];_0x29aa52[_0xbe14('0x51')][_0xbe14('0x59')]=integrations[_0xbe14('0x5a')](_0x29aa52[_0xbe14('0x51')]['channel'],_0x29aa52[_0xbe14('0x51')][_0xbe14('0x47')]);_0x29aa52[_0xbe14('0x51')][_0xbe14('0x5b')]=integrations[_0xbe14('0x5c')](_0x29aa52[_0xbe14('0x51')][_0xbe14('0x5d')],_0x29aa52[_0xbe14('0x51')]['type']);return db[_0xbe14('0x56')][_0xbe14('0x50')](_0x29aa52[_0xbe14('0x51')],{'include':[{'model':db[_0xbe14('0x5e')],'as':_0xbe14('0x59')},{'model':db[_0xbe14('0x5e')],'as':'Descriptions'}]});}return null;})[_0xbe14('0x1c')](respondWithResult(_0x57729f,null))[_0xbe14('0x26')](handleError(_0x57729f,null));};exports[_0xbe14('0x5f')]=function(_0x1b23a1,_0x508455,_0x7e9e5c){var _0x1578b6='';return db[_0xbe14('0x36')][_0xbe14('0x55')]({'where':{'id':_0x1b23a1[_0xbe14('0x4d')]['id']},'attributes':['id',_0xbe14('0x60'),_0xbe14('0x61')]})['then'](handleEntityNotFound(_0x508455,null))[_0xbe14('0x1c')](function(_0x589197){if(_0x589197){_0x1578b6=_0x589197[_0xbe14('0x60')];var _0x5d85d3=_0x1578b6[_0xbe14('0x62')](-0x1);if(_0x5d85d3==='/'){_0x1578b6=_0x1578b6[_0xbe14('0x63')](0x0,_0x1578b6[_0xbe14('0x64')](_0x5d85d3));}return rp({'method':'GET','uri':util[_0xbe14('0x65')](_0xbe14('0x66'),_0x1578b6,_0xbe14('0x67')),'headers':{'Authorization':util['format'](_0xbe14('0x68'),new Buffer(util[_0xbe14('0x65')](_0xbe14('0x69'),_0x589197[_0xbe14('0x61')]))['toString'](_0xbe14('0x6a')))},'json':!![]});}})[_0xbe14('0x1c')](function(_0x34f90b){if(_0x34f90b){var _0x2b2e0e=[_0xbe14('0x6b'),_0xbe14('0x6c'),_0xbe14('0x6d'),'description',_0xbe14('0x2d'),_0xbe14('0x6e'),_0xbe14('0x6f'),'source',_0xbe14('0x70'),_0xbe14('0x6f'),_0xbe14('0x71')];_['remove'](_0x34f90b,function(_0xa53262){return _0x2b2e0e[_0xbe14('0x72')](_0xa53262['name'])||!_0xa53262[_0xbe14('0x73')]&&_0xa53262['type']!==_0xbe14('0x74')&&_0xa53262[_0xbe14('0x47')]!=='custom_dropdown';});return{'count':_0x34f90b['length'],'rows':_[_0xbe14('0x35')](_0x34f90b,function(_0x3db955){return{'id':_0x3db955[_0xbe14('0x33')],'name':_0x3db955['label'],'custom':!_0x3db955[_0xbe14('0x73')],'options':_0x3db955[_0xbe14('0x75')]?_[_0xbe14('0x35')](_0x3db955[_0xbe14('0x75')],function(_0x5ee624){return{'name':_['capitalize'](_0x5ee624),'value':_0x5ee624};}):[]};})};}})[_0xbe14('0x1c')](respondWithResult(_0x508455,null))[_0xbe14('0x26')](function(_0xc8d0f6){var _0x215d5b=_0x1b23a1[_0xbe14('0x3b')][_0xbe14('0x19')]?0x1f4:_0xc8d0f6[_0xbe14('0x76')]||0x1f4;logger['error'](_0xbe14('0x77'),'getFields',_0x215d5b,JSON[_0xbe14('0x22')](_0xc8d0f6));delete _0xc8d0f6[_0xbe14('0x33')];if(_0x215d5b===0x191){_0x215d5b=0x190;}_0x508455[_0xbe14('0x2d')](_0x215d5b)[_0xbe14('0x78')](_0x1b23a1['query'][_0xbe14('0x19')]?{'message':_0xbe14('0x79'),'statusCode':_0xc8d0f6[_0xbe14('0x76')]}:_0xc8d0f6);});};
\ No newline at end of file
index e21458e..7b41df0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2354=['../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0x2354,0x198));var _0x4235=function(_0x376418,_0x621d4c){_0x376418=_0x376418-0x0;var _0x2d60e3=_0x2354[_0x376418];return _0x2d60e3;};'use strict';var _=require(_0x4235('0x0'));var util=require('util');var logger=require(_0x4235('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4235('0x2'));var rp=require(_0x4235('0x3'));var fs=require('fs');var path=require(_0x4235('0x4'));var rimraf=require(_0x4235('0x5'));var config=require(_0x4235('0x6'));var attributes=require(_0x4235('0x7'));var integrations=require(_0x4235('0x8'));module[_0x4235('0x9')]=function(_0x2cd615,_0x3e7cd3){return _0x2cd615[_0x4235('0xa')](_0x4235('0xb'),attributes,{'tableName':_0x4235('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c55=['request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','api','moment','bluebird'];(function(_0x5d851d,_0x53c51c){var _0xbaaa92=function(_0x216b72){while(--_0x216b72){_0x5d851d['push'](_0x5d851d['shift']());}};_0xbaaa92(++_0x53c51c);}(_0x2c55,0x19d));var _0x52c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c55[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x52c5('0x0'));var moment=require(_0x52c5('0x1'));var BPromise=require(_0x52c5('0x2'));var rp=require(_0x52c5('0x3'));var fs=require('fs');var path=require(_0x52c5('0x4'));var rimraf=require(_0x52c5('0x5'));var config=require(_0x52c5('0x6'));var attributes=require(_0x52c5('0x7'));var integrations=require(_0x52c5('0x8'));module[_0x52c5('0x9')]=function(_0x3077e8,_0x4fbf7a){return _0x3077e8[_0x52c5('0xa')](_0x52c5('0xb'),attributes,{'tableName':_0x52c5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8c581d1..2cc0928 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fa0=['include','map','model','attributes','GetFreshdeskAccount','stringify','find','raw','ShowFreshdeskAccount','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','FreshdeskAccount','findAll','options','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0fa0,0x157));var _0x00fa=function(_0x43198b,_0x2ce6dc){_0x43198b=_0x43198b-0x0;var _0x241ef7=_0x0fa0[_0x43198b];return _0x241ef7;};'use strict';var _=require(_0x00fa('0x0'));var util=require(_0x00fa('0x1'));var moment=require(_0x00fa('0x2'));var BPromise=require(_0x00fa('0x3'));var rs=require(_0x00fa('0x4'));var fs=require('fs');var Redis=require(_0x00fa('0x5'));var db=require(_0x00fa('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x00fa('0x7'))(_0x00fa('0x8'));var config=require('../../config/environment');var jayson=require(_0x00fa('0x9'));var client=jayson[_0x00fa('0xa')][_0x00fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x382500,_0x3e083f,_0x43cc25){return new BPromise(function(_0x391772,_0xaf1ef8){return client[_0x00fa('0xc')](_0x382500,_0x43cc25)[_0x00fa('0xd')](function(_0x2d4e37){logger[_0x00fa('0xe')](_0x00fa('0xf'),_0x3e083f,_0x00fa('0x10'));logger[_0x00fa('0x11')](_0x00fa('0x12'),_0x3e083f,'request\x20sent',JSON['stringify'](_0x2d4e37));if(_0x2d4e37[_0x00fa('0x13')]){if(_0x2d4e37[_0x00fa('0x13')][_0x00fa('0x14')]===0x1f4){logger[_0x00fa('0x13')](_0x00fa('0xf'),_0x3e083f,_0x2d4e37[_0x00fa('0x13')][_0x00fa('0x15')]);return _0xaf1ef8(_0x2d4e37[_0x00fa('0x13')][_0x00fa('0x15')]);}logger[_0x00fa('0x13')](_0x00fa('0xf'),_0x3e083f,_0x2d4e37['error'][_0x00fa('0x15')]);return _0x391772(_0x2d4e37[_0x00fa('0x13')]['message']);}else{logger['info'](_0x00fa('0xf'),_0x3e083f,'request\x20sent');_0x391772(_0x2d4e37[_0x00fa('0x16')][_0x00fa('0x15')]);}})['catch'](function(_0x2d4ff0){logger[_0x00fa('0x13')](_0x00fa('0xf'),_0x3e083f,_0x2d4ff0);_0xaf1ef8(_0x2d4ff0);});});}exports['GetFreshdeskAccount']=function(_0x490f03){var _0x1dcd82=this;return new Promise(function(_0xe9c997,_0x92a932){return db[_0x00fa('0x17')][_0x00fa('0x18')]({'raw':_0x490f03['options']?_0x490f03[_0x00fa('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x490f03['options']?_0x490f03[_0x00fa('0x19')][_0x00fa('0x1a')]||null:null,'attributes':_0x490f03[_0x00fa('0x19')]?_0x490f03['options']['attributes']||null:null,'limit':_0x490f03[_0x00fa('0x19')]?_0x490f03[_0x00fa('0x19')]['limit']||null:null,'include':_0x490f03['options']?_0x490f03['options'][_0x00fa('0x1b')]?_[_0x00fa('0x1c')](_0x490f03[_0x00fa('0x19')]['include'],function(_0x198329){return{'model':db[_0x198329[_0x00fa('0x1d')]],'as':_0x198329['as'],'attributes':_0x198329[_0x00fa('0x1e')],'include':_0x198329[_0x00fa('0x1b')]?_[_0x00fa('0x1c')](_0x198329[_0x00fa('0x1b')],function(_0x1b9dd2){return{'model':db[_0x1b9dd2[_0x00fa('0x1d')]],'as':_0x1b9dd2['as'],'attributes':_0x1b9dd2[_0x00fa('0x1e')],'include':_0x1b9dd2['include']?_['map'](_0x1b9dd2[_0x00fa('0x1b')],function(_0x3796ea){return{'model':db[_0x3796ea['model']],'as':_0x3796ea['as'],'attributes':_0x3796ea['attributes']};}):[]};}):[]};}):[]:[]})[_0x00fa('0xd')](function(_0x50af5a){logger['info']('GetFreshdeskAccount',_0x490f03);logger[_0x00fa('0x11')](_0x00fa('0x1f'),_0x490f03,JSON[_0x00fa('0x20')](_0x50af5a));_0xe9c997(_0x50af5a);})['catch'](function(_0x30b2ba){logger[_0x00fa('0x13')](_0x00fa('0x1f'),_0x30b2ba['message'],_0x490f03);_0x92a932(_0x1dcd82[_0x00fa('0x13')](0x1f4,_0x30b2ba['message']));});});};exports['ShowFreshdeskAccount']=function(_0x58415b){var _0x931d7d=this;return new Promise(function(_0x245f33,_0x18f9d2){return db[_0x00fa('0x17')][_0x00fa('0x21')]({'raw':_0x58415b[_0x00fa('0x19')]?_0x58415b[_0x00fa('0x19')][_0x00fa('0x22')]===undefined?!![]:![]:!![],'where':_0x58415b[_0x00fa('0x19')]?_0x58415b[_0x00fa('0x19')]['where']||null:null,'attributes':_0x58415b[_0x00fa('0x19')]?_0x58415b['options'][_0x00fa('0x1e')]||null:null,'include':_0x58415b[_0x00fa('0x19')]?_0x58415b['options'][_0x00fa('0x1b')]?_[_0x00fa('0x1c')](_0x58415b[_0x00fa('0x19')][_0x00fa('0x1b')],function(_0x1f0a89){return{'model':db[_0x1f0a89[_0x00fa('0x1d')]],'as':_0x1f0a89['as'],'attributes':_0x1f0a89[_0x00fa('0x1e')],'include':_0x1f0a89['include']?_[_0x00fa('0x1c')](_0x1f0a89[_0x00fa('0x1b')],function(_0x31b7be){return{'model':db[_0x31b7be[_0x00fa('0x1d')]],'as':_0x31b7be['as'],'attributes':_0x31b7be[_0x00fa('0x1e')],'include':_0x31b7be['include']?_[_0x00fa('0x1c')](_0x31b7be[_0x00fa('0x1b')],function(_0x2bca21){return{'model':db[_0x2bca21['model']],'as':_0x2bca21['as'],'attributes':_0x2bca21['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xee35ed){logger[_0x00fa('0xe')](_0x00fa('0x23'),_0x58415b);logger[_0x00fa('0x11')](_0x00fa('0x23'),_0x58415b,JSON['stringify'](_0xee35ed));_0x245f33(_0xee35ed);})[_0x00fa('0x24')](function(_0x571871){logger[_0x00fa('0x13')](_0x00fa('0x23'),_0x571871['message'],_0x58415b);_0x18f9d2(_0x931d7d[_0x00fa('0x13')](0x1f4,_0x571871[_0x00fa('0x15')]));});});};
\ No newline at end of file
+var _0xbefe=['options','where','attributes','limit','map','include','model','catch','FreshdeskAccount','find','raw','ShowFreshdeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshdeskAccount','findAll'];(function(_0x3e1226,_0x4199d6){var _0x1ff634=function(_0x4dbed0){while(--_0x4dbed0){_0x3e1226['push'](_0x3e1226['shift']());}};_0x1ff634(++_0x4199d6);}(_0xbefe,0x98));var _0xebef=function(_0x5106c1,_0x13233a){_0x5106c1=_0x5106c1-0x0;var _0x5bcaac=_0xbefe[_0x5106c1];return _0x5bcaac;};'use strict';var _=require(_0xebef('0x0'));var util=require('util');var moment=require(_0xebef('0x1'));var BPromise=require(_0xebef('0x2'));var rs=require(_0xebef('0x3'));var fs=require('fs');var Redis=require(_0xebef('0x4'));var db=require(_0xebef('0x5'))['db'];var utils=require(_0xebef('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xebef('0x7'));var client=jayson[_0xebef('0x8')][_0xebef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40de06,_0x3c8e89,_0x51a734){return new BPromise(function(_0x5e53fd,_0x5e49ed){return client[_0xebef('0xa')](_0x40de06,_0x51a734)[_0xebef('0xb')](function(_0x407ce0){logger[_0xebef('0xc')](_0xebef('0xd'),_0x3c8e89,'request\x20sent');logger[_0xebef('0xe')](_0xebef('0xf'),_0x3c8e89,'request\x20sent',JSON[_0xebef('0x10')](_0x407ce0));if(_0x407ce0[_0xebef('0x11')]){if(_0x407ce0[_0xebef('0x11')][_0xebef('0x12')]===0x1f4){logger[_0xebef('0x11')](_0xebef('0xd'),_0x3c8e89,_0x407ce0[_0xebef('0x11')][_0xebef('0x13')]);return _0x5e49ed(_0x407ce0[_0xebef('0x11')][_0xebef('0x13')]);}logger['error'](_0xebef('0xd'),_0x3c8e89,_0x407ce0[_0xebef('0x11')][_0xebef('0x13')]);return _0x5e53fd(_0x407ce0[_0xebef('0x11')]['message']);}else{logger[_0xebef('0xc')](_0xebef('0xd'),_0x3c8e89,'request\x20sent');_0x5e53fd(_0x407ce0[_0xebef('0x14')][_0xebef('0x13')]);}})['catch'](function(_0x10a84d){logger[_0xebef('0x11')](_0xebef('0xd'),_0x3c8e89,_0x10a84d);_0x5e49ed(_0x10a84d);});});}exports[_0xebef('0x15')]=function(_0xe9bd77){var _0x354654=this;return new Promise(function(_0x143082,_0x1cc3f6){return db['FreshdeskAccount'][_0xebef('0x16')]({'raw':_0xe9bd77[_0xebef('0x17')]?_0xe9bd77[_0xebef('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xe9bd77['options']?_0xe9bd77[_0xebef('0x17')][_0xebef('0x18')]||null:null,'attributes':_0xe9bd77[_0xebef('0x17')]?_0xe9bd77[_0xebef('0x17')][_0xebef('0x19')]||null:null,'limit':_0xe9bd77[_0xebef('0x17')]?_0xe9bd77[_0xebef('0x17')][_0xebef('0x1a')]||null:null,'include':_0xe9bd77[_0xebef('0x17')]?_0xe9bd77[_0xebef('0x17')]['include']?_[_0xebef('0x1b')](_0xe9bd77[_0xebef('0x17')][_0xebef('0x1c')],function(_0x2e3f3f){return{'model':db[_0x2e3f3f[_0xebef('0x1d')]],'as':_0x2e3f3f['as'],'attributes':_0x2e3f3f[_0xebef('0x19')],'include':_0x2e3f3f[_0xebef('0x1c')]?_['map'](_0x2e3f3f[_0xebef('0x1c')],function(_0x249088){return{'model':db[_0x249088[_0xebef('0x1d')]],'as':_0x249088['as'],'attributes':_0x249088[_0xebef('0x19')],'include':_0x249088[_0xebef('0x1c')]?_[_0xebef('0x1b')](_0x249088[_0xebef('0x1c')],function(_0x361f5d){return{'model':db[_0x361f5d[_0xebef('0x1d')]],'as':_0x361f5d['as'],'attributes':_0x361f5d[_0xebef('0x19')]};}):[]};}):[]};}):[]:[]})[_0xebef('0xb')](function(_0x15bf4b){logger[_0xebef('0xc')]('GetFreshdeskAccount',_0xe9bd77);logger['debug'](_0xebef('0x15'),_0xe9bd77,JSON[_0xebef('0x10')](_0x15bf4b));_0x143082(_0x15bf4b);})[_0xebef('0x1e')](function(_0x1d4930){logger[_0xebef('0x11')](_0xebef('0x15'),_0x1d4930[_0xebef('0x13')],_0xe9bd77);_0x1cc3f6(_0x354654[_0xebef('0x11')](0x1f4,_0x1d4930['message']));});});};exports['ShowFreshdeskAccount']=function(_0xee3c81){var _0x240020=this;return new Promise(function(_0x13f245,_0x5c1bc6){return db[_0xebef('0x1f')][_0xebef('0x20')]({'raw':_0xee3c81[_0xebef('0x17')]?_0xee3c81['options'][_0xebef('0x21')]===undefined?!![]:![]:!![],'where':_0xee3c81['options']?_0xee3c81['options'][_0xebef('0x18')]||null:null,'attributes':_0xee3c81[_0xebef('0x17')]?_0xee3c81[_0xebef('0x17')][_0xebef('0x19')]||null:null,'include':_0xee3c81[_0xebef('0x17')]?_0xee3c81[_0xebef('0x17')][_0xebef('0x1c')]?_[_0xebef('0x1b')](_0xee3c81[_0xebef('0x17')][_0xebef('0x1c')],function(_0xbff276){return{'model':db[_0xbff276['model']],'as':_0xbff276['as'],'attributes':_0xbff276[_0xebef('0x19')],'include':_0xbff276[_0xebef('0x1c')]?_[_0xebef('0x1b')](_0xbff276[_0xebef('0x1c')],function(_0x55f41c){return{'model':db[_0x55f41c[_0xebef('0x1d')]],'as':_0x55f41c['as'],'attributes':_0x55f41c['attributes'],'include':_0x55f41c[_0xebef('0x1c')]?_[_0xebef('0x1b')](_0x55f41c['include'],function(_0x12c4a6){return{'model':db[_0x12c4a6[_0xebef('0x1d')]],'as':_0x12c4a6['as'],'attributes':_0x12c4a6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x53c9be){logger[_0xebef('0xc')]('ShowFreshdeskAccount',_0xee3c81);logger['debug'](_0xebef('0x22'),_0xee3c81,JSON[_0xebef('0x10')](_0x53c9be));_0x13f245(_0x53c9be);})['catch'](function(_0x3e1fb3){logger['error'](_0xebef('0x22'),_0x3e1fb3['message'],_0xee3c81);_0x5c1bc6(_0x240020['error'](0x1f4,_0x3e1fb3['message']));});});};
\ No newline at end of file
index a687f16..a5a1252 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8be=['put','update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0xb8be,0x1f3));var _0xeb8b=function(_0x1488cd,_0x25a893){_0x1488cd=_0x1488cd-0x0;var _0x63fa13=_0xb8be[_0x1488cd];return _0x63fa13;};'use strict';var multer=require(_0xeb8b('0x0'));var util=require(_0xeb8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeb8b('0x2'));var router=express[_0xeb8b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xeb8b('0x4'));var config=require(_0xeb8b('0x5'));var controller=require(_0xeb8b('0x6'));router[_0xeb8b('0x7')]('/',auth[_0xeb8b('0x8')](),controller[_0xeb8b('0x9')]);router['get'](_0xeb8b('0xa'),auth[_0xeb8b('0x8')](),controller[_0xeb8b('0xb')]);router[_0xeb8b('0x7')](_0xeb8b('0xc'),auth[_0xeb8b('0x8')](),controller[_0xeb8b('0xd')]);router[_0xeb8b('0x7')](_0xeb8b('0xe'),auth['isAuthenticated'](),controller[_0xeb8b('0xf')]);router[_0xeb8b('0x7')](_0xeb8b('0x10'),auth['isAuthenticated'](),controller[_0xeb8b('0x11')]);router[_0xeb8b('0x7')](_0xeb8b('0x12'),auth[_0xeb8b('0x8')](),controller[_0xeb8b('0x13')]);router[_0xeb8b('0x14')]('/',auth[_0xeb8b('0x8')](),controller['create']);router[_0xeb8b('0x14')](_0xeb8b('0x12'),auth[_0xeb8b('0x8')](),controller['setTags']);router[_0xeb8b('0x15')](_0xeb8b('0xa'),auth[_0xeb8b('0x8')](),controller[_0xeb8b('0x16')]);router[_0xeb8b('0x17')](_0xeb8b('0xa'),auth[_0xeb8b('0x8')](),controller[_0xeb8b('0x18')]);module[_0xeb8b('0x19')]=router;
\ No newline at end of file
+var _0x8aac=['getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','/:id/fields','getFields','/:id/subjects'];(function(_0x11213b,_0x29ae71){var _0x438c75=function(_0x4a6094){while(--_0x4a6094){_0x11213b['push'](_0x11213b['shift']());}};_0x438c75(++_0x29ae71);}(_0x8aac,0xfb));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc8aa('0x0'));var util=require(_0xc8aa('0x1'));var path=require(_0xc8aa('0x2'));var timeout=require(_0xc8aa('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xc8aa('0x4'));var interaction=require(_0xc8aa('0x5'));var config=require(_0xc8aa('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0xc8aa('0x7')](),controller['index']);router[_0xc8aa('0x8')]('/:id',auth[_0xc8aa('0x7')](),controller[_0xc8aa('0x9')]);router[_0xc8aa('0x8')](_0xc8aa('0xa'),auth['isAuthenticated'](),controller[_0xc8aa('0xb')]);router[_0xc8aa('0x8')](_0xc8aa('0xc'),auth[_0xc8aa('0x7')](),controller[_0xc8aa('0xd')]);router[_0xc8aa('0x8')](_0xc8aa('0xe'),auth[_0xc8aa('0x7')](),controller[_0xc8aa('0xf')]);router[_0xc8aa('0x8')](_0xc8aa('0x10'),auth[_0xc8aa('0x7')](),controller['getTags']);router[_0xc8aa('0x11')]('/',auth[_0xc8aa('0x7')](),controller[_0xc8aa('0x12')]);router[_0xc8aa('0x11')](_0xc8aa('0x10'),auth[_0xc8aa('0x7')](),controller['setTags']);router[_0xc8aa('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xc8aa('0x14')]);router[_0xc8aa('0x15')]('/:id',auth[_0xc8aa('0x7')](),controller[_0xc8aa('0x16')]);module[_0xc8aa('0x17')]=router;
\ No newline at end of file
index 2940de8..8613411 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x016f=['STRING','sequelize','exports'];(function(_0x4f6f44,_0x545a2b){var _0x4c0d29=function(_0x1d2d7f){while(--_0x1d2d7f){_0x4f6f44['push'](_0x4f6f44['shift']());}};_0x4c0d29(++_0x545a2b);}(_0x016f,0xe5));var _0xf016=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x016f[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0xf016('0x0'));module[_0xf016('0x1')]={'name':{'type':Sequelize[_0xf016('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6ce3=['exports','STRING','sequelize'];(function(_0x3f4683,_0x4062f9){var _0x1a80aa=function(_0x5dea92){while(--_0x5dea92){_0x3f4683['push'](_0x3f4683['shift']());}};_0x1a80aa(++_0x4062f9);}(_0x6ce3,0x7d));var _0x36ce=function(_0x3acd25,_0x10c48a){_0x3acd25=_0x3acd25-0x0;var _0x5b5bbf=_0x6ce3[_0x3acd25];return _0x5b5bbf;};'use strict';var Sequelize=require(_0x36ce('0x0'));module[_0x36ce('0x1')]={'name':{'type':Sequelize[_0x36ce('0x2')]},'description':{'type':Sequelize[_0x36ce('0x2')]}};
\ No newline at end of file
index 4e573c1..1e5e55f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf3e=['options','find','create','body','getFields','findOne','FreshdeskField','length','nolimit','getDescriptions','getTags','Tag','ids','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','catch','show','params'];(function(_0x415183,_0xedf18f){var _0x23678f=function(_0x196729){while(--_0x196729){_0x415183['push'](_0x415183['shift']());}};_0x23678f(++_0xedf18f);}(_0xaf3e,0xcf));var _0xeaf3=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0xaf3e[_0x4ea413];return _0x51cf25;};'use strict';var pdf=require(_0xeaf3('0x0'));var emlformat=require(_0xeaf3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xeaf3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeaf3('0x3'));var moment=require(_0xeaf3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeaf3('0x5'));var util=require(_0xeaf3('0x6'));var path=require(_0xeaf3('0x7'));var sox=require(_0xeaf3('0x8'));var csv=require(_0xeaf3('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeaf3('0xa'));var squel=require(_0xeaf3('0xb'));var crypto=require(_0xeaf3('0xc'));var jsforce=require(_0xeaf3('0xd'));var deskjs=require(_0xeaf3('0xe'));var toCsv=require(_0xeaf3('0x9'));var querystring=require('querystring');var Papa=require(_0xeaf3('0xf'));var Redis=require('ioredis');var authService=require(_0xeaf3('0x10'));var qs=require(_0xeaf3('0x11'));var as=require(_0xeaf3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeaf3('0x13'))(_0xeaf3('0x14'));var utils=require('../../config/utils');var config=require(_0xeaf3('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xeaf3('0x16'));var client=jayson[_0xeaf3('0x17')][_0xeaf3('0x18')]({'port':0x232a});function checkPasswordPattern(_0x203902,_0x5349bf,_0x470165){if(_0x470165){var _0x105c7e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x105c7e[_0xeaf3('0x19')](_0x5349bf)){return _0x203902;}else{throw new db[(_0xeaf3('0x1a'))]['ValidationError'](_0xeaf3('0x1b'));}}else{return _0x203902;}}function respondWithRpcPromise(_0x551b2c,_0x156f63,_0x5468f2,_0x568b43){return new BPromise(function(_0xf647fd,_0x1ae7c3){var _0xf5baba=_0x568b43||client;return _0xf5baba[_0xeaf3('0x1c')](_0x551b2c,_0x5468f2)[_0xeaf3('0x1d')](function(_0x8a8a04){logger['info'](_0xeaf3('0x1e'),_0x156f63,'request\x20sent');logger[_0xeaf3('0x1f')](_0xeaf3('0x20'),_0x156f63,'request\x20sent',JSON[_0xeaf3('0x21')](_0x8a8a04));if(_0x8a8a04[_0xeaf3('0x22')]){if(_0x8a8a04[_0xeaf3('0x22')][_0xeaf3('0x23')]===0x1f4){logger[_0xeaf3('0x22')](_0xeaf3('0x1e'),_0x156f63,_0x8a8a04[_0xeaf3('0x22')][_0xeaf3('0x24')]);return _0x1ae7c3(_0x8a8a04[_0xeaf3('0x22')][_0xeaf3('0x24')]);}logger[_0xeaf3('0x22')](_0xeaf3('0x1e'),_0x156f63,_0x8a8a04[_0xeaf3('0x22')]['message']);return _0xf647fd(_0x8a8a04['error'][_0xeaf3('0x24')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x156f63,_0xeaf3('0x25'));_0xf647fd(_0x8a8a04[_0xeaf3('0x26')][_0xeaf3('0x24')]);}})['catch'](function(_0x5bc55c){logger[_0xeaf3('0x22')](_0xeaf3('0x1e'),_0x156f63,_0x5bc55c);_0x1ae7c3(_0x5bc55c);});});}function respondWithStatusCode(_0x5bedab,_0x1d2377){_0x1d2377=_0x1d2377||0xcc;return function(_0x446056){if(_0x446056){return _0x5bedab[_0xeaf3('0x27')](_0x1d2377);}return _0x5bedab[_0xeaf3('0x28')](_0x1d2377)[_0xeaf3('0x29')]();};}function respondWithResult(_0x179376,_0x5a69d2){_0x5a69d2=_0x5a69d2||0xc8;return function(_0x4de831){if(_0x4de831){return _0x179376[_0xeaf3('0x28')](_0x5a69d2)[_0xeaf3('0x2a')](_0x4de831);}};}function respondWithFilteredResult(_0x2fe525,_0x2f0880){return function(_0x22034b){if(_0x22034b){var _0x29f2e4=_0x22034b['count'],_0x5a0c96=_0x2f0880['offset'],_0x14f689=_0x2f0880[_0xeaf3('0x2b')]+_0x2f0880[_0xeaf3('0x2c')],_0x379cf5;if(_0x14f689>=_0x29f2e4){_0x14f689=_0x29f2e4;_0x379cf5=0xc8;}else{_0x379cf5=0xce;}_0x2fe525[_0xeaf3('0x28')](_0x379cf5);return _0x2fe525[_0xeaf3('0x2d')](_0xeaf3('0x2e'),_0x5a0c96+'-'+_0x14f689+'/'+_0x29f2e4)[_0xeaf3('0x2a')](_0x22034b);}return null;};}function patchUpdates(_0x937b6f){return function(_0x38a81a){try{jsonpatch[_0xeaf3('0x2f')](_0x38a81a,_0x937b6f,!![]);}catch(_0x2489d0){return BPromise[_0xeaf3('0x30')](_0x2489d0);}return _0x38a81a[_0xeaf3('0x31')]();};}function saveUpdates(_0x56d202,_0x15d834){return function(_0x4eec11){if(_0x4eec11){return _0x4eec11[_0xeaf3('0x32')](_0x56d202)[_0xeaf3('0x1d')](function(_0x178de0){return _0x178de0;});}return null;};}function removeEntity(_0x3f6c37,_0x40b430){return function(_0x578ed3){if(_0x578ed3){return _0x578ed3[_0xeaf3('0x33')]()['then'](function(){_0x3f6c37['status'](0xcc)[_0xeaf3('0x29')]();});}};}function handleEntityNotFound(_0x55bf35,_0x5f319c){return function(_0xefa82a){if(!_0xefa82a){_0x55bf35[_0xeaf3('0x27')](0x194);}return _0xefa82a;};}function handleError(_0x21d1cc,_0x1e2f64){_0x1e2f64=_0x1e2f64||0x1f4;return function(_0xda4de2){logger['error'](_0xda4de2[_0xeaf3('0x34')]);if(_0xda4de2[_0xeaf3('0x35')]){delete _0xda4de2[_0xeaf3('0x35')];}_0x21d1cc[_0xeaf3('0x28')](_0x1e2f64)[_0xeaf3('0x36')](_0xda4de2);};}exports[_0xeaf3('0x37')]=function(_0x2c8144,_0x30d353){var _0xc4d4f9={},_0x223142={},_0xe5ca22={'count':0x0,'rows':[]};var _0xee05a=_[_0xeaf3('0x38')](db[_0xeaf3('0x39')][_0xeaf3('0x3a')],function(_0x269f6c){return{'name':_0x269f6c[_0xeaf3('0x3b')],'type':_0x269f6c[_0xeaf3('0x3c')][_0xeaf3('0x3d')]};});_0x223142[_0xeaf3('0x3e')]=_[_0xeaf3('0x38')](_0xee05a,'name');_0x223142[_0xeaf3('0x3f')]=_[_0xeaf3('0x40')](_0x2c8144[_0xeaf3('0x3f')]);_0x223142[_0xeaf3('0x41')]=_[_0xeaf3('0x42')](_0x223142[_0xeaf3('0x3e')],_0x223142['query']);_0xc4d4f9[_0xeaf3('0x43')]=_['intersection'](_0x223142[_0xeaf3('0x3e')],qs[_0xeaf3('0x44')](_0x2c8144['query'][_0xeaf3('0x44')]));_0xc4d4f9[_0xeaf3('0x43')]=_0xc4d4f9[_0xeaf3('0x43')]['length']?_0xc4d4f9['attributes']:_0x223142[_0xeaf3('0x3e')];if(!_0x2c8144[_0xeaf3('0x3f')][_0xeaf3('0x45')]('nolimit')){_0xc4d4f9[_0xeaf3('0x2c')]=qs[_0xeaf3('0x2c')](_0x2c8144['query'][_0xeaf3('0x2c')]);_0xc4d4f9[_0xeaf3('0x2b')]=qs[_0xeaf3('0x2b')](_0x2c8144[_0xeaf3('0x3f')][_0xeaf3('0x2b')]);}_0xc4d4f9[_0xeaf3('0x46')]=qs[_0xeaf3('0x47')](_0x2c8144[_0xeaf3('0x3f')][_0xeaf3('0x47')]);_0xc4d4f9[_0xeaf3('0x48')]=qs[_0xeaf3('0x41')](_[_0xeaf3('0x49')](_0x2c8144[_0xeaf3('0x3f')],_0x223142[_0xeaf3('0x41')]),_0xee05a);if(_0x2c8144[_0xeaf3('0x3f')][_0xeaf3('0x4a')]){_0xc4d4f9[_0xeaf3('0x48')]=_[_0xeaf3('0x4b')](_0xc4d4f9[_0xeaf3('0x48')],{'$or':_[_0xeaf3('0x38')](_0xee05a,function(_0x1cae31){if(_0x1cae31[_0xeaf3('0x3c')]!==_0xeaf3('0x4c')){var _0x3cd057={};_0x3cd057[_0x1cae31['name']]={'$like':'%'+_0x2c8144[_0xeaf3('0x3f')][_0xeaf3('0x4a')]+'%'};return _0x3cd057;}})});}_0xc4d4f9=_['merge']({},_0xc4d4f9,_0x2c8144['options']);var _0x276796={'where':_0xc4d4f9[_0xeaf3('0x48')]};return db[_0xeaf3('0x39')][_0xeaf3('0x4d')](_0x276796)['then'](function(_0x4e5cf3){_0xe5ca22['count']=_0x4e5cf3;if(_0x2c8144[_0xeaf3('0x3f')]['includeAll']){_0xc4d4f9[_0xeaf3('0x4e')]=[{'all':!![]}];}return db[_0xeaf3('0x39')][_0xeaf3('0x4f')](_0xc4d4f9);})[_0xeaf3('0x1d')](function(_0x184d1d){_0xe5ca22[_0xeaf3('0x50')]=_0x184d1d;return _0xe5ca22;})['then'](respondWithFilteredResult(_0x30d353,_0xc4d4f9))[_0xeaf3('0x51')](handleError(_0x30d353,null));};exports[_0xeaf3('0x52')]=function(_0x4e56a7,_0x471b28){var _0x5791b9={'raw':![],'where':{'id':_0x4e56a7[_0xeaf3('0x53')]['id']}},_0x11542b={};_0x11542b['model']=_[_0xeaf3('0x40')](db[_0xeaf3('0x39')][_0xeaf3('0x3a')]);_0x11542b[_0xeaf3('0x3f')]=_[_0xeaf3('0x40')](_0x4e56a7[_0xeaf3('0x3f')]);_0x11542b['filters']=_[_0xeaf3('0x42')](_0x11542b[_0xeaf3('0x3e')],_0x11542b['query']);_0x5791b9[_0xeaf3('0x43')]=_[_0xeaf3('0x42')](_0x11542b['model'],qs[_0xeaf3('0x44')](_0x4e56a7[_0xeaf3('0x3f')][_0xeaf3('0x44')]));_0x5791b9['attributes']=_0x5791b9[_0xeaf3('0x43')]['length']?_0x5791b9[_0xeaf3('0x43')]:_0x11542b[_0xeaf3('0x3e')];if(_0x4e56a7['query']['includeAll']){_0x5791b9['include']=[{'all':!![]}];}_0x5791b9=_['merge']({},_0x5791b9,_0x4e56a7[_0xeaf3('0x54')]);return db[_0xeaf3('0x39')][_0xeaf3('0x55')](_0x5791b9)['then'](handleEntityNotFound(_0x471b28,null))['then'](respondWithResult(_0x471b28,null))[_0xeaf3('0x51')](handleError(_0x471b28,null));};exports[_0xeaf3('0x56')]=function(_0x5309f8,_0x143237){return db[_0xeaf3('0x39')][_0xeaf3('0x56')](_0x5309f8[_0xeaf3('0x57')],{})[_0xeaf3('0x1d')](respondWithResult(_0x143237,0xc9))[_0xeaf3('0x51')](handleError(_0x143237,null));};exports['update']=function(_0x4645a6,_0xfb2c87){if(_0x4645a6['body']['id']){delete _0x4645a6[_0xeaf3('0x57')]['id'];}return db[_0xeaf3('0x39')]['find']({'where':{'id':_0x4645a6[_0xeaf3('0x53')]['id']}})['then'](handleEntityNotFound(_0xfb2c87,null))[_0xeaf3('0x1d')](saveUpdates(_0x4645a6[_0xeaf3('0x57')],null))['then'](respondWithResult(_0xfb2c87,null))['catch'](handleError(_0xfb2c87,null));};exports['destroy']=function(_0x3b5849,_0x33b100){return db['FreshdeskConfiguration'][_0xeaf3('0x55')]({'where':{'id':_0x3b5849['params']['id']}})[_0xeaf3('0x1d')](handleEntityNotFound(_0x33b100,null))[_0xeaf3('0x1d')](removeEntity(_0x33b100,null))[_0xeaf3('0x51')](handleError(_0x33b100,null));};exports[_0xeaf3('0x58')]=function(_0x53f5a4,_0x1509ce,_0xc56f4b){var _0x33023d={};var _0x47374f={};var _0x19b686;var _0x3bc1bb;return db[_0xeaf3('0x39')][_0xeaf3('0x59')]({'where':{'id':_0x53f5a4[_0xeaf3('0x53')]['id']}})[_0xeaf3('0x1d')](handleEntityNotFound(_0x1509ce,null))[_0xeaf3('0x1d')](function(_0x29805a){if(_0x29805a){_0x19b686=_0x29805a;_0x47374f[_0xeaf3('0x3e')]=_[_0xeaf3('0x40')](db[_0xeaf3('0x5a')][_0xeaf3('0x3a')]);_0x47374f['query']=_[_0xeaf3('0x40')](_0x53f5a4[_0xeaf3('0x3f')]);_0x47374f['filters']=_[_0xeaf3('0x42')](_0x47374f[_0xeaf3('0x3e')],_0x47374f['query']);_0x33023d[_0xeaf3('0x43')]=_[_0xeaf3('0x42')](_0x47374f[_0xeaf3('0x3e')],qs['fields'](_0x53f5a4[_0xeaf3('0x3f')]['fields']));_0x33023d[_0xeaf3('0x43')]=_0x33023d[_0xeaf3('0x43')][_0xeaf3('0x5b')]?_0x33023d[_0xeaf3('0x43')]:_0x47374f[_0xeaf3('0x3e')];_0x33023d[_0xeaf3('0x46')]=qs[_0xeaf3('0x47')](_0x53f5a4[_0xeaf3('0x3f')]['sort']);_0x33023d[_0xeaf3('0x48')]=qs[_0xeaf3('0x41')](_[_0xeaf3('0x49')](_0x53f5a4[_0xeaf3('0x3f')],_0x47374f[_0xeaf3('0x41')]));if(_0x53f5a4[_0xeaf3('0x3f')][_0xeaf3('0x4a')]){_0x33023d[_0xeaf3('0x48')]=_['merge'](_0x33023d[_0xeaf3('0x48')],{'$or':_[_0xeaf3('0x38')](_0x33023d[_0xeaf3('0x43')],function(_0x48d9ad){var _0xf7be13={};_0xf7be13[_0x48d9ad]={'$like':'%'+_0x53f5a4['query'][_0xeaf3('0x4a')]+'%'};return _0xf7be13;})});}_0x33023d=_[_0xeaf3('0x4b')]({},_0x33023d,_0x53f5a4[_0xeaf3('0x54')]);return _0x19b686['getFields'](_0x33023d);}})[_0xeaf3('0x1d')](function(_0x3e5115){if(_0x3e5115){_0x3bc1bb=_0x3e5115[_0xeaf3('0x5b')];if(!_0x53f5a4[_0xeaf3('0x3f')][_0xeaf3('0x45')](_0xeaf3('0x5c'))){_0x33023d[_0xeaf3('0x2c')]=qs[_0xeaf3('0x2c')](_0x53f5a4[_0xeaf3('0x3f')][_0xeaf3('0x2c')]);_0x33023d['offset']=qs[_0xeaf3('0x2b')](_0x53f5a4[_0xeaf3('0x3f')][_0xeaf3('0x2b')]);}return _0x19b686[_0xeaf3('0x58')](_0x33023d);}})[_0xeaf3('0x1d')](function(_0xd85160){if(_0xd85160){return _0xd85160?{'count':_0x3bc1bb,'rows':_0xd85160}:null;}})['then'](respondWithResult(_0x1509ce,null))[_0xeaf3('0x51')](handleError(_0x1509ce,null));};exports['getSubjects']=function(_0x4bc7cb,_0x4c044e,_0x121774){var _0x576064={};var _0x27bcc1={};var _0x4c4586;var _0x1037ce;return db[_0xeaf3('0x39')][_0xeaf3('0x59')]({'where':{'id':_0x4bc7cb[_0xeaf3('0x53')]['id']}})[_0xeaf3('0x1d')](handleEntityNotFound(_0x4c044e,null))[_0xeaf3('0x1d')](function(_0x10919c){if(_0x10919c){_0x4c4586=_0x10919c;_0x27bcc1[_0xeaf3('0x3e')]=_[_0xeaf3('0x40')](db[_0xeaf3('0x5a')][_0xeaf3('0x3a')]);_0x27bcc1[_0xeaf3('0x3f')]=_['keys'](_0x4bc7cb[_0xeaf3('0x3f')]);_0x27bcc1[_0xeaf3('0x41')]=_[_0xeaf3('0x42')](_0x27bcc1[_0xeaf3('0x3e')],_0x27bcc1[_0xeaf3('0x3f')]);_0x576064[_0xeaf3('0x43')]=_[_0xeaf3('0x42')](_0x27bcc1[_0xeaf3('0x3e')],qs[_0xeaf3('0x44')](_0x4bc7cb[_0xeaf3('0x3f')][_0xeaf3('0x44')]));_0x576064['attributes']=_0x576064[_0xeaf3('0x43')][_0xeaf3('0x5b')]?_0x576064[_0xeaf3('0x43')]:_0x27bcc1[_0xeaf3('0x3e')];_0x576064[_0xeaf3('0x46')]=qs[_0xeaf3('0x47')](_0x4bc7cb[_0xeaf3('0x3f')][_0xeaf3('0x47')]);_0x576064[_0xeaf3('0x48')]=qs[_0xeaf3('0x41')](_[_0xeaf3('0x49')](_0x4bc7cb[_0xeaf3('0x3f')],_0x27bcc1['filters']));if(_0x4bc7cb[_0xeaf3('0x3f')][_0xeaf3('0x4a')]){_0x576064[_0xeaf3('0x48')]=_[_0xeaf3('0x4b')](_0x576064['where'],{'$or':_[_0xeaf3('0x38')](_0x576064[_0xeaf3('0x43')],function(_0x35fff2){var _0x1822a7={};_0x1822a7[_0x35fff2]={'$like':'%'+_0x4bc7cb[_0xeaf3('0x3f')][_0xeaf3('0x4a')]+'%'};return _0x1822a7;})});}_0x576064=_[_0xeaf3('0x4b')]({},_0x576064,_0x4bc7cb[_0xeaf3('0x54')]);return _0x4c4586['getSubjects'](_0x576064);}})[_0xeaf3('0x1d')](function(_0x59950d){if(_0x59950d){_0x1037ce=_0x59950d[_0xeaf3('0x5b')];if(!_0x4bc7cb[_0xeaf3('0x3f')][_0xeaf3('0x45')](_0xeaf3('0x5c'))){_0x576064[_0xeaf3('0x2c')]=qs[_0xeaf3('0x2c')](_0x4bc7cb[_0xeaf3('0x3f')][_0xeaf3('0x2c')]);_0x576064[_0xeaf3('0x2b')]=qs[_0xeaf3('0x2b')](_0x4bc7cb[_0xeaf3('0x3f')][_0xeaf3('0x2b')]);}return _0x4c4586['getSubjects'](_0x576064);}})[_0xeaf3('0x1d')](function(_0x325846){if(_0x325846){return _0x325846?{'count':_0x1037ce,'rows':_0x325846}:null;}})[_0xeaf3('0x1d')](respondWithResult(_0x4c044e,null))[_0xeaf3('0x51')](handleError(_0x4c044e,null));};exports[_0xeaf3('0x5d')]=function(_0x3cf485,_0x548297,_0x4cdf45){var _0x2236e2={};var _0x4f5054={};var _0x4ca24f;var _0x443222;return db[_0xeaf3('0x39')][_0xeaf3('0x59')]({'where':{'id':_0x3cf485[_0xeaf3('0x53')]['id']}})[_0xeaf3('0x1d')](handleEntityNotFound(_0x548297,null))[_0xeaf3('0x1d')](function(_0x66744f){if(_0x66744f){_0x4ca24f=_0x66744f;_0x4f5054[_0xeaf3('0x3e')]=_['keys'](db[_0xeaf3('0x5a')]['rawAttributes']);_0x4f5054[_0xeaf3('0x3f')]=_[_0xeaf3('0x40')](_0x3cf485[_0xeaf3('0x3f')]);_0x4f5054['filters']=_[_0xeaf3('0x42')](_0x4f5054[_0xeaf3('0x3e')],_0x4f5054[_0xeaf3('0x3f')]);_0x2236e2[_0xeaf3('0x43')]=_['intersection'](_0x4f5054['model'],qs[_0xeaf3('0x44')](_0x3cf485[_0xeaf3('0x3f')][_0xeaf3('0x44')]));_0x2236e2['attributes']=_0x2236e2[_0xeaf3('0x43')][_0xeaf3('0x5b')]?_0x2236e2[_0xeaf3('0x43')]:_0x4f5054[_0xeaf3('0x3e')];_0x2236e2[_0xeaf3('0x46')]=qs['sort'](_0x3cf485[_0xeaf3('0x3f')][_0xeaf3('0x47')]);_0x2236e2['where']=qs[_0xeaf3('0x41')](_[_0xeaf3('0x49')](_0x3cf485[_0xeaf3('0x3f')],_0x4f5054['filters']));if(_0x3cf485[_0xeaf3('0x3f')][_0xeaf3('0x4a')]){_0x2236e2[_0xeaf3('0x48')]=_[_0xeaf3('0x4b')](_0x2236e2['where'],{'$or':_[_0xeaf3('0x38')](_0x2236e2[_0xeaf3('0x43')],function(_0x166c98){var _0xb364d0={};_0xb364d0[_0x166c98]={'$like':'%'+_0x3cf485[_0xeaf3('0x3f')][_0xeaf3('0x4a')]+'%'};return _0xb364d0;})});}_0x2236e2=_['merge']({},_0x2236e2,_0x3cf485[_0xeaf3('0x54')]);return _0x4ca24f[_0xeaf3('0x5d')](_0x2236e2);}})[_0xeaf3('0x1d')](function(_0x253209){if(_0x253209){_0x443222=_0x253209[_0xeaf3('0x5b')];if(!_0x3cf485[_0xeaf3('0x3f')][_0xeaf3('0x45')](_0xeaf3('0x5c'))){_0x2236e2[_0xeaf3('0x2c')]=qs[_0xeaf3('0x2c')](_0x3cf485['query'][_0xeaf3('0x2c')]);_0x2236e2[_0xeaf3('0x2b')]=qs[_0xeaf3('0x2b')](_0x3cf485[_0xeaf3('0x3f')]['offset']);}return _0x4ca24f[_0xeaf3('0x5d')](_0x2236e2);}})['then'](function(_0x53b25b){if(_0x53b25b){return _0x53b25b?{'count':_0x443222,'rows':_0x53b25b}:null;}})[_0xeaf3('0x1d')](respondWithResult(_0x548297,null))[_0xeaf3('0x51')](handleError(_0x548297,null));};exports[_0xeaf3('0x5e')]=function(_0x16980d,_0x220250,_0x4c53d7){var _0x532470={};var _0x5283c1={};var _0x8f74b8;var _0x1cb7dd;return db['FreshdeskConfiguration'][_0xeaf3('0x59')]({'where':{'id':_0x16980d[_0xeaf3('0x53')]['id']}})['then'](handleEntityNotFound(_0x220250,null))[_0xeaf3('0x1d')](function(_0x23a5e5){if(_0x23a5e5){_0x8f74b8=_0x23a5e5;_0x5283c1['model']=_['keys'](db[_0xeaf3('0x5f')][_0xeaf3('0x3a')]);_0x5283c1[_0xeaf3('0x3f')]=_[_0xeaf3('0x40')](_0x16980d[_0xeaf3('0x3f')]);_0x5283c1['filters']=_['intersection'](_0x5283c1[_0xeaf3('0x3e')],_0x5283c1[_0xeaf3('0x3f')]);_0x532470['attributes']=_[_0xeaf3('0x42')](_0x5283c1[_0xeaf3('0x3e')],qs[_0xeaf3('0x44')](_0x16980d['query']['fields']));_0x532470[_0xeaf3('0x43')]=_0x532470[_0xeaf3('0x43')]['length']?_0x532470['attributes']:_0x5283c1[_0xeaf3('0x3e')];_0x532470[_0xeaf3('0x46')]=qs[_0xeaf3('0x47')](_0x16980d['query'][_0xeaf3('0x47')]);_0x532470[_0xeaf3('0x48')]=qs[_0xeaf3('0x41')](_[_0xeaf3('0x49')](_0x16980d[_0xeaf3('0x3f')],_0x5283c1[_0xeaf3('0x41')]));if(_0x16980d['query'][_0xeaf3('0x4a')]){_0x532470['where']=_[_0xeaf3('0x4b')](_0x532470['where'],{'$or':_['map'](_0x532470['attributes'],function(_0x105d95){var _0x137342={};_0x137342[_0x105d95]={'$like':'%'+_0x16980d[_0xeaf3('0x3f')]['filter']+'%'};return _0x137342;})});}_0x532470=_[_0xeaf3('0x4b')]({},_0x532470,_0x16980d[_0xeaf3('0x54')]);return _0x8f74b8[_0xeaf3('0x5e')](_0x532470);}})[_0xeaf3('0x1d')](function(_0x475140){if(_0x475140){_0x1cb7dd=_0x475140[_0xeaf3('0x5b')];if(!_0x16980d[_0xeaf3('0x3f')]['hasOwnProperty']('nolimit')){_0x532470[_0xeaf3('0x2c')]=qs[_0xeaf3('0x2c')](_0x16980d[_0xeaf3('0x3f')]['limit']);_0x532470[_0xeaf3('0x2b')]=qs[_0xeaf3('0x2b')](_0x16980d[_0xeaf3('0x3f')][_0xeaf3('0x2b')]);}return _0x8f74b8[_0xeaf3('0x5e')](_0x532470);}})['then'](function(_0x7b6c7e){if(_0x7b6c7e){return _0x7b6c7e?{'count':_0x1cb7dd,'rows':_0x7b6c7e}:null;}})['then'](respondWithResult(_0x220250,null))['catch'](handleError(_0x220250,null));};exports['setTags']=function(_0x4e0e27,_0x517fde,_0x1e90bb){if(_0x4e0e27[_0xeaf3('0x57')]['id']){delete _0x4e0e27[_0xeaf3('0x57')]['id'];}return db[_0xeaf3('0x39')][_0xeaf3('0x59')]({'where':{'id':_0x4e0e27['params']['id']}})[_0xeaf3('0x1d')](handleEntityNotFound(_0x517fde,null))[_0xeaf3('0x1d')](function(_0x51d0e4){if(_0x51d0e4){return _0x51d0e4['setTags'](_0x4e0e27[_0xeaf3('0x57')][_0xeaf3('0x60')]||[]);}return null;})[_0xeaf3('0x1d')](respondWithResult(_0x517fde,null))[_0xeaf3('0x51')](handleError(_0x517fde,null));};
\ No newline at end of file
+var _0x8eac=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/environment','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','show','options','create','body','params','find','getFields','getSubjects','findOne','FreshdeskField','getDescriptions','Tag','getTags','setTags','ids','html-pdf'];(function(_0x40552e,_0x37fa1c){var _0x1a71ca=function(_0x370d43){while(--_0x370d43){_0x40552e['push'](_0x40552e['shift']());}};_0x1a71ca(++_0x37fa1c);}(_0x8eac,0x11c));var _0xc8ea=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x8eac[_0x1344d6];return _0xf45b24;};'use strict';var pdf=require(_0xc8ea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc8ea('0x1'));var zipdir=require(_0xc8ea('0x2'));var jsonpatch=require(_0xc8ea('0x3'));var rp=require(_0xc8ea('0x4'));var moment=require(_0xc8ea('0x5'));var BPromise=require(_0xc8ea('0x6'));var Mustache=require(_0xc8ea('0x7'));var util=require(_0xc8ea('0x8'));var path=require(_0xc8ea('0x9'));var sox=require(_0xc8ea('0xa'));var csv=require(_0xc8ea('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc8ea('0xc'));var squel=require(_0xc8ea('0xd'));var crypto=require(_0xc8ea('0xe'));var jsforce=require(_0xc8ea('0xf'));var deskjs=require(_0xc8ea('0x10'));var toCsv=require(_0xc8ea('0xb'));var querystring=require(_0xc8ea('0x11'));var Papa=require(_0xc8ea('0x12'));var Redis=require(_0xc8ea('0x13'));var authService=require(_0xc8ea('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc8ea('0x15'));var utils=require('../../config/utils');var config=require(_0xc8ea('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xc8ea('0x17'));var client=jayson[_0xc8ea('0x18')][_0xc8ea('0x19')]({'port':0x232a});function checkPasswordPattern(_0x241e77,_0x4e52dd,_0x3e7ebc){if(_0x3e7ebc){var _0x574b59=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x574b59['test'](_0x4e52dd)){return _0x241e77;}else{throw new db[(_0xc8ea('0x1a'))][(_0xc8ea('0x1b'))](_0xc8ea('0x1c'));}}else{return _0x241e77;}}function respondWithRpcPromise(_0x44a280,_0x5bcafc,_0x2f0c14,_0x6e8671){return new BPromise(function(_0x489807,_0x225e91){var _0x276522=_0x6e8671||client;return _0x276522[_0xc8ea('0x1d')](_0x44a280,_0x2f0c14)[_0xc8ea('0x1e')](function(_0x65f14d){logger[_0xc8ea('0x1f')](_0xc8ea('0x20'),_0x5bcafc,_0xc8ea('0x21'));logger['debug'](_0xc8ea('0x22'),_0x5bcafc,'request\x20sent',JSON[_0xc8ea('0x23')](_0x65f14d));if(_0x65f14d[_0xc8ea('0x24')]){if(_0x65f14d[_0xc8ea('0x24')]['code']===0x1f4){logger[_0xc8ea('0x24')](_0xc8ea('0x20'),_0x5bcafc,_0x65f14d[_0xc8ea('0x24')][_0xc8ea('0x25')]);return _0x225e91(_0x65f14d['error'][_0xc8ea('0x25')]);}logger[_0xc8ea('0x24')](_0xc8ea('0x20'),_0x5bcafc,_0x65f14d['error']['message']);return _0x489807(_0x65f14d['error']['message']);}else{logger['info'](_0xc8ea('0x20'),_0x5bcafc,_0xc8ea('0x21'));_0x489807(_0x65f14d['result'][_0xc8ea('0x25')]);}})[_0xc8ea('0x26')](function(_0xdd3bcd){logger[_0xc8ea('0x24')](_0xc8ea('0x20'),_0x5bcafc,_0xdd3bcd);_0x225e91(_0xdd3bcd);});});}function respondWithStatusCode(_0x21db35,_0x588933){_0x588933=_0x588933||0xcc;return function(_0x5abdbc){if(_0x5abdbc){return _0x21db35[_0xc8ea('0x27')](_0x588933);}return _0x21db35['status'](_0x588933)['end']();};}function respondWithResult(_0x33f9c9,_0x336223){_0x336223=_0x336223||0xc8;return function(_0x2c8007){if(_0x2c8007){return _0x33f9c9[_0xc8ea('0x28')](_0x336223)[_0xc8ea('0x29')](_0x2c8007);}};}function respondWithFilteredResult(_0x57a8d8,_0xffd732){return function(_0x5c29a8){if(_0x5c29a8){var _0x87abfb=_0x5c29a8['count'],_0x325c65=_0xffd732['offset'],_0x1286fc=_0xffd732[_0xc8ea('0x2a')]+_0xffd732[_0xc8ea('0x2b')],_0x1bc8ee;if(_0x1286fc>=_0x87abfb){_0x1286fc=_0x87abfb;_0x1bc8ee=0xc8;}else{_0x1bc8ee=0xce;}_0x57a8d8['status'](_0x1bc8ee);return _0x57a8d8[_0xc8ea('0x2c')](_0xc8ea('0x2d'),_0x325c65+'-'+_0x1286fc+'/'+_0x87abfb)[_0xc8ea('0x29')](_0x5c29a8);}return null;};}function patchUpdates(_0x5d07df){return function(_0xd6e1c9){try{jsonpatch['apply'](_0xd6e1c9,_0x5d07df,!![]);}catch(_0x37e207){return BPromise[_0xc8ea('0x2e')](_0x37e207);}return _0xd6e1c9[_0xc8ea('0x2f')]();};}function saveUpdates(_0x2ec119,_0x13ddea){return function(_0x85ac){if(_0x85ac){return _0x85ac['update'](_0x2ec119)[_0xc8ea('0x1e')](function(_0x3ff0e7){return _0x3ff0e7;});}return null;};}function removeEntity(_0x4d478c,_0x5de8a9){return function(_0x4f3786){if(_0x4f3786){return _0x4f3786[_0xc8ea('0x30')]()[_0xc8ea('0x1e')](function(){_0x4d478c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20dbd3,_0x5d1fa5){return function(_0x53277c){if(!_0x53277c){_0x20dbd3[_0xc8ea('0x27')](0x194);}return _0x53277c;};}function handleError(_0x3a9be8,_0x2ad5ee){_0x2ad5ee=_0x2ad5ee||0x1f4;return function(_0x5e8b8b){logger['error'](_0x5e8b8b[_0xc8ea('0x31')]);if(_0x5e8b8b['name']){delete _0x5e8b8b[_0xc8ea('0x32')];}_0x3a9be8['status'](_0x2ad5ee)[_0xc8ea('0x33')](_0x5e8b8b);};}exports[_0xc8ea('0x34')]=function(_0x8e2a4e,_0x364e05){var _0x1ec332={},_0x5cb232={},_0x5cf332={'count':0x0,'rows':[]};var _0x1ddd36=_[_0xc8ea('0x35')](db[_0xc8ea('0x36')][_0xc8ea('0x37')],function(_0x3338e4){return{'name':_0x3338e4[_0xc8ea('0x38')],'type':_0x3338e4[_0xc8ea('0x39')][_0xc8ea('0x3a')]};});_0x5cb232['model']=_[_0xc8ea('0x35')](_0x1ddd36,_0xc8ea('0x32'));_0x5cb232[_0xc8ea('0x3b')]=_[_0xc8ea('0x3c')](_0x8e2a4e['query']);_0x5cb232['filters']=_[_0xc8ea('0x3d')](_0x5cb232[_0xc8ea('0x3e')],_0x5cb232[_0xc8ea('0x3b')]);_0x1ec332['attributes']=_['intersection'](_0x5cb232[_0xc8ea('0x3e')],qs[_0xc8ea('0x3f')](_0x8e2a4e[_0xc8ea('0x3b')][_0xc8ea('0x3f')]));_0x1ec332[_0xc8ea('0x40')]=_0x1ec332[_0xc8ea('0x40')][_0xc8ea('0x41')]?_0x1ec332[_0xc8ea('0x40')]:_0x5cb232['model'];if(!_0x8e2a4e[_0xc8ea('0x3b')][_0xc8ea('0x42')](_0xc8ea('0x43'))){_0x1ec332[_0xc8ea('0x2b')]=qs[_0xc8ea('0x2b')](_0x8e2a4e[_0xc8ea('0x3b')][_0xc8ea('0x2b')]);_0x1ec332[_0xc8ea('0x2a')]=qs[_0xc8ea('0x2a')](_0x8e2a4e[_0xc8ea('0x3b')][_0xc8ea('0x2a')]);}_0x1ec332[_0xc8ea('0x44')]=qs['sort'](_0x8e2a4e[_0xc8ea('0x3b')][_0xc8ea('0x45')]);_0x1ec332[_0xc8ea('0x46')]=qs[_0xc8ea('0x47')](_[_0xc8ea('0x48')](_0x8e2a4e[_0xc8ea('0x3b')],_0x5cb232[_0xc8ea('0x47')]),_0x1ddd36);if(_0x8e2a4e[_0xc8ea('0x3b')][_0xc8ea('0x49')]){_0x1ec332['where']=_[_0xc8ea('0x4a')](_0x1ec332[_0xc8ea('0x46')],{'$or':_['map'](_0x1ddd36,function(_0x179ee9){if(_0x179ee9[_0xc8ea('0x39')]!==_0xc8ea('0x4b')){var _0x444b23={};_0x444b23[_0x179ee9['name']]={'$like':'%'+_0x8e2a4e[_0xc8ea('0x3b')][_0xc8ea('0x49')]+'%'};return _0x444b23;}})});}_0x1ec332=_[_0xc8ea('0x4a')]({},_0x1ec332,_0x8e2a4e['options']);var _0x5986f9={'where':_0x1ec332[_0xc8ea('0x46')]};return db[_0xc8ea('0x36')][_0xc8ea('0x4c')](_0x5986f9)[_0xc8ea('0x1e')](function(_0x541d69){_0x5cf332[_0xc8ea('0x4c')]=_0x541d69;if(_0x8e2a4e[_0xc8ea('0x3b')][_0xc8ea('0x4d')]){_0x1ec332[_0xc8ea('0x4e')]=[{'all':!![]}];}return db[_0xc8ea('0x36')][_0xc8ea('0x4f')](_0x1ec332);})['then'](function(_0x372ded){_0x5cf332['rows']=_0x372ded;return _0x5cf332;})[_0xc8ea('0x1e')](respondWithFilteredResult(_0x364e05,_0x1ec332))[_0xc8ea('0x26')](handleError(_0x364e05,null));};exports[_0xc8ea('0x50')]=function(_0x516c18,_0x4aeaad){var _0x3d90c9={'raw':![],'where':{'id':_0x516c18['params']['id']}},_0x53f2d0={};_0x53f2d0['model']=_[_0xc8ea('0x3c')](db[_0xc8ea('0x36')]['rawAttributes']);_0x53f2d0[_0xc8ea('0x3b')]=_['keys'](_0x516c18['query']);_0x53f2d0[_0xc8ea('0x47')]=_['intersection'](_0x53f2d0[_0xc8ea('0x3e')],_0x53f2d0[_0xc8ea('0x3b')]);_0x3d90c9[_0xc8ea('0x40')]=_[_0xc8ea('0x3d')](_0x53f2d0[_0xc8ea('0x3e')],qs['fields'](_0x516c18['query'][_0xc8ea('0x3f')]));_0x3d90c9[_0xc8ea('0x40')]=_0x3d90c9[_0xc8ea('0x40')][_0xc8ea('0x41')]?_0x3d90c9[_0xc8ea('0x40')]:_0x53f2d0[_0xc8ea('0x3e')];if(_0x516c18[_0xc8ea('0x3b')][_0xc8ea('0x4d')]){_0x3d90c9['include']=[{'all':!![]}];}_0x3d90c9=_[_0xc8ea('0x4a')]({},_0x3d90c9,_0x516c18[_0xc8ea('0x51')]);return db[_0xc8ea('0x36')]['find'](_0x3d90c9)[_0xc8ea('0x1e')](handleEntityNotFound(_0x4aeaad,null))[_0xc8ea('0x1e')](respondWithResult(_0x4aeaad,null))[_0xc8ea('0x26')](handleError(_0x4aeaad,null));};exports['create']=function(_0x21470b,_0x4d046b){return db['FreshdeskConfiguration'][_0xc8ea('0x52')](_0x21470b[_0xc8ea('0x53')],{})[_0xc8ea('0x1e')](respondWithResult(_0x4d046b,0xc9))[_0xc8ea('0x26')](handleError(_0x4d046b,null));};exports['update']=function(_0x190312,_0x3688ce){if(_0x190312[_0xc8ea('0x53')]['id']){delete _0x190312['body']['id'];}return db[_0xc8ea('0x36')]['find']({'where':{'id':_0x190312[_0xc8ea('0x54')]['id']}})[_0xc8ea('0x1e')](handleEntityNotFound(_0x3688ce,null))[_0xc8ea('0x1e')](saveUpdates(_0x190312[_0xc8ea('0x53')],null))['then'](respondWithResult(_0x3688ce,null))['catch'](handleError(_0x3688ce,null));};exports[_0xc8ea('0x30')]=function(_0x169705,_0x39177f){return db[_0xc8ea('0x36')][_0xc8ea('0x55')]({'where':{'id':_0x169705[_0xc8ea('0x54')]['id']}})[_0xc8ea('0x1e')](handleEntityNotFound(_0x39177f,null))[_0xc8ea('0x1e')](removeEntity(_0x39177f,null))['catch'](handleError(_0x39177f,null));};exports[_0xc8ea('0x56')]=function(_0xc82804,_0x3fc393,_0x4c2cd3){var _0x4962ba={};var _0x242396={};var _0x13a9d8;var _0x2eba1d;return db[_0xc8ea('0x36')]['findOne']({'where':{'id':_0xc82804[_0xc8ea('0x54')]['id']}})['then'](handleEntityNotFound(_0x3fc393,null))[_0xc8ea('0x1e')](function(_0x45625c){if(_0x45625c){_0x13a9d8=_0x45625c;_0x242396[_0xc8ea('0x3e')]=_[_0xc8ea('0x3c')](db['FreshdeskField'][_0xc8ea('0x37')]);_0x242396[_0xc8ea('0x3b')]=_['keys'](_0xc82804['query']);_0x242396[_0xc8ea('0x47')]=_[_0xc8ea('0x3d')](_0x242396['model'],_0x242396['query']);_0x4962ba['attributes']=_['intersection'](_0x242396[_0xc8ea('0x3e')],qs[_0xc8ea('0x3f')](_0xc82804[_0xc8ea('0x3b')][_0xc8ea('0x3f')]));_0x4962ba[_0xc8ea('0x40')]=_0x4962ba[_0xc8ea('0x40')][_0xc8ea('0x41')]?_0x4962ba[_0xc8ea('0x40')]:_0x242396['model'];_0x4962ba['order']=qs[_0xc8ea('0x45')](_0xc82804[_0xc8ea('0x3b')][_0xc8ea('0x45')]);_0x4962ba['where']=qs[_0xc8ea('0x47')](_[_0xc8ea('0x48')](_0xc82804['query'],_0x242396[_0xc8ea('0x47')]));if(_0xc82804[_0xc8ea('0x3b')][_0xc8ea('0x49')]){_0x4962ba['where']=_['merge'](_0x4962ba[_0xc8ea('0x46')],{'$or':_['map'](_0x4962ba['attributes'],function(_0x2ea392){var _0x2c04ac={};_0x2c04ac[_0x2ea392]={'$like':'%'+_0xc82804['query'][_0xc8ea('0x49')]+'%'};return _0x2c04ac;})});}_0x4962ba=_[_0xc8ea('0x4a')]({},_0x4962ba,_0xc82804[_0xc8ea('0x51')]);return _0x13a9d8[_0xc8ea('0x56')](_0x4962ba);}})['then'](function(_0x5aea5c){if(_0x5aea5c){_0x2eba1d=_0x5aea5c[_0xc8ea('0x41')];if(!_0xc82804['query'][_0xc8ea('0x42')](_0xc8ea('0x43'))){_0x4962ba['limit']=qs[_0xc8ea('0x2b')](_0xc82804[_0xc8ea('0x3b')][_0xc8ea('0x2b')]);_0x4962ba[_0xc8ea('0x2a')]=qs[_0xc8ea('0x2a')](_0xc82804[_0xc8ea('0x3b')][_0xc8ea('0x2a')]);}return _0x13a9d8[_0xc8ea('0x56')](_0x4962ba);}})[_0xc8ea('0x1e')](function(_0x13cf54){if(_0x13cf54){return _0x13cf54?{'count':_0x2eba1d,'rows':_0x13cf54}:null;}})[_0xc8ea('0x1e')](respondWithResult(_0x3fc393,null))[_0xc8ea('0x26')](handleError(_0x3fc393,null));};exports[_0xc8ea('0x57')]=function(_0x499e5a,_0x33cef2,_0x1aeb4f){var _0x5c054e={};var _0x42f287={};var _0x2cd6f2;var _0x6fe49d;return db[_0xc8ea('0x36')][_0xc8ea('0x58')]({'where':{'id':_0x499e5a[_0xc8ea('0x54')]['id']}})[_0xc8ea('0x1e')](handleEntityNotFound(_0x33cef2,null))[_0xc8ea('0x1e')](function(_0xfe0e91){if(_0xfe0e91){_0x2cd6f2=_0xfe0e91;_0x42f287[_0xc8ea('0x3e')]=_[_0xc8ea('0x3c')](db[_0xc8ea('0x59')][_0xc8ea('0x37')]);_0x42f287[_0xc8ea('0x3b')]=_[_0xc8ea('0x3c')](_0x499e5a[_0xc8ea('0x3b')]);_0x42f287[_0xc8ea('0x47')]=_[_0xc8ea('0x3d')](_0x42f287['model'],_0x42f287[_0xc8ea('0x3b')]);_0x5c054e['attributes']=_[_0xc8ea('0x3d')](_0x42f287['model'],qs['fields'](_0x499e5a['query'][_0xc8ea('0x3f')]));_0x5c054e[_0xc8ea('0x40')]=_0x5c054e['attributes'][_0xc8ea('0x41')]?_0x5c054e[_0xc8ea('0x40')]:_0x42f287[_0xc8ea('0x3e')];_0x5c054e[_0xc8ea('0x44')]=qs[_0xc8ea('0x45')](_0x499e5a[_0xc8ea('0x3b')][_0xc8ea('0x45')]);_0x5c054e['where']=qs[_0xc8ea('0x47')](_[_0xc8ea('0x48')](_0x499e5a[_0xc8ea('0x3b')],_0x42f287[_0xc8ea('0x47')]));if(_0x499e5a[_0xc8ea('0x3b')][_0xc8ea('0x49')]){_0x5c054e[_0xc8ea('0x46')]=_[_0xc8ea('0x4a')](_0x5c054e[_0xc8ea('0x46')],{'$or':_[_0xc8ea('0x35')](_0x5c054e[_0xc8ea('0x40')],function(_0x422b08){var _0x11cff9={};_0x11cff9[_0x422b08]={'$like':'%'+_0x499e5a[_0xc8ea('0x3b')]['filter']+'%'};return _0x11cff9;})});}_0x5c054e=_['merge']({},_0x5c054e,_0x499e5a[_0xc8ea('0x51')]);return _0x2cd6f2[_0xc8ea('0x57')](_0x5c054e);}})[_0xc8ea('0x1e')](function(_0x2b01ea){if(_0x2b01ea){_0x6fe49d=_0x2b01ea[_0xc8ea('0x41')];if(!_0x499e5a[_0xc8ea('0x3b')][_0xc8ea('0x42')]('nolimit')){_0x5c054e['limit']=qs['limit'](_0x499e5a['query'][_0xc8ea('0x2b')]);_0x5c054e[_0xc8ea('0x2a')]=qs[_0xc8ea('0x2a')](_0x499e5a[_0xc8ea('0x3b')][_0xc8ea('0x2a')]);}return _0x2cd6f2[_0xc8ea('0x57')](_0x5c054e);}})[_0xc8ea('0x1e')](function(_0x45c71b){if(_0x45c71b){return _0x45c71b?{'count':_0x6fe49d,'rows':_0x45c71b}:null;}})['then'](respondWithResult(_0x33cef2,null))['catch'](handleError(_0x33cef2,null));};exports[_0xc8ea('0x5a')]=function(_0xabe424,_0x34b4f7,_0x5583e5){var _0x340596={};var _0xd4dce9={};var _0x46f4fb;var _0x78d119;return db[_0xc8ea('0x36')][_0xc8ea('0x58')]({'where':{'id':_0xabe424[_0xc8ea('0x54')]['id']}})[_0xc8ea('0x1e')](handleEntityNotFound(_0x34b4f7,null))[_0xc8ea('0x1e')](function(_0x2bbed8){if(_0x2bbed8){_0x46f4fb=_0x2bbed8;_0xd4dce9[_0xc8ea('0x3e')]=_['keys'](db['FreshdeskField'][_0xc8ea('0x37')]);_0xd4dce9['query']=_['keys'](_0xabe424[_0xc8ea('0x3b')]);_0xd4dce9[_0xc8ea('0x47')]=_[_0xc8ea('0x3d')](_0xd4dce9[_0xc8ea('0x3e')],_0xd4dce9[_0xc8ea('0x3b')]);_0x340596[_0xc8ea('0x40')]=_[_0xc8ea('0x3d')](_0xd4dce9[_0xc8ea('0x3e')],qs[_0xc8ea('0x3f')](_0xabe424[_0xc8ea('0x3b')][_0xc8ea('0x3f')]));_0x340596[_0xc8ea('0x40')]=_0x340596[_0xc8ea('0x40')][_0xc8ea('0x41')]?_0x340596['attributes']:_0xd4dce9[_0xc8ea('0x3e')];_0x340596['order']=qs[_0xc8ea('0x45')](_0xabe424[_0xc8ea('0x3b')]['sort']);_0x340596['where']=qs[_0xc8ea('0x47')](_['pick'](_0xabe424[_0xc8ea('0x3b')],_0xd4dce9['filters']));if(_0xabe424[_0xc8ea('0x3b')][_0xc8ea('0x49')]){_0x340596[_0xc8ea('0x46')]=_[_0xc8ea('0x4a')](_0x340596[_0xc8ea('0x46')],{'$or':_[_0xc8ea('0x35')](_0x340596[_0xc8ea('0x40')],function(_0x5841a5){var _0x282878={};_0x282878[_0x5841a5]={'$like':'%'+_0xabe424[_0xc8ea('0x3b')][_0xc8ea('0x49')]+'%'};return _0x282878;})});}_0x340596=_['merge']({},_0x340596,_0xabe424[_0xc8ea('0x51')]);return _0x46f4fb[_0xc8ea('0x5a')](_0x340596);}})[_0xc8ea('0x1e')](function(_0x1f69d4){if(_0x1f69d4){_0x78d119=_0x1f69d4[_0xc8ea('0x41')];if(!_0xabe424[_0xc8ea('0x3b')][_0xc8ea('0x42')](_0xc8ea('0x43'))){_0x340596[_0xc8ea('0x2b')]=qs[_0xc8ea('0x2b')](_0xabe424[_0xc8ea('0x3b')][_0xc8ea('0x2b')]);_0x340596['offset']=qs['offset'](_0xabe424[_0xc8ea('0x3b')][_0xc8ea('0x2a')]);}return _0x46f4fb[_0xc8ea('0x5a')](_0x340596);}})['then'](function(_0x4ef462){if(_0x4ef462){return _0x4ef462?{'count':_0x78d119,'rows':_0x4ef462}:null;}})['then'](respondWithResult(_0x34b4f7,null))['catch'](handleError(_0x34b4f7,null));};exports['getTags']=function(_0x4771f2,_0x2d5673,_0x3e06eb){var _0x2510dc={};var _0x3b6e18={};var _0x15c0f9;var _0x61771e;return db['FreshdeskConfiguration'][_0xc8ea('0x58')]({'where':{'id':_0x4771f2[_0xc8ea('0x54')]['id']}})[_0xc8ea('0x1e')](handleEntityNotFound(_0x2d5673,null))['then'](function(_0x5c80f0){if(_0x5c80f0){_0x15c0f9=_0x5c80f0;_0x3b6e18[_0xc8ea('0x3e')]=_[_0xc8ea('0x3c')](db[_0xc8ea('0x5b')][_0xc8ea('0x37')]);_0x3b6e18[_0xc8ea('0x3b')]=_[_0xc8ea('0x3c')](_0x4771f2[_0xc8ea('0x3b')]);_0x3b6e18[_0xc8ea('0x47')]=_['intersection'](_0x3b6e18[_0xc8ea('0x3e')],_0x3b6e18[_0xc8ea('0x3b')]);_0x2510dc['attributes']=_[_0xc8ea('0x3d')](_0x3b6e18['model'],qs['fields'](_0x4771f2[_0xc8ea('0x3b')][_0xc8ea('0x3f')]));_0x2510dc[_0xc8ea('0x40')]=_0x2510dc['attributes']['length']?_0x2510dc['attributes']:_0x3b6e18[_0xc8ea('0x3e')];_0x2510dc[_0xc8ea('0x44')]=qs[_0xc8ea('0x45')](_0x4771f2[_0xc8ea('0x3b')][_0xc8ea('0x45')]);_0x2510dc[_0xc8ea('0x46')]=qs[_0xc8ea('0x47')](_[_0xc8ea('0x48')](_0x4771f2[_0xc8ea('0x3b')],_0x3b6e18['filters']));if(_0x4771f2['query'][_0xc8ea('0x49')]){_0x2510dc[_0xc8ea('0x46')]=_[_0xc8ea('0x4a')](_0x2510dc[_0xc8ea('0x46')],{'$or':_[_0xc8ea('0x35')](_0x2510dc[_0xc8ea('0x40')],function(_0x1a267c){var _0x52543e={};_0x52543e[_0x1a267c]={'$like':'%'+_0x4771f2[_0xc8ea('0x3b')][_0xc8ea('0x49')]+'%'};return _0x52543e;})});}_0x2510dc=_[_0xc8ea('0x4a')]({},_0x2510dc,_0x4771f2[_0xc8ea('0x51')]);return _0x15c0f9[_0xc8ea('0x5c')](_0x2510dc);}})[_0xc8ea('0x1e')](function(_0x256b78){if(_0x256b78){_0x61771e=_0x256b78[_0xc8ea('0x41')];if(!_0x4771f2[_0xc8ea('0x3b')][_0xc8ea('0x42')]('nolimit')){_0x2510dc['limit']=qs['limit'](_0x4771f2['query'][_0xc8ea('0x2b')]);_0x2510dc[_0xc8ea('0x2a')]=qs[_0xc8ea('0x2a')](_0x4771f2[_0xc8ea('0x3b')][_0xc8ea('0x2a')]);}return _0x15c0f9['getTags'](_0x2510dc);}})[_0xc8ea('0x1e')](function(_0x15de6a){if(_0x15de6a){return _0x15de6a?{'count':_0x61771e,'rows':_0x15de6a}:null;}})[_0xc8ea('0x1e')](respondWithResult(_0x2d5673,null))['catch'](handleError(_0x2d5673,null));};exports['setTags']=function(_0x26c520,_0x5c0d88,_0x9b1d33){if(_0x26c520['body']['id']){delete _0x26c520[_0xc8ea('0x53')]['id'];}return db[_0xc8ea('0x36')]['findOne']({'where':{'id':_0x26c520['params']['id']}})['then'](handleEntityNotFound(_0x5c0d88,null))[_0xc8ea('0x1e')](function(_0x463051){if(_0x463051){return _0x463051[_0xc8ea('0x5d')](_0x26c520[_0xc8ea('0x53')][_0xc8ea('0x5e')]||[]);}return null;})[_0xc8ea('0x1e')](respondWithResult(_0x5c0d88,null))[_0xc8ea('0x26')](handleError(_0x5c0d88,null));};
\ No newline at end of file
index ddc244c..e834ecc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x57c7db,_0x3e73d1){var _0xcd192b=function(_0x1aadb8){while(--_0x1aadb8){_0x57c7db['push'](_0x57c7db['shift']());}};_0xcd192b(++_0x3e73d1);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1b5369,_0x2e31a0){_0x1b5369=_0x1b5369-0x0;var _0x410a5b=_0x1cb9[_0x1b5369];return _0x410a5b;};'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':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x814b=['define','FreshdeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports'];(function(_0x3cd619,_0x157f2d){var _0x3844da=function(_0x59bfe5){while(--_0x59bfe5){_0x3cd619['push'](_0x3cd619['shift']());}};_0x3844da(++_0x157f2d);}(_0x814b,0x1a2));var _0xb814=function(_0xb02766,_0xa37d90){_0xb02766=_0xb02766-0x0;var _0x560e6c=_0x814b[_0xb02766];return _0x560e6c;};'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':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c80c31b..619f2a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fb0=['FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x32ab87,_0x5803d0){var _0x5ae2b0=function(_0x3af5d3){while(--_0x3af5d3){_0x32ab87['push'](_0x32ab87['shift']());}};_0x5ae2b0(++_0x5803d0);}(_0x7fb0,0x1ea));var _0x07fb=function(_0x119652,_0x35ceea){_0x119652=_0x119652-0x0;var _0x26f512=_0x7fb0[_0x119652];return _0x26f512;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x07fb('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x07fb('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x07fb('0x2'))(_0x07fb('0x3'));var config=require(_0x07fb('0x4'));var jayson=require(_0x07fb('0x5'));var client=jayson[_0x07fb('0x6')][_0x07fb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c4bf5,_0x382eeb,_0x546e63){return new BPromise(function(_0x490e77,_0x2676c6){return client[_0x07fb('0x8')](_0x4c4bf5,_0x546e63)[_0x07fb('0x9')](function(_0x271fe7){logger['info'](_0x07fb('0xa'),_0x382eeb,_0x07fb('0xb'));logger[_0x07fb('0xc')](_0x07fb('0xd'),_0x382eeb,'request\x20sent',JSON[_0x07fb('0xe')](_0x271fe7));if(_0x271fe7[_0x07fb('0xf')]){if(_0x271fe7['error'][_0x07fb('0x10')]===0x1f4){logger[_0x07fb('0xf')](_0x07fb('0xa'),_0x382eeb,_0x271fe7[_0x07fb('0xf')]['message']);return _0x2676c6(_0x271fe7[_0x07fb('0xf')]['message']);}logger[_0x07fb('0xf')](_0x07fb('0xa'),_0x382eeb,_0x271fe7[_0x07fb('0xf')][_0x07fb('0x11')]);return _0x490e77(_0x271fe7[_0x07fb('0xf')][_0x07fb('0x11')]);}else{logger[_0x07fb('0x12')](_0x07fb('0xa'),_0x382eeb,_0x07fb('0xb'));_0x490e77(_0x271fe7['result']['message']);}})[_0x07fb('0x13')](function(_0x274532){logger[_0x07fb('0xf')](_0x07fb('0xa'),_0x382eeb,_0x274532);_0x2676c6(_0x274532);});});}
\ No newline at end of file
+var _0xb773=['bluebird','../../config/utils','../../config/logger','rpc','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x503325,_0x24a407){var _0x452fff=function(_0x42bf26){while(--_0x42bf26){_0x503325['push'](_0x503325['shift']());}};_0x452fff(++_0x24a407);}(_0xb773,0xcf));var _0x3b77=function(_0x3074f3,_0x4f2c03){_0x3074f3=_0x3074f3-0x0;var _0x53f112=_0xb773[_0x3074f3];return _0x53f112;};'use strict';var _=require(_0x3b77('0x0'));var util=require(_0x3b77('0x1'));var moment=require(_0x3b77('0x2'));var BPromise=require(_0x3b77('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3b77('0x4'));var logger=require(_0x3b77('0x5'))(_0x3b77('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3b77('0x7')][_0x3b77('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b6ef0,_0x51ac42,_0x24c324){return new BPromise(function(_0x9003ee,_0x3c94be){return client[_0x3b77('0x9')](_0x5b6ef0,_0x24c324)[_0x3b77('0xa')](function(_0x2ea3fc){logger[_0x3b77('0xb')](_0x3b77('0xc'),_0x51ac42,_0x3b77('0xd'));logger[_0x3b77('0xe')](_0x3b77('0xf'),_0x51ac42,_0x3b77('0xd'),JSON[_0x3b77('0x10')](_0x2ea3fc));if(_0x2ea3fc[_0x3b77('0x11')]){if(_0x2ea3fc[_0x3b77('0x11')]['code']===0x1f4){logger[_0x3b77('0x11')](_0x3b77('0xc'),_0x51ac42,_0x2ea3fc[_0x3b77('0x11')]['message']);return _0x3c94be(_0x2ea3fc[_0x3b77('0x11')][_0x3b77('0x12')]);}logger[_0x3b77('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x51ac42,_0x2ea3fc[_0x3b77('0x11')]['message']);return _0x9003ee(_0x2ea3fc['error']['message']);}else{logger[_0x3b77('0xb')](_0x3b77('0xc'),_0x51ac42,_0x3b77('0xd'));_0x9003ee(_0x2ea3fc[_0x3b77('0x13')]['message']);}})[_0x3b77('0x14')](function(_0x5cab58){logger[_0x3b77('0x11')](_0x3b77('0xc'),_0x51ac42,_0x5cab58);_0x3c94be(_0x5cab58);});});}
\ No newline at end of file
index 485cd42..9f6a1b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['/:id','isAuthenticated','show','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x27062d,_0x24b179){var _0x4f1478=function(_0x3b4489){while(--_0x3b4489){_0x27062d['push'](_0x27062d['shift']());}};_0x4f1478(++_0x24b179);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['post']('/',auth[_0x49c4('0x9')](),controller[_0x49c4('0xb')]);router[_0x49c4('0xc')](_0x49c4('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x49c4('0xd')](_0x49c4('0x8'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router;
\ No newline at end of file
+var _0x70e0=['create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated'];(function(_0x2c3f37,_0x5a46b6){var _0x12a453=function(_0x506351){while(--_0x506351){_0x2c3f37['push'](_0x2c3f37['shift']());}};_0x12a453(++_0x5a46b6);}(_0x70e0,0x17b));var _0x070e=function(_0x135d99,_0x1405ff){_0x135d99=_0x135d99-0x0;var _0x3922d3=_0x70e0[_0x135d99];return _0x3922d3;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./intFreshdeskField.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0xa')]('/',auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')](_0x070e('0xe'),auth[_0x070e('0xb')](),controller['update']);router['delete'](_0x070e('0xe'),auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);module[_0x070e('0x10')]=router;
\ No newline at end of file
index de83d3b..e6183db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dab=['sequelize','exports','ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN'];(function(_0x1deb8c,_0x5e4103){var _0x1b460c=function(_0x2f7535){while(--_0x2f7535){_0x1deb8c['push'](_0x1deb8c['shift']());}};_0x1b460c(++_0x5e4103);}(_0x2dab,0x120));var _0xb2da=function(_0x18521a,_0x3da414){_0x18521a=_0x18521a-0x0;var _0x54d249=_0x2dab[_0x18521a];return _0x54d249;};'use strict';var Sequelize=require(_0xb2da('0x0'));module[_0xb2da('0x1')]={'type':{'type':Sequelize[_0xb2da('0x2')](_0xb2da('0x3'),_0xb2da('0x4'),'customVariable',_0xb2da('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xb2da('0x6')]},'key':{'type':Sequelize[_0xb2da('0x6')]},'keyType':{'type':Sequelize[_0xb2da('0x2')](_0xb2da('0x3'),_0xb2da('0x4'),_0xb2da('0x7'))},'keyContent':{'type':Sequelize[_0xb2da('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb2da('0x6')]},'customField':{'type':Sequelize[_0xb2da('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb2da('0x6')]}};
\ No newline at end of file
+var _0x383a=['string','STRING','variable','exports','ENUM','customVariable'];(function(_0x3648ae,_0x5e4ab7){var _0x1f14d9=function(_0x2181fe){while(--_0x2181fe){_0x3648ae['push'](_0x3648ae['shift']());}};_0x1f14d9(++_0x5e4ab7);}(_0x383a,0x1ad));var _0xa383=function(_0x55d893,_0x325ebe){_0x55d893=_0x55d893-0x0;var _0x52d152=_0x383a[_0x55d893];return _0x52d152;};'use strict';var Sequelize=require('sequelize');module[_0xa383('0x0')]={'type':{'type':Sequelize[_0xa383('0x1')]('string','variable',_0xa383('0x2'),'keyValue'),'defaultValue':_0xa383('0x3')},'content':{'type':Sequelize[_0xa383('0x4')]},'key':{'type':Sequelize[_0xa383('0x4')]},'keyType':{'type':Sequelize['ENUM']('string',_0xa383('0x5'),_0xa383('0x2'))},'keyContent':{'type':Sequelize[_0xa383('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 487327c..95a4c7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb513=['body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create'];(function(_0x3ed92d,_0x122c7d){var _0x42376d=function(_0x440d96){while(--_0x440d96){_0x3ed92d['push'](_0x3ed92d['shift']());}};_0x42376d(++_0x122c7d);}(_0xb513,0xd3));var _0x3b51=function(_0x104c9b,_0x56944d){_0x104c9b=_0x104c9b-0x0;var _0x39ba4d=_0xb513[_0x104c9b];return _0x39ba4d;};'use strict';var pdf=require(_0x3b51('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3b51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b51('0x2'));var rp=require(_0x3b51('0x3'));var moment=require(_0x3b51('0x4'));var BPromise=require(_0x3b51('0x5'));var Mustache=require(_0x3b51('0x6'));var util=require(_0x3b51('0x7'));var path=require(_0x3b51('0x8'));var sox=require('sox');var csv=require(_0x3b51('0x9'));var ejs=require(_0x3b51('0xa'));var fs=require('fs');var _=require(_0x3b51('0xb'));var squel=require('squel');var crypto=require(_0x3b51('0xc'));var jsforce=require(_0x3b51('0xd'));var deskjs=require(_0x3b51('0xe'));var toCsv=require(_0x3b51('0x9'));var querystring=require(_0x3b51('0xf'));var Papa=require(_0x3b51('0x10'));var Redis=require('ioredis');var authService=require(_0x3b51('0x11'));var qs=require(_0x3b51('0x12'));var as=require(_0x3b51('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3b51('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d6b63,_0x271e9a){_0x271e9a=_0x271e9a||0xcc;return function(_0x58a755){if(_0x58a755){return _0x1d6b63['sendStatus'](_0x271e9a);}return _0x1d6b63[_0x3b51('0x15')](_0x271e9a)[_0x3b51('0x16')]();};}function respondWithResult(_0x3e484b,_0x5bc417){_0x5bc417=_0x5bc417||0xc8;return function(_0x53a9b5){if(_0x53a9b5){return _0x3e484b[_0x3b51('0x15')](_0x5bc417)[_0x3b51('0x17')](_0x53a9b5);}};}function respondWithFilteredResult(_0x144d33,_0x58c263){return function(_0x192740){if(_0x192740){var _0x515f80=_0x192740[_0x3b51('0x18')],_0x382457=_0x58c263[_0x3b51('0x19')],_0x6371e4=_0x58c263['offset']+_0x58c263['limit'],_0x54bff3;if(_0x6371e4>=_0x515f80){_0x6371e4=_0x515f80;_0x54bff3=0xc8;}else{_0x54bff3=0xce;}_0x144d33[_0x3b51('0x15')](_0x54bff3);return _0x144d33[_0x3b51('0x1a')](_0x3b51('0x1b'),_0x382457+'-'+_0x6371e4+'/'+_0x515f80)[_0x3b51('0x17')](_0x192740);}return null;};}function patchUpdates(_0x374968){return function(_0x383571){try{jsonpatch[_0x3b51('0x1c')](_0x383571,_0x374968,!![]);}catch(_0x563783){return BPromise[_0x3b51('0x1d')](_0x563783);}return _0x383571[_0x3b51('0x1e')]();};}function saveUpdates(_0x334115,_0x19f4ff){return function(_0x3a9623){if(_0x3a9623){return _0x3a9623[_0x3b51('0x1f')](_0x334115)[_0x3b51('0x20')](function(_0x24935a){return _0x24935a;});}return null;};}function removeEntity(_0x1fb481,_0x12c3e3){return function(_0x4d75c8){if(_0x4d75c8){return _0x4d75c8[_0x3b51('0x21')]()[_0x3b51('0x20')](function(){_0x1fb481[_0x3b51('0x15')](0xcc)[_0x3b51('0x16')]();});}};}function handleEntityNotFound(_0x2e9c1e,_0x49dc07){return function(_0x3839aa){if(!_0x3839aa){_0x2e9c1e[_0x3b51('0x22')](0x194);}return _0x3839aa;};}function handleError(_0x503ae7,_0x22eae7){_0x22eae7=_0x22eae7||0x1f4;return function(_0x22f915){logger[_0x3b51('0x23')](_0x22f915[_0x3b51('0x24')]);if(_0x22f915['name']){delete _0x22f915[_0x3b51('0x25')];}_0x503ae7[_0x3b51('0x15')](_0x22eae7)[_0x3b51('0x26')](_0x22f915);};}exports[_0x3b51('0x27')]=function(_0x45af9c,_0x34a164){var _0x3267a4={},_0x39b194={},_0x2e8123={'count':0x0,'rows':[]};var _0x5745ab=_[_0x3b51('0x28')](db[_0x3b51('0x29')][_0x3b51('0x2a')],function(_0x1ba589){return{'name':_0x1ba589[_0x3b51('0x2b')],'type':_0x1ba589[_0x3b51('0x2c')]['key']};});_0x39b194[_0x3b51('0x2d')]=_['map'](_0x5745ab,_0x3b51('0x25'));_0x39b194[_0x3b51('0x2e')]=_[_0x3b51('0x2f')](_0x45af9c['query']);_0x39b194[_0x3b51('0x30')]=_[_0x3b51('0x31')](_0x39b194['model'],_0x39b194[_0x3b51('0x2e')]);_0x3267a4[_0x3b51('0x32')]=_[_0x3b51('0x31')](_0x39b194['model'],qs[_0x3b51('0x33')](_0x45af9c[_0x3b51('0x2e')][_0x3b51('0x33')]));_0x3267a4[_0x3b51('0x32')]=_0x3267a4['attributes'][_0x3b51('0x34')]?_0x3267a4[_0x3b51('0x32')]:_0x39b194[_0x3b51('0x2d')];if(!_0x45af9c[_0x3b51('0x2e')][_0x3b51('0x35')]('nolimit')){_0x3267a4[_0x3b51('0x36')]=qs[_0x3b51('0x36')](_0x45af9c['query']['limit']);_0x3267a4['offset']=qs[_0x3b51('0x19')](_0x45af9c[_0x3b51('0x2e')][_0x3b51('0x19')]);}_0x3267a4['order']=qs['sort'](_0x45af9c['query'][_0x3b51('0x37')]);_0x3267a4[_0x3b51('0x38')]=qs[_0x3b51('0x30')](_['pick'](_0x45af9c['query'],_0x39b194[_0x3b51('0x30')]),_0x5745ab);if(_0x45af9c[_0x3b51('0x2e')][_0x3b51('0x39')]){_0x3267a4[_0x3b51('0x38')]=_[_0x3b51('0x3a')](_0x3267a4[_0x3b51('0x38')],{'$or':_[_0x3b51('0x28')](_0x5745ab,function(_0x5e21e8){if(_0x5e21e8['type']!==_0x3b51('0x3b')){var _0x4edc6d={};_0x4edc6d[_0x5e21e8['name']]={'$like':'%'+_0x45af9c[_0x3b51('0x2e')][_0x3b51('0x39')]+'%'};return _0x4edc6d;}})});}_0x3267a4=_['merge']({},_0x3267a4,_0x45af9c[_0x3b51('0x3c')]);var _0x2ef049={'where':_0x3267a4[_0x3b51('0x38')]};return db['FreshdeskField'][_0x3b51('0x18')](_0x2ef049)[_0x3b51('0x20')](function(_0x8d85b){_0x2e8123[_0x3b51('0x18')]=_0x8d85b;if(_0x45af9c[_0x3b51('0x2e')][_0x3b51('0x3d')]){_0x3267a4['include']=[{'all':!![]}];}return db['FreshdeskField'][_0x3b51('0x3e')](_0x3267a4);})[_0x3b51('0x20')](function(_0x66d99a){_0x2e8123[_0x3b51('0x3f')]=_0x66d99a;return _0x2e8123;})[_0x3b51('0x20')](respondWithFilteredResult(_0x34a164,_0x3267a4))[_0x3b51('0x40')](handleError(_0x34a164,null));};exports['show']=function(_0x55c38b,_0xc29726){var _0x1a3d60={'raw':!![],'where':{'id':_0x55c38b[_0x3b51('0x41')]['id']}},_0x122fcc={};_0x122fcc[_0x3b51('0x2d')]=_[_0x3b51('0x2f')](db[_0x3b51('0x29')][_0x3b51('0x2a')]);_0x122fcc[_0x3b51('0x2e')]=_[_0x3b51('0x2f')](_0x55c38b['query']);_0x122fcc[_0x3b51('0x30')]=_[_0x3b51('0x31')](_0x122fcc[_0x3b51('0x2d')],_0x122fcc['query']);_0x1a3d60[_0x3b51('0x32')]=_[_0x3b51('0x31')](_0x122fcc['model'],qs[_0x3b51('0x33')](_0x55c38b[_0x3b51('0x2e')][_0x3b51('0x33')]));_0x1a3d60['attributes']=_0x1a3d60['attributes'][_0x3b51('0x34')]?_0x1a3d60[_0x3b51('0x32')]:_0x122fcc[_0x3b51('0x2d')];if(_0x55c38b[_0x3b51('0x2e')][_0x3b51('0x3d')]){_0x1a3d60[_0x3b51('0x42')]=[{'all':!![]}];}_0x1a3d60=_[_0x3b51('0x3a')]({},_0x1a3d60,_0x55c38b['options']);return db[_0x3b51('0x29')][_0x3b51('0x43')](_0x1a3d60)[_0x3b51('0x20')](handleEntityNotFound(_0xc29726,null))[_0x3b51('0x20')](respondWithResult(_0xc29726,null))['catch'](handleError(_0xc29726,null));};exports[_0x3b51('0x44')]=function(_0x208a79,_0x1c36ec){return db[_0x3b51('0x29')][_0x3b51('0x44')](_0x208a79['body'],{})[_0x3b51('0x20')](respondWithResult(_0x1c36ec,0xc9))[_0x3b51('0x40')](handleError(_0x1c36ec,null));};exports[_0x3b51('0x1f')]=function(_0x13dd0d,_0x43a9f7){if(_0x13dd0d[_0x3b51('0x45')]['id']){delete _0x13dd0d[_0x3b51('0x45')]['id'];}return db[_0x3b51('0x29')][_0x3b51('0x43')]({'where':{'id':_0x13dd0d[_0x3b51('0x41')]['id']}})[_0x3b51('0x20')](handleEntityNotFound(_0x43a9f7,null))[_0x3b51('0x20')](saveUpdates(_0x13dd0d['body'],null))[_0x3b51('0x20')](respondWithResult(_0x43a9f7,null))[_0x3b51('0x40')](handleError(_0x43a9f7,null));};exports['destroy']=function(_0x5ee9d7,_0x438d3f){return db[_0x3b51('0x29')][_0x3b51('0x43')]({'where':{'id':_0x5ee9d7[_0x3b51('0x41')]['id']}})[_0x3b51('0x20')](handleEntityNotFound(_0x438d3f,null))[_0x3b51('0x20')](removeEntity(_0x438d3f,null))['catch'](handleError(_0x438d3f,null));};
\ No newline at end of file
+var _0x798f=['../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','apply','reject','save','update','then','error','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','fields','attributes','length','model','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','includeAll','find','create','body','destroy','html-pdf','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x241811,_0x35ca5f){var _0x1d1e76=function(_0x5c024e){while(--_0x5c024e){_0x241811['push'](_0x241811['shift']());}};_0x1d1e76(++_0x35ca5f);}(_0x798f,0x1cb));var _0xf798=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x798f[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xf798('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf798('0x1'));var zipdir=require(_0xf798('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf798('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf798('0x4'));var util=require('util');var path=require(_0xf798('0x5'));var sox=require(_0xf798('0x6'));var csv=require(_0xf798('0x7'));var ejs=require(_0xf798('0x8'));var fs=require('fs');var _=require(_0xf798('0x9'));var squel=require(_0xf798('0xa'));var crypto=require(_0xf798('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf798('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf798('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xf798('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf798('0xf'));var logger=require('../../config/logger')(_0xf798('0x10'));var utils=require('../../config/utils');var config=require(_0xf798('0x11'));var db=require(_0xf798('0x12'))['db'];function respondWithStatusCode(_0x37be79,_0x476fe1){_0x476fe1=_0x476fe1||0xcc;return function(_0x58f67d){if(_0x58f67d){return _0x37be79[_0xf798('0x13')](_0x476fe1);}return _0x37be79['status'](_0x476fe1)[_0xf798('0x14')]();};}function respondWithResult(_0x570b14,_0x3e82a1){_0x3e82a1=_0x3e82a1||0xc8;return function(_0x267c8d){if(_0x267c8d){return _0x570b14[_0xf798('0x15')](_0x3e82a1)[_0xf798('0x16')](_0x267c8d);}};}function respondWithFilteredResult(_0x18985d,_0x16a2a0){return function(_0x510a13){if(_0x510a13){var _0x789309=_0x510a13[_0xf798('0x17')],_0x1f9a9d=_0x16a2a0[_0xf798('0x18')],_0x13c4de=_0x16a2a0['offset']+_0x16a2a0['limit'],_0x415561;if(_0x13c4de>=_0x789309){_0x13c4de=_0x789309;_0x415561=0xc8;}else{_0x415561=0xce;}_0x18985d[_0xf798('0x15')](_0x415561);return _0x18985d['set']('Content-Range',_0x1f9a9d+'-'+_0x13c4de+'/'+_0x789309)[_0xf798('0x16')](_0x510a13);}return null;};}function patchUpdates(_0x53fb13){return function(_0x194f6b){try{jsonpatch[_0xf798('0x19')](_0x194f6b,_0x53fb13,!![]);}catch(_0x189e5b){return BPromise[_0xf798('0x1a')](_0x189e5b);}return _0x194f6b[_0xf798('0x1b')]();};}function saveUpdates(_0x3780f4,_0x178f2b){return function(_0x5aef94){if(_0x5aef94){return _0x5aef94[_0xf798('0x1c')](_0x3780f4)[_0xf798('0x1d')](function(_0x577a70){return _0x577a70;});}return null;};}function removeEntity(_0x23dcc7,_0x533bbc){return function(_0x46fa1c){if(_0x46fa1c){return _0x46fa1c['destroy']()['then'](function(){_0x23dcc7['status'](0xcc)[_0xf798('0x14')]();});}};}function handleEntityNotFound(_0x3fe350,_0x139e1e){return function(_0x2879c8){if(!_0x2879c8){_0x3fe350[_0xf798('0x13')](0x194);}return _0x2879c8;};}function handleError(_0x476e97,_0x122565){_0x122565=_0x122565||0x1f4;return function(_0xd609e){logger[_0xf798('0x1e')](_0xd609e[_0xf798('0x1f')]);if(_0xd609e['name']){delete _0xd609e[_0xf798('0x20')];}_0x476e97[_0xf798('0x15')](_0x122565)[_0xf798('0x21')](_0xd609e);};}exports[_0xf798('0x22')]=function(_0x2afa22,_0x23f561){var _0x4ba8fb={},_0x232bdd={},_0x4f8248={'count':0x0,'rows':[]};var _0x3cd61a=_['map'](db[_0xf798('0x23')][_0xf798('0x24')],function(_0x453edd){return{'name':_0x453edd[_0xf798('0x25')],'type':_0x453edd[_0xf798('0x26')][_0xf798('0x27')]};});_0x232bdd['model']=_[_0xf798('0x28')](_0x3cd61a,_0xf798('0x20'));_0x232bdd[_0xf798('0x29')]=_[_0xf798('0x2a')](_0x2afa22['query']);_0x232bdd[_0xf798('0x2b')]=_[_0xf798('0x2c')](_0x232bdd['model'],_0x232bdd['query']);_0x4ba8fb['attributes']=_[_0xf798('0x2c')](_0x232bdd['model'],qs[_0xf798('0x2d')](_0x2afa22[_0xf798('0x29')][_0xf798('0x2d')]));_0x4ba8fb['attributes']=_0x4ba8fb[_0xf798('0x2e')][_0xf798('0x2f')]?_0x4ba8fb['attributes']:_0x232bdd[_0xf798('0x30')];if(!_0x2afa22[_0xf798('0x29')]['hasOwnProperty'](_0xf798('0x31'))){_0x4ba8fb['limit']=qs[_0xf798('0x32')](_0x2afa22[_0xf798('0x29')]['limit']);_0x4ba8fb[_0xf798('0x18')]=qs[_0xf798('0x18')](_0x2afa22[_0xf798('0x29')][_0xf798('0x18')]);}_0x4ba8fb[_0xf798('0x33')]=qs[_0xf798('0x34')](_0x2afa22[_0xf798('0x29')][_0xf798('0x34')]);_0x4ba8fb[_0xf798('0x35')]=qs[_0xf798('0x2b')](_['pick'](_0x2afa22['query'],_0x232bdd[_0xf798('0x2b')]),_0x3cd61a);if(_0x2afa22['query'][_0xf798('0x36')]){_0x4ba8fb['where']=_['merge'](_0x4ba8fb[_0xf798('0x35')],{'$or':_[_0xf798('0x28')](_0x3cd61a,function(_0x1011c1){if(_0x1011c1[_0xf798('0x26')]!==_0xf798('0x37')){var _0x3a2fc8={};_0x3a2fc8[_0x1011c1[_0xf798('0x20')]]={'$like':'%'+_0x2afa22[_0xf798('0x29')][_0xf798('0x36')]+'%'};return _0x3a2fc8;}})});}_0x4ba8fb=_[_0xf798('0x38')]({},_0x4ba8fb,_0x2afa22[_0xf798('0x39')]);var _0x352f3f={'where':_0x4ba8fb[_0xf798('0x35')]};return db[_0xf798('0x23')]['count'](_0x352f3f)[_0xf798('0x1d')](function(_0x86e835){_0x4f8248[_0xf798('0x17')]=_0x86e835;if(_0x2afa22[_0xf798('0x29')]['includeAll']){_0x4ba8fb[_0xf798('0x3a')]=[{'all':!![]}];}return db[_0xf798('0x23')][_0xf798('0x3b')](_0x4ba8fb);})['then'](function(_0x367b95){_0x4f8248[_0xf798('0x3c')]=_0x367b95;return _0x4f8248;})[_0xf798('0x1d')](respondWithFilteredResult(_0x23f561,_0x4ba8fb))[_0xf798('0x3d')](handleError(_0x23f561,null));};exports['show']=function(_0xe96bbd,_0x17cf12){var _0x32196a={'raw':!![],'where':{'id':_0xe96bbd[_0xf798('0x3e')]['id']}},_0xdb642={};_0xdb642[_0xf798('0x30')]=_[_0xf798('0x2a')](db[_0xf798('0x23')]['rawAttributes']);_0xdb642[_0xf798('0x29')]=_['keys'](_0xe96bbd[_0xf798('0x29')]);_0xdb642[_0xf798('0x2b')]=_[_0xf798('0x2c')](_0xdb642[_0xf798('0x30')],_0xdb642[_0xf798('0x29')]);_0x32196a[_0xf798('0x2e')]=_[_0xf798('0x2c')](_0xdb642[_0xf798('0x30')],qs[_0xf798('0x2d')](_0xe96bbd[_0xf798('0x29')][_0xf798('0x2d')]));_0x32196a[_0xf798('0x2e')]=_0x32196a['attributes'][_0xf798('0x2f')]?_0x32196a['attributes']:_0xdb642[_0xf798('0x30')];if(_0xe96bbd['query'][_0xf798('0x3f')]){_0x32196a[_0xf798('0x3a')]=[{'all':!![]}];}_0x32196a=_[_0xf798('0x38')]({},_0x32196a,_0xe96bbd[_0xf798('0x39')]);return db[_0xf798('0x23')][_0xf798('0x40')](_0x32196a)[_0xf798('0x1d')](handleEntityNotFound(_0x17cf12,null))[_0xf798('0x1d')](respondWithResult(_0x17cf12,null))['catch'](handleError(_0x17cf12,null));};exports['create']=function(_0x5e6de1,_0x3ae0ef){return db['FreshdeskField'][_0xf798('0x41')](_0x5e6de1[_0xf798('0x42')],{})[_0xf798('0x1d')](respondWithResult(_0x3ae0ef,0xc9))['catch'](handleError(_0x3ae0ef,null));};exports[_0xf798('0x1c')]=function(_0x3a5b97,_0x31c38b){if(_0x3a5b97[_0xf798('0x42')]['id']){delete _0x3a5b97['body']['id'];}return db[_0xf798('0x23')]['find']({'where':{'id':_0x3a5b97[_0xf798('0x3e')]['id']}})[_0xf798('0x1d')](handleEntityNotFound(_0x31c38b,null))[_0xf798('0x1d')](saveUpdates(_0x3a5b97[_0xf798('0x42')],null))['then'](respondWithResult(_0x31c38b,null))[_0xf798('0x3d')](handleError(_0x31c38b,null));};exports[_0xf798('0x43')]=function(_0x3c1df5,_0x565d39){return db[_0xf798('0x23')][_0xf798('0x40')]({'where':{'id':_0x3c1df5['params']['id']}})[_0xf798('0x1d')](handleEntityNotFound(_0x565d39,null))[_0xf798('0x1d')](removeEntity(_0x565d39,null))[_0xf798('0x3d')](handleError(_0x565d39,null));};
\ No newline at end of file
index 91d4acb..96e8933 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8a0=['../../config/environment','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0xc7c9e2,_0x45f092){var _0x4a9eaa=function(_0x127507){while(--_0x127507){_0xc7c9e2['push'](_0xc7c9e2['shift']());}};_0x4a9eaa(++_0x45f092);}(_0xb8a0,0x149));var _0x0b8a=function(_0x22444e,_0x120202){_0x22444e=_0x22444e-0x0;var _0x2b9115=_0xb8a0[_0x22444e];return _0x2b9115;};'use strict';var _=require(_0x0b8a('0x0'));var util=require(_0x0b8a('0x1'));var logger=require('../../config/logger')(_0x0b8a('0x2'));var moment=require(_0x0b8a('0x3'));var BPromise=require('bluebird');var rp=require(_0x0b8a('0x4'));var fs=require('fs');var path=require(_0x0b8a('0x5'));var rimraf=require(_0x0b8a('0x6'));var config=require(_0x0b8a('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x0b8a('0x8')]=function(_0x3c7d96,_0x5159d8){return _0x3c7d96['define'](_0x0b8a('0x9'),attributes,{'tableName':_0x0b8a('0xa'),'paranoid':![],'indexes':[{'name':_0x0b8a('0xb'),'fields':[_0x0b8a('0xc'),_0x0b8a('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x77ad=['FieldId','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index'];(function(_0x14ec75,_0x56a3d4){var _0x40b9e9=function(_0x4d2f39){while(--_0x4d2f39){_0x14ec75['push'](_0x14ec75['shift']());}};_0x40b9e9(++_0x56a3d4);}(_0x77ad,0x16d));var _0xd77a=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x77ad[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0xd77a('0x0'));var util=require('util');var logger=require(_0xd77a('0x1'))(_0xd77a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd77a('0x3'));var fs=require('fs');var path=require(_0xd77a('0x4'));var rimraf=require(_0xd77a('0x5'));var config=require(_0xd77a('0x6'));var attributes=require(_0xd77a('0x7'));module[_0xd77a('0x8')]=function(_0x500587,_0x21bb05){return _0x500587[_0xd77a('0x9')](_0xd77a('0xa'),attributes,{'tableName':_0xd77a('0xb'),'paranoid':![],'indexes':[{'name':_0xd77a('0xc'),'fields':['idField',_0xd77a('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index e9d47e7..1a1d99a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4658dd,_0x193b64){var _0x2e194e=function(_0x406e24){while(--_0x406e24){_0x4658dd['push'](_0x4658dd['shift']());}};_0x2e194e(++_0x193b64);}(_0xb10b,0x12a));var _0xbb10=function(_0x50b1c5,_0x1cf2a9){_0x50b1c5=_0x50b1c5-0x0;var _0x344f99=_0xb10b[_0x50b1c5];return _0x344f99;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}
\ No newline at end of file
+var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x554b15,_0x3d4645){var _0x54641a=function(_0x554260){while(--_0x554260){_0x554b15['push'](_0x554b15['shift']());}};_0x54641a(++_0x3d4645);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d7fb5,_0x16eb5c){_0x3d7fb5=_0x3d7fb5-0x0;var _0x3a9642=_0xb10b[_0x3d7fb5];return _0x3a9642;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}
\ No newline at end of file
index 614ae58..a2b453a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0f5=['../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create','addConfiguration','put','update','util','path','express'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xd0f5,0x12f));var _0x5d0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0f5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x5d0f('0x0'));var path=require(_0x5d0f('0x1'));var timeout=require('connect-timeout');var express=require(_0x5d0f('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5d0f('0x3'));var config=require(_0x5d0f('0x4'));var controller=require(_0x5d0f('0x5'));router[_0x5d0f('0x6')]('/',auth[_0x5d0f('0x7')](),controller[_0x5d0f('0x8')]);router[_0x5d0f('0x6')](_0x5d0f('0x9'),auth[_0x5d0f('0x7')](),controller[_0x5d0f('0xa')]);router['get'](_0x5d0f('0xb'),auth[_0x5d0f('0x7')](),controller['getConfigurations']);router[_0x5d0f('0x6')](_0x5d0f('0xc'),auth['isAuthenticated'](),controller[_0x5d0f('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5d0f('0xe')]);router['post']('/:id/configurations',auth[_0x5d0f('0x7')](),controller[_0x5d0f('0xf')]);router[_0x5d0f('0x10')](_0x5d0f('0x9'),auth[_0x5d0f('0x7')](),controller[_0x5d0f('0x11')]);router['delete'](_0x5d0f('0x9'),auth[_0x5d0f('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5e54=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x591781,_0x8e0ed2){var _0x315bd9=function(_0x39166c){while(--_0x39166c){_0x591781['push'](_0x591781['shift']());}};_0x315bd9(++_0x8e0ed2);}(_0x5e54,0x196));var _0x45e5=function(_0x2edb9d,_0x675dee){_0x2edb9d=_0x2edb9d-0x0;var _0x4ad20c=_0x5e54[_0x2edb9d];return _0x4ad20c;};'use strict';var multer=require(_0x45e5('0x0'));var util=require(_0x45e5('0x1'));var path=require(_0x45e5('0x2'));var timeout=require(_0x45e5('0x3'));var express=require('express');var router=express[_0x45e5('0x4')]();var auth=require(_0x45e5('0x5'));var interaction=require(_0x45e5('0x6'));var config=require(_0x45e5('0x7'));var controller=require(_0x45e5('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x45e5('0x9')]('/:id',auth[_0x45e5('0xa')](),controller[_0x45e5('0xb')]);router[_0x45e5('0x9')](_0x45e5('0xc'),auth[_0x45e5('0xa')](),controller['getConfigurations']);router[_0x45e5('0x9')](_0x45e5('0xd'),auth[_0x45e5('0xa')](),controller[_0x45e5('0xe')]);router[_0x45e5('0xf')]('/',auth[_0x45e5('0xa')](),controller[_0x45e5('0x10')]);router['post'](_0x45e5('0xc'),auth[_0x45e5('0xa')](),controller[_0x45e5('0x11')]);router[_0x45e5('0x12')](_0x45e5('0x13'),auth[_0x45e5('0xa')](),controller[_0x45e5('0x14')]);router[_0x45e5('0x15')]('/:id',auth[_0x45e5('0xa')](),controller[_0x45e5('0x16')]);module[_0x45e5('0x17')]=router;
\ No newline at end of file
index c93ed2a..38fcf14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb296=['STRING','username','remoteUri','sequelize','exports'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0xb296,0xa3));var _0x6b29=function(_0x51d5ee,_0x13e49a){_0x51d5ee=_0x51d5ee-0x0;var _0x4e7f5d=_0xb296[_0x51d5ee];return _0x4e7f5d;};'use strict';var Sequelize=require(_0x6b29('0x0'));module[_0x6b29('0x1')]={'name':{'type':Sequelize[_0x6b29('0x2')]},'description':{'type':Sequelize[_0x6b29('0x2')]},'username':{'type':Sequelize[_0x6b29('0x2')],'unique':_0x6b29('0x3')},'apiKey':{'type':Sequelize[_0x6b29('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x6b29('0x4')},'serverUrl':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa809=['remoteUri','exports','STRING'];(function(_0x284e96,_0x4c2f3f){var _0x5bd863=function(_0x39d7bf){while(--_0x39d7bf){_0x284e96['push'](_0x284e96['shift']());}};_0x5bd863(++_0x4c2f3f);}(_0xa809,0x1f3));var _0x9a80=function(_0x2e05ed,_0x570f52){_0x2e05ed=_0x2e05ed-0x0;var _0x2e40a0=_0xa809[_0x2e05ed];return _0x2e40a0;};'use strict';var Sequelize=require('sequelize');module[_0x9a80('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9a80('0x1')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x9a80('0x2')},'serverUrl':{'type':Sequelize[_0x9a80('0x1')]}};
\ No newline at end of file
index f61f4a7..e5b373b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67ba=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','client','http','test','Sequelize','ValidationError','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','json','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','FreshsalesAccount','fieldName','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','VIRTUAL','options','where','include','findAll','params','rawAttributes','intersection','includeAll','find','create','body','update','merge','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js'];(function(_0x2bd211,_0x522300){var _0x5b963e=function(_0x553314){while(--_0x553314){_0x2bd211['push'](_0x2bd211['shift']());}};_0x5b963e(++_0x522300);}(_0x67ba,0xd3));var _0xa67b=function(_0x154907,_0x266131){_0x154907=_0x154907-0x0;var _0x22f181=_0x67ba[_0x154907];return _0x22f181;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa67b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa67b('0x1'));var jsonpatch=require(_0xa67b('0x2'));var rp=require(_0xa67b('0x3'));var moment=require(_0xa67b('0x4'));var BPromise=require(_0xa67b('0x5'));var Mustache=require(_0xa67b('0x6'));var util=require(_0xa67b('0x7'));var path=require(_0xa67b('0x8'));var sox=require(_0xa67b('0x9'));var csv=require('to-csv');var ejs=require(_0xa67b('0xa'));var fs=require('fs');var _=require(_0xa67b('0xb'));var squel=require(_0xa67b('0xc'));var crypto=require(_0xa67b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa67b('0xe'));var toCsv=require(_0xa67b('0xf'));var querystring=require(_0xa67b('0x10'));var Papa=require(_0xa67b('0x11'));var Redis=require(_0xa67b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa67b('0x13'));var as=require(_0xa67b('0x14'));var hardwareService=require(_0xa67b('0x15'));var logger=require('../../config/logger')(_0xa67b('0x16'));var utils=require(_0xa67b('0x17'));var config=require(_0xa67b('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xa67b('0x19')][_0xa67b('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x14b054,_0x3043bd,_0x50bc3e){if(_0x50bc3e){var _0x539a27=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x539a27[_0xa67b('0x1b')](_0x3043bd)){return _0x14b054;}else{throw new db[(_0xa67b('0x1c'))][(_0xa67b('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x14b054;}}function respondWithRpcPromise(_0x336244,_0x7b3eec,_0x219999,_0xbb4114){return new BPromise(function(_0x25d8f7,_0x2146dd){var _0x4a91c0=_0xbb4114||client;return _0x4a91c0['request'](_0x336244,_0x219999)[_0xa67b('0x1e')](function(_0x52de60){logger[_0xa67b('0x1f')](_0xa67b('0x20'),_0x7b3eec,_0xa67b('0x21'));logger[_0xa67b('0x22')](_0xa67b('0x23'),_0x7b3eec,_0xa67b('0x21'),JSON[_0xa67b('0x24')](_0x52de60));if(_0x52de60['error']){if(_0x52de60[_0xa67b('0x25')]['code']===0x1f4){logger[_0xa67b('0x25')](_0xa67b('0x20'),_0x7b3eec,_0x52de60[_0xa67b('0x25')][_0xa67b('0x26')]);return _0x2146dd(_0x52de60['error'][_0xa67b('0x26')]);}logger[_0xa67b('0x25')](_0xa67b('0x20'),_0x7b3eec,_0x52de60[_0xa67b('0x25')][_0xa67b('0x26')]);return _0x25d8f7(_0x52de60[_0xa67b('0x25')][_0xa67b('0x26')]);}else{logger[_0xa67b('0x1f')]('FreshsalesAccount,\x20%s,\x20%s',_0x7b3eec,_0xa67b('0x21'));_0x25d8f7(_0x52de60['result'][_0xa67b('0x26')]);}})[_0xa67b('0x27')](function(_0x45343e){logger['error'](_0xa67b('0x20'),_0x7b3eec,_0x45343e);_0x2146dd(_0x45343e);});});}function respondWithStatusCode(_0x93f5a3,_0x1fddf8){_0x1fddf8=_0x1fddf8||0xcc;return function(_0x50d7e9){if(_0x50d7e9){return _0x93f5a3['sendStatus'](_0x1fddf8);}return _0x93f5a3[_0xa67b('0x28')](_0x1fddf8)[_0xa67b('0x29')]();};}function respondWithResult(_0x13bd3c,_0x703437){_0x703437=_0x703437||0xc8;return function(_0x373767){if(_0x373767){return _0x13bd3c[_0xa67b('0x28')](_0x703437)[_0xa67b('0x2a')](_0x373767);}};}function respondWithFilteredResult(_0x13208c,_0x5bd825){return function(_0x543fbb){if(_0x543fbb){var _0x3f0858=_0x543fbb[_0xa67b('0x2b')],_0xcec8eb=_0x5bd825[_0xa67b('0x2c')],_0x6d14cd=_0x5bd825[_0xa67b('0x2c')]+_0x5bd825['limit'],_0x2f53e4;if(_0x6d14cd>=_0x3f0858){_0x6d14cd=_0x3f0858;_0x2f53e4=0xc8;}else{_0x2f53e4=0xce;}_0x13208c[_0xa67b('0x28')](_0x2f53e4);return _0x13208c[_0xa67b('0x2d')](_0xa67b('0x2e'),_0xcec8eb+'-'+_0x6d14cd+'/'+_0x3f0858)['json'](_0x543fbb);}return null;};}function patchUpdates(_0x7cb42d){return function(_0x415ed7){try{jsonpatch[_0xa67b('0x2f')](_0x415ed7,_0x7cb42d,!![]);}catch(_0x12ea11){return BPromise[_0xa67b('0x30')](_0x12ea11);}return _0x415ed7[_0xa67b('0x31')]();};}function saveUpdates(_0x2efafd,_0x4af09c){return function(_0xed8b5){if(_0xed8b5){return _0xed8b5['update'](_0x2efafd)[_0xa67b('0x1e')](function(_0x3fc7cf){return _0x3fc7cf;});}return null;};}function removeEntity(_0x4598d6,_0x177538){return function(_0x395195){if(_0x395195){return _0x395195[_0xa67b('0x32')]()[_0xa67b('0x1e')](function(){_0x4598d6[_0xa67b('0x28')](0xcc)[_0xa67b('0x29')]();});}};}function handleEntityNotFound(_0x110568,_0x5d58a7){return function(_0x9bef8e){if(!_0x9bef8e){_0x110568['sendStatus'](0x194);}return _0x9bef8e;};}function handleError(_0x27202,_0x627b44){_0x627b44=_0x627b44||0x1f4;return function(_0x3215bf){logger['error'](_0x3215bf[_0xa67b('0x33')]);if(_0x3215bf[_0xa67b('0x34')]){delete _0x3215bf[_0xa67b('0x34')];}_0x27202[_0xa67b('0x28')](_0x627b44)[_0xa67b('0x35')](_0x3215bf);};}exports[_0xa67b('0x36')]=function(_0x1b9744,_0x328d75){var _0x3a887f={},_0xe74ba2={},_0x3d430d={'count':0x0,'rows':[]};var _0x432e12=_[_0xa67b('0x37')](db[_0xa67b('0x38')]['rawAttributes'],function(_0x3de048){return{'name':_0x3de048[_0xa67b('0x39')],'type':_0x3de048[_0xa67b('0x3a')][_0xa67b('0x3b')]};});_0xe74ba2[_0xa67b('0x3c')]=_['map'](_0x432e12,_0xa67b('0x34'));_0xe74ba2[_0xa67b('0x3d')]=_[_0xa67b('0x3e')](_0x1b9744[_0xa67b('0x3d')]);_0xe74ba2['filters']=_['intersection'](_0xe74ba2[_0xa67b('0x3c')],_0xe74ba2[_0xa67b('0x3d')]);_0x3a887f[_0xa67b('0x3f')]=_['intersection'](_0xe74ba2['model'],qs[_0xa67b('0x40')](_0x1b9744[_0xa67b('0x3d')][_0xa67b('0x40')]));_0x3a887f[_0xa67b('0x3f')]=_0x3a887f[_0xa67b('0x3f')][_0xa67b('0x41')]?_0x3a887f[_0xa67b('0x3f')]:_0xe74ba2[_0xa67b('0x3c')];if(!_0x1b9744['query'][_0xa67b('0x42')](_0xa67b('0x43'))){_0x3a887f['limit']=qs['limit'](_0x1b9744[_0xa67b('0x3d')][_0xa67b('0x44')]);_0x3a887f[_0xa67b('0x2c')]=qs[_0xa67b('0x2c')](_0x1b9744[_0xa67b('0x3d')][_0xa67b('0x2c')]);}_0x3a887f[_0xa67b('0x45')]=qs[_0xa67b('0x46')](_0x1b9744[_0xa67b('0x3d')][_0xa67b('0x46')]);_0x3a887f['where']=qs[_0xa67b('0x47')](_[_0xa67b('0x48')](_0x1b9744['query'],_0xe74ba2['filters']),_0x432e12);if(_0x1b9744[_0xa67b('0x3d')][_0xa67b('0x49')]){_0x3a887f['where']=_['merge'](_0x3a887f['where'],{'$or':_[_0xa67b('0x37')](_0x432e12,function(_0x6ee7a0){if(_0x6ee7a0[_0xa67b('0x3a')]!==_0xa67b('0x4a')){var _0x421dbb={};_0x421dbb[_0x6ee7a0[_0xa67b('0x34')]]={'$like':'%'+_0x1b9744[_0xa67b('0x3d')][_0xa67b('0x49')]+'%'};return _0x421dbb;}})});}_0x3a887f=_['merge']({},_0x3a887f,_0x1b9744[_0xa67b('0x4b')]);var _0x4de336={'where':_0x3a887f[_0xa67b('0x4c')]};return db['FreshsalesAccount'][_0xa67b('0x2b')](_0x4de336)[_0xa67b('0x1e')](function(_0x52804c){_0x3d430d['count']=_0x52804c;if(_0x1b9744[_0xa67b('0x3d')]['includeAll']){_0x3a887f[_0xa67b('0x4d')]=[{'all':!![]}];}return db[_0xa67b('0x38')][_0xa67b('0x4e')](_0x3a887f);})[_0xa67b('0x1e')](function(_0xc3029d){_0x3d430d['rows']=_0xc3029d;return _0x3d430d;})[_0xa67b('0x1e')](respondWithFilteredResult(_0x328d75,_0x3a887f))[_0xa67b('0x27')](handleError(_0x328d75,null));};exports['show']=function(_0x670eb9,_0x3b58a3){var _0x40c089={'raw':![],'where':{'id':_0x670eb9[_0xa67b('0x4f')]['id']}},_0x42453b={};_0x42453b[_0xa67b('0x3c')]=_[_0xa67b('0x3e')](db['FreshsalesAccount'][_0xa67b('0x50')]);_0x42453b[_0xa67b('0x3d')]=_[_0xa67b('0x3e')](_0x670eb9[_0xa67b('0x3d')]);_0x42453b[_0xa67b('0x47')]=_[_0xa67b('0x51')](_0x42453b[_0xa67b('0x3c')],_0x42453b[_0xa67b('0x3d')]);_0x40c089[_0xa67b('0x3f')]=_[_0xa67b('0x51')](_0x42453b['model'],qs['fields'](_0x670eb9[_0xa67b('0x3d')]['fields']));_0x40c089[_0xa67b('0x3f')]=_0x40c089['attributes']['length']?_0x40c089[_0xa67b('0x3f')]:_0x42453b['model'];if(_0x670eb9[_0xa67b('0x3d')][_0xa67b('0x52')]){_0x40c089[_0xa67b('0x4d')]=[{'all':!![]}];}_0x40c089=_['merge']({},_0x40c089,_0x670eb9[_0xa67b('0x4b')]);return db['FreshsalesAccount'][_0xa67b('0x53')](_0x40c089)[_0xa67b('0x1e')](handleEntityNotFound(_0x3b58a3,null))['then'](respondWithResult(_0x3b58a3,null))['catch'](handleError(_0x3b58a3,null));};exports[_0xa67b('0x54')]=function(_0x47ca63,_0x3938ea){return db[_0xa67b('0x38')]['create'](_0x47ca63[_0xa67b('0x55')],{})[_0xa67b('0x1e')](respondWithResult(_0x3938ea,0xc9))['catch'](handleError(_0x3938ea,null));};exports[_0xa67b('0x56')]=function(_0x139f64,_0x1dc054){if(_0x139f64[_0xa67b('0x55')]['id']){delete _0x139f64['body']['id'];}return db['FreshsalesAccount'][_0xa67b('0x53')]({'where':{'id':_0x139f64[_0xa67b('0x4f')]['id']}})[_0xa67b('0x1e')](handleEntityNotFound(_0x1dc054,null))[_0xa67b('0x1e')](saveUpdates(_0x139f64[_0xa67b('0x55')],null))[_0xa67b('0x1e')](respondWithResult(_0x1dc054,null))[_0xa67b('0x27')](handleError(_0x1dc054,null));};exports[_0xa67b('0x32')]=function(_0x5125d6,_0x43acf9){return db[_0xa67b('0x38')][_0xa67b('0x53')]({'where':{'id':_0x5125d6[_0xa67b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x43acf9,null))[_0xa67b('0x1e')](removeEntity(_0x43acf9,null))[_0xa67b('0x27')](handleError(_0x43acf9,null));};exports['getConfigurations']=function(_0x9e348,_0x5dd5f1,_0x5ce25f){var _0x50ea63={};var _0x1c0c79={};var _0x3bdc07;var _0x1c9edd;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x9e348[_0xa67b('0x4f')]['id']}})[_0xa67b('0x1e')](handleEntityNotFound(_0x5dd5f1,null))[_0xa67b('0x1e')](function(_0x359b9b){if(_0x359b9b){_0x3bdc07=_0x359b9b;_0x1c0c79[_0xa67b('0x3c')]=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x1c0c79[_0xa67b('0x3d')]=_[_0xa67b('0x3e')](_0x9e348[_0xa67b('0x3d')]);_0x1c0c79[_0xa67b('0x47')]=_[_0xa67b('0x51')](_0x1c0c79[_0xa67b('0x3c')],_0x1c0c79[_0xa67b('0x3d')]);_0x50ea63[_0xa67b('0x3f')]=_[_0xa67b('0x51')](_0x1c0c79['model'],qs[_0xa67b('0x40')](_0x9e348[_0xa67b('0x3d')][_0xa67b('0x40')]));_0x50ea63[_0xa67b('0x3f')]=_0x50ea63[_0xa67b('0x3f')]['length']?_0x50ea63[_0xa67b('0x3f')]:_0x1c0c79['model'];_0x50ea63[_0xa67b('0x45')]=qs['sort'](_0x9e348[_0xa67b('0x3d')][_0xa67b('0x46')]);_0x50ea63[_0xa67b('0x4c')]=qs[_0xa67b('0x47')](_[_0xa67b('0x48')](_0x9e348[_0xa67b('0x3d')],_0x1c0c79['filters']));if(_0x9e348[_0xa67b('0x3d')][_0xa67b('0x49')]){_0x50ea63[_0xa67b('0x4c')]=_[_0xa67b('0x57')](_0x50ea63[_0xa67b('0x4c')],{'$or':_[_0xa67b('0x37')](_0x50ea63['attributes'],function(_0x2d8fae){var _0x17ddcc={};_0x17ddcc[_0x2d8fae]={'$like':'%'+_0x9e348[_0xa67b('0x3d')][_0xa67b('0x49')]+'%'};return _0x17ddcc;})});}_0x50ea63=_[_0xa67b('0x57')]({},_0x50ea63,_0x9e348[_0xa67b('0x4b')]);return _0x3bdc07[_0xa67b('0x58')](_0x50ea63);}})[_0xa67b('0x1e')](function(_0x114565){if(_0x114565){_0x1c9edd=_0x114565[_0xa67b('0x41')];if(!_0x9e348[_0xa67b('0x3d')][_0xa67b('0x42')](_0xa67b('0x43'))){_0x50ea63[_0xa67b('0x44')]=qs[_0xa67b('0x44')](_0x9e348[_0xa67b('0x3d')][_0xa67b('0x44')]);_0x50ea63['offset']=qs[_0xa67b('0x2c')](_0x9e348[_0xa67b('0x3d')][_0xa67b('0x2c')]);}return _0x3bdc07[_0xa67b('0x58')](_0x50ea63);}})[_0xa67b('0x1e')](function(_0x1c1e6b){if(_0x1c1e6b){return _0x1c1e6b?{'count':_0x1c9edd,'rows':_0x1c1e6b}:null;}})[_0xa67b('0x1e')](respondWithResult(_0x5dd5f1,null))['catch'](handleError(_0x5dd5f1,null));};exports[_0xa67b('0x59')]=function(_0x333236,_0x3ad10e,_0x4fca64){if(_0x333236[_0xa67b('0x55')]['id']){delete _0x333236[_0xa67b('0x55')]['id'];}return db[_0xa67b('0x38')][_0xa67b('0x5a')]({'where':{'id':_0x333236['params']['id']}})['then'](handleEntityNotFound(_0x3ad10e,null))[_0xa67b('0x1e')](function(_0x55db59){if(_0x55db59){_0x333236[_0xa67b('0x55')]['AccountId']=_0x55db59['id'];_0x333236[_0xa67b('0x55')][_0xa67b('0x5b')]=integrations[_0xa67b('0x5c')](_0x333236[_0xa67b('0x55')][_0xa67b('0x5d')],_0x333236['body'][_0xa67b('0x3a')]);_0x333236[_0xa67b('0x55')][_0xa67b('0x5e')]=integrations[_0xa67b('0x5f')](_0x333236[_0xa67b('0x55')][_0xa67b('0x5d')],_0x333236[_0xa67b('0x55')][_0xa67b('0x3a')]);return db[_0xa67b('0x60')][_0xa67b('0x54')](_0x333236[_0xa67b('0x55')],{'include':[{'model':db[_0xa67b('0x61')],'as':_0xa67b('0x5b')},{'model':db[_0xa67b('0x61')],'as':_0xa67b('0x5e')}]});}return null;})[_0xa67b('0x1e')](respondWithResult(_0x3ad10e,null))[_0xa67b('0x27')](handleError(_0x3ad10e,null));};exports[_0xa67b('0x62')]=function(_0x54d128,_0x4ecdc7,_0xad29f2){var _0x41c6d6='';var _0x1b3c9b='';return db[_0xa67b('0x38')][_0xa67b('0x5a')]({'where':{'id':_0x54d128['params']['id']},'attributes':['id',_0xa67b('0x63'),_0xa67b('0x64'),_0xa67b('0x65')]})[_0xa67b('0x1e')](handleEntityNotFound(_0x4ecdc7,null))[_0xa67b('0x1e')](function(_0x115953){if(_0x115953){_0x1b3c9b=_0x115953[_0xa67b('0x63')];_0x41c6d6=_0x115953[_0xa67b('0x64')];var _0x5141d5=_0x115953[_0xa67b('0x64')][_0xa67b('0x66')](-0x1);if(_0x5141d5==='/'){_0x41c6d6=_0x41c6d6[_0xa67b('0x67')](0x0,_0x41c6d6[_0xa67b('0x68')](_0x5141d5));}return rp({'method':_0xa67b('0x69'),'uri':util[_0xa67b('0x6a')](_0xa67b('0x6b'),_0x41c6d6,'/api/selector/owners'),'headers':{'Authorization':_0xa67b('0x6c')+_0x115953[_0xa67b('0x65')]},'json':!![]});}})['then'](function(_0x535124){if(_0x535124){var _0x1ad499=_0x535124['users'];var _0x11516c=![];var _0x42073e=null;for(_0x42073e=0x0;_0x42073e<_0x1ad499[_0xa67b('0x41')];_0x42073e++){if(_0x1ad499[_0x42073e][_0xa67b('0x6d')]===_0x1b3c9b){_0x11516c=!![];}}if(_0x11516c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa67b('0x6e')});}}})[_0xa67b('0x1e')](respondWithResult(_0x4ecdc7,null))[_0xa67b('0x27')](function(_0x551c1d){var _0x261e08=_0x54d128[_0xa67b('0x3d')][_0xa67b('0x1b')]?0x1f4:_0x551c1d[_0xa67b('0x6f')]||0x1f4;logger['error'](_0xa67b('0x70'),_0xa67b('0x62'),_0x261e08,JSON['stringify'](_0x551c1d));delete _0x551c1d[_0xa67b('0x34')];if(_0x261e08===0x191){_0x261e08=0x190;}_0x4ecdc7[_0xa67b('0x28')](_0x261e08)[_0xa67b('0x35')](_0x54d128[_0xa67b('0x3d')][_0xa67b('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0x551c1d[_0xa67b('0x6f')]}:_0x551c1d);});};
\ No newline at end of file
+var _0xdfdf=['crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','name','send','index','map','FreshsalesAccount','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','includeAll','show','params','keys','include','options','find','create','body','destroy','findOne','FreshsalesConfiguration','rawAttributes','order','getConfigurations','nolimit','addConfiguration','AccountId','channel','Descriptions','getDescriptions','Subjects','FreshsalesField','username','remoteUri','slice','substring','lastIndexOf','GET','format','/api/selector/owners','apiKey','users','Requested\x20Resource\x20not\x20Found','statusCode','getFields','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x3042d5,_0x349534){var _0x1acfef=function(_0x5a920f){while(--_0x5a920f){_0x3042d5['push'](_0x3042d5['shift']());}};_0x1acfef(++_0x349534);}(_0xdfdf,0xd4));var _0xfdfd=function(_0x1635d2,_0x51e33a){_0x1635d2=_0x1635d2-0x0;var _0x61d2a5=_0xdfdf[_0x1635d2];return _0x61d2a5;};'use strict';var pdf=require(_0xfdfd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfdfd('0x1'));var zipdir=require(_0xfdfd('0x2'));var jsonpatch=require(_0xfdfd('0x3'));var rp=require(_0xfdfd('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfdfd('0x5'));var util=require(_0xfdfd('0x6'));var path=require(_0xfdfd('0x7'));var sox=require(_0xfdfd('0x8'));var csv=require(_0xfdfd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfdfd('0xa'));var squel=require(_0xfdfd('0xb'));var crypto=require(_0xfdfd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfdfd('0xd'));var toCsv=require(_0xfdfd('0x9'));var querystring=require(_0xfdfd('0xe'));var Papa=require(_0xfdfd('0xf'));var Redis=require('ioredis');var authService=require(_0xfdfd('0x10'));var qs=require(_0xfdfd('0x11'));var as=require(_0xfdfd('0x12'));var hardwareService=require(_0xfdfd('0x13'));var logger=require(_0xfdfd('0x14'))(_0xfdfd('0x15'));var utils=require(_0xfdfd('0x16'));var config=require('../../config/environment');var db=require(_0xfdfd('0x17'))['db'];var integrations=require(_0xfdfd('0x18'));var jayson=require(_0xfdfd('0x19'));var client=jayson[_0xfdfd('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x3f9f8e,_0x205315,_0x3ff767){if(_0x3ff767){var _0xd40d80=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd40d80[_0xfdfd('0x1b')](_0x205315)){return _0x3f9f8e;}else{throw new db[(_0xfdfd('0x1c'))][(_0xfdfd('0x1d'))](_0xfdfd('0x1e'));}}else{return _0x3f9f8e;}}function respondWithRpcPromise(_0x2082fd,_0x8db1af,_0x56519c,_0x2d91f8){return new BPromise(function(_0x2c4a2d,_0x5d9a21){var _0x40aecf=_0x2d91f8||client;return _0x40aecf[_0xfdfd('0x1f')](_0x2082fd,_0x56519c)[_0xfdfd('0x20')](function(_0x30fb9b){logger[_0xfdfd('0x21')](_0xfdfd('0x22'),_0x8db1af,_0xfdfd('0x23'));logger[_0xfdfd('0x24')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x8db1af,'request\x20sent',JSON[_0xfdfd('0x25')](_0x30fb9b));if(_0x30fb9b[_0xfdfd('0x26')]){if(_0x30fb9b[_0xfdfd('0x26')][_0xfdfd('0x27')]===0x1f4){logger[_0xfdfd('0x26')]('FreshsalesAccount,\x20%s,\x20%s',_0x8db1af,_0x30fb9b['error'][_0xfdfd('0x28')]);return _0x5d9a21(_0x30fb9b[_0xfdfd('0x26')]['message']);}logger[_0xfdfd('0x26')]('FreshsalesAccount,\x20%s,\x20%s',_0x8db1af,_0x30fb9b[_0xfdfd('0x26')]['message']);return _0x2c4a2d(_0x30fb9b[_0xfdfd('0x26')]['message']);}else{logger[_0xfdfd('0x21')](_0xfdfd('0x22'),_0x8db1af,_0xfdfd('0x23'));_0x2c4a2d(_0x30fb9b[_0xfdfd('0x29')][_0xfdfd('0x28')]);}})[_0xfdfd('0x2a')](function(_0x342c59){logger['error'](_0xfdfd('0x22'),_0x8db1af,_0x342c59);_0x5d9a21(_0x342c59);});});}function respondWithStatusCode(_0x4282f1,_0x34970b){_0x34970b=_0x34970b||0xcc;return function(_0x2b4d51){if(_0x2b4d51){return _0x4282f1[_0xfdfd('0x2b')](_0x34970b);}return _0x4282f1[_0xfdfd('0x2c')](_0x34970b)[_0xfdfd('0x2d')]();};}function respondWithResult(_0x2ec8d8,_0x4629e0){_0x4629e0=_0x4629e0||0xc8;return function(_0x5417a1){if(_0x5417a1){return _0x2ec8d8['status'](_0x4629e0)[_0xfdfd('0x2e')](_0x5417a1);}};}function respondWithFilteredResult(_0x41ec8a,_0x29851c){return function(_0x2c350f){if(_0x2c350f){var _0x3312d1=_0x2c350f[_0xfdfd('0x2f')],_0x5ea0af=_0x29851c[_0xfdfd('0x30')],_0x58a5d6=_0x29851c[_0xfdfd('0x30')]+_0x29851c[_0xfdfd('0x31')],_0x401b27;if(_0x58a5d6>=_0x3312d1){_0x58a5d6=_0x3312d1;_0x401b27=0xc8;}else{_0x401b27=0xce;}_0x41ec8a[_0xfdfd('0x2c')](_0x401b27);return _0x41ec8a['set']('Content-Range',_0x5ea0af+'-'+_0x58a5d6+'/'+_0x3312d1)[_0xfdfd('0x2e')](_0x2c350f);}return null;};}function patchUpdates(_0x57e5e2){return function(_0x5fc2f4){try{jsonpatch[_0xfdfd('0x32')](_0x5fc2f4,_0x57e5e2,!![]);}catch(_0x1a7228){return BPromise[_0xfdfd('0x33')](_0x1a7228);}return _0x5fc2f4[_0xfdfd('0x34')]();};}function saveUpdates(_0x51db04,_0x298e4e){return function(_0x21ff05){if(_0x21ff05){return _0x21ff05[_0xfdfd('0x35')](_0x51db04)[_0xfdfd('0x20')](function(_0x426f8e){return _0x426f8e;});}return null;};}function removeEntity(_0x433b26,_0x132fb5){return function(_0x51c030){if(_0x51c030){return _0x51c030['destroy']()[_0xfdfd('0x20')](function(){_0x433b26[_0xfdfd('0x2c')](0xcc)[_0xfdfd('0x2d')]();});}};}function handleEntityNotFound(_0xc1c5d6,_0x88fd9e){return function(_0x17a91d){if(!_0x17a91d){_0xc1c5d6[_0xfdfd('0x2b')](0x194);}return _0x17a91d;};}function handleError(_0x1b658c,_0xec8a76){_0xec8a76=_0xec8a76||0x1f4;return function(_0x4fa458){logger[_0xfdfd('0x26')](_0x4fa458['stack']);if(_0x4fa458[_0xfdfd('0x36')]){delete _0x4fa458['name'];}_0x1b658c['status'](_0xec8a76)[_0xfdfd('0x37')](_0x4fa458);};}exports[_0xfdfd('0x38')]=function(_0x377a25,_0x493abc){var _0x567187={},_0x151dce={},_0x585d9f={'count':0x0,'rows':[]};var _0x1a4dbb=_[_0xfdfd('0x39')](db[_0xfdfd('0x3a')]['rawAttributes'],function(_0xf89366){return{'name':_0xf89366['fieldName'],'type':_0xf89366[_0xfdfd('0x3b')][_0xfdfd('0x3c')]};});_0x151dce['model']=_[_0xfdfd('0x39')](_0x1a4dbb,_0xfdfd('0x36'));_0x151dce[_0xfdfd('0x3d')]=_['keys'](_0x377a25[_0xfdfd('0x3d')]);_0x151dce[_0xfdfd('0x3e')]=_[_0xfdfd('0x3f')](_0x151dce[_0xfdfd('0x40')],_0x151dce['query']);_0x567187[_0xfdfd('0x41')]=_[_0xfdfd('0x3f')](_0x151dce[_0xfdfd('0x40')],qs[_0xfdfd('0x42')](_0x377a25[_0xfdfd('0x3d')]['fields']));_0x567187[_0xfdfd('0x41')]=_0x567187[_0xfdfd('0x41')][_0xfdfd('0x43')]?_0x567187['attributes']:_0x151dce[_0xfdfd('0x40')];if(!_0x377a25['query'][_0xfdfd('0x44')]('nolimit')){_0x567187[_0xfdfd('0x31')]=qs['limit'](_0x377a25[_0xfdfd('0x3d')][_0xfdfd('0x31')]);_0x567187[_0xfdfd('0x30')]=qs['offset'](_0x377a25['query'][_0xfdfd('0x30')]);}_0x567187['order']=qs['sort'](_0x377a25[_0xfdfd('0x3d')][_0xfdfd('0x45')]);_0x567187['where']=qs[_0xfdfd('0x3e')](_[_0xfdfd('0x46')](_0x377a25[_0xfdfd('0x3d')],_0x151dce[_0xfdfd('0x3e')]),_0x1a4dbb);if(_0x377a25[_0xfdfd('0x3d')][_0xfdfd('0x47')]){_0x567187['where']=_[_0xfdfd('0x48')](_0x567187[_0xfdfd('0x49')],{'$or':_[_0xfdfd('0x39')](_0x1a4dbb,function(_0x36cc7d){if(_0x36cc7d['type']!==_0xfdfd('0x4a')){var _0x8b386d={};_0x8b386d[_0x36cc7d[_0xfdfd('0x36')]]={'$like':'%'+_0x377a25['query'][_0xfdfd('0x47')]+'%'};return _0x8b386d;}})});}_0x567187=_[_0xfdfd('0x48')]({},_0x567187,_0x377a25['options']);var _0xef6490={'where':_0x567187['where']};return db[_0xfdfd('0x3a')]['count'](_0xef6490)[_0xfdfd('0x20')](function(_0x2cf303){_0x585d9f[_0xfdfd('0x2f')]=_0x2cf303;if(_0x377a25[_0xfdfd('0x3d')][_0xfdfd('0x4b')]){_0x567187['include']=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x567187);})['then'](function(_0xecb889){_0x585d9f['rows']=_0xecb889;return _0x585d9f;})[_0xfdfd('0x20')](respondWithFilteredResult(_0x493abc,_0x567187))[_0xfdfd('0x2a')](handleError(_0x493abc,null));};exports[_0xfdfd('0x4c')]=function(_0xa88e90,_0x353608){var _0x5778c9={'raw':![],'where':{'id':_0xa88e90[_0xfdfd('0x4d')]['id']}},_0x433245={};_0x433245[_0xfdfd('0x40')]=_[_0xfdfd('0x4e')](db[_0xfdfd('0x3a')]['rawAttributes']);_0x433245['query']=_[_0xfdfd('0x4e')](_0xa88e90[_0xfdfd('0x3d')]);_0x433245[_0xfdfd('0x3e')]=_[_0xfdfd('0x3f')](_0x433245[_0xfdfd('0x40')],_0x433245[_0xfdfd('0x3d')]);_0x5778c9['attributes']=_[_0xfdfd('0x3f')](_0x433245['model'],qs[_0xfdfd('0x42')](_0xa88e90[_0xfdfd('0x3d')][_0xfdfd('0x42')]));_0x5778c9[_0xfdfd('0x41')]=_0x5778c9[_0xfdfd('0x41')][_0xfdfd('0x43')]?_0x5778c9[_0xfdfd('0x41')]:_0x433245[_0xfdfd('0x40')];if(_0xa88e90['query'][_0xfdfd('0x4b')]){_0x5778c9[_0xfdfd('0x4f')]=[{'all':!![]}];}_0x5778c9=_[_0xfdfd('0x48')]({},_0x5778c9,_0xa88e90[_0xfdfd('0x50')]);return db[_0xfdfd('0x3a')][_0xfdfd('0x51')](_0x5778c9)['then'](handleEntityNotFound(_0x353608,null))['then'](respondWithResult(_0x353608,null))[_0xfdfd('0x2a')](handleError(_0x353608,null));};exports['create']=function(_0x329601,_0x6ebe24){return db[_0xfdfd('0x3a')][_0xfdfd('0x52')](_0x329601[_0xfdfd('0x53')],{})[_0xfdfd('0x20')](respondWithResult(_0x6ebe24,0xc9))[_0xfdfd('0x2a')](handleError(_0x6ebe24,null));};exports[_0xfdfd('0x35')]=function(_0x2a349d,_0xe79c89){if(_0x2a349d[_0xfdfd('0x53')]['id']){delete _0x2a349d[_0xfdfd('0x53')]['id'];}return db[_0xfdfd('0x3a')]['find']({'where':{'id':_0x2a349d['params']['id']}})[_0xfdfd('0x20')](handleEntityNotFound(_0xe79c89,null))['then'](saveUpdates(_0x2a349d[_0xfdfd('0x53')],null))[_0xfdfd('0x20')](respondWithResult(_0xe79c89,null))[_0xfdfd('0x2a')](handleError(_0xe79c89,null));};exports[_0xfdfd('0x54')]=function(_0x59c5a5,_0x16d80f){return db['FreshsalesAccount']['find']({'where':{'id':_0x59c5a5[_0xfdfd('0x4d')]['id']}})[_0xfdfd('0x20')](handleEntityNotFound(_0x16d80f,null))['then'](removeEntity(_0x16d80f,null))[_0xfdfd('0x2a')](handleError(_0x16d80f,null));};exports['getConfigurations']=function(_0xe231b7,_0x512bc3,_0x1563ce){var _0x31e2f6={};var _0x534386={};var _0x5974d3;var _0x298276;return db[_0xfdfd('0x3a')][_0xfdfd('0x55')]({'where':{'id':_0xe231b7[_0xfdfd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x512bc3,null))['then'](function(_0xd27a90){if(_0xd27a90){_0x5974d3=_0xd27a90;_0x534386[_0xfdfd('0x40')]=_['keys'](db[_0xfdfd('0x56')][_0xfdfd('0x57')]);_0x534386[_0xfdfd('0x3d')]=_[_0xfdfd('0x4e')](_0xe231b7['query']);_0x534386[_0xfdfd('0x3e')]=_['intersection'](_0x534386[_0xfdfd('0x40')],_0x534386['query']);_0x31e2f6['attributes']=_['intersection'](_0x534386[_0xfdfd('0x40')],qs[_0xfdfd('0x42')](_0xe231b7[_0xfdfd('0x3d')][_0xfdfd('0x42')]));_0x31e2f6[_0xfdfd('0x41')]=_0x31e2f6[_0xfdfd('0x41')]['length']?_0x31e2f6['attributes']:_0x534386[_0xfdfd('0x40')];_0x31e2f6[_0xfdfd('0x58')]=qs[_0xfdfd('0x45')](_0xe231b7[_0xfdfd('0x3d')][_0xfdfd('0x45')]);_0x31e2f6['where']=qs[_0xfdfd('0x3e')](_[_0xfdfd('0x46')](_0xe231b7[_0xfdfd('0x3d')],_0x534386[_0xfdfd('0x3e')]));if(_0xe231b7['query'][_0xfdfd('0x47')]){_0x31e2f6['where']=_[_0xfdfd('0x48')](_0x31e2f6[_0xfdfd('0x49')],{'$or':_[_0xfdfd('0x39')](_0x31e2f6[_0xfdfd('0x41')],function(_0x5e4dda){var _0x5205a7={};_0x5205a7[_0x5e4dda]={'$like':'%'+_0xe231b7['query'][_0xfdfd('0x47')]+'%'};return _0x5205a7;})});}_0x31e2f6=_[_0xfdfd('0x48')]({},_0x31e2f6,_0xe231b7['options']);return _0x5974d3[_0xfdfd('0x59')](_0x31e2f6);}})[_0xfdfd('0x20')](function(_0x3f597f){if(_0x3f597f){_0x298276=_0x3f597f[_0xfdfd('0x43')];if(!_0xe231b7[_0xfdfd('0x3d')][_0xfdfd('0x44')](_0xfdfd('0x5a'))){_0x31e2f6[_0xfdfd('0x31')]=qs[_0xfdfd('0x31')](_0xe231b7['query'][_0xfdfd('0x31')]);_0x31e2f6[_0xfdfd('0x30')]=qs[_0xfdfd('0x30')](_0xe231b7[_0xfdfd('0x3d')][_0xfdfd('0x30')]);}return _0x5974d3[_0xfdfd('0x59')](_0x31e2f6);}})['then'](function(_0x2db972){if(_0x2db972){return _0x2db972?{'count':_0x298276,'rows':_0x2db972}:null;}})[_0xfdfd('0x20')](respondWithResult(_0x512bc3,null))['catch'](handleError(_0x512bc3,null));};exports[_0xfdfd('0x5b')]=function(_0x1bd24a,_0x4130f0,_0x53837f){if(_0x1bd24a[_0xfdfd('0x53')]['id']){delete _0x1bd24a[_0xfdfd('0x53')]['id'];}return db[_0xfdfd('0x3a')][_0xfdfd('0x55')]({'where':{'id':_0x1bd24a[_0xfdfd('0x4d')]['id']}})[_0xfdfd('0x20')](handleEntityNotFound(_0x4130f0,null))['then'](function(_0x3620e3){if(_0x3620e3){_0x1bd24a[_0xfdfd('0x53')][_0xfdfd('0x5c')]=_0x3620e3['id'];_0x1bd24a['body']['Subjects']=integrations['getSubjects'](_0x1bd24a[_0xfdfd('0x53')][_0xfdfd('0x5d')],_0x1bd24a[_0xfdfd('0x53')][_0xfdfd('0x3b')]);_0x1bd24a['body'][_0xfdfd('0x5e')]=integrations[_0xfdfd('0x5f')](_0x1bd24a[_0xfdfd('0x53')]['channel'],_0x1bd24a[_0xfdfd('0x53')][_0xfdfd('0x3b')]);return db[_0xfdfd('0x56')][_0xfdfd('0x52')](_0x1bd24a['body'],{'include':[{'model':db['FreshsalesField'],'as':_0xfdfd('0x60')},{'model':db[_0xfdfd('0x61')],'as':_0xfdfd('0x5e')}]});}return null;})[_0xfdfd('0x20')](respondWithResult(_0x4130f0,null))[_0xfdfd('0x2a')](handleError(_0x4130f0,null));};exports['getFields']=function(_0x473add,_0x7ca934,_0x4ed369){var _0x495d67='';var _0x11d09f='';return db[_0xfdfd('0x3a')][_0xfdfd('0x55')]({'where':{'id':_0x473add['params']['id']},'attributes':['id',_0xfdfd('0x62'),_0xfdfd('0x63'),'apiKey']})[_0xfdfd('0x20')](handleEntityNotFound(_0x7ca934,null))[_0xfdfd('0x20')](function(_0x3c3a5c){if(_0x3c3a5c){_0x11d09f=_0x3c3a5c[_0xfdfd('0x62')];_0x495d67=_0x3c3a5c['remoteUri'];var _0x402135=_0x3c3a5c[_0xfdfd('0x63')][_0xfdfd('0x64')](-0x1);if(_0x402135==='/'){_0x495d67=_0x495d67[_0xfdfd('0x65')](0x0,_0x495d67[_0xfdfd('0x66')](_0x402135));}return rp({'method':_0xfdfd('0x67'),'uri':util[_0xfdfd('0x68')]('%s%s',_0x495d67,_0xfdfd('0x69')),'headers':{'Authorization':'Token\x20token='+_0x3c3a5c[_0xfdfd('0x6a')]},'json':!![]});}})['then'](function(_0x5d0970){if(_0x5d0970){var _0xae320b=_0x5d0970[_0xfdfd('0x6b')];var _0x37332e=![];var _0x33737a=null;for(_0x33737a=0x0;_0x33737a<_0xae320b[_0xfdfd('0x43')];_0x33737a++){if(_0xae320b[_0x33737a]['email']===_0x11d09f){_0x37332e=!![];}}if(_0x37332e){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xfdfd('0x6c')});}}})[_0xfdfd('0x20')](respondWithResult(_0x7ca934,null))[_0xfdfd('0x2a')](function(_0x144c48){var _0x1c0c12=_0x473add['query'][_0xfdfd('0x1b')]?0x1f4:_0x144c48[_0xfdfd('0x6d')]||0x1f4;logger[_0xfdfd('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0xfdfd('0x6e'),_0x1c0c12,JSON[_0xfdfd('0x25')](_0x144c48));delete _0x144c48['name'];if(_0x1c0c12===0x191){_0x1c0c12=0x190;}_0x7ca934[_0xfdfd('0x2c')](_0x1c0c12)['send'](_0x473add['query'][_0xfdfd('0x1b')]?{'message':_0xfdfd('0x6f'),'statusCode':_0x144c48[_0xfdfd('0x6d')]}:_0x144c48);});};
\ No newline at end of file
index 664eaa3..429e659 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0x9a19,0x114));var _0x99a1=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0x9a19[_0x27beea];return _0x122645;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));var integrations=require(_0x99a1('0xa'));module[_0x99a1('0xb')]=function(_0xff0240,_0x65045d){return _0xff0240['define']('FreshsalesAccount',attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb66c=['int_freshsales_accounts','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount'];(function(_0x3868af,_0x1569d4){var _0x48a360=function(_0x46bd3e){while(--_0x46bd3e){_0x3868af['push'](_0x3868af['shift']());}};_0x48a360(++_0x1569d4);}(_0xb66c,0x175));var _0xcb66=function(_0x49b307,_0x455061){_0x49b307=_0x49b307-0x0;var _0x3d036f=_0xb66c[_0x49b307];return _0x3d036f;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var logger=require(_0xcb66('0x1'))('api');var moment=require(_0xcb66('0x2'));var BPromise=require(_0xcb66('0x3'));var rp=require(_0xcb66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var attributes=require(_0xcb66('0x7'));var integrations=require(_0xcb66('0x8'));module['exports']=function(_0x518163,_0x19adf5){return _0x518163[_0xcb66('0x9')](_0xcb66('0xa'),attributes,{'tableName':_0xcb66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1af5c93..850890d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f1a=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','map','model','ShowFreshsalesAccount'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8f1a,0xcd));var _0xa8f1=function(_0x41366f,_0x39875f){_0x41366f=_0x41366f-0x0;var _0x51b6ac=_0x8f1a[_0x41366f];return _0x51b6ac;};'use strict';var _=require(_0xa8f1('0x0'));var util=require(_0xa8f1('0x1'));var moment=require(_0xa8f1('0x2'));var BPromise=require(_0xa8f1('0x3'));var rs=require(_0xa8f1('0x4'));var fs=require('fs');var Redis=require(_0xa8f1('0x5'));var db=require(_0xa8f1('0x6'))['db'];var utils=require(_0xa8f1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa8f1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8f1('0x9')][_0xa8f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c2920,_0x43c3ed,_0x13f210){return new BPromise(function(_0xcc8a38,_0x36b58b){return client[_0xa8f1('0xb')](_0x4c2920,_0x13f210)[_0xa8f1('0xc')](function(_0x1a23a0){logger[_0xa8f1('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x43c3ed,_0xa8f1('0xe'));logger[_0xa8f1('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x43c3ed,_0xa8f1('0xe'),JSON['stringify'](_0x1a23a0));if(_0x1a23a0[_0xa8f1('0x10')]){if(_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x11')]===0x1f4){logger['error'](_0xa8f1('0x12'),_0x43c3ed,_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x13')]);return _0x36b58b(_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x13')]);}logger['error'](_0xa8f1('0x12'),_0x43c3ed,_0x1a23a0['error'][_0xa8f1('0x13')]);return _0xcc8a38(_0x1a23a0[_0xa8f1('0x10')]['message']);}else{logger['info'](_0xa8f1('0x12'),_0x43c3ed,_0xa8f1('0xe'));_0xcc8a38(_0x1a23a0[_0xa8f1('0x14')][_0xa8f1('0x13')]);}})[_0xa8f1('0x15')](function(_0x15bfad){logger[_0xa8f1('0x10')](_0xa8f1('0x12'),_0x43c3ed,_0x15bfad);_0x36b58b(_0x15bfad);});});}exports[_0xa8f1('0x16')]=function(_0x124917){var _0x453532=this;return new Promise(function(_0x2ea505,_0x8b7ed1){return db[_0xa8f1('0x17')]['findAll']({'raw':_0x124917['options']?_0x124917[_0xa8f1('0x18')][_0xa8f1('0x19')]===undefined?!![]:![]:!![],'where':_0x124917[_0xa8f1('0x18')]?_0x124917['options'][_0xa8f1('0x1a')]||null:null,'attributes':_0x124917[_0xa8f1('0x18')]?_0x124917[_0xa8f1('0x18')][_0xa8f1('0x1b')]||null:null,'limit':_0x124917[_0xa8f1('0x18')]?_0x124917['options'][_0xa8f1('0x1c')]||null:null,'include':_0x124917[_0xa8f1('0x18')]?_0x124917['options'][_0xa8f1('0x1d')]?_[_0xa8f1('0x1e')](_0x124917[_0xa8f1('0x18')][_0xa8f1('0x1d')],function(_0x2306ec){return{'model':db[_0x2306ec[_0xa8f1('0x1f')]],'as':_0x2306ec['as'],'attributes':_0x2306ec[_0xa8f1('0x1b')],'include':_0x2306ec[_0xa8f1('0x1d')]?_[_0xa8f1('0x1e')](_0x2306ec['include'],function(_0x3966b6){return{'model':db[_0x3966b6[_0xa8f1('0x1f')]],'as':_0x3966b6['as'],'attributes':_0x3966b6[_0xa8f1('0x1b')],'include':_0x3966b6[_0xa8f1('0x1d')]?_[_0xa8f1('0x1e')](_0x3966b6['include'],function(_0x3eda99){return{'model':db[_0x3eda99[_0xa8f1('0x1f')]],'as':_0x3eda99['as'],'attributes':_0x3eda99['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x528cc4){logger[_0xa8f1('0xd')](_0xa8f1('0x16'),_0x124917);logger['debug']('GetFreshsalesAccount',_0x124917,JSON['stringify'](_0x528cc4));_0x2ea505(_0x528cc4);})[_0xa8f1('0x15')](function(_0x50b089){logger[_0xa8f1('0x10')](_0xa8f1('0x16'),_0x50b089[_0xa8f1('0x13')],_0x124917);_0x8b7ed1(_0x453532[_0xa8f1('0x10')](0x1f4,_0x50b089[_0xa8f1('0x13')]));});});};exports[_0xa8f1('0x20')]=function(_0x179ed0){var _0x3641e2=this;return new Promise(function(_0x3ec18d,_0x12be31){return db['FreshsalesAccount']['find']({'raw':_0x179ed0[_0xa8f1('0x18')]?_0x179ed0[_0xa8f1('0x18')][_0xa8f1('0x19')]===undefined?!![]:![]:!![],'where':_0x179ed0[_0xa8f1('0x18')]?_0x179ed0[_0xa8f1('0x18')][_0xa8f1('0x1a')]||null:null,'attributes':_0x179ed0[_0xa8f1('0x18')]?_0x179ed0[_0xa8f1('0x18')][_0xa8f1('0x1b')]||null:null,'include':_0x179ed0['options']?_0x179ed0['options']['include']?_[_0xa8f1('0x1e')](_0x179ed0[_0xa8f1('0x18')][_0xa8f1('0x1d')],function(_0xf2cff7){return{'model':db[_0xf2cff7[_0xa8f1('0x1f')]],'as':_0xf2cff7['as'],'attributes':_0xf2cff7['attributes'],'include':_0xf2cff7['include']?_[_0xa8f1('0x1e')](_0xf2cff7[_0xa8f1('0x1d')],function(_0x112204){return{'model':db[_0x112204[_0xa8f1('0x1f')]],'as':_0x112204['as'],'attributes':_0x112204[_0xa8f1('0x1b')],'include':_0x112204['include']?_[_0xa8f1('0x1e')](_0x112204[_0xa8f1('0x1d')],function(_0x373696){return{'model':db[_0x373696[_0xa8f1('0x1f')]],'as':_0x373696['as'],'attributes':_0x373696[_0xa8f1('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcce489){logger[_0xa8f1('0xd')](_0xa8f1('0x20'),_0x179ed0);logger[_0xa8f1('0xf')](_0xa8f1('0x20'),_0x179ed0,JSON[_0xa8f1('0x21')](_0xcce489));_0x3ec18d(_0xcce489);})['catch'](function(_0x922ba5){logger[_0xa8f1('0x10')]('ShowFreshsalesAccount',_0x922ba5[_0xa8f1('0x13')],_0x179ed0);_0x12be31(_0x3641e2['error'](0x1f4,_0x922ba5[_0xa8f1('0x13')]));});});};
\ No newline at end of file
+var _0xc6c0=['map','ShowFreshsalesAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','include','model'];(function(_0x1086cc,_0x2783f2){var _0xd9c201=function(_0x17a29e){while(--_0x17a29e){_0x1086cc['push'](_0x1086cc['shift']());}};_0xd9c201(++_0x2783f2);}(_0xc6c0,0x13e));var _0x0c6c=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xc6c0[_0x562f3b];return _0x1edd55;};'use strict';var _=require(_0x0c6c('0x0'));var util=require('util');var moment=require(_0x0c6c('0x1'));var BPromise=require(_0x0c6c('0x2'));var rs=require(_0x0c6c('0x3'));var fs=require('fs');var Redis=require(_0x0c6c('0x4'));var db=require(_0x0c6c('0x5'))['db'];var utils=require(_0x0c6c('0x6'));var logger=require(_0x0c6c('0x7'))(_0x0c6c('0x8'));var config=require(_0x0c6c('0x9'));var jayson=require(_0x0c6c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1791cb,_0x223b4f,_0x51208d){return new BPromise(function(_0x2e0cd9,_0x15c862){return client[_0x0c6c('0xb')](_0x1791cb,_0x51208d)[_0x0c6c('0xc')](function(_0x317bcf){logger[_0x0c6c('0xd')](_0x0c6c('0xe'),_0x223b4f,_0x0c6c('0xf'));logger[_0x0c6c('0x10')](_0x0c6c('0x11'),_0x223b4f,_0x0c6c('0xf'),JSON[_0x0c6c('0x12')](_0x317bcf));if(_0x317bcf['error']){if(_0x317bcf[_0x0c6c('0x13')]['code']===0x1f4){logger[_0x0c6c('0x13')](_0x0c6c('0xe'),_0x223b4f,_0x317bcf['error'][_0x0c6c('0x14')]);return _0x15c862(_0x317bcf[_0x0c6c('0x13')][_0x0c6c('0x14')]);}logger[_0x0c6c('0x13')](_0x0c6c('0xe'),_0x223b4f,_0x317bcf['error'][_0x0c6c('0x14')]);return _0x2e0cd9(_0x317bcf[_0x0c6c('0x13')][_0x0c6c('0x14')]);}else{logger[_0x0c6c('0xd')](_0x0c6c('0xe'),_0x223b4f,_0x0c6c('0xf'));_0x2e0cd9(_0x317bcf[_0x0c6c('0x15')]['message']);}})[_0x0c6c('0x16')](function(_0x527ade){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x223b4f,_0x527ade);_0x15c862(_0x527ade);});});}exports[_0x0c6c('0x17')]=function(_0x530333){var _0x9463e8=this;return new Promise(function(_0x50be43,_0x316dbe){return db[_0x0c6c('0x18')][_0x0c6c('0x19')]({'raw':_0x530333[_0x0c6c('0x1a')]?_0x530333['options'][_0x0c6c('0x1b')]===undefined?!![]:![]:!![],'where':_0x530333[_0x0c6c('0x1a')]?_0x530333[_0x0c6c('0x1a')][_0x0c6c('0x1c')]||null:null,'attributes':_0x530333[_0x0c6c('0x1a')]?_0x530333[_0x0c6c('0x1a')][_0x0c6c('0x1d')]||null:null,'limit':_0x530333[_0x0c6c('0x1a')]?_0x530333[_0x0c6c('0x1a')]['limit']||null:null,'include':_0x530333[_0x0c6c('0x1a')]?_0x530333[_0x0c6c('0x1a')][_0x0c6c('0x1e')]?_['map'](_0x530333[_0x0c6c('0x1a')]['include'],function(_0x76992){return{'model':db[_0x76992[_0x0c6c('0x1f')]],'as':_0x76992['as'],'attributes':_0x76992[_0x0c6c('0x1d')],'include':_0x76992['include']?_[_0x0c6c('0x20')](_0x76992[_0x0c6c('0x1e')],function(_0x200a47){return{'model':db[_0x200a47[_0x0c6c('0x1f')]],'as':_0x200a47['as'],'attributes':_0x200a47[_0x0c6c('0x1d')],'include':_0x200a47[_0x0c6c('0x1e')]?_[_0x0c6c('0x20')](_0x200a47[_0x0c6c('0x1e')],function(_0x194637){return{'model':db[_0x194637[_0x0c6c('0x1f')]],'as':_0x194637['as'],'attributes':_0x194637['attributes']};}):[]};}):[]};}):[]:[]})[_0x0c6c('0xc')](function(_0x557046){logger[_0x0c6c('0xd')]('GetFreshsalesAccount',_0x530333);logger[_0x0c6c('0x10')](_0x0c6c('0x17'),_0x530333,JSON[_0x0c6c('0x12')](_0x557046));_0x50be43(_0x557046);})[_0x0c6c('0x16')](function(_0x2cbfc7){logger[_0x0c6c('0x13')](_0x0c6c('0x17'),_0x2cbfc7[_0x0c6c('0x14')],_0x530333);_0x316dbe(_0x9463e8['error'](0x1f4,_0x2cbfc7[_0x0c6c('0x14')]));});});};exports[_0x0c6c('0x21')]=function(_0x5ec5bc){var _0x40d708=this;return new Promise(function(_0x556dad,_0x37357b){return db[_0x0c6c('0x18')][_0x0c6c('0x22')]({'raw':_0x5ec5bc[_0x0c6c('0x1a')]?_0x5ec5bc[_0x0c6c('0x1a')][_0x0c6c('0x1b')]===undefined?!![]:![]:!![],'where':_0x5ec5bc[_0x0c6c('0x1a')]?_0x5ec5bc[_0x0c6c('0x1a')][_0x0c6c('0x1c')]||null:null,'attributes':_0x5ec5bc['options']?_0x5ec5bc['options'][_0x0c6c('0x1d')]||null:null,'include':_0x5ec5bc[_0x0c6c('0x1a')]?_0x5ec5bc[_0x0c6c('0x1a')][_0x0c6c('0x1e')]?_[_0x0c6c('0x20')](_0x5ec5bc[_0x0c6c('0x1a')]['include'],function(_0x3c97d1){return{'model':db[_0x3c97d1['model']],'as':_0x3c97d1['as'],'attributes':_0x3c97d1[_0x0c6c('0x1d')],'include':_0x3c97d1['include']?_[_0x0c6c('0x20')](_0x3c97d1[_0x0c6c('0x1e')],function(_0x5951f2){return{'model':db[_0x5951f2['model']],'as':_0x5951f2['as'],'attributes':_0x5951f2[_0x0c6c('0x1d')],'include':_0x5951f2[_0x0c6c('0x1e')]?_[_0x0c6c('0x20')](_0x5951f2[_0x0c6c('0x1e')],function(_0x4ed556){return{'model':db[_0x4ed556[_0x0c6c('0x1f')]],'as':_0x4ed556['as'],'attributes':_0x4ed556[_0x0c6c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9d6ee8){logger[_0x0c6c('0xd')](_0x0c6c('0x21'),_0x5ec5bc);logger['debug'](_0x0c6c('0x21'),_0x5ec5bc,JSON[_0x0c6c('0x12')](_0x9d6ee8));_0x556dad(_0x9d6ee8);})[_0x0c6c('0x16')](function(_0x93e98a){logger[_0x0c6c('0x13')](_0x0c6c('0x21'),_0x93e98a[_0x0c6c('0x14')],_0x5ec5bc);_0x37357b(_0x40d708[_0x0c6c('0x13')](0x1f4,_0x93e98a[_0x0c6c('0x14')]));});});};
\ No newline at end of file
index 64536d8..f893795 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a12=['../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x540644,_0x806cb7){var _0x4b022b=function(_0x3cd679){while(--_0x3cd679){_0x540644['push'](_0x540644['shift']());}};_0x4b022b(++_0x806cb7);}(_0x2a12,0x1b2));var _0x22a1=function(_0xd4497b,_0x122302){_0xd4497b=_0xd4497b-0x0;var _0x105f72=_0x2a12[_0xd4497b];return _0x105f72;};'use strict';var multer=require(_0x22a1('0x0'));var util=require(_0x22a1('0x1'));var path=require(_0x22a1('0x2'));var timeout=require(_0x22a1('0x3'));var express=require(_0x22a1('0x4'));var router=express[_0x22a1('0x5')]();var auth=require(_0x22a1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x22a1('0x7'));var controller=require(_0x22a1('0x8'));router[_0x22a1('0x9')]('/',auth[_0x22a1('0xa')](),controller['index']);router[_0x22a1('0x9')]('/:id',auth[_0x22a1('0xa')](),controller['show']);router[_0x22a1('0x9')](_0x22a1('0xb'),auth[_0x22a1('0xa')](),controller[_0x22a1('0xc')]);router[_0x22a1('0x9')](_0x22a1('0xd'),auth['isAuthenticated'](),controller[_0x22a1('0xe')]);router[_0x22a1('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x22a1('0xf')]('/',auth[_0x22a1('0xa')](),controller[_0x22a1('0x10')]);router[_0x22a1('0x11')](_0x22a1('0x12'),auth[_0x22a1('0xa')](),controller[_0x22a1('0x13')]);router[_0x22a1('0x14')]('/:id',auth[_0x22a1('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb6af=['./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','post','create','put','update','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4489e8,_0x53b114){var _0x48d98e=function(_0x2a8bac){while(--_0x2a8bac){_0x4489e8['push'](_0x4489e8['shift']());}};_0x48d98e(++_0x53b114);}(_0xb6af,0x197));var _0xfb6a=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0xb6af[_0x4a82ac];return _0x58ee97;};'use strict';var multer=require('multer');var util=require(_0xfb6a('0x0'));var path=require(_0xfb6a('0x1'));var timeout=require(_0xfb6a('0x2'));var express=require(_0xfb6a('0x3'));var router=express[_0xfb6a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xfb6a('0x5'));var config=require(_0xfb6a('0x6'));var controller=require(_0xfb6a('0x7'));router[_0xfb6a('0x8')]('/',auth['isAuthenticated'](),controller[_0xfb6a('0x9')]);router[_0xfb6a('0x8')](_0xfb6a('0xa'),auth[_0xfb6a('0xb')](),controller[_0xfb6a('0xc')]);router[_0xfb6a('0x8')](_0xfb6a('0xd'),auth[_0xfb6a('0xb')](),controller[_0xfb6a('0xe')]);router[_0xfb6a('0x8')]('/:id/descriptions',auth[_0xfb6a('0xb')](),controller[_0xfb6a('0xf')]);router[_0xfb6a('0x8')](_0xfb6a('0x10'),auth[_0xfb6a('0xb')](),controller[_0xfb6a('0x11')]);router[_0xfb6a('0x12')]('/',auth['isAuthenticated'](),controller[_0xfb6a('0x13')]);router[_0xfb6a('0x14')](_0xfb6a('0xa'),auth[_0xfb6a('0xb')](),controller[_0xfb6a('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfb6a('0x16')]);module['exports']=router;
\ No newline at end of file
index 5b4b77f..16167b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaefc=['sequelize','exports','STRING'];(function(_0x4d45c1,_0x2beda1){var _0x244478=function(_0x11304c){while(--_0x11304c){_0x4d45c1['push'](_0x4d45c1['shift']());}};_0x244478(++_0x2beda1);}(_0xaefc,0xc6));var _0xcaef=function(_0x40550d,_0x5acf92){_0x40550d=_0x40550d-0x0;var _0x2ba8be=_0xaefc[_0x40550d];return _0x2ba8be;};'use strict';var Sequelize=require(_0xcaef('0x0'));module[_0xcaef('0x1')]={'name':{'type':Sequelize[_0xcaef('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x69eb=['sequelize'];(function(_0x91f712,_0x43e20e){var _0xcc7a42=function(_0x314f71){while(--_0x314f71){_0x91f712['push'](_0x91f712['shift']());}};_0xcc7a42(++_0x43e20e);}(_0x69eb,0x179));var _0xb69e=function(_0x1c8ed3,_0x4d64b1){_0x1c8ed3=_0x1c8ed3-0x0;var _0xd802=_0x69eb[_0x1c8ed3];return _0xd802;};'use strict';var Sequelize=require(_0xb69e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index cd095d4..e957f0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5055=['fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','include','rows','params','includeAll','body','find','getSubjects','findOne','FreshsalesField','getDescriptions','pick','getFields','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','count','offset','limit','apply','reject','save','update','destroy','stack','name','send','FreshsalesConfiguration','rawAttributes'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0x5055,0x7d));var _0x5505=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5055[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x5505('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5505('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5505('0x2'));var rp=require(_0x5505('0x3'));var moment=require('moment');var BPromise=require(_0x5505('0x4'));var Mustache=require(_0x5505('0x5'));var util=require('util');var path=require(_0x5505('0x6'));var sox=require(_0x5505('0x7'));var csv=require(_0x5505('0x8'));var ejs=require(_0x5505('0x9'));var fs=require('fs');var _=require(_0x5505('0xa'));var squel=require(_0x5505('0xb'));var crypto=require(_0x5505('0xc'));var jsforce=require(_0x5505('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5505('0x8'));var querystring=require(_0x5505('0xe'));var Papa=require(_0x5505('0xf'));var Redis=require(_0x5505('0x10'));var authService=require(_0x5505('0x11'));var qs=require(_0x5505('0x12'));var as=require(_0x5505('0x13'));var hardwareService=require(_0x5505('0x14'));var logger=require(_0x5505('0x15'))(_0x5505('0x16'));var utils=require(_0x5505('0x17'));var config=require(_0x5505('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5505('0x19'));var client=jayson[_0x5505('0x1a')][_0x5505('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x11114c,_0xf8cbca,_0x45b040){if(_0x45b040){var _0xbe8808=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbe8808[_0x5505('0x1c')](_0xf8cbca)){return _0x11114c;}else{throw new db[(_0x5505('0x1d'))][(_0x5505('0x1e'))](_0x5505('0x1f'));}}else{return _0x11114c;}}function respondWithRpcPromise(_0x189a2c,_0x4f1770,_0x3a04b9,_0x171b3c){return new BPromise(function(_0x14e9c3,_0xae912e){var _0x474a4c=_0x171b3c||client;return _0x474a4c[_0x5505('0x20')](_0x189a2c,_0x3a04b9)[_0x5505('0x21')](function(_0x241bb0){logger[_0x5505('0x22')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4f1770,_0x5505('0x23'));logger[_0x5505('0x24')](_0x5505('0x25'),_0x4f1770,'request\x20sent',JSON['stringify'](_0x241bb0));if(_0x241bb0[_0x5505('0x26')]){if(_0x241bb0[_0x5505('0x26')][_0x5505('0x27')]===0x1f4){logger[_0x5505('0x26')](_0x5505('0x28'),_0x4f1770,_0x241bb0[_0x5505('0x26')][_0x5505('0x29')]);return _0xae912e(_0x241bb0[_0x5505('0x26')][_0x5505('0x29')]);}logger[_0x5505('0x26')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4f1770,_0x241bb0['error'][_0x5505('0x29')]);return _0x14e9c3(_0x241bb0[_0x5505('0x26')][_0x5505('0x29')]);}else{logger[_0x5505('0x22')](_0x5505('0x28'),_0x4f1770,_0x5505('0x23'));_0x14e9c3(_0x241bb0[_0x5505('0x2a')]['message']);}})[_0x5505('0x2b')](function(_0x34c537){logger['error'](_0x5505('0x28'),_0x4f1770,_0x34c537);_0xae912e(_0x34c537);});});}function respondWithStatusCode(_0x3f0bef,_0x3f9a38){_0x3f9a38=_0x3f9a38||0xcc;return function(_0x3d09f5){if(_0x3d09f5){return _0x3f0bef[_0x5505('0x2c')](_0x3f9a38);}return _0x3f0bef['status'](_0x3f9a38)[_0x5505('0x2d')]();};}function respondWithResult(_0x3b25e0,_0x4ca27b){_0x4ca27b=_0x4ca27b||0xc8;return function(_0x22772c){if(_0x22772c){return _0x3b25e0[_0x5505('0x2e')](_0x4ca27b)[_0x5505('0x2f')](_0x22772c);}};}function respondWithFilteredResult(_0x38a8fa,_0x187221){return function(_0x3e2988){if(_0x3e2988){var _0x2a5fb8=_0x3e2988[_0x5505('0x30')],_0x2c01ed=_0x187221['offset'],_0x4566db=_0x187221[_0x5505('0x31')]+_0x187221[_0x5505('0x32')],_0x439fbd;if(_0x4566db>=_0x2a5fb8){_0x4566db=_0x2a5fb8;_0x439fbd=0xc8;}else{_0x439fbd=0xce;}_0x38a8fa[_0x5505('0x2e')](_0x439fbd);return _0x38a8fa['set']('Content-Range',_0x2c01ed+'-'+_0x4566db+'/'+_0x2a5fb8)[_0x5505('0x2f')](_0x3e2988);}return null;};}function patchUpdates(_0x4ffdc3){return function(_0x31caa8){try{jsonpatch[_0x5505('0x33')](_0x31caa8,_0x4ffdc3,!![]);}catch(_0x902fe){return BPromise[_0x5505('0x34')](_0x902fe);}return _0x31caa8[_0x5505('0x35')]();};}function saveUpdates(_0xe17295,_0xace010){return function(_0x4804e5){if(_0x4804e5){return _0x4804e5[_0x5505('0x36')](_0xe17295)[_0x5505('0x21')](function(_0x2f5c8a){return _0x2f5c8a;});}return null;};}function removeEntity(_0x307830,_0x24b17d){return function(_0x231872){if(_0x231872){return _0x231872[_0x5505('0x37')]()[_0x5505('0x21')](function(){_0x307830[_0x5505('0x2e')](0xcc)[_0x5505('0x2d')]();});}};}function handleEntityNotFound(_0xe380b0,_0x40922a){return function(_0x24792c){if(!_0x24792c){_0xe380b0[_0x5505('0x2c')](0x194);}return _0x24792c;};}function handleError(_0x47526d,_0x2164c7){_0x2164c7=_0x2164c7||0x1f4;return function(_0x4eb091){logger[_0x5505('0x26')](_0x4eb091[_0x5505('0x38')]);if(_0x4eb091[_0x5505('0x39')]){delete _0x4eb091['name'];}_0x47526d[_0x5505('0x2e')](_0x2164c7)[_0x5505('0x3a')](_0x4eb091);};}exports['index']=function(_0x593094,_0x4542be){var _0x29099c={},_0x1ffe70={},_0x3b7a09={'count':0x0,'rows':[]};var _0x19002c=_['map'](db[_0x5505('0x3b')][_0x5505('0x3c')],function(_0x24a469){return{'name':_0x24a469[_0x5505('0x3d')],'type':_0x24a469['type'][_0x5505('0x3e')]};});_0x1ffe70[_0x5505('0x3f')]=_[_0x5505('0x40')](_0x19002c,_0x5505('0x39'));_0x1ffe70[_0x5505('0x41')]=_[_0x5505('0x42')](_0x593094['query']);_0x1ffe70[_0x5505('0x43')]=_[_0x5505('0x44')](_0x1ffe70[_0x5505('0x3f')],_0x1ffe70[_0x5505('0x41')]);_0x29099c[_0x5505('0x45')]=_[_0x5505('0x44')](_0x1ffe70[_0x5505('0x3f')],qs[_0x5505('0x46')](_0x593094[_0x5505('0x41')]['fields']));_0x29099c['attributes']=_0x29099c[_0x5505('0x45')][_0x5505('0x47')]?_0x29099c[_0x5505('0x45')]:_0x1ffe70[_0x5505('0x3f')];if(!_0x593094[_0x5505('0x41')][_0x5505('0x48')](_0x5505('0x49'))){_0x29099c[_0x5505('0x32')]=qs[_0x5505('0x32')](_0x593094['query'][_0x5505('0x32')]);_0x29099c[_0x5505('0x31')]=qs[_0x5505('0x31')](_0x593094['query'][_0x5505('0x31')]);}_0x29099c[_0x5505('0x4a')]=qs['sort'](_0x593094[_0x5505('0x41')][_0x5505('0x4b')]);_0x29099c['where']=qs['filters'](_['pick'](_0x593094[_0x5505('0x41')],_0x1ffe70['filters']),_0x19002c);if(_0x593094[_0x5505('0x41')]['filter']){_0x29099c[_0x5505('0x4c')]=_[_0x5505('0x4d')](_0x29099c[_0x5505('0x4c')],{'$or':_[_0x5505('0x40')](_0x19002c,function(_0xc811){if(_0xc811[_0x5505('0x4e')]!=='VIRTUAL'){var _0x115832={};_0x115832[_0xc811['name']]={'$like':'%'+_0x593094[_0x5505('0x41')][_0x5505('0x4f')]+'%'};return _0x115832;}})});}_0x29099c=_[_0x5505('0x4d')]({},_0x29099c,_0x593094[_0x5505('0x50')]);var _0x58720a={'where':_0x29099c[_0x5505('0x4c')]};return db['FreshsalesConfiguration'][_0x5505('0x30')](_0x58720a)[_0x5505('0x21')](function(_0x23225e){_0x3b7a09[_0x5505('0x30')]=_0x23225e;if(_0x593094[_0x5505('0x41')]['includeAll']){_0x29099c[_0x5505('0x51')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x29099c);})[_0x5505('0x21')](function(_0x127b31){_0x3b7a09[_0x5505('0x52')]=_0x127b31;return _0x3b7a09;})[_0x5505('0x21')](respondWithFilteredResult(_0x4542be,_0x29099c))['catch'](handleError(_0x4542be,null));};exports['show']=function(_0x445f2d,_0x2cc90a){var _0x17ca4d={'raw':![],'where':{'id':_0x445f2d[_0x5505('0x53')]['id']}},_0x1e78d3={};_0x1e78d3[_0x5505('0x3f')]=_['keys'](db[_0x5505('0x3b')][_0x5505('0x3c')]);_0x1e78d3['query']=_[_0x5505('0x42')](_0x445f2d[_0x5505('0x41')]);_0x1e78d3[_0x5505('0x43')]=_['intersection'](_0x1e78d3[_0x5505('0x3f')],_0x1e78d3['query']);_0x17ca4d[_0x5505('0x45')]=_['intersection'](_0x1e78d3[_0x5505('0x3f')],qs[_0x5505('0x46')](_0x445f2d[_0x5505('0x41')]['fields']));_0x17ca4d[_0x5505('0x45')]=_0x17ca4d[_0x5505('0x45')]['length']?_0x17ca4d['attributes']:_0x1e78d3['model'];if(_0x445f2d[_0x5505('0x41')][_0x5505('0x54')]){_0x17ca4d['include']=[{'all':!![]}];}_0x17ca4d=_['merge']({},_0x17ca4d,_0x445f2d[_0x5505('0x50')]);return db['FreshsalesConfiguration']['find'](_0x17ca4d)[_0x5505('0x21')](handleEntityNotFound(_0x2cc90a,null))[_0x5505('0x21')](respondWithResult(_0x2cc90a,null))[_0x5505('0x2b')](handleError(_0x2cc90a,null));};exports['create']=function(_0x3901e8,_0x339808){return db[_0x5505('0x3b')]['create'](_0x3901e8[_0x5505('0x55')],{})[_0x5505('0x21')](respondWithResult(_0x339808,0xc9))['catch'](handleError(_0x339808,null));};exports[_0x5505('0x36')]=function(_0x4ebefb,_0x3b3765){if(_0x4ebefb['body']['id']){delete _0x4ebefb[_0x5505('0x55')]['id'];}return db['FreshsalesConfiguration'][_0x5505('0x56')]({'where':{'id':_0x4ebefb[_0x5505('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b3765,null))[_0x5505('0x21')](saveUpdates(_0x4ebefb[_0x5505('0x55')],null))['then'](respondWithResult(_0x3b3765,null))[_0x5505('0x2b')](handleError(_0x3b3765,null));};exports[_0x5505('0x37')]=function(_0x42e138,_0x50fad1){return db[_0x5505('0x3b')][_0x5505('0x56')]({'where':{'id':_0x42e138[_0x5505('0x53')]['id']}})[_0x5505('0x21')](handleEntityNotFound(_0x50fad1,null))[_0x5505('0x21')](removeEntity(_0x50fad1,null))['catch'](handleError(_0x50fad1,null));};exports[_0x5505('0x57')]=function(_0xb342c9,_0x3eac3b,_0x26a927){var _0x561008={};var _0x2b4a55={};var _0x359704;var _0x3fd149;return db['FreshsalesConfiguration'][_0x5505('0x58')]({'where':{'id':_0xb342c9[_0x5505('0x53')]['id']}})['then'](handleEntityNotFound(_0x3eac3b,null))[_0x5505('0x21')](function(_0x305d68){if(_0x305d68){_0x359704=_0x305d68;_0x2b4a55[_0x5505('0x3f')]=_[_0x5505('0x42')](db[_0x5505('0x59')][_0x5505('0x3c')]);_0x2b4a55[_0x5505('0x41')]=_[_0x5505('0x42')](_0xb342c9[_0x5505('0x41')]);_0x2b4a55[_0x5505('0x43')]=_[_0x5505('0x44')](_0x2b4a55[_0x5505('0x3f')],_0x2b4a55[_0x5505('0x41')]);_0x561008[_0x5505('0x45')]=_[_0x5505('0x44')](_0x2b4a55[_0x5505('0x3f')],qs[_0x5505('0x46')](_0xb342c9['query'][_0x5505('0x46')]));_0x561008[_0x5505('0x45')]=_0x561008['attributes'][_0x5505('0x47')]?_0x561008[_0x5505('0x45')]:_0x2b4a55[_0x5505('0x3f')];_0x561008[_0x5505('0x4a')]=qs['sort'](_0xb342c9[_0x5505('0x41')][_0x5505('0x4b')]);_0x561008[_0x5505('0x4c')]=qs[_0x5505('0x43')](_['pick'](_0xb342c9['query'],_0x2b4a55[_0x5505('0x43')]));if(_0xb342c9['query']['filter']){_0x561008[_0x5505('0x4c')]=_[_0x5505('0x4d')](_0x561008[_0x5505('0x4c')],{'$or':_[_0x5505('0x40')](_0x561008[_0x5505('0x45')],function(_0x39b55e){var _0x17b00c={};_0x17b00c[_0x39b55e]={'$like':'%'+_0xb342c9[_0x5505('0x41')][_0x5505('0x4f')]+'%'};return _0x17b00c;})});}_0x561008=_['merge']({},_0x561008,_0xb342c9[_0x5505('0x50')]);return _0x359704[_0x5505('0x57')](_0x561008);}})[_0x5505('0x21')](function(_0x1129b2){if(_0x1129b2){_0x3fd149=_0x1129b2[_0x5505('0x47')];if(!_0xb342c9[_0x5505('0x41')][_0x5505('0x48')](_0x5505('0x49'))){_0x561008[_0x5505('0x32')]=qs[_0x5505('0x32')](_0xb342c9[_0x5505('0x41')][_0x5505('0x32')]);_0x561008['offset']=qs[_0x5505('0x31')](_0xb342c9[_0x5505('0x41')][_0x5505('0x31')]);}return _0x359704[_0x5505('0x57')](_0x561008);}})[_0x5505('0x21')](function(_0x1d3d4a){if(_0x1d3d4a){return _0x1d3d4a?{'count':_0x3fd149,'rows':_0x1d3d4a}:null;}})['then'](respondWithResult(_0x3eac3b,null))[_0x5505('0x2b')](handleError(_0x3eac3b,null));};exports[_0x5505('0x5a')]=function(_0x593fa7,_0x25612c,_0x25f05f){var _0x5b76a2={};var _0x18a743={};var _0x29bc78;var _0x5553f5;return db['FreshsalesConfiguration'][_0x5505('0x58')]({'where':{'id':_0x593fa7[_0x5505('0x53')]['id']}})[_0x5505('0x21')](handleEntityNotFound(_0x25612c,null))[_0x5505('0x21')](function(_0x282f92){if(_0x282f92){_0x29bc78=_0x282f92;_0x18a743[_0x5505('0x3f')]=_[_0x5505('0x42')](db[_0x5505('0x59')][_0x5505('0x3c')]);_0x18a743['query']=_['keys'](_0x593fa7[_0x5505('0x41')]);_0x18a743[_0x5505('0x43')]=_['intersection'](_0x18a743[_0x5505('0x3f')],_0x18a743[_0x5505('0x41')]);_0x5b76a2[_0x5505('0x45')]=_['intersection'](_0x18a743[_0x5505('0x3f')],qs[_0x5505('0x46')](_0x593fa7[_0x5505('0x41')][_0x5505('0x46')]));_0x5b76a2['attributes']=_0x5b76a2['attributes'][_0x5505('0x47')]?_0x5b76a2[_0x5505('0x45')]:_0x18a743[_0x5505('0x3f')];_0x5b76a2[_0x5505('0x4a')]=qs[_0x5505('0x4b')](_0x593fa7[_0x5505('0x41')][_0x5505('0x4b')]);_0x5b76a2[_0x5505('0x4c')]=qs[_0x5505('0x43')](_[_0x5505('0x5b')](_0x593fa7['query'],_0x18a743[_0x5505('0x43')]));if(_0x593fa7['query'][_0x5505('0x4f')]){_0x5b76a2[_0x5505('0x4c')]=_[_0x5505('0x4d')](_0x5b76a2[_0x5505('0x4c')],{'$or':_[_0x5505('0x40')](_0x5b76a2['attributes'],function(_0x537870){var _0x239c9f={};_0x239c9f[_0x537870]={'$like':'%'+_0x593fa7[_0x5505('0x41')][_0x5505('0x4f')]+'%'};return _0x239c9f;})});}_0x5b76a2=_['merge']({},_0x5b76a2,_0x593fa7[_0x5505('0x50')]);return _0x29bc78[_0x5505('0x5a')](_0x5b76a2);}})['then'](function(_0x2a5e0b){if(_0x2a5e0b){_0x5553f5=_0x2a5e0b['length'];if(!_0x593fa7[_0x5505('0x41')][_0x5505('0x48')](_0x5505('0x49'))){_0x5b76a2[_0x5505('0x32')]=qs[_0x5505('0x32')](_0x593fa7['query'][_0x5505('0x32')]);_0x5b76a2[_0x5505('0x31')]=qs['offset'](_0x593fa7[_0x5505('0x41')][_0x5505('0x31')]);}return _0x29bc78['getDescriptions'](_0x5b76a2);}})[_0x5505('0x21')](function(_0x1f0992){if(_0x1f0992){return _0x1f0992?{'count':_0x5553f5,'rows':_0x1f0992}:null;}})[_0x5505('0x21')](respondWithResult(_0x25612c,null))[_0x5505('0x2b')](handleError(_0x25612c,null));};exports[_0x5505('0x5c')]=function(_0x1d9b5b,_0x10e555,_0x3ab1bf){var _0x2315a5={};var _0x4097e7={};var _0x2b03a8;var _0x3ecddc;return db['FreshsalesConfiguration'][_0x5505('0x58')]({'where':{'id':_0x1d9b5b[_0x5505('0x53')]['id']}})[_0x5505('0x21')](handleEntityNotFound(_0x10e555,null))[_0x5505('0x21')](function(_0x826226){if(_0x826226){_0x2b03a8=_0x826226;_0x4097e7[_0x5505('0x3f')]=_[_0x5505('0x42')](db['FreshsalesField'][_0x5505('0x3c')]);_0x4097e7[_0x5505('0x41')]=_[_0x5505('0x42')](_0x1d9b5b[_0x5505('0x41')]);_0x4097e7[_0x5505('0x43')]=_['intersection'](_0x4097e7[_0x5505('0x3f')],_0x4097e7[_0x5505('0x41')]);_0x2315a5[_0x5505('0x45')]=_[_0x5505('0x44')](_0x4097e7['model'],qs[_0x5505('0x46')](_0x1d9b5b[_0x5505('0x41')][_0x5505('0x46')]));_0x2315a5[_0x5505('0x45')]=_0x2315a5[_0x5505('0x45')][_0x5505('0x47')]?_0x2315a5['attributes']:_0x4097e7[_0x5505('0x3f')];_0x2315a5['order']=qs['sort'](_0x1d9b5b[_0x5505('0x41')][_0x5505('0x4b')]);_0x2315a5[_0x5505('0x4c')]=qs['filters'](_[_0x5505('0x5b')](_0x1d9b5b[_0x5505('0x41')],_0x4097e7[_0x5505('0x43')]));if(_0x1d9b5b[_0x5505('0x41')]['filter']){_0x2315a5['where']=_[_0x5505('0x4d')](_0x2315a5[_0x5505('0x4c')],{'$or':_[_0x5505('0x40')](_0x2315a5['attributes'],function(_0x40ac53){var _0x48bd03={};_0x48bd03[_0x40ac53]={'$like':'%'+_0x1d9b5b[_0x5505('0x41')][_0x5505('0x4f')]+'%'};return _0x48bd03;})});}_0x2315a5=_[_0x5505('0x4d')]({},_0x2315a5,_0x1d9b5b[_0x5505('0x50')]);return _0x2b03a8[_0x5505('0x5c')](_0x2315a5);}})['then'](function(_0x45f1f6){if(_0x45f1f6){_0x3ecddc=_0x45f1f6[_0x5505('0x47')];if(!_0x1d9b5b[_0x5505('0x41')][_0x5505('0x48')](_0x5505('0x49'))){_0x2315a5[_0x5505('0x32')]=qs['limit'](_0x1d9b5b[_0x5505('0x41')][_0x5505('0x32')]);_0x2315a5[_0x5505('0x31')]=qs['offset'](_0x1d9b5b[_0x5505('0x41')][_0x5505('0x31')]);}return _0x2b03a8[_0x5505('0x5c')](_0x2315a5);}})[_0x5505('0x21')](function(_0x516e29){if(_0x516e29){return _0x516e29?{'count':_0x3ecddc,'rows':_0x516e29}:null;}})[_0x5505('0x21')](respondWithResult(_0x10e555,null))['catch'](handleError(_0x10e555,null));};
\ No newline at end of file
+var _0x8541=['merge','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','options','find','create','body','getSubjects','findOne','getDescriptions','FreshsalesField','getFields','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','name','send','index','map','FreshsalesConfiguration','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter'];(function(_0x33b526,_0x154c90){var _0x2ac44a=function(_0x465b29){while(--_0x465b29){_0x33b526['push'](_0x33b526['shift']());}};_0x2ac44a(++_0x154c90);}(_0x8541,0x18b));var _0x1854=function(_0x1bc836,_0x7dd56){_0x1bc836=_0x1bc836-0x0;var _0x59aa1c=_0x8541[_0x1bc836];return _0x59aa1c;};'use strict';var pdf=require(_0x1854('0x0'));var emlformat=require(_0x1854('0x1'));var rimraf=require(_0x1854('0x2'));var zipdir=require(_0x1854('0x3'));var jsonpatch=require(_0x1854('0x4'));var rp=require(_0x1854('0x5'));var moment=require('moment');var BPromise=require(_0x1854('0x6'));var Mustache=require(_0x1854('0x7'));var util=require(_0x1854('0x8'));var path=require('path');var sox=require(_0x1854('0x9'));var csv=require(_0x1854('0xa'));var ejs=require(_0x1854('0xb'));var fs=require('fs');var _=require(_0x1854('0xc'));var squel=require(_0x1854('0xd'));var crypto=require('crypto');var jsforce=require(_0x1854('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1854('0xa'));var querystring=require(_0x1854('0xf'));var Papa=require(_0x1854('0x10'));var Redis=require(_0x1854('0x11'));var authService=require(_0x1854('0x12'));var qs=require(_0x1854('0x13'));var as=require(_0x1854('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1854('0x15'));var utils=require('../../config/utils');var config=require(_0x1854('0x16'));var db=require(_0x1854('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x1854('0x18')][_0x1854('0x19')]({'port':0x232a});function checkPasswordPattern(_0x15132d,_0x516a95,_0x46b2e0){if(_0x46b2e0){var _0x5a7179=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a7179[_0x1854('0x1a')](_0x516a95)){return _0x15132d;}else{throw new db[(_0x1854('0x1b'))][(_0x1854('0x1c'))](_0x1854('0x1d'));}}else{return _0x15132d;}}function respondWithRpcPromise(_0x13a5b2,_0x504e80,_0x5cf0fa,_0x5a7303){return new BPromise(function(_0x2f9f49,_0x55955e){var _0x45752d=_0x5a7303||client;return _0x45752d[_0x1854('0x1e')](_0x13a5b2,_0x5cf0fa)[_0x1854('0x1f')](function(_0x5344f0){logger['info'](_0x1854('0x20'),_0x504e80,'request\x20sent');logger[_0x1854('0x21')](_0x1854('0x22'),_0x504e80,_0x1854('0x23'),JSON['stringify'](_0x5344f0));if(_0x5344f0[_0x1854('0x24')]){if(_0x5344f0['error'][_0x1854('0x25')]===0x1f4){logger[_0x1854('0x24')](_0x1854('0x20'),_0x504e80,_0x5344f0[_0x1854('0x24')]['message']);return _0x55955e(_0x5344f0['error']['message']);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x504e80,_0x5344f0[_0x1854('0x24')]['message']);return _0x2f9f49(_0x5344f0[_0x1854('0x24')][_0x1854('0x26')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x504e80,_0x1854('0x23'));_0x2f9f49(_0x5344f0[_0x1854('0x27')]['message']);}})[_0x1854('0x28')](function(_0x50636c){logger[_0x1854('0x24')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x504e80,_0x50636c);_0x55955e(_0x50636c);});});}function respondWithStatusCode(_0x540142,_0x129979){_0x129979=_0x129979||0xcc;return function(_0x400844){if(_0x400844){return _0x540142[_0x1854('0x29')](_0x129979);}return _0x540142[_0x1854('0x2a')](_0x129979)[_0x1854('0x2b')]();};}function respondWithResult(_0x4eb164,_0x20195e){_0x20195e=_0x20195e||0xc8;return function(_0x250e12){if(_0x250e12){return _0x4eb164[_0x1854('0x2a')](_0x20195e)[_0x1854('0x2c')](_0x250e12);}};}function respondWithFilteredResult(_0x3ebb06,_0x3ff7cc){return function(_0x2b9682){if(_0x2b9682){var _0x4de758=_0x2b9682[_0x1854('0x2d')],_0x4c0a22=_0x3ff7cc['offset'],_0x241b1b=_0x3ff7cc[_0x1854('0x2e')]+_0x3ff7cc[_0x1854('0x2f')],_0x3222ca;if(_0x241b1b>=_0x4de758){_0x241b1b=_0x4de758;_0x3222ca=0xc8;}else{_0x3222ca=0xce;}_0x3ebb06[_0x1854('0x2a')](_0x3222ca);return _0x3ebb06[_0x1854('0x30')](_0x1854('0x31'),_0x4c0a22+'-'+_0x241b1b+'/'+_0x4de758)[_0x1854('0x2c')](_0x2b9682);}return null;};}function patchUpdates(_0x208e66){return function(_0x3f7e6e){try{jsonpatch[_0x1854('0x32')](_0x3f7e6e,_0x208e66,!![]);}catch(_0x3b79b0){return BPromise['reject'](_0x3b79b0);}return _0x3f7e6e[_0x1854('0x33')]();};}function saveUpdates(_0x1410b4,_0x249505){return function(_0xff0a2a){if(_0xff0a2a){return _0xff0a2a[_0x1854('0x34')](_0x1410b4)['then'](function(_0x250010){return _0x250010;});}return null;};}function removeEntity(_0x3af52a,_0x441d5){return function(_0x553cc0){if(_0x553cc0){return _0x553cc0[_0x1854('0x35')]()[_0x1854('0x1f')](function(){_0x3af52a[_0x1854('0x2a')](0xcc)[_0x1854('0x2b')]();});}};}function handleEntityNotFound(_0x3dd570,_0x8cc933){return function(_0x3b5eec){if(!_0x3b5eec){_0x3dd570[_0x1854('0x29')](0x194);}return _0x3b5eec;};}function handleError(_0x2c3d18,_0x1c3408){_0x1c3408=_0x1c3408||0x1f4;return function(_0x5a2d60){logger['error'](_0x5a2d60['stack']);if(_0x5a2d60[_0x1854('0x36')]){delete _0x5a2d60[_0x1854('0x36')];}_0x2c3d18[_0x1854('0x2a')](_0x1c3408)[_0x1854('0x37')](_0x5a2d60);};}exports[_0x1854('0x38')]=function(_0xf8b9f5,_0x4c92ad){var _0x515b36={},_0x26faf3={},_0x32ba8d={'count':0x0,'rows':[]};var _0x14d85a=_[_0x1854('0x39')](db[_0x1854('0x3a')]['rawAttributes'],function(_0x2a4000){return{'name':_0x2a4000['fieldName'],'type':_0x2a4000[_0x1854('0x3b')][_0x1854('0x3c')]};});_0x26faf3[_0x1854('0x3d')]=_['map'](_0x14d85a,_0x1854('0x36'));_0x26faf3[_0x1854('0x3e')]=_[_0x1854('0x3f')](_0xf8b9f5[_0x1854('0x3e')]);_0x26faf3['filters']=_['intersection'](_0x26faf3[_0x1854('0x3d')],_0x26faf3[_0x1854('0x3e')]);_0x515b36[_0x1854('0x40')]=_['intersection'](_0x26faf3[_0x1854('0x3d')],qs[_0x1854('0x41')](_0xf8b9f5['query'][_0x1854('0x41')]));_0x515b36[_0x1854('0x40')]=_0x515b36[_0x1854('0x40')][_0x1854('0x42')]?_0x515b36[_0x1854('0x40')]:_0x26faf3[_0x1854('0x3d')];if(!_0xf8b9f5[_0x1854('0x3e')][_0x1854('0x43')](_0x1854('0x44'))){_0x515b36[_0x1854('0x2f')]=qs[_0x1854('0x2f')](_0xf8b9f5['query'][_0x1854('0x2f')]);_0x515b36[_0x1854('0x2e')]=qs[_0x1854('0x2e')](_0xf8b9f5[_0x1854('0x3e')][_0x1854('0x2e')]);}_0x515b36[_0x1854('0x45')]=qs[_0x1854('0x46')](_0xf8b9f5[_0x1854('0x3e')][_0x1854('0x46')]);_0x515b36[_0x1854('0x47')]=qs[_0x1854('0x48')](_[_0x1854('0x49')](_0xf8b9f5['query'],_0x26faf3[_0x1854('0x48')]),_0x14d85a);if(_0xf8b9f5['query'][_0x1854('0x4a')]){_0x515b36[_0x1854('0x47')]=_[_0x1854('0x4b')](_0x515b36['where'],{'$or':_['map'](_0x14d85a,function(_0x176118){if(_0x176118['type']!==_0x1854('0x4c')){var _0x2312ef={};_0x2312ef[_0x176118[_0x1854('0x36')]]={'$like':'%'+_0xf8b9f5[_0x1854('0x3e')][_0x1854('0x4a')]+'%'};return _0x2312ef;}})});}_0x515b36=_[_0x1854('0x4b')]({},_0x515b36,_0xf8b9f5['options']);var _0x1b0126={'where':_0x515b36[_0x1854('0x47')]};return db[_0x1854('0x3a')][_0x1854('0x2d')](_0x1b0126)['then'](function(_0x9c070d){_0x32ba8d[_0x1854('0x2d')]=_0x9c070d;if(_0xf8b9f5[_0x1854('0x3e')][_0x1854('0x4d')]){_0x515b36[_0x1854('0x4e')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x1854('0x4f')](_0x515b36);})['then'](function(_0x51f423){_0x32ba8d[_0x1854('0x50')]=_0x51f423;return _0x32ba8d;})[_0x1854('0x1f')](respondWithFilteredResult(_0x4c92ad,_0x515b36))[_0x1854('0x28')](handleError(_0x4c92ad,null));};exports[_0x1854('0x51')]=function(_0x48f638,_0x99989e){var _0x310512={'raw':![],'where':{'id':_0x48f638[_0x1854('0x52')]['id']}},_0x4e3ed9={};_0x4e3ed9[_0x1854('0x3d')]=_[_0x1854('0x3f')](db[_0x1854('0x3a')][_0x1854('0x53')]);_0x4e3ed9['query']=_[_0x1854('0x3f')](_0x48f638['query']);_0x4e3ed9['filters']=_[_0x1854('0x54')](_0x4e3ed9[_0x1854('0x3d')],_0x4e3ed9['query']);_0x310512[_0x1854('0x40')]=_[_0x1854('0x54')](_0x4e3ed9[_0x1854('0x3d')],qs['fields'](_0x48f638[_0x1854('0x3e')][_0x1854('0x41')]));_0x310512[_0x1854('0x40')]=_0x310512[_0x1854('0x40')][_0x1854('0x42')]?_0x310512['attributes']:_0x4e3ed9[_0x1854('0x3d')];if(_0x48f638['query'][_0x1854('0x4d')]){_0x310512['include']=[{'all':!![]}];}_0x310512=_['merge']({},_0x310512,_0x48f638[_0x1854('0x55')]);return db[_0x1854('0x3a')][_0x1854('0x56')](_0x310512)[_0x1854('0x1f')](handleEntityNotFound(_0x99989e,null))[_0x1854('0x1f')](respondWithResult(_0x99989e,null))['catch'](handleError(_0x99989e,null));};exports[_0x1854('0x57')]=function(_0x30ce73,_0x19148c){return db[_0x1854('0x3a')][_0x1854('0x57')](_0x30ce73[_0x1854('0x58')],{})['then'](respondWithResult(_0x19148c,0xc9))[_0x1854('0x28')](handleError(_0x19148c,null));};exports[_0x1854('0x34')]=function(_0x1a3e05,_0x41375f){if(_0x1a3e05['body']['id']){delete _0x1a3e05[_0x1854('0x58')]['id'];}return db['FreshsalesConfiguration'][_0x1854('0x56')]({'where':{'id':_0x1a3e05[_0x1854('0x52')]['id']}})[_0x1854('0x1f')](handleEntityNotFound(_0x41375f,null))[_0x1854('0x1f')](saveUpdates(_0x1a3e05['body'],null))['then'](respondWithResult(_0x41375f,null))['catch'](handleError(_0x41375f,null));};exports[_0x1854('0x35')]=function(_0x5705cf,_0x3644dc){return db[_0x1854('0x3a')][_0x1854('0x56')]({'where':{'id':_0x5705cf['params']['id']}})['then'](handleEntityNotFound(_0x3644dc,null))[_0x1854('0x1f')](removeEntity(_0x3644dc,null))['catch'](handleError(_0x3644dc,null));};exports[_0x1854('0x59')]=function(_0x5596b3,_0xaa7dd3,_0x7b2d97){var _0x22f767={};var _0x1b8782={};var _0x2c262d;var _0x5e1d9d;return db[_0x1854('0x3a')][_0x1854('0x5a')]({'where':{'id':_0x5596b3[_0x1854('0x52')]['id']}})[_0x1854('0x1f')](handleEntityNotFound(_0xaa7dd3,null))[_0x1854('0x1f')](function(_0x1f9ac6){if(_0x1f9ac6){_0x2c262d=_0x1f9ac6;_0x1b8782[_0x1854('0x3d')]=_[_0x1854('0x3f')](db['FreshsalesField']['rawAttributes']);_0x1b8782[_0x1854('0x3e')]=_[_0x1854('0x3f')](_0x5596b3[_0x1854('0x3e')]);_0x1b8782[_0x1854('0x48')]=_[_0x1854('0x54')](_0x1b8782[_0x1854('0x3d')],_0x1b8782['query']);_0x22f767[_0x1854('0x40')]=_[_0x1854('0x54')](_0x1b8782['model'],qs[_0x1854('0x41')](_0x5596b3[_0x1854('0x3e')][_0x1854('0x41')]));_0x22f767[_0x1854('0x40')]=_0x22f767['attributes']['length']?_0x22f767[_0x1854('0x40')]:_0x1b8782[_0x1854('0x3d')];_0x22f767['order']=qs['sort'](_0x5596b3[_0x1854('0x3e')]['sort']);_0x22f767[_0x1854('0x47')]=qs[_0x1854('0x48')](_[_0x1854('0x49')](_0x5596b3[_0x1854('0x3e')],_0x1b8782['filters']));if(_0x5596b3[_0x1854('0x3e')][_0x1854('0x4a')]){_0x22f767[_0x1854('0x47')]=_[_0x1854('0x4b')](_0x22f767[_0x1854('0x47')],{'$or':_[_0x1854('0x39')](_0x22f767['attributes'],function(_0x314e9f){var _0x4224c7={};_0x4224c7[_0x314e9f]={'$like':'%'+_0x5596b3[_0x1854('0x3e')][_0x1854('0x4a')]+'%'};return _0x4224c7;})});}_0x22f767=_[_0x1854('0x4b')]({},_0x22f767,_0x5596b3[_0x1854('0x55')]);return _0x2c262d[_0x1854('0x59')](_0x22f767);}})['then'](function(_0x4f7e81){if(_0x4f7e81){_0x5e1d9d=_0x4f7e81[_0x1854('0x42')];if(!_0x5596b3[_0x1854('0x3e')][_0x1854('0x43')]('nolimit')){_0x22f767['limit']=qs[_0x1854('0x2f')](_0x5596b3[_0x1854('0x3e')][_0x1854('0x2f')]);_0x22f767[_0x1854('0x2e')]=qs['offset'](_0x5596b3[_0x1854('0x3e')][_0x1854('0x2e')]);}return _0x2c262d['getSubjects'](_0x22f767);}})['then'](function(_0x2b4c0b){if(_0x2b4c0b){return _0x2b4c0b?{'count':_0x5e1d9d,'rows':_0x2b4c0b}:null;}})['then'](respondWithResult(_0xaa7dd3,null))[_0x1854('0x28')](handleError(_0xaa7dd3,null));};exports[_0x1854('0x5b')]=function(_0x3fe210,_0x42fdbf,_0x433d17){var _0x5380b2={};var _0x220809={};var _0x2cb6ca;var _0x39ad15;return db[_0x1854('0x3a')][_0x1854('0x5a')]({'where':{'id':_0x3fe210[_0x1854('0x52')]['id']}})['then'](handleEntityNotFound(_0x42fdbf,null))['then'](function(_0x36b6e1){if(_0x36b6e1){_0x2cb6ca=_0x36b6e1;_0x220809['model']=_[_0x1854('0x3f')](db[_0x1854('0x5c')][_0x1854('0x53')]);_0x220809[_0x1854('0x3e')]=_[_0x1854('0x3f')](_0x3fe210['query']);_0x220809[_0x1854('0x48')]=_[_0x1854('0x54')](_0x220809[_0x1854('0x3d')],_0x220809['query']);_0x5380b2[_0x1854('0x40')]=_[_0x1854('0x54')](_0x220809[_0x1854('0x3d')],qs['fields'](_0x3fe210['query']['fields']));_0x5380b2[_0x1854('0x40')]=_0x5380b2[_0x1854('0x40')]['length']?_0x5380b2[_0x1854('0x40')]:_0x220809[_0x1854('0x3d')];_0x5380b2[_0x1854('0x45')]=qs[_0x1854('0x46')](_0x3fe210[_0x1854('0x3e')][_0x1854('0x46')]);_0x5380b2['where']=qs[_0x1854('0x48')](_[_0x1854('0x49')](_0x3fe210[_0x1854('0x3e')],_0x220809[_0x1854('0x48')]));if(_0x3fe210[_0x1854('0x3e')][_0x1854('0x4a')]){_0x5380b2[_0x1854('0x47')]=_[_0x1854('0x4b')](_0x5380b2[_0x1854('0x47')],{'$or':_[_0x1854('0x39')](_0x5380b2[_0x1854('0x40')],function(_0xdccb3f){var _0x27aa0e={};_0x27aa0e[_0xdccb3f]={'$like':'%'+_0x3fe210[_0x1854('0x3e')][_0x1854('0x4a')]+'%'};return _0x27aa0e;})});}_0x5380b2=_[_0x1854('0x4b')]({},_0x5380b2,_0x3fe210[_0x1854('0x55')]);return _0x2cb6ca[_0x1854('0x5b')](_0x5380b2);}})[_0x1854('0x1f')](function(_0x183b28){if(_0x183b28){_0x39ad15=_0x183b28[_0x1854('0x42')];if(!_0x3fe210[_0x1854('0x3e')][_0x1854('0x43')]('nolimit')){_0x5380b2[_0x1854('0x2f')]=qs[_0x1854('0x2f')](_0x3fe210[_0x1854('0x3e')][_0x1854('0x2f')]);_0x5380b2[_0x1854('0x2e')]=qs[_0x1854('0x2e')](_0x3fe210[_0x1854('0x3e')][_0x1854('0x2e')]);}return _0x2cb6ca[_0x1854('0x5b')](_0x5380b2);}})[_0x1854('0x1f')](function(_0x5392c9){if(_0x5392c9){return _0x5392c9?{'count':_0x39ad15,'rows':_0x5392c9}:null;}})[_0x1854('0x1f')](respondWithResult(_0x42fdbf,null))[_0x1854('0x28')](handleError(_0x42fdbf,null));};exports[_0x1854('0x5d')]=function(_0x374388,_0x283a14,_0x4fc6b6){var _0x4cc48c={};var _0x50fd59={};var _0xdbe397;var _0x454f08;return db[_0x1854('0x3a')][_0x1854('0x5a')]({'where':{'id':_0x374388[_0x1854('0x52')]['id']}})[_0x1854('0x1f')](handleEntityNotFound(_0x283a14,null))['then'](function(_0xf59b53){if(_0xf59b53){_0xdbe397=_0xf59b53;_0x50fd59['model']=_[_0x1854('0x3f')](db['FreshsalesField'][_0x1854('0x53')]);_0x50fd59['query']=_['keys'](_0x374388[_0x1854('0x3e')]);_0x50fd59[_0x1854('0x48')]=_[_0x1854('0x54')](_0x50fd59[_0x1854('0x3d')],_0x50fd59['query']);_0x4cc48c[_0x1854('0x40')]=_[_0x1854('0x54')](_0x50fd59['model'],qs[_0x1854('0x41')](_0x374388['query'][_0x1854('0x41')]));_0x4cc48c[_0x1854('0x40')]=_0x4cc48c[_0x1854('0x40')][_0x1854('0x42')]?_0x4cc48c[_0x1854('0x40')]:_0x50fd59[_0x1854('0x3d')];_0x4cc48c['order']=qs['sort'](_0x374388['query'][_0x1854('0x46')]);_0x4cc48c[_0x1854('0x47')]=qs[_0x1854('0x48')](_[_0x1854('0x49')](_0x374388['query'],_0x50fd59[_0x1854('0x48')]));if(_0x374388[_0x1854('0x3e')]['filter']){_0x4cc48c[_0x1854('0x47')]=_[_0x1854('0x4b')](_0x4cc48c['where'],{'$or':_[_0x1854('0x39')](_0x4cc48c['attributes'],function(_0x2cbdc8){var _0x2c2eb2={};_0x2c2eb2[_0x2cbdc8]={'$like':'%'+_0x374388['query'][_0x1854('0x4a')]+'%'};return _0x2c2eb2;})});}_0x4cc48c=_[_0x1854('0x4b')]({},_0x4cc48c,_0x374388[_0x1854('0x55')]);return _0xdbe397['getFields'](_0x4cc48c);}})[_0x1854('0x1f')](function(_0x5b31f6){if(_0x5b31f6){_0x454f08=_0x5b31f6[_0x1854('0x42')];if(!_0x374388[_0x1854('0x3e')][_0x1854('0x43')](_0x1854('0x44'))){_0x4cc48c['limit']=qs[_0x1854('0x2f')](_0x374388[_0x1854('0x3e')]['limit']);_0x4cc48c['offset']=qs[_0x1854('0x2e')](_0x374388[_0x1854('0x3e')][_0x1854('0x2e')]);}return _0xdbe397[_0x1854('0x5d')](_0x4cc48c);}})[_0x1854('0x1f')](function(_0x4bf7ec){if(_0x4bf7ec){return _0x4bf7ec?{'count':_0x454f08,'rows':_0x4bf7ec}:null;}})['then'](respondWithResult(_0x283a14,null))[_0x1854('0x28')](handleError(_0x283a14,null));};
\ No newline at end of file
index 223f3a1..36c3233 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb79=['./intFreshsalesConfiguration.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3550b4,_0x59b309){var _0x237bca=function(_0x9624f9){while(--_0x9624f9){_0x3550b4['push'](_0x3550b4['shift']());}};_0x237bca(++_0x59b309);}(_0xcb79,0xc3));var _0x9cb7=function(_0x52d18d,_0x2bdf0d){_0x52d18d=_0x52d18d-0x0;var _0x3fada0=_0xcb79[_0x52d18d];return _0x3fada0;};'use strict';var _=require(_0x9cb7('0x0'));var util=require(_0x9cb7('0x1'));var logger=require(_0x9cb7('0x2'))(_0x9cb7('0x3'));var moment=require('moment');var BPromise=require(_0x9cb7('0x4'));var rp=require(_0x9cb7('0x5'));var fs=require('fs');var path=require(_0x9cb7('0x6'));var rimraf=require(_0x9cb7('0x7'));var config=require(_0x9cb7('0x8'));var attributes=require(_0x9cb7('0x9'));module[_0x9cb7('0xa')]=function(_0x1ba557,_0x535cd5){return _0x1ba557[_0x9cb7('0xb')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6499=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','FreshsalesConfiguration'];(function(_0x2eb253,_0x23c4c6){var _0x2aec19=function(_0x3a1b8e){while(--_0x3a1b8e){_0x2eb253['push'](_0x2eb253['shift']());}};_0x2aec19(++_0x23c4c6);}(_0x6499,0xe6));var _0x9649=function(_0x398c20,_0x32debb){_0x398c20=_0x398c20-0x0;var _0x1bb27a=_0x6499[_0x398c20];return _0x1bb27a;};'use strict';var _=require('lodash');var util=require(_0x9649('0x0'));var logger=require(_0x9649('0x1'))(_0x9649('0x2'));var moment=require(_0x9649('0x3'));var BPromise=require(_0x9649('0x4'));var rp=require(_0x9649('0x5'));var fs=require('fs');var path=require(_0x9649('0x6'));var rimraf=require('rimraf');var config=require(_0x9649('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x9649('0x8')]=function(_0x2719e2,_0x53fea9){return _0x2719e2['define'](_0x9649('0x9'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 842bcf9..1e97770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3f0a10,_0x244777){var _0x22475f=function(_0x43a69e){while(--_0x43a69e){_0x3f0a10['push'](_0x3f0a10['shift']());}};_0x22475f(++_0x244777);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0xcb91[_0x3474ac];return _0x5345ec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
+var _0xda3f=['rpc','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xda3f,0xec));var _0xfda3=function(_0x501a54,_0x1adb6d){_0x501a54=_0x501a54-0x0;var _0xb652dd=_0xda3f[_0x501a54];return _0xb652dd;};'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')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}
\ No newline at end of file
index 2db286a..7005c79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbebb=['index','get','/:id','isAuthenticated','create','put','exports','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesField.controller'];(function(_0x1bb45d,_0xc82252){var _0x7d8175=function(_0x45f2e9){while(--_0x45f2e9){_0x1bb45d['push'](_0x1bb45d['shift']());}};_0x7d8175(++_0xc82252);}(_0xbebb,0x1c1));var _0xbbeb=function(_0x4e7dbb,_0x133c73){_0x4e7dbb=_0x4e7dbb-0x0;var _0x244887=_0xbebb[_0x4e7dbb];return _0x244887;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xbbeb('0x0'));var express=require(_0xbbeb('0x1'));var router=express[_0xbbeb('0x2')]();var auth=require(_0xbbeb('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbbeb('0x4'));var controller=require(_0xbbeb('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xbbeb('0x6')]);router[_0xbbeb('0x7')](_0xbbeb('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xbbeb('0x9')](),controller[_0xbbeb('0xa')]);router[_0xbbeb('0xb')]('/:id',auth[_0xbbeb('0x9')](),controller['update']);router['delete'](_0xbbeb('0x8'),auth[_0xbbeb('0x9')](),controller['destroy']);module[_0xbbeb('0xc')]=router;
\ No newline at end of file
+var _0x1160=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x550d83,_0xa3aea4){var _0x5b5710=function(_0x166ca0){while(--_0x166ca0){_0x550d83['push'](_0x550d83['shift']());}};_0x5b5710(++_0xa3aea4);}(_0x1160,0x116));var _0x0116=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0x1160[_0x438fe1];return _0x3c8e1b;};'use strict';var multer=require(_0x0116('0x0'));var util=require(_0x0116('0x1'));var path=require('path');var timeout=require(_0x0116('0x2'));var express=require(_0x0116('0x3'));var router=express[_0x0116('0x4')]();var auth=require(_0x0116('0x5'));var interaction=require(_0x0116('0x6'));var config=require(_0x0116('0x7'));var controller=require(_0x0116('0x8'));router[_0x0116('0x9')]('/',auth[_0x0116('0xa')](),controller['index']);router[_0x0116('0x9')]('/:id',auth[_0x0116('0xa')](),controller[_0x0116('0xb')]);router[_0x0116('0xc')]('/',auth['isAuthenticated'](),controller[_0x0116('0xd')]);router[_0x0116('0xe')]('/:id',auth[_0x0116('0xa')](),controller[_0x0116('0xf')]);router[_0x0116('0x10')](_0x0116('0x11'),auth[_0x0116('0xa')](),controller[_0x0116('0x12')]);module[_0x0116('0x13')]=router;
\ No newline at end of file
index dbf78fe..640eede 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb37d=['ENUM','string','customVariable','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb37d,0xbe));var _0xdb37=function(_0x32a04c,_0x48de59){_0x32a04c=_0x32a04c-0x0;var _0x1535ce=_0xb37d[_0x32a04c];return _0x1535ce;};'use strict';var Sequelize=require(_0xdb37('0x0'));module[_0xdb37('0x1')]={'type':{'type':Sequelize[_0xdb37('0x2')](_0xdb37('0x3'),'variable',_0xdb37('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xdb37('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdb37('0x2')](_0xdb37('0x3'),_0xdb37('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xdb37('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdb37('0x5')]},'customField':{'type':Sequelize[_0xdb37('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdb37('0x5')]}};
\ No newline at end of file
+var _0x0140=['exports','ENUM','string','customVariable','STRING','variable','sequelize'];(function(_0x56fbaa,_0x3bc5a6){var _0x49fbc1=function(_0x19b08b){while(--_0x19b08b){_0x56fbaa['push'](_0x56fbaa['shift']());}};_0x49fbc1(++_0x3bc5a6);}(_0x0140,0x148));var _0x0014=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0x0140[_0x4164f2];return _0x2575c7;};'use strict';var Sequelize=require(_0x0014('0x0'));module[_0x0014('0x1')]={'type':{'type':Sequelize[_0x0014('0x2')](_0x0014('0x3'),'variable',_0x0014('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x0014('0x5')]},'key':{'type':Sequelize[_0x0014('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x0014('0x3'),_0x0014('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x0014('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0014('0x5')]}};
\ No newline at end of file
index f4a76be..f4271b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c55=['crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','error','index','FreshsalesField','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','squel'];(function(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0x8c55,0xd2));var _0x58c5=function(_0x27e8de,_0x47253c){_0x27e8de=_0x27e8de-0x0;var _0x5f0a3c=_0x8c55[_0x27e8de];return _0x5f0a3c;};'use strict';var pdf=require(_0x58c5('0x0'));var emlformat=require(_0x58c5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x58c5('0x2'));var jsonpatch=require(_0x58c5('0x3'));var rp=require(_0x58c5('0x4'));var moment=require(_0x58c5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x58c5('0x6'));var util=require('util');var path=require(_0x58c5('0x7'));var sox=require(_0x58c5('0x8'));var csv=require(_0x58c5('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x58c5('0xa'));var squel=require(_0x58c5('0xb'));var crypto=require(_0x58c5('0xc'));var jsforce=require(_0x58c5('0xd'));var deskjs=require(_0x58c5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x58c5('0xf'));var Papa=require(_0x58c5('0x10'));var Redis=require('ioredis');var authService=require(_0x58c5('0x11'));var qs=require(_0x58c5('0x12'));var as=require(_0x58c5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x58c5('0x14'))(_0x58c5('0x15'));var utils=require(_0x58c5('0x16'));var config=require(_0x58c5('0x17'));var db=require(_0x58c5('0x18'))['db'];function respondWithStatusCode(_0x3fa05c,_0x5afa33){_0x5afa33=_0x5afa33||0xcc;return function(_0x581c3b){if(_0x581c3b){return _0x3fa05c[_0x58c5('0x19')](_0x5afa33);}return _0x3fa05c['status'](_0x5afa33)[_0x58c5('0x1a')]();};}function respondWithResult(_0x3fb4fe,_0x22c685){_0x22c685=_0x22c685||0xc8;return function(_0x1c17b2){if(_0x1c17b2){return _0x3fb4fe[_0x58c5('0x1b')](_0x22c685)['json'](_0x1c17b2);}};}function respondWithFilteredResult(_0xf2e6af,_0x1d47de){return function(_0x397f4c){if(_0x397f4c){var _0xf85a1=_0x397f4c[_0x58c5('0x1c')],_0x499bd8=_0x1d47de[_0x58c5('0x1d')],_0x1f19ec=_0x1d47de[_0x58c5('0x1d')]+_0x1d47de[_0x58c5('0x1e')],_0x12381b;if(_0x1f19ec>=_0xf85a1){_0x1f19ec=_0xf85a1;_0x12381b=0xc8;}else{_0x12381b=0xce;}_0xf2e6af[_0x58c5('0x1b')](_0x12381b);return _0xf2e6af[_0x58c5('0x1f')](_0x58c5('0x20'),_0x499bd8+'-'+_0x1f19ec+'/'+_0xf85a1)[_0x58c5('0x21')](_0x397f4c);}return null;};}function patchUpdates(_0x11265d){return function(_0x3345a4){try{jsonpatch[_0x58c5('0x22')](_0x3345a4,_0x11265d,!![]);}catch(_0x3aff58){return BPromise['reject'](_0x3aff58);}return _0x3345a4[_0x58c5('0x23')]();};}function saveUpdates(_0xbab5c4,_0x4c12f5){return function(_0x3c4d6a){if(_0x3c4d6a){return _0x3c4d6a[_0x58c5('0x24')](_0xbab5c4)[_0x58c5('0x25')](function(_0x17545e){return _0x17545e;});}return null;};}function removeEntity(_0x3e1789,_0xd9afa7){return function(_0x3aabe7){if(_0x3aabe7){return _0x3aabe7[_0x58c5('0x26')]()[_0x58c5('0x25')](function(){_0x3e1789[_0x58c5('0x1b')](0xcc)[_0x58c5('0x1a')]();});}};}function handleEntityNotFound(_0x10612c,_0x28aac0){return function(_0x3b6cd4){if(!_0x3b6cd4){_0x10612c[_0x58c5('0x19')](0x194);}return _0x3b6cd4;};}function handleError(_0x59a1ff,_0x4c29be){_0x4c29be=_0x4c29be||0x1f4;return function(_0x5a1767){logger[_0x58c5('0x27')](_0x5a1767['stack']);if(_0x5a1767['name']){delete _0x5a1767['name'];}_0x59a1ff[_0x58c5('0x1b')](_0x4c29be)['send'](_0x5a1767);};}exports[_0x58c5('0x28')]=function(_0x366d9c,_0x63bd79){var _0x9fa2bc={},_0x53102f={},_0x1ccf7b={'count':0x0,'rows':[]};var _0x320517=_['map'](db[_0x58c5('0x29')][_0x58c5('0x2a')],function(_0x3657fc){return{'name':_0x3657fc[_0x58c5('0x2b')],'type':_0x3657fc[_0x58c5('0x2c')][_0x58c5('0x2d')]};});_0x53102f[_0x58c5('0x2e')]=_[_0x58c5('0x2f')](_0x320517,_0x58c5('0x30'));_0x53102f['query']=_['keys'](_0x366d9c[_0x58c5('0x31')]);_0x53102f[_0x58c5('0x32')]=_[_0x58c5('0x33')](_0x53102f[_0x58c5('0x2e')],_0x53102f['query']);_0x9fa2bc[_0x58c5('0x34')]=_['intersection'](_0x53102f[_0x58c5('0x2e')],qs['fields'](_0x366d9c['query'][_0x58c5('0x35')]));_0x9fa2bc['attributes']=_0x9fa2bc[_0x58c5('0x34')][_0x58c5('0x36')]?_0x9fa2bc['attributes']:_0x53102f[_0x58c5('0x2e')];if(!_0x366d9c[_0x58c5('0x31')][_0x58c5('0x37')](_0x58c5('0x38'))){_0x9fa2bc[_0x58c5('0x1e')]=qs[_0x58c5('0x1e')](_0x366d9c[_0x58c5('0x31')]['limit']);_0x9fa2bc[_0x58c5('0x1d')]=qs['offset'](_0x366d9c[_0x58c5('0x31')][_0x58c5('0x1d')]);}_0x9fa2bc[_0x58c5('0x39')]=qs[_0x58c5('0x3a')](_0x366d9c[_0x58c5('0x31')][_0x58c5('0x3a')]);_0x9fa2bc['where']=qs[_0x58c5('0x32')](_[_0x58c5('0x3b')](_0x366d9c[_0x58c5('0x31')],_0x53102f[_0x58c5('0x32')]),_0x320517);if(_0x366d9c[_0x58c5('0x31')]['filter']){_0x9fa2bc[_0x58c5('0x3c')]=_[_0x58c5('0x3d')](_0x9fa2bc[_0x58c5('0x3c')],{'$or':_[_0x58c5('0x2f')](_0x320517,function(_0x338cb8){if(_0x338cb8[_0x58c5('0x2c')]!==_0x58c5('0x3e')){var _0x48c821={};_0x48c821[_0x338cb8[_0x58c5('0x30')]]={'$like':'%'+_0x366d9c[_0x58c5('0x31')]['filter']+'%'};return _0x48c821;}})});}_0x9fa2bc=_['merge']({},_0x9fa2bc,_0x366d9c[_0x58c5('0x3f')]);var _0x10e40c={'where':_0x9fa2bc[_0x58c5('0x3c')]};return db['FreshsalesField'][_0x58c5('0x1c')](_0x10e40c)[_0x58c5('0x25')](function(_0x56f6ea){_0x1ccf7b[_0x58c5('0x1c')]=_0x56f6ea;if(_0x366d9c['query'][_0x58c5('0x40')]){_0x9fa2bc[_0x58c5('0x41')]=[{'all':!![]}];}return db[_0x58c5('0x29')][_0x58c5('0x42')](_0x9fa2bc);})[_0x58c5('0x25')](function(_0x535239){_0x1ccf7b[_0x58c5('0x43')]=_0x535239;return _0x1ccf7b;})[_0x58c5('0x25')](respondWithFilteredResult(_0x63bd79,_0x9fa2bc))[_0x58c5('0x44')](handleError(_0x63bd79,null));};exports['show']=function(_0x2d8a2f,_0x4d1721){var _0x444d29={'raw':!![],'where':{'id':_0x2d8a2f[_0x58c5('0x45')]['id']}},_0x4e83ee={};_0x4e83ee[_0x58c5('0x2e')]=_[_0x58c5('0x46')](db[_0x58c5('0x29')][_0x58c5('0x2a')]);_0x4e83ee[_0x58c5('0x31')]=_[_0x58c5('0x46')](_0x2d8a2f[_0x58c5('0x31')]);_0x4e83ee['filters']=_['intersection'](_0x4e83ee[_0x58c5('0x2e')],_0x4e83ee['query']);_0x444d29[_0x58c5('0x34')]=_[_0x58c5('0x33')](_0x4e83ee[_0x58c5('0x2e')],qs[_0x58c5('0x35')](_0x2d8a2f[_0x58c5('0x31')][_0x58c5('0x35')]));_0x444d29[_0x58c5('0x34')]=_0x444d29[_0x58c5('0x34')][_0x58c5('0x36')]?_0x444d29['attributes']:_0x4e83ee[_0x58c5('0x2e')];if(_0x2d8a2f[_0x58c5('0x31')][_0x58c5('0x40')]){_0x444d29[_0x58c5('0x41')]=[{'all':!![]}];}_0x444d29=_[_0x58c5('0x3d')]({},_0x444d29,_0x2d8a2f[_0x58c5('0x3f')]);return db[_0x58c5('0x29')]['find'](_0x444d29)['then'](handleEntityNotFound(_0x4d1721,null))[_0x58c5('0x25')](respondWithResult(_0x4d1721,null))['catch'](handleError(_0x4d1721,null));};exports[_0x58c5('0x47')]=function(_0x299a5e,_0x1c5404){return db[_0x58c5('0x29')]['create'](_0x299a5e[_0x58c5('0x48')],{})[_0x58c5('0x25')](respondWithResult(_0x1c5404,0xc9))[_0x58c5('0x44')](handleError(_0x1c5404,null));};exports[_0x58c5('0x24')]=function(_0x348df8,_0x2b50e3){if(_0x348df8[_0x58c5('0x48')]['id']){delete _0x348df8[_0x58c5('0x48')]['id'];}return db[_0x58c5('0x29')][_0x58c5('0x49')]({'where':{'id':_0x348df8[_0x58c5('0x45')]['id']}})[_0x58c5('0x25')](handleEntityNotFound(_0x2b50e3,null))[_0x58c5('0x25')](saveUpdates(_0x348df8[_0x58c5('0x48')],null))[_0x58c5('0x25')](respondWithResult(_0x2b50e3,null))[_0x58c5('0x44')](handleError(_0x2b50e3,null));};exports[_0x58c5('0x26')]=function(_0x49bc77,_0x3f7f4c){return db[_0x58c5('0x29')][_0x58c5('0x49')]({'where':{'id':_0x49bc77[_0x58c5('0x45')]['id']}})['then'](handleEntityNotFound(_0x3f7f4c,null))['then'](removeEntity(_0x3f7f4c,null))[_0x58c5('0x44')](handleError(_0x3f7f4c,null));};
\ No newline at end of file
+var _0x6b76=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','update','destroy','then','stack','name','send','index','FreshsalesField','rawAttributes','type','model','query'];(function(_0x21fcd0,_0xd6015f){var _0x475573=function(_0x5ae8b4){while(--_0x5ae8b4){_0x21fcd0['push'](_0x21fcd0['shift']());}};_0x475573(++_0xd6015f);}(_0x6b76,0x13f));var _0x66b7=function(_0x49aa9b,_0x2e3bcb){_0x49aa9b=_0x49aa9b-0x0;var _0x48cdf7=_0x6b76[_0x49aa9b];return _0x48cdf7;};'use strict';var pdf=require(_0x66b7('0x0'));var emlformat=require(_0x66b7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x66b7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x66b7('0x3'));var BPromise=require(_0x66b7('0x4'));var Mustache=require(_0x66b7('0x5'));var util=require(_0x66b7('0x6'));var path=require(_0x66b7('0x7'));var sox=require(_0x66b7('0x8'));var csv=require(_0x66b7('0x9'));var ejs=require(_0x66b7('0xa'));var fs=require('fs');var _=require(_0x66b7('0xb'));var squel=require(_0x66b7('0xc'));var crypto=require(_0x66b7('0xd'));var jsforce=require(_0x66b7('0xe'));var deskjs=require(_0x66b7('0xf'));var toCsv=require(_0x66b7('0x9'));var querystring=require(_0x66b7('0x10'));var Papa=require('papaparse');var Redis=require(_0x66b7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x66b7('0x12'));var as=require(_0x66b7('0x13'));var hardwareService=require(_0x66b7('0x14'));var logger=require(_0x66b7('0x15'))(_0x66b7('0x16'));var utils=require(_0x66b7('0x17'));var config=require(_0x66b7('0x18'));var db=require(_0x66b7('0x19'))['db'];function respondWithStatusCode(_0x4a3b24,_0x4c262a){_0x4c262a=_0x4c262a||0xcc;return function(_0x402432){if(_0x402432){return _0x4a3b24[_0x66b7('0x1a')](_0x4c262a);}return _0x4a3b24[_0x66b7('0x1b')](_0x4c262a)[_0x66b7('0x1c')]();};}function respondWithResult(_0x32226e,_0x8e0f50){_0x8e0f50=_0x8e0f50||0xc8;return function(_0x50af29){if(_0x50af29){return _0x32226e[_0x66b7('0x1b')](_0x8e0f50)[_0x66b7('0x1d')](_0x50af29);}};}function respondWithFilteredResult(_0x3465e0,_0x26ed0d){return function(_0x3fbf76){if(_0x3fbf76){var _0x44696c=_0x3fbf76[_0x66b7('0x1e')],_0x5afcc3=_0x26ed0d[_0x66b7('0x1f')],_0x29115=_0x26ed0d[_0x66b7('0x1f')]+_0x26ed0d[_0x66b7('0x20')],_0x2dc424;if(_0x29115>=_0x44696c){_0x29115=_0x44696c;_0x2dc424=0xc8;}else{_0x2dc424=0xce;}_0x3465e0['status'](_0x2dc424);return _0x3465e0[_0x66b7('0x21')]('Content-Range',_0x5afcc3+'-'+_0x29115+'/'+_0x44696c)['json'](_0x3fbf76);}return null;};}function patchUpdates(_0x224c16){return function(_0x57a0d5){try{jsonpatch['apply'](_0x57a0d5,_0x224c16,!![]);}catch(_0x1e5c62){return BPromise['reject'](_0x1e5c62);}return _0x57a0d5['save']();};}function saveUpdates(_0x49bc9c,_0x29919a){return function(_0x399ffe){if(_0x399ffe){return _0x399ffe[_0x66b7('0x22')](_0x49bc9c)['then'](function(_0x4c5e86){return _0x4c5e86;});}return null;};}function removeEntity(_0x4057c0,_0x217368){return function(_0x80d491){if(_0x80d491){return _0x80d491[_0x66b7('0x23')]()[_0x66b7('0x24')](function(){_0x4057c0[_0x66b7('0x1b')](0xcc)[_0x66b7('0x1c')]();});}};}function handleEntityNotFound(_0x5195ee,_0x1c9984){return function(_0x5a0c7b){if(!_0x5a0c7b){_0x5195ee[_0x66b7('0x1a')](0x194);}return _0x5a0c7b;};}function handleError(_0x1f5765,_0x2b4bec){_0x2b4bec=_0x2b4bec||0x1f4;return function(_0x16f018){logger['error'](_0x16f018[_0x66b7('0x25')]);if(_0x16f018['name']){delete _0x16f018[_0x66b7('0x26')];}_0x1f5765[_0x66b7('0x1b')](_0x2b4bec)[_0x66b7('0x27')](_0x16f018);};}exports[_0x66b7('0x28')]=function(_0x1f474f,_0x518f0e){var _0x1afb09={},_0x57f50c={},_0x2c7ad2={'count':0x0,'rows':[]};var _0x55f709=_['map'](db[_0x66b7('0x29')][_0x66b7('0x2a')],function(_0x305619){return{'name':_0x305619['fieldName'],'type':_0x305619[_0x66b7('0x2b')]['key']};});_0x57f50c[_0x66b7('0x2c')]=_['map'](_0x55f709,_0x66b7('0x26'));_0x57f50c[_0x66b7('0x2d')]=_[_0x66b7('0x2e')](_0x1f474f[_0x66b7('0x2d')]);_0x57f50c[_0x66b7('0x2f')]=_[_0x66b7('0x30')](_0x57f50c[_0x66b7('0x2c')],_0x57f50c[_0x66b7('0x2d')]);_0x1afb09[_0x66b7('0x31')]=_[_0x66b7('0x30')](_0x57f50c[_0x66b7('0x2c')],qs['fields'](_0x1f474f[_0x66b7('0x2d')][_0x66b7('0x32')]));_0x1afb09[_0x66b7('0x31')]=_0x1afb09['attributes'][_0x66b7('0x33')]?_0x1afb09['attributes']:_0x57f50c[_0x66b7('0x2c')];if(!_0x1f474f[_0x66b7('0x2d')][_0x66b7('0x34')](_0x66b7('0x35'))){_0x1afb09[_0x66b7('0x20')]=qs['limit'](_0x1f474f[_0x66b7('0x2d')]['limit']);_0x1afb09[_0x66b7('0x1f')]=qs[_0x66b7('0x1f')](_0x1f474f[_0x66b7('0x2d')][_0x66b7('0x1f')]);}_0x1afb09[_0x66b7('0x36')]=qs[_0x66b7('0x37')](_0x1f474f[_0x66b7('0x2d')][_0x66b7('0x37')]);_0x1afb09[_0x66b7('0x38')]=qs[_0x66b7('0x2f')](_[_0x66b7('0x39')](_0x1f474f['query'],_0x57f50c['filters']),_0x55f709);if(_0x1f474f['query'][_0x66b7('0x3a')]){_0x1afb09['where']=_[_0x66b7('0x3b')](_0x1afb09[_0x66b7('0x38')],{'$or':_[_0x66b7('0x3c')](_0x55f709,function(_0x337ad6){if(_0x337ad6[_0x66b7('0x2b')]!==_0x66b7('0x3d')){var _0x1f5c70={};_0x1f5c70[_0x337ad6[_0x66b7('0x26')]]={'$like':'%'+_0x1f474f[_0x66b7('0x2d')][_0x66b7('0x3a')]+'%'};return _0x1f5c70;}})});}_0x1afb09=_[_0x66b7('0x3b')]({},_0x1afb09,_0x1f474f[_0x66b7('0x3e')]);var _0x11c9b9={'where':_0x1afb09[_0x66b7('0x38')]};return db[_0x66b7('0x29')][_0x66b7('0x1e')](_0x11c9b9)[_0x66b7('0x24')](function(_0x10ad93){_0x2c7ad2[_0x66b7('0x1e')]=_0x10ad93;if(_0x1f474f[_0x66b7('0x2d')][_0x66b7('0x3f')]){_0x1afb09[_0x66b7('0x40')]=[{'all':!![]}];}return db['FreshsalesField'][_0x66b7('0x41')](_0x1afb09);})[_0x66b7('0x24')](function(_0xec4252){_0x2c7ad2[_0x66b7('0x42')]=_0xec4252;return _0x2c7ad2;})[_0x66b7('0x24')](respondWithFilteredResult(_0x518f0e,_0x1afb09))[_0x66b7('0x43')](handleError(_0x518f0e,null));};exports[_0x66b7('0x44')]=function(_0x1066eb,_0xe80625){var _0x340c02={'raw':!![],'where':{'id':_0x1066eb['params']['id']}},_0x2b6197={};_0x2b6197['model']=_[_0x66b7('0x2e')](db[_0x66b7('0x29')][_0x66b7('0x2a')]);_0x2b6197[_0x66b7('0x2d')]=_[_0x66b7('0x2e')](_0x1066eb[_0x66b7('0x2d')]);_0x2b6197[_0x66b7('0x2f')]=_['intersection'](_0x2b6197[_0x66b7('0x2c')],_0x2b6197[_0x66b7('0x2d')]);_0x340c02[_0x66b7('0x31')]=_[_0x66b7('0x30')](_0x2b6197[_0x66b7('0x2c')],qs[_0x66b7('0x32')](_0x1066eb[_0x66b7('0x2d')][_0x66b7('0x32')]));_0x340c02['attributes']=_0x340c02['attributes']['length']?_0x340c02[_0x66b7('0x31')]:_0x2b6197[_0x66b7('0x2c')];if(_0x1066eb[_0x66b7('0x2d')][_0x66b7('0x3f')]){_0x340c02['include']=[{'all':!![]}];}_0x340c02=_[_0x66b7('0x3b')]({},_0x340c02,_0x1066eb[_0x66b7('0x3e')]);return db[_0x66b7('0x29')][_0x66b7('0x45')](_0x340c02)['then'](handleEntityNotFound(_0xe80625,null))[_0x66b7('0x24')](respondWithResult(_0xe80625,null))[_0x66b7('0x43')](handleError(_0xe80625,null));};exports[_0x66b7('0x46')]=function(_0x3e65be,_0x3f645f){return db[_0x66b7('0x29')][_0x66b7('0x46')](_0x3e65be[_0x66b7('0x47')],{})[_0x66b7('0x24')](respondWithResult(_0x3f645f,0xc9))[_0x66b7('0x43')](handleError(_0x3f645f,null));};exports[_0x66b7('0x22')]=function(_0x3faa15,_0x401c30){if(_0x3faa15[_0x66b7('0x47')]['id']){delete _0x3faa15[_0x66b7('0x47')]['id'];}return db[_0x66b7('0x29')][_0x66b7('0x45')]({'where':{'id':_0x3faa15['params']['id']}})[_0x66b7('0x24')](handleEntityNotFound(_0x401c30,null))[_0x66b7('0x24')](saveUpdates(_0x3faa15[_0x66b7('0x47')],null))['then'](respondWithResult(_0x401c30,null))[_0x66b7('0x43')](handleError(_0x401c30,null));};exports[_0x66b7('0x23')]=function(_0x46605e,_0x1021ed){return db[_0x66b7('0x29')]['find']({'where':{'id':_0x46605e[_0x66b7('0x48')]['id']}})[_0x66b7('0x24')](handleEntityNotFound(_0x1021ed,null))[_0x66b7('0x24')](removeEntity(_0x1021ed,null))[_0x66b7('0x43')](handleError(_0x1021ed,null));};
\ No newline at end of file
index e40c787..50c4033 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b55=['./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x406177,_0xaf1eee){var _0x131090=function(_0x399df3){while(--_0x399df3){_0x406177['push'](_0x406177['shift']());}};_0x131090(++_0xaf1eee);}(_0x4b55,0xd7));var _0x54b5=function(_0x5abc65,_0x5e3bb4){_0x5abc65=_0x5abc65-0x0;var _0x7f5647=_0x4b55[_0x5abc65];return _0x7f5647;};'use strict';var _=require(_0x54b5('0x0'));var util=require(_0x54b5('0x1'));var logger=require(_0x54b5('0x2'))('api');var moment=require(_0x54b5('0x3'));var BPromise=require(_0x54b5('0x4'));var rp=require(_0x54b5('0x5'));var fs=require('fs');var path=require(_0x54b5('0x6'));var rimraf=require(_0x54b5('0x7'));var config=require(_0x54b5('0x8'));var attributes=require(_0x54b5('0x9'));module[_0x54b5('0xa')]=function(_0x28ad6b,_0x19461e){return _0x28ad6b[_0x54b5('0xb')](_0x54b5('0xc'),attributes,{'tableName':_0x54b5('0xd'),'paranoid':![],'indexes':[{'name':_0x54b5('0xe'),'fields':[_0x54b5('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d97=['bluebird','request-promise','path','../../config/environment','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','../../config/logger','moment'];(function(_0x1060ea,_0x4c7322){var _0x49ec59=function(_0x5a8716){while(--_0x5a8716){_0x1060ea['push'](_0x1060ea['shift']());}};_0x49ec59(++_0x4c7322);}(_0x1d97,0x110));var _0x71d9=function(_0x2b0441,_0x5b7e96){_0x2b0441=_0x2b0441-0x0;var _0x1222ba=_0x1d97[_0x2b0441];return _0x1222ba;};'use strict';var _=require(_0x71d9('0x0'));var util=require(_0x71d9('0x1'));var logger=require(_0x71d9('0x2'))('api');var moment=require(_0x71d9('0x3'));var BPromise=require(_0x71d9('0x4'));var rp=require(_0x71d9('0x5'));var fs=require('fs');var path=require(_0x71d9('0x6'));var rimraf=require('rimraf');var config=require(_0x71d9('0x7'));var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x472e27,_0x3b273f){return _0x472e27['define'](_0x71d9('0x8'),attributes,{'tableName':_0x71d9('0x9'),'paranoid':![],'indexes':[{'name':_0x71d9('0xa'),'fields':[_0x71d9('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index fcdca77..9f456b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53c6=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x322885,_0x720de8){var _0xbcb825=function(_0x3bb2fc){while(--_0x3bb2fc){_0x322885['push'](_0x322885['shift']());}};_0xbcb825(++_0x720de8);}(_0x53c6,0x198));var _0x653c=function(_0x5fe4f7,_0x4f2c6e){_0x5fe4f7=_0x5fe4f7-0x0;var _0x4871cf=_0x53c6[_0x5fe4f7];return _0x4871cf;};'use strict';var _=require(_0x653c('0x0'));var util=require(_0x653c('0x1'));var moment=require(_0x653c('0x2'));var BPromise=require(_0x653c('0x3'));var rs=require(_0x653c('0x4'));var fs=require('fs');var Redis=require(_0x653c('0x5'));var db=require(_0x653c('0x6'))['db'];var utils=require(_0x653c('0x7'));var logger=require(_0x653c('0x8'))(_0x653c('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x653c('0xa')][_0x653c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x205c91,_0xe6cee1,_0x2d418e){return new BPromise(function(_0xad9f6e,_0x6175c8){return client[_0x653c('0xc')](_0x205c91,_0x2d418e)[_0x653c('0xd')](function(_0x1a40cc){logger['info']('FreshsalesField,\x20%s,\x20%s',_0xe6cee1,_0x653c('0xe'));logger['debug'](_0x653c('0xf'),_0xe6cee1,_0x653c('0xe'),JSON[_0x653c('0x10')](_0x1a40cc));if(_0x1a40cc[_0x653c('0x11')]){if(_0x1a40cc[_0x653c('0x11')][_0x653c('0x12')]===0x1f4){logger[_0x653c('0x11')](_0x653c('0x13'),_0xe6cee1,_0x1a40cc[_0x653c('0x11')][_0x653c('0x14')]);return _0x6175c8(_0x1a40cc[_0x653c('0x11')][_0x653c('0x14')]);}logger[_0x653c('0x11')](_0x653c('0x13'),_0xe6cee1,_0x1a40cc[_0x653c('0x11')][_0x653c('0x14')]);return _0xad9f6e(_0x1a40cc[_0x653c('0x11')][_0x653c('0x14')]);}else{logger['info'](_0x653c('0x13'),_0xe6cee1,_0x653c('0xe'));_0xad9f6e(_0x1a40cc[_0x653c('0x15')][_0x653c('0x14')]);}})[_0x653c('0x16')](function(_0x5df120){logger[_0x653c('0x11')]('FreshsalesField,\x20%s,\x20%s',_0xe6cee1,_0x5df120);_0x6175c8(_0x5df120);});});}
\ No newline at end of file
+var _0x29e2=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3f697e,_0xd15bf7){var _0x3deb76=function(_0x4b16ac){while(--_0x4b16ac){_0x3f697e['push'](_0x3f697e['shift']());}};_0x3deb76(++_0xd15bf7);}(_0x29e2,0xc0));var _0x229e=function(_0x3604f5,_0x5ab25d){_0x3604f5=_0x3604f5-0x0;var _0x4b38e7=_0x29e2[_0x3604f5];return _0x4b38e7;};'use strict';var _=require(_0x229e('0x0'));var util=require(_0x229e('0x1'));var moment=require('moment');var BPromise=require(_0x229e('0x2'));var rs=require(_0x229e('0x3'));var fs=require('fs');var Redis=require(_0x229e('0x4'));var db=require(_0x229e('0x5'))['db'];var utils=require(_0x229e('0x6'));var logger=require(_0x229e('0x7'))(_0x229e('0x8'));var config=require(_0x229e('0x9'));var jayson=require(_0x229e('0xa'));var client=jayson['client'][_0x229e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8ea3a5,_0x59d36d,_0x5f0595){return new BPromise(function(_0x3c5101,_0x439695){return client[_0x229e('0xc')](_0x8ea3a5,_0x5f0595)['then'](function(_0x3cdcec){logger['info'](_0x229e('0xd'),_0x59d36d,'request\x20sent');logger['debug'](_0x229e('0xe'),_0x59d36d,_0x229e('0xf'),JSON[_0x229e('0x10')](_0x3cdcec));if(_0x3cdcec[_0x229e('0x11')]){if(_0x3cdcec['error'][_0x229e('0x12')]===0x1f4){logger[_0x229e('0x11')](_0x229e('0xd'),_0x59d36d,_0x3cdcec['error'][_0x229e('0x13')]);return _0x439695(_0x3cdcec[_0x229e('0x11')][_0x229e('0x13')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x59d36d,_0x3cdcec[_0x229e('0x11')]['message']);return _0x3c5101(_0x3cdcec[_0x229e('0x11')][_0x229e('0x13')]);}else{logger['info'](_0x229e('0xd'),_0x59d36d,_0x229e('0xf'));_0x3c5101(_0x3cdcec[_0x229e('0x14')][_0x229e('0x13')]);}})[_0x229e('0x15')](function(_0x107109){logger[_0x229e('0x11')](_0x229e('0xd'),_0x59d36d,_0x107109);_0x439695(_0x107109);});});}
\ No newline at end of file
index c8799a1..f829dee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a6d=['/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x3d4345,_0xace8a6){var _0x1ceb93=function(_0x47f0b3){while(--_0x47f0b3){_0x3d4345['push'](_0x3d4345['shift']());}};_0x1ceb93(++_0xace8a6);}(_0x7a6d,0x99));var _0xd7a6=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x7a6d[_0x10f6e8];return _0x35bb3c;};'use strict';var multer=require(_0xd7a6('0x0'));var util=require(_0xd7a6('0x1'));var path=require('path');var timeout=require(_0xd7a6('0x2'));var express=require(_0xd7a6('0x3'));var router=express[_0xd7a6('0x4')]();var auth=require(_0xd7a6('0x5'));var interaction=require(_0xd7a6('0x6'));var config=require('../../config/environment');var controller=require(_0xd7a6('0x7'));router[_0xd7a6('0x8')]('/',auth[_0xd7a6('0x9')](),controller[_0xd7a6('0xa')]);router[_0xd7a6('0x8')](_0xd7a6('0xb'),auth[_0xd7a6('0x9')](),controller[_0xd7a6('0xc')]);router[_0xd7a6('0x8')](_0xd7a6('0xd'),auth['isAuthenticated'](),controller[_0xd7a6('0xe')]);router[_0xd7a6('0x8')](_0xd7a6('0xf'),auth['isAuthenticated'](),controller[_0xd7a6('0x10')]);router[_0xd7a6('0x11')]('/',auth[_0xd7a6('0x9')](),controller[_0xd7a6('0x12')]);router['post'](_0xd7a6('0xd'),auth[_0xd7a6('0x9')](),controller[_0xd7a6('0x13')]);router['put'](_0xd7a6('0xb'),auth[_0xd7a6('0x9')](),controller[_0xd7a6('0x14')]);router[_0xd7a6('0x15')](_0xd7a6('0xb'),auth[_0xd7a6('0x9')](),controller[_0xd7a6('0x16')]);module[_0xd7a6('0x17')]=router;
\ No newline at end of file
+var _0xef39=['/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x1c6bed,_0x3cd7f9){var _0x5ad4ce=function(_0x433dd4){while(--_0x433dd4){_0x1c6bed['push'](_0x1c6bed['shift']());}};_0x5ad4ce(++_0x3cd7f9);}(_0xef39,0xa9));var _0x9ef3=function(_0x3d9a90,_0x2739ff){_0x3d9a90=_0x3d9a90-0x0;var _0x47a569=_0xef39[_0x3d9a90];return _0x47a569;};'use strict';var multer=require(_0x9ef3('0x0'));var util=require(_0x9ef3('0x1'));var path=require(_0x9ef3('0x2'));var timeout=require(_0x9ef3('0x3'));var express=require('express');var router=express[_0x9ef3('0x4')]();var auth=require(_0x9ef3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ef3('0x6'));var controller=require('./intSalesforceAccount.controller');router[_0x9ef3('0x7')]('/',auth[_0x9ef3('0x8')](),controller['index']);router[_0x9ef3('0x7')](_0x9ef3('0x9'),auth[_0x9ef3('0x8')](),controller[_0x9ef3('0xa')]);router['get'](_0x9ef3('0xb'),auth[_0x9ef3('0x8')](),controller[_0x9ef3('0xc')]);router[_0x9ef3('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x9ef3('0xd')]);router[_0x9ef3('0xe')]('/',auth[_0x9ef3('0x8')](),controller[_0x9ef3('0xf')]);router['post'](_0x9ef3('0xb'),auth[_0x9ef3('0x8')](),controller[_0x9ef3('0x10')]);router[_0x9ef3('0x11')](_0x9ef3('0x9'),auth[_0x9ef3('0x8')](),controller['update']);router[_0x9ef3('0x12')](_0x9ef3('0x9'),auth['isAuthenticated'](),controller[_0x9ef3('0x13')]);module['exports']=router;
\ No newline at end of file
index 5cb5fa5..ecaf9ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['STRING','username','ENUM','newTab','integrationTab','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x4dd785,_0x496a7f){_0x4dd785=_0x4dd785-0x0;var _0x2026e1=_0x326f[_0x4dd785];return _0x2026e1;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf326('0x1')]},'username':{'type':Sequelize[_0xf326('0x1')],'unique':_0xf326('0x2')},'remoteUri':{'type':Sequelize[_0xf326('0x1')]},'password':{'type':Sequelize[_0xf326('0x1')]},'clientId':{'type':Sequelize[_0xf326('0x1')]},'clientSecret':{'type':Sequelize[_0xf326('0x1')]},'securityToken':{'type':Sequelize[_0xf326('0x1')]},'serverUrl':{'type':Sequelize[_0xf326('0x1')]},'type':{'type':Sequelize[_0xf326('0x3')]('integrationTab',_0xf326('0x4')),'defaultValue':_0xf326('0x5')}};
\ No newline at end of file
+var _0x5fc3=['STRING','username','newTab','sequelize','exports'];(function(_0x4e6eb2,_0x16a451){var _0x4e0c1c=function(_0x59f144){while(--_0x59f144){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x4e0c1c(++_0x16a451);}(_0x5fc3,0xa8));var _0x35fc=function(_0x11f249,_0x4ca4a8){_0x11f249=_0x11f249-0x0;var _0x5c3656=_0x5fc3[_0x11f249];return _0x5c3656;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x35fc('0x2')]},'username':{'type':Sequelize[_0x35fc('0x2')],'unique':_0x35fc('0x3')},'remoteUri':{'type':Sequelize[_0x35fc('0x2')]},'password':{'type':Sequelize[_0x35fc('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x35fc('0x2')]},'securityToken':{'type':Sequelize[_0x35fc('0x2')]},'serverUrl':{'type':Sequelize[_0x35fc('0x2')]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x35fc('0x4')),'defaultValue':'integrationTab'}};
\ No newline at end of file
index 41982c9..6c3f414 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc41=['findAll','catch','show','params','merge','options','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','pick','filter','AccountId','Subjects','getSubjects','getDescriptions','channel','SalesforceField','Descriptions','getFields','remoteUri','clientId','clientSecret','password','securityToken','slice','login','concat','isNil','ticketType','describe','CallDisposition','CallDurationInSeconds','CallObject','IsArchived','Status','Type','Reason','Priority','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','picklistValues','label','value','True','true','false','statusCode','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','sendStatus','status','count','offset','Content-Range','apply','save','then','destroy','end','stack','name','SalesforceAccount','rawAttributes','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','includeAll','include'];(function(_0x1e18dc,_0x58352d){var _0x356ae0=function(_0x598995){while(--_0x598995){_0x1e18dc['push'](_0x1e18dc['shift']());}};_0x356ae0(++_0x58352d);}(_0xfc41,0x133));var _0x1fc4=function(_0x4273f7,_0x3d880a){_0x4273f7=_0x4273f7-0x0;var _0x411bbe=_0xfc41[_0x4273f7];return _0x411bbe;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1fc4('0x0'));var zipdir=require(_0x1fc4('0x1'));var jsonpatch=require(_0x1fc4('0x2'));var rp=require('request-promise');var moment=require(_0x1fc4('0x3'));var BPromise=require(_0x1fc4('0x4'));var Mustache=require('mustache');var util=require(_0x1fc4('0x5'));var path=require('path');var sox=require(_0x1fc4('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1fc4('0x7'));var squel=require(_0x1fc4('0x8'));var crypto=require(_0x1fc4('0x9'));var jsforce=require(_0x1fc4('0xa'));var deskjs=require(_0x1fc4('0xb'));var toCsv=require(_0x1fc4('0xc'));var querystring=require(_0x1fc4('0xd'));var Papa=require(_0x1fc4('0xe'));var Redis=require('ioredis');var authService=require(_0x1fc4('0xf'));var qs=require(_0x1fc4('0x10'));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(_0x1fc4('0x11'));var db=require(_0x1fc4('0x12'))['db'];var integrations=require(_0x1fc4('0x13'));var jayson=require(_0x1fc4('0x14'));var client=jayson[_0x1fc4('0x15')][_0x1fc4('0x16')]({'port':0x232a});function checkPasswordPattern(_0xe4a1b8,_0xde2011,_0x1175b5){if(_0x1175b5){var _0x2e7fb9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e7fb9[_0x1fc4('0x17')](_0xde2011)){return _0xe4a1b8;}else{throw new db[(_0x1fc4('0x18'))][(_0x1fc4('0x19'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xe4a1b8;}}function respondWithRpcPromise(_0x5e93f8,_0x51f648,_0x5b1af5,_0x3baf14){return new BPromise(function(_0x3c057b,_0x53885d){var _0x143822=_0x3baf14||client;return _0x143822['request'](_0x5e93f8,_0x5b1af5)['then'](function(_0x341fdb){logger['info'](_0x1fc4('0x1a'),_0x51f648,_0x1fc4('0x1b'));logger[_0x1fc4('0x1c')](_0x1fc4('0x1d'),_0x51f648,_0x1fc4('0x1b'),JSON['stringify'](_0x341fdb));if(_0x341fdb[_0x1fc4('0x1e')]){if(_0x341fdb['error']['code']===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x51f648,_0x341fdb['error'][_0x1fc4('0x1f')]);return _0x53885d(_0x341fdb[_0x1fc4('0x1e')]['message']);}logger[_0x1fc4('0x1e')]('SalesforceAccount,\x20%s,\x20%s',_0x51f648,_0x341fdb[_0x1fc4('0x1e')][_0x1fc4('0x1f')]);return _0x3c057b(_0x341fdb[_0x1fc4('0x1e')][_0x1fc4('0x1f')]);}else{logger[_0x1fc4('0x20')](_0x1fc4('0x1a'),_0x51f648,_0x1fc4('0x1b'));_0x3c057b(_0x341fdb[_0x1fc4('0x21')][_0x1fc4('0x1f')]);}})['catch'](function(_0x2ee920){logger[_0x1fc4('0x1e')](_0x1fc4('0x1a'),_0x51f648,_0x2ee920);_0x53885d(_0x2ee920);});});}function respondWithStatusCode(_0x53ce9c,_0x5c730f){_0x5c730f=_0x5c730f||0xcc;return function(_0xda8635){if(_0xda8635){return _0x53ce9c[_0x1fc4('0x22')](_0x5c730f);}return _0x53ce9c[_0x1fc4('0x23')](_0x5c730f)['end']();};}function respondWithResult(_0x4d2def,_0x1b1850){_0x1b1850=_0x1b1850||0xc8;return function(_0x36687c){if(_0x36687c){return _0x4d2def[_0x1fc4('0x23')](_0x1b1850)['json'](_0x36687c);}};}function respondWithFilteredResult(_0x1941c4,_0x452ed6){return function(_0x24a713){if(_0x24a713){var _0x10ad1d=_0x24a713[_0x1fc4('0x24')],_0xfd54c7=_0x452ed6[_0x1fc4('0x25')],_0x3afc54=_0x452ed6[_0x1fc4('0x25')]+_0x452ed6['limit'],_0x21a9ee;if(_0x3afc54>=_0x10ad1d){_0x3afc54=_0x10ad1d;_0x21a9ee=0xc8;}else{_0x21a9ee=0xce;}_0x1941c4['status'](_0x21a9ee);return _0x1941c4['set'](_0x1fc4('0x26'),_0xfd54c7+'-'+_0x3afc54+'/'+_0x10ad1d)['json'](_0x24a713);}return null;};}function patchUpdates(_0x3eb1ac){return function(_0x3d7cd1){try{jsonpatch[_0x1fc4('0x27')](_0x3d7cd1,_0x3eb1ac,!![]);}catch(_0x22407d){return BPromise['reject'](_0x22407d);}return _0x3d7cd1[_0x1fc4('0x28')]();};}function saveUpdates(_0x46758d,_0x706f43){return function(_0xf52477){if(_0xf52477){return _0xf52477['update'](_0x46758d)[_0x1fc4('0x29')](function(_0x4b7e89){return _0x4b7e89;});}return null;};}function removeEntity(_0x2e7fcb,_0x3de29e){return function(_0x21485d){if(_0x21485d){return _0x21485d[_0x1fc4('0x2a')]()[_0x1fc4('0x29')](function(){_0x2e7fcb[_0x1fc4('0x23')](0xcc)[_0x1fc4('0x2b')]();});}};}function handleEntityNotFound(_0x5d1882,_0x35e191){return function(_0x487710){if(!_0x487710){_0x5d1882[_0x1fc4('0x22')](0x194);}return _0x487710;};}function handleError(_0x234eea,_0x1dd0cd){_0x1dd0cd=_0x1dd0cd||0x1f4;return function(_0x4fef5c){logger[_0x1fc4('0x1e')](_0x4fef5c[_0x1fc4('0x2c')]);if(_0x4fef5c[_0x1fc4('0x2d')]){delete _0x4fef5c[_0x1fc4('0x2d')];}_0x234eea[_0x1fc4('0x23')](_0x1dd0cd)['send'](_0x4fef5c);};}exports['index']=function(_0x4c1908,_0x779bf4){var _0x371210={},_0x5c801a={},_0x27688e={'count':0x0,'rows':[]};var _0x2b3393=_['map'](db[_0x1fc4('0x2e')][_0x1fc4('0x2f')],function(_0x9a5e1){return{'name':_0x9a5e1[_0x1fc4('0x30')],'type':_0x9a5e1[_0x1fc4('0x31')][_0x1fc4('0x32')]};});_0x5c801a['model']=_[_0x1fc4('0x33')](_0x2b3393,'name');_0x5c801a[_0x1fc4('0x34')]=_[_0x1fc4('0x35')](_0x4c1908[_0x1fc4('0x34')]);_0x5c801a['filters']=_['intersection'](_0x5c801a[_0x1fc4('0x36')],_0x5c801a[_0x1fc4('0x34')]);_0x371210[_0x1fc4('0x37')]=_[_0x1fc4('0x38')](_0x5c801a[_0x1fc4('0x36')],qs['fields'](_0x4c1908[_0x1fc4('0x34')][_0x1fc4('0x39')]));_0x371210[_0x1fc4('0x37')]=_0x371210[_0x1fc4('0x37')][_0x1fc4('0x3a')]?_0x371210[_0x1fc4('0x37')]:_0x5c801a[_0x1fc4('0x36')];if(!_0x4c1908['query'][_0x1fc4('0x3b')](_0x1fc4('0x3c'))){_0x371210['limit']=qs[_0x1fc4('0x3d')](_0x4c1908[_0x1fc4('0x34')]['limit']);_0x371210[_0x1fc4('0x25')]=qs['offset'](_0x4c1908[_0x1fc4('0x34')][_0x1fc4('0x25')]);}_0x371210[_0x1fc4('0x3e')]=qs[_0x1fc4('0x3f')](_0x4c1908[_0x1fc4('0x34')][_0x1fc4('0x3f')]);_0x371210[_0x1fc4('0x40')]=qs[_0x1fc4('0x41')](_['pick'](_0x4c1908[_0x1fc4('0x34')],_0x5c801a[_0x1fc4('0x41')]),_0x2b3393);if(_0x4c1908['query']['filter']){_0x371210[_0x1fc4('0x40')]=_['merge'](_0x371210[_0x1fc4('0x40')],{'$or':_[_0x1fc4('0x33')](_0x2b3393,function(_0x5542df){if(_0x5542df[_0x1fc4('0x31')]!=='VIRTUAL'){var _0x5a74d9={};_0x5a74d9[_0x5542df['name']]={'$like':'%'+_0x4c1908['query']['filter']+'%'};return _0x5a74d9;}})});}_0x371210=_['merge']({},_0x371210,_0x4c1908['options']);var _0x5eba2a={'where':_0x371210['where']};return db[_0x1fc4('0x2e')][_0x1fc4('0x24')](_0x5eba2a)[_0x1fc4('0x29')](function(_0x117b33){_0x27688e[_0x1fc4('0x24')]=_0x117b33;if(_0x4c1908[_0x1fc4('0x34')][_0x1fc4('0x42')]){_0x371210[_0x1fc4('0x43')]=[{'all':!![]}];}return db[_0x1fc4('0x2e')][_0x1fc4('0x44')](_0x371210);})[_0x1fc4('0x29')](function(_0x4003ab){_0x27688e['rows']=_0x4003ab;return _0x27688e;})[_0x1fc4('0x29')](respondWithFilteredResult(_0x779bf4,_0x371210))[_0x1fc4('0x45')](handleError(_0x779bf4,null));};exports[_0x1fc4('0x46')]=function(_0xbd8d06,_0x4e5d91){var _0x535a70={'raw':![],'where':{'id':_0xbd8d06[_0x1fc4('0x47')]['id']}},_0x4afd89={};_0x4afd89[_0x1fc4('0x36')]=_[_0x1fc4('0x35')](db['SalesforceAccount'][_0x1fc4('0x2f')]);_0x4afd89[_0x1fc4('0x34')]=_['keys'](_0xbd8d06[_0x1fc4('0x34')]);_0x4afd89[_0x1fc4('0x41')]=_[_0x1fc4('0x38')](_0x4afd89['model'],_0x4afd89['query']);_0x535a70[_0x1fc4('0x37')]=_[_0x1fc4('0x38')](_0x4afd89['model'],qs[_0x1fc4('0x39')](_0xbd8d06[_0x1fc4('0x34')][_0x1fc4('0x39')]));_0x535a70[_0x1fc4('0x37')]=_0x535a70['attributes'][_0x1fc4('0x3a')]?_0x535a70[_0x1fc4('0x37')]:_0x4afd89[_0x1fc4('0x36')];if(_0xbd8d06[_0x1fc4('0x34')][_0x1fc4('0x42')]){_0x535a70[_0x1fc4('0x43')]=[{'all':!![]}];}_0x535a70=_[_0x1fc4('0x48')]({},_0x535a70,_0xbd8d06[_0x1fc4('0x49')]);return db[_0x1fc4('0x2e')][_0x1fc4('0x4a')](_0x535a70)[_0x1fc4('0x29')](handleEntityNotFound(_0x4e5d91,null))[_0x1fc4('0x29')](respondWithResult(_0x4e5d91,null))[_0x1fc4('0x45')](handleError(_0x4e5d91,null));};exports[_0x1fc4('0x4b')]=function(_0x7be8,_0x1749a8){return db[_0x1fc4('0x2e')][_0x1fc4('0x4b')](_0x7be8[_0x1fc4('0x4c')],{})[_0x1fc4('0x29')](respondWithResult(_0x1749a8,0xc9))[_0x1fc4('0x45')](handleError(_0x1749a8,null));};exports[_0x1fc4('0x4d')]=function(_0x17ce83,_0x2aa380){if(_0x17ce83['body']['id']){delete _0x17ce83['body']['id'];}return db[_0x1fc4('0x2e')][_0x1fc4('0x4a')]({'where':{'id':_0x17ce83[_0x1fc4('0x47')]['id']}})[_0x1fc4('0x29')](handleEntityNotFound(_0x2aa380,null))['then'](saveUpdates(_0x17ce83[_0x1fc4('0x4c')],null))[_0x1fc4('0x29')](respondWithResult(_0x2aa380,null))['catch'](handleError(_0x2aa380,null));};exports[_0x1fc4('0x2a')]=function(_0x321886,_0x391757){return db[_0x1fc4('0x2e')][_0x1fc4('0x4a')]({'where':{'id':_0x321886[_0x1fc4('0x47')]['id']}})['then'](handleEntityNotFound(_0x391757,null))[_0x1fc4('0x29')](removeEntity(_0x391757,null))[_0x1fc4('0x45')](handleError(_0x391757,null));};exports[_0x1fc4('0x4e')]=function(_0x2e3f65,_0x1f9498,_0x4a8d3b){var _0x301419={};var _0x3f88d1={};var _0x2d14fd;var _0x88b88e;return db[_0x1fc4('0x2e')][_0x1fc4('0x4f')]({'where':{'id':_0x2e3f65[_0x1fc4('0x47')]['id']}})[_0x1fc4('0x29')](handleEntityNotFound(_0x1f9498,null))['then'](function(_0x42e76c){if(_0x42e76c){_0x2d14fd=_0x42e76c;_0x3f88d1['model']=_[_0x1fc4('0x35')](db[_0x1fc4('0x50')][_0x1fc4('0x2f')]);_0x3f88d1['query']=_[_0x1fc4('0x35')](_0x2e3f65[_0x1fc4('0x34')]);_0x3f88d1[_0x1fc4('0x41')]=_['intersection'](_0x3f88d1[_0x1fc4('0x36')],_0x3f88d1[_0x1fc4('0x34')]);_0x301419[_0x1fc4('0x37')]=_[_0x1fc4('0x38')](_0x3f88d1[_0x1fc4('0x36')],qs[_0x1fc4('0x39')](_0x2e3f65['query'][_0x1fc4('0x39')]));_0x301419[_0x1fc4('0x37')]=_0x301419['attributes'][_0x1fc4('0x3a')]?_0x301419[_0x1fc4('0x37')]:_0x3f88d1[_0x1fc4('0x36')];_0x301419[_0x1fc4('0x3e')]=qs[_0x1fc4('0x3f')](_0x2e3f65[_0x1fc4('0x34')]['sort']);_0x301419[_0x1fc4('0x40')]=qs['filters'](_[_0x1fc4('0x51')](_0x2e3f65[_0x1fc4('0x34')],_0x3f88d1['filters']));if(_0x2e3f65[_0x1fc4('0x34')]['filter']){_0x301419['where']=_[_0x1fc4('0x48')](_0x301419[_0x1fc4('0x40')],{'$or':_[_0x1fc4('0x33')](_0x301419['attributes'],function(_0x21ea53){var _0x203160={};_0x203160[_0x21ea53]={'$like':'%'+_0x2e3f65[_0x1fc4('0x34')][_0x1fc4('0x52')]+'%'};return _0x203160;})});}_0x301419=_['merge']({},_0x301419,_0x2e3f65[_0x1fc4('0x49')]);return _0x2d14fd[_0x1fc4('0x4e')](_0x301419);}})['then'](function(_0x58cee8){if(_0x58cee8){_0x88b88e=_0x58cee8['length'];if(!_0x2e3f65[_0x1fc4('0x34')][_0x1fc4('0x3b')](_0x1fc4('0x3c'))){_0x301419[_0x1fc4('0x3d')]=qs[_0x1fc4('0x3d')](_0x2e3f65['query']['limit']);_0x301419[_0x1fc4('0x25')]=qs['offset'](_0x2e3f65[_0x1fc4('0x34')]['offset']);}return _0x2d14fd[_0x1fc4('0x4e')](_0x301419);}})['then'](function(_0x50b28e){if(_0x50b28e){return _0x50b28e?{'count':_0x88b88e,'rows':_0x50b28e}:null;}})[_0x1fc4('0x29')](respondWithResult(_0x1f9498,null))[_0x1fc4('0x45')](handleError(_0x1f9498,null));};exports['addConfiguration']=function(_0x3ca587,_0x2dafe2,_0x3ea212){if(_0x3ca587[_0x1fc4('0x4c')]['id']){delete _0x3ca587['body']['id'];}return db['SalesforceAccount'][_0x1fc4('0x4f')]({'where':{'id':_0x3ca587[_0x1fc4('0x47')]['id']}})[_0x1fc4('0x29')](handleEntityNotFound(_0x2dafe2,null))[_0x1fc4('0x29')](function(_0x6ad9db){if(_0x6ad9db){_0x3ca587[_0x1fc4('0x4c')][_0x1fc4('0x53')]=_0x6ad9db['id'];_0x3ca587[_0x1fc4('0x4c')][_0x1fc4('0x54')]=integrations[_0x1fc4('0x55')](_0x3ca587['body']['channel'],_0x3ca587['body']['type']);_0x3ca587['body']['Descriptions']=integrations[_0x1fc4('0x56')](_0x3ca587['body'][_0x1fc4('0x57')],_0x3ca587[_0x1fc4('0x4c')]['type']);return db[_0x1fc4('0x50')][_0x1fc4('0x4b')](_0x3ca587[_0x1fc4('0x4c')],{'include':[{'model':db[_0x1fc4('0x58')],'as':_0x1fc4('0x54')},{'model':db[_0x1fc4('0x58')],'as':_0x1fc4('0x59')}]});}return null;})[_0x1fc4('0x29')](respondWithResult(_0x2dafe2,null))[_0x1fc4('0x45')](handleError(_0x2dafe2,null));};exports[_0x1fc4('0x5a')]=function(_0x2d6c29,_0x25a606,_0x4498ac){var _0x59e629;var _0x1a8d27='';var _0x534fd7='Task';return db[_0x1fc4('0x2e')][_0x1fc4('0x4f')]({'where':{'id':_0x2d6c29[_0x1fc4('0x47')]['id']},'attributes':['id',_0x1fc4('0x5b'),_0x1fc4('0x5c'),_0x1fc4('0x5d'),'username',_0x1fc4('0x5e'),_0x1fc4('0x5f')]})[_0x1fc4('0x29')](handleEntityNotFound(_0x25a606,null))[_0x1fc4('0x29')](function(_0x29b4b6){if(_0x29b4b6){_0x1a8d27=_0x29b4b6['remoteUri'];var _0x4decfa=_0x1a8d27[_0x1fc4('0x60')](-0x1);if(_0x4decfa==='/'){_0x1a8d27=_0x1a8d27['substring'](0x0,_0x1a8d27['lastIndexOf'](_0x4decfa));}_0x59e629=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1a8d27,'clientId':_0x29b4b6[_0x1fc4('0x5c')],'clientSecret':_0x29b4b6[_0x1fc4('0x5d')]}});return _0x59e629[_0x1fc4('0x61')](_0x29b4b6['username'],_0x29b4b6[_0x1fc4('0x5e')][_0x1fc4('0x62')](_0x29b4b6[_0x1fc4('0x5f')]));}})['then'](function(_0x821000){if(_0x821000){if(!_[_0x1fc4('0x63')](_0x2d6c29[_0x1fc4('0x34')][_0x1fc4('0x64')])){_0x534fd7=_0x2d6c29[_0x1fc4('0x34')][_0x1fc4('0x64')];}return _0x59e629['sobject'](_0x534fd7)[_0x1fc4('0x65')]();}})[_0x1fc4('0x29')](function(_0x1b6e38){var _0x5892f3=[_0x1fc4('0x66'),_0x1fc4('0x67'),_0x1fc4('0x68'),'CallType',_0x1fc4('0x69'),'Priority',_0x1fc4('0x6a'),_0x1fc4('0x6b')];if(!_[_0x1fc4('0x63')](_0x2d6c29[_0x1fc4('0x34')][_0x1fc4('0x64')])&&_0x2d6c29[_0x1fc4('0x34')][_0x1fc4('0x64')]==='Case'){_0x5892f3=[_0x1fc4('0x6b'),'Origin',_0x1fc4('0x6c'),_0x1fc4('0x6a'),_0x1fc4('0x6d'),_0x1fc4('0x6e'),_0x1fc4('0x6f'),_0x1fc4('0x70')];}if(_0x1b6e38){_[_0x1fc4('0x71')](_0x1b6e38[_0x1fc4('0x39')],function(_0x3c0255){return _0x3c0255[_0x1fc4('0x72')]===![]&&!_0x5892f3[_0x1fc4('0x73')](_0x3c0255[_0x1fc4('0x2d')]);});return{'count':_0x1b6e38[_0x1fc4('0x39')][_0x1fc4('0x3a')],'rows':_[_0x1fc4('0x33')](_0x1b6e38[_0x1fc4('0x39')],function(_0x539005){return{'id':_0x539005['name'],'name':_0x539005['label'],'custom':_0x539005[_0x1fc4('0x72')],'options':_0x539005[_0x1fc4('0x74')][_0x1fc4('0x3a')]>0x0?_[_0x1fc4('0x33')](_0x539005['picklistValues'],function(_0x59a724){return{'name':_0x59a724[_0x1fc4('0x75')],'value':_0x59a724[_0x1fc4('0x76')]};}):_0x539005['type']=='boolean'?[{'name':_0x1fc4('0x77'),'value':_0x1fc4('0x78')},{'name':'False','value':_0x1fc4('0x79')}]:[]};})};}})[_0x1fc4('0x29')](respondWithResult(_0x25a606,null))[_0x1fc4('0x45')](function(_0x583985){var _0x36f0e6=_0x2d6c29['query']['test']?0x1f4:_0x583985[_0x1fc4('0x7a')]||0x1f4;logger[_0x1fc4('0x1e')]('getFields,\x20%s,\x20%s,\x20%s',_0x1fc4('0x5a'),_0x36f0e6,JSON['stringify'](_0x583985));delete _0x583985['name'];if(_0x36f0e6===0x191){_0x36f0e6=0x190;}_0x25a606[_0x1fc4('0x23')](_0x36f0e6)[_0x1fc4('0x7b')](_0x2d6c29[_0x1fc4('0x34')][_0x1fc4('0x17')]?{'message':_0x1fc4('0x7c'),'statusCode':_0x583985[_0x1fc4('0x7a')]}:_0x583985);});};
\ No newline at end of file
+var _0x4329=['rows','show','params','include','options','create','body','find','destroy','getConfigurations','findOne','keys','SalesforceConfiguration','addConfiguration','AccountId','channel','getDescriptions','SalesforceField','Subjects','Descriptions','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','substring','Connection','clientId','concat','ticketType','sobject','CallDisposition','CallObject','Priority','Type','isNil','Origin','Reason','Status','IsEscalated','SuppliedName','SuppliedCompany','custom','includes','label','value','true','False','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','update','then','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','findAll'];(function(_0x2459fd,_0x575d9b){var _0x364cd2=function(_0x4b22f6){while(--_0x4b22f6){_0x2459fd['push'](_0x2459fd['shift']());}};_0x364cd2(++_0x575d9b);}(_0x4329,0xbb));var _0x9432=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4329[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x9432('0x0'));var emlformat=require(_0x9432('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9432('0x2'));var rp=require(_0x9432('0x3'));var moment=require(_0x9432('0x4'));var BPromise=require(_0x9432('0x5'));var Mustache=require(_0x9432('0x6'));var util=require(_0x9432('0x7'));var path=require(_0x9432('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9432('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9432('0xa'));var crypto=require(_0x9432('0xb'));var jsforce=require(_0x9432('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9432('0xd'));var querystring=require('querystring');var Papa=require(_0x9432('0xe'));var Redis=require(_0x9432('0xf'));var authService=require(_0x9432('0x10'));var qs=require(_0x9432('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9432('0x12'))(_0x9432('0x13'));var utils=require(_0x9432('0x14'));var config=require(_0x9432('0x15'));var db=require(_0x9432('0x16'))['db'];var integrations=require(_0x9432('0x17'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x2f9b09,_0x2131c3,_0x5720d7){if(_0x5720d7){var _0x2fd85a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2fd85a[_0x9432('0x18')](_0x2131c3)){return _0x2f9b09;}else{throw new db[(_0x9432('0x19'))]['ValidationError'](_0x9432('0x1a'));}}else{return _0x2f9b09;}}function respondWithRpcPromise(_0xca6f1d,_0xea697d,_0x38db44,_0xe7ad10){return new BPromise(function(_0x7bf721,_0xbf643){var _0x2179bd=_0xe7ad10||client;return _0x2179bd[_0x9432('0x1b')](_0xca6f1d,_0x38db44)['then'](function(_0x4c8718){logger[_0x9432('0x1c')]('SalesforceAccount,\x20%s,\x20%s',_0xea697d,'request\x20sent');logger[_0x9432('0x1d')](_0x9432('0x1e'),_0xea697d,_0x9432('0x1f'),JSON[_0x9432('0x20')](_0x4c8718));if(_0x4c8718['error']){if(_0x4c8718[_0x9432('0x21')][_0x9432('0x22')]===0x1f4){logger['error'](_0x9432('0x23'),_0xea697d,_0x4c8718['error'][_0x9432('0x24')]);return _0xbf643(_0x4c8718[_0x9432('0x21')][_0x9432('0x24')]);}logger['error'](_0x9432('0x23'),_0xea697d,_0x4c8718[_0x9432('0x21')][_0x9432('0x24')]);return _0x7bf721(_0x4c8718[_0x9432('0x21')]['message']);}else{logger['info'](_0x9432('0x23'),_0xea697d,_0x9432('0x1f'));_0x7bf721(_0x4c8718[_0x9432('0x25')][_0x9432('0x24')]);}})[_0x9432('0x26')](function(_0x183d5f){logger[_0x9432('0x21')](_0x9432('0x23'),_0xea697d,_0x183d5f);_0xbf643(_0x183d5f);});});}function respondWithStatusCode(_0x81a990,_0x1946db){_0x1946db=_0x1946db||0xcc;return function(_0x39400c){if(_0x39400c){return _0x81a990[_0x9432('0x27')](_0x1946db);}return _0x81a990[_0x9432('0x28')](_0x1946db)[_0x9432('0x29')]();};}function respondWithResult(_0x42e93a,_0x5e6211){_0x5e6211=_0x5e6211||0xc8;return function(_0x5089ec){if(_0x5089ec){return _0x42e93a['status'](_0x5e6211)[_0x9432('0x2a')](_0x5089ec);}};}function respondWithFilteredResult(_0xefd8c0,_0x4bfdb6){return function(_0x595ca3){if(_0x595ca3){var _0x54b127=_0x595ca3[_0x9432('0x2b')],_0x558adc=_0x4bfdb6[_0x9432('0x2c')],_0x40ea4a=_0x4bfdb6[_0x9432('0x2c')]+_0x4bfdb6[_0x9432('0x2d')],_0x2c64d4;if(_0x40ea4a>=_0x54b127){_0x40ea4a=_0x54b127;_0x2c64d4=0xc8;}else{_0x2c64d4=0xce;}_0xefd8c0[_0x9432('0x28')](_0x2c64d4);return _0xefd8c0[_0x9432('0x2e')](_0x9432('0x2f'),_0x558adc+'-'+_0x40ea4a+'/'+_0x54b127)[_0x9432('0x2a')](_0x595ca3);}return null;};}function patchUpdates(_0x1aa6b2){return function(_0x4ed3bc){try{jsonpatch['apply'](_0x4ed3bc,_0x1aa6b2,!![]);}catch(_0x1877b3){return BPromise['reject'](_0x1877b3);}return _0x4ed3bc['save']();};}function saveUpdates(_0x5da5ad,_0x42d34d){return function(_0x4a341){if(_0x4a341){return _0x4a341[_0x9432('0x30')](_0x5da5ad)['then'](function(_0x5df3a3){return _0x5df3a3;});}return null;};}function removeEntity(_0x4dfd8a,_0x2673f8){return function(_0x1041a5){if(_0x1041a5){return _0x1041a5['destroy']()[_0x9432('0x31')](function(){_0x4dfd8a['status'](0xcc)[_0x9432('0x29')]();});}};}function handleEntityNotFound(_0x1ad36a,_0x3e809f){return function(_0x52a4f3){if(!_0x52a4f3){_0x1ad36a['sendStatus'](0x194);}return _0x52a4f3;};}function handleError(_0x2bacf8,_0x5326ab){_0x5326ab=_0x5326ab||0x1f4;return function(_0x2a9e25){logger['error'](_0x2a9e25[_0x9432('0x32')]);if(_0x2a9e25[_0x9432('0x33')]){delete _0x2a9e25[_0x9432('0x33')];}_0x2bacf8[_0x9432('0x28')](_0x5326ab)['send'](_0x2a9e25);};}exports[_0x9432('0x34')]=function(_0x20907d,_0xe69a81){var _0x54118a={},_0x173bb3={},_0x1f31e2={'count':0x0,'rows':[]};var _0x4a4edf=_[_0x9432('0x35')](db[_0x9432('0x36')][_0x9432('0x37')],function(_0x173fb2){return{'name':_0x173fb2[_0x9432('0x38')],'type':_0x173fb2['type'][_0x9432('0x39')]};});_0x173bb3['model']=_[_0x9432('0x35')](_0x4a4edf,_0x9432('0x33'));_0x173bb3['query']=_['keys'](_0x20907d[_0x9432('0x3a')]);_0x173bb3[_0x9432('0x3b')]=_[_0x9432('0x3c')](_0x173bb3[_0x9432('0x3d')],_0x173bb3[_0x9432('0x3a')]);_0x54118a[_0x9432('0x3e')]=_['intersection'](_0x173bb3[_0x9432('0x3d')],qs[_0x9432('0x3f')](_0x20907d[_0x9432('0x3a')][_0x9432('0x3f')]));_0x54118a[_0x9432('0x3e')]=_0x54118a[_0x9432('0x3e')][_0x9432('0x40')]?_0x54118a['attributes']:_0x173bb3[_0x9432('0x3d')];if(!_0x20907d[_0x9432('0x3a')][_0x9432('0x41')](_0x9432('0x42'))){_0x54118a[_0x9432('0x2d')]=qs[_0x9432('0x2d')](_0x20907d['query']['limit']);_0x54118a[_0x9432('0x2c')]=qs[_0x9432('0x2c')](_0x20907d[_0x9432('0x3a')]['offset']);}_0x54118a[_0x9432('0x43')]=qs['sort'](_0x20907d['query'][_0x9432('0x44')]);_0x54118a['where']=qs[_0x9432('0x3b')](_[_0x9432('0x45')](_0x20907d[_0x9432('0x3a')],_0x173bb3[_0x9432('0x3b')]),_0x4a4edf);if(_0x20907d['query'][_0x9432('0x46')]){_0x54118a[_0x9432('0x47')]=_['merge'](_0x54118a[_0x9432('0x47')],{'$or':_[_0x9432('0x35')](_0x4a4edf,function(_0x40d4e7){if(_0x40d4e7[_0x9432('0x48')]!==_0x9432('0x49')){var _0x4153ba={};_0x4153ba[_0x40d4e7[_0x9432('0x33')]]={'$like':'%'+_0x20907d[_0x9432('0x3a')]['filter']+'%'};return _0x4153ba;}})});}_0x54118a=_[_0x9432('0x4a')]({},_0x54118a,_0x20907d['options']);var _0x1b0aef={'where':_0x54118a[_0x9432('0x47')]};return db[_0x9432('0x36')]['count'](_0x1b0aef)['then'](function(_0x45c683){_0x1f31e2['count']=_0x45c683;if(_0x20907d['query'][_0x9432('0x4b')]){_0x54118a['include']=[{'all':!![]}];}return db[_0x9432('0x36')][_0x9432('0x4c')](_0x54118a);})[_0x9432('0x31')](function(_0x5f417c){_0x1f31e2[_0x9432('0x4d')]=_0x5f417c;return _0x1f31e2;})[_0x9432('0x31')](respondWithFilteredResult(_0xe69a81,_0x54118a))[_0x9432('0x26')](handleError(_0xe69a81,null));};exports[_0x9432('0x4e')]=function(_0x3c62f0,_0x1517ed){var _0x356563={'raw':![],'where':{'id':_0x3c62f0[_0x9432('0x4f')]['id']}},_0x1cd3c0={};_0x1cd3c0[_0x9432('0x3d')]=_['keys'](db[_0x9432('0x36')]['rawAttributes']);_0x1cd3c0[_0x9432('0x3a')]=_['keys'](_0x3c62f0[_0x9432('0x3a')]);_0x1cd3c0[_0x9432('0x3b')]=_[_0x9432('0x3c')](_0x1cd3c0[_0x9432('0x3d')],_0x1cd3c0[_0x9432('0x3a')]);_0x356563['attributes']=_[_0x9432('0x3c')](_0x1cd3c0['model'],qs['fields'](_0x3c62f0['query']['fields']));_0x356563['attributes']=_0x356563[_0x9432('0x3e')][_0x9432('0x40')]?_0x356563['attributes']:_0x1cd3c0[_0x9432('0x3d')];if(_0x3c62f0['query'][_0x9432('0x4b')]){_0x356563[_0x9432('0x50')]=[{'all':!![]}];}_0x356563=_[_0x9432('0x4a')]({},_0x356563,_0x3c62f0[_0x9432('0x51')]);return db[_0x9432('0x36')]['find'](_0x356563)[_0x9432('0x31')](handleEntityNotFound(_0x1517ed,null))[_0x9432('0x31')](respondWithResult(_0x1517ed,null))[_0x9432('0x26')](handleError(_0x1517ed,null));};exports[_0x9432('0x52')]=function(_0x214fe1,_0x1f8e9d){return db[_0x9432('0x36')]['create'](_0x214fe1[_0x9432('0x53')],{})[_0x9432('0x31')](respondWithResult(_0x1f8e9d,0xc9))[_0x9432('0x26')](handleError(_0x1f8e9d,null));};exports[_0x9432('0x30')]=function(_0xd61c42,_0x4417e5){if(_0xd61c42[_0x9432('0x53')]['id']){delete _0xd61c42[_0x9432('0x53')]['id'];}return db[_0x9432('0x36')][_0x9432('0x54')]({'where':{'id':_0xd61c42[_0x9432('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4417e5,null))['then'](saveUpdates(_0xd61c42[_0x9432('0x53')],null))['then'](respondWithResult(_0x4417e5,null))[_0x9432('0x26')](handleError(_0x4417e5,null));};exports[_0x9432('0x55')]=function(_0x361426,_0x3d11a5){return db[_0x9432('0x36')][_0x9432('0x54')]({'where':{'id':_0x361426[_0x9432('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3d11a5,null))[_0x9432('0x31')](removeEntity(_0x3d11a5,null))[_0x9432('0x26')](handleError(_0x3d11a5,null));};exports[_0x9432('0x56')]=function(_0x3449f6,_0x38ee55,_0xd533d2){var _0x54e752={};var _0x1507fb={};var _0x2f9b24;var _0x24e3a7;return db[_0x9432('0x36')][_0x9432('0x57')]({'where':{'id':_0x3449f6['params']['id']}})[_0x9432('0x31')](handleEntityNotFound(_0x38ee55,null))[_0x9432('0x31')](function(_0x599df8){if(_0x599df8){_0x2f9b24=_0x599df8;_0x1507fb['model']=_[_0x9432('0x58')](db[_0x9432('0x59')][_0x9432('0x37')]);_0x1507fb[_0x9432('0x3a')]=_['keys'](_0x3449f6[_0x9432('0x3a')]);_0x1507fb[_0x9432('0x3b')]=_[_0x9432('0x3c')](_0x1507fb['model'],_0x1507fb[_0x9432('0x3a')]);_0x54e752['attributes']=_[_0x9432('0x3c')](_0x1507fb[_0x9432('0x3d')],qs[_0x9432('0x3f')](_0x3449f6[_0x9432('0x3a')][_0x9432('0x3f')]));_0x54e752[_0x9432('0x3e')]=_0x54e752[_0x9432('0x3e')][_0x9432('0x40')]?_0x54e752[_0x9432('0x3e')]:_0x1507fb[_0x9432('0x3d')];_0x54e752[_0x9432('0x43')]=qs['sort'](_0x3449f6[_0x9432('0x3a')][_0x9432('0x44')]);_0x54e752[_0x9432('0x47')]=qs['filters'](_['pick'](_0x3449f6['query'],_0x1507fb[_0x9432('0x3b')]));if(_0x3449f6[_0x9432('0x3a')]['filter']){_0x54e752[_0x9432('0x47')]=_['merge'](_0x54e752[_0x9432('0x47')],{'$or':_[_0x9432('0x35')](_0x54e752['attributes'],function(_0x1cbd33){var _0x2955e3={};_0x2955e3[_0x1cbd33]={'$like':'%'+_0x3449f6['query'][_0x9432('0x46')]+'%'};return _0x2955e3;})});}_0x54e752=_[_0x9432('0x4a')]({},_0x54e752,_0x3449f6[_0x9432('0x51')]);return _0x2f9b24[_0x9432('0x56')](_0x54e752);}})[_0x9432('0x31')](function(_0xe30a4){if(_0xe30a4){_0x24e3a7=_0xe30a4['length'];if(!_0x3449f6[_0x9432('0x3a')][_0x9432('0x41')](_0x9432('0x42'))){_0x54e752[_0x9432('0x2d')]=qs[_0x9432('0x2d')](_0x3449f6[_0x9432('0x3a')][_0x9432('0x2d')]);_0x54e752['offset']=qs[_0x9432('0x2c')](_0x3449f6[_0x9432('0x3a')][_0x9432('0x2c')]);}return _0x2f9b24['getConfigurations'](_0x54e752);}})['then'](function(_0x86edc6){if(_0x86edc6){return _0x86edc6?{'count':_0x24e3a7,'rows':_0x86edc6}:null;}})[_0x9432('0x31')](respondWithResult(_0x38ee55,null))[_0x9432('0x26')](handleError(_0x38ee55,null));};exports[_0x9432('0x5a')]=function(_0x39c0db,_0x30c626,_0x2e3c97){if(_0x39c0db[_0x9432('0x53')]['id']){delete _0x39c0db[_0x9432('0x53')]['id'];}return db[_0x9432('0x36')]['findOne']({'where':{'id':_0x39c0db[_0x9432('0x4f')]['id']}})['then'](handleEntityNotFound(_0x30c626,null))['then'](function(_0x3b0b02){if(_0x3b0b02){_0x39c0db['body'][_0x9432('0x5b')]=_0x3b0b02['id'];_0x39c0db[_0x9432('0x53')]['Subjects']=integrations['getSubjects'](_0x39c0db['body'][_0x9432('0x5c')],_0x39c0db[_0x9432('0x53')]['type']);_0x39c0db['body']['Descriptions']=integrations[_0x9432('0x5d')](_0x39c0db[_0x9432('0x53')]['channel'],_0x39c0db[_0x9432('0x53')][_0x9432('0x48')]);return db[_0x9432('0x59')][_0x9432('0x52')](_0x39c0db['body'],{'include':[{'model':db[_0x9432('0x5e')],'as':_0x9432('0x5f')},{'model':db[_0x9432('0x5e')],'as':_0x9432('0x60')}]});}return null;})[_0x9432('0x31')](respondWithResult(_0x30c626,null))['catch'](handleError(_0x30c626,null));};exports[_0x9432('0x61')]=function(_0xe42806,_0x1bd62e,_0x511dda){var _0x514c29;var _0x27154a='';var _0x1a7f9f=_0x9432('0x62');return db[_0x9432('0x36')][_0x9432('0x57')]({'where':{'id':_0xe42806[_0x9432('0x4f')]['id']},'attributes':['id',_0x9432('0x63'),'clientId',_0x9432('0x64'),_0x9432('0x65'),_0x9432('0x66'),_0x9432('0x67')]})[_0x9432('0x31')](handleEntityNotFound(_0x1bd62e,null))['then'](function(_0x1a4bfa){if(_0x1a4bfa){_0x27154a=_0x1a4bfa[_0x9432('0x63')];var _0x225de1=_0x27154a[_0x9432('0x68')](-0x1);if(_0x225de1==='/'){_0x27154a=_0x27154a[_0x9432('0x69')](0x0,_0x27154a['lastIndexOf'](_0x225de1));}_0x514c29=new jsforce[(_0x9432('0x6a'))]({'oauth2':{'loginUrl':_0x27154a,'clientId':_0x1a4bfa[_0x9432('0x6b')],'clientSecret':_0x1a4bfa[_0x9432('0x64')]}});return _0x514c29['login'](_0x1a4bfa[_0x9432('0x65')],_0x1a4bfa[_0x9432('0x66')][_0x9432('0x6c')](_0x1a4bfa[_0x9432('0x67')]));}})[_0x9432('0x31')](function(_0x3452f0){if(_0x3452f0){if(!_['isNil'](_0xe42806[_0x9432('0x3a')][_0x9432('0x6d')])){_0x1a7f9f=_0xe42806[_0x9432('0x3a')][_0x9432('0x6d')];}return _0x514c29[_0x9432('0x6e')](_0x1a7f9f)['describe']();}})['then'](function(_0x36f0aa){var _0x3aad03=[_0x9432('0x6f'),'CallDurationInSeconds',_0x9432('0x70'),'CallType','IsArchived',_0x9432('0x71'),'Status',_0x9432('0x72')];if(!_[_0x9432('0x73')](_0xe42806[_0x9432('0x3a')][_0x9432('0x6d')])&&_0xe42806['query'][_0x9432('0x6d')]==='Case'){_0x3aad03=[_0x9432('0x72'),_0x9432('0x74'),_0x9432('0x75'),_0x9432('0x76'),_0x9432('0x71'),_0x9432('0x77'),_0x9432('0x78'),_0x9432('0x79')];}if(_0x36f0aa){_['remove'](_0x36f0aa['fields'],function(_0x25f525){return _0x25f525[_0x9432('0x7a')]===![]&&!_0x3aad03[_0x9432('0x7b')](_0x25f525['name']);});return{'count':_0x36f0aa['fields']['length'],'rows':_[_0x9432('0x35')](_0x36f0aa[_0x9432('0x3f')],function(_0x5bfa1b){return{'id':_0x5bfa1b[_0x9432('0x33')],'name':_0x5bfa1b['label'],'custom':_0x5bfa1b[_0x9432('0x7a')],'options':_0x5bfa1b['picklistValues']['length']>0x0?_[_0x9432('0x35')](_0x5bfa1b['picklistValues'],function(_0x29d7a3){return{'name':_0x29d7a3[_0x9432('0x7c')],'value':_0x29d7a3[_0x9432('0x7d')]};}):_0x5bfa1b['type']=='boolean'?[{'name':'True','value':_0x9432('0x7e')},{'name':_0x9432('0x7f'),'value':'false'}]:[]};})};}})[_0x9432('0x31')](respondWithResult(_0x1bd62e,null))['catch'](function(_0x4073de){var _0x402dde=_0xe42806['query'][_0x9432('0x18')]?0x1f4:_0x4073de[_0x9432('0x80')]||0x1f4;logger[_0x9432('0x21')](_0x9432('0x81'),_0x9432('0x61'),_0x402dde,JSON[_0x9432('0x20')](_0x4073de));delete _0x4073de[_0x9432('0x33')];if(_0x402dde===0x191){_0x402dde=0x190;}_0x1bd62e['status'](_0x402dde)[_0x9432('0x82')](_0xe42806[_0x9432('0x3a')][_0x9432('0x18')]?{'message':_0x9432('0x83'),'statusCode':_0x4073de[_0x9432('0x80')]}:_0x4073de);});};
\ No newline at end of file
index 5f3339e..e27ca33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7711=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_salesforce_accounts'];(function(_0x4f8440,_0x21fe5e){var _0x402999=function(_0x4fb44e){while(--_0x4fb44e){_0x4f8440['push'](_0x4f8440['shift']());}};_0x402999(++_0x21fe5e);}(_0x7711,0xcc));var _0x1771=function(_0x3941de,_0x2a9661){_0x3941de=_0x3941de-0x0;var _0x568430=_0x7711[_0x3941de];return _0x568430;};'use strict';var _=require(_0x1771('0x0'));var util=require(_0x1771('0x1'));var logger=require('../../config/logger')(_0x1771('0x2'));var moment=require(_0x1771('0x3'));var BPromise=require('bluebird');var rp=require(_0x1771('0x4'));var fs=require('fs');var path=require(_0x1771('0x5'));var rimraf=require(_0x1771('0x6'));var config=require(_0x1771('0x7'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x1771('0x8'));module[_0x1771('0x9')]=function(_0x256a4e,_0x244df5){return _0x256a4e[_0x1771('0xa')]('SalesforceAccount',attributes,{'tableName':_0x1771('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc8a7=['moment','bluebird','path','rimraf','./intSalesforceAccount.attributes','exports','util','api'];(function(_0x44ff66,_0x27f548){var _0x136331=function(_0x4c14b5){while(--_0x4c14b5){_0x44ff66['push'](_0x44ff66['shift']());}};_0x136331(++_0x27f548);}(_0xc8a7,0x7e));var _0x7c8a=function(_0x2eb123,_0x197b53){_0x2eb123=_0x2eb123-0x0;var _0x1f616d=_0xc8a7[_0x2eb123];return _0x1f616d;};'use strict';var _=require('lodash');var util=require(_0x7c8a('0x0'));var logger=require('../../config/logger')(_0x7c8a('0x1'));var moment=require(_0x7c8a('0x2'));var BPromise=require(_0x7c8a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c8a('0x4'));var rimraf=require(_0x7c8a('0x5'));var config=require('../../config/environment');var attributes=require(_0x7c8a('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x7c8a('0x7')]=function(_0x18dcc4,_0x2f861d){return _0x18dcc4['define']('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aff9853..52423d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41bb=['../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetSalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowSalesforceAccount','SalesforceAccount','where','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5df88f,_0x2aeb0a){var _0x122de8=function(_0x1d0ad0){while(--_0x1d0ad0){_0x5df88f['push'](_0x5df88f['shift']());}};_0x122de8(++_0x2aeb0a);}(_0x41bb,0xc5));var _0xb41b=function(_0x2bf899,_0x433fe3){_0x2bf899=_0x2bf899-0x0;var _0x27aeca=_0x41bb[_0x2bf899];return _0x27aeca;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var moment=require('moment');var BPromise=require(_0xb41b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb41b('0x3'));var db=require(_0xb41b('0x4'))['db'];var utils=require(_0xb41b('0x5'));var logger=require(_0xb41b('0x6'))('rpc');var config=require(_0xb41b('0x7'));var jayson=require(_0xb41b('0x8'));var client=jayson[_0xb41b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5455ce,_0x497242,_0x2704f0){return new BPromise(function(_0x29c30d,_0x53722a){return client[_0xb41b('0xa')](_0x5455ce,_0x2704f0)[_0xb41b('0xb')](function(_0x11b8b2){logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));logger[_0xb41b('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x497242,_0xb41b('0xe'),JSON['stringify'](_0x11b8b2));if(_0x11b8b2[_0xb41b('0x10')]){if(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x11')]===0x1f4){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error'][_0xb41b('0x12')]);return _0x53722a(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x12')]);}logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error']['message']);return _0x29c30d(_0x11b8b2['error'][_0xb41b('0x12')]);}else{logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));_0x29c30d(_0x11b8b2[_0xb41b('0x13')]['message']);}})[_0xb41b('0x14')](function(_0xd0b6b5){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0xd0b6b5);_0x53722a(_0xd0b6b5);});});}exports[_0xb41b('0x15')]=function(_0x47154d){var _0x198783=this;return new Promise(function(_0x5df8c2,_0x4b3580){return db['SalesforceAccount'][_0xb41b('0x16')]({'raw':_0x47154d['options']?_0x47154d[_0xb41b('0x17')][_0xb41b('0x18')]===undefined?!![]:![]:!![],'where':_0x47154d[_0xb41b('0x17')]?_0x47154d['options']['where']||null:null,'attributes':_0x47154d[_0xb41b('0x17')]?_0x47154d[_0xb41b('0x17')][_0xb41b('0x19')]||null:null,'limit':_0x47154d[_0xb41b('0x17')]?_0x47154d[_0xb41b('0x17')][_0xb41b('0x1a')]||null:null,'include':_0x47154d['options']?_0x47154d['options'][_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x47154d[_0xb41b('0x17')]['include'],function(_0x14e9c8){return{'model':db[_0x14e9c8[_0xb41b('0x1d')]],'as':_0x14e9c8['as'],'attributes':_0x14e9c8['attributes'],'include':_0x14e9c8[_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x14e9c8['include'],function(_0xed3c7e){return{'model':db[_0xed3c7e['model']],'as':_0xed3c7e['as'],'attributes':_0xed3c7e[_0xb41b('0x19')],'include':_0xed3c7e[_0xb41b('0x1b')]?_['map'](_0xed3c7e[_0xb41b('0x1b')],function(_0x4265b8){return{'model':db[_0x4265b8['model']],'as':_0x4265b8['as'],'attributes':_0x4265b8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb41b('0xb')](function(_0x46aecf){logger[_0xb41b('0xc')](_0xb41b('0x15'),_0x47154d);logger[_0xb41b('0xf')](_0xb41b('0x15'),_0x47154d,JSON[_0xb41b('0x1e')](_0x46aecf));_0x5df8c2(_0x46aecf);})['catch'](function(_0x26ef96){logger[_0xb41b('0x10')]('GetSalesforceAccount',_0x26ef96[_0xb41b('0x12')],_0x47154d);_0x4b3580(_0x198783['error'](0x1f4,_0x26ef96[_0xb41b('0x12')]));});});};exports[_0xb41b('0x1f')]=function(_0x597a35){var _0x23a6ed=this;return new Promise(function(_0x4a95e7,_0x29da9f){return db[_0xb41b('0x20')]['find']({'raw':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x18')]===undefined?!![]:![]:!![],'where':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x21')]||null:null,'attributes':_0x597a35[_0xb41b('0x17')]?_0x597a35[_0xb41b('0x17')][_0xb41b('0x19')]||null:null,'include':_0x597a35[_0xb41b('0x17')]?_0x597a35['options'][_0xb41b('0x1b')]?_['map'](_0x597a35['options'][_0xb41b('0x1b')],function(_0x192ceb){return{'model':db[_0x192ceb[_0xb41b('0x1d')]],'as':_0x192ceb['as'],'attributes':_0x192ceb[_0xb41b('0x19')],'include':_0x192ceb[_0xb41b('0x1b')]?_[_0xb41b('0x1c')](_0x192ceb[_0xb41b('0x1b')],function(_0x197197){return{'model':db[_0x197197[_0xb41b('0x1d')]],'as':_0x197197['as'],'attributes':_0x197197[_0xb41b('0x19')],'include':_0x197197[_0xb41b('0x1b')]?_['map'](_0x197197[_0xb41b('0x1b')],function(_0x27990d){return{'model':db[_0x27990d[_0xb41b('0x1d')]],'as':_0x27990d['as'],'attributes':_0x27990d[_0xb41b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb41b('0xb')](function(_0x10b3f6){logger['info']('ShowSalesforceAccount',_0x597a35);logger[_0xb41b('0xf')](_0xb41b('0x1f'),_0x597a35,JSON['stringify'](_0x10b3f6));_0x4a95e7(_0x10b3f6);})[_0xb41b('0x14')](function(_0x47363e){logger[_0xb41b('0x10')](_0xb41b('0x1f'),_0x47363e[_0xb41b('0x12')],_0x597a35);_0x29da9f(_0x23a6ed['error'](0x1f4,_0x47363e[_0xb41b('0x12')]));});});};
\ No newline at end of file
+var _0xf3cd=['find','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x311e77,_0x49a459){_0x311e77=_0x311e77-0x0;var _0x559c54=_0xf3cd[_0x311e77];return _0x559c54;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});}exports[_0xdf3c('0x17')]=function(_0x465e7d){var _0xf1da1f=this;return new Promise(function(_0x18d4ec,_0x1e2690){return db[_0xdf3c('0x18')][_0xdf3c('0x19')]({'raw':_0x465e7d[_0xdf3c('0x1a')]?_0x465e7d[_0xdf3c('0x1a')][_0xdf3c('0x1b')]===undefined?!![]:![]:!![],'where':_0x465e7d[_0xdf3c('0x1a')]?_0x465e7d[_0xdf3c('0x1a')][_0xdf3c('0x1c')]||null:null,'attributes':_0x465e7d['options']?_0x465e7d['options'][_0xdf3c('0x1d')]||null:null,'limit':_0x465e7d['options']?_0x465e7d[_0xdf3c('0x1a')][_0xdf3c('0x1e')]||null:null,'include':_0x465e7d[_0xdf3c('0x1a')]?_0x465e7d[_0xdf3c('0x1a')][_0xdf3c('0x1f')]?_[_0xdf3c('0x20')](_0x465e7d['options'][_0xdf3c('0x1f')],function(_0x213d75){return{'model':db[_0x213d75[_0xdf3c('0x21')]],'as':_0x213d75['as'],'attributes':_0x213d75[_0xdf3c('0x1d')],'include':_0x213d75[_0xdf3c('0x1f')]?_[_0xdf3c('0x20')](_0x213d75[_0xdf3c('0x1f')],function(_0x155f54){return{'model':db[_0x155f54[_0xdf3c('0x21')]],'as':_0x155f54['as'],'attributes':_0x155f54[_0xdf3c('0x1d')],'include':_0x155f54['include']?_[_0xdf3c('0x20')](_0x155f54[_0xdf3c('0x1f')],function(_0x4b57a4){return{'model':db[_0x4b57a4[_0xdf3c('0x21')]],'as':_0x4b57a4['as'],'attributes':_0x4b57a4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x508be9){logger[_0xdf3c('0xc')](_0xdf3c('0x17'),_0x465e7d);logger['debug']('GetSalesforceAccount',_0x465e7d,JSON[_0xdf3c('0x10')](_0x508be9));_0x18d4ec(_0x508be9);})[_0xdf3c('0x16')](function(_0xd3cfcb){logger[_0xdf3c('0x11')]('GetSalesforceAccount',_0xd3cfcb[_0xdf3c('0x14')],_0x465e7d);_0x1e2690(_0xf1da1f[_0xdf3c('0x11')](0x1f4,_0xd3cfcb['message']));});});};exports['ShowSalesforceAccount']=function(_0x1f1d8a){var _0x46f0e3=this;return new Promise(function(_0x36937e,_0x540f3a){return db[_0xdf3c('0x18')][_0xdf3c('0x22')]({'raw':_0x1f1d8a[_0xdf3c('0x1a')]?_0x1f1d8a[_0xdf3c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1f1d8a[_0xdf3c('0x1a')]?_0x1f1d8a[_0xdf3c('0x1a')]['where']||null:null,'attributes':_0x1f1d8a[_0xdf3c('0x1a')]?_0x1f1d8a[_0xdf3c('0x1a')][_0xdf3c('0x1d')]||null:null,'include':_0x1f1d8a[_0xdf3c('0x1a')]?_0x1f1d8a['options'][_0xdf3c('0x1f')]?_[_0xdf3c('0x20')](_0x1f1d8a[_0xdf3c('0x1a')][_0xdf3c('0x1f')],function(_0x4c1f49){return{'model':db[_0x4c1f49[_0xdf3c('0x21')]],'as':_0x4c1f49['as'],'attributes':_0x4c1f49[_0xdf3c('0x1d')],'include':_0x4c1f49['include']?_['map'](_0x4c1f49[_0xdf3c('0x1f')],function(_0x588d02){return{'model':db[_0x588d02[_0xdf3c('0x21')]],'as':_0x588d02['as'],'attributes':_0x588d02['attributes'],'include':_0x588d02['include']?_['map'](_0x588d02[_0xdf3c('0x1f')],function(_0x2ee9ad){return{'model':db[_0x2ee9ad[_0xdf3c('0x21')]],'as':_0x2ee9ad['as'],'attributes':_0x2ee9ad[_0xdf3c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49f147){logger[_0xdf3c('0xc')]('ShowSalesforceAccount',_0x1f1d8a);logger[_0xdf3c('0xe')](_0xdf3c('0x23'),_0x1f1d8a,JSON[_0xdf3c('0x10')](_0x49f147));_0x36937e(_0x49f147);})[_0xdf3c('0x16')](function(_0x1004e9){logger[_0xdf3c('0x11')](_0xdf3c('0x23'),_0x1004e9[_0xdf3c('0x14')],_0x1f1d8a);_0x540f3a(_0x46f0e3[_0xdf3c('0x11')](0x1f4,_0x1004e9['message']));});});};
\ No newline at end of file
index 941b593..e8523ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb687=['/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get'];(function(_0x1bc989,_0x4130ce){var _0x488ead=function(_0xf5c90c){while(--_0xf5c90c){_0x1bc989['push'](_0x1bc989['shift']());}};_0x488ead(++_0x4130ce);}(_0xb687,0xf2));var _0x7b68=function(_0x31a25b,_0x28e46b){_0x31a25b=_0x31a25b-0x0;var _0x1c2b81=_0xb687[_0x31a25b];return _0x1c2b81;};'use strict';var multer=require(_0x7b68('0x0'));var util=require(_0x7b68('0x1'));var path=require(_0x7b68('0x2'));var timeout=require(_0x7b68('0x3'));var express=require('express');var router=express[_0x7b68('0x4')]();var auth=require(_0x7b68('0x5'));var interaction=require(_0x7b68('0x6'));var config=require(_0x7b68('0x7'));var controller=require('./intSalesforceConfiguration.controller');router['get']('/',auth[_0x7b68('0x8')](),controller[_0x7b68('0x9')]);router[_0x7b68('0xa')]('/:id',auth[_0x7b68('0x8')](),controller['show']);router['get'](_0x7b68('0xb'),auth[_0x7b68('0x8')](),controller[_0x7b68('0xc')]);router[_0x7b68('0xa')](_0x7b68('0xd'),auth[_0x7b68('0x8')](),controller['getSubjects']);router[_0x7b68('0xa')](_0x7b68('0xe'),auth[_0x7b68('0x8')](),controller[_0x7b68('0xf')]);router[_0x7b68('0x10')]('/',auth[_0x7b68('0x8')](),controller['create']);router[_0x7b68('0x11')](_0x7b68('0x12'),auth['isAuthenticated'](),controller[_0x7b68('0x13')]);router[_0x7b68('0x14')]('/:id',auth[_0x7b68('0x8')](),controller[_0x7b68('0x15')]);module[_0x7b68('0x16')]=router;
\ No newline at end of file
+var _0xdd35=['/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x4983bc,_0x847e02){var _0x3328ee=function(_0x7cc24b){while(--_0x7cc24b){_0x4983bc['push'](_0x4983bc['shift']());}};_0x3328ee(++_0x847e02);}(_0xdd35,0x103));var _0x5dd3=function(_0x1b083e,_0x236bf0){_0x1b083e=_0x1b083e-0x0;var _0x31fde6=_0xdd35[_0x1b083e];return _0x31fde6;};'use strict';var multer=require(_0x5dd3('0x0'));var util=require(_0x5dd3('0x1'));var path=require(_0x5dd3('0x2'));var timeout=require(_0x5dd3('0x3'));var express=require('express');var router=express[_0x5dd3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5dd3('0x5'));var config=require(_0x5dd3('0x6'));var controller=require('./intSalesforceConfiguration.controller');router['get']('/',auth[_0x5dd3('0x7')](),controller[_0x5dd3('0x8')]);router[_0x5dd3('0x9')](_0x5dd3('0xa'),auth[_0x5dd3('0x7')](),controller[_0x5dd3('0xb')]);router[_0x5dd3('0x9')](_0x5dd3('0xc'),auth[_0x5dd3('0x7')](),controller[_0x5dd3('0xd')]);router[_0x5dd3('0x9')](_0x5dd3('0xe'),auth[_0x5dd3('0x7')](),controller[_0x5dd3('0xf')]);router['get'](_0x5dd3('0x10'),auth[_0x5dd3('0x7')](),controller[_0x5dd3('0x11')]);router[_0x5dd3('0x12')]('/',auth[_0x5dd3('0x7')](),controller[_0x5dd3('0x13')]);router[_0x5dd3('0x14')](_0x5dd3('0xa'),auth[_0x5dd3('0x7')](),controller[_0x5dd3('0x15')]);router[_0x5dd3('0x16')](_0x5dd3('0xa'),auth[_0x5dd3('0x7')](),controller[_0x5dd3('0x17')]);module[_0x5dd3('0x18')]=router;
\ No newline at end of file
index ce12f00..31d25c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9530=['lead','nothing','sequelize','exports','STRING','Case','Task','ENUM','contact_lead','contact'];(function(_0x1e2f76,_0xbc23ca){var _0x3cd411=function(_0x21f486){while(--_0x21f486){_0x1e2f76['push'](_0x1e2f76['shift']());}};_0x3cd411(++_0xbc23ca);}(_0x9530,0x14c));var _0x0953=function(_0x10da04,_0x3026a8){_0x10da04=_0x10da04-0x0;var _0x10b161=_0x9530[_0x10da04];return _0x10b161;};'use strict';var Sequelize=require(_0x0953('0x0'));module[_0x0953('0x1')]={'name':{'type':Sequelize[_0x0953('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM']('Task',_0x0953('0x3')),'defaultValue':_0x0953('0x4')},'moduleSearch':{'type':Sequelize[_0x0953('0x5')](_0x0953('0x6'),_0x0953('0x7'),_0x0953('0x8')),'defaultValue':_0x0953('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x0953('0x9'),_0x0953('0x7'),_0x0953('0x8')),'defaultValue':_0x0953('0x8')}};
\ No newline at end of file
+var _0x9110=['Task','contact_lead','contact','lead','nothing','exports','STRING','Case'];(function(_0x36258f,_0x4ae350){var _0x259dd3=function(_0x3d7c65){while(--_0x3d7c65){_0x36258f['push'](_0x36258f['shift']());}};_0x259dd3(++_0x4ae350);}(_0x9110,0xa5));var _0x0911=function(_0x14b2d0,_0x303cc0){_0x14b2d0=_0x14b2d0-0x0;var _0x345d35=_0x9110[_0x14b2d0];return _0x345d35;};'use strict';var Sequelize=require('sequelize');module[_0x0911('0x0')]={'name':{'type':Sequelize[_0x0911('0x1')]},'description':{'type':Sequelize[_0x0911('0x1')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x0911('0x2')),'defaultValue':_0x0911('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x0911('0x4'),_0x0911('0x5'),_0x0911('0x6')),'defaultValue':_0x0911('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x0911('0x7'),'contact',_0x0911('0x6')),'defaultValue':_0x0911('0x6')}};
\ No newline at end of file
index 9de39d6..b0661d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b1d=['includeAll','include','findAll','show','params','rawAttributes','find','create','body','getFields','SalesforceField','hasOwnProperty','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','index','map','SalesforceConfiguration','type','key','model','name','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options'];(function(_0x3f6d25,_0x3eb6a8){var _0x312419=function(_0x2a5ac1){while(--_0x2a5ac1){_0x3f6d25['push'](_0x3f6d25['shift']());}};_0x312419(++_0x3eb6a8);}(_0x6b1d,0xc9));var _0xd6b1=function(_0x2074b3,_0x54589c){_0x2074b3=_0x2074b3-0x0;var _0x3529e7=_0x6b1d[_0x2074b3];return _0x3529e7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd6b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd6b1('0x1'));var jsonpatch=require(_0xd6b1('0x2'));var rp=require(_0xd6b1('0x3'));var moment=require(_0xd6b1('0x4'));var BPromise=require(_0xd6b1('0x5'));var Mustache=require('mustache');var util=require(_0xd6b1('0x6'));var path=require('path');var sox=require(_0xd6b1('0x7'));var csv=require(_0xd6b1('0x8'));var ejs=require(_0xd6b1('0x9'));var fs=require('fs');var _=require(_0xd6b1('0xa'));var squel=require(_0xd6b1('0xb'));var crypto=require(_0xd6b1('0xc'));var jsforce=require(_0xd6b1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd6b1('0x8'));var querystring=require(_0xd6b1('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd6b1('0xf'));var qs=require(_0xd6b1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6b1('0x11'));var logger=require(_0xd6b1('0x12'))(_0xd6b1('0x13'));var utils=require(_0xd6b1('0x14'));var config=require(_0xd6b1('0x15'));var db=require(_0xd6b1('0x16'))['db'];var jayson=require(_0xd6b1('0x17'));var client=jayson[_0xd6b1('0x18')][_0xd6b1('0x19')]({'port':0x232a});function checkPasswordPattern(_0x1a2341,_0x2c3269,_0x506f09){if(_0x506f09){var _0x20210b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20210b[_0xd6b1('0x1a')](_0x2c3269)){return _0x1a2341;}else{throw new db[(_0xd6b1('0x1b'))][(_0xd6b1('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1a2341;}}function respondWithRpcPromise(_0x2ca32b,_0x26a6ad,_0x5115ff,_0x426e9e){return new BPromise(function(_0x2ad390,_0x25452e){var _0x563651=_0x426e9e||client;return _0x563651[_0xd6b1('0x1d')](_0x2ca32b,_0x5115ff)[_0xd6b1('0x1e')](function(_0x3cbdfe){logger[_0xd6b1('0x1f')](_0xd6b1('0x20'),_0x26a6ad,'request\x20sent');logger[_0xd6b1('0x21')](_0xd6b1('0x22'),_0x26a6ad,'request\x20sent',JSON[_0xd6b1('0x23')](_0x3cbdfe));if(_0x3cbdfe['error']){if(_0x3cbdfe['error'][_0xd6b1('0x24')]===0x1f4){logger[_0xd6b1('0x25')]('SalesforceConfiguration,\x20%s,\x20%s',_0x26a6ad,_0x3cbdfe[_0xd6b1('0x25')][_0xd6b1('0x26')]);return _0x25452e(_0x3cbdfe['error'][_0xd6b1('0x26')]);}logger[_0xd6b1('0x25')](_0xd6b1('0x20'),_0x26a6ad,_0x3cbdfe[_0xd6b1('0x25')][_0xd6b1('0x26')]);return _0x2ad390(_0x3cbdfe['error'][_0xd6b1('0x26')]);}else{logger[_0xd6b1('0x1f')]('SalesforceConfiguration,\x20%s,\x20%s',_0x26a6ad,_0xd6b1('0x27'));_0x2ad390(_0x3cbdfe[_0xd6b1('0x28')][_0xd6b1('0x26')]);}})[_0xd6b1('0x29')](function(_0x44c160){logger[_0xd6b1('0x25')](_0xd6b1('0x20'),_0x26a6ad,_0x44c160);_0x25452e(_0x44c160);});});}function respondWithStatusCode(_0x88a845,_0x522c1e){_0x522c1e=_0x522c1e||0xcc;return function(_0x2bee7b){if(_0x2bee7b){return _0x88a845[_0xd6b1('0x2a')](_0x522c1e);}return _0x88a845[_0xd6b1('0x2b')](_0x522c1e)[_0xd6b1('0x2c')]();};}function respondWithResult(_0xd01925,_0x3a40a8){_0x3a40a8=_0x3a40a8||0xc8;return function(_0x3fbfdf){if(_0x3fbfdf){return _0xd01925[_0xd6b1('0x2b')](_0x3a40a8)[_0xd6b1('0x2d')](_0x3fbfdf);}};}function respondWithFilteredResult(_0x72fbe0,_0x35298f){return function(_0x102ca1){if(_0x102ca1){var _0xd1280f=_0x102ca1[_0xd6b1('0x2e')],_0x5c69e2=_0x35298f['offset'],_0x1f7cc9=_0x35298f[_0xd6b1('0x2f')]+_0x35298f[_0xd6b1('0x30')],_0x343c29;if(_0x1f7cc9>=_0xd1280f){_0x1f7cc9=_0xd1280f;_0x343c29=0xc8;}else{_0x343c29=0xce;}_0x72fbe0[_0xd6b1('0x2b')](_0x343c29);return _0x72fbe0[_0xd6b1('0x31')](_0xd6b1('0x32'),_0x5c69e2+'-'+_0x1f7cc9+'/'+_0xd1280f)[_0xd6b1('0x2d')](_0x102ca1);}return null;};}function patchUpdates(_0x1cfe9a){return function(_0x1ed884){try{jsonpatch['apply'](_0x1ed884,_0x1cfe9a,!![]);}catch(_0x5179a9){return BPromise[_0xd6b1('0x33')](_0x5179a9);}return _0x1ed884[_0xd6b1('0x34')]();};}function saveUpdates(_0x1bd144,_0x3192f0){return function(_0x2d74e1){if(_0x2d74e1){return _0x2d74e1[_0xd6b1('0x35')](_0x1bd144)[_0xd6b1('0x1e')](function(_0x4a1027){return _0x4a1027;});}return null;};}function removeEntity(_0x4df3b1,_0x173ef4){return function(_0xc43c61){if(_0xc43c61){return _0xc43c61[_0xd6b1('0x36')]()[_0xd6b1('0x1e')](function(){_0x4df3b1[_0xd6b1('0x2b')](0xcc)[_0xd6b1('0x2c')]();});}};}function handleEntityNotFound(_0x5aad30,_0x3a7b5f){return function(_0x325673){if(!_0x325673){_0x5aad30[_0xd6b1('0x2a')](0x194);}return _0x325673;};}function handleError(_0x175394,_0x3f2f0e){_0x3f2f0e=_0x3f2f0e||0x1f4;return function(_0x500f80){logger[_0xd6b1('0x25')](_0x500f80[_0xd6b1('0x37')]);if(_0x500f80['name']){delete _0x500f80['name'];}_0x175394['status'](_0x3f2f0e)['send'](_0x500f80);};}exports[_0xd6b1('0x38')]=function(_0x2898b5,_0x398150){var _0x2b02dc={},_0x21d248={},_0x14cd4e={'count':0x0,'rows':[]};var _0x2c030d=_[_0xd6b1('0x39')](db[_0xd6b1('0x3a')]['rawAttributes'],function(_0x202d98){return{'name':_0x202d98['fieldName'],'type':_0x202d98[_0xd6b1('0x3b')][_0xd6b1('0x3c')]};});_0x21d248[_0xd6b1('0x3d')]=_['map'](_0x2c030d,_0xd6b1('0x3e'));_0x21d248['query']=_[_0xd6b1('0x3f')](_0x2898b5['query']);_0x21d248['filters']=_['intersection'](_0x21d248[_0xd6b1('0x3d')],_0x21d248[_0xd6b1('0x40')]);_0x2b02dc[_0xd6b1('0x41')]=_[_0xd6b1('0x42')](_0x21d248['model'],qs[_0xd6b1('0x43')](_0x2898b5[_0xd6b1('0x40')][_0xd6b1('0x43')]));_0x2b02dc[_0xd6b1('0x41')]=_0x2b02dc[_0xd6b1('0x41')][_0xd6b1('0x44')]?_0x2b02dc['attributes']:_0x21d248['model'];if(!_0x2898b5['query']['hasOwnProperty'](_0xd6b1('0x45'))){_0x2b02dc[_0xd6b1('0x30')]=qs[_0xd6b1('0x30')](_0x2898b5[_0xd6b1('0x40')][_0xd6b1('0x30')]);_0x2b02dc[_0xd6b1('0x2f')]=qs[_0xd6b1('0x2f')](_0x2898b5[_0xd6b1('0x40')][_0xd6b1('0x2f')]);}_0x2b02dc[_0xd6b1('0x46')]=qs['sort'](_0x2898b5[_0xd6b1('0x40')][_0xd6b1('0x47')]);_0x2b02dc[_0xd6b1('0x48')]=qs[_0xd6b1('0x49')](_[_0xd6b1('0x4a')](_0x2898b5[_0xd6b1('0x40')],_0x21d248['filters']),_0x2c030d);if(_0x2898b5[_0xd6b1('0x40')][_0xd6b1('0x4b')]){_0x2b02dc['where']=_[_0xd6b1('0x4c')](_0x2b02dc[_0xd6b1('0x48')],{'$or':_[_0xd6b1('0x39')](_0x2c030d,function(_0x114840){if(_0x114840['type']!=='VIRTUAL'){var _0x208a4b={};_0x208a4b[_0x114840[_0xd6b1('0x3e')]]={'$like':'%'+_0x2898b5['query'][_0xd6b1('0x4b')]+'%'};return _0x208a4b;}})});}_0x2b02dc=_[_0xd6b1('0x4c')]({},_0x2b02dc,_0x2898b5[_0xd6b1('0x4d')]);var _0x5cfcb8={'where':_0x2b02dc['where']};return db[_0xd6b1('0x3a')]['count'](_0x5cfcb8)['then'](function(_0x56f5ec){_0x14cd4e['count']=_0x56f5ec;if(_0x2898b5['query'][_0xd6b1('0x4e')]){_0x2b02dc[_0xd6b1('0x4f')]=[{'all':!![]}];}return db[_0xd6b1('0x3a')][_0xd6b1('0x50')](_0x2b02dc);})[_0xd6b1('0x1e')](function(_0x1e957f){_0x14cd4e['rows']=_0x1e957f;return _0x14cd4e;})[_0xd6b1('0x1e')](respondWithFilteredResult(_0x398150,_0x2b02dc))[_0xd6b1('0x29')](handleError(_0x398150,null));};exports[_0xd6b1('0x51')]=function(_0x1a2a93,_0x12ad7f){var _0x2d568c={'raw':![],'where':{'id':_0x1a2a93[_0xd6b1('0x52')]['id']}},_0x2bd643={};_0x2bd643[_0xd6b1('0x3d')]=_[_0xd6b1('0x3f')](db[_0xd6b1('0x3a')][_0xd6b1('0x53')]);_0x2bd643[_0xd6b1('0x40')]=_[_0xd6b1('0x3f')](_0x1a2a93[_0xd6b1('0x40')]);_0x2bd643[_0xd6b1('0x49')]=_[_0xd6b1('0x42')](_0x2bd643[_0xd6b1('0x3d')],_0x2bd643[_0xd6b1('0x40')]);_0x2d568c[_0xd6b1('0x41')]=_[_0xd6b1('0x42')](_0x2bd643[_0xd6b1('0x3d')],qs[_0xd6b1('0x43')](_0x1a2a93['query'][_0xd6b1('0x43')]));_0x2d568c[_0xd6b1('0x41')]=_0x2d568c[_0xd6b1('0x41')][_0xd6b1('0x44')]?_0x2d568c['attributes']:_0x2bd643[_0xd6b1('0x3d')];if(_0x1a2a93[_0xd6b1('0x40')][_0xd6b1('0x4e')]){_0x2d568c[_0xd6b1('0x4f')]=[{'all':!![]}];}_0x2d568c=_['merge']({},_0x2d568c,_0x1a2a93[_0xd6b1('0x4d')]);return db[_0xd6b1('0x3a')][_0xd6b1('0x54')](_0x2d568c)[_0xd6b1('0x1e')](handleEntityNotFound(_0x12ad7f,null))[_0xd6b1('0x1e')](respondWithResult(_0x12ad7f,null))[_0xd6b1('0x29')](handleError(_0x12ad7f,null));};exports['create']=function(_0x2f4a9f,_0x5b2f4d){return db[_0xd6b1('0x3a')][_0xd6b1('0x55')](_0x2f4a9f[_0xd6b1('0x56')],{})['then'](respondWithResult(_0x5b2f4d,0xc9))['catch'](handleError(_0x5b2f4d,null));};exports['update']=function(_0x12a642,_0x35b515){if(_0x12a642[_0xd6b1('0x56')]['id']){delete _0x12a642[_0xd6b1('0x56')]['id'];}return db[_0xd6b1('0x3a')]['find']({'where':{'id':_0x12a642[_0xd6b1('0x52')]['id']}})[_0xd6b1('0x1e')](handleEntityNotFound(_0x35b515,null))[_0xd6b1('0x1e')](saveUpdates(_0x12a642[_0xd6b1('0x56')],null))[_0xd6b1('0x1e')](respondWithResult(_0x35b515,null))[_0xd6b1('0x29')](handleError(_0x35b515,null));};exports[_0xd6b1('0x36')]=function(_0x39aa54,_0x3c005f){return db[_0xd6b1('0x3a')][_0xd6b1('0x54')]({'where':{'id':_0x39aa54[_0xd6b1('0x52')]['id']}})[_0xd6b1('0x1e')](handleEntityNotFound(_0x3c005f,null))[_0xd6b1('0x1e')](removeEntity(_0x3c005f,null))[_0xd6b1('0x29')](handleError(_0x3c005f,null));};exports[_0xd6b1('0x57')]=function(_0x2c17f3,_0x5e8bac,_0xaaf2d5){var _0x1a850e={};var _0x3c4dcc={};var _0x98da8b;var _0x474bd2;return db[_0xd6b1('0x3a')]['findOne']({'where':{'id':_0x2c17f3['params']['id']}})[_0xd6b1('0x1e')](handleEntityNotFound(_0x5e8bac,null))[_0xd6b1('0x1e')](function(_0x5e5ede){if(_0x5e5ede){_0x98da8b=_0x5e5ede;_0x3c4dcc[_0xd6b1('0x3d')]=_[_0xd6b1('0x3f')](db[_0xd6b1('0x58')]['rawAttributes']);_0x3c4dcc[_0xd6b1('0x40')]=_[_0xd6b1('0x3f')](_0x2c17f3[_0xd6b1('0x40')]);_0x3c4dcc[_0xd6b1('0x49')]=_[_0xd6b1('0x42')](_0x3c4dcc[_0xd6b1('0x3d')],_0x3c4dcc[_0xd6b1('0x40')]);_0x1a850e[_0xd6b1('0x41')]=_[_0xd6b1('0x42')](_0x3c4dcc['model'],qs['fields'](_0x2c17f3[_0xd6b1('0x40')][_0xd6b1('0x43')]));_0x1a850e[_0xd6b1('0x41')]=_0x1a850e['attributes'][_0xd6b1('0x44')]?_0x1a850e[_0xd6b1('0x41')]:_0x3c4dcc['model'];_0x1a850e[_0xd6b1('0x46')]=qs[_0xd6b1('0x47')](_0x2c17f3[_0xd6b1('0x40')][_0xd6b1('0x47')]);_0x1a850e[_0xd6b1('0x48')]=qs['filters'](_[_0xd6b1('0x4a')](_0x2c17f3[_0xd6b1('0x40')],_0x3c4dcc['filters']));if(_0x2c17f3[_0xd6b1('0x40')]['filter']){_0x1a850e[_0xd6b1('0x48')]=_[_0xd6b1('0x4c')](_0x1a850e[_0xd6b1('0x48')],{'$or':_[_0xd6b1('0x39')](_0x1a850e['attributes'],function(_0x370620){var _0x163981={};_0x163981[_0x370620]={'$like':'%'+_0x2c17f3[_0xd6b1('0x40')][_0xd6b1('0x4b')]+'%'};return _0x163981;})});}_0x1a850e=_[_0xd6b1('0x4c')]({},_0x1a850e,_0x2c17f3[_0xd6b1('0x4d')]);return _0x98da8b[_0xd6b1('0x57')](_0x1a850e);}})['then'](function(_0x4e5b25){if(_0x4e5b25){_0x474bd2=_0x4e5b25[_0xd6b1('0x44')];if(!_0x2c17f3[_0xd6b1('0x40')][_0xd6b1('0x59')](_0xd6b1('0x45'))){_0x1a850e[_0xd6b1('0x30')]=qs[_0xd6b1('0x30')](_0x2c17f3['query'][_0xd6b1('0x30')]);_0x1a850e[_0xd6b1('0x2f')]=qs[_0xd6b1('0x2f')](_0x2c17f3[_0xd6b1('0x40')][_0xd6b1('0x2f')]);}return _0x98da8b['getFields'](_0x1a850e);}})[_0xd6b1('0x1e')](function(_0x50884b){if(_0x50884b){return _0x50884b?{'count':_0x474bd2,'rows':_0x50884b}:null;}})[_0xd6b1('0x1e')](respondWithResult(_0x5e8bac,null))[_0xd6b1('0x29')](handleError(_0x5e8bac,null));};exports[_0xd6b1('0x5a')]=function(_0x4fa51b,_0x2dd4c7,_0x3c8679){var _0x597438={};var _0x2b808a={};var _0x38ac1c;var _0x103d5c;return db[_0xd6b1('0x3a')][_0xd6b1('0x5b')]({'where':{'id':_0x4fa51b['params']['id']}})[_0xd6b1('0x1e')](handleEntityNotFound(_0x2dd4c7,null))[_0xd6b1('0x1e')](function(_0x1d3045){if(_0x1d3045){_0x38ac1c=_0x1d3045;_0x2b808a['model']=_[_0xd6b1('0x3f')](db[_0xd6b1('0x58')][_0xd6b1('0x53')]);_0x2b808a[_0xd6b1('0x40')]=_[_0xd6b1('0x3f')](_0x4fa51b[_0xd6b1('0x40')]);_0x2b808a[_0xd6b1('0x49')]=_[_0xd6b1('0x42')](_0x2b808a['model'],_0x2b808a['query']);_0x597438[_0xd6b1('0x41')]=_['intersection'](_0x2b808a[_0xd6b1('0x3d')],qs[_0xd6b1('0x43')](_0x4fa51b[_0xd6b1('0x40')]['fields']));_0x597438[_0xd6b1('0x41')]=_0x597438['attributes'][_0xd6b1('0x44')]?_0x597438[_0xd6b1('0x41')]:_0x2b808a[_0xd6b1('0x3d')];_0x597438[_0xd6b1('0x46')]=qs[_0xd6b1('0x47')](_0x4fa51b[_0xd6b1('0x40')][_0xd6b1('0x47')]);_0x597438[_0xd6b1('0x48')]=qs['filters'](_[_0xd6b1('0x4a')](_0x4fa51b[_0xd6b1('0x40')],_0x2b808a[_0xd6b1('0x49')]));if(_0x4fa51b[_0xd6b1('0x40')]['filter']){_0x597438['where']=_['merge'](_0x597438[_0xd6b1('0x48')],{'$or':_['map'](_0x597438['attributes'],function(_0x55e38d){var _0x4065cc={};_0x4065cc[_0x55e38d]={'$like':'%'+_0x4fa51b[_0xd6b1('0x40')][_0xd6b1('0x4b')]+'%'};return _0x4065cc;})});}_0x597438=_[_0xd6b1('0x4c')]({},_0x597438,_0x4fa51b[_0xd6b1('0x4d')]);return _0x38ac1c['getSubjects'](_0x597438);}})[_0xd6b1('0x1e')](function(_0x3b0f83){if(_0x3b0f83){_0x103d5c=_0x3b0f83[_0xd6b1('0x44')];if(!_0x4fa51b[_0xd6b1('0x40')][_0xd6b1('0x59')](_0xd6b1('0x45'))){_0x597438['limit']=qs[_0xd6b1('0x30')](_0x4fa51b[_0xd6b1('0x40')][_0xd6b1('0x30')]);_0x597438['offset']=qs[_0xd6b1('0x2f')](_0x4fa51b[_0xd6b1('0x40')]['offset']);}return _0x38ac1c['getSubjects'](_0x597438);}})[_0xd6b1('0x1e')](function(_0x4d11a4){if(_0x4d11a4){return _0x4d11a4?{'count':_0x103d5c,'rows':_0x4d11a4}:null;}})[_0xd6b1('0x1e')](respondWithResult(_0x2dd4c7,null))[_0xd6b1('0x29')](handleError(_0x2dd4c7,null));};exports[_0xd6b1('0x5c')]=function(_0x3c2e43,_0x34ec1b,_0x659201){var _0x3804ac={};var _0x422c2b={};var _0xfbdaf5;var _0x3b1539;return db[_0xd6b1('0x3a')][_0xd6b1('0x5b')]({'where':{'id':_0x3c2e43['params']['id']}})[_0xd6b1('0x1e')](handleEntityNotFound(_0x34ec1b,null))['then'](function(_0x1eb637){if(_0x1eb637){_0xfbdaf5=_0x1eb637;_0x422c2b[_0xd6b1('0x3d')]=_[_0xd6b1('0x3f')](db[_0xd6b1('0x58')][_0xd6b1('0x53')]);_0x422c2b[_0xd6b1('0x40')]=_[_0xd6b1('0x3f')](_0x3c2e43['query']);_0x422c2b[_0xd6b1('0x49')]=_[_0xd6b1('0x42')](_0x422c2b['model'],_0x422c2b[_0xd6b1('0x40')]);_0x3804ac[_0xd6b1('0x41')]=_[_0xd6b1('0x42')](_0x422c2b[_0xd6b1('0x3d')],qs['fields'](_0x3c2e43['query'][_0xd6b1('0x43')]));_0x3804ac['attributes']=_0x3804ac[_0xd6b1('0x41')]['length']?_0x3804ac[_0xd6b1('0x41')]:_0x422c2b[_0xd6b1('0x3d')];_0x3804ac['order']=qs['sort'](_0x3c2e43[_0xd6b1('0x40')][_0xd6b1('0x47')]);_0x3804ac[_0xd6b1('0x48')]=qs['filters'](_[_0xd6b1('0x4a')](_0x3c2e43['query'],_0x422c2b[_0xd6b1('0x49')]));if(_0x3c2e43['query'][_0xd6b1('0x4b')]){_0x3804ac[_0xd6b1('0x48')]=_[_0xd6b1('0x4c')](_0x3804ac['where'],{'$or':_[_0xd6b1('0x39')](_0x3804ac['attributes'],function(_0x2a37d5){var _0x394488={};_0x394488[_0x2a37d5]={'$like':'%'+_0x3c2e43['query']['filter']+'%'};return _0x394488;})});}_0x3804ac=_['merge']({},_0x3804ac,_0x3c2e43[_0xd6b1('0x4d')]);return _0xfbdaf5[_0xd6b1('0x5c')](_0x3804ac);}})[_0xd6b1('0x1e')](function(_0x3647fd){if(_0x3647fd){_0x3b1539=_0x3647fd[_0xd6b1('0x44')];if(!_0x3c2e43[_0xd6b1('0x40')]['hasOwnProperty'](_0xd6b1('0x45'))){_0x3804ac[_0xd6b1('0x30')]=qs[_0xd6b1('0x30')](_0x3c2e43[_0xd6b1('0x40')]['limit']);_0x3804ac[_0xd6b1('0x2f')]=qs[_0xd6b1('0x2f')](_0x3c2e43[_0xd6b1('0x40')][_0xd6b1('0x2f')]);}return _0xfbdaf5[_0xd6b1('0x5c')](_0x3804ac);}})[_0xd6b1('0x1e')](function(_0xd4167b){if(_0xd4167b){return _0xd4167b?{'count':_0x3b1539,'rows':_0xd4167b}:null;}})['then'](respondWithResult(_0x34ec1b,null))[_0xd6b1('0x29')](handleError(_0x34ec1b,null));};
\ No newline at end of file
+var _0x49c0=['getFields','getSubjects','nolimit','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','type','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','show','length','find','create','body','params','findOne','SalesforceField'];(function(_0x353777,_0x155c1d){var _0x20fc78=function(_0x388436){while(--_0x388436){_0x353777['push'](_0x353777['shift']());}};_0x20fc78(++_0x155c1d);}(_0x49c0,0x188));var _0x049c=function(_0x23f98d,_0x380bec){_0x23f98d=_0x23f98d-0x0;var _0x15146b=_0x49c0[_0x23f98d];return _0x15146b;};'use strict';var pdf=require(_0x049c('0x0'));var emlformat=require(_0x049c('0x1'));var rimraf=require(_0x049c('0x2'));var zipdir=require(_0x049c('0x3'));var jsonpatch=require(_0x049c('0x4'));var rp=require(_0x049c('0x5'));var moment=require(_0x049c('0x6'));var BPromise=require(_0x049c('0x7'));var Mustache=require(_0x049c('0x8'));var util=require(_0x049c('0x9'));var path=require('path');var sox=require(_0x049c('0xa'));var csv=require(_0x049c('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x049c('0xc'));var squel=require(_0x049c('0xd'));var crypto=require('crypto');var jsforce=require(_0x049c('0xe'));var deskjs=require(_0x049c('0xf'));var toCsv=require(_0x049c('0xb'));var querystring=require(_0x049c('0x10'));var Papa=require(_0x049c('0x11'));var Redis=require(_0x049c('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x049c('0x13'));var hardwareService=require(_0x049c('0x14'));var logger=require(_0x049c('0x15'))('api');var utils=require(_0x049c('0x16'));var config=require(_0x049c('0x17'));var db=require(_0x049c('0x18'))['db'];var jayson=require(_0x049c('0x19'));var client=jayson['client'][_0x049c('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1d1746,_0x37abb7,_0x3081d1){if(_0x3081d1){var _0x1c15e5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c15e5[_0x049c('0x1b')](_0x37abb7)){return _0x1d1746;}else{throw new db[(_0x049c('0x1c'))]['ValidationError'](_0x049c('0x1d'));}}else{return _0x1d1746;}}function respondWithRpcPromise(_0x2bec8b,_0x35c162,_0x290fa5,_0x159dea){return new BPromise(function(_0x246439,_0x44f736){var _0x6379e4=_0x159dea||client;return _0x6379e4[_0x049c('0x1e')](_0x2bec8b,_0x290fa5)['then'](function(_0x4dfa9b){logger[_0x049c('0x1f')](_0x049c('0x20'),_0x35c162,_0x049c('0x21'));logger[_0x049c('0x22')](_0x049c('0x23'),_0x35c162,_0x049c('0x21'),JSON['stringify'](_0x4dfa9b));if(_0x4dfa9b[_0x049c('0x24')]){if(_0x4dfa9b[_0x049c('0x24')][_0x049c('0x25')]===0x1f4){logger[_0x049c('0x24')](_0x049c('0x20'),_0x35c162,_0x4dfa9b['error'][_0x049c('0x26')]);return _0x44f736(_0x4dfa9b[_0x049c('0x24')][_0x049c('0x26')]);}logger['error'](_0x049c('0x20'),_0x35c162,_0x4dfa9b[_0x049c('0x24')][_0x049c('0x26')]);return _0x246439(_0x4dfa9b[_0x049c('0x24')][_0x049c('0x26')]);}else{logger[_0x049c('0x1f')](_0x049c('0x20'),_0x35c162,_0x049c('0x21'));_0x246439(_0x4dfa9b[_0x049c('0x27')][_0x049c('0x26')]);}})[_0x049c('0x28')](function(_0x56789e){logger['error'](_0x049c('0x20'),_0x35c162,_0x56789e);_0x44f736(_0x56789e);});});}function respondWithStatusCode(_0x32142d,_0x1c20b2){_0x1c20b2=_0x1c20b2||0xcc;return function(_0x1353d7){if(_0x1353d7){return _0x32142d[_0x049c('0x29')](_0x1c20b2);}return _0x32142d[_0x049c('0x2a')](_0x1c20b2)[_0x049c('0x2b')]();};}function respondWithResult(_0x214264,_0x43dfc5){_0x43dfc5=_0x43dfc5||0xc8;return function(_0x46c3b2){if(_0x46c3b2){return _0x214264[_0x049c('0x2a')](_0x43dfc5)[_0x049c('0x2c')](_0x46c3b2);}};}function respondWithFilteredResult(_0x1edeee,_0x1cf397){return function(_0x3516cf){if(_0x3516cf){var _0x38271f=_0x3516cf['count'],_0x5c46fa=_0x1cf397[_0x049c('0x2d')],_0x15afa8=_0x1cf397[_0x049c('0x2d')]+_0x1cf397[_0x049c('0x2e')],_0x3d1bd5;if(_0x15afa8>=_0x38271f){_0x15afa8=_0x38271f;_0x3d1bd5=0xc8;}else{_0x3d1bd5=0xce;}_0x1edeee['status'](_0x3d1bd5);return _0x1edeee[_0x049c('0x2f')](_0x049c('0x30'),_0x5c46fa+'-'+_0x15afa8+'/'+_0x38271f)[_0x049c('0x2c')](_0x3516cf);}return null;};}function patchUpdates(_0x58b3a3){return function(_0x2eed0a){try{jsonpatch[_0x049c('0x31')](_0x2eed0a,_0x58b3a3,!![]);}catch(_0xe19905){return BPromise['reject'](_0xe19905);}return _0x2eed0a[_0x049c('0x32')]();};}function saveUpdates(_0x314af5,_0x1f1144){return function(_0xc74609){if(_0xc74609){return _0xc74609[_0x049c('0x33')](_0x314af5)[_0x049c('0x34')](function(_0x3e09fd){return _0x3e09fd;});}return null;};}function removeEntity(_0x20379a,_0x2c9b58){return function(_0xd46d04){if(_0xd46d04){return _0xd46d04[_0x049c('0x35')]()[_0x049c('0x34')](function(){_0x20379a[_0x049c('0x2a')](0xcc)[_0x049c('0x2b')]();});}};}function handleEntityNotFound(_0x29e601,_0x21b0a3){return function(_0x2f3284){if(!_0x2f3284){_0x29e601[_0x049c('0x29')](0x194);}return _0x2f3284;};}function handleError(_0x2444e4,_0x25d5fa){_0x25d5fa=_0x25d5fa||0x1f4;return function(_0x42eea5){logger['error'](_0x42eea5[_0x049c('0x36')]);if(_0x42eea5['name']){delete _0x42eea5[_0x049c('0x37')];}_0x2444e4[_0x049c('0x2a')](_0x25d5fa)[_0x049c('0x38')](_0x42eea5);};}exports[_0x049c('0x39')]=function(_0x4327df,_0x47d4a8){var _0xca9e5b={},_0x298f2d={},_0x28ebca={'count':0x0,'rows':[]};var _0x20a3fd=_[_0x049c('0x3a')](db[_0x049c('0x3b')][_0x049c('0x3c')],function(_0x44eb3f){return{'name':_0x44eb3f[_0x049c('0x3d')],'type':_0x44eb3f['type'][_0x049c('0x3e')]};});_0x298f2d[_0x049c('0x3f')]=_[_0x049c('0x3a')](_0x20a3fd,_0x049c('0x37'));_0x298f2d['query']=_[_0x049c('0x40')](_0x4327df[_0x049c('0x41')]);_0x298f2d[_0x049c('0x42')]=_[_0x049c('0x43')](_0x298f2d[_0x049c('0x3f')],_0x298f2d[_0x049c('0x41')]);_0xca9e5b[_0x049c('0x44')]=_[_0x049c('0x43')](_0x298f2d[_0x049c('0x3f')],qs[_0x049c('0x45')](_0x4327df[_0x049c('0x41')][_0x049c('0x45')]));_0xca9e5b['attributes']=_0xca9e5b[_0x049c('0x44')]['length']?_0xca9e5b[_0x049c('0x44')]:_0x298f2d[_0x049c('0x3f')];if(!_0x4327df[_0x049c('0x41')][_0x049c('0x46')]('nolimit')){_0xca9e5b[_0x049c('0x2e')]=qs[_0x049c('0x2e')](_0x4327df[_0x049c('0x41')][_0x049c('0x2e')]);_0xca9e5b[_0x049c('0x2d')]=qs[_0x049c('0x2d')](_0x4327df[_0x049c('0x41')][_0x049c('0x2d')]);}_0xca9e5b[_0x049c('0x47')]=qs['sort'](_0x4327df[_0x049c('0x41')][_0x049c('0x48')]);_0xca9e5b['where']=qs[_0x049c('0x42')](_[_0x049c('0x49')](_0x4327df[_0x049c('0x41')],_0x298f2d[_0x049c('0x42')]),_0x20a3fd);if(_0x4327df[_0x049c('0x41')]['filter']){_0xca9e5b[_0x049c('0x4a')]=_['merge'](_0xca9e5b['where'],{'$or':_[_0x049c('0x3a')](_0x20a3fd,function(_0x313071){if(_0x313071[_0x049c('0x4b')]!==_0x049c('0x4c')){var _0x44d1c6={};_0x44d1c6[_0x313071[_0x049c('0x37')]]={'$like':'%'+_0x4327df[_0x049c('0x41')][_0x049c('0x4d')]+'%'};return _0x44d1c6;}})});}_0xca9e5b=_[_0x049c('0x4e')]({},_0xca9e5b,_0x4327df[_0x049c('0x4f')]);var _0x27827d={'where':_0xca9e5b[_0x049c('0x4a')]};return db[_0x049c('0x3b')][_0x049c('0x50')](_0x27827d)[_0x049c('0x34')](function(_0x24d2d1){_0x28ebca['count']=_0x24d2d1;if(_0x4327df['query'][_0x049c('0x51')]){_0xca9e5b[_0x049c('0x52')]=[{'all':!![]}];}return db[_0x049c('0x3b')][_0x049c('0x53')](_0xca9e5b);})[_0x049c('0x34')](function(_0x1bf4c0){_0x28ebca[_0x049c('0x54')]=_0x1bf4c0;return _0x28ebca;})[_0x049c('0x34')](respondWithFilteredResult(_0x47d4a8,_0xca9e5b))[_0x049c('0x28')](handleError(_0x47d4a8,null));};exports[_0x049c('0x55')]=function(_0x325b72,_0x1643a7){var _0x18ef9d={'raw':![],'where':{'id':_0x325b72['params']['id']}},_0x5c5802={};_0x5c5802['model']=_[_0x049c('0x40')](db[_0x049c('0x3b')][_0x049c('0x3c')]);_0x5c5802[_0x049c('0x41')]=_[_0x049c('0x40')](_0x325b72[_0x049c('0x41')]);_0x5c5802[_0x049c('0x42')]=_[_0x049c('0x43')](_0x5c5802[_0x049c('0x3f')],_0x5c5802[_0x049c('0x41')]);_0x18ef9d[_0x049c('0x44')]=_[_0x049c('0x43')](_0x5c5802[_0x049c('0x3f')],qs[_0x049c('0x45')](_0x325b72[_0x049c('0x41')]['fields']));_0x18ef9d[_0x049c('0x44')]=_0x18ef9d[_0x049c('0x44')][_0x049c('0x56')]?_0x18ef9d[_0x049c('0x44')]:_0x5c5802['model'];if(_0x325b72[_0x049c('0x41')][_0x049c('0x51')]){_0x18ef9d[_0x049c('0x52')]=[{'all':!![]}];}_0x18ef9d=_[_0x049c('0x4e')]({},_0x18ef9d,_0x325b72['options']);return db[_0x049c('0x3b')][_0x049c('0x57')](_0x18ef9d)[_0x049c('0x34')](handleEntityNotFound(_0x1643a7,null))[_0x049c('0x34')](respondWithResult(_0x1643a7,null))['catch'](handleError(_0x1643a7,null));};exports[_0x049c('0x58')]=function(_0x3c479e,_0x439f3e){return db[_0x049c('0x3b')][_0x049c('0x58')](_0x3c479e[_0x049c('0x59')],{})[_0x049c('0x34')](respondWithResult(_0x439f3e,0xc9))[_0x049c('0x28')](handleError(_0x439f3e,null));};exports[_0x049c('0x33')]=function(_0x596771,_0x182ed2){if(_0x596771['body']['id']){delete _0x596771[_0x049c('0x59')]['id'];}return db[_0x049c('0x3b')][_0x049c('0x57')]({'where':{'id':_0x596771[_0x049c('0x5a')]['id']}})[_0x049c('0x34')](handleEntityNotFound(_0x182ed2,null))[_0x049c('0x34')](saveUpdates(_0x596771[_0x049c('0x59')],null))['then'](respondWithResult(_0x182ed2,null))[_0x049c('0x28')](handleError(_0x182ed2,null));};exports[_0x049c('0x35')]=function(_0x42cc16,_0x761007){return db[_0x049c('0x3b')][_0x049c('0x57')]({'where':{'id':_0x42cc16[_0x049c('0x5a')]['id']}})[_0x049c('0x34')](handleEntityNotFound(_0x761007,null))[_0x049c('0x34')](removeEntity(_0x761007,null))['catch'](handleError(_0x761007,null));};exports['getFields']=function(_0x4dd67d,_0x5da1a8,_0x53d6d3){var _0x63a6cd={};var _0x1e07d9={};var _0x185d75;var _0x17b87e;return db[_0x049c('0x3b')][_0x049c('0x5b')]({'where':{'id':_0x4dd67d[_0x049c('0x5a')]['id']}})[_0x049c('0x34')](handleEntityNotFound(_0x5da1a8,null))['then'](function(_0x47b456){if(_0x47b456){_0x185d75=_0x47b456;_0x1e07d9['model']=_['keys'](db[_0x049c('0x5c')][_0x049c('0x3c')]);_0x1e07d9[_0x049c('0x41')]=_[_0x049c('0x40')](_0x4dd67d[_0x049c('0x41')]);_0x1e07d9[_0x049c('0x42')]=_[_0x049c('0x43')](_0x1e07d9['model'],_0x1e07d9['query']);_0x63a6cd[_0x049c('0x44')]=_[_0x049c('0x43')](_0x1e07d9['model'],qs['fields'](_0x4dd67d[_0x049c('0x41')][_0x049c('0x45')]));_0x63a6cd[_0x049c('0x44')]=_0x63a6cd[_0x049c('0x44')][_0x049c('0x56')]?_0x63a6cd[_0x049c('0x44')]:_0x1e07d9['model'];_0x63a6cd['order']=qs[_0x049c('0x48')](_0x4dd67d['query']['sort']);_0x63a6cd[_0x049c('0x4a')]=qs[_0x049c('0x42')](_[_0x049c('0x49')](_0x4dd67d[_0x049c('0x41')],_0x1e07d9[_0x049c('0x42')]));if(_0x4dd67d[_0x049c('0x41')][_0x049c('0x4d')]){_0x63a6cd[_0x049c('0x4a')]=_[_0x049c('0x4e')](_0x63a6cd[_0x049c('0x4a')],{'$or':_[_0x049c('0x3a')](_0x63a6cd[_0x049c('0x44')],function(_0x118777){var _0x2b0f89={};_0x2b0f89[_0x118777]={'$like':'%'+_0x4dd67d[_0x049c('0x41')][_0x049c('0x4d')]+'%'};return _0x2b0f89;})});}_0x63a6cd=_[_0x049c('0x4e')]({},_0x63a6cd,_0x4dd67d[_0x049c('0x4f')]);return _0x185d75['getFields'](_0x63a6cd);}})['then'](function(_0x4e3f07){if(_0x4e3f07){_0x17b87e=_0x4e3f07[_0x049c('0x56')];if(!_0x4dd67d['query'][_0x049c('0x46')]('nolimit')){_0x63a6cd[_0x049c('0x2e')]=qs['limit'](_0x4dd67d['query'][_0x049c('0x2e')]);_0x63a6cd['offset']=qs['offset'](_0x4dd67d[_0x049c('0x41')][_0x049c('0x2d')]);}return _0x185d75[_0x049c('0x5d')](_0x63a6cd);}})[_0x049c('0x34')](function(_0x4a95b6){if(_0x4a95b6){return _0x4a95b6?{'count':_0x17b87e,'rows':_0x4a95b6}:null;}})[_0x049c('0x34')](respondWithResult(_0x5da1a8,null))[_0x049c('0x28')](handleError(_0x5da1a8,null));};exports[_0x049c('0x5e')]=function(_0x121c7d,_0x1cd456,_0x5104e5){var _0x347e70={};var _0x36ab12={};var _0x53f4e7;var _0x2d49b5;return db[_0x049c('0x3b')][_0x049c('0x5b')]({'where':{'id':_0x121c7d[_0x049c('0x5a')]['id']}})[_0x049c('0x34')](handleEntityNotFound(_0x1cd456,null))[_0x049c('0x34')](function(_0x294c31){if(_0x294c31){_0x53f4e7=_0x294c31;_0x36ab12['model']=_[_0x049c('0x40')](db['SalesforceField']['rawAttributes']);_0x36ab12['query']=_[_0x049c('0x40')](_0x121c7d[_0x049c('0x41')]);_0x36ab12[_0x049c('0x42')]=_[_0x049c('0x43')](_0x36ab12['model'],_0x36ab12[_0x049c('0x41')]);_0x347e70[_0x049c('0x44')]=_[_0x049c('0x43')](_0x36ab12['model'],qs[_0x049c('0x45')](_0x121c7d[_0x049c('0x41')][_0x049c('0x45')]));_0x347e70[_0x049c('0x44')]=_0x347e70[_0x049c('0x44')][_0x049c('0x56')]?_0x347e70[_0x049c('0x44')]:_0x36ab12[_0x049c('0x3f')];_0x347e70[_0x049c('0x47')]=qs[_0x049c('0x48')](_0x121c7d[_0x049c('0x41')][_0x049c('0x48')]);_0x347e70[_0x049c('0x4a')]=qs[_0x049c('0x42')](_[_0x049c('0x49')](_0x121c7d[_0x049c('0x41')],_0x36ab12[_0x049c('0x42')]));if(_0x121c7d['query'][_0x049c('0x4d')]){_0x347e70['where']=_[_0x049c('0x4e')](_0x347e70['where'],{'$or':_[_0x049c('0x3a')](_0x347e70[_0x049c('0x44')],function(_0x369f03){var _0xd45356={};_0xd45356[_0x369f03]={'$like':'%'+_0x121c7d[_0x049c('0x41')][_0x049c('0x4d')]+'%'};return _0xd45356;})});}_0x347e70=_['merge']({},_0x347e70,_0x121c7d['options']);return _0x53f4e7[_0x049c('0x5e')](_0x347e70);}})['then'](function(_0x9751b0){if(_0x9751b0){_0x2d49b5=_0x9751b0[_0x049c('0x56')];if(!_0x121c7d[_0x049c('0x41')][_0x049c('0x46')](_0x049c('0x5f'))){_0x347e70[_0x049c('0x2e')]=qs[_0x049c('0x2e')](_0x121c7d['query'][_0x049c('0x2e')]);_0x347e70[_0x049c('0x2d')]=qs[_0x049c('0x2d')](_0x121c7d['query']['offset']);}return _0x53f4e7[_0x049c('0x5e')](_0x347e70);}})[_0x049c('0x34')](function(_0x506dac){if(_0x506dac){return _0x506dac?{'count':_0x2d49b5,'rows':_0x506dac}:null;}})[_0x049c('0x34')](respondWithResult(_0x1cd456,null))[_0x049c('0x28')](handleError(_0x1cd456,null));};exports[_0x049c('0x60')]=function(_0x368e4,_0x124f69,_0x2a7916){var _0x28e3bc={};var _0x313ac4={};var _0x48eed2;var _0xa9623;return db[_0x049c('0x3b')][_0x049c('0x5b')]({'where':{'id':_0x368e4[_0x049c('0x5a')]['id']}})[_0x049c('0x34')](handleEntityNotFound(_0x124f69,null))[_0x049c('0x34')](function(_0x3ba619){if(_0x3ba619){_0x48eed2=_0x3ba619;_0x313ac4[_0x049c('0x3f')]=_['keys'](db[_0x049c('0x5c')][_0x049c('0x3c')]);_0x313ac4[_0x049c('0x41')]=_[_0x049c('0x40')](_0x368e4[_0x049c('0x41')]);_0x313ac4[_0x049c('0x42')]=_[_0x049c('0x43')](_0x313ac4[_0x049c('0x3f')],_0x313ac4['query']);_0x28e3bc[_0x049c('0x44')]=_['intersection'](_0x313ac4[_0x049c('0x3f')],qs[_0x049c('0x45')](_0x368e4['query'][_0x049c('0x45')]));_0x28e3bc[_0x049c('0x44')]=_0x28e3bc[_0x049c('0x44')][_0x049c('0x56')]?_0x28e3bc[_0x049c('0x44')]:_0x313ac4['model'];_0x28e3bc['order']=qs[_0x049c('0x48')](_0x368e4[_0x049c('0x41')][_0x049c('0x48')]);_0x28e3bc[_0x049c('0x4a')]=qs['filters'](_[_0x049c('0x49')](_0x368e4['query'],_0x313ac4['filters']));if(_0x368e4[_0x049c('0x41')][_0x049c('0x4d')]){_0x28e3bc[_0x049c('0x4a')]=_['merge'](_0x28e3bc[_0x049c('0x4a')],{'$or':_[_0x049c('0x3a')](_0x28e3bc[_0x049c('0x44')],function(_0x935f8b){var _0x567928={};_0x567928[_0x935f8b]={'$like':'%'+_0x368e4['query']['filter']+'%'};return _0x567928;})});}_0x28e3bc=_[_0x049c('0x4e')]({},_0x28e3bc,_0x368e4[_0x049c('0x4f')]);return _0x48eed2['getDescriptions'](_0x28e3bc);}})[_0x049c('0x34')](function(_0x2a5bf0){if(_0x2a5bf0){_0xa9623=_0x2a5bf0[_0x049c('0x56')];if(!_0x368e4[_0x049c('0x41')][_0x049c('0x46')](_0x049c('0x5f'))){_0x28e3bc[_0x049c('0x2e')]=qs[_0x049c('0x2e')](_0x368e4['query'][_0x049c('0x2e')]);_0x28e3bc[_0x049c('0x2d')]=qs[_0x049c('0x2d')](_0x368e4[_0x049c('0x41')][_0x049c('0x2d')]);}return _0x48eed2[_0x049c('0x60')](_0x28e3bc);}})[_0x049c('0x34')](function(_0x3b0403){if(_0x3b0403){return _0x3b0403?{'count':_0xa9623,'rows':_0x3b0403}:null;}})[_0x049c('0x34')](respondWithResult(_0x124f69,null))[_0x049c('0x28')](handleError(_0x124f69,null));};
\ No newline at end of file
index 7332159..f642cc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54fa=['api','moment','bluebird','path','rimraf','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util'];(function(_0x171b69,_0x21ee9a){var _0x1a9826=function(_0x6595b){while(--_0x6595b){_0x171b69['push'](_0x171b69['shift']());}};_0x1a9826(++_0x21ee9a);}(_0x54fa,0x132));var _0xa54f=function(_0x3e7804,_0x121853){_0x3e7804=_0x3e7804-0x0;var _0x56efda=_0x54fa[_0x3e7804];return _0x56efda;};'use strict';var _=require(_0xa54f('0x0'));var util=require(_0xa54f('0x1'));var logger=require('../../config/logger')(_0xa54f('0x2'));var moment=require(_0xa54f('0x3'));var BPromise=require(_0xa54f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa54f('0x5'));var rimraf=require(_0xa54f('0x6'));var config=require('../../config/environment');var attributes=require(_0xa54f('0x7'));module[_0xa54f('0x8')]=function(_0x46cc84,_0x13f3f0){return _0x46cc84['define'](_0xa54f('0x9'),attributes,{'tableName':_0xa54f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae6b=['rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','../../config/logger','api','moment','bluebird','path'];(function(_0x1e7385,_0x4cb207){var _0x58c81c=function(_0x4801c7){while(--_0x4801c7){_0x1e7385['push'](_0x1e7385['shift']());}};_0x58c81c(++_0x4cb207);}(_0xae6b,0xf8));var _0xbae6=function(_0x544072,_0xc41ee1){_0x544072=_0x544072-0x0;var _0x590bf6=_0xae6b[_0x544072];return _0x590bf6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbae6('0x0'))(_0xbae6('0x1'));var moment=require(_0xbae6('0x2'));var BPromise=require(_0xbae6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbae6('0x4'));var rimraf=require(_0xbae6('0x5'));var config=require('../../config/environment');var attributes=require(_0xbae6('0x6'));module[_0xbae6('0x7')]=function(_0x121ccc,_0x1e8ac0){return _0x121ccc[_0xbae6('0x8')](_0xbae6('0x9'),attributes,{'tableName':_0xbae6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 998fa93..749fd32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33d5=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info'];(function(_0x507403,_0x3f954d){var _0x1327c=function(_0x2aea1b){while(--_0x2aea1b){_0x507403['push'](_0x507403['shift']());}};_0x1327c(++_0x3f954d);}(_0x33d5,0xa9));var _0x533d=function(_0x1d502c,_0x248372){_0x1d502c=_0x1d502c-0x0;var _0x2417ed=_0x33d5[_0x1d502c];return _0x2417ed;};'use strict';var _=require('lodash');var util=require(_0x533d('0x0'));var moment=require(_0x533d('0x1'));var BPromise=require(_0x533d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x533d('0x3'))['db'];var utils=require(_0x533d('0x4'));var logger=require(_0x533d('0x5'))('rpc');var config=require(_0x533d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x533d('0x7')][_0x533d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d2717,_0x4e2b58,_0x5c734b){return new BPromise(function(_0x5edb25,_0x1c1332){return client['request'](_0x3d2717,_0x5c734b)[_0x533d('0x9')](function(_0x529059){logger[_0x533d('0xa')](_0x533d('0xb'),_0x4e2b58,_0x533d('0xc'));logger[_0x533d('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4e2b58,'request\x20sent',JSON['stringify'](_0x529059));if(_0x529059['error']){if(_0x529059[_0x533d('0xe')][_0x533d('0xf')]===0x1f4){logger[_0x533d('0xe')](_0x533d('0xb'),_0x4e2b58,_0x529059[_0x533d('0xe')][_0x533d('0x10')]);return _0x1c1332(_0x529059['error']['message']);}logger[_0x533d('0xe')](_0x533d('0xb'),_0x4e2b58,_0x529059[_0x533d('0xe')][_0x533d('0x10')]);return _0x5edb25(_0x529059[_0x533d('0xe')][_0x533d('0x10')]);}else{logger['info'](_0x533d('0xb'),_0x4e2b58,'request\x20sent');_0x5edb25(_0x529059[_0x533d('0x11')][_0x533d('0x10')]);}})['catch'](function(_0x53c4ac){logger['error'](_0x533d('0xb'),_0x4e2b58,_0x53c4ac);_0x1c1332(_0x53c4ac);});});}
\ No newline at end of file
+var _0x2d04=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0x2d04,0x1ac));var _0x42d0=function(_0x2993c1,_0x37681f){_0x2993c1=_0x2993c1-0x0;var _0x41c9cf=_0x2d04[_0x2993c1];return _0x41c9cf;};'use strict';var _=require(_0x42d0('0x0'));var util=require(_0x42d0('0x1'));var moment=require(_0x42d0('0x2'));var BPromise=require(_0x42d0('0x3'));var rs=require(_0x42d0('0x4'));var fs=require('fs');var Redis=require(_0x42d0('0x5'));var db=require(_0x42d0('0x6'))['db'];var utils=require(_0x42d0('0x7'));var logger=require(_0x42d0('0x8'))('rpc');var config=require(_0x42d0('0x9'));var jayson=require(_0x42d0('0xa'));var client=jayson[_0x42d0('0xb')][_0x42d0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b2c61,_0x48ee1d,_0x1fd5a4){return new BPromise(function(_0x28e142,_0x4a5771){return client['request'](_0x5b2c61,_0x1fd5a4)[_0x42d0('0xd')](function(_0x484138){logger['info'](_0x42d0('0xe'),_0x48ee1d,_0x42d0('0xf'));logger[_0x42d0('0x10')](_0x42d0('0x11'),_0x48ee1d,_0x42d0('0xf'),JSON[_0x42d0('0x12')](_0x484138));if(_0x484138[_0x42d0('0x13')]){if(_0x484138[_0x42d0('0x13')][_0x42d0('0x14')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x48ee1d,_0x484138[_0x42d0('0x13')][_0x42d0('0x15')]);return _0x4a5771(_0x484138[_0x42d0('0x13')][_0x42d0('0x15')]);}logger['error'](_0x42d0('0xe'),_0x48ee1d,_0x484138[_0x42d0('0x13')][_0x42d0('0x15')]);return _0x28e142(_0x484138['error'][_0x42d0('0x15')]);}else{logger[_0x42d0('0x16')]('SalesforceConfiguration,\x20%s,\x20%s',_0x48ee1d,_0x42d0('0xf'));_0x28e142(_0x484138['result'][_0x42d0('0x15')]);}})[_0x42d0('0x17')](function(_0x583dba){logger['error'](_0x42d0('0xe'),_0x48ee1d,_0x583dba);_0x4a5771(_0x583dba);});});}
\ No newline at end of file
index 2c05bc5..6c138b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['show','post','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0x326f,0xd1));var _0xf326=function(_0x2a2640,_0x179c93){_0x2a2640=_0x2a2640-0x0;var _0x51b276=_0x326f[_0x2a2640];return _0x51b276;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var auth=require(_0xf326('0x4'));var interaction=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));var controller=require(_0xf326('0x7'));router[_0xf326('0x8')]('/',auth[_0xf326('0x9')](),controller[_0xf326('0xa')]);router['get'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xc')]);router[_0xf326('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xe')]);router[_0xf326('0xf')](_0xf326('0xb'),auth['isAuthenticated'](),controller[_0xf326('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xfb65=['./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x582b89,_0x241411){var _0x1468b0=function(_0x25c798){while(--_0x25c798){_0x582b89['push'](_0x582b89['shift']());}};_0x1468b0(++_0x241411);}(_0xfb65,0x82));var _0x5fb6=function(_0x410d6b,_0x16e343){_0x410d6b=_0x410d6b-0x0;var _0x48ee53=_0xfb65[_0x410d6b];return _0x48ee53;};'use strict';var multer=require('multer');var util=require(_0x5fb6('0x0'));var path=require(_0x5fb6('0x1'));var timeout=require('connect-timeout');var express=require(_0x5fb6('0x2'));var router=express['Router']();var auth=require(_0x5fb6('0x3'));var interaction=require(_0x5fb6('0x4'));var config=require(_0x5fb6('0x5'));var controller=require(_0x5fb6('0x6'));router[_0x5fb6('0x7')]('/',auth[_0x5fb6('0x8')](),controller['index']);router['get'](_0x5fb6('0x9'),auth[_0x5fb6('0x8')](),controller[_0x5fb6('0xa')]);router[_0x5fb6('0xb')]('/',auth['isAuthenticated'](),controller[_0x5fb6('0xc')]);router[_0x5fb6('0xd')](_0x5fb6('0x9'),auth[_0x5fb6('0x8')](),controller['update']);router[_0x5fb6('0xe')](_0x5fb6('0x9'),auth['isAuthenticated'](),controller[_0x5fb6('0xf')]);module[_0x5fb6('0x10')]=router;
\ No newline at end of file
index 77f8f8d..6361a5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d22=['ENUM','string','variable','customVariable','STRING'];(function(_0x9cca21,_0xaee881){var _0x27ddbf=function(_0x12d4ac){while(--_0x12d4ac){_0x9cca21['push'](_0x9cca21['shift']());}};_0x27ddbf(++_0xaee881);}(_0x2d22,0x19f));var _0x22d2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2d22[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x22d2('0x0')](_0x22d2('0x1'),_0x22d2('0x2'),_0x22d2('0x3'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x22d2('0x4')]},'key':{'type':Sequelize[_0x22d2('0x4')]},'keyType':{'type':Sequelize[_0x22d2('0x0')]('string',_0x22d2('0x2'),_0x22d2('0x3'))},'keyContent':{'type':Sequelize[_0x22d2('0x4')]},'idField':{'type':Sequelize[_0x22d2('0x4')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc30f=['STRING','sequelize','ENUM','string','variable','customVariable','keyValue'];(function(_0x1a8384,_0x3bc720){var _0x4e71ff=function(_0x59004c){while(--_0x59004c){_0x1a8384['push'](_0x1a8384['shift']());}};_0x4e71ff(++_0x3bc720);}(_0xc30f,0xbe));var _0xfc30=function(_0x5eafab,_0x16f0be){_0x5eafab=_0x5eafab-0x0;var _0x171c24=_0xc30f[_0x5eafab];return _0x171c24;};'use strict';var Sequelize=require(_0xfc30('0x0'));module['exports']={'type':{'type':Sequelize[_0xfc30('0x1')](_0xfc30('0x2'),_0xfc30('0x3'),_0xfc30('0x4'),_0xfc30('0x5')),'defaultValue':_0xfc30('0x2')},'content':{'type':Sequelize[_0xfc30('0x6')]},'key':{'type':Sequelize[_0xfc30('0x6')]},'keyType':{'type':Sequelize[_0xfc30('0x1')]('string',_0xfc30('0x3'),_0xfc30('0x4'))},'keyContent':{'type':Sequelize[_0xfc30('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xfc30('0x6')]}};
\ No newline at end of file
index 1dc62c9..d778281 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9117=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SalesforceField','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body'];(function(_0x4873cd,_0x140991){var _0x4c06cf=function(_0x1abbf1){while(--_0x1abbf1){_0x4873cd['push'](_0x4873cd['shift']());}};_0x4c06cf(++_0x140991);}(_0x9117,0x181));var _0x7911=function(_0x5804b0,_0x3bedd5){_0x5804b0=_0x5804b0-0x0;var _0x1d0d1c=_0x9117[_0x5804b0];return _0x1d0d1c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7911('0x0'));var rimraf=require(_0x7911('0x1'));var zipdir=require(_0x7911('0x2'));var jsonpatch=require(_0x7911('0x3'));var rp=require(_0x7911('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7911('0x5'));var util=require(_0x7911('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7911('0x7'));var ejs=require(_0x7911('0x8'));var fs=require('fs');var _=require(_0x7911('0x9'));var squel=require('squel');var crypto=require(_0x7911('0xa'));var jsforce=require(_0x7911('0xb'));var deskjs=require(_0x7911('0xc'));var toCsv=require(_0x7911('0x7'));var querystring=require(_0x7911('0xd'));var Papa=require(_0x7911('0xe'));var Redis=require('ioredis');var authService=require(_0x7911('0xf'));var qs=require(_0x7911('0x10'));var as=require(_0x7911('0x11'));var hardwareService=require(_0x7911('0x12'));var logger=require(_0x7911('0x13'))(_0x7911('0x14'));var utils=require(_0x7911('0x15'));var config=require(_0x7911('0x16'));var db=require(_0x7911('0x17'))['db'];function respondWithStatusCode(_0xe593bc,_0x3dd4bd){_0x3dd4bd=_0x3dd4bd||0xcc;return function(_0x2f941c){if(_0x2f941c){return _0xe593bc[_0x7911('0x18')](_0x3dd4bd);}return _0xe593bc[_0x7911('0x19')](_0x3dd4bd)[_0x7911('0x1a')]();};}function respondWithResult(_0x3b6ec6,_0xd6fcbf){_0xd6fcbf=_0xd6fcbf||0xc8;return function(_0x12d4f9){if(_0x12d4f9){return _0x3b6ec6[_0x7911('0x19')](_0xd6fcbf)[_0x7911('0x1b')](_0x12d4f9);}};}function respondWithFilteredResult(_0x570a5d,_0x581bb8){return function(_0x3a55e8){if(_0x3a55e8){var _0x114def=_0x3a55e8[_0x7911('0x1c')],_0x14cc43=_0x581bb8[_0x7911('0x1d')],_0x179740=_0x581bb8[_0x7911('0x1d')]+_0x581bb8[_0x7911('0x1e')],_0x23f06b;if(_0x179740>=_0x114def){_0x179740=_0x114def;_0x23f06b=0xc8;}else{_0x23f06b=0xce;}_0x570a5d[_0x7911('0x19')](_0x23f06b);return _0x570a5d[_0x7911('0x1f')](_0x7911('0x20'),_0x14cc43+'-'+_0x179740+'/'+_0x114def)[_0x7911('0x1b')](_0x3a55e8);}return null;};}function patchUpdates(_0x59bd91){return function(_0xf61591){try{jsonpatch[_0x7911('0x21')](_0xf61591,_0x59bd91,!![]);}catch(_0x4a4227){return BPromise[_0x7911('0x22')](_0x4a4227);}return _0xf61591[_0x7911('0x23')]();};}function saveUpdates(_0xd53fd1,_0x3483f0){return function(_0x2bd528){if(_0x2bd528){return _0x2bd528[_0x7911('0x24')](_0xd53fd1)[_0x7911('0x25')](function(_0x5be504){return _0x5be504;});}return null;};}function removeEntity(_0x148066,_0x43c8e0){return function(_0x1518df){if(_0x1518df){return _0x1518df[_0x7911('0x26')]()[_0x7911('0x25')](function(){_0x148066[_0x7911('0x19')](0xcc)[_0x7911('0x1a')]();});}};}function handleEntityNotFound(_0x3b7e38,_0x54b0f0){return function(_0x42967b){if(!_0x42967b){_0x3b7e38[_0x7911('0x18')](0x194);}return _0x42967b;};}function handleError(_0x1043aa,_0x139226){_0x139226=_0x139226||0x1f4;return function(_0x2dde8c){logger[_0x7911('0x27')](_0x2dde8c[_0x7911('0x28')]);if(_0x2dde8c[_0x7911('0x29')]){delete _0x2dde8c[_0x7911('0x29')];}_0x1043aa['status'](_0x139226)[_0x7911('0x2a')](_0x2dde8c);};}exports[_0x7911('0x2b')]=function(_0x3e77ef,_0x3ef65e){var _0x58c968={},_0x4e7d9c={},_0x4bb9e6={'count':0x0,'rows':[]};var _0x2244b6=_[_0x7911('0x2c')](db['SalesforceField']['rawAttributes'],function(_0x291ac7){return{'name':_0x291ac7['fieldName'],'type':_0x291ac7['type'][_0x7911('0x2d')]};});_0x4e7d9c[_0x7911('0x2e')]=_['map'](_0x2244b6,_0x7911('0x29'));_0x4e7d9c[_0x7911('0x2f')]=_[_0x7911('0x30')](_0x3e77ef['query']);_0x4e7d9c[_0x7911('0x31')]=_[_0x7911('0x32')](_0x4e7d9c[_0x7911('0x2e')],_0x4e7d9c[_0x7911('0x2f')]);_0x58c968[_0x7911('0x33')]=_[_0x7911('0x32')](_0x4e7d9c[_0x7911('0x2e')],qs[_0x7911('0x34')](_0x3e77ef[_0x7911('0x2f')]['fields']));_0x58c968[_0x7911('0x33')]=_0x58c968['attributes'][_0x7911('0x35')]?_0x58c968[_0x7911('0x33')]:_0x4e7d9c[_0x7911('0x2e')];if(!_0x3e77ef[_0x7911('0x2f')][_0x7911('0x36')](_0x7911('0x37'))){_0x58c968[_0x7911('0x1e')]=qs['limit'](_0x3e77ef[_0x7911('0x2f')][_0x7911('0x1e')]);_0x58c968['offset']=qs[_0x7911('0x1d')](_0x3e77ef[_0x7911('0x2f')][_0x7911('0x1d')]);}_0x58c968[_0x7911('0x38')]=qs[_0x7911('0x39')](_0x3e77ef['query']['sort']);_0x58c968[_0x7911('0x3a')]=qs[_0x7911('0x31')](_[_0x7911('0x3b')](_0x3e77ef['query'],_0x4e7d9c[_0x7911('0x31')]),_0x2244b6);if(_0x3e77ef[_0x7911('0x2f')][_0x7911('0x3c')]){_0x58c968[_0x7911('0x3a')]=_[_0x7911('0x3d')](_0x58c968[_0x7911('0x3a')],{'$or':_[_0x7911('0x2c')](_0x2244b6,function(_0x5cf26b){if(_0x5cf26b[_0x7911('0x3e')]!==_0x7911('0x3f')){var _0x4a2db2={};_0x4a2db2[_0x5cf26b['name']]={'$like':'%'+_0x3e77ef[_0x7911('0x2f')]['filter']+'%'};return _0x4a2db2;}})});}_0x58c968=_[_0x7911('0x3d')]({},_0x58c968,_0x3e77ef[_0x7911('0x40')]);var _0x47e969={'where':_0x58c968['where']};return db[_0x7911('0x41')]['count'](_0x47e969)['then'](function(_0xe11b33){_0x4bb9e6[_0x7911('0x1c')]=_0xe11b33;if(_0x3e77ef[_0x7911('0x2f')][_0x7911('0x42')]){_0x58c968[_0x7911('0x43')]=[{'all':!![]}];}return db[_0x7911('0x41')][_0x7911('0x44')](_0x58c968);})[_0x7911('0x25')](function(_0x49ee94){_0x4bb9e6[_0x7911('0x45')]=_0x49ee94;return _0x4bb9e6;})[_0x7911('0x25')](respondWithFilteredResult(_0x3ef65e,_0x58c968))[_0x7911('0x46')](handleError(_0x3ef65e,null));};exports[_0x7911('0x47')]=function(_0x46fea1,_0xe37d75){var _0x422967={'raw':!![],'where':{'id':_0x46fea1[_0x7911('0x48')]['id']}},_0x114146={};_0x114146[_0x7911('0x2e')]=_[_0x7911('0x30')](db[_0x7911('0x41')][_0x7911('0x49')]);_0x114146[_0x7911('0x2f')]=_[_0x7911('0x30')](_0x46fea1[_0x7911('0x2f')]);_0x114146[_0x7911('0x31')]=_[_0x7911('0x32')](_0x114146[_0x7911('0x2e')],_0x114146[_0x7911('0x2f')]);_0x422967[_0x7911('0x33')]=_[_0x7911('0x32')](_0x114146[_0x7911('0x2e')],qs['fields'](_0x46fea1['query'][_0x7911('0x34')]));_0x422967[_0x7911('0x33')]=_0x422967['attributes']['length']?_0x422967[_0x7911('0x33')]:_0x114146['model'];if(_0x46fea1[_0x7911('0x2f')][_0x7911('0x42')]){_0x422967[_0x7911('0x43')]=[{'all':!![]}];}_0x422967=_[_0x7911('0x3d')]({},_0x422967,_0x46fea1[_0x7911('0x40')]);return db[_0x7911('0x41')][_0x7911('0x4a')](_0x422967)[_0x7911('0x25')](handleEntityNotFound(_0xe37d75,null))[_0x7911('0x25')](respondWithResult(_0xe37d75,null))[_0x7911('0x46')](handleError(_0xe37d75,null));};exports['create']=function(_0x1edc5d,_0x3b4ade){return db['SalesforceField'][_0x7911('0x4b')](_0x1edc5d[_0x7911('0x4c')],{})[_0x7911('0x25')](respondWithResult(_0x3b4ade,0xc9))['catch'](handleError(_0x3b4ade,null));};exports['update']=function(_0x15ea0e,_0x5ed7e9){if(_0x15ea0e[_0x7911('0x4c')]['id']){delete _0x15ea0e[_0x7911('0x4c')]['id'];}return db[_0x7911('0x41')][_0x7911('0x4a')]({'where':{'id':_0x15ea0e[_0x7911('0x48')]['id']}})[_0x7911('0x25')](handleEntityNotFound(_0x5ed7e9,null))[_0x7911('0x25')](saveUpdates(_0x15ea0e[_0x7911('0x4c')],null))[_0x7911('0x25')](respondWithResult(_0x5ed7e9,null))['catch'](handleError(_0x5ed7e9,null));};exports[_0x7911('0x26')]=function(_0x283fe3,_0x30a68c){return db['SalesforceField']['find']({'where':{'id':_0x283fe3[_0x7911('0x48')]['id']}})[_0x7911('0x25')](handleEntityNotFound(_0x30a68c,null))[_0x7911('0x25')](removeEntity(_0x30a68c,null))[_0x7911('0x46')](handleError(_0x30a68c,null));};
\ No newline at end of file
+var _0x41d8=['ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','save','then','destroy','error','stack','index','SalesforceField','fieldName','type','key','map','name','keys','query','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','VIRTUAL','merge','options','catch','show','params','fields','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x4b9726,_0x31171c){var _0x2b273a=function(_0x2dabd6){while(--_0x2dabd6){_0x4b9726['push'](_0x4b9726['shift']());}};_0x2b273a(++_0x31171c);}(_0x41d8,0xc1));var _0x841d=function(_0x5f0c76,_0x44b266){_0x5f0c76=_0x5f0c76-0x0;var _0x308606=_0x41d8[_0x5f0c76];return _0x308606;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x841d('0x0'));var rimraf=require(_0x841d('0x1'));var zipdir=require(_0x841d('0x2'));var jsonpatch=require(_0x841d('0x3'));var rp=require(_0x841d('0x4'));var moment=require(_0x841d('0x5'));var BPromise=require(_0x841d('0x6'));var Mustache=require(_0x841d('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x841d('0x8'));var fs=require('fs');var _=require(_0x841d('0x9'));var squel=require('squel');var crypto=require(_0x841d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x841d('0xb'));var toCsv=require(_0x841d('0xc'));var querystring=require(_0x841d('0xd'));var Papa=require(_0x841d('0xe'));var Redis=require(_0x841d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x841d('0x10'));var as=require(_0x841d('0x11'));var hardwareService=require(_0x841d('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x841d('0x13'));var config=require('../../config/environment');var db=require(_0x841d('0x14'))['db'];function respondWithStatusCode(_0x5ed81b,_0x2f414){_0x2f414=_0x2f414||0xcc;return function(_0x494cef){if(_0x494cef){return _0x5ed81b[_0x841d('0x15')](_0x2f414);}return _0x5ed81b[_0x841d('0x16')](_0x2f414)[_0x841d('0x17')]();};}function respondWithResult(_0x271e13,_0x17004b){_0x17004b=_0x17004b||0xc8;return function(_0x478449){if(_0x478449){return _0x271e13[_0x841d('0x16')](_0x17004b)[_0x841d('0x18')](_0x478449);}};}function respondWithFilteredResult(_0x34516d,_0x3b6941){return function(_0x5a3049){if(_0x5a3049){var _0x3b1802=_0x5a3049[_0x841d('0x19')],_0x4320da=_0x3b6941['offset'],_0x4116ba=_0x3b6941['offset']+_0x3b6941[_0x841d('0x1a')],_0x3029ff;if(_0x4116ba>=_0x3b1802){_0x4116ba=_0x3b1802;_0x3029ff=0xc8;}else{_0x3029ff=0xce;}_0x34516d[_0x841d('0x16')](_0x3029ff);return _0x34516d[_0x841d('0x1b')](_0x841d('0x1c'),_0x4320da+'-'+_0x4116ba+'/'+_0x3b1802)[_0x841d('0x18')](_0x5a3049);}return null;};}function patchUpdates(_0x2e58ef){return function(_0x16aa70){try{jsonpatch['apply'](_0x16aa70,_0x2e58ef,!![]);}catch(_0x33093a){return BPromise['reject'](_0x33093a);}return _0x16aa70[_0x841d('0x1d')]();};}function saveUpdates(_0x8d12df,_0x30986f){return function(_0x5765cb){if(_0x5765cb){return _0x5765cb['update'](_0x8d12df)[_0x841d('0x1e')](function(_0x40d0f0){return _0x40d0f0;});}return null;};}function removeEntity(_0x1a88e7,_0x25dbe6){return function(_0x5b7158){if(_0x5b7158){return _0x5b7158[_0x841d('0x1f')]()[_0x841d('0x1e')](function(){_0x1a88e7[_0x841d('0x16')](0xcc)[_0x841d('0x17')]();});}};}function handleEntityNotFound(_0x47426a,_0x5c40df){return function(_0x5b13ef){if(!_0x5b13ef){_0x47426a[_0x841d('0x15')](0x194);}return _0x5b13ef;};}function handleError(_0x150f1a,_0x19e0cc){_0x19e0cc=_0x19e0cc||0x1f4;return function(_0x117541){logger[_0x841d('0x20')](_0x117541[_0x841d('0x21')]);if(_0x117541['name']){delete _0x117541['name'];}_0x150f1a[_0x841d('0x16')](_0x19e0cc)['send'](_0x117541);};}exports[_0x841d('0x22')]=function(_0x3117e6,_0x25cd18){var _0x119247={},_0xabc8b0={},_0xe8b880={'count':0x0,'rows':[]};var _0x10a530=_['map'](db[_0x841d('0x23')]['rawAttributes'],function(_0x48e882){return{'name':_0x48e882[_0x841d('0x24')],'type':_0x48e882[_0x841d('0x25')][_0x841d('0x26')]};});_0xabc8b0['model']=_[_0x841d('0x27')](_0x10a530,_0x841d('0x28'));_0xabc8b0['query']=_[_0x841d('0x29')](_0x3117e6[_0x841d('0x2a')]);_0xabc8b0[_0x841d('0x2b')]=_['intersection'](_0xabc8b0[_0x841d('0x2c')],_0xabc8b0['query']);_0x119247[_0x841d('0x2d')]=_[_0x841d('0x2e')](_0xabc8b0[_0x841d('0x2c')],qs['fields'](_0x3117e6[_0x841d('0x2a')]['fields']));_0x119247['attributes']=_0x119247['attributes'][_0x841d('0x2f')]?_0x119247[_0x841d('0x2d')]:_0xabc8b0['model'];if(!_0x3117e6[_0x841d('0x2a')][_0x841d('0x30')](_0x841d('0x31'))){_0x119247[_0x841d('0x1a')]=qs[_0x841d('0x1a')](_0x3117e6[_0x841d('0x2a')][_0x841d('0x1a')]);_0x119247[_0x841d('0x32')]=qs[_0x841d('0x32')](_0x3117e6[_0x841d('0x2a')]['offset']);}_0x119247[_0x841d('0x33')]=qs['sort'](_0x3117e6[_0x841d('0x2a')][_0x841d('0x34')]);_0x119247['where']=qs[_0x841d('0x2b')](_[_0x841d('0x35')](_0x3117e6[_0x841d('0x2a')],_0xabc8b0[_0x841d('0x2b')]),_0x10a530);if(_0x3117e6[_0x841d('0x2a')][_0x841d('0x36')]){_0x119247[_0x841d('0x37')]=_['merge'](_0x119247[_0x841d('0x37')],{'$or':_[_0x841d('0x27')](_0x10a530,function(_0x1aaad0){if(_0x1aaad0['type']!==_0x841d('0x38')){var _0x58545f={};_0x58545f[_0x1aaad0[_0x841d('0x28')]]={'$like':'%'+_0x3117e6[_0x841d('0x2a')]['filter']+'%'};return _0x58545f;}})});}_0x119247=_[_0x841d('0x39')]({},_0x119247,_0x3117e6[_0x841d('0x3a')]);var _0x2360b={'where':_0x119247[_0x841d('0x37')]};return db[_0x841d('0x23')][_0x841d('0x19')](_0x2360b)[_0x841d('0x1e')](function(_0x5700a7){_0xe8b880[_0x841d('0x19')]=_0x5700a7;if(_0x3117e6[_0x841d('0x2a')]['includeAll']){_0x119247['include']=[{'all':!![]}];}return db[_0x841d('0x23')]['findAll'](_0x119247);})[_0x841d('0x1e')](function(_0x1ea80a){_0xe8b880['rows']=_0x1ea80a;return _0xe8b880;})[_0x841d('0x1e')](respondWithFilteredResult(_0x25cd18,_0x119247))[_0x841d('0x3b')](handleError(_0x25cd18,null));};exports[_0x841d('0x3c')]=function(_0x41c329,_0x369ef1){var _0x4481eb={'raw':!![],'where':{'id':_0x41c329[_0x841d('0x3d')]['id']}},_0x5ab0ca={};_0x5ab0ca[_0x841d('0x2c')]=_[_0x841d('0x29')](db['SalesforceField']['rawAttributes']);_0x5ab0ca['query']=_[_0x841d('0x29')](_0x41c329[_0x841d('0x2a')]);_0x5ab0ca['filters']=_[_0x841d('0x2e')](_0x5ab0ca[_0x841d('0x2c')],_0x5ab0ca[_0x841d('0x2a')]);_0x4481eb[_0x841d('0x2d')]=_[_0x841d('0x2e')](_0x5ab0ca[_0x841d('0x2c')],qs[_0x841d('0x3e')](_0x41c329[_0x841d('0x2a')][_0x841d('0x3e')]));_0x4481eb[_0x841d('0x2d')]=_0x4481eb[_0x841d('0x2d')]['length']?_0x4481eb[_0x841d('0x2d')]:_0x5ab0ca['model'];if(_0x41c329[_0x841d('0x2a')]['includeAll']){_0x4481eb['include']=[{'all':!![]}];}_0x4481eb=_[_0x841d('0x39')]({},_0x4481eb,_0x41c329['options']);return db['SalesforceField'][_0x841d('0x3f')](_0x4481eb)[_0x841d('0x1e')](handleEntityNotFound(_0x369ef1,null))[_0x841d('0x1e')](respondWithResult(_0x369ef1,null))[_0x841d('0x3b')](handleError(_0x369ef1,null));};exports[_0x841d('0x40')]=function(_0x586074,_0x5cefd5){return db['SalesforceField']['create'](_0x586074['body'],{})[_0x841d('0x1e')](respondWithResult(_0x5cefd5,0xc9))['catch'](handleError(_0x5cefd5,null));};exports[_0x841d('0x41')]=function(_0x2c9d2c,_0x74bd5f){if(_0x2c9d2c[_0x841d('0x42')]['id']){delete _0x2c9d2c[_0x841d('0x42')]['id'];}return db[_0x841d('0x23')][_0x841d('0x3f')]({'where':{'id':_0x2c9d2c[_0x841d('0x3d')]['id']}})[_0x841d('0x1e')](handleEntityNotFound(_0x74bd5f,null))[_0x841d('0x1e')](saveUpdates(_0x2c9d2c[_0x841d('0x42')],null))[_0x841d('0x1e')](respondWithResult(_0x74bd5f,null))[_0x841d('0x3b')](handleError(_0x74bd5f,null));};exports[_0x841d('0x1f')]=function(_0x3d83a0,_0x305dba){return db[_0x841d('0x23')][_0x841d('0x3f')]({'where':{'id':_0x3d83a0['params']['id']}})[_0x841d('0x1e')](handleEntityNotFound(_0x305dba,null))['then'](removeEntity(_0x305dba,null))[_0x841d('0x3b')](handleError(_0x305dba,null));};
\ No newline at end of file
index d3d1e2d..7630d58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7d5=['api','bluebird','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','idField','lodash','util','../../config/logger'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xb7d5,0x8d));var _0x5b7d=function(_0x56aa76,_0x399f75){_0x56aa76=_0x56aa76-0x0;var _0x48a253=_0xb7d5[_0x56aa76];return _0x48a253;};'use strict';var _=require(_0x5b7d('0x0'));var util=require(_0x5b7d('0x1'));var logger=require(_0x5b7d('0x2'))(_0x5b7d('0x3'));var moment=require('moment');var BPromise=require(_0x5b7d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5b7d('0x5'));var config=require(_0x5b7d('0x6'));var attributes=require(_0x5b7d('0x7'));module[_0x5b7d('0x8')]=function(_0x5523e7,_0x50f08c){return _0x5523e7['define'](_0x5b7d('0x9'),attributes,{'tableName':_0x5b7d('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x5b7d('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7615=['request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x2e200c,_0x48ecf0){var _0x5a1e2e=function(_0x1e39a9){while(--_0x1e39a9){_0x2e200c['push'](_0x2e200c['shift']());}};_0x5a1e2e(++_0x48ecf0);}(_0x7615,0xfa));var _0x5761=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7615[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x5761('0x0'));var util=require(_0x5761('0x1'));var logger=require(_0x5761('0x2'))(_0x5761('0x3'));var moment=require(_0x5761('0x4'));var BPromise=require('bluebird');var rp=require(_0x5761('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5761('0x6'));var config=require(_0x5761('0x7'));var attributes=require(_0x5761('0x8'));module[_0x5761('0x9')]=function(_0x223a67,_0x2e8618){return _0x223a67[_0x5761('0xa')]('SalesforceField',attributes,{'tableName':_0x5761('0xb'),'paranoid':![],'indexes':[{'name':_0x5761('0xc'),'fields':[_0x5761('0xd'),_0x5761('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 0ea37ea..36c4be4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c00=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5c00,0x17e));var _0x05c0=function(_0x3494ee,_0x7b1b9a){_0x3494ee=_0x3494ee-0x0;var _0x12b115=_0x5c00[_0x3494ee];return _0x12b115;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27dc10,_0x5b9f09,_0x3a3b1b){return new BPromise(function(_0x34eb5f,_0x3ad5b7){return client['request'](_0x27dc10,_0x3a3b1b)[_0x05c0('0xb')](function(_0x32cdfa){logger[_0x05c0('0xc')](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));logger[_0x05c0('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x5b9f09,'request\x20sent',JSON[_0x05c0('0x10')](_0x32cdfa));if(_0x32cdfa['error']){if(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x12')]===0x1f4){logger[_0x05c0('0x11')]('SalesforceField,\x20%s,\x20%s',_0x5b9f09,_0x32cdfa[_0x05c0('0x11')]['message']);return _0x3ad5b7(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);return _0x34eb5f(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}else{logger['info'](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));_0x34eb5f(_0x32cdfa[_0x05c0('0x14')][_0x05c0('0x13')]);}})[_0x05c0('0x15')](function(_0x40153e){logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x40153e);_0x3ad5b7(_0x40153e);});});}
\ No newline at end of file
+var _0xf4eb=['SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2b23ab,_0x5ed076){var _0x36414c=function(_0x2a77d7){while(--_0x2a77d7){_0x2b23ab['push'](_0x2b23ab['shift']());}};_0x36414c(++_0x5ed076);}(_0xf4eb,0xec));var _0xbf4e=function(_0x43c8ee,_0x38355b){_0x43c8ee=_0x43c8ee-0x0;var _0x2d5f67=_0xf4eb[_0x43c8ee];return _0x2d5f67;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('SalesforceField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
index 60db0c9..cc712e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5859=['addConfiguration','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x5859,0xc4));var _0x9585=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x5859[_0x381589];return _0x2a075d;};'use strict';var multer=require(_0x9585('0x0'));var util=require(_0x9585('0x1'));var path=require(_0x9585('0x2'));var timeout=require(_0x9585('0x3'));var express=require(_0x9585('0x4'));var router=express[_0x9585('0x5')]();var auth=require(_0x9585('0x6'));var interaction=require(_0x9585('0x7'));var config=require(_0x9585('0x8'));var controller=require(_0x9585('0x9'));router[_0x9585('0xa')]('/',auth[_0x9585('0xb')](),controller[_0x9585('0xc')]);router['get'](_0x9585('0xd'),auth[_0x9585('0xb')](),controller[_0x9585('0xe')]);router['get'](_0x9585('0xf'),auth[_0x9585('0xb')](),controller['getConfigurations']);router['get'](_0x9585('0x10'),auth[_0x9585('0xb')](),controller[_0x9585('0x11')]);router[_0x9585('0x12')]('/',auth['isAuthenticated'](),controller[_0x9585('0x13')]);router['post'](_0x9585('0xf'),auth[_0x9585('0xb')](),controller[_0x9585('0x14')]);router[_0x9585('0x15')](_0x9585('0xd'),auth[_0x9585('0xb')](),controller['update']);router[_0x9585('0x16')](_0x9585('0xd'),auth[_0x9585('0xb')](),controller['destroy']);module[_0x9585('0x17')]=router;
\ No newline at end of file
+var _0x234f=['isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','./intServicenowAccount.controller','get'];(function(_0x3d3431,_0x5af465){var _0x18307a=function(_0xe5efa0){while(--_0xe5efa0){_0x3d3431['push'](_0x3d3431['shift']());}};_0x18307a(++_0x5af465);}(_0x234f,0xb6));var _0xf234=function(_0x4ebaaf,_0x1e12fe){_0x4ebaaf=_0x4ebaaf-0x0;var _0x2b94e1=_0x234f[_0x4ebaaf];return _0x2b94e1;};'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 auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf234('0x5'));router[_0xf234('0x6')]('/',auth[_0xf234('0x7')](),controller[_0xf234('0x8')]);router[_0xf234('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf234('0x6')](_0xf234('0x9'),auth[_0xf234('0x7')](),controller[_0xf234('0xa')]);router[_0xf234('0x6')](_0xf234('0xb'),auth[_0xf234('0x7')](),controller[_0xf234('0xc')]);router[_0xf234('0xd')]('/',auth[_0xf234('0x7')](),controller[_0xf234('0xe')]);router[_0xf234('0xd')]('/:id/configurations',auth[_0xf234('0x7')](),controller[_0xf234('0xf')]);router[_0xf234('0x10')](_0xf234('0x11'),auth['isAuthenticated'](),controller[_0xf234('0x12')]);router['delete'](_0xf234('0x11'),auth['isAuthenticated'](),controller[_0xf234('0x13')]);module[_0xf234('0x14')]=router;
\ No newline at end of file
index f7bb3e8..52f41c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6ed=['username','remoteUri','sequelize','exports','STRING'];(function(_0x490c57,_0x5ceb2d){var _0x27b89e=function(_0xdcb0da){while(--_0xdcb0da){_0x490c57['push'](_0x490c57['shift']());}};_0x27b89e(++_0x5ceb2d);}(_0xe6ed,0x15b));var _0xde6e=function(_0x1ae426,_0x45225c){_0x1ae426=_0x1ae426-0x0;var _0x48d371=_0xe6ed[_0x1ae426];return _0x48d371;};'use strict';var Sequelize=require(_0xde6e('0x0'));module[_0xde6e('0x1')]={'name':{'type':Sequelize[_0xde6e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xde6e('0x2')],'unique':_0xde6e('0x3')},'password':{'type':Sequelize[_0xde6e('0x2')]},'email':{'type':Sequelize[_0xde6e('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xde6e('0x4')},'serverUrl':{'type':Sequelize[_0xde6e('0x2')]}};
\ No newline at end of file
+var _0x44ce=['STRING','username'];(function(_0x2219bd,_0x9cfd12){var _0xb72639=function(_0x2113f3){while(--_0x2113f3){_0x2219bd['push'](_0x2219bd['shift']());}};_0xb72639(++_0x9cfd12);}(_0x44ce,0x1b4));var _0xe44c=function(_0x4d58ce,_0x47fb4f){_0x4d58ce=_0x4d58ce-0x0;var _0x504769=_0x44ce[_0x4d58ce];return _0x504769;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe44c('0x0')]},'username':{'type':Sequelize[_0xe44c('0x0')],'unique':_0xe44c('0x1')},'password':{'type':Sequelize[_0xe44c('0x0')]},'email':{'type':Sequelize[_0xe44c('0x0')]},'remoteUri':{'type':Sequelize[_0xe44c('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xe44c('0x0')]}};
\ No newline at end of file
index c217f87..32e5180 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4304=['sys_id','contact_type','urgency','problem_id','reassignment_count','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','location','username','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','password','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','forEach','internalType','label','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','Wrong\x20credentials','statusCode','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','lodash','squel','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','reject','save','update','destroy','stack','name','send','index','map','ServicenowAccount','rawAttributes','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','length','includeAll','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowConfiguration','ServicenowField','getFields','hold_reason','knowledge','close_code','incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','work_end','resolved_at','approval_set','subcategory','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','description','calendar_duration','notify','sys_class_name','follow_up'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0x4304,0xee));var _0x4430=function(_0x21f425,_0x2482b5){_0x21f425=_0x21f425-0x0;var _0x2f44f2=_0x4304[_0x21f425];return _0x2f44f2;};'use strict';var pdf=require(_0x4430('0x0'));var emlformat=require(_0x4430('0x1'));var rimraf=require(_0x4430('0x2'));var zipdir=require(_0x4430('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4430('0x4'));var moment=require(_0x4430('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4430('0x6'));var path=require(_0x4430('0x7'));var sox=require(_0x4430('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4430('0x9'));var squel=require(_0x4430('0xa'));var crypto=require('crypto');var jsforce=require(_0x4430('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4430('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4430('0xd'));var hardwareService=require(_0x4430('0xe'));var logger=require(_0x4430('0xf'))('api');var utils=require(_0x4430('0x10'));var config=require(_0x4430('0x11'));var db=require(_0x4430('0x12'))['db'];var integrations=require(_0x4430('0x13'));var jayson=require(_0x4430('0x14'));var client=jayson[_0x4430('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0xb48295,_0x1b8803,_0x25667e){if(_0x25667e){var _0x2a5e32=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a5e32[_0x4430('0x16')](_0x1b8803)){return _0xb48295;}else{throw new db[(_0x4430('0x17'))][(_0x4430('0x18'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xb48295;}}function respondWithRpcPromise(_0x50493a,_0x21eb12,_0x31e4ce,_0x1e4842){return new BPromise(function(_0x144f9d,_0x473b0c){var _0x124f0a=_0x1e4842||client;return _0x124f0a[_0x4430('0x19')](_0x50493a,_0x31e4ce)[_0x4430('0x1a')](function(_0x2517cd){logger[_0x4430('0x1b')](_0x4430('0x1c'),_0x21eb12,_0x4430('0x1d'));logger['debug'](_0x4430('0x1e'),_0x21eb12,_0x4430('0x1d'),JSON[_0x4430('0x1f')](_0x2517cd));if(_0x2517cd[_0x4430('0x20')]){if(_0x2517cd['error'][_0x4430('0x21')]===0x1f4){logger[_0x4430('0x20')](_0x4430('0x1c'),_0x21eb12,_0x2517cd['error'][_0x4430('0x22')]);return _0x473b0c(_0x2517cd[_0x4430('0x20')][_0x4430('0x22')]);}logger[_0x4430('0x20')](_0x4430('0x1c'),_0x21eb12,_0x2517cd[_0x4430('0x20')]['message']);return _0x144f9d(_0x2517cd[_0x4430('0x20')][_0x4430('0x22')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x21eb12,_0x4430('0x1d'));_0x144f9d(_0x2517cd[_0x4430('0x23')][_0x4430('0x22')]);}})[_0x4430('0x24')](function(_0x21a248){logger[_0x4430('0x20')](_0x4430('0x1c'),_0x21eb12,_0x21a248);_0x473b0c(_0x21a248);});});}function respondWithStatusCode(_0x4e3be5,_0x1b014c){_0x1b014c=_0x1b014c||0xcc;return function(_0x331886){if(_0x331886){return _0x4e3be5[_0x4430('0x25')](_0x1b014c);}return _0x4e3be5[_0x4430('0x26')](_0x1b014c)[_0x4430('0x27')]();};}function respondWithResult(_0x419812,_0x24453a){_0x24453a=_0x24453a||0xc8;return function(_0x3ca27a){if(_0x3ca27a){return _0x419812[_0x4430('0x26')](_0x24453a)[_0x4430('0x28')](_0x3ca27a);}};}function respondWithFilteredResult(_0x181aeb,_0x5e3d37){return function(_0x1827b1){if(_0x1827b1){var _0x289721=_0x1827b1[_0x4430('0x29')],_0xaa47e5=_0x5e3d37['offset'],_0x19a5cd=_0x5e3d37[_0x4430('0x2a')]+_0x5e3d37['limit'],_0x5cf39c;if(_0x19a5cd>=_0x289721){_0x19a5cd=_0x289721;_0x5cf39c=0xc8;}else{_0x5cf39c=0xce;}_0x181aeb[_0x4430('0x26')](_0x5cf39c);return _0x181aeb['set']('Content-Range',_0xaa47e5+'-'+_0x19a5cd+'/'+_0x289721)['json'](_0x1827b1);}return null;};}function patchUpdates(_0x2e8bb5){return function(_0x3acef2){try{jsonpatch['apply'](_0x3acef2,_0x2e8bb5,!![]);}catch(_0x48dbb6){return BPromise[_0x4430('0x2b')](_0x48dbb6);}return _0x3acef2[_0x4430('0x2c')]();};}function saveUpdates(_0x4c535e,_0x4856b9){return function(_0xd45150){if(_0xd45150){return _0xd45150[_0x4430('0x2d')](_0x4c535e)[_0x4430('0x1a')](function(_0x443cf0){return _0x443cf0;});}return null;};}function removeEntity(_0x36e408,_0x56cd04){return function(_0x26ea34){if(_0x26ea34){return _0x26ea34[_0x4430('0x2e')]()[_0x4430('0x1a')](function(){_0x36e408[_0x4430('0x26')](0xcc)[_0x4430('0x27')]();});}};}function handleEntityNotFound(_0x18dd24,_0x1274d2){return function(_0x1e5be1){if(!_0x1e5be1){_0x18dd24[_0x4430('0x25')](0x194);}return _0x1e5be1;};}function handleError(_0x239147,_0x329884){_0x329884=_0x329884||0x1f4;return function(_0x31491c){logger[_0x4430('0x20')](_0x31491c[_0x4430('0x2f')]);if(_0x31491c['name']){delete _0x31491c[_0x4430('0x30')];}_0x239147[_0x4430('0x26')](_0x329884)[_0x4430('0x31')](_0x31491c);};}exports[_0x4430('0x32')]=function(_0x5a5ec6,_0x5dbd33){var _0x289d86={},_0x25d0c7={},_0x33284e={'count':0x0,'rows':[]};var _0x9cb56e=_[_0x4430('0x33')](db[_0x4430('0x34')][_0x4430('0x35')],function(_0x1c7e95){return{'name':_0x1c7e95['fieldName'],'type':_0x1c7e95[_0x4430('0x36')]['key']};});_0x25d0c7[_0x4430('0x37')]=_['map'](_0x9cb56e,_0x4430('0x30'));_0x25d0c7[_0x4430('0x38')]=_[_0x4430('0x39')](_0x5a5ec6[_0x4430('0x38')]);_0x25d0c7['filters']=_['intersection'](_0x25d0c7[_0x4430('0x37')],_0x25d0c7[_0x4430('0x38')]);_0x289d86['attributes']=_[_0x4430('0x3a')](_0x25d0c7[_0x4430('0x37')],qs[_0x4430('0x3b')](_0x5a5ec6['query'][_0x4430('0x3b')]));_0x289d86['attributes']=_0x289d86[_0x4430('0x3c')]['length']?_0x289d86[_0x4430('0x3c')]:_0x25d0c7[_0x4430('0x37')];if(!_0x5a5ec6[_0x4430('0x38')][_0x4430('0x3d')](_0x4430('0x3e'))){_0x289d86[_0x4430('0x3f')]=qs[_0x4430('0x3f')](_0x5a5ec6['query']['limit']);_0x289d86['offset']=qs[_0x4430('0x2a')](_0x5a5ec6[_0x4430('0x38')][_0x4430('0x2a')]);}_0x289d86[_0x4430('0x40')]=qs[_0x4430('0x41')](_0x5a5ec6[_0x4430('0x38')][_0x4430('0x41')]);_0x289d86[_0x4430('0x42')]=qs[_0x4430('0x43')](_[_0x4430('0x44')](_0x5a5ec6[_0x4430('0x38')],_0x25d0c7[_0x4430('0x43')]),_0x9cb56e);if(_0x5a5ec6[_0x4430('0x38')][_0x4430('0x45')]){_0x289d86[_0x4430('0x42')]=_['merge'](_0x289d86[_0x4430('0x42')],{'$or':_[_0x4430('0x33')](_0x9cb56e,function(_0x1a84db){if(_0x1a84db[_0x4430('0x36')]!==_0x4430('0x46')){var _0x58e369={};_0x58e369[_0x1a84db[_0x4430('0x30')]]={'$like':'%'+_0x5a5ec6[_0x4430('0x38')]['filter']+'%'};return _0x58e369;}})});}_0x289d86=_[_0x4430('0x47')]({},_0x289d86,_0x5a5ec6[_0x4430('0x48')]);var _0x2e2bea={'where':_0x289d86[_0x4430('0x42')]};return db[_0x4430('0x34')][_0x4430('0x29')](_0x2e2bea)['then'](function(_0x12df81){_0x33284e[_0x4430('0x29')]=_0x12df81;if(_0x5a5ec6['query']['includeAll']){_0x289d86[_0x4430('0x49')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x4430('0x4a')](_0x289d86);})[_0x4430('0x1a')](function(_0x1bcc2c){_0x33284e[_0x4430('0x4b')]=_0x1bcc2c;return _0x33284e;})[_0x4430('0x1a')](respondWithFilteredResult(_0x5dbd33,_0x289d86))[_0x4430('0x24')](handleError(_0x5dbd33,null));};exports[_0x4430('0x4c')]=function(_0x4de57e,_0x294df9){var _0x45079b={'raw':![],'where':{'id':_0x4de57e[_0x4430('0x4d')]['id']}},_0x1adb9d={};_0x1adb9d[_0x4430('0x37')]=_[_0x4430('0x39')](db[_0x4430('0x34')][_0x4430('0x35')]);_0x1adb9d[_0x4430('0x38')]=_[_0x4430('0x39')](_0x4de57e['query']);_0x1adb9d['filters']=_[_0x4430('0x3a')](_0x1adb9d['model'],_0x1adb9d[_0x4430('0x38')]);_0x45079b['attributes']=_['intersection'](_0x1adb9d['model'],qs[_0x4430('0x3b')](_0x4de57e[_0x4430('0x38')]['fields']));_0x45079b[_0x4430('0x3c')]=_0x45079b['attributes'][_0x4430('0x4e')]?_0x45079b['attributes']:_0x1adb9d[_0x4430('0x37')];if(_0x4de57e[_0x4430('0x38')][_0x4430('0x4f')]){_0x45079b[_0x4430('0x49')]=[{'all':!![]}];}_0x45079b=_[_0x4430('0x47')]({},_0x45079b,_0x4de57e['options']);return db[_0x4430('0x34')][_0x4430('0x50')](_0x45079b)[_0x4430('0x1a')](handleEntityNotFound(_0x294df9,null))[_0x4430('0x1a')](respondWithResult(_0x294df9,null))[_0x4430('0x24')](handleError(_0x294df9,null));};exports[_0x4430('0x51')]=function(_0x4e9c26,_0x3e2341){return db['ServicenowAccount']['create'](_0x4e9c26[_0x4430('0x52')],{})['then'](respondWithResult(_0x3e2341,0xc9))[_0x4430('0x24')](handleError(_0x3e2341,null));};exports['update']=function(_0x427115,_0x1bcc00){if(_0x427115[_0x4430('0x52')]['id']){delete _0x427115['body']['id'];}return db[_0x4430('0x34')][_0x4430('0x50')]({'where':{'id':_0x427115['params']['id']}})[_0x4430('0x1a')](handleEntityNotFound(_0x1bcc00,null))['then'](saveUpdates(_0x427115[_0x4430('0x52')],null))[_0x4430('0x1a')](respondWithResult(_0x1bcc00,null))[_0x4430('0x24')](handleError(_0x1bcc00,null));};exports[_0x4430('0x2e')]=function(_0x428632,_0x41610f){return db[_0x4430('0x34')]['find']({'where':{'id':_0x428632[_0x4430('0x4d')]['id']}})[_0x4430('0x1a')](handleEntityNotFound(_0x41610f,null))[_0x4430('0x1a')](removeEntity(_0x41610f,null))[_0x4430('0x24')](handleError(_0x41610f,null));};exports[_0x4430('0x53')]=function(_0x10886c,_0x467528,_0x1f4007){var _0x59c5c8={};var _0x280458={};var _0x352567;var _0x5f1a26;return db[_0x4430('0x34')][_0x4430('0x54')]({'where':{'id':_0x10886c[_0x4430('0x4d')]['id']}})['then'](handleEntityNotFound(_0x467528,null))[_0x4430('0x1a')](function(_0x15b909){if(_0x15b909){_0x352567=_0x15b909;_0x280458[_0x4430('0x37')]=_[_0x4430('0x39')](db['ServicenowConfiguration']['rawAttributes']);_0x280458[_0x4430('0x38')]=_[_0x4430('0x39')](_0x10886c['query']);_0x280458[_0x4430('0x43')]=_[_0x4430('0x3a')](_0x280458[_0x4430('0x37')],_0x280458[_0x4430('0x38')]);_0x59c5c8[_0x4430('0x3c')]=_[_0x4430('0x3a')](_0x280458['model'],qs[_0x4430('0x3b')](_0x10886c['query']['fields']));_0x59c5c8['attributes']=_0x59c5c8[_0x4430('0x3c')][_0x4430('0x4e')]?_0x59c5c8[_0x4430('0x3c')]:_0x280458[_0x4430('0x37')];_0x59c5c8[_0x4430('0x40')]=qs[_0x4430('0x41')](_0x10886c[_0x4430('0x38')]['sort']);_0x59c5c8['where']=qs[_0x4430('0x43')](_[_0x4430('0x44')](_0x10886c[_0x4430('0x38')],_0x280458[_0x4430('0x43')]));if(_0x10886c[_0x4430('0x38')][_0x4430('0x45')]){_0x59c5c8[_0x4430('0x42')]=_[_0x4430('0x47')](_0x59c5c8[_0x4430('0x42')],{'$or':_['map'](_0x59c5c8[_0x4430('0x3c')],function(_0x3544a3){var _0x591d65={};_0x591d65[_0x3544a3]={'$like':'%'+_0x10886c[_0x4430('0x38')]['filter']+'%'};return _0x591d65;})});}_0x59c5c8=_[_0x4430('0x47')]({},_0x59c5c8,_0x10886c[_0x4430('0x48')]);return _0x352567[_0x4430('0x53')](_0x59c5c8);}})[_0x4430('0x1a')](function(_0x4f2f15){if(_0x4f2f15){_0x5f1a26=_0x4f2f15[_0x4430('0x4e')];if(!_0x10886c[_0x4430('0x38')]['hasOwnProperty']('nolimit')){_0x59c5c8[_0x4430('0x3f')]=qs[_0x4430('0x3f')](_0x10886c[_0x4430('0x38')][_0x4430('0x3f')]);_0x59c5c8[_0x4430('0x2a')]=qs['offset'](_0x10886c[_0x4430('0x38')][_0x4430('0x2a')]);}return _0x352567[_0x4430('0x53')](_0x59c5c8);}})[_0x4430('0x1a')](function(_0x3e9076){if(_0x3e9076){return _0x3e9076?{'count':_0x5f1a26,'rows':_0x3e9076}:null;}})[_0x4430('0x1a')](respondWithResult(_0x467528,null))[_0x4430('0x24')](handleError(_0x467528,null));};exports[_0x4430('0x55')]=function(_0x3d74f7,_0x23c5a9,_0x586cfe){if(_0x3d74f7[_0x4430('0x52')]['id']){delete _0x3d74f7[_0x4430('0x52')]['id'];}return db[_0x4430('0x34')][_0x4430('0x54')]({'where':{'id':_0x3d74f7[_0x4430('0x4d')]['id']}})['then'](handleEntityNotFound(_0x23c5a9,null))['then'](function(_0x111bef){if(_0x111bef){_0x3d74f7[_0x4430('0x52')][_0x4430('0x56')]=_0x111bef['id'];_0x3d74f7['body'][_0x4430('0x57')]=integrations[_0x4430('0x58')](_0x3d74f7[_0x4430('0x52')][_0x4430('0x59')],_0x3d74f7[_0x4430('0x52')]['type']);_0x3d74f7[_0x4430('0x52')][_0x4430('0x5a')]=integrations['getDescriptions'](_0x3d74f7[_0x4430('0x52')][_0x4430('0x59')],_0x3d74f7[_0x4430('0x52')][_0x4430('0x36')]);return db[_0x4430('0x5b')]['create'](_0x3d74f7['body'],{'include':[{'model':db[_0x4430('0x5c')],'as':_0x4430('0x57')},{'model':db[_0x4430('0x5c')],'as':_0x4430('0x5a')}]});}return null;})[_0x4430('0x1a')](respondWithResult(_0x23c5a9,null))[_0x4430('0x24')](handleError(_0x23c5a9,null));};exports[_0x4430('0x5d')]=function(_0x3a9ccf,_0x2c6779,_0x5b351f){var _0xeb7b0a=['made_sla',_0x4430('0x5e'),_0x4430('0x5f'),'subcategory',_0x4430('0x60'),'notify',_0x4430('0x61'),_0x4430('0x62'),_0x4430('0x63')];var _0x2a65ea=[_0x4430('0x64'),_0x4430('0x65'),_0x4430('0x66'),_0x4430('0x67'),_0x4430('0x68'),_0x4430('0x69'),_0x4430('0x6a'),'hold_reason',_0x4430('0x6b'),_0x4430('0x6c'),'resolved_by',_0x4430('0x6d'),'opened_by',_0x4430('0x6e'),_0x4430('0x6f'),_0x4430('0x70'),_0x4430('0x71'),_0x4430('0x72'),_0x4430('0x5f'),_0x4430('0x40'),'calendar_stc',_0x4430('0x73'),_0x4430('0x74'),_0x4430('0x75'),_0x4430('0x76'),_0x4430('0x77'),_0x4430('0x78'),_0x4430('0x79'),_0x4430('0x7a'),_0x4430('0x7b'),'rfc',_0x4430('0x7c'),_0x4430('0x7d'),_0x4430('0x7e'),_0x4430('0x7f'),_0x4430('0x80'),_0x4430('0x81'),'reopened_time',_0x4430('0x82'),'caller_id',_0x4430('0x83'),_0x4430('0x84'),_0x4430('0x85'),_0x4430('0x86'),_0x4430('0x60'),_0x4430('0x87'),_0x4430('0x88'),_0x4430('0x89'),_0x4430('0x8a'),'business_stc','additional_assignee_list',_0x4430('0x8b'),_0x4430('0x8c'),_0x4430('0x8d'),_0x4430('0x8e'),'close_notes','closed_by',_0x4430('0x8f'),'parent_incident',_0x4430('0x90'),_0x4430('0x91'),'reopened_by','incident_state',_0x4430('0x92'),_0x4430('0x93'),'company',_0x4430('0x94'),'activity_due','assigned_to','severity',_0x4430('0x95'),_0x4430('0x96'),'approval',_0x4430('0x97'),_0x4430('0x98'),_0x4430('0x99'),_0x4430('0x9a'),_0x4430('0x9b'),_0x4430('0x9c'),'upon_approval','correlation_id',_0x4430('0x9d'),_0x4430('0x63')];var _0x41cef5='';var _0x153399='';var _0x47f750=[];var _0x275792='';var _0x4d09db='';var _0x390b6d=[];var _0xbad35f='';var _0x21b09d='';var _0x374520={};var _0x4dcc65='';return db[_0x4430('0x34')]['findOne']({'where':{'id':_0x3a9ccf[_0x4430('0x4d')]['id']},'attributes':['id',_0x4430('0x9e'),'password',_0x4430('0x9f'),_0x4430('0xa0'),_0x4430('0xa1')]})[_0x4430('0x1a')](handleEntityNotFound(_0x2c6779,null))[_0x4430('0x1a')](function(_0x517ce9){if(_0x517ce9){_0x4dcc65=_0x517ce9[_0x4430('0xa0')];var _0x59cfcc=_0x4dcc65[_0x4430('0xa2')](-0x1);if(_0x59cfcc==='/'){_0x4dcc65=_0x4dcc65[_0x4430('0xa3')](0x0,_0x4dcc65[_0x4430('0xa4')](_0x59cfcc));}_0x21b09d=util[_0x4430('0xa5')]('%s/api/now/doc/table/schema/',_0x4dcc65);_0xbad35f=util['format']('%s/api/now/table/',_0x4dcc65);_0x374520={'user':_0x517ce9[_0x4430('0x9e')],'pass':_0x517ce9[_0x4430('0xa6')]};var _0x4a203c={'method':_0x4430('0xa7'),'uri':_0x21b09d+_0x4430('0xa8'),'auth':_0x374520,'json':!![]};return rp(_0x4a203c);}})[_0x4430('0x1a')](function(_0x28276f){if(_0x28276f[_0x4430('0x23')]['length']>0x0){_0x41cef5=_0x28276f[_0x4430('0x23')];}console[_0x4430('0xa9')](_0x4430('0xaa'),_0x41cef5);_0x390b6d=[];_0x153399=Object[_0x4430('0xab')]([],_0x41cef5);_['remove'](_0x153399,function(_0xcc557){return!_0xeb7b0a['includes'](_0xcc557[_0x4430('0x30')]);});_0x153399[_0x4430('0xac')](function(_0x2cbed9){var _0x1a5b41=createFieldObject(_0xbad35f,_0x374520,_0x2cbed9[_0x4430('0xad')],_0x2cbed9[_0x4430('0x30')],_0x2cbed9[_0x4430('0xae')],![]);_0x390b6d[_0x4430('0xaf')](_0x1a5b41);});return Promise[_0x4430('0xb0')](_0x390b6d);})['then'](function(_0x5a62c1){_0x47f750=_0x5a62c1;_0x275792=Object['assign']([],_0x41cef5);console[_0x4430('0xa9')](_0x4430('0xb1'),_0x41cef5);_['remove'](_0x275792,function(_0x1385c8){return _0x2a65ea[_0x4430('0xb2')](_0x1385c8[_0x4430('0x30')]);});console[_0x4430('0xa9')](_0x4430('0xb3'),_0x275792);_0x390b6d=[];_0x275792[_0x4430('0xac')](function(_0x51b870){var _0x376390=createFieldObject(_0xbad35f,_0x374520,_0x51b870[_0x4430('0xad')],_0x51b870[_0x4430('0x30')],_0x51b870[_0x4430('0xae')],!![]);_0x390b6d['push'](_0x376390);});return Promise[_0x4430('0xb0')](_0x390b6d);})[_0x4430('0x1a')](function(_0x548844){_0x4d09db=_0x548844;var _0x36e28b=_0x47f750[_0x4430('0xb4')](_0x4d09db);return{'count':_0x36e28b[_0x4430('0x4e')],'rows':_0x36e28b};})[_0x4430('0x1a')](respondWithResult(_0x2c6779,null))[_0x4430('0x24')](function(_0x10da00){console[_0x4430('0xa9')]('ServiceNow\x20error:\x20'+_0x10da00);var _0x5c8031=_0x3a9ccf[_0x4430('0x38')][_0x4430('0x16')]?0x1f4:_0x10da00['statusCode']||0x1f4;logger[_0x4430('0x20')](_0x10da00[_0x4430('0x2f')]);delete _0x10da00[_0x4430('0x30')];if(_0x5c8031===0x191){_0x5c8031=0x190;}_0x2c6779[_0x4430('0x26')](_0x5c8031)[_0x4430('0x31')](_0x3a9ccf['query'][_0x4430('0x16')]?{'message':_0x4430('0xb5'),'statusCode':_0x10da00[_0x4430('0xb6')]}:_0x10da00);});};function createFieldObject(_0x1bf1ba,_0x313f93,_0x29e35d,_0xd486f3,_0x5393ba,_0x10c966){return new Promise(function(_0x3a9b44,_0x45584d){var _0x1f153d={'id':_0xd486f3,'name':_0x5393ba,'custom':_0x10c966};if(_0x29e35d===_0x4430('0xb7')){_0x1f153d[_0x4430('0x48')]=[{'name':_0x4430('0xb8'),'value':_0x4430('0xb9')},{'name':_0x4430('0xba'),'value':'false'}];_0x3a9b44(_0x1f153d);}else{var _0x70c07d={'method':_0x4430('0xa7'),'uri':_0x1bf1ba+_0x4430('0xbb')+_0xd486f3,'auth':_0x313f93,'json':!![]};return rp(_0x70c07d)[_0x4430('0x1a')](function(_0x2ffcf9){var _0x2b0709=[];if(_0x2ffcf9[_0x4430('0x23')][_0x4430('0x4e')]>0x0){_0x2ffcf9[_0x4430('0x23')]['forEach'](function(_0x18dcef){if(_0x18dcef[_0x4430('0xbc')]===_0x4430('0xbd')){var _0x403b0e={'name':_0x18dcef[_0x4430('0xae')],'value':_0x18dcef[_0x4430('0xbe')]};_0x2b0709[_0x4430('0xaf')](_0x403b0e);}});}_0x1f153d[_0x4430('0x48')]=_0x2b0709;if(_0x1f153d[_0x4430('0x48')]['length']>0x0){_0x3a9b44(_0x1f153d);}else{if(_0x10c966==![]){_0x3a9b44();}else{_0x3a9b44(_0x1f153d);}}});}});}
\ No newline at end of file
+var _0xb9bc=['closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','caller_id','approval_set','short_description','delivery_task','assignment_group','business_stc','description','calendar_duration','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','findOne','username','password','remoteUri','serverUrl','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','remove','includes','forEach','internalType','label','push','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count','offset','set','Content-Range','reject','save','update','then','end','sendStatus','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','keys','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','include','findAll','params','includeAll','options','find','body','destroy','getConfigurations','pick','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','create','Subjects','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','parent','caused_by','watch_list','sys_updated_on','approval_history','number','sys_updated_by','user_input','sys_created_on','state','sys_created_by','calendar_stc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9bc,0x1c2));var _0xcb9b=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0xb9bc[_0x1e500e];return _0x10dc5e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcb9b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb9b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb9b('0x2'));var moment=require(_0xcb9b('0x3'));var BPromise=require(_0xcb9b('0x4'));var Mustache=require(_0xcb9b('0x5'));var util=require(_0xcb9b('0x6'));var path=require(_0xcb9b('0x7'));var sox=require('sox');var csv=require(_0xcb9b('0x8'));var ejs=require(_0xcb9b('0x9'));var fs=require('fs');var _=require(_0xcb9b('0xa'));var squel=require(_0xcb9b('0xb'));var crypto=require(_0xcb9b('0xc'));var jsforce=require(_0xcb9b('0xd'));var deskjs=require(_0xcb9b('0xe'));var toCsv=require(_0xcb9b('0x8'));var querystring=require(_0xcb9b('0xf'));var Papa=require('papaparse');var Redis=require(_0xcb9b('0x10'));var authService=require(_0xcb9b('0x11'));var qs=require(_0xcb9b('0x12'));var as=require(_0xcb9b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb9b('0x14'))(_0xcb9b('0x15'));var utils=require(_0xcb9b('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0xcb9b('0x17'));var jayson=require(_0xcb9b('0x18'));var client=jayson[_0xcb9b('0x19')][_0xcb9b('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x228097,_0x1bcb42,_0x48e245){if(_0x48e245){var _0x495eee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x495eee['test'](_0x1bcb42)){return _0x228097;}else{throw new db[(_0xcb9b('0x1b'))][(_0xcb9b('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x228097;}}function respondWithRpcPromise(_0x141f20,_0x33fb6e,_0x47ca10,_0x42abb4){return new BPromise(function(_0x273309,_0x2ac346){var _0x485173=_0x42abb4||client;return _0x485173[_0xcb9b('0x1d')](_0x141f20,_0x47ca10)['then'](function(_0x48f863){logger[_0xcb9b('0x1e')](_0xcb9b('0x1f'),_0x33fb6e,_0xcb9b('0x20'));logger[_0xcb9b('0x21')](_0xcb9b('0x22'),_0x33fb6e,'request\x20sent',JSON[_0xcb9b('0x23')](_0x48f863));if(_0x48f863['error']){if(_0x48f863[_0xcb9b('0x24')][_0xcb9b('0x25')]===0x1f4){logger['error'](_0xcb9b('0x1f'),_0x33fb6e,_0x48f863[_0xcb9b('0x24')][_0xcb9b('0x26')]);return _0x2ac346(_0x48f863[_0xcb9b('0x24')][_0xcb9b('0x26')]);}logger[_0xcb9b('0x24')](_0xcb9b('0x1f'),_0x33fb6e,_0x48f863[_0xcb9b('0x24')][_0xcb9b('0x26')]);return _0x273309(_0x48f863[_0xcb9b('0x24')]['message']);}else{logger[_0xcb9b('0x1e')](_0xcb9b('0x1f'),_0x33fb6e,_0xcb9b('0x20'));_0x273309(_0x48f863[_0xcb9b('0x27')][_0xcb9b('0x26')]);}})[_0xcb9b('0x28')](function(_0x3bab79){logger[_0xcb9b('0x24')](_0xcb9b('0x1f'),_0x33fb6e,_0x3bab79);_0x2ac346(_0x3bab79);});});}function respondWithStatusCode(_0x27ded9,_0x282eea){_0x282eea=_0x282eea||0xcc;return function(_0x21cdf6){if(_0x21cdf6){return _0x27ded9['sendStatus'](_0x282eea);}return _0x27ded9[_0xcb9b('0x29')](_0x282eea)['end']();};}function respondWithResult(_0x47d43b,_0x3f74b8){_0x3f74b8=_0x3f74b8||0xc8;return function(_0x40a110){if(_0x40a110){return _0x47d43b[_0xcb9b('0x29')](_0x3f74b8)[_0xcb9b('0x2a')](_0x40a110);}};}function respondWithFilteredResult(_0x40e057,_0x55c8af){return function(_0x517283){if(_0x517283){var _0x4bb20a=_0x517283[_0xcb9b('0x2b')],_0x36648c=_0x55c8af[_0xcb9b('0x2c')],_0x331b3e=_0x55c8af[_0xcb9b('0x2c')]+_0x55c8af['limit'],_0xcc1c07;if(_0x331b3e>=_0x4bb20a){_0x331b3e=_0x4bb20a;_0xcc1c07=0xc8;}else{_0xcc1c07=0xce;}_0x40e057[_0xcb9b('0x29')](_0xcc1c07);return _0x40e057[_0xcb9b('0x2d')](_0xcb9b('0x2e'),_0x36648c+'-'+_0x331b3e+'/'+_0x4bb20a)[_0xcb9b('0x2a')](_0x517283);}return null;};}function patchUpdates(_0x381e35){return function(_0x43ca15){try{jsonpatch['apply'](_0x43ca15,_0x381e35,!![]);}catch(_0x13d140){return BPromise[_0xcb9b('0x2f')](_0x13d140);}return _0x43ca15[_0xcb9b('0x30')]();};}function saveUpdates(_0x45f366,_0x3704ec){return function(_0x284431){if(_0x284431){return _0x284431[_0xcb9b('0x31')](_0x45f366)['then'](function(_0x3ec1fd){return _0x3ec1fd;});}return null;};}function removeEntity(_0x5a62f4,_0x314ba8){return function(_0x321cd9){if(_0x321cd9){return _0x321cd9['destroy']()[_0xcb9b('0x32')](function(){_0x5a62f4[_0xcb9b('0x29')](0xcc)[_0xcb9b('0x33')]();});}};}function handleEntityNotFound(_0x1c52b7,_0x2d807e){return function(_0x567f88){if(!_0x567f88){_0x1c52b7[_0xcb9b('0x34')](0x194);}return _0x567f88;};}function handleError(_0x30d28d,_0x5c265c){_0x5c265c=_0x5c265c||0x1f4;return function(_0x27a45d){logger[_0xcb9b('0x24')](_0x27a45d[_0xcb9b('0x35')]);if(_0x27a45d[_0xcb9b('0x36')]){delete _0x27a45d[_0xcb9b('0x36')];}_0x30d28d[_0xcb9b('0x29')](_0x5c265c)[_0xcb9b('0x37')](_0x27a45d);};}exports[_0xcb9b('0x38')]=function(_0x3d4a7a,_0x3c1334){var _0x5499c2={},_0x34df09={},_0x44f1c5={'count':0x0,'rows':[]};var _0x44e0c5=_[_0xcb9b('0x39')](db[_0xcb9b('0x3a')][_0xcb9b('0x3b')],function(_0x1290f9){return{'name':_0x1290f9[_0xcb9b('0x3c')],'type':_0x1290f9[_0xcb9b('0x3d')][_0xcb9b('0x3e')]};});_0x34df09[_0xcb9b('0x3f')]=_[_0xcb9b('0x39')](_0x44e0c5,'name');_0x34df09['query']=_[_0xcb9b('0x40')](_0x3d4a7a['query']);_0x34df09['filters']=_['intersection'](_0x34df09['model'],_0x34df09['query']);_0x5499c2['attributes']=_[_0xcb9b('0x41')](_0x34df09[_0xcb9b('0x3f')],qs[_0xcb9b('0x42')](_0x3d4a7a[_0xcb9b('0x43')]['fields']));_0x5499c2[_0xcb9b('0x44')]=_0x5499c2[_0xcb9b('0x44')][_0xcb9b('0x45')]?_0x5499c2[_0xcb9b('0x44')]:_0x34df09[_0xcb9b('0x3f')];if(!_0x3d4a7a['query'][_0xcb9b('0x46')](_0xcb9b('0x47'))){_0x5499c2[_0xcb9b('0x48')]=qs['limit'](_0x3d4a7a[_0xcb9b('0x43')][_0xcb9b('0x48')]);_0x5499c2['offset']=qs['offset'](_0x3d4a7a[_0xcb9b('0x43')][_0xcb9b('0x2c')]);}_0x5499c2[_0xcb9b('0x49')]=qs[_0xcb9b('0x4a')](_0x3d4a7a['query'][_0xcb9b('0x4a')]);_0x5499c2[_0xcb9b('0x4b')]=qs[_0xcb9b('0x4c')](_['pick'](_0x3d4a7a[_0xcb9b('0x43')],_0x34df09[_0xcb9b('0x4c')]),_0x44e0c5);if(_0x3d4a7a['query'][_0xcb9b('0x4d')]){_0x5499c2[_0xcb9b('0x4b')]=_[_0xcb9b('0x4e')](_0x5499c2[_0xcb9b('0x4b')],{'$or':_[_0xcb9b('0x39')](_0x44e0c5,function(_0x46eb46){if(_0x46eb46[_0xcb9b('0x3d')]!=='VIRTUAL'){var _0x42e413={};_0x42e413[_0x46eb46[_0xcb9b('0x36')]]={'$like':'%'+_0x3d4a7a[_0xcb9b('0x43')][_0xcb9b('0x4d')]+'%'};return _0x42e413;}})});}_0x5499c2=_[_0xcb9b('0x4e')]({},_0x5499c2,_0x3d4a7a['options']);var _0x339492={'where':_0x5499c2[_0xcb9b('0x4b')]};return db[_0xcb9b('0x3a')][_0xcb9b('0x2b')](_0x339492)[_0xcb9b('0x32')](function(_0x273297){_0x44f1c5[_0xcb9b('0x2b')]=_0x273297;if(_0x3d4a7a[_0xcb9b('0x43')]['includeAll']){_0x5499c2[_0xcb9b('0x4f')]=[{'all':!![]}];}return db[_0xcb9b('0x3a')][_0xcb9b('0x50')](_0x5499c2);})[_0xcb9b('0x32')](function(_0x2b7fdd){_0x44f1c5['rows']=_0x2b7fdd;return _0x44f1c5;})[_0xcb9b('0x32')](respondWithFilteredResult(_0x3c1334,_0x5499c2))['catch'](handleError(_0x3c1334,null));};exports['show']=function(_0x56e701,_0x2302b8){var _0x5debf6={'raw':![],'where':{'id':_0x56e701[_0xcb9b('0x51')]['id']}},_0x5df0d3={};_0x5df0d3['model']=_[_0xcb9b('0x40')](db[_0xcb9b('0x3a')][_0xcb9b('0x3b')]);_0x5df0d3[_0xcb9b('0x43')]=_['keys'](_0x56e701[_0xcb9b('0x43')]);_0x5df0d3['filters']=_[_0xcb9b('0x41')](_0x5df0d3['model'],_0x5df0d3[_0xcb9b('0x43')]);_0x5debf6[_0xcb9b('0x44')]=_[_0xcb9b('0x41')](_0x5df0d3[_0xcb9b('0x3f')],qs[_0xcb9b('0x42')](_0x56e701[_0xcb9b('0x43')][_0xcb9b('0x42')]));_0x5debf6[_0xcb9b('0x44')]=_0x5debf6[_0xcb9b('0x44')][_0xcb9b('0x45')]?_0x5debf6['attributes']:_0x5df0d3[_0xcb9b('0x3f')];if(_0x56e701[_0xcb9b('0x43')][_0xcb9b('0x52')]){_0x5debf6[_0xcb9b('0x4f')]=[{'all':!![]}];}_0x5debf6=_[_0xcb9b('0x4e')]({},_0x5debf6,_0x56e701[_0xcb9b('0x53')]);return db[_0xcb9b('0x3a')][_0xcb9b('0x54')](_0x5debf6)[_0xcb9b('0x32')](handleEntityNotFound(_0x2302b8,null))['then'](respondWithResult(_0x2302b8,null))['catch'](handleError(_0x2302b8,null));};exports['create']=function(_0x5e448c,_0x14c472){return db[_0xcb9b('0x3a')]['create'](_0x5e448c['body'],{})['then'](respondWithResult(_0x14c472,0xc9))[_0xcb9b('0x28')](handleError(_0x14c472,null));};exports[_0xcb9b('0x31')]=function(_0x8ec8aa,_0x4f759c){if(_0x8ec8aa[_0xcb9b('0x55')]['id']){delete _0x8ec8aa[_0xcb9b('0x55')]['id'];}return db[_0xcb9b('0x3a')]['find']({'where':{'id':_0x8ec8aa['params']['id']}})[_0xcb9b('0x32')](handleEntityNotFound(_0x4f759c,null))[_0xcb9b('0x32')](saveUpdates(_0x8ec8aa[_0xcb9b('0x55')],null))[_0xcb9b('0x32')](respondWithResult(_0x4f759c,null))['catch'](handleError(_0x4f759c,null));};exports[_0xcb9b('0x56')]=function(_0x3e9984,_0x2cbfab){return db[_0xcb9b('0x3a')][_0xcb9b('0x54')]({'where':{'id':_0x3e9984[_0xcb9b('0x51')]['id']}})[_0xcb9b('0x32')](handleEntityNotFound(_0x2cbfab,null))[_0xcb9b('0x32')](removeEntity(_0x2cbfab,null))['catch'](handleError(_0x2cbfab,null));};exports[_0xcb9b('0x57')]=function(_0x2f383f,_0x4871a7,_0x2ca58b){var _0x3ab434={};var _0x4f52b6={};var _0x4b4bea;var _0x41d081;return db[_0xcb9b('0x3a')]['findOne']({'where':{'id':_0x2f383f['params']['id']}})[_0xcb9b('0x32')](handleEntityNotFound(_0x4871a7,null))[_0xcb9b('0x32')](function(_0x4850b4){if(_0x4850b4){_0x4b4bea=_0x4850b4;_0x4f52b6[_0xcb9b('0x3f')]=_['keys'](db['ServicenowConfiguration'][_0xcb9b('0x3b')]);_0x4f52b6['query']=_[_0xcb9b('0x40')](_0x2f383f[_0xcb9b('0x43')]);_0x4f52b6['filters']=_[_0xcb9b('0x41')](_0x4f52b6[_0xcb9b('0x3f')],_0x4f52b6[_0xcb9b('0x43')]);_0x3ab434['attributes']=_[_0xcb9b('0x41')](_0x4f52b6[_0xcb9b('0x3f')],qs[_0xcb9b('0x42')](_0x2f383f[_0xcb9b('0x43')][_0xcb9b('0x42')]));_0x3ab434[_0xcb9b('0x44')]=_0x3ab434['attributes'][_0xcb9b('0x45')]?_0x3ab434[_0xcb9b('0x44')]:_0x4f52b6[_0xcb9b('0x3f')];_0x3ab434[_0xcb9b('0x49')]=qs[_0xcb9b('0x4a')](_0x2f383f[_0xcb9b('0x43')][_0xcb9b('0x4a')]);_0x3ab434[_0xcb9b('0x4b')]=qs[_0xcb9b('0x4c')](_[_0xcb9b('0x58')](_0x2f383f[_0xcb9b('0x43')],_0x4f52b6[_0xcb9b('0x4c')]));if(_0x2f383f[_0xcb9b('0x43')][_0xcb9b('0x4d')]){_0x3ab434[_0xcb9b('0x4b')]=_[_0xcb9b('0x4e')](_0x3ab434[_0xcb9b('0x4b')],{'$or':_[_0xcb9b('0x39')](_0x3ab434['attributes'],function(_0x227661){var _0x54ad8a={};_0x54ad8a[_0x227661]={'$like':'%'+_0x2f383f[_0xcb9b('0x43')][_0xcb9b('0x4d')]+'%'};return _0x54ad8a;})});}_0x3ab434=_[_0xcb9b('0x4e')]({},_0x3ab434,_0x2f383f[_0xcb9b('0x53')]);return _0x4b4bea[_0xcb9b('0x57')](_0x3ab434);}})[_0xcb9b('0x32')](function(_0x52512d){if(_0x52512d){_0x41d081=_0x52512d[_0xcb9b('0x45')];if(!_0x2f383f['query'][_0xcb9b('0x46')](_0xcb9b('0x47'))){_0x3ab434['limit']=qs['limit'](_0x2f383f[_0xcb9b('0x43')][_0xcb9b('0x48')]);_0x3ab434['offset']=qs[_0xcb9b('0x2c')](_0x2f383f[_0xcb9b('0x43')][_0xcb9b('0x2c')]);}return _0x4b4bea[_0xcb9b('0x57')](_0x3ab434);}})['then'](function(_0x154f30){if(_0x154f30){return _0x154f30?{'count':_0x41d081,'rows':_0x154f30}:null;}})[_0xcb9b('0x32')](respondWithResult(_0x4871a7,null))['catch'](handleError(_0x4871a7,null));};exports[_0xcb9b('0x59')]=function(_0x879651,_0x73ffeb,_0xd9d179){if(_0x879651[_0xcb9b('0x55')]['id']){delete _0x879651[_0xcb9b('0x55')]['id'];}return db[_0xcb9b('0x3a')]['findOne']({'where':{'id':_0x879651[_0xcb9b('0x51')]['id']}})[_0xcb9b('0x32')](handleEntityNotFound(_0x73ffeb,null))[_0xcb9b('0x32')](function(_0x13da35){if(_0x13da35){_0x879651[_0xcb9b('0x55')]['AccountId']=_0x13da35['id'];_0x879651[_0xcb9b('0x55')]['Subjects']=integrations[_0xcb9b('0x5a')](_0x879651['body'][_0xcb9b('0x5b')],_0x879651['body'][_0xcb9b('0x3d')]);_0x879651[_0xcb9b('0x55')][_0xcb9b('0x5c')]=integrations[_0xcb9b('0x5d')](_0x879651[_0xcb9b('0x55')][_0xcb9b('0x5b')],_0x879651[_0xcb9b('0x55')]['type']);return db[_0xcb9b('0x5e')][_0xcb9b('0x5f')](_0x879651[_0xcb9b('0x55')],{'include':[{'model':db['ServicenowField'],'as':_0xcb9b('0x60')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x73ffeb,null))[_0xcb9b('0x28')](handleError(_0x73ffeb,null));};exports['getFields']=function(_0x452613,_0x362792,_0x23d79f){var _0x2850b9=[_0xcb9b('0x61'),_0xcb9b('0x62'),_0xcb9b('0x63'),_0xcb9b('0x64'),_0xcb9b('0x65'),_0xcb9b('0x66'),_0xcb9b('0x67'),_0xcb9b('0x68'),'category'];var _0x5c82c6=[_0xcb9b('0x69'),_0xcb9b('0x61'),_0xcb9b('0x6a'),_0xcb9b('0x6b'),'upon_reject',_0xcb9b('0x6c'),'child_incidents',_0xcb9b('0x62'),_0xcb9b('0x6d'),_0xcb9b('0x6e'),'resolved_by',_0xcb9b('0x6f'),'opened_by',_0xcb9b('0x70'),_0xcb9b('0x71'),'sys_domain',_0xcb9b('0x72'),_0xcb9b('0x73'),_0xcb9b('0x63'),'order',_0xcb9b('0x74'),_0xcb9b('0x75'),_0xcb9b('0x76'),_0xcb9b('0x77'),_0xcb9b('0x78'),_0xcb9b('0x79'),_0xcb9b('0x7a'),_0xcb9b('0x7b'),_0xcb9b('0x7c'),_0xcb9b('0x7d'),_0xcb9b('0x7e'),_0xcb9b('0x7f'),_0xcb9b('0x80'),_0xcb9b('0x81'),_0xcb9b('0x82'),'group_list',_0xcb9b('0x83'),'reopened_time','resolved_at',_0xcb9b('0x84'),_0xcb9b('0x85'),_0xcb9b('0x64'),'work_notes',_0xcb9b('0x86'),'close_code','correlation_display',_0xcb9b('0x87'),'work_start',_0xcb9b('0x88'),_0xcb9b('0x89'),'additional_assignee_list',_0xcb9b('0x8a'),_0xcb9b('0x8b'),_0xcb9b('0x66'),'sys_class_name',_0xcb9b('0x8c'),'closed_by',_0xcb9b('0x8d'),_0xcb9b('0x8e'),_0xcb9b('0x8f'),_0xcb9b('0x90'),_0xcb9b('0x91'),'incident_state','urgency',_0xcb9b('0x92'),_0xcb9b('0x93'),_0xcb9b('0x94'),_0xcb9b('0x95'),'assigned_to','severity','comments',_0xcb9b('0x96'),'approval',_0xcb9b('0x97'),_0xcb9b('0x98'),_0xcb9b('0x99'),_0xcb9b('0x9a'),_0xcb9b('0x9b'),'escalation',_0xcb9b('0x9c'),'correlation_id','location','category'];var _0x51c67a='';var _0x2b76cb='';var _0x431968=[];var _0x478190='';var _0x250ec2='';var _0x4395c9=[];var _0x325ba4='';var _0x281022='';var _0x2cb4a9={};var _0xcd6ec3='';return db[_0xcb9b('0x3a')][_0xcb9b('0x9d')]({'where':{'id':_0x452613['params']['id']},'attributes':['id',_0xcb9b('0x9e'),_0xcb9b('0x9f'),'email',_0xcb9b('0xa0'),_0xcb9b('0xa1')]})['then'](handleEntityNotFound(_0x362792,null))['then'](function(_0x344081){if(_0x344081){_0xcd6ec3=_0x344081[_0xcb9b('0xa0')];var _0x2d90aa=_0xcd6ec3['slice'](-0x1);if(_0x2d90aa==='/'){_0xcd6ec3=_0xcd6ec3['substring'](0x0,_0xcd6ec3[_0xcb9b('0xa2')](_0x2d90aa));}_0x281022=util[_0xcb9b('0xa3')](_0xcb9b('0xa4'),_0xcd6ec3);_0x325ba4=util[_0xcb9b('0xa3')](_0xcb9b('0xa5'),_0xcd6ec3);_0x2cb4a9={'user':_0x344081[_0xcb9b('0x9e')],'pass':_0x344081[_0xcb9b('0x9f')]};var _0x3d6875={'method':_0xcb9b('0xa6'),'uri':_0x281022+_0xcb9b('0xa7'),'auth':_0x2cb4a9,'json':!![]};return rp(_0x3d6875);}})[_0xcb9b('0x32')](function(_0x4291e3){if(_0x4291e3['result'][_0xcb9b('0x45')]>0x0){_0x51c67a=_0x4291e3[_0xcb9b('0x27')];}console[_0xcb9b('0xa8')]('incident\x20table\x20objects',_0x51c67a);_0x4395c9=[];_0x2b76cb=Object['assign']([],_0x51c67a);_[_0xcb9b('0xa9')](_0x2b76cb,function(_0x34b373){return!_0x2850b9[_0xcb9b('0xaa')](_0x34b373[_0xcb9b('0x36')]);});_0x2b76cb[_0xcb9b('0xab')](function(_0x24c35c){var _0x2dc9c5=createFieldObject(_0x325ba4,_0x2cb4a9,_0x24c35c[_0xcb9b('0xac')],_0x24c35c[_0xcb9b('0x36')],_0x24c35c[_0xcb9b('0xad')],![]);_0x4395c9[_0xcb9b('0xae')](_0x2dc9c5);});return Promise[_0xcb9b('0xaf')](_0x4395c9);})[_0xcb9b('0x32')](function(_0x18c9aa){_0x431968=_0x18c9aa;_0x478190=Object[_0xcb9b('0xb0')]([],_0x51c67a);console[_0xcb9b('0xa8')](_0xcb9b('0xb1'),_0x51c67a);_[_0xcb9b('0xa9')](_0x478190,function(_0x1d0df8){return _0x5c82c6[_0xcb9b('0xaa')](_0x1d0df8[_0xcb9b('0x36')]);});console[_0xcb9b('0xa8')](_0xcb9b('0xb2'),_0x478190);_0x4395c9=[];_0x478190['forEach'](function(_0x53a3b5){var _0x130dc9=createFieldObject(_0x325ba4,_0x2cb4a9,_0x53a3b5['internalType'],_0x53a3b5[_0xcb9b('0x36')],_0x53a3b5[_0xcb9b('0xad')],!![]);_0x4395c9[_0xcb9b('0xae')](_0x130dc9);});return Promise[_0xcb9b('0xaf')](_0x4395c9);})[_0xcb9b('0x32')](function(_0x3eb7d2){_0x250ec2=_0x3eb7d2;var _0x4f4ef5=_0x431968[_0xcb9b('0xb3')](_0x250ec2);return{'count':_0x4f4ef5['length'],'rows':_0x4f4ef5};})[_0xcb9b('0x32')](respondWithResult(_0x362792,null))['catch'](function(_0x7c7778){console[_0xcb9b('0xa8')](_0xcb9b('0xb4')+_0x7c7778);var _0x5cf663=_0x452613[_0xcb9b('0x43')][_0xcb9b('0xb5')]?0x1f4:_0x7c7778['statusCode']||0x1f4;logger[_0xcb9b('0x24')](_0x7c7778[_0xcb9b('0x35')]);delete _0x7c7778[_0xcb9b('0x36')];if(_0x5cf663===0x191){_0x5cf663=0x190;}_0x362792[_0xcb9b('0x29')](_0x5cf663)[_0xcb9b('0x37')](_0x452613[_0xcb9b('0x43')]['test']?{'message':_0xcb9b('0xb6'),'statusCode':_0x7c7778[_0xcb9b('0xb7')]}:_0x7c7778);});};function createFieldObject(_0x11c72e,_0x48a5fc,_0x4039dc,_0x44552a,_0x2c6a97,_0x3d55f1){return new Promise(function(_0x2b25d9,_0xa5e995){var _0x274f65={'id':_0x44552a,'name':_0x2c6a97,'custom':_0x3d55f1};if(_0x4039dc===_0xcb9b('0xb8')){_0x274f65['options']=[{'name':_0xcb9b('0xb9'),'value':'true'},{'name':_0xcb9b('0xba'),'value':_0xcb9b('0xbb')}];_0x2b25d9(_0x274f65);}else{var _0x2cc881={'method':_0xcb9b('0xa6'),'uri':_0x11c72e+_0xcb9b('0xbc')+_0x44552a,'auth':_0x48a5fc,'json':!![]};return rp(_0x2cc881)['then'](function(_0x3909c8){var _0x236eab=[];if(_0x3909c8['result'][_0xcb9b('0x45')]>0x0){_0x3909c8[_0xcb9b('0x27')]['forEach'](function(_0x38c55c){if(_0x38c55c['inactive']===_0xcb9b('0xbb')){var _0x26e9b9={'name':_0x38c55c[_0xcb9b('0xad')],'value':_0x38c55c['value']};_0x236eab[_0xcb9b('0xae')](_0x26e9b9);}});}_0x274f65[_0xcb9b('0x53')]=_0x236eab;if(_0x274f65[_0xcb9b('0x53')]['length']>0x0){_0x2b25d9(_0x274f65);}else{if(_0x3d55f1==![]){_0x2b25d9();}else{_0x2b25d9(_0x274f65);}}});}});}
\ No newline at end of file
index a8e9917..0a45817 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e0d=['../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes'];(function(_0x1fb6e2,_0xae8005){var _0x3c9cd9=function(_0x63b140){while(--_0x63b140){_0x1fb6e2['push'](_0x1fb6e2['shift']());}};_0x3c9cd9(++_0xae8005);}(_0x0e0d,0x1c5));var _0xd0e0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0e0d[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xd0e0('0x0'));var logger=require(_0xd0e0('0x1'))(_0xd0e0('0x2'));var moment=require(_0xd0e0('0x3'));var BPromise=require(_0xd0e0('0x4'));var rp=require(_0xd0e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0e0('0x6'));var config=require(_0xd0e0('0x7'));var attributes=require(_0xd0e0('0x8'));var integrations=require(_0xd0e0('0x9'));module[_0xd0e0('0xa')]=function(_0x15ccec,_0x109252){return _0x15ccec[_0xd0e0('0xb')](_0xd0e0('0xc'),attributes,{'tableName':_0xd0e0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2542=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','ServicenowAccount','util','../../config/logger','api'];(function(_0x2f8abf,_0x19757c){var _0x63b80a=function(_0x4620dc){while(--_0x4620dc){_0x2f8abf['push'](_0x2f8abf['shift']());}};_0x63b80a(++_0x19757c);}(_0x2542,0xcd));var _0x2254=function(_0x2233de,_0x3f709e){_0x2233de=_0x2233de-0x0;var _0x9279a7=_0x2542[_0x2233de];return _0x9279a7;};'use strict';var _=require('lodash');var util=require(_0x2254('0x0'));var logger=require(_0x2254('0x1'))(_0x2254('0x2'));var moment=require(_0x2254('0x3'));var BPromise=require(_0x2254('0x4'));var rp=require(_0x2254('0x5'));var fs=require('fs');var path=require(_0x2254('0x6'));var rimraf=require(_0x2254('0x7'));var config=require(_0x2254('0x8'));var attributes=require(_0x2254('0x9'));var integrations=require(_0x2254('0xa'));module[_0x2254('0xb')]=function(_0x41cb31,_0x26cc3){return _0x41cb31['define'](_0x2254('0xc'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4f58a07..351aafd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x203c=['findAll','raw','options','where','attributes','limit','include','map','model','then','ShowServicenowAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','ServicenowAccount,\x20%s,\x20%s','result','catch','GetServicenowAccount','ServicenowAccount'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x203c,0x1b0));var _0xc203=function(_0x324164,_0x3a65ae){_0x324164=_0x324164-0x0;var _0x4c853d=_0x203c[_0x324164];return _0x4c853d;};'use strict';var _=require(_0xc203('0x0'));var util=require(_0xc203('0x1'));var moment=require('moment');var BPromise=require(_0xc203('0x2'));var rs=require(_0xc203('0x3'));var fs=require('fs');var Redis=require(_0xc203('0x4'));var db=require(_0xc203('0x5'))['db'];var utils=require(_0xc203('0x6'));var logger=require('../../config/logger')(_0xc203('0x7'));var config=require('../../config/environment');var jayson=require(_0xc203('0x8'));var client=jayson['client'][_0xc203('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bf394,_0x158350,_0x535e35){return new BPromise(function(_0x1daa99,_0xd6b5f1){return client[_0xc203('0xa')](_0x3bf394,_0x535e35)['then'](function(_0x31e61a){logger[_0xc203('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0x158350,_0xc203('0xc'));logger[_0xc203('0xd')](_0xc203('0xe'),_0x158350,_0xc203('0xc'),JSON[_0xc203('0xf')](_0x31e61a));if(_0x31e61a['error']){if(_0x31e61a[_0xc203('0x10')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x158350,_0x31e61a[_0xc203('0x10')][_0xc203('0x11')]);return _0xd6b5f1(_0x31e61a[_0xc203('0x10')][_0xc203('0x11')]);}logger[_0xc203('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x158350,_0x31e61a['error']['message']);return _0x1daa99(_0x31e61a[_0xc203('0x10')][_0xc203('0x11')]);}else{logger['info'](_0xc203('0x12'),_0x158350,_0xc203('0xc'));_0x1daa99(_0x31e61a[_0xc203('0x13')]['message']);}})[_0xc203('0x14')](function(_0x47299f){logger[_0xc203('0x10')](_0xc203('0x12'),_0x158350,_0x47299f);_0xd6b5f1(_0x47299f);});});}exports[_0xc203('0x15')]=function(_0x4bf55f){var _0x4c88ed=this;return new Promise(function(_0x1d4128,_0x1579e5){return db[_0xc203('0x16')][_0xc203('0x17')]({'raw':_0x4bf55f['options']?_0x4bf55f['options'][_0xc203('0x18')]===undefined?!![]:![]:!![],'where':_0x4bf55f[_0xc203('0x19')]?_0x4bf55f[_0xc203('0x19')][_0xc203('0x1a')]||null:null,'attributes':_0x4bf55f[_0xc203('0x19')]?_0x4bf55f[_0xc203('0x19')][_0xc203('0x1b')]||null:null,'limit':_0x4bf55f[_0xc203('0x19')]?_0x4bf55f[_0xc203('0x19')][_0xc203('0x1c')]||null:null,'include':_0x4bf55f['options']?_0x4bf55f[_0xc203('0x19')][_0xc203('0x1d')]?_[_0xc203('0x1e')](_0x4bf55f[_0xc203('0x19')][_0xc203('0x1d')],function(_0x137989){return{'model':db[_0x137989[_0xc203('0x1f')]],'as':_0x137989['as'],'attributes':_0x137989[_0xc203('0x1b')],'include':_0x137989[_0xc203('0x1d')]?_[_0xc203('0x1e')](_0x137989[_0xc203('0x1d')],function(_0x2dc0e5){return{'model':db[_0x2dc0e5[_0xc203('0x1f')]],'as':_0x2dc0e5['as'],'attributes':_0x2dc0e5['attributes'],'include':_0x2dc0e5[_0xc203('0x1d')]?_[_0xc203('0x1e')](_0x2dc0e5[_0xc203('0x1d')],function(_0x5b3f07){return{'model':db[_0x5b3f07[_0xc203('0x1f')]],'as':_0x5b3f07['as'],'attributes':_0x5b3f07[_0xc203('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc203('0x20')](function(_0x534bfd){logger[_0xc203('0xb')]('GetServicenowAccount',_0x4bf55f);logger[_0xc203('0xd')](_0xc203('0x15'),_0x4bf55f,JSON['stringify'](_0x534bfd));_0x1d4128(_0x534bfd);})[_0xc203('0x14')](function(_0x54d4e3){logger[_0xc203('0x10')](_0xc203('0x15'),_0x54d4e3[_0xc203('0x11')],_0x4bf55f);_0x1579e5(_0x4c88ed[_0xc203('0x10')](0x1f4,_0x54d4e3['message']));});});};exports[_0xc203('0x21')]=function(_0x4ec698){var _0x68a407=this;return new Promise(function(_0x2d2c4d,_0x54e7c8){return db[_0xc203('0x16')][_0xc203('0x22')]({'raw':_0x4ec698[_0xc203('0x19')]?_0x4ec698[_0xc203('0x19')][_0xc203('0x18')]===undefined?!![]:![]:!![],'where':_0x4ec698[_0xc203('0x19')]?_0x4ec698[_0xc203('0x19')]['where']||null:null,'attributes':_0x4ec698['options']?_0x4ec698[_0xc203('0x19')]['attributes']||null:null,'include':_0x4ec698[_0xc203('0x19')]?_0x4ec698[_0xc203('0x19')][_0xc203('0x1d')]?_[_0xc203('0x1e')](_0x4ec698[_0xc203('0x19')]['include'],function(_0x21b038){return{'model':db[_0x21b038[_0xc203('0x1f')]],'as':_0x21b038['as'],'attributes':_0x21b038[_0xc203('0x1b')],'include':_0x21b038['include']?_[_0xc203('0x1e')](_0x21b038['include'],function(_0x510e11){return{'model':db[_0x510e11[_0xc203('0x1f')]],'as':_0x510e11['as'],'attributes':_0x510e11[_0xc203('0x1b')],'include':_0x510e11[_0xc203('0x1d')]?_[_0xc203('0x1e')](_0x510e11['include'],function(_0x25e3e1){return{'model':db[_0x25e3e1[_0xc203('0x1f')]],'as':_0x25e3e1['as'],'attributes':_0x25e3e1[_0xc203('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc203('0x20')](function(_0x3051bd){logger[_0xc203('0xb')]('ShowServicenowAccount',_0x4ec698);logger[_0xc203('0xd')](_0xc203('0x21'),_0x4ec698,JSON[_0xc203('0xf')](_0x3051bd));_0x2d2c4d(_0x3051bd);})['catch'](function(_0x3f9bce){logger['error'](_0xc203('0x21'),_0x3f9bce[_0xc203('0x11')],_0x4ec698);_0x54e7c8(_0x68a407[_0xc203('0x10')](0x1f4,_0x3f9bce[_0xc203('0x11')]));});});};
\ No newline at end of file
+var _0x93e0=['include','map','model','GetServicenowAccount','ShowServicenowAccount','find','raw','lodash','util','moment','randomstring','ioredis','../../config/logger','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','where','attributes','limit'];(function(_0x143368,_0x5d0b64){var _0x44c10a=function(_0x30c90c){while(--_0x30c90c){_0x143368['push'](_0x143368['shift']());}};_0x44c10a(++_0x5d0b64);}(_0x93e0,0xa2));var _0x093e=function(_0x28c054,_0xade95c){_0x28c054=_0x28c054-0x0;var _0x14866c=_0x93e0[_0x28c054];return _0x14866c;};'use strict';var _=require(_0x093e('0x0'));var util=require(_0x093e('0x1'));var moment=require(_0x093e('0x2'));var BPromise=require('bluebird');var rs=require(_0x093e('0x3'));var fs=require('fs');var Redis=require(_0x093e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x093e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x093e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xc0c8e1,_0x14a137,_0x2e1b98){return new BPromise(function(_0x8ae70b,_0x2e1168){return client[_0x093e('0x7')](_0xc0c8e1,_0x2e1b98)[_0x093e('0x8')](function(_0x23d537){logger[_0x093e('0x9')](_0x093e('0xa'),_0x14a137,_0x093e('0xb'));logger[_0x093e('0xc')](_0x093e('0xd'),_0x14a137,_0x093e('0xb'),JSON[_0x093e('0xe')](_0x23d537));if(_0x23d537[_0x093e('0xf')]){if(_0x23d537[_0x093e('0xf')][_0x093e('0x10')]===0x1f4){logger[_0x093e('0xf')](_0x093e('0xa'),_0x14a137,_0x23d537[_0x093e('0xf')]['message']);return _0x2e1168(_0x23d537['error']['message']);}logger[_0x093e('0xf')](_0x093e('0xa'),_0x14a137,_0x23d537[_0x093e('0xf')][_0x093e('0x11')]);return _0x8ae70b(_0x23d537['error'][_0x093e('0x11')]);}else{logger[_0x093e('0x9')](_0x093e('0xa'),_0x14a137,_0x093e('0xb'));_0x8ae70b(_0x23d537['result']['message']);}})[_0x093e('0x12')](function(_0x4caa10){logger[_0x093e('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x14a137,_0x4caa10);_0x2e1168(_0x4caa10);});});}exports['GetServicenowAccount']=function(_0x2b2a35){var _0x3b41fb=this;return new Promise(function(_0x4b5e6a,_0x22a5a9){return db['ServicenowAccount'][_0x093e('0x13')]({'raw':_0x2b2a35[_0x093e('0x14')]?_0x2b2a35[_0x093e('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x2b2a35['options']?_0x2b2a35[_0x093e('0x14')][_0x093e('0x15')]||null:null,'attributes':_0x2b2a35[_0x093e('0x14')]?_0x2b2a35[_0x093e('0x14')][_0x093e('0x16')]||null:null,'limit':_0x2b2a35['options']?_0x2b2a35[_0x093e('0x14')][_0x093e('0x17')]||null:null,'include':_0x2b2a35[_0x093e('0x14')]?_0x2b2a35[_0x093e('0x14')][_0x093e('0x18')]?_[_0x093e('0x19')](_0x2b2a35[_0x093e('0x14')]['include'],function(_0x8b97f7){return{'model':db[_0x8b97f7[_0x093e('0x1a')]],'as':_0x8b97f7['as'],'attributes':_0x8b97f7[_0x093e('0x16')],'include':_0x8b97f7[_0x093e('0x18')]?_[_0x093e('0x19')](_0x8b97f7[_0x093e('0x18')],function(_0x17237c){return{'model':db[_0x17237c[_0x093e('0x1a')]],'as':_0x17237c['as'],'attributes':_0x17237c[_0x093e('0x16')],'include':_0x17237c['include']?_[_0x093e('0x19')](_0x17237c[_0x093e('0x18')],function(_0x149ca2){return{'model':db[_0x149ca2['model']],'as':_0x149ca2['as'],'attributes':_0x149ca2['attributes']};}):[]};}):[]};}):[]:[]})[_0x093e('0x8')](function(_0x2cb182){logger[_0x093e('0x9')](_0x093e('0x1b'),_0x2b2a35);logger[_0x093e('0xc')](_0x093e('0x1b'),_0x2b2a35,JSON[_0x093e('0xe')](_0x2cb182));_0x4b5e6a(_0x2cb182);})[_0x093e('0x12')](function(_0x569db7){logger['error']('GetServicenowAccount',_0x569db7[_0x093e('0x11')],_0x2b2a35);_0x22a5a9(_0x3b41fb[_0x093e('0xf')](0x1f4,_0x569db7[_0x093e('0x11')]));});});};exports[_0x093e('0x1c')]=function(_0x1491d9){var _0x3163c4=this;return new Promise(function(_0x344a84,_0xc288ec){return db['ServicenowAccount'][_0x093e('0x1d')]({'raw':_0x1491d9[_0x093e('0x14')]?_0x1491d9[_0x093e('0x14')][_0x093e('0x1e')]===undefined?!![]:![]:!![],'where':_0x1491d9['options']?_0x1491d9[_0x093e('0x14')][_0x093e('0x15')]||null:null,'attributes':_0x1491d9['options']?_0x1491d9[_0x093e('0x14')]['attributes']||null:null,'include':_0x1491d9[_0x093e('0x14')]?_0x1491d9[_0x093e('0x14')][_0x093e('0x18')]?_[_0x093e('0x19')](_0x1491d9[_0x093e('0x14')][_0x093e('0x18')],function(_0x31b2fc){return{'model':db[_0x31b2fc[_0x093e('0x1a')]],'as':_0x31b2fc['as'],'attributes':_0x31b2fc['attributes'],'include':_0x31b2fc['include']?_[_0x093e('0x19')](_0x31b2fc[_0x093e('0x18')],function(_0x463ed){return{'model':db[_0x463ed[_0x093e('0x1a')]],'as':_0x463ed['as'],'attributes':_0x463ed[_0x093e('0x16')],'include':_0x463ed[_0x093e('0x18')]?_[_0x093e('0x19')](_0x463ed['include'],function(_0x111407){return{'model':db[_0x111407[_0x093e('0x1a')]],'as':_0x111407['as'],'attributes':_0x111407[_0x093e('0x16')]};}):[]};}):[]};}):[]:[]})[_0x093e('0x8')](function(_0x421474){logger[_0x093e('0x9')]('ShowServicenowAccount',_0x1491d9);logger[_0x093e('0xc')](_0x093e('0x1c'),_0x1491d9,JSON[_0x093e('0xe')](_0x421474));_0x344a84(_0x421474);})['catch'](function(_0x13633c){logger[_0x093e('0xf')](_0x093e('0x1c'),_0x13633c['message'],_0x1491d9);_0xc288ec(_0x3163c4[_0x093e('0xf')](0x1f4,_0x13633c[_0x093e('0x11')]));});});};
\ No newline at end of file
index 5187e3a..203df55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x209a=['connect-timeout','express','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','exports','multer','util'];(function(_0x180b0a,_0x2e6f97){var _0xeacdde=function(_0x163db6){while(--_0x163db6){_0x180b0a['push'](_0x180b0a['shift']());}};_0xeacdde(++_0x2e6f97);}(_0x209a,0x1b7));var _0xa209=function(_0xcae41c,_0x299b7d){_0xcae41c=_0xcae41c-0x0;var _0x1892ec=_0x209a[_0xcae41c];return _0x1892ec;};'use strict';var multer=require(_0xa209('0x0'));var util=require(_0xa209('0x1'));var path=require('path');var timeout=require(_0xa209('0x2'));var express=require(_0xa209('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa209('0x4'));var config=require(_0xa209('0x5'));var controller=require(_0xa209('0x6'));router['get']('/',auth[_0xa209('0x7')](),controller[_0xa209('0x8')]);router[_0xa209('0x9')]('/:id',auth[_0xa209('0x7')](),controller[_0xa209('0xa')]);router[_0xa209('0x9')](_0xa209('0xb'),auth[_0xa209('0x7')](),controller[_0xa209('0xc')]);router[_0xa209('0x9')]('/:id/subjects',auth[_0xa209('0x7')](),controller[_0xa209('0xd')]);router['get'](_0xa209('0xe'),auth[_0xa209('0x7')](),controller[_0xa209('0xf')]);router[_0xa209('0x10')]('/',auth[_0xa209('0x7')](),controller[_0xa209('0x11')]);router[_0xa209('0x12')](_0xa209('0x13'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xa209('0x7')](),controller['destroy']);module[_0xa209('0x14')]=router;
\ No newline at end of file
+var _0xc578=['getDescriptions','post','create','put','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects'];(function(_0x39790f,_0x4009ec){var _0x10c304=function(_0x334c49){while(--_0x334c49){_0x39790f['push'](_0x39790f['shift']());}};_0x10c304(++_0x4009ec);}(_0xc578,0xfc));var _0x8c57=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xc578[_0x525c7b];return _0x27b33e;};'use strict';var multer=require(_0x8c57('0x0'));var util=require(_0x8c57('0x1'));var path=require(_0x8c57('0x2'));var timeout=require(_0x8c57('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x8c57('0x4'));var interaction=require(_0x8c57('0x5'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0x8c57('0x6')](),controller[_0x8c57('0x7')]);router[_0x8c57('0x8')](_0x8c57('0x9'),auth[_0x8c57('0x6')](),controller[_0x8c57('0xa')]);router[_0x8c57('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x8c57('0xb')]);router['get'](_0x8c57('0xc'),auth[_0x8c57('0x6')](),controller[_0x8c57('0xd')]);router[_0x8c57('0x8')]('/:id/descriptions',auth[_0x8c57('0x6')](),controller[_0x8c57('0xe')]);router[_0x8c57('0xf')]('/',auth['isAuthenticated'](),controller[_0x8c57('0x10')]);router[_0x8c57('0x11')](_0x8c57('0x9'),auth[_0x8c57('0x6')](),controller['update']);router['delete'](_0x8c57('0x9'),auth[_0x8c57('0x6')](),controller[_0x8c57('0x12')]);module['exports']=router;
\ No newline at end of file
index a3a5d2f..fd473a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cbd=['exports','STRING'];(function(_0x11da4b,_0x837820){var _0x186fe6=function(_0x242aa1){while(--_0x242aa1){_0x11da4b['push'](_0x11da4b['shift']());}};_0x186fe6(++_0x837820);}(_0x7cbd,0xe0));var _0xd7cb=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x7cbd[_0x2c0dc0];return _0x4c0990;};'use strict';var Sequelize=require('sequelize');module[_0xd7cb('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd7cb('0x1')]}};
\ No newline at end of file
+var _0xfcf0=['STRING','exports'];(function(_0x5dcf7d,_0x57faa1){var _0xfc7f6e=function(_0x550622){while(--_0x550622){_0x5dcf7d['push'](_0x5dcf7d['shift']());}};_0xfc7f6e(++_0x57faa1);}(_0xfcf0,0x18d));var _0x0fcf=function(_0x458363,_0x1675db){_0x458363=_0x458363-0x0;var _0x4d0290=_0xfcf0[_0x458363];return _0x4d0290;};'use strict';var Sequelize=require('sequelize');module[_0x0fcf('0x0')]={'name':{'type':Sequelize[_0x0fcf('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 05062ff..9499e39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe605=['result','catch','sendStatus','end','json','count','offset','limit','status','Content-Range','reject','save','update','destroy','stack','name','index','ServicenowConfiguration','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','findOne','ServicenowField','pick','getFields','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message'];(function(_0x538574,_0x4cd6df){var _0x116565=function(_0x1961bd){while(--_0x1961bd){_0x538574['push'](_0x538574['shift']());}};_0x116565(++_0x4cd6df);}(_0xe605,0x92));var _0x5e60=function(_0x3db9a8,_0x1c280e){_0x3db9a8=_0x3db9a8-0x0;var _0x360c3a=_0xe605[_0x3db9a8];return _0x360c3a;};'use strict';var pdf=require(_0x5e60('0x0'));var emlformat=require(_0x5e60('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5e60('0x2'));var jsonpatch=require(_0x5e60('0x3'));var rp=require(_0x5e60('0x4'));var moment=require(_0x5e60('0x5'));var BPromise=require(_0x5e60('0x6'));var Mustache=require(_0x5e60('0x7'));var util=require(_0x5e60('0x8'));var path=require(_0x5e60('0x9'));var sox=require(_0x5e60('0xa'));var csv=require(_0x5e60('0xb'));var ejs=require(_0x5e60('0xc'));var fs=require('fs');var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var as=require(_0x5e60('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e60('0x15'))('api');var utils=require(_0x5e60('0x16'));var config=require(_0x5e60('0x17'));var db=require(_0x5e60('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x5e60('0x19')][_0x5e60('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1f4e14,_0xe039de,_0x2874c4){if(_0x2874c4){var _0xe124cd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xe124cd['test'](_0xe039de)){return _0x1f4e14;}else{throw new db[(_0x5e60('0x1b'))][(_0x5e60('0x1c'))](_0x5e60('0x1d'));}}else{return _0x1f4e14;}}function respondWithRpcPromise(_0x2a1c55,_0x5b028f,_0x20af5f,_0x529ffe){return new BPromise(function(_0x1ffd77,_0x3bc7d8){var _0x4cf084=_0x529ffe||client;return _0x4cf084[_0x5e60('0x1e')](_0x2a1c55,_0x20af5f)[_0x5e60('0x1f')](function(_0xaa7d05){logger[_0x5e60('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5b028f,_0x5e60('0x21'));logger[_0x5e60('0x22')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5b028f,_0x5e60('0x21'),JSON[_0x5e60('0x23')](_0xaa7d05));if(_0xaa7d05[_0x5e60('0x24')]){if(_0xaa7d05[_0x5e60('0x24')][_0x5e60('0x25')]===0x1f4){logger[_0x5e60('0x24')](_0x5e60('0x26'),_0x5b028f,_0xaa7d05[_0x5e60('0x24')][_0x5e60('0x27')]);return _0x3bc7d8(_0xaa7d05[_0x5e60('0x24')][_0x5e60('0x27')]);}logger['error'](_0x5e60('0x26'),_0x5b028f,_0xaa7d05['error'][_0x5e60('0x27')]);return _0x1ffd77(_0xaa7d05[_0x5e60('0x24')][_0x5e60('0x27')]);}else{logger[_0x5e60('0x20')](_0x5e60('0x26'),_0x5b028f,_0x5e60('0x21'));_0x1ffd77(_0xaa7d05[_0x5e60('0x28')]['message']);}})[_0x5e60('0x29')](function(_0x7dbdb7){logger[_0x5e60('0x24')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5b028f,_0x7dbdb7);_0x3bc7d8(_0x7dbdb7);});});}function respondWithStatusCode(_0x45cb62,_0x56e3a5){_0x56e3a5=_0x56e3a5||0xcc;return function(_0x2d8aac){if(_0x2d8aac){return _0x45cb62[_0x5e60('0x2a')](_0x56e3a5);}return _0x45cb62['status'](_0x56e3a5)[_0x5e60('0x2b')]();};}function respondWithResult(_0x5712f7,_0x23d187){_0x23d187=_0x23d187||0xc8;return function(_0x221322){if(_0x221322){return _0x5712f7['status'](_0x23d187)[_0x5e60('0x2c')](_0x221322);}};}function respondWithFilteredResult(_0x19e5ab,_0x5b1b46){return function(_0x1ee931){if(_0x1ee931){var _0xac9c7a=_0x1ee931[_0x5e60('0x2d')],_0x52c97c=_0x5b1b46[_0x5e60('0x2e')],_0x5431a8=_0x5b1b46[_0x5e60('0x2e')]+_0x5b1b46[_0x5e60('0x2f')],_0x52f668;if(_0x5431a8>=_0xac9c7a){_0x5431a8=_0xac9c7a;_0x52f668=0xc8;}else{_0x52f668=0xce;}_0x19e5ab[_0x5e60('0x30')](_0x52f668);return _0x19e5ab['set'](_0x5e60('0x31'),_0x52c97c+'-'+_0x5431a8+'/'+_0xac9c7a)[_0x5e60('0x2c')](_0x1ee931);}return null;};}function patchUpdates(_0x4d4b55){return function(_0x11fc87){try{jsonpatch['apply'](_0x11fc87,_0x4d4b55,!![]);}catch(_0x50f024){return BPromise[_0x5e60('0x32')](_0x50f024);}return _0x11fc87[_0x5e60('0x33')]();};}function saveUpdates(_0x1f474b,_0x385c77){return function(_0xaf3a35){if(_0xaf3a35){return _0xaf3a35[_0x5e60('0x34')](_0x1f474b)[_0x5e60('0x1f')](function(_0x2ff2b7){return _0x2ff2b7;});}return null;};}function removeEntity(_0xc1489a,_0x4702a6){return function(_0x5c429c){if(_0x5c429c){return _0x5c429c[_0x5e60('0x35')]()['then'](function(){_0xc1489a['status'](0xcc)[_0x5e60('0x2b')]();});}};}function handleEntityNotFound(_0x317206,_0x4fd910){return function(_0x307e54){if(!_0x307e54){_0x317206['sendStatus'](0x194);}return _0x307e54;};}function handleError(_0x3757fc,_0x45d979){_0x45d979=_0x45d979||0x1f4;return function(_0x2b2426){logger[_0x5e60('0x24')](_0x2b2426[_0x5e60('0x36')]);if(_0x2b2426[_0x5e60('0x37')]){delete _0x2b2426[_0x5e60('0x37')];}_0x3757fc[_0x5e60('0x30')](_0x45d979)['send'](_0x2b2426);};}exports[_0x5e60('0x38')]=function(_0x3f744d,_0x22d4ad){var _0x1a3782={},_0x200744={},_0x2aa7d4={'count':0x0,'rows':[]};var _0x261245=_['map'](db[_0x5e60('0x39')][_0x5e60('0x3a')],function(_0x4cba18){return{'name':_0x4cba18['fieldName'],'type':_0x4cba18[_0x5e60('0x3b')][_0x5e60('0x3c')]};});_0x200744[_0x5e60('0x3d')]=_[_0x5e60('0x3e')](_0x261245,_0x5e60('0x37'));_0x200744['query']=_[_0x5e60('0x3f')](_0x3f744d[_0x5e60('0x40')]);_0x200744[_0x5e60('0x41')]=_[_0x5e60('0x42')](_0x200744[_0x5e60('0x3d')],_0x200744[_0x5e60('0x40')]);_0x1a3782[_0x5e60('0x43')]=_['intersection'](_0x200744[_0x5e60('0x3d')],qs[_0x5e60('0x44')](_0x3f744d['query']['fields']));_0x1a3782['attributes']=_0x1a3782[_0x5e60('0x43')][_0x5e60('0x45')]?_0x1a3782[_0x5e60('0x43')]:_0x200744[_0x5e60('0x3d')];if(!_0x3f744d['query'][_0x5e60('0x46')](_0x5e60('0x47'))){_0x1a3782['limit']=qs['limit'](_0x3f744d[_0x5e60('0x40')][_0x5e60('0x2f')]);_0x1a3782[_0x5e60('0x2e')]=qs[_0x5e60('0x2e')](_0x3f744d[_0x5e60('0x40')][_0x5e60('0x2e')]);}_0x1a3782[_0x5e60('0x48')]=qs[_0x5e60('0x49')](_0x3f744d[_0x5e60('0x40')]['sort']);_0x1a3782[_0x5e60('0x4a')]=qs[_0x5e60('0x41')](_['pick'](_0x3f744d[_0x5e60('0x40')],_0x200744[_0x5e60('0x41')]),_0x261245);if(_0x3f744d[_0x5e60('0x40')][_0x5e60('0x4b')]){_0x1a3782[_0x5e60('0x4a')]=_['merge'](_0x1a3782[_0x5e60('0x4a')],{'$or':_[_0x5e60('0x3e')](_0x261245,function(_0x172aff){if(_0x172aff[_0x5e60('0x3b')]!=='VIRTUAL'){var _0x4d9787={};_0x4d9787[_0x172aff['name']]={'$like':'%'+_0x3f744d[_0x5e60('0x40')][_0x5e60('0x4b')]+'%'};return _0x4d9787;}})});}_0x1a3782=_[_0x5e60('0x4c')]({},_0x1a3782,_0x3f744d[_0x5e60('0x4d')]);var _0x39c131={'where':_0x1a3782[_0x5e60('0x4a')]};return db['ServicenowConfiguration'][_0x5e60('0x2d')](_0x39c131)[_0x5e60('0x1f')](function(_0x165bea){_0x2aa7d4[_0x5e60('0x2d')]=_0x165bea;if(_0x3f744d[_0x5e60('0x40')][_0x5e60('0x4e')]){_0x1a3782[_0x5e60('0x4f')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x5e60('0x50')](_0x1a3782);})[_0x5e60('0x1f')](function(_0x21a116){_0x2aa7d4[_0x5e60('0x51')]=_0x21a116;return _0x2aa7d4;})[_0x5e60('0x1f')](respondWithFilteredResult(_0x22d4ad,_0x1a3782))[_0x5e60('0x29')](handleError(_0x22d4ad,null));};exports[_0x5e60('0x52')]=function(_0x4470bd,_0x1518bd){var _0x350d6d={'raw':![],'where':{'id':_0x4470bd[_0x5e60('0x53')]['id']}},_0xe5e675={};_0xe5e675[_0x5e60('0x3d')]=_[_0x5e60('0x3f')](db[_0x5e60('0x39')][_0x5e60('0x3a')]);_0xe5e675[_0x5e60('0x40')]=_[_0x5e60('0x3f')](_0x4470bd['query']);_0xe5e675['filters']=_[_0x5e60('0x42')](_0xe5e675['model'],_0xe5e675[_0x5e60('0x40')]);_0x350d6d[_0x5e60('0x43')]=_[_0x5e60('0x42')](_0xe5e675[_0x5e60('0x3d')],qs[_0x5e60('0x44')](_0x4470bd[_0x5e60('0x40')]['fields']));_0x350d6d['attributes']=_0x350d6d[_0x5e60('0x43')][_0x5e60('0x45')]?_0x350d6d[_0x5e60('0x43')]:_0xe5e675['model'];if(_0x4470bd['query'][_0x5e60('0x4e')]){_0x350d6d[_0x5e60('0x4f')]=[{'all':!![]}];}_0x350d6d=_[_0x5e60('0x4c')]({},_0x350d6d,_0x4470bd['options']);return db[_0x5e60('0x39')][_0x5e60('0x54')](_0x350d6d)[_0x5e60('0x1f')](handleEntityNotFound(_0x1518bd,null))[_0x5e60('0x1f')](respondWithResult(_0x1518bd,null))[_0x5e60('0x29')](handleError(_0x1518bd,null));};exports[_0x5e60('0x55')]=function(_0x4ae313,_0x412be1){return db[_0x5e60('0x39')]['create'](_0x4ae313[_0x5e60('0x56')],{})[_0x5e60('0x1f')](respondWithResult(_0x412be1,0xc9))[_0x5e60('0x29')](handleError(_0x412be1,null));};exports['update']=function(_0xbe0bd5,_0x17429d){if(_0xbe0bd5['body']['id']){delete _0xbe0bd5[_0x5e60('0x56')]['id'];}return db[_0x5e60('0x39')][_0x5e60('0x54')]({'where':{'id':_0xbe0bd5[_0x5e60('0x53')]['id']}})['then'](handleEntityNotFound(_0x17429d,null))[_0x5e60('0x1f')](saveUpdates(_0xbe0bd5[_0x5e60('0x56')],null))['then'](respondWithResult(_0x17429d,null))[_0x5e60('0x29')](handleError(_0x17429d,null));};exports['destroy']=function(_0x8d00b9,_0x5220fc){return db[_0x5e60('0x39')][_0x5e60('0x54')]({'where':{'id':_0x8d00b9['params']['id']}})[_0x5e60('0x1f')](handleEntityNotFound(_0x5220fc,null))['then'](removeEntity(_0x5220fc,null))[_0x5e60('0x29')](handleError(_0x5220fc,null));};exports['getFields']=function(_0x157787,_0x5b4daa,_0x1481d0){var _0x17e178={};var _0xb1ef22={};var _0x28c2de;var _0x252fa3;return db[_0x5e60('0x39')][_0x5e60('0x57')]({'where':{'id':_0x157787['params']['id']}})[_0x5e60('0x1f')](handleEntityNotFound(_0x5b4daa,null))[_0x5e60('0x1f')](function(_0x442dbf){if(_0x442dbf){_0x28c2de=_0x442dbf;_0xb1ef22[_0x5e60('0x3d')]=_[_0x5e60('0x3f')](db[_0x5e60('0x58')]['rawAttributes']);_0xb1ef22['query']=_['keys'](_0x157787[_0x5e60('0x40')]);_0xb1ef22[_0x5e60('0x41')]=_['intersection'](_0xb1ef22[_0x5e60('0x3d')],_0xb1ef22[_0x5e60('0x40')]);_0x17e178['attributes']=_[_0x5e60('0x42')](_0xb1ef22[_0x5e60('0x3d')],qs[_0x5e60('0x44')](_0x157787[_0x5e60('0x40')][_0x5e60('0x44')]));_0x17e178[_0x5e60('0x43')]=_0x17e178[_0x5e60('0x43')][_0x5e60('0x45')]?_0x17e178[_0x5e60('0x43')]:_0xb1ef22[_0x5e60('0x3d')];_0x17e178[_0x5e60('0x48')]=qs[_0x5e60('0x49')](_0x157787[_0x5e60('0x40')][_0x5e60('0x49')]);_0x17e178[_0x5e60('0x4a')]=qs[_0x5e60('0x41')](_[_0x5e60('0x59')](_0x157787['query'],_0xb1ef22[_0x5e60('0x41')]));if(_0x157787[_0x5e60('0x40')][_0x5e60('0x4b')]){_0x17e178['where']=_[_0x5e60('0x4c')](_0x17e178[_0x5e60('0x4a')],{'$or':_['map'](_0x17e178[_0x5e60('0x43')],function(_0x6f4d2f){var _0x5bbaaf={};_0x5bbaaf[_0x6f4d2f]={'$like':'%'+_0x157787[_0x5e60('0x40')][_0x5e60('0x4b')]+'%'};return _0x5bbaaf;})});}_0x17e178=_[_0x5e60('0x4c')]({},_0x17e178,_0x157787[_0x5e60('0x4d')]);return _0x28c2de[_0x5e60('0x5a')](_0x17e178);}})[_0x5e60('0x1f')](function(_0x221f35){if(_0x221f35){_0x252fa3=_0x221f35[_0x5e60('0x45')];if(!_0x157787[_0x5e60('0x40')]['hasOwnProperty'](_0x5e60('0x47'))){_0x17e178[_0x5e60('0x2f')]=qs[_0x5e60('0x2f')](_0x157787['query'][_0x5e60('0x2f')]);_0x17e178[_0x5e60('0x2e')]=qs[_0x5e60('0x2e')](_0x157787[_0x5e60('0x40')][_0x5e60('0x2e')]);}return _0x28c2de['getFields'](_0x17e178);}})[_0x5e60('0x1f')](function(_0x213c7e){if(_0x213c7e){return _0x213c7e?{'count':_0x252fa3,'rows':_0x213c7e}:null;}})[_0x5e60('0x1f')](respondWithResult(_0x5b4daa,null))['catch'](handleError(_0x5b4daa,null));};exports['getSubjects']=function(_0x3ecfbe,_0x265b5a,_0x13c6dc){var _0x25f6cb={};var _0x14fb46={};var _0x44ddaa;var _0x2c5b45;return db['ServicenowConfiguration'][_0x5e60('0x57')]({'where':{'id':_0x3ecfbe[_0x5e60('0x53')]['id']}})[_0x5e60('0x1f')](handleEntityNotFound(_0x265b5a,null))['then'](function(_0x5dd41b){if(_0x5dd41b){_0x44ddaa=_0x5dd41b;_0x14fb46[_0x5e60('0x3d')]=_[_0x5e60('0x3f')](db[_0x5e60('0x58')]['rawAttributes']);_0x14fb46['query']=_[_0x5e60('0x3f')](_0x3ecfbe[_0x5e60('0x40')]);_0x14fb46[_0x5e60('0x41')]=_[_0x5e60('0x42')](_0x14fb46[_0x5e60('0x3d')],_0x14fb46[_0x5e60('0x40')]);_0x25f6cb['attributes']=_[_0x5e60('0x42')](_0x14fb46[_0x5e60('0x3d')],qs[_0x5e60('0x44')](_0x3ecfbe[_0x5e60('0x40')][_0x5e60('0x44')]));_0x25f6cb[_0x5e60('0x43')]=_0x25f6cb[_0x5e60('0x43')][_0x5e60('0x45')]?_0x25f6cb[_0x5e60('0x43')]:_0x14fb46['model'];_0x25f6cb[_0x5e60('0x48')]=qs[_0x5e60('0x49')](_0x3ecfbe['query'][_0x5e60('0x49')]);_0x25f6cb[_0x5e60('0x4a')]=qs['filters'](_[_0x5e60('0x59')](_0x3ecfbe[_0x5e60('0x40')],_0x14fb46[_0x5e60('0x41')]));if(_0x3ecfbe[_0x5e60('0x40')][_0x5e60('0x4b')]){_0x25f6cb[_0x5e60('0x4a')]=_['merge'](_0x25f6cb[_0x5e60('0x4a')],{'$or':_[_0x5e60('0x3e')](_0x25f6cb[_0x5e60('0x43')],function(_0x222d94){var _0x95d1c5={};_0x95d1c5[_0x222d94]={'$like':'%'+_0x3ecfbe[_0x5e60('0x40')][_0x5e60('0x4b')]+'%'};return _0x95d1c5;})});}_0x25f6cb=_[_0x5e60('0x4c')]({},_0x25f6cb,_0x3ecfbe[_0x5e60('0x4d')]);return _0x44ddaa['getSubjects'](_0x25f6cb);}})[_0x5e60('0x1f')](function(_0x6f826){if(_0x6f826){_0x2c5b45=_0x6f826[_0x5e60('0x45')];if(!_0x3ecfbe[_0x5e60('0x40')][_0x5e60('0x46')](_0x5e60('0x47'))){_0x25f6cb[_0x5e60('0x2f')]=qs[_0x5e60('0x2f')](_0x3ecfbe[_0x5e60('0x40')][_0x5e60('0x2f')]);_0x25f6cb['offset']=qs['offset'](_0x3ecfbe['query'][_0x5e60('0x2e')]);}return _0x44ddaa[_0x5e60('0x5b')](_0x25f6cb);}})[_0x5e60('0x1f')](function(_0x1a911a){if(_0x1a911a){return _0x1a911a?{'count':_0x2c5b45,'rows':_0x1a911a}:null;}})[_0x5e60('0x1f')](respondWithResult(_0x265b5a,null))[_0x5e60('0x29')](handleError(_0x265b5a,null));};exports[_0x5e60('0x5c')]=function(_0x58640c,_0x120fab,_0x4f9164){var _0x1d95fd={};var _0x42ac7c={};var _0x2afb9c;var _0x530e04;return db[_0x5e60('0x39')]['findOne']({'where':{'id':_0x58640c['params']['id']}})['then'](handleEntityNotFound(_0x120fab,null))[_0x5e60('0x1f')](function(_0x43803c){if(_0x43803c){_0x2afb9c=_0x43803c;_0x42ac7c[_0x5e60('0x3d')]=_[_0x5e60('0x3f')](db[_0x5e60('0x58')][_0x5e60('0x3a')]);_0x42ac7c[_0x5e60('0x40')]=_[_0x5e60('0x3f')](_0x58640c[_0x5e60('0x40')]);_0x42ac7c['filters']=_[_0x5e60('0x42')](_0x42ac7c[_0x5e60('0x3d')],_0x42ac7c[_0x5e60('0x40')]);_0x1d95fd[_0x5e60('0x43')]=_[_0x5e60('0x42')](_0x42ac7c[_0x5e60('0x3d')],qs[_0x5e60('0x44')](_0x58640c[_0x5e60('0x40')][_0x5e60('0x44')]));_0x1d95fd[_0x5e60('0x43')]=_0x1d95fd[_0x5e60('0x43')][_0x5e60('0x45')]?_0x1d95fd['attributes']:_0x42ac7c[_0x5e60('0x3d')];_0x1d95fd[_0x5e60('0x48')]=qs[_0x5e60('0x49')](_0x58640c[_0x5e60('0x40')][_0x5e60('0x49')]);_0x1d95fd[_0x5e60('0x4a')]=qs[_0x5e60('0x41')](_[_0x5e60('0x59')](_0x58640c[_0x5e60('0x40')],_0x42ac7c[_0x5e60('0x41')]));if(_0x58640c[_0x5e60('0x40')][_0x5e60('0x4b')]){_0x1d95fd[_0x5e60('0x4a')]=_[_0x5e60('0x4c')](_0x1d95fd[_0x5e60('0x4a')],{'$or':_[_0x5e60('0x3e')](_0x1d95fd[_0x5e60('0x43')],function(_0x36d256){var _0x358bb5={};_0x358bb5[_0x36d256]={'$like':'%'+_0x58640c[_0x5e60('0x40')]['filter']+'%'};return _0x358bb5;})});}_0x1d95fd=_[_0x5e60('0x4c')]({},_0x1d95fd,_0x58640c[_0x5e60('0x4d')]);return _0x2afb9c[_0x5e60('0x5c')](_0x1d95fd);}})['then'](function(_0x4a4417){if(_0x4a4417){_0x530e04=_0x4a4417[_0x5e60('0x45')];if(!_0x58640c[_0x5e60('0x40')][_0x5e60('0x46')](_0x5e60('0x47'))){_0x1d95fd[_0x5e60('0x2f')]=qs[_0x5e60('0x2f')](_0x58640c[_0x5e60('0x40')][_0x5e60('0x2f')]);_0x1d95fd[_0x5e60('0x2e')]=qs[_0x5e60('0x2e')](_0x58640c[_0x5e60('0x40')][_0x5e60('0x2e')]);}return _0x2afb9c[_0x5e60('0x5c')](_0x1d95fd);}})[_0x5e60('0x1f')](function(_0x30e4a7){if(_0x30e4a7){return _0x30e4a7?{'count':_0x530e04,'rows':_0x30e4a7}:null;}})[_0x5e60('0x1f')](respondWithResult(_0x120fab,null))[_0x5e60('0x29')](handleError(_0x120fab,null));};
\ No newline at end of file
+var _0x9348=['to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','count','offset','set','json','apply','reject','save','destroy','end','name','index','map','ServicenowConfiguration','rawAttributes','type','key','query','keys','attributes','intersection','fields','model','hasOwnProperty','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','find','create','body','update','getFields','findOne','nolimit','getSubjects','getDescriptions','ServicenowField','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox'];(function(_0x5bf3c8,_0x5c268b){var _0xf2a998=function(_0x24243d){while(--_0x24243d){_0x5bf3c8['push'](_0x5bf3c8['shift']());}};_0xf2a998(++_0x5c268b);}(_0x9348,0x10d));var _0x8934=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0x9348[_0x375492];return _0x18ba5b;};'use strict';var pdf=require(_0x8934('0x0'));var emlformat=require(_0x8934('0x1'));var rimraf=require(_0x8934('0x2'));var zipdir=require(_0x8934('0x3'));var jsonpatch=require(_0x8934('0x4'));var rp=require('request-promise');var moment=require(_0x8934('0x5'));var BPromise=require(_0x8934('0x6'));var Mustache=require('mustache');var util=require(_0x8934('0x7'));var path=require(_0x8934('0x8'));var sox=require(_0x8934('0x9'));var csv=require(_0x8934('0xa'));var ejs=require(_0x8934('0xb'));var fs=require('fs');var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8934('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8934('0x11'));var hardwareService=require(_0x8934('0x12'));var logger=require(_0x8934('0x13'))(_0x8934('0x14'));var utils=require(_0x8934('0x15'));var config=require(_0x8934('0x16'));var db=require(_0x8934('0x17'))['db'];var jayson=require(_0x8934('0x18'));var client=jayson['client'][_0x8934('0x19')]({'port':0x232a});function checkPasswordPattern(_0x108eab,_0x46bca5,_0x1906d0){if(_0x1906d0){var _0xbc487e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbc487e[_0x8934('0x1a')](_0x46bca5)){return _0x108eab;}else{throw new db['Sequelize'][(_0x8934('0x1b'))](_0x8934('0x1c'));}}else{return _0x108eab;}}function respondWithRpcPromise(_0xdfc97c,_0x94b948,_0x34d4dc,_0x41e6a9){return new BPromise(function(_0x2a5b04,_0x357cf8){var _0x52de6a=_0x41e6a9||client;return _0x52de6a[_0x8934('0x1d')](_0xdfc97c,_0x34d4dc)[_0x8934('0x1e')](function(_0x261c78){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x94b948,'request\x20sent');logger[_0x8934('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x94b948,_0x8934('0x20'),JSON[_0x8934('0x21')](_0x261c78));if(_0x261c78[_0x8934('0x22')]){if(_0x261c78[_0x8934('0x22')][_0x8934('0x23')]===0x1f4){logger['error'](_0x8934('0x24'),_0x94b948,_0x261c78['error'][_0x8934('0x25')]);return _0x357cf8(_0x261c78[_0x8934('0x22')][_0x8934('0x25')]);}logger[_0x8934('0x22')](_0x8934('0x24'),_0x94b948,_0x261c78[_0x8934('0x22')][_0x8934('0x25')]);return _0x2a5b04(_0x261c78['error'][_0x8934('0x25')]);}else{logger[_0x8934('0x26')](_0x8934('0x24'),_0x94b948,_0x8934('0x20'));_0x2a5b04(_0x261c78[_0x8934('0x27')]['message']);}})[_0x8934('0x28')](function(_0x1c15c5){logger[_0x8934('0x22')]('ServicenowConfiguration,\x20%s,\x20%s',_0x94b948,_0x1c15c5);_0x357cf8(_0x1c15c5);});});}function respondWithStatusCode(_0x16cfc2,_0x561df2){_0x561df2=_0x561df2||0xcc;return function(_0x14c5f0){if(_0x14c5f0){return _0x16cfc2[_0x8934('0x29')](_0x561df2);}return _0x16cfc2[_0x8934('0x2a')](_0x561df2)['end']();};}function respondWithResult(_0x1fd5eb,_0x15910b){_0x15910b=_0x15910b||0xc8;return function(_0x310454){if(_0x310454){return _0x1fd5eb[_0x8934('0x2a')](_0x15910b)['json'](_0x310454);}};}function respondWithFilteredResult(_0x3db790,_0x249031){return function(_0x358445){if(_0x358445){var _0x3d93c7=_0x358445[_0x8934('0x2b')],_0x44972b=_0x249031[_0x8934('0x2c')],_0x20d448=_0x249031[_0x8934('0x2c')]+_0x249031['limit'],_0x3f328a;if(_0x20d448>=_0x3d93c7){_0x20d448=_0x3d93c7;_0x3f328a=0xc8;}else{_0x3f328a=0xce;}_0x3db790[_0x8934('0x2a')](_0x3f328a);return _0x3db790[_0x8934('0x2d')]('Content-Range',_0x44972b+'-'+_0x20d448+'/'+_0x3d93c7)[_0x8934('0x2e')](_0x358445);}return null;};}function patchUpdates(_0x3d60f9){return function(_0x1a17b5){try{jsonpatch[_0x8934('0x2f')](_0x1a17b5,_0x3d60f9,!![]);}catch(_0x4b3cb9){return BPromise[_0x8934('0x30')](_0x4b3cb9);}return _0x1a17b5[_0x8934('0x31')]();};}function saveUpdates(_0x11844a,_0x1af54b){return function(_0x382d81){if(_0x382d81){return _0x382d81['update'](_0x11844a)[_0x8934('0x1e')](function(_0x59a6bf){return _0x59a6bf;});}return null;};}function removeEntity(_0x5559f1,_0xff95be){return function(_0x2447e6){if(_0x2447e6){return _0x2447e6[_0x8934('0x32')]()[_0x8934('0x1e')](function(){_0x5559f1['status'](0xcc)[_0x8934('0x33')]();});}};}function handleEntityNotFound(_0x22aebe,_0x380d47){return function(_0x1439ef){if(!_0x1439ef){_0x22aebe[_0x8934('0x29')](0x194);}return _0x1439ef;};}function handleError(_0x4cd282,_0x6764f8){_0x6764f8=_0x6764f8||0x1f4;return function(_0x1ea0cd){logger['error'](_0x1ea0cd['stack']);if(_0x1ea0cd[_0x8934('0x34')]){delete _0x1ea0cd[_0x8934('0x34')];}_0x4cd282['status'](_0x6764f8)['send'](_0x1ea0cd);};}exports[_0x8934('0x35')]=function(_0x177a57,_0x2f710a){var _0x207ad4={},_0x834d54={},_0x1c624f={'count':0x0,'rows':[]};var _0x30f8c6=_[_0x8934('0x36')](db[_0x8934('0x37')][_0x8934('0x38')],function(_0x46611c){return{'name':_0x46611c['fieldName'],'type':_0x46611c[_0x8934('0x39')][_0x8934('0x3a')]};});_0x834d54['model']=_[_0x8934('0x36')](_0x30f8c6,_0x8934('0x34'));_0x834d54[_0x8934('0x3b')]=_[_0x8934('0x3c')](_0x177a57[_0x8934('0x3b')]);_0x834d54['filters']=_['intersection'](_0x834d54['model'],_0x834d54[_0x8934('0x3b')]);_0x207ad4[_0x8934('0x3d')]=_[_0x8934('0x3e')](_0x834d54['model'],qs[_0x8934('0x3f')](_0x177a57['query']['fields']));_0x207ad4[_0x8934('0x3d')]=_0x207ad4[_0x8934('0x3d')]['length']?_0x207ad4['attributes']:_0x834d54[_0x8934('0x40')];if(!_0x177a57[_0x8934('0x3b')][_0x8934('0x41')]('nolimit')){_0x207ad4[_0x8934('0x42')]=qs['limit'](_0x177a57[_0x8934('0x3b')]['limit']);_0x207ad4[_0x8934('0x2c')]=qs[_0x8934('0x2c')](_0x177a57[_0x8934('0x3b')]['offset']);}_0x207ad4[_0x8934('0x43')]=qs[_0x8934('0x44')](_0x177a57[_0x8934('0x3b')][_0x8934('0x44')]);_0x207ad4['where']=qs[_0x8934('0x45')](_[_0x8934('0x46')](_0x177a57[_0x8934('0x3b')],_0x834d54[_0x8934('0x45')]),_0x30f8c6);if(_0x177a57[_0x8934('0x3b')][_0x8934('0x47')]){_0x207ad4[_0x8934('0x48')]=_[_0x8934('0x49')](_0x207ad4['where'],{'$or':_['map'](_0x30f8c6,function(_0x510152){if(_0x510152[_0x8934('0x39')]!==_0x8934('0x4a')){var _0x58206c={};_0x58206c[_0x510152[_0x8934('0x34')]]={'$like':'%'+_0x177a57['query'][_0x8934('0x47')]+'%'};return _0x58206c;}})});}_0x207ad4=_[_0x8934('0x49')]({},_0x207ad4,_0x177a57['options']);var _0x3561da={'where':_0x207ad4[_0x8934('0x48')]};return db[_0x8934('0x37')][_0x8934('0x2b')](_0x3561da)['then'](function(_0x2adb63){_0x1c624f[_0x8934('0x2b')]=_0x2adb63;if(_0x177a57['query'][_0x8934('0x4b')]){_0x207ad4[_0x8934('0x4c')]=[{'all':!![]}];}return db[_0x8934('0x37')][_0x8934('0x4d')](_0x207ad4);})[_0x8934('0x1e')](function(_0x419e30){_0x1c624f[_0x8934('0x4e')]=_0x419e30;return _0x1c624f;})[_0x8934('0x1e')](respondWithFilteredResult(_0x2f710a,_0x207ad4))[_0x8934('0x28')](handleError(_0x2f710a,null));};exports[_0x8934('0x4f')]=function(_0x1e2175,_0xe212bc){var _0x2c322d={'raw':![],'where':{'id':_0x1e2175[_0x8934('0x50')]['id']}},_0x2febf5={};_0x2febf5[_0x8934('0x40')]=_[_0x8934('0x3c')](db[_0x8934('0x37')]['rawAttributes']);_0x2febf5[_0x8934('0x3b')]=_[_0x8934('0x3c')](_0x1e2175['query']);_0x2febf5['filters']=_['intersection'](_0x2febf5['model'],_0x2febf5[_0x8934('0x3b')]);_0x2c322d[_0x8934('0x3d')]=_[_0x8934('0x3e')](_0x2febf5['model'],qs['fields'](_0x1e2175[_0x8934('0x3b')]['fields']));_0x2c322d['attributes']=_0x2c322d[_0x8934('0x3d')][_0x8934('0x51')]?_0x2c322d[_0x8934('0x3d')]:_0x2febf5[_0x8934('0x40')];if(_0x1e2175[_0x8934('0x3b')][_0x8934('0x4b')]){_0x2c322d[_0x8934('0x4c')]=[{'all':!![]}];}_0x2c322d=_['merge']({},_0x2c322d,_0x1e2175[_0x8934('0x52')]);return db['ServicenowConfiguration'][_0x8934('0x53')](_0x2c322d)[_0x8934('0x1e')](handleEntityNotFound(_0xe212bc,null))[_0x8934('0x1e')](respondWithResult(_0xe212bc,null))[_0x8934('0x28')](handleError(_0xe212bc,null));};exports[_0x8934('0x54')]=function(_0x265b0a,_0x1f6c5f){return db[_0x8934('0x37')]['create'](_0x265b0a[_0x8934('0x55')],{})[_0x8934('0x1e')](respondWithResult(_0x1f6c5f,0xc9))[_0x8934('0x28')](handleError(_0x1f6c5f,null));};exports[_0x8934('0x56')]=function(_0x2ab06d,_0x5a791a){if(_0x2ab06d[_0x8934('0x55')]['id']){delete _0x2ab06d[_0x8934('0x55')]['id'];}return db[_0x8934('0x37')]['find']({'where':{'id':_0x2ab06d[_0x8934('0x50')]['id']}})[_0x8934('0x1e')](handleEntityNotFound(_0x5a791a,null))[_0x8934('0x1e')](saveUpdates(_0x2ab06d['body'],null))['then'](respondWithResult(_0x5a791a,null))['catch'](handleError(_0x5a791a,null));};exports[_0x8934('0x32')]=function(_0x8e3e85,_0x3aab00){return db['ServicenowConfiguration'][_0x8934('0x53')]({'where':{'id':_0x8e3e85[_0x8934('0x50')]['id']}})['then'](handleEntityNotFound(_0x3aab00,null))['then'](removeEntity(_0x3aab00,null))[_0x8934('0x28')](handleError(_0x3aab00,null));};exports[_0x8934('0x57')]=function(_0x44d892,_0xb9e4ac,_0x4bcf77){var _0x4d2e41={};var _0x4ea19e={};var _0x4a9089;var _0x43933f;return db[_0x8934('0x37')][_0x8934('0x58')]({'where':{'id':_0x44d892[_0x8934('0x50')]['id']}})[_0x8934('0x1e')](handleEntityNotFound(_0xb9e4ac,null))[_0x8934('0x1e')](function(_0x5a487e){if(_0x5a487e){_0x4a9089=_0x5a487e;_0x4ea19e[_0x8934('0x40')]=_[_0x8934('0x3c')](db['ServicenowField'][_0x8934('0x38')]);_0x4ea19e['query']=_[_0x8934('0x3c')](_0x44d892['query']);_0x4ea19e[_0x8934('0x45')]=_[_0x8934('0x3e')](_0x4ea19e[_0x8934('0x40')],_0x4ea19e[_0x8934('0x3b')]);_0x4d2e41[_0x8934('0x3d')]=_[_0x8934('0x3e')](_0x4ea19e[_0x8934('0x40')],qs['fields'](_0x44d892['query'][_0x8934('0x3f')]));_0x4d2e41[_0x8934('0x3d')]=_0x4d2e41[_0x8934('0x3d')][_0x8934('0x51')]?_0x4d2e41[_0x8934('0x3d')]:_0x4ea19e[_0x8934('0x40')];_0x4d2e41[_0x8934('0x43')]=qs[_0x8934('0x44')](_0x44d892[_0x8934('0x3b')][_0x8934('0x44')]);_0x4d2e41[_0x8934('0x48')]=qs[_0x8934('0x45')](_[_0x8934('0x46')](_0x44d892[_0x8934('0x3b')],_0x4ea19e['filters']));if(_0x44d892['query'][_0x8934('0x47')]){_0x4d2e41[_0x8934('0x48')]=_[_0x8934('0x49')](_0x4d2e41[_0x8934('0x48')],{'$or':_[_0x8934('0x36')](_0x4d2e41[_0x8934('0x3d')],function(_0x2f8318){var _0x5ed8ff={};_0x5ed8ff[_0x2f8318]={'$like':'%'+_0x44d892[_0x8934('0x3b')][_0x8934('0x47')]+'%'};return _0x5ed8ff;})});}_0x4d2e41=_['merge']({},_0x4d2e41,_0x44d892[_0x8934('0x52')]);return _0x4a9089['getFields'](_0x4d2e41);}})[_0x8934('0x1e')](function(_0x301967){if(_0x301967){_0x43933f=_0x301967[_0x8934('0x51')];if(!_0x44d892['query'][_0x8934('0x41')](_0x8934('0x59'))){_0x4d2e41['limit']=qs[_0x8934('0x42')](_0x44d892['query'][_0x8934('0x42')]);_0x4d2e41['offset']=qs[_0x8934('0x2c')](_0x44d892[_0x8934('0x3b')][_0x8934('0x2c')]);}return _0x4a9089['getFields'](_0x4d2e41);}})[_0x8934('0x1e')](function(_0xfbad9){if(_0xfbad9){return _0xfbad9?{'count':_0x43933f,'rows':_0xfbad9}:null;}})[_0x8934('0x1e')](respondWithResult(_0xb9e4ac,null))[_0x8934('0x28')](handleError(_0xb9e4ac,null));};exports['getSubjects']=function(_0x378e28,_0x4af42b,_0x10f552){var _0x2571ea={};var _0x14992b={};var _0x18afaa;var _0x5880d0;return db[_0x8934('0x37')][_0x8934('0x58')]({'where':{'id':_0x378e28[_0x8934('0x50')]['id']}})['then'](handleEntityNotFound(_0x4af42b,null))[_0x8934('0x1e')](function(_0xa869e8){if(_0xa869e8){_0x18afaa=_0xa869e8;_0x14992b[_0x8934('0x40')]=_['keys'](db['ServicenowField'][_0x8934('0x38')]);_0x14992b[_0x8934('0x3b')]=_[_0x8934('0x3c')](_0x378e28[_0x8934('0x3b')]);_0x14992b[_0x8934('0x45')]=_[_0x8934('0x3e')](_0x14992b[_0x8934('0x40')],_0x14992b[_0x8934('0x3b')]);_0x2571ea[_0x8934('0x3d')]=_['intersection'](_0x14992b[_0x8934('0x40')],qs[_0x8934('0x3f')](_0x378e28[_0x8934('0x3b')][_0x8934('0x3f')]));_0x2571ea[_0x8934('0x3d')]=_0x2571ea['attributes'][_0x8934('0x51')]?_0x2571ea[_0x8934('0x3d')]:_0x14992b['model'];_0x2571ea[_0x8934('0x43')]=qs['sort'](_0x378e28['query']['sort']);_0x2571ea[_0x8934('0x48')]=qs[_0x8934('0x45')](_[_0x8934('0x46')](_0x378e28['query'],_0x14992b[_0x8934('0x45')]));if(_0x378e28[_0x8934('0x3b')]['filter']){_0x2571ea[_0x8934('0x48')]=_[_0x8934('0x49')](_0x2571ea[_0x8934('0x48')],{'$or':_[_0x8934('0x36')](_0x2571ea[_0x8934('0x3d')],function(_0x324722){var _0x293bb8={};_0x293bb8[_0x324722]={'$like':'%'+_0x378e28[_0x8934('0x3b')][_0x8934('0x47')]+'%'};return _0x293bb8;})});}_0x2571ea=_[_0x8934('0x49')]({},_0x2571ea,_0x378e28['options']);return _0x18afaa[_0x8934('0x5a')](_0x2571ea);}})[_0x8934('0x1e')](function(_0xe9991f){if(_0xe9991f){_0x5880d0=_0xe9991f[_0x8934('0x51')];if(!_0x378e28[_0x8934('0x3b')][_0x8934('0x41')](_0x8934('0x59'))){_0x2571ea['limit']=qs[_0x8934('0x42')](_0x378e28[_0x8934('0x3b')][_0x8934('0x42')]);_0x2571ea[_0x8934('0x2c')]=qs[_0x8934('0x2c')](_0x378e28[_0x8934('0x3b')][_0x8934('0x2c')]);}return _0x18afaa[_0x8934('0x5a')](_0x2571ea);}})[_0x8934('0x1e')](function(_0x52b25e){if(_0x52b25e){return _0x52b25e?{'count':_0x5880d0,'rows':_0x52b25e}:null;}})['then'](respondWithResult(_0x4af42b,null))[_0x8934('0x28')](handleError(_0x4af42b,null));};exports[_0x8934('0x5b')]=function(_0x4faab2,_0x2becdf,_0x258bac){var _0x1ff259={};var _0xba3619={};var _0x25c4ac;var _0x1894ff;return db[_0x8934('0x37')][_0x8934('0x58')]({'where':{'id':_0x4faab2[_0x8934('0x50')]['id']}})[_0x8934('0x1e')](handleEntityNotFound(_0x2becdf,null))[_0x8934('0x1e')](function(_0x556b70){if(_0x556b70){_0x25c4ac=_0x556b70;_0xba3619[_0x8934('0x40')]=_[_0x8934('0x3c')](db[_0x8934('0x5c')]['rawAttributes']);_0xba3619[_0x8934('0x3b')]=_['keys'](_0x4faab2[_0x8934('0x3b')]);_0xba3619[_0x8934('0x45')]=_[_0x8934('0x3e')](_0xba3619[_0x8934('0x40')],_0xba3619['query']);_0x1ff259['attributes']=_[_0x8934('0x3e')](_0xba3619['model'],qs[_0x8934('0x3f')](_0x4faab2[_0x8934('0x3b')][_0x8934('0x3f')]));_0x1ff259[_0x8934('0x3d')]=_0x1ff259['attributes'][_0x8934('0x51')]?_0x1ff259['attributes']:_0xba3619['model'];_0x1ff259['order']=qs['sort'](_0x4faab2[_0x8934('0x3b')][_0x8934('0x44')]);_0x1ff259[_0x8934('0x48')]=qs[_0x8934('0x45')](_[_0x8934('0x46')](_0x4faab2['query'],_0xba3619['filters']));if(_0x4faab2[_0x8934('0x3b')][_0x8934('0x47')]){_0x1ff259[_0x8934('0x48')]=_[_0x8934('0x49')](_0x1ff259[_0x8934('0x48')],{'$or':_[_0x8934('0x36')](_0x1ff259[_0x8934('0x3d')],function(_0x2839dd){var _0x261887={};_0x261887[_0x2839dd]={'$like':'%'+_0x4faab2[_0x8934('0x3b')][_0x8934('0x47')]+'%'};return _0x261887;})});}_0x1ff259=_[_0x8934('0x49')]({},_0x1ff259,_0x4faab2[_0x8934('0x52')]);return _0x25c4ac[_0x8934('0x5b')](_0x1ff259);}})[_0x8934('0x1e')](function(_0x40a47a){if(_0x40a47a){_0x1894ff=_0x40a47a['length'];if(!_0x4faab2['query'][_0x8934('0x41')](_0x8934('0x59'))){_0x1ff259['limit']=qs[_0x8934('0x42')](_0x4faab2[_0x8934('0x3b')][_0x8934('0x42')]);_0x1ff259[_0x8934('0x2c')]=qs[_0x8934('0x2c')](_0x4faab2[_0x8934('0x3b')][_0x8934('0x2c')]);}return _0x25c4ac['getDescriptions'](_0x1ff259);}})[_0x8934('0x1e')](function(_0x5aab65){if(_0x5aab65){return _0x5aab65?{'count':_0x1894ff,'rows':_0x5aab65}:null;}})[_0x8934('0x1e')](respondWithResult(_0x2becdf,null))[_0x8934('0x28')](handleError(_0x2becdf,null));};
\ No newline at end of file
index dfa7842..ff8dd83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e5a=['int_servicenow_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./intServicenowConfiguration.attributes','define','ServicenowConfiguration'];(function(_0x5b8be5,_0x3c6226){var _0x277029=function(_0xdf6dff){while(--_0xdf6dff){_0x5b8be5['push'](_0x5b8be5['shift']());}};_0x277029(++_0x3c6226);}(_0x1e5a,0xb5));var _0xa1e5=function(_0x3a235a,_0x1e593f){_0x3a235a=_0x3a235a-0x0;var _0x1a6e21=_0x1e5a[_0x3a235a];return _0x1a6e21;};'use strict';var _=require(_0xa1e5('0x0'));var util=require(_0xa1e5('0x1'));var logger=require(_0xa1e5('0x2'))(_0xa1e5('0x3'));var moment=require(_0xa1e5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa1e5('0x5'));var fs=require('fs');var path=require(_0xa1e5('0x6'));var rimraf=require(_0xa1e5('0x7'));var config=require('../../config/environment');var attributes=require(_0xa1e5('0x8'));module['exports']=function(_0x40845b,_0x41236a){return _0x40845b[_0xa1e5('0x9')](_0xa1e5('0xa'),attributes,{'tableName':_0xa1e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3713=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xce3463,_0x1c0388){var _0x46e755=function(_0x43e036){while(--_0x43e036){_0xce3463['push'](_0xce3463['shift']());}};_0x46e755(++_0x1c0388);}(_0x3713,0xa2));var _0x3371=function(_0xe55ab6,_0x1c3099){_0xe55ab6=_0xe55ab6-0x0;var _0x25265b=_0x3713[_0xe55ab6];return _0x25265b;};'use strict';var _=require(_0x3371('0x0'));var util=require(_0x3371('0x1'));var logger=require(_0x3371('0x2'))(_0x3371('0x3'));var moment=require(_0x3371('0x4'));var BPromise=require(_0x3371('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3371('0x6'));var rimraf=require(_0x3371('0x7'));var config=require(_0x3371('0x8'));var attributes=require(_0x3371('0x9'));module['exports']=function(_0xa8c99c,_0x3e28b2){return _0xa8c99c[_0x3371('0xa')](_0x3371('0xb'),attributes,{'tableName':_0x3371('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9ca61a1..3d98c2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3809=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x26c129,_0x2f91d5){var _0xedee64=function(_0x517bb2){while(--_0x517bb2){_0x26c129['push'](_0x26c129['shift']());}};_0xedee64(++_0x2f91d5);}(_0x3809,0x13d));var _0x9380=function(_0x5e5116,_0x49cda7){_0x5e5116=_0x5e5116-0x0;var _0x5e3bb9=_0x3809[_0x5e5116];return _0x5e3bb9;};'use strict';var _=require(_0x9380('0x0'));var util=require(_0x9380('0x1'));var moment=require(_0x9380('0x2'));var BPromise=require('bluebird');var rs=require(_0x9380('0x3'));var fs=require('fs');var Redis=require(_0x9380('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9380('0x5'));var logger=require('../../config/logger')(_0x9380('0x6'));var config=require(_0x9380('0x7'));var jayson=require(_0x9380('0x8'));var client=jayson['client'][_0x9380('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c804b,_0x2a2a33,_0x18b29e){return new BPromise(function(_0x2d2a49,_0x228907){return client[_0x9380('0xa')](_0x1c804b,_0x18b29e)['then'](function(_0x2a851a){logger[_0x9380('0xb')](_0x9380('0xc'),_0x2a2a33,'request\x20sent');logger['debug'](_0x9380('0xd'),_0x2a2a33,_0x9380('0xe'),JSON[_0x9380('0xf')](_0x2a851a));if(_0x2a851a[_0x9380('0x10')]){if(_0x2a851a[_0x9380('0x10')][_0x9380('0x11')]===0x1f4){logger[_0x9380('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2a2a33,_0x2a851a[_0x9380('0x10')][_0x9380('0x12')]);return _0x228907(_0x2a851a[_0x9380('0x10')][_0x9380('0x12')]);}logger[_0x9380('0x10')](_0x9380('0xc'),_0x2a2a33,_0x2a851a[_0x9380('0x10')][_0x9380('0x12')]);return _0x2d2a49(_0x2a851a[_0x9380('0x10')][_0x9380('0x12')]);}else{logger[_0x9380('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2a2a33,_0x9380('0xe'));_0x2d2a49(_0x2a851a['result'][_0x9380('0x12')]);}})[_0x9380('0x13')](function(_0x3d080d){logger[_0x9380('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2a2a33,_0x3d080d);_0x228907(_0x3d080d);});});}
\ No newline at end of file
+var _0x968e=['error','code','message','request\x20sent','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x5b2e3d,_0x2d7f7b){var _0x35a13c=function(_0x831acc){while(--_0x831acc){_0x5b2e3d['push'](_0x5b2e3d['shift']());}};_0x35a13c(++_0x2d7f7b);}(_0x968e,0x64));var _0xe968=function(_0x432286,_0xc7f906){_0x432286=_0x432286-0x0;var _0x475b6e=_0x968e[_0x432286];return _0x475b6e;};'use strict';var _=require(_0xe968('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe968('0x1'));var rs=require(_0xe968('0x2'));var fs=require('fs');var Redis=require(_0xe968('0x3'));var db=require(_0xe968('0x4'))['db'];var utils=require(_0xe968('0x5'));var logger=require(_0xe968('0x6'))(_0xe968('0x7'));var config=require('../../config/environment');var jayson=require(_0xe968('0x8'));var client=jayson[_0xe968('0x9')][_0xe968('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b4e8a,_0x529d5e,_0x4db7db){return new BPromise(function(_0x5ded3b,_0x3deedb){return client[_0xe968('0xb')](_0x4b4e8a,_0x4db7db)[_0xe968('0xc')](function(_0x4c9d06){logger['info'](_0xe968('0xd'),_0x529d5e,'request\x20sent');logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x529d5e,'request\x20sent',JSON['stringify'](_0x4c9d06));if(_0x4c9d06[_0xe968('0xe')]){if(_0x4c9d06[_0xe968('0xe')][_0xe968('0xf')]===0x1f4){logger[_0xe968('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x529d5e,_0x4c9d06[_0xe968('0xe')][_0xe968('0x10')]);return _0x3deedb(_0x4c9d06['error'][_0xe968('0x10')]);}logger['error'](_0xe968('0xd'),_0x529d5e,_0x4c9d06[_0xe968('0xe')][_0xe968('0x10')]);return _0x5ded3b(_0x4c9d06[_0xe968('0xe')]['message']);}else{logger['info'](_0xe968('0xd'),_0x529d5e,_0xe968('0x11'));_0x5ded3b(_0x4c9d06['result'][_0xe968('0x10')]);}})[_0xe968('0x12')](function(_0x8d0c36){logger[_0xe968('0xe')](_0xe968('0xd'),_0x529d5e,_0x8d0c36);_0x3deedb(_0x8d0c36);});});}
\ No newline at end of file
index c037805..357c009 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1c4=['put','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x368646,_0xb9ed0b){var _0x381a6d=function(_0x292332){while(--_0x292332){_0x368646['push'](_0x368646['shift']());}};_0x381a6d(++_0xb9ed0b);}(_0xd1c4,0x1bc));var _0x4d1c=function(_0x20cdd2,_0x24da9b){_0x20cdd2=_0x20cdd2-0x0;var _0x8bd09e=_0xd1c4[_0x20cdd2];return _0x8bd09e;};'use strict';var multer=require('multer');var util=require(_0x4d1c('0x0'));var path=require(_0x4d1c('0x1'));var timeout=require('connect-timeout');var express=require(_0x4d1c('0x2'));var router=express[_0x4d1c('0x3')]();var auth=require(_0x4d1c('0x4'));var interaction=require(_0x4d1c('0x5'));var config=require(_0x4d1c('0x6'));var controller=require(_0x4d1c('0x7'));router[_0x4d1c('0x8')]('/',auth[_0x4d1c('0x9')](),controller[_0x4d1c('0xa')]);router['get'](_0x4d1c('0xb'),auth[_0x4d1c('0x9')](),controller[_0x4d1c('0xc')]);router[_0x4d1c('0xd')]('/',auth['isAuthenticated'](),controller[_0x4d1c('0xe')]);router[_0x4d1c('0xf')](_0x4d1c('0xb'),auth[_0x4d1c('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4d1c('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x5fa8=['post','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x21399e,_0xbc6101){var _0x3b7be4=function(_0x2b5747){while(--_0x2b5747){_0x21399e['push'](_0x21399e['shift']());}};_0x3b7be4(++_0xbc6101);}(_0x5fa8,0x1ec));var _0x85fa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5fa8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x85fa('0x0'));var util=require(_0x85fa('0x1'));var path=require(_0x85fa('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85fa('0x3')]();var auth=require(_0x85fa('0x4'));var interaction=require(_0x85fa('0x5'));var config=require(_0x85fa('0x6'));var controller=require('./intServicenowField.controller');router[_0x85fa('0x7')]('/',auth[_0x85fa('0x8')](),controller[_0x85fa('0x9')]);router[_0x85fa('0x7')](_0x85fa('0xa'),auth[_0x85fa('0x8')](),controller[_0x85fa('0xb')]);router[_0x85fa('0xc')]('/',auth[_0x85fa('0x8')](),controller['create']);router[_0x85fa('0xd')](_0x85fa('0xa'),auth['isAuthenticated'](),controller[_0x85fa('0xe')]);router[_0x85fa('0xf')](_0x85fa('0xa'),auth[_0x85fa('0x8')](),controller[_0x85fa('0x10')]);module[_0x85fa('0x11')]=router;
\ No newline at end of file
index 8556ba1..3e8056c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8756=['customVariable','keyValue','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x8756,0xc2));var _0x6875=function(_0x1793ef,_0x9f1e1){_0x1793ef=_0x1793ef-0x0;var _0x299901=_0x8756[_0x1793ef];return _0x299901;};'use strict';var Sequelize=require(_0x6875('0x0'));module[_0x6875('0x1')]={'type':{'type':Sequelize[_0x6875('0x2')]('string',_0x6875('0x3'),_0x6875('0x4'),_0x6875('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x6875('0x6')]},'key':{'type':Sequelize[_0x6875('0x6')]},'keyType':{'type':Sequelize[_0x6875('0x2')](_0x6875('0x7'),_0x6875('0x3'),_0x6875('0x4'))},'keyContent':{'type':Sequelize[_0x6875('0x6')]},'idField':{'type':Sequelize[_0x6875('0x6')]},'nameField':{'type':Sequelize[_0x6875('0x6')]},'customField':{'type':Sequelize[_0x6875('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6875('0x6')]}};
\ No newline at end of file
+var _0xec08=['variable','customVariable','keyValue','STRING','ENUM','exports','string'];(function(_0x199bfe,_0x40754b){var _0x3be5c2=function(_0x5d2581){while(--_0x5d2581){_0x199bfe['push'](_0x199bfe['shift']());}};_0x3be5c2(++_0x40754b);}(_0xec08,0xad));var _0x8ec0=function(_0x3e826d,_0x59e2d4){_0x3e826d=_0x3e826d-0x0;var _0x24a906=_0xec08[_0x3e826d];return _0x24a906;};'use strict';var Sequelize=require('sequelize');module[_0x8ec0('0x0')]={'type':{'type':Sequelize['ENUM'](_0x8ec0('0x1'),_0x8ec0('0x2'),_0x8ec0('0x3'),_0x8ec0('0x4')),'defaultValue':_0x8ec0('0x1')},'content':{'type':Sequelize[_0x8ec0('0x5')]},'key':{'type':Sequelize[_0x8ec0('0x5')]},'keyType':{'type':Sequelize[_0x8ec0('0x6')](_0x8ec0('0x1'),_0x8ec0('0x2'),_0x8ec0('0x3'))},'keyContent':{'type':Sequelize[_0x8ec0('0x5')]},'idField':{'type':Sequelize[_0x8ec0('0x5')]},'nameField':{'type':Sequelize[_0x8ec0('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8ec0('0x5')]}};
\ No newline at end of file
index c91ec62..9e61749 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x2ace95,_0x186b37){var _0x35ecfa=function(_0x26ce5a){while(--_0x26ce5a){_0x2ace95['push'](_0x2ace95['shift']());}};_0x35ecfa(++_0x186b37);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x3e954d,_0x4cc3a0){var _0x59649b=function(_0x9c6eac){while(--_0x9c6eac){_0x3e954d['push'](_0x3e954d['shift']());}};_0x59649b(++_0x4cc3a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
index e9ca2f0..bbf7d72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43d=['../../config/logger','api','moment','path','./intServicenowField.attributes','exports','define','int_servicenow_fields','FieldId','lodash','util'];(function(_0x4c750c,_0x3614ab){var _0x5d4cb8=function(_0x175dd1){while(--_0x175dd1){_0x4c750c['push'](_0x4c750c['shift']());}};_0x5d4cb8(++_0x3614ab);}(_0xb43d,0x169));var _0xdb43=function(_0x15807f,_0x576d8a){_0x15807f=_0x15807f-0x0;var _0x66fab1=_0xb43d[_0x15807f];return _0x66fab1;};'use strict';var _=require(_0xdb43('0x0'));var util=require(_0xdb43('0x1'));var logger=require(_0xdb43('0x2'))(_0xdb43('0x3'));var moment=require(_0xdb43('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb43('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdb43('0x6'));module[_0xdb43('0x7')]=function(_0x5378dc,_0x37191b){return _0x5378dc[_0xdb43('0x8')]('ServicenowField',attributes,{'tableName':_0xdb43('0x9'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField',_0xdb43('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4302=['moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','servicenow_unique_index','FieldId','lodash','api'];(function(_0x33e363,_0x4cf709){var _0x6e4b0d=function(_0x406c25){while(--_0x406c25){_0x33e363['push'](_0x33e363['shift']());}};_0x6e4b0d(++_0x4cf709);}(_0x4302,0xbe));var _0x2430=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x4302[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x2430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2430('0x1'));var moment=require(_0x2430('0x2'));var BPromise=require(_0x2430('0x3'));var rp=require(_0x2430('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2430('0x5'));var config=require(_0x2430('0x6'));var attributes=require(_0x2430('0x7'));module[_0x2430('0x8')]=function(_0x594fb4,_0x57c72e){return _0x594fb4[_0x2430('0x9')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x2430('0xa'),'fields':['idField',_0x2430('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 99a91c7..a2a34fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd983=['request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4ab987,_0x387b40){var _0x2d3984=function(_0x2c6fdf){while(--_0x2c6fdf){_0x4ab987['push'](_0x4ab987['shift']());}};_0x2d3984(++_0x387b40);}(_0xd983,0xdb));var _0x3d98=function(_0x37f65f,_0x1c0839){_0x37f65f=_0x37f65f-0x0;var _0x39444c=_0xd983[_0x37f65f];return _0x39444c;};'use strict';var _=require('lodash');var util=require(_0x3d98('0x0'));var moment=require(_0x3d98('0x1'));var BPromise=require(_0x3d98('0x2'));var rs=require(_0x3d98('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d98('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d98('0x5'))(_0x3d98('0x6'));var config=require(_0x3d98('0x7'));var jayson=require(_0x3d98('0x8'));var client=jayson[_0x3d98('0x9')][_0x3d98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12b5cf,_0xeedf21,_0x5a40ab){return new BPromise(function(_0x5b310b,_0x23c076){return client[_0x3d98('0xb')](_0x12b5cf,_0x5a40ab)[_0x3d98('0xc')](function(_0x456afd){logger[_0x3d98('0xd')](_0x3d98('0xe'),_0xeedf21,_0x3d98('0xf'));logger[_0x3d98('0x10')](_0x3d98('0x11'),_0xeedf21,'request\x20sent',JSON[_0x3d98('0x12')](_0x456afd));if(_0x456afd[_0x3d98('0x13')]){if(_0x456afd[_0x3d98('0x13')][_0x3d98('0x14')]===0x1f4){logger[_0x3d98('0x13')](_0x3d98('0xe'),_0xeedf21,_0x456afd[_0x3d98('0x13')][_0x3d98('0x15')]);return _0x23c076(_0x456afd[_0x3d98('0x13')][_0x3d98('0x15')]);}logger['error'](_0x3d98('0xe'),_0xeedf21,_0x456afd[_0x3d98('0x13')][_0x3d98('0x15')]);return _0x5b310b(_0x456afd[_0x3d98('0x13')][_0x3d98('0x15')]);}else{logger[_0x3d98('0xd')]('ServicenowField,\x20%s,\x20%s',_0xeedf21,'request\x20sent');_0x5b310b(_0x456afd[_0x3d98('0x16')]['message']);}})['catch'](function(_0x413f73){logger['error'](_0x3d98('0xe'),_0xeedf21,_0x413f73);_0x23c076(_0x413f73);});});}
\ No newline at end of file
+var _0xd1f7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash'];(function(_0x3bc971,_0x16882d){var _0x42bb0a=function(_0x284e81){while(--_0x284e81){_0x3bc971['push'](_0x3bc971['shift']());}};_0x42bb0a(++_0x16882d);}(_0xd1f7,0x14f));var _0x7d1f=function(_0x5311d7,_0x305d4a){_0x5311d7=_0x5311d7-0x0;var _0x4b4318=_0xd1f7[_0x5311d7];return _0x4b4318;};'use strict';var _=require(_0x7d1f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7d1f('0x1'));var rs=require(_0x7d1f('0x2'));var fs=require('fs');var Redis=require(_0x7d1f('0x3'));var db=require(_0x7d1f('0x4'))['db'];var utils=require(_0x7d1f('0x5'));var logger=require(_0x7d1f('0x6'))(_0x7d1f('0x7'));var config=require('../../config/environment');var jayson=require(_0x7d1f('0x8'));var client=jayson[_0x7d1f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b79d5,_0x8f01e8,_0x55ed32){return new BPromise(function(_0x992582,_0x37dcfc){return client['request'](_0x1b79d5,_0x55ed32)[_0x7d1f('0xa')](function(_0x1bbdf0){logger['info'](_0x7d1f('0xb'),_0x8f01e8,_0x7d1f('0xc'));logger[_0x7d1f('0xd')](_0x7d1f('0xe'),_0x8f01e8,_0x7d1f('0xc'),JSON[_0x7d1f('0xf')](_0x1bbdf0));if(_0x1bbdf0[_0x7d1f('0x10')]){if(_0x1bbdf0['error'][_0x7d1f('0x11')]===0x1f4){logger['error'](_0x7d1f('0xb'),_0x8f01e8,_0x1bbdf0['error'][_0x7d1f('0x12')]);return _0x37dcfc(_0x1bbdf0[_0x7d1f('0x10')][_0x7d1f('0x12')]);}logger[_0x7d1f('0x10')]('ServicenowField,\x20%s,\x20%s',_0x8f01e8,_0x1bbdf0[_0x7d1f('0x10')][_0x7d1f('0x12')]);return _0x992582(_0x1bbdf0[_0x7d1f('0x10')]['message']);}else{logger[_0x7d1f('0x13')]('ServicenowField,\x20%s,\x20%s',_0x8f01e8,_0x7d1f('0xc'));_0x992582(_0x1bbdf0['result']['message']);}})[_0x7d1f('0x14')](function(_0x479040){logger[_0x7d1f('0x10')](_0x7d1f('0xb'),_0x8f01e8,_0x479040);_0x37dcfc(_0x479040);});});}
\ No newline at end of file
index 500f0f7..ffe7009 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcca4=['../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','index','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4ee9c9,_0x4573f8){var _0x24e5b0=function(_0x373f91){while(--_0x373f91){_0x4ee9c9['push'](_0x4ee9c9['shift']());}};_0x24e5b0(++_0x4573f8);}(_0xcca4,0xc2));var _0x4cca=function(_0x1f4172,_0x4b7c1d){_0x1f4172=_0x1f4172-0x0;var _0x4cd833=_0xcca4[_0x1f4172];return _0x4cd833;};'use strict';var multer=require(_0x4cca('0x0'));var util=require('util');var path=require(_0x4cca('0x1'));var timeout=require(_0x4cca('0x2'));var express=require(_0x4cca('0x3'));var router=express[_0x4cca('0x4')]();var auth=require(_0x4cca('0x5'));var interaction=require(_0x4cca('0x6'));var config=require(_0x4cca('0x7'));var controller=require(_0x4cca('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4cca('0x9')]);router[_0x4cca('0xa')]('/:id',auth[_0x4cca('0xb')](),controller[_0x4cca('0xc')]);router[_0x4cca('0xa')](_0x4cca('0xd'),auth['isAuthenticated'](),controller[_0x4cca('0xe')]);router['get'](_0x4cca('0xf'),auth[_0x4cca('0xb')](),controller[_0x4cca('0x10')]);router['post']('/',auth[_0x4cca('0xb')](),controller[_0x4cca('0x11')]);router[_0x4cca('0x12')](_0x4cca('0xd'),auth['isAuthenticated'](),controller[_0x4cca('0x13')]);router[_0x4cca('0x14')](_0x4cca('0x15'),auth[_0x4cca('0xb')](),controller[_0x4cca('0x16')]);router['delete'](_0x4cca('0x15'),auth[_0x4cca('0xb')](),controller[_0x4cca('0x17')]);module[_0x4cca('0x18')]=router;
\ No newline at end of file
+var _0xb4d0=['getConfigurations','getFields','post','create','addConfiguration','put','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x414970,_0x4f502b){var _0xc11455=function(_0x34c261){while(--_0x34c261){_0x414970['push'](_0x414970['shift']());}};_0xc11455(++_0x4f502b);}(_0xb4d0,0xb8));var _0x0b4d=function(_0xf7f62c,_0x34e3e9){_0xf7f62c=_0xf7f62c-0x0;var _0x1fa89e=_0xb4d0[_0xf7f62c];return _0x1fa89e;};'use strict';var multer=require(_0x0b4d('0x0'));var util=require(_0x0b4d('0x1'));var path=require(_0x0b4d('0x2'));var timeout=require(_0x0b4d('0x3'));var express=require(_0x0b4d('0x4'));var router=express['Router']();var auth=require(_0x0b4d('0x5'));var interaction=require(_0x0b4d('0x6'));var config=require(_0x0b4d('0x7'));var controller=require('./intSugarcrmAccount.controller');router[_0x0b4d('0x8')]('/',auth[_0x0b4d('0x9')](),controller[_0x0b4d('0xa')]);router['get'](_0x0b4d('0xb'),auth['isAuthenticated'](),controller[_0x0b4d('0xc')]);router['get'](_0x0b4d('0xd'),auth[_0x0b4d('0x9')](),controller[_0x0b4d('0xe')]);router[_0x0b4d('0x8')]('/:id/fields',auth[_0x0b4d('0x9')](),controller[_0x0b4d('0xf')]);router[_0x0b4d('0x10')]('/',auth[_0x0b4d('0x9')](),controller[_0x0b4d('0x11')]);router[_0x0b4d('0x10')]('/:id/configurations',auth[_0x0b4d('0x9')](),controller[_0x0b4d('0x12')]);router[_0x0b4d('0x13')](_0x0b4d('0xb'),auth[_0x0b4d('0x9')](),controller[_0x0b4d('0x14')]);router[_0x0b4d('0x15')](_0x0b4d('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 9f5a598..5460c85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54e9=['username','STRING'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x54e9,0xbd));var _0x954e=function(_0x3c560a,_0x1c46d4){_0x3c560a=_0x3c560a-0x0;var _0x22e9be=_0x54e9[_0x3c560a];return _0x22e9be;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x954e('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x954e('0x1')},'password':{'type':Sequelize[_0x954e('0x0')]},'remoteUri':{'type':Sequelize[_0x954e('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x954e('0x0')]}};
\ No newline at end of file
+var _0x74c3=['sequelize','exports','STRING','remoteUri'];(function(_0x2adb49,_0x2fb9b5){var _0x16b293=function(_0x3578e3){while(--_0x3578e3){_0x2adb49['push'](_0x2adb49['shift']());}};_0x16b293(++_0x2fb9b5);}(_0x74c3,0x16c));var _0x374c=function(_0x31d5d9,_0x207133){_0x31d5d9=_0x31d5d9-0x0;var _0x1e64c3=_0x74c3[_0x31d5d9];return _0x1e64c3;};'use strict';var Sequelize=require(_0x374c('0x0'));module[_0x374c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x374c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x374c('0x2')],'unique':_0x374c('0x3')},'serverUrl':{'type':Sequelize[_0x374c('0x2')]}};
\ No newline at end of file
index 2f77ad0..386fc47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x518b=['SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','direction','password','remoteUri','slice','format','JSON','stringify','username','Invalid\x20Login','Password\x20Expired','%s%s','Calls','values','module_fields','remove','endsWith','value','statusCode','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','crypto','jsforce','querystring','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','destroy','stack','name','send','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel'];(function(_0x4b1b5c,_0x4228d3){var _0x5366c7=function(_0x516096){while(--_0x516096){_0x4b1b5c['push'](_0x4b1b5c['shift']());}};_0x5366c7(++_0x4228d3);}(_0x518b,0x1e8));var _0xb518=function(_0x5f5017,_0x183deb){_0x5f5017=_0x5f5017-0x0;var _0x56da51=_0x518b[_0x5f5017];return _0x56da51;};'use strict';var pdf=require(_0xb518('0x0'));var emlformat=require(_0xb518('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb518('0x2'));var jsonpatch=require(_0xb518('0x3'));var rp=require(_0xb518('0x4'));var moment=require(_0xb518('0x5'));var BPromise=require(_0xb518('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb518('0x7'));var sox=require('sox');var csv=require(_0xb518('0x8'));var ejs=require(_0xb518('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb518('0xa'));var jsforce=require(_0xb518('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb518('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb518('0xd'));var logger=require(_0xb518('0xe'))(_0xb518('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb518('0x10'))['db'];var integrations=require(_0xb518('0x11'));var jayson=require(_0xb518('0x12'));var client=jayson['client'][_0xb518('0x13')]({'port':0x232a});function checkPasswordPattern(_0x8d6d4c,_0x2d6416,_0x201f02){if(_0x201f02){var _0x33bb51=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33bb51[_0xb518('0x14')](_0x2d6416)){return _0x8d6d4c;}else{throw new db[(_0xb518('0x15'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x8d6d4c;}}function respondWithRpcPromise(_0x486bbe,_0x800c53,_0xe04a6f,_0x7f324d){return new BPromise(function(_0x1a2349,_0x52910e){var _0x266236=_0x7f324d||client;return _0x266236[_0xb518('0x16')](_0x486bbe,_0xe04a6f)[_0xb518('0x17')](function(_0x4ab3fa){logger[_0xb518('0x18')](_0xb518('0x19'),_0x800c53,_0xb518('0x1a'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x800c53,'request\x20sent',JSON['stringify'](_0x4ab3fa));if(_0x4ab3fa[_0xb518('0x1b')]){if(_0x4ab3fa[_0xb518('0x1b')]['code']===0x1f4){logger[_0xb518('0x1b')](_0xb518('0x19'),_0x800c53,_0x4ab3fa[_0xb518('0x1b')]['message']);return _0x52910e(_0x4ab3fa[_0xb518('0x1b')][_0xb518('0x1c')]);}logger['error'](_0xb518('0x19'),_0x800c53,_0x4ab3fa[_0xb518('0x1b')]['message']);return _0x1a2349(_0x4ab3fa['error']['message']);}else{logger[_0xb518('0x18')]('SugarcrmAccount,\x20%s,\x20%s',_0x800c53,_0xb518('0x1a'));_0x1a2349(_0x4ab3fa[_0xb518('0x1d')][_0xb518('0x1c')]);}})[_0xb518('0x1e')](function(_0x571445){logger[_0xb518('0x1b')](_0xb518('0x19'),_0x800c53,_0x571445);_0x52910e(_0x571445);});});}function respondWithStatusCode(_0x59d901,_0xd4bd21){_0xd4bd21=_0xd4bd21||0xcc;return function(_0x5c6ad6){if(_0x5c6ad6){return _0x59d901[_0xb518('0x1f')](_0xd4bd21);}return _0x59d901[_0xb518('0x20')](_0xd4bd21)[_0xb518('0x21')]();};}function respondWithResult(_0x412fd0,_0x4b1cf2){_0x4b1cf2=_0x4b1cf2||0xc8;return function(_0x2d2f9d){if(_0x2d2f9d){return _0x412fd0[_0xb518('0x20')](_0x4b1cf2)[_0xb518('0x22')](_0x2d2f9d);}};}function respondWithFilteredResult(_0x27d675,_0x3f2c6b){return function(_0x3a2cac){if(_0x3a2cac){var _0x4c64ea=_0x3a2cac[_0xb518('0x23')],_0x1e217d=_0x3f2c6b[_0xb518('0x24')],_0x124f3e=_0x3f2c6b[_0xb518('0x24')]+_0x3f2c6b[_0xb518('0x25')],_0x1577d6;if(_0x124f3e>=_0x4c64ea){_0x124f3e=_0x4c64ea;_0x1577d6=0xc8;}else{_0x1577d6=0xce;}_0x27d675['status'](_0x1577d6);return _0x27d675['set'](_0xb518('0x26'),_0x1e217d+'-'+_0x124f3e+'/'+_0x4c64ea)['json'](_0x3a2cac);}return null;};}function patchUpdates(_0x358709){return function(_0x5c573b){try{jsonpatch['apply'](_0x5c573b,_0x358709,!![]);}catch(_0x4716c){return BPromise[_0xb518('0x27')](_0x4716c);}return _0x5c573b[_0xb518('0x28')]();};}function saveUpdates(_0x307f06,_0x38f264){return function(_0x3b059a){if(_0x3b059a){return _0x3b059a['update'](_0x307f06)[_0xb518('0x17')](function(_0x38ce8a){return _0x38ce8a;});}return null;};}function removeEntity(_0x3b4922,_0x3be29c){return function(_0x5191dd){if(_0x5191dd){return _0x5191dd[_0xb518('0x29')]()['then'](function(){_0x3b4922[_0xb518('0x20')](0xcc)[_0xb518('0x21')]();});}};}function handleEntityNotFound(_0x1decc8,_0x3811cc){return function(_0x2ee1aa){if(!_0x2ee1aa){_0x1decc8[_0xb518('0x1f')](0x194);}return _0x2ee1aa;};}function handleError(_0x12373f,_0xeeb22d){_0xeeb22d=_0xeeb22d||0x1f4;return function(_0x131767){logger['error'](_0x131767[_0xb518('0x2a')]);if(_0x131767[_0xb518('0x2b')]){delete _0x131767[_0xb518('0x2b')];}_0x12373f['status'](_0xeeb22d)[_0xb518('0x2c')](_0x131767);};}exports['index']=function(_0x334739,_0x2f9b9d){var _0x20efba={},_0x314f05={},_0x2f15a2={'count':0x0,'rows':[]};var _0x435cc5=_['map'](db[_0xb518('0x2d')][_0xb518('0x2e')],function(_0x4b8605){return{'name':_0x4b8605[_0xb518('0x2f')],'type':_0x4b8605[_0xb518('0x30')][_0xb518('0x31')]};});_0x314f05[_0xb518('0x32')]=_[_0xb518('0x33')](_0x435cc5,_0xb518('0x2b'));_0x314f05[_0xb518('0x34')]=_[_0xb518('0x35')](_0x334739[_0xb518('0x34')]);_0x314f05['filters']=_[_0xb518('0x36')](_0x314f05[_0xb518('0x32')],_0x314f05[_0xb518('0x34')]);_0x20efba[_0xb518('0x37')]=_['intersection'](_0x314f05[_0xb518('0x32')],qs['fields'](_0x334739[_0xb518('0x34')][_0xb518('0x38')]));_0x20efba[_0xb518('0x37')]=_0x20efba[_0xb518('0x37')][_0xb518('0x39')]?_0x20efba['attributes']:_0x314f05[_0xb518('0x32')];if(!_0x334739[_0xb518('0x34')][_0xb518('0x3a')]('nolimit')){_0x20efba[_0xb518('0x25')]=qs[_0xb518('0x25')](_0x334739[_0xb518('0x34')][_0xb518('0x25')]);_0x20efba[_0xb518('0x24')]=qs['offset'](_0x334739['query'][_0xb518('0x24')]);}_0x20efba[_0xb518('0x3b')]=qs[_0xb518('0x3c')](_0x334739[_0xb518('0x34')][_0xb518('0x3c')]);_0x20efba['where']=qs[_0xb518('0x3d')](_[_0xb518('0x3e')](_0x334739[_0xb518('0x34')],_0x314f05[_0xb518('0x3d')]),_0x435cc5);if(_0x334739[_0xb518('0x34')]['filter']){_0x20efba['where']=_[_0xb518('0x3f')](_0x20efba[_0xb518('0x40')],{'$or':_[_0xb518('0x33')](_0x435cc5,function(_0x615d45){if(_0x615d45[_0xb518('0x30')]!==_0xb518('0x41')){var _0x2b2afe={};_0x2b2afe[_0x615d45[_0xb518('0x2b')]]={'$like':'%'+_0x334739['query'][_0xb518('0x42')]+'%'};return _0x2b2afe;}})});}_0x20efba=_[_0xb518('0x3f')]({},_0x20efba,_0x334739[_0xb518('0x43')]);var _0x2b4f55={'where':_0x20efba[_0xb518('0x40')]};return db[_0xb518('0x2d')][_0xb518('0x23')](_0x2b4f55)[_0xb518('0x17')](function(_0x424027){_0x2f15a2[_0xb518('0x23')]=_0x424027;if(_0x334739[_0xb518('0x34')][_0xb518('0x44')]){_0x20efba[_0xb518('0x45')]=[{'all':!![]}];}return db[_0xb518('0x2d')][_0xb518('0x46')](_0x20efba);})[_0xb518('0x17')](function(_0x5a87b6){_0x2f15a2[_0xb518('0x47')]=_0x5a87b6;return _0x2f15a2;})['then'](respondWithFilteredResult(_0x2f9b9d,_0x20efba))[_0xb518('0x1e')](handleError(_0x2f9b9d,null));};exports[_0xb518('0x48')]=function(_0x58daf6,_0x37df7c){var _0x446d62={'raw':![],'where':{'id':_0x58daf6[_0xb518('0x49')]['id']}},_0x5c6b24={};_0x5c6b24['model']=_[_0xb518('0x35')](db[_0xb518('0x2d')][_0xb518('0x2e')]);_0x5c6b24[_0xb518('0x34')]=_[_0xb518('0x35')](_0x58daf6[_0xb518('0x34')]);_0x5c6b24[_0xb518('0x3d')]=_['intersection'](_0x5c6b24[_0xb518('0x32')],_0x5c6b24['query']);_0x446d62[_0xb518('0x37')]=_[_0xb518('0x36')](_0x5c6b24[_0xb518('0x32')],qs[_0xb518('0x38')](_0x58daf6['query'][_0xb518('0x38')]));_0x446d62[_0xb518('0x37')]=_0x446d62[_0xb518('0x37')]['length']?_0x446d62[_0xb518('0x37')]:_0x5c6b24[_0xb518('0x32')];if(_0x58daf6['query'][_0xb518('0x44')]){_0x446d62[_0xb518('0x45')]=[{'all':!![]}];}_0x446d62=_['merge']({},_0x446d62,_0x58daf6[_0xb518('0x43')]);return db[_0xb518('0x2d')][_0xb518('0x4a')](_0x446d62)[_0xb518('0x17')](handleEntityNotFound(_0x37df7c,null))[_0xb518('0x17')](respondWithResult(_0x37df7c,null))['catch'](handleError(_0x37df7c,null));};exports[_0xb518('0x4b')]=function(_0x309145,_0x3d8161){return db[_0xb518('0x2d')][_0xb518('0x4b')](_0x309145[_0xb518('0x4c')],{})[_0xb518('0x17')](respondWithResult(_0x3d8161,0xc9))[_0xb518('0x1e')](handleError(_0x3d8161,null));};exports['update']=function(_0x3bb719,_0x3113e3){if(_0x3bb719[_0xb518('0x4c')]['id']){delete _0x3bb719['body']['id'];}return db[_0xb518('0x2d')][_0xb518('0x4a')]({'where':{'id':_0x3bb719[_0xb518('0x49')]['id']}})[_0xb518('0x17')](handleEntityNotFound(_0x3113e3,null))[_0xb518('0x17')](saveUpdates(_0x3bb719[_0xb518('0x4c')],null))[_0xb518('0x17')](respondWithResult(_0x3113e3,null))['catch'](handleError(_0x3113e3,null));};exports['destroy']=function(_0x3269d1,_0x5c6305){return db[_0xb518('0x2d')][_0xb518('0x4a')]({'where':{'id':_0x3269d1[_0xb518('0x49')]['id']}})['then'](handleEntityNotFound(_0x5c6305,null))[_0xb518('0x17')](removeEntity(_0x5c6305,null))[_0xb518('0x1e')](handleError(_0x5c6305,null));};exports[_0xb518('0x4d')]=function(_0x21b2d5,_0x49de2d,_0x15b979){var _0x1f1b71={};var _0x5cc868={};var _0x35c9a8;var _0x36988f;return db[_0xb518('0x2d')][_0xb518('0x4e')]({'where':{'id':_0x21b2d5[_0xb518('0x49')]['id']}})['then'](handleEntityNotFound(_0x49de2d,null))[_0xb518('0x17')](function(_0x4e6ebf){if(_0x4e6ebf){_0x35c9a8=_0x4e6ebf;_0x5cc868[_0xb518('0x32')]=_[_0xb518('0x35')](db[_0xb518('0x4f')][_0xb518('0x2e')]);_0x5cc868[_0xb518('0x34')]=_[_0xb518('0x35')](_0x21b2d5[_0xb518('0x34')]);_0x5cc868[_0xb518('0x3d')]=_['intersection'](_0x5cc868['model'],_0x5cc868[_0xb518('0x34')]);_0x1f1b71[_0xb518('0x37')]=_[_0xb518('0x36')](_0x5cc868[_0xb518('0x32')],qs[_0xb518('0x38')](_0x21b2d5[_0xb518('0x34')][_0xb518('0x38')]));_0x1f1b71['attributes']=_0x1f1b71[_0xb518('0x37')][_0xb518('0x39')]?_0x1f1b71['attributes']:_0x5cc868[_0xb518('0x32')];_0x1f1b71[_0xb518('0x3b')]=qs[_0xb518('0x3c')](_0x21b2d5[_0xb518('0x34')][_0xb518('0x3c')]);_0x1f1b71['where']=qs[_0xb518('0x3d')](_[_0xb518('0x3e')](_0x21b2d5[_0xb518('0x34')],_0x5cc868[_0xb518('0x3d')]));if(_0x21b2d5[_0xb518('0x34')]['filter']){_0x1f1b71[_0xb518('0x40')]=_[_0xb518('0x3f')](_0x1f1b71[_0xb518('0x40')],{'$or':_[_0xb518('0x33')](_0x1f1b71[_0xb518('0x37')],function(_0x28c1b1){var _0x3d37d={};_0x3d37d[_0x28c1b1]={'$like':'%'+_0x21b2d5[_0xb518('0x34')][_0xb518('0x42')]+'%'};return _0x3d37d;})});}_0x1f1b71=_[_0xb518('0x3f')]({},_0x1f1b71,_0x21b2d5['options']);return _0x35c9a8[_0xb518('0x4d')](_0x1f1b71);}})[_0xb518('0x17')](function(_0x32ad71){if(_0x32ad71){_0x36988f=_0x32ad71[_0xb518('0x39')];if(!_0x21b2d5[_0xb518('0x34')][_0xb518('0x3a')](_0xb518('0x50'))){_0x1f1b71[_0xb518('0x25')]=qs[_0xb518('0x25')](_0x21b2d5[_0xb518('0x34')]['limit']);_0x1f1b71[_0xb518('0x24')]=qs['offset'](_0x21b2d5[_0xb518('0x34')]['offset']);}return _0x35c9a8[_0xb518('0x4d')](_0x1f1b71);}})[_0xb518('0x17')](function(_0x30d274){if(_0x30d274){return _0x30d274?{'count':_0x36988f,'rows':_0x30d274}:null;}})['then'](respondWithResult(_0x49de2d,null))[_0xb518('0x1e')](handleError(_0x49de2d,null));};exports[_0xb518('0x51')]=function(_0x45bf0f,_0x4154ea,_0x326775){if(_0x45bf0f['body']['id']){delete _0x45bf0f[_0xb518('0x4c')]['id'];}return db[_0xb518('0x2d')][_0xb518('0x4e')]({'where':{'id':_0x45bf0f[_0xb518('0x49')]['id']}})[_0xb518('0x17')](handleEntityNotFound(_0x4154ea,null))[_0xb518('0x17')](function(_0x290867){if(_0x290867){_0x45bf0f[_0xb518('0x4c')][_0xb518('0x52')]=_0x290867['id'];_0x45bf0f[_0xb518('0x4c')][_0xb518('0x53')]=integrations['getSubjects'](_0x45bf0f['body']['channel'],_0x45bf0f[_0xb518('0x4c')][_0xb518('0x30')]);_0x45bf0f[_0xb518('0x4c')][_0xb518('0x54')]=integrations[_0xb518('0x55')](_0x45bf0f[_0xb518('0x4c')][_0xb518('0x56')],_0x45bf0f[_0xb518('0x4c')][_0xb518('0x30')]);return db['SugarcrmConfiguration'][_0xb518('0x4b')](_0x45bf0f[_0xb518('0x4c')],{'include':[{'model':db[_0xb518('0x57')],'as':_0xb518('0x53')},{'model':db[_0xb518('0x57')],'as':_0xb518('0x54')}]});}return null;})[_0xb518('0x17')](respondWithResult(_0x4154ea,null))[_0xb518('0x1e')](handleError(_0x4154ea,null));};exports[_0xb518('0x58')]=function(_0x12fe39,_0x30ad6c,_0x68c040){var _0xb6162e='';var _0x469c48=['id',_0xb518('0x2b'),'assigned_user_id',_0xb518('0x59'),_0xb518('0x5a'),_0xb518('0x5b'),_0xb518('0x5c'),_0xb518('0x5d'),_0xb518('0x5e'),_0xb518('0x5f'),'parent_name',_0xb518('0x60')];return db[_0xb518('0x2d')][_0xb518('0x4e')]({'where':{'id':_0x12fe39[_0xb518('0x49')]['id']},'attributes':['id','username',_0xb518('0x61'),_0xb518('0x62')]})[_0xb518('0x17')](handleEntityNotFound(_0x30ad6c,null))['then'](function(_0x24baa5){if(_0x24baa5){_0xb6162e=_0x24baa5[_0xb518('0x62')];var _0x161053=_0xb6162e[_0xb518('0x63')](-0x1);if(_0x161053==='/'){_0xb6162e=_0xb6162e['substring'](0x0,_0xb6162e['lastIndexOf'](_0x161053));}return rp({'method':'POST','uri':util[_0xb518('0x64')]('%s%s',_0xb6162e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0xb518('0x65'),'rest_data':JSON[_0xb518('0x66')]({'user_auth':{'user_name':_0x24baa5[_0xb518('0x67')],'password':_0x24baa5[_0xb518('0x61')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xb518('0x17')](function(_0x1a6de3){if(_0x1a6de3&&_0x1a6de3[_0xb518('0x2b')]!==_0xb518('0x68')&&_0x1a6de3[_0xb518('0x2b')]!==_0xb518('0x69')){return rp({'method':'POST','uri':util['format'](_0xb518('0x6a'),_0xb6162e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0xb518('0x65'),'rest_data':JSON[_0xb518('0x66')]({'session':_0x1a6de3['id'],'module_name':_0xb518('0x6b')})}})['then'](function(_0x1b255a){if(_0x1b255a){var _0x38ebd2=_[_0xb518('0x6c')](_0x1b255a[_0xb518('0x6d')]);_[_0xb518('0x6e')](_0x38ebd2,function(_0x422c03){return _0x469c48['includes'](_0x422c03[_0xb518('0x2b')]);});return{'count':_0x38ebd2['length'],'rows':_[_0xb518('0x33')](_0x38ebd2,function(_0x5af9ff){return{'id':_0x5af9ff[_0xb518('0x2b')],'name':_0x5af9ff['label'],'custom':_[_0xb518('0x6f')](_0x5af9ff[_0xb518('0x2b')],'_c')?!![]:![],'options':_0x5af9ff['options']?_['map'](_['values'](_0x5af9ff[_0xb518('0x43')]),function(_0x1cb445){return{'name':_0x1cb445[_0xb518('0x70')],'value':_0x1cb445['name']};}):[]};})};}})['then'](respondWithResult(_0x30ad6c,null))[_0xb518('0x1e')](function(_0x5b55ba){var _0x5ab596=_0x12fe39[_0xb518('0x34')][_0xb518('0x14')]?0x1f4:_0x5b55ba[_0xb518('0x71')]||0x1f4;logger[_0xb518('0x1b')]('getFields,\x20%s,\x20%s,\x20%s',_0xb518('0x58'),_0x5ab596,JSON['stringify'](_0x5b55ba));delete _0x5b55ba[_0xb518('0x2b')];if(_0x5ab596===0x191){_0x5ab596=0x190;}_0x30ad6c[_0xb518('0x20')](_0x5ab596)[_0xb518('0x2c')](_0x12fe39['query'][_0xb518('0x14')]?{'message':_0xb518('0x72'),'statusCode':_0x5b55ba[_0xb518('0x71')]}:_0x5b55ba);});}else{var _0x18e4ee=0x1f4;_0x30ad6c[_0xb518('0x20')](_0x18e4ee)[_0xb518('0x2c')]({'message':_0xb518('0x72'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0xb89c=['catch','status','json','count','offset','limit','set','apply','end','stack','name','send','SugarcrmAccount','rawAttributes','fieldName','type','key','model','map','query','filters','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','intersection','find','create','body','update','getConfigurations','SugarcrmConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','channel','getDescriptions','SugarcrmField','Subjects','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_type','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','Calls','values','module_fields','remove','includes','label','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x19efbc,_0x10b7d7){var _0x205c5e=function(_0x49daa4){while(--_0x49daa4){_0x19efbc['push'](_0x19efbc['shift']());}};_0x205c5e(++_0x10b7d7);}(_0xb89c,0x1e5));var _0xcb89=function(_0x294939,_0x1f6c1f){_0x294939=_0x294939-0x0;var _0x473885=_0xb89c[_0x294939];return _0x473885;};'use strict';var pdf=require(_0xcb89('0x0'));var emlformat=require(_0xcb89('0x1'));var rimraf=require(_0xcb89('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb89('0x3'));var rp=require('request-promise');var moment=require(_0xcb89('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcb89('0x5'));var util=require(_0xcb89('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xcb89('0x7'));var ejs=require(_0xcb89('0x8'));var fs=require('fs');var _=require(_0xcb89('0x9'));var squel=require(_0xcb89('0xa'));var crypto=require(_0xcb89('0xb'));var jsforce=require(_0xcb89('0xc'));var deskjs=require(_0xcb89('0xd'));var toCsv=require(_0xcb89('0x7'));var querystring=require(_0xcb89('0xe'));var Papa=require(_0xcb89('0xf'));var Redis=require(_0xcb89('0x10'));var authService=require(_0xcb89('0x11'));var qs=require(_0xcb89('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb89('0x13'))(_0xcb89('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xcb89('0x15'))['db'];var integrations=require(_0xcb89('0x16'));var jayson=require(_0xcb89('0x17'));var client=jayson[_0xcb89('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x280ccd,_0x20e734,_0x16a088){if(_0x16a088){var _0x159ece=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x159ece[_0xcb89('0x19')](_0x20e734)){return _0x280ccd;}else{throw new db[(_0xcb89('0x1a'))]['ValidationError'](_0xcb89('0x1b'));}}else{return _0x280ccd;}}function respondWithRpcPromise(_0x19c0f3,_0x2b35c2,_0x39e2fd,_0x312cfa){return new BPromise(function(_0x4a3531,_0x48d3c9){var _0x3b9d86=_0x312cfa||client;return _0x3b9d86[_0xcb89('0x1c')](_0x19c0f3,_0x39e2fd)[_0xcb89('0x1d')](function(_0x51f296){logger[_0xcb89('0x1e')](_0xcb89('0x1f'),_0x2b35c2,_0xcb89('0x20'));logger[_0xcb89('0x21')](_0xcb89('0x22'),_0x2b35c2,'request\x20sent',JSON['stringify'](_0x51f296));if(_0x51f296[_0xcb89('0x23')]){if(_0x51f296['error'][_0xcb89('0x24')]===0x1f4){logger[_0xcb89('0x23')](_0xcb89('0x1f'),_0x2b35c2,_0x51f296[_0xcb89('0x23')][_0xcb89('0x25')]);return _0x48d3c9(_0x51f296['error'][_0xcb89('0x25')]);}logger[_0xcb89('0x23')](_0xcb89('0x1f'),_0x2b35c2,_0x51f296['error'][_0xcb89('0x25')]);return _0x4a3531(_0x51f296['error'][_0xcb89('0x25')]);}else{logger[_0xcb89('0x1e')]('SugarcrmAccount,\x20%s,\x20%s',_0x2b35c2,'request\x20sent');_0x4a3531(_0x51f296[_0xcb89('0x26')][_0xcb89('0x25')]);}})[_0xcb89('0x27')](function(_0x4f1f22){logger['error'](_0xcb89('0x1f'),_0x2b35c2,_0x4f1f22);_0x48d3c9(_0x4f1f22);});});}function respondWithStatusCode(_0x80f5b8,_0x54b845){_0x54b845=_0x54b845||0xcc;return function(_0x3a4891){if(_0x3a4891){return _0x80f5b8['sendStatus'](_0x54b845);}return _0x80f5b8['status'](_0x54b845)['end']();};}function respondWithResult(_0x3758a6,_0x353fa1){_0x353fa1=_0x353fa1||0xc8;return function(_0x5a2597){if(_0x5a2597){return _0x3758a6[_0xcb89('0x28')](_0x353fa1)[_0xcb89('0x29')](_0x5a2597);}};}function respondWithFilteredResult(_0x31418a,_0x484f55){return function(_0x2f76a0){if(_0x2f76a0){var _0x40c7aa=_0x2f76a0[_0xcb89('0x2a')],_0x5d3d97=_0x484f55['offset'],_0x172fb1=_0x484f55[_0xcb89('0x2b')]+_0x484f55[_0xcb89('0x2c')],_0x2ee5e6;if(_0x172fb1>=_0x40c7aa){_0x172fb1=_0x40c7aa;_0x2ee5e6=0xc8;}else{_0x2ee5e6=0xce;}_0x31418a[_0xcb89('0x28')](_0x2ee5e6);return _0x31418a[_0xcb89('0x2d')]('Content-Range',_0x5d3d97+'-'+_0x172fb1+'/'+_0x40c7aa)[_0xcb89('0x29')](_0x2f76a0);}return null;};}function patchUpdates(_0x356f59){return function(_0x18c5fe){try{jsonpatch[_0xcb89('0x2e')](_0x18c5fe,_0x356f59,!![]);}catch(_0x2329a4){return BPromise['reject'](_0x2329a4);}return _0x18c5fe['save']();};}function saveUpdates(_0x55acdb,_0x91562b){return function(_0x40e89f){if(_0x40e89f){return _0x40e89f['update'](_0x55acdb)[_0xcb89('0x1d')](function(_0x3c4fcc){return _0x3c4fcc;});}return null;};}function removeEntity(_0x4197d8,_0x5535d3){return function(_0x5e9088){if(_0x5e9088){return _0x5e9088['destroy']()[_0xcb89('0x1d')](function(){_0x4197d8['status'](0xcc)[_0xcb89('0x2f')]();});}};}function handleEntityNotFound(_0xb232b9,_0x2c8088){return function(_0x57562a){if(!_0x57562a){_0xb232b9['sendStatus'](0x194);}return _0x57562a;};}function handleError(_0x54358e,_0x481b65){_0x481b65=_0x481b65||0x1f4;return function(_0x221329){logger[_0xcb89('0x23')](_0x221329[_0xcb89('0x30')]);if(_0x221329[_0xcb89('0x31')]){delete _0x221329[_0xcb89('0x31')];}_0x54358e[_0xcb89('0x28')](_0x481b65)[_0xcb89('0x32')](_0x221329);};}exports['index']=function(_0x566d75,_0x44a8b6){var _0x318023={},_0x91afc6={},_0xf01c27={'count':0x0,'rows':[]};var _0x27945b=_['map'](db[_0xcb89('0x33')][_0xcb89('0x34')],function(_0x41de3a){return{'name':_0x41de3a[_0xcb89('0x35')],'type':_0x41de3a[_0xcb89('0x36')][_0xcb89('0x37')]};});_0x91afc6[_0xcb89('0x38')]=_[_0xcb89('0x39')](_0x27945b,_0xcb89('0x31'));_0x91afc6[_0xcb89('0x3a')]=_['keys'](_0x566d75[_0xcb89('0x3a')]);_0x91afc6[_0xcb89('0x3b')]=_['intersection'](_0x91afc6[_0xcb89('0x38')],_0x91afc6[_0xcb89('0x3a')]);_0x318023['attributes']=_['intersection'](_0x91afc6[_0xcb89('0x38')],qs['fields'](_0x566d75[_0xcb89('0x3a')][_0xcb89('0x3c')]));_0x318023['attributes']=_0x318023[_0xcb89('0x3d')][_0xcb89('0x3e')]?_0x318023[_0xcb89('0x3d')]:_0x91afc6[_0xcb89('0x38')];if(!_0x566d75['query']['hasOwnProperty'](_0xcb89('0x3f'))){_0x318023[_0xcb89('0x2c')]=qs[_0xcb89('0x2c')](_0x566d75[_0xcb89('0x3a')]['limit']);_0x318023[_0xcb89('0x2b')]=qs['offset'](_0x566d75['query'][_0xcb89('0x2b')]);}_0x318023[_0xcb89('0x40')]=qs[_0xcb89('0x41')](_0x566d75[_0xcb89('0x3a')][_0xcb89('0x41')]);_0x318023[_0xcb89('0x42')]=qs[_0xcb89('0x3b')](_[_0xcb89('0x43')](_0x566d75[_0xcb89('0x3a')],_0x91afc6[_0xcb89('0x3b')]),_0x27945b);if(_0x566d75[_0xcb89('0x3a')][_0xcb89('0x44')]){_0x318023[_0xcb89('0x42')]=_['merge'](_0x318023[_0xcb89('0x42')],{'$or':_['map'](_0x27945b,function(_0x30555d){if(_0x30555d[_0xcb89('0x36')]!==_0xcb89('0x45')){var _0x210269={};_0x210269[_0x30555d['name']]={'$like':'%'+_0x566d75[_0xcb89('0x3a')][_0xcb89('0x44')]+'%'};return _0x210269;}})});}_0x318023=_[_0xcb89('0x46')]({},_0x318023,_0x566d75[_0xcb89('0x47')]);var _0x3f53e2={'where':_0x318023['where']};return db[_0xcb89('0x33')][_0xcb89('0x2a')](_0x3f53e2)[_0xcb89('0x1d')](function(_0x1b04be){_0xf01c27[_0xcb89('0x2a')]=_0x1b04be;if(_0x566d75[_0xcb89('0x3a')][_0xcb89('0x48')]){_0x318023['include']=[{'all':!![]}];}return db[_0xcb89('0x33')][_0xcb89('0x49')](_0x318023);})[_0xcb89('0x1d')](function(_0x4be03b){_0xf01c27[_0xcb89('0x4a')]=_0x4be03b;return _0xf01c27;})['then'](respondWithFilteredResult(_0x44a8b6,_0x318023))[_0xcb89('0x27')](handleError(_0x44a8b6,null));};exports[_0xcb89('0x4b')]=function(_0x57dd03,_0x1ecbe5){var _0xc4bbe7={'raw':![],'where':{'id':_0x57dd03[_0xcb89('0x4c')]['id']}},_0x1efe83={};_0x1efe83['model']=_['keys'](db[_0xcb89('0x33')][_0xcb89('0x34')]);_0x1efe83[_0xcb89('0x3a')]=_[_0xcb89('0x4d')](_0x57dd03['query']);_0x1efe83[_0xcb89('0x3b')]=_['intersection'](_0x1efe83['model'],_0x1efe83['query']);_0xc4bbe7[_0xcb89('0x3d')]=_[_0xcb89('0x4e')](_0x1efe83['model'],qs[_0xcb89('0x3c')](_0x57dd03[_0xcb89('0x3a')]['fields']));_0xc4bbe7['attributes']=_0xc4bbe7[_0xcb89('0x3d')][_0xcb89('0x3e')]?_0xc4bbe7[_0xcb89('0x3d')]:_0x1efe83[_0xcb89('0x38')];if(_0x57dd03[_0xcb89('0x3a')]['includeAll']){_0xc4bbe7['include']=[{'all':!![]}];}_0xc4bbe7=_[_0xcb89('0x46')]({},_0xc4bbe7,_0x57dd03[_0xcb89('0x47')]);return db[_0xcb89('0x33')][_0xcb89('0x4f')](_0xc4bbe7)[_0xcb89('0x1d')](handleEntityNotFound(_0x1ecbe5,null))[_0xcb89('0x1d')](respondWithResult(_0x1ecbe5,null))[_0xcb89('0x27')](handleError(_0x1ecbe5,null));};exports['create']=function(_0x42fb09,_0x3edbf3){return db[_0xcb89('0x33')][_0xcb89('0x50')](_0x42fb09[_0xcb89('0x51')],{})['then'](respondWithResult(_0x3edbf3,0xc9))[_0xcb89('0x27')](handleError(_0x3edbf3,null));};exports[_0xcb89('0x52')]=function(_0x1e9135,_0xf810df){if(_0x1e9135[_0xcb89('0x51')]['id']){delete _0x1e9135[_0xcb89('0x51')]['id'];}return db[_0xcb89('0x33')][_0xcb89('0x4f')]({'where':{'id':_0x1e9135[_0xcb89('0x4c')]['id']}})[_0xcb89('0x1d')](handleEntityNotFound(_0xf810df,null))['then'](saveUpdates(_0x1e9135[_0xcb89('0x51')],null))[_0xcb89('0x1d')](respondWithResult(_0xf810df,null))[_0xcb89('0x27')](handleError(_0xf810df,null));};exports['destroy']=function(_0x18e891,_0x1777de){return db[_0xcb89('0x33')][_0xcb89('0x4f')]({'where':{'id':_0x18e891[_0xcb89('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1777de,null))['then'](removeEntity(_0x1777de,null))[_0xcb89('0x27')](handleError(_0x1777de,null));};exports[_0xcb89('0x53')]=function(_0x59afe5,_0x330a11,_0x582dcd){var _0x36a111={};var _0xcb898={};var _0x25a1eb;var _0xf357eb;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x59afe5[_0xcb89('0x4c')]['id']}})[_0xcb89('0x1d')](handleEntityNotFound(_0x330a11,null))[_0xcb89('0x1d')](function(_0x35ab70){if(_0x35ab70){_0x25a1eb=_0x35ab70;_0xcb898[_0xcb89('0x38')]=_['keys'](db[_0xcb89('0x54')][_0xcb89('0x34')]);_0xcb898[_0xcb89('0x3a')]=_['keys'](_0x59afe5[_0xcb89('0x3a')]);_0xcb898[_0xcb89('0x3b')]=_['intersection'](_0xcb898[_0xcb89('0x38')],_0xcb898['query']);_0x36a111[_0xcb89('0x3d')]=_[_0xcb89('0x4e')](_0xcb898[_0xcb89('0x38')],qs[_0xcb89('0x3c')](_0x59afe5['query'][_0xcb89('0x3c')]));_0x36a111[_0xcb89('0x3d')]=_0x36a111[_0xcb89('0x3d')]['length']?_0x36a111[_0xcb89('0x3d')]:_0xcb898[_0xcb89('0x38')];_0x36a111[_0xcb89('0x40')]=qs[_0xcb89('0x41')](_0x59afe5['query'][_0xcb89('0x41')]);_0x36a111['where']=qs[_0xcb89('0x3b')](_[_0xcb89('0x43')](_0x59afe5['query'],_0xcb898['filters']));if(_0x59afe5[_0xcb89('0x3a')][_0xcb89('0x44')]){_0x36a111['where']=_['merge'](_0x36a111[_0xcb89('0x42')],{'$or':_[_0xcb89('0x39')](_0x36a111[_0xcb89('0x3d')],function(_0x18c2a9){var _0x436fff={};_0x436fff[_0x18c2a9]={'$like':'%'+_0x59afe5[_0xcb89('0x3a')]['filter']+'%'};return _0x436fff;})});}_0x36a111=_[_0xcb89('0x46')]({},_0x36a111,_0x59afe5[_0xcb89('0x47')]);return _0x25a1eb[_0xcb89('0x53')](_0x36a111);}})['then'](function(_0x12075c){if(_0x12075c){_0xf357eb=_0x12075c[_0xcb89('0x3e')];if(!_0x59afe5['query'][_0xcb89('0x55')](_0xcb89('0x3f'))){_0x36a111[_0xcb89('0x2c')]=qs[_0xcb89('0x2c')](_0x59afe5[_0xcb89('0x3a')][_0xcb89('0x2c')]);_0x36a111[_0xcb89('0x2b')]=qs[_0xcb89('0x2b')](_0x59afe5[_0xcb89('0x3a')][_0xcb89('0x2b')]);}return _0x25a1eb[_0xcb89('0x53')](_0x36a111);}})[_0xcb89('0x1d')](function(_0x3a451f){if(_0x3a451f){return _0x3a451f?{'count':_0xf357eb,'rows':_0x3a451f}:null;}})[_0xcb89('0x1d')](respondWithResult(_0x330a11,null))[_0xcb89('0x27')](handleError(_0x330a11,null));};exports[_0xcb89('0x56')]=function(_0x5dd035,_0x3ad23b,_0x2b34e0){if(_0x5dd035[_0xcb89('0x51')]['id']){delete _0x5dd035[_0xcb89('0x51')]['id'];}return db[_0xcb89('0x33')][_0xcb89('0x57')]({'where':{'id':_0x5dd035[_0xcb89('0x4c')]['id']}})[_0xcb89('0x1d')](handleEntityNotFound(_0x3ad23b,null))[_0xcb89('0x1d')](function(_0x38a613){if(_0x38a613){_0x5dd035[_0xcb89('0x51')][_0xcb89('0x58')]=_0x38a613['id'];_0x5dd035[_0xcb89('0x51')]['Subjects']=integrations['getSubjects'](_0x5dd035[_0xcb89('0x51')][_0xcb89('0x59')],_0x5dd035[_0xcb89('0x51')][_0xcb89('0x36')]);_0x5dd035[_0xcb89('0x51')]['Descriptions']=integrations[_0xcb89('0x5a')](_0x5dd035[_0xcb89('0x51')][_0xcb89('0x59')],_0x5dd035[_0xcb89('0x51')]['type']);return db[_0xcb89('0x54')][_0xcb89('0x50')](_0x5dd035[_0xcb89('0x51')],{'include':[{'model':db[_0xcb89('0x5b')],'as':_0xcb89('0x5c')},{'model':db[_0xcb89('0x5b')],'as':_0xcb89('0x5d')}]});}return null;})[_0xcb89('0x1d')](respondWithResult(_0x3ad23b,null))[_0xcb89('0x27')](handleError(_0x3ad23b,null));};exports[_0xcb89('0x5e')]=function(_0x30ff3a,_0x8199a2,_0x44f1ad){var _0x17a3f7='';var _0x5ba3b3=['id',_0xcb89('0x31'),_0xcb89('0x5f'),_0xcb89('0x60'),_0xcb89('0x61'),_0xcb89('0x62'),'duration_hours',_0xcb89('0x63'),_0xcb89('0x64'),_0xcb89('0x65'),'parent_name',_0xcb89('0x66')];return db[_0xcb89('0x33')][_0xcb89('0x57')]({'where':{'id':_0x30ff3a['params']['id']},'attributes':['id',_0xcb89('0x67'),_0xcb89('0x68'),'remoteUri']})[_0xcb89('0x1d')](handleEntityNotFound(_0x8199a2,null))[_0xcb89('0x1d')](function(_0x3f62a4){if(_0x3f62a4){_0x17a3f7=_0x3f62a4[_0xcb89('0x69')];var _0x4e7c8d=_0x17a3f7[_0xcb89('0x6a')](-0x1);if(_0x4e7c8d==='/'){_0x17a3f7=_0x17a3f7[_0xcb89('0x6b')](0x0,_0x17a3f7[_0xcb89('0x6c')](_0x4e7c8d));}return rp({'method':_0xcb89('0x6d'),'uri':util[_0xcb89('0x6e')]('%s%s',_0x17a3f7,_0xcb89('0x6f')),'json':!![],'form':{'method':_0xcb89('0x70'),'input_type':'JSON','response_type':_0xcb89('0x71'),'rest_data':JSON[_0xcb89('0x72')]({'user_auth':{'user_name':_0x3f62a4['username'],'password':_0x3f62a4[_0xcb89('0x68')],'encryption':_0xcb89('0x73')},'application':_0xcb89('0x74')})}});}})[_0xcb89('0x1d')](function(_0x131d6d){if(_0x131d6d&&_0x131d6d[_0xcb89('0x31')]!==_0xcb89('0x75')&&_0x131d6d['name']!==_0xcb89('0x76')){return rp({'method':_0xcb89('0x6d'),'uri':util[_0xcb89('0x6e')](_0xcb89('0x77'),_0x17a3f7,_0xcb89('0x6f')),'json':!![],'form':{'method':_0xcb89('0x78'),'input_type':_0xcb89('0x71'),'response_type':'JSON','rest_data':JSON[_0xcb89('0x72')]({'session':_0x131d6d['id'],'module_name':_0xcb89('0x79')})}})[_0xcb89('0x1d')](function(_0x1ec480){if(_0x1ec480){var _0x4ba880=_[_0xcb89('0x7a')](_0x1ec480[_0xcb89('0x7b')]);_[_0xcb89('0x7c')](_0x4ba880,function(_0x589181){return _0x5ba3b3[_0xcb89('0x7d')](_0x589181[_0xcb89('0x31')]);});return{'count':_0x4ba880[_0xcb89('0x3e')],'rows':_[_0xcb89('0x39')](_0x4ba880,function(_0xa6595e){return{'id':_0xa6595e['name'],'name':_0xa6595e[_0xcb89('0x7e')],'custom':_['endsWith'](_0xa6595e[_0xcb89('0x31')],'_c')?!![]:![],'options':_0xa6595e['options']?_[_0xcb89('0x39')](_[_0xcb89('0x7a')](_0xa6595e[_0xcb89('0x47')]),function(_0x30e047){return{'name':_0x30e047[_0xcb89('0x7f')],'value':_0x30e047[_0xcb89('0x31')]};}):[]};})};}})[_0xcb89('0x1d')](respondWithResult(_0x8199a2,null))[_0xcb89('0x27')](function(_0x5e7690){var _0x3ab313=_0x30ff3a[_0xcb89('0x3a')][_0xcb89('0x19')]?0x1f4:_0x5e7690[_0xcb89('0x80')]||0x1f4;logger['error'](_0xcb89('0x81'),_0xcb89('0x5e'),_0x3ab313,JSON[_0xcb89('0x72')](_0x5e7690));delete _0x5e7690[_0xcb89('0x31')];if(_0x3ab313===0x191){_0x3ab313=0x190;}_0x8199a2[_0xcb89('0x28')](_0x3ab313)[_0xcb89('0x32')](_0x30ff3a['query'][_0xcb89('0x19')]?{'message':_0xcb89('0x82'),'statusCode':_0x5e7690['statusCode']}:_0x5e7690);});}else{var _0x2205f6=0x1f4;_0x8199a2[_0xcb89('0x28')](_0x2205f6)[_0xcb89('0x32')]({'message':_0xcb89('0x82'),'statusCode':0x190});}});};
\ No newline at end of file
index 98361b5..58dc3f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c3f=['int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./intSugarcrmAccount.attributes','SugarcrmAccount'];(function(_0x45d4cf,_0x157f52){var _0x26070c=function(_0x34c487){while(--_0x34c487){_0x45d4cf['push'](_0x45d4cf['shift']());}};_0x26070c(++_0x157f52);}(_0x3c3f,0x1d7));var _0xf3c3=function(_0x43e4b3,_0x1444de){_0x43e4b3=_0x43e4b3-0x0;var _0x10c655=_0x3c3f[_0x43e4b3];return _0x10c655;};'use strict';var _=require(_0xf3c3('0x0'));var util=require(_0xf3c3('0x1'));var logger=require(_0xf3c3('0x2'))(_0xf3c3('0x3'));var moment=require(_0xf3c3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf3c3('0x5'));var config=require(_0xf3c3('0x6'));var attributes=require(_0xf3c3('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x60086a,_0x1d1ec8){return _0x60086a['define'](_0xf3c3('0x8'),attributes,{'tableName':_0xf3c3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7cf6=['api','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','exports','lodash'];(function(_0x3e4547,_0x12a7e9){var _0x507529=function(_0x555fff){while(--_0x555fff){_0x3e4547['push'](_0x3e4547['shift']());}};_0x507529(++_0x12a7e9);}(_0x7cf6,0x1af));var _0x67cf=function(_0x59fb8f,_0x367a3a){_0x59fb8f=_0x59fb8f-0x0;var _0x3e7cf1=_0x7cf6[_0x59fb8f];return _0x3e7cf1;};'use strict';var _=require(_0x67cf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x67cf('0x1'));var moment=require('moment');var BPromise=require(_0x67cf('0x2'));var rp=require(_0x67cf('0x3'));var fs=require('fs');var path=require(_0x67cf('0x4'));var rimraf=require('rimraf');var config=require(_0x67cf('0x5'));var attributes=require(_0x67cf('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x67cf('0x7')]=function(_0x5b293f,_0x388b46){return _0x5b293f['define']('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 015b77e..32569e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9213=['raw','where','limit','map','include','attributes','model','GetSugarcrmAccount','catch','ShowSugarcrmAccount','SugarcrmAccount','find','debug','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','options'];(function(_0x15538f,_0x36d382){var _0x5d5a02=function(_0x438f37){while(--_0x438f37){_0x15538f['push'](_0x15538f['shift']());}};_0x5d5a02(++_0x36d382);}(_0x9213,0x18e));var _0x3921=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0x9213[_0x5c6299];return _0x23b564;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3921('0x0'));var BPromise=require('bluebird');var rs=require(_0x3921('0x1'));var fs=require('fs');var Redis=require(_0x3921('0x2'));var db=require(_0x3921('0x3'))['db'];var utils=require(_0x3921('0x4'));var logger=require(_0x3921('0x5'))(_0x3921('0x6'));var config=require(_0x3921('0x7'));var jayson=require(_0x3921('0x8'));var client=jayson['client'][_0x3921('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cb4da,_0x4e3cb2,_0x46d64e){return new BPromise(function(_0x58fc33,_0x1216a9){return client[_0x3921('0xa')](_0x3cb4da,_0x46d64e)[_0x3921('0xb')](function(_0x90d98e){logger[_0x3921('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x4e3cb2,_0x3921('0xd'));logger['debug'](_0x3921('0xe'),_0x4e3cb2,_0x3921('0xd'),JSON[_0x3921('0xf')](_0x90d98e));if(_0x90d98e[_0x3921('0x10')]){if(_0x90d98e[_0x3921('0x10')][_0x3921('0x11')]===0x1f4){logger[_0x3921('0x10')](_0x3921('0x12'),_0x4e3cb2,_0x90d98e[_0x3921('0x10')]['message']);return _0x1216a9(_0x90d98e[_0x3921('0x10')][_0x3921('0x13')]);}logger[_0x3921('0x10')](_0x3921('0x12'),_0x4e3cb2,_0x90d98e[_0x3921('0x10')][_0x3921('0x13')]);return _0x58fc33(_0x90d98e[_0x3921('0x10')][_0x3921('0x13')]);}else{logger[_0x3921('0xc')](_0x3921('0x12'),_0x4e3cb2,_0x3921('0xd'));_0x58fc33(_0x90d98e[_0x3921('0x14')]['message']);}})['catch'](function(_0x48cf7a){logger[_0x3921('0x10')](_0x3921('0x12'),_0x4e3cb2,_0x48cf7a);_0x1216a9(_0x48cf7a);});});}exports['GetSugarcrmAccount']=function(_0x3b8b37){var _0x1082a8=this;return new Promise(function(_0x17bb88,_0x41b27c){return db['SugarcrmAccount']['findAll']({'raw':_0x3b8b37[_0x3921('0x15')]?_0x3b8b37[_0x3921('0x15')][_0x3921('0x16')]===undefined?!![]:![]:!![],'where':_0x3b8b37[_0x3921('0x15')]?_0x3b8b37[_0x3921('0x15')][_0x3921('0x17')]||null:null,'attributes':_0x3b8b37[_0x3921('0x15')]?_0x3b8b37[_0x3921('0x15')]['attributes']||null:null,'limit':_0x3b8b37[_0x3921('0x15')]?_0x3b8b37['options'][_0x3921('0x18')]||null:null,'include':_0x3b8b37[_0x3921('0x15')]?_0x3b8b37[_0x3921('0x15')]['include']?_[_0x3921('0x19')](_0x3b8b37['options'][_0x3921('0x1a')],function(_0x5d40d4){return{'model':db[_0x5d40d4['model']],'as':_0x5d40d4['as'],'attributes':_0x5d40d4[_0x3921('0x1b')],'include':_0x5d40d4[_0x3921('0x1a')]?_[_0x3921('0x19')](_0x5d40d4[_0x3921('0x1a')],function(_0xd08f75){return{'model':db[_0xd08f75[_0x3921('0x1c')]],'as':_0xd08f75['as'],'attributes':_0xd08f75['attributes'],'include':_0xd08f75[_0x3921('0x1a')]?_[_0x3921('0x19')](_0xd08f75['include'],function(_0x14f997){return{'model':db[_0x14f997[_0x3921('0x1c')]],'as':_0x14f997['as'],'attributes':_0x14f997[_0x3921('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3921('0xb')](function(_0x25b139){logger[_0x3921('0xc')](_0x3921('0x1d'),_0x3b8b37);logger['debug'](_0x3921('0x1d'),_0x3b8b37,JSON[_0x3921('0xf')](_0x25b139));_0x17bb88(_0x25b139);})[_0x3921('0x1e')](function(_0x3e076a){logger[_0x3921('0x10')](_0x3921('0x1d'),_0x3e076a[_0x3921('0x13')],_0x3b8b37);_0x41b27c(_0x1082a8[_0x3921('0x10')](0x1f4,_0x3e076a[_0x3921('0x13')]));});});};exports[_0x3921('0x1f')]=function(_0x5570fc){var _0x382d2a=this;return new Promise(function(_0x5314c7,_0x1e4bb4){return db[_0x3921('0x20')][_0x3921('0x21')]({'raw':_0x5570fc[_0x3921('0x15')]?_0x5570fc[_0x3921('0x15')][_0x3921('0x16')]===undefined?!![]:![]:!![],'where':_0x5570fc[_0x3921('0x15')]?_0x5570fc[_0x3921('0x15')][_0x3921('0x17')]||null:null,'attributes':_0x5570fc['options']?_0x5570fc[_0x3921('0x15')][_0x3921('0x1b')]||null:null,'include':_0x5570fc[_0x3921('0x15')]?_0x5570fc[_0x3921('0x15')][_0x3921('0x1a')]?_[_0x3921('0x19')](_0x5570fc[_0x3921('0x15')][_0x3921('0x1a')],function(_0x173d32){return{'model':db[_0x173d32[_0x3921('0x1c')]],'as':_0x173d32['as'],'attributes':_0x173d32[_0x3921('0x1b')],'include':_0x173d32[_0x3921('0x1a')]?_[_0x3921('0x19')](_0x173d32[_0x3921('0x1a')],function(_0x32cd94){return{'model':db[_0x32cd94['model']],'as':_0x32cd94['as'],'attributes':_0x32cd94[_0x3921('0x1b')],'include':_0x32cd94[_0x3921('0x1a')]?_[_0x3921('0x19')](_0x32cd94[_0x3921('0x1a')],function(_0x4319fb){return{'model':db[_0x4319fb[_0x3921('0x1c')]],'as':_0x4319fb['as'],'attributes':_0x4319fb[_0x3921('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3921('0xb')](function(_0x57af46){logger[_0x3921('0xc')](_0x3921('0x1f'),_0x5570fc);logger[_0x3921('0x22')](_0x3921('0x1f'),_0x5570fc,JSON['stringify'](_0x57af46));_0x5314c7(_0x57af46);})[_0x3921('0x1e')](function(_0x2efe48){logger[_0x3921('0x10')](_0x3921('0x1f'),_0x2efe48[_0x3921('0x13')],_0x5570fc);_0x1e4bb4(_0x382d2a[_0x3921('0x10')](0x1f4,_0x2efe48[_0x3921('0x13')]));});});};
\ No newline at end of file
+var _0xe574=['options','raw','where','attributes','limit','include','model','map','stringify','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll'];(function(_0x131f0c,_0x3d8e5b){var _0x37af49=function(_0xfbcab0){while(--_0xfbcab0){_0x131f0c['push'](_0x131f0c['shift']());}};_0x37af49(++_0x3d8e5b);}(_0xe574,0x13b));var _0x4e57=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe574[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x4e57('0x0'));var util=require(_0x4e57('0x1'));var moment=require(_0x4e57('0x2'));var BPromise=require(_0x4e57('0x3'));var rs=require(_0x4e57('0x4'));var fs=require('fs');var Redis=require(_0x4e57('0x5'));var db=require(_0x4e57('0x6'))['db'];var utils=require(_0x4e57('0x7'));var logger=require(_0x4e57('0x8'))('rpc');var config=require(_0x4e57('0x9'));var jayson=require(_0x4e57('0xa'));var client=jayson[_0x4e57('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50a1d6,_0x17dd3e,_0x36153f){return new BPromise(function(_0x5d6260,_0xfc94d){return client[_0x4e57('0xc')](_0x50a1d6,_0x36153f)[_0x4e57('0xd')](function(_0xae75d5){logger[_0x4e57('0xe')](_0x4e57('0xf'),_0x17dd3e,_0x4e57('0x10'));logger[_0x4e57('0x11')](_0x4e57('0x12'),_0x17dd3e,'request\x20sent',JSON['stringify'](_0xae75d5));if(_0xae75d5[_0x4e57('0x13')]){if(_0xae75d5[_0x4e57('0x13')][_0x4e57('0x14')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x17dd3e,_0xae75d5[_0x4e57('0x13')][_0x4e57('0x15')]);return _0xfc94d(_0xae75d5[_0x4e57('0x13')][_0x4e57('0x15')]);}logger['error'](_0x4e57('0xf'),_0x17dd3e,_0xae75d5[_0x4e57('0x13')][_0x4e57('0x15')]);return _0x5d6260(_0xae75d5['error'][_0x4e57('0x15')]);}else{logger[_0x4e57('0xe')](_0x4e57('0xf'),_0x17dd3e,_0x4e57('0x10'));_0x5d6260(_0xae75d5[_0x4e57('0x16')][_0x4e57('0x15')]);}})[_0x4e57('0x17')](function(_0x3e3cf6){logger[_0x4e57('0x13')](_0x4e57('0xf'),_0x17dd3e,_0x3e3cf6);_0xfc94d(_0x3e3cf6);});});}exports[_0x4e57('0x18')]=function(_0x83d100){var _0x2f05d7=this;return new Promise(function(_0x498338,_0x21822f){return db[_0x4e57('0x19')][_0x4e57('0x1a')]({'raw':_0x83d100['options']?_0x83d100[_0x4e57('0x1b')][_0x4e57('0x1c')]===undefined?!![]:![]:!![],'where':_0x83d100[_0x4e57('0x1b')]?_0x83d100[_0x4e57('0x1b')][_0x4e57('0x1d')]||null:null,'attributes':_0x83d100[_0x4e57('0x1b')]?_0x83d100[_0x4e57('0x1b')][_0x4e57('0x1e')]||null:null,'limit':_0x83d100[_0x4e57('0x1b')]?_0x83d100[_0x4e57('0x1b')][_0x4e57('0x1f')]||null:null,'include':_0x83d100[_0x4e57('0x1b')]?_0x83d100[_0x4e57('0x1b')][_0x4e57('0x20')]?_['map'](_0x83d100[_0x4e57('0x1b')]['include'],function(_0x5320a2){return{'model':db[_0x5320a2[_0x4e57('0x21')]],'as':_0x5320a2['as'],'attributes':_0x5320a2[_0x4e57('0x1e')],'include':_0x5320a2['include']?_[_0x4e57('0x22')](_0x5320a2['include'],function(_0xe0da52){return{'model':db[_0xe0da52[_0x4e57('0x21')]],'as':_0xe0da52['as'],'attributes':_0xe0da52[_0x4e57('0x1e')],'include':_0xe0da52['include']?_[_0x4e57('0x22')](_0xe0da52[_0x4e57('0x20')],function(_0x3009bf){return{'model':db[_0x3009bf[_0x4e57('0x21')]],'as':_0x3009bf['as'],'attributes':_0x3009bf[_0x4e57('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4e57('0xd')](function(_0x299c99){logger['info'](_0x4e57('0x18'),_0x83d100);logger[_0x4e57('0x11')](_0x4e57('0x18'),_0x83d100,JSON[_0x4e57('0x23')](_0x299c99));_0x498338(_0x299c99);})[_0x4e57('0x17')](function(_0x1b0023){logger[_0x4e57('0x13')](_0x4e57('0x18'),_0x1b0023[_0x4e57('0x15')],_0x83d100);_0x21822f(_0x2f05d7[_0x4e57('0x13')](0x1f4,_0x1b0023[_0x4e57('0x15')]));});});};exports[_0x4e57('0x24')]=function(_0x2b9df7){var _0x123377=this;return new Promise(function(_0x4dce87,_0x3897ad){return db[_0x4e57('0x19')][_0x4e57('0x25')]({'raw':_0x2b9df7[_0x4e57('0x1b')]?_0x2b9df7[_0x4e57('0x1b')][_0x4e57('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b9df7[_0x4e57('0x1b')]?_0x2b9df7[_0x4e57('0x1b')][_0x4e57('0x1d')]||null:null,'attributes':_0x2b9df7[_0x4e57('0x1b')]?_0x2b9df7[_0x4e57('0x1b')]['attributes']||null:null,'include':_0x2b9df7[_0x4e57('0x1b')]?_0x2b9df7['options'][_0x4e57('0x20')]?_[_0x4e57('0x22')](_0x2b9df7[_0x4e57('0x1b')][_0x4e57('0x20')],function(_0x3419d4){return{'model':db[_0x3419d4[_0x4e57('0x21')]],'as':_0x3419d4['as'],'attributes':_0x3419d4[_0x4e57('0x1e')],'include':_0x3419d4['include']?_[_0x4e57('0x22')](_0x3419d4[_0x4e57('0x20')],function(_0x54ba30){return{'model':db[_0x54ba30[_0x4e57('0x21')]],'as':_0x54ba30['as'],'attributes':_0x54ba30[_0x4e57('0x1e')],'include':_0x54ba30[_0x4e57('0x20')]?_[_0x4e57('0x22')](_0x54ba30[_0x4e57('0x20')],function(_0x5ac6c1){return{'model':db[_0x5ac6c1[_0x4e57('0x21')]],'as':_0x5ac6c1['as'],'attributes':_0x5ac6c1[_0x4e57('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4e57('0xd')](function(_0x2749fd){logger[_0x4e57('0xe')](_0x4e57('0x24'),_0x2b9df7);logger['debug'](_0x4e57('0x24'),_0x2b9df7,JSON['stringify'](_0x2749fd));_0x4dce87(_0x2749fd);})[_0x4e57('0x17')](function(_0x27273b){logger[_0x4e57('0x13')](_0x4e57('0x24'),_0x27273b[_0x4e57('0x15')],_0x2b9df7);_0x3897ad(_0x123377[_0x4e57('0x13')](0x1f4,_0x27273b[_0x4e57('0x15')]));});});};
\ No newline at end of file
index f983d47..26f5f06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x264e=['getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0x264e,0xaa));var _0xe264=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x264e[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xe264('0x0'));var util=require(_0xe264('0x1'));var path=require(_0xe264('0x2'));var timeout=require('connect-timeout');var express=require(_0xe264('0x3'));var router=express[_0xe264('0x4')]();var auth=require(_0xe264('0x5'));var interaction=require(_0xe264('0x6'));var config=require('../../config/environment');var controller=require(_0xe264('0x7'));router[_0xe264('0x8')]('/',auth[_0xe264('0x9')](),controller['index']);router[_0xe264('0x8')](_0xe264('0xa'),auth[_0xe264('0x9')](),controller[_0xe264('0xb')]);router[_0xe264('0x8')](_0xe264('0xc'),auth[_0xe264('0x9')](),controller['getFields']);router[_0xe264('0x8')](_0xe264('0xd'),auth['isAuthenticated'](),controller[_0xe264('0xe')]);router[_0xe264('0x8')](_0xe264('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xe264('0x10')]('/',auth[_0xe264('0x9')](),controller[_0xe264('0x11')]);router[_0xe264('0x12')](_0xe264('0xa'),auth[_0xe264('0x9')](),controller[_0xe264('0x13')]);router[_0xe264('0x14')]('/:id',auth[_0xe264('0x9')](),controller[_0xe264('0x15')]);module[_0xe264('0x16')]=router;
\ No newline at end of file
+var _0x0f85=['/:id/descriptions','getDescriptions','post','create','put','update','destroy','multer','util','path','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','getSubjects'];(function(_0x4abd5a,_0x2909ae){var _0x2dedda=function(_0x1733c9){while(--_0x1733c9){_0x4abd5a['push'](_0x4abd5a['shift']());}};_0x2dedda(++_0x2909ae);}(_0x0f85,0x1e7));var _0x50f8=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x0f85[_0x5d6456];return _0x4d66c1;};'use strict';var multer=require(_0x50f8('0x0'));var util=require(_0x50f8('0x1'));var path=require(_0x50f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x50f8('0x3'));var router=express['Router']();var auth=require(_0x50f8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x50f8('0x5'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x50f8('0x6')]('/',auth[_0x50f8('0x7')](),controller[_0x50f8('0x8')]);router[_0x50f8('0x6')](_0x50f8('0x9'),auth[_0x50f8('0x7')](),controller[_0x50f8('0xa')]);router[_0x50f8('0x6')]('/:id/fields',auth[_0x50f8('0x7')](),controller[_0x50f8('0xb')]);router['get']('/:id/subjects',auth[_0x50f8('0x7')](),controller[_0x50f8('0xc')]);router[_0x50f8('0x6')](_0x50f8('0xd'),auth[_0x50f8('0x7')](),controller[_0x50f8('0xe')]);router[_0x50f8('0xf')]('/',auth[_0x50f8('0x7')](),controller[_0x50f8('0x10')]);router[_0x50f8('0x11')](_0x50f8('0x9'),auth[_0x50f8('0x7')](),controller[_0x50f8('0x12')]);router['delete'](_0x50f8('0x9'),auth[_0x50f8('0x7')](),controller[_0x50f8('0x13')]);module['exports']=router;
\ No newline at end of file
index fb1449c..8109a79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd856=['sequelize','STRING'];(function(_0x59449b,_0x4d31ad){var _0x3eda98=function(_0x30a999){while(--_0x30a999){_0x59449b['push'](_0x59449b['shift']());}};_0x3eda98(++_0x4d31ad);}(_0xd856,0x92));var _0x6d85=function(_0x55326b,_0x2a567c){_0x55326b=_0x55326b-0x0;var _0x2b6de6=_0xd856[_0x55326b];return _0x2b6de6;};'use strict';var Sequelize=require(_0x6d85('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d85('0x1')]},'description':{'type':Sequelize[_0x6d85('0x1')]}};
\ No newline at end of file
+var _0x249e=['STRING','exports'];(function(_0x30d6fe,_0x4001c7){var _0x55229e=function(_0x3bfec4){while(--_0x3bfec4){_0x30d6fe['push'](_0x30d6fe['shift']());}};_0x55229e(++_0x4001c7);}(_0x249e,0x1cf));var _0xe249=function(_0x1e5a25,_0x3b5a85){_0x1e5a25=_0x1e5a25-0x0;var _0x176d9c=_0x249e[_0x1e5a25];return _0x176d9c;};'use strict';var Sequelize=require('sequelize');module[_0xe249('0x0')]={'name':{'type':Sequelize[_0xe249('0x1')]},'description':{'type':Sequelize[_0xe249('0x1')]}};
\ No newline at end of file
index a822f2d..b6eea8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc54d=['fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','update','destroy','name','send','map','SugarcrmConfiguration','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','create','body','params','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x204e2f,_0x3c9d47){var _0x51233c=function(_0x2876bf){while(--_0x2876bf){_0x204e2f['push'](_0x204e2f['shift']());}};_0x51233c(++_0x3c9d47);}(_0xc54d,0x196));var _0xdc54=function(_0x2b59db,_0x2fd753){_0x2b59db=_0x2b59db-0x0;var _0x1b8a3b=_0xc54d[_0x2b59db];return _0x1b8a3b;};'use strict';var pdf=require(_0xdc54('0x0'));var emlformat=require(_0xdc54('0x1'));var rimraf=require(_0xdc54('0x2'));var zipdir=require(_0xdc54('0x3'));var jsonpatch=require(_0xdc54('0x4'));var rp=require(_0xdc54('0x5'));var moment=require(_0xdc54('0x6'));var BPromise=require(_0xdc54('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdc54('0x8'));var sox=require(_0xdc54('0x9'));var csv=require(_0xdc54('0xa'));var ejs=require(_0xdc54('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdc54('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdc54('0xd'));var toCsv=require(_0xdc54('0xa'));var querystring=require('querystring');var Papa=require(_0xdc54('0xe'));var Redis=require(_0xdc54('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdc54('0x10'));var hardwareService=require(_0xdc54('0x11'));var logger=require(_0xdc54('0x12'))(_0xdc54('0x13'));var utils=require(_0xdc54('0x14'));var config=require(_0xdc54('0x15'));var db=require(_0xdc54('0x16'))['db'];var jayson=require(_0xdc54('0x17'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x47abc6,_0x22f2ad,_0x33943c){if(_0x33943c){var _0x420ec3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x420ec3['test'](_0x22f2ad)){return _0x47abc6;}else{throw new db['Sequelize']['ValidationError'](_0xdc54('0x18'));}}else{return _0x47abc6;}}function respondWithRpcPromise(_0xbd5d17,_0x1e9165,_0x2d0a21,_0x2d297c){return new BPromise(function(_0x881580,_0x38865b){var _0x3bf29b=_0x2d297c||client;return _0x3bf29b[_0xdc54('0x19')](_0xbd5d17,_0x2d0a21)[_0xdc54('0x1a')](function(_0x4e7a15){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x1e9165,_0xdc54('0x1b'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x1e9165,'request\x20sent',JSON['stringify'](_0x4e7a15));if(_0x4e7a15[_0xdc54('0x1c')]){if(_0x4e7a15[_0xdc54('0x1c')][_0xdc54('0x1d')]===0x1f4){logger[_0xdc54('0x1c')](_0xdc54('0x1e'),_0x1e9165,_0x4e7a15[_0xdc54('0x1c')]['message']);return _0x38865b(_0x4e7a15[_0xdc54('0x1c')]['message']);}logger[_0xdc54('0x1c')](_0xdc54('0x1e'),_0x1e9165,_0x4e7a15['error'][_0xdc54('0x1f')]);return _0x881580(_0x4e7a15[_0xdc54('0x1c')]['message']);}else{logger[_0xdc54('0x20')](_0xdc54('0x1e'),_0x1e9165,_0xdc54('0x1b'));_0x881580(_0x4e7a15['result'][_0xdc54('0x1f')]);}})[_0xdc54('0x21')](function(_0x212686){logger[_0xdc54('0x1c')](_0xdc54('0x1e'),_0x1e9165,_0x212686);_0x38865b(_0x212686);});});}function respondWithStatusCode(_0x3450ad,_0x26038c){_0x26038c=_0x26038c||0xcc;return function(_0x1a0b01){if(_0x1a0b01){return _0x3450ad[_0xdc54('0x22')](_0x26038c);}return _0x3450ad[_0xdc54('0x23')](_0x26038c)[_0xdc54('0x24')]();};}function respondWithResult(_0x5a14d7,_0x43f85c){_0x43f85c=_0x43f85c||0xc8;return function(_0x5b5bac){if(_0x5b5bac){return _0x5a14d7[_0xdc54('0x23')](_0x43f85c)['json'](_0x5b5bac);}};}function respondWithFilteredResult(_0x540d1a,_0x19ff4f){return function(_0xab7ba1){if(_0xab7ba1){var _0x331ee2=_0xab7ba1[_0xdc54('0x25')],_0x24c72e=_0x19ff4f[_0xdc54('0x26')],_0x15917e=_0x19ff4f['offset']+_0x19ff4f[_0xdc54('0x27')],_0x5ea366;if(_0x15917e>=_0x331ee2){_0x15917e=_0x331ee2;_0x5ea366=0xc8;}else{_0x5ea366=0xce;}_0x540d1a[_0xdc54('0x23')](_0x5ea366);return _0x540d1a[_0xdc54('0x28')](_0xdc54('0x29'),_0x24c72e+'-'+_0x15917e+'/'+_0x331ee2)[_0xdc54('0x2a')](_0xab7ba1);}return null;};}function patchUpdates(_0x1f1aa1){return function(_0x4d1210){try{jsonpatch['apply'](_0x4d1210,_0x1f1aa1,!![]);}catch(_0x1cc381){return BPromise['reject'](_0x1cc381);}return _0x4d1210['save']();};}function saveUpdates(_0x26ea11,_0x4152c8){return function(_0x18dde2){if(_0x18dde2){return _0x18dde2[_0xdc54('0x2b')](_0x26ea11)[_0xdc54('0x1a')](function(_0x12bc2d){return _0x12bc2d;});}return null;};}function removeEntity(_0x520f29,_0x1b50fc){return function(_0x18623d){if(_0x18623d){return _0x18623d[_0xdc54('0x2c')]()[_0xdc54('0x1a')](function(){_0x520f29['status'](0xcc)[_0xdc54('0x24')]();});}};}function handleEntityNotFound(_0x39b6df,_0x122e8a){return function(_0x205ca0){if(!_0x205ca0){_0x39b6df[_0xdc54('0x22')](0x194);}return _0x205ca0;};}function handleError(_0x2c15f0,_0x1e0b56){_0x1e0b56=_0x1e0b56||0x1f4;return function(_0x185045){logger['error'](_0x185045['stack']);if(_0x185045[_0xdc54('0x2d')]){delete _0x185045['name'];}_0x2c15f0[_0xdc54('0x23')](_0x1e0b56)[_0xdc54('0x2e')](_0x185045);};}exports['index']=function(_0x2b259d,_0x31bd22){var _0x2d0b44={},_0x5e6d9e={},_0xbb447e={'count':0x0,'rows':[]};var _0x38853b=_[_0xdc54('0x2f')](db[_0xdc54('0x30')]['rawAttributes'],function(_0x29bce3){return{'name':_0x29bce3['fieldName'],'type':_0x29bce3[_0xdc54('0x31')]['key']};});_0x5e6d9e[_0xdc54('0x32')]=_[_0xdc54('0x2f')](_0x38853b,_0xdc54('0x2d'));_0x5e6d9e[_0xdc54('0x33')]=_['keys'](_0x2b259d[_0xdc54('0x33')]);_0x5e6d9e['filters']=_[_0xdc54('0x34')](_0x5e6d9e[_0xdc54('0x32')],_0x5e6d9e[_0xdc54('0x33')]);_0x2d0b44[_0xdc54('0x35')]=_[_0xdc54('0x34')](_0x5e6d9e['model'],qs[_0xdc54('0x36')](_0x2b259d[_0xdc54('0x33')][_0xdc54('0x36')]));_0x2d0b44[_0xdc54('0x35')]=_0x2d0b44[_0xdc54('0x35')][_0xdc54('0x37')]?_0x2d0b44[_0xdc54('0x35')]:_0x5e6d9e[_0xdc54('0x32')];if(!_0x2b259d[_0xdc54('0x33')][_0xdc54('0x38')](_0xdc54('0x39'))){_0x2d0b44['limit']=qs[_0xdc54('0x27')](_0x2b259d['query'][_0xdc54('0x27')]);_0x2d0b44[_0xdc54('0x26')]=qs['offset'](_0x2b259d[_0xdc54('0x33')][_0xdc54('0x26')]);}_0x2d0b44[_0xdc54('0x3a')]=qs[_0xdc54('0x3b')](_0x2b259d['query'][_0xdc54('0x3b')]);_0x2d0b44['where']=qs[_0xdc54('0x3c')](_[_0xdc54('0x3d')](_0x2b259d[_0xdc54('0x33')],_0x5e6d9e['filters']),_0x38853b);if(_0x2b259d['query'][_0xdc54('0x3e')]){_0x2d0b44[_0xdc54('0x3f')]=_['merge'](_0x2d0b44[_0xdc54('0x3f')],{'$or':_[_0xdc54('0x2f')](_0x38853b,function(_0x43bdff){if(_0x43bdff['type']!=='VIRTUAL'){var _0x5c015d={};_0x5c015d[_0x43bdff[_0xdc54('0x2d')]]={'$like':'%'+_0x2b259d[_0xdc54('0x33')][_0xdc54('0x3e')]+'%'};return _0x5c015d;}})});}_0x2d0b44=_[_0xdc54('0x40')]({},_0x2d0b44,_0x2b259d[_0xdc54('0x41')]);var _0x26d503={'where':_0x2d0b44[_0xdc54('0x3f')]};return db['SugarcrmConfiguration'][_0xdc54('0x25')](_0x26d503)[_0xdc54('0x1a')](function(_0x55ff26){_0xbb447e[_0xdc54('0x25')]=_0x55ff26;if(_0x2b259d[_0xdc54('0x33')][_0xdc54('0x42')]){_0x2d0b44[_0xdc54('0x43')]=[{'all':!![]}];}return db[_0xdc54('0x30')][_0xdc54('0x44')](_0x2d0b44);})[_0xdc54('0x1a')](function(_0x1ffc63){_0xbb447e[_0xdc54('0x45')]=_0x1ffc63;return _0xbb447e;})[_0xdc54('0x1a')](respondWithFilteredResult(_0x31bd22,_0x2d0b44))[_0xdc54('0x21')](handleError(_0x31bd22,null));};exports[_0xdc54('0x46')]=function(_0x2e45d7,_0x300a0e){var _0x953106={'raw':![],'where':{'id':_0x2e45d7['params']['id']}},_0x2fca04={};_0x2fca04[_0xdc54('0x32')]=_[_0xdc54('0x47')](db['SugarcrmConfiguration'][_0xdc54('0x48')]);_0x2fca04['query']=_[_0xdc54('0x47')](_0x2e45d7[_0xdc54('0x33')]);_0x2fca04[_0xdc54('0x3c')]=_[_0xdc54('0x34')](_0x2fca04[_0xdc54('0x32')],_0x2fca04[_0xdc54('0x33')]);_0x953106[_0xdc54('0x35')]=_[_0xdc54('0x34')](_0x2fca04[_0xdc54('0x32')],qs[_0xdc54('0x36')](_0x2e45d7[_0xdc54('0x33')][_0xdc54('0x36')]));_0x953106[_0xdc54('0x35')]=_0x953106[_0xdc54('0x35')]['length']?_0x953106[_0xdc54('0x35')]:_0x2fca04[_0xdc54('0x32')];if(_0x2e45d7[_0xdc54('0x33')][_0xdc54('0x42')]){_0x953106[_0xdc54('0x43')]=[{'all':!![]}];}_0x953106=_[_0xdc54('0x40')]({},_0x953106,_0x2e45d7[_0xdc54('0x41')]);return db[_0xdc54('0x30')][_0xdc54('0x49')](_0x953106)[_0xdc54('0x1a')](handleEntityNotFound(_0x300a0e,null))[_0xdc54('0x1a')](respondWithResult(_0x300a0e,null))[_0xdc54('0x21')](handleError(_0x300a0e,null));};exports[_0xdc54('0x4a')]=function(_0xe18282,_0xb01277){return db[_0xdc54('0x30')]['create'](_0xe18282['body'],{})[_0xdc54('0x1a')](respondWithResult(_0xb01277,0xc9))[_0xdc54('0x21')](handleError(_0xb01277,null));};exports[_0xdc54('0x2b')]=function(_0x442128,_0x25eb66){if(_0x442128[_0xdc54('0x4b')]['id']){delete _0x442128[_0xdc54('0x4b')]['id'];}return db['SugarcrmConfiguration'][_0xdc54('0x49')]({'where':{'id':_0x442128[_0xdc54('0x4c')]['id']}})[_0xdc54('0x1a')](handleEntityNotFound(_0x25eb66,null))[_0xdc54('0x1a')](saveUpdates(_0x442128['body'],null))[_0xdc54('0x1a')](respondWithResult(_0x25eb66,null))[_0xdc54('0x21')](handleError(_0x25eb66,null));};exports[_0xdc54('0x2c')]=function(_0x33444e,_0x2ea55d){return db[_0xdc54('0x30')][_0xdc54('0x49')]({'where':{'id':_0x33444e['params']['id']}})[_0xdc54('0x1a')](handleEntityNotFound(_0x2ea55d,null))['then'](removeEntity(_0x2ea55d,null))[_0xdc54('0x21')](handleError(_0x2ea55d,null));};exports[_0xdc54('0x4d')]=function(_0x47ab39,_0x31c270,_0x314b0e){var _0x5c8f07={};var _0x283ada={};var _0x38bf2f;var _0x39c833;return db[_0xdc54('0x30')][_0xdc54('0x4e')]({'where':{'id':_0x47ab39['params']['id']}})[_0xdc54('0x1a')](handleEntityNotFound(_0x31c270,null))[_0xdc54('0x1a')](function(_0x2efdf8){if(_0x2efdf8){_0x38bf2f=_0x2efdf8;_0x283ada['model']=_[_0xdc54('0x47')](db[_0xdc54('0x4f')]['rawAttributes']);_0x283ada['query']=_[_0xdc54('0x47')](_0x47ab39[_0xdc54('0x33')]);_0x283ada[_0xdc54('0x3c')]=_[_0xdc54('0x34')](_0x283ada[_0xdc54('0x32')],_0x283ada[_0xdc54('0x33')]);_0x5c8f07[_0xdc54('0x35')]=_[_0xdc54('0x34')](_0x283ada[_0xdc54('0x32')],qs[_0xdc54('0x36')](_0x47ab39[_0xdc54('0x33')][_0xdc54('0x36')]));_0x5c8f07[_0xdc54('0x35')]=_0x5c8f07[_0xdc54('0x35')][_0xdc54('0x37')]?_0x5c8f07[_0xdc54('0x35')]:_0x283ada[_0xdc54('0x32')];_0x5c8f07[_0xdc54('0x3a')]=qs['sort'](_0x47ab39[_0xdc54('0x33')][_0xdc54('0x3b')]);_0x5c8f07[_0xdc54('0x3f')]=qs['filters'](_[_0xdc54('0x3d')](_0x47ab39[_0xdc54('0x33')],_0x283ada[_0xdc54('0x3c')]));if(_0x47ab39['query']['filter']){_0x5c8f07[_0xdc54('0x3f')]=_['merge'](_0x5c8f07[_0xdc54('0x3f')],{'$or':_['map'](_0x5c8f07[_0xdc54('0x35')],function(_0x1a019f){var _0x32f27c={};_0x32f27c[_0x1a019f]={'$like':'%'+_0x47ab39[_0xdc54('0x33')][_0xdc54('0x3e')]+'%'};return _0x32f27c;})});}_0x5c8f07=_[_0xdc54('0x40')]({},_0x5c8f07,_0x47ab39[_0xdc54('0x41')]);return _0x38bf2f[_0xdc54('0x4d')](_0x5c8f07);}})['then'](function(_0x25edff){if(_0x25edff){_0x39c833=_0x25edff['length'];if(!_0x47ab39[_0xdc54('0x33')]['hasOwnProperty'](_0xdc54('0x39'))){_0x5c8f07[_0xdc54('0x27')]=qs[_0xdc54('0x27')](_0x47ab39[_0xdc54('0x33')][_0xdc54('0x27')]);_0x5c8f07['offset']=qs[_0xdc54('0x26')](_0x47ab39[_0xdc54('0x33')][_0xdc54('0x26')]);}return _0x38bf2f[_0xdc54('0x4d')](_0x5c8f07);}})[_0xdc54('0x1a')](function(_0x566114){if(_0x566114){return _0x566114?{'count':_0x39c833,'rows':_0x566114}:null;}})['then'](respondWithResult(_0x31c270,null))['catch'](handleError(_0x31c270,null));};exports[_0xdc54('0x50')]=function(_0x17e93f,_0xf2c131,_0x421cdd){var _0x333f1f={};var _0x3a5491={};var _0x4139e3;var _0x44a33e;return db[_0xdc54('0x30')][_0xdc54('0x4e')]({'where':{'id':_0x17e93f[_0xdc54('0x4c')]['id']}})[_0xdc54('0x1a')](handleEntityNotFound(_0xf2c131,null))[_0xdc54('0x1a')](function(_0x102fe6){if(_0x102fe6){_0x4139e3=_0x102fe6;_0x3a5491[_0xdc54('0x32')]=_[_0xdc54('0x47')](db[_0xdc54('0x4f')]['rawAttributes']);_0x3a5491[_0xdc54('0x33')]=_[_0xdc54('0x47')](_0x17e93f[_0xdc54('0x33')]);_0x3a5491[_0xdc54('0x3c')]=_[_0xdc54('0x34')](_0x3a5491[_0xdc54('0x32')],_0x3a5491[_0xdc54('0x33')]);_0x333f1f['attributes']=_['intersection'](_0x3a5491[_0xdc54('0x32')],qs[_0xdc54('0x36')](_0x17e93f[_0xdc54('0x33')][_0xdc54('0x36')]));_0x333f1f[_0xdc54('0x35')]=_0x333f1f[_0xdc54('0x35')][_0xdc54('0x37')]?_0x333f1f[_0xdc54('0x35')]:_0x3a5491['model'];_0x333f1f[_0xdc54('0x3a')]=qs['sort'](_0x17e93f[_0xdc54('0x33')][_0xdc54('0x3b')]);_0x333f1f['where']=qs[_0xdc54('0x3c')](_['pick'](_0x17e93f[_0xdc54('0x33')],_0x3a5491[_0xdc54('0x3c')]));if(_0x17e93f[_0xdc54('0x33')][_0xdc54('0x3e')]){_0x333f1f[_0xdc54('0x3f')]=_['merge'](_0x333f1f['where'],{'$or':_[_0xdc54('0x2f')](_0x333f1f[_0xdc54('0x35')],function(_0x2451b7){var _0x5333d8={};_0x5333d8[_0x2451b7]={'$like':'%'+_0x17e93f[_0xdc54('0x33')][_0xdc54('0x3e')]+'%'};return _0x5333d8;})});}_0x333f1f=_[_0xdc54('0x40')]({},_0x333f1f,_0x17e93f[_0xdc54('0x41')]);return _0x4139e3[_0xdc54('0x50')](_0x333f1f);}})[_0xdc54('0x1a')](function(_0x120307){if(_0x120307){_0x44a33e=_0x120307[_0xdc54('0x37')];if(!_0x17e93f[_0xdc54('0x33')][_0xdc54('0x38')]('nolimit')){_0x333f1f['limit']=qs[_0xdc54('0x27')](_0x17e93f['query']['limit']);_0x333f1f[_0xdc54('0x26')]=qs[_0xdc54('0x26')](_0x17e93f[_0xdc54('0x33')]['offset']);}return _0x4139e3[_0xdc54('0x50')](_0x333f1f);}})['then'](function(_0x514c66){if(_0x514c66){return _0x514c66?{'count':_0x44a33e,'rows':_0x514c66}:null;}})[_0xdc54('0x1a')](respondWithResult(_0xf2c131,null))[_0xdc54('0x21')](handleError(_0xf2c131,null));};exports['getDescriptions']=function(_0x46171f,_0xec0541,_0x41959d){var _0x542cfc={};var _0x30899d={};var _0x201712;var _0xa3cadd;return db[_0xdc54('0x30')][_0xdc54('0x4e')]({'where':{'id':_0x46171f[_0xdc54('0x4c')]['id']}})[_0xdc54('0x1a')](handleEntityNotFound(_0xec0541,null))[_0xdc54('0x1a')](function(_0x29d602){if(_0x29d602){_0x201712=_0x29d602;_0x30899d[_0xdc54('0x32')]=_['keys'](db['SugarcrmField'][_0xdc54('0x48')]);_0x30899d[_0xdc54('0x33')]=_[_0xdc54('0x47')](_0x46171f['query']);_0x30899d[_0xdc54('0x3c')]=_[_0xdc54('0x34')](_0x30899d['model'],_0x30899d[_0xdc54('0x33')]);_0x542cfc[_0xdc54('0x35')]=_[_0xdc54('0x34')](_0x30899d['model'],qs[_0xdc54('0x36')](_0x46171f['query'][_0xdc54('0x36')]));_0x542cfc[_0xdc54('0x35')]=_0x542cfc['attributes']['length']?_0x542cfc[_0xdc54('0x35')]:_0x30899d[_0xdc54('0x32')];_0x542cfc[_0xdc54('0x3a')]=qs[_0xdc54('0x3b')](_0x46171f[_0xdc54('0x33')][_0xdc54('0x3b')]);_0x542cfc[_0xdc54('0x3f')]=qs[_0xdc54('0x3c')](_[_0xdc54('0x3d')](_0x46171f['query'],_0x30899d[_0xdc54('0x3c')]));if(_0x46171f[_0xdc54('0x33')][_0xdc54('0x3e')]){_0x542cfc['where']=_[_0xdc54('0x40')](_0x542cfc[_0xdc54('0x3f')],{'$or':_['map'](_0x542cfc['attributes'],function(_0x63ca90){var _0x4562f6={};_0x4562f6[_0x63ca90]={'$like':'%'+_0x46171f['query'][_0xdc54('0x3e')]+'%'};return _0x4562f6;})});}_0x542cfc=_[_0xdc54('0x40')]({},_0x542cfc,_0x46171f[_0xdc54('0x41')]);return _0x201712[_0xdc54('0x51')](_0x542cfc);}})[_0xdc54('0x1a')](function(_0x2a2586){if(_0x2a2586){_0xa3cadd=_0x2a2586[_0xdc54('0x37')];if(!_0x46171f[_0xdc54('0x33')][_0xdc54('0x38')](_0xdc54('0x39'))){_0x542cfc[_0xdc54('0x27')]=qs[_0xdc54('0x27')](_0x46171f[_0xdc54('0x33')][_0xdc54('0x27')]);_0x542cfc[_0xdc54('0x26')]=qs[_0xdc54('0x26')](_0x46171f['query'][_0xdc54('0x26')]);}return _0x201712[_0xdc54('0x51')](_0x542cfc);}})[_0xdc54('0x1a')](function(_0x1d8a0d){if(_0x1d8a0d){return _0x1d8a0d?{'count':_0xa3cadd,'rows':_0x1d8a0d}:null;}})[_0xdc54('0x1a')](respondWithResult(_0xec0541,null))[_0xdc54('0x21')](handleError(_0xec0541,null));};
\ No newline at end of file
+var _0x61b6=['includeAll','include','findAll','rows','show','params','length','find','create','body','getFields','findOne','SugarcrmField','filter','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','mustache','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/environment','../../mysqldb','jayson/promise','http','test','ValidationError','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','map','SugarcrmConfiguration','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','options','count'];(function(_0x57419b,_0x403310){var _0x1ddb2d=function(_0x3df9ba){while(--_0x3df9ba){_0x57419b['push'](_0x57419b['shift']());}};_0x1ddb2d(++_0x403310);}(_0x61b6,0x180));var _0x661b=function(_0x38ead8,_0xc39408){_0x38ead8=_0x38ead8-0x0;var _0x210ce0=_0x61b6[_0x38ead8];return _0x210ce0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x661b('0x0'));var zipdir=require(_0x661b('0x1'));var jsonpatch=require(_0x661b('0x2'));var rp=require('request-promise');var moment=require(_0x661b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x661b('0x4'));var util=require('util');var path=require(_0x661b('0x5'));var sox=require(_0x661b('0x6'));var csv=require(_0x661b('0x7'));var ejs=require(_0x661b('0x8'));var fs=require('fs');var _=require(_0x661b('0x9'));var squel=require(_0x661b('0xa'));var crypto=require(_0x661b('0xb'));var jsforce=require(_0x661b('0xc'));var deskjs=require(_0x661b('0xd'));var toCsv=require(_0x661b('0x7'));var querystring=require(_0x661b('0xe'));var Papa=require(_0x661b('0xf'));var Redis=require(_0x661b('0x10'));var authService=require(_0x661b('0x11'));var qs=require(_0x661b('0x12'));var as=require(_0x661b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x661b('0x14'))(_0x661b('0x15'));var utils=require('../../config/utils');var config=require(_0x661b('0x16'));var db=require(_0x661b('0x17'))['db'];var jayson=require(_0x661b('0x18'));var client=jayson['client'][_0x661b('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4c288c,_0xbe2a5b,_0x51e0b4){if(_0x51e0b4){var _0x139821=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x139821[_0x661b('0x1a')](_0xbe2a5b)){return _0x4c288c;}else{throw new db['Sequelize'][(_0x661b('0x1b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4c288c;}}function respondWithRpcPromise(_0x3b0581,_0x20bcfa,_0x38a416,_0x58a691){return new BPromise(function(_0x156cdd,_0xa610f5){var _0x5beab1=_0x58a691||client;return _0x5beab1[_0x661b('0x1c')](_0x3b0581,_0x38a416)[_0x661b('0x1d')](function(_0x1e3665){logger[_0x661b('0x1e')](_0x661b('0x1f'),_0x20bcfa,'request\x20sent');logger['debug'](_0x661b('0x20'),_0x20bcfa,_0x661b('0x21'),JSON[_0x661b('0x22')](_0x1e3665));if(_0x1e3665['error']){if(_0x1e3665[_0x661b('0x23')][_0x661b('0x24')]===0x1f4){logger[_0x661b('0x23')](_0x661b('0x1f'),_0x20bcfa,_0x1e3665[_0x661b('0x23')][_0x661b('0x25')]);return _0xa610f5(_0x1e3665['error'][_0x661b('0x25')]);}logger['error'](_0x661b('0x1f'),_0x20bcfa,_0x1e3665[_0x661b('0x23')][_0x661b('0x25')]);return _0x156cdd(_0x1e3665[_0x661b('0x23')][_0x661b('0x25')]);}else{logger['info'](_0x661b('0x1f'),_0x20bcfa,_0x661b('0x21'));_0x156cdd(_0x1e3665[_0x661b('0x26')][_0x661b('0x25')]);}})[_0x661b('0x27')](function(_0x44c1f7){logger['error'](_0x661b('0x1f'),_0x20bcfa,_0x44c1f7);_0xa610f5(_0x44c1f7);});});}function respondWithStatusCode(_0x106108,_0x1fa969){_0x1fa969=_0x1fa969||0xcc;return function(_0x129ed8){if(_0x129ed8){return _0x106108[_0x661b('0x28')](_0x1fa969);}return _0x106108[_0x661b('0x29')](_0x1fa969)[_0x661b('0x2a')]();};}function respondWithResult(_0x57ef81,_0x20fdff){_0x20fdff=_0x20fdff||0xc8;return function(_0x24cf58){if(_0x24cf58){return _0x57ef81[_0x661b('0x29')](_0x20fdff)[_0x661b('0x2b')](_0x24cf58);}};}function respondWithFilteredResult(_0x96457,_0x1f51f6){return function(_0x17c9f0){if(_0x17c9f0){var _0x2f03a7=_0x17c9f0['count'],_0x144dab=_0x1f51f6[_0x661b('0x2c')],_0x581cac=_0x1f51f6['offset']+_0x1f51f6[_0x661b('0x2d')],_0x54637b;if(_0x581cac>=_0x2f03a7){_0x581cac=_0x2f03a7;_0x54637b=0xc8;}else{_0x54637b=0xce;}_0x96457[_0x661b('0x29')](_0x54637b);return _0x96457[_0x661b('0x2e')](_0x661b('0x2f'),_0x144dab+'-'+_0x581cac+'/'+_0x2f03a7)[_0x661b('0x2b')](_0x17c9f0);}return null;};}function patchUpdates(_0x532ab9){return function(_0xd8a1db){try{jsonpatch[_0x661b('0x30')](_0xd8a1db,_0x532ab9,!![]);}catch(_0x1d5b8a){return BPromise[_0x661b('0x31')](_0x1d5b8a);}return _0xd8a1db[_0x661b('0x32')]();};}function saveUpdates(_0x5483ed,_0x15e6ab){return function(_0x3789a0){if(_0x3789a0){return _0x3789a0[_0x661b('0x33')](_0x5483ed)[_0x661b('0x1d')](function(_0x4de324){return _0x4de324;});}return null;};}function removeEntity(_0x464798,_0x5edda5){return function(_0x5354ec){if(_0x5354ec){return _0x5354ec[_0x661b('0x34')]()[_0x661b('0x1d')](function(){_0x464798['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ab0ab,_0x3e8e4d){return function(_0x1cecfd){if(!_0x1cecfd){_0x2ab0ab[_0x661b('0x28')](0x194);}return _0x1cecfd;};}function handleError(_0x499abc,_0x3a743f){_0x3a743f=_0x3a743f||0x1f4;return function(_0x292d2b){logger[_0x661b('0x23')](_0x292d2b['stack']);if(_0x292d2b['name']){delete _0x292d2b[_0x661b('0x35')];}_0x499abc[_0x661b('0x29')](_0x3a743f)[_0x661b('0x36')](_0x292d2b);};}exports['index']=function(_0x303039,_0x4c4dc2){var _0x2a742a={},_0x35c545={},_0x181ce3={'count':0x0,'rows':[]};var _0x4b3788=_[_0x661b('0x37')](db[_0x661b('0x38')][_0x661b('0x39')],function(_0x13fe5b){return{'name':_0x13fe5b['fieldName'],'type':_0x13fe5b['type'][_0x661b('0x3a')]};});_0x35c545[_0x661b('0x3b')]=_[_0x661b('0x37')](_0x4b3788,_0x661b('0x35'));_0x35c545[_0x661b('0x3c')]=_[_0x661b('0x3d')](_0x303039[_0x661b('0x3c')]);_0x35c545[_0x661b('0x3e')]=_[_0x661b('0x3f')](_0x35c545[_0x661b('0x3b')],_0x35c545[_0x661b('0x3c')]);_0x2a742a['attributes']=_[_0x661b('0x3f')](_0x35c545[_0x661b('0x3b')],qs[_0x661b('0x40')](_0x303039[_0x661b('0x3c')][_0x661b('0x40')]));_0x2a742a[_0x661b('0x41')]=_0x2a742a[_0x661b('0x41')]['length']?_0x2a742a[_0x661b('0x41')]:_0x35c545[_0x661b('0x3b')];if(!_0x303039['query'][_0x661b('0x42')](_0x661b('0x43'))){_0x2a742a[_0x661b('0x2d')]=qs['limit'](_0x303039[_0x661b('0x3c')][_0x661b('0x2d')]);_0x2a742a[_0x661b('0x2c')]=qs[_0x661b('0x2c')](_0x303039['query'][_0x661b('0x2c')]);}_0x2a742a[_0x661b('0x44')]=qs[_0x661b('0x45')](_0x303039[_0x661b('0x3c')][_0x661b('0x45')]);_0x2a742a['where']=qs['filters'](_[_0x661b('0x46')](_0x303039[_0x661b('0x3c')],_0x35c545[_0x661b('0x3e')]),_0x4b3788);if(_0x303039[_0x661b('0x3c')]['filter']){_0x2a742a[_0x661b('0x47')]=_[_0x661b('0x48')](_0x2a742a[_0x661b('0x47')],{'$or':_[_0x661b('0x37')](_0x4b3788,function(_0xc21c29){if(_0xc21c29[_0x661b('0x49')]!=='VIRTUAL'){var _0x46063c={};_0x46063c[_0xc21c29[_0x661b('0x35')]]={'$like':'%'+_0x303039[_0x661b('0x3c')]['filter']+'%'};return _0x46063c;}})});}_0x2a742a=_[_0x661b('0x48')]({},_0x2a742a,_0x303039[_0x661b('0x4a')]);var _0x54b186={'where':_0x2a742a[_0x661b('0x47')]};return db['SugarcrmConfiguration'][_0x661b('0x4b')](_0x54b186)[_0x661b('0x1d')](function(_0x33ec03){_0x181ce3['count']=_0x33ec03;if(_0x303039[_0x661b('0x3c')][_0x661b('0x4c')]){_0x2a742a[_0x661b('0x4d')]=[{'all':!![]}];}return db[_0x661b('0x38')][_0x661b('0x4e')](_0x2a742a);})['then'](function(_0x4de9ae){_0x181ce3[_0x661b('0x4f')]=_0x4de9ae;return _0x181ce3;})[_0x661b('0x1d')](respondWithFilteredResult(_0x4c4dc2,_0x2a742a))[_0x661b('0x27')](handleError(_0x4c4dc2,null));};exports[_0x661b('0x50')]=function(_0x3373a7,_0x5f9fc8){var _0x3bc033={'raw':![],'where':{'id':_0x3373a7[_0x661b('0x51')]['id']}},_0x24edaa={};_0x24edaa['model']=_['keys'](db[_0x661b('0x38')][_0x661b('0x39')]);_0x24edaa[_0x661b('0x3c')]=_[_0x661b('0x3d')](_0x3373a7[_0x661b('0x3c')]);_0x24edaa[_0x661b('0x3e')]=_['intersection'](_0x24edaa[_0x661b('0x3b')],_0x24edaa[_0x661b('0x3c')]);_0x3bc033[_0x661b('0x41')]=_[_0x661b('0x3f')](_0x24edaa[_0x661b('0x3b')],qs[_0x661b('0x40')](_0x3373a7[_0x661b('0x3c')][_0x661b('0x40')]));_0x3bc033[_0x661b('0x41')]=_0x3bc033[_0x661b('0x41')][_0x661b('0x52')]?_0x3bc033[_0x661b('0x41')]:_0x24edaa[_0x661b('0x3b')];if(_0x3373a7['query']['includeAll']){_0x3bc033[_0x661b('0x4d')]=[{'all':!![]}];}_0x3bc033=_[_0x661b('0x48')]({},_0x3bc033,_0x3373a7[_0x661b('0x4a')]);return db['SugarcrmConfiguration'][_0x661b('0x53')](_0x3bc033)[_0x661b('0x1d')](handleEntityNotFound(_0x5f9fc8,null))[_0x661b('0x1d')](respondWithResult(_0x5f9fc8,null))[_0x661b('0x27')](handleError(_0x5f9fc8,null));};exports[_0x661b('0x54')]=function(_0x2f0418,_0x3c6338){return db[_0x661b('0x38')]['create'](_0x2f0418['body'],{})['then'](respondWithResult(_0x3c6338,0xc9))['catch'](handleError(_0x3c6338,null));};exports[_0x661b('0x33')]=function(_0x426c40,_0x1bee78){if(_0x426c40[_0x661b('0x55')]['id']){delete _0x426c40[_0x661b('0x55')]['id'];}return db[_0x661b('0x38')][_0x661b('0x53')]({'where':{'id':_0x426c40[_0x661b('0x51')]['id']}})[_0x661b('0x1d')](handleEntityNotFound(_0x1bee78,null))[_0x661b('0x1d')](saveUpdates(_0x426c40[_0x661b('0x55')],null))[_0x661b('0x1d')](respondWithResult(_0x1bee78,null))[_0x661b('0x27')](handleError(_0x1bee78,null));};exports[_0x661b('0x34')]=function(_0x46c0c7,_0x2f32d1){return db['SugarcrmConfiguration'][_0x661b('0x53')]({'where':{'id':_0x46c0c7[_0x661b('0x51')]['id']}})[_0x661b('0x1d')](handleEntityNotFound(_0x2f32d1,null))[_0x661b('0x1d')](removeEntity(_0x2f32d1,null))['catch'](handleError(_0x2f32d1,null));};exports[_0x661b('0x56')]=function(_0x2c26bb,_0x1a9f7b,_0xadb1d){var _0x54bdb3={};var _0x58c48f={};var _0xe7fad1;var _0x2d0891;return db[_0x661b('0x38')][_0x661b('0x57')]({'where':{'id':_0x2c26bb['params']['id']}})[_0x661b('0x1d')](handleEntityNotFound(_0x1a9f7b,null))[_0x661b('0x1d')](function(_0x2cd366){if(_0x2cd366){_0xe7fad1=_0x2cd366;_0x58c48f[_0x661b('0x3b')]=_[_0x661b('0x3d')](db[_0x661b('0x58')][_0x661b('0x39')]);_0x58c48f['query']=_[_0x661b('0x3d')](_0x2c26bb[_0x661b('0x3c')]);_0x58c48f['filters']=_[_0x661b('0x3f')](_0x58c48f[_0x661b('0x3b')],_0x58c48f[_0x661b('0x3c')]);_0x54bdb3['attributes']=_[_0x661b('0x3f')](_0x58c48f[_0x661b('0x3b')],qs[_0x661b('0x40')](_0x2c26bb[_0x661b('0x3c')][_0x661b('0x40')]));_0x54bdb3['attributes']=_0x54bdb3[_0x661b('0x41')][_0x661b('0x52')]?_0x54bdb3['attributes']:_0x58c48f['model'];_0x54bdb3[_0x661b('0x44')]=qs['sort'](_0x2c26bb[_0x661b('0x3c')][_0x661b('0x45')]);_0x54bdb3[_0x661b('0x47')]=qs[_0x661b('0x3e')](_['pick'](_0x2c26bb[_0x661b('0x3c')],_0x58c48f[_0x661b('0x3e')]));if(_0x2c26bb['query']['filter']){_0x54bdb3[_0x661b('0x47')]=_[_0x661b('0x48')](_0x54bdb3[_0x661b('0x47')],{'$or':_['map'](_0x54bdb3[_0x661b('0x41')],function(_0x28be8a){var _0x57ec9f={};_0x57ec9f[_0x28be8a]={'$like':'%'+_0x2c26bb[_0x661b('0x3c')][_0x661b('0x59')]+'%'};return _0x57ec9f;})});}_0x54bdb3=_['merge']({},_0x54bdb3,_0x2c26bb[_0x661b('0x4a')]);return _0xe7fad1[_0x661b('0x56')](_0x54bdb3);}})[_0x661b('0x1d')](function(_0x5d1b43){if(_0x5d1b43){_0x2d0891=_0x5d1b43['length'];if(!_0x2c26bb['query'][_0x661b('0x42')](_0x661b('0x43'))){_0x54bdb3[_0x661b('0x2d')]=qs[_0x661b('0x2d')](_0x2c26bb[_0x661b('0x3c')]['limit']);_0x54bdb3[_0x661b('0x2c')]=qs['offset'](_0x2c26bb['query'][_0x661b('0x2c')]);}return _0xe7fad1[_0x661b('0x56')](_0x54bdb3);}})[_0x661b('0x1d')](function(_0x183643){if(_0x183643){return _0x183643?{'count':_0x2d0891,'rows':_0x183643}:null;}})[_0x661b('0x1d')](respondWithResult(_0x1a9f7b,null))[_0x661b('0x27')](handleError(_0x1a9f7b,null));};exports[_0x661b('0x5a')]=function(_0x1c5a38,_0x1d4521,_0x381b55){var _0x12de45={};var _0x574d98={};var _0x2c79f7;var _0xcc0985;return db[_0x661b('0x38')][_0x661b('0x57')]({'where':{'id':_0x1c5a38[_0x661b('0x51')]['id']}})[_0x661b('0x1d')](handleEntityNotFound(_0x1d4521,null))[_0x661b('0x1d')](function(_0x127f15){if(_0x127f15){_0x2c79f7=_0x127f15;_0x574d98[_0x661b('0x3b')]=_[_0x661b('0x3d')](db[_0x661b('0x58')][_0x661b('0x39')]);_0x574d98[_0x661b('0x3c')]=_['keys'](_0x1c5a38[_0x661b('0x3c')]);_0x574d98[_0x661b('0x3e')]=_['intersection'](_0x574d98['model'],_0x574d98[_0x661b('0x3c')]);_0x12de45[_0x661b('0x41')]=_[_0x661b('0x3f')](_0x574d98[_0x661b('0x3b')],qs[_0x661b('0x40')](_0x1c5a38[_0x661b('0x3c')][_0x661b('0x40')]));_0x12de45['attributes']=_0x12de45['attributes']['length']?_0x12de45[_0x661b('0x41')]:_0x574d98['model'];_0x12de45[_0x661b('0x44')]=qs[_0x661b('0x45')](_0x1c5a38[_0x661b('0x3c')]['sort']);_0x12de45[_0x661b('0x47')]=qs[_0x661b('0x3e')](_[_0x661b('0x46')](_0x1c5a38['query'],_0x574d98['filters']));if(_0x1c5a38['query'][_0x661b('0x59')]){_0x12de45[_0x661b('0x47')]=_['merge'](_0x12de45[_0x661b('0x47')],{'$or':_['map'](_0x12de45[_0x661b('0x41')],function(_0x4cab6c){var _0x42759e={};_0x42759e[_0x4cab6c]={'$like':'%'+_0x1c5a38[_0x661b('0x3c')]['filter']+'%'};return _0x42759e;})});}_0x12de45=_[_0x661b('0x48')]({},_0x12de45,_0x1c5a38[_0x661b('0x4a')]);return _0x2c79f7[_0x661b('0x5a')](_0x12de45);}})[_0x661b('0x1d')](function(_0x396e3b){if(_0x396e3b){_0xcc0985=_0x396e3b[_0x661b('0x52')];if(!_0x1c5a38[_0x661b('0x3c')]['hasOwnProperty'](_0x661b('0x43'))){_0x12de45[_0x661b('0x2d')]=qs['limit'](_0x1c5a38[_0x661b('0x3c')][_0x661b('0x2d')]);_0x12de45[_0x661b('0x2c')]=qs[_0x661b('0x2c')](_0x1c5a38[_0x661b('0x3c')][_0x661b('0x2c')]);}return _0x2c79f7['getSubjects'](_0x12de45);}})[_0x661b('0x1d')](function(_0xaa7bb7){if(_0xaa7bb7){return _0xaa7bb7?{'count':_0xcc0985,'rows':_0xaa7bb7}:null;}})[_0x661b('0x1d')](respondWithResult(_0x1d4521,null))['catch'](handleError(_0x1d4521,null));};exports['getDescriptions']=function(_0x401553,_0x63ba,_0x525b8f){var _0x3ee15e={};var _0x5280ef={};var _0x54721e;var _0x5e4458;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x401553['params']['id']}})[_0x661b('0x1d')](handleEntityNotFound(_0x63ba,null))[_0x661b('0x1d')](function(_0x43ca03){if(_0x43ca03){_0x54721e=_0x43ca03;_0x5280ef[_0x661b('0x3b')]=_[_0x661b('0x3d')](db[_0x661b('0x58')][_0x661b('0x39')]);_0x5280ef[_0x661b('0x3c')]=_['keys'](_0x401553[_0x661b('0x3c')]);_0x5280ef[_0x661b('0x3e')]=_[_0x661b('0x3f')](_0x5280ef[_0x661b('0x3b')],_0x5280ef['query']);_0x3ee15e[_0x661b('0x41')]=_[_0x661b('0x3f')](_0x5280ef[_0x661b('0x3b')],qs['fields'](_0x401553['query'][_0x661b('0x40')]));_0x3ee15e[_0x661b('0x41')]=_0x3ee15e['attributes'][_0x661b('0x52')]?_0x3ee15e[_0x661b('0x41')]:_0x5280ef[_0x661b('0x3b')];_0x3ee15e[_0x661b('0x44')]=qs['sort'](_0x401553[_0x661b('0x3c')][_0x661b('0x45')]);_0x3ee15e[_0x661b('0x47')]=qs['filters'](_[_0x661b('0x46')](_0x401553[_0x661b('0x3c')],_0x5280ef[_0x661b('0x3e')]));if(_0x401553[_0x661b('0x3c')]['filter']){_0x3ee15e[_0x661b('0x47')]=_[_0x661b('0x48')](_0x3ee15e[_0x661b('0x47')],{'$or':_['map'](_0x3ee15e[_0x661b('0x41')],function(_0x52be9f){var _0x1683ac={};_0x1683ac[_0x52be9f]={'$like':'%'+_0x401553['query'][_0x661b('0x59')]+'%'};return _0x1683ac;})});}_0x3ee15e=_['merge']({},_0x3ee15e,_0x401553['options']);return _0x54721e[_0x661b('0x5b')](_0x3ee15e);}})['then'](function(_0x2278e5){if(_0x2278e5){_0x5e4458=_0x2278e5[_0x661b('0x52')];if(!_0x401553[_0x661b('0x3c')]['hasOwnProperty'](_0x661b('0x43'))){_0x3ee15e[_0x661b('0x2d')]=qs['limit'](_0x401553[_0x661b('0x3c')][_0x661b('0x2d')]);_0x3ee15e['offset']=qs[_0x661b('0x2c')](_0x401553[_0x661b('0x3c')]['offset']);}return _0x54721e['getDescriptions'](_0x3ee15e);}})['then'](function(_0x2a7fa8){if(_0x2a7fa8){return _0x2a7fa8?{'count':_0x5e4458,'rows':_0x2a7fa8}:null;}})[_0x661b('0x1d')](respondWithResult(_0x63ba,null))[_0x661b('0x27')](handleError(_0x63ba,null));};
\ No newline at end of file
index 0269a78..309412c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebf2=['define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x5c469a,_0xf8915a){var _0x4a4fc4=function(_0xc7f881){while(--_0xc7f881){_0x5c469a['push'](_0x5c469a['shift']());}};_0x4a4fc4(++_0xf8915a);}(_0xebf2,0x148));var _0x2ebf=function(_0x2ffa5d,_0x561edb){_0x2ffa5d=_0x2ffa5d-0x0;var _0x92c355=_0xebf2[_0x2ffa5d];return _0x92c355;};'use strict';var _=require(_0x2ebf('0x0'));var util=require(_0x2ebf('0x1'));var logger=require(_0x2ebf('0x2'))('api');var moment=require(_0x2ebf('0x3'));var BPromise=require(_0x2ebf('0x4'));var rp=require(_0x2ebf('0x5'));var fs=require('fs');var path=require(_0x2ebf('0x6'));var rimraf=require(_0x2ebf('0x7'));var config=require(_0x2ebf('0x8'));var attributes=require(_0x2ebf('0x9'));module['exports']=function(_0x3695f3,_0x43af9b){return _0x3695f3[_0x2ebf('0xa')](_0x2ebf('0xb'),attributes,{'tableName':_0x2ebf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe041=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','request-promise'];(function(_0x192cbe,_0x3b4b43){var _0x4ce395=function(_0x5388ae){while(--_0x5388ae){_0x192cbe['push'](_0x192cbe['shift']());}};_0x4ce395(++_0x3b4b43);}(_0xe041,0x1b5));var _0x1e04=function(_0x55702c,_0x5a1364){_0x55702c=_0x55702c-0x0;var _0x41f489=_0xe041[_0x55702c];return _0x41f489;};'use strict';var _=require(_0x1e04('0x0'));var util=require(_0x1e04('0x1'));var logger=require(_0x1e04('0x2'))('api');var moment=require(_0x1e04('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e04('0x4'));var fs=require('fs');var path=require(_0x1e04('0x5'));var rimraf=require(_0x1e04('0x6'));var config=require(_0x1e04('0x7'));var attributes=require(_0x1e04('0x8'));module[_0x1e04('0x9')]=function(_0x333946,_0x56fb8f){return _0x333946[_0x1e04('0xa')](_0x1e04('0xb'),attributes,{'tableName':_0x1e04('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b5b1f12..754b7fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f0e=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment','bluebird','randomstring'];(function(_0x271490,_0x31a1a9){var _0x5e71b4=function(_0x4bc773){while(--_0x4bc773){_0x271490['push'](_0x271490['shift']());}};_0x5e71b4(++_0x31a1a9);}(_0x0f0e,0x178));var _0xe0f0=function(_0x15da07,_0x89d55c){_0x15da07=_0x15da07-0x0;var _0x542d84=_0x0f0e[_0x15da07];return _0x542d84;};'use strict';var _=require('lodash');var util=require(_0xe0f0('0x0'));var moment=require(_0xe0f0('0x1'));var BPromise=require(_0xe0f0('0x2'));var rs=require(_0xe0f0('0x3'));var fs=require('fs');var Redis=require(_0xe0f0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe0f0('0x5'));var logger=require(_0xe0f0('0x6'))('rpc');var config=require(_0xe0f0('0x7'));var jayson=require(_0xe0f0('0x8'));var client=jayson[_0xe0f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c89ff,_0x44dc9d,_0x99161e){return new BPromise(function(_0x3aa4fb,_0x278d9c){return client['request'](_0x4c89ff,_0x99161e)['then'](function(_0x19c50b){logger['info'](_0xe0f0('0xa'),_0x44dc9d,_0xe0f0('0xb'));logger[_0xe0f0('0xc')](_0xe0f0('0xd'),_0x44dc9d,_0xe0f0('0xb'),JSON[_0xe0f0('0xe')](_0x19c50b));if(_0x19c50b['error']){if(_0x19c50b['error']['code']===0x1f4){logger[_0xe0f0('0xf')](_0xe0f0('0xa'),_0x44dc9d,_0x19c50b[_0xe0f0('0xf')][_0xe0f0('0x10')]);return _0x278d9c(_0x19c50b[_0xe0f0('0xf')][_0xe0f0('0x10')]);}logger['error'](_0xe0f0('0xa'),_0x44dc9d,_0x19c50b[_0xe0f0('0xf')][_0xe0f0('0x10')]);return _0x3aa4fb(_0x19c50b[_0xe0f0('0xf')][_0xe0f0('0x10')]);}else{logger[_0xe0f0('0x11')](_0xe0f0('0xa'),_0x44dc9d,_0xe0f0('0xb'));_0x3aa4fb(_0x19c50b[_0xe0f0('0x12')][_0xe0f0('0x10')]);}})['catch'](function(_0x3ccc67){logger[_0xe0f0('0xf')](_0xe0f0('0xa'),_0x44dc9d,_0x3ccc67);_0x278d9c(_0x3ccc67);});});}
\ No newline at end of file
+var _0xd91f=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x26ba35,_0x3816f5){var _0x1d073e=function(_0x7ff982){while(--_0x7ff982){_0x26ba35['push'](_0x26ba35['shift']());}};_0x1d073e(++_0x3816f5);}(_0xd91f,0x12d));var _0xfd91=function(_0x1fbdd1,_0x17323f){_0x1fbdd1=_0x1fbdd1-0x0;var _0x3319a2=_0xd91f[_0x1fbdd1];return _0x3319a2;};'use strict';var _=require(_0xfd91('0x0'));var util=require(_0xfd91('0x1'));var moment=require(_0xfd91('0x2'));var BPromise=require(_0xfd91('0x3'));var rs=require(_0xfd91('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd91('0x5'))['db'];var utils=require(_0xfd91('0x6'));var logger=require(_0xfd91('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfd91('0x8'));var client=jayson[_0xfd91('0x9')][_0xfd91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8fbc8,_0x22b0e9,_0x4e315b){return new BPromise(function(_0x4b4a45,_0x1dd3d7){return client[_0xfd91('0xb')](_0xe8fbc8,_0x4e315b)[_0xfd91('0xc')](function(_0x3abf2d){logger[_0xfd91('0xd')](_0xfd91('0xe'),_0x22b0e9,_0xfd91('0xf'));logger[_0xfd91('0x10')](_0xfd91('0x11'),_0x22b0e9,_0xfd91('0xf'),JSON[_0xfd91('0x12')](_0x3abf2d));if(_0x3abf2d[_0xfd91('0x13')]){if(_0x3abf2d['error'][_0xfd91('0x14')]===0x1f4){logger[_0xfd91('0x13')](_0xfd91('0xe'),_0x22b0e9,_0x3abf2d[_0xfd91('0x13')]['message']);return _0x1dd3d7(_0x3abf2d[_0xfd91('0x13')][_0xfd91('0x15')]);}logger[_0xfd91('0x13')](_0xfd91('0xe'),_0x22b0e9,_0x3abf2d[_0xfd91('0x13')][_0xfd91('0x15')]);return _0x4b4a45(_0x3abf2d[_0xfd91('0x13')][_0xfd91('0x15')]);}else{logger[_0xfd91('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x22b0e9,'request\x20sent');_0x4b4a45(_0x3abf2d['result'][_0xfd91('0x15')]);}})[_0xfd91('0x16')](function(_0x53ff85){logger[_0xfd91('0x13')](_0xfd91('0xe'),_0x22b0e9,_0x53ff85);_0x1dd3d7(_0x53ff85);});});}
\ No newline at end of file
index 0683c20..c0250c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bf1=['create','put','update','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','post'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x7bf1,0xd8));var _0x17bf=function(_0x35d3d0,_0x311a01){_0x35d3d0=_0x35d3d0-0x0;var _0x20fd26=_0x7bf1[_0x35d3d0];return _0x20fd26;};'use strict';var multer=require(_0x17bf('0x0'));var util=require(_0x17bf('0x1'));var path=require(_0x17bf('0x2'));var timeout=require(_0x17bf('0x3'));var express=require(_0x17bf('0x4'));var router=express['Router']();var auth=require(_0x17bf('0x5'));var interaction=require(_0x17bf('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0x17bf('0x7')]('/',auth['isAuthenticated'](),controller[_0x17bf('0x8')]);router[_0x17bf('0x7')](_0x17bf('0x9'),auth['isAuthenticated'](),controller[_0x17bf('0xa')]);router[_0x17bf('0xb')]('/',auth['isAuthenticated'](),controller[_0x17bf('0xc')]);router[_0x17bf('0xd')](_0x17bf('0x9'),auth['isAuthenticated'](),controller[_0x17bf('0xe')]);router[_0x17bf('0xf')](_0x17bf('0x9'),auth[_0x17bf('0x10')](),controller[_0x17bf('0x11')]);module[_0x17bf('0x12')]=router;
\ No newline at end of file
+var _0xdd5e=['./intSugarcrmField.controller','get','isAuthenticated','index','post','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5eee1c,_0x3817d8){var _0x5f2ea1=function(_0x19173b){while(--_0x19173b){_0x5eee1c['push'](_0x5eee1c['shift']());}};_0x5f2ea1(++_0x3817d8);}(_0xdd5e,0x107));var _0xedd5=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xdd5e[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0xedd5('0x0'));var util=require('util');var path=require(_0xedd5('0x1'));var timeout=require(_0xedd5('0x2'));var express=require('express');var router=express[_0xedd5('0x3')]();var auth=require(_0xedd5('0x4'));var interaction=require(_0xedd5('0x5'));var config=require(_0xedd5('0x6'));var controller=require(_0xedd5('0x7'));router[_0xedd5('0x8')]('/',auth[_0xedd5('0x9')](),controller[_0xedd5('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xedd5('0xb')]('/',auth[_0xedd5('0x9')](),controller[_0xedd5('0xc')]);router[_0xedd5('0xd')](_0xedd5('0xe'),auth[_0xedd5('0x9')](),controller['update']);router[_0xedd5('0xf')](_0xedd5('0xe'),auth[_0xedd5('0x9')](),controller[_0xedd5('0x10')]);module[_0xedd5('0x11')]=router;
\ No newline at end of file
index f1cb418..6ae138d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c39=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x487c5c,_0x1526e4){var _0x17640c=function(_0x53e36b){while(--_0x53e36b){_0x487c5c['push'](_0x487c5c['shift']());}};_0x17640c(++_0x1526e4);}(_0x8c39,0x1df));var _0x98c3=function(_0x1fd596,_0x21a7aa){_0x1fd596=_0x1fd596-0x0;var _0x5741e2=_0x8c39[_0x1fd596];return _0x5741e2;};'use strict';var Sequelize=require(_0x98c3('0x0'));module['exports']={'type':{'type':Sequelize[_0x98c3('0x1')](_0x98c3('0x2'),_0x98c3('0x3'),_0x98c3('0x4'),_0x98c3('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x98c3('0x6')]},'key':{'type':Sequelize[_0x98c3('0x6')]},'keyType':{'type':Sequelize[_0x98c3('0x1')]('string',_0x98c3('0x3'),_0x98c3('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x98c3('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x98c3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x98c3('0x6')]}};
\ No newline at end of file
+var _0xa4c2=['customVariable','STRING','string','BOOLEAN','sequelize','ENUM','variable'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa4c2,0xc1));var _0x2a4c=function(_0x59d01d,_0x460e84){_0x59d01d=_0x59d01d-0x0;var _0x21b0e0=_0xa4c2[_0x59d01d];return _0x21b0e0;};'use strict';var Sequelize=require(_0x2a4c('0x0'));module['exports']={'type':{'type':Sequelize[_0x2a4c('0x1')]('string',_0x2a4c('0x2'),_0x2a4c('0x3'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x2a4c('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2a4c('0x1')](_0x2a4c('0x5'),'variable',_0x2a4c('0x3'))},'keyContent':{'type':Sequelize[_0x2a4c('0x4')]},'idField':{'type':Sequelize[_0x2a4c('0x4')]},'nameField':{'type':Sequelize[_0x2a4c('0x4')]},'customField':{'type':Sequelize[_0x2a4c('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2a4c('0x4')]}};
\ No newline at end of file
index ae6e189..cf20389 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bf8=['pick','filter','merge','map','type','SugarcrmField','includeAll','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where'];(function(_0x3bbf44,_0xc0c8b2){var _0x4d7193=function(_0x37a5fb){while(--_0x37a5fb){_0x3bbf44['push'](_0x3bbf44['shift']());}};_0x4d7193(++_0xc0c8b2);}(_0x0bf8,0x171));var _0x80bf=function(_0xe1b14b,_0x275799){_0xe1b14b=_0xe1b14b-0x0;var _0x21da52=_0x0bf8[_0xe1b14b];return _0x21da52;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x80bf('0x0'));var zipdir=require(_0x80bf('0x1'));var jsonpatch=require(_0x80bf('0x2'));var rp=require(_0x80bf('0x3'));var moment=require('moment');var BPromise=require(_0x80bf('0x4'));var Mustache=require(_0x80bf('0x5'));var util=require('util');var path=require(_0x80bf('0x6'));var sox=require(_0x80bf('0x7'));var csv=require(_0x80bf('0x8'));var ejs=require(_0x80bf('0x9'));var fs=require('fs');var _=require(_0x80bf('0xa'));var squel=require(_0x80bf('0xb'));var crypto=require(_0x80bf('0xc'));var jsforce=require(_0x80bf('0xd'));var deskjs=require(_0x80bf('0xe'));var toCsv=require(_0x80bf('0x8'));var querystring=require(_0x80bf('0xf'));var Papa=require(_0x80bf('0x10'));var Redis=require('ioredis');var authService=require(_0x80bf('0x11'));var qs=require(_0x80bf('0x12'));var as=require(_0x80bf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80bf('0x14'))(_0x80bf('0x15'));var utils=require(_0x80bf('0x16'));var config=require('../../config/environment');var db=require(_0x80bf('0x17'))['db'];function respondWithStatusCode(_0x147b7c,_0x1e419d){_0x1e419d=_0x1e419d||0xcc;return function(_0x134ebe){if(_0x134ebe){return _0x147b7c[_0x80bf('0x18')](_0x1e419d);}return _0x147b7c['status'](_0x1e419d)['end']();};}function respondWithResult(_0x58e327,_0xeb6389){_0xeb6389=_0xeb6389||0xc8;return function(_0x1cd14e){if(_0x1cd14e){return _0x58e327[_0x80bf('0x19')](_0xeb6389)[_0x80bf('0x1a')](_0x1cd14e);}};}function respondWithFilteredResult(_0x45f86f,_0x2cb48b){return function(_0x2529e6){if(_0x2529e6){var _0x237133=_0x2529e6[_0x80bf('0x1b')],_0x328922=_0x2cb48b[_0x80bf('0x1c')],_0x9a718d=_0x2cb48b[_0x80bf('0x1c')]+_0x2cb48b['limit'],_0x5b2ba0;if(_0x9a718d>=_0x237133){_0x9a718d=_0x237133;_0x5b2ba0=0xc8;}else{_0x5b2ba0=0xce;}_0x45f86f['status'](_0x5b2ba0);return _0x45f86f[_0x80bf('0x1d')](_0x80bf('0x1e'),_0x328922+'-'+_0x9a718d+'/'+_0x237133)[_0x80bf('0x1a')](_0x2529e6);}return null;};}function patchUpdates(_0x513b05){return function(_0x37ea09){try{jsonpatch[_0x80bf('0x1f')](_0x37ea09,_0x513b05,!![]);}catch(_0x5ac124){return BPromise[_0x80bf('0x20')](_0x5ac124);}return _0x37ea09[_0x80bf('0x21')]();};}function saveUpdates(_0x258bf1,_0x278496){return function(_0x252cd1){if(_0x252cd1){return _0x252cd1[_0x80bf('0x22')](_0x258bf1)[_0x80bf('0x23')](function(_0x3d8e57){return _0x3d8e57;});}return null;};}function removeEntity(_0x36bc0f,_0x3f12dc){return function(_0x46e30c){if(_0x46e30c){return _0x46e30c['destroy']()[_0x80bf('0x23')](function(){_0x36bc0f[_0x80bf('0x19')](0xcc)[_0x80bf('0x24')]();});}};}function handleEntityNotFound(_0x36e8af,_0x65a042){return function(_0xbac87d){if(!_0xbac87d){_0x36e8af[_0x80bf('0x18')](0x194);}return _0xbac87d;};}function handleError(_0x163aae,_0x214470){_0x214470=_0x214470||0x1f4;return function(_0x40bda6){logger[_0x80bf('0x25')](_0x40bda6['stack']);if(_0x40bda6[_0x80bf('0x26')]){delete _0x40bda6[_0x80bf('0x26')];}_0x163aae['status'](_0x214470)[_0x80bf('0x27')](_0x40bda6);};}exports[_0x80bf('0x28')]=function(_0x1c9894,_0x4bca72){var _0x22fd7e={},_0x1a240d={},_0x4b6391={'count':0x0,'rows':[]};var _0x44f8a8=_['map'](db['SugarcrmField'][_0x80bf('0x29')],function(_0x48d1f8){return{'name':_0x48d1f8[_0x80bf('0x2a')],'type':_0x48d1f8['type'][_0x80bf('0x2b')]};});_0x1a240d['model']=_['map'](_0x44f8a8,_0x80bf('0x26'));_0x1a240d[_0x80bf('0x2c')]=_[_0x80bf('0x2d')](_0x1c9894[_0x80bf('0x2c')]);_0x1a240d[_0x80bf('0x2e')]=_[_0x80bf('0x2f')](_0x1a240d[_0x80bf('0x30')],_0x1a240d[_0x80bf('0x2c')]);_0x22fd7e[_0x80bf('0x31')]=_[_0x80bf('0x2f')](_0x1a240d[_0x80bf('0x30')],qs[_0x80bf('0x32')](_0x1c9894['query'][_0x80bf('0x32')]));_0x22fd7e[_0x80bf('0x31')]=_0x22fd7e[_0x80bf('0x31')][_0x80bf('0x33')]?_0x22fd7e[_0x80bf('0x31')]:_0x1a240d[_0x80bf('0x30')];if(!_0x1c9894[_0x80bf('0x2c')]['hasOwnProperty'](_0x80bf('0x34'))){_0x22fd7e[_0x80bf('0x35')]=qs[_0x80bf('0x35')](_0x1c9894[_0x80bf('0x2c')]['limit']);_0x22fd7e[_0x80bf('0x1c')]=qs[_0x80bf('0x1c')](_0x1c9894[_0x80bf('0x2c')][_0x80bf('0x1c')]);}_0x22fd7e[_0x80bf('0x36')]=qs[_0x80bf('0x37')](_0x1c9894[_0x80bf('0x2c')][_0x80bf('0x37')]);_0x22fd7e[_0x80bf('0x38')]=qs[_0x80bf('0x2e')](_[_0x80bf('0x39')](_0x1c9894[_0x80bf('0x2c')],_0x1a240d[_0x80bf('0x2e')]),_0x44f8a8);if(_0x1c9894['query'][_0x80bf('0x3a')]){_0x22fd7e['where']=_[_0x80bf('0x3b')](_0x22fd7e[_0x80bf('0x38')],{'$or':_[_0x80bf('0x3c')](_0x44f8a8,function(_0x83b3ab){if(_0x83b3ab[_0x80bf('0x3d')]!=='VIRTUAL'){var _0x5e59ce={};_0x5e59ce[_0x83b3ab[_0x80bf('0x26')]]={'$like':'%'+_0x1c9894['query'][_0x80bf('0x3a')]+'%'};return _0x5e59ce;}})});}_0x22fd7e=_[_0x80bf('0x3b')]({},_0x22fd7e,_0x1c9894['options']);var _0x1c96c8={'where':_0x22fd7e[_0x80bf('0x38')]};return db[_0x80bf('0x3e')][_0x80bf('0x1b')](_0x1c96c8)[_0x80bf('0x23')](function(_0x3509b5){_0x4b6391[_0x80bf('0x1b')]=_0x3509b5;if(_0x1c9894[_0x80bf('0x2c')][_0x80bf('0x3f')]){_0x22fd7e['include']=[{'all':!![]}];}return db[_0x80bf('0x3e')][_0x80bf('0x40')](_0x22fd7e);})['then'](function(_0x1fa035){_0x4b6391[_0x80bf('0x41')]=_0x1fa035;return _0x4b6391;})[_0x80bf('0x23')](respondWithFilteredResult(_0x4bca72,_0x22fd7e))[_0x80bf('0x42')](handleError(_0x4bca72,null));};exports['show']=function(_0x37d587,_0x16813b){var _0x497d31={'raw':!![],'where':{'id':_0x37d587[_0x80bf('0x43')]['id']}},_0x49e8d1={};_0x49e8d1['model']=_[_0x80bf('0x2d')](db['SugarcrmField']['rawAttributes']);_0x49e8d1[_0x80bf('0x2c')]=_[_0x80bf('0x2d')](_0x37d587[_0x80bf('0x2c')]);_0x49e8d1[_0x80bf('0x2e')]=_[_0x80bf('0x2f')](_0x49e8d1[_0x80bf('0x30')],_0x49e8d1[_0x80bf('0x2c')]);_0x497d31['attributes']=_['intersection'](_0x49e8d1['model'],qs[_0x80bf('0x32')](_0x37d587[_0x80bf('0x2c')][_0x80bf('0x32')]));_0x497d31[_0x80bf('0x31')]=_0x497d31[_0x80bf('0x31')][_0x80bf('0x33')]?_0x497d31[_0x80bf('0x31')]:_0x49e8d1[_0x80bf('0x30')];if(_0x37d587[_0x80bf('0x2c')]['includeAll']){_0x497d31['include']=[{'all':!![]}];}_0x497d31=_[_0x80bf('0x3b')]({},_0x497d31,_0x37d587['options']);return db['SugarcrmField'][_0x80bf('0x44')](_0x497d31)[_0x80bf('0x23')](handleEntityNotFound(_0x16813b,null))[_0x80bf('0x23')](respondWithResult(_0x16813b,null))[_0x80bf('0x42')](handleError(_0x16813b,null));};exports[_0x80bf('0x45')]=function(_0x57f2f1,_0x2a0ab0){return db[_0x80bf('0x3e')]['create'](_0x57f2f1[_0x80bf('0x46')],{})[_0x80bf('0x23')](respondWithResult(_0x2a0ab0,0xc9))[_0x80bf('0x42')](handleError(_0x2a0ab0,null));};exports['update']=function(_0x5356fc,_0x198604){if(_0x5356fc[_0x80bf('0x46')]['id']){delete _0x5356fc['body']['id'];}return db[_0x80bf('0x3e')][_0x80bf('0x44')]({'where':{'id':_0x5356fc[_0x80bf('0x43')]['id']}})[_0x80bf('0x23')](handleEntityNotFound(_0x198604,null))[_0x80bf('0x23')](saveUpdates(_0x5356fc[_0x80bf('0x46')],null))[_0x80bf('0x23')](respondWithResult(_0x198604,null))[_0x80bf('0x42')](handleError(_0x198604,null));};exports['destroy']=function(_0x42099e,_0x29985a){return db[_0x80bf('0x3e')][_0x80bf('0x44')]({'where':{'id':_0x42099e['params']['id']}})['then'](handleEntityNotFound(_0x29985a,null))[_0x80bf('0x23')](removeEntity(_0x29985a,null))[_0x80bf('0x42')](handleError(_0x29985a,null));};
\ No newline at end of file
+var _0xb6c4=['SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','length','include','create','body','find','destroy','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','index'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb6c4,0x1d1));var _0x4b6c=function(_0x422f80,_0x42bd24){_0x422f80=_0x422f80-0x0;var _0x2d370c=_0xb6c4[_0x422f80];return _0x2d370c;};'use strict';var pdf=require(_0x4b6c('0x0'));var emlformat=require(_0x4b6c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4b6c('0x2'));var rp=require(_0x4b6c('0x3'));var moment=require(_0x4b6c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4b6c('0x5'));var util=require(_0x4b6c('0x6'));var path=require('path');var sox=require(_0x4b6c('0x7'));var csv=require(_0x4b6c('0x8'));var ejs=require(_0x4b6c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4b6c('0xa'));var crypto=require(_0x4b6c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4b6c('0xc'));var toCsv=require(_0x4b6c('0x8'));var querystring=require('querystring');var Papa=require(_0x4b6c('0xd'));var Redis=require(_0x4b6c('0xe'));var authService=require(_0x4b6c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4b6c('0x10'));var hardwareService=require(_0x4b6c('0x11'));var logger=require('../../config/logger')(_0x4b6c('0x12'));var utils=require(_0x4b6c('0x13'));var config=require('../../config/environment');var db=require(_0x4b6c('0x14'))['db'];function respondWithStatusCode(_0x1619e2,_0x1d7952){_0x1d7952=_0x1d7952||0xcc;return function(_0x1f6866){if(_0x1f6866){return _0x1619e2['sendStatus'](_0x1d7952);}return _0x1619e2['status'](_0x1d7952)[_0x4b6c('0x15')]();};}function respondWithResult(_0x188dac,_0x443bc4){_0x443bc4=_0x443bc4||0xc8;return function(_0x7d3e4b){if(_0x7d3e4b){return _0x188dac['status'](_0x443bc4)[_0x4b6c('0x16')](_0x7d3e4b);}};}function respondWithFilteredResult(_0x290801,_0x252eed){return function(_0x11c4ae){if(_0x11c4ae){var _0x3bfab5=_0x11c4ae[_0x4b6c('0x17')],_0x5ad100=_0x252eed[_0x4b6c('0x18')],_0x44988a=_0x252eed['offset']+_0x252eed[_0x4b6c('0x19')],_0x333399;if(_0x44988a>=_0x3bfab5){_0x44988a=_0x3bfab5;_0x333399=0xc8;}else{_0x333399=0xce;}_0x290801[_0x4b6c('0x1a')](_0x333399);return _0x290801[_0x4b6c('0x1b')](_0x4b6c('0x1c'),_0x5ad100+'-'+_0x44988a+'/'+_0x3bfab5)[_0x4b6c('0x16')](_0x11c4ae);}return null;};}function patchUpdates(_0x42f371){return function(_0x11ca29){try{jsonpatch[_0x4b6c('0x1d')](_0x11ca29,_0x42f371,!![]);}catch(_0x37537a){return BPromise[_0x4b6c('0x1e')](_0x37537a);}return _0x11ca29[_0x4b6c('0x1f')]();};}function saveUpdates(_0x30931c,_0x24753e){return function(_0x2c31dc){if(_0x2c31dc){return _0x2c31dc[_0x4b6c('0x20')](_0x30931c)[_0x4b6c('0x21')](function(_0x30bd43){return _0x30bd43;});}return null;};}function removeEntity(_0x1696d0,_0x4859ae){return function(_0x3b3f72){if(_0x3b3f72){return _0x3b3f72['destroy']()['then'](function(){_0x1696d0['status'](0xcc)[_0x4b6c('0x15')]();});}};}function handleEntityNotFound(_0x9d0439,_0x3f5807){return function(_0x359c81){if(!_0x359c81){_0x9d0439[_0x4b6c('0x22')](0x194);}return _0x359c81;};}function handleError(_0x1b0076,_0x50a69f){_0x50a69f=_0x50a69f||0x1f4;return function(_0x460b68){logger['error'](_0x460b68[_0x4b6c('0x23')]);if(_0x460b68['name']){delete _0x460b68[_0x4b6c('0x24')];}_0x1b0076[_0x4b6c('0x1a')](_0x50a69f)[_0x4b6c('0x25')](_0x460b68);};}exports[_0x4b6c('0x26')]=function(_0x4a9b5c,_0xe99e8c){var _0x4c2633={},_0x3b6a63={},_0x3639b1={'count':0x0,'rows':[]};var _0x56be3f=_['map'](db[_0x4b6c('0x27')][_0x4b6c('0x28')],function(_0x4ef20d){return{'name':_0x4ef20d[_0x4b6c('0x29')],'type':_0x4ef20d[_0x4b6c('0x2a')][_0x4b6c('0x2b')]};});_0x3b6a63[_0x4b6c('0x2c')]=_[_0x4b6c('0x2d')](_0x56be3f,'name');_0x3b6a63[_0x4b6c('0x2e')]=_['keys'](_0x4a9b5c[_0x4b6c('0x2e')]);_0x3b6a63[_0x4b6c('0x2f')]=_[_0x4b6c('0x30')](_0x3b6a63[_0x4b6c('0x2c')],_0x3b6a63[_0x4b6c('0x2e')]);_0x4c2633[_0x4b6c('0x31')]=_['intersection'](_0x3b6a63[_0x4b6c('0x2c')],qs[_0x4b6c('0x32')](_0x4a9b5c[_0x4b6c('0x2e')][_0x4b6c('0x32')]));_0x4c2633[_0x4b6c('0x31')]=_0x4c2633[_0x4b6c('0x31')]['length']?_0x4c2633['attributes']:_0x3b6a63[_0x4b6c('0x2c')];if(!_0x4a9b5c[_0x4b6c('0x2e')][_0x4b6c('0x33')]('nolimit')){_0x4c2633['limit']=qs[_0x4b6c('0x19')](_0x4a9b5c['query']['limit']);_0x4c2633[_0x4b6c('0x18')]=qs[_0x4b6c('0x18')](_0x4a9b5c['query']['offset']);}_0x4c2633[_0x4b6c('0x34')]=qs[_0x4b6c('0x35')](_0x4a9b5c[_0x4b6c('0x2e')][_0x4b6c('0x35')]);_0x4c2633['where']=qs[_0x4b6c('0x2f')](_[_0x4b6c('0x36')](_0x4a9b5c[_0x4b6c('0x2e')],_0x3b6a63[_0x4b6c('0x2f')]),_0x56be3f);if(_0x4a9b5c['query'][_0x4b6c('0x37')]){_0x4c2633['where']=_[_0x4b6c('0x38')](_0x4c2633[_0x4b6c('0x39')],{'$or':_[_0x4b6c('0x2d')](_0x56be3f,function(_0x1990da){if(_0x1990da[_0x4b6c('0x2a')]!==_0x4b6c('0x3a')){var _0x2ab97a={};_0x2ab97a[_0x1990da['name']]={'$like':'%'+_0x4a9b5c[_0x4b6c('0x2e')][_0x4b6c('0x37')]+'%'};return _0x2ab97a;}})});}_0x4c2633=_[_0x4b6c('0x38')]({},_0x4c2633,_0x4a9b5c[_0x4b6c('0x3b')]);var _0x1de965={'where':_0x4c2633['where']};return db[_0x4b6c('0x27')][_0x4b6c('0x17')](_0x1de965)[_0x4b6c('0x21')](function(_0xe9478c){_0x3639b1[_0x4b6c('0x17')]=_0xe9478c;if(_0x4a9b5c[_0x4b6c('0x2e')][_0x4b6c('0x3c')]){_0x4c2633['include']=[{'all':!![]}];}return db[_0x4b6c('0x27')][_0x4b6c('0x3d')](_0x4c2633);})[_0x4b6c('0x21')](function(_0xfb3da2){_0x3639b1[_0x4b6c('0x3e')]=_0xfb3da2;return _0x3639b1;})['then'](respondWithFilteredResult(_0xe99e8c,_0x4c2633))[_0x4b6c('0x3f')](handleError(_0xe99e8c,null));};exports['show']=function(_0xd6d954,_0x346b34){var _0x237cc6={'raw':!![],'where':{'id':_0xd6d954[_0x4b6c('0x40')]['id']}},_0x5085f7={};_0x5085f7['model']=_[_0x4b6c('0x41')](db[_0x4b6c('0x27')][_0x4b6c('0x28')]);_0x5085f7[_0x4b6c('0x2e')]=_[_0x4b6c('0x41')](_0xd6d954[_0x4b6c('0x2e')]);_0x5085f7[_0x4b6c('0x2f')]=_[_0x4b6c('0x30')](_0x5085f7[_0x4b6c('0x2c')],_0x5085f7[_0x4b6c('0x2e')]);_0x237cc6['attributes']=_[_0x4b6c('0x30')](_0x5085f7['model'],qs[_0x4b6c('0x32')](_0xd6d954['query'][_0x4b6c('0x32')]));_0x237cc6[_0x4b6c('0x31')]=_0x237cc6[_0x4b6c('0x31')][_0x4b6c('0x42')]?_0x237cc6['attributes']:_0x5085f7[_0x4b6c('0x2c')];if(_0xd6d954[_0x4b6c('0x2e')][_0x4b6c('0x3c')]){_0x237cc6[_0x4b6c('0x43')]=[{'all':!![]}];}_0x237cc6=_['merge']({},_0x237cc6,_0xd6d954['options']);return db['SugarcrmField']['find'](_0x237cc6)[_0x4b6c('0x21')](handleEntityNotFound(_0x346b34,null))[_0x4b6c('0x21')](respondWithResult(_0x346b34,null))['catch'](handleError(_0x346b34,null));};exports[_0x4b6c('0x44')]=function(_0x24775c,_0x4d75d2){return db['SugarcrmField'][_0x4b6c('0x44')](_0x24775c[_0x4b6c('0x45')],{})[_0x4b6c('0x21')](respondWithResult(_0x4d75d2,0xc9))['catch'](handleError(_0x4d75d2,null));};exports[_0x4b6c('0x20')]=function(_0x12f7ef,_0x225128){if(_0x12f7ef[_0x4b6c('0x45')]['id']){delete _0x12f7ef[_0x4b6c('0x45')]['id'];}return db[_0x4b6c('0x27')][_0x4b6c('0x46')]({'where':{'id':_0x12f7ef[_0x4b6c('0x40')]['id']}})['then'](handleEntityNotFound(_0x225128,null))['then'](saveUpdates(_0x12f7ef[_0x4b6c('0x45')],null))[_0x4b6c('0x21')](respondWithResult(_0x225128,null))[_0x4b6c('0x3f')](handleError(_0x225128,null));};exports[_0x4b6c('0x47')]=function(_0x418130,_0x330296){return db[_0x4b6c('0x27')][_0x4b6c('0x46')]({'where':{'id':_0x418130[_0x4b6c('0x40')]['id']}})[_0x4b6c('0x21')](handleEntityNotFound(_0x330296,null))[_0x4b6c('0x21')](removeEntity(_0x330296,null))[_0x4b6c('0x3f')](handleError(_0x330296,null));};
\ No newline at end of file
index fad7bb4..7d951d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7253=['int_sugarcrm_fields','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intSugarcrmField.attributes','exports','SugarcrmField'];(function(_0x3bf7a0,_0x384e24){var _0x1b5fec=function(_0x3004ed){while(--_0x3004ed){_0x3bf7a0['push'](_0x3bf7a0['shift']());}};_0x1b5fec(++_0x384e24);}(_0x7253,0x117));var _0x3725=function(_0x428598,_0xb4dba7){_0x428598=_0x428598-0x0;var _0x2aec7a=_0x7253[_0x428598];return _0x2aec7a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3725('0x0'))(_0x3725('0x1'));var moment=require(_0x3725('0x2'));var BPromise=require(_0x3725('0x3'));var rp=require(_0x3725('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3725('0x5'));var config=require('../../config/environment');var attributes=require(_0x3725('0x6'));module[_0x3725('0x7')]=function(_0x1995ae,_0x1e34cb){return _0x1995ae['define'](_0x3725('0x8'),attributes,{'tableName':_0x3725('0x9'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x3725('0xa'),_0x3725('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x54b1=['define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x54b1,0x7e));var _0x154b=function(_0x2ca431,_0x22bbe7){_0x2ca431=_0x2ca431-0x0;var _0x5d5f6c=_0x54b1[_0x2ca431];return _0x5d5f6c;};'use strict';var _=require(_0x154b('0x0'));var util=require(_0x154b('0x1'));var logger=require('../../config/logger')(_0x154b('0x2'));var moment=require(_0x154b('0x3'));var BPromise=require(_0x154b('0x4'));var rp=require(_0x154b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x154b('0x6'));var config=require(_0x154b('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x154b('0x8')]=function(_0x8c2588,_0x4f6472){return _0x8c2588[_0x154b('0x9')](_0x154b('0xa'),attributes,{'tableName':_0x154b('0xb'),'paranoid':![],'indexes':[{'name':_0x154b('0xc'),'fields':[_0x154b('0xd'),_0x154b('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 856030f..9a0c213 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x339a10,_0x5e18e4){var _0xd4db83=function(_0x5cd56a){while(--_0x5cd56a){_0x339a10['push'](_0x339a10['shift']());}};_0xd4db83(++_0x5e18e4);}(_0x757a,0xde));var _0xa757=function(_0x5fe2ae,_0x4bf466){_0x5fe2ae=_0x5fe2ae-0x0;var _0x2776e5=_0x757a[_0x5fe2ae];return _0x2776e5;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}
\ No newline at end of file
+var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SugarcrmField,\x20%s,\x20%s','message','catch','lodash'];(function(_0x51febe,_0x2b87b9){var _0xf125af=function(_0x1e2833){while(--_0x1e2833){_0x51febe['push'](_0x51febe['shift']());}};_0xf125af(++_0x2b87b9);}(_0x66fa,0x117));var _0xa66f=function(_0x91cba2,_0x56c536){_0x91cba2=_0x91cba2-0x0;var _0x3c8d2f=_0x66fa[_0x91cba2];return _0x3c8d2f;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});}
\ No newline at end of file
index 916a3e8..d5ea52d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63ec=['isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x63ec,0x1ef));var _0xc63e=function(_0x32a933,_0x42db57){_0x32a933=_0x32a933-0x0;var _0x174076=_0x63ec[_0x32a933];return _0x174076;};'use strict';var multer=require('multer');var util=require(_0xc63e('0x0'));var path=require(_0xc63e('0x1'));var timeout=require(_0xc63e('0x2'));var express=require(_0xc63e('0x3'));var router=express[_0xc63e('0x4')]();var auth=require(_0xc63e('0x5'));var interaction=require(_0xc63e('0x6'));var config=require(_0xc63e('0x7'));var controller=require('./intVtigerAccount.controller');router[_0xc63e('0x8')]('/',auth[_0xc63e('0x9')](),controller['index']);router['get']('/:id',auth[_0xc63e('0x9')](),controller[_0xc63e('0xa')]);router[_0xc63e('0x8')]('/:id/configurations',auth[_0xc63e('0x9')](),controller[_0xc63e('0xb')]);router['get'](_0xc63e('0xc'),auth[_0xc63e('0x9')](),controller[_0xc63e('0xd')]);router[_0xc63e('0xe')]('/',auth['isAuthenticated'](),controller[_0xc63e('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xc63e('0x10')](_0xc63e('0x11'),auth[_0xc63e('0x9')](),controller[_0xc63e('0x12')]);router[_0xc63e('0x13')](_0xc63e('0x11'),auth['isAuthenticated'](),controller[_0xc63e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xfed8=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','get','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util'];(function(_0x44684a,_0x37d828){var _0xca3aa3=function(_0x457e9f){while(--_0x457e9f){_0x44684a['push'](_0x44684a['shift']());}};_0xca3aa3(++_0x37d828);}(_0xfed8,0x82));var _0x8fed=function(_0x215237,_0x2812d3){_0x215237=_0x215237-0x0;var _0x15745b=_0xfed8[_0x215237];return _0x15745b;};'use strict';var multer=require(_0x8fed('0x0'));var util=require(_0x8fed('0x1'));var path=require(_0x8fed('0x2'));var timeout=require(_0x8fed('0x3'));var express=require(_0x8fed('0x4'));var router=express['Router']();var auth=require(_0x8fed('0x5'));var interaction=require(_0x8fed('0x6'));var config=require(_0x8fed('0x7'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8fed('0x8'),auth[_0x8fed('0x9')](),controller[_0x8fed('0xa')]);router[_0x8fed('0xb')](_0x8fed('0xc'),auth[_0x8fed('0x9')](),controller['getConfigurations']);router[_0x8fed('0xb')](_0x8fed('0xd'),auth['isAuthenticated'](),controller[_0x8fed('0xe')]);router[_0x8fed('0xf')]('/',auth['isAuthenticated'](),controller[_0x8fed('0x10')]);router[_0x8fed('0xf')](_0x8fed('0xc'),auth['isAuthenticated'](),controller[_0x8fed('0x11')]);router['put'](_0x8fed('0x8'),auth[_0x8fed('0x9')](),controller[_0x8fed('0x12')]);router[_0x8fed('0x13')](_0x8fed('0x8'),auth[_0x8fed('0x9')](),controller[_0x8fed('0x14')]);module[_0x8fed('0x15')]=router;
\ No newline at end of file
index 87ff630..caad6c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2383=['STRING','HelpDesk','exports'];(function(_0xc14a52,_0x5b84b9){var _0x2e5227=function(_0x580348){while(--_0x580348){_0xc14a52['push'](_0xc14a52['shift']());}};_0x2e5227(++_0x5b84b9);}(_0x2383,0xf5));var _0x3238=function(_0x5d4e67,_0x1da63e){_0x5d4e67=_0x5d4e67-0x0;var _0x49cf92=_0x2383[_0x5d4e67];return _0x49cf92;};'use strict';var Sequelize=require('sequelize');module[_0x3238('0x0')]={'name':{'type':Sequelize[_0x3238('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3238('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3238('0x1')],'allowNull':![],'defaultValue':_0x3238('0x2')},'remoteUri':{'type':Sequelize[_0x3238('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3238('0x1')]},'accessKey':{'type':Sequelize[_0x3238('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x8234=['exports','STRING','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8234,0x19d));var _0x4823=function(_0x4401e6,_0x130b83){_0x4401e6=_0x4401e6-0x0;var _0x45970a=_0x8234[_0x4401e6];return _0x45970a;};'use strict';var Sequelize=require(_0x4823('0x0'));module[_0x4823('0x1')]={'name':{'type':Sequelize[_0x4823('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4823('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x4823('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x4823('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x4823('0x2')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 0cf4bb9..c3e6a4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfddf=['../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','count','offset','set','Content-Range','apply','reject','destroy','end','stack','name','send','map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','findOne','VtigerConfiguration','options','addConfiguration','AccountId','Subjects','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','username','description','moduleName','remoteUri','serverUrl','slice','substring','format','%s/webservice.php','GET','success','POST','login','token','sessionName','autogenerated','remove','includes','editable','false','label','cf_','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x3876ed,_0x52cbf6){var _0x18f6ca=function(_0x4d3671){while(--_0x4d3671){_0x3876ed['push'](_0x3876ed['shift']());}};_0x18f6ca(++_0x52cbf6);}(_0xfddf,0x1e7));var _0xffdd=function(_0x3f5f37,_0x5d31f7){_0x3f5f37=_0x3f5f37-0x0;var _0x36b98d=_0xfddf[_0x3f5f37];return _0x36b98d;};'use strict';var pdf=require(_0xffdd('0x0'));var emlformat=require(_0xffdd('0x1'));var rimraf=require(_0xffdd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xffdd('0x3'));var BPromise=require(_0xffdd('0x4'));var Mustache=require(_0xffdd('0x5'));var util=require(_0xffdd('0x6'));var path=require('path');var sox=require(_0xffdd('0x7'));var csv=require(_0xffdd('0x8'));var ejs=require(_0xffdd('0x9'));var fs=require('fs');var _=require(_0xffdd('0xa'));var squel=require(_0xffdd('0xb'));var crypto=require(_0xffdd('0xc'));var jsforce=require(_0xffdd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xffdd('0x8'));var querystring=require('querystring');var Papa=require(_0xffdd('0xe'));var Redis=require(_0xffdd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xffdd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xffdd('0x11'));var logger=require(_0xffdd('0x12'))(_0xffdd('0x13'));var utils=require(_0xffdd('0x14'));var config=require('../../config/environment');var db=require(_0xffdd('0x15'))['db'];var integrations=require(_0xffdd('0x16'));var jayson=require(_0xffdd('0x17'));var client=jayson[_0xffdd('0x18')][_0xffdd('0x19')]({'port':0x232a});function checkPasswordPattern(_0x553c49,_0x1471d9,_0x5a84f9){if(_0x5a84f9){var _0x17291e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17291e[_0xffdd('0x1a')](_0x1471d9)){return _0x553c49;}else{throw new db[(_0xffdd('0x1b'))][(_0xffdd('0x1c'))](_0xffdd('0x1d'));}}else{return _0x553c49;}}function respondWithRpcPromise(_0x29c26a,_0x354629,_0x10e3c1,_0x56a12b){return new BPromise(function(_0x73ac85,_0x20bda4){var _0x5ec7e1=_0x56a12b||client;return _0x5ec7e1['request'](_0x29c26a,_0x10e3c1)[_0xffdd('0x1e')](function(_0xd2e13f){logger[_0xffdd('0x1f')]('VtigerAccount,\x20%s,\x20%s',_0x354629,_0xffdd('0x20'));logger[_0xffdd('0x21')](_0xffdd('0x22'),_0x354629,_0xffdd('0x20'),JSON['stringify'](_0xd2e13f));if(_0xd2e13f[_0xffdd('0x23')]){if(_0xd2e13f[_0xffdd('0x23')]['code']===0x1f4){logger[_0xffdd('0x23')](_0xffdd('0x24'),_0x354629,_0xd2e13f[_0xffdd('0x23')][_0xffdd('0x25')]);return _0x20bda4(_0xd2e13f['error'][_0xffdd('0x25')]);}logger[_0xffdd('0x23')]('VtigerAccount,\x20%s,\x20%s',_0x354629,_0xd2e13f[_0xffdd('0x23')][_0xffdd('0x25')]);return _0x73ac85(_0xd2e13f[_0xffdd('0x23')]['message']);}else{logger[_0xffdd('0x1f')](_0xffdd('0x24'),_0x354629,'request\x20sent');_0x73ac85(_0xd2e13f[_0xffdd('0x26')]['message']);}})[_0xffdd('0x27')](function(_0x1850d2){logger['error'](_0xffdd('0x24'),_0x354629,_0x1850d2);_0x20bda4(_0x1850d2);});});}function respondWithStatusCode(_0x104f84,_0x176799){_0x176799=_0x176799||0xcc;return function(_0x40a203){if(_0x40a203){return _0x104f84[_0xffdd('0x28')](_0x176799);}return _0x104f84['status'](_0x176799)['end']();};}function respondWithResult(_0x1edd4f,_0x5f08d7){_0x5f08d7=_0x5f08d7||0xc8;return function(_0x516827){if(_0x516827){return _0x1edd4f[_0xffdd('0x29')](_0x5f08d7)['json'](_0x516827);}};}function respondWithFilteredResult(_0x1b43da,_0x492dd2){return function(_0x5ddba7){if(_0x5ddba7){var _0x54b662=_0x5ddba7[_0xffdd('0x2a')],_0x334880=_0x492dd2[_0xffdd('0x2b')],_0x201051=_0x492dd2['offset']+_0x492dd2['limit'],_0x3a3673;if(_0x201051>=_0x54b662){_0x201051=_0x54b662;_0x3a3673=0xc8;}else{_0x3a3673=0xce;}_0x1b43da[_0xffdd('0x29')](_0x3a3673);return _0x1b43da[_0xffdd('0x2c')](_0xffdd('0x2d'),_0x334880+'-'+_0x201051+'/'+_0x54b662)['json'](_0x5ddba7);}return null;};}function patchUpdates(_0x46188e){return function(_0x40c99b){try{jsonpatch[_0xffdd('0x2e')](_0x40c99b,_0x46188e,!![]);}catch(_0x4c395c){return BPromise[_0xffdd('0x2f')](_0x4c395c);}return _0x40c99b['save']();};}function saveUpdates(_0x250b2d,_0xc244f5){return function(_0x3ba786){if(_0x3ba786){return _0x3ba786['update'](_0x250b2d)['then'](function(_0x459926){return _0x459926;});}return null;};}function removeEntity(_0x51b470,_0x200ca1){return function(_0x2d2884){if(_0x2d2884){return _0x2d2884[_0xffdd('0x30')]()[_0xffdd('0x1e')](function(){_0x51b470['status'](0xcc)[_0xffdd('0x31')]();});}};}function handleEntityNotFound(_0x2898fe,_0x30df6c){return function(_0x350cfb){if(!_0x350cfb){_0x2898fe['sendStatus'](0x194);}return _0x350cfb;};}function handleError(_0x203df5,_0x386867){_0x386867=_0x386867||0x1f4;return function(_0x2b9ea6){logger[_0xffdd('0x23')](_0x2b9ea6[_0xffdd('0x32')]);if(_0x2b9ea6[_0xffdd('0x33')]){delete _0x2b9ea6['name'];}_0x203df5[_0xffdd('0x29')](_0x386867)[_0xffdd('0x34')](_0x2b9ea6);};}exports['index']=function(_0x216181,_0x49a139){var _0x2edd91={},_0x2d81b8={},_0x2975e4={'count':0x0,'rows':[]};var _0x374736=_[_0xffdd('0x35')](db[_0xffdd('0x36')][_0xffdd('0x37')],function(_0x3b5a1d){return{'name':_0x3b5a1d[_0xffdd('0x38')],'type':_0x3b5a1d['type'][_0xffdd('0x39')]};});_0x2d81b8[_0xffdd('0x3a')]=_[_0xffdd('0x35')](_0x374736,'name');_0x2d81b8[_0xffdd('0x3b')]=_[_0xffdd('0x3c')](_0x216181[_0xffdd('0x3b')]);_0x2d81b8[_0xffdd('0x3d')]=_[_0xffdd('0x3e')](_0x2d81b8[_0xffdd('0x3a')],_0x2d81b8['query']);_0x2edd91[_0xffdd('0x3f')]=_[_0xffdd('0x3e')](_0x2d81b8[_0xffdd('0x3a')],qs['fields'](_0x216181[_0xffdd('0x3b')][_0xffdd('0x40')]));_0x2edd91[_0xffdd('0x3f')]=_0x2edd91['attributes'][_0xffdd('0x41')]?_0x2edd91[_0xffdd('0x3f')]:_0x2d81b8[_0xffdd('0x3a')];if(!_0x216181[_0xffdd('0x3b')][_0xffdd('0x42')](_0xffdd('0x43'))){_0x2edd91[_0xffdd('0x44')]=qs[_0xffdd('0x44')](_0x216181[_0xffdd('0x3b')][_0xffdd('0x44')]);_0x2edd91[_0xffdd('0x2b')]=qs['offset'](_0x216181[_0xffdd('0x3b')][_0xffdd('0x2b')]);}_0x2edd91[_0xffdd('0x45')]=qs[_0xffdd('0x46')](_0x216181['query'][_0xffdd('0x46')]);_0x2edd91[_0xffdd('0x47')]=qs[_0xffdd('0x3d')](_[_0xffdd('0x48')](_0x216181[_0xffdd('0x3b')],_0x2d81b8[_0xffdd('0x3d')]),_0x374736);if(_0x216181['query'][_0xffdd('0x49')]){_0x2edd91[_0xffdd('0x47')]=_[_0xffdd('0x4a')](_0x2edd91[_0xffdd('0x47')],{'$or':_[_0xffdd('0x35')](_0x374736,function(_0x1c2868){if(_0x1c2868[_0xffdd('0x4b')]!==_0xffdd('0x4c')){var _0x1fd521={};_0x1fd521[_0x1c2868[_0xffdd('0x33')]]={'$like':'%'+_0x216181[_0xffdd('0x3b')][_0xffdd('0x49')]+'%'};return _0x1fd521;}})});}_0x2edd91=_['merge']({},_0x2edd91,_0x216181['options']);var _0x1e5398={'where':_0x2edd91[_0xffdd('0x47')]};return db[_0xffdd('0x36')][_0xffdd('0x2a')](_0x1e5398)[_0xffdd('0x1e')](function(_0x3aef56){_0x2975e4[_0xffdd('0x2a')]=_0x3aef56;if(_0x216181[_0xffdd('0x3b')][_0xffdd('0x4d')]){_0x2edd91[_0xffdd('0x4e')]=[{'all':!![]}];}return db[_0xffdd('0x36')][_0xffdd('0x4f')](_0x2edd91);})['then'](function(_0x575102){_0x2975e4[_0xffdd('0x50')]=_0x575102;return _0x2975e4;})['then'](respondWithFilteredResult(_0x49a139,_0x2edd91))[_0xffdd('0x27')](handleError(_0x49a139,null));};exports[_0xffdd('0x51')]=function(_0x498b0c,_0xd49d40){var _0x2628b0={'raw':![],'where':{'id':_0x498b0c[_0xffdd('0x52')]['id']}},_0x5cc2ca={};_0x5cc2ca['model']=_[_0xffdd('0x3c')](db[_0xffdd('0x36')][_0xffdd('0x37')]);_0x5cc2ca[_0xffdd('0x3b')]=_[_0xffdd('0x3c')](_0x498b0c[_0xffdd('0x3b')]);_0x5cc2ca[_0xffdd('0x3d')]=_['intersection'](_0x5cc2ca[_0xffdd('0x3a')],_0x5cc2ca[_0xffdd('0x3b')]);_0x2628b0[_0xffdd('0x3f')]=_[_0xffdd('0x3e')](_0x5cc2ca[_0xffdd('0x3a')],qs['fields'](_0x498b0c[_0xffdd('0x3b')]['fields']));_0x2628b0[_0xffdd('0x3f')]=_0x2628b0[_0xffdd('0x3f')][_0xffdd('0x41')]?_0x2628b0['attributes']:_0x5cc2ca[_0xffdd('0x3a')];if(_0x498b0c[_0xffdd('0x3b')][_0xffdd('0x4d')]){_0x2628b0[_0xffdd('0x4e')]=[{'all':!![]}];}_0x2628b0=_[_0xffdd('0x4a')]({},_0x2628b0,_0x498b0c['options']);return db[_0xffdd('0x36')][_0xffdd('0x53')](_0x2628b0)[_0xffdd('0x1e')](handleEntityNotFound(_0xd49d40,null))[_0xffdd('0x1e')](respondWithResult(_0xd49d40,null))[_0xffdd('0x27')](handleError(_0xd49d40,null));};exports['create']=function(_0x3ffa81,_0x9bb698){return db[_0xffdd('0x36')][_0xffdd('0x54')](_0x3ffa81[_0xffdd('0x55')],{})[_0xffdd('0x1e')](respondWithResult(_0x9bb698,0xc9))[_0xffdd('0x27')](handleError(_0x9bb698,null));};exports['update']=function(_0x226d74,_0x187a8a){if(_0x226d74[_0xffdd('0x55')]['id']){delete _0x226d74[_0xffdd('0x55')]['id'];}return db['VtigerAccount'][_0xffdd('0x53')]({'where':{'id':_0x226d74['params']['id']}})[_0xffdd('0x1e')](handleEntityNotFound(_0x187a8a,null))[_0xffdd('0x1e')](saveUpdates(_0x226d74['body'],null))['then'](respondWithResult(_0x187a8a,null))['catch'](handleError(_0x187a8a,null));};exports['destroy']=function(_0x19d471,_0x4745d6){return db[_0xffdd('0x36')][_0xffdd('0x53')]({'where':{'id':_0x19d471['params']['id']}})['then'](handleEntityNotFound(_0x4745d6,null))[_0xffdd('0x1e')](removeEntity(_0x4745d6,null))[_0xffdd('0x27')](handleError(_0x4745d6,null));};exports[_0xffdd('0x56')]=function(_0x16e885,_0x30f381,_0x9778d5){var _0x322514={};var _0x4e5e3b={};var _0x27046e;var _0x3f6d60;return db['VtigerAccount'][_0xffdd('0x57')]({'where':{'id':_0x16e885[_0xffdd('0x52')]['id']}})[_0xffdd('0x1e')](handleEntityNotFound(_0x30f381,null))[_0xffdd('0x1e')](function(_0x2af024){if(_0x2af024){_0x27046e=_0x2af024;_0x4e5e3b[_0xffdd('0x3a')]=_['keys'](db[_0xffdd('0x58')][_0xffdd('0x37')]);_0x4e5e3b[_0xffdd('0x3b')]=_['keys'](_0x16e885[_0xffdd('0x3b')]);_0x4e5e3b[_0xffdd('0x3d')]=_[_0xffdd('0x3e')](_0x4e5e3b[_0xffdd('0x3a')],_0x4e5e3b[_0xffdd('0x3b')]);_0x322514['attributes']=_['intersection'](_0x4e5e3b[_0xffdd('0x3a')],qs['fields'](_0x16e885[_0xffdd('0x3b')][_0xffdd('0x40')]));_0x322514[_0xffdd('0x3f')]=_0x322514[_0xffdd('0x3f')][_0xffdd('0x41')]?_0x322514[_0xffdd('0x3f')]:_0x4e5e3b[_0xffdd('0x3a')];_0x322514[_0xffdd('0x45')]=qs[_0xffdd('0x46')](_0x16e885['query'][_0xffdd('0x46')]);_0x322514['where']=qs[_0xffdd('0x3d')](_['pick'](_0x16e885['query'],_0x4e5e3b[_0xffdd('0x3d')]));if(_0x16e885[_0xffdd('0x3b')][_0xffdd('0x49')]){_0x322514[_0xffdd('0x47')]=_[_0xffdd('0x4a')](_0x322514['where'],{'$or':_['map'](_0x322514[_0xffdd('0x3f')],function(_0x5d6b74){var _0x5d16bb={};_0x5d16bb[_0x5d6b74]={'$like':'%'+_0x16e885[_0xffdd('0x3b')][_0xffdd('0x49')]+'%'};return _0x5d16bb;})});}_0x322514=_[_0xffdd('0x4a')]({},_0x322514,_0x16e885[_0xffdd('0x59')]);return _0x27046e[_0xffdd('0x56')](_0x322514);}})[_0xffdd('0x1e')](function(_0x5ba559){if(_0x5ba559){_0x3f6d60=_0x5ba559['length'];if(!_0x16e885[_0xffdd('0x3b')][_0xffdd('0x42')]('nolimit')){_0x322514[_0xffdd('0x44')]=qs[_0xffdd('0x44')](_0x16e885[_0xffdd('0x3b')][_0xffdd('0x44')]);_0x322514[_0xffdd('0x2b')]=qs[_0xffdd('0x2b')](_0x16e885[_0xffdd('0x3b')][_0xffdd('0x2b')]);}return _0x27046e[_0xffdd('0x56')](_0x322514);}})[_0xffdd('0x1e')](function(_0x34a7bc){if(_0x34a7bc){return _0x34a7bc?{'count':_0x3f6d60,'rows':_0x34a7bc}:null;}})['then'](respondWithResult(_0x30f381,null))[_0xffdd('0x27')](handleError(_0x30f381,null));};exports[_0xffdd('0x5a')]=function(_0x5dc982,_0x58c976,_0x206e67){if(_0x5dc982[_0xffdd('0x55')]['id']){delete _0x5dc982[_0xffdd('0x55')]['id'];}return db[_0xffdd('0x36')][_0xffdd('0x57')]({'where':{'id':_0x5dc982[_0xffdd('0x52')]['id']}})[_0xffdd('0x1e')](handleEntityNotFound(_0x58c976,null))[_0xffdd('0x1e')](function(_0x5c59e0){if(_0x5c59e0){_0x5dc982[_0xffdd('0x55')][_0xffdd('0x5b')]=_0x5c59e0['id'];_0x5dc982[_0xffdd('0x55')][_0xffdd('0x5c')]=integrations['getSubjects'](_0x5dc982[_0xffdd('0x55')][_0xffdd('0x5d')],_0x5dc982[_0xffdd('0x55')][_0xffdd('0x4b')]);_0x5dc982['body']['Descriptions']=integrations[_0xffdd('0x5e')](_0x5dc982['body'][_0xffdd('0x5d')],_0x5dc982[_0xffdd('0x55')][_0xffdd('0x4b')]);return db[_0xffdd('0x58')][_0xffdd('0x54')](_0x5dc982['body'],{'include':[{'model':db['VtigerField'],'as':'Subjects'},{'model':db[_0xffdd('0x5f')],'as':_0xffdd('0x60')}]});}return null;})[_0xffdd('0x1e')](respondWithResult(_0x58c976,null))['catch'](handleError(_0x58c976,null));};var md5=require(_0xffdd('0x61'));exports[_0xffdd('0x62')]=function(_0x4ce0a4,_0x38e3f9,_0x5abc9a){var _0x53871d=null;var _0x468549=null;var _0xf90d01=null;var _0x4f9156=null;var _0x4daca7='';return db[_0xffdd('0x36')][_0xffdd('0x57')]({'where':{'id':_0x4ce0a4[_0xffdd('0x52')]['id']},'attributes':['id',_0xffdd('0x33'),_0xffdd('0x63'),_0xffdd('0x64'),_0xffdd('0x65'),_0xffdd('0x66'),_0xffdd('0x67'),'accessKey']})[_0xffdd('0x1e')](handleEntityNotFound(_0x38e3f9,null))[_0xffdd('0x1e')](function(_0x193842){if(_0x193842){_0x53871d=_0x193842[_0xffdd('0x63')];_0x468549=_0x193842['accessKey'];_0xf90d01=_0x193842['moduleName'];_0x4daca7=_0x193842[_0xffdd('0x66')];var _0x8c5777=_0x4daca7[_0xffdd('0x68')](-0x1);if(_0x8c5777==='/'){_0x4daca7=_0x4daca7[_0xffdd('0x69')](0x0,_0x4daca7['lastIndexOf'](_0x8c5777));}_0x4f9156=util[_0xffdd('0x6a')](_0xffdd('0x6b'),_0x4daca7);var _0x3a9011={'method':_0xffdd('0x6c'),'uri':_0x4f9156,'qs':{'operation':'getchallenge','username':_0x193842[_0xffdd('0x63')]},'json':!![]};return rp(_0x3a9011);}})[_0xffdd('0x1e')](function(_0x315263){if(_0x315263[_0xffdd('0x6d')]){var _0x56caaf={'method':_0xffdd('0x6e'),'uri':_0x4f9156,'form':{'operation':_0xffdd('0x6f'),'username':_0x53871d,'accessKey':md5(_0x315263[_0xffdd('0x26')][_0xffdd('0x70')]+_0x468549)},'json':!![]};return rp(_0x56caaf);}})[_0xffdd('0x1e')](function(_0x4bacef){if(_0x4bacef[_0xffdd('0x6d')]){var _0x1e1ee4={'method':_0xffdd('0x6c'),'uri':_0x4f9156,'qs':{'operation':'describe','username':_0x53871d,'sessionName':_0x4bacef[_0xffdd('0x26')][_0xffdd('0x71')],'elementType':_0xf90d01},'json':!![]};return rp(_0x1e1ee4);}})[_0xffdd('0x1e')](function(_0x3fcc35){if(_0x3fcc35['success']){var _0x1b47a1=[_0xffdd('0x72'),'reference','owner'];_[_0xffdd('0x73')](_0x3fcc35[_0xffdd('0x26')]['fields'],function(_0xbe4987){return _0x1b47a1[_0xffdd('0x74')](_0xbe4987[_0xffdd('0x4b')]['name']);});_[_0xffdd('0x73')](_0x3fcc35[_0xffdd('0x26')][_0xffdd('0x40')],function(_0x41c3f9){return _0x41c3f9[_0xffdd('0x75')]===_0xffdd('0x76');});return{'count':_0x3fcc35['result'][_0xffdd('0x40')][_0xffdd('0x41')],'rows':_[_0xffdd('0x35')](_0x3fcc35[_0xffdd('0x26')][_0xffdd('0x40')],function(_0x4ec4bd){return{'id':_0x4ec4bd[_0xffdd('0x33')],'name':_0x4ec4bd[_0xffdd('0x77')],'custom':_['startsWith'](_0x4ec4bd[_0xffdd('0x33')],_0xffdd('0x78'))?!![]:![],'options':_0x4ec4bd[_0xffdd('0x4b')][_0xffdd('0x33')]==='picklist'&&_0x4ec4bd[_0xffdd('0x4b')][_0xffdd('0x79')]['length']>0x0?_[_0xffdd('0x35')](_0x4ec4bd[_0xffdd('0x4b')][_0xffdd('0x79')],function(_0x24c75a){return{'name':_0x24c75a[_0xffdd('0x77')],'value':_0x24c75a[_0xffdd('0x7a')]};}):[]};})};}})[_0xffdd('0x1e')](respondWithResult(_0x38e3f9,null))[_0xffdd('0x27')](function(_0x248c00){console[_0xffdd('0x7b')](_0xffdd('0x7c')+_0x248c00);var _0x17ef07=_0x4ce0a4['query']['test']?0x1f4:_0x248c00[_0xffdd('0x7d')]||0x1f4;logger[_0xffdd('0x23')](_0xffdd('0x7e'),'getFields',_0x17ef07,JSON['stringify'](_0x248c00));delete _0x248c00[_0xffdd('0x33')];if(_0x17ef07===0x191){_0x17ef07=0x190;}_0x38e3f9[_0xffdd('0x29')](_0x17ef07)[_0xffdd('0x34')](_0x4ce0a4['query'][_0xffdd('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x248c00[_0xffdd('0x7d')]}:_0x248c00);});};
\ No newline at end of file
+var _0xb91d=['sort','where','filter','map','merge','options','includeAll','findAll','show','keys','rawAttributes','include','find','create','body','params','findOne','VtigerConfiguration','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','username','description','remoteUri','accessKey','moduleName','slice','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','name','index','VtigerAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb91d,0x1c6));var _0xdb91=function(_0x30c2ae,_0x4c98a2){_0x30c2ae=_0x30c2ae-0x0;var _0x1ee1cc=_0xb91d[_0x30c2ae];return _0x1ee1cc;};'use strict';var pdf=require(_0xdb91('0x0'));var emlformat=require(_0xdb91('0x1'));var rimraf=require(_0xdb91('0x2'));var zipdir=require(_0xdb91('0x3'));var jsonpatch=require(_0xdb91('0x4'));var rp=require(_0xdb91('0x5'));var moment=require(_0xdb91('0x6'));var BPromise=require(_0xdb91('0x7'));var Mustache=require('mustache');var util=require(_0xdb91('0x8'));var path=require('path');var sox=require(_0xdb91('0x9'));var csv=require(_0xdb91('0xa'));var ejs=require(_0xdb91('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdb91('0xc'));var crypto=require(_0xdb91('0xd'));var jsforce=require(_0xdb91('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdb91('0xf'));var Papa=require('papaparse');var Redis=require(_0xdb91('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdb91('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdb91('0x12'));var utils=require('../../config/utils');var config=require(_0xdb91('0x13'));var db=require(_0xdb91('0x14'))['db'];var integrations=require(_0xdb91('0x15'));var jayson=require(_0xdb91('0x16'));var client=jayson[_0xdb91('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0xf2e3f0,_0x2d9ea8,_0x14e51b){if(_0x14e51b){var _0x139ad4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x139ad4[_0xdb91('0x18')](_0x2d9ea8)){return _0xf2e3f0;}else{throw new db[(_0xdb91('0x19'))][(_0xdb91('0x1a'))](_0xdb91('0x1b'));}}else{return _0xf2e3f0;}}function respondWithRpcPromise(_0x35b705,_0x2cb9b8,_0x15600f,_0x46ecb8){return new BPromise(function(_0x519703,_0x310f93){var _0x184a95=_0x46ecb8||client;return _0x184a95['request'](_0x35b705,_0x15600f)[_0xdb91('0x1c')](function(_0x1a3031){logger['info'](_0xdb91('0x1d'),_0x2cb9b8,'request\x20sent');logger[_0xdb91('0x1e')](_0xdb91('0x1f'),_0x2cb9b8,_0xdb91('0x20'),JSON['stringify'](_0x1a3031));if(_0x1a3031[_0xdb91('0x21')]){if(_0x1a3031[_0xdb91('0x21')][_0xdb91('0x22')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x2cb9b8,_0x1a3031['error'][_0xdb91('0x23')]);return _0x310f93(_0x1a3031[_0xdb91('0x21')][_0xdb91('0x23')]);}logger[_0xdb91('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x2cb9b8,_0x1a3031[_0xdb91('0x21')][_0xdb91('0x23')]);return _0x519703(_0x1a3031[_0xdb91('0x21')][_0xdb91('0x23')]);}else{logger['info'](_0xdb91('0x1d'),_0x2cb9b8,'request\x20sent');_0x519703(_0x1a3031[_0xdb91('0x24')][_0xdb91('0x23')]);}})[_0xdb91('0x25')](function(_0x140ffd){logger[_0xdb91('0x21')](_0xdb91('0x1d'),_0x2cb9b8,_0x140ffd);_0x310f93(_0x140ffd);});});}function respondWithStatusCode(_0x37d676,_0x5d1daa){_0x5d1daa=_0x5d1daa||0xcc;return function(_0x5a5096){if(_0x5a5096){return _0x37d676[_0xdb91('0x26')](_0x5d1daa);}return _0x37d676[_0xdb91('0x27')](_0x5d1daa)[_0xdb91('0x28')]();};}function respondWithResult(_0x2e7438,_0x23ca08){_0x23ca08=_0x23ca08||0xc8;return function(_0x369093){if(_0x369093){return _0x2e7438[_0xdb91('0x27')](_0x23ca08)[_0xdb91('0x29')](_0x369093);}};}function respondWithFilteredResult(_0x258062,_0x396280){return function(_0x49211a){if(_0x49211a){var _0x316319=_0x49211a[_0xdb91('0x2a')],_0x3a164a=_0x396280[_0xdb91('0x2b')],_0x573b09=_0x396280[_0xdb91('0x2b')]+_0x396280[_0xdb91('0x2c')],_0x2036ac;if(_0x573b09>=_0x316319){_0x573b09=_0x316319;_0x2036ac=0xc8;}else{_0x2036ac=0xce;}_0x258062['status'](_0x2036ac);return _0x258062['set'](_0xdb91('0x2d'),_0x3a164a+'-'+_0x573b09+'/'+_0x316319)[_0xdb91('0x29')](_0x49211a);}return null;};}function patchUpdates(_0x41716e){return function(_0x4a322c){try{jsonpatch[_0xdb91('0x2e')](_0x4a322c,_0x41716e,!![]);}catch(_0x3d9371){return BPromise[_0xdb91('0x2f')](_0x3d9371);}return _0x4a322c[_0xdb91('0x30')]();};}function saveUpdates(_0x51116c,_0xdf662e){return function(_0xc1863e){if(_0xc1863e){return _0xc1863e[_0xdb91('0x31')](_0x51116c)[_0xdb91('0x1c')](function(_0x5bd3b4){return _0x5bd3b4;});}return null;};}function removeEntity(_0x30dc0d,_0x4988c7){return function(_0x12d5d2){if(_0x12d5d2){return _0x12d5d2[_0xdb91('0x32')]()[_0xdb91('0x1c')](function(){_0x30dc0d[_0xdb91('0x27')](0xcc)[_0xdb91('0x28')]();});}};}function handleEntityNotFound(_0x4b70b6,_0x3ecc16){return function(_0x2ae36a){if(!_0x2ae36a){_0x4b70b6[_0xdb91('0x26')](0x194);}return _0x2ae36a;};}function handleError(_0xc41397,_0x2871b7){_0x2871b7=_0x2871b7||0x1f4;return function(_0x408d45){logger[_0xdb91('0x21')](_0x408d45['stack']);if(_0x408d45[_0xdb91('0x33')]){delete _0x408d45[_0xdb91('0x33')];}_0xc41397['status'](_0x2871b7)['send'](_0x408d45);};}exports[_0xdb91('0x34')]=function(_0x1f028f,_0x4e4d27){var _0x763a6e={},_0x3a0611={},_0x58c5a5={'count':0x0,'rows':[]};var _0xe1f72d=_['map'](db[_0xdb91('0x35')]['rawAttributes'],function(_0x9c9784){return{'name':_0x9c9784[_0xdb91('0x36')],'type':_0x9c9784[_0xdb91('0x37')][_0xdb91('0x38')]};});_0x3a0611[_0xdb91('0x39')]=_['map'](_0xe1f72d,_0xdb91('0x33'));_0x3a0611[_0xdb91('0x3a')]=_['keys'](_0x1f028f[_0xdb91('0x3a')]);_0x3a0611[_0xdb91('0x3b')]=_[_0xdb91('0x3c')](_0x3a0611[_0xdb91('0x39')],_0x3a0611[_0xdb91('0x3a')]);_0x763a6e[_0xdb91('0x3d')]=_[_0xdb91('0x3c')](_0x3a0611[_0xdb91('0x39')],qs[_0xdb91('0x3e')](_0x1f028f[_0xdb91('0x3a')][_0xdb91('0x3e')]));_0x763a6e['attributes']=_0x763a6e['attributes'][_0xdb91('0x3f')]?_0x763a6e['attributes']:_0x3a0611[_0xdb91('0x39')];if(!_0x1f028f[_0xdb91('0x3a')][_0xdb91('0x40')]('nolimit')){_0x763a6e[_0xdb91('0x2c')]=qs[_0xdb91('0x2c')](_0x1f028f['query'][_0xdb91('0x2c')]);_0x763a6e[_0xdb91('0x2b')]=qs[_0xdb91('0x2b')](_0x1f028f[_0xdb91('0x3a')][_0xdb91('0x2b')]);}_0x763a6e[_0xdb91('0x41')]=qs[_0xdb91('0x42')](_0x1f028f[_0xdb91('0x3a')][_0xdb91('0x42')]);_0x763a6e[_0xdb91('0x43')]=qs[_0xdb91('0x3b')](_['pick'](_0x1f028f[_0xdb91('0x3a')],_0x3a0611[_0xdb91('0x3b')]),_0xe1f72d);if(_0x1f028f['query'][_0xdb91('0x44')]){_0x763a6e['where']=_['merge'](_0x763a6e[_0xdb91('0x43')],{'$or':_[_0xdb91('0x45')](_0xe1f72d,function(_0x3a6d8f){if(_0x3a6d8f[_0xdb91('0x37')]!=='VIRTUAL'){var _0x1fc8b3={};_0x1fc8b3[_0x3a6d8f[_0xdb91('0x33')]]={'$like':'%'+_0x1f028f['query'][_0xdb91('0x44')]+'%'};return _0x1fc8b3;}})});}_0x763a6e=_[_0xdb91('0x46')]({},_0x763a6e,_0x1f028f[_0xdb91('0x47')]);var _0x4f5cff={'where':_0x763a6e[_0xdb91('0x43')]};return db['VtigerAccount'][_0xdb91('0x2a')](_0x4f5cff)[_0xdb91('0x1c')](function(_0x5d3011){_0x58c5a5[_0xdb91('0x2a')]=_0x5d3011;if(_0x1f028f[_0xdb91('0x3a')][_0xdb91('0x48')]){_0x763a6e['include']=[{'all':!![]}];}return db[_0xdb91('0x35')][_0xdb91('0x49')](_0x763a6e);})[_0xdb91('0x1c')](function(_0x7be19){_0x58c5a5['rows']=_0x7be19;return _0x58c5a5;})[_0xdb91('0x1c')](respondWithFilteredResult(_0x4e4d27,_0x763a6e))[_0xdb91('0x25')](handleError(_0x4e4d27,null));};exports[_0xdb91('0x4a')]=function(_0x12cd80,_0x153106){var _0xbd9733={'raw':![],'where':{'id':_0x12cd80['params']['id']}},_0x556efb={};_0x556efb['model']=_[_0xdb91('0x4b')](db[_0xdb91('0x35')][_0xdb91('0x4c')]);_0x556efb[_0xdb91('0x3a')]=_['keys'](_0x12cd80[_0xdb91('0x3a')]);_0x556efb[_0xdb91('0x3b')]=_['intersection'](_0x556efb[_0xdb91('0x39')],_0x556efb['query']);_0xbd9733[_0xdb91('0x3d')]=_[_0xdb91('0x3c')](_0x556efb[_0xdb91('0x39')],qs[_0xdb91('0x3e')](_0x12cd80[_0xdb91('0x3a')][_0xdb91('0x3e')]));_0xbd9733[_0xdb91('0x3d')]=_0xbd9733['attributes'][_0xdb91('0x3f')]?_0xbd9733[_0xdb91('0x3d')]:_0x556efb[_0xdb91('0x39')];if(_0x12cd80['query'][_0xdb91('0x48')]){_0xbd9733[_0xdb91('0x4d')]=[{'all':!![]}];}_0xbd9733=_[_0xdb91('0x46')]({},_0xbd9733,_0x12cd80[_0xdb91('0x47')]);return db[_0xdb91('0x35')][_0xdb91('0x4e')](_0xbd9733)[_0xdb91('0x1c')](handleEntityNotFound(_0x153106,null))[_0xdb91('0x1c')](respondWithResult(_0x153106,null))['catch'](handleError(_0x153106,null));};exports[_0xdb91('0x4f')]=function(_0xeab624,_0x2f6601){return db[_0xdb91('0x35')][_0xdb91('0x4f')](_0xeab624[_0xdb91('0x50')],{})['then'](respondWithResult(_0x2f6601,0xc9))[_0xdb91('0x25')](handleError(_0x2f6601,null));};exports['update']=function(_0x38fc52,_0x345770){if(_0x38fc52[_0xdb91('0x50')]['id']){delete _0x38fc52['body']['id'];}return db['VtigerAccount'][_0xdb91('0x4e')]({'where':{'id':_0x38fc52[_0xdb91('0x51')]['id']}})[_0xdb91('0x1c')](handleEntityNotFound(_0x345770,null))[_0xdb91('0x1c')](saveUpdates(_0x38fc52['body'],null))[_0xdb91('0x1c')](respondWithResult(_0x345770,null))[_0xdb91('0x25')](handleError(_0x345770,null));};exports[_0xdb91('0x32')]=function(_0x3ffad2,_0x450472){return db[_0xdb91('0x35')]['find']({'where':{'id':_0x3ffad2[_0xdb91('0x51')]['id']}})[_0xdb91('0x1c')](handleEntityNotFound(_0x450472,null))[_0xdb91('0x1c')](removeEntity(_0x450472,null))[_0xdb91('0x25')](handleError(_0x450472,null));};exports['getConfigurations']=function(_0x534b86,_0x4a3862,_0x9e3582){var _0x82d9b={};var _0x1c7b86={};var _0xe95c0f;var _0x6d3478;return db['VtigerAccount'][_0xdb91('0x52')]({'where':{'id':_0x534b86[_0xdb91('0x51')]['id']}})[_0xdb91('0x1c')](handleEntityNotFound(_0x4a3862,null))[_0xdb91('0x1c')](function(_0x550a89){if(_0x550a89){_0xe95c0f=_0x550a89;_0x1c7b86[_0xdb91('0x39')]=_[_0xdb91('0x4b')](db[_0xdb91('0x53')]['rawAttributes']);_0x1c7b86[_0xdb91('0x3a')]=_[_0xdb91('0x4b')](_0x534b86['query']);_0x1c7b86[_0xdb91('0x3b')]=_[_0xdb91('0x3c')](_0x1c7b86[_0xdb91('0x39')],_0x1c7b86[_0xdb91('0x3a')]);_0x82d9b[_0xdb91('0x3d')]=_[_0xdb91('0x3c')](_0x1c7b86[_0xdb91('0x39')],qs[_0xdb91('0x3e')](_0x534b86[_0xdb91('0x3a')][_0xdb91('0x3e')]));_0x82d9b[_0xdb91('0x3d')]=_0x82d9b[_0xdb91('0x3d')][_0xdb91('0x3f')]?_0x82d9b[_0xdb91('0x3d')]:_0x1c7b86[_0xdb91('0x39')];_0x82d9b[_0xdb91('0x41')]=qs['sort'](_0x534b86[_0xdb91('0x3a')]['sort']);_0x82d9b[_0xdb91('0x43')]=qs[_0xdb91('0x3b')](_[_0xdb91('0x54')](_0x534b86[_0xdb91('0x3a')],_0x1c7b86['filters']));if(_0x534b86[_0xdb91('0x3a')][_0xdb91('0x44')]){_0x82d9b[_0xdb91('0x43')]=_[_0xdb91('0x46')](_0x82d9b[_0xdb91('0x43')],{'$or':_[_0xdb91('0x45')](_0x82d9b['attributes'],function(_0x6f0bf5){var _0x5beb12={};_0x5beb12[_0x6f0bf5]={'$like':'%'+_0x534b86[_0xdb91('0x3a')][_0xdb91('0x44')]+'%'};return _0x5beb12;})});}_0x82d9b=_[_0xdb91('0x46')]({},_0x82d9b,_0x534b86[_0xdb91('0x47')]);return _0xe95c0f['getConfigurations'](_0x82d9b);}})[_0xdb91('0x1c')](function(_0x365305){if(_0x365305){_0x6d3478=_0x365305[_0xdb91('0x3f')];if(!_0x534b86[_0xdb91('0x3a')][_0xdb91('0x40')]('nolimit')){_0x82d9b[_0xdb91('0x2c')]=qs[_0xdb91('0x2c')](_0x534b86['query']['limit']);_0x82d9b[_0xdb91('0x2b')]=qs[_0xdb91('0x2b')](_0x534b86[_0xdb91('0x3a')][_0xdb91('0x2b')]);}return _0xe95c0f[_0xdb91('0x55')](_0x82d9b);}})['then'](function(_0x34c9c6){if(_0x34c9c6){return _0x34c9c6?{'count':_0x6d3478,'rows':_0x34c9c6}:null;}})[_0xdb91('0x1c')](respondWithResult(_0x4a3862,null))[_0xdb91('0x25')](handleError(_0x4a3862,null));};exports[_0xdb91('0x56')]=function(_0x531faf,_0x1b307a,_0x41889b){if(_0x531faf[_0xdb91('0x50')]['id']){delete _0x531faf[_0xdb91('0x50')]['id'];}return db[_0xdb91('0x35')]['findOne']({'where':{'id':_0x531faf['params']['id']}})[_0xdb91('0x1c')](handleEntityNotFound(_0x1b307a,null))[_0xdb91('0x1c')](function(_0x57bc79){if(_0x57bc79){_0x531faf['body'][_0xdb91('0x57')]=_0x57bc79['id'];_0x531faf['body'][_0xdb91('0x58')]=integrations[_0xdb91('0x59')](_0x531faf[_0xdb91('0x50')][_0xdb91('0x5a')],_0x531faf['body'][_0xdb91('0x37')]);_0x531faf[_0xdb91('0x50')][_0xdb91('0x5b')]=integrations[_0xdb91('0x5c')](_0x531faf[_0xdb91('0x50')][_0xdb91('0x5a')],_0x531faf['body'][_0xdb91('0x37')]);return db[_0xdb91('0x53')][_0xdb91('0x4f')](_0x531faf[_0xdb91('0x50')],{'include':[{'model':db['VtigerField'],'as':_0xdb91('0x58')},{'model':db['VtigerField'],'as':_0xdb91('0x5b')}]});}return null;})['then'](respondWithResult(_0x1b307a,null))[_0xdb91('0x25')](handleError(_0x1b307a,null));};var md5=require('md5');exports[_0xdb91('0x5d')]=function(_0x5a4c3f,_0x33a3a8,_0x2c7159){var _0x4882d4=null;var _0x494c3e=null;var _0x200159=null;var _0x3f292b=null;var _0x4035a5='';return db[_0xdb91('0x35')][_0xdb91('0x52')]({'where':{'id':_0x5a4c3f[_0xdb91('0x51')]['id']},'attributes':['id',_0xdb91('0x33'),_0xdb91('0x5e'),_0xdb91('0x5f'),'moduleName',_0xdb91('0x60'),'serverUrl',_0xdb91('0x61')]})['then'](handleEntityNotFound(_0x33a3a8,null))['then'](function(_0x2e481f){if(_0x2e481f){_0x4882d4=_0x2e481f[_0xdb91('0x5e')];_0x494c3e=_0x2e481f[_0xdb91('0x61')];_0x200159=_0x2e481f[_0xdb91('0x62')];_0x4035a5=_0x2e481f[_0xdb91('0x60')];var _0x4ab1bd=_0x4035a5[_0xdb91('0x63')](-0x1);if(_0x4ab1bd==='/'){_0x4035a5=_0x4035a5['substring'](0x0,_0x4035a5['lastIndexOf'](_0x4ab1bd));}_0x3f292b=util[_0xdb91('0x64')](_0xdb91('0x65'),_0x4035a5);var _0x4093ce={'method':_0xdb91('0x66'),'uri':_0x3f292b,'qs':{'operation':_0xdb91('0x67'),'username':_0x2e481f[_0xdb91('0x5e')]},'json':!![]};return rp(_0x4093ce);}})[_0xdb91('0x1c')](function(_0x4aa9c9){if(_0x4aa9c9[_0xdb91('0x68')]){var _0x4b34c0={'method':_0xdb91('0x69'),'uri':_0x3f292b,'form':{'operation':_0xdb91('0x6a'),'username':_0x4882d4,'accessKey':md5(_0x4aa9c9[_0xdb91('0x24')][_0xdb91('0x6b')]+_0x494c3e)},'json':!![]};return rp(_0x4b34c0);}})[_0xdb91('0x1c')](function(_0x43254a){if(_0x43254a['success']){var _0x4f1f8e={'method':_0xdb91('0x66'),'uri':_0x3f292b,'qs':{'operation':_0xdb91('0x6c'),'username':_0x4882d4,'sessionName':_0x43254a[_0xdb91('0x24')][_0xdb91('0x6d')],'elementType':_0x200159},'json':!![]};return rp(_0x4f1f8e);}})[_0xdb91('0x1c')](function(_0x376b1c){if(_0x376b1c[_0xdb91('0x68')]){var _0x174523=[_0xdb91('0x6e'),_0xdb91('0x6f'),_0xdb91('0x70')];_[_0xdb91('0x71')](_0x376b1c['result'][_0xdb91('0x3e')],function(_0x4a8a38){return _0x174523[_0xdb91('0x72')](_0x4a8a38[_0xdb91('0x37')]['name']);});_[_0xdb91('0x71')](_0x376b1c[_0xdb91('0x24')][_0xdb91('0x3e')],function(_0x594278){return _0x594278[_0xdb91('0x73')]===_0xdb91('0x74');});return{'count':_0x376b1c['result'][_0xdb91('0x3e')][_0xdb91('0x3f')],'rows':_[_0xdb91('0x45')](_0x376b1c[_0xdb91('0x24')][_0xdb91('0x3e')],function(_0x1172e3){return{'id':_0x1172e3[_0xdb91('0x33')],'name':_0x1172e3['label'],'custom':_[_0xdb91('0x75')](_0x1172e3[_0xdb91('0x33')],_0xdb91('0x76'))?!![]:![],'options':_0x1172e3['type'][_0xdb91('0x33')]===_0xdb91('0x77')&&_0x1172e3[_0xdb91('0x37')]['picklistValues']['length']>0x0?_['map'](_0x1172e3[_0xdb91('0x37')][_0xdb91('0x78')],function(_0x42f2ff){return{'name':_0x42f2ff[_0xdb91('0x79')],'value':_0x42f2ff[_0xdb91('0x7a')]};}):[]};})};}})[_0xdb91('0x1c')](respondWithResult(_0x33a3a8,null))['catch'](function(_0x4de33f){console[_0xdb91('0x7b')](_0xdb91('0x7c')+_0x4de33f);var _0x4635d7=_0x5a4c3f[_0xdb91('0x3a')][_0xdb91('0x18')]?0x1f4:_0x4de33f[_0xdb91('0x7d')]||0x1f4;logger[_0xdb91('0x21')](_0xdb91('0x7e'),_0xdb91('0x5d'),_0x4635d7,JSON[_0xdb91('0x7f')](_0x4de33f));delete _0x4de33f[_0xdb91('0x33')];if(_0x4635d7===0x191){_0x4635d7=0x190;}_0x33a3a8[_0xdb91('0x27')](_0x4635d7)[_0xdb91('0x80')](_0x5a4c3f[_0xdb91('0x3a')][_0xdb91('0x18')]?{'message':_0xdb91('0x81'),'statusCode':_0x4de33f['statusCode']}:_0x4de33f);});};
\ No newline at end of file
index 5c898df..e90c3c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x216e=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x216e,0x15f));var _0xe216=function(_0x30d2af,_0x378716){_0x30d2af=_0x30d2af-0x0;var _0x2d1c42=_0x216e[_0x30d2af];return _0x2d1c42;};'use strict';var _=require(_0xe216('0x0'));var util=require('util');var logger=require(_0xe216('0x1'))(_0xe216('0x2'));var moment=require(_0xe216('0x3'));var BPromise=require('bluebird');var rp=require(_0xe216('0x4'));var fs=require('fs');var path=require(_0xe216('0x5'));var rimraf=require(_0xe216('0x6'));var config=require('../../config/environment');var attributes=require(_0xe216('0x7'));var integrations=require(_0xe216('0x8'));module[_0xe216('0x9')]=function(_0x2da533,_0x15bf15){return _0x2da533[_0xe216('0xa')](_0xe216('0xb'),attributes,{'tableName':_0xe216('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde9d=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x28788f,_0x5b62dc){var _0x2ad785=function(_0x9160a4){while(--_0x9160a4){_0x28788f['push'](_0x28788f['shift']());}};_0x2ad785(++_0x5b62dc);}(_0xde9d,0x156));var _0xdde9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde9d[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdde9('0x0'));var util=require(_0xdde9('0x1'));var logger=require(_0xdde9('0x2'))(_0xdde9('0x3'));var moment=require(_0xdde9('0x4'));var BPromise=require('bluebird');var rp=require(_0xdde9('0x5'));var fs=require('fs');var path=require(_0xdde9('0x6'));var rimraf=require(_0xdde9('0x7'));var config=require('../../config/environment');var attributes=require(_0xdde9('0x8'));var integrations=require(_0xdde9('0x9'));module[_0xdde9('0xa')]=function(_0x4c10e9,_0x289ccb){return _0x4c10e9[_0xdde9('0xb')](_0xdde9('0xc'),attributes,{'tableName':_0xdde9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 19929b4..b96b243 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e8d=['VtigerAccount','findAll','options','raw','attributes','limit','include','model','map','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','VtigerAccount,\x20%s,\x20%s','result','catch','GetVtigerAccount'];(function(_0x15da60,_0x3661df){var _0x2709bc=function(_0x242df2){while(--_0x242df2){_0x15da60['push'](_0x15da60['shift']());}};_0x2709bc(++_0x3661df);}(_0x0e8d,0xbf));var _0xd0e8=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x0e8d[_0x29d94e];return _0x106237;};'use strict';var _=require(_0xd0e8('0x0'));var util=require(_0xd0e8('0x1'));var moment=require(_0xd0e8('0x2'));var BPromise=require(_0xd0e8('0x3'));var rs=require(_0xd0e8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0e8('0x5'))['db'];var utils=require(_0xd0e8('0x6'));var logger=require(_0xd0e8('0x7'))('rpc');var config=require(_0xd0e8('0x8'));var jayson=require(_0xd0e8('0x9'));var client=jayson[_0xd0e8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f4174,_0x22291b,_0x4b8808){return new BPromise(function(_0x50bbee,_0x8b6ef){return client[_0xd0e8('0xb')](_0x1f4174,_0x4b8808)[_0xd0e8('0xc')](function(_0x8dc709){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x22291b,_0xd0e8('0xd'));logger[_0xd0e8('0xe')](_0xd0e8('0xf'),_0x22291b,_0xd0e8('0xd'),JSON[_0xd0e8('0x10')](_0x8dc709));if(_0x8dc709[_0xd0e8('0x11')]){if(_0x8dc709['error'][_0xd0e8('0x12')]===0x1f4){logger[_0xd0e8('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x22291b,_0x8dc709[_0xd0e8('0x11')][_0xd0e8('0x13')]);return _0x8b6ef(_0x8dc709[_0xd0e8('0x11')][_0xd0e8('0x13')]);}logger[_0xd0e8('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x22291b,_0x8dc709[_0xd0e8('0x11')][_0xd0e8('0x13')]);return _0x50bbee(_0x8dc709['error'][_0xd0e8('0x13')]);}else{logger[_0xd0e8('0x14')](_0xd0e8('0x15'),_0x22291b,_0xd0e8('0xd'));_0x50bbee(_0x8dc709[_0xd0e8('0x16')][_0xd0e8('0x13')]);}})[_0xd0e8('0x17')](function(_0x30eedd){logger[_0xd0e8('0x11')](_0xd0e8('0x15'),_0x22291b,_0x30eedd);_0x8b6ef(_0x30eedd);});});}exports[_0xd0e8('0x18')]=function(_0xe2f43d){var _0x219e00=this;return new Promise(function(_0x2d81a3,_0x5ad8e6){return db[_0xd0e8('0x19')][_0xd0e8('0x1a')]({'raw':_0xe2f43d[_0xd0e8('0x1b')]?_0xe2f43d['options'][_0xd0e8('0x1c')]===undefined?!![]:![]:!![],'where':_0xe2f43d[_0xd0e8('0x1b')]?_0xe2f43d[_0xd0e8('0x1b')]['where']||null:null,'attributes':_0xe2f43d['options']?_0xe2f43d[_0xd0e8('0x1b')][_0xd0e8('0x1d')]||null:null,'limit':_0xe2f43d[_0xd0e8('0x1b')]?_0xe2f43d[_0xd0e8('0x1b')][_0xd0e8('0x1e')]||null:null,'include':_0xe2f43d['options']?_0xe2f43d[_0xd0e8('0x1b')][_0xd0e8('0x1f')]?_['map'](_0xe2f43d['options'][_0xd0e8('0x1f')],function(_0x473964){return{'model':db[_0x473964[_0xd0e8('0x20')]],'as':_0x473964['as'],'attributes':_0x473964[_0xd0e8('0x1d')],'include':_0x473964[_0xd0e8('0x1f')]?_[_0xd0e8('0x21')](_0x473964[_0xd0e8('0x1f')],function(_0x5bf8b0){return{'model':db[_0x5bf8b0['model']],'as':_0x5bf8b0['as'],'attributes':_0x5bf8b0[_0xd0e8('0x1d')],'include':_0x5bf8b0[_0xd0e8('0x1f')]?_[_0xd0e8('0x21')](_0x5bf8b0[_0xd0e8('0x1f')],function(_0x25f7ce){return{'model':db[_0x25f7ce[_0xd0e8('0x20')]],'as':_0x25f7ce['as'],'attributes':_0x25f7ce['attributes']};}):[]};}):[]};}):[]:[]})[_0xd0e8('0xc')](function(_0x1adfd3){logger[_0xd0e8('0x14')]('GetVtigerAccount',_0xe2f43d);logger[_0xd0e8('0xe')](_0xd0e8('0x18'),_0xe2f43d,JSON[_0xd0e8('0x10')](_0x1adfd3));_0x2d81a3(_0x1adfd3);})['catch'](function(_0x5efe6d){logger[_0xd0e8('0x11')](_0xd0e8('0x18'),_0x5efe6d['message'],_0xe2f43d);_0x5ad8e6(_0x219e00[_0xd0e8('0x11')](0x1f4,_0x5efe6d[_0xd0e8('0x13')]));});});};exports[_0xd0e8('0x22')]=function(_0x23489b){var _0x23d5ab=this;return new Promise(function(_0xa57309,_0x186623){return db['VtigerAccount'][_0xd0e8('0x23')]({'raw':_0x23489b[_0xd0e8('0x1b')]?_0x23489b['options'][_0xd0e8('0x1c')]===undefined?!![]:![]:!![],'where':_0x23489b[_0xd0e8('0x1b')]?_0x23489b['options']['where']||null:null,'attributes':_0x23489b[_0xd0e8('0x1b')]?_0x23489b[_0xd0e8('0x1b')][_0xd0e8('0x1d')]||null:null,'include':_0x23489b[_0xd0e8('0x1b')]?_0x23489b[_0xd0e8('0x1b')]['include']?_['map'](_0x23489b[_0xd0e8('0x1b')]['include'],function(_0x4d2206){return{'model':db[_0x4d2206[_0xd0e8('0x20')]],'as':_0x4d2206['as'],'attributes':_0x4d2206['attributes'],'include':_0x4d2206['include']?_[_0xd0e8('0x21')](_0x4d2206[_0xd0e8('0x1f')],function(_0x354c60){return{'model':db[_0x354c60['model']],'as':_0x354c60['as'],'attributes':_0x354c60[_0xd0e8('0x1d')],'include':_0x354c60[_0xd0e8('0x1f')]?_['map'](_0x354c60['include'],function(_0x113791){return{'model':db[_0x113791[_0xd0e8('0x20')]],'as':_0x113791['as'],'attributes':_0x113791[_0xd0e8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd0e8('0xc')](function(_0x4bfe90){logger[_0xd0e8('0x14')](_0xd0e8('0x22'),_0x23489b);logger[_0xd0e8('0xe')](_0xd0e8('0x22'),_0x23489b,JSON[_0xd0e8('0x10')](_0x4bfe90));_0xa57309(_0x4bfe90);})[_0xd0e8('0x17')](function(_0x4b615d){logger[_0xd0e8('0x11')](_0xd0e8('0x22'),_0x4b615d[_0xd0e8('0x13')],_0x23489b);_0x186623(_0x23d5ab['error'](0x1f4,_0x4b615d['message']));});});};
\ No newline at end of file
+var _0x1f0a=['VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','limit','include','map','model','attributes','ShowVtigerAccount','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4d8b6d,_0x5ebb08){var _0x118c59=function(_0x2c1a20){while(--_0x2c1a20){_0x4d8b6d['push'](_0x4d8b6d['shift']());}};_0x118c59(++_0x5ebb08);}(_0x1f0a,0x1b9));var _0xa1f0=function(_0x31af7b,_0xf90ede){_0x31af7b=_0x31af7b-0x0;var _0xcc3682=_0x1f0a[_0x31af7b];return _0xcc3682;};'use strict';var _=require(_0xa1f0('0x0'));var util=require(_0xa1f0('0x1'));var moment=require(_0xa1f0('0x2'));var BPromise=require('bluebird');var rs=require(_0xa1f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1f0('0x4'))['db'];var utils=require(_0xa1f0('0x5'));var logger=require(_0xa1f0('0x6'))('rpc');var config=require(_0xa1f0('0x7'));var jayson=require(_0xa1f0('0x8'));var client=jayson[_0xa1f0('0x9')][_0xa1f0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x448bdb,_0x3adb41,_0x32ce8c){return new BPromise(function(_0x36f2cf,_0xfa432a){return client[_0xa1f0('0xb')](_0x448bdb,_0x32ce8c)[_0xa1f0('0xc')](function(_0x52ab09){logger[_0xa1f0('0xd')](_0xa1f0('0xe'),_0x3adb41,_0xa1f0('0xf'));logger[_0xa1f0('0x10')](_0xa1f0('0x11'),_0x3adb41,'request\x20sent',JSON[_0xa1f0('0x12')](_0x52ab09));if(_0x52ab09[_0xa1f0('0x13')]){if(_0x52ab09['error'][_0xa1f0('0x14')]===0x1f4){logger['error'](_0xa1f0('0xe'),_0x3adb41,_0x52ab09[_0xa1f0('0x13')][_0xa1f0('0x15')]);return _0xfa432a(_0x52ab09[_0xa1f0('0x13')][_0xa1f0('0x15')]);}logger[_0xa1f0('0x13')](_0xa1f0('0xe'),_0x3adb41,_0x52ab09[_0xa1f0('0x13')][_0xa1f0('0x15')]);return _0x36f2cf(_0x52ab09[_0xa1f0('0x13')]['message']);}else{logger[_0xa1f0('0xd')](_0xa1f0('0xe'),_0x3adb41,_0xa1f0('0xf'));_0x36f2cf(_0x52ab09[_0xa1f0('0x16')][_0xa1f0('0x15')]);}})[_0xa1f0('0x17')](function(_0x285659){logger[_0xa1f0('0x13')](_0xa1f0('0xe'),_0x3adb41,_0x285659);_0xfa432a(_0x285659);});});}exports[_0xa1f0('0x18')]=function(_0x1c225f){var _0x40620d=this;return new Promise(function(_0x151d83,_0x489414){return db[_0xa1f0('0x19')]['findAll']({'raw':_0x1c225f[_0xa1f0('0x1a')]?_0x1c225f[_0xa1f0('0x1a')][_0xa1f0('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c225f[_0xa1f0('0x1a')]?_0x1c225f[_0xa1f0('0x1a')]['where']||null:null,'attributes':_0x1c225f[_0xa1f0('0x1a')]?_0x1c225f[_0xa1f0('0x1a')]['attributes']||null:null,'limit':_0x1c225f['options']?_0x1c225f[_0xa1f0('0x1a')][_0xa1f0('0x1c')]||null:null,'include':_0x1c225f[_0xa1f0('0x1a')]?_0x1c225f[_0xa1f0('0x1a')][_0xa1f0('0x1d')]?_[_0xa1f0('0x1e')](_0x1c225f[_0xa1f0('0x1a')][_0xa1f0('0x1d')],function(_0x5c71bc){return{'model':db[_0x5c71bc[_0xa1f0('0x1f')]],'as':_0x5c71bc['as'],'attributes':_0x5c71bc[_0xa1f0('0x20')],'include':_0x5c71bc['include']?_[_0xa1f0('0x1e')](_0x5c71bc[_0xa1f0('0x1d')],function(_0x375e6e){return{'model':db[_0x375e6e[_0xa1f0('0x1f')]],'as':_0x375e6e['as'],'attributes':_0x375e6e[_0xa1f0('0x20')],'include':_0x375e6e['include']?_[_0xa1f0('0x1e')](_0x375e6e[_0xa1f0('0x1d')],function(_0x6d9f27){return{'model':db[_0x6d9f27[_0xa1f0('0x1f')]],'as':_0x6d9f27['as'],'attributes':_0x6d9f27[_0xa1f0('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x102211){logger[_0xa1f0('0xd')](_0xa1f0('0x18'),_0x1c225f);logger[_0xa1f0('0x10')](_0xa1f0('0x18'),_0x1c225f,JSON[_0xa1f0('0x12')](_0x102211));_0x151d83(_0x102211);})['catch'](function(_0x1e0c53){logger['error'](_0xa1f0('0x18'),_0x1e0c53[_0xa1f0('0x15')],_0x1c225f);_0x489414(_0x40620d[_0xa1f0('0x13')](0x1f4,_0x1e0c53[_0xa1f0('0x15')]));});});};exports[_0xa1f0('0x21')]=function(_0x3de676){var _0x4a25f5=this;return new Promise(function(_0x288028,_0x253df7){return db[_0xa1f0('0x19')]['find']({'raw':_0x3de676[_0xa1f0('0x1a')]?_0x3de676['options'][_0xa1f0('0x1b')]===undefined?!![]:![]:!![],'where':_0x3de676['options']?_0x3de676['options'][_0xa1f0('0x22')]||null:null,'attributes':_0x3de676[_0xa1f0('0x1a')]?_0x3de676['options']['attributes']||null:null,'include':_0x3de676[_0xa1f0('0x1a')]?_0x3de676[_0xa1f0('0x1a')][_0xa1f0('0x1d')]?_[_0xa1f0('0x1e')](_0x3de676[_0xa1f0('0x1a')][_0xa1f0('0x1d')],function(_0x418e22){return{'model':db[_0x418e22[_0xa1f0('0x1f')]],'as':_0x418e22['as'],'attributes':_0x418e22[_0xa1f0('0x20')],'include':_0x418e22[_0xa1f0('0x1d')]?_[_0xa1f0('0x1e')](_0x418e22[_0xa1f0('0x1d')],function(_0x35c9ea){return{'model':db[_0x35c9ea[_0xa1f0('0x1f')]],'as':_0x35c9ea['as'],'attributes':_0x35c9ea[_0xa1f0('0x20')],'include':_0x35c9ea['include']?_['map'](_0x35c9ea[_0xa1f0('0x1d')],function(_0xae9caf){return{'model':db[_0xae9caf[_0xa1f0('0x1f')]],'as':_0xae9caf['as'],'attributes':_0xae9caf[_0xa1f0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa1f0('0xc')](function(_0x24c830){logger[_0xa1f0('0xd')](_0xa1f0('0x21'),_0x3de676);logger[_0xa1f0('0x10')](_0xa1f0('0x21'),_0x3de676,JSON[_0xa1f0('0x12')](_0x24c830));_0x288028(_0x24c830);})['catch'](function(_0x3d6b86){logger[_0xa1f0('0x13')](_0xa1f0('0x21'),_0x3d6b86['message'],_0x3de676);_0x253df7(_0x4a25f5['error'](0x1f4,_0x3d6b86[_0xa1f0('0x15')]));});});};
\ No newline at end of file
index 1009171..e36265c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x41b26f,_0x168833){var _0x209acc=function(_0x20d425){while(--_0x20d425){_0x41b26f['push'](_0x41b26f['shift']());}};_0x209acc(++_0x168833);}(_0xb10b,0x12a));var _0xbb10=function(_0x4f192e,_0x4d1756){_0x4f192e=_0x4f192e-0x0;var _0x49294d=_0xb10b[_0x4f192e];return _0x49294d;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router;
\ No newline at end of file
+var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x3ce4c9,_0x42b5d5){var _0x303dee=function(_0x8dd425){while(--_0x8dd425){_0x3ce4c9['push'](_0x3ce4c9['shift']());}};_0x303dee(++_0x42b5d5);}(_0xb10b,0x12a));var _0xbb10=function(_0x2a8b5c,_0x429c22){_0x2a8b5c=_0x2a8b5c-0x0;var _0x3bbefe=_0xb10b[_0x2a8b5c];return _0x3bbefe;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router;
\ No newline at end of file
index f7b9d74..91cafb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaca0=['sequelize','exports','STRING'];(function(_0x187e82,_0x5254eb){var _0x58625e=function(_0x59d14d){while(--_0x59d14d){_0x187e82['push'](_0x187e82['shift']());}};_0x58625e(++_0x5254eb);}(_0xaca0,0x15c));var _0x0aca=function(_0x399c47,_0x5dcca3){_0x399c47=_0x399c47-0x0;var _0x1ccc4d=_0xaca0[_0x399c47];return _0x1ccc4d;};'use strict';var Sequelize=require(_0x0aca('0x0'));module[_0x0aca('0x1')]={'name':{'type':Sequelize[_0x0aca('0x2')]},'description':{'type':Sequelize[_0x0aca('0x2')]}};
\ No newline at end of file
+var _0x263d=['exports','STRING'];(function(_0x213b16,_0x5ba88a){var _0x3bc27f=function(_0x30134f){while(--_0x30134f){_0x213b16['push'](_0x213b16['shift']());}};_0x3bc27f(++_0x5ba88a);}(_0x263d,0x17a));var _0xd263=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0x263d[_0x482214];return _0x38d0cb;};'use strict';var Sequelize=require('sequelize');module[_0xd263('0x0')]={'name':{'type':Sequelize[_0xd263('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5e83fec..cc9b4bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e9c=['findOne','sort','VtigerField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','set','apply','save','update','destroy','stack','name','send','index','VtigerConfiguration','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','create','body','find','params','getFields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e9c,0x1d6));var _0xc0e9=function(_0x16b186,_0x3fec23){_0x16b186=_0x16b186-0x0;var _0x33b499=_0x0e9c[_0x16b186];return _0x33b499;};'use strict';var pdf=require(_0xc0e9('0x0'));var emlformat=require(_0xc0e9('0x1'));var rimraf=require(_0xc0e9('0x2'));var zipdir=require(_0xc0e9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc0e9('0x4'));var BPromise=require(_0xc0e9('0x5'));var Mustache=require('mustache');var util=require(_0xc0e9('0x6'));var path=require('path');var sox=require(_0xc0e9('0x7'));var csv=require(_0xc0e9('0x8'));var ejs=require(_0xc0e9('0x9'));var fs=require('fs');var _=require(_0xc0e9('0xa'));var squel=require(_0xc0e9('0xb'));var crypto=require(_0xc0e9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc0e9('0xd'));var toCsv=require(_0xc0e9('0x8'));var querystring=require(_0xc0e9('0xe'));var Papa=require(_0xc0e9('0xf'));var Redis=require(_0xc0e9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc0e9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc0e9('0x12'))(_0xc0e9('0x13'));var utils=require('../../config/utils');var config=require(_0xc0e9('0x14'));var db=require(_0xc0e9('0x15'))['db'];var jayson=require(_0xc0e9('0x16'));var client=jayson[_0xc0e9('0x17')][_0xc0e9('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3eae20,_0x48619b,_0x58a864){if(_0x58a864){var _0x24a687=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24a687[_0xc0e9('0x19')](_0x48619b)){return _0x3eae20;}else{throw new db['Sequelize'][(_0xc0e9('0x1a'))](_0xc0e9('0x1b'));}}else{return _0x3eae20;}}function respondWithRpcPromise(_0x4df7d9,_0x2a93a8,_0x43af6e,_0x409970){return new BPromise(function(_0x4a5a4c,_0x467c5b){var _0x3d9d4f=_0x409970||client;return _0x3d9d4f['request'](_0x4df7d9,_0x43af6e)[_0xc0e9('0x1c')](function(_0x170d15){logger[_0xc0e9('0x1d')](_0xc0e9('0x1e'),_0x2a93a8,'request\x20sent');logger[_0xc0e9('0x1f')](_0xc0e9('0x20'),_0x2a93a8,_0xc0e9('0x21'),JSON[_0xc0e9('0x22')](_0x170d15));if(_0x170d15[_0xc0e9('0x23')]){if(_0x170d15[_0xc0e9('0x23')][_0xc0e9('0x24')]===0x1f4){logger['error'](_0xc0e9('0x1e'),_0x2a93a8,_0x170d15['error'][_0xc0e9('0x25')]);return _0x467c5b(_0x170d15[_0xc0e9('0x23')][_0xc0e9('0x25')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x2a93a8,_0x170d15['error'][_0xc0e9('0x25')]);return _0x4a5a4c(_0x170d15[_0xc0e9('0x23')]['message']);}else{logger[_0xc0e9('0x1d')](_0xc0e9('0x1e'),_0x2a93a8,_0xc0e9('0x21'));_0x4a5a4c(_0x170d15[_0xc0e9('0x26')]['message']);}})[_0xc0e9('0x27')](function(_0x4df7e8){logger[_0xc0e9('0x23')]('VtigerConfiguration,\x20%s,\x20%s',_0x2a93a8,_0x4df7e8);_0x467c5b(_0x4df7e8);});});}function respondWithStatusCode(_0x500ae4,_0x358fe2){_0x358fe2=_0x358fe2||0xcc;return function(_0x1b6f44){if(_0x1b6f44){return _0x500ae4[_0xc0e9('0x28')](_0x358fe2);}return _0x500ae4['status'](_0x358fe2)['end']();};}function respondWithResult(_0x2997d0,_0xc9cb9d){_0xc9cb9d=_0xc9cb9d||0xc8;return function(_0x177dd8){if(_0x177dd8){return _0x2997d0[_0xc0e9('0x29')](_0xc9cb9d)[_0xc0e9('0x2a')](_0x177dd8);}};}function respondWithFilteredResult(_0x1c3ae6,_0x596a73){return function(_0x2e0f05){if(_0x2e0f05){var _0x3e526e=_0x2e0f05[_0xc0e9('0x2b')],_0x22836e=_0x596a73[_0xc0e9('0x2c')],_0x27efe6=_0x596a73[_0xc0e9('0x2c')]+_0x596a73['limit'],_0x504b1d;if(_0x27efe6>=_0x3e526e){_0x27efe6=_0x3e526e;_0x504b1d=0xc8;}else{_0x504b1d=0xce;}_0x1c3ae6['status'](_0x504b1d);return _0x1c3ae6[_0xc0e9('0x2d')]('Content-Range',_0x22836e+'-'+_0x27efe6+'/'+_0x3e526e)[_0xc0e9('0x2a')](_0x2e0f05);}return null;};}function patchUpdates(_0x45bb91){return function(_0x4616fe){try{jsonpatch[_0xc0e9('0x2e')](_0x4616fe,_0x45bb91,!![]);}catch(_0x95f267){return BPromise['reject'](_0x95f267);}return _0x4616fe[_0xc0e9('0x2f')]();};}function saveUpdates(_0x5e250e,_0x5de228){return function(_0x442db5){if(_0x442db5){return _0x442db5[_0xc0e9('0x30')](_0x5e250e)['then'](function(_0x3c99d3){return _0x3c99d3;});}return null;};}function removeEntity(_0xd9a394,_0x1ef399){return function(_0x28aca3){if(_0x28aca3){return _0x28aca3[_0xc0e9('0x31')]()[_0xc0e9('0x1c')](function(){_0xd9a394[_0xc0e9('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55a9ce,_0x29357c){return function(_0x40fba1){if(!_0x40fba1){_0x55a9ce[_0xc0e9('0x28')](0x194);}return _0x40fba1;};}function handleError(_0x99a447,_0x2f1205){_0x2f1205=_0x2f1205||0x1f4;return function(_0x5c104a){logger['error'](_0x5c104a[_0xc0e9('0x32')]);if(_0x5c104a[_0xc0e9('0x33')]){delete _0x5c104a['name'];}_0x99a447[_0xc0e9('0x29')](_0x2f1205)[_0xc0e9('0x34')](_0x5c104a);};}exports[_0xc0e9('0x35')]=function(_0x50937b,_0x2862ac){var _0xfd419e={},_0x31266a={},_0x4aff93={'count':0x0,'rows':[]};var _0xab6066=_['map'](db[_0xc0e9('0x36')]['rawAttributes'],function(_0x264312){return{'name':_0x264312[_0xc0e9('0x37')],'type':_0x264312[_0xc0e9('0x38')][_0xc0e9('0x39')]};});_0x31266a['model']=_[_0xc0e9('0x3a')](_0xab6066,_0xc0e9('0x33'));_0x31266a[_0xc0e9('0x3b')]=_[_0xc0e9('0x3c')](_0x50937b[_0xc0e9('0x3b')]);_0x31266a['filters']=_[_0xc0e9('0x3d')](_0x31266a[_0xc0e9('0x3e')],_0x31266a[_0xc0e9('0x3b')]);_0xfd419e[_0xc0e9('0x3f')]=_[_0xc0e9('0x3d')](_0x31266a[_0xc0e9('0x3e')],qs[_0xc0e9('0x40')](_0x50937b[_0xc0e9('0x3b')][_0xc0e9('0x40')]));_0xfd419e[_0xc0e9('0x3f')]=_0xfd419e['attributes'][_0xc0e9('0x41')]?_0xfd419e[_0xc0e9('0x3f')]:_0x31266a[_0xc0e9('0x3e')];if(!_0x50937b[_0xc0e9('0x3b')][_0xc0e9('0x42')](_0xc0e9('0x43'))){_0xfd419e['limit']=qs[_0xc0e9('0x44')](_0x50937b['query'][_0xc0e9('0x44')]);_0xfd419e[_0xc0e9('0x2c')]=qs['offset'](_0x50937b['query']['offset']);}_0xfd419e[_0xc0e9('0x45')]=qs['sort'](_0x50937b[_0xc0e9('0x3b')]['sort']);_0xfd419e[_0xc0e9('0x46')]=qs[_0xc0e9('0x47')](_[_0xc0e9('0x48')](_0x50937b[_0xc0e9('0x3b')],_0x31266a[_0xc0e9('0x47')]),_0xab6066);if(_0x50937b[_0xc0e9('0x3b')][_0xc0e9('0x49')]){_0xfd419e[_0xc0e9('0x46')]=_['merge'](_0xfd419e['where'],{'$or':_[_0xc0e9('0x3a')](_0xab6066,function(_0x5d6167){if(_0x5d6167[_0xc0e9('0x38')]!==_0xc0e9('0x4a')){var _0x2b5c00={};_0x2b5c00[_0x5d6167[_0xc0e9('0x33')]]={'$like':'%'+_0x50937b[_0xc0e9('0x3b')][_0xc0e9('0x49')]+'%'};return _0x2b5c00;}})});}_0xfd419e=_[_0xc0e9('0x4b')]({},_0xfd419e,_0x50937b[_0xc0e9('0x4c')]);var _0x51c8ce={'where':_0xfd419e['where']};return db[_0xc0e9('0x36')]['count'](_0x51c8ce)['then'](function(_0x576ce5){_0x4aff93[_0xc0e9('0x2b')]=_0x576ce5;if(_0x50937b[_0xc0e9('0x3b')][_0xc0e9('0x4d')]){_0xfd419e[_0xc0e9('0x4e')]=[{'all':!![]}];}return db[_0xc0e9('0x36')][_0xc0e9('0x4f')](_0xfd419e);})[_0xc0e9('0x1c')](function(_0x189a23){_0x4aff93[_0xc0e9('0x50')]=_0x189a23;return _0x4aff93;})['then'](respondWithFilteredResult(_0x2862ac,_0xfd419e))[_0xc0e9('0x27')](handleError(_0x2862ac,null));};exports[_0xc0e9('0x51')]=function(_0x178281,_0x5674be){var _0x339639={'raw':![],'where':{'id':_0x178281['params']['id']}},_0x10650e={};_0x10650e[_0xc0e9('0x3e')]=_['keys'](db[_0xc0e9('0x36')][_0xc0e9('0x52')]);_0x10650e[_0xc0e9('0x3b')]=_[_0xc0e9('0x3c')](_0x178281[_0xc0e9('0x3b')]);_0x10650e[_0xc0e9('0x47')]=_[_0xc0e9('0x3d')](_0x10650e[_0xc0e9('0x3e')],_0x10650e['query']);_0x339639['attributes']=_[_0xc0e9('0x3d')](_0x10650e[_0xc0e9('0x3e')],qs[_0xc0e9('0x40')](_0x178281[_0xc0e9('0x3b')]['fields']));_0x339639[_0xc0e9('0x3f')]=_0x339639[_0xc0e9('0x3f')]['length']?_0x339639[_0xc0e9('0x3f')]:_0x10650e[_0xc0e9('0x3e')];if(_0x178281[_0xc0e9('0x3b')][_0xc0e9('0x4d')]){_0x339639[_0xc0e9('0x4e')]=[{'all':!![]}];}_0x339639=_[_0xc0e9('0x4b')]({},_0x339639,_0x178281[_0xc0e9('0x4c')]);return db['VtigerConfiguration']['find'](_0x339639)['then'](handleEntityNotFound(_0x5674be,null))[_0xc0e9('0x1c')](respondWithResult(_0x5674be,null))[_0xc0e9('0x27')](handleError(_0x5674be,null));};exports[_0xc0e9('0x53')]=function(_0x1ff0a8,_0x5f0125){return db[_0xc0e9('0x36')]['create'](_0x1ff0a8[_0xc0e9('0x54')],{})['then'](respondWithResult(_0x5f0125,0xc9))['catch'](handleError(_0x5f0125,null));};exports[_0xc0e9('0x30')]=function(_0x41f2ad,_0x876cc8){if(_0x41f2ad[_0xc0e9('0x54')]['id']){delete _0x41f2ad[_0xc0e9('0x54')]['id'];}return db['VtigerConfiguration'][_0xc0e9('0x55')]({'where':{'id':_0x41f2ad[_0xc0e9('0x56')]['id']}})['then'](handleEntityNotFound(_0x876cc8,null))[_0xc0e9('0x1c')](saveUpdates(_0x41f2ad[_0xc0e9('0x54')],null))[_0xc0e9('0x1c')](respondWithResult(_0x876cc8,null))[_0xc0e9('0x27')](handleError(_0x876cc8,null));};exports[_0xc0e9('0x31')]=function(_0x258ffc,_0x30269e){return db['VtigerConfiguration'][_0xc0e9('0x55')]({'where':{'id':_0x258ffc[_0xc0e9('0x56')]['id']}})[_0xc0e9('0x1c')](handleEntityNotFound(_0x30269e,null))[_0xc0e9('0x1c')](removeEntity(_0x30269e,null))[_0xc0e9('0x27')](handleError(_0x30269e,null));};exports[_0xc0e9('0x57')]=function(_0x5d1997,_0xa86c4f,_0x5201a7){var _0x66e3d3={};var _0xc4a720={};var _0x5c60f2;var _0x3619db;return db[_0xc0e9('0x36')][_0xc0e9('0x58')]({'where':{'id':_0x5d1997['params']['id']}})['then'](handleEntityNotFound(_0xa86c4f,null))[_0xc0e9('0x1c')](function(_0x51897e){if(_0x51897e){_0x5c60f2=_0x51897e;_0xc4a720['model']=_[_0xc0e9('0x3c')](db['VtigerField'][_0xc0e9('0x52')]);_0xc4a720[_0xc0e9('0x3b')]=_[_0xc0e9('0x3c')](_0x5d1997[_0xc0e9('0x3b')]);_0xc4a720[_0xc0e9('0x47')]=_[_0xc0e9('0x3d')](_0xc4a720['model'],_0xc4a720[_0xc0e9('0x3b')]);_0x66e3d3[_0xc0e9('0x3f')]=_[_0xc0e9('0x3d')](_0xc4a720[_0xc0e9('0x3e')],qs[_0xc0e9('0x40')](_0x5d1997['query'][_0xc0e9('0x40')]));_0x66e3d3['attributes']=_0x66e3d3[_0xc0e9('0x3f')][_0xc0e9('0x41')]?_0x66e3d3[_0xc0e9('0x3f')]:_0xc4a720[_0xc0e9('0x3e')];_0x66e3d3['order']=qs['sort'](_0x5d1997[_0xc0e9('0x3b')][_0xc0e9('0x59')]);_0x66e3d3[_0xc0e9('0x46')]=qs[_0xc0e9('0x47')](_[_0xc0e9('0x48')](_0x5d1997['query'],_0xc4a720[_0xc0e9('0x47')]));if(_0x5d1997[_0xc0e9('0x3b')][_0xc0e9('0x49')]){_0x66e3d3[_0xc0e9('0x46')]=_[_0xc0e9('0x4b')](_0x66e3d3[_0xc0e9('0x46')],{'$or':_[_0xc0e9('0x3a')](_0x66e3d3['attributes'],function(_0x1657e5){var _0x37d067={};_0x37d067[_0x1657e5]={'$like':'%'+_0x5d1997[_0xc0e9('0x3b')]['filter']+'%'};return _0x37d067;})});}_0x66e3d3=_[_0xc0e9('0x4b')]({},_0x66e3d3,_0x5d1997[_0xc0e9('0x4c')]);return _0x5c60f2[_0xc0e9('0x57')](_0x66e3d3);}})[_0xc0e9('0x1c')](function(_0x49f923){if(_0x49f923){_0x3619db=_0x49f923[_0xc0e9('0x41')];if(!_0x5d1997[_0xc0e9('0x3b')][_0xc0e9('0x42')](_0xc0e9('0x43'))){_0x66e3d3[_0xc0e9('0x44')]=qs[_0xc0e9('0x44')](_0x5d1997[_0xc0e9('0x3b')][_0xc0e9('0x44')]);_0x66e3d3[_0xc0e9('0x2c')]=qs[_0xc0e9('0x2c')](_0x5d1997[_0xc0e9('0x3b')]['offset']);}return _0x5c60f2[_0xc0e9('0x57')](_0x66e3d3);}})['then'](function(_0x232b3c){if(_0x232b3c){return _0x232b3c?{'count':_0x3619db,'rows':_0x232b3c}:null;}})[_0xc0e9('0x1c')](respondWithResult(_0xa86c4f,null))[_0xc0e9('0x27')](handleError(_0xa86c4f,null));};exports['getSubjects']=function(_0x8a69e4,_0x1f10d6,_0x919cb6){var _0x2e04bc={};var _0x4ee48c={};var _0x353d11;var _0x75a2b1;return db[_0xc0e9('0x36')][_0xc0e9('0x58')]({'where':{'id':_0x8a69e4[_0xc0e9('0x56')]['id']}})[_0xc0e9('0x1c')](handleEntityNotFound(_0x1f10d6,null))[_0xc0e9('0x1c')](function(_0x134f08){if(_0x134f08){_0x353d11=_0x134f08;_0x4ee48c['model']=_[_0xc0e9('0x3c')](db[_0xc0e9('0x5a')][_0xc0e9('0x52')]);_0x4ee48c[_0xc0e9('0x3b')]=_[_0xc0e9('0x3c')](_0x8a69e4['query']);_0x4ee48c['filters']=_[_0xc0e9('0x3d')](_0x4ee48c[_0xc0e9('0x3e')],_0x4ee48c[_0xc0e9('0x3b')]);_0x2e04bc[_0xc0e9('0x3f')]=_[_0xc0e9('0x3d')](_0x4ee48c['model'],qs[_0xc0e9('0x40')](_0x8a69e4[_0xc0e9('0x3b')][_0xc0e9('0x40')]));_0x2e04bc[_0xc0e9('0x3f')]=_0x2e04bc[_0xc0e9('0x3f')][_0xc0e9('0x41')]?_0x2e04bc[_0xc0e9('0x3f')]:_0x4ee48c[_0xc0e9('0x3e')];_0x2e04bc[_0xc0e9('0x45')]=qs[_0xc0e9('0x59')](_0x8a69e4[_0xc0e9('0x3b')][_0xc0e9('0x59')]);_0x2e04bc[_0xc0e9('0x46')]=qs[_0xc0e9('0x47')](_['pick'](_0x8a69e4[_0xc0e9('0x3b')],_0x4ee48c['filters']));if(_0x8a69e4[_0xc0e9('0x3b')][_0xc0e9('0x49')]){_0x2e04bc[_0xc0e9('0x46')]=_[_0xc0e9('0x4b')](_0x2e04bc['where'],{'$or':_[_0xc0e9('0x3a')](_0x2e04bc[_0xc0e9('0x3f')],function(_0x4aba6e){var _0x51c751={};_0x51c751[_0x4aba6e]={'$like':'%'+_0x8a69e4[_0xc0e9('0x3b')]['filter']+'%'};return _0x51c751;})});}_0x2e04bc=_[_0xc0e9('0x4b')]({},_0x2e04bc,_0x8a69e4['options']);return _0x353d11['getSubjects'](_0x2e04bc);}})[_0xc0e9('0x1c')](function(_0x3aa7af){if(_0x3aa7af){_0x75a2b1=_0x3aa7af['length'];if(!_0x8a69e4['query']['hasOwnProperty'](_0xc0e9('0x43'))){_0x2e04bc[_0xc0e9('0x44')]=qs['limit'](_0x8a69e4[_0xc0e9('0x3b')]['limit']);_0x2e04bc['offset']=qs[_0xc0e9('0x2c')](_0x8a69e4[_0xc0e9('0x3b')]['offset']);}return _0x353d11[_0xc0e9('0x5b')](_0x2e04bc);}})[_0xc0e9('0x1c')](function(_0x5ccb14){if(_0x5ccb14){return _0x5ccb14?{'count':_0x75a2b1,'rows':_0x5ccb14}:null;}})[_0xc0e9('0x1c')](respondWithResult(_0x1f10d6,null))['catch'](handleError(_0x1f10d6,null));};exports['getDescriptions']=function(_0x594d10,_0x285c26,_0x5ab162){var _0x382c65={};var _0x3ca227={};var _0x1be33e;var _0x3f36d2;return db['VtigerConfiguration'][_0xc0e9('0x58')]({'where':{'id':_0x594d10[_0xc0e9('0x56')]['id']}})['then'](handleEntityNotFound(_0x285c26,null))[_0xc0e9('0x1c')](function(_0x9851a9){if(_0x9851a9){_0x1be33e=_0x9851a9;_0x3ca227['model']=_['keys'](db['VtigerField'][_0xc0e9('0x52')]);_0x3ca227[_0xc0e9('0x3b')]=_[_0xc0e9('0x3c')](_0x594d10[_0xc0e9('0x3b')]);_0x3ca227['filters']=_['intersection'](_0x3ca227[_0xc0e9('0x3e')],_0x3ca227['query']);_0x382c65[_0xc0e9('0x3f')]=_['intersection'](_0x3ca227['model'],qs['fields'](_0x594d10[_0xc0e9('0x3b')][_0xc0e9('0x40')]));_0x382c65[_0xc0e9('0x3f')]=_0x382c65[_0xc0e9('0x3f')]['length']?_0x382c65[_0xc0e9('0x3f')]:_0x3ca227[_0xc0e9('0x3e')];_0x382c65[_0xc0e9('0x45')]=qs['sort'](_0x594d10[_0xc0e9('0x3b')]['sort']);_0x382c65[_0xc0e9('0x46')]=qs[_0xc0e9('0x47')](_[_0xc0e9('0x48')](_0x594d10[_0xc0e9('0x3b')],_0x3ca227[_0xc0e9('0x47')]));if(_0x594d10['query']['filter']){_0x382c65[_0xc0e9('0x46')]=_[_0xc0e9('0x4b')](_0x382c65['where'],{'$or':_[_0xc0e9('0x3a')](_0x382c65['attributes'],function(_0x12b9b6){var _0x5f49c8={};_0x5f49c8[_0x12b9b6]={'$like':'%'+_0x594d10[_0xc0e9('0x3b')]['filter']+'%'};return _0x5f49c8;})});}_0x382c65=_[_0xc0e9('0x4b')]({},_0x382c65,_0x594d10['options']);return _0x1be33e[_0xc0e9('0x5c')](_0x382c65);}})[_0xc0e9('0x1c')](function(_0xe4f31b){if(_0xe4f31b){_0x3f36d2=_0xe4f31b['length'];if(!_0x594d10[_0xc0e9('0x3b')]['hasOwnProperty']('nolimit')){_0x382c65[_0xc0e9('0x44')]=qs['limit'](_0x594d10[_0xc0e9('0x3b')]['limit']);_0x382c65[_0xc0e9('0x2c')]=qs['offset'](_0x594d10[_0xc0e9('0x3b')][_0xc0e9('0x2c')]);}return _0x1be33e[_0xc0e9('0x5c')](_0x382c65);}})[_0xc0e9('0x1c')](function(_0x540a8a){if(_0x540a8a){return _0x540a8a?{'count':_0x3f36d2,'rows':_0x540a8a}:null;}})['then'](respondWithResult(_0x285c26,null))[_0xc0e9('0x27')](handleError(_0x285c26,null));};
\ No newline at end of file
+var _0x7829=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','VtigerConfiguration','includeAll','include','findAll','rows','show','params','find','create','body','destroy','getFields','VtigerField','findOne','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','client','test','Sequelize','ValidationError','request','then','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','stack','name','send','rawAttributes','type','key','model'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7829,0xd4));var _0x9782=function(_0x2062d9,_0x330ee8){_0x2062d9=_0x2062d9-0x0;var _0x2c0724=_0x7829[_0x2062d9];return _0x2c0724;};'use strict';var pdf=require(_0x9782('0x0'));var emlformat=require(_0x9782('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9782('0x2'));var jsonpatch=require(_0x9782('0x3'));var rp=require(_0x9782('0x4'));var moment=require(_0x9782('0x5'));var BPromise=require(_0x9782('0x6'));var Mustache=require(_0x9782('0x7'));var util=require(_0x9782('0x8'));var path=require(_0x9782('0x9'));var sox=require('sox');var csv=require(_0x9782('0xa'));var ejs=require(_0x9782('0xb'));var fs=require('fs');var _=require(_0x9782('0xc'));var squel=require(_0x9782('0xd'));var crypto=require(_0x9782('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9782('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9782('0x10'));var Papa=require('papaparse');var Redis=require(_0x9782('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9782('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9782('0x13'));var logger=require('../../config/logger')(_0x9782('0x14'));var utils=require(_0x9782('0x15'));var config=require(_0x9782('0x16'));var db=require(_0x9782('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x9782('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0xfb1a31,_0x346e9e,_0x319e20){if(_0x319e20){var _0x18d8e0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18d8e0[_0x9782('0x19')](_0x346e9e)){return _0xfb1a31;}else{throw new db[(_0x9782('0x1a'))][(_0x9782('0x1b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xfb1a31;}}function respondWithRpcPromise(_0x4b9df1,_0x552c4e,_0x2441fc,_0x4fb2a9){return new BPromise(function(_0x5c3a30,_0x420f7a){var _0x11f82b=_0x4fb2a9||client;return _0x11f82b[_0x9782('0x1c')](_0x4b9df1,_0x2441fc)[_0x9782('0x1d')](function(_0x25c4df){logger[_0x9782('0x1e')](_0x9782('0x1f'),_0x552c4e,'request\x20sent');logger['debug'](_0x9782('0x20'),_0x552c4e,_0x9782('0x21'),JSON[_0x9782('0x22')](_0x25c4df));if(_0x25c4df[_0x9782('0x23')]){if(_0x25c4df[_0x9782('0x23')][_0x9782('0x24')]===0x1f4){logger[_0x9782('0x23')](_0x9782('0x1f'),_0x552c4e,_0x25c4df[_0x9782('0x23')][_0x9782('0x25')]);return _0x420f7a(_0x25c4df['error'][_0x9782('0x25')]);}logger[_0x9782('0x23')](_0x9782('0x1f'),_0x552c4e,_0x25c4df[_0x9782('0x23')]['message']);return _0x5c3a30(_0x25c4df['error']['message']);}else{logger['info'](_0x9782('0x1f'),_0x552c4e,_0x9782('0x21'));_0x5c3a30(_0x25c4df['result'][_0x9782('0x25')]);}})[_0x9782('0x26')](function(_0x23cad2){logger[_0x9782('0x23')](_0x9782('0x1f'),_0x552c4e,_0x23cad2);_0x420f7a(_0x23cad2);});});}function respondWithStatusCode(_0x5ce2fc,_0x1d2eb0){_0x1d2eb0=_0x1d2eb0||0xcc;return function(_0x25a133){if(_0x25a133){return _0x5ce2fc[_0x9782('0x27')](_0x1d2eb0);}return _0x5ce2fc[_0x9782('0x28')](_0x1d2eb0)[_0x9782('0x29')]();};}function respondWithResult(_0x22ee19,_0xf7f45d){_0xf7f45d=_0xf7f45d||0xc8;return function(_0x4e930b){if(_0x4e930b){return _0x22ee19['status'](_0xf7f45d)[_0x9782('0x2a')](_0x4e930b);}};}function respondWithFilteredResult(_0x501196,_0x40c02d){return function(_0x37d089){if(_0x37d089){var _0x4d9f09=_0x37d089[_0x9782('0x2b')],_0x189e08=_0x40c02d['offset'],_0x5c2b11=_0x40c02d[_0x9782('0x2c')]+_0x40c02d[_0x9782('0x2d')],_0x595f6a;if(_0x5c2b11>=_0x4d9f09){_0x5c2b11=_0x4d9f09;_0x595f6a=0xc8;}else{_0x595f6a=0xce;}_0x501196['status'](_0x595f6a);return _0x501196['set'](_0x9782('0x2e'),_0x189e08+'-'+_0x5c2b11+'/'+_0x4d9f09)['json'](_0x37d089);}return null;};}function patchUpdates(_0x553d5a){return function(_0x1c0fde){try{jsonpatch[_0x9782('0x2f')](_0x1c0fde,_0x553d5a,!![]);}catch(_0x36bf49){return BPromise[_0x9782('0x30')](_0x36bf49);}return _0x1c0fde[_0x9782('0x31')]();};}function saveUpdates(_0x4c253a,_0x52c113){return function(_0x381d75){if(_0x381d75){return _0x381d75[_0x9782('0x32')](_0x4c253a)['then'](function(_0x1ca749){return _0x1ca749;});}return null;};}function removeEntity(_0x30e68e,_0x381031){return function(_0xbf962c){if(_0xbf962c){return _0xbf962c['destroy']()[_0x9782('0x1d')](function(){_0x30e68e[_0x9782('0x28')](0xcc)[_0x9782('0x29')]();});}};}function handleEntityNotFound(_0x351273,_0x2c40df){return function(_0x510fa5){if(!_0x510fa5){_0x351273[_0x9782('0x27')](0x194);}return _0x510fa5;};}function handleError(_0x21013b,_0x44c5bd){_0x44c5bd=_0x44c5bd||0x1f4;return function(_0x2cc6e7){logger[_0x9782('0x23')](_0x2cc6e7[_0x9782('0x33')]);if(_0x2cc6e7[_0x9782('0x34')]){delete _0x2cc6e7[_0x9782('0x34')];}_0x21013b[_0x9782('0x28')](_0x44c5bd)[_0x9782('0x35')](_0x2cc6e7);};}exports['index']=function(_0x35abbd,_0x5c7e99){var _0x3f46d4={},_0x2aa48e={},_0x55bd5d={'count':0x0,'rows':[]};var _0x1009a2=_['map'](db['VtigerConfiguration'][_0x9782('0x36')],function(_0x3c83f1){return{'name':_0x3c83f1['fieldName'],'type':_0x3c83f1[_0x9782('0x37')][_0x9782('0x38')]};});_0x2aa48e[_0x9782('0x39')]=_['map'](_0x1009a2,_0x9782('0x34'));_0x2aa48e[_0x9782('0x3a')]=_[_0x9782('0x3b')](_0x35abbd[_0x9782('0x3a')]);_0x2aa48e[_0x9782('0x3c')]=_[_0x9782('0x3d')](_0x2aa48e[_0x9782('0x39')],_0x2aa48e[_0x9782('0x3a')]);_0x3f46d4[_0x9782('0x3e')]=_[_0x9782('0x3d')](_0x2aa48e[_0x9782('0x39')],qs['fields'](_0x35abbd[_0x9782('0x3a')][_0x9782('0x3f')]));_0x3f46d4[_0x9782('0x3e')]=_0x3f46d4[_0x9782('0x3e')][_0x9782('0x40')]?_0x3f46d4[_0x9782('0x3e')]:_0x2aa48e[_0x9782('0x39')];if(!_0x35abbd[_0x9782('0x3a')][_0x9782('0x41')](_0x9782('0x42'))){_0x3f46d4['limit']=qs['limit'](_0x35abbd[_0x9782('0x3a')]['limit']);_0x3f46d4[_0x9782('0x2c')]=qs[_0x9782('0x2c')](_0x35abbd[_0x9782('0x3a')]['offset']);}_0x3f46d4[_0x9782('0x43')]=qs['sort'](_0x35abbd['query'][_0x9782('0x44')]);_0x3f46d4[_0x9782('0x45')]=qs['filters'](_[_0x9782('0x46')](_0x35abbd[_0x9782('0x3a')],_0x2aa48e[_0x9782('0x3c')]),_0x1009a2);if(_0x35abbd['query'][_0x9782('0x47')]){_0x3f46d4[_0x9782('0x45')]=_[_0x9782('0x48')](_0x3f46d4[_0x9782('0x45')],{'$or':_[_0x9782('0x49')](_0x1009a2,function(_0x5d6a1f){if(_0x5d6a1f['type']!=='VIRTUAL'){var _0x30e235={};_0x30e235[_0x5d6a1f['name']]={'$like':'%'+_0x35abbd[_0x9782('0x3a')][_0x9782('0x47')]+'%'};return _0x30e235;}})});}_0x3f46d4=_[_0x9782('0x48')]({},_0x3f46d4,_0x35abbd[_0x9782('0x4a')]);var _0x4a89ac={'where':_0x3f46d4[_0x9782('0x45')]};return db[_0x9782('0x4b')][_0x9782('0x2b')](_0x4a89ac)[_0x9782('0x1d')](function(_0x15838b){_0x55bd5d[_0x9782('0x2b')]=_0x15838b;if(_0x35abbd['query'][_0x9782('0x4c')]){_0x3f46d4[_0x9782('0x4d')]=[{'all':!![]}];}return db[_0x9782('0x4b')][_0x9782('0x4e')](_0x3f46d4);})[_0x9782('0x1d')](function(_0x4a55c8){_0x55bd5d[_0x9782('0x4f')]=_0x4a55c8;return _0x55bd5d;})['then'](respondWithFilteredResult(_0x5c7e99,_0x3f46d4))[_0x9782('0x26')](handleError(_0x5c7e99,null));};exports[_0x9782('0x50')]=function(_0x2e7e01,_0xef5b71){var _0x37e0b8={'raw':![],'where':{'id':_0x2e7e01[_0x9782('0x51')]['id']}},_0x499ca3={};_0x499ca3[_0x9782('0x39')]=_[_0x9782('0x3b')](db['VtigerConfiguration']['rawAttributes']);_0x499ca3['query']=_['keys'](_0x2e7e01['query']);_0x499ca3[_0x9782('0x3c')]=_['intersection'](_0x499ca3['model'],_0x499ca3[_0x9782('0x3a')]);_0x37e0b8[_0x9782('0x3e')]=_[_0x9782('0x3d')](_0x499ca3[_0x9782('0x39')],qs[_0x9782('0x3f')](_0x2e7e01[_0x9782('0x3a')]['fields']));_0x37e0b8[_0x9782('0x3e')]=_0x37e0b8[_0x9782('0x3e')][_0x9782('0x40')]?_0x37e0b8['attributes']:_0x499ca3[_0x9782('0x39')];if(_0x2e7e01[_0x9782('0x3a')][_0x9782('0x4c')]){_0x37e0b8[_0x9782('0x4d')]=[{'all':!![]}];}_0x37e0b8=_['merge']({},_0x37e0b8,_0x2e7e01[_0x9782('0x4a')]);return db[_0x9782('0x4b')][_0x9782('0x52')](_0x37e0b8)['then'](handleEntityNotFound(_0xef5b71,null))['then'](respondWithResult(_0xef5b71,null))[_0x9782('0x26')](handleError(_0xef5b71,null));};exports[_0x9782('0x53')]=function(_0x5290ff,_0x4c01c9){return db[_0x9782('0x4b')][_0x9782('0x53')](_0x5290ff[_0x9782('0x54')],{})['then'](respondWithResult(_0x4c01c9,0xc9))['catch'](handleError(_0x4c01c9,null));};exports[_0x9782('0x32')]=function(_0x4408f5,_0x98204b){if(_0x4408f5[_0x9782('0x54')]['id']){delete _0x4408f5[_0x9782('0x54')]['id'];}return db['VtigerConfiguration'][_0x9782('0x52')]({'where':{'id':_0x4408f5[_0x9782('0x51')]['id']}})['then'](handleEntityNotFound(_0x98204b,null))['then'](saveUpdates(_0x4408f5[_0x9782('0x54')],null))['then'](respondWithResult(_0x98204b,null))[_0x9782('0x26')](handleError(_0x98204b,null));};exports[_0x9782('0x55')]=function(_0x457f74,_0x119c37){return db[_0x9782('0x4b')][_0x9782('0x52')]({'where':{'id':_0x457f74[_0x9782('0x51')]['id']}})[_0x9782('0x1d')](handleEntityNotFound(_0x119c37,null))['then'](removeEntity(_0x119c37,null))['catch'](handleError(_0x119c37,null));};exports[_0x9782('0x56')]=function(_0x3be3bd,_0x152938,_0x27c3fb){var _0x369579={};var _0x4ce3d1={};var _0x5bf1ac;var _0x31fc77;return db[_0x9782('0x4b')]['findOne']({'where':{'id':_0x3be3bd[_0x9782('0x51')]['id']}})[_0x9782('0x1d')](handleEntityNotFound(_0x152938,null))['then'](function(_0x300140){if(_0x300140){_0x5bf1ac=_0x300140;_0x4ce3d1[_0x9782('0x39')]=_[_0x9782('0x3b')](db[_0x9782('0x57')][_0x9782('0x36')]);_0x4ce3d1['query']=_[_0x9782('0x3b')](_0x3be3bd[_0x9782('0x3a')]);_0x4ce3d1[_0x9782('0x3c')]=_['intersection'](_0x4ce3d1['model'],_0x4ce3d1[_0x9782('0x3a')]);_0x369579[_0x9782('0x3e')]=_[_0x9782('0x3d')](_0x4ce3d1[_0x9782('0x39')],qs['fields'](_0x3be3bd[_0x9782('0x3a')]['fields']));_0x369579[_0x9782('0x3e')]=_0x369579[_0x9782('0x3e')]['length']?_0x369579[_0x9782('0x3e')]:_0x4ce3d1[_0x9782('0x39')];_0x369579[_0x9782('0x43')]=qs[_0x9782('0x44')](_0x3be3bd[_0x9782('0x3a')]['sort']);_0x369579[_0x9782('0x45')]=qs['filters'](_['pick'](_0x3be3bd[_0x9782('0x3a')],_0x4ce3d1[_0x9782('0x3c')]));if(_0x3be3bd[_0x9782('0x3a')][_0x9782('0x47')]){_0x369579['where']=_[_0x9782('0x48')](_0x369579[_0x9782('0x45')],{'$or':_[_0x9782('0x49')](_0x369579['attributes'],function(_0x398804){var _0x1d4475={};_0x1d4475[_0x398804]={'$like':'%'+_0x3be3bd[_0x9782('0x3a')][_0x9782('0x47')]+'%'};return _0x1d4475;})});}_0x369579=_['merge']({},_0x369579,_0x3be3bd['options']);return _0x5bf1ac[_0x9782('0x56')](_0x369579);}})[_0x9782('0x1d')](function(_0x30fae7){if(_0x30fae7){_0x31fc77=_0x30fae7[_0x9782('0x40')];if(!_0x3be3bd[_0x9782('0x3a')][_0x9782('0x41')](_0x9782('0x42'))){_0x369579[_0x9782('0x2d')]=qs['limit'](_0x3be3bd['query'][_0x9782('0x2d')]);_0x369579[_0x9782('0x2c')]=qs[_0x9782('0x2c')](_0x3be3bd[_0x9782('0x3a')][_0x9782('0x2c')]);}return _0x5bf1ac[_0x9782('0x56')](_0x369579);}})[_0x9782('0x1d')](function(_0x5c6686){if(_0x5c6686){return _0x5c6686?{'count':_0x31fc77,'rows':_0x5c6686}:null;}})[_0x9782('0x1d')](respondWithResult(_0x152938,null))[_0x9782('0x26')](handleError(_0x152938,null));};exports['getSubjects']=function(_0x44256e,_0x2bdd3,_0x407f47){var _0x1110c4={};var _0x3391d3={};var _0x40a696;var _0x365b52;return db[_0x9782('0x4b')][_0x9782('0x58')]({'where':{'id':_0x44256e[_0x9782('0x51')]['id']}})[_0x9782('0x1d')](handleEntityNotFound(_0x2bdd3,null))[_0x9782('0x1d')](function(_0x59b576){if(_0x59b576){_0x40a696=_0x59b576;_0x3391d3['model']=_[_0x9782('0x3b')](db[_0x9782('0x57')]['rawAttributes']);_0x3391d3[_0x9782('0x3a')]=_[_0x9782('0x3b')](_0x44256e[_0x9782('0x3a')]);_0x3391d3[_0x9782('0x3c')]=_[_0x9782('0x3d')](_0x3391d3[_0x9782('0x39')],_0x3391d3[_0x9782('0x3a')]);_0x1110c4[_0x9782('0x3e')]=_['intersection'](_0x3391d3[_0x9782('0x39')],qs[_0x9782('0x3f')](_0x44256e[_0x9782('0x3a')]['fields']));_0x1110c4[_0x9782('0x3e')]=_0x1110c4['attributes'][_0x9782('0x40')]?_0x1110c4[_0x9782('0x3e')]:_0x3391d3[_0x9782('0x39')];_0x1110c4[_0x9782('0x43')]=qs[_0x9782('0x44')](_0x44256e[_0x9782('0x3a')][_0x9782('0x44')]);_0x1110c4[_0x9782('0x45')]=qs[_0x9782('0x3c')](_[_0x9782('0x46')](_0x44256e[_0x9782('0x3a')],_0x3391d3[_0x9782('0x3c')]));if(_0x44256e[_0x9782('0x3a')][_0x9782('0x47')]){_0x1110c4[_0x9782('0x45')]=_[_0x9782('0x48')](_0x1110c4['where'],{'$or':_[_0x9782('0x49')](_0x1110c4['attributes'],function(_0xdd10ac){var _0x3a998d={};_0x3a998d[_0xdd10ac]={'$like':'%'+_0x44256e[_0x9782('0x3a')][_0x9782('0x47')]+'%'};return _0x3a998d;})});}_0x1110c4=_['merge']({},_0x1110c4,_0x44256e[_0x9782('0x4a')]);return _0x40a696['getSubjects'](_0x1110c4);}})[_0x9782('0x1d')](function(_0x37785d){if(_0x37785d){_0x365b52=_0x37785d[_0x9782('0x40')];if(!_0x44256e[_0x9782('0x3a')][_0x9782('0x41')]('nolimit')){_0x1110c4[_0x9782('0x2d')]=qs[_0x9782('0x2d')](_0x44256e[_0x9782('0x3a')][_0x9782('0x2d')]);_0x1110c4[_0x9782('0x2c')]=qs[_0x9782('0x2c')](_0x44256e[_0x9782('0x3a')][_0x9782('0x2c')]);}return _0x40a696['getSubjects'](_0x1110c4);}})['then'](function(_0x50a2bc){if(_0x50a2bc){return _0x50a2bc?{'count':_0x365b52,'rows':_0x50a2bc}:null;}})[_0x9782('0x1d')](respondWithResult(_0x2bdd3,null))[_0x9782('0x26')](handleError(_0x2bdd3,null));};exports[_0x9782('0x59')]=function(_0xc8a9fd,_0x20255e,_0x121dff){var _0x1ca4d1={};var _0x704e73={};var _0x4f7e63;var _0xc2777b;return db['VtigerConfiguration'][_0x9782('0x58')]({'where':{'id':_0xc8a9fd[_0x9782('0x51')]['id']}})[_0x9782('0x1d')](handleEntityNotFound(_0x20255e,null))['then'](function(_0x222e8a){if(_0x222e8a){_0x4f7e63=_0x222e8a;_0x704e73[_0x9782('0x39')]=_['keys'](db['VtigerField'][_0x9782('0x36')]);_0x704e73[_0x9782('0x3a')]=_[_0x9782('0x3b')](_0xc8a9fd[_0x9782('0x3a')]);_0x704e73['filters']=_[_0x9782('0x3d')](_0x704e73[_0x9782('0x39')],_0x704e73['query']);_0x1ca4d1[_0x9782('0x3e')]=_[_0x9782('0x3d')](_0x704e73[_0x9782('0x39')],qs['fields'](_0xc8a9fd['query'][_0x9782('0x3f')]));_0x1ca4d1[_0x9782('0x3e')]=_0x1ca4d1['attributes'][_0x9782('0x40')]?_0x1ca4d1[_0x9782('0x3e')]:_0x704e73['model'];_0x1ca4d1['order']=qs[_0x9782('0x44')](_0xc8a9fd['query'][_0x9782('0x44')]);_0x1ca4d1[_0x9782('0x45')]=qs['filters'](_[_0x9782('0x46')](_0xc8a9fd[_0x9782('0x3a')],_0x704e73['filters']));if(_0xc8a9fd[_0x9782('0x3a')]['filter']){_0x1ca4d1[_0x9782('0x45')]=_[_0x9782('0x48')](_0x1ca4d1[_0x9782('0x45')],{'$or':_[_0x9782('0x49')](_0x1ca4d1[_0x9782('0x3e')],function(_0x1fc5a2){var _0x16cd0b={};_0x16cd0b[_0x1fc5a2]={'$like':'%'+_0xc8a9fd['query']['filter']+'%'};return _0x16cd0b;})});}_0x1ca4d1=_['merge']({},_0x1ca4d1,_0xc8a9fd['options']);return _0x4f7e63['getDescriptions'](_0x1ca4d1);}})[_0x9782('0x1d')](function(_0x162927){if(_0x162927){_0xc2777b=_0x162927[_0x9782('0x40')];if(!_0xc8a9fd[_0x9782('0x3a')][_0x9782('0x41')](_0x9782('0x42'))){_0x1ca4d1[_0x9782('0x2d')]=qs[_0x9782('0x2d')](_0xc8a9fd[_0x9782('0x3a')][_0x9782('0x2d')]);_0x1ca4d1[_0x9782('0x2c')]=qs[_0x9782('0x2c')](_0xc8a9fd[_0x9782('0x3a')][_0x9782('0x2c')]);}return _0x4f7e63[_0x9782('0x59')](_0x1ca4d1);}})[_0x9782('0x1d')](function(_0x920c7d){if(_0x920c7d){return _0x920c7d?{'count':_0xc2777b,'rows':_0x920c7d}:null;}})['then'](respondWithResult(_0x20255e,null))['catch'](handleError(_0x20255e,null));};
\ No newline at end of file
index ae5815d..f28a88d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9455=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','util','../../config/logger','api','moment'];(function(_0x572644,_0x543d79){var _0x17efa9=function(_0x1db802){while(--_0x1db802){_0x572644['push'](_0x572644['shift']());}};_0x17efa9(++_0x543d79);}(_0x9455,0xcd));var _0x5945=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9455[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x5945('0x0'));var logger=require(_0x5945('0x1'))(_0x5945('0x2'));var moment=require(_0x5945('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5945('0x4'));var rimraf=require(_0x5945('0x5'));var config=require(_0x5945('0x6'));var attributes=require(_0x5945('0x7'));module[_0x5945('0x8')]=function(_0x273fcf,_0x53421){return _0x273fcf[_0x5945('0x9')](_0x5945('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0140=['../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','api','request-promise','path'];(function(_0x30fe8c,_0x272cb9){var _0x4f1068=function(_0x5f52c7){while(--_0x5f52c7){_0x30fe8c['push'](_0x30fe8c['shift']());}};_0x4f1068(++_0x272cb9);}(_0x0140,0xcd));var _0x0014=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0x0140[_0x1a0daa];return _0x1dbe15;};'use strict';var _=require(_0x0014('0x0'));var util=require(_0x0014('0x1'));var logger=require('../../config/logger')(_0x0014('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0014('0x3'));var fs=require('fs');var path=require(_0x0014('0x4'));var rimraf=require('rimraf');var config=require(_0x0014('0x5'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x0014('0x6')]=function(_0x493cf8,_0x1d38cb){return _0x493cf8[_0x0014('0x7')](_0x0014('0x8'),attributes,{'tableName':_0x0014('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a3754ed..700189b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dee=['error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1440ce,_0x136aee){var _0x389c35=function(_0x73dfaf){while(--_0x73dfaf){_0x1440ce['push'](_0x1440ce['shift']());}};_0x389c35(++_0x136aee);}(_0x3dee,0x1be));var _0xe3de=function(_0x9953b,_0x30d48d){_0x9953b=_0x9953b-0x0;var _0x2fdee4=_0x3dee[_0x9953b];return _0x2fdee4;};'use strict';var _=require('lodash');var util=require(_0xe3de('0x0'));var moment=require('moment');var BPromise=require(_0xe3de('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe3de('0x2'));var db=require(_0xe3de('0x3'))['db'];var utils=require(_0xe3de('0x4'));var logger=require(_0xe3de('0x5'))(_0xe3de('0x6'));var config=require(_0xe3de('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe3de('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x318cb3,_0x56ab89,_0x5f4325){return new BPromise(function(_0x261192,_0x40f276){return client[_0xe3de('0x9')](_0x318cb3,_0x5f4325)[_0xe3de('0xa')](function(_0x377e22){logger[_0xe3de('0xb')](_0xe3de('0xc'),_0x56ab89,'request\x20sent');logger['debug'](_0xe3de('0xd'),_0x56ab89,_0xe3de('0xe'),JSON[_0xe3de('0xf')](_0x377e22));if(_0x377e22[_0xe3de('0x10')]){if(_0x377e22[_0xe3de('0x10')][_0xe3de('0x11')]===0x1f4){logger[_0xe3de('0x10')](_0xe3de('0xc'),_0x56ab89,_0x377e22[_0xe3de('0x10')][_0xe3de('0x12')]);return _0x40f276(_0x377e22[_0xe3de('0x10')][_0xe3de('0x12')]);}logger[_0xe3de('0x10')](_0xe3de('0xc'),_0x56ab89,_0x377e22[_0xe3de('0x10')][_0xe3de('0x12')]);return _0x261192(_0x377e22[_0xe3de('0x10')][_0xe3de('0x12')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x56ab89,_0xe3de('0xe'));_0x261192(_0x377e22[_0xe3de('0x13')][_0xe3de('0x12')]);}})[_0xe3de('0x14')](function(_0x2d4ed2){logger[_0xe3de('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x56ab89,_0x2d4ed2);_0x40f276(_0x2d4ed2);});});}
\ No newline at end of file
+var _0x8ca2=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ca2,0xe3));var _0x28ca=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x8ca2[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x28ca('0x0'));var util=require(_0x28ca('0x1'));var moment=require(_0x28ca('0x2'));var BPromise=require(_0x28ca('0x3'));var rs=require(_0x28ca('0x4'));var fs=require('fs');var Redis=require(_0x28ca('0x5'));var db=require(_0x28ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x28ca('0x7'))('rpc');var config=require(_0x28ca('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x28ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x348849,_0x4c16a2,_0x4bf4ad){return new BPromise(function(_0xb2a754,_0x1635c4){return client[_0x28ca('0xa')](_0x348849,_0x4bf4ad)[_0x28ca('0xb')](function(_0x483e26){logger[_0x28ca('0xc')](_0x28ca('0xd'),_0x4c16a2,_0x28ca('0xe'));logger[_0x28ca('0xf')](_0x28ca('0x10'),_0x4c16a2,_0x28ca('0xe'),JSON['stringify'](_0x483e26));if(_0x483e26['error']){if(_0x483e26[_0x28ca('0x11')][_0x28ca('0x12')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x4c16a2,_0x483e26['error'][_0x28ca('0x13')]);return _0x1635c4(_0x483e26['error']['message']);}logger[_0x28ca('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x4c16a2,_0x483e26[_0x28ca('0x11')][_0x28ca('0x13')]);return _0xb2a754(_0x483e26[_0x28ca('0x11')][_0x28ca('0x13')]);}else{logger['info'](_0x28ca('0xd'),_0x4c16a2,_0x28ca('0xe'));_0xb2a754(_0x483e26[_0x28ca('0x14')]['message']);}})['catch'](function(_0x279fe4){logger['error'](_0x28ca('0xd'),_0x4c16a2,_0x279fe4);_0x1635c4(_0x279fe4);});});}
\ No newline at end of file
index f0ac34c..8c2b450 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9aab=['create','/:id','update','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index'];(function(_0x1e8b1e,_0x407bbd){var _0x4a0fde=function(_0x4fd2be){while(--_0x4fd2be){_0x1e8b1e['push'](_0x1e8b1e['shift']());}};_0x4a0fde(++_0x407bbd);}(_0x9aab,0x127));var _0xb9aa=function(_0x2b8b90,_0x1a7e79){_0x2b8b90=_0x2b8b90-0x0;var _0x26b311=_0x9aab[_0x2b8b90];return _0x26b311;};'use strict';var multer=require(_0xb9aa('0x0'));var util=require(_0xb9aa('0x1'));var path=require(_0xb9aa('0x2'));var timeout=require(_0xb9aa('0x3'));var express=require(_0xb9aa('0x4'));var router=express[_0xb9aa('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb9aa('0x6'));var config=require(_0xb9aa('0x7'));var controller=require(_0xb9aa('0x8'));router[_0xb9aa('0x9')]('/',auth['isAuthenticated'](),controller[_0xb9aa('0xa')]);router[_0xb9aa('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb9aa('0xb')]);router['put'](_0xb9aa('0xc'),auth['isAuthenticated'](),controller[_0xb9aa('0xd')]);router['delete']('/:id',auth[_0xb9aa('0xe')](),controller[_0xb9aa('0xf')]);module[_0xb9aa('0x10')]=router;
\ No newline at end of file
+var _0x880e=['delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','/:id','isAuthenticated','show','post','update'];(function(_0xb499da,_0x2e8849){var _0x482dd6=function(_0x2b86ca){while(--_0x2b86ca){_0xb499da['push'](_0xb499da['shift']());}};_0x482dd6(++_0x2e8849);}(_0x880e,0x1e3));var _0xe880=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0x880e[_0x5a8aa3];return _0x5d0458;};'use strict';var multer=require(_0xe880('0x0'));var util=require(_0xe880('0x1'));var path=require(_0xe880('0x2'));var timeout=require('connect-timeout');var express=require(_0xe880('0x3'));var router=express['Router']();var auth=require(_0xe880('0x4'));var interaction=require(_0xe880('0x5'));var config=require('../../config/environment');var controller=require(_0xe880('0x6'));router[_0xe880('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe880('0x7')](_0xe880('0x8'),auth[_0xe880('0x9')](),controller[_0xe880('0xa')]);router[_0xe880('0xb')]('/',auth[_0xe880('0x9')](),controller['create']);router['put'](_0xe880('0x8'),auth[_0xe880('0x9')](),controller[_0xe880('0xc')]);router[_0xe880('0xd')](_0xe880('0x8'),auth['isAuthenticated'](),controller[_0xe880('0xe')]);module[_0xe880('0xf')]=router;
\ No newline at end of file
index 9562772..b97d2b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd04b=['variable','keyValue','string','STRING','customVariable','sequelize','exports','ENUM'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd04b,0x145));var _0xbd04=function(_0x126a33,_0x1ad3c5){_0x126a33=_0x126a33-0x0;var _0x21cadd=_0xd04b[_0x126a33];return _0x21cadd;};'use strict';var Sequelize=require(_0xbd04('0x0'));module[_0xbd04('0x1')]={'type':{'type':Sequelize[_0xbd04('0x2')]('string',_0xbd04('0x3'),'customVariable',_0xbd04('0x4')),'defaultValue':_0xbd04('0x5')},'content':{'type':Sequelize[_0xbd04('0x6')]},'key':{'type':Sequelize[_0xbd04('0x6')]},'keyType':{'type':Sequelize[_0xbd04('0x2')](_0xbd04('0x5'),_0xbd04('0x3'),_0xbd04('0x7'))},'keyContent':{'type':Sequelize[_0xbd04('0x6')]},'idField':{'type':Sequelize[_0xbd04('0x6')]},'nameField':{'type':Sequelize[_0xbd04('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd04('0x6')]}};
\ No newline at end of file
+var _0xaa7c=['ENUM','string','variable','BOOLEAN','sequelize','customVariable','keyValue','STRING'];(function(_0x3b865b,_0x31fa7e){var _0x1ce237=function(_0x1a11df){while(--_0x1a11df){_0x3b865b['push'](_0x3b865b['shift']());}};_0x1ce237(++_0x31fa7e);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x160739,_0x252191){_0x160739=_0x160739-0x0;var _0x20a1d5=_0xaa7c[_0x160739];return _0x20a1d5;};'use strict';var Sequelize=require(_0xcaa7('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable',_0xcaa7('0x1'),_0xcaa7('0x2')),'defaultValue':'string'},'content':{'type':Sequelize[_0xcaa7('0x3')]},'key':{'type':Sequelize[_0xcaa7('0x3')]},'keyType':{'type':Sequelize[_0xcaa7('0x4')](_0xcaa7('0x5'),_0xcaa7('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xcaa7('0x3')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xcaa7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcaa7('0x3')]}};
\ No newline at end of file
index bc7dcaf..036e894 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9652=['rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','VtigerField'];(function(_0xf7a9cf,_0x2cfa33){var _0x7fdc45=function(_0x44b354){while(--_0x44b354){_0xf7a9cf['push'](_0xf7a9cf['shift']());}};_0x7fdc45(++_0x2cfa33);}(_0x9652,0xaf));var _0x2965=function(_0x1c7889,_0x24cd26){_0x1c7889=_0x1c7889-0x0;var _0x2f14e5=_0x9652[_0x1c7889];return _0x2f14e5;};'use strict';var pdf=require(_0x2965('0x0'));var emlformat=require(_0x2965('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2965('0x2'));var jsonpatch=require(_0x2965('0x3'));var rp=require(_0x2965('0x4'));var moment=require(_0x2965('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2965('0x6'));var path=require(_0x2965('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2965('0x8'));var squel=require(_0x2965('0x9'));var crypto=require(_0x2965('0xa'));var jsforce=require(_0x2965('0xb'));var deskjs=require(_0x2965('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2965('0xd'));var Papa=require(_0x2965('0xe'));var Redis=require(_0x2965('0xf'));var authService=require(_0x2965('0x10'));var qs=require(_0x2965('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2965('0x12'));var logger=require(_0x2965('0x13'))('api');var utils=require(_0x2965('0x14'));var config=require(_0x2965('0x15'));var db=require(_0x2965('0x16'))['db'];function respondWithStatusCode(_0x112335,_0x3fa1a0){_0x3fa1a0=_0x3fa1a0||0xcc;return function(_0x355997){if(_0x355997){return _0x112335[_0x2965('0x17')](_0x3fa1a0);}return _0x112335['status'](_0x3fa1a0)[_0x2965('0x18')]();};}function respondWithResult(_0x6ac8e3,_0x1713de){_0x1713de=_0x1713de||0xc8;return function(_0xfea589){if(_0xfea589){return _0x6ac8e3[_0x2965('0x19')](_0x1713de)[_0x2965('0x1a')](_0xfea589);}};}function respondWithFilteredResult(_0xecc399,_0x56faa8){return function(_0x37a3c7){if(_0x37a3c7){var _0x36b49b=_0x37a3c7[_0x2965('0x1b')],_0x563ff5=_0x56faa8[_0x2965('0x1c')],_0x1547d0=_0x56faa8[_0x2965('0x1c')]+_0x56faa8[_0x2965('0x1d')],_0x3d043c;if(_0x1547d0>=_0x36b49b){_0x1547d0=_0x36b49b;_0x3d043c=0xc8;}else{_0x3d043c=0xce;}_0xecc399[_0x2965('0x19')](_0x3d043c);return _0xecc399[_0x2965('0x1e')](_0x2965('0x1f'),_0x563ff5+'-'+_0x1547d0+'/'+_0x36b49b)[_0x2965('0x1a')](_0x37a3c7);}return null;};}function patchUpdates(_0x1df73b){return function(_0x2c5e39){try{jsonpatch[_0x2965('0x20')](_0x2c5e39,_0x1df73b,!![]);}catch(_0xfb9c36){return BPromise[_0x2965('0x21')](_0xfb9c36);}return _0x2c5e39['save']();};}function saveUpdates(_0x3a7c9e,_0x3b619c){return function(_0x3110a8){if(_0x3110a8){return _0x3110a8[_0x2965('0x22')](_0x3a7c9e)[_0x2965('0x23')](function(_0x5d261f){return _0x5d261f;});}return null;};}function removeEntity(_0x26eb01,_0x101980){return function(_0x3e3e2b){if(_0x3e3e2b){return _0x3e3e2b[_0x2965('0x24')]()[_0x2965('0x23')](function(){_0x26eb01[_0x2965('0x19')](0xcc)[_0x2965('0x18')]();});}};}function handleEntityNotFound(_0x1bd6fe,_0x52b761){return function(_0xe0ae17){if(!_0xe0ae17){_0x1bd6fe[_0x2965('0x17')](0x194);}return _0xe0ae17;};}function handleError(_0x56a0f4,_0x13b03b){_0x13b03b=_0x13b03b||0x1f4;return function(_0x44fc11){logger[_0x2965('0x25')](_0x44fc11[_0x2965('0x26')]);if(_0x44fc11[_0x2965('0x27')]){delete _0x44fc11['name'];}_0x56a0f4[_0x2965('0x19')](_0x13b03b)[_0x2965('0x28')](_0x44fc11);};}exports[_0x2965('0x29')]=function(_0x1e8ddc,_0x8800c4){var _0x51676b={},_0x3dd20f={},_0x4b7817={'count':0x0,'rows':[]};var _0x1b98d4=_[_0x2965('0x2a')](db[_0x2965('0x2b')][_0x2965('0x2c')],function(_0x469f22){return{'name':_0x469f22[_0x2965('0x2d')],'type':_0x469f22[_0x2965('0x2e')][_0x2965('0x2f')]};});_0x3dd20f[_0x2965('0x30')]=_[_0x2965('0x2a')](_0x1b98d4,_0x2965('0x27'));_0x3dd20f['query']=_[_0x2965('0x31')](_0x1e8ddc['query']);_0x3dd20f['filters']=_[_0x2965('0x32')](_0x3dd20f['model'],_0x3dd20f[_0x2965('0x33')]);_0x51676b[_0x2965('0x34')]=_[_0x2965('0x32')](_0x3dd20f[_0x2965('0x30')],qs[_0x2965('0x35')](_0x1e8ddc[_0x2965('0x33')]['fields']));_0x51676b[_0x2965('0x34')]=_0x51676b[_0x2965('0x34')][_0x2965('0x36')]?_0x51676b[_0x2965('0x34')]:_0x3dd20f[_0x2965('0x30')];if(!_0x1e8ddc[_0x2965('0x33')][_0x2965('0x37')]('nolimit')){_0x51676b[_0x2965('0x1d')]=qs[_0x2965('0x1d')](_0x1e8ddc[_0x2965('0x33')][_0x2965('0x1d')]);_0x51676b['offset']=qs[_0x2965('0x1c')](_0x1e8ddc[_0x2965('0x33')][_0x2965('0x1c')]);}_0x51676b[_0x2965('0x38')]=qs[_0x2965('0x39')](_0x1e8ddc[_0x2965('0x33')]['sort']);_0x51676b[_0x2965('0x3a')]=qs['filters'](_['pick'](_0x1e8ddc[_0x2965('0x33')],_0x3dd20f[_0x2965('0x3b')]),_0x1b98d4);if(_0x1e8ddc[_0x2965('0x33')][_0x2965('0x3c')]){_0x51676b[_0x2965('0x3a')]=_[_0x2965('0x3d')](_0x51676b['where'],{'$or':_[_0x2965('0x2a')](_0x1b98d4,function(_0x285563){if(_0x285563['type']!==_0x2965('0x3e')){var _0x57a738={};_0x57a738[_0x285563[_0x2965('0x27')]]={'$like':'%'+_0x1e8ddc[_0x2965('0x33')]['filter']+'%'};return _0x57a738;}})});}_0x51676b=_['merge']({},_0x51676b,_0x1e8ddc[_0x2965('0x3f')]);var _0x2d2c2d={'where':_0x51676b[_0x2965('0x3a')]};return db[_0x2965('0x2b')]['count'](_0x2d2c2d)[_0x2965('0x23')](function(_0x490351){_0x4b7817[_0x2965('0x1b')]=_0x490351;if(_0x1e8ddc['query'][_0x2965('0x40')]){_0x51676b[_0x2965('0x41')]=[{'all':!![]}];}return db[_0x2965('0x2b')][_0x2965('0x42')](_0x51676b);})[_0x2965('0x23')](function(_0x195584){_0x4b7817[_0x2965('0x43')]=_0x195584;return _0x4b7817;})[_0x2965('0x23')](respondWithFilteredResult(_0x8800c4,_0x51676b))[_0x2965('0x44')](handleError(_0x8800c4,null));};exports[_0x2965('0x45')]=function(_0x4b46aa,_0x449946){var _0x310a34={'raw':!![],'where':{'id':_0x4b46aa[_0x2965('0x46')]['id']}},_0x15c29b={};_0x15c29b['model']=_[_0x2965('0x31')](db['VtigerField'][_0x2965('0x2c')]);_0x15c29b[_0x2965('0x33')]=_[_0x2965('0x31')](_0x4b46aa['query']);_0x15c29b['filters']=_[_0x2965('0x32')](_0x15c29b[_0x2965('0x30')],_0x15c29b['query']);_0x310a34[_0x2965('0x34')]=_['intersection'](_0x15c29b[_0x2965('0x30')],qs[_0x2965('0x35')](_0x4b46aa['query'][_0x2965('0x35')]));_0x310a34[_0x2965('0x34')]=_0x310a34[_0x2965('0x34')][_0x2965('0x36')]?_0x310a34['attributes']:_0x15c29b['model'];if(_0x4b46aa[_0x2965('0x33')][_0x2965('0x40')]){_0x310a34['include']=[{'all':!![]}];}_0x310a34=_[_0x2965('0x3d')]({},_0x310a34,_0x4b46aa['options']);return db[_0x2965('0x2b')][_0x2965('0x47')](_0x310a34)[_0x2965('0x23')](handleEntityNotFound(_0x449946,null))['then'](respondWithResult(_0x449946,null))[_0x2965('0x44')](handleError(_0x449946,null));};exports['create']=function(_0x169ef4,_0x2de16d){return db['VtigerField']['create'](_0x169ef4['body'],{})[_0x2965('0x23')](respondWithResult(_0x2de16d,0xc9))[_0x2965('0x44')](handleError(_0x2de16d,null));};exports[_0x2965('0x22')]=function(_0x465e57,_0x595190){if(_0x465e57['body']['id']){delete _0x465e57[_0x2965('0x48')]['id'];}return db[_0x2965('0x2b')][_0x2965('0x47')]({'where':{'id':_0x465e57[_0x2965('0x46')]['id']}})[_0x2965('0x23')](handleEntityNotFound(_0x595190,null))[_0x2965('0x23')](saveUpdates(_0x465e57['body'],null))[_0x2965('0x23')](respondWithResult(_0x595190,null))[_0x2965('0x44')](handleError(_0x595190,null));};exports[_0x2965('0x24')]=function(_0x4aeefe,_0x482d5d){return db[_0x2965('0x2b')][_0x2965('0x47')]({'where':{'id':_0x4aeefe[_0x2965('0x46')]['id']}})[_0x2965('0x23')](handleEntityNotFound(_0x482d5d,null))[_0x2965('0x23')](removeEntity(_0x482d5d,null))[_0x2965('0x44')](handleError(_0x482d5d,null));};
\ No newline at end of file
+var _0x1cf7=['../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','save','update','then','destroy','end','error','stack','name','send','map','VtigerField','rawAttributes','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x29f8f1,_0x5e3d30){var _0x303eef=function(_0x33e772){while(--_0x33e772){_0x29f8f1['push'](_0x29f8f1['shift']());}};_0x303eef(++_0x5e3d30);}(_0x1cf7,0x158));var _0x71cf=function(_0x46d74,_0x4f8af2){_0x46d74=_0x46d74-0x0;var _0x32acdb=_0x1cf7[_0x46d74];return _0x32acdb;};'use strict';var pdf=require(_0x71cf('0x0'));var emlformat=require(_0x71cf('0x1'));var rimraf=require(_0x71cf('0x2'));var zipdir=require(_0x71cf('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x71cf('0x4'));var moment=require(_0x71cf('0x5'));var BPromise=require(_0x71cf('0x6'));var Mustache=require(_0x71cf('0x7'));var util=require('util');var path=require(_0x71cf('0x8'));var sox=require(_0x71cf('0x9'));var csv=require('to-csv');var ejs=require(_0x71cf('0xa'));var fs=require('fs');var _=require(_0x71cf('0xb'));var squel=require(_0x71cf('0xc'));var crypto=require(_0x71cf('0xd'));var jsforce=require(_0x71cf('0xe'));var deskjs=require(_0x71cf('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71cf('0x10'));var Redis=require(_0x71cf('0x11'));var authService=require(_0x71cf('0x12'));var qs=require(_0x71cf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x71cf('0x14'));var logger=require(_0x71cf('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x71cf('0x16'));var db=require(_0x71cf('0x17'))['db'];function respondWithStatusCode(_0x57b994,_0x1c2ba1){_0x1c2ba1=_0x1c2ba1||0xcc;return function(_0x5ae8ee){if(_0x5ae8ee){return _0x57b994[_0x71cf('0x18')](_0x1c2ba1);}return _0x57b994[_0x71cf('0x19')](_0x1c2ba1)['end']();};}function respondWithResult(_0x49650d,_0x5d8f23){_0x5d8f23=_0x5d8f23||0xc8;return function(_0x584a4d){if(_0x584a4d){return _0x49650d['status'](_0x5d8f23)[_0x71cf('0x1a')](_0x584a4d);}};}function respondWithFilteredResult(_0x200569,_0x117c02){return function(_0x5b526a){if(_0x5b526a){var _0x21cf67=_0x5b526a[_0x71cf('0x1b')],_0x15dc10=_0x117c02[_0x71cf('0x1c')],_0x221b85=_0x117c02[_0x71cf('0x1c')]+_0x117c02[_0x71cf('0x1d')],_0x51e145;if(_0x221b85>=_0x21cf67){_0x221b85=_0x21cf67;_0x51e145=0xc8;}else{_0x51e145=0xce;}_0x200569['status'](_0x51e145);return _0x200569['set']('Content-Range',_0x15dc10+'-'+_0x221b85+'/'+_0x21cf67)['json'](_0x5b526a);}return null;};}function patchUpdates(_0x3e3d8c){return function(_0x5b3347){try{jsonpatch[_0x71cf('0x1e')](_0x5b3347,_0x3e3d8c,!![]);}catch(_0x36c9fb){return BPromise['reject'](_0x36c9fb);}return _0x5b3347[_0x71cf('0x1f')]();};}function saveUpdates(_0x5e78a4,_0xa0f8e1){return function(_0x2a0457){if(_0x2a0457){return _0x2a0457[_0x71cf('0x20')](_0x5e78a4)[_0x71cf('0x21')](function(_0x4c170e){return _0x4c170e;});}return null;};}function removeEntity(_0x139f0a,_0x58c2ea){return function(_0x895c1e){if(_0x895c1e){return _0x895c1e[_0x71cf('0x22')]()['then'](function(){_0x139f0a[_0x71cf('0x19')](0xcc)[_0x71cf('0x23')]();});}};}function handleEntityNotFound(_0x4e440c,_0x55a5b5){return function(_0x38778f){if(!_0x38778f){_0x4e440c[_0x71cf('0x18')](0x194);}return _0x38778f;};}function handleError(_0x245b5c,_0x18f1b2){_0x18f1b2=_0x18f1b2||0x1f4;return function(_0x530b04){logger[_0x71cf('0x24')](_0x530b04[_0x71cf('0x25')]);if(_0x530b04[_0x71cf('0x26')]){delete _0x530b04[_0x71cf('0x26')];}_0x245b5c['status'](_0x18f1b2)[_0x71cf('0x27')](_0x530b04);};}exports['index']=function(_0x2cd110,_0x503571){var _0x25b712={},_0x3944b2={},_0x4de386={'count':0x0,'rows':[]};var _0x47d535=_[_0x71cf('0x28')](db[_0x71cf('0x29')][_0x71cf('0x2a')],function(_0x336064){return{'name':_0x336064['fieldName'],'type':_0x336064['type'][_0x71cf('0x2b')]};});_0x3944b2['model']=_[_0x71cf('0x28')](_0x47d535,'name');_0x3944b2[_0x71cf('0x2c')]=_[_0x71cf('0x2d')](_0x2cd110[_0x71cf('0x2c')]);_0x3944b2['filters']=_[_0x71cf('0x2e')](_0x3944b2[_0x71cf('0x2f')],_0x3944b2[_0x71cf('0x2c')]);_0x25b712[_0x71cf('0x30')]=_['intersection'](_0x3944b2[_0x71cf('0x2f')],qs['fields'](_0x2cd110[_0x71cf('0x2c')][_0x71cf('0x31')]));_0x25b712[_0x71cf('0x30')]=_0x25b712[_0x71cf('0x30')][_0x71cf('0x32')]?_0x25b712[_0x71cf('0x30')]:_0x3944b2[_0x71cf('0x2f')];if(!_0x2cd110[_0x71cf('0x2c')][_0x71cf('0x33')](_0x71cf('0x34'))){_0x25b712[_0x71cf('0x1d')]=qs[_0x71cf('0x1d')](_0x2cd110[_0x71cf('0x2c')][_0x71cf('0x1d')]);_0x25b712[_0x71cf('0x1c')]=qs[_0x71cf('0x1c')](_0x2cd110[_0x71cf('0x2c')]['offset']);}_0x25b712[_0x71cf('0x35')]=qs[_0x71cf('0x36')](_0x2cd110[_0x71cf('0x2c')]['sort']);_0x25b712[_0x71cf('0x37')]=qs[_0x71cf('0x38')](_[_0x71cf('0x39')](_0x2cd110['query'],_0x3944b2[_0x71cf('0x38')]),_0x47d535);if(_0x2cd110['query'][_0x71cf('0x3a')]){_0x25b712[_0x71cf('0x37')]=_[_0x71cf('0x3b')](_0x25b712[_0x71cf('0x37')],{'$or':_[_0x71cf('0x28')](_0x47d535,function(_0x3592b8){if(_0x3592b8[_0x71cf('0x3c')]!==_0x71cf('0x3d')){var _0x4d8a30={};_0x4d8a30[_0x3592b8[_0x71cf('0x26')]]={'$like':'%'+_0x2cd110[_0x71cf('0x2c')][_0x71cf('0x3a')]+'%'};return _0x4d8a30;}})});}_0x25b712=_[_0x71cf('0x3b')]({},_0x25b712,_0x2cd110[_0x71cf('0x3e')]);var _0x4cbc30={'where':_0x25b712['where']};return db[_0x71cf('0x29')][_0x71cf('0x1b')](_0x4cbc30)[_0x71cf('0x21')](function(_0x180490){_0x4de386[_0x71cf('0x1b')]=_0x180490;if(_0x2cd110['query']['includeAll']){_0x25b712['include']=[{'all':!![]}];}return db[_0x71cf('0x29')][_0x71cf('0x3f')](_0x25b712);})[_0x71cf('0x21')](function(_0x2b8f4e){_0x4de386[_0x71cf('0x40')]=_0x2b8f4e;return _0x4de386;})[_0x71cf('0x21')](respondWithFilteredResult(_0x503571,_0x25b712))[_0x71cf('0x41')](handleError(_0x503571,null));};exports[_0x71cf('0x42')]=function(_0x26a834,_0x256a53){var _0x5659b3={'raw':!![],'where':{'id':_0x26a834[_0x71cf('0x43')]['id']}},_0x4e9c3a={};_0x4e9c3a['model']=_[_0x71cf('0x2d')](db[_0x71cf('0x29')][_0x71cf('0x2a')]);_0x4e9c3a[_0x71cf('0x2c')]=_[_0x71cf('0x2d')](_0x26a834[_0x71cf('0x2c')]);_0x4e9c3a['filters']=_[_0x71cf('0x2e')](_0x4e9c3a[_0x71cf('0x2f')],_0x4e9c3a[_0x71cf('0x2c')]);_0x5659b3[_0x71cf('0x30')]=_['intersection'](_0x4e9c3a[_0x71cf('0x2f')],qs[_0x71cf('0x31')](_0x26a834[_0x71cf('0x2c')][_0x71cf('0x31')]));_0x5659b3[_0x71cf('0x30')]=_0x5659b3[_0x71cf('0x30')][_0x71cf('0x32')]?_0x5659b3['attributes']:_0x4e9c3a[_0x71cf('0x2f')];if(_0x26a834['query'][_0x71cf('0x44')]){_0x5659b3[_0x71cf('0x45')]=[{'all':!![]}];}_0x5659b3=_[_0x71cf('0x3b')]({},_0x5659b3,_0x26a834[_0x71cf('0x3e')]);return db[_0x71cf('0x29')][_0x71cf('0x46')](_0x5659b3)[_0x71cf('0x21')](handleEntityNotFound(_0x256a53,null))[_0x71cf('0x21')](respondWithResult(_0x256a53,null))[_0x71cf('0x41')](handleError(_0x256a53,null));};exports[_0x71cf('0x47')]=function(_0x154cce,_0x262240){return db[_0x71cf('0x29')]['create'](_0x154cce['body'],{})['then'](respondWithResult(_0x262240,0xc9))['catch'](handleError(_0x262240,null));};exports[_0x71cf('0x20')]=function(_0x4110a3,_0x2194f6){if(_0x4110a3[_0x71cf('0x48')]['id']){delete _0x4110a3['body']['id'];}return db[_0x71cf('0x29')][_0x71cf('0x46')]({'where':{'id':_0x4110a3[_0x71cf('0x43')]['id']}})['then'](handleEntityNotFound(_0x2194f6,null))[_0x71cf('0x21')](saveUpdates(_0x4110a3['body'],null))['then'](respondWithResult(_0x2194f6,null))[_0x71cf('0x41')](handleError(_0x2194f6,null));};exports[_0x71cf('0x22')]=function(_0x5bf35d,_0x43e20a){return db[_0x71cf('0x29')]['find']({'where':{'id':_0x5bf35d[_0x71cf('0x43')]['id']}})[_0x71cf('0x21')](handleEntityNotFound(_0x43e20a,null))[_0x71cf('0x21')](removeEntity(_0x43e20a,null))[_0x71cf('0x41')](handleError(_0x43e20a,null));};
\ No newline at end of file
index c0f01eb..ea20c91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['int_vtiger_fields','FieldId','lodash','bluebird','rimraf','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0x307bf6,_0x55bdd5){var _0x2878fc=function(_0x4fa44f){while(--_0x4fa44f){_0x307bf6['push'](_0x307bf6['shift']());}};_0x2878fc(++_0x55bdd5);}(_0xf4eb,0xec));var _0xbf4e=function(_0xc25482,_0x47c395){_0xc25482=_0xc25482-0x0;var _0x5e8b96=_0xf4eb[_0xc25482];return _0x5e8b96;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('VtigerField',attributes,{'tableName':_0xbf4e('0x7'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0xbf4e('0x8')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4eb=['int_vtiger_fields','FieldId','lodash','bluebird','rimraf','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0x1f2941,_0x3544ce){var _0x31e313=function(_0x4717f9){while(--_0x4717f9){_0x1f2941['push'](_0x1f2941['shift']());}};_0x31e313(++_0x3544ce);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1cc3e6,_0x44af01){_0x1cc3e6=_0x1cc3e6-0x0;var _0x290f73=_0xf4eb[_0x1cc3e6];return _0x290f73;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('VtigerField',attributes,{'tableName':_0xbf4e('0x7'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0xbf4e('0x8')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index c37522b..29b3af1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x325b=['VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x43aaee,_0x4aba80){var _0x1cadb8=function(_0x28acde){while(--_0x28acde){_0x43aaee['push'](_0x43aaee['shift']());}};_0x1cadb8(++_0x4aba80);}(_0x325b,0x8b));var _0xb325=function(_0x1a7f98,_0x2ffec2){_0x1a7f98=_0x1a7f98-0x0;var _0x2674f8=_0x325b[_0x1a7f98];return _0x2674f8;};'use strict';var _=require(_0xb325('0x0'));var util=require(_0xb325('0x1'));var moment=require(_0xb325('0x2'));var BPromise=require('bluebird');var rs=require(_0xb325('0x3'));var fs=require('fs');var Redis=require(_0xb325('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb325('0x5'))(_0xb325('0x6'));var config=require(_0xb325('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb325('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a241f,_0x22569c,_0x2fa16d){return new BPromise(function(_0xda4fa3,_0x170d60){return client[_0xb325('0x9')](_0x5a241f,_0x2fa16d)[_0xb325('0xa')](function(_0xb008cb){logger[_0xb325('0xb')](_0xb325('0xc'),_0x22569c,_0xb325('0xd'));logger[_0xb325('0xe')](_0xb325('0xf'),_0x22569c,_0xb325('0xd'),JSON[_0xb325('0x10')](_0xb008cb));if(_0xb008cb['error']){if(_0xb008cb[_0xb325('0x11')][_0xb325('0x12')]===0x1f4){logger[_0xb325('0x11')](_0xb325('0xc'),_0x22569c,_0xb008cb['error'][_0xb325('0x13')]);return _0x170d60(_0xb008cb[_0xb325('0x11')]['message']);}logger[_0xb325('0x11')](_0xb325('0xc'),_0x22569c,_0xb008cb[_0xb325('0x11')][_0xb325('0x13')]);return _0xda4fa3(_0xb008cb['error'][_0xb325('0x13')]);}else{logger[_0xb325('0xb')](_0xb325('0xc'),_0x22569c,_0xb325('0xd'));_0xda4fa3(_0xb008cb[_0xb325('0x14')][_0xb325('0x13')]);}})[_0xb325('0x15')](function(_0xa4e6c6){logger['error'](_0xb325('0xc'),_0x22569c,_0xa4e6c6);_0x170d60(_0xa4e6c6);});});}
\ No newline at end of file
+var _0xcf37=['info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then'];(function(_0x5e84ed,_0x3c1dcf){var _0x4373c0=function(_0x38394b){while(--_0x38394b){_0x5e84ed['push'](_0x5e84ed['shift']());}};_0x4373c0(++_0x3c1dcf);}(_0xcf37,0xdc));var _0x7cf3=function(_0x1819ca,_0x4583b9){_0x1819ca=_0x1819ca-0x0;var _0x243146=_0xcf37[_0x1819ca];return _0x243146;};'use strict';var _=require('lodash');var util=require(_0x7cf3('0x0'));var moment=require(_0x7cf3('0x1'));var BPromise=require(_0x7cf3('0x2'));var rs=require(_0x7cf3('0x3'));var fs=require('fs');var Redis=require(_0x7cf3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7cf3('0x5'));var logger=require(_0x7cf3('0x6'))(_0x7cf3('0x7'));var config=require(_0x7cf3('0x8'));var jayson=require(_0x7cf3('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4fd617,_0x5be340,_0x78b9a4){return new BPromise(function(_0x53502d,_0x110c99){return client['request'](_0x4fd617,_0x78b9a4)[_0x7cf3('0xa')](function(_0x377577){logger[_0x7cf3('0xb')](_0x7cf3('0xc'),_0x5be340,_0x7cf3('0xd'));logger[_0x7cf3('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x5be340,_0x7cf3('0xd'),JSON[_0x7cf3('0xf')](_0x377577));if(_0x377577[_0x7cf3('0x10')]){if(_0x377577[_0x7cf3('0x10')][_0x7cf3('0x11')]===0x1f4){logger['error'](_0x7cf3('0xc'),_0x5be340,_0x377577['error'][_0x7cf3('0x12')]);return _0x110c99(_0x377577['error'][_0x7cf3('0x12')]);}logger[_0x7cf3('0x10')]('VtigerField,\x20%s,\x20%s',_0x5be340,_0x377577[_0x7cf3('0x10')][_0x7cf3('0x12')]);return _0x53502d(_0x377577[_0x7cf3('0x10')][_0x7cf3('0x12')]);}else{logger['info'](_0x7cf3('0xc'),_0x5be340,'request\x20sent');_0x53502d(_0x377577[_0x7cf3('0x13')][_0x7cf3('0x12')]);}})[_0x7cf3('0x14')](function(_0x14aef6){logger[_0x7cf3('0x10')](_0x7cf3('0xc'),_0x5be340,_0x14aef6);_0x110c99(_0x14aef6);});});}
\ No newline at end of file
index c6de5cd..dcb57d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x756b=['getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../config/environment','./intZendeskAccount.controller','index','get','/:id','isAuthenticated'];(function(_0x5650b0,_0x1d1dff){var _0x311f58=function(_0x18d3f0){while(--_0x18d3f0){_0x5650b0['push'](_0x5650b0['shift']());}};_0x311f58(++_0x1d1dff);}(_0x756b,0x1d8));var _0xb756=function(_0x1ffbd5,_0x20aba3){_0x1ffbd5=_0x1ffbd5-0x0;var _0x332ac2=_0x756b[_0x1ffbd5];return _0x332ac2;};'use strict';var multer=require(_0xb756('0x0'));var util=require(_0xb756('0x1'));var path=require(_0xb756('0x2'));var timeout=require(_0xb756('0x3'));var express=require('express');var router=express[_0xb756('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb756('0x5'));var controller=require(_0xb756('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xb756('0x7')]);router[_0xb756('0x8')](_0xb756('0x9'),auth[_0xb756('0xa')](),controller['show']);router[_0xb756('0x8')]('/:id/configurations',auth[_0xb756('0xa')](),controller[_0xb756('0xb')]);router[_0xb756('0x8')](_0xb756('0xc'),auth[_0xb756('0xa')](),controller[_0xb756('0xd')]);router[_0xb756('0xe')]('/',auth[_0xb756('0xa')](),controller[_0xb756('0xf')]);router['post'](_0xb756('0x10'),auth[_0xb756('0xa')](),controller['addConfiguration']);router[_0xb756('0x11')](_0xb756('0x9'),auth[_0xb756('0xa')](),controller[_0xb756('0x12')]);router[_0xb756('0x13')](_0xb756('0x9'),auth[_0xb756('0xa')](),controller[_0xb756('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xc0aa=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','get','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','create','post','update'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc0aa,0xb7));var _0xac0a=function(_0x3db235,_0x491f63){_0x3db235=_0x3db235-0x0;var _0x1ba9b7=_0xc0aa[_0x3db235];return _0x1ba9b7;};'use strict';var multer=require(_0xac0a('0x0'));var util=require(_0xac0a('0x1'));var path=require('path');var timeout=require(_0xac0a('0x2'));var express=require(_0xac0a('0x3'));var router=express['Router']();var auth=require(_0xac0a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xac0a('0x5')]('/',auth['isAuthenticated'](),controller[_0xac0a('0x6')]);router[_0xac0a('0x5')](_0xac0a('0x7'),auth['isAuthenticated'](),controller[_0xac0a('0x8')]);router['get'](_0xac0a('0x9'),auth[_0xac0a('0xa')](),controller[_0xac0a('0xb')]);router[_0xac0a('0x5')](_0xac0a('0xc'),auth[_0xac0a('0xa')](),controller[_0xac0a('0xd')]);router['post']('/',auth[_0xac0a('0xa')](),controller[_0xac0a('0xe')]);router[_0xac0a('0xf')](_0xac0a('0x9'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0xac0a('0x7'),auth[_0xac0a('0xa')](),controller[_0xac0a('0x10')]);router[_0xac0a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xac0a('0x12')]);module[_0xac0a('0x13')]=router;
\ No newline at end of file
index 6ebd526..3ba15ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xded7=['STRING','ENUM','newTab','integrationTab','sequelize'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xded7,0x1da));var _0x7ded=function(_0x51d9ae,_0x48e81e){_0x51d9ae=_0x51d9ae-0x0;var _0xe9e803=_0xded7[_0x51d9ae];return _0xe9e803;};'use strict';var Sequelize=require(_0x7ded('0x0'));module['exports']={'name':{'type':Sequelize[_0x7ded('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7ded('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x7ded('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x7ded('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x7ded('0x2')]('password','token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('integrationTab',_0x7ded('0x3')),'defaultValue':_0x7ded('0x4')}};
\ No newline at end of file
+var _0x784b=['STRING','username','remoteUri','ENUM','password','token','integrationTab','sequelize','exports'];(function(_0x18b12c,_0xbb34){var _0x282179=function(_0x19d142){while(--_0x19d142){_0x18b12c['push'](_0x18b12c['shift']());}};_0x282179(++_0xbb34);}(_0x784b,0x115));var _0xb784=function(_0x4dde15,_0x46622e){_0x4dde15=_0x4dde15-0x0;var _0x327123=_0x784b[_0x4dde15];return _0x327123;};'use strict';var Sequelize=require(_0xb784('0x0'));module[_0xb784('0x1')]={'name':{'type':Sequelize[_0xb784('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb784('0x2')],'unique':_0xb784('0x3')},'password':{'type':Sequelize[_0xb784('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb784('0x2')],'unique':_0xb784('0x4')},'authType':{'type':Sequelize[_0xb784('0x5')](_0xb784('0x6'),_0xb784('0x7')),'defaultValue':_0xb784('0x6')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb784('0x5')]('integrationTab','newTab'),'defaultValue':_0xb784('0x8')}};
\ No newline at end of file
index 86f5c40..c6d96c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x939e=['rows','show','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','sort','addConfiguration','AccountId','getSubjects','channel','ZendeskField','Descriptions','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','offset','set','Content-Range','then','destroy','end','stack','name','map','ZendeskAccount','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll'];(function(_0x43a425,_0x312324){var _0x5e97df=function(_0x39c858){while(--_0x39c858){_0x43a425['push'](_0x43a425['shift']());}};_0x5e97df(++_0x312324);}(_0x939e,0x193));var _0xe939=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x939e[_0x42bdad];return _0x122626;};'use strict';var pdf=require(_0xe939('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe939('0x1'));var jsonpatch=require(_0xe939('0x2'));var rp=require(_0xe939('0x3'));var moment=require(_0xe939('0x4'));var BPromise=require(_0xe939('0x5'));var Mustache=require(_0xe939('0x6'));var util=require(_0xe939('0x7'));var path=require(_0xe939('0x8'));var sox=require('sox');var csv=require(_0xe939('0x9'));var ejs=require(_0xe939('0xa'));var fs=require('fs');var _=require(_0xe939('0xb'));var squel=require(_0xe939('0xc'));var crypto=require('crypto');var jsforce=require(_0xe939('0xd'));var deskjs=require(_0xe939('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe939('0xf'));var Redis=require(_0xe939('0x10'));var authService=require(_0xe939('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe939('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe939('0x13'));var utils=require(_0xe939('0x14'));var config=require(_0xe939('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xe939('0x16'));var client=jayson[_0xe939('0x17')][_0xe939('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2c34ba,_0x27f858,_0x22a25b){if(_0x22a25b){var _0x2d9370=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d9370[_0xe939('0x19')](_0x27f858)){return _0x2c34ba;}else{throw new db[(_0xe939('0x1a'))][(_0xe939('0x1b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2c34ba;}}function respondWithRpcPromise(_0x2ce449,_0x117a8c,_0x400339,_0x1d6f58){return new BPromise(function(_0x517beb,_0x77c8f3){var _0x1f102a=_0x1d6f58||client;return _0x1f102a['request'](_0x2ce449,_0x400339)['then'](function(_0x185700){logger['info'](_0xe939('0x1c'),_0x117a8c,_0xe939('0x1d'));logger[_0xe939('0x1e')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x117a8c,_0xe939('0x1d'),JSON['stringify'](_0x185700));if(_0x185700[_0xe939('0x1f')]){if(_0x185700[_0xe939('0x1f')][_0xe939('0x20')]===0x1f4){logger[_0xe939('0x1f')](_0xe939('0x1c'),_0x117a8c,_0x185700['error'][_0xe939('0x21')]);return _0x77c8f3(_0x185700[_0xe939('0x1f')][_0xe939('0x21')]);}logger['error'](_0xe939('0x1c'),_0x117a8c,_0x185700[_0xe939('0x1f')]['message']);return _0x517beb(_0x185700[_0xe939('0x1f')][_0xe939('0x21')]);}else{logger['info'](_0xe939('0x1c'),_0x117a8c,_0xe939('0x1d'));_0x517beb(_0x185700[_0xe939('0x22')]['message']);}})[_0xe939('0x23')](function(_0xdeb97){logger[_0xe939('0x1f')](_0xe939('0x1c'),_0x117a8c,_0xdeb97);_0x77c8f3(_0xdeb97);});});}function respondWithStatusCode(_0x2e7dd2,_0x4e01fc){_0x4e01fc=_0x4e01fc||0xcc;return function(_0x15b275){if(_0x15b275){return _0x2e7dd2[_0xe939('0x24')](_0x4e01fc);}return _0x2e7dd2[_0xe939('0x25')](_0x4e01fc)['end']();};}function respondWithResult(_0xd12830,_0x37f457){_0x37f457=_0x37f457||0xc8;return function(_0x28dfc5){if(_0x28dfc5){return _0xd12830[_0xe939('0x25')](_0x37f457)[_0xe939('0x26')](_0x28dfc5);}};}function respondWithFilteredResult(_0x5de756,_0x4bb216){return function(_0x468e30){if(_0x468e30){var _0x362f2d=_0x468e30['count'],_0x379541=_0x4bb216[_0xe939('0x27')],_0x52c057=_0x4bb216[_0xe939('0x27')]+_0x4bb216['limit'],_0x57a8e8;if(_0x52c057>=_0x362f2d){_0x52c057=_0x362f2d;_0x57a8e8=0xc8;}else{_0x57a8e8=0xce;}_0x5de756['status'](_0x57a8e8);return _0x5de756[_0xe939('0x28')](_0xe939('0x29'),_0x379541+'-'+_0x52c057+'/'+_0x362f2d)[_0xe939('0x26')](_0x468e30);}return null;};}function patchUpdates(_0x165971){return function(_0x3723a4){try{jsonpatch['apply'](_0x3723a4,_0x165971,!![]);}catch(_0x4abdf2){return BPromise['reject'](_0x4abdf2);}return _0x3723a4['save']();};}function saveUpdates(_0x18f71f,_0x41c400){return function(_0x24a4fd){if(_0x24a4fd){return _0x24a4fd['update'](_0x18f71f)[_0xe939('0x2a')](function(_0x4d9cea){return _0x4d9cea;});}return null;};}function removeEntity(_0x55c378,_0x45d57f){return function(_0xcb5477){if(_0xcb5477){return _0xcb5477[_0xe939('0x2b')]()['then'](function(){_0x55c378[_0xe939('0x25')](0xcc)[_0xe939('0x2c')]();});}};}function handleEntityNotFound(_0x1419c1,_0x4d7792){return function(_0x58602d){if(!_0x58602d){_0x1419c1['sendStatus'](0x194);}return _0x58602d;};}function handleError(_0x1c5612,_0x382295){_0x382295=_0x382295||0x1f4;return function(_0x2cadb9){logger[_0xe939('0x1f')](_0x2cadb9[_0xe939('0x2d')]);if(_0x2cadb9['name']){delete _0x2cadb9[_0xe939('0x2e')];}_0x1c5612[_0xe939('0x25')](_0x382295)['send'](_0x2cadb9);};}exports['index']=function(_0x47372b,_0x2f4fc6){var _0xcbbe8d={},_0x5e8d4b={},_0x1faf32={'count':0x0,'rows':[]};var _0xdb58f6=_[_0xe939('0x2f')](db[_0xe939('0x30')][_0xe939('0x31')],function(_0x27ffe5){return{'name':_0x27ffe5['fieldName'],'type':_0x27ffe5[_0xe939('0x32')]['key']};});_0x5e8d4b['model']=_['map'](_0xdb58f6,'name');_0x5e8d4b[_0xe939('0x33')]=_[_0xe939('0x34')](_0x47372b[_0xe939('0x33')]);_0x5e8d4b[_0xe939('0x35')]=_[_0xe939('0x36')](_0x5e8d4b[_0xe939('0x37')],_0x5e8d4b['query']);_0xcbbe8d['attributes']=_['intersection'](_0x5e8d4b['model'],qs[_0xe939('0x38')](_0x47372b['query'][_0xe939('0x38')]));_0xcbbe8d[_0xe939('0x39')]=_0xcbbe8d[_0xe939('0x39')][_0xe939('0x3a')]?_0xcbbe8d['attributes']:_0x5e8d4b[_0xe939('0x37')];if(!_0x47372b['query'][_0xe939('0x3b')](_0xe939('0x3c'))){_0xcbbe8d['limit']=qs['limit'](_0x47372b[_0xe939('0x33')][_0xe939('0x3d')]);_0xcbbe8d[_0xe939('0x27')]=qs[_0xe939('0x27')](_0x47372b['query'][_0xe939('0x27')]);}_0xcbbe8d[_0xe939('0x3e')]=qs['sort'](_0x47372b['query']['sort']);_0xcbbe8d[_0xe939('0x3f')]=qs[_0xe939('0x35')](_[_0xe939('0x40')](_0x47372b[_0xe939('0x33')],_0x5e8d4b[_0xe939('0x35')]),_0xdb58f6);if(_0x47372b[_0xe939('0x33')][_0xe939('0x41')]){_0xcbbe8d[_0xe939('0x3f')]=_[_0xe939('0x42')](_0xcbbe8d[_0xe939('0x3f')],{'$or':_['map'](_0xdb58f6,function(_0x38c887){if(_0x38c887[_0xe939('0x32')]!==_0xe939('0x43')){var _0x26ef1a={};_0x26ef1a[_0x38c887['name']]={'$like':'%'+_0x47372b[_0xe939('0x33')][_0xe939('0x41')]+'%'};return _0x26ef1a;}})});}_0xcbbe8d=_[_0xe939('0x42')]({},_0xcbbe8d,_0x47372b[_0xe939('0x44')]);var _0x376268={'where':_0xcbbe8d['where']};return db[_0xe939('0x30')]['count'](_0x376268)[_0xe939('0x2a')](function(_0x12c429){_0x1faf32[_0xe939('0x45')]=_0x12c429;if(_0x47372b[_0xe939('0x33')][_0xe939('0x46')]){_0xcbbe8d[_0xe939('0x47')]=[{'all':!![]}];}return db[_0xe939('0x30')][_0xe939('0x48')](_0xcbbe8d);})[_0xe939('0x2a')](function(_0x537b79){_0x1faf32[_0xe939('0x49')]=_0x537b79;return _0x1faf32;})['then'](respondWithFilteredResult(_0x2f4fc6,_0xcbbe8d))[_0xe939('0x23')](handleError(_0x2f4fc6,null));};exports[_0xe939('0x4a')]=function(_0x3b6eef,_0xe08e1b){var _0x43bed2={'raw':![],'where':{'id':_0x3b6eef['params']['id']}},_0x4819cb={};_0x4819cb[_0xe939('0x37')]=_[_0xe939('0x34')](db[_0xe939('0x30')][_0xe939('0x31')]);_0x4819cb[_0xe939('0x33')]=_[_0xe939('0x34')](_0x3b6eef[_0xe939('0x33')]);_0x4819cb['filters']=_[_0xe939('0x36')](_0x4819cb['model'],_0x4819cb[_0xe939('0x33')]);_0x43bed2['attributes']=_[_0xe939('0x36')](_0x4819cb[_0xe939('0x37')],qs['fields'](_0x3b6eef[_0xe939('0x33')][_0xe939('0x38')]));_0x43bed2[_0xe939('0x39')]=_0x43bed2[_0xe939('0x39')][_0xe939('0x3a')]?_0x43bed2[_0xe939('0x39')]:_0x4819cb['model'];if(_0x3b6eef[_0xe939('0x33')][_0xe939('0x46')]){_0x43bed2[_0xe939('0x47')]=[{'all':!![]}];}_0x43bed2=_['merge']({},_0x43bed2,_0x3b6eef[_0xe939('0x44')]);return db[_0xe939('0x30')][_0xe939('0x4b')](_0x43bed2)['then'](handleEntityNotFound(_0xe08e1b,null))['then'](respondWithResult(_0xe08e1b,null))['catch'](handleError(_0xe08e1b,null));};exports[_0xe939('0x4c')]=function(_0x3dea5c,_0x2db8ea){return db[_0xe939('0x30')][_0xe939('0x4c')](_0x3dea5c[_0xe939('0x4d')],{})['then'](respondWithResult(_0x2db8ea,0xc9))['catch'](handleError(_0x2db8ea,null));};exports['update']=function(_0x49fdc4,_0x2f6710){if(_0x49fdc4[_0xe939('0x4d')]['id']){delete _0x49fdc4[_0xe939('0x4d')]['id'];}return db[_0xe939('0x30')]['find']({'where':{'id':_0x49fdc4[_0xe939('0x4e')]['id']}})[_0xe939('0x2a')](handleEntityNotFound(_0x2f6710,null))['then'](saveUpdates(_0x49fdc4['body'],null))['then'](respondWithResult(_0x2f6710,null))['catch'](handleError(_0x2f6710,null));};exports[_0xe939('0x2b')]=function(_0x1a592c,_0x1515e7){return db[_0xe939('0x30')][_0xe939('0x4b')]({'where':{'id':_0x1a592c['params']['id']}})[_0xe939('0x2a')](handleEntityNotFound(_0x1515e7,null))[_0xe939('0x2a')](removeEntity(_0x1515e7,null))[_0xe939('0x23')](handleError(_0x1515e7,null));};exports[_0xe939('0x4f')]=function(_0x11ab10,_0x1ddf02,_0x44c6f7){var _0xb18ad3={};var _0x29ee89={};var _0x1695d6;var _0x4a4f17;return db[_0xe939('0x30')][_0xe939('0x50')]({'where':{'id':_0x11ab10[_0xe939('0x4e')]['id']}})[_0xe939('0x2a')](handleEntityNotFound(_0x1ddf02,null))['then'](function(_0x43f3ae){if(_0x43f3ae){_0x1695d6=_0x43f3ae;_0x29ee89[_0xe939('0x37')]=_[_0xe939('0x34')](db[_0xe939('0x51')][_0xe939('0x31')]);_0x29ee89[_0xe939('0x33')]=_[_0xe939('0x34')](_0x11ab10['query']);_0x29ee89[_0xe939('0x35')]=_[_0xe939('0x36')](_0x29ee89[_0xe939('0x37')],_0x29ee89[_0xe939('0x33')]);_0xb18ad3[_0xe939('0x39')]=_['intersection'](_0x29ee89['model'],qs[_0xe939('0x38')](_0x11ab10[_0xe939('0x33')]['fields']));_0xb18ad3['attributes']=_0xb18ad3[_0xe939('0x39')][_0xe939('0x3a')]?_0xb18ad3['attributes']:_0x29ee89['model'];_0xb18ad3[_0xe939('0x3e')]=qs[_0xe939('0x52')](_0x11ab10['query']['sort']);_0xb18ad3[_0xe939('0x3f')]=qs[_0xe939('0x35')](_[_0xe939('0x40')](_0x11ab10['query'],_0x29ee89[_0xe939('0x35')]));if(_0x11ab10['query'][_0xe939('0x41')]){_0xb18ad3[_0xe939('0x3f')]=_['merge'](_0xb18ad3['where'],{'$or':_[_0xe939('0x2f')](_0xb18ad3[_0xe939('0x39')],function(_0x3475cc){var _0x3146de={};_0x3146de[_0x3475cc]={'$like':'%'+_0x11ab10[_0xe939('0x33')][_0xe939('0x41')]+'%'};return _0x3146de;})});}_0xb18ad3=_[_0xe939('0x42')]({},_0xb18ad3,_0x11ab10[_0xe939('0x44')]);return _0x1695d6[_0xe939('0x4f')](_0xb18ad3);}})[_0xe939('0x2a')](function(_0x443b6c){if(_0x443b6c){_0x4a4f17=_0x443b6c[_0xe939('0x3a')];if(!_0x11ab10['query'][_0xe939('0x3b')]('nolimit')){_0xb18ad3[_0xe939('0x3d')]=qs[_0xe939('0x3d')](_0x11ab10[_0xe939('0x33')][_0xe939('0x3d')]);_0xb18ad3[_0xe939('0x27')]=qs['offset'](_0x11ab10[_0xe939('0x33')]['offset']);}return _0x1695d6[_0xe939('0x4f')](_0xb18ad3);}})[_0xe939('0x2a')](function(_0x5aebd2){if(_0x5aebd2){return _0x5aebd2?{'count':_0x4a4f17,'rows':_0x5aebd2}:null;}})['then'](respondWithResult(_0x1ddf02,null))[_0xe939('0x23')](handleError(_0x1ddf02,null));};exports[_0xe939('0x53')]=function(_0x104985,_0x240f0e,_0x30d168){if(_0x104985[_0xe939('0x4d')]['id']){delete _0x104985[_0xe939('0x4d')]['id'];}return db[_0xe939('0x30')][_0xe939('0x50')]({'where':{'id':_0x104985['params']['id']}})['then'](handleEntityNotFound(_0x240f0e,null))['then'](function(_0x564dd9){if(_0x564dd9){_0x104985[_0xe939('0x4d')][_0xe939('0x54')]=_0x564dd9['id'];_0x104985[_0xe939('0x4d')]['Subjects']=integrations[_0xe939('0x55')](_0x104985[_0xe939('0x4d')]['channel'],_0x104985[_0xe939('0x4d')][_0xe939('0x32')]);_0x104985['body']['Descriptions']=integrations['getDescriptions'](_0x104985[_0xe939('0x4d')][_0xe939('0x56')],_0x104985[_0xe939('0x4d')]['type']);return db[_0xe939('0x51')][_0xe939('0x4c')](_0x104985['body'],{'include':[{'model':db[_0xe939('0x57')],'as':'Subjects'},{'model':db[_0xe939('0x57')],'as':_0xe939('0x58')}]});}return null;})[_0xe939('0x2a')](respondWithResult(_0x240f0e,null))[_0xe939('0x23')](handleError(_0x240f0e,null));};exports[_0xe939('0x59')]=function(_0x291e78,_0x3e9b4d,_0x2d82c7){var _0x1f5452='';return db[_0xe939('0x30')][_0xe939('0x50')]({'where':{'id':_0x291e78['params']['id']},'attributes':['id',_0xe939('0x5a'),'password',_0xe939('0x5b'),_0xe939('0x5c'),_0xe939('0x5d')]})[_0xe939('0x2a')](handleEntityNotFound(_0x3e9b4d,null))['then'](function(_0xbbcd1d){if(_0xbbcd1d){_0x1f5452=_0xbbcd1d[_0xe939('0x5d')];var _0x91a9f2=_0x1f5452[_0xe939('0x5e')](-0x1);if(_0x91a9f2==='/'){_0x1f5452=_0x1f5452[_0xe939('0x5f')](0x0,_0x1f5452[_0xe939('0x60')](_0x91a9f2));}var _0x2920a9={'method':_0xe939('0x61'),'uri':util[_0xe939('0x62')](_0xe939('0x63'),_0x1f5452,_0xe939('0x64')),'json':!![]};switch(_0xbbcd1d['authType']){case _0xe939('0x65'):_0x2920a9[_0xe939('0x66')]={'Authorization':util['format'](_0xe939('0x67'),new Buffer(util['format'](_0xe939('0x68'),_0xbbcd1d[_0xe939('0x5a')],_0xbbcd1d['password']))['toString'](_0xe939('0x69')))};break;case _0xe939('0x5b'):_0x2920a9[_0xe939('0x66')]={'Authorization':util['format'](_0xe939('0x67'),new Buffer(util[_0xe939('0x62')](_0xe939('0x6a'),_0xbbcd1d['username'],_0xbbcd1d[_0xe939('0x5b')]))['toString'](_0xe939('0x69')))};break;default:throw new db['Sequelize']['ValidationError'](_0xe939('0x6b'));}return rp(_0x2920a9);}})[_0xe939('0x2a')](function(_0xdd6550){if(_0xdd6550){var _0x4f60b2=[_0xe939('0x6c'),_0xe939('0x6d'),_0xe939('0x6e'),_0xe939('0x6f')];_[_0xe939('0x70')](_0xdd6550[_0xe939('0x64')],function(_0x54b663){return _0x4f60b2[_0xe939('0x71')](_0x54b663['type']);});return{'count':_0xdd6550[_0xe939('0x64')][_0xe939('0x3a')],'rows':_['map'](_0xdd6550['ticket_fields'],function(_0x15b0ef){return{'id':_0x15b0ef['id'],'name':_0x15b0ef[_0xe939('0x72')]>0x7?_0x15b0ef[_0xe939('0x73')]:_0x15b0ef[_0xe939('0x32')],'custom':_0x15b0ef[_0xe939('0x72')]>0x7?!![]:![],'options':_0x15b0ef[_0xe939('0x74')]?_0x15b0ef[_0xe939('0x74')]:_0x15b0ef[_0xe939('0x75')]?_0x15b0ef['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x3e9b4d,null))['catch'](function(_0x44e962){var _0x3b46cb=_0x291e78['query'][_0xe939('0x19')]?0x1f4:_0x44e962[_0xe939('0x76')]||0x1f4;logger[_0xe939('0x1f')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x3b46cb,JSON['stringify'](_0x44e962));delete _0x44e962[_0xe939('0x2e')];if(_0x3b46cb===0x191){_0x3b46cb=0x190;}_0x3e9b4d[_0xe939('0x25')](_0x3b46cb)['send'](_0x291e78[_0xe939('0x33')][_0xe939('0x19')]?{'message':'Wrong\x20credentials','statusCode':_0x44e962[_0xe939('0x76')]}:_0x44e962);});};
\ No newline at end of file
+var _0xeec9=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','update','destroy','name','index','map','ZendeskAccount','rawAttributes','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filters','merge','where','VIRTUAL','options','includeAll','findAll','show','params','fields','include','find','create','body','getConfigurations','findOne','pick','filter','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','password','token','authType','remoteUri','slice','substring','GET','format','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5aaf05,_0x2aad50){var _0x56c733=function(_0xa6ad97){while(--_0xa6ad97){_0x5aaf05['push'](_0x5aaf05['shift']());}};_0x56c733(++_0x2aad50);}(_0xeec9,0x15a));var _0x9eec=function(_0x494dff,_0x614ab9){_0x494dff=_0x494dff-0x0;var _0x55c944=_0xeec9[_0x494dff];return _0x55c944;};'use strict';var pdf=require(_0x9eec('0x0'));var emlformat=require(_0x9eec('0x1'));var rimraf=require(_0x9eec('0x2'));var zipdir=require(_0x9eec('0x3'));var jsonpatch=require(_0x9eec('0x4'));var rp=require(_0x9eec('0x5'));var moment=require(_0x9eec('0x6'));var BPromise=require(_0x9eec('0x7'));var Mustache=require('mustache');var util=require(_0x9eec('0x8'));var path=require(_0x9eec('0x9'));var sox=require(_0x9eec('0xa'));var csv=require(_0x9eec('0xb'));var ejs=require(_0x9eec('0xc'));var fs=require('fs');var _=require(_0x9eec('0xd'));var squel=require(_0x9eec('0xe'));var crypto=require(_0x9eec('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9eec('0x10'));var toCsv=require(_0x9eec('0xb'));var querystring=require(_0x9eec('0x11'));var Papa=require('papaparse');var Redis=require(_0x9eec('0x12'));var authService=require(_0x9eec('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9eec('0x14'));var logger=require('../../config/logger')(_0x9eec('0x15'));var utils=require(_0x9eec('0x16'));var config=require('../../config/environment');var db=require(_0x9eec('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x9eec('0x18'));var client=jayson[_0x9eec('0x19')][_0x9eec('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x31cfaf,_0x157dd6,_0x1f111c){if(_0x1f111c){var _0x2b0f46=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b0f46[_0x9eec('0x1b')](_0x157dd6)){return _0x31cfaf;}else{throw new db['Sequelize'][(_0x9eec('0x1c'))](_0x9eec('0x1d'));}}else{return _0x31cfaf;}}function respondWithRpcPromise(_0x2713c2,_0x21fba7,_0x54b9fc,_0x1ce84f){return new BPromise(function(_0x43dfe4,_0x2fd22b){var _0x14c1c9=_0x1ce84f||client;return _0x14c1c9[_0x9eec('0x1e')](_0x2713c2,_0x54b9fc)[_0x9eec('0x1f')](function(_0xa18945){logger['info'](_0x9eec('0x20'),_0x21fba7,_0x9eec('0x21'));logger[_0x9eec('0x22')](_0x9eec('0x23'),_0x21fba7,_0x9eec('0x21'),JSON[_0x9eec('0x24')](_0xa18945));if(_0xa18945['error']){if(_0xa18945[_0x9eec('0x25')][_0x9eec('0x26')]===0x1f4){logger[_0x9eec('0x25')]('ZendeskAccount,\x20%s,\x20%s',_0x21fba7,_0xa18945[_0x9eec('0x25')][_0x9eec('0x27')]);return _0x2fd22b(_0xa18945[_0x9eec('0x25')][_0x9eec('0x27')]);}logger[_0x9eec('0x25')](_0x9eec('0x20'),_0x21fba7,_0xa18945['error'][_0x9eec('0x27')]);return _0x43dfe4(_0xa18945['error'][_0x9eec('0x27')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x21fba7,_0x9eec('0x21'));_0x43dfe4(_0xa18945[_0x9eec('0x28')][_0x9eec('0x27')]);}})[_0x9eec('0x29')](function(_0x154a76){logger[_0x9eec('0x25')](_0x9eec('0x20'),_0x21fba7,_0x154a76);_0x2fd22b(_0x154a76);});});}function respondWithStatusCode(_0x3aacac,_0xda695d){_0xda695d=_0xda695d||0xcc;return function(_0x2f994c){if(_0x2f994c){return _0x3aacac[_0x9eec('0x2a')](_0xda695d);}return _0x3aacac['status'](_0xda695d)[_0x9eec('0x2b')]();};}function respondWithResult(_0x22a7c7,_0x547553){_0x547553=_0x547553||0xc8;return function(_0x4856cb){if(_0x4856cb){return _0x22a7c7[_0x9eec('0x2c')](_0x547553)[_0x9eec('0x2d')](_0x4856cb);}};}function respondWithFilteredResult(_0x532f25,_0x560c7a){return function(_0x2e86c9){if(_0x2e86c9){var _0x197fca=_0x2e86c9[_0x9eec('0x2e')],_0x13e7b7=_0x560c7a['offset'],_0x4624d0=_0x560c7a[_0x9eec('0x2f')]+_0x560c7a[_0x9eec('0x30')],_0x430d55;if(_0x4624d0>=_0x197fca){_0x4624d0=_0x197fca;_0x430d55=0xc8;}else{_0x430d55=0xce;}_0x532f25[_0x9eec('0x2c')](_0x430d55);return _0x532f25[_0x9eec('0x31')](_0x9eec('0x32'),_0x13e7b7+'-'+_0x4624d0+'/'+_0x197fca)[_0x9eec('0x2d')](_0x2e86c9);}return null;};}function patchUpdates(_0x146306){return function(_0x1a548d){try{jsonpatch['apply'](_0x1a548d,_0x146306,!![]);}catch(_0x1a1cf9){return BPromise['reject'](_0x1a1cf9);}return _0x1a548d[_0x9eec('0x33')]();};}function saveUpdates(_0x411344,_0x37ec0b){return function(_0x39b653){if(_0x39b653){return _0x39b653[_0x9eec('0x34')](_0x411344)[_0x9eec('0x1f')](function(_0x4eb85a){return _0x4eb85a;});}return null;};}function removeEntity(_0x1692fb,_0x2b29d7){return function(_0x284cce){if(_0x284cce){return _0x284cce[_0x9eec('0x35')]()[_0x9eec('0x1f')](function(){_0x1692fb[_0x9eec('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x582cae,_0x4412a6){return function(_0x5a541a){if(!_0x5a541a){_0x582cae[_0x9eec('0x2a')](0x194);}return _0x5a541a;};}function handleError(_0x279aa3,_0x462753){_0x462753=_0x462753||0x1f4;return function(_0x4302e9){logger[_0x9eec('0x25')](_0x4302e9['stack']);if(_0x4302e9[_0x9eec('0x36')]){delete _0x4302e9[_0x9eec('0x36')];}_0x279aa3[_0x9eec('0x2c')](_0x462753)['send'](_0x4302e9);};}exports[_0x9eec('0x37')]=function(_0x29c40c,_0x22357e){var _0x10265d={},_0x1ce04a={},_0x28d89a={'count':0x0,'rows':[]};var _0x213ee7=_[_0x9eec('0x38')](db[_0x9eec('0x39')][_0x9eec('0x3a')],function(_0x182f01){return{'name':_0x182f01['fieldName'],'type':_0x182f01[_0x9eec('0x3b')][_0x9eec('0x3c')]};});_0x1ce04a['model']=_[_0x9eec('0x38')](_0x213ee7,_0x9eec('0x36'));_0x1ce04a[_0x9eec('0x3d')]=_[_0x9eec('0x3e')](_0x29c40c[_0x9eec('0x3d')]);_0x1ce04a['filters']=_[_0x9eec('0x3f')](_0x1ce04a[_0x9eec('0x40')],_0x1ce04a[_0x9eec('0x3d')]);_0x10265d[_0x9eec('0x41')]=_[_0x9eec('0x3f')](_0x1ce04a[_0x9eec('0x40')],qs['fields'](_0x29c40c[_0x9eec('0x3d')]['fields']));_0x10265d[_0x9eec('0x41')]=_0x10265d[_0x9eec('0x41')][_0x9eec('0x42')]?_0x10265d[_0x9eec('0x41')]:_0x1ce04a['model'];if(!_0x29c40c[_0x9eec('0x3d')][_0x9eec('0x43')](_0x9eec('0x44'))){_0x10265d[_0x9eec('0x30')]=qs[_0x9eec('0x30')](_0x29c40c[_0x9eec('0x3d')][_0x9eec('0x30')]);_0x10265d[_0x9eec('0x2f')]=qs[_0x9eec('0x2f')](_0x29c40c['query'][_0x9eec('0x2f')]);}_0x10265d[_0x9eec('0x45')]=qs[_0x9eec('0x46')](_0x29c40c[_0x9eec('0x3d')]['sort']);_0x10265d['where']=qs['filters'](_['pick'](_0x29c40c[_0x9eec('0x3d')],_0x1ce04a[_0x9eec('0x47')]),_0x213ee7);if(_0x29c40c[_0x9eec('0x3d')]['filter']){_0x10265d['where']=_[_0x9eec('0x48')](_0x10265d[_0x9eec('0x49')],{'$or':_[_0x9eec('0x38')](_0x213ee7,function(_0x585561){if(_0x585561[_0x9eec('0x3b')]!==_0x9eec('0x4a')){var _0xc1a7dc={};_0xc1a7dc[_0x585561[_0x9eec('0x36')]]={'$like':'%'+_0x29c40c[_0x9eec('0x3d')]['filter']+'%'};return _0xc1a7dc;}})});}_0x10265d=_['merge']({},_0x10265d,_0x29c40c[_0x9eec('0x4b')]);var _0x212991={'where':_0x10265d['where']};return db[_0x9eec('0x39')]['count'](_0x212991)[_0x9eec('0x1f')](function(_0x2d424a){_0x28d89a[_0x9eec('0x2e')]=_0x2d424a;if(_0x29c40c[_0x9eec('0x3d')][_0x9eec('0x4c')]){_0x10265d['include']=[{'all':!![]}];}return db[_0x9eec('0x39')][_0x9eec('0x4d')](_0x10265d);})[_0x9eec('0x1f')](function(_0x210479){_0x28d89a['rows']=_0x210479;return _0x28d89a;})[_0x9eec('0x1f')](respondWithFilteredResult(_0x22357e,_0x10265d))['catch'](handleError(_0x22357e,null));};exports[_0x9eec('0x4e')]=function(_0x349af4,_0x145981){var _0x456129={'raw':![],'where':{'id':_0x349af4[_0x9eec('0x4f')]['id']}},_0x3ac384={};_0x3ac384[_0x9eec('0x40')]=_[_0x9eec('0x3e')](db['ZendeskAccount'][_0x9eec('0x3a')]);_0x3ac384[_0x9eec('0x3d')]=_[_0x9eec('0x3e')](_0x349af4[_0x9eec('0x3d')]);_0x3ac384['filters']=_[_0x9eec('0x3f')](_0x3ac384[_0x9eec('0x40')],_0x3ac384[_0x9eec('0x3d')]);_0x456129[_0x9eec('0x41')]=_[_0x9eec('0x3f')](_0x3ac384[_0x9eec('0x40')],qs[_0x9eec('0x50')](_0x349af4[_0x9eec('0x3d')][_0x9eec('0x50')]));_0x456129[_0x9eec('0x41')]=_0x456129[_0x9eec('0x41')]['length']?_0x456129[_0x9eec('0x41')]:_0x3ac384[_0x9eec('0x40')];if(_0x349af4[_0x9eec('0x3d')][_0x9eec('0x4c')]){_0x456129[_0x9eec('0x51')]=[{'all':!![]}];}_0x456129=_['merge']({},_0x456129,_0x349af4[_0x9eec('0x4b')]);return db[_0x9eec('0x39')][_0x9eec('0x52')](_0x456129)[_0x9eec('0x1f')](handleEntityNotFound(_0x145981,null))['then'](respondWithResult(_0x145981,null))[_0x9eec('0x29')](handleError(_0x145981,null));};exports[_0x9eec('0x53')]=function(_0x2bad43,_0x15c32d){return db[_0x9eec('0x39')][_0x9eec('0x53')](_0x2bad43[_0x9eec('0x54')],{})[_0x9eec('0x1f')](respondWithResult(_0x15c32d,0xc9))['catch'](handleError(_0x15c32d,null));};exports['update']=function(_0x17ce1e,_0x2f8a45){if(_0x17ce1e[_0x9eec('0x54')]['id']){delete _0x17ce1e['body']['id'];}return db[_0x9eec('0x39')][_0x9eec('0x52')]({'where':{'id':_0x17ce1e[_0x9eec('0x4f')]['id']}})[_0x9eec('0x1f')](handleEntityNotFound(_0x2f8a45,null))[_0x9eec('0x1f')](saveUpdates(_0x17ce1e[_0x9eec('0x54')],null))[_0x9eec('0x1f')](respondWithResult(_0x2f8a45,null))[_0x9eec('0x29')](handleError(_0x2f8a45,null));};exports[_0x9eec('0x35')]=function(_0x1ed2c8,_0x5b2f7f){return db[_0x9eec('0x39')][_0x9eec('0x52')]({'where':{'id':_0x1ed2c8[_0x9eec('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5b2f7f,null))[_0x9eec('0x1f')](removeEntity(_0x5b2f7f,null))[_0x9eec('0x29')](handleError(_0x5b2f7f,null));};exports[_0x9eec('0x55')]=function(_0x191789,_0x176073,_0x385f8b){var _0x52861f={};var _0x4b50e8={};var _0x3fb915;var _0x5a6b7b;return db['ZendeskAccount'][_0x9eec('0x56')]({'where':{'id':_0x191789['params']['id']}})[_0x9eec('0x1f')](handleEntityNotFound(_0x176073,null))[_0x9eec('0x1f')](function(_0x2de261){if(_0x2de261){_0x3fb915=_0x2de261;_0x4b50e8[_0x9eec('0x40')]=_[_0x9eec('0x3e')](db['ZendeskConfiguration'][_0x9eec('0x3a')]);_0x4b50e8[_0x9eec('0x3d')]=_['keys'](_0x191789['query']);_0x4b50e8[_0x9eec('0x47')]=_[_0x9eec('0x3f')](_0x4b50e8[_0x9eec('0x40')],_0x4b50e8['query']);_0x52861f['attributes']=_[_0x9eec('0x3f')](_0x4b50e8[_0x9eec('0x40')],qs[_0x9eec('0x50')](_0x191789['query'][_0x9eec('0x50')]));_0x52861f[_0x9eec('0x41')]=_0x52861f[_0x9eec('0x41')][_0x9eec('0x42')]?_0x52861f[_0x9eec('0x41')]:_0x4b50e8[_0x9eec('0x40')];_0x52861f[_0x9eec('0x45')]=qs['sort'](_0x191789[_0x9eec('0x3d')][_0x9eec('0x46')]);_0x52861f['where']=qs['filters'](_[_0x9eec('0x57')](_0x191789[_0x9eec('0x3d')],_0x4b50e8[_0x9eec('0x47')]));if(_0x191789[_0x9eec('0x3d')][_0x9eec('0x58')]){_0x52861f[_0x9eec('0x49')]=_[_0x9eec('0x48')](_0x52861f[_0x9eec('0x49')],{'$or':_['map'](_0x52861f[_0x9eec('0x41')],function(_0x26206c){var _0x510ca6={};_0x510ca6[_0x26206c]={'$like':'%'+_0x191789[_0x9eec('0x3d')]['filter']+'%'};return _0x510ca6;})});}_0x52861f=_[_0x9eec('0x48')]({},_0x52861f,_0x191789[_0x9eec('0x4b')]);return _0x3fb915['getConfigurations'](_0x52861f);}})[_0x9eec('0x1f')](function(_0xf42b35){if(_0xf42b35){_0x5a6b7b=_0xf42b35['length'];if(!_0x191789[_0x9eec('0x3d')]['hasOwnProperty'](_0x9eec('0x44'))){_0x52861f['limit']=qs[_0x9eec('0x30')](_0x191789['query'][_0x9eec('0x30')]);_0x52861f[_0x9eec('0x2f')]=qs[_0x9eec('0x2f')](_0x191789[_0x9eec('0x3d')][_0x9eec('0x2f')]);}return _0x3fb915[_0x9eec('0x55')](_0x52861f);}})[_0x9eec('0x1f')](function(_0x4bee45){if(_0x4bee45){return _0x4bee45?{'count':_0x5a6b7b,'rows':_0x4bee45}:null;}})[_0x9eec('0x1f')](respondWithResult(_0x176073,null))['catch'](handleError(_0x176073,null));};exports[_0x9eec('0x59')]=function(_0x428cf0,_0x282b1d,_0x2a245f){if(_0x428cf0[_0x9eec('0x54')]['id']){delete _0x428cf0[_0x9eec('0x54')]['id'];}return db['ZendeskAccount'][_0x9eec('0x56')]({'where':{'id':_0x428cf0[_0x9eec('0x4f')]['id']}})[_0x9eec('0x1f')](handleEntityNotFound(_0x282b1d,null))[_0x9eec('0x1f')](function(_0x343948){if(_0x343948){_0x428cf0[_0x9eec('0x54')][_0x9eec('0x5a')]=_0x343948['id'];_0x428cf0[_0x9eec('0x54')][_0x9eec('0x5b')]=integrations['getSubjects'](_0x428cf0[_0x9eec('0x54')][_0x9eec('0x5c')],_0x428cf0[_0x9eec('0x54')][_0x9eec('0x3b')]);_0x428cf0[_0x9eec('0x54')][_0x9eec('0x5d')]=integrations[_0x9eec('0x5e')](_0x428cf0[_0x9eec('0x54')][_0x9eec('0x5c')],_0x428cf0[_0x9eec('0x54')]['type']);return db['ZendeskConfiguration']['create'](_0x428cf0['body'],{'include':[{'model':db[_0x9eec('0x5f')],'as':_0x9eec('0x5b')},{'model':db[_0x9eec('0x5f')],'as':_0x9eec('0x5d')}]});}return null;})[_0x9eec('0x1f')](respondWithResult(_0x282b1d,null))['catch'](handleError(_0x282b1d,null));};exports[_0x9eec('0x60')]=function(_0x5ad004,_0xd49e94,_0x19830a){var _0x8d76c2='';return db[_0x9eec('0x39')][_0x9eec('0x56')]({'where':{'id':_0x5ad004[_0x9eec('0x4f')]['id']},'attributes':['id','username',_0x9eec('0x61'),_0x9eec('0x62'),_0x9eec('0x63'),'remoteUri']})[_0x9eec('0x1f')](handleEntityNotFound(_0xd49e94,null))[_0x9eec('0x1f')](function(_0x190b1c){if(_0x190b1c){_0x8d76c2=_0x190b1c[_0x9eec('0x64')];var _0x571670=_0x8d76c2[_0x9eec('0x65')](-0x1);if(_0x571670==='/'){_0x8d76c2=_0x8d76c2[_0x9eec('0x66')](0x0,_0x8d76c2['lastIndexOf'](_0x571670));}var _0x57a298={'method':_0x9eec('0x67'),'uri':util[_0x9eec('0x68')]('%s/%s',_0x8d76c2,_0x9eec('0x69')),'json':!![]};switch(_0x190b1c['authType']){case _0x9eec('0x61'):_0x57a298[_0x9eec('0x6a')]={'Authorization':util[_0x9eec('0x68')](_0x9eec('0x6b'),new Buffer(util['format'](_0x9eec('0x6c'),_0x190b1c['username'],_0x190b1c[_0x9eec('0x61')]))[_0x9eec('0x6d')](_0x9eec('0x6e')))};break;case _0x9eec('0x62'):_0x57a298['headers']={'Authorization':util[_0x9eec('0x68')](_0x9eec('0x6b'),new Buffer(util[_0x9eec('0x68')](_0x9eec('0x6f'),_0x190b1c['username'],_0x190b1c[_0x9eec('0x62')]))['toString'](_0x9eec('0x6e')))};break;default:throw new db[(_0x9eec('0x70'))][(_0x9eec('0x1c'))](_0x9eec('0x71'));}return rp(_0x57a298);}})[_0x9eec('0x1f')](function(_0x2e51f7){if(_0x2e51f7){var _0x10985e=[_0x9eec('0x72'),_0x9eec('0x73'),_0x9eec('0x74'),_0x9eec('0x75')];_[_0x9eec('0x76')](_0x2e51f7[_0x9eec('0x69')],function(_0x5a58c5){return _0x10985e['includes'](_0x5a58c5[_0x9eec('0x3b')]);});return{'count':_0x2e51f7[_0x9eec('0x69')]['length'],'rows':_[_0x9eec('0x38')](_0x2e51f7[_0x9eec('0x69')],function(_0x4e83b3){return{'id':_0x4e83b3['id'],'name':_0x4e83b3[_0x9eec('0x77')]>0x7?_0x4e83b3[_0x9eec('0x78')]:_0x4e83b3[_0x9eec('0x3b')],'custom':_0x4e83b3[_0x9eec('0x77')]>0x7?!![]:![],'options':_0x4e83b3[_0x9eec('0x79')]?_0x4e83b3['system_field_options']:_0x4e83b3['custom_field_options']?_0x4e83b3[_0x9eec('0x7a')]:[]};})};}})['then'](respondWithResult(_0xd49e94,null))[_0x9eec('0x29')](function(_0xc2ccc2){var _0x3160d0=_0x5ad004['query'][_0x9eec('0x1b')]?0x1f4:_0xc2ccc2[_0x9eec('0x7b')]||0x1f4;logger[_0x9eec('0x25')](_0x9eec('0x7c'),_0x9eec('0x60'),_0x3160d0,JSON[_0x9eec('0x24')](_0xc2ccc2));delete _0xc2ccc2[_0x9eec('0x36')];if(_0x3160d0===0x191){_0x3160d0=0x190;}_0xd49e94[_0x9eec('0x2c')](_0x3160d0)[_0x9eec('0x7d')](_0x5ad004[_0x9eec('0x3d')][_0x9eec('0x1b')]?{'message':_0x9eec('0x7e'),'statusCode':_0xc2ccc2['statusCode']}:_0xc2ccc2);});};
\ No newline at end of file
index 88382f0..c89fbff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44d5=['api','moment','bluebird','request-promise','rimraf','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','../../config/logger'];(function(_0x4b36db,_0x3d1ad3){var _0x76fd93=function(_0x534ba6){while(--_0x534ba6){_0x4b36db['push'](_0x4b36db['shift']());}};_0x76fd93(++_0x3d1ad3);}(_0x44d5,0x133));var _0x544d=function(_0x56e5a4,_0x3378ff){_0x56e5a4=_0x56e5a4-0x0;var _0x446855=_0x44d5[_0x56e5a4];return _0x446855;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x544d('0x0'))(_0x544d('0x1'));var moment=require(_0x544d('0x2'));var BPromise=require(_0x544d('0x3'));var rp=require(_0x544d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x544d('0x5'));var config=require('../../config/environment');var attributes=require(_0x544d('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x544d('0x7')]=function(_0xe5ae3f,_0x419d41){return _0xe5ae3f[_0x544d('0x8')](_0x544d('0x9'),attributes,{'tableName':_0x544d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf348=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util'];(function(_0x4d69a6,_0x44cbe8){var _0x56739a=function(_0x50cc2c){while(--_0x50cc2c){_0x4d69a6['push'](_0x4d69a6['shift']());}};_0x56739a(++_0x44cbe8);}(_0xf348,0x12a));var _0x8f34=function(_0xb64337,_0x11aa71){_0xb64337=_0xb64337-0x0;var _0x2eb9e5=_0xf348[_0xb64337];return _0x2eb9e5;};'use strict';var _=require('lodash');var util=require(_0x8f34('0x0'));var logger=require(_0x8f34('0x1'))('api');var moment=require(_0x8f34('0x2'));var BPromise=require(_0x8f34('0x3'));var rp=require(_0x8f34('0x4'));var fs=require('fs');var path=require(_0x8f34('0x5'));var rimraf=require(_0x8f34('0x6'));var config=require('../../config/environment');var attributes=require(_0x8f34('0x7'));var integrations=require(_0x8f34('0x8'));module[_0x8f34('0x9')]=function(_0x20d3a1,_0x4cf015){return _0x20d3a1[_0x8f34('0xa')](_0x8f34('0xb'),attributes,{'tableName':_0x8f34('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 397512c..c4d681b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','find','where','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http'];(function(_0x1fd481,_0x4229e8){var _0x34f2eb=function(_0x5a7412){while(--_0x5a7412){_0x1fd481['push'](_0x1fd481['shift']());}};_0x34f2eb(++_0x4229e8);}(_0xb7e7,0x121));var _0x7b7e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xb7e7[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}exports[_0x7b7e('0x14')]=function(_0x242368){var _0x200ef7=this;return new Promise(function(_0x2acb8c,_0x429a0e){return db[_0x7b7e('0x15')][_0x7b7e('0x16')]({'raw':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')]['where']||null:null,'attributes':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x19')]||null:null,'limit':_0x242368['options']?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1a')]||null:null,'include':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x53bbb3){return{'model':db[_0x53bbb3['model']],'as':_0x53bbb3['as'],'attributes':_0x53bbb3['attributes'],'include':_0x53bbb3[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x53bbb3[_0x7b7e('0x1b')],function(_0x483c6f){return{'model':db[_0x483c6f['model']],'as':_0x483c6f['as'],'attributes':_0x483c6f['attributes'],'include':_0x483c6f[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x483c6f[_0x7b7e('0x1b')],function(_0x7aa71){return{'model':db[_0x7aa71[_0x7b7e('0x1d')]],'as':_0x7aa71['as'],'attributes':_0x7aa71['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x21a15){logger['info']('GetZendeskAccount',_0x242368);logger['debug'](_0x7b7e('0x14'),_0x242368,JSON[_0x7b7e('0xf')](_0x21a15));_0x2acb8c(_0x21a15);})['catch'](function(_0x3db8c4){logger['error'](_0x7b7e('0x14'),_0x3db8c4[_0x7b7e('0x12')],_0x242368);_0x429a0e(_0x200ef7[_0x7b7e('0x10')](0x1f4,_0x3db8c4['message']));});});};exports[_0x7b7e('0x1e')]=function(_0xe31336){var _0x35602a=this;return new Promise(function(_0x326dd2,_0x33f9a1){return db['ZendeskAccount'][_0x7b7e('0x1f')]({'raw':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x20')]||null:null,'attributes':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')]['attributes']||null:null,'include':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_['map'](_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x2ca366){return{'model':db[_0x2ca366['model']],'as':_0x2ca366['as'],'attributes':_0x2ca366[_0x7b7e('0x19')],'include':_0x2ca366[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x2ca366[_0x7b7e('0x1b')],function(_0x31043a){return{'model':db[_0x31043a[_0x7b7e('0x1d')]],'as':_0x31043a['as'],'attributes':_0x31043a[_0x7b7e('0x19')],'include':_0x31043a[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x31043a[_0x7b7e('0x1b')],function(_0xd5a64d){return{'model':db[_0xd5a64d[_0x7b7e('0x1d')]],'as':_0xd5a64d['as'],'attributes':_0xd5a64d[_0x7b7e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x116563){logger[_0x7b7e('0xa')]('ShowZendeskAccount',_0xe31336);logger[_0x7b7e('0xc')](_0x7b7e('0x1e'),_0xe31336,JSON[_0x7b7e('0xf')](_0x116563));_0x326dd2(_0x116563);})[_0x7b7e('0x13')](function(_0x36abfc){logger[_0x7b7e('0x10')](_0x7b7e('0x1e'),_0x36abfc[_0x7b7e('0x12')],_0xe31336);_0x33f9a1(_0x35602a[_0x7b7e('0x10')](0x1f4,_0x36abfc[_0x7b7e('0x12')]));});});};
\ No newline at end of file
+var _0xb7e7=['request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','find','where','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http'];(function(_0x24fa7a,_0x2ae623){var _0x316e25=function(_0x407be4){while(--_0x407be4){_0x24fa7a['push'](_0x24fa7a['shift']());}};_0x316e25(++_0x2ae623);}(_0xb7e7,0x121));var _0x7b7e=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xb7e7[_0x342700];return _0x53406f;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}exports[_0x7b7e('0x14')]=function(_0x242368){var _0x200ef7=this;return new Promise(function(_0x2acb8c,_0x429a0e){return db[_0x7b7e('0x15')][_0x7b7e('0x16')]({'raw':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')]['where']||null:null,'attributes':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x19')]||null:null,'limit':_0x242368['options']?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1a')]||null:null,'include':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x53bbb3){return{'model':db[_0x53bbb3['model']],'as':_0x53bbb3['as'],'attributes':_0x53bbb3['attributes'],'include':_0x53bbb3[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x53bbb3[_0x7b7e('0x1b')],function(_0x483c6f){return{'model':db[_0x483c6f['model']],'as':_0x483c6f['as'],'attributes':_0x483c6f['attributes'],'include':_0x483c6f[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x483c6f[_0x7b7e('0x1b')],function(_0x7aa71){return{'model':db[_0x7aa71[_0x7b7e('0x1d')]],'as':_0x7aa71['as'],'attributes':_0x7aa71['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x21a15){logger['info']('GetZendeskAccount',_0x242368);logger['debug'](_0x7b7e('0x14'),_0x242368,JSON[_0x7b7e('0xf')](_0x21a15));_0x2acb8c(_0x21a15);})['catch'](function(_0x3db8c4){logger['error'](_0x7b7e('0x14'),_0x3db8c4[_0x7b7e('0x12')],_0x242368);_0x429a0e(_0x200ef7[_0x7b7e('0x10')](0x1f4,_0x3db8c4['message']));});});};exports[_0x7b7e('0x1e')]=function(_0xe31336){var _0x35602a=this;return new Promise(function(_0x326dd2,_0x33f9a1){return db['ZendeskAccount'][_0x7b7e('0x1f')]({'raw':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x20')]||null:null,'attributes':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')]['attributes']||null:null,'include':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_['map'](_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x2ca366){return{'model':db[_0x2ca366['model']],'as':_0x2ca366['as'],'attributes':_0x2ca366[_0x7b7e('0x19')],'include':_0x2ca366[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x2ca366[_0x7b7e('0x1b')],function(_0x31043a){return{'model':db[_0x31043a[_0x7b7e('0x1d')]],'as':_0x31043a['as'],'attributes':_0x31043a[_0x7b7e('0x19')],'include':_0x31043a[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x31043a[_0x7b7e('0x1b')],function(_0xd5a64d){return{'model':db[_0xd5a64d[_0x7b7e('0x1d')]],'as':_0xd5a64d['as'],'attributes':_0xd5a64d[_0x7b7e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x116563){logger[_0x7b7e('0xa')]('ShowZendeskAccount',_0xe31336);logger[_0x7b7e('0xc')](_0x7b7e('0x1e'),_0xe31336,JSON[_0x7b7e('0xf')](_0x116563));_0x326dd2(_0x116563);})[_0x7b7e('0x13')](function(_0x36abfc){logger[_0x7b7e('0x10')](_0x7b7e('0x1e'),_0x36abfc[_0x7b7e('0x12')],_0xe31336);_0x33f9a1(_0x35602a[_0x7b7e('0x10')](0x1f4,_0x36abfc[_0x7b7e('0x12')]));});});};
\ No newline at end of file
index 1203c82..efe136c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55c1=['delete','destroy','multer','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update'];(function(_0x2f752b,_0xd9ed33){var _0x3e8d72=function(_0x186911){while(--_0x186911){_0x2f752b['push'](_0x2f752b['shift']());}};_0x3e8d72(++_0xd9ed33);}(_0x55c1,0x1e2));var _0x155c=function(_0x27714d,_0x457b53){_0x27714d=_0x27714d-0x0;var _0x18e2fb=_0x55c1[_0x27714d];return _0x18e2fb;};'use strict';var multer=require(_0x155c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x155c('0x1'));var router=express[_0x155c('0x2')]();var auth=require(_0x155c('0x3'));var interaction=require(_0x155c('0x4'));var config=require('../../config/environment');var controller=require(_0x155c('0x5'));router[_0x155c('0x6')]('/',auth[_0x155c('0x7')](),controller['index']);router['get'](_0x155c('0x8'),auth[_0x155c('0x7')](),controller[_0x155c('0x9')]);router['get'](_0x155c('0xa'),auth[_0x155c('0x7')](),controller[_0x155c('0xb')]);router[_0x155c('0x6')](_0x155c('0xc'),auth[_0x155c('0x7')](),controller[_0x155c('0xd')]);router[_0x155c('0x6')](_0x155c('0xe'),auth[_0x155c('0x7')](),controller[_0x155c('0xf')]);router[_0x155c('0x6')](_0x155c('0x10'),auth[_0x155c('0x7')](),controller[_0x155c('0x11')]);router[_0x155c('0x12')]('/',auth[_0x155c('0x7')](),controller[_0x155c('0x13')]);router[_0x155c('0x12')]('/:id/tags',auth[_0x155c('0x7')](),controller['setTags']);router[_0x155c('0x14')](_0x155c('0x8'),auth[_0x155c('0x7')](),controller[_0x155c('0x15')]);router[_0x155c('0x16')](_0x155c('0x8'),auth[_0x155c('0x7')](),controller[_0x155c('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x5227=['delete','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update'];(function(_0x57784b,_0x49a858){var _0x4505fa=function(_0x14f13c){while(--_0x14f13c){_0x57784b['push'](_0x57784b['shift']());}};_0x4505fa(++_0x49a858);}(_0x5227,0x188));var _0x7522=function(_0x5347f1,_0x1122ab){_0x5347f1=_0x5347f1-0x0;var _0x31216d=_0x5227[_0x5347f1];return _0x31216d;};'use strict';var multer=require(_0x7522('0x0'));var util=require(_0x7522('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7522('0x2'));var router=express['Router']();var auth=require(_0x7522('0x3'));var interaction=require(_0x7522('0x4'));var config=require(_0x7522('0x5'));var controller=require(_0x7522('0x6'));router[_0x7522('0x7')]('/',auth[_0x7522('0x8')](),controller['index']);router[_0x7522('0x7')](_0x7522('0x9'),auth[_0x7522('0x8')](),controller[_0x7522('0xa')]);router[_0x7522('0x7')](_0x7522('0xb'),auth[_0x7522('0x8')](),controller[_0x7522('0xc')]);router['get'](_0x7522('0xd'),auth[_0x7522('0x8')](),controller[_0x7522('0xe')]);router['get'](_0x7522('0xf'),auth[_0x7522('0x8')](),controller[_0x7522('0x10')]);router[_0x7522('0x7')](_0x7522('0x11'),auth[_0x7522('0x8')](),controller[_0x7522('0x12')]);router['post']('/',auth[_0x7522('0x8')](),controller[_0x7522('0x13')]);router[_0x7522('0x14')](_0x7522('0x11'),auth[_0x7522('0x8')](),controller[_0x7522('0x15')]);router[_0x7522('0x16')](_0x7522('0x9'),auth[_0x7522('0x8')](),controller[_0x7522('0x17')]);router[_0x7522('0x18')](_0x7522('0x9'),auth[_0x7522('0x8')](),controller['destroy']);module[_0x7522('0x19')]=router;
\ No newline at end of file
index 4452197..eaf9918 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x275c=['STRING','sequelize','exports'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0x275c,0x88));var _0xc275=function(_0x5306cf,_0x3a22a6){_0x5306cf=_0x5306cf-0x0;var _0x44c8e2=_0x275c[_0x5306cf];return _0x44c8e2;};'use strict';var Sequelize=require(_0xc275('0x0'));module[_0xc275('0x1')]={'name':{'type':Sequelize[_0xc275('0x2')]},'description':{'type':Sequelize[_0xc275('0x2')]}};
\ No newline at end of file
+var _0x11f7=['STRING','sequelize'];(function(_0x1d6a81,_0x57813a){var _0x1ae8fa=function(_0x481a21){while(--_0x481a21){_0x1d6a81['push'](_0x1d6a81['shift']());}};_0x1ae8fa(++_0x57813a);}(_0x11f7,0x1c9));var _0x711f=function(_0x5d12a2,_0x1104e2){_0x5d12a2=_0x5d12a2-0x0;var _0x58aa1d=_0x11f7[_0x5d12a2];return _0x58aa1d;};'use strict';var Sequelize=require(_0x711f('0x0'));module['exports']={'name':{'type':Sequelize[_0x711f('0x1')]},'description':{'type':Sequelize[_0x711f('0x1')]}};
\ No newline at end of file
index a5dc743..f222067 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3ed=['ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','count','offset','limit','set','reject','save','update','sendStatus','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ZendeskConfiguration','findAll','rows','params','filters','find','create','body','destroy','getFields','findOne','ZendeskField','getSubjects','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','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','jayson/promise','client','http','test','Sequelize','ValidationError','then','info'];(function(_0x5d99bb,_0x10e04b){var _0xdfe846=function(_0x2e3377){while(--_0x2e3377){_0x5d99bb['push'](_0x5d99bb['shift']());}};_0xdfe846(++_0x10e04b);}(_0xe3ed,0x1bf));var _0xde3e=function(_0x4ef870,_0x458b7b){_0x4ef870=_0x4ef870-0x0;var _0x59c0eb=_0xe3ed[_0x4ef870];return _0x59c0eb;};'use strict';var pdf=require(_0xde3e('0x0'));var emlformat=require(_0xde3e('0x1'));var rimraf=require(_0xde3e('0x2'));var zipdir=require(_0xde3e('0x3'));var jsonpatch=require(_0xde3e('0x4'));var rp=require('request-promise');var moment=require(_0xde3e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xde3e('0x6'));var util=require('util');var path=require(_0xde3e('0x7'));var sox=require('sox');var csv=require(_0xde3e('0x8'));var ejs=require(_0xde3e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xde3e('0xa'));var crypto=require(_0xde3e('0xb'));var jsforce=require(_0xde3e('0xc'));var deskjs=require(_0xde3e('0xd'));var toCsv=require(_0xde3e('0x8'));var querystring=require(_0xde3e('0xe'));var Papa=require(_0xde3e('0xf'));var Redis=require(_0xde3e('0x10'));var authService=require(_0xde3e('0x11'));var qs=require(_0xde3e('0x12'));var as=require(_0xde3e('0x13'));var hardwareService=require(_0xde3e('0x14'));var logger=require(_0xde3e('0x15'))(_0xde3e('0x16'));var utils=require(_0xde3e('0x17'));var config=require(_0xde3e('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xde3e('0x19'));var client=jayson[_0xde3e('0x1a')][_0xde3e('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4b46f7,_0x327094,_0x3627cd){if(_0x3627cd){var _0x4db2d8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4db2d8[_0xde3e('0x1c')](_0x327094)){return _0x4b46f7;}else{throw new db[(_0xde3e('0x1d'))][(_0xde3e('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4b46f7;}}function respondWithRpcPromise(_0x7b610d,_0x2d0901,_0x2b2be1,_0x2b85f9){return new BPromise(function(_0x50ad0d,_0x4e83b4){var _0x583bc7=_0x2b85f9||client;return _0x583bc7['request'](_0x7b610d,_0x2b2be1)[_0xde3e('0x1f')](function(_0x5a48d0){logger[_0xde3e('0x20')](_0xde3e('0x21'),_0x2d0901,_0xde3e('0x22'));logger[_0xde3e('0x23')](_0xde3e('0x24'),_0x2d0901,_0xde3e('0x22'),JSON['stringify'](_0x5a48d0));if(_0x5a48d0[_0xde3e('0x25')]){if(_0x5a48d0[_0xde3e('0x25')]['code']===0x1f4){logger['error'](_0xde3e('0x21'),_0x2d0901,_0x5a48d0[_0xde3e('0x25')][_0xde3e('0x26')]);return _0x4e83b4(_0x5a48d0[_0xde3e('0x25')][_0xde3e('0x26')]);}logger[_0xde3e('0x25')](_0xde3e('0x21'),_0x2d0901,_0x5a48d0[_0xde3e('0x25')]['message']);return _0x50ad0d(_0x5a48d0['error']['message']);}else{logger[_0xde3e('0x20')](_0xde3e('0x21'),_0x2d0901,'request\x20sent');_0x50ad0d(_0x5a48d0[_0xde3e('0x27')][_0xde3e('0x26')]);}})[_0xde3e('0x28')](function(_0x5f155a){logger[_0xde3e('0x25')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2d0901,_0x5f155a);_0x4e83b4(_0x5f155a);});});}function respondWithStatusCode(_0x17ce13,_0x1f308a){_0x1f308a=_0x1f308a||0xcc;return function(_0x12c805){if(_0x12c805){return _0x17ce13['sendStatus'](_0x1f308a);}return _0x17ce13[_0xde3e('0x29')](_0x1f308a)[_0xde3e('0x2a')]();};}function respondWithResult(_0x41183d,_0x4e6471){_0x4e6471=_0x4e6471||0xc8;return function(_0x456b5f){if(_0x456b5f){return _0x41183d[_0xde3e('0x29')](_0x4e6471)[_0xde3e('0x2b')](_0x456b5f);}};}function respondWithFilteredResult(_0x2a34eb,_0x3c3a58){return function(_0x383035){if(_0x383035){var _0x4a03f1=_0x383035[_0xde3e('0x2c')],_0x19458e=_0x3c3a58[_0xde3e('0x2d')],_0x55bf38=_0x3c3a58[_0xde3e('0x2d')]+_0x3c3a58[_0xde3e('0x2e')],_0x4629ef;if(_0x55bf38>=_0x4a03f1){_0x55bf38=_0x4a03f1;_0x4629ef=0xc8;}else{_0x4629ef=0xce;}_0x2a34eb[_0xde3e('0x29')](_0x4629ef);return _0x2a34eb[_0xde3e('0x2f')]('Content-Range',_0x19458e+'-'+_0x55bf38+'/'+_0x4a03f1)[_0xde3e('0x2b')](_0x383035);}return null;};}function patchUpdates(_0x137921){return function(_0x442e50){try{jsonpatch['apply'](_0x442e50,_0x137921,!![]);}catch(_0x461fa2){return BPromise[_0xde3e('0x30')](_0x461fa2);}return _0x442e50[_0xde3e('0x31')]();};}function saveUpdates(_0x2bfd66,_0x17abf8){return function(_0x28ce60){if(_0x28ce60){return _0x28ce60[_0xde3e('0x32')](_0x2bfd66)['then'](function(_0x2af06b){return _0x2af06b;});}return null;};}function removeEntity(_0x4111bf,_0x4fb107){return function(_0x39341c){if(_0x39341c){return _0x39341c['destroy']()[_0xde3e('0x1f')](function(){_0x4111bf[_0xde3e('0x29')](0xcc)[_0xde3e('0x2a')]();});}};}function handleEntityNotFound(_0x31183b,_0xb940d8){return function(_0x1e26c8){if(!_0x1e26c8){_0x31183b[_0xde3e('0x33')](0x194);}return _0x1e26c8;};}function handleError(_0x130698,_0x16862d){_0x16862d=_0x16862d||0x1f4;return function(_0xf4e9c1){logger[_0xde3e('0x25')](_0xf4e9c1['stack']);if(_0xf4e9c1[_0xde3e('0x34')]){delete _0xf4e9c1[_0xde3e('0x34')];}_0x130698[_0xde3e('0x29')](_0x16862d)[_0xde3e('0x35')](_0xf4e9c1);};}exports[_0xde3e('0x36')]=function(_0x5c69ac,_0x59384b){var _0x522652={},_0x312231={},_0x28ce5f={'count':0x0,'rows':[]};var _0x1d94ab=_['map'](db['ZendeskConfiguration'][_0xde3e('0x37')],function(_0x1bc038){return{'name':_0x1bc038[_0xde3e('0x38')],'type':_0x1bc038[_0xde3e('0x39')][_0xde3e('0x3a')]};});_0x312231[_0xde3e('0x3b')]=_[_0xde3e('0x3c')](_0x1d94ab,'name');_0x312231[_0xde3e('0x3d')]=_[_0xde3e('0x3e')](_0x5c69ac[_0xde3e('0x3d')]);_0x312231['filters']=_['intersection'](_0x312231[_0xde3e('0x3b')],_0x312231[_0xde3e('0x3d')]);_0x522652[_0xde3e('0x3f')]=_[_0xde3e('0x40')](_0x312231[_0xde3e('0x3b')],qs[_0xde3e('0x41')](_0x5c69ac['query'][_0xde3e('0x41')]));_0x522652[_0xde3e('0x3f')]=_0x522652[_0xde3e('0x3f')][_0xde3e('0x42')]?_0x522652[_0xde3e('0x3f')]:_0x312231[_0xde3e('0x3b')];if(!_0x5c69ac['query'][_0xde3e('0x43')](_0xde3e('0x44'))){_0x522652[_0xde3e('0x2e')]=qs['limit'](_0x5c69ac[_0xde3e('0x3d')][_0xde3e('0x2e')]);_0x522652[_0xde3e('0x2d')]=qs['offset'](_0x5c69ac[_0xde3e('0x3d')]['offset']);}_0x522652[_0xde3e('0x45')]=qs[_0xde3e('0x46')](_0x5c69ac[_0xde3e('0x3d')][_0xde3e('0x46')]);_0x522652[_0xde3e('0x47')]=qs['filters'](_[_0xde3e('0x48')](_0x5c69ac[_0xde3e('0x3d')],_0x312231['filters']),_0x1d94ab);if(_0x5c69ac[_0xde3e('0x3d')][_0xde3e('0x49')]){_0x522652[_0xde3e('0x47')]=_[_0xde3e('0x4a')](_0x522652[_0xde3e('0x47')],{'$or':_[_0xde3e('0x3c')](_0x1d94ab,function(_0x1f9a3b){if(_0x1f9a3b[_0xde3e('0x39')]!==_0xde3e('0x4b')){var _0x2df21a={};_0x2df21a[_0x1f9a3b[_0xde3e('0x34')]]={'$like':'%'+_0x5c69ac[_0xde3e('0x3d')][_0xde3e('0x49')]+'%'};return _0x2df21a;}})});}_0x522652=_[_0xde3e('0x4a')]({},_0x522652,_0x5c69ac[_0xde3e('0x4c')]);var _0x3b66e3={'where':_0x522652['where']};return db['ZendeskConfiguration'][_0xde3e('0x2c')](_0x3b66e3)[_0xde3e('0x1f')](function(_0xd06706){_0x28ce5f[_0xde3e('0x2c')]=_0xd06706;if(_0x5c69ac[_0xde3e('0x3d')][_0xde3e('0x4d')]){_0x522652[_0xde3e('0x4e')]=[{'all':!![]}];}return db[_0xde3e('0x4f')][_0xde3e('0x50')](_0x522652);})[_0xde3e('0x1f')](function(_0x48bb07){_0x28ce5f[_0xde3e('0x51')]=_0x48bb07;return _0x28ce5f;})[_0xde3e('0x1f')](respondWithFilteredResult(_0x59384b,_0x522652))['catch'](handleError(_0x59384b,null));};exports['show']=function(_0x3c64e7,_0x4fa04d){var _0x5a825c={'raw':![],'where':{'id':_0x3c64e7[_0xde3e('0x52')]['id']}},_0x2790c7={};_0x2790c7[_0xde3e('0x3b')]=_[_0xde3e('0x3e')](db['ZendeskConfiguration']['rawAttributes']);_0x2790c7[_0xde3e('0x3d')]=_[_0xde3e('0x3e')](_0x3c64e7[_0xde3e('0x3d')]);_0x2790c7[_0xde3e('0x53')]=_[_0xde3e('0x40')](_0x2790c7[_0xde3e('0x3b')],_0x2790c7[_0xde3e('0x3d')]);_0x5a825c[_0xde3e('0x3f')]=_[_0xde3e('0x40')](_0x2790c7[_0xde3e('0x3b')],qs[_0xde3e('0x41')](_0x3c64e7[_0xde3e('0x3d')][_0xde3e('0x41')]));_0x5a825c[_0xde3e('0x3f')]=_0x5a825c['attributes'][_0xde3e('0x42')]?_0x5a825c['attributes']:_0x2790c7[_0xde3e('0x3b')];if(_0x3c64e7['query']['includeAll']){_0x5a825c[_0xde3e('0x4e')]=[{'all':!![]}];}_0x5a825c=_[_0xde3e('0x4a')]({},_0x5a825c,_0x3c64e7[_0xde3e('0x4c')]);return db[_0xde3e('0x4f')][_0xde3e('0x54')](_0x5a825c)[_0xde3e('0x1f')](handleEntityNotFound(_0x4fa04d,null))['then'](respondWithResult(_0x4fa04d,null))['catch'](handleError(_0x4fa04d,null));};exports[_0xde3e('0x55')]=function(_0x25fb4a,_0x22dfdc){return db['ZendeskConfiguration'][_0xde3e('0x55')](_0x25fb4a[_0xde3e('0x56')],{})[_0xde3e('0x1f')](respondWithResult(_0x22dfdc,0xc9))[_0xde3e('0x28')](handleError(_0x22dfdc,null));};exports[_0xde3e('0x32')]=function(_0x5de25c,_0x317edc){if(_0x5de25c[_0xde3e('0x56')]['id']){delete _0x5de25c[_0xde3e('0x56')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x5de25c[_0xde3e('0x52')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x317edc,null))['then'](saveUpdates(_0x5de25c[_0xde3e('0x56')],null))[_0xde3e('0x1f')](respondWithResult(_0x317edc,null))['catch'](handleError(_0x317edc,null));};exports[_0xde3e('0x57')]=function(_0x57e971,_0xdb8f35){return db[_0xde3e('0x4f')][_0xde3e('0x54')]({'where':{'id':_0x57e971['params']['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0xdb8f35,null))[_0xde3e('0x1f')](removeEntity(_0xdb8f35,null))[_0xde3e('0x28')](handleError(_0xdb8f35,null));};exports[_0xde3e('0x58')]=function(_0x47c0b3,_0x33b950,_0x57ff60){var _0x5ad011={};var _0x14e1e9={};var _0x47bc44;var _0x3b5adc;return db[_0xde3e('0x4f')][_0xde3e('0x59')]({'where':{'id':_0x47c0b3[_0xde3e('0x52')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x33b950,null))['then'](function(_0x4cb0d6){if(_0x4cb0d6){_0x47bc44=_0x4cb0d6;_0x14e1e9[_0xde3e('0x3b')]=_['keys'](db[_0xde3e('0x5a')][_0xde3e('0x37')]);_0x14e1e9[_0xde3e('0x3d')]=_['keys'](_0x47c0b3['query']);_0x14e1e9[_0xde3e('0x53')]=_['intersection'](_0x14e1e9[_0xde3e('0x3b')],_0x14e1e9['query']);_0x5ad011[_0xde3e('0x3f')]=_['intersection'](_0x14e1e9[_0xde3e('0x3b')],qs['fields'](_0x47c0b3['query'][_0xde3e('0x41')]));_0x5ad011['attributes']=_0x5ad011[_0xde3e('0x3f')][_0xde3e('0x42')]?_0x5ad011[_0xde3e('0x3f')]:_0x14e1e9[_0xde3e('0x3b')];_0x5ad011[_0xde3e('0x45')]=qs[_0xde3e('0x46')](_0x47c0b3[_0xde3e('0x3d')]['sort']);_0x5ad011['where']=qs[_0xde3e('0x53')](_[_0xde3e('0x48')](_0x47c0b3['query'],_0x14e1e9[_0xde3e('0x53')]));if(_0x47c0b3[_0xde3e('0x3d')][_0xde3e('0x49')]){_0x5ad011['where']=_['merge'](_0x5ad011[_0xde3e('0x47')],{'$or':_[_0xde3e('0x3c')](_0x5ad011[_0xde3e('0x3f')],function(_0xc96175){var _0x4d27e1={};_0x4d27e1[_0xc96175]={'$like':'%'+_0x47c0b3[_0xde3e('0x3d')][_0xde3e('0x49')]+'%'};return _0x4d27e1;})});}_0x5ad011=_[_0xde3e('0x4a')]({},_0x5ad011,_0x47c0b3['options']);return _0x47bc44[_0xde3e('0x58')](_0x5ad011);}})[_0xde3e('0x1f')](function(_0x52acd4){if(_0x52acd4){_0x3b5adc=_0x52acd4['length'];if(!_0x47c0b3[_0xde3e('0x3d')][_0xde3e('0x43')](_0xde3e('0x44'))){_0x5ad011[_0xde3e('0x2e')]=qs[_0xde3e('0x2e')](_0x47c0b3[_0xde3e('0x3d')][_0xde3e('0x2e')]);_0x5ad011[_0xde3e('0x2d')]=qs[_0xde3e('0x2d')](_0x47c0b3[_0xde3e('0x3d')][_0xde3e('0x2d')]);}return _0x47bc44[_0xde3e('0x58')](_0x5ad011);}})[_0xde3e('0x1f')](function(_0x1a0d47){if(_0x1a0d47){return _0x1a0d47?{'count':_0x3b5adc,'rows':_0x1a0d47}:null;}})[_0xde3e('0x1f')](respondWithResult(_0x33b950,null))[_0xde3e('0x28')](handleError(_0x33b950,null));};exports['getSubjects']=function(_0x2df766,_0x5afe56,_0x46e80f){var _0x333e13={};var _0x350de9={};var _0x3e494c;var _0xb8a3bb;return db['ZendeskConfiguration'][_0xde3e('0x59')]({'where':{'id':_0x2df766[_0xde3e('0x52')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x5afe56,null))[_0xde3e('0x1f')](function(_0x1bcc90){if(_0x1bcc90){_0x3e494c=_0x1bcc90;_0x350de9[_0xde3e('0x3b')]=_['keys'](db['ZendeskField'][_0xde3e('0x37')]);_0x350de9[_0xde3e('0x3d')]=_[_0xde3e('0x3e')](_0x2df766[_0xde3e('0x3d')]);_0x350de9['filters']=_[_0xde3e('0x40')](_0x350de9[_0xde3e('0x3b')],_0x350de9[_0xde3e('0x3d')]);_0x333e13[_0xde3e('0x3f')]=_[_0xde3e('0x40')](_0x350de9[_0xde3e('0x3b')],qs[_0xde3e('0x41')](_0x2df766['query'][_0xde3e('0x41')]));_0x333e13[_0xde3e('0x3f')]=_0x333e13['attributes'][_0xde3e('0x42')]?_0x333e13[_0xde3e('0x3f')]:_0x350de9['model'];_0x333e13['order']=qs[_0xde3e('0x46')](_0x2df766[_0xde3e('0x3d')][_0xde3e('0x46')]);_0x333e13['where']=qs[_0xde3e('0x53')](_[_0xde3e('0x48')](_0x2df766['query'],_0x350de9[_0xde3e('0x53')]));if(_0x2df766['query']['filter']){_0x333e13[_0xde3e('0x47')]=_[_0xde3e('0x4a')](_0x333e13[_0xde3e('0x47')],{'$or':_[_0xde3e('0x3c')](_0x333e13['attributes'],function(_0x22d85e){var _0x52cb69={};_0x52cb69[_0x22d85e]={'$like':'%'+_0x2df766[_0xde3e('0x3d')][_0xde3e('0x49')]+'%'};return _0x52cb69;})});}_0x333e13=_[_0xde3e('0x4a')]({},_0x333e13,_0x2df766[_0xde3e('0x4c')]);return _0x3e494c[_0xde3e('0x5b')](_0x333e13);}})[_0xde3e('0x1f')](function(_0x5321cb){if(_0x5321cb){_0xb8a3bb=_0x5321cb[_0xde3e('0x42')];if(!_0x2df766['query'][_0xde3e('0x43')](_0xde3e('0x44'))){_0x333e13[_0xde3e('0x2e')]=qs['limit'](_0x2df766[_0xde3e('0x3d')][_0xde3e('0x2e')]);_0x333e13[_0xde3e('0x2d')]=qs[_0xde3e('0x2d')](_0x2df766[_0xde3e('0x3d')][_0xde3e('0x2d')]);}return _0x3e494c[_0xde3e('0x5b')](_0x333e13);}})[_0xde3e('0x1f')](function(_0x448667){if(_0x448667){return _0x448667?{'count':_0xb8a3bb,'rows':_0x448667}:null;}})[_0xde3e('0x1f')](respondWithResult(_0x5afe56,null))[_0xde3e('0x28')](handleError(_0x5afe56,null));};exports['getDescriptions']=function(_0x4cdf19,_0x16e02f,_0x34650f){var _0x1874d6={};var _0x4797c5={};var _0x4f15e6;var _0x44cb96;return db[_0xde3e('0x4f')][_0xde3e('0x59')]({'where':{'id':_0x4cdf19[_0xde3e('0x52')]['id']}})['then'](handleEntityNotFound(_0x16e02f,null))['then'](function(_0x2c6b6d){if(_0x2c6b6d){_0x4f15e6=_0x2c6b6d;_0x4797c5[_0xde3e('0x3b')]=_[_0xde3e('0x3e')](db['ZendeskField'][_0xde3e('0x37')]);_0x4797c5[_0xde3e('0x3d')]=_['keys'](_0x4cdf19[_0xde3e('0x3d')]);_0x4797c5[_0xde3e('0x53')]=_['intersection'](_0x4797c5[_0xde3e('0x3b')],_0x4797c5['query']);_0x1874d6[_0xde3e('0x3f')]=_[_0xde3e('0x40')](_0x4797c5['model'],qs['fields'](_0x4cdf19[_0xde3e('0x3d')][_0xde3e('0x41')]));_0x1874d6[_0xde3e('0x3f')]=_0x1874d6['attributes']['length']?_0x1874d6['attributes']:_0x4797c5[_0xde3e('0x3b')];_0x1874d6['order']=qs[_0xde3e('0x46')](_0x4cdf19[_0xde3e('0x3d')][_0xde3e('0x46')]);_0x1874d6['where']=qs[_0xde3e('0x53')](_[_0xde3e('0x48')](_0x4cdf19[_0xde3e('0x3d')],_0x4797c5['filters']));if(_0x4cdf19['query'][_0xde3e('0x49')]){_0x1874d6[_0xde3e('0x47')]=_[_0xde3e('0x4a')](_0x1874d6['where'],{'$or':_[_0xde3e('0x3c')](_0x1874d6[_0xde3e('0x3f')],function(_0x41515d){var _0x4b5129={};_0x4b5129[_0x41515d]={'$like':'%'+_0x4cdf19[_0xde3e('0x3d')][_0xde3e('0x49')]+'%'};return _0x4b5129;})});}_0x1874d6=_[_0xde3e('0x4a')]({},_0x1874d6,_0x4cdf19[_0xde3e('0x4c')]);return _0x4f15e6['getDescriptions'](_0x1874d6);}})[_0xde3e('0x1f')](function(_0x29b7f6){if(_0x29b7f6){_0x44cb96=_0x29b7f6[_0xde3e('0x42')];if(!_0x4cdf19[_0xde3e('0x3d')]['hasOwnProperty'](_0xde3e('0x44'))){_0x1874d6[_0xde3e('0x2e')]=qs[_0xde3e('0x2e')](_0x4cdf19[_0xde3e('0x3d')][_0xde3e('0x2e')]);_0x1874d6[_0xde3e('0x2d')]=qs[_0xde3e('0x2d')](_0x4cdf19[_0xde3e('0x3d')][_0xde3e('0x2d')]);}return _0x4f15e6['getDescriptions'](_0x1874d6);}})[_0xde3e('0x1f')](function(_0x3205c0){if(_0x3205c0){return _0x3205c0?{'count':_0x44cb96,'rows':_0x3205c0}:null;}})[_0xde3e('0x1f')](respondWithResult(_0x16e02f,null))[_0xde3e('0x28')](handleError(_0x16e02f,null));};exports[_0xde3e('0x5c')]=function(_0x3d12be,_0x402edf,_0x593d42){var _0x2d72ec={};var _0x30534f={};var _0x8b45d;var _0x251261;return db['ZendeskConfiguration'][_0xde3e('0x59')]({'where':{'id':_0x3d12be[_0xde3e('0x52')]['id']}})['then'](handleEntityNotFound(_0x402edf,null))[_0xde3e('0x1f')](function(_0x4ff404){if(_0x4ff404){_0x8b45d=_0x4ff404;_0x30534f[_0xde3e('0x3b')]=_[_0xde3e('0x3e')](db[_0xde3e('0x5d')]['rawAttributes']);_0x30534f[_0xde3e('0x3d')]=_[_0xde3e('0x3e')](_0x3d12be[_0xde3e('0x3d')]);_0x30534f['filters']=_[_0xde3e('0x40')](_0x30534f[_0xde3e('0x3b')],_0x30534f[_0xde3e('0x3d')]);_0x2d72ec[_0xde3e('0x3f')]=_[_0xde3e('0x40')](_0x30534f[_0xde3e('0x3b')],qs['fields'](_0x3d12be['query']['fields']));_0x2d72ec['attributes']=_0x2d72ec['attributes'][_0xde3e('0x42')]?_0x2d72ec[_0xde3e('0x3f')]:_0x30534f[_0xde3e('0x3b')];_0x2d72ec[_0xde3e('0x45')]=qs[_0xde3e('0x46')](_0x3d12be[_0xde3e('0x3d')][_0xde3e('0x46')]);_0x2d72ec[_0xde3e('0x47')]=qs[_0xde3e('0x53')](_[_0xde3e('0x48')](_0x3d12be[_0xde3e('0x3d')],_0x30534f[_0xde3e('0x53')]));if(_0x3d12be['query'][_0xde3e('0x49')]){_0x2d72ec[_0xde3e('0x47')]=_[_0xde3e('0x4a')](_0x2d72ec[_0xde3e('0x47')],{'$or':_[_0xde3e('0x3c')](_0x2d72ec[_0xde3e('0x3f')],function(_0x4f29cc){var _0x497993={};_0x497993[_0x4f29cc]={'$like':'%'+_0x3d12be[_0xde3e('0x3d')][_0xde3e('0x49')]+'%'};return _0x497993;})});}_0x2d72ec=_[_0xde3e('0x4a')]({},_0x2d72ec,_0x3d12be[_0xde3e('0x4c')]);return _0x8b45d[_0xde3e('0x5c')](_0x2d72ec);}})[_0xde3e('0x1f')](function(_0x5cb173){if(_0x5cb173){_0x251261=_0x5cb173[_0xde3e('0x42')];if(!_0x3d12be[_0xde3e('0x3d')][_0xde3e('0x43')](_0xde3e('0x44'))){_0x2d72ec[_0xde3e('0x2e')]=qs[_0xde3e('0x2e')](_0x3d12be[_0xde3e('0x3d')][_0xde3e('0x2e')]);_0x2d72ec[_0xde3e('0x2d')]=qs[_0xde3e('0x2d')](_0x3d12be['query']['offset']);}return _0x8b45d[_0xde3e('0x5c')](_0x2d72ec);}})['then'](function(_0x14372e){if(_0x14372e){return _0x14372e?{'count':_0x251261,'rows':_0x14372e}:null;}})[_0xde3e('0x1f')](respondWithResult(_0x402edf,null))[_0xde3e('0x28')](handleError(_0x402edf,null));};exports[_0xde3e('0x5e')]=function(_0x244a02,_0x47105c,_0x1c68cd){if(_0x244a02['body']['id']){delete _0x244a02[_0xde3e('0x56')]['id'];}return db[_0xde3e('0x4f')]['findOne']({'where':{'id':_0x244a02[_0xde3e('0x52')]['id']}})[_0xde3e('0x1f')](handleEntityNotFound(_0x47105c,null))[_0xde3e('0x1f')](function(_0x260a64){if(_0x260a64){return _0x260a64[_0xde3e('0x5e')](_0x244a02[_0xde3e('0x56')][_0xde3e('0x5f')]||[]);}return null;})[_0xde3e('0x1f')](respondWithResult(_0x47105c,null))[_0xde3e('0x28')](handleError(_0x47105c,null));};
\ No newline at end of file
+var _0xe3d5=['../../mysqldb','jayson/promise','client','http','test','Sequelize','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','count','offset','limit','set','json','apply','reject','save','update','destroy','end','sendStatus','index','map','fieldName','type','key','name','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','ZendeskConfiguration','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','findOne','ZendeskField','pick','getFields','getSubjects','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x3bd143,_0x13f1ec){var _0x27ecbf=function(_0x312e16){while(--_0x312e16){_0x3bd143['push'](_0x3bd143['shift']());}};_0x27ecbf(++_0x13f1ec);}(_0xe3d5,0x1de));var _0x5e3d=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0xe3d5[_0x297c55];return _0x120389;};'use strict';var pdf=require(_0x5e3d('0x0'));var emlformat=require(_0x5e3d('0x1'));var rimraf=require(_0x5e3d('0x2'));var zipdir=require(_0x5e3d('0x3'));var jsonpatch=require(_0x5e3d('0x4'));var rp=require(_0x5e3d('0x5'));var moment=require(_0x5e3d('0x6'));var BPromise=require(_0x5e3d('0x7'));var Mustache=require(_0x5e3d('0x8'));var util=require(_0x5e3d('0x9'));var path=require(_0x5e3d('0xa'));var sox=require(_0x5e3d('0xb'));var csv=require(_0x5e3d('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5e3d('0xd'));var squel=require(_0x5e3d('0xe'));var crypto=require(_0x5e3d('0xf'));var jsforce=require(_0x5e3d('0x10'));var deskjs=require(_0x5e3d('0x11'));var toCsv=require(_0x5e3d('0xc'));var querystring=require(_0x5e3d('0x12'));var Papa=require(_0x5e3d('0x13'));var Redis=require(_0x5e3d('0x14'));var authService=require(_0x5e3d('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x5e3d('0x16'));var hardwareService=require(_0x5e3d('0x17'));var logger=require(_0x5e3d('0x18'))('api');var utils=require(_0x5e3d('0x19'));var config=require(_0x5e3d('0x1a'));var db=require(_0x5e3d('0x1b'))['db'];var jayson=require(_0x5e3d('0x1c'));var client=jayson[_0x5e3d('0x1d')][_0x5e3d('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x2b3a45,_0x1c577f,_0x8cc301){if(_0x8cc301){var _0x4c8a95=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4c8a95[_0x5e3d('0x1f')](_0x1c577f)){return _0x2b3a45;}else{throw new db[(_0x5e3d('0x20'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2b3a45;}}function respondWithRpcPromise(_0xcf056c,_0x541254,_0x8f3048,_0x4367a1){return new BPromise(function(_0x564286,_0x22542f){var _0x248336=_0x4367a1||client;return _0x248336[_0x5e3d('0x21')](_0xcf056c,_0x8f3048)[_0x5e3d('0x22')](function(_0x478fbd){logger[_0x5e3d('0x23')](_0x5e3d('0x24'),_0x541254,_0x5e3d('0x25'));logger[_0x5e3d('0x26')](_0x5e3d('0x27'),_0x541254,'request\x20sent',JSON[_0x5e3d('0x28')](_0x478fbd));if(_0x478fbd[_0x5e3d('0x29')]){if(_0x478fbd['error']['code']===0x1f4){logger['error'](_0x5e3d('0x24'),_0x541254,_0x478fbd['error'][_0x5e3d('0x2a')]);return _0x22542f(_0x478fbd[_0x5e3d('0x29')]['message']);}logger[_0x5e3d('0x29')](_0x5e3d('0x24'),_0x541254,_0x478fbd['error'][_0x5e3d('0x2a')]);return _0x564286(_0x478fbd[_0x5e3d('0x29')][_0x5e3d('0x2a')]);}else{logger[_0x5e3d('0x23')](_0x5e3d('0x24'),_0x541254,'request\x20sent');_0x564286(_0x478fbd[_0x5e3d('0x2b')][_0x5e3d('0x2a')]);}})[_0x5e3d('0x2c')](function(_0x5a014e){logger['error'](_0x5e3d('0x24'),_0x541254,_0x5a014e);_0x22542f(_0x5a014e);});});}function respondWithStatusCode(_0x46a091,_0x3924a7){_0x3924a7=_0x3924a7||0xcc;return function(_0x11f0a8){if(_0x11f0a8){return _0x46a091['sendStatus'](_0x3924a7);}return _0x46a091[_0x5e3d('0x2d')](_0x3924a7)['end']();};}function respondWithResult(_0x721092,_0x59b8dc){_0x59b8dc=_0x59b8dc||0xc8;return function(_0x137e31){if(_0x137e31){return _0x721092[_0x5e3d('0x2d')](_0x59b8dc)['json'](_0x137e31);}};}function respondWithFilteredResult(_0x491cf2,_0x45314f){return function(_0x35ad7b){if(_0x35ad7b){var _0x3942c8=_0x35ad7b[_0x5e3d('0x2e')],_0x1c39ef=_0x45314f[_0x5e3d('0x2f')],_0x3ab494=_0x45314f['offset']+_0x45314f[_0x5e3d('0x30')],_0x16ec21;if(_0x3ab494>=_0x3942c8){_0x3ab494=_0x3942c8;_0x16ec21=0xc8;}else{_0x16ec21=0xce;}_0x491cf2[_0x5e3d('0x2d')](_0x16ec21);return _0x491cf2[_0x5e3d('0x31')]('Content-Range',_0x1c39ef+'-'+_0x3ab494+'/'+_0x3942c8)[_0x5e3d('0x32')](_0x35ad7b);}return null;};}function patchUpdates(_0x42b741){return function(_0xcc6f0d){try{jsonpatch[_0x5e3d('0x33')](_0xcc6f0d,_0x42b741,!![]);}catch(_0x2b1cc6){return BPromise[_0x5e3d('0x34')](_0x2b1cc6);}return _0xcc6f0d[_0x5e3d('0x35')]();};}function saveUpdates(_0x9d6e8,_0x575ee9){return function(_0x50f9c4){if(_0x50f9c4){return _0x50f9c4[_0x5e3d('0x36')](_0x9d6e8)[_0x5e3d('0x22')](function(_0x2bbef0){return _0x2bbef0;});}return null;};}function removeEntity(_0x30213d,_0x41a01c){return function(_0x12a4aa){if(_0x12a4aa){return _0x12a4aa[_0x5e3d('0x37')]()[_0x5e3d('0x22')](function(){_0x30213d[_0x5e3d('0x2d')](0xcc)[_0x5e3d('0x38')]();});}};}function handleEntityNotFound(_0x8bbb7d,_0x390914){return function(_0x298565){if(!_0x298565){_0x8bbb7d[_0x5e3d('0x39')](0x194);}return _0x298565;};}function handleError(_0x7eeb50,_0x27f195){_0x27f195=_0x27f195||0x1f4;return function(_0x120ef3){logger[_0x5e3d('0x29')](_0x120ef3['stack']);if(_0x120ef3['name']){delete _0x120ef3['name'];}_0x7eeb50['status'](_0x27f195)['send'](_0x120ef3);};}exports[_0x5e3d('0x3a')]=function(_0x34a87a,_0x413b9f){var _0x237d84={},_0x33e214={},_0x6d1edc={'count':0x0,'rows':[]};var _0x383962=_[_0x5e3d('0x3b')](db['ZendeskConfiguration']['rawAttributes'],function(_0x467236){return{'name':_0x467236[_0x5e3d('0x3c')],'type':_0x467236[_0x5e3d('0x3d')][_0x5e3d('0x3e')]};});_0x33e214['model']=_['map'](_0x383962,_0x5e3d('0x3f'));_0x33e214['query']=_[_0x5e3d('0x40')](_0x34a87a[_0x5e3d('0x41')]);_0x33e214['filters']=_[_0x5e3d('0x42')](_0x33e214[_0x5e3d('0x43')],_0x33e214[_0x5e3d('0x41')]);_0x237d84['attributes']=_[_0x5e3d('0x42')](_0x33e214[_0x5e3d('0x43')],qs[_0x5e3d('0x44')](_0x34a87a[_0x5e3d('0x41')][_0x5e3d('0x44')]));_0x237d84[_0x5e3d('0x45')]=_0x237d84[_0x5e3d('0x45')][_0x5e3d('0x46')]?_0x237d84[_0x5e3d('0x45')]:_0x33e214[_0x5e3d('0x43')];if(!_0x34a87a[_0x5e3d('0x41')][_0x5e3d('0x47')](_0x5e3d('0x48'))){_0x237d84[_0x5e3d('0x30')]=qs[_0x5e3d('0x30')](_0x34a87a[_0x5e3d('0x41')]['limit']);_0x237d84['offset']=qs[_0x5e3d('0x2f')](_0x34a87a['query'][_0x5e3d('0x2f')]);}_0x237d84[_0x5e3d('0x49')]=qs[_0x5e3d('0x4a')](_0x34a87a[_0x5e3d('0x41')][_0x5e3d('0x4a')]);_0x237d84[_0x5e3d('0x4b')]=qs[_0x5e3d('0x4c')](_['pick'](_0x34a87a[_0x5e3d('0x41')],_0x33e214[_0x5e3d('0x4c')]),_0x383962);if(_0x34a87a[_0x5e3d('0x41')]['filter']){_0x237d84[_0x5e3d('0x4b')]=_[_0x5e3d('0x4d')](_0x237d84[_0x5e3d('0x4b')],{'$or':_[_0x5e3d('0x3b')](_0x383962,function(_0x347ceb){if(_0x347ceb[_0x5e3d('0x3d')]!==_0x5e3d('0x4e')){var _0x3d9be8={};_0x3d9be8[_0x347ceb['name']]={'$like':'%'+_0x34a87a[_0x5e3d('0x41')][_0x5e3d('0x4f')]+'%'};return _0x3d9be8;}})});}_0x237d84=_[_0x5e3d('0x4d')]({},_0x237d84,_0x34a87a[_0x5e3d('0x50')]);var _0x4f2322={'where':_0x237d84['where']};return db[_0x5e3d('0x51')][_0x5e3d('0x2e')](_0x4f2322)['then'](function(_0x5aad23){_0x6d1edc[_0x5e3d('0x2e')]=_0x5aad23;if(_0x34a87a[_0x5e3d('0x41')][_0x5e3d('0x52')]){_0x237d84[_0x5e3d('0x53')]=[{'all':!![]}];}return db[_0x5e3d('0x51')][_0x5e3d('0x54')](_0x237d84);})['then'](function(_0x2014db){_0x6d1edc[_0x5e3d('0x55')]=_0x2014db;return _0x6d1edc;})[_0x5e3d('0x22')](respondWithFilteredResult(_0x413b9f,_0x237d84))[_0x5e3d('0x2c')](handleError(_0x413b9f,null));};exports[_0x5e3d('0x56')]=function(_0xcea51,_0x43294e){var _0x68c31b={'raw':![],'where':{'id':_0xcea51[_0x5e3d('0x57')]['id']}},_0x42d94c={};_0x42d94c[_0x5e3d('0x43')]=_[_0x5e3d('0x40')](db[_0x5e3d('0x51')][_0x5e3d('0x58')]);_0x42d94c[_0x5e3d('0x41')]=_[_0x5e3d('0x40')](_0xcea51[_0x5e3d('0x41')]);_0x42d94c['filters']=_['intersection'](_0x42d94c[_0x5e3d('0x43')],_0x42d94c[_0x5e3d('0x41')]);_0x68c31b['attributes']=_[_0x5e3d('0x42')](_0x42d94c[_0x5e3d('0x43')],qs['fields'](_0xcea51[_0x5e3d('0x41')][_0x5e3d('0x44')]));_0x68c31b[_0x5e3d('0x45')]=_0x68c31b[_0x5e3d('0x45')][_0x5e3d('0x46')]?_0x68c31b[_0x5e3d('0x45')]:_0x42d94c[_0x5e3d('0x43')];if(_0xcea51[_0x5e3d('0x41')][_0x5e3d('0x52')]){_0x68c31b[_0x5e3d('0x53')]=[{'all':!![]}];}_0x68c31b=_[_0x5e3d('0x4d')]({},_0x68c31b,_0xcea51[_0x5e3d('0x50')]);return db['ZendeskConfiguration'][_0x5e3d('0x59')](_0x68c31b)[_0x5e3d('0x22')](handleEntityNotFound(_0x43294e,null))[_0x5e3d('0x22')](respondWithResult(_0x43294e,null))[_0x5e3d('0x2c')](handleError(_0x43294e,null));};exports[_0x5e3d('0x5a')]=function(_0x3a8728,_0x61d95d){return db[_0x5e3d('0x51')][_0x5e3d('0x5a')](_0x3a8728[_0x5e3d('0x5b')],{})[_0x5e3d('0x22')](respondWithResult(_0x61d95d,0xc9))[_0x5e3d('0x2c')](handleError(_0x61d95d,null));};exports[_0x5e3d('0x36')]=function(_0x274837,_0x57eda3){if(_0x274837['body']['id']){delete _0x274837[_0x5e3d('0x5b')]['id'];}return db[_0x5e3d('0x51')][_0x5e3d('0x59')]({'where':{'id':_0x274837[_0x5e3d('0x57')]['id']}})['then'](handleEntityNotFound(_0x57eda3,null))[_0x5e3d('0x22')](saveUpdates(_0x274837[_0x5e3d('0x5b')],null))[_0x5e3d('0x22')](respondWithResult(_0x57eda3,null))[_0x5e3d('0x2c')](handleError(_0x57eda3,null));};exports[_0x5e3d('0x37')]=function(_0x18a140,_0x1e8409){return db[_0x5e3d('0x51')][_0x5e3d('0x59')]({'where':{'id':_0x18a140['params']['id']}})['then'](handleEntityNotFound(_0x1e8409,null))[_0x5e3d('0x22')](removeEntity(_0x1e8409,null))[_0x5e3d('0x2c')](handleError(_0x1e8409,null));};exports['getFields']=function(_0x451b17,_0x466fbe,_0x379dbc){var _0x54bc47={};var _0x560a7a={};var _0x2db6ac;var _0x144b19;return db[_0x5e3d('0x51')][_0x5e3d('0x5c')]({'where':{'id':_0x451b17[_0x5e3d('0x57')]['id']}})['then'](handleEntityNotFound(_0x466fbe,null))['then'](function(_0x1ae7aa){if(_0x1ae7aa){_0x2db6ac=_0x1ae7aa;_0x560a7a[_0x5e3d('0x43')]=_['keys'](db[_0x5e3d('0x5d')][_0x5e3d('0x58')]);_0x560a7a[_0x5e3d('0x41')]=_[_0x5e3d('0x40')](_0x451b17[_0x5e3d('0x41')]);_0x560a7a['filters']=_[_0x5e3d('0x42')](_0x560a7a['model'],_0x560a7a[_0x5e3d('0x41')]);_0x54bc47[_0x5e3d('0x45')]=_[_0x5e3d('0x42')](_0x560a7a[_0x5e3d('0x43')],qs[_0x5e3d('0x44')](_0x451b17[_0x5e3d('0x41')][_0x5e3d('0x44')]));_0x54bc47[_0x5e3d('0x45')]=_0x54bc47[_0x5e3d('0x45')][_0x5e3d('0x46')]?_0x54bc47[_0x5e3d('0x45')]:_0x560a7a[_0x5e3d('0x43')];_0x54bc47[_0x5e3d('0x49')]=qs['sort'](_0x451b17[_0x5e3d('0x41')][_0x5e3d('0x4a')]);_0x54bc47[_0x5e3d('0x4b')]=qs[_0x5e3d('0x4c')](_[_0x5e3d('0x5e')](_0x451b17['query'],_0x560a7a[_0x5e3d('0x4c')]));if(_0x451b17[_0x5e3d('0x41')][_0x5e3d('0x4f')]){_0x54bc47[_0x5e3d('0x4b')]=_[_0x5e3d('0x4d')](_0x54bc47[_0x5e3d('0x4b')],{'$or':_[_0x5e3d('0x3b')](_0x54bc47[_0x5e3d('0x45')],function(_0x4b8ca5){var _0x116948={};_0x116948[_0x4b8ca5]={'$like':'%'+_0x451b17[_0x5e3d('0x41')][_0x5e3d('0x4f')]+'%'};return _0x116948;})});}_0x54bc47=_[_0x5e3d('0x4d')]({},_0x54bc47,_0x451b17['options']);return _0x2db6ac[_0x5e3d('0x5f')](_0x54bc47);}})['then'](function(_0x28e17f){if(_0x28e17f){_0x144b19=_0x28e17f[_0x5e3d('0x46')];if(!_0x451b17[_0x5e3d('0x41')][_0x5e3d('0x47')](_0x5e3d('0x48'))){_0x54bc47[_0x5e3d('0x30')]=qs['limit'](_0x451b17[_0x5e3d('0x41')][_0x5e3d('0x30')]);_0x54bc47[_0x5e3d('0x2f')]=qs[_0x5e3d('0x2f')](_0x451b17[_0x5e3d('0x41')][_0x5e3d('0x2f')]);}return _0x2db6ac[_0x5e3d('0x5f')](_0x54bc47);}})[_0x5e3d('0x22')](function(_0x5bccf2){if(_0x5bccf2){return _0x5bccf2?{'count':_0x144b19,'rows':_0x5bccf2}:null;}})[_0x5e3d('0x22')](respondWithResult(_0x466fbe,null))['catch'](handleError(_0x466fbe,null));};exports[_0x5e3d('0x60')]=function(_0x58efd1,_0x2a5ead,_0x1606d9){var _0x5cce19={};var _0x4047d3={};var _0x2803b7;var _0x144ae2;return db['ZendeskConfiguration'][_0x5e3d('0x5c')]({'where':{'id':_0x58efd1[_0x5e3d('0x57')]['id']}})[_0x5e3d('0x22')](handleEntityNotFound(_0x2a5ead,null))[_0x5e3d('0x22')](function(_0x26e8fa){if(_0x26e8fa){_0x2803b7=_0x26e8fa;_0x4047d3['model']=_[_0x5e3d('0x40')](db[_0x5e3d('0x5d')][_0x5e3d('0x58')]);_0x4047d3[_0x5e3d('0x41')]=_[_0x5e3d('0x40')](_0x58efd1[_0x5e3d('0x41')]);_0x4047d3[_0x5e3d('0x4c')]=_[_0x5e3d('0x42')](_0x4047d3['model'],_0x4047d3[_0x5e3d('0x41')]);_0x5cce19['attributes']=_[_0x5e3d('0x42')](_0x4047d3[_0x5e3d('0x43')],qs['fields'](_0x58efd1[_0x5e3d('0x41')][_0x5e3d('0x44')]));_0x5cce19[_0x5e3d('0x45')]=_0x5cce19[_0x5e3d('0x45')][_0x5e3d('0x46')]?_0x5cce19[_0x5e3d('0x45')]:_0x4047d3[_0x5e3d('0x43')];_0x5cce19['order']=qs[_0x5e3d('0x4a')](_0x58efd1['query']['sort']);_0x5cce19[_0x5e3d('0x4b')]=qs[_0x5e3d('0x4c')](_[_0x5e3d('0x5e')](_0x58efd1[_0x5e3d('0x41')],_0x4047d3[_0x5e3d('0x4c')]));if(_0x58efd1[_0x5e3d('0x41')][_0x5e3d('0x4f')]){_0x5cce19[_0x5e3d('0x4b')]=_['merge'](_0x5cce19[_0x5e3d('0x4b')],{'$or':_[_0x5e3d('0x3b')](_0x5cce19['attributes'],function(_0x45c57f){var _0x4f2c82={};_0x4f2c82[_0x45c57f]={'$like':'%'+_0x58efd1[_0x5e3d('0x41')][_0x5e3d('0x4f')]+'%'};return _0x4f2c82;})});}_0x5cce19=_['merge']({},_0x5cce19,_0x58efd1[_0x5e3d('0x50')]);return _0x2803b7['getSubjects'](_0x5cce19);}})[_0x5e3d('0x22')](function(_0x41bade){if(_0x41bade){_0x144ae2=_0x41bade[_0x5e3d('0x46')];if(!_0x58efd1[_0x5e3d('0x41')][_0x5e3d('0x47')](_0x5e3d('0x48'))){_0x5cce19[_0x5e3d('0x30')]=qs[_0x5e3d('0x30')](_0x58efd1[_0x5e3d('0x41')][_0x5e3d('0x30')]);_0x5cce19[_0x5e3d('0x2f')]=qs[_0x5e3d('0x2f')](_0x58efd1[_0x5e3d('0x41')][_0x5e3d('0x2f')]);}return _0x2803b7['getSubjects'](_0x5cce19);}})[_0x5e3d('0x22')](function(_0x49c436){if(_0x49c436){return _0x49c436?{'count':_0x144ae2,'rows':_0x49c436}:null;}})[_0x5e3d('0x22')](respondWithResult(_0x2a5ead,null))[_0x5e3d('0x2c')](handleError(_0x2a5ead,null));};exports[_0x5e3d('0x61')]=function(_0x43d799,_0x41b6b8,_0x519411){var _0x53a30f={};var _0x32cdc9={};var _0x1d81f7;var _0x492e72;return db[_0x5e3d('0x51')][_0x5e3d('0x5c')]({'where':{'id':_0x43d799[_0x5e3d('0x57')]['id']}})[_0x5e3d('0x22')](handleEntityNotFound(_0x41b6b8,null))['then'](function(_0x548cac){if(_0x548cac){_0x1d81f7=_0x548cac;_0x32cdc9[_0x5e3d('0x43')]=_['keys'](db['ZendeskField'][_0x5e3d('0x58')]);_0x32cdc9[_0x5e3d('0x41')]=_['keys'](_0x43d799[_0x5e3d('0x41')]);_0x32cdc9['filters']=_[_0x5e3d('0x42')](_0x32cdc9['model'],_0x32cdc9[_0x5e3d('0x41')]);_0x53a30f[_0x5e3d('0x45')]=_[_0x5e3d('0x42')](_0x32cdc9[_0x5e3d('0x43')],qs['fields'](_0x43d799[_0x5e3d('0x41')][_0x5e3d('0x44')]));_0x53a30f['attributes']=_0x53a30f['attributes']['length']?_0x53a30f[_0x5e3d('0x45')]:_0x32cdc9['model'];_0x53a30f[_0x5e3d('0x49')]=qs[_0x5e3d('0x4a')](_0x43d799[_0x5e3d('0x41')][_0x5e3d('0x4a')]);_0x53a30f[_0x5e3d('0x4b')]=qs[_0x5e3d('0x4c')](_[_0x5e3d('0x5e')](_0x43d799[_0x5e3d('0x41')],_0x32cdc9['filters']));if(_0x43d799[_0x5e3d('0x41')][_0x5e3d('0x4f')]){_0x53a30f['where']=_[_0x5e3d('0x4d')](_0x53a30f['where'],{'$or':_[_0x5e3d('0x3b')](_0x53a30f[_0x5e3d('0x45')],function(_0x4e468a){var _0x36e967={};_0x36e967[_0x4e468a]={'$like':'%'+_0x43d799[_0x5e3d('0x41')]['filter']+'%'};return _0x36e967;})});}_0x53a30f=_[_0x5e3d('0x4d')]({},_0x53a30f,_0x43d799[_0x5e3d('0x50')]);return _0x1d81f7['getDescriptions'](_0x53a30f);}})[_0x5e3d('0x22')](function(_0x2dce49){if(_0x2dce49){_0x492e72=_0x2dce49[_0x5e3d('0x46')];if(!_0x43d799['query']['hasOwnProperty']('nolimit')){_0x53a30f[_0x5e3d('0x30')]=qs[_0x5e3d('0x30')](_0x43d799['query'][_0x5e3d('0x30')]);_0x53a30f[_0x5e3d('0x2f')]=qs['offset'](_0x43d799[_0x5e3d('0x41')]['offset']);}return _0x1d81f7[_0x5e3d('0x61')](_0x53a30f);}})['then'](function(_0x3de0f9){if(_0x3de0f9){return _0x3de0f9?{'count':_0x492e72,'rows':_0x3de0f9}:null;}})['then'](respondWithResult(_0x41b6b8,null))[_0x5e3d('0x2c')](handleError(_0x41b6b8,null));};exports[_0x5e3d('0x62')]=function(_0x9abc0f,_0x29fc34,_0x1e686f){var _0x5f02ba={};var _0xd99321={};var _0x233d16;var _0x2dbf8b;return db['ZendeskConfiguration'][_0x5e3d('0x5c')]({'where':{'id':_0x9abc0f[_0x5e3d('0x57')]['id']}})[_0x5e3d('0x22')](handleEntityNotFound(_0x29fc34,null))[_0x5e3d('0x22')](function(_0x2a8540){if(_0x2a8540){_0x233d16=_0x2a8540;_0xd99321[_0x5e3d('0x43')]=_[_0x5e3d('0x40')](db['Tag'][_0x5e3d('0x58')]);_0xd99321['query']=_[_0x5e3d('0x40')](_0x9abc0f['query']);_0xd99321[_0x5e3d('0x4c')]=_[_0x5e3d('0x42')](_0xd99321[_0x5e3d('0x43')],_0xd99321[_0x5e3d('0x41')]);_0x5f02ba[_0x5e3d('0x45')]=_[_0x5e3d('0x42')](_0xd99321[_0x5e3d('0x43')],qs[_0x5e3d('0x44')](_0x9abc0f['query'][_0x5e3d('0x44')]));_0x5f02ba['attributes']=_0x5f02ba[_0x5e3d('0x45')][_0x5e3d('0x46')]?_0x5f02ba[_0x5e3d('0x45')]:_0xd99321[_0x5e3d('0x43')];_0x5f02ba[_0x5e3d('0x49')]=qs[_0x5e3d('0x4a')](_0x9abc0f[_0x5e3d('0x41')][_0x5e3d('0x4a')]);_0x5f02ba[_0x5e3d('0x4b')]=qs[_0x5e3d('0x4c')](_[_0x5e3d('0x5e')](_0x9abc0f[_0x5e3d('0x41')],_0xd99321[_0x5e3d('0x4c')]));if(_0x9abc0f[_0x5e3d('0x41')][_0x5e3d('0x4f')]){_0x5f02ba[_0x5e3d('0x4b')]=_['merge'](_0x5f02ba[_0x5e3d('0x4b')],{'$or':_[_0x5e3d('0x3b')](_0x5f02ba[_0x5e3d('0x45')],function(_0x1c8cbc){var _0x545faa={};_0x545faa[_0x1c8cbc]={'$like':'%'+_0x9abc0f[_0x5e3d('0x41')][_0x5e3d('0x4f')]+'%'};return _0x545faa;})});}_0x5f02ba=_['merge']({},_0x5f02ba,_0x9abc0f[_0x5e3d('0x50')]);return _0x233d16[_0x5e3d('0x62')](_0x5f02ba);}})[_0x5e3d('0x22')](function(_0x2a4529){if(_0x2a4529){_0x2dbf8b=_0x2a4529[_0x5e3d('0x46')];if(!_0x9abc0f[_0x5e3d('0x41')][_0x5e3d('0x47')](_0x5e3d('0x48'))){_0x5f02ba[_0x5e3d('0x30')]=qs[_0x5e3d('0x30')](_0x9abc0f[_0x5e3d('0x41')][_0x5e3d('0x30')]);_0x5f02ba[_0x5e3d('0x2f')]=qs['offset'](_0x9abc0f[_0x5e3d('0x41')][_0x5e3d('0x2f')]);}return _0x233d16[_0x5e3d('0x62')](_0x5f02ba);}})[_0x5e3d('0x22')](function(_0x208231){if(_0x208231){return _0x208231?{'count':_0x2dbf8b,'rows':_0x208231}:null;}})[_0x5e3d('0x22')](respondWithResult(_0x29fc34,null))[_0x5e3d('0x2c')](handleError(_0x29fc34,null));};exports[_0x5e3d('0x63')]=function(_0x1b10f6,_0x4baeb9,_0x2a9627){if(_0x1b10f6['body']['id']){delete _0x1b10f6[_0x5e3d('0x5b')]['id'];}return db[_0x5e3d('0x51')][_0x5e3d('0x5c')]({'where':{'id':_0x1b10f6[_0x5e3d('0x57')]['id']}})[_0x5e3d('0x22')](handleEntityNotFound(_0x4baeb9,null))[_0x5e3d('0x22')](function(_0x55dba4){if(_0x55dba4){return _0x55dba4[_0x5e3d('0x63')](_0x1b10f6['body'][_0x5e3d('0x64')]||[]);}return null;})['then'](respondWithResult(_0x4baeb9,null))[_0x5e3d('0x2c')](handleError(_0x4baeb9,null));};
\ No newline at end of file
index ef8a85b..52bba66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc185=['request-promise','rimraf','./intZendeskConfiguration.attributes','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','moment','bluebird'];(function(_0x481387,_0x23f3a2){var _0x236bf6=function(_0x3e35c8){while(--_0x3e35c8){_0x481387['push'](_0x481387['shift']());}};_0x236bf6(++_0x23f3a2);}(_0xc185,0x1a3));var _0x5c18=function(_0x343436,_0x49733b){_0x343436=_0x343436-0x0;var _0x3f07c2=_0xc185[_0x343436];return _0x3f07c2;};'use strict';var _=require(_0x5c18('0x0'));var util=require('util');var logger=require(_0x5c18('0x1'))('api');var moment=require(_0x5c18('0x2'));var BPromise=require(_0x5c18('0x3'));var rp=require(_0x5c18('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5c18('0x5'));var config=require('../../config/environment');var attributes=require(_0x5c18('0x6'));module['exports']=function(_0x5e81b3,_0x11c35c){return _0x5e81b3['define'](_0x5c18('0x7'),attributes,{'tableName':_0x5c18('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2aae=['define','int_zendesk_configurations','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x20ff3d,_0x85ff92){var _0x3dd358=function(_0x573480){while(--_0x573480){_0x20ff3d['push'](_0x20ff3d['shift']());}};_0x3dd358(++_0x85ff92);}(_0x2aae,0x13d));var _0xe2aa=function(_0x738f1,_0x526031){_0x738f1=_0x738f1-0x0;var _0x47bc8c=_0x2aae[_0x738f1];return _0x47bc8c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe2aa('0x0'))('api');var moment=require(_0xe2aa('0x1'));var BPromise=require(_0xe2aa('0x2'));var rp=require(_0xe2aa('0x3'));var fs=require('fs');var path=require(_0xe2aa('0x4'));var rimraf=require('rimraf');var config=require(_0xe2aa('0x5'));var attributes=require(_0xe2aa('0x6'));module['exports']=function(_0x10bd27,_0x31cf92){return _0x10bd27[_0xe2aa('0x7')]('ZendeskConfiguration',attributes,{'tableName':_0xe2aa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 12f32d4..32d8070 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdac2=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','debug','request\x20sent','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info','result','catch'];(function(_0xaab2f5,_0x58463f){var _0x3b28ea=function(_0xcbc73c){while(--_0xcbc73c){_0xaab2f5['push'](_0xaab2f5['shift']());}};_0x3b28ea(++_0x58463f);}(_0xdac2,0x159));var _0x2dac=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xdac2[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0x2dac('0x0'));var util=require(_0x2dac('0x1'));var moment=require(_0x2dac('0x2'));var BPromise=require(_0x2dac('0x3'));var rs=require(_0x2dac('0x4'));var fs=require('fs');var Redis=require(_0x2dac('0x5'));var db=require(_0x2dac('0x6'))['db'];var utils=require(_0x2dac('0x7'));var logger=require(_0x2dac('0x8'))('rpc');var config=require(_0x2dac('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2dac('0xa')][_0x2dac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x178f2e,_0xd91deb,_0x15c86c){return new BPromise(function(_0x14afe2,_0x3e44d1){return client[_0x2dac('0xc')](_0x178f2e,_0x15c86c)['then'](function(_0x30aea7){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0xd91deb,'request\x20sent');logger[_0x2dac('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0xd91deb,_0x2dac('0xe'),JSON[_0x2dac('0xf')](_0x30aea7));if(_0x30aea7[_0x2dac('0x10')]){if(_0x30aea7[_0x2dac('0x10')][_0x2dac('0x11')]===0x1f4){logger['error'](_0x2dac('0x12'),_0xd91deb,_0x30aea7[_0x2dac('0x10')][_0x2dac('0x13')]);return _0x3e44d1(_0x30aea7[_0x2dac('0x10')][_0x2dac('0x13')]);}logger[_0x2dac('0x10')](_0x2dac('0x12'),_0xd91deb,_0x30aea7[_0x2dac('0x10')]['message']);return _0x14afe2(_0x30aea7[_0x2dac('0x10')]['message']);}else{logger[_0x2dac('0x14')](_0x2dac('0x12'),_0xd91deb,_0x2dac('0xe'));_0x14afe2(_0x30aea7[_0x2dac('0x15')][_0x2dac('0x13')]);}})[_0x2dac('0x16')](function(_0x4755ce){logger['error'](_0x2dac('0x12'),_0xd91deb,_0x4755ce);_0x3e44d1(_0x4755ce);});});}
\ No newline at end of file
+var _0xb016=['result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xbad2b4,_0x165d66){var _0x9304ef=function(_0x17aa50){while(--_0x17aa50){_0xbad2b4['push'](_0xbad2b4['shift']());}};_0x9304ef(++_0x165d66);}(_0xb016,0x1d0));var _0x6b01=function(_0x4cba33,_0x29fa55){_0x4cba33=_0x4cba33-0x0;var _0x39c238=_0xb016[_0x4cba33];return _0x39c238;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var moment=require(_0x6b01('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b01('0x3'));var db=require(_0x6b01('0x4'))['db'];var utils=require(_0x6b01('0x5'));var logger=require(_0x6b01('0x6'))(_0x6b01('0x7'));var config=require('../../config/environment');var jayson=require(_0x6b01('0x8'));var client=jayson['client'][_0x6b01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x464fa4,_0x45a8e0,_0x2a35c1){return new BPromise(function(_0x2439c9,_0x1721ba){return client[_0x6b01('0xa')](_0x464fa4,_0x2a35c1)['then'](function(_0xd2f543){logger[_0x6b01('0xb')](_0x6b01('0xc'),_0x45a8e0,'request\x20sent');logger[_0x6b01('0xd')](_0x6b01('0xe'),_0x45a8e0,_0x6b01('0xf'),JSON[_0x6b01('0x10')](_0xd2f543));if(_0xd2f543[_0x6b01('0x11')]){if(_0xd2f543[_0x6b01('0x11')][_0x6b01('0x12')]===0x1f4){logger[_0x6b01('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x45a8e0,_0xd2f543[_0x6b01('0x11')]['message']);return _0x1721ba(_0xd2f543[_0x6b01('0x11')][_0x6b01('0x13')]);}logger['error'](_0x6b01('0xc'),_0x45a8e0,_0xd2f543[_0x6b01('0x11')][_0x6b01('0x13')]);return _0x2439c9(_0xd2f543['error'][_0x6b01('0x13')]);}else{logger[_0x6b01('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x45a8e0,_0x6b01('0xf'));_0x2439c9(_0xd2f543[_0x6b01('0x14')][_0x6b01('0x13')]);}})[_0x6b01('0x15')](function(_0x5a99cc){logger['error'](_0x6b01('0xc'),_0x45a8e0,_0x5a99cc);_0x1721ba(_0x5a99cc);});});}
\ No newline at end of file
index 7c5df44..7b42cd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18fe=['get','isAuthenticated','/:id','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x18fe,0x13a));var _0xe18f=function(_0x6d0875,_0xc22447){_0x6d0875=_0x6d0875-0x0;var _0x474aa6=_0x18fe[_0x6d0875];return _0x474aa6;};'use strict';var multer=require(_0xe18f('0x0'));var util=require(_0xe18f('0x1'));var path=require(_0xe18f('0x2'));var timeout=require(_0xe18f('0x3'));var express=require(_0xe18f('0x4'));var router=express[_0xe18f('0x5')]();var auth=require(_0xe18f('0x6'));var interaction=require(_0xe18f('0x7'));var config=require(_0xe18f('0x8'));var controller=require('./intZendeskField.controller');router[_0xe18f('0x9')]('/',auth[_0xe18f('0xa')](),controller['index']);router[_0xe18f('0x9')](_0xe18f('0xb'),auth[_0xe18f('0xa')](),controller[_0xe18f('0xc')]);router[_0xe18f('0xd')]('/',auth['isAuthenticated'](),controller[_0xe18f('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe18f('0xf')](_0xe18f('0xb'),auth[_0xe18f('0xa')](),controller[_0xe18f('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xb7cf=['post','create','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb7cf,0xca));var _0xfb7c=function(_0x48ace4,_0x3ecb6d){_0x48ace4=_0x48ace4-0x0;var _0x1605a1=_0xb7cf[_0x48ace4];return _0x1605a1;};'use strict';var multer=require(_0xfb7c('0x0'));var util=require(_0xfb7c('0x1'));var path=require(_0xfb7c('0x2'));var timeout=require(_0xfb7c('0x3'));var express=require(_0xfb7c('0x4'));var router=express['Router']();var auth=require(_0xfb7c('0x5'));var interaction=require(_0xfb7c('0x6'));var config=require(_0xfb7c('0x7'));var controller=require(_0xfb7c('0x8'));router[_0xfb7c('0x9')]('/',auth[_0xfb7c('0xa')](),controller[_0xfb7c('0xb')]);router[_0xfb7c('0x9')](_0xfb7c('0xc'),auth[_0xfb7c('0xa')](),controller[_0xfb7c('0xd')]);router[_0xfb7c('0xe')]('/',auth[_0xfb7c('0xa')](),controller[_0xfb7c('0xf')]);router['put'](_0xfb7c('0xc'),auth[_0xfb7c('0xa')](),controller[_0xfb7c('0x10')]);router['delete'](_0xfb7c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xfb7c('0x11')]=router;
\ No newline at end of file
index c7a8773..9131be5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x397c=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x56773d,_0x4e5b83){var _0x456d36=function(_0x1e39ed){while(--_0x1e39ed){_0x56773d['push'](_0x56773d['shift']());}};_0x456d36(++_0x4e5b83);}(_0x397c,0xc1));var _0xc397=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x397c[_0x455c6c];return _0x488242;};'use strict';var Sequelize=require(_0xc397('0x0'));module[_0xc397('0x1')]={'type':{'type':Sequelize[_0xc397('0x2')]('string',_0xc397('0x3'),'customVariable',_0xc397('0x4')),'defaultValue':_0xc397('0x5')},'content':{'type':Sequelize[_0xc397('0x6')]},'key':{'type':Sequelize[_0xc397('0x6')]},'keyType':{'type':Sequelize[_0xc397('0x2')]('string',_0xc397('0x3'),_0xc397('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc397('0x6')]},'nameField':{'type':Sequelize[_0xc397('0x6')]},'customField':{'type':Sequelize[_0xc397('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc397('0x6')]}};
\ No newline at end of file
+var _0xeddd=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','STRING','variable'];(function(_0xdb2a17,_0x3c803c){var _0x42250f=function(_0x20dd40){while(--_0x20dd40){_0xdb2a17['push'](_0xdb2a17['shift']());}};_0x42250f(++_0x3c803c);}(_0xeddd,0x69));var _0xdedd=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xeddd[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0xdedd('0x0'));module[_0xdedd('0x1')]={'type':{'type':Sequelize[_0xdedd('0x2')](_0xdedd('0x3'),'variable',_0xdedd('0x4'),'keyValue'),'defaultValue':_0xdedd('0x3')},'content':{'type':Sequelize[_0xdedd('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdedd('0x2')](_0xdedd('0x3'),_0xdedd('0x6'),_0xdedd('0x4'))},'keyContent':{'type':Sequelize[_0xdedd('0x5')]},'idField':{'type':Sequelize[_0xdedd('0x5')]},'nameField':{'type':Sequelize[_0xdedd('0x5')]},'customField':{'type':Sequelize[_0xdedd('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdedd('0x5')]}};
\ No newline at end of file
index 8b14280..056440c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62b7=['offset','limit','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZendeskField','fieldName','type','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','merge','filter','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count'];(function(_0x831d37,_0x594bd0){var _0x4225a4=function(_0x3d958b){while(--_0x3d958b){_0x831d37['push'](_0x831d37['shift']());}};_0x4225a4(++_0x594bd0);}(_0x62b7,0x72));var _0x762b=function(_0x43cf14,_0x2432f1){_0x43cf14=_0x43cf14-0x0;var _0x5ee8b1=_0x62b7[_0x43cf14];return _0x5ee8b1;};'use strict';var pdf=require(_0x762b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x762b('0x1'));var jsonpatch=require(_0x762b('0x2'));var rp=require(_0x762b('0x3'));var moment=require('moment');var BPromise=require(_0x762b('0x4'));var Mustache=require(_0x762b('0x5'));var util=require(_0x762b('0x6'));var path=require(_0x762b('0x7'));var sox=require(_0x762b('0x8'));var csv=require(_0x762b('0x9'));var ejs=require(_0x762b('0xa'));var fs=require('fs');var _=require(_0x762b('0xb'));var squel=require(_0x762b('0xc'));var crypto=require(_0x762b('0xd'));var jsforce=require(_0x762b('0xe'));var deskjs=require(_0x762b('0xf'));var toCsv=require(_0x762b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x762b('0x10'));var qs=require(_0x762b('0x11'));var as=require(_0x762b('0x12'));var hardwareService=require(_0x762b('0x13'));var logger=require(_0x762b('0x14'))(_0x762b('0x15'));var utils=require(_0x762b('0x16'));var config=require(_0x762b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2994e1,_0xacf822){_0xacf822=_0xacf822||0xcc;return function(_0xcfcd66){if(_0xcfcd66){return _0x2994e1['sendStatus'](_0xacf822);}return _0x2994e1[_0x762b('0x18')](_0xacf822)[_0x762b('0x19')]();};}function respondWithResult(_0x1a8205,_0x52ae82){_0x52ae82=_0x52ae82||0xc8;return function(_0x384a34){if(_0x384a34){return _0x1a8205['status'](_0x52ae82)[_0x762b('0x1a')](_0x384a34);}};}function respondWithFilteredResult(_0x132a5e,_0x2bbf93){return function(_0x54187a){if(_0x54187a){var _0x4819de=_0x54187a[_0x762b('0x1b')],_0x568fe7=_0x2bbf93['offset'],_0x27f9ee=_0x2bbf93[_0x762b('0x1c')]+_0x2bbf93[_0x762b('0x1d')],_0x43093a;if(_0x27f9ee>=_0x4819de){_0x27f9ee=_0x4819de;_0x43093a=0xc8;}else{_0x43093a=0xce;}_0x132a5e[_0x762b('0x18')](_0x43093a);return _0x132a5e[_0x762b('0x1e')](_0x762b('0x1f'),_0x568fe7+'-'+_0x27f9ee+'/'+_0x4819de)['json'](_0x54187a);}return null;};}function patchUpdates(_0x232d93){return function(_0xc2e2cb){try{jsonpatch['apply'](_0xc2e2cb,_0x232d93,!![]);}catch(_0xe44f99){return BPromise[_0x762b('0x20')](_0xe44f99);}return _0xc2e2cb['save']();};}function saveUpdates(_0xfcdc82,_0x5b87ef){return function(_0x2ce1bf){if(_0x2ce1bf){return _0x2ce1bf[_0x762b('0x21')](_0xfcdc82)[_0x762b('0x22')](function(_0x4fc0ab){return _0x4fc0ab;});}return null;};}function removeEntity(_0x3de0c3,_0x475edf){return function(_0x203c14){if(_0x203c14){return _0x203c14[_0x762b('0x23')]()[_0x762b('0x22')](function(){_0x3de0c3[_0x762b('0x18')](0xcc)[_0x762b('0x19')]();});}};}function handleEntityNotFound(_0x1cf8c1,_0x38c573){return function(_0x58b962){if(!_0x58b962){_0x1cf8c1[_0x762b('0x24')](0x194);}return _0x58b962;};}function handleError(_0x1a6a04,_0x361448){_0x361448=_0x361448||0x1f4;return function(_0x3712b5){logger[_0x762b('0x25')](_0x3712b5[_0x762b('0x26')]);if(_0x3712b5[_0x762b('0x27')]){delete _0x3712b5[_0x762b('0x27')];}_0x1a6a04[_0x762b('0x18')](_0x361448)[_0x762b('0x28')](_0x3712b5);};}exports[_0x762b('0x29')]=function(_0x18bb4c,_0x1faca6){var _0x55637f={},_0x19f3eb={},_0x5d85e1={'count':0x0,'rows':[]};var _0x519a2b=_[_0x762b('0x2a')](db[_0x762b('0x2b')]['rawAttributes'],function(_0xa74e81){return{'name':_0xa74e81[_0x762b('0x2c')],'type':_0xa74e81[_0x762b('0x2d')]['key']};});_0x19f3eb['model']=_[_0x762b('0x2a')](_0x519a2b,_0x762b('0x27'));_0x19f3eb[_0x762b('0x2e')]=_[_0x762b('0x2f')](_0x18bb4c[_0x762b('0x2e')]);_0x19f3eb[_0x762b('0x30')]=_[_0x762b('0x31')](_0x19f3eb[_0x762b('0x32')],_0x19f3eb[_0x762b('0x2e')]);_0x55637f[_0x762b('0x33')]=_[_0x762b('0x31')](_0x19f3eb[_0x762b('0x32')],qs[_0x762b('0x34')](_0x18bb4c['query']['fields']));_0x55637f[_0x762b('0x33')]=_0x55637f[_0x762b('0x33')]['length']?_0x55637f['attributes']:_0x19f3eb[_0x762b('0x32')];if(!_0x18bb4c[_0x762b('0x2e')]['hasOwnProperty'](_0x762b('0x35'))){_0x55637f[_0x762b('0x1d')]=qs[_0x762b('0x1d')](_0x18bb4c[_0x762b('0x2e')][_0x762b('0x1d')]);_0x55637f['offset']=qs[_0x762b('0x1c')](_0x18bb4c['query'][_0x762b('0x1c')]);}_0x55637f[_0x762b('0x36')]=qs[_0x762b('0x37')](_0x18bb4c[_0x762b('0x2e')][_0x762b('0x37')]);_0x55637f[_0x762b('0x38')]=qs[_0x762b('0x30')](_['pick'](_0x18bb4c['query'],_0x19f3eb[_0x762b('0x30')]),_0x519a2b);if(_0x18bb4c['query']['filter']){_0x55637f[_0x762b('0x38')]=_[_0x762b('0x39')](_0x55637f['where'],{'$or':_[_0x762b('0x2a')](_0x519a2b,function(_0x55e619){if(_0x55e619[_0x762b('0x2d')]!=='VIRTUAL'){var _0x3bc142={};_0x3bc142[_0x55e619[_0x762b('0x27')]]={'$like':'%'+_0x18bb4c[_0x762b('0x2e')][_0x762b('0x3a')]+'%'};return _0x3bc142;}})});}_0x55637f=_[_0x762b('0x39')]({},_0x55637f,_0x18bb4c['options']);var _0x1cf4e2={'where':_0x55637f[_0x762b('0x38')]};return db[_0x762b('0x2b')][_0x762b('0x1b')](_0x1cf4e2)[_0x762b('0x22')](function(_0x2233a0){_0x5d85e1[_0x762b('0x1b')]=_0x2233a0;if(_0x18bb4c[_0x762b('0x2e')][_0x762b('0x3b')]){_0x55637f[_0x762b('0x3c')]=[{'all':!![]}];}return db[_0x762b('0x2b')][_0x762b('0x3d')](_0x55637f);})[_0x762b('0x22')](function(_0x4e7662){_0x5d85e1[_0x762b('0x3e')]=_0x4e7662;return _0x5d85e1;})[_0x762b('0x22')](respondWithFilteredResult(_0x1faca6,_0x55637f))[_0x762b('0x3f')](handleError(_0x1faca6,null));};exports[_0x762b('0x40')]=function(_0x3fd119,_0x3c5a8f){var _0x53ce58={'raw':!![],'where':{'id':_0x3fd119[_0x762b('0x41')]['id']}},_0x25b9d3={};_0x25b9d3[_0x762b('0x32')]=_[_0x762b('0x2f')](db[_0x762b('0x2b')]['rawAttributes']);_0x25b9d3[_0x762b('0x2e')]=_[_0x762b('0x2f')](_0x3fd119['query']);_0x25b9d3[_0x762b('0x30')]=_[_0x762b('0x31')](_0x25b9d3[_0x762b('0x32')],_0x25b9d3[_0x762b('0x2e')]);_0x53ce58[_0x762b('0x33')]=_[_0x762b('0x31')](_0x25b9d3[_0x762b('0x32')],qs['fields'](_0x3fd119[_0x762b('0x2e')][_0x762b('0x34')]));_0x53ce58['attributes']=_0x53ce58[_0x762b('0x33')][_0x762b('0x42')]?_0x53ce58[_0x762b('0x33')]:_0x25b9d3[_0x762b('0x32')];if(_0x3fd119['query'][_0x762b('0x3b')]){_0x53ce58['include']=[{'all':!![]}];}_0x53ce58=_[_0x762b('0x39')]({},_0x53ce58,_0x3fd119[_0x762b('0x43')]);return db[_0x762b('0x2b')][_0x762b('0x44')](_0x53ce58)['then'](handleEntityNotFound(_0x3c5a8f,null))['then'](respondWithResult(_0x3c5a8f,null))[_0x762b('0x3f')](handleError(_0x3c5a8f,null));};exports['create']=function(_0x4e0278,_0x4ec0c9){return db['ZendeskField'][_0x762b('0x45')](_0x4e0278['body'],{})[_0x762b('0x22')](respondWithResult(_0x4ec0c9,0xc9))[_0x762b('0x3f')](handleError(_0x4ec0c9,null));};exports[_0x762b('0x21')]=function(_0x1b9e1e,_0x180852){if(_0x1b9e1e[_0x762b('0x46')]['id']){delete _0x1b9e1e[_0x762b('0x46')]['id'];}return db[_0x762b('0x2b')][_0x762b('0x44')]({'where':{'id':_0x1b9e1e[_0x762b('0x41')]['id']}})[_0x762b('0x22')](handleEntityNotFound(_0x180852,null))[_0x762b('0x22')](saveUpdates(_0x1b9e1e[_0x762b('0x46')],null))[_0x762b('0x22')](respondWithResult(_0x180852,null))[_0x762b('0x3f')](handleError(_0x180852,null));};exports['destroy']=function(_0x4fde4b,_0x5cd2b3){return db[_0x762b('0x2b')][_0x762b('0x44')]({'where':{'id':_0x4fde4b['params']['id']}})[_0x762b('0x22')](handleEntityNotFound(_0x5cd2b3,null))[_0x762b('0x22')](removeEntity(_0x5cd2b3,null))['catch'](handleError(_0x5cd2b3,null));};
\ No newline at end of file
+var _0x44d7=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','error','stack','name','send','index','ZendeskField','fieldName','type','model','map','keys','query','filters','intersection'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x44d7,0x136));var _0x744d=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x44d7[_0x2b7764];return _0x848dcb;};'use strict';var pdf=require(_0x744d('0x0'));var emlformat=require(_0x744d('0x1'));var rimraf=require(_0x744d('0x2'));var zipdir=require(_0x744d('0x3'));var jsonpatch=require(_0x744d('0x4'));var rp=require(_0x744d('0x5'));var moment=require(_0x744d('0x6'));var BPromise=require(_0x744d('0x7'));var Mustache=require(_0x744d('0x8'));var util=require('util');var path=require(_0x744d('0x9'));var sox=require(_0x744d('0xa'));var csv=require(_0x744d('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x744d('0xc'));var squel=require(_0x744d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x744d('0xb'));var querystring=require(_0x744d('0xe'));var Papa=require(_0x744d('0xf'));var Redis=require(_0x744d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x744d('0x11'));var as=require(_0x744d('0x12'));var hardwareService=require(_0x744d('0x13'));var logger=require('../../config/logger')(_0x744d('0x14'));var utils=require(_0x744d('0x15'));var config=require(_0x744d('0x16'));var db=require(_0x744d('0x17'))['db'];function respondWithStatusCode(_0x2eef7c,_0x3cd0b0){_0x3cd0b0=_0x3cd0b0||0xcc;return function(_0x5f3fa3){if(_0x5f3fa3){return _0x2eef7c[_0x744d('0x18')](_0x3cd0b0);}return _0x2eef7c[_0x744d('0x19')](_0x3cd0b0)[_0x744d('0x1a')]();};}function respondWithResult(_0x5ff3c9,_0x43ae4a){_0x43ae4a=_0x43ae4a||0xc8;return function(_0x594415){if(_0x594415){return _0x5ff3c9['status'](_0x43ae4a)[_0x744d('0x1b')](_0x594415);}};}function respondWithFilteredResult(_0x16f788,_0x46544b){return function(_0x30c228){if(_0x30c228){var _0x2bd52c=_0x30c228[_0x744d('0x1c')],_0x21ef84=_0x46544b[_0x744d('0x1d')],_0x30b071=_0x46544b[_0x744d('0x1d')]+_0x46544b[_0x744d('0x1e')],_0x28c6b5;if(_0x30b071>=_0x2bd52c){_0x30b071=_0x2bd52c;_0x28c6b5=0xc8;}else{_0x28c6b5=0xce;}_0x16f788[_0x744d('0x19')](_0x28c6b5);return _0x16f788[_0x744d('0x1f')]('Content-Range',_0x21ef84+'-'+_0x30b071+'/'+_0x2bd52c)[_0x744d('0x1b')](_0x30c228);}return null;};}function patchUpdates(_0x376531){return function(_0x5a3e3c){try{jsonpatch[_0x744d('0x20')](_0x5a3e3c,_0x376531,!![]);}catch(_0x39ba7d){return BPromise[_0x744d('0x21')](_0x39ba7d);}return _0x5a3e3c['save']();};}function saveUpdates(_0xf20936,_0x48b681){return function(_0x2dbf3b){if(_0x2dbf3b){return _0x2dbf3b[_0x744d('0x22')](_0xf20936)[_0x744d('0x23')](function(_0x99452f){return _0x99452f;});}return null;};}function removeEntity(_0x331f73,_0x3973ea){return function(_0x4048c2){if(_0x4048c2){return _0x4048c2['destroy']()[_0x744d('0x23')](function(){_0x331f73['status'](0xcc)[_0x744d('0x1a')]();});}};}function handleEntityNotFound(_0x51b6f4,_0x507cf3){return function(_0x2bc88d){if(!_0x2bc88d){_0x51b6f4[_0x744d('0x18')](0x194);}return _0x2bc88d;};}function handleError(_0x1580e4,_0x5a54c1){_0x5a54c1=_0x5a54c1||0x1f4;return function(_0x23e7c2){logger[_0x744d('0x24')](_0x23e7c2[_0x744d('0x25')]);if(_0x23e7c2[_0x744d('0x26')]){delete _0x23e7c2[_0x744d('0x26')];}_0x1580e4['status'](_0x5a54c1)[_0x744d('0x27')](_0x23e7c2);};}exports[_0x744d('0x28')]=function(_0x160716,_0x360822){var _0x1a2b63={},_0x15094c={},_0x915511={'count':0x0,'rows':[]};var _0x3ab0e5=_['map'](db[_0x744d('0x29')]['rawAttributes'],function(_0x2e10ee){return{'name':_0x2e10ee[_0x744d('0x2a')],'type':_0x2e10ee[_0x744d('0x2b')]['key']};});_0x15094c[_0x744d('0x2c')]=_[_0x744d('0x2d')](_0x3ab0e5,_0x744d('0x26'));_0x15094c['query']=_[_0x744d('0x2e')](_0x160716[_0x744d('0x2f')]);_0x15094c[_0x744d('0x30')]=_[_0x744d('0x31')](_0x15094c[_0x744d('0x2c')],_0x15094c[_0x744d('0x2f')]);_0x1a2b63[_0x744d('0x32')]=_[_0x744d('0x31')](_0x15094c[_0x744d('0x2c')],qs[_0x744d('0x33')](_0x160716['query'][_0x744d('0x33')]));_0x1a2b63[_0x744d('0x32')]=_0x1a2b63[_0x744d('0x32')][_0x744d('0x34')]?_0x1a2b63[_0x744d('0x32')]:_0x15094c[_0x744d('0x2c')];if(!_0x160716[_0x744d('0x2f')][_0x744d('0x35')](_0x744d('0x36'))){_0x1a2b63[_0x744d('0x1e')]=qs[_0x744d('0x1e')](_0x160716[_0x744d('0x2f')]['limit']);_0x1a2b63[_0x744d('0x1d')]=qs[_0x744d('0x1d')](_0x160716[_0x744d('0x2f')]['offset']);}_0x1a2b63[_0x744d('0x37')]=qs[_0x744d('0x38')](_0x160716[_0x744d('0x2f')][_0x744d('0x38')]);_0x1a2b63[_0x744d('0x39')]=qs[_0x744d('0x30')](_[_0x744d('0x3a')](_0x160716[_0x744d('0x2f')],_0x15094c[_0x744d('0x30')]),_0x3ab0e5);if(_0x160716[_0x744d('0x2f')][_0x744d('0x3b')]){_0x1a2b63['where']=_['merge'](_0x1a2b63[_0x744d('0x39')],{'$or':_['map'](_0x3ab0e5,function(_0x2df804){if(_0x2df804[_0x744d('0x2b')]!=='VIRTUAL'){var _0x52b0b0={};_0x52b0b0[_0x2df804[_0x744d('0x26')]]={'$like':'%'+_0x160716[_0x744d('0x2f')][_0x744d('0x3b')]+'%'};return _0x52b0b0;}})});}_0x1a2b63=_[_0x744d('0x3c')]({},_0x1a2b63,_0x160716[_0x744d('0x3d')]);var _0x239d07={'where':_0x1a2b63[_0x744d('0x39')]};return db[_0x744d('0x29')][_0x744d('0x1c')](_0x239d07)[_0x744d('0x23')](function(_0x271865){_0x915511[_0x744d('0x1c')]=_0x271865;if(_0x160716[_0x744d('0x2f')][_0x744d('0x3e')]){_0x1a2b63[_0x744d('0x3f')]=[{'all':!![]}];}return db[_0x744d('0x29')][_0x744d('0x40')](_0x1a2b63);})['then'](function(_0x3c6603){_0x915511[_0x744d('0x41')]=_0x3c6603;return _0x915511;})['then'](respondWithFilteredResult(_0x360822,_0x1a2b63))[_0x744d('0x42')](handleError(_0x360822,null));};exports['show']=function(_0x44c947,_0x120945){var _0x36b377={'raw':!![],'where':{'id':_0x44c947[_0x744d('0x43')]['id']}},_0x32f608={};_0x32f608[_0x744d('0x2c')]=_[_0x744d('0x2e')](db[_0x744d('0x29')]['rawAttributes']);_0x32f608[_0x744d('0x2f')]=_['keys'](_0x44c947[_0x744d('0x2f')]);_0x32f608[_0x744d('0x30')]=_[_0x744d('0x31')](_0x32f608[_0x744d('0x2c')],_0x32f608[_0x744d('0x2f')]);_0x36b377['attributes']=_[_0x744d('0x31')](_0x32f608[_0x744d('0x2c')],qs['fields'](_0x44c947[_0x744d('0x2f')][_0x744d('0x33')]));_0x36b377[_0x744d('0x32')]=_0x36b377[_0x744d('0x32')]['length']?_0x36b377['attributes']:_0x32f608[_0x744d('0x2c')];if(_0x44c947['query']['includeAll']){_0x36b377[_0x744d('0x3f')]=[{'all':!![]}];}_0x36b377=_['merge']({},_0x36b377,_0x44c947['options']);return db[_0x744d('0x29')][_0x744d('0x44')](_0x36b377)[_0x744d('0x23')](handleEntityNotFound(_0x120945,null))[_0x744d('0x23')](respondWithResult(_0x120945,null))[_0x744d('0x42')](handleError(_0x120945,null));};exports[_0x744d('0x45')]=function(_0x26ff77,_0x21d8c1){return db['ZendeskField'][_0x744d('0x45')](_0x26ff77[_0x744d('0x46')],{})[_0x744d('0x23')](respondWithResult(_0x21d8c1,0xc9))['catch'](handleError(_0x21d8c1,null));};exports[_0x744d('0x22')]=function(_0x3032f2,_0x1e7c45){if(_0x3032f2[_0x744d('0x46')]['id']){delete _0x3032f2[_0x744d('0x46')]['id'];}return db[_0x744d('0x29')][_0x744d('0x44')]({'where':{'id':_0x3032f2[_0x744d('0x43')]['id']}})[_0x744d('0x23')](handleEntityNotFound(_0x1e7c45,null))[_0x744d('0x23')](saveUpdates(_0x3032f2[_0x744d('0x46')],null))[_0x744d('0x23')](respondWithResult(_0x1e7c45,null))[_0x744d('0x42')](handleError(_0x1e7c45,null));};exports[_0x744d('0x47')]=function(_0x4cfef0,_0x497246){return db['ZendeskField']['find']({'where':{'id':_0x4cfef0[_0x744d('0x43')]['id']}})[_0x744d('0x23')](handleEntityNotFound(_0x497246,null))['then'](removeEntity(_0x497246,null))[_0x744d('0x42')](handleError(_0x497246,null));};
\ No newline at end of file
index 6cfa2b3..0c7b10c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9861=['api','moment','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash'];(function(_0x10d34a,_0x56a5a3){var _0x512ba7=function(_0x534170){while(--_0x534170){_0x10d34a['push'](_0x10d34a['shift']());}};_0x512ba7(++_0x56a5a3);}(_0x9861,0x176));var _0x1986=function(_0x1100e4,_0x1545b6){_0x1100e4=_0x1100e4-0x0;var _0x380665=_0x9861[_0x1100e4];return _0x380665;};'use strict';var _=require(_0x1986('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1986('0x1'));var moment=require(_0x1986('0x2'));var BPromise=require(_0x1986('0x3'));var rp=require(_0x1986('0x4'));var fs=require('fs');var path=require(_0x1986('0x5'));var rimraf=require(_0x1986('0x6'));var config=require('../../config/environment');var attributes=require(_0x1986('0x7'));module[_0x1986('0x8')]=function(_0x1b56d6,_0x17ccbf){return _0x1b56d6[_0x1986('0x9')](_0x1986('0xa'),attributes,{'tableName':_0x1986('0xb'),'paranoid':![],'indexes':[{'name':_0x1986('0xc'),'fields':[_0x1986('0xd'),_0x1986('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb574=['api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','idField','FieldId','lodash','util'];(function(_0x4cba29,_0x1f219f){var _0x5645ef=function(_0x3f968b){while(--_0x3f968b){_0x4cba29['push'](_0x4cba29['shift']());}};_0x5645ef(++_0x1f219f);}(_0xb574,0x106));var _0x4b57=function(_0x148b7d,_0x8de94c){_0x148b7d=_0x148b7d-0x0;var _0xc59cbb=_0xb574[_0x148b7d];return _0xc59cbb;};'use strict';var _=require(_0x4b57('0x0'));var util=require(_0x4b57('0x1'));var logger=require('../../config/logger')(_0x4b57('0x2'));var moment=require(_0x4b57('0x3'));var BPromise=require('bluebird');var rp=require(_0x4b57('0x4'));var fs=require('fs');var path=require(_0x4b57('0x5'));var rimraf=require(_0x4b57('0x6'));var config=require(_0x4b57('0x7'));var attributes=require(_0x4b57('0x8'));module['exports']=function(_0x4eb019,_0x1c97e5){return _0x4eb019['define']('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x4b57('0x9'),_0x4b57('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 1382628..902f19e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac5b=['http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xac5b,0xf4));var _0xbac5=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0xac5b[_0x4b91c4];return _0x25cb80;};'use strict';var _=require('lodash');var util=require(_0xbac5('0x0'));var moment=require('moment');var BPromise=require(_0xbac5('0x1'));var rs=require(_0xbac5('0x2'));var fs=require('fs');var Redis=require(_0xbac5('0x3'));var db=require(_0xbac5('0x4'))['db'];var utils=require(_0xbac5('0x5'));var logger=require(_0xbac5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbac5('0x7'));var client=jayson['client'][_0xbac5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16720d,_0x32c9d2,_0x2bdd96){return new BPromise(function(_0x49062a,_0x8227e8){return client[_0xbac5('0x9')](_0x16720d,_0x2bdd96)[_0xbac5('0xa')](function(_0x4b378b){logger[_0xbac5('0xb')](_0xbac5('0xc'),_0x32c9d2,'request\x20sent');logger[_0xbac5('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x32c9d2,_0xbac5('0xe'),JSON[_0xbac5('0xf')](_0x4b378b));if(_0x4b378b[_0xbac5('0x10')]){if(_0x4b378b['error'][_0xbac5('0x11')]===0x1f4){logger[_0xbac5('0x10')](_0xbac5('0xc'),_0x32c9d2,_0x4b378b['error']['message']);return _0x8227e8(_0x4b378b[_0xbac5('0x10')][_0xbac5('0x12')]);}logger[_0xbac5('0x10')]('ZendeskField,\x20%s,\x20%s',_0x32c9d2,_0x4b378b[_0xbac5('0x10')]['message']);return _0x49062a(_0x4b378b[_0xbac5('0x10')]['message']);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x32c9d2,_0xbac5('0xe'));_0x49062a(_0x4b378b[_0xbac5('0x13')][_0xbac5('0x12')]);}})[_0xbac5('0x14')](function(_0x599211){logger['error']('ZendeskField,\x20%s,\x20%s',_0x32c9d2,_0x599211);_0x8227e8(_0x599211);});});}
\ No newline at end of file
+var _0x9513=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x21244f,_0x3c24e3){var _0x1fad66=function(_0x264d8e){while(--_0x264d8e){_0x21244f['push'](_0x21244f['shift']());}};_0x1fad66(++_0x3c24e3);}(_0x9513,0x121));var _0x3951=function(_0x2df51f,_0x1de62f){_0x2df51f=_0x2df51f-0x0;var _0x38142e=_0x9513[_0x2df51f];return _0x38142e;};'use strict';var _=require(_0x3951('0x0'));var util=require(_0x3951('0x1'));var moment=require('moment');var BPromise=require(_0x3951('0x2'));var rs=require(_0x3951('0x3'));var fs=require('fs');var Redis=require(_0x3951('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3951('0x5'))(_0x3951('0x6'));var config=require(_0x3951('0x7'));var jayson=require(_0x3951('0x8'));var client=jayson[_0x3951('0x9')][_0x3951('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4672e2,_0x21e606,_0x331f05){return new BPromise(function(_0x4d0c4c,_0x333648){return client[_0x3951('0xb')](_0x4672e2,_0x331f05)[_0x3951('0xc')](function(_0x24e8c5){logger[_0x3951('0xd')](_0x3951('0xe'),_0x21e606,_0x3951('0xf'));logger[_0x3951('0x10')](_0x3951('0x11'),_0x21e606,'request\x20sent',JSON[_0x3951('0x12')](_0x24e8c5));if(_0x24e8c5[_0x3951('0x13')]){if(_0x24e8c5[_0x3951('0x13')][_0x3951('0x14')]===0x1f4){logger[_0x3951('0x13')](_0x3951('0xe'),_0x21e606,_0x24e8c5['error'][_0x3951('0x15')]);return _0x333648(_0x24e8c5[_0x3951('0x13')][_0x3951('0x15')]);}logger['error'](_0x3951('0xe'),_0x21e606,_0x24e8c5[_0x3951('0x13')][_0x3951('0x15')]);return _0x4d0c4c(_0x24e8c5[_0x3951('0x13')][_0x3951('0x15')]);}else{logger[_0x3951('0xd')]('ZendeskField,\x20%s,\x20%s',_0x21e606,'request\x20sent');_0x4d0c4c(_0x24e8c5[_0x3951('0x16')][_0x3951('0x15')]);}})[_0x3951('0x17')](function(_0x208f6c){logger[_0x3951('0x13')](_0x3951('0xe'),_0x21e606,_0x208f6c);_0x333648(_0x208f6c);});});}
\ No newline at end of file
index f0fe845..cd1bebd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c53=['/:id/configurations','addConfiguration','put','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','/:id','isAuthenticated','show','get','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x5bc9c9,_0x12a67c){var _0x44a280=function(_0x177949){while(--_0x177949){_0x5bc9c9['push'](_0x5bc9c9['shift']());}};_0x44a280(++_0x12a67c);}(_0x0c53,0x1ba));var _0x30c5=function(_0x106f2f,_0x483553){_0x106f2f=_0x106f2f-0x0;var _0x4fe056=_0x0c53[_0x106f2f];return _0x4fe056;};'use strict';var multer=require('multer');var util=require(_0x30c5('0x0'));var path=require(_0x30c5('0x1'));var timeout=require(_0x30c5('0x2'));var express=require(_0x30c5('0x3'));var router=express[_0x30c5('0x4')]();var auth=require(_0x30c5('0x5'));var interaction=require(_0x30c5('0x6'));var config=require(_0x30c5('0x7'));var controller=require(_0x30c5('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x30c5('0x9'),auth[_0x30c5('0xa')](),controller[_0x30c5('0xb')]);router[_0x30c5('0xc')]('/:id/configurations',auth[_0x30c5('0xa')](),controller[_0x30c5('0xd')]);router[_0x30c5('0xc')](_0x30c5('0xe'),auth[_0x30c5('0xa')](),controller[_0x30c5('0xf')]);router[_0x30c5('0x10')]('/',auth[_0x30c5('0xa')](),controller[_0x30c5('0x11')]);router[_0x30c5('0x10')](_0x30c5('0x12'),auth[_0x30c5('0xa')](),controller[_0x30c5('0x13')]);router[_0x30c5('0x14')](_0x30c5('0x9'),auth[_0x30c5('0xa')](),controller['update']);router[_0x30c5('0x15')](_0x30c5('0x9'),auth[_0x30c5('0xa')](),controller['destroy']);module[_0x30c5('0x16')]=router;
\ No newline at end of file
+var _0xb30e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x3572cb,_0x4149d3){var _0x33a398=function(_0x163e27){while(--_0x163e27){_0x3572cb['push'](_0x3572cb['shift']());}};_0x33a398(++_0x4149d3);}(_0xb30e,0xb9));var _0xeb30=function(_0x1bd230,_0x1da01e){_0x1bd230=_0x1bd230-0x0;var _0x19a3e3=_0xb30e[_0x1bd230];return _0x19a3e3;};'use strict';var multer=require(_0xeb30('0x0'));var util=require(_0xeb30('0x1'));var path=require(_0xeb30('0x2'));var timeout=require(_0xeb30('0x3'));var express=require(_0xeb30('0x4'));var router=express[_0xeb30('0x5')]();var auth=require(_0xeb30('0x6'));var interaction=require(_0xeb30('0x7'));var config=require(_0xeb30('0x8'));var controller=require(_0xeb30('0x9'));router[_0xeb30('0xa')]('/',auth[_0xeb30('0xb')](),controller['index']);router['get']('/:id',auth[_0xeb30('0xb')](),controller['show']);router['get'](_0xeb30('0xc'),auth[_0xeb30('0xb')](),controller[_0xeb30('0xd')]);router[_0xeb30('0xa')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xeb30('0xe')]('/',auth[_0xeb30('0xb')](),controller[_0xeb30('0xf')]);router[_0xeb30('0xe')](_0xeb30('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xeb30('0x10')](_0xeb30('0x11'),auth[_0xeb30('0xb')](),controller[_0xeb30('0x12')]);router[_0xeb30('0x13')](_0xeb30('0x11'),auth[_0xeb30('0xb')](),controller['destroy']);module[_0xeb30('0x14')]=router;
\ No newline at end of file
index 4bb2b3f..067f1ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa818=['STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa818,0xd6));var _0x8a81=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xa818[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require(_0x8a81('0x0'));module[_0x8a81('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8a81('0x2')]},'host':{'type':Sequelize[_0x8a81('0x2')]},'zone':{'type':Sequelize[_0x8a81('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8a81('0x2')]},'serverUrl':{'type':Sequelize[_0x8a81('0x2')]},'code':{'type':Sequelize[_0x8a81('0x2')]},'refreshToken':{'type':Sequelize[_0x8a81('0x2')]}};
\ No newline at end of file
+var _0xeecf=['STRING','exports'];(function(_0x5998d0,_0x24ad81){var _0x47149d=function(_0x5e4d63){while(--_0x5e4d63){_0x5998d0['push'](_0x5998d0['shift']());}};_0x47149d(++_0x24ad81);}(_0xeecf,0xaf));var _0xfeec=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xeecf[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0xfeec('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xfeec('0x1')]},'zone':{'type':Sequelize[_0xfeec('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xfeec('0x1')]},'code':{'type':Sequelize[_0xfeec('0x1')]},'refreshToken':{'type':Sequelize[_0xfeec('0x1')]}};
\ No newline at end of file
index 72fc7de..15232ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c3d=['Description','WhoId','Call_Result','Call_Start_Time','api_name','push','display_label','data_type','picklist','pick_list_values','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','count','limit','set','Content-Range','reject','save','update','destroy','end','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','offset','order','sort','pick','filter','merge','where','includeAll','include','findAll','rows','show','params','options','find','create','body','getConfigurations','findOne','ZohoConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject'];(function(_0x283013,_0x31a15a){var _0x28310f=function(_0x119190){while(--_0x119190){_0x283013['push'](_0x283013['shift']());}};_0x28310f(++_0x31a15a);}(_0x1c3d,0x116));var _0xd1c3=function(_0x4d9076,_0x3a9c44){_0x4d9076=_0x4d9076-0x0;var _0x127f8d=_0x1c3d[_0x4d9076];return _0x127f8d;};'use strict';var pdf=require(_0xd1c3('0x0'));var emlformat=require(_0xd1c3('0x1'));var rimraf=require(_0xd1c3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd1c3('0x3'));var rp=require(_0xd1c3('0x4'));var moment=require(_0xd1c3('0x5'));var BPromise=require(_0xd1c3('0x6'));var Mustache=require('mustache');var util=require(_0xd1c3('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd1c3('0x8'));var ejs=require(_0xd1c3('0x9'));var fs=require('fs');var _=require(_0xd1c3('0xa'));var squel=require(_0xd1c3('0xb'));var crypto=require(_0xd1c3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd1c3('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd1c3('0xe'));var Papa=require(_0xd1c3('0xf'));var Redis=require('ioredis');var authService=require(_0xd1c3('0x10'));var qs=require(_0xd1c3('0x11'));var as=require(_0xd1c3('0x12'));var hardwareService=require(_0xd1c3('0x13'));var logger=require(_0xd1c3('0x14'))(_0xd1c3('0x15'));var utils=require(_0xd1c3('0x16'));var config=require(_0xd1c3('0x17'));var db=require(_0xd1c3('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xd1c3('0x19')][_0xd1c3('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x370853,_0x950f18,_0x424d44){if(_0x424d44){var _0x5b3613=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b3613[_0xd1c3('0x1b')](_0x950f18)){return _0x370853;}else{throw new db[(_0xd1c3('0x1c'))][(_0xd1c3('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x370853;}}function respondWithRpcPromise(_0x51ee72,_0x157a2b,_0x43f346,_0x145c5a){return new BPromise(function(_0x68a96,_0x49dd3f){var _0xb9af47=_0x145c5a||client;return _0xb9af47['request'](_0x51ee72,_0x43f346)[_0xd1c3('0x1e')](function(_0x139ee7){logger[_0xd1c3('0x1f')](_0xd1c3('0x20'),_0x157a2b,_0xd1c3('0x21'));logger[_0xd1c3('0x22')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x157a2b,_0xd1c3('0x21'),JSON[_0xd1c3('0x23')](_0x139ee7));if(_0x139ee7[_0xd1c3('0x24')]){if(_0x139ee7['error'][_0xd1c3('0x25')]===0x1f4){logger[_0xd1c3('0x24')](_0xd1c3('0x20'),_0x157a2b,_0x139ee7[_0xd1c3('0x24')]['message']);return _0x49dd3f(_0x139ee7['error'][_0xd1c3('0x26')]);}logger[_0xd1c3('0x24')](_0xd1c3('0x20'),_0x157a2b,_0x139ee7['error'][_0xd1c3('0x26')]);return _0x68a96(_0x139ee7[_0xd1c3('0x24')][_0xd1c3('0x26')]);}else{logger['info'](_0xd1c3('0x20'),_0x157a2b,_0xd1c3('0x21'));_0x68a96(_0x139ee7[_0xd1c3('0x27')][_0xd1c3('0x26')]);}})[_0xd1c3('0x28')](function(_0xb6eb78){logger[_0xd1c3('0x24')](_0xd1c3('0x20'),_0x157a2b,_0xb6eb78);_0x49dd3f(_0xb6eb78);});});}function respondWithStatusCode(_0x147cde,_0x56180f){_0x56180f=_0x56180f||0xcc;return function(_0x1bf740){if(_0x1bf740){return _0x147cde['sendStatus'](_0x56180f);}return _0x147cde[_0xd1c3('0x29')](_0x56180f)['end']();};}function respondWithResult(_0x12d0d8,_0x31e960){_0x31e960=_0x31e960||0xc8;return function(_0x298b97){if(_0x298b97){return _0x12d0d8[_0xd1c3('0x29')](_0x31e960)[_0xd1c3('0x2a')](_0x298b97);}};}function respondWithFilteredResult(_0xf7bc3b,_0x2dba04){return function(_0x7d8edb){if(_0x7d8edb){var _0x661df6=_0x7d8edb[_0xd1c3('0x2b')],_0x2b5997=_0x2dba04['offset'],_0x5b9075=_0x2dba04['offset']+_0x2dba04[_0xd1c3('0x2c')],_0x743dfd;if(_0x5b9075>=_0x661df6){_0x5b9075=_0x661df6;_0x743dfd=0xc8;}else{_0x743dfd=0xce;}_0xf7bc3b[_0xd1c3('0x29')](_0x743dfd);return _0xf7bc3b[_0xd1c3('0x2d')](_0xd1c3('0x2e'),_0x2b5997+'-'+_0x5b9075+'/'+_0x661df6)[_0xd1c3('0x2a')](_0x7d8edb);}return null;};}function patchUpdates(_0x47ae92){return function(_0x6d934b){try{jsonpatch['apply'](_0x6d934b,_0x47ae92,!![]);}catch(_0x8d7be9){return BPromise[_0xd1c3('0x2f')](_0x8d7be9);}return _0x6d934b[_0xd1c3('0x30')]();};}function saveUpdates(_0x6ad0f6,_0x557701){return function(_0x2fca8a){if(_0x2fca8a){return _0x2fca8a[_0xd1c3('0x31')](_0x6ad0f6)[_0xd1c3('0x1e')](function(_0x615389){return _0x615389;});}return null;};}function removeEntity(_0x4c7c4f,_0x5bf2af){return function(_0x4f0f3b){if(_0x4f0f3b){return _0x4f0f3b[_0xd1c3('0x32')]()['then'](function(){_0x4c7c4f[_0xd1c3('0x29')](0xcc)[_0xd1c3('0x33')]();});}};}function handleEntityNotFound(_0x194498,_0x436acc){return function(_0x4805f1){if(!_0x4805f1){_0x194498['sendStatus'](0x194);}return _0x4805f1;};}function handleError(_0x3c7c4f,_0x4bc732){_0x4bc732=_0x4bc732||0x1f4;return function(_0x2d73be){logger['error'](_0x2d73be['stack']);if(_0x2d73be[_0xd1c3('0x34')]){delete _0x2d73be[_0xd1c3('0x34')];}_0x3c7c4f[_0xd1c3('0x29')](_0x4bc732)[_0xd1c3('0x35')](_0x2d73be);};}exports['index']=function(_0x9c022d,_0xac00c){var _0x44c8b2={},_0x3fb240={},_0x1d5f00={'count':0x0,'rows':[]};var _0x47ad63=_[_0xd1c3('0x36')](db[_0xd1c3('0x37')][_0xd1c3('0x38')],function(_0x124d90){return{'name':_0x124d90[_0xd1c3('0x39')],'type':_0x124d90[_0xd1c3('0x3a')][_0xd1c3('0x3b')]};});_0x3fb240['model']=_[_0xd1c3('0x36')](_0x47ad63,_0xd1c3('0x34'));_0x3fb240[_0xd1c3('0x3c')]=_[_0xd1c3('0x3d')](_0x9c022d[_0xd1c3('0x3c')]);_0x3fb240[_0xd1c3('0x3e')]=_[_0xd1c3('0x3f')](_0x3fb240[_0xd1c3('0x40')],_0x3fb240['query']);_0x44c8b2[_0xd1c3('0x41')]=_[_0xd1c3('0x3f')](_0x3fb240[_0xd1c3('0x40')],qs[_0xd1c3('0x42')](_0x9c022d[_0xd1c3('0x3c')]['fields']));_0x44c8b2[_0xd1c3('0x41')]=_0x44c8b2[_0xd1c3('0x41')][_0xd1c3('0x43')]?_0x44c8b2[_0xd1c3('0x41')]:_0x3fb240[_0xd1c3('0x40')];if(!_0x9c022d[_0xd1c3('0x3c')][_0xd1c3('0x44')]('nolimit')){_0x44c8b2['limit']=qs[_0xd1c3('0x2c')](_0x9c022d[_0xd1c3('0x3c')][_0xd1c3('0x2c')]);_0x44c8b2[_0xd1c3('0x45')]=qs['offset'](_0x9c022d['query'][_0xd1c3('0x45')]);}_0x44c8b2[_0xd1c3('0x46')]=qs['sort'](_0x9c022d[_0xd1c3('0x3c')][_0xd1c3('0x47')]);_0x44c8b2['where']=qs[_0xd1c3('0x3e')](_[_0xd1c3('0x48')](_0x9c022d[_0xd1c3('0x3c')],_0x3fb240['filters']),_0x47ad63);if(_0x9c022d[_0xd1c3('0x3c')][_0xd1c3('0x49')]){_0x44c8b2['where']=_[_0xd1c3('0x4a')](_0x44c8b2[_0xd1c3('0x4b')],{'$or':_[_0xd1c3('0x36')](_0x47ad63,function(_0x32d758){if(_0x32d758[_0xd1c3('0x3a')]!=='VIRTUAL'){var _0x1168fa={};_0x1168fa[_0x32d758[_0xd1c3('0x34')]]={'$like':'%'+_0x9c022d['query'][_0xd1c3('0x49')]+'%'};return _0x1168fa;}})});}_0x44c8b2=_[_0xd1c3('0x4a')]({},_0x44c8b2,_0x9c022d['options']);var _0x34425d={'where':_0x44c8b2['where']};return db[_0xd1c3('0x37')]['count'](_0x34425d)[_0xd1c3('0x1e')](function(_0x278861){_0x1d5f00[_0xd1c3('0x2b')]=_0x278861;if(_0x9c022d[_0xd1c3('0x3c')][_0xd1c3('0x4c')]){_0x44c8b2[_0xd1c3('0x4d')]=[{'all':!![]}];}return db[_0xd1c3('0x37')][_0xd1c3('0x4e')](_0x44c8b2);})[_0xd1c3('0x1e')](function(_0x161344){_0x1d5f00[_0xd1c3('0x4f')]=_0x161344;return _0x1d5f00;})[_0xd1c3('0x1e')](respondWithFilteredResult(_0xac00c,_0x44c8b2))['catch'](handleError(_0xac00c,null));};exports[_0xd1c3('0x50')]=function(_0x322d23,_0x28ca20){var _0x221cd2={'raw':![],'where':{'id':_0x322d23[_0xd1c3('0x51')]['id']}},_0x13ccd6={};_0x13ccd6[_0xd1c3('0x40')]=_[_0xd1c3('0x3d')](db[_0xd1c3('0x37')][_0xd1c3('0x38')]);_0x13ccd6[_0xd1c3('0x3c')]=_[_0xd1c3('0x3d')](_0x322d23[_0xd1c3('0x3c')]);_0x13ccd6[_0xd1c3('0x3e')]=_[_0xd1c3('0x3f')](_0x13ccd6[_0xd1c3('0x40')],_0x13ccd6[_0xd1c3('0x3c')]);_0x221cd2['attributes']=_[_0xd1c3('0x3f')](_0x13ccd6[_0xd1c3('0x40')],qs['fields'](_0x322d23['query'][_0xd1c3('0x42')]));_0x221cd2[_0xd1c3('0x41')]=_0x221cd2[_0xd1c3('0x41')][_0xd1c3('0x43')]?_0x221cd2['attributes']:_0x13ccd6[_0xd1c3('0x40')];if(_0x322d23[_0xd1c3('0x3c')]['includeAll']){_0x221cd2[_0xd1c3('0x4d')]=[{'all':!![]}];}_0x221cd2=_[_0xd1c3('0x4a')]({},_0x221cd2,_0x322d23[_0xd1c3('0x52')]);return db[_0xd1c3('0x37')][_0xd1c3('0x53')](_0x221cd2)[_0xd1c3('0x1e')](handleEntityNotFound(_0x28ca20,null))['then'](respondWithResult(_0x28ca20,null))[_0xd1c3('0x28')](handleError(_0x28ca20,null));};exports['create']=function(_0x4e6d74,_0x5a0e27){return db[_0xd1c3('0x37')][_0xd1c3('0x54')](_0x4e6d74[_0xd1c3('0x55')],{})[_0xd1c3('0x1e')](respondWithResult(_0x5a0e27,0xc9))[_0xd1c3('0x28')](handleError(_0x5a0e27,null));};exports[_0xd1c3('0x31')]=function(_0x5cae64,_0x130447){if(_0x5cae64[_0xd1c3('0x55')]['id']){delete _0x5cae64[_0xd1c3('0x55')]['id'];}return db[_0xd1c3('0x37')][_0xd1c3('0x53')]({'where':{'id':_0x5cae64[_0xd1c3('0x51')]['id']}})['then'](handleEntityNotFound(_0x130447,null))[_0xd1c3('0x1e')](saveUpdates(_0x5cae64[_0xd1c3('0x55')],null))[_0xd1c3('0x1e')](respondWithResult(_0x130447,null))['catch'](handleError(_0x130447,null));};exports[_0xd1c3('0x32')]=function(_0x129bb8,_0x18ea01){return db[_0xd1c3('0x37')]['find']({'where':{'id':_0x129bb8[_0xd1c3('0x51')]['id']}})[_0xd1c3('0x1e')](handleEntityNotFound(_0x18ea01,null))[_0xd1c3('0x1e')](removeEntity(_0x18ea01,null))[_0xd1c3('0x28')](handleError(_0x18ea01,null));};exports[_0xd1c3('0x56')]=function(_0x4754bf,_0x2f0b87,_0x24c560){var _0x50494b={};var _0x101141={};var _0x405366;var _0x2a1734;return db['ZohoAccount'][_0xd1c3('0x57')]({'where':{'id':_0x4754bf[_0xd1c3('0x51')]['id']}})['then'](handleEntityNotFound(_0x2f0b87,null))[_0xd1c3('0x1e')](function(_0x36af67){if(_0x36af67){_0x405366=_0x36af67;_0x101141[_0xd1c3('0x40')]=_[_0xd1c3('0x3d')](db[_0xd1c3('0x58')][_0xd1c3('0x38')]);_0x101141[_0xd1c3('0x3c')]=_['keys'](_0x4754bf[_0xd1c3('0x3c')]);_0x101141[_0xd1c3('0x3e')]=_[_0xd1c3('0x3f')](_0x101141[_0xd1c3('0x40')],_0x101141[_0xd1c3('0x3c')]);_0x50494b[_0xd1c3('0x41')]=_[_0xd1c3('0x3f')](_0x101141['model'],qs[_0xd1c3('0x42')](_0x4754bf['query'][_0xd1c3('0x42')]));_0x50494b[_0xd1c3('0x41')]=_0x50494b[_0xd1c3('0x41')]['length']?_0x50494b[_0xd1c3('0x41')]:_0x101141[_0xd1c3('0x40')];_0x50494b[_0xd1c3('0x46')]=qs[_0xd1c3('0x47')](_0x4754bf[_0xd1c3('0x3c')]['sort']);_0x50494b[_0xd1c3('0x4b')]=qs[_0xd1c3('0x3e')](_[_0xd1c3('0x48')](_0x4754bf['query'],_0x101141[_0xd1c3('0x3e')]));if(_0x4754bf['query']['filter']){_0x50494b['where']=_[_0xd1c3('0x4a')](_0x50494b[_0xd1c3('0x4b')],{'$or':_[_0xd1c3('0x36')](_0x50494b['attributes'],function(_0x5c768c){var _0x550f69={};_0x550f69[_0x5c768c]={'$like':'%'+_0x4754bf[_0xd1c3('0x3c')][_0xd1c3('0x49')]+'%'};return _0x550f69;})});}_0x50494b=_[_0xd1c3('0x4a')]({},_0x50494b,_0x4754bf[_0xd1c3('0x52')]);return _0x405366[_0xd1c3('0x56')](_0x50494b);}})[_0xd1c3('0x1e')](function(_0x9ec9f8){if(_0x9ec9f8){_0x2a1734=_0x9ec9f8[_0xd1c3('0x43')];if(!_0x4754bf[_0xd1c3('0x3c')][_0xd1c3('0x44')](_0xd1c3('0x59'))){_0x50494b[_0xd1c3('0x2c')]=qs[_0xd1c3('0x2c')](_0x4754bf[_0xd1c3('0x3c')]['limit']);_0x50494b[_0xd1c3('0x45')]=qs[_0xd1c3('0x45')](_0x4754bf[_0xd1c3('0x3c')][_0xd1c3('0x45')]);}return _0x405366['getConfigurations'](_0x50494b);}})[_0xd1c3('0x1e')](function(_0x49339b){if(_0x49339b){return _0x49339b?{'count':_0x2a1734,'rows':_0x49339b}:null;}})[_0xd1c3('0x1e')](respondWithResult(_0x2f0b87,null))[_0xd1c3('0x28')](handleError(_0x2f0b87,null));};exports[_0xd1c3('0x5a')]=function(_0x157726,_0x2f5c4f,_0x4f47cf){if(_0x157726[_0xd1c3('0x55')]['id']){delete _0x157726[_0xd1c3('0x55')]['id'];}return db['ZohoAccount'][_0xd1c3('0x57')]({'where':{'id':_0x157726[_0xd1c3('0x51')]['id']}})[_0xd1c3('0x1e')](handleEntityNotFound(_0x2f5c4f,null))['then'](function(_0x51bfa8){if(_0x51bfa8){_0x157726[_0xd1c3('0x55')][_0xd1c3('0x5b')]=_0x51bfa8['id'];_0x157726[_0xd1c3('0x55')][_0xd1c3('0x5c')]=integrations[_0xd1c3('0x5d')](_0x157726['body'][_0xd1c3('0x5e')],_0x157726['body']['type']);_0x157726[_0xd1c3('0x55')][_0xd1c3('0x5f')]=integrations[_0xd1c3('0x60')](_0x157726[_0xd1c3('0x55')][_0xd1c3('0x5e')],_0x157726[_0xd1c3('0x55')][_0xd1c3('0x3a')]);return db[_0xd1c3('0x58')][_0xd1c3('0x54')](_0x157726[_0xd1c3('0x55')],{'include':[{'model':db['ZohoField'],'as':_0xd1c3('0x5c')},{'model':db[_0xd1c3('0x61')],'as':_0xd1c3('0x5f')}]});}return null;})[_0xd1c3('0x1e')](respondWithResult(_0x2f5c4f,null))[_0xd1c3('0x28')](handleError(_0x2f5c4f,null));};function getAccessToken(_0x19eceb){return new Promise(function(_0x58cde8,_0x4078c6){var _0x47c5e7;switch(_0x19eceb[_0xd1c3('0x62')]){case'US':_0x47c5e7='https://accounts.zoho.com';break;case'AU':_0x47c5e7='https://accounts.zoho.com.au';break;case'EU':_0x47c5e7='https://accounts.zoho.eu';break;case'IN':_0x47c5e7='https://accounts.zoho.in';break;case'CN':_0x47c5e7=_0xd1c3('0x63');break;default:_0x47c5e7=_0xd1c3('0x64');break;}var _0x49ae15={'method':_0xd1c3('0x65'),'uri':_0x47c5e7+'/oauth/v2/token','qs':{'refresh_token':_0x19eceb[_0xd1c3('0x66')],'client_id':_0x19eceb[_0xd1c3('0x67')],'client_secret':_0x19eceb[_0xd1c3('0x68')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x49ae15)[_0xd1c3('0x1e')](function(_0x108c59){if(_0x108c59[_0xd1c3('0x69')]){_0x58cde8(_0x108c59[_0xd1c3('0x69')]);}else{_0x4078c6(_0xd1c3('0x6a'));}})[_0xd1c3('0x28')](function(_0x592546){_0x4078c6(_0x592546);});});}exports[_0xd1c3('0x6b')]=function(_0x21635c,_0x5134e5,_0x35d514){var _0x3e199c,_0x36aab7,_0x335f43,_0x1c4dcb,_0x51d1ae;return db['ZohoAccount'][_0xd1c3('0x57')]({'where':{'id':_0x21635c[_0xd1c3('0x51')]['id']},'attributes':['id',_0xd1c3('0x6c'),'zone',_0xd1c3('0x67'),_0xd1c3('0x68'),_0xd1c3('0x6d'),_0xd1c3('0x25'),_0xd1c3('0x66')]})[_0xd1c3('0x1e')](handleEntityNotFound(_0x5134e5,null))[_0xd1c3('0x1e')](function(_0x1c0a88){_0x51d1ae=_0x1c0a88;_0x3e199c=_0x51d1ae[_0xd1c3('0x6c')];_0x36aab7=_0x3e199c==='zoho.eu'?'eu':_0xd1c3('0x6e');_0x335f43=_0x51d1ae[_0xd1c3('0x6d')];var _0x66d98=_0x335f43[_0xd1c3('0x6f')](-0x1);if(_0x66d98==='/'||_0x66d98==='\x5c'||_0x66d98===':'){_0x335f43=_0x335f43[_0xd1c3('0x70')](0x0,_0x335f43['lastIndexOf'](_0x66d98));}if(!_0x51d1ae['refreshToken']){throw new Error(_0xd1c3('0x71'));}return getAccessToken(_0x51d1ae);})[_0xd1c3('0x1e')](function(_0x42e897){if(_0x42e897){return rp({'method':_0xd1c3('0x72'),'uri':util['format'](_0xd1c3('0x73'),_0x36aab7),'qs':{'module':_0xd1c3('0x74')},'headers':{'Authorization':_0xd1c3('0x75')+_0x42e897},'json':!![]});}})[_0xd1c3('0x1e')](function(_0x34c1a1){if(_0x34c1a1){if(_0x34c1a1[_0xd1c3('0x76')]&&_0x34c1a1[_0xd1c3('0x76')][_0xd1c3('0x24')]){throw new Error(_0x34c1a1['response'][_0xd1c3('0x24')][_0xd1c3('0x26')]);}var _0x51ad40=[];var _0x57a59e=[];var _0xfce22f=[_0xd1c3('0x77'),_0xd1c3('0x78'),_0xd1c3('0x79'),_0xd1c3('0x7a'),'Call_Duration',_0xd1c3('0x7b'),_0xd1c3('0x7c'),'Call_Type'];_0x57a59e=_['remove'](_0x34c1a1[_0xd1c3('0x42')],function(_0x281430){return _0xfce22f['includes'](_0x281430[_0xd1c3('0x7d')]);});for(var _0x8e51d1=0x0;_0x8e51d1<_0x57a59e[_0xd1c3('0x43')];_0x8e51d1++){if(_0x57a59e[_0x8e51d1]['system_mandatory']===![]){_0x51ad40[_0xd1c3('0x7e')]({'id':_0x57a59e[_0x8e51d1]['id'],'name':_0x57a59e[_0x8e51d1][_0xd1c3('0x7f')],'custom':_0x57a59e[_0x8e51d1]['custom_field'],'options':_0x57a59e[_0x8e51d1][_0xd1c3('0x80')]===_0xd1c3('0x81')&&_0x57a59e[_0x8e51d1][_0xd1c3('0x82')][_0xd1c3('0x43')]>-0x1?_[_0xd1c3('0x36')](_0x57a59e[_0x8e51d1][_0xd1c3('0x82')],function(_0x540f4f){return{'name':_0x540f4f,'value':_0x540f4f};}):[]});}}return{'count':_0x51ad40[_0xd1c3('0x43')],'rows':_0x51ad40};}else{return{'count':0x0,'rows':[]};}})[_0xd1c3('0x1e')](respondWithResult(_0x5134e5,null))[_0xd1c3('0x28')](function(_0x3a855f){var _0x44bccb=_0x21635c[_0xd1c3('0x3c')][_0xd1c3('0x1b')]?0x1f4:_0x3a855f[_0xd1c3('0x83')]||0x1f4;logger[_0xd1c3('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xd1c3('0x6b'),_0x44bccb,JSON[_0xd1c3('0x23')](_0x3a855f));delete _0x3a855f[_0xd1c3('0x34')];if(_0x44bccb===0x191){_0x44bccb=0x190;}_0x5134e5['status'](_0x44bccb)[_0xd1c3('0x35')](_0x21635c[_0xd1c3('0x3c')][_0xd1c3('0x1b')]?{'message':_0xd1c3('0x84'),'statusCode':_0x3a855f['statusCode']}:_0x3a855f);});};
\ No newline at end of file
+var _0x353d=['destroy','stack','name','index','ZohoAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','then','includeAll','include','rows','catch','params','merge','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Result','remove','includes','api_name','push','display_label','custom_field','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','info','result','status','end','json','count','offset','limit','set','apply','reject','update'];(function(_0x55e06c,_0x3f9052){var _0x797166=function(_0x291a80){while(--_0x291a80){_0x55e06c['push'](_0x55e06c['shift']());}};_0x797166(++_0x3f9052);}(_0x353d,0x174));var _0xd353=function(_0x308dcc,_0x2d1178){_0x308dcc=_0x308dcc-0x0;var _0x361717=_0x353d[_0x308dcc];return _0x361717;};'use strict';var pdf=require(_0xd353('0x0'));var emlformat=require(_0xd353('0x1'));var rimraf=require(_0xd353('0x2'));var zipdir=require(_0xd353('0x3'));var jsonpatch=require(_0xd353('0x4'));var rp=require(_0xd353('0x5'));var moment=require(_0xd353('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd353('0x7'));var util=require(_0xd353('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xd353('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd353('0xa'));var crypto=require(_0xd353('0xb'));var jsforce=require(_0xd353('0xc'));var deskjs=require(_0xd353('0xd'));var toCsv=require(_0xd353('0x9'));var querystring=require(_0xd353('0xe'));var Papa=require(_0xd353('0xf'));var Redis=require(_0xd353('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd353('0x11'));var hardwareService=require(_0xd353('0x12'));var logger=require(_0xd353('0x13'))(_0xd353('0x14'));var utils=require('../../config/utils');var config=require(_0xd353('0x15'));var db=require(_0xd353('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xd353('0x17'));var client=jayson[_0xd353('0x18')][_0xd353('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3d0024,_0x11e4fe,_0x3cc629){if(_0x3cc629){var _0xfff071=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xfff071[_0xd353('0x1a')](_0x11e4fe)){return _0x3d0024;}else{throw new db['Sequelize'][(_0xd353('0x1b'))](_0xd353('0x1c'));}}else{return _0x3d0024;}}function respondWithRpcPromise(_0x415c48,_0x3eca41,_0x404792,_0x5c708e){return new BPromise(function(_0x5385b5,_0x43e29c){var _0x33229a=_0x5c708e||client;return _0x33229a['request'](_0x415c48,_0x404792)['then'](function(_0x4d6a89){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x3eca41,_0xd353('0x1d'));logger['debug'](_0xd353('0x1e'),_0x3eca41,_0xd353('0x1d'),JSON[_0xd353('0x1f')](_0x4d6a89));if(_0x4d6a89[_0xd353('0x20')]){if(_0x4d6a89['error'][_0xd353('0x21')]===0x1f4){logger[_0xd353('0x20')](_0xd353('0x22'),_0x3eca41,_0x4d6a89[_0xd353('0x20')][_0xd353('0x23')]);return _0x43e29c(_0x4d6a89[_0xd353('0x20')][_0xd353('0x23')]);}logger[_0xd353('0x20')]('ZohoAccount,\x20%s,\x20%s',_0x3eca41,_0x4d6a89['error'][_0xd353('0x23')]);return _0x5385b5(_0x4d6a89[_0xd353('0x20')]['message']);}else{logger[_0xd353('0x24')]('ZohoAccount,\x20%s,\x20%s',_0x3eca41,_0xd353('0x1d'));_0x5385b5(_0x4d6a89[_0xd353('0x25')][_0xd353('0x23')]);}})['catch'](function(_0x4f62cf){logger[_0xd353('0x20')]('ZohoAccount,\x20%s,\x20%s',_0x3eca41,_0x4f62cf);_0x43e29c(_0x4f62cf);});});}function respondWithStatusCode(_0x598e2c,_0x486f53){_0x486f53=_0x486f53||0xcc;return function(_0x31371c){if(_0x31371c){return _0x598e2c['sendStatus'](_0x486f53);}return _0x598e2c[_0xd353('0x26')](_0x486f53)[_0xd353('0x27')]();};}function respondWithResult(_0x7645f5,_0x512852){_0x512852=_0x512852||0xc8;return function(_0x5e7e5e){if(_0x5e7e5e){return _0x7645f5[_0xd353('0x26')](_0x512852)[_0xd353('0x28')](_0x5e7e5e);}};}function respondWithFilteredResult(_0x555c2c,_0x1fcc7b){return function(_0x23b8cc){if(_0x23b8cc){var _0x121454=_0x23b8cc[_0xd353('0x29')],_0x33477e=_0x1fcc7b[_0xd353('0x2a')],_0x1af2cb=_0x1fcc7b[_0xd353('0x2a')]+_0x1fcc7b[_0xd353('0x2b')],_0x498ac2;if(_0x1af2cb>=_0x121454){_0x1af2cb=_0x121454;_0x498ac2=0xc8;}else{_0x498ac2=0xce;}_0x555c2c[_0xd353('0x26')](_0x498ac2);return _0x555c2c[_0xd353('0x2c')]('Content-Range',_0x33477e+'-'+_0x1af2cb+'/'+_0x121454)[_0xd353('0x28')](_0x23b8cc);}return null;};}function patchUpdates(_0x215308){return function(_0x1fc4f9){try{jsonpatch[_0xd353('0x2d')](_0x1fc4f9,_0x215308,!![]);}catch(_0x3364ad){return BPromise[_0xd353('0x2e')](_0x3364ad);}return _0x1fc4f9['save']();};}function saveUpdates(_0xd61f7b,_0x2cbe66){return function(_0x3cf767){if(_0x3cf767){return _0x3cf767[_0xd353('0x2f')](_0xd61f7b)['then'](function(_0x59ca83){return _0x59ca83;});}return null;};}function removeEntity(_0x39c8d9,_0x3517e1){return function(_0x3c7bef){if(_0x3c7bef){return _0x3c7bef[_0xd353('0x30')]()['then'](function(){_0x39c8d9[_0xd353('0x26')](0xcc)[_0xd353('0x27')]();});}};}function handleEntityNotFound(_0x3bdf9a,_0x12c811){return function(_0x4fcd89){if(!_0x4fcd89){_0x3bdf9a['sendStatus'](0x194);}return _0x4fcd89;};}function handleError(_0x2c0c0a,_0x4ec0bf){_0x4ec0bf=_0x4ec0bf||0x1f4;return function(_0x2a394a){logger['error'](_0x2a394a[_0xd353('0x31')]);if(_0x2a394a[_0xd353('0x32')]){delete _0x2a394a[_0xd353('0x32')];}_0x2c0c0a[_0xd353('0x26')](_0x4ec0bf)['send'](_0x2a394a);};}exports[_0xd353('0x33')]=function(_0x4f614b,_0x1b6ab5){var _0x59cd4d={},_0x20c808={},_0x1ca03f={'count':0x0,'rows':[]};var _0x5c3d4c=_['map'](db[_0xd353('0x34')][_0xd353('0x35')],function(_0x58d934){return{'name':_0x58d934[_0xd353('0x36')],'type':_0x58d934['type'][_0xd353('0x37')]};});_0x20c808[_0xd353('0x38')]=_[_0xd353('0x39')](_0x5c3d4c,_0xd353('0x32'));_0x20c808[_0xd353('0x3a')]=_[_0xd353('0x3b')](_0x4f614b[_0xd353('0x3a')]);_0x20c808[_0xd353('0x3c')]=_[_0xd353('0x3d')](_0x20c808[_0xd353('0x38')],_0x20c808[_0xd353('0x3a')]);_0x59cd4d['attributes']=_[_0xd353('0x3d')](_0x20c808[_0xd353('0x38')],qs[_0xd353('0x3e')](_0x4f614b[_0xd353('0x3a')]['fields']));_0x59cd4d['attributes']=_0x59cd4d['attributes'][_0xd353('0x3f')]?_0x59cd4d[_0xd353('0x40')]:_0x20c808['model'];if(!_0x4f614b[_0xd353('0x3a')][_0xd353('0x41')](_0xd353('0x42'))){_0x59cd4d[_0xd353('0x2b')]=qs[_0xd353('0x2b')](_0x4f614b[_0xd353('0x3a')][_0xd353('0x2b')]);_0x59cd4d[_0xd353('0x2a')]=qs['offset'](_0x4f614b['query'][_0xd353('0x2a')]);}_0x59cd4d[_0xd353('0x43')]=qs[_0xd353('0x44')](_0x4f614b[_0xd353('0x3a')][_0xd353('0x44')]);_0x59cd4d[_0xd353('0x45')]=qs[_0xd353('0x3c')](_[_0xd353('0x46')](_0x4f614b[_0xd353('0x3a')],_0x20c808[_0xd353('0x3c')]),_0x5c3d4c);if(_0x4f614b[_0xd353('0x3a')][_0xd353('0x47')]){_0x59cd4d[_0xd353('0x45')]=_['merge'](_0x59cd4d[_0xd353('0x45')],{'$or':_[_0xd353('0x39')](_0x5c3d4c,function(_0x37d1f5){if(_0x37d1f5[_0xd353('0x48')]!==_0xd353('0x49')){var _0x55678f={};_0x55678f[_0x37d1f5[_0xd353('0x32')]]={'$like':'%'+_0x4f614b[_0xd353('0x3a')]['filter']+'%'};return _0x55678f;}})});}_0x59cd4d=_['merge']({},_0x59cd4d,_0x4f614b[_0xd353('0x4a')]);var _0x167bc9={'where':_0x59cd4d[_0xd353('0x45')]};return db[_0xd353('0x34')]['count'](_0x167bc9)[_0xd353('0x4b')](function(_0x1e1df4){_0x1ca03f[_0xd353('0x29')]=_0x1e1df4;if(_0x4f614b[_0xd353('0x3a')][_0xd353('0x4c')]){_0x59cd4d[_0xd353('0x4d')]=[{'all':!![]}];}return db[_0xd353('0x34')]['findAll'](_0x59cd4d);})[_0xd353('0x4b')](function(_0x34286a){_0x1ca03f[_0xd353('0x4e')]=_0x34286a;return _0x1ca03f;})[_0xd353('0x4b')](respondWithFilteredResult(_0x1b6ab5,_0x59cd4d))[_0xd353('0x4f')](handleError(_0x1b6ab5,null));};exports['show']=function(_0xca5a2,_0x4c4d22){var _0x2de632={'raw':![],'where':{'id':_0xca5a2[_0xd353('0x50')]['id']}},_0xd2ee70={};_0xd2ee70[_0xd353('0x38')]=_[_0xd353('0x3b')](db[_0xd353('0x34')][_0xd353('0x35')]);_0xd2ee70['query']=_[_0xd353('0x3b')](_0xca5a2[_0xd353('0x3a')]);_0xd2ee70[_0xd353('0x3c')]=_[_0xd353('0x3d')](_0xd2ee70[_0xd353('0x38')],_0xd2ee70[_0xd353('0x3a')]);_0x2de632[_0xd353('0x40')]=_[_0xd353('0x3d')](_0xd2ee70[_0xd353('0x38')],qs['fields'](_0xca5a2[_0xd353('0x3a')][_0xd353('0x3e')]));_0x2de632[_0xd353('0x40')]=_0x2de632[_0xd353('0x40')][_0xd353('0x3f')]?_0x2de632['attributes']:_0xd2ee70['model'];if(_0xca5a2['query'][_0xd353('0x4c')]){_0x2de632[_0xd353('0x4d')]=[{'all':!![]}];}_0x2de632=_[_0xd353('0x51')]({},_0x2de632,_0xca5a2[_0xd353('0x4a')]);return db['ZohoAccount'][_0xd353('0x52')](_0x2de632)[_0xd353('0x4b')](handleEntityNotFound(_0x4c4d22,null))[_0xd353('0x4b')](respondWithResult(_0x4c4d22,null))[_0xd353('0x4f')](handleError(_0x4c4d22,null));};exports[_0xd353('0x53')]=function(_0x25a34d,_0x48cac5){return db['ZohoAccount'][_0xd353('0x53')](_0x25a34d[_0xd353('0x54')],{})['then'](respondWithResult(_0x48cac5,0xc9))[_0xd353('0x4f')](handleError(_0x48cac5,null));};exports[_0xd353('0x2f')]=function(_0x327f1e,_0x1fc07b){if(_0x327f1e[_0xd353('0x54')]['id']){delete _0x327f1e[_0xd353('0x54')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x327f1e['params']['id']}})[_0xd353('0x4b')](handleEntityNotFound(_0x1fc07b,null))[_0xd353('0x4b')](saveUpdates(_0x327f1e['body'],null))[_0xd353('0x4b')](respondWithResult(_0x1fc07b,null))[_0xd353('0x4f')](handleError(_0x1fc07b,null));};exports['destroy']=function(_0xf3ea91,_0x2432ad){return db[_0xd353('0x34')][_0xd353('0x52')]({'where':{'id':_0xf3ea91['params']['id']}})['then'](handleEntityNotFound(_0x2432ad,null))[_0xd353('0x4b')](removeEntity(_0x2432ad,null))[_0xd353('0x4f')](handleError(_0x2432ad,null));};exports[_0xd353('0x55')]=function(_0x4b9440,_0x1c95b3,_0x3a19a0){var _0x5b292f={};var _0x2dc433={};var _0xc0f07a;var _0x5d0a4e;return db[_0xd353('0x34')][_0xd353('0x56')]({'where':{'id':_0x4b9440['params']['id']}})[_0xd353('0x4b')](handleEntityNotFound(_0x1c95b3,null))[_0xd353('0x4b')](function(_0x89f1e7){if(_0x89f1e7){_0xc0f07a=_0x89f1e7;_0x2dc433[_0xd353('0x38')]=_['keys'](db['ZohoConfiguration'][_0xd353('0x35')]);_0x2dc433[_0xd353('0x3a')]=_[_0xd353('0x3b')](_0x4b9440[_0xd353('0x3a')]);_0x2dc433['filters']=_[_0xd353('0x3d')](_0x2dc433['model'],_0x2dc433[_0xd353('0x3a')]);_0x5b292f[_0xd353('0x40')]=_['intersection'](_0x2dc433['model'],qs[_0xd353('0x3e')](_0x4b9440[_0xd353('0x3a')][_0xd353('0x3e')]));_0x5b292f[_0xd353('0x40')]=_0x5b292f[_0xd353('0x40')][_0xd353('0x3f')]?_0x5b292f[_0xd353('0x40')]:_0x2dc433[_0xd353('0x38')];_0x5b292f['order']=qs[_0xd353('0x44')](_0x4b9440[_0xd353('0x3a')][_0xd353('0x44')]);_0x5b292f['where']=qs[_0xd353('0x3c')](_[_0xd353('0x46')](_0x4b9440['query'],_0x2dc433['filters']));if(_0x4b9440['query'][_0xd353('0x47')]){_0x5b292f[_0xd353('0x45')]=_[_0xd353('0x51')](_0x5b292f[_0xd353('0x45')],{'$or':_['map'](_0x5b292f['attributes'],function(_0xfb703d){var _0xd8a1ac={};_0xd8a1ac[_0xfb703d]={'$like':'%'+_0x4b9440[_0xd353('0x3a')][_0xd353('0x47')]+'%'};return _0xd8a1ac;})});}_0x5b292f=_[_0xd353('0x51')]({},_0x5b292f,_0x4b9440[_0xd353('0x4a')]);return _0xc0f07a[_0xd353('0x55')](_0x5b292f);}})[_0xd353('0x4b')](function(_0x5b58cb){if(_0x5b58cb){_0x5d0a4e=_0x5b58cb[_0xd353('0x3f')];if(!_0x4b9440['query'][_0xd353('0x41')](_0xd353('0x42'))){_0x5b292f['limit']=qs[_0xd353('0x2b')](_0x4b9440[_0xd353('0x3a')]['limit']);_0x5b292f[_0xd353('0x2a')]=qs[_0xd353('0x2a')](_0x4b9440['query'][_0xd353('0x2a')]);}return _0xc0f07a['getConfigurations'](_0x5b292f);}})[_0xd353('0x4b')](function(_0x560b96){if(_0x560b96){return _0x560b96?{'count':_0x5d0a4e,'rows':_0x560b96}:null;}})[_0xd353('0x4b')](respondWithResult(_0x1c95b3,null))[_0xd353('0x4f')](handleError(_0x1c95b3,null));};exports[_0xd353('0x57')]=function(_0x336b2a,_0x20e523,_0x5bfbf9){if(_0x336b2a[_0xd353('0x54')]['id']){delete _0x336b2a[_0xd353('0x54')]['id'];}return db[_0xd353('0x34')]['findOne']({'where':{'id':_0x336b2a[_0xd353('0x50')]['id']}})[_0xd353('0x4b')](handleEntityNotFound(_0x20e523,null))[_0xd353('0x4b')](function(_0x3def4b){if(_0x3def4b){_0x336b2a['body'][_0xd353('0x58')]=_0x3def4b['id'];_0x336b2a[_0xd353('0x54')][_0xd353('0x59')]=integrations[_0xd353('0x5a')](_0x336b2a['body'][_0xd353('0x5b')],_0x336b2a[_0xd353('0x54')][_0xd353('0x48')]);_0x336b2a['body'][_0xd353('0x5c')]=integrations[_0xd353('0x5d')](_0x336b2a['body'][_0xd353('0x5b')],_0x336b2a[_0xd353('0x54')]['type']);return db[_0xd353('0x5e')][_0xd353('0x53')](_0x336b2a[_0xd353('0x54')],{'include':[{'model':db[_0xd353('0x5f')],'as':_0xd353('0x59')},{'model':db[_0xd353('0x5f')],'as':_0xd353('0x5c')}]});}return null;})[_0xd353('0x4b')](respondWithResult(_0x20e523,null))['catch'](handleError(_0x20e523,null));};function getAccessToken(_0x47c9f8){return new Promise(function(_0xffb935,_0x5978fa){var _0x4725b2;switch(_0x47c9f8[_0xd353('0x60')]){case'US':_0x4725b2=_0xd353('0x61');break;case'AU':_0x4725b2=_0xd353('0x62');break;case'EU':_0x4725b2=_0xd353('0x63');break;case'IN':_0x4725b2='https://accounts.zoho.in';break;case'CN':_0x4725b2=_0xd353('0x64');break;default:_0x4725b2='https://accounts.zoho.eu';break;}var _0x191f3f={'method':_0xd353('0x65'),'uri':_0x4725b2+_0xd353('0x66'),'qs':{'refresh_token':_0x47c9f8[_0xd353('0x67')],'client_id':_0x47c9f8[_0xd353('0x68')],'client_secret':_0x47c9f8[_0xd353('0x69')],'grant_type':_0xd353('0x6a')},'json':!![]};return rp(_0x191f3f)[_0xd353('0x4b')](function(_0x54edcd){if(_0x54edcd[_0xd353('0x6b')]){_0xffb935(_0x54edcd['access_token']);}else{_0x5978fa(_0xd353('0x6c'));}})[_0xd353('0x4f')](function(_0x33af33){_0x5978fa(_0x33af33);});});}exports[_0xd353('0x6d')]=function(_0x305522,_0x21f02a,_0x4a36e5){var _0x4684f2,_0x3ed190,_0x238edb,_0x27d10d,_0x39db78;return db[_0xd353('0x34')]['findOne']({'where':{'id':_0x305522[_0xd353('0x50')]['id']},'attributes':['id',_0xd353('0x6e'),_0xd353('0x60'),_0xd353('0x68'),'clientSecret','serverUrl',_0xd353('0x21'),'refreshToken']})[_0xd353('0x4b')](handleEntityNotFound(_0x21f02a,null))[_0xd353('0x4b')](function(_0x55ed04){_0x39db78=_0x55ed04;_0x4684f2=_0x39db78[_0xd353('0x6e')];_0x3ed190=_0x4684f2===_0xd353('0x6f')?'eu':_0xd353('0x70');_0x238edb=_0x39db78[_0xd353('0x71')];var _0x5fdb00=_0x238edb[_0xd353('0x72')](-0x1);if(_0x5fdb00==='/'||_0x5fdb00==='\x5c'||_0x5fdb00===':'){_0x238edb=_0x238edb[_0xd353('0x73')](0x0,_0x238edb[_0xd353('0x74')](_0x5fdb00));}if(!_0x39db78[_0xd353('0x67')]){throw new Error(_0xd353('0x75'));}return getAccessToken(_0x39db78);})[_0xd353('0x4b')](function(_0x290306){if(_0x290306){return rp({'method':_0xd353('0x76'),'uri':util[_0xd353('0x77')](_0xd353('0x78'),_0x3ed190),'qs':{'module':_0xd353('0x79')},'headers':{'Authorization':_0xd353('0x7a')+_0x290306},'json':!![]});}})['then'](function(_0x56bf4b){if(_0x56bf4b){if(_0x56bf4b[_0xd353('0x7b')]&&_0x56bf4b[_0xd353('0x7b')][_0xd353('0x20')]){throw new Error(_0x56bf4b[_0xd353('0x7b')]['error'][_0xd353('0x23')]);}var _0x4fa4f5=[];var _0x514dec=[];var _0x2187d7=['Owner',_0xd353('0x7c'),_0xd353('0x7d'),_0xd353('0x7e'),'Call_Duration',_0xd353('0x7f'),'Call_Start_Time','Call_Type'];_0x514dec=_[_0xd353('0x80')](_0x56bf4b['fields'],function(_0x3d1a29){return _0x2187d7[_0xd353('0x81')](_0x3d1a29[_0xd353('0x82')]);});for(var _0x2538d2=0x0;_0x2538d2<_0x514dec[_0xd353('0x3f')];_0x2538d2++){if(_0x514dec[_0x2538d2]['system_mandatory']===![]){_0x4fa4f5[_0xd353('0x83')]({'id':_0x514dec[_0x2538d2]['id'],'name':_0x514dec[_0x2538d2][_0xd353('0x84')],'custom':_0x514dec[_0x2538d2][_0xd353('0x85')],'options':_0x514dec[_0x2538d2][_0xd353('0x86')]==='picklist'&&_0x514dec[_0x2538d2][_0xd353('0x87')][_0xd353('0x3f')]>-0x1?_[_0xd353('0x39')](_0x514dec[_0x2538d2][_0xd353('0x87')],function(_0x3a0dfa){return{'name':_0x3a0dfa,'value':_0x3a0dfa};}):[]});}}return{'count':_0x4fa4f5[_0xd353('0x3f')],'rows':_0x4fa4f5};}else{return{'count':0x0,'rows':[]};}})[_0xd353('0x4b')](respondWithResult(_0x21f02a,null))[_0xd353('0x4f')](function(_0x1b468d){var _0xe5f051=_0x305522[_0xd353('0x3a')]['test']?0x1f4:_0x1b468d[_0xd353('0x88')]||0x1f4;logger[_0xd353('0x20')](_0xd353('0x89'),'getFields',_0xe5f051,JSON['stringify'](_0x1b468d));delete _0x1b468d['name'];if(_0xe5f051===0x191){_0xe5f051=0x190;}_0x21f02a[_0xd353('0x26')](_0xe5f051)[_0xd353('0x8a')](_0x305522[_0xd353('0x3a')]['test']?{'message':_0xd353('0x8b'),'statusCode':_0x1b468d[_0xd353('0x88')]}:_0x1b468d);});};
\ No newline at end of file
index eceaf38..1f2513c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6780=['POST','parse','refresh_token','refreshToken','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','slice','https://accounts.zoho.com','https://accounts.zoho.com.au','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret','code','host','serverUrl','substring','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu'];(function(_0x3ad875,_0x536c0b){var _0x10f930=function(_0x4b4c21){while(--_0x4b4c21){_0x3ad875['push'](_0x3ad875['shift']());}};_0x10f930(++_0x536c0b);}(_0x6780,0x11b));var _0x0678=function(_0x12abb9,_0xb6ca60){_0x12abb9=_0x12abb9-0x0;var _0x47b7d5=_0x6780[_0x12abb9];return _0x47b7d5;};'use strict';var _=require(_0x0678('0x0'));var util=require('util');var logger=require(_0x0678('0x1'))('api');var moment=require(_0x0678('0x2'));var BPromise=require(_0x0678('0x3'));var rp=require(_0x0678('0x4'));var fs=require('fs');var path=require(_0x0678('0x5'));var rimraf=require(_0x0678('0x6'));var config=require('../../config/environment');var attributes=require(_0x0678('0x7'));var integrations=require(_0x0678('0x8'));module[_0x0678('0x9')]=function(_0x442418,_0x4e00f0){return _0x442418[_0x0678('0xa')](_0x0678('0xb'),attributes,{'tableName':_0x0678('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x7c77d2,_0x381480,_0x559a6b){if(_0x7c77d2[_0x0678('0xd')](_0x0678('0xe'))||_0x7c77d2[_0x0678('0xd')]('serverUrl')||_0x7c77d2['changed'](_0x0678('0xf'))||_0x7c77d2[_0x0678('0xd')](_0x0678('0x10'))||_0x7c77d2['changed'](_0x0678('0x11'))||_0x7c77d2[_0x0678('0xd')](_0x0678('0x12'))){var _0x47ac71,_0x52a940;_0x47ac71=_0x7c77d2[_0x0678('0x13')];var _0xbd13a6=_0x47ac71['slice'](-0x1);if(_0xbd13a6==='/'||_0xbd13a6==='\x5c'||_0xbd13a6===':'){_0x47ac71=_0x47ac71[_0x0678('0x14')](0x0,_0x47ac71[_0x0678('0x15')](_0xbd13a6));}switch(_0x7c77d2[_0x0678('0xe')]){case'US':_0x52a940='https://accounts.zoho.com';break;case'AU':_0x52a940='https://accounts.zoho.com.au';break;case'IN':_0x52a940=_0x0678('0x16');break;case'CN':_0x52a940=_0x0678('0x17');break;default:_0x52a940=_0x0678('0x18');break;}var _0x14dcd6={'method':_0x0678('0x19'),'uri':_0x52a940+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x7c77d2[_0x0678('0xf')],'client_secret':_0x7c77d2[_0x0678('0x10')],'redirect_uri':_0x7c77d2['serverUrl'],'code':_0x7c77d2[_0x0678('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x14dcd6)['then'](function(_0x35ae95){var _0x1f4ead=JSON[_0x0678('0x1a')](_0x35ae95);if(_0x1f4ead[_0x0678('0x1b')]){_0x7c77d2[_0x0678('0x1c')]=_0x1f4ead[_0x0678('0x1b')];logger[_0x0678('0x1d')](util[_0x0678('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x7c77d2[_0x0678('0x1f')],_0x7c77d2['id']));}else{logger[_0x0678('0x20')](util[_0x0678('0x1e')](_0x0678('0x21'),_0x7c77d2[_0x0678('0x1f')],_0x7c77d2['id']),util['inspect'](_0x1f4ead,{'showHidden':![],'depth':null}));}return _0x559a6b(null,_0x381480);})[_0x0678('0x22')](function(_0x3f1505){logger['error'](util['format'](_0x0678('0x21'),_0x7c77d2[_0x0678('0x1f')],_0x7c77d2['id']),util[_0x0678('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x559a6b(_0x3f1505);});}else{return _0x559a6b(null,_0x381480);}},'beforeUpdate':function(_0x53730f,_0x22892a,_0x2843f6){if(_0x53730f[_0x0678('0xd')](_0x0678('0xe'))||_0x53730f['changed']('serverUrl')||_0x53730f['changed'](_0x0678('0xf'))||_0x53730f['changed'](_0x0678('0x10'))||_0x53730f[_0x0678('0xd')](_0x0678('0x11'))||_0x53730f['changed'](_0x0678('0x12'))){var _0x52c2a1,_0x52a5f7;_0x52c2a1=_0x53730f[_0x0678('0x13')];var _0x341e99=_0x52c2a1[_0x0678('0x24')](-0x1);if(_0x341e99==='/'||_0x341e99==='\x5c'||_0x341e99===':'){_0x52c2a1=_0x52c2a1[_0x0678('0x14')](0x0,_0x52c2a1['lastIndexOf'](_0x341e99));}switch(_0x53730f['zone']){case'US':_0x52a5f7=_0x0678('0x25');break;case'AU':_0x52a5f7=_0x0678('0x26');break;case'IN':_0x52a5f7=_0x0678('0x16');break;case'CN':_0x52a5f7=_0x0678('0x17');break;default:_0x52a5f7='https://accounts.zoho.eu';break;}var _0x3d209e={'method':_0x0678('0x19'),'uri':_0x52a5f7+_0x0678('0x27'),'form':{'grant_type':_0x0678('0x28'),'client_id':_0x53730f[_0x0678('0xf')],'client_secret':_0x53730f['clientSecret'],'redirect_uri':_0x53730f[_0x0678('0x13')],'code':_0x53730f[_0x0678('0x11')]},'headers':{'Content-Type':_0x0678('0x29')}};return rp(_0x3d209e)[_0x0678('0x2a')](function(_0x6a5eb7){var _0x39037b=JSON[_0x0678('0x1a')](_0x6a5eb7);if(_0x39037b[_0x0678('0x1b')]){_0x53730f[_0x0678('0x1c')]=_0x39037b[_0x0678('0x1b')];logger[_0x0678('0x1d')](util[_0x0678('0x1e')](_0x0678('0x2b'),_0x53730f['name'],_0x53730f['id']));}else{logger[_0x0678('0x20')](util[_0x0678('0x1e')](_0x0678('0x21'),_0x53730f[_0x0678('0x1f')],_0x53730f['id']),util[_0x0678('0x23')](_0x39037b,{'showHidden':![],'depth':null}));}return _0x2843f6(null,_0x22892a);})['catch'](function(_0x5e8bd7){logger[_0x0678('0x20')](util[_0x0678('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x53730f['name'],_0x53730f['id']),util[_0x0678('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x2843f6(_0x5e8bd7);});}else{return _0x2843f6(null,_0x22892a);}}}});};
\ No newline at end of file
+var _0xfee8=['parse','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret','serverUrl','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','refreshToken','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','code','host','authorization_code'];(function(_0x17dd51,_0x2d09c6){var _0x462eb0=function(_0x3b9f21){while(--_0x3b9f21){_0x17dd51['push'](_0x17dd51['shift']());}};_0x462eb0(++_0x2d09c6);}(_0xfee8,0x109));var _0x8fee=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0xfee8[_0x39780c];return _0x53c19b;};'use strict';var _=require('lodash');var util=require(_0x8fee('0x0'));var logger=require(_0x8fee('0x1'))(_0x8fee('0x2'));var moment=require(_0x8fee('0x3'));var BPromise=require(_0x8fee('0x4'));var rp=require(_0x8fee('0x5'));var fs=require('fs');var path=require(_0x8fee('0x6'));var rimraf=require('rimraf');var config=require(_0x8fee('0x7'));var attributes=require(_0x8fee('0x8'));var integrations=require(_0x8fee('0x9'));module[_0x8fee('0xa')]=function(_0x3ff3d1,_0x561e63){return _0x3ff3d1[_0x8fee('0xb')](_0x8fee('0xc'),attributes,{'tableName':_0x8fee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5a0d1e,_0x3615a7,_0x4b41eb){if(_0x5a0d1e[_0x8fee('0xe')](_0x8fee('0xf'))||_0x5a0d1e[_0x8fee('0xe')]('serverUrl')||_0x5a0d1e['changed'](_0x8fee('0x10'))||_0x5a0d1e['changed'](_0x8fee('0x11'))||_0x5a0d1e['changed']('code')||_0x5a0d1e[_0x8fee('0xe')]('host')){var _0x138465,_0x7b1415;_0x138465=_0x5a0d1e[_0x8fee('0x12')];var _0x5b5632=_0x138465[_0x8fee('0x13')](-0x1);if(_0x5b5632==='/'||_0x5b5632==='\x5c'||_0x5b5632===':'){_0x138465=_0x138465['substring'](0x0,_0x138465[_0x8fee('0x14')](_0x5b5632));}switch(_0x5a0d1e['zone']){case'US':_0x7b1415=_0x8fee('0x15');break;case'AU':_0x7b1415=_0x8fee('0x16');break;case'IN':_0x7b1415=_0x8fee('0x17');break;case'CN':_0x7b1415=_0x8fee('0x18');break;default:_0x7b1415=_0x8fee('0x19');break;}var _0x5b240a={'method':_0x8fee('0x1a'),'uri':_0x7b1415+_0x8fee('0x1b'),'form':{'grant_type':'authorization_code','client_id':_0x5a0d1e[_0x8fee('0x10')],'client_secret':_0x5a0d1e['clientSecret'],'redirect_uri':_0x5a0d1e['serverUrl'],'code':_0x5a0d1e['code']},'headers':{'Content-Type':_0x8fee('0x1c')}};return rp(_0x5b240a)[_0x8fee('0x1d')](function(_0x49254c){var _0x4cafec=JSON['parse'](_0x49254c);if(_0x4cafec['refresh_token']){_0x5a0d1e[_0x8fee('0x1e')]=_0x4cafec[_0x8fee('0x1f')];logger[_0x8fee('0x20')](util[_0x8fee('0x21')](_0x8fee('0x22'),_0x5a0d1e[_0x8fee('0x23')],_0x5a0d1e['id']));}else{logger[_0x8fee('0x24')](util['format'](_0x8fee('0x25'),_0x5a0d1e[_0x8fee('0x23')],_0x5a0d1e['id']),util[_0x8fee('0x26')](_0x4cafec,{'showHidden':![],'depth':null}));}return _0x4b41eb(null,_0x3615a7);})[_0x8fee('0x27')](function(_0xd33284){logger['error'](util[_0x8fee('0x21')](_0x8fee('0x25'),_0x5a0d1e[_0x8fee('0x23')],_0x5a0d1e['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x4b41eb(_0xd33284);});}else{return _0x4b41eb(null,_0x3615a7);}},'beforeUpdate':function(_0x4e2d3b,_0x5e61f3,_0x42eeec){if(_0x4e2d3b['changed'](_0x8fee('0xf'))||_0x4e2d3b['changed'](_0x8fee('0x12'))||_0x4e2d3b[_0x8fee('0xe')](_0x8fee('0x10'))||_0x4e2d3b['changed']('clientSecret')||_0x4e2d3b[_0x8fee('0xe')](_0x8fee('0x28'))||_0x4e2d3b['changed'](_0x8fee('0x29'))){var _0x3fbc89,_0x4c2971;_0x3fbc89=_0x4e2d3b[_0x8fee('0x12')];var _0x586501=_0x3fbc89['slice'](-0x1);if(_0x586501==='/'||_0x586501==='\x5c'||_0x586501===':'){_0x3fbc89=_0x3fbc89['substring'](0x0,_0x3fbc89['lastIndexOf'](_0x586501));}switch(_0x4e2d3b['zone']){case'US':_0x4c2971=_0x8fee('0x15');break;case'AU':_0x4c2971=_0x8fee('0x16');break;case'IN':_0x4c2971='https://accounts.zoho.in';break;case'CN':_0x4c2971='https://accounts.zoho.com.cn';break;default:_0x4c2971=_0x8fee('0x19');break;}var _0x5b77d2={'method':_0x8fee('0x1a'),'uri':_0x4c2971+_0x8fee('0x1b'),'form':{'grant_type':_0x8fee('0x2a'),'client_id':_0x4e2d3b[_0x8fee('0x10')],'client_secret':_0x4e2d3b[_0x8fee('0x11')],'redirect_uri':_0x4e2d3b[_0x8fee('0x12')],'code':_0x4e2d3b[_0x8fee('0x28')]},'headers':{'Content-Type':_0x8fee('0x1c')}};return rp(_0x5b77d2)[_0x8fee('0x1d')](function(_0x1c012b){var _0x3a5586=JSON[_0x8fee('0x2b')](_0x1c012b);if(_0x3a5586[_0x8fee('0x1f')]){_0x4e2d3b[_0x8fee('0x1e')]=_0x3a5586['refresh_token'];logger[_0x8fee('0x20')](util[_0x8fee('0x21')](_0x8fee('0x22'),_0x4e2d3b[_0x8fee('0x23')],_0x4e2d3b['id']));}else{logger[_0x8fee('0x24')](util[_0x8fee('0x21')](_0x8fee('0x25'),_0x4e2d3b['name'],_0x4e2d3b['id']),util[_0x8fee('0x26')](_0x3a5586,{'showHidden':![],'depth':null}));}return _0x42eeec(null,_0x5e61f3);})['catch'](function(_0x1fdd3b){logger['error'](util[_0x8fee('0x21')](_0x8fee('0x25'),_0x4e2d3b[_0x8fee('0x23')],_0x4e2d3b['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x42eeec(_0x1fdd3b);});}else{return _0x42eeec(null,_0x5e61f3);}}}});};
\ No newline at end of file
index 7032028..03db395 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15c0=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','request\x20sent','catch','GetZohoAccount','ZohoAccount','findAll','options','attributes','include','model','map','ShowZohoAccount','find','raw','lodash','util'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x15c0,0x82));var _0x015c=function(_0x1d3c5e,_0x257cc3){_0x1d3c5e=_0x1d3c5e-0x0;var _0x2f9916=_0x15c0[_0x1d3c5e];return _0x2f9916;};'use strict';var _=require(_0x015c('0x0'));var util=require(_0x015c('0x1'));var moment=require(_0x015c('0x2'));var BPromise=require(_0x015c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x015c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x015c('0x5'));var logger=require(_0x015c('0x6'))(_0x015c('0x7'));var config=require(_0x015c('0x8'));var jayson=require(_0x015c('0x9'));var client=jayson[_0x015c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x448f8a,_0x21ecf1,_0x35b3a1){return new BPromise(function(_0x4de7c0,_0x5df422){return client[_0x015c('0xb')](_0x448f8a,_0x35b3a1)[_0x015c('0xc')](function(_0xa494ee){logger[_0x015c('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x21ecf1,'request\x20sent');logger[_0x015c('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x21ecf1,'request\x20sent',JSON[_0x015c('0xf')](_0xa494ee));if(_0xa494ee[_0x015c('0x10')]){if(_0xa494ee['error'][_0x015c('0x11')]===0x1f4){logger['error'](_0x015c('0x12'),_0x21ecf1,_0xa494ee[_0x015c('0x10')]['message']);return _0x5df422(_0xa494ee[_0x015c('0x10')]['message']);}logger[_0x015c('0x10')](_0x015c('0x12'),_0x21ecf1,_0xa494ee[_0x015c('0x10')][_0x015c('0x13')]);return _0x4de7c0(_0xa494ee[_0x015c('0x10')][_0x015c('0x13')]);}else{logger[_0x015c('0xd')](_0x015c('0x12'),_0x21ecf1,_0x015c('0x14'));_0x4de7c0(_0xa494ee['result'][_0x015c('0x13')]);}})[_0x015c('0x15')](function(_0x1fb8c5){logger[_0x015c('0x10')](_0x015c('0x12'),_0x21ecf1,_0x1fb8c5);_0x5df422(_0x1fb8c5);});});}exports[_0x015c('0x16')]=function(_0x479cb1){var _0x309918=this;return new Promise(function(_0x17ddab,_0x403289){return db[_0x015c('0x17')][_0x015c('0x18')]({'raw':_0x479cb1[_0x015c('0x19')]?_0x479cb1[_0x015c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x479cb1[_0x015c('0x19')]?_0x479cb1[_0x015c('0x19')]['where']||null:null,'attributes':_0x479cb1[_0x015c('0x19')]?_0x479cb1[_0x015c('0x19')][_0x015c('0x1a')]||null:null,'limit':_0x479cb1[_0x015c('0x19')]?_0x479cb1[_0x015c('0x19')]['limit']||null:null,'include':_0x479cb1[_0x015c('0x19')]?_0x479cb1['options']['include']?_['map'](_0x479cb1[_0x015c('0x19')][_0x015c('0x1b')],function(_0x36bd1d){return{'model':db[_0x36bd1d[_0x015c('0x1c')]],'as':_0x36bd1d['as'],'attributes':_0x36bd1d[_0x015c('0x1a')],'include':_0x36bd1d[_0x015c('0x1b')]?_['map'](_0x36bd1d['include'],function(_0x6435c4){return{'model':db[_0x6435c4[_0x015c('0x1c')]],'as':_0x6435c4['as'],'attributes':_0x6435c4[_0x015c('0x1a')],'include':_0x6435c4[_0x015c('0x1b')]?_[_0x015c('0x1d')](_0x6435c4[_0x015c('0x1b')],function(_0x31f4e7){return{'model':db[_0x31f4e7[_0x015c('0x1c')]],'as':_0x31f4e7['as'],'attributes':_0x31f4e7[_0x015c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x015c('0xc')](function(_0x169553){logger[_0x015c('0xd')](_0x015c('0x16'),_0x479cb1);logger[_0x015c('0xe')](_0x015c('0x16'),_0x479cb1,JSON[_0x015c('0xf')](_0x169553));_0x17ddab(_0x169553);})[_0x015c('0x15')](function(_0x1ac61a){logger[_0x015c('0x10')](_0x015c('0x16'),_0x1ac61a[_0x015c('0x13')],_0x479cb1);_0x403289(_0x309918[_0x015c('0x10')](0x1f4,_0x1ac61a[_0x015c('0x13')]));});});};exports[_0x015c('0x1e')]=function(_0x11faf5){var _0x472641=this;return new Promise(function(_0x325f85,_0x4d66aa){return db['ZohoAccount'][_0x015c('0x1f')]({'raw':_0x11faf5[_0x015c('0x19')]?_0x11faf5[_0x015c('0x19')][_0x015c('0x20')]===undefined?!![]:![]:!![],'where':_0x11faf5[_0x015c('0x19')]?_0x11faf5['options']['where']||null:null,'attributes':_0x11faf5['options']?_0x11faf5['options']['attributes']||null:null,'include':_0x11faf5[_0x015c('0x19')]?_0x11faf5[_0x015c('0x19')][_0x015c('0x1b')]?_[_0x015c('0x1d')](_0x11faf5['options'][_0x015c('0x1b')],function(_0x44ecb0){return{'model':db[_0x44ecb0['model']],'as':_0x44ecb0['as'],'attributes':_0x44ecb0[_0x015c('0x1a')],'include':_0x44ecb0[_0x015c('0x1b')]?_[_0x015c('0x1d')](_0x44ecb0[_0x015c('0x1b')],function(_0x265ab4){return{'model':db[_0x265ab4['model']],'as':_0x265ab4['as'],'attributes':_0x265ab4[_0x015c('0x1a')],'include':_0x265ab4[_0x015c('0x1b')]?_[_0x015c('0x1d')](_0x265ab4[_0x015c('0x1b')],function(_0x5aae55){return{'model':db[_0x5aae55[_0x015c('0x1c')]],'as':_0x5aae55['as'],'attributes':_0x5aae55['attributes']};}):[]};}):[]};}):[]:[]})[_0x015c('0xc')](function(_0x1506d2){logger[_0x015c('0xd')](_0x015c('0x1e'),_0x11faf5);logger['debug'](_0x015c('0x1e'),_0x11faf5,JSON[_0x015c('0xf')](_0x1506d2));_0x325f85(_0x1506d2);})[_0x015c('0x15')](function(_0x5cce3d){logger[_0x015c('0x10')]('ShowZohoAccount',_0x5cce3d['message'],_0x11faf5);_0x4d66aa(_0x472641[_0x015c('0x10')](0x1f4,_0x5cce3d['message']));});});};
\ No newline at end of file
+var _0xbe79=['include','map','model','GetZohoAccount','ShowZohoAccount','find','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','ZohoAccount,\x20%s,\x20%s','result','catch','ZohoAccount','options','raw','attributes'];(function(_0x2ac475,_0x593bf7){var _0x44bdab=function(_0x27ccfb){while(--_0x27ccfb){_0x2ac475['push'](_0x2ac475['shift']());}};_0x44bdab(++_0x593bf7);}(_0xbe79,0x1e6));var _0x9be7=function(_0x2d7be7,_0x469459){_0x2d7be7=_0x2d7be7-0x0;var _0x29772c=_0xbe79[_0x2d7be7];return _0x29772c;};'use strict';var _=require(_0x9be7('0x0'));var util=require('util');var moment=require(_0x9be7('0x1'));var BPromise=require('bluebird');var rs=require(_0x9be7('0x2'));var fs=require('fs');var Redis=require(_0x9be7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9be7('0x4'));var logger=require(_0x9be7('0x5'))(_0x9be7('0x6'));var config=require(_0x9be7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9be7('0x8')][_0x9be7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c153a,_0x298f23,_0x156cd6){return new BPromise(function(_0xf8315,_0x3f5bd7){return client[_0x9be7('0xa')](_0x1c153a,_0x156cd6)[_0x9be7('0xb')](function(_0x13c3d3){logger[_0x9be7('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x298f23,_0x9be7('0xd'));logger[_0x9be7('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x298f23,'request\x20sent',JSON[_0x9be7('0xf')](_0x13c3d3));if(_0x13c3d3[_0x9be7('0x10')]){if(_0x13c3d3[_0x9be7('0x10')][_0x9be7('0x11')]===0x1f4){logger[_0x9be7('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x298f23,_0x13c3d3[_0x9be7('0x10')]['message']);return _0x3f5bd7(_0x13c3d3[_0x9be7('0x10')][_0x9be7('0x12')]);}logger[_0x9be7('0x10')](_0x9be7('0x13'),_0x298f23,_0x13c3d3[_0x9be7('0x10')][_0x9be7('0x12')]);return _0xf8315(_0x13c3d3['error'][_0x9be7('0x12')]);}else{logger[_0x9be7('0xc')](_0x9be7('0x13'),_0x298f23,_0x9be7('0xd'));_0xf8315(_0x13c3d3[_0x9be7('0x14')][_0x9be7('0x12')]);}})[_0x9be7('0x15')](function(_0x4725d5){logger[_0x9be7('0x10')](_0x9be7('0x13'),_0x298f23,_0x4725d5);_0x3f5bd7(_0x4725d5);});});}exports['GetZohoAccount']=function(_0x372585){var _0x33bbde=this;return new Promise(function(_0x3c3132,_0x46db56){return db[_0x9be7('0x16')]['findAll']({'raw':_0x372585[_0x9be7('0x17')]?_0x372585[_0x9be7('0x17')][_0x9be7('0x18')]===undefined?!![]:![]:!![],'where':_0x372585[_0x9be7('0x17')]?_0x372585[_0x9be7('0x17')]['where']||null:null,'attributes':_0x372585[_0x9be7('0x17')]?_0x372585['options'][_0x9be7('0x19')]||null:null,'limit':_0x372585[_0x9be7('0x17')]?_0x372585[_0x9be7('0x17')]['limit']||null:null,'include':_0x372585[_0x9be7('0x17')]?_0x372585[_0x9be7('0x17')][_0x9be7('0x1a')]?_[_0x9be7('0x1b')](_0x372585['options'][_0x9be7('0x1a')],function(_0x1afc8c){return{'model':db[_0x1afc8c[_0x9be7('0x1c')]],'as':_0x1afc8c['as'],'attributes':_0x1afc8c['attributes'],'include':_0x1afc8c[_0x9be7('0x1a')]?_['map'](_0x1afc8c[_0x9be7('0x1a')],function(_0xac0c5c){return{'model':db[_0xac0c5c[_0x9be7('0x1c')]],'as':_0xac0c5c['as'],'attributes':_0xac0c5c[_0x9be7('0x19')],'include':_0xac0c5c[_0x9be7('0x1a')]?_[_0x9be7('0x1b')](_0xac0c5c[_0x9be7('0x1a')],function(_0x4bd303){return{'model':db[_0x4bd303[_0x9be7('0x1c')]],'as':_0x4bd303['as'],'attributes':_0x4bd303['attributes']};}):[]};}):[]};}):[]:[]})[_0x9be7('0xb')](function(_0x290dee){logger[_0x9be7('0xc')](_0x9be7('0x1d'),_0x372585);logger[_0x9be7('0xe')](_0x9be7('0x1d'),_0x372585,JSON['stringify'](_0x290dee));_0x3c3132(_0x290dee);})['catch'](function(_0x4e0f2a){logger[_0x9be7('0x10')]('GetZohoAccount',_0x4e0f2a[_0x9be7('0x12')],_0x372585);_0x46db56(_0x33bbde['error'](0x1f4,_0x4e0f2a[_0x9be7('0x12')]));});});};exports[_0x9be7('0x1e')]=function(_0xc705c5){var _0x32a7ec=this;return new Promise(function(_0x268397,_0x36da74){return db[_0x9be7('0x16')][_0x9be7('0x1f')]({'raw':_0xc705c5[_0x9be7('0x17')]?_0xc705c5[_0x9be7('0x17')][_0x9be7('0x18')]===undefined?!![]:![]:!![],'where':_0xc705c5[_0x9be7('0x17')]?_0xc705c5['options']['where']||null:null,'attributes':_0xc705c5[_0x9be7('0x17')]?_0xc705c5[_0x9be7('0x17')][_0x9be7('0x19')]||null:null,'include':_0xc705c5[_0x9be7('0x17')]?_0xc705c5[_0x9be7('0x17')][_0x9be7('0x1a')]?_['map'](_0xc705c5['options'][_0x9be7('0x1a')],function(_0x2342bc){return{'model':db[_0x2342bc[_0x9be7('0x1c')]],'as':_0x2342bc['as'],'attributes':_0x2342bc['attributes'],'include':_0x2342bc[_0x9be7('0x1a')]?_[_0x9be7('0x1b')](_0x2342bc[_0x9be7('0x1a')],function(_0x3eeec1){return{'model':db[_0x3eeec1[_0x9be7('0x1c')]],'as':_0x3eeec1['as'],'attributes':_0x3eeec1['attributes'],'include':_0x3eeec1[_0x9be7('0x1a')]?_[_0x9be7('0x1b')](_0x3eeec1[_0x9be7('0x1a')],function(_0x33b61d){return{'model':db[_0x33b61d[_0x9be7('0x1c')]],'as':_0x33b61d['as'],'attributes':_0x33b61d[_0x9be7('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9be7('0xb')](function(_0x599950){logger[_0x9be7('0xc')](_0x9be7('0x1e'),_0xc705c5);logger[_0x9be7('0xe')](_0x9be7('0x1e'),_0xc705c5,JSON[_0x9be7('0xf')](_0x599950));_0x268397(_0x599950);})['catch'](function(_0x37f880){logger['error']('ShowZohoAccount',_0x37f880['message'],_0xc705c5);_0x36da74(_0x32a7ec[_0x9be7('0x10')](0x1f4,_0x37f880[_0x9be7('0x12')]));});});};
\ No newline at end of file
index 7f10b4a..80def8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefe3=['get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','isAuthenticated'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xefe3,0xf5));var _0x3efe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xefe3[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x3efe('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3efe('0x1'));var router=express[_0x3efe('0x2')]();var auth=require(_0x3efe('0x3'));var interaction=require(_0x3efe('0x4'));var config=require('../../config/environment');var controller=require(_0x3efe('0x5'));router['get']('/',auth[_0x3efe('0x6')](),controller['index']);router[_0x3efe('0x7')](_0x3efe('0x8'),auth[_0x3efe('0x6')](),controller[_0x3efe('0x9')]);router[_0x3efe('0x7')](_0x3efe('0xa'),auth['isAuthenticated'](),controller[_0x3efe('0xb')]);router['get'](_0x3efe('0xc'),auth[_0x3efe('0x6')](),controller[_0x3efe('0xd')]);router[_0x3efe('0x7')](_0x3efe('0xe'),auth[_0x3efe('0x6')](),controller['getDescriptions']);router['post']('/',auth[_0x3efe('0x6')](),controller[_0x3efe('0xf')]);router[_0x3efe('0x10')](_0x3efe('0x8'),auth[_0x3efe('0x6')](),controller[_0x3efe('0x11')]);router[_0x3efe('0x12')](_0x3efe('0x8'),auth[_0x3efe('0x6')](),controller[_0x3efe('0x13')]);module[_0x3efe('0x14')]=router;
\ No newline at end of file
+var _0xa3b7=['put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create'];(function(_0x28ef15,_0x472398){var _0x2cad87=function(_0x23bf9d){while(--_0x23bf9d){_0x28ef15['push'](_0x28ef15['shift']());}};_0x2cad87(++_0x472398);}(_0xa3b7,0xe6));var _0x7a3b=function(_0x3815c2,_0x1f54e3){_0x3815c2=_0x3815c2-0x0;var _0x271f88=_0xa3b7[_0x3815c2];return _0x271f88;};'use strict';var multer=require(_0x7a3b('0x0'));var util=require('util');var path=require(_0x7a3b('0x1'));var timeout=require('connect-timeout');var express=require(_0x7a3b('0x2'));var router=express[_0x7a3b('0x3')]();var auth=require(_0x7a3b('0x4'));var interaction=require(_0x7a3b('0x5'));var config=require(_0x7a3b('0x6'));var controller=require(_0x7a3b('0x7'));router[_0x7a3b('0x8')]('/',auth['isAuthenticated'](),controller[_0x7a3b('0x9')]);router[_0x7a3b('0x8')](_0x7a3b('0xa'),auth[_0x7a3b('0xb')](),controller[_0x7a3b('0xc')]);router[_0x7a3b('0x8')](_0x7a3b('0xd'),auth['isAuthenticated'](),controller[_0x7a3b('0xe')]);router[_0x7a3b('0x8')](_0x7a3b('0xf'),auth[_0x7a3b('0xb')](),controller[_0x7a3b('0x10')]);router[_0x7a3b('0x8')]('/:id/descriptions',auth[_0x7a3b('0xb')](),controller[_0x7a3b('0x11')]);router[_0x7a3b('0x12')]('/',auth['isAuthenticated'](),controller[_0x7a3b('0x13')]);router[_0x7a3b('0x14')]('/:id',auth[_0x7a3b('0xb')](),controller[_0x7a3b('0x15')]);router[_0x7a3b('0x16')]('/:id',auth[_0x7a3b('0xb')](),controller[_0x7a3b('0x17')]);module[_0x7a3b('0x18')]=router;
\ No newline at end of file
index 1a9812d..22eaa94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe16f=['STRING','lead','contact','sequelize','exports'];(function(_0x4dc031,_0x5467dc){var _0x19437f=function(_0x3ebcac){while(--_0x3ebcac){_0x4dc031['push'](_0x4dc031['shift']());}};_0x19437f(++_0x5467dc);}(_0xe16f,0xbc));var _0xfe16=function(_0xe70d25,_0x4064e2){_0xe70d25=_0xe70d25-0x0;var _0x1cd1aa=_0xe16f[_0xe70d25];return _0x1cd1aa;};'use strict';var Sequelize=require(_0xfe16('0x0'));module[_0xfe16('0x1')]={'name':{'type':Sequelize[_0xfe16('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xfe16('0x3'),_0xfe16('0x4'),'nothing'),'defaultValue':_0xfe16('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0xfe16('0x4'),_0xfe16('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xcb51=['lead','contact','nothing','contact_lead','sequelize','exports','STRING','ENUM'];(function(_0x36380b,_0x2515ff){var _0x61baa3=function(_0x16e1c4){while(--_0x16e1c4){_0x36380b['push'](_0x36380b['shift']());}};_0x61baa3(++_0x2515ff);}(_0xcb51,0x1a4));var _0x1cb5=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xcb51[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0x1cb5('0x0'));module[_0x1cb5('0x1')]={'name':{'type':Sequelize[_0x1cb5('0x2')]},'moduleCreate':{'type':Sequelize[_0x1cb5('0x3')](_0x1cb5('0x4'),_0x1cb5('0x5'),_0x1cb5('0x6')),'defaultValue':_0x1cb5('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x1cb5('0x7'),_0x1cb5('0x5'),_0x1cb5('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x1cb5('0x2')]}};
\ No newline at end of file
index ac91170..fe75fa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00a7=['fields','where','pick','merge','type','VIRTUAL','filter','options','count','includeAll','rows','show','find','create','body','update','getFields','findOne','length','sort','hasOwnProperty','nolimit','getSubjects','params','ZohoField','order','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','then','destroy','name','send','index','ZohoConfiguration','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes'];(function(_0x380e79,_0x3217a2){var _0x38646d=function(_0x14e1b7){while(--_0x14e1b7){_0x380e79['push'](_0x380e79['shift']());}};_0x38646d(++_0x3217a2);}(_0x00a7,0x132));var _0x700a=function(_0x13c8e4,_0x173c5c){_0x13c8e4=_0x13c8e4-0x0;var _0x32b027=_0x00a7[_0x13c8e4];return _0x32b027;};'use strict';var pdf=require(_0x700a('0x0'));var emlformat=require(_0x700a('0x1'));var rimraf=require(_0x700a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x700a('0x3'));var rp=require(_0x700a('0x4'));var moment=require(_0x700a('0x5'));var BPromise=require(_0x700a('0x6'));var Mustache=require(_0x700a('0x7'));var util=require(_0x700a('0x8'));var path=require(_0x700a('0x9'));var sox=require(_0x700a('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x700a('0xb'));var squel=require(_0x700a('0xc'));var crypto=require(_0x700a('0xd'));var jsforce=require(_0x700a('0xe'));var deskjs=require(_0x700a('0xf'));var toCsv=require(_0x700a('0x10'));var querystring=require('querystring');var Papa=require(_0x700a('0x11'));var Redis=require(_0x700a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x700a('0x13'));var as=require(_0x700a('0x14'));var hardwareService=require(_0x700a('0x15'));var logger=require(_0x700a('0x16'))(_0x700a('0x17'));var utils=require(_0x700a('0x18'));var config=require(_0x700a('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0x700a('0x1a'));var client=jayson['client'][_0x700a('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x381850,_0x166f07,_0x4a4215){if(_0x4a4215){var _0xdf9ee1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xdf9ee1[_0x700a('0x1c')](_0x166f07)){return _0x381850;}else{throw new db['Sequelize'][(_0x700a('0x1d'))](_0x700a('0x1e'));}}else{return _0x381850;}}function respondWithRpcPromise(_0x2a4d3f,_0x3572ba,_0xdb4746,_0xcf6197){return new BPromise(function(_0x29d251,_0x20f6bb){var _0x3e22be=_0xcf6197||client;return _0x3e22be[_0x700a('0x1f')](_0x2a4d3f,_0xdb4746)['then'](function(_0x10099c){logger[_0x700a('0x20')](_0x700a('0x21'),_0x3572ba,_0x700a('0x22'));logger[_0x700a('0x23')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3572ba,_0x700a('0x22'),JSON[_0x700a('0x24')](_0x10099c));if(_0x10099c['error']){if(_0x10099c[_0x700a('0x25')][_0x700a('0x26')]===0x1f4){logger[_0x700a('0x25')](_0x700a('0x21'),_0x3572ba,_0x10099c[_0x700a('0x25')][_0x700a('0x27')]);return _0x20f6bb(_0x10099c[_0x700a('0x25')][_0x700a('0x27')]);}logger['error'](_0x700a('0x21'),_0x3572ba,_0x10099c[_0x700a('0x25')]['message']);return _0x29d251(_0x10099c[_0x700a('0x25')][_0x700a('0x27')]);}else{logger[_0x700a('0x20')](_0x700a('0x21'),_0x3572ba,_0x700a('0x22'));_0x29d251(_0x10099c[_0x700a('0x28')]['message']);}})[_0x700a('0x29')](function(_0x2b2948){logger['error'](_0x700a('0x21'),_0x3572ba,_0x2b2948);_0x20f6bb(_0x2b2948);});});}function respondWithStatusCode(_0x1e7ca6,_0x161071){_0x161071=_0x161071||0xcc;return function(_0x48b539){if(_0x48b539){return _0x1e7ca6[_0x700a('0x2a')](_0x161071);}return _0x1e7ca6[_0x700a('0x2b')](_0x161071)['end']();};}function respondWithResult(_0x493d07,_0x250d40){_0x250d40=_0x250d40||0xc8;return function(_0x30dd50){if(_0x30dd50){return _0x493d07['status'](_0x250d40)[_0x700a('0x2c')](_0x30dd50);}};}function respondWithFilteredResult(_0x273d09,_0x5019b5){return function(_0x1ceeba){if(_0x1ceeba){var _0x438c3a=_0x1ceeba['count'],_0x4be580=_0x5019b5[_0x700a('0x2d')],_0x3fae27=_0x5019b5['offset']+_0x5019b5[_0x700a('0x2e')],_0x5571bf;if(_0x3fae27>=_0x438c3a){_0x3fae27=_0x438c3a;_0x5571bf=0xc8;}else{_0x5571bf=0xce;}_0x273d09['status'](_0x5571bf);return _0x273d09[_0x700a('0x2f')](_0x700a('0x30'),_0x4be580+'-'+_0x3fae27+'/'+_0x438c3a)['json'](_0x1ceeba);}return null;};}function patchUpdates(_0xad10fb){return function(_0x337249){try{jsonpatch[_0x700a('0x31')](_0x337249,_0xad10fb,!![]);}catch(_0x260a70){return BPromise['reject'](_0x260a70);}return _0x337249[_0x700a('0x32')]();};}function saveUpdates(_0x52669a,_0x49f93a){return function(_0x3e1097){if(_0x3e1097){return _0x3e1097['update'](_0x52669a)[_0x700a('0x33')](function(_0x5bc42e){return _0x5bc42e;});}return null;};}function removeEntity(_0x5566cb,_0x311e4f){return function(_0x43ebb7){if(_0x43ebb7){return _0x43ebb7[_0x700a('0x34')]()['then'](function(){_0x5566cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x596207,_0x50b3e6){return function(_0x505225){if(!_0x505225){_0x596207[_0x700a('0x2a')](0x194);}return _0x505225;};}function handleError(_0x5d8ecd,_0x14c54a){_0x14c54a=_0x14c54a||0x1f4;return function(_0x9e2fc0){logger[_0x700a('0x25')](_0x9e2fc0['stack']);if(_0x9e2fc0[_0x700a('0x35')]){delete _0x9e2fc0[_0x700a('0x35')];}_0x5d8ecd['status'](_0x14c54a)[_0x700a('0x36')](_0x9e2fc0);};}exports[_0x700a('0x37')]=function(_0x21d1e6,_0x3da43a){var _0x3a5485={},_0xfd0518={},_0x167842={'count':0x0,'rows':[]};var _0x560db4=_['map'](db[_0x700a('0x38')][_0x700a('0x39')],function(_0x27fa41){return{'name':_0x27fa41[_0x700a('0x3a')],'type':_0x27fa41['type']['key']};});_0xfd0518[_0x700a('0x3b')]=_[_0x700a('0x3c')](_0x560db4,_0x700a('0x35'));_0xfd0518[_0x700a('0x3d')]=_[_0x700a('0x3e')](_0x21d1e6[_0x700a('0x3d')]);_0xfd0518[_0x700a('0x3f')]=_[_0x700a('0x40')](_0xfd0518[_0x700a('0x3b')],_0xfd0518['query']);_0x3a5485[_0x700a('0x41')]=_[_0x700a('0x40')](_0xfd0518[_0x700a('0x3b')],qs[_0x700a('0x42')](_0x21d1e6['query'][_0x700a('0x42')]));_0x3a5485['attributes']=_0x3a5485['attributes']['length']?_0x3a5485[_0x700a('0x41')]:_0xfd0518[_0x700a('0x3b')];if(!_0x21d1e6[_0x700a('0x3d')]['hasOwnProperty']('nolimit')){_0x3a5485['limit']=qs[_0x700a('0x2e')](_0x21d1e6[_0x700a('0x3d')][_0x700a('0x2e')]);_0x3a5485[_0x700a('0x2d')]=qs[_0x700a('0x2d')](_0x21d1e6[_0x700a('0x3d')][_0x700a('0x2d')]);}_0x3a5485['order']=qs['sort'](_0x21d1e6[_0x700a('0x3d')]['sort']);_0x3a5485[_0x700a('0x43')]=qs[_0x700a('0x3f')](_[_0x700a('0x44')](_0x21d1e6[_0x700a('0x3d')],_0xfd0518['filters']),_0x560db4);if(_0x21d1e6[_0x700a('0x3d')]['filter']){_0x3a5485[_0x700a('0x43')]=_[_0x700a('0x45')](_0x3a5485[_0x700a('0x43')],{'$or':_[_0x700a('0x3c')](_0x560db4,function(_0x3044d0){if(_0x3044d0[_0x700a('0x46')]!==_0x700a('0x47')){var _0x1dad7e={};_0x1dad7e[_0x3044d0[_0x700a('0x35')]]={'$like':'%'+_0x21d1e6['query'][_0x700a('0x48')]+'%'};return _0x1dad7e;}})});}_0x3a5485=_[_0x700a('0x45')]({},_0x3a5485,_0x21d1e6[_0x700a('0x49')]);var _0x3005bd={'where':_0x3a5485[_0x700a('0x43')]};return db[_0x700a('0x38')][_0x700a('0x4a')](_0x3005bd)[_0x700a('0x33')](function(_0x235670){_0x167842[_0x700a('0x4a')]=_0x235670;if(_0x21d1e6[_0x700a('0x3d')][_0x700a('0x4b')]){_0x3a5485['include']=[{'all':!![]}];}return db[_0x700a('0x38')]['findAll'](_0x3a5485);})[_0x700a('0x33')](function(_0x5d60d1){_0x167842[_0x700a('0x4c')]=_0x5d60d1;return _0x167842;})[_0x700a('0x33')](respondWithFilteredResult(_0x3da43a,_0x3a5485))[_0x700a('0x29')](handleError(_0x3da43a,null));};exports[_0x700a('0x4d')]=function(_0x3108d5,_0x33d59a){var _0x2f21b8={'raw':![],'where':{'id':_0x3108d5['params']['id']}},_0x567ed7={};_0x567ed7['model']=_[_0x700a('0x3e')](db['ZohoConfiguration']['rawAttributes']);_0x567ed7[_0x700a('0x3d')]=_[_0x700a('0x3e')](_0x3108d5[_0x700a('0x3d')]);_0x567ed7[_0x700a('0x3f')]=_[_0x700a('0x40')](_0x567ed7['model'],_0x567ed7['query']);_0x2f21b8[_0x700a('0x41')]=_[_0x700a('0x40')](_0x567ed7['model'],qs[_0x700a('0x42')](_0x3108d5[_0x700a('0x3d')][_0x700a('0x42')]));_0x2f21b8[_0x700a('0x41')]=_0x2f21b8[_0x700a('0x41')]['length']?_0x2f21b8['attributes']:_0x567ed7['model'];if(_0x3108d5[_0x700a('0x3d')][_0x700a('0x4b')]){_0x2f21b8['include']=[{'all':!![]}];}_0x2f21b8=_[_0x700a('0x45')]({},_0x2f21b8,_0x3108d5[_0x700a('0x49')]);return db[_0x700a('0x38')][_0x700a('0x4e')](_0x2f21b8)[_0x700a('0x33')](handleEntityNotFound(_0x33d59a,null))[_0x700a('0x33')](respondWithResult(_0x33d59a,null))[_0x700a('0x29')](handleError(_0x33d59a,null));};exports['create']=function(_0x3c9f3a,_0x4cb8d7){return db[_0x700a('0x38')][_0x700a('0x4f')](_0x3c9f3a[_0x700a('0x50')],{})['then'](respondWithResult(_0x4cb8d7,0xc9))['catch'](handleError(_0x4cb8d7,null));};exports[_0x700a('0x51')]=function(_0x2b2870,_0x1f5b18){if(_0x2b2870[_0x700a('0x50')]['id']){delete _0x2b2870[_0x700a('0x50')]['id'];}return db[_0x700a('0x38')]['find']({'where':{'id':_0x2b2870['params']['id']}})[_0x700a('0x33')](handleEntityNotFound(_0x1f5b18,null))['then'](saveUpdates(_0x2b2870[_0x700a('0x50')],null))[_0x700a('0x33')](respondWithResult(_0x1f5b18,null))[_0x700a('0x29')](handleError(_0x1f5b18,null));};exports[_0x700a('0x34')]=function(_0x1b0578,_0x4a45ad){return db[_0x700a('0x38')][_0x700a('0x4e')]({'where':{'id':_0x1b0578['params']['id']}})[_0x700a('0x33')](handleEntityNotFound(_0x4a45ad,null))[_0x700a('0x33')](removeEntity(_0x4a45ad,null))[_0x700a('0x29')](handleError(_0x4a45ad,null));};exports[_0x700a('0x52')]=function(_0x1de5bf,_0x2c78ea,_0x140c03){var _0x2f03b9={};var _0x23dd5b={};var _0x158bbd;var _0x29e592;return db[_0x700a('0x38')][_0x700a('0x53')]({'where':{'id':_0x1de5bf['params']['id']}})[_0x700a('0x33')](handleEntityNotFound(_0x2c78ea,null))[_0x700a('0x33')](function(_0x449f42){if(_0x449f42){_0x158bbd=_0x449f42;_0x23dd5b[_0x700a('0x3b')]=_[_0x700a('0x3e')](db['ZohoField'][_0x700a('0x39')]);_0x23dd5b[_0x700a('0x3d')]=_[_0x700a('0x3e')](_0x1de5bf[_0x700a('0x3d')]);_0x23dd5b['filters']=_[_0x700a('0x40')](_0x23dd5b[_0x700a('0x3b')],_0x23dd5b[_0x700a('0x3d')]);_0x2f03b9[_0x700a('0x41')]=_[_0x700a('0x40')](_0x23dd5b[_0x700a('0x3b')],qs[_0x700a('0x42')](_0x1de5bf[_0x700a('0x3d')][_0x700a('0x42')]));_0x2f03b9['attributes']=_0x2f03b9[_0x700a('0x41')][_0x700a('0x54')]?_0x2f03b9['attributes']:_0x23dd5b[_0x700a('0x3b')];_0x2f03b9['order']=qs[_0x700a('0x55')](_0x1de5bf['query'][_0x700a('0x55')]);_0x2f03b9[_0x700a('0x43')]=qs[_0x700a('0x3f')](_[_0x700a('0x44')](_0x1de5bf[_0x700a('0x3d')],_0x23dd5b[_0x700a('0x3f')]));if(_0x1de5bf[_0x700a('0x3d')][_0x700a('0x48')]){_0x2f03b9[_0x700a('0x43')]=_[_0x700a('0x45')](_0x2f03b9[_0x700a('0x43')],{'$or':_[_0x700a('0x3c')](_0x2f03b9['attributes'],function(_0x490908){var _0x12005b={};_0x12005b[_0x490908]={'$like':'%'+_0x1de5bf[_0x700a('0x3d')]['filter']+'%'};return _0x12005b;})});}_0x2f03b9=_['merge']({},_0x2f03b9,_0x1de5bf[_0x700a('0x49')]);return _0x158bbd[_0x700a('0x52')](_0x2f03b9);}})[_0x700a('0x33')](function(_0x5357a6){if(_0x5357a6){_0x29e592=_0x5357a6[_0x700a('0x54')];if(!_0x1de5bf['query'][_0x700a('0x56')](_0x700a('0x57'))){_0x2f03b9[_0x700a('0x2e')]=qs['limit'](_0x1de5bf[_0x700a('0x3d')]['limit']);_0x2f03b9[_0x700a('0x2d')]=qs[_0x700a('0x2d')](_0x1de5bf[_0x700a('0x3d')][_0x700a('0x2d')]);}return _0x158bbd[_0x700a('0x52')](_0x2f03b9);}})[_0x700a('0x33')](function(_0x4f6f06){if(_0x4f6f06){return _0x4f6f06?{'count':_0x29e592,'rows':_0x4f6f06}:null;}})[_0x700a('0x33')](respondWithResult(_0x2c78ea,null))[_0x700a('0x29')](handleError(_0x2c78ea,null));};exports[_0x700a('0x58')]=function(_0x39e31e,_0x309738,_0x29e34f){var _0x1bb6fe={};var _0x12324e={};var _0x490ca2;var _0x14d8f9;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x39e31e[_0x700a('0x59')]['id']}})[_0x700a('0x33')](handleEntityNotFound(_0x309738,null))[_0x700a('0x33')](function(_0x5eb008){if(_0x5eb008){_0x490ca2=_0x5eb008;_0x12324e['model']=_[_0x700a('0x3e')](db[_0x700a('0x5a')][_0x700a('0x39')]);_0x12324e[_0x700a('0x3d')]=_['keys'](_0x39e31e[_0x700a('0x3d')]);_0x12324e['filters']=_['intersection'](_0x12324e[_0x700a('0x3b')],_0x12324e[_0x700a('0x3d')]);_0x1bb6fe[_0x700a('0x41')]=_[_0x700a('0x40')](_0x12324e[_0x700a('0x3b')],qs[_0x700a('0x42')](_0x39e31e['query'][_0x700a('0x42')]));_0x1bb6fe[_0x700a('0x41')]=_0x1bb6fe[_0x700a('0x41')][_0x700a('0x54')]?_0x1bb6fe[_0x700a('0x41')]:_0x12324e[_0x700a('0x3b')];_0x1bb6fe[_0x700a('0x5b')]=qs[_0x700a('0x55')](_0x39e31e[_0x700a('0x3d')][_0x700a('0x55')]);_0x1bb6fe[_0x700a('0x43')]=qs['filters'](_[_0x700a('0x44')](_0x39e31e[_0x700a('0x3d')],_0x12324e['filters']));if(_0x39e31e[_0x700a('0x3d')][_0x700a('0x48')]){_0x1bb6fe[_0x700a('0x43')]=_[_0x700a('0x45')](_0x1bb6fe[_0x700a('0x43')],{'$or':_[_0x700a('0x3c')](_0x1bb6fe[_0x700a('0x41')],function(_0x49c8cf){var _0x34d701={};_0x34d701[_0x49c8cf]={'$like':'%'+_0x39e31e[_0x700a('0x3d')]['filter']+'%'};return _0x34d701;})});}_0x1bb6fe=_[_0x700a('0x45')]({},_0x1bb6fe,_0x39e31e[_0x700a('0x49')]);return _0x490ca2[_0x700a('0x58')](_0x1bb6fe);}})['then'](function(_0x1e5790){if(_0x1e5790){_0x14d8f9=_0x1e5790[_0x700a('0x54')];if(!_0x39e31e[_0x700a('0x3d')]['hasOwnProperty'](_0x700a('0x57'))){_0x1bb6fe[_0x700a('0x2e')]=qs[_0x700a('0x2e')](_0x39e31e[_0x700a('0x3d')][_0x700a('0x2e')]);_0x1bb6fe['offset']=qs['offset'](_0x39e31e[_0x700a('0x3d')][_0x700a('0x2d')]);}return _0x490ca2[_0x700a('0x58')](_0x1bb6fe);}})[_0x700a('0x33')](function(_0x4086eb){if(_0x4086eb){return _0x4086eb?{'count':_0x14d8f9,'rows':_0x4086eb}:null;}})[_0x700a('0x33')](respondWithResult(_0x309738,null))[_0x700a('0x29')](handleError(_0x309738,null));};exports[_0x700a('0x5c')]=function(_0x275b3f,_0xc3e996,_0x4ab005){var _0xa18578={};var _0x264134={};var _0x600ff8;var _0x35bb96;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x275b3f[_0x700a('0x59')]['id']}})['then'](handleEntityNotFound(_0xc3e996,null))[_0x700a('0x33')](function(_0x5781a5){if(_0x5781a5){_0x600ff8=_0x5781a5;_0x264134[_0x700a('0x3b')]=_[_0x700a('0x3e')](db['ZohoField'][_0x700a('0x39')]);_0x264134['query']=_[_0x700a('0x3e')](_0x275b3f['query']);_0x264134[_0x700a('0x3f')]=_[_0x700a('0x40')](_0x264134[_0x700a('0x3b')],_0x264134['query']);_0xa18578['attributes']=_[_0x700a('0x40')](_0x264134['model'],qs[_0x700a('0x42')](_0x275b3f[_0x700a('0x3d')][_0x700a('0x42')]));_0xa18578[_0x700a('0x41')]=_0xa18578['attributes'][_0x700a('0x54')]?_0xa18578[_0x700a('0x41')]:_0x264134[_0x700a('0x3b')];_0xa18578[_0x700a('0x5b')]=qs[_0x700a('0x55')](_0x275b3f[_0x700a('0x3d')][_0x700a('0x55')]);_0xa18578[_0x700a('0x43')]=qs[_0x700a('0x3f')](_[_0x700a('0x44')](_0x275b3f[_0x700a('0x3d')],_0x264134[_0x700a('0x3f')]));if(_0x275b3f[_0x700a('0x3d')][_0x700a('0x48')]){_0xa18578[_0x700a('0x43')]=_[_0x700a('0x45')](_0xa18578[_0x700a('0x43')],{'$or':_[_0x700a('0x3c')](_0xa18578[_0x700a('0x41')],function(_0xc46234){var _0x5b1f00={};_0x5b1f00[_0xc46234]={'$like':'%'+_0x275b3f[_0x700a('0x3d')][_0x700a('0x48')]+'%'};return _0x5b1f00;})});}_0xa18578=_[_0x700a('0x45')]({},_0xa18578,_0x275b3f['options']);return _0x600ff8[_0x700a('0x5c')](_0xa18578);}})[_0x700a('0x33')](function(_0x1e9a3e){if(_0x1e9a3e){_0x35bb96=_0x1e9a3e[_0x700a('0x54')];if(!_0x275b3f[_0x700a('0x3d')][_0x700a('0x56')](_0x700a('0x57'))){_0xa18578[_0x700a('0x2e')]=qs[_0x700a('0x2e')](_0x275b3f[_0x700a('0x3d')][_0x700a('0x2e')]);_0xa18578[_0x700a('0x2d')]=qs[_0x700a('0x2d')](_0x275b3f['query']['offset']);}return _0x600ff8[_0x700a('0x5c')](_0xa18578);}})[_0x700a('0x33')](function(_0x2ecbf8){if(_0x2ecbf8){return _0x2ecbf8?{'count':_0x35bb96,'rows':_0x2ecbf8}:null;}})[_0x700a('0x33')](respondWithResult(_0xc3e996,null))['catch'](handleError(_0xc3e996,null));};
\ No newline at end of file
+var _0x9561=['type','VIRTUAL','options','ZohoConfiguration','includeAll','include','findAll','rows','keys','find','create','body','update','params','getFields','findOne','ZohoField','pick','getSubjects','order','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus','status','json','count','offset','limit','apply','reject','save','destroy','end','stack','name','send','index','map','rawAttributes','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x15de7e,_0x56bee3){var _0x37d74d=function(_0x4d44bc){while(--_0x4d44bc){_0x15de7e['push'](_0x15de7e['shift']());}};_0x37d74d(++_0x56bee3);}(_0x9561,0x18d));var _0x1956=function(_0x524bb0,_0x326327){_0x524bb0=_0x524bb0-0x0;var _0x2fb947=_0x9561[_0x524bb0];return _0x2fb947;};'use strict';var pdf=require(_0x1956('0x0'));var emlformat=require(_0x1956('0x1'));var rimraf=require(_0x1956('0x2'));var zipdir=require(_0x1956('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1956('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1956('0x5'));var util=require('util');var path=require(_0x1956('0x6'));var sox=require(_0x1956('0x7'));var csv=require('to-csv');var ejs=require(_0x1956('0x8'));var fs=require('fs');var _=require(_0x1956('0x9'));var squel=require(_0x1956('0xa'));var crypto=require(_0x1956('0xb'));var jsforce=require(_0x1956('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1956('0xd'));var querystring=require(_0x1956('0xe'));var Papa=require(_0x1956('0xf'));var Redis=require(_0x1956('0x10'));var authService=require(_0x1956('0x11'));var qs=require(_0x1956('0x12'));var as=require(_0x1956('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1956('0x14'));var config=require(_0x1956('0x15'));var db=require(_0x1956('0x16'))['db'];var jayson=require(_0x1956('0x17'));var client=jayson[_0x1956('0x18')][_0x1956('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2fa324,_0x401a92,_0x1aeb7d){if(_0x1aeb7d){var _0x3439f0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3439f0[_0x1956('0x1a')](_0x401a92)){return _0x2fa324;}else{throw new db[(_0x1956('0x1b'))][(_0x1956('0x1c'))](_0x1956('0x1d'));}}else{return _0x2fa324;}}function respondWithRpcPromise(_0x125d77,_0x4d411f,_0x4fefbe,_0x172d0f){return new BPromise(function(_0x5282c9,_0x43ee4b){var _0x3b76b2=_0x172d0f||client;return _0x3b76b2[_0x1956('0x1e')](_0x125d77,_0x4fefbe)[_0x1956('0x1f')](function(_0x3c88ac){logger[_0x1956('0x20')](_0x1956('0x21'),_0x4d411f,_0x1956('0x22'));logger[_0x1956('0x23')](_0x1956('0x24'),_0x4d411f,_0x1956('0x22'),JSON[_0x1956('0x25')](_0x3c88ac));if(_0x3c88ac['error']){if(_0x3c88ac['error'][_0x1956('0x26')]===0x1f4){logger[_0x1956('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x4d411f,_0x3c88ac[_0x1956('0x27')]['message']);return _0x43ee4b(_0x3c88ac[_0x1956('0x27')][_0x1956('0x28')]);}logger['error'](_0x1956('0x21'),_0x4d411f,_0x3c88ac[_0x1956('0x27')][_0x1956('0x28')]);return _0x5282c9(_0x3c88ac['error'][_0x1956('0x28')]);}else{logger[_0x1956('0x20')](_0x1956('0x21'),_0x4d411f,_0x1956('0x22'));_0x5282c9(_0x3c88ac['result'][_0x1956('0x28')]);}})[_0x1956('0x29')](function(_0x2163a5){logger[_0x1956('0x27')](_0x1956('0x21'),_0x4d411f,_0x2163a5);_0x43ee4b(_0x2163a5);});});}function respondWithStatusCode(_0x19209f,_0x4500d6){_0x4500d6=_0x4500d6||0xcc;return function(_0x34cba4){if(_0x34cba4){return _0x19209f[_0x1956('0x2a')](_0x4500d6);}return _0x19209f[_0x1956('0x2b')](_0x4500d6)['end']();};}function respondWithResult(_0x543b24,_0x148c90){_0x148c90=_0x148c90||0xc8;return function(_0x406531){if(_0x406531){return _0x543b24[_0x1956('0x2b')](_0x148c90)[_0x1956('0x2c')](_0x406531);}};}function respondWithFilteredResult(_0x152abf,_0x5420dc){return function(_0x45a38e){if(_0x45a38e){var _0x69e4d7=_0x45a38e[_0x1956('0x2d')],_0x1ec17c=_0x5420dc[_0x1956('0x2e')],_0x4cd3b2=_0x5420dc['offset']+_0x5420dc[_0x1956('0x2f')],_0x2f1fda;if(_0x4cd3b2>=_0x69e4d7){_0x4cd3b2=_0x69e4d7;_0x2f1fda=0xc8;}else{_0x2f1fda=0xce;}_0x152abf['status'](_0x2f1fda);return _0x152abf['set']('Content-Range',_0x1ec17c+'-'+_0x4cd3b2+'/'+_0x69e4d7)[_0x1956('0x2c')](_0x45a38e);}return null;};}function patchUpdates(_0x56d435){return function(_0x2065ba){try{jsonpatch[_0x1956('0x30')](_0x2065ba,_0x56d435,!![]);}catch(_0xf3a9a9){return BPromise[_0x1956('0x31')](_0xf3a9a9);}return _0x2065ba[_0x1956('0x32')]();};}function saveUpdates(_0x57804f,_0x275d21){return function(_0x48b8da){if(_0x48b8da){return _0x48b8da['update'](_0x57804f)[_0x1956('0x1f')](function(_0x1b7cc0){return _0x1b7cc0;});}return null;};}function removeEntity(_0x2f0a8c,_0x51e1cb){return function(_0x43ddf8){if(_0x43ddf8){return _0x43ddf8[_0x1956('0x33')]()['then'](function(){_0x2f0a8c['status'](0xcc)[_0x1956('0x34')]();});}};}function handleEntityNotFound(_0x550033,_0x1e03fe){return function(_0x29b725){if(!_0x29b725){_0x550033[_0x1956('0x2a')](0x194);}return _0x29b725;};}function handleError(_0x52add4,_0x58a2a6){_0x58a2a6=_0x58a2a6||0x1f4;return function(_0x32d336){logger[_0x1956('0x27')](_0x32d336[_0x1956('0x35')]);if(_0x32d336[_0x1956('0x36')]){delete _0x32d336[_0x1956('0x36')];}_0x52add4['status'](_0x58a2a6)[_0x1956('0x37')](_0x32d336);};}exports[_0x1956('0x38')]=function(_0x51d8df,_0x1aa2e1){var _0x5b73e8={},_0x2dd6d0={},_0x56d302={'count':0x0,'rows':[]};var _0xa32474=_[_0x1956('0x39')](db['ZohoConfiguration'][_0x1956('0x3a')],function(_0xdfc31d){return{'name':_0xdfc31d['fieldName'],'type':_0xdfc31d['type'][_0x1956('0x3b')]};});_0x2dd6d0['model']=_['map'](_0xa32474,_0x1956('0x36'));_0x2dd6d0['query']=_['keys'](_0x51d8df[_0x1956('0x3c')]);_0x2dd6d0[_0x1956('0x3d')]=_[_0x1956('0x3e')](_0x2dd6d0['model'],_0x2dd6d0[_0x1956('0x3c')]);_0x5b73e8[_0x1956('0x3f')]=_[_0x1956('0x3e')](_0x2dd6d0[_0x1956('0x40')],qs[_0x1956('0x41')](_0x51d8df[_0x1956('0x3c')][_0x1956('0x41')]));_0x5b73e8['attributes']=_0x5b73e8['attributes'][_0x1956('0x42')]?_0x5b73e8['attributes']:_0x2dd6d0[_0x1956('0x40')];if(!_0x51d8df['query'][_0x1956('0x43')](_0x1956('0x44'))){_0x5b73e8['limit']=qs[_0x1956('0x2f')](_0x51d8df['query'][_0x1956('0x2f')]);_0x5b73e8[_0x1956('0x2e')]=qs[_0x1956('0x2e')](_0x51d8df[_0x1956('0x3c')]['offset']);}_0x5b73e8['order']=qs[_0x1956('0x45')](_0x51d8df[_0x1956('0x3c')]['sort']);_0x5b73e8[_0x1956('0x46')]=qs[_0x1956('0x3d')](_['pick'](_0x51d8df['query'],_0x2dd6d0[_0x1956('0x3d')]),_0xa32474);if(_0x51d8df[_0x1956('0x3c')][_0x1956('0x47')]){_0x5b73e8[_0x1956('0x46')]=_[_0x1956('0x48')](_0x5b73e8[_0x1956('0x46')],{'$or':_[_0x1956('0x39')](_0xa32474,function(_0x3561d2){if(_0x3561d2[_0x1956('0x49')]!==_0x1956('0x4a')){var _0x43d97d={};_0x43d97d[_0x3561d2[_0x1956('0x36')]]={'$like':'%'+_0x51d8df[_0x1956('0x3c')]['filter']+'%'};return _0x43d97d;}})});}_0x5b73e8=_[_0x1956('0x48')]({},_0x5b73e8,_0x51d8df[_0x1956('0x4b')]);var _0x3924ca={'where':_0x5b73e8['where']};return db[_0x1956('0x4c')][_0x1956('0x2d')](_0x3924ca)[_0x1956('0x1f')](function(_0x393de4){_0x56d302[_0x1956('0x2d')]=_0x393de4;if(_0x51d8df['query'][_0x1956('0x4d')]){_0x5b73e8[_0x1956('0x4e')]=[{'all':!![]}];}return db[_0x1956('0x4c')][_0x1956('0x4f')](_0x5b73e8);})[_0x1956('0x1f')](function(_0x5106ba){_0x56d302[_0x1956('0x50')]=_0x5106ba;return _0x56d302;})[_0x1956('0x1f')](respondWithFilteredResult(_0x1aa2e1,_0x5b73e8))[_0x1956('0x29')](handleError(_0x1aa2e1,null));};exports['show']=function(_0x4c7d32,_0x16620f){var _0x262f46={'raw':![],'where':{'id':_0x4c7d32['params']['id']}},_0x5d3040={};_0x5d3040[_0x1956('0x40')]=_[_0x1956('0x51')](db[_0x1956('0x4c')]['rawAttributes']);_0x5d3040[_0x1956('0x3c')]=_[_0x1956('0x51')](_0x4c7d32[_0x1956('0x3c')]);_0x5d3040['filters']=_['intersection'](_0x5d3040[_0x1956('0x40')],_0x5d3040['query']);_0x262f46[_0x1956('0x3f')]=_[_0x1956('0x3e')](_0x5d3040[_0x1956('0x40')],qs['fields'](_0x4c7d32[_0x1956('0x3c')][_0x1956('0x41')]));_0x262f46[_0x1956('0x3f')]=_0x262f46[_0x1956('0x3f')][_0x1956('0x42')]?_0x262f46[_0x1956('0x3f')]:_0x5d3040['model'];if(_0x4c7d32[_0x1956('0x3c')][_0x1956('0x4d')]){_0x262f46['include']=[{'all':!![]}];}_0x262f46=_[_0x1956('0x48')]({},_0x262f46,_0x4c7d32[_0x1956('0x4b')]);return db[_0x1956('0x4c')][_0x1956('0x52')](_0x262f46)[_0x1956('0x1f')](handleEntityNotFound(_0x16620f,null))[_0x1956('0x1f')](respondWithResult(_0x16620f,null))['catch'](handleError(_0x16620f,null));};exports[_0x1956('0x53')]=function(_0x2dd933,_0x5e459a){return db[_0x1956('0x4c')]['create'](_0x2dd933[_0x1956('0x54')],{})[_0x1956('0x1f')](respondWithResult(_0x5e459a,0xc9))[_0x1956('0x29')](handleError(_0x5e459a,null));};exports[_0x1956('0x55')]=function(_0x10421d,_0x19fb8b){if(_0x10421d[_0x1956('0x54')]['id']){delete _0x10421d[_0x1956('0x54')]['id'];}return db[_0x1956('0x4c')][_0x1956('0x52')]({'where':{'id':_0x10421d[_0x1956('0x56')]['id']}})[_0x1956('0x1f')](handleEntityNotFound(_0x19fb8b,null))[_0x1956('0x1f')](saveUpdates(_0x10421d[_0x1956('0x54')],null))['then'](respondWithResult(_0x19fb8b,null))['catch'](handleError(_0x19fb8b,null));};exports[_0x1956('0x33')]=function(_0x553172,_0xcfc6d4){return db['ZohoConfiguration'][_0x1956('0x52')]({'where':{'id':_0x553172[_0x1956('0x56')]['id']}})['then'](handleEntityNotFound(_0xcfc6d4,null))[_0x1956('0x1f')](removeEntity(_0xcfc6d4,null))[_0x1956('0x29')](handleError(_0xcfc6d4,null));};exports[_0x1956('0x57')]=function(_0x359f71,_0x3b58be,_0x34471b){var _0x94f866={};var _0x1bcf48={};var _0x27fd19;var _0x47c8e0;return db[_0x1956('0x4c')][_0x1956('0x58')]({'where':{'id':_0x359f71[_0x1956('0x56')]['id']}})['then'](handleEntityNotFound(_0x3b58be,null))[_0x1956('0x1f')](function(_0x406211){if(_0x406211){_0x27fd19=_0x406211;_0x1bcf48[_0x1956('0x40')]=_[_0x1956('0x51')](db[_0x1956('0x59')]['rawAttributes']);_0x1bcf48[_0x1956('0x3c')]=_[_0x1956('0x51')](_0x359f71[_0x1956('0x3c')]);_0x1bcf48['filters']=_['intersection'](_0x1bcf48['model'],_0x1bcf48[_0x1956('0x3c')]);_0x94f866[_0x1956('0x3f')]=_[_0x1956('0x3e')](_0x1bcf48['model'],qs[_0x1956('0x41')](_0x359f71['query'][_0x1956('0x41')]));_0x94f866[_0x1956('0x3f')]=_0x94f866[_0x1956('0x3f')][_0x1956('0x42')]?_0x94f866[_0x1956('0x3f')]:_0x1bcf48[_0x1956('0x40')];_0x94f866['order']=qs[_0x1956('0x45')](_0x359f71[_0x1956('0x3c')][_0x1956('0x45')]);_0x94f866[_0x1956('0x46')]=qs[_0x1956('0x3d')](_[_0x1956('0x5a')](_0x359f71[_0x1956('0x3c')],_0x1bcf48['filters']));if(_0x359f71[_0x1956('0x3c')]['filter']){_0x94f866['where']=_[_0x1956('0x48')](_0x94f866[_0x1956('0x46')],{'$or':_[_0x1956('0x39')](_0x94f866[_0x1956('0x3f')],function(_0x384ce5){var _0x590f03={};_0x590f03[_0x384ce5]={'$like':'%'+_0x359f71['query'][_0x1956('0x47')]+'%'};return _0x590f03;})});}_0x94f866=_[_0x1956('0x48')]({},_0x94f866,_0x359f71[_0x1956('0x4b')]);return _0x27fd19[_0x1956('0x57')](_0x94f866);}})[_0x1956('0x1f')](function(_0x31fb7b){if(_0x31fb7b){_0x47c8e0=_0x31fb7b['length'];if(!_0x359f71[_0x1956('0x3c')][_0x1956('0x43')]('nolimit')){_0x94f866[_0x1956('0x2f')]=qs[_0x1956('0x2f')](_0x359f71[_0x1956('0x3c')]['limit']);_0x94f866['offset']=qs[_0x1956('0x2e')](_0x359f71[_0x1956('0x3c')][_0x1956('0x2e')]);}return _0x27fd19[_0x1956('0x57')](_0x94f866);}})[_0x1956('0x1f')](function(_0x76c344){if(_0x76c344){return _0x76c344?{'count':_0x47c8e0,'rows':_0x76c344}:null;}})['then'](respondWithResult(_0x3b58be,null))[_0x1956('0x29')](handleError(_0x3b58be,null));};exports[_0x1956('0x5b')]=function(_0x1b0545,_0x492f3f,_0x3d3aae){var _0x57ae7d={};var _0x2e8e46={};var _0x5d2b5b;var _0x5b9a6a;return db[_0x1956('0x4c')][_0x1956('0x58')]({'where':{'id':_0x1b0545[_0x1956('0x56')]['id']}})['then'](handleEntityNotFound(_0x492f3f,null))['then'](function(_0x560045){if(_0x560045){_0x5d2b5b=_0x560045;_0x2e8e46['model']=_[_0x1956('0x51')](db[_0x1956('0x59')][_0x1956('0x3a')]);_0x2e8e46[_0x1956('0x3c')]=_[_0x1956('0x51')](_0x1b0545[_0x1956('0x3c')]);_0x2e8e46[_0x1956('0x3d')]=_[_0x1956('0x3e')](_0x2e8e46[_0x1956('0x40')],_0x2e8e46['query']);_0x57ae7d[_0x1956('0x3f')]=_[_0x1956('0x3e')](_0x2e8e46[_0x1956('0x40')],qs[_0x1956('0x41')](_0x1b0545['query'][_0x1956('0x41')]));_0x57ae7d[_0x1956('0x3f')]=_0x57ae7d['attributes'][_0x1956('0x42')]?_0x57ae7d['attributes']:_0x2e8e46[_0x1956('0x40')];_0x57ae7d[_0x1956('0x5c')]=qs[_0x1956('0x45')](_0x1b0545[_0x1956('0x3c')]['sort']);_0x57ae7d[_0x1956('0x46')]=qs[_0x1956('0x3d')](_[_0x1956('0x5a')](_0x1b0545[_0x1956('0x3c')],_0x2e8e46[_0x1956('0x3d')]));if(_0x1b0545['query']['filter']){_0x57ae7d[_0x1956('0x46')]=_[_0x1956('0x48')](_0x57ae7d['where'],{'$or':_[_0x1956('0x39')](_0x57ae7d[_0x1956('0x3f')],function(_0x1c55f8){var _0x402930={};_0x402930[_0x1c55f8]={'$like':'%'+_0x1b0545[_0x1956('0x3c')][_0x1956('0x47')]+'%'};return _0x402930;})});}_0x57ae7d=_[_0x1956('0x48')]({},_0x57ae7d,_0x1b0545['options']);return _0x5d2b5b[_0x1956('0x5b')](_0x57ae7d);}})[_0x1956('0x1f')](function(_0x175e10){if(_0x175e10){_0x5b9a6a=_0x175e10['length'];if(!_0x1b0545[_0x1956('0x3c')]['hasOwnProperty'](_0x1956('0x44'))){_0x57ae7d[_0x1956('0x2f')]=qs[_0x1956('0x2f')](_0x1b0545[_0x1956('0x3c')][_0x1956('0x2f')]);_0x57ae7d['offset']=qs[_0x1956('0x2e')](_0x1b0545[_0x1956('0x3c')]['offset']);}return _0x5d2b5b[_0x1956('0x5b')](_0x57ae7d);}})[_0x1956('0x1f')](function(_0x135b04){if(_0x135b04){return _0x135b04?{'count':_0x5b9a6a,'rows':_0x135b04}:null;}})[_0x1956('0x1f')](respondWithResult(_0x492f3f,null))[_0x1956('0x29')](handleError(_0x492f3f,null));};exports[_0x1956('0x5d')]=function(_0x24aa32,_0x24f305,_0x194288){var _0x1a03e2={};var _0x3c3bcf={};var _0x1972ae;var _0x332307;return db[_0x1956('0x4c')][_0x1956('0x58')]({'where':{'id':_0x24aa32[_0x1956('0x56')]['id']}})[_0x1956('0x1f')](handleEntityNotFound(_0x24f305,null))[_0x1956('0x1f')](function(_0x2726b5){if(_0x2726b5){_0x1972ae=_0x2726b5;_0x3c3bcf['model']=_[_0x1956('0x51')](db[_0x1956('0x59')][_0x1956('0x3a')]);_0x3c3bcf[_0x1956('0x3c')]=_[_0x1956('0x51')](_0x24aa32[_0x1956('0x3c')]);_0x3c3bcf[_0x1956('0x3d')]=_['intersection'](_0x3c3bcf[_0x1956('0x40')],_0x3c3bcf['query']);_0x1a03e2[_0x1956('0x3f')]=_[_0x1956('0x3e')](_0x3c3bcf[_0x1956('0x40')],qs['fields'](_0x24aa32[_0x1956('0x3c')][_0x1956('0x41')]));_0x1a03e2[_0x1956('0x3f')]=_0x1a03e2[_0x1956('0x3f')][_0x1956('0x42')]?_0x1a03e2['attributes']:_0x3c3bcf['model'];_0x1a03e2[_0x1956('0x5c')]=qs[_0x1956('0x45')](_0x24aa32[_0x1956('0x3c')]['sort']);_0x1a03e2[_0x1956('0x46')]=qs[_0x1956('0x3d')](_[_0x1956('0x5a')](_0x24aa32['query'],_0x3c3bcf[_0x1956('0x3d')]));if(_0x24aa32[_0x1956('0x3c')]['filter']){_0x1a03e2[_0x1956('0x46')]=_[_0x1956('0x48')](_0x1a03e2[_0x1956('0x46')],{'$or':_[_0x1956('0x39')](_0x1a03e2[_0x1956('0x3f')],function(_0x2d94de){var _0x208165={};_0x208165[_0x2d94de]={'$like':'%'+_0x24aa32['query'][_0x1956('0x47')]+'%'};return _0x208165;})});}_0x1a03e2=_[_0x1956('0x48')]({},_0x1a03e2,_0x24aa32['options']);return _0x1972ae['getDescriptions'](_0x1a03e2);}})[_0x1956('0x1f')](function(_0x5e1bc5){if(_0x5e1bc5){_0x332307=_0x5e1bc5[_0x1956('0x42')];if(!_0x24aa32['query']['hasOwnProperty'](_0x1956('0x44'))){_0x1a03e2['limit']=qs[_0x1956('0x2f')](_0x24aa32[_0x1956('0x3c')][_0x1956('0x2f')]);_0x1a03e2[_0x1956('0x2e')]=qs[_0x1956('0x2e')](_0x24aa32[_0x1956('0x3c')][_0x1956('0x2e')]);}return _0x1972ae[_0x1956('0x5d')](_0x1a03e2);}})[_0x1956('0x1f')](function(_0x488c1b){if(_0x488c1b){return _0x488c1b?{'count':_0x332307,'rows':_0x488c1b}:null;}})[_0x1956('0x1f')](respondWithResult(_0x24f305,null))[_0x1956('0x29')](handleError(_0x24f305,null));};
\ No newline at end of file
index a4b9c55..5d5d107 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfef=['exports','define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5971d9,_0x5dcbcc){var _0x442b60=function(_0xb5d13f){while(--_0xb5d13f){_0x5971d9['push'](_0x5971d9['shift']());}};_0x442b60(++_0x5dcbcc);}(_0xcfef,0x118));var _0xfcfe=function(_0x562d0d,_0x17705c){_0x562d0d=_0x562d0d-0x0;var _0x237f8e=_0xcfef[_0x562d0d];return _0x237f8e;};'use strict';var _=require('lodash');var util=require(_0xfcfe('0x0'));var logger=require(_0xfcfe('0x1'))(_0xfcfe('0x2'));var moment=require(_0xfcfe('0x3'));var BPromise=require(_0xfcfe('0x4'));var rp=require(_0xfcfe('0x5'));var fs=require('fs');var path=require(_0xfcfe('0x6'));var rimraf=require(_0xfcfe('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0xfcfe('0x8')]=function(_0x40b7bb,_0x3407a1){return _0x40b7bb[_0xfcfe('0x9')](_0xfcfe('0xa'),attributes,{'tableName':_0xfcfe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x00cc=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash'];(function(_0x383dbb,_0x17d41b){var _0x6e8bde=function(_0x2740f1){while(--_0x2740f1){_0x383dbb['push'](_0x383dbb['shift']());}};_0x6e8bde(++_0x17d41b);}(_0x00cc,0x103));var _0xc00c=function(_0x2b5cf9,_0x3cb5c2){_0x2b5cf9=_0x2b5cf9-0x0;var _0x4d6f06=_0x00cc[_0x2b5cf9];return _0x4d6f06;};'use strict';var _=require(_0xc00c('0x0'));var util=require('util');var logger=require(_0xc00c('0x1'))(_0xc00c('0x2'));var moment=require(_0xc00c('0x3'));var BPromise=require(_0xc00c('0x4'));var rp=require(_0xc00c('0x5'));var fs=require('fs');var path=require(_0xc00c('0x6'));var rimraf=require(_0xc00c('0x7'));var config=require(_0xc00c('0x8'));var attributes=require(_0xc00c('0x9'));module[_0xc00c('0xa')]=function(_0x45947c,_0x7f3350){return _0x45947c[_0xc00c('0xb')](_0xc00c('0xc'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0841477..be1a88b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9404=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird'];(function(_0x84daaa,_0x5b68ac){var _0x4a6477=function(_0x1d9878){while(--_0x1d9878){_0x84daaa['push'](_0x84daaa['shift']());}};_0x4a6477(++_0x5b68ac);}(_0x9404,0x106));var _0x4940=function(_0x3412b3,_0x5a17f0){_0x3412b3=_0x3412b3-0x0;var _0x4930c8=_0x9404[_0x3412b3];return _0x4930c8;};'use strict';var _=require(_0x4940('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4940('0x1'));var rs=require(_0x4940('0x2'));var fs=require('fs');var Redis=require(_0x4940('0x3'));var db=require(_0x4940('0x4'))['db'];var utils=require(_0x4940('0x5'));var logger=require(_0x4940('0x6'))(_0x4940('0x7'));var config=require('../../config/environment');var jayson=require(_0x4940('0x8'));var client=jayson[_0x4940('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d387e,_0x3368cf,_0x3f14a4){return new BPromise(function(_0x4558e7,_0x4408ee){return client[_0x4940('0xa')](_0x4d387e,_0x3f14a4)[_0x4940('0xb')](function(_0x16c048){logger[_0x4940('0xc')](_0x4940('0xd'),_0x3368cf,_0x4940('0xe'));logger[_0x4940('0xf')](_0x4940('0x10'),_0x3368cf,_0x4940('0xe'),JSON[_0x4940('0x11')](_0x16c048));if(_0x16c048[_0x4940('0x12')]){if(_0x16c048['error'][_0x4940('0x13')]===0x1f4){logger[_0x4940('0x12')](_0x4940('0xd'),_0x3368cf,_0x16c048[_0x4940('0x12')]['message']);return _0x4408ee(_0x16c048[_0x4940('0x12')][_0x4940('0x14')]);}logger['error'](_0x4940('0xd'),_0x3368cf,_0x16c048[_0x4940('0x12')][_0x4940('0x14')]);return _0x4558e7(_0x16c048['error'][_0x4940('0x14')]);}else{logger['info'](_0x4940('0xd'),_0x3368cf,'request\x20sent');_0x4558e7(_0x16c048['result'][_0x4940('0x14')]);}})[_0x4940('0x15')](function(_0x570048){logger[_0x4940('0x12')](_0x4940('0xd'),_0x3368cf,_0x570048);_0x4408ee(_0x570048);});});}
\ No newline at end of file
+var _0xa98e=['request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3e77ba,_0x19c4a6){var _0x363fc1=function(_0x293356){while(--_0x293356){_0x3e77ba['push'](_0x3e77ba['shift']());}};_0x363fc1(++_0x19c4a6);}(_0xa98e,0x137));var _0xea98=function(_0x3a5c4e,_0xe94030){_0x3a5c4e=_0x3a5c4e-0x0;var _0x156fce=_0xa98e[_0x3a5c4e];return _0x156fce;};'use strict';var _=require(_0xea98('0x0'));var util=require(_0xea98('0x1'));var moment=require('moment');var BPromise=require(_0xea98('0x2'));var rs=require(_0xea98('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea98('0x4'))['db'];var utils=require(_0xea98('0x5'));var logger=require(_0xea98('0x6'))(_0xea98('0x7'));var config=require('../../config/environment');var jayson=require(_0xea98('0x8'));var client=jayson[_0xea98('0x9')][_0xea98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53d4c9,_0x234170,_0x1261a9){return new BPromise(function(_0xdd8e9d,_0x181e82){return client[_0xea98('0xb')](_0x53d4c9,_0x1261a9)[_0xea98('0xc')](function(_0x318445){logger[_0xea98('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x234170,_0xea98('0xe'));logger[_0xea98('0xf')](_0xea98('0x10'),_0x234170,'request\x20sent',JSON[_0xea98('0x11')](_0x318445));if(_0x318445[_0xea98('0x12')]){if(_0x318445[_0xea98('0x12')]['code']===0x1f4){logger['error'](_0xea98('0x13'),_0x234170,_0x318445['error'][_0xea98('0x14')]);return _0x181e82(_0x318445[_0xea98('0x12')][_0xea98('0x14')]);}logger[_0xea98('0x12')](_0xea98('0x13'),_0x234170,_0x318445['error']['message']);return _0xdd8e9d(_0x318445[_0xea98('0x12')][_0xea98('0x14')]);}else{logger[_0xea98('0xd')](_0xea98('0x13'),_0x234170,'request\x20sent');_0xdd8e9d(_0x318445[_0xea98('0x15')][_0xea98('0x14')]);}})[_0xea98('0x16')](function(_0x2425ab){logger[_0xea98('0x12')](_0xea98('0x13'),_0x234170,_0x2425ab);_0x181e82(_0x2425ab);});});}
\ No newline at end of file
index 54f02a3..dc041ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','show','post','put','/:id','update'];(function(_0x5a766f,_0x135d23){var _0xebfcf3=function(_0x1d5bb5){while(--_0x1d5bb5){_0x5a766f['push'](_0x5a766f['shift']());}};_0xebfcf3(++_0x135d23);}(_0xb016,0x159));var _0x6b01=function(_0x52db2a,_0x1c4dda){_0x52db2a=_0x52db2a-0x0;var _0x33a894=_0xb016[_0x52db2a];return _0x33a894;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var auth=require(_0x6b01('0x3'));var interaction=require(_0x6b01('0x4'));var config=require(_0x6b01('0x5'));var controller=require(_0x6b01('0x6'));router['get']('/',auth[_0x6b01('0x7')](),controller[_0x6b01('0x8')]);router[_0x6b01('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6b01('0xa')]);router[_0x6b01('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6b01('0xc')](_0x6b01('0xd'),auth[_0x6b01('0x7')](),controller[_0x6b01('0xe')]);router[_0x6b01('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6b01('0x10')]);module[_0x6b01('0x11')]=router;
\ No newline at end of file
+var _0xe820=['create','put','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','isAuthenticated','index','get','/:id','post'];(function(_0x4ce734,_0x27fe15){var _0x5f3c38=function(_0x50ec11){while(--_0x50ec11){_0x4ce734['push'](_0x4ce734['shift']());}};_0x5f3c38(++_0x27fe15);}(_0xe820,0xd2));var _0x0e82=function(_0x9039d,_0x3c35e2){_0x9039d=_0x9039d-0x0;var _0x4c995e=_0xe820[_0x9039d];return _0x4c995e;};'use strict';var multer=require(_0x0e82('0x0'));var util=require('util');var path=require(_0x0e82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0e82('0x2')]();var auth=require(_0x0e82('0x3'));var interaction=require(_0x0e82('0x4'));var config=require('../../config/environment');var controller=require(_0x0e82('0x5'));router['get']('/',auth[_0x0e82('0x6')](),controller[_0x0e82('0x7')]);router[_0x0e82('0x8')](_0x0e82('0x9'),auth[_0x0e82('0x6')](),controller['show']);router[_0x0e82('0xa')]('/',auth[_0x0e82('0x6')](),controller[_0x0e82('0xb')]);router[_0x0e82('0xc')](_0x0e82('0x9'),auth['isAuthenticated'](),controller[_0x0e82('0xd')]);router[_0x0e82('0xe')](_0x0e82('0x9'),auth[_0x0e82('0x6')](),controller[_0x0e82('0xf')]);module[_0x0e82('0x10')]=router;
\ No newline at end of file
index d2f7c01..22b4934 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da7=['exports','ENUM','customVariable','keyValue','STRING','string','variable','BOOLEAN','sequelize'];(function(_0x27e892,_0x11f9a2){var _0x21b8ee=function(_0x356d79){while(--_0x356d79){_0x27e892['push'](_0x27e892['shift']());}};_0x21b8ee(++_0x11f9a2);}(_0x7da7,0x10d));var _0x77da=function(_0x4191bc,_0x3096c5){_0x4191bc=_0x4191bc-0x0;var _0x1ffd4e=_0x7da7[_0x4191bc];return _0x1ffd4e;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'type':{'type':Sequelize[_0x77da('0x2')]('string','variable',_0x77da('0x3'),_0x77da('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x77da('0x5')]},'key':{'type':Sequelize[_0x77da('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x77da('0x6'),_0x77da('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x77da('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x77da('0x5')]},'customField':{'type':Sequelize[_0x77da('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x77da('0x5')]}};
\ No newline at end of file
+var _0xa234=['ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x4fb4ff,_0x5ac6a3){var _0x22f51a=function(_0x2d43e4){while(--_0x2d43e4){_0x4fb4ff['push'](_0x4fb4ff['shift']());}};_0x22f51a(++_0x5ac6a3);}(_0xa234,0x142));var _0x4a23=function(_0x1c87c0,_0x7180c6){_0x1c87c0=_0x1c87c0-0x0;var _0x2974f4=_0xa234[_0x1c87c0];return _0x2974f4;};'use strict';var Sequelize=require(_0x4a23('0x0'));module[_0x4a23('0x1')]={'type':{'type':Sequelize[_0x4a23('0x2')](_0x4a23('0x3'),_0x4a23('0x4'),'customVariable',_0x4a23('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4a23('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4a23('0x2')](_0x4a23('0x3'),_0x4a23('0x4'),_0x4a23('0x7'))},'keyContent':{'type':Sequelize[_0x4a23('0x6')]},'idField':{'type':Sequelize[_0x4a23('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4a23('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4a23('0x6')]}};
\ No newline at end of file
index 5124149..b45420d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x3307bd,_0x256dbf){var _0x2561be=function(_0x3ebf){while(--_0x3ebf){_0x3307bd['push'](_0x3307bd['shift']());}};_0x2561be(++_0x256dbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x707646,_0x2d38e2){var _0x3e8113=function(_0x4a3be5){while(--_0x4a3be5){_0x707646['push'](_0x707646['shift']());}};_0x3e8113(++_0x2d38e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
index 6613209..7f00585 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8922=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','lodash','util','../../config/logger'];(function(_0x56cc0e,_0x86dae6){var _0x5482f5=function(_0x15b363){while(--_0x15b363){_0x56cc0e['push'](_0x56cc0e['shift']());}};_0x5482f5(++_0x86dae6);}(_0x8922,0xa2));var _0x2892=function(_0x415a23,_0x3f90db){_0x415a23=_0x415a23-0x0;var _0x4dffc9=_0x8922[_0x415a23];return _0x4dffc9;};'use strict';var _=require(_0x2892('0x0'));var util=require(_0x2892('0x1'));var logger=require(_0x2892('0x2'))(_0x2892('0x3'));var moment=require(_0x2892('0x4'));var BPromise=require(_0x2892('0x5'));var rp=require(_0x2892('0x6'));var fs=require('fs');var path=require(_0x2892('0x7'));var rimraf=require(_0x2892('0x8'));var config=require(_0x2892('0x9'));var attributes=require(_0x2892('0xa'));module[_0x2892('0xb')]=function(_0x100511,_0x268031){return _0x100511[_0x2892('0xc')](_0x2892('0xd'),attributes,{'tableName':_0x2892('0xe'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a11=['idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index'];(function(_0x5174f8,_0x5f1606){var _0x28e240=function(_0x480667){while(--_0x480667){_0x5174f8['push'](_0x5174f8['shift']());}};_0x28e240(++_0x5f1606);}(_0x5a11,0x182));var _0x15a1=function(_0x524181,_0x1df5f8){_0x524181=_0x524181-0x0;var _0x215776=_0x5a11[_0x524181];return _0x215776;};'use strict';var _=require(_0x15a1('0x0'));var util=require(_0x15a1('0x1'));var logger=require('../../config/logger')(_0x15a1('0x2'));var moment=require(_0x15a1('0x3'));var BPromise=require(_0x15a1('0x4'));var rp=require(_0x15a1('0x5'));var fs=require('fs');var path=require(_0x15a1('0x6'));var rimraf=require(_0x15a1('0x7'));var config=require(_0x15a1('0x8'));var attributes=require(_0x15a1('0x9'));module[_0x15a1('0xa')]=function(_0x30f62c,_0x1b83e8){return _0x30f62c[_0x15a1('0xb')](_0x15a1('0xc'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x15a1('0xd'),'fields':[_0x15a1('0xe'),_0x15a1('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index da8eaff..26a14b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd28=['error','code','message','info','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ZohoField,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x53a301,_0x213873){var _0x3ffcca=function(_0x27f530){while(--_0x27f530){_0x53a301['push'](_0x53a301['shift']());}};_0x3ffcca(++_0x213873);}(_0xfd28,0x148));var _0x8fd2=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xfd28[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0afc,_0x4bdc1a,_0x53d938){return new BPromise(function(_0x10fccf,_0x466c3d){return client[_0x8fd2('0xa')](_0x2f0afc,_0x53d938)['then'](function(_0x13cc69){logger['info'](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');logger[_0x8fd2('0xc')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x4bdc1a,_0x8fd2('0xd'),JSON['stringify'](_0x13cc69));if(_0x13cc69[_0x8fd2('0xe')]){if(_0x13cc69['error'][_0x8fd2('0xf')]===0x1f4){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x466c3d(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x10fccf(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}else{logger[_0x8fd2('0x11')](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');_0x10fccf(_0x13cc69[_0x8fd2('0x12')]['message']);}})['catch'](function(_0x56f75d){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x56f75d);_0x466c3d(_0x56f75d);});});}
\ No newline at end of file
+var _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','ZohoField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x29cc6f,_0x4c2bb4){var _0x3f317f=function(_0x3c8d08){while(--_0x3c8d08){_0x29cc6f['push'](_0x29cc6f['shift']());}};_0x3f317f(++_0x4c2bb4);}(_0x5fd1,0x155));var _0x15fd=function(_0x433d89,_0x41a765){_0x433d89=_0x433d89-0x0;var _0x260d70=_0x5fd1[_0x433d89];return _0x260d70;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('ZohoField,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});}
\ No newline at end of file
index 64de4b9..aa75ff5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3b6=['multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','exports'];(function(_0x2f8a7c,_0x3f65fd){var _0x257e01=function(_0x412826){while(--_0x412826){_0x2f8a7c['push'](_0x2f8a7c['shift']());}};_0x257e01(++_0x3f65fd);}(_0xe3b6,0x110));var _0x6e3b=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xe3b6[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x6e3b('0x0'));var util=require(_0x6e3b('0x1'));var path=require(_0x6e3b('0x2'));var timeout=require(_0x6e3b('0x3'));var express=require(_0x6e3b('0x4'));var router=express['Router']();var auth=require(_0x6e3b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6e3b('0x6'));module[_0x6e3b('0x7')]=router;
\ No newline at end of file
+var _0xf084=['../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','Router'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0xf084,0x183));var _0x4f08=function(_0x27467c,_0x5ecdbb){_0x27467c=_0x27467c-0x0;var _0x5e748b=_0xf084[_0x27467c];return _0x5e748b;};'use strict';var multer=require(_0x4f08('0x0'));var util=require(_0x4f08('0x1'));var path=require(_0x4f08('0x2'));var timeout=require(_0x4f08('0x3'));var express=require('express');var router=express[_0x4f08('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4f08('0x5'));var config=require(_0x4f08('0x6'));module[_0x4f08('0x7')]=router;
\ No newline at end of file
index 46dbc26..78696fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3afc=['unique_name_and_version','STRING','app.js','INTEGER','BOOLEAN','state','sequelize','exports'];(function(_0x180e11,_0x24bfb8){var _0x330930=function(_0x5be898){while(--_0x5be898){_0x180e11['push'](_0x180e11['shift']());}};_0x330930(++_0x24bfb8);}(_0x3afc,0x1ee));var _0xc3af=function(_0x2d20d8,_0x56d6d4){_0x2d20d8=_0x2d20d8-0x0;var _0x229c97=_0x3afc[_0x2d20d8];return _0x229c97;};'use strict';var Sequelize=require(_0xc3af('0x0'));module[_0xc3af('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc3af('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xc3af('0x3')],'defaultValue':_0xc3af('0x4')},'filename':{'type':Sequelize[_0xc3af('0x3')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xc3af('0x5')]},'active':{'type':Sequelize[_0xc3af('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xc3af('0x3')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xc3af('0x3')],'unique':_0xc3af('0x7')},'description':{'type':Sequelize[_0xc3af('0x3')]},'title':{'type':Sequelize[_0xc3af('0x3')]},'remoteUri':{'type':Sequelize[_0xc3af('0x3')]},'link':{'type':Sequelize[_0xc3af('0x3')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xdbaa=['sequelize','exports','STRING','unique_name_and_version','BOOLEAN','state'];(function(_0x36c542,_0x380c94){var _0x2db0e8=function(_0x10978a){while(--_0x10978a){_0x36c542['push'](_0x36c542['shift']());}};_0x2db0e8(++_0x380c94);}(_0xdbaa,0x19e));var _0xadba=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xdbaa[_0x45b034];return _0x509cb0;};'use strict';var Sequelize=require(_0xadba('0x0'));module[_0xadba('0x1')]={'name':{'type':Sequelize[_0xadba('0x2')],'allowNull':![],'unique':_0xadba('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xadba('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xadba('0x2')]},'path':{'type':Sequelize[_0xadba('0x2')]},'type':{'type':Sequelize[_0xadba('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xadba('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xadba('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xadba('0x2')],'unique':_0xadba('0x5')},'description':{'type':Sequelize[_0xadba('0x2')]},'title':{'type':Sequelize[_0xadba('0x2')]},'remoteUri':{'type':Sequelize[_0xadba('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
index 4677da0..b21f9b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06f7=['then','includeAll','findAll','catch','show','params','keys','include','find','create','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','error','stack','send','index','map','Integration','fieldName','type','key','filters','intersection','attributes','model','fields','length','query','hasOwnProperty','sort','where','pick','merge','VIRTUAL','name','filter','options'];(function(_0x38f990,_0x2e06a0){var _0x424491=function(_0x55dcc4){while(--_0x55dcc4){_0x38f990['push'](_0x38f990['shift']());}};_0x424491(++_0x2e06a0);}(_0x06f7,0x1aa));var _0x706f=function(_0x44e00a,_0x248bbc){_0x44e00a=_0x44e00a-0x0;var _0x2bdfba=_0x06f7[_0x44e00a];return _0x2bdfba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x706f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x706f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x706f('0x2'));var moment=require(_0x706f('0x3'));var BPromise=require(_0x706f('0x4'));var Mustache=require('mustache');var util=require(_0x706f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x706f('0x6'));var ejs=require(_0x706f('0x7'));var fs=require('fs');var _=require(_0x706f('0x8'));var squel=require(_0x706f('0x9'));var crypto=require(_0x706f('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x706f('0xb'));var Papa=require(_0x706f('0xc'));var Redis=require(_0x706f('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x706f('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x706f('0xf'));var logger=require(_0x706f('0x10'))('api');var utils=require(_0x706f('0x11'));var config=require(_0x706f('0x12'));var db=require(_0x706f('0x13'))['db'];function respondWithStatusCode(_0x26a4b3,_0x40c110){_0x40c110=_0x40c110||0xcc;return function(_0x4d49aa){if(_0x4d49aa){return _0x26a4b3[_0x706f('0x14')](_0x40c110);}return _0x26a4b3[_0x706f('0x15')](_0x40c110)[_0x706f('0x16')]();};}function respondWithResult(_0x28d0a1,_0x5b6a10){_0x5b6a10=_0x5b6a10||0xc8;return function(_0x50cdee){if(_0x50cdee){return _0x28d0a1['status'](_0x5b6a10)[_0x706f('0x17')](_0x50cdee);}};}function respondWithFilteredResult(_0x3f482a,_0x41a122){return function(_0x224f39){if(_0x224f39){var _0x303eeb=_0x224f39[_0x706f('0x18')],_0x275caf=_0x41a122[_0x706f('0x19')],_0x4fad14=_0x41a122[_0x706f('0x19')]+_0x41a122[_0x706f('0x1a')],_0x382576;if(_0x4fad14>=_0x303eeb){_0x4fad14=_0x303eeb;_0x382576=0xc8;}else{_0x382576=0xce;}_0x3f482a[_0x706f('0x15')](_0x382576);return _0x3f482a[_0x706f('0x1b')](_0x706f('0x1c'),_0x275caf+'-'+_0x4fad14+'/'+_0x303eeb)[_0x706f('0x17')](_0x224f39);}return null;};}function patchUpdates(_0x21e799){return function(_0x54f4dc){try{jsonpatch[_0x706f('0x1d')](_0x54f4dc,_0x21e799,!![]);}catch(_0x2710fc){return BPromise['reject'](_0x2710fc);}return _0x54f4dc[_0x706f('0x1e')]();};}function saveUpdates(_0x52720a,_0x46be92){return function(_0x2cc1e4){if(_0x2cc1e4){return _0x2cc1e4[_0x706f('0x1f')](_0x52720a)['then'](function(_0x5230db){return _0x5230db;});}return null;};}function removeEntity(_0x12dc27,_0x2c3127){return function(_0x2b87c9){if(_0x2b87c9){return _0x2b87c9['destroy']()['then'](function(){_0x12dc27[_0x706f('0x15')](0xcc)[_0x706f('0x16')]();});}};}function handleEntityNotFound(_0x1d8380,_0x366c4d){return function(_0x2f0808){if(!_0x2f0808){_0x1d8380['sendStatus'](0x194);}return _0x2f0808;};}function handleError(_0x26e73b,_0x12b953){_0x12b953=_0x12b953||0x1f4;return function(_0x22525d){logger[_0x706f('0x20')](_0x22525d[_0x706f('0x21')]);if(_0x22525d['name']){delete _0x22525d['name'];}_0x26e73b[_0x706f('0x15')](_0x12b953)[_0x706f('0x22')](_0x22525d);};}exports[_0x706f('0x23')]=function(_0xbf2049,_0x8c8972){var _0x57749b={},_0x2141c2={},_0x7f91e0={'count':0x0,'rows':[]};var _0x3448f5=_[_0x706f('0x24')](db[_0x706f('0x25')]['rawAttributes'],function(_0x8a6ea0){return{'name':_0x8a6ea0[_0x706f('0x26')],'type':_0x8a6ea0[_0x706f('0x27')][_0x706f('0x28')]};});_0x2141c2['model']=_[_0x706f('0x24')](_0x3448f5,'name');_0x2141c2['query']=_['keys'](_0xbf2049['query']);_0x2141c2[_0x706f('0x29')]=_[_0x706f('0x2a')](_0x2141c2['model'],_0x2141c2['query']);_0x57749b[_0x706f('0x2b')]=_[_0x706f('0x2a')](_0x2141c2[_0x706f('0x2c')],qs['fields'](_0xbf2049['query'][_0x706f('0x2d')]));_0x57749b[_0x706f('0x2b')]=_0x57749b['attributes'][_0x706f('0x2e')]?_0x57749b[_0x706f('0x2b')]:_0x2141c2['model'];if(!_0xbf2049[_0x706f('0x2f')][_0x706f('0x30')]('nolimit')){_0x57749b[_0x706f('0x1a')]=qs['limit'](_0xbf2049[_0x706f('0x2f')][_0x706f('0x1a')]);_0x57749b[_0x706f('0x19')]=qs['offset'](_0xbf2049[_0x706f('0x2f')][_0x706f('0x19')]);}_0x57749b['order']=qs[_0x706f('0x31')](_0xbf2049[_0x706f('0x2f')][_0x706f('0x31')]);_0x57749b[_0x706f('0x32')]=qs[_0x706f('0x29')](_[_0x706f('0x33')](_0xbf2049[_0x706f('0x2f')],_0x2141c2[_0x706f('0x29')]),_0x3448f5);if(_0xbf2049[_0x706f('0x2f')]['filter']){_0x57749b['where']=_[_0x706f('0x34')](_0x57749b['where'],{'$or':_[_0x706f('0x24')](_0x3448f5,function(_0x56f97d){if(_0x56f97d[_0x706f('0x27')]!==_0x706f('0x35')){var _0x12494e={};_0x12494e[_0x56f97d[_0x706f('0x36')]]={'$like':'%'+_0xbf2049[_0x706f('0x2f')][_0x706f('0x37')]+'%'};return _0x12494e;}})});}_0x57749b=_[_0x706f('0x34')]({},_0x57749b,_0xbf2049[_0x706f('0x38')]);var _0x1cff4d={'where':_0x57749b[_0x706f('0x32')]};return db['Integration']['count'](_0x1cff4d)[_0x706f('0x39')](function(_0x39055f){_0x7f91e0['count']=_0x39055f;if(_0xbf2049[_0x706f('0x2f')][_0x706f('0x3a')]){_0x57749b['include']=[{'all':!![]}];}return db[_0x706f('0x25')][_0x706f('0x3b')](_0x57749b);})['then'](function(_0x1ef091){_0x7f91e0['rows']=_0x1ef091;return _0x7f91e0;})[_0x706f('0x39')](respondWithFilteredResult(_0x8c8972,_0x57749b))[_0x706f('0x3c')](handleError(_0x8c8972,null));};exports[_0x706f('0x3d')]=function(_0x510ae3,_0x308512){var _0x29971f={'raw':![],'where':{'id':_0x510ae3[_0x706f('0x3e')]['id']}},_0x4182c1={};_0x4182c1[_0x706f('0x2c')]=_['keys'](db[_0x706f('0x25')]['rawAttributes']);_0x4182c1[_0x706f('0x2f')]=_[_0x706f('0x3f')](_0x510ae3[_0x706f('0x2f')]);_0x4182c1[_0x706f('0x29')]=_[_0x706f('0x2a')](_0x4182c1[_0x706f('0x2c')],_0x4182c1[_0x706f('0x2f')]);_0x29971f[_0x706f('0x2b')]=_[_0x706f('0x2a')](_0x4182c1[_0x706f('0x2c')],qs[_0x706f('0x2d')](_0x510ae3['query'][_0x706f('0x2d')]));_0x29971f[_0x706f('0x2b')]=_0x29971f[_0x706f('0x2b')]['length']?_0x29971f['attributes']:_0x4182c1['model'];if(_0x510ae3[_0x706f('0x2f')][_0x706f('0x3a')]){_0x29971f[_0x706f('0x40')]=[{'all':!![]}];}_0x29971f=_[_0x706f('0x34')]({},_0x29971f,_0x510ae3[_0x706f('0x38')]);return db['Integration'][_0x706f('0x41')](_0x29971f)['then'](handleEntityNotFound(_0x308512,null))[_0x706f('0x39')](respondWithResult(_0x308512,null))['catch'](handleError(_0x308512,null));};exports[_0x706f('0x42')]=function(_0x5836f9,_0x56fa33){return db[_0x706f('0x25')][_0x706f('0x42')](_0x5836f9[_0x706f('0x43')],{})[_0x706f('0x39')](respondWithResult(_0x56fa33,0xc9))['catch'](handleError(_0x56fa33,null));};exports['update']=function(_0x3e2a95,_0x4c2dbf){if(_0x3e2a95[_0x706f('0x43')]['id']){delete _0x3e2a95[_0x706f('0x43')]['id'];}return db[_0x706f('0x25')]['find']({'where':{'id':_0x3e2a95[_0x706f('0x3e')]['id']}})[_0x706f('0x39')](handleEntityNotFound(_0x4c2dbf,null))['then'](saveUpdates(_0x3e2a95['body'],null))[_0x706f('0x39')](respondWithResult(_0x4c2dbf,null))[_0x706f('0x3c')](handleError(_0x4c2dbf,null));};exports[_0x706f('0x44')]=function(_0x5b6437,_0x6a25cf){return db[_0x706f('0x25')][_0x706f('0x41')]({'where':{'id':_0x5b6437[_0x706f('0x3e')]['id']}})[_0x706f('0x39')](handleEntityNotFound(_0x6a25cf,null))[_0x706f('0x39')](removeEntity(_0x6a25cf,null))[_0x706f('0x3c')](handleError(_0x6a25cf,null));};
\ No newline at end of file
+var _0x9587=['path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','json','apply','save','then','destroy','error','stack','name','index','map','Integration','rawAttributes','type','key','query','keys','filters','model','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','update','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x2d62f6,_0x2b85f3){var _0x19f365=function(_0x51774d){while(--_0x51774d){_0x2d62f6['push'](_0x2d62f6['shift']());}};_0x19f365(++_0x2b85f3);}(_0x9587,0x1ea));var _0x7958=function(_0x5d96ec,_0x39248f){_0x5d96ec=_0x5d96ec-0x0;var _0x350f30=_0x9587[_0x5d96ec];return _0x350f30;};'use strict';var pdf=require(_0x7958('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7958('0x1'));var jsonpatch=require(_0x7958('0x2'));var rp=require(_0x7958('0x3'));var moment=require(_0x7958('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7958('0x5'));var util=require(_0x7958('0x6'));var path=require(_0x7958('0x7'));var sox=require(_0x7958('0x8'));var csv=require('to-csv');var ejs=require(_0x7958('0x9'));var fs=require('fs');var _=require(_0x7958('0xa'));var squel=require(_0x7958('0xb'));var crypto=require(_0x7958('0xc'));var jsforce=require(_0x7958('0xd'));var deskjs=require(_0x7958('0xe'));var toCsv=require(_0x7958('0xf'));var querystring=require('querystring');var Papa=require(_0x7958('0x10'));var Redis=require(_0x7958('0x11'));var authService=require(_0x7958('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7958('0x13'));var hardwareService=require(_0x7958('0x14'));var logger=require(_0x7958('0x15'))(_0x7958('0x16'));var utils=require(_0x7958('0x17'));var config=require(_0x7958('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5667e8,_0x4f06c7){_0x4f06c7=_0x4f06c7||0xcc;return function(_0x500d4b){if(_0x500d4b){return _0x5667e8[_0x7958('0x19')](_0x4f06c7);}return _0x5667e8[_0x7958('0x1a')](_0x4f06c7)[_0x7958('0x1b')]();};}function respondWithResult(_0x2b3886,_0x5757f1){_0x5757f1=_0x5757f1||0xc8;return function(_0x431bf3){if(_0x431bf3){return _0x2b3886[_0x7958('0x1a')](_0x5757f1)['json'](_0x431bf3);}};}function respondWithFilteredResult(_0x2d369e,_0x5ec35c){return function(_0x3cbf77){if(_0x3cbf77){var _0x190223=_0x3cbf77[_0x7958('0x1c')],_0x3fd4ad=_0x5ec35c[_0x7958('0x1d')],_0xaf495a=_0x5ec35c[_0x7958('0x1d')]+_0x5ec35c[_0x7958('0x1e')],_0x2a8026;if(_0xaf495a>=_0x190223){_0xaf495a=_0x190223;_0x2a8026=0xc8;}else{_0x2a8026=0xce;}_0x2d369e[_0x7958('0x1a')](_0x2a8026);return _0x2d369e['set']('Content-Range',_0x3fd4ad+'-'+_0xaf495a+'/'+_0x190223)[_0x7958('0x1f')](_0x3cbf77);}return null;};}function patchUpdates(_0xb4a7fd){return function(_0x44ede5){try{jsonpatch[_0x7958('0x20')](_0x44ede5,_0xb4a7fd,!![]);}catch(_0x41f9a2){return BPromise['reject'](_0x41f9a2);}return _0x44ede5[_0x7958('0x21')]();};}function saveUpdates(_0x15476c,_0x22dcd7){return function(_0x4da4fb){if(_0x4da4fb){return _0x4da4fb['update'](_0x15476c)[_0x7958('0x22')](function(_0xb08fb0){return _0xb08fb0;});}return null;};}function removeEntity(_0x55301b,_0x3938ca){return function(_0x4d9163){if(_0x4d9163){return _0x4d9163[_0x7958('0x23')]()[_0x7958('0x22')](function(){_0x55301b['status'](0xcc)[_0x7958('0x1b')]();});}};}function handleEntityNotFound(_0x2dedf1,_0x15d252){return function(_0x50ac81){if(!_0x50ac81){_0x2dedf1[_0x7958('0x19')](0x194);}return _0x50ac81;};}function handleError(_0x4d77e6,_0x2d6184){_0x2d6184=_0x2d6184||0x1f4;return function(_0x2cc3ba){logger[_0x7958('0x24')](_0x2cc3ba[_0x7958('0x25')]);if(_0x2cc3ba[_0x7958('0x26')]){delete _0x2cc3ba[_0x7958('0x26')];}_0x4d77e6[_0x7958('0x1a')](_0x2d6184)['send'](_0x2cc3ba);};}exports[_0x7958('0x27')]=function(_0x403ed2,_0x165b52){var _0x25d410={},_0x5dbb52={},_0x5e4034={'count':0x0,'rows':[]};var _0x4058a2=_[_0x7958('0x28')](db[_0x7958('0x29')][_0x7958('0x2a')],function(_0xf71485){return{'name':_0xf71485['fieldName'],'type':_0xf71485[_0x7958('0x2b')][_0x7958('0x2c')]};});_0x5dbb52['model']=_[_0x7958('0x28')](_0x4058a2,_0x7958('0x26'));_0x5dbb52[_0x7958('0x2d')]=_[_0x7958('0x2e')](_0x403ed2[_0x7958('0x2d')]);_0x5dbb52[_0x7958('0x2f')]=_['intersection'](_0x5dbb52[_0x7958('0x30')],_0x5dbb52['query']);_0x25d410[_0x7958('0x31')]=_['intersection'](_0x5dbb52[_0x7958('0x30')],qs[_0x7958('0x32')](_0x403ed2[_0x7958('0x2d')][_0x7958('0x32')]));_0x25d410[_0x7958('0x31')]=_0x25d410[_0x7958('0x31')][_0x7958('0x33')]?_0x25d410[_0x7958('0x31')]:_0x5dbb52[_0x7958('0x30')];if(!_0x403ed2[_0x7958('0x2d')]['hasOwnProperty']('nolimit')){_0x25d410[_0x7958('0x1e')]=qs[_0x7958('0x1e')](_0x403ed2['query']['limit']);_0x25d410[_0x7958('0x1d')]=qs['offset'](_0x403ed2[_0x7958('0x2d')][_0x7958('0x1d')]);}_0x25d410['order']=qs[_0x7958('0x34')](_0x403ed2[_0x7958('0x2d')]['sort']);_0x25d410[_0x7958('0x35')]=qs['filters'](_[_0x7958('0x36')](_0x403ed2[_0x7958('0x2d')],_0x5dbb52[_0x7958('0x2f')]),_0x4058a2);if(_0x403ed2['query'][_0x7958('0x37')]){_0x25d410['where']=_[_0x7958('0x38')](_0x25d410[_0x7958('0x35')],{'$or':_[_0x7958('0x28')](_0x4058a2,function(_0x3d0d88){if(_0x3d0d88[_0x7958('0x2b')]!==_0x7958('0x39')){var _0x15a1c0={};_0x15a1c0[_0x3d0d88[_0x7958('0x26')]]={'$like':'%'+_0x403ed2[_0x7958('0x2d')][_0x7958('0x37')]+'%'};return _0x15a1c0;}})});}_0x25d410=_[_0x7958('0x38')]({},_0x25d410,_0x403ed2[_0x7958('0x3a')]);var _0xa48d1f={'where':_0x25d410['where']};return db[_0x7958('0x29')][_0x7958('0x1c')](_0xa48d1f)[_0x7958('0x22')](function(_0xacbb3d){_0x5e4034[_0x7958('0x1c')]=_0xacbb3d;if(_0x403ed2['query'][_0x7958('0x3b')]){_0x25d410[_0x7958('0x3c')]=[{'all':!![]}];}return db[_0x7958('0x29')][_0x7958('0x3d')](_0x25d410);})['then'](function(_0x4d1cfc){_0x5e4034[_0x7958('0x3e')]=_0x4d1cfc;return _0x5e4034;})[_0x7958('0x22')](respondWithFilteredResult(_0x165b52,_0x25d410))[_0x7958('0x3f')](handleError(_0x165b52,null));};exports[_0x7958('0x40')]=function(_0x4378df,_0x250ccc){var _0x4ad1e4={'raw':![],'where':{'id':_0x4378df[_0x7958('0x41')]['id']}},_0x5a6a8d={};_0x5a6a8d[_0x7958('0x30')]=_[_0x7958('0x2e')](db[_0x7958('0x29')][_0x7958('0x2a')]);_0x5a6a8d['query']=_[_0x7958('0x2e')](_0x4378df['query']);_0x5a6a8d['filters']=_[_0x7958('0x42')](_0x5a6a8d[_0x7958('0x30')],_0x5a6a8d[_0x7958('0x2d')]);_0x4ad1e4['attributes']=_[_0x7958('0x42')](_0x5a6a8d[_0x7958('0x30')],qs[_0x7958('0x32')](_0x4378df[_0x7958('0x2d')][_0x7958('0x32')]));_0x4ad1e4[_0x7958('0x31')]=_0x4ad1e4[_0x7958('0x31')]['length']?_0x4ad1e4[_0x7958('0x31')]:_0x5a6a8d[_0x7958('0x30')];if(_0x4378df[_0x7958('0x2d')][_0x7958('0x3b')]){_0x4ad1e4[_0x7958('0x3c')]=[{'all':!![]}];}_0x4ad1e4=_[_0x7958('0x38')]({},_0x4ad1e4,_0x4378df['options']);return db[_0x7958('0x29')][_0x7958('0x43')](_0x4ad1e4)[_0x7958('0x22')](handleEntityNotFound(_0x250ccc,null))[_0x7958('0x22')](respondWithResult(_0x250ccc,null))[_0x7958('0x3f')](handleError(_0x250ccc,null));};exports['create']=function(_0x2a58c5,_0x21b378){return db['Integration'][_0x7958('0x44')](_0x2a58c5[_0x7958('0x45')],{})[_0x7958('0x22')](respondWithResult(_0x21b378,0xc9))[_0x7958('0x3f')](handleError(_0x21b378,null));};exports[_0x7958('0x46')]=function(_0x14b182,_0x7105c3){if(_0x14b182['body']['id']){delete _0x14b182[_0x7958('0x45')]['id'];}return db['Integration'][_0x7958('0x43')]({'where':{'id':_0x14b182['params']['id']}})['then'](handleEntityNotFound(_0x7105c3,null))[_0x7958('0x22')](saveUpdates(_0x14b182[_0x7958('0x45')],null))[_0x7958('0x22')](respondWithResult(_0x7105c3,null))[_0x7958('0x3f')](handleError(_0x7105c3,null));};exports[_0x7958('0x23')]=function(_0x4c3ccd,_0x1ed512){return db[_0x7958('0x29')]['find']({'where':{'id':_0x4c3ccd[_0x7958('0x41')]['id']}})[_0x7958('0x22')](handleEntityNotFound(_0x1ed512,null))[_0x7958('0x22')](removeEntity(_0x1ed512,null))[_0x7958('0x3f')](handleError(_0x1ed512,null));};
\ No newline at end of file
index bd18bd1..4532593 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dce=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger'];(function(_0x526d00,_0x30bd19){var _0x4cb88f=function(_0x2a90df){while(--_0x2a90df){_0x526d00['push'](_0x526d00['shift']());}};_0x4cb88f(++_0x30bd19);}(_0x4dce,0xdd));var _0xe4dc=function(_0x312abc,_0x17f25c){_0x312abc=_0x312abc-0x0;var _0x314298=_0x4dce[_0x312abc];return _0x314298;};'use strict';var _=require(_0xe4dc('0x0'));var util=require(_0xe4dc('0x1'));var logger=require(_0xe4dc('0x2'))('api');var moment=require(_0xe4dc('0x3'));var BPromise=require(_0xe4dc('0x4'));var rp=require(_0xe4dc('0x5'));var fs=require('fs');var path=require(_0xe4dc('0x6'));var rimraf=require(_0xe4dc('0x7'));var config=require(_0xe4dc('0x8'));var attributes=require(_0xe4dc('0x9'));module[_0xe4dc('0xa')]=function(_0xfa9db8,_0x111148){return _0xfa9db8[_0xe4dc('0xb')](_0xe4dc('0xc'),attributes,{'tableName':_0xe4dc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb042=['../../config/environment','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x875527,_0x2234fb){var _0x23c22c=function(_0x46e337){while(--_0x46e337){_0x875527['push'](_0x875527['shift']());}};_0x23c22c(++_0x2234fb);}(_0xb042,0x185));var _0x2b04=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0xb042[_0x4b4f24];return _0x1c13d4;};'use strict';var _=require(_0x2b04('0x0'));var util=require(_0x2b04('0x1'));var logger=require(_0x2b04('0x2'))(_0x2b04('0x3'));var moment=require(_0x2b04('0x4'));var BPromise=require('bluebird');var rp=require(_0x2b04('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b04('0x6'));var config=require(_0x2b04('0x7'));var attributes=require('./integration.attributes');module[_0x2b04('0x8')]=function(_0x3f05cf,_0xee217d){return _0x3f05cf[_0x2b04('0x9')](_0x2b04('0xa'),attributes,{'tableName':_0x2b04('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5f3930f..bdbd4bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3ea=['error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x42932c,_0x4ad0c7){var _0x50166f=function(_0x1d9562){while(--_0x1d9562){_0x42932c['push'](_0x42932c['shift']());}};_0x50166f(++_0x4ad0c7);}(_0xb3ea,0x10d));var _0xab3e=function(_0x32002f,_0x2dbe41){_0x32002f=_0x32002f-0x0;var _0x8688d0=_0xb3ea[_0x32002f];return _0x8688d0;};'use strict';var _=require(_0xab3e('0x0'));var util=require(_0xab3e('0x1'));var moment=require(_0xab3e('0x2'));var BPromise=require('bluebird');var rs=require(_0xab3e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab3e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xab3e('0x5'))(_0xab3e('0x6'));var config=require(_0xab3e('0x7'));var jayson=require(_0xab3e('0x8'));var client=jayson[_0xab3e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c0a3f,_0x4fecb7,_0x1026e7){return new BPromise(function(_0x6b6e2,_0x51482b){return client[_0xab3e('0xa')](_0x3c0a3f,_0x1026e7)[_0xab3e('0xb')](function(_0x5d8bab){logger[_0xab3e('0xc')](_0xab3e('0xd'),_0x4fecb7,'request\x20sent');logger['debug'](_0xab3e('0xe'),_0x4fecb7,_0xab3e('0xf'),JSON[_0xab3e('0x10')](_0x5d8bab));if(_0x5d8bab[_0xab3e('0x11')]){if(_0x5d8bab[_0xab3e('0x11')][_0xab3e('0x12')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x4fecb7,_0x5d8bab['error'][_0xab3e('0x13')]);return _0x51482b(_0x5d8bab[_0xab3e('0x11')][_0xab3e('0x13')]);}logger[_0xab3e('0x11')]('Integration,\x20%s,\x20%s',_0x4fecb7,_0x5d8bab[_0xab3e('0x11')]['message']);return _0x6b6e2(_0x5d8bab['error'][_0xab3e('0x13')]);}else{logger[_0xab3e('0xc')]('Integration,\x20%s,\x20%s',_0x4fecb7,_0xab3e('0xf'));_0x6b6e2(_0x5d8bab[_0xab3e('0x14')]['message']);}})[_0xab3e('0x15')](function(_0x516b1d){logger[_0xab3e('0x11')]('Integration,\x20%s,\x20%s',_0x4fecb7,_0x516b1d);_0x51482b(_0x516b1d);});});}
\ No newline at end of file
+var _0xccdc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','Integration,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis'];(function(_0x254a19,_0x7b092b){var _0xba020a=function(_0x231bb3){while(--_0x231bb3){_0x254a19['push'](_0x254a19['shift']());}};_0xba020a(++_0x7b092b);}(_0xccdc,0x1c4));var _0xcccd=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xccdc[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0xcccd('0x0'));var util=require(_0xcccd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcccd('0x2'));var fs=require('fs');var Redis=require(_0xcccd('0x3'));var db=require(_0xcccd('0x4'))['db'];var utils=require(_0xcccd('0x5'));var logger=require(_0xcccd('0x6'))(_0xcccd('0x7'));var config=require(_0xcccd('0x8'));var jayson=require(_0xcccd('0x9'));var client=jayson[_0xcccd('0xa')][_0xcccd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bd55e,_0x4cc734,_0x270368){return new BPromise(function(_0x1b8c05,_0x41ea2d){return client[_0xcccd('0xc')](_0x5bd55e,_0x270368)[_0xcccd('0xd')](function(_0x1d921f){logger[_0xcccd('0xe')]('Integration,\x20%s,\x20%s',_0x4cc734,_0xcccd('0xf'));logger[_0xcccd('0x10')](_0xcccd('0x11'),_0x4cc734,_0xcccd('0xf'),JSON[_0xcccd('0x12')](_0x1d921f));if(_0x1d921f[_0xcccd('0x13')]){if(_0x1d921f[_0xcccd('0x13')][_0xcccd('0x14')]===0x1f4){logger[_0xcccd('0x13')](_0xcccd('0x15'),_0x4cc734,_0x1d921f[_0xcccd('0x13')][_0xcccd('0x16')]);return _0x41ea2d(_0x1d921f[_0xcccd('0x13')][_0xcccd('0x16')]);}logger[_0xcccd('0x13')](_0xcccd('0x15'),_0x4cc734,_0x1d921f[_0xcccd('0x13')][_0xcccd('0x16')]);return _0x1b8c05(_0x1d921f['error']['message']);}else{logger[_0xcccd('0xe')](_0xcccd('0x15'),_0x4cc734,_0xcccd('0xf'));_0x1b8c05(_0x1d921f['result'][_0xcccd('0x16')]);}})[_0xcccd('0x17')](function(_0x1b3bd9){logger['error'](_0xcccd('0x15'),_0x4cc734,_0x1b3bd9);_0x41ea2d(_0x1b3bd9);});});}
\ No newline at end of file
index d537c5b..c185e1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d2d=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x189a9f,_0x1c2ef6){_0x189a9f=_0x189a9f-0x0;var _0xd65398=_0x1d2d[_0x189a9f];return _0xd65398;};'use strict';var multer=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var path=require(_0xd1d2('0x2'));var timeout=require(_0xd1d2('0x3'));var express=require(_0xd1d2('0x4'));var router=express['Router']();var auth=require(_0xd1d2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd1d2('0x6'));router[_0xd1d2('0x7')]('/',auth[_0xd1d2('0x8')](),controller[_0xd1d2('0x9')]);router[_0xd1d2('0x7')](_0xd1d2('0xa'),auth['isAuthenticated'](),controller[_0xd1d2('0xb')]);router[_0xd1d2('0x7')](_0xd1d2('0xc'),auth[_0xd1d2('0x8')](),controller[_0xd1d2('0xd')]);router[_0xd1d2('0xe')]('/',auth[_0xd1d2('0x8')](),controller[_0xd1d2('0xf')]);router[_0xd1d2('0x10')](_0xd1d2('0xc'),auth[_0xd1d2('0x8')](),controller[_0xd1d2('0x11')]);router[_0xd1d2('0x12')]('/:id',auth[_0xd1d2('0x8')](),controller[_0xd1d2('0x13')]);module[_0xd1d2('0x14')]=router;
\ No newline at end of file
+var _0x374e=['post','create','put','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x323c7e,_0x3d16ec){var _0x2b0f72=function(_0x5a2310){while(--_0x5a2310){_0x323c7e['push'](_0x323c7e['shift']());}};_0x2b0f72(++_0x3d16ec);}(_0x374e,0x146));var _0xe374=function(_0x196f87,_0x36d886){_0x196f87=_0x196f87-0x0;var _0xe3b035=_0x374e[_0x196f87];return _0xe3b035;};'use strict';var multer=require('multer');var util=require(_0xe374('0x0'));var path=require(_0xe374('0x1'));var timeout=require(_0xe374('0x2'));var express=require(_0xe374('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe374('0x4'));var config=require(_0xe374('0x5'));var controller=require(_0xe374('0x6'));router[_0xe374('0x7')]('/',auth[_0xe374('0x8')](),controller[_0xe374('0x9')]);router[_0xe374('0x7')](_0xe374('0xa'),auth[_0xe374('0x8')](),controller[_0xe374('0xb')]);router[_0xe374('0x7')](_0xe374('0xc'),auth['isAuthenticated'](),controller[_0xe374('0xd')]);router[_0xe374('0xe')]('/',auth[_0xe374('0x8')](),controller[_0xe374('0xf')]);router[_0xe374('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe374('0x11')](_0xe374('0xc'),auth[_0xe374('0x8')](),controller[_0xe374('0x12')]);module[_0xe374('0x13')]=router;
\ No newline at end of file
index 1ff7ce7..4486c2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1724=['BOOLEAN','DATE','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','STRING','INTEGER'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0x1724,0x147));var _0x4172=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x1724[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0x4172('0x0'));module['exports']={'integration':{'type':Sequelize[_0x4172('0x1')]},'eventChannel':{'type':Sequelize[_0x4172('0x1')]},'exitStatus':{'type':Sequelize[_0x4172('0x1')]},'ticketId':{'type':Sequelize[_0x4172('0x1')]},'integrationId':{'type':Sequelize[_0x4172('0x2')]},'contacts':{'type':Sequelize[_0x4172('0x1')]},'uniqueid':{'type':Sequelize[_0x4172('0x1')]},'calleridnum':{'type':Sequelize[_0x4172('0x1')]},'calleridname':{'type':Sequelize[_0x4172('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4172('0x1')]},'membername':{'type':Sequelize[_0x4172('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x4172('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x4172('0x2')]},'agentacw':{'type':Sequelize[_0x4172('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x4172('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4172('0x4')]},'agentdump':{'type':Sequelize[_0x4172('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4172('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4172('0x1')]},'channelstate':{'type':Sequelize[_0x4172('0x2')]},'channelstatedesc':{'type':Sequelize[_0x4172('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4172('0x1')]},'connectedlinename':{'type':Sequelize[_0x4172('0x1')]},'language':{'type':Sequelize[_0x4172('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4172('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x4172('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x4172('0x1')]},'destcalleridnum':{'type':Sequelize[_0x4172('0x1')]},'destcalleridname':{'type':Sequelize[_0x4172('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x4172('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x4172('0x1')]},'destlanguage':{'type':Sequelize[_0x4172('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x4172('0x1')]},'destexten':{'type':Sequelize[_0x4172('0x1')]},'destpriority':{'type':Sequelize[_0x4172('0x1')]},'destuniqueid':{'type':Sequelize[_0x4172('0x1')]},'messageId':{'type':Sequelize[_0x4172('0x1')]},'inReplyTo':{'type':Sequelize[_0x4172('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x4172('0x1')]},'to':{'type':Sequelize[_0x4172('0x1')]},'cc':{'type':Sequelize[_0x4172('0x1')]},'attachment':{'type':Sequelize[_0x4172('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x4172('0x6')](_0x4172('0x7'),_0x4172('0x8'),_0x4172('0x9'),_0x4172('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x4172('0x1')]},'projectId':{'type':Sequelize[_0x4172('0x2')]}};
\ No newline at end of file
+var _0x1571=['SENDING','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT'];(function(_0x261999,_0x15f7e8){var _0x109e04=function(_0x4c8e93){while(--_0x4c8e93){_0x261999['push'](_0x261999['shift']());}};_0x109e04(++_0x15f7e8);}(_0x1571,0x16a));var _0x1157=function(_0x49a456,_0x76c6d6){_0x49a456=_0x49a456-0x0;var _0x5818aa=_0x1571[_0x49a456];return _0x5818aa;};'use strict';var Sequelize=require('sequelize');module[_0x1157('0x0')]={'integration':{'type':Sequelize[_0x1157('0x1')]},'eventChannel':{'type':Sequelize[_0x1157('0x1')]},'exitStatus':{'type':Sequelize[_0x1157('0x1')]},'ticketId':{'type':Sequelize[_0x1157('0x1')]},'integrationId':{'type':Sequelize[_0x1157('0x2')]},'contacts':{'type':Sequelize[_0x1157('0x1')]},'uniqueid':{'type':Sequelize[_0x1157('0x1')]},'calleridnum':{'type':Sequelize[_0x1157('0x1')]},'calleridname':{'type':Sequelize[_0x1157('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x1157('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x1157('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x1157('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x1157('0x3')]},'talktime':{'type':Sequelize[_0x1157('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1157('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x1157('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x1157('0x3')]},'agentdump':{'type':Sequelize[_0x1157('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x1157('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1157('0x1')]},'channelstate':{'type':Sequelize[_0x1157('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1157('0x1')]},'connectedlinename':{'type':Sequelize[_0x1157('0x1')]},'language':{'type':Sequelize[_0x1157('0x1')]},'accountcode':{'type':Sequelize[_0x1157('0x1')]},'context':{'type':Sequelize[_0x1157('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1157('0x1')]},'destchannel':{'type':Sequelize[_0x1157('0x1')]},'destchannelstate':{'type':Sequelize[_0x1157('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x1157('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1157('0x1')]},'destcalleridname':{'type':Sequelize[_0x1157('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1157('0x1')]},'destlanguage':{'type':Sequelize[_0x1157('0x1')]},'destaccountcode':{'type':Sequelize[_0x1157('0x1')]},'destcontext':{'type':Sequelize[_0x1157('0x1')]},'destexten':{'type':Sequelize[_0x1157('0x1')]},'destpriority':{'type':Sequelize[_0x1157('0x1')]},'destuniqueid':{'type':Sequelize[_0x1157('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x1157('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x1157('0x1')]},'cc':{'type':Sequelize[_0x1157('0x1')]},'attachment':{'type':Sequelize[_0x1157('0x5')]},'html':{'type':Sequelize[_0x1157('0x5')]},'text':{'type':Sequelize[_0x1157('0x5')]},'status':{'type':Sequelize['ENUM'](_0x1157('0x6'),_0x1157('0x7'),'RECEIVED',_0x1157('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x1157('0x1')]},'appdata':{'type':Sequelize[_0x1157('0x1')]},'projectId':{'type':Sequelize[_0x1157('0x2')]}};
\ No newline at end of file
index a93818f..ae112f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c06=['to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','apply','update','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','IntegrationReport','includeAll','include','findAll','catch','show','params','keys','find','create','body','destroy','describe','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4c06,0x115));var _0x64c0=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x4c06[_0x47a40b];return _0x19610c;};'use strict';var pdf=require(_0x64c0('0x0'));var emlformat=require(_0x64c0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x64c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x64c0('0x3'));var BPromise=require(_0x64c0('0x4'));var Mustache=require(_0x64c0('0x5'));var util=require(_0x64c0('0x6'));var path=require(_0x64c0('0x7'));var sox=require(_0x64c0('0x8'));var csv=require('to-csv');var ejs=require(_0x64c0('0x9'));var fs=require('fs');var _=require(_0x64c0('0xa'));var squel=require(_0x64c0('0xb'));var crypto=require(_0x64c0('0xc'));var jsforce=require(_0x64c0('0xd'));var deskjs=require(_0x64c0('0xe'));var toCsv=require(_0x64c0('0xf'));var querystring=require(_0x64c0('0x10'));var Papa=require('papaparse');var Redis=require(_0x64c0('0x11'));var authService=require(_0x64c0('0x12'));var qs=require(_0x64c0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64c0('0x14'));var logger=require(_0x64c0('0x15'))(_0x64c0('0x16'));var utils=require(_0x64c0('0x17'));var config=require(_0x64c0('0x18'));var db=require(_0x64c0('0x19'))['db'];function respondWithStatusCode(_0x3b223f,_0x49bc18){_0x49bc18=_0x49bc18||0xcc;return function(_0x47b27e){if(_0x47b27e){return _0x3b223f['sendStatus'](_0x49bc18);}return _0x3b223f[_0x64c0('0x1a')](_0x49bc18)[_0x64c0('0x1b')]();};}function respondWithResult(_0x4a2b96,_0x259559){_0x259559=_0x259559||0xc8;return function(_0x400a72){if(_0x400a72){return _0x4a2b96[_0x64c0('0x1a')](_0x259559)['json'](_0x400a72);}};}function respondWithFilteredResult(_0x58e8dd,_0x25177f){return function(_0x418255){if(_0x418255){var _0x531393=_0x418255[_0x64c0('0x1c')],_0x3797bf=_0x25177f[_0x64c0('0x1d')],_0x296535=_0x25177f[_0x64c0('0x1d')]+_0x25177f[_0x64c0('0x1e')],_0x2cf9b2;if(_0x296535>=_0x531393){_0x296535=_0x531393;_0x2cf9b2=0xc8;}else{_0x2cf9b2=0xce;}_0x58e8dd[_0x64c0('0x1a')](_0x2cf9b2);return _0x58e8dd[_0x64c0('0x1f')](_0x64c0('0x20'),_0x3797bf+'-'+_0x296535+'/'+_0x531393)['json'](_0x418255);}return null;};}function patchUpdates(_0xbfb9eb){return function(_0xd51499){try{jsonpatch[_0x64c0('0x21')](_0xd51499,_0xbfb9eb,!![]);}catch(_0x302f10){return BPromise['reject'](_0x302f10);}return _0xd51499['save']();};}function saveUpdates(_0xc67fbf,_0x1e852a){return function(_0x22e591){if(_0x22e591){return _0x22e591[_0x64c0('0x22')](_0xc67fbf)['then'](function(_0x36db1c){return _0x36db1c;});}return null;};}function removeEntity(_0x20ea46,_0x29f4d1){return function(_0x3483aa){if(_0x3483aa){return _0x3483aa['destroy']()[_0x64c0('0x23')](function(){_0x20ea46[_0x64c0('0x1a')](0xcc)[_0x64c0('0x1b')]();});}};}function handleEntityNotFound(_0x519d5e,_0x210d41){return function(_0x346ea1){if(!_0x346ea1){_0x519d5e[_0x64c0('0x24')](0x194);}return _0x346ea1;};}function handleError(_0x58e8b0,_0x55eadc){_0x55eadc=_0x55eadc||0x1f4;return function(_0x106b5c){logger[_0x64c0('0x25')](_0x106b5c[_0x64c0('0x26')]);if(_0x106b5c[_0x64c0('0x27')]){delete _0x106b5c[_0x64c0('0x27')];}_0x58e8b0[_0x64c0('0x1a')](_0x55eadc)[_0x64c0('0x28')](_0x106b5c);};}exports['index']=function(_0x1ad8ad,_0x330ccc){var _0x22eaa7={},_0x41bad7={},_0xfd30b1={'count':0x0,'rows':[]};var _0x1db8aa=_[_0x64c0('0x29')](db['IntegrationReport'][_0x64c0('0x2a')],function(_0xed09a4){return{'name':_0xed09a4[_0x64c0('0x2b')],'type':_0xed09a4[_0x64c0('0x2c')]['key']};});_0x41bad7[_0x64c0('0x2d')]=_[_0x64c0('0x29')](_0x1db8aa,'name');_0x41bad7[_0x64c0('0x2e')]=_['keys'](_0x1ad8ad['query']);_0x41bad7[_0x64c0('0x2f')]=_[_0x64c0('0x30')](_0x41bad7['model'],_0x41bad7['query']);_0x22eaa7[_0x64c0('0x31')]=_[_0x64c0('0x30')](_0x41bad7[_0x64c0('0x2d')],qs[_0x64c0('0x32')](_0x1ad8ad[_0x64c0('0x2e')][_0x64c0('0x32')]));_0x22eaa7['attributes']=_0x22eaa7['attributes'][_0x64c0('0x33')]?_0x22eaa7[_0x64c0('0x31')]:_0x41bad7[_0x64c0('0x2d')];if(!_0x1ad8ad['query'][_0x64c0('0x34')]('nolimit')){_0x22eaa7['limit']=qs[_0x64c0('0x1e')](_0x1ad8ad[_0x64c0('0x2e')][_0x64c0('0x1e')]);_0x22eaa7[_0x64c0('0x1d')]=qs[_0x64c0('0x1d')](_0x1ad8ad['query'][_0x64c0('0x1d')]);}_0x22eaa7[_0x64c0('0x35')]=qs[_0x64c0('0x36')](_0x1ad8ad[_0x64c0('0x2e')]['sort']);_0x22eaa7[_0x64c0('0x37')]=qs['filters'](_['pick'](_0x1ad8ad[_0x64c0('0x2e')],_0x41bad7[_0x64c0('0x2f')]),_0x1db8aa);if(_0x1ad8ad[_0x64c0('0x2e')][_0x64c0('0x38')]){_0x22eaa7[_0x64c0('0x37')]=_[_0x64c0('0x39')](_0x22eaa7[_0x64c0('0x37')],{'$or':_[_0x64c0('0x29')](_0x1db8aa,function(_0x1d6722){if(_0x1d6722['type']!==_0x64c0('0x3a')){var _0x12ff5a={};_0x12ff5a[_0x1d6722[_0x64c0('0x27')]]={'$like':'%'+_0x1ad8ad['query'][_0x64c0('0x38')]+'%'};return _0x12ff5a;}})});}_0x22eaa7=_[_0x64c0('0x39')]({},_0x22eaa7,_0x1ad8ad[_0x64c0('0x3b')]);var _0x512642={'where':_0x22eaa7[_0x64c0('0x37')]};return db[_0x64c0('0x3c')][_0x64c0('0x1c')](_0x512642)[_0x64c0('0x23')](function(_0x3da64a){_0xfd30b1[_0x64c0('0x1c')]=_0x3da64a;if(_0x1ad8ad[_0x64c0('0x2e')][_0x64c0('0x3d')]){_0x22eaa7[_0x64c0('0x3e')]=[{'all':!![]}];}return db[_0x64c0('0x3c')][_0x64c0('0x3f')](_0x22eaa7);})[_0x64c0('0x23')](function(_0x1ab8ff){_0xfd30b1['rows']=_0x1ab8ff;return _0xfd30b1;})[_0x64c0('0x23')](respondWithFilteredResult(_0x330ccc,_0x22eaa7))[_0x64c0('0x40')](handleError(_0x330ccc,null));};exports[_0x64c0('0x41')]=function(_0x2eb9e1,_0xc84100){var _0x50a3a7={'raw':![],'where':{'id':_0x2eb9e1[_0x64c0('0x42')]['id']}},_0x3620d6={};_0x3620d6[_0x64c0('0x2d')]=_[_0x64c0('0x43')](db[_0x64c0('0x3c')]['rawAttributes']);_0x3620d6['query']=_[_0x64c0('0x43')](_0x2eb9e1['query']);_0x3620d6[_0x64c0('0x2f')]=_[_0x64c0('0x30')](_0x3620d6[_0x64c0('0x2d')],_0x3620d6[_0x64c0('0x2e')]);_0x50a3a7[_0x64c0('0x31')]=_[_0x64c0('0x30')](_0x3620d6[_0x64c0('0x2d')],qs['fields'](_0x2eb9e1[_0x64c0('0x2e')][_0x64c0('0x32')]));_0x50a3a7[_0x64c0('0x31')]=_0x50a3a7[_0x64c0('0x31')]['length']?_0x50a3a7[_0x64c0('0x31')]:_0x3620d6[_0x64c0('0x2d')];if(_0x2eb9e1[_0x64c0('0x2e')][_0x64c0('0x3d')]){_0x50a3a7['include']=[{'all':!![]}];}_0x50a3a7=_[_0x64c0('0x39')]({},_0x50a3a7,_0x2eb9e1[_0x64c0('0x3b')]);return db[_0x64c0('0x3c')][_0x64c0('0x44')](_0x50a3a7)[_0x64c0('0x23')](handleEntityNotFound(_0xc84100,null))['then'](respondWithResult(_0xc84100,null))['catch'](handleError(_0xc84100,null));};exports[_0x64c0('0x45')]=function(_0x563cd1,_0x5997ac){return db[_0x64c0('0x3c')][_0x64c0('0x45')](_0x563cd1[_0x64c0('0x46')],{})[_0x64c0('0x23')](respondWithResult(_0x5997ac,0xc9))[_0x64c0('0x40')](handleError(_0x5997ac,null));};exports['update']=function(_0xe6fc62,_0x53b37c){if(_0xe6fc62[_0x64c0('0x46')]['id']){delete _0xe6fc62['body']['id'];}return db[_0x64c0('0x3c')][_0x64c0('0x44')]({'where':{'id':_0xe6fc62[_0x64c0('0x42')]['id']}})[_0x64c0('0x23')](handleEntityNotFound(_0x53b37c,null))[_0x64c0('0x23')](saveUpdates(_0xe6fc62['body'],null))[_0x64c0('0x23')](respondWithResult(_0x53b37c,null))['catch'](handleError(_0x53b37c,null));};exports[_0x64c0('0x47')]=function(_0x31fbfc,_0x5c1b54){return db['IntegrationReport'][_0x64c0('0x44')]({'where':{'id':_0x31fbfc[_0x64c0('0x42')]['id']}})[_0x64c0('0x23')](handleEntityNotFound(_0x5c1b54,null))[_0x64c0('0x23')](removeEntity(_0x5c1b54,null))[_0x64c0('0x40')](handleError(_0x5c1b54,null));};exports[_0x64c0('0x48')]=function(_0x4b0547,_0x19092e){return db[_0x64c0('0x3c')]['describe']()[_0x64c0('0x23')](respondWithResult(_0x19092e,null))[_0x64c0('0x40')](handleError(_0x19092e,null));};
\ No newline at end of file
+var _0x8b47=['nolimit','limit','offset','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','params','length','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','reject','update','destroy','then','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty'];(function(_0x47f0db,_0x4204e0){var _0xa3150a=function(_0x564812){while(--_0x564812){_0x47f0db['push'](_0x47f0db['shift']());}};_0xa3150a(++_0x4204e0);}(_0x8b47,0x169));var _0x78b4=function(_0x2b784c,_0x2e8db4){_0x2b784c=_0x2b784c-0x0;var _0x3fda4a=_0x8b47[_0x2b784c];return _0x3fda4a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x78b4('0x0'));var rimraf=require(_0x78b4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x78b4('0x2'));var rp=require('request-promise');var moment=require(_0x78b4('0x3'));var BPromise=require(_0x78b4('0x4'));var Mustache=require(_0x78b4('0x5'));var util=require('util');var path=require(_0x78b4('0x6'));var sox=require(_0x78b4('0x7'));var csv=require('to-csv');var ejs=require(_0x78b4('0x8'));var fs=require('fs');var _=require(_0x78b4('0x9'));var squel=require(_0x78b4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x78b4('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x78b4('0xc'));var authService=require(_0x78b4('0xd'));var qs=require(_0x78b4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78b4('0xf'));var logger=require(_0x78b4('0x10'))('api');var utils=require(_0x78b4('0x11'));var config=require('../../config/environment');var db=require(_0x78b4('0x12'))['db'];function respondWithStatusCode(_0x198491,_0x2cad5){_0x2cad5=_0x2cad5||0xcc;return function(_0x43cfda){if(_0x43cfda){return _0x198491[_0x78b4('0x13')](_0x2cad5);}return _0x198491[_0x78b4('0x14')](_0x2cad5)[_0x78b4('0x15')]();};}function respondWithResult(_0x255604,_0x3a1518){_0x3a1518=_0x3a1518||0xc8;return function(_0x18bde8){if(_0x18bde8){return _0x255604[_0x78b4('0x14')](_0x3a1518)[_0x78b4('0x16')](_0x18bde8);}};}function respondWithFilteredResult(_0x2d33eb,_0x3922c8){return function(_0x16f7e5){if(_0x16f7e5){var _0x55fc52=_0x16f7e5[_0x78b4('0x17')],_0x358fd5=_0x3922c8['offset'],_0x57e23b=_0x3922c8['offset']+_0x3922c8['limit'],_0x4efe2e;if(_0x57e23b>=_0x55fc52){_0x57e23b=_0x55fc52;_0x4efe2e=0xc8;}else{_0x4efe2e=0xce;}_0x2d33eb[_0x78b4('0x14')](_0x4efe2e);return _0x2d33eb[_0x78b4('0x18')](_0x78b4('0x19'),_0x358fd5+'-'+_0x57e23b+'/'+_0x55fc52)['json'](_0x16f7e5);}return null;};}function patchUpdates(_0x51f000){return function(_0x3b7532){try{jsonpatch['apply'](_0x3b7532,_0x51f000,!![]);}catch(_0x4254f6){return BPromise[_0x78b4('0x1a')](_0x4254f6);}return _0x3b7532['save']();};}function saveUpdates(_0x485c34,_0x184b74){return function(_0x2d5526){if(_0x2d5526){return _0x2d5526[_0x78b4('0x1b')](_0x485c34)['then'](function(_0x4fdb18){return _0x4fdb18;});}return null;};}function removeEntity(_0x29b442,_0x103182){return function(_0xb3414a){if(_0xb3414a){return _0xb3414a[_0x78b4('0x1c')]()[_0x78b4('0x1d')](function(){_0x29b442[_0x78b4('0x14')](0xcc)[_0x78b4('0x15')]();});}};}function handleEntityNotFound(_0x30cf55,_0x197777){return function(_0x50a920){if(!_0x50a920){_0x30cf55['sendStatus'](0x194);}return _0x50a920;};}function handleError(_0x1d46ef,_0x52ca9d){_0x52ca9d=_0x52ca9d||0x1f4;return function(_0x1d357e){logger['error'](_0x1d357e[_0x78b4('0x1e')]);if(_0x1d357e[_0x78b4('0x1f')]){delete _0x1d357e[_0x78b4('0x1f')];}_0x1d46ef[_0x78b4('0x14')](_0x52ca9d)[_0x78b4('0x20')](_0x1d357e);};}exports[_0x78b4('0x21')]=function(_0x5e5899,_0x253dd3){var _0x1c5294={},_0x4f797a={},_0x3ce499={'count':0x0,'rows':[]};var _0x1faac9=_[_0x78b4('0x22')](db[_0x78b4('0x23')][_0x78b4('0x24')],function(_0x4a70fd){return{'name':_0x4a70fd[_0x78b4('0x25')],'type':_0x4a70fd[_0x78b4('0x26')][_0x78b4('0x27')]};});_0x4f797a[_0x78b4('0x28')]=_[_0x78b4('0x22')](_0x1faac9,'name');_0x4f797a[_0x78b4('0x29')]=_[_0x78b4('0x2a')](_0x5e5899['query']);_0x4f797a['filters']=_['intersection'](_0x4f797a['model'],_0x4f797a['query']);_0x1c5294[_0x78b4('0x2b')]=_[_0x78b4('0x2c')](_0x4f797a['model'],qs[_0x78b4('0x2d')](_0x5e5899[_0x78b4('0x29')][_0x78b4('0x2d')]));_0x1c5294['attributes']=_0x1c5294[_0x78b4('0x2b')]['length']?_0x1c5294[_0x78b4('0x2b')]:_0x4f797a[_0x78b4('0x28')];if(!_0x5e5899[_0x78b4('0x29')][_0x78b4('0x2e')](_0x78b4('0x2f'))){_0x1c5294[_0x78b4('0x30')]=qs['limit'](_0x5e5899[_0x78b4('0x29')][_0x78b4('0x30')]);_0x1c5294['offset']=qs[_0x78b4('0x31')](_0x5e5899[_0x78b4('0x29')][_0x78b4('0x31')]);}_0x1c5294['order']=qs[_0x78b4('0x32')](_0x5e5899[_0x78b4('0x29')][_0x78b4('0x32')]);_0x1c5294[_0x78b4('0x33')]=qs[_0x78b4('0x34')](_[_0x78b4('0x35')](_0x5e5899['query'],_0x4f797a['filters']),_0x1faac9);if(_0x5e5899[_0x78b4('0x29')]['filter']){_0x1c5294['where']=_[_0x78b4('0x36')](_0x1c5294[_0x78b4('0x33')],{'$or':_['map'](_0x1faac9,function(_0x929d41){if(_0x929d41['type']!=='VIRTUAL'){var _0x2ec1b0={};_0x2ec1b0[_0x929d41[_0x78b4('0x1f')]]={'$like':'%'+_0x5e5899['query'][_0x78b4('0x37')]+'%'};return _0x2ec1b0;}})});}_0x1c5294=_['merge']({},_0x1c5294,_0x5e5899[_0x78b4('0x38')]);var _0x4633c4={'where':_0x1c5294['where']};return db[_0x78b4('0x23')]['count'](_0x4633c4)[_0x78b4('0x1d')](function(_0x4ec755){_0x3ce499[_0x78b4('0x17')]=_0x4ec755;if(_0x5e5899['query'][_0x78b4('0x39')]){_0x1c5294[_0x78b4('0x3a')]=[{'all':!![]}];}return db[_0x78b4('0x23')][_0x78b4('0x3b')](_0x1c5294);})[_0x78b4('0x1d')](function(_0x50d40c){_0x3ce499[_0x78b4('0x3c')]=_0x50d40c;return _0x3ce499;})[_0x78b4('0x1d')](respondWithFilteredResult(_0x253dd3,_0x1c5294))['catch'](handleError(_0x253dd3,null));};exports['show']=function(_0x16ae90,_0x49d036){var _0x2c0e08={'raw':![],'where':{'id':_0x16ae90[_0x78b4('0x3d')]['id']}},_0x425451={};_0x425451[_0x78b4('0x28')]=_[_0x78b4('0x2a')](db[_0x78b4('0x23')][_0x78b4('0x24')]);_0x425451[_0x78b4('0x29')]=_[_0x78b4('0x2a')](_0x16ae90[_0x78b4('0x29')]);_0x425451[_0x78b4('0x34')]=_[_0x78b4('0x2c')](_0x425451['model'],_0x425451[_0x78b4('0x29')]);_0x2c0e08[_0x78b4('0x2b')]=_[_0x78b4('0x2c')](_0x425451['model'],qs['fields'](_0x16ae90['query'][_0x78b4('0x2d')]));_0x2c0e08[_0x78b4('0x2b')]=_0x2c0e08[_0x78b4('0x2b')][_0x78b4('0x3e')]?_0x2c0e08[_0x78b4('0x2b')]:_0x425451[_0x78b4('0x28')];if(_0x16ae90[_0x78b4('0x29')]['includeAll']){_0x2c0e08[_0x78b4('0x3a')]=[{'all':!![]}];}_0x2c0e08=_['merge']({},_0x2c0e08,_0x16ae90[_0x78b4('0x38')]);return db[_0x78b4('0x23')][_0x78b4('0x3f')](_0x2c0e08)[_0x78b4('0x1d')](handleEntityNotFound(_0x49d036,null))[_0x78b4('0x1d')](respondWithResult(_0x49d036,null))[_0x78b4('0x40')](handleError(_0x49d036,null));};exports[_0x78b4('0x41')]=function(_0x2c5655,_0x1f357f){return db[_0x78b4('0x23')][_0x78b4('0x41')](_0x2c5655[_0x78b4('0x42')],{})['then'](respondWithResult(_0x1f357f,0xc9))['catch'](handleError(_0x1f357f,null));};exports[_0x78b4('0x1b')]=function(_0x5cc39d,_0x3ed502){if(_0x5cc39d[_0x78b4('0x42')]['id']){delete _0x5cc39d['body']['id'];}return db[_0x78b4('0x23')][_0x78b4('0x3f')]({'where':{'id':_0x5cc39d[_0x78b4('0x3d')]['id']}})[_0x78b4('0x1d')](handleEntityNotFound(_0x3ed502,null))[_0x78b4('0x1d')](saveUpdates(_0x5cc39d[_0x78b4('0x42')],null))[_0x78b4('0x1d')](respondWithResult(_0x3ed502,null))[_0x78b4('0x40')](handleError(_0x3ed502,null));};exports[_0x78b4('0x1c')]=function(_0x5a9c3a,_0x447e0e){return db[_0x78b4('0x23')]['find']({'where':{'id':_0x5a9c3a[_0x78b4('0x3d')]['id']}})[_0x78b4('0x1d')](handleEntityNotFound(_0x447e0e,null))['then'](removeEntity(_0x447e0e,null))[_0x78b4('0x40')](handleError(_0x447e0e,null));};exports['describe']=function(_0x361c17,_0x3aed34){return db['IntegrationReport'][_0x78b4('0x43')]()[_0x78b4('0x1d')](respondWithResult(_0x3aed34,null))[_0x78b4('0x40')](handleError(_0x3aed34,null));};
\ No newline at end of file
index bcede7d..e9a6b51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1595=['IntegrationReport','report_integration','lodash','util','../../config/logger','bluebird','../../config/environment','./integrationReport.attributes','exports','define'];(function(_0x178668,_0x1ec300){var _0x26107d=function(_0x4c0aa8){while(--_0x4c0aa8){_0x178668['push'](_0x178668['shift']());}};_0x26107d(++_0x1ec300);}(_0x1595,0xca));var _0x5159=function(_0x161e26,_0x28d80b){_0x161e26=_0x161e26-0x0;var _0x40fdd5=_0x1595[_0x161e26];return _0x40fdd5;};'use strict';var _=require(_0x5159('0x0'));var util=require(_0x5159('0x1'));var logger=require(_0x5159('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5159('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5159('0x4'));var attributes=require(_0x5159('0x5'));module[_0x5159('0x6')]=function(_0x27c1ee,_0x232d96){return _0x27c1ee[_0x5159('0x7')](_0x5159('0x8'),attributes,{'tableName':_0x5159('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a21=['IntegrationReport','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x27c21c,_0x1489c3){var _0x4fa029=function(_0x7e5877){while(--_0x7e5877){_0x27c21c['push'](_0x27c21c['shift']());}};_0x4fa029(++_0x1489c3);}(_0x0a21,0x85));var _0x10a2=function(_0x4a08fc,_0x5b57b7){_0x4a08fc=_0x4a08fc-0x0;var _0x27818c=_0x0a21[_0x4a08fc];return _0x27818c;};'use strict';var _=require(_0x10a2('0x0'));var util=require(_0x10a2('0x1'));var logger=require(_0x10a2('0x2'))(_0x10a2('0x3'));var moment=require(_0x10a2('0x4'));var BPromise=require('bluebird');var rp=require(_0x10a2('0x5'));var fs=require('fs');var path=require(_0x10a2('0x6'));var rimraf=require(_0x10a2('0x7'));var config=require(_0x10a2('0x8'));var attributes=require(_0x10a2('0x9'));module['exports']=function(_0x5e4f92,_0x3fa686){return _0x5e4f92['define'](_0x10a2('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a33a9aa..8939218 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x44f117,_0x14a212){var _0x57a50f=function(_0xc9c4c0){while(--_0xc9c4c0){_0x44f117['push'](_0x44f117['shift']());}};_0x57a50f(++_0x14a212);}(_0x757a,0xde));var _0xa757=function(_0x3fc592,_0x13c751){_0x3fc592=_0x3fc592-0x0;var _0x41578b=_0x757a[_0x3fc592];return _0x41578b;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('IntegrationReport,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}
\ No newline at end of file
+var _0x8603=['message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8603,0x190));var _0x3860=function(_0x3ee7e2,_0x15cf09){_0x3ee7e2=_0x3ee7e2-0x0;var _0x1c1f18=_0x8603[_0x3ee7e2];return _0x1c1f18;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});}
\ No newline at end of file
index 416362b..057560a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['isAuthenticated','index','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./interval.controller','get'];(function(_0x3bab91,_0x495b57){var _0x4698a0=function(_0x536395){while(--_0x536395){_0x3bab91['push'](_0x3bab91['shift']());}};_0x4698a0(++_0x495b57);}(_0x3e74,0x175));var _0x43e7=function(_0x43dae8,_0x4876df){_0x43dae8=_0x43dae8-0x0;var _0x3bf52a=_0x3e74[_0x43dae8];return _0x3bf52a;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['getIntervals']);router[_0x43e7('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x43e7('0xb')](_0x43e7('0xa'),auth['isAuthenticated'](),controller[_0x43e7('0xc')]);router['post'](_0x43e7('0xd'),auth[_0x43e7('0x7')](),controller['addIntervals']);router[_0x43e7('0xe')](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);module[_0x43e7('0x12')]=router;
\ No newline at end of file
+var _0x7217=['multer','path','connect-timeout','express','Router','../../components/auth/service','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports'];(function(_0x222cff,_0x493c92){var _0x5c931b=function(_0x30f854){while(--_0x30f854){_0x222cff['push'](_0x222cff['shift']());}};_0x5c931b(++_0x493c92);}(_0x7217,0x19e));var _0x7721=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x7217[_0xf0bcac];return _0x4e4c65;};'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 auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0x7')](_0x7721('0xc'),auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0xe')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0xf')]);router['post'](_0x7721('0xc'),auth[_0x7721('0x8')](),controller[_0x7721('0x10')]);router[_0x7721('0xe')](_0x7721('0x11'),auth[_0x7721('0x8')](),controller[_0x7721('0x12')]);router[_0x7721('0x13')]('/:id',auth[_0x7721('0x8')](),controller[_0x7721('0x14')]);router['delete'](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x15')]);module[_0x7721('0x16')]=router;
\ No newline at end of file
index 288f981..287c1a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fed=['STRING','sequelize','exports'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x6fed,0x19c));var _0xd6fe=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6fed[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xd6fe('0x0'));module[_0xd6fe('0x1')]={'name':{'type':Sequelize[_0xd6fe('0x2')]},'description':{'type':Sequelize[_0xd6fe('0x2')]},'interval':{'type':Sequelize[_0xd6fe('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xcd2c=['STRING'];(function(_0x4a3ca0,_0x17fb0f){var _0x12a117=function(_0x1f4b26){while(--_0x1f4b26){_0x4a3ca0['push'](_0x4a3ca0['shift']());}};_0x12a117(++_0x17fb0f);}(_0xcd2c,0x1e5));var _0xccd2=function(_0x485d58,_0x195b01){_0x485d58=_0x485d58-0x0;var _0x113d4b=_0xcd2c[_0x485d58];return _0x113d4b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xccd2('0x0')]},'description':{'type':Sequelize[_0xccd2('0x0')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 95d104d..1369fa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfa2=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','where','merge','filter','Interval','include','catch','show','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','userProfileId','autoAssociation','addInterval','IntervalId','findOne','getIntervals','sequelize','bulkCreate','findAll','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x183ee0,_0x48c88d){var _0x4359c3=function(_0x446393){while(--_0x446393){_0x183ee0['push'](_0x183ee0['shift']());}};_0x4359c3(++_0x48c88d);}(_0xbfa2,0xf1));var _0x2bfa=function(_0x58073e,_0x94249d){_0x58073e=_0x58073e-0x0;var _0x177e47=_0xbfa2[_0x58073e];return _0x177e47;};'use strict';var pdf=require(_0x2bfa('0x0'));var emlformat=require(_0x2bfa('0x1'));var rimraf=require(_0x2bfa('0x2'));var zipdir=require(_0x2bfa('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2bfa('0x4'));var moment=require(_0x2bfa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2bfa('0x6'));var util=require(_0x2bfa('0x7'));var path=require(_0x2bfa('0x8'));var sox=require(_0x2bfa('0x9'));var csv=require(_0x2bfa('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2bfa('0xb'));var squel=require(_0x2bfa('0xc'));var crypto=require(_0x2bfa('0xd'));var jsforce=require(_0x2bfa('0xe'));var deskjs=require(_0x2bfa('0xf'));var toCsv=require(_0x2bfa('0xa'));var querystring=require(_0x2bfa('0x10'));var Papa=require('papaparse');var Redis=require(_0x2bfa('0x11'));var authService=require(_0x2bfa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2bfa('0x13'));var hardwareService=require(_0x2bfa('0x14'));var logger=require(_0x2bfa('0x15'))(_0x2bfa('0x16'));var utils=require(_0x2bfa('0x17'));var config=require(_0x2bfa('0x18'));var db=require(_0x2bfa('0x19'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x39d8d5,_0x3e4b45){_0x3e4b45=_0x3e4b45||0xcc;return function(_0x3eb0c2){if(_0x3eb0c2){return _0x39d8d5[_0x2bfa('0x1a')](_0x3e4b45);}return _0x39d8d5[_0x2bfa('0x1b')](_0x3e4b45)[_0x2bfa('0x1c')]();};}function respondWithResult(_0x54d27c,_0x5174e1){_0x5174e1=_0x5174e1||0xc8;return function(_0x5d616c){if(_0x5d616c){return _0x54d27c[_0x2bfa('0x1b')](_0x5174e1)[_0x2bfa('0x1d')](_0x5d616c);}};}function respondWithFilteredResult(_0x15864e,_0x60203){return function(_0x262e05){if(_0x262e05){var _0x2938fe=_0x262e05[_0x2bfa('0x1e')],_0xfab820=_0x60203[_0x2bfa('0x1f')],_0x2f85cb=_0x60203[_0x2bfa('0x1f')]+_0x60203['limit'],_0x18adeb;if(_0x2f85cb>=_0x2938fe){_0x2f85cb=_0x2938fe;_0x18adeb=0xc8;}else{_0x18adeb=0xce;}_0x15864e[_0x2bfa('0x1b')](_0x18adeb);return _0x15864e['set'](_0x2bfa('0x20'),_0xfab820+'-'+_0x2f85cb+'/'+_0x2938fe)[_0x2bfa('0x1d')](_0x262e05);}return null;};}function patchUpdates(_0x17f31f){return function(_0x164d20){try{jsonpatch[_0x2bfa('0x21')](_0x164d20,_0x17f31f,!![]);}catch(_0x96de62){return BPromise['reject'](_0x96de62);}return _0x164d20[_0x2bfa('0x22')]();};}function saveUpdates(_0x146e58,_0x374bba){return function(_0x2c565e){if(_0x2c565e){return _0x2c565e['update'](_0x146e58)[_0x2bfa('0x23')](function(_0x540833){return _0x540833;});}return null;};}function removeEntity(_0x46a912,_0x39536b){return function(_0xafa6a9){if(_0xafa6a9){return _0xafa6a9[_0x2bfa('0x24')]()['then'](function(){var _0x588451=_0xafa6a9[_0x2bfa('0x25')]({'plain':!![]});var _0x344764='Intervals';return db[_0x2bfa('0x26')]['destroy']({'where':{'type':_0x344764,'resourceId':_0x588451['id']}})[_0x2bfa('0x23')](function(){return _0xafa6a9;});})[_0x2bfa('0x23')](function(){_0x46a912[_0x2bfa('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6006ad,_0x5b0277){return function(_0x573fc3){if(!_0x573fc3){_0x6006ad[_0x2bfa('0x1a')](0x194);}return _0x573fc3;};}function handleError(_0x3dfaa0,_0x3b2b9b){_0x3b2b9b=_0x3b2b9b||0x1f4;return function(_0xd30fb7){logger[_0x2bfa('0x27')](_0xd30fb7[_0x2bfa('0x28')]);if(_0xd30fb7['name']){delete _0xd30fb7[_0x2bfa('0x29')];}_0x3dfaa0[_0x2bfa('0x1b')](_0x3b2b9b)[_0x2bfa('0x2a')](_0xd30fb7);};}exports[_0x2bfa('0x2b')]=function(_0x2c546a,_0x5e0efa){var _0x31c6b6={},_0x521dab={},_0x30aa67={'count':0x0,'rows':[]};var _0x3de999=_[_0x2bfa('0x2c')](db['Interval'][_0x2bfa('0x2d')],function(_0x439eca){return{'name':_0x439eca[_0x2bfa('0x2e')],'type':_0x439eca[_0x2bfa('0x2f')]['key']};});_0x521dab[_0x2bfa('0x30')]=_['map'](_0x3de999,_0x2bfa('0x29'));_0x521dab['query']=_[_0x2bfa('0x31')](_0x2c546a[_0x2bfa('0x32')]);_0x521dab['filters']=_['intersection'](_0x521dab[_0x2bfa('0x30')],_0x521dab['query']);_0x31c6b6[_0x2bfa('0x33')]=_[_0x2bfa('0x34')](_0x521dab[_0x2bfa('0x30')],qs[_0x2bfa('0x35')](_0x2c546a[_0x2bfa('0x32')][_0x2bfa('0x35')]));_0x31c6b6[_0x2bfa('0x33')]=_0x31c6b6['attributes'][_0x2bfa('0x36')]?_0x31c6b6[_0x2bfa('0x33')]:_0x521dab['model'];if(!_0x2c546a[_0x2bfa('0x32')][_0x2bfa('0x37')](_0x2bfa('0x38'))){_0x31c6b6[_0x2bfa('0x39')]=qs[_0x2bfa('0x39')](_0x2c546a[_0x2bfa('0x32')][_0x2bfa('0x39')]);_0x31c6b6[_0x2bfa('0x1f')]=qs[_0x2bfa('0x1f')](_0x2c546a[_0x2bfa('0x32')][_0x2bfa('0x1f')]);}_0x31c6b6['order']=qs[_0x2bfa('0x3a')](_0x2c546a[_0x2bfa('0x32')][_0x2bfa('0x3a')]);_0x31c6b6['where']=qs[_0x2bfa('0x3b')](_[_0x2bfa('0x3c')](_0x2c546a[_0x2bfa('0x32')],_0x521dab[_0x2bfa('0x3b')]),_0x3de999);if(_0x2c546a['query']['filter']){_0x31c6b6[_0x2bfa('0x3d')]=_[_0x2bfa('0x3e')](_0x31c6b6[_0x2bfa('0x3d')],{'$or':_[_0x2bfa('0x2c')](_0x3de999,function(_0x361939){if(_0x361939[_0x2bfa('0x2f')]!=='VIRTUAL'){var _0x203922={};_0x203922[_0x361939[_0x2bfa('0x29')]]={'$like':'%'+_0x2c546a['query'][_0x2bfa('0x3f')]+'%'};return _0x203922;}})});}_0x31c6b6=_[_0x2bfa('0x3e')]({},_0x31c6b6,_0x2c546a['options']);var _0x407407={'where':_0x31c6b6[_0x2bfa('0x3d')]};return db[_0x2bfa('0x40')][_0x2bfa('0x1e')](_0x407407)[_0x2bfa('0x23')](function(_0x561dec){_0x30aa67[_0x2bfa('0x1e')]=_0x561dec;if(_0x2c546a[_0x2bfa('0x32')]['includeAll']){_0x31c6b6[_0x2bfa('0x41')]=[{'all':!![]}];}return db[_0x2bfa('0x40')]['findAll'](_0x31c6b6);})['then'](function(_0x15db7b){_0x30aa67['rows']=_0x15db7b;return _0x30aa67;})[_0x2bfa('0x23')](respondWithFilteredResult(_0x5e0efa,_0x31c6b6))[_0x2bfa('0x42')](handleError(_0x5e0efa,null));};exports[_0x2bfa('0x43')]=function(_0x3efe01,_0x1bdca5){var _0x2130f8={'raw':!![],'where':{'id':_0x3efe01[_0x2bfa('0x44')]['id']}},_0x2d7bf7={};_0x2d7bf7['model']=_[_0x2bfa('0x31')](db[_0x2bfa('0x40')][_0x2bfa('0x2d')]);_0x2d7bf7[_0x2bfa('0x32')]=_['keys'](_0x3efe01['query']);_0x2d7bf7['filters']=_['intersection'](_0x2d7bf7['model'],_0x2d7bf7[_0x2bfa('0x32')]);_0x2130f8['attributes']=_[_0x2bfa('0x34')](_0x2d7bf7[_0x2bfa('0x30')],qs[_0x2bfa('0x35')](_0x3efe01[_0x2bfa('0x32')][_0x2bfa('0x35')]));_0x2130f8[_0x2bfa('0x33')]=_0x2130f8[_0x2bfa('0x33')]['length']?_0x2130f8[_0x2bfa('0x33')]:_0x2d7bf7['model'];if(_0x3efe01[_0x2bfa('0x32')][_0x2bfa('0x45')]){_0x2130f8[_0x2bfa('0x41')]=[{'all':!![]}];}_0x2130f8=_[_0x2bfa('0x3e')]({},_0x2130f8,_0x3efe01[_0x2bfa('0x46')]);return db[_0x2bfa('0x40')][_0x2bfa('0x47')](_0x2130f8)['then'](handleEntityNotFound(_0x1bdca5,null))[_0x2bfa('0x23')](respondWithResult(_0x1bdca5,null))[_0x2bfa('0x42')](handleError(_0x1bdca5,null));};exports[_0x2bfa('0x48')]=function(_0x3de068,_0x598b88){return db[_0x2bfa('0x40')][_0x2bfa('0x48')](_0x3de068[_0x2bfa('0x49')],{})[_0x2bfa('0x23')](function(_0x57c070){var _0x306a26=_0x3de068[_0x2bfa('0x4a')][_0x2bfa('0x25')]({'plain':!![]});if(!_0x306a26)throw new Error(_0x2bfa('0x4b'));if(_0x306a26[_0x2bfa('0x4c')]===_0x2bfa('0x4a')){var _0x4d05f6=_0x57c070[_0x2bfa('0x25')]({'plain':!![]});var _0x30c700=_0x2bfa('0x4d');return db[_0x2bfa('0x4e')]['find']({'where':{'name':_0x30c700,'userProfileId':_0x306a26[_0x2bfa('0x4f')]},'raw':!![]})[_0x2bfa('0x23')](function(_0x5f2760){if(_0x5f2760&&_0x5f2760[_0x2bfa('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x4d05f6[_0x2bfa('0x29')],'resourceId':_0x4d05f6['id'],'type':_0x5f2760['name'],'sectionId':_0x5f2760['id']},{})[_0x2bfa('0x23')](function(){return _0x57c070;});}else{return _0x57c070;}})['catch'](function(_0x4b469b){logger[_0x2bfa('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b469b);throw _0x4b469b;});}return _0x57c070;})[_0x2bfa('0x23')](respondWithResult(_0x598b88,0xc9))['catch'](handleError(_0x598b88,null));};exports['update']=function(_0x25f79b,_0x4e195f){if(_0x25f79b[_0x2bfa('0x49')]['id']){delete _0x25f79b[_0x2bfa('0x49')]['id'];}return db['Interval']['find']({'where':{'id':_0x25f79b[_0x2bfa('0x44')]['id']}})[_0x2bfa('0x23')](handleEntityNotFound(_0x4e195f,null))[_0x2bfa('0x23')](saveUpdates(_0x25f79b[_0x2bfa('0x49')],null))[_0x2bfa('0x23')](respondWithResult(_0x4e195f,null))[_0x2bfa('0x42')](handleError(_0x4e195f,null));};exports['destroy']=function(_0x1b796a,_0x751b04){return db[_0x2bfa('0x40')]['find']({'where':{'id':_0x1b796a['params']['id']}})[_0x2bfa('0x23')](handleEntityNotFound(_0x751b04,null))[_0x2bfa('0x23')](removeEntity(_0x751b04,null))[_0x2bfa('0x42')](handleError(_0x751b04,null));};exports[_0x2bfa('0x51')]=function(_0x2a1a01,_0x5f4db5,_0x283464){if(_0x2a1a01[_0x2bfa('0x49')]['id']){delete _0x2a1a01[_0x2bfa('0x49')]['id'];}return db[_0x2bfa('0x40')][_0x2bfa('0x47')]({'where':{'id':_0x2a1a01['params']['id']}})[_0x2bfa('0x23')](handleEntityNotFound(_0x5f4db5,null))[_0x2bfa('0x23')](function(_0x4acfee){if(_0x4acfee){_0x2a1a01[_0x2bfa('0x49')][_0x2bfa('0x52')]=_0x4acfee['id'];return db['Interval'][_0x2bfa('0x48')](_0x2a1a01[_0x2bfa('0x49')]);}})[_0x2bfa('0x23')](respondWithResult(_0x5f4db5,null))[_0x2bfa('0x42')](handleError(_0x5f4db5,null));};exports['getIntervals']=function(_0x2c2332,_0x36c738,_0x56a014){var _0x583021={};var _0x3328e4={};var _0x2173d6;var _0x376acb;return db[_0x2bfa('0x40')][_0x2bfa('0x53')]({'where':{'id':_0x2c2332[_0x2bfa('0x44')]['id']}})[_0x2bfa('0x23')](handleEntityNotFound(_0x36c738,null))[_0x2bfa('0x23')](function(_0x8462f6){if(_0x8462f6){_0x2173d6=_0x8462f6;_0x3328e4[_0x2bfa('0x30')]=_[_0x2bfa('0x31')](db[_0x2bfa('0x40')][_0x2bfa('0x2d')]);_0x3328e4[_0x2bfa('0x32')]=_[_0x2bfa('0x31')](_0x2c2332[_0x2bfa('0x32')]);_0x3328e4['filters']=_[_0x2bfa('0x34')](_0x3328e4[_0x2bfa('0x30')],_0x3328e4[_0x2bfa('0x32')]);_0x583021[_0x2bfa('0x33')]=_[_0x2bfa('0x34')](_0x3328e4['model'],qs[_0x2bfa('0x35')](_0x2c2332[_0x2bfa('0x32')][_0x2bfa('0x35')]));_0x583021['attributes']=_0x583021[_0x2bfa('0x33')]['length']?_0x583021['attributes']:_0x3328e4['model'];_0x583021['order']=qs[_0x2bfa('0x3a')](_0x2c2332[_0x2bfa('0x32')][_0x2bfa('0x3a')]);_0x583021[_0x2bfa('0x3d')]=qs[_0x2bfa('0x3b')](_[_0x2bfa('0x3c')](_0x2c2332[_0x2bfa('0x32')],_0x3328e4['filters']));if(_0x2c2332[_0x2bfa('0x32')][_0x2bfa('0x3f')]){_0x583021['where']=_[_0x2bfa('0x3e')](_0x583021['where'],{'$or':_[_0x2bfa('0x2c')](_0x583021[_0x2bfa('0x33')],function(_0x3c33b7){var _0x732ae5={};_0x732ae5[_0x3c33b7]={'$like':'%'+_0x2c2332[_0x2bfa('0x32')][_0x2bfa('0x3f')]+'%'};return _0x732ae5;})});}_0x583021=_['merge']({},_0x583021,_0x2c2332['options']);return _0x2173d6[_0x2bfa('0x54')](_0x583021);}})[_0x2bfa('0x23')](function(_0x4cc4e3){if(_0x4cc4e3){_0x376acb=_0x4cc4e3['length'];if(!_0x2c2332[_0x2bfa('0x32')]['hasOwnProperty']('nolimit')){_0x583021[_0x2bfa('0x39')]=qs[_0x2bfa('0x39')](_0x2c2332['query'][_0x2bfa('0x39')]);_0x583021[_0x2bfa('0x1f')]=qs['offset'](_0x2c2332[_0x2bfa('0x32')][_0x2bfa('0x1f')]);}return _0x2173d6['getIntervals'](_0x583021);}})[_0x2bfa('0x23')](function(_0x113de5){if(_0x113de5){return _0x113de5?{'count':_0x376acb,'rows':_0x113de5}:null;}})['then'](respondWithResult(_0x36c738,null))[_0x2bfa('0x42')](handleError(_0x36c738,null));};exports['addIntervals']=function(_0x1f9651,_0x3bc9ef,_0x17451a){return db[_0x2bfa('0x40')][_0x2bfa('0x53')]({'where':{'id':_0x1f9651[_0x2bfa('0x44')]['id']}})[_0x2bfa('0x23')](handleEntityNotFound(_0x3bc9ef,null))[_0x2bfa('0x23')](function(_0x35ca33){if(_0x35ca33){return db[_0x2bfa('0x55')]['transaction'](function(_0x24b15e){return db['Interval'][_0x2bfa('0x24')]({'where':{'IntervalId':_0x1f9651[_0x2bfa('0x44')]['id']},'transaction':_0x24b15e})['then'](function(_0x343cc1){var _0xe63fd3=_[_0x2bfa('0x2c')](_0x1f9651[_0x2bfa('0x49')],function(_0x103932){delete _0x103932['id'];_0x103932[_0x2bfa('0x52')]=_0x1f9651[_0x2bfa('0x44')]['id'];return _0x103932;});return db['Interval'][_0x2bfa('0x56')](_0xe63fd3,{'transaction':_0x24b15e});});})['then'](function(){return db[_0x2bfa('0x40')][_0x2bfa('0x57')]({'where':{'IntervalId':_0x1f9651[_0x2bfa('0x44')]['id']}});});}})[_0x2bfa('0x23')](respondWithResult(_0x3bc9ef,null))[_0x2bfa('0x42')](handleError(_0x3bc9ef,null));};
\ No newline at end of file
+var _0x6609=['squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/extensions/rewrite','sendStatus','status','json','count','offset','apply','reject','update','then','destroy','get','Intervals','UserProfileResource','end','error','stack','name','send','index','map','fieldName','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','type','VIRTUAL','Interval','includeAll','include','findAll','catch','params','rawAttributes','options','find','create','body','UserProfileSection','userProfileId','addInterval','getIntervals','findOne','merge','addIntervals','sequelize','transaction','IntervalId','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','lodash'];(function(_0x58dadc,_0x3c1e1d){var _0x1d5749=function(_0x1ea4e1){while(--_0x1ea4e1){_0x58dadc['push'](_0x58dadc['shift']());}};_0x1d5749(++_0x3c1e1d);}(_0x6609,0xef));var _0x9660=function(_0x2d41bb,_0x2c0643){_0x2d41bb=_0x2d41bb-0x0;var _0x2589e0=_0x6609[_0x2d41bb];return _0x2589e0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9660('0x0'));var rimraf=require(_0x9660('0x1'));var zipdir=require(_0x9660('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9660('0x3'));var moment=require(_0x9660('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9660('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9660('0x6'));var csv=require(_0x9660('0x7'));var ejs=require(_0x9660('0x8'));var fs=require('fs');var _=require(_0x9660('0x9'));var squel=require(_0x9660('0xa'));var crypto=require('crypto');var jsforce=require(_0x9660('0xb'));var deskjs=require(_0x9660('0xc'));var toCsv=require(_0x9660('0x7'));var querystring=require(_0x9660('0xd'));var Papa=require('papaparse');var Redis=require(_0x9660('0xe'));var authService=require(_0x9660('0xf'));var qs=require(_0x9660('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9660('0x11'));var logger=require(_0x9660('0x12'))('api');var utils=require(_0x9660('0x13'));var config=require(_0x9660('0x14'));var db=require('../../mysqldb')['db'];var extensions=require(_0x9660('0x15'));function respondWithStatusCode(_0x5db4d6,_0x185d72){_0x185d72=_0x185d72||0xcc;return function(_0x1c43d3){if(_0x1c43d3){return _0x5db4d6[_0x9660('0x16')](_0x185d72);}return _0x5db4d6[_0x9660('0x17')](_0x185d72)['end']();};}function respondWithResult(_0x354da9,_0xbf8b2f){_0xbf8b2f=_0xbf8b2f||0xc8;return function(_0x574dca){if(_0x574dca){return _0x354da9['status'](_0xbf8b2f)[_0x9660('0x18')](_0x574dca);}};}function respondWithFilteredResult(_0x5f39da,_0xf66768){return function(_0x5d0800){if(_0x5d0800){var _0x27a428=_0x5d0800[_0x9660('0x19')],_0x25f1cb=_0xf66768[_0x9660('0x1a')],_0x277015=_0xf66768['offset']+_0xf66768['limit'],_0x9d8adc;if(_0x277015>=_0x27a428){_0x277015=_0x27a428;_0x9d8adc=0xc8;}else{_0x9d8adc=0xce;}_0x5f39da['status'](_0x9d8adc);return _0x5f39da['set']('Content-Range',_0x25f1cb+'-'+_0x277015+'/'+_0x27a428)[_0x9660('0x18')](_0x5d0800);}return null;};}function patchUpdates(_0x2f5899){return function(_0x4b09a5){try{jsonpatch[_0x9660('0x1b')](_0x4b09a5,_0x2f5899,!![]);}catch(_0x4a5632){return BPromise[_0x9660('0x1c')](_0x4a5632);}return _0x4b09a5['save']();};}function saveUpdates(_0x364378,_0x72753){return function(_0x2429b3){if(_0x2429b3){return _0x2429b3[_0x9660('0x1d')](_0x364378)[_0x9660('0x1e')](function(_0x13ae2b){return _0x13ae2b;});}return null;};}function removeEntity(_0x3287b6,_0x56b7ee){return function(_0x25a5b4){if(_0x25a5b4){return _0x25a5b4[_0x9660('0x1f')]()[_0x9660('0x1e')](function(){var _0x3a15fa=_0x25a5b4[_0x9660('0x20')]({'plain':!![]});var _0x310a45=_0x9660('0x21');return db[_0x9660('0x22')][_0x9660('0x1f')]({'where':{'type':_0x310a45,'resourceId':_0x3a15fa['id']}})[_0x9660('0x1e')](function(){return _0x25a5b4;});})[_0x9660('0x1e')](function(){_0x3287b6[_0x9660('0x17')](0xcc)[_0x9660('0x23')]();});}};}function handleEntityNotFound(_0x35eaf3,_0x44941b){return function(_0x13e50f){if(!_0x13e50f){_0x35eaf3['sendStatus'](0x194);}return _0x13e50f;};}function handleError(_0x5a3af5,_0x2cd249){_0x2cd249=_0x2cd249||0x1f4;return function(_0x33c4c7){logger[_0x9660('0x24')](_0x33c4c7[_0x9660('0x25')]);if(_0x33c4c7[_0x9660('0x26')]){delete _0x33c4c7[_0x9660('0x26')];}_0x5a3af5[_0x9660('0x17')](_0x2cd249)[_0x9660('0x27')](_0x33c4c7);};}exports[_0x9660('0x28')]=function(_0x4c9831,_0x5b3101){var _0x54d655={},_0x5eed3d={},_0x15da1a={'count':0x0,'rows':[]};var _0x257fce=_[_0x9660('0x29')](db['Interval']['rawAttributes'],function(_0x16a8ef){return{'name':_0x16a8ef[_0x9660('0x2a')],'type':_0x16a8ef['type'][_0x9660('0x2b')]};});_0x5eed3d['model']=_[_0x9660('0x29')](_0x257fce,_0x9660('0x26'));_0x5eed3d[_0x9660('0x2c')]=_[_0x9660('0x2d')](_0x4c9831[_0x9660('0x2c')]);_0x5eed3d['filters']=_['intersection'](_0x5eed3d['model'],_0x5eed3d['query']);_0x54d655[_0x9660('0x2e')]=_[_0x9660('0x2f')](_0x5eed3d[_0x9660('0x30')],qs[_0x9660('0x31')](_0x4c9831[_0x9660('0x2c')][_0x9660('0x31')]));_0x54d655[_0x9660('0x2e')]=_0x54d655[_0x9660('0x2e')][_0x9660('0x32')]?_0x54d655[_0x9660('0x2e')]:_0x5eed3d[_0x9660('0x30')];if(!_0x4c9831[_0x9660('0x2c')][_0x9660('0x33')](_0x9660('0x34'))){_0x54d655['limit']=qs[_0x9660('0x35')](_0x4c9831[_0x9660('0x2c')][_0x9660('0x35')]);_0x54d655['offset']=qs[_0x9660('0x1a')](_0x4c9831[_0x9660('0x2c')]['offset']);}_0x54d655[_0x9660('0x36')]=qs['sort'](_0x4c9831[_0x9660('0x2c')][_0x9660('0x37')]);_0x54d655[_0x9660('0x38')]=qs[_0x9660('0x39')](_[_0x9660('0x3a')](_0x4c9831['query'],_0x5eed3d['filters']),_0x257fce);if(_0x4c9831[_0x9660('0x2c')][_0x9660('0x3b')]){_0x54d655[_0x9660('0x38')]=_['merge'](_0x54d655['where'],{'$or':_[_0x9660('0x29')](_0x257fce,function(_0x16c862){if(_0x16c862[_0x9660('0x3c')]!==_0x9660('0x3d')){var _0x3a9cde={};_0x3a9cde[_0x16c862[_0x9660('0x26')]]={'$like':'%'+_0x4c9831[_0x9660('0x2c')][_0x9660('0x3b')]+'%'};return _0x3a9cde;}})});}_0x54d655=_['merge']({},_0x54d655,_0x4c9831['options']);var _0xf5a33b={'where':_0x54d655[_0x9660('0x38')]};return db[_0x9660('0x3e')][_0x9660('0x19')](_0xf5a33b)['then'](function(_0x23cb04){_0x15da1a[_0x9660('0x19')]=_0x23cb04;if(_0x4c9831[_0x9660('0x2c')][_0x9660('0x3f')]){_0x54d655[_0x9660('0x40')]=[{'all':!![]}];}return db[_0x9660('0x3e')][_0x9660('0x41')](_0x54d655);})['then'](function(_0xedd85b){_0x15da1a['rows']=_0xedd85b;return _0x15da1a;})[_0x9660('0x1e')](respondWithFilteredResult(_0x5b3101,_0x54d655))[_0x9660('0x42')](handleError(_0x5b3101,null));};exports['show']=function(_0x5e52d4,_0x5b123b){var _0x38b45b={'raw':!![],'where':{'id':_0x5e52d4[_0x9660('0x43')]['id']}},_0x1783db={};_0x1783db[_0x9660('0x30')]=_[_0x9660('0x2d')](db[_0x9660('0x3e')][_0x9660('0x44')]);_0x1783db[_0x9660('0x2c')]=_['keys'](_0x5e52d4['query']);_0x1783db['filters']=_[_0x9660('0x2f')](_0x1783db[_0x9660('0x30')],_0x1783db[_0x9660('0x2c')]);_0x38b45b[_0x9660('0x2e')]=_[_0x9660('0x2f')](_0x1783db[_0x9660('0x30')],qs[_0x9660('0x31')](_0x5e52d4[_0x9660('0x2c')][_0x9660('0x31')]));_0x38b45b[_0x9660('0x2e')]=_0x38b45b[_0x9660('0x2e')][_0x9660('0x32')]?_0x38b45b[_0x9660('0x2e')]:_0x1783db[_0x9660('0x30')];if(_0x5e52d4['query'][_0x9660('0x3f')]){_0x38b45b[_0x9660('0x40')]=[{'all':!![]}];}_0x38b45b=_['merge']({},_0x38b45b,_0x5e52d4[_0x9660('0x45')]);return db[_0x9660('0x3e')][_0x9660('0x46')](_0x38b45b)[_0x9660('0x1e')](handleEntityNotFound(_0x5b123b,null))[_0x9660('0x1e')](respondWithResult(_0x5b123b,null))[_0x9660('0x42')](handleError(_0x5b123b,null));};exports[_0x9660('0x47')]=function(_0xf52d03,_0x456a27){return db['Interval'][_0x9660('0x47')](_0xf52d03[_0x9660('0x48')],{})['then'](function(_0x5d78b6){var _0x58888a=_0xf52d03['user'][_0x9660('0x20')]({'plain':!![]});if(!_0x58888a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58888a['role']==='user'){var _0x49f56b=_0x5d78b6[_0x9660('0x20')]({'plain':!![]});var _0x383c84=_0x9660('0x21');return db[_0x9660('0x49')][_0x9660('0x46')]({'where':{'name':_0x383c84,'userProfileId':_0x58888a[_0x9660('0x4a')]},'raw':!![]})[_0x9660('0x1e')](function(_0x3d71ed){if(_0x3d71ed&&_0x3d71ed['autoAssociation']===0x0){return db[_0x9660('0x22')][_0x9660('0x47')]({'name':_0x49f56b['name'],'resourceId':_0x49f56b['id'],'type':_0x3d71ed[_0x9660('0x26')],'sectionId':_0x3d71ed['id']},{})[_0x9660('0x1e')](function(){return _0x5d78b6;});}else{return _0x5d78b6;}})[_0x9660('0x42')](function(_0x2c8c3f){logger[_0x9660('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c8c3f);throw _0x2c8c3f;});}return _0x5d78b6;})[_0x9660('0x1e')](respondWithResult(_0x456a27,0xc9))[_0x9660('0x42')](handleError(_0x456a27,null));};exports[_0x9660('0x1d')]=function(_0x1e6e64,_0x371ea2){if(_0x1e6e64[_0x9660('0x48')]['id']){delete _0x1e6e64[_0x9660('0x48')]['id'];}return db['Interval']['find']({'where':{'id':_0x1e6e64['params']['id']}})[_0x9660('0x1e')](handleEntityNotFound(_0x371ea2,null))[_0x9660('0x1e')](saveUpdates(_0x1e6e64['body'],null))[_0x9660('0x1e')](respondWithResult(_0x371ea2,null))['catch'](handleError(_0x371ea2,null));};exports[_0x9660('0x1f')]=function(_0x3c78f1,_0x66007f){return db[_0x9660('0x3e')][_0x9660('0x46')]({'where':{'id':_0x3c78f1[_0x9660('0x43')]['id']}})[_0x9660('0x1e')](handleEntityNotFound(_0x66007f,null))[_0x9660('0x1e')](removeEntity(_0x66007f,null))[_0x9660('0x42')](handleError(_0x66007f,null));};exports[_0x9660('0x4b')]=function(_0x3c5419,_0x293c31,_0x319d65){if(_0x3c5419[_0x9660('0x48')]['id']){delete _0x3c5419[_0x9660('0x48')]['id'];}return db[_0x9660('0x3e')]['find']({'where':{'id':_0x3c5419[_0x9660('0x43')]['id']}})[_0x9660('0x1e')](handleEntityNotFound(_0x293c31,null))[_0x9660('0x1e')](function(_0x5574ea){if(_0x5574ea){_0x3c5419[_0x9660('0x48')]['IntervalId']=_0x5574ea['id'];return db[_0x9660('0x3e')][_0x9660('0x47')](_0x3c5419['body']);}})[_0x9660('0x1e')](respondWithResult(_0x293c31,null))[_0x9660('0x42')](handleError(_0x293c31,null));};exports[_0x9660('0x4c')]=function(_0x497ef4,_0x1a8b2a,_0x1a5ed0){var _0x1f81c0={};var _0x5511f8={};var _0x536aa8;var _0x46aa13;return db[_0x9660('0x3e')][_0x9660('0x4d')]({'where':{'id':_0x497ef4['params']['id']}})['then'](handleEntityNotFound(_0x1a8b2a,null))[_0x9660('0x1e')](function(_0x41dcec){if(_0x41dcec){_0x536aa8=_0x41dcec;_0x5511f8[_0x9660('0x30')]=_['keys'](db[_0x9660('0x3e')]['rawAttributes']);_0x5511f8[_0x9660('0x2c')]=_[_0x9660('0x2d')](_0x497ef4['query']);_0x5511f8['filters']=_['intersection'](_0x5511f8['model'],_0x5511f8[_0x9660('0x2c')]);_0x1f81c0[_0x9660('0x2e')]=_[_0x9660('0x2f')](_0x5511f8[_0x9660('0x30')],qs[_0x9660('0x31')](_0x497ef4[_0x9660('0x2c')][_0x9660('0x31')]));_0x1f81c0[_0x9660('0x2e')]=_0x1f81c0[_0x9660('0x2e')][_0x9660('0x32')]?_0x1f81c0['attributes']:_0x5511f8[_0x9660('0x30')];_0x1f81c0[_0x9660('0x36')]=qs[_0x9660('0x37')](_0x497ef4['query'][_0x9660('0x37')]);_0x1f81c0[_0x9660('0x38')]=qs[_0x9660('0x39')](_[_0x9660('0x3a')](_0x497ef4[_0x9660('0x2c')],_0x5511f8[_0x9660('0x39')]));if(_0x497ef4[_0x9660('0x2c')][_0x9660('0x3b')]){_0x1f81c0[_0x9660('0x38')]=_['merge'](_0x1f81c0[_0x9660('0x38')],{'$or':_['map'](_0x1f81c0[_0x9660('0x2e')],function(_0x14d999){var _0x272b00={};_0x272b00[_0x14d999]={'$like':'%'+_0x497ef4[_0x9660('0x2c')][_0x9660('0x3b')]+'%'};return _0x272b00;})});}_0x1f81c0=_[_0x9660('0x4e')]({},_0x1f81c0,_0x497ef4[_0x9660('0x45')]);return _0x536aa8[_0x9660('0x4c')](_0x1f81c0);}})[_0x9660('0x1e')](function(_0x4ff07f){if(_0x4ff07f){_0x46aa13=_0x4ff07f['length'];if(!_0x497ef4[_0x9660('0x2c')]['hasOwnProperty']('nolimit')){_0x1f81c0[_0x9660('0x35')]=qs[_0x9660('0x35')](_0x497ef4[_0x9660('0x2c')]['limit']);_0x1f81c0[_0x9660('0x1a')]=qs[_0x9660('0x1a')](_0x497ef4[_0x9660('0x2c')][_0x9660('0x1a')]);}return _0x536aa8[_0x9660('0x4c')](_0x1f81c0);}})[_0x9660('0x1e')](function(_0x53e914){if(_0x53e914){return _0x53e914?{'count':_0x46aa13,'rows':_0x53e914}:null;}})[_0x9660('0x1e')](respondWithResult(_0x1a8b2a,null))[_0x9660('0x42')](handleError(_0x1a8b2a,null));};exports[_0x9660('0x4f')]=function(_0x5e805e,_0x4d434c,_0x4c5395){return db['Interval']['findOne']({'where':{'id':_0x5e805e[_0x9660('0x43')]['id']}})['then'](handleEntityNotFound(_0x4d434c,null))[_0x9660('0x1e')](function(_0x570d15){if(_0x570d15){return db[_0x9660('0x50')][_0x9660('0x51')](function(_0x4a2e05){return db['Interval']['destroy']({'where':{'IntervalId':_0x5e805e[_0x9660('0x43')]['id']},'transaction':_0x4a2e05})[_0x9660('0x1e')](function(_0x2d147a){var _0x54c53e=_[_0x9660('0x29')](_0x5e805e[_0x9660('0x48')],function(_0x3f166e){delete _0x3f166e['id'];_0x3f166e[_0x9660('0x52')]=_0x5e805e[_0x9660('0x43')]['id'];return _0x3f166e;});return db[_0x9660('0x3e')]['bulkCreate'](_0x54c53e,{'transaction':_0x4a2e05});});})['then'](function(){return db[_0x9660('0x3e')][_0x9660('0x41')]({'where':{'IntervalId':_0x5e805e[_0x9660('0x43')]['id']}});});}})[_0x9660('0x1e')](respondWithResult(_0x4d434c,null))['catch'](handleError(_0x4d434c,null));};
\ No newline at end of file
index 80fc3a8..bfeec5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6e8=['api','moment','bluebird','request-promise','rimraf','./interval.attributes','../../components/extensions/rewrite','define','Interval','tools_intervals','rewrite','util','../../config/logger'];(function(_0x3ce7e9,_0x5094df){var _0x2b9ab7=function(_0x351538){while(--_0x351538){_0x3ce7e9['push'](_0x3ce7e9['shift']());}};_0x2b9ab7(++_0x5094df);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x43a5d7,_0x2d037f){_0x43a5d7=_0x43a5d7-0x0;var _0xe927b=_0xf6e8[_0x43a5d7];return _0xe927b;};'use strict';var _=require('lodash');var util=require(_0x8f6e('0x0'));var logger=require(_0x8f6e('0x1'))(_0x8f6e('0x2'));var moment=require(_0x8f6e('0x3'));var BPromise=require(_0x8f6e('0x4'));var rp=require(_0x8f6e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f6e('0x6'));var config=require('../../config/environment');var attributes=require(_0x8f6e('0x7'));var extensions=require(_0x8f6e('0x8'));module['exports']=function(_0x7b6df3,_0x233158){return _0x7b6df3[_0x8f6e('0x9')](_0x8f6e('0xa'),attributes,{'tableName':_0x8f6e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x105076,_0x3df5fd){extensions[_0x8f6e('0xc')](_0x7b6df3,_0x105076);},'afterBulkCreate':function(_0x364ade,_0x35f528,_0x5b62d7){_0x5b62d7();extensions[_0x8f6e('0xc')](_0x7b6df3,_0x364ade[0x0]);},'afterUpdate':function(_0x1668bf,_0x4de3d0){extensions[_0x8f6e('0xc')](_0x7b6df3,_0x1668bf);},'afterDestroy':function(_0x11c98f,_0xa86c9b){extensions[_0x8f6e('0xc')](_0x7b6df3,_0x11c98f);}}});};
\ No newline at end of file
+var _0x2116=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','Interval','tools_intervals','rewrite','util'];(function(_0x415dd7,_0x291b82){var _0x221384=function(_0x5f3590){while(--_0x5f3590){_0x415dd7['push'](_0x415dd7['shift']());}};_0x221384(++_0x291b82);}(_0x2116,0x67));var _0x6211=function(_0x5c509c,_0x123d62){_0x5c509c=_0x5c509c-0x0;var _0x3da3be=_0x2116[_0x5c509c];return _0x3da3be;};'use strict';var _=require('lodash');var util=require(_0x6211('0x0'));var logger=require('../../config/logger')(_0x6211('0x1'));var moment=require(_0x6211('0x2'));var BPromise=require(_0x6211('0x3'));var rp=require(_0x6211('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6211('0x5'));var config=require(_0x6211('0x6'));var attributes=require(_0x6211('0x7'));var extensions=require(_0x6211('0x8'));module['exports']=function(_0x37d71a,_0x57f7e7){return _0x37d71a[_0x6211('0x9')](_0x6211('0xa'),attributes,{'tableName':_0x6211('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x31914a,_0x837b82){extensions[_0x6211('0xc')](_0x37d71a,_0x31914a);},'afterBulkCreate':function(_0x10bb82,_0x5eb8a5,_0x135182){_0x135182();extensions[_0x6211('0xc')](_0x37d71a,_0x10bb82[0x0]);},'afterUpdate':function(_0x245e56,_0x1e0634){extensions[_0x6211('0xc')](_0x37d71a,_0x245e56);},'afterDestroy':function(_0x2f6474,_0x1b0938){extensions['rewrite'](_0x37d71a,_0x2f6474);}}});};
\ No newline at end of file
index 9c8b9f5..214c1ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b71=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','GetInterval','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowInterval','find','lodash','moment','bluebird'];(function(_0x523a84,_0x323a6f){var _0x262335=function(_0x3c036c){while(--_0x3c036c){_0x523a84['push'](_0x523a84['shift']());}};_0x262335(++_0x323a6f);}(_0x0b71,0x1d1));var _0x10b7=function(_0x2ee973,_0x284293){_0x2ee973=_0x2ee973-0x0;var _0x2b5468=_0x0b71[_0x2ee973];return _0x2b5468;};'use strict';var _=require(_0x10b7('0x0'));var util=require('util');var moment=require(_0x10b7('0x1'));var BPromise=require(_0x10b7('0x2'));var rs=require(_0x10b7('0x3'));var fs=require('fs');var Redis=require(_0x10b7('0x4'));var db=require(_0x10b7('0x5'))['db'];var utils=require(_0x10b7('0x6'));var logger=require(_0x10b7('0x7'))(_0x10b7('0x8'));var config=require(_0x10b7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x10b7('0xa')][_0x10b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x494058,_0x3d61a0,_0x1796af){return new BPromise(function(_0x3f81a3,_0x2ca868){return client['request'](_0x494058,_0x1796af)[_0x10b7('0xc')](function(_0x2bc8f9){logger['info'](_0x10b7('0xd'),_0x3d61a0,_0x10b7('0xe'));logger[_0x10b7('0xf')](_0x10b7('0x10'),_0x3d61a0,_0x10b7('0xe'),JSON[_0x10b7('0x11')](_0x2bc8f9));if(_0x2bc8f9['error']){if(_0x2bc8f9['error'][_0x10b7('0x12')]===0x1f4){logger['error'](_0x10b7('0xd'),_0x3d61a0,_0x2bc8f9[_0x10b7('0x13')][_0x10b7('0x14')]);return _0x2ca868(_0x2bc8f9[_0x10b7('0x13')][_0x10b7('0x14')]);}logger[_0x10b7('0x13')]('Interval,\x20%s,\x20%s',_0x3d61a0,_0x2bc8f9[_0x10b7('0x13')][_0x10b7('0x14')]);return _0x3f81a3(_0x2bc8f9[_0x10b7('0x13')][_0x10b7('0x14')]);}else{logger[_0x10b7('0x15')](_0x10b7('0xd'),_0x3d61a0,_0x10b7('0xe'));_0x3f81a3(_0x2bc8f9[_0x10b7('0x16')][_0x10b7('0x14')]);}})['catch'](function(_0x20701e){logger['error'](_0x10b7('0xd'),_0x3d61a0,_0x20701e);_0x2ca868(_0x20701e);});});}exports[_0x10b7('0x17')]=function(_0x546318){var _0x59cb61=this;return new Promise(function(_0x3fcc75,_0x35ca1e){return db['Interval'][_0x10b7('0x18')]({'raw':_0x546318[_0x10b7('0x19')]?_0x546318[_0x10b7('0x19')][_0x10b7('0x1a')]===undefined?!![]:![]:!![],'where':_0x546318['options']?_0x546318[_0x10b7('0x19')][_0x10b7('0x1b')]||null:null,'attributes':_0x546318[_0x10b7('0x19')]?_0x546318[_0x10b7('0x19')][_0x10b7('0x1c')]||null:null,'limit':_0x546318[_0x10b7('0x19')]?_0x546318[_0x10b7('0x19')][_0x10b7('0x1d')]||null:null,'include':_0x546318[_0x10b7('0x19')]?_0x546318['options'][_0x10b7('0x1e')]?_[_0x10b7('0x1f')](_0x546318[_0x10b7('0x19')][_0x10b7('0x1e')],function(_0x45c310){return{'model':db[_0x45c310[_0x10b7('0x20')]],'as':_0x45c310['as'],'attributes':_0x45c310[_0x10b7('0x1c')],'include':_0x45c310[_0x10b7('0x1e')]?_[_0x10b7('0x1f')](_0x45c310[_0x10b7('0x1e')],function(_0x4d023e){return{'model':db[_0x4d023e['model']],'as':_0x4d023e['as'],'attributes':_0x4d023e[_0x10b7('0x1c')],'include':_0x4d023e['include']?_[_0x10b7('0x1f')](_0x4d023e[_0x10b7('0x1e')],function(_0x3c4c51){return{'model':db[_0x3c4c51['model']],'as':_0x3c4c51['as'],'attributes':_0x3c4c51[_0x10b7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x10b7('0xc')](function(_0x404a1a){logger[_0x10b7('0x15')](_0x10b7('0x17'),_0x546318);logger[_0x10b7('0xf')](_0x10b7('0x17'),_0x546318,JSON['stringify'](_0x404a1a));_0x3fcc75(_0x404a1a);})[_0x10b7('0x21')](function(_0x1e2da7){logger[_0x10b7('0x13')]('GetInterval',_0x1e2da7[_0x10b7('0x14')],_0x546318);_0x35ca1e(_0x59cb61['error'](0x1f4,_0x1e2da7['message']));});});};exports[_0x10b7('0x22')]=function(_0x161d8a){var _0x36e308=this;return new Promise(function(_0x527cb3,_0x28622b){return db['Interval'][_0x10b7('0x23')]({'raw':_0x161d8a[_0x10b7('0x19')]?_0x161d8a[_0x10b7('0x19')][_0x10b7('0x1a')]===undefined?!![]:![]:!![],'where':_0x161d8a[_0x10b7('0x19')]?_0x161d8a[_0x10b7('0x19')][_0x10b7('0x1b')]||null:null,'attributes':_0x161d8a[_0x10b7('0x19')]?_0x161d8a[_0x10b7('0x19')][_0x10b7('0x1c')]||null:null,'include':_0x161d8a[_0x10b7('0x19')]?_0x161d8a[_0x10b7('0x19')][_0x10b7('0x1e')]?_[_0x10b7('0x1f')](_0x161d8a[_0x10b7('0x19')][_0x10b7('0x1e')],function(_0x5c7520){return{'model':db[_0x5c7520[_0x10b7('0x20')]],'as':_0x5c7520['as'],'attributes':_0x5c7520[_0x10b7('0x1c')],'include':_0x5c7520[_0x10b7('0x1e')]?_[_0x10b7('0x1f')](_0x5c7520[_0x10b7('0x1e')],function(_0x1f906e){return{'model':db[_0x1f906e['model']],'as':_0x1f906e['as'],'attributes':_0x1f906e[_0x10b7('0x1c')],'include':_0x1f906e[_0x10b7('0x1e')]?_[_0x10b7('0x1f')](_0x1f906e['include'],function(_0x6102d1){return{'model':db[_0x6102d1[_0x10b7('0x20')]],'as':_0x6102d1['as'],'attributes':_0x6102d1[_0x10b7('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47a46c){logger[_0x10b7('0x15')](_0x10b7('0x22'),_0x161d8a);logger['debug'](_0x10b7('0x22'),_0x161d8a,JSON['stringify'](_0x47a46c));_0x527cb3(_0x47a46c);})[_0x10b7('0x21')](function(_0x5b9b64){logger['error']('ShowInterval',_0x5b9b64[_0x10b7('0x14')],_0x161d8a);_0x28622b(_0x36e308['error'](0x1f4,_0x5b9b64['message']));});});};
\ No newline at end of file
+var _0x85c9=['then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetInterval','Interval','findAll','options','raw','attributes','limit','include','map','model','ShowInterval','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x4c1ac4,_0x2cca46){var _0x44f0fd=function(_0x438672){while(--_0x438672){_0x4c1ac4['push'](_0x4c1ac4['shift']());}};_0x44f0fd(++_0x2cca46);}(_0x85c9,0x113));var _0x985c=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x85c9[_0x588011];return _0x3b3773;};'use strict';var _=require(_0x985c('0x0'));var util=require(_0x985c('0x1'));var moment=require(_0x985c('0x2'));var BPromise=require('bluebird');var rs=require(_0x985c('0x3'));var fs=require('fs');var Redis=require(_0x985c('0x4'));var db=require(_0x985c('0x5'))['db'];var utils=require(_0x985c('0x6'));var logger=require(_0x985c('0x7'))(_0x985c('0x8'));var config=require('../../config/environment');var jayson=require(_0x985c('0x9'));var client=jayson[_0x985c('0xa')][_0x985c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9393,_0x58dbd0,_0x282fb4){return new BPromise(function(_0xfc9983,_0x431bda){return client[_0x985c('0xc')](_0x3f9393,_0x282fb4)[_0x985c('0xd')](function(_0x5420d1){logger[_0x985c('0xe')](_0x985c('0xf'),_0x58dbd0,_0x985c('0x10'));logger[_0x985c('0x11')](_0x985c('0x12'),_0x58dbd0,'request\x20sent',JSON[_0x985c('0x13')](_0x5420d1));if(_0x5420d1[_0x985c('0x14')]){if(_0x5420d1['error'][_0x985c('0x15')]===0x1f4){logger[_0x985c('0x14')]('Interval,\x20%s,\x20%s',_0x58dbd0,_0x5420d1[_0x985c('0x14')][_0x985c('0x16')]);return _0x431bda(_0x5420d1['error'][_0x985c('0x16')]);}logger['error']('Interval,\x20%s,\x20%s',_0x58dbd0,_0x5420d1['error'][_0x985c('0x16')]);return _0xfc9983(_0x5420d1['error'][_0x985c('0x16')]);}else{logger['info'](_0x985c('0xf'),_0x58dbd0,_0x985c('0x10'));_0xfc9983(_0x5420d1[_0x985c('0x17')][_0x985c('0x16')]);}})[_0x985c('0x18')](function(_0x1086f2){logger[_0x985c('0x14')](_0x985c('0xf'),_0x58dbd0,_0x1086f2);_0x431bda(_0x1086f2);});});}exports[_0x985c('0x19')]=function(_0x460628){var _0x571910=this;return new Promise(function(_0x39cc5e,_0x15242b){return db[_0x985c('0x1a')][_0x985c('0x1b')]({'raw':_0x460628[_0x985c('0x1c')]?_0x460628[_0x985c('0x1c')][_0x985c('0x1d')]===undefined?!![]:![]:!![],'where':_0x460628[_0x985c('0x1c')]?_0x460628['options']['where']||null:null,'attributes':_0x460628[_0x985c('0x1c')]?_0x460628[_0x985c('0x1c')][_0x985c('0x1e')]||null:null,'limit':_0x460628[_0x985c('0x1c')]?_0x460628[_0x985c('0x1c')][_0x985c('0x1f')]||null:null,'include':_0x460628[_0x985c('0x1c')]?_0x460628['options'][_0x985c('0x20')]?_[_0x985c('0x21')](_0x460628['options']['include'],function(_0x2e13b5){return{'model':db[_0x2e13b5['model']],'as':_0x2e13b5['as'],'attributes':_0x2e13b5[_0x985c('0x1e')],'include':_0x2e13b5[_0x985c('0x20')]?_[_0x985c('0x21')](_0x2e13b5[_0x985c('0x20')],function(_0x29996c){return{'model':db[_0x29996c['model']],'as':_0x29996c['as'],'attributes':_0x29996c[_0x985c('0x1e')],'include':_0x29996c[_0x985c('0x20')]?_['map'](_0x29996c[_0x985c('0x20')],function(_0x3adf5b){return{'model':db[_0x3adf5b[_0x985c('0x22')]],'as':_0x3adf5b['as'],'attributes':_0x3adf5b[_0x985c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x985c('0xd')](function(_0x4a2f90){logger['info'](_0x985c('0x19'),_0x460628);logger[_0x985c('0x11')]('GetInterval',_0x460628,JSON[_0x985c('0x13')](_0x4a2f90));_0x39cc5e(_0x4a2f90);})['catch'](function(_0x2f1043){logger[_0x985c('0x14')](_0x985c('0x19'),_0x2f1043['message'],_0x460628);_0x15242b(_0x571910[_0x985c('0x14')](0x1f4,_0x2f1043['message']));});});};exports[_0x985c('0x23')]=function(_0xfa0376){var _0xcedb21=this;return new Promise(function(_0x413fd8,_0x50069c){return db[_0x985c('0x1a')]['find']({'raw':_0xfa0376[_0x985c('0x1c')]?_0xfa0376[_0x985c('0x1c')][_0x985c('0x1d')]===undefined?!![]:![]:!![],'where':_0xfa0376['options']?_0xfa0376[_0x985c('0x1c')]['where']||null:null,'attributes':_0xfa0376[_0x985c('0x1c')]?_0xfa0376['options'][_0x985c('0x1e')]||null:null,'include':_0xfa0376[_0x985c('0x1c')]?_0xfa0376[_0x985c('0x1c')]['include']?_[_0x985c('0x21')](_0xfa0376[_0x985c('0x1c')][_0x985c('0x20')],function(_0x12f6f9){return{'model':db[_0x12f6f9[_0x985c('0x22')]],'as':_0x12f6f9['as'],'attributes':_0x12f6f9[_0x985c('0x1e')],'include':_0x12f6f9[_0x985c('0x20')]?_[_0x985c('0x21')](_0x12f6f9['include'],function(_0x35566f){return{'model':db[_0x35566f['model']],'as':_0x35566f['as'],'attributes':_0x35566f[_0x985c('0x1e')],'include':_0x35566f[_0x985c('0x20')]?_['map'](_0x35566f['include'],function(_0x157e9f){return{'model':db[_0x157e9f['model']],'as':_0x157e9f['as'],'attributes':_0x157e9f[_0x985c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x985c('0xd')](function(_0x39fda3){logger[_0x985c('0xe')](_0x985c('0x23'),_0xfa0376);logger['debug'](_0x985c('0x23'),_0xfa0376,JSON['stringify'](_0x39fda3));_0x413fd8(_0x39fda3);})[_0x985c('0x18')](function(_0x290ded){logger[_0x985c('0x14')]('ShowInterval',_0x290ded[_0x985c('0x16')],_0xfa0376);_0x50069c(_0xcedb21[_0x985c('0x14')](0x1f4,_0x290ded[_0x985c('0x16')]));});});};
\ No newline at end of file
index 14ba382..675eefa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94fe=['Router','../../components/auth/service','./jira.controller','post','isAuthenticated','send','exports','express'];(function(_0x35c923,_0x2d150b){var _0x142a94=function(_0x1de3b6){while(--_0x1de3b6){_0x35c923['push'](_0x35c923['shift']());}};_0x142a94(++_0x2d150b);}(_0x94fe,0x1b7));var _0xe94f=function(_0x321173,_0x15c891){_0x321173=_0x321173-0x0;var _0x5ae206=_0x94fe[_0x321173];return _0x5ae206;};'use strict';var express=require(_0xe94f('0x0'));var router=express[_0xe94f('0x1')]();var auth=require(_0xe94f('0x2'));var controller=require(_0xe94f('0x3'));router[_0xe94f('0x4')]('/',auth[_0xe94f('0x5')](),controller[_0xe94f('0x6')]);module[_0xe94f('0x7')]=router;
\ No newline at end of file
+var _0x716a=['../../components/auth/service','./jira.controller','post','send','exports'];(function(_0x2edc39,_0x41b27f){var _0x337772=function(_0x26431a){while(--_0x26431a){_0x2edc39['push'](_0x2edc39['shift']());}};_0x337772(++_0x41b27f);}(_0x716a,0x6e));var _0xa716=function(_0x3457b4,_0x4cd8f9){_0x3457b4=_0x3457b4-0x0;var _0xaa8fa9=_0x716a[_0x3457b4];return _0xaa8fa9;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xa716('0x0'));var controller=require(_0xa716('0x1'));router[_0xa716('0x2')]('/',auth['isAuthenticated'](),controller[_0xa716('0x3')]);module[_0xa716('0x4')]=router;
\ No newline at end of file
index 2e0882c..ff2c9fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08f0=['email','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','POST','toString','base64','stringify','setEncoding','utf8','end','status','statusCode','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','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','MOTGUI','\x20from\x20','description','issuetype','Bug','fields','customfield_11500'];(function(_0x24f86d,_0xeb119){var _0xaea28=function(_0x3bb446){while(--_0x3bb446){_0x24f86d['push'](_0x24f86d['shift']());}};_0xaea28(++_0xeb119);}(_0x08f0,0x127));var _0x008f=function(_0x5ee819,_0x10dc7c){_0x5ee819=_0x5ee819-0x0;var _0x30e020=_0x08f0[_0x5ee819];return _0x30e020;};'use strict';var BPromise=require(_0x008f('0x0'));var https=require(_0x008f('0x1'));var logger=require(_0x008f('0x2'))(_0x008f('0x3'));var USERNAME=_0x008f('0x4');var PASSWORD=_0x008f('0x5');function openIssue(_0x3a4a9d,_0x7e66ad){var _0x317325={'fields':{'project':{'key':_0x3a4a9d['key']||_0x008f('0x6')},'summary':(_0x3a4a9d['summary']||'Report')+_0x008f('0x7')+_0x3a4a9d['ip'],'description':_0x3a4a9d[_0x008f('0x8')]||JSON['stringify'](_0x3a4a9d),'issuetype':{'name':_0x3a4a9d[_0x008f('0x9')]||_0x008f('0xa')}}};_0x317325[_0x008f('0xb')][_0x008f('0xc')]=_0x3a4a9d[_0x008f('0xd')];_0x317325['fields'][_0x008f('0xe')]=_0x3a4a9d['oldToken'];_0x317325[_0x008f('0xb')][_0x008f('0xf')]=_0x3a4a9d[_0x008f('0x10')];_0x317325['fields'][_0x008f('0x11')]=_0x3a4a9d[_0x008f('0x12')];_0x317325['fields'][_0x008f('0x13')]=_0x3a4a9d[_0x008f('0x14')];_0x317325[_0x008f('0xb')]['customfield_10102']=_0x3a4a9d['ip'];var _0x433447={'host':_0x008f('0x15'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x008f('0x16'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x008f('0x17')](_0x008f('0x18'))}};var _0x5d59a9=JSON[_0x008f('0x19')](_0x317325);var _0x379d5d=https['request'](_0x433447,function(_0x41e7cc){_0x41e7cc[_0x008f('0x1a')](_0x008f('0x1b'));var _0x175f3d='';_0x41e7cc['on']('data',function(_0x50358d){_0x175f3d+=_0x50358d;});_0x41e7cc['on'](_0x008f('0x1c'),function(){if(_0x7e66ad){return _0x7e66ad[_0x008f('0x1d')](_0x41e7cc[_0x008f('0x1e')])[_0x008f('0x1f')](JSON[_0x008f('0x20')](_0x175f3d));}});});_0x379d5d['on'](_0x008f('0x21'),function(_0x598031){if(_0x7e66ad){return _0x7e66ad[_0x008f('0x1d')](0x1f4)[_0x008f('0x1f')]({'errors':[{'message':_0x008f('0x22'),'type':_0x008f('0x23')}]});}});_0x379d5d[_0x008f('0x24')](_0x5d59a9);_0x379d5d[_0x008f('0x1c')]();}exports[_0x008f('0x25')]=openIssue;exports[_0x008f('0x26')]=function(_0x19b2a3,_0x14106e){_0x19b2a3[_0x008f('0x27')]['ip']=_0x19b2a3['headers'][_0x008f('0x28')]||_0x19b2a3[_0x008f('0x29')][_0x008f('0x2a')]||_0x19b2a3[_0x008f('0x2b')]['remoteAddress']||_0x19b2a3['connection']['socket'][_0x008f('0x2a')];return openIssue(_0x19b2a3[_0x008f('0x27')],_0x14106e);};
\ No newline at end of file
+var _0x3fb9=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','send','body','headers','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','issuetype','email','fields','oldToken','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','/rest/api/2/issue','POST','Basic\x20','toString','base64','request','setEncoding','data','end','status','statusCode','json','error'];(function(_0x506033,_0x7fe3c4){var _0x3d1e67=function(_0x19244c){while(--_0x19244c){_0x506033['push'](_0x506033['shift']());}};_0x3d1e67(++_0x7fe3c4);}(_0x3fb9,0xdf));var _0x93fb=function(_0x35060d,_0x537dbc){_0x35060d=_0x35060d-0x0;var _0x543bfa=_0x3fb9[_0x35060d];return _0x543bfa;};'use strict';var BPromise=require(_0x93fb('0x0'));var https=require(_0x93fb('0x1'));var logger=require(_0x93fb('0x2'))(_0x93fb('0x3'));var USERNAME=_0x93fb('0x4');var PASSWORD=_0x93fb('0x5');function openIssue(_0x1dcccd,_0x2c9fca){var _0x651ad6={'fields':{'project':{'key':_0x1dcccd[_0x93fb('0x6')]||'MOTGUI'},'summary':(_0x1dcccd[_0x93fb('0x7')]||_0x93fb('0x8'))+_0x93fb('0x9')+_0x1dcccd['ip'],'description':_0x1dcccd[_0x93fb('0xa')]||JSON[_0x93fb('0xb')](_0x1dcccd),'issuetype':{'name':_0x1dcccd[_0x93fb('0xc')]||'Bug'}}};_0x651ad6['fields']['customfield_11500']=_0x1dcccd[_0x93fb('0xd')];_0x651ad6[_0x93fb('0xe')]['customfield_11501']=_0x1dcccd[_0x93fb('0xf')];_0x651ad6[_0x93fb('0xe')][_0x93fb('0x10')]=_0x1dcccd[_0x93fb('0x11')];_0x651ad6[_0x93fb('0xe')][_0x93fb('0x12')]=_0x1dcccd[_0x93fb('0x13')];_0x651ad6[_0x93fb('0xe')]['customfield_11504']=_0x1dcccd[_0x93fb('0x14')];_0x651ad6[_0x93fb('0xe')][_0x93fb('0x15')]=_0x1dcccd['ip'];var _0x11e58e={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x93fb('0x16'),'method':_0x93fb('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x93fb('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x93fb('0x19')](_0x93fb('0x1a'))}};var _0x1462d2=JSON['stringify'](_0x651ad6);var _0x234753=https[_0x93fb('0x1b')](_0x11e58e,function(_0x148c90){_0x148c90[_0x93fb('0x1c')]('utf8');var _0x1965a4='';_0x148c90['on'](_0x93fb('0x1d'),function(_0x5138ec){_0x1965a4+=_0x5138ec;});_0x148c90['on'](_0x93fb('0x1e'),function(){if(_0x2c9fca){return _0x2c9fca[_0x93fb('0x1f')](_0x148c90[_0x93fb('0x20')])[_0x93fb('0x21')](JSON['parse'](_0x1965a4));}});});_0x234753['on'](_0x93fb('0x22'),function(_0x146060){if(_0x2c9fca){return _0x2c9fca[_0x93fb('0x1f')](0x1f4)['json']({'errors':[{'message':_0x93fb('0x23'),'type':'api.jira'}]});}});_0x234753[_0x93fb('0x24')](_0x1462d2);_0x234753[_0x93fb('0x1e')]();}exports['openIssue']=openIssue;exports[_0x93fb('0x25')]=function(_0x3a51f1,_0x408bbf){_0x3a51f1[_0x93fb('0x26')]['ip']=_0x3a51f1[_0x93fb('0x27')]['x-forwarded-for']||_0x3a51f1[_0x93fb('0x28')][_0x93fb('0x29')]||_0x3a51f1[_0x93fb('0x2a')][_0x93fb('0x29')]||_0x3a51f1['connection']['socket'][_0x93fb('0x29')];return openIssue(_0x3a51f1[_0x93fb('0x26')],_0x408bbf);};
\ No newline at end of file
index 2ef839e..55348c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f12=['update','delete','destroy','exports','util','path','Router','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put'];(function(_0x16d5bb,_0x3cf3c3){var _0x531acc=function(_0x60d158){while(--_0x60d158){_0x16d5bb['push'](_0x16d5bb['shift']());}};_0x531acc(++_0x3cf3c3);}(_0x1f12,0x134));var _0x21f1=function(_0x1083ef,_0x1806e4){_0x1083ef=_0x1083ef-0x0;var _0x1b3169=_0x1f12[_0x1083ef];return _0x1b3169;};'use strict';var multer=require('multer');var util=require(_0x21f1('0x0'));var path=require(_0x21f1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x21f1('0x2')]();var auth=require(_0x21f1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x21f1('0x4'));var controller=require(_0x21f1('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x21f1('0x6')](_0x21f1('0x7'),auth[_0x21f1('0x8')](),controller[_0x21f1('0x9')]);router[_0x21f1('0x6')](_0x21f1('0xa'),auth[_0x21f1('0x8')](),controller[_0x21f1('0xb')]);router[_0x21f1('0xc')]('/',auth[_0x21f1('0x8')](),controller[_0x21f1('0xd')]);router[_0x21f1('0xe')](_0x21f1('0xa'),auth[_0x21f1('0x8')](),controller[_0x21f1('0xf')]);router[_0x21f1('0x10')]('/:id',auth[_0x21f1('0x8')](),controller[_0x21f1('0x11')]);module[_0x21f1('0x12')]=router;
\ No newline at end of file
+var _0x8e21=['isAuthenticated','index','describe','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./jscriptyAnswerReport.controller','get'];(function(_0x7ee890,_0x26bc76){var _0x2c1ef7=function(_0x7f60e5){while(--_0x7f60e5){_0x7ee890['push'](_0x7ee890['shift']());}};_0x2c1ef7(++_0x26bc76);}(_0x8e21,0x115));var _0x18e2=function(_0x4e783c,_0x51a362){_0x4e783c=_0x4e783c-0x0;var _0x2fbd6d=_0x8e21[_0x4e783c];return _0x2fbd6d;};'use strict';var multer=require('multer');var util=require(_0x18e2('0x0'));var path=require(_0x18e2('0x1'));var timeout=require(_0x18e2('0x2'));var express=require(_0x18e2('0x3'));var router=express[_0x18e2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x18e2('0x5'));var config=require('../../config/environment');var controller=require(_0x18e2('0x6'));router[_0x18e2('0x7')]('/',auth[_0x18e2('0x8')](),controller[_0x18e2('0x9')]);router['get']('/describe',auth[_0x18e2('0x8')](),controller[_0x18e2('0xa')]);router[_0x18e2('0x7')](_0x18e2('0xb'),auth[_0x18e2('0x8')](),controller[_0x18e2('0xc')]);router[_0x18e2('0xd')]('/',auth[_0x18e2('0x8')](),controller[_0x18e2('0xe')]);router['put'](_0x18e2('0xb'),auth[_0x18e2('0x8')](),controller[_0x18e2('0xf')]);router[_0x18e2('0x10')](_0x18e2('0xb'),auth[_0x18e2('0x8')](),controller[_0x18e2('0x11')]);module[_0x18e2('0x12')]=router;
\ No newline at end of file
index bcd44cd..0182c66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9525=['sequelize','exports','TEXT','long','STRING'];(function(_0x13a34a,_0x2c711d){var _0x10265b=function(_0x53df87){while(--_0x53df87){_0x13a34a['push'](_0x13a34a['shift']());}};_0x10265b(++_0x2c711d);}(_0x9525,0x12c));var _0x5952=function(_0x5bc60d,_0x5dbc62){_0x5bc60d=_0x5bc60d-0x0;var _0x268d5e=_0x9525[_0x5bc60d];return _0x268d5e;};'use strict';var Sequelize=require(_0x5952('0x0'));module[_0x5952('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x5952('0x2')](_0x5952('0x3'))},'membername':{'type':Sequelize[_0x5952('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x5952('0x4')]},'uniqueid':{'type':Sequelize[_0x5952('0x4')]},'calleridname':{'type':Sequelize[_0x5952('0x4')]},'calleridnum':{'type':Sequelize[_0x5952('0x4')]},'questionId':{'type':Sequelize[_0x5952('0x4')]}};
\ No newline at end of file
+var _0x24d8=['TEXT','long','sequelize','exports','STRING'];(function(_0x1b45e2,_0x1fd36a){var _0xfd9616=function(_0x5ccbe7){while(--_0x5ccbe7){_0x1b45e2['push'](_0x1b45e2['shift']());}};_0xfd9616(++_0x1fd36a);}(_0x24d8,0x1c4));var _0x824d=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x24d8[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0x824d('0x0'));module[_0x824d('0x1')]={'question':{'type':Sequelize[_0x824d('0x2')]},'answer':{'type':Sequelize[_0x824d('0x3')](_0x824d('0x4'))},'membername':{'type':Sequelize[_0x824d('0x2')]},'projectname':{'type':Sequelize[_0x824d('0x2')]},'queue':{'type':Sequelize[_0x824d('0x2')]},'uniqueid':{'type':Sequelize[_0x824d('0x2')]},'calleridname':{'type':Sequelize[_0x824d('0x2')]},'calleridnum':{'type':Sequelize[_0x824d('0x2')]},'questionId':{'type':Sequelize[_0x824d('0x2')]}};
\ No newline at end of file
index 3da9b16..965926b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac59=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','then','destroy','error','stack','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter'];(function(_0x2e712f,_0x60d75f){var _0x2fb152=function(_0x577196){while(--_0x577196){_0x2e712f['push'](_0x2e712f['shift']());}};_0x2fb152(++_0x60d75f);}(_0xac59,0x1ac));var _0x9ac5=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xac59[_0x465028];return _0xb783d4;};'use strict';var pdf=require(_0x9ac5('0x0'));var emlformat=require(_0x9ac5('0x1'));var rimraf=require(_0x9ac5('0x2'));var zipdir=require(_0x9ac5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ac5('0x4'));var moment=require('moment');var BPromise=require(_0x9ac5('0x5'));var Mustache=require('mustache');var util=require(_0x9ac5('0x6'));var path=require('path');var sox=require(_0x9ac5('0x7'));var csv=require(_0x9ac5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9ac5('0x9'));var crypto=require(_0x9ac5('0xa'));var jsforce=require(_0x9ac5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9ac5('0x8'));var querystring=require('querystring');var Papa=require(_0x9ac5('0xc'));var Redis=require(_0x9ac5('0xd'));var authService=require(_0x9ac5('0xe'));var qs=require(_0x9ac5('0xf'));var as=require(_0x9ac5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9ac5('0x11'));var utils=require(_0x9ac5('0x12'));var config=require(_0x9ac5('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a4de6,_0x2aec82){_0x2aec82=_0x2aec82||0xcc;return function(_0x3b666a){if(_0x3b666a){return _0x1a4de6[_0x9ac5('0x14')](_0x2aec82);}return _0x1a4de6[_0x9ac5('0x15')](_0x2aec82)[_0x9ac5('0x16')]();};}function respondWithResult(_0x3d7e56,_0x4ddf02){_0x4ddf02=_0x4ddf02||0xc8;return function(_0x868bc5){if(_0x868bc5){return _0x3d7e56[_0x9ac5('0x15')](_0x4ddf02)[_0x9ac5('0x17')](_0x868bc5);}};}function respondWithFilteredResult(_0x2cbba5,_0x3552e7){return function(_0xe1c6fe){if(_0xe1c6fe){var _0x5a87fa=_0xe1c6fe[_0x9ac5('0x18')],_0x20a6dd=_0x3552e7[_0x9ac5('0x19')],_0x49d670=_0x3552e7['offset']+_0x3552e7['limit'],_0x43ebbe;if(_0x49d670>=_0x5a87fa){_0x49d670=_0x5a87fa;_0x43ebbe=0xc8;}else{_0x43ebbe=0xce;}_0x2cbba5[_0x9ac5('0x15')](_0x43ebbe);return _0x2cbba5[_0x9ac5('0x1a')](_0x9ac5('0x1b'),_0x20a6dd+'-'+_0x49d670+'/'+_0x5a87fa)['json'](_0xe1c6fe);}return null;};}function patchUpdates(_0x5a3e96){return function(_0x644f72){try{jsonpatch[_0x9ac5('0x1c')](_0x644f72,_0x5a3e96,!![]);}catch(_0xf2702e){return BPromise[_0x9ac5('0x1d')](_0xf2702e);}return _0x644f72['save']();};}function saveUpdates(_0x11b386,_0x246cfa){return function(_0xec38e1){if(_0xec38e1){return _0xec38e1['update'](_0x11b386)[_0x9ac5('0x1e')](function(_0x14d72c){return _0x14d72c;});}return null;};}function removeEntity(_0x43f857,_0x5f0445){return function(_0x32bde4){if(_0x32bde4){return _0x32bde4[_0x9ac5('0x1f')]()[_0x9ac5('0x1e')](function(){_0x43f857[_0x9ac5('0x15')](0xcc)[_0x9ac5('0x16')]();});}};}function handleEntityNotFound(_0xffd5ee,_0x5d97ae){return function(_0x133b81){if(!_0x133b81){_0xffd5ee['sendStatus'](0x194);}return _0x133b81;};}function handleError(_0x235d51,_0x2d8840){_0x2d8840=_0x2d8840||0x1f4;return function(_0x5f432f){logger[_0x9ac5('0x20')](_0x5f432f[_0x9ac5('0x21')]);if(_0x5f432f['name']){delete _0x5f432f['name'];}_0x235d51[_0x9ac5('0x15')](_0x2d8840)['send'](_0x5f432f);};}exports[_0x9ac5('0x22')]=function(_0x2784c7,_0x57304b){var _0x42ce8f={},_0x3d7fd5={},_0x58ed31={'count':0x0,'rows':[]};var _0xdc50a3=_[_0x9ac5('0x23')](db[_0x9ac5('0x24')][_0x9ac5('0x25')],function(_0x355657){return{'name':_0x355657[_0x9ac5('0x26')],'type':_0x355657[_0x9ac5('0x27')]['key']};});_0x3d7fd5[_0x9ac5('0x28')]=_['map'](_0xdc50a3,_0x9ac5('0x29'));_0x3d7fd5[_0x9ac5('0x2a')]=_[_0x9ac5('0x2b')](_0x2784c7['query']);_0x3d7fd5[_0x9ac5('0x2c')]=_[_0x9ac5('0x2d')](_0x3d7fd5[_0x9ac5('0x28')],_0x3d7fd5[_0x9ac5('0x2a')]);_0x42ce8f[_0x9ac5('0x2e')]=_['intersection'](_0x3d7fd5[_0x9ac5('0x28')],qs['fields'](_0x2784c7['query'][_0x9ac5('0x2f')]));_0x42ce8f[_0x9ac5('0x2e')]=_0x42ce8f['attributes'][_0x9ac5('0x30')]?_0x42ce8f[_0x9ac5('0x2e')]:_0x3d7fd5[_0x9ac5('0x28')];if(!_0x2784c7[_0x9ac5('0x2a')]['hasOwnProperty']('nolimit')){_0x42ce8f['limit']=qs[_0x9ac5('0x31')](_0x2784c7[_0x9ac5('0x2a')][_0x9ac5('0x31')]);_0x42ce8f['offset']=qs[_0x9ac5('0x19')](_0x2784c7[_0x9ac5('0x2a')][_0x9ac5('0x19')]);}_0x42ce8f[_0x9ac5('0x32')]=qs[_0x9ac5('0x33')](_0x2784c7[_0x9ac5('0x2a')][_0x9ac5('0x33')]);_0x42ce8f[_0x9ac5('0x34')]=qs[_0x9ac5('0x2c')](_[_0x9ac5('0x35')](_0x2784c7['query'],_0x3d7fd5[_0x9ac5('0x2c')]),_0xdc50a3);if(_0x2784c7['query'][_0x9ac5('0x36')]){_0x42ce8f[_0x9ac5('0x34')]=_[_0x9ac5('0x37')](_0x42ce8f[_0x9ac5('0x34')],{'$or':_[_0x9ac5('0x23')](_0xdc50a3,function(_0x48e003){if(_0x48e003[_0x9ac5('0x27')]!==_0x9ac5('0x38')){var _0x1398fc={};_0x1398fc[_0x48e003['name']]={'$like':'%'+_0x2784c7['query'][_0x9ac5('0x36')]+'%'};return _0x1398fc;}})});}_0x42ce8f=_[_0x9ac5('0x37')]({},_0x42ce8f,_0x2784c7[_0x9ac5('0x39')]);var _0x5dd362={'where':_0x42ce8f['where']};return db[_0x9ac5('0x24')][_0x9ac5('0x18')](_0x5dd362)['then'](function(_0x5788b4){_0x58ed31['count']=_0x5788b4;if(_0x2784c7[_0x9ac5('0x2a')][_0x9ac5('0x3a')]){_0x42ce8f[_0x9ac5('0x3b')]=[{'all':!![]}];}return db[_0x9ac5('0x24')][_0x9ac5('0x3c')](_0x42ce8f);})[_0x9ac5('0x1e')](function(_0x54f4a8){_0x58ed31[_0x9ac5('0x3d')]=_0x54f4a8;return _0x58ed31;})[_0x9ac5('0x1e')](respondWithFilteredResult(_0x57304b,_0x42ce8f))[_0x9ac5('0x3e')](handleError(_0x57304b,null));};exports[_0x9ac5('0x3f')]=function(_0x45c4bd,_0x473900){var _0x4c6190={'raw':!![],'where':{'id':_0x45c4bd[_0x9ac5('0x40')]['id']}},_0x3c5c13={};_0x3c5c13[_0x9ac5('0x28')]=_[_0x9ac5('0x2b')](db['JscriptyAnswerReport'][_0x9ac5('0x25')]);_0x3c5c13[_0x9ac5('0x2a')]=_['keys'](_0x45c4bd[_0x9ac5('0x2a')]);_0x3c5c13[_0x9ac5('0x2c')]=_[_0x9ac5('0x2d')](_0x3c5c13['model'],_0x3c5c13[_0x9ac5('0x2a')]);_0x4c6190[_0x9ac5('0x2e')]=_[_0x9ac5('0x2d')](_0x3c5c13[_0x9ac5('0x28')],qs[_0x9ac5('0x2f')](_0x45c4bd[_0x9ac5('0x2a')][_0x9ac5('0x2f')]));_0x4c6190[_0x9ac5('0x2e')]=_0x4c6190[_0x9ac5('0x2e')]['length']?_0x4c6190[_0x9ac5('0x2e')]:_0x3c5c13[_0x9ac5('0x28')];if(_0x45c4bd[_0x9ac5('0x2a')][_0x9ac5('0x3a')]){_0x4c6190[_0x9ac5('0x3b')]=[{'all':!![]}];}_0x4c6190=_[_0x9ac5('0x37')]({},_0x4c6190,_0x45c4bd[_0x9ac5('0x39')]);return db[_0x9ac5('0x24')][_0x9ac5('0x41')](_0x4c6190)[_0x9ac5('0x1e')](handleEntityNotFound(_0x473900,null))['then'](respondWithResult(_0x473900,null))[_0x9ac5('0x3e')](handleError(_0x473900,null));};exports[_0x9ac5('0x42')]=function(_0x30fc86,_0x53ca2c){return db['JscriptyAnswerReport']['create'](_0x30fc86[_0x9ac5('0x43')],{})[_0x9ac5('0x1e')](respondWithResult(_0x53ca2c,0xc9))['catch'](handleError(_0x53ca2c,null));};exports['update']=function(_0x1a1e2a,_0x5ca0e5){if(_0x1a1e2a[_0x9ac5('0x43')]['id']){delete _0x1a1e2a[_0x9ac5('0x43')]['id'];}return db[_0x9ac5('0x24')]['find']({'where':{'id':_0x1a1e2a[_0x9ac5('0x40')]['id']}})[_0x9ac5('0x1e')](handleEntityNotFound(_0x5ca0e5,null))[_0x9ac5('0x1e')](saveUpdates(_0x1a1e2a[_0x9ac5('0x43')],null))[_0x9ac5('0x1e')](respondWithResult(_0x5ca0e5,null))[_0x9ac5('0x3e')](handleError(_0x5ca0e5,null));};exports[_0x9ac5('0x1f')]=function(_0x22cec5,_0xdce93c){return db[_0x9ac5('0x24')]['find']({'where':{'id':_0x22cec5[_0x9ac5('0x40')]['id']}})[_0x9ac5('0x1e')](handleEntityNotFound(_0xdce93c,null))[_0x9ac5('0x1e')](removeEntity(_0xdce93c,null))[_0x9ac5('0x3e')](handleError(_0xdce93c,null));};exports[_0x9ac5('0x44')]=function(_0x5e3e4e,_0x4577d9){return db['JscriptyAnswerReport'][_0x9ac5('0x44')]()[_0x9ac5('0x1e')](respondWithResult(_0x4577d9,null))[_0x9ac5('0x3e')](handleError(_0x4577d9,null));};
\ No newline at end of file
+var _0x0192=['send','index','JscriptyAnswerReport','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','VIRTUAL','filter','options','count','includeAll','include','rows','catch','params','rawAttributes','body','update','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0192,0x185));var _0x2019=function(_0x133a7b,_0x1a0d64){_0x133a7b=_0x133a7b-0x0;var _0x5b8091=_0x0192[_0x133a7b];return _0x5b8091;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2019('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2019('0x1'));var jsonpatch=require(_0x2019('0x2'));var rp=require(_0x2019('0x3'));var moment=require(_0x2019('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2019('0x5'));var util=require(_0x2019('0x6'));var path=require(_0x2019('0x7'));var sox=require('sox');var csv=require(_0x2019('0x8'));var ejs=require(_0x2019('0x9'));var fs=require('fs');var _=require(_0x2019('0xa'));var squel=require(_0x2019('0xb'));var crypto=require(_0x2019('0xc'));var jsforce=require(_0x2019('0xd'));var deskjs=require(_0x2019('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2019('0xf'));var Redis=require(_0x2019('0x10'));var authService=require(_0x2019('0x11'));var qs=require(_0x2019('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2019('0x13'))(_0x2019('0x14'));var utils=require('../../config/utils');var config=require(_0x2019('0x15'));var db=require(_0x2019('0x16'))['db'];function respondWithStatusCode(_0x2da395,_0x4a753e){_0x4a753e=_0x4a753e||0xcc;return function(_0x3a0b4c){if(_0x3a0b4c){return _0x2da395[_0x2019('0x17')](_0x4a753e);}return _0x2da395[_0x2019('0x18')](_0x4a753e)[_0x2019('0x19')]();};}function respondWithResult(_0x56de03,_0x25371f){_0x25371f=_0x25371f||0xc8;return function(_0x171191){if(_0x171191){return _0x56de03[_0x2019('0x18')](_0x25371f)[_0x2019('0x1a')](_0x171191);}};}function respondWithFilteredResult(_0x4be33f,_0x3ea8b0){return function(_0x55a9c6){if(_0x55a9c6){var _0x54347b=_0x55a9c6['count'],_0x4c5818=_0x3ea8b0[_0x2019('0x1b')],_0xa83533=_0x3ea8b0[_0x2019('0x1b')]+_0x3ea8b0[_0x2019('0x1c')],_0x7784c0;if(_0xa83533>=_0x54347b){_0xa83533=_0x54347b;_0x7784c0=0xc8;}else{_0x7784c0=0xce;}_0x4be33f[_0x2019('0x18')](_0x7784c0);return _0x4be33f[_0x2019('0x1d')](_0x2019('0x1e'),_0x4c5818+'-'+_0xa83533+'/'+_0x54347b)[_0x2019('0x1a')](_0x55a9c6);}return null;};}function patchUpdates(_0x23615e){return function(_0x2c7f9e){try{jsonpatch[_0x2019('0x1f')](_0x2c7f9e,_0x23615e,!![]);}catch(_0x1cdcca){return BPromise['reject'](_0x1cdcca);}return _0x2c7f9e[_0x2019('0x20')]();};}function saveUpdates(_0x4c406e,_0x53a2a3){return function(_0x4a5433){if(_0x4a5433){return _0x4a5433['update'](_0x4c406e)['then'](function(_0x5a9a45){return _0x5a9a45;});}return null;};}function removeEntity(_0x33bcd2,_0x420370){return function(_0x40ca83){if(_0x40ca83){return _0x40ca83[_0x2019('0x21')]()[_0x2019('0x22')](function(){_0x33bcd2[_0x2019('0x18')](0xcc)[_0x2019('0x19')]();});}};}function handleEntityNotFound(_0x24dbbb,_0x4982e2){return function(_0x3b3b0b){if(!_0x3b3b0b){_0x24dbbb[_0x2019('0x17')](0x194);}return _0x3b3b0b;};}function handleError(_0x1b7839,_0x475906){_0x475906=_0x475906||0x1f4;return function(_0x1d7836){logger['error'](_0x1d7836[_0x2019('0x23')]);if(_0x1d7836['name']){delete _0x1d7836[_0x2019('0x24')];}_0x1b7839[_0x2019('0x18')](_0x475906)[_0x2019('0x25')](_0x1d7836);};}exports[_0x2019('0x26')]=function(_0x432fd4,_0x13ef08){var _0x3e33a3={},_0x3b7576={},_0x1a83a8={'count':0x0,'rows':[]};var _0x3f97c5=_['map'](db[_0x2019('0x27')]['rawAttributes'],function(_0x484a33){return{'name':_0x484a33['fieldName'],'type':_0x484a33[_0x2019('0x28')][_0x2019('0x29')]};});_0x3b7576[_0x2019('0x2a')]=_[_0x2019('0x2b')](_0x3f97c5,_0x2019('0x24'));_0x3b7576[_0x2019('0x2c')]=_[_0x2019('0x2d')](_0x432fd4[_0x2019('0x2c')]);_0x3b7576[_0x2019('0x2e')]=_[_0x2019('0x2f')](_0x3b7576[_0x2019('0x2a')],_0x3b7576[_0x2019('0x2c')]);_0x3e33a3[_0x2019('0x30')]=_['intersection'](_0x3b7576['model'],qs['fields'](_0x432fd4[_0x2019('0x2c')][_0x2019('0x31')]));_0x3e33a3[_0x2019('0x30')]=_0x3e33a3[_0x2019('0x30')][_0x2019('0x32')]?_0x3e33a3[_0x2019('0x30')]:_0x3b7576[_0x2019('0x2a')];if(!_0x432fd4[_0x2019('0x2c')][_0x2019('0x33')](_0x2019('0x34'))){_0x3e33a3[_0x2019('0x1c')]=qs[_0x2019('0x1c')](_0x432fd4[_0x2019('0x2c')][_0x2019('0x1c')]);_0x3e33a3[_0x2019('0x1b')]=qs[_0x2019('0x1b')](_0x432fd4[_0x2019('0x2c')][_0x2019('0x1b')]);}_0x3e33a3[_0x2019('0x35')]=qs['sort'](_0x432fd4[_0x2019('0x2c')]['sort']);_0x3e33a3['where']=qs['filters'](_[_0x2019('0x36')](_0x432fd4[_0x2019('0x2c')],_0x3b7576[_0x2019('0x2e')]),_0x3f97c5);if(_0x432fd4['query']['filter']){_0x3e33a3[_0x2019('0x37')]=_[_0x2019('0x38')](_0x3e33a3[_0x2019('0x37')],{'$or':_[_0x2019('0x2b')](_0x3f97c5,function(_0x1a913a){if(_0x1a913a[_0x2019('0x28')]!==_0x2019('0x39')){var _0x1c86c1={};_0x1c86c1[_0x1a913a[_0x2019('0x24')]]={'$like':'%'+_0x432fd4[_0x2019('0x2c')][_0x2019('0x3a')]+'%'};return _0x1c86c1;}})});}_0x3e33a3=_[_0x2019('0x38')]({},_0x3e33a3,_0x432fd4[_0x2019('0x3b')]);var _0xfd5ec8={'where':_0x3e33a3[_0x2019('0x37')]};return db[_0x2019('0x27')][_0x2019('0x3c')](_0xfd5ec8)['then'](function(_0x46f1db){_0x1a83a8['count']=_0x46f1db;if(_0x432fd4[_0x2019('0x2c')][_0x2019('0x3d')]){_0x3e33a3[_0x2019('0x3e')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x3e33a3);})[_0x2019('0x22')](function(_0x3f9c99){_0x1a83a8[_0x2019('0x3f')]=_0x3f9c99;return _0x1a83a8;})[_0x2019('0x22')](respondWithFilteredResult(_0x13ef08,_0x3e33a3))[_0x2019('0x40')](handleError(_0x13ef08,null));};exports['show']=function(_0x29f772,_0x24d466){var _0x39cc8c={'raw':!![],'where':{'id':_0x29f772[_0x2019('0x41')]['id']}},_0x5e3cb8={};_0x5e3cb8[_0x2019('0x2a')]=_[_0x2019('0x2d')](db['JscriptyAnswerReport'][_0x2019('0x42')]);_0x5e3cb8[_0x2019('0x2c')]=_[_0x2019('0x2d')](_0x29f772[_0x2019('0x2c')]);_0x5e3cb8['filters']=_[_0x2019('0x2f')](_0x5e3cb8[_0x2019('0x2a')],_0x5e3cb8['query']);_0x39cc8c[_0x2019('0x30')]=_[_0x2019('0x2f')](_0x5e3cb8[_0x2019('0x2a')],qs['fields'](_0x29f772[_0x2019('0x2c')][_0x2019('0x31')]));_0x39cc8c['attributes']=_0x39cc8c['attributes']['length']?_0x39cc8c['attributes']:_0x5e3cb8[_0x2019('0x2a')];if(_0x29f772[_0x2019('0x2c')]['includeAll']){_0x39cc8c['include']=[{'all':!![]}];}_0x39cc8c=_[_0x2019('0x38')]({},_0x39cc8c,_0x29f772['options']);return db[_0x2019('0x27')]['find'](_0x39cc8c)[_0x2019('0x22')](handleEntityNotFound(_0x24d466,null))[_0x2019('0x22')](respondWithResult(_0x24d466,null))[_0x2019('0x40')](handleError(_0x24d466,null));};exports['create']=function(_0x2941bc,_0x4036ce){return db[_0x2019('0x27')]['create'](_0x2941bc[_0x2019('0x43')],{})[_0x2019('0x22')](respondWithResult(_0x4036ce,0xc9))[_0x2019('0x40')](handleError(_0x4036ce,null));};exports[_0x2019('0x44')]=function(_0x58f1b5,_0x1bd09f){if(_0x58f1b5[_0x2019('0x43')]['id']){delete _0x58f1b5[_0x2019('0x43')]['id'];}return db[_0x2019('0x27')][_0x2019('0x45')]({'where':{'id':_0x58f1b5[_0x2019('0x41')]['id']}})[_0x2019('0x22')](handleEntityNotFound(_0x1bd09f,null))[_0x2019('0x22')](saveUpdates(_0x58f1b5[_0x2019('0x43')],null))['then'](respondWithResult(_0x1bd09f,null))[_0x2019('0x40')](handleError(_0x1bd09f,null));};exports[_0x2019('0x21')]=function(_0x1256ae,_0x585329){return db[_0x2019('0x27')][_0x2019('0x45')]({'where':{'id':_0x1256ae[_0x2019('0x41')]['id']}})['then'](handleEntityNotFound(_0x585329,null))[_0x2019('0x22')](removeEntity(_0x585329,null))[_0x2019('0x40')](handleError(_0x585329,null));};exports[_0x2019('0x46')]=function(_0x129211,_0xe0e3ca){return db['JscriptyAnswerReport'][_0x2019('0x46')]()[_0x2019('0x22')](respondWithResult(_0xe0e3ca,null))['catch'](handleError(_0xe0e3ca,null));};
\ No newline at end of file
index abcadd7..e05786f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacea=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xacea,0x84));var _0xaace=function(_0x585239,_0x5387fc){_0x585239=_0x585239-0x0;var _0x3f4826=_0xacea[_0x585239];return _0x3f4826;};'use strict';var _=require(_0xaace('0x0'));var util=require('util');var logger=require(_0xaace('0x1'))('api');var moment=require(_0xaace('0x2'));var BPromise=require(_0xaace('0x3'));var rp=require(_0xaace('0x4'));var fs=require('fs');var path=require(_0xaace('0x5'));var rimraf=require(_0xaace('0x6'));var config=require(_0xaace('0x7'));var attributes=require(_0xaace('0x8'));module[_0xaace('0x9')]=function(_0x45978a,_0x3cb197){return _0x45978a[_0xaace('0xa')](_0xaace('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x99c8=['rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x99c8,0x1a6));var _0x899c=function(_0x402d07,_0x1e1755){_0x402d07=_0x402d07-0x0;var _0x38f465=_0x99c8[_0x402d07];return _0x38f465;};'use strict';var _=require(_0x899c('0x0'));var util=require(_0x899c('0x1'));var logger=require(_0x899c('0x2'))(_0x899c('0x3'));var moment=require(_0x899c('0x4'));var BPromise=require('bluebird');var rp=require(_0x899c('0x5'));var fs=require('fs');var path=require(_0x899c('0x6'));var rimraf=require(_0x899c('0x7'));var config=require(_0x899c('0x8'));var attributes=require(_0x899c('0x9'));module[_0x899c('0xa')]=function(_0x3439bf,_0x4537b0){return _0x3439bf[_0x899c('0xb')](_0x899c('0xc'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3368d75..9999b7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43fa=['http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x43fa,0x170));var _0xa43f=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0x43fa[_0x168127];return _0x4c99ad;};'use strict';var _=require(_0xa43f('0x0'));var util=require(_0xa43f('0x1'));var moment=require(_0xa43f('0x2'));var BPromise=require(_0xa43f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa43f('0x4'));var db=require(_0xa43f('0x5'))['db'];var utils=require(_0xa43f('0x6'));var logger=require('../../config/logger')(_0xa43f('0x7'));var config=require('../../config/environment');var jayson=require(_0xa43f('0x8'));var client=jayson[_0xa43f('0x9')][_0xa43f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f288a,_0x5f0dd0,_0x2b8e65){return new BPromise(function(_0x5025b5,_0x20d1c6){return client[_0xa43f('0xb')](_0x4f288a,_0x2b8e65)[_0xa43f('0xc')](function(_0xee5ff){logger[_0xa43f('0xd')](_0xa43f('0xe'),_0x5f0dd0,_0xa43f('0xf'));logger[_0xa43f('0x10')](_0xa43f('0x11'),_0x5f0dd0,'request\x20sent',JSON[_0xa43f('0x12')](_0xee5ff));if(_0xee5ff['error']){if(_0xee5ff['error']['code']===0x1f4){logger['error'](_0xa43f('0xe'),_0x5f0dd0,_0xee5ff[_0xa43f('0x13')][_0xa43f('0x14')]);return _0x20d1c6(_0xee5ff[_0xa43f('0x13')][_0xa43f('0x14')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x5f0dd0,_0xee5ff[_0xa43f('0x13')][_0xa43f('0x14')]);return _0x5025b5(_0xee5ff[_0xa43f('0x13')][_0xa43f('0x14')]);}else{logger['info'](_0xa43f('0xe'),_0x5f0dd0,_0xa43f('0xf'));_0x5025b5(_0xee5ff['result'][_0xa43f('0x14')]);}})['catch'](function(_0x3c7f8c){logger[_0xa43f('0x13')](_0xa43f('0xe'),_0x5f0dd0,_0x3c7f8c);_0x20d1c6(_0x3c7f8c);});});}
\ No newline at end of file
+var _0x3ea5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','info','result','lodash','bluebird','randomstring'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x3ea5,0x13f));var _0x53ea=function(_0x5ef898,_0x31ad18){_0x5ef898=_0x5ef898-0x0;var _0x54c053=_0x3ea5[_0x5ef898];return _0x54c053;};'use strict';var _=require(_0x53ea('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x53ea('0x1'));var rs=require(_0x53ea('0x2'));var fs=require('fs');var Redis=require(_0x53ea('0x3'));var db=require(_0x53ea('0x4'))['db'];var utils=require(_0x53ea('0x5'));var logger=require(_0x53ea('0x6'))(_0x53ea('0x7'));var config=require(_0x53ea('0x8'));var jayson=require(_0x53ea('0x9'));var client=jayson[_0x53ea('0xa')][_0x53ea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52bde7,_0xf8c834,_0x2bbf59){return new BPromise(function(_0x1e026a,_0x40b623){return client[_0x53ea('0xc')](_0x52bde7,_0x2bbf59)[_0x53ea('0xd')](function(_0x48a599){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0xf8c834,'request\x20sent');logger[_0x53ea('0xe')](_0x53ea('0xf'),_0xf8c834,_0x53ea('0x10'),JSON[_0x53ea('0x11')](_0x48a599));if(_0x48a599[_0x53ea('0x12')]){if(_0x48a599['error']['code']===0x1f4){logger[_0x53ea('0x12')](_0x53ea('0x13'),_0xf8c834,_0x48a599[_0x53ea('0x12')]['message']);return _0x40b623(_0x48a599[_0x53ea('0x12')][_0x53ea('0x14')]);}logger[_0x53ea('0x12')](_0x53ea('0x13'),_0xf8c834,_0x48a599[_0x53ea('0x12')][_0x53ea('0x14')]);return _0x1e026a(_0x48a599[_0x53ea('0x12')]['message']);}else{logger[_0x53ea('0x15')](_0x53ea('0x13'),_0xf8c834,_0x53ea('0x10'));_0x1e026a(_0x48a599[_0x53ea('0x16')][_0x53ea('0x14')]);}})['catch'](function(_0x410683){logger['error'](_0x53ea('0x13'),_0xf8c834,_0x410683);_0x40b623(_0x410683);});});}
\ No newline at end of file
index 0f05ffd..3f08c5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20de=['/:id/sessions','getSessions','/:id/answers','getAnswers','30s','post','/:id/clone','clone','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','/:id','isAuthenticated','show'];(function(_0xd5426a,_0x23c659){var _0xb9cfc5=function(_0x4cd3b3){while(--_0x4cd3b3){_0xd5426a['push'](_0xd5426a['shift']());}};_0xb9cfc5(++_0x23c659);}(_0x20de,0x1ce));var _0xe20d=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x20de[_0x255d5b];return _0x3e141a;};'use strict';var multer=require(_0xe20d('0x0'));var util=require(_0xe20d('0x1'));var path=require(_0xe20d('0x2'));var timeout=require(_0xe20d('0x3'));var express=require(_0xe20d('0x4'));var router=express[_0xe20d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe20d('0x6'));var config=require(_0xe20d('0x7'));var controller=require(_0xe20d('0x8'));router[_0xe20d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe20d('0x9')](_0xe20d('0xa'),auth[_0xe20d('0xb')](),controller[_0xe20d('0xc')]);router[_0xe20d('0x9')](_0xe20d('0xd'),auth[_0xe20d('0xb')](),controller[_0xe20d('0xe')]);router[_0xe20d('0x9')](_0xe20d('0xf'),auth[_0xe20d('0xb')](),controller[_0xe20d('0x10')]);router[_0xe20d('0x9')]('/:id/summary',auth['isAuthenticated'](),timeout(_0xe20d('0x11')),controller['getSummary']);router[_0xe20d('0x12')]('/',auth[_0xe20d('0xb')](),controller['create']);router[_0xe20d('0x12')](_0xe20d('0x13'),auth[_0xe20d('0xb')](),controller[_0xe20d('0x14')]);router[_0xe20d('0x15')]('/:id',auth[_0xe20d('0xb')](),controller[_0xe20d('0x16')]);router[_0xe20d('0x17')]('/:id',auth[_0xe20d('0xb')](),controller[_0xe20d('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0xfaf7=['/:id','update','delete','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','getSessions','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','put'];(function(_0x443494,_0x51fc7e){var _0x4a6794=function(_0x15197a){while(--_0x15197a){_0x443494['push'](_0x443494['shift']());}};_0x4a6794(++_0x51fc7e);}(_0xfaf7,0x1b9));var _0x7faf=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xfaf7[_0x4c445a];return _0x2f611c;};'use strict';var multer=require('multer');var util=require(_0x7faf('0x0'));var path=require(_0x7faf('0x1'));var timeout=require('connect-timeout');var express=require(_0x7faf('0x2'));var router=express[_0x7faf('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7faf('0x4'));var config=require(_0x7faf('0x5'));var controller=require(_0x7faf('0x6'));router[_0x7faf('0x7')]('/',auth[_0x7faf('0x8')](),controller[_0x7faf('0x9')]);router[_0x7faf('0x7')]('/:id',auth[_0x7faf('0x8')](),controller['show']);router[_0x7faf('0x7')]('/:id/sessions',auth[_0x7faf('0x8')](),controller[_0x7faf('0xa')]);router[_0x7faf('0x7')]('/:id/answers',auth[_0x7faf('0x8')](),controller[_0x7faf('0xb')]);router[_0x7faf('0x7')](_0x7faf('0xc'),auth[_0x7faf('0x8')](),timeout(_0x7faf('0xd')),controller['getSummary']);router[_0x7faf('0xe')]('/',auth[_0x7faf('0x8')](),controller[_0x7faf('0xf')]);router['post'](_0x7faf('0x10'),auth[_0x7faf('0x8')](),controller[_0x7faf('0x11')]);router[_0x7faf('0x12')](_0x7faf('0x13'),auth[_0x7faf('0x8')](),controller[_0x7faf('0x14')]);router[_0x7faf('0x15')](_0x7faf('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x7faf('0x16')]=router;
\ No newline at end of file
index 829b281..153b471 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5fb=['setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','name','STRING','TEXT','isObjectLike','formData','stringify','isString'];(function(_0x1c1a84,_0x4d7e21){var _0x383641=function(_0x44f340){while(--_0x44f340){_0x1c1a84['push'](_0x1c1a84['shift']());}};_0x383641(++_0x4d7e21);}(_0xe5fb,0x1d6));var _0xbe5f=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0xe5fb[_0x51b0dc];return _0x13fa89;};'use strict';var Sequelize=require(_0xbe5f('0x0'));var _=require(_0xbe5f('0x1'));var util=require(_0xbe5f('0x2'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xbe5f('0x3')},'description':{'type':Sequelize[_0xbe5f('0x4')]},'formData':{'type':Sequelize[_0xbe5f('0x5')]('long'),'set':function(_0x42cabf){if(_[_0xbe5f('0x6')](_0x42cabf)){this['setDataValue'](_0xbe5f('0x7'),JSON[_0xbe5f('0x8')](_0x42cabf));}else if(_[_0xbe5f('0x9')](_0x42cabf)){this[_0xbe5f('0xa')](_0xbe5f('0x7'),_0x42cabf);}else{this[_0xbe5f('0xa')](_0xbe5f('0x7'),util[_0xbe5f('0xb')](_0xbe5f('0xc'),this[_0xbe5f('0xd')](_0xbe5f('0x3'))||'',this[_0xbe5f('0xd')](_0xbe5f('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xbe5f('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x770e=['setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','stringify','isString'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0x770e,0x17d));var _0xe770=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x770e[_0x2fc012];return _0x2891f9;};'use strict';var Sequelize=require(_0xe770('0x0'));var _=require(_0xe770('0x1'));var util=require(_0xe770('0x2'));module[_0xe770('0x3')]={'name':{'type':Sequelize[_0xe770('0x4')],'unique':_0xe770('0x5')},'description':{'type':Sequelize[_0xe770('0x4')]},'formData':{'type':Sequelize[_0xe770('0x6')](_0xe770('0x7')),'set':function(_0x56f5f6){if(_['isObjectLike'](_0x56f5f6)){this['setDataValue']('formData',JSON[_0xe770('0x8')](_0x56f5f6));}else if(_[_0xe770('0x9')](_0x56f5f6)){this['setDataValue']('formData',_0x56f5f6);}else{this[_0xe770('0xa')](_0xe770('0xb'),util[_0xe770('0xc')](_0xe770('0xd'),this[_0xe770('0xe')]('name')||'',this[_0xe770('0xe')](_0xe770('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xe770('0x10')],'defaultValue':![]}};
\ No newline at end of file
index 3347722..588cb56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ba8=['crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','keys','include','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','omit','createdAt','updatedAt','userProfileId','update','findOne','JscriptySessionReport','pick','getAnswers','JscriptyAnswerReport','ProjectId','fromCharCode','indexOf','toString','replace','parse','startTime','JscriptyQuestionReport','-createdAt','question','starttime','format','SessionId','questionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel'];(function(_0xe49c0e,_0x66770d){var _0x3baea1=function(_0x4e9a3a){while(--_0x4e9a3a){_0xe49c0e['push'](_0xe49c0e['shift']());}};_0x3baea1(++_0x66770d);}(_0x7ba8,0xdd));var _0x87ba=function(_0x361892,_0x5b3cce){_0x361892=_0x361892-0x0;var _0x18493a=_0x7ba8[_0x361892];return _0x18493a;};'use strict';var pdf=require(_0x87ba('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x87ba('0x1'));var jsonpatch=require(_0x87ba('0x2'));var rp=require(_0x87ba('0x3'));var moment=require(_0x87ba('0x4'));var BPromise=require(_0x87ba('0x5'));var Mustache=require('mustache');var util=require(_0x87ba('0x6'));var path=require(_0x87ba('0x7'));var sox=require(_0x87ba('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x87ba('0x9'));var squel=require(_0x87ba('0xa'));var crypto=require(_0x87ba('0xb'));var jsforce=require(_0x87ba('0xc'));var deskjs=require(_0x87ba('0xd'));var toCsv=require(_0x87ba('0xe'));var querystring=require(_0x87ba('0xf'));var Papa=require('papaparse');var Redis=require(_0x87ba('0x10'));var authService=require(_0x87ba('0x11'));var qs=require(_0x87ba('0x12'));var as=require(_0x87ba('0x13'));var hardwareService=require(_0x87ba('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x87ba('0x15'));var config=require('../../config/environment');var db=require(_0x87ba('0x16'))['db'];function respondWithStatusCode(_0x552137,_0x43869d){_0x43869d=_0x43869d||0xcc;return function(_0x27a349){if(_0x27a349){return _0x552137[_0x87ba('0x17')](_0x43869d);}return _0x552137[_0x87ba('0x18')](_0x43869d)[_0x87ba('0x19')]();};}function respondWithResult(_0x1f7b1b,_0x2256bb){_0x2256bb=_0x2256bb||0xc8;return function(_0x4d75fc){if(_0x4d75fc){return _0x1f7b1b[_0x87ba('0x18')](_0x2256bb)['json'](_0x4d75fc);}};}function respondWithFilteredResult(_0x27171d,_0x553903){return function(_0x3fc6ec){if(_0x3fc6ec){var _0x27bf97=_0x3fc6ec[_0x87ba('0x1a')],_0x86af1a=_0x553903['offset'],_0x7669ca=_0x553903[_0x87ba('0x1b')]+_0x553903[_0x87ba('0x1c')],_0x24ef5f;if(_0x7669ca>=_0x27bf97){_0x7669ca=_0x27bf97;_0x24ef5f=0xc8;}else{_0x24ef5f=0xce;}_0x27171d[_0x87ba('0x18')](_0x24ef5f);return _0x27171d[_0x87ba('0x1d')](_0x87ba('0x1e'),_0x86af1a+'-'+_0x7669ca+'/'+_0x27bf97)[_0x87ba('0x1f')](_0x3fc6ec);}return null;};}function patchUpdates(_0x3a19be){return function(_0x10dc1a){try{jsonpatch[_0x87ba('0x20')](_0x10dc1a,_0x3a19be,!![]);}catch(_0x26115c){return BPromise['reject'](_0x26115c);}return _0x10dc1a[_0x87ba('0x21')]();};}function saveUpdates(_0x499b40,_0x3e8e20){return function(_0x324971){if(_0x324971){return _0x324971['update'](_0x499b40)[_0x87ba('0x22')](function(_0x298b8e){return _0x298b8e;});}return null;};}function removeEntity(_0xfd51e8,_0x44269d){return function(_0x302246){if(_0x302246){return _0x302246[_0x87ba('0x23')]()[_0x87ba('0x22')](function(){var _0x5592c3=_0x302246[_0x87ba('0x24')]({'plain':!![]});var _0x525527=_0x87ba('0x25');return db[_0x87ba('0x26')][_0x87ba('0x23')]({'where':{'type':_0x525527,'resourceId':_0x5592c3['id']}})['then'](function(){return _0x302246;});})[_0x87ba('0x22')](function(){_0xfd51e8[_0x87ba('0x18')](0xcc)[_0x87ba('0x19')]();});}};}function handleEntityNotFound(_0x1d4571,_0x293a80){return function(_0x4c115f){if(!_0x4c115f){_0x1d4571[_0x87ba('0x17')](0x194);}return _0x4c115f;};}function handleError(_0x3366a3,_0x4f8738){_0x4f8738=_0x4f8738||0x1f4;return function(_0x22fcd9){logger[_0x87ba('0x27')](_0x22fcd9[_0x87ba('0x28')]);if(_0x22fcd9[_0x87ba('0x29')]){delete _0x22fcd9['name'];}_0x3366a3['status'](_0x4f8738)[_0x87ba('0x2a')](_0x22fcd9);};}exports[_0x87ba('0x2b')]=function(_0x2b369e,_0x131358){var _0x5ab625={},_0x1b7a68={},_0x4056f4={'count':0x0,'rows':[]};var _0x9b082=_[_0x87ba('0x2c')](db[_0x87ba('0x2d')]['rawAttributes'],function(_0x163bb3){return{'name':_0x163bb3[_0x87ba('0x2e')],'type':_0x163bb3[_0x87ba('0x2f')][_0x87ba('0x30')]};});_0x1b7a68[_0x87ba('0x31')]=_[_0x87ba('0x2c')](_0x9b082,'name');_0x1b7a68[_0x87ba('0x32')]=_['keys'](_0x2b369e[_0x87ba('0x32')]);_0x1b7a68[_0x87ba('0x33')]=_[_0x87ba('0x34')](_0x1b7a68[_0x87ba('0x31')],_0x1b7a68[_0x87ba('0x32')]);_0x5ab625[_0x87ba('0x35')]=_[_0x87ba('0x34')](_0x1b7a68[_0x87ba('0x31')],qs[_0x87ba('0x36')](_0x2b369e[_0x87ba('0x32')][_0x87ba('0x36')]));_0x5ab625[_0x87ba('0x35')]=_0x5ab625[_0x87ba('0x35')][_0x87ba('0x37')]?_0x5ab625['attributes']:_0x1b7a68['model'];if(!_0x2b369e[_0x87ba('0x32')][_0x87ba('0x38')](_0x87ba('0x39'))){_0x5ab625['limit']=qs[_0x87ba('0x1c')](_0x2b369e['query'][_0x87ba('0x1c')]);_0x5ab625[_0x87ba('0x1b')]=qs[_0x87ba('0x1b')](_0x2b369e[_0x87ba('0x32')][_0x87ba('0x1b')]);}_0x5ab625[_0x87ba('0x3a')]=qs[_0x87ba('0x3b')](_0x2b369e[_0x87ba('0x32')][_0x87ba('0x3b')]);_0x5ab625[_0x87ba('0x3c')]=qs[_0x87ba('0x33')](_['pick'](_0x2b369e[_0x87ba('0x32')],_0x1b7a68[_0x87ba('0x33')]),_0x9b082);if(_0x2b369e[_0x87ba('0x32')][_0x87ba('0x3d')]){_0x5ab625[_0x87ba('0x3c')]=_[_0x87ba('0x3e')](_0x5ab625[_0x87ba('0x3c')],{'$or':_['map'](_0x9b082,function(_0x4544f7){if(_0x4544f7['type']!==_0x87ba('0x3f')){var _0x4174c4={};_0x4174c4[_0x4544f7[_0x87ba('0x29')]]={'$like':'%'+_0x2b369e[_0x87ba('0x32')][_0x87ba('0x3d')]+'%'};return _0x4174c4;}})});}_0x5ab625=_[_0x87ba('0x3e')]({},_0x5ab625,_0x2b369e[_0x87ba('0x40')]);var _0xec6c={'where':_0x5ab625[_0x87ba('0x3c')]};return db[_0x87ba('0x2d')][_0x87ba('0x1a')](_0xec6c)[_0x87ba('0x22')](function(_0x3f080e){_0x4056f4[_0x87ba('0x1a')]=_0x3f080e;if(_0x2b369e[_0x87ba('0x32')][_0x87ba('0x41')]){_0x5ab625['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x87ba('0x42')](_0x5ab625);})[_0x87ba('0x22')](function(_0x58142d){_0x4056f4[_0x87ba('0x43')]=_0x58142d;return _0x4056f4;})['then'](respondWithFilteredResult(_0x131358,_0x5ab625))['catch'](handleError(_0x131358,null));};exports['show']=function(_0x14f436,_0x417f01){var _0x581eae={'raw':![],'where':{'id':_0x14f436[_0x87ba('0x44')]['id']}},_0x2b2b55={};_0x2b2b55[_0x87ba('0x31')]=_[_0x87ba('0x45')](db['JscriptyProject']['rawAttributes']);_0x2b2b55[_0x87ba('0x32')]=_[_0x87ba('0x45')](_0x14f436['query']);_0x2b2b55[_0x87ba('0x33')]=_[_0x87ba('0x34')](_0x2b2b55[_0x87ba('0x31')],_0x2b2b55[_0x87ba('0x32')]);_0x581eae[_0x87ba('0x35')]=_[_0x87ba('0x34')](_0x2b2b55[_0x87ba('0x31')],qs['fields'](_0x14f436[_0x87ba('0x32')][_0x87ba('0x36')]));_0x581eae[_0x87ba('0x35')]=_0x581eae[_0x87ba('0x35')][_0x87ba('0x37')]?_0x581eae[_0x87ba('0x35')]:_0x2b2b55[_0x87ba('0x31')];if(_0x14f436[_0x87ba('0x32')][_0x87ba('0x41')]){_0x581eae[_0x87ba('0x46')]=[{'all':!![]}];}_0x581eae=_[_0x87ba('0x3e')]({},_0x581eae,_0x14f436[_0x87ba('0x40')]);return db[_0x87ba('0x2d')]['find'](_0x581eae)['then'](handleEntityNotFound(_0x417f01,null))[_0x87ba('0x22')](respondWithResult(_0x417f01,null))[_0x87ba('0x47')](handleError(_0x417f01,null));};exports[_0x87ba('0x48')]=function(_0x3544d8,_0x18fce2){return db[_0x87ba('0x2d')][_0x87ba('0x48')](_0x3544d8[_0x87ba('0x49')],{})[_0x87ba('0x22')](function(_0x582262){var _0x443cc5=_0x3544d8['user'][_0x87ba('0x24')]({'plain':!![]});if(!_0x443cc5)throw new Error(_0x87ba('0x4a'));if(_0x443cc5[_0x87ba('0x4b')]===_0x87ba('0x4c')){var _0x5d28d2=_0x582262[_0x87ba('0x24')]({'plain':!![]});var _0x3358be=_0x87ba('0x25');return db[_0x87ba('0x4d')][_0x87ba('0x4e')]({'where':{'name':_0x3358be,'userProfileId':_0x443cc5['userProfileId']},'raw':!![]})[_0x87ba('0x22')](function(_0x39a107){if(_0x39a107&&_0x39a107[_0x87ba('0x4f')]===0x0){return db['UserProfileResource'][_0x87ba('0x48')]({'name':_0x5d28d2[_0x87ba('0x29')],'resourceId':_0x5d28d2['id'],'type':_0x39a107[_0x87ba('0x29')],'sectionId':_0x39a107['id']},{})[_0x87ba('0x22')](function(){return _0x582262;});}else{return _0x582262;}})[_0x87ba('0x47')](function(_0x44a983){logger['error'](_0x87ba('0x50'),_0x44a983);throw _0x44a983;});}return _0x582262;})[_0x87ba('0x22')](respondWithResult(_0x18fce2,0xc9))[_0x87ba('0x47')](handleError(_0x18fce2,null));};exports['clone']=function(_0x118e03,_0x4c110c){var _0x278a72={'where':{'id':_0x118e03['params']['id']}},_0x3a8b0b={};_0x3a8b0b[_0x87ba('0x31')]=_[_0x87ba('0x45')](db[_0x87ba('0x2d')][_0x87ba('0x51')]);_0x278a72[_0x87ba('0x35')]=_[_0x87ba('0x34')](_0x3a8b0b['model'],qs[_0x87ba('0x36')](_0x118e03['query'][_0x87ba('0x36')]));_0x278a72['attributes']=_0x278a72['attributes'][_0x87ba('0x37')]?_0x278a72[_0x87ba('0x35')]:_0x3a8b0b[_0x87ba('0x31')];if(_0x118e03['query'][_0x87ba('0x41')]){_0x278a72[_0x87ba('0x46')]=[{'all':!![]}];}_0x278a72=_[_0x87ba('0x3e')]({},_0x278a72,_0x118e03[_0x87ba('0x40')]);return db[_0x87ba('0x2d')][_0x87ba('0x4e')](_0x278a72)['then'](handleEntityNotFound(_0x4c110c,null))[_0x87ba('0x22')](function(_0x421935){if(_0x421935){var _0x270fc5=_0x421935['get']({'plain':!![]});_0x270fc5=qs['omit'](_0x270fc5,['id','createdAt','updatedAt']);_0x118e03[_0x87ba('0x49')]=_[_0x87ba('0x52')](_0x118e03['body'],['id',_0x87ba('0x53'),_0x87ba('0x54')]);return db['JscriptyProject'][_0x87ba('0x48')](_['merge'](_0x270fc5,_0x118e03['body']),{'include':_0x118e03[_0x87ba('0x32')][_0x87ba('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x1c7821){var _0x1c8faf=_0x118e03['user'][_0x87ba('0x24')]({'plain':!![]});if(!_0x1c8faf)throw new Error(_0x87ba('0x4a'));if(_0x1c8faf[_0x87ba('0x4b')]===_0x87ba('0x4c')){var _0x263cca=_0x1c7821[_0x87ba('0x24')]({'plain':!![]});var _0x390272=_0x87ba('0x25');return db[_0x87ba('0x4d')][_0x87ba('0x4e')]({'where':{'name':_0x390272,'userProfileId':_0x1c8faf[_0x87ba('0x55')]},'raw':!![]})[_0x87ba('0x22')](function(_0x98c509){if(_0x98c509&&_0x98c509[_0x87ba('0x4f')]===0x0){return db[_0x87ba('0x26')][_0x87ba('0x48')]({'name':_0x263cca[_0x87ba('0x29')],'resourceId':_0x263cca['id'],'type':_0x98c509[_0x87ba('0x29')],'sectionId':_0x98c509['id']},{})[_0x87ba('0x22')](function(){return _0x1c7821;});}else{return _0x1c7821;}})[_0x87ba('0x47')](function(_0xb3fb3a){logger[_0x87ba('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb3fb3a);throw _0xb3fb3a;});}return _0x1c7821;});}})[_0x87ba('0x22')](respondWithResult(_0x4c110c,0xc9))[_0x87ba('0x47')](handleError(_0x4c110c,null));};exports[_0x87ba('0x56')]=function(_0x166624,_0x1ff253){if(_0x166624[_0x87ba('0x49')]['id']){delete _0x166624[_0x87ba('0x49')]['id'];}return db['JscriptyProject'][_0x87ba('0x4e')]({'where':{'id':_0x166624['params']['id']}})[_0x87ba('0x22')](handleEntityNotFound(_0x1ff253,null))[_0x87ba('0x22')](saveUpdates(_0x166624[_0x87ba('0x49')],null))[_0x87ba('0x22')](respondWithResult(_0x1ff253,null))[_0x87ba('0x47')](handleError(_0x1ff253,null));};exports['destroy']=function(_0x52b7e1,_0x3644fa){return db['JscriptyProject']['find']({'where':{'id':_0x52b7e1[_0x87ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x3644fa,null))[_0x87ba('0x22')](removeEntity(_0x3644fa,null))['catch'](handleError(_0x3644fa,null));};exports['getSessions']=function(_0x35b720,_0x2f2b23,_0x1f3031){var _0x223868={'raw':!![],'where':{}};var _0x1fbbd9={};var _0x5915e7={'count':0x0,'rows':[]};return db[_0x87ba('0x2d')][_0x87ba('0x57')]({'where':{'id':_0x35b720['params']['id']}})[_0x87ba('0x22')](handleEntityNotFound(_0x2f2b23,null))[_0x87ba('0x22')](function(_0x38458a){if(_0x38458a){_0x1fbbd9[_0x87ba('0x31')]=_[_0x87ba('0x45')](db[_0x87ba('0x58')][_0x87ba('0x51')]);_0x1fbbd9[_0x87ba('0x32')]=_[_0x87ba('0x45')](_0x35b720[_0x87ba('0x32')]);_0x1fbbd9[_0x87ba('0x33')]=_['intersection'](_0x1fbbd9[_0x87ba('0x31')],_0x1fbbd9['query']);_0x223868[_0x87ba('0x35')]=_['intersection'](_0x1fbbd9[_0x87ba('0x31')],qs[_0x87ba('0x36')](_0x35b720[_0x87ba('0x32')]['fields']));_0x223868[_0x87ba('0x35')]=_0x223868[_0x87ba('0x35')][_0x87ba('0x37')]?_0x223868[_0x87ba('0x35')]:_0x1fbbd9[_0x87ba('0x31')];if(!_0x35b720[_0x87ba('0x32')][_0x87ba('0x38')]('nolimit')){_0x223868[_0x87ba('0x1c')]=qs[_0x87ba('0x1c')](_0x35b720[_0x87ba('0x32')]['limit']);_0x223868['offset']=qs[_0x87ba('0x1b')](_0x35b720['query'][_0x87ba('0x1b')]);}_0x223868[_0x87ba('0x3a')]=qs[_0x87ba('0x3b')](_0x35b720[_0x87ba('0x32')][_0x87ba('0x3b')]);_0x223868[_0x87ba('0x3c')]=qs[_0x87ba('0x33')](_[_0x87ba('0x59')](_0x35b720[_0x87ba('0x32')],_0x1fbbd9[_0x87ba('0x33')]));_0x223868['where']['ProjectId']=_0x38458a['id'];if(_0x35b720['query']['filter']){_0x223868[_0x87ba('0x3c')]=_[_0x87ba('0x3e')](_0x223868[_0x87ba('0x3c')],{'$or':_[_0x87ba('0x2c')](_0x223868[_0x87ba('0x35')],function(_0x105503){var _0x293eff={};_0x293eff[_0x105503]={'$like':'%'+_0x35b720['query']['filter']+'%'};return _0x293eff;})});}_0x223868=_['merge']({},_0x223868,_0x35b720[_0x87ba('0x40')]);return db[_0x87ba('0x58')][_0x87ba('0x1a')]({'where':_0x223868[_0x87ba('0x3c')]})[_0x87ba('0x22')](function(_0x472429){_0x5915e7[_0x87ba('0x1a')]=_0x472429;if(_0x35b720[_0x87ba('0x32')][_0x87ba('0x41')]){_0x223868[_0x87ba('0x46')]=[{'all':!![]}];}return db[_0x87ba('0x58')][_0x87ba('0x42')](_0x223868);})[_0x87ba('0x22')](function(_0x437d4f){_0x5915e7[_0x87ba('0x43')]=_0x437d4f;return _0x5915e7;});}})['then'](respondWithFilteredResult(_0x2f2b23,_0x223868))[_0x87ba('0x47')](handleError(_0x2f2b23,null));};exports[_0x87ba('0x5a')]=function(_0x862865,_0x4fe75b,_0x14bb78){var _0x1cd368={'raw':!![],'where':{}};var _0x4daf0b={};var _0x2bcfc1={'count':0x0,'rows':[]};return db[_0x87ba('0x2d')][_0x87ba('0x57')]({'where':{'id':_0x862865[_0x87ba('0x44')]['id']}})[_0x87ba('0x22')](handleEntityNotFound(_0x4fe75b,null))[_0x87ba('0x22')](function(_0x4d24d1){if(_0x4d24d1){_0x4daf0b['model']=_['keys'](db[_0x87ba('0x5b')][_0x87ba('0x51')]);_0x4daf0b[_0x87ba('0x32')]=_[_0x87ba('0x45')](_0x862865[_0x87ba('0x32')]);_0x4daf0b[_0x87ba('0x33')]=_[_0x87ba('0x34')](_0x4daf0b[_0x87ba('0x31')],_0x4daf0b['query']);_0x1cd368[_0x87ba('0x35')]=_[_0x87ba('0x34')](_0x4daf0b[_0x87ba('0x31')],qs[_0x87ba('0x36')](_0x862865[_0x87ba('0x32')][_0x87ba('0x36')]));_0x1cd368['attributes']=_0x1cd368[_0x87ba('0x35')][_0x87ba('0x37')]?_0x1cd368[_0x87ba('0x35')]:_0x4daf0b[_0x87ba('0x31')];if(!_0x862865['query']['hasOwnProperty'](_0x87ba('0x39'))){_0x1cd368[_0x87ba('0x1c')]=qs[_0x87ba('0x1c')](_0x862865[_0x87ba('0x32')][_0x87ba('0x1c')]);_0x1cd368[_0x87ba('0x1b')]=qs[_0x87ba('0x1b')](_0x862865[_0x87ba('0x32')]['offset']);}_0x1cd368[_0x87ba('0x3a')]=qs['sort'](_0x862865[_0x87ba('0x32')][_0x87ba('0x3b')]);_0x1cd368['where']=qs[_0x87ba('0x33')](_[_0x87ba('0x59')](_0x862865['query'],_0x4daf0b[_0x87ba('0x33')]));_0x1cd368[_0x87ba('0x3c')][_0x87ba('0x5c')]=_0x4d24d1['id'];if(_0x862865['query'][_0x87ba('0x3d')]){_0x1cd368[_0x87ba('0x3c')]=_[_0x87ba('0x3e')](_0x1cd368[_0x87ba('0x3c')],{'$or':_[_0x87ba('0x2c')](_0x1cd368[_0x87ba('0x35')],function(_0x3320b4){var _0x3fa7e7={};_0x3fa7e7[_0x3320b4]={'$like':'%'+_0x862865[_0x87ba('0x32')]['filter']+'%'};return _0x3fa7e7;})});}_0x1cd368=_['merge']({},_0x1cd368,_0x862865[_0x87ba('0x40')]);return db[_0x87ba('0x5b')][_0x87ba('0x1a')]({'where':_0x1cd368[_0x87ba('0x3c')]})[_0x87ba('0x22')](function(_0x43f224){_0x2bcfc1[_0x87ba('0x1a')]=_0x43f224;if(_0x862865[_0x87ba('0x32')][_0x87ba('0x41')]){_0x1cd368[_0x87ba('0x46')]=[{'all':!![]}];}return db[_0x87ba('0x5b')][_0x87ba('0x42')](_0x1cd368);})[_0x87ba('0x22')](function(_0x59e51e){_0x2bcfc1[_0x87ba('0x43')]=_0x59e51e;return _0x2bcfc1;});}})[_0x87ba('0x22')](respondWithFilteredResult(_0x4fe75b,_0x1cd368))['catch'](handleError(_0x4fe75b,null));};function char(_0x571f8e){return'number'===typeof _0x571f8e?String[_0x87ba('0x5d')][_0x87ba('0x20')](null,arguments):_0x571f8e;}function needsEncapsulation(_0x47800c){return!!_0x47800c&&(_0x47800c['toString']()[_0x87ba('0x5e')](char(0xd))>=0x0||_0x47800c['toString']()[_0x87ba('0x5e')](char(0xa))>=0x0||_0x47800c[_0x87ba('0x5f')]()[_0x87ba('0x5e')](char(0x2c))>=0x0||_0x47800c[_0x87ba('0x5f')]()[_0x87ba('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x2670f4){var _0x4d3f2a=char(0x22),_0x3b2c09='\x5c'+char(0x22),_0x118a22=_0x2670f4[_0x87ba('0x5f')]()[_0x87ba('0x60')](new RegExp(_0x4d3f2a,'g'),_0x3b2c09);return _0x4d3f2a+_0x118a22+_0x4d3f2a;}exports['getSummary']=function(_0x4701f6,_0x33326c,_0x6b1fd9){var _0x258747,_0x2ffcc0;var _0x4e7c2a={'where':{'ProjectId':_0x4701f6[_0x87ba('0x44')]['id']}};if(_0x4701f6[_0x87ba('0x32')]['startTime']){_0x4e7c2a[_0x87ba('0x3c')]['starttime']=JSON[_0x87ba('0x61')](_0x4701f6[_0x87ba('0x32')][_0x87ba('0x62')]);}return db[_0x87ba('0x58')][_0x87ba('0x42')](_0x4e7c2a)[_0x87ba('0x22')](handleEntityNotFound(_0x33326c,null))[_0x87ba('0x22')](function(_0x55b04b){if(_0x55b04b){_0x258747=_0x55b04b;return db[_0x87ba('0x63')][_0x87ba('0x42')]({'where':{'SessionId':{'$in':_['map'](_0x258747,'id')},'ProjectId':_0x4701f6[_0x87ba('0x44')]['id']},'order':_0x87ba('0x64')});}})[_0x87ba('0x22')](handleEntityNotFound(_0x33326c,null))['then'](function(_0x33b482){if(_0x33b482){_0x2ffcc0=_0x33b482;var _0x2cea4c={};for(var _0x50f6f7=0x0,_0x3b1e7c=_0x2ffcc0[_0x87ba('0x37')];_0x50f6f7<_0x3b1e7c;_0x50f6f7++){if(!_0x2cea4c[_0x87ba('0x38')](_0x2ffcc0[_0x50f6f7]['questionId'])){_0x2cea4c[_0x2ffcc0[_0x50f6f7]['questionId']]=needsEncapsulation(_0x2ffcc0[_0x50f6f7][_0x87ba('0x65')])?encapsulate(_0x2ffcc0[_0x50f6f7]['question']):_0x2ffcc0[_0x50f6f7][_0x87ba('0x65')];}}var _0x1c7186=[],_0x24321a={};for(var _0x28a812=0x0,_0x2e1be1=_0x258747[_0x87ba('0x37')];_0x28a812<_0x2e1be1;_0x28a812++){_0x24321a={'ProjectId':_0x4701f6[_0x87ba('0x44')]['id'],'SessionId':_0x258747[_0x28a812]['id'],'StartTime':moment(_0x258747[_0x28a812][_0x87ba('0x66')])[_0x87ba('0x67')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0xfa10f6=0x0,_0x16c9ec=_0x2ffcc0[_0x87ba('0x37')];_0xfa10f6<_0x16c9ec;_0xfa10f6++){if(_0x2ffcc0[_0xfa10f6][_0x87ba('0x68')]==_0x258747[_0x28a812]['id']&&_0x2cea4c['hasOwnProperty'](_0x2ffcc0[_0xfa10f6][_0x87ba('0x69')])){_0x24321a[_0x2cea4c[_0x2ffcc0[_0xfa10f6][_0x87ba('0x69')]]]=_0x2ffcc0[_0xfa10f6][_0x87ba('0x6a')];}}for(var _0x3f2b54 in _0x2cea4c){if(!_0x24321a[_0x87ba('0x38')](_0x2cea4c[_0x3f2b54])){_0x24321a[_0x2cea4c[_0x3f2b54]]=null;}}_0x1c7186[_0x87ba('0x6b')](_0x24321a);}return _0x1c7186;}})[_0x87ba('0x22')](function(_0x35dd96){if(!_[_0x87ba('0x6c')](_0x35dd96)){var _0x198899=toCsv(_0x35dd96);var _0x1a9ecb=Date[_0x87ba('0x6d')]();fs['writeFileSync'](util[_0x87ba('0x67')](_0x87ba('0x6e'),_0x4701f6[_0x87ba('0x44')]['id'],_0x1a9ecb),_0x198899);_0x33326c[_0x87ba('0x6f')]('Content-disposition','attachment;\x20filename='+util[_0x87ba('0x67')](_0x87ba('0x70'),_0x4701f6['params']['id'],_0x1a9ecb));_0x33326c[_0x87ba('0x6f')](_0x87ba('0x71'),_0x87ba('0x72'));return _0x33326c[_0x87ba('0x73')](util[_0x87ba('0x67')](_0x87ba('0x6e'),_0x4701f6['params']['id'],_0x1a9ecb));}else{return _0x33326c[_0x87ba('0x17')](0xcc);}})[_0x87ba('0x47')](handleError(_0x33326c,null));};
\ No newline at end of file
+var _0x0c30=['key','model','map','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','JscriptyProject','include','findAll','rows','catch','show','params','keys','rawAttributes','intersection','includeAll','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','error','destroy','getSessions','JscriptySessionReport','ProjectId','getAnswers','findOne','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','answer','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','get','Projects','UserProfileResource','stack','name','send','index','fieldName','type'];(function(_0x46dc09,_0xdf9dba){var _0x551ec7=function(_0x377c5b){while(--_0x377c5b){_0x46dc09['push'](_0x46dc09['shift']());}};_0x551ec7(++_0xdf9dba);}(_0x0c30,0x137));var _0x00c3=function(_0xa3c06b,_0x490f99){_0xa3c06b=_0xa3c06b-0x0;var _0x33aa1d=_0x0c30[_0xa3c06b];return _0x33aa1d;};'use strict';var pdf=require(_0x00c3('0x0'));var emlformat=require(_0x00c3('0x1'));var rimraf=require(_0x00c3('0x2'));var zipdir=require(_0x00c3('0x3'));var jsonpatch=require(_0x00c3('0x4'));var rp=require(_0x00c3('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x00c3('0x6'));var util=require(_0x00c3('0x7'));var path=require(_0x00c3('0x8'));var sox=require(_0x00c3('0x9'));var csv=require('to-csv');var ejs=require(_0x00c3('0xa'));var fs=require('fs');var _=require(_0x00c3('0xb'));var squel=require(_0x00c3('0xc'));var crypto=require(_0x00c3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x00c3('0xe'));var toCsv=require(_0x00c3('0xf'));var querystring=require(_0x00c3('0x10'));var Papa=require('papaparse');var Redis=require(_0x00c3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x00c3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x00c3('0x13'));var utils=require('../../config/utils');var config=require(_0x00c3('0x14'));var db=require(_0x00c3('0x15'))['db'];function respondWithStatusCode(_0x459286,_0x4e18fe){_0x4e18fe=_0x4e18fe||0xcc;return function(_0x4898e8){if(_0x4898e8){return _0x459286[_0x00c3('0x16')](_0x4e18fe);}return _0x459286[_0x00c3('0x17')](_0x4e18fe)[_0x00c3('0x18')]();};}function respondWithResult(_0x28308e,_0x2b0181){_0x2b0181=_0x2b0181||0xc8;return function(_0x4c5c00){if(_0x4c5c00){return _0x28308e[_0x00c3('0x17')](_0x2b0181)[_0x00c3('0x19')](_0x4c5c00);}};}function respondWithFilteredResult(_0x512aad,_0x14edd7){return function(_0x51581f){if(_0x51581f){var _0x2956bd=_0x51581f[_0x00c3('0x1a')],_0x411a63=_0x14edd7[_0x00c3('0x1b')],_0x5dd855=_0x14edd7[_0x00c3('0x1b')]+_0x14edd7['limit'],_0x3e1851;if(_0x5dd855>=_0x2956bd){_0x5dd855=_0x2956bd;_0x3e1851=0xc8;}else{_0x3e1851=0xce;}_0x512aad['status'](_0x3e1851);return _0x512aad[_0x00c3('0x1c')]('Content-Range',_0x411a63+'-'+_0x5dd855+'/'+_0x2956bd)['json'](_0x51581f);}return null;};}function patchUpdates(_0x556517){return function(_0x384c0e){try{jsonpatch[_0x00c3('0x1d')](_0x384c0e,_0x556517,!![]);}catch(_0x264e77){return BPromise[_0x00c3('0x1e')](_0x264e77);}return _0x384c0e[_0x00c3('0x1f')]();};}function saveUpdates(_0x11578a,_0x18b364){return function(_0x305257){if(_0x305257){return _0x305257[_0x00c3('0x20')](_0x11578a)[_0x00c3('0x21')](function(_0x57ee5c){return _0x57ee5c;});}return null;};}function removeEntity(_0x24d091,_0x431718){return function(_0x388c85){if(_0x388c85){return _0x388c85['destroy']()[_0x00c3('0x21')](function(){var _0x20589f=_0x388c85[_0x00c3('0x22')]({'plain':!![]});var _0x4ec6ec=_0x00c3('0x23');return db[_0x00c3('0x24')]['destroy']({'where':{'type':_0x4ec6ec,'resourceId':_0x20589f['id']}})[_0x00c3('0x21')](function(){return _0x388c85;});})[_0x00c3('0x21')](function(){_0x24d091[_0x00c3('0x17')](0xcc)[_0x00c3('0x18')]();});}};}function handleEntityNotFound(_0x257711,_0x236baa){return function(_0x59776b){if(!_0x59776b){_0x257711[_0x00c3('0x16')](0x194);}return _0x59776b;};}function handleError(_0x38210c,_0x43249e){_0x43249e=_0x43249e||0x1f4;return function(_0x4e0f46){logger['error'](_0x4e0f46[_0x00c3('0x25')]);if(_0x4e0f46[_0x00c3('0x26')]){delete _0x4e0f46[_0x00c3('0x26')];}_0x38210c['status'](_0x43249e)[_0x00c3('0x27')](_0x4e0f46);};}exports[_0x00c3('0x28')]=function(_0x59cc89,_0x2ef40e){var _0x4d555d={},_0x28892a={},_0xe81345={'count':0x0,'rows':[]};var _0x352fb6=_['map'](db['JscriptyProject']['rawAttributes'],function(_0x47237f){return{'name':_0x47237f[_0x00c3('0x29')],'type':_0x47237f[_0x00c3('0x2a')][_0x00c3('0x2b')]};});_0x28892a[_0x00c3('0x2c')]=_[_0x00c3('0x2d')](_0x352fb6,_0x00c3('0x26'));_0x28892a[_0x00c3('0x2e')]=_['keys'](_0x59cc89[_0x00c3('0x2e')]);_0x28892a['filters']=_['intersection'](_0x28892a[_0x00c3('0x2c')],_0x28892a[_0x00c3('0x2e')]);_0x4d555d[_0x00c3('0x2f')]=_['intersection'](_0x28892a[_0x00c3('0x2c')],qs['fields'](_0x59cc89[_0x00c3('0x2e')][_0x00c3('0x30')]));_0x4d555d[_0x00c3('0x2f')]=_0x4d555d[_0x00c3('0x2f')][_0x00c3('0x31')]?_0x4d555d[_0x00c3('0x2f')]:_0x28892a[_0x00c3('0x2c')];if(!_0x59cc89[_0x00c3('0x2e')][_0x00c3('0x32')](_0x00c3('0x33'))){_0x4d555d[_0x00c3('0x34')]=qs[_0x00c3('0x34')](_0x59cc89[_0x00c3('0x2e')][_0x00c3('0x34')]);_0x4d555d[_0x00c3('0x1b')]=qs[_0x00c3('0x1b')](_0x59cc89[_0x00c3('0x2e')][_0x00c3('0x1b')]);}_0x4d555d[_0x00c3('0x35')]=qs['sort'](_0x59cc89[_0x00c3('0x2e')][_0x00c3('0x36')]);_0x4d555d[_0x00c3('0x37')]=qs['filters'](_[_0x00c3('0x38')](_0x59cc89['query'],_0x28892a[_0x00c3('0x39')]),_0x352fb6);if(_0x59cc89[_0x00c3('0x2e')][_0x00c3('0x3a')]){_0x4d555d['where']=_[_0x00c3('0x3b')](_0x4d555d['where'],{'$or':_[_0x00c3('0x2d')](_0x352fb6,function(_0x5e95cc){if(_0x5e95cc[_0x00c3('0x2a')]!==_0x00c3('0x3c')){var _0x2a5435={};_0x2a5435[_0x5e95cc[_0x00c3('0x26')]]={'$like':'%'+_0x59cc89[_0x00c3('0x2e')][_0x00c3('0x3a')]+'%'};return _0x2a5435;}})});}_0x4d555d=_[_0x00c3('0x3b')]({},_0x4d555d,_0x59cc89[_0x00c3('0x3d')]);var _0xb663c4={'where':_0x4d555d[_0x00c3('0x37')]};return db[_0x00c3('0x3e')]['count'](_0xb663c4)[_0x00c3('0x21')](function(_0x1fe03f){_0xe81345[_0x00c3('0x1a')]=_0x1fe03f;if(_0x59cc89[_0x00c3('0x2e')]['includeAll']){_0x4d555d[_0x00c3('0x3f')]=[{'all':!![]}];}return db[_0x00c3('0x3e')][_0x00c3('0x40')](_0x4d555d);})['then'](function(_0x4a7765){_0xe81345[_0x00c3('0x41')]=_0x4a7765;return _0xe81345;})['then'](respondWithFilteredResult(_0x2ef40e,_0x4d555d))[_0x00c3('0x42')](handleError(_0x2ef40e,null));};exports[_0x00c3('0x43')]=function(_0x127122,_0x24edf3){var _0x2d6a70={'raw':![],'where':{'id':_0x127122[_0x00c3('0x44')]['id']}},_0x3238af={};_0x3238af[_0x00c3('0x2c')]=_[_0x00c3('0x45')](db[_0x00c3('0x3e')][_0x00c3('0x46')]);_0x3238af[_0x00c3('0x2e')]=_[_0x00c3('0x45')](_0x127122[_0x00c3('0x2e')]);_0x3238af['filters']=_[_0x00c3('0x47')](_0x3238af['model'],_0x3238af[_0x00c3('0x2e')]);_0x2d6a70['attributes']=_['intersection'](_0x3238af[_0x00c3('0x2c')],qs['fields'](_0x127122['query']['fields']));_0x2d6a70[_0x00c3('0x2f')]=_0x2d6a70[_0x00c3('0x2f')]['length']?_0x2d6a70[_0x00c3('0x2f')]:_0x3238af[_0x00c3('0x2c')];if(_0x127122[_0x00c3('0x2e')][_0x00c3('0x48')]){_0x2d6a70[_0x00c3('0x3f')]=[{'all':!![]}];}_0x2d6a70=_[_0x00c3('0x3b')]({},_0x2d6a70,_0x127122[_0x00c3('0x3d')]);return db[_0x00c3('0x3e')][_0x00c3('0x49')](_0x2d6a70)[_0x00c3('0x21')](handleEntityNotFound(_0x24edf3,null))[_0x00c3('0x21')](respondWithResult(_0x24edf3,null))[_0x00c3('0x42')](handleError(_0x24edf3,null));};exports['create']=function(_0x37f4ad,_0x2ff6ea){return db[_0x00c3('0x3e')][_0x00c3('0x4a')](_0x37f4ad[_0x00c3('0x4b')],{})['then'](function(_0x151c7f){var _0x4f2624=_0x37f4ad['user']['get']({'plain':!![]});if(!_0x4f2624)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f2624['role']===_0x00c3('0x4c')){var _0x37e699=_0x151c7f[_0x00c3('0x22')]({'plain':!![]});var _0x120ca7='Projects';return db[_0x00c3('0x4d')]['find']({'where':{'name':_0x120ca7,'userProfileId':_0x4f2624[_0x00c3('0x4e')]},'raw':!![]})[_0x00c3('0x21')](function(_0x502174){if(_0x502174&&_0x502174[_0x00c3('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x37e699['name'],'resourceId':_0x37e699['id'],'type':_0x502174[_0x00c3('0x26')],'sectionId':_0x502174['id']},{})[_0x00c3('0x21')](function(){return _0x151c7f;});}else{return _0x151c7f;}})[_0x00c3('0x42')](function(_0x497590){logger['error'](_0x00c3('0x50'),_0x497590);throw _0x497590;});}return _0x151c7f;})['then'](respondWithResult(_0x2ff6ea,0xc9))[_0x00c3('0x42')](handleError(_0x2ff6ea,null));};exports[_0x00c3('0x51')]=function(_0x4beff3,_0x186be6){var _0x40faa5={'where':{'id':_0x4beff3[_0x00c3('0x44')]['id']}},_0x5a0dc3={};_0x5a0dc3[_0x00c3('0x2c')]=_['keys'](db[_0x00c3('0x3e')][_0x00c3('0x46')]);_0x40faa5[_0x00c3('0x2f')]=_['intersection'](_0x5a0dc3[_0x00c3('0x2c')],qs[_0x00c3('0x30')](_0x4beff3[_0x00c3('0x2e')][_0x00c3('0x30')]));_0x40faa5[_0x00c3('0x2f')]=_0x40faa5[_0x00c3('0x2f')][_0x00c3('0x31')]?_0x40faa5[_0x00c3('0x2f')]:_0x5a0dc3['model'];if(_0x4beff3[_0x00c3('0x2e')][_0x00c3('0x48')]){_0x40faa5[_0x00c3('0x3f')]=[{'all':!![]}];}_0x40faa5=_[_0x00c3('0x3b')]({},_0x40faa5,_0x4beff3[_0x00c3('0x3d')]);return db[_0x00c3('0x3e')][_0x00c3('0x49')](_0x40faa5)[_0x00c3('0x21')](handleEntityNotFound(_0x186be6,null))['then'](function(_0x34d4c0){if(_0x34d4c0){var _0x5a9e77=_0x34d4c0[_0x00c3('0x22')]({'plain':!![]});_0x5a9e77=qs[_0x00c3('0x52')](_0x5a9e77,['id',_0x00c3('0x53'),_0x00c3('0x54')]);_0x4beff3[_0x00c3('0x4b')]=_[_0x00c3('0x52')](_0x4beff3[_0x00c3('0x4b')],['id',_0x00c3('0x53'),_0x00c3('0x54')]);return db['JscriptyProject'][_0x00c3('0x4a')](_[_0x00c3('0x3b')](_0x5a9e77,_0x4beff3[_0x00c3('0x4b')]),{'include':_0x4beff3[_0x00c3('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0x00c3('0x21')](function(_0x260fd5){var _0x4adde9=_0x4beff3['user'][_0x00c3('0x22')]({'plain':!![]});if(!_0x4adde9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4adde9[_0x00c3('0x55')]===_0x00c3('0x4c')){var _0x3f0eb5=_0x260fd5[_0x00c3('0x22')]({'plain':!![]});var _0x10a579=_0x00c3('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x10a579,'userProfileId':_0x4adde9[_0x00c3('0x4e')]},'raw':!![]})[_0x00c3('0x21')](function(_0x1fbe11){if(_0x1fbe11&&_0x1fbe11[_0x00c3('0x4f')]===0x0){return db[_0x00c3('0x24')]['create']({'name':_0x3f0eb5[_0x00c3('0x26')],'resourceId':_0x3f0eb5['id'],'type':_0x1fbe11['name'],'sectionId':_0x1fbe11['id']},{})[_0x00c3('0x21')](function(){return _0x260fd5;});}else{return _0x260fd5;}})['catch'](function(_0xe95bcc){logger[_0x00c3('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe95bcc);throw _0xe95bcc;});}return _0x260fd5;});}})[_0x00c3('0x21')](respondWithResult(_0x186be6,0xc9))[_0x00c3('0x42')](handleError(_0x186be6,null));};exports[_0x00c3('0x20')]=function(_0x2b82ed,_0x371faf){if(_0x2b82ed[_0x00c3('0x4b')]['id']){delete _0x2b82ed[_0x00c3('0x4b')]['id'];}return db[_0x00c3('0x3e')][_0x00c3('0x49')]({'where':{'id':_0x2b82ed[_0x00c3('0x44')]['id']}})[_0x00c3('0x21')](handleEntityNotFound(_0x371faf,null))[_0x00c3('0x21')](saveUpdates(_0x2b82ed['body'],null))['then'](respondWithResult(_0x371faf,null))[_0x00c3('0x42')](handleError(_0x371faf,null));};exports[_0x00c3('0x57')]=function(_0x3543c5,_0x1c4a43){return db[_0x00c3('0x3e')][_0x00c3('0x49')]({'where':{'id':_0x3543c5[_0x00c3('0x44')]['id']}})[_0x00c3('0x21')](handleEntityNotFound(_0x1c4a43,null))[_0x00c3('0x21')](removeEntity(_0x1c4a43,null))[_0x00c3('0x42')](handleError(_0x1c4a43,null));};exports[_0x00c3('0x58')]=function(_0x579404,_0x4de706,_0x488251){var _0x5dc393={'raw':!![],'where':{}};var _0xb203ab={};var _0xa34378={'count':0x0,'rows':[]};return db[_0x00c3('0x3e')]['findOne']({'where':{'id':_0x579404[_0x00c3('0x44')]['id']}})['then'](handleEntityNotFound(_0x4de706,null))[_0x00c3('0x21')](function(_0x5c84ca){if(_0x5c84ca){_0xb203ab[_0x00c3('0x2c')]=_[_0x00c3('0x45')](db[_0x00c3('0x59')][_0x00c3('0x46')]);_0xb203ab[_0x00c3('0x2e')]=_[_0x00c3('0x45')](_0x579404['query']);_0xb203ab[_0x00c3('0x39')]=_[_0x00c3('0x47')](_0xb203ab[_0x00c3('0x2c')],_0xb203ab[_0x00c3('0x2e')]);_0x5dc393[_0x00c3('0x2f')]=_['intersection'](_0xb203ab[_0x00c3('0x2c')],qs[_0x00c3('0x30')](_0x579404[_0x00c3('0x2e')]['fields']));_0x5dc393[_0x00c3('0x2f')]=_0x5dc393[_0x00c3('0x2f')][_0x00c3('0x31')]?_0x5dc393[_0x00c3('0x2f')]:_0xb203ab[_0x00c3('0x2c')];if(!_0x579404['query']['hasOwnProperty'](_0x00c3('0x33'))){_0x5dc393['limit']=qs[_0x00c3('0x34')](_0x579404[_0x00c3('0x2e')]['limit']);_0x5dc393[_0x00c3('0x1b')]=qs[_0x00c3('0x1b')](_0x579404[_0x00c3('0x2e')][_0x00c3('0x1b')]);}_0x5dc393[_0x00c3('0x35')]=qs[_0x00c3('0x36')](_0x579404[_0x00c3('0x2e')]['sort']);_0x5dc393[_0x00c3('0x37')]=qs[_0x00c3('0x39')](_[_0x00c3('0x38')](_0x579404[_0x00c3('0x2e')],_0xb203ab[_0x00c3('0x39')]));_0x5dc393['where'][_0x00c3('0x5a')]=_0x5c84ca['id'];if(_0x579404[_0x00c3('0x2e')][_0x00c3('0x3a')]){_0x5dc393[_0x00c3('0x37')]=_[_0x00c3('0x3b')](_0x5dc393[_0x00c3('0x37')],{'$or':_[_0x00c3('0x2d')](_0x5dc393['attributes'],function(_0x7cc09b){var _0x521062={};_0x521062[_0x7cc09b]={'$like':'%'+_0x579404[_0x00c3('0x2e')][_0x00c3('0x3a')]+'%'};return _0x521062;})});}_0x5dc393=_['merge']({},_0x5dc393,_0x579404[_0x00c3('0x3d')]);return db[_0x00c3('0x59')][_0x00c3('0x1a')]({'where':_0x5dc393[_0x00c3('0x37')]})['then'](function(_0x53cf54){_0xa34378[_0x00c3('0x1a')]=_0x53cf54;if(_0x579404[_0x00c3('0x2e')][_0x00c3('0x48')]){_0x5dc393[_0x00c3('0x3f')]=[{'all':!![]}];}return db[_0x00c3('0x59')][_0x00c3('0x40')](_0x5dc393);})[_0x00c3('0x21')](function(_0x24bcc7){_0xa34378[_0x00c3('0x41')]=_0x24bcc7;return _0xa34378;});}})[_0x00c3('0x21')](respondWithFilteredResult(_0x4de706,_0x5dc393))[_0x00c3('0x42')](handleError(_0x4de706,null));};exports[_0x00c3('0x5b')]=function(_0x3940bd,_0x145fc3,_0x5c4e86){var _0x5d2902={'raw':!![],'where':{}};var _0x32340c={};var _0x11c7f7={'count':0x0,'rows':[]};return db[_0x00c3('0x3e')][_0x00c3('0x5c')]({'where':{'id':_0x3940bd[_0x00c3('0x44')]['id']}})[_0x00c3('0x21')](handleEntityNotFound(_0x145fc3,null))[_0x00c3('0x21')](function(_0x514e61){if(_0x514e61){_0x32340c[_0x00c3('0x2c')]=_[_0x00c3('0x45')](db[_0x00c3('0x5d')]['rawAttributes']);_0x32340c[_0x00c3('0x2e')]=_[_0x00c3('0x45')](_0x3940bd[_0x00c3('0x2e')]);_0x32340c[_0x00c3('0x39')]=_[_0x00c3('0x47')](_0x32340c[_0x00c3('0x2c')],_0x32340c[_0x00c3('0x2e')]);_0x5d2902['attributes']=_[_0x00c3('0x47')](_0x32340c['model'],qs[_0x00c3('0x30')](_0x3940bd[_0x00c3('0x2e')]['fields']));_0x5d2902[_0x00c3('0x2f')]=_0x5d2902[_0x00c3('0x2f')][_0x00c3('0x31')]?_0x5d2902['attributes']:_0x32340c[_0x00c3('0x2c')];if(!_0x3940bd['query'][_0x00c3('0x32')](_0x00c3('0x33'))){_0x5d2902['limit']=qs[_0x00c3('0x34')](_0x3940bd[_0x00c3('0x2e')]['limit']);_0x5d2902[_0x00c3('0x1b')]=qs[_0x00c3('0x1b')](_0x3940bd[_0x00c3('0x2e')]['offset']);}_0x5d2902['order']=qs[_0x00c3('0x36')](_0x3940bd['query'][_0x00c3('0x36')]);_0x5d2902['where']=qs[_0x00c3('0x39')](_[_0x00c3('0x38')](_0x3940bd[_0x00c3('0x2e')],_0x32340c[_0x00c3('0x39')]));_0x5d2902['where']['ProjectId']=_0x514e61['id'];if(_0x3940bd[_0x00c3('0x2e')]['filter']){_0x5d2902[_0x00c3('0x37')]=_[_0x00c3('0x3b')](_0x5d2902['where'],{'$or':_[_0x00c3('0x2d')](_0x5d2902['attributes'],function(_0x21e221){var _0x2319e9={};_0x2319e9[_0x21e221]={'$like':'%'+_0x3940bd[_0x00c3('0x2e')]['filter']+'%'};return _0x2319e9;})});}_0x5d2902=_[_0x00c3('0x3b')]({},_0x5d2902,_0x3940bd[_0x00c3('0x3d')]);return db[_0x00c3('0x5d')]['count']({'where':_0x5d2902[_0x00c3('0x37')]})[_0x00c3('0x21')](function(_0x2b8694){_0x11c7f7['count']=_0x2b8694;if(_0x3940bd['query']['includeAll']){_0x5d2902[_0x00c3('0x3f')]=[{'all':!![]}];}return db[_0x00c3('0x5d')][_0x00c3('0x40')](_0x5d2902);})[_0x00c3('0x21')](function(_0x2700d8){_0x11c7f7['rows']=_0x2700d8;return _0x11c7f7;});}})[_0x00c3('0x21')](respondWithFilteredResult(_0x145fc3,_0x5d2902))[_0x00c3('0x42')](handleError(_0x145fc3,null));};function char(_0x1f211f){return _0x00c3('0x5e')===typeof _0x1f211f?String['fromCharCode'][_0x00c3('0x1d')](null,arguments):_0x1f211f;}function needsEncapsulation(_0x2c4367){return!!_0x2c4367&&(_0x2c4367[_0x00c3('0x5f')]()[_0x00c3('0x60')](char(0xd))>=0x0||_0x2c4367[_0x00c3('0x5f')]()[_0x00c3('0x60')](char(0xa))>=0x0||_0x2c4367[_0x00c3('0x5f')]()[_0x00c3('0x60')](char(0x2c))>=0x0||_0x2c4367[_0x00c3('0x5f')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x366bed){var _0xdb9280=char(0x22),_0xf42c19='\x5c'+char(0x22),_0x103732=_0x366bed[_0x00c3('0x5f')]()[_0x00c3('0x61')](new RegExp(_0xdb9280,'g'),_0xf42c19);return _0xdb9280+_0x103732+_0xdb9280;}exports[_0x00c3('0x62')]=function(_0x2cc10d,_0x3b5c92,_0x2f4fd2){var _0x3ef455,_0x5870d1;var _0x5e755c={'where':{'ProjectId':_0x2cc10d[_0x00c3('0x44')]['id']}};if(_0x2cc10d[_0x00c3('0x2e')][_0x00c3('0x63')]){_0x5e755c[_0x00c3('0x37')][_0x00c3('0x64')]=JSON[_0x00c3('0x65')](_0x2cc10d[_0x00c3('0x2e')]['startTime']);}return db['JscriptySessionReport'][_0x00c3('0x40')](_0x5e755c)['then'](handleEntityNotFound(_0x3b5c92,null))[_0x00c3('0x21')](function(_0x427a98){if(_0x427a98){_0x3ef455=_0x427a98;return db[_0x00c3('0x66')][_0x00c3('0x40')]({'where':{'SessionId':{'$in':_[_0x00c3('0x2d')](_0x3ef455,'id')},'ProjectId':_0x2cc10d[_0x00c3('0x44')]['id']},'order':_0x00c3('0x67')});}})[_0x00c3('0x21')](handleEntityNotFound(_0x3b5c92,null))[_0x00c3('0x21')](function(_0x28352f){if(_0x28352f){_0x5870d1=_0x28352f;var _0x171028={};for(var _0x5c54cb=0x0,_0xd0331f=_0x5870d1[_0x00c3('0x31')];_0x5c54cb<_0xd0331f;_0x5c54cb++){if(!_0x171028['hasOwnProperty'](_0x5870d1[_0x5c54cb][_0x00c3('0x68')])){_0x171028[_0x5870d1[_0x5c54cb]['questionId']]=needsEncapsulation(_0x5870d1[_0x5c54cb][_0x00c3('0x69')])?encapsulate(_0x5870d1[_0x5c54cb][_0x00c3('0x69')]):_0x5870d1[_0x5c54cb]['question'];}}var _0x3bc76e=[],_0x95a048={};for(var _0x2677d8=0x0,_0x3f616b=_0x3ef455[_0x00c3('0x31')];_0x2677d8<_0x3f616b;_0x2677d8++){_0x95a048={'ProjectId':_0x2cc10d[_0x00c3('0x44')]['id'],'SessionId':_0x3ef455[_0x2677d8]['id'],'StartTime':moment(_0x3ef455[_0x2677d8][_0x00c3('0x64')])['format'](_0x00c3('0x6a'))};for(var _0xb52368=0x0,_0x556b86=_0x5870d1[_0x00c3('0x31')];_0xb52368<_0x556b86;_0xb52368++){if(_0x5870d1[_0xb52368]['SessionId']==_0x3ef455[_0x2677d8]['id']&&_0x171028[_0x00c3('0x32')](_0x5870d1[_0xb52368]['questionId'])){_0x95a048[_0x171028[_0x5870d1[_0xb52368][_0x00c3('0x68')]]]=_0x5870d1[_0xb52368][_0x00c3('0x6b')];}}for(var _0x4b259c in _0x171028){if(!_0x95a048[_0x00c3('0x32')](_0x171028[_0x4b259c])){_0x95a048[_0x171028[_0x4b259c]]=null;}}_0x3bc76e[_0x00c3('0x6c')](_0x95a048);}return _0x3bc76e;}})[_0x00c3('0x21')](function(_0x6a36b2){if(!_['isEmpty'](_0x6a36b2)){var _0x79d2b5=toCsv(_0x6a36b2);var _0x36a93d=Date[_0x00c3('0x6d')]();fs[_0x00c3('0x6e')](util[_0x00c3('0x6f')](_0x00c3('0x70'),_0x2cc10d[_0x00c3('0x44')]['id'],_0x36a93d),_0x79d2b5);_0x3b5c92[_0x00c3('0x71')](_0x00c3('0x72'),_0x00c3('0x73')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x2cc10d[_0x00c3('0x44')]['id'],_0x36a93d));_0x3b5c92['setHeader'](_0x00c3('0x74'),_0x00c3('0x75'));return _0x3b5c92['download'](util['format'](_0x00c3('0x70'),_0x2cc10d[_0x00c3('0x44')]['id'],_0x36a93d));}else{return _0x3b5c92[_0x00c3('0x16')](0xcc);}})[_0x00c3('0x42')](handleError(_0x3b5c92,null));};
\ No newline at end of file
index aebd2d6..ee14815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbae=['lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject'];(function(_0x2657cf,_0x241101){var _0x5ea237=function(_0xa11d13){while(--_0xa11d13){_0x2657cf['push'](_0x2657cf['shift']());}};_0x5ea237(++_0x241101);}(_0xcbae,0x171));var _0xecba=function(_0x4bf891,_0x57ca13){_0x4bf891=_0x4bf891-0x0;var _0x540586=_0xcbae[_0x4bf891];return _0x540586;};'use strict';var _=require(_0xecba('0x0'));var util=require('util');var logger=require(_0xecba('0x1'))(_0xecba('0x2'));var moment=require('moment');var BPromise=require(_0xecba('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xecba('0x4'));var config=require(_0xecba('0x5'));var attributes=require(_0xecba('0x6'));module[_0xecba('0x7')]=function(_0xcc39b0,_0x2032f7){return _0xcc39b0['define'](_0xecba('0x8'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4716=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','jscripty_projects'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x4716,0x79));var _0x6471=function(_0x54336b,_0x48b028){_0x54336b=_0x54336b-0x0;var _0x5b64a3=_0x4716[_0x54336b];return _0x5b64a3;};'use strict';var _=require(_0x6471('0x0'));var util=require(_0x6471('0x1'));var logger=require('../../config/logger')(_0x6471('0x2'));var moment=require(_0x6471('0x3'));var BPromise=require(_0x6471('0x4'));var rp=require(_0x6471('0x5'));var fs=require('fs');var path=require(_0x6471('0x6'));var rimraf=require('rimraf');var config=require(_0x6471('0x7'));var attributes=require('./jscriptyProject.attributes');module[_0x6471('0x8')]=function(_0x47f10e,_0x2c250d){return _0x47f10e[_0x6471('0x9')]('JscriptyProject',attributes,{'tableName':_0x6471('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9457270..bef468e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1061=['JscriptyProject,\x20%s,\x20%s','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x1061,0x183));var _0x1106=function(_0x59cf35,_0x5b1ecc){_0x59cf35=_0x59cf35-0x0;var _0x313363=_0x1061[_0x59cf35];return _0x313363;};'use strict';var _=require(_0x1106('0x0'));var util=require('util');var moment=require(_0x1106('0x1'));var BPromise=require(_0x1106('0x2'));var rs=require(_0x1106('0x3'));var fs=require('fs');var Redis=require(_0x1106('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1106('0x5'));var logger=require(_0x1106('0x6'))(_0x1106('0x7'));var config=require(_0x1106('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1106('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c63d0,_0x46183d,_0x277bb2){return new BPromise(function(_0xa7064f,_0x581897){return client[_0x1106('0xa')](_0x1c63d0,_0x277bb2)[_0x1106('0xb')](function(_0x1d85ce){logger[_0x1106('0xc')](_0x1106('0xd'),_0x46183d,'request\x20sent');logger[_0x1106('0xe')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x46183d,'request\x20sent',JSON[_0x1106('0xf')](_0x1d85ce));if(_0x1d85ce[_0x1106('0x10')]){if(_0x1d85ce[_0x1106('0x10')][_0x1106('0x11')]===0x1f4){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x46183d,_0x1d85ce['error'][_0x1106('0x12')]);return _0x581897(_0x1d85ce[_0x1106('0x10')][_0x1106('0x12')]);}logger[_0x1106('0x10')](_0x1106('0xd'),_0x46183d,_0x1d85ce[_0x1106('0x10')]['message']);return _0xa7064f(_0x1d85ce[_0x1106('0x10')][_0x1106('0x12')]);}else{logger[_0x1106('0xc')](_0x1106('0xd'),_0x46183d,'request\x20sent');_0xa7064f(_0x1d85ce[_0x1106('0x13')][_0x1106('0x12')]);}})['catch'](function(_0x186cf1){logger[_0x1106('0x10')](_0x1106('0xd'),_0x46183d,_0x186cf1);_0x581897(_0x186cf1);});});}
\ No newline at end of file
+var _0x6d18=['request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyProject,\x20%s,\x20%s','message','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x6d18,0x109));var _0x86d1=function(_0x4140f3,_0x1c48b0){_0x4140f3=_0x4140f3-0x0;var _0x1b6378=_0x6d18[_0x4140f3];return _0x1b6378;};'use strict';var _=require(_0x86d1('0x0'));var util=require(_0x86d1('0x1'));var moment=require(_0x86d1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86d1('0x3'));var db=require(_0x86d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d1('0x5'))('rpc');var config=require(_0x86d1('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12364e,_0x3934ea,_0x2f0a9d){return new BPromise(function(_0x2f834f,_0x602af2){return client[_0x86d1('0x7')](_0x12364e,_0x2f0a9d)['then'](function(_0x44a1f9){logger[_0x86d1('0x8')]('JscriptyProject,\x20%s,\x20%s',_0x3934ea,_0x86d1('0x9'));logger[_0x86d1('0xa')](_0x86d1('0xb'),_0x3934ea,_0x86d1('0x9'),JSON[_0x86d1('0xc')](_0x44a1f9));if(_0x44a1f9['error']){if(_0x44a1f9['error']['code']===0x1f4){logger[_0x86d1('0xd')](_0x86d1('0xe'),_0x3934ea,_0x44a1f9[_0x86d1('0xd')]['message']);return _0x602af2(_0x44a1f9[_0x86d1('0xd')]['message']);}logger['error'](_0x86d1('0xe'),_0x3934ea,_0x44a1f9[_0x86d1('0xd')]['message']);return _0x2f834f(_0x44a1f9[_0x86d1('0xd')][_0x86d1('0xf')]);}else{logger[_0x86d1('0x8')](_0x86d1('0xe'),_0x3934ea,_0x86d1('0x9'));_0x2f834f(_0x44a1f9['result']['message']);}})['catch'](function(_0x2f4950){logger[_0x86d1('0xd')](_0x86d1('0xe'),_0x3934ea,_0x2f4950);_0x602af2(_0x2f4950);});});}
\ No newline at end of file
index c830b20..74dea88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x926d=['./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x926d,0xf5));var _0xd926=function(_0x2ce0df,_0x4f9bb0){_0x2ce0df=_0x2ce0df-0x0;var _0x243c28=_0x926d[_0x2ce0df];return _0x243c28;};'use strict';var multer=require('multer');var util=require(_0xd926('0x0'));var path=require('path');var timeout=require(_0xd926('0x1'));var express=require(_0xd926('0x2'));var router=express[_0xd926('0x3')]();var auth=require(_0xd926('0x4'));var interaction=require(_0xd926('0x5'));var config=require(_0xd926('0x6'));var controller=require(_0xd926('0x7'));router[_0xd926('0x8')]('/',auth[_0xd926('0x9')](),controller[_0xd926('0xa')]);router['get'](_0xd926('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xd926('0x8')](_0xd926('0xc'),auth[_0xd926('0x9')](),controller[_0xd926('0xd')]);router['post']('/',auth[_0xd926('0x9')](),controller[_0xd926('0xe')]);router[_0xd926('0xf')](_0xd926('0xc'),auth[_0xd926('0x9')](),controller['update']);router[_0xd926('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd926('0x11')]=router;
\ No newline at end of file
+var _0x24bc=['/:id','show','post','put','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1e633e,_0x6f47e1){var _0x4c6d74=function(_0x3a6a2d){while(--_0x3a6a2d){_0x1e633e['push'](_0x1e633e['shift']());}};_0x4c6d74(++_0x6f47e1);}(_0x24bc,0x14b));var _0xc24b=function(_0x2b44b5,_0x5a99b0){_0x2b44b5=_0x2b44b5-0x0;var _0x2acd32=_0x24bc[_0x2b44b5];return _0x2acd32;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc24b('0x0'));var timeout=require(_0xc24b('0x1'));var express=require('express');var router=express[_0xc24b('0x2')]();var auth=require(_0xc24b('0x3'));var interaction=require(_0xc24b('0x4'));var config=require('../../config/environment');var controller=require(_0xc24b('0x5'));router[_0xc24b('0x6')]('/',auth[_0xc24b('0x7')](),controller[_0xc24b('0x8')]);router[_0xc24b('0x6')](_0xc24b('0x9'),auth[_0xc24b('0x7')](),controller[_0xc24b('0xa')]);router['get'](_0xc24b('0xb'),auth[_0xc24b('0x7')](),controller[_0xc24b('0xc')]);router[_0xc24b('0xd')]('/',auth[_0xc24b('0x7')](),controller['create']);router[_0xc24b('0xe')](_0xc24b('0xb'),auth['isAuthenticated'](),controller[_0xc24b('0xf')]);router[_0xc24b('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc24b('0x11')]);module[_0xc24b('0x12')]=router;
\ No newline at end of file
index c7d5cbc..0ea2b47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf8d=['exports','STRING','sequelize'];(function(_0x4c6840,_0x97fe36){var _0x23e354=function(_0x5de5d7){while(--_0x5de5d7){_0x4c6840['push'](_0x4c6840['shift']());}};_0x23e354(++_0x97fe36);}(_0xdf8d,0x1ca));var _0xddf8=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xdf8d[_0x1928c9];return _0x51b5fb;};'use strict';var Sequelize=require(_0xddf8('0x0'));module[_0xddf8('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize['TEXT']('long')},'membername':{'type':Sequelize[_0xddf8('0x2')]},'projectname':{'type':Sequelize[_0xddf8('0x2')]},'queue':{'type':Sequelize[_0xddf8('0x2')]},'uniqueid':{'type':Sequelize[_0xddf8('0x2')]},'calleridname':{'type':Sequelize[_0xddf8('0x2')]},'calleridnum':{'type':Sequelize[_0xddf8('0x2')]},'questionId':{'type':Sequelize[_0xddf8('0x2')]}};
\ No newline at end of file
+var _0x63c6=['sequelize','exports','STRING','long'];(function(_0x2addd0,_0x302a64){var _0x10bd41=function(_0x5caeaf){while(--_0x5caeaf){_0x2addd0['push'](_0x2addd0['shift']());}};_0x10bd41(++_0x302a64);}(_0x63c6,0x1b4));var _0x663c=function(_0x3d6394,_0x466156){_0x3d6394=_0x3d6394-0x0;var _0x45ef60=_0x63c6[_0x3d6394];return _0x45ef60;};'use strict';var Sequelize=require(_0x663c('0x0'));module[_0x663c('0x1')]={'question':{'type':Sequelize[_0x663c('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x663c('0x3'))},'membername':{'type':Sequelize[_0x663c('0x2')]},'projectname':{'type':Sequelize[_0x663c('0x2')]},'queue':{'type':Sequelize[_0x663c('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x663c('0x2')]},'calleridnum':{'type':Sequelize[_0x663c('0x2')]},'questionId':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 74a6d9f..98504c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fa5=['request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','map','keys','filters','intersection','attributes','model','fields','query','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','show','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch'];(function(_0x5ded12,_0x2d2127){var _0x188e86=function(_0x5ac2bf){while(--_0x5ac2bf){_0x5ded12['push'](_0x5ded12['shift']());}};_0x188e86(++_0x2d2127);}(_0x3fa5,0x1a6));var _0x53fa=function(_0x565749,_0x492c54){_0x565749=_0x565749-0x0;var _0x47d891=_0x3fa5[_0x565749];return _0x47d891;};'use strict';var pdf=require(_0x53fa('0x0'));var emlformat=require(_0x53fa('0x1'));var rimraf=require(_0x53fa('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53fa('0x3'));var rp=require(_0x53fa('0x4'));var moment=require('moment');var BPromise=require(_0x53fa('0x5'));var Mustache=require(_0x53fa('0x6'));var util=require(_0x53fa('0x7'));var path=require('path');var sox=require(_0x53fa('0x8'));var csv=require(_0x53fa('0x9'));var ejs=require(_0x53fa('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x53fa('0xb'));var crypto=require(_0x53fa('0xc'));var jsforce=require(_0x53fa('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x53fa('0xe'));var Redis=require(_0x53fa('0xf'));var authService=require(_0x53fa('0x10'));var qs=require(_0x53fa('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x53fa('0x12'));var logger=require(_0x53fa('0x13'))(_0x53fa('0x14'));var utils=require(_0x53fa('0x15'));var config=require(_0x53fa('0x16'));var db=require(_0x53fa('0x17'))['db'];function respondWithStatusCode(_0x3a76b0,_0x4a4da7){_0x4a4da7=_0x4a4da7||0xcc;return function(_0x401edd){if(_0x401edd){return _0x3a76b0[_0x53fa('0x18')](_0x4a4da7);}return _0x3a76b0[_0x53fa('0x19')](_0x4a4da7)['end']();};}function respondWithResult(_0x5afa12,_0xd4934d){_0xd4934d=_0xd4934d||0xc8;return function(_0x25a971){if(_0x25a971){return _0x5afa12[_0x53fa('0x19')](_0xd4934d)[_0x53fa('0x1a')](_0x25a971);}};}function respondWithFilteredResult(_0x6f01f7,_0x447a92){return function(_0x463e20){if(_0x463e20){var _0x3bed1a=_0x463e20['count'],_0x13739d=_0x447a92['offset'],_0xe1dcae=_0x447a92['offset']+_0x447a92['limit'],_0x998fe3;if(_0xe1dcae>=_0x3bed1a){_0xe1dcae=_0x3bed1a;_0x998fe3=0xc8;}else{_0x998fe3=0xce;}_0x6f01f7[_0x53fa('0x19')](_0x998fe3);return _0x6f01f7[_0x53fa('0x1b')](_0x53fa('0x1c'),_0x13739d+'-'+_0xe1dcae+'/'+_0x3bed1a)['json'](_0x463e20);}return null;};}function patchUpdates(_0xab900f){return function(_0x3e4318){try{jsonpatch[_0x53fa('0x1d')](_0x3e4318,_0xab900f,!![]);}catch(_0x31c17f){return BPromise['reject'](_0x31c17f);}return _0x3e4318['save']();};}function saveUpdates(_0x32a816,_0x530e7b){return function(_0x1f02bc){if(_0x1f02bc){return _0x1f02bc[_0x53fa('0x1e')](_0x32a816)[_0x53fa('0x1f')](function(_0x23de16){return _0x23de16;});}return null;};}function removeEntity(_0x308c05,_0x1438f8){return function(_0x178a52){if(_0x178a52){return _0x178a52[_0x53fa('0x20')]()[_0x53fa('0x1f')](function(){_0x308c05[_0x53fa('0x19')](0xcc)[_0x53fa('0x21')]();});}};}function handleEntityNotFound(_0x1ef601,_0x1c3ac4){return function(_0x3a2b60){if(!_0x3a2b60){_0x1ef601['sendStatus'](0x194);}return _0x3a2b60;};}function handleError(_0x53c368,_0x2ccf06){_0x2ccf06=_0x2ccf06||0x1f4;return function(_0x212150){logger[_0x53fa('0x22')](_0x212150[_0x53fa('0x23')]);if(_0x212150['name']){delete _0x212150[_0x53fa('0x24')];}_0x53c368[_0x53fa('0x19')](_0x2ccf06)[_0x53fa('0x25')](_0x212150);};}exports[_0x53fa('0x26')]=function(_0x16343c,_0xa66863){var _0x187d6f={},_0x4afacd={},_0x15babd={'count':0x0,'rows':[]};var _0x3ae083=_['map'](db[_0x53fa('0x27')][_0x53fa('0x28')],function(_0x242513){return{'name':_0x242513['fieldName'],'type':_0x242513['type']['key']};});_0x4afacd['model']=_[_0x53fa('0x29')](_0x3ae083,_0x53fa('0x24'));_0x4afacd['query']=_[_0x53fa('0x2a')](_0x16343c['query']);_0x4afacd[_0x53fa('0x2b')]=_[_0x53fa('0x2c')](_0x4afacd['model'],_0x4afacd['query']);_0x187d6f[_0x53fa('0x2d')]=_[_0x53fa('0x2c')](_0x4afacd[_0x53fa('0x2e')],qs[_0x53fa('0x2f')](_0x16343c[_0x53fa('0x30')][_0x53fa('0x2f')]));_0x187d6f[_0x53fa('0x2d')]=_0x187d6f[_0x53fa('0x2d')][_0x53fa('0x31')]?_0x187d6f[_0x53fa('0x2d')]:_0x4afacd[_0x53fa('0x2e')];if(!_0x16343c[_0x53fa('0x30')][_0x53fa('0x32')](_0x53fa('0x33'))){_0x187d6f[_0x53fa('0x34')]=qs[_0x53fa('0x34')](_0x16343c[_0x53fa('0x30')][_0x53fa('0x34')]);_0x187d6f[_0x53fa('0x35')]=qs[_0x53fa('0x35')](_0x16343c[_0x53fa('0x30')]['offset']);}_0x187d6f[_0x53fa('0x36')]=qs[_0x53fa('0x37')](_0x16343c[_0x53fa('0x30')][_0x53fa('0x37')]);_0x187d6f[_0x53fa('0x38')]=qs[_0x53fa('0x2b')](_[_0x53fa('0x39')](_0x16343c[_0x53fa('0x30')],_0x4afacd[_0x53fa('0x2b')]),_0x3ae083);if(_0x16343c[_0x53fa('0x30')][_0x53fa('0x3a')]){_0x187d6f['where']=_[_0x53fa('0x3b')](_0x187d6f['where'],{'$or':_[_0x53fa('0x29')](_0x3ae083,function(_0x386ed1){if(_0x386ed1['type']!=='VIRTUAL'){var _0x487e66={};_0x487e66[_0x386ed1['name']]={'$like':'%'+_0x16343c[_0x53fa('0x30')][_0x53fa('0x3a')]+'%'};return _0x487e66;}})});}_0x187d6f=_[_0x53fa('0x3b')]({},_0x187d6f,_0x16343c['options']);var _0x32fa50={'where':_0x187d6f[_0x53fa('0x38')]};return db[_0x53fa('0x27')][_0x53fa('0x3c')](_0x32fa50)['then'](function(_0x5a908d){_0x15babd['count']=_0x5a908d;if(_0x16343c['query'][_0x53fa('0x3d')]){_0x187d6f[_0x53fa('0x3e')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x53fa('0x3f')](_0x187d6f);})[_0x53fa('0x1f')](function(_0xa8d848){_0x15babd['rows']=_0xa8d848;return _0x15babd;})[_0x53fa('0x1f')](respondWithFilteredResult(_0xa66863,_0x187d6f))['catch'](handleError(_0xa66863,null));};exports[_0x53fa('0x40')]=function(_0x35176b,_0x784810){var _0x3d2b77={'raw':!![],'where':{'id':_0x35176b['params']['id']}},_0x172a8e={};_0x172a8e[_0x53fa('0x2e')]=_[_0x53fa('0x2a')](db['JscriptyQuestionReport'][_0x53fa('0x28')]);_0x172a8e['query']=_['keys'](_0x35176b[_0x53fa('0x30')]);_0x172a8e[_0x53fa('0x2b')]=_['intersection'](_0x172a8e[_0x53fa('0x2e')],_0x172a8e[_0x53fa('0x30')]);_0x3d2b77[_0x53fa('0x2d')]=_[_0x53fa('0x2c')](_0x172a8e[_0x53fa('0x2e')],qs['fields'](_0x35176b['query']['fields']));_0x3d2b77[_0x53fa('0x2d')]=_0x3d2b77[_0x53fa('0x2d')][_0x53fa('0x31')]?_0x3d2b77['attributes']:_0x172a8e['model'];if(_0x35176b[_0x53fa('0x30')]['includeAll']){_0x3d2b77[_0x53fa('0x3e')]=[{'all':!![]}];}_0x3d2b77=_[_0x53fa('0x3b')]({},_0x3d2b77,_0x35176b['options']);return db['JscriptyQuestionReport'][_0x53fa('0x41')](_0x3d2b77)[_0x53fa('0x1f')](handleEntityNotFound(_0x784810,null))[_0x53fa('0x1f')](respondWithResult(_0x784810,null))[_0x53fa('0x42')](handleError(_0x784810,null));};exports[_0x53fa('0x43')]=function(_0x575716,_0x42f067){return db[_0x53fa('0x27')][_0x53fa('0x43')](_0x575716[_0x53fa('0x44')],{})[_0x53fa('0x1f')](respondWithResult(_0x42f067,0xc9))['catch'](handleError(_0x42f067,null));};exports[_0x53fa('0x1e')]=function(_0x254379,_0x56917a){if(_0x254379['body']['id']){delete _0x254379[_0x53fa('0x44')]['id'];}return db[_0x53fa('0x27')][_0x53fa('0x41')]({'where':{'id':_0x254379[_0x53fa('0x45')]['id']}})[_0x53fa('0x1f')](handleEntityNotFound(_0x56917a,null))[_0x53fa('0x1f')](saveUpdates(_0x254379['body'],null))['then'](respondWithResult(_0x56917a,null))[_0x53fa('0x42')](handleError(_0x56917a,null));};exports[_0x53fa('0x20')]=function(_0x3d0a8c,_0x286c72){return db[_0x53fa('0x27')][_0x53fa('0x41')]({'where':{'id':_0x3d0a8c[_0x53fa('0x45')]['id']}})[_0x53fa('0x1f')](handleEntityNotFound(_0x286c72,null))['then'](removeEntity(_0x286c72,null))[_0x53fa('0x42')](handleError(_0x286c72,null));};exports[_0x53fa('0x46')]=function(_0xe939ee,_0x1ed60c){return db[_0x53fa('0x27')]['describe']()[_0x53fa('0x1f')](respondWithResult(_0x1ed60c,null))['catch'](handleError(_0x1ed60c,null));};
\ No newline at end of file
+var _0x0349=['stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','include','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0x0349,0x6e));var _0x9034=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x0349[_0x342700];return _0x53406f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9034('0x0'));var rimraf=require(_0x9034('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9034('0x2'));var rp=require(_0x9034('0x3'));var moment=require(_0x9034('0x4'));var BPromise=require(_0x9034('0x5'));var Mustache=require(_0x9034('0x6'));var util=require('util');var path=require(_0x9034('0x7'));var sox=require('sox');var csv=require(_0x9034('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9034('0x9'));var squel=require(_0x9034('0xa'));var crypto=require(_0x9034('0xb'));var jsforce=require(_0x9034('0xc'));var deskjs=require(_0x9034('0xd'));var toCsv=require(_0x9034('0x8'));var querystring=require(_0x9034('0xe'));var Papa=require(_0x9034('0xf'));var Redis=require(_0x9034('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9034('0x11'));var hardwareService=require(_0x9034('0x12'));var logger=require(_0x9034('0x13'))('api');var utils=require(_0x9034('0x14'));var config=require(_0x9034('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b7109,_0x297e83){_0x297e83=_0x297e83||0xcc;return function(_0x398892){if(_0x398892){return _0x3b7109[_0x9034('0x16')](_0x297e83);}return _0x3b7109['status'](_0x297e83)[_0x9034('0x17')]();};}function respondWithResult(_0x5c9f77,_0x1a58e8){_0x1a58e8=_0x1a58e8||0xc8;return function(_0x4df19c){if(_0x4df19c){return _0x5c9f77[_0x9034('0x18')](_0x1a58e8)[_0x9034('0x19')](_0x4df19c);}};}function respondWithFilteredResult(_0x1f051a,_0x2983ba){return function(_0x57c6a0){if(_0x57c6a0){var _0x3b634c=_0x57c6a0['count'],_0x1ae595=_0x2983ba[_0x9034('0x1a')],_0x1d042f=_0x2983ba[_0x9034('0x1a')]+_0x2983ba[_0x9034('0x1b')],_0x26aa96;if(_0x1d042f>=_0x3b634c){_0x1d042f=_0x3b634c;_0x26aa96=0xc8;}else{_0x26aa96=0xce;}_0x1f051a[_0x9034('0x18')](_0x26aa96);return _0x1f051a[_0x9034('0x1c')](_0x9034('0x1d'),_0x1ae595+'-'+_0x1d042f+'/'+_0x3b634c)[_0x9034('0x19')](_0x57c6a0);}return null;};}function patchUpdates(_0x38aea7){return function(_0x2ae42c){try{jsonpatch[_0x9034('0x1e')](_0x2ae42c,_0x38aea7,!![]);}catch(_0x5e82f9){return BPromise[_0x9034('0x1f')](_0x5e82f9);}return _0x2ae42c[_0x9034('0x20')]();};}function saveUpdates(_0x50f92a,_0x46be44){return function(_0x566f27){if(_0x566f27){return _0x566f27[_0x9034('0x21')](_0x50f92a)[_0x9034('0x22')](function(_0x58b1dd){return _0x58b1dd;});}return null;};}function removeEntity(_0x4e418d,_0x20a8c8){return function(_0x4185cd){if(_0x4185cd){return _0x4185cd[_0x9034('0x23')]()['then'](function(){_0x4e418d[_0x9034('0x18')](0xcc)[_0x9034('0x17')]();});}};}function handleEntityNotFound(_0x3affc5,_0x23635d){return function(_0x4fc636){if(!_0x4fc636){_0x3affc5[_0x9034('0x16')](0x194);}return _0x4fc636;};}function handleError(_0x4ee0ea,_0x5ebd12){_0x5ebd12=_0x5ebd12||0x1f4;return function(_0x22bded){logger['error'](_0x22bded[_0x9034('0x24')]);if(_0x22bded['name']){delete _0x22bded[_0x9034('0x25')];}_0x4ee0ea['status'](_0x5ebd12)[_0x9034('0x26')](_0x22bded);};}exports['index']=function(_0x416657,_0x29b325){var _0x1a5b74={},_0x5de1d9={},_0x10e14f={'count':0x0,'rows':[]};var _0x457a3d=_[_0x9034('0x27')](db[_0x9034('0x28')][_0x9034('0x29')],function(_0x499ed9){return{'name':_0x499ed9[_0x9034('0x2a')],'type':_0x499ed9[_0x9034('0x2b')][_0x9034('0x2c')]};});_0x5de1d9[_0x9034('0x2d')]=_['map'](_0x457a3d,_0x9034('0x25'));_0x5de1d9[_0x9034('0x2e')]=_[_0x9034('0x2f')](_0x416657[_0x9034('0x2e')]);_0x5de1d9[_0x9034('0x30')]=_[_0x9034('0x31')](_0x5de1d9[_0x9034('0x2d')],_0x5de1d9[_0x9034('0x2e')]);_0x1a5b74[_0x9034('0x32')]=_[_0x9034('0x31')](_0x5de1d9[_0x9034('0x2d')],qs['fields'](_0x416657[_0x9034('0x2e')][_0x9034('0x33')]));_0x1a5b74['attributes']=_0x1a5b74['attributes'][_0x9034('0x34')]?_0x1a5b74[_0x9034('0x32')]:_0x5de1d9[_0x9034('0x2d')];if(!_0x416657['query'][_0x9034('0x35')](_0x9034('0x36'))){_0x1a5b74['limit']=qs['limit'](_0x416657[_0x9034('0x2e')][_0x9034('0x1b')]);_0x1a5b74['offset']=qs['offset'](_0x416657[_0x9034('0x2e')][_0x9034('0x1a')]);}_0x1a5b74[_0x9034('0x37')]=qs[_0x9034('0x38')](_0x416657[_0x9034('0x2e')][_0x9034('0x38')]);_0x1a5b74[_0x9034('0x39')]=qs[_0x9034('0x30')](_['pick'](_0x416657['query'],_0x5de1d9[_0x9034('0x30')]),_0x457a3d);if(_0x416657[_0x9034('0x2e')][_0x9034('0x3a')]){_0x1a5b74[_0x9034('0x39')]=_[_0x9034('0x3b')](_0x1a5b74[_0x9034('0x39')],{'$or':_[_0x9034('0x27')](_0x457a3d,function(_0x597415){if(_0x597415['type']!==_0x9034('0x3c')){var _0x85211={};_0x85211[_0x597415[_0x9034('0x25')]]={'$like':'%'+_0x416657['query'][_0x9034('0x3a')]+'%'};return _0x85211;}})});}_0x1a5b74=_['merge']({},_0x1a5b74,_0x416657[_0x9034('0x3d')]);var _0x4575a8={'where':_0x1a5b74[_0x9034('0x39')]};return db[_0x9034('0x28')][_0x9034('0x3e')](_0x4575a8)[_0x9034('0x22')](function(_0x49f8b9){_0x10e14f['count']=_0x49f8b9;if(_0x416657[_0x9034('0x2e')][_0x9034('0x3f')]){_0x1a5b74['include']=[{'all':!![]}];}return db[_0x9034('0x28')]['findAll'](_0x1a5b74);})[_0x9034('0x22')](function(_0x1fb2dd){_0x10e14f[_0x9034('0x40')]=_0x1fb2dd;return _0x10e14f;})[_0x9034('0x22')](respondWithFilteredResult(_0x29b325,_0x1a5b74))[_0x9034('0x41')](handleError(_0x29b325,null));};exports[_0x9034('0x42')]=function(_0x1a4281,_0x2ac84c){var _0x3a44a1={'raw':!![],'where':{'id':_0x1a4281['params']['id']}},_0x549717={};_0x549717[_0x9034('0x2d')]=_[_0x9034('0x2f')](db[_0x9034('0x28')][_0x9034('0x29')]);_0x549717[_0x9034('0x2e')]=_[_0x9034('0x2f')](_0x1a4281[_0x9034('0x2e')]);_0x549717[_0x9034('0x30')]=_[_0x9034('0x31')](_0x549717[_0x9034('0x2d')],_0x549717[_0x9034('0x2e')]);_0x3a44a1[_0x9034('0x32')]=_[_0x9034('0x31')](_0x549717[_0x9034('0x2d')],qs[_0x9034('0x33')](_0x1a4281[_0x9034('0x2e')]['fields']));_0x3a44a1[_0x9034('0x32')]=_0x3a44a1['attributes'][_0x9034('0x34')]?_0x3a44a1[_0x9034('0x32')]:_0x549717[_0x9034('0x2d')];if(_0x1a4281[_0x9034('0x2e')][_0x9034('0x3f')]){_0x3a44a1[_0x9034('0x43')]=[{'all':!![]}];}_0x3a44a1=_['merge']({},_0x3a44a1,_0x1a4281[_0x9034('0x3d')]);return db[_0x9034('0x28')][_0x9034('0x44')](_0x3a44a1)[_0x9034('0x22')](handleEntityNotFound(_0x2ac84c,null))[_0x9034('0x22')](respondWithResult(_0x2ac84c,null))[_0x9034('0x41')](handleError(_0x2ac84c,null));};exports[_0x9034('0x45')]=function(_0x4b7ad,_0x511631){return db[_0x9034('0x28')][_0x9034('0x45')](_0x4b7ad['body'],{})[_0x9034('0x22')](respondWithResult(_0x511631,0xc9))[_0x9034('0x41')](handleError(_0x511631,null));};exports[_0x9034('0x21')]=function(_0x13c72f,_0x4a090a){if(_0x13c72f[_0x9034('0x46')]['id']){delete _0x13c72f[_0x9034('0x46')]['id'];}return db[_0x9034('0x28')][_0x9034('0x44')]({'where':{'id':_0x13c72f[_0x9034('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a090a,null))[_0x9034('0x22')](saveUpdates(_0x13c72f[_0x9034('0x46')],null))[_0x9034('0x22')](respondWithResult(_0x4a090a,null))[_0x9034('0x41')](handleError(_0x4a090a,null));};exports[_0x9034('0x23')]=function(_0x2f85a1,_0x19d36a){return db[_0x9034('0x28')][_0x9034('0x44')]({'where':{'id':_0x2f85a1[_0x9034('0x47')]['id']}})[_0x9034('0x22')](handleEntityNotFound(_0x19d36a,null))[_0x9034('0x22')](removeEntity(_0x19d36a,null))[_0x9034('0x41')](handleError(_0x19d36a,null));};exports[_0x9034('0x48')]=function(_0xb29670,_0xf32741){return db[_0x9034('0x28')]['describe']()[_0x9034('0x22')](respondWithResult(_0xf32741,null))[_0x9034('0x41')](handleError(_0xf32741,null));};
\ No newline at end of file
index 195063f..11b047e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6bc=['lodash','../../config/logger','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x4e32b4,_0xeb32f8){var _0x398b3e=function(_0x154379){while(--_0x154379){_0x4e32b4['push'](_0x4e32b4['shift']());}};_0x398b3e(++_0xeb32f8);}(_0xb6bc,0x75));var _0xcb6b=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xb6bc[_0x2c0dc0];return _0x4c0990;};'use strict';var _=require(_0xcb6b('0x0'));var util=require('util');var logger=require(_0xcb6b('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb6b('0x2'));var fs=require('fs');var path=require(_0xcb6b('0x3'));var rimraf=require('rimraf');var config=require(_0xcb6b('0x4'));var attributes=require(_0xcb6b('0x5'));module[_0xcb6b('0x6')]=function(_0x5e6e88,_0x1c3fc8){return _0x5e6e88['define'](_0xcb6b('0x7'),attributes,{'tableName':_0xcb6b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1639=['path','define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x1639,0x14e));var _0x9163=function(_0xfee060,_0x184a79){_0xfee060=_0xfee060-0x0;var _0x5daef8=_0x1639[_0xfee060];return _0x5daef8;};'use strict';var _=require(_0x9163('0x0'));var util=require('util');var logger=require(_0x9163('0x1'))(_0x9163('0x2'));var moment=require(_0x9163('0x3'));var BPromise=require(_0x9163('0x4'));var rp=require(_0x9163('0x5'));var fs=require('fs');var path=require(_0x9163('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x3ce8c9,_0x27bd3e){return _0x3ce8c9[_0x9163('0x7')](_0x9163('0x8'),attributes,{'tableName':_0x9163('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0e551d3..76ee742 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad53=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment'];(function(_0x5c4236,_0x238f5b){var _0x1ec5f8=function(_0x3c39bf){while(--_0x3c39bf){_0x5c4236['push'](_0x5c4236['shift']());}};_0x1ec5f8(++_0x238f5b);}(_0xad53,0xf9));var _0x3ad5=function(_0x3ee166,_0x4aa48e){_0x3ee166=_0x3ee166-0x0;var _0x2c50d7=_0xad53[_0x3ee166];return _0x2c50d7;};'use strict';var _=require(_0x3ad5('0x0'));var util=require(_0x3ad5('0x1'));var moment=require(_0x3ad5('0x2'));var BPromise=require('bluebird');var rs=require(_0x3ad5('0x3'));var fs=require('fs');var Redis=require(_0x3ad5('0x4'));var db=require(_0x3ad5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ad5('0x6'))(_0x3ad5('0x7'));var config=require(_0x3ad5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3ad5('0x9')][_0x3ad5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c967f,_0x1648d7,_0x20c7b2){return new BPromise(function(_0x293b32,_0x58f613){return client[_0x3ad5('0xb')](_0x3c967f,_0x20c7b2)[_0x3ad5('0xc')](function(_0x48cc25){logger[_0x3ad5('0xd')](_0x3ad5('0xe'),_0x1648d7,_0x3ad5('0xf'));logger[_0x3ad5('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x1648d7,_0x3ad5('0xf'),JSON['stringify'](_0x48cc25));if(_0x48cc25['error']){if(_0x48cc25[_0x3ad5('0x11')][_0x3ad5('0x12')]===0x1f4){logger[_0x3ad5('0x11')](_0x3ad5('0xe'),_0x1648d7,_0x48cc25[_0x3ad5('0x11')][_0x3ad5('0x13')]);return _0x58f613(_0x48cc25[_0x3ad5('0x11')][_0x3ad5('0x13')]);}logger['error'](_0x3ad5('0xe'),_0x1648d7,_0x48cc25[_0x3ad5('0x11')][_0x3ad5('0x13')]);return _0x293b32(_0x48cc25[_0x3ad5('0x11')][_0x3ad5('0x13')]);}else{logger[_0x3ad5('0xd')](_0x3ad5('0xe'),_0x1648d7,_0x3ad5('0xf'));_0x293b32(_0x48cc25['result'][_0x3ad5('0x13')]);}})[_0x3ad5('0x14')](function(_0x49bcf7){logger[_0x3ad5('0x11')](_0x3ad5('0xe'),_0x1648d7,_0x49bcf7);_0x58f613(_0x49bcf7);});});}
\ No newline at end of file
+var _0xff9d=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0xff9d,0x142));var _0xdff9=function(_0x3dfb90,_0x13a3f7){_0x3dfb90=_0x3dfb90-0x0;var _0x59f5d5=_0xff9d[_0x3dfb90];return _0x59f5d5;};'use strict';var _=require(_0xdff9('0x0'));var util=require(_0xdff9('0x1'));var moment=require('moment');var BPromise=require(_0xdff9('0x2'));var rs=require(_0xdff9('0x3'));var fs=require('fs');var Redis=require(_0xdff9('0x4'));var db=require(_0xdff9('0x5'))['db'];var utils=require(_0xdff9('0x6'));var logger=require(_0xdff9('0x7'))(_0xdff9('0x8'));var config=require(_0xdff9('0x9'));var jayson=require(_0xdff9('0xa'));var client=jayson[_0xdff9('0xb')][_0xdff9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f5f20,_0x55e31a,_0x4555a1){return new BPromise(function(_0x32144e,_0x3c3821){return client[_0xdff9('0xd')](_0x2f5f20,_0x4555a1)[_0xdff9('0xe')](function(_0x12d98c){logger['info'](_0xdff9('0xf'),_0x55e31a,'request\x20sent');logger[_0xdff9('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x55e31a,_0xdff9('0x11'),JSON[_0xdff9('0x12')](_0x12d98c));if(_0x12d98c[_0xdff9('0x13')]){if(_0x12d98c['error'][_0xdff9('0x14')]===0x1f4){logger['error'](_0xdff9('0xf'),_0x55e31a,_0x12d98c[_0xdff9('0x13')][_0xdff9('0x15')]);return _0x3c3821(_0x12d98c[_0xdff9('0x13')][_0xdff9('0x15')]);}logger[_0xdff9('0x13')](_0xdff9('0xf'),_0x55e31a,_0x12d98c['error'][_0xdff9('0x15')]);return _0x32144e(_0x12d98c[_0xdff9('0x13')][_0xdff9('0x15')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x55e31a,_0xdff9('0x11'));_0x32144e(_0x12d98c[_0xdff9('0x16')][_0xdff9('0x15')]);}})['catch'](function(_0x2a62b4){logger['error'](_0xdff9('0xf'),_0x55e31a,_0x2a62b4);_0x3c3821(_0x2a62b4);});});}
\ No newline at end of file
index 869dfcd..8725a96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b75=['/:id','show','/:id/questions','getQuestions','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe'];(function(_0x482393,_0x355061){var _0x4c07ae=function(_0x139328){while(--_0x139328){_0x482393['push'](_0x482393['shift']());}};_0x4c07ae(++_0x355061);}(_0x3b75,0x144));var _0x53b7=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0x3b75[_0x532d78];return _0x5990c4;};'use strict';var multer=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var path=require(_0x53b7('0x2'));var timeout=require(_0x53b7('0x3'));var express=require(_0x53b7('0x4'));var router=express[_0x53b7('0x5')]();var auth=require(_0x53b7('0x6'));var interaction=require(_0x53b7('0x7'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0x53b7('0x8')]('/',auth[_0x53b7('0x9')](),controller[_0x53b7('0xa')]);router[_0x53b7('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x53b7('0xb')]);router[_0x53b7('0x8')](_0x53b7('0xc'),auth[_0x53b7('0x9')](),controller[_0x53b7('0xd')]);router['get'](_0x53b7('0xe'),auth[_0x53b7('0x9')](),controller[_0x53b7('0xf')]);router[_0x53b7('0x10')]('/',auth[_0x53b7('0x9')](),controller[_0x53b7('0x11')]);router['put']('/:id',auth[_0x53b7('0x9')](),controller['update']);router[_0x53b7('0x12')]('/:id',auth[_0x53b7('0x9')](),controller[_0x53b7('0x13')]);module[_0x53b7('0x14')]=router;
\ No newline at end of file
+var _0x7a08=['get','isAuthenticated','index','/describe','describe','/:id','show','getQuestions','post','create','update','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x7a08,0x11e));var _0x87a0=function(_0x21bad5,_0x23a39d){_0x21bad5=_0x21bad5-0x0;var _0x235106=_0x7a08[_0x21bad5];return _0x235106;};'use strict';var multer=require(_0x87a0('0x0'));var util=require(_0x87a0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x87a0('0x2'));var router=express[_0x87a0('0x3')]();var auth=require(_0x87a0('0x4'));var interaction=require(_0x87a0('0x5'));var config=require(_0x87a0('0x6'));var controller=require(_0x87a0('0x7'));router[_0x87a0('0x8')]('/',auth[_0x87a0('0x9')](),controller[_0x87a0('0xa')]);router[_0x87a0('0x8')](_0x87a0('0xb'),auth['isAuthenticated'](),controller[_0x87a0('0xc')]);router[_0x87a0('0x8')](_0x87a0('0xd'),auth[_0x87a0('0x9')](),controller[_0x87a0('0xe')]);router['get']('/:id/questions',auth[_0x87a0('0x9')](),controller[_0x87a0('0xf')]);router[_0x87a0('0x10')]('/',auth[_0x87a0('0x9')](),controller[_0x87a0('0x11')]);router['put'](_0x87a0('0xd'),auth[_0x87a0('0x9')](),controller[_0x87a0('0x12')]);router['delete'](_0x87a0('0xd'),auth[_0x87a0('0x9')](),controller[_0x87a0('0x13')]);module[_0x87a0('0x14')]=router;
\ No newline at end of file
index d3b0d98..8832e45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a8=['STRING','BOOLEAN','moment','exports','DATE','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x540b16,_0x3efaa4){var _0x39d678=function(_0x3adc49){while(--_0x3adc49){_0x540b16['push'](_0x540b16['shift']());}};_0x39d678(++_0x3efaa4);}(_0xa8a8,0x119));var _0x8a8a=function(_0x3d043f,_0x2660dc){_0x3d043f=_0x3d043f-0x0;var _0x2bd3a0=_0xa8a8[_0x3d043f];return _0x2bd3a0;};'use strict';var moment=require(_0x8a8a('0x0'));var Sequelize=require('sequelize');module[_0x8a8a('0x1')]={'starttime':{'type':Sequelize[_0x8a8a('0x2')],'set':function(_0xd595fa){this[_0x8a8a('0x3')](_0x8a8a('0x4'),_0xd595fa);this[_0x8a8a('0x3')]('endtime',moment()[_0x8a8a('0x5')](_0x8a8a('0x6')));}},'endtime':{'type':Sequelize[_0x8a8a('0x2')]},'membername':{'type':Sequelize[_0x8a8a('0x7')]},'projectname':{'type':Sequelize[_0x8a8a('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x8a8a('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbd12=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE','setDataValue'];(function(_0x3b363f,_0x38fd63){var _0x3730e8=function(_0x122f2b){while(--_0x122f2b){_0x3b363f['push'](_0x3b363f['shift']());}};_0x3730e8(++_0x38fd63);}(_0xbd12,0x1c8));var _0x2bd1=function(_0x58f172,_0x320085){_0x58f172=_0x58f172-0x0;var _0xe519b9=_0xbd12[_0x58f172];return _0xe519b9;};'use strict';var moment=require(_0x2bd1('0x0'));var Sequelize=require('sequelize');module[_0x2bd1('0x1')]={'starttime':{'type':Sequelize[_0x2bd1('0x2')],'set':function(_0x3f6aa5){this[_0x2bd1('0x3')](_0x2bd1('0x4'),_0x3f6aa5);this[_0x2bd1('0x3')](_0x2bd1('0x5'),moment()[_0x2bd1('0x6')](_0x2bd1('0x7')));}},'endtime':{'type':Sequelize[_0x2bd1('0x2')]},'membername':{'type':Sequelize[_0x2bd1('0x8')]},'projectname':{'type':Sequelize[_0x2bd1('0x8')]},'queue':{'type':Sequelize[_0x2bd1('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2bd1('0x8')]},'calleridnum':{'type':Sequelize[_0x2bd1('0x8')]},'completed':{'type':Sequelize[_0x2bd1('0x9')],'defaultValue':![]}};
\ No newline at end of file
index 43b82b0..6430e53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac5f=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','reject','then','destroy','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','fields','length','find','catch','create','body','describe','getQuestions','JscriptyQuestionReport','nolimit','order','SessionId','count','findAll','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xac5f,0x1b5));var _0xfac5=function(_0x1708a8,_0x40cb27){_0x1708a8=_0x1708a8-0x0;var _0x7c85e3=_0xac5f[_0x1708a8];return _0x7c85e3;};'use strict';var pdf=require(_0xfac5('0x0'));var emlformat=require(_0xfac5('0x1'));var rimraf=require(_0xfac5('0x2'));var zipdir=require(_0xfac5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfac5('0x4'));var moment=require('moment');var BPromise=require(_0xfac5('0x5'));var Mustache=require('mustache');var util=require(_0xfac5('0x6'));var path=require('path');var sox=require(_0xfac5('0x7'));var csv=require(_0xfac5('0x8'));var ejs=require(_0xfac5('0x9'));var fs=require('fs');var _=require(_0xfac5('0xa'));var squel=require('squel');var crypto=require(_0xfac5('0xb'));var jsforce=require(_0xfac5('0xc'));var deskjs=require(_0xfac5('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfac5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfac5('0xf'));var qs=require(_0xfac5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfac5('0x11'));var logger=require(_0xfac5('0x12'))(_0xfac5('0x13'));var utils=require(_0xfac5('0x14'));var config=require(_0xfac5('0x15'));var db=require(_0xfac5('0x16'))['db'];function respondWithStatusCode(_0x48c5d6,_0x40ab65){_0x40ab65=_0x40ab65||0xcc;return function(_0x265739){if(_0x265739){return _0x48c5d6[_0xfac5('0x17')](_0x40ab65);}return _0x48c5d6[_0xfac5('0x18')](_0x40ab65)[_0xfac5('0x19')]();};}function respondWithResult(_0x28fd0c,_0x25a735){_0x25a735=_0x25a735||0xc8;return function(_0x52f529){if(_0x52f529){return _0x28fd0c[_0xfac5('0x18')](_0x25a735)[_0xfac5('0x1a')](_0x52f529);}};}function respondWithFilteredResult(_0x29183c,_0x4a9433){return function(_0x3d5a37){if(_0x3d5a37){var _0x564589=_0x3d5a37['count'],_0x26c06b=_0x4a9433[_0xfac5('0x1b')],_0x27cfa4=_0x4a9433[_0xfac5('0x1b')]+_0x4a9433['limit'],_0x498f86;if(_0x27cfa4>=_0x564589){_0x27cfa4=_0x564589;_0x498f86=0xc8;}else{_0x498f86=0xce;}_0x29183c[_0xfac5('0x18')](_0x498f86);return _0x29183c[_0xfac5('0x1c')](_0xfac5('0x1d'),_0x26c06b+'-'+_0x27cfa4+'/'+_0x564589)['json'](_0x3d5a37);}return null;};}function patchUpdates(_0x36d547){return function(_0x55a217){try{jsonpatch['apply'](_0x55a217,_0x36d547,!![]);}catch(_0x57abca){return BPromise[_0xfac5('0x1e')](_0x57abca);}return _0x55a217['save']();};}function saveUpdates(_0x28d1a2,_0x44e3ee){return function(_0xcd3f87){if(_0xcd3f87){return _0xcd3f87['update'](_0x28d1a2)[_0xfac5('0x1f')](function(_0xbc4fa8){return _0xbc4fa8;});}return null;};}function removeEntity(_0x338c45,_0x1b9216){return function(_0x245a1f){if(_0x245a1f){return _0x245a1f[_0xfac5('0x20')]()[_0xfac5('0x1f')](function(){_0x338c45[_0xfac5('0x18')](0xcc)[_0xfac5('0x19')]();});}};}function handleEntityNotFound(_0x1bfe44,_0x51808b){return function(_0x4ed731){if(!_0x4ed731){_0x1bfe44['sendStatus'](0x194);}return _0x4ed731;};}function handleError(_0x35126d,_0x2235f6){_0x2235f6=_0x2235f6||0x1f4;return function(_0x129ab3){logger[_0xfac5('0x21')](_0x129ab3['stack']);if(_0x129ab3['name']){delete _0x129ab3[_0xfac5('0x22')];}_0x35126d[_0xfac5('0x18')](_0x2235f6)[_0xfac5('0x23')](_0x129ab3);};}exports[_0xfac5('0x24')]=function(_0x310c1a,_0x31160a){var _0x43e062={},_0x5b4f9b={},_0x5ec16a={'count':0x0,'rows':[]};var _0x1ddc91=_[_0xfac5('0x25')](db[_0xfac5('0x26')][_0xfac5('0x27')],function(_0x366f11){return{'name':_0x366f11[_0xfac5('0x28')],'type':_0x366f11[_0xfac5('0x29')][_0xfac5('0x2a')]};});_0x5b4f9b[_0xfac5('0x2b')]=_[_0xfac5('0x25')](_0x1ddc91,'name');_0x5b4f9b[_0xfac5('0x2c')]=_[_0xfac5('0x2d')](_0x310c1a[_0xfac5('0x2c')]);_0x5b4f9b[_0xfac5('0x2e')]=_['intersection'](_0x5b4f9b[_0xfac5('0x2b')],_0x5b4f9b[_0xfac5('0x2c')]);_0x43e062['attributes']=_[_0xfac5('0x2f')](_0x5b4f9b[_0xfac5('0x2b')],qs['fields'](_0x310c1a[_0xfac5('0x2c')]['fields']));_0x43e062[_0xfac5('0x30')]=_0x43e062[_0xfac5('0x30')]['length']?_0x43e062[_0xfac5('0x30')]:_0x5b4f9b[_0xfac5('0x2b')];if(!_0x310c1a[_0xfac5('0x2c')][_0xfac5('0x31')]('nolimit')){_0x43e062['limit']=qs[_0xfac5('0x32')](_0x310c1a[_0xfac5('0x2c')][_0xfac5('0x32')]);_0x43e062[_0xfac5('0x1b')]=qs['offset'](_0x310c1a['query'][_0xfac5('0x1b')]);}_0x43e062['order']=qs[_0xfac5('0x33')](_0x310c1a[_0xfac5('0x2c')][_0xfac5('0x33')]);_0x43e062[_0xfac5('0x34')]=qs[_0xfac5('0x2e')](_[_0xfac5('0x35')](_0x310c1a[_0xfac5('0x2c')],_0x5b4f9b[_0xfac5('0x2e')]),_0x1ddc91);if(_0x310c1a[_0xfac5('0x2c')][_0xfac5('0x36')]){_0x43e062[_0xfac5('0x34')]=_['merge'](_0x43e062['where'],{'$or':_[_0xfac5('0x25')](_0x1ddc91,function(_0x1cb94c){if(_0x1cb94c[_0xfac5('0x29')]!==_0xfac5('0x37')){var _0x27fc5b={};_0x27fc5b[_0x1cb94c['name']]={'$like':'%'+_0x310c1a[_0xfac5('0x2c')]['filter']+'%'};return _0x27fc5b;}})});}_0x43e062=_[_0xfac5('0x38')]({},_0x43e062,_0x310c1a[_0xfac5('0x39')]);var _0x2515ff={'where':_0x43e062['where']};return db[_0xfac5('0x26')]['count'](_0x2515ff)[_0xfac5('0x1f')](function(_0x5e5ed8){_0x5ec16a['count']=_0x5e5ed8;if(_0x310c1a[_0xfac5('0x2c')][_0xfac5('0x3a')]){_0x43e062[_0xfac5('0x3b')]=[{'all':!![]}];}return db[_0xfac5('0x26')]['findAll'](_0x43e062);})['then'](function(_0xf56207){_0x5ec16a[_0xfac5('0x3c')]=_0xf56207;return _0x5ec16a;})[_0xfac5('0x1f')](respondWithFilteredResult(_0x31160a,_0x43e062))['catch'](handleError(_0x31160a,null));};exports['show']=function(_0x4253b7,_0x6912be){var _0x17004f={'raw':!![],'where':{'id':_0x4253b7[_0xfac5('0x3d')]['id']}},_0x54e4e9={};_0x54e4e9[_0xfac5('0x2b')]=_[_0xfac5('0x2d')](db[_0xfac5('0x26')]['rawAttributes']);_0x54e4e9[_0xfac5('0x2c')]=_['keys'](_0x4253b7[_0xfac5('0x2c')]);_0x54e4e9[_0xfac5('0x2e')]=_[_0xfac5('0x2f')](_0x54e4e9[_0xfac5('0x2b')],_0x54e4e9[_0xfac5('0x2c')]);_0x17004f[_0xfac5('0x30')]=_['intersection'](_0x54e4e9['model'],qs['fields'](_0x4253b7[_0xfac5('0x2c')][_0xfac5('0x3e')]));_0x17004f[_0xfac5('0x30')]=_0x17004f['attributes'][_0xfac5('0x3f')]?_0x17004f['attributes']:_0x54e4e9['model'];if(_0x4253b7['query']['includeAll']){_0x17004f[_0xfac5('0x3b')]=[{'all':!![]}];}_0x17004f=_[_0xfac5('0x38')]({},_0x17004f,_0x4253b7[_0xfac5('0x39')]);return db[_0xfac5('0x26')][_0xfac5('0x40')](_0x17004f)['then'](handleEntityNotFound(_0x6912be,null))[_0xfac5('0x1f')](respondWithResult(_0x6912be,null))[_0xfac5('0x41')](handleError(_0x6912be,null));};exports[_0xfac5('0x42')]=function(_0x1f7782,_0x4ee244){return db[_0xfac5('0x26')][_0xfac5('0x42')](_0x1f7782['body'],{})['then'](respondWithResult(_0x4ee244,0xc9))[_0xfac5('0x41')](handleError(_0x4ee244,null));};exports['update']=function(_0x493938,_0x45b2fe){if(_0x493938['body']['id']){delete _0x493938[_0xfac5('0x43')]['id'];}return db['JscriptySessionReport'][_0xfac5('0x40')]({'where':{'id':_0x493938[_0xfac5('0x3d')]['id']}})[_0xfac5('0x1f')](handleEntityNotFound(_0x45b2fe,null))['then'](saveUpdates(_0x493938[_0xfac5('0x43')],null))[_0xfac5('0x1f')](respondWithResult(_0x45b2fe,null))[_0xfac5('0x41')](handleError(_0x45b2fe,null));};exports[_0xfac5('0x20')]=function(_0x520489,_0xe0bddb){return db[_0xfac5('0x26')]['find']({'where':{'id':_0x520489['params']['id']}})[_0xfac5('0x1f')](handleEntityNotFound(_0xe0bddb,null))[_0xfac5('0x1f')](removeEntity(_0xe0bddb,null))['catch'](handleError(_0xe0bddb,null));};exports[_0xfac5('0x44')]=function(_0x5d5210,_0x2f794c){return db['JscriptySessionReport'][_0xfac5('0x44')]()[_0xfac5('0x1f')](respondWithResult(_0x2f794c,null))[_0xfac5('0x41')](handleError(_0x2f794c,null));};exports[_0xfac5('0x45')]=function(_0x38c29a,_0x592c0b,_0x357da4){var _0x212a76={'raw':!![],'where':{}};var _0x397c11={};var _0xd275b0={'count':0x0,'rows':[]};return db[_0xfac5('0x26')]['findOne']({'where':{'id':_0x38c29a[_0xfac5('0x3d')]['id']}})[_0xfac5('0x1f')](handleEntityNotFound(_0x592c0b,null))['then'](function(_0x4ccc7a){if(_0x4ccc7a){_0x397c11[_0xfac5('0x2b')]=_[_0xfac5('0x2d')](db[_0xfac5('0x46')][_0xfac5('0x27')]);_0x397c11[_0xfac5('0x2c')]=_[_0xfac5('0x2d')](_0x38c29a[_0xfac5('0x2c')]);_0x397c11[_0xfac5('0x2e')]=_[_0xfac5('0x2f')](_0x397c11[_0xfac5('0x2b')],_0x397c11[_0xfac5('0x2c')]);_0x212a76[_0xfac5('0x30')]=_[_0xfac5('0x2f')](_0x397c11[_0xfac5('0x2b')],qs['fields'](_0x38c29a[_0xfac5('0x2c')]['fields']));_0x212a76[_0xfac5('0x30')]=_0x212a76[_0xfac5('0x30')][_0xfac5('0x3f')]?_0x212a76['attributes']:_0x397c11[_0xfac5('0x2b')];if(!_0x38c29a[_0xfac5('0x2c')][_0xfac5('0x31')](_0xfac5('0x47'))){_0x212a76[_0xfac5('0x32')]=qs[_0xfac5('0x32')](_0x38c29a[_0xfac5('0x2c')][_0xfac5('0x32')]);_0x212a76[_0xfac5('0x1b')]=qs[_0xfac5('0x1b')](_0x38c29a['query']['offset']);}_0x212a76[_0xfac5('0x48')]=qs[_0xfac5('0x33')](_0x38c29a[_0xfac5('0x2c')]['sort']);_0x212a76[_0xfac5('0x34')]=qs['filters'](_[_0xfac5('0x35')](_0x38c29a[_0xfac5('0x2c')],_0x397c11[_0xfac5('0x2e')]));_0x212a76['where'][_0xfac5('0x49')]=_0x4ccc7a['id'];if(_0x38c29a[_0xfac5('0x2c')][_0xfac5('0x36')]){_0x212a76['where']=_[_0xfac5('0x38')](_0x212a76[_0xfac5('0x34')],{'$or':_['map'](_0x212a76[_0xfac5('0x30')],function(_0x3bbe4c){var _0x1a468b={};_0x1a468b[_0x3bbe4c]={'$like':'%'+_0x38c29a[_0xfac5('0x2c')][_0xfac5('0x36')]+'%'};return _0x1a468b;})});}_0x212a76=_[_0xfac5('0x38')]({},_0x212a76,_0x38c29a[_0xfac5('0x39')]);return db['JscriptyQuestionReport'][_0xfac5('0x4a')]({'where':_0x212a76[_0xfac5('0x34')]})[_0xfac5('0x1f')](function(_0x36b23e){_0xd275b0['count']=_0x36b23e;if(_0x38c29a[_0xfac5('0x2c')]['includeAll']){_0x212a76[_0xfac5('0x3b')]=[{'all':!![]}];}return db[_0xfac5('0x46')][_0xfac5('0x4b')](_0x212a76);})[_0xfac5('0x1f')](function(_0x1d8035){_0xd275b0['rows']=_0x1d8035;return _0xd275b0;});}})[_0xfac5('0x1f')](respondWithFilteredResult(_0x592c0b,_0x212a76))['catch'](handleError(_0x592c0b,null));};
\ No newline at end of file
+var _0xbff9=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','length','pick','SessionId','filter','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x93fa43,_0x4a0675){var _0x2233af=function(_0x444918){while(--_0x444918){_0x93fa43['push'](_0x93fa43['shift']());}};_0x2233af(++_0x4a0675);}(_0xbff9,0x96));var _0x9bff=function(_0x29c65b,_0x84ecb0){_0x29c65b=_0x29c65b-0x0;var _0x5689e9=_0xbff9[_0x29c65b];return _0x5689e9;};'use strict';var pdf=require(_0x9bff('0x0'));var emlformat=require(_0x9bff('0x1'));var rimraf=require(_0x9bff('0x2'));var zipdir=require(_0x9bff('0x3'));var jsonpatch=require(_0x9bff('0x4'));var rp=require(_0x9bff('0x5'));var moment=require(_0x9bff('0x6'));var BPromise=require(_0x9bff('0x7'));var Mustache=require(_0x9bff('0x8'));var util=require(_0x9bff('0x9'));var path=require(_0x9bff('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9bff('0xb'));var fs=require('fs');var _=require(_0x9bff('0xc'));var squel=require(_0x9bff('0xd'));var crypto=require(_0x9bff('0xe'));var jsforce=require(_0x9bff('0xf'));var deskjs=require(_0x9bff('0x10'));var toCsv=require(_0x9bff('0x11'));var querystring=require(_0x9bff('0x12'));var Papa=require(_0x9bff('0x13'));var Redis=require(_0x9bff('0x14'));var authService=require(_0x9bff('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x9bff('0x16'));var hardwareService=require(_0x9bff('0x17'));var logger=require(_0x9bff('0x18'))('api');var utils=require(_0x9bff('0x19'));var config=require(_0x9bff('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14525a,_0x4d09c6){_0x4d09c6=_0x4d09c6||0xcc;return function(_0x544a43){if(_0x544a43){return _0x14525a[_0x9bff('0x1b')](_0x4d09c6);}return _0x14525a[_0x9bff('0x1c')](_0x4d09c6)[_0x9bff('0x1d')]();};}function respondWithResult(_0x1b794e,_0x4267f1){_0x4267f1=_0x4267f1||0xc8;return function(_0x6f83e2){if(_0x6f83e2){return _0x1b794e[_0x9bff('0x1c')](_0x4267f1)['json'](_0x6f83e2);}};}function respondWithFilteredResult(_0x3b03e8,_0xdfc01){return function(_0x16a9f9){if(_0x16a9f9){var _0x3bd97f=_0x16a9f9[_0x9bff('0x1e')],_0x759878=_0xdfc01[_0x9bff('0x1f')],_0x58cacb=_0xdfc01[_0x9bff('0x1f')]+_0xdfc01['limit'],_0x470048;if(_0x58cacb>=_0x3bd97f){_0x58cacb=_0x3bd97f;_0x470048=0xc8;}else{_0x470048=0xce;}_0x3b03e8[_0x9bff('0x1c')](_0x470048);return _0x3b03e8[_0x9bff('0x20')](_0x9bff('0x21'),_0x759878+'-'+_0x58cacb+'/'+_0x3bd97f)[_0x9bff('0x22')](_0x16a9f9);}return null;};}function patchUpdates(_0x5cfbd8){return function(_0x44564e){try{jsonpatch[_0x9bff('0x23')](_0x44564e,_0x5cfbd8,!![]);}catch(_0x2d2a70){return BPromise['reject'](_0x2d2a70);}return _0x44564e[_0x9bff('0x24')]();};}function saveUpdates(_0x1a7ae3,_0x101a32){return function(_0xf9eecd){if(_0xf9eecd){return _0xf9eecd[_0x9bff('0x25')](_0x1a7ae3)['then'](function(_0x4b189a){return _0x4b189a;});}return null;};}function removeEntity(_0x2c4fe2,_0x5ccc46){return function(_0x2a642e){if(_0x2a642e){return _0x2a642e['destroy']()[_0x9bff('0x26')](function(){_0x2c4fe2[_0x9bff('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x583762,_0x52b998){return function(_0x291572){if(!_0x291572){_0x583762[_0x9bff('0x1b')](0x194);}return _0x291572;};}function handleError(_0x3a9575,_0x1f96e0){_0x1f96e0=_0x1f96e0||0x1f4;return function(_0x5da5b1){logger[_0x9bff('0x27')](_0x5da5b1[_0x9bff('0x28')]);if(_0x5da5b1['name']){delete _0x5da5b1[_0x9bff('0x29')];}_0x3a9575['status'](_0x1f96e0)[_0x9bff('0x2a')](_0x5da5b1);};}exports[_0x9bff('0x2b')]=function(_0x55a93b,_0x1b099d){var _0x4f286f={},_0x21a1cf={},_0x39bf10={'count':0x0,'rows':[]};var _0x3941cd=_[_0x9bff('0x2c')](db[_0x9bff('0x2d')][_0x9bff('0x2e')],function(_0x1e9bab){return{'name':_0x1e9bab[_0x9bff('0x2f')],'type':_0x1e9bab[_0x9bff('0x30')][_0x9bff('0x31')]};});_0x21a1cf['model']=_[_0x9bff('0x2c')](_0x3941cd,_0x9bff('0x29'));_0x21a1cf['query']=_[_0x9bff('0x32')](_0x55a93b[_0x9bff('0x33')]);_0x21a1cf[_0x9bff('0x34')]=_[_0x9bff('0x35')](_0x21a1cf[_0x9bff('0x36')],_0x21a1cf['query']);_0x4f286f[_0x9bff('0x37')]=_[_0x9bff('0x35')](_0x21a1cf[_0x9bff('0x36')],qs[_0x9bff('0x38')](_0x55a93b['query'][_0x9bff('0x38')]));_0x4f286f[_0x9bff('0x37')]=_0x4f286f['attributes']['length']?_0x4f286f['attributes']:_0x21a1cf[_0x9bff('0x36')];if(!_0x55a93b[_0x9bff('0x33')][_0x9bff('0x39')](_0x9bff('0x3a'))){_0x4f286f[_0x9bff('0x3b')]=qs[_0x9bff('0x3b')](_0x55a93b[_0x9bff('0x33')][_0x9bff('0x3b')]);_0x4f286f[_0x9bff('0x1f')]=qs['offset'](_0x55a93b[_0x9bff('0x33')]['offset']);}_0x4f286f[_0x9bff('0x3c')]=qs[_0x9bff('0x3d')](_0x55a93b[_0x9bff('0x33')][_0x9bff('0x3d')]);_0x4f286f[_0x9bff('0x3e')]=qs[_0x9bff('0x34')](_['pick'](_0x55a93b[_0x9bff('0x33')],_0x21a1cf[_0x9bff('0x34')]),_0x3941cd);if(_0x55a93b[_0x9bff('0x33')]['filter']){_0x4f286f[_0x9bff('0x3e')]=_['merge'](_0x4f286f[_0x9bff('0x3e')],{'$or':_[_0x9bff('0x2c')](_0x3941cd,function(_0x59e912){if(_0x59e912[_0x9bff('0x30')]!==_0x9bff('0x3f')){var _0x31a2d0={};_0x31a2d0[_0x59e912[_0x9bff('0x29')]]={'$like':'%'+_0x55a93b[_0x9bff('0x33')]['filter']+'%'};return _0x31a2d0;}})});}_0x4f286f=_[_0x9bff('0x40')]({},_0x4f286f,_0x55a93b[_0x9bff('0x41')]);var _0x17da8c={'where':_0x4f286f[_0x9bff('0x3e')]};return db[_0x9bff('0x2d')][_0x9bff('0x1e')](_0x17da8c)['then'](function(_0x17d534){_0x39bf10['count']=_0x17d534;if(_0x55a93b[_0x9bff('0x33')][_0x9bff('0x42')]){_0x4f286f[_0x9bff('0x43')]=[{'all':!![]}];}return db[_0x9bff('0x2d')][_0x9bff('0x44')](_0x4f286f);})[_0x9bff('0x26')](function(_0x2fe6df){_0x39bf10[_0x9bff('0x45')]=_0x2fe6df;return _0x39bf10;})[_0x9bff('0x26')](respondWithFilteredResult(_0x1b099d,_0x4f286f))[_0x9bff('0x46')](handleError(_0x1b099d,null));};exports[_0x9bff('0x47')]=function(_0x59c47d,_0x29af63){var _0x1120fe={'raw':!![],'where':{'id':_0x59c47d[_0x9bff('0x48')]['id']}},_0x4a99c8={};_0x4a99c8[_0x9bff('0x36')]=_[_0x9bff('0x32')](db[_0x9bff('0x2d')][_0x9bff('0x2e')]);_0x4a99c8[_0x9bff('0x33')]=_[_0x9bff('0x32')](_0x59c47d[_0x9bff('0x33')]);_0x4a99c8[_0x9bff('0x34')]=_['intersection'](_0x4a99c8[_0x9bff('0x36')],_0x4a99c8['query']);_0x1120fe[_0x9bff('0x37')]=_['intersection'](_0x4a99c8['model'],qs['fields'](_0x59c47d['query']['fields']));_0x1120fe[_0x9bff('0x37')]=_0x1120fe[_0x9bff('0x37')]['length']?_0x1120fe[_0x9bff('0x37')]:_0x4a99c8['model'];if(_0x59c47d[_0x9bff('0x33')]['includeAll']){_0x1120fe['include']=[{'all':!![]}];}_0x1120fe=_[_0x9bff('0x40')]({},_0x1120fe,_0x59c47d[_0x9bff('0x41')]);return db['JscriptySessionReport'][_0x9bff('0x49')](_0x1120fe)[_0x9bff('0x26')](handleEntityNotFound(_0x29af63,null))[_0x9bff('0x26')](respondWithResult(_0x29af63,null))[_0x9bff('0x46')](handleError(_0x29af63,null));};exports['create']=function(_0x2877bc,_0x373a37){return db['JscriptySessionReport'][_0x9bff('0x4a')](_0x2877bc['body'],{})[_0x9bff('0x26')](respondWithResult(_0x373a37,0xc9))[_0x9bff('0x46')](handleError(_0x373a37,null));};exports[_0x9bff('0x25')]=function(_0x3a7334,_0x7033a){if(_0x3a7334['body']['id']){delete _0x3a7334[_0x9bff('0x4b')]['id'];}return db[_0x9bff('0x2d')][_0x9bff('0x49')]({'where':{'id':_0x3a7334['params']['id']}})[_0x9bff('0x26')](handleEntityNotFound(_0x7033a,null))[_0x9bff('0x26')](saveUpdates(_0x3a7334[_0x9bff('0x4b')],null))[_0x9bff('0x26')](respondWithResult(_0x7033a,null))[_0x9bff('0x46')](handleError(_0x7033a,null));};exports[_0x9bff('0x4c')]=function(_0x4c4fec,_0x4faab8){return db[_0x9bff('0x2d')][_0x9bff('0x49')]({'where':{'id':_0x4c4fec[_0x9bff('0x48')]['id']}})[_0x9bff('0x26')](handleEntityNotFound(_0x4faab8,null))[_0x9bff('0x26')](removeEntity(_0x4faab8,null))[_0x9bff('0x46')](handleError(_0x4faab8,null));};exports['describe']=function(_0x160e20,_0x508f1e){return db[_0x9bff('0x2d')][_0x9bff('0x4d')]()['then'](respondWithResult(_0x508f1e,null))[_0x9bff('0x46')](handleError(_0x508f1e,null));};exports[_0x9bff('0x4e')]=function(_0x48d123,_0x5e4827,_0x244389){var _0xd03244={'raw':!![],'where':{}};var _0x39dfa4={};var _0x1f9c4b={'count':0x0,'rows':[]};return db[_0x9bff('0x2d')][_0x9bff('0x4f')]({'where':{'id':_0x48d123['params']['id']}})[_0x9bff('0x26')](handleEntityNotFound(_0x5e4827,null))[_0x9bff('0x26')](function(_0x1231f9){if(_0x1231f9){_0x39dfa4['model']=_[_0x9bff('0x32')](db[_0x9bff('0x50')]['rawAttributes']);_0x39dfa4[_0x9bff('0x33')]=_[_0x9bff('0x32')](_0x48d123[_0x9bff('0x33')]);_0x39dfa4[_0x9bff('0x34')]=_['intersection'](_0x39dfa4[_0x9bff('0x36')],_0x39dfa4[_0x9bff('0x33')]);_0xd03244[_0x9bff('0x37')]=_[_0x9bff('0x35')](_0x39dfa4[_0x9bff('0x36')],qs[_0x9bff('0x38')](_0x48d123[_0x9bff('0x33')][_0x9bff('0x38')]));_0xd03244[_0x9bff('0x37')]=_0xd03244[_0x9bff('0x37')][_0x9bff('0x51')]?_0xd03244[_0x9bff('0x37')]:_0x39dfa4[_0x9bff('0x36')];if(!_0x48d123[_0x9bff('0x33')]['hasOwnProperty'](_0x9bff('0x3a'))){_0xd03244[_0x9bff('0x3b')]=qs['limit'](_0x48d123[_0x9bff('0x33')][_0x9bff('0x3b')]);_0xd03244['offset']=qs[_0x9bff('0x1f')](_0x48d123[_0x9bff('0x33')]['offset']);}_0xd03244[_0x9bff('0x3c')]=qs[_0x9bff('0x3d')](_0x48d123['query']['sort']);_0xd03244[_0x9bff('0x3e')]=qs[_0x9bff('0x34')](_[_0x9bff('0x52')](_0x48d123['query'],_0x39dfa4[_0x9bff('0x34')]));_0xd03244['where'][_0x9bff('0x53')]=_0x1231f9['id'];if(_0x48d123[_0x9bff('0x33')][_0x9bff('0x54')]){_0xd03244[_0x9bff('0x3e')]=_[_0x9bff('0x40')](_0xd03244[_0x9bff('0x3e')],{'$or':_['map'](_0xd03244['attributes'],function(_0x36543e){var _0x58a207={};_0x58a207[_0x36543e]={'$like':'%'+_0x48d123['query']['filter']+'%'};return _0x58a207;})});}_0xd03244=_['merge']({},_0xd03244,_0x48d123['options']);return db['JscriptyQuestionReport']['count']({'where':_0xd03244['where']})['then'](function(_0x1fe8a1){_0x1f9c4b[_0x9bff('0x1e')]=_0x1fe8a1;if(_0x48d123[_0x9bff('0x33')][_0x9bff('0x42')]){_0xd03244['include']=[{'all':!![]}];}return db[_0x9bff('0x50')][_0x9bff('0x44')](_0xd03244);})[_0x9bff('0x26')](function(_0x3db4d3){_0x1f9c4b[_0x9bff('0x45')]=_0x3db4d3;return _0x1f9c4b;});}})['then'](respondWithFilteredResult(_0x5e4827,_0xd03244))['catch'](handleError(_0x5e4827,null));};
\ No newline at end of file
index 35eb372..9ce037a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd2e=['./jscriptySessionReport.attributes','report_jscripty_sessions','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1d77dd,_0x3e3c63){var _0x34e055=function(_0x5e43c4){while(--_0x5e43c4){_0x1d77dd['push'](_0x1d77dd['shift']());}};_0x34e055(++_0x3e3c63);}(_0xfd2e,0x6e));var _0xefd2=function(_0xa65f54,_0x3608fc){_0xa65f54=_0xa65f54-0x0;var _0x5c5df5=_0xfd2e[_0xa65f54];return _0x5c5df5;};'use strict';var _=require(_0xefd2('0x0'));var util=require('util');var logger=require(_0xefd2('0x1'))('api');var moment=require(_0xefd2('0x2'));var BPromise=require('bluebird');var rp=require(_0xefd2('0x3'));var fs=require('fs');var path=require(_0xefd2('0x4'));var rimraf=require(_0xefd2('0x5'));var config=require(_0xefd2('0x6'));var attributes=require(_0xefd2('0x7'));module['exports']=function(_0x5124c6,_0x40e76c){return _0x5124c6['define']('JscriptySessionReport',attributes,{'tableName':_0xefd2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2da6=['moment','bluebird','request-promise','path','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api'];(function(_0x36203b,_0x276a0b){var _0x398976=function(_0x4a6d6e){while(--_0x4a6d6e){_0x36203b['push'](_0x36203b['shift']());}};_0x398976(++_0x276a0b);}(_0x2da6,0x1dd));var _0x62da=function(_0x467fa3,_0x2fde69){_0x467fa3=_0x467fa3-0x0;var _0x563559=_0x2da6[_0x467fa3];return _0x563559;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var logger=require(_0x62da('0x2'))(_0x62da('0x3'));var moment=require(_0x62da('0x4'));var BPromise=require(_0x62da('0x5'));var rp=require(_0x62da('0x6'));var fs=require('fs');var path=require(_0x62da('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62da('0x8'));module[_0x62da('0x9')]=function(_0x3a59f8,_0x30437f){return _0x3a59f8[_0x62da('0xa')](_0x62da('0xb'),attributes,{'tableName':_0x62da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1ad9f7c..78080d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaff=['error','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5b6f5d,_0xa29a1f){var _0x22d63a=function(_0x2cceb9){while(--_0x2cceb9){_0x5b6f5d['push'](_0x5b6f5d['shift']());}};_0x22d63a(++_0xa29a1f);}(_0xaaff,0xad));var _0xfaaf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaaff[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xfaaf('0x0'));var moment=require(_0xfaaf('0x1'));var BPromise=require(_0xfaaf('0x2'));var rs=require(_0xfaaf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfaaf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfaaf('0x5'));var config=require(_0xfaaf('0x6'));var jayson=require(_0xfaaf('0x7'));var client=jayson[_0xfaaf('0x8')][_0xfaaf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x392c8c,_0x20bff4,_0x1fc27a){return new BPromise(function(_0x34e625,_0x357c64){return client[_0xfaaf('0xa')](_0x392c8c,_0x1fc27a)[_0xfaaf('0xb')](function(_0x3df5d5){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x20bff4,_0xfaaf('0xc'));logger[_0xfaaf('0xd')](_0xfaaf('0xe'),_0x20bff4,_0xfaaf('0xc'),JSON[_0xfaaf('0xf')](_0x3df5d5));if(_0x3df5d5[_0xfaaf('0x10')]){if(_0x3df5d5[_0xfaaf('0x10')]['code']===0x1f4){logger['error'](_0xfaaf('0x11'),_0x20bff4,_0x3df5d5[_0xfaaf('0x10')][_0xfaaf('0x12')]);return _0x357c64(_0x3df5d5[_0xfaaf('0x10')]['message']);}logger[_0xfaaf('0x10')](_0xfaaf('0x11'),_0x20bff4,_0x3df5d5[_0xfaaf('0x10')][_0xfaaf('0x12')]);return _0x34e625(_0x3df5d5[_0xfaaf('0x10')][_0xfaaf('0x12')]);}else{logger['info'](_0xfaaf('0x11'),_0x20bff4,_0xfaaf('0xc'));_0x34e625(_0x3df5d5[_0xfaaf('0x13')][_0xfaaf('0x12')]);}})[_0xfaaf('0x14')](function(_0x5566ea){logger[_0xfaaf('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x20bff4,_0x5566ea);_0x357c64(_0x5566ea);});});}
\ No newline at end of file
+var _0xa759=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x57a068,_0x2557ac){var _0x5542ff=function(_0x2cd3dc){while(--_0x2cd3dc){_0x57a068['push'](_0x57a068['shift']());}};_0x5542ff(++_0x2557ac);}(_0xa759,0x1dd));var _0x9a75=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0xa759[_0x2675da];return _0x5e6153;};'use strict';var _=require(_0x9a75('0x0'));var util=require(_0x9a75('0x1'));var moment=require(_0x9a75('0x2'));var BPromise=require(_0x9a75('0x3'));var rs=require(_0x9a75('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9a75('0x5'));var logger=require(_0x9a75('0x6'))(_0x9a75('0x7'));var config=require(_0x9a75('0x8'));var jayson=require(_0x9a75('0x9'));var client=jayson[_0x9a75('0xa')][_0x9a75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3de1d3,_0x5609cb,_0x2878df){return new BPromise(function(_0x48a4ad,_0x4b0ce5){return client[_0x9a75('0xc')](_0x3de1d3,_0x2878df)[_0x9a75('0xd')](function(_0x1e774a){logger[_0x9a75('0xe')](_0x9a75('0xf'),_0x5609cb,_0x9a75('0x10'));logger[_0x9a75('0x11')](_0x9a75('0x12'),_0x5609cb,_0x9a75('0x10'),JSON['stringify'](_0x1e774a));if(_0x1e774a[_0x9a75('0x13')]){if(_0x1e774a[_0x9a75('0x13')][_0x9a75('0x14')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x5609cb,_0x1e774a['error'][_0x9a75('0x15')]);return _0x4b0ce5(_0x1e774a['error'][_0x9a75('0x15')]);}logger[_0x9a75('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x5609cb,_0x1e774a[_0x9a75('0x13')][_0x9a75('0x15')]);return _0x48a4ad(_0x1e774a['error']['message']);}else{logger[_0x9a75('0xe')](_0x9a75('0xf'),_0x5609cb,_0x9a75('0x10'));_0x48a4ad(_0x1e774a[_0x9a75('0x16')][_0x9a75('0x15')]);}})[_0x9a75('0x17')](function(_0x4cd602){logger[_0x9a75('0x13')](_0x9a75('0xf'),_0x5609cb,_0x4cd602);_0x4b0ce5(_0x4cd602);});});}
\ No newline at end of file
index 1caff40..e036664 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96ba=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','exports','multer','util','path'];(function(_0x4ef0bd,_0x3726c1){var _0x1bb631=function(_0x16f61d){while(--_0x16f61d){_0x4ef0bd['push'](_0x4ef0bd['shift']());}};_0x1bb631(++_0x3726c1);}(_0x96ba,0x195));var _0xa96b=function(_0x5dc2fa,_0x56279d){_0x5dc2fa=_0x5dc2fa-0x0;var _0x16eaf9=_0x96ba[_0x5dc2fa];return _0x16eaf9;};'use strict';var multer=require(_0xa96b('0x0'));var util=require(_0xa96b('0x1'));var path=require(_0xa96b('0x2'));var timeout=require(_0xa96b('0x3'));var express=require(_0xa96b('0x4'));var router=express[_0xa96b('0x5')]();var auth=require(_0xa96b('0x6'));var interaction=require(_0xa96b('0x7'));var config=require(_0xa96b('0x8'));var controller=require(_0xa96b('0x9'));router[_0xa96b('0xa')]('/',controller[_0xa96b('0xb')]);router[_0xa96b('0xc')](_0xa96b('0xd'),auth[_0xa96b('0xe')](),controller[_0xa96b('0xf')]);module[_0xa96b('0x10')]=router;
\ No newline at end of file
+var _0xa198=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','isAuthenticated','update'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0xa198,0x144));var _0x8a19=function(_0x2e1bd4,_0x373905){_0x2e1bd4=_0x2e1bd4-0x0;var _0x33b5d3=_0xa198[_0x2e1bd4];return _0x33b5d3;};'use strict';var multer=require('multer');var util=require(_0x8a19('0x0'));var path=require(_0x8a19('0x1'));var timeout=require(_0x8a19('0x2'));var express=require(_0x8a19('0x3'));var router=express['Router']();var auth=require(_0x8a19('0x4'));var interaction=require(_0x8a19('0x5'));var config=require(_0x8a19('0x6'));var controller=require(_0x8a19('0x7'));router[_0x8a19('0x8')]('/',controller['index']);router[_0x8a19('0x9')]('/:id',auth[_0x8a19('0xa')](),controller[_0x8a19('0xb')]);module['exports']=router;
\ No newline at end of file
index c22188f..466ffdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524e=['STRING','INTEGER','TEXT'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0x524e,0x15e));var _0xe524=function(_0x30a47c,_0x3e02eb){_0x30a47c=_0x30a47c-0x0;var _0x37b002=_0x524e[_0x30a47c];return _0x37b002;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0xe524('0x0')]},'data1':{'type':Sequelize[_0xe524('0x1')]},'data2':{'type':Sequelize[_0xe524('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xe524('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xdc97=['exports','TEXT','STRING','sequelize'];(function(_0x5d2918,_0x3189a0){var _0x319ea0=function(_0x111ca2){while(--_0x111ca2){_0x5d2918['push'](_0x5d2918['shift']());}};_0x319ea0(++_0x3189a0);}(_0xdc97,0x13b));var _0x7dc9=function(_0x498493,_0x832b76){_0x498493=_0x498493-0x0;var _0x8261b6=_0xdc97[_0x498493];return _0x8261b6;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'license':{'type':Sequelize[_0x7dc9('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x7dc9('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index ae6fb79..df78153 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa83a=['../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','update','then','error','name','send','../../config/license/util','model','License','rawAttributes','keys','query','intersection','attributes','fields','length','merge','getLicense','catch','body','find','params','checkLicense','key','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x1a2903,_0x4fefdf){var _0x395057=function(_0x2409a6){while(--_0x2409a6){_0x1a2903['push'](_0x1a2903['shift']());}};_0x395057(++_0x4fefdf);}(_0xa83a,0x1d8));var _0xaa83=function(_0x2928f9,_0x8799c6){_0x2928f9=_0x2928f9-0x0;var _0x467765=_0xa83a[_0x2928f9];return _0x467765;};'use strict';var pdf=require(_0xaa83('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaa83('0x1'));var zipdir=require(_0xaa83('0x2'));var jsonpatch=require(_0xaa83('0x3'));var rp=require(_0xaa83('0x4'));var moment=require(_0xaa83('0x5'));var BPromise=require(_0xaa83('0x6'));var Mustache=require(_0xaa83('0x7'));var util=require(_0xaa83('0x8'));var path=require(_0xaa83('0x9'));var sox=require(_0xaa83('0xa'));var csv=require(_0xaa83('0xb'));var ejs=require(_0xaa83('0xc'));var fs=require('fs');var _=require(_0xaa83('0xd'));var squel=require(_0xaa83('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa83('0xf'));var toCsv=require(_0xaa83('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaa83('0x10'));var authService=require(_0xaa83('0x11'));var qs=require(_0xaa83('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa83('0x13'))(_0xaa83('0x14'));var utils=require(_0xaa83('0x15'));var config=require(_0xaa83('0x16'));var db=require(_0xaa83('0x17'))['db'];function respondWithStatusCode(_0x2f5972,_0x3c3096){_0x3c3096=_0x3c3096||0xcc;return function(_0x536966){if(_0x536966){return _0x2f5972[_0xaa83('0x18')](_0x3c3096);}return _0x2f5972[_0xaa83('0x19')](_0x3c3096)['end']();};}function respondWithResult(_0x28b569,_0x4caa31){_0x4caa31=_0x4caa31||0xc8;return function(_0x35b916){if(_0x35b916){return _0x28b569[_0xaa83('0x19')](_0x4caa31)[_0xaa83('0x1a')](_0x35b916);}};}function respondWithFilteredResult(_0x2a1d4e,_0x5c9cb9){return function(_0x467e27){if(_0x467e27){var _0x210811=_0x467e27['count'],_0x5bfc2b=_0x5c9cb9[_0xaa83('0x1b')],_0x385cfa=_0x5c9cb9[_0xaa83('0x1b')]+_0x5c9cb9[_0xaa83('0x1c')],_0x3972bb;if(_0x385cfa>=_0x210811){_0x385cfa=_0x210811;_0x3972bb=0xc8;}else{_0x3972bb=0xce;}_0x2a1d4e[_0xaa83('0x19')](_0x3972bb);return _0x2a1d4e['set'](_0xaa83('0x1d'),_0x5bfc2b+'-'+_0x385cfa+'/'+_0x210811)[_0xaa83('0x1a')](_0x467e27);}return null;};}function patchUpdates(_0x30be94){return function(_0x38db52){try{jsonpatch[_0xaa83('0x1e')](_0x38db52,_0x30be94,!![]);}catch(_0x570006){return BPromise[_0xaa83('0x1f')](_0x570006);}return _0x38db52['save']();};}function saveUpdates(_0x5e38a6,_0x2fc381){return function(_0x61eb19){if(_0x61eb19){return _0x61eb19[_0xaa83('0x20')](_0x5e38a6)['then'](function(_0x3596a8){return _0x3596a8;});}return null;};}function removeEntity(_0xe4c768,_0x45acf0){return function(_0x2d8fc1){if(_0x2d8fc1){return _0x2d8fc1['destroy']()[_0xaa83('0x21')](function(){_0xe4c768[_0xaa83('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4acf,_0x2e9ef9){return function(_0x3ceab5){if(!_0x3ceab5){_0x4d4acf[_0xaa83('0x18')](0x194);}return _0x3ceab5;};}function handleError(_0x2dd4d9,_0x164ab0){_0x164ab0=_0x164ab0||0x1f4;return function(_0x327f1c){logger[_0xaa83('0x22')](_0x327f1c['stack']);if(_0x327f1c['name']){delete _0x327f1c[_0xaa83('0x23')];}_0x2dd4d9[_0xaa83('0x19')](_0x164ab0)[_0xaa83('0x24')](_0x327f1c);};}var utilLicense=require(_0xaa83('0x25'));exports['index']=function(_0x246101,_0xe78070){var _0x21b464={'raw':!![],'where':{'id':0x1}},_0x468048={};_0x468048[_0xaa83('0x26')]=_['keys'](db[_0xaa83('0x27')][_0xaa83('0x28')]);_0x468048['query']=_[_0xaa83('0x29')](_0x246101[_0xaa83('0x2a')]);_0x468048['filters']=_[_0xaa83('0x2b')](_0x468048[_0xaa83('0x26')],_0x468048['query']);_0x21b464[_0xaa83('0x2c')]=_[_0xaa83('0x2b')](_0x468048[_0xaa83('0x26')],qs[_0xaa83('0x2d')](_0x246101[_0xaa83('0x2a')][_0xaa83('0x2d')]));_0x21b464[_0xaa83('0x2c')]=_0x21b464['attributes'][_0xaa83('0x2e')]?_0x21b464['attributes']:_0x468048[_0xaa83('0x26')];_0x21b464=_[_0xaa83('0x2f')]({},_0x21b464,_0x246101['options']);return utilLicense[_0xaa83('0x30')](_0x21b464)[_0xaa83('0x21')](respondWithResult(_0xe78070,null))[_0xaa83('0x31')](handleError(_0xe78070,null));};exports['update']=function(_0x1b2160,_0x17f955){if(_0x1b2160[_0xaa83('0x32')]['id']){delete _0x1b2160['body']['id'];}return db[_0xaa83('0x27')][_0xaa83('0x33')]({'where':{'id':_0x1b2160[_0xaa83('0x34')]['id']}})[_0xaa83('0x21')](handleEntityNotFound(_0x17f955,null))[_0xaa83('0x21')](function(_0x457cbe){var _0x5d4ee8=_0x457cbe['get']({'plain':!![]});return utilLicense[_0xaa83('0x35')](_0x5d4ee8,_0x1b2160['body'][_0xaa83('0x36')]);})[_0xaa83('0x21')](function(_0x182f05){if(!_0x182f05['demo']){return saveUpdates(_0x1b2160[_0xaa83('0x32')],null);}return _0x182f05;})[_0xaa83('0x21')](respondWithResult(_0x17f955,null))[_0xaa83('0x31')](handleError(_0x17f955,null));};
\ No newline at end of file
+var _0x3502=['reject','then','error','stack','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','attributes','intersection','fields','length','getLicense','catch','update','body','find','params','get','checkLicense','key','demo','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3502,0x148));var _0x2350=function(_0x16c8bb,_0x49d6a7){_0x16c8bb=_0x16c8bb-0x0;var _0x3b0c30=_0x3502[_0x16c8bb];return _0x3b0c30;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2350('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2350('0x1'));var rp=require(_0x2350('0x2'));var moment=require(_0x2350('0x3'));var BPromise=require(_0x2350('0x4'));var Mustache=require(_0x2350('0x5'));var util=require(_0x2350('0x6'));var path=require(_0x2350('0x7'));var sox=require(_0x2350('0x8'));var csv=require(_0x2350('0x9'));var ejs=require(_0x2350('0xa'));var fs=require('fs');var _=require(_0x2350('0xb'));var squel=require(_0x2350('0xc'));var crypto=require('crypto');var jsforce=require(_0x2350('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2350('0x9'));var querystring=require(_0x2350('0xe'));var Papa=require(_0x2350('0xf'));var Redis=require(_0x2350('0x10'));var authService=require(_0x2350('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2350('0x12'));var logger=require(_0x2350('0x13'))('api');var utils=require(_0x2350('0x14'));var config=require(_0x2350('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e69bb,_0x4f73b8){_0x4f73b8=_0x4f73b8||0xcc;return function(_0xa997d2){if(_0xa997d2){return _0x2e69bb[_0x2350('0x16')](_0x4f73b8);}return _0x2e69bb[_0x2350('0x17')](_0x4f73b8)[_0x2350('0x18')]();};}function respondWithResult(_0x12479b,_0x516ffe){_0x516ffe=_0x516ffe||0xc8;return function(_0x2f41cb){if(_0x2f41cb){return _0x12479b[_0x2350('0x17')](_0x516ffe)[_0x2350('0x19')](_0x2f41cb);}};}function respondWithFilteredResult(_0x148b38,_0xbd2715){return function(_0x236b90){if(_0x236b90){var _0x5d0bb1=_0x236b90[_0x2350('0x1a')],_0x51ee7a=_0xbd2715[_0x2350('0x1b')],_0x2b02f5=_0xbd2715[_0x2350('0x1b')]+_0xbd2715[_0x2350('0x1c')],_0x18c3a5;if(_0x2b02f5>=_0x5d0bb1){_0x2b02f5=_0x5d0bb1;_0x18c3a5=0xc8;}else{_0x18c3a5=0xce;}_0x148b38[_0x2350('0x17')](_0x18c3a5);return _0x148b38[_0x2350('0x1d')](_0x2350('0x1e'),_0x51ee7a+'-'+_0x2b02f5+'/'+_0x5d0bb1)[_0x2350('0x19')](_0x236b90);}return null;};}function patchUpdates(_0x96b6ea){return function(_0xc68fff){try{jsonpatch[_0x2350('0x1f')](_0xc68fff,_0x96b6ea,!![]);}catch(_0x4b1029){return BPromise[_0x2350('0x20')](_0x4b1029);}return _0xc68fff['save']();};}function saveUpdates(_0x2815d3,_0x48e872){return function(_0x409a69){if(_0x409a69){return _0x409a69['update'](_0x2815d3)[_0x2350('0x21')](function(_0x3d230b){return _0x3d230b;});}return null;};}function removeEntity(_0x665d54,_0x4a63b9){return function(_0x329e00){if(_0x329e00){return _0x329e00['destroy']()[_0x2350('0x21')](function(){_0x665d54[_0x2350('0x17')](0xcc)[_0x2350('0x18')]();});}};}function handleEntityNotFound(_0x8e406b,_0x4a23a3){return function(_0x2321ba){if(!_0x2321ba){_0x8e406b[_0x2350('0x16')](0x194);}return _0x2321ba;};}function handleError(_0x51eec3,_0x29f885){_0x29f885=_0x29f885||0x1f4;return function(_0x1e53a9){logger[_0x2350('0x22')](_0x1e53a9[_0x2350('0x23')]);if(_0x1e53a9[_0x2350('0x24')]){delete _0x1e53a9[_0x2350('0x24')];}_0x51eec3[_0x2350('0x17')](_0x29f885)[_0x2350('0x25')](_0x1e53a9);};}var utilLicense=require(_0x2350('0x26'));exports[_0x2350('0x27')]=function(_0x130053,_0x4beffe){var _0x5113ad={'raw':!![],'where':{'id':0x1}},_0x1e2a5b={};_0x1e2a5b[_0x2350('0x28')]=_[_0x2350('0x29')](db[_0x2350('0x2a')][_0x2350('0x2b')]);_0x1e2a5b[_0x2350('0x2c')]=_[_0x2350('0x29')](_0x130053[_0x2350('0x2c')]);_0x1e2a5b[_0x2350('0x2d')]=_['intersection'](_0x1e2a5b['model'],_0x1e2a5b['query']);_0x5113ad[_0x2350('0x2e')]=_[_0x2350('0x2f')](_0x1e2a5b[_0x2350('0x28')],qs[_0x2350('0x30')](_0x130053[_0x2350('0x2c')][_0x2350('0x30')]));_0x5113ad[_0x2350('0x2e')]=_0x5113ad[_0x2350('0x2e')][_0x2350('0x31')]?_0x5113ad['attributes']:_0x1e2a5b['model'];_0x5113ad=_['merge']({},_0x5113ad,_0x130053['options']);return utilLicense[_0x2350('0x32')](_0x5113ad)['then'](respondWithResult(_0x4beffe,null))[_0x2350('0x33')](handleError(_0x4beffe,null));};exports[_0x2350('0x34')]=function(_0x14b4d3,_0xa3d3d2){if(_0x14b4d3[_0x2350('0x35')]['id']){delete _0x14b4d3[_0x2350('0x35')]['id'];}return db[_0x2350('0x2a')][_0x2350('0x36')]({'where':{'id':_0x14b4d3[_0x2350('0x37')]['id']}})[_0x2350('0x21')](handleEntityNotFound(_0xa3d3d2,null))[_0x2350('0x21')](function(_0x2594a7){var _0x5d2b8c=_0x2594a7[_0x2350('0x38')]({'plain':!![]});return utilLicense[_0x2350('0x39')](_0x5d2b8c,_0x14b4d3[_0x2350('0x35')][_0x2350('0x3a')]);})['then'](function(_0x55a8c1){if(!_0x55a8c1[_0x2350('0x3b')]){return saveUpdates(_0x14b4d3['body'],null);}return _0x55a8c1;})[_0x2350('0x21')](respondWithResult(_0xa3d3d2,null))[_0x2350('0x33')](handleError(_0xa3d3d2,null));};
\ No newline at end of file
index 08f646f..f7a8120 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['bluebird','request-promise','path','./license.attributes','exports','define','License','lodash','util','../../config/logger','api','moment'];(function(_0x2c1101,_0x3ce298){var _0x2498f4=function(_0x3024e7){while(--_0x3024e7){_0x2c1101['push'](_0x2c1101['shift']());}};_0x2498f4(++_0x3ce298);}(_0x5f2f,0x73));var _0xf5f2=function(_0x11bcbd,_0x4d39b3){_0x11bcbd=_0x11bcbd-0x0;var _0x58aa24=_0x5f2f[_0x11bcbd];return _0x58aa24;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','license','lodash','../../config/logger'];(function(_0x197065,_0x2e79d0){var _0x3d9404=function(_0xf582a7){while(--_0xf582a7){_0x197065['push'](_0x197065['shift']());}};_0x3d9404(++_0x2e79d0);}(_0xb10b,0x12a));var _0xbb10=function(_0xa7d678,_0x3dfdff){_0xa7d678=_0xa7d678-0x0;var _0x5cc539=_0xb10b[_0xa7d678];return _0x5cc539;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('License',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c909b5a..799c590 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd84c=['debug','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0xd84c,0x102));var _0xcd84=function(_0x997acb,_0x52a3a5){_0x997acb=_0x997acb-0x0;var _0x486c7c=_0xd84c[_0x997acb];return _0x486c7c;};'use strict';var _=require(_0xcd84('0x0'));var util=require(_0xcd84('0x1'));var moment=require(_0xcd84('0x2'));var BPromise=require(_0xcd84('0x3'));var rs=require(_0xcd84('0x4'));var fs=require('fs');var Redis=require(_0xcd84('0x5'));var db=require(_0xcd84('0x6'))['db'];var utils=require(_0xcd84('0x7'));var logger=require(_0xcd84('0x8'))('rpc');var config=require(_0xcd84('0x9'));var jayson=require(_0xcd84('0xa'));var client=jayson[_0xcd84('0xb')][_0xcd84('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x520d49,_0x2b5383,_0x22c811){return new BPromise(function(_0x3f3617,_0x5408e2){return client[_0xcd84('0xd')](_0x520d49,_0x22c811)[_0xcd84('0xe')](function(_0xec34a2){logger[_0xcd84('0xf')]('License,\x20%s,\x20%s',_0x2b5383,_0xcd84('0x10'));logger[_0xcd84('0x11')]('License,\x20%s,\x20%s,\x20%s',_0x2b5383,_0xcd84('0x10'),JSON[_0xcd84('0x12')](_0xec34a2));if(_0xec34a2[_0xcd84('0x13')]){if(_0xec34a2['error'][_0xcd84('0x14')]===0x1f4){logger[_0xcd84('0x13')](_0xcd84('0x15'),_0x2b5383,_0xec34a2[_0xcd84('0x13')]['message']);return _0x5408e2(_0xec34a2[_0xcd84('0x13')][_0xcd84('0x16')]);}logger[_0xcd84('0x13')](_0xcd84('0x15'),_0x2b5383,_0xec34a2[_0xcd84('0x13')][_0xcd84('0x16')]);return _0x3f3617(_0xec34a2[_0xcd84('0x13')][_0xcd84('0x16')]);}else{logger[_0xcd84('0xf')](_0xcd84('0x15'),_0x2b5383,_0xcd84('0x10'));_0x3f3617(_0xec34a2[_0xcd84('0x17')][_0xcd84('0x16')]);}})[_0xcd84('0x18')](function(_0xfc4ec7){logger[_0xcd84('0x13')](_0xcd84('0x15'),_0x2b5383,_0xfc4ec7);_0x5408e2(_0xfc4ec7);});});}
\ No newline at end of file
+var _0x2333=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','randomstring','ioredis'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0x2333,0x11a));var _0x3233=function(_0x4511ce,_0x55dea4){_0x4511ce=_0x4511ce-0x0;var _0x2790d2=_0x2333[_0x4511ce];return _0x2790d2;};'use strict';var _=require(_0x3233('0x0'));var util=require(_0x3233('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3233('0x2'));var fs=require('fs');var Redis=require(_0x3233('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3233('0x4'));var logger=require(_0x3233('0x5'))(_0x3233('0x6'));var config=require(_0x3233('0x7'));var jayson=require(_0x3233('0x8'));var client=jayson[_0x3233('0x9')][_0x3233('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33a56d,_0x1e93e8,_0x1842a1){return new BPromise(function(_0x1837b6,_0x2ee6df){return client[_0x3233('0xb')](_0x33a56d,_0x1842a1)[_0x3233('0xc')](function(_0x7ff4bd){logger[_0x3233('0xd')](_0x3233('0xe'),_0x1e93e8,_0x3233('0xf'));logger[_0x3233('0x10')](_0x3233('0x11'),_0x1e93e8,_0x3233('0xf'),JSON['stringify'](_0x7ff4bd));if(_0x7ff4bd[_0x3233('0x12')]){if(_0x7ff4bd[_0x3233('0x12')][_0x3233('0x13')]===0x1f4){logger[_0x3233('0x12')](_0x3233('0xe'),_0x1e93e8,_0x7ff4bd[_0x3233('0x12')][_0x3233('0x14')]);return _0x2ee6df(_0x7ff4bd[_0x3233('0x12')][_0x3233('0x14')]);}logger[_0x3233('0x12')](_0x3233('0xe'),_0x1e93e8,_0x7ff4bd[_0x3233('0x12')][_0x3233('0x14')]);return _0x1837b6(_0x7ff4bd['error']['message']);}else{logger[_0x3233('0xd')](_0x3233('0xe'),_0x1e93e8,_0x3233('0xf'));_0x1837b6(_0x7ff4bd['result'][_0x3233('0x14')]);}})[_0x3233('0x15')](function(_0x127227){logger['error'](_0x3233('0xe'),_0x1e93e8,_0x127227);_0x2ee6df(_0x127227);});});}
\ No newline at end of file
index 143ddc1..db34d63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x405c=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','send','addAgents','update','delete','removeDispositions','removeImap','destroy','removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','/describe','isAuthenticated'];(function(_0x50f613,_0x5b08e9){var _0x1ebf37=function(_0x5c303e){while(--_0x5c303e){_0x50f613['push'](_0x50f613['shift']());}};_0x1ebf37(++_0x5b08e9);}(_0x405c,0x1ca));var _0xc405=function(_0x20e093,_0x391661){_0x20e093=_0x20e093-0x0;var _0x341a40=_0x405c[_0x20e093];return _0x341a40;};'use strict';var multer=require(_0xc405('0x0'));var util=require(_0xc405('0x1'));var path=require(_0xc405('0x2'));var timeout=require(_0xc405('0x3'));var express=require(_0xc405('0x4'));var router=express['Router']();var auth=require(_0xc405('0x5'));var interaction=require(_0xc405('0x6'));var config=require(_0xc405('0x7'));var controller=require(_0xc405('0x8'));router[_0xc405('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc405('0x9')](_0xc405('0xa'),auth[_0xc405('0xb')](),controller['describe']);router[_0xc405('0x9')](_0xc405('0xc'),auth[_0xc405('0xb')](),controller[_0xc405('0xd')]);router['get'](_0xc405('0xe'),auth[_0xc405('0xb')](),controller[_0xc405('0xf')]);router[_0xc405('0x9')](_0xc405('0x10'),auth[_0xc405('0xb')](),controller[_0xc405('0x11')]);router[_0xc405('0x9')](_0xc405('0x12'),auth['isAuthenticated'](),controller[_0xc405('0x13')]);router[_0xc405('0x9')](_0xc405('0x14'),auth['isAuthenticated'](),controller[_0xc405('0x15')]);router[_0xc405('0x9')](_0xc405('0x16'),auth[_0xc405('0xb')](),controller[_0xc405('0x17')]);router[_0xc405('0x9')](_0xc405('0x18'),auth['isAuthenticated'](),controller[_0xc405('0x19')]);router[_0xc405('0x9')](_0xc405('0x1a'),auth['isAuthenticated'](),controller[_0xc405('0x1b')]);router[_0xc405('0x9')](_0xc405('0x1c'),auth[_0xc405('0xb')](),controller[_0xc405('0x1d')]);router[_0xc405('0x9')](_0xc405('0x1e'),auth[_0xc405('0xb')](),controller[_0xc405('0x1f')]);router[_0xc405('0x20')]('/:id/dispositions',auth[_0xc405('0xb')](),controller[_0xc405('0x21')]);router[_0xc405('0x20')](_0xc405('0x10'),auth['isAuthenticated'](),controller[_0xc405('0x22')]);router['post']('/',auth[_0xc405('0xb')](),controller[_0xc405('0x23')]);router[_0xc405('0x20')]('/:id/in_servers',auth[_0xc405('0xb')](),controller[_0xc405('0x24')]);router[_0xc405('0x20')](_0xc405('0x14'),auth['isAuthenticated'](),controller[_0xc405('0x25')]);router['post'](_0xc405('0x16'),auth[_0xc405('0xb')](),controller[_0xc405('0x26')]);router[_0xc405('0x20')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0xc405('0x20')]('/:id/send',auth[_0xc405('0xb')](),controller[_0xc405('0x27')]);router[_0xc405('0x20')](_0xc405('0x1e'),auth[_0xc405('0xb')](),controller[_0xc405('0x28')]);router['put'](_0xc405('0xc'),auth[_0xc405('0xb')](),controller[_0xc405('0x29')]);router[_0xc405('0x2a')](_0xc405('0xe'),auth[_0xc405('0xb')](),controller[_0xc405('0x2b')]);router['delete'](_0xc405('0x10'),auth[_0xc405('0xb')](),controller['removeAnswers']);router[_0xc405('0x2a')](_0xc405('0x12'),auth[_0xc405('0xb')](),controller[_0xc405('0x2c')]);router['delete']('/:id/out_servers',auth[_0xc405('0xb')](),controller['removeSmtp']);router[_0xc405('0x2a')]('/:id',auth[_0xc405('0xb')](),controller[_0xc405('0x2d')]);router['delete'](_0xc405('0x1e'),auth[_0xc405('0xb')](),controller[_0xc405('0x2e')]);module['exports']=router;
\ No newline at end of file
+var _0xacc5=['/:id/send','/:id','delete','removeAnswers','removeSmtp','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','/:id/users','/:id/dispositions','addDisposition','post','create','addImap','/:id/out_servers'];(function(_0x57f2c8,_0x58182c){var _0x135982=function(_0x5ad54b){while(--_0x5ad54b){_0x57f2c8['push'](_0x57f2c8['shift']());}};_0x135982(++_0x58182c);}(_0xacc5,0x1cf));var _0x5acc=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xacc5[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x5acc('0x0'));var util=require('util');var path=require(_0x5acc('0x1'));var timeout=require('connect-timeout');var express=require(_0x5acc('0x2'));var router=express['Router']();var auth=require(_0x5acc('0x3'));var interaction=require(_0x5acc('0x4'));var config=require('../../config/environment');var controller=require(_0x5acc('0x5'));router[_0x5acc('0x6')]('/',auth['isAuthenticated'](),controller[_0x5acc('0x7')]);router[_0x5acc('0x6')](_0x5acc('0x8'),auth[_0x5acc('0x9')](),controller[_0x5acc('0xa')]);router['get']('/:id',auth[_0x5acc('0x9')](),controller[_0x5acc('0xb')]);router[_0x5acc('0x6')]('/:id/dispositions',auth[_0x5acc('0x9')](),controller[_0x5acc('0xc')]);router[_0x5acc('0x6')](_0x5acc('0xd'),auth['isAuthenticated'](),controller[_0x5acc('0xe')]);router['get'](_0x5acc('0xf'),auth[_0x5acc('0x9')](),controller[_0x5acc('0x10')]);router[_0x5acc('0x6')]('/:id/out_servers',auth[_0x5acc('0x9')](),controller[_0x5acc('0x11')]);router[_0x5acc('0x6')](_0x5acc('0x12'),auth[_0x5acc('0x9')](),controller[_0x5acc('0x13')]);router[_0x5acc('0x6')](_0x5acc('0x14'),auth[_0x5acc('0x9')](),controller[_0x5acc('0x15')]);router[_0x5acc('0x6')](_0x5acc('0x16'),auth[_0x5acc('0x9')](),controller['getMessages']);router['get'](_0x5acc('0x17'),auth[_0x5acc('0x9')](),controller['verifySmtp']);router[_0x5acc('0x6')](_0x5acc('0x18'),auth[_0x5acc('0x9')](),controller['getAgents']);router['post'](_0x5acc('0x19'),auth[_0x5acc('0x9')](),controller[_0x5acc('0x1a')]);router[_0x5acc('0x1b')](_0x5acc('0xd'),auth[_0x5acc('0x9')](),controller['addAnswer']);router[_0x5acc('0x1b')]('/',auth['isAuthenticated'](),controller[_0x5acc('0x1c')]);router[_0x5acc('0x1b')]('/:id/in_servers',auth[_0x5acc('0x9')](),controller[_0x5acc('0x1d')]);router[_0x5acc('0x1b')](_0x5acc('0x1e'),auth['isAuthenticated'](),controller['addSmtp']);router[_0x5acc('0x1b')]('/:id/interactions',auth[_0x5acc('0x9')](),controller['addInteraction']);router[_0x5acc('0x1b')](_0x5acc('0x14'),auth[_0x5acc('0x9')](),controller['addApplications']);router[_0x5acc('0x1b')](_0x5acc('0x1f'),auth['isAuthenticated'](),controller['send']);router['post'](_0x5acc('0x18'),auth[_0x5acc('0x9')](),controller['addAgents']);router['put'](_0x5acc('0x20'),auth[_0x5acc('0x9')](),controller['update']);router[_0x5acc('0x21')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x5acc('0x21')](_0x5acc('0xd'),auth[_0x5acc('0x9')](),controller[_0x5acc('0x22')]);router['delete'](_0x5acc('0xf'),auth[_0x5acc('0x9')](),controller['removeImap']);router[_0x5acc('0x21')](_0x5acc('0x1e'),auth[_0x5acc('0x9')](),controller[_0x5acc('0x23')]);router[_0x5acc('0x21')]('/:id',auth[_0x5acc('0x9')](),controller[_0x5acc('0x24')]);router[_0x5acc('0x21')](_0x5acc('0x18'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x5acc('0x25')]=router;
\ No newline at end of file
index df57b03..e8f41f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70f4=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','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'];(function(_0x5505ae,_0x54274d){var _0xd0ef0a=function(_0x168312){while(--_0x168312){_0x5505ae['push'](_0x5505ae['shift']());}};_0xd0ef0a(++_0x54274d);}(_0x70f4,0x10d));var _0x470f=function(_0x5cfcef,_0x20d843){_0x5cfcef=_0x5cfcef-0x0;var _0x21df12=_0x70f4[_0x5cfcef];return _0x21df12;};'use strict';var Sequelize=require(_0x470f('0x0'));module[_0x470f('0x1')]={'description':{'type':Sequelize[_0x470f('0x2')]},'name':{'type':Sequelize[_0x470f('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x470f('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x470f('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x470f('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x470f('0x2')],'allowNull':![],'defaultValue':_0x470f('0x4')},'fontSize':{'type':Sequelize[_0x470f('0x5')](0x2)[_0x470f('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x470f('0x7')],'defaultValue':function(){return _0x470f('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x470f('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x470f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x470f('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x470f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x470f('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x470f('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x470f('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x470f('0x3')],'defaultValue':![],'comment':_0x470f('0xa'),'set':function(_0x4f7977){if(!_0x4f7977)this[_0x470f('0xb')](_0x470f('0xc'),null);this['setDataValue'](_0x470f('0xd'),_0x4f7977);}}};
\ No newline at end of file
+var _0x69d9=['INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT'];(function(_0x1dc130,_0x1f8090){var _0x48e316=function(_0x1f3743){while(--_0x1f3743){_0x1dc130['push'](_0x1dc130['shift']());}};_0x48e316(++_0x1f8090);}(_0x69d9,0x164));var _0x969d=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0x69d9[_0x54bac5];return _0xc15971;};'use strict';var Sequelize=require(_0x969d('0x0'));module['exports']={'description':{'type':Sequelize[_0x969d('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x969d('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x969d('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x969d('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x969d('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x969d('0x4')](0x2)[_0x969d('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x969d('0x3')],'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[_0x969d('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x969d('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x969d('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x969d('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x969d('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x969d('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x969d('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4c46d9){if(!_0x4c46d9)this[_0x969d('0x7')](_0x969d('0x8'),null);this['setDataValue'](_0x969d('0x9'),_0x4c46d9);}}};
\ No newline at end of file
index 3aa27d2..d1ab3cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc422=['findOne','nolimit','merge','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','includeAll','rows','email','ListId','isNil','active','user','cuser','host','port','cservice','password','cpassword','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','color','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','MailMessage','split','format','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','basename','service','auth','pass','secure','sendMail','defaults','List\x20not\x20found','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','authentication','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','offset','limit','Content-Range','apply','save','update','destroy','get','UserProfileResource','sendStatus','stack','name','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','count','include','MailAccount','show','Pause','keys','options','find','body','describe','params','MailAccountId','Disposition','create','getDispositions'];(function(_0x123601,_0x24c858){var _0x12db70=function(_0x31abf8){while(--_0x31abf8){_0x123601['push'](_0x123601['shift']());}};_0x12db70(++_0x24c858);}(_0xc422,0x1cf));var _0x2c42=function(_0x4aa12b,_0x5dc8c9){_0x4aa12b=_0x4aa12b-0x0;var _0xccf4ec=_0xc422[_0x4aa12b];return _0xccf4ec;};'use strict';var pdf=require(_0x2c42('0x0'));var emlformat=require(_0x2c42('0x1'));var rimraf=require(_0x2c42('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2c42('0x3'));var moment=require(_0x2c42('0x4'));var BPromise=require(_0x2c42('0x5'));var Mustache=require('mustache');var util=require(_0x2c42('0x6'));var path=require(_0x2c42('0x7'));var sox=require('sox');var csv=require(_0x2c42('0x8'));var ejs=require(_0x2c42('0x9'));var fs=require('fs');var _=require(_0x2c42('0xa'));var squel=require(_0x2c42('0xb'));var crypto=require('crypto');var jsforce=require(_0x2c42('0xc'));var deskjs=require(_0x2c42('0xd'));var toCsv=require(_0x2c42('0x8'));var querystring=require(_0x2c42('0xe'));var Papa=require('papaparse');var Redis=require(_0x2c42('0xf'));var authService=require(_0x2c42('0x10'));var qs=require(_0x2c42('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c42('0x12'));var logger=require(_0x2c42('0x13'))('api');var utils=require(_0x2c42('0x14'));var config=require(_0x2c42('0x15'));var db=require('../../mysqldb')['db'];config[_0x2c42('0x16')]=_['defaults'](config[_0x2c42('0x16')],{'host':_0x2c42('0x17'),'port':0x18eb});var socket=require(_0x2c42('0x18'))(new Redis(config[_0x2c42('0x16')]));require(_0x2c42('0x19'))[_0x2c42('0x1a')](socket);var jayson=require(_0x2c42('0x1b'));var client=jayson['client'][_0x2c42('0x1c')]({'port':0x232b});function checkPasswordPattern(_0x4c050d,_0x42562e,_0x483034){if(_0x483034){var _0x303153=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x303153[_0x2c42('0x1d')](_0x42562e)){return _0x4c050d;}else{throw new db['Sequelize'][(_0x2c42('0x1e'))](_0x2c42('0x1f'));}}else{return _0x4c050d;}}function respondWithRpcPromise(_0x2bfce7,_0xf50f32,_0x59a9dd,_0x4e9f88){return new BPromise(function(_0x510139,_0x26731a){var _0x52128c=_0x4e9f88||client;return _0x52128c['request'](_0x2bfce7,_0x59a9dd)[_0x2c42('0x20')](function(_0x51e135){logger[_0x2c42('0x21')](_0x2c42('0x22'),_0xf50f32,_0x2c42('0x23'));logger[_0x2c42('0x24')](_0x2c42('0x25'),_0xf50f32,_0x2c42('0x23'),JSON[_0x2c42('0x26')](_0x51e135));if(_0x51e135[_0x2c42('0x27')]){if(_0x51e135[_0x2c42('0x27')][_0x2c42('0x28')]===0x1f4){logger[_0x2c42('0x27')](_0x2c42('0x22'),_0xf50f32,_0x51e135[_0x2c42('0x27')][_0x2c42('0x29')]);return _0x26731a(_0x51e135['error'][_0x2c42('0x29')]);}logger[_0x2c42('0x27')]('MailAccount,\x20%s,\x20%s',_0xf50f32,_0x51e135[_0x2c42('0x27')][_0x2c42('0x29')]);return _0x510139(_0x51e135[_0x2c42('0x27')]['message']);}else{logger[_0x2c42('0x21')](_0x2c42('0x22'),_0xf50f32,'request\x20sent');_0x510139(_0x51e135[_0x2c42('0x2a')][_0x2c42('0x29')]);}})[_0x2c42('0x2b')](function(_0x3b1d07){logger[_0x2c42('0x27')]('MailAccount,\x20%s,\x20%s',_0xf50f32,_0x3b1d07);_0x26731a(_0x3b1d07);});});}function respondWithStatusCode(_0x4ad5dc,_0x20c33c){_0x20c33c=_0x20c33c||0xcc;return function(_0x159c84){if(_0x159c84){return _0x4ad5dc['sendStatus'](_0x20c33c);}return _0x4ad5dc['status'](_0x20c33c)[_0x2c42('0x2c')]();};}function respondWithResult(_0x546cde,_0x120ba0){_0x120ba0=_0x120ba0||0xc8;return function(_0x4b0693){if(_0x4b0693){return _0x546cde[_0x2c42('0x2d')](_0x120ba0)['json'](_0x4b0693);}};}function respondWithFilteredResult(_0x123279,_0x56749d){return function(_0x66a739){if(_0x66a739){var _0x4fa282=_0x66a739['count'],_0x1ac21f=_0x56749d[_0x2c42('0x2e')],_0x281c7b=_0x56749d[_0x2c42('0x2e')]+_0x56749d[_0x2c42('0x2f')],_0x319980;if(_0x281c7b>=_0x4fa282){_0x281c7b=_0x4fa282;_0x319980=0xc8;}else{_0x319980=0xce;}_0x123279[_0x2c42('0x2d')](_0x319980);return _0x123279['set'](_0x2c42('0x30'),_0x1ac21f+'-'+_0x281c7b+'/'+_0x4fa282)['json'](_0x66a739);}return null;};}function patchUpdates(_0x10cd11){return function(_0x2be652){try{jsonpatch[_0x2c42('0x31')](_0x2be652,_0x10cd11,!![]);}catch(_0x18e88f){return BPromise['reject'](_0x18e88f);}return _0x2be652[_0x2c42('0x32')]();};}function saveUpdates(_0x29b46c,_0x3fc98c){return function(_0x5cb7fc){if(_0x5cb7fc){return _0x5cb7fc[_0x2c42('0x33')](_0x29b46c)[_0x2c42('0x20')](function(_0x466286){return _0x466286;});}return null;};}function removeEntity(_0x34ae2d,_0x5970e1){return function(_0x1f4e6b){if(_0x1f4e6b){return _0x1f4e6b[_0x2c42('0x34')]()[_0x2c42('0x20')](function(){var _0x2f3b09=_0x1f4e6b[_0x2c42('0x35')]({'plain':!![]});var _0xc5d854='MailAccounts';return db[_0x2c42('0x36')][_0x2c42('0x34')]({'where':{'type':_0xc5d854,'resourceId':_0x2f3b09['id']}})['then'](function(){return _0x1f4e6b;});})[_0x2c42('0x20')](function(){_0x34ae2d[_0x2c42('0x2d')](0xcc)[_0x2c42('0x2c')]();});}};}function handleEntityNotFound(_0x3321ec,_0x1f337e){return function(_0x10761b){if(!_0x10761b){_0x3321ec[_0x2c42('0x37')](0x194);}return _0x10761b;};}function handleError(_0x11bcd8,_0x271e9b){_0x271e9b=_0x271e9b||0x1f4;return function(_0x93a38a){logger[_0x2c42('0x27')](_0x93a38a[_0x2c42('0x38')]);if(_0x93a38a[_0x2c42('0x39')]){delete _0x93a38a[_0x2c42('0x39')];}_0x11bcd8[_0x2c42('0x2d')](_0x271e9b)['send'](_0x93a38a);};}exports[_0x2c42('0x3a')]=function(_0x16ce75,_0x3bdbea){var _0x24be4f={'include':[{'model':db[_0x2c42('0x3b')],'as':_0x2c42('0x3c')},{'model':db[_0x2c42('0x3d')],'as':_0x2c42('0x3e')},{'model':db['Pause'],'as':_0x2c42('0x3f')}]},_0x4cee71={},_0x20edab={'count':0x0,'rows':[]};var _0x33665d=_[_0x2c42('0x40')](db['MailAccount'][_0x2c42('0x41')],function(_0x41a2f1){return{'name':_0x41a2f1[_0x2c42('0x42')],'type':_0x41a2f1['type'][_0x2c42('0x43')]};});_0x4cee71[_0x2c42('0x44')]=_[_0x2c42('0x40')](_0x33665d,_0x2c42('0x39'));_0x4cee71[_0x2c42('0x45')]=_['keys'](_0x16ce75[_0x2c42('0x45')]);_0x4cee71[_0x2c42('0x46')]=_['intersection'](_0x4cee71['model'],_0x4cee71[_0x2c42('0x45')]);_0x24be4f[_0x2c42('0x47')]=_[_0x2c42('0x48')](_0x4cee71[_0x2c42('0x44')],qs[_0x2c42('0x49')](_0x16ce75[_0x2c42('0x45')][_0x2c42('0x49')]));_0x24be4f[_0x2c42('0x47')]=_0x24be4f[_0x2c42('0x47')][_0x2c42('0x4a')]?_0x24be4f[_0x2c42('0x47')]:_0x4cee71['model'];if(!_0x16ce75[_0x2c42('0x45')][_0x2c42('0x4b')]('nolimit')){_0x24be4f[_0x2c42('0x2f')]=qs[_0x2c42('0x2f')](_0x16ce75[_0x2c42('0x45')][_0x2c42('0x2f')]);_0x24be4f[_0x2c42('0x2e')]=qs[_0x2c42('0x2e')](_0x16ce75[_0x2c42('0x45')][_0x2c42('0x2e')]);}_0x24be4f[_0x2c42('0x4c')]=qs[_0x2c42('0x4d')](_0x16ce75[_0x2c42('0x45')][_0x2c42('0x4d')]);_0x24be4f[_0x2c42('0x4e')]=qs[_0x2c42('0x46')](_[_0x2c42('0x4f')](_0x16ce75[_0x2c42('0x45')],_0x4cee71[_0x2c42('0x46')]),_0x33665d);if(_0x16ce75[_0x2c42('0x45')]['filter']){_0x24be4f[_0x2c42('0x4e')]=_['merge'](_0x24be4f[_0x2c42('0x4e')],{'$or':_[_0x2c42('0x40')](_0x33665d,function(_0x1eb6ff){if(_0x1eb6ff[_0x2c42('0x50')]!==_0x2c42('0x51')){var _0x19c3c2={};_0x19c3c2[_0x1eb6ff[_0x2c42('0x39')]]={'$like':'%'+_0x16ce75['query'][_0x2c42('0x52')]+'%'};return _0x19c3c2;}})});}_0x24be4f=_['merge']({},_0x24be4f,_0x16ce75['options']);var _0x5b372f={'where':_0x24be4f['where']};return db['MailAccount']['count'](_0x5b372f)['then'](function(_0x5f4ded){_0x20edab[_0x2c42('0x53')]=_0x5f4ded;if(_0x16ce75[_0x2c42('0x45')]['includeAll']){_0x24be4f[_0x2c42('0x54')]=[{'all':!![]}];}return db[_0x2c42('0x55')]['findAll'](_0x24be4f);})[_0x2c42('0x20')](function(_0x2df978){_0x20edab['rows']=_0x2df978;return _0x20edab;})[_0x2c42('0x20')](respondWithFilteredResult(_0x3bdbea,_0x24be4f))[_0x2c42('0x2b')](handleError(_0x3bdbea,null));};exports[_0x2c42('0x56')]=function(_0x23fee9,_0x8f1561){var _0x56dcef={'raw':![],'where':{'id':_0x23fee9['params']['id']},'include':[{'model':db[_0x2c42('0x3b')],'as':_0x2c42('0x3c')},{'model':db[_0x2c42('0x3d')],'as':_0x2c42('0x3e')},{'model':db[_0x2c42('0x57')],'as':_0x2c42('0x3f')}]},_0x4edb4e={};_0x4edb4e[_0x2c42('0x44')]=_[_0x2c42('0x58')](db[_0x2c42('0x55')][_0x2c42('0x41')]);_0x4edb4e[_0x2c42('0x45')]=_[_0x2c42('0x58')](_0x23fee9[_0x2c42('0x45')]);_0x4edb4e[_0x2c42('0x46')]=_[_0x2c42('0x48')](_0x4edb4e[_0x2c42('0x44')],_0x4edb4e[_0x2c42('0x45')]);_0x56dcef[_0x2c42('0x47')]=_[_0x2c42('0x48')](_0x4edb4e[_0x2c42('0x44')],qs[_0x2c42('0x49')](_0x23fee9['query'][_0x2c42('0x49')]));_0x56dcef[_0x2c42('0x47')]=_0x56dcef[_0x2c42('0x47')][_0x2c42('0x4a')]?_0x56dcef['attributes']:_0x4edb4e[_0x2c42('0x44')];if(_0x23fee9[_0x2c42('0x45')]['includeAll']){_0x56dcef['include']=[{'all':!![]}];}_0x56dcef=_['merge']({},_0x56dcef,_0x23fee9[_0x2c42('0x59')]);return db[_0x2c42('0x55')][_0x2c42('0x5a')](_0x56dcef)[_0x2c42('0x20')](handleEntityNotFound(_0x8f1561,null))[_0x2c42('0x20')](respondWithResult(_0x8f1561,null))[_0x2c42('0x2b')](handleError(_0x8f1561,null));};exports[_0x2c42('0x33')]=function(_0x100291,_0x46558b){if(_0x100291['body']['id']){delete _0x100291[_0x2c42('0x5b')]['id'];}return db['MailAccount'][_0x2c42('0x5a')]({'where':{'id':_0x100291['params']['id']},'include':[{'model':db[_0x2c42('0x3b')],'as':_0x2c42('0x3c')},{'model':db[_0x2c42('0x3d')],'as':_0x2c42('0x3e')},{'model':db[_0x2c42('0x57')],'as':_0x2c42('0x3f')}]})[_0x2c42('0x20')](handleEntityNotFound(_0x46558b,null))[_0x2c42('0x20')](saveUpdates(_0x100291[_0x2c42('0x5b')],null))[_0x2c42('0x20')](function(_0x184931){if(_0x184931&&_0x100291['body']['Imap']){return db[_0x2c42('0x3b')]['update'](_0x100291[_0x2c42('0x5b')][_0x2c42('0x3c')],{'where':{'MailAccountId':_0x184931['id']}})[_0x2c42('0x20')](function(){return _0x184931;});}return _0x184931;})[_0x2c42('0x20')](function(_0x8ff983){if(_0x8ff983&&_0x100291[_0x2c42('0x5b')]['Smtp']){return db[_0x2c42('0x3d')][_0x2c42('0x33')](_0x100291['body'][_0x2c42('0x3e')],{'where':{'MailAccountId':_0x8ff983['id']}})[_0x2c42('0x20')](function(){return _0x8ff983;});}return _0x8ff983;})[_0x2c42('0x20')](respondWithResult(_0x46558b,null))[_0x2c42('0x2b')](handleError(_0x46558b,null));};exports[_0x2c42('0x5c')]=function(_0x54f164,_0x2dbc3d){return db[_0x2c42('0x55')]['describe']()[_0x2c42('0x20')](respondWithResult(_0x2dbc3d,null))[_0x2c42('0x2b')](handleError(_0x2dbc3d,null));};exports['addDisposition']=function(_0x56916e,_0x4dd41c,_0x4f6301){if(_0x56916e[_0x2c42('0x5b')]['id']){delete _0x56916e[_0x2c42('0x5b')]['id'];}return db['MailAccount'][_0x2c42('0x5a')]({'where':{'id':_0x56916e[_0x2c42('0x5d')]['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x4dd41c,null))[_0x2c42('0x20')](function(_0x3c2f6f){if(_0x3c2f6f){_0x56916e[_0x2c42('0x5b')][_0x2c42('0x5e')]=_0x3c2f6f['id'];return db[_0x2c42('0x5f')][_0x2c42('0x60')](_0x56916e[_0x2c42('0x5b')]);}})[_0x2c42('0x20')](respondWithResult(_0x4dd41c,null))[_0x2c42('0x2b')](handleError(_0x4dd41c,null));};exports[_0x2c42('0x61')]=function(_0x1f72f0,_0x1112ee,_0x27b2e1){var _0x37b91e={'raw':![],'where':{}};var _0x11bff0={};var _0x22fc18={'count':0x0,'rows':[]};return db[_0x2c42('0x55')][_0x2c42('0x62')]({'where':{'id':_0x1f72f0[_0x2c42('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1112ee,null))[_0x2c42('0x20')](function(_0x3b106e){if(_0x3b106e){_0x11bff0[_0x2c42('0x44')]=_[_0x2c42('0x58')](db['Disposition'][_0x2c42('0x41')]);_0x11bff0['query']=_[_0x2c42('0x58')](_0x1f72f0[_0x2c42('0x45')]);_0x11bff0['filters']=_[_0x2c42('0x48')](_0x11bff0[_0x2c42('0x44')],_0x11bff0[_0x2c42('0x45')]);_0x37b91e[_0x2c42('0x47')]=_[_0x2c42('0x48')](_0x11bff0[_0x2c42('0x44')],qs[_0x2c42('0x49')](_0x1f72f0[_0x2c42('0x45')][_0x2c42('0x49')]));_0x37b91e[_0x2c42('0x47')]=_0x37b91e[_0x2c42('0x47')][_0x2c42('0x4a')]?_0x37b91e['attributes']:_0x11bff0[_0x2c42('0x44')];if(!_0x1f72f0['query']['hasOwnProperty'](_0x2c42('0x63'))){_0x37b91e[_0x2c42('0x2f')]=qs['limit'](_0x1f72f0[_0x2c42('0x45')][_0x2c42('0x2f')]);_0x37b91e[_0x2c42('0x2e')]=qs[_0x2c42('0x2e')](_0x1f72f0[_0x2c42('0x45')][_0x2c42('0x2e')]);}_0x37b91e[_0x2c42('0x4c')]=qs[_0x2c42('0x4d')](_0x1f72f0[_0x2c42('0x45')][_0x2c42('0x4d')]);_0x37b91e[_0x2c42('0x4e')]=qs[_0x2c42('0x46')](_[_0x2c42('0x4f')](_0x1f72f0['query'],_0x11bff0[_0x2c42('0x46')]));_0x37b91e[_0x2c42('0x4e')]['MailAccountId']=_0x3b106e['id'];if(_0x1f72f0[_0x2c42('0x45')]['filter']){_0x37b91e[_0x2c42('0x4e')]=_[_0x2c42('0x64')](_0x37b91e['where'],{'$or':_[_0x2c42('0x40')](_0x37b91e['attributes'],function(_0x482c50){var _0x4d035c={};_0x4d035c[_0x482c50]={'$like':'%'+_0x1f72f0[_0x2c42('0x45')][_0x2c42('0x52')]+'%'};return _0x4d035c;})});}_0x37b91e=_['merge']({},_0x37b91e,_0x1f72f0[_0x2c42('0x59')]);return db['Disposition'][_0x2c42('0x53')]({'where':_0x37b91e[_0x2c42('0x4e')]})[_0x2c42('0x20')](function(_0x3b2058){_0x22fc18['count']=_0x3b2058;if(_0x1f72f0['query']['includeAll']){_0x37b91e[_0x2c42('0x54')]=[{'all':!![]}];}return db[_0x2c42('0x5f')][_0x2c42('0x65')](_0x37b91e);})[_0x2c42('0x20')](function(_0x6666a4){_0x22fc18['rows']=_0x6666a4;return _0x22fc18;});}})[_0x2c42('0x20')](respondWithFilteredResult(_0x1112ee,_0x37b91e))[_0x2c42('0x2b')](handleError(_0x1112ee,null));};exports[_0x2c42('0x66')]=function(_0x3a491a,_0x4764e0,_0x5cd76f){return db[_0x2c42('0x55')][_0x2c42('0x5a')]({'where':{'id':_0x3a491a['params']['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x4764e0,null))[_0x2c42('0x20')](function(_0x34e79c){if(_0x34e79c){return _0x34e79c[_0x2c42('0x66')](_0x3a491a[_0x2c42('0x45')][_0x2c42('0x67')]);}})[_0x2c42('0x20')](respondWithStatusCode(_0x4764e0,null))['catch'](handleError(_0x4764e0,null));};exports[_0x2c42('0x68')]=function(_0x21366a,_0x357552,_0x40d69a){if(_0x21366a[_0x2c42('0x5b')]['id']){delete _0x21366a[_0x2c42('0x5b')]['id'];}return db[_0x2c42('0x55')]['find']({'where':{'id':_0x21366a[_0x2c42('0x5d')]['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x357552,null))[_0x2c42('0x20')](function(_0x31c8e9){if(_0x31c8e9){_0x21366a[_0x2c42('0x5b')][_0x2c42('0x5e')]=_0x31c8e9['id'];return db[_0x2c42('0x69')][_0x2c42('0x60')](_0x21366a[_0x2c42('0x5b')]);}})[_0x2c42('0x20')](respondWithResult(_0x357552,null))[_0x2c42('0x2b')](handleError(_0x357552,null));};exports[_0x2c42('0x6a')]=function(_0x551893,_0x3fc257,_0x244c97){var _0x2482fa={'raw':![],'where':{}};var _0x434738={};var _0x312c19={'count':0x0,'rows':[]};return db[_0x2c42('0x55')][_0x2c42('0x62')]({'where':{'id':_0x551893['params']['id']}})['then'](handleEntityNotFound(_0x3fc257,null))[_0x2c42('0x20')](function(_0x1339ac){if(_0x1339ac){_0x434738['model']=_[_0x2c42('0x58')](db[_0x2c42('0x69')][_0x2c42('0x41')]);_0x434738['query']=_[_0x2c42('0x58')](_0x551893[_0x2c42('0x45')]);_0x434738[_0x2c42('0x46')]=_[_0x2c42('0x48')](_0x434738[_0x2c42('0x44')],_0x434738[_0x2c42('0x45')]);_0x2482fa[_0x2c42('0x47')]=_[_0x2c42('0x48')](_0x434738[_0x2c42('0x44')],qs[_0x2c42('0x49')](_0x551893[_0x2c42('0x45')]['fields']));_0x2482fa[_0x2c42('0x47')]=_0x2482fa[_0x2c42('0x47')][_0x2c42('0x4a')]?_0x2482fa[_0x2c42('0x47')]:_0x434738[_0x2c42('0x44')];if(!_0x551893['query'][_0x2c42('0x4b')](_0x2c42('0x63'))){_0x2482fa[_0x2c42('0x2f')]=qs[_0x2c42('0x2f')](_0x551893[_0x2c42('0x45')][_0x2c42('0x2f')]);_0x2482fa[_0x2c42('0x2e')]=qs[_0x2c42('0x2e')](_0x551893[_0x2c42('0x45')]['offset']);}_0x2482fa[_0x2c42('0x4c')]=qs[_0x2c42('0x4d')](_0x551893[_0x2c42('0x45')][_0x2c42('0x4d')]);_0x2482fa['where']=qs[_0x2c42('0x46')](_['pick'](_0x551893[_0x2c42('0x45')],_0x434738['filters']));_0x2482fa['where'][_0x2c42('0x5e')]=_0x1339ac['id'];if(_0x551893[_0x2c42('0x45')][_0x2c42('0x52')]){_0x2482fa[_0x2c42('0x4e')]=_['merge'](_0x2482fa[_0x2c42('0x4e')],{'$or':_[_0x2c42('0x40')](_0x2482fa[_0x2c42('0x47')],function(_0x1c8cb8){var _0x4c175b={};_0x4c175b[_0x1c8cb8]={'$like':'%'+_0x551893[_0x2c42('0x45')][_0x2c42('0x52')]+'%'};return _0x4c175b;})});}_0x2482fa=_[_0x2c42('0x64')]({},_0x2482fa,_0x551893[_0x2c42('0x59')]);return db[_0x2c42('0x69')][_0x2c42('0x53')]({'where':_0x2482fa[_0x2c42('0x4e')]})['then'](function(_0x539f22){_0x312c19[_0x2c42('0x53')]=_0x539f22;if(_0x551893[_0x2c42('0x45')][_0x2c42('0x6b')]){_0x2482fa[_0x2c42('0x54')]=[{'all':!![]}];}return db[_0x2c42('0x69')][_0x2c42('0x65')](_0x2482fa);})[_0x2c42('0x20')](function(_0x514288){_0x312c19[_0x2c42('0x6c')]=_0x514288;return _0x312c19;});}})['then'](respondWithFilteredResult(_0x3fc257,_0x2482fa))[_0x2c42('0x2b')](handleError(_0x3fc257,null));};exports['removeAnswers']=function(_0x43c0f5,_0x4fa797,_0x2143e7){return db[_0x2c42('0x55')][_0x2c42('0x5a')]({'where':{'id':_0x43c0f5[_0x2c42('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4fa797,null))[_0x2c42('0x20')](function(_0x17d8fc){if(_0x17d8fc){return _0x17d8fc['removeAnswers'](_0x43c0f5['query'][_0x2c42('0x67')]);}})[_0x2c42('0x20')](respondWithStatusCode(_0x4fa797,null))[_0x2c42('0x2b')](handleError(_0x4fa797,null));};exports['create']=function(_0x1641bc,_0x59e0bb){var _0x24f9b2={'name':_0x1641bc[_0x2c42('0x5b')][_0x2c42('0x39')],'key':_0x1641bc[_0x2c42('0x5b')][_0x2c42('0x43')],'email':_0x1641bc[_0x2c42('0x5b')][_0x2c42('0x6d')],'ListId':_0x1641bc['body'][_0x2c42('0x6e')],'active':!_[_0x2c42('0x6f')](_0x1641bc[_0x2c42('0x5b')][_0x2c42('0x70')])?_0x1641bc[_0x2c42('0x5b')][_0x2c42('0x70')]:!![],'description':_0x1641bc['body']['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x1641bc['body']['cservice'])){if(_0x1641bc[_0x2c42('0x5b')]['cauthentication']){_0x24f9b2[_0x2c42('0x3c')][_0x2c42('0x71')]=_0x24f9b2[_0x2c42('0x3e')][_0x2c42('0x71')]=_0x1641bc['body'][_0x2c42('0x72')];_0x24f9b2[_0x2c42('0x3c')]['password']=_0x24f9b2[_0x2c42('0x3e')]['pass']=_0x1641bc[_0x2c42('0x5b')]['cpassword'];}else{_0x24f9b2[_0x2c42('0x3c')]['authentication']=_0x24f9b2['Smtp']['authentication']=![];}_0x24f9b2['Imap'][_0x2c42('0x73')]=_0x1641bc[_0x2c42('0x5b')][_0x2c42('0x3c')][_0x2c42('0x73')];_0x24f9b2['Imap']['port']=_0x1641bc['body'][_0x2c42('0x3c')]['port'];_0x24f9b2[_0x2c42('0x3e')]['host']=_0x1641bc['body'][_0x2c42('0x3e')][_0x2c42('0x73')];_0x24f9b2[_0x2c42('0x3e')]['port']=_0x1641bc[_0x2c42('0x5b')]['Smtp'][_0x2c42('0x74')];}else{_0x24f9b2[_0x2c42('0x3c')]['service']=_0x24f9b2[_0x2c42('0x3e')]['service']=_0x1641bc['body'][_0x2c42('0x75')];_0x24f9b2['Imap'][_0x2c42('0x71')]=_0x24f9b2[_0x2c42('0x3e')][_0x2c42('0x71')]=_0x1641bc[_0x2c42('0x5b')][_0x2c42('0x72')];_0x24f9b2[_0x2c42('0x3c')][_0x2c42('0x76')]=_0x24f9b2[_0x2c42('0x3e')]['pass']=_0x1641bc['body'][_0x2c42('0x77')];}return db['MailAccount'][_0x2c42('0x60')](_0x24f9b2,{'include':[{'model':db[_0x2c42('0x3d')],'as':_0x2c42('0x3e')},{'model':db[_0x2c42('0x3b')],'as':'Imap'}]})[_0x2c42('0x20')](function(_0x48c5fd){var _0x2615fb=_0x1641bc[_0x2c42('0x71')]['get']({'plain':!![]});if(!_0x2615fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2615fb[_0x2c42('0x78')]===_0x2c42('0x71')){var _0x2db5bb=_0x48c5fd[_0x2c42('0x35')]({'plain':!![]});return db[_0x2c42('0x79')][_0x2c42('0x5a')]({'where':{'name':_0x2c42('0x7a'),'userProfileId':_0x2615fb[_0x2c42('0x7b')]},'raw':!![]})[_0x2c42('0x20')](function(_0x295734){if(_0x295734&&_0x295734[_0x2c42('0x7c')]===0x0){return db[_0x2c42('0x36')][_0x2c42('0x60')]({'name':_0x2db5bb[_0x2c42('0x39')],'resourceId':_0x2db5bb['id'],'type':_0x295734[_0x2c42('0x39')],'sectionId':_0x295734['id']},{})[_0x2c42('0x20')](function(){return _0x48c5fd;});}else{return _0x48c5fd;}})['catch'](function(_0x4eb8ab){logger['error'](_0x2c42('0x7d'),_0x4eb8ab);throw _0x4eb8ab;});}return _0x48c5fd;})['then'](respondWithResult(_0x59e0bb,0xc9))[_0x2c42('0x2b')](handleError(_0x59e0bb,null));};exports[_0x2c42('0x7e')]=function(_0x1f81da,_0x239a94,_0x1cc65e){return db[_0x2c42('0x55')][_0x2c42('0x62')]({'where':{'id':_0x1f81da['params']['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x239a94,null))[_0x2c42('0x20')](function(_0xd0f084){if(_0xd0f084){return _0xd0f084['getImap']();}return null;})['then'](respondWithResult(_0x239a94,null))[_0x2c42('0x2b')](handleError(_0x239a94,null));};exports['addImap']=function(_0x59acfa,_0xd02b7e,_0x154e28){if(_0x59acfa['body']['id']){delete _0x59acfa[_0x2c42('0x5b')]['id'];}return db[_0x2c42('0x55')][_0x2c42('0x5a')]({'where':{'id':_0x59acfa[_0x2c42('0x5d')]['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0xd02b7e,null))[_0x2c42('0x20')](function(_0x203b39){if(_0x203b39){_0x59acfa[_0x2c42('0x5b')]['MailAccountId']=_0x203b39['id'];return db[_0x2c42('0x3b')][_0x2c42('0x60')](_0x59acfa[_0x2c42('0x5b')]);}})['then'](respondWithResult(_0xd02b7e,null))['catch'](handleError(_0xd02b7e,null));};exports[_0x2c42('0x7f')]=function(_0xef5c96,_0x127037,_0xe11584){return db['MailAccount'][_0x2c42('0x62')]({'where':{'id':_0xef5c96[_0x2c42('0x5d')]['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x127037,null))[_0x2c42('0x20')](function(_0x273cae){if(_0x273cae){return _0x273cae['setImap'](null);}return null;})[_0x2c42('0x20')](respondWithStatusCode(_0x127037,null))['catch'](handleError(_0x127037,null));};exports['getSmtp']=function(_0x5d5526,_0x4416b1,_0x3c0da1){return db[_0x2c42('0x55')][_0x2c42('0x62')]({'where':{'id':_0x5d5526['params']['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x4416b1,null))[_0x2c42('0x20')](function(_0x4ebeb0){if(_0x4ebeb0){return _0x4ebeb0['getSmtp']();}return null;})['then'](respondWithResult(_0x4416b1,null))['catch'](handleError(_0x4416b1,null));};exports[_0x2c42('0x80')]=function(_0x550db0,_0x3cd3b8,_0x375cc9){if(_0x550db0[_0x2c42('0x5b')]['id']){delete _0x550db0[_0x2c42('0x5b')]['id'];}return db['MailAccount'][_0x2c42('0x5a')]({'where':{'id':_0x550db0[_0x2c42('0x5d')]['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x3cd3b8,null))[_0x2c42('0x20')](function(_0x311ffb){if(_0x311ffb){_0x550db0['body'][_0x2c42('0x5e')]=_0x311ffb['id'];return db['MailServerOut'][_0x2c42('0x60')](_0x550db0[_0x2c42('0x5b')]);}})[_0x2c42('0x20')](respondWithResult(_0x3cd3b8,null))[_0x2c42('0x2b')](handleError(_0x3cd3b8,null));};exports[_0x2c42('0x81')]=function(_0x2eb875,_0x2932f5,_0x3a3086){return db[_0x2c42('0x55')][_0x2c42('0x62')]({'where':{'id':_0x2eb875[_0x2c42('0x5d')]['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x2932f5,null))[_0x2c42('0x20')](function(_0x5d1027){if(_0x5d1027){return _0x5d1027[_0x2c42('0x82')](null);}return null;})[_0x2c42('0x20')](respondWithStatusCode(_0x2932f5,null))[_0x2c42('0x2b')](handleError(_0x2932f5,null));};exports[_0x2c42('0x83')]=function(_0x242cde,_0x54d128,_0x16c0c9){return db[_0x2c42('0x84')][_0x2c42('0x5a')]({'where':{'id':_0x242cde[_0x2c42('0x5d')]['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x54d128,null))[_0x2c42('0x20')](function(_0x2faebb){if(_0x2faebb){return _0x2faebb[_0x2c42('0x83')](_0x242cde[_0x2c42('0x5b')]['ids'],_[_0x2c42('0x85')](_0x242cde[_0x2c42('0x5b')],['ids','id'])||{});}})[_0x2c42('0x20')](respondWithResult(_0x54d128,null))[_0x2c42('0x2b')](handleError(_0x54d128,null));};exports[_0x2c42('0x86')]=function(_0x4269c1,_0x3b5ffe,_0x2136a7){var _0x1ed2fb={'raw':![],'where':{}};var _0x206cd2={};var _0x1069dd={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x4269c1['params']['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x3b5ffe,null))[_0x2c42('0x20')](function(_0x55450a){if(_0x55450a){_0x206cd2[_0x2c42('0x44')]=_[_0x2c42('0x58')](db['MailInteraction'][_0x2c42('0x41')]);_0x206cd2['query']=_[_0x2c42('0x58')](_0x4269c1[_0x2c42('0x45')]);_0x206cd2[_0x2c42('0x46')]=_[_0x2c42('0x48')](_0x206cd2['model'],_0x206cd2[_0x2c42('0x45')]);_0x1ed2fb['attributes']=_['intersection'](_0x206cd2[_0x2c42('0x44')],qs[_0x2c42('0x49')](_0x4269c1[_0x2c42('0x45')][_0x2c42('0x49')]));_0x1ed2fb[_0x2c42('0x47')]=_0x1ed2fb[_0x2c42('0x47')][_0x2c42('0x4a')]?_0x1ed2fb['attributes']:_0x206cd2[_0x2c42('0x44')];if(!_0x4269c1[_0x2c42('0x45')][_0x2c42('0x4b')](_0x2c42('0x63'))){_0x1ed2fb['limit']=qs[_0x2c42('0x2f')](_0x4269c1['query'][_0x2c42('0x2f')]);_0x1ed2fb[_0x2c42('0x2e')]=qs[_0x2c42('0x2e')](_0x4269c1[_0x2c42('0x45')][_0x2c42('0x2e')]);}_0x1ed2fb[_0x2c42('0x4c')]=qs[_0x2c42('0x4d')](_0x4269c1[_0x2c42('0x45')][_0x2c42('0x4d')]);_0x1ed2fb['where']=qs[_0x2c42('0x46')](_[_0x2c42('0x4f')](_0x4269c1[_0x2c42('0x45')],_0x206cd2[_0x2c42('0x46')]));_0x1ed2fb['where'][_0x2c42('0x5e')]=_0x55450a['id'];if(_0x4269c1[_0x2c42('0x45')][_0x2c42('0x52')]){_0x1ed2fb[_0x2c42('0x4e')]=_['merge'](_0x1ed2fb[_0x2c42('0x4e')],{'$or':_['map'](_0x1ed2fb[_0x2c42('0x47')],function(_0x57c537){var _0x1e4977={};_0x1e4977[_0x57c537]={'$like':'%'+_0x4269c1[_0x2c42('0x45')]['filter']+'%'};return _0x1e4977;})});}_0x1ed2fb=_['merge']({},_0x1ed2fb,_0x4269c1[_0x2c42('0x59')]);return db['MailInteraction']['count']({'where':_0x1ed2fb['where']})[_0x2c42('0x20')](function(_0x1fa9dc){_0x1069dd[_0x2c42('0x53')]=_0x1fa9dc;if(_0x4269c1[_0x2c42('0x45')]['includeAll']){_0x1ed2fb[_0x2c42('0x54')]=[{'model':db[_0x2c42('0x87')],'as':_0x2c42('0x88'),'required':![]},{'model':db[_0x2c42('0x89')],'as':_0x2c42('0x8a'),'attributes':[_0x2c42('0x39'),_0x2c42('0x8b'),'internal'],'required':![]},{'model':db[_0x2c42('0x8c')],'as':'Tags','attributes':['id','name',_0x2c42('0x8d')],'where':_0x4269c1[_0x2c42('0x45')]['tag']?{'id':_0x4269c1[_0x2c42('0x45')][_0x2c42('0x8e')]}:undefined,'required':_0x4269c1[_0x2c42('0x45')][_0x2c42('0x8e')]?!![]:![]}];}return db['MailInteraction'][_0x2c42('0x65')](_0x1ed2fb);})[_0x2c42('0x20')](function(_0x195e68){_0x1069dd[_0x2c42('0x6c')]=_0x195e68;return _0x1069dd;});}})['then'](respondWithFilteredResult(_0x3b5ffe,_0x1ed2fb))[_0x2c42('0x2b')](handleError(_0x3b5ffe,null));};exports[_0x2c42('0x8f')]=function(_0x382dfa,_0x1a056b,_0x24a02c){return db[_0x2c42('0x55')][_0x2c42('0x62')]({'where':{'id':_0x382dfa[_0x2c42('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1a056b,null))[_0x2c42('0x20')](function(_0x21a370){if(_0x21a370){return db[_0x2c42('0x90')][_0x2c42('0x91')](function(_0x3d4577){return db['MailApplication'][_0x2c42('0x34')]({'where':{'MailAccountId':_0x382dfa[_0x2c42('0x5d')]['id']},'transaction':_0x3d4577})[_0x2c42('0x20')](function(_0x4f08c9){var _0x23d949=_[_0x2c42('0x40')](_0x382dfa[_0x2c42('0x5b')],function(_0x488462){_0x488462[_0x2c42('0x5e')]=_0x382dfa[_0x2c42('0x5d')]['id'];return _0x488462;});return db[_0x2c42('0x92')]['bulkCreate'](_0x23d949,{'transaction':_0x3d4577});});})['then'](function(){return db[_0x2c42('0x92')][_0x2c42('0x93')]({'where':{'MailAccountId':_0x382dfa[_0x2c42('0x5d')]['id']},'order':_0x2c42('0x94')});});}})['then'](respondWithResult(_0x1a056b,null))[_0x2c42('0x2b')](handleError(_0x1a056b,null));};exports['getApplications']=function(_0x4506d5,_0x5823ed,_0x246f37){var _0x217b99={};var _0x37ed45={};var _0x30fc4d;var _0x1a7e45;return db['MailAccount'][_0x2c42('0x62')]({'where':{'id':_0x4506d5[_0x2c42('0x5d')]['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x5823ed,null))[_0x2c42('0x20')](function(_0x126aaa){if(_0x126aaa){_0x30fc4d=_0x126aaa;_0x37ed45['model']=_['keys'](db[_0x2c42('0x92')][_0x2c42('0x41')]);_0x37ed45[_0x2c42('0x45')]=_[_0x2c42('0x58')](_0x4506d5[_0x2c42('0x45')]);_0x37ed45[_0x2c42('0x46')]=_[_0x2c42('0x48')](_0x37ed45[_0x2c42('0x44')],_0x37ed45[_0x2c42('0x45')]);_0x217b99[_0x2c42('0x47')]=_[_0x2c42('0x48')](_0x37ed45['model'],qs['fields'](_0x4506d5['query'][_0x2c42('0x49')]));_0x217b99[_0x2c42('0x47')]=_0x217b99[_0x2c42('0x47')]['length']?_0x217b99[_0x2c42('0x47')]:_0x37ed45[_0x2c42('0x44')];_0x217b99[_0x2c42('0x4c')]=qs['sort'](_0x4506d5[_0x2c42('0x45')][_0x2c42('0x4d')]);_0x217b99[_0x2c42('0x4e')]=qs[_0x2c42('0x46')](_[_0x2c42('0x4f')](_0x4506d5['query'],_0x37ed45[_0x2c42('0x46')]));if(_0x4506d5[_0x2c42('0x45')]['filter']){_0x217b99[_0x2c42('0x4e')]=_['merge'](_0x217b99[_0x2c42('0x4e')],{'$or':_[_0x2c42('0x40')](_0x217b99[_0x2c42('0x47')],function(_0x5a5f35){var _0x3fef49={};_0x3fef49[_0x5a5f35]={'$like':'%'+_0x4506d5[_0x2c42('0x45')]['filter']+'%'};return _0x3fef49;})});}_0x217b99=_[_0x2c42('0x64')]({},_0x217b99,_0x4506d5[_0x2c42('0x59')]);return _0x30fc4d[_0x2c42('0x95')](_0x217b99);}})[_0x2c42('0x20')](function(_0x3e8161){if(_0x3e8161){_0x1a7e45=_0x3e8161['length'];if(!_0x4506d5[_0x2c42('0x45')][_0x2c42('0x4b')]('nolimit')){_0x217b99[_0x2c42('0x2f')]=qs[_0x2c42('0x2f')](_0x4506d5[_0x2c42('0x45')][_0x2c42('0x2f')]);_0x217b99[_0x2c42('0x2e')]=qs[_0x2c42('0x2e')](_0x4506d5[_0x2c42('0x45')][_0x2c42('0x2e')]);}return _0x30fc4d['getApplications'](_0x217b99);}})[_0x2c42('0x20')](function(_0x3468e1){if(_0x3468e1){return _0x3468e1?{'count':_0x1a7e45,'rows':_0x3468e1}:null;}})['then'](respondWithResult(_0x5823ed,null))[_0x2c42('0x2b')](handleError(_0x5823ed,null));};exports['getMessages']=function(_0xfa6697,_0x5a14f2,_0x485be8){var _0x19e1ea={'raw':!![],'where':{}};var _0x286dcb={};var _0x1a58c2={'count':0x0,'rows':[]};return db[_0x2c42('0x55')][_0x2c42('0x62')]({'where':{'id':_0xfa6697[_0x2c42('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5a14f2,null))[_0x2c42('0x20')](function(_0x5bf734){if(_0x5bf734){_0x286dcb[_0x2c42('0x44')]=_[_0x2c42('0x58')](db[_0x2c42('0x96')][_0x2c42('0x41')]);_0x286dcb[_0x2c42('0x45')]=_[_0x2c42('0x58')](_0xfa6697[_0x2c42('0x45')]);_0x286dcb[_0x2c42('0x46')]=_[_0x2c42('0x48')](_0x286dcb['model'],_0x286dcb[_0x2c42('0x45')]);_0x19e1ea['attributes']=_['intersection'](_0x286dcb[_0x2c42('0x44')],qs[_0x2c42('0x49')](_0xfa6697[_0x2c42('0x45')][_0x2c42('0x49')]));_0x19e1ea['attributes']=_0x19e1ea[_0x2c42('0x47')][_0x2c42('0x4a')]?_0x19e1ea[_0x2c42('0x47')]:_0x286dcb[_0x2c42('0x44')];if(!_0xfa6697[_0x2c42('0x45')]['hasOwnProperty'](_0x2c42('0x63'))){_0x19e1ea[_0x2c42('0x2f')]=qs[_0x2c42('0x2f')](_0xfa6697[_0x2c42('0x45')][_0x2c42('0x2f')]);_0x19e1ea[_0x2c42('0x2e')]=qs['offset'](_0xfa6697[_0x2c42('0x45')]['offset']);}_0x19e1ea[_0x2c42('0x4c')]=qs[_0x2c42('0x4d')](_0xfa6697['query']['sort']);_0x19e1ea[_0x2c42('0x4e')]=qs[_0x2c42('0x46')](_[_0x2c42('0x4f')](_0xfa6697['query'],_0x286dcb[_0x2c42('0x46')]));_0x19e1ea[_0x2c42('0x4e')][_0x2c42('0x5e')]=_0x5bf734['id'];if(_0xfa6697[_0x2c42('0x45')][_0x2c42('0x52')]){_0x19e1ea[_0x2c42('0x4e')]=_[_0x2c42('0x64')](_0x19e1ea['where'],{'$or':_['map'](_0x19e1ea[_0x2c42('0x47')],function(_0x14e75b){var _0x5611d1={};_0x5611d1[_0x14e75b]={'$like':'%'+_0xfa6697[_0x2c42('0x45')][_0x2c42('0x52')]+'%'};return _0x5611d1;})});}if(_0xfa6697['query']['$gte']){var _0x5b4264=_0xfa6697[_0x2c42('0x45')]['$gte'][_0x2c42('0x97')](',');var _0x5f50bb={};_0x5f50bb[_0x5b4264[0x0]]={'$gte':moment(_0x5b4264[0x1])[_0x2c42('0x98')]('YYYY-MM-DD\x20HH:mm:ss')};_0x19e1ea[_0x2c42('0x4e')]=_['merge'](_0x19e1ea['where'],_0x5f50bb);}_0x19e1ea=_['merge']({},_0x19e1ea,_0xfa6697['options']);return db['MailMessage'][_0x2c42('0x53')]({'where':_0x19e1ea[_0x2c42('0x4e')]})[_0x2c42('0x20')](function(_0x4c81d8){_0x1a58c2[_0x2c42('0x53')]=_0x4c81d8;if(_0xfa6697[_0x2c42('0x45')][_0x2c42('0x6b')]){_0x19e1ea[_0x2c42('0x54')]=[{'all':!![]}];}return db[_0x2c42('0x96')][_0x2c42('0x65')](_0x19e1ea);})[_0x2c42('0x20')](function(_0x58d4c6){_0x1a58c2[_0x2c42('0x6c')]=_0x58d4c6;return _0x1a58c2;});}})['then'](respondWithFilteredResult(_0x5a14f2,_0x19e1ea))['catch'](handleError(_0x5a14f2,null));};exports['send']=function(_0x3cdcc4,_0x2cd3fa,_0x1f15a9){var _0x3ad7c3,_0x11bd7d={},_0x254127;if(_0x3cdcc4['body']['to']){_0x254127=_0x3cdcc4[_0x2c42('0x5b')]['to'][_0x2c42('0x97')](',')[0x0];}return db[_0x2c42('0x55')]['find']({'where':{'id':_0x3cdcc4['params']['id']},'include':[{'model':db[_0x2c42('0x99')],'as':_0x2c42('0x9a'),'include':[{'model':db[_0x2c42('0x87')],'as':_0x2c42('0x9b'),'where':{'email':_0x254127},'limit':0x1,'order':[[_0x2c42('0x9c'),_0x2c42('0x9d')]]}]},{'model':db[_0x2c42('0x3d')],'as':_0x2c42('0x3e'),'raw':!![]}]})[_0x2c42('0x20')](handleEntityNotFound(_0x2cd3fa,null))['then'](function(_0x26c9f0){if(_0x26c9f0){_0x3ad7c3=_0x26c9f0;if(_0x26c9f0[_0x2c42('0x3e')]){if(_[_0x2c42('0x6f')](_0x3cdcc4['body'][_0x2c42('0x9e')])){_0x3cdcc4[_0x2c42('0x5b')][_0x2c42('0x9e')]=util[_0x2c42('0x98')](_0x2c42('0x9f'),_0x26c9f0[_0x2c42('0x39')],_0x26c9f0['email']||_0x26c9f0[_0x2c42('0x3e')]['user']);}if(_0x3cdcc4[_0x2c42('0x5b')][_0x2c42('0xa0')]&&_0x3cdcc4[_0x2c42('0x5b')]['attachments'][_0x2c42('0x4a')]){for(var _0x25d55e=0x0;_0x25d55e<_0x3cdcc4[_0x2c42('0x5b')][_0x2c42('0xa0')][_0x2c42('0x4a')];_0x25d55e+=0x1){_0x3cdcc4[_0x2c42('0x5b')]['attachments'][_0x25d55e]={'filename':_0x3cdcc4['body'][_0x2c42('0xa0')][_0x25d55e][_0x2c42('0x39')],'path':path['join'](config['root'],'server/files/attachments',_0x3cdcc4[_0x2c42('0x5b')][_0x2c42('0xa0')][_0x25d55e][_0x2c42('0xa1')])};}}var _0x33782c={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x26c9f0[_0x2c42('0x3e')][_0x2c42('0xa2')])){if(_0x26c9f0[_0x2c42('0x3e')]['authentication']){_0x33782c[_0x2c42('0xa3')]={'user':_0x26c9f0[_0x2c42('0x3e')][_0x2c42('0x71')],'pass':_0x26c9f0['Smtp'][_0x2c42('0xa4')]};}_0x33782c['host']=_0x26c9f0[_0x2c42('0x3e')][_0x2c42('0x73')];_0x33782c[_0x2c42('0x74')]=_0x26c9f0[_0x2c42('0x3e')][_0x2c42('0x74')];_0x33782c[_0x2c42('0xa5')]=_0x26c9f0[_0x2c42('0x3e')][_0x2c42('0xa5')];}else{_0x33782c[_0x2c42('0xa2')]=_0x26c9f0['Smtp'][_0x2c42('0xa2')];_0x33782c[_0x2c42('0xa3')]={'user':_0x26c9f0[_0x2c42('0x3e')]['user'],'pass':_0x26c9f0[_0x2c42('0x3e')]['pass']};}return respondWithRpcPromise('SendMail',_0x2c42('0xa6'),{'account':_0x33782c,'message':_0x3cdcc4[_0x2c42('0x5b')]});}else{throw new Error('List\x20not\x20found');}}})[_0x2c42('0x20')](function(_0x3ba982){if(_0x3ba982){_0x11bd7d=_0x3ba982;if(_0x3ad7c3['List']){if(_0x3ad7c3[_0x2c42('0x9a')][_0x2c42('0x9b')][_0x2c42('0x4a')]){return _0x3ad7c3[_0x2c42('0x9a')][_0x2c42('0x9b')][0x0];}else{return db['CmContact'][_0x2c42('0x60')](_[_0x2c42('0xa7')](_0x3cdcc4[_0x2c42('0x5b')],{'firstName':_0x3cdcc4['body']['to'],'email':_0x3cdcc4[_0x2c42('0x5b')]['to'],'phone':_0x3cdcc4['body']['to'],'ListId':_0x3ad7c3[_0x2c42('0x6e')]}));}}else{throw new Error(_0x2c42('0xa8'));}}})[_0x2c42('0x20')](function(_0x536231){if(_0x536231){var _0x33e422={'UserId':_0x3cdcc4[_0x2c42('0x71')]['id'],'ContactId':_0x536231['id'],'MailAccountId':_0x3ad7c3['id'],'inReplyTo':_0x11bd7d[_0x2c42('0xa9')],'to':_0x3cdcc4[_0x2c42('0x5b')]['from'],'cc':_0x3cdcc4[_0x2c42('0x5b')]['cc'],'subject':_0x3cdcc4[_0x2c42('0x5b')][_0x2c42('0xaa')],'attach':_0x3cdcc4[_0x2c42('0x5b')][_0x2c42('0xab')],'firstMsgDirection':_0x2c42('0xac'),'lastMsgAt':moment()[_0x2c42('0x98')](_0x2c42('0xad')),'lastMsgDirection':_0x2c42('0xac'),'lastMsgBody':_0x3cdcc4[_0x2c42('0x5b')]['body'],'Messages':[_[_0x2c42('0x64')](_0x3cdcc4[_0x2c42('0x5b')],{'messageId':_0x11bd7d[_0x2c42('0xa9')],'sentAt':moment()[_0x2c42('0x98')](_0x2c42('0xad')),'read':!![],'MailAccountId':_0x3ad7c3['id'],'UserId':_0x3cdcc4[_0x2c42('0x71')]['id'],'ContactId':_0x536231['id']})]};if(_0x3cdcc4[_0x2c42('0x5b')]['Interaction']){_0x33e422=_[_0x2c42('0x64')](_0x33e422,_0x3cdcc4[_0x2c42('0x5b')][_0x2c42('0xae')]);}return db[_0x2c42('0x84')][_0x2c42('0x60')](_0x33e422,{'include':[{'model':db[_0x2c42('0x96')],'as':_0x2c42('0xaf')}]});}})['then'](respondWithResult(_0x2cd3fa,null))[_0x2c42('0x2b')](handleError(_0x2cd3fa,null));};exports[_0x2c42('0xb0')]=function(_0xfcf68b,_0x55d8be,_0x769c4){return db[_0x2c42('0x55')][_0x2c42('0x5a')]({'where':{'id':_0xfcf68b[_0x2c42('0x5d')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x2c42('0x3e'),'raw':!![]}]})[_0x2c42('0x20')](handleEntityNotFound(_0x55d8be,null))[_0x2c42('0x20')](function(_0x69c023){if(_0x69c023&&_0x69c023['Smtp']){var _0x36b3ad={'id':_0x69c023['id'],'tls':{'rejectUnauthorized':![]}};if(_0x69c023[_0x2c42('0x3e')][_0x2c42('0xa2')]){_0x36b3ad[_0x2c42('0xa2')]=_0x69c023['Smtp'][_0x2c42('0xa2')];}else{_0x36b3ad[_0x2c42('0x73')]=_0x69c023[_0x2c42('0x3e')][_0x2c42('0x73')];_0x36b3ad['port']=_0x69c023[_0x2c42('0x3e')][_0x2c42('0x74')];_0x36b3ad[_0x2c42('0xa5')]=_0x69c023[_0x2c42('0x3e')][_0x2c42('0xa5')];}if(_0x69c023[_0x2c42('0x3e')][_0x2c42('0xb1')]){_0x36b3ad[_0x2c42('0xa3')]={'user':_0x69c023[_0x2c42('0x3e')][_0x2c42('0x71')],'pass':_0x69c023[_0x2c42('0x3e')][_0x2c42('0xa4')]};}return respondWithRpcPromise('VerifySmtp',_0x2c42('0xb0'),{'account':_0x36b3ad});}})[_0x2c42('0x20')](respondWithResult(_0x55d8be,null))[_0x2c42('0x2b')](handleError(_0x55d8be,null));};exports['destroy']=function(_0x38692b,_0x141946){return db['MailAccount'][_0x2c42('0x5a')]({'where':{'id':_0x38692b[_0x2c42('0x5d')]['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x141946,null))[_0x2c42('0x20')](function(_0x3dfaed){if(_0x3dfaed&&_0x3dfaed[_0x2c42('0xa2')]){throw new db['Sequelize'][(_0x2c42('0x1e'))](_0x2c42('0xb2'));}return _0x3dfaed;})['then'](removeEntity(_0x141946,null))[_0x2c42('0x2b')](handleError(_0x141946,null));};exports['addAgents']=function(_0x222a74,_0x1feaf4,_0x282ed6){return db['MailAccount'][_0x2c42('0x5a')]({'where':{'id':_0x222a74[_0x2c42('0x5d')]['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x1feaf4,null))['then'](function(_0x26ea2d){if(_0x26ea2d){return _0x26ea2d[_0x2c42('0xb3')](_0x222a74[_0x2c42('0x5b')][_0x2c42('0x67')],_[_0x2c42('0x85')](_0x222a74['body'],[_0x2c42('0x67'),'id'])||{})[_0x2c42('0xb4')](function(_0xc852e5){for(var _0xe88fa0=0x0;_0xe88fa0<_0x222a74['body'][_0x2c42('0x67')]['length'];_0xe88fa0+=0x1){socket[_0x2c42('0xb5')](_0x2c42('0xb6'),{'UserId':_0x222a74[_0x2c42('0x5b')][_0x2c42('0x67')][_0xe88fa0],'MailAccountId':_0x222a74[_0x2c42('0x5d')]['id']});}return _0xc852e5;});}})[_0x2c42('0x20')](respondWithResult(_0x1feaf4,null))[_0x2c42('0x2b')](handleError(_0x1feaf4,null));};exports[_0x2c42('0xb7')]=function(_0x249643,_0x233d3f,_0x4619a3){return db['MailAccount'][_0x2c42('0x5a')]({'where':{'id':_0x249643['params']['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x233d3f,null))[_0x2c42('0x20')](function(_0x591773){if(_0x591773){return _0x591773[_0x2c42('0xb7')](_0x249643[_0x2c42('0x45')]['ids'])[_0x2c42('0x20')](function(){if(_[_0x2c42('0xb8')](_0x249643[_0x2c42('0x45')][_0x2c42('0x67')])){for(var _0x24a92c=0x0;_0x24a92c<_0x249643[_0x2c42('0x45')]['ids'][_0x2c42('0x4a')];_0x24a92c+=0x1){socket[_0x2c42('0xb5')]('userMailAccount:remove',{'UserId':Number(_0x249643[_0x2c42('0x45')][_0x2c42('0x67')][_0x24a92c]),'MailAccountId':Number(_0x249643[_0x2c42('0x5d')]['id'])});}}else{socket[_0x2c42('0xb5')](_0x2c42('0xb9'),{'UserId':Number(_0x249643['query'][_0x2c42('0x67')]),'MailAccountId':Number(_0x249643[_0x2c42('0x5d')]['id'])});}});}})[_0x2c42('0x20')](respondWithStatusCode(_0x233d3f,null))[_0x2c42('0x2b')](handleError(_0x233d3f,null));};exports[_0x2c42('0xba')]=function(_0x350b47,_0x2a8839,_0x2e1e7c){var _0x1ac44e={};var _0x8d2a83={};var _0x3b07f9;var _0x34cf43;return db[_0x2c42('0x55')]['findOne']({'where':{'id':_0x350b47[_0x2c42('0x5d')]['id']}})[_0x2c42('0x20')](handleEntityNotFound(_0x2a8839,null))[_0x2c42('0x20')](function(_0xa1065e){if(_0xa1065e){_0x3b07f9=_0xa1065e;_0x8d2a83[_0x2c42('0x44')]=_['keys'](db[_0x2c42('0x89')][_0x2c42('0x41')]);_0x8d2a83[_0x2c42('0x45')]=_['keys'](_0x350b47[_0x2c42('0x45')]);_0x8d2a83['filters']=_['intersection'](_0x8d2a83[_0x2c42('0x44')],_0x8d2a83[_0x2c42('0x45')]);_0x1ac44e[_0x2c42('0x47')]=_[_0x2c42('0x48')](_0x8d2a83[_0x2c42('0x44')],qs[_0x2c42('0x49')](_0x350b47[_0x2c42('0x45')][_0x2c42('0x49')]));_0x1ac44e[_0x2c42('0x47')]=_0x1ac44e[_0x2c42('0x47')][_0x2c42('0x4a')]?_0x1ac44e[_0x2c42('0x47')]:_0x8d2a83['model'];_0x1ac44e[_0x2c42('0x4c')]=qs[_0x2c42('0x4d')](_0x350b47['query'][_0x2c42('0x4d')]);_0x1ac44e[_0x2c42('0x4e')]=qs[_0x2c42('0x46')](_['pick'](_0x350b47[_0x2c42('0x45')],_0x8d2a83['filters']));if(_0x350b47[_0x2c42('0x45')]['filter']){_0x1ac44e[_0x2c42('0x4e')]=_[_0x2c42('0x64')](_0x1ac44e[_0x2c42('0x4e')],{'$or':_[_0x2c42('0x40')](_0x1ac44e[_0x2c42('0x47')],function(_0x521862){var _0x26ed5c={};_0x26ed5c[_0x521862]={'$like':'%'+_0x350b47['query'][_0x2c42('0x52')]+'%'};return _0x26ed5c;})});}_0x1ac44e=_['merge']({},_0x1ac44e,_0x350b47[_0x2c42('0x59')]);return _0x3b07f9[_0x2c42('0xba')](_0x1ac44e);}})[_0x2c42('0x20')](function(_0x5d2a83){if(_0x5d2a83){_0x34cf43=_0x5d2a83[_0x2c42('0x4a')];if(!_0x350b47[_0x2c42('0x45')][_0x2c42('0x4b')]('nolimit')){_0x1ac44e['limit']=qs[_0x2c42('0x2f')](_0x350b47[_0x2c42('0x45')]['limit']);_0x1ac44e['offset']=qs[_0x2c42('0x2e')](_0x350b47[_0x2c42('0x45')][_0x2c42('0x2e')]);}return _0x3b07f9[_0x2c42('0xba')](_0x1ac44e);}})['then'](function(_0x2b1a2a){if(_0x2b1a2a){return _0x2b1a2a?{'count':_0x34cf43,'rows':_0x2b1a2a}:null;}})['then'](respondWithResult(_0x2a8839,null))[_0x2c42('0x2b')](handleError(_0x2a8839,null));};
\ No newline at end of file
+var _0xfa79=['host','port','service','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp','removeSmtp','setSmtp','MailInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','transaction','MailApplication','bulkCreate','findAndCountAll','priority','hasOwnProperty','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','List\x20not\x20found','Contacts','messageId','attach','Interaction','Messages','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','pick','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','key','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','pass','cpassword','authentication'];(function(_0x3ecaae,_0x3ed858){var _0x8a331e=function(_0x2f0061){while(--_0x2f0061){_0x3ecaae['push'](_0x3ecaae['shift']());}};_0x8a331e(++_0x3ed858);}(_0xfa79,0x1c7));var _0x9fa7=function(_0x2f6e01,_0x40ce5a){_0x2f6e01=_0x2f6e01-0x0;var _0x5c9346=_0xfa79[_0x2f6e01];return _0x5c9346;};'use strict';var pdf=require(_0x9fa7('0x0'));var emlformat=require(_0x9fa7('0x1'));var rimraf=require(_0x9fa7('0x2'));var zipdir=require(_0x9fa7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9fa7('0x4'));var moment=require(_0x9fa7('0x5'));var BPromise=require(_0x9fa7('0x6'));var Mustache=require(_0x9fa7('0x7'));var util=require('util');var path=require('path');var sox=require(_0x9fa7('0x8'));var csv=require(_0x9fa7('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9fa7('0xa'));var squel=require('squel');var crypto=require(_0x9fa7('0xb'));var jsforce=require(_0x9fa7('0xc'));var deskjs=require(_0x9fa7('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9fa7('0xe'));var Papa=require(_0x9fa7('0xf'));var Redis=require(_0x9fa7('0x10'));var authService=require(_0x9fa7('0x11'));var qs=require(_0x9fa7('0x12'));var as=require(_0x9fa7('0x13'));var hardwareService=require(_0x9fa7('0x14'));var logger=require('../../config/logger')(_0x9fa7('0x15'));var utils=require('../../config/utils');var config=require(_0x9fa7('0x16'));var db=require(_0x9fa7('0x17'))['db'];config[_0x9fa7('0x18')]=_['defaults'](config[_0x9fa7('0x18')],{'host':_0x9fa7('0x19'),'port':0x18eb});var socket=require(_0x9fa7('0x1a'))(new Redis(config['redis']));require(_0x9fa7('0x1b'))[_0x9fa7('0x1c')](socket);var jayson=require(_0x9fa7('0x1d'));var client=jayson[_0x9fa7('0x1e')][_0x9fa7('0x1f')]({'port':0x232b});function checkPasswordPattern(_0x5d08d6,_0x5e58dd,_0x53d02c){if(_0x53d02c){var _0x1cedc2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1cedc2[_0x9fa7('0x20')](_0x5e58dd)){return _0x5d08d6;}else{throw new db[(_0x9fa7('0x21'))][(_0x9fa7('0x22'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5d08d6;}}function respondWithRpcPromise(_0xadd253,_0x2ce478,_0x1787fb,_0x4ac818){return new BPromise(function(_0x1bcb02,_0x42ed00){var _0x116e19=_0x4ac818||client;return _0x116e19[_0x9fa7('0x23')](_0xadd253,_0x1787fb)[_0x9fa7('0x24')](function(_0x4409bc){logger['info'](_0x9fa7('0x25'),_0x2ce478,_0x9fa7('0x26'));logger[_0x9fa7('0x27')](_0x9fa7('0x28'),_0x2ce478,'request\x20sent',JSON['stringify'](_0x4409bc));if(_0x4409bc[_0x9fa7('0x29')]){if(_0x4409bc[_0x9fa7('0x29')][_0x9fa7('0x2a')]===0x1f4){logger[_0x9fa7('0x29')](_0x9fa7('0x25'),_0x2ce478,_0x4409bc[_0x9fa7('0x29')][_0x9fa7('0x2b')]);return _0x42ed00(_0x4409bc[_0x9fa7('0x29')][_0x9fa7('0x2b')]);}logger[_0x9fa7('0x29')](_0x9fa7('0x25'),_0x2ce478,_0x4409bc[_0x9fa7('0x29')]['message']);return _0x1bcb02(_0x4409bc['error'][_0x9fa7('0x2b')]);}else{logger[_0x9fa7('0x2c')]('MailAccount,\x20%s,\x20%s',_0x2ce478,_0x9fa7('0x26'));_0x1bcb02(_0x4409bc[_0x9fa7('0x2d')][_0x9fa7('0x2b')]);}})[_0x9fa7('0x2e')](function(_0x56da02){logger['error']('MailAccount,\x20%s,\x20%s',_0x2ce478,_0x56da02);_0x42ed00(_0x56da02);});});}function respondWithStatusCode(_0x33f25d,_0x5a43dc){_0x5a43dc=_0x5a43dc||0xcc;return function(_0x18e286){if(_0x18e286){return _0x33f25d[_0x9fa7('0x2f')](_0x5a43dc);}return _0x33f25d['status'](_0x5a43dc)['end']();};}function respondWithResult(_0x266fc4,_0x422cd4){_0x422cd4=_0x422cd4||0xc8;return function(_0xd0e622){if(_0xd0e622){return _0x266fc4[_0x9fa7('0x30')](_0x422cd4)[_0x9fa7('0x31')](_0xd0e622);}};}function respondWithFilteredResult(_0x465f9d,_0x2f4953){return function(_0x8e6a14){if(_0x8e6a14){var _0x4c561a=_0x8e6a14[_0x9fa7('0x32')],_0x36bbf1=_0x2f4953[_0x9fa7('0x33')],_0x144ff8=_0x2f4953['offset']+_0x2f4953[_0x9fa7('0x34')],_0x58cb69;if(_0x144ff8>=_0x4c561a){_0x144ff8=_0x4c561a;_0x58cb69=0xc8;}else{_0x58cb69=0xce;}_0x465f9d[_0x9fa7('0x30')](_0x58cb69);return _0x465f9d[_0x9fa7('0x35')](_0x9fa7('0x36'),_0x36bbf1+'-'+_0x144ff8+'/'+_0x4c561a)['json'](_0x8e6a14);}return null;};}function patchUpdates(_0x34ab45){return function(_0xa62b8c){try{jsonpatch['apply'](_0xa62b8c,_0x34ab45,!![]);}catch(_0x2b77b4){return BPromise[_0x9fa7('0x37')](_0x2b77b4);}return _0xa62b8c['save']();};}function saveUpdates(_0x5bd2f6,_0x2f26d4){return function(_0x399166){if(_0x399166){return _0x399166[_0x9fa7('0x38')](_0x5bd2f6)[_0x9fa7('0x24')](function(_0x3eba4b){return _0x3eba4b;});}return null;};}function removeEntity(_0x19ba63,_0x5f53c9){return function(_0x231806){if(_0x231806){return _0x231806[_0x9fa7('0x39')]()[_0x9fa7('0x24')](function(){var _0x4d4b76=_0x231806[_0x9fa7('0x3a')]({'plain':!![]});var _0x5e02ae=_0x9fa7('0x3b');return db[_0x9fa7('0x3c')][_0x9fa7('0x39')]({'where':{'type':_0x5e02ae,'resourceId':_0x4d4b76['id']}})[_0x9fa7('0x24')](function(){return _0x231806;});})[_0x9fa7('0x24')](function(){_0x19ba63[_0x9fa7('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cefff,_0x4cc8e7){return function(_0x2b82ad){if(!_0x2b82ad){_0x2cefff[_0x9fa7('0x2f')](0x194);}return _0x2b82ad;};}function handleError(_0x1492c5,_0x1f465e){_0x1f465e=_0x1f465e||0x1f4;return function(_0x651a8f){logger[_0x9fa7('0x29')](_0x651a8f[_0x9fa7('0x3d')]);if(_0x651a8f['name']){delete _0x651a8f[_0x9fa7('0x3e')];}_0x1492c5['status'](_0x1f465e)[_0x9fa7('0x3f')](_0x651a8f);};}exports[_0x9fa7('0x40')]=function(_0x14ca9f,_0x4ff88f){var _0x550972={'include':[{'model':db[_0x9fa7('0x41')],'as':_0x9fa7('0x42')},{'model':db[_0x9fa7('0x43')],'as':_0x9fa7('0x44')},{'model':db[_0x9fa7('0x45')],'as':_0x9fa7('0x46')}]},_0x364e68={},_0x319723={'count':0x0,'rows':[]};var _0x511f5e=_[_0x9fa7('0x47')](db[_0x9fa7('0x48')][_0x9fa7('0x49')],function(_0x2c938e){return{'name':_0x2c938e[_0x9fa7('0x4a')],'type':_0x2c938e['type']['key']};});_0x364e68['model']=_[_0x9fa7('0x47')](_0x511f5e,_0x9fa7('0x3e'));_0x364e68[_0x9fa7('0x4b')]=_[_0x9fa7('0x4c')](_0x14ca9f['query']);_0x364e68[_0x9fa7('0x4d')]=_[_0x9fa7('0x4e')](_0x364e68[_0x9fa7('0x4f')],_0x364e68[_0x9fa7('0x4b')]);_0x550972[_0x9fa7('0x50')]=_[_0x9fa7('0x4e')](_0x364e68[_0x9fa7('0x4f')],qs[_0x9fa7('0x51')](_0x14ca9f[_0x9fa7('0x4b')]['fields']));_0x550972['attributes']=_0x550972['attributes'][_0x9fa7('0x52')]?_0x550972[_0x9fa7('0x50')]:_0x364e68[_0x9fa7('0x4f')];if(!_0x14ca9f['query']['hasOwnProperty']('nolimit')){_0x550972[_0x9fa7('0x34')]=qs[_0x9fa7('0x34')](_0x14ca9f[_0x9fa7('0x4b')]['limit']);_0x550972[_0x9fa7('0x33')]=qs[_0x9fa7('0x33')](_0x14ca9f['query'][_0x9fa7('0x33')]);}_0x550972[_0x9fa7('0x53')]=qs[_0x9fa7('0x54')](_0x14ca9f[_0x9fa7('0x4b')][_0x9fa7('0x54')]);_0x550972[_0x9fa7('0x55')]=qs[_0x9fa7('0x4d')](_['pick'](_0x14ca9f[_0x9fa7('0x4b')],_0x364e68['filters']),_0x511f5e);if(_0x14ca9f[_0x9fa7('0x4b')][_0x9fa7('0x56')]){_0x550972[_0x9fa7('0x55')]=_[_0x9fa7('0x57')](_0x550972[_0x9fa7('0x55')],{'$or':_['map'](_0x511f5e,function(_0x5bf862){if(_0x5bf862['type']!==_0x9fa7('0x58')){var _0x18a9a6={};_0x18a9a6[_0x5bf862[_0x9fa7('0x3e')]]={'$like':'%'+_0x14ca9f['query'][_0x9fa7('0x56')]+'%'};return _0x18a9a6;}})});}_0x550972=_[_0x9fa7('0x57')]({},_0x550972,_0x14ca9f['options']);var _0x277fc1={'where':_0x550972[_0x9fa7('0x55')]};return db['MailAccount']['count'](_0x277fc1)[_0x9fa7('0x24')](function(_0x2be9d0){_0x319723[_0x9fa7('0x32')]=_0x2be9d0;if(_0x14ca9f[_0x9fa7('0x4b')][_0x9fa7('0x59')]){_0x550972[_0x9fa7('0x5a')]=[{'all':!![]}];}return db['MailAccount'][_0x9fa7('0x5b')](_0x550972);})[_0x9fa7('0x24')](function(_0xfa4b91){_0x319723[_0x9fa7('0x5c')]=_0xfa4b91;return _0x319723;})[_0x9fa7('0x24')](respondWithFilteredResult(_0x4ff88f,_0x550972))[_0x9fa7('0x2e')](handleError(_0x4ff88f,null));};exports['show']=function(_0x1d2276,_0x294a81){var _0x574975={'raw':![],'where':{'id':_0x1d2276[_0x9fa7('0x5d')]['id']},'include':[{'model':db[_0x9fa7('0x41')],'as':_0x9fa7('0x42')},{'model':db[_0x9fa7('0x43')],'as':_0x9fa7('0x44')},{'model':db[_0x9fa7('0x45')],'as':_0x9fa7('0x46')}]},_0x1ba6df={};_0x1ba6df[_0x9fa7('0x4f')]=_['keys'](db[_0x9fa7('0x48')][_0x9fa7('0x49')]);_0x1ba6df[_0x9fa7('0x4b')]=_[_0x9fa7('0x4c')](_0x1d2276[_0x9fa7('0x4b')]);_0x1ba6df[_0x9fa7('0x4d')]=_['intersection'](_0x1ba6df[_0x9fa7('0x4f')],_0x1ba6df[_0x9fa7('0x4b')]);_0x574975[_0x9fa7('0x50')]=_[_0x9fa7('0x4e')](_0x1ba6df[_0x9fa7('0x4f')],qs[_0x9fa7('0x51')](_0x1d2276[_0x9fa7('0x4b')][_0x9fa7('0x51')]));_0x574975[_0x9fa7('0x50')]=_0x574975[_0x9fa7('0x50')]['length']?_0x574975['attributes']:_0x1ba6df[_0x9fa7('0x4f')];if(_0x1d2276['query']['includeAll']){_0x574975[_0x9fa7('0x5a')]=[{'all':!![]}];}_0x574975=_[_0x9fa7('0x57')]({},_0x574975,_0x1d2276[_0x9fa7('0x5e')]);return db[_0x9fa7('0x48')][_0x9fa7('0x5f')](_0x574975)[_0x9fa7('0x24')](handleEntityNotFound(_0x294a81,null))[_0x9fa7('0x24')](respondWithResult(_0x294a81,null))[_0x9fa7('0x2e')](handleError(_0x294a81,null));};exports[_0x9fa7('0x38')]=function(_0x232ebc,_0x558fe9){if(_0x232ebc['body']['id']){delete _0x232ebc[_0x9fa7('0x60')]['id'];}return db[_0x9fa7('0x48')][_0x9fa7('0x5f')]({'where':{'id':_0x232ebc[_0x9fa7('0x5d')]['id']},'include':[{'model':db[_0x9fa7('0x41')],'as':'Imap'},{'model':db[_0x9fa7('0x43')],'as':_0x9fa7('0x44')},{'model':db[_0x9fa7('0x45')],'as':_0x9fa7('0x46')}]})[_0x9fa7('0x24')](handleEntityNotFound(_0x558fe9,null))[_0x9fa7('0x24')](saveUpdates(_0x232ebc['body'],null))[_0x9fa7('0x24')](function(_0x553d7d){if(_0x553d7d&&_0x232ebc['body'][_0x9fa7('0x42')]){return db[_0x9fa7('0x41')][_0x9fa7('0x38')](_0x232ebc[_0x9fa7('0x60')][_0x9fa7('0x42')],{'where':{'MailAccountId':_0x553d7d['id']}})[_0x9fa7('0x24')](function(){return _0x553d7d;});}return _0x553d7d;})['then'](function(_0x3fd6bb){if(_0x3fd6bb&&_0x232ebc[_0x9fa7('0x60')][_0x9fa7('0x44')]){return db['MailServerOut']['update'](_0x232ebc[_0x9fa7('0x60')][_0x9fa7('0x44')],{'where':{'MailAccountId':_0x3fd6bb['id']}})[_0x9fa7('0x24')](function(){return _0x3fd6bb;});}return _0x3fd6bb;})['then'](respondWithResult(_0x558fe9,null))[_0x9fa7('0x2e')](handleError(_0x558fe9,null));};exports['describe']=function(_0xfd3d41,_0x46582f){return db[_0x9fa7('0x48')][_0x9fa7('0x61')]()['then'](respondWithResult(_0x46582f,null))['catch'](handleError(_0x46582f,null));};exports[_0x9fa7('0x62')]=function(_0x48a889,_0x2d0660,_0x17046e){if(_0x48a889['body']['id']){delete _0x48a889[_0x9fa7('0x60')]['id'];}return db[_0x9fa7('0x48')][_0x9fa7('0x5f')]({'where':{'id':_0x48a889[_0x9fa7('0x5d')]['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x2d0660,null))[_0x9fa7('0x24')](function(_0x16a155){if(_0x16a155){_0x48a889[_0x9fa7('0x60')][_0x9fa7('0x63')]=_0x16a155['id'];return db[_0x9fa7('0x64')][_0x9fa7('0x65')](_0x48a889[_0x9fa7('0x60')]);}})[_0x9fa7('0x24')](respondWithResult(_0x2d0660,null))['catch'](handleError(_0x2d0660,null));};exports[_0x9fa7('0x66')]=function(_0x3a99bf,_0x461b31,_0x4070c8){var _0xb6402a={'raw':![],'where':{}};var _0x3b2031={};var _0x9bc364={'count':0x0,'rows':[]};return db[_0x9fa7('0x48')][_0x9fa7('0x67')]({'where':{'id':_0x3a99bf[_0x9fa7('0x5d')]['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x461b31,null))['then'](function(_0x3c3b43){if(_0x3c3b43){_0x3b2031[_0x9fa7('0x4f')]=_[_0x9fa7('0x4c')](db['Disposition']['rawAttributes']);_0x3b2031['query']=_[_0x9fa7('0x4c')](_0x3a99bf['query']);_0x3b2031[_0x9fa7('0x4d')]=_[_0x9fa7('0x4e')](_0x3b2031[_0x9fa7('0x4f')],_0x3b2031['query']);_0xb6402a['attributes']=_['intersection'](_0x3b2031[_0x9fa7('0x4f')],qs['fields'](_0x3a99bf[_0x9fa7('0x4b')][_0x9fa7('0x51')]));_0xb6402a['attributes']=_0xb6402a[_0x9fa7('0x50')][_0x9fa7('0x52')]?_0xb6402a[_0x9fa7('0x50')]:_0x3b2031[_0x9fa7('0x4f')];if(!_0x3a99bf[_0x9fa7('0x4b')]['hasOwnProperty'](_0x9fa7('0x68'))){_0xb6402a[_0x9fa7('0x34')]=qs[_0x9fa7('0x34')](_0x3a99bf[_0x9fa7('0x4b')][_0x9fa7('0x34')]);_0xb6402a[_0x9fa7('0x33')]=qs[_0x9fa7('0x33')](_0x3a99bf['query'][_0x9fa7('0x33')]);}_0xb6402a[_0x9fa7('0x53')]=qs[_0x9fa7('0x54')](_0x3a99bf[_0x9fa7('0x4b')][_0x9fa7('0x54')]);_0xb6402a['where']=qs[_0x9fa7('0x4d')](_[_0x9fa7('0x69')](_0x3a99bf[_0x9fa7('0x4b')],_0x3b2031[_0x9fa7('0x4d')]));_0xb6402a[_0x9fa7('0x55')][_0x9fa7('0x63')]=_0x3c3b43['id'];if(_0x3a99bf[_0x9fa7('0x4b')][_0x9fa7('0x56')]){_0xb6402a[_0x9fa7('0x55')]=_[_0x9fa7('0x57')](_0xb6402a[_0x9fa7('0x55')],{'$or':_[_0x9fa7('0x47')](_0xb6402a[_0x9fa7('0x50')],function(_0x57a72d){var _0x182a07={};_0x182a07[_0x57a72d]={'$like':'%'+_0x3a99bf['query'][_0x9fa7('0x56')]+'%'};return _0x182a07;})});}_0xb6402a=_['merge']({},_0xb6402a,_0x3a99bf[_0x9fa7('0x5e')]);return db[_0x9fa7('0x64')][_0x9fa7('0x32')]({'where':_0xb6402a[_0x9fa7('0x55')]})[_0x9fa7('0x24')](function(_0x3ddcf2){_0x9bc364[_0x9fa7('0x32')]=_0x3ddcf2;if(_0x3a99bf[_0x9fa7('0x4b')][_0x9fa7('0x59')]){_0xb6402a[_0x9fa7('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x9fa7('0x5b')](_0xb6402a);})[_0x9fa7('0x24')](function(_0x397269){_0x9bc364[_0x9fa7('0x5c')]=_0x397269;return _0x9bc364;});}})['then'](respondWithFilteredResult(_0x461b31,_0xb6402a))[_0x9fa7('0x2e')](handleError(_0x461b31,null));};exports['removeDispositions']=function(_0x3acb74,_0x3441a7,_0x431901){return db[_0x9fa7('0x48')][_0x9fa7('0x5f')]({'where':{'id':_0x3acb74[_0x9fa7('0x5d')]['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x3441a7,null))['then'](function(_0x406864){if(_0x406864){return _0x406864[_0x9fa7('0x6a')](_0x3acb74[_0x9fa7('0x4b')]['ids']);}})['then'](respondWithStatusCode(_0x3441a7,null))['catch'](handleError(_0x3441a7,null));};exports['addAnswer']=function(_0x3d176f,_0x49c4d7,_0x1e062e){if(_0x3d176f[_0x9fa7('0x60')]['id']){delete _0x3d176f[_0x9fa7('0x60')]['id'];}return db[_0x9fa7('0x48')][_0x9fa7('0x5f')]({'where':{'id':_0x3d176f['params']['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x49c4d7,null))[_0x9fa7('0x24')](function(_0x998c8b){if(_0x998c8b){_0x3d176f[_0x9fa7('0x60')][_0x9fa7('0x63')]=_0x998c8b['id'];return db[_0x9fa7('0x6b')][_0x9fa7('0x65')](_0x3d176f[_0x9fa7('0x60')]);}})['then'](respondWithResult(_0x49c4d7,null))['catch'](handleError(_0x49c4d7,null));};exports[_0x9fa7('0x6c')]=function(_0x1f7e35,_0x5e0df4,_0x3ffa37){var _0x55f013={'raw':![],'where':{}};var _0x4a7494={};var _0x214b37={'count':0x0,'rows':[]};return db[_0x9fa7('0x48')][_0x9fa7('0x67')]({'where':{'id':_0x1f7e35['params']['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x5e0df4,null))[_0x9fa7('0x24')](function(_0x17eefa){if(_0x17eefa){_0x4a7494[_0x9fa7('0x4f')]=_[_0x9fa7('0x4c')](db[_0x9fa7('0x6b')][_0x9fa7('0x49')]);_0x4a7494[_0x9fa7('0x4b')]=_[_0x9fa7('0x4c')](_0x1f7e35[_0x9fa7('0x4b')]);_0x4a7494[_0x9fa7('0x4d')]=_[_0x9fa7('0x4e')](_0x4a7494[_0x9fa7('0x4f')],_0x4a7494[_0x9fa7('0x4b')]);_0x55f013[_0x9fa7('0x50')]=_['intersection'](_0x4a7494['model'],qs[_0x9fa7('0x51')](_0x1f7e35[_0x9fa7('0x4b')][_0x9fa7('0x51')]));_0x55f013['attributes']=_0x55f013['attributes']['length']?_0x55f013[_0x9fa7('0x50')]:_0x4a7494[_0x9fa7('0x4f')];if(!_0x1f7e35[_0x9fa7('0x4b')]['hasOwnProperty'](_0x9fa7('0x68'))){_0x55f013['limit']=qs[_0x9fa7('0x34')](_0x1f7e35[_0x9fa7('0x4b')]['limit']);_0x55f013[_0x9fa7('0x33')]=qs[_0x9fa7('0x33')](_0x1f7e35[_0x9fa7('0x4b')][_0x9fa7('0x33')]);}_0x55f013['order']=qs[_0x9fa7('0x54')](_0x1f7e35[_0x9fa7('0x4b')][_0x9fa7('0x54')]);_0x55f013[_0x9fa7('0x55')]=qs[_0x9fa7('0x4d')](_['pick'](_0x1f7e35[_0x9fa7('0x4b')],_0x4a7494[_0x9fa7('0x4d')]));_0x55f013[_0x9fa7('0x55')][_0x9fa7('0x63')]=_0x17eefa['id'];if(_0x1f7e35[_0x9fa7('0x4b')][_0x9fa7('0x56')]){_0x55f013[_0x9fa7('0x55')]=_[_0x9fa7('0x57')](_0x55f013['where'],{'$or':_[_0x9fa7('0x47')](_0x55f013[_0x9fa7('0x50')],function(_0x2e6d6e){var _0x239849={};_0x239849[_0x2e6d6e]={'$like':'%'+_0x1f7e35['query'][_0x9fa7('0x56')]+'%'};return _0x239849;})});}_0x55f013=_[_0x9fa7('0x57')]({},_0x55f013,_0x1f7e35[_0x9fa7('0x5e')]);return db['CannedAnswer'][_0x9fa7('0x32')]({'where':_0x55f013['where']})[_0x9fa7('0x24')](function(_0x521114){_0x214b37[_0x9fa7('0x32')]=_0x521114;if(_0x1f7e35[_0x9fa7('0x4b')][_0x9fa7('0x59')]){_0x55f013[_0x9fa7('0x5a')]=[{'all':!![]}];}return db[_0x9fa7('0x6b')][_0x9fa7('0x5b')](_0x55f013);})[_0x9fa7('0x24')](function(_0x11ebc6){_0x214b37['rows']=_0x11ebc6;return _0x214b37;});}})[_0x9fa7('0x24')](respondWithFilteredResult(_0x5e0df4,_0x55f013))[_0x9fa7('0x2e')](handleError(_0x5e0df4,null));};exports['removeAnswers']=function(_0x56cd5b,_0x47bf40,_0x497e10){return db[_0x9fa7('0x48')][_0x9fa7('0x5f')]({'where':{'id':_0x56cd5b['params']['id']}})['then'](handleEntityNotFound(_0x47bf40,null))[_0x9fa7('0x24')](function(_0x21fc92){if(_0x21fc92){return _0x21fc92[_0x9fa7('0x6d')](_0x56cd5b[_0x9fa7('0x4b')][_0x9fa7('0x6e')]);}})[_0x9fa7('0x24')](respondWithStatusCode(_0x47bf40,null))['catch'](handleError(_0x47bf40,null));};exports[_0x9fa7('0x65')]=function(_0x1073e4,_0x43e161){var _0x3613a5={'name':_0x1073e4['body'][_0x9fa7('0x3e')],'key':_0x1073e4[_0x9fa7('0x60')][_0x9fa7('0x6f')],'email':_0x1073e4[_0x9fa7('0x60')][_0x9fa7('0x70')],'ListId':_0x1073e4[_0x9fa7('0x60')][_0x9fa7('0x71')],'active':!_[_0x9fa7('0x72')](_0x1073e4[_0x9fa7('0x60')][_0x9fa7('0x73')])?_0x1073e4['body'][_0x9fa7('0x73')]:!![],'description':_0x1073e4[_0x9fa7('0x60')][_0x9fa7('0x74')]||null,'Imap':{},'Smtp':{}};if(_[_0x9fa7('0x72')](_0x1073e4['body'][_0x9fa7('0x75')])){if(_0x1073e4[_0x9fa7('0x60')][_0x9fa7('0x76')]){_0x3613a5['Imap'][_0x9fa7('0x77')]=_0x3613a5[_0x9fa7('0x44')]['user']=_0x1073e4['body'][_0x9fa7('0x78')];_0x3613a5[_0x9fa7('0x42')]['password']=_0x3613a5['Smtp'][_0x9fa7('0x79')]=_0x1073e4[_0x9fa7('0x60')][_0x9fa7('0x7a')];}else{_0x3613a5[_0x9fa7('0x42')][_0x9fa7('0x7b')]=_0x3613a5['Smtp']['authentication']=![];}_0x3613a5[_0x9fa7('0x42')][_0x9fa7('0x7c')]=_0x1073e4[_0x9fa7('0x60')]['Imap']['host'];_0x3613a5['Imap'][_0x9fa7('0x7d')]=_0x1073e4[_0x9fa7('0x60')]['Imap'][_0x9fa7('0x7d')];_0x3613a5['Smtp']['host']=_0x1073e4['body'][_0x9fa7('0x44')][_0x9fa7('0x7c')];_0x3613a5[_0x9fa7('0x44')][_0x9fa7('0x7d')]=_0x1073e4[_0x9fa7('0x60')][_0x9fa7('0x44')][_0x9fa7('0x7d')];}else{_0x3613a5[_0x9fa7('0x42')]['service']=_0x3613a5[_0x9fa7('0x44')][_0x9fa7('0x7e')]=_0x1073e4[_0x9fa7('0x60')]['cservice'];_0x3613a5[_0x9fa7('0x42')][_0x9fa7('0x77')]=_0x3613a5[_0x9fa7('0x44')]['user']=_0x1073e4[_0x9fa7('0x60')]['cuser'];_0x3613a5[_0x9fa7('0x42')][_0x9fa7('0x7f')]=_0x3613a5[_0x9fa7('0x44')][_0x9fa7('0x79')]=_0x1073e4['body'][_0x9fa7('0x7a')];}return db[_0x9fa7('0x48')][_0x9fa7('0x65')](_0x3613a5,{'include':[{'model':db[_0x9fa7('0x43')],'as':'Smtp'},{'model':db['MailServerIn'],'as':'Imap'}]})[_0x9fa7('0x24')](function(_0x2c8fdb){var _0x193ae5=_0x1073e4[_0x9fa7('0x77')][_0x9fa7('0x3a')]({'plain':!![]});if(!_0x193ae5)throw new Error(_0x9fa7('0x80'));if(_0x193ae5[_0x9fa7('0x81')]==='user'){var _0x1cbcd9=_0x2c8fdb[_0x9fa7('0x3a')]({'plain':!![]});return db[_0x9fa7('0x82')][_0x9fa7('0x5f')]({'where':{'name':_0x9fa7('0x3b'),'userProfileId':_0x193ae5['userProfileId']},'raw':!![]})['then'](function(_0x33fe46){if(_0x33fe46&&_0x33fe46['autoAssociation']===0x0){return db[_0x9fa7('0x3c')][_0x9fa7('0x65')]({'name':_0x1cbcd9['name'],'resourceId':_0x1cbcd9['id'],'type':_0x33fe46[_0x9fa7('0x3e')],'sectionId':_0x33fe46['id']},{})[_0x9fa7('0x24')](function(){return _0x2c8fdb;});}else{return _0x2c8fdb;}})[_0x9fa7('0x2e')](function(_0x426efe){logger[_0x9fa7('0x29')](_0x9fa7('0x83'),_0x426efe);throw _0x426efe;});}return _0x2c8fdb;})[_0x9fa7('0x24')](respondWithResult(_0x43e161,0xc9))[_0x9fa7('0x2e')](handleError(_0x43e161,null));};exports[_0x9fa7('0x84')]=function(_0x4f86e6,_0x4f0363,_0xc04da1){return db[_0x9fa7('0x48')][_0x9fa7('0x67')]({'where':{'id':_0x4f86e6['params']['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x4f0363,null))[_0x9fa7('0x24')](function(_0x2020fa){if(_0x2020fa){return _0x2020fa[_0x9fa7('0x84')]();}return null;})[_0x9fa7('0x24')](respondWithResult(_0x4f0363,null))[_0x9fa7('0x2e')](handleError(_0x4f0363,null));};exports['addImap']=function(_0x4ebab1,_0x4d59dd,_0x4d8e0a){if(_0x4ebab1['body']['id']){delete _0x4ebab1['body']['id'];}return db[_0x9fa7('0x48')][_0x9fa7('0x5f')]({'where':{'id':_0x4ebab1[_0x9fa7('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4d59dd,null))[_0x9fa7('0x24')](function(_0x146a41){if(_0x146a41){_0x4ebab1['body'][_0x9fa7('0x63')]=_0x146a41['id'];return db['MailServerIn'][_0x9fa7('0x65')](_0x4ebab1['body']);}})[_0x9fa7('0x24')](respondWithResult(_0x4d59dd,null))[_0x9fa7('0x2e')](handleError(_0x4d59dd,null));};exports[_0x9fa7('0x85')]=function(_0x1b45ed,_0x3cffe9,_0x49261b){return db[_0x9fa7('0x48')]['findOne']({'where':{'id':_0x1b45ed[_0x9fa7('0x5d')]['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x3cffe9,null))[_0x9fa7('0x24')](function(_0x2f9143){if(_0x2f9143){return _0x2f9143['setImap'](null);}return null;})[_0x9fa7('0x24')](respondWithStatusCode(_0x3cffe9,null))[_0x9fa7('0x2e')](handleError(_0x3cffe9,null));};exports[_0x9fa7('0x86')]=function(_0x5314b5,_0x57c27e,_0x11bfe6){return db['MailAccount'][_0x9fa7('0x67')]({'where':{'id':_0x5314b5['params']['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x57c27e,null))['then'](function(_0x2aade7){if(_0x2aade7){return _0x2aade7[_0x9fa7('0x86')]();}return null;})['then'](respondWithResult(_0x57c27e,null))['catch'](handleError(_0x57c27e,null));};exports['addSmtp']=function(_0x5aa842,_0x4f6f9e,_0x50fdba){if(_0x5aa842[_0x9fa7('0x60')]['id']){delete _0x5aa842[_0x9fa7('0x60')]['id'];}return db[_0x9fa7('0x48')][_0x9fa7('0x5f')]({'where':{'id':_0x5aa842['params']['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x4f6f9e,null))[_0x9fa7('0x24')](function(_0x1d0129){if(_0x1d0129){_0x5aa842[_0x9fa7('0x60')][_0x9fa7('0x63')]=_0x1d0129['id'];return db[_0x9fa7('0x43')][_0x9fa7('0x65')](_0x5aa842[_0x9fa7('0x60')]);}})[_0x9fa7('0x24')](respondWithResult(_0x4f6f9e,null))['catch'](handleError(_0x4f6f9e,null));};exports[_0x9fa7('0x87')]=function(_0x358655,_0x4fe07f,_0x428292){return db['MailAccount'][_0x9fa7('0x67')]({'where':{'id':_0x358655[_0x9fa7('0x5d')]['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x4fe07f,null))[_0x9fa7('0x24')](function(_0xc6fda2){if(_0xc6fda2){return _0xc6fda2[_0x9fa7('0x88')](null);}return null;})[_0x9fa7('0x24')](respondWithStatusCode(_0x4fe07f,null))[_0x9fa7('0x2e')](handleError(_0x4fe07f,null));};exports['addInteraction']=function(_0x5401da,_0x209b93,_0x4c8aab){return db[_0x9fa7('0x89')][_0x9fa7('0x5f')]({'where':{'id':_0x5401da[_0x9fa7('0x5d')]['id']}})['then'](handleEntityNotFound(_0x209b93,null))[_0x9fa7('0x24')](function(_0x27c92f){if(_0x27c92f){return _0x27c92f['addInteraction'](_0x5401da['body']['ids'],_[_0x9fa7('0x8a')](_0x5401da[_0x9fa7('0x60')],[_0x9fa7('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x209b93,null))[_0x9fa7('0x2e')](handleError(_0x209b93,null));};exports[_0x9fa7('0x8b')]=function(_0x16d6f4,_0x33244d,_0x19844c){var _0x410ab2={'raw':![],'where':{}};var _0x518c23={};var _0x45a534={'count':0x0,'rows':[]};return db[_0x9fa7('0x48')]['findOne']({'where':{'id':_0x16d6f4[_0x9fa7('0x5d')]['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x33244d,null))[_0x9fa7('0x24')](function(_0x58a536){if(_0x58a536){_0x518c23[_0x9fa7('0x4f')]=_[_0x9fa7('0x4c')](db['MailInteraction'][_0x9fa7('0x49')]);_0x518c23[_0x9fa7('0x4b')]=_[_0x9fa7('0x4c')](_0x16d6f4[_0x9fa7('0x4b')]);_0x518c23[_0x9fa7('0x4d')]=_[_0x9fa7('0x4e')](_0x518c23[_0x9fa7('0x4f')],_0x518c23[_0x9fa7('0x4b')]);_0x410ab2[_0x9fa7('0x50')]=_[_0x9fa7('0x4e')](_0x518c23['model'],qs[_0x9fa7('0x51')](_0x16d6f4[_0x9fa7('0x4b')][_0x9fa7('0x51')]));_0x410ab2[_0x9fa7('0x50')]=_0x410ab2[_0x9fa7('0x50')]['length']?_0x410ab2[_0x9fa7('0x50')]:_0x518c23[_0x9fa7('0x4f')];if(!_0x16d6f4[_0x9fa7('0x4b')]['hasOwnProperty'](_0x9fa7('0x68'))){_0x410ab2['limit']=qs[_0x9fa7('0x34')](_0x16d6f4['query'][_0x9fa7('0x34')]);_0x410ab2[_0x9fa7('0x33')]=qs[_0x9fa7('0x33')](_0x16d6f4['query'][_0x9fa7('0x33')]);}_0x410ab2['order']=qs[_0x9fa7('0x54')](_0x16d6f4['query']['sort']);_0x410ab2[_0x9fa7('0x55')]=qs[_0x9fa7('0x4d')](_[_0x9fa7('0x69')](_0x16d6f4['query'],_0x518c23['filters']));_0x410ab2[_0x9fa7('0x55')][_0x9fa7('0x63')]=_0x58a536['id'];if(_0x16d6f4[_0x9fa7('0x4b')][_0x9fa7('0x56')]){_0x410ab2[_0x9fa7('0x55')]=_[_0x9fa7('0x57')](_0x410ab2['where'],{'$or':_[_0x9fa7('0x47')](_0x410ab2[_0x9fa7('0x50')],function(_0x558e4d){var _0x247250={};_0x247250[_0x558e4d]={'$like':'%'+_0x16d6f4[_0x9fa7('0x4b')][_0x9fa7('0x56')]+'%'};return _0x247250;})});}_0x410ab2=_['merge']({},_0x410ab2,_0x16d6f4[_0x9fa7('0x5e')]);return db['MailInteraction'][_0x9fa7('0x32')]({'where':_0x410ab2['where']})['then'](function(_0x2e5b48){_0x45a534[_0x9fa7('0x32')]=_0x2e5b48;if(_0x16d6f4['query']['includeAll']){_0x410ab2[_0x9fa7('0x5a')]=[{'model':db['CmContact'],'as':_0x9fa7('0x8c'),'required':![]},{'model':db[_0x9fa7('0x8d')],'as':_0x9fa7('0x8e'),'attributes':[_0x9fa7('0x3e'),_0x9fa7('0x8f'),_0x9fa7('0x90')],'required':![]},{'model':db[_0x9fa7('0x91')],'as':_0x9fa7('0x92'),'attributes':['id',_0x9fa7('0x3e'),_0x9fa7('0x93')],'where':_0x16d6f4[_0x9fa7('0x4b')][_0x9fa7('0x94')]?{'id':_0x16d6f4[_0x9fa7('0x4b')][_0x9fa7('0x94')]}:undefined,'required':_0x16d6f4[_0x9fa7('0x4b')][_0x9fa7('0x94')]?!![]:![]}];}return db[_0x9fa7('0x89')][_0x9fa7('0x5b')](_0x410ab2);})['then'](function(_0x1968ec){_0x45a534['rows']=_0x1968ec;return _0x45a534;});}})[_0x9fa7('0x24')](respondWithFilteredResult(_0x33244d,_0x410ab2))[_0x9fa7('0x2e')](handleError(_0x33244d,null));};exports['addApplications']=function(_0x460fe8,_0x192966,_0x2019ad){return db[_0x9fa7('0x48')]['findOne']({'where':{'id':_0x460fe8[_0x9fa7('0x5d')]['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x192966,null))['then'](function(_0xbd864d){if(_0xbd864d){return db['sequelize'][_0x9fa7('0x95')](function(_0x4cf387){return db['MailApplication'][_0x9fa7('0x39')]({'where':{'MailAccountId':_0x460fe8[_0x9fa7('0x5d')]['id']},'transaction':_0x4cf387})[_0x9fa7('0x24')](function(_0x320ffa){var _0x474676=_[_0x9fa7('0x47')](_0x460fe8[_0x9fa7('0x60')],function(_0x4b9dc6){_0x4b9dc6[_0x9fa7('0x63')]=_0x460fe8['params']['id'];return _0x4b9dc6;});return db[_0x9fa7('0x96')][_0x9fa7('0x97')](_0x474676,{'transaction':_0x4cf387});});})['then'](function(){return db[_0x9fa7('0x96')][_0x9fa7('0x98')]({'where':{'MailAccountId':_0x460fe8[_0x9fa7('0x5d')]['id']},'order':_0x9fa7('0x99')});});}})[_0x9fa7('0x24')](respondWithResult(_0x192966,null))[_0x9fa7('0x2e')](handleError(_0x192966,null));};exports['getApplications']=function(_0x56ce12,_0x4a374f,_0x136256){var _0x23822e={};var _0x26e634={};var _0x1049f8;var _0x1be0c4;return db[_0x9fa7('0x48')]['findOne']({'where':{'id':_0x56ce12['params']['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x4a374f,null))[_0x9fa7('0x24')](function(_0x4cdde9){if(_0x4cdde9){_0x1049f8=_0x4cdde9;_0x26e634['model']=_[_0x9fa7('0x4c')](db[_0x9fa7('0x96')][_0x9fa7('0x49')]);_0x26e634[_0x9fa7('0x4b')]=_[_0x9fa7('0x4c')](_0x56ce12[_0x9fa7('0x4b')]);_0x26e634[_0x9fa7('0x4d')]=_[_0x9fa7('0x4e')](_0x26e634['model'],_0x26e634[_0x9fa7('0x4b')]);_0x23822e[_0x9fa7('0x50')]=_[_0x9fa7('0x4e')](_0x26e634[_0x9fa7('0x4f')],qs[_0x9fa7('0x51')](_0x56ce12[_0x9fa7('0x4b')][_0x9fa7('0x51')]));_0x23822e[_0x9fa7('0x50')]=_0x23822e[_0x9fa7('0x50')][_0x9fa7('0x52')]?_0x23822e['attributes']:_0x26e634[_0x9fa7('0x4f')];_0x23822e[_0x9fa7('0x53')]=qs['sort'](_0x56ce12[_0x9fa7('0x4b')][_0x9fa7('0x54')]);_0x23822e[_0x9fa7('0x55')]=qs[_0x9fa7('0x4d')](_[_0x9fa7('0x69')](_0x56ce12[_0x9fa7('0x4b')],_0x26e634['filters']));if(_0x56ce12[_0x9fa7('0x4b')][_0x9fa7('0x56')]){_0x23822e[_0x9fa7('0x55')]=_['merge'](_0x23822e[_0x9fa7('0x55')],{'$or':_[_0x9fa7('0x47')](_0x23822e[_0x9fa7('0x50')],function(_0x530b1c){var _0x3f1bad={};_0x3f1bad[_0x530b1c]={'$like':'%'+_0x56ce12[_0x9fa7('0x4b')][_0x9fa7('0x56')]+'%'};return _0x3f1bad;})});}_0x23822e=_[_0x9fa7('0x57')]({},_0x23822e,_0x56ce12[_0x9fa7('0x5e')]);return _0x1049f8['getApplications'](_0x23822e);}})[_0x9fa7('0x24')](function(_0xbfa8b9){if(_0xbfa8b9){_0x1be0c4=_0xbfa8b9[_0x9fa7('0x52')];if(!_0x56ce12[_0x9fa7('0x4b')][_0x9fa7('0x9a')](_0x9fa7('0x68'))){_0x23822e['limit']=qs[_0x9fa7('0x34')](_0x56ce12['query'][_0x9fa7('0x34')]);_0x23822e[_0x9fa7('0x33')]=qs[_0x9fa7('0x33')](_0x56ce12[_0x9fa7('0x4b')]['offset']);}return _0x1049f8[_0x9fa7('0x9b')](_0x23822e);}})[_0x9fa7('0x24')](function(_0x593d30){if(_0x593d30){return _0x593d30?{'count':_0x1be0c4,'rows':_0x593d30}:null;}})[_0x9fa7('0x24')](respondWithResult(_0x4a374f,null))[_0x9fa7('0x2e')](handleError(_0x4a374f,null));};exports[_0x9fa7('0x9c')]=function(_0x341bd6,_0x1faf4e,_0x12913d){var _0x39c33a={'raw':!![],'where':{}};var _0x469d63={};var _0x359e14={'count':0x0,'rows':[]};return db[_0x9fa7('0x48')][_0x9fa7('0x67')]({'where':{'id':_0x341bd6['params']['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x1faf4e,null))[_0x9fa7('0x24')](function(_0x125530){if(_0x125530){_0x469d63[_0x9fa7('0x4f')]=_[_0x9fa7('0x4c')](db[_0x9fa7('0x9d')][_0x9fa7('0x49')]);_0x469d63[_0x9fa7('0x4b')]=_['keys'](_0x341bd6[_0x9fa7('0x4b')]);_0x469d63[_0x9fa7('0x4d')]=_[_0x9fa7('0x4e')](_0x469d63[_0x9fa7('0x4f')],_0x469d63[_0x9fa7('0x4b')]);_0x39c33a[_0x9fa7('0x50')]=_[_0x9fa7('0x4e')](_0x469d63['model'],qs['fields'](_0x341bd6[_0x9fa7('0x4b')]['fields']));_0x39c33a[_0x9fa7('0x50')]=_0x39c33a[_0x9fa7('0x50')]['length']?_0x39c33a[_0x9fa7('0x50')]:_0x469d63[_0x9fa7('0x4f')];if(!_0x341bd6['query']['hasOwnProperty'](_0x9fa7('0x68'))){_0x39c33a['limit']=qs[_0x9fa7('0x34')](_0x341bd6['query'][_0x9fa7('0x34')]);_0x39c33a['offset']=qs[_0x9fa7('0x33')](_0x341bd6[_0x9fa7('0x4b')]['offset']);}_0x39c33a[_0x9fa7('0x53')]=qs[_0x9fa7('0x54')](_0x341bd6['query'][_0x9fa7('0x54')]);_0x39c33a[_0x9fa7('0x55')]=qs[_0x9fa7('0x4d')](_[_0x9fa7('0x69')](_0x341bd6[_0x9fa7('0x4b')],_0x469d63['filters']));_0x39c33a[_0x9fa7('0x55')]['MailAccountId']=_0x125530['id'];if(_0x341bd6[_0x9fa7('0x4b')][_0x9fa7('0x56')]){_0x39c33a[_0x9fa7('0x55')]=_[_0x9fa7('0x57')](_0x39c33a['where'],{'$or':_[_0x9fa7('0x47')](_0x39c33a[_0x9fa7('0x50')],function(_0x387bcf){var _0x58a99f={};_0x58a99f[_0x387bcf]={'$like':'%'+_0x341bd6['query']['filter']+'%'};return _0x58a99f;})});}if(_0x341bd6[_0x9fa7('0x4b')][_0x9fa7('0x9e')]){var _0x163da7=_0x341bd6['query']['$gte'][_0x9fa7('0x9f')](',');var _0x10ab9d={};_0x10ab9d[_0x163da7[0x0]]={'$gte':moment(_0x163da7[0x1])[_0x9fa7('0xa0')](_0x9fa7('0xa1'))};_0x39c33a[_0x9fa7('0x55')]=_['merge'](_0x39c33a[_0x9fa7('0x55')],_0x10ab9d);}_0x39c33a=_['merge']({},_0x39c33a,_0x341bd6[_0x9fa7('0x5e')]);return db[_0x9fa7('0x9d')][_0x9fa7('0x32')]({'where':_0x39c33a['where']})[_0x9fa7('0x24')](function(_0xc7578f){_0x359e14['count']=_0xc7578f;if(_0x341bd6[_0x9fa7('0x4b')]['includeAll']){_0x39c33a[_0x9fa7('0x5a')]=[{'all':!![]}];}return db['MailMessage'][_0x9fa7('0x5b')](_0x39c33a);})[_0x9fa7('0x24')](function(_0x444b6d){_0x359e14[_0x9fa7('0x5c')]=_0x444b6d;return _0x359e14;});}})[_0x9fa7('0x24')](respondWithFilteredResult(_0x1faf4e,_0x39c33a))['catch'](handleError(_0x1faf4e,null));};exports[_0x9fa7('0x3f')]=function(_0x5c3be3,_0x5c461d,_0x4243b2){var _0x152b4c,_0x255047={},_0x47bd2d;if(_0x5c3be3['body']['to']){_0x47bd2d=_0x5c3be3[_0x9fa7('0x60')]['to']['split'](',')[0x0];}return db['MailAccount'][_0x9fa7('0x5f')]({'where':{'id':_0x5c3be3['params']['id']},'include':[{'model':db[_0x9fa7('0xa2')],'as':_0x9fa7('0xa3'),'include':[{'model':db[_0x9fa7('0xa4')],'as':'Contacts','where':{'email':_0x47bd2d},'limit':0x1,'order':[[_0x9fa7('0xa5'),_0x9fa7('0xa6')]]}]},{'model':db[_0x9fa7('0x43')],'as':_0x9fa7('0x44'),'raw':!![]}]})[_0x9fa7('0x24')](handleEntityNotFound(_0x5c461d,null))[_0x9fa7('0x24')](function(_0x2b6eac){if(_0x2b6eac){_0x152b4c=_0x2b6eac;if(_0x2b6eac[_0x9fa7('0x44')]){if(_['isNil'](_0x5c3be3[_0x9fa7('0x60')][_0x9fa7('0xa7')])){_0x5c3be3[_0x9fa7('0x60')]['from']=util[_0x9fa7('0xa0')](_0x9fa7('0xa8'),_0x2b6eac['name'],_0x2b6eac[_0x9fa7('0x70')]||_0x2b6eac['Smtp'][_0x9fa7('0x77')]);}if(_0x5c3be3['body'][_0x9fa7('0xa9')]&&_0x5c3be3['body'][_0x9fa7('0xa9')][_0x9fa7('0x52')]){for(var _0x4b9c5f=0x0;_0x4b9c5f<_0x5c3be3[_0x9fa7('0x60')][_0x9fa7('0xa9')][_0x9fa7('0x52')];_0x4b9c5f+=0x1){_0x5c3be3[_0x9fa7('0x60')][_0x9fa7('0xa9')][_0x4b9c5f]={'filename':_0x5c3be3[_0x9fa7('0x60')]['attachments'][_0x4b9c5f][_0x9fa7('0x3e')],'path':path[_0x9fa7('0xaa')](config[_0x9fa7('0xab')],_0x9fa7('0xac'),_0x5c3be3[_0x9fa7('0x60')][_0x9fa7('0xa9')][_0x4b9c5f][_0x9fa7('0xad')])};}}var _0x3ceb07={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x2b6eac[_0x9fa7('0x44')][_0x9fa7('0x7e')])){if(_0x2b6eac[_0x9fa7('0x44')]['authentication']){_0x3ceb07[_0x9fa7('0xae')]={'user':_0x2b6eac[_0x9fa7('0x44')][_0x9fa7('0x77')],'pass':_0x2b6eac[_0x9fa7('0x44')][_0x9fa7('0x79')]};}_0x3ceb07[_0x9fa7('0x7c')]=_0x2b6eac[_0x9fa7('0x44')]['host'];_0x3ceb07[_0x9fa7('0x7d')]=_0x2b6eac[_0x9fa7('0x44')][_0x9fa7('0x7d')];_0x3ceb07[_0x9fa7('0xaf')]=_0x2b6eac['Smtp'][_0x9fa7('0xaf')];}else{_0x3ceb07[_0x9fa7('0x7e')]=_0x2b6eac['Smtp'][_0x9fa7('0x7e')];_0x3ceb07[_0x9fa7('0xae')]={'user':_0x2b6eac['Smtp'][_0x9fa7('0x77')],'pass':_0x2b6eac['Smtp'][_0x9fa7('0x79')]};}return respondWithRpcPromise(_0x9fa7('0xb0'),'sendMail',{'account':_0x3ceb07,'message':_0x5c3be3[_0x9fa7('0x60')]});}else{throw new Error(_0x9fa7('0xb1'));}}})[_0x9fa7('0x24')](function(_0x3dcf96){if(_0x3dcf96){_0x255047=_0x3dcf96;if(_0x152b4c[_0x9fa7('0xa3')]){if(_0x152b4c['List'][_0x9fa7('0xb2')][_0x9fa7('0x52')]){return _0x152b4c[_0x9fa7('0xa3')][_0x9fa7('0xb2')][0x0];}else{return db[_0x9fa7('0xa4')][_0x9fa7('0x65')](_['defaults'](_0x5c3be3[_0x9fa7('0x60')],{'firstName':_0x5c3be3['body']['to'],'email':_0x5c3be3[_0x9fa7('0x60')]['to'],'phone':_0x5c3be3['body']['to'],'ListId':_0x152b4c[_0x9fa7('0x71')]}));}}else{throw new Error(_0x9fa7('0xb1'));}}})[_0x9fa7('0x24')](function(_0x422a06){if(_0x422a06){var _0x4811fb={'UserId':_0x5c3be3[_0x9fa7('0x77')]['id'],'ContactId':_0x422a06['id'],'MailAccountId':_0x152b4c['id'],'inReplyTo':_0x255047[_0x9fa7('0xb3')],'to':_0x5c3be3[_0x9fa7('0x60')][_0x9fa7('0xa7')],'cc':_0x5c3be3[_0x9fa7('0x60')]['cc'],'subject':_0x5c3be3[_0x9fa7('0x60')]['subject'],'attach':_0x5c3be3['body'][_0x9fa7('0xb4')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x9fa7('0xa0')](_0x9fa7('0xa1')),'lastMsgDirection':'out','lastMsgBody':_0x5c3be3[_0x9fa7('0x60')][_0x9fa7('0x60')],'Messages':[_[_0x9fa7('0x57')](_0x5c3be3['body'],{'messageId':_0x255047[_0x9fa7('0xb3')],'sentAt':moment()['format'](_0x9fa7('0xa1')),'read':!![],'MailAccountId':_0x152b4c['id'],'UserId':_0x5c3be3['user']['id'],'ContactId':_0x422a06['id']})]};if(_0x5c3be3[_0x9fa7('0x60')][_0x9fa7('0xb5')]){_0x4811fb=_[_0x9fa7('0x57')](_0x4811fb,_0x5c3be3[_0x9fa7('0x60')]['Interaction']);}return db['MailInteraction'][_0x9fa7('0x65')](_0x4811fb,{'include':[{'model':db[_0x9fa7('0x9d')],'as':_0x9fa7('0xb6')}]});}})[_0x9fa7('0x24')](respondWithResult(_0x5c461d,null))[_0x9fa7('0x2e')](handleError(_0x5c461d,null));};exports[_0x9fa7('0xb7')]=function(_0x565e66,_0xa9e23c,_0x4bfe27){return db[_0x9fa7('0x48')][_0x9fa7('0x5f')]({'where':{'id':_0x565e66['params']['id']},'include':[{'model':db[_0x9fa7('0x43')],'as':_0x9fa7('0x44'),'raw':!![]}]})[_0x9fa7('0x24')](handleEntityNotFound(_0xa9e23c,null))[_0x9fa7('0x24')](function(_0x151397){if(_0x151397&&_0x151397['Smtp']){var _0x3918b8={'id':_0x151397['id'],'tls':{'rejectUnauthorized':![]}};if(_0x151397[_0x9fa7('0x44')][_0x9fa7('0x7e')]){_0x3918b8[_0x9fa7('0x7e')]=_0x151397[_0x9fa7('0x44')][_0x9fa7('0x7e')];}else{_0x3918b8[_0x9fa7('0x7c')]=_0x151397[_0x9fa7('0x44')][_0x9fa7('0x7c')];_0x3918b8[_0x9fa7('0x7d')]=_0x151397[_0x9fa7('0x44')][_0x9fa7('0x7d')];_0x3918b8[_0x9fa7('0xaf')]=_0x151397[_0x9fa7('0x44')][_0x9fa7('0xaf')];}if(_0x151397[_0x9fa7('0x44')][_0x9fa7('0x7b')]){_0x3918b8['auth']={'user':_0x151397[_0x9fa7('0x44')][_0x9fa7('0x77')],'pass':_0x151397[_0x9fa7('0x44')][_0x9fa7('0x79')]};}return respondWithRpcPromise('VerifySmtp',_0x9fa7('0xb7'),{'account':_0x3918b8});}})[_0x9fa7('0x24')](respondWithResult(_0xa9e23c,null))[_0x9fa7('0x2e')](handleError(_0xa9e23c,null));};exports[_0x9fa7('0x39')]=function(_0x4aabc4,_0x659121){return db[_0x9fa7('0x48')][_0x9fa7('0x5f')]({'where':{'id':_0x4aabc4[_0x9fa7('0x5d')]['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x659121,null))['then'](function(_0x3cf213){if(_0x3cf213&&_0x3cf213['service']){throw new db[(_0x9fa7('0x21'))][(_0x9fa7('0x22'))](_0x9fa7('0xb8'));}return _0x3cf213;})[_0x9fa7('0x24')](removeEntity(_0x659121,null))[_0x9fa7('0x2e')](handleError(_0x659121,null));};exports[_0x9fa7('0xb9')]=function(_0x419e46,_0x1e8ead,_0x3c9867){return db[_0x9fa7('0x48')][_0x9fa7('0x5f')]({'where':{'id':_0x419e46[_0x9fa7('0x5d')]['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x1e8ead,null))[_0x9fa7('0x24')](function(_0x20f099){if(_0x20f099){return _0x20f099[_0x9fa7('0xb9')](_0x419e46[_0x9fa7('0x60')]['ids'],_[_0x9fa7('0x8a')](_0x419e46[_0x9fa7('0x60')],[_0x9fa7('0x6e'),'id'])||{})[_0x9fa7('0xba')](function(_0x10a0c9){for(var _0x2f0144=0x0;_0x2f0144<_0x419e46[_0x9fa7('0x60')]['ids'][_0x9fa7('0x52')];_0x2f0144+=0x1){socket[_0x9fa7('0xbb')](_0x9fa7('0xbc'),{'UserId':_0x419e46[_0x9fa7('0x60')]['ids'][_0x2f0144],'MailAccountId':_0x419e46[_0x9fa7('0x5d')]['id']});}return _0x10a0c9;});}})['then'](respondWithResult(_0x1e8ead,null))['catch'](handleError(_0x1e8ead,null));};exports[_0x9fa7('0xbd')]=function(_0x515220,_0x403d42,_0x4d42b4){return db['MailAccount'][_0x9fa7('0x5f')]({'where':{'id':_0x515220[_0x9fa7('0x5d')]['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x403d42,null))['then'](function(_0x4e09f7){if(_0x4e09f7){return _0x4e09f7[_0x9fa7('0xbd')](_0x515220['query'][_0x9fa7('0x6e')])[_0x9fa7('0x24')](function(){if(_[_0x9fa7('0xbe')](_0x515220[_0x9fa7('0x4b')][_0x9fa7('0x6e')])){for(var _0x4cf1fc=0x0;_0x4cf1fc<_0x515220[_0x9fa7('0x4b')][_0x9fa7('0x6e')][_0x9fa7('0x52')];_0x4cf1fc+=0x1){socket['emit'](_0x9fa7('0xbf'),{'UserId':Number(_0x515220['query'][_0x9fa7('0x6e')][_0x4cf1fc]),'MailAccountId':Number(_0x515220[_0x9fa7('0x5d')]['id'])});}}else{socket[_0x9fa7('0xbb')](_0x9fa7('0xbf'),{'UserId':Number(_0x515220['query']['ids']),'MailAccountId':Number(_0x515220[_0x9fa7('0x5d')]['id'])});}});}})[_0x9fa7('0x24')](respondWithStatusCode(_0x403d42,null))[_0x9fa7('0x2e')](handleError(_0x403d42,null));};exports[_0x9fa7('0xc0')]=function(_0x216c47,_0x359ceb,_0x4d6fa2){var _0x16d70d={};var _0x4d8dd3={};var _0x55a274;var _0x512f89;return db[_0x9fa7('0x48')][_0x9fa7('0x67')]({'where':{'id':_0x216c47[_0x9fa7('0x5d')]['id']}})[_0x9fa7('0x24')](handleEntityNotFound(_0x359ceb,null))[_0x9fa7('0x24')](function(_0xc4740f){if(_0xc4740f){_0x55a274=_0xc4740f;_0x4d8dd3[_0x9fa7('0x4f')]=_[_0x9fa7('0x4c')](db['User'][_0x9fa7('0x49')]);_0x4d8dd3[_0x9fa7('0x4b')]=_['keys'](_0x216c47[_0x9fa7('0x4b')]);_0x4d8dd3[_0x9fa7('0x4d')]=_['intersection'](_0x4d8dd3[_0x9fa7('0x4f')],_0x4d8dd3[_0x9fa7('0x4b')]);_0x16d70d[_0x9fa7('0x50')]=_['intersection'](_0x4d8dd3[_0x9fa7('0x4f')],qs[_0x9fa7('0x51')](_0x216c47['query'][_0x9fa7('0x51')]));_0x16d70d['attributes']=_0x16d70d[_0x9fa7('0x50')]['length']?_0x16d70d['attributes']:_0x4d8dd3[_0x9fa7('0x4f')];_0x16d70d[_0x9fa7('0x53')]=qs[_0x9fa7('0x54')](_0x216c47[_0x9fa7('0x4b')][_0x9fa7('0x54')]);_0x16d70d[_0x9fa7('0x55')]=qs[_0x9fa7('0x4d')](_[_0x9fa7('0x69')](_0x216c47[_0x9fa7('0x4b')],_0x4d8dd3[_0x9fa7('0x4d')]));if(_0x216c47['query'][_0x9fa7('0x56')]){_0x16d70d[_0x9fa7('0x55')]=_[_0x9fa7('0x57')](_0x16d70d['where'],{'$or':_[_0x9fa7('0x47')](_0x16d70d[_0x9fa7('0x50')],function(_0x1ca68e){var _0x35ab14={};_0x35ab14[_0x1ca68e]={'$like':'%'+_0x216c47['query']['filter']+'%'};return _0x35ab14;})});}_0x16d70d=_[_0x9fa7('0x57')]({},_0x16d70d,_0x216c47[_0x9fa7('0x5e')]);return _0x55a274[_0x9fa7('0xc0')](_0x16d70d);}})[_0x9fa7('0x24')](function(_0xbe69eb){if(_0xbe69eb){_0x512f89=_0xbe69eb[_0x9fa7('0x52')];if(!_0x216c47[_0x9fa7('0x4b')][_0x9fa7('0x9a')](_0x9fa7('0x68'))){_0x16d70d[_0x9fa7('0x34')]=qs['limit'](_0x216c47[_0x9fa7('0x4b')]['limit']);_0x16d70d[_0x9fa7('0x33')]=qs[_0x9fa7('0x33')](_0x216c47[_0x9fa7('0x4b')][_0x9fa7('0x33')]);}return _0x55a274[_0x9fa7('0xc0')](_0x16d70d);}})[_0x9fa7('0x24')](function(_0x285208){if(_0x285208){return _0x285208?{'count':_0x512f89,'rows':_0x285208}:null;}})[_0x9fa7('0x24')](respondWithResult(_0x359ceb,null))[_0x9fa7('0x2e')](handleError(_0x359ceb,null));};
\ No newline at end of file
index 18abf1b..d1d2eef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6b4=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailAccount','setMaxListeners','save','remove'];(function(_0xa5e664,_0x1b953e){var _0x2256f7=function(_0x247eca){while(--_0x247eca){_0xa5e664['push'](_0xa5e664['shift']());}};_0x2256f7(++_0x1b953e);}(_0xa6b4,0x1ea));var _0x4a6b=function(_0x2bbb3d,_0x400061){_0x2bbb3d=_0x2bbb3d-0x0;var _0x5739f0=_0xa6b4[_0x2bbb3d];return _0x5739f0;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x4a6b('0x0'))['db'][_0x4a6b('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x4a6b('0x2')](0x0);var events={'afterCreate':_0x4a6b('0x3'),'afterUpdate':'update','afterDestroy':_0x4a6b('0x4')};function emitEvent(_0x300d70){return function(_0x22c012,_0x2d7c57,_0xb63d44){MailAccountEvents[_0x4a6b('0x5')](_0x300d70+':'+_0x22c012['id'],_0x22c012);MailAccountEvents[_0x4a6b('0x5')](_0x300d70,_0x22c012);_0xb63d44(null);};}for(var e in events){if(events[_0x4a6b('0x6')](e)){var event=events[e];MailAccount[_0x4a6b('0x7')](e,emitEvent(event));}}module[_0x4a6b('0x8')]=MailAccountEvents;
\ No newline at end of file
+var _0x4cfd=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x550b08,_0x46a5e8){var _0x3d807a=function(_0x29f36d){while(--_0x29f36d){_0x550b08['push'](_0x550b08['shift']());}};_0x3d807a(++_0x46a5e8);}(_0x4cfd,0x162));var _0xd4cf=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x4cfd[_0x3203a1];return _0x24215e;};'use strict';var EventEmitter=require(_0xd4cf('0x0'));var MailAccount=require(_0xd4cf('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xd4cf('0x2')](0x0);var events={'afterCreate':_0xd4cf('0x3'),'afterUpdate':_0xd4cf('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3d27e4){return function(_0x5e40c1,_0x2ef7ef,_0xf277f7){MailAccountEvents[_0xd4cf('0x5')](_0x3d27e4+':'+_0x5e40c1['id'],_0x5e40c1);MailAccountEvents[_0xd4cf('0x5')](_0x3d27e4,_0x5e40c1);_0xf277f7(null);};}for(var e in events){if(events[_0xd4cf('0x6')](e)){var event=events[e];MailAccount[_0xd4cf('0x7')](e,emitEvent(event));}}module[_0xd4cf('0x8')]=MailAccountEvents;
\ No newline at end of file
index 973a59a..5cd6b3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x594b=['api','path','rimraf','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','util','../../config/logger'];(function(_0x3778d8,_0x5ce417){var _0x45a1b3=function(_0x28488a){while(--_0x28488a){_0x3778d8['push'](_0x3778d8['shift']());}};_0x45a1b3(++_0x5ce417);}(_0x594b,0xda));var _0xb594=function(_0xe8768,_0x51089b){_0xe8768=_0xe8768-0x0;var _0x20b22e=_0x594b[_0xe8768];return _0x20b22e;};'use strict';var _=require('lodash');var util=require(_0xb594('0x0'));var logger=require(_0xb594('0x1'))(_0xb594('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb594('0x3'));var rimraf=require(_0xb594('0x4'));var config=require('../../config/environment');var attributes=require(_0xb594('0x5'));module[_0xb594('0x6')]=function(_0x54d2c1,_0x534215){return _0x54d2c1[_0xb594('0x7')](_0xb594('0x8'),attributes,{'tableName':_0xb594('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8709=['define','MailAccount','mail_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','./mailAccount.attributes','exports'];(function(_0xbb5003,_0x16db8e){var _0x55ae29=function(_0xbe98bb){while(--_0xbe98bb){_0xbb5003['push'](_0xbb5003['shift']());}};_0x55ae29(++_0x16db8e);}(_0x8709,0x147));var _0x9870=function(_0x1e99be,_0xe3cf65){_0x1e99be=_0x1e99be-0x0;var _0x11f2b6=_0x8709[_0x1e99be];return _0x11f2b6;};'use strict';var _=require(_0x9870('0x0'));var util=require(_0x9870('0x1'));var logger=require(_0x9870('0x2'))(_0x9870('0x3'));var moment=require('moment');var BPromise=require(_0x9870('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9870('0x5'));var rimraf=require(_0x9870('0x6'));var config=require('../../config/environment');var attributes=require(_0x9870('0x7'));module[_0x9870('0x8')]=function(_0x34ae29,_0x42d1c2){return _0x34ae29[_0x9870('0x9')](_0x9870('0xa'),attributes,{'tableName':_0x9870('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 358219e..22b0309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['length','close','*,*,*,*','Contacts','ListId','mapKey','create','List\x20not\x20found','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','spread','update','attach','interaction','contact','attachments','originCc','bcc','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','info','request\x20sent','debug','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','MailAccount','findAll','options','raw','include','map','attributes','ShowMailAccount','find','model','NotifyMailAccount','difference','keys','CmContact','rawAttributes','CompanyId','body','from','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','updatedAt','MailApplication','Applications','MailServerOut','Smtp','get','account','omit','applications','orderBy','priority','asc','autoclose','push'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0xbec5,0xe5));var _0x5bec=function(_0x2351c4,_0x1dca54){_0x2351c4=_0x2351c4-0x0;var _0x1dd3f8=_0xbec5[_0x2351c4];return _0x1dd3f8;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var moment=require('moment');var BPromise=require(_0x5bec('0x2'));var rs=require(_0x5bec('0x3'));var fs=require('fs');var Redis=require(_0x5bec('0x4'));var db=require(_0x5bec('0x5'))['db'];var utils=require(_0x5bec('0x6'));var logger=require('../../config/logger')(_0x5bec('0x7'));var config=require(_0x5bec('0x8'));var jayson=require(_0x5bec('0x9'));var client=jayson['client'][_0x5bec('0xa')]({'port':0x232c});config[_0x5bec('0xb')]=_[_0x5bec('0xc')](config[_0x5bec('0xb')],{'host':_0x5bec('0xd'),'port':0x18eb});var socket=require(_0x5bec('0xe'))(new Redis(config[_0x5bec('0xb')]));require(_0x5bec('0xf'))['register'](socket);function respondWithRpcPromise(_0x41a827,_0x5c2d67,_0x748f75){return new BPromise(function(_0x2a70a7,_0x117162){return client['request'](_0x41a827,_0x748f75)[_0x5bec('0x10')](function(_0x18fa47){logger[_0x5bec('0x11')]('MailAccount,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'));logger[_0x5bec('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'),JSON[_0x5bec('0x14')](_0x18fa47));if(_0x18fa47[_0x5bec('0x15')]){if(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x16')]===0x1f4){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);return _0x117162(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47['error']['message']);return _0x2a70a7(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}else{logger[_0x5bec('0x11')](_0x5bec('0x17'),_0x5c2d67,'request\x20sent');_0x2a70a7(_0x18fa47['result'][_0x5bec('0x18')]);}})[_0x5bec('0x19')](function(_0x4e0191){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x4e0191);_0x117162(_0x4e0191);});});}exports[_0x5bec('0x1a')]=function(_0x593786){var _0x554f9f=this;return new Promise(function(_0xab397b,_0x5be91c){return db[_0x5bec('0x1b')][_0x5bec('0x1c')]({'raw':_0x593786[_0x5bec('0x1d')]?_0x593786[_0x5bec('0x1d')][_0x5bec('0x1e')]===undefined?!![]:![]:!![],'where':_0x593786['options']?_0x593786[_0x5bec('0x1d')]['where']||null:null,'attributes':_0x593786[_0x5bec('0x1d')]?_0x593786[_0x5bec('0x1d')]['attributes']||null:null,'limit':_0x593786[_0x5bec('0x1d')]?_0x593786[_0x5bec('0x1d')]['limit']||null:null,'include':_0x593786[_0x5bec('0x1d')]?_0x593786[_0x5bec('0x1d')][_0x5bec('0x1f')]?_[_0x5bec('0x20')](_0x593786[_0x5bec('0x1d')][_0x5bec('0x1f')],function(_0x2dc014){return{'model':db[_0x2dc014['model']],'as':_0x2dc014['as'],'attributes':_0x2dc014['attributes'],'include':_0x2dc014['include']?_[_0x5bec('0x20')](_0x2dc014[_0x5bec('0x1f')],function(_0x338c25){return{'model':db[_0x338c25['model']],'as':_0x338c25['as'],'attributes':_0x338c25[_0x5bec('0x21')],'include':_0x338c25[_0x5bec('0x1f')]?_['map'](_0x338c25[_0x5bec('0x1f')],function(_0x63ac8){return{'model':db[_0x63ac8['model']],'as':_0x63ac8['as'],'attributes':_0x63ac8['attributes']};}):[]};}):[]};}):[]:[]})[_0x5bec('0x10')](function(_0x2a82d5){logger[_0x5bec('0x11')](_0x5bec('0x1a'),_0x593786);logger[_0x5bec('0x13')](_0x5bec('0x1a'),_0x593786,JSON['stringify'](_0x2a82d5));_0xab397b(_0x2a82d5);})[_0x5bec('0x19')](function(_0x59b5b6){logger[_0x5bec('0x15')](_0x5bec('0x1a'),_0x59b5b6[_0x5bec('0x18')],_0x593786);_0x5be91c(_0x554f9f[_0x5bec('0x15')](0x1f4,_0x59b5b6['message']));});});};exports[_0x5bec('0x22')]=function(_0x1aba46){var _0xfc7d41=this;return new Promise(function(_0x527cfb,_0xf6ae6b){return db['MailAccount'][_0x5bec('0x23')]({'raw':_0x1aba46[_0x5bec('0x1d')]?_0x1aba46[_0x5bec('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1aba46[_0x5bec('0x1d')]?_0x1aba46[_0x5bec('0x1d')]['where']||null:null,'attributes':_0x1aba46[_0x5bec('0x1d')]?_0x1aba46[_0x5bec('0x1d')][_0x5bec('0x21')]||null:null,'include':_0x1aba46[_0x5bec('0x1d')]?_0x1aba46[_0x5bec('0x1d')]['include']?_[_0x5bec('0x20')](_0x1aba46['options'][_0x5bec('0x1f')],function(_0x384f04){return{'model':db[_0x384f04[_0x5bec('0x24')]],'as':_0x384f04['as'],'attributes':_0x384f04[_0x5bec('0x21')],'include':_0x384f04[_0x5bec('0x1f')]?_[_0x5bec('0x20')](_0x384f04['include'],function(_0x1c6cc3){return{'model':db[_0x1c6cc3[_0x5bec('0x24')]],'as':_0x1c6cc3['as'],'attributes':_0x1c6cc3[_0x5bec('0x21')],'include':_0x1c6cc3['include']?_[_0x5bec('0x20')](_0x1c6cc3[_0x5bec('0x1f')],function(_0x497519){return{'model':db[_0x497519[_0x5bec('0x24')]],'as':_0x497519['as'],'attributes':_0x497519['attributes']};}):[]};}):[]};}):[]:[]})[_0x5bec('0x10')](function(_0x2c0b08){logger[_0x5bec('0x11')]('ShowMailAccount',_0x1aba46);logger[_0x5bec('0x13')](_0x5bec('0x22'),_0x1aba46,JSON[_0x5bec('0x14')](_0x2c0b08));_0x527cfb(_0x2c0b08);})[_0x5bec('0x19')](function(_0x176cfb){logger[_0x5bec('0x15')](_0x5bec('0x22'),_0x176cfb['message'],_0x1aba46);_0xf6ae6b(_0xfc7d41[_0x5bec('0x15')](0x1f4,_0x176cfb[_0x5bec('0x18')]));});});};exports[_0x5bec('0x25')]=function(_0x414d59){var _0x598e53=this;return new Promise(function(_0x27863b,_0x3fe548){var _0x206839={'body':_0x414d59['body'],'channel':'mail'};var _0x1a57e3=_[_0x5bec('0x26')](_[_0x5bec('0x27')](db[_0x5bec('0x28')][_0x5bec('0x29')]),['createdAt','updatedAt',_0x5bec('0x2a'),'ListId']);var _0x39597c=![];if(_0x414d59[_0x5bec('0x2b')]['id']){delete _0x414d59[_0x5bec('0x2b')]['id'];}if(_['isNil'](_0x414d59[_0x5bec('0x2b')][_0x5bec('0x2c')])){return _0x3fe548(_0x598e53['error'](0x1f4,_0x5bec('0x2d')));}if(_[_0x5bec('0x2e')](_0x414d59[_0x5bec('0x2b')][_0x5bec('0x2b')])||_0x414d59[_0x5bec('0x2b')][_0x5bec('0x2b')]===''){return _0x3fe548(_0x598e53[_0x5bec('0x15')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x414d59[_0x5bec('0x2b')]['mapKey'])){return _0x3fe548(_0x598e53['error'](0x1f4,_0x5bec('0x2f')+_0x1a57e3));}if(!_['includes'](_0x1a57e3,_0x414d59['body']['mapKey'])){return _0x3fe548(_0x598e53[_0x5bec('0x15')](0x1f4,_0x5bec('0x30')+_0x1a57e3));}var _0xb7ad6={};_0xb7ad6[_0x414d59[_0x5bec('0x2b')]['mapKey']]=_0x414d59[_0x5bec('0x2b')][_0x5bec('0x2c')];return db[_0x5bec('0x1b')][_0x5bec('0x23')]({'where':{'id':_0x414d59['account']['id']},'include':[{'model':db[_0x5bec('0x31')],'as':_0x5bec('0x32'),'include':[{'model':db[_0x5bec('0x28')],'as':'Contacts','where':_0xb7ad6,'limit':0x1,'order':[[_0x5bec('0x33'),'DESC']]}]},{'model':db[_0x5bec('0x34')],'as':_0x5bec('0x35')},{'model':db[_0x5bec('0x36')],'as':_0x5bec('0x37')}]})['then'](function(_0x32869f){if(_0x32869f&&_0x32869f[_0x5bec('0x32')]){var _0x227420=_0x32869f[_0x5bec('0x38')]({'plain':!![]});_0x206839[_0x5bec('0x39')]=_[_0x5bec('0x3a')](_0x227420,[_0x5bec('0x35'),'List']);_0x206839[_0x5bec('0x3b')]=_0x227420[_0x5bec('0x35')];_0x206839['list']=_0x227420[_0x5bec('0x32')];_0x206839[_0x5bec('0x3b')]=_[_0x5bec('0x3c')](_0x206839[_0x5bec('0x3b')],[_0x5bec('0x3d')],[_0x5bec('0x3e')]);if(_0x206839[_0x5bec('0x39')]&&_0x206839['account'][_0x5bec('0x3f')]){_0x206839['applications'][_0x5bec('0x40')]({'id':0x0,'priority':_0x206839[_0x5bec('0x3b')][_0x5bec('0x41')]+0x1,'app':_0x5bec('0x42'),'appdata':_0x5bec('0x3f'),'interval':_0x5bec('0x43')});}if(_0x206839[_0x5bec('0x39')][_0x5bec('0x35')]){delete _0x206839[_0x5bec('0x39')][_0x5bec('0x35')];}if(_0x206839['account'][_0x5bec('0x32')]){delete _0x206839['account']['List'];}if(_0x227420[_0x5bec('0x32')]['Contacts']['length']){return _0x227420[_0x5bec('0x32')][_0x5bec('0x44')][0x0];}var _0x416058=_['defaults'](_0x414d59[_0x5bec('0x2b')],{'firstName':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x2c')],'ListId':_0x227420[_0x5bec('0x45')]});_0x416058[_0x414d59['body'][_0x5bec('0x46')]]=_0x414d59[_0x5bec('0x2b')][_0x5bec('0x2c')];return db[_0x5bec('0x28')][_0x5bec('0x47')](_0x416058);}else{throw new Error(_0x5bec('0x48'));}})[_0x5bec('0x10')](function(_0x47ea9f){_0x206839['contact']=_0x47ea9f;if(_0x47ea9f){if(!_0x414d59[_0x5bec('0x2b')]['message'][_0x5bec('0x49')]){_0x414d59[_0x5bec('0x2b')]['message'][_0x5bec('0x49')]=rs['generate']()+'\x20'+_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')][_0x5bec('0x2c')];}var _0x17e033={'ContactId':_0x47ea9f['id'],'MailAccountId':_0x414d59[_0x5bec('0x39')]['id'],'inReplyTo':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')][_0x5bec('0x49')],'to':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')][_0x5bec('0x2c')],'cc':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')]['cc'],'subject':_0x414d59[_0x5bec('0x2b')]['message'][_0x5bec('0x4a')],'attach':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')]['attach'],'lastMsgAt':moment()[_0x5bec('0x4b')](_0x5bec('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x2b')]};return db[_0x5bec('0x4d')]['find']({'where':{'closed':![],'MailAccountId':_0x414d59[_0x5bec('0x39')]['id']},'include':[{'model':db[_0x5bec('0x4e')],'as':_0x5bec('0x4f'),'attributes':[_0x5bec('0x49')],'where':{'messageId':_0x414d59['body'][_0x5bec('0x18')]['inReplyTo']}}]})[_0x5bec('0x10')](function(_0x38deb0){if(_0x38deb0){return[_0x38deb0,![]];}return db[_0x5bec('0x4d')][_0x5bec('0x47')](_0x17e033)['then'](function(_0x268cc5){return[_0x268cc5,!![]];});});}else{throw new Error(_0x5bec('0x50'));}})[_0x5bec('0x51')](function(_0x125dfb,_0xc3e3df){if(_0x125dfb){_0x39597c=_0xc3e3df;if(!_0xc3e3df){return _0x125dfb[_0x5bec('0x52')]({'inReplyTo':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')][_0x5bec('0x49')],'to':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')][_0x5bec('0x2c')],'cc':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')]['cc'],'subject':_0x414d59[_0x5bec('0x2b')]['message'][_0x5bec('0x4a')],'attach':_0x125dfb[_0x5bec('0x53')]?_0x125dfb['attach']:_0x414d59[_0x5bec('0x2b')]['message'][_0x5bec('0x53')],'substatus':null,'substatusAt':moment()[_0x5bec('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x5bec('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x2b')]});}else{return _0x125dfb;}}})[_0x5bec('0x10')](function(_0x2c7a94){_0x206839['interaction']=_0x2c7a94[_0x5bec('0x38')]({'plain':!![]});_0x206839[_0x5bec('0x54')]['created']=_0x39597c;return db[_0x5bec('0x4e')][_0x5bec('0x47')]({'body':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x2b')],'MailAccountId':_0x414d59['account']['id'],'MailInteractionId':_0x2c7a94['id'],'direction':'in','ContactId':_0x206839[_0x5bec('0x55')]['id'],'messageId':_0x414d59['body'][_0x5bec('0x18')][_0x5bec('0x49')],'from':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')][_0x5bec('0x2c')],'to':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')]['to'],'cc':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')]['cc'],'subject':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')]['subject'],'attach':_0x414d59['body'][_0x5bec('0x18')][_0x5bec('0x53')],'Attachments':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')][_0x5bec('0x56')],'originTo':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')]['originTo'],'originCc':_0x414d59['body'][_0x5bec('0x18')][_0x5bec('0x57')],'bcc':_0x414d59[_0x5bec('0x2b')][_0x5bec('0x18')][_0x5bec('0x58')]},{'include':[{'model':db[_0x5bec('0x59')],'as':_0x5bec('0x5a')}]});})[_0x5bec('0x10')](function(_0x132c57){_0x206839[_0x5bec('0x18')]=_0x132c57;if(_0x206839[_0x5bec('0x54')][_0x5bec('0x5b')]){return db[_0x5bec('0x5c')][_0x5bec('0x23')]({'attributes':['id',_0x5bec('0x5d')],'where':{'id':_0x206839[_0x5bec('0x54')][_0x5bec('0x5b')]}})[_0x5bec('0x10')](function(_0x2201a3){if(_0x2201a3){_0x206839[_0x5bec('0x3b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5bec('0x5e'),'appdata':_0x2201a3['name']+','+(_0x206839['account'][_0x5bec('0x5f')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x5bec('0x60'),'startRouting',_0x206839);});}return respondWithRpcPromise('Start',_0x5bec('0x61'),_0x206839);})[_0x5bec('0x10')](function(_0x5632cc){_0x27863b(_0x5632cc);})[_0x5bec('0x19')](function(_0x7c1a19){_0x3fe548(_0x598e53[_0x5bec('0x15')](0x1f4,_0x7c1a19[_0x5bec('0x18')]));});});};
\ No newline at end of file
+var _0xa75b=['request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailAccount','MailAccount','options','where','attributes','limit','include','map','model','find','raw','ShowMailAccount','stringify','NotifyMailAccount','body','keys','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','MailApplication','Applications','Smtp','account','omit','applications','list','orderBy','asc','length','autoclose','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailMessage','Messages','Contact\x20not\x20found','spread','update','interaction','get','created','attachments','originTo','bcc','Attachment','unshift','agent','name','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s'];(function(_0x2ebb39,_0x5b323a){var _0x1c00e7=function(_0x61225a){while(--_0x61225a){_0x2ebb39['push'](_0x2ebb39['shift']());}};_0x1c00e7(++_0x5b323a);}(_0xa75b,0x170));var _0xba75=function(_0x389ffc,_0x48d273){_0x389ffc=_0x389ffc-0x0;var _0x561ce6=_0xa75b[_0x389ffc];return _0x561ce6;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba75('0x1'));var rs=require(_0xba75('0x2'));var fs=require('fs');var Redis=require(_0xba75('0x3'));var db=require(_0xba75('0x4'))['db'];var utils=require(_0xba75('0x5'));var logger=require(_0xba75('0x6'))(_0xba75('0x7'));var config=require(_0xba75('0x8'));var jayson=require(_0xba75('0x9'));var client=jayson[_0xba75('0xa')][_0xba75('0xb')]({'port':0x232c});config[_0xba75('0xc')]=_[_0xba75('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xba75('0xe'))(new Redis(config['redis']));require('./mailAccount.socket')[_0xba75('0xf')](socket);function respondWithRpcPromise(_0x4f4d0a,_0x2e8905,_0x470836){return new BPromise(function(_0x1371f4,_0x141931){return client[_0xba75('0x10')](_0x4f4d0a,_0x470836)[_0xba75('0x11')](function(_0xb5afb8){logger[_0xba75('0x12')](_0xba75('0x13'),_0x2e8905,_0xba75('0x14'));logger[_0xba75('0x15')](_0xba75('0x16'),_0x2e8905,'request\x20sent',JSON['stringify'](_0xb5afb8));if(_0xb5afb8[_0xba75('0x17')]){if(_0xb5afb8['error'][_0xba75('0x18')]===0x1f4){logger[_0xba75('0x17')](_0xba75('0x13'),_0x2e8905,_0xb5afb8[_0xba75('0x17')]['message']);return _0x141931(_0xb5afb8[_0xba75('0x17')][_0xba75('0x19')]);}logger[_0xba75('0x17')](_0xba75('0x13'),_0x2e8905,_0xb5afb8[_0xba75('0x17')]['message']);return _0x1371f4(_0xb5afb8[_0xba75('0x17')][_0xba75('0x19')]);}else{logger[_0xba75('0x12')]('MailAccount,\x20%s,\x20%s',_0x2e8905,_0xba75('0x14'));_0x1371f4(_0xb5afb8[_0xba75('0x1a')][_0xba75('0x19')]);}})[_0xba75('0x1b')](function(_0x30d1ab){logger[_0xba75('0x17')]('MailAccount,\x20%s,\x20%s',_0x2e8905,_0x30d1ab);_0x141931(_0x30d1ab);});});}exports[_0xba75('0x1c')]=function(_0x3fb8f0){var _0x54c510=this;return new Promise(function(_0x5217aa,_0x35ffd2){return db[_0xba75('0x1d')]['findAll']({'raw':_0x3fb8f0['options']?_0x3fb8f0[_0xba75('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3fb8f0[_0xba75('0x1e')]?_0x3fb8f0[_0xba75('0x1e')][_0xba75('0x1f')]||null:null,'attributes':_0x3fb8f0['options']?_0x3fb8f0[_0xba75('0x1e')][_0xba75('0x20')]||null:null,'limit':_0x3fb8f0[_0xba75('0x1e')]?_0x3fb8f0[_0xba75('0x1e')][_0xba75('0x21')]||null:null,'include':_0x3fb8f0[_0xba75('0x1e')]?_0x3fb8f0['options'][_0xba75('0x22')]?_[_0xba75('0x23')](_0x3fb8f0[_0xba75('0x1e')][_0xba75('0x22')],function(_0x1caa6){return{'model':db[_0x1caa6[_0xba75('0x24')]],'as':_0x1caa6['as'],'attributes':_0x1caa6[_0xba75('0x20')],'include':_0x1caa6[_0xba75('0x22')]?_[_0xba75('0x23')](_0x1caa6[_0xba75('0x22')],function(_0x47ddff){return{'model':db[_0x47ddff['model']],'as':_0x47ddff['as'],'attributes':_0x47ddff['attributes'],'include':_0x47ddff[_0xba75('0x22')]?_['map'](_0x47ddff[_0xba75('0x22')],function(_0x58ea2d){return{'model':db[_0x58ea2d[_0xba75('0x24')]],'as':_0x58ea2d['as'],'attributes':_0x58ea2d[_0xba75('0x20')]};}):[]};}):[]};}):[]:[]})[_0xba75('0x11')](function(_0x4edc2e){logger[_0xba75('0x12')](_0xba75('0x1c'),_0x3fb8f0);logger[_0xba75('0x15')](_0xba75('0x1c'),_0x3fb8f0,JSON['stringify'](_0x4edc2e));_0x5217aa(_0x4edc2e);})['catch'](function(_0x200715){logger['error'](_0xba75('0x1c'),_0x200715[_0xba75('0x19')],_0x3fb8f0);_0x35ffd2(_0x54c510[_0xba75('0x17')](0x1f4,_0x200715[_0xba75('0x19')]));});});};exports['ShowMailAccount']=function(_0x238271){var _0x222d98=this;return new Promise(function(_0x5c1a2e,_0x33a732){return db[_0xba75('0x1d')][_0xba75('0x25')]({'raw':_0x238271[_0xba75('0x1e')]?_0x238271['options'][_0xba75('0x26')]===undefined?!![]:![]:!![],'where':_0x238271[_0xba75('0x1e')]?_0x238271['options'][_0xba75('0x1f')]||null:null,'attributes':_0x238271[_0xba75('0x1e')]?_0x238271[_0xba75('0x1e')]['attributes']||null:null,'include':_0x238271[_0xba75('0x1e')]?_0x238271[_0xba75('0x1e')][_0xba75('0x22')]?_[_0xba75('0x23')](_0x238271[_0xba75('0x1e')][_0xba75('0x22')],function(_0x3d8453){return{'model':db[_0x3d8453['model']],'as':_0x3d8453['as'],'attributes':_0x3d8453['attributes'],'include':_0x3d8453[_0xba75('0x22')]?_[_0xba75('0x23')](_0x3d8453[_0xba75('0x22')],function(_0x5c6f1a){return{'model':db[_0x5c6f1a[_0xba75('0x24')]],'as':_0x5c6f1a['as'],'attributes':_0x5c6f1a[_0xba75('0x20')],'include':_0x5c6f1a['include']?_['map'](_0x5c6f1a[_0xba75('0x22')],function(_0x4d2933){return{'model':db[_0x4d2933[_0xba75('0x24')]],'as':_0x4d2933['as'],'attributes':_0x4d2933[_0xba75('0x20')]};}):[]};}):[]};}):[]:[]})[_0xba75('0x11')](function(_0x541989){logger['info'](_0xba75('0x27'),_0x238271);logger[_0xba75('0x15')](_0xba75('0x27'),_0x238271,JSON[_0xba75('0x28')](_0x541989));_0x5c1a2e(_0x541989);})[_0xba75('0x1b')](function(_0x22694f){logger[_0xba75('0x17')]('ShowMailAccount',_0x22694f[_0xba75('0x19')],_0x238271);_0x33a732(_0x222d98[_0xba75('0x17')](0x1f4,_0x22694f['message']));});});};exports[_0xba75('0x29')]=function(_0x3740bd){var _0x2d56c0=this;return new Promise(function(_0x45d8cd,_0x360bf7){var _0x32a61d={'body':_0x3740bd[_0xba75('0x2a')],'channel':'mail'};var _0xf6edc7=_['difference'](_[_0xba75('0x2b')](db['CmContact'][_0xba75('0x2c')]),[_0xba75('0x2d'),_0xba75('0x2e'),_0xba75('0x2f'),_0xba75('0x30')]);var _0x30338c=![];if(_0x3740bd[_0xba75('0x2a')]['id']){delete _0x3740bd[_0xba75('0x2a')]['id'];}if(_[_0xba75('0x31')](_0x3740bd['body'][_0xba75('0x32')])){return _0x360bf7(_0x2d56c0[_0xba75('0x17')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xba75('0x31')](_0x3740bd[_0xba75('0x2a')][_0xba75('0x2a')])||_0x3740bd['body']['body']===''){return _0x360bf7(_0x2d56c0['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xba75('0x31')](_0x3740bd['body'][_0xba75('0x33')])){return _0x360bf7(_0x2d56c0[_0xba75('0x17')](0x1f4,_0xba75('0x34')+_0xf6edc7));}if(!_[_0xba75('0x35')](_0xf6edc7,_0x3740bd[_0xba75('0x2a')]['mapKey'])){return _0x360bf7(_0x2d56c0['error'](0x1f4,_0xba75('0x36')+_0xf6edc7));}var _0x4c7d83={};_0x4c7d83[_0x3740bd[_0xba75('0x2a')]['mapKey']]=_0x3740bd[_0xba75('0x2a')][_0xba75('0x32')];return db[_0xba75('0x1d')][_0xba75('0x25')]({'where':{'id':_0x3740bd['account']['id']},'include':[{'model':db[_0xba75('0x37')],'as':_0xba75('0x38'),'include':[{'model':db[_0xba75('0x39')],'as':_0xba75('0x3a'),'where':_0x4c7d83,'limit':0x1,'order':[[_0xba75('0x2e'),_0xba75('0x3b')]]}]},{'model':db[_0xba75('0x3c')],'as':_0xba75('0x3d')},{'model':db['MailServerOut'],'as':_0xba75('0x3e')}]})[_0xba75('0x11')](function(_0x7c297b){if(_0x7c297b&&_0x7c297b[_0xba75('0x38')]){var _0xbd5c97=_0x7c297b['get']({'plain':!![]});_0x32a61d[_0xba75('0x3f')]=_[_0xba75('0x40')](_0xbd5c97,[_0xba75('0x3d'),_0xba75('0x38')]);_0x32a61d[_0xba75('0x41')]=_0xbd5c97[_0xba75('0x3d')];_0x32a61d[_0xba75('0x42')]=_0xbd5c97['List'];_0x32a61d[_0xba75('0x41')]=_[_0xba75('0x43')](_0x32a61d[_0xba75('0x41')],['priority'],[_0xba75('0x44')]);if(_0x32a61d[_0xba75('0x3f')]&&_0x32a61d['account']['autoclose']){_0x32a61d[_0xba75('0x41')]['push']({'id':0x0,'priority':_0x32a61d['applications'][_0xba75('0x45')]+0x1,'app':'close','appdata':_0xba75('0x46'),'interval':_0xba75('0x47')});}if(_0x32a61d[_0xba75('0x3f')][_0xba75('0x3d')]){delete _0x32a61d[_0xba75('0x3f')]['Applications'];}if(_0x32a61d[_0xba75('0x3f')][_0xba75('0x38')]){delete _0x32a61d['account'][_0xba75('0x38')];}if(_0xbd5c97[_0xba75('0x38')][_0xba75('0x3a')][_0xba75('0x45')]){return _0xbd5c97[_0xba75('0x38')]['Contacts'][0x0];}var _0x43f4b7=_[_0xba75('0xd')](_0x3740bd['body'],{'firstName':_0x3740bd[_0xba75('0x2a')][_0xba75('0x32')],'ListId':_0xbd5c97[_0xba75('0x30')]});_0x43f4b7[_0x3740bd[_0xba75('0x2a')][_0xba75('0x33')]]=_0x3740bd[_0xba75('0x2a')]['from'];return db[_0xba75('0x39')][_0xba75('0x48')](_0x43f4b7);}else{throw new Error(_0xba75('0x49'));}})[_0xba75('0x11')](function(_0x38129c){_0x32a61d[_0xba75('0x4a')]=_0x38129c;if(_0x38129c){if(!_0x3740bd['body']['message']['messageId']){_0x3740bd['body'][_0xba75('0x19')][_0xba75('0x4b')]=rs[_0xba75('0x4c')]()+'\x20'+_0x3740bd[_0xba75('0x2a')][_0xba75('0x19')][_0xba75('0x32')];}var _0x3935bd={'ContactId':_0x38129c['id'],'MailAccountId':_0x3740bd['account']['id'],'inReplyTo':_0x3740bd[_0xba75('0x2a')][_0xba75('0x19')][_0xba75('0x4b')],'to':_0x3740bd[_0xba75('0x2a')]['message'][_0xba75('0x32')],'cc':_0x3740bd[_0xba75('0x2a')]['message']['cc'],'subject':_0x3740bd[_0xba75('0x2a')]['message'][_0xba75('0x4d')],'attach':_0x3740bd[_0xba75('0x2a')]['message'][_0xba75('0x4e')],'lastMsgAt':moment()[_0xba75('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x3740bd['body'][_0xba75('0x2a')]};return db['MailInteraction'][_0xba75('0x25')]({'where':{'closed':![],'MailAccountId':_0x3740bd['account']['id']},'include':[{'model':db[_0xba75('0x50')],'as':_0xba75('0x51'),'attributes':[_0xba75('0x4b')],'where':{'messageId':_0x3740bd[_0xba75('0x2a')][_0xba75('0x19')]['inReplyTo']}}]})[_0xba75('0x11')](function(_0x32e2ae){if(_0x32e2ae){return[_0x32e2ae,![]];}return db['MailInteraction'][_0xba75('0x48')](_0x3935bd)[_0xba75('0x11')](function(_0x16f8ff){return[_0x16f8ff,!![]];});});}else{throw new Error(_0xba75('0x52'));}})[_0xba75('0x53')](function(_0x1d3331,_0x3b2dbb){if(_0x1d3331){_0x30338c=_0x3b2dbb;if(!_0x3b2dbb){return _0x1d3331[_0xba75('0x54')]({'inReplyTo':_0x3740bd[_0xba75('0x2a')][_0xba75('0x19')][_0xba75('0x4b')],'to':_0x3740bd[_0xba75('0x2a')]['message']['from'],'cc':_0x3740bd[_0xba75('0x2a')][_0xba75('0x19')]['cc'],'subject':_0x3740bd[_0xba75('0x2a')][_0xba75('0x19')][_0xba75('0x4d')],'attach':_0x1d3331[_0xba75('0x4e')]?_0x1d3331[_0xba75('0x4e')]:_0x3740bd[_0xba75('0x2a')][_0xba75('0x19')][_0xba75('0x4e')],'substatus':null,'substatusAt':moment()[_0xba75('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xba75('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x3740bd[_0xba75('0x2a')][_0xba75('0x2a')]});}else{return _0x1d3331;}}})[_0xba75('0x11')](function(_0x43b73b){_0x32a61d[_0xba75('0x55')]=_0x43b73b[_0xba75('0x56')]({'plain':!![]});_0x32a61d['interaction'][_0xba75('0x57')]=_0x30338c;return db['MailMessage'][_0xba75('0x48')]({'body':_0x3740bd[_0xba75('0x2a')]['body'],'MailAccountId':_0x3740bd['account']['id'],'MailInteractionId':_0x43b73b['id'],'direction':'in','ContactId':_0x32a61d[_0xba75('0x4a')]['id'],'messageId':_0x3740bd[_0xba75('0x2a')][_0xba75('0x19')][_0xba75('0x4b')],'from':_0x3740bd[_0xba75('0x2a')][_0xba75('0x19')]['from'],'to':_0x3740bd[_0xba75('0x2a')][_0xba75('0x19')]['to'],'cc':_0x3740bd['body'][_0xba75('0x19')]['cc'],'subject':_0x3740bd[_0xba75('0x2a')][_0xba75('0x19')][_0xba75('0x4d')],'attach':_0x3740bd[_0xba75('0x2a')]['message'][_0xba75('0x4e')],'Attachments':_0x3740bd['body'][_0xba75('0x19')][_0xba75('0x58')],'originTo':_0x3740bd[_0xba75('0x2a')][_0xba75('0x19')][_0xba75('0x59')],'originCc':_0x3740bd[_0xba75('0x2a')]['message']['originCc'],'bcc':_0x3740bd[_0xba75('0x2a')]['message'][_0xba75('0x5a')]},{'include':[{'model':db[_0xba75('0x5b')],'as':'Attachments'}]});})[_0xba75('0x11')](function(_0x178cb3){_0x32a61d[_0xba75('0x19')]=_0x178cb3;if(_0x32a61d['interaction']['UserId']){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x32a61d[_0xba75('0x55')]['UserId']}})[_0xba75('0x11')](function(_0x159c0a){if(_0x159c0a){_0x32a61d[_0xba75('0x41')][_0xba75('0x5c')]({'id':0x0,'priority':0x0,'app':_0xba75('0x5d'),'appdata':_0x159c0a[_0xba75('0x5e')]+','+(_0x32a61d[_0xba75('0x3f')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xba75('0x5f'),_0xba75('0x60'),_0x32a61d);});}return respondWithRpcPromise('Start',_0xba75('0x60'),_0x32a61d);})['then'](function(_0x43506d){_0x45d8cd(_0x43506d);})[_0xba75('0x1b')](function(_0x5ade59){_0x360bf7(_0x2d56c0[_0xba75('0x17')](0x1f4,_0x5ade59['message']));});});};
\ No newline at end of file
index a2a0234..f2c83e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5183=['./mailAccount.events','save','remove','emit','register','mailAccount:'];(function(_0x192088,_0x2e43a8){var _0x4fd3e0=function(_0x43778b){while(--_0x43778b){_0x192088['push'](_0x192088['shift']());}};_0x4fd3e0(++_0x2e43a8);}(_0x5183,0x13e));var _0x3518=function(_0x4da368,_0x3d81de){_0x4da368=_0x4da368-0x0;var _0x4c713a=_0x5183[_0x4da368];return _0x4c713a;};'use strict';var MailAccountEvents=require(_0x3518('0x0'));var events=[_0x3518('0x1'),_0x3518('0x2'),'update'];function createListener(_0x5b6958,_0x2323f3){return function(_0x3cc276){_0x2323f3[_0x3518('0x3')](_0x5b6958,_0x3cc276);};}function removeListener(_0x421ab5,_0x5a38df){return function(){MailAccountEvents['removeListener'](_0x421ab5,_0x5a38df);};}exports[_0x3518('0x4')]=function(_0x1031a9){for(var _0x2c019c=0x0,_0x482b2d=events['length'];_0x2c019c<_0x482b2d;_0x2c019c++){var _0x488c52=events[_0x2c019c];var _0x147b59=createListener(_0x3518('0x5')+_0x488c52,_0x1031a9);MailAccountEvents['on'](_0x488c52,_0x147b59);}};
\ No newline at end of file
+var _0x92e0=['removeListener','register','length','mailAccount:','./mailAccount.events','remove','update','emit'];(function(_0x26f7d4,_0x5d0acf){var _0x4676ed=function(_0x42e9ec){while(--_0x42e9ec){_0x26f7d4['push'](_0x26f7d4['shift']());}};_0x4676ed(++_0x5d0acf);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require(_0x092e('0x0'));var events=['save',_0x092e('0x1'),_0x092e('0x2')];function createListener(_0x2e3997,_0x116cd1){return function(_0x10ccfe){_0x116cd1[_0x092e('0x3')](_0x2e3997,_0x10ccfe);};}function removeListener(_0x3756db,_0x416760){return function(){MailAccountEvents[_0x092e('0x4')](_0x3756db,_0x416760);};}exports[_0x092e('0x5')]=function(_0x51779f){for(var _0x48af76=0x0,_0x2f1f0b=events[_0x092e('0x6')];_0x48af76<_0x2f1f0b;_0x48af76++){var _0x1af53d=events[_0x48af76];var _0x4c73a9=createListener(_0x092e('0x7')+_0x1af53d,_0x51779f);MailAccountEvents['on'](_0x1af53d,_0x4c73a9);}};
\ No newline at end of file
index 804f247..78ba632 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3d1=['delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x314455,_0x47941a){var _0x423847=function(_0xc37a46){while(--_0xc37a46){_0x314455['push'](_0x314455['shift']());}};_0x423847(++_0x47941a);}(_0xd3d1,0x172));var _0x1d3d=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xd3d1[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d3d('0x2'));var router=express[_0x1d3d('0x3')]();var auth=require(_0x1d3d('0x4'));var interaction=require(_0x1d3d('0x5'));var config=require(_0x1d3d('0x6'));var controller=require(_0x1d3d('0x7'));router[_0x1d3d('0x8')](_0x1d3d('0x9'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xb')]);router[_0x1d3d('0xc')](_0x1d3d('0x9'),auth[_0x1d3d('0xa')](),controller[_0x1d3d('0xd')]);router[_0x1d3d('0xe')](_0x1d3d('0x9'),auth[_0x1d3d('0xa')](),controller['destroy']);module[_0x1d3d('0xf')]=router;
\ No newline at end of file
+var _0x6324=['multer','util','path','connect-timeout','Router','../../components/interaction/service','./mailApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0x621bee,_0x58f8c0){var _0x3076c8=function(_0x228229){while(--_0x228229){_0x621bee['push'](_0x621bee['shift']());}};_0x3076c8(++_0x58f8c0);}(_0x6324,0x142));var _0x4632=function(_0x18be13,_0x12f269){_0x18be13=_0x18be13-0x0;var _0x17317b=_0x6324[_0x18be13];return _0x17317b;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4632('0x5'));var config=require('../../config/environment');var controller=require(_0x4632('0x6'));router['get'](_0x4632('0x7'),auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0xa')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router[_0x4632('0xc')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xd')]);module['exports']=router;
\ No newline at end of file
index fffbba4..12cc314 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd836=['STRING','TEXT','INTEGER'];(function(_0x222688,_0x46c5eb){var _0x437433=function(_0x29958c){while(--_0x29958c){_0x222688['push'](_0x222688['shift']());}};_0x437433(++_0x46c5eb);}(_0xd836,0x16d));var _0x6d83=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd836[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x6d83('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x6d83('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6d83('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xdc1f=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x1c41f7,_0x7f257b){var _0x4d5733=function(_0x5d44a1){while(--_0x5d44a1){_0x1c41f7['push'](_0x1c41f7['shift']());}};_0x4d5733(++_0x7f257b);}(_0xdc1f,0xaf));var _0xfdc1=function(_0x19b29a,_0x555030){_0x19b29a=_0x19b29a-0x0;var _0x4f028d=_0xdc1f[_0x19b29a];return _0x4f028d;};'use strict';var Sequelize=require(_0xfdc1('0x0'));module[_0xfdc1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xfdc1('0x2')],'allowNull':![],'defaultValue':_0xfdc1('0x3')},'appdata':{'type':Sequelize[_0xfdc1('0x4')]()},'description':{'type':Sequelize[_0xfdc1('0x2')]},'interval':{'type':Sequelize[_0xfdc1('0x2')],'defaultValue':_0xfdc1('0x5')}};
\ No newline at end of file
index e5fbff7..4fa2782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9789=['model','query','keys','filters','intersection','attributes','fields','length','includeAll','include','options','MailApplication','find','catch','update','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','show'];(function(_0x577eed,_0x1a5cf5){var _0x43bf78=function(_0x5f33ef){while(--_0x5f33ef){_0x577eed['push'](_0x577eed['shift']());}};_0x43bf78(++_0x1a5cf5);}(_0x9789,0x1bc));var _0x9978=function(_0xca82a4,_0x407eb4){_0xca82a4=_0xca82a4-0x0;var _0x5eed21=_0x9789[_0xca82a4];return _0x5eed21;};'use strict';var pdf=require(_0x9978('0x0'));var emlformat=require(_0x9978('0x1'));var rimraf=require(_0x9978('0x2'));var zipdir=require(_0x9978('0x3'));var jsonpatch=require(_0x9978('0x4'));var rp=require(_0x9978('0x5'));var moment=require(_0x9978('0x6'));var BPromise=require(_0x9978('0x7'));var Mustache=require(_0x9978('0x8'));var util=require(_0x9978('0x9'));var path=require(_0x9978('0xa'));var sox=require(_0x9978('0xb'));var csv=require(_0x9978('0xc'));var ejs=require(_0x9978('0xd'));var fs=require('fs');var _=require(_0x9978('0xe'));var squel=require(_0x9978('0xf'));var crypto=require(_0x9978('0x10'));var jsforce=require(_0x9978('0x11'));var deskjs=require(_0x9978('0x12'));var toCsv=require(_0x9978('0xc'));var querystring=require(_0x9978('0x13'));var Papa=require('papaparse');var Redis=require(_0x9978('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x9978('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9978('0x16'));var logger=require(_0x9978('0x17'))(_0x9978('0x18'));var utils=require('../../config/utils');var config=require(_0x9978('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f3f82,_0xd21833){_0xd21833=_0xd21833||0xcc;return function(_0x1b99e6){if(_0x1b99e6){return _0x4f3f82[_0x9978('0x1a')](_0xd21833);}return _0x4f3f82[_0x9978('0x1b')](_0xd21833)[_0x9978('0x1c')]();};}function respondWithResult(_0x2614cc,_0x44def9){_0x44def9=_0x44def9||0xc8;return function(_0x26beee){if(_0x26beee){return _0x2614cc['status'](_0x44def9)[_0x9978('0x1d')](_0x26beee);}};}function respondWithFilteredResult(_0x242fc1,_0x2da5bb){return function(_0x3957d0){if(_0x3957d0){var _0x4356c4=_0x3957d0[_0x9978('0x1e')],_0x1a662a=_0x2da5bb[_0x9978('0x1f')],_0x1a9b18=_0x2da5bb[_0x9978('0x1f')]+_0x2da5bb[_0x9978('0x20')],_0x402e43;if(_0x1a9b18>=_0x4356c4){_0x1a9b18=_0x4356c4;_0x402e43=0xc8;}else{_0x402e43=0xce;}_0x242fc1[_0x9978('0x1b')](_0x402e43);return _0x242fc1[_0x9978('0x21')](_0x9978('0x22'),_0x1a662a+'-'+_0x1a9b18+'/'+_0x4356c4)[_0x9978('0x1d')](_0x3957d0);}return null;};}function patchUpdates(_0x35c34a){return function(_0x58fb50){try{jsonpatch[_0x9978('0x23')](_0x58fb50,_0x35c34a,!![]);}catch(_0x147a13){return BPromise[_0x9978('0x24')](_0x147a13);}return _0x58fb50[_0x9978('0x25')]();};}function saveUpdates(_0x13387d,_0x29df6e){return function(_0x101a99){if(_0x101a99){return _0x101a99['update'](_0x13387d)[_0x9978('0x26')](function(_0x2c32ae){return _0x2c32ae;});}return null;};}function removeEntity(_0x228ab7,_0x1fefb5){return function(_0x2aca0f){if(_0x2aca0f){return _0x2aca0f[_0x9978('0x27')]()['then'](function(){_0x228ab7[_0x9978('0x1b')](0xcc)[_0x9978('0x1c')]();});}};}function handleEntityNotFound(_0x2041bc,_0x858118){return function(_0x19f42d){if(!_0x19f42d){_0x2041bc[_0x9978('0x1a')](0x194);}return _0x19f42d;};}function handleError(_0x4a9bdb,_0x593da4){_0x593da4=_0x593da4||0x1f4;return function(_0x3489bd){logger['error'](_0x3489bd[_0x9978('0x28')]);if(_0x3489bd[_0x9978('0x29')]){delete _0x3489bd[_0x9978('0x29')];}_0x4a9bdb[_0x9978('0x1b')](_0x593da4)[_0x9978('0x2a')](_0x3489bd);};}exports[_0x9978('0x2b')]=function(_0x5d9b03,_0x64e832){var _0x2f0e40={'raw':!![],'where':{'id':_0x5d9b03['params']['id']}},_0x54a017={};_0x54a017[_0x9978('0x2c')]=_['keys'](db['MailApplication']['rawAttributes']);_0x54a017[_0x9978('0x2d')]=_[_0x9978('0x2e')](_0x5d9b03[_0x9978('0x2d')]);_0x54a017[_0x9978('0x2f')]=_[_0x9978('0x30')](_0x54a017[_0x9978('0x2c')],_0x54a017[_0x9978('0x2d')]);_0x2f0e40[_0x9978('0x31')]=_[_0x9978('0x30')](_0x54a017['model'],qs[_0x9978('0x32')](_0x5d9b03['query'][_0x9978('0x32')]));_0x2f0e40[_0x9978('0x31')]=_0x2f0e40['attributes'][_0x9978('0x33')]?_0x2f0e40['attributes']:_0x54a017['model'];if(_0x5d9b03[_0x9978('0x2d')][_0x9978('0x34')]){_0x2f0e40[_0x9978('0x35')]=[{'all':!![]}];}_0x2f0e40=_['merge']({},_0x2f0e40,_0x5d9b03[_0x9978('0x36')]);return db[_0x9978('0x37')][_0x9978('0x38')](_0x2f0e40)[_0x9978('0x26')](handleEntityNotFound(_0x64e832,null))[_0x9978('0x26')](respondWithResult(_0x64e832,null))[_0x9978('0x39')](handleError(_0x64e832,null));};exports[_0x9978('0x3a')]=function(_0x37555d,_0x26d1d7){if(_0x37555d[_0x9978('0x3b')]['id']){delete _0x37555d[_0x9978('0x3b')]['id'];}return db[_0x9978('0x37')]['find']({'where':{'id':_0x37555d['params']['id']}})['then'](handleEntityNotFound(_0x26d1d7,null))[_0x9978('0x26')](saveUpdates(_0x37555d['body'],null))[_0x9978('0x26')](respondWithResult(_0x26d1d7,null))[_0x9978('0x39')](handleError(_0x26d1d7,null));};exports[_0x9978('0x27')]=function(_0x25b6de,_0x1493ab){return db[_0x9978('0x37')][_0x9978('0x38')]({'where':{'id':_0x25b6de[_0x9978('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1493ab,null))[_0x9978('0x26')](removeEntity(_0x1493ab,null))['catch'](handleError(_0x1493ab,null));};
\ No newline at end of file
+var _0x003f=['limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','params','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','model','fields','length','includeAll','merge','options','find','catch','body','destroy','html-pdf','eml-format','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset'];(function(_0x485b21,_0x5dc3ef){var _0x13d35a=function(_0x189d43){while(--_0x189d43){_0x485b21['push'](_0x485b21['shift']());}};_0x13d35a(++_0x5dc3ef);}(_0x003f,0x1ad));var _0xf003=function(_0x143187,_0x3f55af){_0x143187=_0x143187-0x0;var _0x5cbff7=_0x003f[_0x143187];return _0x5cbff7;};'use strict';var pdf=require(_0xf003('0x0'));var emlformat=require(_0xf003('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf003('0x2'));var moment=require(_0xf003('0x3'));var BPromise=require(_0xf003('0x4'));var Mustache=require(_0xf003('0x5'));var util=require('util');var path=require(_0xf003('0x6'));var sox=require(_0xf003('0x7'));var csv=require('to-csv');var ejs=require(_0xf003('0x8'));var fs=require('fs');var _=require(_0xf003('0x9'));var squel=require(_0xf003('0xa'));var crypto=require('crypto');var jsforce=require(_0xf003('0xb'));var deskjs=require(_0xf003('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf003('0xd'));var authService=require(_0xf003('0xe'));var qs=require(_0xf003('0xf'));var as=require(_0xf003('0x10'));var hardwareService=require(_0xf003('0x11'));var logger=require(_0xf003('0x12'))(_0xf003('0x13'));var utils=require(_0xf003('0x14'));var config=require(_0xf003('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x72fa6b,_0x1694dc){_0x1694dc=_0x1694dc||0xcc;return function(_0xfdcff3){if(_0xfdcff3){return _0x72fa6b['sendStatus'](_0x1694dc);}return _0x72fa6b[_0xf003('0x16')](_0x1694dc)[_0xf003('0x17')]();};}function respondWithResult(_0x597898,_0x5e2c46){_0x5e2c46=_0x5e2c46||0xc8;return function(_0x1452b1){if(_0x1452b1){return _0x597898[_0xf003('0x16')](_0x5e2c46)[_0xf003('0x18')](_0x1452b1);}};}function respondWithFilteredResult(_0x1dfd84,_0x3cde58){return function(_0x829d8f){if(_0x829d8f){var _0xf6608c=_0x829d8f[_0xf003('0x19')],_0x4ba12e=_0x3cde58[_0xf003('0x1a')],_0x33ac7e=_0x3cde58[_0xf003('0x1a')]+_0x3cde58[_0xf003('0x1b')],_0x1a2357;if(_0x33ac7e>=_0xf6608c){_0x33ac7e=_0xf6608c;_0x1a2357=0xc8;}else{_0x1a2357=0xce;}_0x1dfd84[_0xf003('0x16')](_0x1a2357);return _0x1dfd84[_0xf003('0x1c')](_0xf003('0x1d'),_0x4ba12e+'-'+_0x33ac7e+'/'+_0xf6608c)['json'](_0x829d8f);}return null;};}function patchUpdates(_0x2589a2){return function(_0xb6a9fa){try{jsonpatch[_0xf003('0x1e')](_0xb6a9fa,_0x2589a2,!![]);}catch(_0x165dfd){return BPromise[_0xf003('0x1f')](_0x165dfd);}return _0xb6a9fa[_0xf003('0x20')]();};}function saveUpdates(_0x3e2230,_0x27c8c7){return function(_0x505c79){if(_0x505c79){return _0x505c79[_0xf003('0x21')](_0x3e2230)[_0xf003('0x22')](function(_0x6495a5){return _0x6495a5;});}return null;};}function removeEntity(_0x43b0df,_0x3feb20){return function(_0x9d66b8){if(_0x9d66b8){return _0x9d66b8['destroy']()[_0xf003('0x22')](function(){_0x43b0df[_0xf003('0x16')](0xcc)[_0xf003('0x17')]();});}};}function handleEntityNotFound(_0x8bcd3,_0x13cf8a){return function(_0x5c5218){if(!_0x5c5218){_0x8bcd3[_0xf003('0x23')](0x194);}return _0x5c5218;};}function handleError(_0x4ef2cb,_0x390a1e){_0x390a1e=_0x390a1e||0x1f4;return function(_0x5de6fc){logger[_0xf003('0x24')](_0x5de6fc[_0xf003('0x25')]);if(_0x5de6fc[_0xf003('0x26')]){delete _0x5de6fc['name'];}_0x4ef2cb[_0xf003('0x16')](_0x390a1e)['send'](_0x5de6fc);};}exports['show']=function(_0x4fa5d5,_0x45819c){var _0x34c8ac={'raw':!![],'where':{'id':_0x4fa5d5[_0xf003('0x27')]['id']}},_0x300dac={};_0x300dac['model']=_[_0xf003('0x28')](db[_0xf003('0x29')][_0xf003('0x2a')]);_0x300dac[_0xf003('0x2b')]=_[_0xf003('0x28')](_0x4fa5d5['query']);_0x300dac[_0xf003('0x2c')]=_['intersection'](_0x300dac['model'],_0x300dac[_0xf003('0x2b')]);_0x34c8ac[_0xf003('0x2d')]=_[_0xf003('0x2e')](_0x300dac[_0xf003('0x2f')],qs[_0xf003('0x30')](_0x4fa5d5[_0xf003('0x2b')][_0xf003('0x30')]));_0x34c8ac[_0xf003('0x2d')]=_0x34c8ac[_0xf003('0x2d')][_0xf003('0x31')]?_0x34c8ac[_0xf003('0x2d')]:_0x300dac[_0xf003('0x2f')];if(_0x4fa5d5[_0xf003('0x2b')][_0xf003('0x32')]){_0x34c8ac['include']=[{'all':!![]}];}_0x34c8ac=_[_0xf003('0x33')]({},_0x34c8ac,_0x4fa5d5[_0xf003('0x34')]);return db['MailApplication'][_0xf003('0x35')](_0x34c8ac)[_0xf003('0x22')](handleEntityNotFound(_0x45819c,null))[_0xf003('0x22')](respondWithResult(_0x45819c,null))[_0xf003('0x36')](handleError(_0x45819c,null));};exports[_0xf003('0x21')]=function(_0x1ee3fa,_0x1ab111){if(_0x1ee3fa[_0xf003('0x37')]['id']){delete _0x1ee3fa['body']['id'];}return db['MailApplication'][_0xf003('0x35')]({'where':{'id':_0x1ee3fa[_0xf003('0x27')]['id']}})[_0xf003('0x22')](handleEntityNotFound(_0x1ab111,null))[_0xf003('0x22')](saveUpdates(_0x1ee3fa[_0xf003('0x37')],null))['then'](respondWithResult(_0x1ab111,null))[_0xf003('0x36')](handleError(_0x1ab111,null));};exports[_0xf003('0x38')]=function(_0x35e6da,_0x2494dc){return db[_0xf003('0x29')][_0xf003('0x35')]({'where':{'id':_0x35e6da[_0xf003('0x27')]['id']}})[_0xf003('0x22')](handleEntityNotFound(_0x2494dc,null))[_0xf003('0x22')](removeEntity(_0x2494dc,null))['catch'](handleError(_0x2494dc,null));};
\ No newline at end of file
index 9809139..3cda2f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3fb=['../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd3fb,0x93));var _0xbd3f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd3fb[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xbd3f('0x0'));var util=require(_0xbd3f('0x1'));var logger=require(_0xbd3f('0x2'))(_0xbd3f('0x3'));var moment=require(_0xbd3f('0x4'));var BPromise=require(_0xbd3f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbd3f('0x6'));var config=require(_0xbd3f('0x7'));var attributes=require(_0xbd3f('0x8'));module[_0xbd3f('0x9')]=function(_0x1918c3,_0x1ac988){return _0x1918c3[_0xbd3f('0xa')](_0xbd3f('0xb'),attributes,{'tableName':_0xbd3f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbd3f('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9752=['utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','define','mail_applications'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x9752,0x7b));var _0x2975=function(_0x45a0e3,_0xe5ed1b){_0x45a0e3=_0x45a0e3-0x0;var _0x365f01=_0x9752[_0x45a0e3];return _0x365f01;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2975('0x0'));var moment=require(_0x2975('0x1'));var BPromise=require(_0x2975('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2975('0x3'));var rimraf=require(_0x2975('0x4'));var config=require(_0x2975('0x5'));var attributes=require(_0x2975('0x6'));module['exports']=function(_0x36e942,_0x2099bb){return _0x36e942[_0x2975('0x7')]('MailApplication',attributes,{'tableName':_0x2975('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2975('0x9'),'collate':_0x2975('0xa')});};
\ No newline at end of file
index 162dcd2..a5ec922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7eb8=['request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailApplication','body','options','raw','attributes','limit','UpdateMailApplication','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','MailApplication,\x20%s,\x20%s'];(function(_0x470e67,_0x4a596d){var _0x28bbde=function(_0x1bbf56){while(--_0x1bbf56){_0x470e67['push'](_0x470e67['shift']());}};_0x28bbde(++_0x4a596d);}(_0x7eb8,0x7b));var _0x87eb=function(_0x31c083,_0x2c7696){_0x31c083=_0x31c083-0x0;var _0x2436c2=_0x7eb8[_0x31c083];return _0x2436c2;};'use strict';var _=require(_0x87eb('0x0'));var util=require(_0x87eb('0x1'));var moment=require('moment');var BPromise=require(_0x87eb('0x2'));var rs=require(_0x87eb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x87eb('0x4'));var logger=require(_0x87eb('0x5'))(_0x87eb('0x6'));var config=require('../../config/environment');var jayson=require(_0x87eb('0x7'));var client=jayson[_0x87eb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36d13e,_0x31ca01,_0x1ef8ce){return new BPromise(function(_0x5c4402,_0x504032){return client['request'](_0x36d13e,_0x1ef8ce)[_0x87eb('0x9')](function(_0x5d067a){logger[_0x87eb('0xa')](_0x87eb('0xb'),_0x31ca01,_0x87eb('0xc'));logger[_0x87eb('0xd')](_0x87eb('0xe'),_0x31ca01,_0x87eb('0xc'),JSON[_0x87eb('0xf')](_0x5d067a));if(_0x5d067a[_0x87eb('0x10')]){if(_0x5d067a['error'][_0x87eb('0x11')]===0x1f4){logger[_0x87eb('0x10')](_0x87eb('0xb'),_0x31ca01,_0x5d067a[_0x87eb('0x10')][_0x87eb('0x12')]);return _0x504032(_0x5d067a['error'][_0x87eb('0x12')]);}logger[_0x87eb('0x10')](_0x87eb('0xb'),_0x31ca01,_0x5d067a[_0x87eb('0x10')][_0x87eb('0x12')]);return _0x5c4402(_0x5d067a[_0x87eb('0x10')][_0x87eb('0x12')]);}else{logger[_0x87eb('0xa')]('MailApplication,\x20%s,\x20%s',_0x31ca01,_0x87eb('0xc'));_0x5c4402(_0x5d067a['result'][_0x87eb('0x12')]);}})['catch'](function(_0x56ab0d){logger[_0x87eb('0x10')]('MailApplication,\x20%s,\x20%s',_0x31ca01,_0x56ab0d);_0x504032(_0x56ab0d);});});}exports['UpdateMailApplication']=function(_0x572d39){var _0x470738=this;return new Promise(function(_0x45238c,_0x2494a1){return db[_0x87eb('0x13')]['update'](_0x572d39[_0x87eb('0x14')],{'raw':_0x572d39[_0x87eb('0x15')]?_0x572d39[_0x87eb('0x15')][_0x87eb('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x572d39['options']?_0x572d39[_0x87eb('0x15')]['where']||null:null,'attributes':_0x572d39['options']?_0x572d39[_0x87eb('0x15')][_0x87eb('0x17')]||null:null,'limit':_0x572d39[_0x87eb('0x15')]?_0x572d39[_0x87eb('0x15')][_0x87eb('0x18')]||null:null})[_0x87eb('0x9')](function(_0x33dbb5){logger[_0x87eb('0xa')](_0x87eb('0x19'),_0x572d39);logger[_0x87eb('0xd')](_0x87eb('0x19'),_0x572d39,JSON[_0x87eb('0xf')](_0x33dbb5));_0x45238c(_0x33dbb5);})[_0x87eb('0x1a')](function(_0x5a35ed){logger['error'](_0x87eb('0x19'),_0x5a35ed[_0x87eb('0x12')],_0x572d39);_0x2494a1(_0x470738[_0x87eb('0x10')](0x1f4,_0x5a35ed[_0x87eb('0x12')]));});});};
\ No newline at end of file
+var _0xa4fc=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','MailApplication,\x20%s,\x20%s','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','debug','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x571051,_0x80ee6d){var _0xa957ce=function(_0x31d0e2){while(--_0x31d0e2){_0x571051['push'](_0x571051['shift']());}};_0xa957ce(++_0x80ee6d);}(_0xa4fc,0xfb));var _0xca4f=function(_0x4df4ae,_0x1b53e9){_0x4df4ae=_0x4df4ae-0x0;var _0x4f86e7=_0xa4fc[_0x4df4ae];return _0x4f86e7;};'use strict';var _=require(_0xca4f('0x0'));var util=require(_0xca4f('0x1'));var moment=require(_0xca4f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca4f('0x3'));var db=require(_0xca4f('0x4'))['db'];var utils=require(_0xca4f('0x5'));var logger=require(_0xca4f('0x6'))(_0xca4f('0x7'));var config=require(_0xca4f('0x8'));var jayson=require(_0xca4f('0x9'));var client=jayson['client'][_0xca4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18aea9,_0x2eba6b,_0x25d635){return new BPromise(function(_0x51d71e,_0x4c1e46){return client[_0xca4f('0xb')](_0x18aea9,_0x25d635)[_0xca4f('0xc')](function(_0x7fa37){logger['info']('MailApplication,\x20%s,\x20%s',_0x2eba6b,_0xca4f('0xd'));logger['debug'](_0xca4f('0xe'),_0x2eba6b,_0xca4f('0xd'),JSON[_0xca4f('0xf')](_0x7fa37));if(_0x7fa37[_0xca4f('0x10')]){if(_0x7fa37[_0xca4f('0x10')]['code']===0x1f4){logger[_0xca4f('0x10')]('MailApplication,\x20%s,\x20%s',_0x2eba6b,_0x7fa37[_0xca4f('0x10')][_0xca4f('0x11')]);return _0x4c1e46(_0x7fa37[_0xca4f('0x10')]['message']);}logger[_0xca4f('0x10')]('MailApplication,\x20%s,\x20%s',_0x2eba6b,_0x7fa37['error']['message']);return _0x51d71e(_0x7fa37[_0xca4f('0x10')][_0xca4f('0x11')]);}else{logger[_0xca4f('0x12')]('MailApplication,\x20%s,\x20%s',_0x2eba6b,_0xca4f('0xd'));_0x51d71e(_0x7fa37[_0xca4f('0x13')][_0xca4f('0x11')]);}})[_0xca4f('0x14')](function(_0x8ce486){logger[_0xca4f('0x10')](_0xca4f('0x15'),_0x2eba6b,_0x8ce486);_0x4c1e46(_0x8ce486);});});}exports[_0xca4f('0x16')]=function(_0x1a900d){var _0x1ef2aa=this;return new Promise(function(_0x44c75a,_0x382f4a){return db[_0xca4f('0x17')][_0xca4f('0x18')](_0x1a900d[_0xca4f('0x19')],{'raw':_0x1a900d[_0xca4f('0x1a')]?_0x1a900d[_0xca4f('0x1a')][_0xca4f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a900d['options']?_0x1a900d[_0xca4f('0x1a')][_0xca4f('0x1c')]||null:null,'attributes':_0x1a900d['options']?_0x1a900d[_0xca4f('0x1a')][_0xca4f('0x1d')]||null:null,'limit':_0x1a900d[_0xca4f('0x1a')]?_0x1a900d['options'][_0xca4f('0x1e')]||null:null})[_0xca4f('0xc')](function(_0x473c67){logger[_0xca4f('0x12')](_0xca4f('0x16'),_0x1a900d);logger[_0xca4f('0x1f')](_0xca4f('0x16'),_0x1a900d,JSON[_0xca4f('0xf')](_0x473c67));_0x44c75a(_0x473c67);})[_0xca4f('0x14')](function(_0xe86e22){logger[_0xca4f('0x10')](_0xca4f('0x16'),_0xe86e22[_0xca4f('0x11')],_0x1a900d);_0x382f4a(_0x1ef2aa[_0xca4f('0x10')](0x1f4,_0xe86e22[_0xca4f('0x11')]));});});};
\ No newline at end of file
index b9e5fb5..a379cb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ad=['put','mailinteraction:update','update','delete','removeTags','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags'];(function(_0x5539b6,_0x36c377){var _0x4ac4fd=function(_0xe09e03){while(--_0xe09e03){_0x5539b6['push'](_0x5539b6['shift']());}};_0x4ac4fd(++_0x36c377);}(_0x71ad,0xee));var _0xd71a=function(_0x1633d9,_0x56d57e){_0x1633d9=_0x1633d9-0x0;var _0x2a9fa2=_0x71ad[_0x1633d9];return _0x2a9fa2;};'use strict';var multer=require(_0xd71a('0x0'));var util=require(_0xd71a('0x1'));var path=require('path');var timeout=require(_0xd71a('0x2'));var express=require('express');var router=express[_0xd71a('0x3')]();var auth=require(_0xd71a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd71a('0x5'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0xd71a('0x6')](),controller['index']);router[_0xd71a('0x7')](_0xd71a('0x8'),auth[_0xd71a('0x6')](),controller[_0xd71a('0x9')]);router[_0xd71a('0x7')](_0xd71a('0xa'),auth[_0xd71a('0x6')](),controller['show']);router[_0xd71a('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0xd71a('0xb')]);router[_0xd71a('0x7')](_0xd71a('0xc'),auth[_0xd71a('0x6')](),controller[_0xd71a('0xd')]);router[_0xd71a('0xe')]('/',auth[_0xd71a('0x6')](),controller[_0xd71a('0xf')]);router[_0xd71a('0xe')](_0xd71a('0x10'),auth['isAuthenticated'](),controller[_0xd71a('0x11')]);router[_0xd71a('0xe')](_0xd71a('0x12'),auth[_0xd71a('0x6')](),interaction[_0xd71a('0x13')](_0xd71a('0x14'),_0xd71a('0x15')),controller[_0xd71a('0x16')]);router[_0xd71a('0x17')](_0xd71a('0xa'),auth[_0xd71a('0x6')](),interaction[_0xd71a('0x13')](_0xd71a('0x14'),_0xd71a('0x18')),controller[_0xd71a('0x19')]);router['delete'](_0xd71a('0xa'),auth[_0xd71a('0x6')](),interaction[_0xd71a('0x13')]('mail','mailinteraction:destroy'),controller['destroy']);router[_0xd71a('0x1a')](_0xd71a('0x12'),auth[_0xd71a('0x6')](),controller[_0xd71a('0x1b')]);module[_0xd71a('0x1c')]=router;
\ No newline at end of file
+var _0xfd64=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','/:id','mailinteraction:update','delete','tracked','mailinteraction:destroy','destroy','removeTags','exports','util','path'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xfd64,0x1c5));var _0x4fd6=function(_0x7c7115,_0xcd39c0){_0x7c7115=_0x7c7115-0x0;var _0x1a4c76=_0xfd64[_0x7c7115];return _0x1a4c76;};'use strict';var multer=require('multer');var util=require(_0x4fd6('0x0'));var path=require(_0x4fd6('0x1'));var timeout=require(_0x4fd6('0x2'));var express=require(_0x4fd6('0x3'));var router=express[_0x4fd6('0x4')]();var auth=require(_0x4fd6('0x5'));var interaction=require(_0x4fd6('0x6'));var config=require(_0x4fd6('0x7'));var controller=require(_0x4fd6('0x8'));router[_0x4fd6('0x9')]('/',auth[_0x4fd6('0xa')](),controller[_0x4fd6('0xb')]);router[_0x4fd6('0x9')](_0x4fd6('0xc'),auth[_0x4fd6('0xa')](),controller[_0x4fd6('0xd')]);router[_0x4fd6('0x9')]('/:id',auth[_0x4fd6('0xa')](),controller[_0x4fd6('0xe')]);router['get'](_0x4fd6('0xf'),auth['isAuthenticated'](),controller[_0x4fd6('0x10')]);router[_0x4fd6('0x9')](_0x4fd6('0x11'),auth[_0x4fd6('0xa')](),controller[_0x4fd6('0x12')]);router[_0x4fd6('0x13')]('/',auth['isAuthenticated'](),controller[_0x4fd6('0x14')]);router[_0x4fd6('0x13')]('/:id/messages',auth[_0x4fd6('0xa')](),controller[_0x4fd6('0x15')]);router[_0x4fd6('0x13')](_0x4fd6('0x16'),auth[_0x4fd6('0xa')](),interaction['tracked'](_0x4fd6('0x17'),_0x4fd6('0x18')),controller[_0x4fd6('0x19')]);router[_0x4fd6('0x1a')](_0x4fd6('0x1b'),auth[_0x4fd6('0xa')](),interaction['tracked'](_0x4fd6('0x17'),_0x4fd6('0x1c')),controller['update']);router[_0x4fd6('0x1d')](_0x4fd6('0x1b'),auth['isAuthenticated'](),interaction[_0x4fd6('0x1e')](_0x4fd6('0x17'),_0x4fd6('0x1f')),controller[_0x4fd6('0x20')]);router[_0x4fd6('0x1d')](_0x4fd6('0x16'),auth[_0x4fd6('0xa')](),controller[_0x4fd6('0x21')]);module[_0x4fd6('0x22')]=router;
\ No newline at end of file
index 75236fd..d6c3b74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf1b=['long','iconv','BOOLEAN','DATE','STRING','TEXT','ENUM','out'];(function(_0xf03c32,_0x1cc81a){var _0x1d762c=function(_0x46365c){while(--_0x46365c){_0xf03c32['push'](_0xf03c32['shift']());}};_0x1d762c(++_0x1cc81a);}(_0xdf1b,0x111));var _0xbdf1=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0xdf1b[_0xf91841];return _0x4b9c44;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xbdf1('0x0'));module['exports']={'closed':{'type':Sequelize[_0xbdf1('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbdf1('0x2')]},'disposition':{'type':Sequelize[_0xbdf1('0x3')]},'note':{'type':Sequelize[_0xbdf1('0x3')]},'inReplyTo':{'type':Sequelize[_0xbdf1('0x3')](0x1fe)},'to':{'type':Sequelize[_0xbdf1('0x3')]},'cc':{'type':Sequelize[_0xbdf1('0x4')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xbdf1('0x2')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xbdf1('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xbdf1('0x5')]('in',_0xbdf1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbdf1('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xbdf1('0x5')]('in',_0xbdf1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xbdf1('0x4')]('long')},'lastMsgText':{'type':Sequelize[_0xbdf1('0x4')](_0xbdf1('0x7'))}};
\ No newline at end of file
+var _0xec4d=['long','iconv','exports','BOOLEAN','DATE','STRING','TEXT','ENUM','out'];(function(_0xe27035,_0x1f4876){var _0x3745bc=function(_0xfa83f4){while(--_0xfa83f4){_0xe27035['push'](_0xe27035['shift']());}};_0x3745bc(++_0x1f4876);}(_0xec4d,0x1b1));var _0xdec4=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0xec4d[_0x1ee62e];return _0x27c6c8;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xdec4('0x0'));module[_0xdec4('0x1')]={'closed':{'type':Sequelize[_0xdec4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdec4('0x3')]},'disposition':{'type':Sequelize[_0xdec4('0x4')]},'note':{'type':Sequelize[_0xdec4('0x4')]},'inReplyTo':{'type':Sequelize[_0xdec4('0x4')](0x1fe)},'to':{'type':Sequelize[_0xdec4('0x4')]},'cc':{'type':Sequelize[_0xdec4('0x5')]('long')},'subject':{'type':Sequelize[_0xdec4('0x5')]()},'attach':{'type':Sequelize[_0xdec4('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xdec4('0x3')]},'substatus':{'type':Sequelize[_0xdec4('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xdec4('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xdec4('0x6')]('in',_0xdec4('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xdec4('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xdec4('0x5')](_0xdec4('0x8'))},'lastMsgText':{'type':Sequelize[_0xdec4('0x5')]('long')}};
\ No newline at end of file
index 0863aad..61240b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x344abc,_0x390eb0){var _0x1c88ed=function(_0x4e0d9f){while(--_0x4e0d9f){_0x344abc['push'](_0x344abc['shift']());}};_0x1c88ed(++_0x390eb0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));};
\ No newline at end of file
+var _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x23cd6a,_0x26865e){var _0x130acc=function(_0x4086b0){while(--_0x4086b0){_0x23cd6a['push'](_0x23cd6a['shift']());}};_0x130acc(++_0x26865e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));};
\ No newline at end of file
index f942eae..8c21bda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1a4=['update','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','MailInteraction','MailMessage','setMaxListeners','save'];(function(_0x51f34d,_0x2a917a){var _0x1b95a6=function(_0x523ce0){while(--_0x523ce0){_0x51f34d['push'](_0x51f34d['shift']());}};_0x1b95a6(++_0x2a917a);}(_0xb1a4,0x72));var _0x4b1a=function(_0x4d45a7,_0x2a1ea7){_0x4d45a7=_0x4d45a7-0x0;var _0x7ece93=_0xb1a4[_0x4d45a7];return _0x7ece93;};'use strict';var EventEmitter=require(_0x4b1a('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x4b1a('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x4b1a('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4b1a('0x3')](0x0);var events={'afterCreate':_0x4b1a('0x4'),'afterUpdate':_0x4b1a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x445d60){return function(_0x2f34f4,_0x2d1747,_0x2e7cbd){_0x2f34f4['getUsers']({'attributes':['id'],'raw':!![]})[_0x4b1a('0x6')](function(_0xb3874a){_0x2f34f4[_0x4b1a('0x7')](_0x4b1a('0x8'),_0xb3874a['map'](function(_0x1b2ace){return{'id':_0x1b2ace['id']};}));return MailMessage[_0x4b1a('0x9')]({'where':{'MailInteractionId':_0x2f34f4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4b1a('0x6')](function(_0x312ecc){_0x2f34f4[_0x4b1a('0x7')](_0x4b1a('0xa'),_0x312ecc[_0x4b1a('0xb')]);MailInteractionEvents[_0x4b1a('0xc')](_0x445d60+':'+_0x2f34f4['id'],_0x2f34f4);MailInteractionEvents[_0x4b1a('0xc')](_0x445d60,_0x2f34f4);_0x2e7cbd(null);})[_0x4b1a('0xd')](_0x2e7cbd(null));};}for(var e in events){if(events[_0x4b1a('0xe')](e)){var event=events[e];MailInteraction[_0x4b1a('0xf')](e,emitEvent(event));}}module[_0x4b1a('0x10')]=MailInteractionEvents;
\ No newline at end of file
+var _0xbeb7=['../../mysqldb','MailInteraction','setMaxListeners','remove','getUsers','then','setDataValue','findAll','length','emit','hasOwnProperty','exports','events'];(function(_0x6f76f5,_0x29737e){var _0x4b11e6=function(_0xcf4cb9){while(--_0xcf4cb9){_0x6f76f5['push'](_0x6f76f5['shift']());}};_0x4b11e6(++_0x29737e);}(_0xbeb7,0xe9));var _0x7beb=function(_0x210cc8,_0x35d2f2){_0x210cc8=_0x210cc8-0x0;var _0x1df38b=_0xbeb7[_0x210cc8];return _0x1df38b;};'use strict';var EventEmitter=require(_0x7beb('0x0'));var MailInteraction=require(_0x7beb('0x1'))['db'][_0x7beb('0x2')];var MailMessage=require(_0x7beb('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x7beb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7beb('0x4')};function emitEvent(_0x1912e1){return function(_0x2731fe,_0x4f253e,_0x1ee560){_0x2731fe[_0x7beb('0x5')]({'attributes':['id'],'raw':!![]})[_0x7beb('0x6')](function(_0x7066d){_0x2731fe[_0x7beb('0x7')]('Users',_0x7066d['map'](function(_0x1d3d8b){return{'id':_0x1d3d8b['id']};}));return MailMessage[_0x7beb('0x8')]({'where':{'MailInteractionId':_0x2731fe['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5d8956){_0x2731fe[_0x7beb('0x7')]('unreadMessages',_0x5d8956[_0x7beb('0x9')]);MailInteractionEvents['emit'](_0x1912e1+':'+_0x2731fe['id'],_0x2731fe);MailInteractionEvents[_0x7beb('0xa')](_0x1912e1,_0x2731fe);_0x1ee560(null);})['catch'](_0x1ee560(null));};}for(var e in events){if(events[_0x7beb('0xb')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x7beb('0xc')]=MailInteractionEvents;
\ No newline at end of file
index 4ad1151..75960d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['subject','FULLTEXT','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','get','update','catch','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','MailInteraction','fti_mail_interactions'];(function(_0x269485,_0x482fbe){var _0x2c8409=function(_0x3bbfc6){while(--_0x3bbfc6){_0x269485['push'](_0x269485['shift']());}};_0x2c8409(++_0x482fbe);}(_0xedd9,0xfc));var _0x9edd=function(_0x41cc38,_0xe74996){_0x41cc38=_0x41cc38-0x0;var _0x41f3fa=_0xedd9[_0x41cc38];return _0x41f3fa;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x9edd('0xb'),'fields':[_0x9edd('0xc'),'to'],'type':_0x9edd('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3280fd,_0x49d5e3,_0x494a24){if(_0x3280fd['substatus']){_0x3280fd[_0x9edd('0xe')]=moment()[_0x9edd('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3280fd[_0x9edd('0x10')]){_0x3280fd[_0x9edd('0x11')]=moment()['format'](_0x9edd('0x12'));}_0x494a24(null,_0x49d5e3);},'beforeUpdate':function(_0x1b73d1,_0x25e64c,_0xfd544a){if(_0x1b73d1[_0x9edd('0x13')](_0x9edd('0x14'))){_0x1b73d1[_0x9edd('0xe')]=_0x1b73d1[_0x9edd('0x14')]?moment()['format'](_0x9edd('0x12')):null;}if(_0x1b73d1[_0x9edd('0x13')](_0x9edd('0x10'))){_0x1b73d1[_0x9edd('0x11')]=moment()[_0x9edd('0xf')](_0x9edd('0x12'));_0x1b73d1[_0x9edd('0x14')]=null;_0x1b73d1[_0x9edd('0xe')]=null;}_0xfd544a(null,_0x1b73d1);},'afterUpdate':function(_0x4ea60f,_0x5f5bf4,_0x448996){var _0x449cee=_0x268f9e['models'];var _0x1b54c0=_0x4ea60f[_0x9edd('0x15')]({'plain':!![]});if(_0x1b54c0[_0x9edd('0x10')]){return _0x449cee['MailMessage'][_0x9edd('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x1b54c0['id']}})['then'](function(){_0x448996();})[_0x9edd('0x17')](function(_0x1083e4){_0x448996(_0x1083e4);});}else{_0x448996();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x55ca=['changed','models','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt'];(function(_0x17c776,_0x1b0432){var _0x5511c2=function(_0x4bb4ac){while(--_0x4bb4ac){_0x17c776['push'](_0x17c776['shift']());}};_0x5511c2(++_0x1b0432);}(_0x55ca,0x126));var _0xa55c=function(_0x929c7e,_0x38c4cc){_0x929c7e=_0x929c7e-0x0;var _0x5de099=_0x55ca[_0x929c7e];return _0x5de099;};'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')]('MailInteraction',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[{'name':_0xa55c('0xa'),'fields':['subject','to'],'type':_0xa55c('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x290d28,_0x52a3bc,_0x5849ad){if(_0x290d28[_0xa55c('0xc')]){_0x290d28[_0xa55c('0xd')]=moment()[_0xa55c('0xe')](_0xa55c('0xf'));}if(_0x290d28[_0xa55c('0x10')]){_0x290d28[_0xa55c('0x11')]=moment()[_0xa55c('0xe')](_0xa55c('0xf'));}_0x5849ad(null,_0x52a3bc);},'beforeUpdate':function(_0x3998f7,_0x15eec8,_0x5d47ff){if(_0x3998f7['changed'](_0xa55c('0xc'))){_0x3998f7['substatusAt']=_0x3998f7['substatus']?moment()['format'](_0xa55c('0xf')):null;}if(_0x3998f7[_0xa55c('0x12')](_0xa55c('0x10'))){_0x3998f7[_0xa55c('0x11')]=moment()[_0xa55c('0xe')](_0xa55c('0xf'));_0x3998f7['substatus']=null;_0x3998f7[_0xa55c('0xd')]=null;}_0x5d47ff(null,_0x3998f7);},'afterUpdate':function(_0x3dcf4f,_0x25934f,_0x31e10d){var _0x1c4cfd=_0x3c97c8[_0xa55c('0x13')];var _0x51590e=_0x3dcf4f[_0xa55c('0x14')]({'plain':!![]});if(_0x51590e[_0xa55c('0x10')]){return _0x1c4cfd['MailMessage'][_0xa55c('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x51590e['id']}})[_0xa55c('0x16')](function(){_0x31e10d();})[_0xa55c('0x17')](function(_0x358b61){_0x31e10d(_0x358b61);});}else{_0x31e10d();}}},'charset':_0xa55c('0x18'),'collate':_0xa55c('0x19')});};
\ No newline at end of file
index f996333..8abbf2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed8a=['error','code','message','info','result','catch','UpdateMailInteraction','update','options','raw','attributes','limit','AddTagsToMailInteraction','MailInteraction','find','where','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5ca8f0,_0x82aef){var _0x214539=function(_0xe82a6){while(--_0xe82a6){_0x5ca8f0['push'](_0x5ca8f0['shift']());}};_0x214539(++_0x82aef);}(_0xed8a,0xc5));var _0xaed8=function(_0x2b7bf9,_0x30711d){_0x2b7bf9=_0x2b7bf9-0x0;var _0x2983c8=_0xed8a[_0x2b7bf9];return _0x2983c8;};'use strict';var _=require(_0xaed8('0x0'));var util=require(_0xaed8('0x1'));var moment=require(_0xaed8('0x2'));var BPromise=require(_0xaed8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaed8('0x4'));var db=require(_0xaed8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaed8('0x6'))(_0xaed8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaed8('0x8')][_0xaed8('0x9')]({'port':0x232a});config[_0xaed8('0xa')]=_[_0xaed8('0xb')](config[_0xaed8('0xa')],{'host':_0xaed8('0xc'),'port':0x18eb});var socket=require(_0xaed8('0xd'))(new Redis(config['redis']));require(_0xaed8('0xe'))[_0xaed8('0xf')](socket);function respondWithRpcPromise(_0x347f88,_0x5dce71,_0xf51777){return new BPromise(function(_0x29b08a,_0x1385ef){return client[_0xaed8('0x10')](_0x347f88,_0xf51777)[_0xaed8('0x11')](function(_0x55f38f){logger['info'](_0xaed8('0x12'),_0x5dce71,'request\x20sent');logger[_0xaed8('0x13')](_0xaed8('0x14'),_0x5dce71,_0xaed8('0x15'),JSON[_0xaed8('0x16')](_0x55f38f));if(_0x55f38f['error']){if(_0x55f38f[_0xaed8('0x17')][_0xaed8('0x18')]===0x1f4){logger[_0xaed8('0x17')](_0xaed8('0x12'),_0x5dce71,_0x55f38f[_0xaed8('0x17')][_0xaed8('0x19')]);return _0x1385ef(_0x55f38f['error'][_0xaed8('0x19')]);}logger['error'](_0xaed8('0x12'),_0x5dce71,_0x55f38f[_0xaed8('0x17')]['message']);return _0x29b08a(_0x55f38f[_0xaed8('0x17')][_0xaed8('0x19')]);}else{logger[_0xaed8('0x1a')](_0xaed8('0x12'),_0x5dce71,_0xaed8('0x15'));_0x29b08a(_0x55f38f[_0xaed8('0x1b')][_0xaed8('0x19')]);}})[_0xaed8('0x1c')](function(_0x2676a2){logger[_0xaed8('0x17')](_0xaed8('0x12'),_0x5dce71,_0x2676a2);_0x1385ef(_0x2676a2);});});}exports[_0xaed8('0x1d')]=function(_0x16aa06){var _0x39ca9e=this;return new Promise(function(_0x2095ae,_0x48828f){return db['MailInteraction'][_0xaed8('0x1e')](_0x16aa06['body'],{'raw':_0x16aa06[_0xaed8('0x1f')]?_0x16aa06[_0xaed8('0x1f')][_0xaed8('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16aa06[_0xaed8('0x1f')]?_0x16aa06['options']['where']||null:null,'attributes':_0x16aa06['options']?_0x16aa06[_0xaed8('0x1f')][_0xaed8('0x21')]||null:null,'limit':_0x16aa06[_0xaed8('0x1f')]?_0x16aa06[_0xaed8('0x1f')][_0xaed8('0x22')]||null:null})[_0xaed8('0x11')](function(_0x290b32){logger[_0xaed8('0x1a')](_0xaed8('0x1d'),_0x16aa06);logger['debug'](_0xaed8('0x1d'),_0x16aa06,JSON[_0xaed8('0x16')](_0x290b32));_0x2095ae(_0x290b32);})[_0xaed8('0x1c')](function(_0x14cd92){logger[_0xaed8('0x17')](_0xaed8('0x1d'),_0x14cd92['message'],_0x16aa06);_0x48828f(_0x39ca9e[_0xaed8('0x17')](0x1f4,_0x14cd92['message']));});});};exports[_0xaed8('0x23')]=function(_0x5d80c7){return new Promise(function(_0x34c7ff,_0x4b25d9){return db[_0xaed8('0x24')][_0xaed8('0x25')]({'where':_0x5d80c7[_0xaed8('0x1f')]?_0x5d80c7[_0xaed8('0x1f')][_0xaed8('0x26')]||null:null})[_0xaed8('0x11')](function(_0x105376){if(_0x105376){return _0x105376[_0xaed8('0x27')](_0x5d80c7[_0xaed8('0x28')][_0xaed8('0x29')],_['omit'](_0x5d80c7[_0xaed8('0x28')],[_0xaed8('0x29'),'id'])||{});}})[_0xaed8('0x2a')](function(_0x135139){logger[_0xaed8('0x1a')]('AddTags',_0x5d80c7);logger[_0xaed8('0x13')](_0xaed8('0x2b'),_0x5d80c7,JSON[_0xaed8('0x16')](_0x135139));_0x34c7ff(_0x135139);})[_0xaed8('0x1c')](function(_0x1b0237){logger[_0xaed8('0x17')]('AddTags',_0x1b0237['message'],_0x5d80c7);_0x4b25d9(_this[_0xaed8('0x17')](0x1f4,_0x1b0237[_0xaed8('0x19')]));});});};
\ No newline at end of file
+var _0xf996=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','options','where','attributes','limit','debug','AddTagsToMailInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x2c8543,_0x2c2b3e){var _0x516ba2=function(_0x251bbb){while(--_0x251bbb){_0x2c8543['push'](_0x2c8543['shift']());}};_0x516ba2(++_0x2c2b3e);}(_0xf996,0x74));var _0x6f99=function(_0xfb7fd4,_0xdf44ed){_0xfb7fd4=_0xfb7fd4-0x0;var _0x12b4c4=_0xf996[_0xfb7fd4];return _0x12b4c4;};'use strict';var _=require(_0x6f99('0x0'));var util=require(_0x6f99('0x1'));var moment=require(_0x6f99('0x2'));var BPromise=require('bluebird');var rs=require(_0x6f99('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6f99('0x4'));var logger=require(_0x6f99('0x5'))(_0x6f99('0x6'));var config=require(_0x6f99('0x7'));var jayson=require(_0x6f99('0x8'));var client=jayson[_0x6f99('0x9')][_0x6f99('0xa')]({'port':0x232a});config[_0x6f99('0xb')]=_[_0x6f99('0xc')](config[_0x6f99('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f99('0xd'))(new Redis(config['redis']));require(_0x6f99('0xe'))[_0x6f99('0xf')](socket);function respondWithRpcPromise(_0x41f436,_0x161b64,_0xf42ba3){return new BPromise(function(_0x2edd9,_0x43b5c0){return client[_0x6f99('0x10')](_0x41f436,_0xf42ba3)[_0x6f99('0x11')](function(_0x509929){logger[_0x6f99('0x12')]('MailInteraction,\x20%s,\x20%s',_0x161b64,'request\x20sent');logger['debug'](_0x6f99('0x13'),_0x161b64,_0x6f99('0x14'),JSON[_0x6f99('0x15')](_0x509929));if(_0x509929[_0x6f99('0x16')]){if(_0x509929[_0x6f99('0x16')][_0x6f99('0x17')]===0x1f4){logger[_0x6f99('0x16')](_0x6f99('0x18'),_0x161b64,_0x509929[_0x6f99('0x16')][_0x6f99('0x19')]);return _0x43b5c0(_0x509929[_0x6f99('0x16')][_0x6f99('0x19')]);}logger['error'](_0x6f99('0x18'),_0x161b64,_0x509929[_0x6f99('0x16')]['message']);return _0x2edd9(_0x509929['error'][_0x6f99('0x19')]);}else{logger['info'](_0x6f99('0x18'),_0x161b64,_0x6f99('0x14'));_0x2edd9(_0x509929[_0x6f99('0x1a')][_0x6f99('0x19')]);}})[_0x6f99('0x1b')](function(_0x5bfb51){logger[_0x6f99('0x16')]('MailInteraction,\x20%s,\x20%s',_0x161b64,_0x5bfb51);_0x43b5c0(_0x5bfb51);});});}exports[_0x6f99('0x1c')]=function(_0x286edb){var _0x4cfa68=this;return new Promise(function(_0x26cd36,_0x1dc9e5){return db[_0x6f99('0x1d')]['update'](_0x286edb['body'],{'raw':_0x286edb[_0x6f99('0x1e')]?_0x286edb[_0x6f99('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x286edb['options']?_0x286edb[_0x6f99('0x1e')][_0x6f99('0x1f')]||null:null,'attributes':_0x286edb[_0x6f99('0x1e')]?_0x286edb[_0x6f99('0x1e')][_0x6f99('0x20')]||null:null,'limit':_0x286edb[_0x6f99('0x1e')]?_0x286edb[_0x6f99('0x1e')][_0x6f99('0x21')]||null:null})[_0x6f99('0x11')](function(_0x41a60b){logger[_0x6f99('0x12')](_0x6f99('0x1c'),_0x286edb);logger[_0x6f99('0x22')](_0x6f99('0x1c'),_0x286edb,JSON['stringify'](_0x41a60b));_0x26cd36(_0x41a60b);})[_0x6f99('0x1b')](function(_0x201070){logger['error']('UpdateMailInteraction',_0x201070[_0x6f99('0x19')],_0x286edb);_0x1dc9e5(_0x4cfa68[_0x6f99('0x16')](0x1f4,_0x201070['message']));});});};exports[_0x6f99('0x23')]=function(_0x3e56f5){return new Promise(function(_0x53ab0e,_0x45fe22){return db[_0x6f99('0x1d')]['find']({'where':_0x3e56f5[_0x6f99('0x1e')]?_0x3e56f5[_0x6f99('0x1e')][_0x6f99('0x1f')]||null:null})[_0x6f99('0x11')](function(_0x292a29){if(_0x292a29){return _0x292a29[_0x6f99('0x24')](_0x3e56f5['body'][_0x6f99('0x25')],_[_0x6f99('0x26')](_0x3e56f5['body'],['ids','id'])||{});}})[_0x6f99('0x27')](function(_0x33ab31){logger[_0x6f99('0x12')](_0x6f99('0x28'),_0x3e56f5);logger[_0x6f99('0x22')](_0x6f99('0x28'),_0x3e56f5,JSON['stringify'](_0x33ab31));_0x53ab0e(_0x33ab31);})['catch'](function(_0x269d9b){logger[_0x6f99('0x16')](_0x6f99('0x28'),_0x269d9b[_0x6f99('0x19')],_0x3e56f5);_0x45fe22(_this[_0x6f99('0x16')](0x1f4,_0x269d9b[_0x6f99('0x19')]));});});};
\ No newline at end of file
index 1c2a955..21a1034 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3def=['emit','removeListener','register','length','mailInteraction:','remove','update'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x3def,0x163));var _0xf3de=function(_0x11e617,_0x2006b4){_0x11e617=_0x11e617-0x0;var _0x596054=_0x3def[_0x11e617];return _0x596054;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0xf3de('0x0'),_0xf3de('0x1')];function createListener(_0x52c153,_0x343999){return function(_0x17f275){_0x343999[_0xf3de('0x2')](_0x52c153,_0x17f275);};}function removeListener(_0x1c3418,_0x15aa4c){return function(){MailInteractionEvents[_0xf3de('0x3')](_0x1c3418,_0x15aa4c);};}exports[_0xf3de('0x4')]=function(_0x15a6eb){for(var _0x4311c3=0x0,_0x3e7ebf=events[_0xf3de('0x5')];_0x4311c3<_0x3e7ebf;_0x4311c3++){var _0x2b757b=events[_0x4311c3];var _0x3b5c75=createListener(_0xf3de('0x6')+_0x2b757b,_0x15a6eb);MailInteractionEvents['on'](_0x2b757b,_0x3b5c75);}};
\ No newline at end of file
+var _0xe191=['removeListener','register','length','mailInteraction:','./mailInteraction.events','update'];(function(_0x2a354f,_0x477219){var _0x3dd213=function(_0x3dbabe){while(--_0x3dbabe){_0x2a354f['push'](_0x2a354f['shift']());}};_0x3dd213(++_0x477219);}(_0xe191,0x1ea));var _0x1e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe191[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require(_0x1e19('0x0'));var events=['save','remove',_0x1e19('0x1')];function createListener(_0x2eec83,_0x496df7){return function(_0x5c2cb6){_0x496df7['emit'](_0x2eec83,_0x5c2cb6);};}function removeListener(_0x28c6b2,_0x58da9d){return function(){MailInteractionEvents[_0x1e19('0x2')](_0x28c6b2,_0x58da9d);};}exports[_0x1e19('0x3')]=function(_0x505a61){for(var _0x2c6786=0x0,_0x5c993a=events[_0x1e19('0x4')];_0x2c6786<_0x5c993a;_0x2c6786++){var _0x28d0e6=events[_0x2c6786];var _0x4202eb=createListener(_0x1e19('0x5')+_0x28d0e6,_0x505a61);MailInteractionEvents['on'](_0x28d0e6,_0x4202eb);}};
\ No newline at end of file
index 9c39579..1d0a2d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id/download','tracked','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports','util','connect-timeout','express','Router','../../config/environment'];(function(_0x537044,_0x4de18f){var _0x5ba75e=function(_0x58cccc){while(--_0x58cccc){_0x537044['push'](_0x537044['shift']());}};_0x5ba75e(++_0x4de18f);}(_0x9f62,0x154));var _0x29f6=function(_0x45b489,_0x2c7482){_0x45b489=_0x45b489-0x0;var _0x32527f=_0x9f62[_0x45b489];return _0x32527f;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29f6('0x4'));var controller=require(_0x29f6('0x5'));router[_0x29f6('0x6')]('/',auth[_0x29f6('0x7')](),controller['index']);router[_0x29f6('0x6')](_0x29f6('0x8'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x9')]);router[_0x29f6('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x29f6('0xa'),auth[_0x29f6('0x7')](),controller['download']);router['post']('/',auth[_0x29f6('0x7')](),interaction[_0x29f6('0xb')]('mail',_0x29f6('0xc')),controller[_0x29f6('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x29f6('0xe')](_0x29f6('0xf'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x10')]);router[_0x29f6('0xe')](_0x29f6('0x11'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x12')]);router[_0x29f6('0x13')](_0x29f6('0x14'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x15')]);module[_0x29f6('0x16')]=router;
\ No newline at end of file
+var _0x3e74=['path','connect-timeout','express','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','download','post','tracked','mailmessage:create','create','update','put','accept','/:id/reject','delete','destroy','multer'];(function(_0x511a8f,_0x17c1f3){var _0x3bc09f=function(_0x5dfa42){while(--_0x5dfa42){_0x511a8f['push'](_0x511a8f['shift']());}};_0x3bc09f(++_0x17c1f3);}(_0x3e74,0x175));var _0x43e7=function(_0x345baf,_0xee287a){_0x345baf=_0x345baf-0x0;var _0x4ecdaf=_0x3e74[_0x345baf];return _0x4ecdaf;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth['isAuthenticated'](),interaction[_0x43e7('0xd')]('mail',_0x43e7('0xe')),controller[_0x43e7('0xf')]);router['put'](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router[_0x43e7('0x11')]('/:id/accept',auth['isAuthenticated'](),controller[_0x43e7('0x12')]);router[_0x43e7('0x11')](_0x43e7('0x13'),auth['isAuthenticated'](),controller['reject']);router[_0x43e7('0x14')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x15')]);module['exports']=router;
\ No newline at end of file
index 54bcd09..4001975 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd2f=['ENUM','out','STRING','DATE','INTEGER','TEXT','long','medium','BOOLEAN'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xcd2f[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0xfcd2('0x0')](_0xfcd2('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xfcd2('0x0')](_0xfcd2('0x2'))},'read':{'type':Sequelize[_0xfcd2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfcd2('0x4')]('in',_0xfcd2('0x5')),'defaultValue':_0xfcd2('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xfcd2('0x6')]},'to':{'type':Sequelize[_0xfcd2('0x0')](_0xfcd2('0x1'))},'cc':{'type':Sequelize[_0xfcd2('0x0')](_0xfcd2('0x1'))},'bcc':{'type':Sequelize[_0xfcd2('0x0')](_0xfcd2('0x1'))},'subject':{'type':Sequelize[_0xfcd2('0x0')]},'sentAt':{'type':Sequelize[_0xfcd2('0x7')]},'attach':{'type':Sequelize[_0xfcd2('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xfcd2('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xfcd2('0x0')](_0xfcd2('0x1'))},'originCc':{'type':Sequelize[_0xfcd2('0x0')](_0xfcd2('0x1'))}};
\ No newline at end of file
+var _0x056b=['BOOLEAN','ENUM','out','STRING','INTEGER','DATE','lodash','exports','TEXT','long','medium'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x056b,0xb6));var _0xb056=function(_0x5e07a7,_0x1438b3){_0x5e07a7=_0x5e07a7-0x0;var _0x22ced5=_0x056b[_0x5e07a7];return _0x22ced5;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb056('0x0'));module[_0xb056('0x1')]={'body':{'type':Sequelize[_0xb056('0x2')](_0xb056('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb056('0x2')](_0xb056('0x4'))},'read':{'type':Sequelize[_0xb056('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb056('0x6')]('in',_0xb056('0x7')),'defaultValue':_0xb056('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xb056('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xb056('0x2')](_0xb056('0x3'))},'cc':{'type':Sequelize[_0xb056('0x2')](_0xb056('0x3'))},'bcc':{'type':Sequelize[_0xb056('0x2')](_0xb056('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xb056('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb056('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xb056('0xa')]},'originTo':{'type':Sequelize[_0xb056('0x2')]('long')},'originCc':{'type':Sequelize[_0xb056('0x2')]('long')}};
\ No newline at end of file
index 6b5bba6..74d80bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ce1=['mail-interactions','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','MailInteraction','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','reject','agent','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','existsSync','build','writeFileSync','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','test','Sequelize','ValidationError','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','index','map','MailMessage','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','show','params','catch','body','find','describe','direction','out','secret','findOne','MailAccountId','CmList','List','CmContact','Contacts','MailServerOut','Smtp','service','port','secure','authentication','pass','user','attachments','join','root','server/files/attachments','basename','create','defaults','List\x20not\x20found','SendMail','sendMail','messageId','../../config/logger'];(function(_0x1eb186,_0x3e8197){var _0x49079e=function(_0x2ebd6f){while(--_0x2ebd6f){_0x1eb186['push'](_0x1eb186['shift']());}};_0x49079e(++_0x3e8197);}(_0x8ce1,0x183));var _0x18ce=function(_0x5af34b,_0x2fb339){_0x5af34b=_0x5af34b-0x0;var _0x561667=_0x8ce1[_0x5af34b];return _0x561667;};'use strict';var pdf=require(_0x18ce('0x0'));var emlformat=require(_0x18ce('0x1'));var rimraf=require(_0x18ce('0x2'));var zipdir=require(_0x18ce('0x3'));var jsonpatch=require(_0x18ce('0x4'));var rp=require(_0x18ce('0x5'));var moment=require(_0x18ce('0x6'));var BPromise=require(_0x18ce('0x7'));var Mustache=require(_0x18ce('0x8'));var util=require(_0x18ce('0x9'));var path=require(_0x18ce('0xa'));var sox=require(_0x18ce('0xb'));var csv=require(_0x18ce('0xc'));var ejs=require(_0x18ce('0xd'));var fs=require('fs');var _=require(_0x18ce('0xe'));var squel=require(_0x18ce('0xf'));var crypto=require('crypto');var jsforce=require(_0x18ce('0x10'));var deskjs=require(_0x18ce('0x11'));var toCsv=require(_0x18ce('0xc'));var querystring=require(_0x18ce('0x12'));var Papa=require('papaparse');var Redis=require(_0x18ce('0x13'));var authService=require(_0x18ce('0x14'));var qs=require(_0x18ce('0x15'));var as=require(_0x18ce('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x18ce('0x17'));var utils=require(_0x18ce('0x18'));var config=require(_0x18ce('0x19'));var db=require(_0x18ce('0x1a'))['db'];config[_0x18ce('0x1b')]=_['defaults'](config[_0x18ce('0x1b')],{'host':_0x18ce('0x1c'),'port':0x18eb});var socket=require(_0x18ce('0x1d'))(new Redis(config[_0x18ce('0x1b')]));require(_0x18ce('0x1e'))['register'](socket);var jayson=require(_0x18ce('0x1f'));var client=jayson[_0x18ce('0x20')][_0x18ce('0x21')]({'port':0x232c});var client9003=jayson[_0x18ce('0x20')][_0x18ce('0x21')]({'port':0x232b});var client9002=jayson[_0x18ce('0x20')][_0x18ce('0x21')]({'port':0x232a});function checkPasswordPattern(_0x4a934f,_0x959ce,_0x1357ef){if(_0x1357ef){var _0x204d1a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x204d1a[_0x18ce('0x22')](_0x959ce)){return _0x4a934f;}else{throw new db[(_0x18ce('0x23'))][(_0x18ce('0x24'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4a934f;}}function respondWithRpcPromise(_0x6ab555,_0x29c691,_0x362719,_0x56644c){return new BPromise(function(_0x35e446,_0x2fa3d4){var _0xb3725c=_0x56644c||client;return _0xb3725c['request'](_0x6ab555,_0x362719)[_0x18ce('0x25')](function(_0x19084e){logger['info'](_0x18ce('0x26'),_0x29c691,_0x18ce('0x27'));logger[_0x18ce('0x28')](_0x18ce('0x29'),_0x29c691,_0x18ce('0x27'),JSON[_0x18ce('0x2a')](_0x19084e));if(_0x19084e[_0x18ce('0x2b')]){if(_0x19084e[_0x18ce('0x2b')][_0x18ce('0x2c')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x29c691,_0x19084e['error'][_0x18ce('0x2d')]);return _0x2fa3d4(_0x19084e['error'][_0x18ce('0x2d')]);}logger[_0x18ce('0x2b')](_0x18ce('0x26'),_0x29c691,_0x19084e['error']['message']);return _0x35e446(_0x19084e['error'][_0x18ce('0x2d')]);}else{logger[_0x18ce('0x2e')](_0x18ce('0x26'),_0x29c691,_0x18ce('0x27'));_0x35e446(_0x19084e[_0x18ce('0x2f')][_0x18ce('0x2d')]);}})['catch'](function(_0x5279f8){logger['error'](_0x18ce('0x26'),_0x29c691,_0x5279f8);_0x2fa3d4(_0x5279f8);});});}function respondWithStatusCode(_0x3719a2,_0x34c694){_0x34c694=_0x34c694||0xcc;return function(_0x5f3ec2){if(_0x5f3ec2){return _0x3719a2[_0x18ce('0x30')](_0x34c694);}return _0x3719a2[_0x18ce('0x31')](_0x34c694)[_0x18ce('0x32')]();};}function respondWithResult(_0x5ef96c,_0x56d296){_0x56d296=_0x56d296||0xc8;return function(_0x59e472){if(_0x59e472){return _0x5ef96c[_0x18ce('0x31')](_0x56d296)[_0x18ce('0x33')](_0x59e472);}};}function respondWithFilteredResult(_0x5c2d96,_0x5a5826){return function(_0x3394a9){if(_0x3394a9){var _0x3693e5=_0x3394a9[_0x18ce('0x34')],_0x91c42f=_0x5a5826[_0x18ce('0x35')],_0x57e11e=_0x5a5826[_0x18ce('0x35')]+_0x5a5826[_0x18ce('0x36')],_0x5f24f8;if(_0x57e11e>=_0x3693e5){_0x57e11e=_0x3693e5;_0x5f24f8=0xc8;}else{_0x5f24f8=0xce;}_0x5c2d96[_0x18ce('0x31')](_0x5f24f8);return _0x5c2d96[_0x18ce('0x37')](_0x18ce('0x38'),_0x91c42f+'-'+_0x57e11e+'/'+_0x3693e5)[_0x18ce('0x33')](_0x3394a9);}return null;};}function patchUpdates(_0x4dfe2f){return function(_0x51e7e3){try{jsonpatch[_0x18ce('0x39')](_0x51e7e3,_0x4dfe2f,!![]);}catch(_0x3e05d4){return BPromise['reject'](_0x3e05d4);}return _0x51e7e3[_0x18ce('0x3a')]();};}function saveUpdates(_0x55dab7,_0x329b1f){return function(_0x4e340b){if(_0x4e340b){return _0x4e340b[_0x18ce('0x3b')](_0x55dab7)[_0x18ce('0x25')](function(_0x1223cb){return _0x1223cb;});}return null;};}function removeEntity(_0x532dab,_0x4c2d04){return function(_0x3f2fdf){if(_0x3f2fdf){return _0x3f2fdf[_0x18ce('0x3c')]()['then'](function(){_0x532dab['status'](0xcc)[_0x18ce('0x32')]();});}};}function handleEntityNotFound(_0x27db6a,_0x342df2){return function(_0x21ccde){if(!_0x21ccde){_0x27db6a[_0x18ce('0x30')](0x194);}return _0x21ccde;};}function handleError(_0x461ef0,_0x3ca677){_0x3ca677=_0x3ca677||0x1f4;return function(_0x34cec3){logger[_0x18ce('0x2b')](_0x34cec3[_0x18ce('0x3d')]);if(_0x34cec3[_0x18ce('0x3e')]){delete _0x34cec3[_0x18ce('0x3e')];}_0x461ef0[_0x18ce('0x31')](_0x3ca677)['send'](_0x34cec3);};}exports[_0x18ce('0x3f')]=function(_0x277009,_0x2d5d4e){var _0x2f8e29={},_0x1e67dd={},_0x6da169={'count':0x0,'rows':[]};var _0x112954=_[_0x18ce('0x40')](db[_0x18ce('0x41')][_0x18ce('0x42')],function(_0x52ae1e){return{'name':_0x52ae1e['fieldName'],'type':_0x52ae1e[_0x18ce('0x43')][_0x18ce('0x44')]};});_0x1e67dd[_0x18ce('0x45')]=_[_0x18ce('0x40')](_0x112954,_0x18ce('0x3e'));_0x1e67dd[_0x18ce('0x46')]=_[_0x18ce('0x47')](_0x277009['query']);_0x1e67dd['filters']=_[_0x18ce('0x48')](_0x1e67dd[_0x18ce('0x45')],_0x1e67dd['query']);_0x2f8e29[_0x18ce('0x49')]=_[_0x18ce('0x48')](_0x1e67dd[_0x18ce('0x45')],qs[_0x18ce('0x4a')](_0x277009[_0x18ce('0x46')][_0x18ce('0x4a')]));_0x2f8e29[_0x18ce('0x49')]=_0x2f8e29[_0x18ce('0x49')][_0x18ce('0x4b')]?_0x2f8e29[_0x18ce('0x49')]:_0x1e67dd[_0x18ce('0x45')];if(!_0x277009[_0x18ce('0x46')]['hasOwnProperty'](_0x18ce('0x4c'))){_0x2f8e29[_0x18ce('0x36')]=qs[_0x18ce('0x36')](_0x277009[_0x18ce('0x46')][_0x18ce('0x36')]);_0x2f8e29[_0x18ce('0x35')]=qs[_0x18ce('0x35')](_0x277009['query']['offset']);}_0x2f8e29[_0x18ce('0x4d')]=qs[_0x18ce('0x4e')](_0x277009[_0x18ce('0x46')][_0x18ce('0x4e')]);_0x2f8e29['where']=qs[_0x18ce('0x4f')](_[_0x18ce('0x50')](_0x277009[_0x18ce('0x46')],_0x1e67dd['filters']),_0x112954);if(_0x277009['query'][_0x18ce('0x51')]){_0x2f8e29[_0x18ce('0x52')]=_['merge'](_0x2f8e29[_0x18ce('0x52')],{'$or':_[_0x18ce('0x40')](_0x112954,function(_0x2d29e4){if(_0x2d29e4[_0x18ce('0x43')]!==_0x18ce('0x53')){var _0x269b68={};_0x269b68[_0x2d29e4[_0x18ce('0x3e')]]={'$like':'%'+_0x277009['query'][_0x18ce('0x51')]+'%'};return _0x269b68;}})});}_0x2f8e29=_[_0x18ce('0x54')]({},_0x2f8e29,_0x277009[_0x18ce('0x55')]);var _0x1e445d={'where':_0x2f8e29[_0x18ce('0x52')]};return db[_0x18ce('0x41')][_0x18ce('0x34')](_0x1e445d)[_0x18ce('0x25')](function(_0x2dd494){_0x6da169[_0x18ce('0x34')]=_0x2dd494;if(_0x277009[_0x18ce('0x46')][_0x18ce('0x56')]){_0x2f8e29[_0x18ce('0x57')]=[{'all':!![]}];}return db[_0x18ce('0x41')]['findAll'](_0x2f8e29);})[_0x18ce('0x25')](function(_0x13e57b){_0x6da169['rows']=_0x13e57b;return _0x6da169;})[_0x18ce('0x25')](respondWithFilteredResult(_0x2d5d4e,_0x2f8e29))['catch'](handleError(_0x2d5d4e,null));};exports[_0x18ce('0x58')]=function(_0x52101a,_0x1b6258){var _0x188f57={'raw':!![],'where':{'id':_0x52101a[_0x18ce('0x59')]['id']}},_0x3d5b1b={};_0x3d5b1b['model']=_[_0x18ce('0x47')](db['MailMessage']['rawAttributes']);_0x3d5b1b[_0x18ce('0x46')]=_[_0x18ce('0x47')](_0x52101a[_0x18ce('0x46')]);_0x3d5b1b['filters']=_['intersection'](_0x3d5b1b[_0x18ce('0x45')],_0x3d5b1b[_0x18ce('0x46')]);_0x188f57[_0x18ce('0x49')]=_[_0x18ce('0x48')](_0x3d5b1b['model'],qs['fields'](_0x52101a[_0x18ce('0x46')]['fields']));_0x188f57[_0x18ce('0x49')]=_0x188f57[_0x18ce('0x49')][_0x18ce('0x4b')]?_0x188f57['attributes']:_0x3d5b1b[_0x18ce('0x45')];if(_0x52101a[_0x18ce('0x46')][_0x18ce('0x56')]){_0x188f57['include']=[{'all':!![]}];}_0x188f57=_[_0x18ce('0x54')]({},_0x188f57,_0x52101a[_0x18ce('0x55')]);return db[_0x18ce('0x41')]['find'](_0x188f57)[_0x18ce('0x25')](handleEntityNotFound(_0x1b6258,null))[_0x18ce('0x25')](respondWithResult(_0x1b6258,null))[_0x18ce('0x5a')](handleError(_0x1b6258,null));};exports[_0x18ce('0x3b')]=function(_0x55161d,_0x4bf79f){if(_0x55161d[_0x18ce('0x5b')]['id']){delete _0x55161d[_0x18ce('0x5b')]['id'];}return db[_0x18ce('0x41')][_0x18ce('0x5c')]({'where':{'id':_0x55161d[_0x18ce('0x59')]['id']}})[_0x18ce('0x25')](handleEntityNotFound(_0x4bf79f,null))[_0x18ce('0x25')](saveUpdates(_0x55161d['body'],null))[_0x18ce('0x25')](respondWithResult(_0x4bf79f,null))[_0x18ce('0x5a')](handleError(_0x4bf79f,null));};exports['destroy']=function(_0x2a54e3,_0x4878b1){return db['MailMessage'][_0x18ce('0x5c')]({'where':{'id':_0x2a54e3[_0x18ce('0x59')]['id']}})[_0x18ce('0x25')](handleEntityNotFound(_0x4878b1,null))[_0x18ce('0x25')](removeEntity(_0x4878b1,null))[_0x18ce('0x5a')](handleError(_0x4878b1,null));};exports[_0x18ce('0x5d')]=function(_0x4ca5a4,_0x3f5171){return db[_0x18ce('0x41')][_0x18ce('0x5d')]()['then'](respondWithResult(_0x3f5171,null))[_0x18ce('0x5a')](handleError(_0x3f5171,null));};exports['create']=function(_0x361ea3,_0x2f98cc){return db['MailMessage']['create'](_0x361ea3[_0x18ce('0x5b')])[_0x18ce('0x25')](function(_0x5ad549){if(_0x5ad549){if(_0x5ad549[_0x18ce('0x5e')]===_0x18ce('0x5f')&&!_0x5ad549[_0x18ce('0x60')]){var _0x3540e0,_0x1463e6,_0x553a91;if(_0x361ea3[_0x18ce('0x5b')]['to']){_0x1463e6=_0x361ea3[_0x18ce('0x5b')]['to']['split'](',')[0x0];}return db['MailAccount'][_0x18ce('0x61')]({'where':{'id':_0x5ad549[_0x18ce('0x62')]},'include':[{'model':db[_0x18ce('0x63')],'as':_0x18ce('0x64'),'include':[{'model':db[_0x18ce('0x65')],'as':_0x18ce('0x66'),'where':{'email':_0x1463e6},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x18ce('0x67')],'as':_0x18ce('0x68'),'raw':!![]}]})[_0x18ce('0x25')](function(_0x4cbf50){_0x3540e0=_0x4cbf50;if(_0x3540e0&&_0x3540e0[_0x18ce('0x68')]){var _0x1f78e7={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x3540e0[_0x18ce('0x68')][_0x18ce('0x69')])){_0x1f78e7['host']=_0x3540e0[_0x18ce('0x68')]['host'];_0x1f78e7['port']=_0x3540e0[_0x18ce('0x68')][_0x18ce('0x6a')];_0x1f78e7[_0x18ce('0x6b')]=_0x3540e0[_0x18ce('0x68')][_0x18ce('0x6b')];if(_0x3540e0['Smtp'][_0x18ce('0x6c')]){_0x1f78e7['auth']={'user':_0x3540e0[_0x18ce('0x68')]['user'],'pass':_0x3540e0['Smtp'][_0x18ce('0x6d')]};}}else{_0x1f78e7['service']=_0x3540e0[_0x18ce('0x68')][_0x18ce('0x69')];_0x1f78e7['auth']={'user':_0x3540e0[_0x18ce('0x68')][_0x18ce('0x6e')],'pass':_0x3540e0[_0x18ce('0x68')][_0x18ce('0x6d')]};_0x1f78e7[_0x18ce('0x6b')]=_0x3540e0[_0x18ce('0x68')][_0x18ce('0x6b')];}if(_0x361ea3[_0x18ce('0x5b')][_0x18ce('0x6f')]&&_0x361ea3[_0x18ce('0x5b')]['attachments'][_0x18ce('0x4b')]){for(var _0x1eedc8=0x0;_0x1eedc8<_0x361ea3[_0x18ce('0x5b')][_0x18ce('0x6f')][_0x18ce('0x4b')];_0x1eedc8+=0x1){_0x361ea3[_0x18ce('0x5b')][_0x18ce('0x6f')][_0x1eedc8]={'filename':_0x361ea3['body']['attachments'][_0x1eedc8][_0x18ce('0x3e')],'path':path[_0x18ce('0x70')](config[_0x18ce('0x71')],_0x18ce('0x72'),_0x361ea3['body'][_0x18ce('0x6f')][_0x1eedc8][_0x18ce('0x73')])};}}_0x553a91={'account':_0x1f78e7,'message':_0x361ea3[_0x18ce('0x5b')]};return;}})[_0x18ce('0x25')](function(){if(_0x3540e0[_0x18ce('0x64')]){if(_0x3540e0[_0x18ce('0x64')][_0x18ce('0x66')][_0x18ce('0x4b')]){return _0x3540e0[_0x18ce('0x64')][_0x18ce('0x66')][0x0];}else{return db[_0x18ce('0x65')][_0x18ce('0x74')](_[_0x18ce('0x75')](_0x361ea3['body'],{'firstName':_0x361ea3['body']['to'],'email':_0x361ea3[_0x18ce('0x5b')]['to'],'phone':_0x361ea3[_0x18ce('0x5b')]['to'],'ListId':_0x3540e0['ListId']}));}}else{throw new Error(_0x18ce('0x76'));}})[_0x18ce('0x25')](function(){if(_0x553a91){return respondWithRpcPromise(_0x18ce('0x77'),_0x18ce('0x78'),_0x553a91,client9003)[_0x18ce('0x25')](function(_0x566d36){return _0x5ad549[_0x18ce('0x3b')]({'read':!![],'messageId':_0x566d36[_0x18ce('0x79')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x18ce('0x5a')](function(_0x1ba30f){logger[_0x18ce('0x2b')]('%s',JSON[_0x18ce('0x2a')](_0x1ba30f));return _0x5ad549;});}return _0x5ad549;});}return _0x5ad549;}})[_0x18ce('0x25')](respondWithResult(_0x2f98cc,0xc9))[_0x18ce('0x5a')](handleError(_0x2f98cc,null));};var interaction_log=require(_0x18ce('0x7a'))(_0x18ce('0x7b'));exports['accept']=function(_0x127fd6,_0x192d46,_0x4aa31f){var _0x4709c7={'channel':_0x18ce('0x7c')};if(_0x127fd6['body']['id']){delete _0x127fd6[_0x18ce('0x5b')]['id'];}_0x127fd6[_0x18ce('0x5b')][_0x18ce('0x7d')]=!![];_0x127fd6['body'][_0x18ce('0x7e')]=moment()['format'](_0x18ce('0x7f'));_0x127fd6['body'][_0x18ce('0x80')]=_0x127fd6[_0x18ce('0x5b')][_0x18ce('0x80')]||_0x127fd6[_0x18ce('0x6e')]['id'];return db[_0x18ce('0x41')][_0x18ce('0x5c')]({'where':{'id':_0x127fd6[_0x18ce('0x59')]['id'],'UserId':null},'include':[{'model':db[_0x18ce('0x65')],'as':_0x18ce('0x81')}]})[_0x18ce('0x25')](handleEntityNotFound(_0x192d46,null))[_0x18ce('0x25')](saveUpdates(_0x127fd6[_0x18ce('0x5b')],null))['then'](function(_0x1d7138){if(_0x1d7138){_0x4709c7[_0x18ce('0x2d')]=_0x1d7138[_0x18ce('0x82')]({'plain':!![]});return db[_0x18ce('0x83')][_0x18ce('0x5c')]({'where':{'id':_0x1d7138['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x192d46,null))[_0x18ce('0x25')](function(_0x24fd70){if(_0x24fd70){return _0x24fd70[_0x18ce('0x3b')]({'UserId':_0x127fd6[_0x18ce('0x5b')][_0x18ce('0x80')],'read1stAt':_[_0x18ce('0x84')](_0x24fd70['read1stAt'])?moment()['format'](_0x18ce('0x7f')):undefined});}return null;})['then'](function(_0x1d32db){if(_0x1d32db){_0x4709c7[_0x18ce('0x85')]=_0x1d32db['get']({'plain':!![]});interaction_log[_0x18ce('0x2e')](_0x18ce('0x86'),_0x127fd6[_0x18ce('0x6e')]['id'],_0x127fd6[_0x18ce('0x6e')][_0x18ce('0x3e')],_0x127fd6['user'][_0x18ce('0x87')],_0x4709c7[_0x18ce('0x85')]['id'],_0x127fd6[_0x18ce('0x5b')]?JSON[_0x18ce('0x2a')](_0x127fd6[_0x18ce('0x5b')]):_0x18ce('0x88'));return respondWithRpcPromise(_0x18ce('0x89'),'acceptMessage',_0x4709c7);}return null;})[_0x18ce('0x25')](function(_0x504a74){if(_0x504a74){if(_0x127fd6['body'][_0x18ce('0x8a')]){_0x4709c7[_0x18ce('0x2d')][_0x18ce('0x8b')]=util[_0x18ce('0x8c')](_0x18ce('0x8d'),_0x127fd6[_0x18ce('0x6e')][_0x18ce('0x3e')]);_0x4709c7[_0x18ce('0x2d')][_0x18ce('0x8e')]=_0x4709c7[_0x18ce('0x8e')];_0x4709c7['message'][_0x18ce('0x8f')]='accept';return respondWithRpcPromise('EventManager',_0x18ce('0x90'),{'event':_0x18ce('0x91'),'message':_0x4709c7['message']},client9002)[_0x18ce('0x25')](function(){return _0x4709c7;});}return _0x4709c7;}return null;})[_0x18ce('0x25')](respondWithResult(_0x192d46,null))[_0x18ce('0x5a')](handleError(_0x192d46,null));};var interaction_log=require(_0x18ce('0x7a'))('mail-interactions');exports[_0x18ce('0x92')]=function(_0x3a5a50,_0x4a8730,_0x84eec9){var _0x355829={'agent':{},'channel':'mail'};if(_0x3a5a50[_0x18ce('0x5b')]['id']){delete _0x3a5a50[_0x18ce('0x5b')]['id'];}_0x3a5a50[_0x18ce('0x5b')][_0x18ce('0x80')]=_0x3a5a50[_0x18ce('0x5b')]['UserId']||_0x3a5a50[_0x18ce('0x6e')]['id'];_0x355829[_0x18ce('0x93')]['id']=_0x3a5a50[_0x18ce('0x5b')]['UserId'];return db[_0x18ce('0x41')][_0x18ce('0x5c')]({'where':{'id':_0x3a5a50[_0x18ce('0x59')]['id'],'UserId':null}})[_0x18ce('0x25')](handleEntityNotFound(_0x4a8730,null))[_0x18ce('0x25')](function(_0x10b9fd){if(_0x10b9fd){_0x355829[_0x18ce('0x2d')]=_0x10b9fd[_0x18ce('0x82')]({'plain':!![]});return db[_0x18ce('0x83')]['find']({'where':{'id':_0x10b9fd[_0x18ce('0x94')]}});}return null;})[_0x18ce('0x25')](handleEntityNotFound(_0x4a8730,null))[_0x18ce('0x25')](function(_0x3350f9){if(_0x3350f9){_0x355829[_0x18ce('0x85')]=_0x3350f9[_0x18ce('0x82')]({'plain':!![]});interaction_log[_0x18ce('0x2e')](_0x18ce('0x95'),_0x3a5a50[_0x18ce('0x6e')]['id'],_0x3a5a50[_0x18ce('0x6e')][_0x18ce('0x3e')],_0x3a5a50[_0x18ce('0x6e')]['role'],_0x355829[_0x18ce('0x85')]['id'],_0x3a5a50[_0x18ce('0x5b')]?JSON[_0x18ce('0x2a')](_0x3a5a50[_0x18ce('0x5b')]):_0x18ce('0x88'));return respondWithRpcPromise('RejectMessage',_0x18ce('0x96'),_0x355829);}return null;})[_0x18ce('0x25')](function(_0x3e4552){if(_0x3e4552){_0x3e4552[_0x18ce('0x2d')][_0x18ce('0x8b')]=util[_0x18ce('0x8c')](_0x18ce('0x8d'),_0x3a5a50[_0x18ce('0x6e')][_0x18ce('0x3e')]);_0x3e4552[_0x18ce('0x2d')][_0x18ce('0x8e')]=_0x355829[_0x18ce('0x8e')];_0x3e4552[_0x18ce('0x2d')][_0x18ce('0x8f')]=_0x18ce('0x92');respondWithRpcPromise(_0x18ce('0x90'),_0x18ce('0x90'),{'event':_0x18ce('0x97'),'message':_0x3e4552['message']},client9002);return _0x355829;}return null;})[_0x18ce('0x25')](respondWithResult(_0x4a8730,null))[_0x18ce('0x5a')](handleError(_0x4a8730,null));};exports[_0x18ce('0x98')]=function(_0x3cebbe,_0x507b3e){var _0x3be0ce=moment()[_0x18ce('0x99')]()[_0x18ce('0x9a')]();var _0x3dab12=path[_0x18ce('0x70')](config[_0x18ce('0x71')],_0x18ce('0x9b'),_0x18ce('0x9c'),_0x18ce('0x9d'));var _0x53b9b9=path['join'](config[_0x18ce('0x71')],'server',_0x18ce('0x9c'),_0x18ce('0x6f'));var _0x5e8095=util[_0x18ce('0x8c')](_0x18ce('0x9e'),_0x3be0ce);return db[_0x18ce('0x41')][_0x18ce('0x5c')]({'where':{'id':_0x3cebbe['params']['id']},'attributes':['id',_0x18ce('0x5b'),'from','to','cc',_0x18ce('0x9f'),_0x18ce('0xa0'),_0x18ce('0xa1')],'include':_0x3cebbe[_0x18ce('0x46')][_0x18ce('0x6f')]?[{'model':db[_0x18ce('0xa2')],'as':_0x18ce('0xa3')}]:undefined})[_0x18ce('0x25')](handleEntityNotFound(_0x507b3e,null))[_0x18ce('0x25')](function(_0xcc049f){if(_0xcc049f){var _0x2dfa6f=_0xcc049f;var _0x4c34ec={'from':_0x2dfa6f['from'],'to':_0x2dfa6f['to'],'subject':_0x2dfa6f[_0x18ce('0xa0')],'html':_0x2dfa6f['body'],'headers':{'Date':moment(_0x2dfa6f[_0x18ce('0xa1')])[_0x18ce('0x8c')](_0x18ce('0xa4'))},'attachments':[]};if(_0xcc049f['cc']){_0x4c34ec['headers']['Cc']=_0xcc049f['cc'];}if(_0xcc049f[_0x18ce('0x9f')]){_0x4c34ec['headers']['Bcc']=_0xcc049f[_0x18ce('0x9f')];}return new BPromise(function(_0x3a0571,_0x6c0346){if(_0xcc049f[_0x18ce('0xa3')]){for(var _0x21c484=0x0;_0x21c484<_0xcc049f['Attachments']['length'];_0x21c484++){var _0x4b80c7=_0xcc049f[_0x18ce('0xa3')][_0x21c484];var _0x503a44=path['join'](_0x53b9b9,_0x4b80c7[_0x18ce('0x73')]);if(fs[_0x18ce('0xa5')](_0x503a44)){_0x4c34ec[_0x18ce('0x6f')]['push']({'name':_0x4b80c7[_0x18ce('0x3e')],'contentType':_0x4b80c7[_0x18ce('0x43')],'data':fs['readFileSync'](_0x503a44)});}}}emlformat[_0x18ce('0xa6')](_0x4c34ec,function(_0x4907a9,_0x3759f0){if(_0x4907a9)return _0x6c0346(_0x4907a9);fs[_0x18ce('0xa7')](path[_0x18ce('0x70')](_0x3dab12,_0x5e8095),_0x3759f0);return _0x3a0571(_0x3759f0);});});}})[_0x18ce('0x25')](function(_0x2d4509){if(_0x2d4509){return _0x507b3e[_0x18ce('0x98')](path[_0x18ce('0x70')](_0x3dab12,_0x5e8095),_0x5e8095,function(_0x2c86d1){if(_0x2c86d1){console['log'](_0x18ce('0xa8'),_0x2c86d1);}else{fs[_0x18ce('0xa9')](path[_0x18ce('0x70')](_0x3dab12,_0x5e8095));}});}})[_0x18ce('0x5a')](handleError(_0x507b3e,null));};
\ No newline at end of file
+var _0x40c2=['rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','options','MailMessage','includeAll','include','show','params','keys','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','isNil','Smtp','service','host','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','ListId','sendMail','messageId','format','stringify','mail-interactions','YYYY-MM-DD\x20HH:mm:ss','Contact','get','MailInteraction','MailInteractionId','read1stAt','role','interaction','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','mail','UserId','agent','RejectMessage','download','unix','toString','server','files','message-%s.eml','from','createdAt','Attachment','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Attachments','existsSync','push','type','writeFileSync','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','defaults','socket.io-emitter','redis','./mailMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','MailMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send'];(function(_0x431480,_0x40c7a7){var _0x139af7=function(_0x58eb96){while(--_0x58eb96){_0x431480['push'](_0x431480['shift']());}};_0x139af7(++_0x40c7a7);}(_0x40c2,0x10d));var _0x240c=function(_0x37b533,_0x52b69c){_0x37b533=_0x37b533-0x0;var _0x25e7bd=_0x40c2[_0x37b533];return _0x25e7bd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x240c('0x0'));var rimraf=require(_0x240c('0x1'));var zipdir=require(_0x240c('0x2'));var jsonpatch=require(_0x240c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x240c('0x4'));var Mustache=require(_0x240c('0x5'));var util=require(_0x240c('0x6'));var path=require(_0x240c('0x7'));var sox=require(_0x240c('0x8'));var csv=require(_0x240c('0x9'));var ejs=require(_0x240c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x240c('0xb'));var crypto=require(_0x240c('0xc'));var jsforce=require(_0x240c('0xd'));var deskjs=require(_0x240c('0xe'));var toCsv=require(_0x240c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x240c('0xf'));var authService=require(_0x240c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x240c('0x11'))(_0x240c('0x12'));var utils=require(_0x240c('0x13'));var config=require(_0x240c('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x240c('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x240c('0x16'))(new Redis(config[_0x240c('0x17')]));require(_0x240c('0x18'))[_0x240c('0x19')](socket);var jayson=require(_0x240c('0x1a'));var client=jayson[_0x240c('0x1b')]['http']({'port':0x232c});var client9003=jayson[_0x240c('0x1b')][_0x240c('0x1c')]({'port':0x232b});var client9002=jayson[_0x240c('0x1b')][_0x240c('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x376f4b,_0x11676f,_0x5c41bc){if(_0x5c41bc){var _0x3d2251=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d2251[_0x240c('0x1d')](_0x11676f)){return _0x376f4b;}else{throw new db[(_0x240c('0x1e'))][(_0x240c('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x376f4b;}}function respondWithRpcPromise(_0x354656,_0x592812,_0x1a3212,_0xfc1115){return new BPromise(function(_0x1241af,_0x279fbd){var _0x2b2626=_0xfc1115||client;return _0x2b2626[_0x240c('0x20')](_0x354656,_0x1a3212)[_0x240c('0x21')](function(_0x5e123e){logger[_0x240c('0x22')]('MailMessage,\x20%s,\x20%s',_0x592812,'request\x20sent');logger[_0x240c('0x23')](_0x240c('0x24'),_0x592812,_0x240c('0x25'),JSON['stringify'](_0x5e123e));if(_0x5e123e['error']){if(_0x5e123e['error'][_0x240c('0x26')]===0x1f4){logger[_0x240c('0x27')](_0x240c('0x28'),_0x592812,_0x5e123e[_0x240c('0x27')][_0x240c('0x29')]);return _0x279fbd(_0x5e123e[_0x240c('0x27')][_0x240c('0x29')]);}logger[_0x240c('0x27')](_0x240c('0x28'),_0x592812,_0x5e123e[_0x240c('0x27')][_0x240c('0x29')]);return _0x1241af(_0x5e123e[_0x240c('0x27')][_0x240c('0x29')]);}else{logger['info'](_0x240c('0x28'),_0x592812,'request\x20sent');_0x1241af(_0x5e123e[_0x240c('0x2a')][_0x240c('0x29')]);}})[_0x240c('0x2b')](function(_0x3da2e4){logger[_0x240c('0x27')](_0x240c('0x28'),_0x592812,_0x3da2e4);_0x279fbd(_0x3da2e4);});});}function respondWithStatusCode(_0x5b7c15,_0x3dc6cc){_0x3dc6cc=_0x3dc6cc||0xcc;return function(_0x4c5df8){if(_0x4c5df8){return _0x5b7c15[_0x240c('0x2c')](_0x3dc6cc);}return _0x5b7c15[_0x240c('0x2d')](_0x3dc6cc)[_0x240c('0x2e')]();};}function respondWithResult(_0x81625a,_0x1d38c0){_0x1d38c0=_0x1d38c0||0xc8;return function(_0x4559bb){if(_0x4559bb){return _0x81625a[_0x240c('0x2d')](_0x1d38c0)['json'](_0x4559bb);}};}function respondWithFilteredResult(_0x2017d0,_0x28a49b){return function(_0x569815){if(_0x569815){var _0x17a562=_0x569815[_0x240c('0x2f')],_0x25f181=_0x28a49b['offset'],_0x8f7420=_0x28a49b[_0x240c('0x30')]+_0x28a49b[_0x240c('0x31')],_0x115288;if(_0x8f7420>=_0x17a562){_0x8f7420=_0x17a562;_0x115288=0xc8;}else{_0x115288=0xce;}_0x2017d0['status'](_0x115288);return _0x2017d0[_0x240c('0x32')](_0x240c('0x33'),_0x25f181+'-'+_0x8f7420+'/'+_0x17a562)[_0x240c('0x34')](_0x569815);}return null;};}function patchUpdates(_0x5549f3){return function(_0x401349){try{jsonpatch[_0x240c('0x35')](_0x401349,_0x5549f3,!![]);}catch(_0x4c3d45){return BPromise[_0x240c('0x36')](_0x4c3d45);}return _0x401349[_0x240c('0x37')]();};}function saveUpdates(_0x110808,_0x54ba1d){return function(_0x42c95e){if(_0x42c95e){return _0x42c95e[_0x240c('0x38')](_0x110808)[_0x240c('0x21')](function(_0x4c1849){return _0x4c1849;});}return null;};}function removeEntity(_0x4d2ff1,_0x23dde8){return function(_0x3a04b7){if(_0x3a04b7){return _0x3a04b7[_0x240c('0x39')]()[_0x240c('0x21')](function(){_0x4d2ff1[_0x240c('0x2d')](0xcc)[_0x240c('0x2e')]();});}};}function handleEntityNotFound(_0x123e10,_0x2ffe7c){return function(_0x42983e){if(!_0x42983e){_0x123e10['sendStatus'](0x194);}return _0x42983e;};}function handleError(_0x19714f,_0x4ac22e){_0x4ac22e=_0x4ac22e||0x1f4;return function(_0xdaa7e4){logger[_0x240c('0x27')](_0xdaa7e4[_0x240c('0x3a')]);if(_0xdaa7e4[_0x240c('0x3b')]){delete _0xdaa7e4[_0x240c('0x3b')];}_0x19714f[_0x240c('0x2d')](_0x4ac22e)[_0x240c('0x3c')](_0xdaa7e4);};}exports['index']=function(_0x41aee3,_0x1c1212){var _0x276d80={},_0x45d8d9={},_0x499edc={'count':0x0,'rows':[]};var _0x21c3d3=_['map'](db['MailMessage'][_0x240c('0x3d')],function(_0x58e6fd){return{'name':_0x58e6fd[_0x240c('0x3e')],'type':_0x58e6fd['type'][_0x240c('0x3f')]};});_0x45d8d9[_0x240c('0x40')]=_['map'](_0x21c3d3,_0x240c('0x3b'));_0x45d8d9[_0x240c('0x41')]=_['keys'](_0x41aee3[_0x240c('0x41')]);_0x45d8d9[_0x240c('0x42')]=_['intersection'](_0x45d8d9[_0x240c('0x40')],_0x45d8d9[_0x240c('0x41')]);_0x276d80['attributes']=_[_0x240c('0x43')](_0x45d8d9[_0x240c('0x40')],qs['fields'](_0x41aee3[_0x240c('0x41')][_0x240c('0x44')]));_0x276d80['attributes']=_0x276d80[_0x240c('0x45')][_0x240c('0x46')]?_0x276d80[_0x240c('0x45')]:_0x45d8d9[_0x240c('0x40')];if(!_0x41aee3[_0x240c('0x41')][_0x240c('0x47')]('nolimit')){_0x276d80['limit']=qs[_0x240c('0x31')](_0x41aee3[_0x240c('0x41')][_0x240c('0x31')]);_0x276d80[_0x240c('0x30')]=qs[_0x240c('0x30')](_0x41aee3[_0x240c('0x41')][_0x240c('0x30')]);}_0x276d80[_0x240c('0x48')]=qs[_0x240c('0x49')](_0x41aee3[_0x240c('0x41')][_0x240c('0x49')]);_0x276d80['where']=qs[_0x240c('0x42')](_[_0x240c('0x4a')](_0x41aee3[_0x240c('0x41')],_0x45d8d9[_0x240c('0x42')]),_0x21c3d3);if(_0x41aee3[_0x240c('0x41')][_0x240c('0x4b')]){_0x276d80[_0x240c('0x4c')]=_[_0x240c('0x4d')](_0x276d80[_0x240c('0x4c')],{'$or':_[_0x240c('0x4e')](_0x21c3d3,function(_0xc3e49){if(_0xc3e49['type']!==_0x240c('0x4f')){var _0x5a35b2={};_0x5a35b2[_0xc3e49[_0x240c('0x3b')]]={'$like':'%'+_0x41aee3[_0x240c('0x41')][_0x240c('0x4b')]+'%'};return _0x5a35b2;}})});}_0x276d80=_[_0x240c('0x4d')]({},_0x276d80,_0x41aee3[_0x240c('0x50')]);var _0x248c5e={'where':_0x276d80[_0x240c('0x4c')]};return db[_0x240c('0x51')]['count'](_0x248c5e)['then'](function(_0x35cc63){_0x499edc['count']=_0x35cc63;if(_0x41aee3[_0x240c('0x41')][_0x240c('0x52')]){_0x276d80[_0x240c('0x53')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x276d80);})[_0x240c('0x21')](function(_0x5a5361){_0x499edc['rows']=_0x5a5361;return _0x499edc;})[_0x240c('0x21')](respondWithFilteredResult(_0x1c1212,_0x276d80))[_0x240c('0x2b')](handleError(_0x1c1212,null));};exports[_0x240c('0x54')]=function(_0x54670c,_0xf32730){var _0x2d670d={'raw':!![],'where':{'id':_0x54670c[_0x240c('0x55')]['id']}},_0x1a08ec={};_0x1a08ec[_0x240c('0x40')]=_['keys'](db[_0x240c('0x51')][_0x240c('0x3d')]);_0x1a08ec['query']=_[_0x240c('0x56')](_0x54670c[_0x240c('0x41')]);_0x1a08ec[_0x240c('0x42')]=_[_0x240c('0x43')](_0x1a08ec[_0x240c('0x40')],_0x1a08ec[_0x240c('0x41')]);_0x2d670d[_0x240c('0x45')]=_[_0x240c('0x43')](_0x1a08ec['model'],qs[_0x240c('0x44')](_0x54670c[_0x240c('0x41')][_0x240c('0x44')]));_0x2d670d[_0x240c('0x45')]=_0x2d670d[_0x240c('0x45')][_0x240c('0x46')]?_0x2d670d['attributes']:_0x1a08ec['model'];if(_0x54670c[_0x240c('0x41')][_0x240c('0x52')]){_0x2d670d['include']=[{'all':!![]}];}_0x2d670d=_[_0x240c('0x4d')]({},_0x2d670d,_0x54670c['options']);return db['MailMessage']['find'](_0x2d670d)[_0x240c('0x21')](handleEntityNotFound(_0xf32730,null))[_0x240c('0x21')](respondWithResult(_0xf32730,null))['catch'](handleError(_0xf32730,null));};exports[_0x240c('0x38')]=function(_0xe3b3b8,_0x1491db){if(_0xe3b3b8['body']['id']){delete _0xe3b3b8['body']['id'];}return db[_0x240c('0x51')][_0x240c('0x57')]({'where':{'id':_0xe3b3b8['params']['id']}})[_0x240c('0x21')](handleEntityNotFound(_0x1491db,null))['then'](saveUpdates(_0xe3b3b8[_0x240c('0x58')],null))[_0x240c('0x21')](respondWithResult(_0x1491db,null))['catch'](handleError(_0x1491db,null));};exports[_0x240c('0x39')]=function(_0x4e7ad2,_0x1fc698){return db['MailMessage'][_0x240c('0x57')]({'where':{'id':_0x4e7ad2[_0x240c('0x55')]['id']}})[_0x240c('0x21')](handleEntityNotFound(_0x1fc698,null))[_0x240c('0x21')](removeEntity(_0x1fc698,null))[_0x240c('0x2b')](handleError(_0x1fc698,null));};exports['describe']=function(_0x580847,_0x4d9791){return db[_0x240c('0x51')][_0x240c('0x59')]()[_0x240c('0x21')](respondWithResult(_0x4d9791,null))[_0x240c('0x2b')](handleError(_0x4d9791,null));};exports['create']=function(_0x50b902,_0x2ef007){return db[_0x240c('0x51')][_0x240c('0x5a')](_0x50b902['body'])[_0x240c('0x21')](function(_0x1c5f2f){if(_0x1c5f2f){if(_0x1c5f2f[_0x240c('0x5b')]===_0x240c('0x5c')&&!_0x1c5f2f[_0x240c('0x5d')]){var _0x84552,_0x7b0d8,_0xc7d436;if(_0x50b902[_0x240c('0x58')]['to']){_0x7b0d8=_0x50b902[_0x240c('0x58')]['to'][_0x240c('0x5e')](',')[0x0];}return db[_0x240c('0x5f')][_0x240c('0x60')]({'where':{'id':_0x1c5f2f[_0x240c('0x61')]},'include':[{'model':db[_0x240c('0x62')],'as':_0x240c('0x63'),'include':[{'model':db[_0x240c('0x64')],'as':_0x240c('0x65'),'where':{'email':_0x7b0d8},'limit':0x1,'order':[[_0x240c('0x66'),_0x240c('0x67')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x240c('0x21')](function(_0x1194a5){_0x84552=_0x1194a5;if(_0x84552&&_0x84552['Smtp']){var _0x2baf3a={'tls':{'rejectUnauthorized':![]}};if(_[_0x240c('0x68')](_0x84552[_0x240c('0x69')][_0x240c('0x6a')])){_0x2baf3a['host']=_0x84552[_0x240c('0x69')][_0x240c('0x6b')];_0x2baf3a['port']=_0x84552[_0x240c('0x69')]['port'];_0x2baf3a[_0x240c('0x6c')]=_0x84552[_0x240c('0x69')][_0x240c('0x6c')];if(_0x84552[_0x240c('0x69')][_0x240c('0x6d')]){_0x2baf3a[_0x240c('0x6e')]={'user':_0x84552[_0x240c('0x69')][_0x240c('0x6f')],'pass':_0x84552[_0x240c('0x69')][_0x240c('0x70')]};}}else{_0x2baf3a[_0x240c('0x6a')]=_0x84552[_0x240c('0x69')][_0x240c('0x6a')];_0x2baf3a[_0x240c('0x6e')]={'user':_0x84552['Smtp'][_0x240c('0x6f')],'pass':_0x84552['Smtp'][_0x240c('0x70')]};_0x2baf3a[_0x240c('0x6c')]=_0x84552['Smtp'][_0x240c('0x6c')];}if(_0x50b902['body'][_0x240c('0x71')]&&_0x50b902[_0x240c('0x58')][_0x240c('0x71')]['length']){for(var _0x493038=0x0;_0x493038<_0x50b902[_0x240c('0x58')][_0x240c('0x71')][_0x240c('0x46')];_0x493038+=0x1){_0x50b902[_0x240c('0x58')]['attachments'][_0x493038]={'filename':_0x50b902[_0x240c('0x58')][_0x240c('0x71')][_0x493038][_0x240c('0x3b')],'path':path[_0x240c('0x72')](config[_0x240c('0x73')],_0x240c('0x74'),_0x50b902[_0x240c('0x58')][_0x240c('0x71')][_0x493038][_0x240c('0x75')])};}}_0xc7d436={'account':_0x2baf3a,'message':_0x50b902['body']};return;}})[_0x240c('0x21')](function(){if(_0x84552[_0x240c('0x63')]){if(_0x84552[_0x240c('0x63')][_0x240c('0x65')]['length']){return _0x84552[_0x240c('0x63')][_0x240c('0x65')][0x0];}else{return db['CmContact']['create'](_[_0x240c('0x15')](_0x50b902['body'],{'firstName':_0x50b902['body']['to'],'email':_0x50b902[_0x240c('0x58')]['to'],'phone':_0x50b902[_0x240c('0x58')]['to'],'ListId':_0x84552[_0x240c('0x76')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x240c('0x21')](function(){if(_0xc7d436){return respondWithRpcPromise('SendMail',_0x240c('0x77'),_0xc7d436,client9003)[_0x240c('0x21')](function(_0x5e8021){return _0x1c5f2f[_0x240c('0x38')]({'read':!![],'messageId':_0x5e8021[_0x240c('0x78')],'sentAt':moment()[_0x240c('0x79')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x240c('0x2b')](function(_0x523cca){logger[_0x240c('0x27')]('%s',JSON[_0x240c('0x7a')](_0x523cca));return _0x1c5f2f;});}return _0x1c5f2f;});}return _0x1c5f2f;}})[_0x240c('0x21')](respondWithResult(_0x2ef007,0xc9))[_0x240c('0x2b')](handleError(_0x2ef007,null));};var interaction_log=require(_0x240c('0x11'))(_0x240c('0x7b'));exports['accept']=function(_0x3cd519,_0x2b21c7,_0x5d3947){var _0x368c82={'channel':'mail'};if(_0x3cd519[_0x240c('0x58')]['id']){delete _0x3cd519[_0x240c('0x58')]['id'];}_0x3cd519[_0x240c('0x58')]['read']=!![];_0x3cd519[_0x240c('0x58')]['readAt']=moment()[_0x240c('0x79')](_0x240c('0x7c'));_0x3cd519[_0x240c('0x58')]['UserId']=_0x3cd519['body']['UserId']||_0x3cd519['user']['id'];return db[_0x240c('0x51')][_0x240c('0x57')]({'where':{'id':_0x3cd519['params']['id'],'UserId':null},'include':[{'model':db[_0x240c('0x64')],'as':_0x240c('0x7d')}]})[_0x240c('0x21')](handleEntityNotFound(_0x2b21c7,null))['then'](saveUpdates(_0x3cd519[_0x240c('0x58')],null))[_0x240c('0x21')](function(_0x46c0d4){if(_0x46c0d4){_0x368c82[_0x240c('0x29')]=_0x46c0d4[_0x240c('0x7e')]({'plain':!![]});return db[_0x240c('0x7f')][_0x240c('0x57')]({'where':{'id':_0x46c0d4[_0x240c('0x80')]}});}return null;})[_0x240c('0x21')](handleEntityNotFound(_0x2b21c7,null))[_0x240c('0x21')](function(_0x38b374){if(_0x38b374){return _0x38b374[_0x240c('0x38')]({'UserId':_0x3cd519[_0x240c('0x58')]['UserId'],'read1stAt':_[_0x240c('0x68')](_0x38b374[_0x240c('0x81')])?moment()[_0x240c('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x4e51ea){if(_0x4e51ea){_0x368c82['interaction']=_0x4e51ea[_0x240c('0x7e')]({'plain':!![]});interaction_log[_0x240c('0x22')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3cd519[_0x240c('0x6f')]['id'],_0x3cd519[_0x240c('0x6f')][_0x240c('0x3b')],_0x3cd519[_0x240c('0x6f')][_0x240c('0x82')],_0x368c82[_0x240c('0x83')]['id'],_0x3cd519['body']?JSON['stringify'](_0x3cd519['body']):'null');return respondWithRpcPromise(_0x240c('0x84'),_0x240c('0x85'),_0x368c82);}return null;})['then'](function(_0x2815a0){if(_0x2815a0){if(_0x3cd519[_0x240c('0x58')][_0x240c('0x86')]){_0x368c82[_0x240c('0x29')][_0x240c('0x87')]=util[_0x240c('0x79')](_0x240c('0x88'),_0x3cd519[_0x240c('0x6f')][_0x240c('0x3b')]);_0x368c82[_0x240c('0x29')][_0x240c('0x89')]=_0x368c82[_0x240c('0x89')];_0x368c82[_0x240c('0x29')][_0x240c('0x8a')]='accept';return respondWithRpcPromise('EventManager',_0x240c('0x8b'),{'event':_0x240c('0x8c'),'message':_0x368c82['message']},client9002)[_0x240c('0x21')](function(){return _0x368c82;});}return _0x368c82;}return null;})[_0x240c('0x21')](respondWithResult(_0x2b21c7,null))[_0x240c('0x2b')](handleError(_0x2b21c7,null));};var interaction_log=require(_0x240c('0x11'))(_0x240c('0x7b'));exports[_0x240c('0x36')]=function(_0x21d9c5,_0x356381,_0x2095c7){var _0x83830e={'agent':{},'channel':_0x240c('0x8d')};if(_0x21d9c5[_0x240c('0x58')]['id']){delete _0x21d9c5[_0x240c('0x58')]['id'];}_0x21d9c5[_0x240c('0x58')]['UserId']=_0x21d9c5[_0x240c('0x58')][_0x240c('0x8e')]||_0x21d9c5[_0x240c('0x6f')]['id'];_0x83830e[_0x240c('0x8f')]['id']=_0x21d9c5['body'][_0x240c('0x8e')];return db[_0x240c('0x51')]['find']({'where':{'id':_0x21d9c5[_0x240c('0x55')]['id'],'UserId':null}})[_0x240c('0x21')](handleEntityNotFound(_0x356381,null))['then'](function(_0x41dedb){if(_0x41dedb){_0x83830e[_0x240c('0x29')]=_0x41dedb[_0x240c('0x7e')]({'plain':!![]});return db[_0x240c('0x7f')]['find']({'where':{'id':_0x41dedb[_0x240c('0x80')]}});}return null;})['then'](handleEntityNotFound(_0x356381,null))['then'](function(_0x3c2137){if(_0x3c2137){_0x83830e[_0x240c('0x83')]=_0x3c2137[_0x240c('0x7e')]({'plain':!![]});interaction_log[_0x240c('0x22')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x21d9c5['user']['id'],_0x21d9c5[_0x240c('0x6f')]['name'],_0x21d9c5['user'][_0x240c('0x82')],_0x83830e[_0x240c('0x83')]['id'],_0x21d9c5[_0x240c('0x58')]?JSON[_0x240c('0x7a')](_0x21d9c5[_0x240c('0x58')]):'null');return respondWithRpcPromise(_0x240c('0x90'),'rejectMessage',_0x83830e);}return null;})[_0x240c('0x21')](function(_0x2d552c){if(_0x2d552c){_0x2d552c[_0x240c('0x29')][_0x240c('0x87')]=util['format']('SIP/%s',_0x21d9c5[_0x240c('0x6f')]['name']);_0x2d552c[_0x240c('0x29')]['channel']=_0x83830e[_0x240c('0x89')];_0x2d552c[_0x240c('0x29')][_0x240c('0x8a')]=_0x240c('0x36');respondWithRpcPromise(_0x240c('0x8b'),_0x240c('0x8b'),{'event':'rejectmessage','message':_0x2d552c[_0x240c('0x29')]},client9002);return _0x83830e;}return null;})['then'](respondWithResult(_0x356381,null))[_0x240c('0x2b')](handleError(_0x356381,null));};exports[_0x240c('0x91')]=function(_0xba5cb1,_0xe4ced3){var _0x4baa2c=moment()[_0x240c('0x92')]()[_0x240c('0x93')]();var _0x376a4f=path[_0x240c('0x72')](config[_0x240c('0x73')],_0x240c('0x94'),_0x240c('0x95'),'tmp');var _0x322e97=path['join'](config[_0x240c('0x73')],_0x240c('0x94'),'files','attachments');var _0x13a058=util[_0x240c('0x79')](_0x240c('0x96'),_0x4baa2c);return db['MailMessage']['find']({'where':{'id':_0xba5cb1[_0x240c('0x55')]['id']},'attributes':['id','body',_0x240c('0x97'),'to','cc','bcc','subject',_0x240c('0x98')],'include':_0xba5cb1[_0x240c('0x41')]['attachments']?[{'model':db[_0x240c('0x99')],'as':'Attachments'}]:undefined})[_0x240c('0x21')](handleEntityNotFound(_0xe4ced3,null))[_0x240c('0x21')](function(_0x244b2b){if(_0x244b2b){var _0x5ed959=_0x244b2b;var _0x2d81cf={'from':_0x5ed959['from'],'to':_0x5ed959['to'],'subject':_0x5ed959[_0x240c('0x9a')],'html':_0x5ed959[_0x240c('0x58')],'headers':{'Date':moment(_0x5ed959[_0x240c('0x98')])[_0x240c('0x79')](_0x240c('0x9b'))},'attachments':[]};if(_0x244b2b['cc']){_0x2d81cf[_0x240c('0x9c')]['Cc']=_0x244b2b['cc'];}if(_0x244b2b[_0x240c('0x9d')]){_0x2d81cf[_0x240c('0x9c')]['Bcc']=_0x244b2b[_0x240c('0x9d')];}return new BPromise(function(_0xe04664,_0x4dd001){if(_0x244b2b['Attachments']){for(var _0x3f124d=0x0;_0x3f124d<_0x244b2b[_0x240c('0x9e')][_0x240c('0x46')];_0x3f124d++){var _0x3b2f61=_0x244b2b[_0x240c('0x9e')][_0x3f124d];var _0x58b751=path[_0x240c('0x72')](_0x322e97,_0x3b2f61[_0x240c('0x75')]);if(fs[_0x240c('0x9f')](_0x58b751)){_0x2d81cf[_0x240c('0x71')][_0x240c('0xa0')]({'name':_0x3b2f61[_0x240c('0x3b')],'contentType':_0x3b2f61[_0x240c('0xa1')],'data':fs['readFileSync'](_0x58b751)});}}}emlformat['build'](_0x2d81cf,function(_0x42b7fa,_0x25fee1){if(_0x42b7fa)return _0x4dd001(_0x42b7fa);fs[_0x240c('0xa2')](path['join'](_0x376a4f,_0x13a058),_0x25fee1);return _0xe04664(_0x25fee1);});});}})[_0x240c('0x21')](function(_0x721c93){if(_0x721c93){return _0xe4ced3[_0x240c('0x91')](path['join'](_0x376a4f,_0x13a058),_0x13a058,function(_0x21644f){if(_0x21644f){console[_0x240c('0xa3')]('err',_0x21644f);}else{fs[_0x240c('0xa4')](path[_0x240c('0x72')](_0x376a4f,_0x13a058));}});}})['catch'](handleError(_0xe4ced3,null));};
\ No newline at end of file
index 9e73f9b..3ef851b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0050=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','save'];(function(_0x23a007,_0x3f3cc9){var _0x35026a=function(_0x1118b8){while(--_0x1118b8){_0x23a007['push'](_0x23a007['shift']());}};_0x35026a(++_0x3f3cc9);}(_0x0050,0x9c));var _0x0005=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x0050[_0x46698a];return _0x356db0;};'use strict';var EventEmitter=require(_0x0005('0x0'));var MailMessage=require(_0x0005('0x1'))['db'][_0x0005('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0005('0x3'),'afterUpdate':_0x0005('0x4'),'afterDestroy':_0x0005('0x5')};function emitEvent(_0x347af1){return function(_0xb74261,_0x3a068c,_0x5633a5){MailMessageEvents['emit'](_0x347af1+':'+_0xb74261['id'],_0xb74261);MailMessageEvents[_0x0005('0x6')](_0x347af1,_0xb74261);_0x5633a5(null);};}for(var e in events){if(events[_0x0005('0x7')](e)){var event=events[e];MailMessage[_0x0005('0x8')](e,emitEvent(event));}}module[_0x0005('0x9')]=MailMessageEvents;
\ No newline at end of file
+var _0x64e8=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage'];(function(_0x266de6,_0x2983c1){var _0x6b83a2=function(_0x3aad6e){while(--_0x3aad6e){_0x266de6['push'](_0x266de6['shift']());}};_0x6b83a2(++_0x2983c1);}(_0x64e8,0x181));var _0x864e=function(_0x4c7490,_0x26898c){_0x4c7490=_0x4c7490-0x0;var _0x1bc93e=_0x64e8[_0x4c7490];return _0x1bc93e;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x864e('0x0'))['db'][_0x864e('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x864e('0x2'),'afterUpdate':_0x864e('0x3'),'afterDestroy':_0x864e('0x4')};function emitEvent(_0x345c5c){return function(_0x2e5953,_0x3690ef,_0x53a95b){MailMessageEvents[_0x864e('0x5')](_0x345c5c+':'+_0x2e5953['id'],_0x2e5953);MailMessageEvents[_0x864e('0x5')](_0x345c5c,_0x2e5953);_0x53a95b(null);};}for(var e in events){if(events[_0x864e('0x6')](e)){var event=events[e];MailMessage[_0x864e('0x7')](e,emitEvent(event));}}module[_0x864e('0x8')]=MailMessageEvents;
\ No newline at end of file
index 5ebca54..cccda45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x453b=['messageId','fti_mail_messages','plainBody','subject','body','fromString','models','get','direction','toLowerCase','out','UserId','MailInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage'];(function(_0x2e66e9,_0x5a8b47){var _0x42b8ee=function(_0x5f3b49){while(--_0x5f3b49){_0x2e66e9['push'](_0x2e66e9['shift']());}};_0x42b8ee(++_0x5a8b47);}(_0x453b,0xce));var _0xb453=function(_0x12f9e3,_0x3fadc1){_0x12f9e3=_0x12f9e3-0x0;var _0x2de0c8=_0x453b[_0x12f9e3];return _0x2de0c8;};'use strict';var _=require(_0xb453('0x0'));var util=require(_0xb453('0x1'));var logger=require('../../config/logger')(_0xb453('0x2'));var moment=require('moment');var BPromise=require(_0xb453('0x3'));var rp=require(_0xb453('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xb453('0x5'));var rimraf=require('rimraf');var config=require(_0xb453('0x6'));var attributes=require(_0xb453('0x7'));module[_0xb453('0x8')]=function(_0x15dd3b,_0x2c68e5){return _0x15dd3b[_0xb453('0x9')](_0xb453('0xa'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xb453('0xb')]},{'name':_0xb453('0xc'),'fields':[_0xb453('0xd'),_0xb453('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x27c480,_0x5022bd,_0x642852){if(_0x27c480[_0xb453('0xf')]){_0x27c480[_0xb453('0xd')]=htmlToText[_0xb453('0x10')](_0x27c480[_0xb453('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x642852(null,_0x5022bd);},'afterCreate':function(_0x50c52b,_0xf93f66,_0x55e025){var _0x389e10=_0x15dd3b[_0xb453('0x11')];var _0x96ba57=_0x50c52b[_0xb453('0x12')]({'plain':!![]});if(_0x96ba57[_0xb453('0x13')][_0xb453('0x14')]()==='in'||_0x96ba57[_0xb453('0x13')][_0xb453('0x14')]()===_0xb453('0x15')&&!_0x96ba57['secret']&&!_['isNil'](_0x96ba57[_0xb453('0x16')])){_0x389e10[_0xb453('0x17')][_0xb453('0x18')]({'where':{'id':_0x96ba57['MailInteractionId']}})[_0xb453('0x19')](function(_0x59d2ab){if(_0x59d2ab){_0x59d2ab[_0xb453('0x1a')]({'lastMsgAt':_0x96ba57[_0xb453('0x1b')],'lastMsgDirection':_0x96ba57[_0xb453('0x13')]['toLowerCase'](),'lastMsgBody':_0x96ba57[_0xb453('0xf')]});}})[_0xb453('0x1c')](function(_0x43bbcd){console['error'](_0x43bbcd);});}_0x55e025();}},'charset':_0xb453('0x1d'),'collate':_0xb453('0x1e')});};
\ No newline at end of file
+var _0x7b14=['findOne','MailInteractionId','then','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','mail_messages','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','models','get','direction','toLowerCase','out','MailInteraction'];(function(_0x1523e0,_0x367509){var _0x9a8c43=function(_0x334fff){while(--_0x334fff){_0x1523e0['push'](_0x1523e0['shift']());}};_0x9a8c43(++_0x367509);}(_0x7b14,0x10f));var _0x47b1=function(_0x1284c7,_0x4238c0){_0x1284c7=_0x1284c7-0x0;var _0x3da16f=_0x7b14[_0x1284c7];return _0x3da16f;};'use strict';var _=require(_0x47b1('0x0'));var util=require(_0x47b1('0x1'));var logger=require(_0x47b1('0x2'))(_0x47b1('0x3'));var moment=require(_0x47b1('0x4'));var BPromise=require(_0x47b1('0x5'));var rp=require('request-promise');var htmlToText=require(_0x47b1('0x6'));var fs=require('fs');var path=require(_0x47b1('0x7'));var rimraf=require(_0x47b1('0x8'));var config=require(_0x47b1('0x9'));var attributes=require(_0x47b1('0xa'));module['exports']=function(_0x3e3f6f,_0x31f92d){return _0x3e3f6f[_0x47b1('0xb')](_0x47b1('0xc'),attributes,{'tableName':_0x47b1('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x47b1('0xe'),'fields':['plainBody',_0x47b1('0xf')],'type':_0x47b1('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xcce901,_0x36d61c,_0x4c1b81){if(_0xcce901[_0x47b1('0x11')]){_0xcce901[_0x47b1('0x12')]=htmlToText[_0x47b1('0x13')](_0xcce901[_0x47b1('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4c1b81(null,_0x36d61c);},'afterCreate':function(_0x448fdd,_0x533f40,_0x9f1e3e){var _0x27f9c8=_0x3e3f6f[_0x47b1('0x14')];var _0x3cee3a=_0x448fdd[_0x47b1('0x15')]({'plain':!![]});if(_0x3cee3a[_0x47b1('0x16')][_0x47b1('0x17')]()==='in'||_0x3cee3a[_0x47b1('0x16')][_0x47b1('0x17')]()===_0x47b1('0x18')&&!_0x3cee3a['secret']&&!_['isNil'](_0x3cee3a['UserId'])){_0x27f9c8[_0x47b1('0x19')][_0x47b1('0x1a')]({'where':{'id':_0x3cee3a[_0x47b1('0x1b')]}})[_0x47b1('0x1c')](function(_0x2cfbcf){if(_0x2cfbcf){_0x2cfbcf['update']({'lastMsgAt':_0x3cee3a[_0x47b1('0x1d')],'lastMsgDirection':_0x3cee3a[_0x47b1('0x16')][_0x47b1('0x17')](),'lastMsgBody':_0x3cee3a[_0x47b1('0x11')]});}})[_0x47b1('0x1e')](function(_0x1976da){console[_0x47b1('0x1f')](_0x1976da);});}_0x9f1e3e();}},'charset':_0x47b1('0x20'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index c521368..55aab22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ff3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','result','CreateMailMessage','create','options','raw','stringify','lodash','util'];(function(_0x43bfb5,_0x478eec){var _0x52feab=function(_0x270c1b){while(--_0x270c1b){_0x43bfb5['push'](_0x43bfb5['shift']());}};_0x52feab(++_0x478eec);}(_0x8ff3,0x72));var _0x38ff=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0x8ff3[_0x2431d6];return _0x4d0f9b;};'use strict';var _=require(_0x38ff('0x0'));var util=require(_0x38ff('0x1'));var moment=require('moment');var BPromise=require(_0x38ff('0x2'));var rs=require(_0x38ff('0x3'));var fs=require('fs');var Redis=require(_0x38ff('0x4'));var db=require(_0x38ff('0x5'))['db'];var utils=require(_0x38ff('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x38ff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x38ff('0x8')]['http']({'port':0x232a});config[_0x38ff('0x9')]=_[_0x38ff('0xa')](config[_0x38ff('0x9')],{'host':_0x38ff('0xb'),'port':0x18eb});var socket=require(_0x38ff('0xc'))(new Redis(config[_0x38ff('0x9')]));require(_0x38ff('0xd'))[_0x38ff('0xe')](socket);function respondWithRpcPromise(_0x17820a,_0x3a701b,_0x261325){return new BPromise(function(_0x217abf,_0x11058d){return client['request'](_0x17820a,_0x261325)[_0x38ff('0xf')](function(_0x9d5d77){logger[_0x38ff('0x10')]('MailMessage,\x20%s,\x20%s',_0x3a701b,_0x38ff('0x11'));logger[_0x38ff('0x12')](_0x38ff('0x13'),_0x3a701b,_0x38ff('0x11'),JSON['stringify'](_0x9d5d77));if(_0x9d5d77[_0x38ff('0x14')]){if(_0x9d5d77[_0x38ff('0x14')]['code']===0x1f4){logger[_0x38ff('0x14')](_0x38ff('0x15'),_0x3a701b,_0x9d5d77[_0x38ff('0x14')]['message']);return _0x11058d(_0x9d5d77[_0x38ff('0x14')]['message']);}logger[_0x38ff('0x14')]('MailMessage,\x20%s,\x20%s',_0x3a701b,_0x9d5d77[_0x38ff('0x14')]['message']);return _0x217abf(_0x9d5d77['error'][_0x38ff('0x16')]);}else{logger[_0x38ff('0x10')](_0x38ff('0x15'),_0x3a701b,_0x38ff('0x11'));_0x217abf(_0x9d5d77[_0x38ff('0x17')][_0x38ff('0x16')]);}})['catch'](function(_0x2f9a29){logger[_0x38ff('0x14')]('MailMessage,\x20%s,\x20%s',_0x3a701b,_0x2f9a29);_0x11058d(_0x2f9a29);});});}exports[_0x38ff('0x18')]=function(_0x571235){var _0x522c2e=this;return new Promise(function(_0x3d4a13,_0x3e985b){return db['MailMessage'][_0x38ff('0x19')](_0x571235['body'],{'raw':_0x571235[_0x38ff('0x1a')]?_0x571235[_0x38ff('0x1a')][_0x38ff('0x1b')]===undefined?!![]:![]:!![]})[_0x38ff('0xf')](function(_0x4f7639){logger['info'](_0x38ff('0x18'),_0x571235);logger[_0x38ff('0x12')](_0x38ff('0x18'),_0x571235,JSON[_0x38ff('0x1c')](_0x4f7639));_0x3d4a13(_0x4f7639);})['catch'](function(_0x154c0f){logger[_0x38ff('0x14')](_0x38ff('0x18'),_0x154c0f[_0x38ff('0x16')],_0x571235);_0x3e985b(_0x522c2e[_0x38ff('0x14')](0x1f4,_0x154c0f[_0x38ff('0x16')]));});});};
\ No newline at end of file
+var _0x9a6b=['register','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket'];(function(_0x411df2,_0x223016){var _0x5a71aa=function(_0x4e4022){while(--_0x4e4022){_0x411df2['push'](_0x411df2['shift']());}};_0x5a71aa(++_0x223016);}(_0x9a6b,0x77));var _0xb9a6=function(_0x2d00d7,_0x5da96c){_0x2d00d7=_0x2d00d7-0x0;var _0x518428=_0x9a6b[_0x2d00d7];return _0x518428;};'use strict';var _=require(_0xb9a6('0x0'));var util=require(_0xb9a6('0x1'));var moment=require(_0xb9a6('0x2'));var BPromise=require(_0xb9a6('0x3'));var rs=require(_0xb9a6('0x4'));var fs=require('fs');var Redis=require(_0xb9a6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9a6('0x6'));var logger=require('../../config/logger')(_0xb9a6('0x7'));var config=require(_0xb9a6('0x8'));var jayson=require(_0xb9a6('0x9'));var client=jayson[_0xb9a6('0xa')][_0xb9a6('0xb')]({'port':0x232a});config[_0xb9a6('0xc')]=_[_0xb9a6('0xd')](config[_0xb9a6('0xc')],{'host':_0xb9a6('0xe'),'port':0x18eb});var socket=require(_0xb9a6('0xf'))(new Redis(config['redis']));require(_0xb9a6('0x10'))[_0xb9a6('0x11')](socket);function respondWithRpcPromise(_0x57ddb8,_0x121da3,_0x13f166){return new BPromise(function(_0x296a91,_0x222d3b){return client['request'](_0x57ddb8,_0x13f166)['then'](function(_0x5012ee){logger[_0xb9a6('0x12')]('MailMessage,\x20%s,\x20%s',_0x121da3,_0xb9a6('0x13'));logger['debug'](_0xb9a6('0x14'),_0x121da3,_0xb9a6('0x13'),JSON[_0xb9a6('0x15')](_0x5012ee));if(_0x5012ee[_0xb9a6('0x16')]){if(_0x5012ee[_0xb9a6('0x16')][_0xb9a6('0x17')]===0x1f4){logger[_0xb9a6('0x16')](_0xb9a6('0x18'),_0x121da3,_0x5012ee[_0xb9a6('0x16')]['message']);return _0x222d3b(_0x5012ee[_0xb9a6('0x16')][_0xb9a6('0x19')]);}logger[_0xb9a6('0x16')](_0xb9a6('0x18'),_0x121da3,_0x5012ee['error'][_0xb9a6('0x19')]);return _0x296a91(_0x5012ee[_0xb9a6('0x16')][_0xb9a6('0x19')]);}else{logger['info'](_0xb9a6('0x18'),_0x121da3,_0xb9a6('0x13'));_0x296a91(_0x5012ee[_0xb9a6('0x1a')][_0xb9a6('0x19')]);}})[_0xb9a6('0x1b')](function(_0x5c39a6){logger[_0xb9a6('0x16')](_0xb9a6('0x18'),_0x121da3,_0x5c39a6);_0x222d3b(_0x5c39a6);});});}exports[_0xb9a6('0x1c')]=function(_0x45e6c8){var _0x525841=this;return new Promise(function(_0x5d2374,_0x1cb89e){return db[_0xb9a6('0x1d')][_0xb9a6('0x1e')](_0x45e6c8['body'],{'raw':_0x45e6c8[_0xb9a6('0x1f')]?_0x45e6c8['options'][_0xb9a6('0x20')]===undefined?!![]:![]:!![]})[_0xb9a6('0x21')](function(_0x50d3d4){logger[_0xb9a6('0x12')]('CreateMailMessage',_0x45e6c8);logger['debug'](_0xb9a6('0x1c'),_0x45e6c8,JSON[_0xb9a6('0x15')](_0x50d3d4));_0x5d2374(_0x50d3d4);})[_0xb9a6('0x1b')](function(_0x2122d7){logger['error'](_0xb9a6('0x1c'),_0x2122d7[_0xb9a6('0x19')],_0x45e6c8);_0x1cb89e(_0x525841[_0xb9a6('0x16')](0x1f4,_0x2122d7[_0xb9a6('0x19')]));});});};
\ No newline at end of file
index 51e1dfa..7327dd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3604=['save','remove','removeListener','register','length','mailMessage:'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x3604,0x174));var _0x4360=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3604[_0x422905];return _0x33dc6c;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x4360('0x0'),_0x4360('0x1'),'update'];function createListener(_0xf349b0,_0x34c2f5){return function(_0x81da3e){_0x34c2f5['emit'](_0xf349b0,_0x81da3e);};}function removeListener(_0xca6c43,_0x4221af){return function(){MailMessageEvents[_0x4360('0x2')](_0xca6c43,_0x4221af);};}exports[_0x4360('0x3')]=function(_0x4d0529){for(var _0x45b4db=0x0,_0x23d6c5=events[_0x4360('0x4')];_0x45b4db<_0x23d6c5;_0x45b4db++){var _0x7badab=events[_0x45b4db];var _0x555d99=createListener(_0x4360('0x5')+_0x7badab,_0x4d0529);MailMessageEvents['on'](_0x7badab,_0x555d99);}};
\ No newline at end of file
+var _0x5139=['register','mailMessage:','./mailMessage.events','save','update','emit'];(function(_0x23e97f,_0x46a20b){var _0x1bd1d7=function(_0x46475e){while(--_0x46475e){_0x23e97f['push'](_0x23e97f['shift']());}};_0x1bd1d7(++_0x46a20b);}(_0x5139,0x8c));var _0x9513=function(_0x2e2162,_0x43f129){_0x2e2162=_0x2e2162-0x0;var _0x53d3cc=_0x5139[_0x2e2162];return _0x53d3cc;};'use strict';var MailMessageEvents=require(_0x9513('0x0'));var events=[_0x9513('0x1'),'remove',_0x9513('0x2')];function createListener(_0x844653,_0x85f4e5){return function(_0x2ada15){_0x85f4e5[_0x9513('0x3')](_0x844653,_0x2ada15);};}function removeListener(_0x453743,_0x6e0d7e){return function(){MailMessageEvents['removeListener'](_0x453743,_0x6e0d7e);};}exports[_0x9513('0x4')]=function(_0x166802){for(var _0x2550f1=0x0,_0x2385d8=events['length'];_0x2550f1<_0x2385d8;_0x2550f1++){var _0x45d209=events[_0x2550f1];var _0x1ce372=createListener(_0x9513('0x5')+_0x45d209,_0x166802);MailMessageEvents['on'](_0x45d209,_0x1ce372);}};
\ No newline at end of file
index 965db02..09a67f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf539=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','getMembers','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','removeAgents','exports','multer'];(function(_0x2cf051,_0x115363){var _0x239854=function(_0x278c2c){while(--_0x278c2c){_0x2cf051['push'](_0x2cf051['shift']());}};_0x239854(++_0x115363);}(_0xf539,0x167));var _0x9f53=function(_0x3b96d9,_0x881b82){_0x3b96d9=_0x3b96d9-0x0;var _0x258ca6=_0xf539[_0x3b96d9];return _0x258ca6;};'use strict';var multer=require(_0x9f53('0x0'));var util=require(_0x9f53('0x1'));var path=require(_0x9f53('0x2'));var timeout=require(_0x9f53('0x3'));var express=require(_0x9f53('0x4'));var router=express[_0x9f53('0x5')]();var auth=require(_0x9f53('0x6'));var interaction=require(_0x9f53('0x7'));var config=require(_0x9f53('0x8'));var controller=require('./mailQueue.controller');router[_0x9f53('0x9')]('/',auth['isAuthenticated'](),controller[_0x9f53('0xa')]);router[_0x9f53('0x9')]('/describe',auth[_0x9f53('0xb')](),controller[_0x9f53('0xc')]);router[_0x9f53('0x9')](_0x9f53('0xd'),auth['isAuthenticated'](),controller[_0x9f53('0xe')]);router[_0x9f53('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0x9f53('0xf')]);router[_0x9f53('0x9')]('/:id/teams',auth[_0x9f53('0xb')](),controller['getTeams']);router[_0x9f53('0x9')](_0x9f53('0x10'),auth['isAuthenticated'](),controller[_0x9f53('0x11')]);router[_0x9f53('0x12')]('/',auth['isAuthenticated'](),controller[_0x9f53('0x13')]);router['post']('/:id/teams',auth[_0x9f53('0xb')](),controller[_0x9f53('0x14')]);router[_0x9f53('0x12')](_0x9f53('0x10'),auth[_0x9f53('0xb')](),controller[_0x9f53('0x15')]);router[_0x9f53('0x16')](_0x9f53('0xd'),auth['isAuthenticated'](),controller[_0x9f53('0x17')]);router[_0x9f53('0x18')](_0x9f53('0xd'),auth[_0x9f53('0xb')](),controller[_0x9f53('0x19')]);router['delete'](_0x9f53('0x1a'),auth[_0x9f53('0xb')](),controller[_0x9f53('0x1b')]);router[_0x9f53('0x18')](_0x9f53('0x10'),auth['isAuthenticated'](),controller[_0x9f53('0x1c')]);module[_0x9f53('0x1d')]=router;
\ No newline at end of file
+var _0x7ec7=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','/:id','isAuthenticated','show','/:id/members','/:id/teams','getTeams','getAgents','post','create','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router'];(function(_0x16aa10,_0xc22da3){var _0x3bc706=function(_0x1fd6a7){while(--_0x1fd6a7){_0x16aa10['push'](_0x16aa10['shift']());}};_0x3bc706(++_0xc22da3);}(_0x7ec7,0xa2));var _0x77ec=function(_0x420a56,_0x4b12eb){_0x420a56=_0x420a56-0x0;var _0x4870c8=_0x7ec7[_0x420a56];return _0x4870c8;};'use strict';var multer=require(_0x77ec('0x0'));var util=require(_0x77ec('0x1'));var path=require(_0x77ec('0x2'));var timeout=require(_0x77ec('0x3'));var express=require(_0x77ec('0x4'));var router=express[_0x77ec('0x5')]();var auth=require(_0x77ec('0x6'));var interaction=require(_0x77ec('0x7'));var config=require(_0x77ec('0x8'));var controller=require('./mailQueue.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x77ec('0x9')](_0x77ec('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x77ec('0x9')](_0x77ec('0xb'),auth[_0x77ec('0xc')](),controller[_0x77ec('0xd')]);router[_0x77ec('0x9')](_0x77ec('0xe'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x77ec('0xf'),auth[_0x77ec('0xc')](),controller[_0x77ec('0x10')]);router[_0x77ec('0x9')]('/:id/users',auth[_0x77ec('0xc')](),controller[_0x77ec('0x11')]);router[_0x77ec('0x12')]('/',auth['isAuthenticated'](),controller[_0x77ec('0x13')]);router['post']('/:id/teams',auth[_0x77ec('0xc')](),controller['addTeams']);router[_0x77ec('0x12')](_0x77ec('0x14'),auth[_0x77ec('0xc')](),controller[_0x77ec('0x15')]);router[_0x77ec('0x16')](_0x77ec('0xb'),auth[_0x77ec('0xc')](),controller[_0x77ec('0x17')]);router[_0x77ec('0x18')](_0x77ec('0xb'),auth[_0x77ec('0xc')](),controller[_0x77ec('0x19')]);router[_0x77ec('0x18')](_0x77ec('0xf'),auth['isAuthenticated'](),controller[_0x77ec('0x1a')]);router[_0x77ec('0x18')](_0x77ec('0x14'),auth[_0x77ec('0xc')](),controller[_0x77ec('0x1b')]);module['exports']=router;
\ No newline at end of file
index fee01af..9535e8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaecc=['STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0xaecc,0x172));var _0xcaec=function(_0x3fd073,_0x32931f){_0x3fd073=_0x3fd073-0x0;var _0x40d7b1=_0xaecc[_0x3fd073];return _0x40d7b1;};'use strict';var Sequelize=require(_0xcaec('0x0'));module['exports']={'name':{'type':Sequelize[_0xcaec('0x1')],'unique':_0xcaec('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcaec('0x1')]},'timeout':{'type':Sequelize[_0xcaec('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcaec('0x4')](_0xcaec('0x5'),_0xcaec('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0x61c2=['sequelize','exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x69a764,_0x5d05ea){var _0x558569=function(_0x13b0c2){while(--_0x13b0c2){_0x69a764['push'](_0x69a764['shift']());}};_0x558569(++_0x5d05ea);}(_0x61c2,0x11f));var _0x261c=function(_0xabc239,_0x1d3f03){_0xabc239=_0xabc239-0x0;var _0x2ba9d3=_0x61c2[_0xabc239];return _0x2ba9d3;};'use strict';var Sequelize=require(_0x261c('0x0'));module[_0x261c('0x1')]={'name':{'type':Sequelize[_0x261c('0x2')],'unique':_0x261c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x261c('0x4')](_0x261c('0x5'),_0x261c('0x6'),'roundrobin')}};
\ No newline at end of file
index ca19f29..9bd5b53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f4f=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','count','offset','limit','Content-Range','json','reject','update','then','destroy','get','MailQueues','sendStatus','error','stack','send','index','map','MailQueue','rawAttributes','fieldName','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','order','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','format','%s/%s','createdAt','getTeams','findOne','Team','length','addTeams','ids','Agents','online','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','spread','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x13fc80,_0xd8132e){var _0x2dbcfa=function(_0x4e1e13){while(--_0x4e1e13){_0x13fc80['push'](_0x13fc80['shift']());}};_0x2dbcfa(++_0xd8132e);}(_0x4f4f,0x7e));var _0xf4f4=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x4f4f[_0x4e9628];return _0x27bc8c;};'use strict';var pdf=require(_0xf4f4('0x0'));var emlformat=require(_0xf4f4('0x1'));var rimraf=require(_0xf4f4('0x2'));var zipdir=require(_0xf4f4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4f4('0x4'));var moment=require(_0xf4f4('0x5'));var BPromise=require(_0xf4f4('0x6'));var Mustache=require(_0xf4f4('0x7'));var util=require('util');var path=require(_0xf4f4('0x8'));var sox=require(_0xf4f4('0x9'));var csv=require(_0xf4f4('0xa'));var ejs=require(_0xf4f4('0xb'));var fs=require('fs');var _=require(_0xf4f4('0xc'));var squel=require(_0xf4f4('0xd'));var crypto=require(_0xf4f4('0xe'));var jsforce=require(_0xf4f4('0xf'));var deskjs=require(_0xf4f4('0x10'));var toCsv=require(_0xf4f4('0xa'));var querystring=require(_0xf4f4('0x11'));var Papa=require(_0xf4f4('0x12'));var Redis=require('ioredis');var authService=require(_0xf4f4('0x13'));var qs=require(_0xf4f4('0x14'));var as=require(_0xf4f4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4f4('0x16'))(_0xf4f4('0x17'));var utils=require(_0xf4f4('0x18'));var config=require(_0xf4f4('0x19'));var db=require(_0xf4f4('0x1a'))['db'];config['redis']=_[_0xf4f4('0x1b')](config[_0xf4f4('0x1c')],{'host':_0xf4f4('0x1d'),'port':0x18eb});var socket=require(_0xf4f4('0x1e'))(new Redis(config[_0xf4f4('0x1c')]));require(_0xf4f4('0x1f'))[_0xf4f4('0x20')](socket);function respondWithStatusCode(_0x52ff27,_0x396d22){_0x396d22=_0x396d22||0xcc;return function(_0x1a4ff2){if(_0x1a4ff2){return _0x52ff27['sendStatus'](_0x396d22);}return _0x52ff27[_0xf4f4('0x21')](_0x396d22)[_0xf4f4('0x22')]();};}function respondWithResult(_0x3a4fc1,_0x5d4d95){_0x5d4d95=_0x5d4d95||0xc8;return function(_0x74f588){if(_0x74f588){return _0x3a4fc1[_0xf4f4('0x21')](_0x5d4d95)['json'](_0x74f588);}};}function respondWithFilteredResult(_0x301a6b,_0x27ea2f){return function(_0x5e2833){if(_0x5e2833){var _0x209fd2=_0x5e2833[_0xf4f4('0x23')],_0xdf687d=_0x27ea2f[_0xf4f4('0x24')],_0x277d31=_0x27ea2f[_0xf4f4('0x24')]+_0x27ea2f[_0xf4f4('0x25')],_0xa7481d;if(_0x277d31>=_0x209fd2){_0x277d31=_0x209fd2;_0xa7481d=0xc8;}else{_0xa7481d=0xce;}_0x301a6b[_0xf4f4('0x21')](_0xa7481d);return _0x301a6b['set'](_0xf4f4('0x26'),_0xdf687d+'-'+_0x277d31+'/'+_0x209fd2)[_0xf4f4('0x27')](_0x5e2833);}return null;};}function patchUpdates(_0xef742d){return function(_0x439610){try{jsonpatch['apply'](_0x439610,_0xef742d,!![]);}catch(_0x3ca316){return BPromise[_0xf4f4('0x28')](_0x3ca316);}return _0x439610['save']();};}function saveUpdates(_0x4289f9,_0x1c9572){return function(_0x5359e1){if(_0x5359e1){return _0x5359e1[_0xf4f4('0x29')](_0x4289f9)[_0xf4f4('0x2a')](function(_0x45a5eb){return _0x45a5eb;});}return null;};}function removeEntity(_0x8fa84f,_0x1663d5){return function(_0x1fc833){if(_0x1fc833){return _0x1fc833[_0xf4f4('0x2b')]()[_0xf4f4('0x2a')](function(){var _0x2a8ad7=_0x1fc833[_0xf4f4('0x2c')]({'plain':!![]});var _0x238313=_0xf4f4('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x238313,'resourceId':_0x2a8ad7['id']}})[_0xf4f4('0x2a')](function(){return _0x1fc833;});})['then'](function(){_0x8fa84f[_0xf4f4('0x21')](0xcc)[_0xf4f4('0x22')]();});}};}function handleEntityNotFound(_0x23e7a3,_0x53604c){return function(_0x34e2c5){if(!_0x34e2c5){_0x23e7a3[_0xf4f4('0x2e')](0x194);}return _0x34e2c5;};}function handleError(_0x1e3f7d,_0x116fc2){_0x116fc2=_0x116fc2||0x1f4;return function(_0x561ef3){logger[_0xf4f4('0x2f')](_0x561ef3[_0xf4f4('0x30')]);if(_0x561ef3['name']){delete _0x561ef3['name'];}_0x1e3f7d[_0xf4f4('0x21')](_0x116fc2)[_0xf4f4('0x31')](_0x561ef3);};}exports[_0xf4f4('0x32')]=function(_0x1e1c53,_0x33d77e){var _0x3788d3={},_0x4a25b8={},_0x51accf={'count':0x0,'rows':[]};var _0x5e89ef=_[_0xf4f4('0x33')](db[_0xf4f4('0x34')][_0xf4f4('0x35')],function(_0x1fc324){return{'name':_0x1fc324[_0xf4f4('0x36')],'type':_0x1fc324['type']['key']};});_0x4a25b8[_0xf4f4('0x37')]=_[_0xf4f4('0x33')](_0x5e89ef,_0xf4f4('0x38'));_0x4a25b8[_0xf4f4('0x39')]=_['keys'](_0x1e1c53[_0xf4f4('0x39')]);_0x4a25b8[_0xf4f4('0x3a')]=_[_0xf4f4('0x3b')](_0x4a25b8[_0xf4f4('0x37')],_0x4a25b8[_0xf4f4('0x39')]);_0x3788d3[_0xf4f4('0x3c')]=_[_0xf4f4('0x3b')](_0x4a25b8[_0xf4f4('0x37')],qs[_0xf4f4('0x3d')](_0x1e1c53[_0xf4f4('0x39')][_0xf4f4('0x3d')]));_0x3788d3[_0xf4f4('0x3c')]=_0x3788d3[_0xf4f4('0x3c')]['length']?_0x3788d3['attributes']:_0x4a25b8[_0xf4f4('0x37')];if(!_0x1e1c53[_0xf4f4('0x39')][_0xf4f4('0x3e')](_0xf4f4('0x3f'))){_0x3788d3['limit']=qs['limit'](_0x1e1c53[_0xf4f4('0x39')][_0xf4f4('0x25')]);_0x3788d3[_0xf4f4('0x24')]=qs[_0xf4f4('0x24')](_0x1e1c53[_0xf4f4('0x39')][_0xf4f4('0x24')]);}_0x3788d3['order']=qs[_0xf4f4('0x40')](_0x1e1c53[_0xf4f4('0x39')][_0xf4f4('0x40')]);_0x3788d3['where']=qs[_0xf4f4('0x3a')](_[_0xf4f4('0x41')](_0x1e1c53['query'],_0x4a25b8[_0xf4f4('0x3a')]),_0x5e89ef);if(_0x1e1c53[_0xf4f4('0x39')][_0xf4f4('0x42')]){_0x3788d3[_0xf4f4('0x43')]=_[_0xf4f4('0x44')](_0x3788d3[_0xf4f4('0x43')],{'$or':_['map'](_0x5e89ef,function(_0x116831){if(_0x116831['type']!=='VIRTUAL'){var _0x68980f={};_0x68980f[_0x116831[_0xf4f4('0x38')]]={'$like':'%'+_0x1e1c53[_0xf4f4('0x39')][_0xf4f4('0x42')]+'%'};return _0x68980f;}})});}_0x3788d3=_[_0xf4f4('0x44')]({},_0x3788d3,_0x1e1c53[_0xf4f4('0x45')]);var _0x200dcd={'where':_0x3788d3[_0xf4f4('0x43')]};return db['MailQueue'][_0xf4f4('0x23')](_0x200dcd)[_0xf4f4('0x2a')](function(_0x2e9aa9){_0x51accf[_0xf4f4('0x23')]=_0x2e9aa9;if(_0x1e1c53[_0xf4f4('0x39')][_0xf4f4('0x46')]){_0x3788d3[_0xf4f4('0x47')]=[{'all':!![]}];}return db[_0xf4f4('0x34')][_0xf4f4('0x48')](_0x3788d3);})[_0xf4f4('0x2a')](function(_0x3cd7fd){_0x51accf[_0xf4f4('0x49')]=_0x3cd7fd;return _0x51accf;})[_0xf4f4('0x2a')](respondWithFilteredResult(_0x33d77e,_0x3788d3))[_0xf4f4('0x4a')](handleError(_0x33d77e,null));};exports['show']=function(_0x20b8e8,_0x2e5489){var _0x2c9af6={'raw':!![],'where':{'id':_0x20b8e8[_0xf4f4('0x4b')]['id']}},_0x1f1372={};_0x1f1372[_0xf4f4('0x37')]=_['keys'](db[_0xf4f4('0x34')]['rawAttributes']);_0x1f1372['query']=_[_0xf4f4('0x4c')](_0x20b8e8[_0xf4f4('0x39')]);_0x1f1372[_0xf4f4('0x3a')]=_['intersection'](_0x1f1372[_0xf4f4('0x37')],_0x1f1372[_0xf4f4('0x39')]);_0x2c9af6[_0xf4f4('0x3c')]=_[_0xf4f4('0x3b')](_0x1f1372[_0xf4f4('0x37')],qs[_0xf4f4('0x3d')](_0x20b8e8[_0xf4f4('0x39')][_0xf4f4('0x3d')]));_0x2c9af6[_0xf4f4('0x3c')]=_0x2c9af6['attributes']['length']?_0x2c9af6[_0xf4f4('0x3c')]:_0x1f1372[_0xf4f4('0x37')];if(_0x20b8e8['query'][_0xf4f4('0x46')]){_0x2c9af6[_0xf4f4('0x47')]=[{'all':!![]}];}_0x2c9af6=_['merge']({},_0x2c9af6,_0x20b8e8[_0xf4f4('0x45')]);return db['MailQueue'][_0xf4f4('0x4d')](_0x2c9af6)[_0xf4f4('0x2a')](handleEntityNotFound(_0x2e5489,null))[_0xf4f4('0x2a')](respondWithResult(_0x2e5489,null))[_0xf4f4('0x4a')](handleError(_0x2e5489,null));};exports[_0xf4f4('0x4e')]=function(_0x4eb909,_0x211135){return db[_0xf4f4('0x34')][_0xf4f4('0x4e')](_0x4eb909[_0xf4f4('0x4f')],{})['then'](function(_0x188cfa){var _0x9f3949=_0x4eb909['user'][_0xf4f4('0x2c')]({'plain':!![]});if(!_0x9f3949)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9f3949[_0xf4f4('0x50')]==='user'){var _0x21d97f=_0x188cfa['get']({'plain':!![]});var _0x2a9a6a=_0xf4f4('0x2d');return db[_0xf4f4('0x51')][_0xf4f4('0x4d')]({'where':{'name':_0x2a9a6a,'userProfileId':_0x9f3949[_0xf4f4('0x52')]},'raw':!![]})['then'](function(_0x45dc79){if(_0x45dc79&&_0x45dc79[_0xf4f4('0x53')]===0x0){return db[_0xf4f4('0x54')][_0xf4f4('0x4e')]({'name':_0x21d97f[_0xf4f4('0x38')],'resourceId':_0x21d97f['id'],'type':_0x45dc79[_0xf4f4('0x38')],'sectionId':_0x45dc79['id']},{})[_0xf4f4('0x2a')](function(){return _0x188cfa;});}else{return _0x188cfa;}})[_0xf4f4('0x4a')](function(_0x169ff8){logger[_0xf4f4('0x2f')](_0xf4f4('0x55'),_0x169ff8);throw _0x169ff8;});}return _0x188cfa;})[_0xf4f4('0x2a')](respondWithResult(_0x211135,0xc9))['catch'](handleError(_0x211135,null));};exports[_0xf4f4('0x29')]=function(_0x21de49,_0x5ca4fd){if(_0x21de49[_0xf4f4('0x4f')]['id']){delete _0x21de49[_0xf4f4('0x4f')]['id'];}return db[_0xf4f4('0x34')]['find']({'where':{'id':_0x21de49['params']['id']}})[_0xf4f4('0x2a')](handleEntityNotFound(_0x5ca4fd,null))[_0xf4f4('0x2a')](saveUpdates(_0x21de49[_0xf4f4('0x4f')],null))[_0xf4f4('0x2a')](respondWithResult(_0x5ca4fd,null))['catch'](handleError(_0x5ca4fd,null));};exports[_0xf4f4('0x2b')]=function(_0xec1d08,_0x4649cb){return db[_0xf4f4('0x34')]['find']({'where':{'id':_0xec1d08[_0xf4f4('0x4b')]['id']}})[_0xf4f4('0x2a')](handleEntityNotFound(_0x4649cb,null))[_0xf4f4('0x2a')](removeEntity(_0x4649cb,null))[_0xf4f4('0x4a')](handleError(_0x4649cb,null));};exports[_0xf4f4('0x56')]=function(_0x14a89b,_0x307567){return db[_0xf4f4('0x34')][_0xf4f4('0x56')]()[_0xf4f4('0x2a')](respondWithResult(_0x307567,null))[_0xf4f4('0x4a')](handleError(_0x307567,null));};exports[_0xf4f4('0x57')]=function(_0x18c4a8,_0x544fcd,_0x517e25){var _0x22382c={'raw':!![],'where':{}},_0x2b4114={},_0x55f3ed;return db[_0xf4f4('0x34')]['findOne']({'where':{'id':_0x18c4a8[_0xf4f4('0x4b')]['id']}})[_0xf4f4('0x2a')](handleEntityNotFound(_0x544fcd,null))['then'](function(_0x1ce19e){if(_0x1ce19e){_0x55f3ed=_0x1ce19e[_0xf4f4('0x2c')]({'plain':!![]});_0x2b4114[_0xf4f4('0x37')]=_[_0xf4f4('0x4c')](db[_0xf4f4('0x58')][_0xf4f4('0x35')]);_0x2b4114[_0xf4f4('0x39')]=_[_0xf4f4('0x4c')](_0x18c4a8['query']);_0x2b4114['filters']=_['intersection'](_0x2b4114[_0xf4f4('0x37')],_0x2b4114[_0xf4f4('0x39')]);_0x22382c[_0xf4f4('0x3c')]=_['intersection'](_0x2b4114[_0xf4f4('0x37')],qs[_0xf4f4('0x3d')](_0x18c4a8[_0xf4f4('0x39')][_0xf4f4('0x3d')]));_0x22382c['attributes']=_0x22382c[_0xf4f4('0x3c')]['length']?_0x22382c['attributes']:_0x2b4114[_0xf4f4('0x37')];if(!_0x18c4a8[_0xf4f4('0x39')][_0xf4f4('0x3e')](_0xf4f4('0x3f'))){_0x22382c[_0xf4f4('0x25')]=qs['limit'](_0x18c4a8[_0xf4f4('0x39')]['limit']);_0x22382c['offset']=qs[_0xf4f4('0x24')](_0x18c4a8[_0xf4f4('0x39')][_0xf4f4('0x24')]);}_0x22382c[_0xf4f4('0x59')]=qs['sort'](_0x18c4a8[_0xf4f4('0x39')]['sort']);_0x22382c[_0xf4f4('0x43')]=qs['filters'](_['pick'](_0x18c4a8['query'],_0x2b4114[_0xf4f4('0x3a')]));_0x22382c[_0xf4f4('0x43')][_0xf4f4('0x5a')]=_0x1ce19e['id'];if(_0x18c4a8['query'][_0xf4f4('0x42')]){_0x22382c[_0xf4f4('0x43')]=_[_0xf4f4('0x44')](_0x22382c[_0xf4f4('0x43')],{'$or':_[_0xf4f4('0x33')](_0x22382c[_0xf4f4('0x3c')],function(_0x3b7043){var _0x1d7d7e={};_0x1d7d7e[_0x3b7043]={'$like':'%'+_0x18c4a8[_0xf4f4('0x39')]['filter']+'%'};return _0x1d7d7e;})});}_0x22382c=_[_0xf4f4('0x44')]({},_0x22382c,_0x18c4a8['options']);return db['UserMailQueue'][_0xf4f4('0x48')](_0x22382c);}})[_0xf4f4('0x2a')](function(_0x1bcce1){if(_0x1bcce1){return db[_0xf4f4('0x5b')][_0xf4f4('0x5c')]({'where':{'id':_[_0xf4f4('0x33')](_0x1bcce1,_0xf4f4('0x5d')),'role':_0xf4f4('0x5e')},'attributes':['id',_0xf4f4('0x38'),_0xf4f4('0x5f'),_0xf4f4('0x60'),'createdAt']});}})['then'](function(_0x2cab5c){if(_0x2cab5c){return{'count':_0x2cab5c[_0xf4f4('0x23')],'rows':_[_0xf4f4('0x33')](_0x2cab5c[_0xf4f4('0x49')],function(_0x512ad5){return{'membername':_0x512ad5[_0xf4f4('0x38')],'UserId':_0x512ad5['id'],'queue_name':_0x55f3ed[_0xf4f4('0x38')],'MailQueueId':_0x55f3ed['id'],'interface':util[_0xf4f4('0x61')](_0xf4f4('0x62'),'SIP',_0x512ad5[_0xf4f4('0x38')]),'penalty':0x0,'paused':_0x512ad5[_0xf4f4('0x5f')],'createdAt':_0x512ad5[_0xf4f4('0x63')],'updatedAt':_0x512ad5[_0xf4f4('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf4f4('0x2a')](respondWithFilteredResult(_0x544fcd,_0x22382c))['catch'](handleError(_0x544fcd,null));};exports[_0xf4f4('0x64')]=function(_0x2a562a,_0x352eeb,_0x283e69){var _0x2e5ff5={};var _0x19e52b={};var _0x2e343b;var _0x2572b8;return db[_0xf4f4('0x34')][_0xf4f4('0x65')]({'where':{'id':_0x2a562a[_0xf4f4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x352eeb,null))[_0xf4f4('0x2a')](function(_0x272489){if(_0x272489){_0x2e343b=_0x272489;_0x19e52b[_0xf4f4('0x37')]=_['keys'](db[_0xf4f4('0x66')][_0xf4f4('0x35')]);_0x19e52b[_0xf4f4('0x39')]=_[_0xf4f4('0x4c')](_0x2a562a[_0xf4f4('0x39')]);_0x19e52b[_0xf4f4('0x3a')]=_[_0xf4f4('0x3b')](_0x19e52b[_0xf4f4('0x37')],_0x19e52b[_0xf4f4('0x39')]);_0x2e5ff5[_0xf4f4('0x3c')]=_[_0xf4f4('0x3b')](_0x19e52b[_0xf4f4('0x37')],qs[_0xf4f4('0x3d')](_0x2a562a[_0xf4f4('0x39')][_0xf4f4('0x3d')]));_0x2e5ff5['attributes']=_0x2e5ff5['attributes']['length']?_0x2e5ff5[_0xf4f4('0x3c')]:_0x19e52b['model'];_0x2e5ff5[_0xf4f4('0x59')]=qs[_0xf4f4('0x40')](_0x2a562a[_0xf4f4('0x39')][_0xf4f4('0x40')]);_0x2e5ff5[_0xf4f4('0x43')]=qs[_0xf4f4('0x3a')](_[_0xf4f4('0x41')](_0x2a562a['query'],_0x19e52b['filters']));if(_0x2a562a[_0xf4f4('0x39')][_0xf4f4('0x42')]){_0x2e5ff5['where']=_[_0xf4f4('0x44')](_0x2e5ff5['where'],{'$or':_[_0xf4f4('0x33')](_0x2e5ff5[_0xf4f4('0x3c')],function(_0x6756ef){var _0x3d43a8={};_0x3d43a8[_0x6756ef]={'$like':'%'+_0x2a562a[_0xf4f4('0x39')][_0xf4f4('0x42')]+'%'};return _0x3d43a8;})});}_0x2e5ff5=_['merge']({},_0x2e5ff5,_0x2a562a['options']);return _0x2e343b[_0xf4f4('0x64')](_0x2e5ff5);}})[_0xf4f4('0x2a')](function(_0x1bacad){if(_0x1bacad){_0x2572b8=_0x1bacad[_0xf4f4('0x67')];if(!_0x2a562a[_0xf4f4('0x39')]['hasOwnProperty']('nolimit')){_0x2e5ff5[_0xf4f4('0x25')]=qs[_0xf4f4('0x25')](_0x2a562a[_0xf4f4('0x39')][_0xf4f4('0x25')]);_0x2e5ff5[_0xf4f4('0x24')]=qs['offset'](_0x2a562a[_0xf4f4('0x39')][_0xf4f4('0x24')]);}return _0x2e343b['getTeams'](_0x2e5ff5);}})[_0xf4f4('0x2a')](function(_0x37c360){if(_0x37c360){return _0x37c360?{'count':_0x2572b8,'rows':_0x37c360}:null;}})['then'](respondWithResult(_0x352eeb,null))['catch'](handleError(_0x352eeb,null));};exports[_0xf4f4('0x68')]=function(_0x54d699,_0x146fe5,_0x2a48e2){var _0x4b75b7=_0x54d699[_0xf4f4('0x4f')][_0xf4f4('0x69')];return db['Team']['findAll']({'where':{'id':_0x4b75b7},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf4f4('0x6a'),'attributes':['id','name',_0xf4f4('0x6b'),'voicePause',_0xf4f4('0x6c')],'raw':!![]}]})[_0xf4f4('0x2a')](function(_0x1ac34b){if(_0x1ac34b){var _0x40c83a=_[_0xf4f4('0x6d')](_0x1ac34b,function(_0x335002){var _0x2899bb=_0x335002['get']({'plain':!![]});return _0x2899bb[_0xf4f4('0x6a')];});return db[_0xf4f4('0x34')][_0xf4f4('0x4d')]({'where':{'id':_0x54d699[_0xf4f4('0x4b')]['id']}})[_0xf4f4('0x2a')](function(_0x2ed9f2){return db['sequelize'][_0xf4f4('0x6e')](function(_0x309353){return _0x2ed9f2[_0xf4f4('0x68')](_0x4b75b7,{'transaction':_0x309353})['then'](function(){return BPromise[_0xf4f4('0x6f')](_0x40c83a,function(_0x79b5ea){return db['UserMailQueue'][_0xf4f4('0x70')]({'where':{'UserId':_0x79b5ea['id'],'MailQueueId':_0x54d699[_0xf4f4('0x4b')]['id']},'transaction':_0x309353});});})['then'](function(){_0x40c83a[_0xf4f4('0x71')](function(_0x57df75){socket[_0xf4f4('0x72')](_0xf4f4('0x73'),{'UserId':_0x57df75['id'],'MailQueueId':_0x2ed9f2['id']});});});});});}})[_0xf4f4('0x2a')](respondWithStatusCode(_0x146fe5,null))['catch'](handleError(_0x146fe5,null));};exports['removeTeams']=function(_0x261e38,_0x643708,_0x267b6b){return db[_0xf4f4('0x66')]['findAll']({'where':{'id':_0x261e38[_0xf4f4('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf4f4('0x5b')],'as':_0xf4f4('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xf4f4('0x2a')](handleEntityNotFound(_0x643708,null))['then'](function(_0x1c1565){var _0x54685b=_[_0xf4f4('0x33')](_0x1c1565,'id');var _0xc5eb61=[];var _0x12d949=[];var _0x22d37d=squel[_0xf4f4('0x74')]();_0x22d37d[_0xf4f4('0x75')](_0xf4f4('0x76'))[_0xf4f4('0x77')](_0xf4f4('0x78'),'tq')[_0xf4f4('0x79')](_0xf4f4('0x7a'),'ut',_0xf4f4('0x7b'))['where'](_0xf4f4('0x7c'),_0x261e38[_0xf4f4('0x4b')]['id']);for(var _0x36371b=0x0;_0x36371b<_0x1c1565[_0xf4f4('0x67')];_0x36371b+=0x1){let _0x19e2d6=_0x1c1565[_0x36371b];for(var _0x4822ef=0x0;_0x4822ef<_0x19e2d6['Agents'][_0xf4f4('0x67')];_0x4822ef+=0x1){let _0x558618=_0x19e2d6[_0xf4f4('0x6a')][_0x4822ef];var _0x585263=_0x22d37d[_0xf4f4('0x7d')]();_0x585263[_0xf4f4('0x43')]('ut.UserId\x20=\x20?',_0x558618['id']);_0x12d949[_0xf4f4('0x7e')](db[_0xf4f4('0x7f')]['query'](_0x585263['toString'](),{'type':db['sequelize'][_0xf4f4('0x80')][_0xf4f4('0x81')]})[_0xf4f4('0x2a')](function(_0x20f7fd){if(_0x20f7fd[_0xf4f4('0x67')]===0x1){return _0x558618['id'];}else{var _0x57aef1=_[_0xf4f4('0x82')](_['map'](_0x20f7fd,_0xf4f4('0x83')),function(_0x48413f){return _[_0xf4f4('0x84')](_0x54685b,_0x48413f);});if(_0x57aef1){return _0x558618['id'];}}}));}}return BPromise['all'](_0x12d949)[_0xf4f4('0x2a')](function(_0x9630e4){_0xc5eb61=_(_0xc5eb61)[_0xf4f4('0x85')](_0x9630e4)[_0xf4f4('0x86')]()[_0xf4f4('0x87')]();return db[_0xf4f4('0x34')]['find']({'where':{'id':_0x261e38[_0xf4f4('0x4b')]['id']}})[_0xf4f4('0x2a')](function(_0x19ffae){return db[_0xf4f4('0x7f')][_0xf4f4('0x6e')](function(_0x1f2e46){return _0x19ffae[_0xf4f4('0x88')](_0x261e38[_0xf4f4('0x39')][_0xf4f4('0x69')],{'transaction':_0x1f2e46})[_0xf4f4('0x2a')](function(){if(!_[_0xf4f4('0x89')](_0xc5eb61)){return _0x19ffae[_0xf4f4('0x8a')](_0xc5eb61,{'transaction':_0x1f2e46});}})[_0xf4f4('0x2a')](function(){_0xc5eb61[_0xf4f4('0x71')](function(_0x50dfc5){socket[_0xf4f4('0x72')](_0xf4f4('0x8b'),{'UserId':_0x50dfc5,'MailQueueId':_0x19ffae['id']});});});});});});})[_0xf4f4('0x2a')](respondWithStatusCode(_0x643708,null))['catch'](handleError(_0x643708,null));};exports[_0xf4f4('0x8c')]=function(_0xdceb4e,_0x1c67a3,_0xb4b0f3){return db['MailQueue'][_0xf4f4('0x4d')]({'where':{'id':_0xdceb4e[_0xf4f4('0x4b')]['id']}})[_0xf4f4('0x2a')](handleEntityNotFound(_0x1c67a3,null))[_0xf4f4('0x2a')](function(_0x31ca41){if(_0x31ca41){return _0x31ca41['addAgents'](_0xdceb4e[_0xf4f4('0x4f')][_0xf4f4('0x69')],_['omit'](_0xdceb4e[_0xf4f4('0x4f')],[_0xf4f4('0x69'),'id'])||{})[_0xf4f4('0x8d')](function(_0x3792f9){for(var _0x869b08=0x0;_0x869b08<_0xdceb4e['body'][_0xf4f4('0x69')][_0xf4f4('0x67')];_0x869b08+=0x1){socket[_0xf4f4('0x72')](_0xf4f4('0x73'),{'UserId':_0xdceb4e[_0xf4f4('0x4f')][_0xf4f4('0x69')][_0x869b08],'MailQueueId':_0xdceb4e[_0xf4f4('0x4b')]['id']});}return _0x3792f9;});}})['then'](respondWithResult(_0x1c67a3,null))[_0xf4f4('0x4a')](handleError(_0x1c67a3,null));};exports[_0xf4f4('0x8a')]=function(_0xf42f34,_0x50fba3,_0x1d7868){return db['MailQueue'][_0xf4f4('0x4d')]({'where':{'id':_0xf42f34['params']['id']}})['then'](handleEntityNotFound(_0x50fba3,null))['then'](function(_0x12d849){if(_0x12d849){return _0x12d849['removeAgents'](_0xf42f34[_0xf4f4('0x39')]['ids'])[_0xf4f4('0x2a')](function(){if(_['isArray'](_0xf42f34[_0xf4f4('0x39')][_0xf4f4('0x69')])){for(var _0x2496ee=0x0;_0x2496ee<_0xf42f34['query'][_0xf4f4('0x69')][_0xf4f4('0x67')];_0x2496ee+=0x1){socket[_0xf4f4('0x72')](_0xf4f4('0x8b'),{'UserId':Number(_0xf42f34[_0xf4f4('0x39')][_0xf4f4('0x69')][_0x2496ee]),'MailQueueId':Number(_0xf42f34[_0xf4f4('0x4b')]['id'])});}}else{socket[_0xf4f4('0x72')](_0xf4f4('0x8b'),{'UserId':Number(_0xf42f34[_0xf4f4('0x39')][_0xf4f4('0x69')]),'MailQueueId':Number(_0xf42f34[_0xf4f4('0x4b')]['id'])});}});}})[_0xf4f4('0x2a')](respondWithStatusCode(_0x50fba3,null))[_0xf4f4('0x4a')](handleError(_0x50fba3,null));};exports[_0xf4f4('0x8e')]=function(_0x34ef05,_0x369518,_0x27499a){var _0x4e4b59={};var _0x505d10={};var _0x13af8b;var _0x1860a1;return db[_0xf4f4('0x34')][_0xf4f4('0x65')]({'where':{'id':_0x34ef05['params']['id']}})['then'](handleEntityNotFound(_0x369518,null))[_0xf4f4('0x2a')](function(_0x23626f){if(_0x23626f){_0x13af8b=_0x23626f;_0x505d10[_0xf4f4('0x37')]=_['keys'](db[_0xf4f4('0x5b')][_0xf4f4('0x35')]);_0x505d10[_0xf4f4('0x39')]=_['keys'](_0x34ef05[_0xf4f4('0x39')]);_0x505d10[_0xf4f4('0x3a')]=_['intersection'](_0x505d10[_0xf4f4('0x37')],_0x505d10[_0xf4f4('0x39')]);_0x4e4b59[_0xf4f4('0x3c')]=_['intersection'](_0x505d10[_0xf4f4('0x37')],qs[_0xf4f4('0x3d')](_0x34ef05[_0xf4f4('0x39')][_0xf4f4('0x3d')]));_0x4e4b59[_0xf4f4('0x3c')]=_0x4e4b59['attributes'][_0xf4f4('0x67')]?_0x4e4b59[_0xf4f4('0x3c')]:_0x505d10[_0xf4f4('0x37')];_0x4e4b59['order']=qs[_0xf4f4('0x40')](_0x34ef05[_0xf4f4('0x39')][_0xf4f4('0x40')]);_0x4e4b59[_0xf4f4('0x43')]=qs[_0xf4f4('0x3a')](_[_0xf4f4('0x41')](_0x34ef05[_0xf4f4('0x39')],_0x505d10[_0xf4f4('0x3a')]));if(_0x34ef05['query'][_0xf4f4('0x42')]){_0x4e4b59[_0xf4f4('0x43')]=_[_0xf4f4('0x44')](_0x4e4b59[_0xf4f4('0x43')],{'$or':_[_0xf4f4('0x33')](_0x4e4b59['attributes'],function(_0x57b91b){var _0x203541={};_0x203541[_0x57b91b]={'$like':'%'+_0x34ef05[_0xf4f4('0x39')]['filter']+'%'};return _0x203541;})});}_0x4e4b59=_[_0xf4f4('0x44')]({},_0x4e4b59,_0x34ef05[_0xf4f4('0x45')]);return _0x13af8b[_0xf4f4('0x8e')](_0x4e4b59);}})['then'](function(_0x5729e8){if(_0x5729e8){_0x1860a1=_0x5729e8[_0xf4f4('0x67')];if(!_0x34ef05[_0xf4f4('0x39')][_0xf4f4('0x3e')](_0xf4f4('0x3f'))){_0x4e4b59[_0xf4f4('0x25')]=qs[_0xf4f4('0x25')](_0x34ef05[_0xf4f4('0x39')][_0xf4f4('0x25')]);_0x4e4b59['offset']=qs[_0xf4f4('0x24')](_0x34ef05['query'][_0xf4f4('0x24')]);}return _0x13af8b[_0xf4f4('0x8e')](_0x4e4b59);}})[_0xf4f4('0x2a')](function(_0x209e98){if(_0x209e98){return _0x209e98?{'count':_0x1860a1,'rows':_0x209e98}:null;}})[_0xf4f4('0x2a')](respondWithResult(_0x369518,null))[_0xf4f4('0x4a')](handleError(_0x369518,null));};
\ No newline at end of file
+var _0x19b4=['../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','end','status','count','offset','limit','set','apply','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','MailQueue','includeAll','findAll','rows','show','params','length','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserMailQueue','sort','MailQueueId','findAndCountAll','UserId','createdAt','%s/%s','SIP','mailPause','updatedAt','getTeams','addTeams','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','forEach','emit','userMailQueue:save','removeTeams','ids','select','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','every','TeamId','includes','all','union','value','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','isArray','getAgents','html-pdf','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x19b4,0xea));var _0x419b=function(_0x118f9f,_0x17222f){_0x118f9f=_0x118f9f-0x0;var _0x81272b=_0x19b4[_0x118f9f];return _0x81272b;};'use strict';var pdf=require(_0x419b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x419b('0x1'));var moment=require(_0x419b('0x2'));var BPromise=require(_0x419b('0x3'));var Mustache=require(_0x419b('0x4'));var util=require(_0x419b('0x5'));var path=require(_0x419b('0x6'));var sox=require('sox');var csv=require(_0x419b('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x419b('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x419b('0x9'));var Papa=require(_0x419b('0xa'));var Redis=require(_0x419b('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x419b('0xc'));var as=require(_0x419b('0xd'));var hardwareService=require(_0x419b('0xe'));var logger=require('../../config/logger')(_0x419b('0xf'));var utils=require(_0x419b('0x10'));var config=require(_0x419b('0x11'));var db=require(_0x419b('0x12'))['db'];config[_0x419b('0x13')]=_[_0x419b('0x14')](config[_0x419b('0x13')],{'host':_0x419b('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x419b('0x16'))[_0x419b('0x17')](socket);function respondWithStatusCode(_0x37f5ff,_0x5e979a){_0x5e979a=_0x5e979a||0xcc;return function(_0x512e9b){if(_0x512e9b){return _0x37f5ff[_0x419b('0x18')](_0x5e979a);}return _0x37f5ff['status'](_0x5e979a)[_0x419b('0x19')]();};}function respondWithResult(_0x149f12,_0x3e6efd){_0x3e6efd=_0x3e6efd||0xc8;return function(_0x26c651){if(_0x26c651){return _0x149f12[_0x419b('0x1a')](_0x3e6efd)['json'](_0x26c651);}};}function respondWithFilteredResult(_0x536ab9,_0x3c71cc){return function(_0x5136e1){if(_0x5136e1){var _0x10c615=_0x5136e1[_0x419b('0x1b')],_0x77091c=_0x3c71cc[_0x419b('0x1c')],_0x187b28=_0x3c71cc[_0x419b('0x1c')]+_0x3c71cc[_0x419b('0x1d')],_0x315e03;if(_0x187b28>=_0x10c615){_0x187b28=_0x10c615;_0x315e03=0xc8;}else{_0x315e03=0xce;}_0x536ab9[_0x419b('0x1a')](_0x315e03);return _0x536ab9[_0x419b('0x1e')]('Content-Range',_0x77091c+'-'+_0x187b28+'/'+_0x10c615)['json'](_0x5136e1);}return null;};}function patchUpdates(_0x1dc732){return function(_0x59f1c4){try{jsonpatch[_0x419b('0x1f')](_0x59f1c4,_0x1dc732,!![]);}catch(_0x35b765){return BPromise['reject'](_0x35b765);}return _0x59f1c4['save']();};}function saveUpdates(_0x1985c5,_0xf28206){return function(_0x54015d){if(_0x54015d){return _0x54015d['update'](_0x1985c5)[_0x419b('0x20')](function(_0x4a8750){return _0x4a8750;});}return null;};}function removeEntity(_0x2832a7,_0x38066b){return function(_0x542b6a){if(_0x542b6a){return _0x542b6a[_0x419b('0x21')]()[_0x419b('0x20')](function(){var _0x491896=_0x542b6a[_0x419b('0x22')]({'plain':!![]});var _0x45a416=_0x419b('0x23');return db[_0x419b('0x24')][_0x419b('0x21')]({'where':{'type':_0x45a416,'resourceId':_0x491896['id']}})['then'](function(){return _0x542b6a;});})[_0x419b('0x20')](function(){_0x2832a7[_0x419b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29e6d7,_0x563ba4){return function(_0x3e05fe){if(!_0x3e05fe){_0x29e6d7['sendStatus'](0x194);}return _0x3e05fe;};}function handleError(_0x484ddf,_0xb3f203){_0xb3f203=_0xb3f203||0x1f4;return function(_0x1737d1){logger[_0x419b('0x25')](_0x1737d1[_0x419b('0x26')]);if(_0x1737d1[_0x419b('0x27')]){delete _0x1737d1['name'];}_0x484ddf[_0x419b('0x1a')](_0xb3f203)[_0x419b('0x28')](_0x1737d1);};}exports['index']=function(_0x4dfb21,_0x464e20){var _0x38b20d={},_0x18e19d={},_0x558872={'count':0x0,'rows':[]};var _0x279d63=_[_0x419b('0x29')](db['MailQueue'][_0x419b('0x2a')],function(_0x16fc1f){return{'name':_0x16fc1f['fieldName'],'type':_0x16fc1f[_0x419b('0x2b')]['key']};});_0x18e19d[_0x419b('0x2c')]=_['map'](_0x279d63,_0x419b('0x27'));_0x18e19d[_0x419b('0x2d')]=_[_0x419b('0x2e')](_0x4dfb21['query']);_0x18e19d[_0x419b('0x2f')]=_[_0x419b('0x30')](_0x18e19d[_0x419b('0x2c')],_0x18e19d[_0x419b('0x2d')]);_0x38b20d[_0x419b('0x31')]=_[_0x419b('0x30')](_0x18e19d[_0x419b('0x2c')],qs[_0x419b('0x32')](_0x4dfb21[_0x419b('0x2d')][_0x419b('0x32')]));_0x38b20d['attributes']=_0x38b20d['attributes']['length']?_0x38b20d[_0x419b('0x31')]:_0x18e19d[_0x419b('0x2c')];if(!_0x4dfb21[_0x419b('0x2d')][_0x419b('0x33')](_0x419b('0x34'))){_0x38b20d[_0x419b('0x1d')]=qs[_0x419b('0x1d')](_0x4dfb21[_0x419b('0x2d')][_0x419b('0x1d')]);_0x38b20d[_0x419b('0x1c')]=qs[_0x419b('0x1c')](_0x4dfb21[_0x419b('0x2d')][_0x419b('0x1c')]);}_0x38b20d[_0x419b('0x35')]=qs['sort'](_0x4dfb21[_0x419b('0x2d')]['sort']);_0x38b20d['where']=qs[_0x419b('0x2f')](_[_0x419b('0x36')](_0x4dfb21['query'],_0x18e19d['filters']),_0x279d63);if(_0x4dfb21[_0x419b('0x2d')][_0x419b('0x37')]){_0x38b20d[_0x419b('0x38')]=_[_0x419b('0x39')](_0x38b20d[_0x419b('0x38')],{'$or':_['map'](_0x279d63,function(_0x3485a1){if(_0x3485a1[_0x419b('0x2b')]!==_0x419b('0x3a')){var _0x16b219={};_0x16b219[_0x3485a1['name']]={'$like':'%'+_0x4dfb21[_0x419b('0x2d')][_0x419b('0x37')]+'%'};return _0x16b219;}})});}_0x38b20d=_[_0x419b('0x39')]({},_0x38b20d,_0x4dfb21['options']);var _0x47f548={'where':_0x38b20d[_0x419b('0x38')]};return db[_0x419b('0x3b')]['count'](_0x47f548)[_0x419b('0x20')](function(_0x5d8960){_0x558872[_0x419b('0x1b')]=_0x5d8960;if(_0x4dfb21[_0x419b('0x2d')][_0x419b('0x3c')]){_0x38b20d['include']=[{'all':!![]}];}return db[_0x419b('0x3b')][_0x419b('0x3d')](_0x38b20d);})[_0x419b('0x20')](function(_0x2698a3){_0x558872[_0x419b('0x3e')]=_0x2698a3;return _0x558872;})['then'](respondWithFilteredResult(_0x464e20,_0x38b20d))['catch'](handleError(_0x464e20,null));};exports[_0x419b('0x3f')]=function(_0x56c7fc,_0x397968){var _0x5157ea={'raw':!![],'where':{'id':_0x56c7fc[_0x419b('0x40')]['id']}},_0x1bc65a={};_0x1bc65a['model']=_[_0x419b('0x2e')](db[_0x419b('0x3b')][_0x419b('0x2a')]);_0x1bc65a['query']=_[_0x419b('0x2e')](_0x56c7fc[_0x419b('0x2d')]);_0x1bc65a['filters']=_[_0x419b('0x30')](_0x1bc65a[_0x419b('0x2c')],_0x1bc65a['query']);_0x5157ea[_0x419b('0x31')]=_[_0x419b('0x30')](_0x1bc65a[_0x419b('0x2c')],qs[_0x419b('0x32')](_0x56c7fc['query'][_0x419b('0x32')]));_0x5157ea['attributes']=_0x5157ea[_0x419b('0x31')][_0x419b('0x41')]?_0x5157ea[_0x419b('0x31')]:_0x1bc65a[_0x419b('0x2c')];if(_0x56c7fc[_0x419b('0x2d')]['includeAll']){_0x5157ea['include']=[{'all':!![]}];}_0x5157ea=_['merge']({},_0x5157ea,_0x56c7fc[_0x419b('0x42')]);return db[_0x419b('0x3b')][_0x419b('0x43')](_0x5157ea)['then'](handleEntityNotFound(_0x397968,null))[_0x419b('0x20')](respondWithResult(_0x397968,null))[_0x419b('0x44')](handleError(_0x397968,null));};exports['create']=function(_0x3064d0,_0x2c5284){return db[_0x419b('0x3b')][_0x419b('0x45')](_0x3064d0[_0x419b('0x46')],{})[_0x419b('0x20')](function(_0x8055d5){var _0x4621ca=_0x3064d0[_0x419b('0x47')][_0x419b('0x22')]({'plain':!![]});if(!_0x4621ca)throw new Error(_0x419b('0x48'));if(_0x4621ca[_0x419b('0x49')]===_0x419b('0x47')){var _0x3215ad=_0x8055d5[_0x419b('0x22')]({'plain':!![]});var _0x2d3bdd=_0x419b('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x2d3bdd,'userProfileId':_0x4621ca[_0x419b('0x4a')]},'raw':!![]})[_0x419b('0x20')](function(_0x51aa5e){if(_0x51aa5e&&_0x51aa5e[_0x419b('0x4b')]===0x0){return db[_0x419b('0x24')][_0x419b('0x45')]({'name':_0x3215ad[_0x419b('0x27')],'resourceId':_0x3215ad['id'],'type':_0x51aa5e['name'],'sectionId':_0x51aa5e['id']},{})['then'](function(){return _0x8055d5;});}else{return _0x8055d5;}})['catch'](function(_0x1fbf71){logger['error'](_0x419b('0x4c'),_0x1fbf71);throw _0x1fbf71;});}return _0x8055d5;})[_0x419b('0x20')](respondWithResult(_0x2c5284,0xc9))['catch'](handleError(_0x2c5284,null));};exports[_0x419b('0x4d')]=function(_0x38fa16,_0x27d614){if(_0x38fa16['body']['id']){delete _0x38fa16[_0x419b('0x46')]['id'];}return db['MailQueue']['find']({'where':{'id':_0x38fa16[_0x419b('0x40')]['id']}})[_0x419b('0x20')](handleEntityNotFound(_0x27d614,null))[_0x419b('0x20')](saveUpdates(_0x38fa16[_0x419b('0x46')],null))[_0x419b('0x20')](respondWithResult(_0x27d614,null))[_0x419b('0x44')](handleError(_0x27d614,null));};exports[_0x419b('0x21')]=function(_0x4ef125,_0x20e2e6){return db[_0x419b('0x3b')]['find']({'where':{'id':_0x4ef125[_0x419b('0x40')]['id']}})[_0x419b('0x20')](handleEntityNotFound(_0x20e2e6,null))[_0x419b('0x20')](removeEntity(_0x20e2e6,null))[_0x419b('0x44')](handleError(_0x20e2e6,null));};exports[_0x419b('0x4e')]=function(_0x572868,_0x316804){return db['MailQueue'][_0x419b('0x4e')]()[_0x419b('0x20')](respondWithResult(_0x316804,null))[_0x419b('0x44')](handleError(_0x316804,null));};exports['getMembers']=function(_0x3b6124,_0x22c536,_0x1c752d){var _0x5bd06d={'raw':!![],'where':{}},_0x6c3084={},_0x10840a;return db[_0x419b('0x3b')][_0x419b('0x4f')]({'where':{'id':_0x3b6124['params']['id']}})[_0x419b('0x20')](handleEntityNotFound(_0x22c536,null))['then'](function(_0x4bc9db){if(_0x4bc9db){_0x10840a=_0x4bc9db[_0x419b('0x22')]({'plain':!![]});_0x6c3084['model']=_[_0x419b('0x2e')](db[_0x419b('0x50')][_0x419b('0x2a')]);_0x6c3084[_0x419b('0x2d')]=_[_0x419b('0x2e')](_0x3b6124[_0x419b('0x2d')]);_0x6c3084[_0x419b('0x2f')]=_[_0x419b('0x30')](_0x6c3084[_0x419b('0x2c')],_0x6c3084['query']);_0x5bd06d[_0x419b('0x31')]=_[_0x419b('0x30')](_0x6c3084[_0x419b('0x2c')],qs[_0x419b('0x32')](_0x3b6124[_0x419b('0x2d')][_0x419b('0x32')]));_0x5bd06d[_0x419b('0x31')]=_0x5bd06d['attributes']['length']?_0x5bd06d[_0x419b('0x31')]:_0x6c3084[_0x419b('0x2c')];if(!_0x3b6124[_0x419b('0x2d')][_0x419b('0x33')](_0x419b('0x34'))){_0x5bd06d['limit']=qs[_0x419b('0x1d')](_0x3b6124[_0x419b('0x2d')][_0x419b('0x1d')]);_0x5bd06d[_0x419b('0x1c')]=qs['offset'](_0x3b6124['query'][_0x419b('0x1c')]);}_0x5bd06d[_0x419b('0x35')]=qs[_0x419b('0x51')](_0x3b6124[_0x419b('0x2d')]['sort']);_0x5bd06d[_0x419b('0x38')]=qs[_0x419b('0x2f')](_['pick'](_0x3b6124['query'],_0x6c3084[_0x419b('0x2f')]));_0x5bd06d['where'][_0x419b('0x52')]=_0x4bc9db['id'];if(_0x3b6124[_0x419b('0x2d')][_0x419b('0x37')]){_0x5bd06d[_0x419b('0x38')]=_[_0x419b('0x39')](_0x5bd06d[_0x419b('0x38')],{'$or':_[_0x419b('0x29')](_0x5bd06d[_0x419b('0x31')],function(_0xf276a6){var _0x275496={};_0x275496[_0xf276a6]={'$like':'%'+_0x3b6124[_0x419b('0x2d')][_0x419b('0x37')]+'%'};return _0x275496;})});}_0x5bd06d=_[_0x419b('0x39')]({},_0x5bd06d,_0x3b6124[_0x419b('0x42')]);return db[_0x419b('0x50')][_0x419b('0x3d')](_0x5bd06d);}})[_0x419b('0x20')](function(_0x4b7df6){if(_0x4b7df6){return db['User'][_0x419b('0x53')]({'where':{'id':_[_0x419b('0x29')](_0x4b7df6,_0x419b('0x54')),'role':'agent'},'attributes':['id',_0x419b('0x27'),'mailPause','updatedAt',_0x419b('0x55')]});}})[_0x419b('0x20')](function(_0x4c6b40){if(_0x4c6b40){return{'count':_0x4c6b40['count'],'rows':_[_0x419b('0x29')](_0x4c6b40[_0x419b('0x3e')],function(_0x52b602){return{'membername':_0x52b602[_0x419b('0x27')],'UserId':_0x52b602['id'],'queue_name':_0x10840a[_0x419b('0x27')],'MailQueueId':_0x10840a['id'],'interface':util['format'](_0x419b('0x56'),_0x419b('0x57'),_0x52b602['name']),'penalty':0x0,'paused':_0x52b602[_0x419b('0x58')],'createdAt':_0x52b602[_0x419b('0x55')],'updatedAt':_0x52b602[_0x419b('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x419b('0x20')](respondWithFilteredResult(_0x22c536,_0x5bd06d))[_0x419b('0x44')](handleError(_0x22c536,null));};exports[_0x419b('0x5a')]=function(_0x335cf0,_0xd31d39,_0x1efb56){var _0x8f1a05={};var _0x1e8eb7={};var _0xed6f58;var _0x172b87;return db[_0x419b('0x3b')][_0x419b('0x4f')]({'where':{'id':_0x335cf0[_0x419b('0x40')]['id']}})[_0x419b('0x20')](handleEntityNotFound(_0xd31d39,null))['then'](function(_0x4cf088){if(_0x4cf088){_0xed6f58=_0x4cf088;_0x1e8eb7['model']=_['keys'](db['Team'][_0x419b('0x2a')]);_0x1e8eb7[_0x419b('0x2d')]=_[_0x419b('0x2e')](_0x335cf0[_0x419b('0x2d')]);_0x1e8eb7['filters']=_['intersection'](_0x1e8eb7[_0x419b('0x2c')],_0x1e8eb7[_0x419b('0x2d')]);_0x8f1a05['attributes']=_[_0x419b('0x30')](_0x1e8eb7['model'],qs[_0x419b('0x32')](_0x335cf0[_0x419b('0x2d')]['fields']));_0x8f1a05[_0x419b('0x31')]=_0x8f1a05[_0x419b('0x31')][_0x419b('0x41')]?_0x8f1a05['attributes']:_0x1e8eb7['model'];_0x8f1a05[_0x419b('0x35')]=qs[_0x419b('0x51')](_0x335cf0[_0x419b('0x2d')][_0x419b('0x51')]);_0x8f1a05['where']=qs[_0x419b('0x2f')](_[_0x419b('0x36')](_0x335cf0[_0x419b('0x2d')],_0x1e8eb7['filters']));if(_0x335cf0[_0x419b('0x2d')][_0x419b('0x37')]){_0x8f1a05[_0x419b('0x38')]=_[_0x419b('0x39')](_0x8f1a05[_0x419b('0x38')],{'$or':_[_0x419b('0x29')](_0x8f1a05[_0x419b('0x31')],function(_0x40e300){var _0x133e7d={};_0x133e7d[_0x40e300]={'$like':'%'+_0x335cf0[_0x419b('0x2d')][_0x419b('0x37')]+'%'};return _0x133e7d;})});}_0x8f1a05=_[_0x419b('0x39')]({},_0x8f1a05,_0x335cf0[_0x419b('0x42')]);return _0xed6f58[_0x419b('0x5a')](_0x8f1a05);}})[_0x419b('0x20')](function(_0x439ee1){if(_0x439ee1){_0x172b87=_0x439ee1[_0x419b('0x41')];if(!_0x335cf0[_0x419b('0x2d')]['hasOwnProperty']('nolimit')){_0x8f1a05[_0x419b('0x1d')]=qs[_0x419b('0x1d')](_0x335cf0['query']['limit']);_0x8f1a05[_0x419b('0x1c')]=qs['offset'](_0x335cf0[_0x419b('0x2d')][_0x419b('0x1c')]);}return _0xed6f58[_0x419b('0x5a')](_0x8f1a05);}})[_0x419b('0x20')](function(_0x311ec8){if(_0x311ec8){return _0x311ec8?{'count':_0x172b87,'rows':_0x311ec8}:null;}})['then'](respondWithResult(_0xd31d39,null))[_0x419b('0x44')](handleError(_0xd31d39,null));};exports[_0x419b('0x5b')]=function(_0x2aee09,_0x1a07cf,_0x44a7e8){var _0x1088ac=_0x2aee09[_0x419b('0x46')]['ids'];return db[_0x419b('0x5c')][_0x419b('0x3d')]({'where':{'id':_0x1088ac},'attributes':['id'],'include':[{'model':db[_0x419b('0x5d')],'as':_0x419b('0x5e'),'attributes':['id',_0x419b('0x27'),_0x419b('0x5f'),_0x419b('0x60'),_0x419b('0x61')],'raw':!![]}]})['then'](function(_0x1bb6bb){if(_0x1bb6bb){var _0x59a762=_[_0x419b('0x62')](_0x1bb6bb,function(_0x7dc246){var _0x239a17=_0x7dc246[_0x419b('0x22')]({'plain':!![]});return _0x239a17['Agents'];});return db[_0x419b('0x3b')]['find']({'where':{'id':_0x2aee09[_0x419b('0x40')]['id']}})[_0x419b('0x20')](function(_0x4ceff4){return db[_0x419b('0x63')]['transaction'](function(_0x44c373){return _0x4ceff4[_0x419b('0x5b')](_0x1088ac,{'transaction':_0x44c373})[_0x419b('0x20')](function(){return BPromise['each'](_0x59a762,function(_0x2bfbec){return db[_0x419b('0x50')]['findOrCreate']({'where':{'UserId':_0x2bfbec['id'],'MailQueueId':_0x2aee09['params']['id']},'transaction':_0x44c373});});})[_0x419b('0x20')](function(){_0x59a762[_0x419b('0x64')](function(_0x49a151){socket[_0x419b('0x65')](_0x419b('0x66'),{'UserId':_0x49a151['id'],'MailQueueId':_0x4ceff4['id']});});});});});}})['then'](respondWithStatusCode(_0x1a07cf,null))[_0x419b('0x44')](handleError(_0x1a07cf,null));};exports[_0x419b('0x67')]=function(_0x2175f7,_0x2e007a,_0x3e4473){return db[_0x419b('0x5c')][_0x419b('0x3d')]({'where':{'id':_0x2175f7[_0x419b('0x2d')][_0x419b('0x68')]},'attributes':['id'],'include':[{'model':db[_0x419b('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e007a,null))[_0x419b('0x20')](function(_0x2d7655){var _0x59abaf=_[_0x419b('0x29')](_0x2d7655,'id');var _0x2b5729=[];var _0x347b69=[];var _0x4aa17a=squel[_0x419b('0x69')]();_0x4aa17a['field']('tq.TeamId')['from'](_0x419b('0x6a'),'tq')['join'](_0x419b('0x6b'),'ut',_0x419b('0x6c'))[_0x419b('0x38')](_0x419b('0x6d'),_0x2175f7['params']['id']);for(var _0xcfb0e=0x0;_0xcfb0e<_0x2d7655['length'];_0xcfb0e+=0x1){let _0x128ff4=_0x2d7655[_0xcfb0e];for(var _0x2571ba=0x0;_0x2571ba<_0x128ff4[_0x419b('0x5e')][_0x419b('0x41')];_0x2571ba+=0x1){let _0x513aba=_0x128ff4[_0x419b('0x5e')][_0x2571ba];var _0xa1b335=_0x4aa17a['clone']();_0xa1b335[_0x419b('0x38')](_0x419b('0x6e'),_0x513aba['id']);_0x347b69['push'](db[_0x419b('0x63')][_0x419b('0x2d')](_0xa1b335[_0x419b('0x6f')](),{'type':db[_0x419b('0x63')]['QueryTypes']['SELECT']})['then'](function(_0x5a83b6){if(_0x5a83b6[_0x419b('0x41')]===0x1){return _0x513aba['id'];}else{var _0x43ab91=_[_0x419b('0x70')](_[_0x419b('0x29')](_0x5a83b6,_0x419b('0x71')),function(_0x47612e){return _[_0x419b('0x72')](_0x59abaf,_0x47612e);});if(_0x43ab91){return _0x513aba['id'];}}}));}}return BPromise[_0x419b('0x73')](_0x347b69)['then'](function(_0x1c44c7){_0x2b5729=_(_0x2b5729)[_0x419b('0x74')](_0x1c44c7)['compact']()[_0x419b('0x75')]();return db[_0x419b('0x3b')][_0x419b('0x43')]({'where':{'id':_0x2175f7['params']['id']}})[_0x419b('0x20')](function(_0x444898){return db[_0x419b('0x63')][_0x419b('0x76')](function(_0x2ea280){return _0x444898[_0x419b('0x67')](_0x2175f7[_0x419b('0x2d')][_0x419b('0x68')],{'transaction':_0x2ea280})[_0x419b('0x20')](function(){if(!_[_0x419b('0x77')](_0x2b5729)){return _0x444898[_0x419b('0x78')](_0x2b5729,{'transaction':_0x2ea280});}})[_0x419b('0x20')](function(){_0x2b5729[_0x419b('0x64')](function(_0x51eaca){socket[_0x419b('0x65')](_0x419b('0x79'),{'UserId':_0x51eaca,'MailQueueId':_0x444898['id']});});});});});});})[_0x419b('0x20')](respondWithStatusCode(_0x2e007a,null))[_0x419b('0x44')](handleError(_0x2e007a,null));};exports[_0x419b('0x7a')]=function(_0x4e0f1a,_0xbe306f,_0x35e010){return db['MailQueue'][_0x419b('0x43')]({'where':{'id':_0x4e0f1a[_0x419b('0x40')]['id']}})[_0x419b('0x20')](handleEntityNotFound(_0xbe306f,null))['then'](function(_0x889b76){if(_0x889b76){return _0x889b76['addAgents'](_0x4e0f1a[_0x419b('0x46')][_0x419b('0x68')],_['omit'](_0x4e0f1a['body'],[_0x419b('0x68'),'id'])||{})['spread'](function(_0x5b1ee9){for(var _0x3e7a35=0x0;_0x3e7a35<_0x4e0f1a['body'][_0x419b('0x68')][_0x419b('0x41')];_0x3e7a35+=0x1){socket[_0x419b('0x65')](_0x419b('0x66'),{'UserId':_0x4e0f1a['body'][_0x419b('0x68')][_0x3e7a35],'MailQueueId':_0x4e0f1a[_0x419b('0x40')]['id']});}return _0x5b1ee9;});}})[_0x419b('0x20')](respondWithResult(_0xbe306f,null))[_0x419b('0x44')](handleError(_0xbe306f,null));};exports[_0x419b('0x78')]=function(_0x2d001b,_0x24474a,_0x41f871){return db[_0x419b('0x3b')]['find']({'where':{'id':_0x2d001b[_0x419b('0x40')]['id']}})[_0x419b('0x20')](handleEntityNotFound(_0x24474a,null))['then'](function(_0x5e023b){if(_0x5e023b){return _0x5e023b[_0x419b('0x78')](_0x2d001b[_0x419b('0x2d')][_0x419b('0x68')])[_0x419b('0x20')](function(){if(_[_0x419b('0x7b')](_0x2d001b['query'][_0x419b('0x68')])){for(var _0x1318f2=0x0;_0x1318f2<_0x2d001b[_0x419b('0x2d')]['ids']['length'];_0x1318f2+=0x1){socket[_0x419b('0x65')](_0x419b('0x79'),{'UserId':Number(_0x2d001b[_0x419b('0x2d')]['ids'][_0x1318f2]),'MailQueueId':Number(_0x2d001b[_0x419b('0x40')]['id'])});}}else{socket[_0x419b('0x65')]('userMailQueue:remove',{'UserId':Number(_0x2d001b[_0x419b('0x2d')][_0x419b('0x68')]),'MailQueueId':Number(_0x2d001b[_0x419b('0x40')]['id'])});}});}})[_0x419b('0x20')](respondWithStatusCode(_0x24474a,null))[_0x419b('0x44')](handleError(_0x24474a,null));};exports['getAgents']=function(_0xbff5c2,_0x43b088,_0x4039f8){var _0x2772c8={};var _0x5ba12e={};var _0x894cfc;var _0x309925;return db['MailQueue'][_0x419b('0x4f')]({'where':{'id':_0xbff5c2[_0x419b('0x40')]['id']}})['then'](handleEntityNotFound(_0x43b088,null))[_0x419b('0x20')](function(_0x3686ab){if(_0x3686ab){_0x894cfc=_0x3686ab;_0x5ba12e['model']=_[_0x419b('0x2e')](db[_0x419b('0x5d')][_0x419b('0x2a')]);_0x5ba12e[_0x419b('0x2d')]=_[_0x419b('0x2e')](_0xbff5c2[_0x419b('0x2d')]);_0x5ba12e['filters']=_[_0x419b('0x30')](_0x5ba12e['model'],_0x5ba12e[_0x419b('0x2d')]);_0x2772c8['attributes']=_[_0x419b('0x30')](_0x5ba12e[_0x419b('0x2c')],qs[_0x419b('0x32')](_0xbff5c2[_0x419b('0x2d')]['fields']));_0x2772c8['attributes']=_0x2772c8[_0x419b('0x31')][_0x419b('0x41')]?_0x2772c8[_0x419b('0x31')]:_0x5ba12e[_0x419b('0x2c')];_0x2772c8[_0x419b('0x35')]=qs[_0x419b('0x51')](_0xbff5c2[_0x419b('0x2d')][_0x419b('0x51')]);_0x2772c8['where']=qs['filters'](_['pick'](_0xbff5c2[_0x419b('0x2d')],_0x5ba12e['filters']));if(_0xbff5c2[_0x419b('0x2d')][_0x419b('0x37')]){_0x2772c8[_0x419b('0x38')]=_[_0x419b('0x39')](_0x2772c8[_0x419b('0x38')],{'$or':_[_0x419b('0x29')](_0x2772c8[_0x419b('0x31')],function(_0x30ce71){var _0x4be938={};_0x4be938[_0x30ce71]={'$like':'%'+_0xbff5c2['query'][_0x419b('0x37')]+'%'};return _0x4be938;})});}_0x2772c8=_[_0x419b('0x39')]({},_0x2772c8,_0xbff5c2['options']);return _0x894cfc[_0x419b('0x7c')](_0x2772c8);}})[_0x419b('0x20')](function(_0x4d4a65){if(_0x4d4a65){_0x309925=_0x4d4a65[_0x419b('0x41')];if(!_0xbff5c2['query'][_0x419b('0x33')](_0x419b('0x34'))){_0x2772c8[_0x419b('0x1d')]=qs[_0x419b('0x1d')](_0xbff5c2[_0x419b('0x2d')][_0x419b('0x1d')]);_0x2772c8[_0x419b('0x1c')]=qs['offset'](_0xbff5c2['query']['offset']);}return _0x894cfc[_0x419b('0x7c')](_0x2772c8);}})['then'](function(_0x135829){if(_0x135829){return _0x135829?{'count':_0x309925,'rows':_0x135829}:null;}})[_0x419b('0x20')](respondWithResult(_0x43b088,null))[_0x419b('0x44')](handleError(_0x43b088,null));};
\ No newline at end of file
index a03b21c..b096841 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a76=['MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xc92b81,_0x1ba725){var _0x38d666=function(_0x1c849b){while(--_0x1c849b){_0xc92b81['push'](_0xc92b81['shift']());}};_0x38d666(++_0x1ba725);}(_0x2a76,0x86));var _0x62a7=function(_0x4951f3,_0x1cf926){_0x4951f3=_0x4951f3-0x0;var _0x5b8eb9=_0x2a76[_0x4951f3];return _0x5b8eb9;};'use strict';var EventEmitter=require(_0x62a7('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x62a7('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x62a7('0x2')](0x0);var events={'afterCreate':_0x62a7('0x3'),'afterUpdate':'update','afterDestroy':_0x62a7('0x4')};function emitEvent(_0x59b8a6){return function(_0x328bdf,_0x5dc5c9,_0x4295f2){MailQueueEvents[_0x62a7('0x5')](_0x59b8a6+':'+_0x328bdf['id'],_0x328bdf);MailQueueEvents[_0x62a7('0x5')](_0x59b8a6,_0x328bdf);_0x4295f2(null);};}for(var e in events){if(events[_0x62a7('0x6')](e)){var event=events[e];MailQueue[_0x62a7('0x7')](e,emitEvent(event));}}module[_0x62a7('0x8')]=MailQueueEvents;
\ No newline at end of file
+var _0xe7a8=['emit','hasOwnProperty','exports','events','setMaxListeners','save','update'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xe7a8,0x1c3));var _0x8e7a=function(_0x2ffd05,_0x1840e3){_0x2ffd05=_0x2ffd05-0x0;var _0x5038bf=_0xe7a8[_0x2ffd05];return _0x5038bf;};'use strict';var EventEmitter=require(_0x8e7a('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x8e7a('0x1')](0x0);var events={'afterCreate':_0x8e7a('0x2'),'afterUpdate':_0x8e7a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x181855){return function(_0x5e20b0,_0x15bacf,_0x5c2fc0){MailQueueEvents[_0x8e7a('0x4')](_0x181855+':'+_0x5e20b0['id'],_0x5e20b0);MailQueueEvents[_0x8e7a('0x4')](_0x181855,_0x5e20b0);_0x5c2fc0(null);};}for(var e in events){if(events[_0x8e7a('0x5')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x8e7a('0x6')]=MailQueueEvents;
\ No newline at end of file
index c873290..6f61cbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdac2=['api','moment','bluebird','request-promise','path','rimraf','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','../../config/logger'];(function(_0x5a971f,_0x17d5be){var _0x4f8aec=function(_0x24db8){while(--_0x24db8){_0x5a971f['push'](_0x5a971f['shift']());}};_0x4f8aec(++_0x17d5be);}(_0xdac2,0x1ba));var _0x2dac=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0xdac2[_0x119b3e];return _0x1169ae;};'use strict';var _=require(_0x2dac('0x0'));var util=require('util');var logger=require(_0x2dac('0x1'))(_0x2dac('0x2'));var moment=require(_0x2dac('0x3'));var BPromise=require(_0x2dac('0x4'));var rp=require(_0x2dac('0x5'));var fs=require('fs');var path=require(_0x2dac('0x6'));var rimraf=require(_0x2dac('0x7'));var config=require('../../config/environment');var attributes=require(_0x2dac('0x8'));module['exports']=function(_0x3a5ab6,_0x4fcd01){return _0x3a5ab6[_0x2dac('0x9')](_0x2dac('0xa'),attributes,{'tableName':_0x2dac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f7d=['path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x7f7d,0x1cf));var _0xd7f7=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x7f7d[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0xd7f7('0x0'));var util=require('util');var logger=require(_0xd7f7('0x1'))(_0xd7f7('0x2'));var moment=require('moment');var BPromise=require(_0xd7f7('0x3'));var rp=require(_0xd7f7('0x4'));var fs=require('fs');var path=require(_0xd7f7('0x5'));var rimraf=require(_0xd7f7('0x6'));var config=require(_0xd7f7('0x7'));var attributes=require(_0xd7f7('0x8'));module[_0xd7f7('0x9')]=function(_0x28938f,_0x5c256d){return _0x28938f['define'](_0xd7f7('0xa'),attributes,{'tableName':_0xd7f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 35ea438..cd5df31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee3=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','attributes','limit','map','include','model','ShowMailQueue','where','util','bluebird','randomstring'];(function(_0x157977,_0x5964e3){var _0xf365f0=function(_0xdd4175){while(--_0xdd4175){_0x157977['push'](_0x157977['shift']());}};_0xf365f0(++_0x5964e3);}(_0xbee3,0x1dd));var _0x3bee=function(_0x3cbfe7,_0x286ba7){_0x3cbfe7=_0x3cbfe7-0x0;var _0xf9051d=_0xbee3[_0x3cbfe7];return _0xf9051d;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var moment=require('moment');var BPromise=require(_0x3bee('0x1'));var rs=require(_0x3bee('0x2'));var fs=require('fs');var Redis=require(_0x3bee('0x3'));var db=require(_0x3bee('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3bee('0x5'))(_0x3bee('0x6'));var config=require(_0x3bee('0x7'));var jayson=require(_0x3bee('0x8'));var client=jayson[_0x3bee('0x9')][_0x3bee('0xa')]({'port':0x232a});config[_0x3bee('0xb')]=_[_0x3bee('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3bee('0xd'))(new Redis(config[_0x3bee('0xb')]));require(_0x3bee('0xe'))[_0x3bee('0xf')](socket);function respondWithRpcPromise(_0x141fcc,_0x1b66aa,_0x277bd5){return new BPromise(function(_0x3274c9,_0x1384d3){return client[_0x3bee('0x10')](_0x141fcc,_0x277bd5)[_0x3bee('0x11')](function(_0x10370c){logger[_0x3bee('0x12')](_0x3bee('0x13'),_0x1b66aa,'request\x20sent');logger[_0x3bee('0x14')](_0x3bee('0x15'),_0x1b66aa,_0x3bee('0x16'),JSON[_0x3bee('0x17')](_0x10370c));if(_0x10370c[_0x3bee('0x18')]){if(_0x10370c['error'][_0x3bee('0x19')]===0x1f4){logger[_0x3bee('0x18')](_0x3bee('0x13'),_0x1b66aa,_0x10370c[_0x3bee('0x18')][_0x3bee('0x1a')]);return _0x1384d3(_0x10370c[_0x3bee('0x18')][_0x3bee('0x1a')]);}logger['error'](_0x3bee('0x13'),_0x1b66aa,_0x10370c[_0x3bee('0x18')][_0x3bee('0x1a')]);return _0x3274c9(_0x10370c['error']['message']);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x1b66aa,_0x3bee('0x16'));_0x3274c9(_0x10370c[_0x3bee('0x1b')]['message']);}})[_0x3bee('0x1c')](function(_0x9eade){logger[_0x3bee('0x18')](_0x3bee('0x13'),_0x1b66aa,_0x9eade);_0x1384d3(_0x9eade);});});}exports[_0x3bee('0x1d')]=function(_0x2a5644){var _0x4c63b6=this;return new Promise(function(_0x4190c9,_0x2159c7){return db[_0x3bee('0x1e')]['findAll']({'raw':_0x2a5644[_0x3bee('0x1f')]?_0x2a5644[_0x3bee('0x1f')][_0x3bee('0x20')]===undefined?!![]:![]:!![],'where':_0x2a5644[_0x3bee('0x1f')]?_0x2a5644['options']['where']||null:null,'attributes':_0x2a5644['options']?_0x2a5644['options'][_0x3bee('0x21')]||null:null,'limit':_0x2a5644['options']?_0x2a5644[_0x3bee('0x1f')][_0x3bee('0x22')]||null:null,'include':_0x2a5644[_0x3bee('0x1f')]?_0x2a5644[_0x3bee('0x1f')]['include']?_[_0x3bee('0x23')](_0x2a5644[_0x3bee('0x1f')][_0x3bee('0x24')],function(_0x5907f9){return{'model':db[_0x5907f9[_0x3bee('0x25')]],'as':_0x5907f9['as'],'attributes':_0x5907f9[_0x3bee('0x21')],'include':_0x5907f9[_0x3bee('0x24')]?_[_0x3bee('0x23')](_0x5907f9[_0x3bee('0x24')],function(_0x156c7e){return{'model':db[_0x156c7e['model']],'as':_0x156c7e['as'],'attributes':_0x156c7e[_0x3bee('0x21')],'include':_0x156c7e[_0x3bee('0x24')]?_['map'](_0x156c7e['include'],function(_0x2e5b8a){return{'model':db[_0x2e5b8a[_0x3bee('0x25')]],'as':_0x2e5b8a['as'],'attributes':_0x2e5b8a[_0x3bee('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3bee('0x11')](function(_0x4b7a50){logger[_0x3bee('0x12')](_0x3bee('0x1d'),_0x2a5644);logger['debug'](_0x3bee('0x1d'),_0x2a5644,JSON[_0x3bee('0x17')](_0x4b7a50));_0x4190c9(_0x4b7a50);})['catch'](function(_0x6f2b){logger[_0x3bee('0x18')](_0x3bee('0x1d'),_0x6f2b[_0x3bee('0x1a')],_0x2a5644);_0x2159c7(_0x4c63b6[_0x3bee('0x18')](0x1f4,_0x6f2b[_0x3bee('0x1a')]));});});};exports[_0x3bee('0x26')]=function(_0x569faf){var _0x19ba8a=this;return new Promise(function(_0xb19e7e,_0x4d1112){return db['MailQueue']['find']({'raw':_0x569faf[_0x3bee('0x1f')]?_0x569faf[_0x3bee('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x569faf[_0x3bee('0x1f')]?_0x569faf[_0x3bee('0x1f')][_0x3bee('0x27')]||null:null,'attributes':_0x569faf['options']?_0x569faf[_0x3bee('0x1f')][_0x3bee('0x21')]||null:null,'include':_0x569faf['options']?_0x569faf[_0x3bee('0x1f')]['include']?_[_0x3bee('0x23')](_0x569faf['options'][_0x3bee('0x24')],function(_0x575b4a){return{'model':db[_0x575b4a['model']],'as':_0x575b4a['as'],'attributes':_0x575b4a[_0x3bee('0x21')],'include':_0x575b4a[_0x3bee('0x24')]?_[_0x3bee('0x23')](_0x575b4a[_0x3bee('0x24')],function(_0xfd3dbd){return{'model':db[_0xfd3dbd[_0x3bee('0x25')]],'as':_0xfd3dbd['as'],'attributes':_0xfd3dbd[_0x3bee('0x21')],'include':_0xfd3dbd[_0x3bee('0x24')]?_[_0x3bee('0x23')](_0xfd3dbd['include'],function(_0x372544){return{'model':db[_0x372544[_0x3bee('0x25')]],'as':_0x372544['as'],'attributes':_0x372544[_0x3bee('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3bee('0x11')](function(_0xd7797){logger[_0x3bee('0x12')](_0x3bee('0x26'),_0x569faf);logger[_0x3bee('0x14')](_0x3bee('0x26'),_0x569faf,JSON['stringify'](_0xd7797));_0xb19e7e(_0xd7797);})[_0x3bee('0x1c')](function(_0x7381c3){logger[_0x3bee('0x18')](_0x3bee('0x26'),_0x7381c3[_0x3bee('0x1a')],_0x569faf);_0x4d1112(_0x19ba8a[_0x3bee('0x18')](0x1f4,_0x7381c3[_0x3bee('0x1a')]));});});};
\ No newline at end of file
+var _0xd815=['where','attributes','limit','include','map','model','stringify','ShowMailQueue','MailQueue','find','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','localhost','./mailQueue.socket','request','then','info','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','findAll','options'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xd815,0x19b));var _0x5d81=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd815[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5d81('0x0'));var util=require(_0x5d81('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5d81('0x2'));var fs=require('fs');var Redis=require(_0x5d81('0x3'));var db=require(_0x5d81('0x4'))['db'];var utils=require(_0x5d81('0x5'));var logger=require('../../config/logger')(_0x5d81('0x6'));var config=require(_0x5d81('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d81('0x8')][_0x5d81('0x9')]({'port':0x232a});config['redis']=_[_0x5d81('0xa')](config[_0x5d81('0xb')],{'host':_0x5d81('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d81('0xb')]));require(_0x5d81('0xd'))['register'](socket);function respondWithRpcPromise(_0x3dfcb1,_0x42bdf5,_0x327f5d){return new BPromise(function(_0x3e1a1c,_0x8092bd){return client[_0x5d81('0xe')](_0x3dfcb1,_0x327f5d)[_0x5d81('0xf')](function(_0x59e69c){logger[_0x5d81('0x10')]('MailQueue,\x20%s,\x20%s',_0x42bdf5,'request\x20sent');logger[_0x5d81('0x11')](_0x5d81('0x12'),_0x42bdf5,_0x5d81('0x13'),JSON['stringify'](_0x59e69c));if(_0x59e69c[_0x5d81('0x14')]){if(_0x59e69c[_0x5d81('0x14')][_0x5d81('0x15')]===0x1f4){logger[_0x5d81('0x14')](_0x5d81('0x16'),_0x42bdf5,_0x59e69c['error'][_0x5d81('0x17')]);return _0x8092bd(_0x59e69c['error'][_0x5d81('0x17')]);}logger[_0x5d81('0x14')]('MailQueue,\x20%s,\x20%s',_0x42bdf5,_0x59e69c[_0x5d81('0x14')]['message']);return _0x3e1a1c(_0x59e69c[_0x5d81('0x14')][_0x5d81('0x17')]);}else{logger[_0x5d81('0x10')](_0x5d81('0x16'),_0x42bdf5,_0x5d81('0x13'));_0x3e1a1c(_0x59e69c[_0x5d81('0x18')][_0x5d81('0x17')]);}})[_0x5d81('0x19')](function(_0x1beed3){logger['error'](_0x5d81('0x16'),_0x42bdf5,_0x1beed3);_0x8092bd(_0x1beed3);});});}exports[_0x5d81('0x1a')]=function(_0x21a677){var _0x4a58a4=this;return new Promise(function(_0x2b4c87,_0x1315e1){return db['MailQueue'][_0x5d81('0x1b')]({'raw':_0x21a677[_0x5d81('0x1c')]?_0x21a677[_0x5d81('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x21a677['options']?_0x21a677['options'][_0x5d81('0x1d')]||null:null,'attributes':_0x21a677[_0x5d81('0x1c')]?_0x21a677['options'][_0x5d81('0x1e')]||null:null,'limit':_0x21a677[_0x5d81('0x1c')]?_0x21a677[_0x5d81('0x1c')][_0x5d81('0x1f')]||null:null,'include':_0x21a677[_0x5d81('0x1c')]?_0x21a677[_0x5d81('0x1c')][_0x5d81('0x20')]?_[_0x5d81('0x21')](_0x21a677[_0x5d81('0x1c')][_0x5d81('0x20')],function(_0x2c1b1b){return{'model':db[_0x2c1b1b[_0x5d81('0x22')]],'as':_0x2c1b1b['as'],'attributes':_0x2c1b1b[_0x5d81('0x1e')],'include':_0x2c1b1b[_0x5d81('0x20')]?_[_0x5d81('0x21')](_0x2c1b1b[_0x5d81('0x20')],function(_0x983759){return{'model':db[_0x983759[_0x5d81('0x22')]],'as':_0x983759['as'],'attributes':_0x983759[_0x5d81('0x1e')],'include':_0x983759[_0x5d81('0x20')]?_[_0x5d81('0x21')](_0x983759['include'],function(_0x570cf7){return{'model':db[_0x570cf7[_0x5d81('0x22')]],'as':_0x570cf7['as'],'attributes':_0x570cf7[_0x5d81('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa99f4e){logger[_0x5d81('0x10')](_0x5d81('0x1a'),_0x21a677);logger[_0x5d81('0x11')](_0x5d81('0x1a'),_0x21a677,JSON[_0x5d81('0x23')](_0xa99f4e));_0x2b4c87(_0xa99f4e);})['catch'](function(_0x535134){logger[_0x5d81('0x14')](_0x5d81('0x1a'),_0x535134[_0x5d81('0x17')],_0x21a677);_0x1315e1(_0x4a58a4[_0x5d81('0x14')](0x1f4,_0x535134[_0x5d81('0x17')]));});});};exports[_0x5d81('0x24')]=function(_0x3073f0){var _0x987b17=this;return new Promise(function(_0x11f69b,_0x1f3966){return db[_0x5d81('0x25')][_0x5d81('0x26')]({'raw':_0x3073f0[_0x5d81('0x1c')]?_0x3073f0[_0x5d81('0x1c')][_0x5d81('0x27')]===undefined?!![]:![]:!![],'where':_0x3073f0[_0x5d81('0x1c')]?_0x3073f0[_0x5d81('0x1c')][_0x5d81('0x1d')]||null:null,'attributes':_0x3073f0[_0x5d81('0x1c')]?_0x3073f0['options']['attributes']||null:null,'include':_0x3073f0[_0x5d81('0x1c')]?_0x3073f0['options'][_0x5d81('0x20')]?_[_0x5d81('0x21')](_0x3073f0[_0x5d81('0x1c')][_0x5d81('0x20')],function(_0x323033){return{'model':db[_0x323033[_0x5d81('0x22')]],'as':_0x323033['as'],'attributes':_0x323033['attributes'],'include':_0x323033[_0x5d81('0x20')]?_['map'](_0x323033['include'],function(_0x1d4d82){return{'model':db[_0x1d4d82[_0x5d81('0x22')]],'as':_0x1d4d82['as'],'attributes':_0x1d4d82[_0x5d81('0x1e')],'include':_0x1d4d82[_0x5d81('0x20')]?_[_0x5d81('0x21')](_0x1d4d82[_0x5d81('0x20')],function(_0x5331a5){return{'model':db[_0x5331a5['model']],'as':_0x5331a5['as'],'attributes':_0x5331a5[_0x5d81('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5d81('0xf')](function(_0x1c35d5){logger['info'](_0x5d81('0x24'),_0x3073f0);logger[_0x5d81('0x11')](_0x5d81('0x24'),_0x3073f0,JSON[_0x5d81('0x23')](_0x1c35d5));_0x11f69b(_0x1c35d5);})[_0x5d81('0x19')](function(_0x5e0260){logger[_0x5d81('0x14')](_0x5d81('0x24'),_0x5e0260[_0x5d81('0x17')],_0x3073f0);_0x1f3966(_0x987b17['error'](0x1f4,_0x5e0260[_0x5d81('0x17')]));});});};
\ No newline at end of file
index 21a408b..b2f9425 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4279=['length','./mailQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x1d40d5,_0x1ee7a0){var _0x28bdcb=function(_0x355f48){while(--_0x355f48){_0x1d40d5['push'](_0x1d40d5['shift']());}};_0x28bdcb(++_0x1ee7a0);}(_0x4279,0x169));var _0x9427=function(_0x4da1a8,_0x481488){_0x4da1a8=_0x4da1a8-0x0;var _0x49ce68=_0x4279[_0x4da1a8];return _0x49ce68;};'use strict';var MailQueueEvents=require(_0x9427('0x0'));var events=[_0x9427('0x1'),_0x9427('0x2'),_0x9427('0x3')];function createListener(_0x191797,_0x5f0fe5){return function(_0x6589c5){_0x5f0fe5[_0x9427('0x4')](_0x191797,_0x6589c5);};}function removeListener(_0x5b1c69,_0x5da790){return function(){MailQueueEvents[_0x9427('0x5')](_0x5b1c69,_0x5da790);};}exports[_0x9427('0x6')]=function(_0x1317ac){for(var _0x24232c=0x0,_0x606611=events[_0x9427('0x7')];_0x24232c<_0x606611;_0x24232c++){var _0x161245=events[_0x24232c];var _0x1112c4=createListener('mailQueue:'+_0x161245,_0x1317ac);MailQueueEvents['on'](_0x161245,_0x1112c4);}};
\ No newline at end of file
+var _0xff7f=['update','emit','register','length','mailQueue:','./mailQueue.events','save','remove'];(function(_0x2d7ead,_0x48cb08){var _0x4ecf0e=function(_0xca9c69){while(--_0xca9c69){_0x2d7ead['push'](_0x2d7ead['shift']());}};_0x4ecf0e(++_0x48cb08);}(_0xff7f,0x85));var _0xfff7=function(_0x59cf8d,_0x2a541a){_0x59cf8d=_0x59cf8d-0x0;var _0x19bf67=_0xff7f[_0x59cf8d];return _0x19bf67;};'use strict';var MailQueueEvents=require(_0xfff7('0x0'));var events=[_0xfff7('0x1'),_0xfff7('0x2'),_0xfff7('0x3')];function createListener(_0xab59ad,_0x2bac6c){return function(_0x1593d7){_0x2bac6c[_0xfff7('0x4')](_0xab59ad,_0x1593d7);};}function removeListener(_0x526201,_0x5273ff){return function(){MailQueueEvents['removeListener'](_0x526201,_0x5273ff);};}exports[_0xfff7('0x5')]=function(_0x54d9d3){for(var _0x293c56=0x0,_0x7dddca=events[_0xfff7('0x6')];_0x293c56<_0x7dddca;_0x293c56++){var _0x284337=events[_0x293c56];var _0x4d1ef8=createListener(_0xfff7('0x7')+_0x284337,_0x54d9d3);MailQueueEvents['on'](_0x284337,_0x4d1ef8);}};
\ No newline at end of file
index f892fde..c567c24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc196=['get','index','/describe','isAuthenticated','describe','put','/:id','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x1a680a,_0x593e35){var _0x23c264=function(_0x56f739){while(--_0x56f739){_0x1a680a['push'](_0x1a680a['shift']());}};_0x23c264(++_0x593e35);}(_0xc196,0x1b9));var _0x6c19=function(_0x20caaf,_0x11be2b){_0x20caaf=_0x20caaf-0x0;var _0x135308=_0xc196[_0x20caaf];return _0x135308;};'use strict';var multer=require(_0x6c19('0x0'));var util=require(_0x6c19('0x1'));var path=require('path');var timeout=require(_0x6c19('0x2'));var express=require(_0x6c19('0x3'));var router=express[_0x6c19('0x4')]();var auth=require(_0x6c19('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6c19('0x6'));var controller=require('./mailQueueReport.controller');router[_0x6c19('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c19('0x8')]);router[_0x6c19('0x7')](_0x6c19('0x9'),auth[_0x6c19('0xa')](),controller[_0x6c19('0xb')]);router['get']('/:id',auth[_0x6c19('0xa')](),controller['show']);router['post']('/',auth[_0x6c19('0xa')](),controller['create']);router[_0x6c19('0xc')](_0x6c19('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x6c19('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6c19('0xf')]=router;
\ No newline at end of file
+var _0x70e5=['../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','/describe','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2b22a1,_0x5cb33c){var _0x2a4af6=function(_0x268ec8){while(--_0x268ec8){_0x2b22a1['push'](_0x2b22a1['shift']());}};_0x2a4af6(++_0x5cb33c);}(_0x70e5,0xb7));var _0x570e=function(_0x17c241,_0x1bf660){_0x17c241=_0x17c241-0x0;var _0x472397=_0x70e5[_0x17c241];return _0x472397;};'use strict';var multer=require(_0x570e('0x0'));var util=require('util');var path=require(_0x570e('0x1'));var timeout=require(_0x570e('0x2'));var express=require(_0x570e('0x3'));var router=express[_0x570e('0x4')]();var auth=require(_0x570e('0x5'));var interaction=require(_0x570e('0x6'));var config=require('../../config/environment');var controller=require(_0x570e('0x7'));router['get']('/',auth[_0x570e('0x8')](),controller['index']);router['get'](_0x570e('0x9'),auth[_0x570e('0x8')](),controller[_0x570e('0xa')]);router[_0x570e('0xb')](_0x570e('0xc'),auth['isAuthenticated'](),controller[_0x570e('0xd')]);router[_0x570e('0xe')]('/',auth[_0x570e('0x8')](),controller[_0x570e('0xf')]);router[_0x570e('0x10')]('/:id',auth[_0x570e('0x8')](),controller[_0x570e('0x11')]);router[_0x570e('0x12')](_0x570e('0xc'),auth[_0x570e('0x8')](),controller[_0x570e('0x13')]);module[_0x570e('0x14')]=router;
\ No newline at end of file
index 7be1d8b..13169c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78d1=['moment','sequelize','exports','STRING','DATE'];(function(_0x5bd43c,_0x2a8b1a){var _0x2cadf9=function(_0x5534d5){while(--_0x5534d5){_0x5bd43c['push'](_0x5bd43c['shift']());}};_0x2cadf9(++_0x2a8b1a);}(_0x78d1,0x7d));var _0x178d=function(_0x23794b,_0x49fb5a){_0x23794b=_0x23794b-0x0;var _0x4fe80c=_0x78d1[_0x23794b];return _0x4fe80c;};'use strict';var moment=require(_0x178d('0x0'));var Sequelize=require(_0x178d('0x1'));module[_0x178d('0x2')]={'uniqueid':{'type':Sequelize[_0x178d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x178d('0x4')]},'leaveAt':{'type':Sequelize[_0x178d('0x4')]},'acceptAt':{'type':Sequelize[_0x178d('0x4')]},'exitAt':{'type':Sequelize[_0x178d('0x4')]},'reason':{'type':Sequelize[_0x178d('0x3')]}};
\ No newline at end of file
+var _0x9b3d=['exports','STRING','DATE','sequelize'];(function(_0x4f4c81,_0x597e62){var _0x26beab=function(_0x5016e3){while(--_0x5016e3){_0x4f4c81['push'](_0x4f4c81['shift']());}};_0x26beab(++_0x597e62);}(_0x9b3d,0x77));var _0xd9b3=function(_0x593c1b,_0x35c524){_0x593c1b=_0x593c1b-0x0;var _0x4e0c07=_0x9b3d[_0x593c1b];return _0x4e0c07;};'use strict';var moment=require('moment');var Sequelize=require(_0xd9b3('0x0'));module[_0xd9b3('0x1')]={'uniqueid':{'type':Sequelize[_0xd9b3('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd9b3('0x2')]},'joinAt':{'type':Sequelize[_0xd9b3('0x3')]},'leaveAt':{'type':Sequelize[_0xd9b3('0x3')]},'acceptAt':{'type':Sequelize[_0xd9b3('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd9b3('0x2')]}};
\ No newline at end of file
index 6eb5d03..13a7035 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2af3=['to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','apply','save','update','destroy','then','stack','name','index','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','sort','where','pick','filter','merge','options','MailQueueReport','include','findAll','catch','show','params','includeAll','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox'];(function(_0x5c08cb,_0x456960){var _0x147907=function(_0x1da1be){while(--_0x1da1be){_0x5c08cb['push'](_0x5c08cb['shift']());}};_0x147907(++_0x456960);}(_0x2af3,0xbc));var _0x32af=function(_0x5e08be,_0x9bf344){_0x5e08be=_0x5e08be-0x0;var _0x4db79e=_0x2af3[_0x5e08be];return _0x4db79e;};'use strict';var pdf=require(_0x32af('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x32af('0x1'));var zipdir=require(_0x32af('0x2'));var jsonpatch=require(_0x32af('0x3'));var rp=require(_0x32af('0x4'));var moment=require('moment');var BPromise=require(_0x32af('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x32af('0x6'));var csv=require(_0x32af('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x32af('0x8'));var crypto=require(_0x32af('0x9'));var jsforce=require(_0x32af('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x32af('0xb'));var Papa=require(_0x32af('0xc'));var Redis=require(_0x32af('0xd'));var authService=require(_0x32af('0xe'));var qs=require(_0x32af('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x32af('0x10'))(_0x32af('0x11'));var utils=require(_0x32af('0x12'));var config=require(_0x32af('0x13'));var db=require(_0x32af('0x14'))['db'];function respondWithStatusCode(_0x37f9c3,_0x4e2fab){_0x4e2fab=_0x4e2fab||0xcc;return function(_0x4d7269){if(_0x4d7269){return _0x37f9c3[_0x32af('0x15')](_0x4e2fab);}return _0x37f9c3['status'](_0x4e2fab)[_0x32af('0x16')]();};}function respondWithResult(_0x71cfb4,_0x31bed4){_0x31bed4=_0x31bed4||0xc8;return function(_0x5b9e7a){if(_0x5b9e7a){return _0x71cfb4[_0x32af('0x17')](_0x31bed4)['json'](_0x5b9e7a);}};}function respondWithFilteredResult(_0x5084fc,_0x38b892){return function(_0x52ea09){if(_0x52ea09){var _0x7c08e7=_0x52ea09[_0x32af('0x18')],_0x461afa=_0x38b892[_0x32af('0x19')],_0x191c65=_0x38b892[_0x32af('0x19')]+_0x38b892[_0x32af('0x1a')],_0x4c50c1;if(_0x191c65>=_0x7c08e7){_0x191c65=_0x7c08e7;_0x4c50c1=0xc8;}else{_0x4c50c1=0xce;}_0x5084fc[_0x32af('0x17')](_0x4c50c1);return _0x5084fc['set']('Content-Range',_0x461afa+'-'+_0x191c65+'/'+_0x7c08e7)['json'](_0x52ea09);}return null;};}function patchUpdates(_0x5e524c){return function(_0x568b25){try{jsonpatch[_0x32af('0x1b')](_0x568b25,_0x5e524c,!![]);}catch(_0x2cc739){return BPromise['reject'](_0x2cc739);}return _0x568b25[_0x32af('0x1c')]();};}function saveUpdates(_0xcc22bb,_0xc51c81){return function(_0x3d3bf3){if(_0x3d3bf3){return _0x3d3bf3[_0x32af('0x1d')](_0xcc22bb)['then'](function(_0x278aeb){return _0x278aeb;});}return null;};}function removeEntity(_0x2c84ea,_0x1fe1a2){return function(_0x28d0bf){if(_0x28d0bf){return _0x28d0bf[_0x32af('0x1e')]()[_0x32af('0x1f')](function(){_0x2c84ea[_0x32af('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24d9e1,_0xbdc532){return function(_0x2b8e2b){if(!_0x2b8e2b){_0x24d9e1['sendStatus'](0x194);}return _0x2b8e2b;};}function handleError(_0x18f380,_0x3f9280){_0x3f9280=_0x3f9280||0x1f4;return function(_0x4e718e){logger['error'](_0x4e718e[_0x32af('0x20')]);if(_0x4e718e['name']){delete _0x4e718e[_0x32af('0x21')];}_0x18f380[_0x32af('0x17')](_0x3f9280)['send'](_0x4e718e);};}exports[_0x32af('0x22')]=function(_0x38bf61,_0x30628a){var _0x2409ae={},_0x5dcde9={},_0xc7e0e2={'count':0x0,'rows':[]};var _0x2e4f5e=_['map'](db['MailQueueReport']['rawAttributes'],function(_0x58402b){return{'name':_0x58402b[_0x32af('0x23')],'type':_0x58402b[_0x32af('0x24')][_0x32af('0x25')]};});_0x5dcde9['model']=_[_0x32af('0x26')](_0x2e4f5e,_0x32af('0x21'));_0x5dcde9[_0x32af('0x27')]=_[_0x32af('0x28')](_0x38bf61[_0x32af('0x27')]);_0x5dcde9[_0x32af('0x29')]=_[_0x32af('0x2a')](_0x5dcde9['model'],_0x5dcde9[_0x32af('0x27')]);_0x2409ae[_0x32af('0x2b')]=_['intersection'](_0x5dcde9[_0x32af('0x2c')],qs['fields'](_0x38bf61[_0x32af('0x27')][_0x32af('0x2d')]));_0x2409ae[_0x32af('0x2b')]=_0x2409ae[_0x32af('0x2b')][_0x32af('0x2e')]?_0x2409ae['attributes']:_0x5dcde9[_0x32af('0x2c')];if(!_0x38bf61[_0x32af('0x27')]['hasOwnProperty'](_0x32af('0x2f'))){_0x2409ae[_0x32af('0x1a')]=qs[_0x32af('0x1a')](_0x38bf61[_0x32af('0x27')][_0x32af('0x1a')]);_0x2409ae[_0x32af('0x19')]=qs['offset'](_0x38bf61['query'][_0x32af('0x19')]);}_0x2409ae['order']=qs[_0x32af('0x30')](_0x38bf61[_0x32af('0x27')][_0x32af('0x30')]);_0x2409ae[_0x32af('0x31')]=qs[_0x32af('0x29')](_[_0x32af('0x32')](_0x38bf61['query'],_0x5dcde9['filters']),_0x2e4f5e);if(_0x38bf61['query'][_0x32af('0x33')]){_0x2409ae[_0x32af('0x31')]=_[_0x32af('0x34')](_0x2409ae[_0x32af('0x31')],{'$or':_[_0x32af('0x26')](_0x2e4f5e,function(_0x3a5fee){if(_0x3a5fee[_0x32af('0x24')]!=='VIRTUAL'){var _0x4ccd64={};_0x4ccd64[_0x3a5fee[_0x32af('0x21')]]={'$like':'%'+_0x38bf61[_0x32af('0x27')][_0x32af('0x33')]+'%'};return _0x4ccd64;}})});}_0x2409ae=_['merge']({},_0x2409ae,_0x38bf61[_0x32af('0x35')]);var _0x2bf12a={'where':_0x2409ae[_0x32af('0x31')]};return db[_0x32af('0x36')][_0x32af('0x18')](_0x2bf12a)['then'](function(_0x209862){_0xc7e0e2[_0x32af('0x18')]=_0x209862;if(_0x38bf61[_0x32af('0x27')]['includeAll']){_0x2409ae[_0x32af('0x37')]=[{'all':!![]}];}return db['MailQueueReport'][_0x32af('0x38')](_0x2409ae);})[_0x32af('0x1f')](function(_0x3f1be1){_0xc7e0e2['rows']=_0x3f1be1;return _0xc7e0e2;})[_0x32af('0x1f')](respondWithFilteredResult(_0x30628a,_0x2409ae))[_0x32af('0x39')](handleError(_0x30628a,null));};exports[_0x32af('0x3a')]=function(_0x3fadc4,_0xbd3cbf){var _0x4bea6e={'raw':!![],'where':{'id':_0x3fadc4[_0x32af('0x3b')]['id']}},_0x144a7d={};_0x144a7d[_0x32af('0x2c')]=_[_0x32af('0x28')](db['MailQueueReport']['rawAttributes']);_0x144a7d[_0x32af('0x27')]=_[_0x32af('0x28')](_0x3fadc4[_0x32af('0x27')]);_0x144a7d[_0x32af('0x29')]=_['intersection'](_0x144a7d[_0x32af('0x2c')],_0x144a7d[_0x32af('0x27')]);_0x4bea6e['attributes']=_[_0x32af('0x2a')](_0x144a7d['model'],qs[_0x32af('0x2d')](_0x3fadc4[_0x32af('0x27')][_0x32af('0x2d')]));_0x4bea6e[_0x32af('0x2b')]=_0x4bea6e[_0x32af('0x2b')][_0x32af('0x2e')]?_0x4bea6e['attributes']:_0x144a7d['model'];if(_0x3fadc4['query'][_0x32af('0x3c')]){_0x4bea6e[_0x32af('0x37')]=[{'all':!![]}];}_0x4bea6e=_[_0x32af('0x34')]({},_0x4bea6e,_0x3fadc4[_0x32af('0x35')]);return db[_0x32af('0x36')][_0x32af('0x3d')](_0x4bea6e)[_0x32af('0x1f')](handleEntityNotFound(_0xbd3cbf,null))[_0x32af('0x1f')](respondWithResult(_0xbd3cbf,null))['catch'](handleError(_0xbd3cbf,null));};exports[_0x32af('0x3e')]=function(_0x1fac1b,_0x4af620){return db['MailQueueReport'][_0x32af('0x3e')](_0x1fac1b[_0x32af('0x3f')],{})[_0x32af('0x1f')](respondWithResult(_0x4af620,0xc9))[_0x32af('0x39')](handleError(_0x4af620,null));};exports[_0x32af('0x1d')]=function(_0x37320d,_0x37676d){if(_0x37320d[_0x32af('0x3f')]['id']){delete _0x37320d[_0x32af('0x3f')]['id'];}return db[_0x32af('0x36')][_0x32af('0x3d')]({'where':{'id':_0x37320d['params']['id']}})[_0x32af('0x1f')](handleEntityNotFound(_0x37676d,null))[_0x32af('0x1f')](saveUpdates(_0x37320d[_0x32af('0x3f')],null))[_0x32af('0x1f')](respondWithResult(_0x37676d,null))[_0x32af('0x39')](handleError(_0x37676d,null));};exports[_0x32af('0x1e')]=function(_0x4456d2,_0x492ad4){return db[_0x32af('0x36')][_0x32af('0x3d')]({'where':{'id':_0x4456d2[_0x32af('0x3b')]['id']}})[_0x32af('0x1f')](handleEntityNotFound(_0x492ad4,null))['then'](removeEntity(_0x492ad4,null))[_0x32af('0x39')](handleError(_0x492ad4,null));};exports[_0x32af('0x40')]=function(_0x133059,_0x2c8795){return db['MailQueueReport'][_0x32af('0x40')]()[_0x32af('0x1f')](respondWithResult(_0x2c8795,null))['catch'](handleError(_0x2c8795,null));};
\ No newline at end of file
+var _0xc012=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','error','stack','index','map','MailQueueReport','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x290806,_0x130b8f){var _0x451b14=function(_0x45cd46){while(--_0x45cd46){_0x290806['push'](_0x290806['shift']());}};_0x451b14(++_0x130b8f);}(_0xc012,0x97));var _0x2c01=function(_0x20de39,_0x371da1){_0x20de39=_0x20de39-0x0;var _0x2ac9eb=_0xc012[_0x20de39];return _0x2ac9eb;};'use strict';var pdf=require(_0x2c01('0x0'));var emlformat=require(_0x2c01('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2c01('0x2'));var jsonpatch=require(_0x2c01('0x3'));var rp=require(_0x2c01('0x4'));var moment=require('moment');var BPromise=require(_0x2c01('0x5'));var Mustache=require(_0x2c01('0x6'));var util=require(_0x2c01('0x7'));var path=require(_0x2c01('0x8'));var sox=require(_0x2c01('0x9'));var csv=require(_0x2c01('0xa'));var ejs=require(_0x2c01('0xb'));var fs=require('fs');var _=require(_0x2c01('0xc'));var squel=require(_0x2c01('0xd'));var crypto=require(_0x2c01('0xe'));var jsforce=require(_0x2c01('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2c01('0x10'));var Papa=require(_0x2c01('0x11'));var Redis=require(_0x2c01('0x12'));var authService=require(_0x2c01('0x13'));var qs=require(_0x2c01('0x14'));var as=require(_0x2c01('0x15'));var hardwareService=require(_0x2c01('0x16'));var logger=require(_0x2c01('0x17'))(_0x2c01('0x18'));var utils=require(_0x2c01('0x19'));var config=require(_0x2c01('0x1a'));var db=require(_0x2c01('0x1b'))['db'];function respondWithStatusCode(_0x46b163,_0x425b51){_0x425b51=_0x425b51||0xcc;return function(_0x3cc5ea){if(_0x3cc5ea){return _0x46b163[_0x2c01('0x1c')](_0x425b51);}return _0x46b163[_0x2c01('0x1d')](_0x425b51)[_0x2c01('0x1e')]();};}function respondWithResult(_0x38aa82,_0x41b3cc){_0x41b3cc=_0x41b3cc||0xc8;return function(_0x206098){if(_0x206098){return _0x38aa82[_0x2c01('0x1d')](_0x41b3cc)[_0x2c01('0x1f')](_0x206098);}};}function respondWithFilteredResult(_0x472bce,_0x4c1c6a){return function(_0x27a079){if(_0x27a079){var _0x458ff9=_0x27a079[_0x2c01('0x20')],_0x47494b=_0x4c1c6a[_0x2c01('0x21')],_0x2ef888=_0x4c1c6a[_0x2c01('0x21')]+_0x4c1c6a[_0x2c01('0x22')],_0xbc37de;if(_0x2ef888>=_0x458ff9){_0x2ef888=_0x458ff9;_0xbc37de=0xc8;}else{_0xbc37de=0xce;}_0x472bce[_0x2c01('0x1d')](_0xbc37de);return _0x472bce[_0x2c01('0x23')](_0x2c01('0x24'),_0x47494b+'-'+_0x2ef888+'/'+_0x458ff9)['json'](_0x27a079);}return null;};}function patchUpdates(_0x1cac42){return function(_0x1c24c3){try{jsonpatch['apply'](_0x1c24c3,_0x1cac42,!![]);}catch(_0x2517b3){return BPromise[_0x2c01('0x25')](_0x2517b3);}return _0x1c24c3['save']();};}function saveUpdates(_0x3b8551,_0x37b66a){return function(_0x5e91e5){if(_0x5e91e5){return _0x5e91e5[_0x2c01('0x26')](_0x3b8551)[_0x2c01('0x27')](function(_0x2f8618){return _0x2f8618;});}return null;};}function removeEntity(_0x5a7f52,_0x51cc09){return function(_0x2596b8){if(_0x2596b8){return _0x2596b8['destroy']()[_0x2c01('0x27')](function(){_0x5a7f52['status'](0xcc)[_0x2c01('0x1e')]();});}};}function handleEntityNotFound(_0x59ecbc,_0x3eb676){return function(_0x3d7a85){if(!_0x3d7a85){_0x59ecbc[_0x2c01('0x1c')](0x194);}return _0x3d7a85;};}function handleError(_0x2970b6,_0x19df7e){_0x19df7e=_0x19df7e||0x1f4;return function(_0x549715){logger[_0x2c01('0x28')](_0x549715[_0x2c01('0x29')]);if(_0x549715['name']){delete _0x549715['name'];}_0x2970b6['status'](_0x19df7e)['send'](_0x549715);};}exports[_0x2c01('0x2a')]=function(_0x460636,_0x11b61a){var _0x1051a2={},_0x16d45b={},_0x53b695={'count':0x0,'rows':[]};var _0x22ff38=_[_0x2c01('0x2b')](db[_0x2c01('0x2c')][_0x2c01('0x2d')],function(_0x3e0075){return{'name':_0x3e0075[_0x2c01('0x2e')],'type':_0x3e0075['type'][_0x2c01('0x2f')]};});_0x16d45b[_0x2c01('0x30')]=_[_0x2c01('0x2b')](_0x22ff38,_0x2c01('0x31'));_0x16d45b[_0x2c01('0x32')]=_[_0x2c01('0x33')](_0x460636[_0x2c01('0x32')]);_0x16d45b[_0x2c01('0x34')]=_[_0x2c01('0x35')](_0x16d45b[_0x2c01('0x30')],_0x16d45b[_0x2c01('0x32')]);_0x1051a2[_0x2c01('0x36')]=_[_0x2c01('0x35')](_0x16d45b[_0x2c01('0x30')],qs[_0x2c01('0x37')](_0x460636[_0x2c01('0x32')][_0x2c01('0x37')]));_0x1051a2[_0x2c01('0x36')]=_0x1051a2[_0x2c01('0x36')][_0x2c01('0x38')]?_0x1051a2[_0x2c01('0x36')]:_0x16d45b[_0x2c01('0x30')];if(!_0x460636[_0x2c01('0x32')][_0x2c01('0x39')](_0x2c01('0x3a'))){_0x1051a2[_0x2c01('0x22')]=qs[_0x2c01('0x22')](_0x460636[_0x2c01('0x32')][_0x2c01('0x22')]);_0x1051a2[_0x2c01('0x21')]=qs[_0x2c01('0x21')](_0x460636[_0x2c01('0x32')]['offset']);}_0x1051a2[_0x2c01('0x3b')]=qs[_0x2c01('0x3c')](_0x460636[_0x2c01('0x32')]['sort']);_0x1051a2['where']=qs['filters'](_['pick'](_0x460636[_0x2c01('0x32')],_0x16d45b[_0x2c01('0x34')]),_0x22ff38);if(_0x460636[_0x2c01('0x32')][_0x2c01('0x3d')]){_0x1051a2[_0x2c01('0x3e')]=_['merge'](_0x1051a2[_0x2c01('0x3e')],{'$or':_[_0x2c01('0x2b')](_0x22ff38,function(_0x214ef6){if(_0x214ef6[_0x2c01('0x3f')]!==_0x2c01('0x40')){var _0x1a4ca1={};_0x1a4ca1[_0x214ef6[_0x2c01('0x31')]]={'$like':'%'+_0x460636[_0x2c01('0x32')][_0x2c01('0x3d')]+'%'};return _0x1a4ca1;}})});}_0x1051a2=_[_0x2c01('0x41')]({},_0x1051a2,_0x460636['options']);var _0x23a7b0={'where':_0x1051a2[_0x2c01('0x3e')]};return db[_0x2c01('0x2c')][_0x2c01('0x20')](_0x23a7b0)[_0x2c01('0x27')](function(_0x5bde06){_0x53b695['count']=_0x5bde06;if(_0x460636['query'][_0x2c01('0x42')]){_0x1051a2[_0x2c01('0x43')]=[{'all':!![]}];}return db[_0x2c01('0x2c')][_0x2c01('0x44')](_0x1051a2);})['then'](function(_0x26cd28){_0x53b695['rows']=_0x26cd28;return _0x53b695;})[_0x2c01('0x27')](respondWithFilteredResult(_0x11b61a,_0x1051a2))[_0x2c01('0x45')](handleError(_0x11b61a,null));};exports[_0x2c01('0x46')]=function(_0x2493d1,_0x5e3e67){var _0xbe281d={'raw':!![],'where':{'id':_0x2493d1[_0x2c01('0x47')]['id']}},_0x158805={};_0x158805['model']=_[_0x2c01('0x33')](db[_0x2c01('0x2c')][_0x2c01('0x2d')]);_0x158805['query']=_[_0x2c01('0x33')](_0x2493d1[_0x2c01('0x32')]);_0x158805[_0x2c01('0x34')]=_['intersection'](_0x158805[_0x2c01('0x30')],_0x158805[_0x2c01('0x32')]);_0xbe281d['attributes']=_['intersection'](_0x158805['model'],qs[_0x2c01('0x37')](_0x2493d1[_0x2c01('0x32')][_0x2c01('0x37')]));_0xbe281d[_0x2c01('0x36')]=_0xbe281d[_0x2c01('0x36')]['length']?_0xbe281d['attributes']:_0x158805[_0x2c01('0x30')];if(_0x2493d1[_0x2c01('0x32')][_0x2c01('0x42')]){_0xbe281d[_0x2c01('0x43')]=[{'all':!![]}];}_0xbe281d=_[_0x2c01('0x41')]({},_0xbe281d,_0x2493d1[_0x2c01('0x48')]);return db[_0x2c01('0x2c')][_0x2c01('0x49')](_0xbe281d)[_0x2c01('0x27')](handleEntityNotFound(_0x5e3e67,null))[_0x2c01('0x27')](respondWithResult(_0x5e3e67,null))[_0x2c01('0x45')](handleError(_0x5e3e67,null));};exports[_0x2c01('0x4a')]=function(_0x58cafa,_0xb67359){return db[_0x2c01('0x2c')][_0x2c01('0x4a')](_0x58cafa['body'],{})[_0x2c01('0x27')](respondWithResult(_0xb67359,0xc9))[_0x2c01('0x45')](handleError(_0xb67359,null));};exports[_0x2c01('0x26')]=function(_0x182312,_0x247977){if(_0x182312[_0x2c01('0x4b')]['id']){delete _0x182312['body']['id'];}return db[_0x2c01('0x2c')]['find']({'where':{'id':_0x182312['params']['id']}})['then'](handleEntityNotFound(_0x247977,null))[_0x2c01('0x27')](saveUpdates(_0x182312[_0x2c01('0x4b')],null))[_0x2c01('0x27')](respondWithResult(_0x247977,null))[_0x2c01('0x45')](handleError(_0x247977,null));};exports[_0x2c01('0x4c')]=function(_0x31190f,_0x1a7ab3){return db['MailQueueReport'][_0x2c01('0x49')]({'where':{'id':_0x31190f[_0x2c01('0x47')]['id']}})[_0x2c01('0x27')](handleEntityNotFound(_0x1a7ab3,null))[_0x2c01('0x27')](removeEntity(_0x1a7ab3,null))[_0x2c01('0x45')](handleError(_0x1a7ab3,null));};exports[_0x2c01('0x4d')]=function(_0x42bef1,_0x3dfc84){return db[_0x2c01('0x2c')][_0x2c01('0x4d')]()[_0x2c01('0x27')](respondWithResult(_0x3dfc84,null))[_0x2c01('0x45')](handleError(_0x3dfc84,null));};
\ No newline at end of file
index 055c409..635e76b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae6e=['util','../../config/logger','api','moment','request-promise','rimraf','MailQueueReport','report_mail_queue','lodash'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xae6e,0x1e5));var _0xeae6=function(_0x31d43b,_0x5f0e72){_0x31d43b=_0x31d43b-0x0;var _0x13ade9=_0xae6e[_0x31d43b];return _0x13ade9;};'use strict';var _=require(_0xeae6('0x0'));var util=require(_0xeae6('0x1'));var logger=require(_0xeae6('0x2'))(_0xeae6('0x3'));var moment=require(_0xeae6('0x4'));var BPromise=require('bluebird');var rp=require(_0xeae6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeae6('0x6'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x1d06ba,_0x33ea23){return _0x1d06ba['define'](_0xeae6('0x7'),attributes,{'tableName':_0xeae6('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcefd=['MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x183bd6,_0x4d25df){var _0x312e61=function(_0x3c5cf2){while(--_0x3c5cf2){_0x183bd6['push'](_0x183bd6['shift']());}};_0x312e61(++_0x4d25df);}(_0xcefd,0x1bd));var _0xdcef=function(_0x46060a,_0x4ed109){_0x46060a=_0x46060a-0x0;var _0x119e5e=_0xcefd[_0x46060a];return _0x119e5e;};'use strict';var _=require('lodash');var util=require(_0xdcef('0x0'));var logger=require(_0xdcef('0x1'))(_0xdcef('0x2'));var moment=require(_0xdcef('0x3'));var BPromise=require(_0xdcef('0x4'));var rp=require(_0xdcef('0x5'));var fs=require('fs');var path=require(_0xdcef('0x6'));var rimraf=require('rimraf');var config=require(_0xdcef('0x7'));var attributes=require(_0xdcef('0x8'));module[_0xdcef('0x9')]=function(_0x373ed9,_0x31c2d4){return _0x373ed9['define'](_0xdcef('0xa'),attributes,{'tableName':_0xdcef('0xb'),'paranoid':![],'indexes':[{'name':_0xdcef('0xc'),'fields':[_0xdcef('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index cb3bf7f..e16c896 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c60=['message','info','catch','CreateMailQueueReport','MailQueueReport','create','raw','update','options','where','attributes','limit','UpdateMailQueueReport','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','MailQueueReport,\x20%s,\x20%s'];(function(_0x32a95f,_0x570c63){var _0x57f14a=function(_0x5d7f25){while(--_0x5d7f25){_0x32a95f['push'](_0x32a95f['shift']());}};_0x57f14a(++_0x570c63);}(_0x4c60,0xc1));var _0x04c6=function(_0x38f422,_0x191484){_0x38f422=_0x38f422-0x0;var _0x5251f1=_0x4c60[_0x38f422];return _0x5251f1;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('MailQueueReport,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});}exports[_0x04c6('0x14')]=function(_0x21674a){var _0x423ea9=this;return new Promise(function(_0x47f400,_0x142065){return db[_0x04c6('0x15')][_0x04c6('0x16')](_0x21674a['body'],{'raw':_0x21674a['options']?_0x21674a['options'][_0x04c6('0x17')]===undefined?!![]:![]:!![]})[_0x04c6('0xa')](function(_0x50dd61){logger['info'](_0x04c6('0x14'),_0x21674a);logger[_0x04c6('0xb')](_0x04c6('0x14'),_0x21674a,JSON['stringify'](_0x50dd61));_0x47f400(_0x50dd61);})[_0x04c6('0x13')](function(_0x13f2dc){logger[_0x04c6('0xe')]('CreateMailQueueReport',_0x13f2dc[_0x04c6('0x11')],_0x21674a);_0x142065(_0x423ea9[_0x04c6('0xe')](0x1f4,_0x13f2dc['message']));});});};exports['UpdateMailQueueReport']=function(_0x4c8d72){var _0x348ea3=this;return new Promise(function(_0x3a2014,_0xd5828d){return db[_0x04c6('0x15')][_0x04c6('0x18')](_0x4c8d72['body'],{'raw':_0x4c8d72['options']?_0x4c8d72[_0x04c6('0x19')][_0x04c6('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c8d72[_0x04c6('0x19')]?_0x4c8d72[_0x04c6('0x19')][_0x04c6('0x1a')]||null:null,'attributes':_0x4c8d72[_0x04c6('0x19')]?_0x4c8d72['options'][_0x04c6('0x1b')]||null:null,'limit':_0x4c8d72[_0x04c6('0x19')]?_0x4c8d72['options'][_0x04c6('0x1c')]||null:null})[_0x04c6('0xa')](function(_0x5f1331){logger['info'](_0x04c6('0x1d'),_0x4c8d72);logger[_0x04c6('0xb')](_0x04c6('0x1d'),_0x4c8d72,JSON[_0x04c6('0xd')](_0x5f1331));_0x3a2014(_0x5f1331);})[_0x04c6('0x13')](function(_0x43884e){logger['error']('UpdateMailQueueReport',_0x43884e['message'],_0x4c8d72);_0xd5828d(_0x348ea3[_0x04c6('0xe')](0x1f4,_0x43884e['message']));});});};
\ No newline at end of file
+var _0xbd51=['MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','stringify','UpdateMailQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','then','info'];(function(_0x4c630b,_0x25f8ef){var _0x181259=function(_0x5d0e58){while(--_0x5d0e58){_0x4c630b['push'](_0x4c630b['shift']());}};_0x181259(++_0x25f8ef);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x1ad90a,_0x1ff3c5){_0x1ad90a=_0x1ad90a-0x0;var _0xcd9bc0=_0xbd51[_0x1ad90a];return _0xcd9bc0;};'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});function respondWithRpcPromise(_0x29abea,_0x30a385,_0x19077c){return new BPromise(function(_0x27d58f,_0xd8418f){return client['request'](_0x29abea,_0x19077c)[_0x1bd5('0x8')](function(_0x5c8e0d){logger[_0x1bd5('0x9')](_0x1bd5('0xa'),_0x30a385,_0x1bd5('0xb'));logger[_0x1bd5('0xc')](_0x1bd5('0xd'),_0x30a385,_0x1bd5('0xb'),JSON['stringify'](_0x5c8e0d));if(_0x5c8e0d[_0x1bd5('0xe')]){if(_0x5c8e0d['error'][_0x1bd5('0xf')]===0x1f4){logger[_0x1bd5('0xe')](_0x1bd5('0xa'),_0x30a385,_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);return _0xd8418f(_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);}logger['error']('MailQueueReport,\x20%s,\x20%s',_0x30a385,_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);return _0x27d58f(_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);}else{logger['info']('MailQueueReport,\x20%s,\x20%s',_0x30a385,_0x1bd5('0xb'));_0x27d58f(_0x5c8e0d[_0x1bd5('0x11')][_0x1bd5('0x10')]);}})[_0x1bd5('0x12')](function(_0x43ea3e){logger[_0x1bd5('0xe')](_0x1bd5('0xa'),_0x30a385,_0x43ea3e);_0xd8418f(_0x43ea3e);});});}exports[_0x1bd5('0x13')]=function(_0x4670b5){var _0x4c1e84=this;return new Promise(function(_0x53ad5e,_0x2fe1a1){return db[_0x1bd5('0x14')][_0x1bd5('0x15')](_0x4670b5[_0x1bd5('0x16')],{'raw':_0x4670b5[_0x1bd5('0x17')]?_0x4670b5[_0x1bd5('0x17')][_0x1bd5('0x18')]===undefined?!![]:![]:!![]})[_0x1bd5('0x8')](function(_0x456051){logger[_0x1bd5('0x9')](_0x1bd5('0x13'),_0x4670b5);logger[_0x1bd5('0xc')](_0x1bd5('0x13'),_0x4670b5,JSON[_0x1bd5('0x19')](_0x456051));_0x53ad5e(_0x456051);})[_0x1bd5('0x12')](function(_0x46c580){logger[_0x1bd5('0xe')](_0x1bd5('0x13'),_0x46c580['message'],_0x4670b5);_0x2fe1a1(_0x4c1e84[_0x1bd5('0xe')](0x1f4,_0x46c580['message']));});});};exports[_0x1bd5('0x1a')]=function(_0x1e534e){var _0x3b6eb8=this;return new Promise(function(_0x48316b,_0x3f4156){return db['MailQueueReport'][_0x1bd5('0x1b')](_0x1e534e[_0x1bd5('0x16')],{'raw':_0x1e534e[_0x1bd5('0x17')]?_0x1e534e[_0x1bd5('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e534e[_0x1bd5('0x17')]?_0x1e534e[_0x1bd5('0x17')][_0x1bd5('0x1c')]||null:null,'attributes':_0x1e534e[_0x1bd5('0x17')]?_0x1e534e['options'][_0x1bd5('0x1d')]||null:null,'limit':_0x1e534e[_0x1bd5('0x17')]?_0x1e534e[_0x1bd5('0x17')][_0x1bd5('0x1e')]||null:null})[_0x1bd5('0x8')](function(_0xc73670){logger['info'](_0x1bd5('0x1a'),_0x1e534e);logger[_0x1bd5('0xc')](_0x1bd5('0x1a'),_0x1e534e,JSON['stringify'](_0xc73670));_0x48316b(_0xc73670);})[_0x1bd5('0x12')](function(_0x32748e){logger[_0x1bd5('0xe')](_0x1bd5('0x1a'),_0x32748e[_0x1bd5('0x10')],_0x1e534e);_0x3f4156(_0x3b6eb8[_0x1bd5('0xe')](0x1f4,_0x32748e['message']));});});};
\ No newline at end of file
index 2114e04..91dd2e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffbc=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2d001e,_0x260961){var _0x14711b=function(_0x3a2764){while(--_0x3a2764){_0x2d001e['push'](_0x2d001e['shift']());}};_0x14711b(++_0x260961);}(_0xffbc,0x118));var _0xcffb=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xffbc[_0x5bd426];return _0x23a7eb;};'use strict';var multer=require(_0xcffb('0x0'));var util=require(_0xcffb('0x1'));var path=require(_0xcffb('0x2'));var timeout=require('connect-timeout');var express=require(_0xcffb('0x3'));var router=express[_0xcffb('0x4')]();var auth=require(_0xcffb('0x5'));var interaction=require(_0xcffb('0x6'));var config=require('../../config/environment');module[_0xcffb('0x7')]=router;
\ No newline at end of file
+var _0xd6cb=['../../components/interaction/service','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x29261a,_0xe38191){var _0x4d3cbe=function(_0xc43528){while(--_0xc43528){_0x29261a['push'](_0x29261a['shift']());}};_0x4d3cbe(++_0xe38191);}(_0xd6cb,0xe6));var _0xbd6c=function(_0x338782,_0x608258){_0x338782=_0x338782-0x0;var _0x3555ee=_0xd6cb[_0x338782];return _0x3555ee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbd6c('0x0'));var timeout=require(_0xbd6c('0x1'));var express=require(_0xbd6c('0x2'));var router=express['Router']();var auth=require(_0xbd6c('0x3'));var interaction=require(_0xbd6c('0x4'));var config=require('../../config/environment');module[_0xbd6c('0x5')]=router;
\ No newline at end of file
index beb15dd..64c7d7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60df=['STRING','BOOLEAN','username','INTEGER','INBOX','exports'];(function(_0x2c1aad,_0x123752){var _0x5ebef9=function(_0x37dbd7){while(--_0x37dbd7){_0x2c1aad['push'](_0x2c1aad['shift']());}};_0x5ebef9(++_0x123752);}(_0x60df,0x1cd));var _0xf60d=function(_0x260783,_0x41d960){_0x260783=_0x260783-0x0;var _0x4b8e90=_0x60df[_0x260783];return _0x4b8e90;};'use strict';var Sequelize=require('sequelize');module[_0xf60d('0x0')]={'description':{'type':Sequelize[_0xf60d('0x1')]},'host':{'type':Sequelize[_0xf60d('0x1')]},'authentication':{'type':Sequelize[_0xf60d('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xf60d('0x1')],'unique':_0xf60d('0x3')},'password':{'type':Sequelize[_0xf60d('0x1')]},'port':{'type':Sequelize[_0xf60d('0x4')]},'tls':{'type':Sequelize[_0xf60d('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xf60d('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf60d('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf60d('0x1')]}};
\ No newline at end of file
+var _0x7814=['STRING','BOOLEAN','username','INBOX','INTEGER','sequelize','exports'];(function(_0x8ce4af,_0x763b2e){var _0x540000=function(_0x51f54b){while(--_0x51f54b){_0x8ce4af['push'](_0x8ce4af['shift']());}};_0x540000(++_0x763b2e);}(_0x7814,0x14e));var _0x4781=function(_0x242361,_0x5f23ba){_0x242361=_0x242361-0x0;var _0x3905ff=_0x7814[_0x242361];return _0x3905ff;};'use strict';var Sequelize=require(_0x4781('0x0'));module[_0x4781('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4781('0x2')]},'authentication':{'type':Sequelize[_0x4781('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0x4781('0x4')},'password':{'type':Sequelize[_0x4781('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x4781('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4781('0x2')],'defaultValue':_0x4781('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x4781('0x6')],'defaultValue':0x5},'service':{'type':Sequelize[_0x4781('0x2')]}};
\ No newline at end of file
index 9c575e4..1d10b1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfe7=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','define','MailServerIn'];(function(_0x4433b,_0x1eded1){var _0xffc1da=function(_0x3d1d18){while(--_0x3d1d18){_0x4433b['push'](_0x4433b['shift']());}};_0xffc1da(++_0x1eded1);}(_0xdfe7,0xc8));var _0x7dfe=function(_0x111b51,_0x4f89f3){_0x111b51=_0x111b51-0x0;var _0x6d6e18=_0xdfe7[_0x111b51];return _0x6d6e18;};'use strict';var _=require('lodash');var util=require(_0x7dfe('0x0'));var logger=require(_0x7dfe('0x1'))('api');var moment=require(_0x7dfe('0x2'));var BPromise=require(_0x7dfe('0x3'));var rp=require(_0x7dfe('0x4'));var fs=require('fs');var path=require(_0x7dfe('0x5'));var rimraf=require('rimraf');var config=require(_0x7dfe('0x6'));var attributes=require(_0x7dfe('0x7'));module['exports']=function(_0x262561,_0x3d8220){return _0x262561[_0x7dfe('0x8')](_0x7dfe('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4cfd=['bluebird','request-promise','path','rimraf','./mailServerIn.attributes','exports','define','MailServerIn','lodash','util','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4cfd,0x170));var _0xd4cf=function(_0x54de5d,_0x1f8b26){_0x54de5d=_0x54de5d-0x0;var _0x1b349e=_0x4cfd[_0x54de5d];return _0x1b349e;};'use strict';var _=require(_0xd4cf('0x0'));var util=require(_0xd4cf('0x1'));var logger=require('../../config/logger')(_0xd4cf('0x2'));var moment=require(_0xd4cf('0x3'));var BPromise=require(_0xd4cf('0x4'));var rp=require(_0xd4cf('0x5'));var fs=require('fs');var path=require(_0xd4cf('0x6'));var rimraf=require(_0xd4cf('0x7'));var config=require('../../config/environment');var attributes=require(_0xd4cf('0x8'));module[_0xd4cf('0x9')]=function(_0x23710d,_0x108507){return _0x23710d[_0xd4cf('0xa')](_0xd4cf('0xb'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c5c45ff..b63ab77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x776c=['MailServerIn,\x20%s,\x20%s','info','result','GetMailServerIn','MailServerIn','findAll','options','raw','limit','include','model','attributes','map','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x24cbe6,_0x4eb905){var _0x4f50cd=function(_0x2e374a){while(--_0x2e374a){_0x24cbe6['push'](_0x24cbe6['shift']());}};_0x4f50cd(++_0x4eb905);}(_0x776c,0x6f));var _0xc776=function(_0x3f7e0a,_0x17f2ee){_0x3f7e0a=_0x3f7e0a-0x0;var _0x3b4d17=_0x776c[_0x3f7e0a];return _0x3b4d17;};'use strict';var _=require(_0xc776('0x0'));var util=require(_0xc776('0x1'));var moment=require(_0xc776('0x2'));var BPromise=require(_0xc776('0x3'));var rs=require(_0xc776('0x4'));var fs=require('fs');var Redis=require(_0xc776('0x5'));var db=require(_0xc776('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc776('0x7'))(_0xc776('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc776('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe6e46f,_0x2f0574,_0x38f132){return new BPromise(function(_0x3c6023,_0xb710c0){return client[_0xc776('0xa')](_0xe6e46f,_0x38f132)[_0xc776('0xb')](function(_0x50b510){logger['info']('MailServerIn,\x20%s,\x20%s',_0x2f0574,_0xc776('0xc'));logger['debug'](_0xc776('0xd'),_0x2f0574,_0xc776('0xc'),JSON[_0xc776('0xe')](_0x50b510));if(_0x50b510[_0xc776('0xf')]){if(_0x50b510[_0xc776('0xf')]['code']===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x2f0574,_0x50b510['error'][_0xc776('0x10')]);return _0xb710c0(_0x50b510[_0xc776('0xf')][_0xc776('0x10')]);}logger[_0xc776('0xf')](_0xc776('0x11'),_0x2f0574,_0x50b510[_0xc776('0xf')][_0xc776('0x10')]);return _0x3c6023(_0x50b510['error'][_0xc776('0x10')]);}else{logger[_0xc776('0x12')](_0xc776('0x11'),_0x2f0574,_0xc776('0xc'));_0x3c6023(_0x50b510[_0xc776('0x13')][_0xc776('0x10')]);}})['catch'](function(_0x2f0b50){logger[_0xc776('0xf')](_0xc776('0x11'),_0x2f0574,_0x2f0b50);_0xb710c0(_0x2f0b50);});});}exports[_0xc776('0x14')]=function(_0x175a98){var _0x35194a=this;return new Promise(function(_0xfb90e9,_0x3a1a44){return db[_0xc776('0x15')][_0xc776('0x16')]({'raw':_0x175a98[_0xc776('0x17')]?_0x175a98['options'][_0xc776('0x18')]===undefined?!![]:![]:!![],'where':_0x175a98['options']?_0x175a98[_0xc776('0x17')]['where']||null:null,'attributes':_0x175a98[_0xc776('0x17')]?_0x175a98[_0xc776('0x17')]['attributes']||null:null,'limit':_0x175a98[_0xc776('0x17')]?_0x175a98[_0xc776('0x17')][_0xc776('0x19')]||null:null,'include':_0x175a98[_0xc776('0x17')]?_0x175a98['options'][_0xc776('0x1a')]?_['map'](_0x175a98['options'][_0xc776('0x1a')],function(_0xae55a3){return{'model':db[_0xae55a3[_0xc776('0x1b')]],'as':_0xae55a3['as'],'attributes':_0xae55a3[_0xc776('0x1c')],'include':_0xae55a3['include']?_[_0xc776('0x1d')](_0xae55a3[_0xc776('0x1a')],function(_0x26f8e5){return{'model':db[_0x26f8e5[_0xc776('0x1b')]],'as':_0x26f8e5['as'],'attributes':_0x26f8e5[_0xc776('0x1c')],'include':_0x26f8e5[_0xc776('0x1a')]?_['map'](_0x26f8e5[_0xc776('0x1a')],function(_0x28c4da){return{'model':db[_0x28c4da[_0xc776('0x1b')]],'as':_0x28c4da['as'],'attributes':_0x28c4da[_0xc776('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc776('0xb')](function(_0x5b6275){logger[_0xc776('0x12')](_0xc776('0x14'),_0x175a98);logger[_0xc776('0x1e')](_0xc776('0x14'),_0x175a98,JSON[_0xc776('0xe')](_0x5b6275));_0xfb90e9(_0x5b6275);})[_0xc776('0x1f')](function(_0x195e9b){logger[_0xc776('0xf')]('GetMailServerIn',_0x195e9b[_0xc776('0x10')],_0x175a98);_0x3a1a44(_0x35194a[_0xc776('0xf')](0x1f4,_0x195e9b['message']));});});};
\ No newline at end of file
+var _0x3acd=['request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','include','model','map','GetMailServerIn','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3acd,0x195));var _0xd3ac=function(_0x58a65e,_0x5d0a0f){_0x58a65e=_0x58a65e-0x0;var _0x5ac81d=_0x3acd[_0x58a65e];return _0x5ac81d;};'use strict';var _=require(_0xd3ac('0x0'));var util=require(_0xd3ac('0x1'));var moment=require(_0xd3ac('0x2'));var BPromise=require(_0xd3ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3ac('0x4'))['db'];var utils=require(_0xd3ac('0x5'));var logger=require(_0xd3ac('0x6'))(_0xd3ac('0x7'));var config=require(_0xd3ac('0x8'));var jayson=require(_0xd3ac('0x9'));var client=jayson[_0xd3ac('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d9bd4,_0x11e474,_0xac45ef){return new BPromise(function(_0x3ffb28,_0x2c569e){return client[_0xd3ac('0xb')](_0x4d9bd4,_0xac45ef)[_0xd3ac('0xc')](function(_0x3274b1){logger[_0xd3ac('0xd')](_0xd3ac('0xe'),_0x11e474,_0xd3ac('0xf'));logger[_0xd3ac('0x10')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x11e474,_0xd3ac('0xf'),JSON[_0xd3ac('0x11')](_0x3274b1));if(_0x3274b1['error']){if(_0x3274b1[_0xd3ac('0x12')][_0xd3ac('0x13')]===0x1f4){logger[_0xd3ac('0x12')](_0xd3ac('0xe'),_0x11e474,_0x3274b1['error'][_0xd3ac('0x14')]);return _0x2c569e(_0x3274b1[_0xd3ac('0x12')]['message']);}logger['error'](_0xd3ac('0xe'),_0x11e474,_0x3274b1[_0xd3ac('0x12')][_0xd3ac('0x14')]);return _0x3ffb28(_0x3274b1[_0xd3ac('0x12')][_0xd3ac('0x14')]);}else{logger[_0xd3ac('0xd')](_0xd3ac('0xe'),_0x11e474,_0xd3ac('0xf'));_0x3ffb28(_0x3274b1[_0xd3ac('0x15')][_0xd3ac('0x14')]);}})[_0xd3ac('0x16')](function(_0x46e77b){logger[_0xd3ac('0x12')](_0xd3ac('0xe'),_0x11e474,_0x46e77b);_0x2c569e(_0x46e77b);});});}exports['GetMailServerIn']=function(_0x4d03ae){var _0x536f5b=this;return new Promise(function(_0x4fc054,_0xaf863a){return db['MailServerIn'][_0xd3ac('0x17')]({'raw':_0x4d03ae[_0xd3ac('0x18')]?_0x4d03ae['options'][_0xd3ac('0x19')]===undefined?!![]:![]:!![],'where':_0x4d03ae[_0xd3ac('0x18')]?_0x4d03ae[_0xd3ac('0x18')][_0xd3ac('0x1a')]||null:null,'attributes':_0x4d03ae['options']?_0x4d03ae[_0xd3ac('0x18')][_0xd3ac('0x1b')]||null:null,'limit':_0x4d03ae['options']?_0x4d03ae['options']['limit']||null:null,'include':_0x4d03ae[_0xd3ac('0x18')]?_0x4d03ae['options']['include']?_['map'](_0x4d03ae[_0xd3ac('0x18')][_0xd3ac('0x1c')],function(_0x4db0a5){return{'model':db[_0x4db0a5[_0xd3ac('0x1d')]],'as':_0x4db0a5['as'],'attributes':_0x4db0a5[_0xd3ac('0x1b')],'include':_0x4db0a5['include']?_[_0xd3ac('0x1e')](_0x4db0a5['include'],function(_0x15bb53){return{'model':db[_0x15bb53[_0xd3ac('0x1d')]],'as':_0x15bb53['as'],'attributes':_0x15bb53['attributes'],'include':_0x15bb53[_0xd3ac('0x1c')]?_[_0xd3ac('0x1e')](_0x15bb53['include'],function(_0x6f184c){return{'model':db[_0x6f184c[_0xd3ac('0x1d')]],'as':_0x6f184c['as'],'attributes':_0x6f184c[_0xd3ac('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd3ac('0xc')](function(_0x39c15c){logger[_0xd3ac('0xd')](_0xd3ac('0x1f'),_0x4d03ae);logger['debug'](_0xd3ac('0x1f'),_0x4d03ae,JSON[_0xd3ac('0x11')](_0x39c15c));_0x4fc054(_0x39c15c);})['catch'](function(_0x526912){logger[_0xd3ac('0x12')]('GetMailServerIn',_0x526912['message'],_0x4d03ae);_0xaf863a(_0x536f5b[_0xd3ac('0x12')](0x1f4,_0x526912['message']));});});};
\ No newline at end of file
index 9c04a16..c37ad83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2412=['show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0x2412,0x139));var _0x2241=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2412[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x2241('0x0'));var util=require(_0x2241('0x1'));var path=require(_0x2241('0x2'));var timeout=require(_0x2241('0x3'));var express=require(_0x2241('0x4'));var router=express['Router']();var auth=require(_0x2241('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2241('0x6'));var controller=require(_0x2241('0x7'));router[_0x2241('0x8')]('/',auth[_0x2241('0x9')](),controller['index']);router[_0x2241('0x8')]('/:id',auth[_0x2241('0x9')](),controller[_0x2241('0xa')]);router[_0x2241('0xb')]('/',auth[_0x2241('0x9')](),controller[_0x2241('0xc')]);router[_0x2241('0xd')](_0x2241('0xe'),auth[_0x2241('0x9')](),controller[_0x2241('0xf')]);router[_0x2241('0x10')](_0x2241('0xe'),auth[_0x2241('0x9')](),controller[_0x2241('0x11')]);module[_0x2241('0x12')]=router;
\ No newline at end of file
+var _0xeb2d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','index','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x44e824,_0x122837){var _0x2829bd=function(_0xfe4c1f){while(--_0xfe4c1f){_0x44e824['push'](_0x44e824['shift']());}};_0x2829bd(++_0x122837);}(_0xeb2d,0xb0));var _0xdeb2=function(_0x521b68,_0x2338f1){_0x521b68=_0x521b68-0x0;var _0x21a028=_0xeb2d[_0x521b68];return _0x21a028;};'use strict';var multer=require('multer');var util=require(_0xdeb2('0x0'));var path=require('path');var timeout=require(_0xdeb2('0x1'));var express=require(_0xdeb2('0x2'));var router=express[_0xdeb2('0x3')]();var auth=require(_0xdeb2('0x4'));var interaction=require(_0xdeb2('0x5'));var config=require(_0xdeb2('0x6'));var controller=require(_0xdeb2('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xdeb2('0x8')]);router[_0xdeb2('0x9')](_0xdeb2('0xa'),auth[_0xdeb2('0xb')](),controller[_0xdeb2('0xc')]);router[_0xdeb2('0xd')]('/',auth[_0xdeb2('0xb')](),controller['create']);router[_0xdeb2('0xe')]('/:id',auth[_0xdeb2('0xb')](),controller['update']);router[_0xdeb2('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xdeb2('0x10')]);module[_0xdeb2('0x11')]=router;
\ No newline at end of file
index c85ec2f..578ee8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0272=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x36346c,_0x2b472e){var _0x103e5e=function(_0x379f5f){while(--_0x379f5f){_0x36346c['push'](_0x36346c['shift']());}};_0x103e5e(++_0x2b472e);}(_0x0272,0x15a));var _0x2027=function(_0x5bab39,_0x33db83){_0x5bab39=_0x5bab39-0x0;var _0x40305e=_0x0272[_0x5bab39];return _0x40305e;};'use strict';var Sequelize=require(_0x2027('0x0'));module[_0x2027('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x2027('0x2')]},'user':{'type':Sequelize[_0x2027('0x2')]},'pass':{'type':Sequelize[_0x2027('0x2')]},'port':{'type':Sequelize[_0x2027('0x3')]},'secure':{'type':Sequelize[_0x2027('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x2027('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xa93a=['STRING','BOOLEAN'];(function(_0x38db3a,_0x244702){var _0x2ead95=function(_0x558eab){while(--_0x558eab){_0x38db3a['push'](_0x38db3a['shift']());}};_0x2ead95(++_0x244702);}(_0xa93a,0xb8));var _0xaa93=function(_0x311f9d,_0x11409c){_0x311f9d=_0x311f9d-0x0;var _0x26e524=_0xa93a[_0x311f9d];return _0x26e524;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xaa93('0x0')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xaa93('0x0')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xaa93('0x1')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xaa93('0x1')],'defaultValue':!![]}};
\ No newline at end of file
index f181e8f..f3d93f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f8a=['json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','MailServerOut','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','keys','include','find','catch','create','body','destroy','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','sox','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x9f8a,0x185));var _0xa9f8=function(_0xae9024,_0x17f58e){_0xae9024=_0xae9024-0x0;var _0x23e7d3=_0x9f8a[_0xae9024];return _0x23e7d3;};'use strict';var pdf=require(_0xa9f8('0x0'));var emlformat=require(_0xa9f8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa9f8('0x2'));var rp=require(_0xa9f8('0x3'));var moment=require('moment');var BPromise=require(_0xa9f8('0x4'));var Mustache=require(_0xa9f8('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa9f8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa9f8('0x7'));var crypto=require('crypto');var jsforce=require(_0xa9f8('0x8'));var deskjs=require(_0xa9f8('0x9'));var toCsv=require(_0xa9f8('0xa'));var querystring=require(_0xa9f8('0xb'));var Papa=require(_0xa9f8('0xc'));var Redis=require(_0xa9f8('0xd'));var authService=require(_0xa9f8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa9f8('0xf'));var hardwareService=require(_0xa9f8('0x10'));var logger=require(_0xa9f8('0x11'))(_0xa9f8('0x12'));var utils=require(_0xa9f8('0x13'));var config=require(_0xa9f8('0x14'));var db=require(_0xa9f8('0x15'))['db'];function respondWithStatusCode(_0x6d3ffb,_0x2ed55e){_0x2ed55e=_0x2ed55e||0xcc;return function(_0x349189){if(_0x349189){return _0x6d3ffb[_0xa9f8('0x16')](_0x2ed55e);}return _0x6d3ffb[_0xa9f8('0x17')](_0x2ed55e)[_0xa9f8('0x18')]();};}function respondWithResult(_0x637a2a,_0x8285c3){_0x8285c3=_0x8285c3||0xc8;return function(_0x29ee07){if(_0x29ee07){return _0x637a2a['status'](_0x8285c3)[_0xa9f8('0x19')](_0x29ee07);}};}function respondWithFilteredResult(_0xb533cc,_0x537aaf){return function(_0x144dff){if(_0x144dff){var _0x19325a=_0x144dff[_0xa9f8('0x1a')],_0x390d19=_0x537aaf[_0xa9f8('0x1b')],_0x3c8b77=_0x537aaf[_0xa9f8('0x1b')]+_0x537aaf[_0xa9f8('0x1c')],_0x1778d4;if(_0x3c8b77>=_0x19325a){_0x3c8b77=_0x19325a;_0x1778d4=0xc8;}else{_0x1778d4=0xce;}_0xb533cc[_0xa9f8('0x17')](_0x1778d4);return _0xb533cc[_0xa9f8('0x1d')]('Content-Range',_0x390d19+'-'+_0x3c8b77+'/'+_0x19325a)[_0xa9f8('0x19')](_0x144dff);}return null;};}function patchUpdates(_0xad11ae){return function(_0x593ed1){try{jsonpatch[_0xa9f8('0x1e')](_0x593ed1,_0xad11ae,!![]);}catch(_0x8cebd9){return BPromise[_0xa9f8('0x1f')](_0x8cebd9);}return _0x593ed1[_0xa9f8('0x20')]();};}function saveUpdates(_0x5962c1,_0x3b620f){return function(_0x29558){if(_0x29558){return _0x29558[_0xa9f8('0x21')](_0x5962c1)[_0xa9f8('0x22')](function(_0x4a45d9){return _0x4a45d9;});}return null;};}function removeEntity(_0x3132ff,_0x4e48ae){return function(_0x24204f){if(_0x24204f){return _0x24204f['destroy']()['then'](function(){_0x3132ff[_0xa9f8('0x17')](0xcc)[_0xa9f8('0x18')]();});}};}function handleEntityNotFound(_0x48a693,_0x15b7a6){return function(_0x333251){if(!_0x333251){_0x48a693[_0xa9f8('0x16')](0x194);}return _0x333251;};}function handleError(_0x131408,_0x4fbf34){_0x4fbf34=_0x4fbf34||0x1f4;return function(_0x2f8403){logger[_0xa9f8('0x23')](_0x2f8403[_0xa9f8('0x24')]);if(_0x2f8403[_0xa9f8('0x25')]){delete _0x2f8403['name'];}_0x131408['status'](_0x4fbf34)[_0xa9f8('0x26')](_0x2f8403);};}exports['index']=function(_0x267459,_0xceca31){var _0x93cf88={},_0x139de2={},_0x2b84a1={'count':0x0,'rows':[]};var _0x5f5b76=_['map'](db[_0xa9f8('0x27')][_0xa9f8('0x28')],function(_0xd6bb29){return{'name':_0xd6bb29['fieldName'],'type':_0xd6bb29[_0xa9f8('0x29')][_0xa9f8('0x2a')]};});_0x139de2[_0xa9f8('0x2b')]=_['map'](_0x5f5b76,_0xa9f8('0x25'));_0x139de2[_0xa9f8('0x2c')]=_['keys'](_0x267459['query']);_0x139de2[_0xa9f8('0x2d')]=_[_0xa9f8('0x2e')](_0x139de2[_0xa9f8('0x2b')],_0x139de2['query']);_0x93cf88['attributes']=_[_0xa9f8('0x2e')](_0x139de2[_0xa9f8('0x2b')],qs['fields'](_0x267459[_0xa9f8('0x2c')][_0xa9f8('0x2f')]));_0x93cf88[_0xa9f8('0x30')]=_0x93cf88[_0xa9f8('0x30')][_0xa9f8('0x31')]?_0x93cf88[_0xa9f8('0x30')]:_0x139de2['model'];if(!_0x267459['query'][_0xa9f8('0x32')]('nolimit')){_0x93cf88[_0xa9f8('0x1c')]=qs[_0xa9f8('0x1c')](_0x267459[_0xa9f8('0x2c')][_0xa9f8('0x1c')]);_0x93cf88[_0xa9f8('0x1b')]=qs[_0xa9f8('0x1b')](_0x267459[_0xa9f8('0x2c')]['offset']);}_0x93cf88[_0xa9f8('0x33')]=qs['sort'](_0x267459[_0xa9f8('0x2c')][_0xa9f8('0x34')]);_0x93cf88[_0xa9f8('0x35')]=qs[_0xa9f8('0x2d')](_['pick'](_0x267459[_0xa9f8('0x2c')],_0x139de2[_0xa9f8('0x2d')]),_0x5f5b76);if(_0x267459[_0xa9f8('0x2c')][_0xa9f8('0x36')]){_0x93cf88[_0xa9f8('0x35')]=_['merge'](_0x93cf88[_0xa9f8('0x35')],{'$or':_['map'](_0x5f5b76,function(_0x139890){if(_0x139890['type']!==_0xa9f8('0x37')){var _0x2ecbeb={};_0x2ecbeb[_0x139890[_0xa9f8('0x25')]]={'$like':'%'+_0x267459[_0xa9f8('0x2c')][_0xa9f8('0x36')]+'%'};return _0x2ecbeb;}})});}_0x93cf88=_[_0xa9f8('0x38')]({},_0x93cf88,_0x267459['options']);var _0x1ae8d4={'where':_0x93cf88[_0xa9f8('0x35')]};return db['MailServerOut'][_0xa9f8('0x1a')](_0x1ae8d4)[_0xa9f8('0x22')](function(_0x50ffd6){_0x2b84a1[_0xa9f8('0x1a')]=_0x50ffd6;if(_0x267459[_0xa9f8('0x2c')][_0xa9f8('0x39')]){_0x93cf88['include']=[{'all':!![]}];}return db['MailServerOut'][_0xa9f8('0x3a')](_0x93cf88);})[_0xa9f8('0x22')](function(_0x5ef8d3){_0x2b84a1[_0xa9f8('0x3b')]=_0x5ef8d3;return _0x2b84a1;})[_0xa9f8('0x22')](respondWithFilteredResult(_0xceca31,_0x93cf88))['catch'](handleError(_0xceca31,null));};exports[_0xa9f8('0x3c')]=function(_0x3d4026,_0x1a4a6e){var _0x2f78ac={'raw':!![],'where':{'id':_0x3d4026[_0xa9f8('0x3d')]['id']}},_0x3e86f7={};_0x3e86f7['model']=_[_0xa9f8('0x3e')](db[_0xa9f8('0x27')][_0xa9f8('0x28')]);_0x3e86f7['query']=_[_0xa9f8('0x3e')](_0x3d4026[_0xa9f8('0x2c')]);_0x3e86f7[_0xa9f8('0x2d')]=_['intersection'](_0x3e86f7[_0xa9f8('0x2b')],_0x3e86f7['query']);_0x2f78ac[_0xa9f8('0x30')]=_[_0xa9f8('0x2e')](_0x3e86f7['model'],qs[_0xa9f8('0x2f')](_0x3d4026['query']['fields']));_0x2f78ac['attributes']=_0x2f78ac['attributes'][_0xa9f8('0x31')]?_0x2f78ac[_0xa9f8('0x30')]:_0x3e86f7['model'];if(_0x3d4026['query'][_0xa9f8('0x39')]){_0x2f78ac[_0xa9f8('0x3f')]=[{'all':!![]}];}_0x2f78ac=_[_0xa9f8('0x38')]({},_0x2f78ac,_0x3d4026['options']);return db[_0xa9f8('0x27')][_0xa9f8('0x40')](_0x2f78ac)[_0xa9f8('0x22')](handleEntityNotFound(_0x1a4a6e,null))[_0xa9f8('0x22')](respondWithResult(_0x1a4a6e,null))[_0xa9f8('0x41')](handleError(_0x1a4a6e,null));};exports[_0xa9f8('0x42')]=function(_0x51a489,_0x2cd484){return db[_0xa9f8('0x27')][_0xa9f8('0x42')](_0x51a489[_0xa9f8('0x43')],{})[_0xa9f8('0x22')](respondWithResult(_0x2cd484,0xc9))[_0xa9f8('0x41')](handleError(_0x2cd484,null));};exports[_0xa9f8('0x21')]=function(_0x2a1d7f,_0x1ce38e){if(_0x2a1d7f['body']['id']){delete _0x2a1d7f[_0xa9f8('0x43')]['id'];}return db[_0xa9f8('0x27')]['find']({'where':{'id':_0x2a1d7f[_0xa9f8('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1ce38e,null))[_0xa9f8('0x22')](saveUpdates(_0x2a1d7f[_0xa9f8('0x43')],null))[_0xa9f8('0x22')](respondWithResult(_0x1ce38e,null))[_0xa9f8('0x41')](handleError(_0x1ce38e,null));};exports[_0xa9f8('0x44')]=function(_0x30ef96,_0x3c40df){return db[_0xa9f8('0x27')][_0xa9f8('0x40')]({'where':{'id':_0x30ef96['params']['id']}})[_0xa9f8('0x22')](handleEntityNotFound(_0x3c40df,null))[_0xa9f8('0x22')](removeEntity(_0x3c40df,null))['catch'](handleError(_0x3c40df,null));};
\ No newline at end of file
+var _0xeb8d=['create','body','catch','params','destroy','html-pdf','eml-format','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','error','name','MailServerOut','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','show','find'];(function(_0x233fd3,_0x28adf9){var _0x2fd00e=function(_0x5e1a67){while(--_0x5e1a67){_0x233fd3['push'](_0x233fd3['shift']());}};_0x2fd00e(++_0x28adf9);}(_0xeb8d,0x89));var _0xdeb8=function(_0x192d1a,_0x3e7389){_0x192d1a=_0x192d1a-0x0;var _0xef435d=_0xeb8d[_0x192d1a];return _0xef435d;};'use strict';var pdf=require(_0xdeb8('0x0'));var emlformat=require(_0xdeb8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdeb8('0x2'));var rp=require('request-promise');var moment=require(_0xdeb8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdeb8('0x4'));var util=require('util');var path=require(_0xdeb8('0x5'));var sox=require('sox');var csv=require(_0xdeb8('0x6'));var ejs=require(_0xdeb8('0x7'));var fs=require('fs');var _=require(_0xdeb8('0x8'));var squel=require('squel');var crypto=require(_0xdeb8('0x9'));var jsforce=require(_0xdeb8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xdeb8('0x6'));var querystring=require('querystring');var Papa=require(_0xdeb8('0xb'));var Redis=require(_0xdeb8('0xc'));var authService=require(_0xdeb8('0xd'));var qs=require(_0xdeb8('0xe'));var as=require(_0xdeb8('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdeb8('0x10'))(_0xdeb8('0x11'));var utils=require('../../config/utils');var config=require(_0xdeb8('0x12'));var db=require(_0xdeb8('0x13'))['db'];function respondWithStatusCode(_0x2fc7b1,_0xe4c925){_0xe4c925=_0xe4c925||0xcc;return function(_0x4bd2cf){if(_0x4bd2cf){return _0x2fc7b1[_0xdeb8('0x14')](_0xe4c925);}return _0x2fc7b1['status'](_0xe4c925)[_0xdeb8('0x15')]();};}function respondWithResult(_0x2f9dc7,_0x44fd04){_0x44fd04=_0x44fd04||0xc8;return function(_0x32079b){if(_0x32079b){return _0x2f9dc7['status'](_0x44fd04)[_0xdeb8('0x16')](_0x32079b);}};}function respondWithFilteredResult(_0x30b4b5,_0x2aabd5){return function(_0x5cf641){if(_0x5cf641){var _0x5ae59a=_0x5cf641[_0xdeb8('0x17')],_0x3b84f7=_0x2aabd5['offset'],_0x4246c7=_0x2aabd5[_0xdeb8('0x18')]+_0x2aabd5[_0xdeb8('0x19')],_0x55c683;if(_0x4246c7>=_0x5ae59a){_0x4246c7=_0x5ae59a;_0x55c683=0xc8;}else{_0x55c683=0xce;}_0x30b4b5['status'](_0x55c683);return _0x30b4b5[_0xdeb8('0x1a')](_0xdeb8('0x1b'),_0x3b84f7+'-'+_0x4246c7+'/'+_0x5ae59a)[_0xdeb8('0x16')](_0x5cf641);}return null;};}function patchUpdates(_0x2922de){return function(_0x10461e){try{jsonpatch[_0xdeb8('0x1c')](_0x10461e,_0x2922de,!![]);}catch(_0x296e02){return BPromise[_0xdeb8('0x1d')](_0x296e02);}return _0x10461e['save']();};}function saveUpdates(_0x53f7da,_0x2f45c0){return function(_0x487ce0){if(_0x487ce0){return _0x487ce0[_0xdeb8('0x1e')](_0x53f7da)[_0xdeb8('0x1f')](function(_0x2e851e){return _0x2e851e;});}return null;};}function removeEntity(_0x37c831,_0x44adfd){return function(_0x1a00ec){if(_0x1a00ec){return _0x1a00ec['destroy']()[_0xdeb8('0x1f')](function(){_0x37c831['status'](0xcc)[_0xdeb8('0x15')]();});}};}function handleEntityNotFound(_0xaa197,_0x5e6ced){return function(_0x1b9ebb){if(!_0x1b9ebb){_0xaa197[_0xdeb8('0x14')](0x194);}return _0x1b9ebb;};}function handleError(_0x5b1204,_0x5f0069){_0x5f0069=_0x5f0069||0x1f4;return function(_0x2bc0c7){logger[_0xdeb8('0x20')](_0x2bc0c7['stack']);if(_0x2bc0c7[_0xdeb8('0x21')]){delete _0x2bc0c7[_0xdeb8('0x21')];}_0x5b1204['status'](_0x5f0069)['send'](_0x2bc0c7);};}exports['index']=function(_0x1e8577,_0x3ecd00){var _0x3e19e5={},_0x132229={},_0x27d939={'count':0x0,'rows':[]};var _0x5c8d5d=_['map'](db[_0xdeb8('0x22')][_0xdeb8('0x23')],function(_0x2098d0){return{'name':_0x2098d0[_0xdeb8('0x24')],'type':_0x2098d0['type'][_0xdeb8('0x25')]};});_0x132229['model']=_['map'](_0x5c8d5d,_0xdeb8('0x21'));_0x132229['query']=_[_0xdeb8('0x26')](_0x1e8577[_0xdeb8('0x27')]);_0x132229[_0xdeb8('0x28')]=_[_0xdeb8('0x29')](_0x132229[_0xdeb8('0x2a')],_0x132229[_0xdeb8('0x27')]);_0x3e19e5[_0xdeb8('0x2b')]=_[_0xdeb8('0x29')](_0x132229[_0xdeb8('0x2a')],qs[_0xdeb8('0x2c')](_0x1e8577[_0xdeb8('0x27')][_0xdeb8('0x2c')]));_0x3e19e5[_0xdeb8('0x2b')]=_0x3e19e5[_0xdeb8('0x2b')][_0xdeb8('0x2d')]?_0x3e19e5[_0xdeb8('0x2b')]:_0x132229[_0xdeb8('0x2a')];if(!_0x1e8577[_0xdeb8('0x27')][_0xdeb8('0x2e')](_0xdeb8('0x2f'))){_0x3e19e5['limit']=qs[_0xdeb8('0x19')](_0x1e8577[_0xdeb8('0x27')]['limit']);_0x3e19e5['offset']=qs[_0xdeb8('0x18')](_0x1e8577[_0xdeb8('0x27')][_0xdeb8('0x18')]);}_0x3e19e5[_0xdeb8('0x30')]=qs[_0xdeb8('0x31')](_0x1e8577[_0xdeb8('0x27')][_0xdeb8('0x31')]);_0x3e19e5['where']=qs[_0xdeb8('0x28')](_[_0xdeb8('0x32')](_0x1e8577[_0xdeb8('0x27')],_0x132229[_0xdeb8('0x28')]),_0x5c8d5d);if(_0x1e8577[_0xdeb8('0x27')][_0xdeb8('0x33')]){_0x3e19e5[_0xdeb8('0x34')]=_[_0xdeb8('0x35')](_0x3e19e5[_0xdeb8('0x34')],{'$or':_[_0xdeb8('0x36')](_0x5c8d5d,function(_0x997302){if(_0x997302['type']!==_0xdeb8('0x37')){var _0x31fad9={};_0x31fad9[_0x997302[_0xdeb8('0x21')]]={'$like':'%'+_0x1e8577[_0xdeb8('0x27')][_0xdeb8('0x33')]+'%'};return _0x31fad9;}})});}_0x3e19e5=_[_0xdeb8('0x35')]({},_0x3e19e5,_0x1e8577[_0xdeb8('0x38')]);var _0x4519a0={'where':_0x3e19e5['where']};return db[_0xdeb8('0x22')]['count'](_0x4519a0)[_0xdeb8('0x1f')](function(_0x339cf2){_0x27d939['count']=_0x339cf2;if(_0x1e8577[_0xdeb8('0x27')][_0xdeb8('0x39')]){_0x3e19e5[_0xdeb8('0x3a')]=[{'all':!![]}];}return db[_0xdeb8('0x22')]['findAll'](_0x3e19e5);})[_0xdeb8('0x1f')](function(_0x9784c4){_0x27d939['rows']=_0x9784c4;return _0x27d939;})['then'](respondWithFilteredResult(_0x3ecd00,_0x3e19e5))['catch'](handleError(_0x3ecd00,null));};exports[_0xdeb8('0x3b')]=function(_0x3dfd1d,_0x10ad3b){var _0x1b2759={'raw':!![],'where':{'id':_0x3dfd1d['params']['id']}},_0x425ee6={};_0x425ee6['model']=_[_0xdeb8('0x26')](db[_0xdeb8('0x22')][_0xdeb8('0x23')]);_0x425ee6['query']=_[_0xdeb8('0x26')](_0x3dfd1d['query']);_0x425ee6[_0xdeb8('0x28')]=_[_0xdeb8('0x29')](_0x425ee6[_0xdeb8('0x2a')],_0x425ee6[_0xdeb8('0x27')]);_0x1b2759['attributes']=_[_0xdeb8('0x29')](_0x425ee6['model'],qs['fields'](_0x3dfd1d[_0xdeb8('0x27')][_0xdeb8('0x2c')]));_0x1b2759['attributes']=_0x1b2759[_0xdeb8('0x2b')][_0xdeb8('0x2d')]?_0x1b2759['attributes']:_0x425ee6[_0xdeb8('0x2a')];if(_0x3dfd1d[_0xdeb8('0x27')]['includeAll']){_0x1b2759['include']=[{'all':!![]}];}_0x1b2759=_[_0xdeb8('0x35')]({},_0x1b2759,_0x3dfd1d[_0xdeb8('0x38')]);return db['MailServerOut'][_0xdeb8('0x3c')](_0x1b2759)[_0xdeb8('0x1f')](handleEntityNotFound(_0x10ad3b,null))[_0xdeb8('0x1f')](respondWithResult(_0x10ad3b,null))['catch'](handleError(_0x10ad3b,null));};exports[_0xdeb8('0x3d')]=function(_0xe4989,_0x54738f){return db['MailServerOut'][_0xdeb8('0x3d')](_0xe4989[_0xdeb8('0x3e')],{})['then'](respondWithResult(_0x54738f,0xc9))[_0xdeb8('0x3f')](handleError(_0x54738f,null));};exports[_0xdeb8('0x1e')]=function(_0x32a928,_0xf53e3f){if(_0x32a928[_0xdeb8('0x3e')]['id']){delete _0x32a928[_0xdeb8('0x3e')]['id'];}return db[_0xdeb8('0x22')][_0xdeb8('0x3c')]({'where':{'id':_0x32a928[_0xdeb8('0x40')]['id']}})[_0xdeb8('0x1f')](handleEntityNotFound(_0xf53e3f,null))[_0xdeb8('0x1f')](saveUpdates(_0x32a928[_0xdeb8('0x3e')],null))[_0xdeb8('0x1f')](respondWithResult(_0xf53e3f,null))[_0xdeb8('0x3f')](handleError(_0xf53e3f,null));};exports[_0xdeb8('0x41')]=function(_0x413b82,_0x5531ed){return db[_0xdeb8('0x22')]['find']({'where':{'id':_0x413b82[_0xdeb8('0x40')]['id']}})[_0xdeb8('0x1f')](handleEntityNotFound(_0x5531ed,null))[_0xdeb8('0x1f')](removeEntity(_0x5531ed,null))[_0xdeb8('0x3f')](handleError(_0x5531ed,null));};
\ No newline at end of file
index 3321c5e..e13379b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ac6=['MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x204fef,_0xd3e3f0){var _0x11a28d=function(_0x4eea9a){while(--_0x4eea9a){_0x204fef['push'](_0x204fef['shift']());}};_0x11a28d(++_0xd3e3f0);}(_0x9ac6,0xab));var _0x69ac=function(_0x4e9884,_0x193af3){_0x4e9884=_0x4e9884-0x0;var _0x461a20=_0x9ac6[_0x4e9884];return _0x461a20;};'use strict';var _=require(_0x69ac('0x0'));var util=require(_0x69ac('0x1'));var logger=require(_0x69ac('0x2'))(_0x69ac('0x3'));var moment=require(_0x69ac('0x4'));var BPromise=require('bluebird');var rp=require(_0x69ac('0x5'));var fs=require('fs');var path=require(_0x69ac('0x6'));var rimraf=require(_0x69ac('0x7'));var config=require(_0x69ac('0x8'));var attributes=require(_0x69ac('0x9'));module[_0x69ac('0xa')]=function(_0x4a351e,_0x53e32e){return _0x4a351e['define'](_0x69ac('0xb'),attributes,{'tableName':_0x69ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa744=['rimraf','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x420c21,_0x4d7fba){var _0x5e4a6d=function(_0x1fb7a7){while(--_0x1fb7a7){_0x420c21['push'](_0x420c21['shift']());}};_0x5e4a6d(++_0x4d7fba);}(_0xa744,0x16d));var _0x4a74=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa744[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x4a74('0x0'));var util=require(_0x4a74('0x1'));var logger=require(_0x4a74('0x2'))(_0x4a74('0x3'));var moment=require(_0x4a74('0x4'));var BPromise=require(_0x4a74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a74('0x6'));var rimraf=require(_0x4a74('0x7'));var config=require('../../config/environment');var attributes=require(_0x4a74('0x8'));module['exports']=function(_0x2b1bf1,_0x702cce){return _0x2b1bf1[_0x4a74('0x9')](_0x4a74('0xa'),attributes,{'tableName':_0x4a74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9f6871d..86673de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7393=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2a40b3,_0xe1c253){var _0x4ac6cb=function(_0x5083fe){while(--_0x5083fe){_0x2a40b3['push'](_0x2a40b3['shift']());}};_0x4ac6cb(++_0xe1c253);}(_0x7393,0x85));var _0x3739=function(_0x35f7c8,_0x162e2e){_0x35f7c8=_0x35f7c8-0x0;var _0x49682c=_0x7393[_0x35f7c8];return _0x49682c;};'use strict';var _=require(_0x3739('0x0'));var util=require(_0x3739('0x1'));var moment=require(_0x3739('0x2'));var BPromise=require(_0x3739('0x3'));var rs=require(_0x3739('0x4'));var fs=require('fs');var Redis=require(_0x3739('0x5'));var db=require(_0x3739('0x6'))['db'];var utils=require(_0x3739('0x7'));var logger=require(_0x3739('0x8'))('rpc');var config=require(_0x3739('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3739('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x404027,_0xbe6a62,_0x3424af){return new BPromise(function(_0x2bb7a8,_0x422a1f){return client['request'](_0x404027,_0x3424af)[_0x3739('0xb')](function(_0x4b760b){logger[_0x3739('0xc')](_0x3739('0xd'),_0xbe6a62,_0x3739('0xe'));logger['debug'](_0x3739('0xf'),_0xbe6a62,_0x3739('0xe'),JSON[_0x3739('0x10')](_0x4b760b));if(_0x4b760b['error']){if(_0x4b760b[_0x3739('0x11')][_0x3739('0x12')]===0x1f4){logger['error'](_0x3739('0xd'),_0xbe6a62,_0x4b760b[_0x3739('0x11')][_0x3739('0x13')]);return _0x422a1f(_0x4b760b['error'][_0x3739('0x13')]);}logger['error']('MailServerOut,\x20%s,\x20%s',_0xbe6a62,_0x4b760b[_0x3739('0x11')][_0x3739('0x13')]);return _0x2bb7a8(_0x4b760b[_0x3739('0x11')][_0x3739('0x13')]);}else{logger[_0x3739('0xc')](_0x3739('0xd'),_0xbe6a62,'request\x20sent');_0x2bb7a8(_0x4b760b[_0x3739('0x14')]['message']);}})[_0x3739('0x15')](function(_0x217268){logger[_0x3739('0x11')](_0x3739('0xd'),_0xbe6a62,_0x217268);_0x422a1f(_0x217268);});});}
\ No newline at end of file
+var _0x56e9=['MailServerOut,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x4754fb,_0x47fdd1){var _0x48b29d=function(_0x86111){while(--_0x86111){_0x4754fb['push'](_0x4754fb['shift']());}};_0x48b29d(++_0x47fdd1);}(_0x56e9,0xe4));var _0x956e=function(_0x1846b8,_0x5e9fd2){_0x1846b8=_0x1846b8-0x0;var _0x5d29ea=_0x56e9[_0x1846b8];return _0x5d29ea;};'use strict';var _=require(_0x956e('0x0'));var util=require(_0x956e('0x1'));var moment=require(_0x956e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x956e('0x3'));var db=require(_0x956e('0x4'))['db'];var utils=require(_0x956e('0x5'));var logger=require(_0x956e('0x6'))('rpc');var config=require(_0x956e('0x7'));var jayson=require(_0x956e('0x8'));var client=jayson['client'][_0x956e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5120a3,_0x4ec9ad,_0x5385b4){return new BPromise(function(_0x4fb76f,_0x1215e3){return client[_0x956e('0xa')](_0x5120a3,_0x5385b4)[_0x956e('0xb')](function(_0x326f4e){logger['info'](_0x956e('0xc'),_0x4ec9ad,_0x956e('0xd'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0x4ec9ad,_0x956e('0xd'),JSON[_0x956e('0xe')](_0x326f4e));if(_0x326f4e[_0x956e('0xf')]){if(_0x326f4e[_0x956e('0xf')][_0x956e('0x10')]===0x1f4){logger[_0x956e('0xf')](_0x956e('0xc'),_0x4ec9ad,_0x326f4e[_0x956e('0xf')][_0x956e('0x11')]);return _0x1215e3(_0x326f4e['error']['message']);}logger[_0x956e('0xf')]('MailServerOut,\x20%s,\x20%s',_0x4ec9ad,_0x326f4e[_0x956e('0xf')][_0x956e('0x11')]);return _0x4fb76f(_0x326f4e['error'][_0x956e('0x11')]);}else{logger['info'](_0x956e('0xc'),_0x4ec9ad,_0x956e('0xd'));_0x4fb76f(_0x326f4e[_0x956e('0x12')][_0x956e('0x11')]);}})[_0x956e('0x13')](function(_0x12e8b5){logger[_0x956e('0xf')]('MailServerOut,\x20%s,\x20%s',_0x4ec9ad,_0x12e8b5);_0x1215e3(_0x12e8b5);});});}
\ No newline at end of file
index c8faa44..f318f68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86eb=['create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','/describe','get','/:id','show','post'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x86eb,0x116));var _0xb86e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x86eb[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xb86e('0x0'));var path=require(_0xb86e('0x1'));var timeout=require(_0xb86e('0x2'));var express=require(_0xb86e('0x3'));var router=express[_0xb86e('0x4')]();var auth=require(_0xb86e('0x5'));var interaction=require(_0xb86e('0x6'));var config=require(_0xb86e('0x7'));var controller=require(_0xb86e('0x8'));router['get']('/',auth[_0xb86e('0x9')](),controller[_0xb86e('0xa')]);router['get'](_0xb86e('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xb86e('0xc')](_0xb86e('0xd'),auth[_0xb86e('0x9')](),controller[_0xb86e('0xe')]);router[_0xb86e('0xf')]('/',auth['isAuthenticated'](),controller[_0xb86e('0x10')]);router[_0xb86e('0x11')](_0xb86e('0xd'),auth[_0xb86e('0x9')](),controller['update']);router[_0xb86e('0x12')](_0xb86e('0xd'),auth['isAuthenticated'](),controller[_0xb86e('0x13')]);module[_0xb86e('0x14')]=router;
\ No newline at end of file
+var _0x2a71=['exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','describe','/:id','isAuthenticated','create','update','delete'];(function(_0x1b49eb,_0x327535){var _0x52ec8a=function(_0x45b22c){while(--_0x45b22c){_0x1b49eb['push'](_0x1b49eb['shift']());}};_0x52ec8a(++_0x327535);}(_0x2a71,0x121));var _0x12a7=function(_0x350079,_0x510691){_0x350079=_0x350079-0x0;var _0x220852=_0x2a71[_0x350079];return _0x220852;};'use strict';var multer=require(_0x12a7('0x0'));var util=require('util');var path=require(_0x12a7('0x1'));var timeout=require(_0x12a7('0x2'));var express=require(_0x12a7('0x3'));var router=express[_0x12a7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x12a7('0x5'));var config=require(_0x12a7('0x6'));var controller=require(_0x12a7('0x7'));router[_0x12a7('0x8')]('/',auth['isAuthenticated'](),controller[_0x12a7('0x9')]);router[_0x12a7('0x8')](_0x12a7('0xa'),auth['isAuthenticated'](),controller[_0x12a7('0xb')]);router[_0x12a7('0x8')](_0x12a7('0xc'),auth[_0x12a7('0xd')](),controller['show']);router['post']('/',auth[_0x12a7('0xd')](),controller[_0x12a7('0xe')]);router['put'](_0x12a7('0xc'),auth['isAuthenticated'](),controller[_0x12a7('0xf')]);router[_0x12a7('0x10')](_0x12a7('0xc'),auth[_0x12a7('0xd')](),controller['destroy']);module[_0x12a7('0x11')]=router;
\ No newline at end of file
index fdd3c04..e0d7954 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69d4=['exports','name','STRING','sequelize'];(function(_0x23ef30,_0x103cb6){var _0x3292e8=function(_0x3a0974){while(--_0x3a0974){_0x23ef30['push'](_0x23ef30['shift']());}};_0x3292e8(++_0x103cb6);}(_0x69d4,0x83));var _0x469d=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x69d4[_0x5b27da];return _0x3254f4;};'use strict';var Sequelize=require(_0x469d('0x0'));module[_0x469d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x469d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x469d('0x3')]}};
\ No newline at end of file
+var _0x1261=['exports','STRING','name'];(function(_0x239893,_0x520a8d){var _0x1b7a89=function(_0x5d995c){while(--_0x5d995c){_0x239893['push'](_0x239893['shift']());}};_0x1b7a89(++_0x520a8d);}(_0x1261,0x144));var _0x1126=function(_0x33c70e,_0xd8cb0b){_0x33c70e=_0x33c70e-0x0;var _0x5a33e5=_0x1261[_0x33c70e];return _0x5a33e5;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'name':{'type':Sequelize[_0x1126('0x1')],'unique':_0x1126('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1126('0x1')]}};
\ No newline at end of file
index 9a47b30..3f57c4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe858=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','params','include','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query'];(function(_0x412b2a,_0x11fb8a){var _0x5872e3=function(_0x202191){while(--_0x202191){_0x412b2a['push'](_0x412b2a['shift']());}};_0x5872e3(++_0x11fb8a);}(_0xe858,0x67));var _0x8e85=function(_0x471273,_0x1587f1){_0x471273=_0x471273-0x0;var _0x56c63e=_0xe858[_0x471273];return _0x56c63e;};'use strict';var pdf=require(_0x8e85('0x0'));var emlformat=require(_0x8e85('0x1'));var rimraf=require(_0x8e85('0x2'));var zipdir=require(_0x8e85('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e85('0x4'));var moment=require(_0x8e85('0x5'));var BPromise=require(_0x8e85('0x6'));var Mustache=require(_0x8e85('0x7'));var util=require(_0x8e85('0x8'));var path=require('path');var sox=require(_0x8e85('0x9'));var csv=require(_0x8e85('0xa'));var ejs=require(_0x8e85('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8e85('0xc'));var crypto=require(_0x8e85('0xd'));var jsforce=require(_0x8e85('0xe'));var deskjs=require(_0x8e85('0xf'));var toCsv=require(_0x8e85('0xa'));var querystring=require(_0x8e85('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8e85('0x11'));var qs=require(_0x8e85('0x12'));var as=require(_0x8e85('0x13'));var hardwareService=require(_0x8e85('0x14'));var logger=require(_0x8e85('0x15'))(_0x8e85('0x16'));var utils=require('../../config/utils');var config=require(_0x8e85('0x17'));var db=require(_0x8e85('0x18'))['db'];function respondWithStatusCode(_0x23e3ea,_0x4cedbd){_0x4cedbd=_0x4cedbd||0xcc;return function(_0x2e4ade){if(_0x2e4ade){return _0x23e3ea[_0x8e85('0x19')](_0x4cedbd);}return _0x23e3ea[_0x8e85('0x1a')](_0x4cedbd)[_0x8e85('0x1b')]();};}function respondWithResult(_0x13305d,_0x2228c9){_0x2228c9=_0x2228c9||0xc8;return function(_0x5b358b){if(_0x5b358b){return _0x13305d['status'](_0x2228c9)[_0x8e85('0x1c')](_0x5b358b);}};}function respondWithFilteredResult(_0x301070,_0x58d66b){return function(_0x29fc41){if(_0x29fc41){var _0x5c0249=_0x29fc41['count'],_0x6f5ea9=_0x58d66b['offset'],_0x2edc58=_0x58d66b[_0x8e85('0x1d')]+_0x58d66b[_0x8e85('0x1e')],_0x2b4cd2;if(_0x2edc58>=_0x5c0249){_0x2edc58=_0x5c0249;_0x2b4cd2=0xc8;}else{_0x2b4cd2=0xce;}_0x301070[_0x8e85('0x1a')](_0x2b4cd2);return _0x301070[_0x8e85('0x1f')](_0x8e85('0x20'),_0x6f5ea9+'-'+_0x2edc58+'/'+_0x5c0249)[_0x8e85('0x1c')](_0x29fc41);}return null;};}function patchUpdates(_0x134b57){return function(_0x19034c){try{jsonpatch[_0x8e85('0x21')](_0x19034c,_0x134b57,!![]);}catch(_0x571443){return BPromise[_0x8e85('0x22')](_0x571443);}return _0x19034c['save']();};}function saveUpdates(_0x4be4c5,_0x18fb73){return function(_0x472e2c){if(_0x472e2c){return _0x472e2c[_0x8e85('0x23')](_0x4be4c5)[_0x8e85('0x24')](function(_0x59afb7){return _0x59afb7;});}return null;};}function removeEntity(_0x42b7d6,_0x3fa6a2){return function(_0x429f6e){if(_0x429f6e){return _0x429f6e['destroy']()[_0x8e85('0x24')](function(){_0x42b7d6[_0x8e85('0x1a')](0xcc)[_0x8e85('0x1b')]();});}};}function handleEntityNotFound(_0x25e7d6,_0x34d41a){return function(_0x2ed02d){if(!_0x2ed02d){_0x25e7d6[_0x8e85('0x19')](0x194);}return _0x2ed02d;};}function handleError(_0x160b80,_0x3b92b6){_0x3b92b6=_0x3b92b6||0x1f4;return function(_0x5534fa){logger[_0x8e85('0x25')](_0x5534fa[_0x8e85('0x26')]);if(_0x5534fa[_0x8e85('0x27')]){delete _0x5534fa[_0x8e85('0x27')];}_0x160b80[_0x8e85('0x1a')](_0x3b92b6)[_0x8e85('0x28')](_0x5534fa);};}exports['index']=function(_0x2db9fb,_0x45d461){var _0x3393f0={},_0x1541ff={},_0x121f4c={'count':0x0,'rows':[]};var _0x3256fd=_[_0x8e85('0x29')](db[_0x8e85('0x2a')][_0x8e85('0x2b')],function(_0x3445b6){return{'name':_0x3445b6[_0x8e85('0x2c')],'type':_0x3445b6[_0x8e85('0x2d')][_0x8e85('0x2e')]};});_0x1541ff[_0x8e85('0x2f')]=_[_0x8e85('0x29')](_0x3256fd,_0x8e85('0x27'));_0x1541ff[_0x8e85('0x30')]=_[_0x8e85('0x31')](_0x2db9fb[_0x8e85('0x30')]);_0x1541ff[_0x8e85('0x32')]=_[_0x8e85('0x33')](_0x1541ff[_0x8e85('0x2f')],_0x1541ff[_0x8e85('0x30')]);_0x3393f0['attributes']=_['intersection'](_0x1541ff[_0x8e85('0x2f')],qs[_0x8e85('0x34')](_0x2db9fb[_0x8e85('0x30')][_0x8e85('0x34')]));_0x3393f0[_0x8e85('0x35')]=_0x3393f0[_0x8e85('0x35')][_0x8e85('0x36')]?_0x3393f0[_0x8e85('0x35')]:_0x1541ff[_0x8e85('0x2f')];if(!_0x2db9fb[_0x8e85('0x30')][_0x8e85('0x37')]('nolimit')){_0x3393f0[_0x8e85('0x1e')]=qs['limit'](_0x2db9fb[_0x8e85('0x30')][_0x8e85('0x1e')]);_0x3393f0['offset']=qs['offset'](_0x2db9fb['query'][_0x8e85('0x1d')]);}_0x3393f0[_0x8e85('0x38')]=qs[_0x8e85('0x39')](_0x2db9fb[_0x8e85('0x30')]['sort']);_0x3393f0['where']=qs[_0x8e85('0x32')](_[_0x8e85('0x3a')](_0x2db9fb[_0x8e85('0x30')],_0x1541ff['filters']),_0x3256fd);if(_0x2db9fb['query'][_0x8e85('0x3b')]){_0x3393f0[_0x8e85('0x3c')]=_[_0x8e85('0x3d')](_0x3393f0[_0x8e85('0x3c')],{'$or':_['map'](_0x3256fd,function(_0x1e076c){if(_0x1e076c[_0x8e85('0x2d')]!==_0x8e85('0x3e')){var _0x351d2a={};_0x351d2a[_0x1e076c[_0x8e85('0x27')]]={'$like':'%'+_0x2db9fb[_0x8e85('0x30')]['filter']+'%'};return _0x351d2a;}})});}_0x3393f0=_[_0x8e85('0x3d')]({},_0x3393f0,_0x2db9fb['options']);var _0x943b51={'where':_0x3393f0[_0x8e85('0x3c')]};return db[_0x8e85('0x2a')][_0x8e85('0x3f')](_0x943b51)['then'](function(_0x191881){_0x121f4c[_0x8e85('0x3f')]=_0x191881;if(_0x2db9fb['query'][_0x8e85('0x40')]){_0x3393f0['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x8e85('0x41')](_0x3393f0);})[_0x8e85('0x24')](function(_0x3bd079){_0x121f4c[_0x8e85('0x42')]=_0x3bd079;return _0x121f4c;})[_0x8e85('0x24')](respondWithFilteredResult(_0x45d461,_0x3393f0))[_0x8e85('0x43')](handleError(_0x45d461,null));};exports['show']=function(_0x9a93d2,_0x53b384){var _0x29ea3a={'raw':!![],'where':{'id':_0x9a93d2[_0x8e85('0x44')]['id']}},_0x48260f={};_0x48260f[_0x8e85('0x2f')]=_['keys'](db['MailSubstatus'][_0x8e85('0x2b')]);_0x48260f[_0x8e85('0x30')]=_[_0x8e85('0x31')](_0x9a93d2[_0x8e85('0x30')]);_0x48260f[_0x8e85('0x32')]=_[_0x8e85('0x33')](_0x48260f['model'],_0x48260f[_0x8e85('0x30')]);_0x29ea3a[_0x8e85('0x35')]=_[_0x8e85('0x33')](_0x48260f[_0x8e85('0x2f')],qs[_0x8e85('0x34')](_0x9a93d2['query'][_0x8e85('0x34')]));_0x29ea3a['attributes']=_0x29ea3a['attributes'][_0x8e85('0x36')]?_0x29ea3a[_0x8e85('0x35')]:_0x48260f['model'];if(_0x9a93d2['query']['includeAll']){_0x29ea3a[_0x8e85('0x45')]=[{'all':!![]}];}_0x29ea3a=_[_0x8e85('0x3d')]({},_0x29ea3a,_0x9a93d2[_0x8e85('0x46')]);return db[_0x8e85('0x2a')][_0x8e85('0x47')](_0x29ea3a)[_0x8e85('0x24')](handleEntityNotFound(_0x53b384,null))[_0x8e85('0x24')](respondWithResult(_0x53b384,null))[_0x8e85('0x43')](handleError(_0x53b384,null));};exports[_0x8e85('0x48')]=function(_0x1d3eb9,_0x19f965){return db[_0x8e85('0x2a')]['create'](_0x1d3eb9[_0x8e85('0x49')],{})[_0x8e85('0x24')](respondWithResult(_0x19f965,0xc9))['catch'](handleError(_0x19f965,null));};exports[_0x8e85('0x23')]=function(_0x262e1f,_0x215425){if(_0x262e1f[_0x8e85('0x49')]['id']){delete _0x262e1f['body']['id'];}return db[_0x8e85('0x2a')][_0x8e85('0x47')]({'where':{'id':_0x262e1f[_0x8e85('0x44')]['id']}})[_0x8e85('0x24')](handleEntityNotFound(_0x215425,null))['then'](saveUpdates(_0x262e1f[_0x8e85('0x49')],null))[_0x8e85('0x24')](respondWithResult(_0x215425,null))['catch'](handleError(_0x215425,null));};exports[_0x8e85('0x4a')]=function(_0xe2f9a2,_0x4f13a5){return db[_0x8e85('0x2a')][_0x8e85('0x47')]({'where':{'id':_0xe2f9a2['params']['id']}})['then'](handleEntityNotFound(_0x4f13a5,null))[_0x8e85('0x24')](removeEntity(_0x4f13a5,null))[_0x8e85('0x43')](handleError(_0x4f13a5,null));};exports[_0x8e85('0x4b')]=function(_0x2dad4b,_0x2ca769){return db['MailSubstatus'][_0x8e85('0x4b')]()[_0x8e85('0x24')](respondWithResult(_0x2ca769,null))[_0x8e85('0x43')](handleError(_0x2ca769,null));};
\ No newline at end of file
+var _0xac37=['json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','MailSubstatus','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x463608,_0x31f1dc){var _0x1f2a92=function(_0x450be4){while(--_0x450be4){_0x463608['push'](_0x463608['shift']());}};_0x1f2a92(++_0x31f1dc);}(_0xac37,0x199));var _0x7ac3=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xac37[_0x50aa2e];return _0x5e07f0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7ac3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7ac3('0x1'));var jsonpatch=require(_0x7ac3('0x2'));var rp=require(_0x7ac3('0x3'));var moment=require(_0x7ac3('0x4'));var BPromise=require(_0x7ac3('0x5'));var Mustache=require(_0x7ac3('0x6'));var util=require('util');var path=require(_0x7ac3('0x7'));var sox=require(_0x7ac3('0x8'));var csv=require(_0x7ac3('0x9'));var ejs=require(_0x7ac3('0xa'));var fs=require('fs');var _=require(_0x7ac3('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ac3('0xc'));var deskjs=require(_0x7ac3('0xd'));var toCsv=require(_0x7ac3('0x9'));var querystring=require(_0x7ac3('0xe'));var Papa=require(_0x7ac3('0xf'));var Redis=require(_0x7ac3('0x10'));var authService=require(_0x7ac3('0x11'));var qs=require(_0x7ac3('0x12'));var as=require(_0x7ac3('0x13'));var hardwareService=require(_0x7ac3('0x14'));var logger=require(_0x7ac3('0x15'))(_0x7ac3('0x16'));var utils=require(_0x7ac3('0x17'));var config=require(_0x7ac3('0x18'));var db=require(_0x7ac3('0x19'))['db'];function respondWithStatusCode(_0x48ec80,_0x123bcb){_0x123bcb=_0x123bcb||0xcc;return function(_0x128eed){if(_0x128eed){return _0x48ec80[_0x7ac3('0x1a')](_0x123bcb);}return _0x48ec80[_0x7ac3('0x1b')](_0x123bcb)[_0x7ac3('0x1c')]();};}function respondWithResult(_0x213d40,_0x2f42fc){_0x2f42fc=_0x2f42fc||0xc8;return function(_0x4f203){if(_0x4f203){return _0x213d40['status'](_0x2f42fc)[_0x7ac3('0x1d')](_0x4f203);}};}function respondWithFilteredResult(_0x169165,_0x223fb4){return function(_0x74a59b){if(_0x74a59b){var _0x3db55d=_0x74a59b[_0x7ac3('0x1e')],_0x5c36be=_0x223fb4[_0x7ac3('0x1f')],_0x366ab3=_0x223fb4[_0x7ac3('0x1f')]+_0x223fb4[_0x7ac3('0x20')],_0x2ff608;if(_0x366ab3>=_0x3db55d){_0x366ab3=_0x3db55d;_0x2ff608=0xc8;}else{_0x2ff608=0xce;}_0x169165['status'](_0x2ff608);return _0x169165[_0x7ac3('0x21')](_0x7ac3('0x22'),_0x5c36be+'-'+_0x366ab3+'/'+_0x3db55d)['json'](_0x74a59b);}return null;};}function patchUpdates(_0x495326){return function(_0x4c3abc){try{jsonpatch[_0x7ac3('0x23')](_0x4c3abc,_0x495326,!![]);}catch(_0xe3e07a){return BPromise[_0x7ac3('0x24')](_0xe3e07a);}return _0x4c3abc['save']();};}function saveUpdates(_0x49b8aa,_0x13e712){return function(_0x477f9f){if(_0x477f9f){return _0x477f9f[_0x7ac3('0x25')](_0x49b8aa)[_0x7ac3('0x26')](function(_0x36ddc3){return _0x36ddc3;});}return null;};}function removeEntity(_0x431c83,_0x2bedad){return function(_0x256100){if(_0x256100){return _0x256100[_0x7ac3('0x27')]()[_0x7ac3('0x26')](function(){_0x431c83[_0x7ac3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb734c8,_0x349b00){return function(_0x11a594){if(!_0x11a594){_0xb734c8[_0x7ac3('0x1a')](0x194);}return _0x11a594;};}function handleError(_0x12a084,_0x1c6da2){_0x1c6da2=_0x1c6da2||0x1f4;return function(_0x592b17){logger['error'](_0x592b17[_0x7ac3('0x28')]);if(_0x592b17[_0x7ac3('0x29')]){delete _0x592b17[_0x7ac3('0x29')];}_0x12a084['status'](_0x1c6da2)[_0x7ac3('0x2a')](_0x592b17);};}exports['index']=function(_0x2ee4c7,_0x22e90b){var _0x181fd9={},_0x3c2a24={},_0x5f2d87={'count':0x0,'rows':[]};var _0x502a39=_[_0x7ac3('0x2b')](db[_0x7ac3('0x2c')][_0x7ac3('0x2d')],function(_0x299977){return{'name':_0x299977['fieldName'],'type':_0x299977[_0x7ac3('0x2e')]['key']};});_0x3c2a24[_0x7ac3('0x2f')]=_[_0x7ac3('0x2b')](_0x502a39,'name');_0x3c2a24[_0x7ac3('0x30')]=_[_0x7ac3('0x31')](_0x2ee4c7['query']);_0x3c2a24[_0x7ac3('0x32')]=_[_0x7ac3('0x33')](_0x3c2a24['model'],_0x3c2a24['query']);_0x181fd9[_0x7ac3('0x34')]=_[_0x7ac3('0x33')](_0x3c2a24[_0x7ac3('0x2f')],qs[_0x7ac3('0x35')](_0x2ee4c7[_0x7ac3('0x30')][_0x7ac3('0x35')]));_0x181fd9[_0x7ac3('0x34')]=_0x181fd9[_0x7ac3('0x34')][_0x7ac3('0x36')]?_0x181fd9['attributes']:_0x3c2a24[_0x7ac3('0x2f')];if(!_0x2ee4c7[_0x7ac3('0x30')]['hasOwnProperty'](_0x7ac3('0x37'))){_0x181fd9[_0x7ac3('0x20')]=qs[_0x7ac3('0x20')](_0x2ee4c7[_0x7ac3('0x30')][_0x7ac3('0x20')]);_0x181fd9[_0x7ac3('0x1f')]=qs[_0x7ac3('0x1f')](_0x2ee4c7[_0x7ac3('0x30')][_0x7ac3('0x1f')]);}_0x181fd9['order']=qs[_0x7ac3('0x38')](_0x2ee4c7['query'][_0x7ac3('0x38')]);_0x181fd9[_0x7ac3('0x39')]=qs['filters'](_[_0x7ac3('0x3a')](_0x2ee4c7[_0x7ac3('0x30')],_0x3c2a24[_0x7ac3('0x32')]),_0x502a39);if(_0x2ee4c7[_0x7ac3('0x30')]['filter']){_0x181fd9[_0x7ac3('0x39')]=_[_0x7ac3('0x3b')](_0x181fd9[_0x7ac3('0x39')],{'$or':_[_0x7ac3('0x2b')](_0x502a39,function(_0x14dba0){if(_0x14dba0[_0x7ac3('0x2e')]!==_0x7ac3('0x3c')){var _0x523f6b={};_0x523f6b[_0x14dba0[_0x7ac3('0x29')]]={'$like':'%'+_0x2ee4c7[_0x7ac3('0x30')][_0x7ac3('0x3d')]+'%'};return _0x523f6b;}})});}_0x181fd9=_[_0x7ac3('0x3b')]({},_0x181fd9,_0x2ee4c7[_0x7ac3('0x3e')]);var _0x27af7a={'where':_0x181fd9[_0x7ac3('0x39')]};return db[_0x7ac3('0x2c')][_0x7ac3('0x1e')](_0x27af7a)[_0x7ac3('0x26')](function(_0xb29ca8){_0x5f2d87[_0x7ac3('0x1e')]=_0xb29ca8;if(_0x2ee4c7[_0x7ac3('0x30')][_0x7ac3('0x3f')]){_0x181fd9['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x7ac3('0x40')](_0x181fd9);})['then'](function(_0x2ba81f){_0x5f2d87[_0x7ac3('0x41')]=_0x2ba81f;return _0x5f2d87;})[_0x7ac3('0x26')](respondWithFilteredResult(_0x22e90b,_0x181fd9))[_0x7ac3('0x42')](handleError(_0x22e90b,null));};exports[_0x7ac3('0x43')]=function(_0x4fbaac,_0x1abdf7){var _0x54af8d={'raw':!![],'where':{'id':_0x4fbaac[_0x7ac3('0x44')]['id']}},_0x1800a0={};_0x1800a0[_0x7ac3('0x2f')]=_['keys'](db['MailSubstatus'][_0x7ac3('0x2d')]);_0x1800a0['query']=_[_0x7ac3('0x31')](_0x4fbaac[_0x7ac3('0x30')]);_0x1800a0[_0x7ac3('0x32')]=_[_0x7ac3('0x33')](_0x1800a0[_0x7ac3('0x2f')],_0x1800a0['query']);_0x54af8d[_0x7ac3('0x34')]=_[_0x7ac3('0x33')](_0x1800a0[_0x7ac3('0x2f')],qs[_0x7ac3('0x35')](_0x4fbaac['query'][_0x7ac3('0x35')]));_0x54af8d[_0x7ac3('0x34')]=_0x54af8d['attributes'][_0x7ac3('0x36')]?_0x54af8d[_0x7ac3('0x34')]:_0x1800a0[_0x7ac3('0x2f')];if(_0x4fbaac[_0x7ac3('0x30')][_0x7ac3('0x3f')]){_0x54af8d[_0x7ac3('0x45')]=[{'all':!![]}];}_0x54af8d=_[_0x7ac3('0x3b')]({},_0x54af8d,_0x4fbaac[_0x7ac3('0x3e')]);return db[_0x7ac3('0x2c')][_0x7ac3('0x46')](_0x54af8d)['then'](handleEntityNotFound(_0x1abdf7,null))['then'](respondWithResult(_0x1abdf7,null))[_0x7ac3('0x42')](handleError(_0x1abdf7,null));};exports['create']=function(_0x3d694b,_0x22925b){return db[_0x7ac3('0x2c')]['create'](_0x3d694b['body'],{})[_0x7ac3('0x26')](respondWithResult(_0x22925b,0xc9))[_0x7ac3('0x42')](handleError(_0x22925b,null));};exports['update']=function(_0x19211f,_0x2e010b){if(_0x19211f[_0x7ac3('0x47')]['id']){delete _0x19211f[_0x7ac3('0x47')]['id'];}return db[_0x7ac3('0x2c')][_0x7ac3('0x46')]({'where':{'id':_0x19211f['params']['id']}})['then'](handleEntityNotFound(_0x2e010b,null))[_0x7ac3('0x26')](saveUpdates(_0x19211f['body'],null))['then'](respondWithResult(_0x2e010b,null))[_0x7ac3('0x42')](handleError(_0x2e010b,null));};exports['destroy']=function(_0xa3ad4,_0x1273e9){return db['MailSubstatus'][_0x7ac3('0x46')]({'where':{'id':_0xa3ad4[_0x7ac3('0x44')]['id']}})[_0x7ac3('0x26')](handleEntityNotFound(_0x1273e9,null))[_0x7ac3('0x26')](removeEntity(_0x1273e9,null))[_0x7ac3('0x42')](handleError(_0x1273e9,null));};exports[_0x7ac3('0x48')]=function(_0x1fc61a,_0x27da64){return db['MailSubstatus'][_0x7ac3('0x48')]()[_0x7ac3('0x26')](respondWithResult(_0x27da64,null))[_0x7ac3('0x42')](handleError(_0x27da64,null));};
\ No newline at end of file
index 4ee9c0e..4c7876c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2371=['api','moment','bluebird','request-promise','path','rimraf','exports','define','MailSubstatus','mail_substatuses','util','../../config/logger'];(function(_0x12e6e5,_0x39855b){var _0x4ef6ce=function(_0x3e06f3){while(--_0x3e06f3){_0x12e6e5['push'](_0x12e6e5['shift']());}};_0x4ef6ce(++_0x39855b);}(_0x2371,0xbe));var _0x1237=function(_0x53ad58,_0x3fb489){_0x53ad58=_0x53ad58-0x0;var _0x554b03=_0x2371[_0x53ad58];return _0x554b03;};'use strict';var _=require('lodash');var util=require(_0x1237('0x0'));var logger=require(_0x1237('0x1'))(_0x1237('0x2'));var moment=require(_0x1237('0x3'));var BPromise=require(_0x1237('0x4'));var rp=require(_0x1237('0x5'));var fs=require('fs');var path=require(_0x1237('0x6'));var rimraf=require(_0x1237('0x7'));var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module[_0x1237('0x8')]=function(_0x52f92a,_0x564d36){return _0x52f92a[_0x1237('0x9')](_0x1237('0xa'),attributes,{'tableName':_0x1237('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe97e=['define','MailSubstatus','mail_substatuses','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailSubstatus.attributes','exports'];(function(_0xa45c8e,_0x4631e6){var _0x56f4ea=function(_0x5db1ce){while(--_0x5db1ce){_0xa45c8e['push'](_0xa45c8e['shift']());}};_0x56f4ea(++_0x4631e6);}(_0xe97e,0x162));var _0xee97=function(_0x1d2dde,_0x43821b){_0x1d2dde=_0x1d2dde-0x0;var _0x315d19=_0xe97e[_0x1d2dde];return _0x315d19;};'use strict';var _=require('lodash');var util=require(_0xee97('0x0'));var logger=require(_0xee97('0x1'))(_0xee97('0x2'));var moment=require(_0xee97('0x3'));var BPromise=require(_0xee97('0x4'));var rp=require(_0xee97('0x5'));var fs=require('fs');var path=require(_0xee97('0x6'));var rimraf=require(_0xee97('0x7'));var config=require('../../config/environment');var attributes=require(_0xee97('0x8'));module[_0xee97('0x9')]=function(_0x4678d9,_0x4b2cab){return _0x4678d9[_0xee97('0xa')](_0xee97('0xb'),attributes,{'tableName':_0xee97('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aaa5447..14038df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdace=['request\x20sent','debug','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xdace,0xc5));var _0xedac=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xdace[_0x386c3e];return _0x4b8e13;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});}
\ No newline at end of file
+var _0x702d=['stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x589222,_0x1cfc0c){var _0x167251=function(_0x2e2d71){while(--_0x2e2d71){_0x589222['push'](_0x589222['shift']());}};_0x167251(++_0x1cfc0c);}(_0x702d,0x147));var _0xd702=function(_0x176f41,_0x4a64ae){_0x176f41=_0x176f41-0x0;var _0x41e7ad=_0x702d[_0x176f41];return _0x41e7ad;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var moment=require(_0xd702('0x2'));var BPromise=require(_0xd702('0x3'));var rs=require(_0xd702('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd702('0x5'))['db'];var utils=require(_0xd702('0x6'));var logger=require(_0xd702('0x7'))(_0xd702('0x8'));var config=require('../../config/environment');var jayson=require(_0xd702('0x9'));var client=jayson['client'][_0xd702('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2c03,_0xf4bf4f,_0x5af246){return new BPromise(function(_0x12bb75,_0x53bd02){return client[_0xd702('0xb')](_0x3a2c03,_0x5af246)[_0xd702('0xc')](function(_0x907a9f){logger[_0xd702('0xd')](_0xd702('0xe'),_0xf4bf4f,_0xd702('0xf'));logger[_0xd702('0x10')](_0xd702('0x11'),_0xf4bf4f,_0xd702('0xf'),JSON[_0xd702('0x12')](_0x907a9f));if(_0x907a9f['error']){if(_0x907a9f['error'][_0xd702('0x13')]===0x1f4){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f['error'][_0xd702('0x15')]);return _0x53bd02(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f[_0xd702('0x14')]['message']);return _0x12bb75(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}else{logger['info'](_0xd702('0xe'),_0xf4bf4f,'request\x20sent');_0x12bb75(_0x907a9f[_0xd702('0x16')][_0xd702('0x15')]);}})['catch'](function(_0x2ba791){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x2ba791);_0x53bd02(_0x2ba791);});});}
\ No newline at end of file
index 463effd..6d485d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d18=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x12efa0,_0x579590){var _0x158c02=function(_0x311422){while(--_0x311422){_0x12efa0['push'](_0x12efa0['shift']());}};_0x158c02(++_0x579590);}(_0x0d18,0x1b9));var _0x80d1=function(_0x385682,_0x2bf424){_0x385682=_0x385682-0x0;var _0x47d269=_0x0d18[_0x385682];return _0x47d269;};'use strict';var multer=require(_0x80d1('0x0'));var util=require(_0x80d1('0x1'));var path=require(_0x80d1('0x2'));var timeout=require(_0x80d1('0x3'));var express=require(_0x80d1('0x4'));var router=express['Router']();var auth=require(_0x80d1('0x5'));var interaction=require(_0x80d1('0x6'));var config=require('../../config/environment');var controller=require(_0x80d1('0x7'));router[_0x80d1('0x8')]('/',auth[_0x80d1('0x9')](),controller[_0x80d1('0xa')]);router['get']('/describe',auth[_0x80d1('0x9')](),controller[_0x80d1('0xb')]);router['get'](_0x80d1('0xc'),auth[_0x80d1('0x9')](),controller[_0x80d1('0xd')]);router[_0x80d1('0xe')]('/',auth[_0x80d1('0x9')](),controller[_0x80d1('0xf')]);router[_0x80d1('0x10')]('/:id',auth[_0x80d1('0x9')](),controller[_0x80d1('0x11')]);router[_0x80d1('0x12')](_0x80d1('0xc'),auth[_0x80d1('0x9')](),controller[_0x80d1('0x13')]);module[_0x80d1('0x14')]=router;
\ No newline at end of file
+var _0xe3b8=['connect-timeout','express','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','multer','util','path'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0xe3b8,0xb1));var _0x8e3b=function(_0x370708,_0x1ce78c){_0x370708=_0x370708-0x0;var _0x1ea845=_0xe3b8[_0x370708];return _0x1ea845;};'use strict';var multer=require(_0x8e3b('0x0'));var util=require(_0x8e3b('0x1'));var path=require(_0x8e3b('0x2'));var timeout=require(_0x8e3b('0x3'));var express=require(_0x8e3b('0x4'));var router=express['Router']();var auth=require(_0x8e3b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8e3b('0x6'));var controller=require(_0x8e3b('0x7'));router[_0x8e3b('0x8')]('/',auth[_0x8e3b('0x9')](),controller[_0x8e3b('0xa')]);router[_0x8e3b('0x8')](_0x8e3b('0xb'),auth['isAuthenticated'](),controller[_0x8e3b('0xc')]);router[_0x8e3b('0x8')](_0x8e3b('0xd'),auth['isAuthenticated'](),controller[_0x8e3b('0xe')]);router[_0x8e3b('0xf')]('/',auth['isAuthenticated'](),controller[_0x8e3b('0x10')]);router['put']('/:id',auth[_0x8e3b('0x9')](),controller[_0x8e3b('0x11')]);router['delete']('/:id',auth[_0x8e3b('0x9')](),controller[_0x8e3b('0x12')]);module[_0x8e3b('0x13')]=router;
\ No newline at end of file
index 9f32cb9..512ac61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eb9=['account','agent','queue','DATE','NOW','moment','STRING','ENUM'];(function(_0x271bfe,_0x10af9e){var _0x10e3dd=function(_0x3d1ddb){while(--_0x3d1ddb){_0x271bfe['push'](_0x271bfe['shift']());}};_0x10e3dd(++_0x10af9e);}(_0x3eb9,0x8d));var _0x93eb=function(_0x23f0e1,_0x11d94b){_0x23f0e1=_0x23f0e1-0x0;var _0x257f0d=_0x3eb9[_0x23f0e1];return _0x257f0d;};'use strict';var moment=require(_0x93eb('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x93eb('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x93eb('0x2')](_0x93eb('0x3'),_0x93eb('0x4'),_0x93eb('0x5')),'allowNull':![],'defaultValue':_0x93eb('0x5')},'transferredAt':{'type':Sequelize[_0x93eb('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x93eb('0x7')]}};
\ No newline at end of file
+var _0xc3eb=['account','queue','NOW','moment','exports','STRING'];(function(_0x5b869b,_0x5da478){var _0x1a1312=function(_0x4d7993){while(--_0x4d7993){_0x5b869b['push'](_0x5b869b['shift']());}};_0x1a1312(++_0x5da478);}(_0xc3eb,0xe1));var _0xbc3e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xc3eb[_0x2a6809];return _0x11c371;};'use strict';var moment=require(_0xbc3e('0x0'));var Sequelize=require('sequelize');module[_0xbc3e('0x1')]={'uniqueid':{'type':Sequelize[_0xbc3e('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbc3e('0x3'),'agent',_0xbc3e('0x4')),'allowNull':![],'defaultValue':_0xbc3e('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xbc3e('0x5')]}};
\ No newline at end of file
index c9c8a9a..81b9431 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ed9=['sendStatus','end','status','count','offset','set','json','reject','update','destroy','then','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x163bd0,_0x596777){var _0x8a7a6a=function(_0x2c6c26){while(--_0x2c6c26){_0x163bd0['push'](_0x163bd0['shift']());}};_0x8a7a6a(++_0x596777);}(_0x6ed9,0x1a4));var _0x96ed=function(_0x42facc,_0x1eb3ff){_0x42facc=_0x42facc-0x0;var _0x1224ad=_0x6ed9[_0x42facc];return _0x1224ad;};'use strict';var pdf=require(_0x96ed('0x0'));var emlformat=require(_0x96ed('0x1'));var rimraf=require(_0x96ed('0x2'));var zipdir=require(_0x96ed('0x3'));var jsonpatch=require(_0x96ed('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x96ed('0x5'));var Mustache=require(_0x96ed('0x6'));var util=require(_0x96ed('0x7'));var path=require('path');var sox=require(_0x96ed('0x8'));var csv=require(_0x96ed('0x9'));var ejs=require(_0x96ed('0xa'));var fs=require('fs');var _=require(_0x96ed('0xb'));var squel=require(_0x96ed('0xc'));var crypto=require('crypto');var jsforce=require(_0x96ed('0xd'));var deskjs=require(_0x96ed('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x96ed('0xf'));var Redis=require('ioredis');var authService=require(_0x96ed('0x10'));var qs=require(_0x96ed('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96ed('0x12'));var logger=require(_0x96ed('0x13'))(_0x96ed('0x14'));var utils=require(_0x96ed('0x15'));var config=require(_0x96ed('0x16'));var db=require(_0x96ed('0x17'))['db'];function respondWithStatusCode(_0x410237,_0x21199e){_0x21199e=_0x21199e||0xcc;return function(_0x2ed5c7){if(_0x2ed5c7){return _0x410237[_0x96ed('0x18')](_0x21199e);}return _0x410237['status'](_0x21199e)[_0x96ed('0x19')]();};}function respondWithResult(_0x1f5689,_0x5d3319){_0x5d3319=_0x5d3319||0xc8;return function(_0x174753){if(_0x174753){return _0x1f5689[_0x96ed('0x1a')](_0x5d3319)['json'](_0x174753);}};}function respondWithFilteredResult(_0x1e5ea9,_0x10724f){return function(_0x18d82d){if(_0x18d82d){var _0x239b4e=_0x18d82d[_0x96ed('0x1b')],_0x56c442=_0x10724f['offset'],_0x4d18be=_0x10724f[_0x96ed('0x1c')]+_0x10724f['limit'],_0x28787e;if(_0x4d18be>=_0x239b4e){_0x4d18be=_0x239b4e;_0x28787e=0xc8;}else{_0x28787e=0xce;}_0x1e5ea9[_0x96ed('0x1a')](_0x28787e);return _0x1e5ea9[_0x96ed('0x1d')]('Content-Range',_0x56c442+'-'+_0x4d18be+'/'+_0x239b4e)[_0x96ed('0x1e')](_0x18d82d);}return null;};}function patchUpdates(_0xc6e8dd){return function(_0x463610){try{jsonpatch['apply'](_0x463610,_0xc6e8dd,!![]);}catch(_0x455934){return BPromise[_0x96ed('0x1f')](_0x455934);}return _0x463610['save']();};}function saveUpdates(_0x1e20d0,_0x52ffc4){return function(_0x56a0e7){if(_0x56a0e7){return _0x56a0e7[_0x96ed('0x20')](_0x1e20d0)['then'](function(_0x33da7e){return _0x33da7e;});}return null;};}function removeEntity(_0x34d8f3,_0x3ad296){return function(_0x160e43){if(_0x160e43){return _0x160e43[_0x96ed('0x21')]()[_0x96ed('0x22')](function(){_0x34d8f3[_0x96ed('0x1a')](0xcc)[_0x96ed('0x19')]();});}};}function handleEntityNotFound(_0x59f4a0,_0x4f744f){return function(_0x14eba4){if(!_0x14eba4){_0x59f4a0['sendStatus'](0x194);}return _0x14eba4;};}function handleError(_0x51fa8d,_0x113ffa){_0x113ffa=_0x113ffa||0x1f4;return function(_0x3df4a0){logger[_0x96ed('0x23')](_0x3df4a0[_0x96ed('0x24')]);if(_0x3df4a0[_0x96ed('0x25')]){delete _0x3df4a0[_0x96ed('0x25')];}_0x51fa8d[_0x96ed('0x1a')](_0x113ffa)[_0x96ed('0x26')](_0x3df4a0);};}exports[_0x96ed('0x27')]=function(_0x175661,_0x4a1b64){var _0x54b818={},_0x5cf5de={},_0x10e3a5={'count':0x0,'rows':[]};var _0x2ce141=_['map'](db[_0x96ed('0x28')][_0x96ed('0x29')],function(_0x4b11f1){return{'name':_0x4b11f1[_0x96ed('0x2a')],'type':_0x4b11f1[_0x96ed('0x2b')][_0x96ed('0x2c')]};});_0x5cf5de[_0x96ed('0x2d')]=_[_0x96ed('0x2e')](_0x2ce141,_0x96ed('0x25'));_0x5cf5de['query']=_[_0x96ed('0x2f')](_0x175661[_0x96ed('0x30')]);_0x5cf5de['filters']=_[_0x96ed('0x31')](_0x5cf5de[_0x96ed('0x2d')],_0x5cf5de['query']);_0x54b818[_0x96ed('0x32')]=_[_0x96ed('0x31')](_0x5cf5de[_0x96ed('0x2d')],qs[_0x96ed('0x33')](_0x175661[_0x96ed('0x30')][_0x96ed('0x33')]));_0x54b818['attributes']=_0x54b818[_0x96ed('0x32')][_0x96ed('0x34')]?_0x54b818[_0x96ed('0x32')]:_0x5cf5de['model'];if(!_0x175661[_0x96ed('0x30')][_0x96ed('0x35')]('nolimit')){_0x54b818[_0x96ed('0x36')]=qs[_0x96ed('0x36')](_0x175661['query'][_0x96ed('0x36')]);_0x54b818[_0x96ed('0x1c')]=qs[_0x96ed('0x1c')](_0x175661[_0x96ed('0x30')][_0x96ed('0x1c')]);}_0x54b818[_0x96ed('0x37')]=qs['sort'](_0x175661[_0x96ed('0x30')][_0x96ed('0x38')]);_0x54b818[_0x96ed('0x39')]=qs[_0x96ed('0x3a')](_['pick'](_0x175661[_0x96ed('0x30')],_0x5cf5de[_0x96ed('0x3a')]),_0x2ce141);if(_0x175661[_0x96ed('0x30')][_0x96ed('0x3b')]){_0x54b818['where']=_[_0x96ed('0x3c')](_0x54b818['where'],{'$or':_[_0x96ed('0x2e')](_0x2ce141,function(_0x2c98ca){if(_0x2c98ca['type']!==_0x96ed('0x3d')){var _0x10167e={};_0x10167e[_0x2c98ca[_0x96ed('0x25')]]={'$like':'%'+_0x175661[_0x96ed('0x30')][_0x96ed('0x3b')]+'%'};return _0x10167e;}})});}_0x54b818=_['merge']({},_0x54b818,_0x175661[_0x96ed('0x3e')]);var _0x5a4502={'where':_0x54b818[_0x96ed('0x39')]};return db[_0x96ed('0x28')][_0x96ed('0x1b')](_0x5a4502)[_0x96ed('0x22')](function(_0x242a03){_0x10e3a5['count']=_0x242a03;if(_0x175661[_0x96ed('0x30')][_0x96ed('0x3f')]){_0x54b818[_0x96ed('0x40')]=[{'all':!![]}];}return db[_0x96ed('0x28')][_0x96ed('0x41')](_0x54b818);})[_0x96ed('0x22')](function(_0x3a3966){_0x10e3a5[_0x96ed('0x42')]=_0x3a3966;return _0x10e3a5;})['then'](respondWithFilteredResult(_0x4a1b64,_0x54b818))[_0x96ed('0x43')](handleError(_0x4a1b64,null));};exports[_0x96ed('0x44')]=function(_0x1ef2fe,_0x5de691){var _0x584a71={'raw':!![],'where':{'id':_0x1ef2fe[_0x96ed('0x45')]['id']}},_0xa84fa7={};_0xa84fa7['model']=_[_0x96ed('0x2f')](db[_0x96ed('0x28')][_0x96ed('0x29')]);_0xa84fa7['query']=_[_0x96ed('0x2f')](_0x1ef2fe[_0x96ed('0x30')]);_0xa84fa7[_0x96ed('0x3a')]=_[_0x96ed('0x31')](_0xa84fa7[_0x96ed('0x2d')],_0xa84fa7[_0x96ed('0x30')]);_0x584a71[_0x96ed('0x32')]=_[_0x96ed('0x31')](_0xa84fa7[_0x96ed('0x2d')],qs[_0x96ed('0x33')](_0x1ef2fe[_0x96ed('0x30')]['fields']));_0x584a71[_0x96ed('0x32')]=_0x584a71[_0x96ed('0x32')][_0x96ed('0x34')]?_0x584a71[_0x96ed('0x32')]:_0xa84fa7[_0x96ed('0x2d')];if(_0x1ef2fe[_0x96ed('0x30')]['includeAll']){_0x584a71[_0x96ed('0x40')]=[{'all':!![]}];}_0x584a71=_['merge']({},_0x584a71,_0x1ef2fe[_0x96ed('0x3e')]);return db[_0x96ed('0x28')][_0x96ed('0x46')](_0x584a71)[_0x96ed('0x22')](handleEntityNotFound(_0x5de691,null))[_0x96ed('0x22')](respondWithResult(_0x5de691,null))[_0x96ed('0x43')](handleError(_0x5de691,null));};exports[_0x96ed('0x47')]=function(_0x3754ba,_0x31ddd5){return db[_0x96ed('0x28')][_0x96ed('0x47')](_0x3754ba[_0x96ed('0x48')],{})[_0x96ed('0x22')](respondWithResult(_0x31ddd5,0xc9))['catch'](handleError(_0x31ddd5,null));};exports[_0x96ed('0x20')]=function(_0x34f108,_0x22e23c){if(_0x34f108['body']['id']){delete _0x34f108[_0x96ed('0x48')]['id'];}return db[_0x96ed('0x28')]['find']({'where':{'id':_0x34f108[_0x96ed('0x45')]['id']}})[_0x96ed('0x22')](handleEntityNotFound(_0x22e23c,null))[_0x96ed('0x22')](saveUpdates(_0x34f108[_0x96ed('0x48')],null))[_0x96ed('0x22')](respondWithResult(_0x22e23c,null))[_0x96ed('0x43')](handleError(_0x22e23c,null));};exports[_0x96ed('0x21')]=function(_0x316804,_0x3d7f7a){return db['MailTransferReport'][_0x96ed('0x46')]({'where':{'id':_0x316804['params']['id']}})[_0x96ed('0x22')](handleEntityNotFound(_0x3d7f7a,null))[_0x96ed('0x22')](removeEntity(_0x3d7f7a,null))[_0x96ed('0x43')](handleError(_0x3d7f7a,null));};exports[_0x96ed('0x49')]=function(_0x23471e,_0x9f8486){return db['MailTransferReport'][_0x96ed('0x49')]()['then'](respondWithResult(_0x9f8486,null))['catch'](handleError(_0x9f8486,null));};
\ No newline at end of file
+var _0x4938=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','then','destroy','stack','name','send','index','map','MailTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','describe','html-pdf'];(function(_0x4be67c,_0xca024a){var _0x3f71af=function(_0x4b91be){while(--_0x4b91be){_0x4be67c['push'](_0x4be67c['shift']());}};_0x3f71af(++_0xca024a);}(_0x4938,0xda));var _0x8493=function(_0x1d2bc8,_0x2860bc){_0x1d2bc8=_0x1d2bc8-0x0;var _0x1857e1=_0x4938[_0x1d2bc8];return _0x1857e1;};'use strict';var pdf=require(_0x8493('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8493('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8493('0x2'));var rp=require(_0x8493('0x3'));var moment=require(_0x8493('0x4'));var BPromise=require(_0x8493('0x5'));var Mustache=require(_0x8493('0x6'));var util=require(_0x8493('0x7'));var path=require(_0x8493('0x8'));var sox=require(_0x8493('0x9'));var csv=require('to-csv');var ejs=require(_0x8493('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8493('0xb'));var crypto=require(_0x8493('0xc'));var jsforce=require(_0x8493('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8493('0xe'));var querystring=require(_0x8493('0xf'));var Papa=require(_0x8493('0x10'));var Redis=require(_0x8493('0x11'));var authService=require(_0x8493('0x12'));var qs=require(_0x8493('0x13'));var as=require(_0x8493('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8493('0x15'))(_0x8493('0x16'));var utils=require(_0x8493('0x17'));var config=require('../../config/environment');var db=require(_0x8493('0x18'))['db'];function respondWithStatusCode(_0x28fdac,_0xe758a6){_0xe758a6=_0xe758a6||0xcc;return function(_0x999ed3){if(_0x999ed3){return _0x28fdac[_0x8493('0x19')](_0xe758a6);}return _0x28fdac[_0x8493('0x1a')](_0xe758a6)[_0x8493('0x1b')]();};}function respondWithResult(_0x276ee8,_0x4c0ec7){_0x4c0ec7=_0x4c0ec7||0xc8;return function(_0x5d7c5e){if(_0x5d7c5e){return _0x276ee8[_0x8493('0x1a')](_0x4c0ec7)['json'](_0x5d7c5e);}};}function respondWithFilteredResult(_0x7d4a4c,_0x427ef1){return function(_0x3833ec){if(_0x3833ec){var _0x2cb65d=_0x3833ec[_0x8493('0x1c')],_0x319925=_0x427ef1[_0x8493('0x1d')],_0x4c88e9=_0x427ef1['offset']+_0x427ef1[_0x8493('0x1e')],_0x19ff41;if(_0x4c88e9>=_0x2cb65d){_0x4c88e9=_0x2cb65d;_0x19ff41=0xc8;}else{_0x19ff41=0xce;}_0x7d4a4c[_0x8493('0x1a')](_0x19ff41);return _0x7d4a4c[_0x8493('0x1f')](_0x8493('0x20'),_0x319925+'-'+_0x4c88e9+'/'+_0x2cb65d)[_0x8493('0x21')](_0x3833ec);}return null;};}function patchUpdates(_0x140ab9){return function(_0x363919){try{jsonpatch[_0x8493('0x22')](_0x363919,_0x140ab9,!![]);}catch(_0x30f3e6){return BPromise['reject'](_0x30f3e6);}return _0x363919['save']();};}function saveUpdates(_0x168d8a,_0x33f768){return function(_0x181bf4){if(_0x181bf4){return _0x181bf4['update'](_0x168d8a)[_0x8493('0x23')](function(_0x10b0a2){return _0x10b0a2;});}return null;};}function removeEntity(_0x243921,_0x215a4d){return function(_0x5307ac){if(_0x5307ac){return _0x5307ac[_0x8493('0x24')]()[_0x8493('0x23')](function(){_0x243921['status'](0xcc)[_0x8493('0x1b')]();});}};}function handleEntityNotFound(_0x4ce79c,_0x8327bf){return function(_0xb385ee){if(!_0xb385ee){_0x4ce79c['sendStatus'](0x194);}return _0xb385ee;};}function handleError(_0x30092b,_0xfe19d2){_0xfe19d2=_0xfe19d2||0x1f4;return function(_0x874372){logger['error'](_0x874372[_0x8493('0x25')]);if(_0x874372[_0x8493('0x26')]){delete _0x874372[_0x8493('0x26')];}_0x30092b[_0x8493('0x1a')](_0xfe19d2)[_0x8493('0x27')](_0x874372);};}exports[_0x8493('0x28')]=function(_0x3dbe44,_0x37163a){var _0xa12c46={},_0x424442={},_0x196ed1={'count':0x0,'rows':[]};var _0x144b38=_[_0x8493('0x29')](db[_0x8493('0x2a')][_0x8493('0x2b')],function(_0x5db872){return{'name':_0x5db872['fieldName'],'type':_0x5db872[_0x8493('0x2c')][_0x8493('0x2d')]};});_0x424442[_0x8493('0x2e')]=_[_0x8493('0x29')](_0x144b38,'name');_0x424442[_0x8493('0x2f')]=_[_0x8493('0x30')](_0x3dbe44[_0x8493('0x2f')]);_0x424442[_0x8493('0x31')]=_[_0x8493('0x32')](_0x424442[_0x8493('0x2e')],_0x424442[_0x8493('0x2f')]);_0xa12c46[_0x8493('0x33')]=_['intersection'](_0x424442[_0x8493('0x2e')],qs[_0x8493('0x34')](_0x3dbe44[_0x8493('0x2f')]['fields']));_0xa12c46[_0x8493('0x33')]=_0xa12c46[_0x8493('0x33')][_0x8493('0x35')]?_0xa12c46[_0x8493('0x33')]:_0x424442[_0x8493('0x2e')];if(!_0x3dbe44['query'][_0x8493('0x36')]('nolimit')){_0xa12c46['limit']=qs[_0x8493('0x1e')](_0x3dbe44[_0x8493('0x2f')][_0x8493('0x1e')]);_0xa12c46[_0x8493('0x1d')]=qs[_0x8493('0x1d')](_0x3dbe44[_0x8493('0x2f')]['offset']);}_0xa12c46['order']=qs[_0x8493('0x37')](_0x3dbe44[_0x8493('0x2f')][_0x8493('0x37')]);_0xa12c46['where']=qs[_0x8493('0x31')](_['pick'](_0x3dbe44[_0x8493('0x2f')],_0x424442[_0x8493('0x31')]),_0x144b38);if(_0x3dbe44[_0x8493('0x2f')][_0x8493('0x38')]){_0xa12c46[_0x8493('0x39')]=_[_0x8493('0x3a')](_0xa12c46[_0x8493('0x39')],{'$or':_[_0x8493('0x29')](_0x144b38,function(_0x22cc78){if(_0x22cc78['type']!==_0x8493('0x3b')){var _0x3575d0={};_0x3575d0[_0x22cc78[_0x8493('0x26')]]={'$like':'%'+_0x3dbe44[_0x8493('0x2f')][_0x8493('0x38')]+'%'};return _0x3575d0;}})});}_0xa12c46=_[_0x8493('0x3a')]({},_0xa12c46,_0x3dbe44['options']);var _0x4fd02e={'where':_0xa12c46[_0x8493('0x39')]};return db[_0x8493('0x2a')][_0x8493('0x1c')](_0x4fd02e)[_0x8493('0x23')](function(_0x3aeb86){_0x196ed1[_0x8493('0x1c')]=_0x3aeb86;if(_0x3dbe44[_0x8493('0x2f')][_0x8493('0x3c')]){_0xa12c46[_0x8493('0x3d')]=[{'all':!![]}];}return db['MailTransferReport'][_0x8493('0x3e')](_0xa12c46);})[_0x8493('0x23')](function(_0x2518bc){_0x196ed1[_0x8493('0x3f')]=_0x2518bc;return _0x196ed1;})[_0x8493('0x23')](respondWithFilteredResult(_0x37163a,_0xa12c46))[_0x8493('0x40')](handleError(_0x37163a,null));};exports[_0x8493('0x41')]=function(_0x5af5cb,_0x2f8a8f){var _0x13e369={'raw':!![],'where':{'id':_0x5af5cb[_0x8493('0x42')]['id']}},_0x286d20={};_0x286d20[_0x8493('0x2e')]=_[_0x8493('0x30')](db['MailTransferReport'][_0x8493('0x2b')]);_0x286d20[_0x8493('0x2f')]=_[_0x8493('0x30')](_0x5af5cb[_0x8493('0x2f')]);_0x286d20[_0x8493('0x31')]=_[_0x8493('0x32')](_0x286d20[_0x8493('0x2e')],_0x286d20[_0x8493('0x2f')]);_0x13e369[_0x8493('0x33')]=_[_0x8493('0x32')](_0x286d20[_0x8493('0x2e')],qs[_0x8493('0x34')](_0x5af5cb['query'][_0x8493('0x34')]));_0x13e369['attributes']=_0x13e369['attributes'][_0x8493('0x35')]?_0x13e369[_0x8493('0x33')]:_0x286d20[_0x8493('0x2e')];if(_0x5af5cb[_0x8493('0x2f')][_0x8493('0x3c')]){_0x13e369['include']=[{'all':!![]}];}_0x13e369=_[_0x8493('0x3a')]({},_0x13e369,_0x5af5cb[_0x8493('0x43')]);return db['MailTransferReport'][_0x8493('0x44')](_0x13e369)[_0x8493('0x23')](handleEntityNotFound(_0x2f8a8f,null))[_0x8493('0x23')](respondWithResult(_0x2f8a8f,null))[_0x8493('0x40')](handleError(_0x2f8a8f,null));};exports[_0x8493('0x45')]=function(_0x536511,_0x151c86){return db[_0x8493('0x2a')][_0x8493('0x45')](_0x536511[_0x8493('0x46')],{})['then'](respondWithResult(_0x151c86,0xc9))[_0x8493('0x40')](handleError(_0x151c86,null));};exports[_0x8493('0x47')]=function(_0x512379,_0x3726a4){if(_0x512379[_0x8493('0x46')]['id']){delete _0x512379['body']['id'];}return db[_0x8493('0x2a')][_0x8493('0x44')]({'where':{'id':_0x512379[_0x8493('0x42')]['id']}})[_0x8493('0x23')](handleEntityNotFound(_0x3726a4,null))[_0x8493('0x23')](saveUpdates(_0x512379['body'],null))[_0x8493('0x23')](respondWithResult(_0x3726a4,null))[_0x8493('0x40')](handleError(_0x3726a4,null));};exports[_0x8493('0x24')]=function(_0x50f2cc,_0x3f456c){return db[_0x8493('0x2a')]['find']({'where':{'id':_0x50f2cc[_0x8493('0x42')]['id']}})[_0x8493('0x23')](handleEntityNotFound(_0x3f456c,null))[_0x8493('0x23')](removeEntity(_0x3f456c,null))[_0x8493('0x40')](handleError(_0x3f456c,null));};exports[_0x8493('0x48')]=function(_0x2b11ef,_0x5a0043){return db[_0x8493('0x2a')][_0x8493('0x48')]()[_0x8493('0x23')](respondWithResult(_0x5a0043,null))['catch'](handleError(_0x5a0043,null));};
\ No newline at end of file
index 77be83b..d1d97c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed02=['api','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x2b5553,_0x3c2161){var _0x52b730=function(_0x6844b2){while(--_0x6844b2){_0x2b5553['push'](_0x2b5553['shift']());}};_0x52b730(++_0x3c2161);}(_0xed02,0x97));var _0x2ed0=function(_0x37edd2,_0x470d4e){_0x37edd2=_0x37edd2-0x0;var _0x2b00ef=_0xed02[_0x37edd2];return _0x2b00ef;};'use strict';var _=require(_0x2ed0('0x0'));var util=require(_0x2ed0('0x1'));var logger=require(_0x2ed0('0x2'))(_0x2ed0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2ed0('0x4'));var fs=require('fs');var path=require(_0x2ed0('0x5'));var rimraf=require(_0x2ed0('0x6'));var config=require(_0x2ed0('0x7'));var attributes=require(_0x2ed0('0x8'));module[_0x2ed0('0x9')]=function(_0x24799c,_0x34bf56){return _0x24799c[_0x2ed0('0xa')](_0x2ed0('0xb'),attributes,{'tableName':_0x2ed0('0xc'),'paranoid':![],'indexes':[{'name':_0x2ed0('0xd'),'fields':[_0x2ed0('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x693b=['api','moment','bluebird','request-promise','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','../../config/logger'];(function(_0x260fcf,_0x44ea0c){var _0x5d1d08=function(_0xb234aa){while(--_0xb234aa){_0x260fcf['push'](_0x260fcf['shift']());}};_0x5d1d08(++_0x44ea0c);}(_0x693b,0x111));var _0xb693=function(_0x25245c,_0x5d4131){_0x25245c=_0x25245c-0x0;var _0x1ddffd=_0x693b[_0x25245c];return _0x1ddffd;};'use strict';var _=require(_0xb693('0x0'));var util=require('util');var logger=require(_0xb693('0x1'))(_0xb693('0x2'));var moment=require(_0xb693('0x3'));var BPromise=require(_0xb693('0x4'));var rp=require(_0xb693('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb693('0x6'));module[_0xb693('0x7')]=function(_0x37ef06,_0xc69c5e){return _0x37ef06[_0xb693('0x8')]('MailTransferReport',attributes,{'tableName':_0xb693('0x9'),'paranoid':![],'indexes':[{'name':_0xb693('0xa'),'fields':[_0xb693('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 1859cd4..b9b7f5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa82d=['bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','lodash','util'];(function(_0x5c1920,_0xa5ce78){var _0x2c13d9=function(_0x3a14c6){while(--_0x3a14c6){_0x5c1920['push'](_0x5c1920['shift']());}};_0x2c13d9(++_0xa5ce78);}(_0xa82d,0x1b6));var _0xda82=function(_0x224ba0,_0x17cdbd){_0x224ba0=_0x224ba0-0x0;var _0x54c899=_0xa82d[_0x224ba0];return _0x54c899;};'use strict';var _=require(_0xda82('0x0'));var util=require(_0xda82('0x1'));var moment=require('moment');var BPromise=require(_0xda82('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda82('0x3'));var db=require(_0xda82('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xda82('0x5'))('rpc');var config=require(_0xda82('0x6'));var jayson=require(_0xda82('0x7'));var client=jayson[_0xda82('0x8')][_0xda82('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57a295,_0x37e3d0,_0x102530){return new BPromise(function(_0x145738,_0x2ba2fe){return client[_0xda82('0xa')](_0x57a295,_0x102530)['then'](function(_0x22dc3c){logger[_0xda82('0xb')](_0xda82('0xc'),_0x37e3d0,_0xda82('0xd'));logger[_0xda82('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x37e3d0,'request\x20sent',JSON['stringify'](_0x22dc3c));if(_0x22dc3c['error']){if(_0x22dc3c['error'][_0xda82('0xf')]===0x1f4){logger[_0xda82('0x10')](_0xda82('0xc'),_0x37e3d0,_0x22dc3c[_0xda82('0x10')]['message']);return _0x2ba2fe(_0x22dc3c[_0xda82('0x10')]['message']);}logger['error'](_0xda82('0xc'),_0x37e3d0,_0x22dc3c[_0xda82('0x10')]['message']);return _0x145738(_0x22dc3c[_0xda82('0x10')][_0xda82('0x11')]);}else{logger[_0xda82('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x37e3d0,_0xda82('0xd'));_0x145738(_0x22dc3c[_0xda82('0x12')]['message']);}})[_0xda82('0x13')](function(_0x10c832){logger[_0xda82('0x10')](_0xda82('0xc'),_0x37e3d0,_0x10c832);_0x2ba2fe(_0x10c832);});});}
\ No newline at end of file
+var _0x3a13=['jayson/promise','client','http','request','request\x20sent','debug','error','code','message','info','MailTransferReport,\x20%s,\x20%s','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3a13,0x14f));var _0x33a1=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x3a13[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x33a1('0x0'));var util=require('util');var moment=require(_0x33a1('0x1'));var BPromise=require('bluebird');var rs=require(_0x33a1('0x2'));var fs=require('fs');var Redis=require(_0x33a1('0x3'));var db=require(_0x33a1('0x4'))['db'];var utils=require(_0x33a1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x33a1('0x6'));var jayson=require(_0x33a1('0x7'));var client=jayson[_0x33a1('0x8')][_0x33a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14ae71,_0x2a51c2,_0x48d185){return new BPromise(function(_0x4541bf,_0x37e7fd){return client[_0x33a1('0xa')](_0x14ae71,_0x48d185)['then'](function(_0x274f09){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x2a51c2,_0x33a1('0xb'));logger[_0x33a1('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x2a51c2,_0x33a1('0xb'),JSON['stringify'](_0x274f09));if(_0x274f09[_0x33a1('0xd')]){if(_0x274f09[_0x33a1('0xd')][_0x33a1('0xe')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2a51c2,_0x274f09[_0x33a1('0xd')][_0x33a1('0xf')]);return _0x37e7fd(_0x274f09['error'][_0x33a1('0xf')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2a51c2,_0x274f09['error']['message']);return _0x4541bf(_0x274f09[_0x33a1('0xd')]['message']);}else{logger[_0x33a1('0x10')](_0x33a1('0x11'),_0x2a51c2,'request\x20sent');_0x4541bf(_0x274f09['result'][_0x33a1('0xf')]);}})[_0x33a1('0x12')](function(_0x35fe5d){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2a51c2,_0x35fe5d);_0x37e7fd(_0x35fe5d);});});}
\ No newline at end of file
index 7ee951e..a14b843 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb418=['get','isAuthenticated','/describe','describe','/:id','show','post','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller'];(function(_0x655946,_0x575a36){var _0x16ad9c=function(_0x126714){while(--_0x126714){_0x655946['push'](_0x655946['shift']());}};_0x16ad9c(++_0x575a36);}(_0xb418,0xa1));var _0x8b41=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xb418[_0x2dadb9];return _0x2f0097;};'use strict';var multer=require(_0x8b41('0x0'));var util=require(_0x8b41('0x1'));var path=require(_0x8b41('0x2'));var timeout=require(_0x8b41('0x3'));var express=require(_0x8b41('0x4'));var router=express[_0x8b41('0x5')]();var auth=require(_0x8b41('0x6'));var interaction=require(_0x8b41('0x7'));var config=require('../../config/environment');var controller=require(_0x8b41('0x8'));router[_0x8b41('0x9')]('/',auth[_0x8b41('0xa')](),controller['index']);router['get'](_0x8b41('0xb'),auth[_0x8b41('0xa')](),controller[_0x8b41('0xc')]);router[_0x8b41('0x9')](_0x8b41('0xd'),auth[_0x8b41('0xa')](),controller[_0x8b41('0xe')]);router[_0x8b41('0xf')]('/',auth[_0x8b41('0xa')](),controller['create']);router['put'](_0x8b41('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8b41('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x8b41('0x10')]=router;
\ No newline at end of file
+var _0x5f48=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f48,0xb0));var _0x85f4=function(_0x13b9f5,_0x67f583){_0x13b9f5=_0x13b9f5-0x0;var _0x3f3489=_0x5f48[_0x13b9f5];return _0x3f3489;};'use strict';var multer=require(_0x85f4('0x0'));var util=require(_0x85f4('0x1'));var path=require('path');var timeout=require(_0x85f4('0x2'));var express=require(_0x85f4('0x3'));var router=express['Router']();var auth=require(_0x85f4('0x4'));var interaction=require(_0x85f4('0x5'));var config=require(_0x85f4('0x6'));var controller=require('./memberReport.controller');router[_0x85f4('0x7')]('/',auth[_0x85f4('0x8')](),controller['index']);router[_0x85f4('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x85f4('0x9')]);router[_0x85f4('0x7')](_0x85f4('0xa'),auth['isAuthenticated'](),controller[_0x85f4('0xb')]);router[_0x85f4('0xc')]('/',auth[_0x85f4('0x8')](),controller[_0x85f4('0xd')]);router['put'](_0x85f4('0xa'),auth[_0x85f4('0x8')](),controller[_0x85f4('0xe')]);router[_0x85f4('0xf')](_0x85f4('0xa'),auth['isAuthenticated'](),controller[_0x85f4('0x10')]);module[_0x85f4('0x11')]=router;
\ No newline at end of file
index 1fb9cff..3161e30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8a6=['exitAt','talk:[dial\x20string]','sequelize','exports','STRING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue'];(function(_0x463384,_0x11f07c){var _0x45014f=function(_0x1f82db){while(--_0x1f82db){_0x463384['push'](_0x463384['shift']());}};_0x45014f(++_0x11f07c);}(_0xe8a6,0x1a4));var _0x6e8a=function(_0x4c5765,_0x1a354a){_0x4c5765=_0x4c5765-0x0;var _0x190b3d=_0xe8a6[_0x4c5765];return _0x190b3d;};'use strict';var Sequelize=require(_0x6e8a('0x0'));var moment=require('moment');module[_0x6e8a('0x1')]={'channel':{'type':Sequelize[_0x6e8a('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x6e8a('0x2')]},'type':{'type':Sequelize[_0x6e8a('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x6e8a('0x3')]},'enterAt':{'type':Sequelize[_0x6e8a('0x4')]},'exitAt':{'type':Sequelize[_0x6e8a('0x4')],'set':function(_0x29c688){var _0x26dcfa=moment(_0x29c688);var _0x5e4010=moment(this[_0x6e8a('0x5')](_0x6e8a('0x6')));var _0x158dba=_0x26dcfa[_0x6e8a('0x7')](_0x5e4010,'seconds');this[_0x6e8a('0x8')](_0x6e8a('0x9'),_0x29c688);this['setDataValue']('duration',_0x158dba||null);}},'data1':{'type':Sequelize[_0x6e8a('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x6e8a('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x6e8a('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x6e8a('0x2')],'comment':_0x6e8a('0xa')},'data5':{'type':Sequelize['STRING'],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x6e8a('0x2')]},'internal':{'type':Sequelize[_0x6e8a('0x3')]},'uniqueid':{'type':Sequelize[_0x6e8a('0x2')]}};
\ No newline at end of file
+var _0x005e=['getDataValue','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE'];(function(_0xacc729,_0x1a6059){var _0x13ba9d=function(_0xccce3){while(--_0xccce3){_0xacc729['push'](_0xacc729['shift']());}};_0x13ba9d(++_0x1a6059);}(_0x005e,0x1f3));var _0xe005=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x005e[_0x32f7d7];return _0x133d09;};'use strict';var Sequelize=require(_0xe005('0x0'));var moment=require(_0xe005('0x1'));module['exports']={'channel':{'type':Sequelize[_0xe005('0x2')]},'membername':{'type':Sequelize[_0xe005('0x2')]},'interface':{'type':Sequelize[_0xe005('0x2')]},'type':{'type':Sequelize[_0xe005('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xe005('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe005('0x4')],'set':function(_0x5a0123){var _0xfbb3d5=moment(_0x5a0123);var _0x125162=moment(this[_0xe005('0x5')]('enterAt'));var _0x3c6d80=_0xfbb3d5['diff'](_0x125162,_0xe005('0x6'));this[_0xe005('0x7')](_0xe005('0x8'),_0x5a0123);this['setDataValue'](_0xe005('0x9'),_0x3c6d80||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xe005('0xa')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xe005('0x2')],'comment':_0xe005('0xb')},'data4':{'type':Sequelize[_0xe005('0x2')],'comment':_0xe005('0xc')},'data5':{'type':Sequelize['STRING'],'comment':_0xe005('0xd')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 9d393fc..fb4e09d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bc0=['body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','sendStatus','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x8bc0,0x123));var _0x08bc=function(_0x32be65,_0x5d9865){_0x32be65=_0x32be65-0x0;var _0x332615=_0x8bc0[_0x32be65];return _0x332615;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x08bc('0x0'));var rimraf=require(_0x08bc('0x1'));var zipdir=require(_0x08bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x08bc('0x3'));var moment=require('moment');var BPromise=require(_0x08bc('0x4'));var Mustache=require(_0x08bc('0x5'));var util=require(_0x08bc('0x6'));var path=require(_0x08bc('0x7'));var sox=require(_0x08bc('0x8'));var csv=require(_0x08bc('0x9'));var ejs=require(_0x08bc('0xa'));var fs=require('fs');var _=require(_0x08bc('0xb'));var squel=require(_0x08bc('0xc'));var crypto=require(_0x08bc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x08bc('0xe'));var toCsv=require(_0x08bc('0x9'));var querystring=require(_0x08bc('0xf'));var Papa=require(_0x08bc('0x10'));var Redis=require(_0x08bc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x08bc('0x12'));var as=require(_0x08bc('0x13'));var hardwareService=require(_0x08bc('0x14'));var logger=require('../../config/logger')(_0x08bc('0x15'));var utils=require('../../config/utils');var config=require(_0x08bc('0x16'));var db=require(_0x08bc('0x17'))['db'];function respondWithStatusCode(_0x5e85ee,_0x147060){_0x147060=_0x147060||0xcc;return function(_0x4b2855){if(_0x4b2855){return _0x5e85ee['sendStatus'](_0x147060);}return _0x5e85ee['status'](_0x147060)[_0x08bc('0x18')]();};}function respondWithResult(_0x4d7c3d,_0x16914){_0x16914=_0x16914||0xc8;return function(_0x948253){if(_0x948253){return _0x4d7c3d['status'](_0x16914)[_0x08bc('0x19')](_0x948253);}};}function respondWithFilteredResult(_0x29ad4e,_0x3afa16){return function(_0x13157c){if(_0x13157c){var _0x14bc82=_0x13157c[_0x08bc('0x1a')],_0x8ea279=_0x3afa16[_0x08bc('0x1b')],_0x568e54=_0x3afa16['offset']+_0x3afa16[_0x08bc('0x1c')],_0x4a0685;if(_0x568e54>=_0x14bc82){_0x568e54=_0x14bc82;_0x4a0685=0xc8;}else{_0x4a0685=0xce;}_0x29ad4e[_0x08bc('0x1d')](_0x4a0685);return _0x29ad4e[_0x08bc('0x1e')](_0x08bc('0x1f'),_0x8ea279+'-'+_0x568e54+'/'+_0x14bc82)[_0x08bc('0x19')](_0x13157c);}return null;};}function patchUpdates(_0x3f98de){return function(_0x33daa7){try{jsonpatch[_0x08bc('0x20')](_0x33daa7,_0x3f98de,!![]);}catch(_0x4e7d82){return BPromise[_0x08bc('0x21')](_0x4e7d82);}return _0x33daa7[_0x08bc('0x22')]();};}function saveUpdates(_0x3cd833,_0x1c78f2){return function(_0xb32be4){if(_0xb32be4){return _0xb32be4[_0x08bc('0x23')](_0x3cd833)['then'](function(_0xe7085d){return _0xe7085d;});}return null;};}function removeEntity(_0x4b3e30,_0x3d6f39){return function(_0x222880){if(_0x222880){return _0x222880['destroy']()[_0x08bc('0x24')](function(){_0x4b3e30[_0x08bc('0x1d')](0xcc)[_0x08bc('0x18')]();});}};}function handleEntityNotFound(_0x4c013c,_0x5ba77e){return function(_0x254703){if(!_0x254703){_0x4c013c[_0x08bc('0x25')](0x194);}return _0x254703;};}function handleError(_0x43d6a7,_0x3ecc1c){_0x3ecc1c=_0x3ecc1c||0x1f4;return function(_0x3d954a){logger['error'](_0x3d954a['stack']);if(_0x3d954a[_0x08bc('0x26')]){delete _0x3d954a['name'];}_0x43d6a7[_0x08bc('0x1d')](_0x3ecc1c)[_0x08bc('0x27')](_0x3d954a);};}exports[_0x08bc('0x28')]=function(_0x3e5360,_0x5a0556){var _0x4ed761={},_0x29e655={},_0x1aa264={'count':0x0,'rows':[]};var _0x3e9a04=_[_0x08bc('0x29')](db[_0x08bc('0x2a')]['rawAttributes'],function(_0x55a449){return{'name':_0x55a449['fieldName'],'type':_0x55a449[_0x08bc('0x2b')][_0x08bc('0x2c')]};});_0x29e655[_0x08bc('0x2d')]=_[_0x08bc('0x29')](_0x3e9a04,_0x08bc('0x26'));_0x29e655[_0x08bc('0x2e')]=_[_0x08bc('0x2f')](_0x3e5360[_0x08bc('0x2e')]);_0x29e655[_0x08bc('0x30')]=_[_0x08bc('0x31')](_0x29e655[_0x08bc('0x2d')],_0x29e655['query']);_0x4ed761[_0x08bc('0x32')]=_[_0x08bc('0x31')](_0x29e655[_0x08bc('0x2d')],qs[_0x08bc('0x33')](_0x3e5360[_0x08bc('0x2e')][_0x08bc('0x33')]));_0x4ed761[_0x08bc('0x32')]=_0x4ed761['attributes'][_0x08bc('0x34')]?_0x4ed761[_0x08bc('0x32')]:_0x29e655['model'];if(!_0x3e5360['query']['hasOwnProperty']('nolimit')){_0x4ed761[_0x08bc('0x1c')]=qs[_0x08bc('0x1c')](_0x3e5360[_0x08bc('0x2e')][_0x08bc('0x1c')]);_0x4ed761[_0x08bc('0x1b')]=qs[_0x08bc('0x1b')](_0x3e5360['query'][_0x08bc('0x1b')]);}_0x4ed761[_0x08bc('0x35')]=qs[_0x08bc('0x36')](_0x3e5360[_0x08bc('0x2e')]['sort']);_0x4ed761['where']=qs[_0x08bc('0x30')](_[_0x08bc('0x37')](_0x3e5360[_0x08bc('0x2e')],_0x29e655[_0x08bc('0x30')]),_0x3e9a04);if(_0x3e5360['query'][_0x08bc('0x38')]){_0x4ed761[_0x08bc('0x39')]=_['merge'](_0x4ed761[_0x08bc('0x39')],{'$or':_[_0x08bc('0x29')](_0x3e9a04,function(_0x215b3a){if(_0x215b3a[_0x08bc('0x2b')]!=='VIRTUAL'){var _0x10670d={};_0x10670d[_0x215b3a['name']]={'$like':'%'+_0x3e5360[_0x08bc('0x2e')][_0x08bc('0x38')]+'%'};return _0x10670d;}})});}_0x4ed761=_[_0x08bc('0x3a')]({},_0x4ed761,_0x3e5360[_0x08bc('0x3b')]);var _0x525711={'where':_0x4ed761[_0x08bc('0x39')]};return db[_0x08bc('0x2a')][_0x08bc('0x1a')](_0x525711)[_0x08bc('0x24')](function(_0x42f207){_0x1aa264[_0x08bc('0x1a')]=_0x42f207;if(_0x3e5360['query'][_0x08bc('0x3c')]){_0x4ed761[_0x08bc('0x3d')]=[{'all':!![]}];}return db[_0x08bc('0x2a')][_0x08bc('0x3e')](_0x4ed761);})[_0x08bc('0x24')](function(_0x4a61c2){_0x1aa264[_0x08bc('0x3f')]=_0x4a61c2;return _0x1aa264;})[_0x08bc('0x24')](respondWithFilteredResult(_0x5a0556,_0x4ed761))[_0x08bc('0x40')](handleError(_0x5a0556,null));};exports[_0x08bc('0x41')]=function(_0x5aa850,_0x54084b){var _0x238901={'raw':!![],'where':{'id':_0x5aa850[_0x08bc('0x42')]['id']}},_0x2192c7={};_0x2192c7[_0x08bc('0x2d')]=_['keys'](db['MemberReport'][_0x08bc('0x43')]);_0x2192c7[_0x08bc('0x2e')]=_[_0x08bc('0x2f')](_0x5aa850['query']);_0x2192c7[_0x08bc('0x30')]=_[_0x08bc('0x31')](_0x2192c7[_0x08bc('0x2d')],_0x2192c7['query']);_0x238901[_0x08bc('0x32')]=_['intersection'](_0x2192c7[_0x08bc('0x2d')],qs['fields'](_0x5aa850[_0x08bc('0x2e')][_0x08bc('0x33')]));_0x238901[_0x08bc('0x32')]=_0x238901['attributes']['length']?_0x238901[_0x08bc('0x32')]:_0x2192c7[_0x08bc('0x2d')];if(_0x5aa850[_0x08bc('0x2e')]['includeAll']){_0x238901['include']=[{'all':!![]}];}_0x238901=_[_0x08bc('0x3a')]({},_0x238901,_0x5aa850[_0x08bc('0x3b')]);return db['MemberReport'][_0x08bc('0x44')](_0x238901)[_0x08bc('0x24')](handleEntityNotFound(_0x54084b,null))[_0x08bc('0x24')](respondWithResult(_0x54084b,null))[_0x08bc('0x40')](handleError(_0x54084b,null));};exports['create']=function(_0x26a16b,_0x1f3a07){return db[_0x08bc('0x2a')]['create'](_0x26a16b[_0x08bc('0x45')],{})['then'](respondWithResult(_0x1f3a07,0xc9))[_0x08bc('0x40')](handleError(_0x1f3a07,null));};exports[_0x08bc('0x23')]=function(_0x5587ad,_0x4f1bd3){if(_0x5587ad['body']['id']){delete _0x5587ad[_0x08bc('0x45')]['id'];}return db[_0x08bc('0x2a')]['find']({'where':{'id':_0x5587ad[_0x08bc('0x42')]['id']}})[_0x08bc('0x24')](handleEntityNotFound(_0x4f1bd3,null))['then'](saveUpdates(_0x5587ad[_0x08bc('0x45')],null))[_0x08bc('0x24')](respondWithResult(_0x4f1bd3,null))[_0x08bc('0x40')](handleError(_0x4f1bd3,null));};exports[_0x08bc('0x46')]=function(_0x3c4100,_0x64292d){return db['MemberReport'][_0x08bc('0x44')]({'where':{'id':_0x3c4100[_0x08bc('0x42')]['id']}})['then'](handleEntityNotFound(_0x64292d,null))[_0x08bc('0x24')](removeEntity(_0x64292d,null))['catch'](handleError(_0x64292d,null));};exports[_0x08bc('0x47')]=function(_0x2104e5,_0x207d82){return db[_0x08bc('0x2a')]['describe']()[_0x08bc('0x24')](respondWithResult(_0x207d82,null))[_0x08bc('0x40')](handleError(_0x207d82,null));};
\ No newline at end of file
+var _0xcfdf=['describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MemberReport','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','params','options','find','create','body','catch'];(function(_0x546fd1,_0x524034){var _0x3fb790=function(_0x5ed3b9){while(--_0x5ed3b9){_0x546fd1['push'](_0x546fd1['shift']());}};_0x3fb790(++_0x524034);}(_0xcfdf,0x93));var _0xfcfd=function(_0x1bec60,_0x554ed4){_0x1bec60=_0x1bec60-0x0;var _0x2c94b8=_0xcfdf[_0x1bec60];return _0x2c94b8;};'use strict';var pdf=require(_0xfcfd('0x0'));var emlformat=require(_0xfcfd('0x1'));var rimraf=require(_0xfcfd('0x2'));var zipdir=require(_0xfcfd('0x3'));var jsonpatch=require(_0xfcfd('0x4'));var rp=require('request-promise');var moment=require(_0xfcfd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfcfd('0x6'));var util=require(_0xfcfd('0x7'));var path=require(_0xfcfd('0x8'));var sox=require(_0xfcfd('0x9'));var csv=require(_0xfcfd('0xa'));var ejs=require(_0xfcfd('0xb'));var fs=require('fs');var _=require(_0xfcfd('0xc'));var squel=require(_0xfcfd('0xd'));var crypto=require(_0xfcfd('0xe'));var jsforce=require(_0xfcfd('0xf'));var deskjs=require(_0xfcfd('0x10'));var toCsv=require(_0xfcfd('0xa'));var querystring=require(_0xfcfd('0x11'));var Papa=require('papaparse');var Redis=require(_0xfcfd('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfcfd('0x13'));var hardwareService=require(_0xfcfd('0x14'));var logger=require(_0xfcfd('0x15'))(_0xfcfd('0x16'));var utils=require(_0xfcfd('0x17'));var config=require('../../config/environment');var db=require(_0xfcfd('0x18'))['db'];function respondWithStatusCode(_0x11542e,_0x3f1d2f){_0x3f1d2f=_0x3f1d2f||0xcc;return function(_0x1f6f03){if(_0x1f6f03){return _0x11542e[_0xfcfd('0x19')](_0x3f1d2f);}return _0x11542e[_0xfcfd('0x1a')](_0x3f1d2f)[_0xfcfd('0x1b')]();};}function respondWithResult(_0xf33ce,_0xad843a){_0xad843a=_0xad843a||0xc8;return function(_0x42e16e){if(_0x42e16e){return _0xf33ce['status'](_0xad843a)[_0xfcfd('0x1c')](_0x42e16e);}};}function respondWithFilteredResult(_0x415f79,_0x42106b){return function(_0x2954fb){if(_0x2954fb){var _0x50486d=_0x2954fb['count'],_0x3cce81=_0x42106b[_0xfcfd('0x1d')],_0x33e45d=_0x42106b[_0xfcfd('0x1d')]+_0x42106b['limit'],_0x31eae4;if(_0x33e45d>=_0x50486d){_0x33e45d=_0x50486d;_0x31eae4=0xc8;}else{_0x31eae4=0xce;}_0x415f79['status'](_0x31eae4);return _0x415f79['set'](_0xfcfd('0x1e'),_0x3cce81+'-'+_0x33e45d+'/'+_0x50486d)[_0xfcfd('0x1c')](_0x2954fb);}return null;};}function patchUpdates(_0x4f80e6){return function(_0x27a533){try{jsonpatch[_0xfcfd('0x1f')](_0x27a533,_0x4f80e6,!![]);}catch(_0x425534){return BPromise[_0xfcfd('0x20')](_0x425534);}return _0x27a533[_0xfcfd('0x21')]();};}function saveUpdates(_0x2713e8,_0x316b5b){return function(_0x512279){if(_0x512279){return _0x512279[_0xfcfd('0x22')](_0x2713e8)[_0xfcfd('0x23')](function(_0x45d68c){return _0x45d68c;});}return null;};}function removeEntity(_0x8dbb62,_0x329fbc){return function(_0x5ebf76){if(_0x5ebf76){return _0x5ebf76[_0xfcfd('0x24')]()['then'](function(){_0x8dbb62[_0xfcfd('0x1a')](0xcc)[_0xfcfd('0x1b')]();});}};}function handleEntityNotFound(_0x13bacd,_0x415246){return function(_0xd71884){if(!_0xd71884){_0x13bacd[_0xfcfd('0x19')](0x194);}return _0xd71884;};}function handleError(_0x1b5d35,_0x5dfbe6){_0x5dfbe6=_0x5dfbe6||0x1f4;return function(_0x474e77){logger[_0xfcfd('0x25')](_0x474e77[_0xfcfd('0x26')]);if(_0x474e77[_0xfcfd('0x27')]){delete _0x474e77[_0xfcfd('0x27')];}_0x1b5d35['status'](_0x5dfbe6)[_0xfcfd('0x28')](_0x474e77);};}exports[_0xfcfd('0x29')]=function(_0x404039,_0xd3710f){var _0x4c6e43={},_0x3bb483={},_0x3c8b4c={'count':0x0,'rows':[]};var _0x5d9e6e=_[_0xfcfd('0x2a')](db[_0xfcfd('0x2b')][_0xfcfd('0x2c')],function(_0x104853){return{'name':_0x104853['fieldName'],'type':_0x104853['type']['key']};});_0x3bb483[_0xfcfd('0x2d')]=_[_0xfcfd('0x2a')](_0x5d9e6e,_0xfcfd('0x27'));_0x3bb483[_0xfcfd('0x2e')]=_[_0xfcfd('0x2f')](_0x404039['query']);_0x3bb483[_0xfcfd('0x30')]=_[_0xfcfd('0x31')](_0x3bb483[_0xfcfd('0x2d')],_0x3bb483[_0xfcfd('0x2e')]);_0x4c6e43['attributes']=_[_0xfcfd('0x31')](_0x3bb483[_0xfcfd('0x2d')],qs[_0xfcfd('0x32')](_0x404039[_0xfcfd('0x2e')][_0xfcfd('0x32')]));_0x4c6e43[_0xfcfd('0x33')]=_0x4c6e43[_0xfcfd('0x33')][_0xfcfd('0x34')]?_0x4c6e43['attributes']:_0x3bb483[_0xfcfd('0x2d')];if(!_0x404039[_0xfcfd('0x2e')][_0xfcfd('0x35')](_0xfcfd('0x36'))){_0x4c6e43[_0xfcfd('0x37')]=qs[_0xfcfd('0x37')](_0x404039[_0xfcfd('0x2e')][_0xfcfd('0x37')]);_0x4c6e43[_0xfcfd('0x1d')]=qs['offset'](_0x404039[_0xfcfd('0x2e')]['offset']);}_0x4c6e43[_0xfcfd('0x38')]=qs[_0xfcfd('0x39')](_0x404039[_0xfcfd('0x2e')]['sort']);_0x4c6e43[_0xfcfd('0x3a')]=qs[_0xfcfd('0x30')](_[_0xfcfd('0x3b')](_0x404039[_0xfcfd('0x2e')],_0x3bb483[_0xfcfd('0x30')]),_0x5d9e6e);if(_0x404039[_0xfcfd('0x2e')][_0xfcfd('0x3c')]){_0x4c6e43[_0xfcfd('0x3a')]=_[_0xfcfd('0x3d')](_0x4c6e43[_0xfcfd('0x3a')],{'$or':_[_0xfcfd('0x2a')](_0x5d9e6e,function(_0x3f287f){if(_0x3f287f['type']!==_0xfcfd('0x3e')){var _0x583f46={};_0x583f46[_0x3f287f[_0xfcfd('0x27')]]={'$like':'%'+_0x404039[_0xfcfd('0x2e')][_0xfcfd('0x3c')]+'%'};return _0x583f46;}})});}_0x4c6e43=_[_0xfcfd('0x3d')]({},_0x4c6e43,_0x404039['options']);var _0xfd3531={'where':_0x4c6e43[_0xfcfd('0x3a')]};return db[_0xfcfd('0x2b')][_0xfcfd('0x3f')](_0xfd3531)['then'](function(_0x1a1694){_0x3c8b4c['count']=_0x1a1694;if(_0x404039[_0xfcfd('0x2e')][_0xfcfd('0x40')]){_0x4c6e43['include']=[{'all':!![]}];}return db[_0xfcfd('0x2b')][_0xfcfd('0x41')](_0x4c6e43);})[_0xfcfd('0x23')](function(_0x275f62){_0x3c8b4c['rows']=_0x275f62;return _0x3c8b4c;})[_0xfcfd('0x23')](respondWithFilteredResult(_0xd3710f,_0x4c6e43))['catch'](handleError(_0xd3710f,null));};exports['show']=function(_0x48d97f,_0x1e9736){var _0x8c693={'raw':!![],'where':{'id':_0x48d97f[_0xfcfd('0x42')]['id']}},_0x31df15={};_0x31df15['model']=_['keys'](db[_0xfcfd('0x2b')][_0xfcfd('0x2c')]);_0x31df15[_0xfcfd('0x2e')]=_[_0xfcfd('0x2f')](_0x48d97f[_0xfcfd('0x2e')]);_0x31df15[_0xfcfd('0x30')]=_[_0xfcfd('0x31')](_0x31df15[_0xfcfd('0x2d')],_0x31df15['query']);_0x8c693[_0xfcfd('0x33')]=_[_0xfcfd('0x31')](_0x31df15[_0xfcfd('0x2d')],qs[_0xfcfd('0x32')](_0x48d97f[_0xfcfd('0x2e')][_0xfcfd('0x32')]));_0x8c693[_0xfcfd('0x33')]=_0x8c693[_0xfcfd('0x33')]['length']?_0x8c693[_0xfcfd('0x33')]:_0x31df15[_0xfcfd('0x2d')];if(_0x48d97f[_0xfcfd('0x2e')][_0xfcfd('0x40')]){_0x8c693['include']=[{'all':!![]}];}_0x8c693=_['merge']({},_0x8c693,_0x48d97f[_0xfcfd('0x43')]);return db[_0xfcfd('0x2b')][_0xfcfd('0x44')](_0x8c693)[_0xfcfd('0x23')](handleEntityNotFound(_0x1e9736,null))[_0xfcfd('0x23')](respondWithResult(_0x1e9736,null))['catch'](handleError(_0x1e9736,null));};exports[_0xfcfd('0x45')]=function(_0x1bca4d,_0x36af46){return db[_0xfcfd('0x2b')][_0xfcfd('0x45')](_0x1bca4d[_0xfcfd('0x46')],{})[_0xfcfd('0x23')](respondWithResult(_0x36af46,0xc9))['catch'](handleError(_0x36af46,null));};exports[_0xfcfd('0x22')]=function(_0x744c3b,_0x2fcd86){if(_0x744c3b[_0xfcfd('0x46')]['id']){delete _0x744c3b['body']['id'];}return db[_0xfcfd('0x2b')]['find']({'where':{'id':_0x744c3b[_0xfcfd('0x42')]['id']}})[_0xfcfd('0x23')](handleEntityNotFound(_0x2fcd86,null))[_0xfcfd('0x23')](saveUpdates(_0x744c3b['body'],null))['then'](respondWithResult(_0x2fcd86,null))[_0xfcfd('0x47')](handleError(_0x2fcd86,null));};exports[_0xfcfd('0x24')]=function(_0x4940f4,_0x131cfa){return db[_0xfcfd('0x2b')][_0xfcfd('0x44')]({'where':{'id':_0x4940f4[_0xfcfd('0x42')]['id']}})[_0xfcfd('0x23')](handleEntityNotFound(_0x131cfa,null))[_0xfcfd('0x23')](removeEntity(_0x131cfa,null))['catch'](handleError(_0x131cfa,null));};exports[_0xfcfd('0x48')]=function(_0x30e421,_0x413d90){return db['MemberReport'][_0xfcfd('0x48')]()['then'](respondWithResult(_0x413d90,null))['catch'](handleError(_0x413d90,null));};
\ No newline at end of file
index 8974234..351e1d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports'];(function(_0x44901b,_0x3ed624){var _0x1ebdc5=function(_0xe2f58b){while(--_0xe2f58b){_0x44901b['push'](_0x44901b['shift']());}};_0x1ebdc5(++_0x3ed624);}(_0xe14d,0x1ee));var _0xde14=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xe14d[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('MemberReport',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[{'name':_0xde14('0xb'),'fields':[_0xde14('0xc'),_0xde14('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdb94=['path','rimraf','./memberReport.attributes','define','MemberReport','report_member','membername','interface','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x30272e,_0x55abc4){var _0x309031=function(_0xb9f2cb){while(--_0xb9f2cb){_0x30272e['push'](_0x30272e['shift']());}};_0x309031(++_0x55abc4);}(_0xdb94,0xe5));var _0x4db9=function(_0x413ce0,_0xa948d8){_0x413ce0=_0x413ce0-0x0;var _0x1973fb=_0xdb94[_0x413ce0];return _0x1973fb;};'use strict';var _=require('lodash');var util=require(_0x4db9('0x0'));var logger=require(_0x4db9('0x1'))('api');var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var fs=require('fs');var path=require(_0x4db9('0x5'));var rimraf=require(_0x4db9('0x6'));var config=require('../../config/environment');var attributes=require(_0x4db9('0x7'));module['exports']=function(_0x1d21a8,_0xc76bc1){return _0x1d21a8[_0x4db9('0x8')](_0x4db9('0x9'),attributes,{'tableName':_0x4db9('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x4db9('0xb'),_0x4db9('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 32b833b..f211501 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9478=['CreateMemberReport','create','UpdateMemberReport','update','body','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x2bf4ed,_0x5a2a52){var _0x31d26a=function(_0x491b3c){while(--_0x491b3c){_0x2bf4ed['push'](_0x2bf4ed['shift']());}};_0x31d26a(++_0x5a2a52);}(_0x9478,0x15b));var _0x8947=function(_0x2335d9,_0xf40d04){_0x2335d9=_0x2335d9-0x0;var _0x4e4d5b=_0x9478[_0x2335d9];return _0x4e4d5b;};'use strict';var _=require(_0x8947('0x0'));var util=require(_0x8947('0x1'));var moment=require(_0x8947('0x2'));var BPromise=require(_0x8947('0x3'));var rs=require(_0x8947('0x4'));var fs=require('fs');var Redis=require(_0x8947('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8947('0x6'));var logger=require('../../config/logger')(_0x8947('0x7'));var config=require(_0x8947('0x8'));var jayson=require(_0x8947('0x9'));var client=jayson[_0x8947('0xa')][_0x8947('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39f454,_0x13cad0,_0xdcc559){return new BPromise(function(_0x549dda,_0x257cd8){return client['request'](_0x39f454,_0xdcc559)[_0x8947('0xc')](function(_0x47e1fb){logger[_0x8947('0xd')](_0x8947('0xe'),_0x13cad0,_0x8947('0xf'));logger[_0x8947('0x10')](_0x8947('0x11'),_0x13cad0,_0x8947('0xf'),JSON[_0x8947('0x12')](_0x47e1fb));if(_0x47e1fb[_0x8947('0x13')]){if(_0x47e1fb[_0x8947('0x13')][_0x8947('0x14')]===0x1f4){logger[_0x8947('0x13')](_0x8947('0xe'),_0x13cad0,_0x47e1fb[_0x8947('0x13')][_0x8947('0x15')]);return _0x257cd8(_0x47e1fb[_0x8947('0x13')]['message']);}logger[_0x8947('0x13')](_0x8947('0xe'),_0x13cad0,_0x47e1fb[_0x8947('0x13')][_0x8947('0x15')]);return _0x549dda(_0x47e1fb[_0x8947('0x13')][_0x8947('0x15')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x13cad0,'request\x20sent');_0x549dda(_0x47e1fb['result'][_0x8947('0x15')]);}})[_0x8947('0x16')](function(_0x22324a){logger[_0x8947('0x13')]('MemberReport,\x20%s,\x20%s',_0x13cad0,_0x22324a);_0x257cd8(_0x22324a);});});}exports[_0x8947('0x17')]=function(_0x582d16){var _0x1289d7=this;return new Promise(function(_0x2c3fe4,_0x4b041f){return db[_0x8947('0x18')][_0x8947('0x19')]({'raw':_0x582d16[_0x8947('0x1a')]?_0x582d16[_0x8947('0x1a')][_0x8947('0x1b')]===undefined?!![]:![]:!![],'where':_0x582d16[_0x8947('0x1a')]?_0x582d16[_0x8947('0x1a')]['where']||null:null,'attributes':_0x582d16[_0x8947('0x1a')]?_0x582d16[_0x8947('0x1a')][_0x8947('0x1c')]||null:null,'limit':_0x582d16[_0x8947('0x1a')]?_0x582d16[_0x8947('0x1a')][_0x8947('0x1d')]||null:null,'include':_0x582d16[_0x8947('0x1a')]?_0x582d16[_0x8947('0x1a')][_0x8947('0x1e')]?_[_0x8947('0x1f')](_0x582d16['options'][_0x8947('0x1e')],function(_0x1e7f67){return{'model':db[_0x1e7f67[_0x8947('0x20')]],'as':_0x1e7f67['as'],'attributes':_0x1e7f67[_0x8947('0x1c')],'include':_0x1e7f67['include']?_[_0x8947('0x1f')](_0x1e7f67[_0x8947('0x1e')],function(_0x5715d7){return{'model':db[_0x5715d7[_0x8947('0x20')]],'as':_0x5715d7['as'],'attributes':_0x5715d7[_0x8947('0x1c')],'include':_0x5715d7['include']?_['map'](_0x5715d7[_0x8947('0x1e')],function(_0x421ac4){return{'model':db[_0x421ac4[_0x8947('0x20')]],'as':_0x421ac4['as'],'attributes':_0x421ac4[_0x8947('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8947('0xc')](function(_0x534acc){logger[_0x8947('0xd')](_0x8947('0x17'),_0x582d16);logger[_0x8947('0x10')](_0x8947('0x17'),_0x582d16,JSON['stringify'](_0x534acc));_0x2c3fe4(_0x534acc);})[_0x8947('0x16')](function(_0x5d21f8){logger[_0x8947('0x13')](_0x8947('0x17'),_0x5d21f8[_0x8947('0x15')],_0x582d16);_0x4b041f(_0x1289d7[_0x8947('0x13')](0x1f4,_0x5d21f8['message']));});});};exports[_0x8947('0x21')]=function(_0x3fe2b7){var _0x545671=this;return new Promise(function(_0x1ef504,_0x90976d){return db[_0x8947('0x18')][_0x8947('0x22')](_0x3fe2b7['body'],{'raw':_0x3fe2b7[_0x8947('0x1a')]?_0x3fe2b7[_0x8947('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x8947('0xc')](function(_0x40fe29){logger[_0x8947('0xd')](_0x8947('0x21'),_0x3fe2b7);logger['debug'](_0x8947('0x21'),_0x3fe2b7,JSON[_0x8947('0x12')](_0x40fe29));_0x1ef504(_0x40fe29);})[_0x8947('0x16')](function(_0x420cf5){logger[_0x8947('0x13')](_0x8947('0x21'),_0x420cf5[_0x8947('0x15')],_0x3fe2b7);_0x90976d(_0x545671[_0x8947('0x13')](0x1f4,_0x420cf5[_0x8947('0x15')]));});});};exports[_0x8947('0x23')]=function(_0x53ea7c){var _0x81fe44=this;return new Promise(function(_0x14f4ba,_0x2aff06){return db['MemberReport'][_0x8947('0x24')](_0x53ea7c[_0x8947('0x25')],{'raw':_0x53ea7c[_0x8947('0x1a')]?_0x53ea7c['options'][_0x8947('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53ea7c[_0x8947('0x1a')]?_0x53ea7c[_0x8947('0x1a')]['where']||null:null,'attributes':_0x53ea7c[_0x8947('0x1a')]?_0x53ea7c[_0x8947('0x1a')][_0x8947('0x1c')]||null:null,'limit':_0x53ea7c[_0x8947('0x1a')]?_0x53ea7c[_0x8947('0x1a')][_0x8947('0x1d')]||null:null})[_0x8947('0xc')](function(_0x5c79a6){logger[_0x8947('0xd')](_0x8947('0x23'),_0x53ea7c);logger[_0x8947('0x10')](_0x8947('0x23'),_0x53ea7c,JSON[_0x8947('0x12')](_0x5c79a6));_0x14f4ba(_0x5c79a6);})['catch'](function(_0x50a8bf){logger['error'](_0x8947('0x23'),_0x50a8bf[_0x8947('0x15')],_0x53ea7c);_0x2aff06(_0x81fe44[_0x8947('0x13')](0x1f4,_0x50a8bf[_0x8947('0x15')]));});});};
\ No newline at end of file
+var _0x98b2=['request\x20sent','stringify','error','code','message','MemberReport,\x20%s,\x20%s','result','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','debug','CreateMemberReport','create','UpdateMemberReport','update','body','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x2464d1,_0x38b10a){var _0x1674f8=function(_0x29386e){while(--_0x29386e){_0x2464d1['push'](_0x2464d1['shift']());}};_0x1674f8(++_0x38b10a);}(_0x98b2,0x67));var _0x298b=function(_0x40dc39,_0xc4a47){_0x40dc39=_0x40dc39-0x0;var _0x4e03a0=_0x98b2[_0x40dc39];return _0x4e03a0;};'use strict';var _=require(_0x298b('0x0'));var util=require(_0x298b('0x1'));var moment=require(_0x298b('0x2'));var BPromise=require(_0x298b('0x3'));var rs=require(_0x298b('0x4'));var fs=require('fs');var Redis=require(_0x298b('0x5'));var db=require(_0x298b('0x6'))['db'];var utils=require(_0x298b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x298b('0x8'));var jayson=require(_0x298b('0x9'));var client=jayson[_0x298b('0xa')][_0x298b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50a39b,_0x1d1dba,_0x589118){return new BPromise(function(_0x782a3f,_0x212a6f){return client['request'](_0x50a39b,_0x589118)[_0x298b('0xc')](function(_0x1c172a){logger[_0x298b('0xd')]('MemberReport,\x20%s,\x20%s',_0x1d1dba,_0x298b('0xe'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x1d1dba,_0x298b('0xe'),JSON[_0x298b('0xf')](_0x1c172a));if(_0x1c172a[_0x298b('0x10')]){if(_0x1c172a[_0x298b('0x10')][_0x298b('0x11')]===0x1f4){logger[_0x298b('0x10')]('MemberReport,\x20%s,\x20%s',_0x1d1dba,_0x1c172a[_0x298b('0x10')][_0x298b('0x12')]);return _0x212a6f(_0x1c172a[_0x298b('0x10')][_0x298b('0x12')]);}logger[_0x298b('0x10')](_0x298b('0x13'),_0x1d1dba,_0x1c172a['error'][_0x298b('0x12')]);return _0x782a3f(_0x1c172a[_0x298b('0x10')][_0x298b('0x12')]);}else{logger[_0x298b('0xd')](_0x298b('0x13'),_0x1d1dba,_0x298b('0xe'));_0x782a3f(_0x1c172a[_0x298b('0x14')]['message']);}})['catch'](function(_0x4c18e9){logger[_0x298b('0x10')]('MemberReport,\x20%s,\x20%s',_0x1d1dba,_0x4c18e9);_0x212a6f(_0x4c18e9);});});}exports[_0x298b('0x15')]=function(_0x23ab77){var _0x2a493e=this;return new Promise(function(_0x4f1853,_0x2ba599){return db[_0x298b('0x16')][_0x298b('0x17')]({'raw':_0x23ab77[_0x298b('0x18')]?_0x23ab77[_0x298b('0x18')][_0x298b('0x19')]===undefined?!![]:![]:!![],'where':_0x23ab77['options']?_0x23ab77[_0x298b('0x18')][_0x298b('0x1a')]||null:null,'attributes':_0x23ab77[_0x298b('0x18')]?_0x23ab77[_0x298b('0x18')]['attributes']||null:null,'limit':_0x23ab77['options']?_0x23ab77[_0x298b('0x18')][_0x298b('0x1b')]||null:null,'include':_0x23ab77['options']?_0x23ab77['options'][_0x298b('0x1c')]?_[_0x298b('0x1d')](_0x23ab77[_0x298b('0x18')][_0x298b('0x1c')],function(_0x5aeb24){return{'model':db[_0x5aeb24[_0x298b('0x1e')]],'as':_0x5aeb24['as'],'attributes':_0x5aeb24[_0x298b('0x1f')],'include':_0x5aeb24['include']?_[_0x298b('0x1d')](_0x5aeb24['include'],function(_0x23b173){return{'model':db[_0x23b173['model']],'as':_0x23b173['as'],'attributes':_0x23b173[_0x298b('0x1f')],'include':_0x23b173[_0x298b('0x1c')]?_[_0x298b('0x1d')](_0x23b173[_0x298b('0x1c')],function(_0x5009e9){return{'model':db[_0x5009e9[_0x298b('0x1e')]],'as':_0x5009e9['as'],'attributes':_0x5009e9[_0x298b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x298b('0xc')](function(_0x81fd34){logger[_0x298b('0xd')](_0x298b('0x15'),_0x23ab77);logger[_0x298b('0x20')](_0x298b('0x15'),_0x23ab77,JSON[_0x298b('0xf')](_0x81fd34));_0x4f1853(_0x81fd34);})['catch'](function(_0x1e3f57){logger[_0x298b('0x10')](_0x298b('0x15'),_0x1e3f57[_0x298b('0x12')],_0x23ab77);_0x2ba599(_0x2a493e[_0x298b('0x10')](0x1f4,_0x1e3f57[_0x298b('0x12')]));});});};exports[_0x298b('0x21')]=function(_0x223595){var _0x14c037=this;return new Promise(function(_0x12d992,_0x30788a){return db[_0x298b('0x16')][_0x298b('0x22')](_0x223595['body'],{'raw':_0x223595[_0x298b('0x18')]?_0x223595[_0x298b('0x18')][_0x298b('0x19')]===undefined?!![]:![]:!![]})[_0x298b('0xc')](function(_0x4bb99d){logger[_0x298b('0xd')](_0x298b('0x21'),_0x223595);logger[_0x298b('0x20')](_0x298b('0x21'),_0x223595,JSON[_0x298b('0xf')](_0x4bb99d));_0x12d992(_0x4bb99d);})['catch'](function(_0x599bdd){logger['error'](_0x298b('0x21'),_0x599bdd[_0x298b('0x12')],_0x223595);_0x30788a(_0x14c037[_0x298b('0x10')](0x1f4,_0x599bdd[_0x298b('0x12')]));});});};exports[_0x298b('0x23')]=function(_0x59d8d8){var _0xe3c415=this;return new Promise(function(_0x1cd1f0,_0x43ce6d){return db[_0x298b('0x16')][_0x298b('0x24')](_0x59d8d8[_0x298b('0x25')],{'raw':_0x59d8d8[_0x298b('0x18')]?_0x59d8d8[_0x298b('0x18')][_0x298b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59d8d8[_0x298b('0x18')]?_0x59d8d8['options'][_0x298b('0x1a')]||null:null,'attributes':_0x59d8d8['options']?_0x59d8d8[_0x298b('0x18')]['attributes']||null:null,'limit':_0x59d8d8[_0x298b('0x18')]?_0x59d8d8[_0x298b('0x18')][_0x298b('0x1b')]||null:null})['then'](function(_0x198bba){logger['info'](_0x298b('0x23'),_0x59d8d8);logger['debug'](_0x298b('0x23'),_0x59d8d8,JSON[_0x298b('0xf')](_0x198bba));_0x1cd1f0(_0x198bba);})[_0x298b('0x26')](function(_0x274697){logger[_0x298b('0x10')]('UpdateMemberReport',_0x274697[_0x298b('0x12')],_0x59d8d8);_0x43ce6d(_0xe3c415[_0x298b('0x10')](0x1f4,_0x274697[_0x298b('0x12')]));});});};
\ No newline at end of file
index 13aa206..947a197 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe605=['index','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x5e10a0,_0x5b99da){var _0x259327=function(_0x197a2d){while(--_0x197a2d){_0x5e10a0['push'](_0x5e10a0['shift']());}};_0x259327(++_0x5b99da);}(_0xe605,0x92));var _0x5e60=function(_0x2b1039,_0x178590){_0x2b1039=_0x2b1039-0x0;var _0xaddddf=_0xe605[_0x2b1039];return _0xaddddf;};'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 auth=require(_0x5e60('0x5'));var interaction=require(_0x5e60('0x6'));var config=require(_0x5e60('0x7'));var controller=require(_0x5e60('0x8'));router[_0x5e60('0x9')]('/',controller[_0x5e60('0xa')]);module[_0x5e60('0xb')]=router;
\ No newline at end of file
+var _0xe2cf=['index','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0xf3de7a,_0x464f47){_0xf3de7a=_0xf3de7a-0x0;var _0x56f74a=_0xe2cf[_0xf3de7a];return _0x56f74a;};'use strict';var multer=require('multer');var util=require(_0xfe2c('0x0'));var path=require('path');var timeout=require(_0xfe2c('0x1'));var express=require('express');var router=express[_0xfe2c('0x2')]();var auth=require(_0xfe2c('0x3'));var interaction=require(_0xfe2c('0x4'));var config=require(_0xfe2c('0x5'));var controller=require('./migration.controller');router[_0xfe2c('0x6')]('/',controller[_0xfe2c('0x7')]);module['exports']=router;
\ No newline at end of file
index b91ac37..bb88cde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb21a=['exports','STRING','version','sequelize'];(function(_0x1c063a,_0x52b550){var _0x18fc92=function(_0x212806){while(--_0x212806){_0x1c063a['push'](_0x1c063a['shift']());}};_0x18fc92(++_0x52b550);}(_0xb21a,0x123));var _0xab21=function(_0x185977,_0x55a331){_0x185977=_0x185977-0x0;var _0x1045eb=_0xb21a[_0x185977];return _0x1045eb;};'use strict';var Sequelize=require(_0xab21('0x0'));module[_0xab21('0x1')]={'version':{'type':Sequelize[_0xab21('0x2')],'unique':_0xab21('0x3')}};
\ No newline at end of file
+var _0x1910=['sequelize','exports','version'];(function(_0x1f95b7,_0x3aed0a){var _0x228885=function(_0x1d817c){while(--_0x1d817c){_0x1f95b7['push'](_0x1f95b7['shift']());}};_0x228885(++_0x3aed0a);}(_0x1910,0xc0));var _0x0191=function(_0xa17394,_0x2d656f){_0xa17394=_0xa17394-0x0;var _0x145cbd=_0x1910[_0xa17394];return _0x145cbd;};'use strict';var Sequelize=require(_0x0191('0x0'));module[_0x0191('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x0191('0x2')}};
\ No newline at end of file
index be54de2..60e6a3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','Migration','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs'];(function(_0x38308b,_0x422fd9){var _0x4ec7cc=function(_0x2642bc){while(--_0x2642bc){_0x38308b['push'](_0x38308b['shift']());}};_0x4ec7cc(++_0x422fd9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5976f8,_0x1265b7){_0x5976f8=_0x5976f8-0x0;var _0x179715=_0xcb91[_0x5976f8];return _0x179715;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var authService=require(_0x1cb9('0xe'));var qs=require(_0x1cb9('0xf'));var as=require(_0x1cb9('0x10'));var hardwareService=require(_0x1cb9('0x11'));var logger=require('../../config/logger')(_0x1cb9('0x12'));var utils=require(_0x1cb9('0x13'));var config=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x46af58,_0x5445e1){_0x5445e1=_0x5445e1||0xcc;return function(_0x5e3c19){if(_0x5e3c19){return _0x46af58['sendStatus'](_0x5445e1);}return _0x46af58[_0x1cb9('0x16')](_0x5445e1)[_0x1cb9('0x17')]();};}function respondWithResult(_0x384496,_0x1c714f){_0x1c714f=_0x1c714f||0xc8;return function(_0x56884d){if(_0x56884d){return _0x384496[_0x1cb9('0x16')](_0x1c714f)[_0x1cb9('0x18')](_0x56884d);}};}function respondWithFilteredResult(_0x1b3cd7,_0x8dfa55){return function(_0x3e2d11){if(_0x3e2d11){var _0x5806d8=_0x3e2d11[_0x1cb9('0x19')],_0x5572cb=_0x8dfa55[_0x1cb9('0x1a')],_0xd446a3=_0x8dfa55[_0x1cb9('0x1a')]+_0x8dfa55[_0x1cb9('0x1b')],_0x3cc765;if(_0xd446a3>=_0x5806d8){_0xd446a3=_0x5806d8;_0x3cc765=0xc8;}else{_0x3cc765=0xce;}_0x1b3cd7[_0x1cb9('0x16')](_0x3cc765);return _0x1b3cd7['set']('Content-Range',_0x5572cb+'-'+_0xd446a3+'/'+_0x5806d8)[_0x1cb9('0x18')](_0x3e2d11);}return null;};}function patchUpdates(_0x41ac41){return function(_0x2b2669){try{jsonpatch[_0x1cb9('0x1c')](_0x2b2669,_0x41ac41,!![]);}catch(_0x280a84){return BPromise[_0x1cb9('0x1d')](_0x280a84);}return _0x2b2669[_0x1cb9('0x1e')]();};}function saveUpdates(_0x4ac422,_0x559bcc){return function(_0x1a5a72){if(_0x1a5a72){return _0x1a5a72['update'](_0x4ac422)[_0x1cb9('0x1f')](function(_0x2265ea){return _0x2265ea;});}return null;};}function removeEntity(_0x523b26,_0x599275){return function(_0x2e3854){if(_0x2e3854){return _0x2e3854[_0x1cb9('0x20')]()[_0x1cb9('0x1f')](function(){_0x523b26[_0x1cb9('0x16')](0xcc)[_0x1cb9('0x17')]();});}};}function handleEntityNotFound(_0x27db16,_0x59ebea){return function(_0x55b232){if(!_0x55b232){_0x27db16[_0x1cb9('0x21')](0x194);}return _0x55b232;};}function handleError(_0x557199,_0x10a419){_0x10a419=_0x10a419||0x1f4;return function(_0x2b1275){logger[_0x1cb9('0x22')](_0x2b1275[_0x1cb9('0x23')]);if(_0x2b1275[_0x1cb9('0x24')]){delete _0x2b1275['name'];}_0x557199[_0x1cb9('0x16')](_0x10a419)[_0x1cb9('0x25')](_0x2b1275);};}exports['index']=function(_0xd6891c,_0x21effa){var _0x41a9a0={},_0x1804fd={},_0x406821={'count':0x0,'rows':[]};var _0x21d6f5=_[_0x1cb9('0x26')](db[_0x1cb9('0x27')][_0x1cb9('0x28')],function(_0x9de64b){return{'name':_0x9de64b['fieldName'],'type':_0x9de64b[_0x1cb9('0x29')]['key']};});_0x1804fd[_0x1cb9('0x2a')]=_['map'](_0x21d6f5,_0x1cb9('0x24'));_0x1804fd[_0x1cb9('0x2b')]=_[_0x1cb9('0x2c')](_0xd6891c[_0x1cb9('0x2b')]);_0x1804fd['filters']=_[_0x1cb9('0x2d')](_0x1804fd['model'],_0x1804fd[_0x1cb9('0x2b')]);_0x41a9a0[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x1804fd['model'],qs[_0x1cb9('0x2f')](_0xd6891c['query'][_0x1cb9('0x2f')]));_0x41a9a0['attributes']=_0x41a9a0[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x41a9a0[_0x1cb9('0x2e')]:_0x1804fd[_0x1cb9('0x2a')];if(!_0xd6891c['query'][_0x1cb9('0x31')](_0x1cb9('0x32'))){_0x41a9a0[_0x1cb9('0x1b')]=qs[_0x1cb9('0x1b')](_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x1b')]);_0x41a9a0[_0x1cb9('0x1a')]=qs[_0x1cb9('0x1a')](_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x1a')]);}_0x41a9a0[_0x1cb9('0x33')]=qs[_0x1cb9('0x34')](_0xd6891c[_0x1cb9('0x2b')]['sort']);_0x41a9a0['where']=qs[_0x1cb9('0x35')](_[_0x1cb9('0x36')](_0xd6891c[_0x1cb9('0x2b')],_0x1804fd[_0x1cb9('0x35')]),_0x21d6f5);if(_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x37')]){_0x41a9a0[_0x1cb9('0x38')]=_[_0x1cb9('0x39')](_0x41a9a0['where'],{'$or':_[_0x1cb9('0x26')](_0x21d6f5,function(_0x1482c4){if(_0x1482c4[_0x1cb9('0x29')]!=='VIRTUAL'){var _0x2a5aac={};_0x2a5aac[_0x1482c4['name']]={'$like':'%'+_0xd6891c[_0x1cb9('0x2b')]['filter']+'%'};return _0x2a5aac;}})});}_0x41a9a0=_[_0x1cb9('0x39')]({},_0x41a9a0,_0xd6891c[_0x1cb9('0x3a')]);var _0x289b73={'where':_0x41a9a0[_0x1cb9('0x38')]};return db[_0x1cb9('0x27')][_0x1cb9('0x19')](_0x289b73)[_0x1cb9('0x1f')](function(_0x4a4788){_0x406821['count']=_0x4a4788;if(_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x3b')]){_0x41a9a0[_0x1cb9('0x3c')]=[{'all':!![]}];}return db[_0x1cb9('0x27')][_0x1cb9('0x3d')](_0x41a9a0);})[_0x1cb9('0x1f')](function(_0x32130b){_0x406821['rows']=_0x32130b;return _0x406821;})[_0x1cb9('0x1f')](respondWithFilteredResult(_0x21effa,_0x41a9a0))['catch'](handleError(_0x21effa,null));};
\ No newline at end of file
+var _0xf4eb=['hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','html-pdf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','apply','save','update','then','destroy','sendStatus','error','stack','name','Migration','rawAttributes','type','model','map','keys','query','filters','intersection','fields','attributes'];(function(_0x1716eb,_0x3d99ad){var _0x29f8b8=function(_0x34850f){while(--_0x34850f){_0x1716eb['push'](_0x1716eb['shift']());}};_0x29f8b8(++_0x3d99ad);}(_0xf4eb,0xec));var _0xbf4e=function(_0x242b14,_0x3d02f3){_0x242b14=_0x242b14-0x0;var _0x545cac=_0xf4eb[_0x242b14];return _0x545cac;};'use strict';var pdf=require(_0xbf4e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf4e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf4e('0x2'));var util=require(_0xbf4e('0x3'));var path=require(_0xbf4e('0x4'));var sox=require(_0xbf4e('0x5'));var csv=require(_0xbf4e('0x6'));var ejs=require(_0xbf4e('0x7'));var fs=require('fs');var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x6'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var db=require(_0xbf4e('0x12'))['db'];function respondWithStatusCode(_0x54a96e,_0x17fd01){_0x17fd01=_0x17fd01||0xcc;return function(_0x5a3035){if(_0x5a3035){return _0x54a96e['sendStatus'](_0x17fd01);}return _0x54a96e[_0xbf4e('0x13')](_0x17fd01)[_0xbf4e('0x14')]();};}function respondWithResult(_0x1e029b,_0x302841){_0x302841=_0x302841||0xc8;return function(_0x3b74bd){if(_0x3b74bd){return _0x1e029b[_0xbf4e('0x13')](_0x302841)['json'](_0x3b74bd);}};}function respondWithFilteredResult(_0x59fb15,_0x180432){return function(_0x1735ae){if(_0x1735ae){var _0x28fc6b=_0x1735ae[_0xbf4e('0x15')],_0x542909=_0x180432[_0xbf4e('0x16')],_0x14110b=_0x180432['offset']+_0x180432[_0xbf4e('0x17')],_0x2c292c;if(_0x14110b>=_0x28fc6b){_0x14110b=_0x28fc6b;_0x2c292c=0xc8;}else{_0x2c292c=0xce;}_0x59fb15['status'](_0x2c292c);return _0x59fb15['set']('Content-Range',_0x542909+'-'+_0x14110b+'/'+_0x28fc6b)['json'](_0x1735ae);}return null;};}function patchUpdates(_0x35992b){return function(_0x1ca73c){try{jsonpatch[_0xbf4e('0x18')](_0x1ca73c,_0x35992b,!![]);}catch(_0x4d9c2a){return BPromise['reject'](_0x4d9c2a);}return _0x1ca73c[_0xbf4e('0x19')]();};}function saveUpdates(_0x9a46ee,_0x3be138){return function(_0x3a875b){if(_0x3a875b){return _0x3a875b[_0xbf4e('0x1a')](_0x9a46ee)[_0xbf4e('0x1b')](function(_0x415963){return _0x415963;});}return null;};}function removeEntity(_0x3d642a,_0xd09e12){return function(_0x376832){if(_0x376832){return _0x376832[_0xbf4e('0x1c')]()['then'](function(){_0x3d642a[_0xbf4e('0x13')](0xcc)[_0xbf4e('0x14')]();});}};}function handleEntityNotFound(_0x51648c,_0x31e3f5){return function(_0x30994d){if(!_0x30994d){_0x51648c[_0xbf4e('0x1d')](0x194);}return _0x30994d;};}function handleError(_0x1bda8b,_0x3a5d72){_0x3a5d72=_0x3a5d72||0x1f4;return function(_0x4a0243){logger[_0xbf4e('0x1e')](_0x4a0243[_0xbf4e('0x1f')]);if(_0x4a0243[_0xbf4e('0x20')]){delete _0x4a0243['name'];}_0x1bda8b[_0xbf4e('0x13')](_0x3a5d72)['send'](_0x4a0243);};}exports['index']=function(_0x2bfccf,_0x5a0a9b){var _0x38c923={},_0x315df3={},_0x4021a9={'count':0x0,'rows':[]};var _0x41f918=_['map'](db[_0xbf4e('0x21')][_0xbf4e('0x22')],function(_0x43879d){return{'name':_0x43879d['fieldName'],'type':_0x43879d[_0xbf4e('0x23')]['key']};});_0x315df3[_0xbf4e('0x24')]=_[_0xbf4e('0x25')](_0x41f918,_0xbf4e('0x20'));_0x315df3['query']=_[_0xbf4e('0x26')](_0x2bfccf[_0xbf4e('0x27')]);_0x315df3[_0xbf4e('0x28')]=_[_0xbf4e('0x29')](_0x315df3[_0xbf4e('0x24')],_0x315df3[_0xbf4e('0x27')]);_0x38c923['attributes']=_[_0xbf4e('0x29')](_0x315df3[_0xbf4e('0x24')],qs['fields'](_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x2a')]));_0x38c923['attributes']=_0x38c923[_0xbf4e('0x2b')]['length']?_0x38c923[_0xbf4e('0x2b')]:_0x315df3['model'];if(!_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x2c')](_0xbf4e('0x2d'))){_0x38c923['limit']=qs[_0xbf4e('0x17')](_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x17')]);_0x38c923[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0x2bfccf[_0xbf4e('0x27')]['offset']);}_0x38c923[_0xbf4e('0x2e')]=qs[_0xbf4e('0x2f')](_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x2f')]);_0x38c923[_0xbf4e('0x30')]=qs['filters'](_['pick'](_0x2bfccf['query'],_0x315df3['filters']),_0x41f918);if(_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x31')]){_0x38c923[_0xbf4e('0x30')]=_[_0xbf4e('0x32')](_0x38c923[_0xbf4e('0x30')],{'$or':_[_0xbf4e('0x25')](_0x41f918,function(_0x355b42){if(_0x355b42[_0xbf4e('0x23')]!==_0xbf4e('0x33')){var _0x54527d={};_0x54527d[_0x355b42['name']]={'$like':'%'+_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x31')]+'%'};return _0x54527d;}})});}_0x38c923=_[_0xbf4e('0x32')]({},_0x38c923,_0x2bfccf['options']);var _0x3f46f1={'where':_0x38c923['where']};return db[_0xbf4e('0x21')][_0xbf4e('0x15')](_0x3f46f1)[_0xbf4e('0x1b')](function(_0xb30f90){_0x4021a9['count']=_0xb30f90;if(_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x34')]){_0x38c923[_0xbf4e('0x35')]=[{'all':!![]}];}return db[_0xbf4e('0x21')]['findAll'](_0x38c923);})[_0xbf4e('0x1b')](function(_0x44e96b){_0x4021a9[_0xbf4e('0x36')]=_0x44e96b;return _0x4021a9;})[_0xbf4e('0x1b')](respondWithFilteredResult(_0x5a0a9b,_0x38c923))[_0xbf4e('0x37')](handleError(_0x5a0a9b,null));};
\ No newline at end of file
index f30942a..aa0d629 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81d5=['request-promise','path','./migration.attributes','exports','define','Migration','migrations','lodash','util','api','moment','bluebird'];(function(_0x8eca89,_0x26e53a){var _0x32956f=function(_0x371481){while(--_0x371481){_0x8eca89['push'](_0x8eca89['shift']());}};_0x32956f(++_0x26e53a);}(_0x81d5,0x1ab));var _0x581d=function(_0x562998,_0x3fc02f){_0x562998=_0x562998-0x0;var _0xf6bc3a=_0x81d5[_0x562998];return _0xf6bc3a;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var logger=require('../../config/logger')(_0x581d('0x2'));var moment=require(_0x581d('0x3'));var BPromise=require(_0x581d('0x4'));var rp=require(_0x581d('0x5'));var fs=require('fs');var path=require(_0x581d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x581d('0x7'));module[_0x581d('0x8')]=function(_0x1895d2,_0x4bb545){return _0x1895d2[_0x581d('0x9')](_0x581d('0xa'),attributes,{'tableName':_0x581d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc79=['migrations','../../config/logger','bluebird','request-promise','path','rimraf','./migration.attributes','exports','Migration'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfc79,0x1c3));var _0x9fc7=function(_0x23139b,_0xabe89e){_0x23139b=_0x23139b-0x0;var _0x42272a=_0xfc79[_0x23139b];return _0x42272a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9fc7('0x0'))('api');var moment=require('moment');var BPromise=require(_0x9fc7('0x1'));var rp=require(_0x9fc7('0x2'));var fs=require('fs');var path=require(_0x9fc7('0x3'));var rimraf=require(_0x9fc7('0x4'));var config=require('../../config/environment');var attributes=require(_0x9fc7('0x5'));module[_0x9fc7('0x6')]=function(_0x5777c0,_0x32c028){return _0x5777c0['define'](_0x9fc7('0x7'),attributes,{'tableName':_0x9fc7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 786a6c8..08dceef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e1f=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0xf1fb8f,_0x240bbc){var _0x54c4d0=function(_0x3d5691){while(--_0x3d5691){_0xf1fb8f['push'](_0xf1fb8f['shift']());}};_0x54c4d0(++_0x240bbc);}(_0x8e1f,0x95));var _0xf8e1=function(_0x4fc476,_0xb7cdfd){_0x4fc476=_0x4fc476-0x0;var _0x2de7d8=_0x8e1f[_0x4fc476];return _0x2de7d8;};'use strict';var _=require(_0xf8e1('0x0'));var util=require(_0xf8e1('0x1'));var moment=require('moment');var BPromise=require(_0xf8e1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf8e1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8e1('0x4'));var logger=require(_0xf8e1('0x5'))(_0xf8e1('0x6'));var config=require(_0xf8e1('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x326787,_0x4e1fb2,_0x2678d8){return new BPromise(function(_0x59d6ec,_0x25beed){return client['request'](_0x326787,_0x2678d8)[_0xf8e1('0x8')](function(_0x555a48){logger[_0xf8e1('0x9')](_0xf8e1('0xa'),_0x4e1fb2,_0xf8e1('0xb'));logger['debug'](_0xf8e1('0xc'),_0x4e1fb2,_0xf8e1('0xb'),JSON[_0xf8e1('0xd')](_0x555a48));if(_0x555a48[_0xf8e1('0xe')]){if(_0x555a48[_0xf8e1('0xe')][_0xf8e1('0xf')]===0x1f4){logger[_0xf8e1('0xe')](_0xf8e1('0xa'),_0x4e1fb2,_0x555a48['error'][_0xf8e1('0x10')]);return _0x25beed(_0x555a48[_0xf8e1('0xe')][_0xf8e1('0x10')]);}logger['error']('Migration,\x20%s,\x20%s',_0x4e1fb2,_0x555a48[_0xf8e1('0xe')]['message']);return _0x59d6ec(_0x555a48[_0xf8e1('0xe')][_0xf8e1('0x10')]);}else{logger[_0xf8e1('0x9')](_0xf8e1('0xa'),_0x4e1fb2,_0xf8e1('0xb'));_0x59d6ec(_0x555a48[_0xf8e1('0x11')][_0xf8e1('0x10')]);}})[_0xf8e1('0x12')](function(_0x2a5a9f){logger[_0xf8e1('0xe')](_0xf8e1('0xa'),_0x4e1fb2,_0x2a5a9f);_0x25beed(_0x2a5a9f);});});}
\ No newline at end of file
+var _0xf4c9=['Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xf4c9[_0x2c7618];return _0x5ce3f0;};'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});function respondWithRpcPromise(_0x5cf322,_0x498795,_0x12aeb7){return new BPromise(function(_0x398b30,_0x72c8ea){return client[_0x9f4c('0x9')](_0x5cf322,_0x12aeb7)[_0x9f4c('0xa')](function(_0x37b693){logger['info'](_0x9f4c('0xb'),_0x498795,_0x9f4c('0xc'));logger[_0x9f4c('0xd')](_0x9f4c('0xe'),_0x498795,_0x9f4c('0xc'),JSON[_0x9f4c('0xf')](_0x37b693));if(_0x37b693[_0x9f4c('0x10')]){if(_0x37b693[_0x9f4c('0x10')]['code']===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x498795,_0x37b693[_0x9f4c('0x10')]['message']);return _0x72c8ea(_0x37b693['error'][_0x9f4c('0x11')]);}logger['error']('Migration,\x20%s,\x20%s',_0x498795,_0x37b693[_0x9f4c('0x10')]['message']);return _0x398b30(_0x37b693['error'][_0x9f4c('0x11')]);}else{logger['info'](_0x9f4c('0xb'),_0x498795,_0x9f4c('0xc'));_0x398b30(_0x37b693[_0x9f4c('0x12')][_0x9f4c('0x11')]);}})[_0x9f4c('0x13')](function(_0xb61bdf){logger['error'](_0x9f4c('0xb'),_0x498795,_0xb61bdf);_0x72c8ea(_0xb61bdf);});});}
\ No newline at end of file
index b14ab76..738dfcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf569=['get','index','isAuthenticated','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1ef781,_0x3ef340){var _0x3d296a=function(_0x28bf33){while(--_0x28bf33){_0x1ef781['push'](_0x1ef781['shift']());}};_0x3d296a(++_0x3ef340);}(_0xf569,0xd0));var _0x9f56=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xf569[_0x32b542];return _0x554d54;};'use strict';var multer=require('multer');var util=require(_0x9f56('0x0'));var path=require(_0x9f56('0x1'));var timeout=require(_0x9f56('0x2'));var express=require(_0x9f56('0x3'));var router=express[_0x9f56('0x4')]();var auth=require(_0x9f56('0x5'));var interaction=require(_0x9f56('0x6'));var config=require(_0x9f56('0x7'));var controller=require('./network.controller');router[_0x9f56('0x8')]('/',auth['isAuthenticated'](),controller[_0x9f56('0x9')]);router[_0x9f56('0x8')]('/:id',auth[_0x9f56('0xa')](),controller[_0x9f56('0xb')]);router['post']('/',auth[_0x9f56('0xa')](),controller[_0x9f56('0xc')]);router[_0x9f56('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x9f56('0xe')]);router[_0x9f56('0xf')]('/:id',auth[_0x9f56('0xa')](),controller[_0x9f56('0x10')]);module[_0x9f56('0x11')]=router;
\ No newline at end of file
+var _0x4c85=['../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','/:id','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0xffd1b5,_0x1ede18){var _0x3176d6=function(_0xe9ba48){while(--_0xe9ba48){_0xffd1b5['push'](_0xffd1b5['shift']());}};_0x3176d6(++_0x1ede18);}(_0x4c85,0xa5));var _0x54c8=function(_0x3cce93,_0x3daed2){_0x3cce93=_0x3cce93-0x0;var _0x56174e=_0x4c85[_0x3cce93];return _0x56174e;};'use strict';var multer=require(_0x54c8('0x0'));var util=require('util');var path=require(_0x54c8('0x1'));var timeout=require(_0x54c8('0x2'));var express=require(_0x54c8('0x3'));var router=express[_0x54c8('0x4')]();var auth=require(_0x54c8('0x5'));var interaction=require(_0x54c8('0x6'));var config=require(_0x54c8('0x7'));var controller=require(_0x54c8('0x8'));router[_0x54c8('0x9')]('/',auth[_0x54c8('0xa')](),controller['index']);router['get'](_0x54c8('0xb'),auth[_0x54c8('0xa')](),controller['show']);router['post']('/',auth[_0x54c8('0xa')](),controller[_0x54c8('0xc')]);router['put'](_0x54c8('0xb'),auth['isAuthenticated'](),controller[_0x54c8('0xd')]);router[_0x54c8('0xe')]('/:id',auth[_0x54c8('0xa')](),controller[_0x54c8('0xf')]);module[_0x54c8('0x10')]=router;
\ No newline at end of file
index 0b32694..11dbe46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x4ce1f6,_0x3b33d7){var _0x2027ec=function(_0x30a06e){while(--_0x30a06e){_0x4ce1f6['push'](_0x4ce1f6['shift']());}};_0x2027ec(++_0x3b33d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}};
\ No newline at end of file
+var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x4eb2c7,_0x3d6d8f){var _0xcec0a4=function(_0x400fee){while(--_0x400fee){_0x4eb2c7['push'](_0x4eb2c7['shift']());}};_0xcec0a4(++_0x3d6d8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}};
\ No newline at end of file
index f32faa0..80e62ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa889=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','rawAttributes','includeAll','find','create','sequelize','transaction','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','body','toLowerCase','chan_sip.so','STUN','TURN','server/files/templates/network.ejs','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','client','http','Sequelize','ValidationError','request','info','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','name','send','index','map','Network','fieldName','type','key','query','keys','filters'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xa889,0x108));var _0x9a88=function(_0x23cfab,_0x3d12b6){_0x23cfab=_0x23cfab-0x0;var _0x16b25d=_0xa889[_0x23cfab];return _0x16b25d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9a88('0x0'));var zipdir=require(_0x9a88('0x1'));var jsonpatch=require(_0x9a88('0x2'));var rp=require(_0x9a88('0x3'));var moment=require(_0x9a88('0x4'));var BPromise=require(_0x9a88('0x5'));var Mustache=require(_0x9a88('0x6'));var util=require(_0x9a88('0x7'));var path=require(_0x9a88('0x8'));var sox=require(_0x9a88('0x9'));var csv=require('to-csv');var ejs=require(_0x9a88('0xa'));var fs=require('fs');var _=require(_0x9a88('0xb'));var squel=require('squel');var crypto=require(_0x9a88('0xc'));var jsforce=require(_0x9a88('0xd'));var deskjs=require(_0x9a88('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9a88('0xf'));var Papa=require(_0x9a88('0x10'));var Redis=require('ioredis');var authService=require(_0x9a88('0x11'));var qs=require(_0x9a88('0x12'));var as=require(_0x9a88('0x13'));var hardwareService=require(_0x9a88('0x14'));var logger=require('../../config/logger')(_0x9a88('0x15'));var utils=require(_0x9a88('0x16'));var config=require(_0x9a88('0x17'));var db=require(_0x9a88('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x9a88('0x19')][_0x9a88('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x242a00,_0x40e9d6,_0xf07e70){if(_0xf07e70){var _0x5e3fd0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e3fd0['test'](_0x40e9d6)){return _0x242a00;}else{throw new db[(_0x9a88('0x1b'))][(_0x9a88('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x242a00;}}function respondWithRpcPromise(_0x183f79,_0x24b73c,_0xc95d4,_0x28f731){return new BPromise(function(_0x33c6fd,_0xf564b8){var _0x5e12ca=_0x28f731||client;return _0x5e12ca[_0x9a88('0x1d')](_0x183f79,_0xc95d4)['then'](function(_0x5c1a7b){logger[_0x9a88('0x1e')](_0x9a88('0x1f'),_0x24b73c,'request\x20sent');logger['debug'](_0x9a88('0x20'),_0x24b73c,_0x9a88('0x21'),JSON['stringify'](_0x5c1a7b));if(_0x5c1a7b[_0x9a88('0x22')]){if(_0x5c1a7b[_0x9a88('0x22')][_0x9a88('0x23')]===0x1f4){logger['error'](_0x9a88('0x1f'),_0x24b73c,_0x5c1a7b[_0x9a88('0x22')][_0x9a88('0x24')]);return _0xf564b8(_0x5c1a7b[_0x9a88('0x22')][_0x9a88('0x24')]);}logger[_0x9a88('0x22')](_0x9a88('0x1f'),_0x24b73c,_0x5c1a7b[_0x9a88('0x22')][_0x9a88('0x24')]);return _0x33c6fd(_0x5c1a7b[_0x9a88('0x22')][_0x9a88('0x24')]);}else{logger[_0x9a88('0x1e')](_0x9a88('0x1f'),_0x24b73c,_0x9a88('0x21'));_0x33c6fd(_0x5c1a7b['result'][_0x9a88('0x24')]);}})[_0x9a88('0x25')](function(_0x5f557d){logger[_0x9a88('0x22')](_0x9a88('0x1f'),_0x24b73c,_0x5f557d);_0xf564b8(_0x5f557d);});});}function respondWithStatusCode(_0x31e291,_0x365fe4){_0x365fe4=_0x365fe4||0xcc;return function(_0xf4462c){if(_0xf4462c){return _0x31e291[_0x9a88('0x26')](_0x365fe4);}return _0x31e291[_0x9a88('0x27')](_0x365fe4)[_0x9a88('0x28')]();};}function respondWithResult(_0xe575cb,_0x3b0a90){_0x3b0a90=_0x3b0a90||0xc8;return function(_0x364036){if(_0x364036){return _0xe575cb['status'](_0x3b0a90)['json'](_0x364036);}};}function respondWithFilteredResult(_0x3763fb,_0x26c387){return function(_0x3fa33a){if(_0x3fa33a){var _0x39ae3d=_0x3fa33a[_0x9a88('0x29')],_0x87347f=_0x26c387[_0x9a88('0x2a')],_0x5d893a=_0x26c387[_0x9a88('0x2a')]+_0x26c387[_0x9a88('0x2b')],_0x4165eb;if(_0x5d893a>=_0x39ae3d){_0x5d893a=_0x39ae3d;_0x4165eb=0xc8;}else{_0x4165eb=0xce;}_0x3763fb[_0x9a88('0x27')](_0x4165eb);return _0x3763fb[_0x9a88('0x2c')](_0x9a88('0x2d'),_0x87347f+'-'+_0x5d893a+'/'+_0x39ae3d)[_0x9a88('0x2e')](_0x3fa33a);}return null;};}function patchUpdates(_0x4e0281){return function(_0x162faf){try{jsonpatch['apply'](_0x162faf,_0x4e0281,!![]);}catch(_0x51b94b){return BPromise[_0x9a88('0x2f')](_0x51b94b);}return _0x162faf[_0x9a88('0x30')]();};}function saveUpdates(_0x488721,_0x3c4907){return function(_0x555627){if(_0x555627){return _0x555627[_0x9a88('0x31')](_0x488721)[_0x9a88('0x32')](function(_0x440343){return _0x440343;});}return null;};}function removeEntity(_0x3c6b39,_0xec9364){return function(_0x1b09cf){if(_0x1b09cf){return _0x1b09cf[_0x9a88('0x33')]()['then'](function(){_0x3c6b39[_0x9a88('0x27')](0xcc)[_0x9a88('0x28')]();});}};}function handleEntityNotFound(_0x215b65,_0xb7c06b){return function(_0x3ff689){if(!_0x3ff689){_0x215b65[_0x9a88('0x26')](0x194);}return _0x3ff689;};}function handleError(_0x59716b,_0x313960){_0x313960=_0x313960||0x1f4;return function(_0x4a86ea){logger[_0x9a88('0x22')](_0x4a86ea['stack']);if(_0x4a86ea['name']){delete _0x4a86ea[_0x9a88('0x34')];}_0x59716b[_0x9a88('0x27')](_0x313960)[_0x9a88('0x35')](_0x4a86ea);};}exports[_0x9a88('0x36')]=function(_0x4db581,_0x17e255){var _0x5b0948={},_0x3ea6d3={},_0x51ed4a={'count':0x0,'rows':[]};var _0x13a8b5=_[_0x9a88('0x37')](db[_0x9a88('0x38')]['rawAttributes'],function(_0xfad73d){return{'name':_0xfad73d[_0x9a88('0x39')],'type':_0xfad73d[_0x9a88('0x3a')][_0x9a88('0x3b')]};});_0x3ea6d3['model']=_[_0x9a88('0x37')](_0x13a8b5,_0x9a88('0x34'));_0x3ea6d3[_0x9a88('0x3c')]=_[_0x9a88('0x3d')](_0x4db581[_0x9a88('0x3c')]);_0x3ea6d3[_0x9a88('0x3e')]=_[_0x9a88('0x3f')](_0x3ea6d3[_0x9a88('0x40')],_0x3ea6d3[_0x9a88('0x3c')]);_0x5b0948[_0x9a88('0x41')]=_['intersection'](_0x3ea6d3['model'],qs[_0x9a88('0x42')](_0x4db581[_0x9a88('0x3c')][_0x9a88('0x42')]));_0x5b0948[_0x9a88('0x41')]=_0x5b0948['attributes'][_0x9a88('0x43')]?_0x5b0948[_0x9a88('0x41')]:_0x3ea6d3[_0x9a88('0x40')];if(!_0x4db581[_0x9a88('0x3c')][_0x9a88('0x44')](_0x9a88('0x45'))){_0x5b0948[_0x9a88('0x2b')]=qs[_0x9a88('0x2b')](_0x4db581['query'][_0x9a88('0x2b')]);_0x5b0948[_0x9a88('0x2a')]=qs[_0x9a88('0x2a')](_0x4db581[_0x9a88('0x3c')][_0x9a88('0x2a')]);}_0x5b0948[_0x9a88('0x46')]=qs[_0x9a88('0x47')](_0x4db581[_0x9a88('0x3c')][_0x9a88('0x47')]);_0x5b0948[_0x9a88('0x48')]=qs[_0x9a88('0x3e')](_[_0x9a88('0x49')](_0x4db581[_0x9a88('0x3c')],_0x3ea6d3[_0x9a88('0x3e')]),_0x13a8b5);if(_0x4db581[_0x9a88('0x3c')][_0x9a88('0x4a')]){_0x5b0948[_0x9a88('0x48')]=_[_0x9a88('0x4b')](_0x5b0948[_0x9a88('0x48')],{'$or':_[_0x9a88('0x37')](_0x13a8b5,function(_0x1d2339){if(_0x1d2339[_0x9a88('0x3a')]!==_0x9a88('0x4c')){var _0x3e4f06={};_0x3e4f06[_0x1d2339[_0x9a88('0x34')]]={'$like':'%'+_0x4db581[_0x9a88('0x3c')][_0x9a88('0x4a')]+'%'};return _0x3e4f06;}})});}_0x5b0948=_[_0x9a88('0x4b')]({},_0x5b0948,_0x4db581[_0x9a88('0x4d')]);var _0x56838d={'where':_0x5b0948[_0x9a88('0x48')]};return db[_0x9a88('0x38')][_0x9a88('0x29')](_0x56838d)['then'](function(_0x17f851){_0x51ed4a[_0x9a88('0x29')]=_0x17f851;if(_0x4db581[_0x9a88('0x3c')]['includeAll']){_0x5b0948[_0x9a88('0x4e')]=[{'all':!![]}];}return db[_0x9a88('0x38')]['findAll'](_0x5b0948);})[_0x9a88('0x32')](function(_0x4b5ac0){_0x51ed4a[_0x9a88('0x4f')]=_0x4b5ac0;return _0x51ed4a;})[_0x9a88('0x32')](respondWithFilteredResult(_0x17e255,_0x5b0948))['catch'](handleError(_0x17e255,null));};exports[_0x9a88('0x50')]=function(_0x3d3154,_0x2e4adb){var _0x19017e={'raw':!![],'where':{'id':_0x3d3154['params']['id']}},_0x1bd58d={};_0x1bd58d['model']=_[_0x9a88('0x3d')](db[_0x9a88('0x38')][_0x9a88('0x51')]);_0x1bd58d['query']=_['keys'](_0x3d3154[_0x9a88('0x3c')]);_0x1bd58d['filters']=_[_0x9a88('0x3f')](_0x1bd58d['model'],_0x1bd58d['query']);_0x19017e['attributes']=_[_0x9a88('0x3f')](_0x1bd58d[_0x9a88('0x40')],qs[_0x9a88('0x42')](_0x3d3154['query'][_0x9a88('0x42')]));_0x19017e[_0x9a88('0x41')]=_0x19017e[_0x9a88('0x41')][_0x9a88('0x43')]?_0x19017e['attributes']:_0x1bd58d[_0x9a88('0x40')];if(_0x3d3154['query'][_0x9a88('0x52')]){_0x19017e[_0x9a88('0x4e')]=[{'all':!![]}];}_0x19017e=_[_0x9a88('0x4b')]({},_0x19017e,_0x3d3154['options']);return db[_0x9a88('0x38')][_0x9a88('0x53')](_0x19017e)[_0x9a88('0x32')](handleEntityNotFound(_0x2e4adb,null))[_0x9a88('0x32')](respondWithResult(_0x2e4adb,null))[_0x9a88('0x25')](handleError(_0x2e4adb,null));};exports[_0x9a88('0x54')]=function(_0x4739fe,_0x59b53d,_0x3fdc8a){var _0x45ecad;return db[_0x9a88('0x55')][_0x9a88('0x56')](function(_0x106d84){return db[_0x9a88('0x38')]['create'](_0x4739fe['body'],{'raw':!![]})[_0x9a88('0x32')](function(_0x5e2f60){_0x45ecad=_0x5e2f60;return db[_0x9a88('0x38')]['findAll']({'where':{'type':_0x4739fe['body'][_0x9a88('0x3a')]},'raw':!![]});})[_0x9a88('0x32')](function(_0x5216e3){if(_0x45ecad[_0x9a88('0x3a')][_0x9a88('0x57')]()=='STUN'){var _0x4fb9f3=fs[_0x9a88('0x58')](path[_0x9a88('0x59')](config[_0x9a88('0x5a')],_0x9a88('0x5b')),_0x9a88('0x5c'));var _0x5ea154=ejs['render'](_0x4fb9f3,{'networks':_0x5216e3||[]});fs[_0x9a88('0x5d')](_0x9a88('0x5e'),_0x5ea154);return respondWithRpcPromise(_0x9a88('0x5f'),_0x9a88('0x54'),{'module':'res_stun_monitor.so'});}else if(_0x45ecad[_0x9a88('0x3a')][_0x9a88('0x57')]()=='TURN'){var _0x4a6059=fs[_0x9a88('0x58')](path['join'](config[_0x9a88('0x5a')],_0x9a88('0x60')),_0x9a88('0x5c'));var _0x2841ff=ejs[_0x9a88('0x61')](_0x4a6059,{'networks':_0x5216e3||[]});fs[_0x9a88('0x5d')](_0x9a88('0x62'),_0x2841ff);return respondWithRpcPromise(_0x9a88('0x5f'),_0x9a88('0x54'),{'module':_0x9a88('0x63')});}else{var _0x570d18=fs['readFileSync'](path[_0x9a88('0x59')](config[_0x9a88('0x5a')],'server/files/templates/network.ejs'),_0x9a88('0x5c'));var _0x321dce=ejs[_0x9a88('0x61')](_0x570d18,{'networks':_0x5216e3||[]});fs['writeFileSync'](util[_0x9a88('0x64')](_0x9a88('0x65'),_0x4739fe[_0x9a88('0x66')]['type'][_0x9a88('0x67')]()),_0x321dce);return respondWithRpcPromise(_0x9a88('0x5f'),_0x9a88('0x54'),{'module':_0x9a88('0x68')});}return null;})['then'](function(){return _0x45ecad;});})[_0x9a88('0x32')](respondWithResult(_0x59b53d,0xc9))[_0x9a88('0x25')](handleError(_0x59b53d,null));};exports[_0x9a88('0x31')]=function(_0x4505da,_0x497eb7,_0x3bc13f){var _0x22db0b;return db[_0x9a88('0x55')][_0x9a88('0x56')](function(_0x5c3504){return db[_0x9a88('0x38')][_0x9a88('0x53')]({'where':{'id':_0x4505da['params']['id']}})[_0x9a88('0x32')](handleEntityNotFound(_0x497eb7,null))[_0x9a88('0x32')](saveUpdates(_0x4505da[_0x9a88('0x66')],null))[_0x9a88('0x32')](function(_0x4ff30e){if(_0x4ff30e){_0x22db0b=_0x4ff30e;return db[_0x9a88('0x38')]['findAll']({'where':{'type':_0x22db0b['type']},'raw':!![]});}return null;})[_0x9a88('0x32')](function(_0x1c64fe){if(_0x22db0b[_0x9a88('0x3a')][_0x9a88('0x57')]()==_0x9a88('0x69')){var _0x317e58=fs[_0x9a88('0x58')](path[_0x9a88('0x59')](config[_0x9a88('0x5a')],_0x9a88('0x5b')),_0x9a88('0x5c'));var _0x511bc2=ejs[_0x9a88('0x61')](_0x317e58,{'networks':_0x1c64fe||[]});fs['writeFileSync'](_0x9a88('0x5e'),_0x511bc2);return respondWithRpcPromise('Reload',_0x9a88('0x31'),{'module':_0x9a88('0x63')});}else if(_0x22db0b[_0x9a88('0x3a')][_0x9a88('0x57')]()==_0x9a88('0x6a')){var _0x59ab57=fs[_0x9a88('0x58')](path['join'](config[_0x9a88('0x5a')],_0x9a88('0x60')),_0x9a88('0x5c'));var _0x35dcc5=ejs[_0x9a88('0x61')](_0x59ab57,{'networks':_0x1c64fe||[]});fs[_0x9a88('0x5d')](_0x9a88('0x62'),_0x35dcc5);return respondWithRpcPromise(_0x9a88('0x5f'),'update',{'module':_0x9a88('0x63')});}else{var _0x50c367=fs[_0x9a88('0x58')](path[_0x9a88('0x59')](config[_0x9a88('0x5a')],_0x9a88('0x6b')),_0x9a88('0x5c'));var _0x28d116=ejs[_0x9a88('0x61')](_0x50c367,{'networks':_0x1c64fe||[]});fs['writeFileSync'](util[_0x9a88('0x64')](_0x9a88('0x65'),_0x4505da[_0x9a88('0x66')][_0x9a88('0x3a')][_0x9a88('0x67')]()),_0x28d116);return respondWithRpcPromise('Reload',_0x9a88('0x31'),{'module':_0x9a88('0x68')});}return null;})[_0x9a88('0x32')](function(_0x1b85ec){if(_0x1b85ec){return _0x22db0b;}return null;});})['then'](respondWithResult(_0x497eb7,null))['catch'](handleError(_0x497eb7,null));};exports[_0x9a88('0x33')]=function(_0x673213,_0x52a921,_0x311f21){var _0xc9cee2;return db[_0x9a88('0x38')]['find']({'where':{'id':_0x673213[_0x9a88('0x6c')]['id']}})[_0x9a88('0x32')](function(_0x28e836){_0xc9cee2=_0x28e836;return _0x28e836;})[_0x9a88('0x32')](handleEntityNotFound(_0x52a921,null))[_0x9a88('0x32')](removeEntity(_0x52a921,null))[_0x9a88('0x32')](function(){if(_0xc9cee2){return db['Network']['findAll']({'where':{'type':_0xc9cee2[_0x9a88('0x3a')]},'raw':!![]});}})[_0x9a88('0x32')](function(_0x2ccaaf){if(_0xc9cee2[_0x9a88('0x3a')][_0x9a88('0x57')]()==_0x9a88('0x69')){var _0x23257d=fs['readFileSync'](path['join'](config[_0x9a88('0x5a')],_0x9a88('0x5b')),_0x9a88('0x5c'));var _0x4cd09b=ejs[_0x9a88('0x61')](_0x23257d,{'networks':_0x2ccaaf||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x4cd09b);return respondWithRpcPromise('Reload',_0x9a88('0x33'),{'module':'res_stun_monitor.so'});}else if(_0xc9cee2[_0x9a88('0x3a')][_0x9a88('0x57')]()==_0x9a88('0x6a')){var _0x270af0=fs['readFileSync'](path[_0x9a88('0x59')](config['root'],_0x9a88('0x60')),_0x9a88('0x5c'));var _0x2818e6=ejs['render'](_0x270af0,{'networks':_0x2ccaaf||[]});fs[_0x9a88('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x2818e6);return respondWithRpcPromise(_0x9a88('0x5f'),'destroy',{'module':_0x9a88('0x63')});}else{var _0x3e3471=fs[_0x9a88('0x58')](path[_0x9a88('0x59')](config[_0x9a88('0x5a')],_0x9a88('0x6b')),_0x9a88('0x5c'));var _0x8c668b=ejs['render'](_0x3e3471,{'networks':_0x2ccaaf||[]});fs[_0x9a88('0x5d')](util[_0x9a88('0x64')]('/etc/asterisk/sip_xcally_%s.conf',_0x673213[_0x9a88('0x66')]['type'][_0x9a88('0x67')]()),_0x8c668b);return respondWithRpcPromise(_0x9a88('0x5f'),'destroy',{'module':_0x9a88('0x68')});}return null;})[_0x9a88('0x25')](handleError(_0x52a921,null));};
\ No newline at end of file
+var _0xe3e5=['join','server/files/templates/turn_multiple.ejs','utf8','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','update','destroy','TURN','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','ValidationError','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','name','send','index','Network','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','Reload','res_stun_monitor.so'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3e5,0x77));var _0x5e3e=function(_0x4b2dd6,_0x346f36){_0x4b2dd6=_0x4b2dd6-0x0;var _0x15ed34=_0xe3e5[_0x4b2dd6];return _0x15ed34;};'use strict';var pdf=require(_0x5e3e('0x0'));var emlformat=require(_0x5e3e('0x1'));var rimraf=require(_0x5e3e('0x2'));var zipdir=require(_0x5e3e('0x3'));var jsonpatch=require(_0x5e3e('0x4'));var rp=require(_0x5e3e('0x5'));var moment=require(_0x5e3e('0x6'));var BPromise=require(_0x5e3e('0x7'));var Mustache=require(_0x5e3e('0x8'));var util=require(_0x5e3e('0x9'));var path=require(_0x5e3e('0xa'));var sox=require(_0x5e3e('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e3e('0xc'));var jsforce=require(_0x5e3e('0xd'));var deskjs=require(_0x5e3e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e3e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5e3e('0x10'));var hardwareService=require(_0x5e3e('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5e3e('0x12'));var config=require(_0x5e3e('0x13'));var db=require(_0x5e3e('0x14'))['db'];var jayson=require(_0x5e3e('0x15'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x5cbe49,_0x40c30e,_0x3267e2){if(_0x3267e2){var _0x5ab780=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5ab780[_0x5e3e('0x16')](_0x40c30e)){return _0x5cbe49;}else{throw new db['Sequelize'][(_0x5e3e('0x17'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5cbe49;}}function respondWithRpcPromise(_0x16d7ee,_0x1cdaff,_0x2f04f3,_0x5d44a8){return new BPromise(function(_0x306641,_0xbbbbec){var _0x894614=_0x5d44a8||client;return _0x894614['request'](_0x16d7ee,_0x2f04f3)[_0x5e3e('0x18')](function(_0x378f9c){logger[_0x5e3e('0x19')](_0x5e3e('0x1a'),_0x1cdaff,_0x5e3e('0x1b'));logger[_0x5e3e('0x1c')](_0x5e3e('0x1d'),_0x1cdaff,'request\x20sent',JSON[_0x5e3e('0x1e')](_0x378f9c));if(_0x378f9c[_0x5e3e('0x1f')]){if(_0x378f9c[_0x5e3e('0x1f')][_0x5e3e('0x20')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x1cdaff,_0x378f9c[_0x5e3e('0x1f')][_0x5e3e('0x21')]);return _0xbbbbec(_0x378f9c[_0x5e3e('0x1f')][_0x5e3e('0x21')]);}logger[_0x5e3e('0x1f')](_0x5e3e('0x1a'),_0x1cdaff,_0x378f9c[_0x5e3e('0x1f')][_0x5e3e('0x21')]);return _0x306641(_0x378f9c[_0x5e3e('0x1f')][_0x5e3e('0x21')]);}else{logger[_0x5e3e('0x19')]('Network,\x20%s,\x20%s',_0x1cdaff,_0x5e3e('0x1b'));_0x306641(_0x378f9c[_0x5e3e('0x22')][_0x5e3e('0x21')]);}})['catch'](function(_0x23ac2b){logger['error'](_0x5e3e('0x1a'),_0x1cdaff,_0x23ac2b);_0xbbbbec(_0x23ac2b);});});}function respondWithStatusCode(_0x250930,_0x3f4f0c){_0x3f4f0c=_0x3f4f0c||0xcc;return function(_0x3633a8){if(_0x3633a8){return _0x250930[_0x5e3e('0x23')](_0x3f4f0c);}return _0x250930['status'](_0x3f4f0c)[_0x5e3e('0x24')]();};}function respondWithResult(_0x3d9b64,_0x4e1859){_0x4e1859=_0x4e1859||0xc8;return function(_0x10572a){if(_0x10572a){return _0x3d9b64[_0x5e3e('0x25')](_0x4e1859)[_0x5e3e('0x26')](_0x10572a);}};}function respondWithFilteredResult(_0x103000,_0x2f1693){return function(_0x4ba6b4){if(_0x4ba6b4){var _0x1f3b25=_0x4ba6b4['count'],_0x416a00=_0x2f1693[_0x5e3e('0x27')],_0x46f262=_0x2f1693[_0x5e3e('0x27')]+_0x2f1693[_0x5e3e('0x28')],_0x5b0937;if(_0x46f262>=_0x1f3b25){_0x46f262=_0x1f3b25;_0x5b0937=0xc8;}else{_0x5b0937=0xce;}_0x103000[_0x5e3e('0x25')](_0x5b0937);return _0x103000[_0x5e3e('0x29')](_0x5e3e('0x2a'),_0x416a00+'-'+_0x46f262+'/'+_0x1f3b25)[_0x5e3e('0x26')](_0x4ba6b4);}return null;};}function patchUpdates(_0x1def9c){return function(_0x3151d0){try{jsonpatch[_0x5e3e('0x2b')](_0x3151d0,_0x1def9c,!![]);}catch(_0x163b1c){return BPromise[_0x5e3e('0x2c')](_0x163b1c);}return _0x3151d0['save']();};}function saveUpdates(_0x422c74,_0x20829b){return function(_0x544764){if(_0x544764){return _0x544764['update'](_0x422c74)[_0x5e3e('0x18')](function(_0x2a2777){return _0x2a2777;});}return null;};}function removeEntity(_0x4ccb27,_0x4cf667){return function(_0x4b6f94){if(_0x4b6f94){return _0x4b6f94['destroy']()['then'](function(){_0x4ccb27[_0x5e3e('0x25')](0xcc)[_0x5e3e('0x24')]();});}};}function handleEntityNotFound(_0x43f530,_0x16efb9){return function(_0x27670e){if(!_0x27670e){_0x43f530['sendStatus'](0x194);}return _0x27670e;};}function handleError(_0x57e5dd,_0x4a31fb){_0x4a31fb=_0x4a31fb||0x1f4;return function(_0x1ef849){logger[_0x5e3e('0x1f')](_0x1ef849['stack']);if(_0x1ef849[_0x5e3e('0x2d')]){delete _0x1ef849[_0x5e3e('0x2d')];}_0x57e5dd[_0x5e3e('0x25')](_0x4a31fb)[_0x5e3e('0x2e')](_0x1ef849);};}exports[_0x5e3e('0x2f')]=function(_0x4d9a13,_0x122474){var _0x3f5a3c={},_0x1c206f={},_0x16b4e5={'count':0x0,'rows':[]};var _0x325c31=_['map'](db[_0x5e3e('0x30')][_0x5e3e('0x31')],function(_0x50249d){return{'name':_0x50249d[_0x5e3e('0x32')],'type':_0x50249d['type'][_0x5e3e('0x33')]};});_0x1c206f[_0x5e3e('0x34')]=_[_0x5e3e('0x35')](_0x325c31,_0x5e3e('0x2d'));_0x1c206f['query']=_[_0x5e3e('0x36')](_0x4d9a13[_0x5e3e('0x37')]);_0x1c206f[_0x5e3e('0x38')]=_[_0x5e3e('0x39')](_0x1c206f[_0x5e3e('0x34')],_0x1c206f[_0x5e3e('0x37')]);_0x3f5a3c['attributes']=_[_0x5e3e('0x39')](_0x1c206f[_0x5e3e('0x34')],qs[_0x5e3e('0x3a')](_0x4d9a13[_0x5e3e('0x37')]['fields']));_0x3f5a3c[_0x5e3e('0x3b')]=_0x3f5a3c[_0x5e3e('0x3b')][_0x5e3e('0x3c')]?_0x3f5a3c[_0x5e3e('0x3b')]:_0x1c206f[_0x5e3e('0x34')];if(!_0x4d9a13[_0x5e3e('0x37')][_0x5e3e('0x3d')](_0x5e3e('0x3e'))){_0x3f5a3c['limit']=qs['limit'](_0x4d9a13[_0x5e3e('0x37')][_0x5e3e('0x28')]);_0x3f5a3c[_0x5e3e('0x27')]=qs['offset'](_0x4d9a13['query'][_0x5e3e('0x27')]);}_0x3f5a3c[_0x5e3e('0x3f')]=qs[_0x5e3e('0x40')](_0x4d9a13[_0x5e3e('0x37')][_0x5e3e('0x40')]);_0x3f5a3c[_0x5e3e('0x41')]=qs[_0x5e3e('0x38')](_[_0x5e3e('0x42')](_0x4d9a13[_0x5e3e('0x37')],_0x1c206f[_0x5e3e('0x38')]),_0x325c31);if(_0x4d9a13[_0x5e3e('0x37')]['filter']){_0x3f5a3c[_0x5e3e('0x41')]=_[_0x5e3e('0x43')](_0x3f5a3c[_0x5e3e('0x41')],{'$or':_[_0x5e3e('0x35')](_0x325c31,function(_0x40fc70){if(_0x40fc70[_0x5e3e('0x44')]!=='VIRTUAL'){var _0x177493={};_0x177493[_0x40fc70[_0x5e3e('0x2d')]]={'$like':'%'+_0x4d9a13['query'][_0x5e3e('0x45')]+'%'};return _0x177493;}})});}_0x3f5a3c=_[_0x5e3e('0x43')]({},_0x3f5a3c,_0x4d9a13[_0x5e3e('0x46')]);var _0x279260={'where':_0x3f5a3c[_0x5e3e('0x41')]};return db[_0x5e3e('0x30')]['count'](_0x279260)[_0x5e3e('0x18')](function(_0x2cd3a6){_0x16b4e5[_0x5e3e('0x47')]=_0x2cd3a6;if(_0x4d9a13['query'][_0x5e3e('0x48')]){_0x3f5a3c[_0x5e3e('0x49')]=[{'all':!![]}];}return db['Network'][_0x5e3e('0x4a')](_0x3f5a3c);})[_0x5e3e('0x18')](function(_0x56fe55){_0x16b4e5[_0x5e3e('0x4b')]=_0x56fe55;return _0x16b4e5;})['then'](respondWithFilteredResult(_0x122474,_0x3f5a3c))[_0x5e3e('0x4c')](handleError(_0x122474,null));};exports[_0x5e3e('0x4d')]=function(_0xc54791,_0x532142){var _0x3b67e2={'raw':!![],'where':{'id':_0xc54791[_0x5e3e('0x4e')]['id']}},_0x4f917d={};_0x4f917d[_0x5e3e('0x34')]=_['keys'](db['Network'][_0x5e3e('0x31')]);_0x4f917d[_0x5e3e('0x37')]=_['keys'](_0xc54791['query']);_0x4f917d[_0x5e3e('0x38')]=_[_0x5e3e('0x39')](_0x4f917d[_0x5e3e('0x34')],_0x4f917d[_0x5e3e('0x37')]);_0x3b67e2[_0x5e3e('0x3b')]=_[_0x5e3e('0x39')](_0x4f917d[_0x5e3e('0x34')],qs[_0x5e3e('0x3a')](_0xc54791[_0x5e3e('0x37')][_0x5e3e('0x3a')]));_0x3b67e2[_0x5e3e('0x3b')]=_0x3b67e2[_0x5e3e('0x3b')][_0x5e3e('0x3c')]?_0x3b67e2[_0x5e3e('0x3b')]:_0x4f917d[_0x5e3e('0x34')];if(_0xc54791[_0x5e3e('0x37')]['includeAll']){_0x3b67e2[_0x5e3e('0x49')]=[{'all':!![]}];}_0x3b67e2=_[_0x5e3e('0x43')]({},_0x3b67e2,_0xc54791[_0x5e3e('0x46')]);return db[_0x5e3e('0x30')][_0x5e3e('0x4f')](_0x3b67e2)['then'](handleEntityNotFound(_0x532142,null))[_0x5e3e('0x18')](respondWithResult(_0x532142,null))[_0x5e3e('0x4c')](handleError(_0x532142,null));};exports[_0x5e3e('0x50')]=function(_0x5bc9ba,_0x1bdc32,_0xae04e3){var _0x47cd3a;return db[_0x5e3e('0x51')][_0x5e3e('0x52')](function(_0xf8758f){return db[_0x5e3e('0x30')][_0x5e3e('0x50')](_0x5bc9ba[_0x5e3e('0x53')],{'raw':!![]})[_0x5e3e('0x18')](function(_0x25becf){_0x47cd3a=_0x25becf;return db[_0x5e3e('0x30')][_0x5e3e('0x4a')]({'where':{'type':_0x5bc9ba[_0x5e3e('0x53')][_0x5e3e('0x44')]},'raw':!![]});})[_0x5e3e('0x18')](function(_0x472cc7){if(_0x47cd3a[_0x5e3e('0x44')][_0x5e3e('0x54')]()==_0x5e3e('0x55')){var _0x3404c7=fs[_0x5e3e('0x56')](path['join'](config[_0x5e3e('0x57')],_0x5e3e('0x58')),'utf8');var _0x35e38e=ejs[_0x5e3e('0x59')](_0x3404c7,{'networks':_0x472cc7||[]});fs[_0x5e3e('0x5a')]('/etc/asterisk/stun_xcally.conf',_0x35e38e);return respondWithRpcPromise(_0x5e3e('0x5b'),_0x5e3e('0x50'),{'module':_0x5e3e('0x5c')});}else if(_0x47cd3a['type'][_0x5e3e('0x54')]()=='TURN'){var _0x443fbc=fs[_0x5e3e('0x56')](path[_0x5e3e('0x5d')](config['root'],_0x5e3e('0x5e')),_0x5e3e('0x5f'));var _0x70839a=ejs[_0x5e3e('0x59')](_0x443fbc,{'networks':_0x472cc7||[]});fs[_0x5e3e('0x5a')]('/etc/asterisk/turn_xcally.conf',_0x70839a);return respondWithRpcPromise(_0x5e3e('0x5b'),_0x5e3e('0x50'),{'module':_0x5e3e('0x5c')});}else{var _0x41a618=fs[_0x5e3e('0x56')](path[_0x5e3e('0x5d')](config['root'],_0x5e3e('0x60')),'utf8');var _0x488f66=ejs['render'](_0x41a618,{'networks':_0x472cc7||[]});fs[_0x5e3e('0x5a')](util[_0x5e3e('0x61')](_0x5e3e('0x62'),_0x5bc9ba['body'][_0x5e3e('0x44')][_0x5e3e('0x63')]()),_0x488f66);return respondWithRpcPromise(_0x5e3e('0x5b'),'create',{'module':_0x5e3e('0x64')});}return null;})[_0x5e3e('0x18')](function(){return _0x47cd3a;});})[_0x5e3e('0x18')](respondWithResult(_0x1bdc32,0xc9))[_0x5e3e('0x4c')](handleError(_0x1bdc32,null));};exports['update']=function(_0x583ac2,_0x15f80c,_0x5bd5b8){var _0x4ff79c;return db[_0x5e3e('0x51')][_0x5e3e('0x52')](function(_0x1055b3){return db[_0x5e3e('0x30')]['find']({'where':{'id':_0x583ac2[_0x5e3e('0x4e')]['id']}})[_0x5e3e('0x18')](handleEntityNotFound(_0x15f80c,null))[_0x5e3e('0x18')](saveUpdates(_0x583ac2[_0x5e3e('0x53')],null))[_0x5e3e('0x18')](function(_0x9ac191){if(_0x9ac191){_0x4ff79c=_0x9ac191;return db[_0x5e3e('0x30')][_0x5e3e('0x4a')]({'where':{'type':_0x4ff79c[_0x5e3e('0x44')]},'raw':!![]});}return null;})[_0x5e3e('0x18')](function(_0x304ada){if(_0x4ff79c[_0x5e3e('0x44')][_0x5e3e('0x54')]()==_0x5e3e('0x55')){var _0x4dddc1=fs[_0x5e3e('0x56')](path[_0x5e3e('0x5d')](config[_0x5e3e('0x57')],'server/files/templates/stun_multiple.ejs'),_0x5e3e('0x5f'));var _0x4a1910=ejs[_0x5e3e('0x59')](_0x4dddc1,{'networks':_0x304ada||[]});fs['writeFileSync'](_0x5e3e('0x65'),_0x4a1910);return respondWithRpcPromise(_0x5e3e('0x5b'),'update',{'module':_0x5e3e('0x5c')});}else if(_0x4ff79c[_0x5e3e('0x44')]['toUpperCase']()=='TURN'){var _0x3d68c5=fs['readFileSync'](path['join'](config[_0x5e3e('0x57')],_0x5e3e('0x5e')),'utf8');var _0x199800=ejs['render'](_0x3d68c5,{'networks':_0x304ada||[]});fs['writeFileSync'](_0x5e3e('0x66'),_0x199800);return respondWithRpcPromise(_0x5e3e('0x5b'),'update',{'module':'res_stun_monitor.so'});}else{var _0x330273=fs['readFileSync'](path[_0x5e3e('0x5d')](config[_0x5e3e('0x57')],_0x5e3e('0x60')),_0x5e3e('0x5f'));var _0x1b5fc7=ejs[_0x5e3e('0x59')](_0x330273,{'networks':_0x304ada||[]});fs['writeFileSync'](util[_0x5e3e('0x61')](_0x5e3e('0x62'),_0x583ac2[_0x5e3e('0x53')][_0x5e3e('0x44')][_0x5e3e('0x63')]()),_0x1b5fc7);return respondWithRpcPromise(_0x5e3e('0x5b'),_0x5e3e('0x67'),{'module':_0x5e3e('0x64')});}return null;})['then'](function(_0x1ee6a5){if(_0x1ee6a5){return _0x4ff79c;}return null;});})['then'](respondWithResult(_0x15f80c,null))[_0x5e3e('0x4c')](handleError(_0x15f80c,null));};exports[_0x5e3e('0x68')]=function(_0x551831,_0x1ff8dd,_0x1cfe21){var _0x407972;return db[_0x5e3e('0x30')][_0x5e3e('0x4f')]({'where':{'id':_0x551831[_0x5e3e('0x4e')]['id']}})[_0x5e3e('0x18')](function(_0x1e0c96){_0x407972=_0x1e0c96;return _0x1e0c96;})[_0x5e3e('0x18')](handleEntityNotFound(_0x1ff8dd,null))['then'](removeEntity(_0x1ff8dd,null))[_0x5e3e('0x18')](function(){if(_0x407972){return db[_0x5e3e('0x30')]['findAll']({'where':{'type':_0x407972[_0x5e3e('0x44')]},'raw':!![]});}})['then'](function(_0xc531bc){if(_0x407972[_0x5e3e('0x44')][_0x5e3e('0x54')]()=='STUN'){var _0x3d665a=fs[_0x5e3e('0x56')](path[_0x5e3e('0x5d')](config[_0x5e3e('0x57')],_0x5e3e('0x58')),_0x5e3e('0x5f'));var _0x20ff28=ejs[_0x5e3e('0x59')](_0x3d665a,{'networks':_0xc531bc||[]});fs[_0x5e3e('0x5a')](_0x5e3e('0x65'),_0x20ff28);return respondWithRpcPromise(_0x5e3e('0x5b'),_0x5e3e('0x68'),{'module':_0x5e3e('0x5c')});}else if(_0x407972[_0x5e3e('0x44')][_0x5e3e('0x54')]()==_0x5e3e('0x69')){var _0x5062e9=fs['readFileSync'](path[_0x5e3e('0x5d')](config['root'],_0x5e3e('0x5e')),_0x5e3e('0x5f'));var _0x28243d=ejs[_0x5e3e('0x59')](_0x5062e9,{'networks':_0xc531bc||[]});fs[_0x5e3e('0x5a')](_0x5e3e('0x66'),_0x28243d);return respondWithRpcPromise(_0x5e3e('0x5b'),_0x5e3e('0x68'),{'module':'res_stun_monitor.so'});}else{var _0x1c2fed=fs[_0x5e3e('0x56')](path[_0x5e3e('0x5d')](config[_0x5e3e('0x57')],_0x5e3e('0x60')),_0x5e3e('0x5f'));var _0x5b36d0=ejs['render'](_0x1c2fed,{'networks':_0xc531bc||[]});fs[_0x5e3e('0x5a')](util[_0x5e3e('0x61')](_0x5e3e('0x62'),_0x551831[_0x5e3e('0x53')]['type']['toLowerCase']()),_0x5b36d0);return respondWithRpcPromise(_0x5e3e('0x5b'),_0x5e3e('0x68'),{'module':_0x5e3e('0x64')});}return null;})[_0x5e3e('0x4c')](handleError(_0x1ff8dd,null));};
\ No newline at end of file
index 41cab66..9eaf81e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./network.attributes','exports','network','lodash'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xe14d,0x1ee));var _0xde14=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xe14d[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('Network',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3cd=['path','rimraf','../../config/environment','exports','define','Network','network','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x11c53f,_0x556016){var _0x40f275=function(_0x4f3514){while(--_0x4f3514){_0x11c53f['push'](_0x11c53f['shift']());}};_0x40f275(++_0x556016);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3aa0ac,_0x5f5da6){_0x3aa0ac=_0x3aa0ac-0x0;var _0x568a11=_0xf3cd[_0x3aa0ac];return _0x568a11;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./network.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7c5e0a6..9b0a447 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x691b=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x38e02b,_0x12f7c4){var _0x47eb34=function(_0x3e6597){while(--_0x3e6597){_0x38e02b['push'](_0x38e02b['shift']());}};_0x47eb34(++_0x12f7c4);}(_0x691b,0x143));var _0xb691=function(_0x9fdd85,_0x56aa60){_0x9fdd85=_0x9fdd85-0x0;var _0x36bf4a=_0x691b[_0x9fdd85];return _0x36bf4a;};'use strict';var _=require(_0xb691('0x0'));var util=require(_0xb691('0x1'));var moment=require(_0xb691('0x2'));var BPromise=require(_0xb691('0x3'));var rs=require(_0xb691('0x4'));var fs=require('fs');var Redis=require(_0xb691('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb691('0x6'));var logger=require(_0xb691('0x7'))('rpc');var config=require(_0xb691('0x8'));var jayson=require(_0xb691('0x9'));var client=jayson[_0xb691('0xa')][_0xb691('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42efaf,_0x664e4f,_0x3663a7){return new BPromise(function(_0x57e55d,_0x326a27){return client[_0xb691('0xc')](_0x42efaf,_0x3663a7)[_0xb691('0xd')](function(_0x3e4801){logger['info'](_0xb691('0xe'),_0x664e4f,_0xb691('0xf'));logger[_0xb691('0x10')](_0xb691('0x11'),_0x664e4f,'request\x20sent',JSON[_0xb691('0x12')](_0x3e4801));if(_0x3e4801[_0xb691('0x13')]){if(_0x3e4801['error']['code']===0x1f4){logger[_0xb691('0x13')]('Network,\x20%s,\x20%s',_0x664e4f,_0x3e4801[_0xb691('0x13')][_0xb691('0x14')]);return _0x326a27(_0x3e4801[_0xb691('0x13')][_0xb691('0x14')]);}logger[_0xb691('0x13')](_0xb691('0xe'),_0x664e4f,_0x3e4801['error'][_0xb691('0x14')]);return _0x57e55d(_0x3e4801['error'][_0xb691('0x14')]);}else{logger[_0xb691('0x15')](_0xb691('0xe'),_0x664e4f,'request\x20sent');_0x57e55d(_0x3e4801['result'][_0xb691('0x14')]);}})[_0xb691('0x16')](function(_0x19be45){logger['error'](_0xb691('0xe'),_0x664e4f,_0x19be45);_0x326a27(_0x19be45);});});}
\ No newline at end of file
+var _0x097c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','info','Network,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring'];(function(_0x4471b3,_0x511a9f){var _0x386593=function(_0x1057e2){while(--_0x1057e2){_0x4471b3['push'](_0x4471b3['shift']());}};_0x386593(++_0x511a9f);}(_0x097c,0x13e));var _0xc097=function(_0x5e5316,_0x427a98){_0x5e5316=_0x5e5316-0x0;var _0xcdb0d=_0x097c[_0x5e5316];return _0xcdb0d;};'use strict';var _=require(_0xc097('0x0'));var util=require(_0xc097('0x1'));var moment=require(_0xc097('0x2'));var BPromise=require('bluebird');var rs=require(_0xc097('0x3'));var fs=require('fs');var Redis=require(_0xc097('0x4'));var db=require(_0xc097('0x5'))['db'];var utils=require(_0xc097('0x6'));var logger=require(_0xc097('0x7'))(_0xc097('0x8'));var config=require(_0xc097('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc097('0xa')][_0xc097('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x518d7b,_0x168733,_0x3b20e5){return new BPromise(function(_0x3bf151,_0xb8f82b){return client[_0xc097('0xc')](_0x518d7b,_0x3b20e5)[_0xc097('0xd')](function(_0x33acd6){logger['info']('Network,\x20%s,\x20%s',_0x168733,_0xc097('0xe'));logger['debug'](_0xc097('0xf'),_0x168733,_0xc097('0xe'),JSON['stringify'](_0x33acd6));if(_0x33acd6[_0xc097('0x10')]){if(_0x33acd6[_0xc097('0x10')][_0xc097('0x11')]===0x1f4){logger[_0xc097('0x10')]('Network,\x20%s,\x20%s',_0x168733,_0x33acd6[_0xc097('0x10')][_0xc097('0x12')]);return _0xb8f82b(_0x33acd6[_0xc097('0x10')][_0xc097('0x12')]);}logger[_0xc097('0x10')]('Network,\x20%s,\x20%s',_0x168733,_0x33acd6[_0xc097('0x10')]['message']);return _0x3bf151(_0x33acd6[_0xc097('0x10')]['message']);}else{logger[_0xc097('0x13')](_0xc097('0x14'),_0x168733,'request\x20sent');_0x3bf151(_0x33acd6[_0xc097('0x15')][_0xc097('0x12')]);}})[_0xc097('0x16')](function(_0x3e473d){logger[_0xc097('0x10')](_0xc097('0x14'),_0x168733,_0x3e473d);_0xb8f82b(_0x3e473d);});});}
\ No newline at end of file
index 6cad6da..f548603 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3077=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./notification.controller','post','isAuthenticated','multer','util'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x3077,0x196));var _0x7307=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x3077[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x7307('0x0'));var util=require(_0x7307('0x1'));var path=require(_0x7307('0x2'));var timeout=require(_0x7307('0x3'));var express=require(_0x7307('0x4'));var router=express[_0x7307('0x5')]();var auth=require(_0x7307('0x6'));var interaction=require(_0x7307('0x7'));var config=require(_0x7307('0x8'));var controller=require(_0x7307('0x9'));router[_0x7307('0xa')]('/',auth[_0x7307('0xb')](),controller['sendNotification']);module['exports']=router;
\ No newline at end of file
+var _0x2e39=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','post','isAuthenticated','sendNotification','multer'];(function(_0x49f118,_0x5138e4){var _0x3a0443=function(_0x557a45){while(--_0x557a45){_0x49f118['push'](_0x49f118['shift']());}};_0x3a0443(++_0x5138e4);}(_0x2e39,0xe0));var _0x92e3=function(_0x13e35e,_0x175451){_0x13e35e=_0x13e35e-0x0;var _0x1fa344=_0x2e39[_0x13e35e];return _0x1fa344;};'use strict';var multer=require(_0x92e3('0x0'));var util=require('util');var path=require(_0x92e3('0x1'));var timeout=require(_0x92e3('0x2'));var express=require(_0x92e3('0x3'));var router=express['Router']();var auth=require(_0x92e3('0x4'));var interaction=require(_0x92e3('0x5'));var config=require('../../config/environment');var controller=require('./notification.controller');router[_0x92e3('0x6')]('/',auth[_0x92e3('0x7')](),controller[_0x92e3('0x8')]);module['exports']=router;
\ No newline at end of file
index 69dce4c..0a276f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf408=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0xf38492,_0x45d84e){var _0x3e66e3=function(_0xf16ba){while(--_0xf16ba){_0xf38492['push'](_0xf38492['shift']());}};_0x3e66e3(++_0x45d84e);}(_0xf408,0x1d1));var _0x8f40=function(_0x2c065a,_0x44e071){_0x2c065a=_0x2c065a-0x0;var _0x16dcf0=_0xf408[_0x2c065a];return _0x16dcf0;};'use strict';var Sequelize=require(_0x8f40('0x0'));module[_0x8f40('0x1')]={'body':{'type':Sequelize[_0x8f40('0x2')]},'senderName':{'type':Sequelize[_0x8f40('0x3')]},'recipientsId':{'type':Sequelize[_0x8f40('0x2')]},'recipientsDescription':{'type':Sequelize[_0x8f40('0x3')]},'beep':{'type':Sequelize[_0x8f40('0x4')]}};
\ No newline at end of file
+var _0xfba3=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x5f25dd,_0x2e5567){var _0x3b48e3=function(_0x41d00e){while(--_0x41d00e){_0x5f25dd['push'](_0x5f25dd['shift']());}};_0x3b48e3(++_0x2e5567);}(_0xfba3,0x121));var _0x3fba=function(_0x864c0c,_0x1d3d2f){_0x864c0c=_0x864c0c-0x0;var _0x2ef6ba=_0xfba3[_0x864c0c];return _0x2ef6ba;};'use strict';var Sequelize=require(_0x3fba('0x0'));module[_0x3fba('0x1')]={'body':{'type':Sequelize[_0x3fba('0x2')]},'senderName':{'type':Sequelize[_0x3fba('0x3')]},'recipientsId':{'type':Sequelize[_0x3fba('0x2')]},'recipientsDescription':{'type':Sequelize[_0x3fba('0x3')]},'beep':{'type':Sequelize[_0x3fba('0x4')]}};
\ No newline at end of file
index 2c462b6..e454cdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3da=['request-promise','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./notification.socket','sendStatus','status','end','json','count','limit','Content-Range','reject','save','update','destroy','then','error','stack','name','send','sendNotification','body','hasOwnProperty','text','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','sequelize','transaction','create','forEach','recipient','emit','notification:send','catch','Template','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','replace','queue','Queue','push','all','union','flatten','findOne','map','zip-dir','fast-json-patch'];(function(_0x32cc73,_0x156188){var _0x3d3404=function(_0x4450e6){while(--_0x4450e6){_0x32cc73['push'](_0x32cc73['shift']());}};_0x3d3404(++_0x156188);}(_0xe3da,0x11b));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xae3d('0x0'));var jsonpatch=require(_0xae3d('0x1'));var rp=require(_0xae3d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xae3d('0x3'));var util=require(_0xae3d('0x4'));var path=require(_0xae3d('0x5'));var sox=require(_0xae3d('0x6'));var csv=require(_0xae3d('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xae3d('0x8'));var squel=require(_0xae3d('0x9'));var crypto=require('crypto');var jsforce=require(_0xae3d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xae3d('0x7'));var querystring=require(_0xae3d('0xb'));var Papa=require(_0xae3d('0xc'));var Redis=require(_0xae3d('0xd'));var authService=require(_0xae3d('0xe'));var qs=require(_0xae3d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae3d('0x10'));var logger=require(_0xae3d('0x11'))('api');var utils=require(_0xae3d('0x12'));var config=require(_0xae3d('0x13'));var db=require(_0xae3d('0x14'))['db'];config[_0xae3d('0x15')]=_[_0xae3d('0x16')](config[_0xae3d('0x15')],{'host':_0xae3d('0x17'),'port':0x18eb});var socket=require(_0xae3d('0x18'))(new Redis(config[_0xae3d('0x15')]));require(_0xae3d('0x19'))['register'](socket);function respondWithStatusCode(_0x42fb55,_0xa36351){_0xa36351=_0xa36351||0xcc;return function(_0x13deb3){if(_0x13deb3){return _0x42fb55[_0xae3d('0x1a')](_0xa36351);}return _0x42fb55[_0xae3d('0x1b')](_0xa36351)[_0xae3d('0x1c')]();};}function respondWithResult(_0x5315bf,_0x375714){_0x375714=_0x375714||0xc8;return function(_0x4c8750){if(_0x4c8750){return _0x5315bf['status'](_0x375714)[_0xae3d('0x1d')](_0x4c8750);}};}function respondWithFilteredResult(_0x40240e,_0x21e3b0){return function(_0x4a8494){if(_0x4a8494){var _0xd1ae39=_0x4a8494[_0xae3d('0x1e')],_0x211ae7=_0x21e3b0['offset'],_0xa7bb80=_0x21e3b0['offset']+_0x21e3b0[_0xae3d('0x1f')],_0x45c137;if(_0xa7bb80>=_0xd1ae39){_0xa7bb80=_0xd1ae39;_0x45c137=0xc8;}else{_0x45c137=0xce;}_0x40240e[_0xae3d('0x1b')](_0x45c137);return _0x40240e['set'](_0xae3d('0x20'),_0x211ae7+'-'+_0xa7bb80+'/'+_0xd1ae39)[_0xae3d('0x1d')](_0x4a8494);}return null;};}function patchUpdates(_0x248e2a){return function(_0x1e25b9){try{jsonpatch['apply'](_0x1e25b9,_0x248e2a,!![]);}catch(_0x523e56){return BPromise[_0xae3d('0x21')](_0x523e56);}return _0x1e25b9[_0xae3d('0x22')]();};}function saveUpdates(_0x17f344,_0xd16f31){return function(_0x3ff6ae){if(_0x3ff6ae){return _0x3ff6ae[_0xae3d('0x23')](_0x17f344)['then'](function(_0xcd1178){return _0xcd1178;});}return null;};}function removeEntity(_0x2b5d10,_0x521663){return function(_0x273161){if(_0x273161){return _0x273161[_0xae3d('0x24')]()[_0xae3d('0x25')](function(){_0x2b5d10['status'](0xcc)[_0xae3d('0x1c')]();});}};}function handleEntityNotFound(_0x295290,_0x5a1833){return function(_0x106e44){if(!_0x106e44){_0x295290[_0xae3d('0x1a')](0x194);}return _0x106e44;};}function handleError(_0x5ca451,_0x2cd9a2){_0x2cd9a2=_0x2cd9a2||0x1f4;return function(_0x39a0d4){logger[_0xae3d('0x26')](_0x39a0d4[_0xae3d('0x27')]);if(_0x39a0d4['name']){delete _0x39a0d4[_0xae3d('0x28')];}_0x5ca451[_0xae3d('0x1b')](_0x2cd9a2)[_0xae3d('0x29')](_0x39a0d4);};}exports[_0xae3d('0x2a')]=function(_0x4a6beb,_0x215930,_0x25b207){if(!_0x4a6beb[_0xae3d('0x2b')][_0xae3d('0x2c')](_0xae3d('0x2d'))&&!_0x4a6beb[_0xae3d('0x2b')]['hasOwnProperty']('TemplateId')){throw new db['Sequelize'][(_0xae3d('0x2e'))](_0xae3d('0x2f'));}else{if(_0x4a6beb[_0xae3d('0x2b')][_0xae3d('0x2c')](_0xae3d('0x30'))&&!_0x4a6beb[_0xae3d('0x2b')]['hasOwnProperty'](_0xae3d('0x31'))){throw new db[(_0xae3d('0x32'))]['ValidationError'](_0xae3d('0x33'));}if(!_0x4a6beb[_0xae3d('0x2b')][_0xae3d('0x2c')](_0xae3d('0x34'))){throw new db[(_0xae3d('0x32'))][(_0xae3d('0x2e'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x2b3284=JSON[_0xae3d('0x35')](_0x4a6beb[_0xae3d('0x2b')][_0xae3d('0x34')]);}catch(_0x4b41d2){logger['error'](_0x4b41d2);throw new db[(_0xae3d('0x32'))][(_0xae3d('0x2e'))](_0xae3d('0x36'));}var _0x62c839=['chatqueue',_0xae3d('0x37'),_0xae3d('0x38'),_0xae3d('0x39'),_0xae3d('0x3a'),'voicequeue','whatsappqueue',_0xae3d('0x3b'),_0xae3d('0x3c')];if(_[_0xae3d('0x3d')](_0x2b3284,function(_0x277e9b){return!_[_0xae3d('0x3e')](_0x62c839,_0x277e9b[_0xae3d('0x3f')]['toLowerCase']());})){throw new db[(_0xae3d('0x32'))][(_0xae3d('0x2e'))](_0xae3d('0x40'));}}}var _0x373224={};_0x373224[_0xae3d('0x41')]=_0x4a6beb[_0xae3d('0x2b')][_0xae3d('0x2c')](_0xae3d('0x41'))?_0x4a6beb['body'][_0xae3d('0x41')]:_0x4a6beb['user'][_0xae3d('0x42')];_0x373224[_0xae3d('0x43')]=_[_0xae3d('0x44')](_0x4a6beb[_0xae3d('0x2b')][_0xae3d('0x43')])?null:_0x4a6beb['body'][_0xae3d('0x43')];_0x373224['beep']=_0x4a6beb['body'][_0xae3d('0x45')]||![];_0x373224[_0xae3d('0x46')]=_0x4a6beb[_0xae3d('0x3c')]['id'];return getContent(_0x4a6beb[_0xae3d('0x2b')])[_0xae3d('0x25')](function(_0x1bf500){_0x373224['body']=_0x1bf500;return getRecipients(_0x2b3284);})[_0xae3d('0x25')](function(_0x17aa5b){_0x373224[_0xae3d('0x47')]=_[_0xae3d('0x48')](_0x17aa5b)['join'](',');return db[_0xae3d('0x49')][_0xae3d('0x4a')](function(_0x54d8f3){return db['Notification'][_0xae3d('0x4b')](_0x373224,{'raw':!![],'transaction':_0x54d8f3})['then'](function(_0x591565){var _0x42e285={'sender':_0x373224['senderName'],'description':_0x373224[_0xae3d('0x43')],'content':_0x373224[_0xae3d('0x2b')],'beep':_0x373224[_0xae3d('0x45')]};_0x17aa5b[_0xae3d('0x4c')](function(_0x154c51){_0x42e285[_0xae3d('0x4d')]=_0x154c51;socket[_0xae3d('0x4e')](_0xae3d('0x4f'),_0x42e285);});return _0x591565;});});})[_0xae3d('0x25')](respondWithResult(_0x215930,0xc9))[_0xae3d('0x50')](handleError(_0x215930,null));};function getContent(_0x117533){return new BPromise(function(_0x511ecd,_0x37be7f){if(_0x117533[_0xae3d('0x2d')]){_0x511ecd(_0x117533[_0xae3d('0x2d')]);return;}return db[_0xae3d('0x51')]['findOne']({'attributes':['html'],'where':{'id':_0x117533['TemplateId']},'raw':!![]})['then'](function(_0x4f889d){if(!_0x4f889d)throw new db[(_0xae3d('0x32'))][(_0xae3d('0x2e'))](_0xae3d('0x52'));var _0xc7bbf5=Mustache[_0xae3d('0x53')](_0x4f889d[_0xae3d('0x54')],_0x117533[_0xae3d('0x31')]);_0x511ecd(_0xc7bbf5);})[_0xae3d('0x50')](function(_0x5d991d){_0x37be7f(_0x5d991d);});});}function getRecipients(_0x581347){return new BPromise(function(_0x5d5f7f,_0x569e4a){var _0x1b88ec=[];var _0x13fede=[];_0x581347[_0xae3d('0x4c')](function(_0x5e7bde){var _0x5dafb7=_[_0xae3d('0x55')](_0x5e7bde[_0xae3d('0x3f')]['toLowerCase']());if(_0x5dafb7==='User'){_0x1b88ec=_['union'](_0x1b88ec,_0x5e7bde['ids']);}else{if(_['includes'](_0x5dafb7,'queue'))_0x5dafb7=_0x5dafb7[_0xae3d('0x56')](_0xae3d('0x57'),_0xae3d('0x58'));_0x5e7bde['ids'][_0xae3d('0x4c')](function(_0x29b358){_0x13fede[_0xae3d('0x59')](getAgents(_0x5dafb7,_0x29b358));});}});return BPromise[_0xae3d('0x5a')](_0x13fede)[_0xae3d('0x25')](function(_0x579424){_0x1b88ec=_[_0xae3d('0x5b')](_0x1b88ec,_[_0xae3d('0x5c')](_0x579424));_0x5d5f7f(_0x1b88ec);})[_0xae3d('0x50')](function(_0x41b5fc){_0x569e4a(_0x41b5fc);});});}function getAgents(_0x5aac62,_0x42a7ce){return new BPromise(function(_0x41dc47,_0x151b8e){return db[_0x5aac62][_0xae3d('0x5d')]({'where':{'id':_0x42a7ce}})[_0xae3d('0x25')](function(_0x541436){return _0x541436['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x139755){var _0x242995=_[_0xae3d('0x5e')](_0x139755,'id');_0x41dc47(_0x242995);});})[_0xae3d('0x50')](function(_0x3726fb){_0x151b8e(_0x3726fb);});});}
\ No newline at end of file
+var _0x85da=['api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./notification.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','sendNotification','text','body','hasOwnProperty','Sequelize','TemplateId','view','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','sortBy','join','sequelize','transaction','Notification','create','forEach','recipient','emit','notification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','queue','replace','Queue','push','flatten','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x325783,_0x4e0d7f){var _0xa4bfe3=function(_0x4d7fcf){while(--_0x4d7fcf){_0x325783['push'](_0x325783['shift']());}};_0xa4bfe3(++_0x4e0d7f);}(_0x85da,0x1cf));var _0xa85d=function(_0x495b3d,_0x4d3da4){_0x495b3d=_0x495b3d-0x0;var _0x4cb329=_0x85da[_0x495b3d];return _0x4cb329;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa85d('0x0'));var rimraf=require(_0xa85d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa85d('0x2'));var rp=require(_0xa85d('0x3'));var moment=require(_0xa85d('0x4'));var BPromise=require(_0xa85d('0x5'));var Mustache=require(_0xa85d('0x6'));var util=require('util');var path=require(_0xa85d('0x7'));var sox=require('sox');var csv=require(_0xa85d('0x8'));var ejs=require(_0xa85d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa85d('0xa'));var jsforce=require(_0xa85d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa85d('0x8'));var querystring=require(_0xa85d('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa85d('0xd'));var as=require(_0xa85d('0xe'));var hardwareService=require(_0xa85d('0xf'));var logger=require(_0xa85d('0x10'))(_0xa85d('0x11'));var utils=require('../../config/utils');var config=require(_0xa85d('0x12'));var db=require('../../mysqldb')['db'];config[_0xa85d('0x13')]=_[_0xa85d('0x14')](config[_0xa85d('0x13')],{'host':_0xa85d('0x15'),'port':0x18eb});var socket=require(_0xa85d('0x16'))(new Redis(config[_0xa85d('0x13')]));require(_0xa85d('0x17'))[_0xa85d('0x18')](socket);function respondWithStatusCode(_0x31b5de,_0x9ea276){_0x9ea276=_0x9ea276||0xcc;return function(_0x5dcd1f){if(_0x5dcd1f){return _0x31b5de[_0xa85d('0x19')](_0x9ea276);}return _0x31b5de[_0xa85d('0x1a')](_0x9ea276)[_0xa85d('0x1b')]();};}function respondWithResult(_0x3b8904,_0x395a66){_0x395a66=_0x395a66||0xc8;return function(_0x1ee2e3){if(_0x1ee2e3){return _0x3b8904[_0xa85d('0x1a')](_0x395a66)[_0xa85d('0x1c')](_0x1ee2e3);}};}function respondWithFilteredResult(_0x5f4858,_0x4583f9){return function(_0x57e536){if(_0x57e536){var _0x5988f6=_0x57e536[_0xa85d('0x1d')],_0x68ee48=_0x4583f9['offset'],_0x520d30=_0x4583f9[_0xa85d('0x1e')]+_0x4583f9[_0xa85d('0x1f')],_0x219b8b;if(_0x520d30>=_0x5988f6){_0x520d30=_0x5988f6;_0x219b8b=0xc8;}else{_0x219b8b=0xce;}_0x5f4858['status'](_0x219b8b);return _0x5f4858[_0xa85d('0x20')](_0xa85d('0x21'),_0x68ee48+'-'+_0x520d30+'/'+_0x5988f6)[_0xa85d('0x1c')](_0x57e536);}return null;};}function patchUpdates(_0x823e6c){return function(_0x1da2e0){try{jsonpatch[_0xa85d('0x22')](_0x1da2e0,_0x823e6c,!![]);}catch(_0x5ea595){return BPromise[_0xa85d('0x23')](_0x5ea595);}return _0x1da2e0[_0xa85d('0x24')]();};}function saveUpdates(_0xbe366c,_0x5d0173){return function(_0x5e57a6){if(_0x5e57a6){return _0x5e57a6['update'](_0xbe366c)[_0xa85d('0x25')](function(_0x1e86b0){return _0x1e86b0;});}return null;};}function removeEntity(_0x1564b2,_0x512805){return function(_0x543b77){if(_0x543b77){return _0x543b77[_0xa85d('0x26')]()['then'](function(){_0x1564b2['status'](0xcc)[_0xa85d('0x1b')]();});}};}function handleEntityNotFound(_0x517519,_0x2ec66e){return function(_0x50922e){if(!_0x50922e){_0x517519[_0xa85d('0x19')](0x194);}return _0x50922e;};}function handleError(_0x23b6d4,_0x17054c){_0x17054c=_0x17054c||0x1f4;return function(_0x145dd8){logger[_0xa85d('0x27')](_0x145dd8['stack']);if(_0x145dd8['name']){delete _0x145dd8[_0xa85d('0x28')];}_0x23b6d4[_0xa85d('0x1a')](_0x17054c)[_0xa85d('0x29')](_0x145dd8);};}exports[_0xa85d('0x2a')]=function(_0x3d9dd6,_0x7793f9,_0x2bcc8e){if(!_0x3d9dd6['body']['hasOwnProperty'](_0xa85d('0x2b'))&&!_0x3d9dd6[_0xa85d('0x2c')][_0xa85d('0x2d')]('TemplateId')){throw new db[(_0xa85d('0x2e'))]['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x3d9dd6[_0xa85d('0x2c')][_0xa85d('0x2d')](_0xa85d('0x2f'))&&!_0x3d9dd6['body'][_0xa85d('0x2d')](_0xa85d('0x30'))){throw new db[(_0xa85d('0x2e'))][(_0xa85d('0x31'))](_0xa85d('0x32'));}if(!_0x3d9dd6[_0xa85d('0x2c')]['hasOwnProperty'](_0xa85d('0x33'))){throw new db[(_0xa85d('0x2e'))][(_0xa85d('0x31'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x5eed47=JSON[_0xa85d('0x34')](_0x3d9dd6[_0xa85d('0x2c')][_0xa85d('0x33')]);}catch(_0x5b69a7){logger[_0xa85d('0x27')](_0x5b69a7);throw new db[(_0xa85d('0x2e'))][(_0xa85d('0x31'))](_0xa85d('0x35'));}var _0x20358e=['chatqueue',_0xa85d('0x36'),_0xa85d('0x37'),_0xa85d('0x38'),_0xa85d('0x39'),_0xa85d('0x3a'),_0xa85d('0x3b'),'team',_0xa85d('0x3c')];if(_['some'](_0x5eed47,function(_0x235bc4){return!_['includes'](_0x20358e,_0x235bc4[_0xa85d('0x3d')]['toLowerCase']());})){throw new db[(_0xa85d('0x2e'))][(_0xa85d('0x31'))](_0xa85d('0x3e'));}}}var _0x52dd44={};_0x52dd44[_0xa85d('0x3f')]=_0x3d9dd6[_0xa85d('0x2c')]['hasOwnProperty'](_0xa85d('0x3f'))?_0x3d9dd6[_0xa85d('0x2c')][_0xa85d('0x3f')]:_0x3d9dd6[_0xa85d('0x3c')][_0xa85d('0x40')];_0x52dd44['recipientsDescription']=_[_0xa85d('0x41')](_0x3d9dd6[_0xa85d('0x2c')][_0xa85d('0x42')])?null:_0x3d9dd6[_0xa85d('0x2c')][_0xa85d('0x42')];_0x52dd44[_0xa85d('0x43')]=_0x3d9dd6[_0xa85d('0x2c')][_0xa85d('0x43')]||![];_0x52dd44[_0xa85d('0x44')]=_0x3d9dd6[_0xa85d('0x3c')]['id'];return getContent(_0x3d9dd6[_0xa85d('0x2c')])[_0xa85d('0x25')](function(_0x32add0){_0x52dd44[_0xa85d('0x2c')]=_0x32add0;return getRecipients(_0x5eed47);})[_0xa85d('0x25')](function(_0x532193){_0x52dd44['recipientsId']=_[_0xa85d('0x45')](_0x532193)[_0xa85d('0x46')](',');return db[_0xa85d('0x47')][_0xa85d('0x48')](function(_0x3c2c95){return db[_0xa85d('0x49')][_0xa85d('0x4a')](_0x52dd44,{'raw':!![],'transaction':_0x3c2c95})[_0xa85d('0x25')](function(_0x36f6d6){var _0x2b451a={'sender':_0x52dd44[_0xa85d('0x3f')],'description':_0x52dd44[_0xa85d('0x42')],'content':_0x52dd44[_0xa85d('0x2c')],'beep':_0x52dd44[_0xa85d('0x43')]};_0x532193[_0xa85d('0x4b')](function(_0x49bbe7){_0x2b451a[_0xa85d('0x4c')]=_0x49bbe7;socket[_0xa85d('0x4d')](_0xa85d('0x4e'),_0x2b451a);});return _0x36f6d6;});});})[_0xa85d('0x25')](respondWithResult(_0x7793f9,0xc9))[_0xa85d('0x4f')](handleError(_0x7793f9,null));};function getContent(_0x13edb0){return new BPromise(function(_0x1fec6c,_0x2b5c2a){if(_0x13edb0['text']){_0x1fec6c(_0x13edb0[_0xa85d('0x2b')]);return;}return db[_0xa85d('0x50')][_0xa85d('0x51')]({'attributes':[_0xa85d('0x52')],'where':{'id':_0x13edb0[_0xa85d('0x2f')]},'raw':!![]})['then'](function(_0x39c3ad){if(!_0x39c3ad)throw new db[(_0xa85d('0x2e'))][(_0xa85d('0x31'))](_0xa85d('0x53'));var _0x557d5b=Mustache[_0xa85d('0x54')](_0x39c3ad['html'],_0x13edb0[_0xa85d('0x30')]);_0x1fec6c(_0x557d5b);})[_0xa85d('0x4f')](function(_0x14fbb1){_0x2b5c2a(_0x14fbb1);});});}function getRecipients(_0x76acd0){return new BPromise(function(_0x2c8e43,_0x4ee7b8){var _0x5671a4=[];var _0x5462e5=[];_0x76acd0['forEach'](function(_0x465e14){var _0x5a3499=_[_0xa85d('0x55')](_0x465e14['model']['toLowerCase']());if(_0x5a3499===_0xa85d('0x56')){_0x5671a4=_[_0xa85d('0x57')](_0x5671a4,_0x465e14[_0xa85d('0x58')]);}else{if(_['includes'](_0x5a3499,_0xa85d('0x59')))_0x5a3499=_0x5a3499[_0xa85d('0x5a')](_0xa85d('0x59'),_0xa85d('0x5b'));_0x465e14['ids'][_0xa85d('0x4b')](function(_0x38b815){_0x5462e5[_0xa85d('0x5c')](getAgents(_0x5a3499,_0x38b815));});}});return BPromise['all'](_0x5462e5)[_0xa85d('0x25')](function(_0x252668){_0x5671a4=_['union'](_0x5671a4,_[_0xa85d('0x5d')](_0x252668));_0x2c8e43(_0x5671a4);})['catch'](function(_0x45edb3){_0x4ee7b8(_0x45edb3);});});}function getAgents(_0x384154,_0x481533){return new BPromise(function(_0x46ea60,_0xea8c89){return db[_0x384154][_0xa85d('0x51')]({'where':{'id':_0x481533}})[_0xa85d('0x25')](function(_0x2b2ad4){return _0x2b2ad4[_0xa85d('0x5e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x17fbc0){var _0x33dce0=_[_0xa85d('0x5f')](_0x17fbc0,'id');_0x46ea60(_0x33dce0);});})['catch'](function(_0x124acc){_0xea8c89(_0x124acc);});});}
\ No newline at end of file
index 0dea8ee..ae1280c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x5a9033,_0x3f63c1){var _0x56438f=function(_0x277714){while(--_0x277714){_0x5a9033['push'](_0x5a9033['shift']());}};_0x56438f(++_0x3f63c1);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var EventEmitter=require('events');var Notification=require(_0x65f6('0x0'))['db']['Notification'];var NotificationEvents=new EventEmitter();NotificationEvents[_0x65f6('0x1')](0x0);var events={'afterCreate':_0x65f6('0x2'),'afterUpdate':_0x65f6('0x3'),'afterDestroy':_0x65f6('0x4')};function emitEvent(_0x1a330c){return function(_0x5eb9ad,_0x3c5029,_0x5150c8){NotificationEvents[_0x65f6('0x5')](_0x1a330c+':'+_0x5eb9ad['id'],_0x5eb9ad);NotificationEvents[_0x65f6('0x5')](_0x1a330c,_0x5eb9ad);_0x5150c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Notification['hook'](e,emitEvent(event));}}module[_0x65f6('0x6')]=NotificationEvents;
\ No newline at end of file
+var _0xdb28=['Notification','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x567ac1,_0x11e696){var _0x120bf2=function(_0x17110e){while(--_0x17110e){_0x567ac1['push'](_0x567ac1['shift']());}};_0x120bf2(++_0x11e696);}(_0xdb28,0x106));var _0x8db2=function(_0x4cf4ce,_0x30367a){_0x4cf4ce=_0x4cf4ce-0x0;var _0x5f2482=_0xdb28[_0x4cf4ce];return _0x5f2482;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var Notification=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var NotificationEvents=new EventEmitter();NotificationEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){NotificationEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);NotificationEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Notification['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=NotificationEvents;
\ No newline at end of file
index 8f6b6dd..a1c5e65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['Notification','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./notification.attributes','define'];(function(_0x19bf7a,_0x19c529){var _0x326db3=function(_0x1ee683){while(--_0x1ee683){_0x19bf7a['push'](_0x19bf7a['shift']());}};_0x326db3(++_0x19c529);}(_0xb7e7,0x121));var _0x7b7e=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xb7e7[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'notifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b7e('0x9'),'collate':_0x7b7e('0xa')});};
\ No newline at end of file
+var _0xed3c=['exports','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','./notification.attributes'];(function(_0x290c1f,_0xd2de73){var _0x37d4c0=function(_0x733878){while(--_0x733878){_0x290c1f['push'](_0x290c1f['shift']());}};_0x37d4c0(++_0xd2de73);}(_0xed3c,0x1a6));var _0xced3=function(_0x1b903c,_0x3e369c){_0x1b903c=_0x1b903c-0x0;var _0x41b5ed=_0xed3c[_0x1b903c];return _0x41b5ed;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var logger=require(_0xced3('0x2'))(_0xced3('0x3'));var moment=require('moment');var BPromise=require(_0xced3('0x4'));var rp=require(_0xced3('0x5'));var fs=require('fs');var path=require(_0xced3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xced3('0x7'));module[_0xced3('0x8')]=function(_0x2f92f8,_0x1cd694){return _0x2f92f8['define']('Notification',attributes,{'tableName':'notifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xced3('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 2a4ca23..5b512be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa8a=['defaults','localhost','socket.io-emitter','./notification.socket','then','info','Notification,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x4e0406,_0x2b01e8){var _0x48e193=function(_0x3839b3){while(--_0x3839b3){_0x4e0406['push'](_0x4e0406['shift']());}};_0x48e193(++_0x2b01e8);}(_0xaa8a,0x1b5));var _0xaaa8=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0xaa8a[_0x270adf];return _0x29eda9;};'use strict';var _=require(_0xaaa8('0x0'));var util=require(_0xaaa8('0x1'));var moment=require(_0xaaa8('0x2'));var BPromise=require(_0xaaa8('0x3'));var rs=require(_0xaaa8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaaa8('0x5'))['db'];var utils=require(_0xaaa8('0x6'));var logger=require(_0xaaa8('0x7'))(_0xaaa8('0x8'));var config=require('../../config/environment');var jayson=require(_0xaaa8('0x9'));var client=jayson[_0xaaa8('0xa')][_0xaaa8('0xb')]({'port':0x232a});config[_0xaaa8('0xc')]=_[_0xaaa8('0xd')](config[_0xaaa8('0xc')],{'host':_0xaaa8('0xe'),'port':0x18eb});var socket=require(_0xaaa8('0xf'))(new Redis(config['redis']));require(_0xaaa8('0x10'))['register'](socket);function respondWithRpcPromise(_0x39e7ee,_0x53a2ac,_0x4edcd0){return new BPromise(function(_0x399b27,_0x54beb5){return client['request'](_0x39e7ee,_0x4edcd0)[_0xaaa8('0x11')](function(_0x58b1b4){logger[_0xaaa8('0x12')](_0xaaa8('0x13'),_0x53a2ac,'request\x20sent');logger['debug']('Notification,\x20%s,\x20%s,\x20%s',_0x53a2ac,'request\x20sent',JSON[_0xaaa8('0x14')](_0x58b1b4));if(_0x58b1b4['error']){if(_0x58b1b4[_0xaaa8('0x15')]['code']===0x1f4){logger['error'](_0xaaa8('0x13'),_0x53a2ac,_0x58b1b4[_0xaaa8('0x15')][_0xaaa8('0x16')]);return _0x54beb5(_0x58b1b4['error']['message']);}logger['error'](_0xaaa8('0x13'),_0x53a2ac,_0x58b1b4['error'][_0xaaa8('0x16')]);return _0x399b27(_0x58b1b4[_0xaaa8('0x15')][_0xaaa8('0x16')]);}else{logger[_0xaaa8('0x12')](_0xaaa8('0x13'),_0x53a2ac,_0xaaa8('0x17'));_0x399b27(_0x58b1b4[_0xaaa8('0x18')][_0xaaa8('0x16')]);}})['catch'](function(_0x4bc7ca){logger[_0xaaa8('0x15')](_0xaaa8('0x13'),_0x53a2ac,_0x4bc7ca);_0x54beb5(_0x4bc7ca);});});}
\ No newline at end of file
+var _0x7420=['moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./notification.socket','request','info','Notification,\x20%s,\x20%s','request\x20sent','debug','Notification,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util'];(function(_0x26e1e7,_0x128d99){var _0x50272e=function(_0x100476){while(--_0x100476){_0x26e1e7['push'](_0x26e1e7['shift']());}};_0x50272e(++_0x128d99);}(_0x7420,0x129));var _0x0742=function(_0x40d503,_0x1eda2){_0x40d503=_0x40d503-0x0;var _0x3abaab=_0x7420[_0x40d503];return _0x3abaab;};'use strict';var _=require(_0x0742('0x0'));var util=require(_0x0742('0x1'));var moment=require(_0x0742('0x2'));var BPromise=require('bluebird');var rs=require(_0x0742('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0742('0x4'))['db'];var utils=require(_0x0742('0x5'));var logger=require('../../config/logger')(_0x0742('0x6'));var config=require('../../config/environment');var jayson=require(_0x0742('0x7'));var client=jayson['client'][_0x0742('0x8')]({'port':0x232a});config[_0x0742('0x9')]=_[_0x0742('0xa')](config[_0x0742('0x9')],{'host':_0x0742('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0742('0x9')]));require(_0x0742('0xc'))['register'](socket);function respondWithRpcPromise(_0x2b3702,_0x2416a1,_0x347a49){return new BPromise(function(_0x4ce414,_0x2b022d){return client[_0x0742('0xd')](_0x2b3702,_0x347a49)['then'](function(_0xd40dd0){logger[_0x0742('0xe')](_0x0742('0xf'),_0x2416a1,_0x0742('0x10'));logger[_0x0742('0x11')](_0x0742('0x12'),_0x2416a1,_0x0742('0x10'),JSON['stringify'](_0xd40dd0));if(_0xd40dd0['error']){if(_0xd40dd0[_0x0742('0x13')]['code']===0x1f4){logger['error'](_0x0742('0xf'),_0x2416a1,_0xd40dd0['error'][_0x0742('0x14')]);return _0x2b022d(_0xd40dd0[_0x0742('0x13')][_0x0742('0x14')]);}logger[_0x0742('0x13')](_0x0742('0xf'),_0x2416a1,_0xd40dd0[_0x0742('0x13')]['message']);return _0x4ce414(_0xd40dd0[_0x0742('0x13')][_0x0742('0x14')]);}else{logger[_0x0742('0xe')]('Notification,\x20%s,\x20%s',_0x2416a1,_0x0742('0x10'));_0x4ce414(_0xd40dd0[_0x0742('0x15')][_0x0742('0x14')]);}})[_0x0742('0x16')](function(_0x1a313a){logger[_0x0742('0x13')](_0x0742('0xf'),_0x2416a1,_0x1a313a);_0x2b022d(_0x1a313a);});});}
\ No newline at end of file
index cad5db8..619d9c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74ec=['emit','length','./notification.events','save'];(function(_0x50091c,_0x2cee26){var _0x27a165=function(_0x291d24){while(--_0x291d24){_0x50091c['push'](_0x50091c['shift']());}};_0x27a165(++_0x2cee26);}(_0x74ec,0x13a));var _0xc74e=function(_0x712020,_0x5deab0){_0x712020=_0x712020-0x0;var _0x522ff6=_0x74ec[_0x712020];return _0x522ff6;};'use strict';var NotificationEvents=require(_0xc74e('0x0'));var events=[_0xc74e('0x1'),'remove','update'];function createListener(_0x1ecf57,_0x511379){return function(_0x2d7f2){_0x511379[_0xc74e('0x2')](_0x1ecf57,_0x2d7f2);};}function removeListener(_0x54930b,_0x9c016c){return function(){NotificationEvents['removeListener'](_0x54930b,_0x9c016c);};}exports['register']=function(_0x302cc9){for(var _0x1f7459=0x0,_0x7c525d=events[_0xc74e('0x3')];_0x1f7459<_0x7c525d;_0x1f7459++){var _0x148419=events[_0x1f7459];var _0x112c9b=createListener('notification:'+_0x148419,_0x302cc9);NotificationEvents['on'](_0x148419,_0x112c9b);}};
\ No newline at end of file
+var _0x27c0=['remove','update','emit','removeListener','register','length'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x27c0,0x1a4));var _0x027c=function(_0x2c367d,_0x16fdf3){_0x2c367d=_0x2c367d-0x0;var _0x34d53c=_0x27c0[_0x2c367d];return _0x34d53c;};'use strict';var NotificationEvents=require('./notification.events');var events=['save',_0x027c('0x0'),_0x027c('0x1')];function createListener(_0x448ffe,_0x4b21dd){return function(_0x1a16fb){_0x4b21dd[_0x027c('0x2')](_0x448ffe,_0x1a16fb);};}function removeListener(_0x20a85d,_0x267977){return function(){NotificationEvents[_0x027c('0x3')](_0x20a85d,_0x267977);};}exports[_0x027c('0x4')]=function(_0x37c76c){for(var _0x315a43=0x0,_0xa7a385=events[_0x027c('0x5')];_0x315a43<_0xa7a385;_0x315a43++){var _0x49616a=events[_0x315a43];var _0xbe15fb=createListener('notification:'+_0x49616a,_0x37c76c);NotificationEvents['on'](_0x49616a,_0xbe15fb);}};
\ No newline at end of file
index 5c04921..2887862 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8a4=['post','create','/:id/dispositions','addDisposition','/:id/notify','notify','/:id/applications','addApplications','/:id/send','send','update','delete','removeDispositions','removeAnswers','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/interactions','/:id/users','getAgents'];(function(_0x1610a9,_0x3cf98d){var _0x407dd7=function(_0x33dc87){while(--_0x33dc87){_0x1610a9['push'](_0x1610a9['shift']());}};_0x407dd7(++_0x3cf98d);}(_0xf8a4,0x19b));var _0x4f8a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf8a4[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4f8a('0x0'));var timeout=require(_0x4f8a('0x1'));var express=require(_0x4f8a('0x2'));var router=express[_0x4f8a('0x3')]();var auth=require(_0x4f8a('0x4'));var interaction=require(_0x4f8a('0x5'));var config=require('../../config/environment');var controller=require(_0x4f8a('0x6'));router[_0x4f8a('0x7')]('/',auth[_0x4f8a('0x8')](),controller['index']);router[_0x4f8a('0x7')](_0x4f8a('0x9'),auth[_0x4f8a('0x8')](),controller[_0x4f8a('0xa')]);router[_0x4f8a('0x7')](_0x4f8a('0xb'),auth[_0x4f8a('0x8')](),controller[_0x4f8a('0xc')]);router[_0x4f8a('0x7')]('/:id/dispositions',auth[_0x4f8a('0x8')](),controller['getDispositions']);router[_0x4f8a('0x7')](_0x4f8a('0xd'),auth['isAuthenticated'](),controller[_0x4f8a('0xe')]);router[_0x4f8a('0x7')]('/:id/applications',auth[_0x4f8a('0x8')](),controller['getApplications']);router['get'](_0x4f8a('0xf'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x4f8a('0x7')](_0x4f8a('0x10'),auth['isAuthenticated'](),controller[_0x4f8a('0x11')]);router[_0x4f8a('0x12')]('/',auth['isAuthenticated'](),controller[_0x4f8a('0x13')]);router['post'](_0x4f8a('0x14'),auth['isAuthenticated'](),controller[_0x4f8a('0x15')]);router['post'](_0x4f8a('0xd'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x4f8a('0x12')](_0x4f8a('0x16'),controller[_0x4f8a('0x17')]);router[_0x4f8a('0x12')](_0x4f8a('0x18'),auth[_0x4f8a('0x8')](),controller[_0x4f8a('0x19')]);router[_0x4f8a('0x12')](_0x4f8a('0x10'),auth[_0x4f8a('0x8')](),controller['addAgents']);router['post'](_0x4f8a('0x1a'),auth[_0x4f8a('0x8')](),controller[_0x4f8a('0x1b')]);router['put']('/:id',auth[_0x4f8a('0x8')](),controller[_0x4f8a('0x1c')]);router[_0x4f8a('0x1d')](_0x4f8a('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x4f8a('0x1d')](_0x4f8a('0x14'),auth[_0x4f8a('0x8')](),controller[_0x4f8a('0x1e')]);router[_0x4f8a('0x1d')]('/:id/canned_answers',auth[_0x4f8a('0x8')](),controller[_0x4f8a('0x1f')]);router[_0x4f8a('0x1d')](_0x4f8a('0x10'),auth[_0x4f8a('0x8')](),controller['removeAgents']);module[_0x4f8a('0x20')]=router;
\ No newline at end of file
+var _0x7ac3=['/:id/applications','/:id/users','/:id/send','send','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getApplications','getInteractions','post','create','addDisposition','addAnswer','/:id/notify','notify'];(function(_0x402094,_0x33a6e6){var _0x2f2d3c=function(_0x497c72){while(--_0x497c72){_0x402094['push'](_0x402094['shift']());}};_0x2f2d3c(++_0x33a6e6);}(_0x7ac3,0x195));var _0x37ac=function(_0x3f0f95,_0x498023){_0x3f0f95=_0x3f0f95-0x0;var _0x17693e=_0x7ac3[_0x3f0f95];return _0x17693e;};'use strict';var multer=require(_0x37ac('0x0'));var util=require(_0x37ac('0x1'));var path=require(_0x37ac('0x2'));var timeout=require(_0x37ac('0x3'));var express=require(_0x37ac('0x4'));var router=express[_0x37ac('0x5')]();var auth=require(_0x37ac('0x6'));var interaction=require(_0x37ac('0x7'));var config=require('../../config/environment');var controller=require(_0x37ac('0x8'));router[_0x37ac('0x9')]('/',auth['isAuthenticated'](),controller[_0x37ac('0xa')]);router[_0x37ac('0x9')](_0x37ac('0xb'),auth[_0x37ac('0xc')](),controller[_0x37ac('0xd')]);router[_0x37ac('0x9')](_0x37ac('0xe'),auth[_0x37ac('0xc')](),controller[_0x37ac('0xf')]);router[_0x37ac('0x9')](_0x37ac('0x10'),auth[_0x37ac('0xc')](),controller[_0x37ac('0x11')]);router[_0x37ac('0x9')](_0x37ac('0x12'),auth[_0x37ac('0xc')](),controller['getAnswers']);router[_0x37ac('0x9')]('/:id/applications',auth[_0x37ac('0xc')](),controller[_0x37ac('0x13')]);router[_0x37ac('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x37ac('0x14')]);router[_0x37ac('0x9')]('/:id/users',auth[_0x37ac('0xc')](),controller['getAgents']);router[_0x37ac('0x15')]('/',auth['isAuthenticated'](),controller[_0x37ac('0x16')]);router[_0x37ac('0x15')](_0x37ac('0x10'),auth['isAuthenticated'](),controller[_0x37ac('0x17')]);router['post']('/:id/canned_answers',auth[_0x37ac('0xc')](),controller[_0x37ac('0x18')]);router['post'](_0x37ac('0x19'),controller[_0x37ac('0x1a')]);router[_0x37ac('0x15')](_0x37ac('0x1b'),auth[_0x37ac('0xc')](),controller['addApplications']);router[_0x37ac('0x15')](_0x37ac('0x1c'),auth[_0x37ac('0xc')](),controller['addAgents']);router[_0x37ac('0x15')](_0x37ac('0x1d'),auth['isAuthenticated'](),controller[_0x37ac('0x1e')]);router['put']('/:id',auth[_0x37ac('0xc')](),controller[_0x37ac('0x1f')]);router[_0x37ac('0x20')](_0x37ac('0xe'),auth[_0x37ac('0xc')](),controller[_0x37ac('0x21')]);router[_0x37ac('0x20')]('/:id/dispositions',auth[_0x37ac('0xc')](),controller[_0x37ac('0x22')]);router[_0x37ac('0x20')](_0x37ac('0x12'),auth[_0x37ac('0xc')](),controller['removeAnswers']);router[_0x37ac('0x20')](_0x37ac('0x1c'),auth[_0x37ac('0xc')](),controller['removeAgents']);module[_0x37ac('0x23')]=router;
\ No newline at end of file
index 4ead591..2b68794 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2fc=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xd2fc,0x180));var _0xcd2f=function(_0x3efccf,_0x23beef){_0x3efccf=_0x3efccf-0x0;var _0x21c196=_0xd2fc[_0x3efccf];return _0x21c196;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xcd2f('0x0')]={'name':{'type':Sequelize[_0xcd2f('0x1')],'unique':_0xcd2f('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xcd2f('0x1')],'defaultValue':function(){return rs[_0xcd2f('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xcd2f('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xcd2f('0x4')],'defaultValue':function(){return _0xcd2f('0x5');}},'notificationSound':{'type':Sequelize[_0xcd2f('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcd2f('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcd2f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xcd2f('0x1')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcd2f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcd2f('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xcd2f('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xcd2f('0x6')],'defaultValue':![],'comment':_0xcd2f('0x9'),'set':function(_0x2d70d7){if(!_0x2d70d7)this[_0xcd2f('0xa')](_0xcd2f('0xb'),null);this[_0xcd2f('0xa')](_0xcd2f('0xc'),_0x2d70d7);}}};
\ No newline at end of file
+var _0x1b21=['STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring'];(function(_0x36bff5,_0x3156cb){var _0x80ade5=function(_0x5eee65){while(--_0x5eee65){_0x36bff5['push'](_0x36bff5['shift']());}};_0x80ade5(++_0x3156cb);}(_0x1b21,0x149));var _0x11b2=function(_0x24ce1a,_0x1b851c){_0x24ce1a=_0x24ce1a-0x0;var _0x15938e=_0x1b21[_0x24ce1a];return _0x15938e;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x11b2('0x0'));module['exports']={'name':{'type':Sequelize[_0x11b2('0x1')],'unique':_0x11b2('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x11b2('0x3')]();}},'replyUri':{'type':Sequelize[_0x11b2('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x11b2('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x11b2('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x11b2('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x11b2('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x11b2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x11b2('0x1')]},'queueTransfer':{'type':Sequelize[_0x11b2('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x11b2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x11b2('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x11b2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x11b2('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x11b2('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x11b2('0x5')],'defaultValue':![],'comment':_0x11b2('0x8'),'set':function(_0x4de18e){if(!_0x4de18e)this[_0x11b2('0x9')](_0x11b2('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x4de18e);}}};
\ No newline at end of file
index 9559def..d93a1d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x381e=['destroy','get','OpenchannelAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','count','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','length','pick','OpenchannelAccountId','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','CmContact','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','asc','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','sequelize','transaction','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','jayson/promise','http','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','set','Content-Range','json','apply','reject'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x381e,0x14d));var _0xe381=function(_0xbe10b1,_0x7625d4){_0xbe10b1=_0xbe10b1-0x0;var _0x20e467=_0x381e[_0xbe10b1];return _0x20e467;};'use strict';var pdf=require(_0xe381('0x0'));var emlformat=require(_0xe381('0x1'));var rimraf=require(_0xe381('0x2'));var zipdir=require(_0xe381('0x3'));var jsonpatch=require(_0xe381('0x4'));var rp=require('request-promise');var moment=require(_0xe381('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe381('0x6'));var util=require(_0xe381('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe381('0x8'));var ejs=require(_0xe381('0x9'));var fs=require('fs');var _=require(_0xe381('0xa'));var squel=require(_0xe381('0xb'));var crypto=require('crypto');var jsforce=require(_0xe381('0xc'));var deskjs=require(_0xe381('0xd'));var toCsv=require(_0xe381('0x8'));var querystring=require(_0xe381('0xe'));var Papa=require(_0xe381('0xf'));var Redis=require(_0xe381('0x10'));var authService=require(_0xe381('0x11'));var qs=require(_0xe381('0x12'));var as=require(_0xe381('0x13'));var hardwareService=require(_0xe381('0x14'));var logger=require(_0xe381('0x15'))(_0xe381('0x16'));var utils=require(_0xe381('0x17'));var config=require(_0xe381('0x18'));var db=require(_0xe381('0x19'))['db'];config[_0xe381('0x1a')]=_['defaults'](config[_0xe381('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xe381('0x1b'))(new Redis(config[_0xe381('0x1a')]));require(_0xe381('0x1c'))['register'](socket);var jayson=require(_0xe381('0x1d'));var client=jayson['client'][_0xe381('0x1e')]({'port':0x232c});var client9002=jayson[_0xe381('0x1f')][_0xe381('0x1e')]({'port':0x232a});function checkPasswordPattern(_0xd0442d,_0x5f149d,_0x3a7af2){if(_0x3a7af2){var _0xfa15d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xfa15d['test'](_0x5f149d)){return _0xd0442d;}else{throw new db[(_0xe381('0x20'))][(_0xe381('0x21'))](_0xe381('0x22'));}}else{return _0xd0442d;}}function respondWithRpcPromise(_0x306099,_0x4c9ad9,_0x2f96e7,_0xd8ed69){return new BPromise(function(_0xe2748b,_0x296dd1){var _0x2e33e6=_0xd8ed69||client;return _0x2e33e6['request'](_0x306099,_0x2f96e7)[_0xe381('0x23')](function(_0x25df37){logger[_0xe381('0x24')](_0xe381('0x25'),_0x4c9ad9,_0xe381('0x26'));logger[_0xe381('0x27')](_0xe381('0x28'),_0x4c9ad9,_0xe381('0x26'),JSON[_0xe381('0x29')](_0x25df37));if(_0x25df37[_0xe381('0x2a')]){if(_0x25df37[_0xe381('0x2a')][_0xe381('0x2b')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x4c9ad9,_0x25df37[_0xe381('0x2a')][_0xe381('0x2c')]);return _0x296dd1(_0x25df37[_0xe381('0x2a')][_0xe381('0x2c')]);}logger[_0xe381('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x4c9ad9,_0x25df37['error'][_0xe381('0x2c')]);return _0xe2748b(_0x25df37[_0xe381('0x2a')]['message']);}else{logger[_0xe381('0x24')](_0xe381('0x25'),_0x4c9ad9,'request\x20sent');_0xe2748b(_0x25df37[_0xe381('0x2d')]['message']);}})['catch'](function(_0x5a4fe2){logger[_0xe381('0x2a')](_0xe381('0x25'),_0x4c9ad9,_0x5a4fe2);_0x296dd1(_0x5a4fe2);});});}function respondWithStatusCode(_0x51de1a,_0x4b73f6){_0x4b73f6=_0x4b73f6||0xcc;return function(_0x4d19fe){if(_0x4d19fe){return _0x51de1a[_0xe381('0x2e')](_0x4b73f6);}return _0x51de1a[_0xe381('0x2f')](_0x4b73f6)[_0xe381('0x30')]();};}function respondWithResult(_0x251b62,_0x1b7979){_0x1b7979=_0x1b7979||0xc8;return function(_0x4d2475){if(_0x4d2475){return _0x251b62[_0xe381('0x2f')](_0x1b7979)['json'](_0x4d2475);}};}function respondWithFilteredResult(_0x1ac3b7,_0x22c4a8){return function(_0x2283d6){if(_0x2283d6){var _0x13acc0=_0x2283d6['count'],_0x238710=_0x22c4a8[_0xe381('0x31')],_0x5eb903=_0x22c4a8[_0xe381('0x31')]+_0x22c4a8['limit'],_0x505280;if(_0x5eb903>=_0x13acc0){_0x5eb903=_0x13acc0;_0x505280=0xc8;}else{_0x505280=0xce;}_0x1ac3b7[_0xe381('0x2f')](_0x505280);return _0x1ac3b7[_0xe381('0x32')](_0xe381('0x33'),_0x238710+'-'+_0x5eb903+'/'+_0x13acc0)[_0xe381('0x34')](_0x2283d6);}return null;};}function patchUpdates(_0x6eb76a){return function(_0x1fd46e){try{jsonpatch[_0xe381('0x35')](_0x1fd46e,_0x6eb76a,!![]);}catch(_0xc54641){return BPromise[_0xe381('0x36')](_0xc54641);}return _0x1fd46e['save']();};}function saveUpdates(_0x3f5f9c,_0x47bc56){return function(_0x5e18de){if(_0x5e18de){return _0x5e18de['update'](_0x3f5f9c)[_0xe381('0x23')](function(_0x302b6d){return _0x302b6d;});}return null;};}function removeEntity(_0xc597ba,_0x5bc953){return function(_0x598598){if(_0x598598){return _0x598598[_0xe381('0x37')]()[_0xe381('0x23')](function(){var _0x5ce477=_0x598598[_0xe381('0x38')]({'plain':!![]});var _0x235d25=_0xe381('0x39');return db['UserProfileResource'][_0xe381('0x37')]({'where':{'type':_0x235d25,'resourceId':_0x5ce477['id']}})[_0xe381('0x23')](function(){return _0x598598;});})['then'](function(){_0xc597ba['status'](0xcc)[_0xe381('0x30')]();});}};}function handleEntityNotFound(_0x397472,_0x165fb5){return function(_0x330ca9){if(!_0x330ca9){_0x397472[_0xe381('0x2e')](0x194);}return _0x330ca9;};}function handleError(_0x414d83,_0xdfbee6){_0xdfbee6=_0xdfbee6||0x1f4;return function(_0x401034){logger[_0xe381('0x2a')](_0x401034[_0xe381('0x3a')]);if(_0x401034[_0xe381('0x3b')]){delete _0x401034[_0xe381('0x3b')];}_0x414d83['status'](_0xdfbee6)[_0xe381('0x3c')](_0x401034);};}exports[_0xe381('0x3d')]=function(_0x2009eb,_0x16729d){var _0x4d59b4={'include':[{'model':db[_0xe381('0x3e')],'as':_0xe381('0x3f')}]},_0x46d2ee={},_0x5b36c2={'count':0x0,'rows':[]};var _0x50119d=_[_0xe381('0x40')](db[_0xe381('0x41')]['rawAttributes'],function(_0x1853ef){return{'name':_0x1853ef['fieldName'],'type':_0x1853ef[_0xe381('0x42')][_0xe381('0x43')]};});_0x46d2ee[_0xe381('0x44')]=_['map'](_0x50119d,_0xe381('0x3b'));_0x46d2ee[_0xe381('0x45')]=_[_0xe381('0x46')](_0x2009eb[_0xe381('0x45')]);_0x46d2ee[_0xe381('0x47')]=_[_0xe381('0x48')](_0x46d2ee[_0xe381('0x44')],_0x46d2ee[_0xe381('0x45')]);_0x4d59b4[_0xe381('0x49')]=_['intersection'](_0x46d2ee['model'],qs[_0xe381('0x4a')](_0x2009eb[_0xe381('0x45')][_0xe381('0x4a')]));_0x4d59b4['attributes']=_0x4d59b4[_0xe381('0x49')]['length']?_0x4d59b4['attributes']:_0x46d2ee[_0xe381('0x44')];if(!_0x2009eb[_0xe381('0x45')][_0xe381('0x4b')](_0xe381('0x4c'))){_0x4d59b4['limit']=qs[_0xe381('0x4d')](_0x2009eb[_0xe381('0x45')][_0xe381('0x4d')]);_0x4d59b4[_0xe381('0x31')]=qs[_0xe381('0x31')](_0x2009eb[_0xe381('0x45')][_0xe381('0x31')]);}_0x4d59b4[_0xe381('0x4e')]=qs[_0xe381('0x4f')](_0x2009eb[_0xe381('0x45')][_0xe381('0x4f')]);_0x4d59b4[_0xe381('0x50')]=qs[_0xe381('0x47')](_['pick'](_0x2009eb[_0xe381('0x45')],_0x46d2ee[_0xe381('0x47')]),_0x50119d);if(_0x2009eb[_0xe381('0x45')]['filter']){_0x4d59b4[_0xe381('0x50')]=_[_0xe381('0x51')](_0x4d59b4['where'],{'$or':_['map'](_0x50119d,function(_0x48fd2f){if(_0x48fd2f[_0xe381('0x42')]!==_0xe381('0x52')){var _0x5e9e8a={};_0x5e9e8a[_0x48fd2f['name']]={'$like':'%'+_0x2009eb[_0xe381('0x45')][_0xe381('0x53')]+'%'};return _0x5e9e8a;}})});}_0x4d59b4=_['merge']({},_0x4d59b4,_0x2009eb[_0xe381('0x54')]);var _0x1a4f0c={'where':_0x4d59b4['where']};return db[_0xe381('0x41')][_0xe381('0x55')](_0x1a4f0c)[_0xe381('0x23')](function(_0x5188a7){_0x5b36c2[_0xe381('0x55')]=_0x5188a7;if(_0x2009eb[_0xe381('0x45')][_0xe381('0x56')]){_0x4d59b4['include']=[{'all':!![]}];}return db[_0xe381('0x41')][_0xe381('0x57')](_0x4d59b4);})['then'](function(_0x144097){_0x5b36c2['rows']=_0x144097;return _0x5b36c2;})[_0xe381('0x23')](respondWithFilteredResult(_0x16729d,_0x4d59b4))[_0xe381('0x58')](handleError(_0x16729d,null));};exports[_0xe381('0x59')]=function(_0x632711,_0x245201){var _0x38f476={'raw':![],'where':{'id':_0x632711[_0xe381('0x5a')]['id']},'include':[{'model':db[_0xe381('0x3e')],'as':_0xe381('0x3f')}]},_0x39c5e6={};_0x39c5e6[_0xe381('0x44')]=_[_0xe381('0x46')](db['OpenchannelAccount'][_0xe381('0x5b')]);_0x39c5e6[_0xe381('0x45')]=_[_0xe381('0x46')](_0x632711['query']);_0x39c5e6[_0xe381('0x47')]=_[_0xe381('0x48')](_0x39c5e6['model'],_0x39c5e6['query']);_0x38f476[_0xe381('0x49')]=_[_0xe381('0x48')](_0x39c5e6['model'],qs[_0xe381('0x4a')](_0x632711[_0xe381('0x45')][_0xe381('0x4a')]));_0x38f476[_0xe381('0x49')]=_0x38f476[_0xe381('0x49')]['length']?_0x38f476[_0xe381('0x49')]:_0x39c5e6[_0xe381('0x44')];if(_0x632711[_0xe381('0x45')][_0xe381('0x56')]){_0x38f476[_0xe381('0x5c')]=[{'all':!![]}];}_0x38f476=_['merge']({},_0x38f476,_0x632711[_0xe381('0x54')]);return db[_0xe381('0x41')][_0xe381('0x5d')](_0x38f476)['then'](handleEntityNotFound(_0x245201,null))[_0xe381('0x23')](respondWithResult(_0x245201,null))['catch'](handleError(_0x245201,null));};exports[_0xe381('0x5e')]=function(_0xf4663,_0x25d07f){return db[_0xe381('0x41')][_0xe381('0x5e')](_0xf4663[_0xe381('0x5f')],{})[_0xe381('0x23')](function(_0x2fcf94){var _0x4826f6=_0xf4663[_0xe381('0x60')]['get']({'plain':!![]});if(!_0x4826f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4826f6[_0xe381('0x61')]===_0xe381('0x60')){var _0x8b8980=_0x2fcf94[_0xe381('0x38')]({'plain':!![]});var _0x1b9ce1=_0xe381('0x39');return db[_0xe381('0x62')][_0xe381('0x5d')]({'where':{'name':_0x1b9ce1,'userProfileId':_0x4826f6[_0xe381('0x63')]},'raw':!![]})[_0xe381('0x23')](function(_0x389f61){if(_0x389f61&&_0x389f61[_0xe381('0x64')]===0x0){return db[_0xe381('0x65')][_0xe381('0x5e')]({'name':_0x8b8980[_0xe381('0x3b')],'resourceId':_0x8b8980['id'],'type':_0x389f61[_0xe381('0x3b')],'sectionId':_0x389f61['id']},{})[_0xe381('0x23')](function(){return _0x2fcf94;});}else{return _0x2fcf94;}})[_0xe381('0x58')](function(_0x462561){logger[_0xe381('0x2a')](_0xe381('0x66'),_0x462561);throw _0x462561;});}return _0x2fcf94;})['then'](respondWithResult(_0x25d07f,0xc9))['catch'](handleError(_0x25d07f,null));};exports[_0xe381('0x67')]=function(_0x3fa9ec,_0x19d6c3){if(_0x3fa9ec[_0xe381('0x5f')]['id']){delete _0x3fa9ec[_0xe381('0x5f')]['id'];}return db[_0xe381('0x41')]['find']({'where':{'id':_0x3fa9ec[_0xe381('0x5a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xe381('0x23')](handleEntityNotFound(_0x19d6c3,null))[_0xe381('0x23')](saveUpdates(_0x3fa9ec[_0xe381('0x5f')],null))['then'](respondWithResult(_0x19d6c3,null))[_0xe381('0x58')](handleError(_0x19d6c3,null));};exports[_0xe381('0x37')]=function(_0x4526f2,_0x505e59){return db[_0xe381('0x41')][_0xe381('0x5d')]({'where':{'id':_0x4526f2[_0xe381('0x5a')]['id']}})[_0xe381('0x23')](handleEntityNotFound(_0x505e59,null))[_0xe381('0x23')](removeEntity(_0x505e59,null))['catch'](handleError(_0x505e59,null));};exports['describe']=function(_0x270b15,_0x17b79c){return db[_0xe381('0x41')][_0xe381('0x68')]()[_0xe381('0x23')](respondWithResult(_0x17b79c,null))['catch'](handleError(_0x17b79c,null));};exports[_0xe381('0x69')]=function(_0x5bd582,_0xbc16d8,_0xe10e3a){if(_0x5bd582[_0xe381('0x5f')]['id']){delete _0x5bd582[_0xe381('0x5f')]['id'];}return db['OpenchannelAccount'][_0xe381('0x5d')]({'where':{'id':_0x5bd582[_0xe381('0x5a')]['id']}})[_0xe381('0x23')](handleEntityNotFound(_0xbc16d8,null))[_0xe381('0x23')](function(_0x2280e7){if(_0x2280e7){_0x5bd582['body'][_0xe381('0x6a')]=_0x2280e7['id'];return db[_0xe381('0x6b')]['create'](_0x5bd582[_0xe381('0x5f')]);}})['then'](respondWithResult(_0xbc16d8,null))[_0xe381('0x58')](handleError(_0xbc16d8,null));};exports[_0xe381('0x6c')]=function(_0x404a46,_0x1cbfbc,_0x338e15){var _0x17fd26={'raw':![],'where':{}};var _0xba88c4={};var _0x256fa0={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe381('0x6d')]({'where':{'id':_0x404a46[_0xe381('0x5a')]['id']}})[_0xe381('0x23')](handleEntityNotFound(_0x1cbfbc,null))[_0xe381('0x23')](function(_0x1f7593){if(_0x1f7593){_0xba88c4[_0xe381('0x44')]=_[_0xe381('0x46')](db['Disposition']['rawAttributes']);_0xba88c4[_0xe381('0x45')]=_[_0xe381('0x46')](_0x404a46[_0xe381('0x45')]);_0xba88c4[_0xe381('0x47')]=_['intersection'](_0xba88c4['model'],_0xba88c4['query']);_0x17fd26[_0xe381('0x49')]=_[_0xe381('0x48')](_0xba88c4[_0xe381('0x44')],qs[_0xe381('0x4a')](_0x404a46['query'][_0xe381('0x4a')]));_0x17fd26[_0xe381('0x49')]=_0x17fd26[_0xe381('0x49')][_0xe381('0x6e')]?_0x17fd26['attributes']:_0xba88c4[_0xe381('0x44')];if(!_0x404a46[_0xe381('0x45')][_0xe381('0x4b')](_0xe381('0x4c'))){_0x17fd26['limit']=qs['limit'](_0x404a46[_0xe381('0x45')][_0xe381('0x4d')]);_0x17fd26[_0xe381('0x31')]=qs['offset'](_0x404a46[_0xe381('0x45')][_0xe381('0x31')]);}_0x17fd26[_0xe381('0x4e')]=qs[_0xe381('0x4f')](_0x404a46['query'][_0xe381('0x4f')]);_0x17fd26['where']=qs[_0xe381('0x47')](_[_0xe381('0x6f')](_0x404a46[_0xe381('0x45')],_0xba88c4[_0xe381('0x47')]));_0x17fd26[_0xe381('0x50')][_0xe381('0x70')]=_0x1f7593['id'];if(_0x404a46[_0xe381('0x45')]['filter']){_0x17fd26[_0xe381('0x50')]=_[_0xe381('0x51')](_0x17fd26[_0xe381('0x50')],{'$or':_[_0xe381('0x40')](_0x17fd26[_0xe381('0x49')],function(_0x1c76ef){var _0x4a5909={};_0x4a5909[_0x1c76ef]={'$like':'%'+_0x404a46[_0xe381('0x45')][_0xe381('0x53')]+'%'};return _0x4a5909;})});}_0x17fd26=_['merge']({},_0x17fd26,_0x404a46['options']);return db[_0xe381('0x6b')]['count']({'where':_0x17fd26['where']})['then'](function(_0x405050){_0x256fa0['count']=_0x405050;if(_0x404a46[_0xe381('0x45')][_0xe381('0x56')]){_0x17fd26[_0xe381('0x5c')]=[{'all':!![]}];}return db[_0xe381('0x6b')]['findAll'](_0x17fd26);})['then'](function(_0x4a30fe){_0x256fa0['rows']=_0x4a30fe;return _0x256fa0;});}})['then'](respondWithFilteredResult(_0x1cbfbc,_0x17fd26))[_0xe381('0x58')](handleError(_0x1cbfbc,null));};exports[_0xe381('0x71')]=function(_0x2a8f69,_0x479478,_0x5002f8){return db[_0xe381('0x41')][_0xe381('0x5d')]({'where':{'id':_0x2a8f69[_0xe381('0x5a')]['id']}})[_0xe381('0x23')](handleEntityNotFound(_0x479478,null))[_0xe381('0x23')](function(_0x89ebe2){if(_0x89ebe2){return _0x89ebe2[_0xe381('0x71')](_0x2a8f69[_0xe381('0x45')]['ids']);}})[_0xe381('0x23')](respondWithStatusCode(_0x479478,null))[_0xe381('0x58')](handleError(_0x479478,null));};exports['addAnswer']=function(_0x706dcc,_0x5ddaf7,_0x32e102){if(_0x706dcc[_0xe381('0x5f')]['id']){delete _0x706dcc[_0xe381('0x5f')]['id'];}return db['OpenchannelAccount'][_0xe381('0x5d')]({'where':{'id':_0x706dcc['params']['id']}})[_0xe381('0x23')](handleEntityNotFound(_0x5ddaf7,null))[_0xe381('0x23')](function(_0x14af4b){if(_0x14af4b){_0x706dcc['body']['OpenchannelAccountId']=_0x14af4b['id'];return db[_0xe381('0x72')]['create'](_0x706dcc[_0xe381('0x5f')]);}})[_0xe381('0x23')](respondWithResult(_0x5ddaf7,null))['catch'](handleError(_0x5ddaf7,null));};exports[_0xe381('0x73')]=function(_0x4a8990,_0x580252,_0x11cd7e){var _0x192f52={'raw':![],'where':{}};var _0x658dd7={};var _0x369af3={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe381('0x6d')]({'where':{'id':_0x4a8990[_0xe381('0x5a')]['id']}})[_0xe381('0x23')](handleEntityNotFound(_0x580252,null))['then'](function(_0x49067a){if(_0x49067a){_0x658dd7[_0xe381('0x44')]=_[_0xe381('0x46')](db[_0xe381('0x72')][_0xe381('0x5b')]);_0x658dd7[_0xe381('0x45')]=_[_0xe381('0x46')](_0x4a8990['query']);_0x658dd7['filters']=_[_0xe381('0x48')](_0x658dd7[_0xe381('0x44')],_0x658dd7[_0xe381('0x45')]);_0x192f52['attributes']=_[_0xe381('0x48')](_0x658dd7['model'],qs[_0xe381('0x4a')](_0x4a8990[_0xe381('0x45')][_0xe381('0x4a')]));_0x192f52[_0xe381('0x49')]=_0x192f52[_0xe381('0x49')][_0xe381('0x6e')]?_0x192f52[_0xe381('0x49')]:_0x658dd7[_0xe381('0x44')];if(!_0x4a8990[_0xe381('0x45')][_0xe381('0x4b')](_0xe381('0x4c'))){_0x192f52[_0xe381('0x4d')]=qs[_0xe381('0x4d')](_0x4a8990[_0xe381('0x45')][_0xe381('0x4d')]);_0x192f52[_0xe381('0x31')]=qs[_0xe381('0x31')](_0x4a8990[_0xe381('0x45')][_0xe381('0x31')]);}_0x192f52[_0xe381('0x4e')]=qs[_0xe381('0x4f')](_0x4a8990[_0xe381('0x45')]['sort']);_0x192f52[_0xe381('0x50')]=qs[_0xe381('0x47')](_['pick'](_0x4a8990[_0xe381('0x45')],_0x658dd7[_0xe381('0x47')]));_0x192f52[_0xe381('0x50')][_0xe381('0x70')]=_0x49067a['id'];if(_0x4a8990[_0xe381('0x45')][_0xe381('0x53')]){_0x192f52[_0xe381('0x50')]=_[_0xe381('0x51')](_0x192f52['where'],{'$or':_[_0xe381('0x40')](_0x192f52[_0xe381('0x49')],function(_0x16b333){var _0x2718e6={};_0x2718e6[_0x16b333]={'$like':'%'+_0x4a8990[_0xe381('0x45')][_0xe381('0x53')]+'%'};return _0x2718e6;})});}_0x192f52=_[_0xe381('0x51')]({},_0x192f52,_0x4a8990[_0xe381('0x54')]);return db['CannedAnswer'][_0xe381('0x55')]({'where':_0x192f52[_0xe381('0x50')]})[_0xe381('0x23')](function(_0x4e6dfb){_0x369af3[_0xe381('0x55')]=_0x4e6dfb;if(_0x4a8990[_0xe381('0x45')]['includeAll']){_0x192f52[_0xe381('0x5c')]=[{'all':!![]}];}return db[_0xe381('0x72')][_0xe381('0x57')](_0x192f52);})['then'](function(_0x3f7f52){_0x369af3['rows']=_0x3f7f52;return _0x369af3;});}})[_0xe381('0x23')](respondWithFilteredResult(_0x580252,_0x192f52))[_0xe381('0x58')](handleError(_0x580252,null));};exports['removeAnswers']=function(_0x238bae,_0xef598e,_0x1b4785){return db[_0xe381('0x41')]['find']({'where':{'id':_0x238bae['params']['id']}})[_0xe381('0x23')](handleEntityNotFound(_0xef598e,null))['then'](function(_0x201dfe){if(_0x201dfe){return _0x201dfe[_0xe381('0x74')](_0x238bae[_0xe381('0x45')][_0xe381('0x75')]);}})[_0xe381('0x23')](respondWithStatusCode(_0xef598e,null))[_0xe381('0x58')](handleError(_0xef598e,null));};exports[_0xe381('0x76')]=function(_0x2c26af,_0x2dc3db,_0x5d1f3a){var _0x516421={'body':_0x2c26af[_0xe381('0x5f')],'channel':_0xe381('0x77')};var _0x2e8a44=[];var _0x4b62be=[];var _0x10359b={};var _0x3642df=![];return db[_0xe381('0x78')]['describe']()['then'](function(_0x4cea83){if(!_0x4cea83){throw new db[(_0xe381('0x20'))][(_0xe381('0x21'))]('no\x20available\x20attributes');}_0x2e8a44=_[_0xe381('0x79')](_[_0xe381('0x46')](_0x4cea83),[_0xe381('0x7a'),'updatedAt']);_0x4b62be=_['difference'](_[_0xe381('0x46')](_0x4cea83),[_0xe381('0x7a'),_0xe381('0x7b'),_0xe381('0x7c'),_0xe381('0x7d')]);if(_0x2c26af['body']['id']){delete _0x2c26af['body']['id'];}if(_[_0xe381('0x7e')](_0x2c26af[_0xe381('0x5f')][_0xe381('0x7f')])){throw new db['Sequelize'][(_0xe381('0x21'))](_0xe381('0x80'));}if(_[_0xe381('0x7e')](_0x2c26af[_0xe381('0x5f')][_0xe381('0x5f')])||_0x2c26af['body']['body']===''){throw new db[(_0xe381('0x20'))][(_0xe381('0x21'))](_0xe381('0x81'));}if(_[_0xe381('0x7e')](_0x2c26af[_0xe381('0x5f')][_0xe381('0x82')])){throw new db[(_0xe381('0x20'))][(_0xe381('0x21'))](_0xe381('0x83')+_0x4b62be);}if(!_[_0xe381('0x84')](_0x4b62be,_0x2c26af[_0xe381('0x5f')][_0xe381('0x82')])){throw new db[(_0xe381('0x20'))][(_0xe381('0x21'))](_0xe381('0x85')+_0x4b62be);}_0x10359b[_0x2c26af['body'][_0xe381('0x82')]]=_0x2c26af[_0xe381('0x5f')][_0xe381('0x7f')];})['then'](function(){return db['OpenchannelAccount'][_0xe381('0x5d')]({'where':{'id':_0x2c26af[_0xe381('0x5a')]['id']},'include':[{'model':db[_0xe381('0x86')],'as':_0xe381('0x87'),'include':[{'model':db[_0xe381('0x78')],'as':_0xe381('0x88'),'where':_0x10359b,'limit':0x1,'order':[[_0xe381('0x7b'),_0xe381('0x89')]]}]},{'model':db[_0xe381('0x8a')],'as':_0xe381('0x8b')}]});})[_0xe381('0x23')](handleEntityNotFound(_0x2dc3db,null))['then'](function(_0x579654){if(_0x579654&&_0x579654[_0xe381('0x87')]){_0x516421[_0xe381('0x8c')]=_0x579654;_0x516421['applications']=_0x579654[_0xe381('0x8b')];_0x516421[_0xe381('0x8d')]=_0x579654[_0xe381('0x87')];_0x516421[_0xe381('0x8e')]=_[_0xe381('0x8f')](_0x516421[_0xe381('0x8e')],[_0xe381('0x90')],[_0xe381('0x91')]);if(_0x516421[_0xe381('0x8c')][_0xe381('0x8b')]){delete _0x516421[_0xe381('0x8c')][_0xe381('0x8b')];}if(_0x516421[_0xe381('0x8c')][_0xe381('0x87')]&&_0x516421['account'][_0xe381('0x87')][_0xe381('0x88')][_0xe381('0x6e')]){return _0x516421[_0xe381('0x8c')][_0xe381('0x87')][_0xe381('0x88')][0x0];}var _0x2a2ad8=_[_0xe381('0x92')](_0x2c26af[_0xe381('0x5f')],{'firstName':_0x2c26af[_0xe381('0x5f')][_0xe381('0x7f')],'ListId':_0x579654[_0xe381('0x7d')]});_0x2a2ad8[_0x2c26af[_0xe381('0x5f')]['mapKey']]=_0x2c26af[_0xe381('0x5f')][_0xe381('0x7f')];return db[_0xe381('0x78')][_0xe381('0x5e')](_0x2a2ad8,{'fields':_0x2e8a44,'raw':!![]});}})[_0xe381('0x23')](handleEntityNotFound(_0x2dc3db,null))['then'](function(_0xcccce2){_0x516421[_0xe381('0x93')]=_0xcccce2;if(_0xcccce2){var _0x897378={'ContactId':_0xcccce2['id'],'OpenchannelAccountId':_0x2c26af[_0xe381('0x5a')]['id'],'from':(_0xcccce2[_0xe381('0x94')]||'')+'\x20'+(_0xcccce2[_0xe381('0x95')]||'')};var _0x4c0092={'OpenchannelAccountId':_0x2c26af[_0xe381('0x5a')]['id'],'closed':![]};if(_0x2c26af[_0xe381('0x5f')][_0xe381('0x96')]){_0x4c0092[_0xe381('0x96')]=_0x2c26af[_0xe381('0x5f')][_0xe381('0x96')];return db[_0xe381('0x97')]['find']({'where':_0x4c0092})[_0xe381('0x23')](function(_0x183248){if(_0x183248){return[_0x183248,![]];}_0x897378['threadId']=_0x2c26af[_0xe381('0x5f')]['threadId'];_0x897378[_0xe381('0x98')]=_0x2c26af['body'][_0xe381('0x98')];return db[_0xe381('0x97')]['create'](_0x897378)[_0xe381('0x23')](function(_0xe92704){return[_0xe92704,!![]];});});}else{_0x4c0092[_0xe381('0x96')]=null;}_0x4c0092['ContactId']=_0xcccce2['id'];return db[_0xe381('0x97')][_0xe381('0x5d')]({'where':_0x4c0092})[_0xe381('0x23')](function(_0x523115){if(_0x523115){return[_0x523115,![]];}return db[_0xe381('0x97')][_0xe381('0x5e')](_0x897378)[_0xe381('0x23')](function(_0x2a00d0){return[_0x2a00d0,!![]];});});}})[_0xe381('0x99')](function(_0x1d5bbb,_0x1b3b1c){if(_0x1d5bbb){_0x3642df=_0x1b3b1c;if(!_0x1b3b1c){var _0x17dc39={'from':(_0x516421['contact'][_0xe381('0x94')]||'')+'\x20'+(_0x516421[_0xe381('0x93')][_0xe381('0x95')]||'')};if(_0x2c26af[_0xe381('0x5f')][_0xe381('0x96')]&&_0x2c26af[_0xe381('0x5f')]['messageId']&&_0x2c26af['body']['threadId']!=_0x2c26af[_0xe381('0x5f')][_0xe381('0x9a')]){_0x17dc39[_0xe381('0x96')]=_0x2c26af[_0xe381('0x5f')][_0xe381('0x9a')];}return _0x1d5bbb['update'](_0x17dc39);}else{return _0x1d5bbb;}}})[_0xe381('0x23')](function(_0xec982d){_0x516421[_0xe381('0x9b')]=_0xec982d['get']({'plain':!![]});_0x516421[_0xe381('0x9b')][_0xe381('0x9c')]=_0x3642df;if(_0x516421[_0xe381('0x9b')]['created']){if(_0x516421[_0xe381('0x8c')]['autoclose']){_0x516421['applications'][_0xe381('0x9d')]({'id':0x0,'priority':_0x516421['applications'][_0xe381('0x6e')]+0x1,'app':_0xe381('0x9e'),'appdata':_0xe381('0x9f'),'interval':_0xe381('0xa0')});}}return db['OpenchannelMessage'][_0xe381('0x5e')]({'body':_0x2c26af[_0xe381('0x5f')][_0xe381('0x5f')],'OpenchannelAccountId':_0x2c26af['params']['id'],'OpenchannelInteractionId':_0xec982d['id'],'direction':'in','ContactId':_0x516421[_0xe381('0x93')]['id'],'AttachmentId':_0x2c26af[_0xe381('0x5f')][_0xe381('0xa1')]});})[_0xe381('0x23')](function(_0x13760c){_0x516421[_0xe381('0x2c')]=_0x13760c;if(_0x516421[_0xe381('0x9b')]['UserId']){return db[_0xe381('0xa2')]['find']({'attributes':['id',_0xe381('0x3b')],'where':{'id':_0x516421[_0xe381('0x9b')][_0xe381('0xa3')]}})[_0xe381('0x23')](function(_0x144866){if(_0x144866){_0x516421[_0xe381('0x8e')][_0xe381('0xa4')]({'id':0x0,'priority':0x0,'app':_0xe381('0xa5'),'appdata':_0x144866['name']+','+(_0x516421['account'][_0xe381('0xa6')]||0xa),'interval':_0xe381('0xa0')});_0x516421['forcedOwnership']=![];}return respondWithRpcPromise(_0xe381('0xa7'),_0xe381('0xa8'),_0x516421);});}return respondWithRpcPromise(_0xe381('0xa7'),_0xe381('0xa8'),_0x516421);})[_0xe381('0x23')](function(_0x5a6249){respondWithRpcPromise('EventManager',_0xe381('0xa9'),{'event':_0xe381('0x76'),'message':_0x5a6249},client9002);return _0x5a6249;})[_0xe381('0x23')](respondWithResult(_0x2dc3db,null))[_0xe381('0x58')](handleError(_0x2dc3db,null));};exports['addApplications']=function(_0x2a51b7,_0x3142d2,_0x2fc854){return db[_0xe381('0x41')][_0xe381('0x6d')]({'where':{'id':_0x2a51b7[_0xe381('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3142d2,null))[_0xe381('0x23')](function(_0x2a6d78){if(_0x2a6d78){return db[_0xe381('0xaa')][_0xe381('0xab')](function(_0x1dc8dc){return db[_0xe381('0x8a')]['destroy']({'where':{'OpenchannelAccountId':_0x2a51b7[_0xe381('0x5a')]['id']},'transaction':_0x1dc8dc})['then'](function(_0x686a62){var _0x587994=_['map'](_0x2a51b7[_0xe381('0x5f')],function(_0x41ba69){_0x41ba69[_0xe381('0x70')]=_0x2a51b7[_0xe381('0x5a')]['id'];return _0x41ba69;});return db[_0xe381('0x8a')]['bulkCreate'](_0x587994,{'transaction':_0x1dc8dc});});})[_0xe381('0x23')](function(){return db[_0xe381('0x8a')][_0xe381('0xac')]({'where':{'OpenchannelAccountId':_0x2a51b7['params']['id']},'order':'priority'});});}})[_0xe381('0x23')](respondWithResult(_0x3142d2,null))[_0xe381('0x58')](handleError(_0x3142d2,null));};exports[_0xe381('0xad')]=function(_0x21644,_0x1e1457,_0x149bfa){var _0x363ac9={};var _0x27eaf5={};var _0x2c10b2;var _0x440f24;return db[_0xe381('0x41')][_0xe381('0x6d')]({'where':{'id':_0x21644[_0xe381('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1e1457,null))['then'](function(_0x39f542){if(_0x39f542){_0x2c10b2=_0x39f542;_0x27eaf5[_0xe381('0x44')]=_[_0xe381('0x46')](db['OpenchannelApplication'][_0xe381('0x5b')]);_0x27eaf5[_0xe381('0x45')]=_['keys'](_0x21644[_0xe381('0x45')]);_0x27eaf5[_0xe381('0x47')]=_[_0xe381('0x48')](_0x27eaf5[_0xe381('0x44')],_0x27eaf5[_0xe381('0x45')]);_0x363ac9['attributes']=_['intersection'](_0x27eaf5['model'],qs[_0xe381('0x4a')](_0x21644[_0xe381('0x45')][_0xe381('0x4a')]));_0x363ac9[_0xe381('0x49')]=_0x363ac9['attributes'][_0xe381('0x6e')]?_0x363ac9[_0xe381('0x49')]:_0x27eaf5[_0xe381('0x44')];_0x363ac9['order']=qs[_0xe381('0x4f')](_0x21644[_0xe381('0x45')][_0xe381('0x4f')]);_0x363ac9[_0xe381('0x50')]=qs[_0xe381('0x47')](_['pick'](_0x21644[_0xe381('0x45')],_0x27eaf5[_0xe381('0x47')]));if(_0x21644[_0xe381('0x45')][_0xe381('0x53')]){_0x363ac9[_0xe381('0x50')]=_[_0xe381('0x51')](_0x363ac9['where'],{'$or':_['map'](_0x363ac9[_0xe381('0x49')],function(_0x4747e0){var _0x5cf8bc={};_0x5cf8bc[_0x4747e0]={'$like':'%'+_0x21644[_0xe381('0x45')][_0xe381('0x53')]+'%'};return _0x5cf8bc;})});}_0x363ac9=_[_0xe381('0x51')]({},_0x363ac9,_0x21644[_0xe381('0x54')]);return _0x2c10b2[_0xe381('0xad')](_0x363ac9);}})[_0xe381('0x23')](function(_0x136171){if(_0x136171){_0x440f24=_0x136171[_0xe381('0x6e')];if(!_0x21644['query'][_0xe381('0x4b')](_0xe381('0x4c'))){_0x363ac9['limit']=qs[_0xe381('0x4d')](_0x21644[_0xe381('0x45')][_0xe381('0x4d')]);_0x363ac9[_0xe381('0x31')]=qs[_0xe381('0x31')](_0x21644[_0xe381('0x45')][_0xe381('0x31')]);}return _0x2c10b2[_0xe381('0xad')](_0x363ac9);}})['then'](function(_0x4a8974){if(_0x4a8974){return _0x4a8974?{'count':_0x440f24,'rows':_0x4a8974}:null;}})['then'](respondWithResult(_0x1e1457,null))[_0xe381('0x58')](handleError(_0x1e1457,null));};exports[_0xe381('0xae')]=function(_0x23b05,_0xc3829e,_0x12befb){var _0x224231={'raw':![],'where':{}};var _0x5de8d9={};var _0x14213d={'count':0x0,'rows':[]};return db[_0xe381('0x41')]['findOne']({'where':{'id':_0x23b05['params']['id']}})[_0xe381('0x23')](handleEntityNotFound(_0xc3829e,null))['then'](function(_0xf2712f){if(_0xf2712f){_0x5de8d9[_0xe381('0x44')]=_[_0xe381('0x46')](db['OpenchannelInteraction']['rawAttributes']);_0x5de8d9[_0xe381('0x45')]=_[_0xe381('0x46')](_0x23b05[_0xe381('0x45')]);_0x5de8d9[_0xe381('0x47')]=_[_0xe381('0x48')](_0x5de8d9[_0xe381('0x44')],_0x5de8d9[_0xe381('0x45')]);_0x224231['attributes']=_['intersection'](_0x5de8d9[_0xe381('0x44')],qs['fields'](_0x23b05['query'][_0xe381('0x4a')]));_0x224231[_0xe381('0x49')]=_0x224231['attributes'][_0xe381('0x6e')]?_0x224231['attributes']:_0x5de8d9[_0xe381('0x44')];if(!_0x23b05[_0xe381('0x45')]['hasOwnProperty'](_0xe381('0x4c'))){_0x224231['limit']=qs[_0xe381('0x4d')](_0x23b05['query'][_0xe381('0x4d')]);_0x224231['offset']=qs['offset'](_0x23b05[_0xe381('0x45')]['offset']);}_0x224231[_0xe381('0x4e')]=qs[_0xe381('0x4f')](_0x23b05[_0xe381('0x45')][_0xe381('0x4f')]);_0x224231[_0xe381('0x50')]=qs['filters'](_[_0xe381('0x6f')](_0x23b05[_0xe381('0x45')],_0x5de8d9[_0xe381('0x47')]));_0x224231[_0xe381('0x50')][_0xe381('0x70')]=_0xf2712f['id'];if(_0x23b05[_0xe381('0x45')]['filter']){_0x224231[_0xe381('0x50')]=_[_0xe381('0x51')](_0x224231['where'],{'$or':_[_0xe381('0x40')](_0x224231[_0xe381('0x49')],function(_0xcb9539){var _0x354dae={};_0x354dae[_0xcb9539]={'$like':'%'+_0x23b05[_0xe381('0x45')]['filter']+'%'};return _0x354dae;})});}_0x224231=_[_0xe381('0x51')]({},_0x224231,_0x23b05[_0xe381('0x54')]);return db[_0xe381('0x97')][_0xe381('0x55')]({'where':_0x224231[_0xe381('0x50')]})[_0xe381('0x23')](function(_0x16d8bd){_0x14213d[_0xe381('0x55')]=_0x16d8bd;if(_0x23b05[_0xe381('0x45')][_0xe381('0x56')]){_0x224231[_0xe381('0x5c')]=[{'model':db[_0xe381('0x78')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xe381('0xaf'),'attributes':['name',_0xe381('0xb0'),_0xe381('0xb1')],'required':![]},{'model':db[_0xe381('0xb2')],'as':_0xe381('0xb3'),'attributes':['id',_0xe381('0x3b'),_0xe381('0xb4')],'where':_0x23b05[_0xe381('0x45')]['tag']?{'id':_0x23b05[_0xe381('0x45')][_0xe381('0xb5')]}:undefined,'required':_0x23b05[_0xe381('0x45')]['tag']?!![]:![]}];}return db[_0xe381('0x97')][_0xe381('0x57')](_0x224231);})[_0xe381('0x23')](function(_0x41e621){_0x14213d['rows']=_0x41e621;return _0x14213d;});}})['then'](respondWithFilteredResult(_0xc3829e,_0x224231))[_0xe381('0x58')](handleError(_0xc3829e,null));};exports[_0xe381('0xb6')]=function(_0x1dd13b,_0x458cb8,_0x129385){return db[_0xe381('0x41')]['find']({'where':{'id':_0x1dd13b[_0xe381('0x5a')]['id']}})['then'](handleEntityNotFound(_0x458cb8,null))['then'](function(_0x2bc8b6){if(_0x2bc8b6){return _0x2bc8b6[_0xe381('0xb6')](_0x1dd13b[_0xe381('0x5f')]['ids'],_[_0xe381('0xb7')](_0x1dd13b[_0xe381('0x5f')],[_0xe381('0x75'),'id'])||{})[_0xe381('0x99')](function(_0x10178e){for(var _0x15de27=0x0;_0x15de27<_0x1dd13b[_0xe381('0x5f')][_0xe381('0x75')][_0xe381('0x6e')];_0x15de27+=0x1){socket['emit'](_0xe381('0xb8'),{'UserId':_0x1dd13b['body'][_0xe381('0x75')][_0x15de27],'OpenchannelAccountId':_0x1dd13b['params']['id']});}return _0x10178e;});}})[_0xe381('0x23')](respondWithResult(_0x458cb8,null))['catch'](handleError(_0x458cb8,null));};exports[_0xe381('0xb9')]=function(_0x3ba53a,_0x587450,_0x42141){return db[_0xe381('0x41')][_0xe381('0x5d')]({'where':{'id':_0x3ba53a[_0xe381('0x5a')]['id']}})[_0xe381('0x23')](handleEntityNotFound(_0x587450,null))[_0xe381('0x23')](function(_0x40af86){if(_0x40af86){return _0x40af86['removeAgents'](_0x3ba53a[_0xe381('0x45')][_0xe381('0x75')])['then'](function(){if(_[_0xe381('0xba')](_0x3ba53a['query']['ids'])){for(var _0x26e9b3=0x0;_0x26e9b3<_0x3ba53a[_0xe381('0x45')][_0xe381('0x75')]['length'];_0x26e9b3+=0x1){socket[_0xe381('0xbb')](_0xe381('0xbc'),{'UserId':Number(_0x3ba53a[_0xe381('0x45')]['ids'][_0x26e9b3]),'OpenchannelAccountId':Number(_0x3ba53a[_0xe381('0x5a')]['id'])});}}else{socket[_0xe381('0xbb')]('userOpenchannelAccount:remove',{'UserId':Number(_0x3ba53a[_0xe381('0x45')][_0xe381('0x75')]),'OpenchannelAccountId':Number(_0x3ba53a[_0xe381('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x587450,null))[_0xe381('0x58')](handleError(_0x587450,null));};exports[_0xe381('0xbd')]=function(_0x2bada2,_0x4ca5cf,_0x2eb433){var _0x46f12f={};var _0x83dbfc={};var _0x1af299;var _0x147455;return db[_0xe381('0x41')][_0xe381('0x6d')]({'where':{'id':_0x2bada2[_0xe381('0x5a')]['id']}})[_0xe381('0x23')](handleEntityNotFound(_0x4ca5cf,null))['then'](function(_0x540060){if(_0x540060){_0x1af299=_0x540060;_0x83dbfc[_0xe381('0x44')]=_[_0xe381('0x46')](db[_0xe381('0xa2')][_0xe381('0x5b')]);_0x83dbfc[_0xe381('0x45')]=_[_0xe381('0x46')](_0x2bada2[_0xe381('0x45')]);_0x83dbfc[_0xe381('0x47')]=_[_0xe381('0x48')](_0x83dbfc[_0xe381('0x44')],_0x83dbfc['query']);_0x46f12f[_0xe381('0x49')]=_[_0xe381('0x48')](_0x83dbfc[_0xe381('0x44')],qs[_0xe381('0x4a')](_0x2bada2[_0xe381('0x45')][_0xe381('0x4a')]));_0x46f12f[_0xe381('0x49')]=_0x46f12f[_0xe381('0x49')]['length']?_0x46f12f[_0xe381('0x49')]:_0x83dbfc['model'];_0x46f12f[_0xe381('0x4e')]=qs['sort'](_0x2bada2[_0xe381('0x45')][_0xe381('0x4f')]);_0x46f12f['where']=qs[_0xe381('0x47')](_['pick'](_0x2bada2['query'],_0x83dbfc[_0xe381('0x47')]));if(_0x2bada2[_0xe381('0x45')][_0xe381('0x53')]){_0x46f12f[_0xe381('0x50')]=_['merge'](_0x46f12f[_0xe381('0x50')],{'$or':_['map'](_0x46f12f[_0xe381('0x49')],function(_0x377544){var _0x569812={};_0x569812[_0x377544]={'$like':'%'+_0x2bada2[_0xe381('0x45')][_0xe381('0x53')]+'%'};return _0x569812;})});}_0x46f12f=_[_0xe381('0x51')]({},_0x46f12f,_0x2bada2[_0xe381('0x54')]);return _0x1af299[_0xe381('0xbd')](_0x46f12f);}})[_0xe381('0x23')](function(_0x5e2d2d){if(_0x5e2d2d){_0x147455=_0x5e2d2d[_0xe381('0x6e')];if(!_0x2bada2['query'][_0xe381('0x4b')]('nolimit')){_0x46f12f['limit']=qs[_0xe381('0x4d')](_0x2bada2['query'][_0xe381('0x4d')]);_0x46f12f['offset']=qs[_0xe381('0x31')](_0x2bada2[_0xe381('0x45')]['offset']);}return _0x1af299[_0xe381('0xbd')](_0x46f12f);}})[_0xe381('0x23')](function(_0x553fa3){if(_0x553fa3){return _0x553fa3?{'count':_0x147455,'rows':_0x553fa3}:null;}})[_0xe381('0x23')](respondWithResult(_0x4ca5cf,null))['catch'](handleError(_0x4ca5cf,null));};exports[_0xe381('0x3c')]=function(_0x544998,_0x59be9e,_0x5e86c9){var _0x2dcf58,_0x4372dd,_0x4c84c7;if(_[_0xe381('0x7e')](_0x544998[_0xe381('0x5f')][_0xe381('0x5f')])||_0x544998['body']['body']===''){throw new db[(_0xe381('0x20'))][(_0xe381('0x21'))](_0xe381('0x81'));}if(_[_0xe381('0x7e')](_0x544998[_0xe381('0x5f')]['to'])){}_0x2dcf58=_0x544998[_0xe381('0x5f')]['to'];return db[_0xe381('0x41')][_0xe381('0x6d')]({'where':{'id':_0x544998[_0xe381('0x5a')]['id']}})[_0xe381('0x23')](handleEntityNotFound(_0x59be9e,null))[_0xe381('0x23')](function(_0x3bf8a8){if(_0x3bf8a8){return db[_0xe381('0x41')]['find']({'where':{'id':_0x3bf8a8['id']},'include':[{'model':db[_0xe381('0x86')],'as':_0xe381('0x87'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x3bf8a8['mapKey']]:_0x2dcf58},'limit':0x1,'order':[['updatedAt',_0xe381('0x89')]]}]}]})[_0xe381('0x23')](handleEntityNotFound(_0x59be9e,null))['then'](function(_0x503f3b){if(_0x503f3b&&_0x503f3b[_0xe381('0x87')]){_0x4372dd=_0x503f3b[_0xe381('0x38')]({'plain':!![]});if(_0x4372dd[_0xe381('0x87')]&&_0x4372dd[_0xe381('0x87')][_0xe381('0x88')][_0xe381('0x6e')]){return _0x4372dd[_0xe381('0x87')][_0xe381('0x88')][0x0];}return db[_0xe381('0x78')][_0xe381('0x5e')](_[_0xe381('0x92')](_0x544998[_0xe381('0x5f')],{'firstName':_0x2dcf58,[_0x503f3b[_0xe381('0x82')]]:_0x2dcf58,'phone':_0x2dcf58,'ListId':_0x4372dd[_0xe381('0x7d')]}));}})[_0xe381('0x23')](handleEntityNotFound(_0x59be9e,null))[_0xe381('0x23')](function(_0x2c4712){if(_0x2c4712){_0x4c84c7=_0x2c4712;return db['OpenchannelInteraction'][_0xe381('0x5d')]({'where':{'ContactId':_0x4c84c7['id'],'closed':![],'OpenchannelAccountId':_0x4372dd['id']}})[_0xe381('0x23')](function(_0x24f700){if(_0x24f700){return[_0x24f700,![]];}return db[_0xe381('0x97')]['create']({'UserId':_0x544998[_0xe381('0x60')]['id'],'ContactId':_0x4c84c7['id'],'OpenchannelAccountId':_0x4372dd['id'],'lastMsgDirection':_0xe381('0xbe'),'Messages':[_[_0xe381('0x51')](_0x544998['body'],{'read':![],'body':_0x544998['body'][_0xe381('0x5f')],'OpenchannelAccountId':_0x4372dd['id'],'UserId':_0x544998[_0xe381('0x60')]['id'],'ContactId':_0x4c84c7['id']})]},{'include':[{'model':db[_0xe381('0xbf')],'as':_0xe381('0xc0')}]})[_0xe381('0x23')](function(_0x156225){return[_0x156225,!![]];});});}})['spread'](function(_0x50125d,_0x1afd56){if(_0x1afd56){return _0x50125d;}return db[_0xe381('0xbf')][_0xe381('0x5e')](_['merge'](_0x544998[_0xe381('0x5f')],{'read':![],'body':_0x544998[_0xe381('0x5f')][_0xe381('0x5f')],'OpenchannelAccountId':_0x4372dd['id'],'OpenchannelInteractionId':_0x50125d['id'],'UserId':_0x544998[_0xe381('0x60')]['id'],'ContactId':_0x4c84c7['id']}))[_0xe381('0x23')](function(_0x2ab6c4){_0x50125d['dataValues']['Messages']=[];_0x50125d[_0xe381('0xc1')][_0xe381('0xc0')][_0xe381('0x9d')](_0x2ab6c4[_0xe381('0xc1')]);return _0x50125d;});});}})[_0xe381('0x23')](respondWithResult(_0x59be9e,null))[_0xe381('0x58')](handleError(_0x59be9e,null));};
\ No newline at end of file
+var _0x3f66=['offset','limit','set','apply','reject','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','OpenchannelAccount','count','includeAll','include','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','OpenchannelAccountId','removeDispositions','ids','CannedAnswer','getAnswers','findOne','findAll','notify','openchannel','no\x20available\x20attributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','applications','Applications','list','orderBy','priority','asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','User','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','send','out','dataValues','Messages','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','jayson/promise','client','http','test','Sequelize','ValidationError','then','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelAccount,\x20%s,\x20%s','info','catch','status','end','json'];(function(_0x4f795a,_0x5e2571){var _0x3e447b=function(_0x43657a){while(--_0x43657a){_0x4f795a['push'](_0x4f795a['shift']());}};_0x3e447b(++_0x5e2571);}(_0x3f66,0x8b));var _0x63f6=function(_0x4401d2,_0x4fd983){_0x4401d2=_0x4401d2-0x0;var _0x27026b=_0x3f66[_0x4401d2];return _0x27026b;};'use strict';var pdf=require(_0x63f6('0x0'));var emlformat=require(_0x63f6('0x1'));var rimraf=require(_0x63f6('0x2'));var zipdir=require(_0x63f6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x63f6('0x4'));var moment=require(_0x63f6('0x5'));var BPromise=require(_0x63f6('0x6'));var Mustache=require(_0x63f6('0x7'));var util=require(_0x63f6('0x8'));var path=require(_0x63f6('0x9'));var sox=require('sox');var csv=require(_0x63f6('0xa'));var ejs=require(_0x63f6('0xb'));var fs=require('fs');var _=require(_0x63f6('0xc'));var squel=require(_0x63f6('0xd'));var crypto=require('crypto');var jsforce=require(_0x63f6('0xe'));var deskjs=require(_0x63f6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x63f6('0x10'));var Papa=require('papaparse');var Redis=require(_0x63f6('0x11'));var authService=require(_0x63f6('0x12'));var qs=require(_0x63f6('0x13'));var as=require(_0x63f6('0x14'));var hardwareService=require(_0x63f6('0x15'));var logger=require('../../config/logger')(_0x63f6('0x16'));var utils=require(_0x63f6('0x17'));var config=require(_0x63f6('0x18'));var db=require(_0x63f6('0x19'))['db'];config[_0x63f6('0x1a')]=_[_0x63f6('0x1b')](config[_0x63f6('0x1a')],{'host':_0x63f6('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x63f6('0x1d'))['register'](socket);var jayson=require(_0x63f6('0x1e'));var client=jayson[_0x63f6('0x1f')][_0x63f6('0x20')]({'port':0x232c});var client9002=jayson[_0x63f6('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x164cb2,_0x2e863e,_0x151632){if(_0x151632){var _0x118f94=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x118f94[_0x63f6('0x21')](_0x2e863e)){return _0x164cb2;}else{throw new db[(_0x63f6('0x22'))][(_0x63f6('0x23'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x164cb2;}}function respondWithRpcPromise(_0x395108,_0x2b78c8,_0x1c69ad,_0x187a0c){return new BPromise(function(_0x3aec5b,_0x3189e0){var _0x19e1d9=_0x187a0c||client;return _0x19e1d9['request'](_0x395108,_0x1c69ad)[_0x63f6('0x24')](function(_0x730e9d){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2b78c8,_0x63f6('0x25'));logger['debug'](_0x63f6('0x26'),_0x2b78c8,_0x63f6('0x25'),JSON[_0x63f6('0x27')](_0x730e9d));if(_0x730e9d['error']){if(_0x730e9d[_0x63f6('0x28')][_0x63f6('0x29')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2b78c8,_0x730e9d[_0x63f6('0x28')]['message']);return _0x3189e0(_0x730e9d[_0x63f6('0x28')][_0x63f6('0x2a')]);}logger['error'](_0x63f6('0x2b'),_0x2b78c8,_0x730e9d[_0x63f6('0x28')][_0x63f6('0x2a')]);return _0x3aec5b(_0x730e9d[_0x63f6('0x28')][_0x63f6('0x2a')]);}else{logger[_0x63f6('0x2c')](_0x63f6('0x2b'),_0x2b78c8,_0x63f6('0x25'));_0x3aec5b(_0x730e9d['result']['message']);}})[_0x63f6('0x2d')](function(_0x298352){logger[_0x63f6('0x28')](_0x63f6('0x2b'),_0x2b78c8,_0x298352);_0x3189e0(_0x298352);});});}function respondWithStatusCode(_0xd24642,_0x486c1f){_0x486c1f=_0x486c1f||0xcc;return function(_0x15c158){if(_0x15c158){return _0xd24642['sendStatus'](_0x486c1f);}return _0xd24642[_0x63f6('0x2e')](_0x486c1f)[_0x63f6('0x2f')]();};}function respondWithResult(_0x199198,_0x198b30){_0x198b30=_0x198b30||0xc8;return function(_0x17d138){if(_0x17d138){return _0x199198[_0x63f6('0x2e')](_0x198b30)[_0x63f6('0x30')](_0x17d138);}};}function respondWithFilteredResult(_0x47b679,_0x394cd1){return function(_0x39933b){if(_0x39933b){var _0x35e06c=_0x39933b['count'],_0x129b2a=_0x394cd1[_0x63f6('0x31')],_0x514541=_0x394cd1[_0x63f6('0x31')]+_0x394cd1[_0x63f6('0x32')],_0x11e049;if(_0x514541>=_0x35e06c){_0x514541=_0x35e06c;_0x11e049=0xc8;}else{_0x11e049=0xce;}_0x47b679[_0x63f6('0x2e')](_0x11e049);return _0x47b679[_0x63f6('0x33')]('Content-Range',_0x129b2a+'-'+_0x514541+'/'+_0x35e06c)[_0x63f6('0x30')](_0x39933b);}return null;};}function patchUpdates(_0x32574b){return function(_0x2a6823){try{jsonpatch[_0x63f6('0x34')](_0x2a6823,_0x32574b,!![]);}catch(_0x311cfc){return BPromise[_0x63f6('0x35')](_0x311cfc);}return _0x2a6823['save']();};}function saveUpdates(_0x56ed24,_0x23f09e){return function(_0x277388){if(_0x277388){return _0x277388[_0x63f6('0x36')](_0x56ed24)[_0x63f6('0x24')](function(_0x417262){return _0x417262;});}return null;};}function removeEntity(_0x259bbe,_0x5b4c8e){return function(_0x36107d){if(_0x36107d){return _0x36107d[_0x63f6('0x37')]()['then'](function(){var _0x3fc4b9=_0x36107d[_0x63f6('0x38')]({'plain':!![]});var _0x28a892=_0x63f6('0x39');return db[_0x63f6('0x3a')]['destroy']({'where':{'type':_0x28a892,'resourceId':_0x3fc4b9['id']}})['then'](function(){return _0x36107d;});})[_0x63f6('0x24')](function(){_0x259bbe[_0x63f6('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x483519,_0xa79632){return function(_0x1e43fc){if(!_0x1e43fc){_0x483519[_0x63f6('0x3b')](0x194);}return _0x1e43fc;};}function handleError(_0x51e857,_0x5211d2){_0x5211d2=_0x5211d2||0x1f4;return function(_0xb00d3c){logger[_0x63f6('0x28')](_0xb00d3c[_0x63f6('0x3c')]);if(_0xb00d3c[_0x63f6('0x3d')]){delete _0xb00d3c[_0x63f6('0x3d')];}_0x51e857[_0x63f6('0x2e')](_0x5211d2)['send'](_0xb00d3c);};}exports[_0x63f6('0x3e')]=function(_0xce95e2,_0x491f2c){var _0x3a5e7a={'include':[{'model':db[_0x63f6('0x3f')],'as':_0x63f6('0x40')}]},_0xc42c0d={},_0x36a41d={'count':0x0,'rows':[]};var _0x34e82a=_[_0x63f6('0x41')](db['OpenchannelAccount'][_0x63f6('0x42')],function(_0x5c7f33){return{'name':_0x5c7f33[_0x63f6('0x43')],'type':_0x5c7f33[_0x63f6('0x44')][_0x63f6('0x45')]};});_0xc42c0d[_0x63f6('0x46')]=_[_0x63f6('0x41')](_0x34e82a,_0x63f6('0x3d'));_0xc42c0d['query']=_[_0x63f6('0x47')](_0xce95e2[_0x63f6('0x48')]);_0xc42c0d[_0x63f6('0x49')]=_['intersection'](_0xc42c0d[_0x63f6('0x46')],_0xc42c0d['query']);_0x3a5e7a['attributes']=_[_0x63f6('0x4a')](_0xc42c0d[_0x63f6('0x46')],qs[_0x63f6('0x4b')](_0xce95e2['query'][_0x63f6('0x4b')]));_0x3a5e7a['attributes']=_0x3a5e7a[_0x63f6('0x4c')][_0x63f6('0x4d')]?_0x3a5e7a[_0x63f6('0x4c')]:_0xc42c0d[_0x63f6('0x46')];if(!_0xce95e2[_0x63f6('0x48')][_0x63f6('0x4e')](_0x63f6('0x4f'))){_0x3a5e7a['limit']=qs['limit'](_0xce95e2[_0x63f6('0x48')][_0x63f6('0x32')]);_0x3a5e7a['offset']=qs['offset'](_0xce95e2[_0x63f6('0x48')][_0x63f6('0x31')]);}_0x3a5e7a[_0x63f6('0x50')]=qs[_0x63f6('0x51')](_0xce95e2[_0x63f6('0x48')][_0x63f6('0x51')]);_0x3a5e7a['where']=qs['filters'](_[_0x63f6('0x52')](_0xce95e2[_0x63f6('0x48')],_0xc42c0d[_0x63f6('0x49')]),_0x34e82a);if(_0xce95e2[_0x63f6('0x48')][_0x63f6('0x53')]){_0x3a5e7a[_0x63f6('0x54')]=_[_0x63f6('0x55')](_0x3a5e7a[_0x63f6('0x54')],{'$or':_[_0x63f6('0x41')](_0x34e82a,function(_0x46ef13){if(_0x46ef13[_0x63f6('0x44')]!==_0x63f6('0x56')){var _0x2e8918={};_0x2e8918[_0x46ef13[_0x63f6('0x3d')]]={'$like':'%'+_0xce95e2[_0x63f6('0x48')][_0x63f6('0x53')]+'%'};return _0x2e8918;}})});}_0x3a5e7a=_['merge']({},_0x3a5e7a,_0xce95e2[_0x63f6('0x57')]);var _0x5bf3cb={'where':_0x3a5e7a[_0x63f6('0x54')]};return db[_0x63f6('0x58')][_0x63f6('0x59')](_0x5bf3cb)[_0x63f6('0x24')](function(_0x1fcd22){_0x36a41d[_0x63f6('0x59')]=_0x1fcd22;if(_0xce95e2[_0x63f6('0x48')][_0x63f6('0x5a')]){_0x3a5e7a[_0x63f6('0x5b')]=[{'all':!![]}];}return db[_0x63f6('0x58')]['findAll'](_0x3a5e7a);})[_0x63f6('0x24')](function(_0x5bc51f){_0x36a41d[_0x63f6('0x5c')]=_0x5bc51f;return _0x36a41d;})[_0x63f6('0x24')](respondWithFilteredResult(_0x491f2c,_0x3a5e7a))[_0x63f6('0x2d')](handleError(_0x491f2c,null));};exports[_0x63f6('0x5d')]=function(_0x2ed06f,_0x13df2d){var _0x1bffd5={'raw':![],'where':{'id':_0x2ed06f[_0x63f6('0x5e')]['id']},'include':[{'model':db[_0x63f6('0x3f')],'as':'mandatoryDispositionPause'}]},_0x593b2a={};_0x593b2a[_0x63f6('0x46')]=_[_0x63f6('0x47')](db[_0x63f6('0x58')][_0x63f6('0x42')]);_0x593b2a['query']=_['keys'](_0x2ed06f[_0x63f6('0x48')]);_0x593b2a[_0x63f6('0x49')]=_['intersection'](_0x593b2a[_0x63f6('0x46')],_0x593b2a[_0x63f6('0x48')]);_0x1bffd5['attributes']=_[_0x63f6('0x4a')](_0x593b2a[_0x63f6('0x46')],qs[_0x63f6('0x4b')](_0x2ed06f[_0x63f6('0x48')][_0x63f6('0x4b')]));_0x1bffd5['attributes']=_0x1bffd5['attributes'][_0x63f6('0x4d')]?_0x1bffd5[_0x63f6('0x4c')]:_0x593b2a['model'];if(_0x2ed06f[_0x63f6('0x48')][_0x63f6('0x5a')]){_0x1bffd5[_0x63f6('0x5b')]=[{'all':!![]}];}_0x1bffd5=_[_0x63f6('0x55')]({},_0x1bffd5,_0x2ed06f['options']);return db[_0x63f6('0x58')][_0x63f6('0x5f')](_0x1bffd5)['then'](handleEntityNotFound(_0x13df2d,null))[_0x63f6('0x24')](respondWithResult(_0x13df2d,null))[_0x63f6('0x2d')](handleError(_0x13df2d,null));};exports[_0x63f6('0x60')]=function(_0x1ccbbb,_0x46c243){return db[_0x63f6('0x58')][_0x63f6('0x60')](_0x1ccbbb[_0x63f6('0x61')],{})[_0x63f6('0x24')](function(_0x2b7564){var _0x10ce6e=_0x1ccbbb[_0x63f6('0x62')]['get']({'plain':!![]});if(!_0x10ce6e)throw new Error(_0x63f6('0x63'));if(_0x10ce6e[_0x63f6('0x64')]===_0x63f6('0x62')){var _0x337479=_0x2b7564[_0x63f6('0x38')]({'plain':!![]});var _0x497924='OpenchannelAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x497924,'userProfileId':_0x10ce6e[_0x63f6('0x65')]},'raw':!![]})[_0x63f6('0x24')](function(_0x36455e){if(_0x36455e&&_0x36455e[_0x63f6('0x66')]===0x0){return db[_0x63f6('0x3a')][_0x63f6('0x60')]({'name':_0x337479[_0x63f6('0x3d')],'resourceId':_0x337479['id'],'type':_0x36455e[_0x63f6('0x3d')],'sectionId':_0x36455e['id']},{})[_0x63f6('0x24')](function(){return _0x2b7564;});}else{return _0x2b7564;}})[_0x63f6('0x2d')](function(_0x23671d){logger['error'](_0x63f6('0x67'),_0x23671d);throw _0x23671d;});}return _0x2b7564;})[_0x63f6('0x24')](respondWithResult(_0x46c243,0xc9))[_0x63f6('0x2d')](handleError(_0x46c243,null));};exports['update']=function(_0x3d779a,_0x202220){if(_0x3d779a[_0x63f6('0x61')]['id']){delete _0x3d779a[_0x63f6('0x61')]['id'];}return db[_0x63f6('0x58')]['find']({'where':{'id':_0x3d779a[_0x63f6('0x5e')]['id']},'include':[{'model':db[_0x63f6('0x3f')],'as':_0x63f6('0x40')}]})[_0x63f6('0x24')](handleEntityNotFound(_0x202220,null))[_0x63f6('0x24')](saveUpdates(_0x3d779a[_0x63f6('0x61')],null))[_0x63f6('0x24')](respondWithResult(_0x202220,null))[_0x63f6('0x2d')](handleError(_0x202220,null));};exports[_0x63f6('0x37')]=function(_0x5de637,_0x38c616){return db[_0x63f6('0x58')][_0x63f6('0x5f')]({'where':{'id':_0x5de637[_0x63f6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x38c616,null))['then'](removeEntity(_0x38c616,null))['catch'](handleError(_0x38c616,null));};exports[_0x63f6('0x68')]=function(_0x41b570,_0x412a9f){return db[_0x63f6('0x58')][_0x63f6('0x68')]()[_0x63f6('0x24')](respondWithResult(_0x412a9f,null))[_0x63f6('0x2d')](handleError(_0x412a9f,null));};exports[_0x63f6('0x69')]=function(_0x3500b4,_0x54e844,_0xe5e234){if(_0x3500b4[_0x63f6('0x61')]['id']){delete _0x3500b4[_0x63f6('0x61')]['id'];}return db[_0x63f6('0x58')][_0x63f6('0x5f')]({'where':{'id':_0x3500b4['params']['id']}})['then'](handleEntityNotFound(_0x54e844,null))['then'](function(_0x1ef961){if(_0x1ef961){_0x3500b4[_0x63f6('0x61')]['OpnechannelAccountId']=_0x1ef961['id'];return db[_0x63f6('0x6a')][_0x63f6('0x60')](_0x3500b4['body']);}})[_0x63f6('0x24')](respondWithResult(_0x54e844,null))['catch'](handleError(_0x54e844,null));};exports[_0x63f6('0x6b')]=function(_0x19cbcf,_0x2cf2a7,_0x19e9cb){var _0xf910c3={'raw':![],'where':{}};var _0x56ddd7={};var _0x1549fa={'count':0x0,'rows':[]};return db[_0x63f6('0x58')]['findOne']({'where':{'id':_0x19cbcf[_0x63f6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2cf2a7,null))[_0x63f6('0x24')](function(_0x1005ba){if(_0x1005ba){_0x56ddd7['model']=_['keys'](db[_0x63f6('0x6a')]['rawAttributes']);_0x56ddd7['query']=_[_0x63f6('0x47')](_0x19cbcf['query']);_0x56ddd7['filters']=_[_0x63f6('0x4a')](_0x56ddd7['model'],_0x56ddd7[_0x63f6('0x48')]);_0xf910c3['attributes']=_[_0x63f6('0x4a')](_0x56ddd7[_0x63f6('0x46')],qs[_0x63f6('0x4b')](_0x19cbcf[_0x63f6('0x48')][_0x63f6('0x4b')]));_0xf910c3['attributes']=_0xf910c3[_0x63f6('0x4c')]['length']?_0xf910c3[_0x63f6('0x4c')]:_0x56ddd7['model'];if(!_0x19cbcf[_0x63f6('0x48')][_0x63f6('0x4e')](_0x63f6('0x4f'))){_0xf910c3[_0x63f6('0x32')]=qs[_0x63f6('0x32')](_0x19cbcf[_0x63f6('0x48')][_0x63f6('0x32')]);_0xf910c3['offset']=qs[_0x63f6('0x31')](_0x19cbcf[_0x63f6('0x48')][_0x63f6('0x31')]);}_0xf910c3[_0x63f6('0x50')]=qs['sort'](_0x19cbcf['query'][_0x63f6('0x51')]);_0xf910c3[_0x63f6('0x54')]=qs[_0x63f6('0x49')](_[_0x63f6('0x52')](_0x19cbcf[_0x63f6('0x48')],_0x56ddd7[_0x63f6('0x49')]));_0xf910c3['where'][_0x63f6('0x6c')]=_0x1005ba['id'];if(_0x19cbcf['query'][_0x63f6('0x53')]){_0xf910c3[_0x63f6('0x54')]=_['merge'](_0xf910c3[_0x63f6('0x54')],{'$or':_[_0x63f6('0x41')](_0xf910c3[_0x63f6('0x4c')],function(_0x2c22ac){var _0x558287={};_0x558287[_0x2c22ac]={'$like':'%'+_0x19cbcf[_0x63f6('0x48')][_0x63f6('0x53')]+'%'};return _0x558287;})});}_0xf910c3=_[_0x63f6('0x55')]({},_0xf910c3,_0x19cbcf[_0x63f6('0x57')]);return db['Disposition'][_0x63f6('0x59')]({'where':_0xf910c3[_0x63f6('0x54')]})[_0x63f6('0x24')](function(_0x19fc97){_0x1549fa[_0x63f6('0x59')]=_0x19fc97;if(_0x19cbcf[_0x63f6('0x48')][_0x63f6('0x5a')]){_0xf910c3[_0x63f6('0x5b')]=[{'all':!![]}];}return db[_0x63f6('0x6a')]['findAll'](_0xf910c3);})[_0x63f6('0x24')](function(_0x3d4cfe){_0x1549fa[_0x63f6('0x5c')]=_0x3d4cfe;return _0x1549fa;});}})['then'](respondWithFilteredResult(_0x2cf2a7,_0xf910c3))['catch'](handleError(_0x2cf2a7,null));};exports['removeDispositions']=function(_0x5e0678,_0x2f60db,_0x57a8a8){return db[_0x63f6('0x58')]['find']({'where':{'id':_0x5e0678[_0x63f6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2f60db,null))[_0x63f6('0x24')](function(_0x5882b4){if(_0x5882b4){return _0x5882b4[_0x63f6('0x6d')](_0x5e0678[_0x63f6('0x48')][_0x63f6('0x6e')]);}})['then'](respondWithStatusCode(_0x2f60db,null))[_0x63f6('0x2d')](handleError(_0x2f60db,null));};exports['addAnswer']=function(_0x42e32d,_0xe320a8,_0x1c4c05){if(_0x42e32d[_0x63f6('0x61')]['id']){delete _0x42e32d[_0x63f6('0x61')]['id'];}return db[_0x63f6('0x58')]['find']({'where':{'id':_0x42e32d[_0x63f6('0x5e')]['id']}})[_0x63f6('0x24')](handleEntityNotFound(_0xe320a8,null))[_0x63f6('0x24')](function(_0x35c8a6){if(_0x35c8a6){_0x42e32d[_0x63f6('0x61')][_0x63f6('0x6c')]=_0x35c8a6['id'];return db[_0x63f6('0x6f')][_0x63f6('0x60')](_0x42e32d[_0x63f6('0x61')]);}})[_0x63f6('0x24')](respondWithResult(_0xe320a8,null))[_0x63f6('0x2d')](handleError(_0xe320a8,null));};exports[_0x63f6('0x70')]=function(_0x183a73,_0x2cfb1b,_0x39e0c7){var _0x525263={'raw':![],'where':{}};var _0x5449e7={};var _0xfc499d={'count':0x0,'rows':[]};return db[_0x63f6('0x58')][_0x63f6('0x71')]({'where':{'id':_0x183a73[_0x63f6('0x5e')]['id']}})[_0x63f6('0x24')](handleEntityNotFound(_0x2cfb1b,null))['then'](function(_0x4ceb23){if(_0x4ceb23){_0x5449e7['model']=_['keys'](db[_0x63f6('0x6f')][_0x63f6('0x42')]);_0x5449e7['query']=_[_0x63f6('0x47')](_0x183a73[_0x63f6('0x48')]);_0x5449e7[_0x63f6('0x49')]=_[_0x63f6('0x4a')](_0x5449e7[_0x63f6('0x46')],_0x5449e7[_0x63f6('0x48')]);_0x525263[_0x63f6('0x4c')]=_['intersection'](_0x5449e7[_0x63f6('0x46')],qs[_0x63f6('0x4b')](_0x183a73[_0x63f6('0x48')][_0x63f6('0x4b')]));_0x525263['attributes']=_0x525263['attributes'][_0x63f6('0x4d')]?_0x525263[_0x63f6('0x4c')]:_0x5449e7['model'];if(!_0x183a73['query'][_0x63f6('0x4e')](_0x63f6('0x4f'))){_0x525263[_0x63f6('0x32')]=qs[_0x63f6('0x32')](_0x183a73[_0x63f6('0x48')]['limit']);_0x525263[_0x63f6('0x31')]=qs['offset'](_0x183a73['query'][_0x63f6('0x31')]);}_0x525263[_0x63f6('0x50')]=qs[_0x63f6('0x51')](_0x183a73[_0x63f6('0x48')][_0x63f6('0x51')]);_0x525263['where']=qs['filters'](_[_0x63f6('0x52')](_0x183a73[_0x63f6('0x48')],_0x5449e7['filters']));_0x525263[_0x63f6('0x54')][_0x63f6('0x6c')]=_0x4ceb23['id'];if(_0x183a73[_0x63f6('0x48')][_0x63f6('0x53')]){_0x525263[_0x63f6('0x54')]=_[_0x63f6('0x55')](_0x525263[_0x63f6('0x54')],{'$or':_[_0x63f6('0x41')](_0x525263[_0x63f6('0x4c')],function(_0x50a3d7){var _0x746a23={};_0x746a23[_0x50a3d7]={'$like':'%'+_0x183a73[_0x63f6('0x48')]['filter']+'%'};return _0x746a23;})});}_0x525263=_[_0x63f6('0x55')]({},_0x525263,_0x183a73[_0x63f6('0x57')]);return db[_0x63f6('0x6f')][_0x63f6('0x59')]({'where':_0x525263['where']})[_0x63f6('0x24')](function(_0x3aad2d){_0xfc499d[_0x63f6('0x59')]=_0x3aad2d;if(_0x183a73[_0x63f6('0x48')][_0x63f6('0x5a')]){_0x525263[_0x63f6('0x5b')]=[{'all':!![]}];}return db[_0x63f6('0x6f')][_0x63f6('0x72')](_0x525263);})['then'](function(_0x55d690){_0xfc499d[_0x63f6('0x5c')]=_0x55d690;return _0xfc499d;});}})[_0x63f6('0x24')](respondWithFilteredResult(_0x2cfb1b,_0x525263))[_0x63f6('0x2d')](handleError(_0x2cfb1b,null));};exports['removeAnswers']=function(_0x16112f,_0x5c0474,_0x4e2afe){return db[_0x63f6('0x58')][_0x63f6('0x5f')]({'where':{'id':_0x16112f[_0x63f6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5c0474,null))['then'](function(_0x45aff4){if(_0x45aff4){return _0x45aff4['removeAnswers'](_0x16112f['query']['ids']);}})['then'](respondWithStatusCode(_0x5c0474,null))[_0x63f6('0x2d')](handleError(_0x5c0474,null));};exports[_0x63f6('0x73')]=function(_0x29cd6b,_0x3247cc,_0x59779d){var _0x2df3bd={'body':_0x29cd6b[_0x63f6('0x61')],'channel':_0x63f6('0x74')};var _0x5a8b3d=[];var _0x51c745=[];var _0x56d496={};var _0x502ec1=![];return db['CmContact'][_0x63f6('0x68')]()[_0x63f6('0x24')](function(_0x344b7b){if(!_0x344b7b){throw new db[(_0x63f6('0x22'))][(_0x63f6('0x23'))](_0x63f6('0x75'));}_0x5a8b3d=_['difference'](_[_0x63f6('0x47')](_0x344b7b),[_0x63f6('0x76'),'updatedAt']);_0x51c745=_['difference'](_['keys'](_0x344b7b),[_0x63f6('0x76'),_0x63f6('0x77'),'CompanyId',_0x63f6('0x78')]);if(_0x29cd6b[_0x63f6('0x61')]['id']){delete _0x29cd6b['body']['id'];}if(_[_0x63f6('0x79')](_0x29cd6b['body'][_0x63f6('0x7a')])){throw new db[(_0x63f6('0x22'))][(_0x63f6('0x23'))](_0x63f6('0x7b'));}if(_['isNil'](_0x29cd6b[_0x63f6('0x61')][_0x63f6('0x61')])||_0x29cd6b[_0x63f6('0x61')][_0x63f6('0x61')]===''){throw new db['Sequelize'][(_0x63f6('0x23'))](_0x63f6('0x7c'));}if(_[_0x63f6('0x79')](_0x29cd6b['body'][_0x63f6('0x7d')])){throw new db[(_0x63f6('0x22'))][(_0x63f6('0x23'))](_0x63f6('0x7e')+_0x51c745);}if(!_[_0x63f6('0x7f')](_0x51c745,_0x29cd6b['body'][_0x63f6('0x7d')])){throw new db['Sequelize'][(_0x63f6('0x23'))](_0x63f6('0x80')+_0x51c745);}_0x56d496[_0x29cd6b[_0x63f6('0x61')][_0x63f6('0x7d')]]=_0x29cd6b[_0x63f6('0x61')][_0x63f6('0x7a')];})[_0x63f6('0x24')](function(){return db[_0x63f6('0x58')][_0x63f6('0x5f')]({'where':{'id':_0x29cd6b[_0x63f6('0x5e')]['id']},'include':[{'model':db[_0x63f6('0x81')],'as':_0x63f6('0x82'),'include':[{'model':db[_0x63f6('0x83')],'as':_0x63f6('0x84'),'where':_0x56d496,'limit':0x1,'order':[['updatedAt',_0x63f6('0x85')]]}]},{'model':db[_0x63f6('0x86')],'as':'Applications'}]});})[_0x63f6('0x24')](handleEntityNotFound(_0x3247cc,null))[_0x63f6('0x24')](function(_0x2b5fd2){if(_0x2b5fd2&&_0x2b5fd2[_0x63f6('0x82')]){_0x2df3bd['account']=_0x2b5fd2;_0x2df3bd[_0x63f6('0x87')]=_0x2b5fd2[_0x63f6('0x88')];_0x2df3bd[_0x63f6('0x89')]=_0x2b5fd2[_0x63f6('0x82')];_0x2df3bd[_0x63f6('0x87')]=_[_0x63f6('0x8a')](_0x2df3bd[_0x63f6('0x87')],[_0x63f6('0x8b')],[_0x63f6('0x8c')]);if(_0x2df3bd[_0x63f6('0x8d')][_0x63f6('0x88')]){delete _0x2df3bd['account'][_0x63f6('0x88')];}if(_0x2df3bd[_0x63f6('0x8d')][_0x63f6('0x82')]&&_0x2df3bd[_0x63f6('0x8d')][_0x63f6('0x82')][_0x63f6('0x84')]['length']){return _0x2df3bd[_0x63f6('0x8d')][_0x63f6('0x82')][_0x63f6('0x84')][0x0];}var _0x4224b6=_[_0x63f6('0x1b')](_0x29cd6b[_0x63f6('0x61')],{'firstName':_0x29cd6b['body']['from'],'ListId':_0x2b5fd2[_0x63f6('0x78')]});_0x4224b6[_0x29cd6b[_0x63f6('0x61')][_0x63f6('0x7d')]]=_0x29cd6b['body'][_0x63f6('0x7a')];return db['CmContact'][_0x63f6('0x60')](_0x4224b6,{'fields':_0x5a8b3d,'raw':!![]});}})[_0x63f6('0x24')](handleEntityNotFound(_0x3247cc,null))['then'](function(_0x109cf7){_0x2df3bd[_0x63f6('0x8e')]=_0x109cf7;if(_0x109cf7){var _0xd178bb={'ContactId':_0x109cf7['id'],'OpenchannelAccountId':_0x29cd6b['params']['id'],'from':(_0x109cf7[_0x63f6('0x8f')]||'')+'\x20'+(_0x109cf7[_0x63f6('0x90')]||'')};var _0x1e419e={'OpenchannelAccountId':_0x29cd6b[_0x63f6('0x5e')]['id'],'closed':![]};if(_0x29cd6b['body'][_0x63f6('0x91')]){_0x1e419e[_0x63f6('0x91')]=_0x29cd6b[_0x63f6('0x61')][_0x63f6('0x91')];return db[_0x63f6('0x92')][_0x63f6('0x5f')]({'where':_0x1e419e})['then'](function(_0xa47a34){if(_0xa47a34){return[_0xa47a34,![]];}_0xd178bb[_0x63f6('0x91')]=_0x29cd6b['body'][_0x63f6('0x91')];_0xd178bb[_0x63f6('0x93')]=_0x29cd6b[_0x63f6('0x61')]['externalUrl'];return db[_0x63f6('0x92')][_0x63f6('0x60')](_0xd178bb)['then'](function(_0x1928ce){return[_0x1928ce,!![]];});});}else{_0x1e419e[_0x63f6('0x91')]=null;}_0x1e419e[_0x63f6('0x94')]=_0x109cf7['id'];return db[_0x63f6('0x92')][_0x63f6('0x5f')]({'where':_0x1e419e})[_0x63f6('0x24')](function(_0x117e19){if(_0x117e19){return[_0x117e19,![]];}return db[_0x63f6('0x92')][_0x63f6('0x60')](_0xd178bb)['then'](function(_0x30bd92){return[_0x30bd92,!![]];});});}})[_0x63f6('0x95')](function(_0x23a4f2,_0x1f9d90){if(_0x23a4f2){_0x502ec1=_0x1f9d90;if(!_0x1f9d90){var _0x443be3={'from':(_0x2df3bd[_0x63f6('0x8e')]['firstName']||'')+'\x20'+(_0x2df3bd[_0x63f6('0x8e')]['lastName']||'')};if(_0x29cd6b['body'][_0x63f6('0x91')]&&_0x29cd6b[_0x63f6('0x61')]['messageId']&&_0x29cd6b[_0x63f6('0x61')][_0x63f6('0x91')]!=_0x29cd6b['body'][_0x63f6('0x96')]){_0x443be3[_0x63f6('0x91')]=_0x29cd6b[_0x63f6('0x61')][_0x63f6('0x96')];}return _0x23a4f2[_0x63f6('0x36')](_0x443be3);}else{return _0x23a4f2;}}})[_0x63f6('0x24')](function(_0x24f499){_0x2df3bd[_0x63f6('0x97')]=_0x24f499['get']({'plain':!![]});_0x2df3bd[_0x63f6('0x97')][_0x63f6('0x98')]=_0x502ec1;if(_0x2df3bd[_0x63f6('0x97')][_0x63f6('0x98')]){if(_0x2df3bd[_0x63f6('0x8d')]['autoclose']){_0x2df3bd[_0x63f6('0x87')][_0x63f6('0x99')]({'id':0x0,'priority':_0x2df3bd[_0x63f6('0x87')][_0x63f6('0x4d')]+0x1,'app':_0x63f6('0x9a'),'appdata':_0x63f6('0x9b'),'interval':_0x63f6('0x9c')});}}return db[_0x63f6('0x9d')]['create']({'body':_0x29cd6b[_0x63f6('0x61')][_0x63f6('0x61')],'OpenchannelAccountId':_0x29cd6b[_0x63f6('0x5e')]['id'],'OpenchannelInteractionId':_0x24f499['id'],'direction':'in','ContactId':_0x2df3bd[_0x63f6('0x8e')]['id'],'AttachmentId':_0x29cd6b['body']['AttachmentId']});})['then'](function(_0x430f5c){_0x2df3bd[_0x63f6('0x2a')]=_0x430f5c;if(_0x2df3bd[_0x63f6('0x97')]['UserId']){return db[_0x63f6('0x9e')][_0x63f6('0x5f')]({'attributes':['id',_0x63f6('0x3d')],'where':{'id':_0x2df3bd['interaction'][_0x63f6('0x9f')]}})[_0x63f6('0x24')](function(_0x119a4a){if(_0x119a4a){_0x2df3bd[_0x63f6('0x87')][_0x63f6('0xa0')]({'id':0x0,'priority':0x0,'app':_0x63f6('0xa1'),'appdata':_0x119a4a[_0x63f6('0x3d')]+','+(_0x2df3bd[_0x63f6('0x8d')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x2df3bd[_0x63f6('0xa2')]=![];}return respondWithRpcPromise(_0x63f6('0xa3'),_0x63f6('0xa4'),_0x2df3bd);});}return respondWithRpcPromise(_0x63f6('0xa3'),_0x63f6('0xa4'),_0x2df3bd);})['then'](function(_0xf9f2d6){respondWithRpcPromise(_0x63f6('0xa5'),'EventManager',{'event':_0x63f6('0x73'),'message':_0xf9f2d6},client9002);return _0xf9f2d6;})[_0x63f6('0x24')](respondWithResult(_0x3247cc,null))[_0x63f6('0x2d')](handleError(_0x3247cc,null));};exports['addApplications']=function(_0x435665,_0x5aa33a,_0xf76eaf){return db[_0x63f6('0x58')]['findOne']({'where':{'id':_0x435665[_0x63f6('0x5e')]['id']}})[_0x63f6('0x24')](handleEntityNotFound(_0x5aa33a,null))['then'](function(_0x106168){if(_0x106168){return db['sequelize']['transaction'](function(_0x14f63d){return db[_0x63f6('0x86')][_0x63f6('0x37')]({'where':{'OpenchannelAccountId':_0x435665[_0x63f6('0x5e')]['id']},'transaction':_0x14f63d})[_0x63f6('0x24')](function(_0x3e1976){var _0x37a2da=_[_0x63f6('0x41')](_0x435665[_0x63f6('0x61')],function(_0x422e76){_0x422e76[_0x63f6('0x6c')]=_0x435665['params']['id'];return _0x422e76;});return db[_0x63f6('0x86')][_0x63f6('0xa6')](_0x37a2da,{'transaction':_0x14f63d});});})[_0x63f6('0x24')](function(){return db[_0x63f6('0x86')][_0x63f6('0xa7')]({'where':{'OpenchannelAccountId':_0x435665[_0x63f6('0x5e')]['id']},'order':'priority'});});}})[_0x63f6('0x24')](respondWithResult(_0x5aa33a,null))[_0x63f6('0x2d')](handleError(_0x5aa33a,null));};exports[_0x63f6('0xa8')]=function(_0x5b16b2,_0x5e25c2,_0xfb2f90){var _0x3b91d0={};var _0x28585f={};var _0x213c56;var _0x26505a;return db[_0x63f6('0x58')]['findOne']({'where':{'id':_0x5b16b2[_0x63f6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5e25c2,null))[_0x63f6('0x24')](function(_0x15a5eb){if(_0x15a5eb){_0x213c56=_0x15a5eb;_0x28585f[_0x63f6('0x46')]=_[_0x63f6('0x47')](db[_0x63f6('0x86')][_0x63f6('0x42')]);_0x28585f[_0x63f6('0x48')]=_['keys'](_0x5b16b2['query']);_0x28585f[_0x63f6('0x49')]=_[_0x63f6('0x4a')](_0x28585f[_0x63f6('0x46')],_0x28585f[_0x63f6('0x48')]);_0x3b91d0[_0x63f6('0x4c')]=_[_0x63f6('0x4a')](_0x28585f[_0x63f6('0x46')],qs[_0x63f6('0x4b')](_0x5b16b2[_0x63f6('0x48')][_0x63f6('0x4b')]));_0x3b91d0[_0x63f6('0x4c')]=_0x3b91d0[_0x63f6('0x4c')][_0x63f6('0x4d')]?_0x3b91d0[_0x63f6('0x4c')]:_0x28585f[_0x63f6('0x46')];_0x3b91d0['order']=qs['sort'](_0x5b16b2['query'][_0x63f6('0x51')]);_0x3b91d0[_0x63f6('0x54')]=qs['filters'](_[_0x63f6('0x52')](_0x5b16b2[_0x63f6('0x48')],_0x28585f[_0x63f6('0x49')]));if(_0x5b16b2['query']['filter']){_0x3b91d0[_0x63f6('0x54')]=_[_0x63f6('0x55')](_0x3b91d0[_0x63f6('0x54')],{'$or':_[_0x63f6('0x41')](_0x3b91d0[_0x63f6('0x4c')],function(_0x11cb30){var _0xc10d2e={};_0xc10d2e[_0x11cb30]={'$like':'%'+_0x5b16b2['query'][_0x63f6('0x53')]+'%'};return _0xc10d2e;})});}_0x3b91d0=_['merge']({},_0x3b91d0,_0x5b16b2[_0x63f6('0x57')]);return _0x213c56[_0x63f6('0xa8')](_0x3b91d0);}})[_0x63f6('0x24')](function(_0x48a595){if(_0x48a595){_0x26505a=_0x48a595['length'];if(!_0x5b16b2['query'][_0x63f6('0x4e')]('nolimit')){_0x3b91d0[_0x63f6('0x32')]=qs[_0x63f6('0x32')](_0x5b16b2[_0x63f6('0x48')][_0x63f6('0x32')]);_0x3b91d0[_0x63f6('0x31')]=qs[_0x63f6('0x31')](_0x5b16b2[_0x63f6('0x48')][_0x63f6('0x31')]);}return _0x213c56['getApplications'](_0x3b91d0);}})[_0x63f6('0x24')](function(_0x5eb836){if(_0x5eb836){return _0x5eb836?{'count':_0x26505a,'rows':_0x5eb836}:null;}})[_0x63f6('0x24')](respondWithResult(_0x5e25c2,null))[_0x63f6('0x2d')](handleError(_0x5e25c2,null));};exports[_0x63f6('0xa9')]=function(_0x4ed1e0,_0x1563d8,_0x3479f7){var _0x5d3f79={'raw':![],'where':{}};var _0x81b3df={};var _0x418b41={'count':0x0,'rows':[]};return db[_0x63f6('0x58')][_0x63f6('0x71')]({'where':{'id':_0x4ed1e0['params']['id']}})[_0x63f6('0x24')](handleEntityNotFound(_0x1563d8,null))[_0x63f6('0x24')](function(_0x5430ab){if(_0x5430ab){_0x81b3df['model']=_['keys'](db[_0x63f6('0x92')][_0x63f6('0x42')]);_0x81b3df[_0x63f6('0x48')]=_['keys'](_0x4ed1e0[_0x63f6('0x48')]);_0x81b3df['filters']=_[_0x63f6('0x4a')](_0x81b3df[_0x63f6('0x46')],_0x81b3df['query']);_0x5d3f79[_0x63f6('0x4c')]=_[_0x63f6('0x4a')](_0x81b3df['model'],qs['fields'](_0x4ed1e0[_0x63f6('0x48')]['fields']));_0x5d3f79['attributes']=_0x5d3f79[_0x63f6('0x4c')][_0x63f6('0x4d')]?_0x5d3f79['attributes']:_0x81b3df['model'];if(!_0x4ed1e0[_0x63f6('0x48')][_0x63f6('0x4e')](_0x63f6('0x4f'))){_0x5d3f79['limit']=qs['limit'](_0x4ed1e0[_0x63f6('0x48')]['limit']);_0x5d3f79[_0x63f6('0x31')]=qs[_0x63f6('0x31')](_0x4ed1e0[_0x63f6('0x48')][_0x63f6('0x31')]);}_0x5d3f79[_0x63f6('0x50')]=qs['sort'](_0x4ed1e0[_0x63f6('0x48')][_0x63f6('0x51')]);_0x5d3f79[_0x63f6('0x54')]=qs['filters'](_[_0x63f6('0x52')](_0x4ed1e0['query'],_0x81b3df[_0x63f6('0x49')]));_0x5d3f79[_0x63f6('0x54')][_0x63f6('0x6c')]=_0x5430ab['id'];if(_0x4ed1e0[_0x63f6('0x48')][_0x63f6('0x53')]){_0x5d3f79[_0x63f6('0x54')]=_[_0x63f6('0x55')](_0x5d3f79['where'],{'$or':_['map'](_0x5d3f79[_0x63f6('0x4c')],function(_0x1d709b){var _0x55f9d4={};_0x55f9d4[_0x1d709b]={'$like':'%'+_0x4ed1e0[_0x63f6('0x48')][_0x63f6('0x53')]+'%'};return _0x55f9d4;})});}_0x5d3f79=_[_0x63f6('0x55')]({},_0x5d3f79,_0x4ed1e0[_0x63f6('0x57')]);return db[_0x63f6('0x92')][_0x63f6('0x59')]({'where':_0x5d3f79[_0x63f6('0x54')]})[_0x63f6('0x24')](function(_0x4e5274){_0x418b41[_0x63f6('0x59')]=_0x4e5274;if(_0x4ed1e0[_0x63f6('0x48')][_0x63f6('0x5a')]){_0x5d3f79[_0x63f6('0x5b')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x63f6('0x9e')],'as':_0x63f6('0xaa'),'attributes':['name',_0x63f6('0xab'),_0x63f6('0xac')],'required':![]},{'model':db['Tag'],'as':_0x63f6('0xad'),'attributes':['id',_0x63f6('0x3d'),_0x63f6('0xae')],'where':_0x4ed1e0[_0x63f6('0x48')][_0x63f6('0xaf')]?{'id':_0x4ed1e0[_0x63f6('0x48')][_0x63f6('0xaf')]}:undefined,'required':_0x4ed1e0['query'][_0x63f6('0xaf')]?!![]:![]}];}return db[_0x63f6('0x92')][_0x63f6('0x72')](_0x5d3f79);})[_0x63f6('0x24')](function(_0x418b00){_0x418b41[_0x63f6('0x5c')]=_0x418b00;return _0x418b41;});}})[_0x63f6('0x24')](respondWithFilteredResult(_0x1563d8,_0x5d3f79))['catch'](handleError(_0x1563d8,null));};exports[_0x63f6('0xb0')]=function(_0x44f3f2,_0x3e33ff,_0x232efb){return db['OpenchannelAccount'][_0x63f6('0x5f')]({'where':{'id':_0x44f3f2[_0x63f6('0x5e')]['id']}})[_0x63f6('0x24')](handleEntityNotFound(_0x3e33ff,null))[_0x63f6('0x24')](function(_0x1d2380){if(_0x1d2380){return _0x1d2380['addAgents'](_0x44f3f2[_0x63f6('0x61')]['ids'],_[_0x63f6('0xb1')](_0x44f3f2['body'],[_0x63f6('0x6e'),'id'])||{})[_0x63f6('0x95')](function(_0x56a0ba){for(var _0x2d8db5=0x0;_0x2d8db5<_0x44f3f2[_0x63f6('0x61')][_0x63f6('0x6e')][_0x63f6('0x4d')];_0x2d8db5+=0x1){socket['emit'](_0x63f6('0xb2'),{'UserId':_0x44f3f2['body']['ids'][_0x2d8db5],'OpenchannelAccountId':_0x44f3f2[_0x63f6('0x5e')]['id']});}return _0x56a0ba;});}})[_0x63f6('0x24')](respondWithResult(_0x3e33ff,null))[_0x63f6('0x2d')](handleError(_0x3e33ff,null));};exports[_0x63f6('0xb3')]=function(_0x2f0767,_0x3c471e,_0x23fdef){return db['OpenchannelAccount'][_0x63f6('0x5f')]({'where':{'id':_0x2f0767[_0x63f6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3c471e,null))[_0x63f6('0x24')](function(_0x1288bb){if(_0x1288bb){return _0x1288bb[_0x63f6('0xb3')](_0x2f0767[_0x63f6('0x48')][_0x63f6('0x6e')])[_0x63f6('0x24')](function(){if(_[_0x63f6('0xb4')](_0x2f0767['query'][_0x63f6('0x6e')])){for(var _0x1736ef=0x0;_0x1736ef<_0x2f0767[_0x63f6('0x48')][_0x63f6('0x6e')]['length'];_0x1736ef+=0x1){socket[_0x63f6('0xb5')](_0x63f6('0xb6'),{'UserId':Number(_0x2f0767['query'][_0x63f6('0x6e')][_0x1736ef]),'OpenchannelAccountId':Number(_0x2f0767[_0x63f6('0x5e')]['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x2f0767[_0x63f6('0x48')][_0x63f6('0x6e')]),'OpenchannelAccountId':Number(_0x2f0767[_0x63f6('0x5e')]['id'])});}});}})[_0x63f6('0x24')](respondWithStatusCode(_0x3c471e,null))['catch'](handleError(_0x3c471e,null));};exports[_0x63f6('0xb7')]=function(_0x40f9b0,_0x48415f,_0x3271fe){var _0x4d5df3={};var _0x5cb1b1={};var _0x6249e5;var _0x1318ef;return db[_0x63f6('0x58')][_0x63f6('0x71')]({'where':{'id':_0x40f9b0[_0x63f6('0x5e')]['id']}})[_0x63f6('0x24')](handleEntityNotFound(_0x48415f,null))[_0x63f6('0x24')](function(_0x29e4f5){if(_0x29e4f5){_0x6249e5=_0x29e4f5;_0x5cb1b1['model']=_[_0x63f6('0x47')](db[_0x63f6('0x9e')]['rawAttributes']);_0x5cb1b1[_0x63f6('0x48')]=_[_0x63f6('0x47')](_0x40f9b0['query']);_0x5cb1b1[_0x63f6('0x49')]=_[_0x63f6('0x4a')](_0x5cb1b1[_0x63f6('0x46')],_0x5cb1b1['query']);_0x4d5df3[_0x63f6('0x4c')]=_[_0x63f6('0x4a')](_0x5cb1b1[_0x63f6('0x46')],qs[_0x63f6('0x4b')](_0x40f9b0[_0x63f6('0x48')][_0x63f6('0x4b')]));_0x4d5df3[_0x63f6('0x4c')]=_0x4d5df3[_0x63f6('0x4c')]['length']?_0x4d5df3['attributes']:_0x5cb1b1['model'];_0x4d5df3[_0x63f6('0x50')]=qs[_0x63f6('0x51')](_0x40f9b0[_0x63f6('0x48')][_0x63f6('0x51')]);_0x4d5df3[_0x63f6('0x54')]=qs['filters'](_[_0x63f6('0x52')](_0x40f9b0[_0x63f6('0x48')],_0x5cb1b1[_0x63f6('0x49')]));if(_0x40f9b0[_0x63f6('0x48')]['filter']){_0x4d5df3[_0x63f6('0x54')]=_[_0x63f6('0x55')](_0x4d5df3[_0x63f6('0x54')],{'$or':_[_0x63f6('0x41')](_0x4d5df3['attributes'],function(_0x1847b3){var _0x2653d0={};_0x2653d0[_0x1847b3]={'$like':'%'+_0x40f9b0[_0x63f6('0x48')][_0x63f6('0x53')]+'%'};return _0x2653d0;})});}_0x4d5df3=_[_0x63f6('0x55')]({},_0x4d5df3,_0x40f9b0[_0x63f6('0x57')]);return _0x6249e5['getAgents'](_0x4d5df3);}})[_0x63f6('0x24')](function(_0x2a4aca){if(_0x2a4aca){_0x1318ef=_0x2a4aca[_0x63f6('0x4d')];if(!_0x40f9b0[_0x63f6('0x48')][_0x63f6('0x4e')](_0x63f6('0x4f'))){_0x4d5df3[_0x63f6('0x32')]=qs[_0x63f6('0x32')](_0x40f9b0[_0x63f6('0x48')][_0x63f6('0x32')]);_0x4d5df3[_0x63f6('0x31')]=qs[_0x63f6('0x31')](_0x40f9b0['query']['offset']);}return _0x6249e5[_0x63f6('0xb7')](_0x4d5df3);}})[_0x63f6('0x24')](function(_0x55c5e8){if(_0x55c5e8){return _0x55c5e8?{'count':_0x1318ef,'rows':_0x55c5e8}:null;}})['then'](respondWithResult(_0x48415f,null))[_0x63f6('0x2d')](handleError(_0x48415f,null));};exports[_0x63f6('0xb8')]=function(_0x57a0ed,_0x5e5624,_0x4e8c52){var _0x2aec2e,_0x1e6d4e,_0x5dd2ba;if(_[_0x63f6('0x79')](_0x57a0ed['body'][_0x63f6('0x61')])||_0x57a0ed['body'][_0x63f6('0x61')]===''){throw new db[(_0x63f6('0x22'))][(_0x63f6('0x23'))](_0x63f6('0x7c'));}if(_[_0x63f6('0x79')](_0x57a0ed[_0x63f6('0x61')]['to'])){}_0x2aec2e=_0x57a0ed['body']['to'];return db[_0x63f6('0x58')]['findOne']({'where':{'id':_0x57a0ed[_0x63f6('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5e5624,null))[_0x63f6('0x24')](function(_0x2fbdb5){if(_0x2fbdb5){return db[_0x63f6('0x58')][_0x63f6('0x5f')]({'where':{'id':_0x2fbdb5['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x63f6('0x83')],'as':_0x63f6('0x84'),'where':{[_0x2fbdb5[_0x63f6('0x7d')]]:_0x2aec2e},'limit':0x1,'order':[[_0x63f6('0x77'),_0x63f6('0x85')]]}]}]})[_0x63f6('0x24')](handleEntityNotFound(_0x5e5624,null))[_0x63f6('0x24')](function(_0x1b551c){if(_0x1b551c&&_0x1b551c[_0x63f6('0x82')]){_0x1e6d4e=_0x1b551c[_0x63f6('0x38')]({'plain':!![]});if(_0x1e6d4e['List']&&_0x1e6d4e['List'][_0x63f6('0x84')][_0x63f6('0x4d')]){return _0x1e6d4e[_0x63f6('0x82')][_0x63f6('0x84')][0x0];}return db[_0x63f6('0x83')][_0x63f6('0x60')](_[_0x63f6('0x1b')](_0x57a0ed['body'],{'firstName':_0x2aec2e,[_0x1b551c[_0x63f6('0x7d')]]:_0x2aec2e,'phone':_0x2aec2e,'ListId':_0x1e6d4e[_0x63f6('0x78')]}));}})[_0x63f6('0x24')](handleEntityNotFound(_0x5e5624,null))[_0x63f6('0x24')](function(_0x29b866){if(_0x29b866){_0x5dd2ba=_0x29b866;return db[_0x63f6('0x92')][_0x63f6('0x5f')]({'where':{'ContactId':_0x5dd2ba['id'],'closed':![],'OpenchannelAccountId':_0x1e6d4e['id']}})[_0x63f6('0x24')](function(_0x265df8){if(_0x265df8){return[_0x265df8,![]];}return db[_0x63f6('0x92')]['create']({'UserId':_0x57a0ed[_0x63f6('0x62')]['id'],'ContactId':_0x5dd2ba['id'],'OpenchannelAccountId':_0x1e6d4e['id'],'lastMsgDirection':_0x63f6('0xb9'),'Messages':[_['merge'](_0x57a0ed[_0x63f6('0x61')],{'read':![],'body':_0x57a0ed[_0x63f6('0x61')]['body'],'OpenchannelAccountId':_0x1e6d4e['id'],'UserId':_0x57a0ed[_0x63f6('0x62')]['id'],'ContactId':_0x5dd2ba['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})['then'](function(_0xf582b0){return[_0xf582b0,!![]];});});}})['spread'](function(_0x32ed0e,_0x109acc){if(_0x109acc){return _0x32ed0e;}return db['OpenchannelMessage'][_0x63f6('0x60')](_[_0x63f6('0x55')](_0x57a0ed[_0x63f6('0x61')],{'read':![],'body':_0x57a0ed['body'][_0x63f6('0x61')],'OpenchannelAccountId':_0x1e6d4e['id'],'OpenchannelInteractionId':_0x32ed0e['id'],'UserId':_0x57a0ed[_0x63f6('0x62')]['id'],'ContactId':_0x5dd2ba['id']}))[_0x63f6('0x24')](function(_0x45ce11){_0x32ed0e[_0x63f6('0xba')][_0x63f6('0xbb')]=[];_0x32ed0e['dataValues']['Messages'][_0x63f6('0x99')](_0x45ce11[_0x63f6('0xba')]);return _0x32ed0e;});});}})[_0x63f6('0x24')](respondWithResult(_0x5e5624,null))['catch'](handleError(_0x5e5624,null));};
\ No newline at end of file
index 3c6b90f..e13a369 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f8b=['update','emit','hasOwnProperty','hook','OpenchannelAccount','setMaxListeners','save'];(function(_0x7bf4a7,_0x51d7fa){var _0x204c0f=function(_0x374092){while(--_0x374092){_0x7bf4a7['push'](_0x7bf4a7['shift']());}};_0x204c0f(++_0x51d7fa);}(_0x0f8b,0x100));var _0xb0f8=function(_0x109e2e,_0x2e6ebd){_0x109e2e=_0x109e2e-0x0;var _0x290c37=_0x0f8b[_0x109e2e];return _0x290c37;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xb0f8('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb0f8('0x1')](0x0);var events={'afterCreate':_0xb0f8('0x2'),'afterUpdate':_0xb0f8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2b4d7e){return function(_0x3666f1,_0x55608b,_0x4bf29e){OpenchannelAccountEvents[_0xb0f8('0x4')](_0x2b4d7e+':'+_0x3666f1['id'],_0x3666f1);OpenchannelAccountEvents[_0xb0f8('0x4')](_0x2b4d7e,_0x3666f1);_0x4bf29e(null);};}for(var e in events){if(events[_0xb0f8('0x5')](e)){var event=events[e];OpenchannelAccount[_0xb0f8('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
+var _0xf7c5=['exports','events','OpenchannelAccount','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xf7c5,0xa9));var _0x5f7c=function(_0x44e00a,_0x248bbc){_0x44e00a=_0x44e00a-0x0;var _0x2bdfba=_0xf7c5[_0x44e00a];return _0x2bdfba;};'use strict';var EventEmitter=require(_0x5f7c('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x5f7c('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x5f7c('0x2')](0x0);var events={'afterCreate':_0x5f7c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1def70){return function(_0x2594d9,_0x430ab4,_0xc92946){OpenchannelAccountEvents[_0x5f7c('0x4')](_0x1def70+':'+_0x2594d9['id'],_0x2594d9);OpenchannelAccountEvents[_0x5f7c('0x4')](_0x1def70,_0x2594d9);_0xc92946(null);};}for(var e in events){if(events[_0x5f7c('0x5')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x5f7c('0x6')]=OpenchannelAccountEvents;
\ No newline at end of file
index f61747d..4d3b8b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc645=['path','../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','api','bluebird','request-promise'];(function(_0x60bc76,_0x4c43b0){var _0x1d2e35=function(_0x44c839){while(--_0x44c839){_0x60bc76['push'](_0x60bc76['shift']());}};_0x1d2e35(++_0x4c43b0);}(_0xc645,0x1b3));var _0x5c64=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xc645[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x5c64('0x0'));var util=require(_0x5c64('0x1'));var logger=require('../../config/logger')(_0x5c64('0x2'));var moment=require('moment');var BPromise=require(_0x5c64('0x3'));var rp=require(_0x5c64('0x4'));var fs=require('fs');var path=require(_0x5c64('0x5'));var rimraf=require('rimraf');var config=require(_0x5c64('0x6'));var attributes=require(_0x5c64('0x7'));module[_0x5c64('0x8')]=function(_0x448b50,_0x5dd6d4){return _0x448b50[_0x5c64('0x9')](_0x5c64('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2167=['rimraf','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util','api','moment','request-promise','path'];(function(_0x2629db,_0x317a0d){var _0x23c846=function(_0xc7f372){while(--_0xc7f372){_0x2629db['push'](_0x2629db['shift']());}};_0x23c846(++_0x317a0d);}(_0x2167,0xaa));var _0x7216=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x2167[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x7216('0x0'));var util=require(_0x7216('0x1'));var logger=require('../../config/logger')(_0x7216('0x2'));var moment=require(_0x7216('0x3'));var BPromise=require('bluebird');var rp=require(_0x7216('0x4'));var fs=require('fs');var path=require(_0x7216('0x5'));var rimraf=require(_0x7216('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelAccount.attributes');module[_0x7216('0x7')]=function(_0x2d4bcc,_0x3eb049){return _0x2d4bcc[_0x7216('0x8')](_0x7216('0x9'),attributes,{'tableName':_0x7216('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 085fa41..bb187a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88e1=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x35eb0e,_0x2aa92e){var _0xcec969=function(_0x3284db){while(--_0x3284db){_0x35eb0e['push'](_0x35eb0e['shift']());}};_0xcec969(++_0x2aa92e);}(_0x88e1,0x17c));var _0x188e=function(_0x4738b7,_0x9096f0){_0x4738b7=_0x4738b7-0x0;var _0x47cb9e=_0x88e1[_0x4738b7];return _0x47cb9e;};'use strict';var _=require(_0x188e('0x0'));var util=require(_0x188e('0x1'));var moment=require(_0x188e('0x2'));var BPromise=require(_0x188e('0x3'));var rs=require(_0x188e('0x4'));var fs=require('fs');var Redis=require(_0x188e('0x5'));var db=require(_0x188e('0x6'))['db'];var utils=require(_0x188e('0x7'));var logger=require('../../config/logger')(_0x188e('0x8'));var config=require(_0x188e('0x9'));var jayson=require(_0x188e('0xa'));var client=jayson[_0x188e('0xb')][_0x188e('0xc')]({'port':0x232a});config[_0x188e('0xd')]=_[_0x188e('0xe')](config[_0x188e('0xd')],{'host':_0x188e('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x188e('0xd')]));require(_0x188e('0x10'))[_0x188e('0x11')](socket);function respondWithRpcPromise(_0x59cfcb,_0x594750,_0x354c34){return new BPromise(function(_0x4f4657,_0x338ed0){return client[_0x188e('0x12')](_0x59cfcb,_0x354c34)[_0x188e('0x13')](function(_0x5afc2a){logger[_0x188e('0x14')](_0x188e('0x15'),_0x594750,_0x188e('0x16'));logger['debug'](_0x188e('0x17'),_0x594750,'request\x20sent',JSON[_0x188e('0x18')](_0x5afc2a));if(_0x5afc2a[_0x188e('0x19')]){if(_0x5afc2a['error']['code']===0x1f4){logger[_0x188e('0x19')](_0x188e('0x15'),_0x594750,_0x5afc2a[_0x188e('0x19')][_0x188e('0x1a')]);return _0x338ed0(_0x5afc2a[_0x188e('0x19')][_0x188e('0x1a')]);}logger[_0x188e('0x19')](_0x188e('0x15'),_0x594750,_0x5afc2a['error']['message']);return _0x4f4657(_0x5afc2a[_0x188e('0x19')][_0x188e('0x1a')]);}else{logger[_0x188e('0x14')](_0x188e('0x15'),_0x594750,'request\x20sent');_0x4f4657(_0x5afc2a[_0x188e('0x1b')][_0x188e('0x1a')]);}})[_0x188e('0x1c')](function(_0x5af057){logger[_0x188e('0x19')](_0x188e('0x15'),_0x594750,_0x5af057);_0x338ed0(_0x5af057);});});}
\ No newline at end of file
+var _0x19c3=['bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x5a6a1f,_0x5ce170){var _0x1a17bd=function(_0x5012da){while(--_0x5012da){_0x5a6a1f['push'](_0x5a6a1f['shift']());}};_0x1a17bd(++_0x5ce170);}(_0x19c3,0x15d));var _0x319c=function(_0x2ee687,_0x58b317){_0x2ee687=_0x2ee687-0x0;var _0x2cc00b=_0x19c3[_0x2ee687];return _0x2cc00b;};'use strict';var _=require(_0x319c('0x0'));var util=require(_0x319c('0x1'));var moment=require('moment');var BPromise=require(_0x319c('0x2'));var rs=require(_0x319c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x319c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x319c('0x5'));var config=require(_0x319c('0x6'));var jayson=require(_0x319c('0x7'));var client=jayson[_0x319c('0x8')][_0x319c('0x9')]({'port':0x232a});config[_0x319c('0xa')]=_[_0x319c('0xb')](config[_0x319c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x319c('0xc'))(new Redis(config[_0x319c('0xa')]));require(_0x319c('0xd'))[_0x319c('0xe')](socket);function respondWithRpcPromise(_0x2b536a,_0x5b8f17,_0x3edbbb){return new BPromise(function(_0x3d7d8e,_0x550d43){return client[_0x319c('0xf')](_0x2b536a,_0x3edbbb)[_0x319c('0x10')](function(_0x1363e9){logger[_0x319c('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x5b8f17,_0x319c('0x12'));logger[_0x319c('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5b8f17,_0x319c('0x12'),JSON[_0x319c('0x14')](_0x1363e9));if(_0x1363e9[_0x319c('0x15')]){if(_0x1363e9['error'][_0x319c('0x16')]===0x1f4){logger[_0x319c('0x15')](_0x319c('0x17'),_0x5b8f17,_0x1363e9[_0x319c('0x15')][_0x319c('0x18')]);return _0x550d43(_0x1363e9[_0x319c('0x15')][_0x319c('0x18')]);}logger[_0x319c('0x15')](_0x319c('0x17'),_0x5b8f17,_0x1363e9[_0x319c('0x15')][_0x319c('0x18')]);return _0x3d7d8e(_0x1363e9['error'][_0x319c('0x18')]);}else{logger[_0x319c('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x5b8f17,_0x319c('0x12'));_0x3d7d8e(_0x1363e9[_0x319c('0x19')]['message']);}})[_0x319c('0x1a')](function(_0x21b1f6){logger[_0x319c('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x5b8f17,_0x21b1f6);_0x550d43(_0x21b1f6);});});}
\ No newline at end of file
index 1ec453a..e541c90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d06=['save','update','emit','removeListener','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x2eec1f,_0x1b9987){var _0x543075=function(_0x5792d2){while(--_0x5792d2){_0x2eec1f['push'](_0x2eec1f['shift']());}};_0x543075(++_0x1b9987);}(_0x5d06,0x99));var _0x65d0=function(_0xe499c5,_0x413f35){_0xe499c5=_0xe499c5-0x0;var _0x5a7176=_0x5d06[_0xe499c5];return _0x5a7176;};'use strict';var OpenchannelAccountEvents=require(_0x65d0('0x0'));var events=[_0x65d0('0x1'),'remove',_0x65d0('0x2')];function createListener(_0x15c08c,_0x2cb418){return function(_0x2c8b9f){_0x2cb418[_0x65d0('0x3')](_0x15c08c,_0x2c8b9f);};}function removeListener(_0x5058ac,_0x3f575f){return function(){OpenchannelAccountEvents[_0x65d0('0x4')](_0x5058ac,_0x3f575f);};}exports['register']=function(_0x5bf7ed){for(var _0x2b586c=0x0,_0x4509e0=events[_0x65d0('0x5')];_0x2b586c<_0x4509e0;_0x2b586c++){var _0x145c41=events[_0x2b586c];var _0x29e6bd=createListener(_0x65d0('0x6')+_0x145c41,_0x5bf7ed);OpenchannelAccountEvents['on'](_0x145c41,_0x29e6bd);}};
\ No newline at end of file
+var _0x2b4e=['save','update','emit','register','openchannelAccount:','./openchannelAccount.events'];(function(_0x48c33e,_0x39c833){var _0x45519a=function(_0x2b4207){while(--_0x2b4207){_0x48c33e['push'](_0x48c33e['shift']());}};_0x45519a(++_0x39c833);}(_0x2b4e,0x65));var _0xe2b4=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0x2b4e[_0x80f51a];return _0x327148;};'use strict';var OpenchannelAccountEvents=require(_0xe2b4('0x0'));var events=[_0xe2b4('0x1'),'remove',_0xe2b4('0x2')];function createListener(_0xb02ad6,_0x387ec6){return function(_0x122407){_0x387ec6[_0xe2b4('0x3')](_0xb02ad6,_0x122407);};}function removeListener(_0x3e4a4f,_0x246871){return function(){OpenchannelAccountEvents['removeListener'](_0x3e4a4f,_0x246871);};}exports[_0xe2b4('0x4')]=function(_0x5651d6){for(var _0x1b4bd6=0x0,_0x28449c=events['length'];_0x1b4bd6<_0x28449c;_0x1b4bd6++){var _0x50f577=events[_0x1b4bd6];var _0x4b87a8=createListener(_0xe2b4('0x5')+_0x50f577,_0x5651d6);OpenchannelAccountEvents['on'](_0x50f577,_0x4b87a8);}};
\ No newline at end of file
index cdab871..ac66599 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf197=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','put','update','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0xb9be54,_0x43ba92){var _0x55d70f=function(_0x1a12e5){while(--_0x1a12e5){_0xb9be54['push'](_0xb9be54['shift']());}};_0x55d70f(++_0x43ba92);}(_0xf197,0xeb));var _0x7f19=function(_0xa684c8,_0x3086ab){_0xa684c8=_0xa684c8-0x0;var _0x9512e7=_0xf197[_0xa684c8];return _0x9512e7;};'use strict';var multer=require(_0x7f19('0x0'));var util=require('util');var path=require(_0x7f19('0x1'));var timeout=require(_0x7f19('0x2'));var express=require('express');var router=express[_0x7f19('0x3')]();var auth=require(_0x7f19('0x4'));var interaction=require(_0x7f19('0x5'));var config=require(_0x7f19('0x6'));var controller=require('./openchannelApplication.controller');router[_0x7f19('0x7')]('/',auth[_0x7f19('0x8')](),controller[_0x7f19('0x9')]);router[_0x7f19('0x7')](_0x7f19('0xa'),auth['isAuthenticated'](),controller[_0x7f19('0xb')]);router['post']('/',auth[_0x7f19('0x8')](),controller['create']);router[_0x7f19('0xc')]('/:id',auth[_0x7f19('0x8')](),controller[_0x7f19('0xd')]);router[_0x7f19('0xe')](_0x7f19('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x7f19('0xf')]=router;
\ No newline at end of file
+var _0x5858=['../../components/interaction/service','get','isAuthenticated','/:id','post','create','put','delete','destroy','exports','multer','util','path','express','../../components/auth/service'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x5858,0x1cc));var _0x8585=function(_0x2f6d97,_0x5a9889){_0x2f6d97=_0x2f6d97-0x0;var _0x5da3af=_0x5858[_0x2f6d97];return _0x5da3af;};'use strict';var multer=require(_0x8585('0x0'));var util=require(_0x8585('0x1'));var path=require(_0x8585('0x2'));var timeout=require('connect-timeout');var express=require(_0x8585('0x3'));var router=express['Router']();var auth=require(_0x8585('0x4'));var interaction=require(_0x8585('0x5'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0x8585('0x6')]('/',auth[_0x8585('0x7')](),controller['index']);router[_0x8585('0x6')](_0x8585('0x8'),auth[_0x8585('0x7')](),controller['show']);router[_0x8585('0x9')]('/',auth[_0x8585('0x7')](),controller[_0x8585('0xa')]);router[_0x8585('0xb')]('/:id',auth[_0x8585('0x7')](),controller['update']);router[_0x8585('0xc')](_0x8585('0x8'),auth[_0x8585('0x7')](),controller[_0x8585('0xd')]);module[_0x8585('0xe')]=router;
\ No newline at end of file
index 92df1d3..cf16f68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd867=['STRING','*,*,*,*','sequelize','exports','INTEGER','TEXT'];(function(_0x4a9192,_0x143344){var _0x281a62=function(_0x1309a9){while(--_0x1309a9){_0x4a9192['push'](_0x4a9192['shift']());}};_0x281a62(++_0x143344);}(_0xd867,0x1dc));var _0x7d86=function(_0xb4073f,_0x1b1785){_0xb4073f=_0xb4073f-0x0;var _0x69613e=_0xd867[_0xb4073f];return _0x69613e;};'use strict';var Sequelize=require(_0x7d86('0x0'));module[_0x7d86('0x1')]={'priority':{'type':Sequelize[_0x7d86('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7d86('0x3')]()},'description':{'type':Sequelize[_0x7d86('0x4')]},'interval':{'type':Sequelize[_0x7d86('0x4')],'defaultValue':_0x7d86('0x5')}};
\ No newline at end of file
+var _0xdfe7=['*,*,*,*','sequelize','STRING','TEXT'];(function(_0x255ab0,_0x15c694){var _0x251be0=function(_0xf3efed){while(--_0xf3efed){_0x255ab0['push'](_0x255ab0['shift']());}};_0x251be0(++_0x15c694);}(_0xdfe7,0x69));var _0x7dfe=function(_0x35d4a1,_0x2d5827){_0x35d4a1=_0x35d4a1-0x0;var _0x57fa02=_0xdfe7[_0x35d4a1];return _0x57fa02;};'use strict';var Sequelize=require(_0x7dfe('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7dfe('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7dfe('0x2')]()},'description':{'type':Sequelize[_0x7dfe('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7dfe('0x3')}};
\ No newline at end of file
index 6e7d5c8..ab6b434 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1fb=['rawAttributes','fieldName','type','key','query','keys','filters','attributes','model','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','OpenchannelApplication','then','includeAll','findAll','catch','params','fields','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','error','stack','name','index','map'];(function(_0x307296,_0x49b881){var _0x32f975=function(_0x4ed150){while(--_0x4ed150){_0x307296['push'](_0x307296['shift']());}};_0x32f975(++_0x49b881);}(_0xd1fb,0xae));var _0xbd1f=function(_0x5cce2d,_0x356459){_0x5cce2d=_0x5cce2d-0x0;var _0x3d6142=_0xd1fb[_0x5cce2d];return _0x3d6142;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbd1f('0x0'));var rimraf=require(_0xbd1f('0x1'));var zipdir=require(_0xbd1f('0x2'));var jsonpatch=require(_0xbd1f('0x3'));var rp=require(_0xbd1f('0x4'));var moment=require('moment');var BPromise=require(_0xbd1f('0x5'));var Mustache=require(_0xbd1f('0x6'));var util=require(_0xbd1f('0x7'));var path=require(_0xbd1f('0x8'));var sox=require('sox');var csv=require(_0xbd1f('0x9'));var ejs=require(_0xbd1f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbd1f('0xb'));var crypto=require(_0xbd1f('0xc'));var jsforce=require(_0xbd1f('0xd'));var deskjs=require(_0xbd1f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbd1f('0xf'));var Papa=require(_0xbd1f('0x10'));var Redis=require(_0xbd1f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbd1f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd1f('0x13'));var logger=require(_0xbd1f('0x14'))(_0xbd1f('0x15'));var utils=require(_0xbd1f('0x16'));var config=require(_0xbd1f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x335f3e,_0x3fde88){_0x3fde88=_0x3fde88||0xcc;return function(_0x101af1){if(_0x101af1){return _0x335f3e[_0xbd1f('0x18')](_0x3fde88);}return _0x335f3e['status'](_0x3fde88)[_0xbd1f('0x19')]();};}function respondWithResult(_0xc857e5,_0xb8158b){_0xb8158b=_0xb8158b||0xc8;return function(_0x1e5f7d){if(_0x1e5f7d){return _0xc857e5[_0xbd1f('0x1a')](_0xb8158b)['json'](_0x1e5f7d);}};}function respondWithFilteredResult(_0x4f8dc7,_0x3a92dc){return function(_0x54ac17){if(_0x54ac17){var _0x32bfef=_0x54ac17[_0xbd1f('0x1b')],_0x5e1e46=_0x3a92dc[_0xbd1f('0x1c')],_0x29a1c4=_0x3a92dc[_0xbd1f('0x1c')]+_0x3a92dc[_0xbd1f('0x1d')],_0x34827b;if(_0x29a1c4>=_0x32bfef){_0x29a1c4=_0x32bfef;_0x34827b=0xc8;}else{_0x34827b=0xce;}_0x4f8dc7[_0xbd1f('0x1a')](_0x34827b);return _0x4f8dc7[_0xbd1f('0x1e')](_0xbd1f('0x1f'),_0x5e1e46+'-'+_0x29a1c4+'/'+_0x32bfef)[_0xbd1f('0x20')](_0x54ac17);}return null;};}function patchUpdates(_0x1a6ccb){return function(_0x282fa0){try{jsonpatch[_0xbd1f('0x21')](_0x282fa0,_0x1a6ccb,!![]);}catch(_0x573525){return BPromise[_0xbd1f('0x22')](_0x573525);}return _0x282fa0['save']();};}function saveUpdates(_0x105a5e,_0x529966){return function(_0x492799){if(_0x492799){return _0x492799[_0xbd1f('0x23')](_0x105a5e)['then'](function(_0x4e159f){return _0x4e159f;});}return null;};}function removeEntity(_0x56b8f5,_0x4b81d3){return function(_0x2730db){if(_0x2730db){return _0x2730db[_0xbd1f('0x24')]()['then'](function(){_0x56b8f5[_0xbd1f('0x1a')](0xcc)[_0xbd1f('0x19')]();});}};}function handleEntityNotFound(_0x1ebf43,_0x30efea){return function(_0x21345a){if(!_0x21345a){_0x1ebf43[_0xbd1f('0x18')](0x194);}return _0x21345a;};}function handleError(_0x1b83ca,_0x4f3b9c){_0x4f3b9c=_0x4f3b9c||0x1f4;return function(_0x4c43e5){logger[_0xbd1f('0x25')](_0x4c43e5[_0xbd1f('0x26')]);if(_0x4c43e5[_0xbd1f('0x27')]){delete _0x4c43e5[_0xbd1f('0x27')];}_0x1b83ca[_0xbd1f('0x1a')](_0x4f3b9c)['send'](_0x4c43e5);};}exports[_0xbd1f('0x28')]=function(_0x294525,_0x4068ef){var _0x470a03={},_0x4402b2={},_0x5a4499={'count':0x0,'rows':[]};var _0x1d6220=_[_0xbd1f('0x29')](db['OpenchannelApplication'][_0xbd1f('0x2a')],function(_0x2c9e58){return{'name':_0x2c9e58[_0xbd1f('0x2b')],'type':_0x2c9e58[_0xbd1f('0x2c')][_0xbd1f('0x2d')]};});_0x4402b2['model']=_[_0xbd1f('0x29')](_0x1d6220,_0xbd1f('0x27'));_0x4402b2[_0xbd1f('0x2e')]=_[_0xbd1f('0x2f')](_0x294525[_0xbd1f('0x2e')]);_0x4402b2[_0xbd1f('0x30')]=_['intersection'](_0x4402b2['model'],_0x4402b2['query']);_0x470a03[_0xbd1f('0x31')]=_['intersection'](_0x4402b2[_0xbd1f('0x32')],qs['fields'](_0x294525[_0xbd1f('0x2e')]['fields']));_0x470a03[_0xbd1f('0x31')]=_0x470a03['attributes'][_0xbd1f('0x33')]?_0x470a03[_0xbd1f('0x31')]:_0x4402b2[_0xbd1f('0x32')];if(!_0x294525[_0xbd1f('0x2e')][_0xbd1f('0x34')](_0xbd1f('0x35'))){_0x470a03[_0xbd1f('0x1d')]=qs[_0xbd1f('0x1d')](_0x294525[_0xbd1f('0x2e')][_0xbd1f('0x1d')]);_0x470a03[_0xbd1f('0x1c')]=qs[_0xbd1f('0x1c')](_0x294525['query'][_0xbd1f('0x1c')]);}_0x470a03['order']=qs['sort'](_0x294525[_0xbd1f('0x2e')][_0xbd1f('0x36')]);_0x470a03['where']=qs[_0xbd1f('0x30')](_[_0xbd1f('0x37')](_0x294525['query'],_0x4402b2['filters']),_0x1d6220);if(_0x294525[_0xbd1f('0x2e')][_0xbd1f('0x38')]){_0x470a03[_0xbd1f('0x39')]=_[_0xbd1f('0x3a')](_0x470a03['where'],{'$or':_[_0xbd1f('0x29')](_0x1d6220,function(_0x2733b0){if(_0x2733b0[_0xbd1f('0x2c')]!==_0xbd1f('0x3b')){var _0x22ec1c={};_0x22ec1c[_0x2733b0[_0xbd1f('0x27')]]={'$like':'%'+_0x294525[_0xbd1f('0x2e')][_0xbd1f('0x38')]+'%'};return _0x22ec1c;}})});}_0x470a03=_['merge']({},_0x470a03,_0x294525['options']);var _0x1835ea={'where':_0x470a03['where']};return db[_0xbd1f('0x3c')][_0xbd1f('0x1b')](_0x1835ea)[_0xbd1f('0x3d')](function(_0x26013a){_0x5a4499[_0xbd1f('0x1b')]=_0x26013a;if(_0x294525[_0xbd1f('0x2e')][_0xbd1f('0x3e')]){_0x470a03['include']=[{'all':!![]}];}return db[_0xbd1f('0x3c')][_0xbd1f('0x3f')](_0x470a03);})[_0xbd1f('0x3d')](function(_0xc1b817){_0x5a4499['rows']=_0xc1b817;return _0x5a4499;})[_0xbd1f('0x3d')](respondWithFilteredResult(_0x4068ef,_0x470a03))[_0xbd1f('0x40')](handleError(_0x4068ef,null));};exports['show']=function(_0x2e0553,_0x5c5015){var _0xe0c9fe={'raw':!![],'where':{'id':_0x2e0553[_0xbd1f('0x41')]['id']}},_0x564cd3={};_0x564cd3[_0xbd1f('0x32')]=_[_0xbd1f('0x2f')](db[_0xbd1f('0x3c')][_0xbd1f('0x2a')]);_0x564cd3['query']=_[_0xbd1f('0x2f')](_0x2e0553[_0xbd1f('0x2e')]);_0x564cd3[_0xbd1f('0x30')]=_['intersection'](_0x564cd3[_0xbd1f('0x32')],_0x564cd3['query']);_0xe0c9fe[_0xbd1f('0x31')]=_['intersection'](_0x564cd3[_0xbd1f('0x32')],qs[_0xbd1f('0x42')](_0x2e0553[_0xbd1f('0x2e')]['fields']));_0xe0c9fe['attributes']=_0xe0c9fe[_0xbd1f('0x31')][_0xbd1f('0x33')]?_0xe0c9fe[_0xbd1f('0x31')]:_0x564cd3[_0xbd1f('0x32')];if(_0x2e0553[_0xbd1f('0x2e')][_0xbd1f('0x3e')]){_0xe0c9fe[_0xbd1f('0x43')]=[{'all':!![]}];}_0xe0c9fe=_['merge']({},_0xe0c9fe,_0x2e0553[_0xbd1f('0x44')]);return db[_0xbd1f('0x3c')][_0xbd1f('0x45')](_0xe0c9fe)[_0xbd1f('0x3d')](handleEntityNotFound(_0x5c5015,null))['then'](respondWithResult(_0x5c5015,null))['catch'](handleError(_0x5c5015,null));};exports[_0xbd1f('0x46')]=function(_0x3fdbc1,_0x5a8021){return db[_0xbd1f('0x3c')][_0xbd1f('0x46')](_0x3fdbc1[_0xbd1f('0x47')],{})[_0xbd1f('0x3d')](respondWithResult(_0x5a8021,0xc9))[_0xbd1f('0x40')](handleError(_0x5a8021,null));};exports[_0xbd1f('0x23')]=function(_0x3aab4a,_0x3414de){if(_0x3aab4a[_0xbd1f('0x47')]['id']){delete _0x3aab4a[_0xbd1f('0x47')]['id'];}return db[_0xbd1f('0x3c')][_0xbd1f('0x45')]({'where':{'id':_0x3aab4a[_0xbd1f('0x41')]['id']}})['then'](handleEntityNotFound(_0x3414de,null))['then'](saveUpdates(_0x3aab4a[_0xbd1f('0x47')],null))[_0xbd1f('0x3d')](respondWithResult(_0x3414de,null))['catch'](handleError(_0x3414de,null));};exports[_0xbd1f('0x24')]=function(_0x50bf71,_0x2b7d13){return db[_0xbd1f('0x3c')]['find']({'where':{'id':_0x50bf71[_0xbd1f('0x41')]['id']}})[_0xbd1f('0x3d')](handleEntityNotFound(_0x2b7d13,null))[_0xbd1f('0x3d')](removeEntity(_0x2b7d13,null))['catch'](handleError(_0x2b7d13,null));};
\ No newline at end of file
+var _0x2e41=['sendStatus','error','stack','name','send','index','OpenchannelApplication','rawAttributes','type','model','map','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','query','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','save','then'];(function(_0x51ca23,_0x5a055f){var _0x23ef2e=function(_0x41982f){while(--_0x41982f){_0x51ca23['push'](_0x51ca23['shift']());}};_0x23ef2e(++_0x5a055f);}(_0x2e41,0x150));var _0x12e4=function(_0x566438,_0x3abb6a){_0x566438=_0x566438-0x0;var _0x2d8c26=_0x2e41[_0x566438];return _0x2d8c26;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x12e4('0x0'));var rimraf=require(_0x12e4('0x1'));var zipdir=require(_0x12e4('0x2'));var jsonpatch=require(_0x12e4('0x3'));var rp=require(_0x12e4('0x4'));var moment=require(_0x12e4('0x5'));var BPromise=require(_0x12e4('0x6'));var Mustache=require(_0x12e4('0x7'));var util=require(_0x12e4('0x8'));var path=require(_0x12e4('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x12e4('0xa'));var fs=require('fs');var _=require(_0x12e4('0xb'));var squel=require('squel');var crypto=require(_0x12e4('0xc'));var jsforce=require(_0x12e4('0xd'));var deskjs=require(_0x12e4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x12e4('0xf'));var Papa=require(_0x12e4('0x10'));var Redis=require('ioredis');var authService=require(_0x12e4('0x11'));var qs=require(_0x12e4('0x12'));var as=require(_0x12e4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x12e4('0x14'))(_0x12e4('0x15'));var utils=require(_0x12e4('0x16'));var config=require(_0x12e4('0x17'));var db=require(_0x12e4('0x18'))['db'];function respondWithStatusCode(_0x5535c2,_0x3aa1c0){_0x3aa1c0=_0x3aa1c0||0xcc;return function(_0x5060df){if(_0x5060df){return _0x5535c2['sendStatus'](_0x3aa1c0);}return _0x5535c2[_0x12e4('0x19')](_0x3aa1c0)[_0x12e4('0x1a')]();};}function respondWithResult(_0x455edd,_0x2e0ba3){_0x2e0ba3=_0x2e0ba3||0xc8;return function(_0x8374a2){if(_0x8374a2){return _0x455edd[_0x12e4('0x19')](_0x2e0ba3)[_0x12e4('0x1b')](_0x8374a2);}};}function respondWithFilteredResult(_0xee3b9d,_0xcb649){return function(_0x190ff6){if(_0x190ff6){var _0x500cd0=_0x190ff6[_0x12e4('0x1c')],_0x3a3caa=_0xcb649[_0x12e4('0x1d')],_0x1f750f=_0xcb649[_0x12e4('0x1d')]+_0xcb649['limit'],_0x367cdc;if(_0x1f750f>=_0x500cd0){_0x1f750f=_0x500cd0;_0x367cdc=0xc8;}else{_0x367cdc=0xce;}_0xee3b9d[_0x12e4('0x19')](_0x367cdc);return _0xee3b9d[_0x12e4('0x1e')](_0x12e4('0x1f'),_0x3a3caa+'-'+_0x1f750f+'/'+_0x500cd0)[_0x12e4('0x1b')](_0x190ff6);}return null;};}function patchUpdates(_0x34abdf){return function(_0x426b49){try{jsonpatch['apply'](_0x426b49,_0x34abdf,!![]);}catch(_0x5c89bf){return BPromise['reject'](_0x5c89bf);}return _0x426b49[_0x12e4('0x20')]();};}function saveUpdates(_0x36c8fd,_0x3ce960){return function(_0x4d36f3){if(_0x4d36f3){return _0x4d36f3['update'](_0x36c8fd)[_0x12e4('0x21')](function(_0x5681e0){return _0x5681e0;});}return null;};}function removeEntity(_0x543f4c,_0x1fc2b7){return function(_0x523e14){if(_0x523e14){return _0x523e14['destroy']()[_0x12e4('0x21')](function(){_0x543f4c[_0x12e4('0x19')](0xcc)[_0x12e4('0x1a')]();});}};}function handleEntityNotFound(_0x1c0d4a,_0x171a2c){return function(_0x10bac4){if(!_0x10bac4){_0x1c0d4a[_0x12e4('0x22')](0x194);}return _0x10bac4;};}function handleError(_0x5cc240,_0x4f9756){_0x4f9756=_0x4f9756||0x1f4;return function(_0x5c71d4){logger[_0x12e4('0x23')](_0x5c71d4[_0x12e4('0x24')]);if(_0x5c71d4[_0x12e4('0x25')]){delete _0x5c71d4[_0x12e4('0x25')];}_0x5cc240[_0x12e4('0x19')](_0x4f9756)[_0x12e4('0x26')](_0x5c71d4);};}exports[_0x12e4('0x27')]=function(_0x8ad9de,_0x439119){var _0x168805={},_0x4f2f34={},_0x5bf9a5={'count':0x0,'rows':[]};var _0x7b952b=_['map'](db[_0x12e4('0x28')][_0x12e4('0x29')],function(_0x21dbb7){return{'name':_0x21dbb7['fieldName'],'type':_0x21dbb7[_0x12e4('0x2a')]['key']};});_0x4f2f34[_0x12e4('0x2b')]=_[_0x12e4('0x2c')](_0x7b952b,_0x12e4('0x25'));_0x4f2f34['query']=_[_0x12e4('0x2d')](_0x8ad9de['query']);_0x4f2f34[_0x12e4('0x2e')]=_[_0x12e4('0x2f')](_0x4f2f34[_0x12e4('0x2b')],_0x4f2f34['query']);_0x168805[_0x12e4('0x30')]=_[_0x12e4('0x2f')](_0x4f2f34['model'],qs['fields'](_0x8ad9de['query'][_0x12e4('0x31')]));_0x168805[_0x12e4('0x30')]=_0x168805['attributes']['length']?_0x168805[_0x12e4('0x30')]:_0x4f2f34[_0x12e4('0x2b')];if(!_0x8ad9de['query'][_0x12e4('0x32')](_0x12e4('0x33'))){_0x168805[_0x12e4('0x34')]=qs[_0x12e4('0x34')](_0x8ad9de['query'][_0x12e4('0x34')]);_0x168805['offset']=qs['offset'](_0x8ad9de[_0x12e4('0x35')][_0x12e4('0x1d')]);}_0x168805[_0x12e4('0x36')]=qs[_0x12e4('0x37')](_0x8ad9de[_0x12e4('0x35')][_0x12e4('0x37')]);_0x168805['where']=qs[_0x12e4('0x2e')](_[_0x12e4('0x38')](_0x8ad9de[_0x12e4('0x35')],_0x4f2f34[_0x12e4('0x2e')]),_0x7b952b);if(_0x8ad9de['query'][_0x12e4('0x39')]){_0x168805[_0x12e4('0x3a')]=_[_0x12e4('0x3b')](_0x168805[_0x12e4('0x3a')],{'$or':_[_0x12e4('0x2c')](_0x7b952b,function(_0x369e94){if(_0x369e94[_0x12e4('0x2a')]!==_0x12e4('0x3c')){var _0x20a0e9={};_0x20a0e9[_0x369e94[_0x12e4('0x25')]]={'$like':'%'+_0x8ad9de[_0x12e4('0x35')]['filter']+'%'};return _0x20a0e9;}})});}_0x168805=_['merge']({},_0x168805,_0x8ad9de[_0x12e4('0x3d')]);var _0x52d176={'where':_0x168805[_0x12e4('0x3a')]};return db['OpenchannelApplication'][_0x12e4('0x1c')](_0x52d176)[_0x12e4('0x21')](function(_0x1ef122){_0x5bf9a5[_0x12e4('0x1c')]=_0x1ef122;if(_0x8ad9de[_0x12e4('0x35')][_0x12e4('0x3e')]){_0x168805[_0x12e4('0x3f')]=[{'all':!![]}];}return db[_0x12e4('0x28')][_0x12e4('0x40')](_0x168805);})[_0x12e4('0x21')](function(_0x8b1c78){_0x5bf9a5[_0x12e4('0x41')]=_0x8b1c78;return _0x5bf9a5;})['then'](respondWithFilteredResult(_0x439119,_0x168805))[_0x12e4('0x42')](handleError(_0x439119,null));};exports[_0x12e4('0x43')]=function(_0x1ef8e6,_0x137a3b){var _0x66bdde={'raw':!![],'where':{'id':_0x1ef8e6[_0x12e4('0x44')]['id']}},_0x3b13e0={};_0x3b13e0[_0x12e4('0x2b')]=_[_0x12e4('0x2d')](db[_0x12e4('0x28')][_0x12e4('0x29')]);_0x3b13e0[_0x12e4('0x35')]=_[_0x12e4('0x2d')](_0x1ef8e6['query']);_0x3b13e0[_0x12e4('0x2e')]=_[_0x12e4('0x2f')](_0x3b13e0[_0x12e4('0x2b')],_0x3b13e0[_0x12e4('0x35')]);_0x66bdde[_0x12e4('0x30')]=_[_0x12e4('0x2f')](_0x3b13e0[_0x12e4('0x2b')],qs['fields'](_0x1ef8e6[_0x12e4('0x35')][_0x12e4('0x31')]));_0x66bdde[_0x12e4('0x30')]=_0x66bdde['attributes'][_0x12e4('0x45')]?_0x66bdde[_0x12e4('0x30')]:_0x3b13e0['model'];if(_0x1ef8e6[_0x12e4('0x35')]['includeAll']){_0x66bdde[_0x12e4('0x3f')]=[{'all':!![]}];}_0x66bdde=_['merge']({},_0x66bdde,_0x1ef8e6['options']);return db[_0x12e4('0x28')][_0x12e4('0x46')](_0x66bdde)[_0x12e4('0x21')](handleEntityNotFound(_0x137a3b,null))[_0x12e4('0x21')](respondWithResult(_0x137a3b,null))[_0x12e4('0x42')](handleError(_0x137a3b,null));};exports['create']=function(_0x2c3b20,_0x3c0a33){return db[_0x12e4('0x28')][_0x12e4('0x47')](_0x2c3b20[_0x12e4('0x48')],{})[_0x12e4('0x21')](respondWithResult(_0x3c0a33,0xc9))[_0x12e4('0x42')](handleError(_0x3c0a33,null));};exports[_0x12e4('0x49')]=function(_0x1027da,_0xe30dea){if(_0x1027da['body']['id']){delete _0x1027da['body']['id'];}return db[_0x12e4('0x28')][_0x12e4('0x46')]({'where':{'id':_0x1027da[_0x12e4('0x44')]['id']}})['then'](handleEntityNotFound(_0xe30dea,null))[_0x12e4('0x21')](saveUpdates(_0x1027da[_0x12e4('0x48')],null))['then'](respondWithResult(_0xe30dea,null))[_0x12e4('0x42')](handleError(_0xe30dea,null));};exports['destroy']=function(_0x3a8049,_0x4eff07){return db[_0x12e4('0x28')]['find']({'where':{'id':_0x3a8049['params']['id']}})[_0x12e4('0x21')](handleEntityNotFound(_0x4eff07,null))['then'](removeEntity(_0x4eff07,null))['catch'](handleError(_0x4eff07,null));};
\ No newline at end of file
index 264b6b3..f93490b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fac=['utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications'];(function(_0xaf70c2,_0x2fc71c){var _0x361a85=function(_0x57a6b6){while(--_0x57a6b6){_0xaf70c2['push'](_0xaf70c2['shift']());}};_0x361a85(++_0x2fc71c);}(_0x1fac,0x83));var _0xc1fa=function(_0xfdebcc,_0x4918b9){_0xfdebcc=_0xfdebcc-0x0;var _0x3eec17=_0x1fac[_0xfdebcc];return _0x3eec17;};'use strict';var _=require('lodash');var util=require(_0xc1fa('0x0'));var logger=require(_0xc1fa('0x1'))(_0xc1fa('0x2'));var moment=require('moment');var BPromise=require(_0xc1fa('0x3'));var rp=require(_0xc1fa('0x4'));var fs=require('fs');var path=require(_0xc1fa('0x5'));var rimraf=require(_0xc1fa('0x6'));var config=require('../../config/environment');var attributes=require(_0xc1fa('0x7'));module[_0xc1fa('0x8')]=function(_0x128fdb,_0x18ccce){return _0x128fdb[_0xc1fa('0x9')](_0xc1fa('0xa'),attributes,{'tableName':_0xc1fa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc1fa('0xc')});};
\ No newline at end of file
+var _0x1b73=['openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x233fa2,_0x4896e4){var _0x48bb3f=function(_0x5b0145){while(--_0x5b0145){_0x233fa2['push'](_0x233fa2['shift']());}};_0x48bb3f(++_0x4896e4);}(_0x1b73,0x8f));var _0x31b7=function(_0x7d4b32,_0x18579b){_0x7d4b32=_0x7d4b32-0x0;var _0x98ac55=_0x1b73[_0x7d4b32];return _0x98ac55;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var logger=require('../../config/logger')(_0x31b7('0x1'));var moment=require(_0x31b7('0x2'));var BPromise=require(_0x31b7('0x3'));var rp=require(_0x31b7('0x4'));var fs=require('fs');var path=require(_0x31b7('0x5'));var rimraf=require('rimraf');var config=require(_0x31b7('0x6'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x4b25dd,_0x3ed8a7){return _0x4b25dd['define']('OpenchannelApplication',attributes,{'tableName':_0x31b7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x31b7('0x8'),'collate':_0x31b7('0x9')});};
\ No newline at end of file
index 10004b0..5f8d3a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x585ab9,_0x599828){var _0x544b7d=function(_0x46b062){while(--_0x46b062){_0x585ab9['push'](_0x585ab9['shift']());}};_0x544b7d(++_0x599828);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d606d,_0x376e51){_0x1d606d=_0x1d606d-0x0;var _0x3c38bd=_0xb10b[_0x1d606d];return _0x3c38bd;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});};
\ No newline at end of file
+var _0xd8b0=['OpenchannelApplication','body','options','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['update'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1b')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['attributes']||null:null,'limit':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['limit']||null:null})['then'](function(_0x238728){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON[_0x0d8b('0x10')](_0x238728));_0x18dd2d(_0x238728);})[_0x0d8b('0x15')](function(_0x4562cb){logger[_0x0d8b('0x11')]('UpdateOpenchannelApplication',_0x4562cb[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x4562cb['message']));});});};
\ No newline at end of file
index fddd5b0..507c8a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21a3=['tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags'];(function(_0x339f54,_0x3ff67e){var _0x23bb0a=function(_0x50d2d8){while(--_0x50d2d8){_0x339f54['push'](_0x339f54['shift']());}};_0x23bb0a(++_0x3ff67e);}(_0x21a3,0x82));var _0x321a=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0x21a3[_0x1f5a63];return _0x30bb7a;};'use strict';var multer=require(_0x321a('0x0'));var util=require(_0x321a('0x1'));var path=require(_0x321a('0x2'));var timeout=require(_0x321a('0x3'));var express=require(_0x321a('0x4'));var router=express[_0x321a('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x321a('0x6'));var config=require(_0x321a('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x321a('0x8')]('/',auth[_0x321a('0x9')](),controller[_0x321a('0xa')]);router[_0x321a('0x8')](_0x321a('0xb'),auth[_0x321a('0x9')](),controller['describe']);router['get'](_0x321a('0xc'),auth[_0x321a('0x9')](),controller[_0x321a('0xd')]);router['get'](_0x321a('0xe'),auth[_0x321a('0x9')](),controller[_0x321a('0xf')]);router[_0x321a('0x8')](_0x321a('0x10'),auth[_0x321a('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x321a('0x11')](_0x321a('0xe'),auth[_0x321a('0x9')](),controller[_0x321a('0x12')]);router[_0x321a('0x11')](_0x321a('0x13'),auth['isAuthenticated'](),interaction[_0x321a('0x14')](_0x321a('0x15'),_0x321a('0x16')),controller[_0x321a('0x17')]);router[_0x321a('0x18')](_0x321a('0xc'),auth['isAuthenticated'](),interaction[_0x321a('0x14')](_0x321a('0x15'),_0x321a('0x19')),controller[_0x321a('0x1a')]);router[_0x321a('0x1b')]('/:id',auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x321a('0x1c')),controller['destroy']);router[_0x321a('0x1b')](_0x321a('0x13'),auth[_0x321a('0x9')](),controller['removeTags']);module[_0x321a('0x1d')]=router;
\ No newline at end of file
+var _0x06bc=['exports','multer','util','express','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','isAuthenticated','index','get','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','addTags','put','openchannel','update','delete','openchannelinteraction:destroy','removeTags'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x06bc,0x1dd));var _0xc06b=function(_0x2d0241,_0x4101ca){_0x2d0241=_0x2d0241-0x0;var _0x47f807=_0x06bc[_0x2d0241];return _0x47f807;};'use strict';var multer=require(_0xc06b('0x0'));var util=require(_0xc06b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc06b('0x2'));var router=express['Router']();var auth=require(_0xc06b('0x3'));var interaction=require(_0xc06b('0x4'));var config=require('../../config/environment');var controller=require(_0xc06b('0x5'));router['get']('/',auth[_0xc06b('0x6')](),controller[_0xc06b('0x7')]);router[_0xc06b('0x8')]('/describe',auth[_0xc06b('0x6')](),controller[_0xc06b('0x9')]);router[_0xc06b('0x8')](_0xc06b('0xa'),auth['isAuthenticated'](),controller[_0xc06b('0xb')]);router[_0xc06b('0x8')](_0xc06b('0xc'),auth['isAuthenticated'](),controller['getMessages']);router[_0xc06b('0x8')](_0xc06b('0xd'),auth[_0xc06b('0x6')](),controller[_0xc06b('0xe')]);router[_0xc06b('0xf')]('/',auth[_0xc06b('0x6')](),controller[_0xc06b('0x10')]);router[_0xc06b('0xf')]('/:id/messages',auth[_0xc06b('0x6')](),controller[_0xc06b('0x11')]);router[_0xc06b('0xf')](_0xc06b('0x12'),auth[_0xc06b('0x6')](),interaction[_0xc06b('0x13')]('openchannel','openchannelinteraction:addtags'),controller[_0xc06b('0x14')]);router[_0xc06b('0x15')](_0xc06b('0xa'),auth[_0xc06b('0x6')](),interaction[_0xc06b('0x13')](_0xc06b('0x16'),'openchannelinteraction:update'),controller[_0xc06b('0x17')]);router[_0xc06b('0x18')](_0xc06b('0xa'),auth[_0xc06b('0x6')](),interaction[_0xc06b('0x13')](_0xc06b('0x16'),_0xc06b('0x19')),controller['destroy']);router[_0xc06b('0x18')](_0xc06b('0x12'),auth[_0xc06b('0x6')](),controller[_0xc06b('0x1a')]);module[_0xc06b('0x1b')]=router;
\ No newline at end of file
index 98aac6f..cdfdfc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dca=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x3ffa53,_0x3ede30){var _0x1cdce6=function(_0x3f8e9e){while(--_0x3f8e9e){_0x3ffa53['push'](_0x3ffa53['shift']());}};_0x1cdce6(++_0x3ede30);}(_0x3dca,0x13b));var _0xa3dc=function(_0x5c76f8,_0xdc0b8a){_0x5c76f8=_0x5c76f8-0x0;var _0x3ad7a5=_0x3dca[_0x5c76f8];return _0x3ad7a5;};'use strict';var Sequelize=require(_0xa3dc('0x0'));module[_0xa3dc('0x1')]={'closed':{'type':Sequelize[_0xa3dc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xa3dc('0x3')]},'threadId':{'type':Sequelize[_0xa3dc('0x4')]},'externalUrl':{'type':Sequelize[_0xa3dc('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa3dc('0x5')]('in',_0xa3dc('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xa3dc('0x4')]}};
\ No newline at end of file
+var _0xc90d=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x48d037,_0x310797){var _0x5e63ce=function(_0x2a4c8e){while(--_0x2a4c8e){_0x48d037['push'](_0x48d037['shift']());}};_0x5e63ce(++_0x310797);}(_0xc90d,0x12b));var _0xdc90=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0xc90d[_0x20bc10];return _0x3bd5ce;};'use strict';var Sequelize=require(_0xdc90('0x0'));module[_0xdc90('0x1')]={'closed':{'type':Sequelize[_0xdc90('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdc90('0x3')]},'disposition':{'type':Sequelize[_0xdc90('0x4')]},'note':{'type':Sequelize[_0xdc90('0x4')]},'read1stAt':{'type':Sequelize[_0xdc90('0x3')]},'threadId':{'type':Sequelize[_0xdc90('0x4')]},'externalUrl':{'type':Sequelize[_0xdc90('0x4')]},'lastMsgAt':{'type':Sequelize[_0xdc90('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xdc90('0x5')]('in',_0xdc90('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xdc90('0x4')]}};
\ No newline at end of file
index 92f4d85..13c4b32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x616c=['desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','Users','map','fullname','TagIds','split','forEach','push','catch','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','from','tools_tags','u.id','ui.OpenchannelInteractionId','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','type','isEmpty','OpenchannelAccountId','createdAt','$gte','parse','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','OpenchannelInteraction','rawAttributes','includeAll','options','create','update','params','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','omit','color','openchannelInteractionTags:save','removeTags','download','unix','root','server','tmp','join','files','attachments','transcript-%d-%s.zip','Messages','direction','secret','OpenchannelAccount','Account','User','Owner','mkdirSync','10px','40px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','Openchannel','YYYY-MM-DD','N.A.','closed','closedAt','threadId','Public','Private','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','lastName','views','downloadInteraction.html','transcript-','.pdf','log','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel'];(function(_0x1fca33,_0xf7fcf8){var _0x345689=function(_0x2ef468){while(--_0x2ef468){_0x1fca33['push'](_0x1fca33['shift']());}};_0x345689(++_0xf7fcf8);}(_0x616c,0x1b6));var _0xc616=function(_0xb1e92d,_0x264238){_0xb1e92d=_0xb1e92d-0x0;var _0x421fae=_0x616c[_0xb1e92d];return _0x421fae;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc616('0x0'));var rimraf=require(_0xc616('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc616('0x2'));var rp=require(_0xc616('0x3'));var moment=require(_0xc616('0x4'));var BPromise=require(_0xc616('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc616('0x6'));var sox=require(_0xc616('0x7'));var csv=require(_0xc616('0x8'));var ejs=require(_0xc616('0x9'));var fs=require('fs');var _=require(_0xc616('0xa'));var squel=require(_0xc616('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc616('0xc'));var toCsv=require(_0xc616('0x8'));var querystring=require('querystring');var Papa=require(_0xc616('0xd'));var Redis=require('ioredis');var authService=require(_0xc616('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc616('0xf'));var logger=require(_0xc616('0x10'))(_0xc616('0x11'));var utils=require('../../config/utils');var config=require(_0xc616('0x12'));var db=require('../../mysqldb')['db'];config[_0xc616('0x13')]=_[_0xc616('0x14')](config[_0xc616('0x13')],{'host':_0xc616('0x15'),'port':0x18eb});var socket=require(_0xc616('0x16'))(new Redis(config['redis']));require(_0xc616('0x17'))['register'](socket);function respondWithStatusCode(_0x17e829,_0x3958e9){_0x3958e9=_0x3958e9||0xcc;return function(_0x32854f){if(_0x32854f){return _0x17e829[_0xc616('0x18')](_0x3958e9);}return _0x17e829[_0xc616('0x19')](_0x3958e9)['end']();};}function respondWithResult(_0xa07335,_0x1738ff){_0x1738ff=_0x1738ff||0xc8;return function(_0x3ace46){if(_0x3ace46){return _0xa07335[_0xc616('0x19')](_0x1738ff)[_0xc616('0x1a')](_0x3ace46);}};}function respondWithFilteredResult(_0x186b34,_0x4af842){return function(_0x27c4d2){if(_0x27c4d2){var _0x5a8e8e=_0x27c4d2[_0xc616('0x1b')],_0x3d6ed8=_0x4af842['offset'],_0x3e5121=_0x4af842[_0xc616('0x1c')]+_0x4af842['limit'],_0x26c5c3;if(_0x3e5121>=_0x5a8e8e){_0x3e5121=_0x5a8e8e;_0x26c5c3=0xc8;}else{_0x26c5c3=0xce;}_0x186b34['status'](_0x26c5c3);return _0x186b34[_0xc616('0x1d')](_0xc616('0x1e'),_0x3d6ed8+'-'+_0x3e5121+'/'+_0x5a8e8e)[_0xc616('0x1a')](_0x27c4d2);}return null;};}function patchUpdates(_0xf51b1c){return function(_0x3e6053){try{jsonpatch[_0xc616('0x1f')](_0x3e6053,_0xf51b1c,!![]);}catch(_0x2a7506){return BPromise[_0xc616('0x20')](_0x2a7506);}return _0x3e6053[_0xc616('0x21')]();};}function saveUpdates(_0x461e40,_0x47ccd6){return function(_0x297993){if(_0x297993){return _0x297993['update'](_0x461e40)[_0xc616('0x22')](function(_0x1696b5){return _0x1696b5;});}return null;};}function removeEntity(_0x1828f3,_0x229cbd){return function(_0x54d94d){if(_0x54d94d){return _0x54d94d[_0xc616('0x23')]()[_0xc616('0x22')](function(){_0x1828f3[_0xc616('0x19')](0xcc)[_0xc616('0x24')]();});}};}function handleEntityNotFound(_0x108782,_0x4c15ee){return function(_0x28f9b1){if(!_0x28f9b1){_0x108782['sendStatus'](0x194);}return _0x28f9b1;};}function handleError(_0x32ff65,_0x5d10ff){_0x5d10ff=_0x5d10ff||0x1f4;return function(_0x246a98){logger[_0xc616('0x25')](_0x246a98['stack']);if(_0x246a98[_0xc616('0x26')]){delete _0x246a98[_0xc616('0x26')];}_0x32ff65[_0xc616('0x19')](_0x5d10ff)['send'](_0x246a98);};}function getInteractionUsers(_0x2f77a9,_0x4937f6){return new BPromise(function(_0xb1e98a,_0x2935e6){try{if(_0x4937f6[_0x2f77a9['id']]){_0x2f77a9[_0xc616('0x27')]=_[_0xc616('0x28')](_0x4937f6[_0x2f77a9['id']],function(_0x43786e){return{'id':_0x43786e['id'],'fullname':_0x43786e[_0xc616('0x29')]};});}}catch(_0x1ad3d8){_0x2935e6(_0x1ad3d8);}_0xb1e98a(_0x2f77a9);});}function getInteractionTags(_0x357b90,_0x404520){return new BPromise(function(_0x58686c,_0x3758e0){try{if(_0x357b90[_0xc616('0x2a')]){_0x357b90['Tags']=[];_0x357b90[_0xc616('0x2a')][_0xc616('0x2b')](',')[_0xc616('0x2c')](function(_0x648c7b){_0x357b90['Tags'][_0xc616('0x2d')](_0x404520[_0x648c7b]);});}delete _0x357b90['TagIds'];}catch(_0x4b1b60){_0x3758e0(_0x4b1b60);}_0x58686c(_0x357b90);});}function updateOpenchannelInteraction(_0x48b5ca,_0x555594,_0x36aed6){return new BPromise(function(_0xedb413,_0x14e53b){return getInteractionUsers(_0x48b5ca,_0x36aed6)[_0xc616('0x22')](function(_0x62c52e){return getInteractionTags(_0x62c52e,_0x555594);})[_0xc616('0x22')](function(_0x44c61){_0xedb413(_0x44c61);})[_0xc616('0x2e')](function(_0x3be8c2){_0x14e53b(_0x3be8c2);});});}exports[_0xc616('0x2f')]=function(_0x249c72,_0x12ed05){var _0x4c74de={},_0x54d0fe={},_0x4b4d5f={'count':0x0,'rows':[]};var _0xa64ee2=_[_0xc616('0x28')](db['OpenchannelInteraction']['rawAttributes'],function(_0x3e8960){return{'name':_0x3e8960['fieldName'],'type':_0x3e8960['type']['key']};});_0x54d0fe[_0xc616('0x30')]=_[_0xc616('0x28')](_0xa64ee2,'name');_0x54d0fe['query']=_[_0xc616('0x31')](_0x249c72[_0xc616('0x32')]);_0x54d0fe[_0xc616('0x33')]=_[_0xc616('0x34')](_0x54d0fe['model'],_0x54d0fe[_0xc616('0x32')]);_0x4c74de[_0xc616('0x35')]=_['intersection'](_0x54d0fe[_0xc616('0x30')],qs[_0xc616('0x36')](_0x249c72[_0xc616('0x32')]['fields']));_0x4c74de[_0xc616('0x35')]=_0x4c74de[_0xc616('0x35')][_0xc616('0x37')]?_0x4c74de[_0xc616('0x35')]:_0x54d0fe[_0xc616('0x30')];if(!_0x249c72[_0xc616('0x32')][_0xc616('0x38')](_0xc616('0x39'))){_0x4c74de[_0xc616('0x3a')]=qs[_0xc616('0x3a')](_0x249c72[_0xc616('0x32')][_0xc616('0x3a')]);_0x4c74de[_0xc616('0x1c')]=qs[_0xc616('0x1c')](_0x249c72[_0xc616('0x32')][_0xc616('0x1c')]);}_0x4c74de['order']=qs['sort'](_0x249c72[_0xc616('0x32')][_0xc616('0x3b')]);_0x4c74de[_0xc616('0x3c')]=qs[_0xc616('0x33')](_[_0xc616('0x3d')](_0x249c72[_0xc616('0x32')],_0x54d0fe[_0xc616('0x33')]),_0xa64ee2);var _0x11edc6=[];var _0x39c59f=squel[_0xc616('0x3e')]()[_0xc616('0x3f')]('id')['field'](_0xc616('0x26'))[_0xc616('0x3f')]('color')[_0xc616('0x40')](_0xc616('0x41'));var _0x432b99=squel[_0xc616('0x3e')]()[_0xc616('0x3f')](_0xc616('0x42'))['field']('u.fullname')[_0xc616('0x3f')](_0xc616('0x43'))[_0xc616('0x40')]('user_has_openchannel_interactions','ui')[_0xc616('0x44')](_0xc616('0x45'),'u','u.id\x20=\x20ui.UserId');var _0x4f77f0=squel[_0xc616('0x3e')]()[_0xc616('0x40')](_0xc616('0x46'),'i')['left_join'](_0xc616('0x47'),'c',_0xc616('0x48'))[_0xc616('0x44')]('users','o','o.id\x20=\x20i.UserId')['left_join']('openchannel_accounts','a',_0xc616('0x49'))[_0xc616('0x44')](_0xc616('0x4a'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xc616('0x44')]('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id')[_0xc616('0x44')](_0xc616('0x41'),'t','t.id\x20=\x20it.TagId');var _0x7bd030=squel[_0xc616('0x4b')]();var _0x1b2cf5=[];var _0x45bd98=squel[_0xc616('0x4b')]();var _0x4e3281;if(_0x249c72[_0xc616('0x32')][_0xc616('0x4c')]){_0x4e3281=as[_0xc616('0x4d')](_0x249c72[_0xc616('0x32')]['search']);var _0x140ffc=_0x4e3281[_0xc616('0x4e')];for(var _0x1130e2=0x0;_0x1130e2<_0x4e3281[_0xc616('0x4f')]['length'];_0x1130e2++){var _0x3519a4=_0x4e3281[_0xc616('0x4f')][_0x1130e2];var _0x1e9e2e='i';var _0x15adb7=_[_0xc616('0x50')](_0xa64ee2,[_0xc616('0x26'),_0x3519a4[_0xc616('0x3f')]]);if(!_0x15adb7){switch(_0x3519a4[_0xc616('0x3f')]){case _0xc616('0x51'):if(_0x3519a4['value']==0x1){_0x4f77f0['having']('`'+_0x3519a4[_0xc616('0x3f')]+'`\x20=\x200');}else{_0x4f77f0[_0xc616('0x52')]('`'+_0x3519a4[_0xc616('0x3f')]+_0xc616('0x53'));}break;case _0xc616('0x54'):if(_0x3519a4[_0xc616('0x55')]==='$substring'){if(_0x3519a4[_0xc616('0x56')]['split']('\x20')[_0xc616('0x37')]>0x1){_0x7bd030[_0x140ffc](_0xc616('0x57'),qs[_0xc616('0x58')](_0x3519a4[_0xc616('0x56')]),null);}else{var _0x3e49a5='%'+_0x3519a4[_0xc616('0x56')]+'%';_0x7bd030[_0x140ffc](_0xc616('0x59'),_0x3e49a5,_0x3e49a5,_0x3e49a5);}}else{_0x15adb7=_['find'](_0xa64ee2,[_0xc616('0x26'),_0xc616('0x5a')]);_0x3519a4['field']=_0xc616('0x5a');_0xd06aca=as[_0xc616('0x5b')](_0x1e9e2e,_0x15adb7['type'],_0x3519a4);_0x7bd030[_0x140ffc](_0xd06aca['text'],_0xd06aca[_0xc616('0x56')][_0xc616('0x5c')],_0xd06aca[_0xc616('0x56')][_0xc616('0x24')]);}break;case _0xc616('0x5d'):var _0x241ad8=_0x3519a4[_0xc616('0x56')]['split'](',')['map'](function(_0x3f8ebf){return Number(_0x3f8ebf);});_0x241ad8['forEach'](function(_0x2717be){_0x45bd98['or'](_0xc616('0x5e'),'%,'+_0x2717be+',%');});_0x1b2cf5=_['union'](_0x1b2cf5,_0x241ad8);break;case'User':if(_0x3519a4[_0xc616('0x55')]===_0xc616('0x5f')){_0x7bd030[_0x140ffc](_0xc616('0x60'),'%'+_0x3519a4['value']+'%',null);}else{_0x15adb7=_['find'](_0xa64ee2,['name',_0xc616('0x61')]);_0x3519a4[_0xc616('0x3f')]=_0xc616('0x61');_0xd06aca=as[_0xc616('0x5b')](_0x1e9e2e,_0x15adb7['type'],_0x3519a4);_0x7bd030[_0x140ffc](_0xd06aca[_0xc616('0x62')],_0xd06aca['value']['start'],_0xd06aca[_0xc616('0x56')][_0xc616('0x24')]);}break;case _0xc616('0x63'):_0xd06aca=as[_0xc616('0x5b')]('me',null,_0x3519a4);_0x7bd030[_0x140ffc](_0xd06aca[_0xc616('0x62')],_0xd06aca[_0xc616('0x56')][_0xc616('0x5c')],_0xd06aca['value'][_0xc616('0x24')]);break;}}else{var _0xd06aca=as[_0xc616('0x5b')](_0x1e9e2e,_0x15adb7[_0xc616('0x64')],_0x3519a4);_0x7bd030[_0x140ffc](_0xd06aca['text'],_0xd06aca[_0xc616('0x56')][_0xc616('0x5c')],_0xd06aca['value'][_0xc616('0x24')]);}}}else{var _0x1f376b=_(_0x249c72[_0xc616('0x32')])[_0xc616('0x31')]()[_0xc616('0x28')](function(_0x434476){return _['some'](_0xa64ee2,[_0xc616('0x26'),_0x434476])?_0x434476:undefined;})['compact']()[_0xc616('0x56')]();if(!_[_0xc616('0x65')](_0x1f376b)){_0x1f376b[_0xc616('0x2c')](function(_0x939e6e){if(_0x939e6e===_0xc616('0x66')){_0x4f77f0[_0xc616('0x3c')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x249c72[_0xc616('0x32')][_0x939e6e]));}else if(_0x939e6e===_0xc616('0x67')){var _0x10718c=JSON['parse'](_0x249c72[_0xc616('0x32')][_0x939e6e])[_0xc616('0x68')];var _0x4672d3=JSON[_0xc616('0x69')](_0x249c72[_0xc616('0x32')][_0x939e6e])[_0xc616('0x6a')];_0x4f77f0[_0xc616('0x3c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x10718c,_0x4672d3);}else{if(_0x249c72[_0xc616('0x32')][_0x939e6e]===_0xc616('0x6b')){_0x4f77f0[_0xc616('0x3c')]('i.'+_0x939e6e+_0xc616('0x6c'));}else{_0x4f77f0[_0xc616('0x3c')]('i.'+_0x939e6e+'\x20=\x20?',_0x249c72[_0xc616('0x32')][_0x939e6e]);}}});}if(_0x249c72[_0xc616('0x32')][_0xc616('0x6d')]){if(_0x249c72[_0xc616('0x32')][_0xc616('0x6d')]==0x1){_0x4f77f0[_0xc616('0x52')]('`unreadMessages`\x20=\x200');}else{_0x4f77f0[_0xc616('0x52')](_0xc616('0x6e'));}}if(_0x249c72[_0xc616('0x32')][_0xc616('0x6f')]){_0x1b2cf5=_['isArray'](_0x249c72['query'][_0xc616('0x6f')])?_0x249c72[_0xc616('0x32')]['tag']:new Array(_0x249c72[_0xc616('0x32')][_0xc616('0x6f')]);_0x1b2cf5['forEach'](function(_0x2991be){_0x45bd98['or'](_0xc616('0x5e'),'%,'+_0x2991be+',%');});}if(_0x249c72['query'][_0xc616('0x70')]){var _0x35dfb2=_0x249c72[_0xc616('0x32')][_0xc616('0x70')][_0xc616('0x71')]('\x5c','\x5c\x5c')[_0xc616('0x71')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xc616('0x72')](_0x35dfb2)){_0x7bd030['or'](_0xc616('0x73'),_0x35dfb2+'%');}else{_0x7bd030['or'](_0xc616('0x74'),qs[_0xc616('0x58')](_0x35dfb2))['or'](_0xc616('0x75'),_0x35dfb2+'%')['or'](_0xc616('0x76'),_0x35dfb2+'%');}}}_0x4f77f0['where'](_0x7bd030);_0x4f77f0[_0xc616('0x77')]('i.id');var _0x446a87={'type':db[_0xc616('0x78')][_0xc616('0x79')]['SELECT'],'raw':!![]};var _0x509600=_0x4f77f0['clone']();_0x509600['field'](_0xc616('0x7a'));_0x509600['field'](_0xc616('0x7b'),_0xc616('0x51'));if(_0x4c74de[_0xc616('0x7c')]){_0x4c74de[_0xc616('0x7c')][_0xc616('0x2c')](function(_0x408dce){_0x4f77f0[_0xc616('0x7c')]('i.'+_0x408dce[0x0],_0x408dce[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x1b2cf5)){_0x4f77f0[_0xc616('0x52')](_0x45bd98);_0x509600[_0xc616('0x3c')]('t.id\x20IN\x20?',_0x1b2cf5);}BPromise[_0xc616('0x7d')]()['then'](function(){if(!_0x4e3281){if(_0x249c72[_0xc616('0x32')]['OpenchannelAccountId']||_0x249c72['query'][_0xc616('0x7e')])return;_0x509600[_0xc616('0x3c')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x4f77f0['where'](_0xc616('0x7f'));return;}return _0x249c72[_0xc616('0x80')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xc616('0x22')](function(_0x5986d4){if(_[_0xc616('0x65')](_0x5986d4)){_0x509600[_0xc616('0x3c')](_0xc616('0x81'));_0x4f77f0[_0xc616('0x3c')](_0xc616('0x81'));}else{_0x509600[_0xc616('0x3c')](_0xc616('0x82'),_[_0xc616('0x28')](_0x5986d4,'id'));_0x4f77f0[_0xc616('0x3c')](_0xc616('0x82'),_[_0xc616('0x28')](_0x5986d4,'id'));}});})['then'](function(){db[_0xc616('0x83')][_0xc616('0x32')](_0x509600['toString'](),_0x446a87)[_0xc616('0x22')](function(_0x209b4a){_0x4b4d5f['count']=_0x209b4a[_0xc616('0x37')];if(_0x4b4d5f[_0xc616('0x1b')]===0x0)return[];return db['sequelize'][_0xc616('0x32')](_0x39c59f['toString'](),_0x446a87)[_0xc616('0x22')](function(_0x5e2ff7){_0x11edc6=_['keyBy'](_0x5e2ff7,'id');_0x446a87=_[_0xc616('0x84')](_0x446a87,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x249c72['query'][_0xc616('0x36')]){_0x4c74de[_0xc616('0x35')][_0xc616('0x2c')](function(_0x354c46){_0x4f77f0['field']('i.'+_0x354c46);});}else{_0x4f77f0['field'](_0xc616('0x7b'),'unreadMessages');_0x4f77f0[_0xc616('0x3f')](_0xc616('0x85'),'Account.key');_0x4f77f0[_0xc616('0x3f')](_0xc616('0x86'),_0xc616('0x87'));_0x4f77f0[_0xc616('0x3f')](_0xc616('0x88'));_0x4f77f0[_0xc616('0x3f')](_0xc616('0x89'),_0xc616('0x8a'));_0x4f77f0['field'](_0xc616('0x8b'),_0xc616('0x8c'));_0x4f77f0[_0xc616('0x3f')](_0xc616('0x8d'),'Contact.email');_0x4f77f0[_0xc616('0x3f')](_0xc616('0x8e'),_0xc616('0x8f'));_0x4f77f0[_0xc616('0x3f')](_0xc616('0x90'),'Contact.mobile');_0x4f77f0[_0xc616('0x3f')](_0xc616('0x91'),_0xc616('0x92'));_0x4f77f0[_0xc616('0x3f')](_0xc616('0x93'),'Owner.fullname');_0x4f77f0[_0xc616('0x3f')](_0xc616('0x94'),_0xc616('0x95'));_0x4f77f0[_0xc616('0x3f')](_0xc616('0x96'),_0xc616('0x2a'));}if(_0x4c74de[_0xc616('0x3a')])_0x4f77f0[_0xc616('0x3a')](_0x4c74de['limit']);if(_0x4c74de[_0xc616('0x1c')])_0x4f77f0[_0xc616('0x1c')](_0x4c74de['offset']);return db[_0xc616('0x83')][_0xc616('0x32')](_0x4f77f0[_0xc616('0x97')](),_0x446a87);})[_0xc616('0x22')](function(_0x1d45d7){_0x432b99[_0xc616('0x3c')](_0xc616('0x98'),_[_0xc616('0x28')](_0x1d45d7,'id'));return db[_0xc616('0x83')][_0xc616('0x32')](_0x432b99[_0xc616('0x97')](),_0x446a87)['then'](function(_0x5be9ba){var _0x12a21e=_[_0xc616('0x99')](_0x5be9ba,_0xc616('0x9a'));var _0x803f1d=[];_0x1d45d7[_0xc616('0x2c')](function(_0x58eada){_0x803f1d['push'](updateOpenchannelInteraction(_0x58eada,_0x11edc6,_0x12a21e));});return BPromise[_0xc616('0x9b')](_0x803f1d);});});})[_0xc616('0x22')](function(_0x2576c6){_0x4b4d5f[_0xc616('0x9c')]=_0x2576c6;return _0x4b4d5f;})['then'](respondWithFilteredResult(_0x12ed05,_0x4c74de));})[_0xc616('0x2e')](handleError(_0x12ed05,null));};exports[_0xc616('0x9d')]=function(_0x2bbc26,_0x40ce0b){var _0x34a087={'raw':![],'where':{'id':_0x2bbc26['params']['id']}},_0x56c2ac={};_0x56c2ac[_0xc616('0x30')]=_['keys'](db[_0xc616('0x9e')][_0xc616('0x9f')]);_0x56c2ac['query']=_[_0xc616('0x31')](_0x2bbc26[_0xc616('0x32')]);_0x56c2ac[_0xc616('0x33')]=_[_0xc616('0x34')](_0x56c2ac['model'],_0x56c2ac[_0xc616('0x32')]);_0x34a087[_0xc616('0x35')]=_['intersection'](_0x56c2ac[_0xc616('0x30')],qs['fields'](_0x2bbc26[_0xc616('0x32')]['fields']));_0x34a087[_0xc616('0x35')]=_0x34a087[_0xc616('0x35')][_0xc616('0x37')]?_0x34a087[_0xc616('0x35')]:_0x56c2ac[_0xc616('0x30')];if(_0x2bbc26['query'][_0xc616('0xa0')]){_0x34a087['include']=[{'all':!![]}];}_0x34a087=_[_0xc616('0x84')]({},_0x34a087,_0x2bbc26[_0xc616('0xa1')]);return db[_0xc616('0x9e')][_0xc616('0x50')](_0x34a087)[_0xc616('0x22')](handleEntityNotFound(_0x40ce0b,null))[_0xc616('0x22')](respondWithResult(_0x40ce0b,null))['catch'](handleError(_0x40ce0b,null));};exports['create']=function(_0x118a53,_0x1e2e90){return db[_0xc616('0x9e')][_0xc616('0xa2')](_0x118a53[_0xc616('0x63')],{})[_0xc616('0x22')](respondWithResult(_0x1e2e90,0xc9))['catch'](handleError(_0x1e2e90,null));};exports[_0xc616('0xa3')]=function(_0x14e0f3,_0xef549d){if(_0x14e0f3['body']['id']){delete _0x14e0f3[_0xc616('0x63')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x14e0f3['params']['id']}})[_0xc616('0x22')](handleEntityNotFound(_0xef549d,null))[_0xc616('0x22')](saveUpdates(_0x14e0f3['body'],null))['then'](respondWithResult(_0xef549d,null))[_0xc616('0x2e')](handleError(_0xef549d,null));};exports[_0xc616('0x23')]=function(_0xd86a49,_0x5be46b){return db[_0xc616('0x9e')]['find']({'where':{'id':_0xd86a49[_0xc616('0xa4')]['id']}})[_0xc616('0x22')](handleEntityNotFound(_0x5be46b,null))['then'](removeEntity(_0x5be46b,null))[_0xc616('0x2e')](handleError(_0x5be46b,null));};exports[_0xc616('0xa5')]=function(_0x22242e,_0x2888fb){return db[_0xc616('0x9e')][_0xc616('0xa5')]()[_0xc616('0x22')](respondWithResult(_0x2888fb,null))[_0xc616('0x2e')](handleError(_0x2888fb,null));};exports[_0xc616('0xa6')]=function(_0x245b55,_0x15973a,_0x4fd5dd){return db['OpenchannelMessage'][_0xc616('0x50')]({'where':{'id':_0x245b55['params']['id']}})[_0xc616('0x22')](handleEntityNotFound(_0x15973a,null))[_0xc616('0x22')](function(_0x5b6dfa){if(_0x5b6dfa){return _0x5b6dfa[_0xc616('0xa6')](_0x245b55[_0xc616('0x63')][_0xc616('0xa7')],_['omit'](_0x245b55[_0xc616('0x63')],[_0xc616('0xa7'),'id'])||{});}})[_0xc616('0x22')](respondWithResult(_0x15973a,null))[_0xc616('0x2e')](handleError(_0x15973a,null));};exports[_0xc616('0xa8')]=function(_0x5da110,_0x2d8ec3,_0x1fed6b){var _0x151df0={'raw':![],'where':{}};var _0x2382b5={};var _0x191164={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xc616('0xa9')]({'where':{'id':_0x5da110[_0xc616('0xa4')]['id']}})['then'](handleEntityNotFound(_0x2d8ec3,null))[_0xc616('0x22')](function(_0x259955){if(_0x259955){_0x2382b5[_0xc616('0x30')]=_['keys'](db[_0xc616('0xaa')][_0xc616('0x9f')]);_0x2382b5[_0xc616('0x32')]=_[_0xc616('0x31')](_0x5da110[_0xc616('0x32')]);_0x2382b5[_0xc616('0x33')]=_[_0xc616('0x34')](_0x2382b5['model'],_0x2382b5['query']);_0x151df0[_0xc616('0x35')]=_[_0xc616('0x34')](_0x2382b5[_0xc616('0x30')],qs['fields'](_0x5da110[_0xc616('0x32')][_0xc616('0x36')]));_0x151df0[_0xc616('0x35')]=_0x151df0['attributes']['length']?_0x151df0[_0xc616('0x35')]:_0x2382b5[_0xc616('0x30')];if(!_0x5da110[_0xc616('0x32')]['hasOwnProperty'](_0xc616('0x39'))){_0x151df0[_0xc616('0x3a')]=qs[_0xc616('0x3a')](_0x5da110[_0xc616('0x32')][_0xc616('0x3a')]);_0x151df0[_0xc616('0x1c')]=qs['offset'](_0x5da110[_0xc616('0x32')][_0xc616('0x1c')]);}_0x151df0[_0xc616('0x7c')]=qs[_0xc616('0x3b')](_0x5da110['query'][_0xc616('0x3b')]);_0x151df0['where']=qs['filters'](_[_0xc616('0x3d')](_0x5da110['query'],_0x2382b5[_0xc616('0x33')]));_0x151df0[_0xc616('0x3c')][_0xc616('0x9a')]=_0x259955['id'];if(_0x5da110[_0xc616('0x32')][_0xc616('0x70')]){_0x151df0['where']=_['merge'](_0x151df0[_0xc616('0x3c')],{'$or':_['map'](_0x151df0[_0xc616('0x35')],function(_0x172a11){var _0x29e4af={};_0x29e4af[_0x172a11]={'$like':'%'+_0x5da110[_0xc616('0x32')][_0xc616('0x70')]+'%'};return _0x29e4af;})});}if(_0x5da110[_0xc616('0x32')][_0xc616('0x68')]){var _0x267556=_0x5da110[_0xc616('0x32')]['$gte']['split'](',');var _0x1f0201={};_0x1f0201[_0x267556[0x0]]={'$gte':moment(_0x267556[0x1])[_0xc616('0xab')](_0xc616('0xac'))};_0x151df0[_0xc616('0x3c')]=_[_0xc616('0x84')](_0x151df0[_0xc616('0x3c')],_0x1f0201);}_0x151df0=_[_0xc616('0x84')]({},_0x151df0,_0x5da110[_0xc616('0xa1')]);return db['OpenchannelMessage'][_0xc616('0x1b')]({'where':_0x151df0['where']})[_0xc616('0x22')](function(_0x6d1955){_0x191164['count']=_0x6d1955;if(_0x5da110['query']['includeAll']){_0x151df0[_0xc616('0xad')]=[{'all':!![]}];}return db[_0xc616('0xaa')][_0xc616('0xae')](_0x151df0);})['then'](function(_0x208093){_0x191164['rows']=_0x208093;return _0x191164;});}})[_0xc616('0x22')](respondWithFilteredResult(_0x2d8ec3,_0x151df0))[_0xc616('0x2e')](handleError(_0x2d8ec3,null));};exports[_0xc616('0xaf')]=function(_0x4273d2,_0x3dc8c1,_0x32aa91){return db[_0xc616('0x9e')][_0xc616('0x50')]({'where':{'id':_0x4273d2[_0xc616('0xa4')]['id']}})[_0xc616('0x22')](handleEntityNotFound(_0x3dc8c1,null))[_0xc616('0x22')](function(_0x20a3e6){if(_0x20a3e6){return _0x20a3e6[_0xc616('0xb0')](_0x4273d2[_0xc616('0x63')][_0xc616('0xa7')],_[_0xc616('0xb1')](_0x4273d2[_0xc616('0x63')],[_0xc616('0xa7'),'id'])||{})['spread'](function(){return db[_0xc616('0x5d')][_0xc616('0xae')]({'attributes':['id',_0xc616('0x26'),_0xc616('0xb2')],'where':{'id':_0x4273d2[_0xc616('0x63')]['ids']}});})[_0xc616('0x22')](function(_0x1dd18c){socket['emit'](_0xc616('0xb3'),{'id':Number(_0x4273d2[_0xc616('0xa4')]['id']),'tags':_0x1dd18c||[]});return{'id':Number(_0x4273d2['params']['id']),'tags':_0x1dd18c||[]};});}})[_0xc616('0x22')](respondWithResult(_0x3dc8c1,null))['catch'](handleError(_0x3dc8c1,null));};exports['removeTags']=function(_0x2e73d2,_0x1fb4a8,_0x47abf8){return db[_0xc616('0x9e')]['find']({'where':{'id':_0x2e73d2[_0xc616('0xa4')]['id']}})[_0xc616('0x22')](handleEntityNotFound(_0x1fb4a8,null))[_0xc616('0x22')](function(_0x4b3f79){if(_0x4b3f79){return _0x4b3f79[_0xc616('0xb4')](_0x2e73d2[_0xc616('0x32')][_0xc616('0xa7')]);}})[_0xc616('0x22')](respondWithStatusCode(_0x1fb4a8,null))[_0xc616('0x2e')](handleError(_0x1fb4a8,null));};exports[_0xc616('0xb5')]=function(_0x50d63a,_0x2ecb88){var _0x4cf9bc=moment()[_0xc616('0xb6')]()['toString']();var _0x5152be=path['join'](config[_0xc616('0xb7')],_0xc616('0xb8'),'files',_0xc616('0xb9'));var _0x3d7fec=path[_0xc616('0xba')](config[_0xc616('0xb7')],_0xc616('0xb8'),_0xc616('0xbb'),_0xc616('0xbc'));var _0x201a4b=path[_0xc616('0xba')](_0x5152be,_0x4cf9bc);var _0x32a063=util[_0xc616('0xab')](_0xc616('0xbd'),_0x50d63a[_0xc616('0xa4')]['id'],_0x4cf9bc);var _0x4eefe8=path[_0xc616('0xba')](_0x5152be,_0x32a063);var _0x4d17a3=[];_0x4d17a3[_0xc616('0x2d')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x4d17a3[_0xc616('0x2d')]({'model':db['CmContact'],'as':_0xc616('0x54'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x50d63a[_0xc616('0x32')]['attachments']){_0x4d17a3[_0xc616('0x2d')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x390414=[{'model':db['OpenchannelMessage'],'as':_0xc616('0xbe'),'attributes':['id',_0xc616('0x63'),_0xc616('0x67'),_0xc616('0xbf'),_0xc616('0xc0'),_0xc616('0x6d')],'include':_0x4d17a3}];_0x390414[_0xc616('0x2d')]({'model':db[_0xc616('0xc1')],'as':_0xc616('0xc2'),'attributes':['id',_0xc616('0x26')]});_0x390414[_0xc616('0x2d')]({'model':db[_0xc616('0xc3')],'as':_0xc616('0xc4'),'attributes':['id',_0xc616('0x29')]});return db[_0xc616('0x9e')][_0xc616('0x50')]({'where':{'id':_0x50d63a['params']['id']},'include':_0x390414})[_0xc616('0x22')](handleEntityNotFound(_0x2ecb88,null))[_0xc616('0x22')](function(_0x32ff52){if(_0x32ff52){var _0x28c7b1=_0x32ff52['get']({'plain':!![]});fs[_0xc616('0xc5')](_0x201a4b);var _0x3511e3={'format':'A4','border':_0xc616('0xc6'),'header':{'height':_0xc616('0xc7'),'contents':{'first':_0xc616('0xc8')}},'footer':{'height':'30px','contents':{'default':util[_0xc616('0xab')](_0xc616('0xc9'),util[_0xc616('0xab')]('%s\x20#%d',_0xc616('0xca'),_0x28c7b1['id']),moment()[_0xc616('0xab')](_0xc616('0xcb'))['toString']())}}};var _0x43de42={'channel':_0xc616('0xca'),'account':_0x28c7b1[_0xc616('0xc2')][_0xc616('0x26')],'agent':_0x28c7b1[_0xc616('0xc4')]?_0x28c7b1[_0xc616('0xc4')][_0xc616('0x29')]:_0xc616('0xcc'),'createdAt':moment(_0x28c7b1[_0xc616('0x67')])['format'](_0xc616('0xac'))[_0xc616('0x97')](),'closedAt':_0x28c7b1[_0xc616('0xcd')]?moment(_0x28c7b1[_0xc616('0xce')])['format'](_0xc616('0xac'))[_0xc616('0x97')]():'','disposition':_0x28c7b1['disposition'],'visibility':_0x28c7b1[_0xc616('0xcf')]?_0xc616('0xd0'):_0xc616('0xd1'),'messages':_(_0x28c7b1['Messages'])[_0xc616('0x70')]({'secret':![]})[_0xc616('0x28')](function(_0x2fe8b6){if(_0x2fe8b6['Attachment']){var _0x86e929=path[_0xc616('0xba')](_0x3d7fec,_0x2fe8b6[_0xc616('0xd2')][_0xc616('0xd3')]);if(fs[_0xc616('0xd4')](_0x86e929)){fs[_0xc616('0xd5')](_0x86e929)[_0xc616('0xd6')](fs[_0xc616('0xd7')](path[_0xc616('0xba')](_0x201a4b,_0x2fe8b6[_0xc616('0xd2')][_0xc616('0xd3')])));}}return{'date':moment(_0x2fe8b6['createdAt'])['format'](_0xc616('0xac'))['toString'](),'sender':_0x2fe8b6[_0xc616('0xbf')]===_0xc616('0xd8')?_0x2fe8b6[_0xc616('0xc3')]?_0x2fe8b6[_0xc616('0xc3')][_0xc616('0x29')]:_0xc616('0xd9'):_0x2fe8b6['Contact'][_0xc616('0xda')]+(_0x2fe8b6[_0xc616('0x54')][_0xc616('0xdb')]?'\x20'+_0x2fe8b6[_0xc616('0x54')][_0xc616('0xdb')]:''),'body':_0x2fe8b6[_0xc616('0xd2')]?_0x2fe8b6['Attachment']['basename']:_0x2fe8b6[_0xc616('0x63')],'direction':_0x2fe8b6[_0xc616('0xbf')]==='out'?'A':'C','secret':_0x2fe8b6['secret'],'read':_0x2fe8b6['read'],'attachment':_0x2fe8b6['Attachment']};})['value']()};return ejs['renderFile'](path[_0xc616('0xba')](config[_0xc616('0xb7')],_0xc616('0xb8'),_0xc616('0xdc'),_0xc616('0xdd')),{'interaction':_0x43de42})[_0xc616('0x22')](function(_0x1b1e32){return new BPromise(function(_0xd47e6a,_0x4a87f3){pdf[_0xc616('0xa2')](_0x1b1e32,_0x3511e3)['toFile'](path[_0xc616('0xba')](_0x201a4b,_0xc616('0xde')+_0x28c7b1['id']+'-'+_0x4cf9bc+_0xc616('0xdf')),function(_0x1f30b7,_0x111565){if(_0x1f30b7)return _0x4a87f3(_0x1f30b7);_0xd47e6a(_0x111565);});});})['then'](function(){return new BPromise(function(_0x22e03e,_0x1083f1){zipdir(_0x201a4b,{'saveTo':_0x4eefe8},function(_0x305898,_0x3bd1c7){if(_0x305898)return _0x1083f1(_0x305898);return _0x22e03e(_0x3bd1c7);});})[_0xc616('0x22')](function(){return new BPromise(function(_0x5155c9,_0x3e256e){rimraf(_0x201a4b,function(_0x567784){if(_0x567784)_0x3e256e(_0x567784);return _0x5155c9();});});})[_0xc616('0x22')](function(){return _0x2ecb88['download'](_0x4eefe8,_0x32a063,function(_0xa52838){if(_0xa52838){console[_0xc616('0xe0')]('err',_0xa52838);}else{fs['unlinkSync'](_0x4eefe8);}});});});}else{return _0x2ecb88[_0xc616('0x18')](0xc8);}})[_0xc616('0x2e')](handleError(_0x2ecb88,null));};
\ No newline at end of file
+var _0x0cad=['ContactId','buildExpression','text','start','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','DESC','isEmpty','t.id\x20IN\x20?','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','show','params','includeAll','options','catch','create','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','OpenchannelInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','openchannelInteractionTags:save','removeTags','unix','root','server','files','attachments','join','format','transcript-%d-%s.zip','Contact','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','10px','40px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','30px','<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','%s\x20#%d','Openchannel','YYYY-MM-DD','closedAt','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','renderFile','views','downloadInteraction.html','toFile','.pdf','download','log','unlinkSync','html-pdf','eml-format','rimraf','moment','util','path','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','stack','name','Users','fullname','TagIds','Tags','split','push','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','u.id\x20=\x20ui.UserId','cm_contacts','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?'];(function(_0x3c11dd,_0x342a12){var _0x3312ff=function(_0x522c17){while(--_0x522c17){_0x3c11dd['push'](_0x3c11dd['shift']());}};_0x3312ff(++_0x342a12);}(_0x0cad,0x8c));var _0xd0ca=function(_0x4494bd,_0x5d4c66){_0x4494bd=_0x4494bd-0x0;var _0x49ede9=_0x0cad[_0x4494bd];return _0x49ede9;};'use strict';var pdf=require(_0xd0ca('0x0'));var emlformat=require(_0xd0ca('0x1'));var rimraf=require(_0xd0ca('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd0ca('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd0ca('0x4'));var path=require(_0xd0ca('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd0ca('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd0ca('0x7'));var crypto=require(_0xd0ca('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xd0ca('0x9'));var toCsv=require(_0xd0ca('0xa'));var querystring=require(_0xd0ca('0xb'));var Papa=require(_0xd0ca('0xc'));var Redis=require(_0xd0ca('0xd'));var authService=require(_0xd0ca('0xe'));var qs=require(_0xd0ca('0xf'));var as=require(_0xd0ca('0x10'));var hardwareService=require(_0xd0ca('0x11'));var logger=require(_0xd0ca('0x12'))(_0xd0ca('0x13'));var utils=require(_0xd0ca('0x14'));var config=require(_0xd0ca('0x15'));var db=require(_0xd0ca('0x16'))['db'];config['redis']=_[_0xd0ca('0x17')](config['redis'],{'host':_0xd0ca('0x18'),'port':0x18eb});var socket=require(_0xd0ca('0x19'))(new Redis(config['redis']));require(_0xd0ca('0x1a'))[_0xd0ca('0x1b')](socket);function respondWithStatusCode(_0x28fb24,_0x2a90cc){_0x2a90cc=_0x2a90cc||0xcc;return function(_0x597d4f){if(_0x597d4f){return _0x28fb24['sendStatus'](_0x2a90cc);}return _0x28fb24[_0xd0ca('0x1c')](_0x2a90cc)[_0xd0ca('0x1d')]();};}function respondWithResult(_0x2c556d,_0x3783d1){_0x3783d1=_0x3783d1||0xc8;return function(_0x11ea37){if(_0x11ea37){return _0x2c556d[_0xd0ca('0x1c')](_0x3783d1)['json'](_0x11ea37);}};}function respondWithFilteredResult(_0x1d95be,_0x4c3d1f){return function(_0x5a7f41){if(_0x5a7f41){var _0x2e1ef5=_0x5a7f41[_0xd0ca('0x1e')],_0x2eaacb=_0x4c3d1f[_0xd0ca('0x1f')],_0x3063b9=_0x4c3d1f[_0xd0ca('0x1f')]+_0x4c3d1f[_0xd0ca('0x20')],_0xb8cfc2;if(_0x3063b9>=_0x2e1ef5){_0x3063b9=_0x2e1ef5;_0xb8cfc2=0xc8;}else{_0xb8cfc2=0xce;}_0x1d95be[_0xd0ca('0x1c')](_0xb8cfc2);return _0x1d95be[_0xd0ca('0x21')](_0xd0ca('0x22'),_0x2eaacb+'-'+_0x3063b9+'/'+_0x2e1ef5)[_0xd0ca('0x23')](_0x5a7f41);}return null;};}function patchUpdates(_0x458b4c){return function(_0xfb1964){try{jsonpatch[_0xd0ca('0x24')](_0xfb1964,_0x458b4c,!![]);}catch(_0x13f56a){return BPromise[_0xd0ca('0x25')](_0x13f56a);}return _0xfb1964[_0xd0ca('0x26')]();};}function saveUpdates(_0x53aee2,_0x431eff){return function(_0xdac5a7){if(_0xdac5a7){return _0xdac5a7[_0xd0ca('0x27')](_0x53aee2)['then'](function(_0x5dc426){return _0x5dc426;});}return null;};}function removeEntity(_0x28074d,_0xab9f74){return function(_0x2074e0){if(_0x2074e0){return _0x2074e0[_0xd0ca('0x28')]()[_0xd0ca('0x29')](function(){_0x28074d[_0xd0ca('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481c,_0x53b6b2){return function(_0x532a95){if(!_0x532a95){_0x481c[_0xd0ca('0x2a')](0x194);}return _0x532a95;};}function handleError(_0x290f85,_0x5cdea7){_0x5cdea7=_0x5cdea7||0x1f4;return function(_0x20b84a){logger['error'](_0x20b84a[_0xd0ca('0x2b')]);if(_0x20b84a['name']){delete _0x20b84a[_0xd0ca('0x2c')];}_0x290f85[_0xd0ca('0x1c')](_0x5cdea7)['send'](_0x20b84a);};}function getInteractionUsers(_0x338e83,_0x4f50b1){return new BPromise(function(_0x1e7fcd,_0x5f3700){try{if(_0x4f50b1[_0x338e83['id']]){_0x338e83[_0xd0ca('0x2d')]=_['map'](_0x4f50b1[_0x338e83['id']],function(_0x1bc10d){return{'id':_0x1bc10d['id'],'fullname':_0x1bc10d[_0xd0ca('0x2e')]};});}}catch(_0x2c3bbb){_0x5f3700(_0x2c3bbb);}_0x1e7fcd(_0x338e83);});}function getInteractionTags(_0x2c0c6c,_0xd890c1){return new BPromise(function(_0x4be0b9,_0x5c9314){try{if(_0x2c0c6c[_0xd0ca('0x2f')]){_0x2c0c6c[_0xd0ca('0x30')]=[];_0x2c0c6c[_0xd0ca('0x2f')][_0xd0ca('0x31')](',')['forEach'](function(_0x1f297a){_0x2c0c6c[_0xd0ca('0x30')][_0xd0ca('0x32')](_0xd890c1[_0x1f297a]);});}delete _0x2c0c6c[_0xd0ca('0x2f')];}catch(_0x33dc85){_0x5c9314(_0x33dc85);}_0x4be0b9(_0x2c0c6c);});}function updateOpenchannelInteraction(_0x47d6ca,_0x155629,_0x5ce26b){return new BPromise(function(_0xaf38e2,_0x1fefaf){return getInteractionUsers(_0x47d6ca,_0x5ce26b)[_0xd0ca('0x29')](function(_0x6a028c){return getInteractionTags(_0x6a028c,_0x155629);})[_0xd0ca('0x29')](function(_0x2d0042){_0xaf38e2(_0x2d0042);})['catch'](function(_0x2eceb3){_0x1fefaf(_0x2eceb3);});});}exports[_0xd0ca('0x33')]=function(_0x3116a6,_0x21c9bc){var _0x43c6fc={},_0x43d8d7={},_0x52afde={'count':0x0,'rows':[]};var _0x1f9f36=_[_0xd0ca('0x34')](db[_0xd0ca('0x35')][_0xd0ca('0x36')],function(_0x316b7f){return{'name':_0x316b7f[_0xd0ca('0x37')],'type':_0x316b7f[_0xd0ca('0x38')][_0xd0ca('0x39')]};});_0x43d8d7['model']=_[_0xd0ca('0x34')](_0x1f9f36,_0xd0ca('0x2c'));_0x43d8d7['query']=_[_0xd0ca('0x3a')](_0x3116a6[_0xd0ca('0x3b')]);_0x43d8d7[_0xd0ca('0x3c')]=_[_0xd0ca('0x3d')](_0x43d8d7['model'],_0x43d8d7[_0xd0ca('0x3b')]);_0x43c6fc['attributes']=_[_0xd0ca('0x3d')](_0x43d8d7[_0xd0ca('0x3e')],qs[_0xd0ca('0x3f')](_0x3116a6[_0xd0ca('0x3b')][_0xd0ca('0x3f')]));_0x43c6fc[_0xd0ca('0x40')]=_0x43c6fc[_0xd0ca('0x40')][_0xd0ca('0x41')]?_0x43c6fc[_0xd0ca('0x40')]:_0x43d8d7['model'];if(!_0x3116a6[_0xd0ca('0x3b')][_0xd0ca('0x42')](_0xd0ca('0x43'))){_0x43c6fc[_0xd0ca('0x20')]=qs[_0xd0ca('0x20')](_0x3116a6[_0xd0ca('0x3b')][_0xd0ca('0x20')]);_0x43c6fc[_0xd0ca('0x1f')]=qs[_0xd0ca('0x1f')](_0x3116a6['query'][_0xd0ca('0x1f')]);}_0x43c6fc[_0xd0ca('0x44')]=qs[_0xd0ca('0x45')](_0x3116a6[_0xd0ca('0x3b')]['sort']);_0x43c6fc[_0xd0ca('0x46')]=qs[_0xd0ca('0x3c')](_[_0xd0ca('0x47')](_0x3116a6[_0xd0ca('0x3b')],_0x43d8d7['filters']),_0x1f9f36);var _0x290fe3=[];var _0x191be9=squel[_0xd0ca('0x48')]()['field']('id')[_0xd0ca('0x49')](_0xd0ca('0x2c'))[_0xd0ca('0x49')](_0xd0ca('0x4a'))[_0xd0ca('0x4b')]('tools_tags');var _0xd0dc34=squel[_0xd0ca('0x48')]()[_0xd0ca('0x49')](_0xd0ca('0x4c'))[_0xd0ca('0x49')](_0xd0ca('0x4d'))[_0xd0ca('0x49')](_0xd0ca('0x4e'))['from']('user_has_openchannel_interactions','ui')[_0xd0ca('0x4f')]('users','u',_0xd0ca('0x50'));var _0x3bb346=squel[_0xd0ca('0x48')]()[_0xd0ca('0x4b')]('openchannel_interactions','i')['left_join'](_0xd0ca('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xd0ca('0x52'),'o',_0xd0ca('0x53'))[_0xd0ca('0x4f')](_0xd0ca('0x54'),'a',_0xd0ca('0x55'))['left_join'](_0xd0ca('0x56'),'me',_0xd0ca('0x57'))['left_join']('openchannel_interaction_has_tags','it',_0xd0ca('0x58'))[_0xd0ca('0x4f')]('tools_tags','t',_0xd0ca('0x59'));var _0x1f4e66=squel[_0xd0ca('0x5a')]();var _0x8b75ea=[];var _0x530d19=squel['expr']();var _0x532542;if(_0x3116a6[_0xd0ca('0x3b')][_0xd0ca('0x5b')]){_0x532542=as[_0xd0ca('0x5c')](_0x3116a6[_0xd0ca('0x3b')][_0xd0ca('0x5b')]);var _0x4152b9=_0x532542[_0xd0ca('0x5d')];for(var _0x584635=0x0;_0x584635<_0x532542[_0xd0ca('0x5e')]['length'];_0x584635++){var _0x5672f7=_0x532542[_0xd0ca('0x5e')][_0x584635];var _0x3ee3dd='i';var _0x45ab37=_[_0xd0ca('0x5f')](_0x1f9f36,[_0xd0ca('0x2c'),_0x5672f7['field']]);if(!_0x45ab37){switch(_0x5672f7[_0xd0ca('0x49')]){case'unreadMessages':if(_0x5672f7[_0xd0ca('0x60')]==0x1){_0x3bb346['having']('`'+_0x5672f7[_0xd0ca('0x49')]+_0xd0ca('0x61'));}else{_0x3bb346['having']('`'+_0x5672f7[_0xd0ca('0x49')]+_0xd0ca('0x62'));}break;case'Contact':if(_0x5672f7[_0xd0ca('0x63')]===_0xd0ca('0x64')){if(_0x5672f7['value']['split']('\x20')[_0xd0ca('0x41')]>0x1){_0x1f4e66[_0x4152b9](_0xd0ca('0x65'),qs[_0xd0ca('0x66')](_0x5672f7[_0xd0ca('0x60')]),null);}else{var _0x75f685='%'+_0x5672f7[_0xd0ca('0x60')]+'%';_0x1f4e66[_0x4152b9](_0xd0ca('0x67'),_0x75f685,_0x75f685,_0x75f685);}}else{_0x45ab37=_['find'](_0x1f9f36,[_0xd0ca('0x2c'),_0xd0ca('0x68')]);_0x5672f7[_0xd0ca('0x49')]=_0xd0ca('0x68');_0x3b45e9=as[_0xd0ca('0x69')](_0x3ee3dd,_0x45ab37[_0xd0ca('0x38')],_0x5672f7);_0x1f4e66[_0x4152b9](_0x3b45e9[_0xd0ca('0x6a')],_0x3b45e9['value'][_0xd0ca('0x6b')],_0x3b45e9[_0xd0ca('0x60')][_0xd0ca('0x1d')]);}break;case'Tag':var _0x3d3c08=_0x5672f7[_0xd0ca('0x60')][_0xd0ca('0x31')](',')[_0xd0ca('0x34')](function(_0x447be2){return Number(_0x447be2);});_0x3d3c08[_0xd0ca('0x6c')](function(_0xfcc379){_0x530d19['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xfcc379+',%');});_0x8b75ea=_[_0xd0ca('0x6d')](_0x8b75ea,_0x3d3c08);break;case _0xd0ca('0x6e'):if(_0x5672f7[_0xd0ca('0x63')]===_0xd0ca('0x64')){_0x1f4e66[_0x4152b9](_0xd0ca('0x6f'),'%'+_0x5672f7[_0xd0ca('0x60')]+'%',null);}else{_0x45ab37=_[_0xd0ca('0x5f')](_0x1f9f36,[_0xd0ca('0x2c'),_0xd0ca('0x70')]);_0x5672f7[_0xd0ca('0x49')]=_0xd0ca('0x70');_0x3b45e9=as[_0xd0ca('0x69')](_0x3ee3dd,_0x45ab37[_0xd0ca('0x38')],_0x5672f7);_0x1f4e66[_0x4152b9](_0x3b45e9[_0xd0ca('0x6a')],_0x3b45e9[_0xd0ca('0x60')][_0xd0ca('0x6b')],_0x3b45e9['value']['end']);}break;case _0xd0ca('0x71'):_0x3b45e9=as['buildExpression']('me',null,_0x5672f7);_0x1f4e66[_0x4152b9](_0x3b45e9[_0xd0ca('0x6a')],_0x3b45e9[_0xd0ca('0x60')][_0xd0ca('0x6b')],_0x3b45e9[_0xd0ca('0x60')][_0xd0ca('0x1d')]);break;}}else{var _0x3b45e9=as['buildExpression'](_0x3ee3dd,_0x45ab37[_0xd0ca('0x38')],_0x5672f7);_0x1f4e66[_0x4152b9](_0x3b45e9[_0xd0ca('0x6a')],_0x3b45e9[_0xd0ca('0x60')][_0xd0ca('0x6b')],_0x3b45e9[_0xd0ca('0x60')][_0xd0ca('0x1d')]);}}}else{var _0x273027=_(_0x3116a6['query'])[_0xd0ca('0x3a')]()[_0xd0ca('0x34')](function(_0x3c349e){return _[_0xd0ca('0x72')](_0x1f9f36,[_0xd0ca('0x2c'),_0x3c349e])?_0x3c349e:undefined;})[_0xd0ca('0x73')]()[_0xd0ca('0x60')]();if(!_['isEmpty'](_0x273027)){_0x273027[_0xd0ca('0x6c')](function(_0x2e8e9f){if(_0x2e8e9f===_0xd0ca('0x74')){_0x3bb346[_0xd0ca('0x46')](_0xd0ca('0x75'),[][_0xd0ca('0x76')](_0x3116a6[_0xd0ca('0x3b')][_0x2e8e9f]));}else if(_0x2e8e9f===_0xd0ca('0x77')){var _0x4e1649=JSON[_0xd0ca('0x78')](_0x3116a6[_0xd0ca('0x3b')][_0x2e8e9f])['$gte'];var _0x12f976=JSON[_0xd0ca('0x78')](_0x3116a6[_0xd0ca('0x3b')][_0x2e8e9f])['$lte'];_0x3bb346[_0xd0ca('0x46')](_0xd0ca('0x79'),_0x4e1649,_0x12f976);}else{if(_0x3116a6[_0xd0ca('0x3b')][_0x2e8e9f]==='null'){_0x3bb346['where']('i.'+_0x2e8e9f+_0xd0ca('0x7a'));}else{_0x3bb346[_0xd0ca('0x46')]('i.'+_0x2e8e9f+_0xd0ca('0x7b'),_0x3116a6[_0xd0ca('0x3b')][_0x2e8e9f]);}}});}if(_0x3116a6[_0xd0ca('0x3b')][_0xd0ca('0x7c')]){if(_0x3116a6[_0xd0ca('0x3b')][_0xd0ca('0x7c')]==0x1){_0x3bb346[_0xd0ca('0x7d')](_0xd0ca('0x7e'));}else{_0x3bb346[_0xd0ca('0x7d')]('`unreadMessages`\x20>\x200');}}if(_0x3116a6[_0xd0ca('0x3b')]['tag']){_0x8b75ea=_[_0xd0ca('0x7f')](_0x3116a6[_0xd0ca('0x3b')][_0xd0ca('0x80')])?_0x3116a6[_0xd0ca('0x3b')][_0xd0ca('0x80')]:new Array(_0x3116a6['query']['tag']);_0x8b75ea[_0xd0ca('0x6c')](function(_0x5198d8){_0x530d19['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5198d8+',%');});}if(_0x3116a6['query'][_0xd0ca('0x81')]){var _0x5e6018=_0x3116a6[_0xd0ca('0x3b')][_0xd0ca('0x81')]['replace']('\x5c','\x5c\x5c')[_0xd0ca('0x82')]('\x27\x27',_0xd0ca('0x83'));if(qs[_0xd0ca('0x84')](_0x5e6018)){_0x1f4e66['or'](_0xd0ca('0x85'),_0x5e6018+'%');}else{_0x1f4e66['or'](_0xd0ca('0x86'),qs[_0xd0ca('0x66')](_0x5e6018))['or'](_0xd0ca('0x87'),_0x5e6018+'%')['or'](_0xd0ca('0x88'),_0x5e6018+'%');}}}_0x3bb346['where'](_0x1f4e66);_0x3bb346[_0xd0ca('0x89')](_0xd0ca('0x8a'));var _0x56e232={'type':db[_0xd0ca('0x8b')][_0xd0ca('0x8c')]['SELECT'],'raw':!![]};var _0x57c4a6=_0x3bb346[_0xd0ca('0x8d')]();_0x57c4a6[_0xd0ca('0x49')](_0xd0ca('0x8a'));_0x57c4a6[_0xd0ca('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x43c6fc['order']){_0x43c6fc['order']['forEach'](function(_0x1e53fa){_0x3bb346[_0xd0ca('0x44')]('i.'+_0x1e53fa[0x0],_0x1e53fa[0x1]===_0xd0ca('0x8e')?![]:!![]);});}if(!_[_0xd0ca('0x8f')](_0x8b75ea)){_0x3bb346['having'](_0x530d19);_0x57c4a6[_0xd0ca('0x46')](_0xd0ca('0x90'),_0x8b75ea);}BPromise[_0xd0ca('0x91')]()[_0xd0ca('0x29')](function(){if(!_0x532542){if(_0x3116a6[_0xd0ca('0x3b')][_0xd0ca('0x74')]||_0x3116a6[_0xd0ca('0x3b')][_0xd0ca('0x92')])return;_0x57c4a6[_0xd0ca('0x46')](_0xd0ca('0x93'));_0x3bb346[_0xd0ca('0x46')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3116a6[_0xd0ca('0x94')][_0xd0ca('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x49edb0){if(_['isEmpty'](_0x49edb0)){_0x57c4a6[_0xd0ca('0x46')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x3bb346[_0xd0ca('0x46')](_0xd0ca('0x96'));}else{_0x57c4a6[_0xd0ca('0x46')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xd0ca('0x34')](_0x49edb0,'id'));_0x3bb346[_0xd0ca('0x46')](_0xd0ca('0x75'),_[_0xd0ca('0x34')](_0x49edb0,'id'));}});})['then'](function(){db[_0xd0ca('0x97')][_0xd0ca('0x3b')](_0x57c4a6[_0xd0ca('0x98')](),_0x56e232)[_0xd0ca('0x29')](function(_0x1a3aa1){_0x52afde['count']=_0x1a3aa1[_0xd0ca('0x41')];if(_0x52afde[_0xd0ca('0x1e')]===0x0)return[];return db[_0xd0ca('0x97')]['query'](_0x191be9['toString'](),_0x56e232)[_0xd0ca('0x29')](function(_0x4d8641){_0x290fe3=_['keyBy'](_0x4d8641,'id');_0x56e232=_[_0xd0ca('0x99')](_0x56e232,{'model':db[_0xd0ca('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3116a6['query'][_0xd0ca('0x3f')]){_0x43c6fc['attributes'][_0xd0ca('0x6c')](function(_0xca7257){_0x3bb346[_0xd0ca('0x49')]('i.'+_0xca7257);});}else{_0x3bb346[_0xd0ca('0x49')](_0xd0ca('0x9a'),_0xd0ca('0x9b'));_0x3bb346[_0xd0ca('0x49')](_0xd0ca('0x9c'),_0xd0ca('0x9d'));_0x3bb346['field'](_0xd0ca('0x9e'),'Account.mandatoryDisposition');_0x3bb346[_0xd0ca('0x49')](_0xd0ca('0x9f'));_0x3bb346['field'](_0xd0ca('0xa0'),_0xd0ca('0xa1'));_0x3bb346['field'](_0xd0ca('0xa2'),_0xd0ca('0xa3'));_0x3bb346['field'](_0xd0ca('0xa4'),'Contact.email');_0x3bb346['field'](_0xd0ca('0xa5'),_0xd0ca('0xa6'));_0x3bb346['field']('c.mobile',_0xd0ca('0xa7'));_0x3bb346[_0xd0ca('0x49')]('c.fax',_0xd0ca('0xa8'));_0x3bb346[_0xd0ca('0x49')](_0xd0ca('0xa9'),_0xd0ca('0xaa'));_0x3bb346[_0xd0ca('0x49')](_0xd0ca('0xab'),_0xd0ca('0xac'));_0x3bb346[_0xd0ca('0x49')](_0xd0ca('0xad'),_0xd0ca('0x2f'));}if(_0x43c6fc[_0xd0ca('0x20')])_0x3bb346[_0xd0ca('0x20')](_0x43c6fc['limit']);if(_0x43c6fc[_0xd0ca('0x1f')])_0x3bb346['offset'](_0x43c6fc['offset']);return db[_0xd0ca('0x97')][_0xd0ca('0x3b')](_0x3bb346[_0xd0ca('0x98')](),_0x56e232);})[_0xd0ca('0x29')](function(_0x3da3ee){_0xd0dc34[_0xd0ca('0x46')]('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x3da3ee,'id'));return db[_0xd0ca('0x97')][_0xd0ca('0x3b')](_0xd0dc34[_0xd0ca('0x98')](),_0x56e232)['then'](function(_0x1db646){var _0x1e806c=_[_0xd0ca('0xae')](_0x1db646,'OpenchannelInteractionId');var _0x5967b6=[];_0x3da3ee[_0xd0ca('0x6c')](function(_0x82cd31){_0x5967b6[_0xd0ca('0x32')](updateOpenchannelInteraction(_0x82cd31,_0x290fe3,_0x1e806c));});return BPromise[_0xd0ca('0xaf')](_0x5967b6);});});})[_0xd0ca('0x29')](function(_0x4ccaa0){_0x52afde['rows']=_0x4ccaa0;return _0x52afde;})[_0xd0ca('0x29')](respondWithFilteredResult(_0x21c9bc,_0x43c6fc));})['catch'](handleError(_0x21c9bc,null));};exports[_0xd0ca('0xb0')]=function(_0x1503d9,_0x51e319){var _0x12c27b={'raw':![],'where':{'id':_0x1503d9[_0xd0ca('0xb1')]['id']}},_0x46fc8b={};_0x46fc8b[_0xd0ca('0x3e')]=_[_0xd0ca('0x3a')](db['OpenchannelInteraction'][_0xd0ca('0x36')]);_0x46fc8b['query']=_[_0xd0ca('0x3a')](_0x1503d9[_0xd0ca('0x3b')]);_0x46fc8b[_0xd0ca('0x3c')]=_[_0xd0ca('0x3d')](_0x46fc8b[_0xd0ca('0x3e')],_0x46fc8b[_0xd0ca('0x3b')]);_0x12c27b[_0xd0ca('0x40')]=_[_0xd0ca('0x3d')](_0x46fc8b[_0xd0ca('0x3e')],qs[_0xd0ca('0x3f')](_0x1503d9[_0xd0ca('0x3b')][_0xd0ca('0x3f')]));_0x12c27b['attributes']=_0x12c27b[_0xd0ca('0x40')]['length']?_0x12c27b[_0xd0ca('0x40')]:_0x46fc8b[_0xd0ca('0x3e')];if(_0x1503d9['query'][_0xd0ca('0xb2')]){_0x12c27b['include']=[{'all':!![]}];}_0x12c27b=_['merge']({},_0x12c27b,_0x1503d9[_0xd0ca('0xb3')]);return db[_0xd0ca('0x35')]['find'](_0x12c27b)['then'](handleEntityNotFound(_0x51e319,null))[_0xd0ca('0x29')](respondWithResult(_0x51e319,null))[_0xd0ca('0xb4')](handleError(_0x51e319,null));};exports[_0xd0ca('0xb5')]=function(_0x3ab9ba,_0x1563c8){return db[_0xd0ca('0x35')]['create'](_0x3ab9ba['body'],{})[_0xd0ca('0x29')](respondWithResult(_0x1563c8,0xc9))[_0xd0ca('0xb4')](handleError(_0x1563c8,null));};exports['update']=function(_0xd732d6,_0x40e07b){if(_0xd732d6[_0xd0ca('0x71')]['id']){delete _0xd732d6['body']['id'];}return db['OpenchannelInteraction'][_0xd0ca('0x5f')]({'where':{'id':_0xd732d6[_0xd0ca('0xb1')]['id']}})[_0xd0ca('0x29')](handleEntityNotFound(_0x40e07b,null))['then'](saveUpdates(_0xd732d6['body'],null))[_0xd0ca('0x29')](respondWithResult(_0x40e07b,null))[_0xd0ca('0xb4')](handleError(_0x40e07b,null));};exports[_0xd0ca('0x28')]=function(_0x23d04c,_0xd831e6){return db[_0xd0ca('0x35')][_0xd0ca('0x5f')]({'where':{'id':_0x23d04c[_0xd0ca('0xb1')]['id']}})[_0xd0ca('0x29')](handleEntityNotFound(_0xd831e6,null))['then'](removeEntity(_0xd831e6,null))['catch'](handleError(_0xd831e6,null));};exports[_0xd0ca('0xb6')]=function(_0x318189,_0x18bb9c){return db['OpenchannelInteraction'][_0xd0ca('0xb6')]()[_0xd0ca('0x29')](respondWithResult(_0x18bb9c,null))['catch'](handleError(_0x18bb9c,null));};exports[_0xd0ca('0xb7')]=function(_0x544681,_0x5ca4eb,_0xc5ba6c){return db[_0xd0ca('0xb8')][_0xd0ca('0x5f')]({'where':{'id':_0x544681[_0xd0ca('0xb1')]['id']}})[_0xd0ca('0x29')](handleEntityNotFound(_0x5ca4eb,null))[_0xd0ca('0x29')](function(_0x222649){if(_0x222649){return _0x222649[_0xd0ca('0xb7')](_0x544681['body']['ids'],_[_0xd0ca('0xb9')](_0x544681[_0xd0ca('0x71')],[_0xd0ca('0xba'),'id'])||{});}})[_0xd0ca('0x29')](respondWithResult(_0x5ca4eb,null))[_0xd0ca('0xb4')](handleError(_0x5ca4eb,null));};exports[_0xd0ca('0xbb')]=function(_0x4a4043,_0x2174ab,_0x198278){var _0x21eb9e={'raw':![],'where':{}};var _0x52ffea={};var _0x48b921={'count':0x0,'rows':[]};return db[_0xd0ca('0x35')]['findOne']({'where':{'id':_0x4a4043['params']['id']}})[_0xd0ca('0x29')](handleEntityNotFound(_0x2174ab,null))[_0xd0ca('0x29')](function(_0x2c0af0){if(_0x2c0af0){_0x52ffea[_0xd0ca('0x3e')]=_[_0xd0ca('0x3a')](db[_0xd0ca('0xb8')][_0xd0ca('0x36')]);_0x52ffea['query']=_[_0xd0ca('0x3a')](_0x4a4043[_0xd0ca('0x3b')]);_0x52ffea[_0xd0ca('0x3c')]=_[_0xd0ca('0x3d')](_0x52ffea[_0xd0ca('0x3e')],_0x52ffea['query']);_0x21eb9e[_0xd0ca('0x40')]=_[_0xd0ca('0x3d')](_0x52ffea[_0xd0ca('0x3e')],qs[_0xd0ca('0x3f')](_0x4a4043[_0xd0ca('0x3b')][_0xd0ca('0x3f')]));_0x21eb9e['attributes']=_0x21eb9e[_0xd0ca('0x40')][_0xd0ca('0x41')]?_0x21eb9e['attributes']:_0x52ffea['model'];if(!_0x4a4043[_0xd0ca('0x3b')][_0xd0ca('0x42')](_0xd0ca('0x43'))){_0x21eb9e[_0xd0ca('0x20')]=qs[_0xd0ca('0x20')](_0x4a4043['query'][_0xd0ca('0x20')]);_0x21eb9e['offset']=qs[_0xd0ca('0x1f')](_0x4a4043[_0xd0ca('0x3b')]['offset']);}_0x21eb9e[_0xd0ca('0x44')]=qs[_0xd0ca('0x45')](_0x4a4043[_0xd0ca('0x3b')]['sort']);_0x21eb9e[_0xd0ca('0x46')]=qs[_0xd0ca('0x3c')](_[_0xd0ca('0x47')](_0x4a4043[_0xd0ca('0x3b')],_0x52ffea[_0xd0ca('0x3c')]));_0x21eb9e['where'][_0xd0ca('0xbc')]=_0x2c0af0['id'];if(_0x4a4043[_0xd0ca('0x3b')]['filter']){_0x21eb9e[_0xd0ca('0x46')]=_['merge'](_0x21eb9e[_0xd0ca('0x46')],{'$or':_[_0xd0ca('0x34')](_0x21eb9e[_0xd0ca('0x40')],function(_0x467bdd){var _0x1129a3={};_0x1129a3[_0x467bdd]={'$like':'%'+_0x4a4043[_0xd0ca('0x3b')][_0xd0ca('0x81')]+'%'};return _0x1129a3;})});}if(_0x4a4043['query'][_0xd0ca('0xbd')]){var _0x16cec9=_0x4a4043[_0xd0ca('0x3b')][_0xd0ca('0xbd')][_0xd0ca('0x31')](',');var _0x58ccc0={};_0x58ccc0[_0x16cec9[0x0]]={'$gte':moment(_0x16cec9[0x1])['format'](_0xd0ca('0xbe'))};_0x21eb9e[_0xd0ca('0x46')]=_[_0xd0ca('0x99')](_0x21eb9e[_0xd0ca('0x46')],_0x58ccc0);}_0x21eb9e=_[_0xd0ca('0x99')]({},_0x21eb9e,_0x4a4043[_0xd0ca('0xb3')]);return db[_0xd0ca('0xb8')][_0xd0ca('0x1e')]({'where':_0x21eb9e[_0xd0ca('0x46')]})['then'](function(_0x113f62){_0x48b921['count']=_0x113f62;if(_0x4a4043[_0xd0ca('0x3b')][_0xd0ca('0xb2')]){_0x21eb9e['include']=[{'all':!![]}];}return db[_0xd0ca('0xb8')][_0xd0ca('0xbf')](_0x21eb9e);})[_0xd0ca('0x29')](function(_0x393704){_0x48b921['rows']=_0x393704;return _0x48b921;});}})[_0xd0ca('0x29')](respondWithFilteredResult(_0x2174ab,_0x21eb9e))[_0xd0ca('0xb4')](handleError(_0x2174ab,null));};exports[_0xd0ca('0xc0')]=function(_0x1e9ac1,_0x25951a,_0x486cdf){return db[_0xd0ca('0x35')]['find']({'where':{'id':_0x1e9ac1[_0xd0ca('0xb1')]['id']}})['then'](handleEntityNotFound(_0x25951a,null))[_0xd0ca('0x29')](function(_0x2208fe){if(_0x2208fe){return _0x2208fe[_0xd0ca('0xc1')](_0x1e9ac1[_0xd0ca('0x71')]['ids'],_['omit'](_0x1e9ac1[_0xd0ca('0x71')],[_0xd0ca('0xba'),'id'])||{})[_0xd0ca('0xc2')](function(){return db['Tag'][_0xd0ca('0xbf')]({'attributes':['id',_0xd0ca('0x2c'),_0xd0ca('0x4a')],'where':{'id':_0x1e9ac1[_0xd0ca('0x71')]['ids']}});})[_0xd0ca('0x29')](function(_0x24cfb5){socket['emit'](_0xd0ca('0xc3'),{'id':Number(_0x1e9ac1[_0xd0ca('0xb1')]['id']),'tags':_0x24cfb5||[]});return{'id':Number(_0x1e9ac1[_0xd0ca('0xb1')]['id']),'tags':_0x24cfb5||[]};});}})[_0xd0ca('0x29')](respondWithResult(_0x25951a,null))[_0xd0ca('0xb4')](handleError(_0x25951a,null));};exports['removeTags']=function(_0x3f98d0,_0x3819b3,_0x2893bf){return db[_0xd0ca('0x35')][_0xd0ca('0x5f')]({'where':{'id':_0x3f98d0[_0xd0ca('0xb1')]['id']}})[_0xd0ca('0x29')](handleEntityNotFound(_0x3819b3,null))['then'](function(_0x62d7f){if(_0x62d7f){return _0x62d7f[_0xd0ca('0xc4')](_0x3f98d0[_0xd0ca('0x3b')]['ids']);}})[_0xd0ca('0x29')](respondWithStatusCode(_0x3819b3,null))[_0xd0ca('0xb4')](handleError(_0x3819b3,null));};exports['download']=function(_0x59b2ff,_0x117544){var _0x4a0924=moment()[_0xd0ca('0xc5')]()[_0xd0ca('0x98')]();var _0x548a14=path['join'](config[_0xd0ca('0xc6')],_0xd0ca('0xc7'),'files','tmp');var _0x253850=path['join'](config[_0xd0ca('0xc6')],_0xd0ca('0xc7'),_0xd0ca('0xc8'),_0xd0ca('0xc9'));var _0x2fe886=path[_0xd0ca('0xca')](_0x548a14,_0x4a0924);var _0x101ab3=util[_0xd0ca('0xcb')](_0xd0ca('0xcc'),_0x59b2ff['params']['id'],_0x4a0924);var _0x49a675=path[_0xd0ca('0xca')](_0x548a14,_0x101ab3);var _0x518969=[];_0x518969['push']({'model':db[_0xd0ca('0x6e')],'as':_0xd0ca('0x6e'),'attributes':['id',_0xd0ca('0x2e')],'raw':!![]});_0x518969['push']({'model':db['CmContact'],'as':_0xd0ca('0xcd'),'attributes':['id','firstName',_0xd0ca('0xce')],'raw':!![]});if(_0x59b2ff[_0xd0ca('0x3b')][_0xd0ca('0xc9')]){_0x518969[_0xd0ca('0x32')]({'model':db['Attachment'],'as':_0xd0ca('0xcf'),'raw':!![]});}var _0x90cc51=[{'model':db[_0xd0ca('0xb8')],'as':_0xd0ca('0xd0'),'attributes':['id',_0xd0ca('0x71'),_0xd0ca('0x77'),_0xd0ca('0xd1'),_0xd0ca('0xd2'),'read'],'include':_0x518969}];_0x90cc51[_0xd0ca('0x32')]({'model':db[_0xd0ca('0xd3')],'as':_0xd0ca('0xd4'),'attributes':['id',_0xd0ca('0x2c')]});_0x90cc51[_0xd0ca('0x32')]({'model':db['User'],'as':_0xd0ca('0xd5'),'attributes':['id',_0xd0ca('0x2e')]});return db['OpenchannelInteraction'][_0xd0ca('0x5f')]({'where':{'id':_0x59b2ff['params']['id']},'include':_0x90cc51})[_0xd0ca('0x29')](handleEntityNotFound(_0x117544,null))[_0xd0ca('0x29')](function(_0x182b65){if(_0x182b65){var _0x28db34=_0x182b65[_0xd0ca('0xd6')]({'plain':!![]});fs[_0xd0ca('0xd7')](_0x2fe886);var _0x366016={'format':'A4','border':_0xd0ca('0xd8'),'header':{'height':_0xd0ca('0xd9'),'contents':{'first':_0xd0ca('0xda')}},'footer':{'height':_0xd0ca('0xdb'),'contents':{'default':util[_0xd0ca('0xcb')](_0xd0ca('0xdc'),util['format'](_0xd0ca('0xdd'),_0xd0ca('0xde'),_0x28db34['id']),moment()[_0xd0ca('0xcb')](_0xd0ca('0xdf'))['toString']())}}};var _0x4378dd={'channel':_0xd0ca('0xde'),'account':_0x28db34['Account'][_0xd0ca('0x2c')],'agent':_0x28db34[_0xd0ca('0xd5')]?_0x28db34[_0xd0ca('0xd5')][_0xd0ca('0x2e')]:'N.A.','createdAt':moment(_0x28db34[_0xd0ca('0x77')])[_0xd0ca('0xcb')](_0xd0ca('0xbe'))['toString'](),'closedAt':_0x28db34['closed']?moment(_0x28db34[_0xd0ca('0xe0')])[_0xd0ca('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd0ca('0x98')]():'','disposition':_0x28db34['disposition'],'visibility':_0x28db34[_0xd0ca('0xe1')]?_0xd0ca('0xe2'):_0xd0ca('0xe3'),'messages':_(_0x28db34[_0xd0ca('0xd0')])[_0xd0ca('0x81')]({'secret':![]})[_0xd0ca('0x34')](function(_0x35c0f4){if(_0x35c0f4[_0xd0ca('0xcf')]){var _0x4b67e3=path['join'](_0x253850,_0x35c0f4[_0xd0ca('0xcf')][_0xd0ca('0xe4')]);if(fs[_0xd0ca('0xe5')](_0x4b67e3)){fs[_0xd0ca('0xe6')](_0x4b67e3)[_0xd0ca('0xe7')](fs[_0xd0ca('0xe8')](path[_0xd0ca('0xca')](_0x2fe886,_0x35c0f4[_0xd0ca('0xcf')][_0xd0ca('0xe4')])));}}return{'date':moment(_0x35c0f4['createdAt'])['format'](_0xd0ca('0xbe'))['toString'](),'sender':_0x35c0f4[_0xd0ca('0xd1')]===_0xd0ca('0xe9')?_0x35c0f4[_0xd0ca('0x6e')]?_0x35c0f4[_0xd0ca('0x6e')]['fullname']:_0xd0ca('0xea'):_0x35c0f4[_0xd0ca('0xcd')][_0xd0ca('0xeb')]+(_0x35c0f4[_0xd0ca('0xcd')]['lastName']?'\x20'+_0x35c0f4['Contact']['lastName']:''),'body':_0x35c0f4[_0xd0ca('0xcf')]?_0x35c0f4[_0xd0ca('0xcf')][_0xd0ca('0xe4')]:_0x35c0f4[_0xd0ca('0x71')],'direction':_0x35c0f4[_0xd0ca('0xd1')]===_0xd0ca('0xe9')?'A':'C','secret':_0x35c0f4['secret'],'read':_0x35c0f4[_0xd0ca('0x7c')],'attachment':_0x35c0f4[_0xd0ca('0xcf')]};})[_0xd0ca('0x60')]()};return ejs[_0xd0ca('0xec')](path[_0xd0ca('0xca')](config['root'],_0xd0ca('0xc7'),_0xd0ca('0xed'),_0xd0ca('0xee')),{'interaction':_0x4378dd})[_0xd0ca('0x29')](function(_0x477dd2){return new BPromise(function(_0xdf07a2,_0x5ca89a){pdf['create'](_0x477dd2,_0x366016)[_0xd0ca('0xef')](path[_0xd0ca('0xca')](_0x2fe886,'transcript-'+_0x28db34['id']+'-'+_0x4a0924+_0xd0ca('0xf0')),function(_0x4a13c8,_0x53d70f){if(_0x4a13c8)return _0x5ca89a(_0x4a13c8);_0xdf07a2(_0x53d70f);});});})['then'](function(){return new BPromise(function(_0x3857e3,_0x1a3afe){zipdir(_0x2fe886,{'saveTo':_0x49a675},function(_0x5a9ee3,_0xf3ebe){if(_0x5a9ee3)return _0x1a3afe(_0x5a9ee3);return _0x3857e3(_0xf3ebe);});})[_0xd0ca('0x29')](function(){return new BPromise(function(_0x5d4bb7,_0xc4ae95){rimraf(_0x2fe886,function(_0x433795){if(_0x433795)_0xc4ae95(_0x433795);return _0x5d4bb7();});});})['then'](function(){return _0x117544[_0xd0ca('0xf1')](_0x49a675,_0x101ab3,function(_0x45edd9){if(_0x45edd9){console[_0xd0ca('0xf2')]('err',_0x45edd9);}else{fs[_0xd0ca('0xf3')](_0x49a675);}});});});}else{return _0x117544[_0xd0ca('0x2a')](0xc8);}})[_0xd0ca('0xb4')](handleError(_0x117544,null));};
\ No newline at end of file
index b4bbdad..228e815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf89d=['../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0xf89d,0xb4));var _0xdf89=function(_0x470187,_0x2bcbfb){_0x470187=_0x470187-0x0;var _0x1564be=_0xf89d[_0x470187];return _0x1564be;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xdf89('0x0'))['db'][_0xdf89('0x1')];var OpenchannelMessage=require(_0xdf89('0x0'))['db'][_0xdf89('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xdf89('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdf89('0x4'),'afterDestroy':_0xdf89('0x5')};function emitEvent(_0x33be36){return function(_0x45274d,_0x30821b,_0x72c459){_0x45274d[_0xdf89('0x6')]({'attributes':['id'],'raw':!![]})[_0xdf89('0x7')](function(_0x17d182){_0x45274d[_0xdf89('0x8')](_0xdf89('0x9'),_0x17d182['map'](function(_0x1e182e){return{'id':_0x1e182e['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x45274d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x372c63){_0x45274d[_0xdf89('0x8')](_0xdf89('0xa'),_0x372c63['length']);OpenchannelInteractionEvents[_0xdf89('0xb')](_0x33be36+':'+_0x45274d['id'],_0x45274d);OpenchannelInteractionEvents[_0xdf89('0xb')](_0x33be36,_0x45274d);_0x72c459(null);})[_0xdf89('0xc')](_0x72c459(null));};}for(var e in events){if(events[_0xdf89('0xd')](e)){var event=events[e];OpenchannelInteraction[_0xdf89('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x217c=['exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove','getUsers','map','findAll','then','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook'];(function(_0x61c24d,_0x212fb6){var _0x2723eb=function(_0x2c0e12){while(--_0x2c0e12){_0x61c24d['push'](_0x61c24d['shift']());}};_0x2723eb(++_0x212fb6);}(_0x217c,0x133));var _0xc217=function(_0x482660,_0x3af7c7){_0x482660=_0x482660-0x0;var _0x544086=_0x217c[_0x482660];return _0x544086;};'use strict';var EventEmitter=require(_0xc217('0x0'));var OpenchannelInteraction=require(_0xc217('0x1'))['db'][_0xc217('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xc217('0x3')](0x0);var events={'afterCreate':_0xc217('0x4'),'afterUpdate':_0xc217('0x5'),'afterDestroy':_0xc217('0x6')};function emitEvent(_0x1072c2){return function(_0x50fec5,_0x18a7fb,_0x2a720e){_0x50fec5[_0xc217('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x58bb85){_0x50fec5['setDataValue']('Users',_0x58bb85[_0xc217('0x8')](function(_0x427a22){return{'id':_0x427a22['id']};}));return OpenchannelMessage[_0xc217('0x9')]({'where':{'OpenchannelInteractionId':_0x50fec5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc217('0xa')](function(_0x2f0aa6){_0x50fec5[_0xc217('0xb')](_0xc217('0xc'),_0x2f0aa6[_0xc217('0xd')]);OpenchannelInteractionEvents[_0xc217('0xe')](_0x1072c2+':'+_0x50fec5['id'],_0x50fec5);OpenchannelInteractionEvents[_0xc217('0xe')](_0x1072c2,_0x50fec5);_0x2a720e(null);})['catch'](_0x2a720e(null));};}for(var e in events){if(events[_0xc217('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xc217('0x10')](e,emitEvent(event));}}module[_0xc217('0x11')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 83546bd..c14fea5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc241=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','closed','closedAt'];(function(_0x125396,_0x5c4fbe){var _0x847cd7=function(_0x4a08fa){while(--_0x4a08fa){_0x125396['push'](_0x125396['shift']());}};_0x847cd7(++_0x5c4fbe);}(_0xc241,0x134));var _0x1c24=function(_0xfc6749,_0x25395a){_0xfc6749=_0xfc6749-0x0;var _0x8a243f=_0xc241[_0xfc6749];return _0x8a243f;};'use strict';var _=require(_0x1c24('0x0'));var util=require(_0x1c24('0x1'));var logger=require('../../config/logger')(_0x1c24('0x2'));var moment=require(_0x1c24('0x3'));var BPromise=require(_0x1c24('0x4'));var rp=require(_0x1c24('0x5'));var fs=require('fs');var path=require(_0x1c24('0x6'));var rimraf=require(_0x1c24('0x7'));var config=require(_0x1c24('0x8'));var attributes=require(_0x1c24('0x9'));module[_0x1c24('0xa')]=function(_0x1e57b8,_0x1e1512){return _0x1e57b8[_0x1c24('0xb')](_0x1c24('0xc'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x480a9b,_0x3e1ceb,_0x5424fe){if(_0x480a9b['changed'](_0x1c24('0xd'))){_0x480a9b[_0x1c24('0xe')]=moment()[_0x1c24('0xf')](_0x1c24('0x10'));}_0x5424fe(null,_0x480a9b);}}});};
\ No newline at end of file
+var _0x0930=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','closed','closedAt','format','lodash','util'];(function(_0x2b2583,_0x2a154b){var _0x4cd668=function(_0x210866){while(--_0x210866){_0x2b2583['push'](_0x2b2583['shift']());}};_0x4cd668(++_0x2a154b);}(_0x0930,0x6e));var _0x0093=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0x0930[_0x284a61];return _0x220e3c;};'use strict';var _=require(_0x0093('0x0'));var util=require(_0x0093('0x1'));var logger=require(_0x0093('0x2'))(_0x0093('0x3'));var moment=require(_0x0093('0x4'));var BPromise=require(_0x0093('0x5'));var rp=require(_0x0093('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0093('0x7'));var config=require(_0x0093('0x8'));var attributes=require(_0x0093('0x9'));module[_0x0093('0xa')]=function(_0x192dec,_0x5f4f71){return _0x192dec[_0x0093('0xb')](_0x0093('0xc'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x23c1d7,_0x4ada6c,_0x34866b){if(_0x23c1d7['changed'](_0x0093('0xd'))){_0x23c1d7[_0x0093('0xe')]=moment()[_0x0093('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x34866b(null,_0x23c1d7);}}});};
\ No newline at end of file
index 881bb61..77b7ba8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6a2=['client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1415d1,_0x562a8c){var _0x10fe08=function(_0x5706f8){while(--_0x5706f8){_0x1415d1['push'](_0x1415d1['shift']());}};_0x10fe08(++_0x562a8c);}(_0xc6a2,0x17d));var _0x2c6a=function(_0x21609e,_0x2dbb7d){_0x21609e=_0x21609e-0x0;var _0x54086d=_0xc6a2[_0x21609e];return _0x54086d;};'use strict';var _=require('lodash');var util=require(_0x2c6a('0x0'));var moment=require(_0x2c6a('0x1'));var BPromise=require(_0x2c6a('0x2'));var rs=require(_0x2c6a('0x3'));var fs=require('fs');var Redis=require(_0x2c6a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c6a('0x5'));var logger=require(_0x2c6a('0x6'))('rpc');var config=require(_0x2c6a('0x7'));var jayson=require(_0x2c6a('0x8'));var client=jayson[_0x2c6a('0x9')][_0x2c6a('0xa')]({'port':0x232a});config[_0x2c6a('0xb')]=_[_0x2c6a('0xc')](config[_0x2c6a('0xb')],{'host':_0x2c6a('0xd'),'port':0x18eb});var socket=require(_0x2c6a('0xe'))(new Redis(config[_0x2c6a('0xb')]));require(_0x2c6a('0xf'))['register'](socket);function respondWithRpcPromise(_0x4bb40f,_0x2aa4b3,_0xbf7548){return new BPromise(function(_0x239cce,_0xd3dbb4){return client[_0x2c6a('0x10')](_0x4bb40f,_0xbf7548)['then'](function(_0x39ecfd){logger[_0x2c6a('0x11')](_0x2c6a('0x12'),_0x2aa4b3,_0x2c6a('0x13'));logger[_0x2c6a('0x14')](_0x2c6a('0x15'),_0x2aa4b3,'request\x20sent',JSON[_0x2c6a('0x16')](_0x39ecfd));if(_0x39ecfd[_0x2c6a('0x17')]){if(_0x39ecfd[_0x2c6a('0x17')]['code']===0x1f4){logger[_0x2c6a('0x17')](_0x2c6a('0x12'),_0x2aa4b3,_0x39ecfd[_0x2c6a('0x17')][_0x2c6a('0x18')]);return _0xd3dbb4(_0x39ecfd[_0x2c6a('0x17')]['message']);}logger['error'](_0x2c6a('0x12'),_0x2aa4b3,_0x39ecfd[_0x2c6a('0x17')][_0x2c6a('0x18')]);return _0x239cce(_0x39ecfd['error'][_0x2c6a('0x18')]);}else{logger[_0x2c6a('0x11')](_0x2c6a('0x12'),_0x2aa4b3,'request\x20sent');_0x239cce(_0x39ecfd['result'][_0x2c6a('0x18')]);}})[_0x2c6a('0x19')](function(_0x28b279){logger[_0x2c6a('0x17')](_0x2c6a('0x12'),_0x2aa4b3,_0x28b279);_0xd3dbb4(_0x28b279);});});}exports[_0x2c6a('0x1a')]=function(_0x477fac){var _0x2825bf=this;return new Promise(function(_0xf4f507,_0xfcdfd4){return db[_0x2c6a('0x1b')]['update'](_0x477fac[_0x2c6a('0x1c')],{'raw':_0x477fac[_0x2c6a('0x1d')]?_0x477fac['options'][_0x2c6a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x477fac[_0x2c6a('0x1d')]?_0x477fac[_0x2c6a('0x1d')][_0x2c6a('0x1f')]||null:null,'attributes':_0x477fac['options']?_0x477fac[_0x2c6a('0x1d')][_0x2c6a('0x20')]||null:null,'limit':_0x477fac[_0x2c6a('0x1d')]?_0x477fac[_0x2c6a('0x1d')]['limit']||null:null})['then'](function(_0x1ce6b4){logger[_0x2c6a('0x11')](_0x2c6a('0x1a'),_0x477fac);logger['debug']('UpdateOpenchannelInteraction',_0x477fac,JSON[_0x2c6a('0x16')](_0x1ce6b4));_0xf4f507(_0x1ce6b4);})['catch'](function(_0x137446){logger[_0x2c6a('0x17')]('UpdateOpenchannelInteraction',_0x137446[_0x2c6a('0x18')],_0x477fac);_0xfcdfd4(_0x2825bf[_0x2c6a('0x17')](0x1f4,_0x137446[_0x2c6a('0x18')]));});});};exports[_0x2c6a('0x21')]=function(_0x156299){return new Promise(function(_0x370738,_0xc25538){return db['OpenchannelInteraction'][_0x2c6a('0x22')]({'where':_0x156299['options']?_0x156299[_0x2c6a('0x1d')][_0x2c6a('0x1f')]||null:null})['then'](function(_0x339810){if(_0x339810){return _0x339810[_0x2c6a('0x23')](_0x156299[_0x2c6a('0x1c')][_0x2c6a('0x24')],_[_0x2c6a('0x25')](_0x156299['body'],[_0x2c6a('0x24'),'id'])||{});}})['spread'](function(_0x48fb4b){logger[_0x2c6a('0x11')]('AddTags',_0x156299);logger['debug'](_0x2c6a('0x26'),_0x156299,JSON[_0x2c6a('0x16')](_0x48fb4b));_0x370738(_0x48fb4b);})[_0x2c6a('0x19')](function(_0xc21b8f){logger['error'](_0x2c6a('0x26'),_0xc21b8f[_0x2c6a('0x18')],_0x156299);_0xc25538(_this[_0x2c6a('0x17')](0x1f4,_0xc21b8f[_0x2c6a('0x18')]));});});};
\ No newline at end of file
+var _0x8fbb=['stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','debug','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x47b8b1,_0x4ae7d9){var _0x4a0fe0=function(_0x5eb1a0){while(--_0x5eb1a0){_0x47b8b1['push'](_0x47b8b1['shift']());}};_0x4a0fe0(++_0x4ae7d9);}(_0x8fbb,0xc1));var _0xb8fb=function(_0x1ffc3c,_0x3dfb06){_0x1ffc3c=_0x1ffc3c-0x0;var _0x29a70a=_0x8fbb[_0x1ffc3c];return _0x29a70a;};'use strict';var _=require(_0xb8fb('0x0'));var util=require('util');var moment=require(_0xb8fb('0x1'));var BPromise=require(_0xb8fb('0x2'));var rs=require(_0xb8fb('0x3'));var fs=require('fs');var Redis=require(_0xb8fb('0x4'));var db=require(_0xb8fb('0x5'))['db'];var utils=require(_0xb8fb('0x6'));var logger=require(_0xb8fb('0x7'))(_0xb8fb('0x8'));var config=require('../../config/environment');var jayson=require(_0xb8fb('0x9'));var client=jayson['client'][_0xb8fb('0xa')]({'port':0x232a});config['redis']=_[_0xb8fb('0xb')](config[_0xb8fb('0xc')],{'host':_0xb8fb('0xd'),'port':0x18eb});var socket=require(_0xb8fb('0xe'))(new Redis(config['redis']));require(_0xb8fb('0xf'))[_0xb8fb('0x10')](socket);function respondWithRpcPromise(_0x3a49f8,_0x27c23b,_0x32a071){return new BPromise(function(_0x5569ce,_0x256abd){return client[_0xb8fb('0x11')](_0x3a49f8,_0x32a071)[_0xb8fb('0x12')](function(_0x139b91){logger[_0xb8fb('0x13')](_0xb8fb('0x14'),_0x27c23b,_0xb8fb('0x15'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x27c23b,_0xb8fb('0x15'),JSON[_0xb8fb('0x16')](_0x139b91));if(_0x139b91[_0xb8fb('0x17')]){if(_0x139b91[_0xb8fb('0x17')][_0xb8fb('0x18')]===0x1f4){logger[_0xb8fb('0x17')](_0xb8fb('0x14'),_0x27c23b,_0x139b91[_0xb8fb('0x17')][_0xb8fb('0x19')]);return _0x256abd(_0x139b91[_0xb8fb('0x17')]['message']);}logger[_0xb8fb('0x17')](_0xb8fb('0x14'),_0x27c23b,_0x139b91[_0xb8fb('0x17')][_0xb8fb('0x19')]);return _0x5569ce(_0x139b91[_0xb8fb('0x17')][_0xb8fb('0x19')]);}else{logger[_0xb8fb('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x27c23b,_0xb8fb('0x15'));_0x5569ce(_0x139b91['result'][_0xb8fb('0x19')]);}})[_0xb8fb('0x1a')](function(_0x4347ae){logger[_0xb8fb('0x17')](_0xb8fb('0x14'),_0x27c23b,_0x4347ae);_0x256abd(_0x4347ae);});});}exports[_0xb8fb('0x1b')]=function(_0x40d9d2){var _0x1930df=this;return new Promise(function(_0x34cd6c,_0x5df120){return db[_0xb8fb('0x1c')][_0xb8fb('0x1d')](_0x40d9d2['body'],{'raw':_0x40d9d2[_0xb8fb('0x1e')]?_0x40d9d2[_0xb8fb('0x1e')][_0xb8fb('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40d9d2['options']?_0x40d9d2[_0xb8fb('0x1e')][_0xb8fb('0x20')]||null:null,'attributes':_0x40d9d2[_0xb8fb('0x1e')]?_0x40d9d2[_0xb8fb('0x1e')][_0xb8fb('0x21')]||null:null,'limit':_0x40d9d2[_0xb8fb('0x1e')]?_0x40d9d2[_0xb8fb('0x1e')][_0xb8fb('0x22')]||null:null})[_0xb8fb('0x12')](function(_0x3ef619){logger[_0xb8fb('0x13')](_0xb8fb('0x1b'),_0x40d9d2);logger[_0xb8fb('0x23')](_0xb8fb('0x1b'),_0x40d9d2,JSON[_0xb8fb('0x16')](_0x3ef619));_0x34cd6c(_0x3ef619);})['catch'](function(_0x31e52a){logger[_0xb8fb('0x17')](_0xb8fb('0x1b'),_0x31e52a[_0xb8fb('0x19')],_0x40d9d2);_0x5df120(_0x1930df['error'](0x1f4,_0x31e52a[_0xb8fb('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x11bbf2){return new Promise(function(_0x97b1b,_0x315bff){return db[_0xb8fb('0x1c')][_0xb8fb('0x24')]({'where':_0x11bbf2[_0xb8fb('0x1e')]?_0x11bbf2[_0xb8fb('0x1e')][_0xb8fb('0x20')]||null:null})[_0xb8fb('0x12')](function(_0x50d3c4){if(_0x50d3c4){return _0x50d3c4[_0xb8fb('0x25')](_0x11bbf2[_0xb8fb('0x26')][_0xb8fb('0x27')],_[_0xb8fb('0x28')](_0x11bbf2['body'],[_0xb8fb('0x27'),'id'])||{});}})[_0xb8fb('0x29')](function(_0x38077d){logger['info'](_0xb8fb('0x2a'),_0x11bbf2);logger[_0xb8fb('0x23')](_0xb8fb('0x2a'),_0x11bbf2,JSON[_0xb8fb('0x16')](_0x38077d));_0x97b1b(_0x38077d);})['catch'](function(_0x3f9e09){logger['error'](_0xb8fb('0x2a'),_0x3f9e09['message'],_0x11bbf2);_0x315bff(_this[_0xb8fb('0x17')](0x1f4,_0x3f9e09[_0xb8fb('0x19')]));});});};
\ No newline at end of file
index 81eb92e..26a69ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x254b=['openchannelInteraction:','./openchannelInteraction.events','remove','update'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x254b,0x1c5));var _0xb254=function(_0x340380,_0x4bd2a8){_0x340380=_0x340380-0x0;var _0x49ce1c=_0x254b[_0x340380];return _0x49ce1c;};'use strict';var OpenchannelInteractionEvents=require(_0xb254('0x0'));var events=['save',_0xb254('0x1'),_0xb254('0x2')];function createListener(_0x451b0a,_0x49b256){return function(_0x20575e){_0x49b256['emit'](_0x451b0a,_0x20575e);};}function removeListener(_0x510d3b,_0x3b6cd0){return function(){OpenchannelInteractionEvents['removeListener'](_0x510d3b,_0x3b6cd0);};}exports['register']=function(_0x13f115){for(var _0x32977d=0x0,_0x25d564=events['length'];_0x32977d<_0x25d564;_0x32977d++){var _0x57f780=events[_0x32977d];var _0x21eb35=createListener(_0xb254('0x3')+_0x57f780,_0x13f115);OpenchannelInteractionEvents['on'](_0x57f780,_0x21eb35);}};
\ No newline at end of file
+var _0x24af=['emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update'];(function(_0x3d17f5,_0x248c4e){var _0x3a2dbf=function(_0x3d5928){while(--_0x3d5928){_0x3d17f5['push'](_0x3d17f5['shift']());}};_0x3a2dbf(++_0x248c4e);}(_0x24af,0xe6));var _0xf24a=function(_0x2e50a2,_0x27f31e){_0x2e50a2=_0x2e50a2-0x0;var _0x47e5de=_0x24af[_0x2e50a2];return _0x47e5de;};'use strict';var OpenchannelInteractionEvents=require(_0xf24a('0x0'));var events=[_0xf24a('0x1'),_0xf24a('0x2'),_0xf24a('0x3')];function createListener(_0x159bc2,_0x43077c){return function(_0x314541){_0x43077c[_0xf24a('0x4')](_0x159bc2,_0x314541);};}function removeListener(_0x5bc53b,_0x2585a4){return function(){OpenchannelInteractionEvents[_0xf24a('0x5')](_0x5bc53b,_0x2585a4);};}exports[_0xf24a('0x6')]=function(_0xf5e5e7){for(var _0x50e97d=0x0,_0x1740b3=events[_0xf24a('0x7')];_0x50e97d<_0x1740b3;_0x50e97d++){var _0x36ff40=events[_0x50e97d];var _0x49270b=createListener(_0xf24a('0x8')+_0x36ff40,_0xf5e5e7);OpenchannelInteractionEvents['on'](_0x36ff40,_0x49270b);}};
\ No newline at end of file
index b34d1f8..f858b63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dc9=['openchannel','create','put','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x0dc9,0x171));var _0x90dc=function(_0x2c0557,_0x4314fd){_0x2c0557=_0x2c0557-0x0;var _0x2878cd=_0x0dc9[_0x2c0557];return _0x2878cd;};'use strict';var multer=require(_0x90dc('0x0'));var util=require('util');var path=require(_0x90dc('0x1'));var timeout=require(_0x90dc('0x2'));var express=require('express');var router=express[_0x90dc('0x3')]();var auth=require(_0x90dc('0x4'));var interaction=require(_0x90dc('0x5'));var config=require('../../config/environment');var controller=require(_0x90dc('0x6'));router[_0x90dc('0x7')]('/',auth[_0x90dc('0x8')](),controller['index']);router['get'](_0x90dc('0x9'),auth[_0x90dc('0x8')](),controller[_0x90dc('0xa')]);router[_0x90dc('0x7')](_0x90dc('0xb'),auth[_0x90dc('0x8')](),controller[_0x90dc('0xc')]);router[_0x90dc('0xd')]('/',auth[_0x90dc('0x8')](),interaction[_0x90dc('0xe')](_0x90dc('0xf'),'openchannelmessage:create'),controller[_0x90dc('0x10')]);router[_0x90dc('0x11')](_0x90dc('0xb'),auth[_0x90dc('0x8')](),controller['update']);router[_0x90dc('0x11')]('/:id/accept',auth[_0x90dc('0x8')](),controller[_0x90dc('0x12')]);router[_0x90dc('0x11')](_0x90dc('0x13'),auth[_0x90dc('0x8')](),controller[_0x90dc('0x14')]);router[_0x90dc('0x15')]('/:id',auth[_0x90dc('0x8')](),controller[_0x90dc('0x16')]);module[_0x90dc('0x17')]=router;
\ No newline at end of file
+var _0xc6ab=['reject','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked','openchannelmessage:create','create','put','/:id','/:id/accept','accept'];(function(_0x866dbd,_0x520da1){var _0x13f769=function(_0x1d9948){while(--_0x1d9948){_0x866dbd['push'](_0x866dbd['shift']());}};_0x13f769(++_0x520da1);}(_0xc6ab,0xd1));var _0xbc6a=function(_0x4cfb85,_0x382e47){_0x4cfb85=_0x4cfb85-0x0;var _0x49e2b7=_0xc6ab[_0x4cfb85];return _0x49e2b7;};'use strict';var multer=require(_0xbc6a('0x0'));var util=require(_0xbc6a('0x1'));var path=require('path');var timeout=require(_0xbc6a('0x2'));var express=require(_0xbc6a('0x3'));var router=express['Router']();var auth=require(_0xbc6a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbc6a('0x5'));var controller=require(_0xbc6a('0x6'));router[_0xbc6a('0x7')]('/',auth[_0xbc6a('0x8')](),controller[_0xbc6a('0x9')]);router[_0xbc6a('0x7')](_0xbc6a('0xa'),auth[_0xbc6a('0x8')](),controller[_0xbc6a('0xb')]);router['get']('/:id',auth[_0xbc6a('0x8')](),controller[_0xbc6a('0xc')]);router[_0xbc6a('0xd')]('/',auth['isAuthenticated'](),interaction[_0xbc6a('0xe')]('openchannel',_0xbc6a('0xf')),controller[_0xbc6a('0x10')]);router[_0xbc6a('0x11')](_0xbc6a('0x12'),auth[_0xbc6a('0x8')](),controller['update']);router[_0xbc6a('0x11')](_0xbc6a('0x13'),auth['isAuthenticated'](),controller[_0xbc6a('0x14')]);router[_0xbc6a('0x11')]('/:id/reject',auth[_0xbc6a('0x8')](),controller[_0xbc6a('0x15')]);router['delete']('/:id',auth[_0xbc6a('0x8')](),controller[_0xbc6a('0x16')]);module['exports']=router;
\ No newline at end of file
index 850e741..3001b42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aa9=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x3caa01,_0x1a8fb9){var _0x472cff=function(_0xd253ed){while(--_0xd253ed){_0x3caa01['push'](_0x3caa01['shift']());}};_0x472cff(++_0x1a8fb9);}(_0x3aa9,0x8c));var _0x93aa=function(_0x433158,_0x290e9c){_0x433158=_0x433158-0x0;var _0x5d4d76=_0x3aa9[_0x433158];return _0x5d4d76;};'use strict';var Sequelize=require('sequelize');module[_0x93aa('0x0')]={'body':{'type':Sequelize[_0x93aa('0x1')](_0x93aa('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x93aa('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x93aa('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x93aa('0x4')]('in',_0x93aa('0x5')),'defaultValue':_0x93aa('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x93aa('0x6')]}};
\ No newline at end of file
+var _0x6cbc=['DATE','sequelize','TEXT','BOOLEAN','out'];(function(_0x301825,_0x177da2){var _0xa56d5a=function(_0x525bb7){while(--_0x525bb7){_0x301825['push'](_0x301825['shift']());}};_0xa56d5a(++_0x177da2);}(_0x6cbc,0x15a));var _0xc6cb=function(_0x2e3416,_0x5073f4){_0x2e3416=_0x2e3416-0x0;var _0x1749ff=_0x6cbc[_0x2e3416];return _0x1749ff;};'use strict';var Sequelize=require(_0xc6cb('0x0'));module['exports']={'body':{'type':Sequelize[_0xc6cb('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xc6cb('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xc6cb('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc6cb('0x4')]}};
\ No newline at end of file
index f4a9482..f659b7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88a4=['request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','./openchannelMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','json','count','offset','Content-Range','then','destroy','sendStatus','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','show','params','includeAll','options','create','body','update','find','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','openchannel','RejectMessage','rejectMessage','interface','reject','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x88a4,0x16d));var _0x488a=function(_0x5ed57e,_0x3c06ed){_0x5ed57e=_0x5ed57e-0x0;var _0x585b56=_0x88a4[_0x5ed57e];return _0x585b56;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x488a('0x0'));var rimraf=require(_0x488a('0x1'));var zipdir=require(_0x488a('0x2'));var jsonpatch=require(_0x488a('0x3'));var rp=require(_0x488a('0x4'));var moment=require('moment');var BPromise=require(_0x488a('0x5'));var Mustache=require(_0x488a('0x6'));var util=require(_0x488a('0x7'));var path=require(_0x488a('0x8'));var sox=require(_0x488a('0x9'));var csv=require('to-csv');var ejs=require(_0x488a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x488a('0xb'));var crypto=require(_0x488a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x488a('0xd'));var querystring=require(_0x488a('0xe'));var Papa=require(_0x488a('0xf'));var Redis=require(_0x488a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x488a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x488a('0x12'));var logger=require(_0x488a('0x13'))(_0x488a('0x14'));var utils=require(_0x488a('0x15'));var config=require(_0x488a('0x16'));var db=require('../../mysqldb')['db'];config[_0x488a('0x17')]=_['defaults'](config[_0x488a('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x488a('0x17')]));require(_0x488a('0x18'))[_0x488a('0x19')](socket);var jayson=require(_0x488a('0x1a'));var client=jayson[_0x488a('0x1b')][_0x488a('0x1c')]({'port':0x232c});var client9002=jayson[_0x488a('0x1b')][_0x488a('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2484e9,_0x2fc696,_0x41634f){if(_0x41634f){var _0x20e01e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20e01e[_0x488a('0x1d')](_0x2fc696)){return _0x2484e9;}else{throw new db[(_0x488a('0x1e'))][(_0x488a('0x1f'))](_0x488a('0x20'));}}else{return _0x2484e9;}}function respondWithRpcPromise(_0x446853,_0x1179ee,_0x26f47f,_0x42bf39){return new BPromise(function(_0x529fbc,_0x36dc44){var _0x4d9308=_0x42bf39||client;return _0x4d9308[_0x488a('0x21')](_0x446853,_0x26f47f)['then'](function(_0x4dd4ce){logger[_0x488a('0x22')](_0x488a('0x23'),_0x1179ee,_0x488a('0x24'));logger[_0x488a('0x25')](_0x488a('0x26'),_0x1179ee,_0x488a('0x24'),JSON[_0x488a('0x27')](_0x4dd4ce));if(_0x4dd4ce['error']){if(_0x4dd4ce['error'][_0x488a('0x28')]===0x1f4){logger[_0x488a('0x29')](_0x488a('0x23'),_0x1179ee,_0x4dd4ce[_0x488a('0x29')]['message']);return _0x36dc44(_0x4dd4ce[_0x488a('0x29')][_0x488a('0x2a')]);}logger[_0x488a('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x1179ee,_0x4dd4ce[_0x488a('0x29')][_0x488a('0x2a')]);return _0x529fbc(_0x4dd4ce[_0x488a('0x29')]['message']);}else{logger[_0x488a('0x22')](_0x488a('0x23'),_0x1179ee,_0x488a('0x24'));_0x529fbc(_0x4dd4ce[_0x488a('0x2b')]['message']);}})[_0x488a('0x2c')](function(_0x2f7bf6){logger[_0x488a('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x1179ee,_0x2f7bf6);_0x36dc44(_0x2f7bf6);});});}function respondWithStatusCode(_0x4ce913,_0x2eeb92){_0x2eeb92=_0x2eeb92||0xcc;return function(_0x3dc5a3){if(_0x3dc5a3){return _0x4ce913['sendStatus'](_0x2eeb92);}return _0x4ce913[_0x488a('0x2d')](_0x2eeb92)['end']();};}function respondWithResult(_0x2e4cc6,_0x4a8676){_0x4a8676=_0x4a8676||0xc8;return function(_0x23ca7c){if(_0x23ca7c){return _0x2e4cc6[_0x488a('0x2d')](_0x4a8676)[_0x488a('0x2e')](_0x23ca7c);}};}function respondWithFilteredResult(_0x46d512,_0x1d2f03){return function(_0x315520){if(_0x315520){var _0x283c27=_0x315520[_0x488a('0x2f')],_0x4ad2b4=_0x1d2f03[_0x488a('0x30')],_0x23e0b4=_0x1d2f03['offset']+_0x1d2f03['limit'],_0x4990a8;if(_0x23e0b4>=_0x283c27){_0x23e0b4=_0x283c27;_0x4990a8=0xc8;}else{_0x4990a8=0xce;}_0x46d512['status'](_0x4990a8);return _0x46d512['set'](_0x488a('0x31'),_0x4ad2b4+'-'+_0x23e0b4+'/'+_0x283c27)[_0x488a('0x2e')](_0x315520);}return null;};}function patchUpdates(_0x2e5e7a){return function(_0x56267f){try{jsonpatch['apply'](_0x56267f,_0x2e5e7a,!![]);}catch(_0x190b9c){return BPromise['reject'](_0x190b9c);}return _0x56267f['save']();};}function saveUpdates(_0x29c91d,_0x32df3d){return function(_0x3be672){if(_0x3be672){return _0x3be672['update'](_0x29c91d)[_0x488a('0x32')](function(_0x46b876){return _0x46b876;});}return null;};}function removeEntity(_0x241294,_0x1684f5){return function(_0xdb3fd9){if(_0xdb3fd9){return _0xdb3fd9[_0x488a('0x33')]()['then'](function(){_0x241294[_0x488a('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ab702,_0xfc1808){return function(_0x277009){if(!_0x277009){_0x5ab702[_0x488a('0x34')](0x194);}return _0x277009;};}function handleError(_0x171fe4,_0x4e2f02){_0x4e2f02=_0x4e2f02||0x1f4;return function(_0x311247){logger[_0x488a('0x29')](_0x311247[_0x488a('0x35')]);if(_0x311247[_0x488a('0x36')]){delete _0x311247[_0x488a('0x36')];}_0x171fe4[_0x488a('0x2d')](_0x4e2f02)[_0x488a('0x37')](_0x311247);};}exports[_0x488a('0x38')]=function(_0x12ea7c,_0x262009){var _0x45a8f9={},_0x23c2b0={},_0x2b56cb={'count':0x0,'rows':[]};var _0x22f5cf=_[_0x488a('0x39')](db[_0x488a('0x3a')][_0x488a('0x3b')],function(_0x41410f){return{'name':_0x41410f[_0x488a('0x3c')],'type':_0x41410f['type'][_0x488a('0x3d')]};});_0x23c2b0['model']=_[_0x488a('0x39')](_0x22f5cf,_0x488a('0x36'));_0x23c2b0['query']=_[_0x488a('0x3e')](_0x12ea7c[_0x488a('0x3f')]);_0x23c2b0[_0x488a('0x40')]=_[_0x488a('0x41')](_0x23c2b0[_0x488a('0x42')],_0x23c2b0[_0x488a('0x3f')]);_0x45a8f9[_0x488a('0x43')]=_['intersection'](_0x23c2b0['model'],qs[_0x488a('0x44')](_0x12ea7c[_0x488a('0x3f')][_0x488a('0x44')]));_0x45a8f9[_0x488a('0x43')]=_0x45a8f9[_0x488a('0x43')]['length']?_0x45a8f9[_0x488a('0x43')]:_0x23c2b0['model'];if(!_0x12ea7c[_0x488a('0x3f')][_0x488a('0x45')](_0x488a('0x46'))){_0x45a8f9[_0x488a('0x47')]=qs[_0x488a('0x47')](_0x12ea7c[_0x488a('0x3f')][_0x488a('0x47')]);_0x45a8f9['offset']=qs[_0x488a('0x30')](_0x12ea7c['query']['offset']);}_0x45a8f9[_0x488a('0x48')]=qs[_0x488a('0x49')](_0x12ea7c[_0x488a('0x3f')][_0x488a('0x49')]);_0x45a8f9[_0x488a('0x4a')]=qs[_0x488a('0x40')](_[_0x488a('0x4b')](_0x12ea7c[_0x488a('0x3f')],_0x23c2b0['filters']),_0x22f5cf);if(_0x12ea7c[_0x488a('0x3f')][_0x488a('0x4c')]){_0x45a8f9[_0x488a('0x4a')]=_[_0x488a('0x4d')](_0x45a8f9[_0x488a('0x4a')],{'$or':_['map'](_0x22f5cf,function(_0x5391b1){if(_0x5391b1[_0x488a('0x4e')]!==_0x488a('0x4f')){var _0x3428ee={};_0x3428ee[_0x5391b1[_0x488a('0x36')]]={'$like':'%'+_0x12ea7c[_0x488a('0x3f')][_0x488a('0x4c')]+'%'};return _0x3428ee;}})});}_0x45a8f9=_['merge']({},_0x45a8f9,_0x12ea7c['options']);var _0x41a89d={'where':_0x45a8f9[_0x488a('0x4a')]};return db[_0x488a('0x3a')]['count'](_0x41a89d)[_0x488a('0x32')](function(_0x3f9e36){_0x2b56cb[_0x488a('0x2f')]=_0x3f9e36;if(_0x12ea7c[_0x488a('0x3f')]['includeAll']){_0x45a8f9[_0x488a('0x50')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x488a('0x51')](_0x45a8f9);})[_0x488a('0x32')](function(_0x1ac053){_0x2b56cb[_0x488a('0x52')]=_0x1ac053;return _0x2b56cb;})[_0x488a('0x32')](respondWithFilteredResult(_0x262009,_0x45a8f9))[_0x488a('0x2c')](handleError(_0x262009,null));};exports[_0x488a('0x53')]=function(_0xcb530a,_0x3bef2f){var _0x325f70={'raw':!![],'where':{'id':_0xcb530a[_0x488a('0x54')]['id']}},_0x2e70f9={};_0x2e70f9[_0x488a('0x42')]=_[_0x488a('0x3e')](db['OpenchannelMessage'][_0x488a('0x3b')]);_0x2e70f9[_0x488a('0x3f')]=_['keys'](_0xcb530a[_0x488a('0x3f')]);_0x2e70f9['filters']=_[_0x488a('0x41')](_0x2e70f9['model'],_0x2e70f9[_0x488a('0x3f')]);_0x325f70['attributes']=_[_0x488a('0x41')](_0x2e70f9['model'],qs[_0x488a('0x44')](_0xcb530a[_0x488a('0x3f')][_0x488a('0x44')]));_0x325f70[_0x488a('0x43')]=_0x325f70[_0x488a('0x43')]['length']?_0x325f70[_0x488a('0x43')]:_0x2e70f9[_0x488a('0x42')];if(_0xcb530a[_0x488a('0x3f')][_0x488a('0x55')]){_0x325f70[_0x488a('0x50')]=[{'all':!![]}];}_0x325f70=_[_0x488a('0x4d')]({},_0x325f70,_0xcb530a[_0x488a('0x56')]);return db[_0x488a('0x3a')]['find'](_0x325f70)['then'](handleEntityNotFound(_0x3bef2f,null))[_0x488a('0x32')](respondWithResult(_0x3bef2f,null))[_0x488a('0x2c')](handleError(_0x3bef2f,null));};exports['create']=function(_0x41de01,_0x3b72f4){return db[_0x488a('0x3a')][_0x488a('0x57')](_0x41de01[_0x488a('0x58')],{})[_0x488a('0x32')](respondWithResult(_0x3b72f4,0xc9))[_0x488a('0x2c')](handleError(_0x3b72f4,null));};exports[_0x488a('0x59')]=function(_0x1f9e96,_0x38ad0c){if(_0x1f9e96[_0x488a('0x58')]['id']){delete _0x1f9e96['body']['id'];}return db['OpenchannelMessage'][_0x488a('0x5a')]({'where':{'id':_0x1f9e96[_0x488a('0x54')]['id']}})[_0x488a('0x32')](handleEntityNotFound(_0x38ad0c,null))['then'](saveUpdates(_0x1f9e96[_0x488a('0x58')],null))[_0x488a('0x32')](respondWithResult(_0x38ad0c,null))[_0x488a('0x2c')](handleError(_0x38ad0c,null));};exports[_0x488a('0x33')]=function(_0x327857,_0x477f71){return db[_0x488a('0x3a')][_0x488a('0x5a')]({'where':{'id':_0x327857[_0x488a('0x54')]['id']}})[_0x488a('0x32')](handleEntityNotFound(_0x477f71,null))[_0x488a('0x32')](removeEntity(_0x477f71,null))[_0x488a('0x2c')](handleError(_0x477f71,null));};exports[_0x488a('0x5b')]=function(_0x28076d,_0x15c9b3){return db[_0x488a('0x3a')][_0x488a('0x5b')]()[_0x488a('0x32')](respondWithResult(_0x15c9b3,null))['catch'](handleError(_0x15c9b3,null));};var interaction_log=require(_0x488a('0x13'))(_0x488a('0x5c'));exports[_0x488a('0x5d')]=function(_0x2ab4d2,_0x318bac,_0x5e0877){var _0x4e7b4c={'channel':'openchannel'};if(_0x2ab4d2[_0x488a('0x58')]['id']){delete _0x2ab4d2[_0x488a('0x58')]['id'];}_0x2ab4d2[_0x488a('0x58')][_0x488a('0x5e')]=!![];_0x2ab4d2[_0x488a('0x58')][_0x488a('0x5f')]=moment()[_0x488a('0x60')](_0x488a('0x61'));_0x2ab4d2[_0x488a('0x58')][_0x488a('0x62')]=_0x2ab4d2[_0x488a('0x58')][_0x488a('0x62')]||_0x2ab4d2[_0x488a('0x63')]['id'];return db[_0x488a('0x3a')][_0x488a('0x5a')]({'where':{'id':_0x2ab4d2[_0x488a('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x488a('0x64')],'as':_0x488a('0x65')}]})[_0x488a('0x32')](handleEntityNotFound(_0x318bac,null))[_0x488a('0x32')](saveUpdates(_0x2ab4d2['body'],null))[_0x488a('0x32')](function(_0x3c34ad){if(_0x3c34ad){_0x4e7b4c[_0x488a('0x2a')]=_0x3c34ad['get']({'plain':!![]});return db[_0x488a('0x66')][_0x488a('0x5a')]({'where':{'id':_0x3c34ad[_0x488a('0x67')]}});}return null;})[_0x488a('0x32')](handleEntityNotFound(_0x318bac,null))[_0x488a('0x32')](function(_0x5f11e4){if(_0x5f11e4){return _0x5f11e4['update']({'UserId':_0x2ab4d2[_0x488a('0x58')][_0x488a('0x62')],'read1stAt':_[_0x488a('0x68')](_0x5f11e4[_0x488a('0x69')])?moment()['format'](_0x488a('0x61')):undefined});}return null;})[_0x488a('0x32')](function(_0x325405){if(_0x325405){_0x4e7b4c[_0x488a('0x6a')]=_0x325405[_0x488a('0x6b')]({'plain':!![]});interaction_log[_0x488a('0x22')](_0x488a('0x6c'),_0x2ab4d2[_0x488a('0x63')]['id'],_0x2ab4d2['user'][_0x488a('0x36')],_0x2ab4d2[_0x488a('0x63')][_0x488a('0x6d')],_0x4e7b4c[_0x488a('0x6a')]['id'],_0x2ab4d2[_0x488a('0x58')]?JSON[_0x488a('0x27')](_0x2ab4d2[_0x488a('0x58')]):'null');return respondWithRpcPromise(_0x488a('0x6e'),_0x488a('0x6f'),_0x4e7b4c);}return null;})[_0x488a('0x32')](function(_0x4e78cc){if(_0x4e78cc){if(_0x2ab4d2['body'][_0x488a('0x70')]){_0x4e7b4c[_0x488a('0x2a')]['interface']=util[_0x488a('0x60')](_0x488a('0x71'),_0x2ab4d2[_0x488a('0x63')][_0x488a('0x36')]);_0x4e7b4c['message'][_0x488a('0x72')]=_0x4e7b4c[_0x488a('0x72')];_0x4e7b4c[_0x488a('0x2a')][_0x488a('0x73')]=_0x488a('0x5d');return respondWithRpcPromise('EventManager',_0x488a('0x74'),{'event':'acceptmessage','message':_0x4e7b4c[_0x488a('0x2a')]},client9002)['then'](function(){return _0x4e7b4c;});}return _0x4e7b4c;}return null;})[_0x488a('0x32')](respondWithResult(_0x318bac,null))[_0x488a('0x2c')](handleError(_0x318bac,null));};var interaction_log=require(_0x488a('0x13'))('openchannel-interactions');exports['reject']=function(_0x2b49a6,_0x323533,_0x58e1e0){var _0x5c065e={'agent':{},'channel':_0x488a('0x75')};if(_0x2b49a6['body']['id']){delete _0x2b49a6[_0x488a('0x58')]['id'];}_0x2b49a6[_0x488a('0x58')][_0x488a('0x62')]=_0x2b49a6['body'][_0x488a('0x62')]||_0x2b49a6[_0x488a('0x63')]['id'];_0x5c065e['agent']['id']=_0x2b49a6[_0x488a('0x58')][_0x488a('0x62')];return db[_0x488a('0x3a')][_0x488a('0x5a')]({'where':{'id':_0x2b49a6[_0x488a('0x54')]['id'],'UserId':null}})[_0x488a('0x32')](handleEntityNotFound(_0x323533,null))[_0x488a('0x32')](function(_0x367bbd){if(_0x367bbd){_0x5c065e[_0x488a('0x2a')]=_0x367bbd[_0x488a('0x6b')]({'plain':!![]});return db[_0x488a('0x66')][_0x488a('0x5a')]({'where':{'id':_0x367bbd[_0x488a('0x67')]}});}return null;})[_0x488a('0x32')](handleEntityNotFound(_0x323533,null))[_0x488a('0x32')](function(_0x5cfe94){if(_0x5cfe94){_0x5c065e[_0x488a('0x6a')]=_0x5cfe94[_0x488a('0x6b')]({'plain':!![]});interaction_log[_0x488a('0x22')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2b49a6[_0x488a('0x63')]['id'],_0x2b49a6[_0x488a('0x63')][_0x488a('0x36')],_0x2b49a6['user'][_0x488a('0x6d')],_0x5c065e[_0x488a('0x6a')]['id'],_0x2b49a6['body']?JSON[_0x488a('0x27')](_0x2b49a6[_0x488a('0x58')]):'null');return respondWithRpcPromise(_0x488a('0x76'),_0x488a('0x77'),_0x5c065e);}return null;})['then'](function(_0x530a14){if(_0x530a14){_0x530a14['message'][_0x488a('0x78')]=util[_0x488a('0x60')](_0x488a('0x71'),_0x2b49a6[_0x488a('0x63')][_0x488a('0x36')]);_0x530a14['message'][_0x488a('0x72')]=_0x5c065e[_0x488a('0x72')];_0x530a14[_0x488a('0x2a')][_0x488a('0x73')]=_0x488a('0x79');respondWithRpcPromise(_0x488a('0x74'),_0x488a('0x74'),{'event':_0x488a('0x7a'),'message':_0x530a14[_0x488a('0x2a')]},client9002);return _0x5c065e;}return null;})[_0x488a('0x32')](respondWithResult(_0x323533,null))['catch'](handleError(_0x323533,null));};
\ No newline at end of file
+var _0x44c3=['mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','status','name','send','map','OpenchannelMessage','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','where','filter','merge','options','includeAll','findAll','rows','show','params','include','find','create','body','describe','accept','read','readAt','UserId','user','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','openchannel','agent','role','null','RejectMessage','rejectMessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x502d3c,_0x16c5e9){var _0x33336a=function(_0x13c01b){while(--_0x13c01b){_0x502d3c['push'](_0x502d3c['shift']());}};_0x33336a(++_0x16c5e9);}(_0x44c3,0x16f));var _0x344c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44c3[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x344c('0x0'));var emlformat=require(_0x344c('0x1'));var rimraf=require(_0x344c('0x2'));var zipdir=require(_0x344c('0x3'));var jsonpatch=require(_0x344c('0x4'));var rp=require(_0x344c('0x5'));var moment=require(_0x344c('0x6'));var BPromise=require(_0x344c('0x7'));var Mustache=require(_0x344c('0x8'));var util=require('util');var path=require(_0x344c('0x9'));var sox=require(_0x344c('0xa'));var csv=require(_0x344c('0xb'));var ejs=require(_0x344c('0xc'));var fs=require('fs');var _=require(_0x344c('0xd'));var squel=require(_0x344c('0xe'));var crypto=require(_0x344c('0xf'));var jsforce=require(_0x344c('0x10'));var deskjs=require(_0x344c('0x11'));var toCsv=require(_0x344c('0xb'));var querystring=require(_0x344c('0x12'));var Papa=require(_0x344c('0x13'));var Redis=require('ioredis');var authService=require(_0x344c('0x14'));var qs=require(_0x344c('0x15'));var as=require(_0x344c('0x16'));var hardwareService=require(_0x344c('0x17'));var logger=require(_0x344c('0x18'))('api');var utils=require(_0x344c('0x19'));var config=require(_0x344c('0x1a'));var db=require(_0x344c('0x1b'))['db'];config[_0x344c('0x1c')]=_[_0x344c('0x1d')](config[_0x344c('0x1c')],{'host':_0x344c('0x1e'),'port':0x18eb});var socket=require(_0x344c('0x1f'))(new Redis(config[_0x344c('0x1c')]));require('./openchannelMessage.socket')[_0x344c('0x20')](socket);var jayson=require(_0x344c('0x21'));var client=jayson[_0x344c('0x22')][_0x344c('0x23')]({'port':0x232c});var client9002=jayson[_0x344c('0x22')][_0x344c('0x23')]({'port':0x232a});function checkPasswordPattern(_0x2fddd1,_0xfc48d,_0x4e3709){if(_0x4e3709){var _0x3b1f58=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b1f58[_0x344c('0x24')](_0xfc48d)){return _0x2fddd1;}else{throw new db[(_0x344c('0x25'))][(_0x344c('0x26'))](_0x344c('0x27'));}}else{return _0x2fddd1;}}function respondWithRpcPromise(_0xffc454,_0x44f099,_0x2a0501,_0x11a70d){return new BPromise(function(_0x548b1d,_0x5960dc){var _0x1e7b1c=_0x11a70d||client;return _0x1e7b1c[_0x344c('0x28')](_0xffc454,_0x2a0501)[_0x344c('0x29')](function(_0x4d05da){logger['info'](_0x344c('0x2a'),_0x44f099,_0x344c('0x2b'));logger['debug'](_0x344c('0x2c'),_0x44f099,_0x344c('0x2b'),JSON[_0x344c('0x2d')](_0x4d05da));if(_0x4d05da['error']){if(_0x4d05da[_0x344c('0x2e')][_0x344c('0x2f')]===0x1f4){logger[_0x344c('0x2e')](_0x344c('0x2a'),_0x44f099,_0x4d05da[_0x344c('0x2e')]['message']);return _0x5960dc(_0x4d05da[_0x344c('0x2e')][_0x344c('0x30')]);}logger[_0x344c('0x2e')](_0x344c('0x2a'),_0x44f099,_0x4d05da['error'][_0x344c('0x30')]);return _0x548b1d(_0x4d05da['error'][_0x344c('0x30')]);}else{logger[_0x344c('0x31')]('OpenchannelMessage,\x20%s,\x20%s',_0x44f099,_0x344c('0x2b'));_0x548b1d(_0x4d05da[_0x344c('0x32')][_0x344c('0x30')]);}})[_0x344c('0x33')](function(_0xa10f52){logger['error'](_0x344c('0x2a'),_0x44f099,_0xa10f52);_0x5960dc(_0xa10f52);});});}function respondWithStatusCode(_0x32bad4,_0x238fcb){_0x238fcb=_0x238fcb||0xcc;return function(_0x521ccc){if(_0x521ccc){return _0x32bad4[_0x344c('0x34')](_0x238fcb);}return _0x32bad4['status'](_0x238fcb)[_0x344c('0x35')]();};}function respondWithResult(_0x57f10a,_0x31f78f){_0x31f78f=_0x31f78f||0xc8;return function(_0x25223c){if(_0x25223c){return _0x57f10a['status'](_0x31f78f)[_0x344c('0x36')](_0x25223c);}};}function respondWithFilteredResult(_0x3984d7,_0x50ce7c){return function(_0x347ed8){if(_0x347ed8){var _0xcb5d97=_0x347ed8[_0x344c('0x37')],_0x4ca10b=_0x50ce7c[_0x344c('0x38')],_0x104377=_0x50ce7c[_0x344c('0x38')]+_0x50ce7c[_0x344c('0x39')],_0xec3acd;if(_0x104377>=_0xcb5d97){_0x104377=_0xcb5d97;_0xec3acd=0xc8;}else{_0xec3acd=0xce;}_0x3984d7['status'](_0xec3acd);return _0x3984d7[_0x344c('0x3a')](_0x344c('0x3b'),_0x4ca10b+'-'+_0x104377+'/'+_0xcb5d97)[_0x344c('0x36')](_0x347ed8);}return null;};}function patchUpdates(_0x1e5914){return function(_0x466988){try{jsonpatch[_0x344c('0x3c')](_0x466988,_0x1e5914,!![]);}catch(_0xb25c46){return BPromise[_0x344c('0x3d')](_0xb25c46);}return _0x466988['save']();};}function saveUpdates(_0x1469b9,_0x3245ae){return function(_0x14f69a){if(_0x14f69a){return _0x14f69a[_0x344c('0x3e')](_0x1469b9)[_0x344c('0x29')](function(_0x16793e){return _0x16793e;});}return null;};}function removeEntity(_0x24c425,_0x305abe){return function(_0x2a6333){if(_0x2a6333){return _0x2a6333[_0x344c('0x3f')]()[_0x344c('0x29')](function(){_0x24c425[_0x344c('0x40')](0xcc)[_0x344c('0x35')]();});}};}function handleEntityNotFound(_0x29c62f,_0x109867){return function(_0x58e6c0){if(!_0x58e6c0){_0x29c62f[_0x344c('0x34')](0x194);}return _0x58e6c0;};}function handleError(_0x52267c,_0x2c95d8){_0x2c95d8=_0x2c95d8||0x1f4;return function(_0x2faa14){logger[_0x344c('0x2e')](_0x2faa14['stack']);if(_0x2faa14[_0x344c('0x41')]){delete _0x2faa14[_0x344c('0x41')];}_0x52267c['status'](_0x2c95d8)[_0x344c('0x42')](_0x2faa14);};}exports['index']=function(_0x1d178d,_0x5c714f){var _0x54b420={},_0x5558b4={},_0x181a6c={'count':0x0,'rows':[]};var _0x524226=_[_0x344c('0x43')](db[_0x344c('0x44')][_0x344c('0x45')],function(_0x58224e){return{'name':_0x58224e['fieldName'],'type':_0x58224e[_0x344c('0x46')][_0x344c('0x47')]};});_0x5558b4['model']=_['map'](_0x524226,_0x344c('0x41'));_0x5558b4[_0x344c('0x48')]=_[_0x344c('0x49')](_0x1d178d[_0x344c('0x48')]);_0x5558b4[_0x344c('0x4a')]=_[_0x344c('0x4b')](_0x5558b4[_0x344c('0x4c')],_0x5558b4['query']);_0x54b420[_0x344c('0x4d')]=_['intersection'](_0x5558b4['model'],qs[_0x344c('0x4e')](_0x1d178d[_0x344c('0x48')]['fields']));_0x54b420[_0x344c('0x4d')]=_0x54b420[_0x344c('0x4d')][_0x344c('0x4f')]?_0x54b420['attributes']:_0x5558b4[_0x344c('0x4c')];if(!_0x1d178d[_0x344c('0x48')]['hasOwnProperty'](_0x344c('0x50'))){_0x54b420[_0x344c('0x39')]=qs['limit'](_0x1d178d[_0x344c('0x48')]['limit']);_0x54b420[_0x344c('0x38')]=qs[_0x344c('0x38')](_0x1d178d[_0x344c('0x48')][_0x344c('0x38')]);}_0x54b420['order']=qs['sort'](_0x1d178d[_0x344c('0x48')]['sort']);_0x54b420[_0x344c('0x51')]=qs['filters'](_['pick'](_0x1d178d['query'],_0x5558b4[_0x344c('0x4a')]),_0x524226);if(_0x1d178d['query'][_0x344c('0x52')]){_0x54b420[_0x344c('0x51')]=_[_0x344c('0x53')](_0x54b420[_0x344c('0x51')],{'$or':_[_0x344c('0x43')](_0x524226,function(_0x4ec674){if(_0x4ec674[_0x344c('0x46')]!=='VIRTUAL'){var _0x56d2fd={};_0x56d2fd[_0x4ec674['name']]={'$like':'%'+_0x1d178d[_0x344c('0x48')][_0x344c('0x52')]+'%'};return _0x56d2fd;}})});}_0x54b420=_[_0x344c('0x53')]({},_0x54b420,_0x1d178d[_0x344c('0x54')]);var _0x249cdc={'where':_0x54b420[_0x344c('0x51')]};return db[_0x344c('0x44')]['count'](_0x249cdc)[_0x344c('0x29')](function(_0x145620){_0x181a6c['count']=_0x145620;if(_0x1d178d[_0x344c('0x48')][_0x344c('0x55')]){_0x54b420['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x344c('0x56')](_0x54b420);})[_0x344c('0x29')](function(_0xa674){_0x181a6c[_0x344c('0x57')]=_0xa674;return _0x181a6c;})[_0x344c('0x29')](respondWithFilteredResult(_0x5c714f,_0x54b420))['catch'](handleError(_0x5c714f,null));};exports[_0x344c('0x58')]=function(_0x449590,_0x5728e7){var _0x49c39d={'raw':!![],'where':{'id':_0x449590[_0x344c('0x59')]['id']}},_0x45aef2={};_0x45aef2['model']=_[_0x344c('0x49')](db[_0x344c('0x44')][_0x344c('0x45')]);_0x45aef2['query']=_[_0x344c('0x49')](_0x449590[_0x344c('0x48')]);_0x45aef2['filters']=_['intersection'](_0x45aef2[_0x344c('0x4c')],_0x45aef2[_0x344c('0x48')]);_0x49c39d[_0x344c('0x4d')]=_[_0x344c('0x4b')](_0x45aef2[_0x344c('0x4c')],qs['fields'](_0x449590[_0x344c('0x48')]['fields']));_0x49c39d['attributes']=_0x49c39d[_0x344c('0x4d')]['length']?_0x49c39d[_0x344c('0x4d')]:_0x45aef2[_0x344c('0x4c')];if(_0x449590[_0x344c('0x48')][_0x344c('0x55')]){_0x49c39d[_0x344c('0x5a')]=[{'all':!![]}];}_0x49c39d=_[_0x344c('0x53')]({},_0x49c39d,_0x449590['options']);return db['OpenchannelMessage'][_0x344c('0x5b')](_0x49c39d)[_0x344c('0x29')](handleEntityNotFound(_0x5728e7,null))[_0x344c('0x29')](respondWithResult(_0x5728e7,null))['catch'](handleError(_0x5728e7,null));};exports[_0x344c('0x5c')]=function(_0x5e2b39,_0x56fb52){return db[_0x344c('0x44')][_0x344c('0x5c')](_0x5e2b39['body'],{})[_0x344c('0x29')](respondWithResult(_0x56fb52,0xc9))['catch'](handleError(_0x56fb52,null));};exports[_0x344c('0x3e')]=function(_0x435407,_0x11a0fc){if(_0x435407[_0x344c('0x5d')]['id']){delete _0x435407[_0x344c('0x5d')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x435407[_0x344c('0x59')]['id']}})[_0x344c('0x29')](handleEntityNotFound(_0x11a0fc,null))[_0x344c('0x29')](saveUpdates(_0x435407['body'],null))['then'](respondWithResult(_0x11a0fc,null))[_0x344c('0x33')](handleError(_0x11a0fc,null));};exports[_0x344c('0x3f')]=function(_0x144e49,_0x56230a){return db[_0x344c('0x44')]['find']({'where':{'id':_0x144e49[_0x344c('0x59')]['id']}})[_0x344c('0x29')](handleEntityNotFound(_0x56230a,null))[_0x344c('0x29')](removeEntity(_0x56230a,null))['catch'](handleError(_0x56230a,null));};exports[_0x344c('0x5e')]=function(_0x594599,_0x29a572){return db[_0x344c('0x44')][_0x344c('0x5e')]()[_0x344c('0x29')](respondWithResult(_0x29a572,null))[_0x344c('0x33')](handleError(_0x29a572,null));};var interaction_log=require(_0x344c('0x18'))('openchannel-interactions');exports[_0x344c('0x5f')]=function(_0xc936aa,_0x323698,_0x17b233){var _0x44ba03={'channel':'openchannel'};if(_0xc936aa['body']['id']){delete _0xc936aa[_0x344c('0x5d')]['id'];}_0xc936aa['body'][_0x344c('0x60')]=!![];_0xc936aa[_0x344c('0x5d')][_0x344c('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xc936aa['body'][_0x344c('0x62')]=_0xc936aa[_0x344c('0x5d')][_0x344c('0x62')]||_0xc936aa[_0x344c('0x63')]['id'];return db[_0x344c('0x44')][_0x344c('0x5b')]({'where':{'id':_0xc936aa['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x344c('0x64')}]})['then'](handleEntityNotFound(_0x323698,null))['then'](saveUpdates(_0xc936aa[_0x344c('0x5d')],null))[_0x344c('0x29')](function(_0x22230a){if(_0x22230a){_0x44ba03[_0x344c('0x30')]=_0x22230a[_0x344c('0x65')]({'plain':!![]});return db[_0x344c('0x66')][_0x344c('0x5b')]({'where':{'id':_0x22230a[_0x344c('0x67')]}});}return null;})[_0x344c('0x29')](handleEntityNotFound(_0x323698,null))['then'](function(_0x35934c){if(_0x35934c){return _0x35934c[_0x344c('0x3e')]({'UserId':_0xc936aa[_0x344c('0x5d')][_0x344c('0x62')],'read1stAt':_[_0x344c('0x68')](_0x35934c[_0x344c('0x69')])?moment()[_0x344c('0x6a')](_0x344c('0x6b')):undefined});}return null;})[_0x344c('0x29')](function(_0x381615){if(_0x381615){_0x44ba03[_0x344c('0x6c')]=_0x381615[_0x344c('0x65')]({'plain':!![]});interaction_log[_0x344c('0x31')](_0x344c('0x6d'),_0xc936aa['user']['id'],_0xc936aa['user'][_0x344c('0x41')],_0xc936aa['user']['role'],_0x44ba03[_0x344c('0x6c')]['id'],_0xc936aa[_0x344c('0x5d')]?JSON[_0x344c('0x2d')](_0xc936aa['body']):'null');return respondWithRpcPromise(_0x344c('0x6e'),_0x344c('0x6f'),_0x44ba03);}return null;})[_0x344c('0x29')](function(_0x3bde8a){if(_0x3bde8a){if(_0xc936aa[_0x344c('0x5d')]['manual']){_0x44ba03[_0x344c('0x30')][_0x344c('0x70')]=util[_0x344c('0x6a')](_0x344c('0x71'),_0xc936aa[_0x344c('0x63')][_0x344c('0x41')]);_0x44ba03[_0x344c('0x30')][_0x344c('0x72')]=_0x44ba03[_0x344c('0x72')];_0x44ba03[_0x344c('0x30')][_0x344c('0x73')]=_0x344c('0x5f');return respondWithRpcPromise(_0x344c('0x74'),'EventManager',{'event':_0x344c('0x75'),'message':_0x44ba03['message']},client9002)['then'](function(){return _0x44ba03;});}return _0x44ba03;}return null;})[_0x344c('0x29')](respondWithResult(_0x323698,null))['catch'](handleError(_0x323698,null));};var interaction_log=require(_0x344c('0x18'))(_0x344c('0x76'));exports['reject']=function(_0x48e4fa,_0x24efce,_0x28f5c5){var _0x2a3b4a={'agent':{},'channel':_0x344c('0x77')};if(_0x48e4fa[_0x344c('0x5d')]['id']){delete _0x48e4fa['body']['id'];}_0x48e4fa['body'][_0x344c('0x62')]=_0x48e4fa['body'][_0x344c('0x62')]||_0x48e4fa[_0x344c('0x63')]['id'];_0x2a3b4a[_0x344c('0x78')]['id']=_0x48e4fa[_0x344c('0x5d')]['UserId'];return db[_0x344c('0x44')]['find']({'where':{'id':_0x48e4fa[_0x344c('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x24efce,null))[_0x344c('0x29')](function(_0x1cf045){if(_0x1cf045){_0x2a3b4a[_0x344c('0x30')]=_0x1cf045[_0x344c('0x65')]({'plain':!![]});return db[_0x344c('0x66')][_0x344c('0x5b')]({'where':{'id':_0x1cf045[_0x344c('0x67')]}});}return null;})[_0x344c('0x29')](handleEntityNotFound(_0x24efce,null))['then'](function(_0x32df53){if(_0x32df53){_0x2a3b4a['interaction']=_0x32df53[_0x344c('0x65')]({'plain':!![]});interaction_log[_0x344c('0x31')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x48e4fa[_0x344c('0x63')]['id'],_0x48e4fa[_0x344c('0x63')]['name'],_0x48e4fa['user'][_0x344c('0x79')],_0x2a3b4a[_0x344c('0x6c')]['id'],_0x48e4fa[_0x344c('0x5d')]?JSON['stringify'](_0x48e4fa['body']):_0x344c('0x7a'));return respondWithRpcPromise(_0x344c('0x7b'),_0x344c('0x7c'),_0x2a3b4a);}return null;})[_0x344c('0x29')](function(_0x16e110){if(_0x16e110){_0x16e110['message']['interface']=util[_0x344c('0x6a')](_0x344c('0x71'),_0x48e4fa[_0x344c('0x63')][_0x344c('0x41')]);_0x16e110['message']['channel']=_0x2a3b4a['channel'];_0x16e110[_0x344c('0x30')][_0x344c('0x73')]=_0x344c('0x3d');respondWithRpcPromise('EventManager',_0x344c('0x74'),{'event':'rejectmessage','message':_0x16e110[_0x344c('0x30')]},client9002);return _0x2a3b4a;}return null;})[_0x344c('0x29')](respondWithResult(_0x24efce,null))[_0x344c('0x33')](handleError(_0x24efce,null));};
\ No newline at end of file
index fc15bd8..d42faed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba71=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x2ceda4,_0x462c41){var _0x59dd69=function(_0x4ec94d){while(--_0x4ec94d){_0x2ceda4['push'](_0x2ceda4['shift']());}};_0x59dd69(++_0x462c41);}(_0xba71,0xe6));var _0x1ba7=function(_0x252fec,_0x21dfd6){_0x252fec=_0x252fec-0x0;var _0x1b3256=_0xba71[_0x252fec];return _0x1b3256;};'use strict';var EventEmitter=require(_0x1ba7('0x0'));var OpenchannelMessage=require(_0x1ba7('0x1'))['db'][_0x1ba7('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1ba7('0x3')](0x0);var events={'afterCreate':_0x1ba7('0x4'),'afterUpdate':'update','afterDestroy':_0x1ba7('0x5')};function emitEvent(_0x15aeca){return function(_0x3eb99f,_0x29847b,_0x1016c2){OpenchannelMessageEvents['emit'](_0x15aeca+':'+_0x3eb99f['id'],_0x3eb99f);OpenchannelMessageEvents[_0x1ba7('0x6')](_0x15aeca,_0x3eb99f);_0x1016c2(null);};}for(var e in events){if(events[_0x1ba7('0x7')](e)){var event=events[e];OpenchannelMessage[_0x1ba7('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xea92=['hasOwnProperty','hook','exports','events','setMaxListeners','update','remove','emit'];(function(_0x55100f,_0x52b6e9){var _0x5ca4c8=function(_0x378948){while(--_0x378948){_0x55100f['push'](_0x55100f['shift']());}};_0x5ca4c8(++_0x52b6e9);}(_0xea92,0x73));var _0x2ea9=function(_0x5387c2,_0x2951de){_0x5387c2=_0x5387c2-0x0;var _0x540ab0=_0xea92[_0x5387c2];return _0x540ab0;};'use strict';var EventEmitter=require(_0x2ea9('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2ea9('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2ea9('0x2'),'afterDestroy':_0x2ea9('0x3')};function emitEvent(_0x46fcbe){return function(_0x350844,_0x243568,_0x193b62){OpenchannelMessageEvents[_0x2ea9('0x4')](_0x46fcbe+':'+_0x350844['id'],_0x350844);OpenchannelMessageEvents[_0x2ea9('0x4')](_0x46fcbe,_0x350844);_0x193b62(null);};}for(var e in events){if(events[_0x2ea9('0x5')](e)){var event=events[e];OpenchannelMessage[_0x2ea9('0x6')](e,emitEvent(event));}}module[_0x2ea9('0x7')]=OpenchannelMessageEvents;
\ No newline at end of file
index b712e19..3f8c868 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3ff=['Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','body','OpenchannelInteraction','update','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteractionId','then','error','describe','find','OpenchannelAccountId'];(function(_0x587650,_0x288a3c){var _0x18c33a=function(_0x2b83fb){while(--_0x2b83fb){_0x587650['push'](_0x587650['shift']());}};_0x18c33a(++_0x288a3c);}(_0xf3ff,0xae));var _0xff3f=function(_0x3e89bd,_0x35acf9){_0x3e89bd=_0x3e89bd-0x0;var _0x5b2050=_0xf3ff[_0x3e89bd];return _0x5b2050;};'use strict';var _=require(_0xff3f('0x0'));var util=require('util');var logger=require(_0xff3f('0x1'))(_0xff3f('0x2'));var moment=require(_0xff3f('0x3'));var BPromise=require(_0xff3f('0x4'));var rp=require(_0xff3f('0x5'));var fs=require('fs');var path=require(_0xff3f('0x6'));var rimraf=require('rimraf');var config=require(_0xff3f('0x7'));var attributes=require(_0xff3f('0x8'));module[_0xff3f('0x9')]=function(_0x56208b,_0x3591f9){return _0x56208b[_0xff3f('0xa')]('OpenchannelMessage',attributes,{'tableName':_0xff3f('0xb'),'paranoid':![],'indexes':[{'name':_0xff3f('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x55e1a9,_0x34df96,_0x5f58d5){var _0x3e61d8=_0x56208b['models'];var _0x27747c=_0x55e1a9[_0xff3f('0xd')]({'plain':!![]});if(_0x27747c[_0xff3f('0xe')][_0xff3f('0xf')]()==='in'||_0x27747c[_0xff3f('0xe')][_0xff3f('0xf')]()===_0xff3f('0x10')&&!_0x27747c[_0xff3f('0x11')]&&!_[_0xff3f('0x12')](_0x27747c[_0xff3f('0x13')])){_0x3e61d8['OpenchannelInteraction']['findOne']({'where':{'id':_0x27747c[_0xff3f('0x14')]}})[_0xff3f('0x15')](function(_0x32f887){if(_0x32f887){_0x32f887['update']({'lastMsgAt':_0x27747c['createdAt'],'lastMsgDirection':_0x27747c[_0xff3f('0xe')]['toLowerCase']()});}})['catch'](function(_0x2a7c79){console[_0xff3f('0x16')](_0x2a7c79);});}if(_0x27747c['direction']===_0xff3f('0x10')&&!_0x27747c['secret']){var _0x129647;_0x3e61d8['CmContact'][_0xff3f('0x17')]()[_0xff3f('0x15')](function(_0xf21b3){return _0x3e61d8['OpenchannelAccount'][_0xff3f('0x18')]({'where':{'id':_0x27747c[_0xff3f('0x19')]},'include':[{'model':_0x3e61d8['OpenchannelInteraction'],'as':_0xff3f('0x1a'),'where':{'id':_0x27747c[_0xff3f('0x14')]},'limit':0x1,'include':[{'model':_0x3e61d8[_0xff3f('0x1b')],'as':_0xff3f('0x1c'),'attributes':_[_0xff3f('0x1d')](_0xf21b3)}]}]});})[_0xff3f('0x15')](function(_0x2ffd20){_0x129647=_0x2ffd20[_0xff3f('0xd')]({'plain':!![]});if(_0x129647&&_0x129647[_0xff3f('0x1e')]){logger[_0xff3f('0x1f')](_0xff3f('0x20'),_0xff3f('0x21'),util[_0xff3f('0x22')](_0xff3f('0x23'),_0x27747c['id'],_0x129647['replyUri']));if(_0x129647['Interactions']&&_0x129647[_0xff3f('0x1a')]['length']){_0x27747c[_0xff3f('0x24')]=_[_0xff3f('0x25')](_0x129647['Interactions'][0x0],_0xff3f('0x1c'));_0x27747c['Contact']=_0x129647[_0xff3f('0x1a')][0x0]['Contact'];}var _0x34df96={'method':_0xff3f('0x26'),'uri':encodeURI(_0x129647[_0xff3f('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x34df96[_0xff3f('0x27')]){case _0xff3f('0x28'):_0x34df96['qs']=_0x27747c;break;case'POST':_0x34df96['body']=_0x27747c;break;}return rp(_0x34df96)[_0xff3f('0x15')](function(_0x4721f9){logger[_0xff3f('0x1f')](_0xff3f('0x20'),_0xff3f('0x21'),util['format'](_0xff3f('0x29'),_0x27747c['id'],_0x129647[_0xff3f('0x1e')]));if(_0x4721f9['body'][_0xff3f('0x2a')]&&_0x4721f9[_0xff3f('0x2b')][_0xff3f('0x2a')]!=_0x27747c[_0xff3f('0x24')][_0xff3f('0x2a')]){return _0x3e61d8[_0xff3f('0x2c')][_0xff3f('0x2d')]({'threadId':_0x4721f9[_0xff3f('0x2b')][_0xff3f('0x2a')]},{'logging':!![],'where':{'id':_0x27747c[_0xff3f('0x24')]['id']}});}else{return;}})['then'](function(){return _0x55e1a9[_0xff3f('0x2d')]({'read':!![]});})['catch'](function(_0x16e1f3){logger[_0xff3f('0x16')](_0xff3f('0x20'),_0xff3f('0x21'),util[_0xff3f('0x2e')](_0x16e1f3,{'showHidden':![],'depth':null}));_0x5f58d5();});}else{_0x5f58d5();}})[_0xff3f('0x2f')](function(){_0x5f58d5();});}else{_0x5f58d5();}}},'charset':_0xff3f('0x30'),'collate':_0xff3f('0x31')});};
\ No newline at end of file
+var _0x0b78=['length','Interaction','omit','POST','method','GET','format','threadId','update','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','then','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b78,0x1ad));var _0x80b7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0b78[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var logger=require('../../config/logger')(_0x80b7('0x2'));var moment=require(_0x80b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x80b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80b7('0x5'));var config=require(_0x80b7('0x6'));var attributes=require(_0x80b7('0x7'));module['exports']=function(_0x49bc7f,_0x167ddd){return _0x49bc7f['define'](_0x80b7('0x8'),attributes,{'tableName':_0x80b7('0x9'),'paranoid':![],'indexes':[{'name':_0x80b7('0xa'),'fields':[_0x80b7('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x74b4a8,_0x25a015,_0x374c52){var _0x5176b2=_0x49bc7f[_0x80b7('0xc')];var _0x522a21=_0x74b4a8[_0x80b7('0xd')]({'plain':!![]});if(_0x522a21[_0x80b7('0xe')][_0x80b7('0xf')]()==='in'||_0x522a21[_0x80b7('0xe')][_0x80b7('0xf')]()===_0x80b7('0x10')&&!_0x522a21[_0x80b7('0x11')]&&!_[_0x80b7('0x12')](_0x522a21[_0x80b7('0x13')])){_0x5176b2[_0x80b7('0x14')][_0x80b7('0x15')]({'where':{'id':_0x522a21['OpenchannelInteractionId']}})[_0x80b7('0x16')](function(_0x401ad3){if(_0x401ad3){_0x401ad3['update']({'lastMsgAt':_0x522a21[_0x80b7('0x17')],'lastMsgDirection':_0x522a21[_0x80b7('0xe')]['toLowerCase']()});}})[_0x80b7('0x18')](function(_0x3b6b13){console[_0x80b7('0x19')](_0x3b6b13);});}if(_0x522a21[_0x80b7('0xe')]===_0x80b7('0x10')&&!_0x522a21[_0x80b7('0x11')]){var _0x1e3d1c;_0x5176b2[_0x80b7('0x1a')][_0x80b7('0x1b')]()[_0x80b7('0x16')](function(_0x4c12b1){return _0x5176b2[_0x80b7('0x1c')][_0x80b7('0x1d')]({'where':{'id':_0x522a21[_0x80b7('0x1e')]},'include':[{'model':_0x5176b2[_0x80b7('0x14')],'as':'Interactions','where':{'id':_0x522a21['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x5176b2[_0x80b7('0x1a')],'as':_0x80b7('0x1f'),'attributes':_[_0x80b7('0x20')](_0x4c12b1)}]}]});})[_0x80b7('0x16')](function(_0x574e5c){_0x1e3d1c=_0x574e5c['get']({'plain':!![]});if(_0x1e3d1c&&_0x1e3d1c[_0x80b7('0x21')]){logger[_0x80b7('0x22')](_0x80b7('0x23'),_0x80b7('0x24'),util['format'](_0x80b7('0x25'),_0x522a21['id'],_0x1e3d1c['replyUri']));if(_0x1e3d1c['Interactions']&&_0x1e3d1c[_0x80b7('0x26')][_0x80b7('0x27')]){_0x522a21[_0x80b7('0x28')]=_[_0x80b7('0x29')](_0x1e3d1c[_0x80b7('0x26')][0x0],_0x80b7('0x1f'));_0x522a21[_0x80b7('0x1f')]=_0x1e3d1c[_0x80b7('0x26')][0x0][_0x80b7('0x1f')];}var _0x25a015={'method':_0x80b7('0x2a'),'uri':encodeURI(_0x1e3d1c[_0x80b7('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x25a015[_0x80b7('0x2b')]){case _0x80b7('0x2c'):_0x25a015['qs']=_0x522a21;break;case _0x80b7('0x2a'):_0x25a015['body']=_0x522a21;break;}return rp(_0x25a015)[_0x80b7('0x16')](function(_0x1661be){logger['info'](_0x80b7('0x23'),_0x80b7('0x24'),util[_0x80b7('0x2d')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x522a21['id'],_0x1e3d1c[_0x80b7('0x21')]));if(_0x1661be[_0x80b7('0xb')][_0x80b7('0x2e')]&&_0x1661be[_0x80b7('0xb')][_0x80b7('0x2e')]!=_0x522a21[_0x80b7('0x28')][_0x80b7('0x2e')]){return _0x5176b2[_0x80b7('0x14')][_0x80b7('0x2f')]({'threadId':_0x1661be[_0x80b7('0xb')][_0x80b7('0x2e')]},{'logging':!![],'where':{'id':_0x522a21[_0x80b7('0x28')]['id']}});}else{return;}})[_0x80b7('0x16')](function(){return _0x74b4a8['update']({'read':!![]});})['catch'](function(_0x36f25e){logger[_0x80b7('0x19')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x80b7('0x30')](_0x36f25e,{'showHidden':![],'depth':null}));_0x374c52();});}else{_0x374c52();}})[_0x80b7('0x31')](function(){_0x374c52();});}else{_0x374c52();}}},'charset':_0x80b7('0x32'),'collate':_0x80b7('0x33')});};
\ No newline at end of file
index 26dbc11..4ec60b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d10=['catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result'];(function(_0x3bcfce,_0x536c49){var _0x2eb329=function(_0x25c8bc){while(--_0x25c8bc){_0x3bcfce['push'](_0x3bcfce['shift']());}};_0x2eb329(++_0x536c49);}(_0x7d10,0x1ce));var _0x07d1=function(_0x299928,_0x28d38c){_0x299928=_0x299928-0x0;var _0x4f4f28=_0x7d10[_0x299928];return _0x4f4f28;};'use strict';var _=require('lodash');var util=require(_0x07d1('0x0'));var moment=require(_0x07d1('0x1'));var BPromise=require('bluebird');var rs=require(_0x07d1('0x2'));var fs=require('fs');var Redis=require(_0x07d1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x07d1('0x4'));var logger=require(_0x07d1('0x5'))('rpc');var config=require(_0x07d1('0x6'));var jayson=require(_0x07d1('0x7'));var client=jayson[_0x07d1('0x8')][_0x07d1('0x9')]({'port':0x232a});config['redis']=_[_0x07d1('0xa')](config[_0x07d1('0xb')],{'host':_0x07d1('0xc'),'port':0x18eb});var socket=require(_0x07d1('0xd'))(new Redis(config[_0x07d1('0xb')]));require(_0x07d1('0xe'))[_0x07d1('0xf')](socket);function respondWithRpcPromise(_0x42bf2b,_0x370103,_0x40eccc){return new BPromise(function(_0x259865,_0x33abbd){return client[_0x07d1('0x10')](_0x42bf2b,_0x40eccc)[_0x07d1('0x11')](function(_0x40ccbd){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x370103,_0x07d1('0x12'));logger[_0x07d1('0x13')](_0x07d1('0x14'),_0x370103,_0x07d1('0x12'),JSON[_0x07d1('0x15')](_0x40ccbd));if(_0x40ccbd[_0x07d1('0x16')]){if(_0x40ccbd[_0x07d1('0x16')][_0x07d1('0x17')]===0x1f4){logger[_0x07d1('0x16')](_0x07d1('0x18'),_0x370103,_0x40ccbd['error'][_0x07d1('0x19')]);return _0x33abbd(_0x40ccbd[_0x07d1('0x16')][_0x07d1('0x19')]);}logger[_0x07d1('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x370103,_0x40ccbd[_0x07d1('0x16')][_0x07d1('0x19')]);return _0x259865(_0x40ccbd[_0x07d1('0x16')]['message']);}else{logger[_0x07d1('0x1a')](_0x07d1('0x18'),_0x370103,_0x07d1('0x12'));_0x259865(_0x40ccbd[_0x07d1('0x1b')][_0x07d1('0x19')]);}})[_0x07d1('0x1c')](function(_0x234d47){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x370103,_0x234d47);_0x33abbd(_0x234d47);});});}exports[_0x07d1('0x1d')]=function(_0x4aed02){var _0xf369a1=this;return new Promise(function(_0x550c7f,_0x2b5153){return db[_0x07d1('0x1e')][_0x07d1('0x1f')](_0x4aed02[_0x07d1('0x20')],{'raw':_0x4aed02[_0x07d1('0x21')]?_0x4aed02[_0x07d1('0x21')][_0x07d1('0x22')]===undefined?!![]:![]:!![]})[_0x07d1('0x11')](function(_0x43b86c){logger['info']('CreateOpenchannelMessage',_0x4aed02);logger['debug'](_0x07d1('0x1d'),_0x4aed02,JSON['stringify'](_0x43b86c));_0x550c7f(_0x43b86c);})[_0x07d1('0x1c')](function(_0x34ccba){logger[_0x07d1('0x16')](_0x07d1('0x1d'),_0x34ccba[_0x07d1('0x19')],_0x4aed02);_0x2b5153(_0xf369a1['error'](0x1f4,_0x34ccba[_0x07d1('0x19')]));});});};
\ No newline at end of file
+var _0x7292=['create','body','options','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','request','then','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','OpenchannelMessage,\x20%s,\x20%s','result','catch','CreateOpenchannelMessage','OpenchannelMessage'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0x7292,0x6d));var _0x2729=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x7292[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x2729('0x0'));var util=require(_0x2729('0x1'));var moment=require(_0x2729('0x2'));var BPromise=require(_0x2729('0x3'));var rs=require(_0x2729('0x4'));var fs=require('fs');var Redis=require(_0x2729('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2729('0x6'));var logger=require(_0x2729('0x7'))(_0x2729('0x8'));var config=require(_0x2729('0x9'));var jayson=require(_0x2729('0xa'));var client=jayson['client'][_0x2729('0xb')]({'port':0x232a});config[_0x2729('0xc')]=_[_0x2729('0xd')](config[_0x2729('0xc')],{'host':_0x2729('0xe'),'port':0x18eb});var socket=require(_0x2729('0xf'))(new Redis(config['redis']));require(_0x2729('0x10'))['register'](socket);function respondWithRpcPromise(_0x22d1c5,_0x595e43,_0x4e46a1){return new BPromise(function(_0x26d5cf,_0x4374cd){return client[_0x2729('0x11')](_0x22d1c5,_0x4e46a1)[_0x2729('0x12')](function(_0x2c3fa3){logger[_0x2729('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x595e43,'request\x20sent');logger[_0x2729('0x14')](_0x2729('0x15'),_0x595e43,_0x2729('0x16'),JSON['stringify'](_0x2c3fa3));if(_0x2c3fa3['error']){if(_0x2c3fa3[_0x2729('0x17')][_0x2729('0x18')]===0x1f4){logger[_0x2729('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0x595e43,_0x2c3fa3[_0x2729('0x17')][_0x2729('0x19')]);return _0x4374cd(_0x2c3fa3[_0x2729('0x17')][_0x2729('0x19')]);}logger[_0x2729('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0x595e43,_0x2c3fa3[_0x2729('0x17')][_0x2729('0x19')]);return _0x26d5cf(_0x2c3fa3[_0x2729('0x17')][_0x2729('0x19')]);}else{logger[_0x2729('0x13')](_0x2729('0x1a'),_0x595e43,_0x2729('0x16'));_0x26d5cf(_0x2c3fa3[_0x2729('0x1b')][_0x2729('0x19')]);}})[_0x2729('0x1c')](function(_0x2fc850){logger[_0x2729('0x17')](_0x2729('0x1a'),_0x595e43,_0x2fc850);_0x4374cd(_0x2fc850);});});}exports[_0x2729('0x1d')]=function(_0x17db0a){var _0x24eea1=this;return new Promise(function(_0x372eeb,_0x1f7769){return db[_0x2729('0x1e')][_0x2729('0x1f')](_0x17db0a[_0x2729('0x20')],{'raw':_0x17db0a[_0x2729('0x21')]?_0x17db0a[_0x2729('0x21')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x348379){logger[_0x2729('0x13')](_0x2729('0x1d'),_0x17db0a);logger[_0x2729('0x14')]('CreateOpenchannelMessage',_0x17db0a,JSON[_0x2729('0x22')](_0x348379));_0x372eeb(_0x348379);})['catch'](function(_0x149789){logger[_0x2729('0x17')](_0x2729('0x1d'),_0x149789['message'],_0x17db0a);_0x1f7769(_0x24eea1[_0x2729('0x17')](0x1f4,_0x149789['message']));});});};
\ No newline at end of file
index 29b85b8..6f4a096 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x52fcf2,_0x2e19d6){var _0x29274e=function(_0x413e9f){while(--_0x413e9f){_0x52fcf2['push'](_0x52fcf2['shift']());}};_0x29274e(++_0x2e19d6);}(_0x70e0,0x17b));var _0x070e=function(_0x4852df,_0x4c2db7){_0x4852df=_0x4852df-0x0;var _0x1bbf46=_0x70e0[_0x4852df];return _0x1bbf46;};'use strict';var OpenchannelMessageEvents=require(_0x070e('0x0'));var events=[_0x070e('0x1'),_0x070e('0x2'),'update'];function createListener(_0x579b83,_0x16e651){return function(_0xee173){_0x16e651[_0x070e('0x3')](_0x579b83,_0xee173);};}function removeListener(_0x2593e5,_0x5c90fc){return function(){OpenchannelMessageEvents[_0x070e('0x4')](_0x2593e5,_0x5c90fc);};}exports['register']=function(_0x46fe68){for(var _0x4b041d=0x0,_0x56e420=events['length'];_0x4b041d<_0x56e420;_0x4b041d++){var _0x35ab0c=events[_0x4b041d];var _0x1e11f0=createListener(_0x070e('0x5')+_0x35ab0c,_0x46fe68);OpenchannelMessageEvents['on'](_0x35ab0c,_0x1e11f0);}};
\ No newline at end of file
+var _0xa9e0=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var OpenchannelMessageEvents=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(){OpenchannelMessageEvents[_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);OpenchannelMessageEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index a1533ad..9293eae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd072=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x7ea1fb,_0x2f0b74){var _0x478241=function(_0xd06b3a){while(--_0xd06b3a){_0x7ea1fb['push'](_0x7ea1fb['shift']());}};_0x478241(++_0x2f0b74);}(_0xd072,0x132));var _0x2d07=function(_0x1d783f,_0x4c19a3){_0x1d783f=_0x1d783f-0x0;var _0x1fb9a1=_0xd072[_0x1d783f];return _0x1fb9a1;};'use strict';var multer=require(_0x2d07('0x0'));var util=require(_0x2d07('0x1'));var path=require(_0x2d07('0x2'));var timeout=require(_0x2d07('0x3'));var express=require(_0x2d07('0x4'));var router=express[_0x2d07('0x5')]();var auth=require(_0x2d07('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2d07('0x7'));var controller=require(_0x2d07('0x8'));router[_0x2d07('0x9')]('/',auth[_0x2d07('0xa')](),controller[_0x2d07('0xb')]);router['get'](_0x2d07('0xc'),auth[_0x2d07('0xa')](),controller[_0x2d07('0xd')]);router[_0x2d07('0x9')](_0x2d07('0xe'),auth[_0x2d07('0xa')](),controller[_0x2d07('0xf')]);router['get'](_0x2d07('0x10'),auth[_0x2d07('0xa')](),controller[_0x2d07('0x11')]);router[_0x2d07('0x9')](_0x2d07('0x12'),auth[_0x2d07('0xa')](),controller[_0x2d07('0x13')]);router[_0x2d07('0x9')](_0x2d07('0x14'),auth[_0x2d07('0xa')](),controller[_0x2d07('0x15')]);router[_0x2d07('0x16')]('/',auth[_0x2d07('0xa')](),controller[_0x2d07('0x17')]);router[_0x2d07('0x16')](_0x2d07('0x12'),auth[_0x2d07('0xa')](),controller[_0x2d07('0x18')]);router[_0x2d07('0x16')](_0x2d07('0x14'),auth[_0x2d07('0xa')](),controller[_0x2d07('0x19')]);router[_0x2d07('0x1a')](_0x2d07('0xe'),auth[_0x2d07('0xa')](),controller['update']);router[_0x2d07('0x1b')](_0x2d07('0xe'),auth[_0x2d07('0xa')](),controller[_0x2d07('0x1c')]);router[_0x2d07('0x1b')](_0x2d07('0x12'),auth[_0x2d07('0xa')](),controller[_0x2d07('0x1d')]);router['delete'](_0x2d07('0x14'),auth[_0x2d07('0xa')](),controller[_0x2d07('0x1e')]);module[_0x2d07('0x1f')]=router;
\ No newline at end of file
+var _0xef39=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','removeAgents','util','path','connect-timeout','express'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xef39,0x92));var _0x9ef3=function(_0x10469f,_0x584ad0){_0x10469f=_0x10469f-0x0;var _0x35e036=_0xef39[_0x10469f];return _0x35e036;};'use strict';var multer=require('multer');var util=require(_0x9ef3('0x0'));var path=require(_0x9ef3('0x1'));var timeout=require(_0x9ef3('0x2'));var express=require(_0x9ef3('0x3'));var router=express[_0x9ef3('0x4')]();var auth=require(_0x9ef3('0x5'));var interaction=require(_0x9ef3('0x6'));var config=require(_0x9ef3('0x7'));var controller=require(_0x9ef3('0x8'));router[_0x9ef3('0x9')]('/',auth[_0x9ef3('0xa')](),controller[_0x9ef3('0xb')]);router['get'](_0x9ef3('0xc'),auth[_0x9ef3('0xa')](),controller[_0x9ef3('0xd')]);router[_0x9ef3('0x9')](_0x9ef3('0xe'),auth[_0x9ef3('0xa')](),controller[_0x9ef3('0xf')]);router[_0x9ef3('0x9')](_0x9ef3('0x10'),auth[_0x9ef3('0xa')](),controller[_0x9ef3('0x11')]);router[_0x9ef3('0x9')](_0x9ef3('0x12'),auth['isAuthenticated'](),controller[_0x9ef3('0x13')]);router[_0x9ef3('0x9')](_0x9ef3('0x14'),auth[_0x9ef3('0xa')](),controller[_0x9ef3('0x15')]);router[_0x9ef3('0x16')]('/',auth['isAuthenticated'](),controller[_0x9ef3('0x17')]);router[_0x9ef3('0x16')](_0x9ef3('0x12'),auth['isAuthenticated'](),controller[_0x9ef3('0x18')]);router[_0x9ef3('0x16')]('/:id/users',auth[_0x9ef3('0xa')](),controller[_0x9ef3('0x19')]);router[_0x9ef3('0x1a')](_0x9ef3('0xe'),auth[_0x9ef3('0xa')](),controller[_0x9ef3('0x1b')]);router['delete'](_0x9ef3('0xe'),auth[_0x9ef3('0xa')](),controller[_0x9ef3('0x1c')]);router['delete'](_0x9ef3('0x12'),auth[_0x9ef3('0xa')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x9ef3('0xa')](),controller[_0x9ef3('0x1d')]);module['exports']=router;
\ No newline at end of file
index 51c771e..a4235d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fc3=['exports','STRING','name','rrmemory','beepall','sequelize'];(function(_0x2e58ad,_0x1eb316){var _0x227b44=function(_0x487f53){while(--_0x487f53){_0x2e58ad['push'](_0x2e58ad['shift']());}};_0x227b44(++_0x1eb316);}(_0x9fc3,0xcb));var _0x39fc=function(_0x3260b5,_0x319136){_0x3260b5=_0x3260b5-0x0;var _0x43e878=_0x9fc3[_0x3260b5];return _0x43e878;};'use strict';var Sequelize=require(_0x39fc('0x0'));module[_0x39fc('0x1')]={'name':{'type':Sequelize[_0x39fc('0x2')],'unique':_0x39fc('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x39fc('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x39fc('0x4'),_0x39fc('0x5'),'roundrobin')}};
\ No newline at end of file
+var _0xf5dd=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xf5dd,0x1ad));var _0xdf5d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xf5dd[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xdf5d('0x0'));module[_0xdf5d('0x1')]={'name':{'type':Sequelize[_0xdf5d('0x2')],'unique':_0xdf5d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdf5d('0x2')]},'timeout':{'type':Sequelize[_0xdf5d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdf5d('0x5')](_0xdf5d('0x6'),_0xdf5d('0x7'),_0xdf5d('0x8'))}};
\ No newline at end of file
index 931b12f..8c5e6fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6694=['merge','OpenchannelQueue','include','findAll','rows','catch','show','params','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','find','userProfileId','autoAssociation','error','update','describe','findOne','UserOpenchannelQueue','length','OpenchannelQueueId','options','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP','getTeams','Team','nolimit','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','every','includes','union','compact','value','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','count','Content-Range','apply','save','then','destroy','get','UserProfileResource','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','order','sort','where','pick','filter','VIRTUAL'];(function(_0x23e312,_0x5cf650){var _0x493f2d=function(_0x547b53){while(--_0x547b53){_0x23e312['push'](_0x23e312['shift']());}};_0x493f2d(++_0x5cf650);}(_0x6694,0xd6));var _0x4669=function(_0xe31fc4,_0x2939c4){_0xe31fc4=_0xe31fc4-0x0;var _0x3a975c=_0x6694[_0xe31fc4];return _0x3a975c;};'use strict';var pdf=require(_0x4669('0x0'));var emlformat=require(_0x4669('0x1'));var rimraf=require(_0x4669('0x2'));var zipdir=require(_0x4669('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4669('0x4'));var BPromise=require(_0x4669('0x5'));var Mustache=require(_0x4669('0x6'));var util=require(_0x4669('0x7'));var path=require(_0x4669('0x8'));var sox=require(_0x4669('0x9'));var csv=require(_0x4669('0xa'));var ejs=require(_0x4669('0xb'));var fs=require('fs');var _=require(_0x4669('0xc'));var squel=require(_0x4669('0xd'));var crypto=require(_0x4669('0xe'));var jsforce=require(_0x4669('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4669('0xa'));var querystring=require(_0x4669('0x10'));var Papa=require(_0x4669('0x11'));var Redis=require(_0x4669('0x12'));var authService=require(_0x4669('0x13'));var qs=require(_0x4669('0x14'));var as=require(_0x4669('0x15'));var hardwareService=require(_0x4669('0x16'));var logger=require(_0x4669('0x17'))(_0x4669('0x18'));var utils=require('../../config/utils');var config=require(_0x4669('0x19'));var db=require(_0x4669('0x1a'))['db'];config[_0x4669('0x1b')]=_[_0x4669('0x1c')](config['redis'],{'host':_0x4669('0x1d'),'port':0x18eb});var socket=require(_0x4669('0x1e'))(new Redis(config[_0x4669('0x1b')]));require(_0x4669('0x1f'))[_0x4669('0x20')](socket);function respondWithStatusCode(_0x44b20f,_0x253265){_0x253265=_0x253265||0xcc;return function(_0x14aa9e){if(_0x14aa9e){return _0x44b20f[_0x4669('0x21')](_0x253265);}return _0x44b20f[_0x4669('0x22')](_0x253265)[_0x4669('0x23')]();};}function respondWithResult(_0xa829d1,_0x3e296f){_0x3e296f=_0x3e296f||0xc8;return function(_0x48787c){if(_0x48787c){return _0xa829d1[_0x4669('0x22')](_0x3e296f)[_0x4669('0x24')](_0x48787c);}};}function respondWithFilteredResult(_0x15665f,_0x35bbe0){return function(_0x4d7379){if(_0x4d7379){var _0x49f7be=_0x4d7379[_0x4669('0x25')],_0x45e97c=_0x35bbe0['offset'],_0x31f9e8=_0x35bbe0['offset']+_0x35bbe0['limit'],_0x56b579;if(_0x31f9e8>=_0x49f7be){_0x31f9e8=_0x49f7be;_0x56b579=0xc8;}else{_0x56b579=0xce;}_0x15665f['status'](_0x56b579);return _0x15665f['set'](_0x4669('0x26'),_0x45e97c+'-'+_0x31f9e8+'/'+_0x49f7be)['json'](_0x4d7379);}return null;};}function patchUpdates(_0x27b4c5){return function(_0xd23e17){try{jsonpatch[_0x4669('0x27')](_0xd23e17,_0x27b4c5,!![]);}catch(_0x5af442){return BPromise['reject'](_0x5af442);}return _0xd23e17[_0x4669('0x28')]();};}function saveUpdates(_0x515396,_0x28be54){return function(_0x54f212){if(_0x54f212){return _0x54f212['update'](_0x515396)[_0x4669('0x29')](function(_0x161a0f){return _0x161a0f;});}return null;};}function removeEntity(_0x2130ae,_0xf11e44){return function(_0x11ddf4){if(_0x11ddf4){return _0x11ddf4[_0x4669('0x2a')]()['then'](function(){var _0x384ec1=_0x11ddf4[_0x4669('0x2b')]({'plain':!![]});var _0x4e1b74='OpenchannelQueues';return db[_0x4669('0x2c')]['destroy']({'where':{'type':_0x4e1b74,'resourceId':_0x384ec1['id']}})[_0x4669('0x29')](function(){return _0x11ddf4;});})[_0x4669('0x29')](function(){_0x2130ae[_0x4669('0x22')](0xcc)[_0x4669('0x23')]();});}};}function handleEntityNotFound(_0xeaf190,_0x37bb1b){return function(_0x18e1f5){if(!_0x18e1f5){_0xeaf190['sendStatus'](0x194);}return _0x18e1f5;};}function handleError(_0x1aee6a,_0x1bb52f){_0x1bb52f=_0x1bb52f||0x1f4;return function(_0x20b506){logger['error'](_0x20b506['stack']);if(_0x20b506[_0x4669('0x2d')]){delete _0x20b506[_0x4669('0x2d')];}_0x1aee6a['status'](_0x1bb52f)[_0x4669('0x2e')](_0x20b506);};}exports[_0x4669('0x2f')]=function(_0x45e68a,_0x24ed7a){var _0x1b2a32={},_0x540928={},_0x1018d4={'count':0x0,'rows':[]};var _0x29c6da=_[_0x4669('0x30')](db['OpenchannelQueue'][_0x4669('0x31')],function(_0x4d70af){return{'name':_0x4d70af[_0x4669('0x32')],'type':_0x4d70af[_0x4669('0x33')][_0x4669('0x34')]};});_0x540928[_0x4669('0x35')]=_[_0x4669('0x30')](_0x29c6da,'name');_0x540928['query']=_['keys'](_0x45e68a[_0x4669('0x36')]);_0x540928[_0x4669('0x37')]=_[_0x4669('0x38')](_0x540928[_0x4669('0x35')],_0x540928[_0x4669('0x36')]);_0x1b2a32['attributes']=_[_0x4669('0x38')](_0x540928[_0x4669('0x35')],qs['fields'](_0x45e68a[_0x4669('0x36')][_0x4669('0x39')]));_0x1b2a32[_0x4669('0x3a')]=_0x1b2a32[_0x4669('0x3a')]['length']?_0x1b2a32['attributes']:_0x540928['model'];if(!_0x45e68a['query'][_0x4669('0x3b')]('nolimit')){_0x1b2a32[_0x4669('0x3c')]=qs[_0x4669('0x3c')](_0x45e68a[_0x4669('0x36')][_0x4669('0x3c')]);_0x1b2a32[_0x4669('0x3d')]=qs[_0x4669('0x3d')](_0x45e68a[_0x4669('0x36')][_0x4669('0x3d')]);}_0x1b2a32[_0x4669('0x3e')]=qs['sort'](_0x45e68a['query'][_0x4669('0x3f')]);_0x1b2a32[_0x4669('0x40')]=qs[_0x4669('0x37')](_[_0x4669('0x41')](_0x45e68a[_0x4669('0x36')],_0x540928[_0x4669('0x37')]),_0x29c6da);if(_0x45e68a[_0x4669('0x36')][_0x4669('0x42')]){_0x1b2a32[_0x4669('0x40')]=_['merge'](_0x1b2a32['where'],{'$or':_['map'](_0x29c6da,function(_0x85bc6e){if(_0x85bc6e[_0x4669('0x33')]!==_0x4669('0x43')){var _0x1cfc58={};_0x1cfc58[_0x85bc6e[_0x4669('0x2d')]]={'$like':'%'+_0x45e68a[_0x4669('0x36')]['filter']+'%'};return _0x1cfc58;}})});}_0x1b2a32=_[_0x4669('0x44')]({},_0x1b2a32,_0x45e68a['options']);var _0x1dfda9={'where':_0x1b2a32[_0x4669('0x40')]};return db[_0x4669('0x45')]['count'](_0x1dfda9)[_0x4669('0x29')](function(_0x1dad6f){_0x1018d4[_0x4669('0x25')]=_0x1dad6f;if(_0x45e68a['query']['includeAll']){_0x1b2a32[_0x4669('0x46')]=[{'all':!![]}];}return db[_0x4669('0x45')][_0x4669('0x47')](_0x1b2a32);})[_0x4669('0x29')](function(_0x4409af){_0x1018d4[_0x4669('0x48')]=_0x4409af;return _0x1018d4;})[_0x4669('0x29')](respondWithFilteredResult(_0x24ed7a,_0x1b2a32))[_0x4669('0x49')](handleError(_0x24ed7a,null));};exports[_0x4669('0x4a')]=function(_0x38e079,_0x27fc0c){var _0x5cf400={'raw':!![],'where':{'id':_0x38e079[_0x4669('0x4b')]['id']}},_0x18de6f={};_0x18de6f[_0x4669('0x35')]=_[_0x4669('0x4c')](db[_0x4669('0x45')][_0x4669('0x31')]);_0x18de6f[_0x4669('0x36')]=_[_0x4669('0x4c')](_0x38e079[_0x4669('0x36')]);_0x18de6f[_0x4669('0x37')]=_[_0x4669('0x38')](_0x18de6f[_0x4669('0x35')],_0x18de6f[_0x4669('0x36')]);_0x5cf400[_0x4669('0x3a')]=_['intersection'](_0x18de6f[_0x4669('0x35')],qs['fields'](_0x38e079['query'][_0x4669('0x39')]));_0x5cf400[_0x4669('0x3a')]=_0x5cf400['attributes']['length']?_0x5cf400[_0x4669('0x3a')]:_0x18de6f[_0x4669('0x35')];if(_0x38e079['query'][_0x4669('0x4d')]){_0x5cf400[_0x4669('0x46')]=[{'all':!![]}];}_0x5cf400=_['merge']({},_0x5cf400,_0x38e079['options']);return db[_0x4669('0x45')]['find'](_0x5cf400)[_0x4669('0x29')](handleEntityNotFound(_0x27fc0c,null))['then'](respondWithResult(_0x27fc0c,null))[_0x4669('0x49')](handleError(_0x27fc0c,null));};exports['create']=function(_0xd9825d,_0x154b0d){return db[_0x4669('0x45')][_0x4669('0x4e')](_0xd9825d[_0x4669('0x4f')],{})[_0x4669('0x29')](function(_0xcea800){var _0x78b63=_0xd9825d[_0x4669('0x50')][_0x4669('0x2b')]({'plain':!![]});if(!_0x78b63)throw new Error(_0x4669('0x51'));if(_0x78b63[_0x4669('0x52')]===_0x4669('0x50')){var _0x4e5edf=_0xcea800[_0x4669('0x2b')]({'plain':!![]});var _0x1d9e72=_0x4669('0x53');return db['UserProfileSection'][_0x4669('0x54')]({'where':{'name':_0x1d9e72,'userProfileId':_0x78b63[_0x4669('0x55')]},'raw':!![]})['then'](function(_0x10d257){if(_0x10d257&&_0x10d257[_0x4669('0x56')]===0x0){return db[_0x4669('0x2c')][_0x4669('0x4e')]({'name':_0x4e5edf[_0x4669('0x2d')],'resourceId':_0x4e5edf['id'],'type':_0x10d257[_0x4669('0x2d')],'sectionId':_0x10d257['id']},{})[_0x4669('0x29')](function(){return _0xcea800;});}else{return _0xcea800;}})[_0x4669('0x49')](function(_0x55e886){logger[_0x4669('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55e886);throw _0x55e886;});}return _0xcea800;})['then'](respondWithResult(_0x154b0d,0xc9))[_0x4669('0x49')](handleError(_0x154b0d,null));};exports[_0x4669('0x58')]=function(_0x27f298,_0x1f05c1){if(_0x27f298[_0x4669('0x4f')]['id']){delete _0x27f298[_0x4669('0x4f')]['id'];}return db[_0x4669('0x45')]['find']({'where':{'id':_0x27f298[_0x4669('0x4b')]['id']}})[_0x4669('0x29')](handleEntityNotFound(_0x1f05c1,null))[_0x4669('0x29')](saveUpdates(_0x27f298[_0x4669('0x4f')],null))[_0x4669('0x29')](respondWithResult(_0x1f05c1,null))['catch'](handleError(_0x1f05c1,null));};exports[_0x4669('0x2a')]=function(_0x2f1f15,_0xdcc58d){return db['OpenchannelQueue']['find']({'where':{'id':_0x2f1f15[_0x4669('0x4b')]['id']}})['then'](handleEntityNotFound(_0xdcc58d,null))[_0x4669('0x29')](removeEntity(_0xdcc58d,null))[_0x4669('0x49')](handleError(_0xdcc58d,null));};exports[_0x4669('0x59')]=function(_0x4bb125,_0x5667af){return db[_0x4669('0x45')]['describe']()['then'](respondWithResult(_0x5667af,null))[_0x4669('0x49')](handleError(_0x5667af,null));};exports['getMembers']=function(_0xf7fe66,_0x22d702,_0x468285){var _0x283787={'raw':!![],'where':{}},_0x59ff32={},_0x41617e;return db[_0x4669('0x45')][_0x4669('0x5a')]({'where':{'id':_0xf7fe66[_0x4669('0x4b')]['id']}})[_0x4669('0x29')](handleEntityNotFound(_0x22d702,null))['then'](function(_0x398d66){if(_0x398d66){_0x41617e=_0x398d66['get']({'plain':!![]});_0x59ff32['model']=_[_0x4669('0x4c')](db[_0x4669('0x5b')]['rawAttributes']);_0x59ff32['query']=_[_0x4669('0x4c')](_0xf7fe66['query']);_0x59ff32[_0x4669('0x37')]=_[_0x4669('0x38')](_0x59ff32['model'],_0x59ff32['query']);_0x283787[_0x4669('0x3a')]=_['intersection'](_0x59ff32[_0x4669('0x35')],qs[_0x4669('0x39')](_0xf7fe66['query']['fields']));_0x283787[_0x4669('0x3a')]=_0x283787[_0x4669('0x3a')][_0x4669('0x5c')]?_0x283787[_0x4669('0x3a')]:_0x59ff32[_0x4669('0x35')];if(!_0xf7fe66[_0x4669('0x36')][_0x4669('0x3b')]('nolimit')){_0x283787['limit']=qs[_0x4669('0x3c')](_0xf7fe66[_0x4669('0x36')][_0x4669('0x3c')]);_0x283787[_0x4669('0x3d')]=qs[_0x4669('0x3d')](_0xf7fe66[_0x4669('0x36')]['offset']);}_0x283787['order']=qs[_0x4669('0x3f')](_0xf7fe66['query'][_0x4669('0x3f')]);_0x283787[_0x4669('0x40')]=qs[_0x4669('0x37')](_[_0x4669('0x41')](_0xf7fe66[_0x4669('0x36')],_0x59ff32[_0x4669('0x37')]));_0x283787[_0x4669('0x40')][_0x4669('0x5d')]=_0x398d66['id'];if(_0xf7fe66['query'][_0x4669('0x42')]){_0x283787[_0x4669('0x40')]=_[_0x4669('0x44')](_0x283787[_0x4669('0x40')],{'$or':_['map'](_0x283787[_0x4669('0x3a')],function(_0x11e4df){var _0xc14f8d={};_0xc14f8d[_0x11e4df]={'$like':'%'+_0xf7fe66[_0x4669('0x36')][_0x4669('0x42')]+'%'};return _0xc14f8d;})});}_0x283787=_[_0x4669('0x44')]({},_0x283787,_0xf7fe66[_0x4669('0x5e')]);return db[_0x4669('0x5b')][_0x4669('0x47')](_0x283787);}})[_0x4669('0x29')](function(_0x29c2a9){if(_0x29c2a9){return db[_0x4669('0x5f')][_0x4669('0x60')]({'where':{'id':_['map'](_0x29c2a9,_0x4669('0x61')),'role':_0x4669('0x62')},'attributes':['id',_0x4669('0x2d'),_0x4669('0x63'),_0x4669('0x64'),'createdAt']});}})[_0x4669('0x29')](function(_0x54b008){if(_0x54b008){return{'count':_0x54b008['count'],'rows':_[_0x4669('0x30')](_0x54b008['rows'],function(_0x4666bf){return{'membername':_0x4666bf[_0x4669('0x2d')],'UserId':_0x4666bf['id'],'queue_name':_0x41617e[_0x4669('0x2d')],'OpenchannelQueueId':_0x41617e['id'],'interface':util[_0x4669('0x65')](_0x4669('0x66'),_0x4669('0x67'),_0x4666bf[_0x4669('0x2d')]),'penalty':0x0,'paused':_0x4666bf[_0x4669('0x63')],'createdAt':_0x4666bf['createdAt'],'updatedAt':_0x4666bf['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4669('0x29')](respondWithFilteredResult(_0x22d702,_0x283787))[_0x4669('0x49')](handleError(_0x22d702,null));};exports[_0x4669('0x68')]=function(_0x22c91a,_0x409b84,_0x4068f0){var _0x321944={};var _0x114450={};var _0x52c4e3;var _0x536872;return db[_0x4669('0x45')][_0x4669('0x5a')]({'where':{'id':_0x22c91a[_0x4669('0x4b')]['id']}})['then'](handleEntityNotFound(_0x409b84,null))[_0x4669('0x29')](function(_0x1e99b8){if(_0x1e99b8){_0x52c4e3=_0x1e99b8;_0x114450[_0x4669('0x35')]=_[_0x4669('0x4c')](db[_0x4669('0x69')][_0x4669('0x31')]);_0x114450[_0x4669('0x36')]=_[_0x4669('0x4c')](_0x22c91a[_0x4669('0x36')]);_0x114450[_0x4669('0x37')]=_['intersection'](_0x114450[_0x4669('0x35')],_0x114450[_0x4669('0x36')]);_0x321944['attributes']=_[_0x4669('0x38')](_0x114450[_0x4669('0x35')],qs[_0x4669('0x39')](_0x22c91a['query'][_0x4669('0x39')]));_0x321944[_0x4669('0x3a')]=_0x321944[_0x4669('0x3a')][_0x4669('0x5c')]?_0x321944[_0x4669('0x3a')]:_0x114450[_0x4669('0x35')];_0x321944['order']=qs[_0x4669('0x3f')](_0x22c91a[_0x4669('0x36')][_0x4669('0x3f')]);_0x321944[_0x4669('0x40')]=qs[_0x4669('0x37')](_['pick'](_0x22c91a[_0x4669('0x36')],_0x114450['filters']));if(_0x22c91a[_0x4669('0x36')][_0x4669('0x42')]){_0x321944[_0x4669('0x40')]=_[_0x4669('0x44')](_0x321944[_0x4669('0x40')],{'$or':_[_0x4669('0x30')](_0x321944['attributes'],function(_0x1cb6b9){var _0x5d3c05={};_0x5d3c05[_0x1cb6b9]={'$like':'%'+_0x22c91a['query'][_0x4669('0x42')]+'%'};return _0x5d3c05;})});}_0x321944=_[_0x4669('0x44')]({},_0x321944,_0x22c91a[_0x4669('0x5e')]);return _0x52c4e3['getTeams'](_0x321944);}})[_0x4669('0x29')](function(_0x214322){if(_0x214322){_0x536872=_0x214322[_0x4669('0x5c')];if(!_0x22c91a['query']['hasOwnProperty'](_0x4669('0x6a'))){_0x321944[_0x4669('0x3c')]=qs['limit'](_0x22c91a['query'][_0x4669('0x3c')]);_0x321944[_0x4669('0x3d')]=qs['offset'](_0x22c91a['query'][_0x4669('0x3d')]);}return _0x52c4e3[_0x4669('0x68')](_0x321944);}})[_0x4669('0x29')](function(_0x39f937){if(_0x39f937){return _0x39f937?{'count':_0x536872,'rows':_0x39f937}:null;}})['then'](respondWithResult(_0x409b84,null))[_0x4669('0x49')](handleError(_0x409b84,null));};exports['addTeams']=function(_0x169945,_0x386064,_0x4a3cb5){var _0x24eb89=_0x169945[_0x4669('0x4f')][_0x4669('0x6b')];return db[_0x4669('0x69')][_0x4669('0x47')]({'where':{'id':_0x24eb89},'attributes':['id'],'include':[{'model':db[_0x4669('0x5f')],'as':_0x4669('0x6c'),'attributes':['id','name',_0x4669('0x6d'),_0x4669('0x6e'),'interface'],'raw':!![]}]})[_0x4669('0x29')](function(_0x2984a1){if(_0x2984a1){var _0x2b32e2=_[_0x4669('0x6f')](_0x2984a1,function(_0x42531f){var _0x2e8a0c=_0x42531f['get']({'plain':!![]});return _0x2e8a0c[_0x4669('0x6c')];});return db[_0x4669('0x45')][_0x4669('0x54')]({'where':{'id':_0x169945[_0x4669('0x4b')]['id']}})['then'](function(_0x2e6f8e){return db[_0x4669('0x70')][_0x4669('0x71')](function(_0x4945d8){return _0x2e6f8e[_0x4669('0x72')](_0x24eb89,{'transaction':_0x4945d8})[_0x4669('0x29')](function(){return BPromise[_0x4669('0x73')](_0x2b32e2,function(_0x27c5ad){return db[_0x4669('0x5b')]['findOrCreate']({'where':{'UserId':_0x27c5ad['id'],'OpenchannelQueueId':_0x169945[_0x4669('0x4b')]['id']},'transaction':_0x4945d8});});})[_0x4669('0x29')](function(){_0x2b32e2['forEach'](function(_0x4286c7){socket[_0x4669('0x74')](_0x4669('0x75'),{'UserId':_0x4286c7['id'],'OpenchannelQueueId':_0x2e6f8e['id']});});});});});}})[_0x4669('0x29')](respondWithStatusCode(_0x386064,null))[_0x4669('0x49')](handleError(_0x386064,null));};exports[_0x4669('0x76')]=function(_0x37631b,_0x4c9a07,_0x8c4c12){return db['Team'][_0x4669('0x47')]({'where':{'id':_0x37631b[_0x4669('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4669('0x5f')],'as':_0x4669('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4c9a07,null))[_0x4669('0x29')](function(_0x1444ca){var _0x2233d5=_['map'](_0x1444ca,'id');var _0x4435bf=[];var _0x41ba87=[];var _0x20491a=squel[_0x4669('0x77')]();_0x20491a[_0x4669('0x78')](_0x4669('0x79'))['from'](_0x4669('0x7a'),'tq')[_0x4669('0x7b')](_0x4669('0x7c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4669('0x40')]('OpenchannelQueueId\x20=\x20?',_0x37631b[_0x4669('0x4b')]['id']);for(var _0x5473c8=0x0;_0x5473c8<_0x1444ca[_0x4669('0x5c')];_0x5473c8+=0x1){let _0x330022=_0x1444ca[_0x5473c8];for(var _0x52d8d5=0x0;_0x52d8d5<_0x330022[_0x4669('0x6c')][_0x4669('0x5c')];_0x52d8d5+=0x1){let _0xaa6fd8=_0x330022[_0x4669('0x6c')][_0x52d8d5];var _0x126ddd=_0x20491a['clone']();_0x126ddd[_0x4669('0x40')](_0x4669('0x7d'),_0xaa6fd8['id']);_0x41ba87[_0x4669('0x7e')](db['sequelize']['query'](_0x126ddd[_0x4669('0x7f')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x4669('0x29')](function(_0x4a4e96){if(_0x4a4e96[_0x4669('0x5c')]===0x1){return _0xaa6fd8['id'];}else{var _0x4d5a47=_[_0x4669('0x80')](_[_0x4669('0x30')](_0x4a4e96,'TeamId'),function(_0x180078){return _[_0x4669('0x81')](_0x2233d5,_0x180078);});if(_0x4d5a47){return _0xaa6fd8['id'];}}}));}}return BPromise['all'](_0x41ba87)[_0x4669('0x29')](function(_0x5b907b){_0x4435bf=_(_0x4435bf)[_0x4669('0x82')](_0x5b907b)[_0x4669('0x83')]()[_0x4669('0x84')]();return db['OpenchannelQueue'][_0x4669('0x54')]({'where':{'id':_0x37631b[_0x4669('0x4b')]['id']}})[_0x4669('0x29')](function(_0x2168c3){return db[_0x4669('0x70')][_0x4669('0x71')](function(_0x3fa14c){return _0x2168c3['removeTeams'](_0x37631b[_0x4669('0x36')][_0x4669('0x6b')],{'transaction':_0x3fa14c})[_0x4669('0x29')](function(){if(!_[_0x4669('0x85')](_0x4435bf)){return _0x2168c3[_0x4669('0x86')](_0x4435bf,{'transaction':_0x3fa14c});}})[_0x4669('0x29')](function(){_0x4435bf[_0x4669('0x87')](function(_0x587490){socket[_0x4669('0x74')](_0x4669('0x88'),{'UserId':_0x587490,'OpenchannelQueueId':_0x2168c3['id']});});});});});});})[_0x4669('0x29')](respondWithStatusCode(_0x4c9a07,null))[_0x4669('0x49')](handleError(_0x4c9a07,null));};exports['addAgents']=function(_0x413ba2,_0x28429e,_0xafe021){return db['OpenchannelQueue'][_0x4669('0x54')]({'where':{'id':_0x413ba2[_0x4669('0x4b')]['id']}})[_0x4669('0x29')](handleEntityNotFound(_0x28429e,null))[_0x4669('0x29')](function(_0x392736){if(_0x392736){return _0x392736[_0x4669('0x89')](_0x413ba2['body']['ids'],_[_0x4669('0x8a')](_0x413ba2[_0x4669('0x4f')],[_0x4669('0x6b'),'id'])||{})['spread'](function(_0x5d11e3){for(var _0x1f5285=0x0;_0x1f5285<_0x413ba2[_0x4669('0x4f')][_0x4669('0x6b')]['length'];_0x1f5285+=0x1){socket[_0x4669('0x74')]('userOpenchannelQueue:save',{'UserId':_0x413ba2[_0x4669('0x4f')][_0x4669('0x6b')][_0x1f5285],'OpenchannelQueueId':_0x413ba2[_0x4669('0x4b')]['id']});}return _0x5d11e3;});}})[_0x4669('0x29')](respondWithResult(_0x28429e,null))[_0x4669('0x49')](handleError(_0x28429e,null));};exports[_0x4669('0x86')]=function(_0x228277,_0xcd3ee2,_0x33d7d2){return db[_0x4669('0x45')][_0x4669('0x54')]({'where':{'id':_0x228277['params']['id']}})[_0x4669('0x29')](handleEntityNotFound(_0xcd3ee2,null))[_0x4669('0x29')](function(_0x47febb){if(_0x47febb){return _0x47febb[_0x4669('0x86')](_0x228277[_0x4669('0x36')][_0x4669('0x6b')])[_0x4669('0x29')](function(){if(_[_0x4669('0x8b')](_0x228277['query'][_0x4669('0x6b')])){for(var _0x4c3711=0x0;_0x4c3711<_0x228277[_0x4669('0x36')][_0x4669('0x6b')][_0x4669('0x5c')];_0x4c3711+=0x1){socket[_0x4669('0x74')](_0x4669('0x88'),{'UserId':Number(_0x228277[_0x4669('0x36')]['ids'][_0x4c3711]),'OpenchannelQueueId':Number(_0x228277['params']['id'])});}}else{socket[_0x4669('0x74')](_0x4669('0x88'),{'UserId':Number(_0x228277[_0x4669('0x36')][_0x4669('0x6b')]),'OpenchannelQueueId':Number(_0x228277[_0x4669('0x4b')]['id'])});}});}})[_0x4669('0x29')](respondWithStatusCode(_0xcd3ee2,null))[_0x4669('0x49')](handleError(_0xcd3ee2,null));};exports[_0x4669('0x8c')]=function(_0x17f749,_0xb9d174,_0x3c2407){var _0x42ae12={};var _0xab0610={};var _0x507834;var _0x578a61;return db[_0x4669('0x45')][_0x4669('0x5a')]({'where':{'id':_0x17f749[_0x4669('0x4b')]['id']}})[_0x4669('0x29')](handleEntityNotFound(_0xb9d174,null))[_0x4669('0x29')](function(_0x9ec0b1){if(_0x9ec0b1){_0x507834=_0x9ec0b1;_0xab0610['model']=_[_0x4669('0x4c')](db[_0x4669('0x5f')]['rawAttributes']);_0xab0610[_0x4669('0x36')]=_['keys'](_0x17f749[_0x4669('0x36')]);_0xab0610['filters']=_['intersection'](_0xab0610[_0x4669('0x35')],_0xab0610['query']);_0x42ae12[_0x4669('0x3a')]=_[_0x4669('0x38')](_0xab0610['model'],qs[_0x4669('0x39')](_0x17f749[_0x4669('0x36')][_0x4669('0x39')]));_0x42ae12[_0x4669('0x3a')]=_0x42ae12['attributes'][_0x4669('0x5c')]?_0x42ae12['attributes']:_0xab0610[_0x4669('0x35')];_0x42ae12[_0x4669('0x3e')]=qs[_0x4669('0x3f')](_0x17f749[_0x4669('0x36')]['sort']);_0x42ae12[_0x4669('0x40')]=qs[_0x4669('0x37')](_[_0x4669('0x41')](_0x17f749['query'],_0xab0610[_0x4669('0x37')]));if(_0x17f749[_0x4669('0x36')][_0x4669('0x42')]){_0x42ae12['where']=_[_0x4669('0x44')](_0x42ae12[_0x4669('0x40')],{'$or':_[_0x4669('0x30')](_0x42ae12[_0x4669('0x3a')],function(_0x439184){var _0x42b57e={};_0x42b57e[_0x439184]={'$like':'%'+_0x17f749[_0x4669('0x36')]['filter']+'%'};return _0x42b57e;})});}_0x42ae12=_[_0x4669('0x44')]({},_0x42ae12,_0x17f749[_0x4669('0x5e')]);return _0x507834[_0x4669('0x8c')](_0x42ae12);}})[_0x4669('0x29')](function(_0x32b358){if(_0x32b358){_0x578a61=_0x32b358[_0x4669('0x5c')];if(!_0x17f749['query'][_0x4669('0x3b')](_0x4669('0x6a'))){_0x42ae12[_0x4669('0x3c')]=qs[_0x4669('0x3c')](_0x17f749[_0x4669('0x36')][_0x4669('0x3c')]);_0x42ae12['offset']=qs[_0x4669('0x3d')](_0x17f749[_0x4669('0x36')][_0x4669('0x3d')]);}return _0x507834[_0x4669('0x8c')](_0x42ae12);}})[_0x4669('0x29')](function(_0xa1b66e){if(_0xa1b66e){return _0xa1b66e?{'count':_0x578a61,'rows':_0xa1b66e}:null;}})[_0x4669('0x29')](respondWithResult(_0xb9d174,null))[_0x4669('0x49')](handleError(_0xb9d174,null));};
\ No newline at end of file
+var _0x2b22=['find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','length','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','addTeams','ids','Team','online','voicePause','interface','sequelize','each','findOrCreate','forEach','emit','removeTeams','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','Agents','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','all','union','compact','value','transaction','isEmpty','addAgents','omit','userOpenchannelQueue:save','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','merge'];(function(_0x25e5ef,_0x2a1960){var _0xbbb239=function(_0x134f23){while(--_0x134f23){_0x25e5ef['push'](_0x25e5ef['shift']());}};_0xbbb239(++_0x2a1960);}(_0x2b22,0x15e));var _0x22b2=function(_0x27522d,_0x266e5c){_0x27522d=_0x27522d-0x0;var _0x20a9af=_0x2b22[_0x27522d];return _0x20a9af;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x22b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x22b2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x22b2('0x2'));var BPromise=require(_0x22b2('0x3'));var Mustache=require('mustache');var util=require(_0x22b2('0x4'));var path=require(_0x22b2('0x5'));var sox=require(_0x22b2('0x6'));var csv=require(_0x22b2('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x22b2('0x8'));var squel=require(_0x22b2('0x9'));var crypto=require(_0x22b2('0xa'));var jsforce=require(_0x22b2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x22b2('0x7'));var querystring=require(_0x22b2('0xc'));var Papa=require(_0x22b2('0xd'));var Redis=require('ioredis');var authService=require(_0x22b2('0xe'));var qs=require(_0x22b2('0xf'));var as=require(_0x22b2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x22b2('0x11'))(_0x22b2('0x12'));var utils=require(_0x22b2('0x13'));var config=require(_0x22b2('0x14'));var db=require(_0x22b2('0x15'))['db'];config['redis']=_[_0x22b2('0x16')](config['redis'],{'host':_0x22b2('0x17'),'port':0x18eb});var socket=require(_0x22b2('0x18'))(new Redis(config[_0x22b2('0x19')]));require(_0x22b2('0x1a'))[_0x22b2('0x1b')](socket);function respondWithStatusCode(_0x177dcd,_0x168a7c){_0x168a7c=_0x168a7c||0xcc;return function(_0x5524e9){if(_0x5524e9){return _0x177dcd[_0x22b2('0x1c')](_0x168a7c);}return _0x177dcd[_0x22b2('0x1d')](_0x168a7c)[_0x22b2('0x1e')]();};}function respondWithResult(_0x126a87,_0x21f777){_0x21f777=_0x21f777||0xc8;return function(_0x2c353c){if(_0x2c353c){return _0x126a87[_0x22b2('0x1d')](_0x21f777)[_0x22b2('0x1f')](_0x2c353c);}};}function respondWithFilteredResult(_0x1fc80c,_0x365fc4){return function(_0x47d14e){if(_0x47d14e){var _0x576ab9=_0x47d14e[_0x22b2('0x20')],_0x40f7f3=_0x365fc4[_0x22b2('0x21')],_0x4bec80=_0x365fc4[_0x22b2('0x21')]+_0x365fc4[_0x22b2('0x22')],_0x35882d;if(_0x4bec80>=_0x576ab9){_0x4bec80=_0x576ab9;_0x35882d=0xc8;}else{_0x35882d=0xce;}_0x1fc80c[_0x22b2('0x1d')](_0x35882d);return _0x1fc80c[_0x22b2('0x23')](_0x22b2('0x24'),_0x40f7f3+'-'+_0x4bec80+'/'+_0x576ab9)[_0x22b2('0x1f')](_0x47d14e);}return null;};}function patchUpdates(_0xa5ec20){return function(_0x154389){try{jsonpatch[_0x22b2('0x25')](_0x154389,_0xa5ec20,!![]);}catch(_0x4a3bb1){return BPromise[_0x22b2('0x26')](_0x4a3bb1);}return _0x154389[_0x22b2('0x27')]();};}function saveUpdates(_0x5df453,_0x40e76a){return function(_0x2623a1){if(_0x2623a1){return _0x2623a1[_0x22b2('0x28')](_0x5df453)[_0x22b2('0x29')](function(_0xc1e31c){return _0xc1e31c;});}return null;};}function removeEntity(_0x1d8e2b,_0x18bc93){return function(_0x29bb5c){if(_0x29bb5c){return _0x29bb5c[_0x22b2('0x2a')]()[_0x22b2('0x29')](function(){var _0x2e77b4=_0x29bb5c[_0x22b2('0x2b')]({'plain':!![]});var _0x504ec3='OpenchannelQueues';return db[_0x22b2('0x2c')][_0x22b2('0x2a')]({'where':{'type':_0x504ec3,'resourceId':_0x2e77b4['id']}})[_0x22b2('0x29')](function(){return _0x29bb5c;});})[_0x22b2('0x29')](function(){_0x1d8e2b[_0x22b2('0x1d')](0xcc)[_0x22b2('0x1e')]();});}};}function handleEntityNotFound(_0x32c9bb,_0x497c32){return function(_0xb9dfa5){if(!_0xb9dfa5){_0x32c9bb['sendStatus'](0x194);}return _0xb9dfa5;};}function handleError(_0x2b508d,_0x4a841b){_0x4a841b=_0x4a841b||0x1f4;return function(_0x3ffdca){logger['error'](_0x3ffdca['stack']);if(_0x3ffdca['name']){delete _0x3ffdca['name'];}_0x2b508d[_0x22b2('0x1d')](_0x4a841b)[_0x22b2('0x2d')](_0x3ffdca);};}exports[_0x22b2('0x2e')]=function(_0x297625,_0x3cfb73){var _0x6da0af={},_0x5c0871={},_0x11c7ca={'count':0x0,'rows':[]};var _0x1e8cc5=_[_0x22b2('0x2f')](db[_0x22b2('0x30')][_0x22b2('0x31')],function(_0x51d562){return{'name':_0x51d562[_0x22b2('0x32')],'type':_0x51d562[_0x22b2('0x33')]['key']};});_0x5c0871[_0x22b2('0x34')]=_[_0x22b2('0x2f')](_0x1e8cc5,_0x22b2('0x35'));_0x5c0871[_0x22b2('0x36')]=_['keys'](_0x297625[_0x22b2('0x36')]);_0x5c0871[_0x22b2('0x37')]=_[_0x22b2('0x38')](_0x5c0871[_0x22b2('0x34')],_0x5c0871['query']);_0x6da0af[_0x22b2('0x39')]=_[_0x22b2('0x38')](_0x5c0871[_0x22b2('0x34')],qs[_0x22b2('0x3a')](_0x297625[_0x22b2('0x36')][_0x22b2('0x3a')]));_0x6da0af[_0x22b2('0x39')]=_0x6da0af[_0x22b2('0x39')]['length']?_0x6da0af[_0x22b2('0x39')]:_0x5c0871[_0x22b2('0x34')];if(!_0x297625[_0x22b2('0x36')][_0x22b2('0x3b')](_0x22b2('0x3c'))){_0x6da0af[_0x22b2('0x22')]=qs[_0x22b2('0x22')](_0x297625[_0x22b2('0x36')]['limit']);_0x6da0af[_0x22b2('0x21')]=qs[_0x22b2('0x21')](_0x297625[_0x22b2('0x36')][_0x22b2('0x21')]);}_0x6da0af[_0x22b2('0x3d')]=qs[_0x22b2('0x3e')](_0x297625[_0x22b2('0x36')][_0x22b2('0x3e')]);_0x6da0af[_0x22b2('0x3f')]=qs[_0x22b2('0x37')](_[_0x22b2('0x40')](_0x297625[_0x22b2('0x36')],_0x5c0871[_0x22b2('0x37')]),_0x1e8cc5);if(_0x297625[_0x22b2('0x36')][_0x22b2('0x41')]){_0x6da0af['where']=_['merge'](_0x6da0af['where'],{'$or':_['map'](_0x1e8cc5,function(_0x1cacea){if(_0x1cacea['type']!==_0x22b2('0x42')){var _0x2c8760={};_0x2c8760[_0x1cacea['name']]={'$like':'%'+_0x297625['query'][_0x22b2('0x41')]+'%'};return _0x2c8760;}})});}_0x6da0af=_['merge']({},_0x6da0af,_0x297625[_0x22b2('0x43')]);var _0x19c584={'where':_0x6da0af[_0x22b2('0x3f')]};return db[_0x22b2('0x30')][_0x22b2('0x20')](_0x19c584)[_0x22b2('0x29')](function(_0x3b8567){_0x11c7ca[_0x22b2('0x20')]=_0x3b8567;if(_0x297625[_0x22b2('0x36')][_0x22b2('0x44')]){_0x6da0af[_0x22b2('0x45')]=[{'all':!![]}];}return db[_0x22b2('0x30')][_0x22b2('0x46')](_0x6da0af);})['then'](function(_0x248d6f){_0x11c7ca['rows']=_0x248d6f;return _0x11c7ca;})['then'](respondWithFilteredResult(_0x3cfb73,_0x6da0af))[_0x22b2('0x47')](handleError(_0x3cfb73,null));};exports[_0x22b2('0x48')]=function(_0x57e906,_0x2b4757){var _0x74caeb={'raw':!![],'where':{'id':_0x57e906[_0x22b2('0x49')]['id']}},_0x210d1b={};_0x210d1b[_0x22b2('0x34')]=_[_0x22b2('0x4a')](db['OpenchannelQueue'][_0x22b2('0x31')]);_0x210d1b['query']=_[_0x22b2('0x4a')](_0x57e906[_0x22b2('0x36')]);_0x210d1b[_0x22b2('0x37')]=_['intersection'](_0x210d1b[_0x22b2('0x34')],_0x210d1b[_0x22b2('0x36')]);_0x74caeb['attributes']=_[_0x22b2('0x38')](_0x210d1b[_0x22b2('0x34')],qs[_0x22b2('0x3a')](_0x57e906[_0x22b2('0x36')][_0x22b2('0x3a')]));_0x74caeb[_0x22b2('0x39')]=_0x74caeb[_0x22b2('0x39')]['length']?_0x74caeb[_0x22b2('0x39')]:_0x210d1b[_0x22b2('0x34')];if(_0x57e906[_0x22b2('0x36')][_0x22b2('0x44')]){_0x74caeb[_0x22b2('0x45')]=[{'all':!![]}];}_0x74caeb=_[_0x22b2('0x4b')]({},_0x74caeb,_0x57e906[_0x22b2('0x43')]);return db['OpenchannelQueue'][_0x22b2('0x4c')](_0x74caeb)[_0x22b2('0x29')](handleEntityNotFound(_0x2b4757,null))[_0x22b2('0x29')](respondWithResult(_0x2b4757,null))[_0x22b2('0x47')](handleError(_0x2b4757,null));};exports['create']=function(_0x2e24e7,_0x1fa49f){return db['OpenchannelQueue']['create'](_0x2e24e7['body'],{})[_0x22b2('0x29')](function(_0x39cf59){var _0x803df5=_0x2e24e7['user']['get']({'plain':!![]});if(!_0x803df5)throw new Error(_0x22b2('0x4d'));if(_0x803df5[_0x22b2('0x4e')]===_0x22b2('0x4f')){var _0xfbe4c7=_0x39cf59['get']({'plain':!![]});var _0x872094=_0x22b2('0x50');return db[_0x22b2('0x51')][_0x22b2('0x4c')]({'where':{'name':_0x872094,'userProfileId':_0x803df5[_0x22b2('0x52')]},'raw':!![]})['then'](function(_0x299418){if(_0x299418&&_0x299418[_0x22b2('0x53')]===0x0){return db[_0x22b2('0x2c')]['create']({'name':_0xfbe4c7[_0x22b2('0x35')],'resourceId':_0xfbe4c7['id'],'type':_0x299418[_0x22b2('0x35')],'sectionId':_0x299418['id']},{})[_0x22b2('0x29')](function(){return _0x39cf59;});}else{return _0x39cf59;}})[_0x22b2('0x47')](function(_0x20df1f){logger[_0x22b2('0x54')](_0x22b2('0x55'),_0x20df1f);throw _0x20df1f;});}return _0x39cf59;})[_0x22b2('0x29')](respondWithResult(_0x1fa49f,0xc9))[_0x22b2('0x47')](handleError(_0x1fa49f,null));};exports[_0x22b2('0x28')]=function(_0x360e4e,_0x14fbd5){if(_0x360e4e[_0x22b2('0x56')]['id']){delete _0x360e4e[_0x22b2('0x56')]['id'];}return db[_0x22b2('0x30')][_0x22b2('0x4c')]({'where':{'id':_0x360e4e[_0x22b2('0x49')]['id']}})[_0x22b2('0x29')](handleEntityNotFound(_0x14fbd5,null))[_0x22b2('0x29')](saveUpdates(_0x360e4e[_0x22b2('0x56')],null))[_0x22b2('0x29')](respondWithResult(_0x14fbd5,null))['catch'](handleError(_0x14fbd5,null));};exports['destroy']=function(_0x13ebc4,_0x2aa0f3){return db[_0x22b2('0x30')][_0x22b2('0x4c')]({'where':{'id':_0x13ebc4['params']['id']}})[_0x22b2('0x29')](handleEntityNotFound(_0x2aa0f3,null))['then'](removeEntity(_0x2aa0f3,null))['catch'](handleError(_0x2aa0f3,null));};exports[_0x22b2('0x57')]=function(_0x2189db,_0x45fcc0){return db['OpenchannelQueue'][_0x22b2('0x57')]()[_0x22b2('0x29')](respondWithResult(_0x45fcc0,null))[_0x22b2('0x47')](handleError(_0x45fcc0,null));};exports[_0x22b2('0x58')]=function(_0x4debf6,_0x25a00c,_0x4790b4){var _0x53a7a9={'raw':!![],'where':{}},_0x14e393={},_0x4e4928;return db[_0x22b2('0x30')][_0x22b2('0x59')]({'where':{'id':_0x4debf6[_0x22b2('0x49')]['id']}})[_0x22b2('0x29')](handleEntityNotFound(_0x25a00c,null))['then'](function(_0x1e6bba){if(_0x1e6bba){_0x4e4928=_0x1e6bba['get']({'plain':!![]});_0x14e393[_0x22b2('0x34')]=_['keys'](db[_0x22b2('0x5a')][_0x22b2('0x31')]);_0x14e393[_0x22b2('0x36')]=_[_0x22b2('0x4a')](_0x4debf6[_0x22b2('0x36')]);_0x14e393[_0x22b2('0x37')]=_[_0x22b2('0x38')](_0x14e393[_0x22b2('0x34')],_0x14e393[_0x22b2('0x36')]);_0x53a7a9[_0x22b2('0x39')]=_[_0x22b2('0x38')](_0x14e393['model'],qs[_0x22b2('0x3a')](_0x4debf6[_0x22b2('0x36')][_0x22b2('0x3a')]));_0x53a7a9['attributes']=_0x53a7a9[_0x22b2('0x39')][_0x22b2('0x5b')]?_0x53a7a9['attributes']:_0x14e393[_0x22b2('0x34')];if(!_0x4debf6[_0x22b2('0x36')][_0x22b2('0x3b')](_0x22b2('0x3c'))){_0x53a7a9[_0x22b2('0x22')]=qs['limit'](_0x4debf6[_0x22b2('0x36')][_0x22b2('0x22')]);_0x53a7a9['offset']=qs[_0x22b2('0x21')](_0x4debf6[_0x22b2('0x36')][_0x22b2('0x21')]);}_0x53a7a9[_0x22b2('0x3d')]=qs[_0x22b2('0x3e')](_0x4debf6['query'][_0x22b2('0x3e')]);_0x53a7a9[_0x22b2('0x3f')]=qs[_0x22b2('0x37')](_['pick'](_0x4debf6[_0x22b2('0x36')],_0x14e393[_0x22b2('0x37')]));_0x53a7a9['where'][_0x22b2('0x5c')]=_0x1e6bba['id'];if(_0x4debf6[_0x22b2('0x36')][_0x22b2('0x41')]){_0x53a7a9[_0x22b2('0x3f')]=_[_0x22b2('0x4b')](_0x53a7a9[_0x22b2('0x3f')],{'$or':_[_0x22b2('0x2f')](_0x53a7a9['attributes'],function(_0x4038b2){var _0x2c820d={};_0x2c820d[_0x4038b2]={'$like':'%'+_0x4debf6['query'][_0x22b2('0x41')]+'%'};return _0x2c820d;})});}_0x53a7a9=_['merge']({},_0x53a7a9,_0x4debf6[_0x22b2('0x43')]);return db[_0x22b2('0x5a')][_0x22b2('0x46')](_0x53a7a9);}})[_0x22b2('0x29')](function(_0x3c0d48){if(_0x3c0d48){return db[_0x22b2('0x5d')][_0x22b2('0x5e')]({'where':{'id':_[_0x22b2('0x2f')](_0x3c0d48,_0x22b2('0x5f')),'role':_0x22b2('0x60')},'attributes':['id',_0x22b2('0x35'),_0x22b2('0x61'),_0x22b2('0x62'),'createdAt']});}})['then'](function(_0x10cf03){if(_0x10cf03){return{'count':_0x10cf03['count'],'rows':_[_0x22b2('0x2f')](_0x10cf03[_0x22b2('0x63')],function(_0x1685b2){return{'membername':_0x1685b2[_0x22b2('0x35')],'UserId':_0x1685b2['id'],'queue_name':_0x4e4928['name'],'OpenchannelQueueId':_0x4e4928['id'],'interface':util[_0x22b2('0x64')](_0x22b2('0x65'),_0x22b2('0x66'),_0x1685b2[_0x22b2('0x35')]),'penalty':0x0,'paused':_0x1685b2[_0x22b2('0x61')],'createdAt':_0x1685b2[_0x22b2('0x67')],'updatedAt':_0x1685b2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x22b2('0x29')](respondWithFilteredResult(_0x25a00c,_0x53a7a9))['catch'](handleError(_0x25a00c,null));};exports[_0x22b2('0x68')]=function(_0x80baa3,_0x282060,_0x25af4c){var _0x5661d2={};var _0x5963a4={};var _0x42d78a;var _0xa4b2cf;return db[_0x22b2('0x30')]['findOne']({'where':{'id':_0x80baa3[_0x22b2('0x49')]['id']}})['then'](handleEntityNotFound(_0x282060,null))[_0x22b2('0x29')](function(_0x2096ea){if(_0x2096ea){_0x42d78a=_0x2096ea;_0x5963a4[_0x22b2('0x34')]=_['keys'](db['Team'][_0x22b2('0x31')]);_0x5963a4['query']=_[_0x22b2('0x4a')](_0x80baa3[_0x22b2('0x36')]);_0x5963a4[_0x22b2('0x37')]=_[_0x22b2('0x38')](_0x5963a4[_0x22b2('0x34')],_0x5963a4['query']);_0x5661d2[_0x22b2('0x39')]=_[_0x22b2('0x38')](_0x5963a4[_0x22b2('0x34')],qs['fields'](_0x80baa3[_0x22b2('0x36')][_0x22b2('0x3a')]));_0x5661d2[_0x22b2('0x39')]=_0x5661d2[_0x22b2('0x39')][_0x22b2('0x5b')]?_0x5661d2['attributes']:_0x5963a4[_0x22b2('0x34')];_0x5661d2[_0x22b2('0x3d')]=qs[_0x22b2('0x3e')](_0x80baa3[_0x22b2('0x36')][_0x22b2('0x3e')]);_0x5661d2[_0x22b2('0x3f')]=qs[_0x22b2('0x37')](_[_0x22b2('0x40')](_0x80baa3[_0x22b2('0x36')],_0x5963a4[_0x22b2('0x37')]));if(_0x80baa3[_0x22b2('0x36')]['filter']){_0x5661d2[_0x22b2('0x3f')]=_[_0x22b2('0x4b')](_0x5661d2['where'],{'$or':_[_0x22b2('0x2f')](_0x5661d2[_0x22b2('0x39')],function(_0x112372){var _0x5513ac={};_0x5513ac[_0x112372]={'$like':'%'+_0x80baa3[_0x22b2('0x36')][_0x22b2('0x41')]+'%'};return _0x5513ac;})});}_0x5661d2=_['merge']({},_0x5661d2,_0x80baa3['options']);return _0x42d78a['getTeams'](_0x5661d2);}})[_0x22b2('0x29')](function(_0x59e7d2){if(_0x59e7d2){_0xa4b2cf=_0x59e7d2[_0x22b2('0x5b')];if(!_0x80baa3[_0x22b2('0x36')][_0x22b2('0x3b')](_0x22b2('0x3c'))){_0x5661d2[_0x22b2('0x22')]=qs[_0x22b2('0x22')](_0x80baa3[_0x22b2('0x36')]['limit']);_0x5661d2['offset']=qs[_0x22b2('0x21')](_0x80baa3[_0x22b2('0x36')][_0x22b2('0x21')]);}return _0x42d78a[_0x22b2('0x68')](_0x5661d2);}})[_0x22b2('0x29')](function(_0x44503f){if(_0x44503f){return _0x44503f?{'count':_0xa4b2cf,'rows':_0x44503f}:null;}})[_0x22b2('0x29')](respondWithResult(_0x282060,null))[_0x22b2('0x47')](handleError(_0x282060,null));};exports[_0x22b2('0x69')]=function(_0x2d24ad,_0x295c08,_0x4430c2){var _0x201b0c=_0x2d24ad[_0x22b2('0x56')][_0x22b2('0x6a')];return db[_0x22b2('0x6b')][_0x22b2('0x46')]({'where':{'id':_0x201b0c},'attributes':['id'],'include':[{'model':db[_0x22b2('0x5d')],'as':'Agents','attributes':['id',_0x22b2('0x35'),_0x22b2('0x6c'),_0x22b2('0x6d'),_0x22b2('0x6e')],'raw':!![]}]})[_0x22b2('0x29')](function(_0x1f308a){if(_0x1f308a){var _0x52e95a=_['flatMap'](_0x1f308a,function(_0x39f5c8){var _0x5039df=_0x39f5c8[_0x22b2('0x2b')]({'plain':!![]});return _0x5039df['Agents'];});return db[_0x22b2('0x30')][_0x22b2('0x4c')]({'where':{'id':_0x2d24ad['params']['id']}})[_0x22b2('0x29')](function(_0x35a777){return db[_0x22b2('0x6f')]['transaction'](function(_0x5c2528){return _0x35a777[_0x22b2('0x69')](_0x201b0c,{'transaction':_0x5c2528})[_0x22b2('0x29')](function(){return BPromise[_0x22b2('0x70')](_0x52e95a,function(_0x5481d1){return db[_0x22b2('0x5a')][_0x22b2('0x71')]({'where':{'UserId':_0x5481d1['id'],'OpenchannelQueueId':_0x2d24ad[_0x22b2('0x49')]['id']},'transaction':_0x5c2528});});})[_0x22b2('0x29')](function(){_0x52e95a[_0x22b2('0x72')](function(_0x402c54){socket[_0x22b2('0x73')]('userOpenchannelQueue:save',{'UserId':_0x402c54['id'],'OpenchannelQueueId':_0x35a777['id']});});});});});}})[_0x22b2('0x29')](respondWithStatusCode(_0x295c08,null))['catch'](handleError(_0x295c08,null));};exports[_0x22b2('0x74')]=function(_0x4c098b,_0x261c9b,_0x22f24e){return db[_0x22b2('0x6b')]['findAll']({'where':{'id':_0x4c098b[_0x22b2('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x22b2('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x22b2('0x29')](handleEntityNotFound(_0x261c9b,null))[_0x22b2('0x29')](function(_0x5e3d90){var _0x4135a8=_[_0x22b2('0x2f')](_0x5e3d90,'id');var _0x4741f7=[];var _0x493be8=[];var _0xa735e1=squel['select']();_0xa735e1[_0x22b2('0x75')]('tq.TeamId')['from']('team_has_openchannel_queues','tq')[_0x22b2('0x76')](_0x22b2('0x77'),'ut',_0x22b2('0x78'))[_0x22b2('0x3f')](_0x22b2('0x79'),_0x4c098b[_0x22b2('0x49')]['id']);for(var _0x55a891=0x0;_0x55a891<_0x5e3d90[_0x22b2('0x5b')];_0x55a891+=0x1){let _0x4effd4=_0x5e3d90[_0x55a891];for(var _0x4ead2b=0x0;_0x4ead2b<_0x4effd4[_0x22b2('0x7a')][_0x22b2('0x5b')];_0x4ead2b+=0x1){let _0x24017f=_0x4effd4[_0x22b2('0x7a')][_0x4ead2b];var _0x372669=_0xa735e1[_0x22b2('0x7b')]();_0x372669['where'](_0x22b2('0x7c'),_0x24017f['id']);_0x493be8[_0x22b2('0x7d')](db[_0x22b2('0x6f')][_0x22b2('0x36')](_0x372669['toString'](),{'type':db[_0x22b2('0x6f')][_0x22b2('0x7e')][_0x22b2('0x7f')]})['then'](function(_0x23f0ed){if(_0x23f0ed[_0x22b2('0x5b')]===0x1){return _0x24017f['id'];}else{var _0x4ec637=_[_0x22b2('0x80')](_[_0x22b2('0x2f')](_0x23f0ed,'TeamId'),function(_0x4caab4){return _['includes'](_0x4135a8,_0x4caab4);});if(_0x4ec637){return _0x24017f['id'];}}}));}}return BPromise[_0x22b2('0x81')](_0x493be8)['then'](function(_0x40e2d7){_0x4741f7=_(_0x4741f7)[_0x22b2('0x82')](_0x40e2d7)[_0x22b2('0x83')]()[_0x22b2('0x84')]();return db[_0x22b2('0x30')]['find']({'where':{'id':_0x4c098b[_0x22b2('0x49')]['id']}})[_0x22b2('0x29')](function(_0x519527){return db['sequelize'][_0x22b2('0x85')](function(_0xa84e12){return _0x519527[_0x22b2('0x74')](_0x4c098b[_0x22b2('0x36')][_0x22b2('0x6a')],{'transaction':_0xa84e12})['then'](function(){if(!_[_0x22b2('0x86')](_0x4741f7)){return _0x519527['removeAgents'](_0x4741f7,{'transaction':_0xa84e12});}})[_0x22b2('0x29')](function(){_0x4741f7['forEach'](function(_0x36bb87){socket[_0x22b2('0x73')]('userOpenchannelQueue:remove',{'UserId':_0x36bb87,'OpenchannelQueueId':_0x519527['id']});});});});});});})[_0x22b2('0x29')](respondWithStatusCode(_0x261c9b,null))[_0x22b2('0x47')](handleError(_0x261c9b,null));};exports[_0x22b2('0x87')]=function(_0xfbdb43,_0x2f7093,_0x5b5682){return db[_0x22b2('0x30')][_0x22b2('0x4c')]({'where':{'id':_0xfbdb43[_0x22b2('0x49')]['id']}})[_0x22b2('0x29')](handleEntityNotFound(_0x2f7093,null))['then'](function(_0x4986d1){if(_0x4986d1){return _0x4986d1[_0x22b2('0x87')](_0xfbdb43[_0x22b2('0x56')]['ids'],_[_0x22b2('0x88')](_0xfbdb43['body'],[_0x22b2('0x6a'),'id'])||{})['spread'](function(_0x1b6bee){for(var _0x74170=0x0;_0x74170<_0xfbdb43[_0x22b2('0x56')][_0x22b2('0x6a')]['length'];_0x74170+=0x1){socket['emit'](_0x22b2('0x89'),{'UserId':_0xfbdb43[_0x22b2('0x56')]['ids'][_0x74170],'OpenchannelQueueId':_0xfbdb43[_0x22b2('0x49')]['id']});}return _0x1b6bee;});}})[_0x22b2('0x29')](respondWithResult(_0x2f7093,null))[_0x22b2('0x47')](handleError(_0x2f7093,null));};exports[_0x22b2('0x8a')]=function(_0x27a95e,_0x340c00,_0x3d4a2d){return db[_0x22b2('0x30')][_0x22b2('0x4c')]({'where':{'id':_0x27a95e['params']['id']}})[_0x22b2('0x29')](handleEntityNotFound(_0x340c00,null))['then'](function(_0x4cec94){if(_0x4cec94){return _0x4cec94[_0x22b2('0x8a')](_0x27a95e['query'][_0x22b2('0x6a')])['then'](function(){if(_[_0x22b2('0x8b')](_0x27a95e['query'][_0x22b2('0x6a')])){for(var _0x5ba2e1=0x0;_0x5ba2e1<_0x27a95e[_0x22b2('0x36')][_0x22b2('0x6a')]['length'];_0x5ba2e1+=0x1){socket['emit'](_0x22b2('0x8c'),{'UserId':Number(_0x27a95e['query'][_0x22b2('0x6a')][_0x5ba2e1]),'OpenchannelQueueId':Number(_0x27a95e[_0x22b2('0x49')]['id'])});}}else{socket[_0x22b2('0x73')](_0x22b2('0x8c'),{'UserId':Number(_0x27a95e[_0x22b2('0x36')][_0x22b2('0x6a')]),'OpenchannelQueueId':Number(_0x27a95e[_0x22b2('0x49')]['id'])});}});}})[_0x22b2('0x29')](respondWithStatusCode(_0x340c00,null))[_0x22b2('0x47')](handleError(_0x340c00,null));};exports[_0x22b2('0x8d')]=function(_0x12bd94,_0x10be62,_0x31777c){var _0x3003de={};var _0x1c7fa8={};var _0x4f941a;var _0x3b57a9;return db[_0x22b2('0x30')][_0x22b2('0x59')]({'where':{'id':_0x12bd94['params']['id']}})['then'](handleEntityNotFound(_0x10be62,null))[_0x22b2('0x29')](function(_0xf88d8b){if(_0xf88d8b){_0x4f941a=_0xf88d8b;_0x1c7fa8[_0x22b2('0x34')]=_[_0x22b2('0x4a')](db[_0x22b2('0x5d')][_0x22b2('0x31')]);_0x1c7fa8[_0x22b2('0x36')]=_['keys'](_0x12bd94[_0x22b2('0x36')]);_0x1c7fa8[_0x22b2('0x37')]=_[_0x22b2('0x38')](_0x1c7fa8['model'],_0x1c7fa8[_0x22b2('0x36')]);_0x3003de[_0x22b2('0x39')]=_[_0x22b2('0x38')](_0x1c7fa8[_0x22b2('0x34')],qs[_0x22b2('0x3a')](_0x12bd94['query'][_0x22b2('0x3a')]));_0x3003de[_0x22b2('0x39')]=_0x3003de[_0x22b2('0x39')][_0x22b2('0x5b')]?_0x3003de[_0x22b2('0x39')]:_0x1c7fa8[_0x22b2('0x34')];_0x3003de[_0x22b2('0x3d')]=qs[_0x22b2('0x3e')](_0x12bd94[_0x22b2('0x36')][_0x22b2('0x3e')]);_0x3003de[_0x22b2('0x3f')]=qs['filters'](_[_0x22b2('0x40')](_0x12bd94[_0x22b2('0x36')],_0x1c7fa8[_0x22b2('0x37')]));if(_0x12bd94[_0x22b2('0x36')][_0x22b2('0x41')]){_0x3003de[_0x22b2('0x3f')]=_['merge'](_0x3003de[_0x22b2('0x3f')],{'$or':_[_0x22b2('0x2f')](_0x3003de['attributes'],function(_0x1b177c){var _0x56137a={};_0x56137a[_0x1b177c]={'$like':'%'+_0x12bd94[_0x22b2('0x36')]['filter']+'%'};return _0x56137a;})});}_0x3003de=_[_0x22b2('0x4b')]({},_0x3003de,_0x12bd94[_0x22b2('0x43')]);return _0x4f941a[_0x22b2('0x8d')](_0x3003de);}})[_0x22b2('0x29')](function(_0x5a495b){if(_0x5a495b){_0x3b57a9=_0x5a495b[_0x22b2('0x5b')];if(!_0x12bd94['query'][_0x22b2('0x3b')](_0x22b2('0x3c'))){_0x3003de[_0x22b2('0x22')]=qs[_0x22b2('0x22')](_0x12bd94[_0x22b2('0x36')][_0x22b2('0x22')]);_0x3003de[_0x22b2('0x21')]=qs[_0x22b2('0x21')](_0x12bd94[_0x22b2('0x36')][_0x22b2('0x21')]);}return _0x4f941a[_0x22b2('0x8d')](_0x3003de);}})['then'](function(_0x298ea0){if(_0x298ea0){return _0x298ea0?{'count':_0x3b57a9,'rows':_0x298ea0}:null;}})[_0x22b2('0x29')](respondWithResult(_0x10be62,null))[_0x22b2('0x47')](handleError(_0x10be62,null));};
\ No newline at end of file
index f1307b4..f6a3d10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0746=['update','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x418b55,_0x460d11){var _0x4a05c7=function(_0x1dae95){while(--_0x1dae95){_0x418b55['push'](_0x418b55['shift']());}};_0x4a05c7(++_0x460d11);}(_0x0746,0xfa));var _0x6074=function(_0x1f222c,_0x33603a){_0x1f222c=_0x1f222c-0x0;var _0xa42cb1=_0x0746[_0x1f222c];return _0xa42cb1;};'use strict';var EventEmitter=require(_0x6074('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6074('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6074('0x2'),'afterDestroy':'remove'};function emitEvent(_0x142f13){return function(_0x26b88e,_0x3c9d68,_0x576e20){OpenchannelQueueEvents[_0x6074('0x3')](_0x142f13+':'+_0x26b88e['id'],_0x26b88e);OpenchannelQueueEvents[_0x6074('0x3')](_0x142f13,_0x26b88e);_0x576e20(null);};}for(var e in events){if(events[_0x6074('0x4')](e)){var event=events[e];OpenchannelQueue[_0x6074('0x5')](e,emitEvent(event));}}module[_0x6074('0x6')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x6c37=['OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x35aeda,_0x264a31){var _0x40498c=function(_0x25f8fc){while(--_0x25f8fc){_0x35aeda['push'](_0x35aeda['shift']());}};_0x40498c(++_0x264a31);}(_0x6c37,0x13a));var _0x76c3=function(_0x208c3b,_0x3481c0){_0x208c3b=_0x208c3b-0x0;var _0x1ea841=_0x6c37[_0x208c3b];return _0x1ea841;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x76c3('0x0'))['db'][_0x76c3('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x76c3('0x2')](0x0);var events={'afterCreate':_0x76c3('0x3'),'afterUpdate':_0x76c3('0x4'),'afterDestroy':_0x76c3('0x5')};function emitEvent(_0x244ed5){return function(_0xd2635f,_0x49b1bb,_0xd5213c){OpenchannelQueueEvents[_0x76c3('0x6')](_0x244ed5+':'+_0xd2635f['id'],_0xd2635f);OpenchannelQueueEvents[_0x76c3('0x6')](_0x244ed5,_0xd2635f);_0xd5213c(null);};}for(var e in events){if(events[_0x76c3('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x76c3('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
index 78c4e10..64cf8ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7acf=['request-promise','path','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','util','api','moment','bluebird'];(function(_0x2df182,_0xfa060d){var _0x2240eb=function(_0x222c60){while(--_0x222c60){_0x2df182['push'](_0x2df182['shift']());}};_0x2240eb(++_0xfa060d);}(_0x7acf,0x8b));var _0xf7ac=function(_0x3d0112,_0x5adb56){_0x3d0112=_0x3d0112-0x0;var _0x1a769b=_0x7acf[_0x3d0112];return _0x1a769b;};'use strict';var _=require('lodash');var util=require(_0xf7ac('0x0'));var logger=require('../../config/logger')(_0xf7ac('0x1'));var moment=require(_0xf7ac('0x2'));var BPromise=require(_0xf7ac('0x3'));var rp=require(_0xf7ac('0x4'));var fs=require('fs');var path=require(_0xf7ac('0x5'));var rimraf=require('rimraf');var config=require(_0xf7ac('0x6'));var attributes=require(_0xf7ac('0x7'));module[_0xf7ac('0x8')]=function(_0x104fb7,_0xd51454){return _0x104fb7['define'](_0xf7ac('0x9'),attributes,{'tableName':_0xf7ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x30f0=['util','../../config/logger','api','request-promise','path','../../config/environment','define','OpenchannelQueue'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x30f0,0x180));var _0x030f=function(_0x3076f9,_0x379308){_0x3076f9=_0x3076f9-0x0;var _0x552d12=_0x30f0[_0x3076f9];return _0x552d12;};'use strict';var _=require('lodash');var util=require(_0x030f('0x0'));var logger=require(_0x030f('0x1'))(_0x030f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x030f('0x3'));var fs=require('fs');var path=require(_0x030f('0x4'));var rimraf=require('rimraf');var config=require(_0x030f('0x5'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x4b48d8,_0x2754c3){return _0x4b48d8[_0x030f('0x6')](_0x030f('0x7'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d24a66..b639260 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa174=['find','ShowOpenchannelQueue','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','./openchannelQueue.socket','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0xa174,0xda));var _0x4a17=function(_0x4722df,_0x5052d4){_0x4722df=_0x4722df-0x0;var _0x456ddb=_0xa174[_0x4722df];return _0x456ddb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4a17('0x0'));var BPromise=require(_0x4a17('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a17('0x2'));var db=require(_0x4a17('0x3'))['db'];var utils=require(_0x4a17('0x4'));var logger=require('../../config/logger')(_0x4a17('0x5'));var config=require(_0x4a17('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4a17('0x7')]['http']({'port':0x232a});config[_0x4a17('0x8')]=_[_0x4a17('0x9')](config[_0x4a17('0x8')],{'host':_0x4a17('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a17('0x8')]));require(_0x4a17('0xb'))['register'](socket);function respondWithRpcPromise(_0x5adc71,_0x515ab5,_0x1d88dd){return new BPromise(function(_0x5ec3ac,_0x56d81c){return client['request'](_0x5adc71,_0x1d88dd)[_0x4a17('0xc')](function(_0x17891c){logger[_0x4a17('0xd')]('OpenchannelQueue,\x20%s,\x20%s',_0x515ab5,_0x4a17('0xe'));logger[_0x4a17('0xf')](_0x4a17('0x10'),_0x515ab5,_0x4a17('0xe'),JSON[_0x4a17('0x11')](_0x17891c));if(_0x17891c[_0x4a17('0x12')]){if(_0x17891c[_0x4a17('0x12')][_0x4a17('0x13')]===0x1f4){logger['error'](_0x4a17('0x14'),_0x515ab5,_0x17891c['error'][_0x4a17('0x15')]);return _0x56d81c(_0x17891c['error'][_0x4a17('0x15')]);}logger[_0x4a17('0x12')](_0x4a17('0x14'),_0x515ab5,_0x17891c[_0x4a17('0x12')]['message']);return _0x5ec3ac(_0x17891c[_0x4a17('0x12')][_0x4a17('0x15')]);}else{logger[_0x4a17('0xd')](_0x4a17('0x14'),_0x515ab5,_0x4a17('0xe'));_0x5ec3ac(_0x17891c['result'][_0x4a17('0x15')]);}})['catch'](function(_0x396fbd){logger[_0x4a17('0x12')](_0x4a17('0x14'),_0x515ab5,_0x396fbd);_0x56d81c(_0x396fbd);});});}exports[_0x4a17('0x16')]=function(_0x51866c){var _0x2cb728=this;return new Promise(function(_0x2667cd,_0x382988){return db[_0x4a17('0x17')][_0x4a17('0x18')]({'raw':_0x51866c[_0x4a17('0x19')]?_0x51866c['options'][_0x4a17('0x1a')]===undefined?!![]:![]:!![],'where':_0x51866c[_0x4a17('0x19')]?_0x51866c[_0x4a17('0x19')][_0x4a17('0x1b')]||null:null,'attributes':_0x51866c[_0x4a17('0x19')]?_0x51866c['options'][_0x4a17('0x1c')]||null:null,'limit':_0x51866c[_0x4a17('0x19')]?_0x51866c[_0x4a17('0x19')][_0x4a17('0x1d')]||null:null,'include':_0x51866c[_0x4a17('0x19')]?_0x51866c[_0x4a17('0x19')][_0x4a17('0x1e')]?_[_0x4a17('0x1f')](_0x51866c[_0x4a17('0x19')][_0x4a17('0x1e')],function(_0x24ab27){return{'model':db[_0x24ab27['model']],'as':_0x24ab27['as'],'attributes':_0x24ab27['attributes'],'include':_0x24ab27[_0x4a17('0x1e')]?_['map'](_0x24ab27[_0x4a17('0x1e')],function(_0x3285fc){return{'model':db[_0x3285fc[_0x4a17('0x20')]],'as':_0x3285fc['as'],'attributes':_0x3285fc[_0x4a17('0x1c')],'include':_0x3285fc[_0x4a17('0x1e')]?_['map'](_0x3285fc[_0x4a17('0x1e')],function(_0xe080e2){return{'model':db[_0xe080e2[_0x4a17('0x20')]],'as':_0xe080e2['as'],'attributes':_0xe080e2[_0x4a17('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4a17('0xc')](function(_0x21fa5b){logger[_0x4a17('0xd')](_0x4a17('0x16'),_0x51866c);logger['debug'](_0x4a17('0x16'),_0x51866c,JSON[_0x4a17('0x11')](_0x21fa5b));_0x2667cd(_0x21fa5b);})[_0x4a17('0x21')](function(_0x3cfda3){logger[_0x4a17('0x12')](_0x4a17('0x16'),_0x3cfda3['message'],_0x51866c);_0x382988(_0x2cb728['error'](0x1f4,_0x3cfda3[_0x4a17('0x15')]));});});};exports['ShowOpenchannelQueue']=function(_0x425e71){var _0x194440=this;return new Promise(function(_0x47c743,_0x2ebbc9){return db[_0x4a17('0x17')][_0x4a17('0x22')]({'raw':_0x425e71[_0x4a17('0x19')]?_0x425e71[_0x4a17('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x425e71[_0x4a17('0x19')]?_0x425e71[_0x4a17('0x19')][_0x4a17('0x1b')]||null:null,'attributes':_0x425e71[_0x4a17('0x19')]?_0x425e71[_0x4a17('0x19')][_0x4a17('0x1c')]||null:null,'include':_0x425e71[_0x4a17('0x19')]?_0x425e71[_0x4a17('0x19')][_0x4a17('0x1e')]?_[_0x4a17('0x1f')](_0x425e71[_0x4a17('0x19')]['include'],function(_0x3de2c5){return{'model':db[_0x3de2c5[_0x4a17('0x20')]],'as':_0x3de2c5['as'],'attributes':_0x3de2c5[_0x4a17('0x1c')],'include':_0x3de2c5[_0x4a17('0x1e')]?_[_0x4a17('0x1f')](_0x3de2c5[_0x4a17('0x1e')],function(_0x45b0c2){return{'model':db[_0x45b0c2[_0x4a17('0x20')]],'as':_0x45b0c2['as'],'attributes':_0x45b0c2[_0x4a17('0x1c')],'include':_0x45b0c2[_0x4a17('0x1e')]?_[_0x4a17('0x1f')](_0x45b0c2['include'],function(_0x58688e){return{'model':db[_0x58688e[_0x4a17('0x20')]],'as':_0x58688e['as'],'attributes':_0x58688e[_0x4a17('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4a17('0xc')](function(_0x6637fd){logger[_0x4a17('0xd')]('ShowOpenchannelQueue',_0x425e71);logger[_0x4a17('0xf')](_0x4a17('0x23'),_0x425e71,JSON[_0x4a17('0x11')](_0x6637fd));_0x47c743(_0x6637fd);})[_0x4a17('0x21')](function(_0x3aceab){logger[_0x4a17('0x12')](_0x4a17('0x23'),_0x3aceab[_0x4a17('0x15')],_0x425e71);_0x2ebbc9(_0x194440['error'](0x1f4,_0x3aceab[_0x4a17('0x15')]));});});};
\ No newline at end of file
+var _0x281b=['defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','limit','include','map','model','stringify','ShowOpenchannelQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0xbeefde,_0x31b267){var _0x49185a=function(_0x4eeaa1){while(--_0x4eeaa1){_0xbeefde['push'](_0xbeefde['shift']());}};_0x49185a(++_0x31b267);}(_0x281b,0xc5));var _0xb281=function(_0x18fd4b,_0x475e2e){_0x18fd4b=_0x18fd4b-0x0;var _0xe5d6b4=_0x281b[_0x18fd4b];return _0xe5d6b4;};'use strict';var _=require(_0xb281('0x0'));var util=require(_0xb281('0x1'));var moment=require(_0xb281('0x2'));var BPromise=require(_0xb281('0x3'));var rs=require(_0xb281('0x4'));var fs=require('fs');var Redis=require(_0xb281('0x5'));var db=require(_0xb281('0x6'))['db'];var utils=require(_0xb281('0x7'));var logger=require('../../config/logger')(_0xb281('0x8'));var config=require(_0xb281('0x9'));var jayson=require(_0xb281('0xa'));var client=jayson[_0xb281('0xb')]['http']({'port':0x232a});config[_0xb281('0xc')]=_[_0xb281('0xd')](config[_0xb281('0xc')],{'host':_0xb281('0xe'),'port':0x18eb});var socket=require(_0xb281('0xf'))(new Redis(config['redis']));require(_0xb281('0x10'))[_0xb281('0x11')](socket);function respondWithRpcPromise(_0x41a668,_0x5e783f,_0x75041d){return new BPromise(function(_0x4224a8,_0x156e0c){return client[_0xb281('0x12')](_0x41a668,_0x75041d)[_0xb281('0x13')](function(_0x441bd4){logger[_0xb281('0x14')](_0xb281('0x15'),_0x5e783f,_0xb281('0x16'));logger[_0xb281('0x17')](_0xb281('0x18'),_0x5e783f,_0xb281('0x16'),JSON['stringify'](_0x441bd4));if(_0x441bd4[_0xb281('0x19')]){if(_0x441bd4[_0xb281('0x19')][_0xb281('0x1a')]===0x1f4){logger[_0xb281('0x19')](_0xb281('0x15'),_0x5e783f,_0x441bd4['error'][_0xb281('0x1b')]);return _0x156e0c(_0x441bd4[_0xb281('0x19')]['message']);}logger[_0xb281('0x19')](_0xb281('0x15'),_0x5e783f,_0x441bd4[_0xb281('0x19')][_0xb281('0x1b')]);return _0x4224a8(_0x441bd4[_0xb281('0x19')][_0xb281('0x1b')]);}else{logger[_0xb281('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x5e783f,'request\x20sent');_0x4224a8(_0x441bd4['result']['message']);}})[_0xb281('0x1c')](function(_0x10b133){logger[_0xb281('0x19')](_0xb281('0x15'),_0x5e783f,_0x10b133);_0x156e0c(_0x10b133);});});}exports[_0xb281('0x1d')]=function(_0x31616d){var _0x36ca66=this;return new Promise(function(_0x429a5d,_0x4d4dc3){return db[_0xb281('0x1e')][_0xb281('0x1f')]({'raw':_0x31616d[_0xb281('0x20')]?_0x31616d[_0xb281('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x31616d[_0xb281('0x20')]?_0x31616d[_0xb281('0x20')][_0xb281('0x21')]||null:null,'attributes':_0x31616d[_0xb281('0x20')]?_0x31616d['options'][_0xb281('0x22')]||null:null,'limit':_0x31616d[_0xb281('0x20')]?_0x31616d[_0xb281('0x20')][_0xb281('0x23')]||null:null,'include':_0x31616d[_0xb281('0x20')]?_0x31616d[_0xb281('0x20')][_0xb281('0x24')]?_[_0xb281('0x25')](_0x31616d[_0xb281('0x20')][_0xb281('0x24')],function(_0x160ca4){return{'model':db[_0x160ca4[_0xb281('0x26')]],'as':_0x160ca4['as'],'attributes':_0x160ca4['attributes'],'include':_0x160ca4[_0xb281('0x24')]?_[_0xb281('0x25')](_0x160ca4['include'],function(_0x7c3468){return{'model':db[_0x7c3468['model']],'as':_0x7c3468['as'],'attributes':_0x7c3468[_0xb281('0x22')],'include':_0x7c3468['include']?_['map'](_0x7c3468[_0xb281('0x24')],function(_0x25ae8e){return{'model':db[_0x25ae8e[_0xb281('0x26')]],'as':_0x25ae8e['as'],'attributes':_0x25ae8e[_0xb281('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb281('0x13')](function(_0x55db3c){logger['info'](_0xb281('0x1d'),_0x31616d);logger['debug'](_0xb281('0x1d'),_0x31616d,JSON[_0xb281('0x27')](_0x55db3c));_0x429a5d(_0x55db3c);})[_0xb281('0x1c')](function(_0xc67b5e){logger['error'](_0xb281('0x1d'),_0xc67b5e[_0xb281('0x1b')],_0x31616d);_0x4d4dc3(_0x36ca66[_0xb281('0x19')](0x1f4,_0xc67b5e[_0xb281('0x1b')]));});});};exports[_0xb281('0x28')]=function(_0x449625){var _0x337cf9=this;return new Promise(function(_0xee4e5f,_0x5b181b){return db[_0xb281('0x1e')]['find']({'raw':_0x449625[_0xb281('0x20')]?_0x449625['options'][_0xb281('0x29')]===undefined?!![]:![]:!![],'where':_0x449625[_0xb281('0x20')]?_0x449625[_0xb281('0x20')][_0xb281('0x21')]||null:null,'attributes':_0x449625[_0xb281('0x20')]?_0x449625[_0xb281('0x20')]['attributes']||null:null,'include':_0x449625['options']?_0x449625['options'][_0xb281('0x24')]?_[_0xb281('0x25')](_0x449625[_0xb281('0x20')][_0xb281('0x24')],function(_0x811509){return{'model':db[_0x811509[_0xb281('0x26')]],'as':_0x811509['as'],'attributes':_0x811509[_0xb281('0x22')],'include':_0x811509[_0xb281('0x24')]?_[_0xb281('0x25')](_0x811509['include'],function(_0x20fd6e){return{'model':db[_0x20fd6e[_0xb281('0x26')]],'as':_0x20fd6e['as'],'attributes':_0x20fd6e[_0xb281('0x22')],'include':_0x20fd6e[_0xb281('0x24')]?_['map'](_0x20fd6e['include'],function(_0x44fe32){return{'model':db[_0x44fe32['model']],'as':_0x44fe32['as'],'attributes':_0x44fe32[_0xb281('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb281('0x13')](function(_0x1d637a){logger[_0xb281('0x14')](_0xb281('0x28'),_0x449625);logger[_0xb281('0x17')](_0xb281('0x28'),_0x449625,JSON['stringify'](_0x1d637a));_0xee4e5f(_0x1d637a);})[_0xb281('0x1c')](function(_0xd65cfc){logger[_0xb281('0x19')](_0xb281('0x28'),_0xd65cfc['message'],_0x449625);_0x5b181b(_0x337cf9[_0xb281('0x19')](0x1f4,_0xd65cfc[_0xb281('0x1b')]));});});};
\ No newline at end of file
index 3a6fad3..db292c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52bd=['register','length','openchannelQueue:','./openchannelQueue.events','remove','update','emit','removeListener'];(function(_0x3ba62f,_0x2b3163){var _0x495302=function(_0x59e6f8){while(--_0x59e6f8){_0x3ba62f['push'](_0x3ba62f['shift']());}};_0x495302(++_0x2b3163);}(_0x52bd,0x1db));var _0xd52b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x52bd[_0x5c351c];return _0x26f3b3;};'use strict';var OpenchannelQueueEvents=require(_0xd52b('0x0'));var events=['save',_0xd52b('0x1'),_0xd52b('0x2')];function createListener(_0x91ce96,_0x1dde2b){return function(_0x58c6b0){_0x1dde2b[_0xd52b('0x3')](_0x91ce96,_0x58c6b0);};}function removeListener(_0x3abb15,_0x83ff51){return function(){OpenchannelQueueEvents[_0xd52b('0x4')](_0x3abb15,_0x83ff51);};}exports[_0xd52b('0x5')]=function(_0x2d0ac8){for(var _0x55b9a0=0x0,_0x5aa62a=events[_0xd52b('0x6')];_0x55b9a0<_0x5aa62a;_0x55b9a0++){var _0x5c3874=events[_0x55b9a0];var _0x2acb2e=createListener(_0xd52b('0x7')+_0x5c3874,_0x2d0ac8);OpenchannelQueueEvents['on'](_0x5c3874,_0x2acb2e);}};
\ No newline at end of file
+var _0x8e01=['./openchannelQueue.events','save','remove','update','emit','removeListener','register','length','openchannelQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e01,0x14d));var _0x18e0=function(_0x2f4bbb,_0x3df713){_0x2f4bbb=_0x2f4bbb-0x0;var _0x36cc4e=_0x8e01[_0x2f4bbb];return _0x36cc4e;};'use strict';var OpenchannelQueueEvents=require(_0x18e0('0x0'));var events=[_0x18e0('0x1'),_0x18e0('0x2'),_0x18e0('0x3')];function createListener(_0x595506,_0x4a4f52){return function(_0x5bd451){_0x4a4f52[_0x18e0('0x4')](_0x595506,_0x5bd451);};}function removeListener(_0x565458,_0x5bf57b){return function(){OpenchannelQueueEvents[_0x18e0('0x5')](_0x565458,_0x5bf57b);};}exports[_0x18e0('0x6')]=function(_0x2f8adc){for(var _0x28ec50=0x0,_0x3c586d=events[_0x18e0('0x7')];_0x28ec50<_0x3c586d;_0x28ec50++){var _0x49a3ea=events[_0x28ec50];var _0xdf7dd7=createListener(_0x18e0('0x8')+_0x49a3ea,_0x2f8adc);OpenchannelQueueEvents['on'](_0x49a3ea,_0xdf7dd7);}};
\ No newline at end of file
index 98eeb45..183c1b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19d5=['isAuthenticated','get','/describe','/:id','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2db048,_0x355a8){var _0x21595a=function(_0x57efcc){while(--_0x57efcc){_0x2db048['push'](_0x2db048['shift']());}};_0x21595a(++_0x355a8);}(_0x19d5,0xe7));var _0x519d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x19d5[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x519d('0x0'));var util=require(_0x519d('0x1'));var path=require('path');var timeout=require(_0x519d('0x2'));var express=require(_0x519d('0x3'));var router=express['Router']();var auth=require(_0x519d('0x4'));var interaction=require(_0x519d('0x5'));var config=require(_0x519d('0x6'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x519d('0x7')](),controller['index']);router[_0x519d('0x8')](_0x519d('0x9'),auth[_0x519d('0x7')](),controller['describe']);router[_0x519d('0x8')](_0x519d('0xa'),auth[_0x519d('0x7')](),controller['show']);router[_0x519d('0xb')]('/',auth[_0x519d('0x7')](),controller['create']);router[_0x519d('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x519d('0xd')]);router[_0x519d('0xe')](_0x519d('0xa'),auth[_0x519d('0x7')](),controller[_0x519d('0xf')]);module[_0x519d('0x10')]=router;
\ No newline at end of file
+var _0xeef3=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x260509,_0x436bc6){var _0x7dc09f=function(_0x49c0fe){while(--_0x49c0fe){_0x260509['push'](_0x260509['shift']());}};_0x7dc09f(++_0x436bc6);}(_0xeef3,0x19c));var _0x3eef=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0xeef3[_0x1fd675];return _0x16b554;};'use strict';var multer=require(_0x3eef('0x0'));var util=require('util');var path=require(_0x3eef('0x1'));var timeout=require(_0x3eef('0x2'));var express=require('express');var router=express[_0x3eef('0x3')]();var auth=require(_0x3eef('0x4'));var interaction=require(_0x3eef('0x5'));var config=require(_0x3eef('0x6'));var controller=require(_0x3eef('0x7'));router[_0x3eef('0x8')]('/',auth[_0x3eef('0x9')](),controller[_0x3eef('0xa')]);router['get'](_0x3eef('0xb'),auth['isAuthenticated'](),controller[_0x3eef('0xc')]);router[_0x3eef('0x8')]('/:id',auth[_0x3eef('0x9')](),controller[_0x3eef('0xd')]);router[_0x3eef('0xe')]('/',auth[_0x3eef('0x9')](),controller[_0x3eef('0xf')]);router[_0x3eef('0x10')](_0x3eef('0x11'),auth['isAuthenticated'](),controller[_0x3eef('0x12')]);router[_0x3eef('0x13')](_0x3eef('0x11'),auth[_0x3eef('0x9')](),controller[_0x3eef('0x14')]);module[_0x3eef('0x15')]=router;
\ No newline at end of file
index f80cfe8..ce69cbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4119=['DATE','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4119,0x1ab));var _0x9411=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x4119[_0x220dbb];return _0x2b77de;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x9411('0x0')]={'uniqueid':{'type':Sequelize[_0x9411('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x9411('0x1')]},'joinAt':{'type':Sequelize[_0x9411('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9411('0x2')]},'exitAt':{'type':Sequelize[_0x9411('0x2')]},'reason':{'type':Sequelize[_0x9411('0x1')]}};
\ No newline at end of file
+var _0xe81b=['exports','STRING','DATE','sequelize'];(function(_0x22d122,_0x30802a){var _0x37e370=function(_0x510d58){while(--_0x510d58){_0x22d122['push'](_0x22d122['shift']());}};_0x37e370(++_0x30802a);}(_0xe81b,0x73));var _0xbe81=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xe81b[_0x3070dc];return _0x431489;};'use strict';var moment=require('moment');var Sequelize=require(_0xbe81('0x0'));module[_0xbe81('0x1')]={'uniqueid':{'type':Sequelize[_0xbe81('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbe81('0x2')]},'joinAt':{'type':Sequelize[_0xbe81('0x3')]},'leaveAt':{'type':Sequelize[_0xbe81('0x3')]},'acceptAt':{'type':Sequelize[_0xbe81('0x3')]},'exitAt':{'type':Sequelize[_0xbe81('0x3')]},'reason':{'type':Sequelize[_0xbe81('0x2')]}};
\ No newline at end of file
index 7306e0d..fcb1ba6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ccb=['intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','OpenchannelQueueReport','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9ccb,0x1c1));var _0xb9cc=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0x9ccb[_0x389832];return _0x59429e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb9cc('0x0'));var rimraf=require(_0xb9cc('0x1'));var zipdir=require(_0xb9cc('0x2'));var jsonpatch=require(_0xb9cc('0x3'));var rp=require(_0xb9cc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb9cc('0x5'));var util=require(_0xb9cc('0x6'));var path=require('path');var sox=require(_0xb9cc('0x7'));var csv=require(_0xb9cc('0x8'));var ejs=require(_0xb9cc('0x9'));var fs=require('fs');var _=require(_0xb9cc('0xa'));var squel=require('squel');var crypto=require(_0xb9cc('0xb'));var jsforce=require(_0xb9cc('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb9cc('0xd'));var Papa=require('papaparse');var Redis=require(_0xb9cc('0xe'));var authService=require(_0xb9cc('0xf'));var qs=require(_0xb9cc('0x10'));var as=require(_0xb9cc('0x11'));var hardwareService=require(_0xb9cc('0x12'));var logger=require('../../config/logger')(_0xb9cc('0x13'));var utils=require('../../config/utils');var config=require(_0xb9cc('0x14'));var db=require(_0xb9cc('0x15'))['db'];function respondWithStatusCode(_0x3fe7f8,_0x60ebd1){_0x60ebd1=_0x60ebd1||0xcc;return function(_0x4ae2bf){if(_0x4ae2bf){return _0x3fe7f8[_0xb9cc('0x16')](_0x60ebd1);}return _0x3fe7f8['status'](_0x60ebd1)[_0xb9cc('0x17')]();};}function respondWithResult(_0x2408cc,_0x9daeb6){_0x9daeb6=_0x9daeb6||0xc8;return function(_0x4139a8){if(_0x4139a8){return _0x2408cc[_0xb9cc('0x18')](_0x9daeb6)['json'](_0x4139a8);}};}function respondWithFilteredResult(_0x274b18,_0x55ca40){return function(_0x473090){if(_0x473090){var _0x4827c4=_0x473090[_0xb9cc('0x19')],_0x30929c=_0x55ca40[_0xb9cc('0x1a')],_0xf3385f=_0x55ca40[_0xb9cc('0x1a')]+_0x55ca40[_0xb9cc('0x1b')],_0x323360;if(_0xf3385f>=_0x4827c4){_0xf3385f=_0x4827c4;_0x323360=0xc8;}else{_0x323360=0xce;}_0x274b18[_0xb9cc('0x18')](_0x323360);return _0x274b18[_0xb9cc('0x1c')](_0xb9cc('0x1d'),_0x30929c+'-'+_0xf3385f+'/'+_0x4827c4)['json'](_0x473090);}return null;};}function patchUpdates(_0x354bd9){return function(_0x5a4f11){try{jsonpatch[_0xb9cc('0x1e')](_0x5a4f11,_0x354bd9,!![]);}catch(_0x4468bc){return BPromise[_0xb9cc('0x1f')](_0x4468bc);}return _0x5a4f11[_0xb9cc('0x20')]();};}function saveUpdates(_0x168ea8,_0x454917){return function(_0x1abbc4){if(_0x1abbc4){return _0x1abbc4[_0xb9cc('0x21')](_0x168ea8)[_0xb9cc('0x22')](function(_0x3bcfa1){return _0x3bcfa1;});}return null;};}function removeEntity(_0x1587ab,_0x40edbb){return function(_0x1c0cdf){if(_0x1c0cdf){return _0x1c0cdf[_0xb9cc('0x23')]()[_0xb9cc('0x22')](function(){_0x1587ab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c3371,_0x4b8f93){return function(_0xb24eda){if(!_0xb24eda){_0x2c3371[_0xb9cc('0x16')](0x194);}return _0xb24eda;};}function handleError(_0xb937ad,_0x423c8a){_0x423c8a=_0x423c8a||0x1f4;return function(_0x4e1d85){logger[_0xb9cc('0x24')](_0x4e1d85[_0xb9cc('0x25')]);if(_0x4e1d85[_0xb9cc('0x26')]){delete _0x4e1d85['name'];}_0xb937ad[_0xb9cc('0x18')](_0x423c8a)['send'](_0x4e1d85);};}exports[_0xb9cc('0x27')]=function(_0x1317f1,_0x507134){var _0x2bf034={},_0x437512={},_0x1af4a7={'count':0x0,'rows':[]};var _0x402871=_[_0xb9cc('0x28')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x461103){return{'name':_0x461103[_0xb9cc('0x29')],'type':_0x461103[_0xb9cc('0x2a')][_0xb9cc('0x2b')]};});_0x437512[_0xb9cc('0x2c')]=_[_0xb9cc('0x28')](_0x402871,_0xb9cc('0x26'));_0x437512[_0xb9cc('0x2d')]=_[_0xb9cc('0x2e')](_0x1317f1['query']);_0x437512[_0xb9cc('0x2f')]=_[_0xb9cc('0x30')](_0x437512[_0xb9cc('0x2c')],_0x437512['query']);_0x2bf034[_0xb9cc('0x31')]=_[_0xb9cc('0x30')](_0x437512[_0xb9cc('0x2c')],qs[_0xb9cc('0x32')](_0x1317f1[_0xb9cc('0x2d')][_0xb9cc('0x32')]));_0x2bf034['attributes']=_0x2bf034[_0xb9cc('0x31')][_0xb9cc('0x33')]?_0x2bf034[_0xb9cc('0x31')]:_0x437512[_0xb9cc('0x2c')];if(!_0x1317f1[_0xb9cc('0x2d')]['hasOwnProperty'](_0xb9cc('0x34'))){_0x2bf034[_0xb9cc('0x1b')]=qs[_0xb9cc('0x1b')](_0x1317f1[_0xb9cc('0x2d')][_0xb9cc('0x1b')]);_0x2bf034[_0xb9cc('0x1a')]=qs[_0xb9cc('0x1a')](_0x1317f1['query'][_0xb9cc('0x1a')]);}_0x2bf034['order']=qs[_0xb9cc('0x35')](_0x1317f1['query'][_0xb9cc('0x35')]);_0x2bf034[_0xb9cc('0x36')]=qs[_0xb9cc('0x2f')](_[_0xb9cc('0x37')](_0x1317f1['query'],_0x437512['filters']),_0x402871);if(_0x1317f1['query'][_0xb9cc('0x38')]){_0x2bf034[_0xb9cc('0x36')]=_[_0xb9cc('0x39')](_0x2bf034[_0xb9cc('0x36')],{'$or':_[_0xb9cc('0x28')](_0x402871,function(_0x4088da){if(_0x4088da[_0xb9cc('0x2a')]!==_0xb9cc('0x3a')){var _0x49f9fa={};_0x49f9fa[_0x4088da['name']]={'$like':'%'+_0x1317f1[_0xb9cc('0x2d')]['filter']+'%'};return _0x49f9fa;}})});}_0x2bf034=_[_0xb9cc('0x39')]({},_0x2bf034,_0x1317f1['options']);var _0x3a1fcb={'where':_0x2bf034[_0xb9cc('0x36')]};return db[_0xb9cc('0x3b')]['count'](_0x3a1fcb)[_0xb9cc('0x22')](function(_0x410137){_0x1af4a7[_0xb9cc('0x19')]=_0x410137;if(_0x1317f1[_0xb9cc('0x2d')]['includeAll']){_0x2bf034[_0xb9cc('0x3c')]=[{'all':!![]}];}return db[_0xb9cc('0x3b')][_0xb9cc('0x3d')](_0x2bf034);})[_0xb9cc('0x22')](function(_0x5ce2ac){_0x1af4a7[_0xb9cc('0x3e')]=_0x5ce2ac;return _0x1af4a7;})[_0xb9cc('0x22')](respondWithFilteredResult(_0x507134,_0x2bf034))[_0xb9cc('0x3f')](handleError(_0x507134,null));};exports[_0xb9cc('0x40')]=function(_0x50c4f3,_0xb2fd50){var _0x579774={'raw':!![],'where':{'id':_0x50c4f3[_0xb9cc('0x41')]['id']}},_0x544b20={};_0x544b20[_0xb9cc('0x2c')]=_[_0xb9cc('0x2e')](db[_0xb9cc('0x3b')][_0xb9cc('0x42')]);_0x544b20[_0xb9cc('0x2d')]=_['keys'](_0x50c4f3['query']);_0x544b20[_0xb9cc('0x2f')]=_[_0xb9cc('0x30')](_0x544b20['model'],_0x544b20['query']);_0x579774[_0xb9cc('0x31')]=_[_0xb9cc('0x30')](_0x544b20['model'],qs['fields'](_0x50c4f3[_0xb9cc('0x2d')][_0xb9cc('0x32')]));_0x579774[_0xb9cc('0x31')]=_0x579774[_0xb9cc('0x31')]['length']?_0x579774[_0xb9cc('0x31')]:_0x544b20[_0xb9cc('0x2c')];if(_0x50c4f3[_0xb9cc('0x2d')][_0xb9cc('0x43')]){_0x579774[_0xb9cc('0x3c')]=[{'all':!![]}];}_0x579774=_[_0xb9cc('0x39')]({},_0x579774,_0x50c4f3['options']);return db[_0xb9cc('0x3b')]['find'](_0x579774)[_0xb9cc('0x22')](handleEntityNotFound(_0xb2fd50,null))[_0xb9cc('0x22')](respondWithResult(_0xb2fd50,null))[_0xb9cc('0x3f')](handleError(_0xb2fd50,null));};exports[_0xb9cc('0x44')]=function(_0x2bf0df,_0x416f16){return db['OpenchannelQueueReport'][_0xb9cc('0x44')](_0x2bf0df['body'],{})[_0xb9cc('0x22')](respondWithResult(_0x416f16,0xc9))[_0xb9cc('0x3f')](handleError(_0x416f16,null));};exports[_0xb9cc('0x21')]=function(_0x4f6e00,_0x4580b3){if(_0x4f6e00[_0xb9cc('0x45')]['id']){delete _0x4f6e00[_0xb9cc('0x45')]['id'];}return db[_0xb9cc('0x3b')]['find']({'where':{'id':_0x4f6e00[_0xb9cc('0x41')]['id']}})[_0xb9cc('0x22')](handleEntityNotFound(_0x4580b3,null))['then'](saveUpdates(_0x4f6e00[_0xb9cc('0x45')],null))[_0xb9cc('0x22')](respondWithResult(_0x4580b3,null))['catch'](handleError(_0x4580b3,null));};exports[_0xb9cc('0x23')]=function(_0x4e76ac,_0x47a489){return db[_0xb9cc('0x3b')]['find']({'where':{'id':_0x4e76ac[_0xb9cc('0x41')]['id']}})[_0xb9cc('0x22')](handleEntityNotFound(_0x47a489,null))[_0xb9cc('0x22')](removeEntity(_0x47a489,null))[_0xb9cc('0x3f')](handleError(_0x47a489,null));};exports[_0xb9cc('0x46')]=function(_0x2a6982,_0x3d36cd){return db[_0xb9cc('0x3b')][_0xb9cc('0x46')]()[_0xb9cc('0x22')](respondWithResult(_0x3d36cd,null))[_0xb9cc('0x3f')](handleError(_0x3d36cd,null));};
\ No newline at end of file
+var _0x66b8=['rawAttributes','intersection','create','body','find','destroy','describe','html-pdf','rimraf','zip-dir','moment','bluebird','util','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','apply','save','update','then','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','fields','attributes','length','nolimit','offset','order','sort','filter','where','merge','options','OpenchannelQueueReport','includeAll','include','catch','show','params'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x66b8,0x8b));var _0x866b=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x66b8[_0x2070da];return _0x4f9fe1;};'use strict';var pdf=require(_0x866b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x866b('0x1'));var zipdir=require(_0x866b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x866b('0x3'));var BPromise=require(_0x866b('0x4'));var Mustache=require('mustache');var util=require(_0x866b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x866b('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x866b('0x7'));var squel=require('squel');var crypto=require(_0x866b('0x8'));var jsforce=require(_0x866b('0x9'));var deskjs=require(_0x866b('0xa'));var toCsv=require(_0x866b('0x6'));var querystring=require(_0x866b('0xb'));var Papa=require(_0x866b('0xc'));var Redis=require(_0x866b('0xd'));var authService=require(_0x866b('0xe'));var qs=require(_0x866b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x866b('0x10'));var logger=require('../../config/logger')(_0x866b('0x11'));var utils=require(_0x866b('0x12'));var config=require(_0x866b('0x13'));var db=require(_0x866b('0x14'))['db'];function respondWithStatusCode(_0x386656,_0x27387a){_0x27387a=_0x27387a||0xcc;return function(_0x285140){if(_0x285140){return _0x386656[_0x866b('0x15')](_0x27387a);}return _0x386656['status'](_0x27387a)['end']();};}function respondWithResult(_0x4aeea4,_0x1c97a9){_0x1c97a9=_0x1c97a9||0xc8;return function(_0x199a9b){if(_0x199a9b){return _0x4aeea4[_0x866b('0x16')](_0x1c97a9)[_0x866b('0x17')](_0x199a9b);}};}function respondWithFilteredResult(_0x3c3cd4,_0x1b8abd){return function(_0x2fa062){if(_0x2fa062){var _0x536606=_0x2fa062[_0x866b('0x18')],_0xc1d310=_0x1b8abd['offset'],_0x24ef13=_0x1b8abd['offset']+_0x1b8abd[_0x866b('0x19')],_0x2af57d;if(_0x24ef13>=_0x536606){_0x24ef13=_0x536606;_0x2af57d=0xc8;}else{_0x2af57d=0xce;}_0x3c3cd4[_0x866b('0x16')](_0x2af57d);return _0x3c3cd4['set']('Content-Range',_0xc1d310+'-'+_0x24ef13+'/'+_0x536606)[_0x866b('0x17')](_0x2fa062);}return null;};}function patchUpdates(_0x348635){return function(_0x1be9d1){try{jsonpatch[_0x866b('0x1a')](_0x1be9d1,_0x348635,!![]);}catch(_0x217b57){return BPromise['reject'](_0x217b57);}return _0x1be9d1[_0x866b('0x1b')]();};}function saveUpdates(_0x252ed0,_0x1541be){return function(_0x26dd31){if(_0x26dd31){return _0x26dd31[_0x866b('0x1c')](_0x252ed0)['then'](function(_0x30d562){return _0x30d562;});}return null;};}function removeEntity(_0x32c151,_0x2bf6b9){return function(_0x369c38){if(_0x369c38){return _0x369c38['destroy']()[_0x866b('0x1d')](function(){_0x32c151[_0x866b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28f5f5,_0x544313){return function(_0x230cf9){if(!_0x230cf9){_0x28f5f5[_0x866b('0x15')](0x194);}return _0x230cf9;};}function handleError(_0x11fc69,_0x40a894){_0x40a894=_0x40a894||0x1f4;return function(_0xdd0ec6){logger['error'](_0xdd0ec6[_0x866b('0x1e')]);if(_0xdd0ec6[_0x866b('0x1f')]){delete _0xdd0ec6[_0x866b('0x1f')];}_0x11fc69[_0x866b('0x16')](_0x40a894)[_0x866b('0x20')](_0xdd0ec6);};}exports[_0x866b('0x21')]=function(_0x28f6bf,_0x5ed7a0){var _0xae3a29={},_0x4d4e98={},_0x4812ae={'count':0x0,'rows':[]};var _0x8bb25d=_[_0x866b('0x22')](db['OpenchannelQueueReport']['rawAttributes'],function(_0xdfaf1a){return{'name':_0xdfaf1a[_0x866b('0x23')],'type':_0xdfaf1a[_0x866b('0x24')][_0x866b('0x25')]};});_0x4d4e98[_0x866b('0x26')]=_[_0x866b('0x22')](_0x8bb25d,_0x866b('0x1f'));_0x4d4e98[_0x866b('0x27')]=_[_0x866b('0x28')](_0x28f6bf['query']);_0x4d4e98[_0x866b('0x29')]=_['intersection'](_0x4d4e98[_0x866b('0x26')],_0x4d4e98[_0x866b('0x27')]);_0xae3a29['attributes']=_['intersection'](_0x4d4e98[_0x866b('0x26')],qs[_0x866b('0x2a')](_0x28f6bf[_0x866b('0x27')][_0x866b('0x2a')]));_0xae3a29['attributes']=_0xae3a29[_0x866b('0x2b')][_0x866b('0x2c')]?_0xae3a29[_0x866b('0x2b')]:_0x4d4e98['model'];if(!_0x28f6bf[_0x866b('0x27')]['hasOwnProperty'](_0x866b('0x2d'))){_0xae3a29[_0x866b('0x19')]=qs[_0x866b('0x19')](_0x28f6bf[_0x866b('0x27')]['limit']);_0xae3a29[_0x866b('0x2e')]=qs[_0x866b('0x2e')](_0x28f6bf['query'][_0x866b('0x2e')]);}_0xae3a29[_0x866b('0x2f')]=qs[_0x866b('0x30')](_0x28f6bf['query'][_0x866b('0x30')]);_0xae3a29['where']=qs['filters'](_['pick'](_0x28f6bf['query'],_0x4d4e98['filters']),_0x8bb25d);if(_0x28f6bf[_0x866b('0x27')][_0x866b('0x31')]){_0xae3a29[_0x866b('0x32')]=_[_0x866b('0x33')](_0xae3a29['where'],{'$or':_[_0x866b('0x22')](_0x8bb25d,function(_0x2ba1c2){if(_0x2ba1c2[_0x866b('0x24')]!=='VIRTUAL'){var _0x1ebca7={};_0x1ebca7[_0x2ba1c2[_0x866b('0x1f')]]={'$like':'%'+_0x28f6bf[_0x866b('0x27')][_0x866b('0x31')]+'%'};return _0x1ebca7;}})});}_0xae3a29=_['merge']({},_0xae3a29,_0x28f6bf[_0x866b('0x34')]);var _0x557404={'where':_0xae3a29[_0x866b('0x32')]};return db[_0x866b('0x35')][_0x866b('0x18')](_0x557404)[_0x866b('0x1d')](function(_0x34b7d1){_0x4812ae[_0x866b('0x18')]=_0x34b7d1;if(_0x28f6bf[_0x866b('0x27')][_0x866b('0x36')]){_0xae3a29[_0x866b('0x37')]=[{'all':!![]}];}return db[_0x866b('0x35')]['findAll'](_0xae3a29);})[_0x866b('0x1d')](function(_0x129925){_0x4812ae['rows']=_0x129925;return _0x4812ae;})[_0x866b('0x1d')](respondWithFilteredResult(_0x5ed7a0,_0xae3a29))[_0x866b('0x38')](handleError(_0x5ed7a0,null));};exports[_0x866b('0x39')]=function(_0x58a31b,_0x4f52de){var _0x17ca48={'raw':!![],'where':{'id':_0x58a31b[_0x866b('0x3a')]['id']}},_0xd4b95d={};_0xd4b95d['model']=_[_0x866b('0x28')](db[_0x866b('0x35')][_0x866b('0x3b')]);_0xd4b95d[_0x866b('0x27')]=_[_0x866b('0x28')](_0x58a31b['query']);_0xd4b95d['filters']=_[_0x866b('0x3c')](_0xd4b95d[_0x866b('0x26')],_0xd4b95d[_0x866b('0x27')]);_0x17ca48[_0x866b('0x2b')]=_[_0x866b('0x3c')](_0xd4b95d[_0x866b('0x26')],qs[_0x866b('0x2a')](_0x58a31b['query']['fields']));_0x17ca48[_0x866b('0x2b')]=_0x17ca48[_0x866b('0x2b')][_0x866b('0x2c')]?_0x17ca48[_0x866b('0x2b')]:_0xd4b95d['model'];if(_0x58a31b[_0x866b('0x27')][_0x866b('0x36')]){_0x17ca48[_0x866b('0x37')]=[{'all':!![]}];}_0x17ca48=_[_0x866b('0x33')]({},_0x17ca48,_0x58a31b[_0x866b('0x34')]);return db['OpenchannelQueueReport']['find'](_0x17ca48)[_0x866b('0x1d')](handleEntityNotFound(_0x4f52de,null))[_0x866b('0x1d')](respondWithResult(_0x4f52de,null))[_0x866b('0x38')](handleError(_0x4f52de,null));};exports[_0x866b('0x3d')]=function(_0x497e2f,_0x981556){return db[_0x866b('0x35')][_0x866b('0x3d')](_0x497e2f[_0x866b('0x3e')],{})[_0x866b('0x1d')](respondWithResult(_0x981556,0xc9))[_0x866b('0x38')](handleError(_0x981556,null));};exports[_0x866b('0x1c')]=function(_0x16e72d,_0x338e18){if(_0x16e72d[_0x866b('0x3e')]['id']){delete _0x16e72d[_0x866b('0x3e')]['id'];}return db[_0x866b('0x35')][_0x866b('0x3f')]({'where':{'id':_0x16e72d['params']['id']}})[_0x866b('0x1d')](handleEntityNotFound(_0x338e18,null))[_0x866b('0x1d')](saveUpdates(_0x16e72d['body'],null))[_0x866b('0x1d')](respondWithResult(_0x338e18,null))[_0x866b('0x38')](handleError(_0x338e18,null));};exports[_0x866b('0x40')]=function(_0x10b0fd,_0x84eb5){return db[_0x866b('0x35')]['find']({'where':{'id':_0x10b0fd[_0x866b('0x3a')]['id']}})['then'](handleEntityNotFound(_0x84eb5,null))[_0x866b('0x1d')](removeEntity(_0x84eb5,null))[_0x866b('0x38')](handleError(_0x84eb5,null));};exports[_0x866b('0x41')]=function(_0x5bea61,_0x557b01){return db[_0x866b('0x35')][_0x866b('0x41')]()[_0x866b('0x1d')](respondWithResult(_0x557b01,null))[_0x866b('0x38')](handleError(_0x557b01,null));};
\ No newline at end of file
index a73adb8..a90e77e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7b9=['../../config/logger','path','rimraf','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util'];(function(_0x2c93a4,_0x3e90b7){var _0x41e095=function(_0x53439a){while(--_0x53439a){_0x2c93a4['push'](_0x2c93a4['shift']());}};_0x41e095(++_0x3e90b7);}(_0xf7b9,0x8d));var _0x9f7b=function(_0x5929ff,_0x2c88d5){_0x5929ff=_0x5929ff-0x0;var _0x79477d=_0xf7b9[_0x5929ff];return _0x79477d;};'use strict';var _=require(_0x9f7b('0x0'));var util=require(_0x9f7b('0x1'));var logger=require(_0x9f7b('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f7b('0x3'));var rimraf=require(_0x9f7b('0x4'));var config=require('../../config/environment');var attributes=require(_0x9f7b('0x5'));module[_0x9f7b('0x6')]=function(_0x31e7fd,_0x50cb54){return _0x31e7fd[_0x9f7b('0x7')](_0x9f7b('0x8'),attributes,{'tableName':_0x9f7b('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9f7b('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1735=['report_openchannel_queue','uniqueid','util','moment','bluebird','request-promise','path','rimraf','./openchannelQueueReport.attributes','exports','define'];(function(_0x415869,_0x9f502e){var _0x3454e9=function(_0x44f9e6){while(--_0x44f9e6){_0x415869['push'](_0x415869['shift']());}};_0x3454e9(++_0x9f502e);}(_0x1735,0x136));var _0x5173=function(_0x2669c8,_0x401161){_0x2669c8=_0x2669c8-0x0;var _0x45a28b=_0x1735[_0x2669c8];return _0x45a28b;};'use strict';var _=require('lodash');var util=require(_0x5173('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5173('0x1'));var BPromise=require(_0x5173('0x2'));var rp=require(_0x5173('0x3'));var fs=require('fs');var path=require(_0x5173('0x4'));var rimraf=require(_0x5173('0x5'));var config=require('../../config/environment');var attributes=require(_0x5173('0x6'));module[_0x5173('0x7')]=function(_0x125736,_0x230d7c){return _0x125736[_0x5173('0x8')]('OpenchannelQueueReport',attributes,{'tableName':_0x5173('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5173('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 60524f0..bcda37f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe39=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateOpenchannelQueueReport','create','options','raw','debug','UpdateOpenchannelQueueReport','OpenchannelQueueReport','body','where','attributes','limit','stringify','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s'];(function(_0x49e4c5,_0x1bdc1e){var _0x2a4ceb=function(_0x1091cd){while(--_0x1091cd){_0x49e4c5['push'](_0x49e4c5['shift']());}};_0x2a4ceb(++_0x1bdc1e);}(_0xfe39,0x1b3));var _0x9fe3=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xfe39[_0x1b6186];return _0x186121;};'use strict';var _=require(_0x9fe3('0x0'));var util=require(_0x9fe3('0x1'));var moment=require('moment');var BPromise=require(_0x9fe3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fe3('0x3'))['db'];var utils=require(_0x9fe3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9fe3('0x5'));var jayson=require(_0x9fe3('0x6'));var client=jayson[_0x9fe3('0x7')][_0x9fe3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc469b7,_0x4183ce,_0x25868f){return new BPromise(function(_0x5a3bd6,_0x211eb2){return client[_0x9fe3('0x9')](_0xc469b7,_0x25868f)[_0x9fe3('0xa')](function(_0x35c391){logger[_0x9fe3('0xb')](_0x9fe3('0xc'),_0x4183ce,'request\x20sent');logger['debug'](_0x9fe3('0xd'),_0x4183ce,_0x9fe3('0xe'),JSON['stringify'](_0x35c391));if(_0x35c391[_0x9fe3('0xf')]){if(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x10')]===0x1f4){logger[_0x9fe3('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4183ce,_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);return _0x211eb2(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x4183ce,_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);return _0x5a3bd6(_0x35c391[_0x9fe3('0xf')][_0x9fe3('0x11')]);}else{logger[_0x9fe3('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4183ce,'request\x20sent');_0x5a3bd6(_0x35c391[_0x9fe3('0x12')][_0x9fe3('0x11')]);}})[_0x9fe3('0x13')](function(_0x2d28d4){logger['error'](_0x9fe3('0xc'),_0x4183ce,_0x2d28d4);_0x211eb2(_0x2d28d4);});});}exports[_0x9fe3('0x14')]=function(_0x15fcaa){var _0x592b8b=this;return new Promise(function(_0x35bbaf,_0x43854c){return db['OpenchannelQueueReport'][_0x9fe3('0x15')](_0x15fcaa['body'],{'raw':_0x15fcaa[_0x9fe3('0x16')]?_0x15fcaa['options'][_0x9fe3('0x17')]===undefined?!![]:![]:!![]})[_0x9fe3('0xa')](function(_0x302d5c){logger['info']('CreateOpenchannelQueueReport',_0x15fcaa);logger[_0x9fe3('0x18')](_0x9fe3('0x14'),_0x15fcaa,JSON['stringify'](_0x302d5c));_0x35bbaf(_0x302d5c);})[_0x9fe3('0x13')](function(_0x2e9ae5){logger['error'](_0x9fe3('0x14'),_0x2e9ae5[_0x9fe3('0x11')],_0x15fcaa);_0x43854c(_0x592b8b['error'](0x1f4,_0x2e9ae5[_0x9fe3('0x11')]));});});};exports[_0x9fe3('0x19')]=function(_0x3fd88e){var _0x3d80e9=this;return new Promise(function(_0x14f1a1,_0x1c4665){return db[_0x9fe3('0x1a')]['update'](_0x3fd88e[_0x9fe3('0x1b')],{'raw':_0x3fd88e[_0x9fe3('0x16')]?_0x3fd88e[_0x9fe3('0x16')][_0x9fe3('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fd88e['options']?_0x3fd88e[_0x9fe3('0x16')][_0x9fe3('0x1c')]||null:null,'attributes':_0x3fd88e[_0x9fe3('0x16')]?_0x3fd88e['options'][_0x9fe3('0x1d')]||null:null,'limit':_0x3fd88e[_0x9fe3('0x16')]?_0x3fd88e[_0x9fe3('0x16')][_0x9fe3('0x1e')]||null:null})[_0x9fe3('0xa')](function(_0x17f01f){logger['info'](_0x9fe3('0x19'),_0x3fd88e);logger[_0x9fe3('0x18')](_0x9fe3('0x19'),_0x3fd88e,JSON[_0x9fe3('0x1f')](_0x17f01f));_0x14f1a1(_0x17f01f);})[_0x9fe3('0x13')](function(_0x4557c5){logger['error'](_0x9fe3('0x19'),_0x4557c5[_0x9fe3('0x11')],_0x3fd88e);_0x1c4665(_0x3d80e9['error'](0x1f4,_0x4557c5[_0x9fe3('0x11')]));});});};
\ No newline at end of file
+var _0x8921=['body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create'];(function(_0x129b6b,_0x4faf08){var _0x24d8df=function(_0x6e758b){while(--_0x6e758b){_0x129b6b['push'](_0x129b6b['shift']());}};_0x24d8df(++_0x4faf08);}(_0x8921,0x9a));var _0x1892=function(_0x3a53a1,_0x52a91d){_0x3a53a1=_0x3a53a1-0x0;var _0x3f714e=_0x8921[_0x3a53a1];return _0x3f714e;};'use strict';var _=require(_0x1892('0x0'));var util=require('util');var moment=require(_0x1892('0x1'));var BPromise=require(_0x1892('0x2'));var rs=require(_0x1892('0x3'));var fs=require('fs');var Redis=require(_0x1892('0x4'));var db=require(_0x1892('0x5'))['db'];var utils=require(_0x1892('0x6'));var logger=require(_0x1892('0x7'))(_0x1892('0x8'));var config=require(_0x1892('0x9'));var jayson=require(_0x1892('0xa'));var client=jayson[_0x1892('0xb')][_0x1892('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x504741,_0xfe2155,_0x6a2604){return new BPromise(function(_0x2db820,_0x18d62f){return client[_0x1892('0xd')](_0x504741,_0x6a2604)[_0x1892('0xe')](function(_0x4d15a4){logger[_0x1892('0xf')](_0x1892('0x10'),_0xfe2155,_0x1892('0x11'));logger[_0x1892('0x12')](_0x1892('0x13'),_0xfe2155,_0x1892('0x11'),JSON[_0x1892('0x14')](_0x4d15a4));if(_0x4d15a4[_0x1892('0x15')]){if(_0x4d15a4[_0x1892('0x15')][_0x1892('0x16')]===0x1f4){logger[_0x1892('0x15')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xfe2155,_0x4d15a4[_0x1892('0x15')][_0x1892('0x17')]);return _0x18d62f(_0x4d15a4[_0x1892('0x15')]['message']);}logger[_0x1892('0x15')](_0x1892('0x10'),_0xfe2155,_0x4d15a4[_0x1892('0x15')][_0x1892('0x17')]);return _0x2db820(_0x4d15a4['error']['message']);}else{logger[_0x1892('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xfe2155,_0x1892('0x11'));_0x2db820(_0x4d15a4['result'][_0x1892('0x17')]);}})[_0x1892('0x18')](function(_0x237451){logger[_0x1892('0x15')](_0x1892('0x10'),_0xfe2155,_0x237451);_0x18d62f(_0x237451);});});}exports['CreateOpenchannelQueueReport']=function(_0x5d28fc){var _0x349b58=this;return new Promise(function(_0x49937d,_0x437502){return db['OpenchannelQueueReport'][_0x1892('0x19')](_0x5d28fc[_0x1892('0x1a')],{'raw':_0x5d28fc['options']?_0x5d28fc[_0x1892('0x1b')][_0x1892('0x1c')]===undefined?!![]:![]:!![]})[_0x1892('0xe')](function(_0xf4d237){logger['info']('CreateOpenchannelQueueReport',_0x5d28fc);logger['debug'](_0x1892('0x1d'),_0x5d28fc,JSON[_0x1892('0x14')](_0xf4d237));_0x49937d(_0xf4d237);})['catch'](function(_0xa9a3e0){logger[_0x1892('0x15')](_0x1892('0x1d'),_0xa9a3e0[_0x1892('0x17')],_0x5d28fc);_0x437502(_0x349b58['error'](0x1f4,_0xa9a3e0[_0x1892('0x17')]));});});};exports[_0x1892('0x1e')]=function(_0x2fc141){var _0x23114a=this;return new Promise(function(_0x573e5e,_0x8e9dd4){return db[_0x1892('0x1f')][_0x1892('0x20')](_0x2fc141[_0x1892('0x1a')],{'raw':_0x2fc141[_0x1892('0x1b')]?_0x2fc141[_0x1892('0x1b')][_0x1892('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fc141[_0x1892('0x1b')]?_0x2fc141[_0x1892('0x1b')][_0x1892('0x21')]||null:null,'attributes':_0x2fc141[_0x1892('0x1b')]?_0x2fc141['options'][_0x1892('0x22')]||null:null,'limit':_0x2fc141[_0x1892('0x1b')]?_0x2fc141['options'][_0x1892('0x23')]||null:null})['then'](function(_0x23098b){logger[_0x1892('0xf')](_0x1892('0x1e'),_0x2fc141);logger[_0x1892('0x12')](_0x1892('0x1e'),_0x2fc141,JSON['stringify'](_0x23098b));_0x573e5e(_0x23098b);})[_0x1892('0x18')](function(_0x160ba0){logger[_0x1892('0x15')](_0x1892('0x1e'),_0x160ba0[_0x1892('0x17')],_0x2fc141);_0x8e9dd4(_0x23114a[_0x1892('0x15')](0x1f4,_0x160ba0[_0x1892('0x17')]));});});};
\ No newline at end of file
index dc4d5b7..005317f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router;
\ No newline at end of file
+var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0xd1b4d7,_0x28b2c1){var _0x3002ec=function(_0x3d95ce){while(--_0x3d95ce){_0xd1b4d7['push'](_0xd1b4d7['shift']());}};_0x3002ec(++_0x28b2c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router;
\ No newline at end of file
index 52bc1c0..ca28ad4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb306=['DATE','NOW','moment','account','agent','queue'];(function(_0x50647b,_0x42cd58){var _0x76fbbc=function(_0x599e79){while(--_0x599e79){_0x50647b['push'](_0x50647b['shift']());}};_0x76fbbc(++_0x42cd58);}(_0xb306,0xda));var _0x6b30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb306[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x6b30('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6b30('0x1'),_0x6b30('0x2'),_0x6b30('0x3')),'allowNull':![],'defaultValue':_0x6b30('0x3')},'transferredAt':{'type':Sequelize[_0x6b30('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x6b30('0x5')]}};
\ No newline at end of file
+var _0x3fca=['STRING','ENUM','account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4ee881,_0x10ddc8){var _0x305f48=function(_0x5303d5){while(--_0x5303d5){_0x4ee881['push'](_0x4ee881['shift']());}};_0x305f48(++_0x10ddc8);}(_0x3fca,0x192));var _0xa3fc=function(_0xe598a7,_0x109eb9){_0xe598a7=_0xe598a7-0x0;var _0x5283f8=_0x3fca[_0xe598a7];return _0x5283f8;};'use strict';var moment=require(_0xa3fc('0x0'));var Sequelize=require(_0xa3fc('0x1'));module[_0xa3fc('0x2')]={'uniqueid':{'type':Sequelize[_0xa3fc('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xa3fc('0x4')](_0xa3fc('0x5'),'agent',_0xa3fc('0x6')),'allowNull':![],'defaultValue':_0xa3fc('0x6')},'transferredAt':{'type':Sequelize[_0xa3fc('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xa3fc('0x8')]}};
\ No newline at end of file
index 6ce58d7..17ca07d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf67f=['create','update','body','params','describe','html-pdf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','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','count','offset','limit','set','json','apply','reject','save','destroy','then','name','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','OpenchannelTransferReport','findAll','catch','find'];(function(_0x24044f,_0x19c664){var _0x411164=function(_0x7df6cf){while(--_0x7df6cf){_0x24044f['push'](_0x24044f['shift']());}};_0x411164(++_0x19c664);}(_0xf67f,0x1da));var _0xff67=function(_0xc6879,_0x84a966){_0xc6879=_0xc6879-0x0;var _0x54f7a4=_0xf67f[_0xc6879];return _0x54f7a4;};'use strict';var pdf=require(_0xff67('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xff67('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xff67('0x2'));var BPromise=require(_0xff67('0x3'));var Mustache=require(_0xff67('0x4'));var util=require(_0xff67('0x5'));var path=require(_0xff67('0x6'));var sox=require('sox');var csv=require(_0xff67('0x7'));var ejs=require(_0xff67('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xff67('0x9'));var crypto=require(_0xff67('0xa'));var jsforce=require(_0xff67('0xb'));var deskjs=require(_0xff67('0xc'));var toCsv=require(_0xff67('0x7'));var querystring=require(_0xff67('0xd'));var Papa=require('papaparse');var Redis=require(_0xff67('0xe'));var authService=require(_0xff67('0xf'));var qs=require(_0xff67('0x10'));var as=require(_0xff67('0x11'));var hardwareService=require(_0xff67('0x12'));var logger=require('../../config/logger')(_0xff67('0x13'));var utils=require('../../config/utils');var config=require(_0xff67('0x14'));var db=require(_0xff67('0x15'))['db'];function respondWithStatusCode(_0x294598,_0x1f85da){_0x1f85da=_0x1f85da||0xcc;return function(_0x315d6d){if(_0x315d6d){return _0x294598['sendStatus'](_0x1f85da);}return _0x294598[_0xff67('0x16')](_0x1f85da)[_0xff67('0x17')]();};}function respondWithResult(_0x143a9c,_0x9c3d61){_0x9c3d61=_0x9c3d61||0xc8;return function(_0x10cf50){if(_0x10cf50){return _0x143a9c[_0xff67('0x16')](_0x9c3d61)['json'](_0x10cf50);}};}function respondWithFilteredResult(_0x2acde1,_0x35ab99){return function(_0x4bbecc){if(_0x4bbecc){var _0x11d3ed=_0x4bbecc[_0xff67('0x18')],_0x8b2f9f=_0x35ab99['offset'],_0x393a8e=_0x35ab99[_0xff67('0x19')]+_0x35ab99[_0xff67('0x1a')],_0xd428b4;if(_0x393a8e>=_0x11d3ed){_0x393a8e=_0x11d3ed;_0xd428b4=0xc8;}else{_0xd428b4=0xce;}_0x2acde1[_0xff67('0x16')](_0xd428b4);return _0x2acde1[_0xff67('0x1b')]('Content-Range',_0x8b2f9f+'-'+_0x393a8e+'/'+_0x11d3ed)[_0xff67('0x1c')](_0x4bbecc);}return null;};}function patchUpdates(_0x34d5e8){return function(_0x17f598){try{jsonpatch[_0xff67('0x1d')](_0x17f598,_0x34d5e8,!![]);}catch(_0x1bdada){return BPromise[_0xff67('0x1e')](_0x1bdada);}return _0x17f598[_0xff67('0x1f')]();};}function saveUpdates(_0x152f96,_0x34e617){return function(_0x332488){if(_0x332488){return _0x332488['update'](_0x152f96)['then'](function(_0x4b2886){return _0x4b2886;});}return null;};}function removeEntity(_0x59f8f5,_0x26e98b){return function(_0x12bf3c){if(_0x12bf3c){return _0x12bf3c[_0xff67('0x20')]()[_0xff67('0x21')](function(){_0x59f8f5['status'](0xcc)[_0xff67('0x17')]();});}};}function handleEntityNotFound(_0xfdc25,_0x3e27d4){return function(_0x1c5050){if(!_0x1c5050){_0xfdc25['sendStatus'](0x194);}return _0x1c5050;};}function handleError(_0x5889c7,_0x251ddb){_0x251ddb=_0x251ddb||0x1f4;return function(_0x487eac){logger['error'](_0x487eac['stack']);if(_0x487eac[_0xff67('0x22')]){delete _0x487eac[_0xff67('0x22')];}_0x5889c7['status'](_0x251ddb)['send'](_0x487eac);};}exports['index']=function(_0x54b92a,_0xaaf7b9){var _0x2bbc73={},_0x3d485b={},_0x49eeee={'count':0x0,'rows':[]};var _0x22f760=_['map'](db['OpenchannelTransferReport'][_0xff67('0x23')],function(_0x2c9d42){return{'name':_0x2c9d42['fieldName'],'type':_0x2c9d42[_0xff67('0x24')][_0xff67('0x25')]};});_0x3d485b[_0xff67('0x26')]=_[_0xff67('0x27')](_0x22f760,_0xff67('0x22'));_0x3d485b[_0xff67('0x28')]=_[_0xff67('0x29')](_0x54b92a[_0xff67('0x28')]);_0x3d485b['filters']=_[_0xff67('0x2a')](_0x3d485b[_0xff67('0x26')],_0x3d485b[_0xff67('0x28')]);_0x2bbc73[_0xff67('0x2b')]=_[_0xff67('0x2a')](_0x3d485b[_0xff67('0x26')],qs[_0xff67('0x2c')](_0x54b92a[_0xff67('0x28')]['fields']));_0x2bbc73[_0xff67('0x2b')]=_0x2bbc73[_0xff67('0x2b')][_0xff67('0x2d')]?_0x2bbc73[_0xff67('0x2b')]:_0x3d485b[_0xff67('0x26')];if(!_0x54b92a[_0xff67('0x28')]['hasOwnProperty'](_0xff67('0x2e'))){_0x2bbc73[_0xff67('0x1a')]=qs[_0xff67('0x1a')](_0x54b92a[_0xff67('0x28')][_0xff67('0x1a')]);_0x2bbc73[_0xff67('0x19')]=qs[_0xff67('0x19')](_0x54b92a[_0xff67('0x28')][_0xff67('0x19')]);}_0x2bbc73[_0xff67('0x2f')]=qs[_0xff67('0x30')](_0x54b92a[_0xff67('0x28')][_0xff67('0x30')]);_0x2bbc73[_0xff67('0x31')]=qs['filters'](_[_0xff67('0x32')](_0x54b92a[_0xff67('0x28')],_0x3d485b[_0xff67('0x33')]),_0x22f760);if(_0x54b92a[_0xff67('0x28')]['filter']){_0x2bbc73['where']=_[_0xff67('0x34')](_0x2bbc73[_0xff67('0x31')],{'$or':_['map'](_0x22f760,function(_0x5e7b5f){if(_0x5e7b5f['type']!==_0xff67('0x35')){var _0x34d706={};_0x34d706[_0x5e7b5f[_0xff67('0x22')]]={'$like':'%'+_0x54b92a[_0xff67('0x28')][_0xff67('0x36')]+'%'};return _0x34d706;}})});}_0x2bbc73=_[_0xff67('0x34')]({},_0x2bbc73,_0x54b92a[_0xff67('0x37')]);var _0xfecc71={'where':_0x2bbc73[_0xff67('0x31')]};return db['OpenchannelTransferReport'][_0xff67('0x18')](_0xfecc71)['then'](function(_0x5abd8c){_0x49eeee['count']=_0x5abd8c;if(_0x54b92a[_0xff67('0x28')][_0xff67('0x38')]){_0x2bbc73[_0xff67('0x39')]=[{'all':!![]}];}return db[_0xff67('0x3a')][_0xff67('0x3b')](_0x2bbc73);})[_0xff67('0x21')](function(_0x44c932){_0x49eeee['rows']=_0x44c932;return _0x49eeee;})['then'](respondWithFilteredResult(_0xaaf7b9,_0x2bbc73))[_0xff67('0x3c')](handleError(_0xaaf7b9,null));};exports['show']=function(_0x477c78,_0x361056){var _0x49c542={'raw':!![],'where':{'id':_0x477c78['params']['id']}},_0x39c4de={};_0x39c4de[_0xff67('0x26')]=_[_0xff67('0x29')](db[_0xff67('0x3a')]['rawAttributes']);_0x39c4de[_0xff67('0x28')]=_['keys'](_0x477c78[_0xff67('0x28')]);_0x39c4de[_0xff67('0x33')]=_['intersection'](_0x39c4de['model'],_0x39c4de[_0xff67('0x28')]);_0x49c542[_0xff67('0x2b')]=_[_0xff67('0x2a')](_0x39c4de['model'],qs[_0xff67('0x2c')](_0x477c78[_0xff67('0x28')][_0xff67('0x2c')]));_0x49c542[_0xff67('0x2b')]=_0x49c542[_0xff67('0x2b')]['length']?_0x49c542[_0xff67('0x2b')]:_0x39c4de['model'];if(_0x477c78['query'][_0xff67('0x38')]){_0x49c542[_0xff67('0x39')]=[{'all':!![]}];}_0x49c542=_[_0xff67('0x34')]({},_0x49c542,_0x477c78['options']);return db['OpenchannelTransferReport'][_0xff67('0x3d')](_0x49c542)[_0xff67('0x21')](handleEntityNotFound(_0x361056,null))[_0xff67('0x21')](respondWithResult(_0x361056,null))[_0xff67('0x3c')](handleError(_0x361056,null));};exports['create']=function(_0x5c3f0e,_0xe9abcc){return db[_0xff67('0x3a')][_0xff67('0x3e')](_0x5c3f0e['body'],{})[_0xff67('0x21')](respondWithResult(_0xe9abcc,0xc9))[_0xff67('0x3c')](handleError(_0xe9abcc,null));};exports[_0xff67('0x3f')]=function(_0x245021,_0x56b29f){if(_0x245021[_0xff67('0x40')]['id']){delete _0x245021[_0xff67('0x40')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x245021['params']['id']}})['then'](handleEntityNotFound(_0x56b29f,null))['then'](saveUpdates(_0x245021[_0xff67('0x40')],null))['then'](respondWithResult(_0x56b29f,null))[_0xff67('0x3c')](handleError(_0x56b29f,null));};exports[_0xff67('0x20')]=function(_0x234ebd,_0xe49a02){return db[_0xff67('0x3a')][_0xff67('0x3d')]({'where':{'id':_0x234ebd[_0xff67('0x41')]['id']}})[_0xff67('0x21')](handleEntityNotFound(_0xe49a02,null))['then'](removeEntity(_0xe49a02,null))[_0xff67('0x3c')](handleError(_0xe49a02,null));};exports['describe']=function(_0x4e3ff7,_0x248541){return db[_0xff67('0x3a')][_0xff67('0x42')]()['then'](respondWithResult(_0x248541,null))['catch'](handleError(_0x248541,null));};
\ No newline at end of file
+var _0x7f70=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','update','then','destroy','stack','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','name','options','includeAll','include','findAll','rows','keys','find','create','body','catch','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','ioredis'];(function(_0x301426,_0x38c9a1){var _0x4e1cb0=function(_0xbbc896){while(--_0xbbc896){_0x301426['push'](_0x301426['shift']());}};_0x4e1cb0(++_0x38c9a1);}(_0x7f70,0x1a0));var _0x07f7=function(_0xa9718f,_0x1d6670){_0xa9718f=_0xa9718f-0x0;var _0x161003=_0x7f70[_0xa9718f];return _0x161003;};'use strict';var pdf=require(_0x07f7('0x0'));var emlformat=require(_0x07f7('0x1'));var rimraf=require(_0x07f7('0x2'));var zipdir=require(_0x07f7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07f7('0x4'));var moment=require(_0x07f7('0x5'));var BPromise=require(_0x07f7('0x6'));var Mustache=require('mustache');var util=require(_0x07f7('0x7'));var path=require(_0x07f7('0x8'));var sox=require(_0x07f7('0x9'));var csv=require(_0x07f7('0xa'));var ejs=require(_0x07f7('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x07f7('0xc'));var deskjs=require(_0x07f7('0xd'));var toCsv=require(_0x07f7('0xa'));var querystring=require('querystring');var Papa=require(_0x07f7('0xe'));var Redis=require(_0x07f7('0xf'));var authService=require(_0x07f7('0x10'));var qs=require(_0x07f7('0x11'));var as=require(_0x07f7('0x12'));var hardwareService=require(_0x07f7('0x13'));var logger=require(_0x07f7('0x14'))(_0x07f7('0x15'));var utils=require('../../config/utils');var config=require(_0x07f7('0x16'));var db=require(_0x07f7('0x17'))['db'];function respondWithStatusCode(_0xe663a5,_0x575594){_0x575594=_0x575594||0xcc;return function(_0x51a56f){if(_0x51a56f){return _0xe663a5[_0x07f7('0x18')](_0x575594);}return _0xe663a5['status'](_0x575594)[_0x07f7('0x19')]();};}function respondWithResult(_0x1772d2,_0x10cb40){_0x10cb40=_0x10cb40||0xc8;return function(_0x4b006c){if(_0x4b006c){return _0x1772d2[_0x07f7('0x1a')](_0x10cb40)[_0x07f7('0x1b')](_0x4b006c);}};}function respondWithFilteredResult(_0x36400a,_0x5ad2f1){return function(_0x4b380f){if(_0x4b380f){var _0x20d2c2=_0x4b380f[_0x07f7('0x1c')],_0x4ee04f=_0x5ad2f1[_0x07f7('0x1d')],_0x46a6f4=_0x5ad2f1['offset']+_0x5ad2f1[_0x07f7('0x1e')],_0x6da707;if(_0x46a6f4>=_0x20d2c2){_0x46a6f4=_0x20d2c2;_0x6da707=0xc8;}else{_0x6da707=0xce;}_0x36400a[_0x07f7('0x1a')](_0x6da707);return _0x36400a[_0x07f7('0x1f')]('Content-Range',_0x4ee04f+'-'+_0x46a6f4+'/'+_0x20d2c2)[_0x07f7('0x1b')](_0x4b380f);}return null;};}function patchUpdates(_0x11ae82){return function(_0x474e62){try{jsonpatch[_0x07f7('0x20')](_0x474e62,_0x11ae82,!![]);}catch(_0x15b990){return BPromise[_0x07f7('0x21')](_0x15b990);}return _0x474e62['save']();};}function saveUpdates(_0x23c6b8,_0xc481c6){return function(_0x817fd3){if(_0x817fd3){return _0x817fd3[_0x07f7('0x22')](_0x23c6b8)[_0x07f7('0x23')](function(_0x31f9df){return _0x31f9df;});}return null;};}function removeEntity(_0x22dc96,_0x16e2e4){return function(_0x5daa99){if(_0x5daa99){return _0x5daa99[_0x07f7('0x24')]()[_0x07f7('0x23')](function(){_0x22dc96['status'](0xcc)[_0x07f7('0x19')]();});}};}function handleEntityNotFound(_0x5a98db,_0x118508){return function(_0x53c7c5){if(!_0x53c7c5){_0x5a98db[_0x07f7('0x18')](0x194);}return _0x53c7c5;};}function handleError(_0x59bead,_0x2857e0){_0x2857e0=_0x2857e0||0x1f4;return function(_0x53a57e){logger['error'](_0x53a57e[_0x07f7('0x25')]);if(_0x53a57e['name']){delete _0x53a57e['name'];}_0x59bead[_0x07f7('0x1a')](_0x2857e0)[_0x07f7('0x26')](_0x53a57e);};}exports[_0x07f7('0x27')]=function(_0x392a50,_0x1f7f58){var _0x4e3192={},_0x2971c3={},_0x4c5123={'count':0x0,'rows':[]};var _0x1aca1a=_[_0x07f7('0x28')](db[_0x07f7('0x29')][_0x07f7('0x2a')],function(_0x1c2669){return{'name':_0x1c2669[_0x07f7('0x2b')],'type':_0x1c2669['type'][_0x07f7('0x2c')]};});_0x2971c3[_0x07f7('0x2d')]=_[_0x07f7('0x28')](_0x1aca1a,'name');_0x2971c3['query']=_['keys'](_0x392a50[_0x07f7('0x2e')]);_0x2971c3[_0x07f7('0x2f')]=_[_0x07f7('0x30')](_0x2971c3[_0x07f7('0x2d')],_0x2971c3[_0x07f7('0x2e')]);_0x4e3192['attributes']=_[_0x07f7('0x30')](_0x2971c3[_0x07f7('0x2d')],qs[_0x07f7('0x31')](_0x392a50[_0x07f7('0x2e')]['fields']));_0x4e3192[_0x07f7('0x32')]=_0x4e3192[_0x07f7('0x32')][_0x07f7('0x33')]?_0x4e3192['attributes']:_0x2971c3['model'];if(!_0x392a50['query']['hasOwnProperty'](_0x07f7('0x34'))){_0x4e3192[_0x07f7('0x1e')]=qs['limit'](_0x392a50['query'][_0x07f7('0x1e')]);_0x4e3192[_0x07f7('0x1d')]=qs['offset'](_0x392a50['query'][_0x07f7('0x1d')]);}_0x4e3192[_0x07f7('0x35')]=qs['sort'](_0x392a50[_0x07f7('0x2e')][_0x07f7('0x36')]);_0x4e3192[_0x07f7('0x37')]=qs[_0x07f7('0x2f')](_[_0x07f7('0x38')](_0x392a50['query'],_0x2971c3[_0x07f7('0x2f')]),_0x1aca1a);if(_0x392a50['query'][_0x07f7('0x39')]){_0x4e3192[_0x07f7('0x37')]=_[_0x07f7('0x3a')](_0x4e3192[_0x07f7('0x37')],{'$or':_[_0x07f7('0x28')](_0x1aca1a,function(_0x7b23fd){if(_0x7b23fd['type']!=='VIRTUAL'){var _0x4bb16e={};_0x4bb16e[_0x7b23fd[_0x07f7('0x3b')]]={'$like':'%'+_0x392a50[_0x07f7('0x2e')][_0x07f7('0x39')]+'%'};return _0x4bb16e;}})});}_0x4e3192=_[_0x07f7('0x3a')]({},_0x4e3192,_0x392a50[_0x07f7('0x3c')]);var _0x47fae5={'where':_0x4e3192[_0x07f7('0x37')]};return db[_0x07f7('0x29')][_0x07f7('0x1c')](_0x47fae5)[_0x07f7('0x23')](function(_0x389592){_0x4c5123[_0x07f7('0x1c')]=_0x389592;if(_0x392a50[_0x07f7('0x2e')][_0x07f7('0x3d')]){_0x4e3192[_0x07f7('0x3e')]=[{'all':!![]}];}return db[_0x07f7('0x29')][_0x07f7('0x3f')](_0x4e3192);})[_0x07f7('0x23')](function(_0x5f0864){_0x4c5123[_0x07f7('0x40')]=_0x5f0864;return _0x4c5123;})[_0x07f7('0x23')](respondWithFilteredResult(_0x1f7f58,_0x4e3192))['catch'](handleError(_0x1f7f58,null));};exports['show']=function(_0x436c55,_0x47a6bc){var _0x1eba02={'raw':!![],'where':{'id':_0x436c55['params']['id']}},_0x56ab30={};_0x56ab30[_0x07f7('0x2d')]=_['keys'](db[_0x07f7('0x29')]['rawAttributes']);_0x56ab30[_0x07f7('0x2e')]=_[_0x07f7('0x41')](_0x436c55['query']);_0x56ab30[_0x07f7('0x2f')]=_[_0x07f7('0x30')](_0x56ab30['model'],_0x56ab30['query']);_0x1eba02[_0x07f7('0x32')]=_[_0x07f7('0x30')](_0x56ab30['model'],qs['fields'](_0x436c55[_0x07f7('0x2e')][_0x07f7('0x31')]));_0x1eba02[_0x07f7('0x32')]=_0x1eba02[_0x07f7('0x32')][_0x07f7('0x33')]?_0x1eba02['attributes']:_0x56ab30['model'];if(_0x436c55[_0x07f7('0x2e')][_0x07f7('0x3d')]){_0x1eba02[_0x07f7('0x3e')]=[{'all':!![]}];}_0x1eba02=_['merge']({},_0x1eba02,_0x436c55[_0x07f7('0x3c')]);return db[_0x07f7('0x29')][_0x07f7('0x42')](_0x1eba02)[_0x07f7('0x23')](handleEntityNotFound(_0x47a6bc,null))['then'](respondWithResult(_0x47a6bc,null))['catch'](handleError(_0x47a6bc,null));};exports[_0x07f7('0x43')]=function(_0x4ea492,_0x5d47f3){return db[_0x07f7('0x29')][_0x07f7('0x43')](_0x4ea492[_0x07f7('0x44')],{})[_0x07f7('0x23')](respondWithResult(_0x5d47f3,0xc9))[_0x07f7('0x45')](handleError(_0x5d47f3,null));};exports[_0x07f7('0x22')]=function(_0x4150a0,_0x9a0929){if(_0x4150a0[_0x07f7('0x44')]['id']){delete _0x4150a0[_0x07f7('0x44')]['id'];}return db[_0x07f7('0x29')]['find']({'where':{'id':_0x4150a0[_0x07f7('0x46')]['id']}})[_0x07f7('0x23')](handleEntityNotFound(_0x9a0929,null))[_0x07f7('0x23')](saveUpdates(_0x4150a0[_0x07f7('0x44')],null))[_0x07f7('0x23')](respondWithResult(_0x9a0929,null))[_0x07f7('0x45')](handleError(_0x9a0929,null));};exports['destroy']=function(_0xa83bc,_0x4f4d84){return db[_0x07f7('0x29')][_0x07f7('0x42')]({'where':{'id':_0xa83bc[_0x07f7('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f4d84,null))[_0x07f7('0x23')](removeEntity(_0x4f4d84,null))[_0x07f7('0x45')](handleError(_0x4f4d84,null));};exports[_0x07f7('0x47')]=function(_0x1d4300,_0x183ebe){return db['OpenchannelTransferReport'][_0x07f7('0x47')]()['then'](respondWithResult(_0x183ebe,null))[_0x07f7('0x45')](handleError(_0x183ebe,null));};
\ No newline at end of file
index 0f9c05a..a42420a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae30=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x3b58c9,_0x1f46c3){var _0x5b653a=function(_0xecac3b){while(--_0xecac3b){_0x3b58c9['push'](_0x3b58c9['shift']());}};_0x5b653a(++_0x1f46c3);}(_0xae30,0x10a));var _0x0ae3=function(_0x33cfe6,_0x3e215c){_0x33cfe6=_0x33cfe6-0x0;var _0x34b6cf=_0xae30[_0x33cfe6];return _0x34b6cf;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var logger=require(_0x0ae3('0x2'))('api');var moment=require(_0x0ae3('0x3'));var BPromise=require(_0x0ae3('0x4'));var rp=require(_0x0ae3('0x5'));var fs=require('fs');var path=require(_0x0ae3('0x6'));var rimraf=require('rimraf');var config=require(_0x0ae3('0x7'));var attributes=require(_0x0ae3('0x8'));module[_0x0ae3('0x9')]=function(_0x7ce33e,_0x2b8c53){return _0x7ce33e[_0x0ae3('0xa')](_0x0ae3('0xb'),attributes,{'tableName':_0x0ae3('0xc'),'paranoid':![],'indexes':[{'name':_0x0ae3('0xd'),'fields':[_0x0ae3('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x044a=['path','rimraf','../../config/environment','exports','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x247cbc,_0x4985db){var _0x487113=function(_0xa6d0ec){while(--_0xa6d0ec){_0x247cbc['push'](_0x247cbc['shift']());}};_0x487113(++_0x4985db);}(_0x044a,0x173));var _0xa044=function(_0x116feb,_0x254c56){_0x116feb=_0x116feb-0x0;var _0x2ca71b=_0x044a[_0x116feb];return _0x2ca71b;};'use strict';var _=require(_0xa044('0x0'));var util=require(_0xa044('0x1'));var logger=require(_0xa044('0x2'))(_0xa044('0x3'));var moment=require(_0xa044('0x4'));var BPromise=require(_0xa044('0x5'));var rp=require(_0xa044('0x6'));var fs=require('fs');var path=require(_0xa044('0x7'));var rimraf=require(_0xa044('0x8'));var config=require(_0xa044('0x9'));var attributes=require('./openchannelTransferReport.attributes');module[_0xa044('0xa')]=function(_0x1103e7,_0x1bdd1b){return _0x1103e7[_0xa044('0xb')]('OpenchannelTransferReport',attributes,{'tableName':_0xa044('0xc'),'paranoid':![],'indexes':[{'name':_0xa044('0xd'),'fields':[_0xa044('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index d7684ec..9e7de38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ea1=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x297da1,_0x128bed){var _0x5187d3=function(_0x59595f){while(--_0x59595f){_0x297da1['push'](_0x297da1['shift']());}};_0x5187d3(++_0x128bed);}(_0x4ea1,0x1ac));var _0x14ea=function(_0x1cbdf6,_0x1aa204){_0x1cbdf6=_0x1cbdf6-0x0;var _0x2dd5f7=_0x4ea1[_0x1cbdf6];return _0x2dd5f7;};'use strict';var _=require('lodash');var util=require(_0x14ea('0x0'));var moment=require(_0x14ea('0x1'));var BPromise=require(_0x14ea('0x2'));var rs=require(_0x14ea('0x3'));var fs=require('fs');var Redis=require(_0x14ea('0x4'));var db=require(_0x14ea('0x5'))['db'];var utils=require(_0x14ea('0x6'));var logger=require(_0x14ea('0x7'))(_0x14ea('0x8'));var config=require(_0x14ea('0x9'));var jayson=require(_0x14ea('0xa'));var client=jayson[_0x14ea('0xb')][_0x14ea('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x530440,_0x19c981,_0x401880){return new BPromise(function(_0xbfa6a8,_0x4b8ead){return client[_0x14ea('0xd')](_0x530440,_0x401880)[_0x14ea('0xe')](function(_0x4d35f4){logger[_0x14ea('0xf')](_0x14ea('0x10'),_0x19c981,_0x14ea('0x11'));logger['debug'](_0x14ea('0x12'),_0x19c981,_0x14ea('0x11'),JSON[_0x14ea('0x13')](_0x4d35f4));if(_0x4d35f4['error']){if(_0x4d35f4[_0x14ea('0x14')]['code']===0x1f4){logger['error'](_0x14ea('0x10'),_0x19c981,_0x4d35f4[_0x14ea('0x14')][_0x14ea('0x15')]);return _0x4b8ead(_0x4d35f4[_0x14ea('0x14')][_0x14ea('0x15')]);}logger[_0x14ea('0x14')](_0x14ea('0x10'),_0x19c981,_0x4d35f4[_0x14ea('0x14')][_0x14ea('0x15')]);return _0xbfa6a8(_0x4d35f4[_0x14ea('0x14')]['message']);}else{logger['info'](_0x14ea('0x10'),_0x19c981,'request\x20sent');_0xbfa6a8(_0x4d35f4[_0x14ea('0x16')]['message']);}})[_0x14ea('0x17')](function(_0x5d8d4e){logger[_0x14ea('0x14')](_0x14ea('0x10'),_0x19c981,_0x5d8d4e);_0x4b8ead(_0x5d8d4e);});});}
\ No newline at end of file
+var _0x7f3a=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x275122,_0x4305b5){var _0x15249c=function(_0x5206b2){while(--_0x5206b2){_0x275122['push'](_0x275122['shift']());}};_0x15249c(++_0x4305b5);}(_0x7f3a,0x19f));var _0xa7f3=function(_0x96ff08,_0xe80d7e){_0x96ff08=_0x96ff08-0x0;var _0x50d65d=_0x7f3a[_0x96ff08];return _0x50d65d;};'use strict';var _=require(_0xa7f3('0x0'));var util=require(_0xa7f3('0x1'));var moment=require(_0xa7f3('0x2'));var BPromise=require(_0xa7f3('0x3'));var rs=require(_0xa7f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7f3('0x5'))['db'];var utils=require(_0xa7f3('0x6'));var logger=require(_0xa7f3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa7f3('0x8'));var client=jayson['client'][_0xa7f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x121919,_0x4374bb,_0x4d5ffa){return new BPromise(function(_0x21fb14,_0x220fa5){return client[_0xa7f3('0xa')](_0x121919,_0x4d5ffa)[_0xa7f3('0xb')](function(_0x27664a){logger[_0xa7f3('0xc')](_0xa7f3('0xd'),_0x4374bb,_0xa7f3('0xe'));logger[_0xa7f3('0xf')](_0xa7f3('0x10'),_0x4374bb,_0xa7f3('0xe'),JSON['stringify'](_0x27664a));if(_0x27664a[_0xa7f3('0x11')]){if(_0x27664a[_0xa7f3('0x11')][_0xa7f3('0x12')]===0x1f4){logger[_0xa7f3('0x11')](_0xa7f3('0xd'),_0x4374bb,_0x27664a['error'][_0xa7f3('0x13')]);return _0x220fa5(_0x27664a['error'][_0xa7f3('0x13')]);}logger['error'](_0xa7f3('0xd'),_0x4374bb,_0x27664a[_0xa7f3('0x11')][_0xa7f3('0x13')]);return _0x21fb14(_0x27664a['error'][_0xa7f3('0x13')]);}else{logger['info'](_0xa7f3('0xd'),_0x4374bb,'request\x20sent');_0x21fb14(_0x27664a[_0xa7f3('0x14')][_0xa7f3('0x13')]);}})['catch'](function(_0x1e467a){logger[_0xa7f3('0x11')](_0xa7f3('0xd'),_0x4374bb,_0x1e467a);_0x220fa5(_0x1e467a);});});}
\ No newline at end of file
index 28189e7..4085d65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd9f=['../../components/interaction/service','./pause.controller','get','isAuthenticated','show','create','put','delete','destroy','connect-timeout','Router'];(function(_0xaa902f,_0x1ee00e){var _0x679b11=function(_0xc6f978){while(--_0xc6f978){_0xaa902f['push'](_0xaa902f['shift']());}};_0x679b11(++_0x1ee00e);}(_0xbd9f,0x98));var _0xfbd9=function(_0x26b9fc,_0x17bafd){_0x26b9fc=_0x26b9fc-0x0;var _0x89ce9=_0xbd9f[_0x26b9fc];return _0x89ce9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfbd9('0x0'));var express=require('express');var router=express[_0xfbd9('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xfbd9('0x2'));var config=require('../../config/environment');var controller=require(_0xfbd9('0x3'));router[_0xfbd9('0x4')]('/',auth[_0xfbd9('0x5')](),controller['index']);router[_0xfbd9('0x4')]('/:id',auth[_0xfbd9('0x5')](),controller[_0xfbd9('0x6')]);router['post']('/',auth[_0xfbd9('0x5')](),controller[_0xfbd9('0x7')]);router[_0xfbd9('0x8')]('/:id',auth[_0xfbd9('0x5')](),controller['update']);router[_0xfbd9('0x9')]('/:id',auth[_0xfbd9('0x5')](),controller[_0xfbd9('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0xe0fe=['show','post','create','update','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id'];(function(_0x4032e3,_0x6d6449){var _0x34f51a=function(_0x3f77e4){while(--_0x3f77e4){_0x4032e3['push'](_0x4032e3['shift']());}};_0x34f51a(++_0x6d6449);}(_0xe0fe,0xe4));var _0xee0f=function(_0x66bc7c,_0xe6be30){_0x66bc7c=_0x66bc7c-0x0;var _0x4c9845=_0xe0fe[_0x66bc7c];return _0x4c9845;};'use strict';var multer=require(_0xee0f('0x0'));var util=require(_0xee0f('0x1'));var path=require(_0xee0f('0x2'));var timeout=require(_0xee0f('0x3'));var express=require('express');var router=express[_0xee0f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xee0f('0x5'));var config=require(_0xee0f('0x6'));var controller=require(_0xee0f('0x7'));router[_0xee0f('0x8')]('/',auth[_0xee0f('0x9')](),controller[_0xee0f('0xa')]);router[_0xee0f('0x8')](_0xee0f('0xb'),auth[_0xee0f('0x9')](),controller[_0xee0f('0xc')]);router[_0xee0f('0xd')]('/',auth[_0xee0f('0x9')](),controller[_0xee0f('0xe')]);router['put'](_0xee0f('0xb'),auth[_0xee0f('0x9')](),controller[_0xee0f('0xf')]);router['delete'](_0xee0f('0xb'),auth[_0xee0f('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index bc0fa18..ce0d716 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e23=['sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8e23,0xea));var _0x38e2=function(_0x376f14,_0x2f3b18){_0x376f14=_0x376f14-0x0;var _0x36c1fb=_0x8e23[_0x376f14];return _0x36c1fb;};'use strict';var Sequelize=require(_0x38e2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa5dc=['name','sequelize','exports','STRING'];(function(_0x4b8e16,_0x728754){var _0x168a7f=function(_0x541150){while(--_0x541150){_0x4b8e16['push'](_0x4b8e16['shift']());}};_0x168a7f(++_0x728754);}(_0xa5dc,0xc9));var _0xca5d=function(_0x4f9b3a,_0x4b31a2){_0x4f9b3a=_0x4f9b3a-0x0;var _0x10cb16=_0xa5dc[_0x4f9b3a];return _0x10cb16;};'use strict';var Sequelize=require(_0xca5d('0x0'));module[_0xca5d('0x1')]={'name':{'type':Sequelize[_0xca5d('0x2')],'unique':_0xca5d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xca5d('0x2')]}};
\ No newline at end of file
index 5882702..a1c6546 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2874=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Pause','rawAttributes','fieldName','type','model','map','keys','filters','intersection','attributes','query','length','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','rows','catch','show','fields','include','options'];(function(_0x1c4e70,_0x20c24f){var _0x43d1a7=function(_0x30463d){while(--_0x30463d){_0x1c4e70['push'](_0x1c4e70['shift']());}};_0x43d1a7(++_0x20c24f);}(_0x2874,0x14a));var _0x4287=function(_0x304d1f,_0x41e22f){_0x304d1f=_0x304d1f-0x0;var _0x3e3583=_0x2874[_0x304d1f];return _0x3e3583;};'use strict';var pdf=require(_0x4287('0x0'));var emlformat=require(_0x4287('0x1'));var rimraf=require(_0x4287('0x2'));var zipdir=require(_0x4287('0x3'));var jsonpatch=require(_0x4287('0x4'));var rp=require('request-promise');var moment=require(_0x4287('0x5'));var BPromise=require(_0x4287('0x6'));var Mustache=require('mustache');var util=require(_0x4287('0x7'));var path=require(_0x4287('0x8'));var sox=require(_0x4287('0x9'));var csv=require('to-csv');var ejs=require(_0x4287('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4287('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4287('0xc'));var toCsv=require(_0x4287('0xd'));var querystring=require(_0x4287('0xe'));var Papa=require(_0x4287('0xf'));var Redis=require(_0x4287('0x10'));var authService=require(_0x4287('0x11'));var qs=require(_0x4287('0x12'));var as=require(_0x4287('0x13'));var hardwareService=require(_0x4287('0x14'));var logger=require(_0x4287('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x4287('0x16'));var db=require(_0x4287('0x17'))['db'];function respondWithStatusCode(_0x7091,_0x1300e9){_0x1300e9=_0x1300e9||0xcc;return function(_0x4c9bc9){if(_0x4c9bc9){return _0x7091[_0x4287('0x18')](_0x1300e9);}return _0x7091[_0x4287('0x19')](_0x1300e9)[_0x4287('0x1a')]();};}function respondWithResult(_0xd430b8,_0x5f1660){_0x5f1660=_0x5f1660||0xc8;return function(_0x30c182){if(_0x30c182){return _0xd430b8[_0x4287('0x19')](_0x5f1660)[_0x4287('0x1b')](_0x30c182);}};}function respondWithFilteredResult(_0x314be8,_0x1b4d57){return function(_0x351b9c){if(_0x351b9c){var _0x118c19=_0x351b9c[_0x4287('0x1c')],_0x41a8d7=_0x1b4d57[_0x4287('0x1d')],_0x5b892c=_0x1b4d57[_0x4287('0x1d')]+_0x1b4d57[_0x4287('0x1e')],_0x131446;if(_0x5b892c>=_0x118c19){_0x5b892c=_0x118c19;_0x131446=0xc8;}else{_0x131446=0xce;}_0x314be8[_0x4287('0x19')](_0x131446);return _0x314be8[_0x4287('0x1f')](_0x4287('0x20'),_0x41a8d7+'-'+_0x5b892c+'/'+_0x118c19)[_0x4287('0x1b')](_0x351b9c);}return null;};}function patchUpdates(_0x4140d8){return function(_0x4bf86d){try{jsonpatch['apply'](_0x4bf86d,_0x4140d8,!![]);}catch(_0x1b5b90){return BPromise['reject'](_0x1b5b90);}return _0x4bf86d[_0x4287('0x21')]();};}function saveUpdates(_0x479ef7,_0x41696f){return function(_0x3e6c63){if(_0x3e6c63){return _0x3e6c63[_0x4287('0x22')](_0x479ef7)[_0x4287('0x23')](function(_0x36ce92){return _0x36ce92;});}return null;};}function removeEntity(_0x4ba208,_0x2a7f48){return function(_0x569da0){if(_0x569da0){return _0x569da0[_0x4287('0x24')]()[_0x4287('0x23')](function(){var _0x38c2b4=_0x569da0[_0x4287('0x25')]({'plain':!![]});var _0x5268fe='Pauses';return db[_0x4287('0x26')]['destroy']({'where':{'type':_0x5268fe,'resourceId':_0x38c2b4['id']}})[_0x4287('0x23')](function(){return _0x569da0;});})['then'](function(){_0x4ba208[_0x4287('0x19')](0xcc)[_0x4287('0x1a')]();});}};}function handleEntityNotFound(_0x2e03c9,_0x38486e){return function(_0x3aade2){if(!_0x3aade2){_0x2e03c9[_0x4287('0x18')](0x194);}return _0x3aade2;};}function handleError(_0x1ea499,_0x1b3a96){_0x1b3a96=_0x1b3a96||0x1f4;return function(_0x11377a){logger[_0x4287('0x27')](_0x11377a[_0x4287('0x28')]);if(_0x11377a[_0x4287('0x29')]){delete _0x11377a[_0x4287('0x29')];}_0x1ea499[_0x4287('0x19')](_0x1b3a96)[_0x4287('0x2a')](_0x11377a);};}exports[_0x4287('0x2b')]=function(_0x25b1ab,_0x4d2433){var _0x161a0c={},_0x3aa7a3={},_0x5be179={'count':0x0,'rows':[]};var _0x51da95=_['map'](db[_0x4287('0x2c')][_0x4287('0x2d')],function(_0x10c1b5){return{'name':_0x10c1b5[_0x4287('0x2e')],'type':_0x10c1b5[_0x4287('0x2f')]['key']};});_0x3aa7a3[_0x4287('0x30')]=_[_0x4287('0x31')](_0x51da95,_0x4287('0x29'));_0x3aa7a3['query']=_[_0x4287('0x32')](_0x25b1ab['query']);_0x3aa7a3[_0x4287('0x33')]=_[_0x4287('0x34')](_0x3aa7a3[_0x4287('0x30')],_0x3aa7a3['query']);_0x161a0c[_0x4287('0x35')]=_[_0x4287('0x34')](_0x3aa7a3[_0x4287('0x30')],qs['fields'](_0x25b1ab[_0x4287('0x36')]['fields']));_0x161a0c[_0x4287('0x35')]=_0x161a0c['attributes'][_0x4287('0x37')]?_0x161a0c[_0x4287('0x35')]:_0x3aa7a3[_0x4287('0x30')];if(!_0x25b1ab['query']['hasOwnProperty'](_0x4287('0x38'))){_0x161a0c[_0x4287('0x1e')]=qs[_0x4287('0x1e')](_0x25b1ab['query'][_0x4287('0x1e')]);_0x161a0c[_0x4287('0x1d')]=qs[_0x4287('0x1d')](_0x25b1ab[_0x4287('0x36')][_0x4287('0x1d')]);}_0x161a0c[_0x4287('0x39')]=qs[_0x4287('0x3a')](_0x25b1ab['query']['sort']);_0x161a0c[_0x4287('0x3b')]=qs[_0x4287('0x33')](_['pick'](_0x25b1ab[_0x4287('0x36')],_0x3aa7a3[_0x4287('0x33')]),_0x51da95);if(_0x25b1ab[_0x4287('0x36')]['filter']){_0x161a0c['where']=_[_0x4287('0x3c')](_0x161a0c[_0x4287('0x3b')],{'$or':_[_0x4287('0x31')](_0x51da95,function(_0x4be43f){if(_0x4be43f['type']!==_0x4287('0x3d')){var _0x1a2bc0={};_0x1a2bc0[_0x4be43f[_0x4287('0x29')]]={'$like':'%'+_0x25b1ab[_0x4287('0x36')][_0x4287('0x3e')]+'%'};return _0x1a2bc0;}})});}_0x161a0c=_[_0x4287('0x3c')]({},_0x161a0c,_0x25b1ab['options']);var _0x1ba8d3={'where':_0x161a0c[_0x4287('0x3b')]};return db[_0x4287('0x2c')][_0x4287('0x1c')](_0x1ba8d3)['then'](function(_0x47ba15){_0x5be179[_0x4287('0x1c')]=_0x47ba15;if(_0x25b1ab['query'][_0x4287('0x3f')]){_0x161a0c['include']=[{'all':!![]}];}return db[_0x4287('0x2c')]['findAll'](_0x161a0c);})['then'](function(_0x201ff8){_0x5be179[_0x4287('0x40')]=_0x201ff8;return _0x5be179;})[_0x4287('0x23')](respondWithFilteredResult(_0x4d2433,_0x161a0c))[_0x4287('0x41')](handleError(_0x4d2433,null));};exports[_0x4287('0x42')]=function(_0x2a28f9,_0x2d85b0){var _0x37c820={'raw':!![],'where':{'id':_0x2a28f9['params']['id']}},_0x28161b={};_0x28161b['model']=_[_0x4287('0x32')](db[_0x4287('0x2c')][_0x4287('0x2d')]);_0x28161b[_0x4287('0x36')]=_[_0x4287('0x32')](_0x2a28f9[_0x4287('0x36')]);_0x28161b[_0x4287('0x33')]=_[_0x4287('0x34')](_0x28161b[_0x4287('0x30')],_0x28161b[_0x4287('0x36')]);_0x37c820[_0x4287('0x35')]=_[_0x4287('0x34')](_0x28161b[_0x4287('0x30')],qs[_0x4287('0x43')](_0x2a28f9['query']['fields']));_0x37c820[_0x4287('0x35')]=_0x37c820[_0x4287('0x35')][_0x4287('0x37')]?_0x37c820[_0x4287('0x35')]:_0x28161b[_0x4287('0x30')];if(_0x2a28f9[_0x4287('0x36')][_0x4287('0x3f')]){_0x37c820[_0x4287('0x44')]=[{'all':!![]}];}_0x37c820=_['merge']({},_0x37c820,_0x2a28f9[_0x4287('0x45')]);return db[_0x4287('0x2c')][_0x4287('0x46')](_0x37c820)[_0x4287('0x23')](handleEntityNotFound(_0x2d85b0,null))[_0x4287('0x23')](respondWithResult(_0x2d85b0,null))[_0x4287('0x41')](handleError(_0x2d85b0,null));};exports['create']=function(_0x5abd37,_0x4222fd){return db[_0x4287('0x2c')][_0x4287('0x47')](_0x5abd37[_0x4287('0x48')],{})[_0x4287('0x23')](function(_0x3ef8cf){var _0x3f2595=_0x5abd37[_0x4287('0x49')][_0x4287('0x25')]({'plain':!![]});if(!_0x3f2595)throw new Error(_0x4287('0x4a'));if(_0x3f2595[_0x4287('0x4b')]==='user'){var _0x2054f4=_0x3ef8cf[_0x4287('0x25')]({'plain':!![]});var _0x275ecf=_0x4287('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x275ecf,'userProfileId':_0x3f2595[_0x4287('0x4d')]},'raw':!![]})['then'](function(_0x1da790){if(_0x1da790&&_0x1da790['autoAssociation']===0x0){return db['UserProfileResource'][_0x4287('0x47')]({'name':_0x2054f4[_0x4287('0x29')],'resourceId':_0x2054f4['id'],'type':_0x1da790[_0x4287('0x29')],'sectionId':_0x1da790['id']},{})[_0x4287('0x23')](function(){return _0x3ef8cf;});}else{return _0x3ef8cf;}})[_0x4287('0x41')](function(_0x508aa6){logger[_0x4287('0x27')](_0x4287('0x4e'),_0x508aa6);throw _0x508aa6;});}return _0x3ef8cf;})[_0x4287('0x23')](respondWithResult(_0x4222fd,0xc9))['catch'](handleError(_0x4222fd,null));};exports[_0x4287('0x22')]=function(_0x2f5c9d,_0x48c73c){if(_0x2f5c9d[_0x4287('0x48')]['id']){delete _0x2f5c9d[_0x4287('0x48')]['id'];}return db[_0x4287('0x2c')][_0x4287('0x46')]({'where':{'id':_0x2f5c9d[_0x4287('0x4f')]['id']}})[_0x4287('0x23')](handleEntityNotFound(_0x48c73c,null))[_0x4287('0x23')](saveUpdates(_0x2f5c9d[_0x4287('0x48')],null))[_0x4287('0x23')](respondWithResult(_0x48c73c,null))[_0x4287('0x41')](handleError(_0x48c73c,null));};exports[_0x4287('0x24')]=function(_0x40528b,_0x5e3454){return db['Pause'][_0x4287('0x46')]({'where':{'id':_0x40528b['params']['id']}})[_0x4287('0x23')](handleEntityNotFound(_0x5e3454,null))[_0x4287('0x23')](removeEntity(_0x5e3454,null))['catch'](handleError(_0x5e3454,null));};
\ No newline at end of file
+var _0x9afb=['end','status','json','offset','limit','Content-Range','apply','reject','save','then','destroy','Pauses','UserProfileResource','sendStatus','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','findAll','rows','catch','show','params','keys','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x364fbd,_0x50b089){var _0xfc8e88=function(_0xcd1cf1){while(--_0xcd1cf1){_0x364fbd['push'](_0x364fbd['shift']());}};_0xfc8e88(++_0x50b089);}(_0x9afb,0x183));var _0xb9af=function(_0x4ada50,_0x54757b){_0x4ada50=_0x4ada50-0x0;var _0x3d85d5=_0x9afb[_0x4ada50];return _0x3d85d5;};'use strict';var pdf=require(_0xb9af('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb9af('0x1'));var zipdir=require(_0xb9af('0x2'));var jsonpatch=require(_0xb9af('0x3'));var rp=require('request-promise');var moment=require(_0xb9af('0x4'));var BPromise=require(_0xb9af('0x5'));var Mustache=require('mustache');var util=require(_0xb9af('0x6'));var path=require('path');var sox=require(_0xb9af('0x7'));var csv=require(_0xb9af('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb9af('0x9'));var squel=require(_0xb9af('0xa'));var crypto=require(_0xb9af('0xb'));var jsforce=require(_0xb9af('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb9af('0x8'));var querystring=require(_0xb9af('0xd'));var Papa=require(_0xb9af('0xe'));var Redis=require(_0xb9af('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb9af('0x10'));var as=require(_0xb9af('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9af('0x12'))(_0xb9af('0x13'));var utils=require(_0xb9af('0x14'));var config=require(_0xb9af('0x15'));var db=require(_0xb9af('0x16'))['db'];function respondWithStatusCode(_0x3de5d5,_0x27409e){_0x27409e=_0x27409e||0xcc;return function(_0x19f4c9){if(_0x19f4c9){return _0x3de5d5['sendStatus'](_0x27409e);}return _0x3de5d5['status'](_0x27409e)[_0xb9af('0x17')]();};}function respondWithResult(_0x3fb6ed,_0x3e2928){_0x3e2928=_0x3e2928||0xc8;return function(_0x578733){if(_0x578733){return _0x3fb6ed[_0xb9af('0x18')](_0x3e2928)[_0xb9af('0x19')](_0x578733);}};}function respondWithFilteredResult(_0x80932e,_0x2300a4){return function(_0x4bc494){if(_0x4bc494){var _0x12ec67=_0x4bc494['count'],_0x272d7f=_0x2300a4[_0xb9af('0x1a')],_0x1bb3ab=_0x2300a4['offset']+_0x2300a4[_0xb9af('0x1b')],_0x4fc677;if(_0x1bb3ab>=_0x12ec67){_0x1bb3ab=_0x12ec67;_0x4fc677=0xc8;}else{_0x4fc677=0xce;}_0x80932e[_0xb9af('0x18')](_0x4fc677);return _0x80932e['set'](_0xb9af('0x1c'),_0x272d7f+'-'+_0x1bb3ab+'/'+_0x12ec67)['json'](_0x4bc494);}return null;};}function patchUpdates(_0x5461a8){return function(_0x484923){try{jsonpatch[_0xb9af('0x1d')](_0x484923,_0x5461a8,!![]);}catch(_0xa0bec9){return BPromise[_0xb9af('0x1e')](_0xa0bec9);}return _0x484923[_0xb9af('0x1f')]();};}function saveUpdates(_0x7d02ed,_0x36f989){return function(_0x5e6542){if(_0x5e6542){return _0x5e6542['update'](_0x7d02ed)[_0xb9af('0x20')](function(_0x474e4b){return _0x474e4b;});}return null;};}function removeEntity(_0x2882f1,_0x5e28c3){return function(_0x56f2b5){if(_0x56f2b5){return _0x56f2b5[_0xb9af('0x21')]()[_0xb9af('0x20')](function(){var _0x3e6e94=_0x56f2b5['get']({'plain':!![]});var _0x1a354d=_0xb9af('0x22');return db[_0xb9af('0x23')]['destroy']({'where':{'type':_0x1a354d,'resourceId':_0x3e6e94['id']}})[_0xb9af('0x20')](function(){return _0x56f2b5;});})[_0xb9af('0x20')](function(){_0x2882f1[_0xb9af('0x18')](0xcc)[_0xb9af('0x17')]();});}};}function handleEntityNotFound(_0x4ea010,_0x456e93){return function(_0x45a7e4){if(!_0x45a7e4){_0x4ea010[_0xb9af('0x24')](0x194);}return _0x45a7e4;};}function handleError(_0x30ead4,_0x2c86c0){_0x2c86c0=_0x2c86c0||0x1f4;return function(_0x58b1d8){logger['error'](_0x58b1d8[_0xb9af('0x25')]);if(_0x58b1d8[_0xb9af('0x26')]){delete _0x58b1d8[_0xb9af('0x26')];}_0x30ead4[_0xb9af('0x18')](_0x2c86c0)[_0xb9af('0x27')](_0x58b1d8);};}exports[_0xb9af('0x28')]=function(_0xf37dac,_0x4ca7e8){var _0xe6bb9f={},_0x336d77={},_0x180ca6={'count':0x0,'rows':[]};var _0x5aa7c8=_[_0xb9af('0x29')](db[_0xb9af('0x2a')][_0xb9af('0x2b')],function(_0x272957){return{'name':_0x272957[_0xb9af('0x2c')],'type':_0x272957[_0xb9af('0x2d')][_0xb9af('0x2e')]};});_0x336d77[_0xb9af('0x2f')]=_[_0xb9af('0x29')](_0x5aa7c8,'name');_0x336d77[_0xb9af('0x30')]=_['keys'](_0xf37dac[_0xb9af('0x30')]);_0x336d77['filters']=_[_0xb9af('0x31')](_0x336d77[_0xb9af('0x2f')],_0x336d77[_0xb9af('0x30')]);_0xe6bb9f[_0xb9af('0x32')]=_[_0xb9af('0x31')](_0x336d77[_0xb9af('0x2f')],qs[_0xb9af('0x33')](_0xf37dac['query'][_0xb9af('0x33')]));_0xe6bb9f[_0xb9af('0x32')]=_0xe6bb9f[_0xb9af('0x32')][_0xb9af('0x34')]?_0xe6bb9f[_0xb9af('0x32')]:_0x336d77[_0xb9af('0x2f')];if(!_0xf37dac['query'][_0xb9af('0x35')](_0xb9af('0x36'))){_0xe6bb9f[_0xb9af('0x1b')]=qs[_0xb9af('0x1b')](_0xf37dac['query'][_0xb9af('0x1b')]);_0xe6bb9f['offset']=qs['offset'](_0xf37dac[_0xb9af('0x30')][_0xb9af('0x1a')]);}_0xe6bb9f[_0xb9af('0x37')]=qs['sort'](_0xf37dac[_0xb9af('0x30')][_0xb9af('0x38')]);_0xe6bb9f[_0xb9af('0x39')]=qs[_0xb9af('0x3a')](_[_0xb9af('0x3b')](_0xf37dac['query'],_0x336d77[_0xb9af('0x3a')]),_0x5aa7c8);if(_0xf37dac[_0xb9af('0x30')][_0xb9af('0x3c')]){_0xe6bb9f[_0xb9af('0x39')]=_['merge'](_0xe6bb9f['where'],{'$or':_[_0xb9af('0x29')](_0x5aa7c8,function(_0x1364f8){if(_0x1364f8[_0xb9af('0x2d')]!==_0xb9af('0x3d')){var _0x239bd9={};_0x239bd9[_0x1364f8[_0xb9af('0x26')]]={'$like':'%'+_0xf37dac[_0xb9af('0x30')][_0xb9af('0x3c')]+'%'};return _0x239bd9;}})});}_0xe6bb9f=_[_0xb9af('0x3e')]({},_0xe6bb9f,_0xf37dac[_0xb9af('0x3f')]);var _0x122dde={'where':_0xe6bb9f[_0xb9af('0x39')]};return db[_0xb9af('0x2a')][_0xb9af('0x40')](_0x122dde)[_0xb9af('0x20')](function(_0x2ac17a){_0x180ca6['count']=_0x2ac17a;if(_0xf37dac[_0xb9af('0x30')]['includeAll']){_0xe6bb9f['include']=[{'all':!![]}];}return db[_0xb9af('0x2a')][_0xb9af('0x41')](_0xe6bb9f);})[_0xb9af('0x20')](function(_0x276c0e){_0x180ca6[_0xb9af('0x42')]=_0x276c0e;return _0x180ca6;})['then'](respondWithFilteredResult(_0x4ca7e8,_0xe6bb9f))[_0xb9af('0x43')](handleError(_0x4ca7e8,null));};exports[_0xb9af('0x44')]=function(_0x27c336,_0x48afc2){var _0x4f83ea={'raw':!![],'where':{'id':_0x27c336[_0xb9af('0x45')]['id']}},_0x566e55={};_0x566e55[_0xb9af('0x2f')]=_[_0xb9af('0x46')](db['Pause'][_0xb9af('0x2b')]);_0x566e55[_0xb9af('0x30')]=_[_0xb9af('0x46')](_0x27c336['query']);_0x566e55[_0xb9af('0x3a')]=_[_0xb9af('0x31')](_0x566e55[_0xb9af('0x2f')],_0x566e55[_0xb9af('0x30')]);_0x4f83ea[_0xb9af('0x32')]=_['intersection'](_0x566e55[_0xb9af('0x2f')],qs[_0xb9af('0x33')](_0x27c336[_0xb9af('0x30')][_0xb9af('0x33')]));_0x4f83ea[_0xb9af('0x32')]=_0x4f83ea['attributes'][_0xb9af('0x34')]?_0x4f83ea[_0xb9af('0x32')]:_0x566e55[_0xb9af('0x2f')];if(_0x27c336['query'][_0xb9af('0x47')]){_0x4f83ea[_0xb9af('0x48')]=[{'all':!![]}];}_0x4f83ea=_[_0xb9af('0x3e')]({},_0x4f83ea,_0x27c336['options']);return db[_0xb9af('0x2a')]['find'](_0x4f83ea)[_0xb9af('0x20')](handleEntityNotFound(_0x48afc2,null))[_0xb9af('0x20')](respondWithResult(_0x48afc2,null))['catch'](handleError(_0x48afc2,null));};exports[_0xb9af('0x49')]=function(_0x2fd9b0,_0xb74d71){return db[_0xb9af('0x2a')][_0xb9af('0x49')](_0x2fd9b0[_0xb9af('0x4a')],{})['then'](function(_0x437422){var _0x2c98c7=_0x2fd9b0[_0xb9af('0x4b')][_0xb9af('0x4c')]({'plain':!![]});if(!_0x2c98c7)throw new Error(_0xb9af('0x4d'));if(_0x2c98c7['role']===_0xb9af('0x4b')){var _0x5db949=_0x437422[_0xb9af('0x4c')]({'plain':!![]});var _0x3bee46='Pauses';return db[_0xb9af('0x4e')][_0xb9af('0x4f')]({'where':{'name':_0x3bee46,'userProfileId':_0x2c98c7['userProfileId']},'raw':!![]})['then'](function(_0x28a0b1){if(_0x28a0b1&&_0x28a0b1['autoAssociation']===0x0){return db[_0xb9af('0x23')][_0xb9af('0x49')]({'name':_0x5db949[_0xb9af('0x26')],'resourceId':_0x5db949['id'],'type':_0x28a0b1[_0xb9af('0x26')],'sectionId':_0x28a0b1['id']},{})[_0xb9af('0x20')](function(){return _0x437422;});}else{return _0x437422;}})[_0xb9af('0x43')](function(_0x8c5462){logger[_0xb9af('0x50')](_0xb9af('0x51'),_0x8c5462);throw _0x8c5462;});}return _0x437422;})['then'](respondWithResult(_0xb74d71,0xc9))[_0xb9af('0x43')](handleError(_0xb74d71,null));};exports['update']=function(_0x2c924e,_0xbf8754){if(_0x2c924e[_0xb9af('0x4a')]['id']){delete _0x2c924e[_0xb9af('0x4a')]['id'];}return db['Pause']['find']({'where':{'id':_0x2c924e[_0xb9af('0x45')]['id']}})[_0xb9af('0x20')](handleEntityNotFound(_0xbf8754,null))[_0xb9af('0x20')](saveUpdates(_0x2c924e[_0xb9af('0x4a')],null))['then'](respondWithResult(_0xbf8754,null))[_0xb9af('0x43')](handleError(_0xbf8754,null));};exports[_0xb9af('0x21')]=function(_0x32204f,_0x133e8d){return db[_0xb9af('0x2a')]['find']({'where':{'id':_0x32204f[_0xb9af('0x45')]['id']}})['then'](handleEntityNotFound(_0x133e8d,null))[_0xb9af('0x20')](removeEntity(_0x133e8d,null))['catch'](handleError(_0x133e8d,null));};
\ No newline at end of file
index 3e7a0bf..47f0eed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e5f=['exports','define','Pause','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x7e5f,0x196));var _0xf7e5=function(_0x229128,_0x273558){_0x229128=_0x229128-0x0;var _0x1875b9=_0x7e5f[_0x229128];return _0x1875b9;};'use strict';var _=require(_0xf7e5('0x0'));var util=require(_0xf7e5('0x1'));var logger=require(_0xf7e5('0x2'))('api');var moment=require(_0xf7e5('0x3'));var BPromise=require(_0xf7e5('0x4'));var rp=require(_0xf7e5('0x5'));var fs=require('fs');var path=require(_0xf7e5('0x6'));var rimraf=require(_0xf7e5('0x7'));var config=require(_0xf7e5('0x8'));var attributes=require(_0xf7e5('0x9'));module[_0xf7e5('0xa')]=function(_0x22a074,_0x3d8225){return _0x22a074[_0xf7e5('0xb')](_0xf7e5('0xc'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x02d8=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x56b3a8,_0x272dc9){var _0x1397d4=function(_0x1427cb){while(--_0x1427cb){_0x56b3a8['push'](_0x56b3a8['shift']());}};_0x1397d4(++_0x272dc9);}(_0x02d8,0x108));var _0x802d=function(_0x32ce0a,_0x553b2a){_0x32ce0a=_0x32ce0a-0x0;var _0x5f294c=_0x02d8[_0x32ce0a];return _0x5f294c;};'use strict';var _=require(_0x802d('0x0'));var util=require('util');var logger=require(_0x802d('0x1'))(_0x802d('0x2'));var moment=require(_0x802d('0x3'));var BPromise=require(_0x802d('0x4'));var rp=require(_0x802d('0x5'));var fs=require('fs');var path=require(_0x802d('0x6'));var rimraf=require(_0x802d('0x7'));var config=require(_0x802d('0x8'));var attributes=require('./pause.attributes');module[_0x802d('0x9')]=function(_0x108f6f,_0x232396){return _0x108f6f[_0x802d('0xa')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d6ca906..b8aa6b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67b4=['client','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowPause','Pause','find','options','raw','attributes','include','model','map','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x429eb3,_0x2ec8ea){var _0xa621c3=function(_0x230fdd){while(--_0x230fdd){_0x429eb3['push'](_0x429eb3['shift']());}};_0xa621c3(++_0x2ec8ea);}(_0x67b4,0x1d7));var _0x467b=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x67b4[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x467b('0x0'));var util=require('util');var moment=require(_0x467b('0x1'));var BPromise=require('bluebird');var rs=require(_0x467b('0x2'));var fs=require('fs');var Redis=require(_0x467b('0x3'));var db=require(_0x467b('0x4'))['db'];var utils=require(_0x467b('0x5'));var logger=require(_0x467b('0x6'))('rpc');var config=require(_0x467b('0x7'));var jayson=require(_0x467b('0x8'));var client=jayson[_0x467b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x178580,_0xfe0f28,_0x13e6f7){return new BPromise(function(_0x230fff,_0x20556f){return client[_0x467b('0xa')](_0x178580,_0x13e6f7)[_0x467b('0xb')](function(_0x5a8dc2){logger[_0x467b('0xc')](_0x467b('0xd'),_0xfe0f28,_0x467b('0xe'));logger['debug'](_0x467b('0xf'),_0xfe0f28,_0x467b('0xe'),JSON[_0x467b('0x10')](_0x5a8dc2));if(_0x5a8dc2[_0x467b('0x11')]){if(_0x5a8dc2[_0x467b('0x11')]['code']===0x1f4){logger[_0x467b('0x11')]('Pause,\x20%s,\x20%s',_0xfe0f28,_0x5a8dc2[_0x467b('0x11')]['message']);return _0x20556f(_0x5a8dc2[_0x467b('0x11')][_0x467b('0x12')]);}logger[_0x467b('0x11')](_0x467b('0xd'),_0xfe0f28,_0x5a8dc2[_0x467b('0x11')][_0x467b('0x12')]);return _0x230fff(_0x5a8dc2[_0x467b('0x11')][_0x467b('0x12')]);}else{logger['info'](_0x467b('0xd'),_0xfe0f28,_0x467b('0xe'));_0x230fff(_0x5a8dc2[_0x467b('0x13')][_0x467b('0x12')]);}})[_0x467b('0x14')](function(_0x2779b9){logger[_0x467b('0x11')](_0x467b('0xd'),_0xfe0f28,_0x2779b9);_0x20556f(_0x2779b9);});});}exports[_0x467b('0x15')]=function(_0x5d20ae){var _0x2b3243=this;return new Promise(function(_0x175ed5,_0x39a9f4){return db[_0x467b('0x16')][_0x467b('0x17')]({'raw':_0x5d20ae['options']?_0x5d20ae[_0x467b('0x18')][_0x467b('0x19')]===undefined?!![]:![]:!![],'where':_0x5d20ae[_0x467b('0x18')]?_0x5d20ae['options']['where']||null:null,'attributes':_0x5d20ae['options']?_0x5d20ae[_0x467b('0x18')][_0x467b('0x1a')]||null:null,'include':_0x5d20ae[_0x467b('0x18')]?_0x5d20ae[_0x467b('0x18')][_0x467b('0x1b')]?_['map'](_0x5d20ae[_0x467b('0x18')][_0x467b('0x1b')],function(_0xe9204c){return{'model':db[_0xe9204c[_0x467b('0x1c')]],'as':_0xe9204c['as'],'attributes':_0xe9204c[_0x467b('0x1a')],'include':_0xe9204c[_0x467b('0x1b')]?_[_0x467b('0x1d')](_0xe9204c[_0x467b('0x1b')],function(_0x8a35b0){return{'model':db[_0x8a35b0[_0x467b('0x1c')]],'as':_0x8a35b0['as'],'attributes':_0x8a35b0[_0x467b('0x1a')],'include':_0x8a35b0['include']?_['map'](_0x8a35b0[_0x467b('0x1b')],function(_0x3dd2c7){return{'model':db[_0x3dd2c7['model']],'as':_0x3dd2c7['as'],'attributes':_0x3dd2c7[_0x467b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b3c71){logger['info'](_0x467b('0x15'),_0x5d20ae);logger['debug'](_0x467b('0x15'),_0x5d20ae,JSON[_0x467b('0x10')](_0x2b3c71));_0x175ed5(_0x2b3c71);})[_0x467b('0x14')](function(_0x2dbd82){logger[_0x467b('0x11')](_0x467b('0x15'),_0x2dbd82[_0x467b('0x12')],_0x5d20ae);_0x39a9f4(_0x2b3243[_0x467b('0x11')](0x1f4,_0x2dbd82['message']));});});};
\ No newline at end of file
+var _0xad7c=['find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','Pause,\x20%s,\x20%s','message','result','catch','ShowPause','Pause'];(function(_0x3e4c86,_0x5d4516){var _0x510cca=function(_0x41397c){while(--_0x41397c){_0x3e4c86['push'](_0x3e4c86['shift']());}};_0x510cca(++_0x5d4516);}(_0xad7c,0x8c));var _0xcad7=function(_0x2186b8,_0x59c1e6){_0x2186b8=_0x2186b8-0x0;var _0xaaf4b1=_0xad7c[_0x2186b8];return _0xaaf4b1;};'use strict';var _=require(_0xcad7('0x0'));var util=require(_0xcad7('0x1'));var moment=require(_0xcad7('0x2'));var BPromise=require(_0xcad7('0x3'));var rs=require(_0xcad7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcad7('0x5'))['db'];var utils=require(_0xcad7('0x6'));var logger=require(_0xcad7('0x7'))(_0xcad7('0x8'));var config=require(_0xcad7('0x9'));var jayson=require(_0xcad7('0xa'));var client=jayson[_0xcad7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf9b48e,_0x1f8b66,_0x483fa0){return new BPromise(function(_0x1575a3,_0x42cfa2){return client[_0xcad7('0xc')](_0xf9b48e,_0x483fa0)[_0xcad7('0xd')](function(_0x304136){logger[_0xcad7('0xe')]('Pause,\x20%s,\x20%s',_0x1f8b66,_0xcad7('0xf'));logger[_0xcad7('0x10')]('Pause,\x20%s,\x20%s,\x20%s',_0x1f8b66,_0xcad7('0xf'),JSON[_0xcad7('0x11')](_0x304136));if(_0x304136[_0xcad7('0x12')]){if(_0x304136[_0xcad7('0x12')]['code']===0x1f4){logger[_0xcad7('0x12')](_0xcad7('0x13'),_0x1f8b66,_0x304136[_0xcad7('0x12')][_0xcad7('0x14')]);return _0x42cfa2(_0x304136['error'][_0xcad7('0x14')]);}logger[_0xcad7('0x12')](_0xcad7('0x13'),_0x1f8b66,_0x304136[_0xcad7('0x12')][_0xcad7('0x14')]);return _0x1575a3(_0x304136[_0xcad7('0x12')][_0xcad7('0x14')]);}else{logger[_0xcad7('0xe')](_0xcad7('0x13'),_0x1f8b66,'request\x20sent');_0x1575a3(_0x304136[_0xcad7('0x15')][_0xcad7('0x14')]);}})[_0xcad7('0x16')](function(_0x28bd02){logger[_0xcad7('0x12')](_0xcad7('0x13'),_0x1f8b66,_0x28bd02);_0x42cfa2(_0x28bd02);});});}exports[_0xcad7('0x17')]=function(_0x3d9789){var _0x4701df=this;return new Promise(function(_0x3c2196,_0x426ce0){return db[_0xcad7('0x18')][_0xcad7('0x19')]({'raw':_0x3d9789[_0xcad7('0x1a')]?_0x3d9789[_0xcad7('0x1a')][_0xcad7('0x1b')]===undefined?!![]:![]:!![],'where':_0x3d9789[_0xcad7('0x1a')]?_0x3d9789[_0xcad7('0x1a')][_0xcad7('0x1c')]||null:null,'attributes':_0x3d9789['options']?_0x3d9789[_0xcad7('0x1a')][_0xcad7('0x1d')]||null:null,'include':_0x3d9789[_0xcad7('0x1a')]?_0x3d9789['options'][_0xcad7('0x1e')]?_[_0xcad7('0x1f')](_0x3d9789[_0xcad7('0x1a')]['include'],function(_0x40ade5){return{'model':db[_0x40ade5[_0xcad7('0x20')]],'as':_0x40ade5['as'],'attributes':_0x40ade5[_0xcad7('0x1d')],'include':_0x40ade5[_0xcad7('0x1e')]?_['map'](_0x40ade5[_0xcad7('0x1e')],function(_0x37f80f){return{'model':db[_0x37f80f[_0xcad7('0x20')]],'as':_0x37f80f['as'],'attributes':_0x37f80f[_0xcad7('0x1d')],'include':_0x37f80f[_0xcad7('0x1e')]?_[_0xcad7('0x1f')](_0x37f80f[_0xcad7('0x1e')],function(_0x215f49){return{'model':db[_0x215f49[_0xcad7('0x20')]],'as':_0x215f49['as'],'attributes':_0x215f49[_0xcad7('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x135b90){logger[_0xcad7('0xe')](_0xcad7('0x17'),_0x3d9789);logger['debug'](_0xcad7('0x17'),_0x3d9789,JSON['stringify'](_0x135b90));_0x3c2196(_0x135b90);})[_0xcad7('0x16')](function(_0x567e7a){logger[_0xcad7('0x12')](_0xcad7('0x17'),_0x567e7a['message'],_0x3d9789);_0x426ce0(_0x4701df[_0xcad7('0x12')](0x1f4,_0x567e7a[_0xcad7('0x14')]));});});};
\ No newline at end of file
index 9427f79..d3593c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b84=['originalname','basename','extname','upload','webhookPost','put','update','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/webhook','webhookGet','show','/:id/download','join','root','server/files/plugins'];(function(_0x1bc76e,_0x3c2452){var _0x549281=function(_0x1b2f6f){while(--_0x1b2f6f){_0x1bc76e['push'](_0x1bc76e['shift']());}};_0x549281(++_0x3c2452);}(_0x3b84,0xce));var _0x43b8=function(_0x246c26,_0x52adea){_0x246c26=_0x246c26-0x0;var _0x29b836=_0x3b84[_0x246c26];return _0x29b836;};'use strict';var multer=require(_0x43b8('0x0'));var util=require(_0x43b8('0x1'));var path=require(_0x43b8('0x2'));var timeout=require(_0x43b8('0x3'));var express=require(_0x43b8('0x4'));var router=express[_0x43b8('0x5')]();var auth=require(_0x43b8('0x6'));var interaction=require(_0x43b8('0x7'));var config=require(_0x43b8('0x8'));var controller=require('./plugin.controller');router[_0x43b8('0x9')]('/',auth[_0x43b8('0xa')](),controller['index']);router[_0x43b8('0x9')](_0x43b8('0xb'),controller[_0x43b8('0xc')]);router['get']('/:id',auth[_0x43b8('0xa')](),controller[_0x43b8('0xd')]);router[_0x43b8('0x9')](_0x43b8('0xe'),auth[_0x43b8('0xa')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f0983,_0x38bdaf,_0x42d2cd){_0x42d2cd(null,path[_0x43b8('0xf')](config[_0x43b8('0x10')],_0x43b8('0x11')));},'filename':function(_0x57eb77,_0xc1b1d5,_0x2b0c5b){_0xc1b1d5[_0x43b8('0x12')]=_0xc1b1d5[_0x43b8('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b0c5b(null,util['format']('%s-%s%s',path[_0x43b8('0x13')](_0xc1b1d5[_0x43b8('0x12')],path[_0x43b8('0x14')](_0xc1b1d5[_0x43b8('0x12')])),Date['now'](),path[_0x43b8('0x14')](_0xc1b1d5[_0x43b8('0x12')])));}})});router['post']('/',upload['single']('file'),controller[_0x43b8('0x15')]);router['post']('/webhook',controller[_0x43b8('0x16')]);router[_0x43b8('0x17')]('/:id',auth[_0x43b8('0xa')](),controller[_0x43b8('0x18')]);router['delete'](_0x43b8('0x19'),auth[_0x43b8('0xa')](),controller[_0x43b8('0x1a')]);module[_0x43b8('0x1b')]=router;
\ No newline at end of file
+var _0x28f2=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/webhook','show','/:id/download','download','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','/:id','delete','exports','multer','util','path'];(function(_0x454bd6,_0x5662ea){var _0x132a84=function(_0xf4b4e2){while(--_0xf4b4e2){_0x454bd6['push'](_0x454bd6['shift']());}};_0x132a84(++_0x5662ea);}(_0x28f2,0x81));var _0x228f=function(_0x23774e,_0x50bd36){_0x23774e=_0x23774e-0x0;var _0x21882f=_0x28f2[_0x23774e];return _0x21882f;};'use strict';var multer=require(_0x228f('0x0'));var util=require(_0x228f('0x1'));var path=require(_0x228f('0x2'));var timeout=require(_0x228f('0x3'));var express=require(_0x228f('0x4'));var router=express[_0x228f('0x5')]();var auth=require(_0x228f('0x6'));var interaction=require(_0x228f('0x7'));var config=require('../../config/environment');var controller=require(_0x228f('0x8'));router[_0x228f('0x9')]('/',auth[_0x228f('0xa')](),controller[_0x228f('0xb')]);router[_0x228f('0x9')](_0x228f('0xc'),controller['webhookGet']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x228f('0xd')]);router[_0x228f('0x9')](_0x228f('0xe'),auth[_0x228f('0xa')](),controller[_0x228f('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52f37a,_0x5518c9,_0x2b34b1){_0x2b34b1(null,path[_0x228f('0x10')](config['root'],_0x228f('0x11')));},'filename':function(_0x19c6d3,_0x238507,_0x112d37){_0x238507[_0x228f('0x12')]=_0x238507[_0x228f('0x12')][_0x228f('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x112d37(null,util['format'](_0x228f('0x14'),path[_0x228f('0x15')](_0x238507['originalname'],path[_0x228f('0x16')](_0x238507['originalname'])),Date[_0x228f('0x17')](),path[_0x228f('0x16')](_0x238507[_0x228f('0x12')])));}})});router[_0x228f('0x18')]('/',upload[_0x228f('0x19')](_0x228f('0x1a')),controller[_0x228f('0x1b')]);router[_0x228f('0x18')](_0x228f('0xc'),controller[_0x228f('0x1c')]);router[_0x228f('0x1d')](_0x228f('0x1e'),auth[_0x228f('0xa')](),controller['update']);router[_0x228f('0x1f')](_0x228f('0x1e'),auth[_0x228f('0xa')](),controller[_0x228f('0x1f')]);module[_0x228f('0x20')]=router;
\ No newline at end of file
index ae5295f..a0b2871 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d0e=['always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','ENUM','html','script','TEXT','STRING','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly'];(function(_0x5b39c0,_0x493480){var _0x5b2c65=function(_0x2703d6){while(--_0x2703d6){_0x5b39c0['push'](_0x5b39c0['shift']());}};_0x5b2c65(++_0x493480);}(_0x3d0e,0x14d));var _0xe3d0=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x3d0e[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe3d0('0x0')](_0xe3d0('0x1'),_0xe3d0('0x2'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xe3d0('0x3')]},'path':{'type':Sequelize[_0xe3d0('0x4')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xe3d0('0x5')],'defaultValue':0x0,'comment':_0xe3d0('0x6')},'sidebar':{'type':Sequelize[_0xe3d0('0x0')]('adminOnly',_0xe3d0('0x7'),_0xe3d0('0x8'),_0xe3d0('0x9')),'defaultValue':'always','comment':_0xe3d0('0xa')},'icon':{'type':Sequelize[_0xe3d0('0x4')]},'adminUrl':{'type':Sequelize[_0xe3d0('0x4')]},'agentUrl':{'type':Sequelize[_0xe3d0('0x4')]},'scriptName':{'type':Sequelize[_0xe3d0('0x4')]},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x26ed=['agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','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.'];(function(_0x51f7a3,_0x3f9940){var _0x174039=function(_0x4bf86e){while(--_0x4bf86e){_0x51f7a3['push'](_0x51f7a3['shift']());}};_0x174039(++_0x3f9940);}(_0x26ed,0x1f0));var _0xd26e=function(_0x27842c,_0x324fcb){_0x27842c=_0x27842c-0x0;var _0x493de8=_0x26ed[_0x27842c];return _0x493de8;};'use strict';var Sequelize=require(_0xd26e('0x0'));module['exports']={'name':{'type':Sequelize[_0xd26e('0x1')]},'type':{'type':Sequelize[_0xd26e('0x2')]('html',_0xd26e('0x3'))},'description':{'type':Sequelize[_0xd26e('0x4')]},'version':{'type':Sequelize[_0xd26e('0x4')]},'path':{'type':Sequelize[_0xd26e('0x1')],'comment':_0xd26e('0x5')},'active':{'type':Sequelize[_0xd26e('0x6')],'defaultValue':0x0,'comment':_0xd26e('0x7')},'sidebar':{'type':Sequelize[_0xd26e('0x2')]('adminOnly',_0xd26e('0x8'),_0xd26e('0x9'),_0xd26e('0xa')),'defaultValue':_0xd26e('0x9'),'comment':_0xd26e('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xd26e('0x1')]},'agentUrl':{'type':Sequelize[_0xd26e('0x1')]},'scriptName':{'type':Sequelize[_0xd26e('0x1')]},'scriptPath':{'type':Sequelize[_0xd26e('0x1')]}};
\ No newline at end of file
index 8f259be..f9d3013 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dd7=['querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','count','offset','Content-Range','apply','update','then','destroy','get','Plugins','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','limit','order','sort','pick','merge','where','VIRTUAL','filter','options','Plugin','includeAll','include','rows','catch','show','find','download','params','join','root','server/files/plugins','%s.zip','basename','zip','warning','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','attachments/**/*','close','format','Sequelize','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','length','Invalid\x20plugin\x20structure','isFile','isDirectory','manifest.json','undefined','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','sidebar','always','icon','icon-apps','html','admin','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2c0ea7,_0x33dcbd){var _0x155f88=function(_0x3c6d9d){while(--_0x3c6d9d){_0x2c0ea7['push'](_0x2c0ea7['shift']());}};_0x155f88(++_0x33dcbd);}(_0x5dd7,0x1e6));var _0x75dd=function(_0x212cd5,_0x14a9d1){_0x212cd5=_0x212cd5-0x0;var _0x1ad0b8=_0x5dd7[_0x212cd5];return _0x1ad0b8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x75dd('0x0'));var rimraf=require(_0x75dd('0x1'));var zipdir=require(_0x75dd('0x2'));var jsonpatch=require(_0x75dd('0x3'));var rp=require('request-promise');var moment=require(_0x75dd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x75dd('0x5'));var util=require(_0x75dd('0x6'));var path=require(_0x75dd('0x7'));var sox=require(_0x75dd('0x8'));var csv=require(_0x75dd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x75dd('0xa'));var squel=require(_0x75dd('0xb'));var crypto=require(_0x75dd('0xc'));var jsforce=require(_0x75dd('0xd'));var deskjs=require(_0x75dd('0xe'));var toCsv=require(_0x75dd('0x9'));var querystring=require(_0x75dd('0xf'));var Papa=require(_0x75dd('0x10'));var extract=require(_0x75dd('0x11'));var rimraf=require(_0x75dd('0x1'));var archiver=require(_0x75dd('0x12'));var Redis=require(_0x75dd('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x75dd('0x14'));var as=require(_0x75dd('0x15'));var hardwareService=require(_0x75dd('0x16'));var logger=require(_0x75dd('0x17'))('api');var utils=require(_0x75dd('0x18'));var config=require(_0x75dd('0x19'));var db=require(_0x75dd('0x1a'))['db'];config[_0x75dd('0x1b')]=_[_0x75dd('0x1c')](config[_0x75dd('0x1b')],{'host':_0x75dd('0x1d'),'port':0x18eb});var socket=require(_0x75dd('0x1e'))(new Redis(config['redis']));require(_0x75dd('0x1f'))[_0x75dd('0x20')](socket);function respondWithStatusCode(_0x24ea6c,_0x2446b1){_0x2446b1=_0x2446b1||0xcc;return function(_0x4e318b){if(_0x4e318b){return _0x24ea6c[_0x75dd('0x21')](_0x2446b1);}return _0x24ea6c[_0x75dd('0x22')](_0x2446b1)[_0x75dd('0x23')]();};}function respondWithResult(_0x378395,_0x508624){_0x508624=_0x508624||0xc8;return function(_0x11dad1){if(_0x11dad1){return _0x378395['status'](_0x508624)[_0x75dd('0x24')](_0x11dad1);}};}function respondWithFilteredResult(_0x198f4b,_0x5384b1){return function(_0x577d8c){if(_0x577d8c){var _0x8f4117=_0x577d8c[_0x75dd('0x25')],_0x51ea7e=_0x5384b1[_0x75dd('0x26')],_0x4b053b=_0x5384b1['offset']+_0x5384b1['limit'],_0x8e8ebf;if(_0x4b053b>=_0x8f4117){_0x4b053b=_0x8f4117;_0x8e8ebf=0xc8;}else{_0x8e8ebf=0xce;}_0x198f4b[_0x75dd('0x22')](_0x8e8ebf);return _0x198f4b['set'](_0x75dd('0x27'),_0x51ea7e+'-'+_0x4b053b+'/'+_0x8f4117)[_0x75dd('0x24')](_0x577d8c);}return null;};}function patchUpdates(_0x569fee){return function(_0x338001){try{jsonpatch[_0x75dd('0x28')](_0x338001,_0x569fee,!![]);}catch(_0x306efe){return BPromise['reject'](_0x306efe);}return _0x338001['save']();};}function saveUpdates(_0x21ead5,_0x3bef36){return function(_0x23012f){if(_0x23012f){return _0x23012f[_0x75dd('0x29')](_0x21ead5)[_0x75dd('0x2a')](function(_0x135f60){return _0x135f60;});}return null;};}function removeEntity(_0x338fad,_0x26cc8a){return function(_0x41e8b6){if(_0x41e8b6){return _0x41e8b6[_0x75dd('0x2b')]()[_0x75dd('0x2a')](function(){var _0x58e7c0=_0x41e8b6[_0x75dd('0x2c')]({'plain':!![]});var _0x1fd3a1=_0x75dd('0x2d');return db[_0x75dd('0x2e')][_0x75dd('0x2b')]({'where':{'type':_0x1fd3a1,'resourceId':_0x58e7c0['id']}})['then'](function(){return _0x41e8b6;});})[_0x75dd('0x2a')](function(){_0x338fad[_0x75dd('0x22')](0xcc)[_0x75dd('0x23')]();});}};}function handleEntityNotFound(_0x1ebcb9,_0x2f368c){return function(_0x352fb1){if(!_0x352fb1){_0x1ebcb9[_0x75dd('0x21')](0x194);}return _0x352fb1;};}function handleError(_0xed16f,_0x1c834e){_0x1c834e=_0x1c834e||0x1f4;return function(_0x585ac8){logger[_0x75dd('0x2f')](_0x585ac8['stack']);if(_0x585ac8[_0x75dd('0x30')]){delete _0x585ac8['name'];}_0xed16f['status'](_0x1c834e)[_0x75dd('0x31')](_0x585ac8);};}exports[_0x75dd('0x32')]=function(_0x1fac8,_0x439b4d){var _0x57945c={},_0xe30022={},_0x388265={'count':0x0,'rows':[]};var _0x700982=_[_0x75dd('0x33')](db['Plugin'][_0x75dd('0x34')],function(_0x3c7c97){return{'name':_0x3c7c97[_0x75dd('0x35')],'type':_0x3c7c97[_0x75dd('0x36')][_0x75dd('0x37')]};});_0xe30022[_0x75dd('0x38')]=_[_0x75dd('0x33')](_0x700982,'name');_0xe30022[_0x75dd('0x39')]=_[_0x75dd('0x3a')](_0x1fac8[_0x75dd('0x39')]);_0xe30022[_0x75dd('0x3b')]=_['intersection'](_0xe30022[_0x75dd('0x38')],_0xe30022[_0x75dd('0x39')]);_0x57945c[_0x75dd('0x3c')]=_[_0x75dd('0x3d')](_0xe30022[_0x75dd('0x38')],qs[_0x75dd('0x3e')](_0x1fac8['query'][_0x75dd('0x3e')]));_0x57945c['attributes']=_0x57945c[_0x75dd('0x3c')]['length']?_0x57945c[_0x75dd('0x3c')]:_0xe30022['model'];if(!_0x1fac8[_0x75dd('0x39')]['hasOwnProperty'](_0x75dd('0x3f'))){_0x57945c[_0x75dd('0x40')]=qs['limit'](_0x1fac8[_0x75dd('0x39')][_0x75dd('0x40')]);_0x57945c[_0x75dd('0x26')]=qs[_0x75dd('0x26')](_0x1fac8[_0x75dd('0x39')][_0x75dd('0x26')]);}_0x57945c[_0x75dd('0x41')]=qs[_0x75dd('0x42')](_0x1fac8[_0x75dd('0x39')][_0x75dd('0x42')]);_0x57945c['where']=qs['filters'](_[_0x75dd('0x43')](_0x1fac8[_0x75dd('0x39')],_0xe30022[_0x75dd('0x3b')]),_0x700982);if(_0x1fac8[_0x75dd('0x39')]['filter']){_0x57945c['where']=_[_0x75dd('0x44')](_0x57945c[_0x75dd('0x45')],{'$or':_[_0x75dd('0x33')](_0x700982,function(_0x3da856){if(_0x3da856[_0x75dd('0x36')]!==_0x75dd('0x46')){var _0x41e5bf={};_0x41e5bf[_0x3da856[_0x75dd('0x30')]]={'$like':'%'+_0x1fac8[_0x75dd('0x39')][_0x75dd('0x47')]+'%'};return _0x41e5bf;}})});}_0x57945c=_['merge']({},_0x57945c,_0x1fac8[_0x75dd('0x48')]);var _0x748094={'where':_0x57945c[_0x75dd('0x45')]};return db[_0x75dd('0x49')]['count'](_0x748094)['then'](function(_0x1542b7){_0x388265['count']=_0x1542b7;if(_0x1fac8[_0x75dd('0x39')][_0x75dd('0x4a')]){_0x57945c[_0x75dd('0x4b')]=[{'all':!![]}];}return db[_0x75dd('0x49')]['findAll'](_0x57945c);})[_0x75dd('0x2a')](function(_0x4b3f83){_0x388265[_0x75dd('0x4c')]=_0x4b3f83;return _0x388265;})['then'](respondWithFilteredResult(_0x439b4d,_0x57945c))[_0x75dd('0x4d')](handleError(_0x439b4d,null));};exports[_0x75dd('0x4e')]=function(_0x368168,_0x192aa8){var _0x405d1a={'raw':!![],'where':{'id':_0x368168['params']['id']}},_0x76e843={};_0x76e843[_0x75dd('0x38')]=_['keys'](db[_0x75dd('0x49')][_0x75dd('0x34')]);_0x76e843[_0x75dd('0x39')]=_['keys'](_0x368168['query']);_0x76e843[_0x75dd('0x3b')]=_[_0x75dd('0x3d')](_0x76e843[_0x75dd('0x38')],_0x76e843['query']);_0x405d1a[_0x75dd('0x3c')]=_['intersection'](_0x76e843['model'],qs[_0x75dd('0x3e')](_0x368168['query'][_0x75dd('0x3e')]));_0x405d1a[_0x75dd('0x3c')]=_0x405d1a[_0x75dd('0x3c')]['length']?_0x405d1a[_0x75dd('0x3c')]:_0x76e843[_0x75dd('0x38')];if(_0x368168[_0x75dd('0x39')][_0x75dd('0x4a')]){_0x405d1a[_0x75dd('0x4b')]=[{'all':!![]}];}_0x405d1a=_[_0x75dd('0x44')]({},_0x405d1a,_0x368168[_0x75dd('0x48')]);return db['Plugin'][_0x75dd('0x4f')](_0x405d1a)[_0x75dd('0x2a')](handleEntityNotFound(_0x192aa8,null))[_0x75dd('0x2a')](respondWithResult(_0x192aa8,null))['catch'](handleError(_0x192aa8,null));};exports[_0x75dd('0x50')]=function(_0x2559d3,_0x3cda8c,_0x5d34dc){return db[_0x75dd('0x49')][_0x75dd('0x4f')]({'where':{'id':_0x2559d3[_0x75dd('0x51')]['id']},'attributes':[_0x75dd('0x30'),_0x75dd('0x7')],'raw':!![]})[_0x75dd('0x2a')](handleEntityNotFound(_0x3cda8c,null))[_0x75dd('0x2a')](function(_0x395278){if(_0x395278){var _0x3ff30f=path[_0x75dd('0x52')](config[_0x75dd('0x53')],_0x75dd('0x54'),util['format'](_0x75dd('0x55'),path[_0x75dd('0x56')](_0x395278[_0x75dd('0x7')])));var _0x177929=fs['createWriteStream'](_0x3ff30f);var _0x15e848=archiver(_0x75dd('0x57'),{'zlib':{'level':0x9}});_0x15e848['on'](_0x75dd('0x58'),function(_0x4e52b0){if(_0x4e52b0[_0x75dd('0x59')]===_0x75dd('0x5a')){logger['error'](_0x4e52b0);}else{throw new db['Sequelize'][(_0x75dd('0x5b'))](_0x75dd('0x5c'));}});_0x15e848['on'](_0x75dd('0x2f'),function(_0x354124){throw new db['Sequelize'][(_0x75dd('0x5b'))](_0x75dd('0x5c'));});_0x15e848['pipe'](_0x177929);_0x15e848[_0x75dd('0x5d')](_0x75dd('0x5e'),{'cwd':path['join'](config[_0x75dd('0x53')],'server/files/plugins',path['dirname'](_0x395278['path'])),'ignore':[path[_0x75dd('0x52')](path[_0x75dd('0x56')](_0x395278[_0x75dd('0x7')]),'node_modules/**/*'),path[_0x75dd('0x52')](path[_0x75dd('0x56')](_0x395278[_0x75dd('0x7')]),_0x75dd('0x5f'))],'nodir':!![]})['finalize']();_0x177929['on'](_0x75dd('0x60'),function(){if(!fs['existsSync'](_0x3ff30f)){throw new db['Sequelize'][(_0x75dd('0x5b'))]('Plugin\x20not\x20found');}return _0x3cda8c[_0x75dd('0x50')](_0x3ff30f,util[_0x75dd('0x61')](_0x75dd('0x55'),path['basename'](_0x395278[_0x75dd('0x7')])),function(_0x127b89){if(_0x127b89){throw new db[(_0x75dd('0x62'))]['Error'](_0x75dd('0x63'));}fs[_0x75dd('0x64')](_0x3ff30f);logger[_0x75dd('0x65')](_0x75dd('0x66'));logger[_0x75dd('0x65')](_0x75dd('0x67'));});});}return null;})[_0x75dd('0x4d')](handleError(_0x3cda8c,null));};exports[_0x75dd('0x68')]=function(_0x5d5794,_0x4ede03,_0x530856){var _0x3faefa=path[_0x75dd('0x56')](_0x5d5794[_0x75dd('0x69')][_0x75dd('0x6a')],path[_0x75dd('0x6b')](_0x5d5794[_0x75dd('0x69')][_0x75dd('0x6a')]));var _0x3173cb=path[_0x75dd('0x52')](config[_0x75dd('0x53')],_0x75dd('0x54'),_0x5d5794[_0x75dd('0x69')][_0x75dd('0x6a')]);var _0x19724d=path[_0x75dd('0x52')](config[_0x75dd('0x53')],_0x75dd('0x54'),_0x3faefa);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x3173cb);logger[_0x75dd('0x65')](_0x75dd('0x6c'),_0x19724d);try{fs[_0x75dd('0x6d')](_0x3173cb,parseInt(_0x75dd('0x6e'),0x8));extract(_0x3173cb,{'dir':_0x19724d},function(_0x38417b){if(_0x38417b){logger[_0x75dd('0x2f')](_0x38417b);handleError(_0x38417b,!![]);};var _0x22f166=fs[_0x75dd('0x6f')](_0x19724d);if(_0x22f166[_0x75dd('0x70')]>0x1){removeReferences(_0x3173cb,_0x19724d);logger[_0x75dd('0x2f')](_0x75dd('0x71'));return _0x530856(new Error(_0x75dd('0x71')));}var _0x25b84a=fs['lstatSync'](path[_0x75dd('0x52')](_0x19724d,_0x22f166[0x0]));if(_0x25b84a[_0x75dd('0x72')]()){removeReferences(_0x3173cb,_0x19724d);logger[_0x75dd('0x2f')]('Invalid\x20plugin\x20structure');return _0x530856(new Error('Invalid\x20plugin\x20structure'));}if(_0x25b84a[_0x75dd('0x73')]()){var _0xb0e4f3=fs['readdirSync'](path[_0x75dd('0x52')](_0x19724d,_0x22f166[0x0]));if(_0xb0e4f3[_0x75dd('0x70')]===0x0){removeReferences(_0x3173cb,_0x19724d);logger['error'](_0x75dd('0x71'));return _0x530856(new Error(_0x75dd('0x71')));}var _0x127f43=_0xb0e4f3['some'](function(_0x5d601e){return _0x5d601e===_0x75dd('0x74');});if(!_0x127f43){return _0x530856(new Error('Plugin\x20manifest\x20missing'));}var _0x296656=fs['readFileSync'](path['join'](_0x19724d,_0x22f166[0x0],_0x75dd('0x74')));var _0x1d3249=JSON['parse'](_0x296656);if(_0x75dd('0x75')==typeof _0x1d3249[_0x75dd('0x30')]){return _0x530856(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x75dd('0x75')==typeof _0x1d3249[_0x75dd('0x36')]){return _0x530856(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x75dd('0x75')==typeof _0x1d3249[_0x75dd('0x76')]){return _0x530856(new Error(_0x75dd('0x77')));}if(_0x75dd('0x75')==typeof _0x1d3249[_0x75dd('0x78')]){return _0x530856(new Error(_0x75dd('0x79')));}if(_0x1d3249['type']==='html'){if(_0x75dd('0x75')==typeof _0x1d3249[_0x75dd('0x78')][_0x75dd('0x7a')]){return _0x530856(new Error(_0x75dd('0x7b')));}if(_0x75dd('0x75')==typeof _0x1d3249[_0x75dd('0x78')][_0x75dd('0x7a')]['admin']&&_0x75dd('0x75')==typeof _0x1d3249[_0x75dd('0x78')][_0x75dd('0x7a')][_0x75dd('0x7c')]){return _0x530856(new Error(_0x75dd('0x7d')));}}else if(_0x1d3249['type']==='script'){if('undefined'==typeof _0x1d3249[_0x75dd('0x78')][_0x75dd('0x7e')]){return _0x530856(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x75dd('0x75')==typeof _0x1d3249[_0x75dd('0x78')][_0x75dd('0x7f')]){return _0x530856(new Error(_0x75dd('0x80')));}}else{return _0x530856(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x3c226f=_0x1d3249[_0x75dd('0x30')];var _0x4accb3=_0x1d3249['description'];var _0x4fe6d0=_0x1d3249['type'];var _0x249fd1=_0x1d3249[_0x75dd('0x81')]?_0x1d3249[_0x75dd('0x81')]:_0x75dd('0x82');var _0x17d5b1=_0x1d3249[_0x75dd('0x83')]?_0x1d3249[_0x75dd('0x83')]:_0x75dd('0x84');var _0x5de2a7='';var _0x854799='';var _0x5af4b9='';var _0x47929c='';var _0x2d1bee=_0x1d3249[_0x75dd('0x76')];if(_0x4fe6d0===_0x75dd('0x85')){if(_0x75dd('0x75')!=typeof _0x1d3249[_0x75dd('0x78')][_0x75dd('0x7a')][_0x75dd('0x86')]){var _0x47906d=_0x1d3249[_0x75dd('0x78')][_0x75dd('0x7a')][_0x75dd('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x75dd('0x87')](_0x47906d)){_0x5de2a7=path[_0x75dd('0x52')]('plugins',_0x3faefa,_0x22f166[0x0],_0x47906d);}else{_0x5de2a7=_0x47906d;}}else{logger[_0x75dd('0x65')](_0x75dd('0x88'));}if('undefined'!=typeof _0x1d3249[_0x75dd('0x78')]['views']['agent']){var _0xb5c93e=_0x1d3249[_0x75dd('0x78')][_0x75dd('0x7a')][_0x75dd('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x75dd('0x87')](_0xb5c93e)){_0x854799=path[_0x75dd('0x52')](_0x75dd('0x89'),_0x3faefa,_0x22f166[0x0],_0xb5c93e);}else{_0x854799=_0xb5c93e;}}else{logger[_0x75dd('0x65')](_0x75dd('0x8a'));}}else if(_0x4fe6d0===_0x75dd('0x8b')){_0x5af4b9=_0x1d3249[_0x75dd('0x78')][_0x75dd('0x7e')];_0x47929c=_0x1d3249['parameters'][_0x75dd('0x7f')];if(_0x75dd('0x75')!=typeof _0x1d3249[_0x75dd('0x78')][_0x75dd('0x7a')]){if(_0x75dd('0x75')!=typeof _0x1d3249[_0x75dd('0x78')][_0x75dd('0x7a')]['admin']){var _0x47906d=_0x1d3249['parameters'][_0x75dd('0x7a')][_0x75dd('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x75dd('0x87')](_0x47906d)){_0x5de2a7=path[_0x75dd('0x52')](_0x75dd('0x89'),_0x3faefa,_0x22f166[0x0],_0x47906d);}else{_0x5de2a7=_0x47906d;}}if(_0x75dd('0x75')!=typeof _0x1d3249[_0x75dd('0x78')][_0x75dd('0x7a')][_0x75dd('0x7c')]){var _0xb5c93e=_0x1d3249[_0x75dd('0x78')][_0x75dd('0x7a')][_0x75dd('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x75dd('0x87')](_0xb5c93e)){_0x854799=path[_0x75dd('0x52')](_0x75dd('0x89'),_0x3faefa,_0x22f166[0x0],_0xb5c93e);}else{_0x854799=_0xb5c93e;}}}}var _0x212c93={'name':_0x3c226f,'description':_0x4accb3,'path':path[_0x75dd('0x52')](_0x3faefa,_0x22f166[0x0]),'type':_0x4fe6d0,'sidebar':_0x249fd1,'icon':_0x17d5b1,'adminUrl':_0x5de2a7,'agentUrl':_0x854799,'scriptName':_0x5af4b9,'scriptPath':_0x47929c,'version':_0x2d1bee};removeReferences(_0x3173cb,null);return db[_0x75dd('0x49')][_0x75dd('0x8c')](_0x212c93)[_0x75dd('0x2a')](function(_0x188024){var _0x2d0988={'role':_0x5d5794[_0x75dd('0x8d')][_0x75dd('0x8e')],'userProfileId':_0x5d5794[_0x75dd('0x8d')][_0x75dd('0x8f')]};if(!_0x2d0988)throw new Error(_0x75dd('0x90'));if(_0x2d0988[_0x75dd('0x8e')]==='user'){var _0x2e8351=_0x188024['get']({'plain':!![]});return db[_0x75dd('0x91')][_0x75dd('0x4f')]({'where':{'name':'Plugins','userProfileId':_0x2d0988[_0x75dd('0x8f')]},'raw':!![]})['then'](function(_0x3193da){if(_0x3193da&&_0x3193da[_0x75dd('0x92')]===0x0){return db[_0x75dd('0x2e')][_0x75dd('0x8c')]({'name':_0x2e8351[_0x75dd('0x30')],'resourceId':_0x2e8351['id'],'type':_0x3193da['name'],'sectionId':_0x3193da['id']},{})[_0x75dd('0x2a')](function(){return _0x188024;});}else{return _0x188024;}})['catch'](function(_0x344ab1){logger[_0x75dd('0x2f')](_0x75dd('0x93'),_0x344ab1);throw _0x344ab1;});}return _0x188024;})[_0x75dd('0x2a')](respondWithResult(_0x4ede03,null))['catch'](handleError(_0x4ede03,null));}});}catch(_0xb3151){_0x4ede03['status'](0x1f4)[_0x75dd('0x31')](_0xb3151);}};function removeReferences(_0x4d72b0,_0x151de9){try{if(_0x4d72b0){fs['unlinkSync'](_0x4d72b0);logger[_0x75dd('0x65')]('Zip\x20archive\x20removed');}if(_0x151de9){rimraf(_0x151de9,function(){});logger[_0x75dd('0x65')](_0x75dd('0x94'));}}catch(_0x1817a6){logger['error'](_0x1817a6);}}exports['update']=function(_0x16f310,_0x1da91c,_0x4e1768){return db[_0x75dd('0x49')][_0x75dd('0x4f')]({'where':{'id':_0x16f310[_0x75dd('0x51')]['id']}})[_0x75dd('0x2a')](handleEntityNotFound(_0x1da91c,null))[_0x75dd('0x2a')](saveUpdates(_0x16f310[_0x75dd('0x8d')],null))[_0x75dd('0x2a')](respondWithResult(_0x1da91c,null))[_0x75dd('0x4d')](handleError(_0x1da91c,null));};exports[_0x75dd('0x95')]=function(_0x2ebbbf,_0x47856e,_0x15dc8f){return db[_0x75dd('0x49')][_0x75dd('0x4f')]({'where':{'id':_0x2ebbbf[_0x75dd('0x51')]['id']}})[_0x75dd('0x2a')](function(_0x5077a8){if(_0x5077a8){return _0x5077a8[_0x75dd('0x2b')]();}})[_0x75dd('0x2a')](function(_0xf147c8){rimraf(path[_0x75dd('0x52')](config[_0x75dd('0x53')],_0x75dd('0x54'),path['dirname'](_0xf147c8[_0x75dd('0x7')])),function(){});return _0xf147c8;})[_0x75dd('0x2a')](handleEntityNotFound(_0x47856e,null))[_0x75dd('0x2a')](respondWithStatusCode(_0x47856e,null))[_0x75dd('0x4d')](handleError(_0x47856e,null));};exports[_0x75dd('0x96')]=function(_0x175bf9,_0x2185b6,_0x2b9e02){return BPromise[_0x75dd('0x97')]()[_0x75dd('0x2a')](function(){if(!_0x175bf9[_0x75dd('0x39')][_0x75dd('0x7')]){throw new Error(_0x75dd('0x98'));}if(!_0x175bf9[_0x75dd('0x39')][_0x75dd('0x99')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5f4e20=_0x175bf9[_0x75dd('0x39')][_0x75dd('0x9a')]?_0x175bf9[_0x75dd('0x39')][_0x75dd('0x9a')]+':'+_0x175bf9[_0x75dd('0x39')][_0x75dd('0x99')]:_0x75dd('0x9b')+_0x175bf9[_0x75dd('0x39')][_0x75dd('0x99')];var _0x5f2538=_0x175bf9[_0x75dd('0x39')][_0x75dd('0x24')]?_0x175bf9['query']['json']:!![];var _0x276aaf=_0x175bf9[_0x75dd('0x39')][_0x75dd('0x9c')]?_0x175bf9[_0x75dd('0x39')][_0x75dd('0x9c')]:null;var _0x3cd75a={'method':_0x175bf9[_0x75dd('0x9d')],'uri':util[_0x75dd('0x61')](_0x75dd('0x9e'),_0x5f4e20,_0x175bf9[_0x75dd('0x39')][_0x75dd('0x7')]),'json':_0x5f2538,'resolveWithFullResponse':!![],'encoding':_0x276aaf,'qs':_0x175bf9[_0x75dd('0x39')]};if(_0x175bf9[_0x75dd('0x9f')]){_0x3cd75a['headers']=_0x175bf9['headers'];if(_0x3cd75a[_0x75dd('0x9f')][_0x75dd('0xa0')]){delete _0x3cd75a[_0x75dd('0x9f')]['content-length'];}}if(_0x3cd75a[_0x75dd('0x9f')][_0x75dd('0xa1')]){delete _0x3cd75a['headers']['content-type'];}return rp(_0x3cd75a);})[_0x75dd('0x2a')](function(_0x1221e2){if(_0x1221e2){_0x2185b6[_0x75dd('0xa2')](_0x1221e2[_0x75dd('0x9f')]);logger[_0x75dd('0x65')](_0x1221e2['body']);if(_[_0x75dd('0xa3')](_0x175bf9[_0x75dd('0x39')][_0x75dd('0x7')],_0x75dd('0x50'))&&_0x1221e2[_0x75dd('0xa4')]==0x1f4){return _0x2185b6[_0x75dd('0x21')](_0x1221e2[_0x75dd('0xa4')]);}else{return _0x2185b6[_0x75dd('0x22')](_0x1221e2['statusCode'])[_0x75dd('0x31')](_0x1221e2[_0x75dd('0x8d')]);}}else{return _0x2185b6['sendStatus'](0xc8);}})[_0x75dd('0x4d')](handleError(_0x2185b6,null));};exports[_0x75dd('0xa5')]=function(_0xe30043,_0xb5c813,_0x492e50){return BPromise['resolve']()[_0x75dd('0x2a')](function(){if(!_0xe30043[_0x75dd('0x39')][_0x75dd('0x7')]){throw new Error(_0x75dd('0x98'));}if(!_0xe30043[_0x75dd('0x39')][_0x75dd('0x99')]){throw new Error(_0x75dd('0xa6'));}var _0x47e0c2=_0xe30043['query'][_0x75dd('0x9a')]?_0xe30043[_0x75dd('0x39')][_0x75dd('0x9a')]+':'+_0xe30043[_0x75dd('0x39')]['port']:_0x75dd('0x9b')+_0xe30043[_0x75dd('0x39')][_0x75dd('0x99')];var _0x19fd32=_0xe30043['query'][_0x75dd('0x24')]?_0xe30043[_0x75dd('0x39')][_0x75dd('0x24')]:!![];var _0x20ed66=_0xe30043[_0x75dd('0x39')][_0x75dd('0x9c')]?_0xe30043[_0x75dd('0x39')][_0x75dd('0x9c')]:null;var _0xec9c0a={'method':_0xe30043[_0x75dd('0x9d')],'uri':util[_0x75dd('0x61')]('%s%s',_0x47e0c2,_0xe30043['query'][_0x75dd('0x7')]),'json':_0x19fd32,'resolveWithFullResponse':!![],'encoding':_0x20ed66,'body':_0xe30043[_0x75dd('0x8d')]};if(_0xe30043[_0x75dd('0x9f')]){_0xec9c0a['headers']=_0xe30043['headers'];if(_0xec9c0a[_0x75dd('0x9f')]['content-length']){delete _0xec9c0a[_0x75dd('0x9f')]['content-length'];}}if(_0xec9c0a[_0x75dd('0x9f')][_0x75dd('0xa1')]){delete _0xec9c0a['headers'][_0x75dd('0xa1')];}return rp(_0xec9c0a);})[_0x75dd('0x2a')](function(_0x38e022){if(_0x38e022){_0xb5c813[_0x75dd('0xa2')](_0x38e022['headers']);logger[_0x75dd('0x65')](_0x38e022[_0x75dd('0x8d')]);return _0xb5c813['status'](_0x38e022['statusCode'])[_0x75dd('0x31')](_0x38e022[_0x75dd('0x8d')]);}else{return _0xb5c813[_0x75dd('0x21')](0xc8);}})[_0x75dd('0x4d')](handleError(_0xb5c813,null));};
\ No newline at end of file
+var _0x6444=['set','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','sendStatus','error','stack','send','map','Plugin','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','download','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','root','server/files/plugins','dirname','node_modules/**/*','join','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','lstatSync','Invalid\x20plugin\x20structure','isDirectory','manifest.json','Plugin\x20manifest\x20missing','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','script','scriptPath','create','body','role','userProfileId','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-type','endsWith','statusCode','content-length','html-pdf','eml-format','rimraf','zip-dir','moment','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','register','status','end','json','count','offset','limit'];(function(_0x3bfc1a,_0x2aee03){var _0x29a176=function(_0x1904b3){while(--_0x1904b3){_0x3bfc1a['push'](_0x3bfc1a['shift']());}};_0x29a176(++_0x2aee03);}(_0x6444,0x87));var _0x4644=function(_0x23ff2a,_0x1d692c){_0x23ff2a=_0x23ff2a-0x0;var _0x4c0753=_0x6444[_0x23ff2a];return _0x4c0753;};'use strict';var pdf=require(_0x4644('0x0'));var emlformat=require(_0x4644('0x1'));var rimraf=require(_0x4644('0x2'));var zipdir=require(_0x4644('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4644('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4644('0x5'));var util=require(_0x4644('0x6'));var path=require(_0x4644('0x7'));var sox=require('sox');var csv=require(_0x4644('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4644('0x9'));var crypto=require(_0x4644('0xa'));var jsforce=require(_0x4644('0xb'));var deskjs=require(_0x4644('0xc'));var toCsv=require(_0x4644('0x8'));var querystring=require(_0x4644('0xd'));var Papa=require(_0x4644('0xe'));var extract=require(_0x4644('0xf'));var rimraf=require(_0x4644('0x2'));var archiver=require('archiver');var Redis=require(_0x4644('0x10'));var authService=require(_0x4644('0x11'));var qs=require(_0x4644('0x12'));var as=require(_0x4644('0x13'));var hardwareService=require(_0x4644('0x14'));var logger=require(_0x4644('0x15'))(_0x4644('0x16'));var utils=require(_0x4644('0x17'));var config=require(_0x4644('0x18'));var db=require(_0x4644('0x19'))['db'];config[_0x4644('0x1a')]=_[_0x4644('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4644('0x1c'))(new Redis(config[_0x4644('0x1a')]));require(_0x4644('0x1d'))[_0x4644('0x1e')](socket);function respondWithStatusCode(_0x23e219,_0x1331f5){_0x1331f5=_0x1331f5||0xcc;return function(_0x29e131){if(_0x29e131){return _0x23e219['sendStatus'](_0x1331f5);}return _0x23e219[_0x4644('0x1f')](_0x1331f5)[_0x4644('0x20')]();};}function respondWithResult(_0x49a102,_0x2bb5f2){_0x2bb5f2=_0x2bb5f2||0xc8;return function(_0x1c4acb){if(_0x1c4acb){return _0x49a102['status'](_0x2bb5f2)[_0x4644('0x21')](_0x1c4acb);}};}function respondWithFilteredResult(_0x3a5b4f,_0x29c5c7){return function(_0x31a85d){if(_0x31a85d){var _0x2025d7=_0x31a85d[_0x4644('0x22')],_0x4f6f5f=_0x29c5c7[_0x4644('0x23')],_0x44e1de=_0x29c5c7[_0x4644('0x23')]+_0x29c5c7[_0x4644('0x24')],_0xdd90ec;if(_0x44e1de>=_0x2025d7){_0x44e1de=_0x2025d7;_0xdd90ec=0xc8;}else{_0xdd90ec=0xce;}_0x3a5b4f[_0x4644('0x1f')](_0xdd90ec);return _0x3a5b4f[_0x4644('0x25')]('Content-Range',_0x4f6f5f+'-'+_0x44e1de+'/'+_0x2025d7)['json'](_0x31a85d);}return null;};}function patchUpdates(_0x3b86fc){return function(_0x2b96ce){try{jsonpatch[_0x4644('0x26')](_0x2b96ce,_0x3b86fc,!![]);}catch(_0x1c92c8){return BPromise[_0x4644('0x27')](_0x1c92c8);}return _0x2b96ce[_0x4644('0x28')]();};}function saveUpdates(_0x4f182b,_0x57b6d0){return function(_0x5cb95f){if(_0x5cb95f){return _0x5cb95f[_0x4644('0x29')](_0x4f182b)['then'](function(_0x56d6fb){return _0x56d6fb;});}return null;};}function removeEntity(_0x5b5cce,_0x32e633){return function(_0x55c949){if(_0x55c949){return _0x55c949[_0x4644('0x2a')]()[_0x4644('0x2b')](function(){var _0x55f076=_0x55c949[_0x4644('0x2c')]({'plain':!![]});var _0x3e4d02=_0x4644('0x2d');return db[_0x4644('0x2e')]['destroy']({'where':{'type':_0x3e4d02,'resourceId':_0x55f076['id']}})[_0x4644('0x2b')](function(){return _0x55c949;});})[_0x4644('0x2b')](function(){_0x5b5cce[_0x4644('0x1f')](0xcc)[_0x4644('0x20')]();});}};}function handleEntityNotFound(_0x342488,_0x18d123){return function(_0xe10ab3){if(!_0xe10ab3){_0x342488[_0x4644('0x2f')](0x194);}return _0xe10ab3;};}function handleError(_0x525256,_0x242e19){_0x242e19=_0x242e19||0x1f4;return function(_0x47486f){logger[_0x4644('0x30')](_0x47486f[_0x4644('0x31')]);if(_0x47486f['name']){delete _0x47486f['name'];}_0x525256[_0x4644('0x1f')](_0x242e19)[_0x4644('0x32')](_0x47486f);};}exports['index']=function(_0x18793a,_0x1e436c){var _0x58c853={},_0xcb2c2c={},_0x2acc97={'count':0x0,'rows':[]};var _0x3457eb=_[_0x4644('0x33')](db[_0x4644('0x34')][_0x4644('0x35')],function(_0x3722fb){return{'name':_0x3722fb[_0x4644('0x36')],'type':_0x3722fb[_0x4644('0x37')][_0x4644('0x38')]};});_0xcb2c2c[_0x4644('0x39')]=_['map'](_0x3457eb,_0x4644('0x3a'));_0xcb2c2c['query']=_[_0x4644('0x3b')](_0x18793a[_0x4644('0x3c')]);_0xcb2c2c[_0x4644('0x3d')]=_[_0x4644('0x3e')](_0xcb2c2c[_0x4644('0x39')],_0xcb2c2c[_0x4644('0x3c')]);_0x58c853[_0x4644('0x3f')]=_[_0x4644('0x3e')](_0xcb2c2c['model'],qs[_0x4644('0x40')](_0x18793a['query'][_0x4644('0x40')]));_0x58c853['attributes']=_0x58c853[_0x4644('0x3f')]['length']?_0x58c853['attributes']:_0xcb2c2c[_0x4644('0x39')];if(!_0x18793a[_0x4644('0x3c')][_0x4644('0x41')](_0x4644('0x42'))){_0x58c853[_0x4644('0x24')]=qs[_0x4644('0x24')](_0x18793a['query'][_0x4644('0x24')]);_0x58c853[_0x4644('0x23')]=qs[_0x4644('0x23')](_0x18793a[_0x4644('0x3c')][_0x4644('0x23')]);}_0x58c853[_0x4644('0x43')]=qs['sort'](_0x18793a[_0x4644('0x3c')][_0x4644('0x44')]);_0x58c853[_0x4644('0x45')]=qs['filters'](_[_0x4644('0x46')](_0x18793a[_0x4644('0x3c')],_0xcb2c2c['filters']),_0x3457eb);if(_0x18793a[_0x4644('0x3c')][_0x4644('0x47')]){_0x58c853[_0x4644('0x45')]=_['merge'](_0x58c853[_0x4644('0x45')],{'$or':_[_0x4644('0x33')](_0x3457eb,function(_0x27aa60){if(_0x27aa60['type']!==_0x4644('0x48')){var _0x26991a={};_0x26991a[_0x27aa60[_0x4644('0x3a')]]={'$like':'%'+_0x18793a[_0x4644('0x3c')]['filter']+'%'};return _0x26991a;}})});}_0x58c853=_[_0x4644('0x49')]({},_0x58c853,_0x18793a[_0x4644('0x4a')]);var _0x2eec7c={'where':_0x58c853[_0x4644('0x45')]};return db[_0x4644('0x34')][_0x4644('0x22')](_0x2eec7c)[_0x4644('0x2b')](function(_0x3cdf04){_0x2acc97[_0x4644('0x22')]=_0x3cdf04;if(_0x18793a['query'][_0x4644('0x4b')]){_0x58c853[_0x4644('0x4c')]=[{'all':!![]}];}return db[_0x4644('0x34')][_0x4644('0x4d')](_0x58c853);})[_0x4644('0x2b')](function(_0xf46e60){_0x2acc97[_0x4644('0x4e')]=_0xf46e60;return _0x2acc97;})[_0x4644('0x2b')](respondWithFilteredResult(_0x1e436c,_0x58c853))[_0x4644('0x4f')](handleError(_0x1e436c,null));};exports[_0x4644('0x50')]=function(_0x5a0b38,_0x8570d9){var _0x31492e={'raw':!![],'where':{'id':_0x5a0b38[_0x4644('0x51')]['id']}},_0x1e965a={};_0x1e965a[_0x4644('0x39')]=_[_0x4644('0x3b')](db[_0x4644('0x34')][_0x4644('0x35')]);_0x1e965a[_0x4644('0x3c')]=_['keys'](_0x5a0b38[_0x4644('0x3c')]);_0x1e965a[_0x4644('0x3d')]=_['intersection'](_0x1e965a[_0x4644('0x39')],_0x1e965a[_0x4644('0x3c')]);_0x31492e['attributes']=_['intersection'](_0x1e965a[_0x4644('0x39')],qs['fields'](_0x5a0b38['query'][_0x4644('0x40')]));_0x31492e['attributes']=_0x31492e[_0x4644('0x3f')][_0x4644('0x52')]?_0x31492e[_0x4644('0x3f')]:_0x1e965a[_0x4644('0x39')];if(_0x5a0b38[_0x4644('0x3c')][_0x4644('0x4b')]){_0x31492e[_0x4644('0x4c')]=[{'all':!![]}];}_0x31492e=_['merge']({},_0x31492e,_0x5a0b38[_0x4644('0x4a')]);return db[_0x4644('0x34')][_0x4644('0x53')](_0x31492e)[_0x4644('0x2b')](handleEntityNotFound(_0x8570d9,null))[_0x4644('0x2b')](respondWithResult(_0x8570d9,null))[_0x4644('0x4f')](handleError(_0x8570d9,null));};exports[_0x4644('0x54')]=function(_0x45339e,_0x46e07d,_0x41e01c){return db[_0x4644('0x34')]['find']({'where':{'id':_0x45339e['params']['id']},'attributes':[_0x4644('0x3a'),_0x4644('0x7')],'raw':!![]})[_0x4644('0x2b')](handleEntityNotFound(_0x46e07d,null))['then'](function(_0x2a6ee8){if(_0x2a6ee8){var _0x568e97=path['join'](config['root'],'server/files/plugins',util[_0x4644('0x55')](_0x4644('0x56'),path[_0x4644('0x57')](_0x2a6ee8[_0x4644('0x7')])));var _0x2d343b=fs[_0x4644('0x58')](_0x568e97);var _0x384464=archiver(_0x4644('0x59'),{'zlib':{'level':0x9}});_0x384464['on'](_0x4644('0x5a'),function(_0x30b25e){if(_0x30b25e[_0x4644('0x5b')]===_0x4644('0x5c')){logger[_0x4644('0x30')](_0x30b25e);}else{throw new db[(_0x4644('0x5d'))][(_0x4644('0x5e'))](_0x4644('0x5f'));}});_0x384464['on'](_0x4644('0x30'),function(_0x2272ad){throw new db[(_0x4644('0x5d'))][(_0x4644('0x5e'))](_0x4644('0x5f'));});_0x384464['pipe'](_0x2d343b);_0x384464[_0x4644('0x60')]('**/*',{'cwd':path['join'](config[_0x4644('0x61')],_0x4644('0x62'),path[_0x4644('0x63')](_0x2a6ee8[_0x4644('0x7')])),'ignore':[path['join'](path[_0x4644('0x57')](_0x2a6ee8[_0x4644('0x7')]),_0x4644('0x64')),path[_0x4644('0x65')](path[_0x4644('0x57')](_0x2a6ee8[_0x4644('0x7')]),_0x4644('0x66'))],'nodir':!![]})[_0x4644('0x67')]();_0x2d343b['on'](_0x4644('0x68'),function(){if(!fs[_0x4644('0x69')](_0x568e97)){throw new db['Sequelize'][(_0x4644('0x5e'))](_0x4644('0x6a'));}return _0x46e07d['download'](_0x568e97,util[_0x4644('0x55')]('%s.zip',path['basename'](_0x2a6ee8['path'])),function(_0x5482fe){if(_0x5482fe){throw new db[(_0x4644('0x5d'))][(_0x4644('0x5e'))](_0x4644('0x6b'));}fs[_0x4644('0x6c')](_0x568e97);logger[_0x4644('0x6d')](_0x4644('0x6e'));logger[_0x4644('0x6d')](_0x4644('0x6f'));});});}return null;})[_0x4644('0x4f')](handleError(_0x46e07d,null));};exports[_0x4644('0x70')]=function(_0x4b318d,_0x522f93,_0x5adff4){var _0x47a93c=path[_0x4644('0x57')](_0x4b318d['file'][_0x4644('0x71')],path[_0x4644('0x72')](_0x4b318d[_0x4644('0x73')][_0x4644('0x71')]));var _0x2d4821=path['join'](config[_0x4644('0x61')],'server/files/plugins',_0x4b318d[_0x4644('0x73')][_0x4644('0x71')]);var _0x4a5936=path['join'](config[_0x4644('0x61')],'server/files/plugins',_0x47a93c);logger['info'](_0x4644('0x74'),_0x2d4821);logger[_0x4644('0x6d')](_0x4644('0x75'),_0x4a5936);try{fs[_0x4644('0x76')](_0x2d4821,parseInt(_0x4644('0x77'),0x8));extract(_0x2d4821,{'dir':_0x4a5936},function(_0x2dc266){if(_0x2dc266){logger[_0x4644('0x30')](_0x2dc266);handleError(_0x2dc266,!![]);};var _0x4a85bf=fs[_0x4644('0x78')](_0x4a5936);if(_0x4a85bf[_0x4644('0x52')]>0x1){removeReferences(_0x2d4821,_0x4a5936);logger[_0x4644('0x30')]('Invalid\x20plugin\x20structure');return _0x5adff4(new Error('Invalid\x20plugin\x20structure'));}var _0x2ce068=fs[_0x4644('0x79')](path[_0x4644('0x65')](_0x4a5936,_0x4a85bf[0x0]));if(_0x2ce068['isFile']()){removeReferences(_0x2d4821,_0x4a5936);logger['error']('Invalid\x20plugin\x20structure');return _0x5adff4(new Error(_0x4644('0x7a')));}if(_0x2ce068[_0x4644('0x7b')]()){var _0x4f804f=fs[_0x4644('0x78')](path['join'](_0x4a5936,_0x4a85bf[0x0]));if(_0x4f804f[_0x4644('0x52')]===0x0){removeReferences(_0x2d4821,_0x4a5936);logger['error'](_0x4644('0x7a'));return _0x5adff4(new Error(_0x4644('0x7a')));}var _0x344cd1=_0x4f804f['some'](function(_0x477365){return _0x477365===_0x4644('0x7c');});if(!_0x344cd1){return _0x5adff4(new Error(_0x4644('0x7d')));}var _0x2add9c=fs['readFileSync'](path[_0x4644('0x65')](_0x4a5936,_0x4a85bf[0x0],_0x4644('0x7c')));var _0xf8907=JSON[_0x4644('0x7e')](_0x2add9c);if(_0x4644('0x7f')==typeof _0xf8907[_0x4644('0x3a')]){return _0x5adff4(new Error(_0x4644('0x80')));}if(_0x4644('0x7f')==typeof _0xf8907['type']){return _0x5adff4(new Error(_0x4644('0x81')));}if('undefined'==typeof _0xf8907[_0x4644('0x82')]){return _0x5adff4(new Error(_0x4644('0x83')));}if('undefined'==typeof _0xf8907[_0x4644('0x84')]){return _0x5adff4(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0xf8907[_0x4644('0x37')]===_0x4644('0x85')){if(_0x4644('0x7f')==typeof _0xf8907[_0x4644('0x84')][_0x4644('0x86')]){return _0x5adff4(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x4644('0x7f')==typeof _0xf8907[_0x4644('0x84')]['views']['admin']&&_0x4644('0x7f')==typeof _0xf8907['parameters'][_0x4644('0x86')]['agent']){return _0x5adff4(new Error(_0x4644('0x87')));}}else if(_0xf8907[_0x4644('0x37')]==='script'){if('undefined'==typeof _0xf8907['parameters']['scriptName']){return _0x5adff4(new Error(_0x4644('0x88')));}if(_0x4644('0x7f')==typeof _0xf8907[_0x4644('0x84')]['scriptPath']){return _0x5adff4(new Error(_0x4644('0x89')));}}else{return _0x5adff4(new Error(_0x4644('0x8a')));}var _0x54bea2=_0xf8907['name'];var _0x1425d2=_0xf8907['description'];var _0xc0a9a5=_0xf8907[_0x4644('0x37')];var _0x215683=_0xf8907['sidebar']?_0xf8907['sidebar']:_0x4644('0x8b');var _0x5c9479=_0xf8907[_0x4644('0x8c')]?_0xf8907[_0x4644('0x8c')]:_0x4644('0x8d');var _0x488b10='';var _0x5d3fa='';var _0x43ba8b='';var _0x113e26='';var _0x406c7b=_0xf8907['version'];if(_0xc0a9a5===_0x4644('0x85')){if(_0x4644('0x7f')!=typeof _0xf8907[_0x4644('0x84')][_0x4644('0x86')]['admin']){var _0x24df7e=_0xf8907[_0x4644('0x84')][_0x4644('0x86')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x4644('0x8e')](_0x24df7e)){_0x488b10=path['join'](_0x4644('0x8f'),_0x47a93c,_0x4a85bf[0x0],_0x24df7e);}else{_0x488b10=_0x24df7e;}}else{logger[_0x4644('0x6d')](_0x4644('0x90'));}if('undefined'!=typeof _0xf8907[_0x4644('0x84')]['views'][_0x4644('0x91')]){var _0x42f2f9=_0xf8907[_0x4644('0x84')]['views'][_0x4644('0x91')];if(!/^(f|ht)tps?:\/\//i['test'](_0x42f2f9)){_0x5d3fa=path[_0x4644('0x65')](_0x4644('0x8f'),_0x47a93c,_0x4a85bf[0x0],_0x42f2f9);}else{_0x5d3fa=_0x42f2f9;}}else{logger[_0x4644('0x6d')](_0x4644('0x92'));}}else if(_0xc0a9a5===_0x4644('0x93')){_0x43ba8b=_0xf8907[_0x4644('0x84')]['scriptName'];_0x113e26=_0xf8907[_0x4644('0x84')][_0x4644('0x94')];if(_0x4644('0x7f')!=typeof _0xf8907[_0x4644('0x84')][_0x4644('0x86')]){if(_0x4644('0x7f')!=typeof _0xf8907[_0x4644('0x84')][_0x4644('0x86')]['admin']){var _0x24df7e=_0xf8907[_0x4644('0x84')][_0x4644('0x86')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x4644('0x8e')](_0x24df7e)){_0x488b10=path[_0x4644('0x65')](_0x4644('0x8f'),_0x47a93c,_0x4a85bf[0x0],_0x24df7e);}else{_0x488b10=_0x24df7e;}}if(_0x4644('0x7f')!=typeof _0xf8907[_0x4644('0x84')]['views'][_0x4644('0x91')]){var _0x42f2f9=_0xf8907['parameters'][_0x4644('0x86')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x4644('0x8e')](_0x42f2f9)){_0x5d3fa=path['join'](_0x4644('0x8f'),_0x47a93c,_0x4a85bf[0x0],_0x42f2f9);}else{_0x5d3fa=_0x42f2f9;}}}}var _0xb17fee={'name':_0x54bea2,'description':_0x1425d2,'path':path[_0x4644('0x65')](_0x47a93c,_0x4a85bf[0x0]),'type':_0xc0a9a5,'sidebar':_0x215683,'icon':_0x5c9479,'adminUrl':_0x488b10,'agentUrl':_0x5d3fa,'scriptName':_0x43ba8b,'scriptPath':_0x113e26,'version':_0x406c7b};removeReferences(_0x2d4821,null);return db[_0x4644('0x34')][_0x4644('0x95')](_0xb17fee)[_0x4644('0x2b')](function(_0x22a1c3){var _0x365f43={'role':_0x4b318d[_0x4644('0x96')][_0x4644('0x97')],'userProfileId':_0x4b318d[_0x4644('0x96')][_0x4644('0x98')]};if(!_0x365f43)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x365f43[_0x4644('0x97')]===_0x4644('0x99')){var _0x1c9542=_0x22a1c3[_0x4644('0x2c')]({'plain':!![]});return db[_0x4644('0x9a')][_0x4644('0x53')]({'where':{'name':_0x4644('0x2d'),'userProfileId':_0x365f43[_0x4644('0x98')]},'raw':!![]})[_0x4644('0x2b')](function(_0xbff3d2){if(_0xbff3d2&&_0xbff3d2[_0x4644('0x9b')]===0x0){return db[_0x4644('0x2e')][_0x4644('0x95')]({'name':_0x1c9542[_0x4644('0x3a')],'resourceId':_0x1c9542['id'],'type':_0xbff3d2['name'],'sectionId':_0xbff3d2['id']},{})[_0x4644('0x2b')](function(){return _0x22a1c3;});}else{return _0x22a1c3;}})['catch'](function(_0x17c498){logger[_0x4644('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17c498);throw _0x17c498;});}return _0x22a1c3;})[_0x4644('0x2b')](respondWithResult(_0x522f93,null))[_0x4644('0x4f')](handleError(_0x522f93,null));}});}catch(_0x5aa1d1){_0x522f93[_0x4644('0x1f')](0x1f4)[_0x4644('0x32')](_0x5aa1d1);}};function removeReferences(_0x33c455,_0x513073){try{if(_0x33c455){fs[_0x4644('0x6c')](_0x33c455);logger['info'](_0x4644('0x9c'));}if(_0x513073){rimraf(_0x513073,function(){});logger[_0x4644('0x6d')]('Extracted\x20folder\x20removed');}}catch(_0x2b5c5d){logger[_0x4644('0x30')](_0x2b5c5d);}}exports[_0x4644('0x29')]=function(_0x56f6de,_0xdab8a0,_0x44ae2a){return db[_0x4644('0x34')][_0x4644('0x53')]({'where':{'id':_0x56f6de[_0x4644('0x51')]['id']}})[_0x4644('0x2b')](handleEntityNotFound(_0xdab8a0,null))[_0x4644('0x2b')](saveUpdates(_0x56f6de[_0x4644('0x96')],null))['then'](respondWithResult(_0xdab8a0,null))[_0x4644('0x4f')](handleError(_0xdab8a0,null));};exports['delete']=function(_0xe5ea0d,_0x1b4be8,_0x5912e2){return db[_0x4644('0x34')][_0x4644('0x53')]({'where':{'id':_0xe5ea0d['params']['id']}})[_0x4644('0x2b')](function(_0x4f1e2e){if(_0x4f1e2e){return _0x4f1e2e[_0x4644('0x2a')]();}})[_0x4644('0x2b')](function(_0x233de2){rimraf(path[_0x4644('0x65')](config[_0x4644('0x61')],_0x4644('0x62'),path[_0x4644('0x63')](_0x233de2[_0x4644('0x7')])),function(){});return _0x233de2;})[_0x4644('0x2b')](handleEntityNotFound(_0x1b4be8,null))[_0x4644('0x2b')](respondWithStatusCode(_0x1b4be8,null))[_0x4644('0x4f')](handleError(_0x1b4be8,null));};exports[_0x4644('0x9d')]=function(_0x5e5cbe,_0x4e7ef6,_0x30bc7e){return BPromise[_0x4644('0x9e')]()['then'](function(){if(!_0x5e5cbe[_0x4644('0x3c')][_0x4644('0x7')]){throw new Error(_0x4644('0x9f'));}if(!_0x5e5cbe[_0x4644('0x3c')]['port']){throw new Error(_0x4644('0xa0'));}var _0x4f7e77=_0x5e5cbe[_0x4644('0x3c')]['hostname']?_0x5e5cbe[_0x4644('0x3c')][_0x4644('0xa1')]+':'+_0x5e5cbe[_0x4644('0x3c')][_0x4644('0xa2')]:_0x4644('0xa3')+_0x5e5cbe[_0x4644('0x3c')][_0x4644('0xa2')];var _0x1f36fb=_0x5e5cbe[_0x4644('0x3c')][_0x4644('0x21')]?_0x5e5cbe['query'][_0x4644('0x21')]:!![];var _0x5282b4=_0x5e5cbe[_0x4644('0x3c')]['encoding']?_0x5e5cbe['query'][_0x4644('0xa4')]:null;var _0x844d27={'method':_0x5e5cbe[_0x4644('0xa5')],'uri':util[_0x4644('0x55')](_0x4644('0xa6'),_0x4f7e77,_0x5e5cbe[_0x4644('0x3c')][_0x4644('0x7')]),'json':_0x1f36fb,'resolveWithFullResponse':!![],'encoding':_0x5282b4,'qs':_0x5e5cbe['query']};if(_0x5e5cbe[_0x4644('0xa7')]){_0x844d27[_0x4644('0xa7')]=_0x5e5cbe['headers'];if(_0x844d27[_0x4644('0xa7')]['content-length']){delete _0x844d27[_0x4644('0xa7')]['content-length'];}}if(_0x844d27[_0x4644('0xa7')][_0x4644('0xa8')]){delete _0x844d27[_0x4644('0xa7')]['content-type'];}return rp(_0x844d27);})[_0x4644('0x2b')](function(_0x23e849){if(_0x23e849){_0x4e7ef6[_0x4644('0x25')](_0x23e849[_0x4644('0xa7')]);logger[_0x4644('0x6d')](_0x23e849[_0x4644('0x96')]);if(_[_0x4644('0xa9')](_0x5e5cbe[_0x4644('0x3c')][_0x4644('0x7')],'download')&&_0x23e849[_0x4644('0xaa')]==0x1f4){return _0x4e7ef6[_0x4644('0x2f')](_0x23e849[_0x4644('0xaa')]);}else{return _0x4e7ef6['status'](_0x23e849[_0x4644('0xaa')])[_0x4644('0x32')](_0x23e849[_0x4644('0x96')]);}}else{return _0x4e7ef6[_0x4644('0x2f')](0xc8);}})[_0x4644('0x4f')](handleError(_0x4e7ef6,null));};exports['webhookPost']=function(_0x4c24fd,_0x139bd0,_0x29323c){return BPromise['resolve']()[_0x4644('0x2b')](function(){if(!_0x4c24fd[_0x4644('0x3c')][_0x4644('0x7')]){throw new Error(_0x4644('0x9f'));}if(!_0x4c24fd[_0x4644('0x3c')][_0x4644('0xa2')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x51bca4=_0x4c24fd[_0x4644('0x3c')][_0x4644('0xa1')]?_0x4c24fd[_0x4644('0x3c')][_0x4644('0xa1')]+':'+_0x4c24fd[_0x4644('0x3c')][_0x4644('0xa2')]:'http://localhost:'+_0x4c24fd['query'][_0x4644('0xa2')];var _0x154dea=_0x4c24fd[_0x4644('0x3c')][_0x4644('0x21')]?_0x4c24fd[_0x4644('0x3c')][_0x4644('0x21')]:!![];var _0x446c5c=_0x4c24fd['query'][_0x4644('0xa4')]?_0x4c24fd[_0x4644('0x3c')]['encoding']:null;var _0x28ee9c={'method':_0x4c24fd[_0x4644('0xa5')],'uri':util[_0x4644('0x55')]('%s%s',_0x51bca4,_0x4c24fd[_0x4644('0x3c')]['path']),'json':_0x154dea,'resolveWithFullResponse':!![],'encoding':_0x446c5c,'body':_0x4c24fd['body']};if(_0x4c24fd[_0x4644('0xa7')]){_0x28ee9c[_0x4644('0xa7')]=_0x4c24fd[_0x4644('0xa7')];if(_0x28ee9c[_0x4644('0xa7')][_0x4644('0xab')]){delete _0x28ee9c[_0x4644('0xa7')][_0x4644('0xab')];}}if(_0x28ee9c['headers'][_0x4644('0xa8')]){delete _0x28ee9c[_0x4644('0xa7')][_0x4644('0xa8')];}return rp(_0x28ee9c);})[_0x4644('0x2b')](function(_0x376091){if(_0x376091){_0x139bd0[_0x4644('0x25')](_0x376091[_0x4644('0xa7')]);logger['info'](_0x376091[_0x4644('0x96')]);return _0x139bd0['status'](_0x376091[_0x4644('0xaa')])[_0x4644('0x32')](_0x376091[_0x4644('0x96')]);}else{return _0x139bd0['sendStatus'](0xc8);}})[_0x4644('0x4f')](handleError(_0x139bd0,null));};
\ No newline at end of file
index 8dca903..4aa434b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66fa=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x66fa,0x117));var _0xa66f=function(_0x2b4933,_0x1109c7){_0x2b4933=_0x2b4933-0x0;var _0xc539ff=_0x66fa[_0x2b4933];return _0xc539ff;};'use strict';var EventEmitter=require(_0xa66f('0x0'));var Plugin=require(_0xa66f('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xa66f('0x2')](0x0);var events={'afterCreate':_0xa66f('0x3'),'afterUpdate':_0xa66f('0x4'),'afterDestroy':_0xa66f('0x5')};function emitEvent(_0x3d0c49){return function(_0x2a2abf,_0x3f4904,_0x5ebea5){PluginEvents['emit'](_0x3d0c49+':'+_0x2a2abf['id'],_0x2a2abf);PluginEvents[_0xa66f('0x6')](_0x3d0c49,_0x2a2abf);_0x5ebea5(null);};}for(var e in events){if(events[_0xa66f('0x7')](e)){var event=events[e];Plugin[_0xa66f('0x8')](e,emitEvent(event));}}module[_0xa66f('0x9')]=PluginEvents;
\ No newline at end of file
+var _0xb44a=['Plugin','save','emit','hasOwnProperty','hook','exports'];(function(_0x2f47fd,_0x5d07bf){var _0x3581e9=function(_0xd62c1a){while(--_0xd62c1a){_0x2f47fd['push'](_0x2f47fd['shift']());}};_0x3581e9(++_0x5d07bf);}(_0xb44a,0x1c2));var _0xab44=function(_0x153846,_0x1227ad){_0x153846=_0x153846-0x0;var _0x3ee557=_0xb44a[_0x153846];return _0x3ee557;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0xab44('0x0')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xab44('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3aa69c){return function(_0x5c93b4,_0x1b9e05,_0x32396c){PluginEvents[_0xab44('0x2')](_0x3aa69c+':'+_0x5c93b4['id'],_0x5c93b4);PluginEvents[_0xab44('0x2')](_0x3aa69c,_0x5c93b4);_0x32396c(null);};}for(var e in events){if(events[_0xab44('0x3')](e)){var event=events[e];Plugin[_0xab44('0x4')](e,emitEvent(event));}}module[_0xab44('0x5')]=PluginEvents;
\ No newline at end of file
index 9f776a1..d446ee1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3d4=['moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes','exports','Plugin','util'];(function(_0x5d3a99,_0x18bd27){var _0x16713c=function(_0xb5ab0d){while(--_0xb5ab0d){_0x5d3a99['push'](_0x5d3a99['shift']());}};_0x16713c(++_0x18bd27);}(_0xb3d4,0x74));var _0x4b3d=function(_0x39d06c,_0x118455){_0x39d06c=_0x39d06c-0x0;var _0x559d6d=_0xb3d4[_0x39d06c];return _0x559d6d;};'use strict';var _=require('lodash');var util=require(_0x4b3d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4b3d('0x1'));var BPromise=require(_0x4b3d('0x2'));var rp=require(_0x4b3d('0x3'));var fs=require('fs');var path=require(_0x4b3d('0x4'));var rimraf=require('rimraf');var config=require(_0x4b3d('0x5'));var attributes=require(_0x4b3d('0x6'));module[_0x4b3d('0x7')]=function(_0x4d4094,_0x27f301){return _0x4d4094['define'](_0x4b3d('0x8'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4a8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','../../config/logger','api'];(function(_0x381f03,_0x4c3f61){var _0x21a630=function(_0x34a2fa){while(--_0x34a2fa){_0x381f03['push'](_0x381f03['shift']());}};_0x21a630(++_0x4c3f61);}(_0xf4a8,0x89));var _0x8f4a=function(_0x254abd,_0x1ab7f0){_0x254abd=_0x254abd-0x0;var _0x31bf1b=_0xf4a8[_0x254abd];return _0x31bf1b;};'use strict';var _=require(_0x8f4a('0x0'));var util=require('util');var logger=require(_0x8f4a('0x1'))(_0x8f4a('0x2'));var moment=require(_0x8f4a('0x3'));var BPromise=require(_0x8f4a('0x4'));var rp=require(_0x8f4a('0x5'));var fs=require('fs');var path=require(_0x8f4a('0x6'));var rimraf=require(_0x8f4a('0x7'));var config=require(_0x8f4a('0x8'));var attributes=require(_0x8f4a('0x9'));module[_0x8f4a('0xa')]=function(_0x18e296,_0x25da42){return _0x18e296[_0x8f4a('0xb')](_0x8f4a('0xc'),attributes,{'tableName':_0x8f4a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 24ca7ea..1db803a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10e6=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message','CreatePlugin','create','body','options','raw','then','stringify','lodash','moment','bluebird','randomstring'];(function(_0x3dc3f2,_0x492891){var _0x5f58e4=function(_0x37381d){while(--_0x37381d){_0x3dc3f2['push'](_0x3dc3f2['shift']());}};_0x5f58e4(++_0x492891);}(_0x10e6,0xb6));var _0x610e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x10e6[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x610e('0x0'));var util=require('util');var moment=require(_0x610e('0x1'));var BPromise=require(_0x610e('0x2'));var rs=require(_0x610e('0x3'));var fs=require('fs');var Redis=require(_0x610e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x610e('0x5'));var logger=require(_0x610e('0x6'))('rpc');var config=require(_0x610e('0x7'));var jayson=require(_0x610e('0x8'));var client=jayson['client'][_0x610e('0x9')]({'port':0x232a});config[_0x610e('0xa')]=_[_0x610e('0xb')](config['redis'],{'host':_0x610e('0xc'),'port':0x18eb});var socket=require(_0x610e('0xd'))(new Redis(config[_0x610e('0xa')]));require(_0x610e('0xe'))[_0x610e('0xf')](socket);function respondWithRpcPromise(_0x55c230,_0x245a2a,_0x33dd49){return new BPromise(function(_0x34c4c9,_0x1d3771){return client[_0x610e('0x10')](_0x55c230,_0x33dd49)['then'](function(_0x5a2644){logger[_0x610e('0x11')](_0x610e('0x12'),_0x245a2a,_0x610e('0x13'));logger[_0x610e('0x14')]('Plugin,\x20%s,\x20%s,\x20%s',_0x245a2a,_0x610e('0x13'),JSON['stringify'](_0x5a2644));if(_0x5a2644[_0x610e('0x15')]){if(_0x5a2644[_0x610e('0x15')][_0x610e('0x16')]===0x1f4){logger[_0x610e('0x15')](_0x610e('0x12'),_0x245a2a,_0x5a2644[_0x610e('0x15')]['message']);return _0x1d3771(_0x5a2644['error'][_0x610e('0x17')]);}logger[_0x610e('0x15')](_0x610e('0x12'),_0x245a2a,_0x5a2644[_0x610e('0x15')][_0x610e('0x17')]);return _0x34c4c9(_0x5a2644[_0x610e('0x15')][_0x610e('0x17')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x245a2a,_0x610e('0x13'));_0x34c4c9(_0x5a2644['result'][_0x610e('0x17')]);}})['catch'](function(_0x43c67a){logger[_0x610e('0x15')](_0x610e('0x12'),_0x245a2a,_0x43c67a);_0x1d3771(_0x43c67a);});});}exports[_0x610e('0x18')]=function(_0x537c44){var _0x21bb38=this;return new Promise(function(_0x2473b8,_0x303587){return db['Plugin'][_0x610e('0x19')](_0x537c44[_0x610e('0x1a')],{'raw':_0x537c44[_0x610e('0x1b')]?_0x537c44[_0x610e('0x1b')][_0x610e('0x1c')]===undefined?!![]:![]:!![]})[_0x610e('0x1d')](function(_0x553e30){logger[_0x610e('0x11')](_0x610e('0x18'),_0x537c44);logger['debug'](_0x610e('0x18'),_0x537c44,JSON[_0x610e('0x1e')](_0x553e30));_0x2473b8(_0x553e30);})['catch'](function(_0x4d3017){logger[_0x610e('0x15')]('CreatePlugin',_0x4d3017[_0x610e('0x17')],_0x537c44);_0x303587(_0x21bb38['error'](0x1f4,_0x4d3017['message']));});});};
\ No newline at end of file
+var _0xd870=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x15ed5d,_0xdd2d44){var _0x2ab46d=function(_0x391a5d){while(--_0x391a5d){_0x15ed5d['push'](_0x15ed5d['shift']());}};_0x2ab46d(++_0xdd2d44);}(_0xd870,0x14e));var _0x0d87=function(_0x3ca39c,_0x263221){_0x3ca39c=_0x3ca39c-0x0;var _0x3aad48=_0xd870[_0x3ca39c];return _0x3aad48;};'use strict';var _=require(_0x0d87('0x0'));var util=require(_0x0d87('0x1'));var moment=require(_0x0d87('0x2'));var BPromise=require(_0x0d87('0x3'));var rs=require(_0x0d87('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d87('0x5'))['db'];var utils=require(_0x0d87('0x6'));var logger=require(_0x0d87('0x7'))('rpc');var config=require(_0x0d87('0x8'));var jayson=require(_0x0d87('0x9'));var client=jayson[_0x0d87('0xa')][_0x0d87('0xb')]({'port':0x232a});config[_0x0d87('0xc')]=_['defaults'](config[_0x0d87('0xc')],{'host':_0x0d87('0xd'),'port':0x18eb});var socket=require(_0x0d87('0xe'))(new Redis(config[_0x0d87('0xc')]));require(_0x0d87('0xf'))[_0x0d87('0x10')](socket);function respondWithRpcPromise(_0x13cea7,_0x10eb18,_0x2f9b55){return new BPromise(function(_0x59b3d0,_0x27f7a9){return client['request'](_0x13cea7,_0x2f9b55)[_0x0d87('0x11')](function(_0xa94a21){logger[_0x0d87('0x12')]('Plugin,\x20%s,\x20%s',_0x10eb18,_0x0d87('0x13'));logger[_0x0d87('0x14')](_0x0d87('0x15'),_0x10eb18,'request\x20sent',JSON['stringify'](_0xa94a21));if(_0xa94a21[_0x0d87('0x16')]){if(_0xa94a21['error'][_0x0d87('0x17')]===0x1f4){logger['error'](_0x0d87('0x18'),_0x10eb18,_0xa94a21[_0x0d87('0x16')][_0x0d87('0x19')]);return _0x27f7a9(_0xa94a21[_0x0d87('0x16')][_0x0d87('0x19')]);}logger[_0x0d87('0x16')](_0x0d87('0x18'),_0x10eb18,_0xa94a21[_0x0d87('0x16')][_0x0d87('0x19')]);return _0x59b3d0(_0xa94a21[_0x0d87('0x16')][_0x0d87('0x19')]);}else{logger[_0x0d87('0x12')](_0x0d87('0x18'),_0x10eb18,'request\x20sent');_0x59b3d0(_0xa94a21[_0x0d87('0x1a')][_0x0d87('0x19')]);}})[_0x0d87('0x1b')](function(_0x3810da){logger[_0x0d87('0x16')]('Plugin,\x20%s,\x20%s',_0x10eb18,_0x3810da);_0x27f7a9(_0x3810da);});});}exports[_0x0d87('0x1c')]=function(_0x88a4e4){var _0x88fcf0=this;return new Promise(function(_0x42cb4a,_0x14bc3c){return db[_0x0d87('0x1d')][_0x0d87('0x1e')](_0x88a4e4['body'],{'raw':_0x88a4e4['options']?_0x88a4e4[_0x0d87('0x1f')][_0x0d87('0x20')]===undefined?!![]:![]:!![]})[_0x0d87('0x11')](function(_0x3a91bc){logger[_0x0d87('0x12')]('CreatePlugin',_0x88a4e4);logger[_0x0d87('0x14')](_0x0d87('0x1c'),_0x88a4e4,JSON[_0x0d87('0x21')](_0x3a91bc));_0x42cb4a(_0x3a91bc);})[_0x0d87('0x1b')](function(_0x4344d4){logger[_0x0d87('0x16')](_0x0d87('0x1c'),_0x4344d4[_0x0d87('0x19')],_0x88a4e4);_0x14bc3c(_0x88fcf0[_0x0d87('0x16')](0x1f4,_0x4344d4[_0x0d87('0x19')]));});});};
\ No newline at end of file
index 7adfa19..03e4b80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c01=['length','./plugin.events','save','emit','removeListener'];(function(_0xd42db4,_0x29c00b){var _0x36ccdd=function(_0x5f4ef1){while(--_0x5f4ef1){_0xd42db4['push'](_0xd42db4['shift']());}};_0x36ccdd(++_0x29c00b);}(_0x3c01,0x79));var _0x13c0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3c01[_0x20a584];return _0x4b41a8;};'use strict';var PluginEvents=require(_0x13c0('0x0'));var events=[_0x13c0('0x1'),'remove','update'];function createListener(_0x932a0b,_0x4d135a){return function(_0x1cee7d){_0x4d135a[_0x13c0('0x2')](_0x932a0b,_0x1cee7d);};}function removeListener(_0x5b7def,_0x3e8dce){return function(){PluginEvents[_0x13c0('0x3')](_0x5b7def,_0x3e8dce);};}exports['register']=function(_0x4264ca){for(var _0x491e08=0x0,_0x1e1d5a=events[_0x13c0('0x4')];_0x491e08<_0x1e1d5a;_0x491e08++){var _0x47cdab=events[_0x491e08];var _0x17b99c=createListener('plugin:'+_0x47cdab,_0x4264ca);PluginEvents['on'](_0x47cdab,_0x17b99c);}};
\ No newline at end of file
+var _0xf0b0=['plugin:','save','remove','update','emit','removeListener','register'];(function(_0x39c646,_0x1bbf0f){var _0x12ea70=function(_0x1b80ce){while(--_0x1b80ce){_0x39c646['push'](_0x39c646['shift']());}};_0x12ea70(++_0x1bbf0f);}(_0xf0b0,0x143));var _0x0f0b=function(_0x12afef,_0x348cb6){_0x12afef=_0x12afef-0x0;var _0x37919b=_0xf0b0[_0x12afef];return _0x37919b;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x0f0b('0x0'),_0x0f0b('0x1'),_0x0f0b('0x2')];function createListener(_0x5520e8,_0x35c758){return function(_0x479c96){_0x35c758[_0x0f0b('0x3')](_0x5520e8,_0x479c96);};}function removeListener(_0x550b05,_0x1fc3c2){return function(){PluginEvents[_0x0f0b('0x4')](_0x550b05,_0x1fc3c2);};}exports[_0x0f0b('0x5')]=function(_0x56e2db){for(var _0x109705=0x0,_0x1495a7=events['length'];_0x109705<_0x1495a7;_0x109705++){var _0x2f0b0a=events[_0x109705];var _0x449f1b=createListener(_0x0f0b('0x6')+_0x2f0b0a,_0x56e2db);PluginEvents['on'](_0x2f0b0a,_0x449f1b);}};
\ No newline at end of file
index 3547280..a34750c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e61=['isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','express','Router','../../components/auth/service','index'];(function(_0xe3f6b,_0x36fd18){var _0x1d4bf0=function(_0x9fe0dd){while(--_0x9fe0dd){_0xe3f6b['push'](_0xe3f6b['shift']());}};_0x1d4bf0(++_0x36fd18);}(_0x4e61,0x141));var _0x14e6=function(_0x5418ad,_0x40742f){_0x5418ad=_0x5418ad-0x0;var _0x2cae56=_0x4e61[_0x5418ad];return _0x2cae56;};'use strict';var express=require(_0x14e6('0x0'));var router=express[_0x14e6('0x1')]();var auth=require(_0x14e6('0x2'));var controller=require('./pm2.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x14e6('0x3')]);router['get']('/:id',auth[_0x14e6('0x4')](),controller[_0x14e6('0x5')]);router[_0x14e6('0x6')]('/',auth['isAuthenticated'](),controller['create']);router[_0x14e6('0x7')](_0x14e6('0x8'),auth[_0x14e6('0x4')](),controller[_0x14e6('0x9')]);router[_0x14e6('0xa')]('/:id',auth[_0x14e6('0x4')](),controller[_0x14e6('0xb')]);module[_0x14e6('0xc')]=router;
\ No newline at end of file
+var _0xf3fd=['show','post','create','delete','destroy','exports','Router','../../components/auth/service','./pm2.controller','isAuthenticated','index','get','/:id'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0xf3fd,0xd6));var _0xdf3f=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xf3fd[_0x2f5ac5];return _0x37c9a8;};'use strict';var express=require('express');var router=express[_0xdf3f('0x0')]();var auth=require(_0xdf3f('0x1'));var controller=require(_0xdf3f('0x2'));router['get']('/',auth[_0xdf3f('0x3')](),controller[_0xdf3f('0x4')]);router[_0xdf3f('0x5')](_0xdf3f('0x6'),auth[_0xdf3f('0x3')](),controller[_0xdf3f('0x7')]);router[_0xdf3f('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf3f('0x9')]);router['put'](_0xdf3f('0x6'),auth['isAuthenticated'](),controller['update']);router[_0xdf3f('0xa')](_0xdf3f('0x6'),auth['isAuthenticated'](),controller[_0xdf3f('0xb')]);module[_0xdf3f('0xc')]=router;
\ No newline at end of file
index 94e8906..93e50eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe47e=['delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','bluebird','sendStatus','status','json','error','stack','send','info','list','name','length','then','catch','params','create','body','script','join','../../files/plugins','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy'];(function(_0x1f0e6c,_0x43bfcb){var _0x36c19c=function(_0x2de6c1){while(--_0x2de6c1){_0x1f0e6c['push'](_0x1f0e6c['shift']());}};_0x36c19c(++_0x43bfcb);}(_0xe47e,0x199));var _0xee47=function(_0x445c98,_0x132bf7){_0x445c98=_0x445c98-0x0;var _0x2fe913=_0xe47e[_0x445c98];return _0x2fe913;};'use strict';var _=require(_0xee47('0x0'));var pm2=require(_0xee47('0x1'));var logger=require(_0xee47('0x2'))(_0xee47('0x3'));var path=require(_0xee47('0x4'));var exec=require(_0xee47('0x5'))['exec'];var BPromise=require(_0xee47('0x6'));function handleEntityNotFound(_0x118705,_0x103e9f){return function(_0x48e1e3){if(!_0x48e1e3){_0x118705[_0xee47('0x7')](0x194);;}return _0x48e1e3;};}function respondWithResult(_0x43a69e,_0x25c6f0){_0x25c6f0=_0x25c6f0||0xc8;return function(_0x2f0d90){if(_0x2f0d90){return _0x43a69e[_0xee47('0x8')](_0x25c6f0)[_0xee47('0x9')](_0x2f0d90);}return null;};}function handleError(_0x2ef053,_0x51f62a){_0x51f62a=_0x51f62a||0x1f4;return function(_0xa2af1d){logger[_0xee47('0xa')](_0xa2af1d[_0xee47('0xb')]);if(_0xa2af1d['name']){delete _0xa2af1d['name'];}_0x2ef053[_0xee47('0x8')](_0x51f62a)[_0xee47('0xc')](_0xa2af1d);};}function execChildProcess(){return new BPromise(function(_0xe9f3fa,_0x59535e){exec('npm\x20install',function(_0x4a1522,_0x1d24e7,_0x18eb3e){logger[_0xee47('0xd')](_0x1d24e7);logger[_0xee47('0xd')](_0x18eb3e);if(_0x4a1522){logger['error'](_0x4a1522);return _0x59535e(_0x4a1522);}return _0xe9f3fa(_0x1d24e7);});});}exports['index']=function(_0x5a5962,_0x9459dd){return pm2[_0xee47('0xe')]()['then'](function(_0xa8c6c5){if(_0xa8c6c5){var _0x4bd4b2=_['reject'](_0xa8c6c5,function(_0x208d23){return _0x208d23['name']==='express'||_0x208d23[_0xee47('0xf')]==='motion2';});return{'rows':_0x4bd4b2,'count':_0x4bd4b2[_0xee47('0x10')]};}return null;})[_0xee47('0x11')](respondWithResult(_0x9459dd,null))[_0xee47('0x12')](handleError(_0x9459dd,null));};exports['show']=function(_0x1249f6,_0x37f180){return pm2['describe'](_0x1249f6[_0xee47('0x13')]['id'])['then'](respondWithResult(_0x37f180,null))[_0xee47('0x11')](handleEntityNotFound(_0x37f180,null))[_0xee47('0x12')](handleError(_0x37f180,null));};exports[_0xee47('0x14')]=function(_0x5ee16c,_0x2c6aa0){if(_0x5ee16c[_0xee47('0x15')][_0xee47('0xf')]&&_0x5ee16c[_0xee47('0x15')][_0xee47('0x16')]){var _0x4c3ceb=path[_0xee47('0x17')](__dirname,_0xee47('0x18'),_0x5ee16c['body'][_0xee47('0x16')]);var _0x54e690=process['cwd']();process[_0xee47('0x19')](path[_0xee47('0x1a')](_0x4c3ceb));return execChildProcess()[_0xee47('0x11')](function(_0x4fe480){process[_0xee47('0x19')](_0x54e690);return pm2[_0xee47('0x1b')]({'name':_0x5ee16c[_0xee47('0x15')][_0xee47('0xf')],'script':_0x4c3ceb});})['then'](function(_0x41054e){pm2[_0xee47('0x1c')]();return _0x41054e[0x0];})[_0xee47('0x11')](respondWithResult(_0x2c6aa0,0xc9))['catch'](handleError(_0x2c6aa0,null));}else{return _0x2c6aa0['status'](0x1f4)[_0xee47('0xc')]({'message':_0xee47('0x1d')});}};exports[_0xee47('0x1e')]=function(_0x2ad43f,_0x4d15ab){if(_0x2ad43f[_0xee47('0x15')]['id']){delete _0x2ad43f[_0xee47('0x15')]['id'];}var _0x206907={'online':_0xee47('0x1f'),'stopped':_0xee47('0x20')};if(_0x206907[_0xee47('0x21')](_0x2ad43f[_0xee47('0x15')]['status'])){return pm2[_0x206907[_0x2ad43f['body']['status']]](_0x2ad43f[_0xee47('0x13')]['id'])[_0xee47('0x11')](respondWithResult(_0x4d15ab,0xc8))[_0xee47('0x12')](handleError(_0x4d15ab,null));}else{return _0x4d15ab[_0xee47('0x8')](0x1f4)[_0xee47('0xc')]({'message':'Unknown\x20status'});}};exports[_0xee47('0x22')]=function(_0x3c5686,_0x6188a6){if(_0x3c5686[_0xee47('0x15')]['id']){delete _0x3c5686[_0xee47('0x15')]['id'];}if(_0x3c5686[_0xee47('0x13')]['id']){return pm2[_0xee47('0x23')](_0x3c5686[_0xee47('0x13')]['id'])[_0xee47('0x11')](function(_0x4562ec){pm2['dump']();return _0x4562ec[0x0];})['then'](respondWithResult(_0x6188a6,null))[_0xee47('0x12')](handleError(_0x6188a6,null));}else{return _0x6188a6[_0xee47('0x8')](0x1f4)[_0xee47('0xc')]({'message':_0xee47('0x24')});}};
\ No newline at end of file
+var _0x2915=['path','exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','index','reject','express','motion2','length','then','catch','show','describe','params','create','body','script','join','../../files/plugins','chdir','start','dump','update','restart','Unknown\x20status','delete','Unknown\x20id','../../config/logger'];(function(_0x27790c,_0x507d46){var _0x1e573b=function(_0x2275a8){while(--_0x2275a8){_0x27790c['push'](_0x27790c['shift']());}};_0x1e573b(++_0x507d46);}(_0x2915,0x13a));var _0x5291=function(_0xd4636c,_0x34dbf6){_0xd4636c=_0xd4636c-0x0;var _0x5ee17d=_0x2915[_0xd4636c];return _0x5ee17d;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x5291('0x0'))('api');var path=require(_0x5291('0x1'));var exec=require('child_process')[_0x5291('0x2')];var BPromise=require(_0x5291('0x3'));function handleEntityNotFound(_0x3adb8d,_0x5eb077){return function(_0x5a92b2){if(!_0x5a92b2){_0x3adb8d[_0x5291('0x4')](0x194);;}return _0x5a92b2;};}function respondWithResult(_0x2095b0,_0x576d57){_0x576d57=_0x576d57||0xc8;return function(_0x5d0e16){if(_0x5d0e16){return _0x2095b0[_0x5291('0x5')](_0x576d57)[_0x5291('0x6')](_0x5d0e16);}return null;};}function handleError(_0x196125,_0x55fb76){_0x55fb76=_0x55fb76||0x1f4;return function(_0xa80233){logger[_0x5291('0x7')](_0xa80233['stack']);if(_0xa80233[_0x5291('0x8')]){delete _0xa80233[_0x5291('0x8')];}_0x196125['status'](_0x55fb76)[_0x5291('0x9')](_0xa80233);};}function execChildProcess(){return new BPromise(function(_0x5794fa,_0x5ac3cc){exec(_0x5291('0xa'),function(_0x26e7a0,_0x399ba7,_0x5e715f){logger[_0x5291('0xb')](_0x399ba7);logger[_0x5291('0xb')](_0x5e715f);if(_0x26e7a0){logger[_0x5291('0x7')](_0x26e7a0);return _0x5ac3cc(_0x26e7a0);}return _0x5794fa(_0x399ba7);});});}exports[_0x5291('0xc')]=function(_0x3a3309,_0xc58a7d){return pm2['list']()['then'](function(_0x354a1a){if(_0x354a1a){var _0x283fd9=_[_0x5291('0xd')](_0x354a1a,function(_0x1bced0){return _0x1bced0['name']===_0x5291('0xe')||_0x1bced0[_0x5291('0x8')]===_0x5291('0xf');});return{'rows':_0x283fd9,'count':_0x283fd9[_0x5291('0x10')]};}return null;})[_0x5291('0x11')](respondWithResult(_0xc58a7d,null))[_0x5291('0x12')](handleError(_0xc58a7d,null));};exports[_0x5291('0x13')]=function(_0x1dff7a,_0x245617){return pm2[_0x5291('0x14')](_0x1dff7a[_0x5291('0x15')]['id'])['then'](respondWithResult(_0x245617,null))['then'](handleEntityNotFound(_0x245617,null))['catch'](handleError(_0x245617,null));};exports[_0x5291('0x16')]=function(_0x398f56,_0x30960f){if(_0x398f56[_0x5291('0x17')][_0x5291('0x8')]&&_0x398f56[_0x5291('0x17')][_0x5291('0x18')]){var _0x3534e2=path[_0x5291('0x19')](__dirname,_0x5291('0x1a'),_0x398f56[_0x5291('0x17')][_0x5291('0x18')]);var _0x2a6346=process['cwd']();process['chdir'](path['dirname'](_0x3534e2));return execChildProcess()['then'](function(_0x2ce91a){process[_0x5291('0x1b')](_0x2a6346);return pm2[_0x5291('0x1c')]({'name':_0x398f56['body'][_0x5291('0x8')],'script':_0x3534e2});})['then'](function(_0x2963fc){pm2[_0x5291('0x1d')]();return _0x2963fc[0x0];})['then'](respondWithResult(_0x30960f,0xc9))[_0x5291('0x12')](handleError(_0x30960f,null));}else{return _0x30960f['status'](0x1f4)[_0x5291('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x5291('0x1e')]=function(_0x421e09,_0x4d0665){if(_0x421e09[_0x5291('0x17')]['id']){delete _0x421e09[_0x5291('0x17')]['id'];}var _0x48db31={'online':_0x5291('0x1f'),'stopped':'stop'};if(_0x48db31['hasOwnProperty'](_0x421e09[_0x5291('0x17')][_0x5291('0x5')])){return pm2[_0x48db31[_0x421e09[_0x5291('0x17')][_0x5291('0x5')]]](_0x421e09[_0x5291('0x15')]['id'])[_0x5291('0x11')](respondWithResult(_0x4d0665,0xc8))[_0x5291('0x12')](handleError(_0x4d0665,null));}else{return _0x4d0665[_0x5291('0x5')](0x1f4)[_0x5291('0x9')]({'message':_0x5291('0x20')});}};exports['destroy']=function(_0x55b7f2,_0x1f1916){if(_0x55b7f2['body']['id']){delete _0x55b7f2[_0x5291('0x17')]['id'];}if(_0x55b7f2[_0x5291('0x15')]['id']){return pm2[_0x5291('0x21')](_0x55b7f2[_0x5291('0x15')]['id'])['then'](function(_0x186889){pm2['dump']();return _0x186889[0x0];})[_0x5291('0x11')](respondWithResult(_0x1f1916,null))[_0x5291('0x12')](handleError(_0x1f1916,null));}else{return _0x1f1916[_0x5291('0x5')](0x1f4)[_0x5291('0x9')]({'message':_0x5291('0x22')});}};
\ No newline at end of file
index 44507e2..a73c1cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ccc=['exports','multer','path','connect-timeout','express','Router','../../config/environment'];(function(_0x26986a,_0x168f62){var _0x361f12=function(_0x1df5dc){while(--_0x1df5dc){_0x26986a['push'](_0x26986a['shift']());}};_0x361f12(++_0x168f62);}(_0x5ccc,0x190));var _0xc5cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5ccc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc5cc('0x0'));var util=require('util');var path=require(_0xc5cc('0x1'));var timeout=require(_0xc5cc('0x2'));var express=require(_0xc5cc('0x3'));var router=express[_0xc5cc('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc5cc('0x5'));module[_0xc5cc('0x6')]=router;
\ No newline at end of file
+var _0xfcb4=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x330e70,_0x366811){var _0x470854=function(_0x504dcf){while(--_0x504dcf){_0x330e70['push'](_0x330e70['shift']());}};_0x470854(++_0x366811);}(_0xfcb4,0x1d5));var _0x4fcb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xfcb4[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4fcb('0x0'));var timeout=require('connect-timeout');var express=require(_0x4fcb('0x1'));var router=express[_0x4fcb('0x2')]();var auth=require(_0x4fcb('0x3'));var interaction=require(_0x4fcb('0x4'));var config=require(_0x4fcb('0x5'));module[_0x4fcb('0x6')]=router;
\ No newline at end of file
index 7d69a5c..30220eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61b3=['exports','INTEGER','DATE','STRING','sequelize'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x61b3,0xf4));var _0x361b=function(_0x42f8f9,_0x2d8757){_0x42f8f9=_0x42f8f9-0x0;var _0x4dae76=_0x61b3[_0x42f8f9];return _0x4dae76;};'use strict';var Sequelize=require(_0x361b('0x0'));module[_0x361b('0x1')]={'state':{'type':Sequelize[_0x361b('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x361b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x361b('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x361b('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x361b('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2a4e=['DATE','exports','INTEGER','STRING'];(function(_0x256439,_0x39a309){var _0x4f30fe=function(_0x48ed50){while(--_0x48ed50){_0x256439['push'](_0x256439['shift']());}};_0x4f30fe(++_0x39a309);}(_0x2a4e,0x119));var _0xe2a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a4e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xe2a4('0x0')]={'state':{'type':Sequelize[_0xe2a4('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xe2a4('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xe2a4('0x2')]},'starttime':{'type':Sequelize[_0xe2a4('0x3')]},'responsetime':{'type':Sequelize[_0xe2a4('0x3')]},'ringtime':{'type':Sequelize[_0xe2a4('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe2a4('0x2')]},'campaigntype':{'type':Sequelize[_0xe2a4('0x2')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 4ddda45..baa9d18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x109c=['../../config/logger','moment','bluebird','request-promise','path','./reportAgentPreview.attributes','exports','ReportAgentPreview','lodash','util'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0x109c,0x1de));var _0xc109=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x109c[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xc109('0x0'));var util=require(_0xc109('0x1'));var logger=require(_0xc109('0x2'))('api');var moment=require(_0xc109('0x3'));var BPromise=require(_0xc109('0x4'));var rp=require(_0xc109('0x5'));var fs=require('fs');var path=require(_0xc109('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc109('0x7'));module[_0xc109('0x8')]=function(_0x27c203,_0xbc906f){return _0x27c203['define'](_0xc109('0x9'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5efc=['rimraf','../../config/environment','exports','ReportAgentPreview','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0x5efc,0x1a6));var _0xc5ef=function(_0x27a28d,_0x1ee332){_0x27a28d=_0x27a28d-0x0;var _0x1552e9=_0x5efc[_0x27a28d];return _0x1552e9;};'use strict';var _=require(_0xc5ef('0x0'));var util=require('util');var logger=require(_0xc5ef('0x1'))(_0xc5ef('0x2'));var moment=require(_0xc5ef('0x3'));var BPromise=require(_0xc5ef('0x4'));var rp=require(_0xc5ef('0x5'));var fs=require('fs');var path=require(_0xc5ef('0x6'));var rimraf=require(_0xc5ef('0x7'));var config=require(_0xc5ef('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0xc5ef('0x9')]=function(_0xb1405,_0x50a742){return _0xb1405['define'](_0xc5ef('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 69eb81e..905f38f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d9a=['../../config/environment','client','http','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','ReportAgentPreview,\x20%s,\x20%s','message','result','CreateReportAgentPreview','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1e19bd,_0x70ca16){var _0x51192d=function(_0x513489){while(--_0x513489){_0x1e19bd['push'](_0x1e19bd['shift']());}};_0x51192d(++_0x70ca16);}(_0x6d9a,0xd7));var _0xa6d9=function(_0x28f7e7,_0x1459ca){_0x28f7e7=_0x28f7e7-0x0;var _0x157219=_0x6d9a[_0x28f7e7];return _0x157219;};'use strict';var _=require(_0xa6d9('0x0'));var util=require(_0xa6d9('0x1'));var moment=require(_0xa6d9('0x2'));var BPromise=require(_0xa6d9('0x3'));var rs=require(_0xa6d9('0x4'));var fs=require('fs');var Redis=require(_0xa6d9('0x5'));var db=require(_0xa6d9('0x6'))['db'];var utils=require(_0xa6d9('0x7'));var logger=require(_0xa6d9('0x8'))('rpc');var config=require(_0xa6d9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa6d9('0xa')][_0xa6d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x532b5f,_0x297aed,_0x3abe62){return new BPromise(function(_0x25dfc1,_0x59075b){return client[_0xa6d9('0xc')](_0x532b5f,_0x3abe62)[_0xa6d9('0xd')](function(_0x217413){logger[_0xa6d9('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x297aed,_0xa6d9('0xf'));logger[_0xa6d9('0x10')](_0xa6d9('0x11'),_0x297aed,_0xa6d9('0xf'),JSON[_0xa6d9('0x12')](_0x217413));if(_0x217413['error']){if(_0x217413[_0xa6d9('0x13')]['code']===0x1f4){logger[_0xa6d9('0x13')](_0xa6d9('0x14'),_0x297aed,_0x217413['error'][_0xa6d9('0x15')]);return _0x59075b(_0x217413[_0xa6d9('0x13')]['message']);}logger[_0xa6d9('0x13')](_0xa6d9('0x14'),_0x297aed,_0x217413['error']['message']);return _0x25dfc1(_0x217413['error'][_0xa6d9('0x15')]);}else{logger[_0xa6d9('0xe')](_0xa6d9('0x14'),_0x297aed,_0xa6d9('0xf'));_0x25dfc1(_0x217413[_0xa6d9('0x16')]['message']);}})['catch'](function(_0x4c6181){logger['error'](_0xa6d9('0x14'),_0x297aed,_0x4c6181);_0x59075b(_0x4c6181);});});}exports[_0xa6d9('0x17')]=function(_0x2104c1){var _0x1cc4fb=this;return new Promise(function(_0x254a69,_0x51421d){return db['ReportAgentPreview']['create'](_0x2104c1[_0xa6d9('0x18')],{'raw':_0x2104c1[_0xa6d9('0x19')]?_0x2104c1[_0xa6d9('0x19')][_0xa6d9('0x1a')]===undefined?!![]:![]:!![]})[_0xa6d9('0xd')](function(_0x46958f){logger[_0xa6d9('0xe')]('CreateReportAgentPreview',_0x2104c1);logger['debug'](_0xa6d9('0x17'),_0x2104c1,JSON[_0xa6d9('0x12')](_0x46958f));_0x254a69(_0x46958f);})[_0xa6d9('0x1b')](function(_0x255c06){logger[_0xa6d9('0x13')](_0xa6d9('0x17'),_0x255c06[_0xa6d9('0x15')],_0x2104c1);_0x51421d(_0x1cc4fb[_0xa6d9('0x13')](0x1f4,_0x255c06[_0xa6d9('0x15')]));});});};
\ No newline at end of file
+var _0xf6fc=['../../config/environment','client','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','then','stringify','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xf6fc,0x1a3));var _0xcf6f=function(_0x55b32a,_0x3bb7fa){_0x55b32a=_0x55b32a-0x0;var _0x2f3bb4=_0xf6fc[_0x55b32a];return _0x2f3bb4;};'use strict';var _=require(_0xcf6f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcf6f('0x1'));var fs=require('fs');var Redis=require(_0xcf6f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf6f('0x3'));var logger=require(_0xcf6f('0x4'))(_0xcf6f('0x5'));var config=require(_0xcf6f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcf6f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x66b2b0,_0x1a5a50,_0x4a84a8){return new BPromise(function(_0x409471,_0x201401){return client[_0xcf6f('0x8')](_0x66b2b0,_0x4a84a8)['then'](function(_0x1dd932){logger[_0xcf6f('0x9')](_0xcf6f('0xa'),_0x1a5a50,_0xcf6f('0xb'));logger[_0xcf6f('0xc')](_0xcf6f('0xd'),_0x1a5a50,_0xcf6f('0xb'),JSON['stringify'](_0x1dd932));if(_0x1dd932[_0xcf6f('0xe')]){if(_0x1dd932['error'][_0xcf6f('0xf')]===0x1f4){logger[_0xcf6f('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x1a5a50,_0x1dd932[_0xcf6f('0xe')][_0xcf6f('0x10')]);return _0x201401(_0x1dd932[_0xcf6f('0xe')][_0xcf6f('0x10')]);}logger['error'](_0xcf6f('0xa'),_0x1a5a50,_0x1dd932[_0xcf6f('0xe')]['message']);return _0x409471(_0x1dd932[_0xcf6f('0xe')][_0xcf6f('0x10')]);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x1a5a50,'request\x20sent');_0x409471(_0x1dd932['result'][_0xcf6f('0x10')]);}})[_0xcf6f('0x11')](function(_0x218b58){logger[_0xcf6f('0xe')](_0xcf6f('0xa'),_0x1a5a50,_0x218b58);_0x201401(_0x218b58);});});}exports[_0xcf6f('0x12')]=function(_0x23b5df){var _0x45068f=this;return new Promise(function(_0x1df05a,_0x592b6a){return db[_0xcf6f('0x13')][_0xcf6f('0x14')](_0x23b5df[_0xcf6f('0x15')],{'raw':_0x23b5df[_0xcf6f('0x16')]?_0x23b5df[_0xcf6f('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xcf6f('0x17')](function(_0x20ae57){logger[_0xcf6f('0x9')]('CreateReportAgentPreview',_0x23b5df);logger[_0xcf6f('0xc')]('CreateReportAgentPreview',_0x23b5df,JSON[_0xcf6f('0x18')](_0x20ae57));_0x1df05a(_0x20ae57);})[_0xcf6f('0x11')](function(_0x148046){logger[_0xcf6f('0xe')](_0xcf6f('0x12'),_0x148046[_0xcf6f('0x10')],_0x23b5df);_0x592b6a(_0x45068f[_0xcf6f('0xe')](0x1f4,_0x148046[_0xcf6f('0x10')]));});});};
\ No newline at end of file
index 6023a86..eda0064 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x795e=['showChatQueues','/fax/queues/:id','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','multer','path','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound/channels','outboundChannels','agents','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat'];(function(_0x6e7740,_0x3ef325){var _0x59d023=function(_0x2f74cb){while(--_0x2f74cb){_0x6e7740['push'](_0x6e7740['shift']());}};_0x59d023(++_0x3ef325);}(_0x795e,0x174));var _0xe795=function(_0x18ecb8,_0x113401){_0x18ecb8=_0x18ecb8-0x0;var _0xdc7567=_0x795e[_0x18ecb8];return _0xdc7567;};'use strict';var multer=require(_0xe795('0x0'));var util=require('util');var path=require(_0xe795('0x1'));var express=require('express');var router=express[_0xe795('0x2')]();var auth=require(_0xe795('0x3'));var controller=require('./rpc.controller');router[_0xe795('0x4')](_0xe795('0x5'),auth[_0xe795('0x6')](),controller['voiceChannels']);router[_0xe795('0x4')](_0xe795('0x7'),auth[_0xe795('0x6')](),controller[_0xe795('0x8')]);router['get'](_0xe795('0x9'),auth[_0xe795('0x6')](),controller[_0xe795('0xa')]);router[_0xe795('0x4')](_0xe795('0xb'),auth[_0xe795('0x6')](),controller[_0xe795('0xc')]);router[_0xe795('0x4')](_0xe795('0xd'),auth['isAuthenticated'](),controller[_0xe795('0xe')]);router[_0xe795('0x4')](_0xe795('0xf'),auth['isAuthenticated'](),controller['mailQueues']);router[_0xe795('0x4')]('/mail/accounts',auth['isAuthenticated'](),controller[_0xe795('0x10')]);router[_0xe795('0x4')](_0xe795('0x11'),auth['isAuthenticated'](),controller[_0xe795('0x12')]);router[_0xe795('0x4')](_0xe795('0x13'),auth[_0xe795('0x6')](),controller[_0xe795('0x14')]);router['get'](_0xe795('0x15'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0xe795('0x4')](_0xe795('0x16'),auth['isAuthenticated'](),controller[_0xe795('0x17')]);router[_0xe795('0x4')](_0xe795('0x18'),auth[_0xe795('0x6')](),controller[_0xe795('0x19')]);router[_0xe795('0x4')](_0xe795('0x1a'),auth[_0xe795('0x6')](),controller[_0xe795('0x1b')]);router['get']('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0xe795('0x1c')]);router[_0xe795('0x4')](_0xe795('0x1d'),auth[_0xe795('0x6')](),controller['voiceQueuesChannelHangup']);router[_0xe795('0x4')](_0xe795('0x1e'),auth[_0xe795('0x6')](),controller[_0xe795('0x1f')]);router[_0xe795('0x4')](_0xe795('0x20'),auth['isAuthenticated'](),controller[_0xe795('0x21')]);router[_0xe795('0x4')]('/outbound',auth['isAuthenticated'](),controller['outbound']);router[_0xe795('0x4')](_0xe795('0x22'),auth[_0xe795('0x6')](),controller[_0xe795('0x23')]);router['get']('/agents',auth[_0xe795('0x6')](),controller[_0xe795('0x24')]);router['put']('/agents/:id/capacity',auth[_0xe795('0x6')](),controller[_0xe795('0x25')]);router['get'](_0xe795('0x26'),auth[_0xe795('0x6')](),controller[_0xe795('0x27')]);router[_0xe795('0x4')](_0xe795('0x28'),auth['isAuthenticated'](),controller[_0xe795('0x29')]);router['get'](_0xe795('0x2a'),auth[_0xe795('0x6')](),controller['campaigns']);router[_0xe795('0x4')](_0xe795('0x2b'),auth[_0xe795('0x6')](),controller[_0xe795('0x2c')]);router['get'](_0xe795('0x2d'),auth[_0xe795('0x6')](),controller['chatQueuesWaitingInteractions']);router['get']('/mail/queues/waitinginteractions',auth[_0xe795('0x6')](),controller[_0xe795('0x2e')]);router[_0xe795('0x4')](_0xe795('0x2f'),auth[_0xe795('0x6')](),controller[_0xe795('0x30')]);router['get'](_0xe795('0x31'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router['get'](_0xe795('0x32'),auth[_0xe795('0x6')](),controller[_0xe795('0x33')]);router[_0xe795('0x4')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xe795('0x34')]);router[_0xe795('0x35')](_0xe795('0x36'),auth[_0xe795('0x6')](),controller[_0xe795('0x37')]('mail'));router[_0xe795('0x4')](_0xe795('0x38'),auth[_0xe795('0x6')](),controller[_0xe795('0x39')]);router['post'](_0xe795('0x3a'),auth['isAuthenticated'](),controller[_0xe795('0x37')](_0xe795('0x3b')));router[_0xe795('0x4')]('/chat/queues/:id',auth[_0xe795('0x6')](),controller[_0xe795('0x3c')]);router[_0xe795('0x35')]('/fax/queues/:id/notify',auth[_0xe795('0x6')](),controller[_0xe795('0x37')]('fax'));router[_0xe795('0x4')](_0xe795('0x3d'),auth[_0xe795('0x6')](),controller['showFaxQueues']);router[_0xe795('0x35')](_0xe795('0x3e'),auth[_0xe795('0x6')](),controller[_0xe795('0x37')]('openchannel'));router[_0xe795('0x4')](_0xe795('0x3f'),auth[_0xe795('0x6')](),controller[_0xe795('0x40')]);router[_0xe795('0x35')](_0xe795('0x41'),auth['isAuthenticated'](),controller['queueNotify'](_0xe795('0x42')));router[_0xe795('0x35')](_0xe795('0x43'),auth[_0xe795('0x6')](),controller[_0xe795('0x37')]('whatsapp'));router[_0xe795('0x4')](_0xe795('0x44'),auth[_0xe795('0x6')](),controller['showSmsQueues']);router[_0xe795('0x4')](_0xe795('0x45'),auth[_0xe795('0x6')](),controller['showWhatsappQueues']);router[_0xe795('0x35')](_0xe795('0x46'),auth[_0xe795('0x6')](),controller[_0xe795('0x47')]);module['exports']=router;
\ No newline at end of file
+var _0xf22d=['/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','outbound','/outbound/channels','outboundChannels','/agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','queueNotify','mail','/mail/queues/:id','post','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel'];(function(_0x48dfb3,_0x4c9908){var _0x511daa=function(_0x51f2e5){while(--_0x51f2e5){_0x48dfb3['push'](_0x48dfb3['shift']());}};_0x511daa(++_0x4c9908);}(_0xf22d,0x1d3));var _0xdf22=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0xf22d[_0x512c83];return _0x1f7f25;};'use strict';var multer=require(_0xdf22('0x0'));var util=require(_0xdf22('0x1'));var path=require(_0xdf22('0x2'));var express=require(_0xdf22('0x3'));var router=express[_0xdf22('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0xdf22('0x5'));router['get'](_0xdf22('0x6'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x8')]);router[_0xdf22('0x9')](_0xdf22('0xa'),auth[_0xdf22('0x7')](),controller[_0xdf22('0xb')]);router['get'](_0xdf22('0xc'),auth[_0xdf22('0x7')](),controller[_0xdf22('0xd')]);router['get'](_0xdf22('0xe'),auth[_0xdf22('0x7')](),controller[_0xdf22('0xf')]);router['get']('/chat/queues',auth[_0xdf22('0x7')](),controller[_0xdf22('0x10')]);router[_0xdf22('0x9')](_0xdf22('0x11'),auth['isAuthenticated'](),controller['mailQueues']);router[_0xdf22('0x9')]('/mail/accounts',auth['isAuthenticated'](),controller[_0xdf22('0x12')]);router[_0xdf22('0x9')](_0xdf22('0x13'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x14')]);router[_0xdf22('0x9')](_0xdf22('0x15'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x16')]);router[_0xdf22('0x9')]('/whatsapp/queues',auth[_0xdf22('0x7')](),controller[_0xdf22('0x17')]);router[_0xdf22('0x9')](_0xdf22('0x18'),auth['isAuthenticated'](),controller[_0xdf22('0x19')]);router[_0xdf22('0x9')](_0xdf22('0x1a'),auth['isAuthenticated'](),controller[_0xdf22('0x1b')]);router[_0xdf22('0x9')]('/voice/queues/channels',auth[_0xdf22('0x7')](),controller[_0xdf22('0x1c')]);router[_0xdf22('0x9')](_0xdf22('0x1d'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x1e')]);router['get'](_0xdf22('0x1f'),auth['isAuthenticated'](),controller[_0xdf22('0x20')]);router['get'](_0xdf22('0x21'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x22')]);router[_0xdf22('0x9')](_0xdf22('0x23'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x24')]);router[_0xdf22('0x9')]('/outbound',auth[_0xdf22('0x7')](),controller[_0xdf22('0x25')]);router[_0xdf22('0x9')](_0xdf22('0x26'),auth['isAuthenticated'](),controller[_0xdf22('0x27')]);router[_0xdf22('0x9')](_0xdf22('0x28'),auth['isAuthenticated'](),controller['agents']);router[_0xdf22('0x29')](_0xdf22('0x2a'),auth['isAuthenticated'](),controller[_0xdf22('0x2b')]);router[_0xdf22('0x9')](_0xdf22('0x2c'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x2d')]);router[_0xdf22('0x9')](_0xdf22('0x2e'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x2f')]);router[_0xdf22('0x9')](_0xdf22('0x30'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x31')]);router['get']('/fax/accounts',auth[_0xdf22('0x7')](),controller[_0xdf22('0x32')]);router[_0xdf22('0x9')]('/chat/queues/waitinginteractions',auth[_0xdf22('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0xdf22('0x9')](_0xdf22('0x33'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x34')]);router['get'](_0xdf22('0x35'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x36')]);router[_0xdf22('0x9')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xdf22('0x37')]);router[_0xdf22('0x9')](_0xdf22('0x38'),auth['isAuthenticated'](),controller[_0xdf22('0x39')]);router[_0xdf22('0x9')](_0xdf22('0x3a'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x3b')]);router['post']('/mail/queues/:id/notify',auth[_0xdf22('0x7')](),controller[_0xdf22('0x3c')](_0xdf22('0x3d')));router[_0xdf22('0x9')](_0xdf22('0x3e'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0xdf22('0x3f')]('/chat/queues/:id/notify',auth[_0xdf22('0x7')](),controller[_0xdf22('0x3c')](_0xdf22('0x40')));router[_0xdf22('0x9')]('/chat/queues/:id',auth[_0xdf22('0x7')](),controller[_0xdf22('0x41')]);router[_0xdf22('0x3f')](_0xdf22('0x42'),auth[_0xdf22('0x7')](),controller['queueNotify'](_0xdf22('0x43')));router[_0xdf22('0x9')](_0xdf22('0x44'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x45')]);router['post'](_0xdf22('0x46'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x3c')](_0xdf22('0x47')));router[_0xdf22('0x9')]('/openchannel/queues/:id',auth[_0xdf22('0x7')](),controller[_0xdf22('0x48')]);router[_0xdf22('0x3f')](_0xdf22('0x49'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x3c')]('sms'));router[_0xdf22('0x3f')](_0xdf22('0x4a'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x3c')](_0xdf22('0x4b')));router[_0xdf22('0x9')](_0xdf22('0x4c'),auth['isAuthenticated'](),controller[_0xdf22('0x4d')]);router[_0xdf22('0x9')](_0xdf22('0x4e'),auth[_0xdf22('0x7')](),controller[_0xdf22('0x4f')]);router[_0xdf22('0x3f')](_0xdf22('0x50'),auth['isAuthenticated'](),controller[_0xdf22('0x51')]);module[_0xdf22('0x52')]=router;
\ No newline at end of file
index 0ccfee8..5127730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15ae=['queue','queueTransferTimeout','*,*,*,*','agentNotify','Agent\x20not\x20found','update','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','voiceChannels','VoiceChannels','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','showVoiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','Agents','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','interface','SIP/%s','agent','internal','capacity','telephones','Telephones','trunks','campaigns','Campaigns','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Queue','findOne','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','TransferReport','Start'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x15ae,0x15d));var _0xe15a=function(_0x150b65,_0xbb6a2f){_0x150b65=_0x150b65-0x0;var _0x1194dc=_0x15ae[_0x150b65];return _0x1194dc;};'use strict';var BPromise=require(_0xe15a('0x0'));var moment=require(_0xe15a('0x1'));var _=require(_0xe15a('0x2'));var util=require(_0xe15a('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xe15a('0x4'))(_0xe15a('0x5'));var jayson=require(_0xe15a('0x6'));var amiClient=jayson[_0xe15a('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0xe15a('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0xe15a('0x7')][_0xe15a('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x9a88a1,_0x4bff22,_0x17aceb){return new BPromise(function(_0x55c8f8,_0x1c9fce){var _0x328a34=_0x17aceb?_0x17aceb:amiClient;return _0x328a34[_0xe15a('0x9')](_0x9a88a1,_0x4bff22)[_0xe15a('0xa')](function(_0x2fcfab){if(_0x2fcfab[_0xe15a('0xb')]){if(_0x2fcfab[_0xe15a('0xb')][_0xe15a('0xc')]===0x1f4){return _0x1c9fce(_0x2fcfab[_0xe15a('0xb')]['message']);}return _0x55c8f8(_0x2fcfab[_0xe15a('0xb')][_0xe15a('0xd')]);}else{_0x55c8f8(_0x2fcfab[_0xe15a('0xe')]);}})[_0xe15a('0xf')](function(_0x32c20c){_0x1c9fce(_0x32c20c);});});}function respondWithResult(_0x4df2af,_0x17705c){_0x17705c=_0x17705c||0xc8;return function(_0x3108e4){if(_0x3108e4){return _0x4df2af[_0xe15a('0x10')](_0x17705c)[_0xe15a('0x11')](_0x3108e4);}return _0x4df2af[_0xe15a('0x12')](0x194);};}function handleError(_0x1b38f3,_0x54d51a){_0x54d51a=_0x54d51a||0x1f4;return function(_0x4e23b0){logger['error'](_0x4e23b0[_0xe15a('0x13')]);if(_0x4e23b0[_0xe15a('0x14')]){delete _0x4e23b0[_0xe15a('0x14')];}_0x1b38f3[_0xe15a('0x10')](_0x54d51a)[_0xe15a('0x15')](_0x4e23b0);};}function findById(_0x3807d1){return function(_0x53fce3){if(!_[_0xe15a('0x16')](_0x3807d1)&&!_[_0xe15a('0x16')](_0x53fce3)&&!_[_0xe15a('0x16')](_0x53fce3['rows'])){return _[_0xe15a('0x17')](_0x53fce3['rows'],function(_0x594ded){return _0x594ded['id']==_0x3807d1;});}return null;};}exports[_0xe15a('0x18')]=function(_0xe22a3f,_0x555434){return respondWithRpcPromise(_0xe15a('0x19'),_0xe22a3f['query'])[_0xe15a('0xa')](respondWithResult(_0x555434,null))['catch'](handleError(_0x555434,null));};exports['voiceChannelMixMonitor']=function(_0x52b665,_0x34f9fc){return respondWithRpcPromise(_0xe15a('0x1a'),_[_0xe15a('0x1b')](_0x52b665[_0xe15a('0x1c')],_0x52b665[_0xe15a('0x1d')]))[_0xe15a('0xa')](respondWithResult(_0x34f9fc,null))[_0xe15a('0xf')](handleError(_0x34f9fc,null));};exports[_0xe15a('0x1e')]=function(_0x18d698,_0x4e4389){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xe15a('0x1b')](_0x18d698['query'],_0x18d698[_0xe15a('0x1d')]))['then'](respondWithResult(_0x4e4389,null))[_0xe15a('0xf')](handleError(_0x4e4389,null));};exports['voiceQueues']=function(_0x3f2b82,_0x274099){return respondWithRpcPromise('VoiceQueues',_0x3f2b82[_0xe15a('0x1c')])[_0xe15a('0xa')](respondWithResult(_0x274099,null))[_0xe15a('0xf')](handleError(_0x274099,null));};exports[_0xe15a('0x1f')]=function(_0x11511d,_0x1a1302){return respondWithRpcPromise(_0xe15a('0x20'),_0x11511d['query'])[_0xe15a('0xa')](findById(_0x11511d[_0xe15a('0x1d')]['id']))[_0xe15a('0xa')](respondWithResult(_0x1a1302,null))['catch'](handleError(_0x1a1302,null));};exports[_0xe15a('0x21')]=function(_0x10522e,_0x524786){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xe15a('0x1b')](_0x10522e[_0xe15a('0x1c')],_0x10522e[_0xe15a('0x1d')]))['then'](respondWithResult(_0x524786,null))[_0xe15a('0xf')](handleError(_0x524786,null));};exports['voiceQueuesChannels']=function(_0x258843,_0x383e4b){return respondWithRpcPromise(_0xe15a('0x22'),_0x258843['query'])['then'](respondWithResult(_0x383e4b,null))[_0xe15a('0xf')](handleError(_0x383e4b,null));};exports[_0xe15a('0x23')]=function(_0x5cd101,_0x35a59e){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xe15a('0x1b')](_0x5cd101['query'],_0x5cd101[_0xe15a('0x1d')]))['then'](respondWithResult(_0x35a59e,null))[_0xe15a('0xf')](handleError(_0x35a59e,null));};exports[_0xe15a('0x24')]=function(_0x3441ef,_0x3308f6){return respondWithRpcPromise(_0xe15a('0x25'),_['merge'](_0x3441ef[_0xe15a('0x1c')],_0x3441ef['params']))[_0xe15a('0xa')](respondWithResult(_0x3308f6,null))['catch'](handleError(_0x3308f6,null));};exports[_0xe15a('0x26')]=function(_0x222dbb,_0x37c820){return respondWithRpcPromise(_0xe15a('0x27'),_['merge'](_0x222dbb[_0xe15a('0x1c')],_0x222dbb['params']))[_0xe15a('0xa')](respondWithResult(_0x37c820,null))[_0xe15a('0xf')](handleError(_0x37c820,null));};exports['outbound']=function(_0x173c08,_0x2a55ad){return respondWithRpcPromise(_0xe15a('0x28'),_0x173c08[_0xe15a('0x1c')])[_0xe15a('0xa')](respondWithResult(_0x2a55ad,null))[_0xe15a('0xf')](handleError(_0x2a55ad,null));};exports['outboundChannels']=function(_0x51b267,_0x1ec462){return respondWithRpcPromise('OutboundChannels',_0x51b267[_0xe15a('0x1c')])[_0xe15a('0xa')](respondWithResult(_0x1ec462,null))['catch'](handleError(_0x1ec462,null));};exports['agents']=function(_0x39228c,_0x5a0087){var _0x1fd780;return respondWithRpcPromise(_0xe15a('0x29'),_0x39228c['query'])['then'](function(_0x2e3b78){_0x1fd780=_0x2e3b78;return respondWithRpcPromise(_0xe15a('0x29'),_0x39228c[_0xe15a('0x1c')],routingClient);})[_0xe15a('0xa')](function(_0x475148){return _['merge']({},_0x475148,_0x1fd780);})['then'](respondWithResult(_0x5a0087,null))[_0xe15a('0xf')](handleError(_0x5a0087,null));};exports['agentCapacity']=function(_0x20f293,_0x384a96){if(_0x20f293[_0xe15a('0x2a')]&&_0x20f293['body'][_0xe15a('0x2b')]&&_0x20f293[_0xe15a('0x2c')]&&_0x20f293[_0xe15a('0x2c')][_0xe15a('0x14')]){for(var _0x13aaeb in _0x20f293['body'][_0xe15a('0x2b')]){if(_0x20f293['body']['interaction'][_0xe15a('0x2d')](_0x13aaeb)){db[_0xe15a('0x2e')][_0xe15a('0x2f')]({'where':{'channel':_0x13aaeb,'membername':_0x20f293[_0xe15a('0x2c')][_0xe15a('0x14')],'type':_0xe15a('0x30'),'exitAt':null,'uniqueid':_0x20f293['body'][_0xe15a('0x2b')][_0x13aaeb]&&_0x20f293[_0xe15a('0x2a')][_0xe15a('0x2b')][_0x13aaeb][_0xe15a('0x31')]?{'$notIn':_0x20f293['body'][_0xe15a('0x2b')][_0x13aaeb]}:{'$ne':null}}})[_0xe15a('0xa')](function(_0x19f1f8){var _0x534e9d=moment()[_0xe15a('0x32')](_0xe15a('0x33'));for(var _0x42ba5d=0x0,_0x25b69f=_0x19f1f8[_0xe15a('0x31')];_0x42ba5d<_0x25b69f;_0x42ba5d+=0x1){_0x19f1f8[_0x42ba5d]['updateAttributes']({'exitAt':_0x534e9d});}});for(var _0x4380d1=0x0;_0x4380d1<_0x20f293[_0xe15a('0x2a')][_0xe15a('0x2b')][_0x13aaeb][_0xe15a('0x31')];_0x4380d1+=0x1){db[_0xe15a('0x2e')]['findOrCreate']({'where':{'channel':_0x13aaeb,'membername':_0x20f293[_0xe15a('0x2c')]['name'],'type':_0xe15a('0x30'),'uniqueid':_0x20f293[_0xe15a('0x2a')][_0xe15a('0x2b')][_0x13aaeb][_0x4380d1],'exitAt':null},'defaults':{'channel':_0x13aaeb,'membername':_0x20f293[_0xe15a('0x2c')][_0xe15a('0x14')],'interface':_[_0xe15a('0x16')](_0x20f293[_0xe15a('0x2c')][_0xe15a('0x34')])?util[_0xe15a('0x32')](_0xe15a('0x35'),_0x20f293[_0xe15a('0x2c')][_0xe15a('0x14')]):_0x20f293[_0xe15a('0x2c')][_0xe15a('0x34')],'type':_0xe15a('0x30'),'enterAt':moment()[_0xe15a('0x32')](_0xe15a('0x33')),'role':_0xe15a('0x36'),'internal':_0x20f293[_0xe15a('0x2c')][_0xe15a('0x37')],'uniqueid':_0x20f293[_0xe15a('0x2a')][_0xe15a('0x2b')][_0x13aaeb][_0x4380d1]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x20f293[_0xe15a('0x1d')]['id'],'capacity':_0x20f293[_0xe15a('0x2a')][_0xe15a('0x38')]},routingClient)[_0xe15a('0xa')](respondWithResult(_0x384a96,null))['catch'](handleError(_0x384a96,null));};exports[_0xe15a('0x39')]=function(_0x1da9e9,_0x7df456){return respondWithRpcPromise(_0xe15a('0x3a'),_0x1da9e9[_0xe15a('0x1c')])[_0xe15a('0xa')](respondWithResult(_0x7df456,null))[_0xe15a('0xf')](handleError(_0x7df456,null));};exports[_0xe15a('0x3b')]=function(_0x1c4c64,_0x8ba52c){return respondWithRpcPromise('Trunks',_0x1c4c64[_0xe15a('0x1c')])[_0xe15a('0xa')](respondWithResult(_0x8ba52c,null))[_0xe15a('0xf')](handleError(_0x8ba52c,null));};exports[_0xe15a('0x3c')]=function(_0x5c6c5d,_0x48177b){return respondWithRpcPromise(_0xe15a('0x3d'),_0x5c6c5d['query'])[_0xe15a('0xa')](respondWithResult(_0x48177b,null))[_0xe15a('0xf')](handleError(_0x48177b,null));};exports['chatQueues']=function(_0x3a0192,_0x15af2c){return respondWithRpcPromise(_0xe15a('0x3e'),_0x3a0192[_0xe15a('0x1c')],routingClient)[_0xe15a('0xa')](respondWithResult(_0x15af2c,null))[_0xe15a('0xf')](handleError(_0x15af2c,null));};exports[_0xe15a('0x3f')]=function(_0x134219,_0x368e9c){return respondWithRpcPromise(_0xe15a('0x3e'),_0x134219[_0xe15a('0x1c')],routingClient)[_0xe15a('0xa')](findById(_0x134219['params']['id']))['then'](respondWithResult(_0x368e9c,null))[_0xe15a('0xf')](handleError(_0x368e9c,null));};exports[_0xe15a('0x40')]=function(_0x89215d,_0x1eeb27){return respondWithRpcPromise('MailQueues',_0x89215d[_0xe15a('0x1c')],routingClient)[_0xe15a('0xa')](respondWithResult(_0x1eeb27,null))[_0xe15a('0xf')](handleError(_0x1eeb27,null));};exports[_0xe15a('0x41')]=function(_0x41623b,_0x236b15){return respondWithRpcPromise(_0xe15a('0x42'),_0x41623b[_0xe15a('0x1c')],routingClient)['then'](findById(_0x41623b[_0xe15a('0x1d')]['id']))[_0xe15a('0xa')](respondWithResult(_0x236b15,null))[_0xe15a('0xf')](handleError(_0x236b15,null));};exports[_0xe15a('0x43')]=function(_0x181341,_0x1a48bd){return respondWithRpcPromise(_0xe15a('0x44'),_0x181341[_0xe15a('0x1c')],mailClient)['then'](respondWithResult(_0x1a48bd,null))[_0xe15a('0xf')](handleError(_0x1a48bd,null));};exports[_0xe15a('0x45')]=function(_0x149b24,_0x4332a8){return respondWithRpcPromise(_0xe15a('0x46'),_0x149b24[_0xe15a('0x1c')],routingClient)[_0xe15a('0xa')](respondWithResult(_0x4332a8,null))[_0xe15a('0xf')](handleError(_0x4332a8,null));};exports['showOpenchannelQueues']=function(_0x212341,_0x3568be){return respondWithRpcPromise(_0xe15a('0x46'),_0x212341[_0xe15a('0x1c')],routingClient)['then'](findById(_0x212341['params']['id']))[_0xe15a('0xa')](respondWithResult(_0x3568be,null))[_0xe15a('0xf')](handleError(_0x3568be,null));};exports[_0xe15a('0x47')]=function(_0xc65be6,_0x2954b0){return respondWithRpcPromise(_0xe15a('0x48'),_0xc65be6[_0xe15a('0x1c')],routingClient)[_0xe15a('0xa')](respondWithResult(_0x2954b0,null))[_0xe15a('0xf')](handleError(_0x2954b0,null));};exports[_0xe15a('0x49')]=function(_0x4870e5,_0x812475){return respondWithRpcPromise('SmsQueues',_0x4870e5[_0xe15a('0x1c')],routingClient)[_0xe15a('0xa')](findById(_0x4870e5['params']['id']))[_0xe15a('0xa')](respondWithResult(_0x812475,null))[_0xe15a('0xf')](handleError(_0x812475,null));};exports[_0xe15a('0x4a')]=function(_0x15d008,_0x14013c){return respondWithRpcPromise('WhatsappQueues',_0x15d008['query'],routingClient)['then'](respondWithResult(_0x14013c,null))[_0xe15a('0xf')](handleError(_0x14013c,null));};exports[_0xe15a('0x4b')]=function(_0x3eb769,_0x671f2a){return respondWithRpcPromise(_0xe15a('0x4c'),_0x3eb769[_0xe15a('0x1c')],routingClient)[_0xe15a('0xa')](findById(_0x3eb769[_0xe15a('0x1d')]['id']))[_0xe15a('0xa')](respondWithResult(_0x671f2a,null))[_0xe15a('0xf')](handleError(_0x671f2a,null));};exports[_0xe15a('0x4d')]=function(_0x1cf1ee,_0x2087aa){return respondWithRpcPromise('FaxQueues',_0x1cf1ee[_0xe15a('0x1c')],routingClient)['then'](respondWithResult(_0x2087aa,null))[_0xe15a('0xf')](handleError(_0x2087aa,null));};exports[_0xe15a('0x4e')]=function(_0x2806a8,_0x41b4d9){return respondWithRpcPromise('FaxQueues',_0x2806a8[_0xe15a('0x1c')],routingClient)[_0xe15a('0xa')](findById(_0x2806a8[_0xe15a('0x1d')]['id']))[_0xe15a('0xa')](respondWithResult(_0x41b4d9,null))[_0xe15a('0xf')](handleError(_0x41b4d9,null));};exports[_0xe15a('0x4f')]=function(_0x84003b,_0x1e7fdd){return respondWithRpcPromise('FaxAccounts',_0x84003b['query'])[_0xe15a('0xa')](respondWithResult(_0x1e7fdd,null))['catch'](handleError(_0x1e7fdd,null));};exports['chatQueuesWaitingInteractions']=function(_0x46e6dc,_0x140583){return respondWithRpcPromise(_0xe15a('0x50'),_0x46e6dc['query'],routingClient)[_0xe15a('0xa')](respondWithResult(_0x140583,null))[_0xe15a('0xf')](handleError(_0x140583,null));};exports[_0xe15a('0x51')]=function(_0xf4dc4e,_0x422a08){return respondWithRpcPromise(_0xe15a('0x52'),_0xf4dc4e[_0xe15a('0x1c')],routingClient)[_0xe15a('0xa')](respondWithResult(_0x422a08,null))[_0xe15a('0xf')](handleError(_0x422a08,null));};exports[_0xe15a('0x53')]=function(_0x583fea,_0x5b495d){return respondWithRpcPromise(_0xe15a('0x54'),_0x583fea[_0xe15a('0x1c')],routingClient)[_0xe15a('0xa')](respondWithResult(_0x5b495d,null))['catch'](handleError(_0x5b495d,null));};exports[_0xe15a('0x55')]=function(_0x3b914a,_0x5d6874){return respondWithRpcPromise(_0xe15a('0x56'),_0x3b914a[_0xe15a('0x1c')],routingClient)['then'](respondWithResult(_0x5d6874,null))[_0xe15a('0xf')](handleError(_0x5d6874,null));};exports[_0xe15a('0x57')]=function(_0x4a66c7,_0x1fe6cf){return respondWithRpcPromise(_0xe15a('0x58'),_0x4a66c7[_0xe15a('0x1c')],routingClient)[_0xe15a('0xa')](respondWithResult(_0x1fe6cf,null))[_0xe15a('0xf')](handleError(_0x1fe6cf,null));};exports[_0xe15a('0x59')]=function(_0x26b494,_0x3d92da){return respondWithRpcPromise(_0xe15a('0x5a'),_0x26b494['query'],routingClient)['then'](respondWithResult(_0x3d92da,null))['catch'](handleError(_0x3d92da,null));};exports['queueNotify']=function(_0x257d4a){return function(_0x2ea253,_0x3cc67b){var _0x4afb0f,_0x49d5c3;var _0xe52bd7=_[_0xe15a('0x5b')](_0x257d4a);var _0x3ad050=_0x257d4a===_0xe15a('0x5c')?_0xe15a('0x5d'):'Account';return db[_0xe52bd7+_0xe15a('0x5e')][_0xe15a('0x5f')]({'raw':!![],'where':{'id':_0x2ea253['params']['id']}})[_0xe15a('0xa')](function(_0x42a442){if(_[_0xe15a('0x16')](_0x42a442)){throw new Error(_0xe52bd7+'\x20Queue\x20not\x20found');}_0x4afb0f=_0x42a442;return db[_0xe52bd7+_0xe15a('0x60')][_0xe15a('0x5f')]({'where':{'id':_0x2ea253[_0xe15a('0x2a')][_0xe15a('0x61')]},'include':[{'model':db[_0xe52bd7+_0xe15a('0x62')],'as':'Interaction'},{'model':db[_0xe52bd7+_0x3ad050],'as':_0xe15a('0x63')}]});})['then'](function(_0x39100b){if(_[_0xe15a('0x16')](_0x39100b)){throw new Error(_0xe52bd7+_0xe15a('0x64'));}_0x49d5c3=_0x39100b;return _0x39100b['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xe15a('0xa')](function(){var _0x3c86e9={'uniqueid':_0x257d4a+'.'+_0x49d5c3['id']+'.'+_0x49d5c3[_0xe15a('0x62')]['id'],'FromUserId':_0x2ea253['user']['id'],'type':'queue'};_0x3c86e9[_0xe52bd7+_0xe15a('0x65')]=_0x49d5c3['id'];_0x3c86e9[_0xe52bd7+_0xe15a('0x66')]=_0x49d5c3[_0xe15a('0x62')]['id'];_0x3c86e9[_0xe15a('0x67')+_0xe52bd7+_0x3ad050+'Id']=_0x49d5c3[_0xe15a('0x63')]['id'];_0x3c86e9['To'+_0xe52bd7+_0xe15a('0x68')]=_0x4afb0f['id'];return db[_0xe52bd7+_0xe15a('0x69')]['create'](_0x3c86e9);})[_0xe15a('0xa')](function(){return respondWithRpcPromise(_0xe15a('0x6a'),{'channel':_0x257d4a,'interaction':_0x49d5c3['Interaction'],'message':_0x49d5c3,'account':_0x49d5c3['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xe15a('0x6b'),'appdata':_0x4afb0f['name']+','+(_0x49d5c3[_0xe15a('0x63')][_0xe15a('0x6c')]||0x12c),'interval':_0xe15a('0x6d')}]},routingClient);})['then'](respondWithResult(_0x3cc67b,null))[_0xe15a('0xf')](handleError(_0x3cc67b,null));};};exports[_0xe15a('0x6e')]=function(_0x3e9543,_0x517c45){var _0x536871,_0x595d35;if(_['isNil'](_0x3e9543[_0xe15a('0x2a')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x53553e=_0x3e9543[_0xe15a('0x2a')]['channel'];var _0x4802bc=_[_0xe15a('0x5b')](_0x53553e);var _0x2c821f=_0x53553e===_0xe15a('0x5c')?_0xe15a('0x5d'):_0xe15a('0x63');return db['User'][_0xe15a('0x5f')]({'raw':!![],'where':{'id':_0x3e9543[_0xe15a('0x1d')]['id'],'role':_0xe15a('0x36')}})[_0xe15a('0xa')](function(_0x3ce24e){if(_[_0xe15a('0x16')](_0x3ce24e)){throw new Error(_0xe15a('0x6f'));}_0x536871=_0x3ce24e;return db[_0x4802bc+'Message'][_0xe15a('0x5f')]({'where':{'id':_0x3e9543[_0xe15a('0x2a')][_0xe15a('0x61')]},'include':[{'model':db[_0x4802bc+_0xe15a('0x62')],'as':_0xe15a('0x62')},{'model':db[_0x4802bc+_0x2c821f],'as':_0xe15a('0x63')}]});})['then'](function(_0x12b29f){if(_[_0xe15a('0x16')](_0x12b29f)){throw new Error(_0x4802bc+_0xe15a('0x64'));}_0x595d35=_0x12b29f;return _0x12b29f[_0xe15a('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe15a('0xa')](function(){var _0x1c4682={'uniqueid':_0x53553e+'.'+_0x595d35['id']+'.'+_0x595d35[_0xe15a('0x62')]['id'],'FromUserId':_0x3e9543[_0xe15a('0x2c')]['id'],'type':_0xe15a('0x6b'),'ToUserId':_0x536871['id']};_0x1c4682[_0x4802bc+'MessageId']=_0x595d35['id'];_0x1c4682[_0x4802bc+_0xe15a('0x66')]=_0x595d35[_0xe15a('0x62')]['id'];_0x1c4682[_0xe15a('0x67')+_0x4802bc+_0x2c821f+'Id']=_0x595d35[_0xe15a('0x63')]['id'];return db[_0x4802bc+_0xe15a('0x69')]['create'](_0x1c4682);})[_0xe15a('0xa')](function(){return respondWithRpcPromise(_0xe15a('0x6a'),{'channel':_0x53553e,'interaction':_0x595d35['Interaction'],'message':_0x595d35,'account':_0x595d35['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xe15a('0x36'),'appdata':_0x536871[_0xe15a('0x14')]+','+(_0x595d35[_0xe15a('0x63')][_0xe15a('0x71')]||0x12c),'interval':_0xe15a('0x6d')}]},routingClient);})[_0xe15a('0xa')](respondWithResult(_0x517c45,null))[_0xe15a('0xf')](handleError(_0x517c45,null));};
\ No newline at end of file
+var _0x1f7d=['chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','Interaction','Account','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','TransferReport','create','*,*,*,*','agentNotify','channel','User','Agent\x20not\x20found','Message','queue','Start','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','catch','json','sendStatus','stack','name','send','isNil','rows','find','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','hasOwnProperty','MemberReport','findAll','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','format','agent','AgentCapacity','capacity','Telephones','trunks','campaigns','Campaigns'];(function(_0x1d7492,_0x34abc1){var _0xc17b6d=function(_0x11e13a){while(--_0x11e13a){_0x1d7492['push'](_0x1d7492['shift']());}};_0xc17b6d(++_0x34abc1);}(_0x1f7d,0xa2));var _0xd1f7=function(_0x2bd4c3,_0x407026){_0x2bd4c3=_0x2bd4c3-0x0;var _0x18ee4d=_0x1f7d[_0x2bd4c3];return _0x18ee4d;};'use strict';var BPromise=require('bluebird');var moment=require(_0xd1f7('0x0'));var _=require(_0xd1f7('0x1'));var util=require('util');var db=require(_0xd1f7('0x2'))['db'];var logger=require(_0xd1f7('0x3'))(_0xd1f7('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0xd1f7('0x5')]['http']({'port':0x232a});var mailClient=jayson[_0xd1f7('0x5')]['http']({'port':0x232b});var routingClient=jayson['client'][_0xd1f7('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x57493c,_0xdcc065,_0x5c6aa4){return new BPromise(function(_0x5396ea,_0x285b48){var _0x42f647=_0x5c6aa4?_0x5c6aa4:amiClient;return _0x42f647[_0xd1f7('0x7')](_0x57493c,_0xdcc065)[_0xd1f7('0x8')](function(_0x16a96b){if(_0x16a96b[_0xd1f7('0x9')]){if(_0x16a96b[_0xd1f7('0x9')][_0xd1f7('0xa')]===0x1f4){return _0x285b48(_0x16a96b[_0xd1f7('0x9')][_0xd1f7('0xb')]);}return _0x5396ea(_0x16a96b[_0xd1f7('0x9')][_0xd1f7('0xb')]);}else{_0x5396ea(_0x16a96b[_0xd1f7('0xc')]);}})[_0xd1f7('0xd')](function(_0x5acfd0){_0x285b48(_0x5acfd0);});});}function respondWithResult(_0x5661c8,_0x1af53f){_0x1af53f=_0x1af53f||0xc8;return function(_0x5c017f){if(_0x5c017f){return _0x5661c8['status'](_0x1af53f)[_0xd1f7('0xe')](_0x5c017f);}return _0x5661c8[_0xd1f7('0xf')](0x194);};}function handleError(_0xcab890,_0x8668ce){_0x8668ce=_0x8668ce||0x1f4;return function(_0x452ef8){logger[_0xd1f7('0x9')](_0x452ef8[_0xd1f7('0x10')]);if(_0x452ef8[_0xd1f7('0x11')]){delete _0x452ef8[_0xd1f7('0x11')];}_0xcab890['status'](_0x8668ce)[_0xd1f7('0x12')](_0x452ef8);};}function findById(_0x41e98d){return function(_0x16a241){if(!_[_0xd1f7('0x13')](_0x41e98d)&&!_[_0xd1f7('0x13')](_0x16a241)&&!_[_0xd1f7('0x13')](_0x16a241[_0xd1f7('0x14')])){return _[_0xd1f7('0x15')](_0x16a241['rows'],function(_0x312125){return _0x312125['id']==_0x41e98d;});}return null;};}exports['voiceChannels']=function(_0x3b4046,_0x39e58f){return respondWithRpcPromise(_0xd1f7('0x16'),_0x3b4046[_0xd1f7('0x17')])['then'](respondWithResult(_0x39e58f,null))['catch'](handleError(_0x39e58f,null));};exports[_0xd1f7('0x18')]=function(_0x2c1152,_0x567ff9){return respondWithRpcPromise(_0xd1f7('0x19'),_[_0xd1f7('0x1a')](_0x2c1152['query'],_0x2c1152[_0xd1f7('0x1b')]))[_0xd1f7('0x8')](respondWithResult(_0x567ff9,null))['catch'](handleError(_0x567ff9,null));};exports[_0xd1f7('0x1c')]=function(_0x2de095,_0x4ea278){return respondWithRpcPromise(_0xd1f7('0x1d'),_[_0xd1f7('0x1a')](_0x2de095[_0xd1f7('0x17')],_0x2de095[_0xd1f7('0x1b')]))[_0xd1f7('0x8')](respondWithResult(_0x4ea278,null))[_0xd1f7('0xd')](handleError(_0x4ea278,null));};exports['voiceQueues']=function(_0x3bebb2,_0x530640){return respondWithRpcPromise(_0xd1f7('0x1e'),_0x3bebb2[_0xd1f7('0x17')])['then'](respondWithResult(_0x530640,null))['catch'](handleError(_0x530640,null));};exports[_0xd1f7('0x1f')]=function(_0x156d39,_0x1e49b7){return respondWithRpcPromise('VoiceQueues',_0x156d39[_0xd1f7('0x17')])[_0xd1f7('0x8')](findById(_0x156d39[_0xd1f7('0x1b')]['id']))[_0xd1f7('0x8')](respondWithResult(_0x1e49b7,null))[_0xd1f7('0xd')](handleError(_0x1e49b7,null));};exports[_0xd1f7('0x20')]=function(_0x22229c,_0x32deb2){return respondWithRpcPromise(_0xd1f7('0x21'),_[_0xd1f7('0x1a')](_0x22229c[_0xd1f7('0x17')],_0x22229c[_0xd1f7('0x1b')]))[_0xd1f7('0x8')](respondWithResult(_0x32deb2,null))[_0xd1f7('0xd')](handleError(_0x32deb2,null));};exports[_0xd1f7('0x22')]=function(_0x2e1832,_0x3ea05b){return respondWithRpcPromise(_0xd1f7('0x23'),_0x2e1832[_0xd1f7('0x17')])['then'](respondWithResult(_0x3ea05b,null))['catch'](handleError(_0x3ea05b,null));};exports[_0xd1f7('0x24')]=function(_0x1bbb3b,_0xe8c23a){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xd1f7('0x1a')](_0x1bbb3b[_0xd1f7('0x17')],_0x1bbb3b[_0xd1f7('0x1b')]))[_0xd1f7('0x8')](respondWithResult(_0xe8c23a,null))[_0xd1f7('0xd')](handleError(_0xe8c23a,null));};exports[_0xd1f7('0x25')]=function(_0x124c3e,_0x234813){return respondWithRpcPromise(_0xd1f7('0x26'),_[_0xd1f7('0x1a')](_0x124c3e[_0xd1f7('0x17')],_0x124c3e[_0xd1f7('0x1b')]))[_0xd1f7('0x8')](respondWithResult(_0x234813,null))[_0xd1f7('0xd')](handleError(_0x234813,null));};exports[_0xd1f7('0x27')]=function(_0xb27f11,_0x3339f4){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xd1f7('0x1a')](_0xb27f11[_0xd1f7('0x17')],_0xb27f11[_0xd1f7('0x1b')]))[_0xd1f7('0x8')](respondWithResult(_0x3339f4,null))[_0xd1f7('0xd')](handleError(_0x3339f4,null));};exports['outbound']=function(_0x4b119d,_0x3ded5e){return respondWithRpcPromise(_0xd1f7('0x28'),_0x4b119d[_0xd1f7('0x17')])[_0xd1f7('0x8')](respondWithResult(_0x3ded5e,null))[_0xd1f7('0xd')](handleError(_0x3ded5e,null));};exports['outboundChannels']=function(_0x58270e,_0x15cdcd){return respondWithRpcPromise(_0xd1f7('0x29'),_0x58270e[_0xd1f7('0x17')])[_0xd1f7('0x8')](respondWithResult(_0x15cdcd,null))[_0xd1f7('0xd')](handleError(_0x15cdcd,null));};exports[_0xd1f7('0x2a')]=function(_0x2bfe06,_0x59825c){var _0x340cb1;return respondWithRpcPromise(_0xd1f7('0x2b'),_0x2bfe06[_0xd1f7('0x17')])[_0xd1f7('0x8')](function(_0x851963){_0x340cb1=_0x851963;return respondWithRpcPromise(_0xd1f7('0x2b'),_0x2bfe06[_0xd1f7('0x17')],routingClient);})[_0xd1f7('0x8')](function(_0x56daa2){return _[_0xd1f7('0x1a')]({},_0x56daa2,_0x340cb1);})[_0xd1f7('0x8')](respondWithResult(_0x59825c,null))[_0xd1f7('0xd')](handleError(_0x59825c,null));};exports[_0xd1f7('0x2c')]=function(_0x24847f,_0x2601ec){if(_0x24847f[_0xd1f7('0x2d')]&&_0x24847f[_0xd1f7('0x2d')]['interaction']&&_0x24847f[_0xd1f7('0x2e')]&&_0x24847f[_0xd1f7('0x2e')]['name']){for(var _0xbb6b71 in _0x24847f['body'][_0xd1f7('0x2f')]){if(_0x24847f['body'][_0xd1f7('0x2f')][_0xd1f7('0x30')](_0xbb6b71)){db[_0xd1f7('0x31')][_0xd1f7('0x32')]({'where':{'channel':_0xbb6b71,'membername':_0x24847f[_0xd1f7('0x2e')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x24847f['body']['interaction'][_0xbb6b71]&&_0x24847f[_0xd1f7('0x2d')]['interaction'][_0xbb6b71][_0xd1f7('0x33')]?{'$notIn':_0x24847f['body'][_0xd1f7('0x2f')][_0xbb6b71]}:{'$ne':null}}})[_0xd1f7('0x8')](function(_0x53132f){var _0xd97af4=moment()['format'](_0xd1f7('0x34'));for(var _0x8a1d4a=0x0,_0x138f40=_0x53132f[_0xd1f7('0x33')];_0x8a1d4a<_0x138f40;_0x8a1d4a+=0x1){_0x53132f[_0x8a1d4a][_0xd1f7('0x35')]({'exitAt':_0xd97af4});}});for(var _0xa76e20=0x0;_0xa76e20<_0x24847f['body'][_0xd1f7('0x2f')][_0xbb6b71][_0xd1f7('0x33')];_0xa76e20+=0x1){db[_0xd1f7('0x31')][_0xd1f7('0x36')]({'where':{'channel':_0xbb6b71,'membername':_0x24847f[_0xd1f7('0x2e')][_0xd1f7('0x11')],'type':'INTERACTION','uniqueid':_0x24847f['body']['interaction'][_0xbb6b71][_0xa76e20],'exitAt':null},'defaults':{'channel':_0xbb6b71,'membername':_0x24847f[_0xd1f7('0x2e')][_0xd1f7('0x11')],'interface':_[_0xd1f7('0x13')](_0x24847f[_0xd1f7('0x2e')][_0xd1f7('0x37')])?util[_0xd1f7('0x38')]('SIP/%s',_0x24847f[_0xd1f7('0x2e')][_0xd1f7('0x11')]):_0x24847f[_0xd1f7('0x2e')]['interface'],'type':'INTERACTION','enterAt':moment()['format'](_0xd1f7('0x34')),'role':_0xd1f7('0x39'),'internal':_0x24847f[_0xd1f7('0x2e')]['internal'],'uniqueid':_0x24847f[_0xd1f7('0x2d')][_0xd1f7('0x2f')][_0xbb6b71][_0xa76e20]}});}}}}return respondWithRpcPromise(_0xd1f7('0x3a'),{'id':_0x24847f[_0xd1f7('0x1b')]['id'],'capacity':_0x24847f['body'][_0xd1f7('0x3b')]},routingClient)[_0xd1f7('0x8')](respondWithResult(_0x2601ec,null))['catch'](handleError(_0x2601ec,null));};exports['telephones']=function(_0xa50907,_0x549a69){return respondWithRpcPromise(_0xd1f7('0x3c'),_0xa50907[_0xd1f7('0x17')])[_0xd1f7('0x8')](respondWithResult(_0x549a69,null))[_0xd1f7('0xd')](handleError(_0x549a69,null));};exports[_0xd1f7('0x3d')]=function(_0xefd812,_0xed7fc1){return respondWithRpcPromise('Trunks',_0xefd812[_0xd1f7('0x17')])[_0xd1f7('0x8')](respondWithResult(_0xed7fc1,null))[_0xd1f7('0xd')](handleError(_0xed7fc1,null));};exports[_0xd1f7('0x3e')]=function(_0x566b0d,_0x3ccc76){return respondWithRpcPromise(_0xd1f7('0x3f'),_0x566b0d[_0xd1f7('0x17')])[_0xd1f7('0x8')](respondWithResult(_0x3ccc76,null))['catch'](handleError(_0x3ccc76,null));};exports[_0xd1f7('0x40')]=function(_0x215fe0,_0x5f45dd){return respondWithRpcPromise(_0xd1f7('0x41'),_0x215fe0['query'],routingClient)[_0xd1f7('0x8')](respondWithResult(_0x5f45dd,null))['catch'](handleError(_0x5f45dd,null));};exports[_0xd1f7('0x42')]=function(_0x4eb3fb,_0x1a2201){return respondWithRpcPromise(_0xd1f7('0x41'),_0x4eb3fb[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](findById(_0x4eb3fb[_0xd1f7('0x1b')]['id']))[_0xd1f7('0x8')](respondWithResult(_0x1a2201,null))[_0xd1f7('0xd')](handleError(_0x1a2201,null));};exports[_0xd1f7('0x43')]=function(_0x15555b,_0x5ae745){return respondWithRpcPromise(_0xd1f7('0x44'),_0x15555b[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](respondWithResult(_0x5ae745,null))[_0xd1f7('0xd')](handleError(_0x5ae745,null));};exports['showMailQueues']=function(_0x36b82d,_0xea2e18){return respondWithRpcPromise(_0xd1f7('0x44'),_0x36b82d[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](findById(_0x36b82d[_0xd1f7('0x1b')]['id']))[_0xd1f7('0x8')](respondWithResult(_0xea2e18,null))['catch'](handleError(_0xea2e18,null));};exports[_0xd1f7('0x45')]=function(_0x3ffff0,_0x34e7f2){return respondWithRpcPromise(_0xd1f7('0x46'),_0x3ffff0[_0xd1f7('0x17')],mailClient)[_0xd1f7('0x8')](respondWithResult(_0x34e7f2,null))[_0xd1f7('0xd')](handleError(_0x34e7f2,null));};exports[_0xd1f7('0x47')]=function(_0x4c3de6,_0x30396d){return respondWithRpcPromise(_0xd1f7('0x48'),_0x4c3de6[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](respondWithResult(_0x30396d,null))[_0xd1f7('0xd')](handleError(_0x30396d,null));};exports[_0xd1f7('0x49')]=function(_0x56dc29,_0x58ddd6){return respondWithRpcPromise(_0xd1f7('0x48'),_0x56dc29[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](findById(_0x56dc29[_0xd1f7('0x1b')]['id']))[_0xd1f7('0x8')](respondWithResult(_0x58ddd6,null))['catch'](handleError(_0x58ddd6,null));};exports['smsQueues']=function(_0x42cc2c,_0x208a12){return respondWithRpcPromise(_0xd1f7('0x4a'),_0x42cc2c[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](respondWithResult(_0x208a12,null))[_0xd1f7('0xd')](handleError(_0x208a12,null));};exports['showSmsQueues']=function(_0x3ff86f,_0x401199){return respondWithRpcPromise('SmsQueues',_0x3ff86f[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](findById(_0x3ff86f['params']['id']))[_0xd1f7('0x8')](respondWithResult(_0x401199,null))[_0xd1f7('0xd')](handleError(_0x401199,null));};exports['whatsappQueues']=function(_0x99cc49,_0x461f9f){return respondWithRpcPromise(_0xd1f7('0x4b'),_0x99cc49['query'],routingClient)[_0xd1f7('0x8')](respondWithResult(_0x461f9f,null))[_0xd1f7('0xd')](handleError(_0x461f9f,null));};exports['showWhatsappQueues']=function(_0x456472,_0x47d7cf){return respondWithRpcPromise('WhatsappQueues',_0x456472[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](findById(_0x456472['params']['id']))[_0xd1f7('0x8')](respondWithResult(_0x47d7cf,null))[_0xd1f7('0xd')](handleError(_0x47d7cf,null));};exports[_0xd1f7('0x4c')]=function(_0x1172fe,_0x405727){return respondWithRpcPromise(_0xd1f7('0x4d'),_0x1172fe[_0xd1f7('0x17')],routingClient)['then'](respondWithResult(_0x405727,null))[_0xd1f7('0xd')](handleError(_0x405727,null));};exports[_0xd1f7('0x4e')]=function(_0x2ba31,_0x12aa8c){return respondWithRpcPromise(_0xd1f7('0x4d'),_0x2ba31[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](findById(_0x2ba31[_0xd1f7('0x1b')]['id']))['then'](respondWithResult(_0x12aa8c,null))['catch'](handleError(_0x12aa8c,null));};exports[_0xd1f7('0x4f')]=function(_0x488b1f,_0x135700){return respondWithRpcPromise(_0xd1f7('0x50'),_0x488b1f[_0xd1f7('0x17')])['then'](respondWithResult(_0x135700,null))[_0xd1f7('0xd')](handleError(_0x135700,null));};exports[_0xd1f7('0x51')]=function(_0x226042,_0xb4b364){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x226042['query'],routingClient)[_0xd1f7('0x8')](respondWithResult(_0xb4b364,null))[_0xd1f7('0xd')](handleError(_0xb4b364,null));};exports[_0xd1f7('0x52')]=function(_0x28ad84,_0x201e10){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x28ad84[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](respondWithResult(_0x201e10,null))[_0xd1f7('0xd')](handleError(_0x201e10,null));};exports[_0xd1f7('0x53')]=function(_0x426d28,_0xef0200){return respondWithRpcPromise(_0xd1f7('0x54'),_0x426d28[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](respondWithResult(_0xef0200,null))[_0xd1f7('0xd')](handleError(_0xef0200,null));};exports['smsQueuesWaitingInteractions']=function(_0x3db1bb,_0x1cfdcb){return respondWithRpcPromise(_0xd1f7('0x55'),_0x3db1bb[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](respondWithResult(_0x1cfdcb,null))[_0xd1f7('0xd')](handleError(_0x1cfdcb,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x483d4c,_0x404d09){return respondWithRpcPromise(_0xd1f7('0x56'),_0x483d4c[_0xd1f7('0x17')],routingClient)[_0xd1f7('0x8')](respondWithResult(_0x404d09,null))[_0xd1f7('0xd')](handleError(_0x404d09,null));};exports[_0xd1f7('0x57')]=function(_0x279b43,_0xa78f3e){return respondWithRpcPromise(_0xd1f7('0x58'),_0x279b43[_0xd1f7('0x17')],routingClient)['then'](respondWithResult(_0xa78f3e,null))[_0xd1f7('0xd')](handleError(_0xa78f3e,null));};exports[_0xd1f7('0x59')]=function(_0x522ca0){return function(_0xd9a285,_0x4ba31f){var _0x367e59,_0xe823b;var _0x2083f1=_[_0xd1f7('0x5a')](_0x522ca0);var _0x4dbae9=_0x522ca0===_0xd1f7('0x5b')?_0xd1f7('0x5c'):'Account';return db[_0x2083f1+_0xd1f7('0x5d')][_0xd1f7('0x5e')]({'raw':!![],'where':{'id':_0xd9a285[_0xd1f7('0x1b')]['id']}})['then'](function(_0x2bdfac){if(_[_0xd1f7('0x13')](_0x2bdfac)){throw new Error(_0x2083f1+'\x20Queue\x20not\x20found');}_0x367e59=_0x2bdfac;return db[_0x2083f1+'Message']['findOne']({'where':{'id':_0xd9a285[_0xd1f7('0x2d')]['messageId']},'include':[{'model':db[_0x2083f1+_0xd1f7('0x5f')],'as':_0xd1f7('0x5f')},{'model':db[_0x2083f1+_0x4dbae9],'as':_0xd1f7('0x60')}]});})[_0xd1f7('0x8')](function(_0x243b11){if(_[_0xd1f7('0x13')](_0x243b11)){throw new Error(_0x2083f1+_0xd1f7('0x61'));}_0xe823b=_0x243b11;return _0x243b11[_0xd1f7('0x62')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd1f7('0x8')](function(){var _0x5eecf8={'uniqueid':_0x522ca0+'.'+_0xe823b['id']+'.'+_0xe823b['Interaction']['id'],'FromUserId':_0xd9a285[_0xd1f7('0x2e')]['id'],'type':'queue'};_0x5eecf8[_0x2083f1+_0xd1f7('0x63')]=_0xe823b['id'];_0x5eecf8[_0x2083f1+_0xd1f7('0x64')]=_0xe823b[_0xd1f7('0x5f')]['id'];_0x5eecf8[_0xd1f7('0x65')+_0x2083f1+_0x4dbae9+'Id']=_0xe823b['Account']['id'];_0x5eecf8['To'+_0x2083f1+'QueueId']=_0x367e59['id'];return db[_0x2083f1+_0xd1f7('0x66')][_0xd1f7('0x67')](_0x5eecf8);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x522ca0,'interaction':_0xe823b[_0xd1f7('0x5f')],'message':_0xe823b,'account':_0xe823b[_0xd1f7('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x367e59['name']+','+(_0xe823b[_0xd1f7('0x60')]['queueTransferTimeout']||0x12c),'interval':_0xd1f7('0x68')}]},routingClient);})[_0xd1f7('0x8')](respondWithResult(_0x4ba31f,null))[_0xd1f7('0xd')](handleError(_0x4ba31f,null));};};exports[_0xd1f7('0x69')]=function(_0x407c2b,_0x57ce5c){var _0x37ca2f,_0x10118e;if(_[_0xd1f7('0x13')](_0x407c2b[_0xd1f7('0x2d')][_0xd1f7('0x6a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x55cd0e=_0x407c2b[_0xd1f7('0x2d')]['channel'];var _0x17bc7b=_['capitalize'](_0x55cd0e);var _0x53cdb8=_0x55cd0e===_0xd1f7('0x5b')?_0xd1f7('0x5c'):_0xd1f7('0x60');return db[_0xd1f7('0x6b')][_0xd1f7('0x5e')]({'raw':!![],'where':{'id':_0x407c2b[_0xd1f7('0x1b')]['id'],'role':_0xd1f7('0x39')}})['then'](function(_0x404a13){if(_['isNil'](_0x404a13)){throw new Error(_0xd1f7('0x6c'));}_0x37ca2f=_0x404a13;return db[_0x17bc7b+_0xd1f7('0x6d')]['findOne']({'where':{'id':_0x407c2b[_0xd1f7('0x2d')]['messageId']},'include':[{'model':db[_0x17bc7b+_0xd1f7('0x5f')],'as':_0xd1f7('0x5f')},{'model':db[_0x17bc7b+_0x53cdb8],'as':_0xd1f7('0x60')}]});})[_0xd1f7('0x8')](function(_0x18d5bc){if(_['isNil'](_0x18d5bc)){throw new Error(_0x17bc7b+'\x20Message\x20not\x20found');}_0x10118e=_0x18d5bc;return _0x18d5bc['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd1f7('0x8')](function(){var _0x39a917={'uniqueid':_0x55cd0e+'.'+_0x10118e['id']+'.'+_0x10118e['Interaction']['id'],'FromUserId':_0x407c2b[_0xd1f7('0x2e')]['id'],'type':_0xd1f7('0x6e'),'ToUserId':_0x37ca2f['id']};_0x39a917[_0x17bc7b+_0xd1f7('0x63')]=_0x10118e['id'];_0x39a917[_0x17bc7b+'InteractionId']=_0x10118e[_0xd1f7('0x5f')]['id'];_0x39a917['From'+_0x17bc7b+_0x53cdb8+'Id']=_0x10118e[_0xd1f7('0x60')]['id'];return db[_0x17bc7b+_0xd1f7('0x66')][_0xd1f7('0x67')](_0x39a917);})[_0xd1f7('0x8')](function(){return respondWithRpcPromise(_0xd1f7('0x6f'),{'channel':_0x55cd0e,'interaction':_0x10118e['Interaction'],'message':_0x10118e,'account':_0x10118e[_0xd1f7('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd1f7('0x39'),'appdata':_0x37ca2f[_0xd1f7('0x11')]+','+(_0x10118e[_0xd1f7('0x60')][_0xd1f7('0x70')]||0x12c),'interval':_0xd1f7('0x68')}]},routingClient);})[_0xd1f7('0x8')](respondWithResult(_0x57ce5c,null))['catch'](handleError(_0x57ce5c,null));};
\ No newline at end of file
index 7d302b1..5d514c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfeb8=['delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/run','run','post','put','/:id','update'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xfeb8,0x6f));var _0x8feb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfeb8[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x8feb('0x0'));var util=require('util');var path=require(_0x8feb('0x1'));var timeout=require(_0x8feb('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x8feb('0x3'));var interaction=require(_0x8feb('0x4'));var config=require(_0x8feb('0x5'));var controller=require('./schedule.controller');router[_0x8feb('0x6')]('/',auth[_0x8feb('0x7')](),controller['index']);router[_0x8feb('0x6')]('/:id',auth[_0x8feb('0x7')](),controller[_0x8feb('0x8')]);router[_0x8feb('0x6')](_0x8feb('0x9'),auth[_0x8feb('0x7')](),controller[_0x8feb('0xa')]);router[_0x8feb('0xb')]('/',auth[_0x8feb('0x7')](),controller['create']);router[_0x8feb('0xc')](_0x8feb('0xd'),auth[_0x8feb('0x7')](),controller[_0x8feb('0xe')]);router[_0x8feb('0xf')](_0x8feb('0xd'),auth[_0x8feb('0x7')](),controller[_0x8feb('0x10')]);module[_0x8feb('0x11')]=router;
\ No newline at end of file
+var _0xd9b4=['isAuthenticated','index','show','get','/:id/run','run','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller'];(function(_0x5bc0ef,_0x212473){var _0xe7216e=function(_0x208c38){while(--_0x208c38){_0x5bc0ef['push'](_0x5bc0ef['shift']());}};_0xe7216e(++_0x212473);}(_0xd9b4,0x1ac));var _0x4d9b=function(_0x38bbfd,_0x5bf36e){_0x38bbfd=_0x38bbfd-0x0;var _0x2543e3=_0xd9b4[_0x38bbfd];return _0x2543e3;};'use strict';var multer=require(_0x4d9b('0x0'));var util=require('util');var path=require(_0x4d9b('0x1'));var timeout=require(_0x4d9b('0x2'));var express=require(_0x4d9b('0x3'));var router=express[_0x4d9b('0x4')]();var auth=require(_0x4d9b('0x5'));var interaction=require(_0x4d9b('0x6'));var config=require(_0x4d9b('0x7'));var controller=require(_0x4d9b('0x8'));router['get']('/',auth[_0x4d9b('0x9')](),controller[_0x4d9b('0xa')]);router['get']('/:id',auth[_0x4d9b('0x9')](),controller[_0x4d9b('0xb')]);router[_0x4d9b('0xc')](_0x4d9b('0xd'),auth['isAuthenticated'](),controller[_0x4d9b('0xe')]);router[_0x4d9b('0xf')]('/',auth[_0x4d9b('0x9')](),controller[_0x4d9b('0x10')]);router[_0x4d9b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x4d9b('0x12')]);router[_0x4d9b('0x13')](_0x4d9b('0x14'),auth[_0x4d9b('0x9')](),controller[_0x4d9b('0x15')]);module[_0x4d9b('0x16')]=router;
\ No newline at end of file
index cd586ca..6507559 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0650=['DATE','INTEGER','ENUM','months','days','csv','pdf','custom','BOOLEAN','TEXT','sequelize','exports','STRING'];(function(_0x4321a6,_0x502ae4){var _0x11b3a8=function(_0x3c619d){while(--_0x3c619d){_0x4321a6['push'](_0x4321a6['shift']());}};_0x11b3a8(++_0x502ae4);}(_0x0650,0x1aa));var _0x0065=function(_0x4c42c8,_0x326182){_0x4c42c8=_0x4c42c8-0x0;var _0x474b68=_0x0650[_0x4c42c8];return _0x474b68;};'use strict';var Sequelize=require(_0x0065('0x0'));module[_0x0065('0x1')]={'name':{'type':Sequelize[_0x0065('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0065('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x0065('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x0065('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x0065('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x0065('0x5')]('years','quarters',_0x0065('0x6'),'weeks','days','hours','minutes'),'allowNull':![],'defaultValue':_0x0065('0x7')},'output':{'type':Sequelize['ENUM'](_0x0065('0x8'),_0x0065('0x9'),'xlsx'),'allowNull':![],'defaultValue':_0x0065('0x8')},'type':{'type':Sequelize[_0x0065('0x5')]('custom','default'),'allowNull':![],'defaultValue':_0x0065('0xa')},'sendMail':{'type':Sequelize[_0x0065('0xb')],'defaultValue':![]},'email':{'type':Sequelize[_0x0065('0x2')]},'cc':{'type':Sequelize[_0x0065('0xc')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xe714=['months','weeks','hours','minutes','days','csv','xlsx','custom','default','TEXT','sequelize','STRING','BOOLEAN','DATE','INTEGER','ENUM','years','quarters'];(function(_0x31aa0d,_0x217049){var _0x53e7e0=function(_0x244397){while(--_0x244397){_0x31aa0d['push'](_0x31aa0d['shift']());}};_0x53e7e0(++_0x217049);}(_0xe714,0xe2));var _0x4e71=function(_0x3736bf,_0x4be223){_0x3736bf=_0x3736bf-0x0;var _0x3d0784=_0xe714[_0x3736bf];return _0x3d0784;};'use strict';var Sequelize=require(_0x4e71('0x0'));module['exports']={'name':{'type':Sequelize[_0x4e71('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4e71('0x1')]},'active':{'type':Sequelize[_0x4e71('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x4e71('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x4e71('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x4e71('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x4e71('0x5')](_0x4e71('0x6'),_0x4e71('0x7'),_0x4e71('0x8'),_0x4e71('0x9'),'days',_0x4e71('0xa'),_0x4e71('0xb')),'allowNull':![],'defaultValue':_0x4e71('0xc')},'output':{'type':Sequelize['ENUM'](_0x4e71('0xd'),'pdf',_0x4e71('0xe')),'allowNull':![],'defaultValue':_0x4e71('0xd')},'type':{'type':Sequelize[_0x4e71('0x5')](_0x4e71('0xf'),_0x4e71('0x10')),'allowNull':![],'defaultValue':_0x4e71('0xf')},'sendMail':{'type':Sequelize[_0x4e71('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x4e71('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x4e71('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x4e71('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 0a434bc..4103446 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa7f=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Scheduler','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','get','sendStatus','error','stack','name','send','index','Schedule'];(function(_0x12b7af,_0x4a6133){var _0x3504a0=function(_0x2e2227){while(--_0x2e2227){_0x12b7af['push'](_0x12b7af['shift']());}};_0x3504a0(++_0x4a6133);}(_0xaa7f,0x19c));var _0xfaa7=function(_0x785d45,_0x2b02a7){_0x785d45=_0x785d45-0x0;var _0x57b012=_0xaa7f[_0x785d45];return _0x57b012;};'use strict';var pdf=require(_0xfaa7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfaa7('0x1'));var zipdir=require(_0xfaa7('0x2'));var jsonpatch=require(_0xfaa7('0x3'));var rp=require(_0xfaa7('0x4'));var moment=require(_0xfaa7('0x5'));var BPromise=require(_0xfaa7('0x6'));var Mustache=require(_0xfaa7('0x7'));var util=require(_0xfaa7('0x8'));var path=require(_0xfaa7('0x9'));var sox=require(_0xfaa7('0xa'));var csv=require('to-csv');var ejs=require(_0xfaa7('0xb'));var fs=require('fs');var _=require(_0xfaa7('0xc'));var squel=require(_0xfaa7('0xd'));var crypto=require(_0xfaa7('0xe'));var jsforce=require(_0xfaa7('0xf'));var deskjs=require(_0xfaa7('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfaa7('0x11'));var Papa=require(_0xfaa7('0x12'));var Redis=require(_0xfaa7('0x13'));var authService=require(_0xfaa7('0x14'));var qs=require(_0xfaa7('0x15'));var as=require(_0xfaa7('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfaa7('0x17'))(_0xfaa7('0x18'));var utils=require(_0xfaa7('0x19'));var config=require('../../config/environment');var db=require(_0xfaa7('0x1a'))['db'];function respondWithStatusCode(_0xbf709f,_0x19ab0b){_0x19ab0b=_0x19ab0b||0xcc;return function(_0x56ee30){if(_0x56ee30){return _0xbf709f['sendStatus'](_0x19ab0b);}return _0xbf709f['status'](_0x19ab0b)[_0xfaa7('0x1b')]();};}function respondWithResult(_0x2bea3a,_0x50d704){_0x50d704=_0x50d704||0xc8;return function(_0x231a49){if(_0x231a49){return _0x2bea3a['status'](_0x50d704)[_0xfaa7('0x1c')](_0x231a49);}};}function respondWithFilteredResult(_0x2cfa69,_0x50a447){return function(_0xcc04a1){if(_0xcc04a1){var _0x5a941e=_0xcc04a1[_0xfaa7('0x1d')],_0x583c77=_0x50a447[_0xfaa7('0x1e')],_0x14345a=_0x50a447[_0xfaa7('0x1e')]+_0x50a447[_0xfaa7('0x1f')],_0x1fefb0;if(_0x14345a>=_0x5a941e){_0x14345a=_0x5a941e;_0x1fefb0=0xc8;}else{_0x1fefb0=0xce;}_0x2cfa69[_0xfaa7('0x20')](_0x1fefb0);return _0x2cfa69[_0xfaa7('0x21')](_0xfaa7('0x22'),_0x583c77+'-'+_0x14345a+'/'+_0x5a941e)['json'](_0xcc04a1);}return null;};}function patchUpdates(_0x33d9a8){return function(_0x5dedf6){try{jsonpatch[_0xfaa7('0x23')](_0x5dedf6,_0x33d9a8,!![]);}catch(_0x1eeaa6){return BPromise[_0xfaa7('0x24')](_0x1eeaa6);}return _0x5dedf6[_0xfaa7('0x25')]();};}function saveUpdates(_0x5b56b4,_0x30d872){return function(_0x501802){if(_0x501802){return _0x501802['update'](_0x5b56b4)[_0xfaa7('0x26')](function(_0x465631){return _0x465631;});}return null;};}function removeEntity(_0x319a62,_0x2a0e16){return function(_0x33bb53){if(_0x33bb53){return _0x33bb53[_0xfaa7('0x27')]()[_0xfaa7('0x26')](function(){var _0x13b033=_0x33bb53[_0xfaa7('0x28')]({'plain':!![]});var _0x472559='Scheduler';return db['UserProfileResource'][_0xfaa7('0x27')]({'where':{'type':_0x472559,'resourceId':_0x13b033['id']}})[_0xfaa7('0x26')](function(){return _0x33bb53;});})['then'](function(){_0x319a62[_0xfaa7('0x20')](0xcc)[_0xfaa7('0x1b')]();});}};}function handleEntityNotFound(_0xdddace,_0x1671de){return function(_0x379131){if(!_0x379131){_0xdddace[_0xfaa7('0x29')](0x194);}return _0x379131;};}function handleError(_0x1ced27,_0x57e451){_0x57e451=_0x57e451||0x1f4;return function(_0x33b43a){logger[_0xfaa7('0x2a')](_0x33b43a[_0xfaa7('0x2b')]);if(_0x33b43a[_0xfaa7('0x2c')]){delete _0x33b43a[_0xfaa7('0x2c')];}_0x1ced27[_0xfaa7('0x20')](_0x57e451)[_0xfaa7('0x2d')](_0x33b43a);};}exports[_0xfaa7('0x2e')]=function(_0x2ce1bd,_0x1491c7){var _0x3fd802={},_0x51016b={},_0x51a505={'count':0x0,'rows':[]};var _0x3cf8ac=_['map'](db[_0xfaa7('0x2f')][_0xfaa7('0x30')],function(_0x5d353e){return{'name':_0x5d353e[_0xfaa7('0x31')],'type':_0x5d353e[_0xfaa7('0x32')][_0xfaa7('0x33')]};});_0x51016b[_0xfaa7('0x34')]=_['map'](_0x3cf8ac,'name');_0x51016b[_0xfaa7('0x35')]=_[_0xfaa7('0x36')](_0x2ce1bd[_0xfaa7('0x35')]);_0x51016b[_0xfaa7('0x37')]=_[_0xfaa7('0x38')](_0x51016b[_0xfaa7('0x34')],_0x51016b[_0xfaa7('0x35')]);_0x3fd802['attributes']=_[_0xfaa7('0x38')](_0x51016b['model'],qs[_0xfaa7('0x39')](_0x2ce1bd[_0xfaa7('0x35')][_0xfaa7('0x39')]));_0x3fd802[_0xfaa7('0x3a')]=_0x3fd802[_0xfaa7('0x3a')]['length']?_0x3fd802[_0xfaa7('0x3a')]:_0x51016b[_0xfaa7('0x34')];if(!_0x2ce1bd[_0xfaa7('0x35')][_0xfaa7('0x3b')](_0xfaa7('0x3c'))){_0x3fd802[_0xfaa7('0x1f')]=qs['limit'](_0x2ce1bd['query'][_0xfaa7('0x1f')]);_0x3fd802[_0xfaa7('0x1e')]=qs[_0xfaa7('0x1e')](_0x2ce1bd[_0xfaa7('0x35')][_0xfaa7('0x1e')]);}_0x3fd802[_0xfaa7('0x3d')]=qs[_0xfaa7('0x3e')](_0x2ce1bd[_0xfaa7('0x35')][_0xfaa7('0x3e')]);_0x3fd802['where']=qs['filters'](_[_0xfaa7('0x3f')](_0x2ce1bd[_0xfaa7('0x35')],_0x51016b['filters']),_0x3cf8ac);if(_0x2ce1bd[_0xfaa7('0x35')][_0xfaa7('0x40')]){_0x3fd802['where']=_[_0xfaa7('0x41')](_0x3fd802[_0xfaa7('0x42')],{'$or':_[_0xfaa7('0x43')](_0x3cf8ac,function(_0x2f68e1){if(_0x2f68e1[_0xfaa7('0x32')]!==_0xfaa7('0x44')){var _0x655180={};_0x655180[_0x2f68e1[_0xfaa7('0x2c')]]={'$like':'%'+_0x2ce1bd[_0xfaa7('0x35')][_0xfaa7('0x40')]+'%'};return _0x655180;}})});}_0x3fd802=_[_0xfaa7('0x41')]({},_0x3fd802,_0x2ce1bd[_0xfaa7('0x45')]);var _0xe87cb9={'where':_0x3fd802['where']};return db['Schedule'][_0xfaa7('0x1d')](_0xe87cb9)['then'](function(_0x5f4e72){_0x51a505['count']=_0x5f4e72;if(_0x2ce1bd[_0xfaa7('0x35')]['includeAll']){_0x3fd802[_0xfaa7('0x46')]=[{'all':!![]}];}return db['Schedule'][_0xfaa7('0x47')](_0x3fd802);})[_0xfaa7('0x26')](function(_0x5e0d7a){_0x51a505[_0xfaa7('0x48')]=_0x5e0d7a;return _0x51a505;})['then'](respondWithFilteredResult(_0x1491c7,_0x3fd802))[_0xfaa7('0x49')](handleError(_0x1491c7,null));};exports[_0xfaa7('0x4a')]=function(_0x27eeab,_0x430d08){var _0x299fa7={'raw':![],'where':{'id':_0x27eeab[_0xfaa7('0x4b')]['id']}},_0x55a1e4={};_0x55a1e4[_0xfaa7('0x34')]=_[_0xfaa7('0x36')](db[_0xfaa7('0x2f')][_0xfaa7('0x30')]);_0x55a1e4[_0xfaa7('0x35')]=_[_0xfaa7('0x36')](_0x27eeab[_0xfaa7('0x35')]);_0x55a1e4['filters']=_[_0xfaa7('0x38')](_0x55a1e4[_0xfaa7('0x34')],_0x55a1e4[_0xfaa7('0x35')]);_0x299fa7[_0xfaa7('0x3a')]=_['intersection'](_0x55a1e4[_0xfaa7('0x34')],qs['fields'](_0x27eeab[_0xfaa7('0x35')][_0xfaa7('0x39')]));_0x299fa7[_0xfaa7('0x3a')]=_0x299fa7['attributes'][_0xfaa7('0x4c')]?_0x299fa7['attributes']:_0x55a1e4[_0xfaa7('0x34')];if(_0x27eeab[_0xfaa7('0x35')][_0xfaa7('0x4d')]){_0x299fa7[_0xfaa7('0x46')]=[{'all':!![]}];}_0x299fa7=_[_0xfaa7('0x41')]({},_0x299fa7,_0x27eeab['options']);return db[_0xfaa7('0x2f')][_0xfaa7('0x4e')](_0x299fa7)[_0xfaa7('0x26')](handleEntityNotFound(_0x430d08,null))['then'](respondWithResult(_0x430d08,null))[_0xfaa7('0x49')](handleError(_0x430d08,null));};exports['create']=function(_0x43f47a,_0x1a7ce3){return db[_0xfaa7('0x2f')][_0xfaa7('0x4f')](_0x43f47a[_0xfaa7('0x50')],{})[_0xfaa7('0x26')](function(_0x1ffe1d){var _0x5c70ee=_0x43f47a[_0xfaa7('0x51')][_0xfaa7('0x28')]({'plain':!![]});if(!_0x5c70ee)throw new Error(_0xfaa7('0x52'));if(_0x5c70ee[_0xfaa7('0x53')]===_0xfaa7('0x51')){var _0x3e0f22=_0x1ffe1d[_0xfaa7('0x28')]({'plain':!![]});var _0x4afe94=_0xfaa7('0x54');return db[_0xfaa7('0x55')][_0xfaa7('0x4e')]({'where':{'name':_0x4afe94,'userProfileId':_0x5c70ee['userProfileId']},'raw':!![]})['then'](function(_0x4719ec){if(_0x4719ec&&_0x4719ec[_0xfaa7('0x56')]===0x0){return db[_0xfaa7('0x57')][_0xfaa7('0x4f')]({'name':_0x3e0f22[_0xfaa7('0x2c')],'resourceId':_0x3e0f22['id'],'type':_0x4719ec[_0xfaa7('0x2c')],'sectionId':_0x4719ec['id']},{})[_0xfaa7('0x26')](function(){return _0x1ffe1d;});}else{return _0x1ffe1d;}})[_0xfaa7('0x49')](function(_0x15e3f3){logger['error'](_0xfaa7('0x58'),_0x15e3f3);throw _0x15e3f3;});}return _0x1ffe1d;})[_0xfaa7('0x26')](respondWithResult(_0x1a7ce3,0xc9))[_0xfaa7('0x49')](handleError(_0x1a7ce3,null));};exports[_0xfaa7('0x59')]=function(_0x2750ac,_0x217644){if(_0x2750ac[_0xfaa7('0x50')]['id']){delete _0x2750ac['body']['id'];}return db[_0xfaa7('0x2f')][_0xfaa7('0x4e')]({'where':{'id':_0x2750ac[_0xfaa7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x217644,null))['then'](saveUpdates(_0x2750ac['body'],null))['then'](respondWithResult(_0x217644,null))[_0xfaa7('0x49')](handleError(_0x217644,null));};exports[_0xfaa7('0x27')]=function(_0x372ace,_0xf0cb70){return db[_0xfaa7('0x2f')][_0xfaa7('0x4e')]({'where':{'id':_0x372ace['params']['id']}})[_0xfaa7('0x26')](handleEntityNotFound(_0xf0cb70,null))[_0xfaa7('0x26')](removeEntity(_0xf0cb70,null))['catch'](handleError(_0xf0cb70,null));};exports[_0xfaa7('0x5a')]=function(_0x18061d,_0x1c0973,_0x3f98b8){var _0x20cd18=require(_0xfaa7('0x5b'));return db[_0xfaa7('0x2f')][_0xfaa7('0x4e')]({'where':{'id':_0x18061d[_0xfaa7('0x4b')]['id']},'raw':!![]})[_0xfaa7('0x26')](handleEntityNotFound(_0x1c0973,null))['then'](function(){_0x20cd18[_0xfaa7('0x5a')](_0x18061d['params']['id']);})[_0xfaa7('0x26')](respondWithStatusCode(_0x1c0973,null))['catch'](handleError(_0x1c0973,null));};
\ No newline at end of file
+var _0x86dd=['attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','user','get','role','Scheduler','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','then','destroy','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','model','keys','query','filters','intersection'];(function(_0x3bdf48,_0x1979a2){var _0x8b4812=function(_0x44d545){while(--_0x44d545){_0x3bdf48['push'](_0x3bdf48['shift']());}};_0x8b4812(++_0x1979a2);}(_0x86dd,0x1be));var _0xd86d=function(_0x1722bc,_0x4a3b3c){_0x1722bc=_0x1722bc-0x0;var _0x2588de=_0x86dd[_0x1722bc];return _0x2588de;};'use strict';var pdf=require(_0xd86d('0x0'));var emlformat=require(_0xd86d('0x1'));var rimraf=require(_0xd86d('0x2'));var zipdir=require(_0xd86d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd86d('0x4'));var moment=require('moment');var BPromise=require(_0xd86d('0x5'));var Mustache=require(_0xd86d('0x6'));var util=require(_0xd86d('0x7'));var path=require(_0xd86d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd86d('0x9'));var fs=require('fs');var _=require(_0xd86d('0xa'));var squel=require(_0xd86d('0xb'));var crypto=require(_0xd86d('0xc'));var jsforce=require(_0xd86d('0xd'));var deskjs=require(_0xd86d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd86d('0xf'));var Papa=require(_0xd86d('0x10'));var Redis=require('ioredis');var authService=require(_0xd86d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd86d('0x12'));var hardwareService=require(_0xd86d('0x13'));var logger=require(_0xd86d('0x14'))(_0xd86d('0x15'));var utils=require(_0xd86d('0x16'));var config=require('../../config/environment');var db=require(_0xd86d('0x17'))['db'];function respondWithStatusCode(_0x4bf269,_0x10794f){_0x10794f=_0x10794f||0xcc;return function(_0x4bc397){if(_0x4bc397){return _0x4bf269[_0xd86d('0x18')](_0x10794f);}return _0x4bf269[_0xd86d('0x19')](_0x10794f)[_0xd86d('0x1a')]();};}function respondWithResult(_0x232f31,_0x247192){_0x247192=_0x247192||0xc8;return function(_0x50b597){if(_0x50b597){return _0x232f31[_0xd86d('0x19')](_0x247192)[_0xd86d('0x1b')](_0x50b597);}};}function respondWithFilteredResult(_0x20fee1,_0x5d8f9d){return function(_0x50156a){if(_0x50156a){var _0x20f97c=_0x50156a[_0xd86d('0x1c')],_0x3feec2=_0x5d8f9d['offset'],_0x56ccfc=_0x5d8f9d[_0xd86d('0x1d')]+_0x5d8f9d[_0xd86d('0x1e')],_0x694c6;if(_0x56ccfc>=_0x20f97c){_0x56ccfc=_0x20f97c;_0x694c6=0xc8;}else{_0x694c6=0xce;}_0x20fee1['status'](_0x694c6);return _0x20fee1['set'](_0xd86d('0x1f'),_0x3feec2+'-'+_0x56ccfc+'/'+_0x20f97c)[_0xd86d('0x1b')](_0x50156a);}return null;};}function patchUpdates(_0x4fb5d6){return function(_0x5d3a98){try{jsonpatch['apply'](_0x5d3a98,_0x4fb5d6,!![]);}catch(_0x58ce6e){return BPromise[_0xd86d('0x20')](_0x58ce6e);}return _0x5d3a98[_0xd86d('0x21')]();};}function saveUpdates(_0x4b377a,_0x161935){return function(_0x5dbfba){if(_0x5dbfba){return _0x5dbfba['update'](_0x4b377a)[_0xd86d('0x22')](function(_0x4515cd){return _0x4515cd;});}return null;};}function removeEntity(_0x5c9021,_0x521b00){return function(_0x26ec2f){if(_0x26ec2f){return _0x26ec2f[_0xd86d('0x23')]()[_0xd86d('0x22')](function(){var _0x46d1e8=_0x26ec2f['get']({'plain':!![]});var _0x1269d0='Scheduler';return db[_0xd86d('0x24')][_0xd86d('0x23')]({'where':{'type':_0x1269d0,'resourceId':_0x46d1e8['id']}})[_0xd86d('0x22')](function(){return _0x26ec2f;});})[_0xd86d('0x22')](function(){_0x5c9021['status'](0xcc)[_0xd86d('0x1a')]();});}};}function handleEntityNotFound(_0x1ba0ca,_0x363ec3){return function(_0x4d8c6b){if(!_0x4d8c6b){_0x1ba0ca[_0xd86d('0x18')](0x194);}return _0x4d8c6b;};}function handleError(_0x8dc333,_0x3a40a1){_0x3a40a1=_0x3a40a1||0x1f4;return function(_0x160474){logger[_0xd86d('0x25')](_0x160474[_0xd86d('0x26')]);if(_0x160474['name']){delete _0x160474[_0xd86d('0x27')];}_0x8dc333[_0xd86d('0x19')](_0x3a40a1)[_0xd86d('0x28')](_0x160474);};}exports[_0xd86d('0x29')]=function(_0x581fe9,_0x24e8f1){var _0x344fe2={},_0x39b586={},_0xc582d5={'count':0x0,'rows':[]};var _0x5b590f=_[_0xd86d('0x2a')](db[_0xd86d('0x2b')][_0xd86d('0x2c')],function(_0x8bd1a3){return{'name':_0x8bd1a3[_0xd86d('0x2d')],'type':_0x8bd1a3[_0xd86d('0x2e')]['key']};});_0x39b586[_0xd86d('0x2f')]=_[_0xd86d('0x2a')](_0x5b590f,_0xd86d('0x27'));_0x39b586['query']=_[_0xd86d('0x30')](_0x581fe9[_0xd86d('0x31')]);_0x39b586[_0xd86d('0x32')]=_[_0xd86d('0x33')](_0x39b586[_0xd86d('0x2f')],_0x39b586[_0xd86d('0x31')]);_0x344fe2[_0xd86d('0x34')]=_[_0xd86d('0x33')](_0x39b586[_0xd86d('0x2f')],qs[_0xd86d('0x35')](_0x581fe9[_0xd86d('0x31')][_0xd86d('0x35')]));_0x344fe2[_0xd86d('0x34')]=_0x344fe2[_0xd86d('0x34')][_0xd86d('0x36')]?_0x344fe2['attributes']:_0x39b586[_0xd86d('0x2f')];if(!_0x581fe9['query'][_0xd86d('0x37')]('nolimit')){_0x344fe2['limit']=qs[_0xd86d('0x1e')](_0x581fe9[_0xd86d('0x31')]['limit']);_0x344fe2[_0xd86d('0x1d')]=qs['offset'](_0x581fe9[_0xd86d('0x31')][_0xd86d('0x1d')]);}_0x344fe2[_0xd86d('0x38')]=qs[_0xd86d('0x39')](_0x581fe9[_0xd86d('0x31')]['sort']);_0x344fe2['where']=qs[_0xd86d('0x32')](_[_0xd86d('0x3a')](_0x581fe9[_0xd86d('0x31')],_0x39b586[_0xd86d('0x32')]),_0x5b590f);if(_0x581fe9[_0xd86d('0x31')][_0xd86d('0x3b')]){_0x344fe2[_0xd86d('0x3c')]=_[_0xd86d('0x3d')](_0x344fe2['where'],{'$or':_[_0xd86d('0x2a')](_0x5b590f,function(_0x273f0a){if(_0x273f0a['type']!==_0xd86d('0x3e')){var _0x2415be={};_0x2415be[_0x273f0a[_0xd86d('0x27')]]={'$like':'%'+_0x581fe9[_0xd86d('0x31')][_0xd86d('0x3b')]+'%'};return _0x2415be;}})});}_0x344fe2=_['merge']({},_0x344fe2,_0x581fe9[_0xd86d('0x3f')]);var _0xd2ac02={'where':_0x344fe2['where']};return db['Schedule'][_0xd86d('0x1c')](_0xd2ac02)[_0xd86d('0x22')](function(_0x4d1fe2){_0xc582d5[_0xd86d('0x1c')]=_0x4d1fe2;if(_0x581fe9['query'][_0xd86d('0x40')]){_0x344fe2[_0xd86d('0x41')]=[{'all':!![]}];}return db[_0xd86d('0x2b')]['findAll'](_0x344fe2);})[_0xd86d('0x22')](function(_0x2e5a27){_0xc582d5[_0xd86d('0x42')]=_0x2e5a27;return _0xc582d5;})[_0xd86d('0x22')](respondWithFilteredResult(_0x24e8f1,_0x344fe2))['catch'](handleError(_0x24e8f1,null));};exports[_0xd86d('0x43')]=function(_0x48dc58,_0x12d3f0){var _0x4fa991={'raw':![],'where':{'id':_0x48dc58[_0xd86d('0x44')]['id']}},_0x47cdda={};_0x47cdda[_0xd86d('0x2f')]=_[_0xd86d('0x30')](db[_0xd86d('0x2b')]['rawAttributes']);_0x47cdda[_0xd86d('0x31')]=_[_0xd86d('0x30')](_0x48dc58[_0xd86d('0x31')]);_0x47cdda['filters']=_[_0xd86d('0x33')](_0x47cdda[_0xd86d('0x2f')],_0x47cdda[_0xd86d('0x31')]);_0x4fa991[_0xd86d('0x34')]=_[_0xd86d('0x33')](_0x47cdda[_0xd86d('0x2f')],qs[_0xd86d('0x35')](_0x48dc58['query'][_0xd86d('0x35')]));_0x4fa991['attributes']=_0x4fa991[_0xd86d('0x34')][_0xd86d('0x36')]?_0x4fa991[_0xd86d('0x34')]:_0x47cdda[_0xd86d('0x2f')];if(_0x48dc58[_0xd86d('0x31')]['includeAll']){_0x4fa991[_0xd86d('0x41')]=[{'all':!![]}];}_0x4fa991=_[_0xd86d('0x3d')]({},_0x4fa991,_0x48dc58['options']);return db[_0xd86d('0x2b')][_0xd86d('0x45')](_0x4fa991)[_0xd86d('0x22')](handleEntityNotFound(_0x12d3f0,null))[_0xd86d('0x22')](respondWithResult(_0x12d3f0,null))[_0xd86d('0x46')](handleError(_0x12d3f0,null));};exports['create']=function(_0x3db7e0,_0x219ffc){return db[_0xd86d('0x2b')][_0xd86d('0x47')](_0x3db7e0[_0xd86d('0x48')],{})[_0xd86d('0x22')](function(_0x377b88){var _0x53e53a=_0x3db7e0[_0xd86d('0x49')][_0xd86d('0x4a')]({'plain':!![]});if(!_0x53e53a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53e53a[_0xd86d('0x4b')]===_0xd86d('0x49')){var _0x357139=_0x377b88[_0xd86d('0x4a')]({'plain':!![]});var _0x1e2bed=_0xd86d('0x4c');return db[_0xd86d('0x4d')][_0xd86d('0x45')]({'where':{'name':_0x1e2bed,'userProfileId':_0x53e53a['userProfileId']},'raw':!![]})[_0xd86d('0x22')](function(_0x81cf06){if(_0x81cf06&&_0x81cf06[_0xd86d('0x4e')]===0x0){return db[_0xd86d('0x24')][_0xd86d('0x47')]({'name':_0x357139[_0xd86d('0x27')],'resourceId':_0x357139['id'],'type':_0x81cf06[_0xd86d('0x27')],'sectionId':_0x81cf06['id']},{})[_0xd86d('0x22')](function(){return _0x377b88;});}else{return _0x377b88;}})[_0xd86d('0x46')](function(_0x2148c9){logger[_0xd86d('0x25')](_0xd86d('0x4f'),_0x2148c9);throw _0x2148c9;});}return _0x377b88;})[_0xd86d('0x22')](respondWithResult(_0x219ffc,0xc9))[_0xd86d('0x46')](handleError(_0x219ffc,null));};exports[_0xd86d('0x50')]=function(_0x3c887e,_0x2ef0b3){if(_0x3c887e[_0xd86d('0x48')]['id']){delete _0x3c887e['body']['id'];}return db['Schedule']['find']({'where':{'id':_0x3c887e[_0xd86d('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ef0b3,null))[_0xd86d('0x22')](saveUpdates(_0x3c887e[_0xd86d('0x48')],null))[_0xd86d('0x22')](respondWithResult(_0x2ef0b3,null))[_0xd86d('0x46')](handleError(_0x2ef0b3,null));};exports[_0xd86d('0x23')]=function(_0x314087,_0x565a93){return db['Schedule'][_0xd86d('0x45')]({'where':{'id':_0x314087[_0xd86d('0x44')]['id']}})[_0xd86d('0x22')](handleEntityNotFound(_0x565a93,null))[_0xd86d('0x22')](removeEntity(_0x565a93,null))[_0xd86d('0x46')](handleError(_0x565a93,null));};exports[_0xd86d('0x51')]=function(_0x522aa0,_0x1aedbd,_0x4da97d){var _0x205f63=require(_0xd86d('0x52'));return db[_0xd86d('0x2b')]['find']({'where':{'id':_0x522aa0[_0xd86d('0x44')]['id']},'raw':!![]})[_0xd86d('0x22')](handleEntityNotFound(_0x1aedbd,null))[_0xd86d('0x22')](function(){_0x205f63[_0xd86d('0x51')](_0x522aa0[_0xd86d('0x44')]['id']);})[_0xd86d('0x22')](respondWithStatusCode(_0x1aedbd,null))['catch'](handleError(_0x1aedbd,null));};
\ No newline at end of file
index a431d5e..25c3ba6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe914=['bluebird','request-promise','path','rimraf','./schedule.attributes','define','Schedule','tools_schedules','lodash','api'];(function(_0x33f00b,_0x6cf445){var _0x410562=function(_0x22482d){while(--_0x22482d){_0x33f00b['push'](_0x33f00b['shift']());}};_0x410562(++_0x6cf445);}(_0xe914,0x1b6));var _0x4e91=function(_0x1ed354,_0x4bb5be){_0x1ed354=_0x1ed354-0x0;var _0x532757=_0xe914[_0x1ed354];return _0x532757;};'use strict';var _=require(_0x4e91('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4e91('0x1'));var moment=require('moment');var BPromise=require(_0x4e91('0x2'));var rp=require(_0x4e91('0x3'));var fs=require('fs');var path=require(_0x4e91('0x4'));var rimraf=require(_0x4e91('0x5'));var config=require('../../config/environment');var attributes=require(_0x4e91('0x6'));module['exports']=function(_0x148737,_0x21f96f){return _0x148737[_0x4e91('0x7')](_0x4e91('0x8'),attributes,{'tableName':_0x4e91('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf58e=['moment','bluebird','request-promise','path','rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','api'];(function(_0xbe6a41,_0x94619f){var _0x4e57dd=function(_0x532c4f){while(--_0x532c4f){_0xbe6a41['push'](_0xbe6a41['shift']());}};_0x4e57dd(++_0x94619f);}(_0xf58e,0x1ba));var _0xef58=function(_0x4af13c,_0xc4e12e){_0x4af13c=_0x4af13c-0x0;var _0x242637=_0xf58e[_0x4af13c];return _0x242637;};'use strict';var _=require(_0xef58('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xef58('0x1'));var moment=require(_0xef58('0x2'));var BPromise=require(_0xef58('0x3'));var rp=require(_0xef58('0x4'));var fs=require('fs');var path=require(_0xef58('0x5'));var rimraf=require(_0xef58('0x6'));var config=require('../../config/environment');var attributes=require(_0xef58('0x7'));module[_0xef58('0x8')]=function(_0x2d2dec,_0x2651c0){return _0x2d2dec[_0xef58('0x9')](_0xef58('0xa'),attributes,{'tableName':_0xef58('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4ca11d5..e381082 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4364=['http','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','Schedule,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5ebca3,_0x200f96){var _0x353d06=function(_0x4ee5fa){while(--_0x4ee5fa){_0x5ebca3['push'](_0x5ebca3['shift']());}};_0x353d06(++_0x200f96);}(_0x4364,0x109));var _0x4436=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x4364[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x4436('0x0'));var util=require(_0x4436('0x1'));var moment=require(_0x4436('0x2'));var BPromise=require(_0x4436('0x3'));var rs=require(_0x4436('0x4'));var fs=require('fs');var Redis=require(_0x4436('0x5'));var db=require(_0x4436('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4436('0x7'))(_0x4436('0x8'));var config=require(_0x4436('0x9'));var jayson=require(_0x4436('0xa'));var client=jayson['client'][_0x4436('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d1a6b,_0x255556,_0x5a204a){return new BPromise(function(_0x3fa62d,_0x29222d){return client[_0x4436('0xc')](_0x2d1a6b,_0x5a204a)[_0x4436('0xd')](function(_0x4b3032){logger[_0x4436('0xe')]('Schedule,\x20%s,\x20%s',_0x255556,_0x4436('0xf'));logger[_0x4436('0x10')](_0x4436('0x11'),_0x255556,_0x4436('0xf'),JSON['stringify'](_0x4b3032));if(_0x4b3032[_0x4436('0x12')]){if(_0x4b3032['error'][_0x4436('0x13')]===0x1f4){logger[_0x4436('0x12')]('Schedule,\x20%s,\x20%s',_0x255556,_0x4b3032['error'][_0x4436('0x14')]);return _0x29222d(_0x4b3032['error']['message']);}logger[_0x4436('0x12')]('Schedule,\x20%s,\x20%s',_0x255556,_0x4b3032[_0x4436('0x12')][_0x4436('0x14')]);return _0x3fa62d(_0x4b3032[_0x4436('0x12')][_0x4436('0x14')]);}else{logger[_0x4436('0xe')](_0x4436('0x15'),_0x255556,'request\x20sent');_0x3fa62d(_0x4b3032['result']['message']);}})[_0x4436('0x16')](function(_0x13e0e1){logger[_0x4436('0x12')](_0x4436('0x15'),_0x255556,_0x13e0e1);_0x29222d(_0x13e0e1);});});}
\ No newline at end of file
+var _0x30a0=['error','code','message','result','lodash','util','moment','ioredis','../../config/environment','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x588f2c,_0x10e069){var _0x467467=function(_0xa0110d){while(--_0xa0110d){_0x588f2c['push'](_0x588f2c['shift']());}};_0x467467(++_0x10e069);}(_0x30a0,0xa6));var _0x030a=function(_0x4cc694,_0x545151){_0x4cc694=_0x4cc694-0x0;var _0x28d029=_0x30a0[_0x4cc694];return _0x28d029;};'use strict';var _=require(_0x030a('0x0'));var util=require(_0x030a('0x1'));var moment=require(_0x030a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x030a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x030a('0x4'));var jayson=require(_0x030a('0x5'));var client=jayson['client'][_0x030a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2475fb,_0xaf9481,_0x61792d){return new BPromise(function(_0x2374ad,_0x228dce){return client[_0x030a('0x7')](_0x2475fb,_0x61792d)[_0x030a('0x8')](function(_0x313264){logger[_0x030a('0x9')](_0x030a('0xa'),_0xaf9481,_0x030a('0xb'));logger[_0x030a('0xc')](_0x030a('0xd'),_0xaf9481,'request\x20sent',JSON['stringify'](_0x313264));if(_0x313264[_0x030a('0xe')]){if(_0x313264['error'][_0x030a('0xf')]===0x1f4){logger[_0x030a('0xe')]('Schedule,\x20%s,\x20%s',_0xaf9481,_0x313264[_0x030a('0xe')]['message']);return _0x228dce(_0x313264['error']['message']);}logger['error'](_0x030a('0xa'),_0xaf9481,_0x313264[_0x030a('0xe')][_0x030a('0x10')]);return _0x2374ad(_0x313264[_0x030a('0xe')][_0x030a('0x10')]);}else{logger['info'](_0x030a('0xa'),_0xaf9481,_0x030a('0xb'));_0x2374ad(_0x313264[_0x030a('0x11')]['message']);}})['catch'](function(_0x40d000){logger[_0x030a('0xe')](_0x030a('0xa'),_0xaf9481,_0x40d000);_0x228dce(_0x40d000);});});}
\ No newline at end of file
index 3c83fd0..a4d3a60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7850=['get','/describe','describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index'];(function(_0x34450e,_0x350b08){var _0x348049=function(_0x43e6ef){while(--_0x43e6ef){_0x34450e['push'](_0x34450e['shift']());}};_0x348049(++_0x350b08);}(_0x7850,0x6e));var _0x0785=function(_0x443bd4,_0x19502f){_0x443bd4=_0x443bd4-0x0;var _0x124f7c=_0x7850[_0x443bd4];return _0x124f7c;};'use strict';var multer=require(_0x0785('0x0'));var util=require(_0x0785('0x1'));var path=require(_0x0785('0x2'));var timeout=require(_0x0785('0x3'));var express=require(_0x0785('0x4'));var router=express[_0x0785('0x5')]();var auth=require(_0x0785('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0785('0x7'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0x0785('0x8')](),controller[_0x0785('0x9')]);router[_0x0785('0xa')](_0x0785('0xb'),auth['isAuthenticated'](),controller[_0x0785('0xc')]);router[_0x0785('0xa')](_0x0785('0xd'),auth['isAuthenticated'](),controller[_0x0785('0xe')]);router[_0x0785('0xa')](_0x0785('0xf'),auth[_0x0785('0x8')](),controller[_0x0785('0x10')]);router[_0x0785('0x11')]('/',auth[_0x0785('0x8')](),controller[_0x0785('0x12')]);router[_0x0785('0x13')](_0x0785('0xd'),auth['isAuthenticated'](),controller[_0x0785('0x14')]);router[_0x0785('0x15')](_0x0785('0xd'),auth['isAuthenticated'](),controller[_0x0785('0x16')]);module[_0x0785('0x17')]=router;
\ No newline at end of file
+var _0x2550=['Router','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','/:id','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x453b6d,_0x42c4b6){var _0x2510d8=function(_0x5762c6){while(--_0x5762c6){_0x453b6d['push'](_0x453b6d['shift']());}};_0x2510d8(++_0x42c4b6);}(_0x2550,0xeb));var _0x0255=function(_0xb00f0d,_0xa51fd3){_0xb00f0d=_0xb00f0d-0x0;var _0x2a9876=_0x2550[_0xb00f0d];return _0x2a9876;};'use strict';var multer=require(_0x0255('0x0'));var util=require(_0x0255('0x1'));var path=require(_0x0255('0x2'));var timeout=require(_0x0255('0x3'));var express=require(_0x0255('0x4'));var router=express[_0x0255('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0255('0x6'));var controller=require(_0x0255('0x7'));router[_0x0255('0x8')]('/',auth[_0x0255('0x9')](),controller[_0x0255('0xa')]);router[_0x0255('0x8')](_0x0255('0xb'),auth[_0x0255('0x9')](),controller[_0x0255('0xc')]);router[_0x0255('0x8')]('/:id',auth[_0x0255('0x9')](),controller[_0x0255('0xd')]);router[_0x0255('0x8')](_0x0255('0xe'),auth['isAuthenticated'](),controller[_0x0255('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0255('0x10'),auth['isAuthenticated'](),controller[_0x0255('0x11')]);router[_0x0255('0x12')](_0x0255('0x10'),auth[_0x0255('0x9')](),controller['destroy']);module[_0x0255('0x13')]=router;
\ No newline at end of file
index 55ea781..a87b367 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a19=['VIRTUAL','getDataValue','value','extname','STRING','INTEGER','setDataValue','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','exports'];(function(_0x4b784d,_0x5efb2f){var _0x2cdeaf=function(_0x106242){while(--_0x106242){_0x4b784d['push'](_0x4b784d['shift']());}};_0x2cdeaf(++_0x5efb2f);}(_0x9a19,0x114));var _0x99a1=function(_0x351509,_0x54725c){_0x351509=_0x351509-0x0;var _0x4e9861=_0x9a19[_0x351509];return _0x4e9861;};'use strict';var Sequelize=require(_0x99a1('0x0'));var moment=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var config=require('../../config/environment');module[_0x99a1('0x3')]={'format':{'type':Sequelize[_0x99a1('0x4')],'get':function(){return this[_0x99a1('0x5')](_0x99a1('0x6'))?path[_0x99a1('0x7')](this[_0x99a1('0x5')](_0x99a1('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x99a1('0x8')]},'channel':{'type':Sequelize[_0x99a1('0x8')]},'value':{'type':Sequelize[_0x99a1('0x8')],'set':function(_0x65045d){var _0x523b9e=_0x65045d['replace'](/\\/g,'/');this['setDataValue'](_0x99a1('0x6'),_0x523b9e);}},'rating':{'type':Sequelize[_0x99a1('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5874fc){this[_0x99a1('0xa')](_0x99a1('0xb'),moment()[_0x99a1('0xc')](_0x5874fc,'ms'));this[_0x99a1('0xa')](_0x99a1('0xd'),moment());this['setDataValue'](_0x99a1('0xe'),_0x5874fc);}},'startedAt':{'type':Sequelize[_0x99a1('0xf')],'get':function(){return moment(this[_0x99a1('0x5')](_0x99a1('0xb')))[_0x99a1('0x10')](_0x99a1('0x11'))[_0x99a1('0x12')]();}},'closedAt':{'type':Sequelize[_0x99a1('0xf')],'get':function(){return moment(this[_0x99a1('0x5')](_0x99a1('0xd')))[_0x99a1('0x10')](_0x99a1('0x11'))[_0x99a1('0x12')]();}},'createdAt':{'type':Sequelize[_0x99a1('0xf')],'get':function(){return moment(this[_0x99a1('0x5')]('createdAt'))[_0x99a1('0x10')](_0x99a1('0x11'))[_0x99a1('0x12')]();}},'updatedAt':{'type':Sequelize[_0x99a1('0xf')],'get':function(){return moment(this[_0x99a1('0x5')](_0x99a1('0x13')))[_0x99a1('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}}};
\ No newline at end of file
+var _0xb138=['extname','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xb138,0x1dd));var _0x8b13=function(_0x3849a1,_0x38b53f){_0x3849a1=_0x3849a1-0x0;var _0x49364=_0xb138[_0x3849a1];return _0x49364;};'use strict';var Sequelize=require(_0x8b13('0x0'));var moment=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var config=require(_0x8b13('0x3'));module[_0x8b13('0x4')]={'format':{'type':Sequelize[_0x8b13('0x5')],'get':function(){return this[_0x8b13('0x6')]('value')?path[_0x8b13('0x7')](this[_0x8b13('0x6')](_0x8b13('0x8'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8b13('0x9')]},'value':{'type':Sequelize[_0x8b13('0x9')],'set':function(_0x5d51b1){var _0x3fdf4d=_0x5d51b1[_0x8b13('0xa')](/\\/g,'/');this[_0x8b13('0xb')]('value',_0x3fdf4d);}},'rating':{'type':Sequelize[_0x8b13('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x8b13('0xc')],'set':function(_0x58683a){this['setDataValue'](_0x8b13('0xd'),moment()[_0x8b13('0xe')](_0x58683a,'ms'));this[_0x8b13('0xb')](_0x8b13('0xf'),moment());this[_0x8b13('0xb')]('duration',_0x58683a);}},'startedAt':{'type':Sequelize[_0x8b13('0x10')],'get':function(){return moment(this[_0x8b13('0x6')](_0x8b13('0xd')))[_0x8b13('0x11')](_0x8b13('0x12'))[_0x8b13('0x13')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x8b13('0xf')))[_0x8b13('0x11')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8b13('0x6')](_0x8b13('0x14')))[_0x8b13('0x11')](_0x8b13('0x12'))[_0x8b13('0x13')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x8b13('0x6')](_0x8b13('0x15')))[_0x8b13('0x11')](_0x8b13('0x12'))[_0x8b13('0x13')]();}}};
\ No newline at end of file
index 7569d31..83e1120 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f91=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','catch','show','params','length','options','find','body','duration','createdAt','closedAt','value','describe','download','uniqueid','join','root','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','server/files/screen_recordings','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x2cbab9,_0x1fa591){var _0x3a77a9=function(_0x2824b8){while(--_0x2824b8){_0x2cbab9['push'](_0x2cbab9['shift']());}};_0x3a77a9(++_0x1fa591);}(_0x9f91,0x11c));var _0x19f9=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0x9f91[_0x51cc1d];return _0x2eb9f2;};'use strict';var pdf=require(_0x19f9('0x0'));var emlformat=require(_0x19f9('0x1'));var rimraf=require(_0x19f9('0x2'));var zipdir=require(_0x19f9('0x3'));var jsonpatch=require(_0x19f9('0x4'));var rp=require('request-promise');var moment=require(_0x19f9('0x5'));var BPromise=require(_0x19f9('0x6'));var Mustache=require('mustache');var util=require(_0x19f9('0x7'));var path=require(_0x19f9('0x8'));var sox=require(_0x19f9('0x9'));var csv=require(_0x19f9('0xa'));var ejs=require(_0x19f9('0xb'));var fs=require('fs');var _=require(_0x19f9('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x19f9('0xd'));var deskjs=require(_0x19f9('0xe'));var toCsv=require(_0x19f9('0xa'));var querystring=require(_0x19f9('0xf'));var Papa=require(_0x19f9('0x10'));var Redis=require(_0x19f9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x19f9('0x12'));var as=require(_0x19f9('0x13'));var hardwareService=require(_0x19f9('0x14'));var logger=require(_0x19f9('0x15'))('api');var utils=require(_0x19f9('0x16'));var config=require(_0x19f9('0x17'));var db=require(_0x19f9('0x18'))['db'];function respondWithStatusCode(_0x387fcf,_0x11b1ab){_0x11b1ab=_0x11b1ab||0xcc;return function(_0x5ea836){if(_0x5ea836){return _0x387fcf['sendStatus'](_0x11b1ab);}return _0x387fcf[_0x19f9('0x19')](_0x11b1ab)[_0x19f9('0x1a')]();};}function respondWithResult(_0x526a86,_0x4602a2){_0x4602a2=_0x4602a2||0xc8;return function(_0x7970b3){if(_0x7970b3){return _0x526a86[_0x19f9('0x19')](_0x4602a2)[_0x19f9('0x1b')](_0x7970b3);}};}function respondWithFilteredResult(_0x5c9a59,_0x419dc8){return function(_0x570004){if(_0x570004){var _0x436792=_0x570004[_0x19f9('0x1c')],_0x285ddb=_0x419dc8['offset'],_0x1764ba=_0x419dc8[_0x19f9('0x1d')]+_0x419dc8[_0x19f9('0x1e')],_0x54ac41;if(_0x1764ba>=_0x436792){_0x1764ba=_0x436792;_0x54ac41=0xc8;}else{_0x54ac41=0xce;}_0x5c9a59[_0x19f9('0x19')](_0x54ac41);return _0x5c9a59[_0x19f9('0x1f')](_0x19f9('0x20'),_0x285ddb+'-'+_0x1764ba+'/'+_0x436792)[_0x19f9('0x1b')](_0x570004);}return null;};}function patchUpdates(_0x530ce7){return function(_0x15947b){try{jsonpatch[_0x19f9('0x21')](_0x15947b,_0x530ce7,!![]);}catch(_0x25fe74){return BPromise['reject'](_0x25fe74);}return _0x15947b[_0x19f9('0x22')]();};}function saveUpdates(_0x37ff40,_0x4bad29){return function(_0x46ede6){if(_0x46ede6){return _0x46ede6[_0x19f9('0x23')](_0x37ff40)[_0x19f9('0x24')](function(_0x835108){return _0x835108;});}return null;};}function removeEntity(_0x3a9e26,_0xd7355b){return function(_0x343417){if(_0x343417){return _0x343417[_0x19f9('0x25')]()[_0x19f9('0x24')](function(){_0x3a9e26['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c06ad,_0xdb554f){return function(_0x166d13){if(!_0x166d13){_0x3c06ad[_0x19f9('0x26')](0x194);}return _0x166d13;};}function handleError(_0x17d974,_0xc72d62){_0xc72d62=_0xc72d62||0x1f4;return function(_0x2cff8c){logger[_0x19f9('0x27')](_0x2cff8c['stack']);if(_0x2cff8c[_0x19f9('0x28')]){delete _0x2cff8c[_0x19f9('0x28')];}_0x17d974[_0x19f9('0x19')](_0xc72d62)[_0x19f9('0x29')](_0x2cff8c);};}exports['index']=function(_0x4721c6,_0x568d04){var _0x104a20={},_0x18123f={},_0x222bc5={'count':0x0,'rows':[]};var _0x32d6f7=_[_0x19f9('0x2a')](db[_0x19f9('0x2b')][_0x19f9('0x2c')],function(_0x588e61){return{'name':_0x588e61[_0x19f9('0x2d')],'type':_0x588e61[_0x19f9('0x2e')][_0x19f9('0x2f')]};});_0x18123f[_0x19f9('0x30')]=_['differenceBy'](_[_0x19f9('0x2a')](_0x32d6f7,'name'),['format']);_0x18123f[_0x19f9('0x31')]=_[_0x19f9('0x32')](_0x4721c6[_0x19f9('0x31')]);_0x18123f[_0x19f9('0x33')]=_[_0x19f9('0x34')](_0x18123f[_0x19f9('0x30')],_0x18123f[_0x19f9('0x31')]);_0x104a20[_0x19f9('0x35')]=_['intersection'](_0x18123f[_0x19f9('0x30')],qs[_0x19f9('0x36')](_0x4721c6[_0x19f9('0x31')][_0x19f9('0x36')]));_0x104a20[_0x19f9('0x35')]=_0x104a20[_0x19f9('0x35')]['length']?_0x104a20[_0x19f9('0x35')]:_0x18123f['model'];if(!_0x4721c6[_0x19f9('0x31')][_0x19f9('0x37')](_0x19f9('0x38'))){_0x104a20[_0x19f9('0x1e')]=qs['limit'](_0x4721c6[_0x19f9('0x31')][_0x19f9('0x1e')]);_0x104a20[_0x19f9('0x1d')]=qs[_0x19f9('0x1d')](_0x4721c6[_0x19f9('0x31')][_0x19f9('0x1d')]);}_0x104a20['order']=qs[_0x19f9('0x39')](_0x4721c6['query'][_0x19f9('0x39')]);_0x104a20[_0x19f9('0x3a')]=qs['filters'](_[_0x19f9('0x3b')](_0x4721c6['query'],_0x18123f[_0x19f9('0x33')]),_0x32d6f7);if(_0x4721c6[_0x19f9('0x31')]['filter']){_0x104a20['where']=_['merge'](_0x104a20['where'],{'$or':_['map'](_0x32d6f7,function(_0x2e231e){if(_0x2e231e['type']!==_0x19f9('0x3c')){var _0x1a7b11={};_0x1a7b11[_0x2e231e[_0x19f9('0x28')]]={'$like':'%'+_0x4721c6[_0x19f9('0x31')][_0x19f9('0x3d')]+'%'};return _0x1a7b11;}})});}_0x104a20=_[_0x19f9('0x3e')]({},_0x104a20,_0x4721c6['options']);var _0x4d3703={'where':_0x104a20[_0x19f9('0x3a')]};return db[_0x19f9('0x2b')][_0x19f9('0x1c')](_0x4d3703)[_0x19f9('0x24')](function(_0x2a57c3){_0x222bc5[_0x19f9('0x1c')]=_0x2a57c3;if(_0x4721c6[_0x19f9('0x31')][_0x19f9('0x3f')]){_0x104a20[_0x19f9('0x40')]=[{'all':!![]}];}return db[_0x19f9('0x2b')][_0x19f9('0x41')](_0x104a20);})[_0x19f9('0x24')](function(_0xb7903){_0x222bc5['rows']=_0xb7903;return _0x222bc5;})[_0x19f9('0x24')](respondWithFilteredResult(_0x568d04,_0x104a20))[_0x19f9('0x42')](handleError(_0x568d04,null));};exports[_0x19f9('0x43')]=function(_0x48c162,_0x2b1e55){var _0x5dd0af={'raw':![],'where':{'id':_0x48c162[_0x19f9('0x44')]['id']}},_0x4c80af={};_0x4c80af['model']=_[_0x19f9('0x32')](db[_0x19f9('0x2b')][_0x19f9('0x2c')]);_0x4c80af[_0x19f9('0x31')]=_[_0x19f9('0x32')](_0x48c162[_0x19f9('0x31')]);_0x4c80af[_0x19f9('0x33')]=_['intersection'](_0x4c80af[_0x19f9('0x30')],_0x4c80af['query']);_0x5dd0af[_0x19f9('0x35')]=_[_0x19f9('0x34')](_0x4c80af[_0x19f9('0x30')],qs['fields'](_0x48c162[_0x19f9('0x31')][_0x19f9('0x36')]));_0x5dd0af[_0x19f9('0x35')]=_0x5dd0af[_0x19f9('0x35')][_0x19f9('0x45')]?_0x5dd0af[_0x19f9('0x35')]:_0x4c80af['model'];if(_0x48c162[_0x19f9('0x31')][_0x19f9('0x3f')]){_0x5dd0af[_0x19f9('0x40')]=[{'all':!![]}];}_0x5dd0af=_[_0x19f9('0x3e')]({},_0x5dd0af,_0x48c162[_0x19f9('0x46')]);return db[_0x19f9('0x2b')][_0x19f9('0x47')](_0x5dd0af)[_0x19f9('0x24')](handleEntityNotFound(_0x2b1e55,null))[_0x19f9('0x24')](respondWithResult(_0x2b1e55,null))[_0x19f9('0x42')](handleError(_0x2b1e55,null));};exports['create']=function(_0x46319b,_0x294cca){return db[_0x19f9('0x2b')]['create'](_0x46319b[_0x19f9('0x48')],{})[_0x19f9('0x24')](respondWithResult(_0x294cca,0xc9))[_0x19f9('0x42')](handleError(_0x294cca,null));};exports['update']=function(_0x1438fe,_0x499dd1){if(_0x1438fe[_0x19f9('0x48')]['id']){delete _0x1438fe[_0x19f9('0x48')]['id'];}delete _0x1438fe[_0x19f9('0x48')][_0x19f9('0x49')];delete _0x1438fe[_0x19f9('0x48')][_0x19f9('0x4a')];delete _0x1438fe[_0x19f9('0x48')][_0x19f9('0x4b')];delete _0x1438fe['body'][_0x19f9('0x4c')];return db[_0x19f9('0x2b')][_0x19f9('0x47')]({'where':{'id':_0x1438fe[_0x19f9('0x44')]['id']}})['then'](handleEntityNotFound(_0x499dd1,null))[_0x19f9('0x24')](saveUpdates(_0x1438fe['body'],null))[_0x19f9('0x24')](respondWithResult(_0x499dd1,null))[_0x19f9('0x42')](handleError(_0x499dd1,null));};exports[_0x19f9('0x4d')]=function(_0x9f842f,_0x423fea){return db[_0x19f9('0x2b')][_0x19f9('0x4d')]()[_0x19f9('0x24')](respondWithResult(_0x423fea,null))[_0x19f9('0x42')](handleError(_0x423fea,null));};exports[_0x19f9('0x4e')]=function(_0x3dbd60,_0x475a37,_0xc49e36){var _0x24b1de=require('../../components/encryptor');var _0xa0a159=![];var _0x489215={};if(_0x3dbd60['query']['type']&&_0x3dbd60[_0x19f9('0x31')]['type']===_0x19f9('0x4f')){_0x489215[_0x19f9('0x4f')]=_0x3dbd60[_0x19f9('0x44')]['id'];}else{_0x489215['id']=_0x3dbd60[_0x19f9('0x44')]['id'];}return db[_0x19f9('0x2b')][_0x19f9('0x47')]({'where':_0x489215,'attributes':['id',_0x19f9('0x4c')],'raw':!![]})[_0x19f9('0x24')](handleEntityNotFound(_0x475a37,null))['then'](function(_0x37de57){if(_0x37de57){var _0x64aa8f=path[_0x19f9('0x50')](config[_0x19f9('0x51')],'server/files/screen_recordings',_0x37de57[_0x19f9('0x4c')]);var _0x33815d=util[_0x19f9('0x52')]('%s.cypher',_0x64aa8f);if(fs[_0x19f9('0x53')](_0x33815d)){_0xa0a159=!![];return _0x24b1de[_0x19f9('0x54')](_0x33815d,_0x64aa8f,config[_0x19f9('0x55')][_0x19f9('0x56')])[_0x19f9('0x24')](function(){return _0x37de57;});}return _0x37de57;}})[_0x19f9('0x24')](function(_0xece391){if(_0xece391){var _0x4a16e9=path[_0x19f9('0x50')](config[_0x19f9('0x51')],'server/files/screen_recordings',_0xece391['value']);if(!fs['existsSync'](_0x4a16e9)){throw new db[(_0x19f9('0x57'))][(_0x19f9('0x58'))](_0x19f9('0x59'));}if(_0xece391['filename']){return _0x475a37[_0x19f9('0x4e')](_0x4a16e9,_0xece391[_0x19f9('0x5a')]+path['extname'](_0x4a16e9),function(){if(_0xa0a159){fs[_0x19f9('0x5b')](_0x4a16e9);}});}else{return _0x475a37['download'](_0x4a16e9,function(_0x4bf42e){if(_0xa0a159){fs['unlink'](_0x4a16e9);}});}}})[_0x19f9('0x42')](function(_0x370662){if(_0x370662[_0x19f9('0x5c')]==='ScreenRecording\x20not\x20found'){_0x475a37['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x475a37,null);}});};exports[_0x19f9('0x25')]=function(_0x57ca83,_0x404d8d){return db['ScreenRecording'][_0x19f9('0x47')]({'where':{'id':_0x57ca83['params']['id']}})[_0x19f9('0x24')](function(_0x3c1a3b){if(!_0x3c1a3b)throw new ReferenceError('Entity\x20not\x20found');return _0x3c1a3b;})[_0x19f9('0x24')](function(_0x2bac09){var _0x1b45b7=path[_0x19f9('0x50')](config[_0x19f9('0x51')],_0x19f9('0x5d'),_0x2bac09['value']);logger[_0x19f9('0x5e')](_0x19f9('0x5f'),_0x1b45b7);if(!_[_0x19f9('0x60')](_0x2bac09[_0x19f9('0x4c')])&&fs['existsSync'](_0x1b45b7)){logger[_0x19f9('0x5e')]('File:\x20\x22'+_0x1b45b7+_0x19f9('0x61'));fs[_0x19f9('0x62')](_0x1b45b7);}_0x1b45b7=_0x1b45b7+_0x19f9('0x63');if(!_[_0x19f9('0x60')](_0x2bac09['value'])&&fs[_0x19f9('0x53')](_0x1b45b7)){logger[_0x19f9('0x5e')](_0x19f9('0x64')+_0x1b45b7+_0x19f9('0x61'));fs['unlinkSync'](_0x1b45b7);}return _0x2bac09;})['then'](function(_0x3ec825){if(!_0x3ec825)throw new InternalError();return _0x3ec825[_0x19f9('0x25')]();})[_0x19f9('0x24')](function(){_0x404d8d[_0x19f9('0x19')](0xcc)[_0x19f9('0x1a')]();})[_0x19f9('0x42')](handleError(_0x404d8d,null));};
\ No newline at end of file
+var _0xebe5=['fast-json-patch','request-promise','bluebird','mustache','path','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','reject','save','destroy','then','end','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','key','model','differenceBy','format','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','duration','closedAt','describe','download','../../components/encryptor','uniqueid','value','join','%s.cypher','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','root','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir'];(function(_0x4d8789,_0x3fdff1){var _0x404e41=function(_0x33d5a6){while(--_0x33d5a6){_0x4d8789['push'](_0x4d8789['shift']());}};_0x404e41(++_0x3fdff1);}(_0xebe5,0xc9));var _0x5ebe=function(_0x44080e,_0x537af9){_0x44080e=_0x44080e-0x0;var _0x15c6b9=_0xebe5[_0x44080e];return _0x15c6b9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5ebe('0x0'));var rimraf=require(_0x5ebe('0x1'));var zipdir=require(_0x5ebe('0x2'));var jsonpatch=require(_0x5ebe('0x3'));var rp=require(_0x5ebe('0x4'));var moment=require('moment');var BPromise=require(_0x5ebe('0x5'));var Mustache=require(_0x5ebe('0x6'));var util=require('util');var path=require(_0x5ebe('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x5ebe('0x8'));var squel=require(_0x5ebe('0x9'));var crypto=require('crypto');var jsforce=require(_0x5ebe('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5ebe('0xb'));var querystring=require(_0x5ebe('0xc'));var Papa=require(_0x5ebe('0xd'));var Redis=require(_0x5ebe('0xe'));var authService=require(_0x5ebe('0xf'));var qs=require(_0x5ebe('0x10'));var as=require(_0x5ebe('0x11'));var hardwareService=require(_0x5ebe('0x12'));var logger=require(_0x5ebe('0x13'))(_0x5ebe('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5ebe('0x15'))['db'];function respondWithStatusCode(_0x4ae01c,_0x1d16b9){_0x1d16b9=_0x1d16b9||0xcc;return function(_0x389939){if(_0x389939){return _0x4ae01c[_0x5ebe('0x16')](_0x1d16b9);}return _0x4ae01c[_0x5ebe('0x17')](_0x1d16b9)['end']();};}function respondWithResult(_0xae8193,_0x5b65d5){_0x5b65d5=_0x5b65d5||0xc8;return function(_0x27cd74){if(_0x27cd74){return _0xae8193['status'](_0x5b65d5)[_0x5ebe('0x18')](_0x27cd74);}};}function respondWithFilteredResult(_0x5d7e99,_0x5e5873){return function(_0x1a11b8){if(_0x1a11b8){var _0x30210d=_0x1a11b8[_0x5ebe('0x19')],_0x46cec5=_0x5e5873[_0x5ebe('0x1a')],_0x354566=_0x5e5873[_0x5ebe('0x1a')]+_0x5e5873['limit'],_0x3a1e3d;if(_0x354566>=_0x30210d){_0x354566=_0x30210d;_0x3a1e3d=0xc8;}else{_0x3a1e3d=0xce;}_0x5d7e99['status'](_0x3a1e3d);return _0x5d7e99['set'](_0x5ebe('0x1b'),_0x46cec5+'-'+_0x354566+'/'+_0x30210d)[_0x5ebe('0x18')](_0x1a11b8);}return null;};}function patchUpdates(_0x54af91){return function(_0x3175cd){try{jsonpatch['apply'](_0x3175cd,_0x54af91,!![]);}catch(_0x1bf663){return BPromise[_0x5ebe('0x1c')](_0x1bf663);}return _0x3175cd[_0x5ebe('0x1d')]();};}function saveUpdates(_0x3bb98e,_0x2f38d0){return function(_0x3f1f5f){if(_0x3f1f5f){return _0x3f1f5f['update'](_0x3bb98e)['then'](function(_0x147ee2){return _0x147ee2;});}return null;};}function removeEntity(_0x3a45a1,_0x4293b3){return function(_0x4ef769){if(_0x4ef769){return _0x4ef769[_0x5ebe('0x1e')]()[_0x5ebe('0x1f')](function(){_0x3a45a1[_0x5ebe('0x17')](0xcc)[_0x5ebe('0x20')]();});}};}function handleEntityNotFound(_0x4a023c,_0x408081){return function(_0x30cd4a){if(!_0x30cd4a){_0x4a023c['sendStatus'](0x194);}return _0x30cd4a;};}function handleError(_0x1209aa,_0x5007b6){_0x5007b6=_0x5007b6||0x1f4;return function(_0x2fc3e3){logger[_0x5ebe('0x21')](_0x2fc3e3['stack']);if(_0x2fc3e3['name']){delete _0x2fc3e3[_0x5ebe('0x22')];}_0x1209aa[_0x5ebe('0x17')](_0x5007b6)[_0x5ebe('0x23')](_0x2fc3e3);};}exports[_0x5ebe('0x24')]=function(_0xf1bcad,_0x1c6bd8){var _0xb0f8ea={},_0x14c6e4={},_0x89b8be={'count':0x0,'rows':[]};var _0x192d3c=_[_0x5ebe('0x25')](db[_0x5ebe('0x26')][_0x5ebe('0x27')],function(_0x9d0c95){return{'name':_0x9d0c95[_0x5ebe('0x28')],'type':_0x9d0c95['type'][_0x5ebe('0x29')]};});_0x14c6e4[_0x5ebe('0x2a')]=_[_0x5ebe('0x2b')](_[_0x5ebe('0x25')](_0x192d3c,'name'),[_0x5ebe('0x2c')]);_0x14c6e4[_0x5ebe('0x2d')]=_['keys'](_0xf1bcad[_0x5ebe('0x2d')]);_0x14c6e4[_0x5ebe('0x2e')]=_[_0x5ebe('0x2f')](_0x14c6e4[_0x5ebe('0x2a')],_0x14c6e4[_0x5ebe('0x2d')]);_0xb0f8ea[_0x5ebe('0x30')]=_[_0x5ebe('0x2f')](_0x14c6e4[_0x5ebe('0x2a')],qs['fields'](_0xf1bcad[_0x5ebe('0x2d')][_0x5ebe('0x31')]));_0xb0f8ea[_0x5ebe('0x30')]=_0xb0f8ea['attributes']['length']?_0xb0f8ea[_0x5ebe('0x30')]:_0x14c6e4[_0x5ebe('0x2a')];if(!_0xf1bcad[_0x5ebe('0x2d')][_0x5ebe('0x32')](_0x5ebe('0x33'))){_0xb0f8ea['limit']=qs[_0x5ebe('0x34')](_0xf1bcad['query']['limit']);_0xb0f8ea['offset']=qs[_0x5ebe('0x1a')](_0xf1bcad[_0x5ebe('0x2d')][_0x5ebe('0x1a')]);}_0xb0f8ea['order']=qs[_0x5ebe('0x35')](_0xf1bcad['query'][_0x5ebe('0x35')]);_0xb0f8ea['where']=qs[_0x5ebe('0x2e')](_[_0x5ebe('0x36')](_0xf1bcad[_0x5ebe('0x2d')],_0x14c6e4[_0x5ebe('0x2e')]),_0x192d3c);if(_0xf1bcad[_0x5ebe('0x2d')][_0x5ebe('0x37')]){_0xb0f8ea[_0x5ebe('0x38')]=_[_0x5ebe('0x39')](_0xb0f8ea[_0x5ebe('0x38')],{'$or':_[_0x5ebe('0x25')](_0x192d3c,function(_0x13e94f){if(_0x13e94f[_0x5ebe('0x3a')]!==_0x5ebe('0x3b')){var _0x56d4a7={};_0x56d4a7[_0x13e94f['name']]={'$like':'%'+_0xf1bcad[_0x5ebe('0x2d')]['filter']+'%'};return _0x56d4a7;}})});}_0xb0f8ea=_[_0x5ebe('0x39')]({},_0xb0f8ea,_0xf1bcad[_0x5ebe('0x3c')]);var _0x3435f5={'where':_0xb0f8ea[_0x5ebe('0x38')]};return db['ScreenRecording'][_0x5ebe('0x19')](_0x3435f5)[_0x5ebe('0x1f')](function(_0x49abac){_0x89b8be['count']=_0x49abac;if(_0xf1bcad[_0x5ebe('0x2d')][_0x5ebe('0x3d')]){_0xb0f8ea[_0x5ebe('0x3e')]=[{'all':!![]}];}return db['ScreenRecording'][_0x5ebe('0x3f')](_0xb0f8ea);})[_0x5ebe('0x1f')](function(_0x5e2f65){_0x89b8be[_0x5ebe('0x40')]=_0x5e2f65;return _0x89b8be;})[_0x5ebe('0x1f')](respondWithFilteredResult(_0x1c6bd8,_0xb0f8ea))['catch'](handleError(_0x1c6bd8,null));};exports[_0x5ebe('0x41')]=function(_0x3b4d30,_0x50c809){var _0x3c1156={'raw':![],'where':{'id':_0x3b4d30[_0x5ebe('0x42')]['id']}},_0x238e0d={};_0x238e0d[_0x5ebe('0x2a')]=_[_0x5ebe('0x43')](db[_0x5ebe('0x26')][_0x5ebe('0x27')]);_0x238e0d[_0x5ebe('0x2d')]=_[_0x5ebe('0x43')](_0x3b4d30[_0x5ebe('0x2d')]);_0x238e0d[_0x5ebe('0x2e')]=_[_0x5ebe('0x2f')](_0x238e0d[_0x5ebe('0x2a')],_0x238e0d[_0x5ebe('0x2d')]);_0x3c1156[_0x5ebe('0x30')]=_[_0x5ebe('0x2f')](_0x238e0d[_0x5ebe('0x2a')],qs['fields'](_0x3b4d30[_0x5ebe('0x2d')][_0x5ebe('0x31')]));_0x3c1156[_0x5ebe('0x30')]=_0x3c1156['attributes']['length']?_0x3c1156[_0x5ebe('0x30')]:_0x238e0d[_0x5ebe('0x2a')];if(_0x3b4d30[_0x5ebe('0x2d')]['includeAll']){_0x3c1156[_0x5ebe('0x3e')]=[{'all':!![]}];}_0x3c1156=_[_0x5ebe('0x39')]({},_0x3c1156,_0x3b4d30['options']);return db[_0x5ebe('0x26')][_0x5ebe('0x44')](_0x3c1156)[_0x5ebe('0x1f')](handleEntityNotFound(_0x50c809,null))[_0x5ebe('0x1f')](respondWithResult(_0x50c809,null))[_0x5ebe('0x45')](handleError(_0x50c809,null));};exports[_0x5ebe('0x46')]=function(_0x4a8e74,_0x1c32d2){return db['ScreenRecording'][_0x5ebe('0x46')](_0x4a8e74['body'],{})[_0x5ebe('0x1f')](respondWithResult(_0x1c32d2,0xc9))[_0x5ebe('0x45')](handleError(_0x1c32d2,null));};exports['update']=function(_0x4637a4,_0x1d64b3){if(_0x4637a4[_0x5ebe('0x47')]['id']){delete _0x4637a4[_0x5ebe('0x47')]['id'];}delete _0x4637a4[_0x5ebe('0x47')][_0x5ebe('0x48')];delete _0x4637a4[_0x5ebe('0x47')]['createdAt'];delete _0x4637a4[_0x5ebe('0x47')][_0x5ebe('0x49')];delete _0x4637a4[_0x5ebe('0x47')]['value'];return db[_0x5ebe('0x26')][_0x5ebe('0x44')]({'where':{'id':_0x4637a4[_0x5ebe('0x42')]['id']}})[_0x5ebe('0x1f')](handleEntityNotFound(_0x1d64b3,null))[_0x5ebe('0x1f')](saveUpdates(_0x4637a4[_0x5ebe('0x47')],null))[_0x5ebe('0x1f')](respondWithResult(_0x1d64b3,null))['catch'](handleError(_0x1d64b3,null));};exports[_0x5ebe('0x4a')]=function(_0x2e4e14,_0x5a55a4){return db[_0x5ebe('0x26')][_0x5ebe('0x4a')]()[_0x5ebe('0x1f')](respondWithResult(_0x5a55a4,null))['catch'](handleError(_0x5a55a4,null));};exports[_0x5ebe('0x4b')]=function(_0x85c119,_0x4394be,_0x19e81f){var _0x16107b=require(_0x5ebe('0x4c'));var _0x216415=![];var _0x1ff1bd={};if(_0x85c119[_0x5ebe('0x2d')]['type']&&_0x85c119[_0x5ebe('0x2d')][_0x5ebe('0x3a')]===_0x5ebe('0x4d')){_0x1ff1bd[_0x5ebe('0x4d')]=_0x85c119[_0x5ebe('0x42')]['id'];}else{_0x1ff1bd['id']=_0x85c119[_0x5ebe('0x42')]['id'];}return db[_0x5ebe('0x26')]['find']({'where':_0x1ff1bd,'attributes':['id',_0x5ebe('0x4e')],'raw':!![]})[_0x5ebe('0x1f')](handleEntityNotFound(_0x4394be,null))[_0x5ebe('0x1f')](function(_0x3864e3){if(_0x3864e3){var _0x5759a0=path[_0x5ebe('0x4f')](config['root'],'server/files/screen_recordings',_0x3864e3[_0x5ebe('0x4e')]);var _0x53cf62=util[_0x5ebe('0x2c')](_0x5ebe('0x50'),_0x5759a0);if(fs[_0x5ebe('0x51')](_0x53cf62)){_0x216415=!![];return _0x16107b[_0x5ebe('0x52')](_0x53cf62,_0x5759a0,config[_0x5ebe('0x53')][_0x5ebe('0x54')])['then'](function(){return _0x3864e3;});}return _0x3864e3;}})[_0x5ebe('0x1f')](function(_0x4b3f35){if(_0x4b3f35){var _0x3aa352=path[_0x5ebe('0x4f')](config['root'],_0x5ebe('0x55'),_0x4b3f35[_0x5ebe('0x4e')]);if(!fs[_0x5ebe('0x51')](_0x3aa352)){throw new db[(_0x5ebe('0x56'))][(_0x5ebe('0x57'))](_0x5ebe('0x58'));}if(_0x4b3f35[_0x5ebe('0x59')]){return _0x4394be['download'](_0x3aa352,_0x4b3f35[_0x5ebe('0x59')]+path[_0x5ebe('0x5a')](_0x3aa352),function(){if(_0x216415){fs[_0x5ebe('0x5b')](_0x3aa352);}});}else{return _0x4394be[_0x5ebe('0x4b')](_0x3aa352,function(_0x322bbf){if(_0x216415){fs[_0x5ebe('0x5b')](_0x3aa352);}});}}})[_0x5ebe('0x45')](function(_0x11b098){if(_0x11b098[_0x5ebe('0x5c')]===_0x5ebe('0x58')){_0x4394be[_0x5ebe('0x17')](0x194)['send'](_0x5ebe('0x5d'));}else{return handleError(_0x4394be,null);}});};exports['destroy']=function(_0x3ec568,_0x5ab422){return db[_0x5ebe('0x26')][_0x5ebe('0x44')]({'where':{'id':_0x3ec568['params']['id']}})['then'](function(_0x3abaf9){if(!_0x3abaf9)throw new ReferenceError(_0x5ebe('0x5e'));return _0x3abaf9;})['then'](function(_0x2144c2){var _0x5f359f=path['join'](config[_0x5ebe('0x5f')],_0x5ebe('0x55'),_0x2144c2[_0x5ebe('0x4e')]);logger[_0x5ebe('0x60')]('cancellazione\x20fisica\x20documento\x20%s',_0x5f359f);if(!_[_0x5ebe('0x61')](_0x2144c2[_0x5ebe('0x4e')])&&fs[_0x5ebe('0x51')](_0x5f359f)){logger[_0x5ebe('0x60')](_0x5ebe('0x62')+_0x5f359f+_0x5ebe('0x63'));fs[_0x5ebe('0x64')](_0x5f359f);}_0x5f359f=_0x5f359f+_0x5ebe('0x65');if(!_[_0x5ebe('0x61')](_0x2144c2[_0x5ebe('0x4e')])&&fs[_0x5ebe('0x51')](_0x5f359f)){logger['info'](_0x5ebe('0x62')+_0x5f359f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x5ebe('0x64')](_0x5f359f);}return _0x2144c2;})['then'](function(_0x334eea){if(!_0x334eea)throw new InternalError();return _0x334eea[_0x5ebe('0x1e')]();})['then'](function(){_0x5ab422[_0x5ebe('0x17')](0xcc)['end']();})['catch'](handleError(_0x5ab422,null));};
\ No newline at end of file
index 11da274..697db82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e0c=['define','interactionid','util','moment','bluebird','request-promise','path','./screenRecording.attributes'];(function(_0x4887c3,_0x4cc111){var _0x4b8784=function(_0x281ac1){while(--_0x281ac1){_0x4887c3['push'](_0x4887c3['shift']());}};_0x4b8784(++_0x4cc111);}(_0x4e0c,0xb2));var _0xc4e0=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x4e0c[_0x391c55];return _0xa434e0;};'use strict';var _=require('lodash');var util=require(_0xc4e0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc4e0('0x1'));var BPromise=require(_0xc4e0('0x2'));var rp=require(_0xc4e0('0x3'));var fs=require('fs');var path=require(_0xc4e0('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc4e0('0x5'));module['exports']=function(_0x223c45,_0x335d10){return _0x223c45[_0xc4e0('0x6')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xc4e0('0x7'),'fields':[_0xc4e0('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x398a=['./screenRecording.attributes','define','ScreenRecording','interactionid','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x30c4f6,_0x5c2f4a){var _0x2affc3=function(_0x195e7e){while(--_0x195e7e){_0x30c4f6['push'](_0x30c4f6['shift']());}};_0x2affc3(++_0x5c2f4a);}(_0x398a,0xe0));var _0xa398=function(_0x1dbe2b,_0x4e6c80){_0x1dbe2b=_0x1dbe2b-0x0;var _0x2ecc3b=_0x398a[_0x1dbe2b];return _0x2ecc3b;};'use strict';var _=require(_0xa398('0x0'));var util=require(_0xa398('0x1'));var logger=require('../../config/logger')(_0xa398('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa398('0x3'));var fs=require('fs');var path=require(_0xa398('0x4'));var rimraf=require(_0xa398('0x5'));var config=require(_0xa398('0x6'));var attributes=require(_0xa398('0x7'));module['exports']=function(_0x33a281,_0x2e173c){return _0x33a281[_0xa398('0x8')](_0xa398('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xa398('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 19d5f0f..fd6ff9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x95d4cf,_0x1a7301){var _0x49549d=function(_0x2c3cbc){while(--_0x2c3cbc){_0x95d4cf['push'](_0x95d4cf['shift']());}};_0x49549d(++_0x1a7301);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x408718,_0x37fd0c){var _0x3a2e14=function(_0x41a9d9){while(--_0x41a9d9){_0x408718['push'](_0x408718['shift']());}};_0x3a2e14(++_0x37fd0c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 3fdda74..8c94c0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52e6=['Router','../../components/auth/service','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','single','addLogo','originalname','post','file','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','util','connect-timeout','express'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x52e6,0x1ca));var _0x652e=function(_0x26eb67,_0x438d55){_0x26eb67=_0x26eb67-0x0;var _0x2de906=_0x52e6[_0x26eb67];return _0x2de906;};'use strict';var multer=require(_0x652e('0x0'));var util=require(_0x652e('0x1'));var path=require('path');var timeout=require(_0x652e('0x2'));var express=require(_0x652e('0x3'));var router=express[_0x652e('0x4')]();var auth=require(_0x652e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x652e('0x6'));router[_0x652e('0x7')]('/',auth[_0x652e('0x8')](),controller[_0x652e('0x9')]);router[_0x652e('0x7')](_0x652e('0xa'),controller[_0x652e('0xb')]);router[_0x652e('0x7')](_0x652e('0xc'),controller[_0x652e('0xd')]);router['get'](_0x652e('0xe'),controller[_0x652e('0xf')]);router[_0x652e('0x7')]('/:id/gdpr',controller[_0x652e('0x10')]);router[_0x652e('0x7')]('/:id/preferred',controller[_0x652e('0x11')]);router[_0x652e('0x7')](_0x652e('0x12'),controller[_0x652e('0x13')]);var upload=multer({'storage':multer[_0x652e('0x14')]({'destination':function(_0x163791,_0x4fcd36,_0x25a990){_0x25a990(null,path[_0x652e('0x15')](config[_0x652e('0x16')],_0x652e('0x17')));},'filename':function(_0x2ea5d7,_0x3a1375,_0x42f675){_0x42f675(null,util[_0x652e('0x18')](_0x652e('0x19'),_0x652e('0x1a'),path[_0x652e('0x1b')](_0x3a1375['originalname'])));}})});router['post'](_0x652e('0xc'),upload[_0x652e('0x1c')]('file'),controller[_0x652e('0x1d')]);var upload=multer({'storage':multer[_0x652e('0x14')]({'destination':function(_0x4e2a8c,_0x14d67c,_0x5daf1a){_0x5daf1a(null,path['join'](config[_0x652e('0x16')],_0x652e('0x17')));},'filename':function(_0x2559e,_0x534d1e,_0x6aa81b){_0x6aa81b(null,util[_0x652e('0x18')](_0x652e('0x19'),'logologin',path[_0x652e('0x1b')](_0x534d1e[_0x652e('0x1e')])));}})});router[_0x652e('0x1f')](_0x652e('0xe'),upload[_0x652e('0x1c')](_0x652e('0x20')),controller[_0x652e('0x21')]);var upload=multer({'storage':multer[_0x652e('0x14')]({'destination':function(_0x33e151,_0x39632d,_0x49f2ec){_0x49f2ec(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x58ed5d,_0x5c8b4a,_0x3df432){_0x3df432(null,util[_0x652e('0x18')](_0x652e('0x19'),_0x652e('0x22'),path[_0x652e('0x1b')](_0x5c8b4a[_0x652e('0x1e')])));}})});router['post'](_0x652e('0x23'),upload[_0x652e('0x1c')](_0x652e('0x20')),controller[_0x652e('0x24')]);var upload=multer({'storage':multer[_0x652e('0x14')]({'destination':function(_0x529f36,_0x21a9ca,_0x48e17a){_0x48e17a(null,path[_0x652e('0x15')](config[_0x652e('0x16')],_0x652e('0x17')));},'filename':function(_0x4c7f74,_0x56ec75,_0x1644fd){_0x1644fd(null,util[_0x652e('0x18')](_0x652e('0x19'),_0x652e('0x25'),path[_0x652e('0x1b')](_0x56ec75[_0x652e('0x1e')])));}})});router[_0x652e('0x1f')](_0x652e('0x12'),upload['single'](_0x652e('0x20')),controller[_0x652e('0x26')]);router[_0x652e('0x27')](_0x652e('0xa'),auth[_0x652e('0x8')](),controller[_0x652e('0x28')]);module[_0x652e('0x29')]=router;
\ No newline at end of file
+var _0x615b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/:id','show','getLogo','getPreferred','getFavicon','diskStorage','join','root','format','extname','post','/:id/logo','single','addLogo','server/files/images/logos/','%s%s','logologin','originalname','file','addLogoLogin','/:id/preferred','addPreferred','favicon','addFavicon','put','exports','multer','connect-timeout','Router'];(function(_0x2026d1,_0x19df64){var _0x41de23=function(_0x48c2ea){while(--_0x48c2ea){_0x2026d1['push'](_0x2026d1['shift']());}};_0x41de23(++_0x19df64);}(_0x615b,0x66));var _0xb615=function(_0x31aec1,_0x394b02){_0x31aec1=_0x31aec1-0x0;var _0x277efa=_0x615b[_0x31aec1];return _0x277efa;};'use strict';var multer=require(_0xb615('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb615('0x1'));var express=require('express');var router=express[_0xb615('0x2')]();var auth=require(_0xb615('0x3'));var interaction=require(_0xb615('0x4'));var config=require(_0xb615('0x5'));var controller=require(_0xb615('0x6'));router[_0xb615('0x7')]('/',auth[_0xb615('0x8')](),controller['index']);router[_0xb615('0x7')](_0xb615('0x9'),controller[_0xb615('0xa')]);router['get']('/:id/logo',controller[_0xb615('0xb')]);router['get']('/:id/logo_login',controller['getLogoLogin']);router['get']('/:id/gdpr',controller['gdpr']);router[_0xb615('0x7')]('/:id/preferred',controller[_0xb615('0xc')]);router[_0xb615('0x7')]('/:id/favicon',controller[_0xb615('0xd')]);var upload=multer({'storage':multer[_0xb615('0xe')]({'destination':function(_0x84e7f9,_0x472f84,_0x1d1e1d){_0x1d1e1d(null,path[_0xb615('0xf')](config[_0xb615('0x10')],'server/files/images/logos/'));},'filename':function(_0x3663f0,_0x427b31,_0x19ea7c){_0x19ea7c(null,util[_0xb615('0x11')]('%s%s','logo',path[_0xb615('0x12')](_0x427b31['originalname'])));}})});router[_0xb615('0x13')](_0xb615('0x14'),upload[_0xb615('0x15')]('file'),controller[_0xb615('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x19af94,_0x5839a0,_0x368b61){_0x368b61(null,path['join'](config[_0xb615('0x10')],_0xb615('0x17')));},'filename':function(_0x403c83,_0x903721,_0x17e97f){_0x17e97f(null,util[_0xb615('0x11')](_0xb615('0x18'),_0xb615('0x19'),path['extname'](_0x903721[_0xb615('0x1a')])));}})});router[_0xb615('0x13')]('/:id/logo_login',upload[_0xb615('0x15')](_0xb615('0x1b')),controller[_0xb615('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x469961,_0x1f704c,_0x21baf7){_0x21baf7(null,path[_0xb615('0xf')](config[_0xb615('0x10')],_0xb615('0x17')));},'filename':function(_0xbb6e48,_0x3bc406,_0x210033){_0x210033(null,util[_0xb615('0x11')](_0xb615('0x18'),'preferred',path['extname'](_0x3bc406['originalname'])));}})});router[_0xb615('0x13')](_0xb615('0x1d'),upload['single'](_0xb615('0x1b')),controller[_0xb615('0x1e')]);var upload=multer({'storage':multer[_0xb615('0xe')]({'destination':function(_0x119674,_0x491b2d,_0x5691a2){_0x5691a2(null,path[_0xb615('0xf')](config[_0xb615('0x10')],_0xb615('0x17')));},'filename':function(_0x197e86,_0x17433c,_0x439920){_0x439920(null,util[_0xb615('0x11')](_0xb615('0x18'),_0xb615('0x1f'),path['extname'](_0x17433c['originalname'])));}})});router[_0xb615('0x13')]('/:id/favicon',upload[_0xb615('0x15')](_0xb615('0x1b')),controller[_0xb615('0x20')]);router[_0xb615('0x21')](_0xb615('0x9'),auth['isAuthenticated'](),controller['update']);module[_0xb615('0x22')]=router;
\ No newline at end of file
index 2976bed..9849aff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbda0=['sequelize','exports','INTEGER','min_internal','STRING','BOOLEAN'];(function(_0x2f0b82,_0xa07e26){var _0x5d6fb1=function(_0x178f3f){while(--_0x178f3f){_0x2f0b82['push'](_0x2f0b82['shift']());}};_0x5d6fb1(++_0xa07e26);}(_0xbda0,0xf0));var _0x0bda=function(_0xcc6b8e,_0x1e4585){_0xcc6b8e=_0xcc6b8e-0x0;var _0x2a7362=_0xbda0[_0xcc6b8e];return _0x2a7362;};'use strict';var Sequelize=require(_0x0bda('0x0'));module[_0x0bda('0x1')]={'min_internal':{'type':Sequelize[_0x0bda('0x2')](0xb),'unique':_0x0bda('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x0bda('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0bda('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x0bda('0x4')]},'defaultLogo':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0bda('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0bda('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x0bda('0x4')]},'turnaddr':{'type':Sequelize[_0x0bda('0x4')]},'turnusername':{'type':Sequelize[_0x0bda('0x4')]},'turnpassword':{'type':Sequelize[_0x0bda('0x4')]},'pageTitle':{'type':Sequelize[_0x0bda('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0bda('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0bda('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x0bda('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0bda('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0bda('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0bda('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x0bda('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x0bda('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0bda('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0bda('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0bda('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0bda('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x0bda('0x2')]},'transcribeRegion':{'type':Sequelize[_0x0bda('0x4')]},'sentiment':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0bda('0x2')]},'sentimentRegion':{'type':Sequelize[_0x0bda('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0x0bda('0x5')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7b95=['INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','exports'];(function(_0x44a612,_0x37c2ec){var _0xbda14e=function(_0x221966){while(--_0x221966){_0x44a612['push'](_0x44a612['shift']());}};_0xbda14e(++_0x37c2ec);}(_0x7b95,0x11f));var _0x57b9=function(_0xbf3d75,_0x312384){_0xbf3d75=_0xbf3d75-0x0;var _0x56c687=_0x7b95[_0xbf3d75];return _0x56c687;};'use strict';var Sequelize=require('sequelize');module[_0x57b9('0x0')]={'min_internal':{'type':Sequelize[_0x57b9('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x57b9('0x1')](0xb),'unique':_0x57b9('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x57b9('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x57b9('0x3')],'defaultValue':_0x57b9('0x4')},'logo':{'type':Sequelize[_0x57b9('0x3')]},'defaultLogo':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x57b9('0x3')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x57b9('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x57b9('0x3')]},'turnaddr':{'type':Sequelize[_0x57b9('0x3')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x57b9('0x3')]},'pageTitle':{'type':Sequelize[_0x57b9('0x3')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x57b9('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x57b9('0x3')],'defaultValue':_0x57b9('0x6')},'enableEmailPreview':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x57b9('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x57b9('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x57b9('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x57b9('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x57b9('0x3')]},'defaultPreferred':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x57b9('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0x57b9('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x57b9('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x57b9('0x3')]},'defaultFavicon':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x57b9('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x57b9('0x1')]},'transcribeRegion':{'type':Sequelize[_0x57b9('0x3')]},'sentiment':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x57b9('0x1')]},'sentimentRegion':{'type':Sequelize[_0x57b9('0x3')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x57b9('0x3')]},'googleSsoEnabled':{'type':Sequelize[_0x57b9('0x5')],'defaultValue':![]}};
\ No newline at end of file
index acb7a80..ad76605 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfea9=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','error','Setting,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','Setting','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','rawAttributes','length','includeAll','find','body','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','custom','existsSync','upperFirst','\x20not\x20found','download','../../config/license/util','default_loginLogo.svg','gdpr','addPreferred','getPreferred','favicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','html-pdf','rimraf','zip-dir','moment','mustache','path','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x5a58de,_0x5aca3f){var _0x24aa83=function(_0x764e0e){while(--_0x764e0e){_0x5a58de['push'](_0x5a58de['shift']());}};_0x24aa83(++_0x5aca3f);}(_0xfea9,0x1c5));var _0x9fea=function(_0x315508,_0x517b76){_0x315508=_0x315508-0x0;var _0x14767a=_0xfea9[_0x315508];return _0x14767a;};'use strict';var pdf=require(_0x9fea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9fea('0x1'));var zipdir=require(_0x9fea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9fea('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9fea('0x4'));var util=require('util');var path=require(_0x9fea('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9fea('0x6'));var squel=require(_0x9fea('0x7'));var crypto=require(_0x9fea('0x8'));var jsforce=require(_0x9fea('0x9'));var deskjs=require(_0x9fea('0xa'));var toCsv=require('to-csv');var querystring=require(_0x9fea('0xb'));var Papa=require(_0x9fea('0xc'));var Redis=require(_0x9fea('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9fea('0xe'));var as=require(_0x9fea('0xf'));var hardwareService=require(_0x9fea('0x10'));var logger=require(_0x9fea('0x11'))(_0x9fea('0x12'));var utils=require(_0x9fea('0x13'));var config=require('../../config/environment');var db=require(_0x9fea('0x14'))['db'];var jayson=require(_0x9fea('0x15'));var client=jayson[_0x9fea('0x16')][_0x9fea('0x17')]({'port':0x232a});function checkPasswordPattern(_0x41f860,_0x48ab2e,_0xb0e2b3){if(_0xb0e2b3){var _0x3fc060=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3fc060[_0x9fea('0x18')](_0x48ab2e)){return _0x41f860;}else{throw new db[(_0x9fea('0x19'))][(_0x9fea('0x1a'))](_0x9fea('0x1b'));}}else{return _0x41f860;}}function respondWithRpcPromise(_0x526e66,_0x6fd779,_0x365a5d,_0x471c0d){return new BPromise(function(_0xfd86dc,_0x1b12d7){var _0x448bda=_0x471c0d||client;return _0x448bda[_0x9fea('0x1c')](_0x526e66,_0x365a5d)['then'](function(_0x59f2b8){logger[_0x9fea('0x1d')]('Setting,\x20%s,\x20%s',_0x6fd779,_0x9fea('0x1e'));logger[_0x9fea('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x6fd779,_0x9fea('0x1e'),JSON['stringify'](_0x59f2b8));if(_0x59f2b8['error']){if(_0x59f2b8[_0x9fea('0x20')]['code']===0x1f4){logger[_0x9fea('0x20')](_0x9fea('0x21'),_0x6fd779,_0x59f2b8[_0x9fea('0x20')][_0x9fea('0x22')]);return _0x1b12d7(_0x59f2b8[_0x9fea('0x20')][_0x9fea('0x22')]);}logger[_0x9fea('0x20')](_0x9fea('0x21'),_0x6fd779,_0x59f2b8['error']['message']);return _0xfd86dc(_0x59f2b8[_0x9fea('0x20')][_0x9fea('0x22')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x6fd779,_0x9fea('0x1e'));_0xfd86dc(_0x59f2b8['result'][_0x9fea('0x22')]);}})[_0x9fea('0x23')](function(_0x3b39c5){logger[_0x9fea('0x20')](_0x9fea('0x21'),_0x6fd779,_0x3b39c5);_0x1b12d7(_0x3b39c5);});});}function respondWithStatusCode(_0x38f013,_0x1f5b13){_0x1f5b13=_0x1f5b13||0xcc;return function(_0x174b68){if(_0x174b68){return _0x38f013[_0x9fea('0x24')](_0x1f5b13);}return _0x38f013[_0x9fea('0x25')](_0x1f5b13)[_0x9fea('0x26')]();};}function respondWithResult(_0xe28562,_0x188f03){_0x188f03=_0x188f03||0xc8;return function(_0x2e866b){if(_0x2e866b){return _0xe28562[_0x9fea('0x25')](_0x188f03)[_0x9fea('0x27')](_0x2e866b);}};}function respondWithFilteredResult(_0x436a19,_0x274555){return function(_0x44bc4c){if(_0x44bc4c){var _0x3b819d=_0x44bc4c[_0x9fea('0x28')],_0x25be71=_0x274555[_0x9fea('0x29')],_0x115db4=_0x274555[_0x9fea('0x29')]+_0x274555[_0x9fea('0x2a')],_0x1c3680;if(_0x115db4>=_0x3b819d){_0x115db4=_0x3b819d;_0x1c3680=0xc8;}else{_0x1c3680=0xce;}_0x436a19[_0x9fea('0x25')](_0x1c3680);return _0x436a19[_0x9fea('0x2b')](_0x9fea('0x2c'),_0x25be71+'-'+_0x115db4+'/'+_0x3b819d)[_0x9fea('0x27')](_0x44bc4c);}return null;};}function patchUpdates(_0x26d6b0){return function(_0x11a610){try{jsonpatch[_0x9fea('0x2d')](_0x11a610,_0x26d6b0,!![]);}catch(_0x37ef38){return BPromise[_0x9fea('0x2e')](_0x37ef38);}return _0x11a610['save']();};}function saveUpdates(_0x4ae927,_0x5a2450){return function(_0x241897){if(_0x241897){return _0x241897[_0x9fea('0x2f')](_0x4ae927)[_0x9fea('0x30')](function(_0x2cedee){return _0x2cedee;});}return null;};}function removeEntity(_0x451418,_0x71784c){return function(_0x30fd17){if(_0x30fd17){return _0x30fd17[_0x9fea('0x31')]()[_0x9fea('0x30')](function(){_0x451418[_0x9fea('0x25')](0xcc)[_0x9fea('0x26')]();});}};}function handleEntityNotFound(_0x30f84e,_0x278e92){return function(_0x422ed3){if(!_0x422ed3){_0x30f84e[_0x9fea('0x24')](0x194);}return _0x422ed3;};}function handleError(_0x30c9da,_0x30f70d){_0x30f70d=_0x30f70d||0x1f4;return function(_0xfd3904){logger[_0x9fea('0x20')](_0xfd3904[_0x9fea('0x32')]);if(_0xfd3904[_0x9fea('0x33')]){delete _0xfd3904[_0x9fea('0x33')];}_0x30c9da['status'](_0x30f70d)[_0x9fea('0x34')](_0xfd3904);};}exports[_0x9fea('0x35')]=function(_0x457c34,_0x384d36){var _0x32a71d={},_0x258a25={},_0x146174={'count':0x0,'rows':[]};var _0x5c7eb6=_['map'](db[_0x9fea('0x36')]['rawAttributes'],function(_0x306f91){return{'name':_0x306f91[_0x9fea('0x37')],'type':_0x306f91[_0x9fea('0x38')]['key']};});_0x258a25[_0x9fea('0x39')]=_[_0x9fea('0x3a')](_0x5c7eb6,_0x9fea('0x33'));_0x258a25['query']=_[_0x9fea('0x3b')](_0x457c34[_0x9fea('0x3c')]);_0x258a25[_0x9fea('0x3d')]=_[_0x9fea('0x3e')](_0x258a25[_0x9fea('0x39')],_0x258a25[_0x9fea('0x3c')]);_0x32a71d['attributes']=_[_0x9fea('0x3e')](_0x258a25[_0x9fea('0x39')],qs['fields'](_0x457c34[_0x9fea('0x3c')][_0x9fea('0x3f')]));_0x32a71d['attributes']=_0x32a71d[_0x9fea('0x40')]['length']?_0x32a71d[_0x9fea('0x40')]:_0x258a25[_0x9fea('0x39')];if(!_0x457c34[_0x9fea('0x3c')][_0x9fea('0x41')](_0x9fea('0x42'))){_0x32a71d[_0x9fea('0x2a')]=qs[_0x9fea('0x2a')](_0x457c34[_0x9fea('0x3c')][_0x9fea('0x2a')]);_0x32a71d[_0x9fea('0x29')]=qs[_0x9fea('0x29')](_0x457c34[_0x9fea('0x3c')][_0x9fea('0x29')]);}_0x32a71d[_0x9fea('0x43')]=qs['sort'](_0x457c34[_0x9fea('0x3c')][_0x9fea('0x44')]);_0x32a71d[_0x9fea('0x45')]=qs[_0x9fea('0x3d')](_[_0x9fea('0x46')](_0x457c34[_0x9fea('0x3c')],_0x258a25['filters']),_0x5c7eb6);if(_0x457c34[_0x9fea('0x3c')][_0x9fea('0x47')]){_0x32a71d[_0x9fea('0x45')]=_[_0x9fea('0x48')](_0x32a71d[_0x9fea('0x45')],{'$or':_['map'](_0x5c7eb6,function(_0x4901f2){if(_0x4901f2['type']!=='VIRTUAL'){var _0x2b25bc={};_0x2b25bc[_0x4901f2[_0x9fea('0x33')]]={'$like':'%'+_0x457c34['query']['filter']+'%'};return _0x2b25bc;}})});}_0x32a71d=_[_0x9fea('0x48')]({},_0x32a71d,_0x457c34[_0x9fea('0x49')]);var _0x4e60ff={'where':_0x32a71d[_0x9fea('0x45')]};return db[_0x9fea('0x36')][_0x9fea('0x28')](_0x4e60ff)[_0x9fea('0x30')](function(_0xe89311){_0x146174[_0x9fea('0x28')]=_0xe89311;if(_0x457c34[_0x9fea('0x3c')]['includeAll']){_0x32a71d[_0x9fea('0x4a')]=[{'all':!![]}];}return db[_0x9fea('0x36')][_0x9fea('0x4b')](_0x32a71d);})[_0x9fea('0x30')](function(_0x51c061){_0x146174[_0x9fea('0x4c')]=_0x51c061;return _0x146174;})['then'](respondWithFilteredResult(_0x384d36,_0x32a71d))[_0x9fea('0x23')](handleError(_0x384d36,null));};exports[_0x9fea('0x4d')]=function(_0x174bbd,_0x4dc22e){var _0x15f5cc={'raw':![],'where':{'id':_0x174bbd[_0x9fea('0x4e')]['id']}},_0x4e4be1={};_0x4e4be1[_0x9fea('0x39')]=_[_0x9fea('0x3b')](db[_0x9fea('0x36')][_0x9fea('0x4f')]);_0x4e4be1['query']=_[_0x9fea('0x3b')](_0x174bbd['query']);_0x4e4be1[_0x9fea('0x3d')]=_[_0x9fea('0x3e')](_0x4e4be1[_0x9fea('0x39')],_0x4e4be1[_0x9fea('0x3c')]);_0x15f5cc[_0x9fea('0x40')]=_['intersection'](_0x4e4be1['model'],qs[_0x9fea('0x3f')](_0x174bbd[_0x9fea('0x3c')][_0x9fea('0x3f')]));_0x15f5cc[_0x9fea('0x40')]=_0x15f5cc['attributes'][_0x9fea('0x50')]?_0x15f5cc[_0x9fea('0x40')]:_0x4e4be1[_0x9fea('0x39')];if(_0x174bbd[_0x9fea('0x3c')][_0x9fea('0x51')]){_0x15f5cc['include']=[{'all':!![]}];}_0x15f5cc=_[_0x9fea('0x48')]({},_0x15f5cc,_0x174bbd[_0x9fea('0x49')]);return db[_0x9fea('0x36')][_0x9fea('0x52')](_0x15f5cc)[_0x9fea('0x30')](handleEntityNotFound(_0x4dc22e,null))[_0x9fea('0x30')](respondWithResult(_0x4dc22e,null))[_0x9fea('0x23')](handleError(_0x4dc22e,null));};exports[_0x9fea('0x2f')]=function(_0x4e764e,_0x332c62){if(_0x4e764e[_0x9fea('0x53')]['id']){delete _0x4e764e[_0x9fea('0x53')]['id'];}return db[_0x9fea('0x36')]['find']({'where':{'id':_0x4e764e[_0x9fea('0x4e')]['id']}})[_0x9fea('0x30')](handleEntityNotFound(_0x332c62,null))[_0x9fea('0x30')](saveUpdates(_0x4e764e[_0x9fea('0x53')],null))[_0x9fea('0x30')](respondWithResult(_0x332c62,null))[_0x9fea('0x23')](handleError(_0x332c62,null));};exports['addLogo']=function(_0x2c5fe4,_0x4c5fb4,_0x30a06e){if(_0x2c5fe4['file']&&_0x2c5fe4[_0x9fea('0x54')]['filename']){_0x2c5fe4[_0x9fea('0x53')][_0x9fea('0x55')]=_0x2c5fe4[_0x9fea('0x54')][_0x9fea('0x56')];}return db[_0x9fea('0x36')][_0x9fea('0x52')]({'where':{'id':_0x2c5fe4[_0x9fea('0x4e')]['id']}})[_0x9fea('0x30')](handleEntityNotFound(_0x4c5fb4,null))['then'](saveUpdates(_0x2c5fe4[_0x9fea('0x53')],null))[_0x9fea('0x30')](respondWithResult(_0x4c5fb4,null))[_0x9fea('0x23')](handleError(_0x4c5fb4,null));};exports[_0x9fea('0x57')]=function(_0x279402,_0x5eb0a4,_0x3edee4){if(_0x279402[_0x9fea('0x54')]&&_0x279402['file']['filename']){_0x279402['body'][_0x9fea('0x58')]=_0x279402[_0x9fea('0x54')][_0x9fea('0x56')];}return db[_0x9fea('0x36')][_0x9fea('0x52')]({'where':{'id':_0x279402[_0x9fea('0x4e')]['id']}})[_0x9fea('0x30')](handleEntityNotFound(_0x5eb0a4,null))['then'](saveUpdates(_0x279402[_0x9fea('0x53')],null))[_0x9fea('0x30')](respondWithResult(_0x5eb0a4,null))[_0x9fea('0x23')](handleError(_0x5eb0a4,null));};var utilLicense=require('../../config/license/util');exports[_0x9fea('0x59')]=function(_0x4b2d24,_0x5a9a84,_0x2c3d4e){var _0x1a9382=_0x9fea('0x5a');var _0x294ee1={'custom':![]};return utilLicense[_0x9fea('0x5b')]()['then'](function(_0x33860f){if(_0x33860f){_0x294ee1=_0x33860f;}return db[_0x9fea('0x36')][_0x9fea('0x52')]({'where':{'id':_0x4b2d24[_0x9fea('0x4e')]['id']},'attributes':[_0x9fea('0x55'),_0x9fea('0x58'),_0x9fea('0x5c'),'favicon',_0x9fea('0x5d'),_0x9fea('0x5e'),_0x9fea('0x5f'),_0x9fea('0x60')],'raw':!![]});})[_0x9fea('0x30')](handleEntityNotFound(_0x5a9a84,null))['then'](function(_0x535506){if(_0x535506){var _0x314598=_0x535506['logo']&&fs['existsSync'](path[_0x9fea('0x61')](config[_0x9fea('0x62')],_0x1a9382,_[_0x9fea('0x63')](_0x535506[_0x9fea('0x55')])))?path['join'](config[_0x9fea('0x62')],_0x1a9382,_[_0x9fea('0x63')](_0x535506['logo'])):path['join'](config['root'],_0x1a9382,_[_0x9fea('0x63')](_0x9fea('0x64')));var _0x46c1c7=_0x9fea('0x65')+_['upperFirst'](_0x9fea('0x55'));if(_0x535506[_0x46c1c7]||!_0x294ee1[_0x9fea('0x66')]){_0x314598=path['join'](config[_0x9fea('0x62')],_0x1a9382,_[_0x9fea('0x63')]('default_logo.svg'));}if(!fs[_0x9fea('0x67')](_0x314598)){throw new db['Sequelize'][(_0x9fea('0x1a'))](_[_0x9fea('0x68')]('logo')+_0x9fea('0x69'));}return _0x5a9a84[_0x9fea('0x6a')](_0x314598);}})[_0x9fea('0x23')](handleError(_0x5a9a84,null));};var utilLicense=require(_0x9fea('0x6b'));exports['getLogoLogin']=function(_0x37afb6,_0x3499c0,_0x259bad){var _0xb4b7a0=_0x9fea('0x5a');var _0x4827a0={'custom':![]};return utilLicense[_0x9fea('0x5b')]()[_0x9fea('0x30')](function(_0x3d871f){if(_0x3d871f){_0x4827a0=_0x3d871f;}return db['Setting'][_0x9fea('0x52')]({'where':{'id':_0x37afb6['params']['id']},'attributes':[_0x9fea('0x55'),_0x9fea('0x58'),'preferred','favicon',_0x9fea('0x5d'),_0x9fea('0x5e'),'defaultPreferred',_0x9fea('0x60')],'raw':!![]});})[_0x9fea('0x30')](handleEntityNotFound(_0x3499c0,null))['then'](function(_0x5f1410){if(_0x5f1410){var _0x3763ac=_0x5f1410[_0x9fea('0x58')]&&fs[_0x9fea('0x67')](path['join'](config[_0x9fea('0x62')],_0xb4b7a0,_[_0x9fea('0x63')](_0x5f1410[_0x9fea('0x58')])))?path['join'](config['root'],_0xb4b7a0,_[_0x9fea('0x63')](_0x5f1410[_0x9fea('0x58')])):path[_0x9fea('0x61')](config[_0x9fea('0x62')],_0xb4b7a0,_[_0x9fea('0x63')](_0x9fea('0x6c')));var _0x2a65f1='default'+_[_0x9fea('0x68')](_0x9fea('0x58'));if(_0x5f1410[_0x2a65f1]||!_0x4827a0[_0x9fea('0x66')]){_0x3763ac=path[_0x9fea('0x61')](config['root'],_0xb4b7a0,_[_0x9fea('0x63')]('default_loginLogo.svg'));}if(!fs[_0x9fea('0x67')](_0x3763ac)){throw new db['Sequelize'][(_0x9fea('0x1a'))](_[_0x9fea('0x68')](_0x9fea('0x58'))+_0x9fea('0x69'));}return _0x3499c0[_0x9fea('0x6a')](_0x3763ac);}})[_0x9fea('0x23')](handleError(_0x3499c0,null));};exports[_0x9fea('0x6d')]=function(_0x770bcd,_0x3ac43c){return db[_0x9fea('0x36')][_0x9fea('0x52')]({'where':{'id':_0x770bcd[_0x9fea('0x4e')]['id']},'attributes':['securePassword']})[_0x9fea('0x30')](respondWithResult(_0x3ac43c,null))[_0x9fea('0x23')](handleError(_0x3ac43c,null));};exports[_0x9fea('0x6e')]=function(_0x4e421c,_0x454bc2,_0x435e61){if(_0x4e421c[_0x9fea('0x54')]&&_0x4e421c[_0x9fea('0x54')]['filename']){_0x4e421c[_0x9fea('0x53')][_0x9fea('0x5c')]=_0x4e421c['file'][_0x9fea('0x56')];}return db[_0x9fea('0x36')]['find']({'where':{'id':_0x4e421c[_0x9fea('0x4e')]['id']}})[_0x9fea('0x30')](handleEntityNotFound(_0x454bc2,null))['then'](saveUpdates(_0x4e421c[_0x9fea('0x53')],null))[_0x9fea('0x30')](respondWithResult(_0x454bc2,null))[_0x9fea('0x23')](handleError(_0x454bc2,null));};var utilLicense=require('../../config/license/util');exports[_0x9fea('0x6f')]=function(_0x5757a6,_0x5dbba0,_0x1f6b5c){var _0x31b9b0=_0x9fea('0x5a');var _0x2a0fc5={'custom':![]};return utilLicense[_0x9fea('0x5b')]()['then'](function(_0x4c6b28){if(_0x4c6b28){_0x2a0fc5=_0x4c6b28;}return db[_0x9fea('0x36')][_0x9fea('0x52')]({'where':{'id':_0x5757a6[_0x9fea('0x4e')]['id']},'attributes':[_0x9fea('0x55'),_0x9fea('0x58'),'preferred',_0x9fea('0x70'),_0x9fea('0x5d'),'defaultLoginLogo',_0x9fea('0x5f'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x5dbba0,null))[_0x9fea('0x30')](function(_0x2a5bf2){if(_0x2a5bf2){var _0x458d21=_0x2a5bf2[_0x9fea('0x5c')]&&fs[_0x9fea('0x67')](path[_0x9fea('0x61')](config['root'],_0x31b9b0,_[_0x9fea('0x63')](_0x2a5bf2[_0x9fea('0x5c')])))?path[_0x9fea('0x61')](config[_0x9fea('0x62')],_0x31b9b0,_[_0x9fea('0x63')](_0x2a5bf2['preferred'])):path[_0x9fea('0x61')](config['root'],_0x31b9b0,_[_0x9fea('0x63')](_0x9fea('0x71')));var _0x36ef2f=_0x9fea('0x65')+_[_0x9fea('0x68')]('preferred');if(_0x2a5bf2[_0x36ef2f]||!_0x2a0fc5[_0x9fea('0x66')]||!_0x2a0fc5[_0x9fea('0x5c')]){_0x458d21=path['join'](config[_0x9fea('0x62')],_0x31b9b0,_['toLower'](_0x9fea('0x71')));}if(!fs[_0x9fea('0x67')](_0x458d21)){throw new db['Sequelize'][(_0x9fea('0x1a'))](_[_0x9fea('0x68')](_0x9fea('0x5c'))+'\x20not\x20found');}return _0x5dbba0[_0x9fea('0x6a')](_0x458d21);}})['catch'](handleError(_0x5dbba0,null));};exports[_0x9fea('0x72')]=function(_0x323f4b,_0xe4130,_0xa8cc32){if(_0x323f4b[_0x9fea('0x54')]&&_0x323f4b[_0x9fea('0x54')]['filename']){_0x323f4b[_0x9fea('0x53')][_0x9fea('0x70')]=_0x323f4b[_0x9fea('0x54')]['filename'];}return db['Setting'][_0x9fea('0x52')]({'where':{'id':_0x323f4b[_0x9fea('0x4e')]['id']}})[_0x9fea('0x30')](handleEntityNotFound(_0xe4130,null))[_0x9fea('0x30')](saveUpdates(_0x323f4b[_0x9fea('0x53')],null))[_0x9fea('0x30')](respondWithResult(_0xe4130,null))[_0x9fea('0x23')](handleError(_0xe4130,null));};var utilLicense=require('../../config/license/util');exports[_0x9fea('0x73')]=function(_0x5236a7,_0x507c7f,_0x122772){var _0x41195a=_0x9fea('0x5a');var _0x3d8d2b={'custom':![]};return utilLicense[_0x9fea('0x5b')]()[_0x9fea('0x30')](function(_0xce2358){if(_0xce2358){_0x3d8d2b=_0xce2358;}return db['Setting'][_0x9fea('0x52')]({'where':{'id':_0x5236a7[_0x9fea('0x4e')]['id']},'attributes':[_0x9fea('0x55'),'loginLogo',_0x9fea('0x5c'),'favicon',_0x9fea('0x5d'),_0x9fea('0x5e'),_0x9fea('0x5f'),_0x9fea('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x507c7f,null))['then'](function(_0x39b5b4){if(_0x39b5b4){var _0x4b40a7=_0x39b5b4[_0x9fea('0x70')]&&fs[_0x9fea('0x67')](path[_0x9fea('0x61')](config['root'],_0x41195a,_[_0x9fea('0x63')](_0x39b5b4[_0x9fea('0x70')])))?path[_0x9fea('0x61')](config[_0x9fea('0x62')],_0x41195a,_['toLower'](_0x39b5b4[_0x9fea('0x70')])):path[_0x9fea('0x61')](config['root'],_0x41195a,_[_0x9fea('0x63')]('default_favicon.ico'));var _0x4c61c5='default'+_[_0x9fea('0x68')](_0x9fea('0x70'));if(_0x39b5b4[_0x4c61c5]||!_0x3d8d2b['custom']){_0x4b40a7=path[_0x9fea('0x61')](config[_0x9fea('0x62')],_0x41195a,_[_0x9fea('0x63')](_0x9fea('0x74')));}if(!fs['existsSync'](_0x4b40a7)){throw new db[(_0x9fea('0x19'))][(_0x9fea('0x1a'))](_[_0x9fea('0x68')](_0x9fea('0x70'))+_0x9fea('0x69'));}return _0x507c7f[_0x9fea('0x6a')](_0x4b40a7);}})[_0x9fea('0x23')](handleError(_0x507c7f,null));};
\ No newline at end of file
+var _0x591e=['merge','options','includeAll','findAll','rows','params','intersection','include','body','find','file','filename','logo','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','getLicense','default_loginLogo.svg','default','addPreferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','info','result','catch','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','index','map','Setting','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3169e9,_0x12e682){var _0x22a452=function(_0x345a21){while(--_0x345a21){_0x3169e9['push'](_0x3169e9['shift']());}};_0x22a452(++_0x12e682);}(_0x591e,0x11b));var _0xe591=function(_0x23e3f9,_0x5b495e){_0x23e3f9=_0x23e3f9-0x0;var _0x188309=_0x591e[_0x23e3f9];return _0x188309;};'use strict';var pdf=require(_0xe591('0x0'));var emlformat=require(_0xe591('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe591('0x2'));var jsonpatch=require(_0xe591('0x3'));var rp=require(_0xe591('0x4'));var moment=require('moment');var BPromise=require(_0xe591('0x5'));var Mustache=require(_0xe591('0x6'));var util=require(_0xe591('0x7'));var path=require(_0xe591('0x8'));var sox=require(_0xe591('0x9'));var csv=require(_0xe591('0xa'));var ejs=require(_0xe591('0xb'));var fs=require('fs');var _=require(_0xe591('0xc'));var squel=require(_0xe591('0xd'));var crypto=require(_0xe591('0xe'));var jsforce=require(_0xe591('0xf'));var deskjs=require(_0xe591('0x10'));var toCsv=require(_0xe591('0xa'));var querystring=require('querystring');var Papa=require(_0xe591('0x11'));var Redis=require(_0xe591('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe591('0x13'));var as=require(_0xe591('0x14'));var hardwareService=require(_0xe591('0x15'));var logger=require(_0xe591('0x16'))(_0xe591('0x17'));var utils=require(_0xe591('0x18'));var config=require('../../config/environment');var db=require(_0xe591('0x19'))['db'];var jayson=require(_0xe591('0x1a'));var client=jayson[_0xe591('0x1b')][_0xe591('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5867dc,_0x491dcd,_0x229a7c){if(_0x229a7c){var _0x5c6284=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c6284['test'](_0x491dcd)){return _0x5867dc;}else{throw new db['Sequelize'][(_0xe591('0x1d'))](_0xe591('0x1e'));}}else{return _0x5867dc;}}function respondWithRpcPromise(_0xbada04,_0x11429e,_0x99fd94,_0x2f410a){return new BPromise(function(_0x49768c,_0x2dbe22){var _0x33ef85=_0x2f410a||client;return _0x33ef85[_0xe591('0x1f')](_0xbada04,_0x99fd94)[_0xe591('0x20')](function(_0x214b6){logger['info']('Setting,\x20%s,\x20%s',_0x11429e,_0xe591('0x21'));logger[_0xe591('0x22')](_0xe591('0x23'),_0x11429e,_0xe591('0x21'),JSON['stringify'](_0x214b6));if(_0x214b6[_0xe591('0x24')]){if(_0x214b6['error'][_0xe591('0x25')]===0x1f4){logger[_0xe591('0x24')](_0xe591('0x26'),_0x11429e,_0x214b6['error'][_0xe591('0x27')]);return _0x2dbe22(_0x214b6[_0xe591('0x24')][_0xe591('0x27')]);}logger[_0xe591('0x24')](_0xe591('0x26'),_0x11429e,_0x214b6[_0xe591('0x24')][_0xe591('0x27')]);return _0x49768c(_0x214b6[_0xe591('0x24')][_0xe591('0x27')]);}else{logger[_0xe591('0x28')]('Setting,\x20%s,\x20%s',_0x11429e,'request\x20sent');_0x49768c(_0x214b6[_0xe591('0x29')][_0xe591('0x27')]);}})[_0xe591('0x2a')](function(_0x4fa6a3){logger[_0xe591('0x24')](_0xe591('0x26'),_0x11429e,_0x4fa6a3);_0x2dbe22(_0x4fa6a3);});});}function respondWithStatusCode(_0x4f5712,_0x59f20d){_0x59f20d=_0x59f20d||0xcc;return function(_0x15f5b7){if(_0x15f5b7){return _0x4f5712['sendStatus'](_0x59f20d);}return _0x4f5712['status'](_0x59f20d)['end']();};}function respondWithResult(_0x337643,_0x220192){_0x220192=_0x220192||0xc8;return function(_0x184b5c){if(_0x184b5c){return _0x337643['status'](_0x220192)[_0xe591('0x2b')](_0x184b5c);}};}function respondWithFilteredResult(_0x37d15b,_0x2a9da1){return function(_0x4e12b5){if(_0x4e12b5){var _0x5a0590=_0x4e12b5[_0xe591('0x2c')],_0x31936a=_0x2a9da1[_0xe591('0x2d')],_0x2f25b5=_0x2a9da1[_0xe591('0x2d')]+_0x2a9da1[_0xe591('0x2e')],_0x48fb4a;if(_0x2f25b5>=_0x5a0590){_0x2f25b5=_0x5a0590;_0x48fb4a=0xc8;}else{_0x48fb4a=0xce;}_0x37d15b[_0xe591('0x2f')](_0x48fb4a);return _0x37d15b[_0xe591('0x30')](_0xe591('0x31'),_0x31936a+'-'+_0x2f25b5+'/'+_0x5a0590)['json'](_0x4e12b5);}return null;};}function patchUpdates(_0x538e03){return function(_0x3a564b){try{jsonpatch[_0xe591('0x32')](_0x3a564b,_0x538e03,!![]);}catch(_0x52a475){return BPromise[_0xe591('0x33')](_0x52a475);}return _0x3a564b[_0xe591('0x34')]();};}function saveUpdates(_0x276ebd,_0xeb8519){return function(_0x564f29){if(_0x564f29){return _0x564f29[_0xe591('0x35')](_0x276ebd)[_0xe591('0x20')](function(_0x40d3a8){return _0x40d3a8;});}return null;};}function removeEntity(_0x21db98,_0x9b803f){return function(_0x29f20a){if(_0x29f20a){return _0x29f20a[_0xe591('0x36')]()[_0xe591('0x20')](function(){_0x21db98[_0xe591('0x2f')](0xcc)[_0xe591('0x37')]();});}};}function handleEntityNotFound(_0x479212,_0x264b40){return function(_0x4d28b5){if(!_0x4d28b5){_0x479212[_0xe591('0x38')](0x194);}return _0x4d28b5;};}function handleError(_0x16665a,_0x248eb5){_0x248eb5=_0x248eb5||0x1f4;return function(_0x2adecd){logger[_0xe591('0x24')](_0x2adecd['stack']);if(_0x2adecd[_0xe591('0x39')]){delete _0x2adecd[_0xe591('0x39')];}_0x16665a[_0xe591('0x2f')](_0x248eb5)['send'](_0x2adecd);};}exports[_0xe591('0x3a')]=function(_0x14a0e9,_0x354c69){var _0x290f03={},_0x4896f7={},_0xe36525={'count':0x0,'rows':[]};var _0x6f4e12=_[_0xe591('0x3b')](db[_0xe591('0x3c')][_0xe591('0x3d')],function(_0x9e2511){return{'name':_0x9e2511['fieldName'],'type':_0x9e2511[_0xe591('0x3e')][_0xe591('0x3f')]};});_0x4896f7[_0xe591('0x40')]=_[_0xe591('0x3b')](_0x6f4e12,_0xe591('0x39'));_0x4896f7[_0xe591('0x41')]=_[_0xe591('0x42')](_0x14a0e9['query']);_0x4896f7[_0xe591('0x43')]=_['intersection'](_0x4896f7[_0xe591('0x40')],_0x4896f7[_0xe591('0x41')]);_0x290f03[_0xe591('0x44')]=_['intersection'](_0x4896f7['model'],qs[_0xe591('0x45')](_0x14a0e9[_0xe591('0x41')]['fields']));_0x290f03[_0xe591('0x44')]=_0x290f03['attributes'][_0xe591('0x46')]?_0x290f03[_0xe591('0x44')]:_0x4896f7[_0xe591('0x40')];if(!_0x14a0e9[_0xe591('0x41')][_0xe591('0x47')](_0xe591('0x48'))){_0x290f03[_0xe591('0x2e')]=qs[_0xe591('0x2e')](_0x14a0e9[_0xe591('0x41')]['limit']);_0x290f03[_0xe591('0x2d')]=qs[_0xe591('0x2d')](_0x14a0e9[_0xe591('0x41')][_0xe591('0x2d')]);}_0x290f03[_0xe591('0x49')]=qs[_0xe591('0x4a')](_0x14a0e9[_0xe591('0x41')][_0xe591('0x4a')]);_0x290f03[_0xe591('0x4b')]=qs[_0xe591('0x43')](_[_0xe591('0x4c')](_0x14a0e9['query'],_0x4896f7[_0xe591('0x43')]),_0x6f4e12);if(_0x14a0e9[_0xe591('0x41')]['filter']){_0x290f03[_0xe591('0x4b')]=_[_0xe591('0x4d')](_0x290f03[_0xe591('0x4b')],{'$or':_[_0xe591('0x3b')](_0x6f4e12,function(_0x5c51e3){if(_0x5c51e3[_0xe591('0x3e')]!=='VIRTUAL'){var _0x56be46={};_0x56be46[_0x5c51e3[_0xe591('0x39')]]={'$like':'%'+_0x14a0e9['query']['filter']+'%'};return _0x56be46;}})});}_0x290f03=_['merge']({},_0x290f03,_0x14a0e9[_0xe591('0x4e')]);var _0x776d6={'where':_0x290f03[_0xe591('0x4b')]};return db['Setting']['count'](_0x776d6)[_0xe591('0x20')](function(_0x151a0c){_0xe36525[_0xe591('0x2c')]=_0x151a0c;if(_0x14a0e9[_0xe591('0x41')][_0xe591('0x4f')]){_0x290f03['include']=[{'all':!![]}];}return db[_0xe591('0x3c')][_0xe591('0x50')](_0x290f03);})[_0xe591('0x20')](function(_0x1a336f){_0xe36525[_0xe591('0x51')]=_0x1a336f;return _0xe36525;})['then'](respondWithFilteredResult(_0x354c69,_0x290f03))[_0xe591('0x2a')](handleError(_0x354c69,null));};exports['show']=function(_0xd1ef00,_0x5b5cab){var _0xa58b4a={'raw':![],'where':{'id':_0xd1ef00[_0xe591('0x52')]['id']}},_0x10a700={};_0x10a700[_0xe591('0x40')]=_['keys'](db[_0xe591('0x3c')][_0xe591('0x3d')]);_0x10a700[_0xe591('0x41')]=_['keys'](_0xd1ef00[_0xe591('0x41')]);_0x10a700['filters']=_[_0xe591('0x53')](_0x10a700['model'],_0x10a700[_0xe591('0x41')]);_0xa58b4a[_0xe591('0x44')]=_[_0xe591('0x53')](_0x10a700[_0xe591('0x40')],qs[_0xe591('0x45')](_0xd1ef00[_0xe591('0x41')][_0xe591('0x45')]));_0xa58b4a[_0xe591('0x44')]=_0xa58b4a[_0xe591('0x44')][_0xe591('0x46')]?_0xa58b4a['attributes']:_0x10a700[_0xe591('0x40')];if(_0xd1ef00[_0xe591('0x41')][_0xe591('0x4f')]){_0xa58b4a[_0xe591('0x54')]=[{'all':!![]}];}_0xa58b4a=_[_0xe591('0x4d')]({},_0xa58b4a,_0xd1ef00[_0xe591('0x4e')]);return db[_0xe591('0x3c')]['find'](_0xa58b4a)[_0xe591('0x20')](handleEntityNotFound(_0x5b5cab,null))[_0xe591('0x20')](respondWithResult(_0x5b5cab,null))[_0xe591('0x2a')](handleError(_0x5b5cab,null));};exports['update']=function(_0x3fb8fe,_0x1672c1){if(_0x3fb8fe[_0xe591('0x55')]['id']){delete _0x3fb8fe[_0xe591('0x55')]['id'];}return db[_0xe591('0x3c')][_0xe591('0x56')]({'where':{'id':_0x3fb8fe['params']['id']}})[_0xe591('0x20')](handleEntityNotFound(_0x1672c1,null))[_0xe591('0x20')](saveUpdates(_0x3fb8fe[_0xe591('0x55')],null))[_0xe591('0x20')](respondWithResult(_0x1672c1,null))[_0xe591('0x2a')](handleError(_0x1672c1,null));};exports['addLogo']=function(_0x40557b,_0x3fbf2c,_0x26e7fd){if(_0x40557b['file']&&_0x40557b[_0xe591('0x57')][_0xe591('0x58')]){_0x40557b[_0xe591('0x55')][_0xe591('0x59')]=_0x40557b[_0xe591('0x57')][_0xe591('0x58')];}return db[_0xe591('0x3c')][_0xe591('0x56')]({'where':{'id':_0x40557b[_0xe591('0x52')]['id']}})[_0xe591('0x20')](handleEntityNotFound(_0x3fbf2c,null))[_0xe591('0x20')](saveUpdates(_0x40557b['body'],null))['then'](respondWithResult(_0x3fbf2c,null))[_0xe591('0x2a')](handleError(_0x3fbf2c,null));};exports[_0xe591('0x5a')]=function(_0xd6602c,_0x12557c,_0x27c836){if(_0xd6602c[_0xe591('0x57')]&&_0xd6602c[_0xe591('0x57')][_0xe591('0x58')]){_0xd6602c[_0xe591('0x55')][_0xe591('0x5b')]=_0xd6602c['file'][_0xe591('0x58')];}return db[_0xe591('0x3c')][_0xe591('0x56')]({'where':{'id':_0xd6602c['params']['id']}})[_0xe591('0x20')](handleEntityNotFound(_0x12557c,null))[_0xe591('0x20')](saveUpdates(_0xd6602c[_0xe591('0x55')],null))[_0xe591('0x20')](respondWithResult(_0x12557c,null))[_0xe591('0x2a')](handleError(_0x12557c,null));};var utilLicense=require(_0xe591('0x5c'));exports[_0xe591('0x5d')]=function(_0x451914,_0x40db91,_0x4722cb){var _0x57db7b=_0xe591('0x5e');var _0xf67732={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x322413){if(_0x322413){_0xf67732=_0x322413;}return db[_0xe591('0x3c')][_0xe591('0x56')]({'where':{'id':_0x451914[_0xe591('0x52')]['id']},'attributes':[_0xe591('0x59'),_0xe591('0x5b'),_0xe591('0x5f'),_0xe591('0x60'),_0xe591('0x61'),_0xe591('0x62'),_0xe591('0x63'),_0xe591('0x64')],'raw':!![]});})[_0xe591('0x20')](handleEntityNotFound(_0x40db91,null))[_0xe591('0x20')](function(_0x114e3f){if(_0x114e3f){var _0x2593df=_0x114e3f[_0xe591('0x59')]&&fs[_0xe591('0x65')](path['join'](config[_0xe591('0x66')],_0x57db7b,_[_0xe591('0x67')](_0x114e3f[_0xe591('0x59')])))?path[_0xe591('0x68')](config[_0xe591('0x66')],_0x57db7b,_[_0xe591('0x67')](_0x114e3f[_0xe591('0x59')])):path[_0xe591('0x68')](config[_0xe591('0x66')],_0x57db7b,_[_0xe591('0x67')](_0xe591('0x69')));var _0xb468ea='default'+_[_0xe591('0x6a')](_0xe591('0x59'));if(_0x114e3f[_0xb468ea]||!_0xf67732[_0xe591('0x6b')]){_0x2593df=path[_0xe591('0x68')](config[_0xe591('0x66')],_0x57db7b,_['toLower'](_0xe591('0x69')));}if(!fs['existsSync'](_0x2593df)){throw new db[(_0xe591('0x6c'))][(_0xe591('0x1d'))](_[_0xe591('0x6a')]('logo')+_0xe591('0x6d'));}return _0x40db91[_0xe591('0x6e')](_0x2593df);}})[_0xe591('0x2a')](handleError(_0x40db91,null));};var utilLicense=require('../../config/license/util');exports[_0xe591('0x6f')]=function(_0x555724,_0x1791f9,_0x38de4b){var _0x2d1319=_0xe591('0x5e');var _0x1e1d23={'custom':![]};return utilLicense[_0xe591('0x70')]()['then'](function(_0x3110df){if(_0x3110df){_0x1e1d23=_0x3110df;}return db[_0xe591('0x3c')]['find']({'where':{'id':_0x555724[_0xe591('0x52')]['id']},'attributes':['logo',_0xe591('0x5b'),_0xe591('0x5f'),_0xe591('0x60'),'defaultLogo',_0xe591('0x62'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xe591('0x20')](handleEntityNotFound(_0x1791f9,null))[_0xe591('0x20')](function(_0x553b69){if(_0x553b69){var _0x3a6b1e=_0x553b69['loginLogo']&&fs[_0xe591('0x65')](path[_0xe591('0x68')](config[_0xe591('0x66')],_0x2d1319,_[_0xe591('0x67')](_0x553b69[_0xe591('0x5b')])))?path[_0xe591('0x68')](config[_0xe591('0x66')],_0x2d1319,_['toLower'](_0x553b69['loginLogo'])):path[_0xe591('0x68')](config['root'],_0x2d1319,_[_0xe591('0x67')](_0xe591('0x71')));var _0x3f0fbb=_0xe591('0x72')+_['upperFirst'](_0xe591('0x5b'));if(_0x553b69[_0x3f0fbb]||!_0x1e1d23[_0xe591('0x6b')]){_0x3a6b1e=path[_0xe591('0x68')](config[_0xe591('0x66')],_0x2d1319,_[_0xe591('0x67')]('default_loginLogo.svg'));}if(!fs[_0xe591('0x65')](_0x3a6b1e)){throw new db[(_0xe591('0x6c'))][(_0xe591('0x1d'))](_[_0xe591('0x6a')](_0xe591('0x5b'))+_0xe591('0x6d'));}return _0x1791f9[_0xe591('0x6e')](_0x3a6b1e);}})[_0xe591('0x2a')](handleError(_0x1791f9,null));};exports['gdpr']=function(_0x191d14,_0x2dfe2b){return db['Setting']['find']({'where':{'id':_0x191d14[_0xe591('0x52')]['id']},'attributes':['securePassword']})[_0xe591('0x20')](respondWithResult(_0x2dfe2b,null))[_0xe591('0x2a')](handleError(_0x2dfe2b,null));};exports[_0xe591('0x73')]=function(_0x253b97,_0x2b6a62,_0x246254){if(_0x253b97[_0xe591('0x57')]&&_0x253b97[_0xe591('0x57')][_0xe591('0x58')]){_0x253b97[_0xe591('0x55')][_0xe591('0x5f')]=_0x253b97[_0xe591('0x57')][_0xe591('0x58')];}return db[_0xe591('0x3c')][_0xe591('0x56')]({'where':{'id':_0x253b97[_0xe591('0x52')]['id']}})[_0xe591('0x20')](handleEntityNotFound(_0x2b6a62,null))[_0xe591('0x20')](saveUpdates(_0x253b97[_0xe591('0x55')],null))[_0xe591('0x20')](respondWithResult(_0x2b6a62,null))[_0xe591('0x2a')](handleError(_0x2b6a62,null));};var utilLicense=require(_0xe591('0x5c'));exports[_0xe591('0x74')]=function(_0x4e310e,_0x5b4968,_0x23c615){var _0x3f4604='server/files/images/logos';var _0x3e2d53={'custom':![]};return utilLicense[_0xe591('0x70')]()[_0xe591('0x20')](function(_0x1b89ed){if(_0x1b89ed){_0x3e2d53=_0x1b89ed;}return db['Setting'][_0xe591('0x56')]({'where':{'id':_0x4e310e[_0xe591('0x52')]['id']},'attributes':[_0xe591('0x59'),_0xe591('0x5b'),_0xe591('0x5f'),_0xe591('0x60'),_0xe591('0x61'),_0xe591('0x62'),_0xe591('0x63'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x5b4968,null))[_0xe591('0x20')](function(_0x27dce1){if(_0x27dce1){var _0x626aaa=_0x27dce1['preferred']&&fs[_0xe591('0x65')](path[_0xe591('0x68')](config['root'],_0x3f4604,_['toLower'](_0x27dce1['preferred'])))?path['join'](config[_0xe591('0x66')],_0x3f4604,_[_0xe591('0x67')](_0x27dce1[_0xe591('0x5f')])):path[_0xe591('0x68')](config['root'],_0x3f4604,_['toLower'](_0xe591('0x75')));var _0x460250=_0xe591('0x72')+_[_0xe591('0x6a')]('preferred');if(_0x27dce1[_0x460250]||!_0x3e2d53[_0xe591('0x6b')]||!_0x3e2d53[_0xe591('0x5f')]){_0x626aaa=path[_0xe591('0x68')](config[_0xe591('0x66')],_0x3f4604,_[_0xe591('0x67')](_0xe591('0x75')));}if(!fs[_0xe591('0x65')](_0x626aaa)){throw new db[(_0xe591('0x6c'))][(_0xe591('0x1d'))](_[_0xe591('0x6a')](_0xe591('0x5f'))+_0xe591('0x6d'));}return _0x5b4968[_0xe591('0x6e')](_0x626aaa);}})[_0xe591('0x2a')](handleError(_0x5b4968,null));};exports['addFavicon']=function(_0x102826,_0x172116,_0x6b55f8){if(_0x102826[_0xe591('0x57')]&&_0x102826['file'][_0xe591('0x58')]){_0x102826[_0xe591('0x55')][_0xe591('0x60')]=_0x102826['file'][_0xe591('0x58')];}return db['Setting'][_0xe591('0x56')]({'where':{'id':_0x102826[_0xe591('0x52')]['id']}})[_0xe591('0x20')](handleEntityNotFound(_0x172116,null))[_0xe591('0x20')](saveUpdates(_0x102826[_0xe591('0x55')],null))['then'](respondWithResult(_0x172116,null))['catch'](handleError(_0x172116,null));};var utilLicense=require('../../config/license/util');exports[_0xe591('0x76')]=function(_0x3ab092,_0x4eeed1,_0x581596){var _0x5c6f89='server/files/images/logos';var _0x2737e2={'custom':![]};return utilLicense[_0xe591('0x70')]()[_0xe591('0x20')](function(_0x14d3ed){if(_0x14d3ed){_0x2737e2=_0x14d3ed;}return db[_0xe591('0x3c')][_0xe591('0x56')]({'where':{'id':_0x3ab092[_0xe591('0x52')]['id']},'attributes':[_0xe591('0x59'),'loginLogo',_0xe591('0x5f'),_0xe591('0x60'),'defaultLogo',_0xe591('0x62'),'defaultPreferred',_0xe591('0x64')],'raw':!![]});})[_0xe591('0x20')](handleEntityNotFound(_0x4eeed1,null))[_0xe591('0x20')](function(_0x3031fc){if(_0x3031fc){var _0xaf5c60=_0x3031fc[_0xe591('0x60')]&&fs['existsSync'](path[_0xe591('0x68')](config[_0xe591('0x66')],_0x5c6f89,_[_0xe591('0x67')](_0x3031fc[_0xe591('0x60')])))?path[_0xe591('0x68')](config[_0xe591('0x66')],_0x5c6f89,_[_0xe591('0x67')](_0x3031fc[_0xe591('0x60')])):path[_0xe591('0x68')](config[_0xe591('0x66')],_0x5c6f89,_[_0xe591('0x67')](_0xe591('0x77')));var _0x383967=_0xe591('0x72')+_[_0xe591('0x6a')]('favicon');if(_0x3031fc[_0x383967]||!_0x2737e2[_0xe591('0x6b')]){_0xaf5c60=path[_0xe591('0x68')](config[_0xe591('0x66')],_0x5c6f89,_[_0xe591('0x67')]('default_favicon.ico'));}if(!fs[_0xe591('0x65')](_0xaf5c60)){throw new db[(_0xe591('0x6c'))][(_0xe591('0x1d'))](_['upperFirst'](_0xe591('0x60'))+_0xe591('0x6d'));}return _0x4eeed1['download'](_0xaf5c60);}})[_0xe591('0x2a')](handleError(_0x4eeed1,null));};
\ No newline at end of file
index fdd91ef..c32b730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3364=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','lodash'];(function(_0x2ebacc,_0xdc5ab3){var _0x44e8ad=function(_0x300190){while(--_0x300190){_0x2ebacc['push'](_0x2ebacc['shift']());}};_0x44e8ad(++_0xdc5ab3);}(_0x3364,0x1a3));var _0x4336=function(_0x163a55,_0x1ce9ba){_0x163a55=_0x163a55-0x0;var _0x190622=_0x3364[_0x163a55];return _0x190622;};'use strict';var _=require(_0x4336('0x0'));var util=require(_0x4336('0x1'));var logger=require(_0x4336('0x2'))(_0x4336('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4336('0x4'));var fs=require('fs');var path=require(_0x4336('0x5'));var rimraf=require(_0x4336('0x6'));var config=require(_0x4336('0x7'));var attributes=require(_0x4336('0x8'));module[_0x4336('0x9')]=function(_0x42fea6,_0x45e0e3){return _0x42fea6['define']('Setting',attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a4f=['rimraf','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4207a6,_0x3a3110){var _0x42b37a=function(_0x574360){while(--_0x574360){_0x4207a6['push'](_0x4207a6['shift']());}};_0x42b37a(++_0x3a3110);}(_0x7a4f,0x179));var _0xf7a4=function(_0x109e39,_0x27f91c){_0x109e39=_0x109e39-0x0;var _0x3b142f=_0x7a4f[_0x109e39];return _0x3b142f;};'use strict';var _=require(_0xf7a4('0x0'));var util=require('util');var logger=require(_0xf7a4('0x1'))(_0xf7a4('0x2'));var moment=require(_0xf7a4('0x3'));var BPromise=require(_0xf7a4('0x4'));var rp=require(_0xf7a4('0x5'));var fs=require('fs');var path=require(_0xf7a4('0x6'));var rimraf=require(_0xf7a4('0x7'));var config=require('../../config/environment');var attributes=require('./setting.attributes');module[_0xf7a4('0x8')]=function(_0x2f603d,_0xe41c72){return _0x2f603d[_0xf7a4('0x9')](_0xf7a4('0xa'),attributes,{'tableName':_0xf7a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8374342..3a6030d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c93=['http','request','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1ed2bc,_0x156791){var _0x25fa6a=function(_0x104f8b){while(--_0x104f8b){_0x1ed2bc['push'](_0x1ed2bc['shift']());}};_0x25fa6a(++_0x156791);}(_0x9c93,0x11d));var _0x39c9=function(_0x9ca21f,_0x437553){_0x9ca21f=_0x9ca21f-0x0;var _0x9ef54b=_0x9c93[_0x9ca21f];return _0x9ef54b;};'use strict';var _=require(_0x39c9('0x0'));var util=require(_0x39c9('0x1'));var moment=require(_0x39c9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39c9('0x3'));var db=require(_0x39c9('0x4'))['db'];var utils=require(_0x39c9('0x5'));var logger=require(_0x39c9('0x6'))(_0x39c9('0x7'));var config=require('../../config/environment');var jayson=require(_0x39c9('0x8'));var client=jayson['client'][_0x39c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5925c0,_0x192a4d,_0x1f5354){return new BPromise(function(_0x4b6f07,_0x51ec32){return client[_0x39c9('0xa')](_0x5925c0,_0x1f5354)[_0x39c9('0xb')](function(_0x186f4e){logger[_0x39c9('0xc')]('Setting,\x20%s,\x20%s',_0x192a4d,_0x39c9('0xd'));logger['debug'](_0x39c9('0xe'),_0x192a4d,_0x39c9('0xd'),JSON[_0x39c9('0xf')](_0x186f4e));if(_0x186f4e[_0x39c9('0x10')]){if(_0x186f4e[_0x39c9('0x10')][_0x39c9('0x11')]===0x1f4){logger[_0x39c9('0x10')](_0x39c9('0x12'),_0x192a4d,_0x186f4e[_0x39c9('0x10')]['message']);return _0x51ec32(_0x186f4e[_0x39c9('0x10')][_0x39c9('0x13')]);}logger[_0x39c9('0x10')](_0x39c9('0x12'),_0x192a4d,_0x186f4e[_0x39c9('0x10')][_0x39c9('0x13')]);return _0x4b6f07(_0x186f4e['error'][_0x39c9('0x13')]);}else{logger['info'](_0x39c9('0x12'),_0x192a4d,_0x39c9('0xd'));_0x4b6f07(_0x186f4e[_0x39c9('0x14')][_0x39c9('0x13')]);}})['catch'](function(_0xb22676){logger['error']('Setting,\x20%s,\x20%s',_0x192a4d,_0xb22676);_0x51ec32(_0xb22676);});});}
\ No newline at end of file
+var _0xc233=['request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','Setting,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xc233,0x1c0));var _0x3c23=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0xc233[_0xabbd2f];return _0x34a040;};'use strict';var _=require(_0x3c23('0x0'));var util=require(_0x3c23('0x1'));var moment=require(_0x3c23('0x2'));var BPromise=require(_0x3c23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c23('0x4'));var db=require(_0x3c23('0x5'))['db'];var utils=require(_0x3c23('0x6'));var logger=require(_0x3c23('0x7'))(_0x3c23('0x8'));var config=require(_0x3c23('0x9'));var jayson=require(_0x3c23('0xa'));var client=jayson[_0x3c23('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2af032,_0x49bbe0,_0x6cc614){return new BPromise(function(_0x82f4dc,_0x335155){return client[_0x3c23('0xc')](_0x2af032,_0x6cc614)[_0x3c23('0xd')](function(_0xd5bfe7){logger['info']('Setting,\x20%s,\x20%s',_0x49bbe0,_0x3c23('0xe'));logger[_0x3c23('0xf')](_0x3c23('0x10'),_0x49bbe0,_0x3c23('0xe'),JSON['stringify'](_0xd5bfe7));if(_0xd5bfe7[_0x3c23('0x11')]){if(_0xd5bfe7['error']['code']===0x1f4){logger[_0x3c23('0x11')](_0x3c23('0x12'),_0x49bbe0,_0xd5bfe7[_0x3c23('0x11')][_0x3c23('0x13')]);return _0x335155(_0xd5bfe7[_0x3c23('0x11')][_0x3c23('0x13')]);}logger[_0x3c23('0x11')](_0x3c23('0x12'),_0x49bbe0,_0xd5bfe7[_0x3c23('0x11')]['message']);return _0x82f4dc(_0xd5bfe7['error'][_0x3c23('0x13')]);}else{logger[_0x3c23('0x14')](_0x3c23('0x12'),_0x49bbe0,_0x3c23('0xe'));_0x82f4dc(_0xd5bfe7[_0x3c23('0x15')][_0x3c23('0x13')]);}})[_0x3c23('0x16')](function(_0x7f43a4){logger['error'](_0x3c23('0x12'),_0x49bbe0,_0x7f43a4);_0x335155(_0x7f43a4);});});}
\ No newline at end of file
index 45ec1f0..8536bd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2b5=['getInteractions','statusGet','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','/:id/status','status','addAgents','put','update','destroy','delete','removeDispositions','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/applications','getApplications'];(function(_0x3438cf,_0x73b174){var _0x278698=function(_0xbba932){while(--_0xbba932){_0x3438cf['push'](_0x3438cf['shift']());}};_0x278698(++_0x73b174);}(_0xa2b5,0xb2));var _0x5a2b=function(_0x2548b3,_0x2bd6c7){_0x2548b3=_0x2548b3-0x0;var _0x4c9b6f=_0xa2b5[_0x2548b3];return _0x4c9b6f;};'use strict';var multer=require('multer');var util=require(_0x5a2b('0x0'));var path=require('path');var timeout=require(_0x5a2b('0x1'));var express=require('express');var router=express[_0x5a2b('0x2')]();var auth=require(_0x5a2b('0x3'));var interaction=require(_0x5a2b('0x4'));var config=require(_0x5a2b('0x5'));var controller=require(_0x5a2b('0x6'));router[_0x5a2b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5a2b('0x7')](_0x5a2b('0x8'),auth[_0x5a2b('0x9')](),controller[_0x5a2b('0xa')]);router['get'](_0x5a2b('0xb'),auth[_0x5a2b('0x9')](),controller[_0x5a2b('0xc')]);router[_0x5a2b('0x7')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x5a2b('0x7')](_0x5a2b('0xd'),auth[_0x5a2b('0x9')](),controller[_0x5a2b('0xe')]);router[_0x5a2b('0x7')](_0x5a2b('0xf'),auth[_0x5a2b('0x9')](),controller[_0x5a2b('0x10')]);router['get']('/:id/interactions',auth[_0x5a2b('0x9')](),controller[_0x5a2b('0x11')]);router[_0x5a2b('0x7')]('/:id/status',controller[_0x5a2b('0x12')]);router[_0x5a2b('0x7')](_0x5a2b('0x13'),auth['isAuthenticated'](),controller[_0x5a2b('0x14')]);router[_0x5a2b('0x15')]('/',auth[_0x5a2b('0x9')](),controller[_0x5a2b('0x16')]);router[_0x5a2b('0x15')](_0x5a2b('0x17'),auth[_0x5a2b('0x9')](),controller[_0x5a2b('0x18')]);router['post'](_0x5a2b('0xd'),auth['isAuthenticated'](),controller[_0x5a2b('0x19')]);router[_0x5a2b('0x15')](_0x5a2b('0x1a'),controller[_0x5a2b('0x1b')]);router[_0x5a2b('0x15')](_0x5a2b('0xf'),auth['isAuthenticated'](),controller[_0x5a2b('0x1c')]);router[_0x5a2b('0x15')]('/:id/send',auth[_0x5a2b('0x9')](),controller[_0x5a2b('0x1d')]);router[_0x5a2b('0x15')](_0x5a2b('0x1e'),controller[_0x5a2b('0x1f')]);router[_0x5a2b('0x15')]('/:id/users',auth[_0x5a2b('0x9')](),controller[_0x5a2b('0x20')]);router[_0x5a2b('0x21')](_0x5a2b('0xb'),auth[_0x5a2b('0x9')](),controller[_0x5a2b('0x22')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5a2b('0x23')]);router[_0x5a2b('0x24')]('/:id/dispositions',auth[_0x5a2b('0x9')](),controller[_0x5a2b('0x25')]);router[_0x5a2b('0x24')](_0x5a2b('0xd'),auth[_0x5a2b('0x9')](),controller['removeAnswers']);router[_0x5a2b('0x24')](_0x5a2b('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x5a2b('0x26')]=router;
\ No newline at end of file
+var _0xc701=['getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','addAgents','put','/:id','delete','destroy','removeDispositions','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','isAuthenticated','index','get','/describe','/:id/dispositions','/:id/canned_answers'];(function(_0x591b0d,_0xa34ef2){var _0x58ac3e=function(_0x104dd6){while(--_0x104dd6){_0x591b0d['push'](_0x591b0d['shift']());}};_0x58ac3e(++_0xa34ef2);}(_0xc701,0x19e));var _0x1c70=function(_0xe9fdc4,_0x1cc454){_0xe9fdc4=_0xe9fdc4-0x0;var _0x529cdd=_0xc701[_0xe9fdc4];return _0x529cdd;};'use strict';var multer=require('multer');var util=require(_0x1c70('0x0'));var path=require(_0x1c70('0x1'));var timeout=require(_0x1c70('0x2'));var express=require(_0x1c70('0x3'));var router=express[_0x1c70('0x4')]();var auth=require(_0x1c70('0x5'));var interaction=require(_0x1c70('0x6'));var config=require(_0x1c70('0x7'));var controller=require(_0x1c70('0x8'));router['get']('/',auth[_0x1c70('0x9')](),controller[_0x1c70('0xa')]);router[_0x1c70('0xb')](_0x1c70('0xc'),auth[_0x1c70('0x9')](),controller['describe']);router[_0x1c70('0xb')]('/:id',auth[_0x1c70('0x9')](),controller['show']);router[_0x1c70('0xb')](_0x1c70('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x1c70('0xb')](_0x1c70('0xe'),auth[_0x1c70('0x9')](),controller[_0x1c70('0xf')]);router[_0x1c70('0xb')](_0x1c70('0x10'),auth['isAuthenticated'](),controller[_0x1c70('0x11')]);router[_0x1c70('0xb')](_0x1c70('0x12'),auth[_0x1c70('0x9')](),controller['getInteractions']);router[_0x1c70('0xb')](_0x1c70('0x13'),controller[_0x1c70('0x14')]);router[_0x1c70('0xb')](_0x1c70('0x15'),auth[_0x1c70('0x9')](),controller['getAgents']);router[_0x1c70('0x16')]('/',auth['isAuthenticated'](),controller[_0x1c70('0x17')]);router['post'](_0x1c70('0xd'),auth[_0x1c70('0x9')](),controller[_0x1c70('0x18')]);router[_0x1c70('0x16')](_0x1c70('0xe'),auth['isAuthenticated'](),controller[_0x1c70('0x19')]);router['post'](_0x1c70('0x1a'),controller[_0x1c70('0x1b')]);router[_0x1c70('0x16')](_0x1c70('0x10'),auth[_0x1c70('0x9')](),controller[_0x1c70('0x1c')]);router[_0x1c70('0x16')](_0x1c70('0x1d'),auth[_0x1c70('0x9')](),controller[_0x1c70('0x1e')]);router[_0x1c70('0x16')](_0x1c70('0x13'),controller['status']);router[_0x1c70('0x16')](_0x1c70('0x15'),auth[_0x1c70('0x9')](),controller[_0x1c70('0x1f')]);router[_0x1c70('0x20')](_0x1c70('0x21'),auth[_0x1c70('0x9')](),controller['update']);router[_0x1c70('0x22')](_0x1c70('0x21'),auth[_0x1c70('0x9')](),controller[_0x1c70('0x23')]);router[_0x1c70('0x22')](_0x1c70('0xd'),auth[_0x1c70('0x9')](),controller[_0x1c70('0x24')]);router[_0x1c70('0x22')]('/:id/canned_answers',auth[_0x1c70('0x9')](),controller['removeAnswers']);router[_0x1c70('0x22')](_0x1c70('0x15'),auth[_0x1c70('0x9')](),controller[_0x1c70('0x25')]);module[_0x1c70('0x26')]=router;
\ No newline at end of file
index 295a7ed..a9456c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff76=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','skebby','connectel','clicksend','clickatell','infobip','intelepeer','TEXT'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xff76,0x1d3));var _0x6ff7=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xff76[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0x6ff7('0x0'));var rs=require(_0x6ff7('0x1'));module[_0x6ff7('0x2')]={'name':{'type':Sequelize[_0x6ff7('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x6ff7('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6ff7('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6ff7('0x5')]('twilio',_0x6ff7('0x6'),_0x6ff7('0x7'),_0x6ff7('0x8'),'plivo',_0x6ff7('0x9'),'csc',_0x6ff7('0xa'),_0x6ff7('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x6ff7('0x3')]},'authToken':{'type':Sequelize[_0x6ff7('0x3')]},'smsMethod':{'type':Sequelize[_0x6ff7('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x6ff7('0x3')]},'password':{'type':Sequelize[_0x6ff7('0x3')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x6ff7('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x6ff7('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6ff7('0xc')],'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[_0x6ff7('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6ff7('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6ff7('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6ff7('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6ff7('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6ff7('0xe')],'comment':_0x6ff7('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x6ff7('0xd')],'defaultValue':![],'comment':_0x6ff7('0x10'),'set':function(_0x1f4d10){if(!_0x1f4d10)this[_0x6ff7('0x11')](_0x6ff7('0x12'),null);this[_0x6ff7('0x11')](_0x6ff7('0x13'),_0x1f4d10);}}};
\ No newline at end of file
+var _0x30cd=['twilio','skebby','clicksend','plivo','clickatell','csc','intelepeer','BOOLEAN','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x116a23,_0xe53a90){var _0x27186e=function(_0x10cdbe){while(--_0x10cdbe){_0x116a23['push'](_0x116a23['shift']());}};_0x27186e(++_0xe53a90);}(_0x30cd,0x126));var _0xd30c=function(_0x453536,_0x46622b){_0x453536=_0x453536-0x0;var _0x252fb0=_0x30cd[_0x453536];return _0x252fb0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xd30c('0x0'));module[_0xd30c('0x1')]={'name':{'type':Sequelize[_0xd30c('0x2')],'unique':_0xd30c('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xd30c('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xd30c('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xd30c('0x2')],'defaultValue':function(){return rs[_0xd30c('0x4')]();}},'phone':{'type':Sequelize[_0xd30c('0x2')]},'type':{'type':Sequelize[_0xd30c('0x5')](_0xd30c('0x6'),_0xd30c('0x7'),'connectel',_0xd30c('0x8'),_0xd30c('0x9'),_0xd30c('0xa'),_0xd30c('0xb'),'infobip',_0xd30c('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xd30c('0x2')]},'authToken':{'type':Sequelize[_0xd30c('0x2')]},'smsMethod':{'type':Sequelize[_0xd30c('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xd30c('0x2')]},'password':{'type':Sequelize[_0xd30c('0x2')]},'apiKey':{'type':Sequelize[_0xd30c('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xd30c('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xd30c('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd30c('0xe');}},'notificationSound':{'type':Sequelize[_0xd30c('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd30c('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd30c('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd30c('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd30c('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd30c('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xd30c('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd30c('0xf')],'comment':_0xd30c('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd30c('0x11'),'set':function(_0x525408){if(!_0x525408)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xd30c('0x12')](_0xd30c('0x13'),_0x525408);}}};
\ No newline at end of file
index ede45c0..d8fd478 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','DESC','List','out','Messages','spread','dataValues','push','log','skebby_dispatch_id','statusInt','requestid','clicksend','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','limit','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','SmsAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','rawAttributes','length','find','create','user','role','SmsAccounts','UserProfileSection','autoAssociation','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','SmsApplication','Applications','account','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','From','Body','messageId','skebby','from','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','intelepeer','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','SmsInteraction','interaction','applications','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','bulkCreate'];(function(_0xe53033,_0x191b7b){var _0x544dbf=function(_0x46b3f3){while(--_0x46b3f3){_0xe53033['push'](_0xe53033['shift']());}};_0x544dbf(++_0x191b7b);}(_0x7a54,0x106));var _0x47a5=function(_0x4f50d5,_0x549563){_0x4f50d5=_0x4f50d5-0x0;var _0x103c33=_0x7a54[_0x4f50d5];return _0x103c33;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);var jayson=require(_0x47a5('0x1a'));var client=jayson[_0x47a5('0x1b')][_0x47a5('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x190faa,_0x4e99a8,_0x362359){if(_0x362359){var _0x11faf5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11faf5[_0x47a5('0x1d')](_0x4e99a8)){return _0x190faa;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x190faa;}}function respondWithRpcPromise(_0x549de3,_0x138bc0,_0x4b966e,_0x5247fd){return new BPromise(function(_0x423a81,_0xaf70a6){var _0x2ce454=_0x5247fd||client;return _0x2ce454[_0x47a5('0x20')](_0x549de3,_0x4b966e)[_0x47a5('0x21')](function(_0x12b98e){logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,_0x47a5('0x24'));logger['debug'](_0x47a5('0x25'),_0x138bc0,_0x47a5('0x24'),JSON['stringify'](_0x12b98e));if(_0x12b98e[_0x47a5('0x26')]){if(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x27')]===0x1f4){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);return _0xaf70a6(_0x12b98e[_0x47a5('0x26')]['message']);}logger[_0x47a5('0x26')](_0x47a5('0x23'),_0x138bc0,_0x12b98e['error'][_0x47a5('0x28')]);return _0x423a81(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);}else{logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,'request\x20sent');_0x423a81(_0x12b98e['result'][_0x47a5('0x28')]);}})['catch'](function(_0x1ea9c8){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x1ea9c8);_0xaf70a6(_0x1ea9c8);});});}function respondWithStatusCode(_0x378208,_0x36ad34){_0x36ad34=_0x36ad34||0xcc;return function(_0x1dac65){if(_0x1dac65){return _0x378208[_0x47a5('0x29')](_0x36ad34);}return _0x378208[_0x47a5('0x2a')](_0x36ad34)[_0x47a5('0x2b')]();};}function respondWithResult(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0xc8;return function(_0x361bfa){if(_0x361bfa){return _0x136b14[_0x47a5('0x2a')](_0x16631f)[_0x47a5('0x2c')](_0x361bfa);}};}function respondWithFilteredResult(_0x3ad507,_0x528582){return function(_0x243210){if(_0x243210){var _0x51833b=_0x243210['count'],_0x2ef875=_0x528582[_0x47a5('0x2d')],_0x9ac908=_0x528582[_0x47a5('0x2d')]+_0x528582[_0x47a5('0x2e')],_0x16901f;if(_0x9ac908>=_0x51833b){_0x9ac908=_0x51833b;_0x16901f=0xc8;}else{_0x16901f=0xce;}_0x3ad507[_0x47a5('0x2a')](_0x16901f);return _0x3ad507['set']('Content-Range',_0x2ef875+'-'+_0x9ac908+'/'+_0x51833b)[_0x47a5('0x2c')](_0x243210);}return null;};}function patchUpdates(_0xfb5ddb){return function(_0x5bd7eb){try{jsonpatch['apply'](_0x5bd7eb,_0xfb5ddb,!![]);}catch(_0x836303){return BPromise[_0x47a5('0x2f')](_0x836303);}return _0x5bd7eb['save']();};}function saveUpdates(_0x42f70c,_0x53119b){return function(_0x122ed6){if(_0x122ed6){return _0x122ed6[_0x47a5('0x30')](_0x42f70c)['then'](function(_0x4843c0){return _0x4843c0;});}return null;};}function removeEntity(_0x274e34,_0x5910bb){return function(_0x403028){if(_0x403028){return _0x403028[_0x47a5('0x31')]()[_0x47a5('0x21')](function(){var _0x52749b=_0x403028[_0x47a5('0x32')]({'plain':!![]});var _0x50c086='SmsAccounts';return db[_0x47a5('0x33')]['destroy']({'where':{'type':_0x50c086,'resourceId':_0x52749b['id']}})[_0x47a5('0x21')](function(){return _0x403028;});})['then'](function(){_0x274e34[_0x47a5('0x2a')](0xcc)[_0x47a5('0x2b')]();});}};}function handleEntityNotFound(_0x38c8d4,_0x199698){return function(_0x36add5){if(!_0x36add5){_0x38c8d4[_0x47a5('0x29')](0x194);}return _0x36add5;};}function handleError(_0xee582c,_0x452be5){_0x452be5=_0x452be5||0x1f4;return function(_0x1a0d23){logger['error'](_0x1a0d23[_0x47a5('0x34')]);if(_0x1a0d23[_0x47a5('0x35')]){delete _0x1a0d23['name'];}_0xee582c[_0x47a5('0x2a')](_0x452be5)[_0x47a5('0x36')](_0x1a0d23);};}exports[_0x47a5('0x37')]=function(_0x49c4b5,_0x101f70){var _0x10f660={'include':[{'model':db[_0x47a5('0x38')],'as':'mandatoryDispositionPause'}]},_0x596097={},_0x2ebba0={'count':0x0,'rows':[]};var _0x55c5eb=_['map'](db[_0x47a5('0x39')]['rawAttributes'],function(_0x9b5eaf){return{'name':_0x9b5eaf[_0x47a5('0x3a')],'type':_0x9b5eaf[_0x47a5('0x3b')][_0x47a5('0x3c')]};});_0x596097[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x55c5eb,_0x47a5('0x35'));_0x596097[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3f')]);_0x596097[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],_0x596097['query']);_0x10f660[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x49c4b5['query'][_0x47a5('0x44')]));_0x10f660['attributes']=_0x10f660['attributes']['length']?_0x10f660['attributes']:_0x596097[_0x47a5('0x3d')];if(!_0x49c4b5['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x10f660[_0x47a5('0x2e')]=qs['limit'](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x10f660['offset']=qs['offset'](_0x49c4b5[_0x47a5('0x3f')]['offset']);}_0x10f660[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x10f660[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x49c4b5[_0x47a5('0x3f')],_0x596097[_0x47a5('0x41')]),_0x55c5eb);if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x4b')]){_0x10f660[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x10f660[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x55c5eb,function(_0x3a2b38){if(_0x3a2b38['type']!==_0x47a5('0x4d')){var _0x23bb04={};_0x23bb04[_0x3a2b38['name']]={'$like':'%'+_0x49c4b5['query'][_0x47a5('0x4b')]+'%'};return _0x23bb04;}})});}_0x10f660=_['merge']({},_0x10f660,_0x49c4b5[_0x47a5('0x4e')]);var _0xd93e37={'where':_0x10f660['where']};return db['SmsAccount'][_0x47a5('0x4f')](_0xd93e37)['then'](function(_0x2d147c){_0x2ebba0[_0x47a5('0x4f')]=_0x2d147c;if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x10f660[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x39')][_0x47a5('0x52')](_0x10f660);})['then'](function(_0x48a0ef){_0x2ebba0[_0x47a5('0x53')]=_0x48a0ef;return _0x2ebba0;})[_0x47a5('0x21')](respondWithFilteredResult(_0x101f70,_0x10f660))[_0x47a5('0x54')](handleError(_0x101f70,null));};exports[_0x47a5('0x55')]=function(_0x2c7020,_0x2c0c86){var _0x249de5={'raw':![],'where':{'id':_0x2c7020[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]},_0x492cf7={};_0x492cf7['model']=_[_0x47a5('0x40')](db['SmsAccount'][_0x47a5('0x58')]);_0x492cf7[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x2c7020[_0x47a5('0x3f')]);_0x492cf7['filters']=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],_0x492cf7[_0x47a5('0x3f')]);_0x249de5[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x2c7020['query'][_0x47a5('0x44')]));_0x249de5[_0x47a5('0x43')]=_0x249de5[_0x47a5('0x43')][_0x47a5('0x59')]?_0x249de5[_0x47a5('0x43')]:_0x492cf7[_0x47a5('0x3d')];if(_0x2c7020['query'][_0x47a5('0x50')]){_0x249de5[_0x47a5('0x51')]=[{'all':!![]}];}_0x249de5=_[_0x47a5('0x4c')]({},_0x249de5,_0x2c7020['options']);return db[_0x47a5('0x39')][_0x47a5('0x5a')](_0x249de5)[_0x47a5('0x21')](handleEntityNotFound(_0x2c0c86,null))['then'](respondWithResult(_0x2c0c86,null))['catch'](handleError(_0x2c0c86,null));};exports[_0x47a5('0x5b')]=function(_0x376e1d,_0x4fa1da){return db['SmsAccount'][_0x47a5('0x5b')](_0x376e1d['body'],{})[_0x47a5('0x21')](function(_0x5d383d){var _0x482de6=_0x376e1d[_0x47a5('0x5c')][_0x47a5('0x32')]({'plain':!![]});if(!_0x482de6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x482de6[_0x47a5('0x5d')]===_0x47a5('0x5c')){var _0x4b706a=_0x5d383d['get']({'plain':!![]});var _0x16b4fd=_0x47a5('0x5e');return db[_0x47a5('0x5f')][_0x47a5('0x5a')]({'where':{'name':_0x16b4fd,'userProfileId':_0x482de6['userProfileId']},'raw':!![]})[_0x47a5('0x21')](function(_0x2b4255){if(_0x2b4255&&_0x2b4255[_0x47a5('0x60')]===0x0){return db['UserProfileResource'][_0x47a5('0x5b')]({'name':_0x4b706a['name'],'resourceId':_0x4b706a['id'],'type':_0x2b4255[_0x47a5('0x35')],'sectionId':_0x2b4255['id']},{})[_0x47a5('0x21')](function(){return _0x5d383d;});}else{return _0x5d383d;}})[_0x47a5('0x54')](function(_0x1c485b){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c485b);throw _0x1c485b;});}return _0x5d383d;})[_0x47a5('0x21')](respondWithResult(_0x4fa1da,0xc9))['catch'](handleError(_0x4fa1da,null));};exports['update']=function(_0x5eb150,_0x4f8564){if(_0x5eb150[_0x47a5('0x61')]['id']){delete _0x5eb150[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')]['find']({'where':{'id':_0x5eb150['params']['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x4f8564,null))[_0x47a5('0x21')](saveUpdates(_0x5eb150[_0x47a5('0x61')],null))['then'](respondWithResult(_0x4f8564,null))[_0x47a5('0x54')](handleError(_0x4f8564,null));};exports['destroy']=function(_0x22c886,_0x274d31){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x22c886[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x274d31,null))[_0x47a5('0x21')](removeEntity(_0x274d31,null))[_0x47a5('0x54')](handleError(_0x274d31,null));};exports[_0x47a5('0x62')]=function(_0x35cca8,_0x3ac38c){return db['SmsAccount'][_0x47a5('0x62')]()[_0x47a5('0x21')](respondWithResult(_0x3ac38c,null))[_0x47a5('0x54')](handleError(_0x3ac38c,null));};exports[_0x47a5('0x63')]=function(_0x396cb0,_0x4bbe14,_0xbec033){if(_0x396cb0[_0x47a5('0x61')]['id']){delete _0x396cb0[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x396cb0[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4bbe14,null))[_0x47a5('0x21')](function(_0x350af8){if(_0x350af8){_0x396cb0[_0x47a5('0x61')][_0x47a5('0x64')]=_0x350af8['id'];return db[_0x47a5('0x65')][_0x47a5('0x5b')](_0x396cb0[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x4bbe14,null))['catch'](handleError(_0x4bbe14,null));};exports[_0x47a5('0x66')]=function(_0x284fb8,_0x30504e,_0x4b42f3){var _0x37ac59={'raw':![],'where':{}};var _0x2e46af={};var _0x36c67={'count':0x0,'rows':[]};return db[_0x47a5('0x39')]['findOne']({'where':{'id':_0x284fb8[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x30504e,null))[_0x47a5('0x21')](function(_0x487e21){if(_0x487e21){_0x2e46af[_0x47a5('0x3d')]=_['keys'](db[_0x47a5('0x65')][_0x47a5('0x58')]);_0x2e46af[_0x47a5('0x3f')]=_['keys'](_0x284fb8['query']);_0x2e46af['filters']=_[_0x47a5('0x42')](_0x2e46af[_0x47a5('0x3d')],_0x2e46af[_0x47a5('0x3f')]);_0x37ac59[_0x47a5('0x43')]=_['intersection'](_0x2e46af[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x37ac59[_0x47a5('0x43')]=_0x37ac59[_0x47a5('0x43')][_0x47a5('0x59')]?_0x37ac59[_0x47a5('0x43')]:_0x2e46af[_0x47a5('0x3d')];if(!_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x45')](_0x47a5('0x46'))){_0x37ac59['limit']=qs[_0x47a5('0x2e')](_0x284fb8['query'][_0x47a5('0x2e')]);_0x37ac59[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x37ac59[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x37ac59[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x284fb8[_0x47a5('0x3f')],_0x2e46af[_0x47a5('0x41')]));_0x37ac59[_0x47a5('0x49')]['SmsAccountId']=_0x487e21['id'];if(_0x284fb8['query']['filter']){_0x37ac59['where']=_[_0x47a5('0x4c')](_0x37ac59[_0x47a5('0x49')],{'$or':_['map'](_0x37ac59[_0x47a5('0x43')],function(_0x44dda2){var _0x1baa5a={};_0x1baa5a[_0x44dda2]={'$like':'%'+_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1baa5a;})});}_0x37ac59=_[_0x47a5('0x4c')]({},_0x37ac59,_0x284fb8[_0x47a5('0x4e')]);return db[_0x47a5('0x65')][_0x47a5('0x4f')]({'where':_0x37ac59[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x5e5f16){_0x36c67[_0x47a5('0x4f')]=_0x5e5f16;if(_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x37ac59['include']=[{'all':!![]}];}return db[_0x47a5('0x65')][_0x47a5('0x52')](_0x37ac59);})[_0x47a5('0x21')](function(_0x5d41d8){_0x36c67[_0x47a5('0x53')]=_0x5d41d8;return _0x36c67;});}})['then'](respondWithFilteredResult(_0x30504e,_0x37ac59))['catch'](handleError(_0x30504e,null));};exports[_0x47a5('0x67')]=function(_0x292d9c,_0x277486,_0x27333e){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x292d9c['params']['id']}})['then'](handleEntityNotFound(_0x277486,null))[_0x47a5('0x21')](function(_0x4f2361){if(_0x4f2361){return _0x4f2361[_0x47a5('0x67')](_0x292d9c[_0x47a5('0x3f')][_0x47a5('0x68')]);}})[_0x47a5('0x21')](respondWithStatusCode(_0x277486,null))['catch'](handleError(_0x277486,null));};exports[_0x47a5('0x69')]=function(_0x550bde,_0x5f3a04,_0x139c79){if(_0x550bde[_0x47a5('0x61')]['id']){delete _0x550bde['body']['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x550bde[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f3a04,null))[_0x47a5('0x21')](function(_0x578e27){if(_0x578e27){_0x550bde[_0x47a5('0x61')][_0x47a5('0x64')]=_0x578e27['id'];return db[_0x47a5('0x6a')]['create'](_0x550bde[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x5f3a04,null))[_0x47a5('0x54')](handleError(_0x5f3a04,null));};exports['getAnswers']=function(_0x3525e7,_0x4f2fbb,_0x3c012b){var _0x491bb4={'raw':![],'where':{}};var _0x135d2e={};var _0x20d8bd={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x3525e7['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4f2fbb,null))[_0x47a5('0x21')](function(_0x23c393){if(_0x23c393){_0x135d2e[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db['CannedAnswer']['rawAttributes']);_0x135d2e[_0x47a5('0x3f')]=_['keys'](_0x3525e7[_0x47a5('0x3f')]);_0x135d2e[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x135d2e['model'],_0x135d2e[_0x47a5('0x3f')]);_0x491bb4[_0x47a5('0x43')]=_['intersection'](_0x135d2e[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x491bb4['attributes']=_0x491bb4['attributes'][_0x47a5('0x59')]?_0x491bb4[_0x47a5('0x43')]:_0x135d2e['model'];if(!_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x45')]('nolimit')){_0x491bb4[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x3525e7[_0x47a5('0x3f')]['limit']);_0x491bb4[_0x47a5('0x2d')]=qs['offset'](_0x3525e7[_0x47a5('0x3f')]['offset']);}_0x491bb4[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x3525e7['query'][_0x47a5('0x48')]);_0x491bb4['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x3525e7[_0x47a5('0x3f')],_0x135d2e[_0x47a5('0x41')]));_0x491bb4['where'][_0x47a5('0x64')]=_0x23c393['id'];if(_0x3525e7['query']['filter']){_0x491bb4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x491bb4[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x491bb4[_0x47a5('0x43')],function(_0x5b1f5e){var _0x1522a6={};_0x1522a6[_0x5b1f5e]={'$like':'%'+_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1522a6;})});}_0x491bb4=_[_0x47a5('0x4c')]({},_0x491bb4,_0x3525e7['options']);return db[_0x47a5('0x6a')]['count']({'where':_0x491bb4[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x3f93f0){_0x20d8bd[_0x47a5('0x4f')]=_0x3f93f0;if(_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x491bb4[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x6a')][_0x47a5('0x52')](_0x491bb4);})['then'](function(_0x36796e){_0x20d8bd[_0x47a5('0x53')]=_0x36796e;return _0x20d8bd;});}})['then'](respondWithFilteredResult(_0x4f2fbb,_0x491bb4))[_0x47a5('0x54')](handleError(_0x4f2fbb,null));};exports[_0x47a5('0x6c')]=function(_0x6d6a5,_0x5b85cd,_0x4bf1f5){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x6d6a5['params']['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x21')](function(_0x17f82d){if(_0x17f82d){return _0x17f82d['removeAnswers'](_0x6d6a5[_0x47a5('0x3f')][_0x47a5('0x68')]);}})['then'](respondWithStatusCode(_0x5b85cd,null))[_0x47a5('0x54')](handleError(_0x5b85cd,null));};exports[_0x47a5('0x6d')]=function(_0x109805,_0x70c8a6,_0x364bb0){var _0x1371e4={'channel':'sms'};var _0x4c9894=[];var _0x5bd86e=[];var _0x133b7a={};return db[_0x47a5('0x39')]['find']({'where':{'id':_0x109805[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x6e')],'as':_0x47a5('0x6f')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x5084d6){_0x1371e4[_0x47a5('0x70')]=_0x5084d6;_0x1371e4['applications']=_['orderBy'](_0x5084d6['Applications'],[_0x47a5('0x71')],['asc']);if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x6f')]){delete _0x1371e4[_0x47a5('0x70')]['Applications'];}return db[_0x47a5('0x72')][_0x47a5('0x62')]();})[_0x47a5('0x21')](function(_0x121750){if(!_0x121750){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x73'));}_0x4c9894=_[_0x47a5('0x74')](_['keys'](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76')]);_0x5bd86e=_[_0x47a5('0x74')](_[_0x47a5('0x40')](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76'),'CompanyId',_0x47a5('0x77')]);_0x1371e4[_0x47a5('0x61')]={'mapKey':'mobile'};if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){switch(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){case'twilio':_0x1371e4['body']['from']=_0x109805['body'][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x79')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['MessageSid'];break;case _0x47a5('0x7b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['sender'];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body']['text'];break;case _0x47a5('0x7d'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805[_0x47a5('0x61')][_0x47a5('0x28')];break;case'clicksend':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x61')];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7e')];break;case _0x47a5('0x7f'):_0x1371e4['body'][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x80')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x81')];break;case _0x47a5('0x82'):_0x1371e4['body'][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['results'][0x0][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0]['text'];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0][_0x47a5('0x7a')];break;case _0x47a5('0x84'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805['body'][_0x47a5('0x85')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x86')][_0x47a5('0x28')];break;case _0x47a5('0x87'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x88')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805['body'][_0x47a5('0x89')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x8a')];break;case _0x47a5('0x8b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805['body'][_0x47a5('0x7c')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')]['message'];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['refid'];break;}}if(_0x1371e4[_0x47a5('0x61')]['id']){delete _0x1371e4[_0x47a5('0x61')]['id'];}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')]['from'])){throw new db[(_0x47a5('0x1e'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x1371e4[_0x47a5('0x61')]['body'])||_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8d'));}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8f')+_0x5bd86e);}if(!_[_0x47a5('0x90')](_0x5bd86e,_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x91')+_0x5bd86e);}_0x133b7a[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db[_0x47a5('0x92')]['find']({'where':{'id':_0x1371e4[_0x47a5('0x70')]['ListId']},'include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':_0x133b7a,'limit':0x1,'order':[[_0x47a5('0x76'),'DESC']]}]});})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x14771b){if(_0x14771b){_0x1371e4['list']=_['omit'](_0x14771b,[_0x47a5('0x93')]);if(_0x14771b[_0x47a5('0x93')][_0x47a5('0x59')]){return _0x14771b[_0x47a5('0x93')][0x0];}var _0x204bd6=_['defaults'](_0x1371e4[_0x47a5('0x61')],{'firstName':_0x1371e4['body'][_0x47a5('0x7c')],'ListId':_0x14771b['id']});_0x204bd6[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db['CmContact'][_0x47a5('0x5b')](_0x204bd6,{'fields':_0x4c9894,'raw':!![]});}})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x4339d4){if(_0x4339d4){_0x1371e4[_0x47a5('0x94')]=_0x4339d4;var _0x36a44c={'ContactId':_0x4339d4['id'],'phone':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')],'SmsAccountId':_0x109805[_0x47a5('0x56')]['id']};var _0x481bc3={'ContactId':_0x4339d4['id'],'SmsAccountId':_0x109805['params']['id'],'closed':![]};return db[_0x47a5('0x95')]['find']({'where':_0x481bc3})[_0x47a5('0x21')](function(_0x2d0b67){if(_0x2d0b67){return[_0x2d0b67,![]];}return db[_0x47a5('0x95')]['create'](_0x36a44c)[_0x47a5('0x21')](function(_0x26d629){return[_0x26d629,!![]];});});}})['spread'](function(_0xcb6714,_0x51f6cf){_0x1371e4[_0x47a5('0x96')]=_0xcb6714[_0x47a5('0x32')]({'plain':!![]});_0x1371e4[_0x47a5('0x96')]['created']=![];if(_0x51f6cf){if(_0x1371e4['account']['autoclose']){_0x1371e4['applications']['push']({'id':0x0,'priority':_0x1371e4[_0x47a5('0x97')]['length']+0x1,'app':_0x47a5('0x98'),'appdata':_0x47a5('0x99'),'interval':'*,*,*,*'});}_0x1371e4['interaction']['created']=!![];}return db[_0x47a5('0x9a')]['create']({'phone':_0x1371e4['body']['from'],'messageId':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')],'body':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')],'SmsAccountId':_0x109805['params']['id'],'SmsInteractionId':_0xcb6714['id'],'direction':'in','ContactId':_0xcb6714[_0x47a5('0x9b')],'AttachmentId':_0x1371e4['body'][_0x47a5('0x9c')]});})['then'](function(_0x2de924){_0x1371e4[_0x47a5('0x28')]=_0x2de924;if(_0x1371e4[_0x47a5('0x96')]['UserId']){return db[_0x47a5('0x9d')][_0x47a5('0x5a')]({'attributes':['id',_0x47a5('0x35')],'where':{'id':_0x1371e4[_0x47a5('0x96')]['UserId']}})[_0x47a5('0x21')](function(_0x9a7edc){if(_0x9a7edc){_0x1371e4[_0x47a5('0x97')][_0x47a5('0x9e')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x9f'),'appdata':_0x9a7edc[_0x47a5('0x35')]+','+(_0x1371e4['account'][_0x47a5('0xa0')]||0xa),'interval':_0x47a5('0xa1')});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);})[_0x47a5('0x21')](function(_0x2697df){if(_0x2697df){var _0x408887=0xc8;var _0x34fde3=_0x47a5('0xa4');logger[_0x47a5('0x22')](_0x47a5('0x25'),_0x34fde3,_0x408887,_0x47a5('0xa5'));logger[_0x47a5('0xa6')](_0x47a5('0xa7'),_0x34fde3,_0x408887,_0x47a5('0xa5'),JSON['stringify'](_0x2697df));if(_0x1371e4[_0x47a5('0x70')]['type']==='twilio'){return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0xa8')](_0x47a5('0xa9'),'text/xml')[_0x47a5('0x36')](_0x47a5('0xaa'));}else{return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0x2c')](_0x2697df);}}})[_0x47a5('0x54')](handleError(_0x70c8a6,null));};exports[_0x47a5('0xab')]=function(_0x1b1f86,_0x46cb3a,_0x176e71){return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1b1f86[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x46cb3a,null))['then'](function(_0x4aad5f){if(_0x4aad5f){return db[_0x47a5('0xac')]['transaction'](function(_0x249339){return db[_0x47a5('0x6e')][_0x47a5('0x31')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'transaction':_0x249339})[_0x47a5('0x21')](function(_0x3708ea){var _0x583b37=_[_0x47a5('0x3e')](_0x1b1f86[_0x47a5('0x61')],function(_0x380eca){_0x380eca['SmsAccountId']=_0x1b1f86[_0x47a5('0x56')]['id'];return _0x380eca;});return db[_0x47a5('0x6e')][_0x47a5('0xad')](_0x583b37,{'transaction':_0x249339});});})[_0x47a5('0x21')](function(){return db[_0x47a5('0x6e')][_0x47a5('0xae')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'order':_0x47a5('0x71')});});}})[_0x47a5('0x21')](respondWithResult(_0x46cb3a,null))[_0x47a5('0x54')](handleError(_0x46cb3a,null));};exports[_0x47a5('0xaf')]=function(_0x40b7a5,_0x28e998,_0x2ac386){var _0x578983={};var _0x3f7fdc={};var _0x272cd0;var _0x150cff;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x40b7a5[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x28e998,null))['then'](function(_0x185104){if(_0x185104){_0x272cd0=_0x185104;_0x3f7fdc['model']=_[_0x47a5('0x40')](db[_0x47a5('0x6e')][_0x47a5('0x58')]);_0x3f7fdc[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x40b7a5[_0x47a5('0x3f')]);_0x3f7fdc[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],_0x3f7fdc[_0x47a5('0x3f')]);_0x578983[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],qs[_0x47a5('0x44')](_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x578983[_0x47a5('0x43')]=_0x578983['attributes'][_0x47a5('0x59')]?_0x578983[_0x47a5('0x43')]:_0x3f7fdc[_0x47a5('0x3d')];_0x578983[_0x47a5('0x47')]=qs['sort'](_0x40b7a5[_0x47a5('0x3f')]['sort']);_0x578983['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x40b7a5[_0x47a5('0x3f')],_0x3f7fdc[_0x47a5('0x41')]));if(_0x40b7a5['query'][_0x47a5('0x4b')]){_0x578983[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x578983[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x578983[_0x47a5('0x43')],function(_0x5eae8d){var _0x1da268={};_0x1da268[_0x5eae8d]={'$like':'%'+_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1da268;})});}_0x578983=_[_0x47a5('0x4c')]({},_0x578983,_0x40b7a5[_0x47a5('0x4e')]);return _0x272cd0['getApplications'](_0x578983);}})[_0x47a5('0x21')](function(_0x4c7627){if(_0x4c7627){_0x150cff=_0x4c7627[_0x47a5('0x59')];if(!_0x40b7a5['query'][_0x47a5('0x45')]('nolimit')){_0x578983['limit']=qs[_0x47a5('0x2e')](_0x40b7a5[_0x47a5('0x3f')]['limit']);_0x578983[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x40b7a5['query'][_0x47a5('0x2d')]);}return _0x272cd0[_0x47a5('0xaf')](_0x578983);}})[_0x47a5('0x21')](function(_0x508622){if(_0x508622){return _0x508622?{'count':_0x150cff,'rows':_0x508622}:null;}})[_0x47a5('0x21')](respondWithResult(_0x28e998,null))[_0x47a5('0x54')](handleError(_0x28e998,null));};exports[_0x47a5('0xb0')]=function(_0x30b0f9,_0x37721c,_0x53cc9e){var _0x5973d4={'raw':![],'where':{}};var _0x2678cb={};var _0x56808d={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x30b0f9['params']['id']}})['then'](handleEntityNotFound(_0x37721c,null))[_0x47a5('0x21')](function(_0x4997bc){if(_0x4997bc){_0x2678cb[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x95')][_0x47a5('0x58')]);_0x2678cb[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x30b0f9[_0x47a5('0x3f')]);_0x2678cb['filters']=_[_0x47a5('0x42')](_0x2678cb['model'],_0x2678cb[_0x47a5('0x3f')]);_0x5973d4[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x2678cb[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x5973d4[_0x47a5('0x43')]=_0x5973d4[_0x47a5('0x43')][_0x47a5('0x59')]?_0x5973d4[_0x47a5('0x43')]:_0x2678cb[_0x47a5('0x3d')];if(!_0x30b0f9['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x5973d4[_0x47a5('0x2e')]=qs['limit'](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x5973d4[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x5973d4['order']=qs[_0x47a5('0x48')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x5973d4[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x30b0f9[_0x47a5('0x3f')],_0x2678cb[_0x47a5('0x41')]));_0x5973d4[_0x47a5('0x49')][_0x47a5('0x64')]=_0x4997bc['id'];if(_0x30b0f9['query']['filter']){_0x5973d4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x5973d4[_0x47a5('0x49')],{'$or':_['map'](_0x5973d4[_0x47a5('0x43')],function(_0x50b7fc){var _0x522345={};_0x522345[_0x50b7fc]={'$like':'%'+_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x522345;})});}_0x5973d4=_[_0x47a5('0x4c')]({},_0x5973d4,_0x30b0f9[_0x47a5('0x4e')]);return db['SmsInteraction'][_0x47a5('0x4f')]({'where':_0x5973d4[_0x47a5('0x49')]})['then'](function(_0x59ba59){_0x56808d['count']=_0x59ba59;if(_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x5973d4[_0x47a5('0x51')]=[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0xb1'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x47a5('0x35'),_0x47a5('0xb2'),_0x47a5('0xb3')],'required':![]},{'model':db[_0x47a5('0xb4')],'as':'Tags','attributes':['id',_0x47a5('0x35'),_0x47a5('0xb5')],'where':_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0xb6')]?{'id':_0x30b0f9['query']['tag']}:undefined,'required':_0x30b0f9['query'][_0x47a5('0xb6')]?!![]:![]}];}return db[_0x47a5('0x95')][_0x47a5('0x52')](_0x5973d4);})[_0x47a5('0x21')](function(_0x242006){_0x56808d[_0x47a5('0x53')]=_0x242006;return _0x56808d;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x37721c,_0x5973d4))[_0x47a5('0x54')](handleError(_0x37721c,null));};exports[_0x47a5('0x36')]=function(_0x5b48d0,_0x40fe75,_0x7b5348){var _0x50b482,_0x34ff37,_0x2bbf95;if(_[_0x47a5('0x8c')](_0x5b48d0[_0x47a5('0x61')]['body'])||_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x47a5('0x8c')](_0x5b48d0['body']['to'])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0xb7'));}_0x50b482=_0x5b48d0[_0x47a5('0x61')]['to'];return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x5b48d0[_0x47a5('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':{'mobile':_0x50b482},'limit':0x1,'order':[[_0x47a5('0x76'),_0x47a5('0xb8')]]}]}]})['then'](handleEntityNotFound(_0x40fe75,null))['then'](function(_0x3222e4){if(_0x3222e4&&_0x3222e4['List']){_0x34ff37=_0x3222e4[_0x47a5('0x32')]({'plain':!![]});if(_0x34ff37['List']&&_0x34ff37[_0x47a5('0xb9')]['Contacts'][_0x47a5('0x59')]){return _0x34ff37[_0x47a5('0xb9')][_0x47a5('0x93')][0x0];}return db[_0x47a5('0x72')][_0x47a5('0x5b')](_[_0x47a5('0x16')](_0x5b48d0[_0x47a5('0x61')],{'firstName':_0x50b482,'mobile':_0x50b482,'phone':_0x50b482,'ListId':_0x34ff37[_0x47a5('0x77')]}));}})['then'](handleEntityNotFound(_0x40fe75,null))[_0x47a5('0x21')](function(_0x4394f0){if(_0x4394f0){_0x2bbf95=_0x4394f0;return db['SmsInteraction'][_0x47a5('0x5a')]({'where':{'ContactId':_0x2bbf95['id'],'closed':![],'SmsAccountId':_0x34ff37['id']}})[_0x47a5('0x21')](function(_0x54f283){if(_0x54f283){return[_0x54f283,![]];}return db['SmsInteraction'][_0x47a5('0x5b')]({'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id'],'SmsAccountId':_0x34ff37['id'],'phone':_0x50b482,'firstMsgDirection':_0x47a5('0xba'),'Messages':[_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0['body'][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'UserId':_0x5b48d0[_0x47a5('0x5c')]['id'],'ContactId':_0x2bbf95['id']})]},{'include':[{'model':db[_0x47a5('0x9a')],'as':_0x47a5('0xbb')}]})[_0x47a5('0x21')](function(_0x454609){return[_0x454609,!![]];});});}})[_0x47a5('0xbc')](function(_0x5c4301,_0x2bc0d8){if(_0x2bc0d8){return _0x5c4301;}return db[_0x47a5('0x9a')][_0x47a5('0x5b')](_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'SmsInteractionId':_0x5c4301['id'],'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id']}))['then'](function(_0x11d87b){_0x5c4301[_0x47a5('0xbd')][_0x47a5('0xbb')]=[];_0x5c4301['dataValues']['Messages'][_0x47a5('0xbe')](_0x11d87b[_0x47a5('0xbd')]);return _0x5c4301;});})[_0x47a5('0x21')](respondWithResult(_0x40fe75,null))[_0x47a5('0x54')](handleError(_0x40fe75,null));};exports[_0x47a5('0x2a')]=function(_0x4121c1,_0x2e0add,_0x58e85b){if(_0x4121c1[_0x47a5('0x61')]['id']){delete _0x4121c1[_0x47a5('0x61')]['id'];}console[_0x47a5('0xbf')]('endpoint\x20/status\x20POST\x20/',_0x4121c1[_0x47a5('0x61')]);var _0x611b40,_0x144bc9,_0x278b42;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x4121c1[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x9ced85){if(_0x9ced85){_0x278b42=_0x9ced85;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),'received\x20delivery\x20report\x20from',_0x9ced85[_0x47a5('0x3b')],util['inspect'](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));switch(_0x9ced85['type']){case _0x47a5('0x7b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc0')]&&_0x4121c1['body'][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1['body'][_0x47a5('0x2a')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['skebby_dispatch_id']}});}break;case _0x47a5('0x7d'):if(_0x4121c1['body']['requestid']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc2')]}});}break;case _0x47a5('0xc3'):if(_0x4121c1['body']['message_id']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')];return db[_0x47a5('0x9a')]['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0x7e')]}});}break;case _0x47a5('0x82'):var _0x50ff41=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x50ff41[_0x47a5('0x7a')]&&_0x50ff41['status'][_0x47a5('0xc5')]===_0x47a5('0xc6')){_0x144bc9=_0x50ff41[_0x47a5('0x2a')]['groupName'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x50ff41[_0x47a5('0x7a')]}});}break;case _0x47a5('0x87'):if(_0x4121c1[_0x47a5('0x61')]['messageId']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['messageId']}});}break;case _0x47a5('0x8b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc7')]&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')]['status'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x4ebe30){if(_0x4ebe30){_0x611b40=_0x4ebe30;switch(_0x278b42[_0x47a5('0x3b')]){case _0x47a5('0x7b'):if(_0x144bc9===_0x47a5('0xc6')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x7d'):if(_0x144bc9==='1'){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc9')]&&_0x144bc9>=0xc8&&_0x144bc9<=0xce){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xc3'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x82'):var _0x2cc493=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x2cc493[_0x47a5('0x2a')][_0x47a5('0xc5')]===_0x47a5('0xc6')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),'infobip',util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x144bc9==_0x47a5('0xca')||_0x144bc9==_0x47a5('0xcb')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),'status',_0x47a5('0x87'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x8b'):if(_0x144bc9===_0x47a5('0xcc')||_0x144bc9===_0x47a5('0xcd')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),_0x47a5('0x8b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x611b40;}})[_0x47a5('0x21')](respondWithResult(_0x2e0add,null))[_0x47a5('0x54')](handleError(_0x2e0add,null));};exports[_0x47a5('0xce')]=function(_0x138b92,_0x232c36,_0x25954e){var _0x277061,_0x3917e0,_0x1c7695;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x138b92[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x46b82a){if(_0x46b82a){_0x1c7695=_0x46b82a;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xcf'),_0x46b82a[_0x47a5('0x3b')],util[_0x47a5('0xc8')](_0x138b92['query'],{'showHidden':![],'depth':null}));switch(_0x46b82a[_0x47a5('0x3b')]){case'csc':if(_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]&&_0x138b92['query'][_0x47a5('0xd1')]){_0x3917e0=_0x138b92['query'][_0x47a5('0xd1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x9a2f87){if(_0x9a2f87){_0x277061=_0x9a2f87;switch(_0x1c7695[_0x47a5('0x3b')]){case'csc':if(_0x3917e0==='2'||_0x3917e0==='6'){return _0x277061['update']({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),'csc',util[_0x47a5('0xc8')](_0x138b92[_0x47a5('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x277061;}})[_0x47a5('0x21')](respondWithResult(_0x232c36,null))['catch'](handleError(_0x232c36,null));};exports[_0x47a5('0xd2')]=function(_0x3136f9,_0x3ecc43,_0xf4b1df){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x3136f9['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x3ecc43,null))[_0x47a5('0x21')](function(_0xdc5eac){if(_0xdc5eac){return _0xdc5eac[_0x47a5('0xd2')](_0x3136f9['body'][_0x47a5('0x68')],_[_0x47a5('0xd3')](_0x3136f9[_0x47a5('0x61')],[_0x47a5('0x68'),'id'])||{})[_0x47a5('0xbc')](function(_0x4c2b0c){for(var _0xbe3a38=0x0;_0xbe3a38<_0x3136f9[_0x47a5('0x61')][_0x47a5('0x68')][_0x47a5('0x59')];_0xbe3a38+=0x1){socket[_0x47a5('0xd4')](_0x47a5('0xd5'),{'UserId':_0x3136f9['body'][_0x47a5('0x68')][_0xbe3a38],'SmsAccountId':_0x3136f9[_0x47a5('0x56')]['id']});}return _0x4c2b0c;});}})['then'](respondWithResult(_0x3ecc43,null))['catch'](handleError(_0x3ecc43,null));};exports[_0x47a5('0xd6')]=function(_0x32d299,_0x20d99b,_0x3964f8){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x32d299['params']['id']}})['then'](handleEntityNotFound(_0x20d99b,null))[_0x47a5('0x21')](function(_0xa3a516){if(_0xa3a516){return _0xa3a516['removeAgents'](_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')])['then'](function(){if(_[_0x47a5('0xd7')](_0x32d299['query']['ids'])){for(var _0x4aeaff=0x0;_0x4aeaff<_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')][_0x47a5('0x59')];_0x4aeaff+=0x1){socket['emit'](_0x47a5('0xd8'),{'UserId':Number(_0x32d299['query'][_0x47a5('0x68')][_0x4aeaff]),'SmsAccountId':Number(_0x32d299['params']['id'])});}}else{socket[_0x47a5('0xd4')](_0x47a5('0xd8'),{'UserId':Number(_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')]),'SmsAccountId':Number(_0x32d299[_0x47a5('0x56')]['id'])});}});}})[_0x47a5('0x21')](respondWithStatusCode(_0x20d99b,null))[_0x47a5('0x54')](handleError(_0x20d99b,null));};exports[_0x47a5('0xd9')]=function(_0x1396c2,_0x5c9091,_0x4f1e24){var _0x24c88e={};var _0xa859a={};var _0x5270cc;var _0x2a0f45;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1396c2[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x5c9091,null))[_0x47a5('0x21')](function(_0x969d4b){if(_0x969d4b){_0x5270cc=_0x969d4b;_0xa859a[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x9d')]['rawAttributes']);_0xa859a['query']=_['keys'](_0x1396c2['query']);_0xa859a[_0x47a5('0x41')]=_['intersection'](_0xa859a[_0x47a5('0x3d')],_0xa859a[_0x47a5('0x3f')]);_0x24c88e['attributes']=_[_0x47a5('0x42')](_0xa859a[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x24c88e[_0x47a5('0x43')]=_0x24c88e['attributes'][_0x47a5('0x59')]?_0x24c88e[_0x47a5('0x43')]:_0xa859a['model'];_0x24c88e[_0x47a5('0x47')]=qs['sort'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x24c88e[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x1396c2[_0x47a5('0x3f')],_0xa859a[_0x47a5('0x41')]));if(_0x1396c2['query'][_0x47a5('0x4b')]){_0x24c88e[_0x47a5('0x49')]=_['merge'](_0x24c88e[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x24c88e['attributes'],function(_0x14c968){var _0x5a7920={};_0x5a7920[_0x14c968]={'$like':'%'+_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x5a7920;})});}_0x24c88e=_[_0x47a5('0x4c')]({},_0x24c88e,_0x1396c2[_0x47a5('0x4e')]);return _0x5270cc[_0x47a5('0xd9')](_0x24c88e);}})['then'](function(_0x4b8b65){if(_0x4b8b65){_0x2a0f45=_0x4b8b65[_0x47a5('0x59')];if(!_0x1396c2['query']['hasOwnProperty']('nolimit')){_0x24c88e[_0x47a5('0x2e')]=qs['limit'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x24c88e[_0x47a5('0x2d')]=qs['offset'](_0x1396c2['query'][_0x47a5('0x2d')]);}return _0x5270cc['getAgents'](_0x24c88e);}})['then'](function(_0xe87e6e){if(_0xe87e6e){return _0xe87e6e?{'count':_0x2a0f45,'rows':_0xe87e6e}:null;}})['then'](respondWithResult(_0x5c9091,null))['catch'](handleError(_0x5c9091,null));};
\ No newline at end of file
+var _0x9957=['show','params','fields','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','sort','pick','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','account','applications','orderBy','Applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','list','omit','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','entity\x20found','stringify','Content-Type','text/xml','addApplications','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','DESC','dataValues','Messages','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','intelepeer','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','test','ValidationError','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','apply','save','destroy','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','limit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x42f270,_0x452dec){var _0x57bc5b=function(_0x258159){while(--_0x258159){_0x42f270['push'](_0x42f270['shift']());}};_0x57bc5b(++_0x452dec);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x7995('0x1e'));var client=jayson[_0x7995('0x1f')][_0x7995('0x20')]({'port':0x232c});function checkPasswordPattern(_0x321ae8,_0x3f1d3e,_0x1a5310){if(_0x1a5310){var _0x2202ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2202ce[_0x7995('0x21')](_0x3f1d3e)){return _0x321ae8;}else{throw new db['Sequelize'][(_0x7995('0x22'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x321ae8;}}function respondWithRpcPromise(_0x2f832e,_0x37f297,_0x43d4b8,_0x291317){return new BPromise(function(_0x1e1415,_0x37a7d4){var _0x4faa60=_0x291317||client;return _0x4faa60['request'](_0x2f832e,_0x43d4b8)[_0x7995('0x23')](function(_0x5e6f90){logger['info'](_0x7995('0x24'),_0x37f297,_0x7995('0x25'));logger['debug'](_0x7995('0x26'),_0x37f297,'request\x20sent',JSON['stringify'](_0x5e6f90));if(_0x5e6f90[_0x7995('0x27')]){if(_0x5e6f90[_0x7995('0x27')][_0x7995('0x28')]===0x1f4){logger[_0x7995('0x27')](_0x7995('0x24'),_0x37f297,_0x5e6f90[_0x7995('0x27')]['message']);return _0x37a7d4(_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);}logger[_0x7995('0x27')](_0x7995('0x24'),_0x37f297,_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);return _0x1e1415(_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);}else{logger['info'](_0x7995('0x24'),_0x37f297,_0x7995('0x25'));_0x1e1415(_0x5e6f90[_0x7995('0x2a')][_0x7995('0x29')]);}})[_0x7995('0x2b')](function(_0x2a307e){logger['error'](_0x7995('0x24'),_0x37f297,_0x2a307e);_0x37a7d4(_0x2a307e);});});}function respondWithStatusCode(_0x5911c3,_0x229742){_0x229742=_0x229742||0xcc;return function(_0x49bc7e){if(_0x49bc7e){return _0x5911c3[_0x7995('0x2c')](_0x229742);}return _0x5911c3[_0x7995('0x2d')](_0x229742)[_0x7995('0x2e')]();};}function respondWithResult(_0x4b6f99,_0x9b2a15){_0x9b2a15=_0x9b2a15||0xc8;return function(_0x514445){if(_0x514445){return _0x4b6f99[_0x7995('0x2d')](_0x9b2a15)[_0x7995('0x2f')](_0x514445);}};}function respondWithFilteredResult(_0x4253e5,_0x574574){return function(_0x530611){if(_0x530611){var _0x48e573=_0x530611[_0x7995('0x30')],_0x3573be=_0x574574[_0x7995('0x31')],_0xe6b0b3=_0x574574[_0x7995('0x31')]+_0x574574['limit'],_0x327a81;if(_0xe6b0b3>=_0x48e573){_0xe6b0b3=_0x48e573;_0x327a81=0xc8;}else{_0x327a81=0xce;}_0x4253e5['status'](_0x327a81);return _0x4253e5[_0x7995('0x32')]('Content-Range',_0x3573be+'-'+_0xe6b0b3+'/'+_0x48e573)[_0x7995('0x2f')](_0x530611);}return null;};}function patchUpdates(_0x3eb566){return function(_0x29fac5){try{jsonpatch[_0x7995('0x33')](_0x29fac5,_0x3eb566,!![]);}catch(_0x1f7d27){return BPromise['reject'](_0x1f7d27);}return _0x29fac5[_0x7995('0x34')]();};}function saveUpdates(_0x33e24e,_0x5dd802){return function(_0x48db25){if(_0x48db25){return _0x48db25['update'](_0x33e24e)[_0x7995('0x23')](function(_0x3acfc3){return _0x3acfc3;});}return null;};}function removeEntity(_0x4a176f,_0x3e7020){return function(_0x51b95d){if(_0x51b95d){return _0x51b95d[_0x7995('0x35')]()[_0x7995('0x23')](function(){var _0x177cb4=_0x51b95d['get']({'plain':!![]});var _0x52d76d=_0x7995('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x52d76d,'resourceId':_0x177cb4['id']}})[_0x7995('0x23')](function(){return _0x51b95d;});})[_0x7995('0x23')](function(){_0x4a176f['status'](0xcc)[_0x7995('0x2e')]();});}};}function handleEntityNotFound(_0x1922b4,_0x2b772f){return function(_0x18667c){if(!_0x18667c){_0x1922b4[_0x7995('0x2c')](0x194);}return _0x18667c;};}function handleError(_0x53002a,_0x2d4285){_0x2d4285=_0x2d4285||0x1f4;return function(_0x242713){logger[_0x7995('0x27')](_0x242713[_0x7995('0x37')]);if(_0x242713['name']){delete _0x242713[_0x7995('0x38')];}_0x53002a[_0x7995('0x2d')](_0x2d4285)[_0x7995('0x39')](_0x242713);};}exports[_0x7995('0x3a')]=function(_0x1f5bee,_0x1035dc){var _0x5688a1={'include':[{'model':db[_0x7995('0x3b')],'as':_0x7995('0x3c')}]},_0x183a68={},_0x3be298={'count':0x0,'rows':[]};var _0x2e04cd=_[_0x7995('0x3d')](db[_0x7995('0x3e')][_0x7995('0x3f')],function(_0x1234e1){return{'name':_0x1234e1[_0x7995('0x40')],'type':_0x1234e1[_0x7995('0x41')][_0x7995('0x42')]};});_0x183a68[_0x7995('0x43')]=_['map'](_0x2e04cd,'name');_0x183a68[_0x7995('0x44')]=_[_0x7995('0x45')](_0x1f5bee['query']);_0x183a68['filters']=_[_0x7995('0x46')](_0x183a68['model'],_0x183a68['query']);_0x5688a1[_0x7995('0x47')]=_[_0x7995('0x46')](_0x183a68[_0x7995('0x43')],qs['fields'](_0x1f5bee[_0x7995('0x44')]['fields']));_0x5688a1[_0x7995('0x47')]=_0x5688a1['attributes']['length']?_0x5688a1[_0x7995('0x47')]:_0x183a68[_0x7995('0x43')];if(!_0x1f5bee[_0x7995('0x44')][_0x7995('0x48')]('nolimit')){_0x5688a1[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x1f5bee[_0x7995('0x44')][_0x7995('0x49')]);_0x5688a1['offset']=qs['offset'](_0x1f5bee[_0x7995('0x44')]['offset']);}_0x5688a1[_0x7995('0x4a')]=qs['sort'](_0x1f5bee[_0x7995('0x44')]['sort']);_0x5688a1[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_['pick'](_0x1f5bee[_0x7995('0x44')],_0x183a68[_0x7995('0x4c')]),_0x2e04cd);if(_0x1f5bee[_0x7995('0x44')][_0x7995('0x4d')]){_0x5688a1['where']=_[_0x7995('0x4e')](_0x5688a1[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x2e04cd,function(_0x491184){if(_0x491184[_0x7995('0x41')]!==_0x7995('0x4f')){var _0x511567={};_0x511567[_0x491184[_0x7995('0x38')]]={'$like':'%'+_0x1f5bee[_0x7995('0x44')]['filter']+'%'};return _0x511567;}})});}_0x5688a1=_[_0x7995('0x4e')]({},_0x5688a1,_0x1f5bee[_0x7995('0x50')]);var _0x5921b9={'where':_0x5688a1[_0x7995('0x4b')]};return db['SmsAccount'][_0x7995('0x30')](_0x5921b9)[_0x7995('0x23')](function(_0x1afab4){_0x3be298[_0x7995('0x30')]=_0x1afab4;if(_0x1f5bee[_0x7995('0x44')][_0x7995('0x51')]){_0x5688a1[_0x7995('0x52')]=[{'all':!![]}];}return db['SmsAccount'][_0x7995('0x53')](_0x5688a1);})[_0x7995('0x23')](function(_0x418eb9){_0x3be298['rows']=_0x418eb9;return _0x3be298;})[_0x7995('0x23')](respondWithFilteredResult(_0x1035dc,_0x5688a1))[_0x7995('0x2b')](handleError(_0x1035dc,null));};exports[_0x7995('0x54')]=function(_0x47d1d8,_0x4ec548){var _0x5a592e={'raw':![],'where':{'id':_0x47d1d8[_0x7995('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x7995('0x3c')}]},_0xb70620={};_0xb70620[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0x3e')][_0x7995('0x3f')]);_0xb70620['query']=_[_0x7995('0x45')](_0x47d1d8['query']);_0xb70620[_0x7995('0x4c')]=_[_0x7995('0x46')](_0xb70620[_0x7995('0x43')],_0xb70620['query']);_0x5a592e['attributes']=_['intersection'](_0xb70620['model'],qs[_0x7995('0x56')](_0x47d1d8[_0x7995('0x44')][_0x7995('0x56')]));_0x5a592e[_0x7995('0x47')]=_0x5a592e[_0x7995('0x47')][_0x7995('0x57')]?_0x5a592e[_0x7995('0x47')]:_0xb70620[_0x7995('0x43')];if(_0x47d1d8[_0x7995('0x44')][_0x7995('0x51')]){_0x5a592e[_0x7995('0x52')]=[{'all':!![]}];}_0x5a592e=_[_0x7995('0x4e')]({},_0x5a592e,_0x47d1d8[_0x7995('0x50')]);return db[_0x7995('0x3e')][_0x7995('0x58')](_0x5a592e)[_0x7995('0x23')](handleEntityNotFound(_0x4ec548,null))[_0x7995('0x23')](respondWithResult(_0x4ec548,null))[_0x7995('0x2b')](handleError(_0x4ec548,null));};exports[_0x7995('0x59')]=function(_0x50b7c2,_0x56a374){return db[_0x7995('0x3e')][_0x7995('0x59')](_0x50b7c2[_0x7995('0x5a')],{})['then'](function(_0x53125a){var _0x402fa0=_0x50b7c2[_0x7995('0x5b')][_0x7995('0x5c')]({'plain':!![]});if(!_0x402fa0)throw new Error(_0x7995('0x5d'));if(_0x402fa0['role']===_0x7995('0x5b')){var _0x74ff38=_0x53125a[_0x7995('0x5c')]({'plain':!![]});var _0x33c49c='SmsAccounts';return db['UserProfileSection'][_0x7995('0x58')]({'where':{'name':_0x33c49c,'userProfileId':_0x402fa0[_0x7995('0x5e')]},'raw':!![]})[_0x7995('0x23')](function(_0x1d69ce){if(_0x1d69ce&&_0x1d69ce[_0x7995('0x5f')]===0x0){return db[_0x7995('0x60')][_0x7995('0x59')]({'name':_0x74ff38[_0x7995('0x38')],'resourceId':_0x74ff38['id'],'type':_0x1d69ce[_0x7995('0x38')],'sectionId':_0x1d69ce['id']},{})['then'](function(){return _0x53125a;});}else{return _0x53125a;}})[_0x7995('0x2b')](function(_0x3ec5a8){logger[_0x7995('0x27')](_0x7995('0x61'),_0x3ec5a8);throw _0x3ec5a8;});}return _0x53125a;})['then'](respondWithResult(_0x56a374,0xc9))['catch'](handleError(_0x56a374,null));};exports[_0x7995('0x62')]=function(_0xebb5c8,_0x47d5d7){if(_0xebb5c8[_0x7995('0x5a')]['id']){delete _0xebb5c8[_0x7995('0x5a')]['id'];}return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0xebb5c8[_0x7995('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x7995('0x3c')}]})['then'](handleEntityNotFound(_0x47d5d7,null))[_0x7995('0x23')](saveUpdates(_0xebb5c8[_0x7995('0x5a')],null))[_0x7995('0x23')](respondWithResult(_0x47d5d7,null))[_0x7995('0x2b')](handleError(_0x47d5d7,null));};exports[_0x7995('0x35')]=function(_0xeb8920,_0x2b3c1d){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0xeb8920[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x2b3c1d,null))[_0x7995('0x23')](removeEntity(_0x2b3c1d,null))['catch'](handleError(_0x2b3c1d,null));};exports[_0x7995('0x63')]=function(_0x23bbc1,_0x293480){return db[_0x7995('0x3e')][_0x7995('0x63')]()['then'](respondWithResult(_0x293480,null))['catch'](handleError(_0x293480,null));};exports[_0x7995('0x64')]=function(_0x87e38d,_0x221542,_0xae6166){if(_0x87e38d['body']['id']){delete _0x87e38d[_0x7995('0x5a')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x87e38d[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x221542,null))[_0x7995('0x23')](function(_0x44bf2b){if(_0x44bf2b){_0x87e38d[_0x7995('0x5a')][_0x7995('0x65')]=_0x44bf2b['id'];return db[_0x7995('0x66')][_0x7995('0x59')](_0x87e38d[_0x7995('0x5a')]);}})[_0x7995('0x23')](respondWithResult(_0x221542,null))['catch'](handleError(_0x221542,null));};exports[_0x7995('0x67')]=function(_0x8908cd,_0x3c5802,_0x4cc247){var _0x1fe1cb={'raw':![],'where':{}};var _0x1d2f9d={};var _0x705f0={'count':0x0,'rows':[]};return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x8908cd[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x3c5802,null))[_0x7995('0x23')](function(_0x2f94c4){if(_0x2f94c4){_0x1d2f9d[_0x7995('0x43')]=_[_0x7995('0x45')](db['Disposition']['rawAttributes']);_0x1d2f9d[_0x7995('0x44')]=_[_0x7995('0x45')](_0x8908cd[_0x7995('0x44')]);_0x1d2f9d[_0x7995('0x4c')]=_['intersection'](_0x1d2f9d[_0x7995('0x43')],_0x1d2f9d[_0x7995('0x44')]);_0x1fe1cb['attributes']=_['intersection'](_0x1d2f9d[_0x7995('0x43')],qs[_0x7995('0x56')](_0x8908cd['query'][_0x7995('0x56')]));_0x1fe1cb['attributes']=_0x1fe1cb[_0x7995('0x47')][_0x7995('0x57')]?_0x1fe1cb['attributes']:_0x1d2f9d['model'];if(!_0x8908cd[_0x7995('0x44')]['hasOwnProperty'](_0x7995('0x69'))){_0x1fe1cb[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x8908cd[_0x7995('0x44')][_0x7995('0x49')]);_0x1fe1cb[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x8908cd[_0x7995('0x44')][_0x7995('0x31')]);}_0x1fe1cb[_0x7995('0x4a')]=qs[_0x7995('0x6a')](_0x8908cd[_0x7995('0x44')][_0x7995('0x6a')]);_0x1fe1cb[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x8908cd[_0x7995('0x44')],_0x1d2f9d[_0x7995('0x4c')]));_0x1fe1cb[_0x7995('0x4b')][_0x7995('0x65')]=_0x2f94c4['id'];if(_0x8908cd[_0x7995('0x44')][_0x7995('0x4d')]){_0x1fe1cb[_0x7995('0x4b')]=_[_0x7995('0x4e')](_0x1fe1cb[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x1fe1cb[_0x7995('0x47')],function(_0x34724d){var _0x59efff={};_0x59efff[_0x34724d]={'$like':'%'+_0x8908cd[_0x7995('0x44')][_0x7995('0x4d')]+'%'};return _0x59efff;})});}_0x1fe1cb=_['merge']({},_0x1fe1cb,_0x8908cd['options']);return db[_0x7995('0x66')][_0x7995('0x30')]({'where':_0x1fe1cb[_0x7995('0x4b')]})[_0x7995('0x23')](function(_0xe1ce4){_0x705f0[_0x7995('0x30')]=_0xe1ce4;if(_0x8908cd['query'][_0x7995('0x51')]){_0x1fe1cb[_0x7995('0x52')]=[{'all':!![]}];}return db[_0x7995('0x66')][_0x7995('0x53')](_0x1fe1cb);})[_0x7995('0x23')](function(_0x3f0bff){_0x705f0[_0x7995('0x6c')]=_0x3f0bff;return _0x705f0;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x3c5802,_0x1fe1cb))['catch'](handleError(_0x3c5802,null));};exports[_0x7995('0x6d')]=function(_0x2b8217,_0x5c04c9,_0x479271){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x2b8217[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x5c04c9,null))[_0x7995('0x23')](function(_0x4a02ea){if(_0x4a02ea){return _0x4a02ea[_0x7995('0x6d')](_0x2b8217[_0x7995('0x44')]['ids']);}})[_0x7995('0x23')](respondWithStatusCode(_0x5c04c9,null))[_0x7995('0x2b')](handleError(_0x5c04c9,null));};exports['addAnswer']=function(_0x1535a3,_0x4a5bc5,_0x135191){if(_0x1535a3[_0x7995('0x5a')]['id']){delete _0x1535a3[_0x7995('0x5a')]['id'];}return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x1535a3['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x4a5bc5,null))[_0x7995('0x23')](function(_0x38b37f){if(_0x38b37f){_0x1535a3['body'][_0x7995('0x65')]=_0x38b37f['id'];return db[_0x7995('0x6e')][_0x7995('0x59')](_0x1535a3[_0x7995('0x5a')]);}})['then'](respondWithResult(_0x4a5bc5,null))[_0x7995('0x2b')](handleError(_0x4a5bc5,null));};exports[_0x7995('0x6f')]=function(_0x3a5f5e,_0x4aafa3,_0x5358d4){var _0x3fc10={'raw':![],'where':{}};var _0x333379={};var _0x4800a8={'count':0x0,'rows':[]};return db['SmsAccount'][_0x7995('0x68')]({'where':{'id':_0x3a5f5e[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x4aafa3,null))[_0x7995('0x23')](function(_0x2ba606){if(_0x2ba606){_0x333379['model']=_['keys'](db[_0x7995('0x6e')]['rawAttributes']);_0x333379['query']=_[_0x7995('0x45')](_0x3a5f5e[_0x7995('0x44')]);_0x333379[_0x7995('0x4c')]=_['intersection'](_0x333379[_0x7995('0x43')],_0x333379[_0x7995('0x44')]);_0x3fc10[_0x7995('0x47')]=_[_0x7995('0x46')](_0x333379[_0x7995('0x43')],qs['fields'](_0x3a5f5e[_0x7995('0x44')][_0x7995('0x56')]));_0x3fc10[_0x7995('0x47')]=_0x3fc10[_0x7995('0x47')]['length']?_0x3fc10[_0x7995('0x47')]:_0x333379[_0x7995('0x43')];if(!_0x3a5f5e['query'][_0x7995('0x48')](_0x7995('0x69'))){_0x3fc10['limit']=qs[_0x7995('0x49')](_0x3a5f5e['query'][_0x7995('0x49')]);_0x3fc10['offset']=qs[_0x7995('0x31')](_0x3a5f5e['query'][_0x7995('0x31')]);}_0x3fc10[_0x7995('0x4a')]=qs['sort'](_0x3a5f5e[_0x7995('0x44')]['sort']);_0x3fc10['where']=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x3a5f5e[_0x7995('0x44')],_0x333379[_0x7995('0x4c')]));_0x3fc10['where'][_0x7995('0x65')]=_0x2ba606['id'];if(_0x3a5f5e[_0x7995('0x44')]['filter']){_0x3fc10['where']=_[_0x7995('0x4e')](_0x3fc10['where'],{'$or':_[_0x7995('0x3d')](_0x3fc10[_0x7995('0x47')],function(_0xfb4479){var _0x5b42be={};_0x5b42be[_0xfb4479]={'$like':'%'+_0x3a5f5e['query'][_0x7995('0x4d')]+'%'};return _0x5b42be;})});}_0x3fc10=_['merge']({},_0x3fc10,_0x3a5f5e[_0x7995('0x50')]);return db[_0x7995('0x6e')][_0x7995('0x30')]({'where':_0x3fc10[_0x7995('0x4b')]})['then'](function(_0x52d102){_0x4800a8['count']=_0x52d102;if(_0x3a5f5e[_0x7995('0x44')][_0x7995('0x51')]){_0x3fc10[_0x7995('0x52')]=[{'all':!![]}];}return db[_0x7995('0x6e')][_0x7995('0x53')](_0x3fc10);})[_0x7995('0x23')](function(_0x59a793){_0x4800a8['rows']=_0x59a793;return _0x4800a8;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x4aafa3,_0x3fc10))['catch'](handleError(_0x4aafa3,null));};exports['removeAnswers']=function(_0x17d00f,_0x5e95c0,_0x57a164){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x17d00f[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x5e95c0,null))[_0x7995('0x23')](function(_0xf604d9){if(_0xf604d9){return _0xf604d9[_0x7995('0x70')](_0x17d00f[_0x7995('0x44')][_0x7995('0x71')]);}})[_0x7995('0x23')](respondWithStatusCode(_0x5e95c0,null))[_0x7995('0x2b')](handleError(_0x5e95c0,null));};exports[_0x7995('0x72')]=function(_0x19d746,_0x570b71,_0x3eb3fa){var _0x87a539={'channel':_0x7995('0x73')};var _0x2056da=[];var _0x2a01d4=[];var _0x5a4695={};return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x19d746[_0x7995('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x17f7d6){_0x87a539[_0x7995('0x74')]=_0x17f7d6;_0x87a539[_0x7995('0x75')]=_[_0x7995('0x76')](_0x17f7d6[_0x7995('0x77')],['priority'],[_0x7995('0x78')]);if(_0x87a539['account'][_0x7995('0x77')]){delete _0x87a539[_0x7995('0x74')][_0x7995('0x77')];}return db[_0x7995('0x79')][_0x7995('0x63')]();})[_0x7995('0x23')](function(_0x4f929b){if(!_0x4f929b){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x7b'));}_0x2056da=_[_0x7995('0x7c')](_['keys'](_0x4f929b),[_0x7995('0x7d'),'updatedAt']);_0x2a01d4=_[_0x7995('0x7c')](_[_0x7995('0x45')](_0x4f929b),['createdAt','updatedAt',_0x7995('0x7e'),_0x7995('0x7f')]);_0x87a539[_0x7995('0x5a')]={'mapKey':_0x7995('0x80')};if(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]){switch(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]){case _0x7995('0x81'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['From'];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x83')];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746['body'][_0x7995('0x85')];break;case _0x7995('0x86'):_0x87a539['body'][_0x7995('0x82')]='+'+_0x19d746['body'][_0x7995('0x87')];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746['body'][_0x7995('0x88')];break;case _0x7995('0x89'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')]['body']=_0x19d746['body']['message'];break;case _0x7995('0x8a'):_0x87a539[_0x7995('0x5a')]['from']=_0x19d746['body'][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')]['body']=_0x19d746['body']['body'];_0x87a539['body'][_0x7995('0x84')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x8b')];break;case _0x7995('0x8c'):_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['From'];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')]['Text'];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746['body'][_0x7995('0x8d')];break;case _0x7995('0x8e'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]='+'+_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x88')];_0x87a539[_0x7995('0x5a')]['messageId']=_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x84')];break;case _0x7995('0x90'):_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x91')];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x92')][_0x7995('0x29')];break;case _0x7995('0x93'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746['body'][_0x7995('0x94')];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x88')];_0x87a539['body'][_0x7995('0x84')]=_0x19d746['body']['replyMessageId'];break;case'intelepeer':_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['from'];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746['body'][_0x7995('0x29')];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x95')];break;}}if(_0x87a539['body']['id']){delete _0x87a539[_0x7995('0x5a')]['id'];}if(_[_0x7995('0x96')](_0x87a539[_0x7995('0x5a')][_0x7995('0x82')])){throw new db['Sequelize'][(_0x7995('0x22'))](_0x7995('0x97'));}if(_[_0x7995('0x96')](_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')])||_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]===''){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x98'));}if(_['isNil'](_0x87a539[_0x7995('0x5a')]['mapKey'])){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x99')+_0x2a01d4);}if(!_['includes'](_0x2a01d4,_0x87a539['body'][_0x7995('0x9a')])){throw new db[(_0x7995('0x7a'))]['ValidationError'](_0x7995('0x9b')+_0x2a01d4);}_0x5a4695[_0x87a539['body'][_0x7995('0x9a')]]=_0x87a539[_0x7995('0x5a')][_0x7995('0x82')];return db[_0x7995('0x9c')]['find']({'where':{'id':_0x87a539['account'][_0x7995('0x7f')]},'include':[{'model':db[_0x7995('0x79')],'as':_0x7995('0x9d'),'where':_0x5a4695,'limit':0x1,'order':[[_0x7995('0x9e'),'DESC']]}]});})[_0x7995('0x23')](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x8b820b){if(_0x8b820b){_0x87a539[_0x7995('0x9f')]=_[_0x7995('0xa0')](_0x8b820b,['Contacts']);if(_0x8b820b['Contacts']['length']){return _0x8b820b[_0x7995('0x9d')][0x0];}var _0x24a3cf=_['defaults'](_0x87a539[_0x7995('0x5a')],{'firstName':_0x87a539['body'][_0x7995('0x82')],'ListId':_0x8b820b['id']});_0x24a3cf[_0x87a539[_0x7995('0x5a')][_0x7995('0x9a')]]=_0x87a539[_0x7995('0x5a')]['from'];return db[_0x7995('0x79')][_0x7995('0x59')](_0x24a3cf,{'fields':_0x2056da,'raw':!![]});}})[_0x7995('0x23')](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x2023a7){if(_0x2023a7){_0x87a539[_0x7995('0xa1')]=_0x2023a7;var _0x1d200d={'ContactId':_0x2023a7['id'],'phone':_0x87a539[_0x7995('0x5a')][_0x7995('0x82')],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id']};var _0x30893a={'ContactId':_0x2023a7['id'],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id'],'closed':![]};return db[_0x7995('0xa2')][_0x7995('0x58')]({'where':_0x30893a})['then'](function(_0x764245){if(_0x764245){return[_0x764245,![]];}return db['SmsInteraction'][_0x7995('0x59')](_0x1d200d)[_0x7995('0x23')](function(_0x5cf7b2){return[_0x5cf7b2,!![]];});});}})[_0x7995('0xa3')](function(_0x55dc6c,_0x17c3f9){_0x87a539[_0x7995('0xa4')]=_0x55dc6c['get']({'plain':!![]});_0x87a539['interaction']['created']=![];if(_0x17c3f9){if(_0x87a539[_0x7995('0x74')][_0x7995('0xa5')]){_0x87a539[_0x7995('0x75')][_0x7995('0xa6')]({'id':0x0,'priority':_0x87a539['applications'][_0x7995('0x57')]+0x1,'app':_0x7995('0xa7'),'appdata':_0x7995('0xa8'),'interval':_0x7995('0xa9')});}_0x87a539[_0x7995('0xa4')][_0x7995('0xaa')]=!![];}return db[_0x7995('0xab')][_0x7995('0x59')]({'phone':_0x87a539['body'][_0x7995('0x82')],'messageId':_0x87a539[_0x7995('0x5a')][_0x7995('0x84')],'body':_0x87a539[_0x7995('0x5a')]['body'],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id'],'SmsInteractionId':_0x55dc6c['id'],'direction':'in','ContactId':_0x55dc6c[_0x7995('0xac')],'AttachmentId':_0x87a539[_0x7995('0x5a')][_0x7995('0xad')]});})[_0x7995('0x23')](function(_0x2e7416){_0x87a539['message']=_0x2e7416;if(_0x87a539[_0x7995('0xa4')][_0x7995('0xae')]){return db[_0x7995('0xaf')][_0x7995('0x58')]({'attributes':['id',_0x7995('0x38')],'where':{'id':_0x87a539[_0x7995('0xa4')][_0x7995('0xae')]}})[_0x7995('0x23')](function(_0xf76f46){if(_0xf76f46){_0x87a539[_0x7995('0x75')][_0x7995('0xb0')]({'id':0x0,'priority':0x0,'app':_0x7995('0xb1'),'appdata':_0xf76f46[_0x7995('0x38')]+','+(_0x87a539[_0x7995('0x74')][_0x7995('0xb2')]||0xa),'interval':_0x7995('0xa9')});}return respondWithRpcPromise(_0x7995('0xb3'),_0x7995('0xb4'),_0x87a539);});}return respondWithRpcPromise(_0x7995('0xb3'),_0x7995('0xb4'),_0x87a539);})[_0x7995('0x23')](function(_0x51f854){if(_0x51f854){var _0x4cf7f1=0xc8;var _0x1a980b=_0x7995('0xb5');logger['info'](_0x7995('0x26'),_0x1a980b,_0x4cf7f1,'entity\x20found');logger[_0x7995('0xb6')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1a980b,_0x4cf7f1,_0x7995('0xb7'),JSON[_0x7995('0xb8')](_0x51f854));if(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]===_0x7995('0x81')){return _0x570b71[_0x7995('0x2d')](_0x4cf7f1)[_0x7995('0x32')](_0x7995('0xb9'),_0x7995('0xba'))[_0x7995('0x39')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x570b71[_0x7995('0x2d')](_0x4cf7f1)[_0x7995('0x2f')](_0x51f854);}}})[_0x7995('0x2b')](handleError(_0x570b71,null));};exports[_0x7995('0xbb')]=function(_0x54b803,_0x408c22,_0x1d2afe){return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x54b803['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x408c22,null))[_0x7995('0x23')](function(_0x31d0e9){if(_0x31d0e9){return db[_0x7995('0xbc')][_0x7995('0xbd')](function(_0x13dda4){return db[_0x7995('0xbe')][_0x7995('0x35')]({'where':{'SmsAccountId':_0x54b803[_0x7995('0x55')]['id']},'transaction':_0x13dda4})['then'](function(_0x3c81cc){var _0x5f5496=_[_0x7995('0x3d')](_0x54b803[_0x7995('0x5a')],function(_0x35b217){_0x35b217[_0x7995('0x65')]=_0x54b803['params']['id'];return _0x35b217;});return db[_0x7995('0xbe')][_0x7995('0xbf')](_0x5f5496,{'transaction':_0x13dda4});});})[_0x7995('0x23')](function(){return db[_0x7995('0xbe')][_0x7995('0xc0')]({'where':{'SmsAccountId':_0x54b803[_0x7995('0x55')]['id']},'order':_0x7995('0xc1')});});}})[_0x7995('0x23')](respondWithResult(_0x408c22,null))[_0x7995('0x2b')](handleError(_0x408c22,null));};exports[_0x7995('0xc2')]=function(_0x45f389,_0x44d6a8,_0x7d14e2){var _0x405711={};var _0x54e341={};var _0x5cb30e;var _0xdfc11d;return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x45f389['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x44d6a8,null))[_0x7995('0x23')](function(_0x610b81){if(_0x610b81){_0x5cb30e=_0x610b81;_0x54e341['model']=_[_0x7995('0x45')](db[_0x7995('0xbe')][_0x7995('0x3f')]);_0x54e341[_0x7995('0x44')]=_[_0x7995('0x45')](_0x45f389[_0x7995('0x44')]);_0x54e341[_0x7995('0x4c')]=_[_0x7995('0x46')](_0x54e341[_0x7995('0x43')],_0x54e341[_0x7995('0x44')]);_0x405711[_0x7995('0x47')]=_['intersection'](_0x54e341['model'],qs[_0x7995('0x56')](_0x45f389['query'][_0x7995('0x56')]));_0x405711[_0x7995('0x47')]=_0x405711[_0x7995('0x47')][_0x7995('0x57')]?_0x405711[_0x7995('0x47')]:_0x54e341['model'];_0x405711['order']=qs[_0x7995('0x6a')](_0x45f389[_0x7995('0x44')][_0x7995('0x6a')]);_0x405711[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x45f389[_0x7995('0x44')],_0x54e341[_0x7995('0x4c')]));if(_0x45f389[_0x7995('0x44')][_0x7995('0x4d')]){_0x405711['where']=_[_0x7995('0x4e')](_0x405711[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x405711[_0x7995('0x47')],function(_0x511cf8){var _0x4d6da0={};_0x4d6da0[_0x511cf8]={'$like':'%'+_0x45f389['query']['filter']+'%'};return _0x4d6da0;})});}_0x405711=_['merge']({},_0x405711,_0x45f389[_0x7995('0x50')]);return _0x5cb30e['getApplications'](_0x405711);}})['then'](function(_0x32f19d){if(_0x32f19d){_0xdfc11d=_0x32f19d[_0x7995('0x57')];if(!_0x45f389[_0x7995('0x44')]['hasOwnProperty'](_0x7995('0x69'))){_0x405711['limit']=qs[_0x7995('0x49')](_0x45f389[_0x7995('0x44')][_0x7995('0x49')]);_0x405711['offset']=qs[_0x7995('0x31')](_0x45f389[_0x7995('0x44')][_0x7995('0x31')]);}return _0x5cb30e['getApplications'](_0x405711);}})[_0x7995('0x23')](function(_0x15cfd3){if(_0x15cfd3){return _0x15cfd3?{'count':_0xdfc11d,'rows':_0x15cfd3}:null;}})[_0x7995('0x23')](respondWithResult(_0x44d6a8,null))[_0x7995('0x2b')](handleError(_0x44d6a8,null));};exports[_0x7995('0xc3')]=function(_0x574e2a,_0x1761e1,_0x2a4991){var _0xc8bbb4={'raw':![],'where':{}};var _0x484b6c={};var _0x20852c={'count':0x0,'rows':[]};return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x574e2a[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1761e1,null))['then'](function(_0x2995a3){if(_0x2995a3){_0x484b6c[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0xa2')][_0x7995('0x3f')]);_0x484b6c[_0x7995('0x44')]=_[_0x7995('0x45')](_0x574e2a['query']);_0x484b6c['filters']=_[_0x7995('0x46')](_0x484b6c[_0x7995('0x43')],_0x484b6c['query']);_0xc8bbb4['attributes']=_[_0x7995('0x46')](_0x484b6c[_0x7995('0x43')],qs[_0x7995('0x56')](_0x574e2a[_0x7995('0x44')][_0x7995('0x56')]));_0xc8bbb4[_0x7995('0x47')]=_0xc8bbb4[_0x7995('0x47')]['length']?_0xc8bbb4[_0x7995('0x47')]:_0x484b6c[_0x7995('0x43')];if(!_0x574e2a[_0x7995('0x44')][_0x7995('0x48')](_0x7995('0x69'))){_0xc8bbb4[_0x7995('0x49')]=qs['limit'](_0x574e2a[_0x7995('0x44')][_0x7995('0x49')]);_0xc8bbb4[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x574e2a[_0x7995('0x44')][_0x7995('0x31')]);}_0xc8bbb4[_0x7995('0x4a')]=qs['sort'](_0x574e2a[_0x7995('0x44')][_0x7995('0x6a')]);_0xc8bbb4[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_['pick'](_0x574e2a[_0x7995('0x44')],_0x484b6c['filters']));_0xc8bbb4[_0x7995('0x4b')][_0x7995('0x65')]=_0x2995a3['id'];if(_0x574e2a['query']['filter']){_0xc8bbb4['where']=_[_0x7995('0x4e')](_0xc8bbb4[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0xc8bbb4[_0x7995('0x47')],function(_0x503b32){var _0x2da21e={};_0x2da21e[_0x503b32]={'$like':'%'+_0x574e2a[_0x7995('0x44')][_0x7995('0x4d')]+'%'};return _0x2da21e;})});}_0xc8bbb4=_[_0x7995('0x4e')]({},_0xc8bbb4,_0x574e2a[_0x7995('0x50')]);return db[_0x7995('0xa2')][_0x7995('0x30')]({'where':_0xc8bbb4['where']})['then'](function(_0x2695eb){_0x20852c['count']=_0x2695eb;if(_0x574e2a['query'][_0x7995('0x51')]){_0xc8bbb4[_0x7995('0x52')]=[{'model':db[_0x7995('0x79')],'as':_0x7995('0xc4'),'required':![]},{'model':db[_0x7995('0xaf')],'as':_0x7995('0xc5'),'attributes':[_0x7995('0x38'),_0x7995('0xc6'),_0x7995('0xc7')],'required':![]},{'model':db[_0x7995('0xc8')],'as':_0x7995('0xc9'),'attributes':['id',_0x7995('0x38'),'color'],'where':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]?{'id':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]}:undefined,'required':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]?!![]:![]}];}return db[_0x7995('0xa2')]['findAll'](_0xc8bbb4);})[_0x7995('0x23')](function(_0x234832){_0x20852c[_0x7995('0x6c')]=_0x234832;return _0x20852c;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x1761e1,_0xc8bbb4))[_0x7995('0x2b')](handleError(_0x1761e1,null));};exports['send']=function(_0x2d1c14,_0x5e7fde,_0x156b65){var _0x12f4c5,_0x221be8,_0x5150aa;if(_[_0x7995('0x96')](_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')])||_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')]===''){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2d1c14[_0x7995('0x5a')]['to'])){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0xcb'));}_0x12f4c5=_0x2d1c14[_0x7995('0x5a')]['to'];return db[_0x7995('0x3e')]['find']({'where':{'id':_0x2d1c14[_0x7995('0x55')]['id']},'include':[{'model':db[_0x7995('0x9c')],'as':_0x7995('0xcc'),'include':[{'model':db[_0x7995('0x79')],'as':'Contacts','where':{'mobile':_0x12f4c5},'limit':0x1,'order':[['updatedAt',_0x7995('0xcd')]]}]}]})[_0x7995('0x23')](handleEntityNotFound(_0x5e7fde,null))['then'](function(_0x3130f2){if(_0x3130f2&&_0x3130f2[_0x7995('0xcc')]){_0x221be8=_0x3130f2['get']({'plain':!![]});if(_0x221be8[_0x7995('0xcc')]&&_0x221be8[_0x7995('0xcc')][_0x7995('0x9d')][_0x7995('0x57')]){return _0x221be8[_0x7995('0xcc')]['Contacts'][0x0];}return db['CmContact'][_0x7995('0x59')](_[_0x7995('0x1b')](_0x2d1c14[_0x7995('0x5a')],{'firstName':_0x12f4c5,'mobile':_0x12f4c5,'phone':_0x12f4c5,'ListId':_0x221be8[_0x7995('0x7f')]}));}})[_0x7995('0x23')](handleEntityNotFound(_0x5e7fde,null))['then'](function(_0xd0da6e){if(_0xd0da6e){_0x5150aa=_0xd0da6e;return db[_0x7995('0xa2')][_0x7995('0x58')]({'where':{'ContactId':_0x5150aa['id'],'closed':![],'SmsAccountId':_0x221be8['id']}})[_0x7995('0x23')](function(_0x1949f5){if(_0x1949f5){return[_0x1949f5,![]];}return db['SmsInteraction']['create']({'UserId':_0x2d1c14['user']['id'],'ContactId':_0x5150aa['id'],'SmsAccountId':_0x221be8['id'],'phone':_0x12f4c5,'firstMsgDirection':'out','Messages':[_[_0x7995('0x4e')](_0x2d1c14[_0x7995('0x5a')],{'read':![],'body':_0x2d1c14['body'][_0x7995('0x5a')],'phone':_0x12f4c5,'SmsAccountId':_0x221be8['id'],'UserId':_0x2d1c14[_0x7995('0x5b')]['id'],'ContactId':_0x5150aa['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x7995('0x23')](function(_0x3ee80c){return[_0x3ee80c,!![]];});});}})[_0x7995('0xa3')](function(_0x8bd55,_0x20a056){if(_0x20a056){return _0x8bd55;}return db[_0x7995('0xab')][_0x7995('0x59')](_['merge'](_0x2d1c14['body'],{'read':![],'body':_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')],'phone':_0x12f4c5,'SmsAccountId':_0x221be8['id'],'SmsInteractionId':_0x8bd55['id'],'UserId':_0x2d1c14[_0x7995('0x5b')]['id'],'ContactId':_0x5150aa['id']}))['then'](function(_0x2f96fd){_0x8bd55[_0x7995('0xce')][_0x7995('0xcf')]=[];_0x8bd55[_0x7995('0xce')][_0x7995('0xcf')][_0x7995('0xa6')](_0x2f96fd[_0x7995('0xce')]);return _0x8bd55;});})[_0x7995('0x23')](respondWithResult(_0x5e7fde,null))[_0x7995('0x2b')](handleError(_0x5e7fde,null));};exports['status']=function(_0x5136f5,_0x1161f2,_0x4bd222){if(_0x5136f5[_0x7995('0x5a')]['id']){delete _0x5136f5['body']['id'];}console[_0x7995('0xd0')](_0x7995('0xd1'),_0x5136f5[_0x7995('0x5a')]);var _0x4a75d2,_0x4c810d,_0x1401b4;return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x5136f5[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1161f2,null))[_0x7995('0x23')](function(_0xb0164a){if(_0xb0164a){_0x1401b4=_0xb0164a;logger[_0x7995('0xb6')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0xd2'),_0xb0164a['type'],util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));switch(_0xb0164a[_0x7995('0x41')]){case _0x7995('0x86'):if(_0x5136f5[_0x7995('0x5a')]['skebby_dispatch_id']&&_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0xd4')]}});}break;case _0x7995('0x89'):if(_0x5136f5['body']['requestid']&&_0x5136f5[_0x7995('0x5a')][_0x7995('0xd5')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0xd5')];return db[_0x7995('0xab')]['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0xd6')]}});}break;case _0x7995('0x8a'):if(_0x5136f5[_0x7995('0x5a')][_0x7995('0x8b')]&&_0x5136f5[_0x7995('0x5a')][_0x7995('0xd7')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0xd7')];return db['SmsMessage']['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0x8b')]}});}break;case _0x7995('0x8e'):var _0x296643=_0x5136f5[_0x7995('0x5a')][_0x7995('0x8f')][0x0];if(_0x296643[_0x7995('0x84')]&&_0x296643[_0x7995('0x2d')]['groupName']==='DELIVERED'){_0x4c810d=_0x296643[_0x7995('0x2d')][_0x7995('0xd8')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x296643['messageId']}});}break;case'clickatell':if(_0x5136f5[_0x7995('0x5a')][_0x7995('0x84')]&&_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0x84')]}});}break;case _0x7995('0xd9'):if(_0x5136f5[_0x7995('0x5a')]['redif']&&_0x5136f5['body'][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')]['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')]['redif']}});}break;}}})[_0x7995('0x23')](handleEntityNotFound(_0x1161f2,null))[_0x7995('0x23')](function(_0x308d0e){if(_0x308d0e){_0x4a75d2=_0x308d0e;switch(_0x1401b4[_0x7995('0x41')]){case _0x7995('0x86'):if(_0x4c810d===_0x7995('0xda')){return _0x4a75d2['update']({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x86'),util['inspect'](_0x5136f5['body'],{'showHidden':![],'depth':null}));}break;case _0x7995('0x89'):if(_0x4c810d==='1'){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),'status',_0x7995('0x86'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x5136f5[_0x7995('0x5a')][_0x7995('0xdb')]&&_0x4c810d>=0xc8&&_0x4c810d<=0xce){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger['error'](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x8a'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x7995('0x8e'):var _0x1f6c3e=_0x5136f5[_0x7995('0x5a')][_0x7995('0x8f')][0x0];if(_0x1f6c3e['status'][_0x7995('0xd8')]===_0x7995('0xda')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7995('0x2d'),_0x7995('0x8e'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4c810d==_0x7995('0xdc')||_0x4c810d==_0x7995('0xdd')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x93'),util['inspect'](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x7995('0xd9'):if(_0x4c810d===_0x7995('0xde')||_0x4c810d===_0x7995('0xdf')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger['error'](_0x7995('0x26'),'status',_0x7995('0xd9'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x4a75d2;}})['then'](respondWithResult(_0x1161f2,null))['catch'](handleError(_0x1161f2,null));};exports['statusGet']=function(_0x21ff84,_0x1763aa,_0x32e443){var _0x35b6f9,_0x17fab0,_0x4da0e8;return db['SmsAccount'][_0x7995('0x58')]({'where':{'id':_0x21ff84[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1763aa,null))[_0x7995('0x23')](function(_0x5bc1b4){if(_0x5bc1b4){_0x4da0e8=_0x5bc1b4;logger[_0x7995('0xb6')](_0x7995('0x26'),'status',_0x7995('0xd2'),_0x5bc1b4['type'],util[_0x7995('0xd3')](_0x21ff84[_0x7995('0x44')],{'showHidden':![],'depth':null}));switch(_0x5bc1b4[_0x7995('0x41')]){case'csc':if(_0x21ff84['query'][_0x7995('0xe0')]&&_0x21ff84[_0x7995('0x44')][_0x7995('0xe1')]){_0x17fab0=_0x21ff84[_0x7995('0x44')][_0x7995('0xe1')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x21ff84[_0x7995('0x44')][_0x7995('0xe0')]}});}break;}}})[_0x7995('0x23')](handleEntityNotFound(_0x1763aa,null))[_0x7995('0x23')](function(_0x48c9fc){if(_0x48c9fc){_0x35b6f9=_0x48c9fc;switch(_0x4da0e8['type']){case _0x7995('0x90'):if(_0x17fab0==='2'||_0x17fab0==='6'){return _0x35b6f9[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),'status','csc',util[_0x7995('0xd3')](_0x21ff84[_0x7995('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x35b6f9;}})['then'](respondWithResult(_0x1763aa,null))['catch'](handleError(_0x1763aa,null));};exports[_0x7995('0xe2')]=function(_0x469cd6,_0x3ad24,_0x17c27b){return db[_0x7995('0x3e')]['find']({'where':{'id':_0x469cd6[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x3ad24,null))['then'](function(_0xf9859c){if(_0xf9859c){return _0xf9859c[_0x7995('0xe2')](_0x469cd6[_0x7995('0x5a')]['ids'],_[_0x7995('0xa0')](_0x469cd6[_0x7995('0x5a')],[_0x7995('0x71'),'id'])||{})[_0x7995('0xa3')](function(_0x113e03){for(var _0x5348b1=0x0;_0x5348b1<_0x469cd6['body'][_0x7995('0x71')]['length'];_0x5348b1+=0x1){socket[_0x7995('0xe3')]('userSmsAccount:save',{'UserId':_0x469cd6[_0x7995('0x5a')][_0x7995('0x71')][_0x5348b1],'SmsAccountId':_0x469cd6[_0x7995('0x55')]['id']});}return _0x113e03;});}})['then'](respondWithResult(_0x3ad24,null))['catch'](handleError(_0x3ad24,null));};exports['removeAgents']=function(_0x362580,_0x1da57f,_0x270ef3){return db['SmsAccount'][_0x7995('0x58')]({'where':{'id':_0x362580[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x1da57f,null))[_0x7995('0x23')](function(_0x39449e){if(_0x39449e){return _0x39449e[_0x7995('0xe4')](_0x362580[_0x7995('0x44')][_0x7995('0x71')])['then'](function(){if(_['isArray'](_0x362580[_0x7995('0x44')][_0x7995('0x71')])){for(var _0x134da2=0x0;_0x134da2<_0x362580[_0x7995('0x44')][_0x7995('0x71')][_0x7995('0x57')];_0x134da2+=0x1){socket[_0x7995('0xe3')](_0x7995('0xe5'),{'UserId':Number(_0x362580[_0x7995('0x44')][_0x7995('0x71')][_0x134da2]),'SmsAccountId':Number(_0x362580['params']['id'])});}}else{socket[_0x7995('0xe3')](_0x7995('0xe5'),{'UserId':Number(_0x362580[_0x7995('0x44')][_0x7995('0x71')]),'SmsAccountId':Number(_0x362580[_0x7995('0x55')]['id'])});}});}})[_0x7995('0x23')](respondWithStatusCode(_0x1da57f,null))[_0x7995('0x2b')](handleError(_0x1da57f,null));};exports['getAgents']=function(_0x5d0fe6,_0x43a8a4,_0x2aec8d){var _0x12df49={};var _0x1f4efc={};var _0x55ce63;var _0x572c53;return db['SmsAccount'][_0x7995('0x68')]({'where':{'id':_0x5d0fe6[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x43a8a4,null))[_0x7995('0x23')](function(_0x2265cf){if(_0x2265cf){_0x55ce63=_0x2265cf;_0x1f4efc[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0xaf')][_0x7995('0x3f')]);_0x1f4efc[_0x7995('0x44')]=_[_0x7995('0x45')](_0x5d0fe6['query']);_0x1f4efc[_0x7995('0x4c')]=_[_0x7995('0x46')](_0x1f4efc[_0x7995('0x43')],_0x1f4efc['query']);_0x12df49[_0x7995('0x47')]=_['intersection'](_0x1f4efc['model'],qs['fields'](_0x5d0fe6['query'][_0x7995('0x56')]));_0x12df49['attributes']=_0x12df49[_0x7995('0x47')][_0x7995('0x57')]?_0x12df49['attributes']:_0x1f4efc[_0x7995('0x43')];_0x12df49[_0x7995('0x4a')]=qs[_0x7995('0x6a')](_0x5d0fe6[_0x7995('0x44')]['sort']);_0x12df49[_0x7995('0x4b')]=qs['filters'](_[_0x7995('0x6b')](_0x5d0fe6[_0x7995('0x44')],_0x1f4efc[_0x7995('0x4c')]));if(_0x5d0fe6[_0x7995('0x44')][_0x7995('0x4d')]){_0x12df49[_0x7995('0x4b')]=_[_0x7995('0x4e')](_0x12df49[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x12df49[_0x7995('0x47')],function(_0x4aa202){var _0x8c9b6f={};_0x8c9b6f[_0x4aa202]={'$like':'%'+_0x5d0fe6[_0x7995('0x44')]['filter']+'%'};return _0x8c9b6f;})});}_0x12df49=_[_0x7995('0x4e')]({},_0x12df49,_0x5d0fe6[_0x7995('0x50')]);return _0x55ce63[_0x7995('0xe6')](_0x12df49);}})[_0x7995('0x23')](function(_0x1a6f42){if(_0x1a6f42){_0x572c53=_0x1a6f42[_0x7995('0x57')];if(!_0x5d0fe6['query'][_0x7995('0x48')]('nolimit')){_0x12df49[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x5d0fe6[_0x7995('0x44')][_0x7995('0x49')]);_0x12df49[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x5d0fe6['query'][_0x7995('0x31')]);}return _0x55ce63[_0x7995('0xe6')](_0x12df49);}})[_0x7995('0x23')](function(_0x4c2faf){if(_0x4c2faf){return _0x4c2faf?{'count':_0x572c53,'rows':_0x4c2faf}:null;}})[_0x7995('0x23')](respondWithResult(_0x43a8a4,null))[_0x7995('0x2b')](handleError(_0x43a8a4,null));};
\ No newline at end of file
index bb6972f..0f4b59c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95a4=['hook','exports','events','../../mysqldb','SmsAccount','save','update','remove','emit'];(function(_0x42c91d,_0x5dd75e){var _0x29d5fe=function(_0x26a509){while(--_0x26a509){_0x42c91d['push'](_0x42c91d['shift']());}};_0x29d5fe(++_0x5dd75e);}(_0x95a4,0x6e));var _0x495a=function(_0x4a452d,_0x3d27a6){_0x4a452d=_0x4a452d-0x0;var _0x45fb05=_0x95a4[_0x4a452d];return _0x45fb05;};'use strict';var EventEmitter=require(_0x495a('0x0'));var SmsAccount=require(_0x495a('0x1'))['db'][_0x495a('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x495a('0x3'),'afterUpdate':_0x495a('0x4'),'afterDestroy':_0x495a('0x5')};function emitEvent(_0x1eee3e){return function(_0x4b4a3d,_0x570013,_0x24039c){SmsAccountEvents[_0x495a('0x6')](_0x1eee3e+':'+_0x4b4a3d['id'],_0x4b4a3d);SmsAccountEvents[_0x495a('0x6')](_0x1eee3e,_0x4b4a3d);_0x24039c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x495a('0x7')](e,emitEvent(event));}}module[_0x495a('0x8')]=SmsAccountEvents;
\ No newline at end of file
+var _0xe49f=['emit','hasOwnProperty','hook','exports','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe49f,0x163));var _0xfe49=function(_0x2e4528,_0xa6c63d){_0x2e4528=_0x2e4528-0x0;var _0x1b8f2b=_0xe49f[_0x2e4528];return _0x1b8f2b;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0xfe49('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xfe49('0x1')](0x0);var events={'afterCreate':_0xfe49('0x2'),'afterUpdate':_0xfe49('0x3'),'afterDestroy':_0xfe49('0x4')};function emitEvent(_0x15efe6){return function(_0x314f5f,_0xcf7a69,_0x1f0cf2){SmsAccountEvents[_0xfe49('0x5')](_0x15efe6+':'+_0x314f5f['id'],_0x314f5f);SmsAccountEvents[_0xfe49('0x5')](_0x15efe6,_0x314f5f);_0x1f0cf2(null);};}for(var e in events){if(events[_0xfe49('0x6')](e)){var event=events[e];SmsAccount[_0xfe49('0x7')](e,emitEvent(event));}}module[_0xfe49('0x8')]=SmsAccountEvents;
\ No newline at end of file
index cd747c5..eebfeb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x24a378,_0x443d34){var _0x43c588=function(_0x2b951a){while(--_0x2b951a){_0x24a378['push'](_0x24a378['shift']());}};_0x43c588(++_0x443d34);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5b15d2,_0x37b7c6){var _0x4989f8=function(_0x33c341){while(--_0x33c341){_0x5b15d2['push'](_0x5b15d2['shift']());}};_0x4989f8(++_0x37b7c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0d79b60..4ef076b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54f5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','register','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','map','model','util','moment','bluebird','randomstring'];(function(_0xaf9c97,_0x3acbd4){var _0x42ad92=function(_0x5a3b62){while(--_0x5a3b62){_0xaf9c97['push'](_0xaf9c97['shift']());}};_0x42ad92(++_0x3acbd4);}(_0x54f5,0x7c));var _0x554f=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0x54f5[_0xfc406a];return _0x395473;};'use strict';var _=require('lodash');var util=require(_0x554f('0x0'));var moment=require(_0x554f('0x1'));var BPromise=require(_0x554f('0x2'));var rs=require(_0x554f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x554f('0x4'))['db'];var utils=require(_0x554f('0x5'));var logger=require(_0x554f('0x6'))(_0x554f('0x7'));var config=require(_0x554f('0x8'));var jayson=require(_0x554f('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x554f('0xa')]=_['defaults'](config[_0x554f('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x554f('0xa')]));require('./smsAccount.socket')[_0x554f('0xb')](socket);function respondWithRpcPromise(_0x4f61e7,_0x473281,_0x50cd66){return new BPromise(function(_0x1bac5c,_0x108dc8){return client['request'](_0x4f61e7,_0x50cd66)['then'](function(_0x5c3a60){logger[_0x554f('0xc')](_0x554f('0xd'),_0x473281,'request\x20sent');logger[_0x554f('0xe')](_0x554f('0xf'),_0x473281,_0x554f('0x10'),JSON[_0x554f('0x11')](_0x5c3a60));if(_0x5c3a60[_0x554f('0x12')]){if(_0x5c3a60['error'][_0x554f('0x13')]===0x1f4){logger[_0x554f('0x12')](_0x554f('0xd'),_0x473281,_0x5c3a60[_0x554f('0x12')]['message']);return _0x108dc8(_0x5c3a60[_0x554f('0x12')][_0x554f('0x14')]);}logger[_0x554f('0x12')]('SmsAccount,\x20%s,\x20%s',_0x473281,_0x5c3a60[_0x554f('0x12')][_0x554f('0x14')]);return _0x1bac5c(_0x5c3a60[_0x554f('0x12')][_0x554f('0x14')]);}else{logger[_0x554f('0xc')](_0x554f('0xd'),_0x473281,_0x554f('0x10'));_0x1bac5c(_0x5c3a60[_0x554f('0x15')][_0x554f('0x14')]);}})[_0x554f('0x16')](function(_0x57f8a5){logger[_0x554f('0x12')](_0x554f('0xd'),_0x473281,_0x57f8a5);_0x108dc8(_0x57f8a5);});});}exports[_0x554f('0x17')]=function(_0x5caec6){var _0x4a9a6c=this;return new Promise(function(_0x552744,_0xff6d07){return db[_0x554f('0x18')][_0x554f('0x19')]({'raw':_0x5caec6[_0x554f('0x1a')]?_0x5caec6['options'][_0x554f('0x1b')]===undefined?!![]:![]:!![],'where':_0x5caec6[_0x554f('0x1a')]?_0x5caec6[_0x554f('0x1a')]['where']||null:null,'attributes':_0x5caec6['options']?_0x5caec6[_0x554f('0x1a')][_0x554f('0x1c')]||null:null,'include':_0x5caec6['options']?_0x5caec6['options'][_0x554f('0x1d')]?_[_0x554f('0x1e')](_0x5caec6['options'][_0x554f('0x1d')],function(_0x5443d2){return{'model':db[_0x5443d2[_0x554f('0x1f')]],'as':_0x5443d2['as'],'attributes':_0x5443d2['attributes'],'include':_0x5443d2[_0x554f('0x1d')]?_['map'](_0x5443d2[_0x554f('0x1d')],function(_0x5b754a){return{'model':db[_0x5b754a[_0x554f('0x1f')]],'as':_0x5b754a['as'],'attributes':_0x5b754a['attributes'],'include':_0x5b754a['include']?_[_0x554f('0x1e')](_0x5b754a[_0x554f('0x1d')],function(_0x78216b){return{'model':db[_0x78216b[_0x554f('0x1f')]],'as':_0x78216b['as'],'attributes':_0x78216b[_0x554f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46e947){logger[_0x554f('0xc')](_0x554f('0x17'),_0x5caec6);logger['debug'](_0x554f('0x17'),_0x5caec6,JSON[_0x554f('0x11')](_0x46e947));_0x552744(_0x46e947);})[_0x554f('0x16')](function(_0x11f637){logger[_0x554f('0x12')](_0x554f('0x17'),_0x11f637[_0x554f('0x14')],_0x5caec6);_0xff6d07(_0x4a9a6c[_0x554f('0x12')](0x1f4,_0x11f637[_0x554f('0x14')]));});});};
\ No newline at end of file
+var _0x98b4=['attributes','include','map','model','then','ShowSmsAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','SmsAccount','options','raw'];(function(_0x32cf10,_0x21237a){var _0x225c84=function(_0x490c3b){while(--_0x490c3b){_0x32cf10['push'](_0x32cf10['shift']());}};_0x225c84(++_0x21237a);}(_0x98b4,0x1a8));var _0x498b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x98b4[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x498b('0x0'));var util=require(_0x498b('0x1'));var moment=require(_0x498b('0x2'));var BPromise=require(_0x498b('0x3'));var rs=require(_0x498b('0x4'));var fs=require('fs');var Redis=require(_0x498b('0x5'));var db=require(_0x498b('0x6'))['db'];var utils=require(_0x498b('0x7'));var logger=require('../../config/logger')(_0x498b('0x8'));var config=require(_0x498b('0x9'));var jayson=require(_0x498b('0xa'));var client=jayson[_0x498b('0xb')][_0x498b('0xc')]({'port':0x232a});config[_0x498b('0xd')]=_[_0x498b('0xe')](config['redis'],{'host':_0x498b('0xf'),'port':0x18eb});var socket=require(_0x498b('0x10'))(new Redis(config['redis']));require(_0x498b('0x11'))[_0x498b('0x12')](socket);function respondWithRpcPromise(_0x311872,_0x6bc9b9,_0x2ef867){return new BPromise(function(_0x42d5ce,_0xf8d62c){return client[_0x498b('0x13')](_0x311872,_0x2ef867)['then'](function(_0x520d07){logger[_0x498b('0x14')](_0x498b('0x15'),_0x6bc9b9,_0x498b('0x16'));logger[_0x498b('0x17')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6bc9b9,_0x498b('0x16'),JSON[_0x498b('0x18')](_0x520d07));if(_0x520d07[_0x498b('0x19')]){if(_0x520d07[_0x498b('0x19')]['code']===0x1f4){logger[_0x498b('0x19')](_0x498b('0x15'),_0x6bc9b9,_0x520d07[_0x498b('0x19')][_0x498b('0x1a')]);return _0xf8d62c(_0x520d07['error'][_0x498b('0x1a')]);}logger['error'](_0x498b('0x15'),_0x6bc9b9,_0x520d07[_0x498b('0x19')][_0x498b('0x1a')]);return _0x42d5ce(_0x520d07[_0x498b('0x19')][_0x498b('0x1a')]);}else{logger[_0x498b('0x14')](_0x498b('0x15'),_0x6bc9b9,_0x498b('0x16'));_0x42d5ce(_0x520d07[_0x498b('0x1b')][_0x498b('0x1a')]);}})[_0x498b('0x1c')](function(_0x2fefe4){logger[_0x498b('0x19')](_0x498b('0x15'),_0x6bc9b9,_0x2fefe4);_0xf8d62c(_0x2fefe4);});});}exports['ShowSmsAccount']=function(_0x48c994){var _0x12789d=this;return new Promise(function(_0xb89aba,_0x269767){return db[_0x498b('0x1d')]['find']({'raw':_0x48c994[_0x498b('0x1e')]?_0x48c994[_0x498b('0x1e')][_0x498b('0x1f')]===undefined?!![]:![]:!![],'where':_0x48c994[_0x498b('0x1e')]?_0x48c994[_0x498b('0x1e')]['where']||null:null,'attributes':_0x48c994[_0x498b('0x1e')]?_0x48c994[_0x498b('0x1e')][_0x498b('0x20')]||null:null,'include':_0x48c994[_0x498b('0x1e')]?_0x48c994['options'][_0x498b('0x21')]?_[_0x498b('0x22')](_0x48c994['options'][_0x498b('0x21')],function(_0x26fa29){return{'model':db[_0x26fa29[_0x498b('0x23')]],'as':_0x26fa29['as'],'attributes':_0x26fa29['attributes'],'include':_0x26fa29[_0x498b('0x21')]?_[_0x498b('0x22')](_0x26fa29[_0x498b('0x21')],function(_0x3ab903){return{'model':db[_0x3ab903['model']],'as':_0x3ab903['as'],'attributes':_0x3ab903[_0x498b('0x20')],'include':_0x3ab903['include']?_[_0x498b('0x22')](_0x3ab903[_0x498b('0x21')],function(_0x5a3961){return{'model':db[_0x5a3961['model']],'as':_0x5a3961['as'],'attributes':_0x5a3961[_0x498b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x498b('0x24')](function(_0x1bd030){logger[_0x498b('0x14')](_0x498b('0x25'),_0x48c994);logger[_0x498b('0x17')](_0x498b('0x25'),_0x48c994,JSON[_0x498b('0x18')](_0x1bd030));_0xb89aba(_0x1bd030);})[_0x498b('0x1c')](function(_0x2bc26f){logger[_0x498b('0x19')](_0x498b('0x25'),_0x2bc26f[_0x498b('0x1a')],_0x48c994);_0x269767(_0x12789d[_0x498b('0x19')](0x1f4,_0x2bc26f[_0x498b('0x1a')]));});});};
\ No newline at end of file
index 845c581..c07ec29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98e7=['length','smsAccount:','save','remove','update','emit','register'];(function(_0xbedcf5,_0x1820af){var _0x319194=function(_0x5b78d2){while(--_0x5b78d2){_0xbedcf5['push'](_0xbedcf5['shift']());}};_0x319194(++_0x1820af);}(_0x98e7,0x1c2));var _0x798e=function(_0x52dfa9,_0x306d3f){_0x52dfa9=_0x52dfa9-0x0;var _0xdfaa57=_0x98e7[_0x52dfa9];return _0xdfaa57;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x798e('0x0'),_0x798e('0x1'),_0x798e('0x2')];function createListener(_0x4478b2,_0x320e4d){return function(_0x1571c4){_0x320e4d[_0x798e('0x3')](_0x4478b2,_0x1571c4);};}function removeListener(_0x5e750c,_0x808ffe){return function(){SmsAccountEvents['removeListener'](_0x5e750c,_0x808ffe);};}exports[_0x798e('0x4')]=function(_0x1b5f85){for(var _0x2119a8=0x0,_0x155f0c=events[_0x798e('0x5')];_0x2119a8<_0x155f0c;_0x2119a8++){var _0x1a60d5=events[_0x2119a8];var _0x4c48db=createListener(_0x798e('0x6')+_0x1a60d5,_0x1b5f85);SmsAccountEvents['on'](_0x1a60d5,_0x4c48db);}};
\ No newline at end of file
+var _0x8945=['update','emit','removeListener','length','smsAccount:','save','remove'];(function(_0x4c3c4b,_0x2cf1ef){var _0x5004fa=function(_0x5124eb){while(--_0x5124eb){_0x4c3c4b['push'](_0x4c3c4b['shift']());}};_0x5004fa(++_0x2cf1ef);}(_0x8945,0x12b));var _0x5894=function(_0xdcfd07,_0x3a481b){_0xdcfd07=_0xdcfd07-0x0;var _0x2dc2b7=_0x8945[_0xdcfd07];return _0x2dc2b7;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x5894('0x0'),_0x5894('0x1'),_0x5894('0x2')];function createListener(_0x26bb70,_0x9694d7){return function(_0x408e8c){_0x9694d7[_0x5894('0x3')](_0x26bb70,_0x408e8c);};}function removeListener(_0x3f3f79,_0x25d1f8){return function(){SmsAccountEvents[_0x5894('0x4')](_0x3f3f79,_0x25d1f8);};}exports['register']=function(_0x71d30a){for(var _0x3c082e=0x0,_0x3beb24=events[_0x5894('0x5')];_0x3c082e<_0x3beb24;_0x3c082e++){var _0x5d60a2=events[_0x3c082e];var _0x14b051=createListener(_0x5894('0x6')+_0x5d60a2,_0x71d30a);SmsAccountEvents['on'](_0x5d60a2,_0x14b051);}};
\ No newline at end of file
index 22f68f3..bf1e5a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d2b=['./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x102977,_0x41f7ac){var _0x3050f5=function(_0x1aa495){while(--_0x1aa495){_0x102977['push'](_0x102977['shift']());}};_0x3050f5(++_0x41f7ac);}(_0x1d2b,0x1d4));var _0xb1d2=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x1d2b[_0x20c9b2];return _0x2c6030;};'use strict';var multer=require('multer');var util=require(_0xb1d2('0x0'));var path=require(_0xb1d2('0x1'));var timeout=require('connect-timeout');var express=require(_0xb1d2('0x2'));var router=express[_0xb1d2('0x3')]();var auth=require(_0xb1d2('0x4'));var interaction=require(_0xb1d2('0x5'));var config=require(_0xb1d2('0x6'));var controller=require(_0xb1d2('0x7'));router[_0xb1d2('0x8')]('/',auth['isAuthenticated'](),controller[_0xb1d2('0x9')]);router['get'](_0xb1d2('0xa'),auth[_0xb1d2('0xb')](),controller[_0xb1d2('0xc')]);router[_0xb1d2('0xd')]('/',auth[_0xb1d2('0xb')](),controller[_0xb1d2('0xe')]);router['put'](_0xb1d2('0xa'),auth[_0xb1d2('0xb')](),controller[_0xb1d2('0xf')]);router[_0xb1d2('0x10')](_0xb1d2('0xa'),auth[_0xb1d2('0xb')](),controller[_0xb1d2('0x11')]);module[_0xb1d2('0x12')]=router;
\ No newline at end of file
+var _0xf170=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsApplication.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy'];(function(_0x2ab7f0,_0x446b5b){var _0x2c82d9=function(_0x26fe8e){while(--_0x26fe8e){_0x2ab7f0['push'](_0x2ab7f0['shift']());}};_0x2c82d9(++_0x446b5b);}(_0xf170,0x1a3));var _0x0f17=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0xf170[_0x29e35f];return _0x266b74;};'use strict';var multer=require('multer');var util=require(_0x0f17('0x0'));var path=require(_0x0f17('0x1'));var timeout=require(_0x0f17('0x2'));var express=require(_0x0f17('0x3'));var router=express[_0x0f17('0x4')]();var auth=require(_0x0f17('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0f17('0x6'));var controller=require(_0x0f17('0x7'));router['get']('/',auth[_0x0f17('0x8')](),controller[_0x0f17('0x9')]);router[_0x0f17('0xa')](_0x0f17('0xb'),auth[_0x0f17('0x8')](),controller[_0x0f17('0xc')]);router['post']('/',auth[_0x0f17('0x8')](),controller[_0x0f17('0xd')]);router[_0x0f17('0xe')](_0x0f17('0xb'),auth['isAuthenticated'](),controller[_0x0f17('0xf')]);router[_0x0f17('0x10')](_0x0f17('0xb'),auth[_0x0f17('0x8')](),controller[_0x0f17('0x11')]);module[_0x0f17('0x12')]=router;
\ No newline at end of file
index 1a5e011..d7f573e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeab9=['TEXT','sequelize','STRING','noop'];(function(_0x4fc430,_0x3190fb){var _0x1667c4=function(_0x529c55){while(--_0x529c55){_0x4fc430['push'](_0x4fc430['shift']());}};_0x1667c4(++_0x3190fb);}(_0xeab9,0x65));var _0x9eab=function(_0x102b93,_0x329aa3){_0x102b93=_0x102b93-0x0;var _0x4bdd0a=_0xeab9[_0x102b93];return _0x4bdd0a;};'use strict';var Sequelize=require(_0x9eab('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9eab('0x1')],'allowNull':![],'defaultValue':_0x9eab('0x2')},'appdata':{'type':Sequelize[_0x9eab('0x3')]()},'description':{'type':Sequelize[_0x9eab('0x1')]},'interval':{'type':Sequelize[_0x9eab('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xbdeb=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x400322,_0x4353a8){var _0xfdd597=function(_0xd914b6){while(--_0xd914b6){_0x400322['push'](_0x400322['shift']());}};_0xfdd597(++_0x4353a8);}(_0xbdeb,0x162));var _0xbbde=function(_0x4ad364,_0x3ff8d7){_0x4ad364=_0x4ad364-0x0;var _0x4ac3c3=_0xbdeb[_0x4ad364];return _0x4ac3c3;};'use strict';var Sequelize=require(_0xbbde('0x0'));module[_0xbbde('0x1')]={'priority':{'type':Sequelize[_0xbbde('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbbde('0x3')],'allowNull':![],'defaultValue':_0xbbde('0x4')},'appdata':{'type':Sequelize[_0xbbde('0x5')]()},'description':{'type':Sequelize[_0xbbde('0x3')]},'interval':{'type':Sequelize[_0xbbde('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 05e2f5d..0c6be60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed3c=['ejs','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','then','error','name','send','index','map','SmsApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xed3c,0x1a6));var _0xced3=function(_0x1b4002,_0x5b4094){_0x1b4002=_0x1b4002-0x0;var _0x1716f3=_0xed3c[_0x1b4002];return _0x1716f3;};'use strict';var pdf=require(_0xced3('0x0'));var emlformat=require(_0xced3('0x1'));var rimraf=require(_0xced3('0x2'));var zipdir=require(_0xced3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xced3('0x4'));var moment=require(_0xced3('0x5'));var BPromise=require(_0xced3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xced3('0x7'));var sox=require(_0xced3('0x8'));var csv=require(_0xced3('0x9'));var ejs=require(_0xced3('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xced3('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xced3('0xc'));var Redis=require(_0xced3('0xd'));var authService=require(_0xced3('0xe'));var qs=require(_0xced3('0xf'));var as=require(_0xced3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced3('0x11'))(_0xced3('0x12'));var utils=require(_0xced3('0x13'));var config=require('../../config/environment');var db=require(_0xced3('0x14'))['db'];function respondWithStatusCode(_0x19b8c2,_0x42d879){_0x42d879=_0x42d879||0xcc;return function(_0x3b2ac4){if(_0x3b2ac4){return _0x19b8c2[_0xced3('0x15')](_0x42d879);}return _0x19b8c2[_0xced3('0x16')](_0x42d879)[_0xced3('0x17')]();};}function respondWithResult(_0x5aadb6,_0x65bb58){_0x65bb58=_0x65bb58||0xc8;return function(_0x5e186e){if(_0x5e186e){return _0x5aadb6[_0xced3('0x16')](_0x65bb58)[_0xced3('0x18')](_0x5e186e);}};}function respondWithFilteredResult(_0x20d099,_0x39e4aa){return function(_0x4dd4c3){if(_0x4dd4c3){var _0x146a21=_0x4dd4c3[_0xced3('0x19')],_0x322c2d=_0x39e4aa[_0xced3('0x1a')],_0x4acae6=_0x39e4aa[_0xced3('0x1a')]+_0x39e4aa['limit'],_0x3b5962;if(_0x4acae6>=_0x146a21){_0x4acae6=_0x146a21;_0x3b5962=0xc8;}else{_0x3b5962=0xce;}_0x20d099[_0xced3('0x16')](_0x3b5962);return _0x20d099['set'](_0xced3('0x1b'),_0x322c2d+'-'+_0x4acae6+'/'+_0x146a21)[_0xced3('0x18')](_0x4dd4c3);}return null;};}function patchUpdates(_0x32c402){return function(_0x1fb300){try{jsonpatch[_0xced3('0x1c')](_0x1fb300,_0x32c402,!![]);}catch(_0x688c97){return BPromise[_0xced3('0x1d')](_0x688c97);}return _0x1fb300[_0xced3('0x1e')]();};}function saveUpdates(_0x3f688c,_0x17c011){return function(_0x2008f2){if(_0x2008f2){return _0x2008f2['update'](_0x3f688c)['then'](function(_0x5e8c44){return _0x5e8c44;});}return null;};}function removeEntity(_0x1e8450,_0x342b9e){return function(_0x21e074){if(_0x21e074){return _0x21e074['destroy']()[_0xced3('0x1f')](function(){_0x1e8450[_0xced3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x559fa2,_0x3adf14){return function(_0x101708){if(!_0x101708){_0x559fa2[_0xced3('0x15')](0x194);}return _0x101708;};}function handleError(_0x15c6c5,_0x50f7c1){_0x50f7c1=_0x50f7c1||0x1f4;return function(_0x1905a3){logger[_0xced3('0x20')](_0x1905a3['stack']);if(_0x1905a3[_0xced3('0x21')]){delete _0x1905a3['name'];}_0x15c6c5[_0xced3('0x16')](_0x50f7c1)[_0xced3('0x22')](_0x1905a3);};}exports[_0xced3('0x23')]=function(_0x23a570,_0x2ec2c4){var _0x502cf1={},_0x5454c0={},_0x36b1fe={'count':0x0,'rows':[]};var _0x5bb425=_[_0xced3('0x24')](db[_0xced3('0x25')]['rawAttributes'],function(_0x3db664){return{'name':_0x3db664[_0xced3('0x26')],'type':_0x3db664[_0xced3('0x27')][_0xced3('0x28')]};});_0x5454c0[_0xced3('0x29')]=_[_0xced3('0x24')](_0x5bb425,_0xced3('0x21'));_0x5454c0[_0xced3('0x2a')]=_[_0xced3('0x2b')](_0x23a570['query']);_0x5454c0[_0xced3('0x2c')]=_[_0xced3('0x2d')](_0x5454c0[_0xced3('0x29')],_0x5454c0[_0xced3('0x2a')]);_0x502cf1[_0xced3('0x2e')]=_[_0xced3('0x2d')](_0x5454c0[_0xced3('0x29')],qs[_0xced3('0x2f')](_0x23a570[_0xced3('0x2a')][_0xced3('0x2f')]));_0x502cf1[_0xced3('0x2e')]=_0x502cf1[_0xced3('0x2e')][_0xced3('0x30')]?_0x502cf1[_0xced3('0x2e')]:_0x5454c0[_0xced3('0x29')];if(!_0x23a570[_0xced3('0x2a')][_0xced3('0x31')](_0xced3('0x32'))){_0x502cf1[_0xced3('0x33')]=qs[_0xced3('0x33')](_0x23a570[_0xced3('0x2a')]['limit']);_0x502cf1[_0xced3('0x1a')]=qs['offset'](_0x23a570[_0xced3('0x2a')][_0xced3('0x1a')]);}_0x502cf1[_0xced3('0x34')]=qs[_0xced3('0x35')](_0x23a570[_0xced3('0x2a')][_0xced3('0x35')]);_0x502cf1[_0xced3('0x36')]=qs[_0xced3('0x2c')](_[_0xced3('0x37')](_0x23a570[_0xced3('0x2a')],_0x5454c0['filters']),_0x5bb425);if(_0x23a570[_0xced3('0x2a')][_0xced3('0x38')]){_0x502cf1['where']=_[_0xced3('0x39')](_0x502cf1[_0xced3('0x36')],{'$or':_[_0xced3('0x24')](_0x5bb425,function(_0x4f6ada){if(_0x4f6ada['type']!==_0xced3('0x3a')){var _0x529d5e={};_0x529d5e[_0x4f6ada[_0xced3('0x21')]]={'$like':'%'+_0x23a570[_0xced3('0x2a')]['filter']+'%'};return _0x529d5e;}})});}_0x502cf1=_[_0xced3('0x39')]({},_0x502cf1,_0x23a570[_0xced3('0x3b')]);var _0x2a6dbf={'where':_0x502cf1['where']};return db[_0xced3('0x25')]['count'](_0x2a6dbf)['then'](function(_0x34d5db){_0x36b1fe[_0xced3('0x19')]=_0x34d5db;if(_0x23a570[_0xced3('0x2a')]['includeAll']){_0x502cf1[_0xced3('0x3c')]=[{'all':!![]}];}return db[_0xced3('0x25')][_0xced3('0x3d')](_0x502cf1);})[_0xced3('0x1f')](function(_0x28506e){_0x36b1fe[_0xced3('0x3e')]=_0x28506e;return _0x36b1fe;})[_0xced3('0x1f')](respondWithFilteredResult(_0x2ec2c4,_0x502cf1))[_0xced3('0x3f')](handleError(_0x2ec2c4,null));};exports[_0xced3('0x40')]=function(_0x3eca11,_0x2b4a18){var _0x38855f={'raw':!![],'where':{'id':_0x3eca11[_0xced3('0x41')]['id']}},_0x16b2c7={};_0x16b2c7[_0xced3('0x29')]=_['keys'](db[_0xced3('0x25')][_0xced3('0x42')]);_0x16b2c7[_0xced3('0x2a')]=_[_0xced3('0x2b')](_0x3eca11[_0xced3('0x2a')]);_0x16b2c7[_0xced3('0x2c')]=_[_0xced3('0x2d')](_0x16b2c7[_0xced3('0x29')],_0x16b2c7[_0xced3('0x2a')]);_0x38855f['attributes']=_[_0xced3('0x2d')](_0x16b2c7['model'],qs[_0xced3('0x2f')](_0x3eca11[_0xced3('0x2a')][_0xced3('0x2f')]));_0x38855f['attributes']=_0x38855f[_0xced3('0x2e')][_0xced3('0x30')]?_0x38855f[_0xced3('0x2e')]:_0x16b2c7[_0xced3('0x29')];if(_0x3eca11['query'][_0xced3('0x43')]){_0x38855f[_0xced3('0x3c')]=[{'all':!![]}];}_0x38855f=_[_0xced3('0x39')]({},_0x38855f,_0x3eca11[_0xced3('0x3b')]);return db[_0xced3('0x25')]['find'](_0x38855f)[_0xced3('0x1f')](handleEntityNotFound(_0x2b4a18,null))[_0xced3('0x1f')](respondWithResult(_0x2b4a18,null))[_0xced3('0x3f')](handleError(_0x2b4a18,null));};exports[_0xced3('0x44')]=function(_0x334474,_0x740743){return db[_0xced3('0x25')]['create'](_0x334474[_0xced3('0x45')],{})[_0xced3('0x1f')](respondWithResult(_0x740743,0xc9))['catch'](handleError(_0x740743,null));};exports['update']=function(_0x140df2,_0x59b586){if(_0x140df2[_0xced3('0x45')]['id']){delete _0x140df2[_0xced3('0x45')]['id'];}return db[_0xced3('0x25')][_0xced3('0x46')]({'where':{'id':_0x140df2[_0xced3('0x41')]['id']}})[_0xced3('0x1f')](handleEntityNotFound(_0x59b586,null))[_0xced3('0x1f')](saveUpdates(_0x140df2[_0xced3('0x45')],null))[_0xced3('0x1f')](respondWithResult(_0x59b586,null))['catch'](handleError(_0x59b586,null));};exports[_0xced3('0x47')]=function(_0x8df206,_0x2aa876){return db[_0xced3('0x25')][_0xced3('0x46')]({'where':{'id':_0x8df206[_0xced3('0x41')]['id']}})['then'](handleEntityNotFound(_0x2aa876,null))[_0xced3('0x1f')](removeEntity(_0x2aa876,null))[_0xced3('0x3f')](handleError(_0x2aa876,null));};
\ No newline at end of file
+var _0x8952=['querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','save','update','then','destroy','end','stack','name','send','index','SmsApplication','fieldName','model','map','query','keys','filters','attributes','fields','length','order','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','intersection','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0x8952,0x17e));var _0x2895=function(_0x272aea,_0x59b853){_0x272aea=_0x272aea-0x0;var _0x526a95=_0x8952[_0x272aea];return _0x526a95;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2895('0x0'));var rimraf=require(_0x2895('0x1'));var zipdir=require(_0x2895('0x2'));var jsonpatch=require(_0x2895('0x3'));var rp=require(_0x2895('0x4'));var moment=require('moment');var BPromise=require(_0x2895('0x5'));var Mustache=require(_0x2895('0x6'));var util=require(_0x2895('0x7'));var path=require('path');var sox=require(_0x2895('0x8'));var csv=require(_0x2895('0x9'));var ejs=require(_0x2895('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x9'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x981298,_0x3924be){_0x3924be=_0x3924be||0xcc;return function(_0x4b1342){if(_0x4b1342){return _0x981298[_0x2895('0x14')](_0x3924be);}return _0x981298[_0x2895('0x15')](_0x3924be)['end']();};}function respondWithResult(_0x590a1b,_0x1d1493){_0x1d1493=_0x1d1493||0xc8;return function(_0x2ca2ac){if(_0x2ca2ac){return _0x590a1b['status'](_0x1d1493)[_0x2895('0x16')](_0x2ca2ac);}};}function respondWithFilteredResult(_0xd8192e,_0x27b50e){return function(_0x1ae013){if(_0x1ae013){var _0x1d3659=_0x1ae013[_0x2895('0x17')],_0x2627e6=_0x27b50e[_0x2895('0x18')],_0x6a5c7e=_0x27b50e[_0x2895('0x18')]+_0x27b50e[_0x2895('0x19')],_0x31bb7f;if(_0x6a5c7e>=_0x1d3659){_0x6a5c7e=_0x1d3659;_0x31bb7f=0xc8;}else{_0x31bb7f=0xce;}_0xd8192e[_0x2895('0x15')](_0x31bb7f);return _0xd8192e[_0x2895('0x1a')](_0x2895('0x1b'),_0x2627e6+'-'+_0x6a5c7e+'/'+_0x1d3659)[_0x2895('0x16')](_0x1ae013);}return null;};}function patchUpdates(_0x2fe8fe){return function(_0x1e8d47){try{jsonpatch['apply'](_0x1e8d47,_0x2fe8fe,!![]);}catch(_0x4b3ba0){return BPromise['reject'](_0x4b3ba0);}return _0x1e8d47[_0x2895('0x1c')]();};}function saveUpdates(_0x12c2fb,_0x3ec4da){return function(_0x593e47){if(_0x593e47){return _0x593e47[_0x2895('0x1d')](_0x12c2fb)[_0x2895('0x1e')](function(_0x2743b5){return _0x2743b5;});}return null;};}function removeEntity(_0x19228e,_0x8b75e0){return function(_0x5dbbfe){if(_0x5dbbfe){return _0x5dbbfe[_0x2895('0x1f')]()[_0x2895('0x1e')](function(){_0x19228e['status'](0xcc)[_0x2895('0x20')]();});}};}function handleEntityNotFound(_0x384357,_0x6f8ad4){return function(_0x511286){if(!_0x511286){_0x384357['sendStatus'](0x194);}return _0x511286;};}function handleError(_0x3a72fa,_0x4569b5){_0x4569b5=_0x4569b5||0x1f4;return function(_0x23b0eb){logger['error'](_0x23b0eb[_0x2895('0x21')]);if(_0x23b0eb[_0x2895('0x22')]){delete _0x23b0eb['name'];}_0x3a72fa[_0x2895('0x15')](_0x4569b5)[_0x2895('0x23')](_0x23b0eb);};}exports[_0x2895('0x24')]=function(_0x5c6c21,_0x320661){var _0x30f491={},_0x5eedfc={},_0x21f549={'count':0x0,'rows':[]};var _0x501898=_['map'](db[_0x2895('0x25')]['rawAttributes'],function(_0xfa4f85){return{'name':_0xfa4f85[_0x2895('0x26')],'type':_0xfa4f85['type']['key']};});_0x5eedfc[_0x2895('0x27')]=_[_0x2895('0x28')](_0x501898,_0x2895('0x22'));_0x5eedfc[_0x2895('0x29')]=_[_0x2895('0x2a')](_0x5c6c21[_0x2895('0x29')]);_0x5eedfc[_0x2895('0x2b')]=_['intersection'](_0x5eedfc[_0x2895('0x27')],_0x5eedfc[_0x2895('0x29')]);_0x30f491[_0x2895('0x2c')]=_['intersection'](_0x5eedfc[_0x2895('0x27')],qs[_0x2895('0x2d')](_0x5c6c21[_0x2895('0x29')][_0x2895('0x2d')]));_0x30f491['attributes']=_0x30f491[_0x2895('0x2c')][_0x2895('0x2e')]?_0x30f491[_0x2895('0x2c')]:_0x5eedfc[_0x2895('0x27')];if(!_0x5c6c21[_0x2895('0x29')]['hasOwnProperty']('nolimit')){_0x30f491[_0x2895('0x19')]=qs[_0x2895('0x19')](_0x5c6c21['query'][_0x2895('0x19')]);_0x30f491['offset']=qs[_0x2895('0x18')](_0x5c6c21[_0x2895('0x29')]['offset']);}_0x30f491[_0x2895('0x2f')]=qs['sort'](_0x5c6c21[_0x2895('0x29')]['sort']);_0x30f491['where']=qs[_0x2895('0x2b')](_[_0x2895('0x30')](_0x5c6c21[_0x2895('0x29')],_0x5eedfc['filters']),_0x501898);if(_0x5c6c21[_0x2895('0x29')][_0x2895('0x31')]){_0x30f491[_0x2895('0x32')]=_[_0x2895('0x33')](_0x30f491[_0x2895('0x32')],{'$or':_[_0x2895('0x28')](_0x501898,function(_0xf44bda){if(_0xf44bda[_0x2895('0x34')]!==_0x2895('0x35')){var _0xa6b8c5={};_0xa6b8c5[_0xf44bda['name']]={'$like':'%'+_0x5c6c21[_0x2895('0x29')][_0x2895('0x31')]+'%'};return _0xa6b8c5;}})});}_0x30f491=_[_0x2895('0x33')]({},_0x30f491,_0x5c6c21[_0x2895('0x36')]);var _0x41a66b={'where':_0x30f491[_0x2895('0x32')]};return db[_0x2895('0x25')]['count'](_0x41a66b)['then'](function(_0x2c2dd3){_0x21f549[_0x2895('0x17')]=_0x2c2dd3;if(_0x5c6c21[_0x2895('0x29')][_0x2895('0x37')]){_0x30f491[_0x2895('0x38')]=[{'all':!![]}];}return db[_0x2895('0x25')]['findAll'](_0x30f491);})['then'](function(_0x3f083e){_0x21f549[_0x2895('0x39')]=_0x3f083e;return _0x21f549;})['then'](respondWithFilteredResult(_0x320661,_0x30f491))['catch'](handleError(_0x320661,null));};exports[_0x2895('0x3a')]=function(_0x3fa454,_0x3cc827){var _0x28967f={'raw':!![],'where':{'id':_0x3fa454[_0x2895('0x3b')]['id']}},_0x2bac35={};_0x2bac35['model']=_[_0x2895('0x2a')](db[_0x2895('0x25')][_0x2895('0x3c')]);_0x2bac35[_0x2895('0x29')]=_['keys'](_0x3fa454[_0x2895('0x29')]);_0x2bac35[_0x2895('0x2b')]=_[_0x2895('0x3d')](_0x2bac35[_0x2895('0x27')],_0x2bac35['query']);_0x28967f['attributes']=_[_0x2895('0x3d')](_0x2bac35[_0x2895('0x27')],qs[_0x2895('0x2d')](_0x3fa454[_0x2895('0x29')][_0x2895('0x2d')]));_0x28967f['attributes']=_0x28967f['attributes'][_0x2895('0x2e')]?_0x28967f[_0x2895('0x2c')]:_0x2bac35[_0x2895('0x27')];if(_0x3fa454[_0x2895('0x29')][_0x2895('0x37')]){_0x28967f[_0x2895('0x38')]=[{'all':!![]}];}_0x28967f=_[_0x2895('0x33')]({},_0x28967f,_0x3fa454['options']);return db[_0x2895('0x25')][_0x2895('0x3e')](_0x28967f)[_0x2895('0x1e')](handleEntityNotFound(_0x3cc827,null))[_0x2895('0x1e')](respondWithResult(_0x3cc827,null))[_0x2895('0x3f')](handleError(_0x3cc827,null));};exports[_0x2895('0x40')]=function(_0x232464,_0x299d71){return db['SmsApplication'][_0x2895('0x40')](_0x232464[_0x2895('0x41')],{})[_0x2895('0x1e')](respondWithResult(_0x299d71,0xc9))['catch'](handleError(_0x299d71,null));};exports[_0x2895('0x1d')]=function(_0x5307a9,_0x5e4f70){if(_0x5307a9[_0x2895('0x41')]['id']){delete _0x5307a9[_0x2895('0x41')]['id'];}return db[_0x2895('0x25')][_0x2895('0x3e')]({'where':{'id':_0x5307a9[_0x2895('0x3b')]['id']}})[_0x2895('0x1e')](handleEntityNotFound(_0x5e4f70,null))[_0x2895('0x1e')](saveUpdates(_0x5307a9['body'],null))[_0x2895('0x1e')](respondWithResult(_0x5e4f70,null))[_0x2895('0x3f')](handleError(_0x5e4f70,null));};exports['destroy']=function(_0x4e1d47,_0x574839){return db[_0x2895('0x25')][_0x2895('0x3e')]({'where':{'id':_0x4e1d47[_0x2895('0x3b')]['id']}})[_0x2895('0x1e')](handleEntityNotFound(_0x574839,null))[_0x2895('0x1e')](removeEntity(_0x574839,null))[_0x2895('0x3f')](handleError(_0x574839,null));};
\ No newline at end of file
index 5ca8f9c..f2ddf15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34ec=['request-promise','path','../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','util','../../config/logger','api','moment'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0x34ec,0x128));var _0xc34e=function(_0x35194d,_0x53151b){_0x35194d=_0x35194d-0x0;var _0x2f028b=_0x34ec[_0x35194d];return _0x2f028b;};'use strict';var _=require('lodash');var util=require(_0xc34e('0x0'));var logger=require(_0xc34e('0x1'))(_0xc34e('0x2'));var moment=require(_0xc34e('0x3'));var BPromise=require('bluebird');var rp=require(_0xc34e('0x4'));var fs=require('fs');var path=require(_0xc34e('0x5'));var rimraf=require('rimraf');var config=require(_0xc34e('0x6'));var attributes=require(_0xc34e('0x7'));module[_0xc34e('0x8')]=function(_0x196870,_0xe9e61c){return _0x196870['define'](_0xc34e('0x9'),attributes,{'tableName':_0xc34e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc34e('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xa639=['lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4_unicode_ci'];(function(_0x357174,_0x3875e2){var _0x13d040=function(_0x12341b){while(--_0x12341b){_0x357174['push'](_0x357174['shift']());}};_0x13d040(++_0x3875e2);}(_0xa639,0x78));var _0x9a63=function(_0x2d099d,_0x39d932){_0x2d099d=_0x2d099d-0x0;var _0x5d66da=_0xa639[_0x2d099d];return _0x5d66da;};'use strict';var _=require(_0x9a63('0x0'));var util=require('util');var logger=require(_0x9a63('0x1'))(_0x9a63('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9a63('0x3'));var fs=require('fs');var path=require(_0x9a63('0x4'));var rimraf=require(_0x9a63('0x5'));var config=require(_0x9a63('0x6'));var attributes=require(_0x9a63('0x7'));module['exports']=function(_0x299c66,_0x1e0736){return _0x299c66[_0x9a63('0x8')](_0x9a63('0x9'),attributes,{'tableName':_0x9a63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9a63('0xb')});};
\ No newline at end of file
index b9cde42..8446c70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93bb=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x372826,_0x24dd3c){var _0x197bda=function(_0xfc119f){while(--_0xfc119f){_0x372826['push'](_0x372826['shift']());}};_0x197bda(++_0x24dd3c);}(_0x93bb,0x135));var _0xb93b=function(_0x5f5b30,_0x32b0b6){_0x5f5b30=_0x5f5b30-0x0;var _0x34be0d=_0x93bb[_0x5f5b30];return _0x34be0d;};'use strict';var _=require(_0xb93b('0x0'));var util=require(_0xb93b('0x1'));var moment=require(_0xb93b('0x2'));var BPromise=require(_0xb93b('0x3'));var rs=require(_0xb93b('0x4'));var fs=require('fs');var Redis=require(_0xb93b('0x5'));var db=require(_0xb93b('0x6'))['db'];var utils=require(_0xb93b('0x7'));var logger=require(_0xb93b('0x8'))(_0xb93b('0x9'));var config=require('../../config/environment');var jayson=require(_0xb93b('0xa'));var client=jayson[_0xb93b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4dcf,_0x2c27ca,_0x516b0b){return new BPromise(function(_0x35c135,_0x455cb2){return client[_0xb93b('0xc')](_0x3c4dcf,_0x516b0b)[_0xb93b('0xd')](function(_0x1c9b11){logger[_0xb93b('0xe')](_0xb93b('0xf'),_0x2c27ca,_0xb93b('0x10'));logger[_0xb93b('0x11')](_0xb93b('0x12'),_0x2c27ca,_0xb93b('0x10'),JSON['stringify'](_0x1c9b11));if(_0x1c9b11[_0xb93b('0x13')]){if(_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x14')]===0x1f4){logger[_0xb93b('0x13')]('SmsApplication,\x20%s,\x20%s',_0x2c27ca,_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x15')]);return _0x455cb2(_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x15')]);}logger[_0xb93b('0x13')](_0xb93b('0xf'),_0x2c27ca,_0x1c9b11[_0xb93b('0x13')]['message']);return _0x35c135(_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x15')]);}else{logger[_0xb93b('0xe')](_0xb93b('0xf'),_0x2c27ca,_0xb93b('0x10'));_0x35c135(_0x1c9b11[_0xb93b('0x16')]['message']);}})[_0xb93b('0x17')](function(_0x5ee3c4){logger[_0xb93b('0x13')](_0xb93b('0xf'),_0x2c27ca,_0x5ee3c4);_0x455cb2(_0x5ee3c4);});});}
\ No newline at end of file
+var _0x5577=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5577,0x1b4));var _0x7557=function(_0x2bc6a2,_0x44e6ea){_0x2bc6a2=_0x2bc6a2-0x0;var _0x50f1ce=_0x5577[_0x2bc6a2];return _0x50f1ce;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var moment=require(_0x7557('0x1'));var BPromise=require(_0x7557('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7557('0x3'));var db=require(_0x7557('0x4'))['db'];var utils=require(_0x7557('0x5'));var logger=require(_0x7557('0x6'))(_0x7557('0x7'));var config=require(_0x7557('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7557('0x9')][_0x7557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da895,_0x1446fd,_0x33e9aa){return new BPromise(function(_0x37f335,_0xa4f49a){return client[_0x7557('0xb')](_0x3da895,_0x33e9aa)[_0x7557('0xc')](function(_0x24b592){logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));logger[_0x7557('0x10')](_0x7557('0x11'),_0x1446fd,'request\x20sent',JSON['stringify'](_0x24b592));if(_0x24b592[_0x7557('0x12')]){if(_0x24b592[_0x7557('0x12')][_0x7557('0x13')]===0x1f4){logger[_0x7557('0x12')](_0x7557('0xe'),_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0xa4f49a(_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);}logger[_0x7557('0x12')]('SmsApplication,\x20%s,\x20%s',_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0x37f335(_0x24b592[_0x7557('0x12')]['message']);}else{logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));_0x37f335(_0x24b592[_0x7557('0x15')]['message']);}})[_0x7557('0x16')](function(_0x46057c){logger['error']('SmsApplication,\x20%s,\x20%s',_0x1446fd,_0x46057c);_0xa4f49a(_0x46057c);});});}
\ No newline at end of file
index d4cba7a..4af8414 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c45=['/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages'];(function(_0x100070,_0x15333b){var _0x12d824=function(_0x3ae061){while(--_0x3ae061){_0x100070['push'](_0x100070['shift']());}};_0x12d824(++_0x15333b);}(_0x1c45,0x1b0));var _0x51c4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1c45[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x51c4('0x0'));var util=require(_0x51c4('0x1'));var path=require(_0x51c4('0x2'));var timeout=require(_0x51c4('0x3'));var express=require(_0x51c4('0x4'));var router=express[_0x51c4('0x5')]();var auth=require(_0x51c4('0x6'));var interaction=require(_0x51c4('0x7'));var config=require('../../config/environment');var controller=require('./smsInteraction.controller');router[_0x51c4('0x8')]('/',auth[_0x51c4('0x9')](),controller[_0x51c4('0xa')]);router[_0x51c4('0x8')](_0x51c4('0xb'),auth[_0x51c4('0x9')](),controller[_0x51c4('0xc')]);router[_0x51c4('0x8')](_0x51c4('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x51c4('0x8')](_0x51c4('0xe'),auth[_0x51c4('0x9')](),controller[_0x51c4('0xf')]);router[_0x51c4('0x8')](_0x51c4('0x10'),auth['isAuthenticated'](),controller[_0x51c4('0x11')]);router[_0x51c4('0x12')]('/',auth[_0x51c4('0x9')](),controller[_0x51c4('0x13')]);router[_0x51c4('0x12')](_0x51c4('0xe'),auth[_0x51c4('0x9')](),controller[_0x51c4('0x14')]);router[_0x51c4('0x12')](_0x51c4('0x15'),auth[_0x51c4('0x9')](),interaction[_0x51c4('0x16')](_0x51c4('0x17'),'smsinteraction:addtags'),controller[_0x51c4('0x18')]);router[_0x51c4('0x19')]('/:id',auth[_0x51c4('0x9')](),interaction[_0x51c4('0x16')](_0x51c4('0x17'),_0x51c4('0x1a')),controller[_0x51c4('0x1b')]);router[_0x51c4('0x1c')](_0x51c4('0xd'),auth['isAuthenticated'](),interaction[_0x51c4('0x16')](_0x51c4('0x17'),'smsinteraction:destroy'),controller[_0x51c4('0x1d')]);router['delete'](_0x51c4('0x15'),auth[_0x51c4('0x9')](),controller[_0x51c4('0x1e')]);module[_0x51c4('0x1f')]=router;
\ No newline at end of file
+var _0xb0d2=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','post','create','/:id/messages','addMessage','tracked','smsinteraction:addtags','addTags','sms','smsinteraction:update','update','delete','smsinteraction:destroy'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xb0d2,0x1b4));var _0x2b0d=function(_0x13682e,_0x431f67){_0x13682e=_0x13682e-0x0;var _0x244503=_0xb0d2[_0x13682e];return _0x244503;};'use strict';var multer=require(_0x2b0d('0x0'));var util=require('util');var path=require(_0x2b0d('0x1'));var timeout=require(_0x2b0d('0x2'));var express=require(_0x2b0d('0x3'));var router=express['Router']();var auth=require(_0x2b0d('0x4'));var interaction=require(_0x2b0d('0x5'));var config=require(_0x2b0d('0x6'));var controller=require(_0x2b0d('0x7'));router[_0x2b0d('0x8')]('/',auth['isAuthenticated'](),controller[_0x2b0d('0x9')]);router[_0x2b0d('0x8')](_0x2b0d('0xa'),auth[_0x2b0d('0xb')](),controller[_0x2b0d('0xc')]);router[_0x2b0d('0x8')](_0x2b0d('0xd'),auth[_0x2b0d('0xb')](),controller[_0x2b0d('0xe')]);router[_0x2b0d('0x8')]('/:id/messages',auth[_0x2b0d('0xb')](),controller['getMessages']);router[_0x2b0d('0x8')](_0x2b0d('0xf'),auth[_0x2b0d('0xb')](),controller['download']);router[_0x2b0d('0x10')]('/',auth[_0x2b0d('0xb')](),controller[_0x2b0d('0x11')]);router[_0x2b0d('0x10')](_0x2b0d('0x12'),auth[_0x2b0d('0xb')](),controller[_0x2b0d('0x13')]);router[_0x2b0d('0x10')]('/:id/tags',auth[_0x2b0d('0xb')](),interaction[_0x2b0d('0x14')]('sms',_0x2b0d('0x15')),controller[_0x2b0d('0x16')]);router['put'](_0x2b0d('0xd'),auth[_0x2b0d('0xb')](),interaction[_0x2b0d('0x14')](_0x2b0d('0x17'),_0x2b0d('0x18')),controller[_0x2b0d('0x19')]);router[_0x2b0d('0x1a')](_0x2b0d('0xd'),auth[_0x2b0d('0xb')](),interaction[_0x2b0d('0x14')]('sms',_0x2b0d('0x1b')),controller['destroy']);router[_0x2b0d('0x1a')]('/:id/tags',auth[_0x2b0d('0xb')](),controller['removeTags']);module[_0x2b0d('0x1c')]=router;
\ No newline at end of file
index 07c91a6..a906117 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['moment','STRING','DATE','ENUM','out','sequelize'];(function(_0x49b9ef,_0x55547f){var _0x4de813=function(_0x4647cb){while(--_0x4647cb){_0x49b9ef['push'](_0x49b9ef['shift']());}};_0x4de813(++_0x55547f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0d8b('0x2')]},'note':{'type':Sequelize[_0x0d8b('0x2')]},'phone':{'type':Sequelize[_0x0d8b('0x2')]},'read1stAt':{'type':Sequelize[_0x0d8b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in',_0x0d8b('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xd8b0=['moment','STRING','DATE','ENUM','out','sequelize'];(function(_0x58c239,_0x1788bc){var _0x1cd7cb=function(_0x4359b5){while(--_0x4359b5){_0x58c239['push'](_0x58c239['shift']());}};_0x1cd7cb(++_0x1788bc);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0d8b('0x2')]},'note':{'type':Sequelize[_0x0d8b('0x2')]},'phone':{'type':Sequelize[_0x0d8b('0x2')]},'read1stAt':{'type':Sequelize[_0x0d8b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in',_0x0d8b('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 79bf0b3..39a2cb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','stack','Users','map','fullname','Tags','TagIds','forEach','catch','index','SmsInteraction','rawAttributes','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','field','color','tools_tags','select','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','having','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','parse','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','t.id\x20IN\x20?','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','push','all','rows','show','params','filters','includeAll','include','options','create','SmsMessage','addMessage','ids','omit','findOne','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','smsInteractionTags:save','removeTags','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','SmsAccount','Account','Owner','mkdirSync','10px','40px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','%s\x20#%d','Sms','N.A.','closed','closedAt','Messages','out','System','firstName','lastName','direction','secret','renderFile','transcript-','.pdf','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','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','redis'];(function(_0xadd417,_0x207028){var _0x5c79e7=function(_0xa07df0){while(--_0xa07df0){_0xadd417['push'](_0xadd417['shift']());}};_0x5c79e7(++_0x207028);}(_0xb688,0xcf));var _0x8b68=function(_0xcd9837,_0x5a0efd){_0xcd9837=_0xcd9837-0x0;var _0x57f1ba=_0xb688[_0xcd9837];return _0x57f1ba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8b68('0x0'));var rimraf=require(_0x8b68('0x1'));var zipdir=require(_0x8b68('0x2'));var jsonpatch=require(_0x8b68('0x3'));var rp=require(_0x8b68('0x4'));var moment=require(_0x8b68('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8b68('0x6'));var util=require(_0x8b68('0x7'));var path=require(_0x8b68('0x8'));var sox=require(_0x8b68('0x9'));var csv=require('to-csv');var ejs=require(_0x8b68('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8b68('0xb'));var crypto=require(_0x8b68('0xc'));var jsforce=require(_0x8b68('0xd'));var deskjs=require(_0x8b68('0xe'));var toCsv=require(_0x8b68('0xf'));var querystring=require(_0x8b68('0x10'));var Papa=require(_0x8b68('0x11'));var Redis=require(_0x8b68('0x12'));var authService=require(_0x8b68('0x13'));var qs=require(_0x8b68('0x14'));var as=require(_0x8b68('0x15'));var hardwareService=require(_0x8b68('0x16'));var logger=require(_0x8b68('0x17'))('api');var utils=require(_0x8b68('0x18'));var config=require(_0x8b68('0x19'));var db=require(_0x8b68('0x1a'))['db'];config[_0x8b68('0x1b')]=_[_0x8b68('0x1c')](config[_0x8b68('0x1b')],{'host':_0x8b68('0x1d'),'port':0x18eb});var socket=require(_0x8b68('0x1e'))(new Redis(config[_0x8b68('0x1b')]));require('./smsInteraction.socket')[_0x8b68('0x1f')](socket);function respondWithStatusCode(_0x509033,_0x5e3c66){_0x5e3c66=_0x5e3c66||0xcc;return function(_0x22f75b){if(_0x22f75b){return _0x509033[_0x8b68('0x20')](_0x5e3c66);}return _0x509033[_0x8b68('0x21')](_0x5e3c66)['end']();};}function respondWithResult(_0x5c8d0e,_0x23bd52){_0x23bd52=_0x23bd52||0xc8;return function(_0x5c1e44){if(_0x5c1e44){return _0x5c8d0e[_0x8b68('0x21')](_0x23bd52)[_0x8b68('0x22')](_0x5c1e44);}};}function respondWithFilteredResult(_0x1df44f,_0x10c9c6){return function(_0x491695){if(_0x491695){var _0xd17693=_0x491695[_0x8b68('0x23')],_0x203dd4=_0x10c9c6[_0x8b68('0x24')],_0x4a68c7=_0x10c9c6[_0x8b68('0x24')]+_0x10c9c6[_0x8b68('0x25')],_0x42b3bd;if(_0x4a68c7>=_0xd17693){_0x4a68c7=_0xd17693;_0x42b3bd=0xc8;}else{_0x42b3bd=0xce;}_0x1df44f['status'](_0x42b3bd);return _0x1df44f[_0x8b68('0x26')](_0x8b68('0x27'),_0x203dd4+'-'+_0x4a68c7+'/'+_0xd17693)[_0x8b68('0x22')](_0x491695);}return null;};}function patchUpdates(_0x1a9788){return function(_0x35d055){try{jsonpatch[_0x8b68('0x28')](_0x35d055,_0x1a9788,!![]);}catch(_0x5603d4){return BPromise['reject'](_0x5603d4);}return _0x35d055[_0x8b68('0x29')]();};}function saveUpdates(_0x59cb26,_0x332202){return function(_0x30b6d0){if(_0x30b6d0){return _0x30b6d0[_0x8b68('0x2a')](_0x59cb26)[_0x8b68('0x2b')](function(_0x32ddc5){return _0x32ddc5;});}return null;};}function removeEntity(_0x173524,_0x59bb8a){return function(_0x1a6fe8){if(_0x1a6fe8){return _0x1a6fe8[_0x8b68('0x2c')]()['then'](function(){_0x173524[_0x8b68('0x21')](0xcc)[_0x8b68('0x2d')]();});}};}function handleEntityNotFound(_0x240b0b,_0x5590ec){return function(_0x511ccf){if(!_0x511ccf){_0x240b0b['sendStatus'](0x194);}return _0x511ccf;};}function handleError(_0x92d186,_0x448e43){_0x448e43=_0x448e43||0x1f4;return function(_0x2ba2a3){logger['error'](_0x2ba2a3[_0x8b68('0x2e')]);if(_0x2ba2a3['name']){delete _0x2ba2a3['name'];}_0x92d186[_0x8b68('0x21')](_0x448e43)['send'](_0x2ba2a3);};}function getInteractionUsers(_0x26cad7,_0x3ac356){return new BPromise(function(_0x48e2c8,_0x494ce4){try{if(_0x3ac356[_0x26cad7['id']]){_0x26cad7[_0x8b68('0x2f')]=_[_0x8b68('0x30')](_0x3ac356[_0x26cad7['id']],function(_0x1e7c06){return{'id':_0x1e7c06['id'],'fullname':_0x1e7c06[_0x8b68('0x31')]};});}}catch(_0x210926){_0x494ce4(_0x210926);}_0x48e2c8(_0x26cad7);});}function getInteractionTags(_0x2ad2df,_0x460c37){return new BPromise(function(_0x5b7ed1,_0x3b6d1b){try{if(_0x2ad2df['TagIds']){_0x2ad2df[_0x8b68('0x32')]=[];_0x2ad2df[_0x8b68('0x33')]['split'](',')[_0x8b68('0x34')](function(_0x93daf7){_0x2ad2df[_0x8b68('0x32')]['push'](_0x460c37[_0x93daf7]);});}delete _0x2ad2df['TagIds'];}catch(_0x13c26b){_0x3b6d1b(_0x13c26b);}_0x5b7ed1(_0x2ad2df);});}function updateSmsInteraction(_0x8c11aa,_0x3e905a,_0x394cca){return new BPromise(function(_0x2c0ace,_0x334b13){return getInteractionUsers(_0x8c11aa,_0x394cca)[_0x8b68('0x2b')](function(_0x3e646e){return getInteractionTags(_0x3e646e,_0x3e905a);})[_0x8b68('0x2b')](function(_0x7fe301){_0x2c0ace(_0x7fe301);})[_0x8b68('0x35')](function(_0x15027a){_0x334b13(_0x15027a);});});}exports[_0x8b68('0x36')]=function(_0x439d36,_0x10aca9){var _0x151277={},_0x23336e={},_0x2a7dd5={'count':0x0,'rows':[]};var _0x120b34=_[_0x8b68('0x30')](db[_0x8b68('0x37')][_0x8b68('0x38')],function(_0x48abb7){return{'name':_0x48abb7['fieldName'],'type':_0x48abb7[_0x8b68('0x39')][_0x8b68('0x3a')]};});_0x23336e[_0x8b68('0x3b')]=_[_0x8b68('0x30')](_0x120b34,_0x8b68('0x3c'));_0x23336e[_0x8b68('0x3d')]=_[_0x8b68('0x3e')](_0x439d36[_0x8b68('0x3d')]);_0x23336e['filters']=_[_0x8b68('0x3f')](_0x23336e[_0x8b68('0x3b')],_0x23336e[_0x8b68('0x3d')]);_0x151277[_0x8b68('0x40')]=_[_0x8b68('0x3f')](_0x23336e[_0x8b68('0x3b')],qs[_0x8b68('0x41')](_0x439d36[_0x8b68('0x3d')]['fields']));_0x151277[_0x8b68('0x40')]=_0x151277[_0x8b68('0x40')][_0x8b68('0x42')]?_0x151277[_0x8b68('0x40')]:_0x23336e[_0x8b68('0x3b')];if(!_0x439d36[_0x8b68('0x3d')][_0x8b68('0x43')]('nolimit')){_0x151277[_0x8b68('0x25')]=qs[_0x8b68('0x25')](_0x439d36['query'][_0x8b68('0x25')]);_0x151277[_0x8b68('0x24')]=qs['offset'](_0x439d36['query']['offset']);}_0x151277['order']=qs[_0x8b68('0x44')](_0x439d36[_0x8b68('0x3d')]['sort']);_0x151277[_0x8b68('0x45')]=qs['filters'](_[_0x8b68('0x46')](_0x439d36[_0x8b68('0x3d')],_0x23336e['filters']),_0x120b34);var _0x2f90d9=[];var _0x5ae345=squel['select']()['field']('id')[_0x8b68('0x47')](_0x8b68('0x3c'))[_0x8b68('0x47')](_0x8b68('0x48'))['from'](_0x8b68('0x49'));var _0x58a5e3=squel[_0x8b68('0x4a')]()[_0x8b68('0x47')]('u.id')[_0x8b68('0x47')](_0x8b68('0x4b'))[_0x8b68('0x47')](_0x8b68('0x4c'))['from'](_0x8b68('0x4d'),'ui')[_0x8b68('0x4e')](_0x8b68('0x4f'),'u',_0x8b68('0x50'));var _0xae2c2a=squel[_0x8b68('0x4a')]()[_0x8b68('0x51')](_0x8b68('0x52'),'i')[_0x8b68('0x4e')](_0x8b68('0x53'),'c',_0x8b68('0x54'))[_0x8b68('0x4e')](_0x8b68('0x4f'),'o',_0x8b68('0x55'))[_0x8b68('0x4e')](_0x8b68('0x56'),'a','a.id\x20=\x20i.SmsAccountId')[_0x8b68('0x4e')](_0x8b68('0x57'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x8b68('0x4e')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')['left_join'](_0x8b68('0x49'),'t',_0x8b68('0x58'));var _0x34047c=squel[_0x8b68('0x59')]();var _0x49e279=[];var _0x522f47=squel[_0x8b68('0x59')]();var _0x163fd5;if(_0x439d36[_0x8b68('0x3d')]['search']){_0x163fd5=as[_0x8b68('0x5a')](_0x439d36[_0x8b68('0x3d')]['search']);var _0x429ebb=_0x163fd5[_0x8b68('0x5b')];for(var _0x595942=0x0;_0x595942<_0x163fd5[_0x8b68('0x5c')][_0x8b68('0x42')];_0x595942++){var _0x51bf1b=_0x163fd5[_0x8b68('0x5c')][_0x595942];var _0x735e17='i';var _0x48f886=_['find'](_0x120b34,['name',_0x51bf1b[_0x8b68('0x47')]]);if(!_0x48f886){switch(_0x51bf1b[_0x8b68('0x47')]){case _0x8b68('0x5d'):if(_0x51bf1b[_0x8b68('0x5e')]==0x1){_0xae2c2a['having']('`'+_0x51bf1b['field']+_0x8b68('0x5f'));}else{_0xae2c2a[_0x8b68('0x60')]('`'+_0x51bf1b[_0x8b68('0x47')]+'`\x20>\x200');}break;case _0x8b68('0x61'):if(_0x51bf1b[_0x8b68('0x62')]===_0x8b68('0x63')){if(_0x51bf1b['value'][_0x8b68('0x64')]('\x20')['length']>0x1){_0x34047c[_0x429ebb](_0x8b68('0x65'),qs[_0x8b68('0x66')](_0x51bf1b['value']),null);}else{var _0xba7139='%'+_0x51bf1b[_0x8b68('0x5e')]+'%';_0x34047c[_0x429ebb](_0x8b68('0x67'),_0xba7139,_0xba7139,_0xba7139);}}else{_0x48f886=_[_0x8b68('0x68')](_0x120b34,[_0x8b68('0x3c'),'ContactId']);_0x51bf1b[_0x8b68('0x47')]=_0x8b68('0x69');_0x401c20=as[_0x8b68('0x6a')](_0x735e17,_0x48f886[_0x8b68('0x39')],_0x51bf1b);_0x34047c[_0x429ebb](_0x401c20[_0x8b68('0x6b')],_0x401c20[_0x8b68('0x5e')][_0x8b68('0x6c')],_0x401c20[_0x8b68('0x5e')]['end']);}break;case _0x8b68('0x6d'):var _0x1a85da=_0x51bf1b[_0x8b68('0x5e')][_0x8b68('0x64')](',')[_0x8b68('0x30')](function(_0x4677b6){return Number(_0x4677b6);});_0x1a85da[_0x8b68('0x34')](function(_0x37c4cb){_0x522f47['or'](_0x8b68('0x6e'),'%,'+_0x37c4cb+',%');});_0x49e279=_[_0x8b68('0x6f')](_0x49e279,_0x1a85da);break;case _0x8b68('0x70'):if(_0x51bf1b[_0x8b68('0x62')]===_0x8b68('0x63')){_0x34047c[_0x429ebb](_0x8b68('0x71'),'%'+_0x51bf1b[_0x8b68('0x5e')]+'%',null);}else{_0x48f886=_[_0x8b68('0x68')](_0x120b34,[_0x8b68('0x3c'),_0x8b68('0x72')]);_0x51bf1b[_0x8b68('0x47')]=_0x8b68('0x72');_0x401c20=as['buildExpression'](_0x735e17,_0x48f886[_0x8b68('0x39')],_0x51bf1b);_0x34047c[_0x429ebb](_0x401c20['text'],_0x401c20['value'][_0x8b68('0x6c')],_0x401c20['value'][_0x8b68('0x2d')]);}break;case _0x8b68('0x73'):_0x401c20=as[_0x8b68('0x6a')]('me',null,_0x51bf1b);_0x34047c[_0x429ebb](_0x401c20['text'],_0x401c20[_0x8b68('0x5e')][_0x8b68('0x6c')],_0x401c20[_0x8b68('0x5e')][_0x8b68('0x2d')]);break;}}else{var _0x401c20=as[_0x8b68('0x6a')](_0x735e17,_0x48f886[_0x8b68('0x39')],_0x51bf1b);_0x34047c[_0x429ebb](_0x401c20['text'],_0x401c20['value'][_0x8b68('0x6c')],_0x401c20[_0x8b68('0x5e')][_0x8b68('0x2d')]);}}}else{var _0x371526=_(_0x439d36[_0x8b68('0x3d')])[_0x8b68('0x3e')]()[_0x8b68('0x30')](function(_0x314f1e){return _[_0x8b68('0x74')](_0x120b34,[_0x8b68('0x3c'),_0x314f1e])?_0x314f1e:undefined;})[_0x8b68('0x75')]()[_0x8b68('0x5e')]();if(!_[_0x8b68('0x76')](_0x371526)){_0x371526[_0x8b68('0x34')](function(_0x38fedf){if(_0x38fedf===_0x8b68('0x77')){_0xae2c2a[_0x8b68('0x45')](_0x8b68('0x78'),[]['concat'](_0x439d36['query'][_0x38fedf]));}else if(_0x38fedf===_0x8b68('0x79')){var _0x23e01a=JSON['parse'](_0x439d36['query'][_0x38fedf])['$gte'];var _0x39a04e=JSON[_0x8b68('0x7a')](_0x439d36[_0x8b68('0x3d')][_0x38fedf])[_0x8b68('0x7b')];_0xae2c2a[_0x8b68('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x23e01a,_0x39a04e);}else{if(_0x439d36[_0x8b68('0x3d')][_0x38fedf]===_0x8b68('0x7c')){_0xae2c2a['where']('i.'+_0x38fedf+_0x8b68('0x7d'));}else{_0xae2c2a['where']('i.'+_0x38fedf+'\x20=\x20?',_0x439d36['query'][_0x38fedf]);}}});}if(_0x439d36[_0x8b68('0x3d')][_0x8b68('0x7e')]){if(_0x439d36[_0x8b68('0x3d')][_0x8b68('0x7e')]==0x1){_0xae2c2a[_0x8b68('0x60')](_0x8b68('0x7f'));}else{_0xae2c2a[_0x8b68('0x60')](_0x8b68('0x80'));}}if(_0x439d36[_0x8b68('0x3d')][_0x8b68('0x81')]){_0x49e279=_['isArray'](_0x439d36[_0x8b68('0x3d')][_0x8b68('0x81')])?_0x439d36[_0x8b68('0x3d')]['tag']:new Array(_0x439d36['query'][_0x8b68('0x81')]);_0x49e279[_0x8b68('0x34')](function(_0x525b41){_0x522f47['or'](_0x8b68('0x6e'),'%,'+_0x525b41+',%');});}if(_0x439d36[_0x8b68('0x3d')][_0x8b68('0x82')]){var _0x2c2f6d=_0x439d36['query'][_0x8b68('0x82')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x8b68('0x83'));if(qs['isNumeric'](_0x2c2f6d)){_0x34047c['or'](_0x8b68('0x84'),_0x2c2f6d+'%')['or'](_0x8b68('0x85'),_0x2c2f6d+'%');}else{_0x34047c['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8b68('0x66')](_0x2c2f6d))['or'](_0x8b68('0x86'),_0x2c2f6d+'%');}}}_0xae2c2a[_0x8b68('0x45')](_0x34047c);_0xae2c2a[_0x8b68('0x87')](_0x8b68('0x88'));var _0x4afa60={'type':db[_0x8b68('0x89')][_0x8b68('0x8a')][_0x8b68('0x8b')],'raw':!![]};var _0x2f87e8=_0xae2c2a[_0x8b68('0x8c')]();_0x2f87e8['field']('i.id');_0x2f87e8[_0x8b68('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8b68('0x5d'));if(_0x151277[_0x8b68('0x8d')]){_0x151277[_0x8b68('0x8d')][_0x8b68('0x34')](function(_0x3f3b31){_0xae2c2a[_0x8b68('0x8d')]('i.'+_0x3f3b31[0x0],_0x3f3b31[0x1]===_0x8b68('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x49e279)){_0xae2c2a[_0x8b68('0x60')](_0x522f47);_0x2f87e8['where'](_0x8b68('0x8f'),_0x49e279);}BPromise[_0x8b68('0x90')]()[_0x8b68('0x2b')](function(){if(!_0x163fd5){if(_0x439d36['query'][_0x8b68('0x77')]||_0x439d36['query'][_0x8b68('0x91')])return;_0x2f87e8['where'](_0x8b68('0x92'));_0xae2c2a[_0x8b68('0x45')](_0x8b68('0x92'));return;}return _0x439d36['user'][_0x8b68('0x93')]({'attributes':['id'],'raw':!![]})[_0x8b68('0x2b')](function(_0x3d8a44){if(_[_0x8b68('0x76')](_0x3d8a44)){_0x2f87e8[_0x8b68('0x45')](_0x8b68('0x94'));_0xae2c2a[_0x8b68('0x45')](_0x8b68('0x94'));}else{_0x2f87e8[_0x8b68('0x45')]('i.SmsAccountId\x20IN\x20?',_[_0x8b68('0x30')](_0x3d8a44,'id'));_0xae2c2a[_0x8b68('0x45')](_0x8b68('0x78'),_[_0x8b68('0x30')](_0x3d8a44,'id'));}});})[_0x8b68('0x2b')](function(){db['sequelize'][_0x8b68('0x3d')](_0x2f87e8['toString'](),_0x4afa60)[_0x8b68('0x2b')](function(_0x2de166){_0x2a7dd5['count']=_0x2de166[_0x8b68('0x42')];if(_0x2a7dd5[_0x8b68('0x23')]===0x0)return[];return db[_0x8b68('0x95')]['query'](_0x5ae345[_0x8b68('0x96')](),_0x4afa60)[_0x8b68('0x2b')](function(_0x43a874){_0x2f90d9=_[_0x8b68('0x97')](_0x43a874,'id');_0x4afa60=_[_0x8b68('0x98')](_0x4afa60,{'model':db[_0x8b68('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x439d36['query'][_0x8b68('0x41')]){_0x151277[_0x8b68('0x40')][_0x8b68('0x34')](function(_0x4e5d13){_0xae2c2a[_0x8b68('0x47')]('i.'+_0x4e5d13);});}else{_0xae2c2a[_0x8b68('0x47')](_0x8b68('0x99'),_0x8b68('0x5d'));_0xae2c2a[_0x8b68('0x47')](_0x8b68('0x9a'),_0x8b68('0x9b'));_0xae2c2a[_0x8b68('0x47')](_0x8b68('0x9c'),_0x8b68('0x9d'));_0xae2c2a[_0x8b68('0x47')]('i.*');_0xae2c2a['field'](_0x8b68('0x9e'),_0x8b68('0x9f'));_0xae2c2a[_0x8b68('0x47')](_0x8b68('0xa0'),_0x8b68('0xa1'));_0xae2c2a['field'](_0x8b68('0xa2'),_0x8b68('0xa3'));_0xae2c2a[_0x8b68('0x47')](_0x8b68('0xa4'),'Contact.phone');_0xae2c2a['field'](_0x8b68('0xa5'),_0x8b68('0xa6'));_0xae2c2a[_0x8b68('0x47')](_0x8b68('0xa7'),_0x8b68('0xa8'));_0xae2c2a[_0x8b68('0x47')](_0x8b68('0xa9'),_0x8b68('0xaa'));_0xae2c2a['field'](_0x8b68('0xab'),_0x8b68('0xac'));_0xae2c2a[_0x8b68('0x47')](_0x8b68('0xad'),_0x8b68('0x33'));}if(_0x151277[_0x8b68('0x25')])_0xae2c2a['limit'](_0x151277[_0x8b68('0x25')]);if(_0x151277[_0x8b68('0x24')])_0xae2c2a[_0x8b68('0x24')](_0x151277['offset']);return db[_0x8b68('0x95')]['query'](_0xae2c2a[_0x8b68('0x96')](),_0x4afa60);})['then'](function(_0x21399f){_0x58a5e3[_0x8b68('0x45')](_0x8b68('0xae'),_[_0x8b68('0x30')](_0x21399f,'id'));return db[_0x8b68('0x95')][_0x8b68('0x3d')](_0x58a5e3['toString'](),_0x4afa60)['then'](function(_0x58e99a){var _0xa20bfd=_[_0x8b68('0xaf')](_0x58e99a,_0x8b68('0xb0'));var _0x198b79=[];_0x21399f[_0x8b68('0x34')](function(_0x401229){_0x198b79[_0x8b68('0xb1')](updateSmsInteraction(_0x401229,_0x2f90d9,_0xa20bfd));});return BPromise[_0x8b68('0xb2')](_0x198b79);});});})[_0x8b68('0x2b')](function(_0x60f6e5){_0x2a7dd5[_0x8b68('0xb3')]=_0x60f6e5;return _0x2a7dd5;})[_0x8b68('0x2b')](respondWithFilteredResult(_0x10aca9,_0x151277));})[_0x8b68('0x35')](handleError(_0x10aca9,null));};exports[_0x8b68('0xb4')]=function(_0x322e3c,_0x5e76ac){var _0x4b5045={'raw':![],'where':{'id':_0x322e3c[_0x8b68('0xb5')]['id']}},_0x5b042c={};_0x5b042c[_0x8b68('0x3b')]=_[_0x8b68('0x3e')](db[_0x8b68('0x37')][_0x8b68('0x38')]);_0x5b042c['query']=_[_0x8b68('0x3e')](_0x322e3c['query']);_0x5b042c[_0x8b68('0xb6')]=_['intersection'](_0x5b042c[_0x8b68('0x3b')],_0x5b042c['query']);_0x4b5045[_0x8b68('0x40')]=_['intersection'](_0x5b042c[_0x8b68('0x3b')],qs[_0x8b68('0x41')](_0x322e3c['query'][_0x8b68('0x41')]));_0x4b5045[_0x8b68('0x40')]=_0x4b5045['attributes'][_0x8b68('0x42')]?_0x4b5045['attributes']:_0x5b042c[_0x8b68('0x3b')];if(_0x322e3c['query'][_0x8b68('0xb7')]){_0x4b5045[_0x8b68('0xb8')]=[{'all':!![]}];}_0x4b5045=_[_0x8b68('0x98')]({},_0x4b5045,_0x322e3c[_0x8b68('0xb9')]);return db[_0x8b68('0x37')][_0x8b68('0x68')](_0x4b5045)[_0x8b68('0x2b')](handleEntityNotFound(_0x5e76ac,null))['then'](respondWithResult(_0x5e76ac,null))[_0x8b68('0x35')](handleError(_0x5e76ac,null));};exports[_0x8b68('0xba')]=function(_0x1e34f8,_0x22c8cb){return db[_0x8b68('0x37')][_0x8b68('0xba')](_0x1e34f8[_0x8b68('0x73')],{})[_0x8b68('0x2b')](respondWithResult(_0x22c8cb,0xc9))[_0x8b68('0x35')](handleError(_0x22c8cb,null));};exports[_0x8b68('0x2a')]=function(_0x334bdc,_0x18305f){if(_0x334bdc[_0x8b68('0x73')]['id']){delete _0x334bdc[_0x8b68('0x73')]['id'];}return db['SmsInteraction'][_0x8b68('0x68')]({'where':{'id':_0x334bdc[_0x8b68('0xb5')]['id']}})[_0x8b68('0x2b')](handleEntityNotFound(_0x18305f,null))[_0x8b68('0x2b')](saveUpdates(_0x334bdc[_0x8b68('0x73')],null))[_0x8b68('0x2b')](respondWithResult(_0x18305f,null))['catch'](handleError(_0x18305f,null));};exports[_0x8b68('0x2c')]=function(_0x2433a5,_0x3a24f8){return db[_0x8b68('0x37')][_0x8b68('0x68')]({'where':{'id':_0x2433a5[_0x8b68('0xb5')]['id']}})[_0x8b68('0x2b')](handleEntityNotFound(_0x3a24f8,null))[_0x8b68('0x2b')](removeEntity(_0x3a24f8,null))[_0x8b68('0x35')](handleError(_0x3a24f8,null));};exports['describe']=function(_0x31d70c,_0x4df181){return db['SmsInteraction']['describe']()[_0x8b68('0x2b')](respondWithResult(_0x4df181,null))[_0x8b68('0x35')](handleError(_0x4df181,null));};exports['addMessage']=function(_0x39258e,_0x1dba7b,_0x56f8af){return db[_0x8b68('0xbb')][_0x8b68('0x68')]({'where':{'id':_0x39258e[_0x8b68('0xb5')]['id']}})[_0x8b68('0x2b')](handleEntityNotFound(_0x1dba7b,null))[_0x8b68('0x2b')](function(_0x14bbfc){if(_0x14bbfc){return _0x14bbfc[_0x8b68('0xbc')](_0x39258e['body'][_0x8b68('0xbd')],_[_0x8b68('0xbe')](_0x39258e['body'],[_0x8b68('0xbd'),'id'])||{});}})[_0x8b68('0x2b')](respondWithResult(_0x1dba7b,null))['catch'](handleError(_0x1dba7b,null));};exports['getMessages']=function(_0x798a24,_0xed7a85,_0x2f62ab){var _0x1c5aaa={'raw':![],'where':{}};var _0x20d8ff={};var _0x15897a={'count':0x0,'rows':[]};return db[_0x8b68('0x37')][_0x8b68('0xbf')]({'where':{'id':_0x798a24['params']['id']}})[_0x8b68('0x2b')](handleEntityNotFound(_0xed7a85,null))['then'](function(_0x4d26aa){if(_0x4d26aa){_0x20d8ff[_0x8b68('0x3b')]=_[_0x8b68('0x3e')](db['SmsMessage'][_0x8b68('0x38')]);_0x20d8ff['query']=_[_0x8b68('0x3e')](_0x798a24[_0x8b68('0x3d')]);_0x20d8ff[_0x8b68('0xb6')]=_['intersection'](_0x20d8ff[_0x8b68('0x3b')],_0x20d8ff['query']);_0x1c5aaa['attributes']=_[_0x8b68('0x3f')](_0x20d8ff[_0x8b68('0x3b')],qs[_0x8b68('0x41')](_0x798a24[_0x8b68('0x3d')][_0x8b68('0x41')]));_0x1c5aaa[_0x8b68('0x40')]=_0x1c5aaa[_0x8b68('0x40')]['length']?_0x1c5aaa[_0x8b68('0x40')]:_0x20d8ff[_0x8b68('0x3b')];if(!_0x798a24[_0x8b68('0x3d')][_0x8b68('0x43')](_0x8b68('0xc0'))){_0x1c5aaa[_0x8b68('0x25')]=qs[_0x8b68('0x25')](_0x798a24['query'][_0x8b68('0x25')]);_0x1c5aaa[_0x8b68('0x24')]=qs['offset'](_0x798a24['query'][_0x8b68('0x24')]);}_0x1c5aaa[_0x8b68('0x8d')]=qs['sort'](_0x798a24[_0x8b68('0x3d')][_0x8b68('0x44')]);_0x1c5aaa[_0x8b68('0x45')]=qs[_0x8b68('0xb6')](_[_0x8b68('0x46')](_0x798a24[_0x8b68('0x3d')],_0x20d8ff[_0x8b68('0xb6')]));_0x1c5aaa['where'][_0x8b68('0xb0')]=_0x4d26aa['id'];if(_0x798a24[_0x8b68('0x3d')][_0x8b68('0x82')]){_0x1c5aaa['where']=_['merge'](_0x1c5aaa[_0x8b68('0x45')],{'$or':_[_0x8b68('0x30')](_0x1c5aaa[_0x8b68('0x40')],function(_0x54d99a){var _0x4c8fb8={};_0x4c8fb8[_0x54d99a]={'$like':'%'+_0x798a24[_0x8b68('0x3d')][_0x8b68('0x82')]+'%'};return _0x4c8fb8;})});}if(_0x798a24[_0x8b68('0x3d')]['$gte']){var _0x48e035=_0x798a24['query'][_0x8b68('0xc1')][_0x8b68('0x64')](',');var _0xb1e53c={};_0xb1e53c[_0x48e035[0x0]]={'$gte':moment(_0x48e035[0x1])[_0x8b68('0xc2')](_0x8b68('0xc3'))};_0x1c5aaa['where']=_['merge'](_0x1c5aaa[_0x8b68('0x45')],_0xb1e53c);}_0x1c5aaa=_['merge']({},_0x1c5aaa,_0x798a24['options']);return db['SmsMessage'][_0x8b68('0x23')]({'where':_0x1c5aaa[_0x8b68('0x45')]})[_0x8b68('0x2b')](function(_0x53602b){_0x15897a[_0x8b68('0x23')]=_0x53602b;if(_0x798a24['query'][_0x8b68('0xb7')]){_0x1c5aaa[_0x8b68('0xb8')]=[{'all':!![]}];}return db[_0x8b68('0xbb')][_0x8b68('0xc4')](_0x1c5aaa);})[_0x8b68('0x2b')](function(_0x8beb27){_0x15897a[_0x8b68('0xb3')]=_0x8beb27;return _0x15897a;});}})[_0x8b68('0x2b')](respondWithFilteredResult(_0xed7a85,_0x1c5aaa))[_0x8b68('0x35')](handleError(_0xed7a85,null));};exports[_0x8b68('0xc5')]=function(_0x25e8cd,_0x14e073,_0x21e601){return db[_0x8b68('0x37')][_0x8b68('0x68')]({'where':{'id':_0x25e8cd[_0x8b68('0xb5')]['id']}})[_0x8b68('0x2b')](handleEntityNotFound(_0x14e073,null))[_0x8b68('0x2b')](function(_0x1bf8fb){if(_0x1bf8fb){return _0x1bf8fb['setTags'](_0x25e8cd[_0x8b68('0x73')]['ids'],_[_0x8b68('0xbe')](_0x25e8cd[_0x8b68('0x73')],[_0x8b68('0xbd'),'id'])||{})[_0x8b68('0xc6')](function(){return db[_0x8b68('0x6d')][_0x8b68('0xc4')]({'attributes':['id',_0x8b68('0x3c'),_0x8b68('0x48')],'where':{'id':_0x25e8cd[_0x8b68('0x73')][_0x8b68('0xbd')]}});})[_0x8b68('0x2b')](function(_0x477cd1){socket['emit'](_0x8b68('0xc7'),{'id':Number(_0x25e8cd[_0x8b68('0xb5')]['id']),'tags':_0x477cd1||[]});return{'id':Number(_0x25e8cd[_0x8b68('0xb5')]['id']),'tags':_0x477cd1||[]};});}})[_0x8b68('0x2b')](respondWithResult(_0x14e073,null))[_0x8b68('0x35')](handleError(_0x14e073,null));};exports[_0x8b68('0xc8')]=function(_0x16eea0,_0x45b488,_0x3a3f59){return db[_0x8b68('0x37')][_0x8b68('0x68')]({'where':{'id':_0x16eea0['params']['id']}})[_0x8b68('0x2b')](handleEntityNotFound(_0x45b488,null))[_0x8b68('0x2b')](function(_0x17251d){if(_0x17251d){return _0x17251d[_0x8b68('0xc8')](_0x16eea0[_0x8b68('0x3d')]['ids']);}})[_0x8b68('0x2b')](respondWithStatusCode(_0x45b488,null))[_0x8b68('0x35')](handleError(_0x45b488,null));};exports['download']=function(_0x14021d,_0x420ed6){var _0x4a524e=moment()['unix']()[_0x8b68('0x96')]();var _0x25684b=path[_0x8b68('0xc9')](config[_0x8b68('0xca')],_0x8b68('0xcb'),_0x8b68('0xcc'),_0x8b68('0xcd'));var _0x44fa68=path['join'](config[_0x8b68('0xca')],_0x8b68('0xcb'),_0x8b68('0xcc'),_0x8b68('0xce'));var _0x5124b2=path[_0x8b68('0xc9')](_0x25684b,_0x4a524e);var _0x5df8a1=util[_0x8b68('0xc2')](_0x8b68('0xcf'),_0x14021d[_0x8b68('0xb5')]['id'],_0x4a524e);var _0x3c2fb6=path[_0x8b68('0xc9')](_0x25684b,_0x5df8a1);var _0x2f92d1=[];_0x2f92d1['push']({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x2f92d1['push']({'model':db[_0x8b68('0xd0')],'as':_0x8b68('0x61'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x416662=[{'model':db[_0x8b68('0xbb')],'as':'Messages','attributes':['id',_0x8b68('0x73'),_0x8b68('0x79'),'direction','secret',_0x8b68('0x7e')],'include':_0x2f92d1}];_0x416662[_0x8b68('0xb1')]({'model':db[_0x8b68('0xd1')],'as':_0x8b68('0xd2'),'attributes':['id',_0x8b68('0x3c')]});_0x416662[_0x8b68('0xb1')]({'model':db[_0x8b68('0x70')],'as':_0x8b68('0xd3'),'attributes':['id','fullname']});return db[_0x8b68('0x37')][_0x8b68('0x68')]({'where':{'id':_0x14021d[_0x8b68('0xb5')]['id']},'include':_0x416662})[_0x8b68('0x2b')](handleEntityNotFound(_0x420ed6,null))[_0x8b68('0x2b')](function(_0x54bac7){if(_0x54bac7){var _0x4442a9=_0x54bac7['get']({'plain':!![]});fs[_0x8b68('0xd4')](_0x5124b2);var _0x5c5190={'format':'A4','border':_0x8b68('0xd5'),'header':{'height':_0x8b68('0xd6'),'contents':{'first':_0x8b68('0xd7')}},'footer':{'height':'30px','contents':{'default':util[_0x8b68('0xc2')]('<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>',util[_0x8b68('0xc2')](_0x8b68('0xd8'),_0x8b68('0xd9'),_0x4442a9['id']),moment()[_0x8b68('0xc2')]('YYYY-MM-DD')[_0x8b68('0x96')]())}}};var _0x1b12a6={'channel':_0x8b68('0xd9'),'account':_0x4442a9[_0x8b68('0xd2')][_0x8b68('0x3c')],'agent':_0x4442a9[_0x8b68('0xd3')]?_0x4442a9[_0x8b68('0xd3')][_0x8b68('0x31')]:_0x8b68('0xda'),'createdAt':moment(_0x4442a9[_0x8b68('0x79')])[_0x8b68('0xc2')](_0x8b68('0xc3'))[_0x8b68('0x96')](),'closedAt':_0x4442a9[_0x8b68('0xdb')]?moment(_0x4442a9[_0x8b68('0xdc')])[_0x8b68('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8b68('0x96')]():'','disposition':_0x4442a9['disposition'],'messages':_(_0x4442a9[_0x8b68('0xdd')])[_0x8b68('0x82')]({'secret':![]})[_0x8b68('0x30')](function(_0x44f4a9){return{'date':moment(_0x44f4a9[_0x8b68('0x79')])[_0x8b68('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x44f4a9['direction']===_0x8b68('0xde')?_0x44f4a9[_0x8b68('0x70')]?_0x44f4a9[_0x8b68('0x70')][_0x8b68('0x31')]:_0x8b68('0xdf'):_0x44f4a9[_0x8b68('0x61')][_0x8b68('0xe0')]+(_0x44f4a9[_0x8b68('0x61')][_0x8b68('0xe1')]?'\x20'+_0x44f4a9[_0x8b68('0x61')]['lastName']:''),'body':_0x44f4a9['body'],'direction':_0x44f4a9[_0x8b68('0xe2')]==='out'?'A':'C','secret':_0x44f4a9[_0x8b68('0xe3')],'read':_0x44f4a9[_0x8b68('0x7e')]};})[_0x8b68('0x5e')]()};return ejs[_0x8b68('0xe4')](path[_0x8b68('0xc9')](config[_0x8b68('0xca')],_0x8b68('0xcb'),'views','downloadInteraction.html'),{'interaction':_0x1b12a6})[_0x8b68('0x2b')](function(_0x475c22){return new BPromise(function(_0x271be8,_0x2da7fa){pdf[_0x8b68('0xba')](_0x475c22,_0x5c5190)['toFile'](path[_0x8b68('0xc9')](_0x5124b2,_0x8b68('0xe5')+_0x4442a9['id']+'-'+_0x4a524e+_0x8b68('0xe6')),function(_0x28e5f1,_0x13896b){if(_0x28e5f1)return _0x2da7fa(_0x28e5f1);_0x271be8(_0x13896b);});});})['then'](function(){return new BPromise(function(_0x9d6042,_0x309c7b){zipdir(_0x5124b2,{'saveTo':_0x3c2fb6},function(_0x2df561,_0x3dae61){if(_0x2df561)return _0x309c7b(_0x2df561);return _0x9d6042(_0x3dae61);});})[_0x8b68('0x2b')](function(){return new BPromise(function(_0x5b85a6,_0x2489fa){rimraf(_0x5124b2,function(_0x564e76){if(_0x564e76)_0x2489fa(_0x564e76);return _0x5b85a6();});});})[_0x8b68('0x2b')](function(){return _0x420ed6[_0x8b68('0xe7')](_0x3c2fb6,_0x5df8a1,function(_0x55f08d){if(_0x55f08d){console[_0x8b68('0xe8')](_0x8b68('0xe9'),_0x55f08d);}else{fs[_0x8b68('0xea')](_0x3c2fb6);}});});});}else{return _0x420ed6['sendStatus'](0xc8);}})[_0x8b68('0x35')](handleError(_0x420ed6,null));};
\ No newline at end of file
+var _0x4e81=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','index','SmsInteraction','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','users','left_join','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','\x20IS\x20NULL','read','isArray','tag','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','sequelize','toString','keyBy','merge','a.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','params','rawAttributes','includeAll','options','create','destroy','describe','SmsMessage','addMessage','ids','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','setTags','omit','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','transcript-%d-%s.zip','CmContact','lastName','direction','secret','Owner','get','10px','40px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','%s\x20#%d','Sms','N.A.','closed','closedAt','disposition','out','firstName','renderFile','views','transcript-','.pdf','log','err','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x4e81,0x1bc));var _0x14e8=function(_0x403fc7,_0x32931a){_0x403fc7=_0x403fc7-0x0;var _0x5d0827=_0x4e81[_0x403fc7];return _0x5d0827;};'use strict';var pdf=require(_0x14e8('0x0'));var emlformat=require(_0x14e8('0x1'));var rimraf=require(_0x14e8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x14e8('0x3'));var BPromise=require(_0x14e8('0x4'));var Mustache=require(_0x14e8('0x5'));var util=require(_0x14e8('0x6'));var path=require(_0x14e8('0x7'));var sox=require(_0x14e8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0xe'));var querystring=require(_0x14e8('0xf'));var Papa=require(_0x14e8('0x10'));var Redis=require(_0x14e8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x12'));var as=require(_0x14e8('0x13'));var hardwareService=require(_0x14e8('0x14'));var logger=require(_0x14e8('0x15'))(_0x14e8('0x16'));var utils=require(_0x14e8('0x17'));var config=require(_0x14e8('0x18'));var db=require(_0x14e8('0x19'))['db'];config['redis']=_[_0x14e8('0x1a')](config['redis'],{'host':_0x14e8('0x1b'),'port':0x18eb});var socket=require(_0x14e8('0x1c'))(new Redis(config[_0x14e8('0x1d')]));require('./smsInteraction.socket')[_0x14e8('0x1e')](socket);function respondWithStatusCode(_0x4e1064,_0x458e4a){_0x458e4a=_0x458e4a||0xcc;return function(_0x58d26e){if(_0x58d26e){return _0x4e1064[_0x14e8('0x1f')](_0x458e4a);}return _0x4e1064[_0x14e8('0x20')](_0x458e4a)[_0x14e8('0x21')]();};}function respondWithResult(_0x135996,_0x52e64f){_0x52e64f=_0x52e64f||0xc8;return function(_0x10c4a9){if(_0x10c4a9){return _0x135996[_0x14e8('0x20')](_0x52e64f)[_0x14e8('0x22')](_0x10c4a9);}};}function respondWithFilteredResult(_0x412c0a,_0xd4d6b2){return function(_0x1f1a0d){if(_0x1f1a0d){var _0x10dc8b=_0x1f1a0d[_0x14e8('0x23')],_0x462259=_0xd4d6b2[_0x14e8('0x24')],_0x5a38c1=_0xd4d6b2[_0x14e8('0x24')]+_0xd4d6b2[_0x14e8('0x25')],_0x328c5a;if(_0x5a38c1>=_0x10dc8b){_0x5a38c1=_0x10dc8b;_0x328c5a=0xc8;}else{_0x328c5a=0xce;}_0x412c0a['status'](_0x328c5a);return _0x412c0a[_0x14e8('0x26')](_0x14e8('0x27'),_0x462259+'-'+_0x5a38c1+'/'+_0x10dc8b)[_0x14e8('0x22')](_0x1f1a0d);}return null;};}function patchUpdates(_0x48e30a){return function(_0x2c3f45){try{jsonpatch['apply'](_0x2c3f45,_0x48e30a,!![]);}catch(_0x4cca43){return BPromise[_0x14e8('0x28')](_0x4cca43);}return _0x2c3f45[_0x14e8('0x29')]();};}function saveUpdates(_0x117b00,_0xcf673){return function(_0x4ad25d){if(_0x4ad25d){return _0x4ad25d[_0x14e8('0x2a')](_0x117b00)['then'](function(_0x31bdd3){return _0x31bdd3;});}return null;};}function removeEntity(_0x185a0e,_0x4ffc8b){return function(_0x58a3a1){if(_0x58a3a1){return _0x58a3a1['destroy']()[_0x14e8('0x2b')](function(){_0x185a0e[_0x14e8('0x20')](0xcc)[_0x14e8('0x21')]();});}};}function handleEntityNotFound(_0x20bfe8,_0x333d44){return function(_0x57eb46){if(!_0x57eb46){_0x20bfe8[_0x14e8('0x1f')](0x194);}return _0x57eb46;};}function handleError(_0x3fd96d,_0x3c09cb){_0x3c09cb=_0x3c09cb||0x1f4;return function(_0x2f5818){logger[_0x14e8('0x2c')](_0x2f5818[_0x14e8('0x2d')]);if(_0x2f5818[_0x14e8('0x2e')]){delete _0x2f5818['name'];}_0x3fd96d[_0x14e8('0x20')](_0x3c09cb)[_0x14e8('0x2f')](_0x2f5818);};}function getInteractionUsers(_0x393ab0,_0x5f5abb){return new BPromise(function(_0x48eed0,_0x5cacd7){try{if(_0x5f5abb[_0x393ab0['id']]){_0x393ab0[_0x14e8('0x30')]=_[_0x14e8('0x31')](_0x5f5abb[_0x393ab0['id']],function(_0x567385){return{'id':_0x567385['id'],'fullname':_0x567385[_0x14e8('0x32')]};});}}catch(_0x1d71ca){_0x5cacd7(_0x1d71ca);}_0x48eed0(_0x393ab0);});}function getInteractionTags(_0x176e8f,_0xa83433){return new BPromise(function(_0x5c2635,_0x1f1259){try{if(_0x176e8f[_0x14e8('0x33')]){_0x176e8f[_0x14e8('0x34')]=[];_0x176e8f[_0x14e8('0x33')][_0x14e8('0x35')](',')['forEach'](function(_0x2f83c3){_0x176e8f[_0x14e8('0x34')][_0x14e8('0x36')](_0xa83433[_0x2f83c3]);});}delete _0x176e8f[_0x14e8('0x33')];}catch(_0x538764){_0x1f1259(_0x538764);}_0x5c2635(_0x176e8f);});}function updateSmsInteraction(_0xbb8003,_0x4fe501,_0x14a038){return new BPromise(function(_0x44c6fb,_0x1f4876){return getInteractionUsers(_0xbb8003,_0x14a038)[_0x14e8('0x2b')](function(_0x17fc40){return getInteractionTags(_0x17fc40,_0x4fe501);})[_0x14e8('0x2b')](function(_0xbe9eab){_0x44c6fb(_0xbe9eab);})[_0x14e8('0x37')](function(_0xd144b){_0x1f4876(_0xd144b);});});}exports[_0x14e8('0x38')]=function(_0x13dec7,_0x4411e9){var _0x54e624={},_0x54ff6d={},_0x4dac15={'count':0x0,'rows':[]};var _0x16ff09=_['map'](db[_0x14e8('0x39')]['rawAttributes'],function(_0x16afca){return{'name':_0x16afca[_0x14e8('0x3a')],'type':_0x16afca[_0x14e8('0x3b')][_0x14e8('0x3c')]};});_0x54ff6d['model']=_[_0x14e8('0x31')](_0x16ff09,'name');_0x54ff6d[_0x14e8('0x3d')]=_[_0x14e8('0x3e')](_0x13dec7[_0x14e8('0x3d')]);_0x54ff6d[_0x14e8('0x3f')]=_[_0x14e8('0x40')](_0x54ff6d[_0x14e8('0x41')],_0x54ff6d['query']);_0x54e624[_0x14e8('0x42')]=_['intersection'](_0x54ff6d[_0x14e8('0x41')],qs[_0x14e8('0x43')](_0x13dec7[_0x14e8('0x3d')]['fields']));_0x54e624[_0x14e8('0x42')]=_0x54e624[_0x14e8('0x42')]['length']?_0x54e624[_0x14e8('0x42')]:_0x54ff6d[_0x14e8('0x41')];if(!_0x13dec7[_0x14e8('0x3d')][_0x14e8('0x44')](_0x14e8('0x45'))){_0x54e624[_0x14e8('0x25')]=qs[_0x14e8('0x25')](_0x13dec7[_0x14e8('0x3d')][_0x14e8('0x25')]);_0x54e624[_0x14e8('0x24')]=qs[_0x14e8('0x24')](_0x13dec7[_0x14e8('0x3d')][_0x14e8('0x24')]);}_0x54e624[_0x14e8('0x46')]=qs[_0x14e8('0x47')](_0x13dec7['query'][_0x14e8('0x47')]);_0x54e624['where']=qs['filters'](_['pick'](_0x13dec7[_0x14e8('0x3d')],_0x54ff6d['filters']),_0x16ff09);var _0x46a3c4=[];var _0x45bff0=squel[_0x14e8('0x48')]()[_0x14e8('0x49')]('id')[_0x14e8('0x49')](_0x14e8('0x2e'))[_0x14e8('0x49')](_0x14e8('0x4a'))[_0x14e8('0x4b')](_0x14e8('0x4c'));var _0x6c3e1f=squel['select']()[_0x14e8('0x49')](_0x14e8('0x4d'))[_0x14e8('0x49')](_0x14e8('0x4e'))['field'](_0x14e8('0x4f'))[_0x14e8('0x4b')]('user_has_sms_interactions','ui')['left_join'](_0x14e8('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x58b609=squel[_0x14e8('0x48')]()[_0x14e8('0x4b')]('sms_interactions','i')[_0x14e8('0x51')](_0x14e8('0x52'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x14e8('0x51')](_0x14e8('0x50'),'o',_0x14e8('0x53'))[_0x14e8('0x51')](_0x14e8('0x54'),'a',_0x14e8('0x55'))[_0x14e8('0x51')](_0x14e8('0x56'),'me',_0x14e8('0x57'))[_0x14e8('0x51')](_0x14e8('0x58'),'it',_0x14e8('0x59'))[_0x14e8('0x51')](_0x14e8('0x4c'),'t',_0x14e8('0x5a'));var _0x1f50bc=squel['expr']();var _0x40aa43=[];var _0x49324a=squel[_0x14e8('0x5b')]();var _0x3fadc2;if(_0x13dec7[_0x14e8('0x3d')][_0x14e8('0x5c')]){_0x3fadc2=as['parseSearch'](_0x13dec7['query']['search']);var _0x291fe2=_0x3fadc2['sqlOperator'];for(var _0x55f9b0=0x0;_0x55f9b0<_0x3fadc2[_0x14e8('0x5d')][_0x14e8('0x5e')];_0x55f9b0++){var _0x590bcd=_0x3fadc2[_0x14e8('0x5d')][_0x55f9b0];var _0x27e319='i';var _0x7d6759=_[_0x14e8('0x5f')](_0x16ff09,['name',_0x590bcd['field']]);if(!_0x7d6759){switch(_0x590bcd[_0x14e8('0x49')]){case _0x14e8('0x60'):if(_0x590bcd[_0x14e8('0x61')]==0x1){_0x58b609[_0x14e8('0x62')]('`'+_0x590bcd[_0x14e8('0x49')]+_0x14e8('0x63'));}else{_0x58b609['having']('`'+_0x590bcd[_0x14e8('0x49')]+_0x14e8('0x64'));}break;case _0x14e8('0x65'):if(_0x590bcd[_0x14e8('0x66')]==='$substring'){if(_0x590bcd[_0x14e8('0x61')][_0x14e8('0x35')]('\x20')[_0x14e8('0x5e')]>0x1){_0x1f50bc[_0x291fe2](_0x14e8('0x67'),qs['getFullTextValue'](_0x590bcd[_0x14e8('0x61')]),null);}else{var _0x45020b='%'+_0x590bcd[_0x14e8('0x61')]+'%';_0x1f50bc[_0x291fe2](_0x14e8('0x68'),_0x45020b,_0x45020b,_0x45020b);}}else{_0x7d6759=_[_0x14e8('0x5f')](_0x16ff09,[_0x14e8('0x2e'),_0x14e8('0x69')]);_0x590bcd[_0x14e8('0x49')]='ContactId';_0x4848be=as['buildExpression'](_0x27e319,_0x7d6759[_0x14e8('0x3b')],_0x590bcd);_0x1f50bc[_0x291fe2](_0x4848be[_0x14e8('0x6a')],_0x4848be[_0x14e8('0x61')][_0x14e8('0x6b')],_0x4848be[_0x14e8('0x61')]['end']);}break;case'Tag':var _0x4c49e5=_0x590bcd[_0x14e8('0x61')][_0x14e8('0x35')](',')[_0x14e8('0x31')](function(_0x58e2a4){return Number(_0x58e2a4);});_0x4c49e5[_0x14e8('0x6c')](function(_0xbd38ae){_0x49324a['or'](_0x14e8('0x6d'),'%,'+_0xbd38ae+',%');});_0x40aa43=_['union'](_0x40aa43,_0x4c49e5);break;case _0x14e8('0x6e'):if(_0x590bcd[_0x14e8('0x66')]===_0x14e8('0x6f')){_0x1f50bc[_0x291fe2](_0x14e8('0x70'),'%'+_0x590bcd[_0x14e8('0x61')]+'%',null);}else{_0x7d6759=_[_0x14e8('0x5f')](_0x16ff09,[_0x14e8('0x2e'),_0x14e8('0x71')]);_0x590bcd[_0x14e8('0x49')]=_0x14e8('0x71');_0x4848be=as[_0x14e8('0x72')](_0x27e319,_0x7d6759['type'],_0x590bcd);_0x1f50bc[_0x291fe2](_0x4848be[_0x14e8('0x6a')],_0x4848be[_0x14e8('0x61')][_0x14e8('0x6b')],_0x4848be[_0x14e8('0x61')][_0x14e8('0x21')]);}break;case _0x14e8('0x73'):_0x4848be=as[_0x14e8('0x72')]('me',null,_0x590bcd);_0x1f50bc[_0x291fe2](_0x4848be[_0x14e8('0x6a')],_0x4848be[_0x14e8('0x61')][_0x14e8('0x6b')],_0x4848be[_0x14e8('0x61')][_0x14e8('0x21')]);break;}}else{var _0x4848be=as[_0x14e8('0x72')](_0x27e319,_0x7d6759[_0x14e8('0x3b')],_0x590bcd);_0x1f50bc[_0x291fe2](_0x4848be['text'],_0x4848be[_0x14e8('0x61')][_0x14e8('0x6b')],_0x4848be[_0x14e8('0x61')][_0x14e8('0x21')]);}}}else{var _0x3228ea=_(_0x13dec7[_0x14e8('0x3d')])[_0x14e8('0x3e')]()['map'](function(_0x4c30dd){return _['some'](_0x16ff09,[_0x14e8('0x2e'),_0x4c30dd])?_0x4c30dd:undefined;})[_0x14e8('0x74')]()[_0x14e8('0x61')]();if(!_[_0x14e8('0x75')](_0x3228ea)){_0x3228ea[_0x14e8('0x6c')](function(_0x369c3b){if(_0x369c3b===_0x14e8('0x76')){_0x58b609['where'](_0x14e8('0x77'),[][_0x14e8('0x78')](_0x13dec7['query'][_0x369c3b]));}else if(_0x369c3b===_0x14e8('0x79')){var _0x3a5602=JSON['parse'](_0x13dec7['query'][_0x369c3b])['$gte'];var _0x379734=JSON[_0x14e8('0x7a')](_0x13dec7[_0x14e8('0x3d')][_0x369c3b])[_0x14e8('0x7b')];_0x58b609['where'](_0x14e8('0x7c'),_0x3a5602,_0x379734);}else{if(_0x13dec7[_0x14e8('0x3d')][_0x369c3b]===_0x14e8('0x7d')){_0x58b609[_0x14e8('0x7e')]('i.'+_0x369c3b+_0x14e8('0x7f'));}else{_0x58b609[_0x14e8('0x7e')]('i.'+_0x369c3b+'\x20=\x20?',_0x13dec7[_0x14e8('0x3d')][_0x369c3b]);}}});}if(_0x13dec7[_0x14e8('0x3d')][_0x14e8('0x80')]){if(_0x13dec7['query']['read']==0x1){_0x58b609[_0x14e8('0x62')]('`unreadMessages`\x20=\x200');}else{_0x58b609[_0x14e8('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x13dec7[_0x14e8('0x3d')]['tag']){_0x40aa43=_[_0x14e8('0x81')](_0x13dec7[_0x14e8('0x3d')]['tag'])?_0x13dec7[_0x14e8('0x3d')][_0x14e8('0x82')]:new Array(_0x13dec7[_0x14e8('0x3d')][_0x14e8('0x82')]);_0x40aa43[_0x14e8('0x6c')](function(_0x6dee32){_0x49324a['or'](_0x14e8('0x6d'),'%,'+_0x6dee32+',%');});}if(_0x13dec7[_0x14e8('0x3d')][_0x14e8('0x83')]){var _0x3858cf=_0x13dec7[_0x14e8('0x3d')][_0x14e8('0x83')][_0x14e8('0x84')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x3858cf)){_0x1f50bc['or'](_0x14e8('0x85'),_0x3858cf+'%')['or'](_0x14e8('0x86'),_0x3858cf+'%');}else{_0x1f50bc['or'](_0x14e8('0x87'),qs['getFullTextValue'](_0x3858cf))['or'](_0x14e8('0x88'),_0x3858cf+'%');}}}_0x58b609['where'](_0x1f50bc);_0x58b609['group']('i.id');var _0x304328={'type':db[_0x14e8('0x89')][_0x14e8('0x8a')]['SELECT'],'raw':!![]};var _0xfc647b=_0x58b609['clone']();_0xfc647b[_0x14e8('0x49')](_0x14e8('0x8b'));_0xfc647b[_0x14e8('0x49')](_0x14e8('0x8c'),_0x14e8('0x60'));if(_0x54e624[_0x14e8('0x46')]){_0x54e624[_0x14e8('0x46')][_0x14e8('0x6c')](function(_0x25e26d){_0x58b609['order']('i.'+_0x25e26d[0x0],_0x25e26d[0x1]===_0x14e8('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x40aa43)){_0x58b609[_0x14e8('0x62')](_0x49324a);_0xfc647b[_0x14e8('0x7e')](_0x14e8('0x8e'),_0x40aa43);}BPromise[_0x14e8('0x8f')]()[_0x14e8('0x2b')](function(){if(!_0x3fadc2){if(_0x13dec7[_0x14e8('0x3d')][_0x14e8('0x76')]||_0x13dec7[_0x14e8('0x3d')][_0x14e8('0x90')])return;_0xfc647b['where'](_0x14e8('0x91'));_0x58b609[_0x14e8('0x7e')](_0x14e8('0x91'));return;}return _0x13dec7[_0x14e8('0x92')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x14e8('0x2b')](function(_0x21ead5){if(_[_0x14e8('0x75')](_0x21ead5)){_0xfc647b[_0x14e8('0x7e')]('i.SmsAccountId\x20IS\x20NULL');_0x58b609[_0x14e8('0x7e')]('i.SmsAccountId\x20IS\x20NULL');}else{_0xfc647b[_0x14e8('0x7e')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x21ead5,'id'));_0x58b609[_0x14e8('0x7e')](_0x14e8('0x77'),_[_0x14e8('0x31')](_0x21ead5,'id'));}});})[_0x14e8('0x2b')](function(){db[_0x14e8('0x93')][_0x14e8('0x3d')](_0xfc647b[_0x14e8('0x94')](),_0x304328)[_0x14e8('0x2b')](function(_0x14d4b7){_0x4dac15[_0x14e8('0x23')]=_0x14d4b7[_0x14e8('0x5e')];if(_0x4dac15['count']===0x0)return[];return db[_0x14e8('0x93')][_0x14e8('0x3d')](_0x45bff0[_0x14e8('0x94')](),_0x304328)['then'](function(_0x5a9e57){_0x46a3c4=_[_0x14e8('0x95')](_0x5a9e57,'id');_0x304328=_[_0x14e8('0x96')](_0x304328,{'model':db[_0x14e8('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13dec7[_0x14e8('0x3d')][_0x14e8('0x43')]){_0x54e624[_0x14e8('0x42')][_0x14e8('0x6c')](function(_0x196815){_0x58b609[_0x14e8('0x49')]('i.'+_0x196815);});}else{_0x58b609[_0x14e8('0x49')](_0x14e8('0x8c'),_0x14e8('0x60'));_0x58b609[_0x14e8('0x49')](_0x14e8('0x97'),'Account.key');_0x58b609[_0x14e8('0x49')]('a.mandatoryDisposition',_0x14e8('0x98'));_0x58b609[_0x14e8('0x49')](_0x14e8('0x99'));_0x58b609[_0x14e8('0x49')](_0x14e8('0x9a'),_0x14e8('0x9b'));_0x58b609['field'](_0x14e8('0x9c'),_0x14e8('0x9d'));_0x58b609['field'](_0x14e8('0x9e'),_0x14e8('0x9f'));_0x58b609[_0x14e8('0x49')]('c.phone',_0x14e8('0xa0'));_0x58b609[_0x14e8('0x49')](_0x14e8('0xa1'),_0x14e8('0xa2'));_0x58b609[_0x14e8('0x49')](_0x14e8('0xa3'),_0x14e8('0xa4'));_0x58b609[_0x14e8('0x49')](_0x14e8('0xa5'),_0x14e8('0xa6'));_0x58b609[_0x14e8('0x49')](_0x14e8('0xa7'),'Owner.internal');_0x58b609[_0x14e8('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x54e624[_0x14e8('0x25')])_0x58b609['limit'](_0x54e624[_0x14e8('0x25')]);if(_0x54e624[_0x14e8('0x24')])_0x58b609[_0x14e8('0x24')](_0x54e624[_0x14e8('0x24')]);return db['sequelize'][_0x14e8('0x3d')](_0x58b609[_0x14e8('0x94')](),_0x304328);})[_0x14e8('0x2b')](function(_0x509c76){_0x6c3e1f['where'](_0x14e8('0xa8'),_[_0x14e8('0x31')](_0x509c76,'id'));return db[_0x14e8('0x93')]['query'](_0x6c3e1f[_0x14e8('0x94')](),_0x304328)[_0x14e8('0x2b')](function(_0x4e57c6){var _0x2c7c45=_[_0x14e8('0xa9')](_0x4e57c6,_0x14e8('0xaa'));var _0x4a05b3=[];_0x509c76[_0x14e8('0x6c')](function(_0x2015d3){_0x4a05b3[_0x14e8('0x36')](updateSmsInteraction(_0x2015d3,_0x46a3c4,_0x2c7c45));});return BPromise[_0x14e8('0xab')](_0x4a05b3);});});})[_0x14e8('0x2b')](function(_0x214dcf){_0x4dac15['rows']=_0x214dcf;return _0x4dac15;})[_0x14e8('0x2b')](respondWithFilteredResult(_0x4411e9,_0x54e624));})['catch'](handleError(_0x4411e9,null));};exports[_0x14e8('0xac')]=function(_0xe738a2,_0x10e9ac){var _0x58fa79={'raw':![],'where':{'id':_0xe738a2[_0x14e8('0xad')]['id']}},_0x4cf205={};_0x4cf205[_0x14e8('0x41')]=_[_0x14e8('0x3e')](db[_0x14e8('0x39')][_0x14e8('0xae')]);_0x4cf205[_0x14e8('0x3d')]=_['keys'](_0xe738a2[_0x14e8('0x3d')]);_0x4cf205['filters']=_[_0x14e8('0x40')](_0x4cf205[_0x14e8('0x41')],_0x4cf205[_0x14e8('0x3d')]);_0x58fa79['attributes']=_[_0x14e8('0x40')](_0x4cf205[_0x14e8('0x41')],qs[_0x14e8('0x43')](_0xe738a2[_0x14e8('0x3d')][_0x14e8('0x43')]));_0x58fa79['attributes']=_0x58fa79[_0x14e8('0x42')][_0x14e8('0x5e')]?_0x58fa79['attributes']:_0x4cf205['model'];if(_0xe738a2['query'][_0x14e8('0xaf')]){_0x58fa79['include']=[{'all':!![]}];}_0x58fa79=_[_0x14e8('0x96')]({},_0x58fa79,_0xe738a2[_0x14e8('0xb0')]);return db[_0x14e8('0x39')][_0x14e8('0x5f')](_0x58fa79)[_0x14e8('0x2b')](handleEntityNotFound(_0x10e9ac,null))[_0x14e8('0x2b')](respondWithResult(_0x10e9ac,null))[_0x14e8('0x37')](handleError(_0x10e9ac,null));};exports[_0x14e8('0xb1')]=function(_0x2eb108,_0x586f7f){return db[_0x14e8('0x39')]['create'](_0x2eb108[_0x14e8('0x73')],{})[_0x14e8('0x2b')](respondWithResult(_0x586f7f,0xc9))['catch'](handleError(_0x586f7f,null));};exports[_0x14e8('0x2a')]=function(_0x525408,_0x15784f){if(_0x525408[_0x14e8('0x73')]['id']){delete _0x525408[_0x14e8('0x73')]['id'];}return db['SmsInteraction'][_0x14e8('0x5f')]({'where':{'id':_0x525408['params']['id']}})[_0x14e8('0x2b')](handleEntityNotFound(_0x15784f,null))['then'](saveUpdates(_0x525408['body'],null))['then'](respondWithResult(_0x15784f,null))[_0x14e8('0x37')](handleError(_0x15784f,null));};exports[_0x14e8('0xb2')]=function(_0xd6f663,_0x29d121){return db['SmsInteraction']['find']({'where':{'id':_0xd6f663[_0x14e8('0xad')]['id']}})['then'](handleEntityNotFound(_0x29d121,null))[_0x14e8('0x2b')](removeEntity(_0x29d121,null))[_0x14e8('0x37')](handleError(_0x29d121,null));};exports['describe']=function(_0x4d80d2,_0x14846c){return db[_0x14e8('0x39')][_0x14e8('0xb3')]()['then'](respondWithResult(_0x14846c,null))[_0x14e8('0x37')](handleError(_0x14846c,null));};exports['addMessage']=function(_0x151b58,_0x1c0986,_0x22a8ca){return db[_0x14e8('0xb4')][_0x14e8('0x5f')]({'where':{'id':_0x151b58[_0x14e8('0xad')]['id']}})[_0x14e8('0x2b')](handleEntityNotFound(_0x1c0986,null))[_0x14e8('0x2b')](function(_0x110a61){if(_0x110a61){return _0x110a61[_0x14e8('0xb5')](_0x151b58[_0x14e8('0x73')][_0x14e8('0xb6')],_['omit'](_0x151b58[_0x14e8('0x73')],[_0x14e8('0xb6'),'id'])||{});}})[_0x14e8('0x2b')](respondWithResult(_0x1c0986,null))[_0x14e8('0x37')](handleError(_0x1c0986,null));};exports['getMessages']=function(_0x2f342d,_0x5ba50f,_0x28b9d1){var _0xb378={'raw':![],'where':{}};var _0x1262c1={};var _0x1c3036={'count':0x0,'rows':[]};return db[_0x14e8('0x39')][_0x14e8('0xb7')]({'where':{'id':_0x2f342d[_0x14e8('0xad')]['id']}})[_0x14e8('0x2b')](handleEntityNotFound(_0x5ba50f,null))[_0x14e8('0x2b')](function(_0x387ded){if(_0x387ded){_0x1262c1[_0x14e8('0x41')]=_[_0x14e8('0x3e')](db[_0x14e8('0xb4')]['rawAttributes']);_0x1262c1['query']=_[_0x14e8('0x3e')](_0x2f342d['query']);_0x1262c1[_0x14e8('0x3f')]=_[_0x14e8('0x40')](_0x1262c1['model'],_0x1262c1[_0x14e8('0x3d')]);_0xb378[_0x14e8('0x42')]=_[_0x14e8('0x40')](_0x1262c1[_0x14e8('0x41')],qs[_0x14e8('0x43')](_0x2f342d[_0x14e8('0x3d')]['fields']));_0xb378[_0x14e8('0x42')]=_0xb378[_0x14e8('0x42')][_0x14e8('0x5e')]?_0xb378[_0x14e8('0x42')]:_0x1262c1[_0x14e8('0x41')];if(!_0x2f342d['query'][_0x14e8('0x44')]('nolimit')){_0xb378['limit']=qs[_0x14e8('0x25')](_0x2f342d[_0x14e8('0x3d')]['limit']);_0xb378[_0x14e8('0x24')]=qs['offset'](_0x2f342d[_0x14e8('0x3d')][_0x14e8('0x24')]);}_0xb378['order']=qs[_0x14e8('0x47')](_0x2f342d[_0x14e8('0x3d')][_0x14e8('0x47')]);_0xb378[_0x14e8('0x7e')]=qs[_0x14e8('0x3f')](_['pick'](_0x2f342d[_0x14e8('0x3d')],_0x1262c1[_0x14e8('0x3f')]));_0xb378[_0x14e8('0x7e')]['SmsInteractionId']=_0x387ded['id'];if(_0x2f342d['query'][_0x14e8('0x83')]){_0xb378['where']=_['merge'](_0xb378[_0x14e8('0x7e')],{'$or':_['map'](_0xb378['attributes'],function(_0x814975){var _0x300270={};_0x300270[_0x814975]={'$like':'%'+_0x2f342d[_0x14e8('0x3d')]['filter']+'%'};return _0x300270;})});}if(_0x2f342d[_0x14e8('0x3d')]['$gte']){var _0x52e21a=_0x2f342d['query'][_0x14e8('0xb8')][_0x14e8('0x35')](',');var _0x1607be={};_0x1607be[_0x52e21a[0x0]]={'$gte':moment(_0x52e21a[0x1])[_0x14e8('0xb9')](_0x14e8('0xba'))};_0xb378['where']=_[_0x14e8('0x96')](_0xb378[_0x14e8('0x7e')],_0x1607be);}_0xb378=_[_0x14e8('0x96')]({},_0xb378,_0x2f342d[_0x14e8('0xb0')]);return db[_0x14e8('0xb4')][_0x14e8('0x23')]({'where':_0xb378[_0x14e8('0x7e')]})[_0x14e8('0x2b')](function(_0x40e637){_0x1c3036[_0x14e8('0x23')]=_0x40e637;if(_0x2f342d[_0x14e8('0x3d')][_0x14e8('0xaf')]){_0xb378[_0x14e8('0xbb')]=[{'all':!![]}];}return db[_0x14e8('0xb4')][_0x14e8('0xbc')](_0xb378);})['then'](function(_0x2bd99e){_0x1c3036[_0x14e8('0xbd')]=_0x2bd99e;return _0x1c3036;});}})[_0x14e8('0x2b')](respondWithFilteredResult(_0x5ba50f,_0xb378))[_0x14e8('0x37')](handleError(_0x5ba50f,null));};exports['addTags']=function(_0x2f5465,_0x9401b7,_0x2801e9){return db[_0x14e8('0x39')]['find']({'where':{'id':_0x2f5465[_0x14e8('0xad')]['id']}})[_0x14e8('0x2b')](handleEntityNotFound(_0x9401b7,null))[_0x14e8('0x2b')](function(_0x3844c9){if(_0x3844c9){return _0x3844c9[_0x14e8('0xbe')](_0x2f5465[_0x14e8('0x73')][_0x14e8('0xb6')],_[_0x14e8('0xbf')](_0x2f5465['body'],[_0x14e8('0xb6'),'id'])||{})[_0x14e8('0xc0')](function(){return db[_0x14e8('0xc1')][_0x14e8('0xbc')]({'attributes':['id',_0x14e8('0x2e'),_0x14e8('0x4a')],'where':{'id':_0x2f5465['body'][_0x14e8('0xb6')]}});})[_0x14e8('0x2b')](function(_0x376023){socket[_0x14e8('0xc2')](_0x14e8('0xc3'),{'id':Number(_0x2f5465['params']['id']),'tags':_0x376023||[]});return{'id':Number(_0x2f5465[_0x14e8('0xad')]['id']),'tags':_0x376023||[]};});}})[_0x14e8('0x2b')](respondWithResult(_0x9401b7,null))[_0x14e8('0x37')](handleError(_0x9401b7,null));};exports[_0x14e8('0xc4')]=function(_0x3b390b,_0x3f2edc,_0x1ad0ce){return db[_0x14e8('0x39')]['find']({'where':{'id':_0x3b390b[_0x14e8('0xad')]['id']}})[_0x14e8('0x2b')](handleEntityNotFound(_0x3f2edc,null))[_0x14e8('0x2b')](function(_0x549f96){if(_0x549f96){return _0x549f96[_0x14e8('0xc4')](_0x3b390b['query']['ids']);}})[_0x14e8('0x2b')](respondWithStatusCode(_0x3f2edc,null))['catch'](handleError(_0x3f2edc,null));};exports[_0x14e8('0xc5')]=function(_0x3950fa,_0x767357){var _0x3e989d=moment()[_0x14e8('0xc6')]()[_0x14e8('0x94')]();var _0x446b97=path[_0x14e8('0xc7')](config['root'],_0x14e8('0xc8'),_0x14e8('0xc9'),_0x14e8('0xca'));var _0x2cf8bf=path[_0x14e8('0xc7')](config[_0x14e8('0xcb')],_0x14e8('0xc8'),'files','attachments');var _0x539785=path[_0x14e8('0xc7')](_0x446b97,_0x3e989d);var _0x330160=util['format'](_0x14e8('0xcc'),_0x3950fa['params']['id'],_0x3e989d);var _0xb46471=path[_0x14e8('0xc7')](_0x446b97,_0x330160);var _0x7accea=[];_0x7accea[_0x14e8('0x36')]({'model':db['User'],'as':_0x14e8('0x6e'),'attributes':['id',_0x14e8('0x32')],'raw':!![]});_0x7accea[_0x14e8('0x36')]({'model':db[_0x14e8('0xcd')],'as':_0x14e8('0x65'),'attributes':['id','firstName',_0x14e8('0xce')],'raw':!![]});var _0x46b097=[{'model':db[_0x14e8('0xb4')],'as':'Messages','attributes':['id','body',_0x14e8('0x79'),_0x14e8('0xcf'),_0x14e8('0xd0'),_0x14e8('0x80')],'include':_0x7accea}];_0x46b097[_0x14e8('0x36')]({'model':db['SmsAccount'],'as':'Account','attributes':['id','name']});_0x46b097[_0x14e8('0x36')]({'model':db['User'],'as':_0x14e8('0xd1'),'attributes':['id',_0x14e8('0x32')]});return db['SmsInteraction']['find']({'where':{'id':_0x3950fa[_0x14e8('0xad')]['id']},'include':_0x46b097})[_0x14e8('0x2b')](handleEntityNotFound(_0x767357,null))['then'](function(_0x4120e1){if(_0x4120e1){var _0x92e465=_0x4120e1[_0x14e8('0xd2')]({'plain':!![]});fs['mkdirSync'](_0x539785);var _0xe9ecf4={'format':'A4','border':_0x14e8('0xd3'),'header':{'height':_0x14e8('0xd4'),'contents':{'first':_0x14e8('0xd5')}},'footer':{'height':'30px','contents':{'default':util[_0x14e8('0xb9')](_0x14e8('0xd6'),util[_0x14e8('0xb9')](_0x14e8('0xd7'),_0x14e8('0xd8'),_0x92e465['id']),moment()['format']('YYYY-MM-DD')['toString']())}}};var _0x4611f9={'channel':_0x14e8('0xd8'),'account':_0x92e465['Account']['name'],'agent':_0x92e465['Owner']?_0x92e465[_0x14e8('0xd1')][_0x14e8('0x32')]:_0x14e8('0xd9'),'createdAt':moment(_0x92e465[_0x14e8('0x79')])[_0x14e8('0xb9')](_0x14e8('0xba'))[_0x14e8('0x94')](),'closedAt':_0x92e465[_0x14e8('0xda')]?moment(_0x92e465[_0x14e8('0xdb')])[_0x14e8('0xb9')](_0x14e8('0xba'))[_0x14e8('0x94')]():'','disposition':_0x92e465[_0x14e8('0xdc')],'messages':_(_0x92e465['Messages'])['filter']({'secret':![]})[_0x14e8('0x31')](function(_0x1b7dbf){return{'date':moment(_0x1b7dbf[_0x14e8('0x79')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x14e8('0x94')](),'sender':_0x1b7dbf[_0x14e8('0xcf')]===_0x14e8('0xdd')?_0x1b7dbf[_0x14e8('0x6e')]?_0x1b7dbf[_0x14e8('0x6e')][_0x14e8('0x32')]:'System':_0x1b7dbf[_0x14e8('0x65')][_0x14e8('0xde')]+(_0x1b7dbf[_0x14e8('0x65')]['lastName']?'\x20'+_0x1b7dbf[_0x14e8('0x65')][_0x14e8('0xce')]:''),'body':_0x1b7dbf[_0x14e8('0x73')],'direction':_0x1b7dbf[_0x14e8('0xcf')]===_0x14e8('0xdd')?'A':'C','secret':_0x1b7dbf[_0x14e8('0xd0')],'read':_0x1b7dbf[_0x14e8('0x80')]};})['value']()};return ejs[_0x14e8('0xdf')](path['join'](config['root'],_0x14e8('0xc8'),_0x14e8('0xe0'),'downloadInteraction.html'),{'interaction':_0x4611f9})[_0x14e8('0x2b')](function(_0x5e3dba){return new BPromise(function(_0x12516d,_0x3a4a17){pdf['create'](_0x5e3dba,_0xe9ecf4)['toFile'](path[_0x14e8('0xc7')](_0x539785,_0x14e8('0xe1')+_0x92e465['id']+'-'+_0x3e989d+_0x14e8('0xe2')),function(_0x42b79c,_0x82e208){if(_0x42b79c)return _0x3a4a17(_0x42b79c);_0x12516d(_0x82e208);});});})[_0x14e8('0x2b')](function(){return new BPromise(function(_0x473c25,_0x30926e){zipdir(_0x539785,{'saveTo':_0xb46471},function(_0x368c89,_0x356320){if(_0x368c89)return _0x30926e(_0x368c89);return _0x473c25(_0x356320);});})[_0x14e8('0x2b')](function(){return new BPromise(function(_0x5e63ce,_0xf2af74){rimraf(_0x539785,function(_0x1dd8cf){if(_0x1dd8cf)_0xf2af74(_0x1dd8cf);return _0x5e63ce();});});})[_0x14e8('0x2b')](function(){return _0x767357['download'](_0xb46471,_0x330160,function(_0x3cf235){if(_0x3cf235){console[_0x14e8('0xe3')](_0x14e8('0xe4'),_0x3cf235);}else{fs['unlinkSync'](_0xb46471);}});});});}else{return _0x767357[_0x14e8('0x1f')](0xc8);}})[_0x14e8('0x37')](handleError(_0x767357,null));};
\ No newline at end of file
index e610b01..e10dde4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed95=['length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xed95,0xb9));var _0x5ed9=function(_0xed0084,_0x1837a3){_0xed0084=_0xed0084-0x0;var _0x2461cc=_0xed95[_0xed0084];return _0x2461cc;};'use strict';var EventEmitter=require(_0x5ed9('0x0'));var SmsInteraction=require(_0x5ed9('0x1'))['db'][_0x5ed9('0x2')];var SmsMessage=require(_0x5ed9('0x1'))['db'][_0x5ed9('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x5ed9('0x4')](0x0);var events={'afterCreate':_0x5ed9('0x5'),'afterUpdate':_0x5ed9('0x6'),'afterDestroy':_0x5ed9('0x7')};function emitEvent(_0x7b84d6){return function(_0x206a5e,_0x15b734,_0x52a57d){_0x206a5e['getUsers']({'attributes':['id'],'raw':!![]})[_0x5ed9('0x8')](function(_0x217c71){_0x206a5e[_0x5ed9('0x9')](_0x5ed9('0xa'),_0x217c71[_0x5ed9('0xb')](function(_0x40e8eb){return{'id':_0x40e8eb['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x206a5e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3cbaf0){_0x206a5e[_0x5ed9('0x9')](_0x5ed9('0xc'),_0x3cbaf0[_0x5ed9('0xd')]);SmsInteractionEvents['emit'](_0x7b84d6+':'+_0x206a5e['id'],_0x206a5e);SmsInteractionEvents['emit'](_0x7b84d6,_0x206a5e);_0x52a57d(null);})[_0x5ed9('0xe')](_0x52a57d(null));};}for(var e in events){if(events[_0x5ed9('0xf')](e)){var event=events[e];SmsInteraction[_0x5ed9('0x10')](e,emitEvent(event));}}module[_0x5ed9('0x11')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x84e7=['length','emit','catch','hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','update','remove','then','setDataValue','Users','findAll'];(function(_0x3d60a8,_0x3dd7c8){var _0x434106=function(_0x58f833){while(--_0x58f833){_0x3d60a8['push'](_0x3d60a8['shift']());}};_0x434106(++_0x3dd7c8);}(_0x84e7,0x122));var _0x784e=function(_0x583571,_0x55f9d4){_0x583571=_0x583571-0x0;var _0x5666ef=_0x84e7[_0x583571];return _0x5666ef;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x784e('0x0'))['db'][_0x784e('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x784e('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x784e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x784e('0x4'),'afterDestroy':_0x784e('0x5')};function emitEvent(_0x205619){return function(_0xdc7692,_0x42993b,_0x133296){_0xdc7692['getUsers']({'attributes':['id'],'raw':!![]})[_0x784e('0x6')](function(_0x5d5595){_0xdc7692[_0x784e('0x7')](_0x784e('0x8'),_0x5d5595['map'](function(_0x18be55){return{'id':_0x18be55['id']};}));return SmsMessage[_0x784e('0x9')]({'where':{'SmsInteractionId':_0xdc7692['id'],'direction':'in','read':![]},'raw':!![]});})[_0x784e('0x6')](function(_0x3ddd55){_0xdc7692['setDataValue']('unreadMessages',_0x3ddd55[_0x784e('0xa')]);SmsInteractionEvents[_0x784e('0xb')](_0x205619+':'+_0xdc7692['id'],_0xdc7692);SmsInteractionEvents[_0x784e('0xb')](_0x205619,_0xdc7692);_0x133296(null);})[_0x784e('0xc')](_0x133296(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x784e('0xd')](e,emitEvent(event));}}module[_0x784e('0xe')]=SmsInteractionEvents;
\ No newline at end of file
index 0f68fec..2124d48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x744a=['./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','lodash','api','moment','request-promise','path','rimraf'];(function(_0x1648f8,_0x51870b){var _0x1185df=function(_0x373b83){while(--_0x373b83){_0x1648f8['push'](_0x1648f8['shift']());}};_0x1185df(++_0x51870b);}(_0x744a,0xf9));var _0xa744=function(_0x30e92b,_0x5d65be){_0x30e92b=_0x30e92b-0x0;var _0x4b8961=_0x744a[_0x30e92b];return _0x4b8961;};'use strict';var _=require(_0xa744('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa744('0x1'));var moment=require(_0xa744('0x2'));var BPromise=require('bluebird');var rp=require(_0xa744('0x3'));var fs=require('fs');var path=require(_0xa744('0x4'));var rimraf=require(_0xa744('0x5'));var config=require('../../config/environment');var attributes=require(_0xa744('0x6'));module[_0xa744('0x7')]=function(_0x21e4f1,_0x5094cb){return _0x21e4f1[_0xa744('0x8')](_0xa744('0x9'),attributes,{'tableName':_0xa744('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3aadbd,_0x30a2d3,_0x398837){if(_0x3aadbd[_0xa744('0xb')](_0xa744('0xc'))){_0x3aadbd[_0xa744('0xd')]=moment()[_0xa744('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x398837(null,_0x3aadbd);}}});};
\ No newline at end of file
+var _0x0ec5=['./smsInteraction.attributes','exports','define','sms_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x51951a,_0x1e40fd){var _0x22dc23=function(_0x1412b8){while(--_0x1412b8){_0x51951a['push'](_0x51951a['shift']());}};_0x22dc23(++_0x1e40fd);}(_0x0ec5,0x9e));var _0x50ec=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x0ec5[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x50ec('0x0'));var util=require(_0x50ec('0x1'));var logger=require(_0x50ec('0x2'))(_0x50ec('0x3'));var moment=require(_0x50ec('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x50ec('0x5'));var rimraf=require('rimraf');var config=require(_0x50ec('0x6'));var attributes=require(_0x50ec('0x7'));module[_0x50ec('0x8')]=function(_0x51659e,_0x632ba0){return _0x51659e[_0x50ec('0x9')]('SmsInteraction',attributes,{'tableName':_0x50ec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x458360,_0x5915d5,_0x29e5b3){if(_0x458360[_0x50ec('0xb')](_0x50ec('0xc'))){_0x458360[_0x50ec('0xd')]=moment()[_0x50ec('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x29e5b3(null,_0x458360);}}});};
\ No newline at end of file
index 87dd702..b948379 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f6a=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','body','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1fbb37,_0x5840b8){var _0x591a30=function(_0x2a6573){while(--_0x2a6573){_0x1fbb37['push'](_0x1fbb37['shift']());}};_0x591a30(++_0x5840b8);}(_0x1f6a,0x184));var _0xa1f6=function(_0x311df2,_0x5b6291){_0x311df2=_0x311df2-0x0;var _0x2d70d7=_0x1f6a[_0x311df2];return _0x2d70d7;};'use strict';var _=require(_0xa1f6('0x0'));var util=require(_0xa1f6('0x1'));var moment=require(_0xa1f6('0x2'));var BPromise=require(_0xa1f6('0x3'));var rs=require(_0xa1f6('0x4'));var fs=require('fs');var Redis=require(_0xa1f6('0x5'));var db=require(_0xa1f6('0x6'))['db'];var utils=require(_0xa1f6('0x7'));var logger=require(_0xa1f6('0x8'))(_0xa1f6('0x9'));var config=require('../../config/environment');var jayson=require(_0xa1f6('0xa'));var client=jayson[_0xa1f6('0xb')][_0xa1f6('0xc')]({'port':0x232a});config[_0xa1f6('0xd')]=_[_0xa1f6('0xe')](config[_0xa1f6('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa1f6('0xf'))(new Redis(config[_0xa1f6('0xd')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x2f528d,_0x1631eb,_0x30560e){return new BPromise(function(_0x108e25,_0x271569){return client[_0xa1f6('0x10')](_0x2f528d,_0x30560e)[_0xa1f6('0x11')](function(_0x55b1c5){logger[_0xa1f6('0x12')](_0xa1f6('0x13'),_0x1631eb,_0xa1f6('0x14'));logger[_0xa1f6('0x15')](_0xa1f6('0x16'),_0x1631eb,_0xa1f6('0x14'),JSON[_0xa1f6('0x17')](_0x55b1c5));if(_0x55b1c5[_0xa1f6('0x18')]){if(_0x55b1c5[_0xa1f6('0x18')][_0xa1f6('0x19')]===0x1f4){logger[_0xa1f6('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x1631eb,_0x55b1c5[_0xa1f6('0x18')][_0xa1f6('0x1a')]);return _0x271569(_0x55b1c5['error']['message']);}logger[_0xa1f6('0x18')](_0xa1f6('0x13'),_0x1631eb,_0x55b1c5[_0xa1f6('0x18')][_0xa1f6('0x1a')]);return _0x108e25(_0x55b1c5[_0xa1f6('0x18')][_0xa1f6('0x1a')]);}else{logger[_0xa1f6('0x12')](_0xa1f6('0x13'),_0x1631eb,'request\x20sent');_0x108e25(_0x55b1c5[_0xa1f6('0x1b')]['message']);}})[_0xa1f6('0x1c')](function(_0x2e6e8d){logger['error'](_0xa1f6('0x13'),_0x1631eb,_0x2e6e8d);_0x271569(_0x2e6e8d);});});}exports[_0xa1f6('0x1d')]=function(_0x26277c){var _0x1dca47=this;return new Promise(function(_0x1d157a,_0x3fb38f){return db[_0xa1f6('0x1e')][_0xa1f6('0x1f')](_0x26277c['body'],{'raw':_0x26277c[_0xa1f6('0x20')]?_0x26277c[_0xa1f6('0x20')][_0xa1f6('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26277c['options']?_0x26277c[_0xa1f6('0x20')][_0xa1f6('0x22')]||null:null,'attributes':_0x26277c[_0xa1f6('0x20')]?_0x26277c[_0xa1f6('0x20')][_0xa1f6('0x23')]||null:null,'limit':_0x26277c[_0xa1f6('0x20')]?_0x26277c[_0xa1f6('0x20')][_0xa1f6('0x24')]||null:null})[_0xa1f6('0x11')](function(_0x2ab65){logger[_0xa1f6('0x12')](_0xa1f6('0x1d'),_0x26277c);logger['debug'](_0xa1f6('0x1d'),_0x26277c,JSON[_0xa1f6('0x17')](_0x2ab65));_0x1d157a(_0x2ab65);})[_0xa1f6('0x1c')](function(_0x46cf52){logger[_0xa1f6('0x18')]('UpdateSmsInteraction',_0x46cf52[_0xa1f6('0x1a')],_0x26277c);_0x3fb38f(_0x1dca47['error'](0x1f4,_0x46cf52[_0xa1f6('0x1a')]));});});};exports[_0xa1f6('0x25')]=function(_0x596dbb){return new Promise(function(_0x274896,_0x3857f3){return db[_0xa1f6('0x1e')][_0xa1f6('0x26')]({'where':_0x596dbb[_0xa1f6('0x20')]?_0x596dbb[_0xa1f6('0x20')][_0xa1f6('0x22')]||null:null})[_0xa1f6('0x11')](function(_0x196470){if(_0x196470){return _0x196470[_0xa1f6('0x27')](_0x596dbb[_0xa1f6('0x28')]['ids'],_[_0xa1f6('0x29')](_0x596dbb[_0xa1f6('0x28')],['ids','id'])||{});}})[_0xa1f6('0x2a')](function(_0x399852){logger['info']('AddTags',_0x596dbb);logger[_0xa1f6('0x15')]('AddTags',_0x596dbb,JSON['stringify'](_0x399852));_0x274896(_0x399852);})[_0xa1f6('0x1c')](function(_0xe214bf){logger[_0xa1f6('0x18')](_0xa1f6('0x2b'),_0xe214bf[_0xa1f6('0x1a')],_0x596dbb);_0x3857f3(_this[_0xa1f6('0x18')](0x1f4,_0xe214bf['message']));});});};
\ No newline at end of file
+var _0xdda5=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','attributes','find','omit','ids','spread','AddTags'];(function(_0x353d3d,_0xc7ebc){var _0x1c5409=function(_0x54838e){while(--_0x54838e){_0x353d3d['push'](_0x353d3d['shift']());}};_0x1c5409(++_0xc7ebc);}(_0xdda5,0x11f));var _0x5dda=function(_0xbf8a2,_0x4c910b){_0xbf8a2=_0xbf8a2-0x0;var _0x15d931=_0xdda5[_0xbf8a2];return _0x15d931;};'use strict';var _=require(_0x5dda('0x0'));var util=require('util');var moment=require(_0x5dda('0x1'));var BPromise=require(_0x5dda('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dda('0x3'));var db=require(_0x5dda('0x4'))['db'];var utils=require(_0x5dda('0x5'));var logger=require(_0x5dda('0x6'))(_0x5dda('0x7'));var config=require(_0x5dda('0x8'));var jayson=require(_0x5dda('0x9'));var client=jayson[_0x5dda('0xa')]['http']({'port':0x232a});config[_0x5dda('0xb')]=_[_0x5dda('0xc')](config[_0x5dda('0xb')],{'host':_0x5dda('0xd'),'port':0x18eb});var socket=require(_0x5dda('0xe'))(new Redis(config[_0x5dda('0xb')]));require('./smsInteraction.socket')[_0x5dda('0xf')](socket);function respondWithRpcPromise(_0x2ad493,_0x2fd772,_0x48477f){return new BPromise(function(_0x1a8188,_0x5978f3){return client[_0x5dda('0x10')](_0x2ad493,_0x48477f)[_0x5dda('0x11')](function(_0x3b7e85){logger[_0x5dda('0x12')](_0x5dda('0x13'),_0x2fd772,_0x5dda('0x14'));logger[_0x5dda('0x15')](_0x5dda('0x16'),_0x2fd772,_0x5dda('0x14'),JSON[_0x5dda('0x17')](_0x3b7e85));if(_0x3b7e85[_0x5dda('0x18')]){if(_0x3b7e85[_0x5dda('0x18')][_0x5dda('0x19')]===0x1f4){logger['error'](_0x5dda('0x13'),_0x2fd772,_0x3b7e85[_0x5dda('0x18')][_0x5dda('0x1a')]);return _0x5978f3(_0x3b7e85['error'][_0x5dda('0x1a')]);}logger[_0x5dda('0x18')](_0x5dda('0x13'),_0x2fd772,_0x3b7e85[_0x5dda('0x18')]['message']);return _0x1a8188(_0x3b7e85[_0x5dda('0x18')][_0x5dda('0x1a')]);}else{logger[_0x5dda('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x2fd772,_0x5dda('0x14'));_0x1a8188(_0x3b7e85[_0x5dda('0x1b')][_0x5dda('0x1a')]);}})[_0x5dda('0x1c')](function(_0x45482f){logger['error'](_0x5dda('0x13'),_0x2fd772,_0x45482f);_0x5978f3(_0x45482f);});});}exports[_0x5dda('0x1d')]=function(_0x31b35b){var _0x1aec83=this;return new Promise(function(_0x3155f9,_0x55fed4){return db[_0x5dda('0x1e')][_0x5dda('0x1f')](_0x31b35b[_0x5dda('0x20')],{'raw':_0x31b35b[_0x5dda('0x21')]?_0x31b35b['options'][_0x5dda('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31b35b[_0x5dda('0x21')]?_0x31b35b[_0x5dda('0x21')]['where']||null:null,'attributes':_0x31b35b['options']?_0x31b35b[_0x5dda('0x21')][_0x5dda('0x23')]||null:null,'limit':_0x31b35b[_0x5dda('0x21')]?_0x31b35b[_0x5dda('0x21')]['limit']||null:null})[_0x5dda('0x11')](function(_0x4ec017){logger['info']('UpdateSmsInteraction',_0x31b35b);logger['debug']('UpdateSmsInteraction',_0x31b35b,JSON['stringify'](_0x4ec017));_0x3155f9(_0x4ec017);})[_0x5dda('0x1c')](function(_0x5d9844){logger[_0x5dda('0x18')](_0x5dda('0x1d'),_0x5d9844[_0x5dda('0x1a')],_0x31b35b);_0x55fed4(_0x1aec83[_0x5dda('0x18')](0x1f4,_0x5d9844[_0x5dda('0x1a')]));});});};exports['AddTagsToSmsInteraction']=function(_0x735047){return new Promise(function(_0x43f2b7,_0x10de3a){return db[_0x5dda('0x1e')][_0x5dda('0x24')]({'where':_0x735047[_0x5dda('0x21')]?_0x735047[_0x5dda('0x21')]['where']||null:null})['then'](function(_0x56dab9){if(_0x56dab9){return _0x56dab9['addTags'](_0x735047[_0x5dda('0x20')]['ids'],_[_0x5dda('0x25')](_0x735047['body'],[_0x5dda('0x26'),'id'])||{});}})[_0x5dda('0x27')](function(_0x293481){logger[_0x5dda('0x12')](_0x5dda('0x28'),_0x735047);logger['debug'](_0x5dda('0x28'),_0x735047,JSON[_0x5dda('0x17')](_0x293481));_0x43f2b7(_0x293481);})[_0x5dda('0x1c')](function(_0x5a1ccb){logger['error'](_0x5dda('0x28'),_0x5a1ccb[_0x5dda('0x1a')],_0x735047);_0x10de3a(_this[_0x5dda('0x18')](0x1f4,_0x5a1ccb[_0x5dda('0x1a')]));});});};
\ No newline at end of file
index 1ed6db1..65c5197 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['emit','removeListener','register','smsInteraction:','./smsInteraction.events','remove','update'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0xb10b,0x12a));var _0xbb10=function(_0x559233,_0x4f4408){_0x559233=_0x559233-0x0;var _0x1a9acb=_0xb10b[_0x559233];return _0x1a9acb;};'use strict';var SmsInteractionEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){SmsInteractionEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);SmsInteractionEvents['on'](_0x1b9e94,_0x3fb675);}};
\ No newline at end of file
+var _0x757a=['save','remove','emit','removeListener','register','smsInteraction:'];(function(_0x432400,_0x3cc68d){var _0xdd5de3=function(_0x5cb6d3){while(--_0x5cb6d3){_0x432400['push'](_0x432400['shift']());}};_0xdd5de3(++_0x3cc68d);}(_0x757a,0xde));var _0xa757=function(_0x2d306f,_0x500e99){_0x2d306f=_0x2d306f-0x0;var _0x49f030=_0x757a[_0x2d306f];return _0x49f030;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa757('0x0'),_0xa757('0x1'),'update'];function createListener(_0x5c03c3,_0x5709ed){return function(_0x32be3b){_0x5709ed[_0xa757('0x2')](_0x5c03c3,_0x32be3b);};}function removeListener(_0x1c2932,_0x453d07){return function(){SmsInteractionEvents[_0xa757('0x3')](_0x1c2932,_0x453d07);};}exports[_0xa757('0x4')]=function(_0x5edca8){for(var _0xae0e7c=0x0,_0x4343b6=events['length'];_0xae0e7c<_0x4343b6;_0xae0e7c++){var _0x2930fa=events[_0xae0e7c];var _0x2f7793=createListener(_0xa757('0x5')+_0x2930fa,_0x5edca8);SmsInteractionEvents['on'](_0x2930fa,_0x2f7793);}};
\ No newline at end of file
index b68b7f3..1a6472c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcec8=['put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','express','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','show','post','tracked','sms','smsmessage:create','create','/:id/status'];(function(_0x2bda14,_0x4fab1b){var _0xb5dd49=function(_0x1da71e){while(--_0x1da71e){_0x2bda14['push'](_0x2bda14['shift']());}};_0xb5dd49(++_0x4fab1b);}(_0xcec8,0xda));var _0x8cec=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0xcec8[_0x2d6197];return _0x4d0e75;};'use strict';var multer=require(_0x8cec('0x0'));var util=require(_0x8cec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8cec('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8cec('0x3'));var config=require('../../config/environment');var controller=require(_0x8cec('0x4'));router[_0x8cec('0x5')]('/',auth[_0x8cec('0x6')](),controller[_0x8cec('0x7')]);router[_0x8cec('0x5')](_0x8cec('0x8'),auth[_0x8cec('0x6')](),controller['describe']);router[_0x8cec('0x5')]('/:id',auth[_0x8cec('0x6')](),controller[_0x8cec('0x9')]);router[_0x8cec('0xa')]('/',auth[_0x8cec('0x6')](),interaction[_0x8cec('0xb')](_0x8cec('0xc'),_0x8cec('0xd')),controller[_0x8cec('0xe')]);router[_0x8cec('0xa')](_0x8cec('0xf'),controller['status']);router[_0x8cec('0x10')](_0x8cec('0x11'),auth[_0x8cec('0x6')](),controller[_0x8cec('0x12')]);router[_0x8cec('0x10')](_0x8cec('0x13'),auth['isAuthenticated'](),controller[_0x8cec('0x14')]);router[_0x8cec('0x10')](_0x8cec('0x15'),auth['isAuthenticated'](),controller[_0x8cec('0x16')]);router[_0x8cec('0x17')]('/:id',auth[_0x8cec('0x6')](),controller[_0x8cec('0x18')]);module[_0x8cec('0x19')]=router;
\ No newline at end of file
+var _0x822d=['create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create'];(function(_0x100c92,_0x30362f){var _0x2e2b34=function(_0x5d1c9c){while(--_0x5d1c9c){_0x100c92['push'](_0x100c92['shift']());}};_0x2e2b34(++_0x30362f);}(_0x822d,0xa2));var _0xd822=function(_0x378720,_0xa711f1){_0x378720=_0x378720-0x0;var _0x47920a=_0x822d[_0x378720];return _0x47920a;};'use strict';var multer=require(_0xd822('0x0'));var util=require(_0xd822('0x1'));var path=require(_0xd822('0x2'));var timeout=require(_0xd822('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xd822('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd822('0x5'));var controller=require(_0xd822('0x6'));router[_0xd822('0x7')]('/',auth[_0xd822('0x8')](),controller[_0xd822('0x9')]);router['get'](_0xd822('0xa'),auth[_0xd822('0x8')](),controller[_0xd822('0xb')]);router['get'](_0xd822('0xc'),auth[_0xd822('0x8')](),controller[_0xd822('0xd')]);router[_0xd822('0xe')]('/',auth[_0xd822('0x8')](),interaction[_0xd822('0xf')](_0xd822('0x10'),_0xd822('0x11')),controller[_0xd822('0x12')]);router['post'](_0xd822('0x13'),controller[_0xd822('0x14')]);router[_0xd822('0x15')](_0xd822('0xc'),auth[_0xd822('0x8')](),controller[_0xd822('0x16')]);router[_0xd822('0x15')](_0xd822('0x17'),auth[_0xd822('0x8')](),controller[_0xd822('0x18')]);router['put'](_0xd822('0x19'),auth['isAuthenticated'](),controller[_0xd822('0x1a')]);router[_0xd822('0x1b')](_0xd822('0xc'),auth[_0xd822('0x8')](),controller[_0xd822('0x1c')]);module[_0xd822('0x1d')]=router;
\ No newline at end of file
index f882131..acd66bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fee=['ENUM','out','STRING','DATE','BOOLEAN','exports','TEXT','medium'];(function(_0x14ac07,_0x4973f6){var _0x19e6af=function(_0xe6e1fe){while(--_0xe6e1fe){_0x14ac07['push'](_0x14ac07['shift']());}};_0x19e6af(++_0x4973f6);}(_0x9fee,0xc5));var _0xe9fe=function(_0x57f8f0,_0x20d876){_0x57f8f0=_0x57f8f0-0x0;var _0x5e41b9=_0x9fee[_0x57f8f0];return _0x5e41b9;};'use strict';var Sequelize=require('sequelize');module[_0xe9fe('0x0')]={'body':{'type':Sequelize[_0xe9fe('0x1')](_0xe9fe('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xe9fe('0x3')]('in',_0xe9fe('0x4')),'defaultValue':_0xe9fe('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xe9fe('0x5')]},'readAt':{'type':Sequelize[_0xe9fe('0x6')]},'secret':{'type':Sequelize[_0xe9fe('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2b29=['ENUM','out','STRING','DATE','BOOLEAN','sequelize','TEXT','medium'];(function(_0x5cf130,_0x25bad2){var _0x336f51=function(_0x39bfe4){while(--_0x39bfe4){_0x5cf130['push'](_0x5cf130['shift']());}};_0x336f51(++_0x25bad2);}(_0x2b29,0x135));var _0x92b2=function(_0xb1e4ac,_0xab8379){_0xb1e4ac=_0xb1e4ac-0x0;var _0x593279=_0x2b29[_0xb1e4ac];return _0x593279;};'use strict';var Sequelize=require(_0x92b2('0x0'));module['exports']={'body':{'type':Sequelize[_0x92b2('0x1')](_0x92b2('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x92b2('0x3')]('in',_0x92b2('0x4')),'defaultValue':_0x92b2('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x92b2('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x92b2('0x6')]},'secret':{'type':Sequelize[_0x92b2('0x7')],'defaultValue':![]}};
\ No newline at end of file
index f1133e6..32caba9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b05=['groupName','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./smsMessage.socket','register','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','end','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','SmsMessage','includeAll','findAll','rows','show','include','find','create','update','body','params','describe','sms-interactions','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','sms','agent','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results'];(function(_0x41cdea,_0x4563cf){var _0x12cbd2=function(_0x426316){while(--_0x426316){_0x41cdea['push'](_0x41cdea['shift']());}};_0x12cbd2(++_0x4563cf);}(_0x7b05,0x91));var _0x57b0=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x7b05[_0x13b392];return _0x39db24;};'use strict';var pdf=require(_0x57b0('0x0'));var emlformat=require(_0x57b0('0x1'));var rimraf=require(_0x57b0('0x2'));var zipdir=require(_0x57b0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57b0('0x4'));var moment=require('moment');var BPromise=require(_0x57b0('0x5'));var Mustache=require(_0x57b0('0x6'));var util=require(_0x57b0('0x7'));var path=require(_0x57b0('0x8'));var sox=require(_0x57b0('0x9'));var csv=require('to-csv');var ejs=require(_0x57b0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x57b0('0xb'));var crypto=require(_0x57b0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x57b0('0xd'));var Redis=require(_0x57b0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57b0('0xf'));var logger=require(_0x57b0('0x10'))(_0x57b0('0x11'));var utils=require(_0x57b0('0x12'));var config=require(_0x57b0('0x13'));var db=require(_0x57b0('0x14'))['db'];config['redis']=_[_0x57b0('0x15')](config[_0x57b0('0x16')],{'host':_0x57b0('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x57b0('0x18'))[_0x57b0('0x19')](socket);var jayson=require(_0x57b0('0x1a'));var client=jayson[_0x57b0('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x57b0('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x235d4a,_0xa20423,_0x55fd9c){if(_0x55fd9c){var _0x1ad3c9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ad3c9[_0x57b0('0x1c')](_0xa20423)){return _0x235d4a;}else{throw new db[(_0x57b0('0x1d'))][(_0x57b0('0x1e'))](_0x57b0('0x1f'));}}else{return _0x235d4a;}}function respondWithRpcPromise(_0x545c29,_0x37bd5d,_0x4ac304,_0x592b2d){return new BPromise(function(_0x1f18a7,_0x26c6ed){var _0x310d2a=_0x592b2d||client;return _0x310d2a[_0x57b0('0x20')](_0x545c29,_0x4ac304)[_0x57b0('0x21')](function(_0x28af98){logger['info'](_0x57b0('0x22'),_0x37bd5d,_0x57b0('0x23'));logger[_0x57b0('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x37bd5d,_0x57b0('0x23'),JSON[_0x57b0('0x25')](_0x28af98));if(_0x28af98[_0x57b0('0x26')]){if(_0x28af98[_0x57b0('0x26')][_0x57b0('0x27')]===0x1f4){logger[_0x57b0('0x26')](_0x57b0('0x22'),_0x37bd5d,_0x28af98[_0x57b0('0x26')][_0x57b0('0x28')]);return _0x26c6ed(_0x28af98['error']['message']);}logger[_0x57b0('0x26')]('SmsMessage,\x20%s,\x20%s',_0x37bd5d,_0x28af98[_0x57b0('0x26')][_0x57b0('0x28')]);return _0x1f18a7(_0x28af98[_0x57b0('0x26')][_0x57b0('0x28')]);}else{logger[_0x57b0('0x29')](_0x57b0('0x22'),_0x37bd5d,_0x57b0('0x23'));_0x1f18a7(_0x28af98[_0x57b0('0x2a')][_0x57b0('0x28')]);}})[_0x57b0('0x2b')](function(_0x3e4e5f){logger[_0x57b0('0x26')](_0x57b0('0x22'),_0x37bd5d,_0x3e4e5f);_0x26c6ed(_0x3e4e5f);});});}function respondWithStatusCode(_0x508288,_0x285522){_0x285522=_0x285522||0xcc;return function(_0x114cd7){if(_0x114cd7){return _0x508288[_0x57b0('0x2c')](_0x285522);}return _0x508288[_0x57b0('0x2d')](_0x285522)['end']();};}function respondWithResult(_0x552f3e,_0x325e39){_0x325e39=_0x325e39||0xc8;return function(_0x3aaf57){if(_0x3aaf57){return _0x552f3e[_0x57b0('0x2d')](_0x325e39)['json'](_0x3aaf57);}};}function respondWithFilteredResult(_0x52d2bc,_0x9d9195){return function(_0x577dae){if(_0x577dae){var _0x12f4bf=_0x577dae[_0x57b0('0x2e')],_0x5b6c1d=_0x9d9195['offset'],_0x5d19a6=_0x9d9195[_0x57b0('0x2f')]+_0x9d9195[_0x57b0('0x30')],_0x2fb4b7;if(_0x5d19a6>=_0x12f4bf){_0x5d19a6=_0x12f4bf;_0x2fb4b7=0xc8;}else{_0x2fb4b7=0xce;}_0x52d2bc['status'](_0x2fb4b7);return _0x52d2bc[_0x57b0('0x31')](_0x57b0('0x32'),_0x5b6c1d+'-'+_0x5d19a6+'/'+_0x12f4bf)[_0x57b0('0x33')](_0x577dae);}return null;};}function patchUpdates(_0x547ea6){return function(_0x575a07){try{jsonpatch[_0x57b0('0x34')](_0x575a07,_0x547ea6,!![]);}catch(_0x46ccd7){return BPromise[_0x57b0('0x35')](_0x46ccd7);}return _0x575a07[_0x57b0('0x36')]();};}function saveUpdates(_0x5cafcb,_0x4fb841){return function(_0x4ab6cd){if(_0x4ab6cd){return _0x4ab6cd['update'](_0x5cafcb)[_0x57b0('0x21')](function(_0xb44fff){return _0xb44fff;});}return null;};}function removeEntity(_0x1592ac,_0x443881){return function(_0x46513d){if(_0x46513d){return _0x46513d['destroy']()[_0x57b0('0x21')](function(){_0x1592ac[_0x57b0('0x2d')](0xcc)[_0x57b0('0x37')]();});}};}function handleEntityNotFound(_0x208b30,_0x5b1c28){return function(_0x3dab86){if(!_0x3dab86){_0x208b30[_0x57b0('0x2c')](0x194);}return _0x3dab86;};}function handleError(_0x4b0739,_0xbf8d86){_0xbf8d86=_0xbf8d86||0x1f4;return function(_0x530d66){logger['error'](_0x530d66['stack']);if(_0x530d66[_0x57b0('0x38')]){delete _0x530d66[_0x57b0('0x38')];}_0x4b0739[_0x57b0('0x2d')](_0xbf8d86)[_0x57b0('0x39')](_0x530d66);};}exports[_0x57b0('0x3a')]=function(_0x43ca03,_0x30c9b7){var _0x451a88={},_0x3e90f5={},_0x33f0b2={'count':0x0,'rows':[]};var _0x37e0a7=_[_0x57b0('0x3b')](db['SmsMessage'][_0x57b0('0x3c')],function(_0x145b80){return{'name':_0x145b80[_0x57b0('0x3d')],'type':_0x145b80['type']['key']};});_0x3e90f5['model']=_[_0x57b0('0x3b')](_0x37e0a7,_0x57b0('0x38'));_0x3e90f5[_0x57b0('0x3e')]=_[_0x57b0('0x3f')](_0x43ca03['query']);_0x3e90f5[_0x57b0('0x40')]=_[_0x57b0('0x41')](_0x3e90f5['model'],_0x3e90f5[_0x57b0('0x3e')]);_0x451a88[_0x57b0('0x42')]=_[_0x57b0('0x41')](_0x3e90f5[_0x57b0('0x43')],qs[_0x57b0('0x44')](_0x43ca03['query'][_0x57b0('0x44')]));_0x451a88[_0x57b0('0x42')]=_0x451a88[_0x57b0('0x42')][_0x57b0('0x45')]?_0x451a88['attributes']:_0x3e90f5['model'];if(!_0x43ca03[_0x57b0('0x3e')][_0x57b0('0x46')]('nolimit')){_0x451a88[_0x57b0('0x30')]=qs[_0x57b0('0x30')](_0x43ca03[_0x57b0('0x3e')]['limit']);_0x451a88['offset']=qs[_0x57b0('0x2f')](_0x43ca03[_0x57b0('0x3e')][_0x57b0('0x2f')]);}_0x451a88[_0x57b0('0x47')]=qs[_0x57b0('0x48')](_0x43ca03['query'][_0x57b0('0x48')]);_0x451a88[_0x57b0('0x49')]=qs[_0x57b0('0x40')](_[_0x57b0('0x4a')](_0x43ca03[_0x57b0('0x3e')],_0x3e90f5['filters']),_0x37e0a7);if(_0x43ca03['query']['filter']){_0x451a88['where']=_[_0x57b0('0x4b')](_0x451a88[_0x57b0('0x49')],{'$or':_[_0x57b0('0x3b')](_0x37e0a7,function(_0x2af039){if(_0x2af039[_0x57b0('0x4c')]!==_0x57b0('0x4d')){var _0x1f2fd7={};_0x1f2fd7[_0x2af039['name']]={'$like':'%'+_0x43ca03[_0x57b0('0x3e')][_0x57b0('0x4e')]+'%'};return _0x1f2fd7;}})});}_0x451a88=_[_0x57b0('0x4b')]({},_0x451a88,_0x43ca03[_0x57b0('0x4f')]);var _0x3b1f16={'where':_0x451a88[_0x57b0('0x49')]};return db[_0x57b0('0x50')]['count'](_0x3b1f16)[_0x57b0('0x21')](function(_0x535f22){_0x33f0b2[_0x57b0('0x2e')]=_0x535f22;if(_0x43ca03['query'][_0x57b0('0x51')]){_0x451a88['include']=[{'all':!![]}];}return db[_0x57b0('0x50')][_0x57b0('0x52')](_0x451a88);})['then'](function(_0x30b4dd){_0x33f0b2[_0x57b0('0x53')]=_0x30b4dd;return _0x33f0b2;})[_0x57b0('0x21')](respondWithFilteredResult(_0x30c9b7,_0x451a88))['catch'](handleError(_0x30c9b7,null));};exports[_0x57b0('0x54')]=function(_0xb8f21,_0x5d02f4){var _0x2ee9de={'raw':!![],'where':{'id':_0xb8f21['params']['id']}},_0x1f4774={};_0x1f4774[_0x57b0('0x43')]=_[_0x57b0('0x3f')](db[_0x57b0('0x50')][_0x57b0('0x3c')]);_0x1f4774[_0x57b0('0x3e')]=_['keys'](_0xb8f21['query']);_0x1f4774[_0x57b0('0x40')]=_[_0x57b0('0x41')](_0x1f4774[_0x57b0('0x43')],_0x1f4774['query']);_0x2ee9de[_0x57b0('0x42')]=_[_0x57b0('0x41')](_0x1f4774[_0x57b0('0x43')],qs[_0x57b0('0x44')](_0xb8f21[_0x57b0('0x3e')][_0x57b0('0x44')]));_0x2ee9de[_0x57b0('0x42')]=_0x2ee9de[_0x57b0('0x42')][_0x57b0('0x45')]?_0x2ee9de[_0x57b0('0x42')]:_0x1f4774[_0x57b0('0x43')];if(_0xb8f21[_0x57b0('0x3e')][_0x57b0('0x51')]){_0x2ee9de[_0x57b0('0x55')]=[{'all':!![]}];}_0x2ee9de=_[_0x57b0('0x4b')]({},_0x2ee9de,_0xb8f21[_0x57b0('0x4f')]);return db[_0x57b0('0x50')][_0x57b0('0x56')](_0x2ee9de)['then'](handleEntityNotFound(_0x5d02f4,null))[_0x57b0('0x21')](respondWithResult(_0x5d02f4,null))[_0x57b0('0x2b')](handleError(_0x5d02f4,null));};exports[_0x57b0('0x57')]=function(_0x4b7511,_0x56bcec){return db[_0x57b0('0x50')]['create'](_0x4b7511['body'],{})[_0x57b0('0x21')](respondWithResult(_0x56bcec,0xc9))['catch'](handleError(_0x56bcec,null));};exports[_0x57b0('0x58')]=function(_0x4ad368,_0x1ee98e){if(_0x4ad368[_0x57b0('0x59')]['id']){delete _0x4ad368['body']['id'];}return db['SmsMessage'][_0x57b0('0x56')]({'where':{'id':_0x4ad368[_0x57b0('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1ee98e,null))[_0x57b0('0x21')](saveUpdates(_0x4ad368[_0x57b0('0x59')],null))[_0x57b0('0x21')](respondWithResult(_0x1ee98e,null))[_0x57b0('0x2b')](handleError(_0x1ee98e,null));};exports['destroy']=function(_0x88b313,_0x3a881d){return db['SmsMessage'][_0x57b0('0x56')]({'where':{'id':_0x88b313[_0x57b0('0x5a')]['id']}})[_0x57b0('0x21')](handleEntityNotFound(_0x3a881d,null))['then'](removeEntity(_0x3a881d,null))[_0x57b0('0x2b')](handleError(_0x3a881d,null));};exports[_0x57b0('0x5b')]=function(_0x358ded,_0x55fde5){return db['SmsMessage'][_0x57b0('0x5b')]()['then'](respondWithResult(_0x55fde5,null))[_0x57b0('0x2b')](handleError(_0x55fde5,null));};var interaction_log=require('../../config/logger')(_0x57b0('0x5c'));exports['accept']=function(_0x5aa588,_0x323f57,_0x224853){var _0x4a8ad4={'channel':'sms'};if(_0x5aa588['body']['id']){delete _0x5aa588[_0x57b0('0x59')]['id'];}_0x5aa588[_0x57b0('0x59')][_0x57b0('0x5d')]=!![];_0x5aa588[_0x57b0('0x59')]['readAt']=moment()['format'](_0x57b0('0x5e'));_0x5aa588[_0x57b0('0x59')][_0x57b0('0x5f')]=_0x5aa588[_0x57b0('0x59')][_0x57b0('0x5f')]||_0x5aa588[_0x57b0('0x60')]['id'];return db['SmsMessage'][_0x57b0('0x56')]({'where':{'id':_0x5aa588[_0x57b0('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0x57b0('0x61')],'as':_0x57b0('0x62')}]})[_0x57b0('0x21')](handleEntityNotFound(_0x323f57,null))['then'](saveUpdates(_0x5aa588[_0x57b0('0x59')],null))[_0x57b0('0x21')](function(_0x19f35d){if(_0x19f35d){_0x4a8ad4[_0x57b0('0x28')]=_0x19f35d[_0x57b0('0x63')]({'plain':!![]});return db[_0x57b0('0x64')]['find']({'where':{'id':_0x19f35d['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x323f57,null))[_0x57b0('0x21')](function(_0x40d188){if(_0x40d188){return _0x40d188['update']({'UserId':_0x5aa588[_0x57b0('0x59')][_0x57b0('0x5f')],'read1stAt':_[_0x57b0('0x65')](_0x40d188[_0x57b0('0x66')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x46d600){if(_0x46d600){_0x4a8ad4[_0x57b0('0x67')]=_0x46d600[_0x57b0('0x63')]({'plain':!![]});interaction_log['info'](_0x57b0('0x68'),_0x5aa588['user']['id'],_0x5aa588['user']['name'],_0x5aa588[_0x57b0('0x60')]['role'],_0x4a8ad4[_0x57b0('0x67')]['id'],_0x5aa588[_0x57b0('0x59')]?JSON[_0x57b0('0x25')](_0x5aa588[_0x57b0('0x59')]):_0x57b0('0x69'));return respondWithRpcPromise(_0x57b0('0x6a'),_0x57b0('0x6b'),_0x4a8ad4);}return null;})[_0x57b0('0x21')](function(_0x12d801){if(_0x12d801){if(_0x5aa588['body'][_0x57b0('0x6c')]){_0x4a8ad4[_0x57b0('0x28')][_0x57b0('0x6d')]=util['format'](_0x57b0('0x6e'),_0x5aa588[_0x57b0('0x60')][_0x57b0('0x38')]);_0x4a8ad4[_0x57b0('0x28')][_0x57b0('0x6f')]=_0x4a8ad4['channel'];_0x4a8ad4['message'][_0x57b0('0x70')]=_0x57b0('0x71');return respondWithRpcPromise('EventManager',_0x57b0('0x72'),{'event':_0x57b0('0x73'),'message':_0x4a8ad4[_0x57b0('0x28')]},client9002)['then'](function(){return _0x4a8ad4;});}return _0x4a8ad4;}return null;})['then'](respondWithResult(_0x323f57,null))[_0x57b0('0x2b')](handleError(_0x323f57,null));};var interaction_log=require('../../config/logger')(_0x57b0('0x5c'));exports[_0x57b0('0x35')]=function(_0x371cd3,_0x199877,_0x32f519){var _0x44fa33={'agent':{},'channel':_0x57b0('0x74')};if(_0x371cd3[_0x57b0('0x59')]['id']){delete _0x371cd3['body']['id'];}_0x371cd3[_0x57b0('0x59')][_0x57b0('0x5f')]=_0x371cd3[_0x57b0('0x59')][_0x57b0('0x5f')]||_0x371cd3['user']['id'];_0x44fa33[_0x57b0('0x75')]['id']=_0x371cd3[_0x57b0('0x59')]['UserId'];return db[_0x57b0('0x50')][_0x57b0('0x56')]({'where':{'id':_0x371cd3[_0x57b0('0x5a')]['id'],'UserId':null}})[_0x57b0('0x21')](handleEntityNotFound(_0x199877,null))['then'](function(_0x54d0f6){if(_0x54d0f6){_0x44fa33[_0x57b0('0x28')]=_0x54d0f6[_0x57b0('0x63')]({'plain':!![]});return db[_0x57b0('0x64')][_0x57b0('0x56')]({'where':{'id':_0x54d0f6[_0x57b0('0x76')]}});}return null;})[_0x57b0('0x21')](handleEntityNotFound(_0x199877,null))[_0x57b0('0x21')](function(_0x46633d){if(_0x46633d){_0x44fa33[_0x57b0('0x67')]=_0x46633d[_0x57b0('0x63')]({'plain':!![]});interaction_log[_0x57b0('0x29')](_0x57b0('0x77'),_0x371cd3['user']['id'],_0x371cd3[_0x57b0('0x60')]['name'],_0x371cd3[_0x57b0('0x60')][_0x57b0('0x78')],_0x44fa33[_0x57b0('0x67')]['id'],_0x371cd3[_0x57b0('0x59')]?JSON[_0x57b0('0x25')](_0x371cd3[_0x57b0('0x59')]):_0x57b0('0x69'));return respondWithRpcPromise(_0x57b0('0x79'),'rejectMessage',_0x44fa33);}return null;})[_0x57b0('0x21')](function(_0x2d6808){if(_0x2d6808){_0x2d6808[_0x57b0('0x28')][_0x57b0('0x6d')]=util['format'](_0x57b0('0x6e'),_0x371cd3['user'][_0x57b0('0x38')]);_0x2d6808[_0x57b0('0x28')]['channel']=_0x44fa33[_0x57b0('0x6f')];_0x2d6808['message']['event']=_0x57b0('0x35');respondWithRpcPromise(_0x57b0('0x72'),'EventManager',{'event':_0x57b0('0x7a'),'message':_0x2d6808[_0x57b0('0x28')]},client9002);return _0x44fa33;}return null;})[_0x57b0('0x21')](respondWithResult(_0x199877,null))['catch'](handleError(_0x199877,null));};exports['status']=function(_0x369eba,_0xb5becf,_0x85a087){if(_0x369eba[_0x57b0('0x59')]['id']){delete _0x369eba[_0x57b0('0x59')]['id'];}var _0x3f14f1;return db[_0x57b0('0x50')]['find']({'where':{'id':_0x369eba['params']['id']}})['then'](handleEntityNotFound(_0xb5becf,null))['then'](function(_0x3a4e43){if(_0x3a4e43){_0x3f14f1=_0x3a4e43;return db[_0x57b0('0x7b')][_0x57b0('0x56')]({'where':{'id':_0x3a4e43[_0x57b0('0x7c')]}});}})['then'](handleEntityNotFound(_0xb5becf,null))[_0x57b0('0x21')](function(_0x40b843){if(_0x40b843){logger[_0x57b0('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s','status',_0x57b0('0x7d'),_0x40b843['type'],util['inspect'](_0x369eba[_0x57b0('0x59')],{'showHidden':![],'depth':null}));switch(_0x40b843[_0x57b0('0x4c')]){case _0x57b0('0x7e'):if(_0x369eba[_0x57b0('0x59')][_0x57b0('0x7f')]&&_0x369eba[_0x57b0('0x59')]['MessageSid']===_0x3f14f1[_0x57b0('0x80')]){return _0x3f14f1[_0x57b0('0x58')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x57b0('0x2d'),_0x57b0('0x7e'),util[_0x57b0('0x81')](_0x369eba[_0x57b0('0x59')],{'showHidden':![],'depth':null}));}break;case _0x57b0('0x82'):if(_0x369eba[_0x57b0('0x59')][_0x57b0('0x83')]&&_0x369eba[_0x57b0('0x59')][_0x57b0('0x83')]===_0x3f14f1[_0x57b0('0x80')]&&_[_0x57b0('0x84')]([_0x57b0('0x85'),_0x57b0('0x86')],_0x369eba['body'][_0x57b0('0x87')])>=0x0){return _0x3f14f1[_0x57b0('0x58')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x57b0('0x2d'),_0x57b0('0x88'),util[_0x57b0('0x81')](_0x369eba[_0x57b0('0x59')],{'showHidden':![],'depth':null}));}break;case _0x57b0('0x89'):var _0x552ac3=_0x369eba['body'][_0x57b0('0x8a')][0x0];if(_0x552ac3[_0x57b0('0x2d')][_0x57b0('0x8b')]===_0x57b0('0x8c')){return _0x3f14f1[_0x57b0('0x58')]({'read':!![]});}else{logger['error'](_0x57b0('0x8d'),_0x57b0('0x2d'),_0x57b0('0x89'),util[_0x57b0('0x81')](_0x369eba['body'],{'showHidden':![],'depth':null}));}break;}return _0x3f14f1;}})['then'](respondWithResult(_0xb5becf,null))['catch'](handleError(_0xb5becf,null));};
\ No newline at end of file
+var _0x8e44=['SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','end','json','offset','limit','status','set','Content-Range','apply','reject','update','destroy','then','stack','name','send','index','SmsMessage','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','show','params','rawAttributes','create','body','find','describe','sms-interactions','accept','sms','read','readAt','format','UserId','CmContact','Contact','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','user','role','null','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','agent','SmsInteraction','RejectMessage','rejectMessage','event','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId'];(function(_0x576811,_0x25ff72){var _0x4d66d6=function(_0x1b454e){while(--_0x1b454e){_0x576811['push'](_0x576811['shift']());}};_0x4d66d6(++_0x25ff72);}(_0x8e44,0x1ac));var _0x48e4=function(_0x1146d7,_0xa4368d){_0x1146d7=_0x1146d7-0x0;var _0x3fb9b2=_0x8e44[_0x1146d7];return _0x3fb9b2;};'use strict';var pdf=require(_0x48e4('0x0'));var emlformat=require(_0x48e4('0x1'));var rimraf=require(_0x48e4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x48e4('0x3'));var moment=require(_0x48e4('0x4'));var BPromise=require(_0x48e4('0x5'));var Mustache=require(_0x48e4('0x6'));var util=require('util');var path=require(_0x48e4('0x7'));var sox=require(_0x48e4('0x8'));var csv=require(_0x48e4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x48e4('0xa'));var crypto=require(_0x48e4('0xb'));var jsforce=require(_0x48e4('0xc'));var deskjs=require(_0x48e4('0xd'));var toCsv=require(_0x48e4('0x9'));var querystring=require(_0x48e4('0xe'));var Papa=require(_0x48e4('0xf'));var Redis=require(_0x48e4('0x10'));var authService=require(_0x48e4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x48e4('0x12'));var hardwareService=require(_0x48e4('0x13'));var logger=require(_0x48e4('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x48e4('0x15'));var db=require(_0x48e4('0x16'))['db'];config[_0x48e4('0x17')]=_[_0x48e4('0x18')](config['redis'],{'host':_0x48e4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x48e4('0x17')]));require(_0x48e4('0x1a'))[_0x48e4('0x1b')](socket);var jayson=require(_0x48e4('0x1c'));var client=jayson[_0x48e4('0x1d')][_0x48e4('0x1e')]({'port':0x232c});var client9002=jayson[_0x48e4('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x1c82d2,_0x15519c,_0x5c8fe5){if(_0x5c8fe5){var _0x171f89=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x171f89[_0x48e4('0x1f')](_0x15519c)){return _0x1c82d2;}else{throw new db['Sequelize'][(_0x48e4('0x20'))](_0x48e4('0x21'));}}else{return _0x1c82d2;}}function respondWithRpcPromise(_0x12fc37,_0x4ffc0d,_0x231dcd,_0x16e405){return new BPromise(function(_0x4e3943,_0x4e75f6){var _0xbaa743=_0x16e405||client;return _0xbaa743['request'](_0x12fc37,_0x231dcd)['then'](function(_0x113ff4){logger[_0x48e4('0x22')](_0x48e4('0x23'),_0x4ffc0d,_0x48e4('0x24'));logger[_0x48e4('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4ffc0d,'request\x20sent',JSON[_0x48e4('0x26')](_0x113ff4));if(_0x113ff4[_0x48e4('0x27')]){if(_0x113ff4[_0x48e4('0x27')][_0x48e4('0x28')]===0x1f4){logger[_0x48e4('0x27')](_0x48e4('0x23'),_0x4ffc0d,_0x113ff4[_0x48e4('0x27')][_0x48e4('0x29')]);return _0x4e75f6(_0x113ff4[_0x48e4('0x27')][_0x48e4('0x29')]);}logger[_0x48e4('0x27')]('SmsMessage,\x20%s,\x20%s',_0x4ffc0d,_0x113ff4[_0x48e4('0x27')][_0x48e4('0x29')]);return _0x4e3943(_0x113ff4['error'][_0x48e4('0x29')]);}else{logger[_0x48e4('0x22')]('SmsMessage,\x20%s,\x20%s',_0x4ffc0d,_0x48e4('0x24'));_0x4e3943(_0x113ff4[_0x48e4('0x2a')][_0x48e4('0x29')]);}})[_0x48e4('0x2b')](function(_0x1e7d7e){logger[_0x48e4('0x27')](_0x48e4('0x23'),_0x4ffc0d,_0x1e7d7e);_0x4e75f6(_0x1e7d7e);});});}function respondWithStatusCode(_0x4ae6ba,_0xb7627d){_0xb7627d=_0xb7627d||0xcc;return function(_0xcaa9cb){if(_0xcaa9cb){return _0x4ae6ba['sendStatus'](_0xb7627d);}return _0x4ae6ba['status'](_0xb7627d)[_0x48e4('0x2c')]();};}function respondWithResult(_0x4b8f3c,_0x346765){_0x346765=_0x346765||0xc8;return function(_0x214def){if(_0x214def){return _0x4b8f3c['status'](_0x346765)[_0x48e4('0x2d')](_0x214def);}};}function respondWithFilteredResult(_0x28c1,_0x14b545){return function(_0xea1c5b){if(_0xea1c5b){var _0x15a413=_0xea1c5b['count'],_0x4f6459=_0x14b545['offset'],_0x108f46=_0x14b545[_0x48e4('0x2e')]+_0x14b545[_0x48e4('0x2f')],_0x53511e;if(_0x108f46>=_0x15a413){_0x108f46=_0x15a413;_0x53511e=0xc8;}else{_0x53511e=0xce;}_0x28c1[_0x48e4('0x30')](_0x53511e);return _0x28c1[_0x48e4('0x31')](_0x48e4('0x32'),_0x4f6459+'-'+_0x108f46+'/'+_0x15a413)[_0x48e4('0x2d')](_0xea1c5b);}return null;};}function patchUpdates(_0x109c9d){return function(_0x45a052){try{jsonpatch[_0x48e4('0x33')](_0x45a052,_0x109c9d,!![]);}catch(_0x12af4d){return BPromise[_0x48e4('0x34')](_0x12af4d);}return _0x45a052['save']();};}function saveUpdates(_0x521a65,_0x5f13aa){return function(_0x3d336d){if(_0x3d336d){return _0x3d336d[_0x48e4('0x35')](_0x521a65)['then'](function(_0x2fc2ef){return _0x2fc2ef;});}return null;};}function removeEntity(_0x8ef937,_0x5ddf17){return function(_0x38da48){if(_0x38da48){return _0x38da48[_0x48e4('0x36')]()[_0x48e4('0x37')](function(){_0x8ef937[_0x48e4('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb5a6f3,_0x21a05c){return function(_0x4d83e9){if(!_0x4d83e9){_0xb5a6f3['sendStatus'](0x194);}return _0x4d83e9;};}function handleError(_0x1c4d86,_0x2d29cd){_0x2d29cd=_0x2d29cd||0x1f4;return function(_0x20923e){logger['error'](_0x20923e[_0x48e4('0x38')]);if(_0x20923e[_0x48e4('0x39')]){delete _0x20923e['name'];}_0x1c4d86[_0x48e4('0x30')](_0x2d29cd)[_0x48e4('0x3a')](_0x20923e);};}exports[_0x48e4('0x3b')]=function(_0xbe8ca1,_0x3a4b75){var _0x59b381={},_0x21e829={},_0x3f695e={'count':0x0,'rows':[]};var _0x44f206=_['map'](db[_0x48e4('0x3c')]['rawAttributes'],function(_0x465a2f){return{'name':_0x465a2f[_0x48e4('0x3d')],'type':_0x465a2f[_0x48e4('0x3e')][_0x48e4('0x3f')]};});_0x21e829[_0x48e4('0x40')]=_[_0x48e4('0x41')](_0x44f206,_0x48e4('0x39'));_0x21e829[_0x48e4('0x42')]=_[_0x48e4('0x43')](_0xbe8ca1[_0x48e4('0x42')]);_0x21e829[_0x48e4('0x44')]=_['intersection'](_0x21e829[_0x48e4('0x40')],_0x21e829[_0x48e4('0x42')]);_0x59b381[_0x48e4('0x45')]=_[_0x48e4('0x46')](_0x21e829[_0x48e4('0x40')],qs[_0x48e4('0x47')](_0xbe8ca1[_0x48e4('0x42')]['fields']));_0x59b381[_0x48e4('0x45')]=_0x59b381[_0x48e4('0x45')][_0x48e4('0x48')]?_0x59b381['attributes']:_0x21e829[_0x48e4('0x40')];if(!_0xbe8ca1[_0x48e4('0x42')][_0x48e4('0x49')]('nolimit')){_0x59b381['limit']=qs[_0x48e4('0x2f')](_0xbe8ca1[_0x48e4('0x42')]['limit']);_0x59b381[_0x48e4('0x2e')]=qs['offset'](_0xbe8ca1['query']['offset']);}_0x59b381['order']=qs[_0x48e4('0x4a')](_0xbe8ca1[_0x48e4('0x42')][_0x48e4('0x4a')]);_0x59b381[_0x48e4('0x4b')]=qs[_0x48e4('0x44')](_[_0x48e4('0x4c')](_0xbe8ca1['query'],_0x21e829[_0x48e4('0x44')]),_0x44f206);if(_0xbe8ca1[_0x48e4('0x42')]['filter']){_0x59b381['where']=_[_0x48e4('0x4d')](_0x59b381[_0x48e4('0x4b')],{'$or':_[_0x48e4('0x41')](_0x44f206,function(_0x34b9dc){if(_0x34b9dc['type']!==_0x48e4('0x4e')){var _0x25ea8e={};_0x25ea8e[_0x34b9dc[_0x48e4('0x39')]]={'$like':'%'+_0xbe8ca1[_0x48e4('0x42')][_0x48e4('0x4f')]+'%'};return _0x25ea8e;}})});}_0x59b381=_[_0x48e4('0x4d')]({},_0x59b381,_0xbe8ca1['options']);var _0x31dd8c={'where':_0x59b381[_0x48e4('0x4b')]};return db[_0x48e4('0x3c')][_0x48e4('0x50')](_0x31dd8c)[_0x48e4('0x37')](function(_0x384a52){_0x3f695e[_0x48e4('0x50')]=_0x384a52;if(_0xbe8ca1[_0x48e4('0x42')][_0x48e4('0x51')]){_0x59b381[_0x48e4('0x52')]=[{'all':!![]}];}return db[_0x48e4('0x3c')]['findAll'](_0x59b381);})[_0x48e4('0x37')](function(_0x48717f){_0x3f695e['rows']=_0x48717f;return _0x3f695e;})[_0x48e4('0x37')](respondWithFilteredResult(_0x3a4b75,_0x59b381))['catch'](handleError(_0x3a4b75,null));};exports[_0x48e4('0x53')]=function(_0x14511b,_0x3a5670){var _0x1f10e3={'raw':!![],'where':{'id':_0x14511b[_0x48e4('0x54')]['id']}},_0x214d1f={};_0x214d1f[_0x48e4('0x40')]=_['keys'](db['SmsMessage'][_0x48e4('0x55')]);_0x214d1f['query']=_[_0x48e4('0x43')](_0x14511b[_0x48e4('0x42')]);_0x214d1f[_0x48e4('0x44')]=_['intersection'](_0x214d1f[_0x48e4('0x40')],_0x214d1f[_0x48e4('0x42')]);_0x1f10e3[_0x48e4('0x45')]=_['intersection'](_0x214d1f[_0x48e4('0x40')],qs[_0x48e4('0x47')](_0x14511b[_0x48e4('0x42')][_0x48e4('0x47')]));_0x1f10e3[_0x48e4('0x45')]=_0x1f10e3['attributes'][_0x48e4('0x48')]?_0x1f10e3[_0x48e4('0x45')]:_0x214d1f['model'];if(_0x14511b[_0x48e4('0x42')][_0x48e4('0x51')]){_0x1f10e3[_0x48e4('0x52')]=[{'all':!![]}];}_0x1f10e3=_[_0x48e4('0x4d')]({},_0x1f10e3,_0x14511b['options']);return db['SmsMessage']['find'](_0x1f10e3)['then'](handleEntityNotFound(_0x3a5670,null))[_0x48e4('0x37')](respondWithResult(_0x3a5670,null))[_0x48e4('0x2b')](handleError(_0x3a5670,null));};exports[_0x48e4('0x56')]=function(_0x23727e,_0x32abe0){return db[_0x48e4('0x3c')][_0x48e4('0x56')](_0x23727e[_0x48e4('0x57')],{})[_0x48e4('0x37')](respondWithResult(_0x32abe0,0xc9))[_0x48e4('0x2b')](handleError(_0x32abe0,null));};exports[_0x48e4('0x35')]=function(_0x2f0955,_0x180ae4){if(_0x2f0955['body']['id']){delete _0x2f0955[_0x48e4('0x57')]['id'];}return db[_0x48e4('0x3c')][_0x48e4('0x58')]({'where':{'id':_0x2f0955[_0x48e4('0x54')]['id']}})[_0x48e4('0x37')](handleEntityNotFound(_0x180ae4,null))[_0x48e4('0x37')](saveUpdates(_0x2f0955[_0x48e4('0x57')],null))[_0x48e4('0x37')](respondWithResult(_0x180ae4,null))[_0x48e4('0x2b')](handleError(_0x180ae4,null));};exports[_0x48e4('0x36')]=function(_0x3a22b4,_0x4624b0){return db['SmsMessage']['find']({'where':{'id':_0x3a22b4[_0x48e4('0x54')]['id']}})[_0x48e4('0x37')](handleEntityNotFound(_0x4624b0,null))[_0x48e4('0x37')](removeEntity(_0x4624b0,null))[_0x48e4('0x2b')](handleError(_0x4624b0,null));};exports[_0x48e4('0x59')]=function(_0x599988,_0x256e79){return db['SmsMessage'][_0x48e4('0x59')]()[_0x48e4('0x37')](respondWithResult(_0x256e79,null))[_0x48e4('0x2b')](handleError(_0x256e79,null));};var interaction_log=require('../../config/logger')(_0x48e4('0x5a'));exports[_0x48e4('0x5b')]=function(_0x3e1b92,_0x18c18e,_0x20f0f0){var _0x153fb6={'channel':_0x48e4('0x5c')};if(_0x3e1b92['body']['id']){delete _0x3e1b92[_0x48e4('0x57')]['id'];}_0x3e1b92[_0x48e4('0x57')][_0x48e4('0x5d')]=!![];_0x3e1b92['body'][_0x48e4('0x5e')]=moment()[_0x48e4('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e1b92['body']['UserId']=_0x3e1b92[_0x48e4('0x57')][_0x48e4('0x60')]||_0x3e1b92['user']['id'];return db[_0x48e4('0x3c')][_0x48e4('0x58')]({'where':{'id':_0x3e1b92[_0x48e4('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x48e4('0x61')],'as':_0x48e4('0x62')}]})[_0x48e4('0x37')](handleEntityNotFound(_0x18c18e,null))[_0x48e4('0x37')](saveUpdates(_0x3e1b92[_0x48e4('0x57')],null))[_0x48e4('0x37')](function(_0x456a6c){if(_0x456a6c){_0x153fb6['message']=_0x456a6c['get']({'plain':!![]});return db['SmsInteraction'][_0x48e4('0x58')]({'where':{'id':_0x456a6c[_0x48e4('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x18c18e,null))[_0x48e4('0x37')](function(_0x4a6def){if(_0x4a6def){return _0x4a6def[_0x48e4('0x35')]({'UserId':_0x3e1b92[_0x48e4('0x57')][_0x48e4('0x60')],'read1stAt':_[_0x48e4('0x64')](_0x4a6def[_0x48e4('0x65')])?moment()[_0x48e4('0x5f')](_0x48e4('0x66')):undefined});}return null;})[_0x48e4('0x37')](function(_0x2ab596){if(_0x2ab596){_0x153fb6[_0x48e4('0x67')]=_0x2ab596[_0x48e4('0x68')]({'plain':!![]});interaction_log[_0x48e4('0x22')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3e1b92['user']['id'],_0x3e1b92[_0x48e4('0x69')]['name'],_0x3e1b92[_0x48e4('0x69')][_0x48e4('0x6a')],_0x153fb6['interaction']['id'],_0x3e1b92[_0x48e4('0x57')]?JSON[_0x48e4('0x26')](_0x3e1b92[_0x48e4('0x57')]):_0x48e4('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x48e4('0x6c'),_0x153fb6);}return null;})['then'](function(_0x3d9252){if(_0x3d9252){if(_0x3e1b92[_0x48e4('0x57')][_0x48e4('0x6d')]){_0x153fb6[_0x48e4('0x29')][_0x48e4('0x6e')]=util['format'](_0x48e4('0x6f'),_0x3e1b92['user'][_0x48e4('0x39')]);_0x153fb6[_0x48e4('0x29')][_0x48e4('0x70')]=_0x153fb6[_0x48e4('0x70')];_0x153fb6[_0x48e4('0x29')]['event']=_0x48e4('0x5b');return respondWithRpcPromise(_0x48e4('0x71'),_0x48e4('0x71'),{'event':_0x48e4('0x72'),'message':_0x153fb6[_0x48e4('0x29')]},client9002)[_0x48e4('0x37')](function(){return _0x153fb6;});}return _0x153fb6;}return null;})[_0x48e4('0x37')](respondWithResult(_0x18c18e,null))[_0x48e4('0x2b')](handleError(_0x18c18e,null));};var interaction_log=require(_0x48e4('0x14'))(_0x48e4('0x5a'));exports['reject']=function(_0x4b7106,_0x2f71e8,_0x5d6d17){var _0x4bc126={'agent':{},'channel':_0x48e4('0x5c')};if(_0x4b7106['body']['id']){delete _0x4b7106[_0x48e4('0x57')]['id'];}_0x4b7106['body'][_0x48e4('0x60')]=_0x4b7106['body'][_0x48e4('0x60')]||_0x4b7106[_0x48e4('0x69')]['id'];_0x4bc126[_0x48e4('0x73')]['id']=_0x4b7106['body']['UserId'];return db['SmsMessage'][_0x48e4('0x58')]({'where':{'id':_0x4b7106['params']['id'],'UserId':null}})[_0x48e4('0x37')](handleEntityNotFound(_0x2f71e8,null))[_0x48e4('0x37')](function(_0x58bb85){if(_0x58bb85){_0x4bc126['message']=_0x58bb85[_0x48e4('0x68')]({'plain':!![]});return db[_0x48e4('0x74')][_0x48e4('0x58')]({'where':{'id':_0x58bb85[_0x48e4('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x2f71e8,null))[_0x48e4('0x37')](function(_0xc44015){if(_0xc44015){_0x4bc126['interaction']=_0xc44015['get']({'plain':!![]});interaction_log[_0x48e4('0x22')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4b7106['user']['id'],_0x4b7106[_0x48e4('0x69')][_0x48e4('0x39')],_0x4b7106[_0x48e4('0x69')][_0x48e4('0x6a')],_0x4bc126[_0x48e4('0x67')]['id'],_0x4b7106['body']?JSON['stringify'](_0x4b7106[_0x48e4('0x57')]):_0x48e4('0x6b'));return respondWithRpcPromise(_0x48e4('0x75'),_0x48e4('0x76'),_0x4bc126);}return null;})[_0x48e4('0x37')](function(_0x33f9b7){if(_0x33f9b7){_0x33f9b7[_0x48e4('0x29')]['interface']=util[_0x48e4('0x5f')]('SIP/%s',_0x4b7106['user'][_0x48e4('0x39')]);_0x33f9b7[_0x48e4('0x29')][_0x48e4('0x70')]=_0x4bc126[_0x48e4('0x70')];_0x33f9b7[_0x48e4('0x29')][_0x48e4('0x77')]=_0x48e4('0x34');respondWithRpcPromise('EventManager',_0x48e4('0x71'),{'event':_0x48e4('0x78'),'message':_0x33f9b7['message']},client9002);return _0x4bc126;}return null;})['then'](respondWithResult(_0x2f71e8,null))[_0x48e4('0x2b')](handleError(_0x2f71e8,null));};exports[_0x48e4('0x30')]=function(_0x3d2014,_0x27d4a3,_0x7da4de){if(_0x3d2014[_0x48e4('0x57')]['id']){delete _0x3d2014[_0x48e4('0x57')]['id'];}var _0x130bea;return db[_0x48e4('0x3c')][_0x48e4('0x58')]({'where':{'id':_0x3d2014[_0x48e4('0x54')]['id']}})[_0x48e4('0x37')](handleEntityNotFound(_0x27d4a3,null))[_0x48e4('0x37')](function(_0x5c323e){if(_0x5c323e){_0x130bea=_0x5c323e;return db['SmsAccount'][_0x48e4('0x58')]({'where':{'id':_0x5c323e[_0x48e4('0x79')]}});}})[_0x48e4('0x37')](handleEntityNotFound(_0x27d4a3,null))[_0x48e4('0x37')](function(_0x4eec59){if(_0x4eec59){logger[_0x48e4('0x25')](_0x48e4('0x7a'),_0x48e4('0x30'),_0x48e4('0x7b'),_0x4eec59[_0x48e4('0x3e')],util[_0x48e4('0x7c')](_0x3d2014[_0x48e4('0x57')],{'showHidden':![],'depth':null}));switch(_0x4eec59[_0x48e4('0x3e')]){case _0x48e4('0x7d'):if(_0x3d2014[_0x48e4('0x57')][_0x48e4('0x7e')]&&_0x3d2014['body'][_0x48e4('0x7e')]===_0x130bea[_0x48e4('0x7f')]){return _0x130bea[_0x48e4('0x35')]({'read':!![]});}else{logger[_0x48e4('0x27')](_0x48e4('0x80'),'status','twilio',util[_0x48e4('0x7c')](_0x3d2014[_0x48e4('0x57')],{'showHidden':![],'depth':null}));}break;case _0x48e4('0x81'):if(_0x3d2014['body'][_0x48e4('0x82')]&&_0x3d2014[_0x48e4('0x57')][_0x48e4('0x82')]===_0x130bea[_0x48e4('0x7f')]&&_[_0x48e4('0x83')]([_0x48e4('0x84'),'delivered'],_0x3d2014[_0x48e4('0x57')][_0x48e4('0x85')])>=0x0){return _0x130bea[_0x48e4('0x35')]({'read':!![]});}else{logger[_0x48e4('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x48e4('0x30'),_0x48e4('0x86'),util[_0x48e4('0x7c')](_0x3d2014[_0x48e4('0x57')],{'showHidden':![],'depth':null}));}break;case _0x48e4('0x87'):var _0x1e3c73=_0x3d2014[_0x48e4('0x57')][_0x48e4('0x88')][0x0];if(_0x1e3c73[_0x48e4('0x30')][_0x48e4('0x89')]===_0x48e4('0x8a')){return _0x130bea[_0x48e4('0x35')]({'read':!![]});}else{logger[_0x48e4('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x48e4('0x30'),_0x48e4('0x87'),util[_0x48e4('0x7c')](_0x3d2014[_0x48e4('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x130bea;}})[_0x48e4('0x37')](respondWithResult(_0x27d4a3,null))[_0x48e4('0x2b')](handleError(_0x27d4a3,null));};
\ No newline at end of file
index d422a96..afc3788 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb1c=['hook','exports','events','../../mysqldb','SmsMessage','save','update','emit','hasOwnProperty'];(function(_0x98607e,_0x36181e){var _0x308cd0=function(_0x226ab9){while(--_0x226ab9){_0x98607e['push'](_0x98607e['shift']());}};_0x308cd0(++_0x36181e);}(_0xbb1c,0x16a));var _0xcbb1=function(_0x52c841,_0x1a77af){_0x52c841=_0x52c841-0x0;var _0x3f52dc=_0xbb1c[_0x52c841];return _0x3f52dc;};'use strict';var EventEmitter=require(_0xcbb1('0x0'));var SmsMessage=require(_0xcbb1('0x1'))['db'][_0xcbb1('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcbb1('0x3'),'afterUpdate':_0xcbb1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x196188){return function(_0x147536,_0x5c5368,_0x54a0da){SmsMessageEvents[_0xcbb1('0x5')](_0x196188+':'+_0x147536['id'],_0x147536);SmsMessageEvents['emit'](_0x196188,_0x147536);_0x54a0da(null);};}for(var e in events){if(events[_0xcbb1('0x6')](e)){var event=events[e];SmsMessage[_0xcbb1('0x7')](e,emitEvent(event));}}module[_0xcbb1('0x8')]=SmsMessageEvents;
\ No newline at end of file
+var _0xe820=['remove','emit','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x8e579f,_0x5d7ddd){var _0x438bcb=function(_0x1fb930){while(--_0x1fb930){_0x8e579f['push'](_0x8e579f['shift']());}};_0x438bcb(++_0x5d7ddd);}(_0xe820,0x114));var _0x0e82=function(_0x9d3ae8,_0x9217bc){_0x9d3ae8=_0x9d3ae8-0x0;var _0x24d9f2=_0xe820[_0x9d3ae8];return _0x24d9f2;};'use strict';var EventEmitter=require(_0x0e82('0x0'));var SmsMessage=require(_0x0e82('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0e82('0x2')](0x0);var events={'afterCreate':_0x0e82('0x3'),'afterUpdate':'update','afterDestroy':_0x0e82('0x4')};function emitEvent(_0x142a22){return function(_0x14100e,_0x8927ef,_0x37285c){SmsMessageEvents[_0x0e82('0x5')](_0x142a22+':'+_0x14100e['id'],_0x14100e);SmsMessageEvents[_0x0e82('0x5')](_0x142a22,_0x14100e);_0x37285c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x0e82('0x6')](e,emitEvent(event));}}module[_0x0e82('0x7')]=SmsMessageEvents;
\ No newline at end of file
index e35ece9..e0341b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x037e=['requestid','deliveryReport','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','Basic\x20%s','toString','http_code','queued_count','head','data','message_id','clickSend','authId','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','base64','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','hex','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','message','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','createdAt','catch','out','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','remote','/status?token=','token','sid','error','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','login?username=','username','GET','split','sms','POST','user_key','total_sent','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/'];(function(_0x8b8d7c,_0x313171){var _0x5c498c=function(_0x389b12){while(--_0x389b12){_0x8b8d7c['push'](_0x8b8d7c['shift']());}};_0x5c498c(++_0x313171);}(_0x037e,0x129));var _0xe037=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x037e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe037('0x0'));var util=require(_0xe037('0x1'));var logger=require(_0xe037('0x2'))(_0xe037('0x3'));var moment=require(_0xe037('0x4'));var BPromise=require(_0xe037('0x5'));var rp=require(_0xe037('0x6'));var fs=require('fs');var path=require(_0xe037('0x7'));var rimraf=require(_0xe037('0x8'));var config=require('../../config/environment');var attributes=require(_0xe037('0x9'));module[_0xe037('0xa')]=function(_0xfe0a2,_0x9ef8bd){return _0xfe0a2[_0xe037('0xb')]('SmsMessage',attributes,{'tableName':_0xe037('0xc'),'paranoid':![],'indexes':[{'name':_0xe037('0xd'),'fields':[_0xe037('0xd')]},{'name':_0xe037('0xe'),'fields':['body'],'type':_0xe037('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53c06e,_0x1555d8,_0x30652f){var _0x35c8d7=_0xfe0a2['models'];var _0x31311e=_0x53c06e[_0xe037('0x10')]({'plain':!![]});if(_0x31311e[_0xe037('0x11')][_0xe037('0x12')]()==='in'||_0x31311e[_0xe037('0x11')]['toLowerCase']()==='out'&&!_0x31311e[_0xe037('0x13')]&&!_[_0xe037('0x14')](_0x31311e[_0xe037('0x15')])){_0x35c8d7[_0xe037('0x16')]['findOne']({'where':{'id':_0x31311e[_0xe037('0x17')]}})[_0xe037('0x18')](function(_0xd402f8){if(_0xd402f8){_0xd402f8[_0xe037('0x19')]({'lastMsgAt':_0x31311e[_0xe037('0x1a')],'lastMsgDirection':_0x31311e[_0xe037('0x11')][_0xe037('0x12')]()});}})[_0xe037('0x1b')](function(_0x30e641){console['error'](_0x30e641);});}if(_0x31311e['direction']===_0xe037('0x1c')&&!_0x31311e['secret']){var _0x20ea21;_0x35c8d7[_0xe037('0x1d')][_0xe037('0x1e')]({'where':{'id':_0x31311e[_0xe037('0x1f')]},'raw':!![]})[_0xe037('0x18')](function(_0x459aa8){_0x20ea21=_0x459aa8;if(_0x20ea21&&_0x20ea21[_0xe037('0x20')]){switch(_0x20ea21['type']){case _0xe037('0x21'):var _0x1afea2=require(_0xe037('0x21'));if(_0x20ea21[_0xe037('0x22')]&&_0x20ea21[_0xe037('0x23')]&&_0x20ea21[_0xe037('0x24')]){var _0x47b013=new _0x1afea2(_0x20ea21['accountSid'],_0x20ea21['authToken']);_0x47b013[_0xe037('0x25')][_0xe037('0x26')]({'body':_0x31311e[_0xe037('0x27')],'to':_0x31311e[_0xe037('0x24')],'from':_0x20ea21[_0xe037('0x24')],'statusCallback':_0x20ea21[_0xe037('0x28')]+'/api/sms/messages/'+_0x31311e['id']+_0xe037('0x29')+_0x20ea21[_0xe037('0x2a')]})[_0xe037('0x18')](function(_0x35313c){if(_0x35313c[_0xe037('0x2b')]){return _0x53c06e[_0xe037('0x19')]({'messageId':_0x35313c[_0xe037('0x2b')]});}})[_0xe037('0x1b')](function(_0x320cf1){logger[_0xe037('0x2c')](_0xe037('0x2d'),_0xe037('0x2e'),_0xe037('0x21'),util[_0xe037('0x2f')](_0x320cf1,{'showHidden':![],'depth':null}));});}else{logger[_0xe037('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe037('0x2e'),'twilio',_0xe037('0x30'));}break;case _0xe037('0x31'):var _0x52f420=_0xe037('0x32');if(_0x20ea21['username']&&_0x20ea21[_0xe037('0x33')]){var _0x24ddb2={'recipient':[_0x31311e['phone']],'message':_0x31311e[_0xe037('0x27')],'message_type':_0x20ea21[_0xe037('0x34')]};if(_0x20ea21[_0xe037('0x34')]&&_0x20ea21[_0xe037('0x34')]!=='SI'){_0x24ddb2[_0xe037('0x35')]=_0x20ea21[_0xe037('0x24')];}var _0xa889ff={'url':_0x52f420+_0xe037('0x36')+_0x20ea21[_0xe037('0x37')]+'&password='+_0x20ea21[_0xe037('0x33')],'method':_0xe037('0x38')};rp(_0xa889ff)[_0xe037('0x18')](function(_0x2d5235){var _0x3d4be=_0x2d5235[_0xe037('0x39')](';');var _0x27475e={'user_key':_0x3d4be[0x0],'session_key':_0x3d4be[0x1]};_0xa889ff={'url':_0x52f420+_0xe037('0x3a'),'method':_0xe037('0x3b'),'headers':{'user_key':_0x27475e[_0xe037('0x3c')],'Session_key':_0x27475e['session_key']},'json':!![],'body':_0x24ddb2};return rp(_0xa889ff);})[_0xe037('0x18')](function(_0x17a03d){if(_0x17a03d[_0xe037('0x3d')]>=0x1){var _0x5b49d1={'messageId':_0x17a03d['internal_order_id']};if(_0x20ea21[_0xe037('0x34')]!=='GP'||!_0x20ea21['deliveryReport']){_0x5b49d1['read']=!![];}return _0x53c06e[_0xe037('0x19')](_0x5b49d1);}else{return logger[_0xe037('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe037('0x31'),util[_0xe037('0x2f')](_0x17a03d,{'showHidden':![],'depth':null}));}})[_0xe037('0x1b')](function(_0xbedc23){return logger[_0xe037('0x2c')](_0xe037('0x2d'),_0xe037('0x2e'),'skebby',util[_0xe037('0x2f')](_0xbedc23,{'showHidden':![],'depth':null}));});}else{logger[_0xe037('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe037('0x2e'),_0xe037('0x31'),_0xe037('0x3e'));}break;case _0xe037('0x3f'):if(_0x20ea21[_0xe037('0x23')]){var _0x47a580={'recipient':_0x31311e[_0xe037('0x24')],'message':_0x31311e[_0xe037('0x27')],'sender':_0x20ea21[_0xe037('0x40')]||_0x20ea21['phone'],'authorization':_0x20ea21[_0xe037('0x23')]};var _0x1555d8={'method':_0xe037('0x3b'),'uri':_0xe037('0x41'),'body':_0x47a580,'json':!![]};rp(_0x1555d8)[_0xe037('0x18')](function(_0x4a3afd){var _0xa9359e={'messageId':_0x4a3afd[_0xe037('0x42')]};if(!_0x20ea21[_0xe037('0x43')]){_0xa9359e[_0xe037('0x44')]=!![];}return _0x53c06e['update'](_0xa9359e);})[_0xe037('0x1b')](function(_0x201d1b){logger[_0xe037('0x2c')](_0xe037('0x2d'),_0xe037('0x2e'),_0xe037('0x3f'),util[_0xe037('0x2f')](_0x201d1b,{'showHidden':![],'depth':null}));});}else{logger[_0xe037('0x2c')](_0xe037('0x2d'),_0xe037('0x2e'),_0xe037('0x3f'),_0xe037('0x45'));}break;case _0xe037('0x46'):if(_0x20ea21['username']&&_0x20ea21[_0xe037('0x33')]){var _0x47a580={'messages':[{'source':_0xe037('0x47'),'to':_0x31311e['phone'],'body':_0x31311e[_0xe037('0x27')],'from':_0x20ea21[_0xe037('0x40')]||_0x20ea21[_0xe037('0x24')]}]};var _0x3e4298=util[_0xe037('0x48')]('%s:%s',_0x20ea21['username'],_0x20ea21[_0xe037('0x33')]);var _0x1555d8={'method':_0xe037('0x3b'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x47a580,'headers':{'Authorization':util['format'](_0xe037('0x49'),new Buffer(_0x3e4298)[_0xe037('0x4a')]('base64'))},'json':!![]};rp(_0x1555d8)[_0xe037('0x18')](function(_0x21d7ba){if(_0x21d7ba[_0xe037('0x4b')]>=0xc8&&_0x21d7ba[_0xe037('0x4b')]<=0xce){if(_0x21d7ba['data']&&_0x21d7ba['data'][_0xe037('0x4c')]>0x0){var _0x393fa7=_[_0xe037('0x4d')](_0x21d7ba[_0xe037('0x4e')]['messages']);var _0x245205={'messageId':_0x393fa7[_0xe037('0x4f')]};if(!_0x20ea21['deliveryReport']){_0x245205['read']=!![];}return _0x53c06e[_0xe037('0x19')](_0x245205);}else{logger['error'](_0xe037('0x2d'),_0xe037('0x2e'),'clickSend',util[_0xe037('0x2f')](_0x21d7ba,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xe037('0x2d'),'afterCreate','clickSend',util['inspect'](_0x21d7ba,{'showHidden':![],'depth':null}));}})[_0xe037('0x1b')](function(_0x93bd0f){logger[_0xe037('0x2c')](_0xe037('0x2d'),_0xe037('0x2e'),_0xe037('0x50'),util[_0xe037('0x2f')](_0x93bd0f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe037('0x2d'),_0xe037('0x2e'),_0xe037('0x50'),_0xe037('0x3e'));}break;case'plivo':if(_0x20ea21[_0xe037('0x51')]&&_0x20ea21[_0xe037('0x23')]){var _0x47a580={'dst':_0x31311e[_0xe037('0x24')],'text':_0x31311e['body'],'src':_0x20ea21[_0xe037('0x40')]||_0x20ea21[_0xe037('0x24')],'url':_0x20ea21[_0xe037('0x28')]+_0xe037('0x52')+_0x31311e['id']+_0xe037('0x29')+_0x20ea21[_0xe037('0x2a')]};var _0x3e4298=util[_0xe037('0x48')]('%s:%s',_0x20ea21['authId'],_0x20ea21[_0xe037('0x23')]);var _0x1555d8={'method':_0xe037('0x3b'),'uri':util[_0xe037('0x48')](_0xe037('0x53'),_0x20ea21[_0xe037('0x51')]),'body':_0x47a580,'headers':{'Authorization':util[_0xe037('0x48')]('Basic\x20%s',new Buffer(_0x3e4298)['toString'](_0xe037('0x54')))},'json':!![]};rp(_0x1555d8)['then'](function(_0x299027){var _0x57c2ec={'messageId':_0x299027['message_uuid'][0x0]};return _0x53c06e[_0xe037('0x19')](_0x57c2ec);})[_0xe037('0x1b')](function(_0x1a65f3){logger[_0xe037('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe037('0x2e'),_0xe037('0x55'),util[_0xe037('0x2f')](_0x1a65f3,{'showHidden':![],'depth':null}));});}else{logger[_0xe037('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe037('0x2e'),_0xe037('0x55'),_0xe037('0x56'));}break;case _0xe037('0x57'):if(_0x20ea21[_0xe037('0x37')]&&_0x20ea21[_0xe037('0x33')]){if(_0x20ea21['baseUrl']){var _0x241147={'method':_0xe037('0x3b'),'uri':_0x20ea21['baseUrl']+'/auth/1/session','body':{'username':_0x20ea21['username'],'password':_0x20ea21[_0xe037('0x33')]},'json':!![]};return rp(_0x241147)[_0xe037('0x18')](function(_0x63c208){var _0x420200={'method':_0xe037('0x3b'),'uri':_0x20ea21[_0xe037('0x58')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x20ea21[_0xe037('0x24')],'destinations':[{'to':_0x31311e[_0xe037('0x24')]}],'text':_0x31311e[_0xe037('0x27')],'notifyUrl':_0x20ea21[_0xe037('0x28')]+_0xe037('0x52')+_0x31311e['id']+'/status?token='+_0x20ea21[_0xe037('0x2a')],'notifyContentType':_0xe037('0x59'),'callbackData':_0x20ea21['phone']+';'+_0x31311e[_0xe037('0x27')]}]},'headers':{'Authorization':_0xe037('0x5a')+_0x63c208[_0xe037('0x2a')]},'json':!![]};return rp(_0x420200)[_0xe037('0x18')](function(_0x2ab1e0){if(_0x2ab1e0[_0xe037('0x25')]){var _0x4e0f5a={'messageId':_0x2ab1e0[_0xe037('0x25')][0x0][_0xe037('0xd')]};if(!_0x20ea21[_0xe037('0x43')]){_0x4e0f5a[_0xe037('0x44')]=!![];}return _0x53c06e[_0xe037('0x19')](_0x4e0f5a);}else{return logger[_0xe037('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe037('0x2e'),_0xe037('0x57'),util[_0xe037('0x2f')](_0x2ab1e0,{'showHidden':![],'depth':null}));}});})[_0xe037('0x1b')](function(_0x1dd607){return logger[_0xe037('0x2c')](_0xe037('0x2d'),_0xe037('0x2e'),_0xe037('0x57'),util['inspect'](_0x1dd607,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe037('0x2d'),_0xe037('0x2e'),_0xe037('0x57'),_0xe037('0x5b'));}}else{logger[_0xe037('0x2c')](_0xe037('0x2d'),_0xe037('0x2e'),'infobip',_0xe037('0x3e'));}break;case _0xe037('0x5c'):var _0x31113f=require(_0xe037('0x5d'));if(_0x20ea21[_0xe037('0x5e')]){var _0x5cbe9a={};_0x5cbe9a[_0xe037('0x5f')]=_0x20ea21[_0xe037('0x37')];_0x5cbe9a[_0xe037('0x24')]=_0x31311e['phone'];_0x5cbe9a[_0xe037('0x35')]=_0x20ea21[_0xe037('0x24')];_0x5cbe9a[_0xe037('0x60')]=_0x31311e[_0xe037('0x27')];_0x5cbe9a[_0xe037('0x61')]=+new Date();var _0x5a3e1b='';var _0xc81c2a='';var _0x576990=Object[_0xe037('0x62')](_0x5cbe9a);_0x576990[_0xe037('0x63')]();for(var _0x2ebb2e=0x0;_0x2ebb2e<_0x576990[_0xe037('0x64')];_0x2ebb2e++){if(_0x5a3e1b!=''){_0x5a3e1b+='&';}_0x5a3e1b+=_0x576990[_0x2ebb2e]+'='+encodeURIComponent(_0x5cbe9a[_0x576990[_0x2ebb2e]]);_0xc81c2a+=_0x5cbe9a[_0x576990[_0x2ebb2e]];}_0xc81c2a+=_0x20ea21[_0xe037('0x5e')];_0xc81c2a=_0x31113f[_0xe037('0x65')]('md5')[_0xe037('0x19')](_0xc81c2a)['digest'](_0xe037('0x66'));if(_0x5a3e1b!==''){_0x5a3e1b+='&';}_0x5a3e1b+='signature='+_0xc81c2a;var _0xa889ff={'method':_0xe037('0x38'),'uri':_0x20ea21['baseUrl']+_0xe037('0x67')+_0x5a3e1b,'json':!![]};return rp(_0xa889ff)[_0xe037('0x18')](function(_0x1ad596){var _0x4c197a=Object[_0xe037('0x62')](_0x1ad596);if(_0x1ad596[_0x4c197a[0x0]][_0xe037('0x2c')]&&parseInt(_0x1ad596[_0x4c197a[0x0]]['error'])===0x0){var _0x32c518={'messageId':_0x1ad596[_0x4c197a[0x0]]['id_sms']};if(!_0x20ea21['deliveryReport']){_0x32c518[_0xe037('0x44')]=!![];}return _0x53c06e[_0xe037('0x19')](_0x32c518);}else{return logger[_0xe037('0x2c')](_0xe037('0x2d'),_0xe037('0x2e'),_0xe037('0x5c'),util[_0xe037('0x2f')](_0x1ad596['error'],{'showHidden':![],'depth':null}));}})[_0xe037('0x1b')](function(_0x1b7bb9){return logger[_0xe037('0x2c')](_0xe037('0x2d'),_0xe037('0x2e'),'csc',util[_0xe037('0x2f')](_0x1b7bb9,{'showHidden':![],'depth':null}));});}else{logger[_0xe037('0x2c')](_0xe037('0x2d'),'afterCreate','csc',_0xe037('0x68'));}break;case _0xe037('0x69'):if(_0x20ea21[_0xe037('0x5e')]){var _0x5d0ffd={'method':'POST','uri':_0xe037('0x6a'),'headers':{'Authorization':_0x20ea21[_0xe037('0x5e')]},'body':{'content':_0x31311e[_0xe037('0x27')],'to':[_0x31311e[_0xe037('0x24')]],'from':_0x20ea21[_0xe037('0x24')],'binary':![],'clientMessageId':_0xe037('0x6b'),'charset':_0xe037('0x6c')},'json':!![]};rp(_0x5d0ffd)[_0xe037('0x18')](function(_0x14ddb3){if(!_0x14ddb3[_0xe037('0x2c')]){var _0x22594d={'messageId':_0x14ddb3[_0xe037('0x25')][0x0]['apiMessageId']};if(!_0x20ea21['deliveryReport']){_0x22594d[_0xe037('0x44')]=!![];}return _0x53c06e['update'](_0x22594d);}else{return logger[_0xe037('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe037('0x2e'),_0xe037('0x69'),util[_0xe037('0x2f')](_0x14ddb3[_0xe037('0x2c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3473a8){return logger['error'](_0xe037('0x2d'),_0xe037('0x2e'),_0xe037('0x69'),util[_0xe037('0x2f')](_0x3473a8,{'showHidden':![],'depth':null}));});}else{logger[_0xe037('0x2c')](_0xe037('0x2d'),_0xe037('0x2e'),_0xe037('0x69'),_0xe037('0x68'));}break;case _0xe037('0x6d'):if(_0x20ea21[_0xe037('0x5e')]){var _0x52dec4={};var _0xa889ff={'method':_0xe037('0x3b'),'uri':_0xe037('0x6e'),'headers':{'Authorization':_0xe037('0x6f')+_0x20ea21[_0xe037('0x5e')],'Content-Type':_0xe037('0x59')},'body':{'from':_0x20ea21[_0xe037('0x24')],'to':_0x31311e[_0xe037('0x24')],'text':_0x31311e[_0xe037('0x27')]},'json':!![]};return rp(_0xa889ff)[_0xe037('0x18')](function(_0x5a700d){if(_0x5a700d[_0xe037('0x70')]==0xca){_0x52dec4['message']=_0x5a700d;var _0xfdd280={'method':_0xe037('0x3b'),'uri':_0xe037('0x71'),'headers':{'Authorization':_0xe037('0x6f')+_0x20ea21[_0xe037('0x5e')],'Content-Type':_0xe037('0x59')},'body':{'refid':_0x52dec4['message']['refid']},'json':!![]};return rp(_0xfdd280)[_0xe037('0x18')](function(_0x1b8779){_0x52dec4[_0xe037('0x72')]=_0x1b8779;var _0x41b604={'messageId':_0x52dec4[_0xe037('0x73')][_0xe037('0x74')],'read':!![]};return _0x53c06e[_0xe037('0x19')](_0x41b604);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe037('0x2e'),_0xe037('0x6d'),util[_0xe037('0x2f')](_0x5a700d,{'showHidden':![],'depth':null}));}})[_0xe037('0x1b')](function(_0x381ad9){return logger[_0xe037('0x2c')](_0xe037('0x2d'),'afterCreate','intelepeer',util[_0xe037('0x2f')](_0x381ad9,{'showHidden':![],'depth':null}));});}else{return logger[_0xe037('0x2c')](_0xe037('0x2d'),_0xe037('0x2e'),'intelepeer',_0xe037('0x75'));}break;}}})[_0xe037('0x76')](function(){_0x30652f();});}else{_0x30652f();}}},'charset':_0xe037('0x77'),'collate':_0xe037('0x78')});};
\ No newline at end of file
+var _0xebda=['/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','split','sms','POST','total_sent','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','clickSend','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','authId','toString','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','timestamp','keys','length','digest','hex','/external/get/send.php?','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','body','get','direction','toLowerCase','out','secret','UserId','SmsInteraction','findOne','SmsInteractionId','update','catch','then','type','accountSid','authToken','phone','messages','create','remote'];(function(_0x4f8931,_0x2879a8){var _0x35c82d=function(_0x43a484){while(--_0x43a484){_0x4f8931['push'](_0x4f8931['shift']());}};_0x35c82d(++_0x2879a8);}(_0xebda,0x12f));var _0xaebd=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xebda[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0xaebd('0x0'));var util=require(_0xaebd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaebd('0x2'));var BPromise=require(_0xaebd('0x3'));var rp=require(_0xaebd('0x4'));var fs=require('fs');var path=require(_0xaebd('0x5'));var rimraf=require(_0xaebd('0x6'));var config=require(_0xaebd('0x7'));var attributes=require('./smsMessage.attributes');module[_0xaebd('0x8')]=function(_0x451995,_0x5a3a3b){return _0x451995[_0xaebd('0x9')](_0xaebd('0xa'),attributes,{'tableName':_0xaebd('0xb'),'paranoid':![],'indexes':[{'name':_0xaebd('0xc'),'fields':[_0xaebd('0xc')]},{'name':'fti_sms_messages','fields':[_0xaebd('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x21f52e,_0xcdc332,_0x19d2a9){var _0x16b4c1=_0x451995['models'];var _0x537261=_0x21f52e[_0xaebd('0xe')]({'plain':!![]});if(_0x537261[_0xaebd('0xf')]['toLowerCase']()==='in'||_0x537261[_0xaebd('0xf')][_0xaebd('0x10')]()===_0xaebd('0x11')&&!_0x537261[_0xaebd('0x12')]&&!_['isNil'](_0x537261[_0xaebd('0x13')])){_0x16b4c1[_0xaebd('0x14')][_0xaebd('0x15')]({'where':{'id':_0x537261[_0xaebd('0x16')]}})['then'](function(_0x161160){if(_0x161160){_0x161160[_0xaebd('0x17')]({'lastMsgAt':_0x537261['createdAt'],'lastMsgDirection':_0x537261[_0xaebd('0xf')][_0xaebd('0x10')]()});}})[_0xaebd('0x18')](function(_0xbe606b){console['error'](_0xbe606b);});}if(_0x537261[_0xaebd('0xf')]===_0xaebd('0x11')&&!_0x537261[_0xaebd('0x12')]){var _0x493607;_0x16b4c1['SmsAccount']['find']({'where':{'id':_0x537261['SmsAccountId']},'raw':!![]})[_0xaebd('0x19')](function(_0x208a9f){_0x493607=_0x208a9f;if(_0x493607&&_0x493607[_0xaebd('0x1a')]){switch(_0x493607[_0xaebd('0x1a')]){case'twilio':var _0x375053=require('twilio');if(_0x493607[_0xaebd('0x1b')]&&_0x493607[_0xaebd('0x1c')]&&_0x493607[_0xaebd('0x1d')]){var _0x415d7d=new _0x375053(_0x493607['accountSid'],_0x493607[_0xaebd('0x1c')]);_0x415d7d[_0xaebd('0x1e')][_0xaebd('0x1f')]({'body':_0x537261[_0xaebd('0xd')],'to':_0x537261['phone'],'from':_0x493607[_0xaebd('0x1d')],'statusCallback':_0x493607[_0xaebd('0x20')]+'/api/sms/messages/'+_0x537261['id']+_0xaebd('0x21')+_0x493607[_0xaebd('0x22')]})[_0xaebd('0x19')](function(_0x3c4014){if(_0x3c4014[_0xaebd('0x23')]){return _0x21f52e[_0xaebd('0x17')]({'messageId':_0x3c4014[_0xaebd('0x23')]});}})[_0xaebd('0x18')](function(_0x4644b1){logger[_0xaebd('0x24')](_0xaebd('0x25'),_0xaebd('0x26'),_0xaebd('0x27'),util[_0xaebd('0x28')](_0x4644b1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xaebd('0x25'),_0xaebd('0x26'),_0xaebd('0x27'),_0xaebd('0x29'));}break;case'skebby':var _0x111f8f=_0xaebd('0x2a');if(_0x493607[_0xaebd('0x2b')]&&_0x493607[_0xaebd('0x2c')]){var _0x2426c4={'recipient':[_0x537261[_0xaebd('0x1d')]],'message':_0x537261[_0xaebd('0xd')],'message_type':_0x493607[_0xaebd('0x2d')]};if(_0x493607[_0xaebd('0x2d')]&&_0x493607[_0xaebd('0x2d')]!=='SI'){_0x2426c4[_0xaebd('0x2e')]=_0x493607[_0xaebd('0x1d')];}var _0x2e29d6={'url':_0x111f8f+_0xaebd('0x2f')+_0x493607['username']+'&password='+_0x493607['password'],'method':_0xaebd('0x30')};rp(_0x2e29d6)[_0xaebd('0x19')](function(_0x3942f8){var _0x263fa8=_0x3942f8[_0xaebd('0x31')](';');var _0x339150={'user_key':_0x263fa8[0x0],'session_key':_0x263fa8[0x1]};_0x2e29d6={'url':_0x111f8f+_0xaebd('0x32'),'method':_0xaebd('0x33'),'headers':{'user_key':_0x339150['user_key'],'Session_key':_0x339150['session_key']},'json':!![],'body':_0x2426c4};return rp(_0x2e29d6);})[_0xaebd('0x19')](function(_0x338828){if(_0x338828[_0xaebd('0x34')]>=0x1){var _0x3bf11f={'messageId':_0x338828[_0xaebd('0x35')]};if(_0x493607[_0xaebd('0x2d')]!=='GP'||!_0x493607[_0xaebd('0x36')]){_0x3bf11f[_0xaebd('0x37')]=!![];}return _0x21f52e[_0xaebd('0x17')](_0x3bf11f);}else{return logger[_0xaebd('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaebd('0x26'),_0xaebd('0x38'),util[_0xaebd('0x28')](_0x338828,{'showHidden':![],'depth':null}));}})[_0xaebd('0x18')](function(_0x5b7ec1){return logger[_0xaebd('0x24')](_0xaebd('0x25'),'afterCreate',_0xaebd('0x38'),util[_0xaebd('0x28')](_0x5b7ec1,{'showHidden':![],'depth':null}));});}else{logger[_0xaebd('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xaebd('0x38'),_0xaebd('0x39'));}break;case _0xaebd('0x3a'):if(_0x493607['authToken']){var _0x913287={'recipient':_0x537261[_0xaebd('0x1d')],'message':_0x537261['body'],'sender':_0x493607[_0xaebd('0x3b')]||_0x493607[_0xaebd('0x1d')],'authorization':_0x493607['authToken']};var _0xcdc332={'method':_0xaebd('0x33'),'uri':_0xaebd('0x3c'),'body':_0x913287,'json':!![]};rp(_0xcdc332)[_0xaebd('0x19')](function(_0x3b3460){var _0x5368af={'messageId':_0x3b3460[_0xaebd('0x3d')]};if(!_0x493607[_0xaebd('0x36')]){_0x5368af[_0xaebd('0x37')]=!![];}return _0x21f52e[_0xaebd('0x17')](_0x5368af);})[_0xaebd('0x18')](function(_0x3eddec){logger[_0xaebd('0x24')](_0xaebd('0x25'),'afterCreate',_0xaebd('0x3a'),util['inspect'](_0x3eddec,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaebd('0x26'),_0xaebd('0x3a'),_0xaebd('0x3e'));}break;case _0xaebd('0x3f'):if(_0x493607[_0xaebd('0x2b')]&&_0x493607[_0xaebd('0x2c')]){var _0x913287={'messages':[{'source':_0xaebd('0x40'),'to':_0x537261[_0xaebd('0x1d')],'body':_0x537261[_0xaebd('0xd')],'from':_0x493607['senderString']||_0x493607[_0xaebd('0x1d')]}]};var _0xe56ee0=util[_0xaebd('0x41')](_0xaebd('0x42'),_0x493607[_0xaebd('0x2b')],_0x493607['password']);var _0xcdc332={'method':_0xaebd('0x33'),'uri':_0xaebd('0x43'),'body':_0x913287,'headers':{'Authorization':util['format'](_0xaebd('0x44'),new Buffer(_0xe56ee0)['toString'](_0xaebd('0x45')))},'json':!![]};rp(_0xcdc332)[_0xaebd('0x19')](function(_0x3fe9e9){if(_0x3fe9e9[_0xaebd('0x46')]>=0xc8&&_0x3fe9e9[_0xaebd('0x46')]<=0xce){if(_0x3fe9e9[_0xaebd('0x47')]&&_0x3fe9e9[_0xaebd('0x47')][_0xaebd('0x48')]>0x0){var _0x569759=_[_0xaebd('0x49')](_0x3fe9e9[_0xaebd('0x47')][_0xaebd('0x1e')]);var _0x4bfdf1={'messageId':_0x569759['message_id']};if(!_0x493607[_0xaebd('0x36')]){_0x4bfdf1['read']=!![];}return _0x21f52e[_0xaebd('0x17')](_0x4bfdf1);}else{logger[_0xaebd('0x24')](_0xaebd('0x25'),'afterCreate',_0xaebd('0x4a'),util['inspect'](_0x3fe9e9,{'showHidden':![],'depth':null}));}}else{logger[_0xaebd('0x24')](_0xaebd('0x25'),_0xaebd('0x26'),_0xaebd('0x4a'),util['inspect'](_0x3fe9e9,{'showHidden':![],'depth':null}));}})['catch'](function(_0xbfb1ff){logger[_0xaebd('0x24')](_0xaebd('0x25'),_0xaebd('0x26'),_0xaebd('0x4a'),util[_0xaebd('0x28')](_0xbfb1ff,{'showHidden':![],'depth':null}));});}else{logger[_0xaebd('0x24')](_0xaebd('0x25'),_0xaebd('0x26'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x493607['authId']&&_0x493607[_0xaebd('0x1c')]){var _0x913287={'dst':_0x537261[_0xaebd('0x1d')],'text':_0x537261[_0xaebd('0xd')],'src':_0x493607[_0xaebd('0x3b')]||_0x493607[_0xaebd('0x1d')],'url':_0x493607[_0xaebd('0x20')]+_0xaebd('0x4b')+_0x537261['id']+_0xaebd('0x21')+_0x493607['token']};var _0xe56ee0=util[_0xaebd('0x41')](_0xaebd('0x42'),_0x493607['authId'],_0x493607[_0xaebd('0x1c')]);var _0xcdc332={'method':_0xaebd('0x33'),'uri':util[_0xaebd('0x41')](_0xaebd('0x4c'),_0x493607[_0xaebd('0x4d')]),'body':_0x913287,'headers':{'Authorization':util['format'](_0xaebd('0x44'),new Buffer(_0xe56ee0)[_0xaebd('0x4e')](_0xaebd('0x45')))},'json':!![]};rp(_0xcdc332)['then'](function(_0x52f6ef){var _0x1e4c97={'messageId':_0x52f6ef[_0xaebd('0x4f')][0x0]};return _0x21f52e[_0xaebd('0x17')](_0x1e4c97);})[_0xaebd('0x18')](function(_0x48ea49){logger[_0xaebd('0x24')](_0xaebd('0x25'),'afterCreate',_0xaebd('0x50'),util['inspect'](_0x48ea49,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaebd('0x26'),_0xaebd('0x50'),_0xaebd('0x51'));}break;case _0xaebd('0x52'):if(_0x493607[_0xaebd('0x2b')]&&_0x493607['password']){if(_0x493607[_0xaebd('0x53')]){var _0x59feb9={'method':_0xaebd('0x33'),'uri':_0x493607[_0xaebd('0x53')]+_0xaebd('0x54'),'body':{'username':_0x493607[_0xaebd('0x2b')],'password':_0x493607[_0xaebd('0x2c')]},'json':!![]};return rp(_0x59feb9)['then'](function(_0x443b0a){var _0x484e53={'method':_0xaebd('0x33'),'uri':_0x493607[_0xaebd('0x53')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x493607[_0xaebd('0x1d')],'destinations':[{'to':_0x537261[_0xaebd('0x1d')]}],'text':_0x537261[_0xaebd('0xd')],'notifyUrl':_0x493607[_0xaebd('0x20')]+_0xaebd('0x4b')+_0x537261['id']+'/status?token='+_0x493607[_0xaebd('0x22')],'notifyContentType':_0xaebd('0x55'),'callbackData':_0x493607[_0xaebd('0x1d')]+';'+_0x537261['body']}]},'headers':{'Authorization':_0xaebd('0x56')+_0x443b0a[_0xaebd('0x22')]},'json':!![]};return rp(_0x484e53)['then'](function(_0x11f24b){if(_0x11f24b[_0xaebd('0x1e')]){var _0x15d7c9={'messageId':_0x11f24b[_0xaebd('0x1e')][0x0]['messageId']};if(!_0x493607[_0xaebd('0x36')]){_0x15d7c9[_0xaebd('0x37')]=!![];}return _0x21f52e[_0xaebd('0x17')](_0x15d7c9);}else{return logger[_0xaebd('0x24')](_0xaebd('0x25'),_0xaebd('0x26'),_0xaebd('0x52'),util['inspect'](_0x11f24b,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x21d2d1){return logger[_0xaebd('0x24')](_0xaebd('0x25'),_0xaebd('0x26'),_0xaebd('0x52'),util[_0xaebd('0x28')](_0x21d2d1,{'showHidden':![],'depth':null}));});}else{logger[_0xaebd('0x24')](_0xaebd('0x25'),'afterCreate',_0xaebd('0x52'),_0xaebd('0x57'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xaebd('0x26'),_0xaebd('0x52'),_0xaebd('0x39'));}break;case _0xaebd('0x58'):var _0xeac2ff=require(_0xaebd('0x59'));if(_0x493607[_0xaebd('0x5a')]){var _0x1d81f7={};_0x1d81f7['login']=_0x493607['username'];_0x1d81f7[_0xaebd('0x1d')]=_0x537261[_0xaebd('0x1d')];_0x1d81f7[_0xaebd('0x2e')]=_0x493607['phone'];_0x1d81f7['text']=_0x537261['body'];_0x1d81f7[_0xaebd('0x5b')]=+new Date();var _0x54996e='';var _0x3c6f71='';var _0x27e705=Object[_0xaebd('0x5c')](_0x1d81f7);_0x27e705['sort']();for(var _0x3a26b4=0x0;_0x3a26b4<_0x27e705[_0xaebd('0x5d')];_0x3a26b4++){if(_0x54996e!=''){_0x54996e+='&';}_0x54996e+=_0x27e705[_0x3a26b4]+'='+encodeURIComponent(_0x1d81f7[_0x27e705[_0x3a26b4]]);_0x3c6f71+=_0x1d81f7[_0x27e705[_0x3a26b4]];}_0x3c6f71+=_0x493607['apiKey'];_0x3c6f71=_0xeac2ff['createHash']('md5')[_0xaebd('0x17')](_0x3c6f71)[_0xaebd('0x5e')](_0xaebd('0x5f'));if(_0x54996e!==''){_0x54996e+='&';}_0x54996e+='signature='+_0x3c6f71;var _0x2e29d6={'method':_0xaebd('0x30'),'uri':_0x493607[_0xaebd('0x53')]+_0xaebd('0x60')+_0x54996e,'json':!![]};return rp(_0x2e29d6)[_0xaebd('0x19')](function(_0x4cd2ab){var _0x1e416b=Object[_0xaebd('0x5c')](_0x4cd2ab);if(_0x4cd2ab[_0x1e416b[0x0]][_0xaebd('0x24')]&&parseInt(_0x4cd2ab[_0x1e416b[0x0]][_0xaebd('0x24')])===0x0){var _0x3f8d60={'messageId':_0x4cd2ab[_0x1e416b[0x0]]['id_sms']};if(!_0x493607[_0xaebd('0x36')]){_0x3f8d60[_0xaebd('0x37')]=!![];}return _0x21f52e[_0xaebd('0x17')](_0x3f8d60);}else{return logger[_0xaebd('0x24')](_0xaebd('0x25'),_0xaebd('0x26'),_0xaebd('0x58'),util[_0xaebd('0x28')](_0x4cd2ab['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x350b57){return logger['error'](_0xaebd('0x25'),_0xaebd('0x26'),_0xaebd('0x58'),util[_0xaebd('0x28')](_0x350b57,{'showHidden':![],'depth':null}));});}else{logger[_0xaebd('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xaebd('0x58'),'Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x493607['apiKey']){var _0x10cac1={'method':'POST','uri':_0xaebd('0x61'),'headers':{'Authorization':_0x493607[_0xaebd('0x5a')]},'body':{'content':_0x537261[_0xaebd('0xd')],'to':[_0x537261[_0xaebd('0x1d')]],'from':_0x493607['phone'],'binary':![],'clientMessageId':_0xaebd('0x62'),'charset':_0xaebd('0x63')},'json':!![]};rp(_0x10cac1)[_0xaebd('0x19')](function(_0x380693){if(!_0x380693[_0xaebd('0x24')]){var _0x1195d3={'messageId':_0x380693['messages'][0x0][_0xaebd('0x64')]};if(!_0x493607[_0xaebd('0x36')]){_0x1195d3[_0xaebd('0x37')]=!![];}return _0x21f52e[_0xaebd('0x17')](_0x1195d3);}else{return logger[_0xaebd('0x24')](_0xaebd('0x25'),_0xaebd('0x26'),'clickatell',util[_0xaebd('0x28')](_0x380693[_0xaebd('0x24')],{'showHidden':![],'depth':null}));}})[_0xaebd('0x18')](function(_0x3e0bbe){return logger[_0xaebd('0x24')](_0xaebd('0x25'),'afterCreate','clickatell',util[_0xaebd('0x28')](_0x3e0bbe,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xaebd('0x25'),_0xaebd('0x26'),_0xaebd('0x65'),'Missing\x20parameters:\x20apiKey');}break;case _0xaebd('0x66'):if(_0x493607[_0xaebd('0x5a')]){var _0x16b1c5={};var _0x2e29d6={'method':_0xaebd('0x33'),'uri':_0xaebd('0x67'),'headers':{'Authorization':_0xaebd('0x68')+_0x493607[_0xaebd('0x5a')],'Content-Type':_0xaebd('0x55')},'body':{'from':_0x493607['phone'],'to':_0x537261['phone'],'text':_0x537261['body']},'json':!![]};return rp(_0x2e29d6)['then'](function(_0x5e7a91){if(_0x5e7a91[_0xaebd('0x69')]==0xca){_0x16b1c5[_0xaebd('0x6a')]=_0x5e7a91;var _0x2e56b7={'method':_0xaebd('0x33'),'uri':_0xaebd('0x6b'),'headers':{'Authorization':'Bearer\x20'+_0x493607[_0xaebd('0x5a')],'Content-Type':'application/json'},'body':{'refid':_0x16b1c5[_0xaebd('0x6a')][_0xaebd('0x6c')]},'json':!![]};return rp(_0x2e56b7)['then'](function(_0x50edec){_0x16b1c5['status']=_0x50edec;var _0x21364f={'messageId':_0x16b1c5[_0xaebd('0x6a')][_0xaebd('0x6c')],'read':!![]};return _0x21f52e[_0xaebd('0x17')](_0x21364f);});}else{return logger[_0xaebd('0x24')](_0xaebd('0x25'),_0xaebd('0x26'),_0xaebd('0x66'),util['inspect'](_0x5e7a91,{'showHidden':![],'depth':null}));}})[_0xaebd('0x18')](function(_0x2876dd){return logger[_0xaebd('0x24')](_0xaebd('0x25'),_0xaebd('0x26'),'intelepeer',util['inspect'](_0x2876dd,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xaebd('0x25'),'afterCreate',_0xaebd('0x66'),_0xaebd('0x6d'));}break;}}})[_0xaebd('0x6e')](function(){_0x19d2a9();});}else{_0x19d2a9();}}},'charset':'utf8mb4','collate':_0xaebd('0x6f')});};
\ No newline at end of file
index b23d474..c0cc83f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8603=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./smsMessage.socket','register','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','then','util','moment','bluebird'];(function(_0x5752ee,_0x2b4f71){var _0x542f87=function(_0x1360c1){while(--_0x1360c1){_0x5752ee['push'](_0x5752ee['shift']());}};_0x542f87(++_0x2b4f71);}(_0x8603,0x190));var _0x3860=function(_0x2f3238,_0x99ca05){_0x2f3238=_0x2f3238-0x0;var _0x509fb0=_0x8603[_0x2f3238];return _0x509fb0;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});config[_0x3860('0x9')]=_[_0x3860('0xa')](config[_0x3860('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3860('0xb'))[_0x3860('0xc')](socket);function respondWithRpcPromise(_0x52c277,_0x2fb169,_0x38737e){return new BPromise(function(_0x5909b8,_0x101263){return client[_0x3860('0xd')](_0x52c277,_0x38737e)['then'](function(_0x365579){logger[_0x3860('0xe')]('SmsMessage,\x20%s,\x20%s',_0x2fb169,_0x3860('0xf'));logger[_0x3860('0x10')](_0x3860('0x11'),_0x2fb169,_0x3860('0xf'),JSON[_0x3860('0x12')](_0x365579));if(_0x365579[_0x3860('0x13')]){if(_0x365579[_0x3860('0x13')][_0x3860('0x14')]===0x1f4){logger[_0x3860('0x13')](_0x3860('0x15'),_0x2fb169,_0x365579['error'][_0x3860('0x16')]);return _0x101263(_0x365579[_0x3860('0x13')][_0x3860('0x16')]);}logger[_0x3860('0x13')](_0x3860('0x15'),_0x2fb169,_0x365579[_0x3860('0x13')][_0x3860('0x16')]);return _0x5909b8(_0x365579[_0x3860('0x13')][_0x3860('0x16')]);}else{logger[_0x3860('0xe')](_0x3860('0x15'),_0x2fb169,_0x3860('0xf'));_0x5909b8(_0x365579['result']['message']);}})[_0x3860('0x17')](function(_0x41ce59){logger[_0x3860('0x13')]('SmsMessage,\x20%s,\x20%s',_0x2fb169,_0x41ce59);_0x101263(_0x41ce59);});});}exports[_0x3860('0x18')]=function(_0x145b26){var _0x22e873=this;return new Promise(function(_0x3af33a,_0x20a5b0){return db[_0x3860('0x19')][_0x3860('0x1a')](_0x145b26[_0x3860('0x1b')],{'raw':_0x145b26[_0x3860('0x1c')]?_0x145b26[_0x3860('0x1c')][_0x3860('0x1d')]===undefined?!![]:![]:!![]})[_0x3860('0x1e')](function(_0x280ea9){logger[_0x3860('0xe')](_0x3860('0x18'),_0x145b26);logger['debug'](_0x3860('0x18'),_0x145b26,JSON[_0x3860('0x12')](_0x280ea9));_0x3af33a(_0x280ea9);})[_0x3860('0x17')](function(_0x301e03){logger[_0x3860('0x13')]('CreateSmsMessage',_0x301e03[_0x3860('0x16')],_0x145b26);_0x20a5b0(_0x22e873['error'](0x1f4,_0x301e03['message']));});});};
\ No newline at end of file
+var _0x5eb8=['client','http','defaults','redis','localhost','register','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','result','catch','options','raw','then','stringify','CreateSmsMessage','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3ea40d,_0x1e2b89){var _0x2839dd=function(_0x2efd27){while(--_0x2efd27){_0x3ea40d['push'](_0x3ea40d['shift']());}};_0x2839dd(++_0x1e2b89);}(_0x5eb8,0xb0));var _0x85eb=function(_0xe1269d,_0x57b7c3){_0xe1269d=_0xe1269d-0x0;var _0x261ca1=_0x5eb8[_0xe1269d];return _0x261ca1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});config['redis']=_[_0x85eb('0xc')](config[_0x85eb('0xd')],{'host':_0x85eb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0xd')]));require('./smsMessage.socket')[_0x85eb('0xf')](socket);function respondWithRpcPromise(_0x40d6b6,_0x673228,_0x29030b){return new BPromise(function(_0x1dacf2,_0x73e6d0){return client[_0x85eb('0x10')](_0x40d6b6,_0x29030b)['then'](function(_0x163f32){logger[_0x85eb('0x11')]('SmsMessage,\x20%s,\x20%s',_0x673228,_0x85eb('0x12'));logger[_0x85eb('0x13')](_0x85eb('0x14'),_0x673228,_0x85eb('0x12'),JSON['stringify'](_0x163f32));if(_0x163f32['error']){if(_0x163f32[_0x85eb('0x15')]['code']===0x1f4){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x73e6d0(_0x163f32[_0x85eb('0x15')]['message']);}logger[_0x85eb('0x15')]('SmsMessage,\x20%s,\x20%s',_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x1dacf2(_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x673228,'request\x20sent');_0x1dacf2(_0x163f32[_0x85eb('0x18')][_0x85eb('0x17')]);}})[_0x85eb('0x19')](function(_0x2e986c){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x2e986c);_0x73e6d0(_0x2e986c);});});}exports['CreateSmsMessage']=function(_0x24cf28){var _0x7244fc=this;return new Promise(function(_0xd9f06d,_0x4e8041){return db['SmsMessage']['create'](_0x24cf28['body'],{'raw':_0x24cf28[_0x85eb('0x1a')]?_0x24cf28[_0x85eb('0x1a')][_0x85eb('0x1b')]===undefined?!![]:![]:!![]})[_0x85eb('0x1c')](function(_0x465c74){logger[_0x85eb('0x11')]('CreateSmsMessage',_0x24cf28);logger['debug']('CreateSmsMessage',_0x24cf28,JSON[_0x85eb('0x1d')](_0x465c74));_0xd9f06d(_0x465c74);})[_0x85eb('0x19')](function(_0x3f7a4d){logger[_0x85eb('0x15')](_0x85eb('0x1e'),_0x3f7a4d[_0x85eb('0x17')],_0x24cf28);_0x4e8041(_0x7244fc['error'](0x1f4,_0x3f7a4d[_0x85eb('0x17')]));});});};
\ No newline at end of file
index ea91968..9b6ea74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5b1=['./smsMessage.events','save','update','emit','register','length'];(function(_0x79c912,_0x593f5d){var _0x5b0fb3=function(_0x1d28ea){while(--_0x1d28ea){_0x79c912['push'](_0x79c912['shift']());}};_0x5b0fb3(++_0x593f5d);}(_0xa5b1,0x1f2));var _0x1a5b=function(_0xed9c99,_0x2217b1){_0xed9c99=_0xed9c99-0x0;var _0x5443a1=_0xa5b1[_0xed9c99];return _0x5443a1;};'use strict';var SmsMessageEvents=require(_0x1a5b('0x0'));var events=[_0x1a5b('0x1'),'remove',_0x1a5b('0x2')];function createListener(_0x1e58bd,_0x1e0228){return function(_0x348a45){_0x1e0228[_0x1a5b('0x3')](_0x1e58bd,_0x348a45);};}function removeListener(_0x2f453b,_0x1a4c0f){return function(){SmsMessageEvents['removeListener'](_0x2f453b,_0x1a4c0f);};}exports[_0x1a5b('0x4')]=function(_0x25e3e2){for(var _0x5e7ba9=0x0,_0x1a665a=events[_0x1a5b('0x5')];_0x5e7ba9<_0x1a665a;_0x5e7ba9++){var _0x5ac1c5=events[_0x5e7ba9];var _0x262201=createListener('smsMessage:'+_0x5ac1c5,_0x25e3e2);SmsMessageEvents['on'](_0x5ac1c5,_0x262201);}};
\ No newline at end of file
+var _0x90d1=['emit','removeListener','length','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x11458e,_0x27088b){var _0x48be5e=function(_0x575ea1){while(--_0x575ea1){_0x11458e['push'](_0x11458e['shift']());}};_0x48be5e(++_0x27088b);}(_0x90d1,0x18c));var _0x190d=function(_0x263e17,_0x244755){_0x263e17=_0x263e17-0x0;var _0x3c1b7f=_0x90d1[_0x263e17];return _0x3c1b7f;};'use strict';var SmsMessageEvents=require(_0x190d('0x0'));var events=[_0x190d('0x1'),_0x190d('0x2'),_0x190d('0x3')];function createListener(_0x3fd9af,_0x1dba24){return function(_0x3224d5){_0x1dba24[_0x190d('0x4')](_0x3fd9af,_0x3224d5);};}function removeListener(_0x23ac27,_0x14c400){return function(){SmsMessageEvents[_0x190d('0x5')](_0x23ac27,_0x14c400);};}exports['register']=function(_0x3c62b5){for(var _0x4630d5=0x0,_0x3744c4=events[_0x190d('0x6')];_0x4630d5<_0x3744c4;_0x4630d5++){var _0x8a913a=events[_0x4630d5];var _0x1d7f4c=createListener(_0x190d('0x7')+_0x8a913a,_0x3c62b5);SmsMessageEvents['on'](_0x8a913a,_0x1d7f4c);}};
\ No newline at end of file
index c6720ed..a61bb73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad78=['addAgents','destroy','delete','removeTeams','removeAgents','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams'];(function(_0x3f3b4a,_0x5fe176){var _0x158c59=function(_0x527ae3){while(--_0x527ae3){_0x3f3b4a['push'](_0x3f3b4a['shift']());}};_0x158c59(++_0x5fe176);}(_0xad78,0x149));var _0x8ad7=function(_0x3f5c14,_0x2ccbce){_0x3f5c14=_0x3f5c14-0x0;var _0x219a4e=_0xad78[_0x3f5c14];return _0x219a4e;};'use strict';var multer=require(_0x8ad7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8ad7('0x1'));var express=require(_0x8ad7('0x2'));var router=express['Router']();var auth=require(_0x8ad7('0x3'));var interaction=require(_0x8ad7('0x4'));var config=require(_0x8ad7('0x5'));var controller=require(_0x8ad7('0x6'));router[_0x8ad7('0x7')]('/',auth[_0x8ad7('0x8')](),controller[_0x8ad7('0x9')]);router[_0x8ad7('0x7')](_0x8ad7('0xa'),auth[_0x8ad7('0x8')](),controller['describe']);router['get'](_0x8ad7('0xb'),auth[_0x8ad7('0x8')](),controller[_0x8ad7('0xc')]);router[_0x8ad7('0x7')](_0x8ad7('0xd'),auth[_0x8ad7('0x8')](),controller[_0x8ad7('0xe')]);router['get'](_0x8ad7('0xf'),auth[_0x8ad7('0x8')](),controller[_0x8ad7('0x10')]);router['get'](_0x8ad7('0x11'),auth[_0x8ad7('0x8')](),controller[_0x8ad7('0x12')]);router[_0x8ad7('0x13')]('/',auth[_0x8ad7('0x8')](),controller[_0x8ad7('0x14')]);router[_0x8ad7('0x13')](_0x8ad7('0xf'),auth[_0x8ad7('0x8')](),controller[_0x8ad7('0x15')]);router[_0x8ad7('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x8ad7('0x16')]);router['put'](_0x8ad7('0xb'),auth[_0x8ad7('0x8')](),controller['update']);router['delete'](_0x8ad7('0xb'),auth[_0x8ad7('0x8')](),controller[_0x8ad7('0x17')]);router[_0x8ad7('0x18')](_0x8ad7('0xf'),auth[_0x8ad7('0x8')](),controller[_0x8ad7('0x19')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x8ad7('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x8375=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','delete','destroy','removeAgents','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/describe','/:id'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x8375,0xa8));var _0x5837=function(_0x2cb44f,_0x23a9f5){_0x2cb44f=_0x2cb44f-0x0;var _0x54f088=_0x8375[_0x2cb44f];return _0x54f088;};'use strict';var multer=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var path=require(_0x5837('0x2'));var timeout=require('connect-timeout');var express=require(_0x5837('0x3'));var router=express[_0x5837('0x4')]();var auth=require(_0x5837('0x5'));var interaction=require(_0x5837('0x6'));var config=require(_0x5837('0x7'));var controller=require(_0x5837('0x8'));router['get']('/',auth[_0x5837('0x9')](),controller[_0x5837('0xa')]);router[_0x5837('0xb')](_0x5837('0xc'),auth[_0x5837('0x9')](),controller['describe']);router['get'](_0x5837('0xd'),auth[_0x5837('0x9')](),controller['show']);router[_0x5837('0xb')]('/:id/members',auth[_0x5837('0x9')](),controller[_0x5837('0xe')]);router[_0x5837('0xb')](_0x5837('0xf'),auth[_0x5837('0x9')](),controller[_0x5837('0x10')]);router['get'](_0x5837('0x11'),auth[_0x5837('0x9')](),controller[_0x5837('0x12')]);router[_0x5837('0x13')]('/',auth[_0x5837('0x9')](),controller['create']);router['post']('/:id/teams',auth[_0x5837('0x9')](),controller[_0x5837('0x14')]);router[_0x5837('0x13')](_0x5837('0x11'),auth[_0x5837('0x9')](),controller[_0x5837('0x15')]);router[_0x5837('0x16')](_0x5837('0xd'),auth[_0x5837('0x9')](),controller['update']);router[_0x5837('0x17')](_0x5837('0xd'),auth['isAuthenticated'](),controller[_0x5837('0x18')]);router[_0x5837('0x17')](_0x5837('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x5837('0x11'),auth[_0x5837('0x9')](),controller[_0x5837('0x19')]);module['exports']=router;
\ No newline at end of file
index 419722d..4f96822 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf908=['name','INTEGER','ENUM','rrmemory','sequelize','exports','STRING'];(function(_0x39bf2e,_0x47b583){var _0x4fb4b5=function(_0x4a4295){while(--_0x4a4295){_0x39bf2e['push'](_0x39bf2e['shift']());}};_0x4fb4b5(++_0x47b583);}(_0xf908,0x1bd));var _0x8f90=function(_0x3fedd5,_0x4123a3){_0x3fedd5=_0x3fedd5-0x0;var _0x3b602e=_0xf908[_0x3fedd5];return _0x3b602e;};'use strict';var Sequelize=require(_0x8f90('0x0'));module[_0x8f90('0x1')]={'name':{'type':Sequelize[_0x8f90('0x2')],'unique':_0x8f90('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8f90('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8f90('0x5')](_0x8f90('0x6'),'beepall','roundrobin')}};
\ No newline at end of file
+var _0x1540=['STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x3d5064,_0x543444){var _0x49a127=function(_0x545094){while(--_0x545094){_0x3d5064['push'](_0x3d5064['shift']());}};_0x49a127(++_0x543444);}(_0x1540,0x18d));var _0x0154=function(_0x442398,_0x486809){_0x442398=_0x442398-0x0;var _0xaf58dd=_0x1540[_0x442398];return _0xaf58dd;};'use strict';var Sequelize=require(_0x0154('0x0'));module[_0x0154('0x1')]={'name':{'type':Sequelize[_0x0154('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0154('0x2')]},'timeout':{'type':Sequelize[_0x0154('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0154('0x4')](_0x0154('0x5'),'beepall',_0x0154('0x6'))}};
\ No newline at end of file
index b695122..ce983aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9119=['type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','SmsQueue','includeAll','include','findAll','rows','show','keys','rawAttributes','options','find','create','user','role','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','User','findAndCountAll','agent','createdAt','format','%s/%s','SIP','smsPause','updatedAt','getTeams','addTeams','ids','Team','Agents','interface','flatMap','transaction','each','UserSmsQueue','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','TeamId','includes','all','compact','removeAgents','userSmsQueue:remove','addAgents','omit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./smsQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','SmsQueues','UserProfileResource','error','stack','name','send','index','fieldName'];(function(_0x137fdc,_0x350ef5){var _0x4594b8=function(_0x3bc436){while(--_0x3bc436){_0x137fdc['push'](_0x137fdc['shift']());}};_0x4594b8(++_0x350ef5);}(_0x9119,0x16c));var _0x9911=function(_0x563413,_0x57fb7b){_0x563413=_0x563413-0x0;var _0x1cbb55=_0x9119[_0x563413];return _0x1cbb55;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9911('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9911('0x1'));var jsonpatch=require(_0x9911('0x2'));var rp=require(_0x9911('0x3'));var moment=require(_0x9911('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9911('0x5'));var util=require(_0x9911('0x6'));var path=require(_0x9911('0x7'));var sox=require(_0x9911('0x8'));var csv=require('to-csv');var ejs=require(_0x9911('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9911('0xa'));var crypto=require(_0x9911('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9911('0xc'));var Redis=require(_0x9911('0xd'));var authService=require(_0x9911('0xe'));var qs=require(_0x9911('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9911('0x10'));var logger=require(_0x9911('0x11'))(_0x9911('0x12'));var utils=require(_0x9911('0x13'));var config=require(_0x9911('0x14'));var db=require(_0x9911('0x15'))['db'];config[_0x9911('0x16')]=_[_0x9911('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9911('0x18'))[_0x9911('0x19')](socket);function respondWithStatusCode(_0x556cb9,_0x1e66ff){_0x1e66ff=_0x1e66ff||0xcc;return function(_0x463b47){if(_0x463b47){return _0x556cb9[_0x9911('0x1a')](_0x1e66ff);}return _0x556cb9[_0x9911('0x1b')](_0x1e66ff)[_0x9911('0x1c')]();};}function respondWithResult(_0x34218e,_0x52022f){_0x52022f=_0x52022f||0xc8;return function(_0x3d184f){if(_0x3d184f){return _0x34218e['status'](_0x52022f)[_0x9911('0x1d')](_0x3d184f);}};}function respondWithFilteredResult(_0x1b0fd8,_0x848b8a){return function(_0x4eb456){if(_0x4eb456){var _0x2b3fc5=_0x4eb456[_0x9911('0x1e')],_0x5630bb=_0x848b8a[_0x9911('0x1f')],_0x15817e=_0x848b8a[_0x9911('0x1f')]+_0x848b8a[_0x9911('0x20')],_0x58b1ee;if(_0x15817e>=_0x2b3fc5){_0x15817e=_0x2b3fc5;_0x58b1ee=0xc8;}else{_0x58b1ee=0xce;}_0x1b0fd8[_0x9911('0x1b')](_0x58b1ee);return _0x1b0fd8[_0x9911('0x21')](_0x9911('0x22'),_0x5630bb+'-'+_0x15817e+'/'+_0x2b3fc5)[_0x9911('0x1d')](_0x4eb456);}return null;};}function patchUpdates(_0x5177a4){return function(_0x4834a2){try{jsonpatch[_0x9911('0x23')](_0x4834a2,_0x5177a4,!![]);}catch(_0x1513db){return BPromise[_0x9911('0x24')](_0x1513db);}return _0x4834a2[_0x9911('0x25')]();};}function saveUpdates(_0x4ffc7d,_0x115776){return function(_0x50bd6c){if(_0x50bd6c){return _0x50bd6c[_0x9911('0x26')](_0x4ffc7d)['then'](function(_0x4c59e5){return _0x4c59e5;});}return null;};}function removeEntity(_0x2b843c,_0x4114d4){return function(_0x14cc00){if(_0x14cc00){return _0x14cc00[_0x9911('0x27')]()[_0x9911('0x28')](function(){var _0x1e744b=_0x14cc00[_0x9911('0x29')]({'plain':!![]});var _0x2cefdb=_0x9911('0x2a');return db[_0x9911('0x2b')][_0x9911('0x27')]({'where':{'type':_0x2cefdb,'resourceId':_0x1e744b['id']}})[_0x9911('0x28')](function(){return _0x14cc00;});})[_0x9911('0x28')](function(){_0x2b843c['status'](0xcc)[_0x9911('0x1c')]();});}};}function handleEntityNotFound(_0x387e53,_0x392dd4){return function(_0x5aa9d6){if(!_0x5aa9d6){_0x387e53[_0x9911('0x1a')](0x194);}return _0x5aa9d6;};}function handleError(_0x1980d1,_0x5d9ed8){_0x5d9ed8=_0x5d9ed8||0x1f4;return function(_0x35a9cc){logger[_0x9911('0x2c')](_0x35a9cc[_0x9911('0x2d')]);if(_0x35a9cc['name']){delete _0x35a9cc[_0x9911('0x2e')];}_0x1980d1[_0x9911('0x1b')](_0x5d9ed8)[_0x9911('0x2f')](_0x35a9cc);};}exports[_0x9911('0x30')]=function(_0xc1a71a,_0x1dbffd){var _0x5c805c={},_0x354892={},_0x325e06={'count':0x0,'rows':[]};var _0x156f5d=_['map'](db['SmsQueue']['rawAttributes'],function(_0x713181){return{'name':_0x713181[_0x9911('0x31')],'type':_0x713181[_0x9911('0x32')][_0x9911('0x33')]};});_0x354892[_0x9911('0x34')]=_[_0x9911('0x35')](_0x156f5d,_0x9911('0x2e'));_0x354892[_0x9911('0x36')]=_['keys'](_0xc1a71a[_0x9911('0x36')]);_0x354892[_0x9911('0x37')]=_[_0x9911('0x38')](_0x354892['model'],_0x354892['query']);_0x5c805c[_0x9911('0x39')]=_[_0x9911('0x38')](_0x354892[_0x9911('0x34')],qs[_0x9911('0x3a')](_0xc1a71a[_0x9911('0x36')]['fields']));_0x5c805c[_0x9911('0x39')]=_0x5c805c[_0x9911('0x39')][_0x9911('0x3b')]?_0x5c805c[_0x9911('0x39')]:_0x354892[_0x9911('0x34')];if(!_0xc1a71a[_0x9911('0x36')][_0x9911('0x3c')](_0x9911('0x3d'))){_0x5c805c[_0x9911('0x20')]=qs[_0x9911('0x20')](_0xc1a71a[_0x9911('0x36')][_0x9911('0x20')]);_0x5c805c[_0x9911('0x1f')]=qs['offset'](_0xc1a71a[_0x9911('0x36')]['offset']);}_0x5c805c[_0x9911('0x3e')]=qs[_0x9911('0x3f')](_0xc1a71a[_0x9911('0x36')][_0x9911('0x3f')]);_0x5c805c[_0x9911('0x40')]=qs['filters'](_[_0x9911('0x41')](_0xc1a71a[_0x9911('0x36')],_0x354892[_0x9911('0x37')]),_0x156f5d);if(_0xc1a71a['query'][_0x9911('0x42')]){_0x5c805c['where']=_['merge'](_0x5c805c[_0x9911('0x40')],{'$or':_[_0x9911('0x35')](_0x156f5d,function(_0x2dfd5b){if(_0x2dfd5b[_0x9911('0x32')]!==_0x9911('0x43')){var _0x36960e={};_0x36960e[_0x2dfd5b['name']]={'$like':'%'+_0xc1a71a['query'][_0x9911('0x42')]+'%'};return _0x36960e;}})});}_0x5c805c=_[_0x9911('0x44')]({},_0x5c805c,_0xc1a71a['options']);var _0x2f6592={'where':_0x5c805c['where']};return db[_0x9911('0x45')][_0x9911('0x1e')](_0x2f6592)[_0x9911('0x28')](function(_0xe1f159){_0x325e06[_0x9911('0x1e')]=_0xe1f159;if(_0xc1a71a[_0x9911('0x36')][_0x9911('0x46')]){_0x5c805c[_0x9911('0x47')]=[{'all':!![]}];}return db[_0x9911('0x45')][_0x9911('0x48')](_0x5c805c);})[_0x9911('0x28')](function(_0x2fe401){_0x325e06[_0x9911('0x49')]=_0x2fe401;return _0x325e06;})[_0x9911('0x28')](respondWithFilteredResult(_0x1dbffd,_0x5c805c))['catch'](handleError(_0x1dbffd,null));};exports[_0x9911('0x4a')]=function(_0x16b0b7,_0x5639c2){var _0x2eca62={'raw':!![],'where':{'id':_0x16b0b7['params']['id']}},_0x1ed777={};_0x1ed777[_0x9911('0x34')]=_[_0x9911('0x4b')](db[_0x9911('0x45')][_0x9911('0x4c')]);_0x1ed777[_0x9911('0x36')]=_['keys'](_0x16b0b7[_0x9911('0x36')]);_0x1ed777[_0x9911('0x37')]=_[_0x9911('0x38')](_0x1ed777[_0x9911('0x34')],_0x1ed777['query']);_0x2eca62[_0x9911('0x39')]=_[_0x9911('0x38')](_0x1ed777[_0x9911('0x34')],qs[_0x9911('0x3a')](_0x16b0b7[_0x9911('0x36')][_0x9911('0x3a')]));_0x2eca62[_0x9911('0x39')]=_0x2eca62[_0x9911('0x39')][_0x9911('0x3b')]?_0x2eca62[_0x9911('0x39')]:_0x1ed777[_0x9911('0x34')];if(_0x16b0b7[_0x9911('0x36')]['includeAll']){_0x2eca62[_0x9911('0x47')]=[{'all':!![]}];}_0x2eca62=_['merge']({},_0x2eca62,_0x16b0b7[_0x9911('0x4d')]);return db[_0x9911('0x45')][_0x9911('0x4e')](_0x2eca62)[_0x9911('0x28')](handleEntityNotFound(_0x5639c2,null))[_0x9911('0x28')](respondWithResult(_0x5639c2,null))['catch'](handleError(_0x5639c2,null));};exports[_0x9911('0x4f')]=function(_0x53e404,_0x375e9e){return db[_0x9911('0x45')][_0x9911('0x4f')](_0x53e404['body'],{})['then'](function(_0x22d4fd){var _0x918612=_0x53e404[_0x9911('0x50')]['get']({'plain':!![]});if(!_0x918612)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x918612[_0x9911('0x51')]==='user'){var _0x4acaf4=_0x22d4fd['get']({'plain':!![]});var _0x55c422=_0x9911('0x2a');return db['UserProfileSection'][_0x9911('0x4e')]({'where':{'name':_0x55c422,'userProfileId':_0x918612[_0x9911('0x52')]},'raw':!![]})[_0x9911('0x28')](function(_0x32c135){if(_0x32c135&&_0x32c135[_0x9911('0x53')]===0x0){return db['UserProfileResource'][_0x9911('0x4f')]({'name':_0x4acaf4[_0x9911('0x2e')],'resourceId':_0x4acaf4['id'],'type':_0x32c135[_0x9911('0x2e')],'sectionId':_0x32c135['id']},{})['then'](function(){return _0x22d4fd;});}else{return _0x22d4fd;}})[_0x9911('0x54')](function(_0x217ef8){logger[_0x9911('0x2c')](_0x9911('0x55'),_0x217ef8);throw _0x217ef8;});}return _0x22d4fd;})['then'](respondWithResult(_0x375e9e,0xc9))[_0x9911('0x54')](handleError(_0x375e9e,null));};exports['update']=function(_0x5dbdfc,_0x48603a){if(_0x5dbdfc[_0x9911('0x56')]['id']){delete _0x5dbdfc[_0x9911('0x56')]['id'];}return db[_0x9911('0x45')]['find']({'where':{'id':_0x5dbdfc[_0x9911('0x57')]['id']}})[_0x9911('0x28')](handleEntityNotFound(_0x48603a,null))['then'](saveUpdates(_0x5dbdfc[_0x9911('0x56')],null))[_0x9911('0x28')](respondWithResult(_0x48603a,null))[_0x9911('0x54')](handleError(_0x48603a,null));};exports[_0x9911('0x27')]=function(_0x4076d7,_0x52c49c){return db[_0x9911('0x45')][_0x9911('0x4e')]({'where':{'id':_0x4076d7[_0x9911('0x57')]['id']}})[_0x9911('0x28')](handleEntityNotFound(_0x52c49c,null))[_0x9911('0x28')](removeEntity(_0x52c49c,null))[_0x9911('0x54')](handleError(_0x52c49c,null));};exports[_0x9911('0x58')]=function(_0x43a84a,_0x270d61){return db[_0x9911('0x45')][_0x9911('0x58')]()[_0x9911('0x28')](respondWithResult(_0x270d61,null))[_0x9911('0x54')](handleError(_0x270d61,null));};exports[_0x9911('0x59')]=function(_0x438e03,_0xdee7dd,_0x32c8b3){var _0x254bf7={'raw':!![],'where':{}},_0x545abf={},_0x41be7c;return db['SmsQueue'][_0x9911('0x5a')]({'where':{'id':_0x438e03[_0x9911('0x57')]['id']}})[_0x9911('0x28')](handleEntityNotFound(_0xdee7dd,null))[_0x9911('0x28')](function(_0x14e207){if(_0x14e207){_0x41be7c=_0x14e207['get']({'plain':!![]});_0x545abf[_0x9911('0x34')]=_[_0x9911('0x4b')](db['UserSmsQueue'][_0x9911('0x4c')]);_0x545abf[_0x9911('0x36')]=_[_0x9911('0x4b')](_0x438e03[_0x9911('0x36')]);_0x545abf[_0x9911('0x37')]=_['intersection'](_0x545abf[_0x9911('0x34')],_0x545abf[_0x9911('0x36')]);_0x254bf7['attributes']=_[_0x9911('0x38')](_0x545abf['model'],qs[_0x9911('0x3a')](_0x438e03[_0x9911('0x36')][_0x9911('0x3a')]));_0x254bf7[_0x9911('0x39')]=_0x254bf7['attributes']['length']?_0x254bf7[_0x9911('0x39')]:_0x545abf[_0x9911('0x34')];if(!_0x438e03[_0x9911('0x36')]['hasOwnProperty'](_0x9911('0x3d'))){_0x254bf7[_0x9911('0x20')]=qs[_0x9911('0x20')](_0x438e03[_0x9911('0x36')][_0x9911('0x20')]);_0x254bf7['offset']=qs[_0x9911('0x1f')](_0x438e03['query']['offset']);}_0x254bf7[_0x9911('0x3e')]=qs['sort'](_0x438e03[_0x9911('0x36')][_0x9911('0x3f')]);_0x254bf7['where']=qs[_0x9911('0x37')](_[_0x9911('0x41')](_0x438e03['query'],_0x545abf[_0x9911('0x37')]));_0x254bf7[_0x9911('0x40')]['SmsQueueId']=_0x14e207['id'];if(_0x438e03[_0x9911('0x36')][_0x9911('0x42')]){_0x254bf7[_0x9911('0x40')]=_['merge'](_0x254bf7[_0x9911('0x40')],{'$or':_[_0x9911('0x35')](_0x254bf7[_0x9911('0x39')],function(_0x470cb3){var _0x4d6156={};_0x4d6156[_0x470cb3]={'$like':'%'+_0x438e03[_0x9911('0x36')][_0x9911('0x42')]+'%'};return _0x4d6156;})});}_0x254bf7=_[_0x9911('0x44')]({},_0x254bf7,_0x438e03[_0x9911('0x4d')]);return db['UserSmsQueue'][_0x9911('0x48')](_0x254bf7);}})[_0x9911('0x28')](function(_0x17faca){if(_0x17faca){return db[_0x9911('0x5b')][_0x9911('0x5c')]({'where':{'id':_[_0x9911('0x35')](_0x17faca,'UserId'),'role':_0x9911('0x5d')},'attributes':['id','name','smsPause','updatedAt',_0x9911('0x5e')]});}})[_0x9911('0x28')](function(_0x2a39d3){if(_0x2a39d3){return{'count':_0x2a39d3[_0x9911('0x1e')],'rows':_[_0x9911('0x35')](_0x2a39d3[_0x9911('0x49')],function(_0x44e0e4){return{'membername':_0x44e0e4[_0x9911('0x2e')],'UserId':_0x44e0e4['id'],'queue_name':_0x41be7c[_0x9911('0x2e')],'SmsQueueId':_0x41be7c['id'],'interface':util[_0x9911('0x5f')](_0x9911('0x60'),_0x9911('0x61'),_0x44e0e4['name']),'penalty':0x0,'paused':_0x44e0e4[_0x9911('0x62')],'createdAt':_0x44e0e4[_0x9911('0x5e')],'updatedAt':_0x44e0e4[_0x9911('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xdee7dd,_0x254bf7))['catch'](handleError(_0xdee7dd,null));};exports['getTeams']=function(_0x5732e6,_0x2eedd4,_0x46eb61){var _0x4e49f9={};var _0x62c5f3={};var _0x4ccb08;var _0x4ad279;return db[_0x9911('0x45')][_0x9911('0x5a')]({'where':{'id':_0x5732e6[_0x9911('0x57')]['id']}})[_0x9911('0x28')](handleEntityNotFound(_0x2eedd4,null))[_0x9911('0x28')](function(_0x252dd0){if(_0x252dd0){_0x4ccb08=_0x252dd0;_0x62c5f3['model']=_[_0x9911('0x4b')](db['Team'][_0x9911('0x4c')]);_0x62c5f3[_0x9911('0x36')]=_['keys'](_0x5732e6[_0x9911('0x36')]);_0x62c5f3['filters']=_[_0x9911('0x38')](_0x62c5f3['model'],_0x62c5f3[_0x9911('0x36')]);_0x4e49f9[_0x9911('0x39')]=_[_0x9911('0x38')](_0x62c5f3[_0x9911('0x34')],qs[_0x9911('0x3a')](_0x5732e6[_0x9911('0x36')][_0x9911('0x3a')]));_0x4e49f9[_0x9911('0x39')]=_0x4e49f9[_0x9911('0x39')]['length']?_0x4e49f9['attributes']:_0x62c5f3[_0x9911('0x34')];_0x4e49f9[_0x9911('0x3e')]=qs['sort'](_0x5732e6['query'][_0x9911('0x3f')]);_0x4e49f9[_0x9911('0x40')]=qs[_0x9911('0x37')](_[_0x9911('0x41')](_0x5732e6[_0x9911('0x36')],_0x62c5f3['filters']));if(_0x5732e6['query'][_0x9911('0x42')]){_0x4e49f9[_0x9911('0x40')]=_[_0x9911('0x44')](_0x4e49f9[_0x9911('0x40')],{'$or':_['map'](_0x4e49f9[_0x9911('0x39')],function(_0x12a086){var _0x30eca7={};_0x30eca7[_0x12a086]={'$like':'%'+_0x5732e6[_0x9911('0x36')][_0x9911('0x42')]+'%'};return _0x30eca7;})});}_0x4e49f9=_[_0x9911('0x44')]({},_0x4e49f9,_0x5732e6[_0x9911('0x4d')]);return _0x4ccb08[_0x9911('0x64')](_0x4e49f9);}})[_0x9911('0x28')](function(_0x13502c){if(_0x13502c){_0x4ad279=_0x13502c[_0x9911('0x3b')];if(!_0x5732e6[_0x9911('0x36')][_0x9911('0x3c')](_0x9911('0x3d'))){_0x4e49f9['limit']=qs['limit'](_0x5732e6[_0x9911('0x36')][_0x9911('0x20')]);_0x4e49f9[_0x9911('0x1f')]=qs['offset'](_0x5732e6[_0x9911('0x36')][_0x9911('0x1f')]);}return _0x4ccb08[_0x9911('0x64')](_0x4e49f9);}})[_0x9911('0x28')](function(_0x1a63f0){if(_0x1a63f0){return _0x1a63f0?{'count':_0x4ad279,'rows':_0x1a63f0}:null;}})[_0x9911('0x28')](respondWithResult(_0x2eedd4,null))[_0x9911('0x54')](handleError(_0x2eedd4,null));};exports[_0x9911('0x65')]=function(_0x2aff8e,_0x29616a,_0x43b7a0){var _0x409a2d=_0x2aff8e[_0x9911('0x56')][_0x9911('0x66')];return db[_0x9911('0x67')][_0x9911('0x48')]({'where':{'id':_0x409a2d},'attributes':['id'],'include':[{'model':db[_0x9911('0x5b')],'as':_0x9911('0x68'),'attributes':['id',_0x9911('0x2e'),'online','voicePause',_0x9911('0x69')],'raw':!![]}]})[_0x9911('0x28')](function(_0x383575){if(_0x383575){var _0x3d623e=_[_0x9911('0x6a')](_0x383575,function(_0x114e25){var _0x42f2ef=_0x114e25['get']({'plain':!![]});return _0x42f2ef['Agents'];});return db[_0x9911('0x45')][_0x9911('0x4e')]({'where':{'id':_0x2aff8e['params']['id']}})[_0x9911('0x28')](function(_0x19afc0){return db['sequelize'][_0x9911('0x6b')](function(_0x125c07){return _0x19afc0['addTeams'](_0x409a2d,{'transaction':_0x125c07})[_0x9911('0x28')](function(){return BPromise[_0x9911('0x6c')](_0x3d623e,function(_0x16dae9){return db[_0x9911('0x6d')][_0x9911('0x6e')]({'where':{'UserId':_0x16dae9['id'],'SmsQueueId':_0x2aff8e[_0x9911('0x57')]['id']},'transaction':_0x125c07});});})[_0x9911('0x28')](function(){_0x3d623e[_0x9911('0x6f')](function(_0x22e077){socket[_0x9911('0x70')](_0x9911('0x71'),{'UserId':_0x22e077['id'],'SmsQueueId':_0x19afc0['id']});});});});});}})[_0x9911('0x28')](respondWithStatusCode(_0x29616a,null))[_0x9911('0x54')](handleError(_0x29616a,null));};exports[_0x9911('0x72')]=function(_0xd68cc3,_0x54e855,_0x19d0dd){return db[_0x9911('0x67')][_0x9911('0x48')]({'where':{'id':_0xd68cc3[_0x9911('0x36')][_0x9911('0x66')]},'attributes':['id'],'include':[{'model':db[_0x9911('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9911('0x28')](handleEntityNotFound(_0x54e855,null))[_0x9911('0x28')](function(_0x5942ff){var _0x1b3893=_[_0x9911('0x35')](_0x5942ff,'id');var _0x5d4f7f=[];var _0x26b062=[];var _0x4f1303=squel[_0x9911('0x73')]();_0x4f1303[_0x9911('0x74')]('tq.TeamId')[_0x9911('0x75')](_0x9911('0x76'),'tq')[_0x9911('0x77')]('user_has_teams','ut',_0x9911('0x78'))[_0x9911('0x40')](_0x9911('0x79'),_0xd68cc3['params']['id']);for(var _0x3412b9=0x0;_0x3412b9<_0x5942ff['length'];_0x3412b9+=0x1){let _0x32dab9=_0x5942ff[_0x3412b9];for(var _0x24932a=0x0;_0x24932a<_0x32dab9['Agents'][_0x9911('0x3b')];_0x24932a+=0x1){let _0x2af386=_0x32dab9[_0x9911('0x68')][_0x24932a];var _0x3a5e2e=_0x4f1303[_0x9911('0x7a')]();_0x3a5e2e[_0x9911('0x40')](_0x9911('0x7b'),_0x2af386['id']);_0x26b062[_0x9911('0x7c')](db[_0x9911('0x7d')][_0x9911('0x36')](_0x3a5e2e[_0x9911('0x7e')](),{'type':db[_0x9911('0x7d')]['QueryTypes'][_0x9911('0x7f')]})['then'](function(_0x230561){if(_0x230561['length']===0x1){return _0x2af386['id'];}else{var _0x2dbaec=_['every'](_[_0x9911('0x35')](_0x230561,_0x9911('0x80')),function(_0x77ba66){return _[_0x9911('0x81')](_0x1b3893,_0x77ba66);});if(_0x2dbaec){return _0x2af386['id'];}}}));}}return BPromise[_0x9911('0x82')](_0x26b062)['then'](function(_0x30cf1b){_0x5d4f7f=_(_0x5d4f7f)['union'](_0x30cf1b)[_0x9911('0x83')]()['value']();return db[_0x9911('0x45')][_0x9911('0x4e')]({'where':{'id':_0xd68cc3['params']['id']}})[_0x9911('0x28')](function(_0x3b92c0){return db[_0x9911('0x7d')][_0x9911('0x6b')](function(_0x35b14d){return _0x3b92c0[_0x9911('0x72')](_0xd68cc3['query'][_0x9911('0x66')],{'transaction':_0x35b14d})[_0x9911('0x28')](function(){if(!_['isEmpty'](_0x5d4f7f)){return _0x3b92c0[_0x9911('0x84')](_0x5d4f7f,{'transaction':_0x35b14d});}})[_0x9911('0x28')](function(){_0x5d4f7f[_0x9911('0x6f')](function(_0xcf7fd8){socket[_0x9911('0x70')](_0x9911('0x85'),{'UserId':_0xcf7fd8,'SmsQueueId':_0x3b92c0['id']});});});});});});})['then'](respondWithStatusCode(_0x54e855,null))[_0x9911('0x54')](handleError(_0x54e855,null));};exports[_0x9911('0x86')]=function(_0x17cd5f,_0x29a93d,_0x426a31){return db[_0x9911('0x45')][_0x9911('0x4e')]({'where':{'id':_0x17cd5f[_0x9911('0x57')]['id']}})[_0x9911('0x28')](handleEntityNotFound(_0x29a93d,null))[_0x9911('0x28')](function(_0x243cc0){if(_0x243cc0){return _0x243cc0[_0x9911('0x86')](_0x17cd5f[_0x9911('0x56')][_0x9911('0x66')],_[_0x9911('0x87')](_0x17cd5f[_0x9911('0x56')],[_0x9911('0x66'),'id'])||{})['spread'](function(_0x53630c){for(var _0x21ecaa=0x0;_0x21ecaa<_0x17cd5f['body'][_0x9911('0x66')][_0x9911('0x3b')];_0x21ecaa+=0x1){socket[_0x9911('0x70')](_0x9911('0x71'),{'UserId':_0x17cd5f[_0x9911('0x56')][_0x9911('0x66')][_0x21ecaa],'SmsQueueId':_0x17cd5f['params']['id']});}return _0x53630c;});}})[_0x9911('0x28')](respondWithResult(_0x29a93d,null))[_0x9911('0x54')](handleError(_0x29a93d,null));};exports['removeAgents']=function(_0x3d50c7,_0x238175,_0x405793){return db['SmsQueue'][_0x9911('0x4e')]({'where':{'id':_0x3d50c7['params']['id']}})[_0x9911('0x28')](handleEntityNotFound(_0x238175,null))[_0x9911('0x28')](function(_0x2c6c69){if(_0x2c6c69){return _0x2c6c69[_0x9911('0x84')](_0x3d50c7[_0x9911('0x36')][_0x9911('0x66')])['then'](function(){if(_[_0x9911('0x88')](_0x3d50c7['query'][_0x9911('0x66')])){for(var _0x41db72=0x0;_0x41db72<_0x3d50c7['query']['ids']['length'];_0x41db72+=0x1){socket[_0x9911('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x3d50c7[_0x9911('0x36')][_0x9911('0x66')][_0x41db72]),'SmsQueueId':Number(_0x3d50c7[_0x9911('0x57')]['id'])});}}else{socket['emit'](_0x9911('0x85'),{'UserId':Number(_0x3d50c7[_0x9911('0x36')][_0x9911('0x66')]),'SmsQueueId':Number(_0x3d50c7[_0x9911('0x57')]['id'])});}});}})[_0x9911('0x28')](respondWithStatusCode(_0x238175,null))[_0x9911('0x54')](handleError(_0x238175,null));};exports[_0x9911('0x89')]=function(_0x86b710,_0x173684,_0x579fcf){var _0x5af4cc={};var _0x3da856={};var _0x45a7ad;var _0x10d8d4;return db[_0x9911('0x45')][_0x9911('0x5a')]({'where':{'id':_0x86b710[_0x9911('0x57')]['id']}})[_0x9911('0x28')](handleEntityNotFound(_0x173684,null))['then'](function(_0x32c25a){if(_0x32c25a){_0x45a7ad=_0x32c25a;_0x3da856['model']=_['keys'](db[_0x9911('0x5b')][_0x9911('0x4c')]);_0x3da856[_0x9911('0x36')]=_[_0x9911('0x4b')](_0x86b710[_0x9911('0x36')]);_0x3da856[_0x9911('0x37')]=_[_0x9911('0x38')](_0x3da856[_0x9911('0x34')],_0x3da856[_0x9911('0x36')]);_0x5af4cc[_0x9911('0x39')]=_['intersection'](_0x3da856[_0x9911('0x34')],qs[_0x9911('0x3a')](_0x86b710[_0x9911('0x36')][_0x9911('0x3a')]));_0x5af4cc[_0x9911('0x39')]=_0x5af4cc[_0x9911('0x39')][_0x9911('0x3b')]?_0x5af4cc[_0x9911('0x39')]:_0x3da856[_0x9911('0x34')];_0x5af4cc['order']=qs[_0x9911('0x3f')](_0x86b710[_0x9911('0x36')][_0x9911('0x3f')]);_0x5af4cc[_0x9911('0x40')]=qs[_0x9911('0x37')](_[_0x9911('0x41')](_0x86b710[_0x9911('0x36')],_0x3da856[_0x9911('0x37')]));if(_0x86b710[_0x9911('0x36')][_0x9911('0x42')]){_0x5af4cc['where']=_[_0x9911('0x44')](_0x5af4cc[_0x9911('0x40')],{'$or':_[_0x9911('0x35')](_0x5af4cc[_0x9911('0x39')],function(_0x38fe47){var _0x69cca={};_0x69cca[_0x38fe47]={'$like':'%'+_0x86b710[_0x9911('0x36')][_0x9911('0x42')]+'%'};return _0x69cca;})});}_0x5af4cc=_[_0x9911('0x44')]({},_0x5af4cc,_0x86b710[_0x9911('0x4d')]);return _0x45a7ad[_0x9911('0x89')](_0x5af4cc);}})['then'](function(_0x203f24){if(_0x203f24){_0x10d8d4=_0x203f24[_0x9911('0x3b')];if(!_0x86b710[_0x9911('0x36')][_0x9911('0x3c')](_0x9911('0x3d'))){_0x5af4cc[_0x9911('0x20')]=qs['limit'](_0x86b710['query'][_0x9911('0x20')]);_0x5af4cc[_0x9911('0x1f')]=qs['offset'](_0x86b710['query'][_0x9911('0x1f')]);}return _0x45a7ad['getAgents'](_0x5af4cc);}})[_0x9911('0x28')](function(_0x2bc055){if(_0x2bc055){return _0x2bc055?{'count':_0x10d8d4,'rows':_0x2bc055}:null;}})[_0x9911('0x28')](respondWithResult(_0x173684,null))[_0x9911('0x54')](handleError(_0x173684,null));};
\ No newline at end of file
+var _0x3c0f=['end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','name','send','index','map','SmsQueue','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','User','agent','createdAt','format','%s/%s','SIP','smsPause','getTeams','Team','pick','addTeams','body','ids','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','field','from','team_has_sms_queues','user_has_teams','SmsQueueId\x20=\x20?','Agents','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x3c0f,0x69));var _0xf3c0=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0x3c0f[_0x7feb90];return _0x3c5b33;};'use strict';var pdf=require(_0xf3c0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf3c0('0x1'));var zipdir=require(_0xf3c0('0x2'));var jsonpatch=require(_0xf3c0('0x3'));var rp=require(_0xf3c0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf3c0('0x5'));var util=require(_0xf3c0('0x6'));var path=require(_0xf3c0('0x7'));var sox=require('sox');var csv=require(_0xf3c0('0x8'));var ejs=require(_0xf3c0('0x9'));var fs=require('fs');var _=require(_0xf3c0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf3c0('0xb'));var deskjs=require(_0xf3c0('0xc'));var toCsv=require(_0xf3c0('0x8'));var querystring=require(_0xf3c0('0xd'));var Papa=require('papaparse');var Redis=require(_0xf3c0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf3c0('0xf'));var as=require(_0xf3c0('0x10'));var hardwareService=require(_0xf3c0('0x11'));var logger=require(_0xf3c0('0x12'))(_0xf3c0('0x13'));var utils=require(_0xf3c0('0x14'));var config=require(_0xf3c0('0x15'));var db=require('../../mysqldb')['db'];config[_0xf3c0('0x16')]=_[_0xf3c0('0x17')](config[_0xf3c0('0x16')],{'host':_0xf3c0('0x18'),'port':0x18eb});var socket=require(_0xf3c0('0x19'))(new Redis(config[_0xf3c0('0x16')]));require('./smsQueue.socket')[_0xf3c0('0x1a')](socket);function respondWithStatusCode(_0x433f88,_0x3a2036){_0x3a2036=_0x3a2036||0xcc;return function(_0x4f701e){if(_0x4f701e){return _0x433f88[_0xf3c0('0x1b')](_0x3a2036);}return _0x433f88[_0xf3c0('0x1c')](_0x3a2036)[_0xf3c0('0x1d')]();};}function respondWithResult(_0x5d1aaf,_0x3d880c){_0x3d880c=_0x3d880c||0xc8;return function(_0xbf3d97){if(_0xbf3d97){return _0x5d1aaf[_0xf3c0('0x1c')](_0x3d880c)[_0xf3c0('0x1e')](_0xbf3d97);}};}function respondWithFilteredResult(_0x37362e,_0x3ada87){return function(_0x40c7f2){if(_0x40c7f2){var _0x2f15ff=_0x40c7f2['count'],_0x142330=_0x3ada87[_0xf3c0('0x1f')],_0x5a21b0=_0x3ada87[_0xf3c0('0x1f')]+_0x3ada87[_0xf3c0('0x20')],_0x2f109e;if(_0x5a21b0>=_0x2f15ff){_0x5a21b0=_0x2f15ff;_0x2f109e=0xc8;}else{_0x2f109e=0xce;}_0x37362e['status'](_0x2f109e);return _0x37362e[_0xf3c0('0x21')](_0xf3c0('0x22'),_0x142330+'-'+_0x5a21b0+'/'+_0x2f15ff)[_0xf3c0('0x1e')](_0x40c7f2);}return null;};}function patchUpdates(_0x2277ab){return function(_0x5deddc){try{jsonpatch[_0xf3c0('0x23')](_0x5deddc,_0x2277ab,!![]);}catch(_0x533352){return BPromise['reject'](_0x533352);}return _0x5deddc[_0xf3c0('0x24')]();};}function saveUpdates(_0x49bafb,_0x1c969d){return function(_0x56be4e){if(_0x56be4e){return _0x56be4e[_0xf3c0('0x25')](_0x49bafb)[_0xf3c0('0x26')](function(_0x14b3a8){return _0x14b3a8;});}return null;};}function removeEntity(_0x529f99,_0x53e1f9){return function(_0x3d858b){if(_0x3d858b){return _0x3d858b[_0xf3c0('0x27')]()[_0xf3c0('0x26')](function(){var _0x33045d=_0x3d858b[_0xf3c0('0x28')]({'plain':!![]});var _0x5b95ba=_0xf3c0('0x29');return db[_0xf3c0('0x2a')][_0xf3c0('0x27')]({'where':{'type':_0x5b95ba,'resourceId':_0x33045d['id']}})['then'](function(){return _0x3d858b;});})['then'](function(){_0x529f99[_0xf3c0('0x1c')](0xcc)[_0xf3c0('0x1d')]();});}};}function handleEntityNotFound(_0x1b5661,_0x30aca7){return function(_0x379ca5){if(!_0x379ca5){_0x1b5661[_0xf3c0('0x1b')](0x194);}return _0x379ca5;};}function handleError(_0x106b70,_0x18bf97){_0x18bf97=_0x18bf97||0x1f4;return function(_0x2c262a){logger[_0xf3c0('0x2b')](_0x2c262a['stack']);if(_0x2c262a[_0xf3c0('0x2c')]){delete _0x2c262a[_0xf3c0('0x2c')];}_0x106b70[_0xf3c0('0x1c')](_0x18bf97)[_0xf3c0('0x2d')](_0x2c262a);};}exports[_0xf3c0('0x2e')]=function(_0x3f1386,_0x326827){var _0x394b4f={},_0x430a3c={},_0x438cf6={'count':0x0,'rows':[]};var _0xfe9079=_[_0xf3c0('0x2f')](db[_0xf3c0('0x30')]['rawAttributes'],function(_0xe3f8b8){return{'name':_0xe3f8b8[_0xf3c0('0x31')],'type':_0xe3f8b8[_0xf3c0('0x32')][_0xf3c0('0x33')]};});_0x430a3c[_0xf3c0('0x34')]=_[_0xf3c0('0x2f')](_0xfe9079,_0xf3c0('0x2c'));_0x430a3c[_0xf3c0('0x35')]=_['keys'](_0x3f1386[_0xf3c0('0x35')]);_0x430a3c[_0xf3c0('0x36')]=_[_0xf3c0('0x37')](_0x430a3c[_0xf3c0('0x34')],_0x430a3c[_0xf3c0('0x35')]);_0x394b4f[_0xf3c0('0x38')]=_[_0xf3c0('0x37')](_0x430a3c['model'],qs[_0xf3c0('0x39')](_0x3f1386[_0xf3c0('0x35')][_0xf3c0('0x39')]));_0x394b4f['attributes']=_0x394b4f[_0xf3c0('0x38')][_0xf3c0('0x3a')]?_0x394b4f['attributes']:_0x430a3c['model'];if(!_0x3f1386[_0xf3c0('0x35')][_0xf3c0('0x3b')](_0xf3c0('0x3c'))){_0x394b4f[_0xf3c0('0x20')]=qs['limit'](_0x3f1386[_0xf3c0('0x35')]['limit']);_0x394b4f[_0xf3c0('0x1f')]=qs[_0xf3c0('0x1f')](_0x3f1386['query'][_0xf3c0('0x1f')]);}_0x394b4f[_0xf3c0('0x3d')]=qs[_0xf3c0('0x3e')](_0x3f1386[_0xf3c0('0x35')][_0xf3c0('0x3e')]);_0x394b4f[_0xf3c0('0x3f')]=qs[_0xf3c0('0x36')](_['pick'](_0x3f1386[_0xf3c0('0x35')],_0x430a3c[_0xf3c0('0x36')]),_0xfe9079);if(_0x3f1386[_0xf3c0('0x35')][_0xf3c0('0x40')]){_0x394b4f[_0xf3c0('0x3f')]=_[_0xf3c0('0x41')](_0x394b4f[_0xf3c0('0x3f')],{'$or':_[_0xf3c0('0x2f')](_0xfe9079,function(_0x1d42e0){if(_0x1d42e0[_0xf3c0('0x32')]!=='VIRTUAL'){var _0x43b22d={};_0x43b22d[_0x1d42e0[_0xf3c0('0x2c')]]={'$like':'%'+_0x3f1386['query'][_0xf3c0('0x40')]+'%'};return _0x43b22d;}})});}_0x394b4f=_[_0xf3c0('0x41')]({},_0x394b4f,_0x3f1386[_0xf3c0('0x42')]);var _0x10d324={'where':_0x394b4f[_0xf3c0('0x3f')]};return db[_0xf3c0('0x30')][_0xf3c0('0x43')](_0x10d324)[_0xf3c0('0x26')](function(_0x265f7c){_0x438cf6[_0xf3c0('0x43')]=_0x265f7c;if(_0x3f1386['query'][_0xf3c0('0x44')]){_0x394b4f[_0xf3c0('0x45')]=[{'all':!![]}];}return db[_0xf3c0('0x30')]['findAll'](_0x394b4f);})[_0xf3c0('0x26')](function(_0x475c10){_0x438cf6[_0xf3c0('0x46')]=_0x475c10;return _0x438cf6;})[_0xf3c0('0x26')](respondWithFilteredResult(_0x326827,_0x394b4f))[_0xf3c0('0x47')](handleError(_0x326827,null));};exports[_0xf3c0('0x48')]=function(_0x2ce2f2,_0x1f63d9){var _0x215d3a={'raw':!![],'where':{'id':_0x2ce2f2[_0xf3c0('0x49')]['id']}},_0x2bf643={};_0x2bf643[_0xf3c0('0x34')]=_[_0xf3c0('0x4a')](db[_0xf3c0('0x30')][_0xf3c0('0x4b')]);_0x2bf643[_0xf3c0('0x35')]=_['keys'](_0x2ce2f2['query']);_0x2bf643['filters']=_[_0xf3c0('0x37')](_0x2bf643['model'],_0x2bf643[_0xf3c0('0x35')]);_0x215d3a['attributes']=_[_0xf3c0('0x37')](_0x2bf643[_0xf3c0('0x34')],qs[_0xf3c0('0x39')](_0x2ce2f2[_0xf3c0('0x35')][_0xf3c0('0x39')]));_0x215d3a['attributes']=_0x215d3a[_0xf3c0('0x38')]['length']?_0x215d3a[_0xf3c0('0x38')]:_0x2bf643[_0xf3c0('0x34')];if(_0x2ce2f2[_0xf3c0('0x35')][_0xf3c0('0x44')]){_0x215d3a[_0xf3c0('0x45')]=[{'all':!![]}];}_0x215d3a=_[_0xf3c0('0x41')]({},_0x215d3a,_0x2ce2f2[_0xf3c0('0x42')]);return db[_0xf3c0('0x30')][_0xf3c0('0x4c')](_0x215d3a)[_0xf3c0('0x26')](handleEntityNotFound(_0x1f63d9,null))[_0xf3c0('0x26')](respondWithResult(_0x1f63d9,null))['catch'](handleError(_0x1f63d9,null));};exports[_0xf3c0('0x4d')]=function(_0x31b0ef,_0x36ae0a){return db[_0xf3c0('0x30')][_0xf3c0('0x4d')](_0x31b0ef['body'],{})[_0xf3c0('0x26')](function(_0x4ce394){var _0x1860f0=_0x31b0ef[_0xf3c0('0x4e')][_0xf3c0('0x28')]({'plain':!![]});if(!_0x1860f0)throw new Error(_0xf3c0('0x4f'));if(_0x1860f0['role']===_0xf3c0('0x4e')){var _0x441633=_0x4ce394[_0xf3c0('0x28')]({'plain':!![]});var _0x708b5=_0xf3c0('0x29');return db[_0xf3c0('0x50')][_0xf3c0('0x4c')]({'where':{'name':_0x708b5,'userProfileId':_0x1860f0['userProfileId']},'raw':!![]})[_0xf3c0('0x26')](function(_0x2abc78){if(_0x2abc78&&_0x2abc78[_0xf3c0('0x51')]===0x0){return db[_0xf3c0('0x2a')][_0xf3c0('0x4d')]({'name':_0x441633[_0xf3c0('0x2c')],'resourceId':_0x441633['id'],'type':_0x2abc78[_0xf3c0('0x2c')],'sectionId':_0x2abc78['id']},{})[_0xf3c0('0x26')](function(){return _0x4ce394;});}else{return _0x4ce394;}})[_0xf3c0('0x47')](function(_0x216299){logger[_0xf3c0('0x2b')](_0xf3c0('0x52'),_0x216299);throw _0x216299;});}return _0x4ce394;})[_0xf3c0('0x26')](respondWithResult(_0x36ae0a,0xc9))[_0xf3c0('0x47')](handleError(_0x36ae0a,null));};exports[_0xf3c0('0x25')]=function(_0x2f677d,_0x38e20a){if(_0x2f677d['body']['id']){delete _0x2f677d['body']['id'];}return db['SmsQueue'][_0xf3c0('0x4c')]({'where':{'id':_0x2f677d[_0xf3c0('0x49')]['id']}})[_0xf3c0('0x26')](handleEntityNotFound(_0x38e20a,null))[_0xf3c0('0x26')](saveUpdates(_0x2f677d['body'],null))[_0xf3c0('0x26')](respondWithResult(_0x38e20a,null))[_0xf3c0('0x47')](handleError(_0x38e20a,null));};exports[_0xf3c0('0x27')]=function(_0x2408f7,_0x3514d4){return db[_0xf3c0('0x30')]['find']({'where':{'id':_0x2408f7[_0xf3c0('0x49')]['id']}})[_0xf3c0('0x26')](handleEntityNotFound(_0x3514d4,null))['then'](removeEntity(_0x3514d4,null))[_0xf3c0('0x47')](handleError(_0x3514d4,null));};exports[_0xf3c0('0x53')]=function(_0x46155f,_0x57fa83){return db[_0xf3c0('0x30')][_0xf3c0('0x53')]()[_0xf3c0('0x26')](respondWithResult(_0x57fa83,null))['catch'](handleError(_0x57fa83,null));};exports[_0xf3c0('0x54')]=function(_0x500b91,_0x3ff874,_0x306d86){var _0x499919={'raw':!![],'where':{}},_0x3665e2={},_0x5bbd36;return db[_0xf3c0('0x30')][_0xf3c0('0x55')]({'where':{'id':_0x500b91['params']['id']}})[_0xf3c0('0x26')](handleEntityNotFound(_0x3ff874,null))[_0xf3c0('0x26')](function(_0x923c09){if(_0x923c09){_0x5bbd36=_0x923c09[_0xf3c0('0x28')]({'plain':!![]});_0x3665e2[_0xf3c0('0x34')]=_[_0xf3c0('0x4a')](db['UserSmsQueue'][_0xf3c0('0x4b')]);_0x3665e2[_0xf3c0('0x35')]=_[_0xf3c0('0x4a')](_0x500b91[_0xf3c0('0x35')]);_0x3665e2[_0xf3c0('0x36')]=_[_0xf3c0('0x37')](_0x3665e2[_0xf3c0('0x34')],_0x3665e2[_0xf3c0('0x35')]);_0x499919[_0xf3c0('0x38')]=_[_0xf3c0('0x37')](_0x3665e2['model'],qs[_0xf3c0('0x39')](_0x500b91['query'][_0xf3c0('0x39')]));_0x499919[_0xf3c0('0x38')]=_0x499919[_0xf3c0('0x38')][_0xf3c0('0x3a')]?_0x499919['attributes']:_0x3665e2[_0xf3c0('0x34')];if(!_0x500b91[_0xf3c0('0x35')][_0xf3c0('0x3b')](_0xf3c0('0x3c'))){_0x499919['limit']=qs[_0xf3c0('0x20')](_0x500b91[_0xf3c0('0x35')][_0xf3c0('0x20')]);_0x499919[_0xf3c0('0x1f')]=qs[_0xf3c0('0x1f')](_0x500b91[_0xf3c0('0x35')][_0xf3c0('0x1f')]);}_0x499919['order']=qs[_0xf3c0('0x3e')](_0x500b91['query'][_0xf3c0('0x3e')]);_0x499919[_0xf3c0('0x3f')]=qs[_0xf3c0('0x36')](_['pick'](_0x500b91[_0xf3c0('0x35')],_0x3665e2['filters']));_0x499919[_0xf3c0('0x3f')]['SmsQueueId']=_0x923c09['id'];if(_0x500b91[_0xf3c0('0x35')][_0xf3c0('0x40')]){_0x499919[_0xf3c0('0x3f')]=_[_0xf3c0('0x41')](_0x499919[_0xf3c0('0x3f')],{'$or':_[_0xf3c0('0x2f')](_0x499919['attributes'],function(_0x2078ed){var _0x3eb3de={};_0x3eb3de[_0x2078ed]={'$like':'%'+_0x500b91[_0xf3c0('0x35')][_0xf3c0('0x40')]+'%'};return _0x3eb3de;})});}_0x499919=_[_0xf3c0('0x41')]({},_0x499919,_0x500b91[_0xf3c0('0x42')]);return db[_0xf3c0('0x56')]['findAll'](_0x499919);}})[_0xf3c0('0x26')](function(_0x469348){if(_0x469348){return db[_0xf3c0('0x57')]['findAndCountAll']({'where':{'id':_['map'](_0x469348,'UserId'),'role':_0xf3c0('0x58')},'attributes':['id',_0xf3c0('0x2c'),'smsPause','updatedAt',_0xf3c0('0x59')]});}})[_0xf3c0('0x26')](function(_0x33510e){if(_0x33510e){return{'count':_0x33510e[_0xf3c0('0x43')],'rows':_[_0xf3c0('0x2f')](_0x33510e[_0xf3c0('0x46')],function(_0xa2ec50){return{'membername':_0xa2ec50[_0xf3c0('0x2c')],'UserId':_0xa2ec50['id'],'queue_name':_0x5bbd36['name'],'SmsQueueId':_0x5bbd36['id'],'interface':util[_0xf3c0('0x5a')](_0xf3c0('0x5b'),_0xf3c0('0x5c'),_0xa2ec50['name']),'penalty':0x0,'paused':_0xa2ec50[_0xf3c0('0x5d')],'createdAt':_0xa2ec50[_0xf3c0('0x59')],'updatedAt':_0xa2ec50['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf3c0('0x26')](respondWithFilteredResult(_0x3ff874,_0x499919))['catch'](handleError(_0x3ff874,null));};exports[_0xf3c0('0x5e')]=function(_0x58e467,_0x4f7503,_0x553b3f){var _0x1dacbc={};var _0x3abe38={};var _0x10b10f;var _0xcc3019;return db['SmsQueue'][_0xf3c0('0x55')]({'where':{'id':_0x58e467[_0xf3c0('0x49')]['id']}})[_0xf3c0('0x26')](handleEntityNotFound(_0x4f7503,null))[_0xf3c0('0x26')](function(_0x4bef6b){if(_0x4bef6b){_0x10b10f=_0x4bef6b;_0x3abe38[_0xf3c0('0x34')]=_['keys'](db[_0xf3c0('0x5f')]['rawAttributes']);_0x3abe38['query']=_[_0xf3c0('0x4a')](_0x58e467[_0xf3c0('0x35')]);_0x3abe38['filters']=_[_0xf3c0('0x37')](_0x3abe38[_0xf3c0('0x34')],_0x3abe38[_0xf3c0('0x35')]);_0x1dacbc[_0xf3c0('0x38')]=_['intersection'](_0x3abe38[_0xf3c0('0x34')],qs[_0xf3c0('0x39')](_0x58e467[_0xf3c0('0x35')][_0xf3c0('0x39')]));_0x1dacbc[_0xf3c0('0x38')]=_0x1dacbc[_0xf3c0('0x38')]['length']?_0x1dacbc[_0xf3c0('0x38')]:_0x3abe38[_0xf3c0('0x34')];_0x1dacbc[_0xf3c0('0x3d')]=qs[_0xf3c0('0x3e')](_0x58e467[_0xf3c0('0x35')][_0xf3c0('0x3e')]);_0x1dacbc[_0xf3c0('0x3f')]=qs[_0xf3c0('0x36')](_[_0xf3c0('0x60')](_0x58e467[_0xf3c0('0x35')],_0x3abe38['filters']));if(_0x58e467['query'][_0xf3c0('0x40')]){_0x1dacbc['where']=_['merge'](_0x1dacbc[_0xf3c0('0x3f')],{'$or':_[_0xf3c0('0x2f')](_0x1dacbc[_0xf3c0('0x38')],function(_0x4095b4){var _0x423cf8={};_0x423cf8[_0x4095b4]={'$like':'%'+_0x58e467[_0xf3c0('0x35')][_0xf3c0('0x40')]+'%'};return _0x423cf8;})});}_0x1dacbc=_[_0xf3c0('0x41')]({},_0x1dacbc,_0x58e467['options']);return _0x10b10f['getTeams'](_0x1dacbc);}})['then'](function(_0x819bd3){if(_0x819bd3){_0xcc3019=_0x819bd3['length'];if(!_0x58e467[_0xf3c0('0x35')][_0xf3c0('0x3b')](_0xf3c0('0x3c'))){_0x1dacbc[_0xf3c0('0x20')]=qs[_0xf3c0('0x20')](_0x58e467[_0xf3c0('0x35')][_0xf3c0('0x20')]);_0x1dacbc[_0xf3c0('0x1f')]=qs[_0xf3c0('0x1f')](_0x58e467['query']['offset']);}return _0x10b10f[_0xf3c0('0x5e')](_0x1dacbc);}})[_0xf3c0('0x26')](function(_0x174469){if(_0x174469){return _0x174469?{'count':_0xcc3019,'rows':_0x174469}:null;}})[_0xf3c0('0x26')](respondWithResult(_0x4f7503,null))['catch'](handleError(_0x4f7503,null));};exports[_0xf3c0('0x61')]=function(_0x50dd7f,_0x8d7b92,_0x492148){var _0x2b7a09=_0x50dd7f[_0xf3c0('0x62')][_0xf3c0('0x63')];return db['Team']['findAll']({'where':{'id':_0x2b7a09},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xf3c0('0x2c'),'online',_0xf3c0('0x64'),'interface'],'raw':!![]}]})[_0xf3c0('0x26')](function(_0x439a7a){if(_0x439a7a){var _0x32e3e7=_[_0xf3c0('0x65')](_0x439a7a,function(_0x56c348){var _0x26601d=_0x56c348[_0xf3c0('0x28')]({'plain':!![]});return _0x26601d['Agents'];});return db['SmsQueue']['find']({'where':{'id':_0x50dd7f[_0xf3c0('0x49')]['id']}})['then'](function(_0x44c182){return db[_0xf3c0('0x66')][_0xf3c0('0x67')](function(_0x3d0b63){return _0x44c182[_0xf3c0('0x61')](_0x2b7a09,{'transaction':_0x3d0b63})[_0xf3c0('0x26')](function(){return BPromise[_0xf3c0('0x68')](_0x32e3e7,function(_0x2fd994){return db['UserSmsQueue'][_0xf3c0('0x69')]({'where':{'UserId':_0x2fd994['id'],'SmsQueueId':_0x50dd7f['params']['id']},'transaction':_0x3d0b63});});})[_0xf3c0('0x26')](function(){_0x32e3e7[_0xf3c0('0x6a')](function(_0xf5afae){socket['emit'](_0xf3c0('0x6b'),{'UserId':_0xf5afae['id'],'SmsQueueId':_0x44c182['id']});});});});});}})[_0xf3c0('0x26')](respondWithStatusCode(_0x8d7b92,null))[_0xf3c0('0x47')](handleError(_0x8d7b92,null));};exports[_0xf3c0('0x6c')]=function(_0x170d86,_0x2ae600,_0x2014c7){return db[_0xf3c0('0x5f')]['findAll']({'where':{'id':_0x170d86[_0xf3c0('0x35')][_0xf3c0('0x63')]},'attributes':['id'],'include':[{'model':db[_0xf3c0('0x57')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf3c0('0x26')](handleEntityNotFound(_0x2ae600,null))[_0xf3c0('0x26')](function(_0x4ed0e4){var _0x955570=_[_0xf3c0('0x2f')](_0x4ed0e4,'id');var _0x3f8453=[];var _0xd9b50f=[];var _0xc292ae=squel['select']();_0xc292ae[_0xf3c0('0x6d')]('tq.TeamId')[_0xf3c0('0x6e')](_0xf3c0('0x6f'),'tq')['join'](_0xf3c0('0x70'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf3c0('0x3f')](_0xf3c0('0x71'),_0x170d86['params']['id']);for(var _0x1a4d76=0x0;_0x1a4d76<_0x4ed0e4[_0xf3c0('0x3a')];_0x1a4d76+=0x1){let _0x5e83e9=_0x4ed0e4[_0x1a4d76];for(var _0xacaae4=0x0;_0xacaae4<_0x5e83e9['Agents']['length'];_0xacaae4+=0x1){let _0x2e0c21=_0x5e83e9[_0xf3c0('0x72')][_0xacaae4];var _0x26a12d=_0xc292ae['clone']();_0x26a12d[_0xf3c0('0x3f')](_0xf3c0('0x73'),_0x2e0c21['id']);_0xd9b50f['push'](db[_0xf3c0('0x66')][_0xf3c0('0x35')](_0x26a12d['toString'](),{'type':db[_0xf3c0('0x66')][_0xf3c0('0x74')][_0xf3c0('0x75')]})[_0xf3c0('0x26')](function(_0x2f1dc9){if(_0x2f1dc9['length']===0x1){return _0x2e0c21['id'];}else{var _0x10690d=_[_0xf3c0('0x76')](_[_0xf3c0('0x2f')](_0x2f1dc9,_0xf3c0('0x77')),function(_0x469bcb){return _[_0xf3c0('0x78')](_0x955570,_0x469bcb);});if(_0x10690d){return _0x2e0c21['id'];}}}));}}return BPromise[_0xf3c0('0x79')](_0xd9b50f)[_0xf3c0('0x26')](function(_0x5c8b56){_0x3f8453=_(_0x3f8453)[_0xf3c0('0x7a')](_0x5c8b56)[_0xf3c0('0x7b')]()[_0xf3c0('0x7c')]();return db[_0xf3c0('0x30')][_0xf3c0('0x4c')]({'where':{'id':_0x170d86[_0xf3c0('0x49')]['id']}})[_0xf3c0('0x26')](function(_0x1df73d){return db[_0xf3c0('0x66')][_0xf3c0('0x67')](function(_0xb52c5a){return _0x1df73d[_0xf3c0('0x6c')](_0x170d86[_0xf3c0('0x35')][_0xf3c0('0x63')],{'transaction':_0xb52c5a})['then'](function(){if(!_[_0xf3c0('0x7d')](_0x3f8453)){return _0x1df73d[_0xf3c0('0x7e')](_0x3f8453,{'transaction':_0xb52c5a});}})[_0xf3c0('0x26')](function(){_0x3f8453[_0xf3c0('0x6a')](function(_0x10c7cc){socket[_0xf3c0('0x7f')](_0xf3c0('0x80'),{'UserId':_0x10c7cc,'SmsQueueId':_0x1df73d['id']});});});});});});})[_0xf3c0('0x26')](respondWithStatusCode(_0x2ae600,null))['catch'](handleError(_0x2ae600,null));};exports[_0xf3c0('0x81')]=function(_0xa23e4b,_0x57a661,_0x549a91){return db[_0xf3c0('0x30')][_0xf3c0('0x4c')]({'where':{'id':_0xa23e4b[_0xf3c0('0x49')]['id']}})[_0xf3c0('0x26')](handleEntityNotFound(_0x57a661,null))['then'](function(_0x457c4d){if(_0x457c4d){return _0x457c4d[_0xf3c0('0x81')](_0xa23e4b['body'][_0xf3c0('0x63')],_[_0xf3c0('0x82')](_0xa23e4b[_0xf3c0('0x62')],['ids','id'])||{})[_0xf3c0('0x83')](function(_0x376943){for(var _0x33a34e=0x0;_0x33a34e<_0xa23e4b[_0xf3c0('0x62')][_0xf3c0('0x63')][_0xf3c0('0x3a')];_0x33a34e+=0x1){socket[_0xf3c0('0x7f')](_0xf3c0('0x6b'),{'UserId':_0xa23e4b['body'][_0xf3c0('0x63')][_0x33a34e],'SmsQueueId':_0xa23e4b[_0xf3c0('0x49')]['id']});}return _0x376943;});}})['then'](respondWithResult(_0x57a661,null))[_0xf3c0('0x47')](handleError(_0x57a661,null));};exports[_0xf3c0('0x7e')]=function(_0x2f94bf,_0x42eb7d,_0x4afa8c){return db[_0xf3c0('0x30')][_0xf3c0('0x4c')]({'where':{'id':_0x2f94bf['params']['id']}})['then'](handleEntityNotFound(_0x42eb7d,null))[_0xf3c0('0x26')](function(_0x51a234){if(_0x51a234){return _0x51a234['removeAgents'](_0x2f94bf['query'][_0xf3c0('0x63')])[_0xf3c0('0x26')](function(){if(_[_0xf3c0('0x84')](_0x2f94bf['query'][_0xf3c0('0x63')])){for(var _0x23b2c2=0x0;_0x23b2c2<_0x2f94bf[_0xf3c0('0x35')][_0xf3c0('0x63')]['length'];_0x23b2c2+=0x1){socket[_0xf3c0('0x7f')](_0xf3c0('0x80'),{'UserId':Number(_0x2f94bf[_0xf3c0('0x35')][_0xf3c0('0x63')][_0x23b2c2]),'SmsQueueId':Number(_0x2f94bf[_0xf3c0('0x49')]['id'])});}}else{socket[_0xf3c0('0x7f')](_0xf3c0('0x80'),{'UserId':Number(_0x2f94bf[_0xf3c0('0x35')][_0xf3c0('0x63')]),'SmsQueueId':Number(_0x2f94bf[_0xf3c0('0x49')]['id'])});}});}})[_0xf3c0('0x26')](respondWithStatusCode(_0x42eb7d,null))[_0xf3c0('0x47')](handleError(_0x42eb7d,null));};exports[_0xf3c0('0x85')]=function(_0x5bca41,_0x506057,_0x4eea8a){var _0x5c9163={};var _0x129e02={};var _0x635022;var _0x5d2a9a;return db[_0xf3c0('0x30')]['findOne']({'where':{'id':_0x5bca41['params']['id']}})[_0xf3c0('0x26')](handleEntityNotFound(_0x506057,null))['then'](function(_0x19ef16){if(_0x19ef16){_0x635022=_0x19ef16;_0x129e02[_0xf3c0('0x34')]=_[_0xf3c0('0x4a')](db[_0xf3c0('0x57')][_0xf3c0('0x4b')]);_0x129e02[_0xf3c0('0x35')]=_[_0xf3c0('0x4a')](_0x5bca41[_0xf3c0('0x35')]);_0x129e02[_0xf3c0('0x36')]=_[_0xf3c0('0x37')](_0x129e02[_0xf3c0('0x34')],_0x129e02[_0xf3c0('0x35')]);_0x5c9163['attributes']=_[_0xf3c0('0x37')](_0x129e02[_0xf3c0('0x34')],qs[_0xf3c0('0x39')](_0x5bca41['query'][_0xf3c0('0x39')]));_0x5c9163[_0xf3c0('0x38')]=_0x5c9163[_0xf3c0('0x38')]['length']?_0x5c9163[_0xf3c0('0x38')]:_0x129e02[_0xf3c0('0x34')];_0x5c9163[_0xf3c0('0x3d')]=qs[_0xf3c0('0x3e')](_0x5bca41[_0xf3c0('0x35')][_0xf3c0('0x3e')]);_0x5c9163[_0xf3c0('0x3f')]=qs[_0xf3c0('0x36')](_['pick'](_0x5bca41[_0xf3c0('0x35')],_0x129e02['filters']));if(_0x5bca41[_0xf3c0('0x35')][_0xf3c0('0x40')]){_0x5c9163['where']=_[_0xf3c0('0x41')](_0x5c9163['where'],{'$or':_[_0xf3c0('0x2f')](_0x5c9163['attributes'],function(_0x39c7a1){var _0x254e62={};_0x254e62[_0x39c7a1]={'$like':'%'+_0x5bca41['query']['filter']+'%'};return _0x254e62;})});}_0x5c9163=_[_0xf3c0('0x41')]({},_0x5c9163,_0x5bca41[_0xf3c0('0x42')]);return _0x635022[_0xf3c0('0x85')](_0x5c9163);}})[_0xf3c0('0x26')](function(_0x3dce38){if(_0x3dce38){_0x5d2a9a=_0x3dce38[_0xf3c0('0x3a')];if(!_0x5bca41['query']['hasOwnProperty']('nolimit')){_0x5c9163['limit']=qs[_0xf3c0('0x20')](_0x5bca41[_0xf3c0('0x35')][_0xf3c0('0x20')]);_0x5c9163[_0xf3c0('0x1f')]=qs[_0xf3c0('0x1f')](_0x5bca41[_0xf3c0('0x35')][_0xf3c0('0x1f')]);}return _0x635022['getAgents'](_0x5c9163);}})[_0xf3c0('0x26')](function(_0x2bcb1d){if(_0x2bcb1d){return _0x2bcb1d?{'count':_0x5d2a9a,'rows':_0x2bcb1d}:null;}})[_0xf3c0('0x26')](respondWithResult(_0x506057,null))[_0xf3c0('0x47')](handleError(_0x506057,null));};
\ No newline at end of file
index f537285..2fb58a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6995=['events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2c8641,_0x5d09a1){var _0x476901=function(_0x20e34f){while(--_0x20e34f){_0x2c8641['push'](_0x2c8641['shift']());}};_0x476901(++_0x5d09a1);}(_0x6995,0xfd));var _0x5699=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6995[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x5699('0x0'));var SmsQueue=require(_0x5699('0x1'))['db'][_0x5699('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x5699('0x3')](0x0);var events={'afterCreate':_0x5699('0x4'),'afterUpdate':_0x5699('0x5'),'afterDestroy':_0x5699('0x6')};function emitEvent(_0xb7d57a){return function(_0x5bea44,_0x237520,_0x249701){SmsQueueEvents['emit'](_0xb7d57a+':'+_0x5bea44['id'],_0x5bea44);SmsQueueEvents[_0x5699('0x7')](_0xb7d57a,_0x5bea44);_0x249701(null);};}for(var e in events){if(events[_0x5699('0x8')](e)){var event=events[e];SmsQueue[_0x5699('0x9')](e,emitEvent(event));}}module[_0x5699('0xa')]=SmsQueueEvents;
\ No newline at end of file
+var _0x27f2=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x36bf11,_0x1ea7b7){var _0x164a98=function(_0x2cd5c7){while(--_0x2cd5c7){_0x36bf11['push'](_0x36bf11['shift']());}};_0x164a98(++_0x1ea7b7);}(_0x27f2,0x6f));var _0x227f=function(_0xc7e123,_0x1fb099){_0xc7e123=_0xc7e123-0x0;var _0x5621cc=_0x27f2[_0xc7e123];return _0x5621cc;};'use strict';var EventEmitter=require(_0x227f('0x0'));var SmsQueue=require(_0x227f('0x1'))['db'][_0x227f('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x227f('0x3')](0x0);var events={'afterCreate':_0x227f('0x4'),'afterUpdate':_0x227f('0x5'),'afterDestroy':_0x227f('0x6')};function emitEvent(_0x4a166f){return function(_0x3cd131,_0x2e9ed8,_0x221473){SmsQueueEvents[_0x227f('0x7')](_0x4a166f+':'+_0x3cd131['id'],_0x3cd131);SmsQueueEvents['emit'](_0x4a166f,_0x3cd131);_0x221473(null);};}for(var e in events){if(events[_0x227f('0x8')](e)){var event=events[e];SmsQueue[_0x227f('0x9')](e,emitEvent(event));}}module[_0x227f('0xa')]=SmsQueueEvents;
\ No newline at end of file
index f66b334..cdbb7b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x303a=['bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','lodash','../../config/logger','api','moment'];(function(_0x5a59a0,_0x4f2cee){var _0x233883=function(_0x73a1ab){while(--_0x73a1ab){_0x5a59a0['push'](_0x5a59a0['shift']());}};_0x233883(++_0x4f2cee);}(_0x303a,0x1a0));var _0xa303=function(_0x5be892,_0x68238a){_0x5be892=_0x5be892-0x0;var _0x53fc35=_0x303a[_0x5be892];return _0x53fc35;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var logger=require(_0xa303('0x1'))(_0xa303('0x2'));var moment=require(_0xa303('0x3'));var BPromise=require(_0xa303('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa303('0x5'));var rimraf=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var attributes=require(_0xa303('0x8'));module[_0xa303('0x9')]=function(_0x1c7ee9,_0x2bc3d7){return _0x1c7ee9[_0xa303('0xa')](_0xa303('0xb'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a5e=['path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','sms_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3a5e,0x14c));var _0xe3a5=function(_0x13199e,_0x5ee6aa){_0x13199e=_0x13199e-0x0;var _0x355269=_0x3a5e[_0x13199e];return _0x355269;};'use strict';var _=require(_0xe3a5('0x0'));var util=require(_0xe3a5('0x1'));var logger=require(_0xe3a5('0x2'))(_0xe3a5('0x3'));var moment=require(_0xe3a5('0x4'));var BPromise=require(_0xe3a5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe3a5('0x6'));var rimraf=require(_0xe3a5('0x7'));var config=require(_0xe3a5('0x8'));var attributes=require(_0xe3a5('0x9'));module[_0xe3a5('0xa')]=function(_0x499f61,_0x5e1507){return _0x499f61[_0xe3a5('0xb')]('SmsQueue',attributes,{'tableName':_0xe3a5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 735049c..ad2562e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x726f=['client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSmsQueue','SmsQueue','findAll','options','attributes','limit','include','map','model','catch','raw','where','info','ShowSmsQueue','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x27fcf2,_0x29d206){var _0x3b6a19=function(_0x10fc05){while(--_0x10fc05){_0x27fcf2['push'](_0x27fcf2['shift']());}};_0x3b6a19(++_0x29d206);}(_0x726f,0x188));var _0xf726=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x726f[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0xf726('0x0'));var moment=require(_0xf726('0x1'));var BPromise=require(_0xf726('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf726('0x3'));var db=require(_0xf726('0x4'))['db'];var utils=require(_0xf726('0x5'));var logger=require(_0xf726('0x6'))('rpc');var config=require(_0xf726('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf726('0x8')][_0xf726('0x9')]({'port':0x232a});config[_0xf726('0xa')]=_[_0xf726('0xb')](config[_0xf726('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf726('0xc'))(new Redis(config[_0xf726('0xa')]));require(_0xf726('0xd'))[_0xf726('0xe')](socket);function respondWithRpcPromise(_0x4f948c,_0x586282,_0x3b9274){return new BPromise(function(_0x20ca71,_0x547539){return client[_0xf726('0xf')](_0x4f948c,_0x3b9274)[_0xf726('0x10')](function(_0x55c7){logger['info'](_0xf726('0x11'),_0x586282,_0xf726('0x12'));logger[_0xf726('0x13')](_0xf726('0x14'),_0x586282,_0xf726('0x12'),JSON[_0xf726('0x15')](_0x55c7));if(_0x55c7[_0xf726('0x16')]){if(_0x55c7[_0xf726('0x16')][_0xf726('0x17')]===0x1f4){logger['error'](_0xf726('0x11'),_0x586282,_0x55c7[_0xf726('0x16')][_0xf726('0x18')]);return _0x547539(_0x55c7['error'][_0xf726('0x18')]);}logger['error'](_0xf726('0x11'),_0x586282,_0x55c7[_0xf726('0x16')][_0xf726('0x18')]);return _0x20ca71(_0x55c7[_0xf726('0x16')][_0xf726('0x18')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x586282,_0xf726('0x12'));_0x20ca71(_0x55c7[_0xf726('0x19')][_0xf726('0x18')]);}})['catch'](function(_0x900a29){logger[_0xf726('0x16')](_0xf726('0x11'),_0x586282,_0x900a29);_0x547539(_0x900a29);});});}exports[_0xf726('0x1a')]=function(_0x72e7c4){var _0x123662=this;return new Promise(function(_0x300954,_0x327f92){return db[_0xf726('0x1b')][_0xf726('0x1c')]({'raw':_0x72e7c4[_0xf726('0x1d')]?_0x72e7c4[_0xf726('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x72e7c4[_0xf726('0x1d')]?_0x72e7c4['options']['where']||null:null,'attributes':_0x72e7c4[_0xf726('0x1d')]?_0x72e7c4[_0xf726('0x1d')][_0xf726('0x1e')]||null:null,'limit':_0x72e7c4[_0xf726('0x1d')]?_0x72e7c4[_0xf726('0x1d')][_0xf726('0x1f')]||null:null,'include':_0x72e7c4[_0xf726('0x1d')]?_0x72e7c4['options'][_0xf726('0x20')]?_[_0xf726('0x21')](_0x72e7c4['options'][_0xf726('0x20')],function(_0x611473){return{'model':db[_0x611473[_0xf726('0x22')]],'as':_0x611473['as'],'attributes':_0x611473[_0xf726('0x1e')],'include':_0x611473[_0xf726('0x20')]?_[_0xf726('0x21')](_0x611473[_0xf726('0x20')],function(_0x388e95){return{'model':db[_0x388e95[_0xf726('0x22')]],'as':_0x388e95['as'],'attributes':_0x388e95[_0xf726('0x1e')],'include':_0x388e95[_0xf726('0x20')]?_[_0xf726('0x21')](_0x388e95['include'],function(_0x3248bf){return{'model':db[_0x3248bf[_0xf726('0x22')]],'as':_0x3248bf['as'],'attributes':_0x3248bf[_0xf726('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2082e3){logger['info']('GetSmsQueue',_0x72e7c4);logger['debug'](_0xf726('0x1a'),_0x72e7c4,JSON[_0xf726('0x15')](_0x2082e3));_0x300954(_0x2082e3);})[_0xf726('0x23')](function(_0x43fa6b){logger[_0xf726('0x16')](_0xf726('0x1a'),_0x43fa6b[_0xf726('0x18')],_0x72e7c4);_0x327f92(_0x123662[_0xf726('0x16')](0x1f4,_0x43fa6b[_0xf726('0x18')]));});});};exports['ShowSmsQueue']=function(_0x2d8d55){var _0x2b1161=this;return new Promise(function(_0xe999e1,_0x19814f){return db['SmsQueue']['find']({'raw':_0x2d8d55[_0xf726('0x1d')]?_0x2d8d55[_0xf726('0x1d')][_0xf726('0x24')]===undefined?!![]:![]:!![],'where':_0x2d8d55[_0xf726('0x1d')]?_0x2d8d55[_0xf726('0x1d')][_0xf726('0x25')]||null:null,'attributes':_0x2d8d55[_0xf726('0x1d')]?_0x2d8d55[_0xf726('0x1d')][_0xf726('0x1e')]||null:null,'include':_0x2d8d55[_0xf726('0x1d')]?_0x2d8d55[_0xf726('0x1d')][_0xf726('0x20')]?_['map'](_0x2d8d55['options'][_0xf726('0x20')],function(_0x383202){return{'model':db[_0x383202[_0xf726('0x22')]],'as':_0x383202['as'],'attributes':_0x383202['attributes'],'include':_0x383202[_0xf726('0x20')]?_['map'](_0x383202[_0xf726('0x20')],function(_0x55f2a5){return{'model':db[_0x55f2a5['model']],'as':_0x55f2a5['as'],'attributes':_0x55f2a5['attributes'],'include':_0x55f2a5[_0xf726('0x20')]?_['map'](_0x55f2a5[_0xf726('0x20')],function(_0x59475b){return{'model':db[_0x59475b[_0xf726('0x22')]],'as':_0x59475b['as'],'attributes':_0x59475b[_0xf726('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28c51a){logger[_0xf726('0x26')]('ShowSmsQueue',_0x2d8d55);logger[_0xf726('0x13')](_0xf726('0x27'),_0x2d8d55,JSON[_0xf726('0x15')](_0x28c51a));_0xe999e1(_0x28c51a);})[_0xf726('0x23')](function(_0x279265){logger[_0xf726('0x16')](_0xf726('0x27'),_0x279265[_0xf726('0x18')],_0x2d8d55);_0x19814f(_0x2b1161[_0xf726('0x16')](0x1f4,_0x279265[_0xf726('0x18')]));});});};
\ No newline at end of file
+var _0xb5e6=['findAll','options','where','attributes','include','map','model','catch','ShowSmsQueue','find','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./smsQueue.socket','register','then','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueue,\x20%s,\x20%s','message','info','result','GetSmsQueue','SmsQueue'];(function(_0x24f326,_0x616a7){var _0x488e2d=function(_0x293d9a){while(--_0x293d9a){_0x24f326['push'](_0x24f326['shift']());}};_0x488e2d(++_0x616a7);}(_0xb5e6,0xf5));var _0x6b5e=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb5e6[_0x432682];return _0x463d05;};'use strict';var _=require(_0x6b5e('0x0'));var util=require(_0x6b5e('0x1'));var moment=require('moment');var BPromise=require(_0x6b5e('0x2'));var rs=require(_0x6b5e('0x3'));var fs=require('fs');var Redis=require(_0x6b5e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b5e('0x5'));var logger=require(_0x6b5e('0x6'))(_0x6b5e('0x7'));var config=require(_0x6b5e('0x8'));var jayson=require(_0x6b5e('0x9'));var client=jayson[_0x6b5e('0xa')][_0x6b5e('0xb')]({'port':0x232a});config[_0x6b5e('0xc')]=_['defaults'](config[_0x6b5e('0xc')],{'host':_0x6b5e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6b5e('0xe'))[_0x6b5e('0xf')](socket);function respondWithRpcPromise(_0x21eb83,_0x1d9ac5,_0x1b19bc){return new BPromise(function(_0x3f83bd,_0x1c5cbb){return client['request'](_0x21eb83,_0x1b19bc)[_0x6b5e('0x10')](function(_0x251d66){logger['info']('SmsQueue,\x20%s,\x20%s',_0x1d9ac5,_0x6b5e('0x11'));logger[_0x6b5e('0x12')](_0x6b5e('0x13'),_0x1d9ac5,_0x6b5e('0x11'),JSON[_0x6b5e('0x14')](_0x251d66));if(_0x251d66[_0x6b5e('0x15')]){if(_0x251d66['error']['code']===0x1f4){logger['error'](_0x6b5e('0x16'),_0x1d9ac5,_0x251d66[_0x6b5e('0x15')][_0x6b5e('0x17')]);return _0x1c5cbb(_0x251d66[_0x6b5e('0x15')][_0x6b5e('0x17')]);}logger['error'](_0x6b5e('0x16'),_0x1d9ac5,_0x251d66[_0x6b5e('0x15')][_0x6b5e('0x17')]);return _0x3f83bd(_0x251d66['error'][_0x6b5e('0x17')]);}else{logger[_0x6b5e('0x18')](_0x6b5e('0x16'),_0x1d9ac5,'request\x20sent');_0x3f83bd(_0x251d66[_0x6b5e('0x19')]['message']);}})['catch'](function(_0x5e5e5c){logger[_0x6b5e('0x15')](_0x6b5e('0x16'),_0x1d9ac5,_0x5e5e5c);_0x1c5cbb(_0x5e5e5c);});});}exports[_0x6b5e('0x1a')]=function(_0x65f553){var _0x4f6944=this;return new Promise(function(_0x1f83f0,_0x339edc){return db[_0x6b5e('0x1b')][_0x6b5e('0x1c')]({'raw':_0x65f553['options']?_0x65f553[_0x6b5e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x65f553[_0x6b5e('0x1d')]?_0x65f553[_0x6b5e('0x1d')][_0x6b5e('0x1e')]||null:null,'attributes':_0x65f553['options']?_0x65f553['options'][_0x6b5e('0x1f')]||null:null,'limit':_0x65f553[_0x6b5e('0x1d')]?_0x65f553[_0x6b5e('0x1d')]['limit']||null:null,'include':_0x65f553[_0x6b5e('0x1d')]?_0x65f553[_0x6b5e('0x1d')][_0x6b5e('0x20')]?_[_0x6b5e('0x21')](_0x65f553[_0x6b5e('0x1d')][_0x6b5e('0x20')],function(_0x400827){return{'model':db[_0x400827[_0x6b5e('0x22')]],'as':_0x400827['as'],'attributes':_0x400827[_0x6b5e('0x1f')],'include':_0x400827[_0x6b5e('0x20')]?_[_0x6b5e('0x21')](_0x400827['include'],function(_0x4a3c30){return{'model':db[_0x4a3c30['model']],'as':_0x4a3c30['as'],'attributes':_0x4a3c30[_0x6b5e('0x1f')],'include':_0x4a3c30[_0x6b5e('0x20')]?_[_0x6b5e('0x21')](_0x4a3c30[_0x6b5e('0x20')],function(_0x36dec7){return{'model':db[_0x36dec7[_0x6b5e('0x22')]],'as':_0x36dec7['as'],'attributes':_0x36dec7[_0x6b5e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6b5e('0x10')](function(_0x5471f1){logger[_0x6b5e('0x18')](_0x6b5e('0x1a'),_0x65f553);logger[_0x6b5e('0x12')](_0x6b5e('0x1a'),_0x65f553,JSON[_0x6b5e('0x14')](_0x5471f1));_0x1f83f0(_0x5471f1);})[_0x6b5e('0x23')](function(_0x5a7619){logger[_0x6b5e('0x15')](_0x6b5e('0x1a'),_0x5a7619['message'],_0x65f553);_0x339edc(_0x4f6944[_0x6b5e('0x15')](0x1f4,_0x5a7619[_0x6b5e('0x17')]));});});};exports[_0x6b5e('0x24')]=function(_0x5aaeac){var _0x9d2649=this;return new Promise(function(_0x2d8de6,_0x2efb93){return db[_0x6b5e('0x1b')][_0x6b5e('0x25')]({'raw':_0x5aaeac[_0x6b5e('0x1d')]?_0x5aaeac['options'][_0x6b5e('0x26')]===undefined?!![]:![]:!![],'where':_0x5aaeac[_0x6b5e('0x1d')]?_0x5aaeac[_0x6b5e('0x1d')][_0x6b5e('0x1e')]||null:null,'attributes':_0x5aaeac[_0x6b5e('0x1d')]?_0x5aaeac[_0x6b5e('0x1d')][_0x6b5e('0x1f')]||null:null,'include':_0x5aaeac[_0x6b5e('0x1d')]?_0x5aaeac['options'][_0x6b5e('0x20')]?_[_0x6b5e('0x21')](_0x5aaeac[_0x6b5e('0x1d')][_0x6b5e('0x20')],function(_0x5af1ad){return{'model':db[_0x5af1ad[_0x6b5e('0x22')]],'as':_0x5af1ad['as'],'attributes':_0x5af1ad[_0x6b5e('0x1f')],'include':_0x5af1ad[_0x6b5e('0x20')]?_[_0x6b5e('0x21')](_0x5af1ad[_0x6b5e('0x20')],function(_0x369129){return{'model':db[_0x369129[_0x6b5e('0x22')]],'as':_0x369129['as'],'attributes':_0x369129[_0x6b5e('0x1f')],'include':_0x369129[_0x6b5e('0x20')]?_[_0x6b5e('0x21')](_0x369129[_0x6b5e('0x20')],function(_0x5165bc){return{'model':db[_0x5165bc['model']],'as':_0x5165bc['as'],'attributes':_0x5165bc[_0x6b5e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x364733){logger[_0x6b5e('0x18')](_0x6b5e('0x24'),_0x5aaeac);logger['debug']('ShowSmsQueue',_0x5aaeac,JSON[_0x6b5e('0x14')](_0x364733));_0x2d8de6(_0x364733);})[_0x6b5e('0x23')](function(_0x3e8022){logger[_0x6b5e('0x15')](_0x6b5e('0x24'),_0x3e8022['message'],_0x5aaeac);_0x2efb93(_0x9d2649['error'](0x1f4,_0x3e8022[_0x6b5e('0x17')]));});});};
\ No newline at end of file
index fecaafd..dd234c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c63=['smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener','register'];(function(_0xcb95ba,_0x16dd5c){var _0x3867f9=function(_0x2462ee){while(--_0x2462ee){_0xcb95ba['push'](_0xcb95ba['shift']());}};_0x3867f9(++_0x16dd5c);}(_0x9c63,0x159));var _0x39c6=function(_0x59eb01,_0x487436){_0x59eb01=_0x59eb01-0x0;var _0x35941e=_0x9c63[_0x59eb01];return _0x35941e;};'use strict';var SmsQueueEvents=require(_0x39c6('0x0'));var events=[_0x39c6('0x1'),_0x39c6('0x2'),_0x39c6('0x3')];function createListener(_0x4fa320,_0x163328){return function(_0x518d85){_0x163328[_0x39c6('0x4')](_0x4fa320,_0x518d85);};}function removeListener(_0x581338,_0x4b17e6){return function(){SmsQueueEvents[_0x39c6('0x5')](_0x581338,_0x4b17e6);};}exports[_0x39c6('0x6')]=function(_0x364d48){for(var _0x179a8d=0x0,_0x55756b=events['length'];_0x179a8d<_0x55756b;_0x179a8d++){var _0x4a9cf4=events[_0x179a8d];var _0x23ad01=createListener(_0x39c6('0x7')+_0x4a9cf4,_0x364d48);SmsQueueEvents['on'](_0x4a9cf4,_0x23ad01);}};
\ No newline at end of file
+var _0x8695=['length','smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x18631f,_0x286206){var _0x59b62c=function(_0x728bf3){while(--_0x728bf3){_0x18631f['push'](_0x18631f['shift']());}};_0x59b62c(++_0x286206);}(_0x8695,0x12b));var _0x5869=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0x8695[_0x3fa7d3];return _0x4c51bd;};'use strict';var SmsQueueEvents=require(_0x5869('0x0'));var events=[_0x5869('0x1'),_0x5869('0x2'),_0x5869('0x3')];function createListener(_0x1f60de,_0x3b2410){return function(_0x2f2887){_0x3b2410[_0x5869('0x4')](_0x1f60de,_0x2f2887);};}function removeListener(_0x5d5080,_0x3d79ca){return function(){SmsQueueEvents[_0x5869('0x5')](_0x5d5080,_0x3d79ca);};}exports[_0x5869('0x6')]=function(_0x38b92e){for(var _0x3c7c09=0x0,_0x30fe3c=events[_0x5869('0x7')];_0x3c7c09<_0x30fe3c;_0x3c7c09++){var _0x232208=events[_0x3c7c09];var _0x5708f6=createListener(_0x5869('0x8')+_0x232208,_0x38b92e);SmsQueueEvents['on'](_0x232208,_0x5708f6);}};
\ No newline at end of file
index e53f8ad..e0259df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43c4=['put','delete','exports','multer','util','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x43c4,0x8b));var _0x443c=function(_0x39dd9f,_0x36b1af){_0x39dd9f=_0x39dd9f-0x0;var _0x5351e7=_0x43c4[_0x39dd9f];return _0x5351e7;};'use strict';var multer=require(_0x443c('0x0'));var util=require(_0x443c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x443c('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x443c('0x3'));var config=require(_0x443c('0x4'));var controller=require('./smsQueueReport.controller');router[_0x443c('0x5')]('/',auth[_0x443c('0x6')](),controller[_0x443c('0x7')]);router['get'](_0x443c('0x8'),auth[_0x443c('0x6')](),controller[_0x443c('0x9')]);router['get'](_0x443c('0xa'),auth[_0x443c('0x6')](),controller[_0x443c('0xb')]);router[_0x443c('0xc')]('/',auth[_0x443c('0x6')](),controller[_0x443c('0xd')]);router[_0x443c('0xe')]('/:id',auth[_0x443c('0x6')](),controller['update']);router[_0x443c('0xf')](_0x443c('0xa'),auth[_0x443c('0x6')](),controller['destroy']);module[_0x443c('0x10')]=router;
\ No newline at end of file
+var _0x6c4f=['../../config/environment','./smsQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xbc4f4,_0x415333){var _0x7c988a=function(_0x19de63){while(--_0x19de63){_0xbc4f4['push'](_0xbc4f4['shift']());}};_0x7c988a(++_0x415333);}(_0x6c4f,0x168));var _0xf6c4=function(_0x374154,_0x174ddb){_0x374154=_0x374154-0x0;var _0x275e99=_0x6c4f[_0x374154];return _0x275e99;};'use strict';var multer=require(_0xf6c4('0x0'));var util=require(_0xf6c4('0x1'));var path=require(_0xf6c4('0x2'));var timeout=require(_0xf6c4('0x3'));var express=require(_0xf6c4('0x4'));var router=express[_0xf6c4('0x5')]();var auth=require(_0xf6c4('0x6'));var interaction=require(_0xf6c4('0x7'));var config=require(_0xf6c4('0x8'));var controller=require(_0xf6c4('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf6c4('0xa')]);router[_0xf6c4('0xb')](_0xf6c4('0xc'),auth[_0xf6c4('0xd')](),controller[_0xf6c4('0xe')]);router['get'](_0xf6c4('0xf'),auth[_0xf6c4('0xd')](),controller['show']);router[_0xf6c4('0x10')]('/',auth[_0xf6c4('0xd')](),controller[_0xf6c4('0x11')]);router[_0xf6c4('0x12')](_0xf6c4('0xf'),auth[_0xf6c4('0xd')](),controller[_0xf6c4('0x13')]);router[_0xf6c4('0x14')](_0xf6c4('0xf'),auth[_0xf6c4('0xd')](),controller[_0xf6c4('0x15')]);module[_0xf6c4('0x16')]=router;
\ No newline at end of file
index e8b02be..b478790 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd4b=['DATE','moment','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfd4b,0x1f0));var _0xbfd4=function(_0x22afb6,_0x483c7c){_0x22afb6=_0x22afb6-0x0;var _0x23b7ba=_0xfd4b[_0x22afb6];return _0x23b7ba;};'use strict';var moment=require(_0xbfd4('0x0'));var Sequelize=require(_0xbfd4('0x1'));module[_0xbfd4('0x2')]={'uniqueid':{'type':Sequelize[_0xbfd4('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xbfd4('0x3')]},'joinAt':{'type':Sequelize[_0xbfd4('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbfd4('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xbfd4('0x3')]}};
\ No newline at end of file
+var _0xfca8=['DATE','moment','sequelize','exports','STRING'];(function(_0x22ae6b,_0x37caa3){var _0x5d7551=function(_0x29a18f){while(--_0x29a18f){_0x22ae6b['push'](_0x22ae6b['shift']());}};_0x5d7551(++_0x37caa3);}(_0xfca8,0x10a));var _0x8fca=function(_0x387765,_0x1eec4a){_0x387765=_0x387765-0x0;var _0x3846c6=_0xfca8[_0x387765];return _0x3846c6;};'use strict';var moment=require(_0x8fca('0x0'));var Sequelize=require(_0x8fca('0x1'));module[_0x8fca('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8fca('0x3')]},'joinAt':{'type':Sequelize[_0x8fca('0x4')]},'leaveAt':{'type':Sequelize[_0x8fca('0x4')]},'acceptAt':{'type':Sequelize[_0x8fca('0x4')]},'exitAt':{'type':Sequelize[_0x8fca('0x4')]},'reason':{'type':Sequelize[_0x8fca('0x3')]}};
\ No newline at end of file
index 0fd450c..cd9874c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','SmsQueueReport','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send'];(function(_0x5679e5,_0x4e45c9){var _0x34a94=function(_0xda168c){while(--_0xda168c){_0x5679e5['push'](_0x5679e5['shift']());}};_0x34a94(++_0x4e45c9);}(_0x814b,0x1a2));var _0xb814=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0x814b[_0x13f980];return _0x27153c;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=_[_0xb814('0x2d')](db['SmsQueueReport'][_0xb814('0x2e')],function(_0x37d24d){return{'name':_0x37d24d[_0xb814('0x2f')],'type':_0x37d24d['type'][_0xb814('0x30')]};});_0x1e4e89[_0xb814('0x31')]=_['map'](_0x271aa8,_0xb814('0x2a'));_0x1e4e89['query']=_[_0xb814('0x32')](_0x32ed56['query']);_0x1e4e89['filters']=_[_0xb814('0x33')](_0x1e4e89['model'],_0x1e4e89[_0xb814('0x34')]);_0x3f0150[_0xb814('0x35')]=_[_0xb814('0x33')](_0x1e4e89['model'],qs['fields'](_0x32ed56[_0xb814('0x34')][_0xb814('0x36')]));_0x3f0150['attributes']=_0x3f0150[_0xb814('0x35')][_0xb814('0x37')]?_0x3f0150[_0xb814('0x35')]:_0x1e4e89[_0xb814('0x31')];if(!_0x32ed56[_0xb814('0x34')][_0xb814('0x38')](_0xb814('0x39'))){_0x3f0150['limit']=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x34')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150['order']=qs[_0xb814('0x3a')](_0x32ed56[_0xb814('0x34')][_0xb814('0x3a')]);_0x3f0150['where']=qs[_0xb814('0x3b')](_[_0xb814('0x3c')](_0x32ed56['query'],_0x1e4e89[_0xb814('0x3b')]),_0x271aa8);if(_0x32ed56[_0xb814('0x34')][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=_[_0xb814('0x3f')](_0x3f0150[_0xb814('0x3e')],{'$or':_['map'](_0x271aa8,function(_0xa6ce87){if(_0xa6ce87['type']!==_0xb814('0x40')){var _0x4b5583={};_0x4b5583[_0xa6ce87[_0xb814('0x2a')]]={'$like':'%'+_0x32ed56['query'][_0xb814('0x3d')]+'%'};return _0x4b5583;}})});}_0x3f0150=_[_0xb814('0x3f')]({},_0x3f0150,_0x32ed56['options']);var _0x4d308a={'where':_0x3f0150['where']};return db['SmsQueueReport'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xb814('0x42')](_0x3f0150);})[_0xb814('0x27')](function(_0x178823){_0x5a6291[_0xb814('0x43')]=_0x178823;return _0x5a6291;})[_0xb814('0x27')](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x44')](handleError(_0x1d5965,null));};exports[_0xb814('0x45')]=function(_0x28b2b4,_0x31989d){var _0x4b6ff8={'raw':!![],'where':{'id':_0x28b2b4['params']['id']}},_0x544d36={};_0x544d36[_0xb814('0x31')]=_['keys'](db[_0xb814('0x46')]['rawAttributes']);_0x544d36[_0xb814('0x34')]=_[_0xb814('0x32')](_0x28b2b4[_0xb814('0x34')]);_0x544d36[_0xb814('0x3b')]=_['intersection'](_0x544d36[_0xb814('0x31')],_0x544d36[_0xb814('0x34')]);_0x4b6ff8[_0xb814('0x35')]=_[_0xb814('0x33')](_0x544d36[_0xb814('0x31')],qs[_0xb814('0x36')](_0x28b2b4['query'][_0xb814('0x36')]));_0x4b6ff8[_0xb814('0x35')]=_0x4b6ff8[_0xb814('0x35')][_0xb814('0x37')]?_0x4b6ff8[_0xb814('0x35')]:_0x544d36[_0xb814('0x31')];if(_0x28b2b4[_0xb814('0x34')]['includeAll']){_0x4b6ff8['include']=[{'all':!![]}];}_0x4b6ff8=_[_0xb814('0x3f')]({},_0x4b6ff8,_0x28b2b4[_0xb814('0x47')]);return db[_0xb814('0x46')][_0xb814('0x48')](_0x4b6ff8)[_0xb814('0x27')](handleEntityNotFound(_0x31989d,null))[_0xb814('0x27')](respondWithResult(_0x31989d,null))[_0xb814('0x44')](handleError(_0x31989d,null));};exports[_0xb814('0x49')]=function(_0x2eb9b6,_0x344198){return db[_0xb814('0x46')]['create'](_0x2eb9b6[_0xb814('0x4a')],{})[_0xb814('0x27')](respondWithResult(_0x344198,0xc9))['catch'](handleError(_0x344198,null));};exports[_0xb814('0x25')]=function(_0x55234d,_0x2fb0f7){if(_0x55234d[_0xb814('0x4a')]['id']){delete _0x55234d[_0xb814('0x4a')]['id'];}return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x55234d[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x2fb0f7,null))[_0xb814('0x27')](saveUpdates(_0x55234d[_0xb814('0x4a')],null))[_0xb814('0x27')](respondWithResult(_0x2fb0f7,null))['catch'](handleError(_0x2fb0f7,null));};exports['destroy']=function(_0x32eca6,_0x30f07b){return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x32eca6[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x30f07b,null))[_0xb814('0x27')](removeEntity(_0x30f07b,null))['catch'](handleError(_0x30f07b,null));};exports[_0xb814('0x4c')]=function(_0x388324,_0xf27a6e){return db['SmsQueueReport'][_0xb814('0x4c')]()['then'](respondWithResult(_0xf27a6e,null))[_0xb814('0x44')](handleError(_0xf27a6e,null));};
\ No newline at end of file
+var _0x814b=['index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','SmsQueueReport','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send'];(function(_0x14d4d5,_0x3c298e){var _0x516cf5=function(_0x10a2f6){while(--_0x10a2f6){_0x14d4d5['push'](_0x14d4d5['shift']());}};_0x516cf5(++_0x3c298e);}(_0x814b,0x1a2));var _0xb814=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0x814b[_0x5180c3];return _0x55c975;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=_[_0xb814('0x2d')](db['SmsQueueReport'][_0xb814('0x2e')],function(_0x37d24d){return{'name':_0x37d24d[_0xb814('0x2f')],'type':_0x37d24d['type'][_0xb814('0x30')]};});_0x1e4e89[_0xb814('0x31')]=_['map'](_0x271aa8,_0xb814('0x2a'));_0x1e4e89['query']=_[_0xb814('0x32')](_0x32ed56['query']);_0x1e4e89['filters']=_[_0xb814('0x33')](_0x1e4e89['model'],_0x1e4e89[_0xb814('0x34')]);_0x3f0150[_0xb814('0x35')]=_[_0xb814('0x33')](_0x1e4e89['model'],qs['fields'](_0x32ed56[_0xb814('0x34')][_0xb814('0x36')]));_0x3f0150['attributes']=_0x3f0150[_0xb814('0x35')][_0xb814('0x37')]?_0x3f0150[_0xb814('0x35')]:_0x1e4e89[_0xb814('0x31')];if(!_0x32ed56[_0xb814('0x34')][_0xb814('0x38')](_0xb814('0x39'))){_0x3f0150['limit']=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x34')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150['order']=qs[_0xb814('0x3a')](_0x32ed56[_0xb814('0x34')][_0xb814('0x3a')]);_0x3f0150['where']=qs[_0xb814('0x3b')](_[_0xb814('0x3c')](_0x32ed56['query'],_0x1e4e89[_0xb814('0x3b')]),_0x271aa8);if(_0x32ed56[_0xb814('0x34')][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=_[_0xb814('0x3f')](_0x3f0150[_0xb814('0x3e')],{'$or':_['map'](_0x271aa8,function(_0xa6ce87){if(_0xa6ce87['type']!==_0xb814('0x40')){var _0x4b5583={};_0x4b5583[_0xa6ce87[_0xb814('0x2a')]]={'$like':'%'+_0x32ed56['query'][_0xb814('0x3d')]+'%'};return _0x4b5583;}})});}_0x3f0150=_[_0xb814('0x3f')]({},_0x3f0150,_0x32ed56['options']);var _0x4d308a={'where':_0x3f0150['where']};return db['SmsQueueReport'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xb814('0x42')](_0x3f0150);})[_0xb814('0x27')](function(_0x178823){_0x5a6291[_0xb814('0x43')]=_0x178823;return _0x5a6291;})[_0xb814('0x27')](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x44')](handleError(_0x1d5965,null));};exports[_0xb814('0x45')]=function(_0x28b2b4,_0x31989d){var _0x4b6ff8={'raw':!![],'where':{'id':_0x28b2b4['params']['id']}},_0x544d36={};_0x544d36[_0xb814('0x31')]=_['keys'](db[_0xb814('0x46')]['rawAttributes']);_0x544d36[_0xb814('0x34')]=_[_0xb814('0x32')](_0x28b2b4[_0xb814('0x34')]);_0x544d36[_0xb814('0x3b')]=_['intersection'](_0x544d36[_0xb814('0x31')],_0x544d36[_0xb814('0x34')]);_0x4b6ff8[_0xb814('0x35')]=_[_0xb814('0x33')](_0x544d36[_0xb814('0x31')],qs[_0xb814('0x36')](_0x28b2b4['query'][_0xb814('0x36')]));_0x4b6ff8[_0xb814('0x35')]=_0x4b6ff8[_0xb814('0x35')][_0xb814('0x37')]?_0x4b6ff8[_0xb814('0x35')]:_0x544d36[_0xb814('0x31')];if(_0x28b2b4[_0xb814('0x34')]['includeAll']){_0x4b6ff8['include']=[{'all':!![]}];}_0x4b6ff8=_[_0xb814('0x3f')]({},_0x4b6ff8,_0x28b2b4[_0xb814('0x47')]);return db[_0xb814('0x46')][_0xb814('0x48')](_0x4b6ff8)[_0xb814('0x27')](handleEntityNotFound(_0x31989d,null))[_0xb814('0x27')](respondWithResult(_0x31989d,null))[_0xb814('0x44')](handleError(_0x31989d,null));};exports[_0xb814('0x49')]=function(_0x2eb9b6,_0x344198){return db[_0xb814('0x46')]['create'](_0x2eb9b6[_0xb814('0x4a')],{})[_0xb814('0x27')](respondWithResult(_0x344198,0xc9))['catch'](handleError(_0x344198,null));};exports[_0xb814('0x25')]=function(_0x55234d,_0x2fb0f7){if(_0x55234d[_0xb814('0x4a')]['id']){delete _0x55234d[_0xb814('0x4a')]['id'];}return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x55234d[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x2fb0f7,null))[_0xb814('0x27')](saveUpdates(_0x55234d[_0xb814('0x4a')],null))[_0xb814('0x27')](respondWithResult(_0x2fb0f7,null))['catch'](handleError(_0x2fb0f7,null));};exports['destroy']=function(_0x32eca6,_0x30f07b){return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x32eca6[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x30f07b,null))[_0xb814('0x27')](removeEntity(_0x30f07b,null))['catch'](handleError(_0x30f07b,null));};exports[_0xb814('0x4c')]=function(_0x388324,_0xf27a6e){return db['SmsQueueReport'][_0xb814('0x4c')]()['then'](respondWithResult(_0xf27a6e,null))[_0xb814('0x44')](handleError(_0xf27a6e,null));};
\ No newline at end of file
index e15bf6b..10153e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe103=['report_sms_queue','uniqueid','util','../../config/logger','bluebird','path','../../config/environment','./smsQueueReport.attributes','exports','SmsQueueReport'];(function(_0x1e3c02,_0x5c07a2){var _0x4d26d7=function(_0x367ed9){while(--_0x367ed9){_0x1e3c02['push'](_0x1e3c02['shift']());}};_0x4d26d7(++_0x5c07a2);}(_0xe103,0x1ce));var _0x3e10=function(_0x26adcb,_0x516ac9){_0x26adcb=_0x26adcb-0x0;var _0x4ab9cc=_0xe103[_0x26adcb];return _0x4ab9cc;};'use strict';var _=require('lodash');var util=require(_0x3e10('0x0'));var logger=require(_0x3e10('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3e10('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e10('0x3'));var rimraf=require('rimraf');var config=require(_0x3e10('0x4'));var attributes=require(_0x3e10('0x5'));module[_0x3e10('0x6')]=function(_0x41806c,_0x166a7e){return _0x41806c['define'](_0x3e10('0x7'),attributes,{'tableName':_0x3e10('0x8'),'paranoid':![],'indexes':[{'name':_0x3e10('0x9'),'fields':[_0x3e10('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa03c=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1b9bb3,_0x314e5d){var _0x52f37e=function(_0x2282f4){while(--_0x2282f4){_0x1b9bb3['push'](_0x1b9bb3['shift']());}};_0x52f37e(++_0x314e5d);}(_0xa03c,0xeb));var _0xca03=function(_0x31543a,_0x41b33d){_0x31543a=_0x31543a-0x0;var _0x468934=_0xa03c[_0x31543a];return _0x468934;};'use strict';var _=require(_0xca03('0x0'));var util=require(_0xca03('0x1'));var logger=require(_0xca03('0x2'))(_0xca03('0x3'));var moment=require(_0xca03('0x4'));var BPromise=require(_0xca03('0x5'));var rp=require(_0xca03('0x6'));var fs=require('fs');var path=require(_0xca03('0x7'));var rimraf=require(_0xca03('0x8'));var config=require(_0xca03('0x9'));var attributes=require('./smsQueueReport.attributes');module[_0xca03('0xa')]=function(_0xeff83e,_0x3f5072){return _0xeff83e[_0xca03('0xb')](_0xca03('0xc'),attributes,{'tableName':_0xca03('0xd'),'paranoid':![],'indexes':[{'name':_0xca03('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index e9d4534..4314acb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9756=['options','then','debug','UpdateSmsQueueReport','update','raw','where','attributes','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','request','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport'];(function(_0x10ad13,_0x397757){var _0x2f4298=function(_0xffe3d4){while(--_0xffe3d4){_0x10ad13['push'](_0x10ad13['shift']());}};_0x2f4298(++_0x397757);}(_0x9756,0x190));var _0x6975=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x9756[_0x1203f];return _0x365f0a;};'use strict';var _=require('lodash');var util=require(_0x6975('0x0'));var moment=require(_0x6975('0x1'));var BPromise=require(_0x6975('0x2'));var rs=require(_0x6975('0x3'));var fs=require('fs');var Redis=require(_0x6975('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6975('0x5'))('rpc');var config=require(_0x6975('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6975('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49c0f1,_0x3f3012,_0x5dec50){return new BPromise(function(_0x4349cb,_0x1ac002){return client[_0x6975('0x8')](_0x49c0f1,_0x5dec50)['then'](function(_0x2631c5){logger[_0x6975('0x9')](_0x6975('0xa'),_0x3f3012,'request\x20sent');logger['debug'](_0x6975('0xb'),_0x3f3012,_0x6975('0xc'),JSON[_0x6975('0xd')](_0x2631c5));if(_0x2631c5[_0x6975('0xe')]){if(_0x2631c5['error'][_0x6975('0xf')]===0x1f4){logger[_0x6975('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x3f3012,_0x2631c5[_0x6975('0xe')][_0x6975('0x10')]);return _0x1ac002(_0x2631c5[_0x6975('0xe')][_0x6975('0x10')]);}logger[_0x6975('0xe')](_0x6975('0xa'),_0x3f3012,_0x2631c5[_0x6975('0xe')][_0x6975('0x10')]);return _0x4349cb(_0x2631c5['error'][_0x6975('0x10')]);}else{logger[_0x6975('0x9')](_0x6975('0xa'),_0x3f3012,'request\x20sent');_0x4349cb(_0x2631c5[_0x6975('0x11')][_0x6975('0x10')]);}})['catch'](function(_0x385b3c){logger[_0x6975('0xe')](_0x6975('0xa'),_0x3f3012,_0x385b3c);_0x1ac002(_0x385b3c);});});}exports[_0x6975('0x12')]=function(_0x45c14b){var _0x4a8181=this;return new Promise(function(_0xf3244b,_0x2b928e){return db[_0x6975('0x13')]['create'](_0x45c14b['body'],{'raw':_0x45c14b[_0x6975('0x14')]?_0x45c14b[_0x6975('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x6975('0x15')](function(_0x40f05f){logger[_0x6975('0x9')]('CreateSmsQueueReport',_0x45c14b);logger[_0x6975('0x16')]('CreateSmsQueueReport',_0x45c14b,JSON['stringify'](_0x40f05f));_0xf3244b(_0x40f05f);})['catch'](function(_0x1dc6c4){logger['error']('CreateSmsQueueReport',_0x1dc6c4[_0x6975('0x10')],_0x45c14b);_0x2b928e(_0x4a8181[_0x6975('0xe')](0x1f4,_0x1dc6c4[_0x6975('0x10')]));});});};exports[_0x6975('0x17')]=function(_0x262caf){var _0x33e191=this;return new Promise(function(_0x45fb4c,_0x26fecd){return db[_0x6975('0x13')][_0x6975('0x18')](_0x262caf['body'],{'raw':_0x262caf[_0x6975('0x14')]?_0x262caf[_0x6975('0x14')][_0x6975('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x262caf['options']?_0x262caf[_0x6975('0x14')][_0x6975('0x1a')]||null:null,'attributes':_0x262caf[_0x6975('0x14')]?_0x262caf[_0x6975('0x14')][_0x6975('0x1b')]||null:null,'limit':_0x262caf[_0x6975('0x14')]?_0x262caf[_0x6975('0x14')]['limit']||null:null})[_0x6975('0x15')](function(_0x527ea9){logger['info'](_0x6975('0x17'),_0x262caf);logger['debug']('UpdateSmsQueueReport',_0x262caf,JSON[_0x6975('0xd')](_0x527ea9));_0x45fb4c(_0x527ea9);})['catch'](function(_0x455b59){logger['error'](_0x6975('0x17'),_0x455b59['message'],_0x262caf);_0x26fecd(_0x33e191['error'](0x1f4,_0x455b59[_0x6975('0x10')]));});});};
\ No newline at end of file
+var _0x397f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','CreateSmsQueueReport','SmsQueueReport','create','options','raw','catch','UpdateSmsQueueReport','update','where','attributes','limit'];(function(_0x85fdbc,_0x31d350){var _0x6e4308=function(_0xda48ef){while(--_0xda48ef){_0x85fdbc['push'](_0x85fdbc['shift']());}};_0x6e4308(++_0x31d350);}(_0x397f,0xc0));var _0xf397=function(_0x17c579,_0x1968f3){_0x17c579=_0x17c579-0x0;var _0xe506d7=_0x397f[_0x17c579];return _0xe506d7;};'use strict';var _=require(_0xf397('0x0'));var util=require(_0xf397('0x1'));var moment=require(_0xf397('0x2'));var BPromise=require(_0xf397('0x3'));var rs=require(_0xf397('0x4'));var fs=require('fs');var Redis=require(_0xf397('0x5'));var db=require(_0xf397('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf397('0x7'));var config=require('../../config/environment');var jayson=require(_0xf397('0x8'));var client=jayson[_0xf397('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x352c6f,_0x558959,_0x17150f){return new BPromise(function(_0x379faf,_0x443538){return client['request'](_0x352c6f,_0x17150f)[_0xf397('0xa')](function(_0x8c1174){logger[_0xf397('0xb')](_0xf397('0xc'),_0x558959,'request\x20sent');logger[_0xf397('0xd')](_0xf397('0xe'),_0x558959,_0xf397('0xf'),JSON[_0xf397('0x10')](_0x8c1174));if(_0x8c1174['error']){if(_0x8c1174['error'][_0xf397('0x11')]===0x1f4){logger[_0xf397('0x12')](_0xf397('0xc'),_0x558959,_0x8c1174[_0xf397('0x12')][_0xf397('0x13')]);return _0x443538(_0x8c1174[_0xf397('0x12')][_0xf397('0x13')]);}logger['error'](_0xf397('0xc'),_0x558959,_0x8c1174[_0xf397('0x12')][_0xf397('0x13')]);return _0x379faf(_0x8c1174[_0xf397('0x12')][_0xf397('0x13')]);}else{logger[_0xf397('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x558959,_0xf397('0xf'));_0x379faf(_0x8c1174[_0xf397('0x14')][_0xf397('0x13')]);}})['catch'](function(_0x215cd0){logger['error'](_0xf397('0xc'),_0x558959,_0x215cd0);_0x443538(_0x215cd0);});});}exports[_0xf397('0x15')]=function(_0x16b56a){var _0x473d0f=this;return new Promise(function(_0x3a1bd0,_0x1610fe){return db[_0xf397('0x16')][_0xf397('0x17')](_0x16b56a['body'],{'raw':_0x16b56a[_0xf397('0x18')]?_0x16b56a[_0xf397('0x18')][_0xf397('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x336ccb){logger[_0xf397('0xb')](_0xf397('0x15'),_0x16b56a);logger[_0xf397('0xd')](_0xf397('0x15'),_0x16b56a,JSON[_0xf397('0x10')](_0x336ccb));_0x3a1bd0(_0x336ccb);})[_0xf397('0x1a')](function(_0x38f140){logger['error']('CreateSmsQueueReport',_0x38f140[_0xf397('0x13')],_0x16b56a);_0x1610fe(_0x473d0f[_0xf397('0x12')](0x1f4,_0x38f140['message']));});});};exports[_0xf397('0x1b')]=function(_0x537dca){var _0xc805b=this;return new Promise(function(_0x5ea81e,_0xb6b3b1){return db['SmsQueueReport'][_0xf397('0x1c')](_0x537dca['body'],{'raw':_0x537dca[_0xf397('0x18')]?_0x537dca['options'][_0xf397('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x537dca['options']?_0x537dca[_0xf397('0x18')][_0xf397('0x1d')]||null:null,'attributes':_0x537dca[_0xf397('0x18')]?_0x537dca[_0xf397('0x18')][_0xf397('0x1e')]||null:null,'limit':_0x537dca[_0xf397('0x18')]?_0x537dca[_0xf397('0x18')][_0xf397('0x1f')]||null:null})[_0xf397('0xa')](function(_0x5d5f72){logger['info'](_0xf397('0x1b'),_0x537dca);logger[_0xf397('0xd')](_0xf397('0x1b'),_0x537dca,JSON['stringify'](_0x5d5f72));_0x5ea81e(_0x5d5f72);})[_0xf397('0x1a')](function(_0x3707e8){logger['error'](_0xf397('0x1b'),_0x3707e8['message'],_0x537dca);_0xb6b3b1(_0xc805b[_0xf397('0x12')](0x1f4,_0x3707e8['message']));});});};
\ No newline at end of file
index 03dc9d0..a4623bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['./smsTransferReport.controller','get','index','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1f9a8e,_0x435967){var _0x3bd851=function(_0x246d27){while(--_0x246d27){_0x1f9a8e['push'](_0x1f9a8e['shift']());}};_0x3bd851(++_0x435967);}(_0x4fc2,0x111));var _0x24fc=function(_0x334e39,_0x16f47f){_0x334e39=_0x334e39-0x0;var _0x158b6c=_0x4fc2[_0x334e39];return _0x158b6c;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var auth=require(_0x24fc('0x5'));var interaction=require(_0x24fc('0x6'));var config=require('../../config/environment');var controller=require(_0x24fc('0x7'));router[_0x24fc('0x8')]('/',auth['isAuthenticated'](),controller[_0x24fc('0x9')]);router[_0x24fc('0x8')]('/describe',auth[_0x24fc('0xa')](),controller[_0x24fc('0xb')]);router[_0x24fc('0x8')](_0x24fc('0xc'),auth[_0x24fc('0xa')](),controller[_0x24fc('0xd')]);router['post']('/',auth[_0x24fc('0xa')](),controller[_0x24fc('0xe')]);router[_0x24fc('0xf')](_0x24fc('0xc'),auth[_0x24fc('0xa')](),controller[_0x24fc('0x10')]);router[_0x24fc('0x11')](_0x24fc('0xc'),auth['isAuthenticated'](),controller[_0x24fc('0x12')]);module[_0x24fc('0x13')]=router;
\ No newline at end of file
+var _0x0abf=['get','isAuthenticated','index','/describe','describe','/:id','post','create','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0abf,0xe8));var _0xf0ab=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0abf[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0xf0ab('0x0'));var util=require('util');var path=require(_0xf0ab('0x1'));var timeout=require(_0xf0ab('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xf0ab('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf0ab('0x4'));var controller=require(_0xf0ab('0x5'));router[_0xf0ab('0x6')]('/',auth[_0xf0ab('0x7')](),controller[_0xf0ab('0x8')]);router[_0xf0ab('0x6')](_0xf0ab('0x9'),auth['isAuthenticated'](),controller[_0xf0ab('0xa')]);router[_0xf0ab('0x6')](_0xf0ab('0xb'),auth[_0xf0ab('0x7')](),controller['show']);router[_0xf0ab('0xc')]('/',auth[_0xf0ab('0x7')](),controller[_0xf0ab('0xd')]);router['put']('/:id',auth[_0xf0ab('0x7')](),controller['update']);router[_0xf0ab('0xe')](_0xf0ab('0xb'),auth[_0xf0ab('0x7')](),controller[_0xf0ab('0xf')]);module[_0xf0ab('0x10')]=router;
\ No newline at end of file
index a099893..865c007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7c3=['agent','DATE','sequelize','exports','STRING'];(function(_0x37d2c3,_0x2ef0cd){var _0x2583f1=function(_0x5d40c5){while(--_0x5d40c5){_0x37d2c3['push'](_0x37d2c3['shift']());}};_0x2583f1(++_0x2ef0cd);}(_0xc7c3,0xcf));var _0x3c7c=function(_0x26736e,_0x4abc98){_0x26736e=_0x26736e-0x0;var _0x3746e2=_0xc7c3[_0x26736e];return _0x3746e2;};'use strict';var moment=require('moment');var Sequelize=require(_0x3c7c('0x0'));module[_0x3c7c('0x1')]={'uniqueid':{'type':Sequelize[_0x3c7c('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x3c7c('0x3'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x3c7c('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xb1f4=['queue','NOW','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb1f4,0x122));var _0x4b1f=function(_0x169da7,_0x54bf47){_0x169da7=_0x169da7-0x0;var _0x5a87ca=_0xb1f4[_0x169da7];return _0x5a87ca;};'use strict';var moment=require(_0x4b1f('0x0'));var Sequelize=require(_0x4b1f('0x1'));module[_0x4b1f('0x2')]={'uniqueid':{'type':Sequelize[_0x4b1f('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4b1f('0x4')](_0x4b1f('0x5'),'agent',_0x4b1f('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x4b1f('0x7')]}};
\ No newline at end of file
index b69cd09..b8c6931 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','findAll','catch','show','params','includeAll','include','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x5c1dbe,_0x1e32d9){var _0x5c037d=function(_0x24784d){while(--_0x24784d){_0x5c1dbe['push'](_0x5c1dbe['shift']());}};_0x5c037d(++_0x1e32d9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];function respondWithStatusCode(_0xa0c1,_0x4a8cc7){_0x4a8cc7=_0x4a8cc7||0xcc;return function(_0x5330a8){if(_0x5330a8){return _0xa0c1[_0x3071('0x1a')](_0x4a8cc7);}return _0xa0c1['status'](_0x4a8cc7)[_0x3071('0x1b')]();};}function respondWithResult(_0x44fbae,_0x5d4883){_0x5d4883=_0x5d4883||0xc8;return function(_0x104e73){if(_0x104e73){return _0x44fbae['status'](_0x5d4883)[_0x3071('0x1c')](_0x104e73);}};}function respondWithFilteredResult(_0x45c93b,_0x1271d0){return function(_0x1f14e1){if(_0x1f14e1){var _0x1caa5d=_0x1f14e1[_0x3071('0x1d')],_0x2a6a4b=_0x1271d0[_0x3071('0x1e')],_0x157a47=_0x1271d0['offset']+_0x1271d0[_0x3071('0x1f')],_0x11bdc9;if(_0x157a47>=_0x1caa5d){_0x157a47=_0x1caa5d;_0x11bdc9=0xc8;}else{_0x11bdc9=0xce;}_0x45c93b[_0x3071('0x20')](_0x11bdc9);return _0x45c93b[_0x3071('0x21')](_0x3071('0x22'),_0x2a6a4b+'-'+_0x157a47+'/'+_0x1caa5d)[_0x3071('0x1c')](_0x1f14e1);}return null;};}function patchUpdates(_0x17aee2){return function(_0x105bbb){try{jsonpatch[_0x3071('0x23')](_0x105bbb,_0x17aee2,!![]);}catch(_0x502a16){return BPromise[_0x3071('0x24')](_0x502a16);}return _0x105bbb[_0x3071('0x25')]();};}function saveUpdates(_0xd3e23d,_0x56c267){return function(_0xb8f4e3){if(_0xb8f4e3){return _0xb8f4e3['update'](_0xd3e23d)[_0x3071('0x26')](function(_0x43128c){return _0x43128c;});}return null;};}function removeEntity(_0x3762d8,_0x457b57){return function(_0x33090c){if(_0x33090c){return _0x33090c[_0x3071('0x27')]()[_0x3071('0x26')](function(){_0x3762d8[_0x3071('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(!_0xb05b1d){_0x481a51[_0x3071('0x1a')](0x194);}return _0xb05b1d;};}function handleError(_0x13df9f,_0x2793ef){_0x2793ef=_0x2793ef||0x1f4;return function(_0x44b45f){logger[_0x3071('0x28')](_0x44b45f[_0x3071('0x29')]);if(_0x44b45f[_0x3071('0x2a')]){delete _0x44b45f['name'];}_0x13df9f[_0x3071('0x20')](_0x2793ef)[_0x3071('0x2b')](_0x44b45f);};}exports[_0x3071('0x2c')]=function(_0x4d5c4b,_0x4fb1ca){var _0x28792d={},_0x163604={},_0x950fde={'count':0x0,'rows':[]};var _0x3fa3b8=_[_0x3071('0x2d')](db[_0x3071('0x2e')][_0x3071('0x2f')],function(_0x32f1b4){return{'name':_0x32f1b4[_0x3071('0x30')],'type':_0x32f1b4[_0x3071('0x31')]['key']};});_0x163604['model']=_[_0x3071('0x2d')](_0x3fa3b8,_0x3071('0x2a'));_0x163604[_0x3071('0x32')]=_[_0x3071('0x33')](_0x4d5c4b[_0x3071('0x32')]);_0x163604[_0x3071('0x34')]=_[_0x3071('0x35')](_0x163604[_0x3071('0x36')],_0x163604['query']);_0x28792d['attributes']=_['intersection'](_0x163604[_0x3071('0x36')],qs[_0x3071('0x37')](_0x4d5c4b['query'][_0x3071('0x37')]));_0x28792d[_0x3071('0x38')]=_0x28792d[_0x3071('0x38')][_0x3071('0x39')]?_0x28792d['attributes']:_0x163604[_0x3071('0x36')];if(!_0x4d5c4b[_0x3071('0x32')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x28792d[_0x3071('0x1f')]=qs[_0x3071('0x1f')](_0x4d5c4b[_0x3071('0x32')][_0x3071('0x1f')]);_0x28792d['offset']=qs[_0x3071('0x1e')](_0x4d5c4b['query']['offset']);}_0x28792d[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x4d5c4b['query'][_0x3071('0x3d')]);_0x28792d[_0x3071('0x3e')]=qs[_0x3071('0x34')](_[_0x3071('0x3f')](_0x4d5c4b[_0x3071('0x32')],_0x163604[_0x3071('0x34')]),_0x3fa3b8);if(_0x4d5c4b['query'][_0x3071('0x40')]){_0x28792d[_0x3071('0x3e')]=_['merge'](_0x28792d[_0x3071('0x3e')],{'$or':_['map'](_0x3fa3b8,function(_0x28f855){if(_0x28f855[_0x3071('0x31')]!=='VIRTUAL'){var _0x593c99={};_0x593c99[_0x28f855[_0x3071('0x2a')]]={'$like':'%'+_0x4d5c4b[_0x3071('0x32')][_0x3071('0x40')]+'%'};return _0x593c99;}})});}_0x28792d=_['merge']({},_0x28792d,_0x4d5c4b[_0x3071('0x41')]);var _0x534a77={'where':_0x28792d[_0x3071('0x3e')]};return db['SmsTransferReport'][_0x3071('0x1d')](_0x534a77)[_0x3071('0x26')](function(_0x1fcc52){_0x950fde[_0x3071('0x1d')]=_0x1fcc52;if(_0x4d5c4b[_0x3071('0x32')]['includeAll']){_0x28792d['include']=[{'all':!![]}];}return db[_0x3071('0x2e')][_0x3071('0x42')](_0x28792d);})[_0x3071('0x26')](function(_0x1f69a6){_0x950fde['rows']=_0x1f69a6;return _0x950fde;})[_0x3071('0x26')](respondWithFilteredResult(_0x4fb1ca,_0x28792d))[_0x3071('0x43')](handleError(_0x4fb1ca,null));};exports[_0x3071('0x44')]=function(_0x25c29f,_0x277104){var _0xb9a4b8={'raw':!![],'where':{'id':_0x25c29f[_0x3071('0x45')]['id']}},_0x56a9d8={};_0x56a9d8['model']=_['keys'](db['SmsTransferReport']['rawAttributes']);_0x56a9d8[_0x3071('0x32')]=_[_0x3071('0x33')](_0x25c29f[_0x3071('0x32')]);_0x56a9d8[_0x3071('0x34')]=_[_0x3071('0x35')](_0x56a9d8[_0x3071('0x36')],_0x56a9d8[_0x3071('0x32')]);_0xb9a4b8[_0x3071('0x38')]=_['intersection'](_0x56a9d8[_0x3071('0x36')],qs[_0x3071('0x37')](_0x25c29f[_0x3071('0x32')][_0x3071('0x37')]));_0xb9a4b8[_0x3071('0x38')]=_0xb9a4b8['attributes']['length']?_0xb9a4b8[_0x3071('0x38')]:_0x56a9d8[_0x3071('0x36')];if(_0x25c29f[_0x3071('0x32')][_0x3071('0x46')]){_0xb9a4b8[_0x3071('0x47')]=[{'all':!![]}];}_0xb9a4b8=_['merge']({},_0xb9a4b8,_0x25c29f[_0x3071('0x41')]);return db['SmsTransferReport'][_0x3071('0x48')](_0xb9a4b8)['then'](handleEntityNotFound(_0x277104,null))['then'](respondWithResult(_0x277104,null))[_0x3071('0x43')](handleError(_0x277104,null));};exports['create']=function(_0x1862ea,_0x5a0a69){return db[_0x3071('0x2e')][_0x3071('0x49')](_0x1862ea[_0x3071('0x4a')],{})[_0x3071('0x26')](respondWithResult(_0x5a0a69,0xc9))['catch'](handleError(_0x5a0a69,null));};exports[_0x3071('0x4b')]=function(_0x575c12,_0xd273ec){if(_0x575c12['body']['id']){delete _0x575c12[_0x3071('0x4a')]['id'];}return db[_0x3071('0x2e')]['find']({'where':{'id':_0x575c12[_0x3071('0x45')]['id']}})[_0x3071('0x26')](handleEntityNotFound(_0xd273ec,null))[_0x3071('0x26')](saveUpdates(_0x575c12[_0x3071('0x4a')],null))[_0x3071('0x26')](respondWithResult(_0xd273ec,null))[_0x3071('0x43')](handleError(_0xd273ec,null));};exports[_0x3071('0x27')]=function(_0x577060,_0x2c6e4c){return db[_0x3071('0x2e')][_0x3071('0x48')]({'where':{'id':_0x577060[_0x3071('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c6e4c,null))[_0x3071('0x26')](removeEntity(_0x2c6e4c,null))[_0x3071('0x43')](handleError(_0x2c6e4c,null));};exports[_0x3071('0x4c')]=function(_0x2307dd,_0x22aade){return db[_0x3071('0x2e')][_0x3071('0x4c')]()[_0x3071('0x26')](respondWithResult(_0x22aade,null))[_0x3071('0x43')](handleError(_0x22aade,null));};
\ No newline at end of file
+var _0xd8b0=['intersection','fields','attributes','length','model','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','SmsTransferReport','count','includeAll','include','findAll','catch','show','params','options','create','body','find','destroy','describe','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys'];(function(_0x26139d,_0x12206b){var _0x1bd4a9=function(_0x9f4228){while(--_0x9f4228){_0x26139d['push'](_0x26139d['shift']());}};_0x1bd4a9(++_0x12206b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];function respondWithStatusCode(_0x340cc4,_0x92cdd8){_0x92cdd8=_0x92cdd8||0xcc;return function(_0x35a07b){if(_0x35a07b){return _0x340cc4[_0x0d8b('0x16')](_0x92cdd8);}return _0x340cc4[_0x0d8b('0x17')](_0x92cdd8)[_0x0d8b('0x18')]();};}function respondWithResult(_0x1d4bbc,_0x2ce75e){_0x2ce75e=_0x2ce75e||0xc8;return function(_0x5ad086){if(_0x5ad086){return _0x1d4bbc[_0x0d8b('0x17')](_0x2ce75e)[_0x0d8b('0x19')](_0x5ad086);}};}function respondWithFilteredResult(_0x2d4e1c,_0x4f6f21){return function(_0x23eb7b){if(_0x23eb7b){var _0xa86349=_0x23eb7b['count'],_0x17f7df=_0x4f6f21[_0x0d8b('0x1a')],_0xe2e167=_0x4f6f21[_0x0d8b('0x1a')]+_0x4f6f21[_0x0d8b('0x1b')],_0x2cb03c;if(_0xe2e167>=_0xa86349){_0xe2e167=_0xa86349;_0x2cb03c=0xc8;}else{_0x2cb03c=0xce;}_0x2d4e1c[_0x0d8b('0x17')](_0x2cb03c);return _0x2d4e1c[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x17f7df+'-'+_0xe2e167+'/'+_0xa86349)[_0x0d8b('0x19')](_0x23eb7b);}return null;};}function patchUpdates(_0xa3612a){return function(_0x4a15bf){try{jsonpatch[_0x0d8b('0x1e')](_0x4a15bf,_0xa3612a,!![]);}catch(_0x23d58f){return BPromise[_0x0d8b('0x1f')](_0x23d58f);}return _0x4a15bf[_0x0d8b('0x20')]();};}function saveUpdates(_0x24e8ed,_0x5b709c){return function(_0x393beb){if(_0x393beb){return _0x393beb[_0x0d8b('0x21')](_0x24e8ed)['then'](function(_0x4f0a1a){return _0x4f0a1a;});}return null;};}function removeEntity(_0x33fb87,_0x54a9a7){return function(_0x56c729){if(_0x56c729){return _0x56c729['destroy']()[_0x0d8b('0x22')](function(){_0x33fb87[_0x0d8b('0x17')](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x38efc8,_0x221071){return function(_0x2c64e2){if(!_0x2c64e2){_0x38efc8[_0x0d8b('0x16')](0x194);}return _0x2c64e2;};}function handleError(_0x4562cb,_0x27b695){_0x27b695=_0x27b695||0x1f4;return function(_0x5e5bc3){logger[_0x0d8b('0x23')](_0x5e5bc3[_0x0d8b('0x24')]);if(_0x5e5bc3['name']){delete _0x5e5bc3[_0x0d8b('0x25')];}_0x4562cb['status'](_0x27b695)[_0x0d8b('0x26')](_0x5e5bc3);};}exports[_0x0d8b('0x27')]=function(_0xa2af02,_0x4fe6f9){var _0x59a905={},_0x28f639={},_0x3ef745={'count':0x0,'rows':[]};var _0x4c05ee=_[_0x0d8b('0x28')](db['SmsTransferReport'][_0x0d8b('0x29')],function(_0x4b59e5){return{'name':_0x4b59e5[_0x0d8b('0x2a')],'type':_0x4b59e5['type'][_0x0d8b('0x2b')]};});_0x28f639['model']=_[_0x0d8b('0x28')](_0x4c05ee,'name');_0x28f639[_0x0d8b('0x2c')]=_[_0x0d8b('0x2d')](_0xa2af02[_0x0d8b('0x2c')]);_0x28f639['filters']=_['intersection'](_0x28f639['model'],_0x28f639[_0x0d8b('0x2c')]);_0x59a905['attributes']=_[_0x0d8b('0x2e')](_0x28f639['model'],qs['fields'](_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x2f')]));_0x59a905[_0x0d8b('0x30')]=_0x59a905[_0x0d8b('0x30')][_0x0d8b('0x31')]?_0x59a905[_0x0d8b('0x30')]:_0x28f639[_0x0d8b('0x32')];if(!_0xa2af02[_0x0d8b('0x2c')]['hasOwnProperty'](_0x0d8b('0x33'))){_0x59a905[_0x0d8b('0x1b')]=qs['limit'](_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x1b')]);_0x59a905[_0x0d8b('0x1a')]=qs['offset'](_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}_0x59a905[_0x0d8b('0x34')]=qs[_0x0d8b('0x35')](_0xa2af02[_0x0d8b('0x2c')]['sort']);_0x59a905[_0x0d8b('0x36')]=qs[_0x0d8b('0x37')](_['pick'](_0xa2af02[_0x0d8b('0x2c')],_0x28f639[_0x0d8b('0x37')]),_0x4c05ee);if(_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x59a905[_0x0d8b('0x36')]=_['merge'](_0x59a905['where'],{'$or':_[_0x0d8b('0x28')](_0x4c05ee,function(_0x5c2c04){if(_0x5c2c04['type']!==_0x0d8b('0x39')){var _0x2e279c={};_0x2e279c[_0x5c2c04[_0x0d8b('0x25')]]={'$like':'%'+_0xa2af02[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x2e279c;}})});}_0x59a905=_[_0x0d8b('0x3a')]({},_0x59a905,_0xa2af02['options']);var _0x6e5bab={'where':_0x59a905[_0x0d8b('0x36')]};return db[_0x0d8b('0x3b')][_0x0d8b('0x3c')](_0x6e5bab)[_0x0d8b('0x22')](function(_0x1a39ad){_0x3ef745[_0x0d8b('0x3c')]=_0x1a39ad;if(_0xa2af02['query'][_0x0d8b('0x3d')]){_0x59a905[_0x0d8b('0x3e')]=[{'all':!![]}];}return db[_0x0d8b('0x3b')][_0x0d8b('0x3f')](_0x59a905);})['then'](function(_0xe0bf42){_0x3ef745['rows']=_0xe0bf42;return _0x3ef745;})[_0x0d8b('0x22')](respondWithFilteredResult(_0x4fe6f9,_0x59a905))[_0x0d8b('0x40')](handleError(_0x4fe6f9,null));};exports[_0x0d8b('0x41')]=function(_0x26ac10,_0x35fa7e){var _0x3e632e={'raw':!![],'where':{'id':_0x26ac10[_0x0d8b('0x42')]['id']}},_0x1ff17d={};_0x1ff17d[_0x0d8b('0x32')]=_[_0x0d8b('0x2d')](db['SmsTransferReport']['rawAttributes']);_0x1ff17d['query']=_['keys'](_0x26ac10['query']);_0x1ff17d[_0x0d8b('0x37')]=_[_0x0d8b('0x2e')](_0x1ff17d[_0x0d8b('0x32')],_0x1ff17d['query']);_0x3e632e['attributes']=_[_0x0d8b('0x2e')](_0x1ff17d[_0x0d8b('0x32')],qs[_0x0d8b('0x2f')](_0x26ac10['query'][_0x0d8b('0x2f')]));_0x3e632e[_0x0d8b('0x30')]=_0x3e632e['attributes']['length']?_0x3e632e[_0x0d8b('0x30')]:_0x1ff17d['model'];if(_0x26ac10[_0x0d8b('0x2c')]['includeAll']){_0x3e632e['include']=[{'all':!![]}];}_0x3e632e=_[_0x0d8b('0x3a')]({},_0x3e632e,_0x26ac10[_0x0d8b('0x43')]);return db['SmsTransferReport']['find'](_0x3e632e)['then'](handleEntityNotFound(_0x35fa7e,null))['then'](respondWithResult(_0x35fa7e,null))[_0x0d8b('0x40')](handleError(_0x35fa7e,null));};exports[_0x0d8b('0x44')]=function(_0xd9d4c3,_0x490eda){return db[_0x0d8b('0x3b')][_0x0d8b('0x44')](_0xd9d4c3[_0x0d8b('0x45')],{})[_0x0d8b('0x22')](respondWithResult(_0x490eda,0xc9))[_0x0d8b('0x40')](handleError(_0x490eda,null));};exports[_0x0d8b('0x21')]=function(_0x11d22b,_0x1d5067){if(_0x11d22b[_0x0d8b('0x45')]['id']){delete _0x11d22b[_0x0d8b('0x45')]['id'];}return db[_0x0d8b('0x3b')][_0x0d8b('0x46')]({'where':{'id':_0x11d22b[_0x0d8b('0x42')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x1d5067,null))[_0x0d8b('0x22')](saveUpdates(_0x11d22b[_0x0d8b('0x45')],null))[_0x0d8b('0x22')](respondWithResult(_0x1d5067,null))[_0x0d8b('0x40')](handleError(_0x1d5067,null));};exports[_0x0d8b('0x47')]=function(_0x574b90,_0x371fa0){return db['SmsTransferReport']['find']({'where':{'id':_0x574b90[_0x0d8b('0x42')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x371fa0,null))[_0x0d8b('0x22')](removeEntity(_0x371fa0,null))[_0x0d8b('0x40')](handleError(_0x371fa0,null));};exports['describe']=function(_0x131579,_0x1106d6){return db[_0x0d8b('0x3b')][_0x0d8b('0x48')]()[_0x0d8b('0x22')](respondWithResult(_0x1106d6,null))['catch'](handleError(_0x1106d6,null));};
\ No newline at end of file
index 4d58b67..f4cf1e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21c7=['path','rimraf','./smsTransferReport.attributes','define','uniqueid','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x21c7,0x7d));var _0x721c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21c7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x721c('0x0'))(_0x721c('0x1'));var moment=require(_0x721c('0x2'));var BPromise=require(_0x721c('0x3'));var rp=require(_0x721c('0x4'));var fs=require('fs');var path=require(_0x721c('0x5'));var rimraf=require(_0x721c('0x6'));var config=require('../../config/environment');var attributes=require(_0x721c('0x7'));module['exports']=function(_0x1bd285,_0x852b8e){return _0x1bd285[_0x721c('0x8')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x721c('0x9'),'fields':[_0x721c('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2456=['request-promise','rimraf','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment'];(function(_0x3f8d91,_0x26d57f){var _0x4f3aab=function(_0x4659c1){while(--_0x4659c1){_0x3f8d91['push'](_0x3f8d91['shift']());}};_0x4f3aab(++_0x26d57f);}(_0x2456,0xc8));var _0x6245=function(_0x3669bf,_0x13f4f4){_0x3669bf=_0x3669bf-0x0;var _0x4bae1a=_0x2456[_0x3669bf];return _0x4bae1a;};'use strict';var _=require(_0x6245('0x0'));var util=require(_0x6245('0x1'));var logger=require('../../config/logger')(_0x6245('0x2'));var moment=require(_0x6245('0x3'));var BPromise=require('bluebird');var rp=require(_0x6245('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6245('0x5'));var config=require(_0x6245('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x6245('0x7')]=function(_0x3cee26,_0x2fdae3){return _0x3cee26[_0x6245('0x8')](_0x6245('0x9'),attributes,{'tableName':_0x6245('0xa'),'paranoid':![],'indexes':[{'name':_0x6245('0xb'),'fields':[_0x6245('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 4c35435..4034d51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43a1=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x43a1,0x6d));var _0x143a=function(_0x24c86a,_0x4131b5){_0x24c86a=_0x24c86a-0x0;var _0x3412ff=_0x43a1[_0x24c86a];return _0x3412ff;};'use strict';var _=require(_0x143a('0x0'));var util=require(_0x143a('0x1'));var moment=require(_0x143a('0x2'));var BPromise=require(_0x143a('0x3'));var rs=require(_0x143a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x143a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x143a('0x6'));var config=require('../../config/environment');var jayson=require(_0x143a('0x7'));var client=jayson[_0x143a('0x8')][_0x143a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x263ca7,_0x384e5d,_0x1d8e04){return new BPromise(function(_0x33095d,_0x493f68){return client[_0x143a('0xa')](_0x263ca7,_0x1d8e04)['then'](function(_0x4b67bd){logger[_0x143a('0xb')](_0x143a('0xc'),_0x384e5d,_0x143a('0xd'));logger['debug'](_0x143a('0xe'),_0x384e5d,_0x143a('0xd'),JSON[_0x143a('0xf')](_0x4b67bd));if(_0x4b67bd[_0x143a('0x10')]){if(_0x4b67bd['error'][_0x143a('0x11')]===0x1f4){logger[_0x143a('0x10')](_0x143a('0xc'),_0x384e5d,_0x4b67bd['error'][_0x143a('0x12')]);return _0x493f68(_0x4b67bd[_0x143a('0x10')][_0x143a('0x12')]);}logger[_0x143a('0x10')](_0x143a('0xc'),_0x384e5d,_0x4b67bd[_0x143a('0x10')]['message']);return _0x33095d(_0x4b67bd['error'][_0x143a('0x12')]);}else{logger[_0x143a('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x384e5d,_0x143a('0xd'));_0x33095d(_0x4b67bd[_0x143a('0x13')][_0x143a('0x12')]);}})[_0x143a('0x14')](function(_0x5a8c8b){logger['error'](_0x143a('0xc'),_0x384e5d,_0x5a8c8b);_0x493f68(_0x5a8c8b);});});}
\ No newline at end of file
+var _0x941c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x42c24f,_0x5e4327){var _0x36b58e=function(_0xd30559){while(--_0xd30559){_0x42c24f['push'](_0x42c24f['shift']());}};_0x36b58e(++_0x5e4327);}(_0x941c,0x1b2));var _0xc941=function(_0x2f708e,_0x312f9b){_0x2f708e=_0x2f708e-0x0;var _0x3771fb=_0x941c[_0x2f708e];return _0x3771fb;};'use strict';var _=require(_0xc941('0x0'));var util=require(_0xc941('0x1'));var moment=require(_0xc941('0x2'));var BPromise=require('bluebird');var rs=require(_0xc941('0x3'));var fs=require('fs');var Redis=require(_0xc941('0x4'));var db=require(_0xc941('0x5'))['db'];var utils=require(_0xc941('0x6'));var logger=require(_0xc941('0x7'))(_0xc941('0x8'));var config=require(_0xc941('0x9'));var jayson=require(_0xc941('0xa'));var client=jayson[_0xc941('0xb')][_0xc941('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35059f,_0x242865,_0x4671ef){return new BPromise(function(_0x5e34b7,_0x44c51b){return client['request'](_0x35059f,_0x4671ef)['then'](function(_0x3670ae){logger[_0xc941('0xd')](_0xc941('0xe'),_0x242865,_0xc941('0xf'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x242865,_0xc941('0xf'),JSON[_0xc941('0x10')](_0x3670ae));if(_0x3670ae[_0xc941('0x11')]){if(_0x3670ae['error'][_0xc941('0x12')]===0x1f4){logger[_0xc941('0x11')](_0xc941('0xe'),_0x242865,_0x3670ae[_0xc941('0x11')][_0xc941('0x13')]);return _0x44c51b(_0x3670ae[_0xc941('0x11')]['message']);}logger['error'](_0xc941('0xe'),_0x242865,_0x3670ae['error'][_0xc941('0x13')]);return _0x5e34b7(_0x3670ae[_0xc941('0x11')][_0xc941('0x13')]);}else{logger[_0xc941('0xd')](_0xc941('0xe'),_0x242865,_0xc941('0xf'));_0x5e34b7(_0x3670ae[_0xc941('0x14')][_0xc941('0x13')]);}})[_0xc941('0x15')](function(_0x55383f){logger[_0xc941('0x11')](_0xc941('0xe'),_0x242865,_0x55383f);_0x44c51b(_0x55383f);});});}
\ No newline at end of file
index 8fd002f..322a5c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6bd=['../../components/interaction/service','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','join','root','server/files/sounds/original/','originalname','format','basename','extname','post','single','file','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xb4a263,_0x260cab){var _0x3179af=function(_0x13c55a){while(--_0x13c55a){_0xb4a263['push'](_0xb4a263['shift']());}};_0x3179af(++_0x260cab);}(_0xd6bd,0xe9));var _0xdd6b=function(_0x5c08ae,_0x504511){_0x5c08ae=_0x5c08ae-0x0;var _0x191f67=_0xd6bd[_0x5c08ae];return _0x191f67;};'use strict';var multer=require(_0xdd6b('0x0'));var util=require(_0xdd6b('0x1'));var path=require(_0xdd6b('0x2'));var timeout=require(_0xdd6b('0x3'));var express=require(_0xdd6b('0x4'));var router=express[_0xdd6b('0x5')]();var auth=require(_0xdd6b('0x6'));var interaction=require(_0xdd6b('0x7'));var config=require('../../config/environment');var controller=require(_0xdd6b('0x8'));router[_0xdd6b('0x9')]('/',auth['isAuthenticated'](),controller[_0xdd6b('0xa')]);router[_0xdd6b('0x9')](_0xdd6b('0xb'),auth[_0xdd6b('0xc')](),controller[_0xdd6b('0xd')]);router[_0xdd6b('0x9')](_0xdd6b('0xe'),auth['isAuthenticated'](),controller[_0xdd6b('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52deb2,_0x52e996,_0x11964f){_0x11964f(null,path[_0xdd6b('0x10')](config[_0xdd6b('0x11')],_0xdd6b('0x12')));},'filename':function(_0xd51072,_0x517f9d,_0x15dab5){_0x517f9d['originalname']=_0x517f9d[_0xdd6b('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x15dab5(null,util[_0xdd6b('0x14')]('%s-%s%s',path[_0xdd6b('0x15')](_0x517f9d[_0xdd6b('0x13')],path[_0xdd6b('0x16')](_0x517f9d['originalname'])),Date['now'](),path[_0xdd6b('0x16')](_0x517f9d[_0xdd6b('0x13')])));}})});router[_0xdd6b('0x17')]('/',upload[_0xdd6b('0x18')](_0xdd6b('0x19')),controller[_0xdd6b('0x1a')]);router[_0xdd6b('0x1b')](_0xdd6b('0xb'),auth[_0xdd6b('0xc')](),controller['update']);router[_0xdd6b('0x1c')](_0xdd6b('0xb'),auth[_0xdd6b('0xc')](),controller[_0xdd6b('0x1c')]);module[_0xdd6b('0x1d')]=router;
\ No newline at end of file
+var _0x5e1e=['diskStorage','server/files/sounds/original/','replace','extname','originalname','now','post','single','file','create','put','update','delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','isAuthenticated','show','/:id/download'];(function(_0x17b90c,_0x46ba51){var _0x4100d2=function(_0x1ba8dd){while(--_0x1ba8dd){_0x17b90c['push'](_0x17b90c['shift']());}};_0x4100d2(++_0x46ba51);}(_0x5e1e,0xd2));var _0xe5e1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5e1e[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xe5e1('0x0'));var util=require(_0xe5e1('0x1'));var path=require(_0xe5e1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe5e1('0x3')]();var auth=require(_0xe5e1('0x4'));var interaction=require(_0xe5e1('0x5'));var config=require(_0xe5e1('0x6'));var controller=require(_0xe5e1('0x7'));router[_0xe5e1('0x8')]('/',auth['isAuthenticated'](),controller[_0xe5e1('0x9')]);router[_0xe5e1('0x8')](_0xe5e1('0xa'),auth[_0xe5e1('0xb')](),controller[_0xe5e1('0xc')]);router[_0xe5e1('0x8')](_0xe5e1('0xd'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xe5e1('0xe')]({'destination':function(_0x245524,_0x42cfcb,_0x5ed004){_0x5ed004(null,path['join'](config['root'],_0xe5e1('0xf')));},'filename':function(_0x1103d9,_0x4cb01d,_0x58dedf){_0x4cb01d['originalname']=_0x4cb01d['originalname'][_0xe5e1('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x58dedf(null,util['format']('%s-%s%s',path['basename'](_0x4cb01d['originalname'],path[_0xe5e1('0x11')](_0x4cb01d[_0xe5e1('0x12')])),Date[_0xe5e1('0x13')](),path[_0xe5e1('0x11')](_0x4cb01d[_0xe5e1('0x12')])));}})});router[_0xe5e1('0x14')]('/',upload[_0xe5e1('0x15')](_0xe5e1('0x16')),controller[_0xe5e1('0x17')]);router[_0xe5e1('0x18')]('/:id',auth[_0xe5e1('0xb')](),controller[_0xe5e1('0x19')]);router['delete'](_0xe5e1('0xa'),auth[_0xe5e1('0xb')](),controller[_0xe5e1('0x1a')]);module[_0xe5e1('0x1b')]=router;
\ No newline at end of file
index a552030..b014ebb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3937=['INTEGER','sequelize','exports','STRING','name','FLOAT','BIGINT'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0x3937,0x1a5));var _0x7393=function(_0x20d443,_0x2d6a87){_0x20d443=_0x20d443-0x0;var _0x249cc4=_0x3937[_0x20d443];return _0x249cc4;};'use strict';var Sequelize=require(_0x7393('0x0'));module[_0x7393('0x1')]={'name':{'type':Sequelize[_0x7393('0x2')],'unique':_0x7393('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x7393('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x7393('0x2')]},'original_format':{'type':Sequelize[_0x7393('0x2')]},'original_duration':{'type':Sequelize[_0x7393('0x4')]},'original_sampleCount':{'type':Sequelize[_0x7393('0x5')]},'original_channelCount':{'type':Sequelize[_0x7393('0x6')]},'original_bitRate':{'type':Sequelize[_0x7393('0x5')]},'original_sampleRate':{'type':Sequelize[_0x7393('0x6')]},'converted_format':{'type':Sequelize[_0x7393('0x2')]},'converted_duration':{'type':Sequelize[_0x7393('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x7393('0x5')]},'converted_channelCount':{'type':Sequelize[_0x7393('0x6')]},'converted_bitRate':{'type':Sequelize[_0x7393('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xb332=['INTEGER','sequelize','exports','STRING','FLOAT','BIGINT'];(function(_0x43c8b8,_0x5e8934){var _0x413be3=function(_0x23969c){while(--_0x23969c){_0x43c8b8['push'](_0x43c8b8['shift']());}};_0x413be3(++_0x5e8934);}(_0xb332,0x109));var _0x2b33=function(_0x216428,_0x5d20ea){_0x216428=_0x216428-0x0;var _0x313dd4=_0xb332[_0x216428];return _0x313dd4;};'use strict';var Sequelize=require(_0x2b33('0x0'));module[_0x2b33('0x1')]={'name':{'type':Sequelize[_0x2b33('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x2b33('0x2')]},'display_name':{'type':Sequelize[_0x2b33('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x2b33('0x2')]},'original_format':{'type':Sequelize[_0x2b33('0x2')]},'original_duration':{'type':Sequelize[_0x2b33('0x3')]},'original_sampleCount':{'type':Sequelize[_0x2b33('0x4')]},'original_channelCount':{'type':Sequelize[_0x2b33('0x5')]},'original_bitRate':{'type':Sequelize[_0x2b33('0x4')]},'original_sampleRate':{'type':Sequelize[_0x2b33('0x5')]},'converted_format':{'type':Sequelize[_0x2b33('0x2')]},'converted_duration':{'type':Sequelize[_0x2b33('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x2b33('0x4')]},'converted_channelCount':{'type':Sequelize[_0x2b33('0x5')]},'converted_bitRate':{'type':Sequelize[_0x2b33('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x2b33('0x5')]}};
\ No newline at end of file
index 5cbb680..aae2575 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c53=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','Sound','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','filename','extname','substring','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','description','delete','original_format','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x42f840,_0x1aa32e){var _0x47539f=function(_0x390a4b){while(--_0x390a4b){_0x42f840['push'](_0x42f840['shift']());}};_0x47539f(++_0x1aa32e);}(_0x0c53,0x1e1));var _0x30c5=function(_0x56b497,_0x388b63){_0x56b497=_0x56b497-0x0;var _0x95041=_0x0c53[_0x56b497];return _0x95041;};'use strict';var pdf=require(_0x30c5('0x0'));var emlformat=require(_0x30c5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x30c5('0x2'));var jsonpatch=require(_0x30c5('0x3'));var rp=require(_0x30c5('0x4'));var moment=require(_0x30c5('0x5'));var BPromise=require(_0x30c5('0x6'));var Mustache=require('mustache');var util=require(_0x30c5('0x7'));var path=require(_0x30c5('0x8'));var sox=require(_0x30c5('0x9'));var csv=require('to-csv');var ejs=require(_0x30c5('0xa'));var fs=require('fs');var _=require(_0x30c5('0xb'));var squel=require(_0x30c5('0xc'));var crypto=require('crypto');var jsforce=require(_0x30c5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x30c5('0xe'));var querystring=require(_0x30c5('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x30c5('0x10'));var qs=require(_0x30c5('0x11'));var as=require(_0x30c5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30c5('0x13'))(_0x30c5('0x14'));var utils=require(_0x30c5('0x15'));var config=require(_0x30c5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e8a6e,_0x55f04c){_0x55f04c=_0x55f04c||0xcc;return function(_0x3365d7){if(_0x3365d7){return _0x5e8a6e[_0x30c5('0x17')](_0x55f04c);}return _0x5e8a6e['status'](_0x55f04c)[_0x30c5('0x18')]();};}function respondWithResult(_0x4eba1a,_0x486de2){_0x486de2=_0x486de2||0xc8;return function(_0x1c12e2){if(_0x1c12e2){return _0x4eba1a['status'](_0x486de2)[_0x30c5('0x19')](_0x1c12e2);}};}function respondWithFilteredResult(_0xaa99d,_0xe2b3d8){return function(_0x54835f){if(_0x54835f){var _0x4611ee=_0x54835f[_0x30c5('0x1a')],_0x2fd335=_0xe2b3d8[_0x30c5('0x1b')],_0x263a1d=_0xe2b3d8[_0x30c5('0x1b')]+_0xe2b3d8[_0x30c5('0x1c')],_0x55143d;if(_0x263a1d>=_0x4611ee){_0x263a1d=_0x4611ee;_0x55143d=0xc8;}else{_0x55143d=0xce;}_0xaa99d[_0x30c5('0x1d')](_0x55143d);return _0xaa99d[_0x30c5('0x1e')](_0x30c5('0x1f'),_0x2fd335+'-'+_0x263a1d+'/'+_0x4611ee)[_0x30c5('0x19')](_0x54835f);}return null;};}function patchUpdates(_0x139de7){return function(_0x3df6d0){try{jsonpatch[_0x30c5('0x20')](_0x3df6d0,_0x139de7,!![]);}catch(_0x48b40f){return BPromise[_0x30c5('0x21')](_0x48b40f);}return _0x3df6d0[_0x30c5('0x22')]();};}function saveUpdates(_0x40ca13,_0x1e152f){return function(_0x3f2bfd){if(_0x3f2bfd){return _0x3f2bfd['update'](_0x40ca13)[_0x30c5('0x23')](function(_0x378496){return _0x378496;});}return null;};}function removeEntity(_0x27a45c,_0x5c22b1){return function(_0x580652){if(_0x580652){return _0x580652[_0x30c5('0x24')]()[_0x30c5('0x23')](function(){var _0xad22d5=_0x580652['get']({'plain':!![]});var _0x5386cc=_0x30c5('0x25');return db[_0x30c5('0x26')][_0x30c5('0x24')]({'where':{'type':_0x5386cc,'resourceId':_0xad22d5['id']}})[_0x30c5('0x23')](function(){return _0x580652;});})[_0x30c5('0x23')](function(){_0x27a45c['status'](0xcc)[_0x30c5('0x18')]();});}};}function handleEntityNotFound(_0x43ab27,_0x4cc81b){return function(_0x542cf1){if(!_0x542cf1){_0x43ab27[_0x30c5('0x17')](0x194);}return _0x542cf1;};}function handleError(_0x14cd82,_0x44576a){_0x44576a=_0x44576a||0x1f4;return function(_0x409104){logger[_0x30c5('0x27')](_0x409104[_0x30c5('0x28')]);if(_0x409104[_0x30c5('0x29')]){delete _0x409104[_0x30c5('0x29')];}_0x14cd82[_0x30c5('0x1d')](_0x44576a)[_0x30c5('0x2a')](_0x409104);};}exports[_0x30c5('0x2b')]=function(_0x3e2abe,_0x573ac2){var _0x2e9709={},_0x5224e3={},_0x495aa9={'count':0x0,'rows':[]};var _0x1b2257=_['map'](db[_0x30c5('0x2c')]['rawAttributes'],function(_0x2e5bc7){return{'name':_0x2e5bc7[_0x30c5('0x2d')],'type':_0x2e5bc7['type'][_0x30c5('0x2e')]};});_0x5224e3[_0x30c5('0x2f')]=_[_0x30c5('0x30')](_0x1b2257,'name');_0x5224e3[_0x30c5('0x31')]=_[_0x30c5('0x32')](_0x3e2abe[_0x30c5('0x31')]);_0x5224e3[_0x30c5('0x33')]=_[_0x30c5('0x34')](_0x5224e3[_0x30c5('0x2f')],_0x5224e3[_0x30c5('0x31')]);_0x2e9709[_0x30c5('0x35')]=_['intersection'](_0x5224e3[_0x30c5('0x2f')],qs[_0x30c5('0x36')](_0x3e2abe[_0x30c5('0x31')][_0x30c5('0x36')]));_0x2e9709['attributes']=_0x2e9709[_0x30c5('0x35')]['length']?_0x2e9709[_0x30c5('0x35')]:_0x5224e3[_0x30c5('0x2f')];if(!_0x3e2abe['query']['hasOwnProperty']('nolimit')){_0x2e9709[_0x30c5('0x1c')]=qs['limit'](_0x3e2abe['query'][_0x30c5('0x1c')]);_0x2e9709[_0x30c5('0x1b')]=qs[_0x30c5('0x1b')](_0x3e2abe['query'][_0x30c5('0x1b')]);}_0x2e9709[_0x30c5('0x37')]=qs[_0x30c5('0x38')](_0x3e2abe[_0x30c5('0x31')][_0x30c5('0x38')]);_0x2e9709[_0x30c5('0x39')]=qs[_0x30c5('0x33')](_[_0x30c5('0x3a')](_0x3e2abe['query'],_0x5224e3['filters']),_0x1b2257);if(_0x3e2abe[_0x30c5('0x31')][_0x30c5('0x3b')]){_0x2e9709[_0x30c5('0x39')]=_[_0x30c5('0x3c')](_0x2e9709[_0x30c5('0x39')],{'$or':_[_0x30c5('0x30')](_0x1b2257,function(_0x4539b6){if(_0x4539b6[_0x30c5('0x3d')]!==_0x30c5('0x3e')){var _0x1927c8={};_0x1927c8[_0x4539b6['name']]={'$like':'%'+_0x3e2abe[_0x30c5('0x31')][_0x30c5('0x3b')]+'%'};return _0x1927c8;}})});}_0x2e9709=_[_0x30c5('0x3c')]({},_0x2e9709,_0x3e2abe[_0x30c5('0x3f')]);var _0x389167={'where':_0x2e9709[_0x30c5('0x39')]};return db[_0x30c5('0x2c')][_0x30c5('0x1a')](_0x389167)[_0x30c5('0x23')](function(_0x2f4bd3){_0x495aa9[_0x30c5('0x1a')]=_0x2f4bd3;if(_0x3e2abe['query'][_0x30c5('0x40')]){_0x2e9709[_0x30c5('0x41')]=[{'all':!![]}];}return db[_0x30c5('0x2c')]['findAll'](_0x2e9709);})['then'](function(_0x4b92c3){_0x495aa9[_0x30c5('0x42')]=_0x4b92c3;return _0x495aa9;})[_0x30c5('0x23')](respondWithFilteredResult(_0x573ac2,_0x2e9709))[_0x30c5('0x43')](handleError(_0x573ac2,null));};exports['show']=function(_0x1bddcd,_0x844337){var _0x5b0a51={'raw':!![],'where':{'id':_0x1bddcd[_0x30c5('0x44')]['id']}},_0x5416c9={};_0x5416c9['model']=_['keys'](db[_0x30c5('0x2c')][_0x30c5('0x45')]);_0x5416c9[_0x30c5('0x31')]=_[_0x30c5('0x32')](_0x1bddcd['query']);_0x5416c9[_0x30c5('0x33')]=_['intersection'](_0x5416c9['model'],_0x5416c9[_0x30c5('0x31')]);_0x5b0a51[_0x30c5('0x35')]=_[_0x30c5('0x34')](_0x5416c9[_0x30c5('0x2f')],qs[_0x30c5('0x36')](_0x1bddcd[_0x30c5('0x31')]['fields']));_0x5b0a51[_0x30c5('0x35')]=_0x5b0a51[_0x30c5('0x35')]['length']?_0x5b0a51['attributes']:_0x5416c9['model'];if(_0x1bddcd[_0x30c5('0x31')][_0x30c5('0x40')]){_0x5b0a51[_0x30c5('0x41')]=[{'all':!![]}];}_0x5b0a51=_['merge']({},_0x5b0a51,_0x1bddcd['options']);return db['Sound'][_0x30c5('0x46')](_0x5b0a51)[_0x30c5('0x23')](handleEntityNotFound(_0x844337,null))[_0x30c5('0x23')](respondWithResult(_0x844337,null))[_0x30c5('0x43')](handleError(_0x844337,null));};exports[_0x30c5('0x47')]=function(_0x4f35c9,_0xeac05e,_0x5db9a7){return db[_0x30c5('0x2c')]['find']({'where':{'id':_0x4f35c9[_0x30c5('0x44')]['id']},'attributes':[_0x30c5('0x29'),_0x30c5('0x48'),_0x30c5('0x49')],'raw':!![]})[_0x30c5('0x23')](handleEntityNotFound(_0xeac05e,null))[_0x30c5('0x23')](function(_0x297bc8){if(_0x297bc8){if(!fs[_0x30c5('0x4a')](path[_0x30c5('0x4b')](config[_0x30c5('0x4c')],_0x30c5('0x4d'),_0x297bc8[_0x30c5('0x48')]+'.'+_0x297bc8[_0x30c5('0x49')]))){throw new db[(_0x30c5('0x4e'))][(_0x30c5('0x4f'))](_0x30c5('0x50'));}return _0xeac05e['download'](path['join'](config[_0x30c5('0x4c')],_0x30c5('0x4d'),util[_0x30c5('0x51')](_0x30c5('0x52'),_0x297bc8[_0x30c5('0x48')],_0x297bc8[_0x30c5('0x49')])),util[_0x30c5('0x51')](_0x30c5('0x52'),_0x297bc8[_0x30c5('0x29')],_0x297bc8[_0x30c5('0x49')]));}return null;})['catch'](handleError(_0xeac05e,null));};exports[_0x30c5('0x53')]=function(_0x5734c8,_0x4b02e6,_0x3abc7c){var _0x3c5bbf={'name':path[_0x30c5('0x54')](_0x5734c8[_0x30c5('0x55')]['originalname'],path['extname'](_0x5734c8[_0x30c5('0x55')][_0x30c5('0x56')])),'save_name':path['basename'](_0x5734c8[_0x30c5('0x55')][_0x30c5('0x57')],path[_0x30c5('0x58')](_0x5734c8[_0x30c5('0x55')][_0x30c5('0x57')])),'original_format':path[_0x30c5('0x58')](_0x5734c8['file'][_0x30c5('0x56')])[_0x30c5('0x59')](0x1),'converted_format':'wav'};var _0x18b586=path[_0x30c5('0x4b')](config[_0x30c5('0x4c')],_0x30c5('0x5a'),_0x5734c8[_0x30c5('0x55')]['filename']);var _0x507cdb=path['join'](config['root'],_0x30c5('0x4d'),util[_0x30c5('0x51')](_0x30c5('0x52'),path[_0x30c5('0x54')](_0x5734c8[_0x30c5('0x55')][_0x30c5('0x57')],path[_0x30c5('0x58')](_0x5734c8[_0x30c5('0x55')][_0x30c5('0x57')])),_0x3c5bbf[_0x30c5('0x49')]));logger['info'](_0x30c5('0x5b'),_0x18b586);logger[_0x30c5('0x5c')](_0x30c5('0x5d'),_0x507cdb);try{fs[_0x30c5('0x5e')](_0x18b586,parseInt(_0x30c5('0x5f'),0x8));var _0x587caf=sox[_0x30c5('0x60')](_0x18b586,_0x507cdb,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x587caf['on']('error',function(_0x4d56fb){fs[_0x30c5('0x61')](_0x18b586);_0x4b02e6[_0x30c5('0x1d')](0x1f4)[_0x30c5('0x2a')](_0x4d56fb);});_0x587caf['on'](_0x30c5('0x62'),function(_0xe9c70f){_0x3c5bbf[_0x30c5('0x63')]=isNaN(_0xe9c70f[_0x30c5('0x64')])?null:_0xe9c70f[_0x30c5('0x64')]*0x3e8;_0x3c5bbf[_0x30c5('0x65')]=isNaN(_0xe9c70f[_0x30c5('0x66')])?null:_0xe9c70f['sampleCount'];_0x3c5bbf[_0x30c5('0x67')]=isNaN(_0xe9c70f[_0x30c5('0x68')])?null:_0xe9c70f[_0x30c5('0x68')];_0x3c5bbf[_0x30c5('0x69')]=isNaN(_0xe9c70f[_0x30c5('0x6a')])?null:_0xe9c70f['bitRate'];_0x3c5bbf[_0x30c5('0x6b')]=isNaN(_0xe9c70f['sampleRate'])?null:_0xe9c70f[_0x30c5('0x6c')];});_0x587caf['on'](_0x30c5('0x6d'),function(_0x516549){_0x3c5bbf['converted_duration']=isNaN(_0x516549[_0x30c5('0x64')])?null:_0x516549[_0x30c5('0x64')]*0x3e8;_0x3c5bbf[_0x30c5('0x6e')]=isNaN(_0x516549[_0x30c5('0x66')])?null:_0x516549[_0x30c5('0x66')];_0x3c5bbf[_0x30c5('0x6f')]=isNaN(_0x516549[_0x30c5('0x68')])?null:_0x516549[_0x30c5('0x68')];_0x3c5bbf[_0x30c5('0x70')]=isNaN(_0x516549['bitRate'])?null:_0x516549['bitRate'];_0x3c5bbf[_0x30c5('0x71')]=isNaN(_0x516549['sampleRate'])?null:_0x516549['sampleRate'];});_0x587caf['on'](_0x30c5('0x18'),function(){fs['chmodSync'](_0x507cdb,parseInt(_0x30c5('0x5f'),0x8));return db['Sound'][_0x30c5('0x53')](_0x3c5bbf)[_0x30c5('0x23')](function(_0x2ca535){var _0x464fee={'role':_0x5734c8['body'][_0x30c5('0x72')],'userProfileId':_0x5734c8[_0x30c5('0x73')][_0x30c5('0x74')]};if(!_0x464fee)throw new Error(_0x30c5('0x75'));if(_0x464fee[_0x30c5('0x72')]==='user'){var _0x1710a6=_0x2ca535['get']({'plain':!![]});return db[_0x30c5('0x76')][_0x30c5('0x46')]({'where':{'name':_0x30c5('0x25'),'userProfileId':_0x464fee['userProfileId']},'raw':!![]})[_0x30c5('0x23')](function(_0x4c5272){if(_0x4c5272&&_0x4c5272['autoAssociation']===0x0){return db[_0x30c5('0x26')]['create']({'name':_0x1710a6[_0x30c5('0x29')],'resourceId':_0x1710a6['id'],'type':_0x4c5272[_0x30c5('0x29')],'sectionId':_0x4c5272['id']},{})[_0x30c5('0x23')](function(){return _0x2ca535;});}else{return _0x2ca535;}})[_0x30c5('0x43')](function(_0x4c8eab){logger[_0x30c5('0x27')](_0x30c5('0x77'),_0x4c8eab);throw _0x4c8eab;});}return _0x2ca535;})[_0x30c5('0x23')](respondWithResult(_0x4b02e6,null))['catch'](handleError(_0x4b02e6,null));});_0x587caf[_0x30c5('0x78')]();}catch(_0x544e4e){_0x4b02e6[_0x30c5('0x1d')](0x1f4)[_0x30c5('0x2a')](_0x544e4e);}};exports[_0x30c5('0x79')]=function(_0x1447bf,_0x58e45a,_0x5b5990){return db[_0x30c5('0x2c')][_0x30c5('0x46')]({'where':{'id':_0x1447bf[_0x30c5('0x44')]['id']}})[_0x30c5('0x23')](handleEntityNotFound(_0x58e45a,null))[_0x30c5('0x23')](saveUpdates(_[_0x30c5('0x3a')](_0x1447bf[_0x30c5('0x73')],[_0x30c5('0x29'),_0x30c5('0x7a')]),null))['then'](respondWithResult(_0x58e45a,null))['catch'](handleError(_0x58e45a,null));};exports[_0x30c5('0x7b')]=function(_0x45a127,_0x312363,_0x345e45){return db[_0x30c5('0x2c')][_0x30c5('0x46')]({'where':{'id':_0x45a127['params']['id']}})[_0x30c5('0x23')](function(_0x2bd7fd){if(_0x2bd7fd){return _0x2bd7fd[_0x30c5('0x24')]();}})['then'](function(_0x3f5712){var _0x1bc448=path[_0x30c5('0x4b')](config[_0x30c5('0x4c')],_0x30c5('0x5a'),util['format'](_0x30c5('0x52'),_0x3f5712[_0x30c5('0x48')],_0x3f5712[_0x30c5('0x7c')]));var _0x22d318=path[_0x30c5('0x4b')](config['root'],_0x30c5('0x4d'),util['format'](_0x30c5('0x52'),_0x3f5712[_0x30c5('0x48')],_0x3f5712[_0x30c5('0x49')]));fs['unlinkSync'](_0x1bc448);fs['unlinkSync'](_0x22d318);return _0x3f5712;})['then'](function(_0x3db872){if(_0x3db872){return _0x312363['status'](0xcc)[_0x30c5('0x18')]();}})['then'](handleEntityNotFound(_0x312363,null))[_0x30c5('0x43')](handleError(_0x312363,null));};
\ No newline at end of file
+var _0x1b0a=['show','params','rawAttributes','includeAll','find','download','existsSync','root','server/files/sounds/converted','save_name','converted_format','Sequelize','ValidationError','format','%s.%s','create','basename','originalname','extname','file','filename','substring','wav','join','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','0777','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','error','name','send','index','map','Sound','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','include','catch'];(function(_0x2e4a0f,_0x3a9bb6){var _0x25a3cd=function(_0x1c614f){while(--_0x1c614f){_0x2e4a0f['push'](_0x2e4a0f['shift']());}};_0x25a3cd(++_0x3a9bb6);}(_0x1b0a,0x19f));var _0xa1b0=function(_0x11c8dd,_0x563b34){_0x11c8dd=_0x11c8dd-0x0;var _0x1aefb1=_0x1b0a[_0x11c8dd];return _0x1aefb1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa1b0('0x0'));var rimraf=require(_0xa1b0('0x1'));var zipdir=require(_0xa1b0('0x2'));var jsonpatch=require(_0xa1b0('0x3'));var rp=require(_0xa1b0('0x4'));var moment=require(_0xa1b0('0x5'));var BPromise=require(_0xa1b0('0x6'));var Mustache=require(_0xa1b0('0x7'));var util=require(_0xa1b0('0x8'));var path=require('path');var sox=require(_0xa1b0('0x9'));var csv=require(_0xa1b0('0xa'));var ejs=require(_0xa1b0('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa1b0('0xc'));var crypto=require(_0xa1b0('0xd'));var jsforce=require(_0xa1b0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa1b0('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa1b0('0xf'));var authService=require(_0xa1b0('0x10'));var qs=require(_0xa1b0('0x11'));var as=require(_0xa1b0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa1b0('0x13'));var utils=require(_0xa1b0('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1438cc,_0x4d384a){_0x4d384a=_0x4d384a||0xcc;return function(_0x2b9a91){if(_0x2b9a91){return _0x1438cc[_0xa1b0('0x15')](_0x4d384a);}return _0x1438cc[_0xa1b0('0x16')](_0x4d384a)[_0xa1b0('0x17')]();};}function respondWithResult(_0x47945e,_0x50805f){_0x50805f=_0x50805f||0xc8;return function(_0x7a2d47){if(_0x7a2d47){return _0x47945e[_0xa1b0('0x16')](_0x50805f)[_0xa1b0('0x18')](_0x7a2d47);}};}function respondWithFilteredResult(_0x4c46af,_0x53c5ec){return function(_0x45b0c7){if(_0x45b0c7){var _0x2af77b=_0x45b0c7[_0xa1b0('0x19')],_0x26335e=_0x53c5ec[_0xa1b0('0x1a')],_0x18ecb7=_0x53c5ec[_0xa1b0('0x1a')]+_0x53c5ec[_0xa1b0('0x1b')],_0x15dd94;if(_0x18ecb7>=_0x2af77b){_0x18ecb7=_0x2af77b;_0x15dd94=0xc8;}else{_0x15dd94=0xce;}_0x4c46af[_0xa1b0('0x16')](_0x15dd94);return _0x4c46af[_0xa1b0('0x1c')](_0xa1b0('0x1d'),_0x26335e+'-'+_0x18ecb7+'/'+_0x2af77b)[_0xa1b0('0x18')](_0x45b0c7);}return null;};}function patchUpdates(_0x286b0d){return function(_0x36acd4){try{jsonpatch[_0xa1b0('0x1e')](_0x36acd4,_0x286b0d,!![]);}catch(_0x300ca3){return BPromise[_0xa1b0('0x1f')](_0x300ca3);}return _0x36acd4[_0xa1b0('0x20')]();};}function saveUpdates(_0x2d6ce4,_0xb148d6){return function(_0x1f4ada){if(_0x1f4ada){return _0x1f4ada[_0xa1b0('0x21')](_0x2d6ce4)[_0xa1b0('0x22')](function(_0x5da121){return _0x5da121;});}return null;};}function removeEntity(_0x1a302b,_0x5eeb05){return function(_0x17c559){if(_0x17c559){return _0x17c559[_0xa1b0('0x23')]()['then'](function(){var _0x1b2acd=_0x17c559[_0xa1b0('0x24')]({'plain':!![]});var _0x7c5efa=_0xa1b0('0x25');return db[_0xa1b0('0x26')][_0xa1b0('0x23')]({'where':{'type':_0x7c5efa,'resourceId':_0x1b2acd['id']}})['then'](function(){return _0x17c559;});})[_0xa1b0('0x22')](function(){_0x1a302b['status'](0xcc)[_0xa1b0('0x17')]();});}};}function handleEntityNotFound(_0xbf07a0,_0x107db7){return function(_0x5b094b){if(!_0x5b094b){_0xbf07a0['sendStatus'](0x194);}return _0x5b094b;};}function handleError(_0x1267e3,_0x41a65b){_0x41a65b=_0x41a65b||0x1f4;return function(_0x1c1780){logger[_0xa1b0('0x27')](_0x1c1780['stack']);if(_0x1c1780[_0xa1b0('0x28')]){delete _0x1c1780['name'];}_0x1267e3[_0xa1b0('0x16')](_0x41a65b)[_0xa1b0('0x29')](_0x1c1780);};}exports[_0xa1b0('0x2a')]=function(_0x31bbc1,_0x2bcf52){var _0x26925a={},_0x59dfd3={},_0x42663d={'count':0x0,'rows':[]};var _0x2445c6=_[_0xa1b0('0x2b')](db[_0xa1b0('0x2c')]['rawAttributes'],function(_0x2977b1){return{'name':_0x2977b1[_0xa1b0('0x2d')],'type':_0x2977b1[_0xa1b0('0x2e')]['key']};});_0x59dfd3[_0xa1b0('0x2f')]=_['map'](_0x2445c6,_0xa1b0('0x28'));_0x59dfd3['query']=_[_0xa1b0('0x30')](_0x31bbc1[_0xa1b0('0x31')]);_0x59dfd3[_0xa1b0('0x32')]=_[_0xa1b0('0x33')](_0x59dfd3['model'],_0x59dfd3[_0xa1b0('0x31')]);_0x26925a['attributes']=_[_0xa1b0('0x33')](_0x59dfd3['model'],qs[_0xa1b0('0x34')](_0x31bbc1[_0xa1b0('0x31')][_0xa1b0('0x34')]));_0x26925a['attributes']=_0x26925a[_0xa1b0('0x35')][_0xa1b0('0x36')]?_0x26925a[_0xa1b0('0x35')]:_0x59dfd3[_0xa1b0('0x2f')];if(!_0x31bbc1[_0xa1b0('0x31')][_0xa1b0('0x37')]('nolimit')){_0x26925a[_0xa1b0('0x1b')]=qs['limit'](_0x31bbc1[_0xa1b0('0x31')][_0xa1b0('0x1b')]);_0x26925a[_0xa1b0('0x1a')]=qs[_0xa1b0('0x1a')](_0x31bbc1[_0xa1b0('0x31')][_0xa1b0('0x1a')]);}_0x26925a[_0xa1b0('0x38')]=qs[_0xa1b0('0x39')](_0x31bbc1['query'][_0xa1b0('0x39')]);_0x26925a[_0xa1b0('0x3a')]=qs[_0xa1b0('0x32')](_['pick'](_0x31bbc1[_0xa1b0('0x31')],_0x59dfd3['filters']),_0x2445c6);if(_0x31bbc1[_0xa1b0('0x31')]['filter']){_0x26925a['where']=_[_0xa1b0('0x3b')](_0x26925a[_0xa1b0('0x3a')],{'$or':_[_0xa1b0('0x2b')](_0x2445c6,function(_0x4006b9){if(_0x4006b9[_0xa1b0('0x2e')]!==_0xa1b0('0x3c')){var _0x1e3079={};_0x1e3079[_0x4006b9[_0xa1b0('0x28')]]={'$like':'%'+_0x31bbc1['query'][_0xa1b0('0x3d')]+'%'};return _0x1e3079;}})});}_0x26925a=_[_0xa1b0('0x3b')]({},_0x26925a,_0x31bbc1[_0xa1b0('0x3e')]);var _0x4223e={'where':_0x26925a[_0xa1b0('0x3a')]};return db[_0xa1b0('0x2c')]['count'](_0x4223e)['then'](function(_0xa97559){_0x42663d[_0xa1b0('0x19')]=_0xa97559;if(_0x31bbc1[_0xa1b0('0x31')]['includeAll']){_0x26925a[_0xa1b0('0x3f')]=[{'all':!![]}];}return db[_0xa1b0('0x2c')]['findAll'](_0x26925a);})[_0xa1b0('0x22')](function(_0xa071ee){_0x42663d['rows']=_0xa071ee;return _0x42663d;})[_0xa1b0('0x22')](respondWithFilteredResult(_0x2bcf52,_0x26925a))[_0xa1b0('0x40')](handleError(_0x2bcf52,null));};exports[_0xa1b0('0x41')]=function(_0x478d0f,_0x31dc27){var _0x2e57f7={'raw':!![],'where':{'id':_0x478d0f[_0xa1b0('0x42')]['id']}},_0x3469a3={};_0x3469a3[_0xa1b0('0x2f')]=_[_0xa1b0('0x30')](db['Sound'][_0xa1b0('0x43')]);_0x3469a3[_0xa1b0('0x31')]=_[_0xa1b0('0x30')](_0x478d0f[_0xa1b0('0x31')]);_0x3469a3[_0xa1b0('0x32')]=_[_0xa1b0('0x33')](_0x3469a3[_0xa1b0('0x2f')],_0x3469a3[_0xa1b0('0x31')]);_0x2e57f7[_0xa1b0('0x35')]=_[_0xa1b0('0x33')](_0x3469a3[_0xa1b0('0x2f')],qs[_0xa1b0('0x34')](_0x478d0f[_0xa1b0('0x31')][_0xa1b0('0x34')]));_0x2e57f7[_0xa1b0('0x35')]=_0x2e57f7[_0xa1b0('0x35')]['length']?_0x2e57f7[_0xa1b0('0x35')]:_0x3469a3[_0xa1b0('0x2f')];if(_0x478d0f[_0xa1b0('0x31')][_0xa1b0('0x44')]){_0x2e57f7['include']=[{'all':!![]}];}_0x2e57f7=_['merge']({},_0x2e57f7,_0x478d0f[_0xa1b0('0x3e')]);return db[_0xa1b0('0x2c')][_0xa1b0('0x45')](_0x2e57f7)[_0xa1b0('0x22')](handleEntityNotFound(_0x31dc27,null))[_0xa1b0('0x22')](respondWithResult(_0x31dc27,null))[_0xa1b0('0x40')](handleError(_0x31dc27,null));};exports[_0xa1b0('0x46')]=function(_0x160004,_0x5455c0,_0x33056c){return db[_0xa1b0('0x2c')]['find']({'where':{'id':_0x160004[_0xa1b0('0x42')]['id']},'attributes':[_0xa1b0('0x28'),'save_name','converted_format'],'raw':!![]})[_0xa1b0('0x22')](handleEntityNotFound(_0x5455c0,null))['then'](function(_0x4c068b){if(_0x4c068b){if(!fs[_0xa1b0('0x47')](path['join'](config[_0xa1b0('0x48')],_0xa1b0('0x49'),_0x4c068b[_0xa1b0('0x4a')]+'.'+_0x4c068b[_0xa1b0('0x4b')]))){throw new db[(_0xa1b0('0x4c'))][(_0xa1b0('0x4d'))]('Sound\x20not\x20found');}return _0x5455c0[_0xa1b0('0x46')](path['join'](config['root'],_0xa1b0('0x49'),util['format']('%s.%s',_0x4c068b[_0xa1b0('0x4a')],_0x4c068b[_0xa1b0('0x4b')])),util[_0xa1b0('0x4e')](_0xa1b0('0x4f'),_0x4c068b[_0xa1b0('0x28')],_0x4c068b[_0xa1b0('0x4b')]));}return null;})[_0xa1b0('0x40')](handleError(_0x5455c0,null));};exports[_0xa1b0('0x50')]=function(_0x4d1bbf,_0x2c23aa,_0x1f7f20){var _0xdf7c10={'name':path[_0xa1b0('0x51')](_0x4d1bbf['file'][_0xa1b0('0x52')],path[_0xa1b0('0x53')](_0x4d1bbf['file'][_0xa1b0('0x52')])),'save_name':path[_0xa1b0('0x51')](_0x4d1bbf[_0xa1b0('0x54')][_0xa1b0('0x55')],path[_0xa1b0('0x53')](_0x4d1bbf[_0xa1b0('0x54')][_0xa1b0('0x55')])),'original_format':path[_0xa1b0('0x53')](_0x4d1bbf[_0xa1b0('0x54')][_0xa1b0('0x52')])[_0xa1b0('0x56')](0x1),'converted_format':_0xa1b0('0x57')};var _0x3f3b51=path[_0xa1b0('0x58')](config['root'],_0xa1b0('0x59'),_0x4d1bbf[_0xa1b0('0x54')][_0xa1b0('0x55')]);var _0x4048d1=path[_0xa1b0('0x58')](config[_0xa1b0('0x48')],_0xa1b0('0x49'),util['format']('%s.%s',path[_0xa1b0('0x51')](_0x4d1bbf['file'][_0xa1b0('0x55')],path[_0xa1b0('0x53')](_0x4d1bbf[_0xa1b0('0x54')]['filename'])),_0xdf7c10['converted_format']));logger[_0xa1b0('0x5a')]('Sound\x20upload\x20filepath:\x20%s',_0x3f3b51);logger[_0xa1b0('0x5a')](_0xa1b0('0x5b'),_0x4048d1);try{fs['chmodSync'](_0x3f3b51,parseInt(_0xa1b0('0x5c'),0x8));var _0x7f5a2e=sox['transcode'](_0x3f3b51,_0x4048d1,{'sampleRate':0x1f40,'format':_0xa1b0('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x7f5a2e['on'](_0xa1b0('0x27'),function(_0x571a93){fs[_0xa1b0('0x5d')](_0x3f3b51);_0x2c23aa['status'](0x1f4)[_0xa1b0('0x29')](_0x571a93);});_0x7f5a2e['on'](_0xa1b0('0x5e'),function(_0x428170){_0xdf7c10[_0xa1b0('0x5f')]=isNaN(_0x428170[_0xa1b0('0x60')])?null:_0x428170[_0xa1b0('0x60')]*0x3e8;_0xdf7c10['original_sampleCount']=isNaN(_0x428170[_0xa1b0('0x61')])?null:_0x428170[_0xa1b0('0x61')];_0xdf7c10[_0xa1b0('0x62')]=isNaN(_0x428170[_0xa1b0('0x63')])?null:_0x428170[_0xa1b0('0x63')];_0xdf7c10[_0xa1b0('0x64')]=isNaN(_0x428170[_0xa1b0('0x65')])?null:_0x428170[_0xa1b0('0x65')];_0xdf7c10['original_sampleRate']=isNaN(_0x428170[_0xa1b0('0x66')])?null:_0x428170[_0xa1b0('0x66')];});_0x7f5a2e['on'](_0xa1b0('0x67'),function(_0x4d1965){_0xdf7c10[_0xa1b0('0x68')]=isNaN(_0x4d1965[_0xa1b0('0x60')])?null:_0x4d1965[_0xa1b0('0x60')]*0x3e8;_0xdf7c10[_0xa1b0('0x69')]=isNaN(_0x4d1965[_0xa1b0('0x61')])?null:_0x4d1965['sampleCount'];_0xdf7c10[_0xa1b0('0x6a')]=isNaN(_0x4d1965['channelCount'])?null:_0x4d1965['channelCount'];_0xdf7c10[_0xa1b0('0x6b')]=isNaN(_0x4d1965['bitRate'])?null:_0x4d1965['bitRate'];_0xdf7c10[_0xa1b0('0x6c')]=isNaN(_0x4d1965[_0xa1b0('0x66')])?null:_0x4d1965['sampleRate'];});_0x7f5a2e['on'](_0xa1b0('0x17'),function(){fs[_0xa1b0('0x6d')](_0x4048d1,parseInt(_0xa1b0('0x5c'),0x8));return db[_0xa1b0('0x2c')][_0xa1b0('0x50')](_0xdf7c10)[_0xa1b0('0x22')](function(_0x3387c6){var _0xa4472d={'role':_0x4d1bbf[_0xa1b0('0x6e')][_0xa1b0('0x6f')],'userProfileId':_0x4d1bbf['body'][_0xa1b0('0x70')]};if(!_0xa4472d)throw new Error(_0xa1b0('0x71'));if(_0xa4472d[_0xa1b0('0x6f')]===_0xa1b0('0x72')){var _0x83ff56=_0x3387c6[_0xa1b0('0x24')]({'plain':!![]});return db[_0xa1b0('0x73')][_0xa1b0('0x45')]({'where':{'name':_0xa1b0('0x25'),'userProfileId':_0xa4472d['userProfileId']},'raw':!![]})[_0xa1b0('0x22')](function(_0x3f48b3){if(_0x3f48b3&&_0x3f48b3[_0xa1b0('0x74')]===0x0){return db[_0xa1b0('0x26')][_0xa1b0('0x50')]({'name':_0x83ff56[_0xa1b0('0x28')],'resourceId':_0x83ff56['id'],'type':_0x3f48b3[_0xa1b0('0x28')],'sectionId':_0x3f48b3['id']},{})[_0xa1b0('0x22')](function(){return _0x3387c6;});}else{return _0x3387c6;}})[_0xa1b0('0x40')](function(_0x1f0b58){logger[_0xa1b0('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f0b58);throw _0x1f0b58;});}return _0x3387c6;})[_0xa1b0('0x22')](respondWithResult(_0x2c23aa,null))[_0xa1b0('0x40')](handleError(_0x2c23aa,null));});_0x7f5a2e['start']();}catch(_0x51bc0a){_0x2c23aa[_0xa1b0('0x16')](0x1f4)[_0xa1b0('0x29')](_0x51bc0a);}};exports[_0xa1b0('0x21')]=function(_0x5866cd,_0xf5f354,_0x68a7e1){return db[_0xa1b0('0x2c')][_0xa1b0('0x45')]({'where':{'id':_0x5866cd[_0xa1b0('0x42')]['id']}})[_0xa1b0('0x22')](handleEntityNotFound(_0xf5f354,null))[_0xa1b0('0x22')](saveUpdates(_['pick'](_0x5866cd[_0xa1b0('0x6e')],[_0xa1b0('0x28'),_0xa1b0('0x75')]),null))['then'](respondWithResult(_0xf5f354,null))[_0xa1b0('0x40')](handleError(_0xf5f354,null));};exports[_0xa1b0('0x76')]=function(_0x3de966,_0x95f23f,_0x386d52){return db['Sound'][_0xa1b0('0x45')]({'where':{'id':_0x3de966[_0xa1b0('0x42')]['id']}})['then'](function(_0x55f676){if(_0x55f676){return _0x55f676[_0xa1b0('0x23')]();}})[_0xa1b0('0x22')](function(_0x3a414d){var _0x440ad4=path['join'](config[_0xa1b0('0x48')],_0xa1b0('0x59'),util[_0xa1b0('0x4e')]('%s.%s',_0x3a414d['save_name'],_0x3a414d[_0xa1b0('0x77')]));var _0x267e1f=path[_0xa1b0('0x58')](config[_0xa1b0('0x48')],'server/files/sounds/converted',util[_0xa1b0('0x4e')](_0xa1b0('0x4f'),_0x3a414d[_0xa1b0('0x4a')],_0x3a414d[_0xa1b0('0x4b')]));fs['unlinkSync'](_0x440ad4);fs[_0xa1b0('0x5d')](_0x267e1f);return _0x3a414d;})[_0xa1b0('0x22')](function(_0x22632c){if(_0x22632c){return _0x95f23f['status'](0xcc)[_0xa1b0('0x17')]();}})[_0xa1b0('0x22')](handleEntityNotFound(_0x95f23f,null))['catch'](handleError(_0x95f23f,null));};
\ No newline at end of file
index ab04d7c..801a137 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20ae=['util','api','request-promise','path','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','lodash'];(function(_0x3780c6,_0x126a4d){var _0xa2eae5=function(_0xf39820){while(--_0xf39820){_0x3780c6['push'](_0x3780c6['shift']());}};_0xa2eae5(++_0x126a4d);}(_0x20ae,0xd0));var _0xe20a=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x20ae[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0xe20a('0x0'));var util=require(_0xe20a('0x1'));var logger=require('../../config/logger')(_0xe20a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe20a('0x3'));var fs=require('fs');var path=require(_0xe20a('0x4'));var rimraf=require(_0xe20a('0x5'));var config=require('../../config/environment');var attributes=require(_0xe20a('0x6'));module[_0xe20a('0x7')]=function(_0x4e2407,_0x2acc50){return _0x4e2407[_0xe20a('0x8')](_0xe20a('0x9'),attributes,{'tableName':_0xe20a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x29ea=['request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','lodash','util','api','moment','bluebird'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x29ea,0x14d));var _0xa29e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x29ea[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa29e('0x0'));var util=require(_0xa29e('0x1'));var logger=require('../../config/logger')(_0xa29e('0x2'));var moment=require(_0xa29e('0x3'));var BPromise=require(_0xa29e('0x4'));var rp=require(_0xa29e('0x5'));var fs=require('fs');var path=require(_0xa29e('0x6'));var rimraf=require(_0xa29e('0x7'));var config=require(_0xa29e('0x8'));var attributes=require(_0xa29e('0x9'));module[_0xa29e('0xa')]=function(_0x44b59b,_0x551d02){return _0x44b59b[_0xa29e('0xb')](_0xa29e('0xc'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6866daf..ab58871 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd15=['find','options','where','attributes','include','map','model','then','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSound','Sound'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xdd15,0x169));var _0x5dd1=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0xdd15[_0x531d15];return _0x271a18;};'use strict';var _=require(_0x5dd1('0x0'));var util=require(_0x5dd1('0x1'));var moment=require(_0x5dd1('0x2'));var BPromise=require(_0x5dd1('0x3'));var rs=require(_0x5dd1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5dd1('0x5'));var logger=require(_0x5dd1('0x6'))(_0x5dd1('0x7'));var config=require(_0x5dd1('0x8'));var jayson=require(_0x5dd1('0x9'));var client=jayson['client'][_0x5dd1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea127,_0x5ccaec,_0x329149){return new BPromise(function(_0x1ff2ac,_0x50d0cf){return client[_0x5dd1('0xb')](_0x4ea127,_0x329149)['then'](function(_0x42a989){logger[_0x5dd1('0xc')](_0x5dd1('0xd'),_0x5ccaec,_0x5dd1('0xe'));logger[_0x5dd1('0xf')](_0x5dd1('0x10'),_0x5ccaec,_0x5dd1('0xe'),JSON['stringify'](_0x42a989));if(_0x42a989[_0x5dd1('0x11')]){if(_0x42a989['error'][_0x5dd1('0x12')]===0x1f4){logger[_0x5dd1('0x11')](_0x5dd1('0xd'),_0x5ccaec,_0x42a989[_0x5dd1('0x11')][_0x5dd1('0x13')]);return _0x50d0cf(_0x42a989['error'][_0x5dd1('0x13')]);}logger['error'](_0x5dd1('0xd'),_0x5ccaec,_0x42a989[_0x5dd1('0x11')][_0x5dd1('0x13')]);return _0x1ff2ac(_0x42a989[_0x5dd1('0x11')][_0x5dd1('0x13')]);}else{logger[_0x5dd1('0xc')](_0x5dd1('0xd'),_0x5ccaec,_0x5dd1('0xe'));_0x1ff2ac(_0x42a989['result'][_0x5dd1('0x13')]);}})[_0x5dd1('0x14')](function(_0x2c4144){logger[_0x5dd1('0x11')]('Sound,\x20%s,\x20%s',_0x5ccaec,_0x2c4144);_0x50d0cf(_0x2c4144);});});}exports[_0x5dd1('0x15')]=function(_0x3d512b){var _0x4296b5=this;return new Promise(function(_0x344362,_0x1da6d4){return db[_0x5dd1('0x16')][_0x5dd1('0x17')]({'raw':_0x3d512b['options']?_0x3d512b[_0x5dd1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3d512b[_0x5dd1('0x18')]?_0x3d512b[_0x5dd1('0x18')][_0x5dd1('0x19')]||null:null,'attributes':_0x3d512b[_0x5dd1('0x18')]?_0x3d512b[_0x5dd1('0x18')][_0x5dd1('0x1a')]||null:null,'include':_0x3d512b[_0x5dd1('0x18')]?_0x3d512b[_0x5dd1('0x18')][_0x5dd1('0x1b')]?_[_0x5dd1('0x1c')](_0x3d512b['options'][_0x5dd1('0x1b')],function(_0x29f300){return{'model':db[_0x29f300['model']],'as':_0x29f300['as'],'attributes':_0x29f300[_0x5dd1('0x1a')],'include':_0x29f300['include']?_['map'](_0x29f300[_0x5dd1('0x1b')],function(_0x2b0981){return{'model':db[_0x2b0981[_0x5dd1('0x1d')]],'as':_0x2b0981['as'],'attributes':_0x2b0981[_0x5dd1('0x1a')],'include':_0x2b0981['include']?_[_0x5dd1('0x1c')](_0x2b0981[_0x5dd1('0x1b')],function(_0x30a2de){return{'model':db[_0x30a2de['model']],'as':_0x30a2de['as'],'attributes':_0x30a2de['attributes']};}):[]};}):[]};}):[]:[]})[_0x5dd1('0x1e')](function(_0x9ed649){logger[_0x5dd1('0xc')](_0x5dd1('0x15'),_0x3d512b);logger[_0x5dd1('0xf')]('ShowSound',_0x3d512b,JSON[_0x5dd1('0x1f')](_0x9ed649));_0x344362(_0x9ed649);})[_0x5dd1('0x14')](function(_0x9142eb){logger[_0x5dd1('0x11')]('ShowSound',_0x9142eb[_0x5dd1('0x13')],_0x3d512b);_0x1da6d4(_0x4296b5[_0x5dd1('0x11')](0x1f4,_0x9142eb[_0x5dd1('0x13')]));});});};
\ No newline at end of file
+var _0x6389=['request\x20sent','debug','stringify','error','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','lodash','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'];(function(_0x6e7f4a,_0x5d114d){var _0x4407b6=function(_0x5d9525){while(--_0x5d9525){_0x6e7f4a['push'](_0x6e7f4a['shift']());}};_0x4407b6(++_0x5d114d);}(_0x6389,0x14c));var _0x9638=function(_0x25986f,_0x10785d){_0x25986f=_0x25986f-0x0;var _0x496221=_0x6389[_0x25986f];return _0x496221;};'use strict';var _=require(_0x9638('0x0'));var util=require(_0x9638('0x1'));var moment=require(_0x9638('0x2'));var BPromise=require(_0x9638('0x3'));var rs=require(_0x9638('0x4'));var fs=require('fs');var Redis=require(_0x9638('0x5'));var db=require(_0x9638('0x6'))['db'];var utils=require(_0x9638('0x7'));var logger=require(_0x9638('0x8'))(_0x9638('0x9'));var config=require(_0x9638('0xa'));var jayson=require(_0x9638('0xb'));var client=jayson[_0x9638('0xc')][_0x9638('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x575ca2,_0x488f04,_0x315819){return new BPromise(function(_0x372db0,_0x4262da){return client[_0x9638('0xe')](_0x575ca2,_0x315819)[_0x9638('0xf')](function(_0x5b5da3){logger[_0x9638('0x10')](_0x9638('0x11'),_0x488f04,_0x9638('0x12'));logger[_0x9638('0x13')]('Sound,\x20%s,\x20%s,\x20%s',_0x488f04,_0x9638('0x12'),JSON[_0x9638('0x14')](_0x5b5da3));if(_0x5b5da3[_0x9638('0x15')]){if(_0x5b5da3[_0x9638('0x15')]['code']===0x1f4){logger[_0x9638('0x15')](_0x9638('0x11'),_0x488f04,_0x5b5da3['error'][_0x9638('0x16')]);return _0x4262da(_0x5b5da3['error'][_0x9638('0x16')]);}logger[_0x9638('0x15')](_0x9638('0x11'),_0x488f04,_0x5b5da3[_0x9638('0x15')][_0x9638('0x16')]);return _0x372db0(_0x5b5da3[_0x9638('0x15')][_0x9638('0x16')]);}else{logger['info'](_0x9638('0x11'),_0x488f04,'request\x20sent');_0x372db0(_0x5b5da3[_0x9638('0x17')][_0x9638('0x16')]);}})[_0x9638('0x18')](function(_0x2d7635){logger[_0x9638('0x15')](_0x9638('0x11'),_0x488f04,_0x2d7635);_0x4262da(_0x2d7635);});});}exports[_0x9638('0x19')]=function(_0x2aab85){var _0x5bb4b7=this;return new Promise(function(_0xccb320,_0x54bc04){return db[_0x9638('0x1a')][_0x9638('0x1b')]({'raw':_0x2aab85['options']?_0x2aab85[_0x9638('0x1c')][_0x9638('0x1d')]===undefined?!![]:![]:!![],'where':_0x2aab85[_0x9638('0x1c')]?_0x2aab85[_0x9638('0x1c')][_0x9638('0x1e')]||null:null,'attributes':_0x2aab85['options']?_0x2aab85[_0x9638('0x1c')][_0x9638('0x1f')]||null:null,'include':_0x2aab85[_0x9638('0x1c')]?_0x2aab85['options'][_0x9638('0x20')]?_[_0x9638('0x21')](_0x2aab85[_0x9638('0x1c')]['include'],function(_0x324704){return{'model':db[_0x324704[_0x9638('0x22')]],'as':_0x324704['as'],'attributes':_0x324704[_0x9638('0x1f')],'include':_0x324704[_0x9638('0x20')]?_[_0x9638('0x21')](_0x324704[_0x9638('0x20')],function(_0x42647b){return{'model':db[_0x42647b[_0x9638('0x22')]],'as':_0x42647b['as'],'attributes':_0x42647b['attributes'],'include':_0x42647b[_0x9638('0x20')]?_[_0x9638('0x21')](_0x42647b[_0x9638('0x20')],function(_0xdea163){return{'model':db[_0xdea163[_0x9638('0x22')]],'as':_0xdea163['as'],'attributes':_0xdea163['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x34baf0){logger[_0x9638('0x10')](_0x9638('0x19'),_0x2aab85);logger[_0x9638('0x13')](_0x9638('0x19'),_0x2aab85,JSON['stringify'](_0x34baf0));_0xccb320(_0x34baf0);})['catch'](function(_0x288998){logger[_0x9638('0x15')](_0x9638('0x19'),_0x288998['message'],_0x2aab85);_0x54bc04(_0x5bb4b7[_0x9638('0x15')](0x1f4,_0x288998[_0x9638('0x16')]));});});};
\ No newline at end of file
index 96b1437..3c949b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2c8=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xb2c8,0x1ce));var _0x8b2c=function(_0x5e3806,_0x5c5c1b){_0x5e3806=_0x5e3806-0x0;var _0x25ccac=_0xb2c8[_0x5e3806];return _0x25ccac;};'use strict';var multer=require(_0x8b2c('0x0'));var util=require(_0x8b2c('0x1'));var path=require(_0x8b2c('0x2'));var timeout=require(_0x8b2c('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x8b2c('0x4'));var interaction=require(_0x8b2c('0x5'));var config=require('../../config/environment');var controller=require('./squareMessage.controller');router[_0x8b2c('0x6')]('/',auth[_0x8b2c('0x7')](),controller[_0x8b2c('0x8')]);router['get'](_0x8b2c('0x9'),auth[_0x8b2c('0x7')](),controller[_0x8b2c('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8b2c('0xb')]);router[_0x8b2c('0xc')]('/:id',auth[_0x8b2c('0x7')](),controller[_0x8b2c('0xd')]);router[_0x8b2c('0xe')]('/:id',auth[_0x8b2c('0x7')](),controller[_0x8b2c('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x157d=['./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','../../config/environment'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x157d,0x13e));var _0xd157=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x157d[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xd157('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd157('0x1'));var express=require(_0xd157('0x2'));var router=express[_0xd157('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd157('0x4'));var controller=require(_0xd157('0x5'));router[_0xd157('0x6')]('/',auth[_0xd157('0x7')](),controller[_0xd157('0x8')]);router[_0xd157('0x6')](_0xd157('0x9'),auth['isAuthenticated'](),controller[_0xd157('0xa')]);router[_0xd157('0xb')]('/',auth['isAuthenticated'](),controller[_0xd157('0xc')]);router[_0xd157('0xd')](_0xd157('0x9'),auth[_0xd157('0x7')](),controller[_0xd157('0xe')]);router['delete'](_0xd157('0x9'),auth['isAuthenticated'](),controller[_0xd157('0xf')]);module[_0xd157('0x10')]=router;
\ No newline at end of file
index 16e8d0f..3ebcd41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f16=['ENUM','out','sequelize','STRING','TEXT'];(function(_0x59edc5,_0x452840){var _0x345d3f=function(_0x1a785d){while(--_0x1a785d){_0x59edc5['push'](_0x59edc5['shift']());}};_0x345d3f(++_0x452840);}(_0x7f16,0xd4));var _0x67f1=function(_0x304c69,_0x335d76){_0x304c69=_0x304c69-0x0;var _0x30c438=_0x7f16[_0x304c69];return _0x30c438;};'use strict';var Sequelize=require(_0x67f1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x67f1('0x1')]},'body':{'type':Sequelize[_0x67f1('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x67f1('0x3')]('in',_0x67f1('0x4')),'defaultValue':_0x67f1('0x4'),'allowNull':![]}};
\ No newline at end of file
+var _0x6f54=['out','sequelize','exports','STRING','medium','ENUM'];(function(_0xbc82c2,_0x514272){var _0x1421d1=function(_0x17b4df){while(--_0x17b4df){_0xbc82c2['push'](_0xbc82c2['shift']());}};_0x1421d1(++_0x514272);}(_0x6f54,0x1ab));var _0x46f5=function(_0x3f08be,_0x1fea44){_0x3f08be=_0x3f08be-0x0;var _0x55f1c9=_0x6f54[_0x3f08be];return _0x55f1c9;};'use strict';var Sequelize=require(_0x46f5('0x0'));module[_0x46f5('0x1')]={'uniqueid':{'type':Sequelize[_0x46f5('0x2')]},'body':{'type':Sequelize['TEXT'](_0x46f5('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x46f5('0x4')]('in',_0x46f5('0x5')),'defaultValue':_0x46f5('0x5'),'allowNull':![]}};
\ No newline at end of file
index c8af5ba..6a23f1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1349=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x872f6f,_0x5efe7b){var _0x59a5f4=function(_0x147463){while(--_0x147463){_0x872f6f['push'](_0x872f6f['shift']());}};_0x59a5f4(++_0x5efe7b);}(_0x1349,0xc8));var _0x9134=function(_0x4b3ac0,_0x372d11){_0x4b3ac0=_0x4b3ac0-0x0;var _0x3f7ce6=_0x1349[_0x4b3ac0];return _0x3f7ce6;};'use strict';var pdf=require(_0x9134('0x0'));var emlformat=require(_0x9134('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9134('0x2'));var jsonpatch=require(_0x9134('0x3'));var rp=require(_0x9134('0x4'));var moment=require(_0x9134('0x5'));var BPromise=require(_0x9134('0x6'));var Mustache=require(_0x9134('0x7'));var util=require(_0x9134('0x8'));var path=require(_0x9134('0x9'));var sox=require('sox');var csv=require(_0x9134('0xa'));var ejs=require(_0x9134('0xb'));var fs=require('fs');var _=require(_0x9134('0xc'));var squel=require(_0x9134('0xd'));var crypto=require(_0x9134('0xe'));var jsforce=require(_0x9134('0xf'));var deskjs=require(_0x9134('0x10'));var toCsv=require(_0x9134('0xa'));var querystring=require('querystring');var Papa=require(_0x9134('0x11'));var Redis=require(_0x9134('0x12'));var authService=require(_0x9134('0x13'));var qs=require(_0x9134('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9134('0x15'));var logger=require(_0x9134('0x16'))('api');var utils=require(_0x9134('0x17'));var config=require(_0x9134('0x18'));var db=require(_0x9134('0x19'))['db'];function respondWithStatusCode(_0x329c34,_0x59f1f7){_0x59f1f7=_0x59f1f7||0xcc;return function(_0x566461){if(_0x566461){return _0x329c34[_0x9134('0x1a')](_0x59f1f7);}return _0x329c34['status'](_0x59f1f7)[_0x9134('0x1b')]();};}function respondWithResult(_0x107a83,_0x4f35ab){_0x4f35ab=_0x4f35ab||0xc8;return function(_0x42808c){if(_0x42808c){return _0x107a83[_0x9134('0x1c')](_0x4f35ab)[_0x9134('0x1d')](_0x42808c);}};}function respondWithFilteredResult(_0x30bccb,_0x1880ef){return function(_0x14e950){if(_0x14e950){var _0x14b0c0=_0x14e950[_0x9134('0x1e')],_0x59a149=_0x1880ef[_0x9134('0x1f')],_0x4104c2=_0x1880ef['offset']+_0x1880ef[_0x9134('0x20')],_0x2a538c;if(_0x4104c2>=_0x14b0c0){_0x4104c2=_0x14b0c0;_0x2a538c=0xc8;}else{_0x2a538c=0xce;}_0x30bccb['status'](_0x2a538c);return _0x30bccb['set'](_0x9134('0x21'),_0x59a149+'-'+_0x4104c2+'/'+_0x14b0c0)[_0x9134('0x1d')](_0x14e950);}return null;};}function patchUpdates(_0x7d4a73){return function(_0x249a4a){try{jsonpatch[_0x9134('0x22')](_0x249a4a,_0x7d4a73,!![]);}catch(_0x14c737){return BPromise['reject'](_0x14c737);}return _0x249a4a[_0x9134('0x23')]();};}function saveUpdates(_0x174ed6,_0x53f37b){return function(_0x40e78a){if(_0x40e78a){return _0x40e78a[_0x9134('0x24')](_0x174ed6)[_0x9134('0x25')](function(_0x597c07){return _0x597c07;});}return null;};}function removeEntity(_0x4cdcba,_0x348b24){return function(_0x34808c){if(_0x34808c){return _0x34808c[_0x9134('0x26')]()[_0x9134('0x25')](function(){_0x4cdcba[_0x9134('0x1c')](0xcc)[_0x9134('0x1b')]();});}};}function handleEntityNotFound(_0x4140d2,_0x42b371){return function(_0x310bec){if(!_0x310bec){_0x4140d2[_0x9134('0x1a')](0x194);}return _0x310bec;};}function handleError(_0x52c98f,_0x124d45){_0x124d45=_0x124d45||0x1f4;return function(_0x4d27f1){logger['error'](_0x4d27f1[_0x9134('0x27')]);if(_0x4d27f1[_0x9134('0x28')]){delete _0x4d27f1['name'];}_0x52c98f[_0x9134('0x1c')](_0x124d45)[_0x9134('0x29')](_0x4d27f1);};}exports['index']=function(_0x5644a9,_0x1b6231){var _0x2007ff={},_0x5e7141={},_0x4c850a={'count':0x0,'rows':[]};var _0x38f6ce=_[_0x9134('0x2a')](db[_0x9134('0x2b')][_0x9134('0x2c')],function(_0x40a295){return{'name':_0x40a295[_0x9134('0x2d')],'type':_0x40a295[_0x9134('0x2e')][_0x9134('0x2f')]};});_0x5e7141['model']=_[_0x9134('0x2a')](_0x38f6ce,_0x9134('0x28'));_0x5e7141[_0x9134('0x30')]=_[_0x9134('0x31')](_0x5644a9[_0x9134('0x30')]);_0x5e7141['filters']=_[_0x9134('0x32')](_0x5e7141['model'],_0x5e7141['query']);_0x2007ff[_0x9134('0x33')]=_['intersection'](_0x5e7141[_0x9134('0x34')],qs['fields'](_0x5644a9[_0x9134('0x30')]['fields']));_0x2007ff[_0x9134('0x33')]=_0x2007ff['attributes'][_0x9134('0x35')]?_0x2007ff[_0x9134('0x33')]:_0x5e7141[_0x9134('0x34')];if(!_0x5644a9['query'][_0x9134('0x36')]('nolimit')){_0x2007ff[_0x9134('0x20')]=qs['limit'](_0x5644a9['query'][_0x9134('0x20')]);_0x2007ff[_0x9134('0x1f')]=qs[_0x9134('0x1f')](_0x5644a9['query'][_0x9134('0x1f')]);}_0x2007ff[_0x9134('0x37')]=qs[_0x9134('0x38')](_0x5644a9[_0x9134('0x30')]['sort']);_0x2007ff[_0x9134('0x39')]=qs[_0x9134('0x3a')](_[_0x9134('0x3b')](_0x5644a9[_0x9134('0x30')],_0x5e7141[_0x9134('0x3a')]),_0x38f6ce);if(_0x5644a9['query'][_0x9134('0x3c')]){_0x2007ff[_0x9134('0x39')]=_[_0x9134('0x3d')](_0x2007ff[_0x9134('0x39')],{'$or':_[_0x9134('0x2a')](_0x38f6ce,function(_0x54aea2){if(_0x54aea2[_0x9134('0x2e')]!==_0x9134('0x3e')){var _0x281a27={};_0x281a27[_0x54aea2[_0x9134('0x28')]]={'$like':'%'+_0x5644a9[_0x9134('0x30')][_0x9134('0x3c')]+'%'};return _0x281a27;}})});}_0x2007ff=_[_0x9134('0x3d')]({},_0x2007ff,_0x5644a9[_0x9134('0x3f')]);var _0x3c9b5c={'where':_0x2007ff[_0x9134('0x39')]};return db['SquareMessage']['count'](_0x3c9b5c)[_0x9134('0x25')](function(_0x14a7a9){_0x4c850a['count']=_0x14a7a9;if(_0x5644a9['query'][_0x9134('0x40')]){_0x2007ff[_0x9134('0x41')]=[{'all':!![]}];}return db[_0x9134('0x2b')]['findAll'](_0x2007ff);})['then'](function(_0x122429){_0x4c850a[_0x9134('0x42')]=_0x122429;return _0x4c850a;})[_0x9134('0x25')](respondWithFilteredResult(_0x1b6231,_0x2007ff))[_0x9134('0x43')](handleError(_0x1b6231,null));};exports[_0x9134('0x44')]=function(_0x38a5aa,_0x3ee3bb){var _0x3effbe={'raw':!![],'where':{'id':_0x38a5aa[_0x9134('0x45')]['id']}},_0x371723={};_0x371723[_0x9134('0x34')]=_[_0x9134('0x31')](db[_0x9134('0x2b')][_0x9134('0x2c')]);_0x371723[_0x9134('0x30')]=_[_0x9134('0x31')](_0x38a5aa[_0x9134('0x30')]);_0x371723[_0x9134('0x3a')]=_['intersection'](_0x371723[_0x9134('0x34')],_0x371723[_0x9134('0x30')]);_0x3effbe[_0x9134('0x33')]=_[_0x9134('0x32')](_0x371723[_0x9134('0x34')],qs[_0x9134('0x46')](_0x38a5aa['query']['fields']));_0x3effbe['attributes']=_0x3effbe[_0x9134('0x33')][_0x9134('0x35')]?_0x3effbe['attributes']:_0x371723[_0x9134('0x34')];if(_0x38a5aa[_0x9134('0x30')][_0x9134('0x40')]){_0x3effbe[_0x9134('0x41')]=[{'all':!![]}];}_0x3effbe=_['merge']({},_0x3effbe,_0x38a5aa[_0x9134('0x3f')]);return db[_0x9134('0x2b')][_0x9134('0x47')](_0x3effbe)[_0x9134('0x25')](handleEntityNotFound(_0x3ee3bb,null))['then'](respondWithResult(_0x3ee3bb,null))[_0x9134('0x43')](handleError(_0x3ee3bb,null));};exports[_0x9134('0x48')]=function(_0x2d0eb3,_0x469f5d){return db[_0x9134('0x2b')][_0x9134('0x48')](_0x2d0eb3[_0x9134('0x49')],{})[_0x9134('0x25')](respondWithResult(_0x469f5d,0xc9))[_0x9134('0x43')](handleError(_0x469f5d,null));};exports[_0x9134('0x24')]=function(_0x243b82,_0x1af471){if(_0x243b82[_0x9134('0x49')]['id']){delete _0x243b82[_0x9134('0x49')]['id'];}return db['SquareMessage'][_0x9134('0x47')]({'where':{'id':_0x243b82['params']['id']}})[_0x9134('0x25')](handleEntityNotFound(_0x1af471,null))[_0x9134('0x25')](saveUpdates(_0x243b82[_0x9134('0x49')],null))['then'](respondWithResult(_0x1af471,null))[_0x9134('0x43')](handleError(_0x1af471,null));};exports[_0x9134('0x26')]=function(_0x489521,_0x37a81c){return db['SquareMessage'][_0x9134('0x47')]({'where':{'id':_0x489521[_0x9134('0x45')]['id']}})[_0x9134('0x25')](handleEntityNotFound(_0x37a81c,null))['then'](removeEntity(_0x37a81c,null))[_0x9134('0x43')](handleError(_0x37a81c,null));};
\ No newline at end of file
+var _0xe728=['reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','SquareMessage','count','includeAll','include','rows','catch','show','params','find','create','body','html-pdf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply'];(function(_0xfc91c8,_0x3a1001){var _0x85178e=function(_0x1d4f95){while(--_0x1d4f95){_0xfc91c8['push'](_0xfc91c8['shift']());}};_0x85178e(++_0x3a1001);}(_0xe728,0xfc));var _0x8e72=function(_0x3c66c9,_0x47ebc5){_0x3c66c9=_0x3c66c9-0x0;var _0x5580d6=_0xe728[_0x3c66c9];return _0x5580d6;};'use strict';var pdf=require(_0x8e72('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8e72('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8e72('0x2'));var Mustache=require(_0x8e72('0x3'));var util=require(_0x8e72('0x4'));var path=require(_0x8e72('0x5'));var sox=require(_0x8e72('0x6'));var csv=require(_0x8e72('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8e72('0x8'));var squel=require(_0x8e72('0x9'));var crypto=require(_0x8e72('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8e72('0x7'));var querystring=require(_0x8e72('0xb'));var Papa=require('papaparse');var Redis=require(_0x8e72('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x8e72('0xd'));var as=require(_0x8e72('0xe'));var hardwareService=require(_0x8e72('0xf'));var logger=require(_0x8e72('0x10'))('api');var utils=require(_0x8e72('0x11'));var config=require(_0x8e72('0x12'));var db=require(_0x8e72('0x13'))['db'];function respondWithStatusCode(_0x198d9c,_0x5ce37f){_0x5ce37f=_0x5ce37f||0xcc;return function(_0x9b39e3){if(_0x9b39e3){return _0x198d9c[_0x8e72('0x14')](_0x5ce37f);}return _0x198d9c[_0x8e72('0x15')](_0x5ce37f)[_0x8e72('0x16')]();};}function respondWithResult(_0xbd248,_0x3d92b0){_0x3d92b0=_0x3d92b0||0xc8;return function(_0x3013bd){if(_0x3013bd){return _0xbd248[_0x8e72('0x15')](_0x3d92b0)[_0x8e72('0x17')](_0x3013bd);}};}function respondWithFilteredResult(_0x9c3516,_0x22fa01){return function(_0x269c1e){if(_0x269c1e){var _0x229f4e=_0x269c1e['count'],_0x19b552=_0x22fa01[_0x8e72('0x18')],_0x4af83b=_0x22fa01[_0x8e72('0x18')]+_0x22fa01[_0x8e72('0x19')],_0x3d8120;if(_0x4af83b>=_0x229f4e){_0x4af83b=_0x229f4e;_0x3d8120=0xc8;}else{_0x3d8120=0xce;}_0x9c3516[_0x8e72('0x15')](_0x3d8120);return _0x9c3516[_0x8e72('0x1a')]('Content-Range',_0x19b552+'-'+_0x4af83b+'/'+_0x229f4e)[_0x8e72('0x17')](_0x269c1e);}return null;};}function patchUpdates(_0xa16b9e){return function(_0x4c9d91){try{jsonpatch[_0x8e72('0x1b')](_0x4c9d91,_0xa16b9e,!![]);}catch(_0x291d48){return BPromise[_0x8e72('0x1c')](_0x291d48);}return _0x4c9d91[_0x8e72('0x1d')]();};}function saveUpdates(_0x5358c2,_0x441d7a){return function(_0x505844){if(_0x505844){return _0x505844[_0x8e72('0x1e')](_0x5358c2)[_0x8e72('0x1f')](function(_0x25130e){return _0x25130e;});}return null;};}function removeEntity(_0x546157,_0x3d8d03){return function(_0x3ba227){if(_0x3ba227){return _0x3ba227[_0x8e72('0x20')]()[_0x8e72('0x1f')](function(){_0x546157[_0x8e72('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b56c1,_0x1a64a2){return function(_0x250e2f){if(!_0x250e2f){_0x3b56c1[_0x8e72('0x14')](0x194);}return _0x250e2f;};}function handleError(_0x14c6f8,_0x1b8c13){_0x1b8c13=_0x1b8c13||0x1f4;return function(_0x57c56d){logger[_0x8e72('0x21')](_0x57c56d[_0x8e72('0x22')]);if(_0x57c56d[_0x8e72('0x23')]){delete _0x57c56d[_0x8e72('0x23')];}_0x14c6f8[_0x8e72('0x15')](_0x1b8c13)[_0x8e72('0x24')](_0x57c56d);};}exports[_0x8e72('0x25')]=function(_0x50b723,_0x23105b){var _0x16de81={},_0x50bea3={},_0x1f20b8={'count':0x0,'rows':[]};var _0x4f7f21=_[_0x8e72('0x26')](db['SquareMessage'][_0x8e72('0x27')],function(_0x3a1fbc){return{'name':_0x3a1fbc[_0x8e72('0x28')],'type':_0x3a1fbc[_0x8e72('0x29')]['key']};});_0x50bea3['model']=_[_0x8e72('0x26')](_0x4f7f21,'name');_0x50bea3[_0x8e72('0x2a')]=_[_0x8e72('0x2b')](_0x50b723[_0x8e72('0x2a')]);_0x50bea3[_0x8e72('0x2c')]=_[_0x8e72('0x2d')](_0x50bea3[_0x8e72('0x2e')],_0x50bea3[_0x8e72('0x2a')]);_0x16de81[_0x8e72('0x2f')]=_[_0x8e72('0x2d')](_0x50bea3['model'],qs[_0x8e72('0x30')](_0x50b723['query'][_0x8e72('0x30')]));_0x16de81['attributes']=_0x16de81[_0x8e72('0x2f')][_0x8e72('0x31')]?_0x16de81[_0x8e72('0x2f')]:_0x50bea3[_0x8e72('0x2e')];if(!_0x50b723[_0x8e72('0x2a')][_0x8e72('0x32')]('nolimit')){_0x16de81['limit']=qs['limit'](_0x50b723['query']['limit']);_0x16de81[_0x8e72('0x18')]=qs['offset'](_0x50b723[_0x8e72('0x2a')][_0x8e72('0x18')]);}_0x16de81[_0x8e72('0x33')]=qs[_0x8e72('0x34')](_0x50b723['query'][_0x8e72('0x34')]);_0x16de81['where']=qs['filters'](_[_0x8e72('0x35')](_0x50b723[_0x8e72('0x2a')],_0x50bea3['filters']),_0x4f7f21);if(_0x50b723['query'][_0x8e72('0x36')]){_0x16de81[_0x8e72('0x37')]=_[_0x8e72('0x38')](_0x16de81[_0x8e72('0x37')],{'$or':_[_0x8e72('0x26')](_0x4f7f21,function(_0x232058){if(_0x232058[_0x8e72('0x29')]!==_0x8e72('0x39')){var _0x12973d={};_0x12973d[_0x232058[_0x8e72('0x23')]]={'$like':'%'+_0x50b723[_0x8e72('0x2a')][_0x8e72('0x36')]+'%'};return _0x12973d;}})});}_0x16de81=_['merge']({},_0x16de81,_0x50b723[_0x8e72('0x3a')]);var _0x57e816={'where':_0x16de81[_0x8e72('0x37')]};return db[_0x8e72('0x3b')][_0x8e72('0x3c')](_0x57e816)[_0x8e72('0x1f')](function(_0x369c82){_0x1f20b8[_0x8e72('0x3c')]=_0x369c82;if(_0x50b723[_0x8e72('0x2a')][_0x8e72('0x3d')]){_0x16de81[_0x8e72('0x3e')]=[{'all':!![]}];}return db[_0x8e72('0x3b')]['findAll'](_0x16de81);})['then'](function(_0x2ad235){_0x1f20b8[_0x8e72('0x3f')]=_0x2ad235;return _0x1f20b8;})[_0x8e72('0x1f')](respondWithFilteredResult(_0x23105b,_0x16de81))[_0x8e72('0x40')](handleError(_0x23105b,null));};exports[_0x8e72('0x41')]=function(_0x49e522,_0x27cc2b){var _0x3b7aff={'raw':!![],'where':{'id':_0x49e522[_0x8e72('0x42')]['id']}},_0x230aa8={};_0x230aa8[_0x8e72('0x2e')]=_[_0x8e72('0x2b')](db[_0x8e72('0x3b')][_0x8e72('0x27')]);_0x230aa8[_0x8e72('0x2a')]=_[_0x8e72('0x2b')](_0x49e522[_0x8e72('0x2a')]);_0x230aa8[_0x8e72('0x2c')]=_[_0x8e72('0x2d')](_0x230aa8['model'],_0x230aa8[_0x8e72('0x2a')]);_0x3b7aff[_0x8e72('0x2f')]=_['intersection'](_0x230aa8[_0x8e72('0x2e')],qs[_0x8e72('0x30')](_0x49e522[_0x8e72('0x2a')][_0x8e72('0x30')]));_0x3b7aff[_0x8e72('0x2f')]=_0x3b7aff[_0x8e72('0x2f')]['length']?_0x3b7aff[_0x8e72('0x2f')]:_0x230aa8[_0x8e72('0x2e')];if(_0x49e522[_0x8e72('0x2a')][_0x8e72('0x3d')]){_0x3b7aff['include']=[{'all':!![]}];}_0x3b7aff=_[_0x8e72('0x38')]({},_0x3b7aff,_0x49e522['options']);return db['SquareMessage'][_0x8e72('0x43')](_0x3b7aff)[_0x8e72('0x1f')](handleEntityNotFound(_0x27cc2b,null))[_0x8e72('0x1f')](respondWithResult(_0x27cc2b,null))['catch'](handleError(_0x27cc2b,null));};exports[_0x8e72('0x44')]=function(_0x744f02,_0x579e7f){return db[_0x8e72('0x3b')][_0x8e72('0x44')](_0x744f02['body'],{})[_0x8e72('0x1f')](respondWithResult(_0x579e7f,0xc9))[_0x8e72('0x40')](handleError(_0x579e7f,null));};exports[_0x8e72('0x1e')]=function(_0x5f05b7,_0x6af20b){if(_0x5f05b7[_0x8e72('0x45')]['id']){delete _0x5f05b7['body']['id'];}return db[_0x8e72('0x3b')][_0x8e72('0x43')]({'where':{'id':_0x5f05b7[_0x8e72('0x42')]['id']}})[_0x8e72('0x1f')](handleEntityNotFound(_0x6af20b,null))['then'](saveUpdates(_0x5f05b7[_0x8e72('0x45')],null))[_0x8e72('0x1f')](respondWithResult(_0x6af20b,null))[_0x8e72('0x40')](handleError(_0x6af20b,null));};exports['destroy']=function(_0x470cd9,_0x2ff547){return db['SquareMessage']['find']({'where':{'id':_0x470cd9[_0x8e72('0x42')]['id']}})['then'](handleEntityNotFound(_0x2ff547,null))[_0x8e72('0x1f')](removeEntity(_0x2ff547,null))[_0x8e72('0x40')](handleError(_0x2ff547,null));};
\ No newline at end of file
index 03f45df..26f26e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage','square_messages','lodash','util'];(function(_0xbefd3c,_0xbc56f0){var _0x253ad5=function(_0x284b82){while(--_0x284b82){_0xbefd3c['push'](_0xbefd3c['shift']());}};_0x253ad5(++_0xbc56f0);}(_0x7a54,0x106));var _0x47a5=function(_0x358cbf,_0x34e228){_0x358cbf=_0x358cbf-0x0;var _0x156c16=_0x7a54[_0x358cbf];return _0x156c16;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x814b=['define','SquareMessage','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareMessage.attributes','exports'];(function(_0x1ccbc7,_0x4ee7da){var _0x350dd1=function(_0x18eedb){while(--_0x18eedb){_0x1ccbc7['push'](_0x1ccbc7['shift']());}};_0x350dd1(++_0x4ee7da);}(_0x814b,0x1a2));var _0xb814=function(_0x161f59,_0x42e9ff){_0x161f59=_0x161f59-0x0;var _0x3ffa0e=_0x814b[_0x161f59];return _0x3ffa0e;};'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':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b6d3f31..3259eb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0650=['request\x20sent','stringify','error','message','info','result','CreateSquareMessage','SquareMessage','create','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','http','then','SquareMessage,\x20%s,\x20%s'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x0650,0x1aa));var _0x0065=function(_0x233ba9,_0x581b20){_0x233ba9=_0x233ba9-0x0;var _0x3704da=_0x0650[_0x233ba9];return _0x3704da;};'use strict';var _=require(_0x0065('0x0'));var util=require(_0x0065('0x1'));var moment=require(_0x0065('0x2'));var BPromise=require(_0x0065('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0065('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0065('0x5'))(_0x0065('0x6'));var config=require(_0x0065('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0065('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5792dc,_0x517b9f,_0x49d04d){return new BPromise(function(_0x576ca0,_0x25892a){return client['request'](_0x5792dc,_0x49d04d)[_0x0065('0x9')](function(_0x141e01){logger['info'](_0x0065('0xa'),_0x517b9f,_0x0065('0xb'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x517b9f,_0x0065('0xb'),JSON[_0x0065('0xc')](_0x141e01));if(_0x141e01[_0x0065('0xd')]){if(_0x141e01[_0x0065('0xd')]['code']===0x1f4){logger['error'](_0x0065('0xa'),_0x517b9f,_0x141e01['error']['message']);return _0x25892a(_0x141e01[_0x0065('0xd')]['message']);}logger[_0x0065('0xd')]('SquareMessage,\x20%s,\x20%s',_0x517b9f,_0x141e01['error'][_0x0065('0xe')]);return _0x576ca0(_0x141e01[_0x0065('0xd')][_0x0065('0xe')]);}else{logger[_0x0065('0xf')](_0x0065('0xa'),_0x517b9f,_0x0065('0xb'));_0x576ca0(_0x141e01[_0x0065('0x10')][_0x0065('0xe')]);}})['catch'](function(_0x26f491){logger[_0x0065('0xd')](_0x0065('0xa'),_0x517b9f,_0x26f491);_0x25892a(_0x26f491);});});}exports[_0x0065('0x11')]=function(_0x20adaa){var _0x9c1723=this;return new Promise(function(_0x244937,_0xcf4ea1){return db[_0x0065('0x12')][_0x0065('0x13')](_0x20adaa['body'],{'raw':_0x20adaa['options']?_0x20adaa[_0x0065('0x14')][_0x0065('0x15')]===undefined?!![]:![]:!![]})[_0x0065('0x9')](function(_0x2efd09){logger[_0x0065('0xf')](_0x0065('0x11'),_0x20adaa);logger['debug'](_0x0065('0x11'),_0x20adaa,JSON[_0x0065('0xc')](_0x2efd09));_0x244937(_0x2efd09);})[_0x0065('0x16')](function(_0x502c7a){logger[_0x0065('0xd')]('CreateSquareMessage',_0x502c7a[_0x0065('0xe')],_0x20adaa);_0xcf4ea1(_0x9c1723[_0x0065('0xd')](0x1f4,_0x502c7a[_0x0065('0xe')]));});});};
\ No newline at end of file
+var _0x8458=['body','options','raw','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateSquareMessage'];(function(_0x32c4d0,_0x4eded1){var _0x4b235c=function(_0x26cb8b){while(--_0x26cb8b){_0x32c4d0['push'](_0x32c4d0['shift']());}};_0x4b235c(++_0x4eded1);}(_0x8458,0x1a5));var _0x8845=function(_0x26e121,_0x4dd9a5){_0x26e121=_0x26e121-0x0;var _0x308357=_0x8458[_0x26e121];return _0x308357;};'use strict';var _=require(_0x8845('0x0'));var util=require('util');var moment=require(_0x8845('0x1'));var BPromise=require(_0x8845('0x2'));var rs=require(_0x8845('0x3'));var fs=require('fs');var Redis=require(_0x8845('0x4'));var db=require(_0x8845('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8845('0x6'))(_0x8845('0x7'));var config=require(_0x8845('0x8'));var jayson=require(_0x8845('0x9'));var client=jayson[_0x8845('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4099,_0x59d900,_0x2a91b4){return new BPromise(function(_0x3067d1,_0xd94398){return client['request'](_0x3c4099,_0x2a91b4)[_0x8845('0xb')](function(_0x33b0dc){logger['info'](_0x8845('0xc'),_0x59d900,_0x8845('0xd'));logger['debug'](_0x8845('0xe'),_0x59d900,_0x8845('0xd'),JSON[_0x8845('0xf')](_0x33b0dc));if(_0x33b0dc[_0x8845('0x10')]){if(_0x33b0dc[_0x8845('0x10')][_0x8845('0x11')]===0x1f4){logger[_0x8845('0x10')](_0x8845('0xc'),_0x59d900,_0x33b0dc[_0x8845('0x10')][_0x8845('0x12')]);return _0xd94398(_0x33b0dc[_0x8845('0x10')][_0x8845('0x12')]);}logger[_0x8845('0x10')](_0x8845('0xc'),_0x59d900,_0x33b0dc['error'][_0x8845('0x12')]);return _0x3067d1(_0x33b0dc[_0x8845('0x10')]['message']);}else{logger[_0x8845('0x13')](_0x8845('0xc'),_0x59d900,_0x8845('0xd'));_0x3067d1(_0x33b0dc['result']['message']);}})['catch'](function(_0x3c3864){logger[_0x8845('0x10')](_0x8845('0xc'),_0x59d900,_0x3c3864);_0xd94398(_0x3c3864);});});}exports[_0x8845('0x14')]=function(_0x10f1d5){var _0x27761f=this;return new Promise(function(_0x433170,_0x49c56a){return db['SquareMessage']['create'](_0x10f1d5[_0x8845('0x15')],{'raw':_0x10f1d5[_0x8845('0x16')]?_0x10f1d5[_0x8845('0x16')][_0x8845('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x2e94f5){logger['info']('CreateSquareMessage',_0x10f1d5);logger[_0x8845('0x18')](_0x8845('0x14'),_0x10f1d5,JSON['stringify'](_0x2e94f5));_0x433170(_0x2e94f5);})[_0x8845('0x19')](function(_0x23a0d3){logger['error'](_0x8845('0x14'),_0x23a0d3[_0x8845('0x12')],_0x10f1d5);_0x49c56a(_0x27761f[_0x8845('0x10')](0x1f4,_0x23a0d3[_0x8845('0x12')]));});});};
\ No newline at end of file
index cdbd8ab..40b1bea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4127=['/:id','update','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','15s','test','post','create','put'];(function(_0x4a2cd8,_0x13983c){var _0x6a647d=function(_0x33b87e){while(--_0x33b87e){_0x4a2cd8['push'](_0x4a2cd8['shift']());}};_0x6a647d(++_0x13983c);}(_0x4127,0x72));var _0x7412=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4127[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7412('0x0'));var util=require('util');var path=require(_0x7412('0x1'));var timeout=require(_0x7412('0x2'));var express=require('express');var router=express[_0x7412('0x3')]();var auth=require(_0x7412('0x4'));var interaction=require(_0x7412('0x5'));var config=require(_0x7412('0x6'));var controller=require(_0x7412('0x7'));router[_0x7412('0x8')]('/',auth[_0x7412('0x9')](),controller[_0x7412('0xa')]);router[_0x7412('0x8')]('/:id',auth[_0x7412('0x9')](),controller[_0x7412('0xb')]);router['get'](_0x7412('0xc'),auth[_0x7412('0x9')](),timeout(_0x7412('0xd')),controller[_0x7412('0xe')]);router[_0x7412('0xf')]('/',auth[_0x7412('0x9')](),controller[_0x7412('0x10')]);router[_0x7412('0x11')](_0x7412('0x12'),auth['isAuthenticated'](),controller[_0x7412('0x13')]);router[_0x7412('0x14')]('/:id',auth[_0x7412('0x9')](),controller[_0x7412('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x7d91=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','/:id','isAuthenticated','show','/:id/test','15s','post','create','put','exports','util'];(function(_0x29e7f0,_0x56e947){var _0x391b64=function(_0x2541f9){while(--_0x2541f9){_0x29e7f0['push'](_0x29e7f0['shift']());}};_0x391b64(++_0x56e947);}(_0x7d91,0x10f));var _0x17d9=function(_0x45dacb,_0x4b50b2){_0x45dacb=_0x45dacb-0x0;var _0x1b8c13=_0x7d91[_0x45dacb];return _0x1b8c13;};'use strict';var multer=require('multer');var util=require(_0x17d9('0x0'));var path=require('path');var timeout=require(_0x17d9('0x1'));var express=require(_0x17d9('0x2'));var router=express[_0x17d9('0x3')]();var auth=require(_0x17d9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x17d9('0x5'));var controller=require(_0x17d9('0x6'));router[_0x17d9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x17d9('0x8'),auth[_0x17d9('0x9')](),controller[_0x17d9('0xa')]);router[_0x17d9('0x7')](_0x17d9('0xb'),auth['isAuthenticated'](),timeout(_0x17d9('0xc')),controller['test']);router[_0x17d9('0xd')]('/',auth[_0x17d9('0x9')](),controller[_0x17d9('0xe')]);router[_0x17d9('0xf')](_0x17d9('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x17d9('0x8'),auth[_0x17d9('0x9')](),controller['destroy']);module[_0x17d9('0x10')]=router;
\ No newline at end of file
index 24ba673..0dc851e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc58=['STRING','name','sequelize','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbc58,0x162));var _0x8bc5=function(_0x8f2524,_0xec48ba){_0x8f2524=_0x8f2524-0x0;var _0x171af3=_0xbc58[_0x8f2524];return _0x171af3;};'use strict';var Sequelize=require(_0x8bc5('0x0'));module[_0x8bc5('0x1')]={'name':{'type':Sequelize[_0x8bc5('0x2')],'unique':_0x8bc5('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x8bc5('0x2')]},'description':{'type':Sequelize[_0x8bc5('0x2')]}};
\ No newline at end of file
+var _0xd530=['name','sequelize','exports','STRING'];(function(_0x398423,_0x227dbe){var _0x5e9555=function(_0x5bee5f){while(--_0x5bee5f){_0x398423['push'](_0x398423['shift']());}};_0x5e9555(++_0x227dbe);}(_0xd530,0xdd));var _0x0d53=function(_0x43beb7,_0x339a88){_0x43beb7=_0x43beb7-0x0;var _0xc06e66=_0xd530[_0x43beb7];return _0xc06e66;};'use strict';var Sequelize=require(_0x0d53('0x0'));module[_0x0d53('0x1')]={'name':{'type':Sequelize[_0x0d53('0x2')],'unique':_0x0d53('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0d53('0x2')]},'description':{'type':Sequelize[_0x0d53('0x2')]}};
\ No newline at end of file
index 3a26da5..9f39389 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28ea=['desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','stack','name','send','index','type','key','map','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','SquareOdbc','include','findAll','catch','show','params','rawAttributes','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','dsn','odbc','openSync','closeSync','eml-format','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x1bef2a,_0x5becb3){var _0x10f24b=function(_0x1b9b83){while(--_0x1b9b83){_0x1bef2a['push'](_0x1bef2a['shift']());}};_0x10f24b(++_0x5becb3);}(_0x28ea,0x139));var _0xa28e=function(_0x356916,_0x5b963a){_0x356916=_0x356916-0x0;var _0x40c4a0=_0x28ea[_0x356916];return _0x40c4a0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa28e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa28e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa28e('0x2'));var moment=require('moment');var BPromise=require(_0xa28e('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa28e('0x4'));var sox=require(_0xa28e('0x5'));var csv=require(_0xa28e('0x6'));var ejs=require(_0xa28e('0x7'));var fs=require('fs');var _=require(_0xa28e('0x8'));var squel=require('squel');var crypto=require(_0xa28e('0x9'));var jsforce=require(_0xa28e('0xa'));var deskjs=require(_0xa28e('0xb'));var toCsv=require(_0xa28e('0x6'));var querystring=require(_0xa28e('0xc'));var Papa=require(_0xa28e('0xd'));var Redis=require('ioredis');var authService=require(_0xa28e('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa28e('0xf'));var logger=require(_0xa28e('0x10'))(_0xa28e('0x11'));var utils=require(_0xa28e('0x12'));var config=require(_0xa28e('0x13'));var db=require(_0xa28e('0x14'))['db'];function respondWithStatusCode(_0x14ddc4,_0x46d9a8){_0x46d9a8=_0x46d9a8||0xcc;return function(_0x459895){if(_0x459895){return _0x14ddc4[_0xa28e('0x15')](_0x46d9a8);}return _0x14ddc4[_0xa28e('0x16')](_0x46d9a8)[_0xa28e('0x17')]();};}function respondWithResult(_0x5c63e5,_0x31ee80){_0x31ee80=_0x31ee80||0xc8;return function(_0x165d73){if(_0x165d73){return _0x5c63e5[_0xa28e('0x16')](_0x31ee80)[_0xa28e('0x18')](_0x165d73);}};}function respondWithFilteredResult(_0x272156,_0x35a9ce){return function(_0x244272){if(_0x244272){var _0x5ae9fa=_0x244272[_0xa28e('0x19')],_0x19a2b7=_0x35a9ce[_0xa28e('0x1a')],_0x3d9f06=_0x35a9ce[_0xa28e('0x1a')]+_0x35a9ce[_0xa28e('0x1b')],_0x520958;if(_0x3d9f06>=_0x5ae9fa){_0x3d9f06=_0x5ae9fa;_0x520958=0xc8;}else{_0x520958=0xce;}_0x272156['status'](_0x520958);return _0x272156['set'](_0xa28e('0x1c'),_0x19a2b7+'-'+_0x3d9f06+'/'+_0x5ae9fa)[_0xa28e('0x18')](_0x244272);}return null;};}function patchUpdates(_0x4fcb48){return function(_0x3c10ed){try{jsonpatch[_0xa28e('0x1d')](_0x3c10ed,_0x4fcb48,!![]);}catch(_0x32e25b){return BPromise[_0xa28e('0x1e')](_0x32e25b);}return _0x3c10ed[_0xa28e('0x1f')]();};}function saveUpdates(_0x1fb2d1,_0x2c2712){return function(_0xcd90bd){if(_0xcd90bd){return _0xcd90bd['update'](_0x1fb2d1)[_0xa28e('0x20')](function(_0x514cde){return _0x514cde;});}return null;};}function removeEntity(_0xe73a1e,_0x5ad456){return function(_0x54d675){if(_0x54d675){return _0x54d675[_0xa28e('0x21')]()[_0xa28e('0x20')](function(){var _0x4ad403=_0x54d675[_0xa28e('0x22')]({'plain':!![]});var _0x2db5f2=_0xa28e('0x23');return db[_0xa28e('0x24')]['destroy']({'where':{'type':_0x2db5f2,'resourceId':_0x4ad403['id']}})['then'](function(){return _0x54d675;});})[_0xa28e('0x20')](function(){_0xe73a1e[_0xa28e('0x16')](0xcc)[_0xa28e('0x17')]();});}};}function handleEntityNotFound(_0x3ebdef,_0x3a7d05){return function(_0x386b74){if(!_0x386b74){_0x3ebdef[_0xa28e('0x15')](0x194);}return _0x386b74;};}function handleError(_0x311540,_0x15f22f){_0x15f22f=_0x15f22f||0x1f4;return function(_0x1fcff6){logger['error'](_0x1fcff6[_0xa28e('0x25')]);if(_0x1fcff6[_0xa28e('0x26')]){delete _0x1fcff6['name'];}_0x311540['status'](_0x15f22f)[_0xa28e('0x27')](_0x1fcff6);};}exports[_0xa28e('0x28')]=function(_0x14caae,_0xc2cdd4){var _0x3a8f4b={},_0xaaf84c={},_0x18bcd4={'count':0x0,'rows':[]};var _0x23ec2e=_['map'](db['SquareOdbc']['rawAttributes'],function(_0x11961a){return{'name':_0x11961a['fieldName'],'type':_0x11961a[_0xa28e('0x29')][_0xa28e('0x2a')]};});_0xaaf84c['model']=_[_0xa28e('0x2b')](_0x23ec2e,_0xa28e('0x26'));_0xaaf84c[_0xa28e('0x2c')]=_['keys'](_0x14caae[_0xa28e('0x2c')]);_0xaaf84c['filters']=_[_0xa28e('0x2d')](_0xaaf84c['model'],_0xaaf84c[_0xa28e('0x2c')]);_0x3a8f4b[_0xa28e('0x2e')]=_[_0xa28e('0x2d')](_0xaaf84c[_0xa28e('0x2f')],qs[_0xa28e('0x30')](_0x14caae[_0xa28e('0x2c')][_0xa28e('0x30')]));_0x3a8f4b[_0xa28e('0x2e')]=_0x3a8f4b[_0xa28e('0x2e')][_0xa28e('0x31')]?_0x3a8f4b['attributes']:_0xaaf84c[_0xa28e('0x2f')];if(!_0x14caae[_0xa28e('0x2c')][_0xa28e('0x32')](_0xa28e('0x33'))){_0x3a8f4b['limit']=qs[_0xa28e('0x1b')](_0x14caae[_0xa28e('0x2c')]['limit']);_0x3a8f4b[_0xa28e('0x1a')]=qs['offset'](_0x14caae[_0xa28e('0x2c')]['offset']);}_0x3a8f4b[_0xa28e('0x34')]=qs[_0xa28e('0x35')](_0x14caae[_0xa28e('0x2c')][_0xa28e('0x35')]);_0x3a8f4b[_0xa28e('0x36')]=qs[_0xa28e('0x37')](_['pick'](_0x14caae[_0xa28e('0x2c')],_0xaaf84c[_0xa28e('0x37')]),_0x23ec2e);if(_0x14caae['query'][_0xa28e('0x38')]){_0x3a8f4b[_0xa28e('0x36')]=_[_0xa28e('0x39')](_0x3a8f4b[_0xa28e('0x36')],{'$or':_[_0xa28e('0x2b')](_0x23ec2e,function(_0x5084ea){if(_0x5084ea[_0xa28e('0x29')]!=='VIRTUAL'){var _0x4b098b={};_0x4b098b[_0x5084ea[_0xa28e('0x26')]]={'$like':'%'+_0x14caae[_0xa28e('0x2c')][_0xa28e('0x38')]+'%'};return _0x4b098b;}})});}_0x3a8f4b=_[_0xa28e('0x39')]({},_0x3a8f4b,_0x14caae[_0xa28e('0x3a')]);var _0x3fba8e={'where':_0x3a8f4b[_0xa28e('0x36')]};return db[_0xa28e('0x3b')]['count'](_0x3fba8e)['then'](function(_0x41ffee){_0x18bcd4['count']=_0x41ffee;if(_0x14caae[_0xa28e('0x2c')]['includeAll']){_0x3a8f4b[_0xa28e('0x3c')]=[{'all':!![]}];}return db[_0xa28e('0x3b')][_0xa28e('0x3d')](_0x3a8f4b);})[_0xa28e('0x20')](function(_0x285351){_0x18bcd4['rows']=_0x285351;return _0x18bcd4;})[_0xa28e('0x20')](respondWithFilteredResult(_0xc2cdd4,_0x3a8f4b))[_0xa28e('0x3e')](handleError(_0xc2cdd4,null));};exports[_0xa28e('0x3f')]=function(_0x49243f,_0x262917){var _0x2d3c69={'raw':!![],'where':{'id':_0x49243f[_0xa28e('0x40')]['id']}},_0x3751b5={};_0x3751b5['model']=_['keys'](db['SquareOdbc'][_0xa28e('0x41')]);_0x3751b5[_0xa28e('0x2c')]=_[_0xa28e('0x42')](_0x49243f['query']);_0x3751b5['filters']=_['intersection'](_0x3751b5['model'],_0x3751b5[_0xa28e('0x2c')]);_0x2d3c69['attributes']=_[_0xa28e('0x2d')](_0x3751b5['model'],qs[_0xa28e('0x30')](_0x49243f[_0xa28e('0x2c')]['fields']));_0x2d3c69[_0xa28e('0x2e')]=_0x2d3c69[_0xa28e('0x2e')]['length']?_0x2d3c69[_0xa28e('0x2e')]:_0x3751b5[_0xa28e('0x2f')];if(_0x49243f[_0xa28e('0x2c')]['includeAll']){_0x2d3c69['include']=[{'all':!![]}];}_0x2d3c69=_['merge']({},_0x2d3c69,_0x49243f[_0xa28e('0x3a')]);return db[_0xa28e('0x3b')][_0xa28e('0x43')](_0x2d3c69)[_0xa28e('0x20')](handleEntityNotFound(_0x262917,null))[_0xa28e('0x20')](respondWithResult(_0x262917,null))['catch'](handleError(_0x262917,null));};exports[_0xa28e('0x44')]=function(_0x2657ff,_0x87485e){return db['SquareOdbc']['create'](_0x2657ff[_0xa28e('0x45')],{})[_0xa28e('0x20')](function(_0x1b18db){var _0x57ebb3=_0x2657ff[_0xa28e('0x46')][_0xa28e('0x22')]({'plain':!![]});if(!_0x57ebb3)throw new Error(_0xa28e('0x47'));if(_0x57ebb3[_0xa28e('0x48')]===_0xa28e('0x46')){var _0x2a080a=_0x1b18db[_0xa28e('0x22')]({'plain':!![]});var _0x3e512b=_0xa28e('0x23');return db['UserProfileSection'][_0xa28e('0x43')]({'where':{'name':_0x3e512b,'userProfileId':_0x57ebb3[_0xa28e('0x49')]},'raw':!![]})[_0xa28e('0x20')](function(_0x157f4){if(_0x157f4&&_0x157f4['autoAssociation']===0x0){return db[_0xa28e('0x24')][_0xa28e('0x44')]({'name':_0x2a080a[_0xa28e('0x26')],'resourceId':_0x2a080a['id'],'type':_0x157f4[_0xa28e('0x26')],'sectionId':_0x157f4['id']},{})['then'](function(){return _0x1b18db;});}else{return _0x1b18db;}})['catch'](function(_0x53bf60){logger[_0xa28e('0x4a')](_0xa28e('0x4b'),_0x53bf60);throw _0x53bf60;});}return _0x1b18db;})['then'](respondWithResult(_0x87485e,0xc9))[_0xa28e('0x3e')](handleError(_0x87485e,null));};exports[_0xa28e('0x4c')]=function(_0x344166,_0x28dbd2){if(_0x344166[_0xa28e('0x45')]['id']){delete _0x344166[_0xa28e('0x45')]['id'];}return db[_0xa28e('0x3b')][_0xa28e('0x43')]({'where':{'id':_0x344166['params']['id']}})['then'](handleEntityNotFound(_0x28dbd2,null))['then'](saveUpdates(_0x344166['body'],null))['then'](respondWithResult(_0x28dbd2,null))['catch'](handleError(_0x28dbd2,null));};exports[_0xa28e('0x21')]=function(_0x170ceb,_0x165010){return db[_0xa28e('0x3b')][_0xa28e('0x43')]({'where':{'id':_0x170ceb['params']['id']}})[_0xa28e('0x20')](handleEntityNotFound(_0x165010,null))[_0xa28e('0x20')](removeEntity(_0x165010,null))[_0xa28e('0x3e')](handleError(_0x165010,null));};exports['test']=function(_0x1a6105,_0x57401f,_0x34af87){var _0x59f657;return db[_0xa28e('0x3b')]['find']({'where':{'id':_0x1a6105['params']['id']},'attributes':['id',_0xa28e('0x4d')]})[_0xa28e('0x20')](handleEntityNotFound(_0x57401f,null))[_0xa28e('0x20')](function(_0x1923e3){if(_0x1923e3){var _0x277e2a=require(_0xa28e('0x4e'))();_0x277e2a[_0xa28e('0x4f')](_0x1923e3[_0xa28e('0x4d')]);_0x277e2a[_0xa28e('0x50')]();return _0x1923e3;}})[_0xa28e('0x20')](respondWithResult(_0x57401f,null))[_0xa28e('0x3e')](handleError(_0x57401f,null));};
\ No newline at end of file
+var _0x5613=['../../mysqldb','status','offset','limit','set','apply','reject','then','destroy','get','ODBC','UserProfileResource','end','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','dsn','odbc','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5613,0x8f));var _0x3561=function(_0x89a540,_0x36e397){_0x89a540=_0x89a540-0x0;var _0x22794d=_0x5613[_0x89a540];return _0x22794d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3561('0x0'));var rimraf=require(_0x3561('0x1'));var zipdir=require(_0x3561('0x2'));var jsonpatch=require(_0x3561('0x3'));var rp=require(_0x3561('0x4'));var moment=require(_0x3561('0x5'));var BPromise=require(_0x3561('0x6'));var Mustache=require('mustache');var util=require(_0x3561('0x7'));var path=require(_0x3561('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3561('0x9'));var squel=require('squel');var crypto=require(_0x3561('0xa'));var jsforce=require(_0x3561('0xb'));var deskjs=require(_0x3561('0xc'));var toCsv=require(_0x3561('0xd'));var querystring=require(_0x3561('0xe'));var Papa=require(_0x3561('0xf'));var Redis=require(_0x3561('0x10'));var authService=require(_0x3561('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3561('0x12'))(_0x3561('0x13'));var utils=require('../../config/utils');var config=require(_0x3561('0x14'));var db=require(_0x3561('0x15'))['db'];function respondWithStatusCode(_0x1c3652,_0x109003){_0x109003=_0x109003||0xcc;return function(_0x1be381){if(_0x1be381){return _0x1c3652['sendStatus'](_0x109003);}return _0x1c3652[_0x3561('0x16')](_0x109003)['end']();};}function respondWithResult(_0x2c206e,_0x1343a6){_0x1343a6=_0x1343a6||0xc8;return function(_0x3511e6){if(_0x3511e6){return _0x2c206e['status'](_0x1343a6)['json'](_0x3511e6);}};}function respondWithFilteredResult(_0x11237b,_0x5a5927){return function(_0x2d9dbc){if(_0x2d9dbc){var _0x538a6f=_0x2d9dbc['count'],_0x399aaa=_0x5a5927[_0x3561('0x17')],_0x1f24e7=_0x5a5927[_0x3561('0x17')]+_0x5a5927[_0x3561('0x18')],_0x481b61;if(_0x1f24e7>=_0x538a6f){_0x1f24e7=_0x538a6f;_0x481b61=0xc8;}else{_0x481b61=0xce;}_0x11237b[_0x3561('0x16')](_0x481b61);return _0x11237b[_0x3561('0x19')]('Content-Range',_0x399aaa+'-'+_0x1f24e7+'/'+_0x538a6f)['json'](_0x2d9dbc);}return null;};}function patchUpdates(_0x4cfed8){return function(_0x185365){try{jsonpatch[_0x3561('0x1a')](_0x185365,_0x4cfed8,!![]);}catch(_0xade305){return BPromise[_0x3561('0x1b')](_0xade305);}return _0x185365['save']();};}function saveUpdates(_0x345f65,_0x1a15c7){return function(_0x11985f){if(_0x11985f){return _0x11985f['update'](_0x345f65)[_0x3561('0x1c')](function(_0x1b7b95){return _0x1b7b95;});}return null;};}function removeEntity(_0x562b2c,_0x4aff29){return function(_0x435771){if(_0x435771){return _0x435771[_0x3561('0x1d')]()[_0x3561('0x1c')](function(){var _0x5d43de=_0x435771[_0x3561('0x1e')]({'plain':!![]});var _0x2916c0=_0x3561('0x1f');return db[_0x3561('0x20')][_0x3561('0x1d')]({'where':{'type':_0x2916c0,'resourceId':_0x5d43de['id']}})['then'](function(){return _0x435771;});})[_0x3561('0x1c')](function(){_0x562b2c[_0x3561('0x16')](0xcc)[_0x3561('0x21')]();});}};}function handleEntityNotFound(_0x25f496,_0x16d009){return function(_0x1a9e60){if(!_0x1a9e60){_0x25f496['sendStatus'](0x194);}return _0x1a9e60;};}function handleError(_0x860487,_0x4ad5d5){_0x4ad5d5=_0x4ad5d5||0x1f4;return function(_0x3ba704){logger[_0x3561('0x22')](_0x3ba704[_0x3561('0x23')]);if(_0x3ba704[_0x3561('0x24')]){delete _0x3ba704[_0x3561('0x24')];}_0x860487[_0x3561('0x16')](_0x4ad5d5)[_0x3561('0x25')](_0x3ba704);};}exports['index']=function(_0x133ecc,_0x3f6189){var _0x2beede={},_0xcb843c={},_0x4b2e13={'count':0x0,'rows':[]};var _0x4639d9=_[_0x3561('0x26')](db[_0x3561('0x27')][_0x3561('0x28')],function(_0x4a759c){return{'name':_0x4a759c[_0x3561('0x29')],'type':_0x4a759c[_0x3561('0x2a')][_0x3561('0x2b')]};});_0xcb843c[_0x3561('0x2c')]=_['map'](_0x4639d9,_0x3561('0x24'));_0xcb843c[_0x3561('0x2d')]=_['keys'](_0x133ecc[_0x3561('0x2d')]);_0xcb843c[_0x3561('0x2e')]=_[_0x3561('0x2f')](_0xcb843c[_0x3561('0x2c')],_0xcb843c[_0x3561('0x2d')]);_0x2beede['attributes']=_[_0x3561('0x2f')](_0xcb843c[_0x3561('0x2c')],qs[_0x3561('0x30')](_0x133ecc[_0x3561('0x2d')][_0x3561('0x30')]));_0x2beede[_0x3561('0x31')]=_0x2beede[_0x3561('0x31')]['length']?_0x2beede[_0x3561('0x31')]:_0xcb843c[_0x3561('0x2c')];if(!_0x133ecc[_0x3561('0x2d')][_0x3561('0x32')](_0x3561('0x33'))){_0x2beede[_0x3561('0x18')]=qs['limit'](_0x133ecc['query'][_0x3561('0x18')]);_0x2beede[_0x3561('0x17')]=qs['offset'](_0x133ecc[_0x3561('0x2d')]['offset']);}_0x2beede[_0x3561('0x34')]=qs[_0x3561('0x35')](_0x133ecc[_0x3561('0x2d')][_0x3561('0x35')]);_0x2beede[_0x3561('0x36')]=qs['filters'](_['pick'](_0x133ecc[_0x3561('0x2d')],_0xcb843c[_0x3561('0x2e')]),_0x4639d9);if(_0x133ecc[_0x3561('0x2d')]['filter']){_0x2beede[_0x3561('0x36')]=_['merge'](_0x2beede[_0x3561('0x36')],{'$or':_[_0x3561('0x26')](_0x4639d9,function(_0x42ce39){if(_0x42ce39[_0x3561('0x2a')]!=='VIRTUAL'){var _0x2f1c76={};_0x2f1c76[_0x42ce39[_0x3561('0x24')]]={'$like':'%'+_0x133ecc[_0x3561('0x2d')][_0x3561('0x37')]+'%'};return _0x2f1c76;}})});}_0x2beede=_[_0x3561('0x38')]({},_0x2beede,_0x133ecc[_0x3561('0x39')]);var _0x1ffc6e={'where':_0x2beede[_0x3561('0x36')]};return db[_0x3561('0x27')]['count'](_0x1ffc6e)[_0x3561('0x1c')](function(_0x5db2e8){_0x4b2e13[_0x3561('0x3a')]=_0x5db2e8;if(_0x133ecc['query'][_0x3561('0x3b')]){_0x2beede[_0x3561('0x3c')]=[{'all':!![]}];}return db[_0x3561('0x27')][_0x3561('0x3d')](_0x2beede);})[_0x3561('0x1c')](function(_0x42551a){_0x4b2e13[_0x3561('0x3e')]=_0x42551a;return _0x4b2e13;})[_0x3561('0x1c')](respondWithFilteredResult(_0x3f6189,_0x2beede))[_0x3561('0x3f')](handleError(_0x3f6189,null));};exports[_0x3561('0x40')]=function(_0x31251a,_0x1e7433){var _0xc17f88={'raw':!![],'where':{'id':_0x31251a[_0x3561('0x41')]['id']}},_0x28412f={};_0x28412f[_0x3561('0x2c')]=_[_0x3561('0x42')](db['SquareOdbc'][_0x3561('0x28')]);_0x28412f[_0x3561('0x2d')]=_[_0x3561('0x42')](_0x31251a[_0x3561('0x2d')]);_0x28412f[_0x3561('0x2e')]=_[_0x3561('0x2f')](_0x28412f['model'],_0x28412f[_0x3561('0x2d')]);_0xc17f88[_0x3561('0x31')]=_[_0x3561('0x2f')](_0x28412f[_0x3561('0x2c')],qs[_0x3561('0x30')](_0x31251a[_0x3561('0x2d')][_0x3561('0x30')]));_0xc17f88[_0x3561('0x31')]=_0xc17f88[_0x3561('0x31')][_0x3561('0x43')]?_0xc17f88[_0x3561('0x31')]:_0x28412f['model'];if(_0x31251a[_0x3561('0x2d')][_0x3561('0x3b')]){_0xc17f88['include']=[{'all':!![]}];}_0xc17f88=_[_0x3561('0x38')]({},_0xc17f88,_0x31251a[_0x3561('0x39')]);return db[_0x3561('0x27')]['find'](_0xc17f88)[_0x3561('0x1c')](handleEntityNotFound(_0x1e7433,null))[_0x3561('0x1c')](respondWithResult(_0x1e7433,null))[_0x3561('0x3f')](handleError(_0x1e7433,null));};exports[_0x3561('0x44')]=function(_0x2e70e4,_0x359337){return db[_0x3561('0x27')]['create'](_0x2e70e4['body'],{})[_0x3561('0x1c')](function(_0x5132c7){var _0x2b7929=_0x2e70e4[_0x3561('0x45')]['get']({'plain':!![]});if(!_0x2b7929)throw new Error(_0x3561('0x46'));if(_0x2b7929['role']==='user'){var _0x34ef4f=_0x5132c7[_0x3561('0x1e')]({'plain':!![]});var _0x29ab77='ODBC';return db[_0x3561('0x47')][_0x3561('0x48')]({'where':{'name':_0x29ab77,'userProfileId':_0x2b7929[_0x3561('0x49')]},'raw':!![]})[_0x3561('0x1c')](function(_0x5417f3){if(_0x5417f3&&_0x5417f3[_0x3561('0x4a')]===0x0){return db[_0x3561('0x20')]['create']({'name':_0x34ef4f[_0x3561('0x24')],'resourceId':_0x34ef4f['id'],'type':_0x5417f3[_0x3561('0x24')],'sectionId':_0x5417f3['id']},{})['then'](function(){return _0x5132c7;});}else{return _0x5132c7;}})[_0x3561('0x3f')](function(_0xf1d72d){logger[_0x3561('0x22')](_0x3561('0x4b'),_0xf1d72d);throw _0xf1d72d;});}return _0x5132c7;})[_0x3561('0x1c')](respondWithResult(_0x359337,0xc9))[_0x3561('0x3f')](handleError(_0x359337,null));};exports[_0x3561('0x4c')]=function(_0x252541,_0x5c1448){if(_0x252541[_0x3561('0x4d')]['id']){delete _0x252541[_0x3561('0x4d')]['id'];}return db[_0x3561('0x27')][_0x3561('0x48')]({'where':{'id':_0x252541[_0x3561('0x41')]['id']}})[_0x3561('0x1c')](handleEntityNotFound(_0x5c1448,null))[_0x3561('0x1c')](saveUpdates(_0x252541[_0x3561('0x4d')],null))[_0x3561('0x1c')](respondWithResult(_0x5c1448,null))[_0x3561('0x3f')](handleError(_0x5c1448,null));};exports[_0x3561('0x1d')]=function(_0x55fea1,_0x1bb0a4){return db[_0x3561('0x27')][_0x3561('0x48')]({'where':{'id':_0x55fea1[_0x3561('0x41')]['id']}})[_0x3561('0x1c')](handleEntityNotFound(_0x1bb0a4,null))[_0x3561('0x1c')](removeEntity(_0x1bb0a4,null))[_0x3561('0x3f')](handleError(_0x1bb0a4,null));};exports[_0x3561('0x4e')]=function(_0x2dedfb,_0x20fcbe,_0x4216b4){var _0xa4fbad;return db[_0x3561('0x27')][_0x3561('0x48')]({'where':{'id':_0x2dedfb[_0x3561('0x41')]['id']},'attributes':['id',_0x3561('0x4f')]})['then'](handleEntityNotFound(_0x20fcbe,null))[_0x3561('0x1c')](function(_0x1f2eb5){if(_0x1f2eb5){var _0xcafb3c=require(_0x3561('0x50'))();_0xcafb3c['openSync'](_0x1f2eb5[_0x3561('0x4f')]);_0xcafb3c[_0x3561('0x51')]();return _0x1f2eb5;}})['then'](respondWithResult(_0x20fcbe,null))[_0x3561('0x3f')](handleError(_0x20fcbe,null));};
\ No newline at end of file
index ae5a101..2212f0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf84a=['../../config/logger','api','moment','bluebird','request-promise','path','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','util'];(function(_0x1fd2e6,_0x319411){var _0x38284b=function(_0x220170){while(--_0x220170){_0x1fd2e6['push'](_0x1fd2e6['shift']());}};_0x38284b(++_0x319411);}(_0xf84a,0x1c7));var _0xaf84=function(_0x1d550d,_0x5130db){_0x1d550d=_0x1d550d-0x0;var _0x19b8bb=_0xf84a[_0x1d550d];return _0x19b8bb;};'use strict';var _=require('lodash');var util=require(_0xaf84('0x0'));var logger=require(_0xaf84('0x1'))(_0xaf84('0x2'));var moment=require(_0xaf84('0x3'));var BPromise=require(_0xaf84('0x4'));var rp=require(_0xaf84('0x5'));var fs=require('fs');var path=require(_0xaf84('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaf84('0x7'));module[_0xaf84('0x8')]=function(_0x5e5e79,_0x4c14ea){return _0x5e5e79[_0xaf84('0x9')](_0xaf84('0xa'),attributes,{'tableName':_0xaf84('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1a7f=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','SquareOdbc','square_odbc'];(function(_0x1c3124,_0x218186){var _0x23477a=function(_0x34df96){while(--_0x34df96){_0x1c3124['push'](_0x1c3124['shift']());}};_0x23477a(++_0x218186);}(_0x1a7f,0xb4));var _0xf1a7=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x1a7f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf1a7('0x0'));var util=require(_0xf1a7('0x1'));var logger=require('../../config/logger')(_0xf1a7('0x2'));var moment=require(_0xf1a7('0x3'));var BPromise=require('bluebird');var rp=require(_0xf1a7('0x4'));var fs=require('fs');var path=require(_0xf1a7('0x5'));var rimraf=require(_0xf1a7('0x6'));var config=require(_0xf1a7('0x7'));var attributes=require('./squareOdbc.attributes');module[_0xf1a7('0x8')]=function(_0x6f06d,_0x17a05e){return _0x6f06d[_0xf1a7('0x9')](_0xf1a7('0xa'),attributes,{'tableName':_0xf1a7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9667fe1..d62f2b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find'];(function(_0x46eb55,_0x3cbe36){var _0x2a98af=function(_0x52c26f){while(--_0x52c26f){_0x46eb55['push'](_0x46eb55['shift']());}};_0x2a98af(++_0x3cbe36);}(_0x55ca,0x126));var _0xa55c=function(_0x457c96,_0x13785c){_0x457c96=_0x457c96-0x0;var _0x4e5ebc=_0x55ca[_0x457c96];return _0x4e5ebc;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});};
\ No newline at end of file
+var _0x3e74=['catch','SquareOdbc','find','options','raw','where','attributes','include','map','model','then','ShowSquareOdbc','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','SquareOdbc,\x20%s,\x20%s','message','info'];(function(_0x33bb07,_0x5b1849){var _0x481c81=function(_0x1709f0){while(--_0x1709f0){_0x33bb07['push'](_0x33bb07['shift']());}};_0x481c81(++_0x5b1849);}(_0x3e74,0x175));var _0x43e7=function(_0x3cda63,_0x479eb3){_0x3cda63=_0x3cda63-0x0;var _0x46f0ac=_0x3e74[_0x3cda63];return _0x46f0ac;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowSquareOdbc']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});};
\ No newline at end of file
index 87270d9..2e4cca8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3423=['./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','create','put','update','delete','removeUsers','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x40e53a,_0x2f0d79){var _0x43700a=function(_0xea50a4){while(--_0xea50a4){_0x40e53a['push'](_0x40e53a['shift']());}};_0x43700a(++_0x2f0d79);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var auth=require(_0x3342('0x4'));var interaction=require(_0x3342('0x5'));var config=require(_0x3342('0x6'));var controller=require(_0x3342('0x7'));router[_0x3342('0x8')]('/',auth[_0x3342('0x9')](),controller[_0x3342('0xa')]);router[_0x3342('0x8')](_0x3342('0xb'),auth[_0x3342('0x9')](),controller[_0x3342('0xc')]);router[_0x3342('0x8')](_0x3342('0xd'),auth[_0x3342('0x9')](),controller[_0x3342('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3342('0xf')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addUsers']);router[_0x3342('0x10')](_0x3342('0xb'),auth['isAuthenticated'](),controller[_0x3342('0x11')]);router['delete'](_0x3342('0xb'),auth[_0x3342('0x9')](),controller['destroy']);router[_0x3342('0x12')](_0x3342('0xd'),auth[_0x3342('0x9')](),controller[_0x3342('0x13')]);module[_0x3342('0x14')]=router;
\ No newline at end of file
+var _0x4213=['post','addUsers','put','/:id','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/users'];(function(_0x3b99bd,_0x186207){var _0x5808b6=function(_0x1b4e85){while(--_0x1b4e85){_0x3b99bd['push'](_0x3b99bd['shift']());}};_0x5808b6(++_0x186207);}(_0x4213,0x77));var _0x3421=function(_0x7ac7b2,_0x29cd45){_0x7ac7b2=_0x7ac7b2-0x0;var _0x2089f8=_0x4213[_0x7ac7b2];return _0x2089f8;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var auth=require(_0x3421('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3421('0x7'));var controller=require('./squareProject.controller');router[_0x3421('0x8')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xa')]);router[_0x3421('0x8')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0xb')]);router[_0x3421('0x8')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller['getUsers']);router[_0x3421('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3421('0xd')]('/:id/users',auth[_0x3421('0x9')](),controller[_0x3421('0xe')]);router[_0x3421('0xf')](_0x3421('0x10'),auth[_0x3421('0x9')](),controller[_0x3421('0x11')]);router[_0x3421('0x12')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0x13')]);router[_0x3421('0x12')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller[_0x3421('0x14')]);module[_0x3421('0x15')]=router;
\ No newline at end of file
index 85b7a0a..dbabb3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3e1=['STRING','BLOB','preproduction','toString','utf8','long','production','sequelize'];(function(_0x4ccaf9,_0x2e20f0){var _0x5229b9=function(_0x1269d3){while(--_0x1269d3){_0x4ccaf9['push'](_0x4ccaf9['shift']());}};_0x5229b9(++_0x2e20f0);}(_0xe3e1,0xaf));var _0x1e3e=function(_0x8bfd20,_0x4ca91a){_0x8bfd20=_0x8bfd20-0x0;var _0x5853dc=_0xe3e1[_0x8bfd20];return _0x5853dc;};'use strict';var Sequelize=require(_0x1e3e('0x0'));module['exports']={'name':{'type':Sequelize[_0x1e3e('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x1e3e('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x1e3e('0x2')]('long'),'get':function(){if(this['getDataValue'](_0x1e3e('0x3'))){return this['getDataValue'](_0x1e3e('0x3'))[_0x1e3e('0x4')](_0x1e3e('0x5'));}}},'production':{'type':Sequelize[_0x1e3e('0x2')](_0x1e3e('0x6')),'get':function(){if(this['getDataValue'](_0x1e3e('0x7'))){return this['getDataValue'](_0x1e3e('0x7'))[_0x1e3e('0x4')](_0x1e3e('0x5'));}}}};
\ No newline at end of file
+var _0x4660=['toString','utf8','production','exports','STRING','name','TEXT','BLOB','long','preproduction','getDataValue'];(function(_0x332ee1,_0x38ccad){var _0x23e120=function(_0x393f6c){while(--_0x393f6c){_0x332ee1['push'](_0x332ee1['shift']());}};_0x23e120(++_0x38ccad);}(_0x4660,0x1e7));var _0x0466=function(_0x291b05,_0x54d15c){_0x291b05=_0x291b05-0x0;var _0x5171b8=_0x4660[_0x291b05];return _0x5171b8;};'use strict';var Sequelize=require('sequelize');module[_0x0466('0x0')]={'name':{'type':Sequelize[_0x0466('0x1')],'unique':_0x0466('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x0466('0x1')]},'notes':{'type':Sequelize[_0x0466('0x3')]},'preproduction':{'type':Sequelize[_0x0466('0x4')](_0x0466('0x5')),'get':function(){if(this['getDataValue'](_0x0466('0x6'))){return this[_0x0466('0x7')](_0x0466('0x6'))[_0x0466('0x8')](_0x0466('0x9'));}}},'production':{'type':Sequelize[_0x0466('0x4')]('long'),'get':function(){if(this[_0x0466('0x7')](_0x0466('0xa'))){return this[_0x0466('0x7')]('production')[_0x0466('0x8')]('utf8');}}}};
\ No newline at end of file
index 754e957..ace147a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf51b=['path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','index','map','SquareProject','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','options','include','catch','show','keys','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','body','addUsers','params','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','findOne','User','order','filter','getUsers','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache'];(function(_0x4e8165,_0x4aac69){var _0x56f576=function(_0x2ce95c){while(--_0x2ce95c){_0x4e8165['push'](_0x4e8165['shift']());}};_0x56f576(++_0x4aac69);}(_0xf51b,0x10b));var _0xbf51=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf51b[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbf51('0x0'));var rimraf=require(_0xbf51('0x1'));var zipdir=require(_0xbf51('0x2'));var jsonpatch=require(_0xbf51('0x3'));var rp=require(_0xbf51('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf51('0x5'));var util=require('util');var path=require(_0xbf51('0x6'));var sox=require(_0xbf51('0x7'));var csv=require(_0xbf51('0x8'));var ejs=require(_0xbf51('0x9'));var fs=require('fs');var _=require(_0xbf51('0xa'));var squel=require(_0xbf51('0xb'));var crypto=require('crypto');var jsforce=require(_0xbf51('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbf51('0xd'));var Papa=require('papaparse');var Redis=require(_0xbf51('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf51('0xf'));var logger=require(_0xbf51('0x10'))(_0xbf51('0x11'));var utils=require(_0xbf51('0x12'));var config=require(_0xbf51('0x13'));var db=require('../../mysqldb')['db'];config[_0xbf51('0x14')]=_[_0xbf51('0x15')](config[_0xbf51('0x14')],{'host':_0xbf51('0x16'),'port':0x18eb});var socket=require(_0xbf51('0x17'))(new Redis(config[_0xbf51('0x14')]));require(_0xbf51('0x18'))[_0xbf51('0x19')](socket);function respondWithStatusCode(_0x3217fc,_0x4656d9){_0x4656d9=_0x4656d9||0xcc;return function(_0x41c122){if(_0x41c122){return _0x3217fc['sendStatus'](_0x4656d9);}return _0x3217fc['status'](_0x4656d9)[_0xbf51('0x1a')]();};}function respondWithResult(_0x4eb2f9,_0xf8b104){_0xf8b104=_0xf8b104||0xc8;return function(_0x594aff){if(_0x594aff){return _0x4eb2f9[_0xbf51('0x1b')](_0xf8b104)[_0xbf51('0x1c')](_0x594aff);}};}function respondWithFilteredResult(_0x24eb78,_0x17cf0c){return function(_0x577f61){if(_0x577f61){var _0x153cf3=_0x577f61[_0xbf51('0x1d')],_0x98312e=_0x17cf0c[_0xbf51('0x1e')],_0x5a2c9f=_0x17cf0c[_0xbf51('0x1e')]+_0x17cf0c[_0xbf51('0x1f')],_0x3e8ce0;if(_0x5a2c9f>=_0x153cf3){_0x5a2c9f=_0x153cf3;_0x3e8ce0=0xc8;}else{_0x3e8ce0=0xce;}_0x24eb78[_0xbf51('0x1b')](_0x3e8ce0);return _0x24eb78[_0xbf51('0x20')](_0xbf51('0x21'),_0x98312e+'-'+_0x5a2c9f+'/'+_0x153cf3)[_0xbf51('0x1c')](_0x577f61);}return null;};}function patchUpdates(_0x3dae8d){return function(_0x30b4f8){try{jsonpatch[_0xbf51('0x22')](_0x30b4f8,_0x3dae8d,!![]);}catch(_0x31f78f){return BPromise['reject'](_0x31f78f);}return _0x30b4f8[_0xbf51('0x23')]();};}function saveUpdates(_0x3b736e,_0x44f538){return function(_0xf26d86){if(_0xf26d86){return _0xf26d86[_0xbf51('0x24')](_0x3b736e)[_0xbf51('0x25')](function(_0x3ac569){return _0x3ac569;});}return null;};}function removeEntity(_0x3baf88,_0x19620e){return function(_0x14d86a){if(_0x14d86a){return _0x14d86a[_0xbf51('0x26')]()[_0xbf51('0x25')](function(){var _0x2c0d53=_0x14d86a[_0xbf51('0x27')]({'plain':!![]});var _0x2c388f=_0xbf51('0x28');return db[_0xbf51('0x29')][_0xbf51('0x26')]({'where':{'type':_0x2c388f,'resourceId':_0x2c0d53['id']}})['then'](function(){return _0x14d86a;});})[_0xbf51('0x25')](function(){_0x3baf88[_0xbf51('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33fabd,_0x286c9b){return function(_0x6b8cf1){if(!_0x6b8cf1){_0x33fabd['sendStatus'](0x194);}return _0x6b8cf1;};}function handleError(_0x6953fe,_0x3d1b8d){_0x3d1b8d=_0x3d1b8d||0x1f4;return function(_0x45b0e2){logger[_0xbf51('0x2a')](_0x45b0e2[_0xbf51('0x2b')]);if(_0x45b0e2[_0xbf51('0x2c')]){delete _0x45b0e2[_0xbf51('0x2c')];}_0x6953fe['status'](_0x3d1b8d)['send'](_0x45b0e2);};}exports[_0xbf51('0x2d')]=function(_0x2b6468,_0x31af64){var _0x3b401d={},_0x2594c3={},_0x2f9c55={'count':0x0,'rows':[]};var _0x309d81=_[_0xbf51('0x2e')](db[_0xbf51('0x2f')][_0xbf51('0x30')],function(_0x23cea6){return{'name':_0x23cea6[_0xbf51('0x31')],'type':_0x23cea6[_0xbf51('0x32')]['key']};});_0x2594c3[_0xbf51('0x33')]=_['map'](_0x309d81,_0xbf51('0x2c'));_0x2594c3[_0xbf51('0x34')]=_['keys'](_0x2b6468['query']);_0x2594c3['filters']=_[_0xbf51('0x35')](_0x2594c3[_0xbf51('0x33')],_0x2594c3[_0xbf51('0x34')]);_0x3b401d['attributes']=_['intersection'](_0x2594c3[_0xbf51('0x33')],qs[_0xbf51('0x36')](_0x2b6468[_0xbf51('0x34')]['fields']));_0x3b401d[_0xbf51('0x37')]=_0x3b401d[_0xbf51('0x37')][_0xbf51('0x38')]?_0x3b401d[_0xbf51('0x37')]:_0x2594c3[_0xbf51('0x33')];if(!_0x2b6468[_0xbf51('0x34')][_0xbf51('0x39')](_0xbf51('0x3a'))){_0x3b401d['limit']=qs[_0xbf51('0x1f')](_0x2b6468[_0xbf51('0x34')]['limit']);_0x3b401d[_0xbf51('0x1e')]=qs[_0xbf51('0x1e')](_0x2b6468[_0xbf51('0x34')]['offset']);}_0x3b401d['order']=qs[_0xbf51('0x3b')](_0x2b6468[_0xbf51('0x34')][_0xbf51('0x3b')]);_0x3b401d[_0xbf51('0x3c')]=qs[_0xbf51('0x3d')](_[_0xbf51('0x3e')](_0x2b6468[_0xbf51('0x34')],_0x2594c3[_0xbf51('0x3d')]),_0x309d81);if(_0x2b6468['query']['filter']){_0x3b401d[_0xbf51('0x3c')]=_[_0xbf51('0x3f')](_0x3b401d[_0xbf51('0x3c')],{'$or':_['map'](_0x309d81,function(_0x2042ba){if(_0x2042ba[_0xbf51('0x32')]!=='VIRTUAL'){var _0x304a2f={};_0x304a2f[_0x2042ba[_0xbf51('0x2c')]]={'$like':'%'+_0x2b6468['query']['filter']+'%'};return _0x304a2f;}})});}_0x3b401d=_[_0xbf51('0x3f')]({},_0x3b401d,_0x2b6468[_0xbf51('0x40')]);var _0x2d21c5={'where':_0x3b401d['where']};return db[_0xbf51('0x2f')][_0xbf51('0x1d')](_0x2d21c5)[_0xbf51('0x25')](function(_0x20d9c5){_0x2f9c55[_0xbf51('0x1d')]=_0x20d9c5;if(_0x2b6468[_0xbf51('0x34')]['includeAll']){_0x3b401d[_0xbf51('0x41')]=[{'all':!![]}];}return db[_0xbf51('0x2f')]['findAll'](_0x3b401d);})[_0xbf51('0x25')](function(_0x4b2a13){_0x2f9c55['rows']=_0x4b2a13;return _0x2f9c55;})['then'](respondWithFilteredResult(_0x31af64,_0x3b401d))[_0xbf51('0x42')](handleError(_0x31af64,null));};exports[_0xbf51('0x43')]=function(_0x1600a3,_0x4ed61d){var _0x2a24f1={'raw':![],'where':{'id':_0x1600a3['params']['id']}},_0x169b00={};_0x169b00[_0xbf51('0x33')]=_[_0xbf51('0x44')](db[_0xbf51('0x2f')][_0xbf51('0x30')]);_0x169b00[_0xbf51('0x34')]=_[_0xbf51('0x44')](_0x1600a3[_0xbf51('0x34')]);_0x169b00[_0xbf51('0x3d')]=_['intersection'](_0x169b00['model'],_0x169b00[_0xbf51('0x34')]);_0x2a24f1['attributes']=_[_0xbf51('0x35')](_0x169b00['model'],qs['fields'](_0x1600a3[_0xbf51('0x34')][_0xbf51('0x36')]));_0x2a24f1[_0xbf51('0x37')]=_0x2a24f1['attributes'][_0xbf51('0x38')]?_0x2a24f1[_0xbf51('0x37')]:_0x169b00['model'];if(_0x1600a3[_0xbf51('0x34')][_0xbf51('0x45')]){_0x2a24f1['include']=[{'all':!![]}];}_0x2a24f1=_[_0xbf51('0x3f')]({},_0x2a24f1,_0x1600a3[_0xbf51('0x40')]);return db['SquareProject'][_0xbf51('0x46')](_0x2a24f1)[_0xbf51('0x25')](handleEntityNotFound(_0x4ed61d,null))[_0xbf51('0x25')](respondWithResult(_0x4ed61d,null))['catch'](handleError(_0x4ed61d,null));};exports[_0xbf51('0x47')]=function(_0x9a0465,_0x3cab3c){return db['SquareProject'][_0xbf51('0x47')](_0x9a0465['body'],{})['then'](function(_0x2d68b0){var _0x2ea119=_0x9a0465[_0xbf51('0x48')][_0xbf51('0x27')]({'plain':!![]});if(!_0x2ea119)throw new Error(_0xbf51('0x49'));if(_0x2ea119[_0xbf51('0x4a')]==='user'){var _0x3a9930=_0x2d68b0[_0xbf51('0x27')]({'plain':!![]});var _0x3693a1=_0xbf51('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x3693a1,'userProfileId':_0x2ea119[_0xbf51('0x4b')]},'raw':!![]})[_0xbf51('0x25')](function(_0x307e60){if(_0x307e60&&_0x307e60[_0xbf51('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x3a9930[_0xbf51('0x2c')],'resourceId':_0x3a9930['id'],'type':_0x307e60['name'],'sectionId':_0x307e60['id']},{})['then'](function(){return _0x2d68b0;});}else{return _0x2d68b0;}})[_0xbf51('0x42')](function(_0x314fcf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x314fcf);throw _0x314fcf;});}return _0x2d68b0;})[_0xbf51('0x25')](respondWithResult(_0x3cab3c,0xc9))['catch'](handleError(_0x3cab3c,null));};exports[_0xbf51('0x24')]=function(_0x2fda8a,_0x3a8740){if(_0x2fda8a[_0xbf51('0x4d')]['id']){delete _0x2fda8a[_0xbf51('0x4d')]['id'];}return db[_0xbf51('0x2f')]['find']({'where':{'id':_0x2fda8a['params']['id']}})['then'](handleEntityNotFound(_0x3a8740,null))[_0xbf51('0x25')](saveUpdates(_0x2fda8a[_0xbf51('0x4d')],null))['then'](respondWithResult(_0x3a8740,null))[_0xbf51('0x42')](handleError(_0x3a8740,null));};exports['destroy']=function(_0x25d5ea,_0x3727c3){return db[_0xbf51('0x2f')][_0xbf51('0x46')]({'where':{'id':_0x25d5ea['params']['id']}})[_0xbf51('0x25')](handleEntityNotFound(_0x3727c3,null))[_0xbf51('0x25')](removeEntity(_0x3727c3,null))[_0xbf51('0x42')](handleError(_0x3727c3,null));};exports[_0xbf51('0x4e')]=function(_0x168204,_0xef57c2,_0x3eb18e){return db[_0xbf51('0x2f')][_0xbf51('0x46')]({'where':{'id':_0x168204[_0xbf51('0x4f')]['id']}})[_0xbf51('0x25')](handleEntityNotFound(_0xef57c2,null))[_0xbf51('0x25')](function(_0x59bd77){if(_0x59bd77){return _0x59bd77[_0xbf51('0x4e')](_0x168204['body']['ids'],_[_0xbf51('0x50')](_0x168204[_0xbf51('0x4d')],[_0xbf51('0x51'),'id'])||{});}})[_0xbf51('0x25')](respondWithResult(_0xef57c2,null))[_0xbf51('0x42')](handleError(_0xef57c2,null));};exports[_0xbf51('0x52')]=function(_0x44b39a,_0x473742,_0x106645){return db[_0xbf51('0x2f')]['find']({'where':{'id':_0x44b39a[_0xbf51('0x4f')]['id']}})[_0xbf51('0x25')](handleEntityNotFound(_0x473742,null))[_0xbf51('0x25')](function(_0x44e3b9){if(_0x44e3b9){return _0x44e3b9[_0xbf51('0x52')](_0x44b39a['query'][_0xbf51('0x51')])[_0xbf51('0x25')](function(){if(_[_0xbf51('0x53')](_0x44b39a[_0xbf51('0x34')][_0xbf51('0x51')])){for(var _0x40122b=0x0;_0x40122b<_0x44b39a[_0xbf51('0x34')]['ids'][_0xbf51('0x38')];_0x40122b+=0x1){socket[_0xbf51('0x54')](_0xbf51('0x55'),{'UserId':Number(_0x44b39a[_0xbf51('0x34')][_0xbf51('0x51')][_0x40122b]),'SquareProjectId':Number(_0x44b39a['params']['id'])});}}else{socket[_0xbf51('0x54')](_0xbf51('0x55'),{'UserId':Number(_0x44b39a[_0xbf51('0x34')][_0xbf51('0x51')]),'SquareProjectId':Number(_0x44b39a['params']['id'])});}});}})[_0xbf51('0x25')](respondWithStatusCode(_0x473742,null))[_0xbf51('0x42')](handleError(_0x473742,null));};exports['getUsers']=function(_0x4b71eb,_0x3d37cc,_0x135ab4){var _0x37ad04={};var _0x410eba={};var _0x191676;var _0x20b4c7;return db[_0xbf51('0x2f')][_0xbf51('0x56')]({'where':{'id':_0x4b71eb[_0xbf51('0x4f')]['id']}})[_0xbf51('0x25')](handleEntityNotFound(_0x3d37cc,null))[_0xbf51('0x25')](function(_0xe0241c){if(_0xe0241c){_0x191676=_0xe0241c;_0x410eba[_0xbf51('0x33')]=_[_0xbf51('0x44')](db[_0xbf51('0x57')][_0xbf51('0x30')]);_0x410eba[_0xbf51('0x34')]=_['keys'](_0x4b71eb[_0xbf51('0x34')]);_0x410eba[_0xbf51('0x3d')]=_['intersection'](_0x410eba[_0xbf51('0x33')],_0x410eba[_0xbf51('0x34')]);_0x37ad04[_0xbf51('0x37')]=_[_0xbf51('0x35')](_0x410eba[_0xbf51('0x33')],qs[_0xbf51('0x36')](_0x4b71eb[_0xbf51('0x34')][_0xbf51('0x36')]));_0x37ad04[_0xbf51('0x37')]=_0x37ad04[_0xbf51('0x37')][_0xbf51('0x38')]?_0x37ad04[_0xbf51('0x37')]:_0x410eba[_0xbf51('0x33')];_0x37ad04[_0xbf51('0x58')]=qs[_0xbf51('0x3b')](_0x4b71eb['query'][_0xbf51('0x3b')]);_0x37ad04[_0xbf51('0x3c')]=qs[_0xbf51('0x3d')](_[_0xbf51('0x3e')](_0x4b71eb['query'],_0x410eba[_0xbf51('0x3d')]));if(_0x4b71eb[_0xbf51('0x34')][_0xbf51('0x59')]){_0x37ad04[_0xbf51('0x3c')]=_[_0xbf51('0x3f')](_0x37ad04[_0xbf51('0x3c')],{'$or':_['map'](_0x37ad04[_0xbf51('0x37')],function(_0x1c06e4){var _0x13c43a={};_0x13c43a[_0x1c06e4]={'$like':'%'+_0x4b71eb[_0xbf51('0x34')][_0xbf51('0x59')]+'%'};return _0x13c43a;})});}_0x37ad04=_[_0xbf51('0x3f')]({},_0x37ad04,_0x4b71eb[_0xbf51('0x40')]);return _0x191676[_0xbf51('0x5a')](_0x37ad04);}})[_0xbf51('0x25')](function(_0x5c0e9d){if(_0x5c0e9d){_0x20b4c7=_0x5c0e9d[_0xbf51('0x38')];if(!_0x4b71eb[_0xbf51('0x34')][_0xbf51('0x39')](_0xbf51('0x3a'))){_0x37ad04['limit']=qs[_0xbf51('0x1f')](_0x4b71eb[_0xbf51('0x34')][_0xbf51('0x1f')]);_0x37ad04[_0xbf51('0x1e')]=qs[_0xbf51('0x1e')](_0x4b71eb[_0xbf51('0x34')][_0xbf51('0x1e')]);}return _0x191676[_0xbf51('0x5a')](_0x37ad04);}})[_0xbf51('0x25')](function(_0x4ccf99){if(_0x4ccf99){return _0x4ccf99?{'count':_0x20b4c7,'rows':_0x4ccf99}:null;}})[_0xbf51('0x25')](respondWithResult(_0x3d37cc,null))[_0xbf51('0x42')](handleError(_0x3d37cc,null));};
\ No newline at end of file
+var _0x9d67=['sort','where','filters','pick','filter','merge','type','VIRTUAL','options','SquareProject','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','./squareProject.socket','register','status','end','count','offset','limit','set','Content-Range','json','reject','update','destroy','then','get','SquareProjects','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order'];(function(_0x363ad1,_0x5802f9){var _0x4bc051=function(_0x2ad917){while(--_0x2ad917){_0x363ad1['push'](_0x363ad1['shift']());}};_0x4bc051(++_0x5802f9);}(_0x9d67,0xe0));var _0x79d6=function(_0x34190c,_0x4df8fe){_0x34190c=_0x34190c-0x0;var _0x2a03fe=_0x9d67[_0x34190c];return _0x2a03fe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x79d6('0x0'));var rimraf=require(_0x79d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x79d6('0x2'));var moment=require(_0x79d6('0x3'));var BPromise=require(_0x79d6('0x4'));var Mustache=require(_0x79d6('0x5'));var util=require('util');var path=require(_0x79d6('0x6'));var sox=require(_0x79d6('0x7'));var csv=require(_0x79d6('0x8'));var ejs=require(_0x79d6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x79d6('0xa'));var jsforce=require(_0x79d6('0xb'));var deskjs=require(_0x79d6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x79d6('0xd'));var Papa=require(_0x79d6('0xe'));var Redis=require(_0x79d6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x79d6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79d6('0x11'));var logger=require(_0x79d6('0x12'))('api');var utils=require(_0x79d6('0x13'));var config=require(_0x79d6('0x14'));var db=require(_0x79d6('0x15'))['db'];config['redis']=_[_0x79d6('0x16')](config['redis'],{'host':_0x79d6('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x79d6('0x18'))[_0x79d6('0x19')](socket);function respondWithStatusCode(_0x5bd3ec,_0x27767b){_0x27767b=_0x27767b||0xcc;return function(_0x110ca2){if(_0x110ca2){return _0x5bd3ec['sendStatus'](_0x27767b);}return _0x5bd3ec[_0x79d6('0x1a')](_0x27767b)[_0x79d6('0x1b')]();};}function respondWithResult(_0x5bf325,_0xc638b2){_0xc638b2=_0xc638b2||0xc8;return function(_0x2356f5){if(_0x2356f5){return _0x5bf325[_0x79d6('0x1a')](_0xc638b2)['json'](_0x2356f5);}};}function respondWithFilteredResult(_0x5cf4a9,_0x2c2d93){return function(_0x283778){if(_0x283778){var _0x2364a2=_0x283778[_0x79d6('0x1c')],_0x67eae2=_0x2c2d93[_0x79d6('0x1d')],_0x3c6158=_0x2c2d93[_0x79d6('0x1d')]+_0x2c2d93[_0x79d6('0x1e')],_0x3b7842;if(_0x3c6158>=_0x2364a2){_0x3c6158=_0x2364a2;_0x3b7842=0xc8;}else{_0x3b7842=0xce;}_0x5cf4a9[_0x79d6('0x1a')](_0x3b7842);return _0x5cf4a9[_0x79d6('0x1f')](_0x79d6('0x20'),_0x67eae2+'-'+_0x3c6158+'/'+_0x2364a2)[_0x79d6('0x21')](_0x283778);}return null;};}function patchUpdates(_0x3518c9){return function(_0x567be6){try{jsonpatch['apply'](_0x567be6,_0x3518c9,!![]);}catch(_0x481913){return BPromise[_0x79d6('0x22')](_0x481913);}return _0x567be6['save']();};}function saveUpdates(_0x1f8fe6,_0x1819b3){return function(_0x4d6bb4){if(_0x4d6bb4){return _0x4d6bb4[_0x79d6('0x23')](_0x1f8fe6)['then'](function(_0x3abf20){return _0x3abf20;});}return null;};}function removeEntity(_0x62b1eb,_0x467a9b){return function(_0x175523){if(_0x175523){return _0x175523[_0x79d6('0x24')]()[_0x79d6('0x25')](function(){var _0x763a75=_0x175523[_0x79d6('0x26')]({'plain':!![]});var _0x472636=_0x79d6('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x472636,'resourceId':_0x763a75['id']}})[_0x79d6('0x25')](function(){return _0x175523;});})[_0x79d6('0x25')](function(){_0x62b1eb['status'](0xcc)[_0x79d6('0x1b')]();});}};}function handleEntityNotFound(_0x271337,_0x81b61d){return function(_0x278cfb){if(!_0x278cfb){_0x271337[_0x79d6('0x28')](0x194);}return _0x278cfb;};}function handleError(_0x131075,_0x488915){_0x488915=_0x488915||0x1f4;return function(_0x500e98){logger[_0x79d6('0x29')](_0x500e98[_0x79d6('0x2a')]);if(_0x500e98['name']){delete _0x500e98[_0x79d6('0x2b')];}_0x131075[_0x79d6('0x1a')](_0x488915)[_0x79d6('0x2c')](_0x500e98);};}exports[_0x79d6('0x2d')]=function(_0x31efa2,_0x4d29c8){var _0x4c2bc7={},_0x173e98={},_0x3855fb={'count':0x0,'rows':[]};var _0x332f16=_['map'](db['SquareProject'][_0x79d6('0x2e')],function(_0x3e26fe){return{'name':_0x3e26fe[_0x79d6('0x2f')],'type':_0x3e26fe['type']['key']};});_0x173e98[_0x79d6('0x30')]=_[_0x79d6('0x31')](_0x332f16,'name');_0x173e98[_0x79d6('0x32')]=_[_0x79d6('0x33')](_0x31efa2[_0x79d6('0x32')]);_0x173e98['filters']=_[_0x79d6('0x34')](_0x173e98['model'],_0x173e98['query']);_0x4c2bc7['attributes']=_['intersection'](_0x173e98[_0x79d6('0x30')],qs[_0x79d6('0x35')](_0x31efa2['query'][_0x79d6('0x35')]));_0x4c2bc7[_0x79d6('0x36')]=_0x4c2bc7['attributes']['length']?_0x4c2bc7['attributes']:_0x173e98[_0x79d6('0x30')];if(!_0x31efa2[_0x79d6('0x32')][_0x79d6('0x37')](_0x79d6('0x38'))){_0x4c2bc7[_0x79d6('0x1e')]=qs[_0x79d6('0x1e')](_0x31efa2[_0x79d6('0x32')][_0x79d6('0x1e')]);_0x4c2bc7['offset']=qs[_0x79d6('0x1d')](_0x31efa2[_0x79d6('0x32')][_0x79d6('0x1d')]);}_0x4c2bc7[_0x79d6('0x39')]=qs['sort'](_0x31efa2[_0x79d6('0x32')][_0x79d6('0x3a')]);_0x4c2bc7[_0x79d6('0x3b')]=qs[_0x79d6('0x3c')](_[_0x79d6('0x3d')](_0x31efa2[_0x79d6('0x32')],_0x173e98[_0x79d6('0x3c')]),_0x332f16);if(_0x31efa2[_0x79d6('0x32')][_0x79d6('0x3e')]){_0x4c2bc7[_0x79d6('0x3b')]=_[_0x79d6('0x3f')](_0x4c2bc7['where'],{'$or':_[_0x79d6('0x31')](_0x332f16,function(_0x1a978f){if(_0x1a978f[_0x79d6('0x40')]!==_0x79d6('0x41')){var _0x4f5614={};_0x4f5614[_0x1a978f[_0x79d6('0x2b')]]={'$like':'%'+_0x31efa2[_0x79d6('0x32')][_0x79d6('0x3e')]+'%'};return _0x4f5614;}})});}_0x4c2bc7=_['merge']({},_0x4c2bc7,_0x31efa2[_0x79d6('0x42')]);var _0x150be0={'where':_0x4c2bc7[_0x79d6('0x3b')]};return db[_0x79d6('0x43')][_0x79d6('0x1c')](_0x150be0)['then'](function(_0x4a7e98){_0x3855fb['count']=_0x4a7e98;if(_0x31efa2[_0x79d6('0x32')][_0x79d6('0x44')]){_0x4c2bc7[_0x79d6('0x45')]=[{'all':!![]}];}return db[_0x79d6('0x43')][_0x79d6('0x46')](_0x4c2bc7);})[_0x79d6('0x25')](function(_0x521d71){_0x3855fb[_0x79d6('0x47')]=_0x521d71;return _0x3855fb;})['then'](respondWithFilteredResult(_0x4d29c8,_0x4c2bc7))[_0x79d6('0x48')](handleError(_0x4d29c8,null));};exports[_0x79d6('0x49')]=function(_0x458ce7,_0xe9b310){var _0x4f182f={'raw':![],'where':{'id':_0x458ce7[_0x79d6('0x4a')]['id']}},_0x1fc71a={};_0x1fc71a[_0x79d6('0x30')]=_[_0x79d6('0x33')](db[_0x79d6('0x43')][_0x79d6('0x2e')]);_0x1fc71a[_0x79d6('0x32')]=_[_0x79d6('0x33')](_0x458ce7['query']);_0x1fc71a[_0x79d6('0x3c')]=_[_0x79d6('0x34')](_0x1fc71a[_0x79d6('0x30')],_0x1fc71a[_0x79d6('0x32')]);_0x4f182f[_0x79d6('0x36')]=_[_0x79d6('0x34')](_0x1fc71a[_0x79d6('0x30')],qs[_0x79d6('0x35')](_0x458ce7[_0x79d6('0x32')]['fields']));_0x4f182f[_0x79d6('0x36')]=_0x4f182f[_0x79d6('0x36')][_0x79d6('0x4b')]?_0x4f182f['attributes']:_0x1fc71a[_0x79d6('0x30')];if(_0x458ce7[_0x79d6('0x32')][_0x79d6('0x44')]){_0x4f182f[_0x79d6('0x45')]=[{'all':!![]}];}_0x4f182f=_[_0x79d6('0x3f')]({},_0x4f182f,_0x458ce7[_0x79d6('0x42')]);return db['SquareProject'][_0x79d6('0x4c')](_0x4f182f)[_0x79d6('0x25')](handleEntityNotFound(_0xe9b310,null))[_0x79d6('0x25')](respondWithResult(_0xe9b310,null))[_0x79d6('0x48')](handleError(_0xe9b310,null));};exports[_0x79d6('0x4d')]=function(_0x14000a,_0x61782e){return db[_0x79d6('0x43')][_0x79d6('0x4d')](_0x14000a[_0x79d6('0x4e')],{})[_0x79d6('0x25')](function(_0x543495){var _0x44f9a6=_0x14000a[_0x79d6('0x4f')]['get']({'plain':!![]});if(!_0x44f9a6)throw new Error(_0x79d6('0x50'));if(_0x44f9a6['role']===_0x79d6('0x4f')){var _0x26884b=_0x543495[_0x79d6('0x26')]({'plain':!![]});var _0x13d7d2=_0x79d6('0x27');return db[_0x79d6('0x51')][_0x79d6('0x4c')]({'where':{'name':_0x13d7d2,'userProfileId':_0x44f9a6[_0x79d6('0x52')]},'raw':!![]})[_0x79d6('0x25')](function(_0x32b507){if(_0x32b507&&_0x32b507[_0x79d6('0x53')]===0x0){return db['UserProfileResource'][_0x79d6('0x4d')]({'name':_0x26884b[_0x79d6('0x2b')],'resourceId':_0x26884b['id'],'type':_0x32b507[_0x79d6('0x2b')],'sectionId':_0x32b507['id']},{})[_0x79d6('0x25')](function(){return _0x543495;});}else{return _0x543495;}})[_0x79d6('0x48')](function(_0x4418d8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4418d8);throw _0x4418d8;});}return _0x543495;})['then'](respondWithResult(_0x61782e,0xc9))['catch'](handleError(_0x61782e,null));};exports[_0x79d6('0x23')]=function(_0x3c81cc,_0x360753){if(_0x3c81cc[_0x79d6('0x4e')]['id']){delete _0x3c81cc['body']['id'];}return db[_0x79d6('0x43')][_0x79d6('0x4c')]({'where':{'id':_0x3c81cc[_0x79d6('0x4a')]['id']}})[_0x79d6('0x25')](handleEntityNotFound(_0x360753,null))[_0x79d6('0x25')](saveUpdates(_0x3c81cc[_0x79d6('0x4e')],null))[_0x79d6('0x25')](respondWithResult(_0x360753,null))[_0x79d6('0x48')](handleError(_0x360753,null));};exports[_0x79d6('0x24')]=function(_0x531d83,_0x1b2405){return db[_0x79d6('0x43')][_0x79d6('0x4c')]({'where':{'id':_0x531d83[_0x79d6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b2405,null))['then'](removeEntity(_0x1b2405,null))['catch'](handleError(_0x1b2405,null));};exports['addUsers']=function(_0x67257e,_0x16a283,_0x5641a6){return db[_0x79d6('0x43')][_0x79d6('0x4c')]({'where':{'id':_0x67257e['params']['id']}})['then'](handleEntityNotFound(_0x16a283,null))[_0x79d6('0x25')](function(_0x10c7d7){if(_0x10c7d7){return _0x10c7d7[_0x79d6('0x54')](_0x67257e[_0x79d6('0x4e')]['ids'],_[_0x79d6('0x55')](_0x67257e[_0x79d6('0x4e')],[_0x79d6('0x56'),'id'])||{});}})[_0x79d6('0x25')](respondWithResult(_0x16a283,null))[_0x79d6('0x48')](handleError(_0x16a283,null));};exports[_0x79d6('0x57')]=function(_0xc06ff8,_0x17d447,_0x1c5962){return db['SquareProject'][_0x79d6('0x4c')]({'where':{'id':_0xc06ff8[_0x79d6('0x4a')]['id']}})[_0x79d6('0x25')](handleEntityNotFound(_0x17d447,null))[_0x79d6('0x25')](function(_0x118861){if(_0x118861){return _0x118861['removeUsers'](_0xc06ff8[_0x79d6('0x32')][_0x79d6('0x56')])[_0x79d6('0x25')](function(){if(_[_0x79d6('0x58')](_0xc06ff8[_0x79d6('0x32')][_0x79d6('0x56')])){for(var _0x938042=0x0;_0x938042<_0xc06ff8['query'][_0x79d6('0x56')][_0x79d6('0x4b')];_0x938042+=0x1){socket['emit']('userSquareProject:remove',{'UserId':Number(_0xc06ff8[_0x79d6('0x32')]['ids'][_0x938042]),'SquareProjectId':Number(_0xc06ff8[_0x79d6('0x4a')]['id'])});}}else{socket[_0x79d6('0x59')](_0x79d6('0x5a'),{'UserId':Number(_0xc06ff8[_0x79d6('0x32')]['ids']),'SquareProjectId':Number(_0xc06ff8['params']['id'])});}});}})[_0x79d6('0x25')](respondWithStatusCode(_0x17d447,null))[_0x79d6('0x48')](handleError(_0x17d447,null));};exports[_0x79d6('0x5b')]=function(_0x32e116,_0x46d749,_0x10dad8){var _0x43844d={};var _0x34c7d2={};var _0x18f945;var _0x5a59ce;return db[_0x79d6('0x43')][_0x79d6('0x5c')]({'where':{'id':_0x32e116[_0x79d6('0x4a')]['id']}})[_0x79d6('0x25')](handleEntityNotFound(_0x46d749,null))[_0x79d6('0x25')](function(_0x190ba5){if(_0x190ba5){_0x18f945=_0x190ba5;_0x34c7d2['model']=_[_0x79d6('0x33')](db[_0x79d6('0x5d')]['rawAttributes']);_0x34c7d2[_0x79d6('0x32')]=_[_0x79d6('0x33')](_0x32e116['query']);_0x34c7d2[_0x79d6('0x3c')]=_['intersection'](_0x34c7d2['model'],_0x34c7d2[_0x79d6('0x32')]);_0x43844d[_0x79d6('0x36')]=_[_0x79d6('0x34')](_0x34c7d2[_0x79d6('0x30')],qs['fields'](_0x32e116[_0x79d6('0x32')][_0x79d6('0x35')]));_0x43844d[_0x79d6('0x36')]=_0x43844d[_0x79d6('0x36')][_0x79d6('0x4b')]?_0x43844d[_0x79d6('0x36')]:_0x34c7d2[_0x79d6('0x30')];_0x43844d['order']=qs[_0x79d6('0x3a')](_0x32e116[_0x79d6('0x32')][_0x79d6('0x3a')]);_0x43844d[_0x79d6('0x3b')]=qs[_0x79d6('0x3c')](_['pick'](_0x32e116['query'],_0x34c7d2['filters']));if(_0x32e116[_0x79d6('0x32')][_0x79d6('0x3e')]){_0x43844d['where']=_['merge'](_0x43844d[_0x79d6('0x3b')],{'$or':_[_0x79d6('0x31')](_0x43844d['attributes'],function(_0x4499c0){var _0xd11a66={};_0xd11a66[_0x4499c0]={'$like':'%'+_0x32e116['query'][_0x79d6('0x3e')]+'%'};return _0xd11a66;})});}_0x43844d=_[_0x79d6('0x3f')]({},_0x43844d,_0x32e116['options']);return _0x18f945['getUsers'](_0x43844d);}})['then'](function(_0x1867b1){if(_0x1867b1){_0x5a59ce=_0x1867b1[_0x79d6('0x4b')];if(!_0x32e116[_0x79d6('0x32')][_0x79d6('0x37')](_0x79d6('0x38'))){_0x43844d[_0x79d6('0x1e')]=qs[_0x79d6('0x1e')](_0x32e116['query'][_0x79d6('0x1e')]);_0x43844d['offset']=qs['offset'](_0x32e116[_0x79d6('0x32')]['offset']);}return _0x18f945[_0x79d6('0x5b')](_0x43844d);}})[_0x79d6('0x25')](function(_0x5f1d34){if(_0x5f1d34){return _0x5f1d34?{'count':_0x5a59ce,'rows':_0x5f1d34}:null;}})[_0x79d6('0x25')](respondWithResult(_0x46d749,null))[_0x79d6('0x48')](handleError(_0x46d749,null));};
\ No newline at end of file
index 94cc503..0b0fec2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca66=['save','remove','emit','exports','events','SquareProject','setMaxListeners'];(function(_0x5d03c7,_0x5f5725){var _0x4dd1e0=function(_0x4a8523){while(--_0x4a8523){_0x5d03c7['push'](_0x5d03c7['shift']());}};_0x4dd1e0(++_0x5f5725);}(_0xca66,0xb3));var _0x6ca6=function(_0x26d290,_0x2de876){_0x26d290=_0x26d290-0x0;var _0x244a20=_0xca66[_0x26d290];return _0x244a20;};'use strict';var EventEmitter=require(_0x6ca6('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x6ca6('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x6ca6('0x2')](0x0);var events={'afterCreate':_0x6ca6('0x3'),'afterUpdate':'update','afterDestroy':_0x6ca6('0x4')};function emitEvent(_0x4a1f25){return function(_0x292b53,_0xf0e76,_0x1603ee){SquareProjectEvents[_0x6ca6('0x5')](_0x4a1f25+':'+_0x292b53['id'],_0x292b53);SquareProjectEvents[_0x6ca6('0x5')](_0x4a1f25,_0x292b53);_0x1603ee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x6ca6('0x6')]=SquareProjectEvents;
\ No newline at end of file
+var _0x8f82=['../../mysqldb','SquareProject','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5e25af,_0x2c5385){var _0x449b15=function(_0x29533d){while(--_0x29533d){_0x5e25af['push'](_0x5e25af['shift']());}};_0x449b15(++_0x2c5385);}(_0x8f82,0x77));var _0x28f8=function(_0x2401a6,_0x44ddc6){_0x2401a6=_0x2401a6-0x0;var _0x5d2af9=_0x8f82[_0x2401a6];return _0x5d2af9;};'use strict';var EventEmitter=require(_0x28f8('0x0'));var SquareProject=require(_0x28f8('0x1'))['db'][_0x28f8('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x28f8('0x3')](0x0);var events={'afterCreate':_0x28f8('0x4'),'afterUpdate':'update','afterDestroy':_0x28f8('0x5')};function emitEvent(_0x23e5d3){return function(_0x30ba43,_0x3cee73,_0x25a734){SquareProjectEvents[_0x28f8('0x6')](_0x23e5d3+':'+_0x30ba43['id'],_0x30ba43);SquareProjectEvents[_0x28f8('0x6')](_0x23e5d3,_0x30ba43);_0x25a734(null);};}for(var e in events){if(events[_0x28f8('0x7')](e)){var event=events[e];SquareProject[_0x28f8('0x8')](e,emitEvent(event));}}module[_0x28f8('0x9')]=SquareProjectEvents;
\ No newline at end of file
index b504fdf..989b31c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['../../config/logger','api','moment','bluebird','request-promise','path','./squareProject.attributes','exports','SquareProject','square_projects','util'];(function(_0x5a5d36,_0x403479){var _0xa1d458=function(_0x49bed0){while(--_0x49bed0){_0x5a5d36['push'](_0x5a5d36['shift']());}};_0xa1d458(++_0x403479);}(_0x14a0,0x8e));var _0x014a=function(_0x1b38ec,_0x13ec29){_0x1b38ec=_0x1b38ec-0x0;var _0x523f01=_0x14a0[_0x1b38ec];return _0x523f01;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var logger=require(_0x014a('0x1'))(_0x014a('0x2'));var moment=require(_0x014a('0x3'));var BPromise=require(_0x014a('0x4'));var rp=require(_0x014a('0x5'));var fs=require('fs');var path=require(_0x014a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x014a('0x7'));module[_0x014a('0x8')]=function(_0x38a22c,_0x5ec84d){return _0x38a22c['define'](_0x014a('0x9'),attributes,{'tableName':_0x014a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x66fa=['define','SquareProject','square_projects','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x66fa,0x117));var _0xa66f=function(_0x388888,_0x446258){_0x388888=_0x388888-0x0;var _0x50809e=_0x66fa[_0x388888];return _0x50809e;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x2239d3,_0x20a150){return _0x2239d3[_0xa66f('0x9')](_0xa66f('0xa'),attributes,{'tableName':_0xa66f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3f3a4f2..3d9f9b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08af=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','include','map','model','debug','lodash'];(function(_0x4e9e0b,_0x1d4aa8){var _0x280541=function(_0x1034cd){while(--_0x1034cd){_0x4e9e0b['push'](_0x4e9e0b['shift']());}};_0x280541(++_0x1d4aa8);}(_0x08af,0x102));var _0xf08a=function(_0x48a928,_0x430727){_0x48a928=_0x48a928-0x0;var _0x11c1e9=_0x08af[_0x48a928];return _0x11c1e9;};'use strict';var _=require(_0xf08a('0x0'));var util=require(_0xf08a('0x1'));var moment=require(_0xf08a('0x2'));var BPromise=require(_0xf08a('0x3'));var rs=require(_0xf08a('0x4'));var fs=require('fs');var Redis=require(_0xf08a('0x5'));var db=require(_0xf08a('0x6'))['db'];var utils=require(_0xf08a('0x7'));var logger=require(_0xf08a('0x8'))(_0xf08a('0x9'));var config=require(_0xf08a('0xa'));var jayson=require(_0xf08a('0xb'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xf08a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf08a('0xd'))(new Redis(config[_0xf08a('0xc')]));require('./squareProject.socket')[_0xf08a('0xe')](socket);function respondWithRpcPromise(_0x1a3eb2,_0x1dfecc,_0x3e8ff1){return new BPromise(function(_0x179c62,_0x1f03c9){return client[_0xf08a('0xf')](_0x1a3eb2,_0x3e8ff1)[_0xf08a('0x10')](function(_0x35abc6){logger[_0xf08a('0x11')](_0xf08a('0x12'),_0x1dfecc,_0xf08a('0x13'));logger['debug'](_0xf08a('0x14'),_0x1dfecc,_0xf08a('0x13'),JSON[_0xf08a('0x15')](_0x35abc6));if(_0x35abc6[_0xf08a('0x16')]){if(_0x35abc6[_0xf08a('0x16')][_0xf08a('0x17')]===0x1f4){logger[_0xf08a('0x16')](_0xf08a('0x12'),_0x1dfecc,_0x35abc6[_0xf08a('0x16')]['message']);return _0x1f03c9(_0x35abc6[_0xf08a('0x16')]['message']);}logger[_0xf08a('0x16')](_0xf08a('0x12'),_0x1dfecc,_0x35abc6['error'][_0xf08a('0x18')]);return _0x179c62(_0x35abc6['error']['message']);}else{logger['info']('SquareProject,\x20%s,\x20%s',_0x1dfecc,_0xf08a('0x13'));_0x179c62(_0x35abc6[_0xf08a('0x19')][_0xf08a('0x18')]);}})[_0xf08a('0x1a')](function(_0x374e82){logger[_0xf08a('0x16')](_0xf08a('0x12'),_0x1dfecc,_0x374e82);_0x1f03c9(_0x374e82);});});}exports[_0xf08a('0x1b')]=function(_0x139836){var _0x3e16fe=this;return new Promise(function(_0x4202f0,_0x55bf68){return db[_0xf08a('0x1c')][_0xf08a('0x1d')]({'raw':_0x139836[_0xf08a('0x1e')]?_0x139836[_0xf08a('0x1e')][_0xf08a('0x1f')]===undefined?!![]:![]:!![],'where':_0x139836[_0xf08a('0x1e')]?_0x139836['options']['where']||null:null,'attributes':_0x139836[_0xf08a('0x1e')]?_0x139836[_0xf08a('0x1e')][_0xf08a('0x20')]||null:null,'include':_0x139836['options']?_0x139836['options'][_0xf08a('0x21')]?_[_0xf08a('0x22')](_0x139836[_0xf08a('0x1e')][_0xf08a('0x21')],function(_0xaa156c){return{'model':db[_0xaa156c['model']],'as':_0xaa156c['as'],'attributes':_0xaa156c[_0xf08a('0x20')],'include':_0xaa156c['include']?_[_0xf08a('0x22')](_0xaa156c[_0xf08a('0x21')],function(_0x42b1e4){return{'model':db[_0x42b1e4['model']],'as':_0x42b1e4['as'],'attributes':_0x42b1e4[_0xf08a('0x20')],'include':_0x42b1e4[_0xf08a('0x21')]?_[_0xf08a('0x22')](_0x42b1e4[_0xf08a('0x21')],function(_0x3a5576){return{'model':db[_0x3a5576[_0xf08a('0x23')]],'as':_0x3a5576['as'],'attributes':_0x3a5576['attributes']};}):[]};}):[]};}):[]:[]})[_0xf08a('0x10')](function(_0x3e8681){logger['info'](_0xf08a('0x1b'),_0x139836);logger[_0xf08a('0x24')]('ShowSquareProject',_0x139836,JSON[_0xf08a('0x15')](_0x3e8681));_0x4202f0(_0x3e8681);})[_0xf08a('0x1a')](function(_0x4058f9){logger[_0xf08a('0x16')](_0xf08a('0x1b'),_0x4058f9[_0xf08a('0x18')],_0x139836);_0x55bf68(_0x3e16fe[_0xf08a('0x16')](0x1f4,_0x4058f9[_0xf08a('0x18')]));});});};
\ No newline at end of file
+var _0x6cfc=['ShowSquareProject','SquareProject','find','options','where','attributes','include','map','model','debug','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x164e8f,_0xdba27a){var _0x2b2840=function(_0x4458f0){while(--_0x4458f0){_0x164e8f['push'](_0x164e8f['shift']());}};_0x2b2840(++_0xdba27a);}(_0x6cfc,0x1e7));var _0xc6cf=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x6cfc[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xc6cf('0x0'));var util=require(_0xc6cf('0x1'));var moment=require('moment');var BPromise=require(_0xc6cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6cf('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc6cf('0x4'))(_0xc6cf('0x5'));var config=require(_0xc6cf('0x6'));var jayson=require(_0xc6cf('0x7'));var client=jayson['client'][_0xc6cf('0x8')]({'port':0x232a});config[_0xc6cf('0x9')]=_['defaults'](config[_0xc6cf('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc6cf('0xa'))(new Redis(config[_0xc6cf('0x9')]));require(_0xc6cf('0xb'))[_0xc6cf('0xc')](socket);function respondWithRpcPromise(_0x1b075e,_0x376840,_0x24aef0){return new BPromise(function(_0x290e6c,_0x42e5b2){return client[_0xc6cf('0xd')](_0x1b075e,_0x24aef0)[_0xc6cf('0xe')](function(_0x5cb791){logger[_0xc6cf('0xf')](_0xc6cf('0x10'),_0x376840,_0xc6cf('0x11'));logger['debug'](_0xc6cf('0x12'),_0x376840,'request\x20sent',JSON[_0xc6cf('0x13')](_0x5cb791));if(_0x5cb791['error']){if(_0x5cb791[_0xc6cf('0x14')]['code']===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x376840,_0x5cb791['error'][_0xc6cf('0x15')]);return _0x42e5b2(_0x5cb791['error']['message']);}logger[_0xc6cf('0x14')]('SquareProject,\x20%s,\x20%s',_0x376840,_0x5cb791['error'][_0xc6cf('0x15')]);return _0x290e6c(_0x5cb791[_0xc6cf('0x14')][_0xc6cf('0x15')]);}else{logger[_0xc6cf('0xf')](_0xc6cf('0x10'),_0x376840,_0xc6cf('0x11'));_0x290e6c(_0x5cb791[_0xc6cf('0x16')][_0xc6cf('0x15')]);}})['catch'](function(_0x54dcf9){logger['error'](_0xc6cf('0x10'),_0x376840,_0x54dcf9);_0x42e5b2(_0x54dcf9);});});}exports[_0xc6cf('0x17')]=function(_0x47f154){var _0x4b0f2a=this;return new Promise(function(_0x1de596,_0x6eaa87){return db[_0xc6cf('0x18')][_0xc6cf('0x19')]({'raw':_0x47f154[_0xc6cf('0x1a')]?_0x47f154['options']['raw']===undefined?!![]:![]:!![],'where':_0x47f154['options']?_0x47f154[_0xc6cf('0x1a')][_0xc6cf('0x1b')]||null:null,'attributes':_0x47f154['options']?_0x47f154['options'][_0xc6cf('0x1c')]||null:null,'include':_0x47f154['options']?_0x47f154[_0xc6cf('0x1a')][_0xc6cf('0x1d')]?_[_0xc6cf('0x1e')](_0x47f154[_0xc6cf('0x1a')][_0xc6cf('0x1d')],function(_0x22ff87){return{'model':db[_0x22ff87['model']],'as':_0x22ff87['as'],'attributes':_0x22ff87[_0xc6cf('0x1c')],'include':_0x22ff87['include']?_[_0xc6cf('0x1e')](_0x22ff87['include'],function(_0x546f3f){return{'model':db[_0x546f3f[_0xc6cf('0x1f')]],'as':_0x546f3f['as'],'attributes':_0x546f3f[_0xc6cf('0x1c')],'include':_0x546f3f[_0xc6cf('0x1d')]?_[_0xc6cf('0x1e')](_0x546f3f[_0xc6cf('0x1d')],function(_0x4974d0){return{'model':db[_0x4974d0[_0xc6cf('0x1f')]],'as':_0x4974d0['as'],'attributes':_0x4974d0['attributes']};}):[]};}):[]};}):[]:[]})[_0xc6cf('0xe')](function(_0x34fdb7){logger['info']('ShowSquareProject',_0x47f154);logger[_0xc6cf('0x20')](_0xc6cf('0x17'),_0x47f154,JSON[_0xc6cf('0x13')](_0x34fdb7));_0x1de596(_0x34fdb7);})[_0xc6cf('0x21')](function(_0xdd77e0){logger[_0xc6cf('0x14')](_0xc6cf('0x17'),_0xdd77e0['message'],_0x47f154);_0x6eaa87(_0x4b0f2a[_0xc6cf('0x14')](0x1f4,_0xdd77e0[_0xc6cf('0x15')]));});});};
\ No newline at end of file
index 6edc06a..7f737f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['register','squareProject:','save','remove','update','emit'];(function(_0x3d21d0,_0x3a69dc){var _0x347843=function(_0x55baf4){while(--_0x55baf4){_0x3d21d0['push'](_0x3d21d0['shift']());}};_0x347843(++_0x3a69dc);}(_0xc2c7,0x134));var _0x7c2c=function(_0x36aceb,_0x438884){_0x36aceb=_0x36aceb-0x0;var _0x1da135=_0xc2c7[_0x36aceb];return _0x1da135;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x7c2c('0x0'),_0x7c2c('0x1'),_0x7c2c('0x2')];function createListener(_0x330870,_0x380d13){return function(_0x237e4d){_0x380d13[_0x7c2c('0x3')](_0x330870,_0x237e4d);};}function removeListener(_0x116f8a,_0x4bbc14){return function(){SquareProjectEvents['removeListener'](_0x116f8a,_0x4bbc14);};}exports[_0x7c2c('0x4')]=function(_0x42ecc9){for(var _0x23c038=0x0,_0x54f027=events['length'];_0x23c038<_0x54f027;_0x23c038++){var _0x5a1027=events[_0x23c038];var _0x2274cd=createListener(_0x7c2c('0x5')+_0x5a1027,_0x42ecc9);SquareProjectEvents['on'](_0x5a1027,_0x2274cd);}};
\ No newline at end of file
+var _0xd117=['save','remove','update','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x6e0673,_0xb815cb){var _0x2fe57e=function(_0x20c41c){while(--_0x20c41c){_0x6e0673['push'](_0x6e0673['shift']());}};_0x2fe57e(++_0xb815cb);}(_0xd117,0x182));var _0x7d11=function(_0x1dc01f,_0x157a75){_0x1dc01f=_0x1dc01f-0x0;var _0x298041=_0xd117[_0x1dc01f];return _0x298041;};'use strict';var SquareProjectEvents=require(_0x7d11('0x0'));var events=[_0x7d11('0x1'),_0x7d11('0x2'),_0x7d11('0x3')];function createListener(_0x454387,_0x26e0f0){return function(_0x306ae4){_0x26e0f0[_0x7d11('0x4')](_0x454387,_0x306ae4);};}function removeListener(_0x3c07be,_0x31fcb0){return function(){SquareProjectEvents[_0x7d11('0x5')](_0x3c07be,_0x31fcb0);};}exports[_0x7d11('0x6')]=function(_0x27d7e8){for(var _0x40c3c4=0x0,_0x345602=events[_0x7d11('0x7')];_0x40c3c4<_0x345602;_0x40c3c4++){var _0x47b5e6=events[_0x40c3c4];var _0x3803b5=createListener(_0x7d11('0x8')+_0x47b5e6,_0x27d7e8);SquareProjectEvents['on'](_0x47b5e6,_0x3803b5);}};
\ No newline at end of file
index 50c65f6..9c2abb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67ec=['/:id/delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete'];(function(_0x2f797e,_0x415057){var _0x4ced18=function(_0x858aad){while(--_0x858aad){_0x2f797e['push'](_0x2f797e['shift']());}};_0x4ced18(++_0x415057);}(_0x67ec,0x100));var _0xc67e=function(_0x272b36,_0x3a8acb){_0x272b36=_0x272b36-0x0;var _0x350765=_0x67ec[_0x272b36];return _0x350765;};'use strict';var multer=require(_0xc67e('0x0'));var util=require('util');var path=require(_0xc67e('0x1'));var timeout=require(_0xc67e('0x2'));var express=require(_0xc67e('0x3'));var router=express[_0xc67e('0x4')]();var auth=require(_0xc67e('0x5'));var interaction=require(_0xc67e('0x6'));var config=require(_0xc67e('0x7'));var controller=require(_0xc67e('0x8'));router[_0xc67e('0x9')]('/',auth[_0xc67e('0xa')](),controller[_0xc67e('0xb')]);router['get'](_0xc67e('0xc'),auth[_0xc67e('0xa')](),controller['show']);router['get'](_0xc67e('0xd'),auth['isAuthenticated'](),controller[_0xc67e('0xe')]);router[_0xc67e('0xf')]('/',auth[_0xc67e('0xa')](),controller[_0xc67e('0x10')]);router[_0xc67e('0x11')](_0xc67e('0xc'),auth[_0xc67e('0xa')](),controller[_0xc67e('0x12')]);router[_0xc67e('0x13')](_0xc67e('0x14'),auth[_0xc67e('0xa')](),controller[_0xc67e('0x15')]);module[_0xc67e('0x16')]=router;
\ No newline at end of file
+var _0x407f=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','post','put','update','delete'];(function(_0x4ae756,_0x2d489c){var _0x2f04d1=function(_0xcb965b){while(--_0xcb965b){_0x4ae756['push'](_0x4ae756['shift']());}};_0x2f04d1(++_0x2d489c);}(_0x407f,0x106));var _0xf407=function(_0x302a84,_0xfaf37c){_0x302a84=_0x302a84-0x0;var _0x28ef60=_0x407f[_0x302a84];return _0x28ef60;};'use strict';var multer=require('multer');var util=require(_0xf407('0x0'));var path=require(_0xf407('0x1'));var timeout=require(_0xf407('0x2'));var express=require(_0xf407('0x3'));var router=express[_0xf407('0x4')]();var auth=require(_0xf407('0x5'));var interaction=require(_0xf407('0x6'));var config=require(_0xf407('0x7'));var controller=require('./squareRecording.controller');router[_0xf407('0x8')]('/',auth[_0xf407('0x9')](),controller['index']);router['get'](_0xf407('0xa'),auth[_0xf407('0x9')](),controller[_0xf407('0xb')]);router[_0xf407('0x8')](_0xf407('0xc'),auth[_0xf407('0x9')](),controller[_0xf407('0xd')]);router[_0xf407('0xe')]('/',auth[_0xf407('0x9')](),controller['create']);router[_0xf407('0xf')](_0xf407('0xa'),auth[_0xf407('0x9')](),controller[_0xf407('0x10')]);router[_0xf407('0x11')]('/:id/delete',auth['isAuthenticated'](),controller[_0xf407('0x12')]);module[_0xf407('0x13')]=router;
\ No newline at end of file
index fc3a186..7be3f27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf37a=['savePath','substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xf37a,0x1f4));var _0xaf37=function(_0x6704d5,_0xb7141f){_0x6704d5=_0x6704d5-0x0;var _0x296387=_0xf37a[_0x6704d5];return _0x296387;};'use strict';var Sequelize=require(_0xaf37('0x0'));module[_0xaf37('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaf37('0x2')]},'calleridname':{'type':Sequelize[_0xaf37('0x2')]},'context':{'type':Sequelize[_0xaf37('0x2')]},'extension':{'type':Sequelize[_0xaf37('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaf37('0x2')]},'dnid':{'type':Sequelize[_0xaf37('0x2')]},'projectName':{'type':Sequelize[_0xaf37('0x2')]},'saveName':{'type':Sequelize[_0xaf37('0x2')]},'filename':{'type':Sequelize[_0xaf37('0x2')]},'savePath':{'type':Sequelize[_0xaf37('0x2')]},'format':{'type':Sequelize[_0xaf37('0x3')],'get':function(){var _0x2e4e73='';var _0x2e6aac=this['getDataValue'](_0xaf37('0x4'));if(_0x2e6aac){_0x2e4e73=_0x2e6aac[_0xaf37('0x5')](_0x2e6aac[_0xaf37('0x6')]('.'));}return _0x2e4e73;}}};
\ No newline at end of file
+var _0x99fd=['sequelize','STRING','VIRTUAL','getDataValue','savePath','substring'];(function(_0x2d9548,_0x2c84d8){var _0x2088cc=function(_0x1ca8c){while(--_0x1ca8c){_0x2d9548['push'](_0x2d9548['shift']());}};_0x2088cc(++_0x2c84d8);}(_0x99fd,0x1e0));var _0xd99f=function(_0x1ff15d,_0x21b441){_0x1ff15d=_0x1ff15d-0x0;var _0x51a67f=_0x99fd[_0x1ff15d];return _0x51a67f;};'use strict';var Sequelize=require(_0xd99f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd99f('0x1')]},'callerid':{'type':Sequelize[_0xd99f('0x1')]},'calleridname':{'type':Sequelize[_0xd99f('0x1')]},'context':{'type':Sequelize[_0xd99f('0x1')]},'extension':{'type':Sequelize[_0xd99f('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd99f('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xd99f('0x1')]},'filename':{'type':Sequelize[_0xd99f('0x1')]},'savePath':{'type':Sequelize[_0xd99f('0x1')]},'format':{'type':Sequelize[_0xd99f('0x2')],'get':function(){var _0x4a6671='';var _0x2c78c7=this[_0xd99f('0x3')](_0xd99f('0x4'));if(_0x2c78c7){_0x4a6671=_0x2c78c7[_0xd99f('0x5')](_0x2c78c7['lastIndexOf']('.'));}return _0x4a6671;}}};
\ No newline at end of file
index 6621ffd..8d9da9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf72=['unlink','message','send','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','VIRTUAL','options','SquareRecording','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','uniqueid','savePath','format','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','filename','extname'];(function(_0x315aea,_0x318a80){var _0x4a4bdb=function(_0x7c049c){while(--_0x7c049c){_0x315aea['push'](_0x315aea['shift']());}};_0x4a4bdb(++_0x318a80);}(_0xdf72,0x68));var _0x2df7=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0xdf72[_0x1b95a1];return _0x57aef1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2df7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2df7('0x1'));var rp=require(_0x2df7('0x2'));var moment=require(_0x2df7('0x3'));var BPromise=require(_0x2df7('0x4'));var Mustache=require(_0x2df7('0x5'));var util=require(_0x2df7('0x6'));var path=require(_0x2df7('0x7'));var sox=require(_0x2df7('0x8'));var csv=require(_0x2df7('0x9'));var ejs=require(_0x2df7('0xa'));var fs=require('fs');var _=require(_0x2df7('0xb'));var squel=require(_0x2df7('0xc'));var crypto=require('crypto');var jsforce=require(_0x2df7('0xd'));var deskjs=require(_0x2df7('0xe'));var toCsv=require(_0x2df7('0x9'));var querystring=require(_0x2df7('0xf'));var Papa=require(_0x2df7('0x10'));var Redis=require(_0x2df7('0x11'));var authService=require(_0x2df7('0x12'));var qs=require(_0x2df7('0x13'));var as=require(_0x2df7('0x14'));var hardwareService=require(_0x2df7('0x15'));var logger=require('../../config/logger')(_0x2df7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a23e6,_0x10d9d7){_0x10d9d7=_0x10d9d7||0xcc;return function(_0x1bf388){if(_0x1bf388){return _0x4a23e6[_0x2df7('0x17')](_0x10d9d7);}return _0x4a23e6[_0x2df7('0x18')](_0x10d9d7)[_0x2df7('0x19')]();};}function respondWithResult(_0x5caf12,_0x2389a5){_0x2389a5=_0x2389a5||0xc8;return function(_0x5e0b7e){if(_0x5e0b7e){return _0x5caf12[_0x2df7('0x18')](_0x2389a5)[_0x2df7('0x1a')](_0x5e0b7e);}};}function respondWithFilteredResult(_0x5ee1ba,_0x4b9bbc){return function(_0x1bd882){if(_0x1bd882){var _0x41982a=_0x1bd882[_0x2df7('0x1b')],_0x1598b=_0x4b9bbc['offset'],_0x26cbe5=_0x4b9bbc[_0x2df7('0x1c')]+_0x4b9bbc['limit'],_0x4d5a90;if(_0x26cbe5>=_0x41982a){_0x26cbe5=_0x41982a;_0x4d5a90=0xc8;}else{_0x4d5a90=0xce;}_0x5ee1ba[_0x2df7('0x18')](_0x4d5a90);return _0x5ee1ba[_0x2df7('0x1d')](_0x2df7('0x1e'),_0x1598b+'-'+_0x26cbe5+'/'+_0x41982a)[_0x2df7('0x1a')](_0x1bd882);}return null;};}function patchUpdates(_0x5beec0){return function(_0xbfdd0e){try{jsonpatch[_0x2df7('0x1f')](_0xbfdd0e,_0x5beec0,!![]);}catch(_0x39b4a7){return BPromise[_0x2df7('0x20')](_0x39b4a7);}return _0xbfdd0e['save']();};}function saveUpdates(_0x5b4c2a,_0x205dc2){return function(_0x5144ed){if(_0x5144ed){return _0x5144ed[_0x2df7('0x21')](_0x5b4c2a)[_0x2df7('0x22')](function(_0x32a266){return _0x32a266;});}return null;};}function removeEntity(_0x11547c,_0x3c14e6){return function(_0x50f534){if(_0x50f534){return _0x50f534[_0x2df7('0x23')]()[_0x2df7('0x22')](function(){_0x11547c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1abd0b,_0x36102d){return function(_0x41c519){if(!_0x41c519){_0x1abd0b[_0x2df7('0x17')](0x194);}return _0x41c519;};}function handleError(_0x17efd3,_0x506aaf){_0x506aaf=_0x506aaf||0x1f4;return function(_0x4c2f44){logger['error'](_0x4c2f44[_0x2df7('0x24')]);if(_0x4c2f44['name']){delete _0x4c2f44[_0x2df7('0x25')];}_0x17efd3[_0x2df7('0x18')](_0x506aaf)['send'](_0x4c2f44);};}exports[_0x2df7('0x26')]=function(_0x2cd6af,_0x22e418){var _0x5091b4={},_0x159097={},_0x1b6b8a={'count':0x0,'rows':[]};var _0x132ac3=_[_0x2df7('0x27')](db['SquareRecording'][_0x2df7('0x28')],function(_0x585ac9){return{'name':_0x585ac9['fieldName'],'type':_0x585ac9[_0x2df7('0x29')][_0x2df7('0x2a')]};});_0x159097[_0x2df7('0x2b')]=_['map'](_0x132ac3,_0x2df7('0x25'));_0x159097[_0x2df7('0x2c')]=_['keys'](_0x2cd6af[_0x2df7('0x2c')]);_0x159097[_0x2df7('0x2d')]=_[_0x2df7('0x2e')](_0x159097[_0x2df7('0x2b')],_0x159097['query']);_0x5091b4[_0x2df7('0x2f')]=_[_0x2df7('0x2e')](_0x159097['model'],qs[_0x2df7('0x30')](_0x2cd6af[_0x2df7('0x2c')][_0x2df7('0x30')]));_0x5091b4[_0x2df7('0x2f')]=_0x5091b4[_0x2df7('0x2f')]['length']?_0x5091b4[_0x2df7('0x2f')]:_0x159097[_0x2df7('0x2b')];if(!_0x2cd6af['query'][_0x2df7('0x31')](_0x2df7('0x32'))){_0x5091b4[_0x2df7('0x33')]=qs[_0x2df7('0x33')](_0x2cd6af[_0x2df7('0x2c')][_0x2df7('0x33')]);_0x5091b4[_0x2df7('0x1c')]=qs['offset'](_0x2cd6af['query']['offset']);}_0x5091b4[_0x2df7('0x34')]=qs['sort'](_0x2cd6af['query'][_0x2df7('0x35')]);_0x5091b4['where']=qs[_0x2df7('0x2d')](_[_0x2df7('0x36')](_0x2cd6af['query'],_0x159097['filters']),_0x132ac3);if(_0x2cd6af[_0x2df7('0x2c')][_0x2df7('0x37')]){_0x5091b4['where']=_[_0x2df7('0x38')](_0x5091b4['where'],{'$or':_[_0x2df7('0x27')](_0x132ac3,function(_0x5e9489){if(_0x5e9489[_0x2df7('0x29')]!==_0x2df7('0x39')){var _0x5cfe25={};_0x5cfe25[_0x5e9489['name']]={'$like':'%'+_0x2cd6af[_0x2df7('0x2c')][_0x2df7('0x37')]+'%'};return _0x5cfe25;}})});}_0x5091b4=_[_0x2df7('0x38')]({},_0x5091b4,_0x2cd6af[_0x2df7('0x3a')]);var _0x1e31c9={'where':_0x5091b4['where']};return db[_0x2df7('0x3b')][_0x2df7('0x1b')](_0x1e31c9)[_0x2df7('0x22')](function(_0x4000da){_0x1b6b8a['count']=_0x4000da;if(_0x2cd6af[_0x2df7('0x2c')][_0x2df7('0x3c')]){_0x5091b4[_0x2df7('0x3d')]=[{'all':!![]}];}return db[_0x2df7('0x3b')][_0x2df7('0x3e')](_0x5091b4);})[_0x2df7('0x22')](function(_0x5dbbcf){_0x1b6b8a[_0x2df7('0x3f')]=_0x5dbbcf;return _0x1b6b8a;})[_0x2df7('0x22')](respondWithFilteredResult(_0x22e418,_0x5091b4))[_0x2df7('0x40')](handleError(_0x22e418,null));};exports[_0x2df7('0x41')]=function(_0xa105,_0x18062d){var _0x295653={'raw':!![],'where':{'id':_0xa105[_0x2df7('0x42')]['id']}},_0x74c49b={};_0x74c49b['model']=_[_0x2df7('0x43')](db['SquareRecording'][_0x2df7('0x28')]);_0x74c49b[_0x2df7('0x2c')]=_['keys'](_0xa105['query']);_0x74c49b[_0x2df7('0x2d')]=_[_0x2df7('0x2e')](_0x74c49b[_0x2df7('0x2b')],_0x74c49b['query']);_0x295653[_0x2df7('0x2f')]=_[_0x2df7('0x2e')](_0x74c49b['model'],qs[_0x2df7('0x30')](_0xa105[_0x2df7('0x2c')]['fields']));_0x295653[_0x2df7('0x2f')]=_0x295653[_0x2df7('0x2f')][_0x2df7('0x44')]?_0x295653[_0x2df7('0x2f')]:_0x74c49b[_0x2df7('0x2b')];if(_0xa105[_0x2df7('0x2c')][_0x2df7('0x3c')]){_0x295653[_0x2df7('0x3d')]=[{'all':!![]}];}_0x295653=_['merge']({},_0x295653,_0xa105[_0x2df7('0x3a')]);return db[_0x2df7('0x3b')][_0x2df7('0x45')](_0x295653)[_0x2df7('0x22')](handleEntityNotFound(_0x18062d,null))[_0x2df7('0x22')](respondWithResult(_0x18062d,null))[_0x2df7('0x40')](handleError(_0x18062d,null));};exports[_0x2df7('0x46')]=function(_0x149b7c,_0x1a901e){return db['SquareRecording']['create'](_0x149b7c[_0x2df7('0x47')],{})[_0x2df7('0x22')](respondWithResult(_0x1a901e,0xc9))[_0x2df7('0x40')](handleError(_0x1a901e,null));};exports[_0x2df7('0x21')]=function(_0x5c2114,_0x4ea0a5){if(_0x5c2114[_0x2df7('0x47')]['id']){delete _0x5c2114[_0x2df7('0x47')]['id'];}return db[_0x2df7('0x3b')][_0x2df7('0x45')]({'where':{'id':_0x5c2114['params']['id']}})[_0x2df7('0x22')](handleEntityNotFound(_0x4ea0a5,null))[_0x2df7('0x22')](saveUpdates(_0x5c2114[_0x2df7('0x47')],null))[_0x2df7('0x22')](respondWithResult(_0x4ea0a5,null))[_0x2df7('0x40')](handleError(_0x4ea0a5,null));};exports['download']=function(_0xd79fe5,_0x4a2bb4,_0x3229ce){var _0x582e58=require('../../components/encryptor');var _0x2cc64a=![];var _0x331560={};if(_0xd79fe5[_0x2df7('0x2c')][_0x2df7('0x29')]&&_0xd79fe5['query'][_0x2df7('0x29')]===_0x2df7('0x48')){_0x331560[_0x2df7('0x48')]=_0xd79fe5['params']['id'];}else{_0x331560['id']=_0xd79fe5[_0x2df7('0x42')]['id'];}return db[_0x2df7('0x3b')][_0x2df7('0x45')]({'where':_0x331560,'attributes':['id',_0x2df7('0x49'),'filename'],'raw':!![]})[_0x2df7('0x22')](handleEntityNotFound(_0x4a2bb4,null))['then'](function(_0x2bb07b){if(_0x2bb07b){var _0x72e7b1=_0x2bb07b[_0x2df7('0x49')];var _0x18357b=util[_0x2df7('0x4a')]('%s.cypher',_0x72e7b1);if(fs[_0x2df7('0x4b')](_0x18357b)){_0x2cc64a=!![];return _0x582e58[_0x2df7('0x4c')](_0x18357b,_0x72e7b1,config[_0x2df7('0x4d')]['recording'])[_0x2df7('0x22')](function(){return _0x2bb07b;});}return _0x2bb07b;}})['then'](function(_0x3dd247){if(_0x3dd247){var _0x343577=_0x3dd247['savePath'];if(!fs[_0x2df7('0x4b')](_0x343577)){throw new db[(_0x2df7('0x4e'))][(_0x2df7('0x4f'))](_0x2df7('0x50'));}if(_0x3dd247['filename']){return _0x4a2bb4[_0x2df7('0x51')](_0x343577,_0x3dd247[_0x2df7('0x52')]+path[_0x2df7('0x53')](_0x343577),function(){if(_0x2cc64a){fs['unlink'](_0x343577);}});}else{return _0x4a2bb4['download'](_0x343577,function(_0xe5c1ae){if(_0x2cc64a){fs[_0x2df7('0x54')](_0x343577);}});}}})[_0x2df7('0x40')](function(_0x521c44){if(_0x521c44[_0x2df7('0x55')]===_0x2df7('0x50')){_0x4a2bb4['status'](0x194)[_0x2df7('0x56')]('Not\x20found');}else{return handleError(_0x4a2bb4,null);}});};exports[_0x2df7('0x23')]=function(_0x17414e,_0x17f00c){return db[_0x2df7('0x3b')][_0x2df7('0x45')]({'where':{'id':_0x17414e[_0x2df7('0x42')]['id']}})[_0x2df7('0x22')](function(_0x3f45e3){if(!_0x3f45e3)throw new ReferenceError(_0x2df7('0x57'));return _0x3f45e3;})[_0x2df7('0x22')](function(_0x40242d){var _0x444600=_0x40242d[_0x2df7('0x49')];logger[_0x2df7('0x58')](_0x2df7('0x59'),_0x444600);if(!_[_0x2df7('0x5a')](_0x40242d[_0x2df7('0x49')])&&fs[_0x2df7('0x4b')](_0x444600)){logger[_0x2df7('0x58')]('File:\x20\x22'+_0x444600+_0x2df7('0x5b'));fs[_0x2df7('0x5c')](_0x444600);}_0x444600=_0x444600+'.cypher';if(!_[_0x2df7('0x5a')](_0x40242d['savePath'])&&fs[_0x2df7('0x4b')](_0x444600)){logger['info'](_0x2df7('0x5d')+_0x444600+_0x2df7('0x5b'));fs['unlinkSync'](_0x444600);}return _0x40242d;})[_0x2df7('0x22')](function(_0x46cfcb){if(!_0x46cfcb)throw new InternalError();return _0x46cfcb[_0x2df7('0x23')]();})[_0x2df7('0x22')](function(){_0x17f00c['status'](0xcc)[_0x2df7('0x19')]();})[_0x2df7('0x40')](handleError(_0x17f00c,null));};
\ No newline at end of file
+var _0x0080=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','params','options','create','body','update','find','../../components/encryptor','type','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','download','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','isNil','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','json','offset','limit','apply','save','destroy','then','sendStatus','error','stack','name','send','SquareRecording','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0080,0x91));var _0x0008=function(_0x544141,_0x231e35){_0x544141=_0x544141-0x0;var _0x3ff9a8=_0x0080[_0x544141];return _0x3ff9a8;};'use strict';var pdf=require(_0x0008('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0008('0x1'));var zipdir=require(_0x0008('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0008('0x3'));var moment=require(_0x0008('0x4'));var BPromise=require(_0x0008('0x5'));var Mustache=require(_0x0008('0x6'));var util=require(_0x0008('0x7'));var path=require(_0x0008('0x8'));var sox=require(_0x0008('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0008('0xa'));var squel=require(_0x0008('0xb'));var crypto=require(_0x0008('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0008('0xd'));var toCsv=require(_0x0008('0xe'));var querystring=require(_0x0008('0xf'));var Papa=require(_0x0008('0x10'));var Redis=require(_0x0008('0x11'));var authService=require(_0x0008('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0008('0x13'));var hardwareService=require(_0x0008('0x14'));var logger=require(_0x0008('0x15'))(_0x0008('0x16'));var utils=require(_0x0008('0x17'));var config=require('../../config/environment');var db=require(_0x0008('0x18'))['db'];function respondWithStatusCode(_0x2b771c,_0x4c4cc1){_0x4c4cc1=_0x4c4cc1||0xcc;return function(_0x50e20b){if(_0x50e20b){return _0x2b771c['sendStatus'](_0x4c4cc1);}return _0x2b771c['status'](_0x4c4cc1)[_0x0008('0x19')]();};}function respondWithResult(_0x317f23,_0x191d43){_0x191d43=_0x191d43||0xc8;return function(_0x1ead57){if(_0x1ead57){return _0x317f23[_0x0008('0x1a')](_0x191d43)[_0x0008('0x1b')](_0x1ead57);}};}function respondWithFilteredResult(_0x271f34,_0x31d082){return function(_0x51271e){if(_0x51271e){var _0x2b73bc=_0x51271e['count'],_0x4e7f35=_0x31d082[_0x0008('0x1c')],_0x22f47b=_0x31d082[_0x0008('0x1c')]+_0x31d082[_0x0008('0x1d')],_0x5f0b30;if(_0x22f47b>=_0x2b73bc){_0x22f47b=_0x2b73bc;_0x5f0b30=0xc8;}else{_0x5f0b30=0xce;}_0x271f34[_0x0008('0x1a')](_0x5f0b30);return _0x271f34['set']('Content-Range',_0x4e7f35+'-'+_0x22f47b+'/'+_0x2b73bc)['json'](_0x51271e);}return null;};}function patchUpdates(_0x4e5ebd){return function(_0xa88095){try{jsonpatch[_0x0008('0x1e')](_0xa88095,_0x4e5ebd,!![]);}catch(_0x133223){return BPromise['reject'](_0x133223);}return _0xa88095[_0x0008('0x1f')]();};}function saveUpdates(_0x206792,_0x5720da){return function(_0x4fee77){if(_0x4fee77){return _0x4fee77['update'](_0x206792)['then'](function(_0x42e1d6){return _0x42e1d6;});}return null;};}function removeEntity(_0x1962f5,_0x3b64d2){return function(_0x442488){if(_0x442488){return _0x442488[_0x0008('0x20')]()[_0x0008('0x21')](function(){_0x1962f5[_0x0008('0x1a')](0xcc)[_0x0008('0x19')]();});}};}function handleEntityNotFound(_0xbe9068,_0xdeefc9){return function(_0x480165){if(!_0x480165){_0xbe9068[_0x0008('0x22')](0x194);}return _0x480165;};}function handleError(_0x38a908,_0x29ecfb){_0x29ecfb=_0x29ecfb||0x1f4;return function(_0x1d80e3){logger[_0x0008('0x23')](_0x1d80e3[_0x0008('0x24')]);if(_0x1d80e3[_0x0008('0x25')]){delete _0x1d80e3[_0x0008('0x25')];}_0x38a908[_0x0008('0x1a')](_0x29ecfb)[_0x0008('0x26')](_0x1d80e3);};}exports['index']=function(_0x4e9419,_0x54806e){var _0x43df6c={},_0x227205={},_0x19d2ea={'count':0x0,'rows':[]};var _0x50a8d1=_['map'](db[_0x0008('0x27')][_0x0008('0x28')],function(_0x138d64){return{'name':_0x138d64[_0x0008('0x29')],'type':_0x138d64['type'][_0x0008('0x2a')]};});_0x227205[_0x0008('0x2b')]=_[_0x0008('0x2c')](_0x50a8d1,_0x0008('0x25'));_0x227205['query']=_[_0x0008('0x2d')](_0x4e9419[_0x0008('0x2e')]);_0x227205[_0x0008('0x2f')]=_['intersection'](_0x227205[_0x0008('0x2b')],_0x227205[_0x0008('0x2e')]);_0x43df6c[_0x0008('0x30')]=_[_0x0008('0x31')](_0x227205[_0x0008('0x2b')],qs['fields'](_0x4e9419['query'][_0x0008('0x32')]));_0x43df6c[_0x0008('0x30')]=_0x43df6c[_0x0008('0x30')][_0x0008('0x33')]?_0x43df6c[_0x0008('0x30')]:_0x227205[_0x0008('0x2b')];if(!_0x4e9419[_0x0008('0x2e')][_0x0008('0x34')](_0x0008('0x35'))){_0x43df6c['limit']=qs[_0x0008('0x1d')](_0x4e9419[_0x0008('0x2e')]['limit']);_0x43df6c[_0x0008('0x1c')]=qs['offset'](_0x4e9419[_0x0008('0x2e')][_0x0008('0x1c')]);}_0x43df6c[_0x0008('0x36')]=qs[_0x0008('0x37')](_0x4e9419[_0x0008('0x2e')]['sort']);_0x43df6c[_0x0008('0x38')]=qs[_0x0008('0x2f')](_[_0x0008('0x39')](_0x4e9419[_0x0008('0x2e')],_0x227205['filters']),_0x50a8d1);if(_0x4e9419[_0x0008('0x2e')][_0x0008('0x3a')]){_0x43df6c[_0x0008('0x38')]=_[_0x0008('0x3b')](_0x43df6c[_0x0008('0x38')],{'$or':_['map'](_0x50a8d1,function(_0x340998){if(_0x340998['type']!==_0x0008('0x3c')){var _0x247d46={};_0x247d46[_0x340998[_0x0008('0x25')]]={'$like':'%'+_0x4e9419[_0x0008('0x2e')][_0x0008('0x3a')]+'%'};return _0x247d46;}})});}_0x43df6c=_[_0x0008('0x3b')]({},_0x43df6c,_0x4e9419['options']);var _0xaf9c50={'where':_0x43df6c[_0x0008('0x38')]};return db[_0x0008('0x27')]['count'](_0xaf9c50)[_0x0008('0x21')](function(_0x642c4c){_0x19d2ea[_0x0008('0x3d')]=_0x642c4c;if(_0x4e9419[_0x0008('0x2e')][_0x0008('0x3e')]){_0x43df6c[_0x0008('0x3f')]=[{'all':!![]}];}return db[_0x0008('0x27')]['findAll'](_0x43df6c);})[_0x0008('0x21')](function(_0x41a7f9){_0x19d2ea[_0x0008('0x40')]=_0x41a7f9;return _0x19d2ea;})[_0x0008('0x21')](respondWithFilteredResult(_0x54806e,_0x43df6c))[_0x0008('0x41')](handleError(_0x54806e,null));};exports[_0x0008('0x42')]=function(_0x2b0931,_0x57d1c8){var _0x5653d5={'raw':!![],'where':{'id':_0x2b0931[_0x0008('0x43')]['id']}},_0x41e0dd={};_0x41e0dd[_0x0008('0x2b')]=_[_0x0008('0x2d')](db[_0x0008('0x27')][_0x0008('0x28')]);_0x41e0dd[_0x0008('0x2e')]=_['keys'](_0x2b0931[_0x0008('0x2e')]);_0x41e0dd[_0x0008('0x2f')]=_[_0x0008('0x31')](_0x41e0dd['model'],_0x41e0dd['query']);_0x5653d5[_0x0008('0x30')]=_[_0x0008('0x31')](_0x41e0dd['model'],qs[_0x0008('0x32')](_0x2b0931[_0x0008('0x2e')][_0x0008('0x32')]));_0x5653d5[_0x0008('0x30')]=_0x5653d5[_0x0008('0x30')][_0x0008('0x33')]?_0x5653d5[_0x0008('0x30')]:_0x41e0dd[_0x0008('0x2b')];if(_0x2b0931[_0x0008('0x2e')]['includeAll']){_0x5653d5[_0x0008('0x3f')]=[{'all':!![]}];}_0x5653d5=_['merge']({},_0x5653d5,_0x2b0931[_0x0008('0x44')]);return db['SquareRecording']['find'](_0x5653d5)[_0x0008('0x21')](handleEntityNotFound(_0x57d1c8,null))[_0x0008('0x21')](respondWithResult(_0x57d1c8,null))['catch'](handleError(_0x57d1c8,null));};exports[_0x0008('0x45')]=function(_0xc801cd,_0x286f23){return db[_0x0008('0x27')]['create'](_0xc801cd[_0x0008('0x46')],{})['then'](respondWithResult(_0x286f23,0xc9))['catch'](handleError(_0x286f23,null));};exports[_0x0008('0x47')]=function(_0x29367b,_0x555e3b){if(_0x29367b['body']['id']){delete _0x29367b[_0x0008('0x46')]['id'];}return db[_0x0008('0x27')][_0x0008('0x48')]({'where':{'id':_0x29367b[_0x0008('0x43')]['id']}})[_0x0008('0x21')](handleEntityNotFound(_0x555e3b,null))[_0x0008('0x21')](saveUpdates(_0x29367b[_0x0008('0x46')],null))[_0x0008('0x21')](respondWithResult(_0x555e3b,null))['catch'](handleError(_0x555e3b,null));};exports['download']=function(_0x2a30d0,_0x55a926,_0x4d63ac){var _0x4fd3d6=require(_0x0008('0x49'));var _0xda9d7e=![];var _0x5858ab={};if(_0x2a30d0[_0x0008('0x2e')][_0x0008('0x4a')]&&_0x2a30d0[_0x0008('0x2e')]['type']===_0x0008('0x4b')){_0x5858ab['uniqueid']=_0x2a30d0[_0x0008('0x43')]['id'];}else{_0x5858ab['id']=_0x2a30d0[_0x0008('0x43')]['id'];}return db[_0x0008('0x27')][_0x0008('0x48')]({'where':_0x5858ab,'attributes':['id',_0x0008('0x4c'),_0x0008('0x4d')],'raw':!![]})[_0x0008('0x21')](handleEntityNotFound(_0x55a926,null))['then'](function(_0x742f0){if(_0x742f0){var _0x4f91ad=_0x742f0['savePath'];var _0x305d76=util[_0x0008('0x4e')](_0x0008('0x4f'),_0x4f91ad);if(fs[_0x0008('0x50')](_0x305d76)){_0xda9d7e=!![];return _0x4fd3d6[_0x0008('0x51')](_0x305d76,_0x4f91ad,config[_0x0008('0x52')][_0x0008('0x53')])[_0x0008('0x21')](function(){return _0x742f0;});}return _0x742f0;}})['then'](function(_0x3d96cc){if(_0x3d96cc){var _0x324673=_0x3d96cc['savePath'];if(!fs['existsSync'](_0x324673)){throw new db[(_0x0008('0x54'))][(_0x0008('0x55'))]('SquareRecording\x20not\x20found');}if(_0x3d96cc['filename']){return _0x55a926[_0x0008('0x56')](_0x324673,_0x3d96cc[_0x0008('0x4d')]+path[_0x0008('0x57')](_0x324673),function(){if(_0xda9d7e){fs[_0x0008('0x58')](_0x324673);}});}else{return _0x55a926[_0x0008('0x56')](_0x324673,function(_0x474253){if(_0xda9d7e){fs['unlink'](_0x324673);}});}}})['catch'](function(_0x4872ce){if(_0x4872ce[_0x0008('0x59')]===_0x0008('0x5a')){_0x55a926[_0x0008('0x1a')](0x194)['send'](_0x0008('0x5b'));}else{return handleError(_0x55a926,null);}});};exports[_0x0008('0x20')]=function(_0x4e0c83,_0x6293b9){return db[_0x0008('0x27')][_0x0008('0x48')]({'where':{'id':_0x4e0c83['params']['id']}})[_0x0008('0x21')](function(_0x37e668){if(!_0x37e668)throw new ReferenceError('Entity\x20not\x20found');return _0x37e668;})[_0x0008('0x21')](function(_0x5651b3){var _0x1658a3=_0x5651b3[_0x0008('0x4c')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x1658a3);if(!_[_0x0008('0x5c')](_0x5651b3['savePath'])&&fs['existsSync'](_0x1658a3)){logger[_0x0008('0x5d')]('File:\x20\x22'+_0x1658a3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x0008('0x5e')](_0x1658a3);}_0x1658a3=_0x1658a3+_0x0008('0x5f');if(!_[_0x0008('0x5c')](_0x5651b3['savePath'])&&fs[_0x0008('0x50')](_0x1658a3)){logger['info'](_0x0008('0x60')+_0x1658a3+_0x0008('0x61'));fs[_0x0008('0x5e')](_0x1658a3);}return _0x5651b3;})[_0x0008('0x21')](function(_0x1d558c){if(!_0x1d558c)throw new InternalError();return _0x1d558c['destroy']();})[_0x0008('0x21')](function(){_0x6293b9['status'](0xcc)[_0x0008('0x19')]();})[_0x0008('0x41')](handleError(_0x6293b9,null));};
\ No newline at end of file
index 6045ca0..a39dee2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0aa8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings'];(function(_0x4a617c,_0x2b3334){var _0xc47d=function(_0x218dda){while(--_0x218dda){_0x4a617c['push'](_0x4a617c['shift']());}};_0xc47d(++_0x2b3334);}(_0x0aa8,0x1d1));var _0x80aa=function(_0x289891,_0x49a0fa){_0x289891=_0x289891-0x0;var _0x31cf2e=_0x0aa8[_0x289891];return _0x31cf2e;};'use strict';var _=require(_0x80aa('0x0'));var util=require(_0x80aa('0x1'));var logger=require(_0x80aa('0x2'))(_0x80aa('0x3'));var moment=require(_0x80aa('0x4'));var BPromise=require(_0x80aa('0x5'));var rp=require(_0x80aa('0x6'));var fs=require('fs');var path=require(_0x80aa('0x7'));var rimraf=require(_0x80aa('0x8'));var config=require(_0x80aa('0x9'));var attributes=require(_0x80aa('0xa'));module[_0x80aa('0xb')]=function(_0x1a6fdb,_0x53cda2){return _0x1a6fdb[_0x80aa('0xc')](_0x80aa('0xd'),attributes,{'tableName':_0x80aa('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2d21=['../../config/logger','bluebird','path','exports','define','SquareRecording','square_recordings','util'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x2d21,0x137));var _0x12d2=function(_0x1b8524,_0x1bb669){_0x1b8524=_0x1b8524-0x0;var _0x81418d=_0x2d21[_0x1b8524];return _0x81418d;};'use strict';var _=require('lodash');var util=require(_0x12d2('0x0'));var logger=require(_0x12d2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x12d2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12d2('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0x12d2('0x4')]=function(_0x2aea04,_0xf8a1d0){return _0x2aea04[_0x12d2('0x5')](_0x12d2('0x6'),attributes,{'tableName':_0x12d2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7d0747f..fa9cb56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02fc=['debug','error','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','create','body','options','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x02fc,0x134));var _0xc02f=function(_0x142433,_0x5e8a10){_0x142433=_0x142433-0x0;var _0x2aa168=_0x02fc[_0x142433];return _0x2aa168;};'use strict';var _=require(_0xc02f('0x0'));var util=require('util');var moment=require(_0xc02f('0x1'));var BPromise=require(_0xc02f('0x2'));var rs=require(_0xc02f('0x3'));var fs=require('fs');var Redis=require(_0xc02f('0x4'));var db=require(_0xc02f('0x5'))['db'];var utils=require(_0xc02f('0x6'));var logger=require('../../config/logger')(_0xc02f('0x7'));var config=require(_0xc02f('0x8'));var jayson=require(_0xc02f('0x9'));var client=jayson[_0xc02f('0xa')][_0xc02f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x310b4c,_0x4e60fd,_0x7e10fa){return new BPromise(function(_0x6b234d,_0x35f79e){return client[_0xc02f('0xc')](_0x310b4c,_0x7e10fa)[_0xc02f('0xd')](function(_0x2c07fc){logger[_0xc02f('0xe')]('SquareRecording,\x20%s,\x20%s',_0x4e60fd,_0xc02f('0xf'));logger[_0xc02f('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x4e60fd,_0xc02f('0xf'),JSON['stringify'](_0x2c07fc));if(_0x2c07fc[_0xc02f('0x11')]){if(_0x2c07fc[_0xc02f('0x11')]['code']===0x1f4){logger['error'](_0xc02f('0x12'),_0x4e60fd,_0x2c07fc[_0xc02f('0x11')][_0xc02f('0x13')]);return _0x35f79e(_0x2c07fc[_0xc02f('0x11')][_0xc02f('0x13')]);}logger[_0xc02f('0x11')](_0xc02f('0x12'),_0x4e60fd,_0x2c07fc[_0xc02f('0x11')]['message']);return _0x6b234d(_0x2c07fc[_0xc02f('0x11')][_0xc02f('0x13')]);}else{logger[_0xc02f('0xe')]('SquareRecording,\x20%s,\x20%s',_0x4e60fd,'request\x20sent');_0x6b234d(_0x2c07fc[_0xc02f('0x14')]['message']);}})[_0xc02f('0x15')](function(_0x5b34bc){logger['error'](_0xc02f('0x12'),_0x4e60fd,_0x5b34bc);_0x35f79e(_0x5b34bc);});});}exports[_0xc02f('0x16')]=function(_0x5e53a7){var _0x240e97=this;return new Promise(function(_0x457cd7,_0x5e827e){return db['SquareRecording'][_0xc02f('0x17')](_0x5e53a7[_0xc02f('0x18')],{'raw':_0x5e53a7[_0xc02f('0x19')]?_0x5e53a7[_0xc02f('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x23ceb6){logger[_0xc02f('0xe')](_0xc02f('0x16'),_0x5e53a7);logger[_0xc02f('0x10')]('CreateSquareRecording',_0x5e53a7,JSON[_0xc02f('0x1a')](_0x23ceb6));_0x457cd7(_0x23ceb6);})['catch'](function(_0x4d8298){logger[_0xc02f('0x11')](_0xc02f('0x16'),_0x4d8298['message'],_0x5e53a7);_0x5e827e(_0x240e97[_0xc02f('0x11')](0x1f4,_0x4d8298[_0xc02f('0x13')]));});});};
\ No newline at end of file
+var _0xdd3f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareRecording','SquareRecording','body','options','raw','info','debug','catch','lodash','util','moment'];(function(_0x3a796e,_0x4e8a8c){var _0x11cc46=function(_0x3652de){while(--_0x3652de){_0x3a796e['push'](_0x3a796e['shift']());}};_0x11cc46(++_0x4e8a8c);}(_0xdd3f,0x147));var _0xfdd3=function(_0x37c33a,_0x523e81){_0x37c33a=_0x37c33a-0x0;var _0x1a41fc=_0xdd3f[_0x37c33a];return _0x1a41fc;};'use strict';var _=require(_0xfdd3('0x0'));var util=require(_0xfdd3('0x1'));var moment=require(_0xfdd3('0x2'));var BPromise=require('bluebird');var rs=require(_0xfdd3('0x3'));var fs=require('fs');var Redis=require(_0xfdd3('0x4'));var db=require(_0xfdd3('0x5'))['db'];var utils=require(_0xfdd3('0x6'));var logger=require(_0xfdd3('0x7'))(_0xfdd3('0x8'));var config=require(_0xfdd3('0x9'));var jayson=require(_0xfdd3('0xa'));var client=jayson['client'][_0xfdd3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ce46e,_0x4bb242,_0x2e92f3){return new BPromise(function(_0x205249,_0x82c8fb){return client[_0xfdd3('0xc')](_0x5ce46e,_0x2e92f3)[_0xfdd3('0xd')](function(_0x25dac2){logger['info'](_0xfdd3('0xe'),_0x4bb242,_0xfdd3('0xf'));logger['debug'](_0xfdd3('0x10'),_0x4bb242,'request\x20sent',JSON[_0xfdd3('0x11')](_0x25dac2));if(_0x25dac2[_0xfdd3('0x12')]){if(_0x25dac2[_0xfdd3('0x12')][_0xfdd3('0x13')]===0x1f4){logger[_0xfdd3('0x12')](_0xfdd3('0xe'),_0x4bb242,_0x25dac2[_0xfdd3('0x12')][_0xfdd3('0x14')]);return _0x82c8fb(_0x25dac2['error'][_0xfdd3('0x14')]);}logger[_0xfdd3('0x12')](_0xfdd3('0xe'),_0x4bb242,_0x25dac2[_0xfdd3('0x12')][_0xfdd3('0x14')]);return _0x205249(_0x25dac2[_0xfdd3('0x12')][_0xfdd3('0x14')]);}else{logger['info'](_0xfdd3('0xe'),_0x4bb242,_0xfdd3('0xf'));_0x205249(_0x25dac2[_0xfdd3('0x15')]['message']);}})['catch'](function(_0x573560){logger['error'](_0xfdd3('0xe'),_0x4bb242,_0x573560);_0x82c8fb(_0x573560);});});}exports[_0xfdd3('0x16')]=function(_0x16085a){var _0x4caafc=this;return new Promise(function(_0x1abee1,_0x3c5be6){return db[_0xfdd3('0x17')]['create'](_0x16085a[_0xfdd3('0x18')],{'raw':_0x16085a[_0xfdd3('0x19')]?_0x16085a['options'][_0xfdd3('0x1a')]===undefined?!![]:![]:!![]})[_0xfdd3('0xd')](function(_0x274893){logger[_0xfdd3('0x1b')](_0xfdd3('0x16'),_0x16085a);logger[_0xfdd3('0x1c')](_0xfdd3('0x16'),_0x16085a,JSON[_0xfdd3('0x11')](_0x274893));_0x1abee1(_0x274893);})[_0xfdd3('0x1d')](function(_0x25c643){logger[_0xfdd3('0x12')](_0xfdd3('0x16'),_0x25c643['message'],_0x16085a);_0x3c5be6(_0x4caafc[_0xfdd3('0x12')](0x1f4,_0x25c643[_0xfdd3('0x14')]));});});};
\ No newline at end of file
index 497c9e2..e678cf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71bb=['/:id','show','create','delete','exports','express','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe'];(function(_0x44d853,_0x687284){var _0xfa3100=function(_0x571eba){while(--_0x571eba){_0x44d853['push'](_0x44d853['shift']());}};_0xfa3100(++_0x687284);}(_0x71bb,0x161));var _0xb71b=function(_0x2f0b72,_0x2a3653){_0x2f0b72=_0x2f0b72-0x0;var _0x513d56=_0x71bb[_0x2f0b72];return _0x513d56;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb71b('0x0'));var router=express['Router']();var auth=require(_0xb71b('0x1'));var interaction=require(_0xb71b('0x2'));var config=require('../../config/environment');var controller=require('./squareReport.controller');router[_0xb71b('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb71b('0x3')](_0xb71b('0x4'),auth[_0xb71b('0x5')](),controller[_0xb71b('0x6')]);router[_0xb71b('0x3')](_0xb71b('0x7'),auth[_0xb71b('0x5')](),controller[_0xb71b('0x8')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb71b('0x9')]);router['put'](_0xb71b('0x7'),auth['isAuthenticated'](),controller['update']);router[_0xb71b('0xa')](_0xb71b('0x7'),auth[_0xb71b('0x5')](),controller['destroy']);module[_0xb71b('0xb')]=router;
\ No newline at end of file
+var _0x2f02=['index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./squareReport.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f02,0x170));var _0x22f0=function(_0xd6fcb5,_0x526523){_0xd6fcb5=_0xd6fcb5-0x0;var _0x278ac7=_0x2f02[_0xd6fcb5];return _0x278ac7;};'use strict';var multer=require(_0x22f0('0x0'));var util=require(_0x22f0('0x1'));var path=require(_0x22f0('0x2'));var timeout=require(_0x22f0('0x3'));var express=require(_0x22f0('0x4'));var router=express['Router']();var auth=require(_0x22f0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x22f0('0x6'));var controller=require(_0x22f0('0x7'));router[_0x22f0('0x8')]('/',auth[_0x22f0('0x9')](),controller[_0x22f0('0xa')]);router['get'](_0x22f0('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x22f0('0xc'),auth[_0x22f0('0x9')](),controller[_0x22f0('0xd')]);router[_0x22f0('0xe')]('/',auth['isAuthenticated'](),controller[_0x22f0('0xf')]);router[_0x22f0('0x10')](_0x22f0('0xc'),auth['isAuthenticated'](),controller[_0x22f0('0x11')]);router[_0x22f0('0x12')](_0x22f0('0xc'),auth[_0x22f0('0x9')](),controller[_0x22f0('0x13')]);module[_0x22f0('0x14')]=router;
\ No newline at end of file
index fe048cf..d00c786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac7d=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x3d9f5d,_0x51db56){var _0x1b2d1e=function(_0x478a0b){while(--_0x478a0b){_0x3d9f5d['push'](_0x3d9f5d['shift']());}};_0x1b2d1e(++_0x51db56);}(_0xac7d,0x6f));var _0xdac7=function(_0x24bb95,_0x159f95){_0x24bb95=_0x24bb95-0x0;var _0xfa9158=_0xac7d[_0x24bb95];return _0xfa9158;};'use strict';var Sequelize=require(_0xdac7('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xdac7('0x1')]},'request':{'type':Sequelize[_0xdac7('0x1')]},'channel':{'type':Sequelize[_0xdac7('0x1')]},'language':{'type':Sequelize[_0xdac7('0x1')]},'type':{'type':Sequelize[_0xdac7('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xdac7('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xdac7('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xdac7('0x1')]},'rdnis':{'type':Sequelize[_0xdac7('0x1')]},'context':{'type':Sequelize[_0xdac7('0x1')]},'extension':{'type':Sequelize[_0xdac7('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xdac7('0x1')]},'accountcode':{'type':Sequelize[_0xdac7('0x1')]},'threadid':{'type':Sequelize[_0xdac7('0x1')]},'project_name':{'type':Sequelize[_0xdac7('0x1')]},'joinAt':{'type':Sequelize[_0xdac7('0x2')]},'leaveAt':{'type':Sequelize[_0xdac7('0x2')]},'bot':{'type':Sequelize[_0xdac7('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xf5e0=['BOOLEAN','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5e0,0xa5));var _0x0f5e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf5e0[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0x0f5e('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x0f5e('0x1')]},'channel':{'type':Sequelize[_0x0f5e('0x1')]},'language':{'type':Sequelize[_0x0f5e('0x1')]},'type':{'type':Sequelize[_0x0f5e('0x1')]},'uniqueid':{'type':Sequelize[_0x0f5e('0x1')]},'version':{'type':Sequelize[_0x0f5e('0x1')]},'callerid':{'type':Sequelize[_0x0f5e('0x1')]},'calleridname':{'type':Sequelize[_0x0f5e('0x1')]},'callingpres':{'type':Sequelize[_0x0f5e('0x1')]},'callingani2':{'type':Sequelize[_0x0f5e('0x1')]},'callington':{'type':Sequelize[_0x0f5e('0x1')]},'callingtns':{'type':Sequelize[_0x0f5e('0x1')]},'dnid':{'type':Sequelize[_0x0f5e('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0f5e('0x1')]},'extension':{'type':Sequelize[_0x0f5e('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x0f5e('0x1')]},'joinAt':{'type':Sequelize[_0x0f5e('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x0f5e('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 38f10f9..6790b6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd51=['jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','crypto'];(function(_0x4783bd,_0x47805c){var _0x534bac=function(_0x9c9ddb){while(--_0x9c9ddb){_0x4783bd['push'](_0x4783bd['shift']());}};_0x534bac(++_0x47805c);}(_0xfd51,0x8a));var _0x1fd5=function(_0x5e9d29,_0x43c663){_0x5e9d29=_0x5e9d29-0x0;var _0x24947d=_0xfd51[_0x5e9d29];return _0x24947d;};'use strict';var pdf=require(_0x1fd5('0x0'));var emlformat=require(_0x1fd5('0x1'));var rimraf=require(_0x1fd5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1fd5('0x3'));var rp=require(_0x1fd5('0x4'));var moment=require(_0x1fd5('0x5'));var BPromise=require(_0x1fd5('0x6'));var Mustache=require(_0x1fd5('0x7'));var util=require('util');var path=require(_0x1fd5('0x8'));var sox=require(_0x1fd5('0x9'));var csv=require('to-csv');var ejs=require(_0x1fd5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1fd5('0xb'));var jsforce=require(_0x1fd5('0xc'));var deskjs=require(_0x1fd5('0xd'));var toCsv=require(_0x1fd5('0xe'));var querystring=require('querystring');var Papa=require(_0x1fd5('0xf'));var Redis=require(_0x1fd5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1fd5('0x11'));var as=require(_0x1fd5('0x12'));var hardwareService=require(_0x1fd5('0x13'));var logger=require(_0x1fd5('0x14'))(_0x1fd5('0x15'));var utils=require(_0x1fd5('0x16'));var config=require(_0x1fd5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x570534,_0x44ede0){_0x44ede0=_0x44ede0||0xcc;return function(_0x23124c){if(_0x23124c){return _0x570534['sendStatus'](_0x44ede0);}return _0x570534['status'](_0x44ede0)[_0x1fd5('0x18')]();};}function respondWithResult(_0x21a961,_0x2735ab){_0x2735ab=_0x2735ab||0xc8;return function(_0xc47ba){if(_0xc47ba){return _0x21a961[_0x1fd5('0x19')](_0x2735ab)[_0x1fd5('0x1a')](_0xc47ba);}};}function respondWithFilteredResult(_0x453858,_0x5af697){return function(_0x243dcf){if(_0x243dcf){var _0x45a6fb=_0x243dcf[_0x1fd5('0x1b')],_0x3426f4=_0x5af697[_0x1fd5('0x1c')],_0x5c19a9=_0x5af697[_0x1fd5('0x1c')]+_0x5af697['limit'],_0x4b0df7;if(_0x5c19a9>=_0x45a6fb){_0x5c19a9=_0x45a6fb;_0x4b0df7=0xc8;}else{_0x4b0df7=0xce;}_0x453858[_0x1fd5('0x19')](_0x4b0df7);return _0x453858[_0x1fd5('0x1d')](_0x1fd5('0x1e'),_0x3426f4+'-'+_0x5c19a9+'/'+_0x45a6fb)[_0x1fd5('0x1a')](_0x243dcf);}return null;};}function patchUpdates(_0x2175e6){return function(_0x4d74a0){try{jsonpatch[_0x1fd5('0x1f')](_0x4d74a0,_0x2175e6,!![]);}catch(_0x14afac){return BPromise[_0x1fd5('0x20')](_0x14afac);}return _0x4d74a0['save']();};}function saveUpdates(_0x2f49b7,_0x5dccdf){return function(_0x264262){if(_0x264262){return _0x264262[_0x1fd5('0x21')](_0x2f49b7)[_0x1fd5('0x22')](function(_0x5b8756){return _0x5b8756;});}return null;};}function removeEntity(_0x184df1,_0x5cb193){return function(_0x3f959c){if(_0x3f959c){return _0x3f959c[_0x1fd5('0x23')]()[_0x1fd5('0x22')](function(){_0x184df1['status'](0xcc)[_0x1fd5('0x18')]();});}};}function handleEntityNotFound(_0x534fcb,_0xea81de){return function(_0x233e83){if(!_0x233e83){_0x534fcb[_0x1fd5('0x24')](0x194);}return _0x233e83;};}function handleError(_0x17869b,_0x59fc8e){_0x59fc8e=_0x59fc8e||0x1f4;return function(_0x16bd4b){logger[_0x1fd5('0x25')](_0x16bd4b[_0x1fd5('0x26')]);if(_0x16bd4b[_0x1fd5('0x27')]){delete _0x16bd4b[_0x1fd5('0x27')];}_0x17869b[_0x1fd5('0x19')](_0x59fc8e)[_0x1fd5('0x28')](_0x16bd4b);};}exports[_0x1fd5('0x29')]=function(_0x4dd5b5,_0xe4c6e3){var _0x1c7c07={},_0x3243ab={},_0x11075c={'count':0x0,'rows':[]};var _0x1b640e=_[_0x1fd5('0x2a')](db[_0x1fd5('0x2b')][_0x1fd5('0x2c')],function(_0x135c56){return{'name':_0x135c56['fieldName'],'type':_0x135c56[_0x1fd5('0x2d')][_0x1fd5('0x2e')]};});_0x3243ab[_0x1fd5('0x2f')]=_[_0x1fd5('0x2a')](_0x1b640e,_0x1fd5('0x27'));_0x3243ab[_0x1fd5('0x30')]=_[_0x1fd5('0x31')](_0x4dd5b5['query']);_0x3243ab[_0x1fd5('0x32')]=_[_0x1fd5('0x33')](_0x3243ab['model'],_0x3243ab['query']);_0x1c7c07[_0x1fd5('0x34')]=_[_0x1fd5('0x33')](_0x3243ab[_0x1fd5('0x2f')],qs[_0x1fd5('0x35')](_0x4dd5b5[_0x1fd5('0x30')][_0x1fd5('0x35')]));_0x1c7c07[_0x1fd5('0x34')]=_0x1c7c07[_0x1fd5('0x34')][_0x1fd5('0x36')]?_0x1c7c07['attributes']:_0x3243ab[_0x1fd5('0x2f')];if(!_0x4dd5b5[_0x1fd5('0x30')][_0x1fd5('0x37')](_0x1fd5('0x38'))){_0x1c7c07[_0x1fd5('0x39')]=qs[_0x1fd5('0x39')](_0x4dd5b5['query'][_0x1fd5('0x39')]);_0x1c7c07[_0x1fd5('0x1c')]=qs[_0x1fd5('0x1c')](_0x4dd5b5[_0x1fd5('0x30')][_0x1fd5('0x1c')]);}_0x1c7c07[_0x1fd5('0x3a')]=qs[_0x1fd5('0x3b')](_0x4dd5b5[_0x1fd5('0x30')][_0x1fd5('0x3b')]);_0x1c7c07[_0x1fd5('0x3c')]=qs['filters'](_[_0x1fd5('0x3d')](_0x4dd5b5[_0x1fd5('0x30')],_0x3243ab[_0x1fd5('0x32')]),_0x1b640e);if(_0x4dd5b5['query'][_0x1fd5('0x3e')]){_0x1c7c07[_0x1fd5('0x3c')]=_['merge'](_0x1c7c07[_0x1fd5('0x3c')],{'$or':_['map'](_0x1b640e,function(_0x161a62){if(_0x161a62[_0x1fd5('0x2d')]!==_0x1fd5('0x3f')){var _0x19890a={};_0x19890a[_0x161a62[_0x1fd5('0x27')]]={'$like':'%'+_0x4dd5b5[_0x1fd5('0x30')][_0x1fd5('0x3e')]+'%'};return _0x19890a;}})});}_0x1c7c07=_[_0x1fd5('0x40')]({},_0x1c7c07,_0x4dd5b5[_0x1fd5('0x41')]);var _0x7be9ab={'where':_0x1c7c07[_0x1fd5('0x3c')]};return db[_0x1fd5('0x2b')]['count'](_0x7be9ab)['then'](function(_0x4948d4){_0x11075c[_0x1fd5('0x1b')]=_0x4948d4;if(_0x4dd5b5['query'][_0x1fd5('0x42')]){_0x1c7c07[_0x1fd5('0x43')]=[{'all':!![]}];}return db[_0x1fd5('0x2b')]['findAll'](_0x1c7c07);})[_0x1fd5('0x22')](function(_0x4fa7fb){_0x11075c[_0x1fd5('0x44')]=_0x4fa7fb;return _0x11075c;})['then'](respondWithFilteredResult(_0xe4c6e3,_0x1c7c07))[_0x1fd5('0x45')](handleError(_0xe4c6e3,null));};exports['show']=function(_0x6d5f94,_0x2969df){var _0x4ce451={'raw':!![],'where':{'id':_0x6d5f94[_0x1fd5('0x46')]['id']}},_0x1a1088={};_0x1a1088[_0x1fd5('0x2f')]=_[_0x1fd5('0x31')](db[_0x1fd5('0x2b')][_0x1fd5('0x2c')]);_0x1a1088['query']=_[_0x1fd5('0x31')](_0x6d5f94['query']);_0x1a1088[_0x1fd5('0x32')]=_[_0x1fd5('0x33')](_0x1a1088[_0x1fd5('0x2f')],_0x1a1088[_0x1fd5('0x30')]);_0x4ce451[_0x1fd5('0x34')]=_[_0x1fd5('0x33')](_0x1a1088['model'],qs[_0x1fd5('0x35')](_0x6d5f94[_0x1fd5('0x30')][_0x1fd5('0x35')]));_0x4ce451['attributes']=_0x4ce451['attributes'][_0x1fd5('0x36')]?_0x4ce451[_0x1fd5('0x34')]:_0x1a1088[_0x1fd5('0x2f')];if(_0x6d5f94[_0x1fd5('0x30')][_0x1fd5('0x42')]){_0x4ce451[_0x1fd5('0x43')]=[{'all':!![]}];}_0x4ce451=_['merge']({},_0x4ce451,_0x6d5f94['options']);return db['SquareReport']['find'](_0x4ce451)['then'](handleEntityNotFound(_0x2969df,null))[_0x1fd5('0x22')](respondWithResult(_0x2969df,null))['catch'](handleError(_0x2969df,null));};exports[_0x1fd5('0x47')]=function(_0x57555b,_0x329534){return db['SquareReport']['create'](_0x57555b['body'],{})[_0x1fd5('0x22')](respondWithResult(_0x329534,0xc9))[_0x1fd5('0x45')](handleError(_0x329534,null));};exports[_0x1fd5('0x21')]=function(_0x273c57,_0x3fde42){if(_0x273c57[_0x1fd5('0x48')]['id']){delete _0x273c57['body']['id'];}return db[_0x1fd5('0x2b')][_0x1fd5('0x49')]({'where':{'id':_0x273c57[_0x1fd5('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fde42,null))[_0x1fd5('0x22')](saveUpdates(_0x273c57[_0x1fd5('0x48')],null))['then'](respondWithResult(_0x3fde42,null))[_0x1fd5('0x45')](handleError(_0x3fde42,null));};exports[_0x1fd5('0x23')]=function(_0x417253,_0x4b82ee){return db['SquareReport'][_0x1fd5('0x49')]({'where':{'id':_0x417253[_0x1fd5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b82ee,null))[_0x1fd5('0x22')](removeEntity(_0x4b82ee,null))['catch'](handleError(_0x4b82ee,null));};exports['describe']=function(_0x428f7f,_0x270c02){return db[_0x1fd5('0x2b')][_0x1fd5('0x4a')]()[_0x1fd5('0x22')](respondWithResult(_0x270c02,null))[_0x1fd5('0x45')](handleError(_0x270c02,null));};
\ No newline at end of file
+var _0x6fed=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','include','findAll','catch','show','keys','rawAttributes','includeAll','find','create','body','update','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','then','end','error','stack','name','send','index','SquareReport','fieldName','type','key','query','filters','intersection','model'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6fed,0xfa));var _0xd6fe=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6fed[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd6fe('0x0'));var zipdir=require(_0xd6fe('0x1'));var jsonpatch=require(_0xd6fe('0x2'));var rp=require(_0xd6fe('0x3'));var moment=require('moment');var BPromise=require(_0xd6fe('0x4'));var Mustache=require(_0xd6fe('0x5'));var util=require(_0xd6fe('0x6'));var path=require(_0xd6fe('0x7'));var sox=require(_0xd6fe('0x8'));var csv=require(_0xd6fe('0x9'));var ejs=require(_0xd6fe('0xa'));var fs=require('fs');var _=require(_0xd6fe('0xb'));var squel=require('squel');var crypto=require(_0xd6fe('0xc'));var jsforce=require(_0xd6fe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd6fe('0x9'));var querystring=require(_0xd6fe('0xe'));var Papa=require(_0xd6fe('0xf'));var Redis=require(_0xd6fe('0x10'));var authService=require(_0xd6fe('0x11'));var qs=require(_0xd6fe('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6fe('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd6fe('0x14'))['db'];function respondWithStatusCode(_0x1c6e31,_0xe31cef){_0xe31cef=_0xe31cef||0xcc;return function(_0x5c7501){if(_0x5c7501){return _0x1c6e31[_0xd6fe('0x15')](_0xe31cef);}return _0x1c6e31[_0xd6fe('0x16')](_0xe31cef)['end']();};}function respondWithResult(_0x2411fe,_0x2f72eb){_0x2f72eb=_0x2f72eb||0xc8;return function(_0x18deae){if(_0x18deae){return _0x2411fe[_0xd6fe('0x16')](_0x2f72eb)['json'](_0x18deae);}};}function respondWithFilteredResult(_0x236269,_0xaa7a35){return function(_0x1131bc){if(_0x1131bc){var _0x25ce9e=_0x1131bc[_0xd6fe('0x17')],_0x3b3c1f=_0xaa7a35['offset'],_0x16b983=_0xaa7a35[_0xd6fe('0x18')]+_0xaa7a35[_0xd6fe('0x19')],_0x283ebd;if(_0x16b983>=_0x25ce9e){_0x16b983=_0x25ce9e;_0x283ebd=0xc8;}else{_0x283ebd=0xce;}_0x236269['status'](_0x283ebd);return _0x236269[_0xd6fe('0x1a')](_0xd6fe('0x1b'),_0x3b3c1f+'-'+_0x16b983+'/'+_0x25ce9e)[_0xd6fe('0x1c')](_0x1131bc);}return null;};}function patchUpdates(_0x303227){return function(_0x174869){try{jsonpatch['apply'](_0x174869,_0x303227,!![]);}catch(_0x28d504){return BPromise[_0xd6fe('0x1d')](_0x28d504);}return _0x174869[_0xd6fe('0x1e')]();};}function saveUpdates(_0x54ccc,_0x4edf78){return function(_0x1722f3){if(_0x1722f3){return _0x1722f3['update'](_0x54ccc)[_0xd6fe('0x1f')](function(_0x516125){return _0x516125;});}return null;};}function removeEntity(_0x3ce66f,_0x5a1060){return function(_0x198eaa){if(_0x198eaa){return _0x198eaa['destroy']()[_0xd6fe('0x1f')](function(){_0x3ce66f[_0xd6fe('0x16')](0xcc)[_0xd6fe('0x20')]();});}};}function handleEntityNotFound(_0x182893,_0x671535){return function(_0x37bfe9){if(!_0x37bfe9){_0x182893[_0xd6fe('0x15')](0x194);}return _0x37bfe9;};}function handleError(_0x1b2411,_0x323dd0){_0x323dd0=_0x323dd0||0x1f4;return function(_0x2332d7){logger[_0xd6fe('0x21')](_0x2332d7[_0xd6fe('0x22')]);if(_0x2332d7[_0xd6fe('0x23')]){delete _0x2332d7[_0xd6fe('0x23')];}_0x1b2411[_0xd6fe('0x16')](_0x323dd0)[_0xd6fe('0x24')](_0x2332d7);};}exports[_0xd6fe('0x25')]=function(_0x57d9a4,_0x595c4c){var _0x593257={},_0x1eb3fe={},_0x3c3bb8={'count':0x0,'rows':[]};var _0x2f42ac=_['map'](db[_0xd6fe('0x26')]['rawAttributes'],function(_0x27dc69){return{'name':_0x27dc69[_0xd6fe('0x27')],'type':_0x27dc69[_0xd6fe('0x28')][_0xd6fe('0x29')]};});_0x1eb3fe['model']=_['map'](_0x2f42ac,_0xd6fe('0x23'));_0x1eb3fe[_0xd6fe('0x2a')]=_['keys'](_0x57d9a4['query']);_0x1eb3fe[_0xd6fe('0x2b')]=_[_0xd6fe('0x2c')](_0x1eb3fe[_0xd6fe('0x2d')],_0x1eb3fe[_0xd6fe('0x2a')]);_0x593257[_0xd6fe('0x2e')]=_[_0xd6fe('0x2c')](_0x1eb3fe['model'],qs[_0xd6fe('0x2f')](_0x57d9a4[_0xd6fe('0x2a')]['fields']));_0x593257[_0xd6fe('0x2e')]=_0x593257[_0xd6fe('0x2e')][_0xd6fe('0x30')]?_0x593257[_0xd6fe('0x2e')]:_0x1eb3fe[_0xd6fe('0x2d')];if(!_0x57d9a4[_0xd6fe('0x2a')][_0xd6fe('0x31')](_0xd6fe('0x32'))){_0x593257['limit']=qs['limit'](_0x57d9a4[_0xd6fe('0x2a')][_0xd6fe('0x19')]);_0x593257[_0xd6fe('0x18')]=qs[_0xd6fe('0x18')](_0x57d9a4[_0xd6fe('0x2a')]['offset']);}_0x593257[_0xd6fe('0x33')]=qs[_0xd6fe('0x34')](_0x57d9a4['query']['sort']);_0x593257['where']=qs['filters'](_[_0xd6fe('0x35')](_0x57d9a4['query'],_0x1eb3fe[_0xd6fe('0x2b')]),_0x2f42ac);if(_0x57d9a4[_0xd6fe('0x2a')][_0xd6fe('0x36')]){_0x593257[_0xd6fe('0x37')]=_[_0xd6fe('0x38')](_0x593257[_0xd6fe('0x37')],{'$or':_[_0xd6fe('0x39')](_0x2f42ac,function(_0x3493ab){if(_0x3493ab['type']!==_0xd6fe('0x3a')){var _0x34331c={};_0x34331c[_0x3493ab[_0xd6fe('0x23')]]={'$like':'%'+_0x57d9a4[_0xd6fe('0x2a')]['filter']+'%'};return _0x34331c;}})});}_0x593257=_[_0xd6fe('0x38')]({},_0x593257,_0x57d9a4[_0xd6fe('0x3b')]);var _0x278ec2={'where':_0x593257[_0xd6fe('0x37')]};return db[_0xd6fe('0x26')][_0xd6fe('0x17')](_0x278ec2)[_0xd6fe('0x1f')](function(_0x327a59){_0x3c3bb8['count']=_0x327a59;if(_0x57d9a4[_0xd6fe('0x2a')]['includeAll']){_0x593257[_0xd6fe('0x3c')]=[{'all':!![]}];}return db[_0xd6fe('0x26')][_0xd6fe('0x3d')](_0x593257);})['then'](function(_0x49b45a){_0x3c3bb8['rows']=_0x49b45a;return _0x3c3bb8;})[_0xd6fe('0x1f')](respondWithFilteredResult(_0x595c4c,_0x593257))[_0xd6fe('0x3e')](handleError(_0x595c4c,null));};exports[_0xd6fe('0x3f')]=function(_0x244a82,_0x312e2a){var _0x3802d6={'raw':!![],'where':{'id':_0x244a82['params']['id']}},_0x499447={};_0x499447[_0xd6fe('0x2d')]=_[_0xd6fe('0x40')](db[_0xd6fe('0x26')][_0xd6fe('0x41')]);_0x499447[_0xd6fe('0x2a')]=_['keys'](_0x244a82['query']);_0x499447['filters']=_[_0xd6fe('0x2c')](_0x499447[_0xd6fe('0x2d')],_0x499447[_0xd6fe('0x2a')]);_0x3802d6[_0xd6fe('0x2e')]=_[_0xd6fe('0x2c')](_0x499447[_0xd6fe('0x2d')],qs['fields'](_0x244a82[_0xd6fe('0x2a')][_0xd6fe('0x2f')]));_0x3802d6[_0xd6fe('0x2e')]=_0x3802d6[_0xd6fe('0x2e')][_0xd6fe('0x30')]?_0x3802d6['attributes']:_0x499447[_0xd6fe('0x2d')];if(_0x244a82[_0xd6fe('0x2a')][_0xd6fe('0x42')]){_0x3802d6[_0xd6fe('0x3c')]=[{'all':!![]}];}_0x3802d6=_[_0xd6fe('0x38')]({},_0x3802d6,_0x244a82[_0xd6fe('0x3b')]);return db[_0xd6fe('0x26')][_0xd6fe('0x43')](_0x3802d6)['then'](handleEntityNotFound(_0x312e2a,null))[_0xd6fe('0x1f')](respondWithResult(_0x312e2a,null))[_0xd6fe('0x3e')](handleError(_0x312e2a,null));};exports[_0xd6fe('0x44')]=function(_0xa65059,_0x4a5fd7){return db[_0xd6fe('0x26')]['create'](_0xa65059[_0xd6fe('0x45')],{})[_0xd6fe('0x1f')](respondWithResult(_0x4a5fd7,0xc9))[_0xd6fe('0x3e')](handleError(_0x4a5fd7,null));};exports[_0xd6fe('0x46')]=function(_0x4a030e,_0x25e0b3){if(_0x4a030e['body']['id']){delete _0x4a030e[_0xd6fe('0x45')]['id'];}return db['SquareReport'][_0xd6fe('0x43')]({'where':{'id':_0x4a030e[_0xd6fe('0x47')]['id']}})[_0xd6fe('0x1f')](handleEntityNotFound(_0x25e0b3,null))[_0xd6fe('0x1f')](saveUpdates(_0x4a030e['body'],null))[_0xd6fe('0x1f')](respondWithResult(_0x25e0b3,null))[_0xd6fe('0x3e')](handleError(_0x25e0b3,null));};exports[_0xd6fe('0x48')]=function(_0x4cf95c,_0x37f635){return db[_0xd6fe('0x26')][_0xd6fe('0x43')]({'where':{'id':_0x4cf95c[_0xd6fe('0x47')]['id']}})['then'](handleEntityNotFound(_0x37f635,null))['then'](removeEntity(_0x37f635,null))[_0xd6fe('0x3e')](handleError(_0x37f635,null));};exports[_0xd6fe('0x49')]=function(_0x5e6c99,_0x3c1fa8){return db[_0xd6fe('0x26')][_0xd6fe('0x49')]()['then'](respondWithResult(_0x3c1fa8,null))[_0xd6fe('0x3e')](handleError(_0x3c1fa8,null));};
\ No newline at end of file
index bb3cd32..846d386 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6861=['project_name','leaveAt','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uniqueid'];(function(_0x352833,_0x348f7f){var _0x29c92b=function(_0x44751a){while(--_0x44751a){_0x352833['push'](_0x352833['shift']());}};_0x29c92b(++_0x348f7f);}(_0x6861,0x132));var _0x1686=function(_0x239d82,_0x37a4cd){_0x239d82=_0x239d82-0x0;var _0x55380d=_0x6861[_0x239d82];return _0x55380d;};'use strict';var _=require(_0x1686('0x0'));var util=require(_0x1686('0x1'));var logger=require(_0x1686('0x2'))(_0x1686('0x3'));var moment=require(_0x1686('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1686('0x5'));var rimraf=require(_0x1686('0x6'));var config=require(_0x1686('0x7'));var attributes=require(_0x1686('0x8'));module[_0x1686('0x9')]=function(_0x9b2837,_0x49e4d1){return _0x9b2837[_0x1686('0xa')](_0x1686('0xb'),attributes,{'tableName':_0x1686('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x1686('0xd'),_0x1686('0xe')]},{'name':_0x1686('0xf'),'fields':[_0x1686('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfae7=['./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x296260,_0x1c8a20){var _0x56b38f=function(_0x59bbf7){while(--_0x59bbf7){_0x296260['push'](_0x296260['shift']());}};_0x56b38f(++_0x1c8a20);}(_0xfae7,0x18f));var _0x7fae=function(_0x8f9691,_0x2cb861){_0x8f9691=_0x8f9691-0x0;var _0x314fa5=_0xfae7[_0x8f9691];return _0x314fa5;};'use strict';var _=require(_0x7fae('0x0'));var util=require('util');var logger=require(_0x7fae('0x1'))(_0x7fae('0x2'));var moment=require(_0x7fae('0x3'));var BPromise=require(_0x7fae('0x4'));var rp=require(_0x7fae('0x5'));var fs=require('fs');var path=require(_0x7fae('0x6'));var rimraf=require(_0x7fae('0x7'));var config=require(_0x7fae('0x8'));var attributes=require(_0x7fae('0x9'));module[_0x7fae('0xa')]=function(_0x19d25f,_0x12109e){return _0x19d25f[_0x7fae('0xb')](_0x7fae('0xc'),attributes,{'tableName':_0x7fae('0xd'),'paranoid':![],'indexes':[{'name':_0x7fae('0xe'),'fields':['uniqueid',_0x7fae('0xf')]},{'name':_0x7fae('0x10'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
index 0795c48..14d2e5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa61b=['rpc','../../config/environment','jayson/promise','request','then','SquareReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','create','options','CreateSquareReport','UpdateSquareReport','SquareReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x40edc7,_0x154969){var _0x3334c9=function(_0x40957c){while(--_0x40957c){_0x40edc7['push'](_0x40edc7['shift']());}};_0x3334c9(++_0x154969);}(_0xa61b,0xe9));var _0xba61=function(_0x58609b,_0x4b9fc7){_0x58609b=_0x58609b-0x0;var _0x4c9ace=_0xa61b[_0x58609b];return _0x4c9ace;};'use strict';var _=require(_0xba61('0x0'));var util=require(_0xba61('0x1'));var moment=require(_0xba61('0x2'));var BPromise=require(_0xba61('0x3'));var rs=require(_0xba61('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba61('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xba61('0x6'))(_0xba61('0x7'));var config=require(_0xba61('0x8'));var jayson=require(_0xba61('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x255600,_0x19e3c6,_0x14463d){return new BPromise(function(_0x5c1b17,_0x4dc15){return client[_0xba61('0xa')](_0x255600,_0x14463d)[_0xba61('0xb')](function(_0x248b72){logger['info'](_0xba61('0xc'),_0x19e3c6,'request\x20sent');logger[_0xba61('0xd')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x19e3c6,_0xba61('0xe'),JSON[_0xba61('0xf')](_0x248b72));if(_0x248b72[_0xba61('0x10')]){if(_0x248b72['error'][_0xba61('0x11')]===0x1f4){logger[_0xba61('0x10')](_0xba61('0xc'),_0x19e3c6,_0x248b72[_0xba61('0x10')]['message']);return _0x4dc15(_0x248b72[_0xba61('0x10')][_0xba61('0x12')]);}logger['error'](_0xba61('0xc'),_0x19e3c6,_0x248b72[_0xba61('0x10')][_0xba61('0x12')]);return _0x5c1b17(_0x248b72[_0xba61('0x10')]['message']);}else{logger[_0xba61('0x13')]('SquareReport,\x20%s,\x20%s',_0x19e3c6,_0xba61('0xe'));_0x5c1b17(_0x248b72[_0xba61('0x14')][_0xba61('0x12')]);}})[_0xba61('0x15')](function(_0x4fe4d1){logger[_0xba61('0x10')](_0xba61('0xc'),_0x19e3c6,_0x4fe4d1);_0x4dc15(_0x4fe4d1);});});}exports['CreateSquareReport']=function(_0x2b0839){var _0xdcab4e=this;return new Promise(function(_0x58ced3,_0x31557b){return db['SquareReport'][_0xba61('0x16')](_0x2b0839['body'],{'raw':_0x2b0839['options']?_0x2b0839[_0xba61('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xba61('0xb')](function(_0x559c88){logger[_0xba61('0x13')](_0xba61('0x18'),_0x2b0839);logger[_0xba61('0xd')](_0xba61('0x18'),_0x2b0839,JSON[_0xba61('0xf')](_0x559c88));_0x58ced3(_0x559c88);})[_0xba61('0x15')](function(_0x1e01c8){logger['error'](_0xba61('0x18'),_0x1e01c8[_0xba61('0x12')],_0x2b0839);_0x31557b(_0xdcab4e[_0xba61('0x10')](0x1f4,_0x1e01c8['message']));});});};exports[_0xba61('0x19')]=function(_0x3a3f89){var _0x5b5402=this;return new Promise(function(_0x1e3714,_0xda39c3){return db[_0xba61('0x1a')][_0xba61('0x1b')](_0x3a3f89['body'],{'raw':_0x3a3f89[_0xba61('0x17')]?_0x3a3f89[_0xba61('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a3f89[_0xba61('0x17')]?_0x3a3f89[_0xba61('0x17')][_0xba61('0x1c')]||null:null,'attributes':_0x3a3f89[_0xba61('0x17')]?_0x3a3f89[_0xba61('0x17')][_0xba61('0x1d')]||null:null,'limit':_0x3a3f89[_0xba61('0x17')]?_0x3a3f89[_0xba61('0x17')]['limit']||null:null})[_0xba61('0xb')](function(_0x19cc65){logger[_0xba61('0x13')](_0xba61('0x19'),_0x3a3f89);logger['debug']('UpdateSquareReport',_0x3a3f89,JSON[_0xba61('0xf')](_0x19cc65));_0x1e3714(_0x19cc65);})['catch'](function(_0xa65fa5){logger['error'](_0xba61('0x19'),_0xa65fa5[_0xba61('0x12')],_0x3a3f89);_0xda39c3(_0x5b5402[_0xba61('0x10')](0x1f4,_0xa65fa5['message']));});});};
\ No newline at end of file
+var _0xe16b=['debug','stringify','error','code','message','info','result','catch','CreateSquareReport','create','body','options','raw','UpdateSquareReport','SquareReport','update','where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent'];(function(_0xb4d02b,_0x42e388){var _0x177778=function(_0x5681c3){while(--_0x5681c3){_0xb4d02b['push'](_0xb4d02b['shift']());}};_0x177778(++_0x42e388);}(_0xe16b,0x145));var _0xbe16=function(_0x4b8156,_0x437af2){_0x4b8156=_0x4b8156-0x0;var _0x4a819c=_0xe16b[_0x4b8156];return _0x4a819c;};'use strict';var _=require(_0xbe16('0x0'));var util=require(_0xbe16('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe16('0x2'));var fs=require('fs');var Redis=require(_0xbe16('0x3'));var db=require(_0xbe16('0x4'))['db'];var utils=require(_0xbe16('0x5'));var logger=require(_0xbe16('0x6'))(_0xbe16('0x7'));var config=require(_0xbe16('0x8'));var jayson=require(_0xbe16('0x9'));var client=jayson['client'][_0xbe16('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4323ff,_0x38e990,_0x395d10){return new BPromise(function(_0x871782,_0x265d9f){return client[_0xbe16('0xb')](_0x4323ff,_0x395d10)[_0xbe16('0xc')](function(_0x262ddd){logger['info'](_0xbe16('0xd'),_0x38e990,_0xbe16('0xe'));logger[_0xbe16('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x38e990,_0xbe16('0xe'),JSON[_0xbe16('0x10')](_0x262ddd));if(_0x262ddd[_0xbe16('0x11')]){if(_0x262ddd['error'][_0xbe16('0x12')]===0x1f4){logger[_0xbe16('0x11')](_0xbe16('0xd'),_0x38e990,_0x262ddd[_0xbe16('0x11')]['message']);return _0x265d9f(_0x262ddd[_0xbe16('0x11')][_0xbe16('0x13')]);}logger['error'](_0xbe16('0xd'),_0x38e990,_0x262ddd[_0xbe16('0x11')][_0xbe16('0x13')]);return _0x871782(_0x262ddd['error']['message']);}else{logger[_0xbe16('0x14')](_0xbe16('0xd'),_0x38e990,'request\x20sent');_0x871782(_0x262ddd[_0xbe16('0x15')][_0xbe16('0x13')]);}})[_0xbe16('0x16')](function(_0x49f2cf){logger[_0xbe16('0x11')]('SquareReport,\x20%s,\x20%s',_0x38e990,_0x49f2cf);_0x265d9f(_0x49f2cf);});});}exports[_0xbe16('0x17')]=function(_0xb82763){var _0x45a8e9=this;return new Promise(function(_0x177f97,_0x4aff99){return db['SquareReport'][_0xbe16('0x18')](_0xb82763[_0xbe16('0x19')],{'raw':_0xb82763[_0xbe16('0x1a')]?_0xb82763[_0xbe16('0x1a')][_0xbe16('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x438b7e){logger[_0xbe16('0x14')](_0xbe16('0x17'),_0xb82763);logger['debug'](_0xbe16('0x17'),_0xb82763,JSON[_0xbe16('0x10')](_0x438b7e));_0x177f97(_0x438b7e);})[_0xbe16('0x16')](function(_0x5c4a56){logger[_0xbe16('0x11')](_0xbe16('0x17'),_0x5c4a56[_0xbe16('0x13')],_0xb82763);_0x4aff99(_0x45a8e9[_0xbe16('0x11')](0x1f4,_0x5c4a56['message']));});});};exports[_0xbe16('0x1c')]=function(_0x32deae){var _0x2edd85=this;return new Promise(function(_0x26d348,_0x4a6157){return db[_0xbe16('0x1d')][_0xbe16('0x1e')](_0x32deae[_0xbe16('0x19')],{'raw':_0x32deae['options']?_0x32deae[_0xbe16('0x1a')][_0xbe16('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32deae['options']?_0x32deae[_0xbe16('0x1a')][_0xbe16('0x1f')]||null:null,'attributes':_0x32deae['options']?_0x32deae[_0xbe16('0x1a')][_0xbe16('0x20')]||null:null,'limit':_0x32deae[_0xbe16('0x1a')]?_0x32deae[_0xbe16('0x1a')][_0xbe16('0x21')]||null:null})['then'](function(_0x5c5517){logger[_0xbe16('0x14')](_0xbe16('0x1c'),_0x32deae);logger['debug'](_0xbe16('0x1c'),_0x32deae,JSON[_0xbe16('0x10')](_0x5c5517));_0x26d348(_0x5c5517);})[_0xbe16('0x16')](function(_0x215a69){logger[_0xbe16('0x11')](_0xbe16('0x1c'),_0x215a69[_0xbe16('0x13')],_0x32deae);_0x4a6157(_0x2edd85[_0xbe16('0x11')](0x1f4,_0x215a69[_0xbe16('0x13')]));});});};
\ No newline at end of file
index b4600a9..3bad2b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x13a5b4,_0x649bea){var _0x30afd4=function(_0xaeb65a){while(--_0xaeb65a){_0x13a5b4['push'](_0x13a5b4['shift']());}};_0x30afd4(++_0x649bea);}(_0x5f2f,0x73));var _0xf5f2=function(_0x54fda5,_0x1093c6){_0x54fda5=_0x54fda5-0x0;var _0x34c133=_0x5f2f[_0x54fda5];return _0x34c133;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router;
\ No newline at end of file
+var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x19dfee,_0x314a43){var _0x6f4a82=function(_0x52ff86){while(--_0x52ff86){_0x19dfee['push'](_0x19dfee['shift']());}};_0x6f4a82(++_0x314a43);}(_0x5f2f,0x73));var _0xf5f2=function(_0x459f94,_0x570e5e){_0x459f94=_0x459f94-0x0;var _0xa1ac8c=_0x5f2f[_0x459f94];return _0xa1ac8c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router;
\ No newline at end of file
index 2001eaf..f3198a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7d7=['exports','STRING','sequelize'];(function(_0x5e3f88,_0xf9b218){var _0x161d3f=function(_0x5b7ac1){while(--_0x5b7ac1){_0x5e3f88['push'](_0x5e3f88['shift']());}};_0x161d3f(++_0xf9b218);}(_0xe7d7,0x1e5));var _0x7e7d=function(_0x238793,_0x4a3755){_0x238793=_0x238793-0x0;var _0x109e7b=_0xe7d7[_0x238793];return _0x109e7b;};'use strict';var Sequelize=require(_0x7e7d('0x0'));module[_0x7e7d('0x1')]={'uniqueid':{'type':Sequelize[_0x7e7d('0x2')]},'node':{'type':Sequelize[_0x7e7d('0x2')]},'application':{'type':Sequelize[_0x7e7d('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x7e7d('0x2')]},'callerid':{'type':Sequelize[_0x7e7d('0x2')]}};
\ No newline at end of file
+var _0xd44c=['sequelize','exports','STRING','TEXT'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xd44c,0x1e0));var _0xcd44=function(_0x115621,_0x341cde){_0x115621=_0x115621-0x0;var _0x5ef5ce=_0xd44c[_0x115621];return _0x5ef5ce;};'use strict';var Sequelize=require(_0xcd44('0x0'));module[_0xcd44('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xcd44('0x2')]},'application':{'type':Sequelize[_0xcd44('0x2')]},'data':{'type':Sequelize[_0xcd44('0x3')]},'project_name':{'type':Sequelize[_0xcd44('0x2')]},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 345c7dd..545d875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc812=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SquareDetailsReport','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','util','to-csv','ejs','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc812,0x1eb));var _0x2c81=function(_0x39ad23,_0x1ef6a5){_0x39ad23=_0x39ad23-0x0;var _0x710d93=_0xc812[_0x39ad23];return _0x710d93;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2c81('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c81('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2c81('0x2'));var Mustache=require('mustache');var util=require(_0x2c81('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x2c81('0x4'));var ejs=require(_0x2c81('0x5'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2c81('0x6'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2c81('0x4'));var querystring=require('querystring');var Papa=require(_0x2c81('0x7'));var Redis=require(_0x2c81('0x8'));var authService=require(_0x2c81('0x9'));var qs=require('../../components/parsers/qs');var as=require(_0x2c81('0xa'));var hardwareService=require(_0x2c81('0xb'));var logger=require(_0x2c81('0xc'))(_0x2c81('0xd'));var utils=require('../../config/utils');var config=require(_0x2c81('0xe'));var db=require(_0x2c81('0xf'))['db'];function respondWithStatusCode(_0x20e9a3,_0x594bd3){_0x594bd3=_0x594bd3||0xcc;return function(_0x462c2c){if(_0x462c2c){return _0x20e9a3[_0x2c81('0x10')](_0x594bd3);}return _0x20e9a3[_0x2c81('0x11')](_0x594bd3)[_0x2c81('0x12')]();};}function respondWithResult(_0x46613f,_0x4a7c37){_0x4a7c37=_0x4a7c37||0xc8;return function(_0x51a97f){if(_0x51a97f){return _0x46613f[_0x2c81('0x11')](_0x4a7c37)[_0x2c81('0x13')](_0x51a97f);}};}function respondWithFilteredResult(_0x29a7d1,_0x1dc488){return function(_0x4563ae){if(_0x4563ae){var _0xa6fb84=_0x4563ae[_0x2c81('0x14')],_0x13287d=_0x1dc488[_0x2c81('0x15')],_0x1aaf83=_0x1dc488[_0x2c81('0x15')]+_0x1dc488[_0x2c81('0x16')],_0x33dbed;if(_0x1aaf83>=_0xa6fb84){_0x1aaf83=_0xa6fb84;_0x33dbed=0xc8;}else{_0x33dbed=0xce;}_0x29a7d1[_0x2c81('0x11')](_0x33dbed);return _0x29a7d1[_0x2c81('0x17')](_0x2c81('0x18'),_0x13287d+'-'+_0x1aaf83+'/'+_0xa6fb84)['json'](_0x4563ae);}return null;};}function patchUpdates(_0x22bdd6){return function(_0x56525b){try{jsonpatch['apply'](_0x56525b,_0x22bdd6,!![]);}catch(_0x24caf2){return BPromise[_0x2c81('0x19')](_0x24caf2);}return _0x56525b[_0x2c81('0x1a')]();};}function saveUpdates(_0x181905,_0x4941cd){return function(_0x2d43c0){if(_0x2d43c0){return _0x2d43c0[_0x2c81('0x1b')](_0x181905)[_0x2c81('0x1c')](function(_0x4547b4){return _0x4547b4;});}return null;};}function removeEntity(_0x32fd32,_0x1b2622){return function(_0x19fced){if(_0x19fced){return _0x19fced[_0x2c81('0x1d')]()[_0x2c81('0x1c')](function(){_0x32fd32[_0x2c81('0x11')](0xcc)[_0x2c81('0x12')]();});}};}function handleEntityNotFound(_0x34857c,_0x2e7cac){return function(_0x1a7935){if(!_0x1a7935){_0x34857c[_0x2c81('0x10')](0x194);}return _0x1a7935;};}function handleError(_0x1d6e22,_0x178bd3){_0x178bd3=_0x178bd3||0x1f4;return function(_0x2d534e){logger[_0x2c81('0x1e')](_0x2d534e[_0x2c81('0x1f')]);if(_0x2d534e['name']){delete _0x2d534e['name'];}_0x1d6e22['status'](_0x178bd3)['send'](_0x2d534e);};}exports[_0x2c81('0x20')]=function(_0x3a998d,_0xf3d66d){var _0x5ca29b={},_0x52fdea={},_0x3d68d0={'count':0x0,'rows':[]};var _0x163e8f=_[_0x2c81('0x21')](db['SquareDetailsReport'][_0x2c81('0x22')],function(_0x317804){return{'name':_0x317804[_0x2c81('0x23')],'type':_0x317804[_0x2c81('0x24')][_0x2c81('0x25')]};});_0x52fdea[_0x2c81('0x26')]=_[_0x2c81('0x21')](_0x163e8f,_0x2c81('0x27'));_0x52fdea[_0x2c81('0x28')]=_['keys'](_0x3a998d[_0x2c81('0x28')]);_0x52fdea[_0x2c81('0x29')]=_[_0x2c81('0x2a')](_0x52fdea[_0x2c81('0x26')],_0x52fdea['query']);_0x5ca29b[_0x2c81('0x2b')]=_[_0x2c81('0x2a')](_0x52fdea[_0x2c81('0x26')],qs[_0x2c81('0x2c')](_0x3a998d[_0x2c81('0x28')][_0x2c81('0x2c')]));_0x5ca29b['attributes']=_0x5ca29b[_0x2c81('0x2b')][_0x2c81('0x2d')]?_0x5ca29b[_0x2c81('0x2b')]:_0x52fdea['model'];if(!_0x3a998d[_0x2c81('0x28')][_0x2c81('0x2e')](_0x2c81('0x2f'))){_0x5ca29b[_0x2c81('0x16')]=qs[_0x2c81('0x16')](_0x3a998d[_0x2c81('0x28')][_0x2c81('0x16')]);_0x5ca29b['offset']=qs['offset'](_0x3a998d[_0x2c81('0x28')][_0x2c81('0x15')]);}_0x5ca29b[_0x2c81('0x30')]=qs[_0x2c81('0x31')](_0x3a998d[_0x2c81('0x28')][_0x2c81('0x31')]);_0x5ca29b[_0x2c81('0x32')]=qs[_0x2c81('0x29')](_['pick'](_0x3a998d['query'],_0x52fdea[_0x2c81('0x29')]),_0x163e8f);if(_0x3a998d[_0x2c81('0x28')][_0x2c81('0x33')]){_0x5ca29b[_0x2c81('0x32')]=_[_0x2c81('0x34')](_0x5ca29b['where'],{'$or':_['map'](_0x163e8f,function(_0x2db49b){if(_0x2db49b[_0x2c81('0x24')]!==_0x2c81('0x35')){var _0xfd06d7={};_0xfd06d7[_0x2db49b[_0x2c81('0x27')]]={'$like':'%'+_0x3a998d[_0x2c81('0x28')][_0x2c81('0x33')]+'%'};return _0xfd06d7;}})});}_0x5ca29b=_[_0x2c81('0x34')]({},_0x5ca29b,_0x3a998d[_0x2c81('0x36')]);var _0x534070={'where':_0x5ca29b[_0x2c81('0x32')]};return db[_0x2c81('0x37')][_0x2c81('0x14')](_0x534070)[_0x2c81('0x1c')](function(_0x30dd95){_0x3d68d0['count']=_0x30dd95;if(_0x3a998d[_0x2c81('0x28')][_0x2c81('0x38')]){_0x5ca29b[_0x2c81('0x39')]=[{'all':!![]}];}return db[_0x2c81('0x37')][_0x2c81('0x3a')](_0x5ca29b);})[_0x2c81('0x1c')](function(_0x14993a){_0x3d68d0['rows']=_0x14993a;return _0x3d68d0;})[_0x2c81('0x1c')](respondWithFilteredResult(_0xf3d66d,_0x5ca29b))[_0x2c81('0x3b')](handleError(_0xf3d66d,null));};exports[_0x2c81('0x3c')]=function(_0x3366b0,_0xf1e7e3){var _0x57f648={'raw':!![],'where':{'id':_0x3366b0[_0x2c81('0x3d')]['id']}},_0x17beef={};_0x17beef[_0x2c81('0x26')]=_[_0x2c81('0x3e')](db[_0x2c81('0x37')]['rawAttributes']);_0x17beef[_0x2c81('0x28')]=_[_0x2c81('0x3e')](_0x3366b0['query']);_0x17beef[_0x2c81('0x29')]=_[_0x2c81('0x2a')](_0x17beef[_0x2c81('0x26')],_0x17beef['query']);_0x57f648[_0x2c81('0x2b')]=_[_0x2c81('0x2a')](_0x17beef[_0x2c81('0x26')],qs[_0x2c81('0x2c')](_0x3366b0[_0x2c81('0x28')][_0x2c81('0x2c')]));_0x57f648['attributes']=_0x57f648[_0x2c81('0x2b')][_0x2c81('0x2d')]?_0x57f648['attributes']:_0x17beef[_0x2c81('0x26')];if(_0x3366b0['query'][_0x2c81('0x38')]){_0x57f648[_0x2c81('0x39')]=[{'all':!![]}];}_0x57f648=_[_0x2c81('0x34')]({},_0x57f648,_0x3366b0[_0x2c81('0x36')]);return db['SquareDetailsReport'][_0x2c81('0x3f')](_0x57f648)[_0x2c81('0x1c')](handleEntityNotFound(_0xf1e7e3,null))[_0x2c81('0x1c')](respondWithResult(_0xf1e7e3,null))['catch'](handleError(_0xf1e7e3,null));};exports['create']=function(_0x4f92f4,_0x8291e1){return db[_0x2c81('0x37')][_0x2c81('0x40')](_0x4f92f4[_0x2c81('0x41')],{})[_0x2c81('0x1c')](respondWithResult(_0x8291e1,0xc9))[_0x2c81('0x3b')](handleError(_0x8291e1,null));};exports[_0x2c81('0x1b')]=function(_0x42c5a1,_0x21807a){if(_0x42c5a1[_0x2c81('0x41')]['id']){delete _0x42c5a1[_0x2c81('0x41')]['id'];}return db['SquareDetailsReport'][_0x2c81('0x3f')]({'where':{'id':_0x42c5a1[_0x2c81('0x3d')]['id']}})['then'](handleEntityNotFound(_0x21807a,null))[_0x2c81('0x1c')](saveUpdates(_0x42c5a1[_0x2c81('0x41')],null))[_0x2c81('0x1c')](respondWithResult(_0x21807a,null))[_0x2c81('0x3b')](handleError(_0x21807a,null));};exports[_0x2c81('0x1d')]=function(_0x1431e0,_0x471871){return db[_0x2c81('0x37')][_0x2c81('0x3f')]({'where':{'id':_0x1431e0[_0x2c81('0x3d')]['id']}})[_0x2c81('0x1c')](handleEntityNotFound(_0x471871,null))['then'](removeEntity(_0x471871,null))[_0x2c81('0x3b')](handleError(_0x471871,null));};exports[_0x2c81('0x42')]=function(_0x34083d,_0x42a949){return db['SquareDetailsReport'][_0x2c81('0x42')]()[_0x2c81('0x1c')](respondWithResult(_0x42a949,null))[_0x2c81('0x3b')](handleError(_0x42a949,null));};
\ No newline at end of file
+var _0x6557=['status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','nolimit','sort','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','intersection','length','find','create','body','catch','describe','eml-format','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x6557,0x146));var _0x7655=function(_0x5498f3,_0x133c45){_0x5498f3=_0x5498f3-0x0;var _0x1fcb0b=_0x6557[_0x5498f3];return _0x1fcb0b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7655('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7655('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7655('0x2'));var moment=require('moment');var BPromise=require(_0x7655('0x3'));var Mustache=require(_0x7655('0x4'));var util=require('util');var path=require('path');var sox=require(_0x7655('0x5'));var csv=require(_0x7655('0x6'));var ejs=require(_0x7655('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7655('0x8'));var crypto=require(_0x7655('0x9'));var jsforce=require(_0x7655('0xa'));var deskjs=require(_0x7655('0xb'));var toCsv=require(_0x7655('0x6'));var querystring=require(_0x7655('0xc'));var Papa=require('papaparse');var Redis=require(_0x7655('0xd'));var authService=require(_0x7655('0xe'));var qs=require(_0x7655('0xf'));var as=require(_0x7655('0x10'));var hardwareService=require(_0x7655('0x11'));var logger=require(_0x7655('0x12'))(_0x7655('0x13'));var utils=require(_0x7655('0x14'));var config=require(_0x7655('0x15'));var db=require(_0x7655('0x16'))['db'];function respondWithStatusCode(_0x1d002f,_0x2169d3){_0x2169d3=_0x2169d3||0xcc;return function(_0xaa27a0){if(_0xaa27a0){return _0x1d002f[_0x7655('0x17')](_0x2169d3);}return _0x1d002f[_0x7655('0x18')](_0x2169d3)['end']();};}function respondWithResult(_0x5ef4a0,_0x3c9b41){_0x3c9b41=_0x3c9b41||0xc8;return function(_0x415275){if(_0x415275){return _0x5ef4a0[_0x7655('0x18')](_0x3c9b41)[_0x7655('0x19')](_0x415275);}};}function respondWithFilteredResult(_0x58e323,_0x45328f){return function(_0x5aace7){if(_0x5aace7){var _0xf8edf6=_0x5aace7['count'],_0x576685=_0x45328f['offset'],_0x3ad57b=_0x45328f[_0x7655('0x1a')]+_0x45328f[_0x7655('0x1b')],_0x358584;if(_0x3ad57b>=_0xf8edf6){_0x3ad57b=_0xf8edf6;_0x358584=0xc8;}else{_0x358584=0xce;}_0x58e323['status'](_0x358584);return _0x58e323[_0x7655('0x1c')](_0x7655('0x1d'),_0x576685+'-'+_0x3ad57b+'/'+_0xf8edf6)[_0x7655('0x19')](_0x5aace7);}return null;};}function patchUpdates(_0x2352b3){return function(_0xebc871){try{jsonpatch['apply'](_0xebc871,_0x2352b3,!![]);}catch(_0x2fd2c4){return BPromise[_0x7655('0x1e')](_0x2fd2c4);}return _0xebc871[_0x7655('0x1f')]();};}function saveUpdates(_0x20bb15,_0x1da301){return function(_0x550c97){if(_0x550c97){return _0x550c97[_0x7655('0x20')](_0x20bb15)[_0x7655('0x21')](function(_0x1ad418){return _0x1ad418;});}return null;};}function removeEntity(_0x1e01f6,_0x14af5a){return function(_0x26fb7a){if(_0x26fb7a){return _0x26fb7a[_0x7655('0x22')]()['then'](function(){_0x1e01f6[_0x7655('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xecc4f7,_0x2137c5){return function(_0x18a3fa){if(!_0x18a3fa){_0xecc4f7['sendStatus'](0x194);}return _0x18a3fa;};}function handleError(_0x43af7b,_0x3f68a7){_0x3f68a7=_0x3f68a7||0x1f4;return function(_0x310d3f){logger['error'](_0x310d3f[_0x7655('0x23')]);if(_0x310d3f[_0x7655('0x24')]){delete _0x310d3f[_0x7655('0x24')];}_0x43af7b[_0x7655('0x18')](_0x3f68a7)[_0x7655('0x25')](_0x310d3f);};}exports[_0x7655('0x26')]=function(_0x7373fd,_0x324735){var _0x223262={},_0x2175f2={},_0x54af35={'count':0x0,'rows':[]};var _0x851cf5=_[_0x7655('0x27')](db[_0x7655('0x28')][_0x7655('0x29')],function(_0x2ab742){return{'name':_0x2ab742[_0x7655('0x2a')],'type':_0x2ab742[_0x7655('0x2b')][_0x7655('0x2c')]};});_0x2175f2[_0x7655('0x2d')]=_[_0x7655('0x27')](_0x851cf5,_0x7655('0x24'));_0x2175f2[_0x7655('0x2e')]=_[_0x7655('0x2f')](_0x7373fd[_0x7655('0x2e')]);_0x2175f2[_0x7655('0x30')]=_['intersection'](_0x2175f2[_0x7655('0x2d')],_0x2175f2[_0x7655('0x2e')]);_0x223262[_0x7655('0x31')]=_['intersection'](_0x2175f2['model'],qs[_0x7655('0x32')](_0x7373fd['query']['fields']));_0x223262[_0x7655('0x31')]=_0x223262[_0x7655('0x31')]['length']?_0x223262['attributes']:_0x2175f2[_0x7655('0x2d')];if(!_0x7373fd[_0x7655('0x2e')]['hasOwnProperty'](_0x7655('0x33'))){_0x223262[_0x7655('0x1b')]=qs[_0x7655('0x1b')](_0x7373fd[_0x7655('0x2e')]['limit']);_0x223262[_0x7655('0x1a')]=qs['offset'](_0x7373fd[_0x7655('0x2e')]['offset']);}_0x223262['order']=qs[_0x7655('0x34')](_0x7373fd[_0x7655('0x2e')][_0x7655('0x34')]);_0x223262['where']=qs[_0x7655('0x30')](_['pick'](_0x7373fd[_0x7655('0x2e')],_0x2175f2['filters']),_0x851cf5);if(_0x7373fd['query']['filter']){_0x223262['where']=_['merge'](_0x223262['where'],{'$or':_[_0x7655('0x27')](_0x851cf5,function(_0xae2c8d){if(_0xae2c8d[_0x7655('0x2b')]!==_0x7655('0x35')){var _0x443830={};_0x443830[_0xae2c8d['name']]={'$like':'%'+_0x7373fd[_0x7655('0x2e')]['filter']+'%'};return _0x443830;}})});}_0x223262=_[_0x7655('0x36')]({},_0x223262,_0x7373fd[_0x7655('0x37')]);var _0x2b7439={'where':_0x223262['where']};return db[_0x7655('0x28')]['count'](_0x2b7439)[_0x7655('0x21')](function(_0x262119){_0x54af35[_0x7655('0x38')]=_0x262119;if(_0x7373fd[_0x7655('0x2e')][_0x7655('0x39')]){_0x223262[_0x7655('0x3a')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x7655('0x3b')](_0x223262);})[_0x7655('0x21')](function(_0x469e0b){_0x54af35[_0x7655('0x3c')]=_0x469e0b;return _0x54af35;})[_0x7655('0x21')](respondWithFilteredResult(_0x324735,_0x223262))['catch'](handleError(_0x324735,null));};exports[_0x7655('0x3d')]=function(_0x431f66,_0x43b4fd){var _0x2e2ec9={'raw':!![],'where':{'id':_0x431f66[_0x7655('0x3e')]['id']}},_0x243498={};_0x243498[_0x7655('0x2d')]=_[_0x7655('0x2f')](db[_0x7655('0x28')][_0x7655('0x29')]);_0x243498[_0x7655('0x2e')]=_[_0x7655('0x2f')](_0x431f66[_0x7655('0x2e')]);_0x243498[_0x7655('0x30')]=_[_0x7655('0x3f')](_0x243498[_0x7655('0x2d')],_0x243498[_0x7655('0x2e')]);_0x2e2ec9[_0x7655('0x31')]=_['intersection'](_0x243498[_0x7655('0x2d')],qs['fields'](_0x431f66[_0x7655('0x2e')][_0x7655('0x32')]));_0x2e2ec9['attributes']=_0x2e2ec9[_0x7655('0x31')][_0x7655('0x40')]?_0x2e2ec9['attributes']:_0x243498[_0x7655('0x2d')];if(_0x431f66[_0x7655('0x2e')][_0x7655('0x39')]){_0x2e2ec9['include']=[{'all':!![]}];}_0x2e2ec9=_[_0x7655('0x36')]({},_0x2e2ec9,_0x431f66['options']);return db['SquareDetailsReport'][_0x7655('0x41')](_0x2e2ec9)[_0x7655('0x21')](handleEntityNotFound(_0x43b4fd,null))[_0x7655('0x21')](respondWithResult(_0x43b4fd,null))['catch'](handleError(_0x43b4fd,null));};exports[_0x7655('0x42')]=function(_0x4651fd,_0x3ea87b){return db[_0x7655('0x28')]['create'](_0x4651fd[_0x7655('0x43')],{})[_0x7655('0x21')](respondWithResult(_0x3ea87b,0xc9))[_0x7655('0x44')](handleError(_0x3ea87b,null));};exports[_0x7655('0x20')]=function(_0xf8c8e8,_0x38179e){if(_0xf8c8e8['body']['id']){delete _0xf8c8e8[_0x7655('0x43')]['id'];}return db[_0x7655('0x28')][_0x7655('0x41')]({'where':{'id':_0xf8c8e8[_0x7655('0x3e')]['id']}})[_0x7655('0x21')](handleEntityNotFound(_0x38179e,null))['then'](saveUpdates(_0xf8c8e8[_0x7655('0x43')],null))[_0x7655('0x21')](respondWithResult(_0x38179e,null))[_0x7655('0x44')](handleError(_0x38179e,null));};exports['destroy']=function(_0x5022f5,_0x49ba53){return db[_0x7655('0x28')][_0x7655('0x41')]({'where':{'id':_0x5022f5[_0x7655('0x3e')]['id']}})[_0x7655('0x21')](handleEntityNotFound(_0x49ba53,null))['then'](removeEntity(_0x49ba53,null))[_0x7655('0x44')](handleError(_0x49ba53,null));};exports[_0x7655('0x45')]=function(_0x35567e,_0x1cb69f){return db[_0x7655('0x28')][_0x7655('0x45')]()['then'](respondWithResult(_0x1cb69f,null))[_0x7655('0x44')](handleError(_0x1cb69f,null));};
\ No newline at end of file
index 6374e25..d57e373 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70cd=['define','SquareDetailsReport','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x3bd97c,_0x5d1daa){var _0x3a9a14=function(_0x57911f){while(--_0x57911f){_0x3bd97c['push'](_0x3bd97c['shift']());}};_0x3a9a14(++_0x5d1daa);}(_0x70cd,0x178));var _0xd70c=function(_0x1b9cd5,_0x103dc4){_0x1b9cd5=_0x1b9cd5-0x0;var _0x4c74ca=_0x70cd[_0x1b9cd5];return _0x4c74ca;};'use strict';var _=require('lodash');var util=require(_0xd70c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd70c('0x1'));var BPromise=require(_0xd70c('0x2'));var rp=require(_0xd70c('0x3'));var fs=require('fs');var path=require(_0xd70c('0x4'));var rimraf=require(_0xd70c('0x5'));var config=require(_0xd70c('0x6'));var attributes=require(_0xd70c('0x7'));module[_0xd70c('0x8')]=function(_0x171fbf,_0x290c14){return _0x171fbf[_0xd70c('0x9')](_0xd70c('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xef6e=['../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x16a400,_0x598592){var _0x1e9b69=function(_0xca5276){while(--_0xca5276){_0x16a400['push'](_0x16a400['shift']());}};_0x1e9b69(++_0x598592);}(_0xef6e,0x1b5));var _0xeef6=function(_0x1d7de6,_0x4d1adf){_0x1d7de6=_0x1d7de6-0x0;var _0x2d0d63=_0xef6e[_0x1d7de6];return _0x2d0d63;};'use strict';var _=require(_0xeef6('0x0'));var util=require(_0xeef6('0x1'));var logger=require(_0xeef6('0x2'))(_0xeef6('0x3'));var moment=require(_0xeef6('0x4'));var BPromise=require('bluebird');var rp=require(_0xeef6('0x5'));var fs=require('fs');var path=require(_0xeef6('0x6'));var rimraf=require('rimraf');var config=require(_0xeef6('0x7'));var attributes=require(_0xeef6('0x8'));module[_0xeef6('0x9')]=function(_0xda0373,_0x1461b7){return _0xda0373[_0xeef6('0xa')]('SquareDetailsReport',attributes,{'tableName':_0xeef6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 40253f8..d8e9981 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f13=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw'];(function(_0x488616,_0xd42426){var _0x45ee9a=function(_0x16a4b5){while(--_0x16a4b5){_0x488616['push'](_0x488616['shift']());}};_0x45ee9a(++_0xd42426);}(_0x2f13,0x114));var _0x32f1=function(_0x5e67e4,_0x4cc627){_0x5e67e4=_0x5e67e4-0x0;var _0x508abd=_0x2f13[_0x5e67e4];return _0x508abd;};'use strict';var _=require('lodash');var util=require(_0x32f1('0x0'));var moment=require(_0x32f1('0x1'));var BPromise=require(_0x32f1('0x2'));var rs=require(_0x32f1('0x3'));var fs=require('fs');var Redis=require(_0x32f1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x32f1('0x5'))(_0x32f1('0x6'));var config=require('../../config/environment');var jayson=require(_0x32f1('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42bda0,_0x155ecd,_0x25e4c2){return new BPromise(function(_0x39dfa0,_0x4eb44a){return client['request'](_0x42bda0,_0x25e4c2)[_0x32f1('0x8')](function(_0x234f16){logger[_0x32f1('0x9')](_0x32f1('0xa'),_0x155ecd,'request\x20sent');logger[_0x32f1('0xb')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x155ecd,_0x32f1('0xc'),JSON[_0x32f1('0xd')](_0x234f16));if(_0x234f16[_0x32f1('0xe')]){if(_0x234f16[_0x32f1('0xe')]['code']===0x1f4){logger[_0x32f1('0xe')](_0x32f1('0xa'),_0x155ecd,_0x234f16['error'][_0x32f1('0xf')]);return _0x4eb44a(_0x234f16[_0x32f1('0xe')][_0x32f1('0xf')]);}logger[_0x32f1('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x155ecd,_0x234f16[_0x32f1('0xe')][_0x32f1('0xf')]);return _0x39dfa0(_0x234f16[_0x32f1('0xe')]['message']);}else{logger['info'](_0x32f1('0xa'),_0x155ecd,_0x32f1('0xc'));_0x39dfa0(_0x234f16[_0x32f1('0x10')][_0x32f1('0xf')]);}})[_0x32f1('0x11')](function(_0xc7d2de){logger[_0x32f1('0xe')](_0x32f1('0xa'),_0x155ecd,_0xc7d2de);_0x4eb44a(_0xc7d2de);});});}exports[_0x32f1('0x12')]=function(_0x573680){var _0x5dfd6e=this;return new Promise(function(_0xc67611,_0x46f892){return db[_0x32f1('0x13')]['create'](_0x573680[_0x32f1('0x14')],{'raw':_0x573680[_0x32f1('0x15')]?_0x573680[_0x32f1('0x15')][_0x32f1('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0xb50070){logger['info']('CreateSquareDetailsReport',_0x573680);logger[_0x32f1('0xb')]('CreateSquareDetailsReport',_0x573680,JSON[_0x32f1('0xd')](_0xb50070));_0xc67611(_0xb50070);})[_0x32f1('0x11')](function(_0x2a787e){logger[_0x32f1('0xe')](_0x32f1('0x12'),_0x2a787e[_0x32f1('0xf')],_0x573680);_0x46f892(_0x5dfd6e[_0x32f1('0xe')](0x1f4,_0x2a787e[_0x32f1('0xf')]));});});};
\ No newline at end of file
+var _0x0524=['body','options','then','stringify','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateSquareDetailsReport','SquareDetailsReport','create'];(function(_0x553aeb,_0x2f772e){var _0x3317eb=function(_0x2fe4a1){while(--_0x2fe4a1){_0x553aeb['push'](_0x553aeb['shift']());}};_0x3317eb(++_0x2f772e);}(_0x0524,0xd5));var _0x4052=function(_0x35ef6b,_0x202c42){_0x35ef6b=_0x35ef6b-0x0;var _0x3ad145=_0x0524[_0x35ef6b];return _0x3ad145;};'use strict';var _=require('lodash');var util=require(_0x4052('0x0'));var moment=require(_0x4052('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4052('0x2'));var db=require(_0x4052('0x3'))['db'];var utils=require(_0x4052('0x4'));var logger=require(_0x4052('0x5'))(_0x4052('0x6'));var config=require(_0x4052('0x7'));var jayson=require(_0x4052('0x8'));var client=jayson[_0x4052('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43404a,_0x500c35,_0x4cc5b4){return new BPromise(function(_0x386011,_0xeccdd5){return client['request'](_0x43404a,_0x4cc5b4)['then'](function(_0x2ca157){logger['info'](_0x4052('0xa'),_0x500c35,'request\x20sent');logger[_0x4052('0xb')](_0x4052('0xc'),_0x500c35,_0x4052('0xd'),JSON['stringify'](_0x2ca157));if(_0x2ca157[_0x4052('0xe')]){if(_0x2ca157[_0x4052('0xe')][_0x4052('0xf')]===0x1f4){logger[_0x4052('0xe')](_0x4052('0xa'),_0x500c35,_0x2ca157[_0x4052('0xe')][_0x4052('0x10')]);return _0xeccdd5(_0x2ca157['error'][_0x4052('0x10')]);}logger[_0x4052('0xe')](_0x4052('0xa'),_0x500c35,_0x2ca157[_0x4052('0xe')][_0x4052('0x10')]);return _0x386011(_0x2ca157['error'][_0x4052('0x10')]);}else{logger['info'](_0x4052('0xa'),_0x500c35,_0x4052('0xd'));_0x386011(_0x2ca157[_0x4052('0x11')][_0x4052('0x10')]);}})['catch'](function(_0x179eba){logger[_0x4052('0xe')](_0x4052('0xa'),_0x500c35,_0x179eba);_0xeccdd5(_0x179eba);});});}exports[_0x4052('0x12')]=function(_0x128dc6){var _0x56421e=this;return new Promise(function(_0x156479,_0x292038){return db[_0x4052('0x13')][_0x4052('0x14')](_0x128dc6[_0x4052('0x15')],{'raw':_0x128dc6['options']?_0x128dc6[_0x4052('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x4052('0x17')](function(_0x29e562){logger['info'](_0x4052('0x12'),_0x128dc6);logger[_0x4052('0xb')](_0x4052('0x12'),_0x128dc6,JSON[_0x4052('0x18')](_0x29e562));_0x156479(_0x29e562);})[_0x4052('0x19')](function(_0x5b3159){logger['error']('CreateSquareDetailsReport',_0x5b3159['message'],_0x128dc6);_0x292038(_0x56421e[_0x4052('0xe')](0x1f4,_0x5b3159['message']));});});};
\ No newline at end of file
index b9eb1cd..1fe730e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe413=['/process/:pid/kill','exports','Router','./system.controller','get','isAuthenticated','index'];(function(_0x5be1ef,_0x109e19){var _0xdf34bb=function(_0x2e0172){while(--_0x2e0172){_0x5be1ef['push'](_0x5be1ef['shift']());}};_0xdf34bb(++_0x109e19);}(_0xe413,0xa3));var _0x3e41=function(_0x5a57fa,_0x25ca6c){_0x5a57fa=_0x5a57fa-0x0;var _0x4561c5=_0xe413[_0x5a57fa];return _0x4561c5;};'use strict';var express=require('express');var router=express[_0x3e41('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x3e41('0x1'));router[_0x3e41('0x2')]('/',auth[_0x3e41('0x3')](),controller[_0x3e41('0x4')]);router[_0x3e41('0x2')](_0x3e41('0x5'),auth[_0x3e41('0x3')](),controller['killProcess']);module[_0x3e41('0x6')]=router;
\ No newline at end of file
+var _0x576b=['get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x576b,0x9e));var _0xb576=function(_0x51ec6d,_0x134dd1){_0x51ec6d=_0x51ec6d-0x0;var _0x26d83c=_0x576b[_0x51ec6d];return _0x26d83c;};'use strict';var express=require(_0xb576('0x0'));var router=express[_0xb576('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0xb576('0x2')]('/',auth[_0xb576('0x3')](),controller[_0xb576('0x4')]);router['get'](_0xb576('0x5'),auth[_0xb576('0x3')](),controller[_0xb576('0x6')]);module[_0xb576('0x7')]=router;
\ No newline at end of file
index 4790f29..64f673a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9e4=['util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','child_process','exec','../../config/logger','api'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0xe9e4,0x1e2));var _0x4e9e=function(_0x106a43,_0x5823a5){_0x106a43=_0x106a43-0x0;var _0x2b211e=_0xe9e4[_0x106a43];return _0x2b211e;};'use strict';var info=require('systeminformation');var exec=require(_0x4e9e('0x0'))[_0x4e9e('0x1')];var logger=require(_0x4e9e('0x2'))(_0x4e9e('0x3'));var util=require(_0x4e9e('0x4'));var BPromise=require('bluebird');var _=require(_0x4e9e('0x5'));function handleError(_0x4b041e,_0x2b2237,_0x15fb23){_0x2b2237=_0x2b2237||0x1f4;return function(_0x15f0ba){logger[_0x4e9e('0x6')](_0x4e9e('0x7'),_0x15fb23,_0x2b2237,util[_0x4e9e('0x8')](_0x15f0ba,{'showHidden':![],'depth':null}));delete _0x15f0ba[_0x4e9e('0x9')];_0x4b041e[_0x4e9e('0xa')](_0x2b2237)[_0x4e9e('0xb')](_0x15f0ba);};}exports[_0x4e9e('0xc')]=function(_0x540861,_0x635ce4){return info['getAllData']()[_0x4e9e('0xd')](function(_0x3c6c5b){return _0x635ce4['status'](0xc8)[_0x4e9e('0xe')](_0x3c6c5b);})[_0x4e9e('0xf')](function(_0x341a40){return _0x635ce4['status'](0x1f4)['json'](_0x341a40);});};exports[_0x4e9e('0x10')]=function(_0x82b9b4,_0x425b39){var _0x188849=[_0x4e9e('0x11')];return new BPromise(function(_0x18ba56,_0x5995b4){return exec(util[_0x4e9e('0x12')](_0x4e9e('0x13'),_0x82b9b4['params'][_0x4e9e('0x14')]),function(_0x186c18,_0x2cfe01,_0x2cae41){if(_0x186c18){return _0x5995b4(_0x186c18);}return _0x18ba56(_0x2cfe01);});})[_0x4e9e('0xd')](function(_0x3732ce){var _0x51bd26=![];var _0x1c68b1=_0x3732ce[_0x4e9e('0x15')](/\n/);for(var _0xe5102e=0x0,_0x1275a6=_0x188849[_0x4e9e('0x16')];_0xe5102e<_0x1275a6,_0x51bd26===![];_0xe5102e+=0x1){if(_0x3732ce[_0x4e9e('0x17')](_0x188849[_0xe5102e])>=0x0){_0x51bd26=!![];}}if(!_0x51bd26){throw new Error(util[_0x4e9e('0x12')](_0x4e9e('0x18'),_0x82b9b4[_0x4e9e('0x19')][_0x4e9e('0x14')]));}process[_0x4e9e('0x1a')](_0x82b9b4[_0x4e9e('0x19')][_0x4e9e('0x14')],'SIGINT');return _0x425b39[_0x4e9e('0xa')](0xc8)[_0x4e9e('0xe')]({'message':util[_0x4e9e('0x12')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x82b9b4[_0x4e9e('0x19')][_0x4e9e('0x14')])});})[_0x4e9e('0xf')](handleError(_0x425b39,null,_0x4e9e('0x10')));};
\ No newline at end of file
+var _0xd117=['name','status','send','getAllData','then','json','catch','killProcess','components/import/cm','format','indexOf','params','pid','kill','SIGINT','exec','../../config/logger','api','util','bluebird','lodash','error','inspect'];(function(_0x42aa93,_0x4548a8){var _0x265de5=function(_0x2def5b){while(--_0x2def5b){_0x42aa93['push'](_0x42aa93['shift']());}};_0x265de5(++_0x4548a8);}(_0xd117,0xf5));var _0x7d11=function(_0x13945b,_0x289c94){_0x13945b=_0x13945b-0x0;var _0x1b1643=_0xd117[_0x13945b];return _0x1b1643;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0x7d11('0x0')];var logger=require(_0x7d11('0x1'))(_0x7d11('0x2'));var util=require(_0x7d11('0x3'));var BPromise=require(_0x7d11('0x4'));var _=require(_0x7d11('0x5'));function handleError(_0x3f5b68,_0x21c293,_0x1720b8){_0x21c293=_0x21c293||0x1f4;return function(_0x2245e5){logger[_0x7d11('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x1720b8,_0x21c293,util[_0x7d11('0x7')](_0x2245e5,{'showHidden':![],'depth':null}));delete _0x2245e5[_0x7d11('0x8')];_0x3f5b68[_0x7d11('0x9')](_0x21c293)[_0x7d11('0xa')](_0x2245e5);};}exports['index']=function(_0x477360,_0x24a1dc){return info[_0x7d11('0xb')]()[_0x7d11('0xc')](function(_0x36988a){return _0x24a1dc['status'](0xc8)[_0x7d11('0xd')](_0x36988a);})[_0x7d11('0xe')](function(_0x1d5df2){return _0x24a1dc['status'](0x1f4)[_0x7d11('0xd')](_0x1d5df2);});};exports[_0x7d11('0xf')]=function(_0x5e136b,_0x282437){var _0x5b7ff9=[_0x7d11('0x10')];return new BPromise(function(_0x2abcfe,_0x3f3f78){return exec(util[_0x7d11('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x5e136b['params']['pid']),function(_0x2c3ec8,_0x2a9491,_0x122f8a){if(_0x2c3ec8){return _0x3f3f78(_0x2c3ec8);}return _0x2abcfe(_0x2a9491);});})['then'](function(_0xa74683){var _0x58991c=![];var _0x17b61c=_0xa74683['split'](/\n/);for(var _0x411b79=0x0,_0x4f6399=_0x5b7ff9['length'];_0x411b79<_0x4f6399,_0x58991c===![];_0x411b79+=0x1){if(_0xa74683[_0x7d11('0x12')](_0x5b7ff9[_0x411b79])>=0x0){_0x58991c=!![];}}if(!_0x58991c){throw new Error(util[_0x7d11('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x5e136b[_0x7d11('0x13')][_0x7d11('0x14')]));}process[_0x7d11('0x15')](_0x5e136b[_0x7d11('0x13')]['pid'],_0x7d11('0x16'));return _0x282437['status'](0xc8)['json']({'message':util[_0x7d11('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x5e136b[_0x7d11('0x13')]['pid'])});})['catch'](handleError(_0x282437,null,_0x7d11('0xf')));};
\ No newline at end of file
index eb2d85a..f4462b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['isAuthenticated','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','/:id'];(function(_0x1bced0,_0x57973c){var _0x20f37d=function(_0xf0030a){while(--_0xf0030a){_0x1bced0['push'](_0x1bced0['shift']());}};_0x20f37d(++_0x57973c);}(_0x54ef,0x112));var _0xf54e=function(_0x2811e3,_0x210f51){_0x2811e3=_0x2811e3-0x0;var _0x4c40e6=_0x54ef[_0x2811e3];return _0x4c40e6;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var auth=require(_0xf54e('0x5'));var interaction=require(_0xf54e('0x6'));var config=require(_0xf54e('0x7'));var controller=require(_0xf54e('0x8'));router[_0xf54e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf54e('0x9')](_0xf54e('0xa'),auth[_0xf54e('0xb')](),controller['show']);router[_0xf54e('0xc')]('/',auth['isAuthenticated'](),controller[_0xf54e('0xd')]);router[_0xf54e('0xe')]('/:id',auth[_0xf54e('0xb')](),controller[_0xf54e('0xf')]);router[_0xf54e('0x10')](_0xf54e('0xa'),auth['isAuthenticated'](),controller[_0xf54e('0x11')]);module[_0xf54e('0x12')]=router;
\ No newline at end of file
+var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x51b1a5,_0x285a4f){var _0x15c738=function(_0x5c94d7){while(--_0x5c94d7){_0x51b1a5['push'](_0x51b1a5['shift']());}};_0x15c738(++_0x285a4f);}(_0x34e8,0x12c));var _0x834e=function(_0x5cf82f,_0x1de011){_0x5cf82f=_0x5cf82f-0x0;var _0x12b820=_0x34e8[_0x5cf82f];return _0x12b820;};'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 auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);module[_0x834e('0x13')]=router;
\ No newline at end of file
index f10aef0..e877c0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['STRING','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xb7e7[_0x342700];return _0x53406f;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x7b7e('0x1')]}};
\ No newline at end of file
+var _0x36ee=['STRING','#0091EA'];(function(_0x274940,_0x4fa4ea){var _0x69da60=function(_0x1303ad){while(--_0x1303ad){_0x274940['push'](_0x274940['shift']());}};_0x69da60(++_0x4fa4ea);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe36e('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xe36e('0x0')],'defaultValue':_0xe36e('0x1')},'description':{'type':Sequelize[_0xe36e('0x0')]}};
\ No newline at end of file
index 7c10be2..5f5c6c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x985d=['UserProfileResource','then','sendStatus','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','get','Tags'];(function(_0x189393,_0xa27223){var _0x3c6661=function(_0xacf6dd){while(--_0xacf6dd){_0x189393['push'](_0x189393['shift']());}};_0x3c6661(++_0xa27223);}(_0x985d,0x1c1));var _0xd985=function(_0x114fd0,_0x3c2caf){_0x114fd0=_0x114fd0-0x0;var _0x1f660d=_0x985d[_0x114fd0];return _0x1f660d;};'use strict';var pdf=require(_0xd985('0x0'));var emlformat=require(_0xd985('0x1'));var rimraf=require(_0xd985('0x2'));var zipdir=require(_0xd985('0x3'));var jsonpatch=require(_0xd985('0x4'));var rp=require(_0xd985('0x5'));var moment=require(_0xd985('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd985('0x7'));var path=require(_0xd985('0x8'));var sox=require('sox');var csv=require(_0xd985('0x9'));var ejs=require(_0xd985('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd985('0xb'));var crypto=require(_0xd985('0xc'));var jsforce=require(_0xd985('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd985('0xe'));var Redis=require(_0xd985('0xf'));var authService=require(_0xd985('0x10'));var qs=require(_0xd985('0x11'));var as=require(_0xd985('0x12'));var hardwareService=require(_0xd985('0x13'));var logger=require('../../config/logger')(_0xd985('0x14'));var utils=require('../../config/utils');var config=require(_0xd985('0x15'));var db=require(_0xd985('0x16'))['db'];function respondWithStatusCode(_0x380dac,_0x8e8959){_0x8e8959=_0x8e8959||0xcc;return function(_0x1a916a){if(_0x1a916a){return _0x380dac['sendStatus'](_0x8e8959);}return _0x380dac[_0xd985('0x17')](_0x8e8959)[_0xd985('0x18')]();};}function respondWithResult(_0xf30a8f,_0x32fbbe){_0x32fbbe=_0x32fbbe||0xc8;return function(_0x2941f1){if(_0x2941f1){return _0xf30a8f[_0xd985('0x17')](_0x32fbbe)['json'](_0x2941f1);}};}function respondWithFilteredResult(_0x3eed1c,_0x1670ff){return function(_0x423e74){if(_0x423e74){var _0x5ef3d3=_0x423e74[_0xd985('0x19')],_0x44fffd=_0x1670ff[_0xd985('0x1a')],_0x52f082=_0x1670ff['offset']+_0x1670ff[_0xd985('0x1b')],_0x414466;if(_0x52f082>=_0x5ef3d3){_0x52f082=_0x5ef3d3;_0x414466=0xc8;}else{_0x414466=0xce;}_0x3eed1c['status'](_0x414466);return _0x3eed1c['set'](_0xd985('0x1c'),_0x44fffd+'-'+_0x52f082+'/'+_0x5ef3d3)[_0xd985('0x1d')](_0x423e74);}return null;};}function patchUpdates(_0x49fbd1){return function(_0x32583a){try{jsonpatch[_0xd985('0x1e')](_0x32583a,_0x49fbd1,!![]);}catch(_0x4e573c){return BPromise[_0xd985('0x1f')](_0x4e573c);}return _0x32583a[_0xd985('0x20')]();};}function saveUpdates(_0x55b7f2,_0x2bc51d){return function(_0x59f4e7){if(_0x59f4e7){return _0x59f4e7[_0xd985('0x21')](_0x55b7f2)['then'](function(_0x45798){return _0x45798;});}return null;};}function removeEntity(_0x93fd94,_0x21b6fb){return function(_0x361813){if(_0x361813){return _0x361813[_0xd985('0x22')]()['then'](function(){var _0x8f590e=_0x361813[_0xd985('0x23')]({'plain':!![]});var _0x3aa129=_0xd985('0x24');return db[_0xd985('0x25')]['destroy']({'where':{'type':_0x3aa129,'resourceId':_0x8f590e['id']}})[_0xd985('0x26')](function(){return _0x361813;});})['then'](function(){_0x93fd94[_0xd985('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44e90e,_0x29dfd6){return function(_0x4072cf){if(!_0x4072cf){_0x44e90e[_0xd985('0x27')](0x194);}return _0x4072cf;};}function handleError(_0x12b20d,_0x63c84c){_0x63c84c=_0x63c84c||0x1f4;return function(_0x4fdd2e){logger[_0xd985('0x28')](_0x4fdd2e[_0xd985('0x29')]);if(_0x4fdd2e[_0xd985('0x2a')]){delete _0x4fdd2e[_0xd985('0x2a')];}_0x12b20d[_0xd985('0x17')](_0x63c84c)['send'](_0x4fdd2e);};}exports[_0xd985('0x2b')]=function(_0x3b9faf,_0x352eee){var _0x441519={},_0x846f2e={},_0x3720b7={'count':0x0,'rows':[]};var _0x18e200=_[_0xd985('0x2c')](db[_0xd985('0x2d')][_0xd985('0x2e')],function(_0x2c0e32){return{'name':_0x2c0e32[_0xd985('0x2f')],'type':_0x2c0e32[_0xd985('0x30')][_0xd985('0x31')]};});_0x846f2e['model']=_[_0xd985('0x2c')](_0x18e200,_0xd985('0x2a'));_0x846f2e[_0xd985('0x32')]=_['keys'](_0x3b9faf['query']);_0x846f2e[_0xd985('0x33')]=_[_0xd985('0x34')](_0x846f2e[_0xd985('0x35')],_0x846f2e['query']);_0x441519['attributes']=_['intersection'](_0x846f2e[_0xd985('0x35')],qs[_0xd985('0x36')](_0x3b9faf[_0xd985('0x32')][_0xd985('0x36')]));_0x441519[_0xd985('0x37')]=_0x441519['attributes'][_0xd985('0x38')]?_0x441519[_0xd985('0x37')]:_0x846f2e[_0xd985('0x35')];if(!_0x3b9faf['query'][_0xd985('0x39')](_0xd985('0x3a'))){_0x441519['limit']=qs[_0xd985('0x1b')](_0x3b9faf['query'][_0xd985('0x1b')]);_0x441519[_0xd985('0x1a')]=qs[_0xd985('0x1a')](_0x3b9faf[_0xd985('0x32')][_0xd985('0x1a')]);}_0x441519['order']=qs[_0xd985('0x3b')](_0x3b9faf['query'][_0xd985('0x3b')]);_0x441519[_0xd985('0x3c')]=qs['filters'](_[_0xd985('0x3d')](_0x3b9faf[_0xd985('0x32')],_0x846f2e['filters']),_0x18e200);if(_0x3b9faf[_0xd985('0x32')]['filter']){_0x441519[_0xd985('0x3c')]=_[_0xd985('0x3e')](_0x441519[_0xd985('0x3c')],{'$or':_[_0xd985('0x2c')](_0x18e200,function(_0x588852){if(_0x588852[_0xd985('0x30')]!==_0xd985('0x3f')){var _0x1c718f={};_0x1c718f[_0x588852[_0xd985('0x2a')]]={'$like':'%'+_0x3b9faf[_0xd985('0x32')][_0xd985('0x40')]+'%'};return _0x1c718f;}})});}_0x441519=_[_0xd985('0x3e')]({},_0x441519,_0x3b9faf[_0xd985('0x41')]);var _0x117f04={'where':_0x441519[_0xd985('0x3c')]};return db[_0xd985('0x2d')][_0xd985('0x19')](_0x117f04)['then'](function(_0xe8f3a5){_0x3720b7[_0xd985('0x19')]=_0xe8f3a5;if(_0x3b9faf[_0xd985('0x32')][_0xd985('0x42')]){_0x441519[_0xd985('0x43')]=[{'all':!![]}];}return db[_0xd985('0x2d')][_0xd985('0x44')](_0x441519);})['then'](function(_0x321b03){_0x3720b7['rows']=_0x321b03;return _0x3720b7;})[_0xd985('0x26')](respondWithFilteredResult(_0x352eee,_0x441519))['catch'](handleError(_0x352eee,null));};exports[_0xd985('0x45')]=function(_0x3b6be4,_0x1ccd8d){var _0x7b7c22={'raw':!![],'where':{'id':_0x3b6be4[_0xd985('0x46')]['id']}},_0x3f5216={};_0x3f5216[_0xd985('0x35')]=_[_0xd985('0x47')](db[_0xd985('0x2d')][_0xd985('0x2e')]);_0x3f5216[_0xd985('0x32')]=_[_0xd985('0x47')](_0x3b6be4[_0xd985('0x32')]);_0x3f5216[_0xd985('0x33')]=_['intersection'](_0x3f5216[_0xd985('0x35')],_0x3f5216[_0xd985('0x32')]);_0x7b7c22[_0xd985('0x37')]=_[_0xd985('0x34')](_0x3f5216['model'],qs['fields'](_0x3b6be4[_0xd985('0x32')][_0xd985('0x36')]));_0x7b7c22['attributes']=_0x7b7c22[_0xd985('0x37')][_0xd985('0x38')]?_0x7b7c22[_0xd985('0x37')]:_0x3f5216[_0xd985('0x35')];if(_0x3b6be4[_0xd985('0x32')][_0xd985('0x42')]){_0x7b7c22[_0xd985('0x43')]=[{'all':!![]}];}_0x7b7c22=_[_0xd985('0x3e')]({},_0x7b7c22,_0x3b6be4['options']);return db[_0xd985('0x2d')][_0xd985('0x48')](_0x7b7c22)[_0xd985('0x26')](handleEntityNotFound(_0x1ccd8d,null))['then'](respondWithResult(_0x1ccd8d,null))[_0xd985('0x49')](handleError(_0x1ccd8d,null));};exports[_0xd985('0x4a')]=function(_0x1704c9,_0x3ad411){return db[_0xd985('0x2d')]['create'](_0x1704c9[_0xd985('0x4b')],{})[_0xd985('0x26')](function(_0x49350b){var _0x34f797=_0x1704c9['user'][_0xd985('0x23')]({'plain':!![]});if(!_0x34f797)throw new Error(_0xd985('0x4c'));if(_0x34f797[_0xd985('0x4d')]==='user'){var _0x4520a2=_0x49350b['get']({'plain':!![]});var _0x1176b5=_0xd985('0x24');return db[_0xd985('0x4e')][_0xd985('0x48')]({'where':{'name':_0x1176b5,'userProfileId':_0x34f797[_0xd985('0x4f')]},'raw':!![]})[_0xd985('0x26')](function(_0x2b3036){if(_0x2b3036&&_0x2b3036['autoAssociation']===0x0){return db[_0xd985('0x25')]['create']({'name':_0x4520a2[_0xd985('0x2a')],'resourceId':_0x4520a2['id'],'type':_0x2b3036[_0xd985('0x2a')],'sectionId':_0x2b3036['id']},{})[_0xd985('0x26')](function(){return _0x49350b;});}else{return _0x49350b;}})[_0xd985('0x49')](function(_0x38e703){logger[_0xd985('0x28')](_0xd985('0x50'),_0x38e703);throw _0x38e703;});}return _0x49350b;})[_0xd985('0x26')](respondWithResult(_0x3ad411,0xc9))[_0xd985('0x49')](handleError(_0x3ad411,null));};exports[_0xd985('0x21')]=function(_0x1187f4,_0x5757d6){if(_0x1187f4['body']['id']){delete _0x1187f4[_0xd985('0x4b')]['id'];}return db[_0xd985('0x2d')]['find']({'where':{'id':_0x1187f4[_0xd985('0x46')]['id']}})['then'](handleEntityNotFound(_0x5757d6,null))[_0xd985('0x26')](saveUpdates(_0x1187f4[_0xd985('0x4b')],null))['then'](respondWithResult(_0x5757d6,null))['catch'](handleError(_0x5757d6,null));};exports[_0xd985('0x22')]=function(_0xe066e0,_0x4e41d5){return db['Tag'][_0xd985('0x48')]({'where':{'id':_0xe066e0[_0xd985('0x46')]['id']}})[_0xd985('0x26')](handleEntityNotFound(_0x4e41d5,null))[_0xd985('0x26')](removeEntity(_0x4e41d5,null))[_0xd985('0x49')](handleError(_0x4e41d5,null));};
\ No newline at end of file
+var _0x9373=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Tags','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xab82b9,_0x2c5f4f){var _0x3c1ef9=function(_0x1c38f5){while(--_0x1c38f5){_0xab82b9['push'](_0xab82b9['shift']());}};_0x3c1ef9(++_0x2c5f4f);}(_0x9373,0x1a7));var _0x3937=function(_0x22b516,_0x5034c7){_0x22b516=_0x22b516-0x0;var _0x442e0b=_0x9373[_0x22b516];return _0x442e0b;};'use strict';var pdf=require(_0x3937('0x0'));var emlformat=require(_0x3937('0x1'));var rimraf=require(_0x3937('0x2'));var zipdir=require(_0x3937('0x3'));var jsonpatch=require(_0x3937('0x4'));var rp=require(_0x3937('0x5'));var moment=require(_0x3937('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x3937('0x7'));var util=require(_0x3937('0x8'));var path=require(_0x3937('0x9'));var sox=require(_0x3937('0xa'));var csv=require(_0x3937('0xb'));var ejs=require(_0x3937('0xc'));var fs=require('fs');var _=require(_0x3937('0xd'));var squel=require(_0x3937('0xe'));var crypto=require(_0x3937('0xf'));var jsforce=require(_0x3937('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3937('0xb'));var querystring=require(_0x3937('0x11'));var Papa=require(_0x3937('0x12'));var Redis=require(_0x3937('0x13'));var authService=require(_0x3937('0x14'));var qs=require(_0x3937('0x15'));var as=require(_0x3937('0x16'));var hardwareService=require(_0x3937('0x17'));var logger=require(_0x3937('0x18'))(_0x3937('0x19'));var utils=require(_0x3937('0x1a'));var config=require(_0x3937('0x1b'));var db=require(_0x3937('0x1c'))['db'];function respondWithStatusCode(_0x44425f,_0x241942){_0x241942=_0x241942||0xcc;return function(_0x4a5120){if(_0x4a5120){return _0x44425f[_0x3937('0x1d')](_0x241942);}return _0x44425f[_0x3937('0x1e')](_0x241942)['end']();};}function respondWithResult(_0x492b70,_0x4c2796){_0x4c2796=_0x4c2796||0xc8;return function(_0x5f525d){if(_0x5f525d){return _0x492b70['status'](_0x4c2796)[_0x3937('0x1f')](_0x5f525d);}};}function respondWithFilteredResult(_0x323e77,_0x4dfdc9){return function(_0x57163a){if(_0x57163a){var _0x10f194=_0x57163a[_0x3937('0x20')],_0x229693=_0x4dfdc9[_0x3937('0x21')],_0x14c809=_0x4dfdc9[_0x3937('0x21')]+_0x4dfdc9['limit'],_0x46509a;if(_0x14c809>=_0x10f194){_0x14c809=_0x10f194;_0x46509a=0xc8;}else{_0x46509a=0xce;}_0x323e77['status'](_0x46509a);return _0x323e77[_0x3937('0x22')](_0x3937('0x23'),_0x229693+'-'+_0x14c809+'/'+_0x10f194)['json'](_0x57163a);}return null;};}function patchUpdates(_0x16ad9b){return function(_0x457b8b){try{jsonpatch[_0x3937('0x24')](_0x457b8b,_0x16ad9b,!![]);}catch(_0x8dc7ad){return BPromise[_0x3937('0x25')](_0x8dc7ad);}return _0x457b8b[_0x3937('0x26')]();};}function saveUpdates(_0x4df054,_0x375434){return function(_0x10b4ad){if(_0x10b4ad){return _0x10b4ad['update'](_0x4df054)[_0x3937('0x27')](function(_0x1816a9){return _0x1816a9;});}return null;};}function removeEntity(_0x5ed068,_0x5de1c6){return function(_0x245d83){if(_0x245d83){return _0x245d83[_0x3937('0x28')]()['then'](function(){var _0x51893f=_0x245d83[_0x3937('0x29')]({'plain':!![]});var _0x3cd8bf='Tags';return db[_0x3937('0x2a')][_0x3937('0x28')]({'where':{'type':_0x3cd8bf,'resourceId':_0x51893f['id']}})[_0x3937('0x27')](function(){return _0x245d83;});})['then'](function(){_0x5ed068['status'](0xcc)[_0x3937('0x2b')]();});}};}function handleEntityNotFound(_0x38d9f8,_0x2acf11){return function(_0x488df5){if(!_0x488df5){_0x38d9f8[_0x3937('0x1d')](0x194);}return _0x488df5;};}function handleError(_0x22abb9,_0x57668a){_0x57668a=_0x57668a||0x1f4;return function(_0x448b93){logger[_0x3937('0x2c')](_0x448b93[_0x3937('0x2d')]);if(_0x448b93[_0x3937('0x2e')]){delete _0x448b93[_0x3937('0x2e')];}_0x22abb9[_0x3937('0x1e')](_0x57668a)[_0x3937('0x2f')](_0x448b93);};}exports[_0x3937('0x30')]=function(_0x2e2dbf,_0x23d647){var _0x2c3556={},_0x443134={},_0x47fc07={'count':0x0,'rows':[]};var _0x3bdbf7=_[_0x3937('0x31')](db[_0x3937('0x32')][_0x3937('0x33')],function(_0x9849d){return{'name':_0x9849d[_0x3937('0x34')],'type':_0x9849d[_0x3937('0x35')]['key']};});_0x443134['model']=_['map'](_0x3bdbf7,'name');_0x443134[_0x3937('0x36')]=_[_0x3937('0x37')](_0x2e2dbf[_0x3937('0x36')]);_0x443134[_0x3937('0x38')]=_[_0x3937('0x39')](_0x443134[_0x3937('0x3a')],_0x443134['query']);_0x2c3556[_0x3937('0x3b')]=_[_0x3937('0x39')](_0x443134[_0x3937('0x3a')],qs[_0x3937('0x3c')](_0x2e2dbf[_0x3937('0x36')][_0x3937('0x3c')]));_0x2c3556[_0x3937('0x3b')]=_0x2c3556[_0x3937('0x3b')][_0x3937('0x3d')]?_0x2c3556['attributes']:_0x443134[_0x3937('0x3a')];if(!_0x2e2dbf[_0x3937('0x36')][_0x3937('0x3e')](_0x3937('0x3f'))){_0x2c3556[_0x3937('0x40')]=qs[_0x3937('0x40')](_0x2e2dbf[_0x3937('0x36')][_0x3937('0x40')]);_0x2c3556[_0x3937('0x21')]=qs[_0x3937('0x21')](_0x2e2dbf[_0x3937('0x36')][_0x3937('0x21')]);}_0x2c3556[_0x3937('0x41')]=qs[_0x3937('0x42')](_0x2e2dbf[_0x3937('0x36')][_0x3937('0x42')]);_0x2c3556[_0x3937('0x43')]=qs[_0x3937('0x38')](_[_0x3937('0x44')](_0x2e2dbf['query'],_0x443134[_0x3937('0x38')]),_0x3bdbf7);if(_0x2e2dbf['query'][_0x3937('0x45')]){_0x2c3556[_0x3937('0x43')]=_['merge'](_0x2c3556[_0x3937('0x43')],{'$or':_[_0x3937('0x31')](_0x3bdbf7,function(_0x14ad7d){if(_0x14ad7d[_0x3937('0x35')]!==_0x3937('0x46')){var _0x3270b7={};_0x3270b7[_0x14ad7d['name']]={'$like':'%'+_0x2e2dbf[_0x3937('0x36')][_0x3937('0x45')]+'%'};return _0x3270b7;}})});}_0x2c3556=_[_0x3937('0x47')]({},_0x2c3556,_0x2e2dbf[_0x3937('0x48')]);var _0x429228={'where':_0x2c3556['where']};return db[_0x3937('0x32')]['count'](_0x429228)['then'](function(_0x46bd26){_0x47fc07['count']=_0x46bd26;if(_0x2e2dbf[_0x3937('0x36')][_0x3937('0x49')]){_0x2c3556[_0x3937('0x4a')]=[{'all':!![]}];}return db[_0x3937('0x32')][_0x3937('0x4b')](_0x2c3556);})['then'](function(_0x2e48c9){_0x47fc07['rows']=_0x2e48c9;return _0x47fc07;})['then'](respondWithFilteredResult(_0x23d647,_0x2c3556))[_0x3937('0x4c')](handleError(_0x23d647,null));};exports[_0x3937('0x4d')]=function(_0x2c40d0,_0x9243c2){var _0x239fc7={'raw':!![],'where':{'id':_0x2c40d0[_0x3937('0x4e')]['id']}},_0x3be60d={};_0x3be60d[_0x3937('0x3a')]=_[_0x3937('0x37')](db['Tag'][_0x3937('0x33')]);_0x3be60d[_0x3937('0x36')]=_[_0x3937('0x37')](_0x2c40d0['query']);_0x3be60d['filters']=_[_0x3937('0x39')](_0x3be60d[_0x3937('0x3a')],_0x3be60d['query']);_0x239fc7[_0x3937('0x3b')]=_[_0x3937('0x39')](_0x3be60d[_0x3937('0x3a')],qs[_0x3937('0x3c')](_0x2c40d0[_0x3937('0x36')][_0x3937('0x3c')]));_0x239fc7['attributes']=_0x239fc7[_0x3937('0x3b')][_0x3937('0x3d')]?_0x239fc7[_0x3937('0x3b')]:_0x3be60d[_0x3937('0x3a')];if(_0x2c40d0[_0x3937('0x36')][_0x3937('0x49')]){_0x239fc7[_0x3937('0x4a')]=[{'all':!![]}];}_0x239fc7=_[_0x3937('0x47')]({},_0x239fc7,_0x2c40d0[_0x3937('0x48')]);return db['Tag'][_0x3937('0x4f')](_0x239fc7)[_0x3937('0x27')](handleEntityNotFound(_0x9243c2,null))['then'](respondWithResult(_0x9243c2,null))[_0x3937('0x4c')](handleError(_0x9243c2,null));};exports[_0x3937('0x50')]=function(_0x2e5787,_0x4680aa){return db['Tag'][_0x3937('0x50')](_0x2e5787[_0x3937('0x51')],{})[_0x3937('0x27')](function(_0x45e28a){var _0x5db0bf=_0x2e5787[_0x3937('0x52')]['get']({'plain':!![]});if(!_0x5db0bf)throw new Error(_0x3937('0x53'));if(_0x5db0bf['role']===_0x3937('0x52')){var _0x34fcf1=_0x45e28a[_0x3937('0x29')]({'plain':!![]});var _0x28e648=_0x3937('0x54');return db[_0x3937('0x55')][_0x3937('0x4f')]({'where':{'name':_0x28e648,'userProfileId':_0x5db0bf['userProfileId']},'raw':!![]})[_0x3937('0x27')](function(_0x4327d4){if(_0x4327d4&&_0x4327d4[_0x3937('0x56')]===0x0){return db['UserProfileResource'][_0x3937('0x50')]({'name':_0x34fcf1[_0x3937('0x2e')],'resourceId':_0x34fcf1['id'],'type':_0x4327d4[_0x3937('0x2e')],'sectionId':_0x4327d4['id']},{})[_0x3937('0x27')](function(){return _0x45e28a;});}else{return _0x45e28a;}})[_0x3937('0x4c')](function(_0x19eda4){logger[_0x3937('0x2c')](_0x3937('0x57'),_0x19eda4);throw _0x19eda4;});}return _0x45e28a;})['then'](respondWithResult(_0x4680aa,0xc9))[_0x3937('0x4c')](handleError(_0x4680aa,null));};exports[_0x3937('0x58')]=function(_0x5b4c40,_0x5eef4f){if(_0x5b4c40[_0x3937('0x51')]['id']){delete _0x5b4c40['body']['id'];}return db[_0x3937('0x32')]['find']({'where':{'id':_0x5b4c40[_0x3937('0x4e')]['id']}})[_0x3937('0x27')](handleEntityNotFound(_0x5eef4f,null))['then'](saveUpdates(_0x5b4c40['body'],null))[_0x3937('0x27')](respondWithResult(_0x5eef4f,null))[_0x3937('0x4c')](handleError(_0x5eef4f,null));};exports[_0x3937('0x28')]=function(_0xc4c173,_0x45a379){return db[_0x3937('0x32')][_0x3937('0x4f')]({'where':{'id':_0xc4c173[_0x3937('0x4e')]['id']}})[_0x3937('0x27')](handleEntityNotFound(_0x45a379,null))[_0x3937('0x27')](removeEntity(_0x45a379,null))[_0x3937('0x4c')](handleError(_0x45a379,null));};
\ No newline at end of file
index 550d547..e0036bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51df=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash'];(function(_0x2e7845,_0x4adc29){var _0x18b4ab=function(_0x5d47dd){while(--_0x5d47dd){_0x2e7845['push'](_0x2e7845['shift']());}};_0x18b4ab(++_0x4adc29);}(_0x51df,0xcb));var _0xf51d=function(_0xfb9be1,_0x18c3ef){_0xfb9be1=_0xfb9be1-0x0;var _0x174de0=_0x51df[_0xfb9be1];return _0x174de0;};'use strict';var _=require(_0xf51d('0x0'));var util=require('util');var logger=require(_0xf51d('0x1'))(_0xf51d('0x2'));var moment=require('moment');var BPromise=require(_0xf51d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf51d('0x4'));var rimraf=require(_0xf51d('0x5'));var config=require(_0xf51d('0x6'));var attributes=require(_0xf51d('0x7'));module[_0xf51d('0x8')]=function(_0x110592,_0x389adb){return _0x110592[_0xf51d('0x9')](_0xf51d('0xa'),attributes,{'tableName':_0xf51d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb0b3=['api','moment','bluebird','request-promise','rimraf','./tag.attributes','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x49e0d8,_0x3041b6){var _0x3f1c1b=function(_0x3caf63){while(--_0x3caf63){_0x49e0d8['push'](_0x49e0d8['shift']());}};_0x3f1c1b(++_0x3041b6);}(_0xb0b3,0xa2));var _0x3b0b=function(_0x4075bc,_0x2aa562){_0x4075bc=_0x4075bc-0x0;var _0x138d75=_0xb0b3[_0x4075bc];return _0x138d75;};'use strict';var _=require(_0x3b0b('0x0'));var util=require(_0x3b0b('0x1'));var logger=require(_0x3b0b('0x2'))(_0x3b0b('0x3'));var moment=require(_0x3b0b('0x4'));var BPromise=require(_0x3b0b('0x5'));var rp=require(_0x3b0b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b0b('0x7'));var config=require('../../config/environment');var attributes=require(_0x3b0b('0x8'));module['exports']=function(_0x4a8065,_0x1f3437){return _0x4a8065['define'](_0x3b0b('0x9'),attributes,{'tableName':_0x3b0b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5f198d6..f602133 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ded=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','error','code','Tag,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x4ded,0x116));var _0xd4de=function(_0x26a291,_0x57666c){_0x26a291=_0x26a291-0x0;var _0x26d352=_0x4ded[_0x26a291];return _0x26d352;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var moment=require(_0xd4de('0x2'));var BPromise=require(_0xd4de('0x3'));var rs=require(_0xd4de('0x4'));var fs=require('fs');var Redis=require(_0xd4de('0x5'));var db=require(_0xd4de('0x6'))['db'];var utils=require(_0xd4de('0x7'));var logger=require(_0xd4de('0x8'))(_0xd4de('0x9'));var config=require(_0xd4de('0xa'));var jayson=require(_0xd4de('0xb'));var client=jayson['client'][_0xd4de('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2433b8,_0x15eb91,_0x2c56d5){return new BPromise(function(_0x4453c2,_0x1e8c35){return client['request'](_0x2433b8,_0x2c56d5)[_0xd4de('0xd')](function(_0x5ebcf3){logger['info']('Tag,\x20%s,\x20%s',_0x15eb91,_0xd4de('0xe'));logger[_0xd4de('0xf')]('Tag,\x20%s,\x20%s,\x20%s',_0x15eb91,'request\x20sent',JSON['stringify'](_0x5ebcf3));if(_0x5ebcf3[_0xd4de('0x10')]){if(_0x5ebcf3['error'][_0xd4de('0x11')]===0x1f4){logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);return _0x1e8c35(_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);}logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);return _0x4453c2(_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);}else{logger[_0xd4de('0x14')](_0xd4de('0x12'),_0x15eb91,_0xd4de('0xe'));_0x4453c2(_0x5ebcf3[_0xd4de('0x15')]['message']);}})['catch'](function(_0x3df820){logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x3df820);_0x1e8c35(_0x3df820);});});}
\ No newline at end of file
+var _0x7072=['randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x58bec1,_0x42c53f){var _0x16439f=function(_0x19b7ec){while(--_0x19b7ec){_0x58bec1['push'](_0x58bec1['shift']());}};_0x16439f(++_0x42c53f);}(_0x7072,0x138));var _0x2707=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x7072[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var moment=require(_0x2707('0x1'));var BPromise=require(_0x2707('0x2'));var rs=require(_0x2707('0x3'));var fs=require('fs');var Redis=require(_0x2707('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2707('0x5'))('rpc');var config=require(_0x2707('0x6'));var jayson=require(_0x2707('0x7'));var client=jayson[_0x2707('0x8')][_0x2707('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd8ff,_0x128205,_0x21b0a0){return new BPromise(function(_0x745cfd,_0x4062b6){return client[_0x2707('0xa')](_0x2fd8ff,_0x21b0a0)['then'](function(_0x597ff9){logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));logger[_0x2707('0xe')](_0x2707('0xf'),_0x128205,_0x2707('0xd'),JSON[_0x2707('0x10')](_0x597ff9));if(_0x597ff9[_0x2707('0x11')]){if(_0x597ff9[_0x2707('0x11')][_0x2707('0x12')]===0x1f4){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')]['message']);return _0x4062b6(_0x597ff9[_0x2707('0x11')]['message']);}logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')][_0x2707('0x13')]);return _0x745cfd(_0x597ff9[_0x2707('0x11')]['message']);}else{logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));_0x745cfd(_0x597ff9['result'][_0x2707('0x13')]);}})[_0x2707('0x14')](function(_0x1a979e){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x1a979e);_0x4062b6(_0x1a979e);});});}
\ No newline at end of file
index 4fed5eb..b1497bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7be=['/:id/queues','getQueues','/:id/users','getAgents','post','create','addQueues','addAgents','put','delete','removeQueues','removeAgents','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id','show'];(function(_0x9a24b6,_0x15b682){var _0x274729=function(_0x13d7f4){while(--_0x13d7f4){_0x9a24b6['push'](_0x9a24b6['shift']());}};_0x274729(++_0x15b682);}(_0xe7be,0x12b));var _0xee7b=function(_0x3cdf8f,_0x5adb9c){_0x3cdf8f=_0x3cdf8f-0x0;var _0x35344f=_0xe7be[_0x3cdf8f];return _0x35344f;};'use strict';var multer=require(_0xee7b('0x0'));var util=require('util');var path=require(_0xee7b('0x1'));var timeout=require('connect-timeout');var express=require(_0xee7b('0x2'));var router=express[_0xee7b('0x3')]();var auth=require(_0xee7b('0x4'));var interaction=require(_0xee7b('0x5'));var config=require(_0xee7b('0x6'));var controller=require(_0xee7b('0x7'));router[_0xee7b('0x8')]('/',auth[_0xee7b('0x9')](),controller[_0xee7b('0xa')]);router['get'](_0xee7b('0xb'),auth[_0xee7b('0x9')](),controller[_0xee7b('0xc')]);router[_0xee7b('0x8')](_0xee7b('0xd'),auth[_0xee7b('0x9')](),controller[_0xee7b('0xe')]);router[_0xee7b('0x8')](_0xee7b('0xf'),auth[_0xee7b('0x9')](),controller[_0xee7b('0x10')]);router[_0xee7b('0x11')]('/',auth[_0xee7b('0x9')](),controller[_0xee7b('0x12')]);router[_0xee7b('0x11')](_0xee7b('0xd'),auth['isAuthenticated'](),controller[_0xee7b('0x13')]);router[_0xee7b('0x11')]('/:id/users',auth[_0xee7b('0x9')](),controller[_0xee7b('0x14')]);router[_0xee7b('0x15')](_0xee7b('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xee7b('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xee7b('0x16')]('/:id/queues',auth['isAuthenticated'](),controller[_0xee7b('0x17')]);router['delete'](_0xee7b('0xf'),auth[_0xee7b('0x9')](),controller[_0xee7b('0x18')]);module[_0xee7b('0x19')]=router;
\ No newline at end of file
+var _0xecb4=['../../config/environment','./team.controller','get','index','/:id','isAuthenticated','getQueues','getAgents','post','create','/:id/queues','addQueues','/:id/users','addAgents','update','delete','destroy','removeQueues','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x754f7f,_0x5a0753){var _0x20d21b=function(_0x36594e){while(--_0x36594e){_0x754f7f['push'](_0x754f7f['shift']());}};_0x20d21b(++_0x5a0753);}(_0xecb4,0x1a4));var _0x4ecb=function(_0x3bdf49,_0x47ddb4){_0x3bdf49=_0x3bdf49-0x0;var _0x556d46=_0xecb4[_0x3bdf49];return _0x556d46;};'use strict';var multer=require(_0x4ecb('0x0'));var util=require('util');var path=require(_0x4ecb('0x1'));var timeout=require(_0x4ecb('0x2'));var express=require(_0x4ecb('0x3'));var router=express['Router']();var auth=require(_0x4ecb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4ecb('0x5'));var controller=require(_0x4ecb('0x6'));router[_0x4ecb('0x7')]('/',auth['isAuthenticated'](),controller[_0x4ecb('0x8')]);router[_0x4ecb('0x7')](_0x4ecb('0x9'),auth[_0x4ecb('0xa')](),controller['show']);router[_0x4ecb('0x7')]('/:id/queues',auth[_0x4ecb('0xa')](),controller[_0x4ecb('0xb')]);router['get']('/:id/users',auth[_0x4ecb('0xa')](),controller[_0x4ecb('0xc')]);router[_0x4ecb('0xd')]('/',auth[_0x4ecb('0xa')](),controller[_0x4ecb('0xe')]);router['post'](_0x4ecb('0xf'),auth[_0x4ecb('0xa')](),controller[_0x4ecb('0x10')]);router[_0x4ecb('0xd')](_0x4ecb('0x11'),auth[_0x4ecb('0xa')](),controller[_0x4ecb('0x12')]);router['put'](_0x4ecb('0x9'),auth[_0x4ecb('0xa')](),controller[_0x4ecb('0x13')]);router[_0x4ecb('0x14')]('/:id',auth[_0x4ecb('0xa')](),controller[_0x4ecb('0x15')]);router[_0x4ecb('0x14')](_0x4ecb('0xf'),auth['isAuthenticated'](),controller[_0x4ecb('0x16')]);router[_0x4ecb('0x14')](_0x4ecb('0x11'),auth['isAuthenticated'](),controller[_0x4ecb('0x17')]);module[_0x4ecb('0x18')]=router;
\ No newline at end of file
index 1388fce..37380b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce6a=['sequelize','exports','STRING'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xce6a,0x8a));var _0xace6=function(_0x4b7fea,_0x2f8cf6){_0x4b7fea=_0x4b7fea-0x0;var _0x236120=_0xce6a[_0x4b7fea];return _0x236120;};'use strict';var Sequelize=require(_0xace6('0x0'));module[_0xace6('0x1')]={'name':{'type':Sequelize[_0xace6('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0xace6('0x2')]}};
\ No newline at end of file
+var _0x1ec3=['exports','STRING','name'];(function(_0x2fcd90,_0x4780cc){var _0x55b596=function(_0xe475f6){while(--_0xe475f6){_0x2fcd90['push'](_0x2fcd90['shift']());}};_0x55b596(++_0x4780cc);}(_0x1ec3,0x7e));var _0x31ec=function(_0xd6956c,_0x116a90){_0xd6956c=_0xd6956c-0x0;var _0x521362=_0x1ec3[_0xd6956c];return _0x521362;};'use strict';var Sequelize=require('sequelize');module[_0x31ec('0x0')]={'name':{'type':Sequelize[_0x31ec('0x1')],'allowNull':![],'unique':_0x31ec('0x2')},'description':{'type':Sequelize[_0x31ec('0x1')]}};
\ No newline at end of file
index 18c1827..07e496c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67d6=['path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','get','Teams','sendStatus','error','stack','name','map','Team','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','channel','isValidChannel','Sequelize','Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','ValidationError','add','ids','remove','Voice','Sms','Fax','Openchannel','each','addAgents','voicePause','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','interface','omit','spread','emit','userTeam:save','removeAgents','voice','chat','mail','sms','openchannel','whatsapp','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x3c0ccc,_0x38f2f4){var _0x2dd4e5=function(_0x407ddc){while(--_0x407ddc){_0x3c0ccc['push'](_0x3c0ccc['shift']());}};_0x2dd4e5(++_0x38f2f4);}(_0x67d6,0x16c));var _0x667d=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0x67d6[_0x5ad07c];return _0x204bae;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x667d('0x0'));var rimraf=require(_0x667d('0x1'));var zipdir=require(_0x667d('0x2'));var jsonpatch=require(_0x667d('0x3'));var rp=require(_0x667d('0x4'));var moment=require(_0x667d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x667d('0x6'));var util=require(_0x667d('0x7'));var path=require(_0x667d('0x8'));var sox=require(_0x667d('0x9'));var csv=require(_0x667d('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x667d('0xb'));var squel=require(_0x667d('0xc'));var crypto=require('crypto');var jsforce=require(_0x667d('0xd'));var deskjs=require(_0x667d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x667d('0xf'));var Papa=require('papaparse');var Redis=require(_0x667d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x667d('0x11'));var as=require(_0x667d('0x12'));var hardwareService=require(_0x667d('0x13'));var logger=require(_0x667d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x667d('0x15'));var db=require('../../mysqldb')['db'];config[_0x667d('0x16')]=_[_0x667d('0x17')](config[_0x667d('0x16')],{'host':_0x667d('0x18'),'port':0x18eb});var socket=require(_0x667d('0x19'))(new Redis(config[_0x667d('0x16')]));require('./team.socket')[_0x667d('0x1a')](socket);function respondWithStatusCode(_0x1b2f55,_0x91e34b){_0x91e34b=_0x91e34b||0xcc;return function(_0x31b7d6){if(_0x31b7d6){return _0x1b2f55['sendStatus'](_0x91e34b);}return _0x1b2f55[_0x667d('0x1b')](_0x91e34b)[_0x667d('0x1c')]();};}function respondWithResult(_0x6f8b72,_0x12f1ec){_0x12f1ec=_0x12f1ec||0xc8;return function(_0x1319f3){if(_0x1319f3){return _0x6f8b72[_0x667d('0x1b')](_0x12f1ec)[_0x667d('0x1d')](_0x1319f3);}};}function respondWithFilteredResult(_0x1fd3e8,_0x4bfec4){return function(_0x3462b3){if(_0x3462b3){var _0x14843d=_0x3462b3[_0x667d('0x1e')],_0x8cbda6=_0x4bfec4[_0x667d('0x1f')],_0x1e6138=_0x4bfec4[_0x667d('0x1f')]+_0x4bfec4[_0x667d('0x20')],_0x2d0847;if(_0x1e6138>=_0x14843d){_0x1e6138=_0x14843d;_0x2d0847=0xc8;}else{_0x2d0847=0xce;}_0x1fd3e8[_0x667d('0x1b')](_0x2d0847);return _0x1fd3e8[_0x667d('0x21')]('Content-Range',_0x8cbda6+'-'+_0x1e6138+'/'+_0x14843d)[_0x667d('0x1d')](_0x3462b3);}return null;};}function patchUpdates(_0x180175){return function(_0x347458){try{jsonpatch[_0x667d('0x22')](_0x347458,_0x180175,!![]);}catch(_0x48bba4){return BPromise[_0x667d('0x23')](_0x48bba4);}return _0x347458[_0x667d('0x24')]();};}function saveUpdates(_0x5d6d95,_0x250b33){return function(_0x429d56){if(_0x429d56){return _0x429d56['update'](_0x5d6d95)[_0x667d('0x25')](function(_0xe4aa5){return _0xe4aa5;});}return null;};}function removeEntity(_0x4a482a,_0x32809c){return function(_0x19ca91){if(_0x19ca91){return _0x19ca91[_0x667d('0x26')]()[_0x667d('0x25')](function(){var _0x2b008c=_0x19ca91[_0x667d('0x27')]({'plain':!![]});var _0x39e41e=_0x667d('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x39e41e,'resourceId':_0x2b008c['id']}})['then'](function(){return _0x19ca91;});})[_0x667d('0x25')](function(){_0x4a482a[_0x667d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x354b87,_0xa10520){return function(_0x4074d5){if(!_0x4074d5){_0x354b87[_0x667d('0x29')](0x194);}return _0x4074d5;};}function handleError(_0x3e2b45,_0x1092ac){_0x1092ac=_0x1092ac||0x1f4;return function(_0x449721){logger[_0x667d('0x2a')](_0x449721[_0x667d('0x2b')]);if(_0x449721['name']){delete _0x449721[_0x667d('0x2c')];}_0x3e2b45[_0x667d('0x1b')](_0x1092ac)['send'](_0x449721);};}exports['index']=function(_0x58868d,_0x5c7dad){var _0x579167={},_0x564744={},_0x242f3b={'count':0x0,'rows':[]};var _0x65452c=_[_0x667d('0x2d')](db[_0x667d('0x2e')][_0x667d('0x2f')],function(_0x48a414){return{'name':_0x48a414[_0x667d('0x30')],'type':_0x48a414[_0x667d('0x31')][_0x667d('0x32')]};});_0x564744[_0x667d('0x33')]=_[_0x667d('0x2d')](_0x65452c,_0x667d('0x2c'));_0x564744[_0x667d('0x34')]=_['keys'](_0x58868d[_0x667d('0x34')]);_0x564744['filters']=_[_0x667d('0x35')](_0x564744[_0x667d('0x33')],_0x564744[_0x667d('0x34')]);_0x579167['attributes']=_['intersection'](_0x564744[_0x667d('0x33')],qs[_0x667d('0x36')](_0x58868d[_0x667d('0x34')][_0x667d('0x36')]));_0x579167[_0x667d('0x37')]=_0x579167[_0x667d('0x37')]['length']?_0x579167[_0x667d('0x37')]:_0x564744[_0x667d('0x33')];if(!_0x58868d[_0x667d('0x34')][_0x667d('0x38')](_0x667d('0x39'))){_0x579167[_0x667d('0x20')]=qs['limit'](_0x58868d[_0x667d('0x34')][_0x667d('0x20')]);_0x579167['offset']=qs['offset'](_0x58868d[_0x667d('0x34')][_0x667d('0x1f')]);}_0x579167[_0x667d('0x3a')]=qs[_0x667d('0x3b')](_0x58868d['query'][_0x667d('0x3b')]);_0x579167[_0x667d('0x3c')]=qs[_0x667d('0x3d')](_[_0x667d('0x3e')](_0x58868d[_0x667d('0x34')],_0x564744['filters']),_0x65452c);if(_0x58868d[_0x667d('0x34')]['filter']){_0x579167['where']=_['merge'](_0x579167['where'],{'$or':_[_0x667d('0x2d')](_0x65452c,function(_0xcd760f){if(_0xcd760f[_0x667d('0x31')]!==_0x667d('0x3f')){var _0x555da5={};_0x555da5[_0xcd760f[_0x667d('0x2c')]]={'$like':'%'+_0x58868d[_0x667d('0x34')][_0x667d('0x40')]+'%'};return _0x555da5;}})});}_0x579167=_[_0x667d('0x41')]({},_0x579167,_0x58868d[_0x667d('0x42')]);var _0x2f651e={'where':_0x579167[_0x667d('0x3c')]};return db['Team'][_0x667d('0x1e')](_0x2f651e)[_0x667d('0x25')](function(_0x1e6901){_0x242f3b['count']=_0x1e6901;if(_0x58868d[_0x667d('0x34')][_0x667d('0x43')]){_0x579167[_0x667d('0x44')]=[{'all':!![]}];}return db[_0x667d('0x2e')][_0x667d('0x45')](_0x579167);})['then'](function(_0x4040aa){_0x242f3b[_0x667d('0x46')]=_0x4040aa;return _0x242f3b;})['then'](respondWithFilteredResult(_0x5c7dad,_0x579167))[_0x667d('0x47')](handleError(_0x5c7dad,null));};exports[_0x667d('0x48')]=function(_0x5182fc,_0x330c3e){var _0x121b12={'raw':![],'where':{'id':_0x5182fc[_0x667d('0x49')]['id']}},_0x38819e={};_0x38819e[_0x667d('0x33')]=_[_0x667d('0x4a')](db['Team']['rawAttributes']);_0x38819e[_0x667d('0x34')]=_[_0x667d('0x4a')](_0x5182fc[_0x667d('0x34')]);_0x38819e['filters']=_['intersection'](_0x38819e['model'],_0x38819e[_0x667d('0x34')]);_0x121b12[_0x667d('0x37')]=_['intersection'](_0x38819e[_0x667d('0x33')],qs['fields'](_0x5182fc[_0x667d('0x34')][_0x667d('0x36')]));_0x121b12[_0x667d('0x37')]=_0x121b12[_0x667d('0x37')][_0x667d('0x4b')]?_0x121b12[_0x667d('0x37')]:_0x38819e[_0x667d('0x33')];if(_0x5182fc[_0x667d('0x34')]['includeAll']){_0x121b12[_0x667d('0x44')]=[{'all':!![]}];}_0x121b12=_[_0x667d('0x41')]({},_0x121b12,_0x5182fc['options']);return db['Team'][_0x667d('0x4c')](_0x121b12)['then'](handleEntityNotFound(_0x330c3e,null))[_0x667d('0x25')](respondWithResult(_0x330c3e,null))[_0x667d('0x47')](handleError(_0x330c3e,null));};exports[_0x667d('0x4d')]=function(_0x527d27,_0x18fdd0){return db[_0x667d('0x2e')][_0x667d('0x4d')](_0x527d27[_0x667d('0x4e')],{})[_0x667d('0x25')](function(_0x210e13){var _0x47683f=_0x527d27[_0x667d('0x4f')][_0x667d('0x27')]({'plain':!![]});if(!_0x47683f)throw new Error(_0x667d('0x50'));if(_0x47683f[_0x667d('0x51')]===_0x667d('0x4f')){var _0x14ecfe=_0x210e13[_0x667d('0x27')]({'plain':!![]});var _0x3193a1=_0x667d('0x28');return db[_0x667d('0x52')][_0x667d('0x4c')]({'where':{'name':_0x3193a1,'userProfileId':_0x47683f['userProfileId']},'raw':!![]})[_0x667d('0x25')](function(_0x4da15c){if(_0x4da15c&&_0x4da15c['autoAssociation']===0x0){return db['UserProfileResource'][_0x667d('0x4d')]({'name':_0x14ecfe[_0x667d('0x2c')],'resourceId':_0x14ecfe['id'],'type':_0x4da15c[_0x667d('0x2c')],'sectionId':_0x4da15c['id']},{})[_0x667d('0x25')](function(){return _0x210e13;});}else{return _0x210e13;}})['catch'](function(_0x323669){logger[_0x667d('0x2a')](_0x667d('0x53'),_0x323669);throw _0x323669;});}return _0x210e13;})[_0x667d('0x25')](respondWithResult(_0x18fdd0,0xc9))['catch'](handleError(_0x18fdd0,null));};exports[_0x667d('0x54')]=function(_0x25a51c,_0x1dcc88){if(_0x25a51c['body']['id']){delete _0x25a51c['body']['id'];}return db[_0x667d('0x2e')][_0x667d('0x4c')]({'where':{'id':_0x25a51c['params']['id']}})['then'](handleEntityNotFound(_0x1dcc88,null))['then'](saveUpdates(_0x25a51c['body'],null))['then'](respondWithResult(_0x1dcc88,null))['catch'](handleError(_0x1dcc88,null));};exports[_0x667d('0x26')]=function(_0x147fef,_0x4dd1c0){return db[_0x667d('0x2e')][_0x667d('0x4c')]({'where':{'id':_0x147fef[_0x667d('0x49')]['id']}})['then'](handleEntityNotFound(_0x4dd1c0,null))[_0x667d('0x25')](removeEntity(_0x4dd1c0,null))[_0x667d('0x47')](handleError(_0x4dd1c0,null));};exports['getQueues']=function(_0x350fd6,_0x1e3fe0,_0x22ac09){return db['Team'][_0x667d('0x55')]({'where':{'id':_0x350fd6['params']['id']}})[_0x667d('0x25')](handleEntityNotFound(_0x1e3fe0,null))[_0x667d('0x25')](function(_0x3f926c){if(!_0x350fd6['query'][_0x667d('0x56')]||!utils[_0x667d('0x57')](_0x350fd6['query'][_0x667d('0x56')])){throw new db[(_0x667d('0x58'))]['ValidationError'](_0x667d('0x59'));}var _0xb0b5fe={};var _0x488647={};_0x488647[_0x667d('0x33')]=_[_0x667d('0x4a')](db[_['capitalize'](_0x350fd6[_0x667d('0x34')]['channel'][_0x667d('0x5a')]())+_0x667d('0x5b')][_0x667d('0x2f')]);_0x488647[_0x667d('0x34')]=_[_0x667d('0x4a')](_0x350fd6['query']);_0x488647[_0x667d('0x3d')]=_[_0x667d('0x35')](_0x488647['model'],_0x488647[_0x667d('0x34')]);_0xb0b5fe[_0x667d('0x37')]=_[_0x667d('0x35')](_0x488647[_0x667d('0x33')],qs[_0x667d('0x36')](_0x350fd6['query'][_0x667d('0x36')]));_0xb0b5fe[_0x667d('0x37')]=_0xb0b5fe[_0x667d('0x37')][_0x667d('0x4b')]?_0xb0b5fe[_0x667d('0x37')]:_0x488647[_0x667d('0x33')];_0xb0b5fe[_0x667d('0x20')]=qs['limit'](_0x350fd6['query']['limit']);_0xb0b5fe[_0x667d('0x1f')]=qs[_0x667d('0x1f')](_0x350fd6[_0x667d('0x34')][_0x667d('0x1f')]);_0xb0b5fe[_0x667d('0x3a')]=qs[_0x667d('0x3b')](_0x350fd6[_0x667d('0x34')][_0x667d('0x3b')]);_0xb0b5fe[_0x667d('0x3c')]=qs[_0x667d('0x3d')](_[_0x667d('0x3e')](_0x350fd6[_0x667d('0x34')],_0x488647[_0x667d('0x3d')]));_0xb0b5fe=_[_0x667d('0x41')]({},_0xb0b5fe,_0x350fd6[_0x667d('0x42')]);return _0x3f926c[_0x667d('0x27')+_[_0x667d('0x5c')](_0x350fd6[_0x667d('0x34')][_0x667d('0x56')][_0x667d('0x5a')]())+_0x667d('0x5d')](_0xb0b5fe);})[_0x667d('0x25')](respondWithResult(_0x1e3fe0,null))[_0x667d('0x47')](handleError(_0x1e3fe0,null));};exports[_0x667d('0x5e')]=function(_0x5c2d2d,_0x5cd913,_0x4122d3){return db[_0x667d('0x2e')][_0x667d('0x55')]({'where':{'id':_0x5c2d2d[_0x667d('0x49')]['id']}})[_0x667d('0x25')](function(_0x585458){if(_0x585458){if(!_0x5c2d2d[_0x667d('0x4e')][_0x667d('0x56')]||!utils[_0x667d('0x57')](_0x5c2d2d[_0x667d('0x4e')]['channel'])){throw new db['Sequelize'][(_0x667d('0x5f'))](_0x667d('0x59'));}return _0x585458[_0x667d('0x60')+_['capitalize'](_0x5c2d2d['body'][_0x667d('0x56')]['toLowerCase']())+_0x667d('0x5d')](_0x5c2d2d[_0x667d('0x4e')][_0x667d('0x61')]);}return null;})[_0x667d('0x25')](handleEntityNotFound(_0x5cd913,null))['then'](respondWithStatusCode(_0x5cd913,null))['catch'](handleError(_0x5cd913,null));};exports['removeQueues']=function(_0x4c6ad7,_0x2db0ef,_0x1b9e51){return db[_0x667d('0x2e')]['findOne']({'where':{'id':_0x4c6ad7[_0x667d('0x49')]['id']}})[_0x667d('0x25')](function(_0x4cfb36){if(_0x4cfb36){if(!_0x4c6ad7[_0x667d('0x34')][_0x667d('0x56')]||!utils[_0x667d('0x57')](_0x4c6ad7['query']['channel'])){throw new db[(_0x667d('0x58'))][(_0x667d('0x5f'))](_0x667d('0x59'));}return _0x4cfb36[_0x667d('0x62')+_[_0x667d('0x5c')](_0x4c6ad7['query'][_0x667d('0x56')][_0x667d('0x5a')]())+_0x667d('0x5d')](_0x4c6ad7['query']['ids']);}return null;})['then'](handleEntityNotFound(_0x2db0ef,null))[_0x667d('0x25')](respondWithStatusCode(_0x2db0ef,null))[_0x667d('0x47')](handleError(_0x2db0ef,null));};exports['addAgents']=function(_0xba4d2a,_0x239134,_0x582233){return db[_0x667d('0x2e')][_0x667d('0x4c')]({'where':{'id':_0xba4d2a['params']['id']}})[_0x667d('0x25')](handleEntityNotFound(_0x239134,null))[_0x667d('0x25')](function(_0x5247a4){if(_0x5247a4){var _0x2b2d92=[_0x667d('0x63'),'Chat','Mail',_0x667d('0x64'),_0x667d('0x65'),_0x667d('0x66'),'Whatsapp'];return BPromise['each'](_0x2b2d92,function(_0x44279b){return _0x5247a4[_0x667d('0x27')+_0x44279b+_0x667d('0x5d')]({'attributes':['id',_0x667d('0x2c')]})[_0x667d('0x25')](function(_0x9fc957){return BPromise[_0x667d('0x67')](_0x9fc957,function(_0x2977be){return _0x2977be[_0x667d('0x68')](_0xba4d2a[_0x667d('0x4e')][_0x667d('0x61')])[_0x667d('0x25')](function(){if(_0x44279b===_0x667d('0x63')){return db['User'][_0x667d('0x45')]({'where':{'id':_0xba4d2a[_0x667d('0x4e')][_0x667d('0x61')]},'attributes':['id',_0x667d('0x2c'),'online',_0x667d('0x69'),'interface'],'raw':!![]})[_0x667d('0x25')](function(_0x3979d6){return BPromise[_0x667d('0x67')](_['filter'](_0x3979d6,{'online':0x1}),function(_0x1eb6dd){return db[_0x667d('0x6a')][_0x667d('0x6b')]({'membername':_0x1eb6dd['name'],'UserId':_0x1eb6dd['id'],'queue_name':_0x2977be['name'],'VoiceQueueId':_0x2977be['id'],'interface':_[_0x667d('0x6c')](_0x1eb6dd['interface'])?util[_0x667d('0x6d')](_0x667d('0x6e'),_0x1eb6dd['name']):_0x1eb6dd[_0x667d('0x6f')],'paused':_0x1eb6dd['voicePause']||![],'penalty':0x0});});});}});});})[_0x667d('0x25')](function(){return _0x5247a4;});})[_0x667d('0x25')](function(){return _0x5247a4;});}})[_0x667d('0x25')](function(_0x3d88c2){if(_0x3d88c2){return _0x3d88c2['addAgents'](_0xba4d2a[_0x667d('0x4e')][_0x667d('0x61')],_[_0x667d('0x70')](_0xba4d2a[_0x667d('0x4e')],[_0x667d('0x61'),'id'])||{})[_0x667d('0x71')](function(_0x2e6ac8){for(var _0xf48a5=0x0;_0xf48a5<_0xba4d2a[_0x667d('0x4e')][_0x667d('0x61')]['length'];_0xf48a5+=0x1){socket[_0x667d('0x72')](_0x667d('0x73'),{'UserId':_0xba4d2a[_0x667d('0x4e')][_0x667d('0x61')][_0xf48a5],'TeamId':_0xba4d2a['params']['id']});}return _0x2e6ac8;});}})[_0x667d('0x25')](respondWithResult(_0x239134,null))[_0x667d('0x47')](handleError(_0x239134,null));};exports[_0x667d('0x74')]=function(_0x536522,_0x4330bc,_0x59d709){return db[_0x667d('0x2e')][_0x667d('0x4c')]({'where':{'id':_0x536522[_0x667d('0x49')]['id']}})[_0x667d('0x25')](handleEntityNotFound(_0x4330bc,null))[_0x667d('0x25')](function(_0x36a865){if(_0x36a865){return BPromise[_0x667d('0x67')]([_0x667d('0x75'),_0x667d('0x76'),_0x667d('0x77'),_0x667d('0x78'),'fax',_0x667d('0x79'),_0x667d('0x7a')],function(_0xb4c43c){return _0x36a865['get'+_[_0x667d('0x5c')](_0xb4c43c)+_0x667d('0x5d')]({'attributes':['id',_0x667d('0x2c')]})[_0x667d('0x25')](function(_0x3dd497){return BPromise[_0x667d('0x67')](_0x3dd497,function(_0x21129d){return _0x21129d[_0x667d('0x74')](_0x536522[_0x667d('0x34')]['ids'])['then'](function(){if(_0xb4c43c===_0x667d('0x75')){return db[_0x667d('0x6a')][_0x667d('0x26')]({'where':{'VoiceQueueId':_0x21129d['id'],'UserId':_0x536522[_0x667d('0x34')]['ids']}});}});});})[_0x667d('0x25')](function(){return _0x36a865;});})['then'](function(){return _0x36a865;});}})['then'](function(_0x38be18){if(_0x38be18){return _0x38be18['removeAgents'](_0x536522['query'][_0x667d('0x61')])['then'](function(){if(_['isArray'](_0x536522[_0x667d('0x34')]['ids'])){for(var _0x26a0c1=0x0;_0x26a0c1<_0x536522[_0x667d('0x34')]['ids']['length'];_0x26a0c1+=0x1){socket[_0x667d('0x72')]('userTeam:remove',{'UserId':Number(_0x536522[_0x667d('0x34')][_0x667d('0x61')][_0x26a0c1]),'TeamId':Number(_0x536522['params']['id'])});}}else{socket[_0x667d('0x72')]('userTeam:remove',{'UserId':Number(_0x536522[_0x667d('0x34')][_0x667d('0x61')]),'TeamId':Number(_0x536522['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4330bc,null))[_0x667d('0x47')](handleError(_0x4330bc,null));};exports[_0x667d('0x7b')]=function(_0x1a16de,_0x4dc37c,_0x27e4d2){var _0x483e82={};var _0x8f911d={};var _0x5e9364;var _0x5f37eb;return db[_0x667d('0x2e')][_0x667d('0x55')]({'where':{'id':_0x1a16de[_0x667d('0x49')]['id']}})[_0x667d('0x25')](handleEntityNotFound(_0x4dc37c,null))[_0x667d('0x25')](function(_0x238381){if(_0x238381){_0x5e9364=_0x238381;_0x8f911d[_0x667d('0x33')]=_[_0x667d('0x4a')](db['User'][_0x667d('0x2f')]);_0x8f911d[_0x667d('0x34')]=_['keys'](_0x1a16de[_0x667d('0x34')]);_0x8f911d[_0x667d('0x3d')]=_[_0x667d('0x35')](_0x8f911d['model'],_0x8f911d['query']);_0x483e82[_0x667d('0x37')]=_[_0x667d('0x35')](_0x8f911d[_0x667d('0x33')],qs[_0x667d('0x36')](_0x1a16de['query'][_0x667d('0x36')]));_0x483e82[_0x667d('0x37')]=_0x483e82[_0x667d('0x37')]['length']?_0x483e82['attributes']:_0x8f911d[_0x667d('0x33')];_0x483e82[_0x667d('0x3a')]=qs['sort'](_0x1a16de[_0x667d('0x34')][_0x667d('0x3b')]);_0x483e82[_0x667d('0x3c')]=qs['filters'](_[_0x667d('0x3e')](_0x1a16de[_0x667d('0x34')],_0x8f911d[_0x667d('0x3d')]));if(_0x1a16de['query'][_0x667d('0x40')]){_0x483e82[_0x667d('0x3c')]=_[_0x667d('0x41')](_0x483e82[_0x667d('0x3c')],{'$or':_[_0x667d('0x2d')](_0x483e82[_0x667d('0x37')],function(_0x459831){var _0x4de5e4={};_0x4de5e4[_0x459831]={'$like':'%'+_0x1a16de[_0x667d('0x34')][_0x667d('0x40')]+'%'};return _0x4de5e4;})});}_0x483e82=_['merge']({},_0x483e82,_0x1a16de[_0x667d('0x42')]);return _0x5e9364[_0x667d('0x7b')](_0x483e82);}})[_0x667d('0x25')](function(_0x3a8fe0){if(_0x3a8fe0){_0x5f37eb=_0x3a8fe0[_0x667d('0x4b')];if(!_0x1a16de[_0x667d('0x34')][_0x667d('0x38')](_0x667d('0x39'))){_0x483e82[_0x667d('0x20')]=qs['limit'](_0x1a16de['query'][_0x667d('0x20')]);_0x483e82['offset']=qs[_0x667d('0x1f')](_0x1a16de[_0x667d('0x34')]['offset']);}return _0x5e9364[_0x667d('0x7b')](_0x483e82);}})['then'](function(_0x609c35){if(_0x609c35){return _0x609c35?{'count':_0x5f37eb,'rows':_0x609c35}:null;}})[_0x667d('0x25')](respondWithResult(_0x4dc37c,null))[_0x667d('0x47')](handleError(_0x4dc37c,null));};
\ No newline at end of file
+var _0xda9d=['format','interface','omit','spread','emit','userTeam:save','removeAgents','voice','chat','mail','userTeam:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./team.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','update','destroy','then','get','Teams','error','stack','name','send','index','map','Team','type','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','fields','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','findOne','add','Queues','removeQueues','Sequelize','ids','Voice','Chat','Mail','Sms','Fax','each','addAgents','User','online','voicePause','UserVoiceQueueRt','upsert','isNil'];(function(_0x2b3c2c,_0x2f21c6){var _0xd4557e=function(_0x4e2736){while(--_0x4e2736){_0x2b3c2c['push'](_0x2b3c2c['shift']());}};_0xd4557e(++_0x2f21c6);}(_0xda9d,0x85));var _0xdda9=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0xda9d[_0x48b5e0];return _0x4287ea;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdda9('0x0'));var rimraf=require(_0xdda9('0x1'));var zipdir=require(_0xdda9('0x2'));var jsonpatch=require(_0xdda9('0x3'));var rp=require(_0xdda9('0x4'));var moment=require('moment');var BPromise=require(_0xdda9('0x5'));var Mustache=require('mustache');var util=require(_0xdda9('0x6'));var path=require('path');var sox=require(_0xdda9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdda9('0x8'));var crypto=require(_0xdda9('0x9'));var jsforce=require(_0xdda9('0xa'));var deskjs=require(_0xdda9('0xb'));var toCsv=require('to-csv');var querystring=require(_0xdda9('0xc'));var Papa=require(_0xdda9('0xd'));var Redis=require(_0xdda9('0xe'));var authService=require(_0xdda9('0xf'));var qs=require(_0xdda9('0x10'));var as=require(_0xdda9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdda9('0x12'));var config=require(_0xdda9('0x13'));var db=require(_0xdda9('0x14'))['db'];config['redis']=_[_0xdda9('0x15')](config[_0xdda9('0x16')],{'host':_0xdda9('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdda9('0x18'))[_0xdda9('0x19')](socket);function respondWithStatusCode(_0x2045f3,_0x10061f){_0x10061f=_0x10061f||0xcc;return function(_0x389750){if(_0x389750){return _0x2045f3[_0xdda9('0x1a')](_0x10061f);}return _0x2045f3[_0xdda9('0x1b')](_0x10061f)[_0xdda9('0x1c')]();};}function respondWithResult(_0x27899a,_0x18a3f8){_0x18a3f8=_0x18a3f8||0xc8;return function(_0x14ad33){if(_0x14ad33){return _0x27899a[_0xdda9('0x1b')](_0x18a3f8)[_0xdda9('0x1d')](_0x14ad33);}};}function respondWithFilteredResult(_0x30dec2,_0x1c0bbc){return function(_0x4ae02a){if(_0x4ae02a){var _0x2e8c4e=_0x4ae02a[_0xdda9('0x1e')],_0x200b60=_0x1c0bbc[_0xdda9('0x1f')],_0x1c46b9=_0x1c0bbc[_0xdda9('0x1f')]+_0x1c0bbc[_0xdda9('0x20')],_0x25d1e7;if(_0x1c46b9>=_0x2e8c4e){_0x1c46b9=_0x2e8c4e;_0x25d1e7=0xc8;}else{_0x25d1e7=0xce;}_0x30dec2[_0xdda9('0x1b')](_0x25d1e7);return _0x30dec2[_0xdda9('0x21')]('Content-Range',_0x200b60+'-'+_0x1c46b9+'/'+_0x2e8c4e)[_0xdda9('0x1d')](_0x4ae02a);}return null;};}function patchUpdates(_0x518f92){return function(_0x471056){try{jsonpatch[_0xdda9('0x22')](_0x471056,_0x518f92,!![]);}catch(_0x90dafa){return BPromise['reject'](_0x90dafa);}return _0x471056['save']();};}function saveUpdates(_0x2ec141,_0x2c9048){return function(_0x326db6){if(_0x326db6){return _0x326db6[_0xdda9('0x23')](_0x2ec141)['then'](function(_0x3462ce){return _0x3462ce;});}return null;};}function removeEntity(_0x402134,_0x3ddb32){return function(_0x4e4710){if(_0x4e4710){return _0x4e4710[_0xdda9('0x24')]()[_0xdda9('0x25')](function(){var _0x2257f1=_0x4e4710[_0xdda9('0x26')]({'plain':!![]});var _0x2b67d4=_0xdda9('0x27');return db['UserProfileResource'][_0xdda9('0x24')]({'where':{'type':_0x2b67d4,'resourceId':_0x2257f1['id']}})[_0xdda9('0x25')](function(){return _0x4e4710;});})[_0xdda9('0x25')](function(){_0x402134[_0xdda9('0x1b')](0xcc)[_0xdda9('0x1c')]();});}};}function handleEntityNotFound(_0x22ac80,_0xb10a83){return function(_0x8eae05){if(!_0x8eae05){_0x22ac80[_0xdda9('0x1a')](0x194);}return _0x8eae05;};}function handleError(_0x130105,_0x2278cd){_0x2278cd=_0x2278cd||0x1f4;return function(_0x3a74de){logger[_0xdda9('0x28')](_0x3a74de[_0xdda9('0x29')]);if(_0x3a74de['name']){delete _0x3a74de[_0xdda9('0x2a')];}_0x130105[_0xdda9('0x1b')](_0x2278cd)[_0xdda9('0x2b')](_0x3a74de);};}exports[_0xdda9('0x2c')]=function(_0x1f078f,_0x2a88af){var _0x553036={},_0x516c7d={},_0x239ae9={'count':0x0,'rows':[]};var _0x4857c0=_[_0xdda9('0x2d')](db[_0xdda9('0x2e')]['rawAttributes'],function(_0x5f5478){return{'name':_0x5f5478['fieldName'],'type':_0x5f5478[_0xdda9('0x2f')]['key']};});_0x516c7d[_0xdda9('0x30')]=_['map'](_0x4857c0,_0xdda9('0x2a'));_0x516c7d[_0xdda9('0x31')]=_[_0xdda9('0x32')](_0x1f078f[_0xdda9('0x31')]);_0x516c7d['filters']=_[_0xdda9('0x33')](_0x516c7d[_0xdda9('0x30')],_0x516c7d[_0xdda9('0x31')]);_0x553036[_0xdda9('0x34')]=_[_0xdda9('0x33')](_0x516c7d[_0xdda9('0x30')],qs['fields'](_0x1f078f['query']['fields']));_0x553036[_0xdda9('0x34')]=_0x553036[_0xdda9('0x34')][_0xdda9('0x35')]?_0x553036[_0xdda9('0x34')]:_0x516c7d[_0xdda9('0x30')];if(!_0x1f078f['query'][_0xdda9('0x36')](_0xdda9('0x37'))){_0x553036[_0xdda9('0x20')]=qs[_0xdda9('0x20')](_0x1f078f[_0xdda9('0x31')]['limit']);_0x553036[_0xdda9('0x1f')]=qs[_0xdda9('0x1f')](_0x1f078f[_0xdda9('0x31')]['offset']);}_0x553036[_0xdda9('0x38')]=qs[_0xdda9('0x39')](_0x1f078f[_0xdda9('0x31')][_0xdda9('0x39')]);_0x553036[_0xdda9('0x3a')]=qs['filters'](_[_0xdda9('0x3b')](_0x1f078f[_0xdda9('0x31')],_0x516c7d[_0xdda9('0x3c')]),_0x4857c0);if(_0x1f078f['query'][_0xdda9('0x3d')]){_0x553036['where']=_[_0xdda9('0x3e')](_0x553036[_0xdda9('0x3a')],{'$or':_['map'](_0x4857c0,function(_0x5ab11d){if(_0x5ab11d[_0xdda9('0x2f')]!==_0xdda9('0x3f')){var _0x261c42={};_0x261c42[_0x5ab11d[_0xdda9('0x2a')]]={'$like':'%'+_0x1f078f['query'][_0xdda9('0x3d')]+'%'};return _0x261c42;}})});}_0x553036=_[_0xdda9('0x3e')]({},_0x553036,_0x1f078f[_0xdda9('0x40')]);var _0x5cd55a={'where':_0x553036[_0xdda9('0x3a')]};return db[_0xdda9('0x2e')][_0xdda9('0x1e')](_0x5cd55a)[_0xdda9('0x25')](function(_0x573c86){_0x239ae9['count']=_0x573c86;if(_0x1f078f[_0xdda9('0x31')]['includeAll']){_0x553036[_0xdda9('0x41')]=[{'all':!![]}];}return db[_0xdda9('0x2e')][_0xdda9('0x42')](_0x553036);})[_0xdda9('0x25')](function(_0x4a1794){_0x239ae9[_0xdda9('0x43')]=_0x4a1794;return _0x239ae9;})[_0xdda9('0x25')](respondWithFilteredResult(_0x2a88af,_0x553036))['catch'](handleError(_0x2a88af,null));};exports[_0xdda9('0x44')]=function(_0x3d563a,_0x4bf8c3){var _0x35210f={'raw':![],'where':{'id':_0x3d563a[_0xdda9('0x45')]['id']}},_0x3bbd35={};_0x3bbd35[_0xdda9('0x30')]=_[_0xdda9('0x32')](db['Team'][_0xdda9('0x46')]);_0x3bbd35[_0xdda9('0x31')]=_[_0xdda9('0x32')](_0x3d563a[_0xdda9('0x31')]);_0x3bbd35[_0xdda9('0x3c')]=_[_0xdda9('0x33')](_0x3bbd35[_0xdda9('0x30')],_0x3bbd35[_0xdda9('0x31')]);_0x35210f[_0xdda9('0x34')]=_[_0xdda9('0x33')](_0x3bbd35[_0xdda9('0x30')],qs[_0xdda9('0x47')](_0x3d563a[_0xdda9('0x31')]['fields']));_0x35210f[_0xdda9('0x34')]=_0x35210f[_0xdda9('0x34')]['length']?_0x35210f[_0xdda9('0x34')]:_0x3bbd35['model'];if(_0x3d563a[_0xdda9('0x31')][_0xdda9('0x48')]){_0x35210f[_0xdda9('0x41')]=[{'all':!![]}];}_0x35210f=_[_0xdda9('0x3e')]({},_0x35210f,_0x3d563a[_0xdda9('0x40')]);return db[_0xdda9('0x2e')][_0xdda9('0x49')](_0x35210f)[_0xdda9('0x25')](handleEntityNotFound(_0x4bf8c3,null))['then'](respondWithResult(_0x4bf8c3,null))[_0xdda9('0x4a')](handleError(_0x4bf8c3,null));};exports[_0xdda9('0x4b')]=function(_0x5b667f,_0x444528){return db['Team']['create'](_0x5b667f[_0xdda9('0x4c')],{})[_0xdda9('0x25')](function(_0x28ff32){var _0x34cd55=_0x5b667f[_0xdda9('0x4d')][_0xdda9('0x26')]({'plain':!![]});if(!_0x34cd55)throw new Error(_0xdda9('0x4e'));if(_0x34cd55[_0xdda9('0x4f')]==='user'){var _0x2e745e=_0x28ff32['get']({'plain':!![]});var _0x140448='Teams';return db[_0xdda9('0x50')][_0xdda9('0x49')]({'where':{'name':_0x140448,'userProfileId':_0x34cd55['userProfileId']},'raw':!![]})[_0xdda9('0x25')](function(_0x1f6af1){if(_0x1f6af1&&_0x1f6af1['autoAssociation']===0x0){return db['UserProfileResource'][_0xdda9('0x4b')]({'name':_0x2e745e[_0xdda9('0x2a')],'resourceId':_0x2e745e['id'],'type':_0x1f6af1[_0xdda9('0x2a')],'sectionId':_0x1f6af1['id']},{})[_0xdda9('0x25')](function(){return _0x28ff32;});}else{return _0x28ff32;}})[_0xdda9('0x4a')](function(_0x4cad1b){logger[_0xdda9('0x28')](_0xdda9('0x51'),_0x4cad1b);throw _0x4cad1b;});}return _0x28ff32;})[_0xdda9('0x25')](respondWithResult(_0x444528,0xc9))[_0xdda9('0x4a')](handleError(_0x444528,null));};exports['update']=function(_0x474283,_0x432a54){if(_0x474283[_0xdda9('0x4c')]['id']){delete _0x474283[_0xdda9('0x4c')]['id'];}return db['Team'][_0xdda9('0x49')]({'where':{'id':_0x474283[_0xdda9('0x45')]['id']}})[_0xdda9('0x25')](handleEntityNotFound(_0x432a54,null))['then'](saveUpdates(_0x474283[_0xdda9('0x4c')],null))[_0xdda9('0x25')](respondWithResult(_0x432a54,null))[_0xdda9('0x4a')](handleError(_0x432a54,null));};exports[_0xdda9('0x24')]=function(_0x38a6da,_0x200ce1){return db[_0xdda9('0x2e')]['find']({'where':{'id':_0x38a6da[_0xdda9('0x45')]['id']}})[_0xdda9('0x25')](handleEntityNotFound(_0x200ce1,null))[_0xdda9('0x25')](removeEntity(_0x200ce1,null))[_0xdda9('0x4a')](handleError(_0x200ce1,null));};exports[_0xdda9('0x52')]=function(_0x472382,_0x4cdbe7,_0x2aaf62){return db[_0xdda9('0x2e')]['findOne']({'where':{'id':_0x472382[_0xdda9('0x45')]['id']}})[_0xdda9('0x25')](handleEntityNotFound(_0x4cdbe7,null))['then'](function(_0x57d543){if(!_0x472382[_0xdda9('0x31')][_0xdda9('0x53')]||!utils[_0xdda9('0x54')](_0x472382[_0xdda9('0x31')]['channel'])){throw new db['Sequelize'][(_0xdda9('0x55'))](_0xdda9('0x56'));}var _0x2be189={};var _0x3efb34={};_0x3efb34['model']=_[_0xdda9('0x32')](db[_[_0xdda9('0x57')](_0x472382['query'][_0xdda9('0x53')][_0xdda9('0x58')]())+_0xdda9('0x59')][_0xdda9('0x46')]);_0x3efb34[_0xdda9('0x31')]=_['keys'](_0x472382[_0xdda9('0x31')]);_0x3efb34[_0xdda9('0x3c')]=_[_0xdda9('0x33')](_0x3efb34[_0xdda9('0x30')],_0x3efb34[_0xdda9('0x31')]);_0x2be189['attributes']=_[_0xdda9('0x33')](_0x3efb34[_0xdda9('0x30')],qs[_0xdda9('0x47')](_0x472382[_0xdda9('0x31')][_0xdda9('0x47')]));_0x2be189[_0xdda9('0x34')]=_0x2be189[_0xdda9('0x34')][_0xdda9('0x35')]?_0x2be189['attributes']:_0x3efb34[_0xdda9('0x30')];_0x2be189[_0xdda9('0x20')]=qs[_0xdda9('0x20')](_0x472382['query']['limit']);_0x2be189[_0xdda9('0x1f')]=qs[_0xdda9('0x1f')](_0x472382[_0xdda9('0x31')][_0xdda9('0x1f')]);_0x2be189[_0xdda9('0x38')]=qs['sort'](_0x472382[_0xdda9('0x31')][_0xdda9('0x39')]);_0x2be189['where']=qs['filters'](_[_0xdda9('0x3b')](_0x472382['query'],_0x3efb34[_0xdda9('0x3c')]));_0x2be189=_[_0xdda9('0x3e')]({},_0x2be189,_0x472382['options']);return _0x57d543['get'+_[_0xdda9('0x57')](_0x472382[_0xdda9('0x31')][_0xdda9('0x53')][_0xdda9('0x58')]())+'Queues'](_0x2be189);})['then'](respondWithResult(_0x4cdbe7,null))[_0xdda9('0x4a')](handleError(_0x4cdbe7,null));};exports['addQueues']=function(_0x3a010e,_0x4be237,_0x5ddbd9){return db[_0xdda9('0x2e')][_0xdda9('0x5a')]({'where':{'id':_0x3a010e[_0xdda9('0x45')]['id']}})[_0xdda9('0x25')](function(_0x5a1882){if(_0x5a1882){if(!_0x3a010e[_0xdda9('0x4c')][_0xdda9('0x53')]||!utils[_0xdda9('0x54')](_0x3a010e[_0xdda9('0x4c')][_0xdda9('0x53')])){throw new db['Sequelize']['ValidationError'](_0xdda9('0x56'));}return _0x5a1882[_0xdda9('0x5b')+_['capitalize'](_0x3a010e['body'][_0xdda9('0x53')][_0xdda9('0x58')]())+_0xdda9('0x5c')](_0x3a010e[_0xdda9('0x4c')]['ids']);}return null;})[_0xdda9('0x25')](handleEntityNotFound(_0x4be237,null))[_0xdda9('0x25')](respondWithStatusCode(_0x4be237,null))[_0xdda9('0x4a')](handleError(_0x4be237,null));};exports[_0xdda9('0x5d')]=function(_0x54b364,_0x38d22c,_0x244739){return db[_0xdda9('0x2e')][_0xdda9('0x5a')]({'where':{'id':_0x54b364[_0xdda9('0x45')]['id']}})[_0xdda9('0x25')](function(_0x3bc785){if(_0x3bc785){if(!_0x54b364[_0xdda9('0x31')][_0xdda9('0x53')]||!utils[_0xdda9('0x54')](_0x54b364[_0xdda9('0x31')][_0xdda9('0x53')])){throw new db[(_0xdda9('0x5e'))][(_0xdda9('0x55'))]('Unknown\x20channel');}return _0x3bc785['remove'+_[_0xdda9('0x57')](_0x54b364[_0xdda9('0x31')][_0xdda9('0x53')][_0xdda9('0x58')]())+'Queues'](_0x54b364[_0xdda9('0x31')][_0xdda9('0x5f')]);}return null;})[_0xdda9('0x25')](handleEntityNotFound(_0x38d22c,null))[_0xdda9('0x25')](respondWithStatusCode(_0x38d22c,null))[_0xdda9('0x4a')](handleError(_0x38d22c,null));};exports['addAgents']=function(_0x1bcce7,_0x1b3181,_0x4dbd07){return db[_0xdda9('0x2e')][_0xdda9('0x49')]({'where':{'id':_0x1bcce7[_0xdda9('0x45')]['id']}})[_0xdda9('0x25')](handleEntityNotFound(_0x1b3181,null))[_0xdda9('0x25')](function(_0x54bfee){if(_0x54bfee){var _0xa4358e=[_0xdda9('0x60'),_0xdda9('0x61'),_0xdda9('0x62'),_0xdda9('0x63'),_0xdda9('0x64'),'Openchannel','Whatsapp'];return BPromise['each'](_0xa4358e,function(_0x4bae5f){return _0x54bfee['get'+_0x4bae5f+'Queues']({'attributes':['id',_0xdda9('0x2a')]})[_0xdda9('0x25')](function(_0x10ab0f){return BPromise[_0xdda9('0x65')](_0x10ab0f,function(_0x5454da){return _0x5454da[_0xdda9('0x66')](_0x1bcce7['body'][_0xdda9('0x5f')])[_0xdda9('0x25')](function(){if(_0x4bae5f===_0xdda9('0x60')){return db[_0xdda9('0x67')][_0xdda9('0x42')]({'where':{'id':_0x1bcce7[_0xdda9('0x4c')][_0xdda9('0x5f')]},'attributes':['id',_0xdda9('0x2a'),_0xdda9('0x68'),_0xdda9('0x69'),'interface'],'raw':!![]})[_0xdda9('0x25')](function(_0x54ab76){return BPromise['each'](_[_0xdda9('0x3d')](_0x54ab76,{'online':0x1}),function(_0x322413){return db[_0xdda9('0x6a')][_0xdda9('0x6b')]({'membername':_0x322413[_0xdda9('0x2a')],'UserId':_0x322413['id'],'queue_name':_0x5454da[_0xdda9('0x2a')],'VoiceQueueId':_0x5454da['id'],'interface':_[_0xdda9('0x6c')](_0x322413['interface'])?util[_0xdda9('0x6d')]('SIP/%s',_0x322413[_0xdda9('0x2a')]):_0x322413[_0xdda9('0x6e')],'paused':_0x322413[_0xdda9('0x69')]||![],'penalty':0x0});});});}});});})[_0xdda9('0x25')](function(){return _0x54bfee;});})[_0xdda9('0x25')](function(){return _0x54bfee;});}})['then'](function(_0x33b264){if(_0x33b264){return _0x33b264['addAgents'](_0x1bcce7[_0xdda9('0x4c')]['ids'],_[_0xdda9('0x6f')](_0x1bcce7[_0xdda9('0x4c')],[_0xdda9('0x5f'),'id'])||{})[_0xdda9('0x70')](function(_0x28c4fe){for(var _0x4c16c2=0x0;_0x4c16c2<_0x1bcce7[_0xdda9('0x4c')][_0xdda9('0x5f')][_0xdda9('0x35')];_0x4c16c2+=0x1){socket[_0xdda9('0x71')](_0xdda9('0x72'),{'UserId':_0x1bcce7['body'][_0xdda9('0x5f')][_0x4c16c2],'TeamId':_0x1bcce7[_0xdda9('0x45')]['id']});}return _0x28c4fe;});}})[_0xdda9('0x25')](respondWithResult(_0x1b3181,null))[_0xdda9('0x4a')](handleError(_0x1b3181,null));};exports[_0xdda9('0x73')]=function(_0x4a2834,_0x3d4800,_0x1be3bc){return db[_0xdda9('0x2e')][_0xdda9('0x49')]({'where':{'id':_0x4a2834['params']['id']}})[_0xdda9('0x25')](handleEntityNotFound(_0x3d4800,null))[_0xdda9('0x25')](function(_0xa0cc0){if(_0xa0cc0){return BPromise[_0xdda9('0x65')]([_0xdda9('0x74'),_0xdda9('0x75'),_0xdda9('0x76'),'sms','fax','openchannel','whatsapp'],function(_0x24af25){return _0xa0cc0[_0xdda9('0x26')+_[_0xdda9('0x57')](_0x24af25)+'Queues']({'attributes':['id',_0xdda9('0x2a')]})['then'](function(_0x46252d){return BPromise['each'](_0x46252d,function(_0x119434){return _0x119434[_0xdda9('0x73')](_0x4a2834[_0xdda9('0x31')][_0xdda9('0x5f')])[_0xdda9('0x25')](function(){if(_0x24af25==='voice'){return db[_0xdda9('0x6a')][_0xdda9('0x24')]({'where':{'VoiceQueueId':_0x119434['id'],'UserId':_0x4a2834['query'][_0xdda9('0x5f')]}});}});});})[_0xdda9('0x25')](function(){return _0xa0cc0;});})[_0xdda9('0x25')](function(){return _0xa0cc0;});}})[_0xdda9('0x25')](function(_0x383656){if(_0x383656){return _0x383656[_0xdda9('0x73')](_0x4a2834[_0xdda9('0x31')][_0xdda9('0x5f')])[_0xdda9('0x25')](function(){if(_['isArray'](_0x4a2834[_0xdda9('0x31')][_0xdda9('0x5f')])){for(var _0x422904=0x0;_0x422904<_0x4a2834['query']['ids']['length'];_0x422904+=0x1){socket[_0xdda9('0x71')](_0xdda9('0x77'),{'UserId':Number(_0x4a2834[_0xdda9('0x31')][_0xdda9('0x5f')][_0x422904]),'TeamId':Number(_0x4a2834['params']['id'])});}}else{socket['emit'](_0xdda9('0x77'),{'UserId':Number(_0x4a2834[_0xdda9('0x31')][_0xdda9('0x5f')]),'TeamId':Number(_0x4a2834[_0xdda9('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x3d4800,null))[_0xdda9('0x4a')](handleError(_0x3d4800,null));};exports[_0xdda9('0x78')]=function(_0x1d73ac,_0x184583,_0x595b1e){var _0x214bcd={};var _0x23a7ee={};var _0x304e3a;var _0x1d54c5;return db['Team']['findOne']({'where':{'id':_0x1d73ac[_0xdda9('0x45')]['id']}})[_0xdda9('0x25')](handleEntityNotFound(_0x184583,null))[_0xdda9('0x25')](function(_0xd69329){if(_0xd69329){_0x304e3a=_0xd69329;_0x23a7ee[_0xdda9('0x30')]=_['keys'](db[_0xdda9('0x67')]['rawAttributes']);_0x23a7ee[_0xdda9('0x31')]=_[_0xdda9('0x32')](_0x1d73ac['query']);_0x23a7ee['filters']=_[_0xdda9('0x33')](_0x23a7ee[_0xdda9('0x30')],_0x23a7ee['query']);_0x214bcd['attributes']=_[_0xdda9('0x33')](_0x23a7ee[_0xdda9('0x30')],qs['fields'](_0x1d73ac[_0xdda9('0x31')][_0xdda9('0x47')]));_0x214bcd[_0xdda9('0x34')]=_0x214bcd['attributes']['length']?_0x214bcd['attributes']:_0x23a7ee['model'];_0x214bcd[_0xdda9('0x38')]=qs[_0xdda9('0x39')](_0x1d73ac[_0xdda9('0x31')][_0xdda9('0x39')]);_0x214bcd[_0xdda9('0x3a')]=qs[_0xdda9('0x3c')](_[_0xdda9('0x3b')](_0x1d73ac[_0xdda9('0x31')],_0x23a7ee['filters']));if(_0x1d73ac[_0xdda9('0x31')]['filter']){_0x214bcd[_0xdda9('0x3a')]=_['merge'](_0x214bcd['where'],{'$or':_[_0xdda9('0x2d')](_0x214bcd[_0xdda9('0x34')],function(_0x602285){var _0x31f305={};_0x31f305[_0x602285]={'$like':'%'+_0x1d73ac[_0xdda9('0x31')][_0xdda9('0x3d')]+'%'};return _0x31f305;})});}_0x214bcd=_[_0xdda9('0x3e')]({},_0x214bcd,_0x1d73ac['options']);return _0x304e3a[_0xdda9('0x78')](_0x214bcd);}})['then'](function(_0x557a13){if(_0x557a13){_0x1d54c5=_0x557a13['length'];if(!_0x1d73ac[_0xdda9('0x31')]['hasOwnProperty']('nolimit')){_0x214bcd[_0xdda9('0x20')]=qs[_0xdda9('0x20')](_0x1d73ac[_0xdda9('0x31')]['limit']);_0x214bcd[_0xdda9('0x1f')]=qs[_0xdda9('0x1f')](_0x1d73ac[_0xdda9('0x31')]['offset']);}return _0x304e3a[_0xdda9('0x78')](_0x214bcd);}})[_0xdda9('0x25')](function(_0x385d8a){if(_0x385d8a){return _0x385d8a?{'count':_0x1d54c5,'rows':_0x385d8a}:null;}})[_0xdda9('0x25')](respondWithResult(_0x184583,null))[_0xdda9('0x4a')](handleError(_0x184583,null));};
\ No newline at end of file
index b5ec966..165a605 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x297c=['events','setMaxListeners','remove','emit','hasOwnProperty','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x297c,0x14a));var _0xc297=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x297c[_0x102ff9];return _0x24fa97;};'use strict';var EventEmitter=require(_0xc297('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xc297('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc297('0x2')};function emitEvent(_0x5dfb1a){return function(_0x5e681a,_0x120c58,_0x220f19){TeamEvents[_0xc297('0x3')](_0x5dfb1a+':'+_0x5e681a['id'],_0x5e681a);TeamEvents[_0xc297('0x3')](_0x5dfb1a,_0x5e681a);_0x220f19(null);};}for(var e in events){if(events[_0xc297('0x4')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xc297('0x5')]=TeamEvents;
\ No newline at end of file
+var _0x87bf=['save','remove','emit','hook','exports','../../mysqldb','Team'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x87bf,0x194));var _0xf87b=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0x87bf[_0x44a64f];return _0x52024b;};'use strict';var EventEmitter=require('events');var Team=require(_0xf87b('0x0'))['db'][_0xf87b('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf87b('0x2'),'afterUpdate':'update','afterDestroy':_0xf87b('0x3')};function emitEvent(_0x15b01c){return function(_0x11411f,_0x48c7db,_0x15ca03){TeamEvents[_0xf87b('0x4')](_0x15b01c+':'+_0x11411f['id'],_0x11411f);TeamEvents[_0xf87b('0x4')](_0x15b01c,_0x11411f);_0x15ca03(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xf87b('0x5')](e,emitEvent(event));}}module[_0xf87b('0x6')]=TeamEvents;
\ No newline at end of file
index 200c32c..626d500 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x588f=['api','moment','bluebird','rimraf','exports','define','teams','lodash','../../config/logger'];(function(_0x9fb085,_0x2251a3){var _0x400c75=function(_0x1455ed){while(--_0x1455ed){_0x9fb085['push'](_0x9fb085['shift']());}};_0x400c75(++_0x2251a3);}(_0x588f,0x130));var _0xf588=function(_0x5a1fb0,_0x2364ea){_0x5a1fb0=_0x5a1fb0-0x0;var _0x3806ef=_0x588f[_0x5a1fb0];return _0x3806ef;};'use strict';var _=require(_0xf588('0x0'));var util=require('util');var logger=require(_0xf588('0x1'))(_0xf588('0x2'));var moment=require(_0xf588('0x3'));var BPromise=require(_0xf588('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf588('0x5'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0xf588('0x6')]=function(_0x4e5408,_0x1eb8c3){return _0x4e5408[_0xf588('0x7')]('Team',attributes,{'tableName':_0xf588('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x23cf=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','exports','define','Team','teams'];(function(_0x5e2118,_0x2d6c5e){var _0x10dee5=function(_0x255d11){while(--_0x255d11){_0x5e2118['push'](_0x5e2118['shift']());}};_0x10dee5(++_0x2d6c5e);}(_0x23cf,0xf2));var _0xf23c=function(_0x182acf,_0x727cda){_0x182acf=_0x182acf-0x0;var _0x278535=_0x23cf[_0x182acf];return _0x278535;};'use strict';var _=require(_0xf23c('0x0'));var util=require(_0xf23c('0x1'));var logger=require(_0xf23c('0x2'))('api');var moment=require(_0xf23c('0x3'));var BPromise=require(_0xf23c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf23c('0x5'));var rimraf=require(_0xf23c('0x6'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0xf23c('0x7')]=function(_0x5e58c6,_0x33864c){return _0x5e58c6[_0xf23c('0x8')](_0xf23c('0x9'),attributes,{'tableName':_0xf23c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 15f7629..22140f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4149=['debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s'];(function(_0x5b7971,_0x44d12f){var _0x5e10fa=function(_0x4f8e14){while(--_0x4f8e14){_0x5b7971['push'](_0x5b7971['shift']());}};_0x5e10fa(++_0x44d12f);}(_0x4149,0x117));var _0x9414=function(_0x53e06a,_0x26c264){_0x53e06a=_0x53e06a-0x0;var _0x4a84d5=_0x4149[_0x53e06a];return _0x4a84d5;};'use strict';var _=require('lodash');var util=require(_0x9414('0x0'));var moment=require(_0x9414('0x1'));var BPromise=require(_0x9414('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9414('0x3'));var db=require(_0x9414('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9414('0x5'))(_0x9414('0x6'));var config=require(_0x9414('0x7'));var jayson=require(_0x9414('0x8'));var client=jayson['client'][_0x9414('0x9')]({'port':0x232a});config[_0x9414('0xa')]=_['defaults'](config['redis'],{'host':_0x9414('0xb'),'port':0x18eb});var socket=require(_0x9414('0xc'))(new Redis(config[_0x9414('0xa')]));require(_0x9414('0xd'))[_0x9414('0xe')](socket);function respondWithRpcPromise(_0x3f1411,_0x415d95,_0x34f5b3){return new BPromise(function(_0x5ef7c7,_0x1222bc){return client['request'](_0x3f1411,_0x34f5b3)[_0x9414('0xf')](function(_0x2de504){logger[_0x9414('0x10')](_0x9414('0x11'),_0x415d95,'request\x20sent');logger[_0x9414('0x12')](_0x9414('0x13'),_0x415d95,_0x9414('0x14'),JSON[_0x9414('0x15')](_0x2de504));if(_0x2de504['error']){if(_0x2de504[_0x9414('0x16')][_0x9414('0x17')]===0x1f4){logger[_0x9414('0x16')](_0x9414('0x11'),_0x415d95,_0x2de504['error']['message']);return _0x1222bc(_0x2de504[_0x9414('0x16')][_0x9414('0x18')]);}logger[_0x9414('0x16')](_0x9414('0x11'),_0x415d95,_0x2de504[_0x9414('0x16')][_0x9414('0x18')]);return _0x5ef7c7(_0x2de504[_0x9414('0x16')]['message']);}else{logger[_0x9414('0x10')]('Team,\x20%s,\x20%s',_0x415d95,'request\x20sent');_0x5ef7c7(_0x2de504[_0x9414('0x19')][_0x9414('0x18')]);}})[_0x9414('0x1a')](function(_0x1bb6a5){logger[_0x9414('0x16')]('Team,\x20%s,\x20%s',_0x415d95,_0x1bb6a5);_0x1222bc(_0x1bb6a5);});});}
\ No newline at end of file
+var _0x0704=['redis','localhost','socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','../../config/logger','rpc','../../config/environment','jayson/promise','defaults'];(function(_0x1add6e,_0x2f858d){var _0x48258b=function(_0x425cac){while(--_0x425cac){_0x1add6e['push'](_0x1add6e['shift']());}};_0x48258b(++_0x2f858d);}(_0x0704,0x152));var _0x4070=function(_0x101751,_0x295b14){_0x101751=_0x101751-0x0;var _0x22d38b=_0x0704[_0x101751];return _0x22d38b;};'use strict';var _=require(_0x4070('0x0'));var util=require('util');var moment=require(_0x4070('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4070('0x2'))(_0x4070('0x3'));var config=require(_0x4070('0x4'));var jayson=require(_0x4070('0x5'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x4070('0x6')](config[_0x4070('0x7')],{'host':_0x4070('0x8'),'port':0x18eb});var socket=require(_0x4070('0x9'))(new Redis(config['redis']));require(_0x4070('0xa'))[_0x4070('0xb')](socket);function respondWithRpcPromise(_0x28d4b5,_0x2eb665,_0x244d7f){return new BPromise(function(_0x59ed20,_0x3bc5b7){return client['request'](_0x28d4b5,_0x244d7f)[_0x4070('0xc')](function(_0x583eca){logger[_0x4070('0xd')](_0x4070('0xe'),_0x2eb665,'request\x20sent');logger[_0x4070('0xf')](_0x4070('0x10'),_0x2eb665,_0x4070('0x11'),JSON[_0x4070('0x12')](_0x583eca));if(_0x583eca[_0x4070('0x13')]){if(_0x583eca[_0x4070('0x13')][_0x4070('0x14')]===0x1f4){logger['error'](_0x4070('0xe'),_0x2eb665,_0x583eca[_0x4070('0x13')][_0x4070('0x15')]);return _0x3bc5b7(_0x583eca[_0x4070('0x13')]['message']);}logger['error']('Team,\x20%s,\x20%s',_0x2eb665,_0x583eca[_0x4070('0x13')]['message']);return _0x59ed20(_0x583eca['error']['message']);}else{logger[_0x4070('0xd')](_0x4070('0xe'),_0x2eb665,_0x4070('0x11'));_0x59ed20(_0x583eca[_0x4070('0x16')][_0x4070('0x15')]);}})['catch'](function(_0x475bdb){logger['error'](_0x4070('0xe'),_0x2eb665,_0x475bdb);_0x3bc5b7(_0x475bdb);});});}
\ No newline at end of file
index 3a78c07..0eee5dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x202a=['removeListener','team:','save','remove','update'];(function(_0x25a536,_0x451301){var _0x53a449=function(_0x2e551d){while(--_0x2e551d){_0x25a536['push'](_0x25a536['shift']());}};_0x53a449(++_0x451301);}(_0x202a,0xc0));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var TeamEvents=require('./team.events');var events=[_0xa202('0x0'),_0xa202('0x1'),_0xa202('0x2')];function createListener(_0x47ca75,_0x3739bd){return function(_0x5a7f7d){_0x3739bd['emit'](_0x47ca75,_0x5a7f7d);};}function removeListener(_0x595945,_0x32f8b7){return function(){TeamEvents[_0xa202('0x3')](_0x595945,_0x32f8b7);};}exports['register']=function(_0x49e186){for(var _0x8e05f0=0x0,_0x4cb469=events['length'];_0x8e05f0<_0x4cb469;_0x8e05f0++){var _0x4d8dcc=events[_0x8e05f0];var _0x216b4c=createListener(_0xa202('0x4')+_0x4d8dcc,_0x49e186);TeamEvents['on'](_0x4d8dcc,_0x216b4c);}};
\ No newline at end of file
+var _0x7a3e=['remove','removeListener','length','team:','./team.events','save'];(function(_0x1428a1,_0x467550){var _0x5e21d7=function(_0x25d3c6){while(--_0x25d3c6){_0x1428a1['push'](_0x1428a1['shift']());}};_0x5e21d7(++_0x467550);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x4a3705,_0x3ad460){_0x4a3705=_0x4a3705-0x0;var _0x16c23b=_0x7a3e[_0x4a3705];return _0x16c23b;};'use strict';var TeamEvents=require(_0xe7a3('0x0'));var events=[_0xe7a3('0x1'),_0xe7a3('0x2'),'update'];function createListener(_0xd95a19,_0x37f29c){return function(_0x49157a){_0x37f29c['emit'](_0xd95a19,_0x49157a);};}function removeListener(_0x9d97ac,_0x4053f3){return function(){TeamEvents[_0xe7a3('0x3')](_0x9d97ac,_0x4053f3);};}exports['register']=function(_0x401117){for(var _0x45b019=0x0,_0x46ecf7=events[_0xe7a3('0x4')];_0x45b019<_0x46ecf7;_0x45b019++){var _0x1a7627=events[_0x45b019];var _0x5524ad=createListener(_0xe7a3('0x5')+_0x1a7627,_0x401117);TeamEvents['on'](_0x1a7627,_0x5524ad);}};
\ No newline at end of file
index 2bdff98..962902a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b0d=['/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','show','post','put'];(function(_0x11ae49,_0x59de01){var _0x31be93=function(_0x42f145){while(--_0x42f145){_0x11ae49['push'](_0x11ae49['shift']());}};_0x31be93(++_0x59de01);}(_0x1b0d,0x1e0));var _0xd1b0=function(_0x4fd940,_0x40969f){_0x4fd940=_0x4fd940-0x0;var _0x23e599=_0x1b0d[_0x4fd940];return _0x23e599;};'use strict';var multer=require(_0xd1b0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd1b0('0x1'));var express=require(_0xd1b0('0x2'));var router=express[_0xd1b0('0x3')]();var auth=require(_0xd1b0('0x4'));var interaction=require(_0xd1b0('0x5'));var config=require(_0xd1b0('0x6'));var controller=require(_0xd1b0('0x7'));router[_0xd1b0('0x8')]('/',auth[_0xd1b0('0x9')](),controller[_0xd1b0('0xa')]);router[_0xd1b0('0x8')]('/:id',auth[_0xd1b0('0x9')](),controller[_0xd1b0('0xb')]);router[_0xd1b0('0xc')]('/',auth[_0xd1b0('0x9')](),controller['create']);router[_0xd1b0('0xd')](_0xd1b0('0xe'),auth[_0xd1b0('0x9')](),controller[_0xd1b0('0xf')]);router[_0xd1b0('0x10')](_0xd1b0('0xe'),auth[_0xd1b0('0x9')](),controller[_0xd1b0('0x11')]);module[_0xd1b0('0x12')]=router;
\ No newline at end of file
+var _0x0580=['get','/:id','show','post','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index'];(function(_0x3c7f2a,_0x1ace46){var _0x1e8fdf=function(_0x1a2bf5){while(--_0x1a2bf5){_0x3c7f2a['push'](_0x3c7f2a['shift']());}};_0x1e8fdf(++_0x1ace46);}(_0x0580,0x1cf));var _0x0058=function(_0x201b9b,_0x558203){_0x201b9b=_0x201b9b-0x0;var _0x5f3730=_0x0580[_0x201b9b];return _0x5f3730;};'use strict';var multer=require(_0x0058('0x0'));var util=require(_0x0058('0x1'));var path=require(_0x0058('0x2'));var timeout=require(_0x0058('0x3'));var express=require(_0x0058('0x4'));var router=express[_0x0058('0x5')]();var auth=require(_0x0058('0x6'));var interaction=require(_0x0058('0x7'));var config=require(_0x0058('0x8'));var controller=require(_0x0058('0x9'));router['get']('/',auth[_0x0058('0xa')](),controller[_0x0058('0xb')]);router[_0x0058('0xc')](_0x0058('0xd'),auth[_0x0058('0xa')](),controller[_0x0058('0xe')]);router[_0x0058('0xf')]('/',auth[_0x0058('0xa')](),controller['create']);router['put'](_0x0058('0xd'),auth[_0x0058('0xa')](),controller[_0x0058('0x10')]);router[_0x0058('0x11')]('/:id',auth[_0x0058('0xa')](),controller[_0x0058('0x12')]);module['exports']=router;
\ No newline at end of file
index 32311f4..b0a66a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf695=['TEXT','sequelize','STRING'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf695,0x103));var _0x5f69=function(_0x265340,_0x1281a9){_0x265340=_0x265340-0x0;var _0x451049=_0xf695[_0x265340];return _0x451049;};'use strict';var Sequelize=require(_0x5f69('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5f69('0x1')]},'html':{'type':Sequelize[_0x5f69('0x2')]}};
\ No newline at end of file
+var _0xc55f=['STRING','TEXT','sequelize','exports'];(function(_0x44a2f1,_0x40c54a){var _0x34d15b=function(_0x3fe0f8){while(--_0x3fe0f8){_0x44a2f1['push'](_0x44a2f1['shift']());}};_0x34d15b(++_0x40c54a);}(_0xc55f,0x8a));var _0xfc55=function(_0x277af0,_0x1af851){_0x277af0=_0x277af0-0x0;var _0x15a5a7=_0xc55f[_0x277af0];return _0x15a5a7;};'use strict';var Sequelize=require(_0xfc55('0x0'));module[_0xfc55('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfc55('0x2')]},'html':{'type':Sequelize[_0xfc55('0x3')]}};
\ No newline at end of file
index 08981a0..71b95c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca20=['fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','where','merge','type','VIRTUAL','options','include','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','limit','set','Content-Range','apply','save','update','then','Templates','UserProfileResource','destroy','name','send','index','map','Template','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xca20,0x72));var _0x0ca2=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0xca20[_0x28f1de];return _0x5b5dad;};'use strict';var pdf=require(_0x0ca2('0x0'));var emlformat=require(_0x0ca2('0x1'));var rimraf=require(_0x0ca2('0x2'));var zipdir=require(_0x0ca2('0x3'));var jsonpatch=require(_0x0ca2('0x4'));var rp=require(_0x0ca2('0x5'));var moment=require(_0x0ca2('0x6'));var BPromise=require(_0x0ca2('0x7'));var Mustache=require(_0x0ca2('0x8'));var util=require(_0x0ca2('0x9'));var path=require(_0x0ca2('0xa'));var sox=require('sox');var csv=require(_0x0ca2('0xb'));var ejs=require(_0x0ca2('0xc'));var fs=require('fs');var _=require(_0x0ca2('0xd'));var squel=require(_0x0ca2('0xe'));var crypto=require(_0x0ca2('0xf'));var jsforce=require(_0x0ca2('0x10'));var deskjs=require(_0x0ca2('0x11'));var toCsv=require(_0x0ca2('0xb'));var querystring=require('querystring');var Papa=require(_0x0ca2('0x12'));var Redis=require(_0x0ca2('0x13'));var authService=require(_0x0ca2('0x14'));var qs=require(_0x0ca2('0x15'));var as=require(_0x0ca2('0x16'));var hardwareService=require(_0x0ca2('0x17'));var logger=require(_0x0ca2('0x18'))(_0x0ca2('0x19'));var utils=require(_0x0ca2('0x1a'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a7c54,_0x381e5f){_0x381e5f=_0x381e5f||0xcc;return function(_0x5ee70b){if(_0x5ee70b){return _0x4a7c54[_0x0ca2('0x1b')](_0x381e5f);}return _0x4a7c54[_0x0ca2('0x1c')](_0x381e5f)[_0x0ca2('0x1d')]();};}function respondWithResult(_0x438eaf,_0x5f105b){_0x5f105b=_0x5f105b||0xc8;return function(_0x3102a0){if(_0x3102a0){return _0x438eaf[_0x0ca2('0x1c')](_0x5f105b)[_0x0ca2('0x1e')](_0x3102a0);}};}function respondWithFilteredResult(_0x3c9d83,_0x573f32){return function(_0x4f567d){if(_0x4f567d){var _0x9433aa=_0x4f567d[_0x0ca2('0x1f')],_0x22f771=_0x573f32['offset'],_0x3146fc=_0x573f32['offset']+_0x573f32[_0x0ca2('0x20')],_0x482c3c;if(_0x3146fc>=_0x9433aa){_0x3146fc=_0x9433aa;_0x482c3c=0xc8;}else{_0x482c3c=0xce;}_0x3c9d83[_0x0ca2('0x1c')](_0x482c3c);return _0x3c9d83[_0x0ca2('0x21')](_0x0ca2('0x22'),_0x22f771+'-'+_0x3146fc+'/'+_0x9433aa)[_0x0ca2('0x1e')](_0x4f567d);}return null;};}function patchUpdates(_0x1c4f63){return function(_0x1c4f4c){try{jsonpatch[_0x0ca2('0x23')](_0x1c4f4c,_0x1c4f63,!![]);}catch(_0x1a6805){return BPromise['reject'](_0x1a6805);}return _0x1c4f4c[_0x0ca2('0x24')]();};}function saveUpdates(_0x17d5cf,_0xf25c86){return function(_0x54b956){if(_0x54b956){return _0x54b956[_0x0ca2('0x25')](_0x17d5cf)[_0x0ca2('0x26')](function(_0x54e731){return _0x54e731;});}return null;};}function removeEntity(_0x446e33,_0x310892){return function(_0x554391){if(_0x554391){return _0x554391['destroy']()[_0x0ca2('0x26')](function(){var _0x1e7723=_0x554391['get']({'plain':!![]});var _0x65980e=_0x0ca2('0x27');return db[_0x0ca2('0x28')][_0x0ca2('0x29')]({'where':{'type':_0x65980e,'resourceId':_0x1e7723['id']}})[_0x0ca2('0x26')](function(){return _0x554391;});})['then'](function(){_0x446e33[_0x0ca2('0x1c')](0xcc)[_0x0ca2('0x1d')]();});}};}function handleEntityNotFound(_0x5f1c8b,_0x2916e8){return function(_0x2a937f){if(!_0x2a937f){_0x5f1c8b[_0x0ca2('0x1b')](0x194);}return _0x2a937f;};}function handleError(_0x3b94f3,_0x35a0a5){_0x35a0a5=_0x35a0a5||0x1f4;return function(_0x31ec17){logger['error'](_0x31ec17['stack']);if(_0x31ec17[_0x0ca2('0x2a')]){delete _0x31ec17[_0x0ca2('0x2a')];}_0x3b94f3[_0x0ca2('0x1c')](_0x35a0a5)[_0x0ca2('0x2b')](_0x31ec17);};}exports[_0x0ca2('0x2c')]=function(_0x4d857b,_0x3a06cd){var _0xdb0402={},_0x1da6da={},_0x354587={'count':0x0,'rows':[]};var _0xf98f62=_[_0x0ca2('0x2d')](db[_0x0ca2('0x2e')][_0x0ca2('0x2f')],function(_0x5569c4){return{'name':_0x5569c4[_0x0ca2('0x30')],'type':_0x5569c4['type'][_0x0ca2('0x31')]};});_0x1da6da[_0x0ca2('0x32')]=_['map'](_0xf98f62,_0x0ca2('0x2a'));_0x1da6da[_0x0ca2('0x33')]=_[_0x0ca2('0x34')](_0x4d857b[_0x0ca2('0x33')]);_0x1da6da[_0x0ca2('0x35')]=_['intersection'](_0x1da6da['model'],_0x1da6da['query']);_0xdb0402[_0x0ca2('0x36')]=_[_0x0ca2('0x37')](_0x1da6da[_0x0ca2('0x32')],qs[_0x0ca2('0x38')](_0x4d857b[_0x0ca2('0x33')]['fields']));_0xdb0402['attributes']=_0xdb0402[_0x0ca2('0x36')][_0x0ca2('0x39')]?_0xdb0402[_0x0ca2('0x36')]:_0x1da6da[_0x0ca2('0x32')];if(!_0x4d857b[_0x0ca2('0x33')][_0x0ca2('0x3a')](_0x0ca2('0x3b'))){_0xdb0402['limit']=qs[_0x0ca2('0x20')](_0x4d857b[_0x0ca2('0x33')][_0x0ca2('0x20')]);_0xdb0402[_0x0ca2('0x3c')]=qs[_0x0ca2('0x3c')](_0x4d857b['query']['offset']);}_0xdb0402[_0x0ca2('0x3d')]=qs[_0x0ca2('0x3e')](_0x4d857b[_0x0ca2('0x33')]['sort']);_0xdb0402['where']=qs['filters'](_[_0x0ca2('0x3f')](_0x4d857b[_0x0ca2('0x33')],_0x1da6da[_0x0ca2('0x35')]),_0xf98f62);if(_0x4d857b[_0x0ca2('0x33')]['filter']){_0xdb0402[_0x0ca2('0x40')]=_[_0x0ca2('0x41')](_0xdb0402[_0x0ca2('0x40')],{'$or':_[_0x0ca2('0x2d')](_0xf98f62,function(_0x410e1b){if(_0x410e1b[_0x0ca2('0x42')]!==_0x0ca2('0x43')){var _0x5093e2={};_0x5093e2[_0x410e1b[_0x0ca2('0x2a')]]={'$like':'%'+_0x4d857b['query']['filter']+'%'};return _0x5093e2;}})});}_0xdb0402=_[_0x0ca2('0x41')]({},_0xdb0402,_0x4d857b[_0x0ca2('0x44')]);var _0x5783f7={'where':_0xdb0402[_0x0ca2('0x40')]};return db[_0x0ca2('0x2e')][_0x0ca2('0x1f')](_0x5783f7)[_0x0ca2('0x26')](function(_0x509991){_0x354587[_0x0ca2('0x1f')]=_0x509991;if(_0x4d857b[_0x0ca2('0x33')]['includeAll']){_0xdb0402[_0x0ca2('0x45')]=[{'all':!![]}];}return db[_0x0ca2('0x2e')]['findAll'](_0xdb0402);})[_0x0ca2('0x26')](function(_0x1cff69){_0x354587[_0x0ca2('0x46')]=_0x1cff69;return _0x354587;})['then'](respondWithFilteredResult(_0x3a06cd,_0xdb0402))[_0x0ca2('0x47')](handleError(_0x3a06cd,null));};exports[_0x0ca2('0x48')]=function(_0x11912a,_0x5a61fd){var _0x18944d={'raw':!![],'where':{'id':_0x11912a[_0x0ca2('0x49')]['id']}},_0x2e1c36={};_0x2e1c36[_0x0ca2('0x32')]=_['keys'](db[_0x0ca2('0x2e')][_0x0ca2('0x2f')]);_0x2e1c36[_0x0ca2('0x33')]=_[_0x0ca2('0x34')](_0x11912a['query']);_0x2e1c36[_0x0ca2('0x35')]=_['intersection'](_0x2e1c36[_0x0ca2('0x32')],_0x2e1c36[_0x0ca2('0x33')]);_0x18944d[_0x0ca2('0x36')]=_[_0x0ca2('0x37')](_0x2e1c36[_0x0ca2('0x32')],qs[_0x0ca2('0x38')](_0x11912a['query'][_0x0ca2('0x38')]));_0x18944d[_0x0ca2('0x36')]=_0x18944d[_0x0ca2('0x36')][_0x0ca2('0x39')]?_0x18944d[_0x0ca2('0x36')]:_0x2e1c36[_0x0ca2('0x32')];if(_0x11912a['query']['includeAll']){_0x18944d[_0x0ca2('0x45')]=[{'all':!![]}];}_0x18944d=_[_0x0ca2('0x41')]({},_0x18944d,_0x11912a['options']);return db[_0x0ca2('0x2e')][_0x0ca2('0x4a')](_0x18944d)[_0x0ca2('0x26')](handleEntityNotFound(_0x5a61fd,null))[_0x0ca2('0x26')](respondWithResult(_0x5a61fd,null))['catch'](handleError(_0x5a61fd,null));};exports['create']=function(_0xce8f68,_0x47ad39){return db['Template'][_0x0ca2('0x4b')](_0xce8f68[_0x0ca2('0x4c')],{})[_0x0ca2('0x26')](function(_0x24fb54){var _0x13e6d4=_0xce8f68[_0x0ca2('0x4d')][_0x0ca2('0x4e')]({'plain':!![]});if(!_0x13e6d4)throw new Error(_0x0ca2('0x4f'));if(_0x13e6d4[_0x0ca2('0x50')]===_0x0ca2('0x4d')){var _0x3ecbff=_0x24fb54[_0x0ca2('0x4e')]({'plain':!![]});var _0x1d44b4=_0x0ca2('0x27');return db[_0x0ca2('0x51')]['find']({'where':{'name':_0x1d44b4,'userProfileId':_0x13e6d4[_0x0ca2('0x52')]},'raw':!![]})['then'](function(_0x438080){if(_0x438080&&_0x438080[_0x0ca2('0x53')]===0x0){return db['UserProfileResource'][_0x0ca2('0x4b')]({'name':_0x3ecbff['name'],'resourceId':_0x3ecbff['id'],'type':_0x438080[_0x0ca2('0x2a')],'sectionId':_0x438080['id']},{})[_0x0ca2('0x26')](function(){return _0x24fb54;});}else{return _0x24fb54;}})[_0x0ca2('0x47')](function(_0x27f9f5){logger['error'](_0x0ca2('0x54'),_0x27f9f5);throw _0x27f9f5;});}return _0x24fb54;})[_0x0ca2('0x26')](respondWithResult(_0x47ad39,0xc9))[_0x0ca2('0x47')](handleError(_0x47ad39,null));};exports[_0x0ca2('0x25')]=function(_0x1c85aa,_0x4b340b){if(_0x1c85aa[_0x0ca2('0x4c')]['id']){delete _0x1c85aa['body']['id'];}return db[_0x0ca2('0x2e')][_0x0ca2('0x4a')]({'where':{'id':_0x1c85aa[_0x0ca2('0x49')]['id']}})[_0x0ca2('0x26')](handleEntityNotFound(_0x4b340b,null))[_0x0ca2('0x26')](saveUpdates(_0x1c85aa[_0x0ca2('0x4c')],null))[_0x0ca2('0x26')](respondWithResult(_0x4b340b,null))[_0x0ca2('0x47')](handleError(_0x4b340b,null));};exports['destroy']=function(_0x197b6d,_0x2ffa8c){return db[_0x0ca2('0x2e')][_0x0ca2('0x4a')]({'where':{'id':_0x197b6d[_0x0ca2('0x49')]['id']}})[_0x0ca2('0x26')](handleEntityNotFound(_0x2ffa8c,null))['then'](removeEntity(_0x2ffa8c,null))['catch'](handleError(_0x2ffa8c,null));};
\ No newline at end of file
+var _0x5345=['nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','show','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty'];(function(_0x51c440,_0x3b6802){var _0x67a2d6=function(_0x3d15ab){while(--_0x3d15ab){_0x51c440['push'](_0x51c440['shift']());}};_0x67a2d6(++_0x3b6802);}(_0x5345,0x1b3));var _0x5534=function(_0x565801,_0x11c9d8){_0x565801=_0x565801-0x0;var _0x48e721=_0x5345[_0x565801];return _0x48e721;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5534('0x0'));var rimraf=require(_0x5534('0x1'));var zipdir=require(_0x5534('0x2'));var jsonpatch=require(_0x5534('0x3'));var rp=require(_0x5534('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5534('0x5'));var path=require(_0x5534('0x6'));var sox=require(_0x5534('0x7'));var csv=require(_0x5534('0x8'));var ejs=require(_0x5534('0x9'));var fs=require('fs');var _=require(_0x5534('0xa'));var squel=require(_0x5534('0xb'));var crypto=require('crypto');var jsforce=require(_0x5534('0xc'));var deskjs=require(_0x5534('0xd'));var toCsv=require(_0x5534('0x8'));var querystring=require(_0x5534('0xe'));var Papa=require(_0x5534('0xf'));var Redis=require(_0x5534('0x10'));var authService=require(_0x5534('0x11'));var qs=require(_0x5534('0x12'));var as=require(_0x5534('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5534('0x14'));var utils=require(_0x5534('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1926f0,_0x3d4bec){_0x3d4bec=_0x3d4bec||0xcc;return function(_0x521657){if(_0x521657){return _0x1926f0[_0x5534('0x16')](_0x3d4bec);}return _0x1926f0[_0x5534('0x17')](_0x3d4bec)[_0x5534('0x18')]();};}function respondWithResult(_0x3b4e29,_0x5bcc7){_0x5bcc7=_0x5bcc7||0xc8;return function(_0x6e34dd){if(_0x6e34dd){return _0x3b4e29[_0x5534('0x17')](_0x5bcc7)[_0x5534('0x19')](_0x6e34dd);}};}function respondWithFilteredResult(_0x348421,_0x24d63b){return function(_0x54b768){if(_0x54b768){var _0x2e5258=_0x54b768[_0x5534('0x1a')],_0x34e7d5=_0x24d63b[_0x5534('0x1b')],_0x2a6ffe=_0x24d63b[_0x5534('0x1b')]+_0x24d63b[_0x5534('0x1c')],_0xbb8e9f;if(_0x2a6ffe>=_0x2e5258){_0x2a6ffe=_0x2e5258;_0xbb8e9f=0xc8;}else{_0xbb8e9f=0xce;}_0x348421[_0x5534('0x17')](_0xbb8e9f);return _0x348421[_0x5534('0x1d')](_0x5534('0x1e'),_0x34e7d5+'-'+_0x2a6ffe+'/'+_0x2e5258)[_0x5534('0x19')](_0x54b768);}return null;};}function patchUpdates(_0x13b6d1){return function(_0xb572f){try{jsonpatch[_0x5534('0x1f')](_0xb572f,_0x13b6d1,!![]);}catch(_0x5a7138){return BPromise[_0x5534('0x20')](_0x5a7138);}return _0xb572f[_0x5534('0x21')]();};}function saveUpdates(_0x4e29df,_0x1b712e){return function(_0x341157){if(_0x341157){return _0x341157[_0x5534('0x22')](_0x4e29df)[_0x5534('0x23')](function(_0x3201b8){return _0x3201b8;});}return null;};}function removeEntity(_0x1f7899,_0x1ec0bb){return function(_0x4d1826){if(_0x4d1826){return _0x4d1826[_0x5534('0x24')]()[_0x5534('0x23')](function(){var _0x10e8b4=_0x4d1826[_0x5534('0x25')]({'plain':!![]});var _0x11bb2d=_0x5534('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x11bb2d,'resourceId':_0x10e8b4['id']}})['then'](function(){return _0x4d1826;});})[_0x5534('0x23')](function(){_0x1f7899['status'](0xcc)[_0x5534('0x18')]();});}};}function handleEntityNotFound(_0x381251,_0x21e36e){return function(_0x4bd972){if(!_0x4bd972){_0x381251[_0x5534('0x16')](0x194);}return _0x4bd972;};}function handleError(_0x496b1b,_0x52a28a){_0x52a28a=_0x52a28a||0x1f4;return function(_0xf13074){logger['error'](_0xf13074[_0x5534('0x27')]);if(_0xf13074['name']){delete _0xf13074[_0x5534('0x28')];}_0x496b1b['status'](_0x52a28a)[_0x5534('0x29')](_0xf13074);};}exports[_0x5534('0x2a')]=function(_0x2aedba,_0x4a597a){var _0x4c7738={},_0x4a2c6b={},_0x42a1c5={'count':0x0,'rows':[]};var _0x106e4b=_[_0x5534('0x2b')](db[_0x5534('0x2c')][_0x5534('0x2d')],function(_0x2494be){return{'name':_0x2494be[_0x5534('0x2e')],'type':_0x2494be[_0x5534('0x2f')][_0x5534('0x30')]};});_0x4a2c6b[_0x5534('0x31')]=_[_0x5534('0x2b')](_0x106e4b,_0x5534('0x28'));_0x4a2c6b['query']=_[_0x5534('0x32')](_0x2aedba['query']);_0x4a2c6b[_0x5534('0x33')]=_[_0x5534('0x34')](_0x4a2c6b['model'],_0x4a2c6b[_0x5534('0x35')]);_0x4c7738[_0x5534('0x36')]=_[_0x5534('0x34')](_0x4a2c6b['model'],qs['fields'](_0x2aedba['query'][_0x5534('0x37')]));_0x4c7738[_0x5534('0x36')]=_0x4c7738[_0x5534('0x36')]['length']?_0x4c7738[_0x5534('0x36')]:_0x4a2c6b['model'];if(!_0x2aedba[_0x5534('0x35')][_0x5534('0x38')](_0x5534('0x39'))){_0x4c7738[_0x5534('0x1c')]=qs[_0x5534('0x1c')](_0x2aedba['query'][_0x5534('0x1c')]);_0x4c7738[_0x5534('0x1b')]=qs[_0x5534('0x1b')](_0x2aedba[_0x5534('0x35')][_0x5534('0x1b')]);}_0x4c7738[_0x5534('0x3a')]=qs[_0x5534('0x3b')](_0x2aedba[_0x5534('0x35')][_0x5534('0x3b')]);_0x4c7738['where']=qs[_0x5534('0x33')](_[_0x5534('0x3c')](_0x2aedba[_0x5534('0x35')],_0x4a2c6b[_0x5534('0x33')]),_0x106e4b);if(_0x2aedba['query'][_0x5534('0x3d')]){_0x4c7738[_0x5534('0x3e')]=_[_0x5534('0x3f')](_0x4c7738[_0x5534('0x3e')],{'$or':_['map'](_0x106e4b,function(_0x56cfbe){if(_0x56cfbe[_0x5534('0x2f')]!=='VIRTUAL'){var _0x464443={};_0x464443[_0x56cfbe['name']]={'$like':'%'+_0x2aedba[_0x5534('0x35')][_0x5534('0x3d')]+'%'};return _0x464443;}})});}_0x4c7738=_[_0x5534('0x3f')]({},_0x4c7738,_0x2aedba[_0x5534('0x40')]);var _0xdb1214={'where':_0x4c7738[_0x5534('0x3e')]};return db['Template'][_0x5534('0x1a')](_0xdb1214)[_0x5534('0x23')](function(_0x4b0a75){_0x42a1c5[_0x5534('0x1a')]=_0x4b0a75;if(_0x2aedba[_0x5534('0x35')][_0x5534('0x41')]){_0x4c7738[_0x5534('0x42')]=[{'all':!![]}];}return db['Template'][_0x5534('0x43')](_0x4c7738);})[_0x5534('0x23')](function(_0x41ab87){_0x42a1c5['rows']=_0x41ab87;return _0x42a1c5;})[_0x5534('0x23')](respondWithFilteredResult(_0x4a597a,_0x4c7738))['catch'](handleError(_0x4a597a,null));};exports[_0x5534('0x44')]=function(_0x10f65d,_0x7a0057){var _0x1bf8ad={'raw':!![],'where':{'id':_0x10f65d['params']['id']}},_0x588460={};_0x588460['model']=_[_0x5534('0x32')](db[_0x5534('0x2c')][_0x5534('0x2d')]);_0x588460[_0x5534('0x35')]=_[_0x5534('0x32')](_0x10f65d[_0x5534('0x35')]);_0x588460[_0x5534('0x33')]=_['intersection'](_0x588460[_0x5534('0x31')],_0x588460[_0x5534('0x35')]);_0x1bf8ad[_0x5534('0x36')]=_['intersection'](_0x588460[_0x5534('0x31')],qs[_0x5534('0x37')](_0x10f65d['query'][_0x5534('0x37')]));_0x1bf8ad[_0x5534('0x36')]=_0x1bf8ad[_0x5534('0x36')][_0x5534('0x45')]?_0x1bf8ad['attributes']:_0x588460['model'];if(_0x10f65d[_0x5534('0x35')]['includeAll']){_0x1bf8ad[_0x5534('0x42')]=[{'all':!![]}];}_0x1bf8ad=_[_0x5534('0x3f')]({},_0x1bf8ad,_0x10f65d[_0x5534('0x40')]);return db[_0x5534('0x2c')][_0x5534('0x46')](_0x1bf8ad)[_0x5534('0x23')](handleEntityNotFound(_0x7a0057,null))['then'](respondWithResult(_0x7a0057,null))[_0x5534('0x47')](handleError(_0x7a0057,null));};exports[_0x5534('0x48')]=function(_0x5272fe,_0xa22009){return db[_0x5534('0x2c')][_0x5534('0x48')](_0x5272fe[_0x5534('0x49')],{})[_0x5534('0x23')](function(_0x46415c){var _0x3f6202=_0x5272fe[_0x5534('0x4a')]['get']({'plain':!![]});if(!_0x3f6202)throw new Error(_0x5534('0x4b'));if(_0x3f6202[_0x5534('0x4c')]===_0x5534('0x4a')){var _0x1ee53d=_0x46415c[_0x5534('0x25')]({'plain':!![]});var _0x919f5=_0x5534('0x26');return db['UserProfileSection'][_0x5534('0x46')]({'where':{'name':_0x919f5,'userProfileId':_0x3f6202[_0x5534('0x4d')]},'raw':!![]})['then'](function(_0x5b8e0f){if(_0x5b8e0f&&_0x5b8e0f[_0x5534('0x4e')]===0x0){return db[_0x5534('0x4f')][_0x5534('0x48')]({'name':_0x1ee53d[_0x5534('0x28')],'resourceId':_0x1ee53d['id'],'type':_0x5b8e0f['name'],'sectionId':_0x5b8e0f['id']},{})['then'](function(){return _0x46415c;});}else{return _0x46415c;}})[_0x5534('0x47')](function(_0x242035){logger[_0x5534('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x242035);throw _0x242035;});}return _0x46415c;})[_0x5534('0x23')](respondWithResult(_0xa22009,0xc9))[_0x5534('0x47')](handleError(_0xa22009,null));};exports[_0x5534('0x22')]=function(_0x656ea4,_0x23d588){if(_0x656ea4['body']['id']){delete _0x656ea4[_0x5534('0x49')]['id'];}return db[_0x5534('0x2c')][_0x5534('0x46')]({'where':{'id':_0x656ea4[_0x5534('0x51')]['id']}})[_0x5534('0x23')](handleEntityNotFound(_0x23d588,null))['then'](saveUpdates(_0x656ea4[_0x5534('0x49')],null))[_0x5534('0x23')](respondWithResult(_0x23d588,null))[_0x5534('0x47')](handleError(_0x23d588,null));};exports['destroy']=function(_0xcd5302,_0x437f71){return db[_0x5534('0x2c')][_0x5534('0x46')]({'where':{'id':_0xcd5302[_0x5534('0x51')]['id']}})[_0x5534('0x23')](handleEntityNotFound(_0x437f71,null))[_0x5534('0x23')](removeEntity(_0x437f71,null))[_0x5534('0x47')](handleError(_0x437f71,null));};
\ No newline at end of file
index 5e907a2..29a5174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2a5=['moment','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','Template','tools_templates','lodash','util','../../config/logger','api'];(function(_0x448f4d,_0x437a06){var _0x1d950e=function(_0x1528ba){while(--_0x1528ba){_0x448f4d['push'](_0x448f4d['shift']());}};_0x1d950e(++_0x437a06);}(_0xc2a5,0x14e));var _0x5c2a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc2a5[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x5c2a('0x0'));var util=require(_0x5c2a('0x1'));var logger=require(_0x5c2a('0x2'))(_0x5c2a('0x3'));var moment=require(_0x5c2a('0x4'));var BPromise=require('bluebird');var rp=require(_0x5c2a('0x5'));var fs=require('fs');var path=require(_0x5c2a('0x6'));var rimraf=require(_0x5c2a('0x7'));var config=require(_0x5c2a('0x8'));var attributes=require(_0x5c2a('0x9'));module[_0x5c2a('0xa')]=function(_0x14c4ad,_0x45da5b){return _0x14c4ad['define'](_0x5c2a('0xb'),attributes,{'tableName':_0x5c2a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc03=['bluebird','path','../../config/environment','./template.attributes','define','Template','lodash','util','../../config/logger','api','moment'];(function(_0x41bbaa,_0x532d97){var _0x2f639f=function(_0xa577a3){while(--_0xa577a3){_0x41bbaa['push'](_0x41bbaa['shift']());}};_0x2f639f(++_0x532d97);}(_0xfc03,0x103));var _0x3fc0=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0xfc03[_0xb24a3e];return _0x4038d7;};'use strict';var _=require(_0x3fc0('0x0'));var util=require(_0x3fc0('0x1'));var logger=require(_0x3fc0('0x2'))(_0x3fc0('0x3'));var moment=require(_0x3fc0('0x4'));var BPromise=require(_0x3fc0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fc0('0x6'));var rimraf=require('rimraf');var config=require(_0x3fc0('0x7'));var attributes=require(_0x3fc0('0x8'));module['exports']=function(_0x47d6fc,_0xa5a8b7){return _0x47d6fc[_0x3fc0('0x9')](_0x3fc0('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4a1e23c..3cf9f3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd94=['Template','findAll','options','raw','limit','include','map','model','attributes','debug','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetTemplate'];(function(_0x4ebf10,_0x2ea42a){var _0x12453b=function(_0x13643b){while(--_0x13643b){_0x4ebf10['push'](_0x4ebf10['shift']());}};_0x12453b(++_0x2ea42a);}(_0xfd94,0x1bc));var _0x4fd9=function(_0x4b067d,_0x5d7bb5){_0x4b067d=_0x4b067d-0x0;var _0x273272=_0xfd94[_0x4b067d];return _0x273272;};'use strict';var _=require(_0x4fd9('0x0'));var util=require('util');var moment=require(_0x4fd9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4fd9('0x2'));var db=require(_0x4fd9('0x3'))['db'];var utils=require(_0x4fd9('0x4'));var logger=require(_0x4fd9('0x5'))(_0x4fd9('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4fd9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e7212,_0x4c875c,_0x3453a1){return new BPromise(function(_0x3345fa,_0x1319d6){return client[_0x4fd9('0x8')](_0x5e7212,_0x3453a1)[_0x4fd9('0x9')](function(_0x58de8f){logger[_0x4fd9('0xa')](_0x4fd9('0xb'),_0x4c875c,'request\x20sent');logger['debug'](_0x4fd9('0xc'),_0x4c875c,'request\x20sent',JSON[_0x4fd9('0xd')](_0x58de8f));if(_0x58de8f['error']){if(_0x58de8f[_0x4fd9('0xe')][_0x4fd9('0xf')]===0x1f4){logger[_0x4fd9('0xe')]('Template,\x20%s,\x20%s',_0x4c875c,_0x58de8f[_0x4fd9('0xe')][_0x4fd9('0x10')]);return _0x1319d6(_0x58de8f[_0x4fd9('0xe')][_0x4fd9('0x10')]);}logger[_0x4fd9('0xe')](_0x4fd9('0xb'),_0x4c875c,_0x58de8f[_0x4fd9('0xe')]['message']);return _0x3345fa(_0x58de8f[_0x4fd9('0xe')][_0x4fd9('0x10')]);}else{logger[_0x4fd9('0xa')](_0x4fd9('0xb'),_0x4c875c,_0x4fd9('0x11'));_0x3345fa(_0x58de8f[_0x4fd9('0x12')][_0x4fd9('0x10')]);}})[_0x4fd9('0x13')](function(_0x2368b8){logger[_0x4fd9('0xe')](_0x4fd9('0xb'),_0x4c875c,_0x2368b8);_0x1319d6(_0x2368b8);});});}exports[_0x4fd9('0x14')]=function(_0x67b81a){var _0x22e3c0=this;return new Promise(function(_0x13060b,_0x488267){return db[_0x4fd9('0x15')][_0x4fd9('0x16')]({'raw':_0x67b81a['options']?_0x67b81a[_0x4fd9('0x17')][_0x4fd9('0x18')]===undefined?!![]:![]:!![],'where':_0x67b81a[_0x4fd9('0x17')]?_0x67b81a['options']['where']||null:null,'attributes':_0x67b81a['options']?_0x67b81a[_0x4fd9('0x17')]['attributes']||null:null,'limit':_0x67b81a[_0x4fd9('0x17')]?_0x67b81a['options'][_0x4fd9('0x19')]||null:null,'include':_0x67b81a[_0x4fd9('0x17')]?_0x67b81a['options'][_0x4fd9('0x1a')]?_[_0x4fd9('0x1b')](_0x67b81a['options'][_0x4fd9('0x1a')],function(_0x68e735){return{'model':db[_0x68e735[_0x4fd9('0x1c')]],'as':_0x68e735['as'],'attributes':_0x68e735[_0x4fd9('0x1d')],'include':_0x68e735[_0x4fd9('0x1a')]?_[_0x4fd9('0x1b')](_0x68e735[_0x4fd9('0x1a')],function(_0x384d22){return{'model':db[_0x384d22[_0x4fd9('0x1c')]],'as':_0x384d22['as'],'attributes':_0x384d22[_0x4fd9('0x1d')],'include':_0x384d22[_0x4fd9('0x1a')]?_[_0x4fd9('0x1b')](_0x384d22['include'],function(_0x40642c){return{'model':db[_0x40642c[_0x4fd9('0x1c')]],'as':_0x40642c['as'],'attributes':_0x40642c[_0x4fd9('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x548512){logger['info'](_0x4fd9('0x14'),_0x67b81a);logger[_0x4fd9('0x1e')](_0x4fd9('0x14'),_0x67b81a,JSON[_0x4fd9('0xd')](_0x548512));_0x13060b(_0x548512);})[_0x4fd9('0x13')](function(_0x1cecd3){logger['error'](_0x4fd9('0x14'),_0x1cecd3[_0x4fd9('0x10')],_0x67b81a);_0x488267(_0x22e3c0['error'](0x1f4,_0x1cecd3[_0x4fd9('0x10')]));});});};
\ No newline at end of file
+var _0x5729=['then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTemplate','Template','options','raw','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x58d26d,_0x5ccb56){var _0x58e0a1=function(_0x456712){while(--_0x456712){_0x58d26d['push'](_0x58d26d['shift']());}};_0x58e0a1(++_0x5ccb56);}(_0x5729,0xce));var _0x9572=function(_0xc7d92f,_0x2f2193){_0xc7d92f=_0xc7d92f-0x0;var _0x3a17ea=_0x5729[_0xc7d92f];return _0x3a17ea;};'use strict';var _=require('lodash');var util=require(_0x9572('0x0'));var moment=require(_0x9572('0x1'));var BPromise=require(_0x9572('0x2'));var rs=require(_0x9572('0x3'));var fs=require('fs');var Redis=require(_0x9572('0x4'));var db=require(_0x9572('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9572('0x6'))(_0x9572('0x7'));var config=require(_0x9572('0x8'));var jayson=require(_0x9572('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x596fd9,_0x43b775,_0xc73dcf){return new BPromise(function(_0x245a33,_0x230afe){return client[_0x9572('0xa')](_0x596fd9,_0xc73dcf)[_0x9572('0xb')](function(_0x482e9e){logger[_0x9572('0xc')](_0x9572('0xd'),_0x43b775,'request\x20sent');logger[_0x9572('0xe')](_0x9572('0xf'),_0x43b775,_0x9572('0x10'),JSON[_0x9572('0x11')](_0x482e9e));if(_0x482e9e[_0x9572('0x12')]){if(_0x482e9e['error'][_0x9572('0x13')]===0x1f4){logger[_0x9572('0x12')](_0x9572('0xd'),_0x43b775,_0x482e9e[_0x9572('0x12')][_0x9572('0x14')]);return _0x230afe(_0x482e9e[_0x9572('0x12')]['message']);}logger[_0x9572('0x12')](_0x9572('0xd'),_0x43b775,_0x482e9e['error'][_0x9572('0x14')]);return _0x245a33(_0x482e9e[_0x9572('0x12')][_0x9572('0x14')]);}else{logger['info'](_0x9572('0xd'),_0x43b775,_0x9572('0x10'));_0x245a33(_0x482e9e[_0x9572('0x15')][_0x9572('0x14')]);}})[_0x9572('0x16')](function(_0x5dd8f2){logger[_0x9572('0x12')]('Template,\x20%s,\x20%s',_0x43b775,_0x5dd8f2);_0x230afe(_0x5dd8f2);});});}exports[_0x9572('0x17')]=function(_0x1b411c){var _0x3d5f71=this;return new Promise(function(_0x5de8d4,_0x1fc14){return db[_0x9572('0x18')]['findAll']({'raw':_0x1b411c[_0x9572('0x19')]?_0x1b411c[_0x9572('0x19')][_0x9572('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b411c['options']?_0x1b411c[_0x9572('0x19')]['where']||null:null,'attributes':_0x1b411c['options']?_0x1b411c[_0x9572('0x19')][_0x9572('0x1b')]||null:null,'limit':_0x1b411c[_0x9572('0x19')]?_0x1b411c['options']['limit']||null:null,'include':_0x1b411c[_0x9572('0x19')]?_0x1b411c[_0x9572('0x19')][_0x9572('0x1c')]?_[_0x9572('0x1d')](_0x1b411c[_0x9572('0x19')][_0x9572('0x1c')],function(_0x2bc587){return{'model':db[_0x2bc587['model']],'as':_0x2bc587['as'],'attributes':_0x2bc587[_0x9572('0x1b')],'include':_0x2bc587[_0x9572('0x1c')]?_[_0x9572('0x1d')](_0x2bc587[_0x9572('0x1c')],function(_0xf23aac){return{'model':db[_0xf23aac[_0x9572('0x1e')]],'as':_0xf23aac['as'],'attributes':_0xf23aac[_0x9572('0x1b')],'include':_0xf23aac[_0x9572('0x1c')]?_['map'](_0xf23aac['include'],function(_0x34cc5a){return{'model':db[_0x34cc5a[_0x9572('0x1e')]],'as':_0x34cc5a['as'],'attributes':_0x34cc5a[_0x9572('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a7e76){logger[_0x9572('0xc')](_0x9572('0x17'),_0x1b411c);logger[_0x9572('0xe')]('GetTemplate',_0x1b411c,JSON[_0x9572('0x11')](_0x3a7e76));_0x5de8d4(_0x3a7e76);})[_0x9572('0x16')](function(_0xbbf445){logger[_0x9572('0x12')](_0x9572('0x17'),_0xbbf445[_0x9572('0x14')],_0x1b411c);_0x1fc14(_0x3d5f71[_0x9572('0x12')](0x1f4,_0xbbf445['message']));});});};
\ No newline at end of file
index 863ec5c..62ad7b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x724b=['getActions','post','create','/:id/any_conditions','addAnyCondition','addAction','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','getAllConditions','getAnyConditions','/:id/actions'];(function(_0x54c0e4,_0x38fbe6){var _0x33e259=function(_0x265a3f){while(--_0x265a3f){_0x54c0e4['push'](_0x54c0e4['shift']());}};_0x33e259(++_0x38fbe6);}(_0x724b,0x1e9));var _0xb724=function(_0x230333,_0x351eb2){_0x230333=_0x230333-0x0;var _0x2b012e=_0x724b[_0x230333];return _0x2b012e;};'use strict';var multer=require(_0xb724('0x0'));var util=require(_0xb724('0x1'));var path=require(_0xb724('0x2'));var timeout=require(_0xb724('0x3'));var express=require(_0xb724('0x4'));var router=express[_0xb724('0x5')]();var auth=require(_0xb724('0x6'));var interaction=require(_0xb724('0x7'));var config=require('../../config/environment');var controller=require('./trigger.controller');router['get']('/',auth[_0xb724('0x8')](),controller[_0xb724('0x9')]);router[_0xb724('0xa')](_0xb724('0xb'),auth[_0xb724('0x8')](),controller['show']);router[_0xb724('0xa')]('/:id/all_conditions',auth[_0xb724('0x8')](),controller[_0xb724('0xc')]);router['get']('/:id/any_conditions',auth[_0xb724('0x8')](),controller[_0xb724('0xd')]);router[_0xb724('0xa')](_0xb724('0xe'),auth['isAuthenticated'](),controller[_0xb724('0xf')]);router[_0xb724('0x10')]('/',auth[_0xb724('0x8')](),controller[_0xb724('0x11')]);router[_0xb724('0x10')]('/:id/all_conditions',auth[_0xb724('0x8')](),controller['addAllCondition']);router[_0xb724('0x10')](_0xb724('0x12'),auth[_0xb724('0x8')](),controller[_0xb724('0x13')]);router[_0xb724('0x10')](_0xb724('0xe'),auth['isAuthenticated'](),controller[_0xb724('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb724('0x15')]);router[_0xb724('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb724('0x17')]=router;
\ No newline at end of file
+var _0xbb87=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','show','/:id/all_conditions','isAuthenticated','getAllConditions','get','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','delete','destroy','exports','util'];(function(_0x5d9f3a,_0x398dd7){var _0x2f8258=function(_0x51e76d){while(--_0x51e76d){_0x5d9f3a['push'](_0x5d9f3a['shift']());}};_0x2f8258(++_0x398dd7);}(_0xbb87,0x1af));var _0x7bb8=function(_0x4d5e23,_0x1df8fa){_0x4d5e23=_0x4d5e23-0x0;var _0x2bfb07=_0xbb87[_0x4d5e23];return _0x2bfb07;};'use strict';var multer=require('multer');var util=require(_0x7bb8('0x0'));var path=require(_0x7bb8('0x1'));var timeout=require(_0x7bb8('0x2'));var express=require(_0x7bb8('0x3'));var router=express[_0x7bb8('0x4')]();var auth=require(_0x7bb8('0x5'));var interaction=require(_0x7bb8('0x6'));var config=require(_0x7bb8('0x7'));var controller=require('./trigger.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7bb8('0x8')]);router['get'](_0x7bb8('0x9'),auth['isAuthenticated'](),controller[_0x7bb8('0xa')]);router['get'](_0x7bb8('0xb'),auth[_0x7bb8('0xc')](),controller[_0x7bb8('0xd')]);router[_0x7bb8('0xe')]('/:id/any_conditions',auth[_0x7bb8('0xc')](),controller['getAnyConditions']);router[_0x7bb8('0xe')](_0x7bb8('0xf'),auth['isAuthenticated'](),controller[_0x7bb8('0x10')]);router['post']('/',auth[_0x7bb8('0xc')](),controller['create']);router[_0x7bb8('0x11')](_0x7bb8('0xb'),auth[_0x7bb8('0xc')](),controller[_0x7bb8('0x12')]);router[_0x7bb8('0x11')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x7bb8('0x13')]);router[_0x7bb8('0x11')](_0x7bb8('0xf'),auth[_0x7bb8('0xc')](),controller[_0x7bb8('0x14')]);router['put'](_0x7bb8('0x9'),auth[_0x7bb8('0xc')](),controller['update']);router[_0x7bb8('0x15')](_0x7bb8('0x9'),auth[_0x7bb8('0xc')](),controller[_0x7bb8('0x16')]);module[_0x7bb8('0x17')]=router;
\ No newline at end of file
index 96b9b30..1711adb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2afa=['STRING','BOOLEAN','sequelize','exports'];(function(_0x25c020,_0x1a1db6){var _0xa05517=function(_0x5f17d7){while(--_0x5f17d7){_0x25c020['push'](_0x25c020['shift']());}};_0xa05517(++_0x1a1db6);}(_0x2afa,0x6e));var _0xa2af=function(_0x5a7790,_0x29dce2){_0x5a7790=_0x5a7790-0x0;var _0x23dc47=_0x2afa[_0x5a7790];return _0x23dc47;};'use strict';var Sequelize=require(_0xa2af('0x0'));module[_0xa2af('0x1')]={'name':{'type':Sequelize[_0xa2af('0x2')]},'channel':{'type':Sequelize[_0xa2af('0x2')]},'description':{'type':Sequelize[_0xa2af('0x2')]},'status':{'type':Sequelize[_0xa2af('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6807=['BOOLEAN','sequelize','exports','STRING'];(function(_0x5bd612,_0x47e025){var _0x5f0715=function(_0x27ec10){while(--_0x27ec10){_0x5bd612['push'](_0x5bd612['shift']());}};_0x5f0715(++_0x47e025);}(_0x6807,0x105));var _0x7680=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6807[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x7680('0x0'));module[_0x7680('0x1')]={'name':{'type':Sequelize[_0x7680('0x2')]},'channel':{'type':Sequelize[_0x7680('0x2')]},'description':{'type':Sequelize[_0x7680('0x2')]},'status':{'type':Sequelize[_0x7680('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 9bc6d02..44c5cbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66df=['length','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','getAllConditions','findOne','Condition','getAnyConditions','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','destroy','then','get','Triggers','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','Trigger','findAll','catch','show','params'];(function(_0x3034fd,_0x3f33fd){var _0x2276f1=function(_0x1d404e){while(--_0x1d404e){_0x3034fd['push'](_0x3034fd['shift']());}};_0x2276f1(++_0x3f33fd);}(_0x66df,0x126));var _0xf66d=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x66df[_0xa9a245];return _0x2d0eaa;};'use strict';var pdf=require(_0xf66d('0x0'));var emlformat=require(_0xf66d('0x1'));var rimraf=require(_0xf66d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf66d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf66d('0x4'));var Mustache=require(_0xf66d('0x5'));var util=require(_0xf66d('0x6'));var path=require(_0xf66d('0x7'));var sox=require(_0xf66d('0x8'));var csv=require(_0xf66d('0x9'));var ejs=require(_0xf66d('0xa'));var fs=require('fs');var _=require(_0xf66d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf66d('0xc'));var deskjs=require(_0xf66d('0xd'));var toCsv=require(_0xf66d('0x9'));var querystring=require(_0xf66d('0xe'));var Papa=require('papaparse');var Redis=require(_0xf66d('0xf'));var authService=require(_0xf66d('0x10'));var qs=require(_0xf66d('0x11'));var as=require(_0xf66d('0x12'));var hardwareService=require(_0xf66d('0x13'));var logger=require(_0xf66d('0x14'))(_0xf66d('0x15'));var utils=require(_0xf66d('0x16'));var config=require(_0xf66d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d7677,_0x191e5f){_0x191e5f=_0x191e5f||0xcc;return function(_0x50792a){if(_0x50792a){return _0x5d7677[_0xf66d('0x18')](_0x191e5f);}return _0x5d7677[_0xf66d('0x19')](_0x191e5f)[_0xf66d('0x1a')]();};}function respondWithResult(_0x3f5a3b,_0x11b310){_0x11b310=_0x11b310||0xc8;return function(_0x47cb22){if(_0x47cb22){return _0x3f5a3b['status'](_0x11b310)[_0xf66d('0x1b')](_0x47cb22);}};}function respondWithFilteredResult(_0xbc5cce,_0x5dcc23){return function(_0x1b402e){if(_0x1b402e){var _0x4c5112=_0x1b402e[_0xf66d('0x1c')],_0x2b78e7=_0x5dcc23[_0xf66d('0x1d')],_0x5571df=_0x5dcc23[_0xf66d('0x1d')]+_0x5dcc23[_0xf66d('0x1e')],_0x3fec6c;if(_0x5571df>=_0x4c5112){_0x5571df=_0x4c5112;_0x3fec6c=0xc8;}else{_0x3fec6c=0xce;}_0xbc5cce['status'](_0x3fec6c);return _0xbc5cce['set'](_0xf66d('0x1f'),_0x2b78e7+'-'+_0x5571df+'/'+_0x4c5112)[_0xf66d('0x1b')](_0x1b402e);}return null;};}function patchUpdates(_0x364d8e){return function(_0x163052){try{jsonpatch['apply'](_0x163052,_0x364d8e,!![]);}catch(_0x4d7c3a){return BPromise[_0xf66d('0x20')](_0x4d7c3a);}return _0x163052['save']();};}function saveUpdates(_0x404655,_0x440487){return function(_0xd271bd){if(_0xd271bd){return _0xd271bd[_0xf66d('0x21')](_0x404655)['then'](function(_0x51e5e1){return _0x51e5e1;});}return null;};}function removeEntity(_0x292f10,_0x3d07d7){return function(_0x50fd34){if(_0x50fd34){return _0x50fd34[_0xf66d('0x22')]()[_0xf66d('0x23')](function(){var _0x1b826f=_0x50fd34[_0xf66d('0x24')]({'plain':!![]});var _0xa7ded7=_0xf66d('0x25');return db[_0xf66d('0x26')][_0xf66d('0x22')]({'where':{'type':_0xa7ded7,'resourceId':_0x1b826f['id']}})[_0xf66d('0x23')](function(){return _0x50fd34;});})[_0xf66d('0x23')](function(){_0x292f10[_0xf66d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49aa7a,_0x51145c){return function(_0x30fc85){if(!_0x30fc85){_0x49aa7a[_0xf66d('0x18')](0x194);}return _0x30fc85;};}function handleError(_0x26f088,_0x438687){_0x438687=_0x438687||0x1f4;return function(_0x105607){logger[_0xf66d('0x27')](_0x105607[_0xf66d('0x28')]);if(_0x105607[_0xf66d('0x29')]){delete _0x105607[_0xf66d('0x29')];}_0x26f088[_0xf66d('0x19')](_0x438687)[_0xf66d('0x2a')](_0x105607);};}exports[_0xf66d('0x2b')]=function(_0x3074e7,_0x3fcbbe){var _0x3efcb5={},_0x2bf22c={},_0x3ce305={'count':0x0,'rows':[]};var _0x22e977=_[_0xf66d('0x2c')](db['Trigger'][_0xf66d('0x2d')],function(_0x5ead6d){return{'name':_0x5ead6d[_0xf66d('0x2e')],'type':_0x5ead6d['type'][_0xf66d('0x2f')]};});_0x2bf22c[_0xf66d('0x30')]=_[_0xf66d('0x2c')](_0x22e977,_0xf66d('0x29'));_0x2bf22c[_0xf66d('0x31')]=_[_0xf66d('0x32')](_0x3074e7[_0xf66d('0x31')]);_0x2bf22c[_0xf66d('0x33')]=_['intersection'](_0x2bf22c['model'],_0x2bf22c[_0xf66d('0x31')]);_0x3efcb5[_0xf66d('0x34')]=_[_0xf66d('0x35')](_0x2bf22c['model'],qs[_0xf66d('0x36')](_0x3074e7[_0xf66d('0x31')]['fields']));_0x3efcb5['attributes']=_0x3efcb5['attributes']['length']?_0x3efcb5[_0xf66d('0x34')]:_0x2bf22c[_0xf66d('0x30')];if(!_0x3074e7[_0xf66d('0x31')][_0xf66d('0x37')](_0xf66d('0x38'))){_0x3efcb5[_0xf66d('0x1e')]=qs[_0xf66d('0x1e')](_0x3074e7[_0xf66d('0x31')]['limit']);_0x3efcb5[_0xf66d('0x1d')]=qs[_0xf66d('0x1d')](_0x3074e7[_0xf66d('0x31')][_0xf66d('0x1d')]);}_0x3efcb5[_0xf66d('0x39')]=qs[_0xf66d('0x3a')](_0x3074e7[_0xf66d('0x31')][_0xf66d('0x3a')]);_0x3efcb5[_0xf66d('0x3b')]=qs[_0xf66d('0x33')](_[_0xf66d('0x3c')](_0x3074e7['query'],_0x2bf22c[_0xf66d('0x33')]),_0x22e977);if(_0x3074e7['query'][_0xf66d('0x3d')]){_0x3efcb5[_0xf66d('0x3b')]=_[_0xf66d('0x3e')](_0x3efcb5['where'],{'$or':_['map'](_0x22e977,function(_0x201478){if(_0x201478[_0xf66d('0x3f')]!=='VIRTUAL'){var _0x37cbec={};_0x37cbec[_0x201478[_0xf66d('0x29')]]={'$like':'%'+_0x3074e7[_0xf66d('0x31')][_0xf66d('0x3d')]+'%'};return _0x37cbec;}})});}_0x3efcb5=_[_0xf66d('0x3e')]({},_0x3efcb5,_0x3074e7['options']);var _0x5522b6={'where':_0x3efcb5[_0xf66d('0x3b')]};return db['Trigger'][_0xf66d('0x1c')](_0x5522b6)[_0xf66d('0x23')](function(_0x1e4e7a){_0x3ce305[_0xf66d('0x1c')]=_0x1e4e7a;if(_0x3074e7['query'][_0xf66d('0x40')]){_0x3efcb5['include']=[{'all':!![]}];}return db[_0xf66d('0x41')][_0xf66d('0x42')](_0x3efcb5);})[_0xf66d('0x23')](function(_0x1a7b84){_0x3ce305['rows']=_0x1a7b84;return _0x3ce305;})[_0xf66d('0x23')](respondWithFilteredResult(_0x3fcbbe,_0x3efcb5))[_0xf66d('0x43')](handleError(_0x3fcbbe,null));};exports[_0xf66d('0x44')]=function(_0xf48b88,_0x3bceca){var _0x36c1c3={'raw':![],'where':{'id':_0xf48b88[_0xf66d('0x45')]['id']}},_0x10ec7e={};_0x10ec7e['model']=_['keys'](db['Trigger'][_0xf66d('0x2d')]);_0x10ec7e['query']=_[_0xf66d('0x32')](_0xf48b88[_0xf66d('0x31')]);_0x10ec7e[_0xf66d('0x33')]=_[_0xf66d('0x35')](_0x10ec7e[_0xf66d('0x30')],_0x10ec7e[_0xf66d('0x31')]);_0x36c1c3['attributes']=_[_0xf66d('0x35')](_0x10ec7e[_0xf66d('0x30')],qs[_0xf66d('0x36')](_0xf48b88['query'][_0xf66d('0x36')]));_0x36c1c3['attributes']=_0x36c1c3['attributes'][_0xf66d('0x46')]?_0x36c1c3[_0xf66d('0x34')]:_0x10ec7e[_0xf66d('0x30')];if(_0xf48b88[_0xf66d('0x31')][_0xf66d('0x40')]){_0x36c1c3[_0xf66d('0x47')]=[{'all':!![]}];}_0x36c1c3=_[_0xf66d('0x3e')]({},_0x36c1c3,_0xf48b88[_0xf66d('0x48')]);return db[_0xf66d('0x41')][_0xf66d('0x49')](_0x36c1c3)[_0xf66d('0x23')](handleEntityNotFound(_0x3bceca,null))[_0xf66d('0x23')](respondWithResult(_0x3bceca,null))['catch'](handleError(_0x3bceca,null));};exports[_0xf66d('0x4a')]=function(_0x5588ad,_0x391141){return db[_0xf66d('0x41')][_0xf66d('0x4a')](_0x5588ad[_0xf66d('0x4b')],{})['then'](function(_0x22f10f){var _0x1911c4=_0x5588ad['user']['get']({'plain':!![]});if(!_0x1911c4)throw new Error(_0xf66d('0x4c'));if(_0x1911c4[_0xf66d('0x4d')]===_0xf66d('0x4e')){var _0x3c63c9=_0x22f10f[_0xf66d('0x24')]({'plain':!![]});var _0x3a5f12=_0xf66d('0x25');return db['UserProfileSection'][_0xf66d('0x49')]({'where':{'name':_0x3a5f12,'userProfileId':_0x1911c4['userProfileId']},'raw':!![]})[_0xf66d('0x23')](function(_0x2c42cc){if(_0x2c42cc&&_0x2c42cc[_0xf66d('0x4f')]===0x0){return db[_0xf66d('0x26')][_0xf66d('0x4a')]({'name':_0x3c63c9['name'],'resourceId':_0x3c63c9['id'],'type':_0x2c42cc['name'],'sectionId':_0x2c42cc['id']},{})[_0xf66d('0x23')](function(){return _0x22f10f;});}else{return _0x22f10f;}})[_0xf66d('0x43')](function(_0x22acbc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22acbc);throw _0x22acbc;});}return _0x22f10f;})[_0xf66d('0x23')](respondWithResult(_0x391141,0xc9))['catch'](handleError(_0x391141,null));};exports[_0xf66d('0x21')]=function(_0xa0c1c9,_0x397904){if(_0xa0c1c9[_0xf66d('0x4b')]['id']){delete _0xa0c1c9[_0xf66d('0x4b')]['id'];}return db[_0xf66d('0x41')][_0xf66d('0x49')]({'where':{'id':_0xa0c1c9[_0xf66d('0x45')]['id']}})[_0xf66d('0x23')](handleEntityNotFound(_0x397904,null))[_0xf66d('0x23')](saveUpdates(_0xa0c1c9['body'],null))[_0xf66d('0x23')](respondWithResult(_0x397904,null))[_0xf66d('0x43')](handleError(_0x397904,null));};exports[_0xf66d('0x22')]=function(_0x2d6b57,_0x4a8e6b){return db[_0xf66d('0x41')][_0xf66d('0x49')]({'where':{'id':_0x2d6b57[_0xf66d('0x45')]['id']}})[_0xf66d('0x23')](handleEntityNotFound(_0x4a8e6b,null))[_0xf66d('0x23')](removeEntity(_0x4a8e6b,null))[_0xf66d('0x43')](handleError(_0x4a8e6b,null));};exports[_0xf66d('0x50')]=function(_0x312c79,_0x1b1bac,_0x5c9c95){if(_0x312c79['body']['id']){delete _0x312c79[_0xf66d('0x4b')]['id'];}return db[_0xf66d('0x41')][_0xf66d('0x49')]({'where':{'id':_0x312c79[_0xf66d('0x45')]['id']}})[_0xf66d('0x23')](handleEntityNotFound(_0x1b1bac,null))[_0xf66d('0x23')](function(_0x329e5a){if(_0x329e5a){_0x312c79[_0xf66d('0x4b')][_0xf66d('0x51')]=_0x329e5a['id'];return db['Condition'][_0xf66d('0x4a')](_0x312c79[_0xf66d('0x4b')]);}})[_0xf66d('0x23')](respondWithResult(_0x1b1bac,null))['catch'](handleError(_0x1b1bac,null));};exports[_0xf66d('0x52')]=function(_0x3e5453,_0x1df20e,_0x5cc646){if(_0x3e5453['body']['id']){delete _0x3e5453[_0xf66d('0x4b')]['id'];}return db[_0xf66d('0x41')]['find']({'where':{'id':_0x3e5453[_0xf66d('0x45')]['id']}})[_0xf66d('0x23')](handleEntityNotFound(_0x1df20e,null))[_0xf66d('0x23')](function(_0x1cb194){if(_0x1cb194){_0x3e5453[_0xf66d('0x4b')][_0xf66d('0x53')]=_0x1cb194['id'];return db['Condition'][_0xf66d('0x4a')](_0x3e5453[_0xf66d('0x4b')]);}})[_0xf66d('0x23')](respondWithResult(_0x1df20e,null))[_0xf66d('0x43')](handleError(_0x1df20e,null));};exports[_0xf66d('0x54')]=function(_0x5e0880,_0x515c4e,_0x4f5779){var _0x18a7e5={};var _0x4e6069={};var _0x2842db;var _0x170d80;return db[_0xf66d('0x41')][_0xf66d('0x55')]({'where':{'id':_0x5e0880['params']['id']}})['then'](handleEntityNotFound(_0x515c4e,null))[_0xf66d('0x23')](function(_0x38dc21){if(_0x38dc21){_0x2842db=_0x38dc21;_0x4e6069[_0xf66d('0x30')]=_[_0xf66d('0x32')](db[_0xf66d('0x56')][_0xf66d('0x2d')]);_0x4e6069['query']=_[_0xf66d('0x32')](_0x5e0880[_0xf66d('0x31')]);_0x4e6069[_0xf66d('0x33')]=_['intersection'](_0x4e6069[_0xf66d('0x30')],_0x4e6069[_0xf66d('0x31')]);_0x18a7e5[_0xf66d('0x34')]=_['intersection'](_0x4e6069[_0xf66d('0x30')],qs[_0xf66d('0x36')](_0x5e0880[_0xf66d('0x31')][_0xf66d('0x36')]));_0x18a7e5[_0xf66d('0x34')]=_0x18a7e5[_0xf66d('0x34')][_0xf66d('0x46')]?_0x18a7e5[_0xf66d('0x34')]:_0x4e6069[_0xf66d('0x30')];_0x18a7e5[_0xf66d('0x39')]=qs['sort'](_0x5e0880[_0xf66d('0x31')][_0xf66d('0x3a')]);_0x18a7e5[_0xf66d('0x3b')]=qs['filters'](_['pick'](_0x5e0880[_0xf66d('0x31')],_0x4e6069[_0xf66d('0x33')]));if(_0x5e0880[_0xf66d('0x31')][_0xf66d('0x3d')]){_0x18a7e5[_0xf66d('0x3b')]=_[_0xf66d('0x3e')](_0x18a7e5['where'],{'$or':_[_0xf66d('0x2c')](_0x18a7e5[_0xf66d('0x34')],function(_0x11f4d7){var _0x209767={};_0x209767[_0x11f4d7]={'$like':'%'+_0x5e0880['query'][_0xf66d('0x3d')]+'%'};return _0x209767;})});}_0x18a7e5=_['merge']({},_0x18a7e5,_0x5e0880[_0xf66d('0x48')]);return _0x2842db['getAllConditions'](_0x18a7e5);}})[_0xf66d('0x23')](function(_0x134768){if(_0x134768){_0x170d80=_0x134768[_0xf66d('0x46')];if(!_0x5e0880[_0xf66d('0x31')][_0xf66d('0x37')](_0xf66d('0x38'))){_0x18a7e5[_0xf66d('0x1e')]=qs[_0xf66d('0x1e')](_0x5e0880[_0xf66d('0x31')][_0xf66d('0x1e')]);_0x18a7e5[_0xf66d('0x1d')]=qs[_0xf66d('0x1d')](_0x5e0880[_0xf66d('0x31')][_0xf66d('0x1d')]);}return _0x2842db[_0xf66d('0x54')](_0x18a7e5);}})[_0xf66d('0x23')](function(_0x50ec5c){if(_0x50ec5c){return _0x50ec5c?{'count':_0x170d80,'rows':_0x50ec5c}:null;}})['then'](respondWithResult(_0x515c4e,null))[_0xf66d('0x43')](handleError(_0x515c4e,null));};exports[_0xf66d('0x57')]=function(_0x393a3d,_0x1cdbef,_0x563e77){var _0x5047ea={};var _0x374761={};var _0x21a80e;var _0x238452;return db[_0xf66d('0x41')][_0xf66d('0x55')]({'where':{'id':_0x393a3d['params']['id']}})[_0xf66d('0x23')](handleEntityNotFound(_0x1cdbef,null))[_0xf66d('0x23')](function(_0x35b9be){if(_0x35b9be){_0x21a80e=_0x35b9be;_0x374761[_0xf66d('0x30')]=_[_0xf66d('0x32')](db[_0xf66d('0x56')]['rawAttributes']);_0x374761[_0xf66d('0x31')]=_[_0xf66d('0x32')](_0x393a3d[_0xf66d('0x31')]);_0x374761[_0xf66d('0x33')]=_['intersection'](_0x374761[_0xf66d('0x30')],_0x374761['query']);_0x5047ea[_0xf66d('0x34')]=_[_0xf66d('0x35')](_0x374761['model'],qs[_0xf66d('0x36')](_0x393a3d['query']['fields']));_0x5047ea[_0xf66d('0x34')]=_0x5047ea[_0xf66d('0x34')][_0xf66d('0x46')]?_0x5047ea['attributes']:_0x374761[_0xf66d('0x30')];_0x5047ea[_0xf66d('0x39')]=qs[_0xf66d('0x3a')](_0x393a3d[_0xf66d('0x31')][_0xf66d('0x3a')]);_0x5047ea[_0xf66d('0x3b')]=qs[_0xf66d('0x33')](_[_0xf66d('0x3c')](_0x393a3d[_0xf66d('0x31')],_0x374761[_0xf66d('0x33')]));if(_0x393a3d[_0xf66d('0x31')][_0xf66d('0x3d')]){_0x5047ea[_0xf66d('0x3b')]=_[_0xf66d('0x3e')](_0x5047ea['where'],{'$or':_[_0xf66d('0x2c')](_0x5047ea['attributes'],function(_0x496d6d){var _0x3de9fa={};_0x3de9fa[_0x496d6d]={'$like':'%'+_0x393a3d[_0xf66d('0x31')][_0xf66d('0x3d')]+'%'};return _0x3de9fa;})});}_0x5047ea=_['merge']({},_0x5047ea,_0x393a3d[_0xf66d('0x48')]);return _0x21a80e['getAnyConditions'](_0x5047ea);}})[_0xf66d('0x23')](function(_0x2d1cfa){if(_0x2d1cfa){_0x238452=_0x2d1cfa[_0xf66d('0x46')];if(!_0x393a3d[_0xf66d('0x31')][_0xf66d('0x37')]('nolimit')){_0x5047ea[_0xf66d('0x1e')]=qs[_0xf66d('0x1e')](_0x393a3d['query'][_0xf66d('0x1e')]);_0x5047ea[_0xf66d('0x1d')]=qs[_0xf66d('0x1d')](_0x393a3d[_0xf66d('0x31')][_0xf66d('0x1d')]);}return _0x21a80e['getAnyConditions'](_0x5047ea);}})['then'](function(_0x1e1507){if(_0x1e1507){return _0x1e1507?{'count':_0x238452,'rows':_0x1e1507}:null;}})[_0xf66d('0x23')](respondWithResult(_0x1cdbef,null))[_0xf66d('0x43')](handleError(_0x1cdbef,null));};exports['addAction']=function(_0x3f3a42,_0x2067d8,_0x40d65c){if(_0x3f3a42[_0xf66d('0x4b')]['id']){delete _0x3f3a42[_0xf66d('0x4b')]['id'];}return db[_0xf66d('0x41')][_0xf66d('0x49')]({'where':{'id':_0x3f3a42[_0xf66d('0x45')]['id']}})[_0xf66d('0x23')](handleEntityNotFound(_0x2067d8,null))[_0xf66d('0x23')](function(_0xcd3b82){if(_0xcd3b82){_0x3f3a42[_0xf66d('0x4b')][_0xf66d('0x58')]=_0xcd3b82['id'];return db[_0xf66d('0x59')][_0xf66d('0x4a')](_0x3f3a42['body']);}})[_0xf66d('0x23')](respondWithResult(_0x2067d8,null))[_0xf66d('0x43')](handleError(_0x2067d8,null));};exports[_0xf66d('0x5a')]=function(_0x44b8d9,_0x5c7c32,_0x2cb6a3){var _0x3cd93d={};var _0x5e6d56={};var _0x4e7fb4;var _0x598737;return db[_0xf66d('0x41')][_0xf66d('0x55')]({'where':{'id':_0x44b8d9[_0xf66d('0x45')]['id']}})[_0xf66d('0x23')](handleEntityNotFound(_0x5c7c32,null))[_0xf66d('0x23')](function(_0x307210){if(_0x307210){_0x4e7fb4=_0x307210;_0x5e6d56[_0xf66d('0x30')]=_[_0xf66d('0x32')](db[_0xf66d('0x59')][_0xf66d('0x2d')]);_0x5e6d56[_0xf66d('0x31')]=_[_0xf66d('0x32')](_0x44b8d9[_0xf66d('0x31')]);_0x5e6d56[_0xf66d('0x33')]=_['intersection'](_0x5e6d56[_0xf66d('0x30')],_0x5e6d56[_0xf66d('0x31')]);_0x3cd93d[_0xf66d('0x34')]=_[_0xf66d('0x35')](_0x5e6d56['model'],qs[_0xf66d('0x36')](_0x44b8d9[_0xf66d('0x31')]['fields']));_0x3cd93d['attributes']=_0x3cd93d[_0xf66d('0x34')][_0xf66d('0x46')]?_0x3cd93d['attributes']:_0x5e6d56[_0xf66d('0x30')];_0x3cd93d['order']=qs['sort'](_0x44b8d9['query'][_0xf66d('0x3a')]);_0x3cd93d[_0xf66d('0x3b')]=qs[_0xf66d('0x33')](_[_0xf66d('0x3c')](_0x44b8d9[_0xf66d('0x31')],_0x5e6d56[_0xf66d('0x33')]));if(_0x44b8d9[_0xf66d('0x31')][_0xf66d('0x3d')]){_0x3cd93d['where']=_[_0xf66d('0x3e')](_0x3cd93d[_0xf66d('0x3b')],{'$or':_[_0xf66d('0x2c')](_0x3cd93d[_0xf66d('0x34')],function(_0x37f698){var _0x1a9e93={};_0x1a9e93[_0x37f698]={'$like':'%'+_0x44b8d9[_0xf66d('0x31')]['filter']+'%'};return _0x1a9e93;})});}_0x3cd93d=_[_0xf66d('0x3e')]({},_0x3cd93d,_0x44b8d9[_0xf66d('0x48')]);return _0x4e7fb4[_0xf66d('0x5a')](_0x3cd93d);}})[_0xf66d('0x23')](function(_0x2037df){if(_0x2037df){_0x598737=_0x2037df[_0xf66d('0x46')];if(!_0x44b8d9[_0xf66d('0x31')][_0xf66d('0x37')](_0xf66d('0x38'))){_0x3cd93d[_0xf66d('0x1e')]=qs['limit'](_0x44b8d9['query'][_0xf66d('0x1e')]);_0x3cd93d[_0xf66d('0x1d')]=qs[_0xf66d('0x1d')](_0x44b8d9[_0xf66d('0x31')][_0xf66d('0x1d')]);}return _0x4e7fb4[_0xf66d('0x5a')](_0x3cd93d);}})[_0xf66d('0x23')](function(_0x5565b8){if(_0x5565b8){return _0x5565b8?{'count':_0x598737,'rows':_0x5565b8}:null;}})[_0xf66d('0x23')](respondWithResult(_0x5c7c32,null))[_0xf66d('0x43')](handleError(_0x5c7c32,null));};
\ No newline at end of file
+var _0xbc3a=['nolimit','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','find','userProfileId','autoAssociation','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','order','getAnyConditions','findOne','addAction','Action','getActions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','Trigger','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x4386e0,_0x5092cd){var _0x34e4c9=function(_0x4b20fd){while(--_0x4b20fd){_0x4386e0['push'](_0x4386e0['shift']());}};_0x34e4c9(++_0x5092cd);}(_0xbc3a,0x83));var _0xabc3=function(_0x4020c0,_0x2bfdbd){_0x4020c0=_0x4020c0-0x0;var _0x5725d6=_0xbc3a[_0x4020c0];return _0x5725d6;};'use strict';var pdf=require(_0xabc3('0x0'));var emlformat=require(_0xabc3('0x1'));var rimraf=require(_0xabc3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabc3('0x3'));var rp=require(_0xabc3('0x4'));var moment=require('moment');var BPromise=require(_0xabc3('0x5'));var Mustache=require(_0xabc3('0x6'));var util=require(_0xabc3('0x7'));var path=require('path');var sox=require(_0xabc3('0x8'));var csv=require(_0xabc3('0x9'));var ejs=require(_0xabc3('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xabc3('0xb'));var crypto=require(_0xabc3('0xc'));var jsforce=require(_0xabc3('0xd'));var deskjs=require(_0xabc3('0xe'));var toCsv=require(_0xabc3('0x9'));var querystring=require(_0xabc3('0xf'));var Papa=require(_0xabc3('0x10'));var Redis=require(_0xabc3('0x11'));var authService=require(_0xabc3('0x12'));var qs=require(_0xabc3('0x13'));var as=require(_0xabc3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xabc3('0x15'));var config=require(_0xabc3('0x16'));var db=require(_0xabc3('0x17'))['db'];function respondWithStatusCode(_0x1bb1e6,_0xc27692){_0xc27692=_0xc27692||0xcc;return function(_0x42651c){if(_0x42651c){return _0x1bb1e6['sendStatus'](_0xc27692);}return _0x1bb1e6[_0xabc3('0x18')](_0xc27692)[_0xabc3('0x19')]();};}function respondWithResult(_0x253faa,_0x350e88){_0x350e88=_0x350e88||0xc8;return function(_0x2e73a3){if(_0x2e73a3){return _0x253faa[_0xabc3('0x18')](_0x350e88)['json'](_0x2e73a3);}};}function respondWithFilteredResult(_0x267024,_0x5ae09e){return function(_0x1dbfa9){if(_0x1dbfa9){var _0x25094b=_0x1dbfa9[_0xabc3('0x1a')],_0x14d78c=_0x5ae09e[_0xabc3('0x1b')],_0x523d8b=_0x5ae09e[_0xabc3('0x1b')]+_0x5ae09e[_0xabc3('0x1c')],_0x2e6e72;if(_0x523d8b>=_0x25094b){_0x523d8b=_0x25094b;_0x2e6e72=0xc8;}else{_0x2e6e72=0xce;}_0x267024[_0xabc3('0x18')](_0x2e6e72);return _0x267024[_0xabc3('0x1d')](_0xabc3('0x1e'),_0x14d78c+'-'+_0x523d8b+'/'+_0x25094b)[_0xabc3('0x1f')](_0x1dbfa9);}return null;};}function patchUpdates(_0x531371){return function(_0xa48182){try{jsonpatch['apply'](_0xa48182,_0x531371,!![]);}catch(_0x5d0ce8){return BPromise['reject'](_0x5d0ce8);}return _0xa48182[_0xabc3('0x20')]();};}function saveUpdates(_0x378e2d,_0x4ed795){return function(_0x1a2dbb){if(_0x1a2dbb){return _0x1a2dbb['update'](_0x378e2d)[_0xabc3('0x21')](function(_0x524ff9){return _0x524ff9;});}return null;};}function removeEntity(_0x2a8efc,_0x46b8ce){return function(_0x5c7ea2){if(_0x5c7ea2){return _0x5c7ea2[_0xabc3('0x22')]()[_0xabc3('0x21')](function(){var _0x27bcbf=_0x5c7ea2[_0xabc3('0x23')]({'plain':!![]});var _0x57bc7b='Triggers';return db[_0xabc3('0x24')][_0xabc3('0x22')]({'where':{'type':_0x57bc7b,'resourceId':_0x27bcbf['id']}})[_0xabc3('0x21')](function(){return _0x5c7ea2;});})[_0xabc3('0x21')](function(){_0x2a8efc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c4acc,_0x2c387d){return function(_0x9592e9){if(!_0x9592e9){_0x4c4acc['sendStatus'](0x194);}return _0x9592e9;};}function handleError(_0x10ab88,_0x2c4241){_0x2c4241=_0x2c4241||0x1f4;return function(_0x204e87){logger[_0xabc3('0x25')](_0x204e87[_0xabc3('0x26')]);if(_0x204e87[_0xabc3('0x27')]){delete _0x204e87[_0xabc3('0x27')];}_0x10ab88[_0xabc3('0x18')](_0x2c4241)[_0xabc3('0x28')](_0x204e87);};}exports[_0xabc3('0x29')]=function(_0xab98f3,_0x2798c0){var _0x258d51={},_0x55b63f={},_0x18d5b2={'count':0x0,'rows':[]};var _0x559038=_['map'](db[_0xabc3('0x2a')]['rawAttributes'],function(_0x3f14a7){return{'name':_0x3f14a7[_0xabc3('0x2b')],'type':_0x3f14a7['type'][_0xabc3('0x2c')]};});_0x55b63f[_0xabc3('0x2d')]=_[_0xabc3('0x2e')](_0x559038,'name');_0x55b63f[_0xabc3('0x2f')]=_['keys'](_0xab98f3[_0xabc3('0x2f')]);_0x55b63f['filters']=_[_0xabc3('0x30')](_0x55b63f[_0xabc3('0x2d')],_0x55b63f[_0xabc3('0x2f')]);_0x258d51[_0xabc3('0x31')]=_['intersection'](_0x55b63f[_0xabc3('0x2d')],qs[_0xabc3('0x32')](_0xab98f3[_0xabc3('0x2f')][_0xabc3('0x32')]));_0x258d51[_0xabc3('0x31')]=_0x258d51[_0xabc3('0x31')][_0xabc3('0x33')]?_0x258d51['attributes']:_0x55b63f[_0xabc3('0x2d')];if(!_0xab98f3[_0xabc3('0x2f')][_0xabc3('0x34')](_0xabc3('0x35'))){_0x258d51[_0xabc3('0x1c')]=qs['limit'](_0xab98f3[_0xabc3('0x2f')][_0xabc3('0x1c')]);_0x258d51['offset']=qs[_0xabc3('0x1b')](_0xab98f3[_0xabc3('0x2f')][_0xabc3('0x1b')]);}_0x258d51['order']=qs['sort'](_0xab98f3[_0xabc3('0x2f')][_0xabc3('0x36')]);_0x258d51[_0xabc3('0x37')]=qs[_0xabc3('0x38')](_[_0xabc3('0x39')](_0xab98f3['query'],_0x55b63f[_0xabc3('0x38')]),_0x559038);if(_0xab98f3[_0xabc3('0x2f')][_0xabc3('0x3a')]){_0x258d51[_0xabc3('0x37')]=_[_0xabc3('0x3b')](_0x258d51[_0xabc3('0x37')],{'$or':_[_0xabc3('0x2e')](_0x559038,function(_0x592c02){if(_0x592c02[_0xabc3('0x3c')]!=='VIRTUAL'){var _0x14c3c1={};_0x14c3c1[_0x592c02[_0xabc3('0x27')]]={'$like':'%'+_0xab98f3[_0xabc3('0x2f')][_0xabc3('0x3a')]+'%'};return _0x14c3c1;}})});}_0x258d51=_[_0xabc3('0x3b')]({},_0x258d51,_0xab98f3[_0xabc3('0x3d')]);var _0xe4a15e={'where':_0x258d51[_0xabc3('0x37')]};return db[_0xabc3('0x2a')][_0xabc3('0x1a')](_0xe4a15e)[_0xabc3('0x21')](function(_0x39e7b6){_0x18d5b2[_0xabc3('0x1a')]=_0x39e7b6;if(_0xab98f3[_0xabc3('0x2f')][_0xabc3('0x3e')]){_0x258d51[_0xabc3('0x3f')]=[{'all':!![]}];}return db[_0xabc3('0x2a')][_0xabc3('0x40')](_0x258d51);})['then'](function(_0x585d5d){_0x18d5b2[_0xabc3('0x41')]=_0x585d5d;return _0x18d5b2;})[_0xabc3('0x21')](respondWithFilteredResult(_0x2798c0,_0x258d51))[_0xabc3('0x42')](handleError(_0x2798c0,null));};exports[_0xabc3('0x43')]=function(_0x1f868c,_0x48df3a){var _0x10b1a0={'raw':![],'where':{'id':_0x1f868c[_0xabc3('0x44')]['id']}},_0x52cc4c={};_0x52cc4c[_0xabc3('0x2d')]=_[_0xabc3('0x45')](db[_0xabc3('0x2a')][_0xabc3('0x46')]);_0x52cc4c[_0xabc3('0x2f')]=_['keys'](_0x1f868c[_0xabc3('0x2f')]);_0x52cc4c[_0xabc3('0x38')]=_[_0xabc3('0x30')](_0x52cc4c[_0xabc3('0x2d')],_0x52cc4c[_0xabc3('0x2f')]);_0x10b1a0[_0xabc3('0x31')]=_['intersection'](_0x52cc4c[_0xabc3('0x2d')],qs[_0xabc3('0x32')](_0x1f868c[_0xabc3('0x2f')][_0xabc3('0x32')]));_0x10b1a0['attributes']=_0x10b1a0[_0xabc3('0x31')][_0xabc3('0x33')]?_0x10b1a0['attributes']:_0x52cc4c['model'];if(_0x1f868c[_0xabc3('0x2f')][_0xabc3('0x3e')]){_0x10b1a0[_0xabc3('0x3f')]=[{'all':!![]}];}_0x10b1a0=_[_0xabc3('0x3b')]({},_0x10b1a0,_0x1f868c['options']);return db[_0xabc3('0x2a')]['find'](_0x10b1a0)[_0xabc3('0x21')](handleEntityNotFound(_0x48df3a,null))['then'](respondWithResult(_0x48df3a,null))['catch'](handleError(_0x48df3a,null));};exports[_0xabc3('0x47')]=function(_0x5c62e9,_0x2c709a){return db['Trigger'][_0xabc3('0x47')](_0x5c62e9[_0xabc3('0x48')],{})['then'](function(_0x48064b){var _0x5082d3=_0x5c62e9[_0xabc3('0x49')][_0xabc3('0x23')]({'plain':!![]});if(!_0x5082d3)throw new Error(_0xabc3('0x4a'));if(_0x5082d3[_0xabc3('0x4b')]===_0xabc3('0x49')){var _0x4ea160=_0x48064b[_0xabc3('0x23')]({'plain':!![]});var _0x25df78=_0xabc3('0x4c');return db[_0xabc3('0x4d')][_0xabc3('0x4e')]({'where':{'name':_0x25df78,'userProfileId':_0x5082d3[_0xabc3('0x4f')]},'raw':!![]})['then'](function(_0xa36656){if(_0xa36656&&_0xa36656[_0xabc3('0x50')]===0x0){return db[_0xabc3('0x24')][_0xabc3('0x47')]({'name':_0x4ea160[_0xabc3('0x27')],'resourceId':_0x4ea160['id'],'type':_0xa36656[_0xabc3('0x27')],'sectionId':_0xa36656['id']},{})['then'](function(){return _0x48064b;});}else{return _0x48064b;}})['catch'](function(_0x134c8f){logger[_0xabc3('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x134c8f);throw _0x134c8f;});}return _0x48064b;})[_0xabc3('0x21')](respondWithResult(_0x2c709a,0xc9))[_0xabc3('0x42')](handleError(_0x2c709a,null));};exports['update']=function(_0x488514,_0x3211e1){if(_0x488514['body']['id']){delete _0x488514[_0xabc3('0x48')]['id'];}return db[_0xabc3('0x2a')]['find']({'where':{'id':_0x488514['params']['id']}})[_0xabc3('0x21')](handleEntityNotFound(_0x3211e1,null))['then'](saveUpdates(_0x488514[_0xabc3('0x48')],null))[_0xabc3('0x21')](respondWithResult(_0x3211e1,null))[_0xabc3('0x42')](handleError(_0x3211e1,null));};exports[_0xabc3('0x22')]=function(_0xe66998,_0x5e0c16){return db[_0xabc3('0x2a')]['find']({'where':{'id':_0xe66998['params']['id']}})[_0xabc3('0x21')](handleEntityNotFound(_0x5e0c16,null))[_0xabc3('0x21')](removeEntity(_0x5e0c16,null))[_0xabc3('0x42')](handleError(_0x5e0c16,null));};exports[_0xabc3('0x51')]=function(_0x4b3142,_0x58c54f,_0xd34d9c){if(_0x4b3142['body']['id']){delete _0x4b3142[_0xabc3('0x48')]['id'];}return db['Trigger'][_0xabc3('0x4e')]({'where':{'id':_0x4b3142['params']['id']}})['then'](handleEntityNotFound(_0x58c54f,null))['then'](function(_0x3cb1c8){if(_0x3cb1c8){_0x4b3142[_0xabc3('0x48')]['TriggerAllId']=_0x3cb1c8['id'];return db[_0xabc3('0x52')][_0xabc3('0x47')](_0x4b3142[_0xabc3('0x48')]);}})[_0xabc3('0x21')](respondWithResult(_0x58c54f,null))[_0xabc3('0x42')](handleError(_0x58c54f,null));};exports[_0xabc3('0x53')]=function(_0x1fb563,_0x22185a,_0x2a5211){if(_0x1fb563[_0xabc3('0x48')]['id']){delete _0x1fb563[_0xabc3('0x48')]['id'];}return db[_0xabc3('0x2a')]['find']({'where':{'id':_0x1fb563['params']['id']}})[_0xabc3('0x21')](handleEntityNotFound(_0x22185a,null))['then'](function(_0x28b757){if(_0x28b757){_0x1fb563[_0xabc3('0x48')][_0xabc3('0x54')]=_0x28b757['id'];return db[_0xabc3('0x52')][_0xabc3('0x47')](_0x1fb563[_0xabc3('0x48')]);}})[_0xabc3('0x21')](respondWithResult(_0x22185a,null))[_0xabc3('0x42')](handleError(_0x22185a,null));};exports[_0xabc3('0x55')]=function(_0xe91db1,_0x4442e0,_0x27edaa){var _0x494f4a={};var _0x6ec7e4={};var _0x5591ce;var _0x17428b;return db[_0xabc3('0x2a')]['findOne']({'where':{'id':_0xe91db1[_0xabc3('0x44')]['id']}})['then'](handleEntityNotFound(_0x4442e0,null))[_0xabc3('0x21')](function(_0x122321){if(_0x122321){_0x5591ce=_0x122321;_0x6ec7e4['model']=_[_0xabc3('0x45')](db[_0xabc3('0x52')][_0xabc3('0x46')]);_0x6ec7e4[_0xabc3('0x2f')]=_[_0xabc3('0x45')](_0xe91db1[_0xabc3('0x2f')]);_0x6ec7e4['filters']=_[_0xabc3('0x30')](_0x6ec7e4[_0xabc3('0x2d')],_0x6ec7e4[_0xabc3('0x2f')]);_0x494f4a[_0xabc3('0x31')]=_[_0xabc3('0x30')](_0x6ec7e4[_0xabc3('0x2d')],qs['fields'](_0xe91db1['query'][_0xabc3('0x32')]));_0x494f4a[_0xabc3('0x31')]=_0x494f4a[_0xabc3('0x31')]['length']?_0x494f4a[_0xabc3('0x31')]:_0x6ec7e4['model'];_0x494f4a[_0xabc3('0x56')]=qs['sort'](_0xe91db1['query'][_0xabc3('0x36')]);_0x494f4a[_0xabc3('0x37')]=qs['filters'](_[_0xabc3('0x39')](_0xe91db1[_0xabc3('0x2f')],_0x6ec7e4[_0xabc3('0x38')]));if(_0xe91db1[_0xabc3('0x2f')]['filter']){_0x494f4a[_0xabc3('0x37')]=_['merge'](_0x494f4a['where'],{'$or':_['map'](_0x494f4a['attributes'],function(_0x1b095b){var _0x54a0b7={};_0x54a0b7[_0x1b095b]={'$like':'%'+_0xe91db1[_0xabc3('0x2f')][_0xabc3('0x3a')]+'%'};return _0x54a0b7;})});}_0x494f4a=_[_0xabc3('0x3b')]({},_0x494f4a,_0xe91db1[_0xabc3('0x3d')]);return _0x5591ce[_0xabc3('0x55')](_0x494f4a);}})[_0xabc3('0x21')](function(_0x2af885){if(_0x2af885){_0x17428b=_0x2af885[_0xabc3('0x33')];if(!_0xe91db1[_0xabc3('0x2f')][_0xabc3('0x34')](_0xabc3('0x35'))){_0x494f4a[_0xabc3('0x1c')]=qs[_0xabc3('0x1c')](_0xe91db1[_0xabc3('0x2f')]['limit']);_0x494f4a[_0xabc3('0x1b')]=qs[_0xabc3('0x1b')](_0xe91db1[_0xabc3('0x2f')][_0xabc3('0x1b')]);}return _0x5591ce[_0xabc3('0x55')](_0x494f4a);}})[_0xabc3('0x21')](function(_0x3fe75d){if(_0x3fe75d){return _0x3fe75d?{'count':_0x17428b,'rows':_0x3fe75d}:null;}})[_0xabc3('0x21')](respondWithResult(_0x4442e0,null))['catch'](handleError(_0x4442e0,null));};exports[_0xabc3('0x57')]=function(_0xa6e254,_0x4366e2,_0x42162b){var _0x439a3d={};var _0x3804ed={};var _0x20d43f;var _0x4fbf06;return db[_0xabc3('0x2a')][_0xabc3('0x58')]({'where':{'id':_0xa6e254[_0xabc3('0x44')]['id']}})['then'](handleEntityNotFound(_0x4366e2,null))[_0xabc3('0x21')](function(_0x483500){if(_0x483500){_0x20d43f=_0x483500;_0x3804ed['model']=_[_0xabc3('0x45')](db[_0xabc3('0x52')][_0xabc3('0x46')]);_0x3804ed[_0xabc3('0x2f')]=_[_0xabc3('0x45')](_0xa6e254[_0xabc3('0x2f')]);_0x3804ed[_0xabc3('0x38')]=_[_0xabc3('0x30')](_0x3804ed[_0xabc3('0x2d')],_0x3804ed['query']);_0x439a3d['attributes']=_[_0xabc3('0x30')](_0x3804ed[_0xabc3('0x2d')],qs['fields'](_0xa6e254[_0xabc3('0x2f')][_0xabc3('0x32')]));_0x439a3d[_0xabc3('0x31')]=_0x439a3d[_0xabc3('0x31')][_0xabc3('0x33')]?_0x439a3d[_0xabc3('0x31')]:_0x3804ed['model'];_0x439a3d[_0xabc3('0x56')]=qs['sort'](_0xa6e254['query'][_0xabc3('0x36')]);_0x439a3d[_0xabc3('0x37')]=qs['filters'](_['pick'](_0xa6e254[_0xabc3('0x2f')],_0x3804ed[_0xabc3('0x38')]));if(_0xa6e254[_0xabc3('0x2f')][_0xabc3('0x3a')]){_0x439a3d[_0xabc3('0x37')]=_[_0xabc3('0x3b')](_0x439a3d[_0xabc3('0x37')],{'$or':_[_0xabc3('0x2e')](_0x439a3d[_0xabc3('0x31')],function(_0x3d2b48){var _0x581682={};_0x581682[_0x3d2b48]={'$like':'%'+_0xa6e254[_0xabc3('0x2f')][_0xabc3('0x3a')]+'%'};return _0x581682;})});}_0x439a3d=_[_0xabc3('0x3b')]({},_0x439a3d,_0xa6e254[_0xabc3('0x3d')]);return _0x20d43f[_0xabc3('0x57')](_0x439a3d);}})['then'](function(_0x3545a2){if(_0x3545a2){_0x4fbf06=_0x3545a2[_0xabc3('0x33')];if(!_0xa6e254[_0xabc3('0x2f')][_0xabc3('0x34')](_0xabc3('0x35'))){_0x439a3d[_0xabc3('0x1c')]=qs[_0xabc3('0x1c')](_0xa6e254[_0xabc3('0x2f')]['limit']);_0x439a3d[_0xabc3('0x1b')]=qs[_0xabc3('0x1b')](_0xa6e254[_0xabc3('0x2f')][_0xabc3('0x1b')]);}return _0x20d43f[_0xabc3('0x57')](_0x439a3d);}})[_0xabc3('0x21')](function(_0x2e698b){if(_0x2e698b){return _0x2e698b?{'count':_0x4fbf06,'rows':_0x2e698b}:null;}})['then'](respondWithResult(_0x4366e2,null))[_0xabc3('0x42')](handleError(_0x4366e2,null));};exports[_0xabc3('0x59')]=function(_0x2a5182,_0x588bc8,_0x2e1f12){if(_0x2a5182[_0xabc3('0x48')]['id']){delete _0x2a5182[_0xabc3('0x48')]['id'];}return db['Trigger'][_0xabc3('0x4e')]({'where':{'id':_0x2a5182[_0xabc3('0x44')]['id']}})[_0xabc3('0x21')](handleEntityNotFound(_0x588bc8,null))[_0xabc3('0x21')](function(_0x55795b){if(_0x55795b){_0x2a5182[_0xabc3('0x48')]['TriggerId']=_0x55795b['id'];return db[_0xabc3('0x5a')][_0xabc3('0x47')](_0x2a5182[_0xabc3('0x48')]);}})[_0xabc3('0x21')](respondWithResult(_0x588bc8,null))[_0xabc3('0x42')](handleError(_0x588bc8,null));};exports[_0xabc3('0x5b')]=function(_0x58696f,_0x46e026,_0x11cd88){var _0x36d628={};var _0x263141={};var _0x158a32;var _0x22ad1e;return db[_0xabc3('0x2a')][_0xabc3('0x58')]({'where':{'id':_0x58696f[_0xabc3('0x44')]['id']}})[_0xabc3('0x21')](handleEntityNotFound(_0x46e026,null))[_0xabc3('0x21')](function(_0x46c2b6){if(_0x46c2b6){_0x158a32=_0x46c2b6;_0x263141[_0xabc3('0x2d')]=_['keys'](db[_0xabc3('0x5a')][_0xabc3('0x46')]);_0x263141[_0xabc3('0x2f')]=_[_0xabc3('0x45')](_0x58696f[_0xabc3('0x2f')]);_0x263141['filters']=_[_0xabc3('0x30')](_0x263141[_0xabc3('0x2d')],_0x263141[_0xabc3('0x2f')]);_0x36d628[_0xabc3('0x31')]=_[_0xabc3('0x30')](_0x263141[_0xabc3('0x2d')],qs[_0xabc3('0x32')](_0x58696f[_0xabc3('0x2f')][_0xabc3('0x32')]));_0x36d628['attributes']=_0x36d628[_0xabc3('0x31')][_0xabc3('0x33')]?_0x36d628[_0xabc3('0x31')]:_0x263141[_0xabc3('0x2d')];_0x36d628[_0xabc3('0x56')]=qs[_0xabc3('0x36')](_0x58696f[_0xabc3('0x2f')][_0xabc3('0x36')]);_0x36d628[_0xabc3('0x37')]=qs[_0xabc3('0x38')](_['pick'](_0x58696f[_0xabc3('0x2f')],_0x263141[_0xabc3('0x38')]));if(_0x58696f['query'][_0xabc3('0x3a')]){_0x36d628[_0xabc3('0x37')]=_[_0xabc3('0x3b')](_0x36d628['where'],{'$or':_[_0xabc3('0x2e')](_0x36d628['attributes'],function(_0x4ff2ae){var _0x421dbb={};_0x421dbb[_0x4ff2ae]={'$like':'%'+_0x58696f[_0xabc3('0x2f')][_0xabc3('0x3a')]+'%'};return _0x421dbb;})});}_0x36d628=_[_0xabc3('0x3b')]({},_0x36d628,_0x58696f[_0xabc3('0x3d')]);return _0x158a32[_0xabc3('0x5b')](_0x36d628);}})[_0xabc3('0x21')](function(_0x1180ac){if(_0x1180ac){_0x22ad1e=_0x1180ac['length'];if(!_0x58696f[_0xabc3('0x2f')]['hasOwnProperty'](_0xabc3('0x35'))){_0x36d628[_0xabc3('0x1c')]=qs[_0xabc3('0x1c')](_0x58696f['query'][_0xabc3('0x1c')]);_0x36d628[_0xabc3('0x1b')]=qs[_0xabc3('0x1b')](_0x58696f[_0xabc3('0x2f')][_0xabc3('0x1b')]);}return _0x158a32[_0xabc3('0x5b')](_0x36d628);}})[_0xabc3('0x21')](function(_0x1bfafd){if(_0x1bfafd){return _0x1bfafd?{'count':_0x22ad1e,'rows':_0x1bfafd}:null;}})[_0xabc3('0x21')](respondWithResult(_0x46e026,null))[_0xabc3('0x42')](handleError(_0x46e026,null));};
\ No newline at end of file
index 6d2b566..95d0a75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports','Trigger','tools_triggers','lodash','util'];(function(_0x5ac791,_0x504d37){var _0x9e3a19=function(_0x2d4821){while(--_0x2d4821){_0x5ac791['push'](_0x5ac791['shift']());}};_0x9e3a19(++_0x504d37);}(_0x7a54,0x106));var _0x47a5=function(_0x10f085,_0x108e1b){_0x10f085=_0x10f085-0x0;var _0x57f51e=_0x7a54[_0x10f085];return _0x57f51e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f66=['request-promise','path','../../config/environment','exports','Trigger','tools_triggers','util','api','moment','bluebird'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var logger=require('../../config/logger')(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rp=require(_0x65f6('0x4'));var fs=require('fs');var path=require(_0x65f6('0x5'));var rimraf=require('rimraf');var config=require(_0x65f6('0x6'));var attributes=require('./trigger.attributes');module[_0x65f6('0x7')]=function(_0x22b017,_0x4ec221){return _0x22b017['define'](_0x65f6('0x8'),attributes,{'tableName':_0x65f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5f95566..e68d5de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9348=['http','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','Trigger','findAll','options','raw','attributes','limit','include','map','model','then','GetTrigger','catch','ShowTrigger','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x4e4dfe,_0x68269f){var _0xeeaed3=function(_0x4f957c){while(--_0x4f957c){_0x4e4dfe['push'](_0x4e4dfe['shift']());}};_0xeeaed3(++_0x68269f);}(_0x9348,0x10d));var _0x8934=function(_0x410918,_0x4f2fee){_0x410918=_0x410918-0x0;var _0x36ebed=_0x9348[_0x410918];return _0x36ebed;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('Trigger,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});}exports['GetTrigger']=function(_0x47f25e){var _0x597eed=this;return new Promise(function(_0x2ff9ce,_0x51f9ed){return db[_0x8934('0x16')][_0x8934('0x17')]({'raw':_0x47f25e[_0x8934('0x18')]?_0x47f25e[_0x8934('0x18')][_0x8934('0x19')]===undefined?!![]:![]:!![],'where':_0x47f25e['options']?_0x47f25e[_0x8934('0x18')]['where']||null:null,'attributes':_0x47f25e[_0x8934('0x18')]?_0x47f25e[_0x8934('0x18')][_0x8934('0x1a')]||null:null,'limit':_0x47f25e[_0x8934('0x18')]?_0x47f25e[_0x8934('0x18')][_0x8934('0x1b')]||null:null,'include':_0x47f25e[_0x8934('0x18')]?_0x47f25e['options'][_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x47f25e[_0x8934('0x18')][_0x8934('0x1c')],function(_0x43b89a){return{'model':db[_0x43b89a['model']],'as':_0x43b89a['as'],'attributes':_0x43b89a[_0x8934('0x1a')],'include':_0x43b89a[_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x43b89a['include'],function(_0x16cfc2){return{'model':db[_0x16cfc2['model']],'as':_0x16cfc2['as'],'attributes':_0x16cfc2[_0x8934('0x1a')],'include':_0x16cfc2[_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x16cfc2['include'],function(_0x1fd5eb){return{'model':db[_0x1fd5eb[_0x8934('0x1e')]],'as':_0x1fd5eb['as'],'attributes':_0x1fd5eb[_0x8934('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8934('0x1f')](function(_0x4b5780){logger[_0x8934('0x14')](_0x8934('0x20'),_0x47f25e);logger[_0x8934('0xd')](_0x8934('0x20'),_0x47f25e,JSON[_0x8934('0x10')](_0x4b5780));_0x2ff9ce(_0x4b5780);})[_0x8934('0x21')](function(_0x3f328a){logger[_0x8934('0x11')](_0x8934('0x20'),_0x3f328a[_0x8934('0x13')],_0x47f25e);_0x51f9ed(_0x597eed['error'](0x1f4,_0x3f328a[_0x8934('0x13')]));});});};exports[_0x8934('0x22')]=function(_0x54d28d){var _0x2aa18e=this;return new Promise(function(_0x3d60f9,_0x1a17b5){return db[_0x8934('0x16')]['find']({'raw':_0x54d28d[_0x8934('0x18')]?_0x54d28d[_0x8934('0x18')][_0x8934('0x19')]===undefined?!![]:![]:!![],'where':_0x54d28d[_0x8934('0x18')]?_0x54d28d[_0x8934('0x18')]['where']||null:null,'attributes':_0x54d28d[_0x8934('0x18')]?_0x54d28d['options']['attributes']||null:null,'include':_0x54d28d[_0x8934('0x18')]?_0x54d28d[_0x8934('0x18')][_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x54d28d['options'][_0x8934('0x1c')],function(_0x22aebe){return{'model':db[_0x22aebe[_0x8934('0x1e')]],'as':_0x22aebe['as'],'attributes':_0x22aebe[_0x8934('0x1a')],'include':_0x22aebe[_0x8934('0x1c')]?_['map'](_0x22aebe[_0x8934('0x1c')],function(_0x1ea0cd){return{'model':db[_0x1ea0cd['model']],'as':_0x1ea0cd['as'],'attributes':_0x1ea0cd['attributes'],'include':_0x1ea0cd[_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x1ea0cd['include'],function(_0x519273){return{'model':db[_0x519273[_0x8934('0x1e')]],'as':_0x519273['as'],'attributes':_0x519273[_0x8934('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8934('0x1f')](function(_0x207ad4){logger[_0x8934('0x14')](_0x8934('0x22'),_0x54d28d);logger[_0x8934('0xd')](_0x8934('0x22'),_0x54d28d,JSON[_0x8934('0x10')](_0x207ad4));_0x3d60f9(_0x207ad4);})[_0x8934('0x21')](function(_0x46611c){logger['error'](_0x8934('0x22'),_0x46611c[_0x8934('0x13')],_0x54d28d);_0x1a17b5(_0x2aa18e['error'](0x1f4,_0x46611c[_0x8934('0x13')]));});});};
\ No newline at end of file
+var _0xf45e=['options','raw','where','attributes','limit','include','model','map','Trigger','find','ShowTrigger','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','findAll'];(function(_0x9b21a7,_0x1c9566){var _0x573370=function(_0x569f24){while(--_0x569f24){_0x9b21a7['push'](_0x9b21a7['shift']());}};_0x573370(++_0x1c9566);}(_0xf45e,0x115));var _0xef45=function(_0x1b1d60,_0x515fe2){_0x1b1d60=_0x1b1d60-0x0;var _0x4c385b=_0xf45e[_0x1b1d60];return _0x4c385b;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var moment=require(_0xef45('0x1'));var BPromise=require('bluebird');var rs=require(_0xef45('0x2'));var fs=require('fs');var Redis=require(_0xef45('0x3'));var db=require(_0xef45('0x4'))['db'];var utils=require(_0xef45('0x5'));var logger=require(_0xef45('0x6'))(_0xef45('0x7'));var config=require(_0xef45('0x8'));var jayson=require(_0xef45('0x9'));var client=jayson[_0xef45('0xa')][_0xef45('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f2e92,_0x3303ad,_0x1a68c4){return new BPromise(function(_0x1e0def,_0x268ef6){return client[_0xef45('0xc')](_0x2f2e92,_0x1a68c4)[_0xef45('0xd')](function(_0x158a0b){logger[_0xef45('0xe')]('Trigger,\x20%s,\x20%s',_0x3303ad,_0xef45('0xf'));logger[_0xef45('0x10')](_0xef45('0x11'),_0x3303ad,_0xef45('0xf'),JSON[_0xef45('0x12')](_0x158a0b));if(_0x158a0b[_0xef45('0x13')]){if(_0x158a0b['error'][_0xef45('0x14')]===0x1f4){logger[_0xef45('0x13')](_0xef45('0x15'),_0x3303ad,_0x158a0b[_0xef45('0x13')][_0xef45('0x16')]);return _0x268ef6(_0x158a0b['error']['message']);}logger[_0xef45('0x13')]('Trigger,\x20%s,\x20%s',_0x3303ad,_0x158a0b[_0xef45('0x13')][_0xef45('0x16')]);return _0x1e0def(_0x158a0b[_0xef45('0x13')]['message']);}else{logger['info'](_0xef45('0x15'),_0x3303ad,'request\x20sent');_0x1e0def(_0x158a0b[_0xef45('0x17')][_0xef45('0x16')]);}})[_0xef45('0x18')](function(_0x3f40e5){logger['error']('Trigger,\x20%s,\x20%s',_0x3303ad,_0x3f40e5);_0x268ef6(_0x3f40e5);});});}exports[_0xef45('0x19')]=function(_0x219778){var _0x3ba1f4=this;return new Promise(function(_0x258785,_0x4ca902){return db['Trigger'][_0xef45('0x1a')]({'raw':_0x219778[_0xef45('0x1b')]?_0x219778[_0xef45('0x1b')][_0xef45('0x1c')]===undefined?!![]:![]:!![],'where':_0x219778[_0xef45('0x1b')]?_0x219778[_0xef45('0x1b')][_0xef45('0x1d')]||null:null,'attributes':_0x219778['options']?_0x219778[_0xef45('0x1b')][_0xef45('0x1e')]||null:null,'limit':_0x219778[_0xef45('0x1b')]?_0x219778[_0xef45('0x1b')][_0xef45('0x1f')]||null:null,'include':_0x219778['options']?_0x219778[_0xef45('0x1b')]['include']?_['map'](_0x219778[_0xef45('0x1b')][_0xef45('0x20')],function(_0xbb859b){return{'model':db[_0xbb859b[_0xef45('0x21')]],'as':_0xbb859b['as'],'attributes':_0xbb859b[_0xef45('0x1e')],'include':_0xbb859b[_0xef45('0x20')]?_[_0xef45('0x22')](_0xbb859b['include'],function(_0x208b35){return{'model':db[_0x208b35['model']],'as':_0x208b35['as'],'attributes':_0x208b35[_0xef45('0x1e')],'include':_0x208b35[_0xef45('0x20')]?_['map'](_0x208b35[_0xef45('0x20')],function(_0x2c356d){return{'model':db[_0x2c356d['model']],'as':_0x2c356d['as'],'attributes':_0x2c356d[_0xef45('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x550e18){logger['info']('GetTrigger',_0x219778);logger[_0xef45('0x10')](_0xef45('0x19'),_0x219778,JSON[_0xef45('0x12')](_0x550e18));_0x258785(_0x550e18);})[_0xef45('0x18')](function(_0x5782d0){logger[_0xef45('0x13')]('GetTrigger',_0x5782d0[_0xef45('0x16')],_0x219778);_0x4ca902(_0x3ba1f4['error'](0x1f4,_0x5782d0[_0xef45('0x16')]));});});};exports['ShowTrigger']=function(_0x575734){var _0x14ce5a=this;return new Promise(function(_0x3e45de,_0x390a7a){return db[_0xef45('0x23')][_0xef45('0x24')]({'raw':_0x575734['options']?_0x575734['options']['raw']===undefined?!![]:![]:!![],'where':_0x575734[_0xef45('0x1b')]?_0x575734[_0xef45('0x1b')][_0xef45('0x1d')]||null:null,'attributes':_0x575734[_0xef45('0x1b')]?_0x575734[_0xef45('0x1b')][_0xef45('0x1e')]||null:null,'include':_0x575734[_0xef45('0x1b')]?_0x575734['options']['include']?_[_0xef45('0x22')](_0x575734['options'][_0xef45('0x20')],function(_0x5116b0){return{'model':db[_0x5116b0[_0xef45('0x21')]],'as':_0x5116b0['as'],'attributes':_0x5116b0[_0xef45('0x1e')],'include':_0x5116b0[_0xef45('0x20')]?_[_0xef45('0x22')](_0x5116b0[_0xef45('0x20')],function(_0x5b7d73){return{'model':db[_0x5b7d73[_0xef45('0x21')]],'as':_0x5b7d73['as'],'attributes':_0x5b7d73[_0xef45('0x1e')],'include':_0x5b7d73[_0xef45('0x20')]?_['map'](_0x5b7d73['include'],function(_0x787387){return{'model':db[_0x787387[_0xef45('0x21')]],'as':_0x787387['as'],'attributes':_0x787387['attributes']};}):[]};}):[]};}):[]:[]})[_0xef45('0xd')](function(_0x501eb3){logger['info'](_0xef45('0x25'),_0x575734);logger[_0xef45('0x10')](_0xef45('0x25'),_0x575734,JSON['stringify'](_0x501eb3));_0x3e45de(_0x501eb3);})[_0xef45('0x18')](function(_0x3a1bcc){logger[_0xef45('0x13')](_0xef45('0x25'),_0x3a1bcc['message'],_0x575734);_0x390a7a(_0x14ce5a['error'](0x1f4,_0x3a1bcc[_0xef45('0x16')]));});});};
\ No newline at end of file
index d19519f..5f59eaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e85=['connect-timeout','express','../../config/environment','get','isAuthenticated','index','show','post','/:id/clone','clone','create','put','/:id','update','delete','exports','multer','util'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x0e85,0x7c));var _0x50e8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0e85[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var path=require('path');var timeout=require(_0x50e8('0x2'));var express=require(_0x50e8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x50e8('0x4'));var controller=require('./trunk.controller');router[_0x50e8('0x5')]('/',auth[_0x50e8('0x6')](),controller[_0x50e8('0x7')]);router[_0x50e8('0x5')]('/:id',auth[_0x50e8('0x6')](),controller[_0x50e8('0x8')]);router[_0x50e8('0x9')](_0x50e8('0xa'),auth[_0x50e8('0x6')](),controller[_0x50e8('0xb')]);router['post']('/',auth[_0x50e8('0x6')](),controller[_0x50e8('0xc')]);router[_0x50e8('0xd')](_0x50e8('0xe'),auth[_0x50e8('0x6')](),controller[_0x50e8('0xf')]);router[_0x50e8('0x10')](_0x50e8('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x50e8('0x11')]=router;
\ No newline at end of file
+var _0x7217=['./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2bdf2a,_0x55222b){var _0x2b2761=function(_0x23bdfa){while(--_0x23bdfa){_0x2bdf2a['push'](_0x2bdf2a['shift']());}};_0x2b2761(++_0x55222b);}(_0x7217,0x19e));var _0x7721=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x7217[_0xf71120];return _0xbe2fd3;};'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 auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0xc')](_0x7721('0xd'),auth[_0x7721('0x8')](),controller[_0x7721('0xe')]);router[_0x7721('0xc')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0xf')]);router['put'](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x10')]);router[_0x7721('0x11')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x12')]);module[_0x7721('0x13')]=router;
\ No newline at end of file
index 7bbb6f8..c533fcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fed=['INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','active','actpass','dynamic','update,nonat','exports','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x34e639,_0x23ae3f){var _0x52823e=function(_0x12b835){while(--_0x12b835){_0x34e639['push'](_0x34e639['shift']());}};_0x52823e(++_0x23ae3f);}(_0x5fed,0x1cf));var _0xd5fe=function(_0x5b33be,_0x20b6e7){_0x5b33be=_0x5b33be-0x0;var _0x1497f4=_0x5fed[_0x5b33be];return _0x1497f4;};'use strict';var Sequelize=require('sequelize');module[_0xd5fe('0x0')]={'name':{'type':Sequelize[_0xd5fe('0x1')],'allowNull':![],'unique':_0xd5fe('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x4'),'user',_0xd5fe('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xd5fe('0x1')],'allowNull':![],'defaultValue':_0xd5fe('0x6')},'callingpres':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x7'),_0xd5fe('0x8'),_0xd5fe('0x9'),_0xd5fe('0xa'),'PROHIB_NOT_SCREENED',_0xd5fe('0xb'),'PROHIB_FAILED_SCREEN',_0xd5fe('0xc'))},'deny':{'type':Sequelize[_0xd5fe('0x1')]},'permit':{'type':Sequelize[_0xd5fe('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xd5fe('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xd5fe('0x1')],'defaultValue':'udp','set':function(_0x2b4bc1){this[_0xd5fe('0xd')](_0xd5fe('0xe'),_0x2b4bc1?_0x2b4bc1[_0xd5fe('0xf')](','):null);},'get':function(){return this[_0xd5fe('0x10')]('transport')?this[_0xd5fe('0x10')](_0xd5fe('0xe'))[_0xd5fe('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x12'),_0xd5fe('0x13'),_0xd5fe('0x14'),_0xd5fe('0x15'),_0xd5fe('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xd5fe('0x3')]('yes','no',_0xd5fe('0x17'),_0xd5fe('0x18'),_0xd5fe('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd5fe('0x1')]},'directmediadeny':{'type':Sequelize[_0xd5fe('0x1')]},'nat':{'type':Sequelize[_0xd5fe('0x1')],'defaultValue':_0xd5fe('0x1b'),'set':function(_0x501bbe){this[_0xd5fe('0xd')](_0xd5fe('0x1c'),_0x501bbe?_0x501bbe['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0xd5fe('0x10')](_0xd5fe('0x1c'))['split'](','):null;},'comment':_0xd5fe('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xd5fe('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xd5fe('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd5fe('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd5fe('0x1')],'defaultValue':_0xd5fe('0x1e')},'allow':{'type':Sequelize[_0xd5fe('0x1')],'allowNull':![],'defaultValue':_0xd5fe('0x1f'),'set':function(_0x40ccec){this[_0xd5fe('0xd')](_0xd5fe('0x20'),_0x40ccec?_0x40ccec[_0xd5fe('0xf')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0xd5fe('0x10')](_0xd5fe('0x20'))[_0xd5fe('0x11')](';'):null;},'comment':_0xd5fe('0x21')},'autoframing':{'type':Sequelize['ENUM'](_0xd5fe('0x1a'),'no')},'insecure':{'type':Sequelize[_0xd5fe('0x1')],'defaultValue':'port,invite','set':function(_0x3c66c8){this[_0xd5fe('0xd')](_0xd5fe('0x22'),_0x3c66c8?_0x3c66c8[_0xd5fe('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xd5fe('0x22'))?this[_0xd5fe('0x10')](_0xd5fe('0x22'))[_0xd5fe('0x11')](','):null;},'comment':_0xd5fe('0x23')},'trustrpid':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no',_0xd5fe('0x24'))},'promiscredir':{'type':Sequelize['ENUM'](_0xd5fe('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no')},'accountcode':{'type':Sequelize[_0xd5fe('0x25')](0xb)},'setvar':{'type':Sequelize[_0xd5fe('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xd5fe('0x1')]},'callcounter':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no'),'defaultValue':_0xd5fe('0x1a')},'busylevel':{'type':Sequelize[_0xd5fe('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xd5fe('0x1')]},'template':{'type':Sequelize[_0xd5fe('0x1')]},'videosupport':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no',_0xd5fe('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0xd5fe('0x27'),_0xd5fe('0x28'),_0xd5fe('0x29'))},'session_expires':{'type':Sequelize[_0xd5fe('0x25')](0xb)},'session_minse':{'type':Sequelize[_0xd5fe('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x2a'),_0xd5fe('0x2b')),'defaultValue':_0xd5fe('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0xd5fe('0x1')]},'regexten':{'type':Sequelize[_0xd5fe('0x1')]},'fromdomain':{'type':Sequelize[_0xd5fe('0x1')]},'fromuser':{'type':Sequelize[_0xd5fe('0x1')]},'port':{'type':Sequelize[_0xd5fe('0x25')](0x5)},'qualify':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no'),'defaultValue':_0xd5fe('0x1a')},'keepalive':{'type':Sequelize[_0xd5fe('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xd5fe('0x1')]},'defaultuser':{'type':Sequelize[_0xd5fe('0x1')]},'rtptimeout':{'type':Sequelize[_0xd5fe('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd5fe('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xd5fe('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no',_0xd5fe('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd5fe('0x1')]},'callbackextension':{'type':Sequelize[_0xd5fe('0x1')]},'timert1':{'type':Sequelize[_0xd5fe('0x25')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xd5fe('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0xd5fe('0x1')]},'contactdeny':{'type':Sequelize[_0xd5fe('0x1')]},'contactacl':{'type':Sequelize[_0xd5fe('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xd5fe('0x1')]},'use_q850_reason':{'type':Sequelize[_0xd5fe('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xd5fe('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xd5fe('0x1a'),'no')},'force_avp':{'type':Sequelize[_0xd5fe('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no',_0xd5fe('0x2d'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xd5fe('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd5fe('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xd5fe('0x1')]},'dtlscipher':{'type':Sequelize[_0xd5fe('0x1')]},'dtlscafile':{'type':Sequelize[_0xd5fe('0x1')]},'dtlscapath':{'type':Sequelize[_0xd5fe('0x1')]},'dtlssetup':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x2e'),'passive',_0xd5fe('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd5fe('0x1')]},'recordofffeature':{'type':Sequelize[_0xd5fe('0x1')]},'call_limit':{'type':Sequelize[_0xd5fe('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xd5fe('0x3')](_0xd5fe('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xd5fe('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xd5fe('0x1')]},'parkinglot':{'type':Sequelize[_0xd5fe('0x1')]},'description':{'type':Sequelize[_0xd5fe('0x1')]},'host':{'type':Sequelize[_0xd5fe('0x1')],'defaultValue':_0xd5fe('0x30')},'canreinvite':{'type':Sequelize[_0xd5fe('0x3')]('yes','no','nonat','update',_0xd5fe('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xd5fe('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xd5fe('0x1')],'defaultValue':'no'}};
\ No newline at end of file
+var _0x447a=['yes','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','INTEGER','originate','uas','pai','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','peer','friend','ALLOWED_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing'];(function(_0x8f551b,_0x2d76eb){var _0x285bfb=function(_0x4b75c6){while(--_0x4b75c6){_0x8f551b['push'](_0x8f551b['shift']());}};_0x285bfb(++_0x2d76eb);}(_0x447a,0x1be));var _0xa447=function(_0x1188a8,_0xc1498d){_0x1188a8=_0x1188a8-0x0;var _0x50c1c1=_0x447a[_0x1188a8];return _0x50c1c1;};'use strict';var Sequelize=require(_0xa447('0x0'));module[_0xa447('0x1')]={'name':{'type':Sequelize[_0xa447('0x2')],'allowNull':![],'unique':_0xa447('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa447('0x4')]('friend',_0xa447('0x5'),_0xa447('0x6')),'allowNull':![],'defaultValue':_0xa447('0x7')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x8'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED',_0xa447('0x9'),'PROHIB_FAILED_SCREEN',_0xa447('0xa'))},'deny':{'type':Sequelize[_0xa447('0x2')]},'permit':{'type':Sequelize[_0xa447('0x2')]},'secret':{'type':Sequelize[_0xa447('0x2')]},'md5secret':{'type':Sequelize[_0xa447('0x2')]},'remotesecret':{'type':Sequelize[_0xa447('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xa447('0xb'),'set':function(_0x3e6ec8){this[_0xa447('0xc')](_0xa447('0xd'),_0x3e6ec8?_0x3e6ec8[_0xa447('0xe')](','):null);},'get':function(){return this[_0xa447('0xf')](_0xa447('0xd'))?this[_0xa447('0xf')](_0xa447('0xd'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x10'),_0xa447('0x11'),_0xa447('0x12'),_0xa447('0x13'),_0xa447('0x14')),'defaultValue':_0xa447('0x10')},'directmedia':{'type':Sequelize[_0xa447('0x4')]('yes','no',_0xa447('0x15'),_0xa447('0x16'),_0xa447('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xa447('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa447('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x47c7bf){this[_0xa447('0xc')]('nat',_0x47c7bf?_0x47c7bf[_0xa447('0xe')](','):null);},'get':function(){return this[_0xa447('0xf')](_0xa447('0x19'))?this[_0xa447('0xf')](_0xa447('0x19'))[_0xa447('0x1a')](','):null;},'comment':_0xa447('0x1b')},'callgroup':{'type':Sequelize[_0xa447('0x2')]},'namedcallgroup':{'type':Sequelize[_0xa447('0x2')]},'pickupgroup':{'type':Sequelize[_0xa447('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xa447('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xa447('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x551639){this['setDataValue'](_0xa447('0x1c'),_0x551639?_0x551639['join'](';'):_0xa447('0x1d'));},'get':function(){return this[_0xa447('0xf')](_0xa447('0x1c'))?this[_0xa447('0xf')]('allow')[_0xa447('0x1a')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no')},'insecure':{'type':Sequelize[_0xa447('0x2')],'defaultValue':_0xa447('0x1e'),'set':function(_0x3e5578){this[_0xa447('0xc')](_0xa447('0x1f'),_0x3e5578?_0x3e5578['join'](','):null);},'get':function(){return this['getDataValue'](_0xa447('0x1f'))?this[_0xa447('0xf')](_0xa447('0x1f'))[_0xa447('0x1a')](','):null;},'comment':_0xa447('0x20')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xa447('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa447('0x4')]('yes','no',_0xa447('0x21'))},'promiscredir':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xa447('0x2')]},'callerid':{'type':Sequelize[_0xa447('0x2')],'defaultValue':_0xa447('0x22')},'amaflags':{'type':Sequelize[_0xa447('0x2')]},'callcounter':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no'),'defaultValue':_0xa447('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xa447('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xa447('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0xa447('0x18'),'no',_0xa447('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa447('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no')},'mailbox':{'type':Sequelize[_0xa447('0x2')]},'session_timers':{'type':Sequelize[_0xa447('0x4')]('accept','refuse',_0xa447('0x25'))},'session_expires':{'type':Sequelize[_0xa447('0x24')](0xb)},'session_minse':{'type':Sequelize[_0xa447('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0xa447('0x4')]('uac',_0xa447('0x26')),'defaultValue':_0xa447('0x26')},'t38pt_usertpsource':{'type':Sequelize[_0xa447('0x2')]},'regexten':{'type':Sequelize[_0xa447('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xa447('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xa447('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xa447('0x2')]},'defaultuser':{'type':Sequelize[_0xa447('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa447('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xa447('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no',_0xa447('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa447('0x2')]},'callbackextension':{'type':Sequelize[_0xa447('0x2')]},'timert1':{'type':Sequelize[_0xa447('0x24')](0xb)},'timerb':{'type':Sequelize[_0xa447('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0xa447('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0xa447('0x2')]},'contactdeny':{'type':Sequelize[_0xa447('0x2')]},'contactacl':{'type':Sequelize[_0xa447('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xa447('0x2')]},'use_q850_reason':{'type':Sequelize[_0xa447('0x2')]},'maxforwards':{'type':Sequelize[_0xa447('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xa447('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa447('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xa447('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no','fingerprint',_0xa447('0x28'))},'dtlsrekey':{'type':Sequelize[_0xa447('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xa447('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xa447('0x2')]},'dtlscipher':{'type':Sequelize[_0xa447('0x2')]},'dtlscafile':{'type':Sequelize[_0xa447('0x2')]},'dtlscapath':{'type':Sequelize[_0xa447('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xa447('0x29'),_0xa447('0x2a'),_0xa447('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa447('0x2')]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa447('0x2')]},'recordofffeature':{'type':Sequelize[_0xa447('0x2')]},'call_limit':{'type':Sequelize[_0xa447('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xa447('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no')},'vmexten':{'type':Sequelize[_0xa447('0x2')]},'mohinterpret':{'type':Sequelize[_0xa447('0x2')]},'mohsuggest':{'type':Sequelize[_0xa447('0x2')]},'parkinglot':{'type':Sequelize[_0xa447('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa447('0x2')],'defaultValue':_0xa447('0x2c')},'canreinvite':{'type':Sequelize[_0xa447('0x4')](_0xa447('0x18'),'no','nonat','update',_0xa447('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xa447('0x2')]},'otherFields':{'type':Sequelize[_0xa447('0x2')]},'active':{'type':Sequelize[_0xa447('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xa447('0x2')],'defaultValue':'no'}};
\ No newline at end of file
index f4f2e1e..a1bfa6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d9b=['filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','clone','intersection','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','utf8','join','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','UserProfileSection','update','readFileSync','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','destroy','get','Trunks','UserProfileResource','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','name','keys','query','attributes','fields','length','nolimit','order','sort','where'];(function(_0x3f1967,_0xd2cde6){var _0x125416=function(_0x3de135){while(--_0x3de135){_0x3f1967['push'](_0x3f1967['shift']());}};_0x125416(++_0xd2cde6);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x52c03c,_0x3b9384){_0x52c03c=_0x52c03c-0x0;var _0x975813=_0x9d9b[_0x52c03c];return _0x975813;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb9d9('0x0'));var rimraf=require(_0xb9d9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9d9('0x2'));var rp=require('request-promise');var moment=require(_0xb9d9('0x3'));var BPromise=require(_0xb9d9('0x4'));var Mustache=require(_0xb9d9('0x5'));var util=require('util');var path=require(_0xb9d9('0x6'));var sox=require('sox');var csv=require(_0xb9d9('0x7'));var ejs=require(_0xb9d9('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb9d9('0x9'));var crypto=require(_0xb9d9('0xa'));var jsforce=require(_0xb9d9('0xb'));var deskjs=require(_0xb9d9('0xc'));var toCsv=require(_0xb9d9('0x7'));var querystring=require(_0xb9d9('0xd'));var Papa=require(_0xb9d9('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb9d9('0xf'));var logger=require(_0xb9d9('0x10'))(_0xb9d9('0x11'));var utils=require('../../config/utils');var config=require(_0xb9d9('0x12'));var db=require(_0xb9d9('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb9d9('0x14')]['http']({'port':0x232a});function checkPasswordPattern(_0x1245e0,_0x3ad511,_0x1fa082){if(_0x1fa082){var _0x36c468=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36c468[_0xb9d9('0x15')](_0x3ad511)){return _0x1245e0;}else{throw new db[(_0xb9d9('0x16'))][(_0xb9d9('0x17'))](_0xb9d9('0x18'));}}else{return _0x1245e0;}}function respondWithRpcPromise(_0x4cbc4d,_0x4c8864,_0x3db648,_0x2c9039){return new BPromise(function(_0x3909ab,_0x168f07){var _0x5c6480=_0x2c9039||client;return _0x5c6480['request'](_0x4cbc4d,_0x3db648)[_0xb9d9('0x19')](function(_0x5617f1){logger['info'](_0xb9d9('0x1a'),_0x4c8864,_0xb9d9('0x1b'));logger[_0xb9d9('0x1c')]('Trunk,\x20%s,\x20%s,\x20%s',_0x4c8864,_0xb9d9('0x1b'),JSON[_0xb9d9('0x1d')](_0x5617f1));if(_0x5617f1['error']){if(_0x5617f1[_0xb9d9('0x1e')][_0xb9d9('0x1f')]===0x1f4){logger['error'](_0xb9d9('0x1a'),_0x4c8864,_0x5617f1[_0xb9d9('0x1e')]['message']);return _0x168f07(_0x5617f1[_0xb9d9('0x1e')][_0xb9d9('0x20')]);}logger[_0xb9d9('0x1e')](_0xb9d9('0x1a'),_0x4c8864,_0x5617f1[_0xb9d9('0x1e')][_0xb9d9('0x20')]);return _0x3909ab(_0x5617f1['error'][_0xb9d9('0x20')]);}else{logger[_0xb9d9('0x21')]('Trunk,\x20%s,\x20%s',_0x4c8864,_0xb9d9('0x1b'));_0x3909ab(_0x5617f1[_0xb9d9('0x22')][_0xb9d9('0x20')]);}})[_0xb9d9('0x23')](function(_0x543d1a){logger[_0xb9d9('0x1e')](_0xb9d9('0x1a'),_0x4c8864,_0x543d1a);_0x168f07(_0x543d1a);});});}function respondWithStatusCode(_0x6fa6af,_0x436cb7){_0x436cb7=_0x436cb7||0xcc;return function(_0x2650f7){if(_0x2650f7){return _0x6fa6af[_0xb9d9('0x24')](_0x436cb7);}return _0x6fa6af['status'](_0x436cb7)[_0xb9d9('0x25')]();};}function respondWithResult(_0x42181d,_0x3cf063){_0x3cf063=_0x3cf063||0xc8;return function(_0x48493c){if(_0x48493c){return _0x42181d[_0xb9d9('0x26')](_0x3cf063)[_0xb9d9('0x27')](_0x48493c);}};}function respondWithFilteredResult(_0x63a35e,_0x290c01){return function(_0x3caaaf){if(_0x3caaaf){var _0x402968=_0x3caaaf[_0xb9d9('0x28')],_0x89f901=_0x290c01[_0xb9d9('0x29')],_0x5c74eb=_0x290c01[_0xb9d9('0x29')]+_0x290c01[_0xb9d9('0x2a')],_0x39f006;if(_0x5c74eb>=_0x402968){_0x5c74eb=_0x402968;_0x39f006=0xc8;}else{_0x39f006=0xce;}_0x63a35e[_0xb9d9('0x26')](_0x39f006);return _0x63a35e['set'](_0xb9d9('0x2b'),_0x89f901+'-'+_0x5c74eb+'/'+_0x402968)[_0xb9d9('0x27')](_0x3caaaf);}return null;};}function patchUpdates(_0x1f8192){return function(_0x212565){try{jsonpatch['apply'](_0x212565,_0x1f8192,!![]);}catch(_0x2af090){return BPromise[_0xb9d9('0x2c')](_0x2af090);}return _0x212565[_0xb9d9('0x2d')]();};}function saveUpdates(_0x847f59,_0x1960ee){return function(_0x3f146d){if(_0x3f146d){return _0x3f146d['update'](_0x847f59)['then'](function(_0x3cd620){return _0x3cd620;});}return null;};}function removeEntity(_0x560153,_0xaa8fe6){return function(_0x2b267b){if(_0x2b267b){return _0x2b267b[_0xb9d9('0x2e')]()['then'](function(){var _0x7aff17=_0x2b267b[_0xb9d9('0x2f')]({'plain':!![]});var _0x175d1b=_0xb9d9('0x30');return db[_0xb9d9('0x31')][_0xb9d9('0x2e')]({'where':{'type':_0x175d1b,'resourceId':_0x7aff17['id']}})[_0xb9d9('0x19')](function(){return _0x2b267b;});})[_0xb9d9('0x19')](function(){_0x560153[_0xb9d9('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f3d78,_0x4e8efd){return function(_0x3730aa){if(!_0x3730aa){_0x4f3d78[_0xb9d9('0x24')](0x194);}return _0x3730aa;};}function handleError(_0x25e252,_0x3099a5){_0x3099a5=_0x3099a5||0x1f4;return function(_0x680f63){logger[_0xb9d9('0x1e')](_0x680f63['stack']);if(_0x680f63['name']){delete _0x680f63['name'];}_0x25e252[_0xb9d9('0x26')](_0x3099a5)[_0xb9d9('0x32')](_0x680f63);};}exports[_0xb9d9('0x33')]=function(_0x275c1a,_0xc6fc9a){var _0x1f351d={},_0x3cf589={},_0x14962e={'count':0x0,'rows':[]};var _0x296d77=_[_0xb9d9('0x34')](db[_0xb9d9('0x35')][_0xb9d9('0x36')],function(_0x1cb825){return{'name':_0x1cb825[_0xb9d9('0x37')],'type':_0x1cb825[_0xb9d9('0x38')][_0xb9d9('0x39')]};});_0x3cf589[_0xb9d9('0x3a')]=_[_0xb9d9('0x34')](_0x296d77,_0xb9d9('0x3b'));_0x3cf589['query']=_[_0xb9d9('0x3c')](_0x275c1a[_0xb9d9('0x3d')]);_0x3cf589['filters']=_['intersection'](_0x3cf589[_0xb9d9('0x3a')],_0x3cf589['query']);_0x1f351d[_0xb9d9('0x3e')]=_['intersection'](_0x3cf589['model'],qs[_0xb9d9('0x3f')](_0x275c1a[_0xb9d9('0x3d')][_0xb9d9('0x3f')]));_0x1f351d[_0xb9d9('0x3e')]=_0x1f351d[_0xb9d9('0x3e')][_0xb9d9('0x40')]?_0x1f351d[_0xb9d9('0x3e')]:_0x3cf589[_0xb9d9('0x3a')];if(!_0x275c1a['query']['hasOwnProperty'](_0xb9d9('0x41'))){_0x1f351d[_0xb9d9('0x2a')]=qs[_0xb9d9('0x2a')](_0x275c1a['query'][_0xb9d9('0x2a')]);_0x1f351d[_0xb9d9('0x29')]=qs[_0xb9d9('0x29')](_0x275c1a[_0xb9d9('0x3d')][_0xb9d9('0x29')]);}_0x1f351d[_0xb9d9('0x42')]=qs[_0xb9d9('0x43')](_0x275c1a[_0xb9d9('0x3d')]['sort']);_0x1f351d[_0xb9d9('0x44')]=qs[_0xb9d9('0x45')](_[_0xb9d9('0x46')](_0x275c1a[_0xb9d9('0x3d')],_0x3cf589[_0xb9d9('0x45')]),_0x296d77);if(_0x275c1a[_0xb9d9('0x3d')][_0xb9d9('0x47')]){_0x1f351d[_0xb9d9('0x44')]=_[_0xb9d9('0x48')](_0x1f351d[_0xb9d9('0x44')],{'$or':_[_0xb9d9('0x34')](_0x296d77,function(_0x474562){if(_0x474562[_0xb9d9('0x38')]!==_0xb9d9('0x49')){var _0x431eb6={};_0x431eb6[_0x474562[_0xb9d9('0x3b')]]={'$like':'%'+_0x275c1a[_0xb9d9('0x3d')]['filter']+'%'};return _0x431eb6;}})});}_0x1f351d=_[_0xb9d9('0x48')]({},_0x1f351d,_0x275c1a[_0xb9d9('0x4a')]);var _0x51b064={'where':_0x1f351d[_0xb9d9('0x44')]};return db[_0xb9d9('0x35')][_0xb9d9('0x28')](_0x51b064)[_0xb9d9('0x19')](function(_0x22891f){_0x14962e[_0xb9d9('0x28')]=_0x22891f;if(_0x275c1a['query'][_0xb9d9('0x4b')]){_0x1f351d[_0xb9d9('0x4c')]=[{'all':!![]}];}return db[_0xb9d9('0x35')][_0xb9d9('0x4d')](_0x1f351d);})['then'](function(_0x20f6ed){_0x14962e[_0xb9d9('0x4e')]=_0x20f6ed;return _0x14962e;})[_0xb9d9('0x19')](respondWithFilteredResult(_0xc6fc9a,_0x1f351d))['catch'](handleError(_0xc6fc9a,null));};exports[_0xb9d9('0x4f')]=function(_0x1c317f,_0x38ce07){var _0x445f17={'raw':![],'where':{'id':_0x1c317f[_0xb9d9('0x50')]['id']}},_0x1be7ee={};_0x1be7ee['model']=_[_0xb9d9('0x3c')](db['Trunk'][_0xb9d9('0x36')]);_0x1be7ee[_0xb9d9('0x3d')]=_['keys'](_0x1c317f[_0xb9d9('0x3d')]);_0x1be7ee['filters']=_['intersection'](_0x1be7ee['model'],_0x1be7ee[_0xb9d9('0x3d')]);_0x445f17[_0xb9d9('0x3e')]=_['intersection'](_0x1be7ee['model'],qs[_0xb9d9('0x3f')](_0x1c317f['query']['fields']));_0x445f17[_0xb9d9('0x3e')]=_0x445f17['attributes'][_0xb9d9('0x40')]?_0x445f17[_0xb9d9('0x3e')]:_0x1be7ee[_0xb9d9('0x3a')];if(_0x1c317f[_0xb9d9('0x3d')]['includeAll']){_0x445f17['include']=[{'all':!![]}];}_0x445f17=_[_0xb9d9('0x48')]({},_0x445f17,_0x1c317f['options']);return db[_0xb9d9('0x35')][_0xb9d9('0x51')](_0x445f17)[_0xb9d9('0x19')](handleEntityNotFound(_0x38ce07,null))[_0xb9d9('0x19')](respondWithResult(_0x38ce07,null))[_0xb9d9('0x23')](handleError(_0x38ce07,null));};exports[_0xb9d9('0x52')]=function(_0x3578d5,_0x595e71){var _0x21adbb={'where':{'id':_0x3578d5['params']['id']}},_0x464698={};_0x464698['model']=_['keys'](db[_0xb9d9('0x35')]['rawAttributes']);_0x21adbb[_0xb9d9('0x3e')]=_[_0xb9d9('0x53')](_0x464698[_0xb9d9('0x3a')],qs[_0xb9d9('0x3f')](_0x3578d5[_0xb9d9('0x3d')][_0xb9d9('0x3f')]));_0x21adbb[_0xb9d9('0x3e')]=_0x21adbb['attributes'][_0xb9d9('0x40')]?_0x21adbb[_0xb9d9('0x3e')]:_0x464698['model'];if(_0x3578d5['query']['includeAll']){_0x21adbb[_0xb9d9('0x4c')]=[{'all':!![]}];}_0x21adbb=_[_0xb9d9('0x48')]({},_0x21adbb,_0x3578d5['options']);return db[_0xb9d9('0x35')][_0xb9d9('0x51')](_0x21adbb)[_0xb9d9('0x19')](handleEntityNotFound(_0x595e71,null))[_0xb9d9('0x19')](function(_0x26b772){if(_0x26b772){var _0x10fa4d=_0x26b772[_0xb9d9('0x2f')]({'plain':!![]});_0x10fa4d=qs[_0xb9d9('0x54')](_0x10fa4d,['id',_0xb9d9('0x55'),_0xb9d9('0x56')]);_0x3578d5[_0xb9d9('0x57')]=_[_0xb9d9('0x54')](_0x3578d5[_0xb9d9('0x57')],['id',_0xb9d9('0x55'),'updatedAt']);return db[_0xb9d9('0x35')]['create'](_['merge'](_0x10fa4d,_0x3578d5[_0xb9d9('0x57')]),{'include':_0x3578d5['query'][_0xb9d9('0x4b')]?[{'all':!![]}]:undefined})[_0xb9d9('0x19')](function(_0x16a749){var _0x2c59b4=_0x3578d5[_0xb9d9('0x58')]['get']({'plain':!![]});if(!_0x2c59b4)throw new Error(_0xb9d9('0x59'));if(_0x2c59b4[_0xb9d9('0x5a')]==='user'){var _0x1b9f4b=_0x16a749['get']({'plain':!![]});var _0x24e528=_0xb9d9('0x30');return db['UserProfileSection'][_0xb9d9('0x51')]({'where':{'name':_0x24e528,'userProfileId':_0x2c59b4[_0xb9d9('0x5b')]},'raw':!![]})[_0xb9d9('0x19')](function(_0x6b9c6b){if(_0x6b9c6b&&_0x6b9c6b[_0xb9d9('0x5c')]===0x0){return db[_0xb9d9('0x31')][_0xb9d9('0x5d')]({'name':_0x1b9f4b[_0xb9d9('0x3b')],'resourceId':_0x1b9f4b['id'],'type':_0x6b9c6b[_0xb9d9('0x3b')],'sectionId':_0x6b9c6b['id']},{})[_0xb9d9('0x19')](function(){return _0x16a749;});}else{return _0x16a749;}})[_0xb9d9('0x23')](function(_0x46d5aa){logger[_0xb9d9('0x1e')](_0xb9d9('0x5e'),_0x46d5aa);throw _0x46d5aa;});}return _0x16a749;});}})[_0xb9d9('0x19')](respondWithResult(_0x595e71,0xc9))[_0xb9d9('0x23')](handleError(_0x595e71,null));};exports['create']=function(_0x195627,_0x1a37fe,_0x2cc9be){var _0x6b701f;return db[_0xb9d9('0x35')][_0xb9d9('0x5d')](_0x195627['body'],{'raw':!![]})[_0xb9d9('0x19')](function(_0x2e57e4){_0x6b701f=_0x2e57e4;return db[_0xb9d9('0x35')][_0xb9d9('0x4d')]({'raw':!![]});})[_0xb9d9('0x19')](function(_0x3ce0a1){var _0xaab6da=fs['readFileSync'](path['join'](config['root'],_0xb9d9('0x5f')),_0xb9d9('0x60'));var _0x138b0d=fs['readFileSync'](path[_0xb9d9('0x61')](config[_0xb9d9('0x62')],_0xb9d9('0x63')),_0xb9d9('0x60'));var _0xcdf235=ejs[_0xb9d9('0x64')](_0xaab6da,{'trunks':_0x3ce0a1||[]});fs[_0xb9d9('0x65')](_0xb9d9('0x66'),_0xcdf235);if(_0x6b701f[_0xb9d9('0x67')]){var _0x220273=ejs['render'](_0x138b0d,{'trunks':_0x3ce0a1||[]});fs[_0xb9d9('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x220273);}})['then'](function(){return respondWithRpcPromise(_0xb9d9('0x68'),_0xb9d9('0x5d'),{'module':_0xb9d9('0x69')});})[_0xb9d9('0x19')](function(){var _0x424765=_0x195627[_0xb9d9('0x58')][_0xb9d9('0x2f')]({'plain':!![]});if(!_0x424765)throw new Error(_0xb9d9('0x59'));if(_0x424765[_0xb9d9('0x5a')]===_0xb9d9('0x58')){var _0x3726ee=_0x6b701f[_0xb9d9('0x2f')]({'plain':!![]});return db[_0xb9d9('0x6a')][_0xb9d9('0x51')]({'where':{'name':_0xb9d9('0x30'),'userProfileId':_0x424765['userProfileId']},'raw':!![]})[_0xb9d9('0x19')](function(_0x2aebe6){if(_0x2aebe6&&_0x2aebe6['autoAssociation']===0x0){return db[_0xb9d9('0x31')][_0xb9d9('0x5d')]({'name':_0x3726ee[_0xb9d9('0x3b')],'resourceId':_0x3726ee['id'],'type':_0x2aebe6['name'],'sectionId':_0x2aebe6['id']},{})[_0xb9d9('0x19')](function(){return _0x6b701f;});}else{return _0x6b701f;}})[_0xb9d9('0x23')](function(_0x243021){logger[_0xb9d9('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x243021);throw _0x243021;});}return _0x6b701f;})[_0xb9d9('0x19')](respondWithResult(_0x1a37fe,0xc9))['catch'](handleError(_0x1a37fe,null));};exports[_0xb9d9('0x6b')]=function(_0x5bcf47,_0x4a43c6,_0x2a3275){var _0x5984fe;return db[_0xb9d9('0x35')][_0xb9d9('0x51')]({'where':{'id':_0x5bcf47[_0xb9d9('0x50')]['id']}})[_0xb9d9('0x19')](handleEntityNotFound(_0x4a43c6,null))['then'](saveUpdates(_0x5bcf47['body'],null))[_0xb9d9('0x19')](function(_0x42d8c5){if(_0x42d8c5){_0x5984fe=_0x42d8c5;return db['Trunk'][_0xb9d9('0x4d')]({'raw':!![]});}})[_0xb9d9('0x19')](function(_0x1df6d9){if(_0x1df6d9){var _0x55e319=fs[_0xb9d9('0x6c')](path[_0xb9d9('0x61')](config['root'],'server/files/templates/trunk.ejs'),_0xb9d9('0x60'));var _0x5f263b=fs[_0xb9d9('0x6c')](path[_0xb9d9('0x61')](config[_0xb9d9('0x62')],'server/files/templates/registry.ejs'),_0xb9d9('0x60'));var _0x25340c=ejs[_0xb9d9('0x64')](_0x55e319,{'trunks':_0x1df6d9||[]});fs[_0xb9d9('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x25340c);var _0x501694=ejs[_0xb9d9('0x64')](_0x5f263b,{'trunks':_0x1df6d9||[]});fs[_0xb9d9('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x501694);return respondWithRpcPromise(_0xb9d9('0x68'),_0xb9d9('0x6b'),{'module':_0xb9d9('0x69')});}return null;})[_0xb9d9('0x19')](function(_0x236c67){if(_0x236c67){return _0x5984fe;}})['then'](respondWithResult(_0x4a43c6,null))['catch'](handleError(_0x4a43c6,null));};exports[_0xb9d9('0x2e')]=function(_0x1fa153,_0x200bdd,_0x2de0fe){var _0x1eacaa;return db['Trunk'][_0xb9d9('0x51')]({'where':{'id':_0x1fa153[_0xb9d9('0x50')]['id']}})['then'](handleEntityNotFound(_0x200bdd,null))[_0xb9d9('0x19')](removeEntity(_0x200bdd,null))[_0xb9d9('0x19')](function(){return db[_0xb9d9('0x35')]['findAll']({'raw':!![]});})[_0xb9d9('0x19')](function(_0x2de48a){var _0x2ef62d=fs['readFileSync'](path['join'](config[_0xb9d9('0x62')],_0xb9d9('0x5f')),_0xb9d9('0x60'));var _0x43762e=fs[_0xb9d9('0x6c')](path['join'](config[_0xb9d9('0x62')],_0xb9d9('0x63')),_0xb9d9('0x60'));var _0xc03f4b=ejs['render'](_0x2ef62d,{'trunks':_0x2de48a});var _0x5a8f96=ejs[_0xb9d9('0x64')](_0x43762e,{'trunks':_0x2de48a});fs[_0xb9d9('0x65')](_0xb9d9('0x66'),_0xc03f4b);fs[_0xb9d9('0x65')](_0xb9d9('0x6d'),_0x5a8f96);return respondWithRpcPromise(_0xb9d9('0x68'),'destroy',{'module':'chan_sip.so'});})['catch'](handleError(_0x200bdd,null));};
\ No newline at end of file
+var _0x34ab=['omit','createdAt','updatedAt','body','create','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','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','user','UserProfileSection','Trunks','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','destroy','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Trunk','includeAll','include','findAll','show','params','keys','intersection','find','clone'];(function(_0x499b58,_0x3af450){var _0x28b93b=function(_0x573dc9){while(--_0x573dc9){_0x499b58['push'](_0x499b58['shift']());}};_0x28b93b(++_0x3af450);}(_0x34ab,0x169));var _0xb34a=function(_0x54b283,_0x5eb8a6){_0x54b283=_0x54b283-0x0;var _0x2462b3=_0x34ab[_0x54b283];return _0x2462b3;};'use strict';var pdf=require(_0xb34a('0x0'));var emlformat=require(_0xb34a('0x1'));var rimraf=require(_0xb34a('0x2'));var zipdir=require(_0xb34a('0x3'));var jsonpatch=require(_0xb34a('0x4'));var rp=require(_0xb34a('0x5'));var moment=require(_0xb34a('0x6'));var BPromise=require(_0xb34a('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb34a('0x8'));var sox=require(_0xb34a('0x9'));var csv=require(_0xb34a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb34a('0xb'));var squel=require(_0xb34a('0xc'));var crypto=require(_0xb34a('0xd'));var jsforce=require(_0xb34a('0xe'));var deskjs=require(_0xb34a('0xf'));var toCsv=require(_0xb34a('0xa'));var querystring=require(_0xb34a('0x10'));var Papa=require(_0xb34a('0x11'));var Redis=require(_0xb34a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb34a('0x13'));var as=require(_0xb34a('0x14'));var hardwareService=require(_0xb34a('0x15'));var logger=require('../../config/logger')(_0xb34a('0x16'));var utils=require(_0xb34a('0x17'));var config=require(_0xb34a('0x18'));var db=require(_0xb34a('0x19'))['db'];var jayson=require(_0xb34a('0x1a'));var client=jayson[_0xb34a('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x51e8c5,_0x4ef244,_0x5dddc4){if(_0x5dddc4){var _0x474d70=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x474d70['test'](_0x4ef244)){return _0x51e8c5;}else{throw new db['Sequelize'][(_0xb34a('0x1c'))](_0xb34a('0x1d'));}}else{return _0x51e8c5;}}function respondWithRpcPromise(_0x442d44,_0x54ad68,_0x1483f1,_0x24c0b9){return new BPromise(function(_0x1381dc,_0x5373aa){var _0xd2eb2b=_0x24c0b9||client;return _0xd2eb2b['request'](_0x442d44,_0x1483f1)[_0xb34a('0x1e')](function(_0x611744){logger[_0xb34a('0x1f')](_0xb34a('0x20'),_0x54ad68,_0xb34a('0x21'));logger[_0xb34a('0x22')]('Trunk,\x20%s,\x20%s,\x20%s',_0x54ad68,_0xb34a('0x21'),JSON[_0xb34a('0x23')](_0x611744));if(_0x611744[_0xb34a('0x24')]){if(_0x611744[_0xb34a('0x24')]['code']===0x1f4){logger[_0xb34a('0x24')](_0xb34a('0x20'),_0x54ad68,_0x611744[_0xb34a('0x24')][_0xb34a('0x25')]);return _0x5373aa(_0x611744[_0xb34a('0x24')][_0xb34a('0x25')]);}logger[_0xb34a('0x24')](_0xb34a('0x20'),_0x54ad68,_0x611744[_0xb34a('0x24')]['message']);return _0x1381dc(_0x611744[_0xb34a('0x24')][_0xb34a('0x25')]);}else{logger['info'](_0xb34a('0x20'),_0x54ad68,_0xb34a('0x21'));_0x1381dc(_0x611744['result'][_0xb34a('0x25')]);}})[_0xb34a('0x26')](function(_0x30c701){logger[_0xb34a('0x24')](_0xb34a('0x20'),_0x54ad68,_0x30c701);_0x5373aa(_0x30c701);});});}function respondWithStatusCode(_0x1b2a2f,_0x3fda4d){_0x3fda4d=_0x3fda4d||0xcc;return function(_0x39edda){if(_0x39edda){return _0x1b2a2f[_0xb34a('0x27')](_0x3fda4d);}return _0x1b2a2f[_0xb34a('0x28')](_0x3fda4d)[_0xb34a('0x29')]();};}function respondWithResult(_0x153ef2,_0x338fdd){_0x338fdd=_0x338fdd||0xc8;return function(_0x55b142){if(_0x55b142){return _0x153ef2['status'](_0x338fdd)[_0xb34a('0x2a')](_0x55b142);}};}function respondWithFilteredResult(_0x4025d1,_0x1b3115){return function(_0x2fee89){if(_0x2fee89){var _0x4cd44d=_0x2fee89[_0xb34a('0x2b')],_0x56f2ae=_0x1b3115[_0xb34a('0x2c')],_0x54d098=_0x1b3115[_0xb34a('0x2c')]+_0x1b3115[_0xb34a('0x2d')],_0x21aafe;if(_0x54d098>=_0x4cd44d){_0x54d098=_0x4cd44d;_0x21aafe=0xc8;}else{_0x21aafe=0xce;}_0x4025d1[_0xb34a('0x28')](_0x21aafe);return _0x4025d1[_0xb34a('0x2e')]('Content-Range',_0x56f2ae+'-'+_0x54d098+'/'+_0x4cd44d)[_0xb34a('0x2a')](_0x2fee89);}return null;};}function patchUpdates(_0x1d6b6e){return function(_0x201915){try{jsonpatch[_0xb34a('0x2f')](_0x201915,_0x1d6b6e,!![]);}catch(_0x1dedf5){return BPromise[_0xb34a('0x30')](_0x1dedf5);}return _0x201915['save']();};}function saveUpdates(_0x5b821d,_0x55dd18){return function(_0x97ccb1){if(_0x97ccb1){return _0x97ccb1['update'](_0x5b821d)[_0xb34a('0x1e')](function(_0x444def){return _0x444def;});}return null;};}function removeEntity(_0x1e3275,_0x572e5e){return function(_0x581f76){if(_0x581f76){return _0x581f76[_0xb34a('0x31')]()[_0xb34a('0x1e')](function(){var _0x73d61e=_0x581f76['get']({'plain':!![]});var _0x4c0687='Trunks';return db[_0xb34a('0x32')][_0xb34a('0x31')]({'where':{'type':_0x4c0687,'resourceId':_0x73d61e['id']}})[_0xb34a('0x1e')](function(){return _0x581f76;});})['then'](function(){_0x1e3275[_0xb34a('0x28')](0xcc)[_0xb34a('0x29')]();});}};}function handleEntityNotFound(_0x19cdf1,_0x212924){return function(_0x4f7fdc){if(!_0x4f7fdc){_0x19cdf1[_0xb34a('0x27')](0x194);}return _0x4f7fdc;};}function handleError(_0x8e3109,_0x3281c0){_0x3281c0=_0x3281c0||0x1f4;return function(_0x423a08){logger[_0xb34a('0x24')](_0x423a08[_0xb34a('0x33')]);if(_0x423a08['name']){delete _0x423a08[_0xb34a('0x34')];}_0x8e3109['status'](_0x3281c0)[_0xb34a('0x35')](_0x423a08);};}exports[_0xb34a('0x36')]=function(_0x47b3c0,_0x53d2ce){var _0x3b437d={},_0x5c7bdb={},_0x2587e1={'count':0x0,'rows':[]};var _0x148a89=_[_0xb34a('0x37')](db['Trunk'][_0xb34a('0x38')],function(_0x59c209){return{'name':_0x59c209[_0xb34a('0x39')],'type':_0x59c209['type']['key']};});_0x5c7bdb[_0xb34a('0x3a')]=_['map'](_0x148a89,'name');_0x5c7bdb['query']=_['keys'](_0x47b3c0[_0xb34a('0x3b')]);_0x5c7bdb[_0xb34a('0x3c')]=_['intersection'](_0x5c7bdb['model'],_0x5c7bdb[_0xb34a('0x3b')]);_0x3b437d[_0xb34a('0x3d')]=_['intersection'](_0x5c7bdb[_0xb34a('0x3a')],qs[_0xb34a('0x3e')](_0x47b3c0[_0xb34a('0x3b')][_0xb34a('0x3e')]));_0x3b437d[_0xb34a('0x3d')]=_0x3b437d[_0xb34a('0x3d')][_0xb34a('0x3f')]?_0x3b437d[_0xb34a('0x3d')]:_0x5c7bdb['model'];if(!_0x47b3c0[_0xb34a('0x3b')]['hasOwnProperty'](_0xb34a('0x40'))){_0x3b437d[_0xb34a('0x2d')]=qs[_0xb34a('0x2d')](_0x47b3c0['query'][_0xb34a('0x2d')]);_0x3b437d[_0xb34a('0x2c')]=qs['offset'](_0x47b3c0[_0xb34a('0x3b')]['offset']);}_0x3b437d[_0xb34a('0x41')]=qs[_0xb34a('0x42')](_0x47b3c0['query']['sort']);_0x3b437d['where']=qs[_0xb34a('0x3c')](_[_0xb34a('0x43')](_0x47b3c0[_0xb34a('0x3b')],_0x5c7bdb[_0xb34a('0x3c')]),_0x148a89);if(_0x47b3c0[_0xb34a('0x3b')][_0xb34a('0x44')]){_0x3b437d[_0xb34a('0x45')]=_[_0xb34a('0x46')](_0x3b437d[_0xb34a('0x45')],{'$or':_[_0xb34a('0x37')](_0x148a89,function(_0x5ab08c){if(_0x5ab08c['type']!==_0xb34a('0x47')){var _0x5ee933={};_0x5ee933[_0x5ab08c[_0xb34a('0x34')]]={'$like':'%'+_0x47b3c0[_0xb34a('0x3b')]['filter']+'%'};return _0x5ee933;}})});}_0x3b437d=_[_0xb34a('0x46')]({},_0x3b437d,_0x47b3c0[_0xb34a('0x48')]);var _0x162e44={'where':_0x3b437d[_0xb34a('0x45')]};return db[_0xb34a('0x49')][_0xb34a('0x2b')](_0x162e44)[_0xb34a('0x1e')](function(_0xbb1951){_0x2587e1['count']=_0xbb1951;if(_0x47b3c0[_0xb34a('0x3b')][_0xb34a('0x4a')]){_0x3b437d[_0xb34a('0x4b')]=[{'all':!![]}];}return db[_0xb34a('0x49')][_0xb34a('0x4c')](_0x3b437d);})[_0xb34a('0x1e')](function(_0x4a6bd1){_0x2587e1['rows']=_0x4a6bd1;return _0x2587e1;})[_0xb34a('0x1e')](respondWithFilteredResult(_0x53d2ce,_0x3b437d))['catch'](handleError(_0x53d2ce,null));};exports[_0xb34a('0x4d')]=function(_0x2b1337,_0x26fcc9){var _0x38e8eb={'raw':![],'where':{'id':_0x2b1337[_0xb34a('0x4e')]['id']}},_0x3962d4={};_0x3962d4[_0xb34a('0x3a')]=_[_0xb34a('0x4f')](db[_0xb34a('0x49')][_0xb34a('0x38')]);_0x3962d4[_0xb34a('0x3b')]=_['keys'](_0x2b1337['query']);_0x3962d4[_0xb34a('0x3c')]=_['intersection'](_0x3962d4[_0xb34a('0x3a')],_0x3962d4[_0xb34a('0x3b')]);_0x38e8eb[_0xb34a('0x3d')]=_[_0xb34a('0x50')](_0x3962d4['model'],qs['fields'](_0x2b1337['query']['fields']));_0x38e8eb[_0xb34a('0x3d')]=_0x38e8eb[_0xb34a('0x3d')][_0xb34a('0x3f')]?_0x38e8eb[_0xb34a('0x3d')]:_0x3962d4[_0xb34a('0x3a')];if(_0x2b1337[_0xb34a('0x3b')][_0xb34a('0x4a')]){_0x38e8eb[_0xb34a('0x4b')]=[{'all':!![]}];}_0x38e8eb=_[_0xb34a('0x46')]({},_0x38e8eb,_0x2b1337[_0xb34a('0x48')]);return db[_0xb34a('0x49')][_0xb34a('0x51')](_0x38e8eb)[_0xb34a('0x1e')](handleEntityNotFound(_0x26fcc9,null))['then'](respondWithResult(_0x26fcc9,null))['catch'](handleError(_0x26fcc9,null));};exports[_0xb34a('0x52')]=function(_0x215cdf,_0x356b46){var _0x5c302b={'where':{'id':_0x215cdf[_0xb34a('0x4e')]['id']}},_0x2a8e07={};_0x2a8e07[_0xb34a('0x3a')]=_[_0xb34a('0x4f')](db[_0xb34a('0x49')]['rawAttributes']);_0x5c302b['attributes']=_['intersection'](_0x2a8e07[_0xb34a('0x3a')],qs[_0xb34a('0x3e')](_0x215cdf['query'][_0xb34a('0x3e')]));_0x5c302b[_0xb34a('0x3d')]=_0x5c302b[_0xb34a('0x3d')][_0xb34a('0x3f')]?_0x5c302b[_0xb34a('0x3d')]:_0x2a8e07[_0xb34a('0x3a')];if(_0x215cdf[_0xb34a('0x3b')][_0xb34a('0x4a')]){_0x5c302b[_0xb34a('0x4b')]=[{'all':!![]}];}_0x5c302b=_['merge']({},_0x5c302b,_0x215cdf[_0xb34a('0x48')]);return db['Trunk'][_0xb34a('0x51')](_0x5c302b)[_0xb34a('0x1e')](handleEntityNotFound(_0x356b46,null))[_0xb34a('0x1e')](function(_0x1b0bbe){if(_0x1b0bbe){var _0x20718f=_0x1b0bbe['get']({'plain':!![]});_0x20718f=qs[_0xb34a('0x53')](_0x20718f,['id',_0xb34a('0x54'),_0xb34a('0x55')]);_0x215cdf[_0xb34a('0x56')]=_[_0xb34a('0x53')](_0x215cdf[_0xb34a('0x56')],['id','createdAt',_0xb34a('0x55')]);return db[_0xb34a('0x49')][_0xb34a('0x57')](_['merge'](_0x20718f,_0x215cdf[_0xb34a('0x56')]),{'include':_0x215cdf[_0xb34a('0x3b')][_0xb34a('0x4a')]?[{'all':!![]}]:undefined})[_0xb34a('0x1e')](function(_0x2f1057){var _0x3e399c=_0x215cdf['user'][_0xb34a('0x58')]({'plain':!![]});if(!_0x3e399c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e399c[_0xb34a('0x59')]==='user'){var _0x2e2f8a=_0x2f1057[_0xb34a('0x58')]({'plain':!![]});var _0x5e3393='Trunks';return db['UserProfileSection'][_0xb34a('0x51')]({'where':{'name':_0x5e3393,'userProfileId':_0x3e399c[_0xb34a('0x5a')]},'raw':!![]})[_0xb34a('0x1e')](function(_0xe9075b){if(_0xe9075b&&_0xe9075b[_0xb34a('0x5b')]===0x0){return db['UserProfileResource'][_0xb34a('0x57')]({'name':_0x2e2f8a[_0xb34a('0x34')],'resourceId':_0x2e2f8a['id'],'type':_0xe9075b[_0xb34a('0x34')],'sectionId':_0xe9075b['id']},{})[_0xb34a('0x1e')](function(){return _0x2f1057;});}else{return _0x2f1057;}})[_0xb34a('0x26')](function(_0x1dd63){logger['error'](_0xb34a('0x5c'),_0x1dd63);throw _0x1dd63;});}return _0x2f1057;});}})['then'](respondWithResult(_0x356b46,0xc9))['catch'](handleError(_0x356b46,null));};exports['create']=function(_0x127553,_0x587664,_0x412ab4){var _0x44c205;return db[_0xb34a('0x49')][_0xb34a('0x57')](_0x127553['body'],{'raw':!![]})[_0xb34a('0x1e')](function(_0x5dbe0f){_0x44c205=_0x5dbe0f;return db[_0xb34a('0x49')][_0xb34a('0x4c')]({'raw':!![]});})[_0xb34a('0x1e')](function(_0x558ef1){var _0x5b68e8=fs[_0xb34a('0x5d')](path[_0xb34a('0x5e')](config[_0xb34a('0x5f')],_0xb34a('0x60')),_0xb34a('0x61'));var _0x2da606=fs['readFileSync'](path[_0xb34a('0x5e')](config['root'],_0xb34a('0x62')),'utf8');var _0xffe30d=ejs[_0xb34a('0x63')](_0x5b68e8,{'trunks':_0x558ef1||[]});fs[_0xb34a('0x64')](_0xb34a('0x65'),_0xffe30d);if(_0x44c205[_0xb34a('0x66')]){var _0x4c0aee=ejs[_0xb34a('0x63')](_0x2da606,{'trunks':_0x558ef1||[]});fs[_0xb34a('0x64')](_0xb34a('0x67'),_0x4c0aee);}})[_0xb34a('0x1e')](function(){return respondWithRpcPromise(_0xb34a('0x68'),'create',{'module':_0xb34a('0x69')});})[_0xb34a('0x1e')](function(){var _0x52de9b=_0x127553['user'][_0xb34a('0x58')]({'plain':!![]});if(!_0x52de9b)throw new Error(_0xb34a('0x6a'));if(_0x52de9b[_0xb34a('0x59')]===_0xb34a('0x6b')){var _0x100c02=_0x44c205[_0xb34a('0x58')]({'plain':!![]});return db[_0xb34a('0x6c')][_0xb34a('0x51')]({'where':{'name':_0xb34a('0x6d'),'userProfileId':_0x52de9b[_0xb34a('0x5a')]},'raw':!![]})[_0xb34a('0x1e')](function(_0xd4636c){if(_0xd4636c&&_0xd4636c[_0xb34a('0x5b')]===0x0){return db[_0xb34a('0x32')][_0xb34a('0x57')]({'name':_0x100c02[_0xb34a('0x34')],'resourceId':_0x100c02['id'],'type':_0xd4636c[_0xb34a('0x34')],'sectionId':_0xd4636c['id']},{})[_0xb34a('0x1e')](function(){return _0x44c205;});}else{return _0x44c205;}})[_0xb34a('0x26')](function(_0x515266){logger[_0xb34a('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x515266);throw _0x515266;});}return _0x44c205;})[_0xb34a('0x1e')](respondWithResult(_0x587664,0xc9))[_0xb34a('0x26')](handleError(_0x587664,null));};exports[_0xb34a('0x6e')]=function(_0x5eb244,_0x19b761,_0x54277f){var _0x401dc7;return db[_0xb34a('0x49')][_0xb34a('0x51')]({'where':{'id':_0x5eb244['params']['id']}})[_0xb34a('0x1e')](handleEntityNotFound(_0x19b761,null))[_0xb34a('0x1e')](saveUpdates(_0x5eb244[_0xb34a('0x56')],null))[_0xb34a('0x1e')](function(_0x1b9b6f){if(_0x1b9b6f){_0x401dc7=_0x1b9b6f;return db[_0xb34a('0x49')]['findAll']({'raw':!![]});}})[_0xb34a('0x1e')](function(_0x268b78){if(_0x268b78){var _0x1c4a03=fs[_0xb34a('0x5d')](path[_0xb34a('0x5e')](config[_0xb34a('0x5f')],'server/files/templates/trunk.ejs'),_0xb34a('0x61'));var _0x5acad7=fs[_0xb34a('0x5d')](path['join'](config['root'],_0xb34a('0x62')),_0xb34a('0x61'));var _0x1b11d0=ejs['render'](_0x1c4a03,{'trunks':_0x268b78||[]});fs['writeFileSync'](_0xb34a('0x65'),_0x1b11d0);var _0x2be08d=ejs['render'](_0x5acad7,{'trunks':_0x268b78||[]});fs[_0xb34a('0x64')]('/etc/asterisk/sip_xcally_registers.conf',_0x2be08d);return respondWithRpcPromise('Reload',_0xb34a('0x6e'),{'module':'chan_sip.so'});}return null;})[_0xb34a('0x1e')](function(_0x33aed7){if(_0x33aed7){return _0x401dc7;}})[_0xb34a('0x1e')](respondWithResult(_0x19b761,null))['catch'](handleError(_0x19b761,null));};exports['destroy']=function(_0x580876,_0x178988,_0x165e6b){var _0x5de101;return db[_0xb34a('0x49')][_0xb34a('0x51')]({'where':{'id':_0x580876['params']['id']}})['then'](handleEntityNotFound(_0x178988,null))[_0xb34a('0x1e')](removeEntity(_0x178988,null))[_0xb34a('0x1e')](function(){return db[_0xb34a('0x49')]['findAll']({'raw':!![]});})[_0xb34a('0x1e')](function(_0x32dc19){var _0x34eae2=fs['readFileSync'](path[_0xb34a('0x5e')](config[_0xb34a('0x5f')],_0xb34a('0x60')),_0xb34a('0x61'));var _0x232fc7=fs[_0xb34a('0x5d')](path[_0xb34a('0x5e')](config[_0xb34a('0x5f')],_0xb34a('0x62')),'utf8');var _0x4cb385=ejs[_0xb34a('0x63')](_0x34eae2,{'trunks':_0x32dc19});var _0x11c933=ejs[_0xb34a('0x63')](_0x232fc7,{'trunks':_0x32dc19});fs[_0xb34a('0x64')](_0xb34a('0x65'),_0x4cb385);fs[_0xb34a('0x64')](_0xb34a('0x67'),_0x11c933);return respondWithRpcPromise(_0xb34a('0x68'),_0xb34a('0x31'),{'module':'chan_sip.so'});})[_0xb34a('0x26')](handleError(_0x178988,null));};
\ No newline at end of file
index 5f4cb9e..1793487 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9003=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','lodash'];(function(_0x2fab06,_0x47ef86){var _0x1f19d7=function(_0x40a04f){while(--_0x40a04f){_0x2fab06['push'](_0x2fab06['shift']());}};_0x1f19d7(++_0x47ef86);}(_0x9003,0x1c7));var _0x3900=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9003[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x3900('0x0'));var util=require('util');var logger=require(_0x3900('0x1'))(_0x3900('0x2'));var moment=require(_0x3900('0x3'));var BPromise=require(_0x3900('0x4'));var rp=require(_0x3900('0x5'));var fs=require('fs');var path=require(_0x3900('0x6'));var rimraf=require(_0x3900('0x7'));var config=require(_0x3900('0x8'));var attributes=require(_0x3900('0x9'));module[_0x3900('0xa')]=function(_0x27819c,_0x6dc8ca){return _0x27819c[_0x3900('0xb')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3aa=['../../config/environment','./trunk.attributes','exports','define','tools_trunks','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x18f790,_0x2685ac){var _0x10488c=function(_0x590177){while(--_0x590177){_0x18f790['push'](_0x18f790['shift']());}};_0x10488c(++_0x2685ac);}(_0xf3aa,0xf7));var _0xaf3a=function(_0x3044e3,_0x255336){_0x3044e3=_0x3044e3-0x0;var _0x389181=_0xf3aa[_0x3044e3];return _0x389181;};'use strict';var _=require(_0xaf3a('0x0'));var util=require(_0xaf3a('0x1'));var logger=require(_0xaf3a('0x2'))(_0xaf3a('0x3'));var moment=require(_0xaf3a('0x4'));var BPromise=require('bluebird');var rp=require(_0xaf3a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaf3a('0x6'));var attributes=require(_0xaf3a('0x7'));module[_0xaf3a('0x8')]=function(_0x4101cb,_0x1475ef){return _0x4101cb[_0xaf3a('0x9')]('Trunk',attributes,{'tableName':_0xaf3a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5e8ae0e..0a52cd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','ShowTrunk','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x59d691,_0x4a557e){var _0x1a058a=function(_0x179758){while(--_0x179758){_0x59d691['push'](_0x59d691['shift']());}};_0x1a058a(++_0x4a557e);}(_0x757a,0xde));var _0xa757=function(_0x2565bd,_0x1da86b){_0x2565bd=_0x2565bd-0x0;var _0x10db2d=_0x757a[_0x2565bd];return _0x10db2d;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}exports[_0xa757('0x15')]=function(_0x4d9f58){var _0x54b305=this;return new Promise(function(_0x151c04,_0x468d45){return db[_0xa757('0x16')][_0xa757('0x17')]({'raw':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58['options'][_0xa757('0x19')]||null:null,'attributes':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'limit':_0x4d9f58['options']?_0x4d9f58['options'][_0xa757('0x1b')]||null:null,'include':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')],function(_0x21f1af){return{'model':db[_0x21f1af[_0xa757('0x1e')]],'as':_0x21f1af['as'],'attributes':_0x21f1af['attributes'],'include':_0x21f1af[_0xa757('0x1c')]?_['map'](_0x21f1af[_0xa757('0x1c')],function(_0x47903b){return{'model':db[_0x47903b[_0xa757('0x1e')]],'as':_0x47903b['as'],'attributes':_0x47903b[_0xa757('0x1a')],'include':_0x47903b[_0xa757('0x1c')]?_['map'](_0x47903b[_0xa757('0x1c')],function(_0xcd98bd){return{'model':db[_0xcd98bd[_0xa757('0x1e')]],'as':_0xcd98bd['as'],'attributes':_0xcd98bd[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x449a7d){logger['info']('GetTrunk',_0x4d9f58);logger['debug']('GetTrunk',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetTrunk',_0x2208f9[_0xa757('0x12')],_0x4d9f58);_0x468d45(_0x54b305['error'](0x1f4,_0x2208f9[_0xa757('0x12')]));});});};exports[_0xa757('0x1f')]=function(_0x5307c3){var _0x235e54=this;return new Promise(function(_0x5ade7b,_0x3a4a66){return db[_0xa757('0x16')][_0xa757('0x20')]({'raw':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x21')]===undefined?!![]:![]:!![],'where':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x19')]||null:null,'attributes':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'include':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')],function(_0x1eacde){return{'model':db[_0x1eacde[_0xa757('0x1e')]],'as':_0x1eacde['as'],'attributes':_0x1eacde[_0xa757('0x1a')],'include':_0x1eacde[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x1eacde[_0xa757('0x1c')],function(_0x59700d){return{'model':db[_0x59700d[_0xa757('0x1e')]],'as':_0x59700d['as'],'attributes':_0x59700d[_0xa757('0x1a')],'include':_0x59700d[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x59700d[_0xa757('0x1c')],function(_0x51e2aa){return{'model':db[_0x51e2aa[_0xa757('0x1e')]],'as':_0x51e2aa['as'],'attributes':_0x51e2aa[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa757('0xa')](function(_0x2c34b1){logger[_0xa757('0xb')](_0xa757('0x1f'),_0x5307c3);logger['debug'](_0xa757('0x1f'),_0x5307c3,JSON[_0xa757('0x10')](_0x2c34b1));_0x5ade7b(_0x2c34b1);})[_0xa757('0x14')](function(_0xc34409){logger[_0xa757('0x11')](_0xa757('0x1f'),_0xc34409[_0xa757('0x12')],_0x5307c3);_0x3a4a66(_0x235e54[_0xa757('0x11')](0x1f4,_0xc34409[_0xa757('0x12')]));});});};
\ No newline at end of file
+var _0x4fc2=['rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','where','attributes','include','model','map','GetTrunk','Trunk','find','raw','ShowTrunk','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0x4fc2,0x111));var _0x24fc=function(_0x121c59,_0x583b72){_0x121c59=_0x121c59-0x0;var _0x1c1b78=_0x4fc2[_0x121c59];return _0x1c1b78;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('Trunk,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('Trunk,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}exports['GetTrunk']=function(_0x23873c){var _0x1cb3d0=this;return new Promise(function(_0x6cfa0a,_0x8ac114){return db['Trunk'][_0x24fc('0x17')]({'raw':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')][_0x24fc('0x19')]||null:null,'attributes':_0x23873c[_0x24fc('0x18')]?_0x23873c['options'][_0x24fc('0x1a')]||null:null,'limit':_0x23873c['options']?_0x23873c[_0x24fc('0x18')]['limit']||null:null,'include':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')][_0x24fc('0x1b')]?_['map'](_0x23873c[_0x24fc('0x18')]['include'],function(_0x35a9c7){return{'model':db[_0x35a9c7[_0x24fc('0x1c')]],'as':_0x35a9c7['as'],'attributes':_0x35a9c7[_0x24fc('0x1a')],'include':_0x35a9c7[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x35a9c7[_0x24fc('0x1b')],function(_0x3f0875){return{'model':db[_0x3f0875[_0x24fc('0x1c')]],'as':_0x3f0875['as'],'attributes':_0x3f0875[_0x24fc('0x1a')],'include':_0x3f0875[_0x24fc('0x1b')]?_['map'](_0x3f0875[_0x24fc('0x1b')],function(_0x16f27f){return{'model':db[_0x16f27f[_0x24fc('0x1c')]],'as':_0x16f27f['as'],'attributes':_0x16f27f['attributes']};}):[]};}):[]};}):[]:[]})[_0x24fc('0xc')](function(_0x3d1ec8){logger[_0x24fc('0xd')](_0x24fc('0x1e'),_0x23873c);logger[_0x24fc('0x10')](_0x24fc('0x1e'),_0x23873c,JSON['stringify'](_0x3d1ec8));_0x6cfa0a(_0x3d1ec8);})[_0x24fc('0x16')](function(_0x29a461){logger[_0x24fc('0x13')](_0x24fc('0x1e'),_0x29a461[_0x24fc('0x15')],_0x23873c);_0x8ac114(_0x1cb3d0['error'](0x1f4,_0x29a461['message']));});});};exports['ShowTrunk']=function(_0x3df6f4){var _0x574ba3=this;return new Promise(function(_0x3f2464,_0x3e6389){return db[_0x24fc('0x1f')][_0x24fc('0x20')]({'raw':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x21')]===undefined?!![]:![]:!![],'where':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x19')]||null:null,'attributes':_0x3df6f4['options']?_0x3df6f4['options'][_0x24fc('0x1a')]||null:null,'include':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x1b')]?_['map'](_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x1b')],function(_0x3b2862){return{'model':db[_0x3b2862[_0x24fc('0x1c')]],'as':_0x3b2862['as'],'attributes':_0x3b2862[_0x24fc('0x1a')],'include':_0x3b2862[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x3b2862[_0x24fc('0x1b')],function(_0x379a4a){return{'model':db[_0x379a4a['model']],'as':_0x379a4a['as'],'attributes':_0x379a4a[_0x24fc('0x1a')],'include':_0x379a4a[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x379a4a[_0x24fc('0x1b')],function(_0x242bd5){return{'model':db[_0x242bd5['model']],'as':_0x242bd5['as'],'attributes':_0x242bd5['attributes']};}):[]};}):[]};}):[]:[]})[_0x24fc('0xc')](function(_0x5d48fe){logger[_0x24fc('0xd')](_0x24fc('0x22'),_0x3df6f4);logger[_0x24fc('0x10')](_0x24fc('0x22'),_0x3df6f4,JSON['stringify'](_0x5d48fe));_0x3f2464(_0x5d48fe);})[_0x24fc('0x16')](function(_0x4f4ec8){logger[_0x24fc('0x13')](_0x24fc('0x22'),_0x4f4ec8[_0x24fc('0x15')],_0x3df6f4);_0x3e6389(_0x574ba3[_0x24fc('0x13')](0x1f4,_0x4f4ec8[_0x24fc('0x15')]));});});};
\ No newline at end of file
index 4b6e901..b20f219 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7bd=['/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','/create_many','addContacts','addQueues','diskStorage','join','format','%s-%s','now','file','addAvatar','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','addMailInteractions','/:id/fax_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','put','update','changePassword','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','/whoami','whoami','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','/:id/agents','getAgents'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xd7bd,0x118));var _0xdd7b=function(_0x2353fe,_0x4b0bca){_0x2353fe=_0x2353fe-0x0;var _0x4d43f6=_0xd7bd[_0x2353fe];return _0x4d43f6;};'use strict';var multer=require(_0xdd7b('0x0'));var util=require(_0xdd7b('0x1'));var path=require('path');var timeout=require(_0xdd7b('0x2'));var express=require(_0xdd7b('0x3'));var router=express['Router']();var auth=require(_0xdd7b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdd7b('0x5'));var controller=require('./user.controller');router[_0xdd7b('0x6')]('/',auth['isAuthenticated'](),controller[_0xdd7b('0x7')]);router[_0xdd7b('0x6')](_0xdd7b('0x8'),auth[_0xdd7b('0x9')](),controller['describe']);router[_0xdd7b('0x6')](_0xdd7b('0xa'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0xb')]);router[_0xdd7b('0x6')](_0xdd7b('0xc'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0xd')]);router[_0xdd7b('0x6')](_0xdd7b('0xe'),controller[_0xdd7b('0xf')]);router[_0xdd7b('0x6')](_0xdd7b('0x10'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x11')]);router[_0xdd7b('0x6')](_0xdd7b('0x12'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x13')]);router[_0xdd7b('0x6')](_0xdd7b('0x14'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x15')]);router['get'](_0xdd7b('0x16'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x17')]);router[_0xdd7b('0x6')](_0xdd7b('0x18'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x19')]);router[_0xdd7b('0x6')]('/:id/screen_recordings',auth[_0xdd7b('0x9')](),controller['getScreenRecordings']);router[_0xdd7b('0x6')](_0xdd7b('0x1a'),auth['isAuthenticated'](),controller[_0xdd7b('0x1b')]);router[_0xdd7b('0x6')]('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0xdd7b('0x1c')]);router[_0xdd7b('0x6')](_0xdd7b('0x1d'),auth['isAuthenticated'](),controller[_0xdd7b('0x1e')]);router['get']('/:id/sms/interactions',auth[_0xdd7b('0x9')](),controller['getSmsInteractions']);router[_0xdd7b('0x6')](_0xdd7b('0x1f'),auth[_0xdd7b('0x9')](),controller['getFaxInteractions']);router[_0xdd7b('0x6')](_0xdd7b('0x20'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x21')]);router[_0xdd7b('0x6')](_0xdd7b('0x22'),auth[_0xdd7b('0x9')](),controller['getTeams']);router[_0xdd7b('0x6')](_0xdd7b('0x23'),auth[_0xdd7b('0x9')](),controller['getLists']);router['get'](_0xdd7b('0x24'),auth['isAuthenticated'](),controller[_0xdd7b('0x25')]);router['get'](_0xdd7b('0x26'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x27')]);router['get'](_0xdd7b('0x28'),auth['isAuthenticated'](),controller[_0xdd7b('0x29')]);router[_0xdd7b('0x6')](_0xdd7b('0x2a'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x2b')]);router['get'](_0xdd7b('0x2c'),auth['isAuthenticated'](),controller[_0xdd7b('0x2d')]);router[_0xdd7b('0x6')](_0xdd7b('0x2e'),auth[_0xdd7b('0x9')](),controller['getSmsAccounts']);router[_0xdd7b('0x6')](_0xdd7b('0x2f'),auth['isAuthenticated'](),controller[_0xdd7b('0x30')]);router['get'](_0xdd7b('0x31'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x32')]);router['get'](_0xdd7b('0x33'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x34')]);router[_0xdd7b('0x6')](_0xdd7b('0x35'),auth[_0xdd7b('0x9')](),controller['getScheduledCalls']);router['get'](_0xdd7b('0x36'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x37')]);router[_0xdd7b('0x38')](_0xdd7b('0x39'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0xdd7b('0x38')](_0xdd7b('0x10'),auth['isAuthenticated'](),controller[_0xdd7b('0x3a')]);router[_0xdd7b('0x38')]('/',auth[_0xdd7b('0x9')](),controller['create']);router[_0xdd7b('0x38')](_0xdd7b('0x12'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x3b')]);var upload=multer({'storage':multer[_0xdd7b('0x3c')]({'destination':function(_0x4d9136,_0x1f13b8,_0x1b2825){_0x1b2825(null,path[_0xdd7b('0x3d')](config['root'],'server/files/images/'));},'filename':function(_0x4b6104,_0x20f1bf,_0x2f199c){_0x2f199c(null,util[_0xdd7b('0x3e')](_0xdd7b('0x3f'),Date[_0xdd7b('0x40')](),_0x20f1bf['originalname']));}})});router['post'](_0xdd7b('0xe'),upload['single'](_0xdd7b('0x41')),controller[_0xdd7b('0x42')]);router[_0xdd7b('0x38')]('/:id/login',auth[_0xdd7b('0x9')](),controller['login']);router[_0xdd7b('0x38')](_0xdd7b('0x43'),auth['isAuthenticated'](),controller[_0xdd7b('0x44')]);router[_0xdd7b('0x38')](_0xdd7b('0x45'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x46')]);router[_0xdd7b('0x38')](_0xdd7b('0x47'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x48')]);router[_0xdd7b('0x38')](_0xdd7b('0x22'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x49')]);router[_0xdd7b('0x38')]('/:id/chat_interactions',auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x4a')]);router[_0xdd7b('0x38')]('/:id/mail_interactions',auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x4b')]);router[_0xdd7b('0x38')](_0xdd7b('0x4c'),auth[_0xdd7b('0x9')](),controller['addFaxInteractions']);router[_0xdd7b('0x38')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xdd7b('0x4d')]);router[_0xdd7b('0x38')](_0xdd7b('0x4e'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x4f')]);router['post'](_0xdd7b('0x50'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x51')]);router[_0xdd7b('0x38')](_0xdd7b('0x28'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x52')]);router[_0xdd7b('0x38')](_0xdd7b('0x2a'),auth['isAuthenticated'](),controller[_0xdd7b('0x53')]);router[_0xdd7b('0x38')](_0xdd7b('0x2c'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x54')]);router[_0xdd7b('0x38')](_0xdd7b('0x2e'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x55')]);router[_0xdd7b('0x38')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xdd7b('0x56')]);router['post']('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0xdd7b('0x38')]('/:id/square_projects',auth['isAuthenticated'](),controller['addSquareProjects']);router[_0xdd7b('0x38')](_0xdd7b('0x36'),auth[_0xdd7b('0x9')](),controller['createApiKey']);router[_0xdd7b('0x57')]('/:id',auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x58')]);router['put']('/:id/password',auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x59')]);router[_0xdd7b('0x5a')](_0xdd7b('0x12'),auth[_0xdd7b('0x9')](),controller['removeQueues']);router[_0xdd7b('0x5a')](_0xdd7b('0x22'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x5b')]);router[_0xdd7b('0x5a')]('/:id',auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x5c')]);router[_0xdd7b('0x5a')](_0xdd7b('0x5d'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x5e')]);router[_0xdd7b('0x5a')]('/:id/mail_interactions',auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x5f')]);router['delete']('/:id/fax_interactions',auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x60')]);router[_0xdd7b('0x5a')](_0xdd7b('0x61'),auth[_0xdd7b('0x9')](),controller['removeSmsInteractions']);router['delete']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0xdd7b('0x62')]);router[_0xdd7b('0x5a')](_0xdd7b('0x50'),auth['isAuthenticated'](),controller[_0xdd7b('0x63')]);router[_0xdd7b('0x5a')](_0xdd7b('0x28'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x64')]);router['delete'](_0xdd7b('0x2a'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x65')]);router[_0xdd7b('0x5a')](_0xdd7b('0x2c'),auth['isAuthenticated'](),controller[_0xdd7b('0x66')]);router['delete']('/:id/sms_accounts',auth[_0xdd7b('0x9')](),controller['removeSmsAccounts']);router[_0xdd7b('0x5a')](_0xdd7b('0x2f'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x67')]);router[_0xdd7b('0x5a')](_0xdd7b('0x31'),auth[_0xdd7b('0x9')](),controller[_0xdd7b('0x68')]);router[_0xdd7b('0x5a')](_0xdd7b('0x33'),auth[_0xdd7b('0x9')](),controller['removeSquareProjects']);router[_0xdd7b('0x5a')](_0xdd7b('0x36'),auth['isAuthenticated'](),controller['removeApiKey']);module[_0xdd7b('0x69')]=router;
\ No newline at end of file
+var _0xca7c=['getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','/:id/chat/interactions','/:id/openchannel/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','post','/create_many','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','/:id/square_projects','addSquareProjects','/:id/api_key','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','/:id','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','index','/describe','isAuthenticated','get','/whoami','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues'];(function(_0x52a9d1,_0x59e1a2){var _0x1d063c=function(_0x855eea){while(--_0x855eea){_0x52a9d1['push'](_0x52a9d1['shift']());}};_0x1d063c(++_0x59e1a2);}(_0xca7c,0x1a5));var _0xcca7=function(_0x3b1523,_0xa32606){_0x3b1523=_0x3b1523-0x0;var _0x45ee67=_0xca7c[_0x3b1523];return _0x45ee67;};'use strict';var multer=require(_0xcca7('0x0'));var util=require('util');var path=require(_0xcca7('0x1'));var timeout=require(_0xcca7('0x2'));var express=require(_0xcca7('0x3'));var router=express[_0xcca7('0x4')]();var auth=require(_0xcca7('0x5'));var interaction=require(_0xcca7('0x6'));var config=require(_0xcca7('0x7'));var controller=require(_0xcca7('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xcca7('0x9')]);router['get'](_0xcca7('0xa'),auth[_0xcca7('0xb')](),controller['describe']);router[_0xcca7('0xc')](_0xcca7('0xd'),auth[_0xcca7('0xb')](),controller['whoami']);router[_0xcca7('0xc')]('/:id',auth[_0xcca7('0xb')](),controller['show']);router['get'](_0xcca7('0xe'),controller[_0xcca7('0xf')]);router[_0xcca7('0xc')](_0xcca7('0x10'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x11')]);router['get'](_0xcca7('0x12'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x13')]);router[_0xcca7('0xc')](_0xcca7('0x14'),auth[_0xcca7('0xb')](),controller['getVoiceQueuesRt']);router[_0xcca7('0xc')](_0xcca7('0x15'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x16')]);router[_0xcca7('0xc')](_0xcca7('0x17'),auth[_0xcca7('0xb')](),controller['getRecordings']);router[_0xcca7('0xc')](_0xcca7('0x18'),auth[_0xcca7('0xb')](),controller['getScreenRecordings']);router[_0xcca7('0xc')](_0xcca7('0x19'),auth[_0xcca7('0xb')](),controller['getChatInteractions']);router[_0xcca7('0xc')](_0xcca7('0x1a'),auth[_0xcca7('0xb')](),controller['getOpenchannelInteractions']);router['get']('/:id/mail/interactions',auth[_0xcca7('0xb')](),controller[_0xcca7('0x1b')]);router[_0xcca7('0xc')](_0xcca7('0x1c'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x1d')]);router['get']('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0xcca7('0x1e')]);router[_0xcca7('0xc')]('/:id/whatsapp/interactions',auth[_0xcca7('0xb')](),controller[_0xcca7('0x1f')]);router[_0xcca7('0xc')](_0xcca7('0x20'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x21')]);router[_0xcca7('0xc')](_0xcca7('0x22'),auth['isAuthenticated'](),controller[_0xcca7('0x23')]);router['get'](_0xcca7('0x24'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x25')]);router['get'](_0xcca7('0x26'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x27')]);router['get'](_0xcca7('0x28'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x29')]);router[_0xcca7('0xc')](_0xcca7('0x2a'),auth['isAuthenticated'](),controller['getMailAccounts']);router[_0xcca7('0xc')](_0xcca7('0x2b'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x2c')]);router['get'](_0xcca7('0x2d'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x2e')]);router[_0xcca7('0xc')](_0xcca7('0x2f'),auth[_0xcca7('0xb')](),controller['getChatWebsites']);router['get'](_0xcca7('0x30'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x31')]);router[_0xcca7('0xc')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xcca7('0x32')]);router[_0xcca7('0xc')](_0xcca7('0x33'),auth[_0xcca7('0xb')](),controller['getScheduledCalls']);router[_0xcca7('0xc')]('/:id/api_key',auth[_0xcca7('0xb')](),controller['getApiKey']);router[_0xcca7('0x34')](_0xcca7('0x35'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0xcca7('0x34')](_0xcca7('0x10'),auth[_0xcca7('0xb')](),controller['addContacts']);router[_0xcca7('0x34')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcca7('0x34')]('/:id/queues',auth[_0xcca7('0xb')](),controller[_0xcca7('0x36')]);var upload=multer({'storage':multer[_0xcca7('0x37')]({'destination':function(_0x23c5ba,_0x4eb23c,_0x42dd0b){_0x42dd0b(null,path['join'](config[_0xcca7('0x38')],_0xcca7('0x39')));},'filename':function(_0x5c21ec,_0x2792cd,_0xdae94c){_0xdae94c(null,util[_0xcca7('0x3a')](_0xcca7('0x3b'),Date[_0xcca7('0x3c')](),_0x2792cd[_0xcca7('0x3d')]));}})});router[_0xcca7('0x34')](_0xcca7('0xe'),upload[_0xcca7('0x3e')](_0xcca7('0x3f')),controller[_0xcca7('0x40')]);router[_0xcca7('0x34')](_0xcca7('0x41'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x42')]);router['post'](_0xcca7('0x43'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x44')]);router[_0xcca7('0x34')]('/:id/pause',auth[_0xcca7('0xb')](),controller[_0xcca7('0x45')]);router[_0xcca7('0x34')](_0xcca7('0x46'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x47')]);router[_0xcca7('0x34')](_0xcca7('0x20'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x48')]);router[_0xcca7('0x34')]('/:id/chat_interactions',auth[_0xcca7('0xb')](),controller[_0xcca7('0x49')]);router[_0xcca7('0x34')](_0xcca7('0x4a'),auth['isAuthenticated'](),controller['addMailInteractions']);router['post'](_0xcca7('0x4b'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x4c')]);router['post'](_0xcca7('0x4d'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x4e')]);router[_0xcca7('0x34')](_0xcca7('0x4f'),auth[_0xcca7('0xb')](),controller['addOpenchannelInteractions']);router['post'](_0xcca7('0x50'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x51')]);router[_0xcca7('0x34')](_0xcca7('0x28'),auth['isAuthenticated'](),controller['addFaxAccounts']);router['post']('/:id/mail_accounts',auth[_0xcca7('0xb')](),controller['addMailAccounts']);router[_0xcca7('0x34')](_0xcca7('0x2b'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x52')]);router['post']('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xcca7('0x53')]);router['post'](_0xcca7('0x2f'),auth[_0xcca7('0xb')](),controller['addChatWebsites']);router[_0xcca7('0x34')](_0xcca7('0x30'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x54')]);router[_0xcca7('0x34')](_0xcca7('0x55'),auth['isAuthenticated'](),controller[_0xcca7('0x56')]);router[_0xcca7('0x34')](_0xcca7('0x57'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x58')]);router[_0xcca7('0x59')]('/:id',auth[_0xcca7('0xb')](),controller[_0xcca7('0x5a')]);router['put'](_0xcca7('0x5b'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x5c')]);router[_0xcca7('0x5d')]('/:id/queues',auth[_0xcca7('0xb')](),controller[_0xcca7('0x5e')]);router[_0xcca7('0x5d')](_0xcca7('0x20'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x5f')]);router[_0xcca7('0x5d')](_0xcca7('0x60'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x61')]);router[_0xcca7('0x5d')]('/:id/chat_interactions',auth[_0xcca7('0xb')](),controller[_0xcca7('0x62')]);router[_0xcca7('0x5d')](_0xcca7('0x4a'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x63')]);router[_0xcca7('0x5d')](_0xcca7('0x4b'),auth['isAuthenticated'](),controller[_0xcca7('0x64')]);router['delete']('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0xcca7('0x65')]);router['delete'](_0xcca7('0x4f'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0xcca7('0x5d')](_0xcca7('0x50'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x66')]);router[_0xcca7('0x5d')](_0xcca7('0x28'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x67')]);router[_0xcca7('0x5d')](_0xcca7('0x2a'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x68')]);router[_0xcca7('0x5d')](_0xcca7('0x2b'),auth['isAuthenticated'](),controller[_0xcca7('0x69')]);router[_0xcca7('0x5d')]('/:id/sms_accounts',auth[_0xcca7('0xb')](),controller['removeSmsAccounts']);router['delete'](_0xcca7('0x2f'),auth['isAuthenticated'](),controller[_0xcca7('0x6a')]);router[_0xcca7('0x5d')](_0xcca7('0x30'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x6b')]);router[_0xcca7('0x5d')](_0xcca7('0x55'),auth[_0xcca7('0xb')](),controller[_0xcca7('0x6c')]);router[_0xcca7('0x5d')](_0xcca7('0x57'),auth[_0xcca7('0xb')](),controller['removeApiKey']);module[_0xcca7('0x6d')]=router;
\ No newline at end of file
index 2cc2e31..4ff9983 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba99=['showWebBar','get','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','encryption','icesupport','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','local','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','dynamic','friend','peer','ALLOWED_NOT_SCREENED','PROHIB_NOT_SCREENED','PROHIB','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','nonat','outgoing','yes','force_rport,comedia','nat','split','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass'];(function(_0x2bedab,_0x19f666){var _0x118ff5=function(_0x25670a){while(--_0x25670a){_0x2bedab['push'](_0x2bedab['shift']());}};_0x118ff5(++_0x19f666);}(_0xba99,0x168));var _0x9ba9=function(_0x3e525d,_0x1b7145){_0x3e525d=_0x3e525d-0x0;var _0xbf71e9=_0xba99[_0x3e525d];return _0xbf71e9;};'use strict';var Sequelize=require(_0x9ba9('0x0'));var moment=require('moment');var util=require('util');var _=require(_0x9ba9('0x1'));module['exports']={'name':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':![],'unique':_0x9ba9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x538ff7){this['setDataValue'](_0x9ba9('0x3'),_0x538ff7);this[_0x9ba9('0x4')](_0x9ba9('0x5'),_0x538ff7);},'comment':_0x9ba9('0x6')},'fullname':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':![],'set':function(_0xc32843){this[_0x9ba9('0x4')](_0x9ba9('0x7'),_0xc32843);this[_0x9ba9('0x4')](_0x9ba9('0x8'),util[_0x9ba9('0x9')](_0x9ba9('0xa'),_0xc32843,this['getDataValue'](_0x9ba9('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9ba9('0xc'),'validate':{'isEmail':!![]},'set':function(_0xb5209b){if(_0xb5209b){this[_0x9ba9('0x4')](_0x9ba9('0xc'),_0xb5209b[_0x9ba9('0xd')]());}}},'role':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0xf'),_0x9ba9('0x10'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x9ba9('0x11')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x9ba9('0xb'),'set':function(_0x593793){this[_0x9ba9('0x4')](_0x9ba9('0xb'),_0x593793);this[_0x9ba9('0x4')]('accountcode',_0x593793);this['setDataValue']('callerid',util['format'](_0x9ba9('0xa'),this[_0x9ba9('0x12')](_0x9ba9('0x7')),_0x593793));}},'salt':{'type':Sequelize[_0x9ba9('0x2')]},'phone':{'type':Sequelize[_0x9ba9('0x2')]},'mobile':{'type':Sequelize[_0x9ba9('0x2')]},'address':{'type':Sequelize[_0x9ba9('0x2')]},'zipcode':{'type':Sequelize[_0x9ba9('0x2')]},'userpic':{'type':Sequelize[_0x9ba9('0x2')]},'city':{'type':Sequelize[_0x9ba9('0x2')]},'country':{'type':Sequelize[_0x9ba9('0x2')]},'online':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9ba9('0x2')],'defaultValue':_0x9ba9('0x14')},'lastPauseAt':{'type':Sequelize[_0x9ba9('0x15')]},'chatCapacity':{'type':Sequelize[_0x9ba9('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x9ba9('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9ba9('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9ba9('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x9ba9('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9ba9('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![],'defaultValue':_0x9ba9('0x17')},'ipaddr':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0x9ba9('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x9ba9('0x18'),_0x9ba9('0x10'),_0x9ba9('0x19')),'allowNull':!![],'defaultValue':_0x9ba9('0x18')},'context':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x1a'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED',_0x9ba9('0x1b'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x9ba9('0x1c')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'permit':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'secret':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9ba9('0x1d'),'set':function(_0x48f6b9){this[_0x9ba9('0x4')]('transport',_0x48f6b9?_0x48f6b9[_0x9ba9('0x1e')](','):null);},'get':function(){return this[_0x9ba9('0x12')]('transport')?this['getDataValue'](_0x9ba9('0x1f'))['split'](','):null;},'comment':_0x9ba9('0x20')},'dtmfmode':{'type':Sequelize['ENUM'](_0x9ba9('0x21'),_0x9ba9('0x22'),'shortinfo',_0x9ba9('0x23'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x9ba9('0xe')]('yes','no',_0x9ba9('0x24'),'update',_0x9ba9('0x25')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9ba9('0x27'),'set':function(_0x8579b0){this['setDataValue'](_0x9ba9('0x28'),_0x8579b0?_0x8579b0[_0x9ba9('0x1e')](','):null);},'get':function(){return this[_0x9ba9('0x12')](_0x9ba9('0x28'))?this[_0x9ba9('0x12')](_0x9ba9('0x28'))[_0x9ba9('0x29')](','):null;},'comment':_0x9ba9('0x2a')},'callgroup':{'type':Sequelize[_0x9ba9('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x9ba9('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x9ba9('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':![],'defaultValue':_0x9ba9('0x2b')},'allow':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':![],'defaultValue':_0x9ba9('0x2c'),'set':function(_0x6e0acd){this[_0x9ba9('0x4')](_0x9ba9('0x2d'),_0x6e0acd?_0x6e0acd[_0x9ba9('0x1e')](';'):_0x9ba9('0x2c'));},'get':function(){return this[_0x9ba9('0x12')](_0x9ba9('0x2d'))?this[_0x9ba9('0x12')](_0x9ba9('0x2d'))[_0x9ba9('0x29')](';'):null;},'comment':_0x9ba9('0x2e')},'autoframing':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![],'set':function(_0x5875cb){this[_0x9ba9('0x4')]('insecure',_0x5875cb?_0x5875cb[_0x9ba9('0x1e')](','):null);},'get':function(){return this[_0x9ba9('0x12')](_0x9ba9('0x2f'))?this[_0x9ba9('0x12')](_0x9ba9('0x2f'))[_0x9ba9('0x29')](','):null;},'comment':_0x9ba9('0x30')},'trustrpid':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x9ba9('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x9ba9('0x26'),'no',_0x9ba9('0x31')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9ba9('0xe')]('yes','no'),'allowNull':!![],'defaultValue':_0x9ba9('0x26')},'busylevel':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0x9ba9('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x9ba9('0xe')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x9ba9('0xe')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'template':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no',_0x9ba9('0x32')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9ba9('0xe')]('accept',_0x9ba9('0x33'),_0x9ba9('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x9ba9('0x35'),_0x9ba9('0x36')),'allowNull':!![],'defaultValue':_0x9ba9('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![],'defaultValue':_0x9ba9('0x26')},'keepalive':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x9ba9('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x9ba9('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x9ba9('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x9ba9('0xe')]('yes','no',_0x9ba9('0x37'),_0x9ba9('0x38')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x39'),_0x9ba9('0x3a'),_0x9ba9('0x3b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9ba9('0x16')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x9ba9('0x26'),'no',_0x9ba9('0x24'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x9ba9('0x15')]},'showWebBar':{'type':Sequelize[_0x9ba9('0x16')],'defaultValue':0x0,'set':function(_0xb0ced4){this[_0x9ba9('0x4')](_0x9ba9('0x3c'),_0xb0ced4);var _0x4ba97b=this[_0x9ba9('0x3d')]({'plain':!![]});switch(_0xb0ced4){case 0x0:case 0x1:var _0x1b9662=_0x4ba97b[_0x9ba9('0x1f')]?_['isArray'](_0x4ba97b['transport'])?_0x4ba97b[_0x9ba9('0x1f')]['join']():_0x4ba97b['transport']:_0x9ba9('0x1d');if(_0x1b9662==='wss'){_0x1b9662=_0x9ba9('0x1d');}this[_0x9ba9('0x4')](_0x9ba9('0x1f'),_0x1b9662);this[_0x9ba9('0x4')]('encryption','no');this[_0x9ba9('0x4')](_0x9ba9('0x3e'),null);this['setDataValue'](_0x9ba9('0x3f'),null);this[_0x9ba9('0x4')]('icesupport',null);this[_0x9ba9('0x4')](_0x9ba9('0x40'),null);this[_0x9ba9('0x4')](_0x9ba9('0x41'),null);this[_0x9ba9('0x4')](_0x9ba9('0x42'),null);this[_0x9ba9('0x4')](_0x9ba9('0x43'),null);this[_0x9ba9('0x4')](_0x9ba9('0x44'),null);this[_0x9ba9('0x4')](_0x9ba9('0x45'),'no');break;case 0x2:this[_0x9ba9('0x4')](_0x9ba9('0x1f'),'wss');this[_0x9ba9('0x4')](_0x9ba9('0x46'),_0x9ba9('0x26'));this[_0x9ba9('0x4')](_0x9ba9('0x3e'),_0x9ba9('0x26'));this[_0x9ba9('0x4')](_0x9ba9('0x3f'),_0x9ba9('0x26'));this[_0x9ba9('0x4')](_0x9ba9('0x47'),_0x9ba9('0x26'));this['setDataValue'](_0x9ba9('0x40'),_0x9ba9('0x26'));this['setDataValue'](_0x9ba9('0x41'),'no');this[_0x9ba9('0x4')](_0x9ba9('0x42'),_0x9ba9('0x3b'));this[_0x9ba9('0x4')](_0x9ba9('0x43'),_0x4ba97b['dtlscertfile']||_0x9ba9('0x48'));this['setDataValue'](_0x9ba9('0x44'),_0x4ba97b[_0x9ba9('0x44')]||_0x9ba9('0x49'));this[_0x9ba9('0x4')]('rtcp_mux',_0x9ba9('0x26'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x13fc4b){this[_0x9ba9('0x4')](_0x9ba9('0x4a'),_0x13fc4b?_0x13fc4b[_0x9ba9('0x1e')](','):[]);},'get':function(){return this[_0x9ba9('0x12')]('permissions')?_[_0x9ba9('0x4b')](this['getDataValue']('permissions')[_0x9ba9('0x29')](','),function(_0x5d67ab){return parseInt(_0x5d67ab,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x9ba9('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9ba9('0x2')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9ba9('0x2')]},'phoneBarUnconditional':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9ba9('0xe')](_0x9ba9('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9ba9('0x2')]},'passwordResetAt':{'type':Sequelize[_0x9ba9('0x15')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x9ba9('0x4c')],'get':function(){return this['getDataValue'](_0x9ba9('0x4d'))?this[_0x9ba9('0x12')](_0x9ba9('0x4d')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize[_0x9ba9('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9ba9('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![],'set':function(_0x532247){if(typeof _0x532247==='string'){var _0x355f54=_0x532247==='1'?!![]:_0x532247==='0'?![]:_0x532247===_0x9ba9('0x4e')?!![]:_0x532247===_0x9ba9('0x4f')?![]:![];this[_0x9ba9('0x4')](_0x9ba9('0x50'),_0x355f54);}else{this[_0x9ba9('0x4')]('screenrecording',_0x532247);}}},'blocked':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![],'set':function(_0x350188){this[_0x9ba9('0x4')](_0x9ba9('0x51'),_0x350188);if(_0x350188===!![]){this[_0x9ba9('0x4')](_0x9ba9('0x52'),moment());this[_0x9ba9('0x4')](_0x9ba9('0x53'),0x0);}else{this[_0x9ba9('0x4')](_0x9ba9('0x52'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x9ba9('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x9ba9('0x13')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc9e6=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','nonat','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','wss','force_avp','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','blocked','blockedAt','loginAttempts','util','lodash','STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','callerid','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB','udp','join','transport','split'];(function(_0x4ce14e,_0x4c1e37){var _0x5a42a1=function(_0x10371e){while(--_0x10371e){_0x4ce14e['push'](_0x4ce14e['shift']());}};_0x5a42a1(++_0x4c1e37);}(_0xc9e6,0xe6));var _0x6c9e=function(_0x1aca8e,_0x114212){_0x1aca8e=_0x1aca8e-0x0;var _0x1b91f5=_0xc9e6[_0x1aca8e];return _0x1b91f5;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x6c9e('0x0'));var _=require(_0x6c9e('0x1'));module['exports']={'name':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x267c1b){this[_0x6c9e('0x3')](_0x6c9e('0x4'),_0x267c1b);this[_0x6c9e('0x3')](_0x6c9e('0x5'),_0x267c1b);},'comment':_0x6c9e('0x6')},'fullname':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':![],'set':function(_0x3adf76){this[_0x6c9e('0x3')](_0x6c9e('0x7'),_0x3adf76);this['setDataValue']('callerid',util[_0x6c9e('0x8')](_0x6c9e('0x9'),_0x3adf76,this['getDataValue'](_0x6c9e('0xa'))));}},'alias':{'type':Sequelize[_0x6c9e('0x2')]},'email':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':![],'unique':_0x6c9e('0xb'),'validate':{'isEmail':!![]},'set':function(_0x43bc4f){if(_0x43bc4f){this[_0x6c9e('0x3')]('email',_0x43bc4f[_0x6c9e('0xc')]());}}},'role':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0xe'),_0x6c9e('0xf'),_0x6c9e('0x10'),_0x6c9e('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x6c9e('0x12')},'internal':{'type':Sequelize[_0x6c9e('0x13')](0xb),'allowNull':![],'unique':_0x6c9e('0xa'),'set':function(_0x124565){this[_0x6c9e('0x3')]('internal',_0x124565);this[_0x6c9e('0x3')](_0x6c9e('0x14'),_0x124565);this[_0x6c9e('0x3')](_0x6c9e('0x15'),util[_0x6c9e('0x8')](_0x6c9e('0x9'),this[_0x6c9e('0x16')]('fullname'),_0x124565));}},'salt':{'type':Sequelize[_0x6c9e('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6c9e('0x2')]},'address':{'type':Sequelize[_0x6c9e('0x2')]},'zipcode':{'type':Sequelize[_0x6c9e('0x2')]},'userpic':{'type':Sequelize[_0x6c9e('0x2')]},'city':{'type':Sequelize[_0x6c9e('0x2')]},'country':{'type':Sequelize[_0x6c9e('0x2')]},'online':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6c9e('0x18')]},'voicePause':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x6c9e('0x19')},'lastPauseAt':{'type':Sequelize[_0x6c9e('0x18')]},'chatCapacity':{'type':Sequelize[_0x6c9e('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6c9e('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6c9e('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6c9e('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x6c9e('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x6c9e('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6c9e('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'host':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'port':{'type':Sequelize[_0x6c9e('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6c9e('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x1a'),_0x6c9e('0xf'),'peer'),'allowNull':!![],'defaultValue':_0x6c9e('0x1a')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x1b'),_0x6c9e('0x1c'),'ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x6c9e('0x1d')),'allowNull':!![]},'deny':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'permit':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'secret':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![],'defaultValue':_0x6c9e('0x1e'),'set':function(_0x12adf9){this[_0x6c9e('0x3')]('transport',_0x12adf9?_0x12adf9[_0x6c9e('0x1f')](','):null);},'get':function(){return this['getDataValue'](_0x6c9e('0x20'))?this[_0x6c9e('0x16')](_0x6c9e('0x20'))[_0x6c9e('0x21')](','):null;},'comment':_0x6c9e('0x22')},'dtmfmode':{'type':Sequelize['ENUM'](_0x6c9e('0x23'),_0x6c9e('0x24'),_0x6c9e('0x25'),_0x6c9e('0x26'),_0x6c9e('0x27')),'allowNull':!![],'defaultValue':_0x6c9e('0x23')},'directmedia':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no','nonat',_0x6c9e('0x29'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![],'defaultValue':_0x6c9e('0x2a'),'set':function(_0x26ad40){this[_0x6c9e('0x3')](_0x6c9e('0x2b'),_0x26ad40?_0x26ad40[_0x6c9e('0x1f')](','):null);},'get':function(){return this['getDataValue'](_0x6c9e('0x2b'))?this[_0x6c9e('0x16')]('nat')[_0x6c9e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x6c9e('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x6c9e('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x6c9e('0x2')]},'language':{'type':Sequelize[_0x6c9e('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6c9e('0x2')]},'disallow':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':![],'defaultValue':_0x6c9e('0x2c')},'allow':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':![],'defaultValue':_0x6c9e('0x2d'),'set':function(_0x207a85){this[_0x6c9e('0x3')](_0x6c9e('0x2e'),_0x207a85?_0x207a85['join'](';'):_0x6c9e('0x2d'));},'get':function(){return this[_0x6c9e('0x16')](_0x6c9e('0x2e'))?this['getDataValue']('allow')[_0x6c9e('0x21')](';'):null;},'comment':_0x6c9e('0x2f')},'autoframing':{'type':Sequelize[_0x6c9e('0xd')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x1603fc){this[_0x6c9e('0x3')](_0x6c9e('0x30'),_0x1603fc?_0x1603fc['join'](','):null);},'get':function(){return this[_0x6c9e('0x16')]('insecure')?this[_0x6c9e('0x16')](_0x6c9e('0x30'))[_0x6c9e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x6c9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no',_0x6c9e('0x31')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![],'defaultValue':_0x6c9e('0x32')},'amaflags':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6c9e('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0x6c9e('0x28')},'busylevel':{'type':Sequelize[_0x6c9e('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6c9e('0xd')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x6c9e('0x28'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no',_0x6c9e('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x6c9e('0x28'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x34'),_0x6c9e('0x35'),_0x6c9e('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6c9e('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x37'),_0x6c9e('0x38')),'allowNull':!![],'defaultValue':_0x6c9e('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6c9e('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0x6c9e('0x28')},'keepalive':{'type':Sequelize[_0x6c9e('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6c9e('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6c9e('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6c9e('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6c9e('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x6c9e('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x6c9e('0x28'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6c9e('0x28'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6c9e('0xd')]('yes','no',_0x6c9e('0x39'),_0x6c9e('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6c9e('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x3b'),_0x6c9e('0x3c'),_0x6c9e('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6c9e('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x6c9e('0x28'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x6c9e('0x28'),'no',_0x6c9e('0x3e'),'update','update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6c9e('0x2')]},'resetPasswordExpires':{'type':Sequelize[_0x6c9e('0x18')]},'showWebBar':{'type':Sequelize[_0x6c9e('0x13')],'defaultValue':0x0,'set':function(_0x1a2cd8){this[_0x6c9e('0x3')](_0x6c9e('0x3f'),_0x1a2cd8);var _0xe1b9ca=this[_0x6c9e('0x40')]({'plain':!![]});switch(_0x1a2cd8){case 0x0:case 0x1:var _0x80a7cf=_0xe1b9ca[_0x6c9e('0x20')]?_[_0x6c9e('0x41')](_0xe1b9ca[_0x6c9e('0x20')])?_0xe1b9ca[_0x6c9e('0x20')][_0x6c9e('0x1f')]():_0xe1b9ca[_0x6c9e('0x20')]:_0x6c9e('0x1e');if(_0x80a7cf==='wss'){_0x80a7cf=_0x6c9e('0x1e');}this[_0x6c9e('0x3')](_0x6c9e('0x20'),_0x80a7cf);this[_0x6c9e('0x3')](_0x6c9e('0x42'),'no');this[_0x6c9e('0x3')](_0x6c9e('0x43'),null);this['setDataValue']('force_avp',null);this[_0x6c9e('0x3')](_0x6c9e('0x44'),null);this[_0x6c9e('0x3')](_0x6c9e('0x45'),null);this['setDataValue'](_0x6c9e('0x46'),null);this['setDataValue'](_0x6c9e('0x47'),null);this[_0x6c9e('0x3')](_0x6c9e('0x48'),null);this[_0x6c9e('0x3')]('dtlsprivatekey',null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0x6c9e('0x3')](_0x6c9e('0x20'),_0x6c9e('0x49'));this[_0x6c9e('0x3')](_0x6c9e('0x42'),_0x6c9e('0x28'));this['setDataValue'](_0x6c9e('0x43'),'yes');this[_0x6c9e('0x3')](_0x6c9e('0x4a'),_0x6c9e('0x28'));this[_0x6c9e('0x3')]('icesupport',_0x6c9e('0x28'));this[_0x6c9e('0x3')](_0x6c9e('0x45'),_0x6c9e('0x28'));this[_0x6c9e('0x3')](_0x6c9e('0x46'),'no');this['setDataValue'](_0x6c9e('0x47'),_0x6c9e('0x3d'));this[_0x6c9e('0x3')]('dtlscertfile',_0xe1b9ca['dtlscertfile']||_0x6c9e('0x4b'));this[_0x6c9e('0x3')](_0x6c9e('0x4c'),_0xe1b9ca[_0x6c9e('0x4c')]||_0x6c9e('0x4d'));this[_0x6c9e('0x3')](_0x6c9e('0x4e'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x6c9e('0x4f')],'set':function(_0x4804f3){this[_0x6c9e('0x3')](_0x6c9e('0x50'),_0x4804f3?_0x4804f3[_0x6c9e('0x1f')](','):[]);},'get':function(){return this[_0x6c9e('0x16')]('permissions')?_['map'](this[_0x6c9e('0x16')](_0x6c9e('0x50'))[_0x6c9e('0x21')](','),function(_0x2e3431){return parseInt(_0x2e3431,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6c9e('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6c9e('0x2')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6c9e('0x2')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6c9e('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6c9e('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6c9e('0xd')](_0x6c9e('0x28'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6c9e('0x2')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x6c9e('0x16')](_0x6c9e('0x51'))?this[_0x6c9e('0x16')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6c9e('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![],'set':function(_0x4143ed){if(typeof _0x4143ed===_0x6c9e('0x52')){var _0x3155d7=_0x4143ed==='1'?!![]:_0x4143ed==='0'?![]:_0x4143ed===_0x6c9e('0x53')?!![]:_0x4143ed===_0x6c9e('0x54')?![]:![];this['setDataValue']('screenrecording',_0x3155d7);}else{this[_0x6c9e('0x3')]('screenrecording',_0x4143ed);}}},'blocked':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![],'set':function(_0x2d9953){this[_0x6c9e('0x3')](_0x6c9e('0x55'),_0x2d9953);if(_0x2d9953===!![]){this['setDataValue'](_0x6c9e('0x56'),moment());this[_0x6c9e('0x3')](_0x6c9e('0x57'),0x0);}else{this[_0x6c9e('0x3')](_0x6c9e('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x6c9e('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6c9e('0x17')],'defaultValue':![]}};
\ No newline at end of file
index 3348197..64dacc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ff2=['removeMailInteractions','addFaxInteractions','removeFaxInteractions','isArray','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$and','$gt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$iLike','$notILike','$like','$contains','$any','firstName','lastName','Contact','dialActive','VoiceQueue','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','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','redis','defaults','socket.io-emitter','jayson/promise','client','test','request','then','info','stringify','error','code','User,\x20%s,\x20%s','message','request\x20sent','result','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','update','destroy','get','Users','user','Agents','agent','telephone','ignore','map','value','includes','find','role','name','send','index','User','rawAttributes','type','differenceBy','password','salt','query','keys','filters','intersection','model','fields','attributes','length','limit','order','sort','where','merge','VIRTUAL','sequelize','lower','includeAll','include','findAll','rows','catch','show','options','bulkCreate','body','params','describe','addContacts','agent\x20role','admin','../../config/license/util','getLicense','telephones','users','isNil','License\x20limit\x20reached','create','internal','Setting','findById','securePassword','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','103','105','106','108','109','100','111','114','Unable\x20to\x20retrieve\x20the\x20current\x20user','Telephones','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','findOne','oldPassword','newPassword','Sequelize','ValidationError','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','channel','interface','isValidChannel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','ids','emit','voice','push','SIP/%s','voicePause','each','UserVoiceQueueRt','removeQueues','remove','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','download','existsSync','server/files/images/','getContacts','CmContact','pick','List','color','tag','hasOwnProperty','nolimit','getQueues','Queue','filter','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','UserId','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','loginInPause','format','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','socket','remoteAddress','connection','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','forEach','LOGIN','device','concat','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','openchannelPause','smsPause','lastPauseAt','Unknown\x20channel','unpause','manual','mail','chat','fax','sms','whatsapp','set','Pause','getTeams','Team','addTeams','omit','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','transaction','addAgent','getDataValue','Queue:save','removeTeams','Mail','Fax','Openchannel','flatten','removeAgent','getLists','CmList','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save'];(function(_0x1d4dc9,_0x4aafc8){var _0x37d837=function(_0x56d1d5){while(--_0x56d1d5){_0x1d4dc9['push'](_0x1d4dc9['shift']());}};_0x37d837(++_0x4aafc8);}(_0x3ff2,0x1b2));var _0x23ff=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ff2[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x23ff('0x0'));var emlformat=require(_0x23ff('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x23ff('0x2'));var jsonpatch=require(_0x23ff('0x3'));var rp=require(_0x23ff('0x4'));var moment=require('moment');var BPromise=require(_0x23ff('0x5'));var Mustache=require(_0x23ff('0x6'));var util=require(_0x23ff('0x7'));var path=require('path');var sox=require(_0x23ff('0x8'));var csv=require(_0x23ff('0x9'));var ejs=require(_0x23ff('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x23ff('0xb'));var crypto=require('crypto');var jsforce=require(_0x23ff('0xc'));var deskjs=require(_0x23ff('0xd'));var toCsv=require(_0x23ff('0x9'));var querystring=require(_0x23ff('0xe'));var Papa=require('papaparse');var Redis=require(_0x23ff('0xf'));var authService=require(_0x23ff('0x10'));var qs=require(_0x23ff('0x11'));var as=require(_0x23ff('0x12'));var hardwareService=require(_0x23ff('0x13'));var logger=require(_0x23ff('0x14'))(_0x23ff('0x15'));var utils=require(_0x23ff('0x16'));var config=require(_0x23ff('0x17'));var db=require(_0x23ff('0x18'))['db'];config[_0x23ff('0x19')]=_[_0x23ff('0x1a')](config[_0x23ff('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x23ff('0x1b'))(new Redis(config[_0x23ff('0x19')]));require('./user.socket')['register'](socket);var jayson=require(_0x23ff('0x1c'));var client=jayson[_0x23ff('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x194503,_0x4801ed,_0x1f9b39){if(_0x1f9b39){var _0x47a455=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x47a455[_0x23ff('0x1e')](_0x4801ed)){return _0x194503;}else{throw new db['Sequelize']['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x194503;}}function respondWithRpcPromise(_0xdca319,_0x6df967,_0xf32e68,_0x4b6fa5){return new BPromise(function(_0xe2c2d3,_0x49ccd7){var _0x33fce4=_0x4b6fa5||client;return _0x33fce4[_0x23ff('0x1f')](_0xdca319,_0xf32e68)[_0x23ff('0x20')](function(_0xb53b3f){logger[_0x23ff('0x21')]('User,\x20%s,\x20%s',_0x6df967,'request\x20sent');logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x6df967,'request\x20sent',JSON[_0x23ff('0x22')](_0xb53b3f));if(_0xb53b3f['error']){if(_0xb53b3f[_0x23ff('0x23')][_0x23ff('0x24')]===0x1f4){logger[_0x23ff('0x23')](_0x23ff('0x25'),_0x6df967,_0xb53b3f[_0x23ff('0x23')]['message']);return _0x49ccd7(_0xb53b3f[_0x23ff('0x23')][_0x23ff('0x26')]);}logger[_0x23ff('0x23')](_0x23ff('0x25'),_0x6df967,_0xb53b3f[_0x23ff('0x23')][_0x23ff('0x26')]);return _0xe2c2d3(_0xb53b3f[_0x23ff('0x23')][_0x23ff('0x26')]);}else{logger[_0x23ff('0x21')](_0x23ff('0x25'),_0x6df967,_0x23ff('0x27'));_0xe2c2d3(_0xb53b3f[_0x23ff('0x28')][_0x23ff('0x26')]);}})['catch'](function(_0x2f3678){logger['error'](_0x23ff('0x25'),_0x6df967,_0x2f3678);_0x49ccd7(_0x2f3678);});});}function respondWithStatusCode(_0x54b39e,_0x4b5bac){_0x4b5bac=_0x4b5bac||0xcc;return function(_0x3b44af){if(_0x3b44af){return _0x54b39e[_0x23ff('0x29')](_0x4b5bac);}return _0x54b39e[_0x23ff('0x2a')](_0x4b5bac)[_0x23ff('0x2b')]();};}function respondWithResult(_0x28e2e8,_0x3a6acc){_0x3a6acc=_0x3a6acc||0xc8;return function(_0x1d68c0){if(_0x1d68c0){return _0x28e2e8[_0x23ff('0x2a')](_0x3a6acc)[_0x23ff('0x2c')](_0x1d68c0);}};}function respondWithFilteredResult(_0x8b3ba0,_0x416a33){return function(_0x38591c){if(_0x38591c){var _0x1662ea=_0x38591c[_0x23ff('0x2d')],_0x379f9a=_0x416a33[_0x23ff('0x2e')],_0x38c348=_0x416a33['offset']+_0x416a33['limit'],_0x4fb3bb;if(_0x38c348>=_0x1662ea){_0x38c348=_0x1662ea;_0x4fb3bb=0xc8;}else{_0x4fb3bb=0xce;}_0x8b3ba0[_0x23ff('0x2a')](_0x4fb3bb);return _0x8b3ba0['set'](_0x23ff('0x2f'),_0x379f9a+'-'+_0x38c348+'/'+_0x1662ea)['json'](_0x38591c);}return null;};}function patchUpdates(_0x5c8ce7){return function(_0x49ea48){try{jsonpatch[_0x23ff('0x30')](_0x49ea48,_0x5c8ce7,!![]);}catch(_0x5eb278){return BPromise[_0x23ff('0x31')](_0x5eb278);}return _0x49ea48['save']();};}function saveUpdates(_0x5f0559,_0x2a8e17){return function(_0x396be2){if(_0x396be2){return _0x396be2[_0x23ff('0x32')](_0x5f0559)['then'](function(_0xcb29bb){return _0xcb29bb;});}return null;};}function removeEntity(_0xfa6b2a,_0x23818f){return function(_0xd07147){if(_0xd07147){return _0xd07147[_0x23ff('0x33')]()[_0x23ff('0x20')](function(){var _0x3dce24=_0xd07147[_0x23ff('0x34')]({'plain':!![]});var _0x28b9d9=[{'name':_0x23ff('0x35'),'value':_0x23ff('0x36'),'ignore':!![]},{'name':_0x23ff('0x37'),'value':_0x23ff('0x38'),'ignore':![]},{'name':'Telephones','value':_0x23ff('0x39'),'ignore':![]}];var _0x1d73f1=_(_0x28b9d9)['filter'](_0x23ff('0x3a'))[_0x23ff('0x3b')](_0x23ff('0x3c'))[_0x23ff('0x3c')]();if(_[_0x23ff('0x3d')](_0x1d73f1,_0x3dce24['role'])){return;}var _0xa9df57=_[_0x23ff('0x3e')](_0x28b9d9,[_0x23ff('0x3c'),_0x3dce24[_0x23ff('0x3f')]])['name'];return db['UserProfileResource'][_0x23ff('0x33')]({'where':{'type':_0xa9df57,'resourceId':_0x3dce24['id']}})[_0x23ff('0x20')](function(){return _0xd07147;});})[_0x23ff('0x20')](function(){_0xfa6b2a['status'](0xcc)[_0x23ff('0x2b')]();});}};}function handleEntityNotFound(_0x461b4e,_0x455594){return function(_0x178506){if(!_0x178506){_0x461b4e[_0x23ff('0x29')](0x194);}return _0x178506;};}function handleError(_0x23e1b3,_0x40b13f){_0x40b13f=_0x40b13f||0x1f4;return function(_0x439024){logger[_0x23ff('0x23')](_0x439024['stack']);if(_0x439024[_0x23ff('0x40')]){delete _0x439024[_0x23ff('0x40')];}_0x23e1b3[_0x23ff('0x2a')](_0x40b13f)[_0x23ff('0x41')](_0x439024);};}exports[_0x23ff('0x42')]=function(_0x1a7ddc,_0x3fa8fb){var _0xfafb18={},_0x289009={},_0x33a015={'count':0x0,'rows':[]};var _0x3f65a1=_['map'](db[_0x23ff('0x43')][_0x23ff('0x44')],function(_0x36cc29){return{'name':_0x36cc29['fieldName'],'type':_0x36cc29[_0x23ff('0x45')]['key']};});_0x289009['model']=_[_0x23ff('0x46')](_[_0x23ff('0x3b')](_0x3f65a1,_0x23ff('0x40')),[_0x23ff('0x47'),_0x23ff('0x48')]);_0x289009[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x1a7ddc[_0x23ff('0x49')]);_0x289009[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x289009[_0x23ff('0x4d')],_0x289009['query']);_0xfafb18['attributes']=_[_0x23ff('0x4c')](_0x289009['model'],qs[_0x23ff('0x4e')](_0x1a7ddc[_0x23ff('0x49')][_0x23ff('0x4e')]));_0xfafb18[_0x23ff('0x4f')]=_0xfafb18['attributes'][_0x23ff('0x50')]?_0xfafb18[_0x23ff('0x4f')]:_0x289009[_0x23ff('0x4d')];if(!_0x1a7ddc[_0x23ff('0x49')]['hasOwnProperty']('nolimit')){_0xfafb18[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x1a7ddc['query'][_0x23ff('0x51')]);_0xfafb18[_0x23ff('0x2e')]=qs[_0x23ff('0x2e')](_0x1a7ddc[_0x23ff('0x49')][_0x23ff('0x2e')]);}_0xfafb18[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x1a7ddc[_0x23ff('0x49')][_0x23ff('0x53')]);_0xfafb18[_0x23ff('0x54')]=qs[_0x23ff('0x4b')](_['pick'](_0x1a7ddc[_0x23ff('0x49')],_0x289009[_0x23ff('0x4b')]),_0x3f65a1);if(_0x1a7ddc['query']['filter']){_0xfafb18[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0xfafb18[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x3f65a1,function(_0x44e384){if(_0x44e384[_0x23ff('0x45')]!==_0x23ff('0x56')){return db[_0x23ff('0x57')]['where'](db[_0x23ff('0x57')]['fn'](_0x23ff('0x58'),db['sequelize']['col'](_0x44e384[_0x23ff('0x40')])),{'$like':db[_0x23ff('0x57')]['fn'](_0x23ff('0x58'),'%'+_0x1a7ddc['query']['filter']+'%')});}})});}_0xfafb18=_[_0x23ff('0x55')]({},_0xfafb18,_0x1a7ddc['options']);var _0x15ed42={'where':_0xfafb18['where']};return db[_0x23ff('0x43')][_0x23ff('0x2d')](_0x15ed42)[_0x23ff('0x20')](function(_0x2c82df){_0x33a015[_0x23ff('0x2d')]=_0x2c82df;if(_0x1a7ddc[_0x23ff('0x49')][_0x23ff('0x59')]){_0xfafb18[_0x23ff('0x5a')]=[{'all':!![]}];}return db[_0x23ff('0x43')][_0x23ff('0x5b')](_0xfafb18);})[_0x23ff('0x20')](function(_0x4346bc){_0x33a015[_0x23ff('0x5c')]=_0x4346bc;return _0x33a015;})[_0x23ff('0x20')](respondWithFilteredResult(_0x3fa8fb,_0xfafb18))[_0x23ff('0x5d')](handleError(_0x3fa8fb,null));};exports[_0x23ff('0x5e')]=function(_0x37b28e,_0x1a299b){var _0x2c7337={'raw':![],'where':{'id':_0x37b28e['params']['id']}},_0x531784={};_0x531784[_0x23ff('0x4d')]=_[_0x23ff('0x46')](_[_0x23ff('0x4a')](db[_0x23ff('0x43')][_0x23ff('0x44')]),[_0x23ff('0x47'),_0x23ff('0x48')]);_0x531784['query']=_[_0x23ff('0x4a')](_0x37b28e[_0x23ff('0x49')]);_0x531784[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x531784[_0x23ff('0x4d')],_0x531784['query']);_0x2c7337['attributes']=_['intersection'](_0x531784['model'],qs['fields'](_0x37b28e[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x2c7337[_0x23ff('0x4f')]=_0x2c7337['attributes']['length']?_0x2c7337['attributes']:_0x531784[_0x23ff('0x4d')];if(_0x37b28e['query'][_0x23ff('0x59')]){_0x2c7337[_0x23ff('0x5a')]=[{'all':!![]}];}_0x2c7337=_[_0x23ff('0x55')]({},_0x2c7337,_0x37b28e[_0x23ff('0x5f')]);return db[_0x23ff('0x43')][_0x23ff('0x3e')](_0x2c7337)['then'](handleEntityNotFound(_0x1a299b,null))[_0x23ff('0x20')](respondWithResult(_0x1a299b,null))[_0x23ff('0x5d')](handleError(_0x1a299b,null));};exports[_0x23ff('0x60')]=function(_0x4edd76,_0xcea64a){return db[_0x23ff('0x43')][_0x23ff('0x60')](_0x4edd76[_0x23ff('0x61')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xcea64a,0xc9))['catch'](handleError(_0xcea64a,null));};exports[_0x23ff('0x32')]=function(_0x7b57d4,_0x2b117e){if(_0x7b57d4[_0x23ff('0x61')]['id']){delete _0x7b57d4[_0x23ff('0x61')]['id'];}delete _0x7b57d4[_0x23ff('0x61')][_0x23ff('0x3f')];return db['User'][_0x23ff('0x3e')]({'where':{'id':_0x7b57d4[_0x23ff('0x62')]['id']}})['then'](handleEntityNotFound(_0x2b117e,null))[_0x23ff('0x20')](saveUpdates(_0x7b57d4[_0x23ff('0x61')],null))[_0x23ff('0x20')](respondWithResult(_0x2b117e,null))[_0x23ff('0x5d')](handleError(_0x2b117e,null));};exports['describe']=function(_0x47f951,_0x6ef7ba){return db[_0x23ff('0x43')][_0x23ff('0x63')]()[_0x23ff('0x20')](respondWithResult(_0x6ef7ba,null))['catch'](handleError(_0x6ef7ba,null));};exports[_0x23ff('0x64')]=function(_0x4ccb55,_0x1d1e81,_0x4a4554){return db['User'][_0x23ff('0x3e')]({'where':{'id':_0x4ccb55[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x1d1e81,null))[_0x23ff('0x20')](function(_0x249e50){if(_0x249e50){return _0x249e50['addContacts'](_0x4ccb55[_0x23ff('0x61')]['ids'],_['omit'](_0x4ccb55[_0x23ff('0x61')],['ids','id'])||{});}})[_0x23ff('0x20')](respondWithResult(_0x1d1e81,null))['catch'](handleError(_0x1d1e81,null));};var getLicense=function(_0x14f88d){return new BPromise(function(_0x312d76,_0x3653dd){var _0x3ba4fe=0x0;_0x14f88d['body'][_0x23ff('0x3f')]===_0x23ff('0x38')&&_0x312d76(_0x23ff('0x65'));return db['User'][_0x23ff('0x2d')]({'where':{'$or':[{'role':_0x14f88d[_0x23ff('0x61')][_0x23ff('0x3f')]===_0x23ff('0x39')?_0x23ff('0x39'):[_0x23ff('0x66'),_0x23ff('0x36')]}]}})[_0x23ff('0x20')](function(_0x278e3b){_0x3ba4fe=_0x278e3b;return require(_0x23ff('0x67'))[_0x23ff('0x68')]();})[_0x23ff('0x20')](function(_0x238e9b){var _0x3470dd=_0x14f88d[_0x23ff('0x61')][_0x23ff('0x3f')]===_0x23ff('0x39')?_0x23ff('0x69'):_0x23ff('0x6a');if(!_[_0x23ff('0x6b')](_0x238e9b[_0x3470dd])&&_0x3ba4fe>=_0x238e9b[_0x3470dd]){return _0x3653dd({'message':_0x23ff('0x6c')});}return _0x312d76(util['format']('count\x20%s:\x20%s',_0x3470dd,_0x3ba4fe));})[_0x23ff('0x5d')](function(_0x1696ab){return _0x3653dd(_0x1696ab);});});};exports[_0x23ff('0x6d')]=function(_0x39d257,_0x239664){return getLicense(_0x39d257)['then'](function(_0x327aa4){if(!_0x39d257['body'][_0x23ff('0x6e')]){var _0x59949f;return db[_0x23ff('0x6f')][_0x23ff('0x70')](0x1)['then'](function(_0x393750){return checkPasswordPattern(_0x393750,_0x39d257[_0x23ff('0x61')][_0x23ff('0x47')],_0x393750[_0x23ff('0x71')]);})[_0x23ff('0x20')](function(_0x1e92a1){_0x59949f=_0x1e92a1[_0x23ff('0x72')];return db[_0x23ff('0x43')]['max'](_0x23ff('0x6e'));})[_0x23ff('0x20')](function(_0x2d67be){if(_[_0x23ff('0x6b')](_0x2d67be)){if(_0x59949f){_0x39d257['body'][_0x23ff('0x6e')]=_0x59949f;}else{_0x39d257[_0x23ff('0x61')]['internal']=0x1;}}else{if(_[_0x23ff('0x6b')](_0x59949f)||_0x59949f==_0x2d67be){_0x39d257[_0x23ff('0x61')][_0x23ff('0x6e')]=_0x2d67be+0x1;}else if(_0x59949f>_0x2d67be){_0x39d257[_0x23ff('0x61')]['internal']=_0x59949f;}else{return db[_0x23ff('0x57')][_0x23ff('0x49')](_0x23ff('0x73'),{'type':db[_0x23ff('0x57')][_0x23ff('0x74')][_0x23ff('0x75')]})[_0x23ff('0x20')](function(_0x190379){if(_0x190379&&_0x190379[_0x23ff('0x50')]){for(var _0x35acd4=0x0,_0x1daa50=_0x190379[_0x23ff('0x50')];_0x35acd4<_0x1daa50&&_[_0x23ff('0x6b')](_0x39d257[_0x23ff('0x61')][_0x23ff('0x6e')]);_0x35acd4++){if(_0x59949f<=_0x190379[_0x35acd4][_0x23ff('0x76')]){_0x39d257[_0x23ff('0x61')][_0x23ff('0x6e')]=_0x190379[_0x35acd4][_0x23ff('0x76')];}else if(_0x59949f>_0x190379[_0x35acd4]['from']&&_0x59949f<=_0x190379[_0x35acd4]['to']){_0x39d257[_0x23ff('0x61')][_0x23ff('0x6e')]=_0x59949f;}}}if(_[_0x23ff('0x6b')](_0x39d257[_0x23ff('0x61')][_0x23ff('0x6e')])){_0x39d257[_0x23ff('0x61')][_0x23ff('0x6e')]=_0x2d67be+0x1;}});}}});}})[_0x23ff('0x20')](function(){if(_0x39d257[_0x23ff('0x61')][_0x23ff('0x77')]){_0x39d257[_0x23ff('0x61')][_0x23ff('0x78')]=_0x39d257[_0x23ff('0x61')][_0x23ff('0x6e')];_0x39d257[_0x23ff('0x61')][_0x23ff('0x79')]={'mailbox':_0x39d257[_0x23ff('0x61')][_0x23ff('0x6e')],'password':_0x39d257[_0x23ff('0x61')]['password'],'fullname':_0x39d257[_0x23ff('0x61')][_0x23ff('0x7a')],'email':_0x39d257['body'][_0x23ff('0x7b')]};}if(_0x39d257[_0x23ff('0x61')]&&_0x39d257[_0x23ff('0x61')][_0x23ff('0x3f')]===_0x23ff('0x38')){if(!_0x39d257['body'][_0x23ff('0x7c')]){_0x39d257['body'][_0x23ff('0x7c')]=[_0x23ff('0x7d'),'102',_0x23ff('0x7e'),'113','110','104',_0x23ff('0x7f'),_0x23ff('0x80'),'107',_0x23ff('0x81'),_0x23ff('0x82'),_0x23ff('0x83'),_0x23ff('0x84'),_0x23ff('0x85')];}}return db[_0x23ff('0x43')][_0x23ff('0x6d')](_0x39d257[_0x23ff('0x61')],{'include':[{'model':db[_0x23ff('0x79')],'as':_0x23ff('0x79')}]});})[_0x23ff('0x20')](function(_0x38e296){if(_0x39d257['body'][_0x23ff('0x3f')]==='user')return _0x38e296;var _0x119ad4=_0x39d257[_0x23ff('0x36')][_0x23ff('0x34')]({'plain':!![]});if(!_0x119ad4)throw new Error(_0x23ff('0x86'));if(_0x119ad4[_0x23ff('0x3f')]==='user'){var _0x3d9b35=_0x38e296['get']({'plain':!![]});var _0x1aae6c=[{'name':_0x23ff('0x37'),'value':_0x23ff('0x38')},{'name':_0x23ff('0x87'),'value':_0x23ff('0x39')}];var _0x62f625=_[_0x23ff('0x3e')](_0x1aae6c,[_0x23ff('0x3c'),_0x3d9b35[_0x23ff('0x3f')]])['name'];return db[_0x23ff('0x88')][_0x23ff('0x3e')]({'where':{'name':_0x62f625,'userProfileId':_0x119ad4[_0x23ff('0x89')]},'raw':!![]})['then'](function(_0x263e47){if(_0x263e47&&_0x263e47['autoAssociation']===0x0){return db[_0x23ff('0x8a')]['create']({'name':_0x3d9b35[_0x23ff('0x40')],'resourceId':_0x3d9b35['id'],'type':_0x263e47[_0x23ff('0x40')],'sectionId':_0x263e47['id']},{})[_0x23ff('0x20')](function(){return _0x38e296;});}else{return _0x38e296;}})[_0x23ff('0x5d')](function(_0x2156c7){logger[_0x23ff('0x23')](_0x23ff('0x8b'),_0x2156c7);throw _0x2156c7;});}return _0x38e296;})[_0x23ff('0x20')](respondWithResult(_0x239664,0xc9))['catch'](handleError(_0x239664,null));};exports[_0x23ff('0x8c')]=function(_0x9f4172,_0xd0f5e5,_0x311a49){var _0x23410a=![];if(_0x9f4172['body']['id']){delete _0x9f4172[_0x23ff('0x61')]['id'];}return db[_0x23ff('0x6f')][_0x23ff('0x8d')]({'attributes':['id',_0x23ff('0x71')]})[_0x23ff('0x20')](function(_0x42425a){_0x23410a=_0x42425a[_0x23ff('0x71')];return db['User']['find']({'where':{'id':_0x9f4172[_0x23ff('0x62')]['id']}});})['then'](function(_0x4daf3b){if(_0x4daf3b){if(_0x4daf3b['id']==_0x9f4172[_0x23ff('0x36')]['id']){if(!_0x9f4172[_0x23ff('0x61')][_0x23ff('0x8e')]||!_0x9f4172[_0x23ff('0x61')][_0x23ff('0x8f')]){throw new db[(_0x23ff('0x90'))][(_0x23ff('0x91'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x4daf3b[_0x23ff('0x92')](_0x9f4172[_0x23ff('0x61')]['oldPassword'])){throw new db['Sequelize'][(_0x23ff('0x91'))](_0x23ff('0x93'));}if(_0x9f4172[_0x23ff('0x61')][_0x23ff('0x8e')]==_0x9f4172['body'][_0x23ff('0x8f')]){throw new db[(_0x23ff('0x90'))][(_0x23ff('0x91'))](_0x23ff('0x94'));}return _0x4daf3b;}else if(_0x9f4172[_0x23ff('0x36')][_0x23ff('0x3f')]==_0x23ff('0x66')){if(!_0x9f4172[_0x23ff('0x61')]['newPassword']){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x4daf3b;}else if(_0x9f4172[_0x23ff('0x36')][_0x23ff('0x3f')]==_0x23ff('0x36')){if(!_0x9f4172[_0x23ff('0x61')][_0x23ff('0x8f')]){throw new db[(_0x23ff('0x90'))][(_0x23ff('0x91'))](_0x23ff('0x95'));}if(_0x4daf3b[_0x23ff('0x3f')]!=_0x23ff('0x38')){throw new db[(_0x23ff('0x90'))][(_0x23ff('0x91'))]('Unauthorized');}return _0x4daf3b;}else{throw new db[(_0x23ff('0x90'))][(_0x23ff('0x91'))](_0x23ff('0x96'));}}return null;})[_0x23ff('0x20')](handleEntityNotFound(_0xd0f5e5,null))[_0x23ff('0x20')](function(_0x580c41){return checkPasswordPattern(_0x580c41,_0x9f4172[_0x23ff('0x61')][_0x23ff('0x8f')],_0x23410a);})[_0x23ff('0x20')](saveUpdates({'password':_0x9f4172['body'][_0x23ff('0x8f')],'passwordResetAt':_0x9f4172[_0x23ff('0x36')]['id']==_0x9f4172[_0x23ff('0x62')]['id']?moment():null},null))['then'](respondWithResult(_0xd0f5e5,null))['catch'](handleError(_0xd0f5e5,null));};exports[_0x23ff('0x97')]=function(_0x3c9040,_0x5ebc55,_0xc2b749){var _0x4e2f51=_0x3c9040[_0x23ff('0x61')][_0x23ff('0x98')];return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x3c9040[_0x23ff('0x62')]['id']},'attributes':['id','name','role','online','loginInPause','voicePause',_0x23ff('0x99')]})[_0x23ff('0x20')](handleEntityNotFound(_0x5ebc55,null))[_0x23ff('0x20')](function(_0x1732c4){if(_0x1732c4){if(!utils[_0x23ff('0x9a')](_0x4e2f51)){throw new db[(_0x23ff('0x90'))][(_0x23ff('0x91'))]('Unknown\x20channel');}return _0x1732c4[_0x23ff('0x9b')+_[_0x23ff('0x9c')](_0x4e2f51[_0x23ff('0x9d')]())+_0x23ff('0x9e')](_0x3c9040[_0x23ff('0x61')]['ids'],{'penalty':_0x3c9040[_0x23ff('0x61')][_0x23ff('0x9f')]||0x0})[_0x23ff('0xa0')](function(_0x336325){for(var _0x8e976=0x0;_0x8e976<_0x3c9040['body']['ids'][_0x23ff('0x50')];_0x8e976+=0x1){var _0x419d14={'UserId':_0x3c9040['params']['id']};_0x419d14[_[_0x23ff('0x9c')](_0x4e2f51[_0x23ff('0x9d')]())+_0x23ff('0xa1')]=_0x3c9040[_0x23ff('0x61')][_0x23ff('0xa2')][_0x8e976];socket[_0x23ff('0xa3')](_0x23ff('0x36')+_[_0x23ff('0x9c')](_0x4e2f51[_0x23ff('0x9d')]())+'Queue:save',_0x419d14);}return _0x336325;})[_0x23ff('0x20')](function(){if(_0x4e2f51===_0x23ff('0xa4')){return db['VoiceQueue']['findAll']({'where':{'id':_0x3c9040[_0x23ff('0x61')][_0x23ff('0xa2')]||[]},'raw':!![],'attributes':['id',_0x23ff('0x40')]});}})[_0x23ff('0x20')](function(_0x5c8936){var _0x10f28b=_0x1732c4[_0x23ff('0x34')]({'plain':!![]});var _0x5eb3f3=[];if(_0x4e2f51===_0x23ff('0xa4')&&_0x10f28b[_0x23ff('0x3f')]===_0x23ff('0x38')&&_0x10f28b['online']){for(var _0x86bee1=0x0;_0x86bee1<_0x5c8936[_0x23ff('0x50')];_0x86bee1+=0x1){_0x5eb3f3[_0x23ff('0xa5')]({'membername':_0x10f28b[_0x23ff('0x40')],'UserId':_0x10f28b['id'],'queue_name':_0x5c8936[_0x86bee1]['name'],'VoiceQueueId':_0x5c8936[_0x86bee1]['id'],'interface':_[_0x23ff('0x6b')](_0x10f28b[_0x23ff('0x99')])?util['format'](_0x23ff('0xa6'),_0x10f28b[_0x23ff('0x40')]):_0x10f28b[_0x23ff('0x99')],'paused':_0x10f28b[_0x23ff('0xa7')]||![],'penalty':_0x3c9040[_0x23ff('0x61')][_0x23ff('0x9f')]||0x0});}return BPromise[_0x23ff('0xa8')](_0x5eb3f3,function(_0x2819a8){return db[_0x23ff('0xa9')]['upsert'](_0x2819a8);});}return _0x1732c4;});}})[_0x23ff('0x20')](respondWithStatusCode(_0x5ebc55,null))['catch'](handleError(_0x5ebc55,null));};exports[_0x23ff('0xaa')]=function(_0x5f44ea,_0x1b791c,_0x2b5542){var _0x5440d7;return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x5f44ea[_0x23ff('0x62')]['id']},'attributes':['id','name',_0x23ff('0x3f')]})[_0x23ff('0x20')](handleEntityNotFound(_0x1b791c,null))[_0x23ff('0x20')](function(_0x112277){if(_0x112277){_0x5440d7=_0x112277;if(!_0x5f44ea['query'][_0x23ff('0x98')]||!utils[_0x23ff('0x9a')](_0x5f44ea[_0x23ff('0x49')][_0x23ff('0x98')])){throw new db[(_0x23ff('0x90'))][(_0x23ff('0x91'))]('Unknown\x20channel');}return _0x112277[_0x23ff('0xab')+_[_0x23ff('0x9c')](_0x5f44ea['query'][_0x23ff('0x98')][_0x23ff('0x9d')]())+_0x23ff('0x9e')](_0x5f44ea[_0x23ff('0x49')][_0x23ff('0xa2')]);}})[_0x23ff('0x20')](function(_0x3c9975){for(var _0x3d3da8=0x0;_0x3d3da8<_0x5f44ea['query'][_0x23ff('0xa2')][_0x23ff('0x50')];_0x3d3da8+=0x1){var _0x187990={'UserId':_0x5f44ea['params']['id']};_0x187990[_['capitalize'](_0x5f44ea[_0x23ff('0x49')][_0x23ff('0x98')][_0x23ff('0x9d')]())+'QueueId']=_0x5f44ea['query'][_0x23ff('0xa2')][_0x3d3da8];socket[_0x23ff('0xa3')]('user'+_[_0x23ff('0x9c')](_0x5f44ea[_0x23ff('0x49')]['channel'][_0x23ff('0x9d')]())+_0x23ff('0xac'),_0x187990);}return _0x3c9975;})[_0x23ff('0x20')](function(){if(_0x5f44ea['query'][_0x23ff('0x98')]==='voice'){return db[_0x23ff('0xa9')][_0x23ff('0x33')]({'where':{'UserId':_0x5f44ea[_0x23ff('0x62')]['id'],'VoiceQueueId':_0x5f44ea[_0x23ff('0x49')]['ids']},'individualHooks':!![]})['then'](function(){return _0x5440d7;});}return _0x5440d7;})[_0x23ff('0x20')](respondWithStatusCode(_0x1b791c,null))[_0x23ff('0x5d')](handleError(_0x1b791c,null));};exports[_0x23ff('0xad')]=function(_0xe9a183,_0x28e07b,_0x5cfa99){_0xe9a183[_0x23ff('0x61')][_0x23ff('0xae')]=_0xe9a183[_0x23ff('0xaf')][_0x23ff('0xb0')];return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0xe9a183[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x28e07b,null))[_0x23ff('0x20')](saveUpdates(_0xe9a183['body'],null))[_0x23ff('0x20')](respondWithResult(_0x28e07b,null))[_0x23ff('0x5d')](handleError(_0x28e07b,null));};exports[_0x23ff('0xb1')]=function(_0x110faa,_0x537e6f,_0x124bbf){var _0x1535dd=path[_0x23ff('0xb2')](config['root'],'server/files/images/logos/default_profile.png');return db['User'][_0x23ff('0x3e')]({'where':{'id':_0x110faa['params']['id']},'attributes':['id',_0x23ff('0xae')],'raw':!![]})[_0x23ff('0x20')](handleEntityNotFound(_0x537e6f,null))[_0x23ff('0x20')](function(_0x476f5e){if(_0x476f5e){if(_['isNil'](_0x476f5e[_0x23ff('0xae')])){return _0x537e6f[_0x23ff('0xb3')](_0x1535dd);}else{if(!fs[_0x23ff('0xb4')](path['join'](config['root'],_0x23ff('0xb5'),_0x476f5e[_0x23ff('0xae')]))){return _0x537e6f[_0x23ff('0xb3')](_0x1535dd);}return _0x537e6f[_0x23ff('0xb3')](path[_0x23ff('0xb2')](config['root'],'server/files/images/',_0x476f5e['userpic']));}}})[_0x23ff('0x5d')](handleError(_0x537e6f,null));};exports[_0x23ff('0xb6')]=function(_0x11c286,_0x55c740,_0x5c40fc){var _0x20c4ce={};var _0x1a00e2={};var _0x1137ae;var _0x227ef1;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x11c286[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x55c740,null))['then'](function(_0x307789){if(_0x307789){_0x1137ae=_0x307789;_0x1a00e2['model']=_['keys'](db[_0x23ff('0xb7')][_0x23ff('0x44')]);_0x1a00e2[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x11c286[_0x23ff('0x49')]);_0x1a00e2['filters']=_[_0x23ff('0x4c')](_0x1a00e2[_0x23ff('0x4d')],_0x1a00e2[_0x23ff('0x49')]);_0x20c4ce['attributes']=_[_0x23ff('0x4c')](_0x1a00e2['model'],qs[_0x23ff('0x4e')](_0x11c286['query'][_0x23ff('0x4e')]));_0x20c4ce[_0x23ff('0x4f')]=_0x20c4ce['attributes']['length']?_0x20c4ce['attributes']:_0x1a00e2[_0x23ff('0x4d')];_0x20c4ce['order']=qs[_0x23ff('0x53')](_0x11c286[_0x23ff('0x49')][_0x23ff('0x53')]);_0x20c4ce['where']=qs[_0x23ff('0x4b')](_[_0x23ff('0xb8')](_0x11c286[_0x23ff('0x49')],_0x1a00e2[_0x23ff('0x4b')]));if(_0x11c286[_0x23ff('0x49')]['filter']){_0x20c4ce['where']=_['merge'](_0x20c4ce['where'],{'$or':_[_0x23ff('0x3b')](_0x20c4ce[_0x23ff('0x4f')],function(_0x4c250a){var _0x2b1fb6={};_0x2b1fb6[_0x4c250a]={'$like':'%'+_0x11c286[_0x23ff('0x49')]['filter']+'%'};return _0x2b1fb6;})});}_0x20c4ce=_[_0x23ff('0x55')]({},_0x20c4ce,_0x11c286[_0x23ff('0x5f')]);return _0x1137ae[_0x23ff('0xb6')](_0x20c4ce);}})[_0x23ff('0x20')](function(_0x40e3fb){if(_0x40e3fb){_0x227ef1=_0x40e3fb[_0x23ff('0x50')];if(_0x11c286['query']['hasOwnProperty']('includeAll')){_0x20c4ce[_0x23ff('0x5a')]=[{'model':db['CmList'],'as':_0x23ff('0xb9'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x23ff('0x40'),_0x23ff('0xba')],'where':_0x11c286[_0x23ff('0x49')][_0x23ff('0xbb')]?{'id':_0x11c286[_0x23ff('0x49')]['tag']}:undefined,'required':_0x11c286[_0x23ff('0x49')][_0x23ff('0xbb')]?!![]:![]}];}if(!_0x11c286[_0x23ff('0x49')][_0x23ff('0xbc')](_0x23ff('0xbd'))){_0x20c4ce[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x11c286[_0x23ff('0x49')][_0x23ff('0x51')]);_0x20c4ce[_0x23ff('0x2e')]=qs['offset'](_0x11c286['query'][_0x23ff('0x2e')]);}return _0x1137ae['getContacts'](_0x20c4ce);}})['then'](function(_0x39e4aa){if(_0x39e4aa){return _0x39e4aa?{'count':_0x227ef1,'rows':_0x39e4aa}:null;}})[_0x23ff('0x20')](respondWithResult(_0x55c740,null))[_0x23ff('0x5d')](handleError(_0x55c740,null));};exports[_0x23ff('0xbe')]=function(_0x177c57,_0x1149bf,_0x3d18cf){var _0x53797f;var _0x3aa4aa;var _0x272f7e={};var _0x4d109a;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x177c57[_0x23ff('0x62')]['id']},'attributes':['id',_0x23ff('0x40'),_0x23ff('0x3f')]})[_0x23ff('0x20')](handleEntityNotFound(_0x1149bf,null))[_0x23ff('0x20')](function(_0x55aab9){if(!utils['isValidChannel'](_0x177c57[_0x23ff('0x49')]['channel'])){throw new db[(_0x23ff('0x90'))][(_0x23ff('0x91'))]('Unknown\x20channel');}_0x53797f=_0x55aab9;var _0x155d87={};_0x155d87[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db[_[_0x23ff('0x9c')](_0x177c57[_0x23ff('0x49')][_0x23ff('0x98')])+_0x23ff('0xbf')]['rawAttributes']);_0x155d87[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x177c57[_0x23ff('0x49')]);_0x155d87[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x155d87[_0x23ff('0x4d')],_0x155d87[_0x23ff('0x49')]);_0x272f7e[_0x23ff('0x4f')]=_['intersection'](_0x155d87[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x177c57[_0x23ff('0x49')]['fields']));_0x272f7e[_0x23ff('0x4f')]=_0x272f7e[_0x23ff('0x4f')]['length']?_0x272f7e[_0x23ff('0x4f')]:_0x155d87[_0x23ff('0x4d')];_0x272f7e[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x177c57[_0x23ff('0x49')][_0x23ff('0x53')]);_0x272f7e[_0x23ff('0x54')]=qs['filters'](_[_0x23ff('0xb8')](_0x177c57['query'],_0x155d87['filters']));if(_0x177c57[_0x23ff('0x49')][_0x23ff('0xc0')]){_0x272f7e[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0x272f7e['where'],{'$or':_[_0x23ff('0x3b')](_0x272f7e[_0x23ff('0x4f')],function(_0x1307a0){var _0x55d478={};_0x55d478[_0x1307a0]={'$like':'%'+_0x177c57[_0x23ff('0x49')]['filter']+'%'};return _0x55d478;})});}_0x272f7e=_['merge']({},_0x272f7e,_0x177c57[_0x23ff('0x5f')]);switch(_0x53797f[_0x23ff('0x3f')]){case'admin':return db[_[_0x23ff('0x9c')](_0x177c57[_0x23ff('0x49')]['channel'])+_0x23ff('0xbf')][_0x23ff('0x5b')](_0x272f7e);case _0x23ff('0x36'):case _0x23ff('0x38'):return _0x53797f[_0x23ff('0x34')+_[_0x23ff('0x9c')](_0x177c57['query'][_0x23ff('0x98')])+'Queues'](_0x272f7e);default:throw new db[(_0x23ff('0x90'))]['ValidationError'](_0x23ff('0xc1'));}})['then'](function(_0xd42145){_0x4d109a=_0xd42145[_0x23ff('0x50')];if(!_0x177c57['query']['hasOwnProperty'](_0x23ff('0xbd'))){_0x272f7e[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x177c57[_0x23ff('0x49')][_0x23ff('0x51')]);_0x272f7e[_0x23ff('0x2e')]=qs['offset'](_0x177c57[_0x23ff('0x49')][_0x23ff('0x2e')]);}switch(_0x53797f['role']){case'admin':return db[_[_0x23ff('0x9c')](_0x177c57[_0x23ff('0x49')][_0x23ff('0x98')])+'Queue'][_0x23ff('0x5b')](_0x272f7e);case'user':case _0x23ff('0x38'):return _0x53797f[_0x23ff('0x34')+_[_0x23ff('0x9c')](_0x177c57[_0x23ff('0x49')]['channel'])+_0x23ff('0x9e')](_0x272f7e);}})[_0x23ff('0x20')](function(_0x7d2d50){return{'count':_0x4d109a,'rows':_0x7d2d50};})[_0x23ff('0x20')](respondWithResult(_0x1149bf,null))[_0x23ff('0x5d')](handleError(_0x1149bf,null));};exports[_0x23ff('0xc2')]=function(_0x28880d,_0x3cf5ee,_0x9c8934){var _0x34728b={};var _0x3824af={};var _0x3204de;var _0x26fcd0;return db[_0x23ff('0x43')]['findOne']({'where':{'id':_0x28880d[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x3cf5ee,null))[_0x23ff('0x20')](function(_0xbc1f2a){if(_0xbc1f2a){_0x3204de=_0xbc1f2a;_0x3824af[_0x23ff('0x4d')]=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x3824af[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x28880d[_0x23ff('0x49')]);_0x3824af[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x3824af[_0x23ff('0x4d')],_0x3824af[_0x23ff('0x49')]);_0x34728b['attributes']=_[_0x23ff('0x4c')](_0x3824af['model'],qs['fields'](_0x28880d[_0x23ff('0x49')]['fields']));_0x34728b[_0x23ff('0x4f')]=_0x34728b[_0x23ff('0x4f')][_0x23ff('0x50')]?_0x34728b[_0x23ff('0x4f')]:_0x3824af[_0x23ff('0x4d')];_0x34728b['order']=qs['sort'](_0x28880d[_0x23ff('0x49')]['sort']);_0x34728b[_0x23ff('0x54')]=qs[_0x23ff('0x4b')](_[_0x23ff('0xb8')](_0x28880d['query'],_0x3824af[_0x23ff('0x4b')]));if(_0x28880d[_0x23ff('0x49')]['filter']){_0x34728b[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0x34728b[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x34728b[_0x23ff('0x4f')],function(_0x498025){var _0x477ed6={};_0x477ed6[_0x498025]={'$like':'%'+_0x28880d[_0x23ff('0x49')][_0x23ff('0xc0')]+'%'};return _0x477ed6;})});}_0x34728b=_[_0x23ff('0x55')]({},_0x34728b,_0x28880d['options']);return _0x3204de['getVoiceQueuesRt'](_0x34728b);}})[_0x23ff('0x20')](function(_0x5cbae8){if(_0x5cbae8){_0x26fcd0=_0x5cbae8[_0x23ff('0x50')];if(!_0x28880d[_0x23ff('0x49')][_0x23ff('0xbc')](_0x23ff('0xbd'))){_0x34728b[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x28880d[_0x23ff('0x49')][_0x23ff('0x51')]);_0x34728b[_0x23ff('0x2e')]=qs['offset'](_0x28880d[_0x23ff('0x49')]['offset']);}return _0x3204de[_0x23ff('0xc2')](_0x34728b);}})[_0x23ff('0x20')](function(_0x280f20){if(_0x280f20){return _0x280f20?{'count':_0x26fcd0,'rows':_0x280f20}:null;}})[_0x23ff('0x20')](respondWithResult(_0x3cf5ee,null))['catch'](handleError(_0x3cf5ee,null));};exports[_0x23ff('0xc3')]=function(_0x5a28ca,_0x59527b,_0x41752a){var _0x4b4b54={};var _0x1083a2={};var _0x1d05df;var _0x502ecc;return db[_0x23ff('0x43')]['findOne']({'where':{'id':_0x5a28ca[_0x23ff('0x62')]['id']}})['then'](handleEntityNotFound(_0x59527b,null))[_0x23ff('0x20')](function(_0x454efc){if(_0x454efc){_0x1d05df=_0x454efc;_0x1083a2[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db[_0x23ff('0xc4')][_0x23ff('0x44')]);_0x1083a2[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x5a28ca['query']);_0x1083a2[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x1083a2[_0x23ff('0x4d')],_0x1083a2[_0x23ff('0x49')]);_0x4b4b54['attributes']=_[_0x23ff('0x4c')](_0x1083a2[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x5a28ca[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x4b4b54[_0x23ff('0x4f')]=_0x4b4b54[_0x23ff('0x4f')]['length']?_0x4b4b54[_0x23ff('0x4f')]:_0x1083a2[_0x23ff('0x4d')];_0x4b4b54[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x5a28ca[_0x23ff('0x49')]['sort']);_0x4b4b54['where']=qs[_0x23ff('0x4b')](_['pick'](_0x5a28ca[_0x23ff('0x49')],_0x1083a2[_0x23ff('0x4b')]));if(_0x5a28ca['query'][_0x23ff('0xc0')]){_0x4b4b54[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0x4b4b54[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x4b4b54[_0x23ff('0x4f')],function(_0x1aa8c4){var _0x46e3e7={};_0x46e3e7[_0x1aa8c4]={'$like':'%'+_0x5a28ca['query'][_0x23ff('0xc0')]+'%'};return _0x46e3e7;})});}_0x4b4b54=_[_0x23ff('0x55')]({},_0x4b4b54,_0x5a28ca['options']);return _0x1d05df[_0x23ff('0xc3')](_0x4b4b54);}})[_0x23ff('0x20')](function(_0x558afc){if(_0x558afc){_0x502ecc=_0x558afc['length'];if(!_0x5a28ca[_0x23ff('0x49')]['hasOwnProperty']('nolimit')){_0x4b4b54[_0x23ff('0x51')]=qs['limit'](_0x5a28ca[_0x23ff('0x49')][_0x23ff('0x51')]);_0x4b4b54[_0x23ff('0x2e')]=qs[_0x23ff('0x2e')](_0x5a28ca[_0x23ff('0x49')]['offset']);}return _0x1d05df[_0x23ff('0xc3')](_0x4b4b54);}})['then'](function(_0x5816c4){if(_0x5816c4){return _0x5816c4?{'count':_0x502ecc,'rows':_0x5816c4}:null;}})[_0x23ff('0x20')](respondWithResult(_0x59527b,null))[_0x23ff('0x5d')](handleError(_0x59527b,null));};exports[_0x23ff('0xc5')]=function(_0x47d526,_0x180bf9,_0x5d1ad2){var _0x49ecba={'raw':!![],'where':{}};var _0x3794d4={};var _0x4bc30f={'count':0x0,'rows':[]};return db['User'][_0x23ff('0x8d')]({'where':{'id':_0x47d526[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x180bf9,null))['then'](function(_0x460f5c){if(_0x460f5c){_0x3794d4[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db[_0x23ff('0xc6')][_0x23ff('0x44')]);_0x3794d4[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x47d526['query']);_0x3794d4['filters']=_['intersection'](_0x3794d4['model'],_0x3794d4[_0x23ff('0x49')]);_0x49ecba[_0x23ff('0x4f')]=_[_0x23ff('0x4c')](_0x3794d4[_0x23ff('0x4d')],qs['fields'](_0x47d526[_0x23ff('0x49')]['fields']));_0x49ecba[_0x23ff('0x4f')]=_0x49ecba[_0x23ff('0x4f')][_0x23ff('0x50')]?_0x49ecba[_0x23ff('0x4f')]:_0x3794d4[_0x23ff('0x4d')];if(!_0x47d526[_0x23ff('0x49')][_0x23ff('0xbc')]('nolimit')){_0x49ecba['limit']=qs[_0x23ff('0x51')](_0x47d526[_0x23ff('0x49')]['limit']);_0x49ecba[_0x23ff('0x2e')]=qs[_0x23ff('0x2e')](_0x47d526['query'][_0x23ff('0x2e')]);}_0x49ecba[_0x23ff('0x52')]=qs['sort'](_0x47d526[_0x23ff('0x49')][_0x23ff('0x53')]);_0x49ecba[_0x23ff('0x54')]=qs['filters'](_['pick'](_0x47d526[_0x23ff('0x49')],_0x3794d4[_0x23ff('0x4b')]));_0x49ecba['where']['UserId']=_0x460f5c['id'];if(_0x47d526[_0x23ff('0x49')][_0x23ff('0xc0')]){_0x49ecba[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0x49ecba[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x49ecba['attributes'],function(_0x60712){var _0x2b271f={};_0x2b271f[_0x60712]={'$like':'%'+_0x47d526[_0x23ff('0x49')]['filter']+'%'};return _0x2b271f;})});}_0x49ecba=_[_0x23ff('0x55')]({},_0x49ecba,_0x47d526[_0x23ff('0x5f')]);return db[_0x23ff('0xc6')]['count']({'where':_0x49ecba[_0x23ff('0x54')]})[_0x23ff('0x20')](function(_0x564a98){_0x4bc30f[_0x23ff('0x2d')]=_0x564a98;if(_0x47d526['query'][_0x23ff('0x59')]){_0x49ecba[_0x23ff('0x5a')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x49ecba);})['then'](function(_0x3a5578){_0x4bc30f[_0x23ff('0x5c')]=_0x3a5578;return _0x4bc30f;});}})[_0x23ff('0x20')](respondWithFilteredResult(_0x180bf9,_0x49ecba))[_0x23ff('0x5d')](handleError(_0x180bf9,null));};exports[_0x23ff('0xc7')]=function(_0x55d30b,_0x4b07ed,_0x14821b){var _0x1da44e={'raw':!![],'where':{}};var _0x41df13={};var _0x1c78b1={'count':0x0,'rows':[]};return db['User'][_0x23ff('0x8d')]({'where':{'id':_0x55d30b[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x4b07ed,null))[_0x23ff('0x20')](function(_0x22c8d0){if(_0x22c8d0){_0x41df13[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db['ScreenRecording'][_0x23ff('0x44')]);_0x41df13[_0x23ff('0x49')]=_['keys'](_0x55d30b[_0x23ff('0x49')]);_0x41df13[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x41df13[_0x23ff('0x4d')],_0x41df13[_0x23ff('0x49')]);_0x1da44e[_0x23ff('0x4f')]=_[_0x23ff('0x4c')](_0x41df13[_0x23ff('0x4d')],qs['fields'](_0x55d30b[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x1da44e['attributes']=_0x1da44e[_0x23ff('0x4f')][_0x23ff('0x50')]?_0x1da44e[_0x23ff('0x4f')]:_0x41df13[_0x23ff('0x4d')];if(!_0x55d30b[_0x23ff('0x49')][_0x23ff('0xbc')]('nolimit')){_0x1da44e['limit']=qs['limit'](_0x55d30b['query'][_0x23ff('0x51')]);_0x1da44e[_0x23ff('0x2e')]=qs['offset'](_0x55d30b[_0x23ff('0x49')]['offset']);}_0x1da44e[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x55d30b[_0x23ff('0x49')][_0x23ff('0x53')]);_0x1da44e[_0x23ff('0x54')]=qs[_0x23ff('0x4b')](_[_0x23ff('0xb8')](_0x55d30b[_0x23ff('0x49')],_0x41df13['filters']));_0x1da44e[_0x23ff('0x54')]['UserId']=_0x22c8d0['id'];if(_0x55d30b[_0x23ff('0x49')][_0x23ff('0xc0')]){_0x1da44e['where']=_[_0x23ff('0x55')](_0x1da44e['where'],{'$or':_[_0x23ff('0x3b')](_0x1da44e[_0x23ff('0x4f')],function(_0x32e1c1){var _0x5a9dfa={};_0x5a9dfa[_0x32e1c1]={'$like':'%'+_0x55d30b[_0x23ff('0x49')]['filter']+'%'};return _0x5a9dfa;})});}_0x1da44e=_[_0x23ff('0x55')]({},_0x1da44e,_0x55d30b[_0x23ff('0x5f')]);return db[_0x23ff('0xc8')][_0x23ff('0x2d')]({'where':_0x1da44e[_0x23ff('0x54')]})[_0x23ff('0x20')](function(_0x120334){_0x1c78b1[_0x23ff('0x2d')]=_0x120334;if(_0x55d30b[_0x23ff('0x49')][_0x23ff('0x59')]){_0x1da44e[_0x23ff('0x5a')]=[{'all':!![]}];}return db['ScreenRecording'][_0x23ff('0x5b')](_0x1da44e);})[_0x23ff('0x20')](function(_0x5d4713){_0x1c78b1[_0x23ff('0x5c')]=_0x5d4713;return _0x1c78b1;});}})['then'](respondWithFilteredResult(_0x4b07ed,_0x1da44e))[_0x23ff('0x5d')](handleError(_0x4b07ed,null));};exports['getChatInteractions']=function(_0x3d6cf9,_0xf18163,_0x570769){var _0x2e2ca8={};var _0x5f149b={};var _0x3e371c;var _0x4f7313;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x3d6cf9[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0xf18163,null))[_0x23ff('0x20')](function(_0x317ed4){if(_0x317ed4){_0x3e371c=_0x317ed4;_0x5f149b['model']=_[_0x23ff('0x4a')](db[_0x23ff('0xc9')][_0x23ff('0x44')]);_0x5f149b[_0x23ff('0x49')]=_['keys'](_0x3d6cf9['query']);_0x5f149b[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x5f149b['model'],_0x5f149b[_0x23ff('0x49')]);_0x2e2ca8[_0x23ff('0x4f')]=_[_0x23ff('0x4c')](_0x5f149b[_0x23ff('0x4d')],qs['fields'](_0x3d6cf9[_0x23ff('0x49')]['fields']));_0x2e2ca8['attributes']=_0x2e2ca8[_0x23ff('0x4f')]['length']?_0x2e2ca8['attributes']:_0x5f149b[_0x23ff('0x4d')];_0x2e2ca8[_0x23ff('0x52')]=qs['sort'](_0x3d6cf9['query'][_0x23ff('0x53')]);_0x2e2ca8[_0x23ff('0x54')]=qs[_0x23ff('0x4b')](_[_0x23ff('0xb8')](_0x3d6cf9['query'],_0x5f149b['filters']));if(_0x3d6cf9['query'][_0x23ff('0xc0')]){_0x2e2ca8['where']=_[_0x23ff('0x55')](_0x2e2ca8[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x2e2ca8[_0x23ff('0x4f')],function(_0x4cc6e6){var _0x50ee23={};_0x50ee23[_0x4cc6e6]={'$like':'%'+_0x3d6cf9['query'][_0x23ff('0xc0')]+'%'};return _0x50ee23;})});}_0x2e2ca8=_[_0x23ff('0x55')]({},_0x2e2ca8,_0x3d6cf9[_0x23ff('0x5f')]);return _0x3e371c[_0x23ff('0xca')](_0x2e2ca8);}})['then'](function(_0x713e06){if(_0x713e06){_0x4f7313=_0x713e06[_0x23ff('0x50')];if(!_0x3d6cf9['query']['hasOwnProperty'](_0x23ff('0xbd'))){_0x2e2ca8['limit']=qs[_0x23ff('0x51')](_0x3d6cf9['query']['limit']);_0x2e2ca8[_0x23ff('0x2e')]=qs['offset'](_0x3d6cf9[_0x23ff('0x49')][_0x23ff('0x2e')]);}return _0x3e371c[_0x23ff('0xca')](_0x2e2ca8);}})[_0x23ff('0x20')](function(_0x363ba5){if(_0x363ba5){return _0x363ba5?{'count':_0x4f7313,'rows':_0x363ba5}:null;}})[_0x23ff('0x20')](respondWithResult(_0xf18163,null))[_0x23ff('0x5d')](handleError(_0xf18163,null));};exports[_0x23ff('0xcb')]=function(_0x4bec3f,_0x3d3690,_0x3f3da7){var _0x46e0e3={};var _0x132b12={};var _0x2906ee;var _0x31fabb;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x4bec3f[_0x23ff('0x62')]['id']}})['then'](handleEntityNotFound(_0x3d3690,null))[_0x23ff('0x20')](function(_0x41dc51){if(_0x41dc51){_0x2906ee=_0x41dc51;_0x132b12[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db[_0x23ff('0xcc')][_0x23ff('0x44')]);_0x132b12[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x4bec3f[_0x23ff('0x49')]);_0x132b12[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x132b12[_0x23ff('0x4d')],_0x132b12['query']);_0x46e0e3['attributes']=_['intersection'](_0x132b12[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x4bec3f['query'][_0x23ff('0x4e')]));_0x46e0e3[_0x23ff('0x4f')]=_0x46e0e3['attributes']['length']?_0x46e0e3['attributes']:_0x132b12[_0x23ff('0x4d')];_0x46e0e3[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x4bec3f['query'][_0x23ff('0x53')]);_0x46e0e3[_0x23ff('0x54')]=qs[_0x23ff('0x4b')](_[_0x23ff('0xb8')](_0x4bec3f[_0x23ff('0x49')],_0x132b12[_0x23ff('0x4b')]));if(_0x4bec3f['query'][_0x23ff('0xc0')]){_0x46e0e3[_0x23ff('0x54')]=_['merge'](_0x46e0e3[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x46e0e3[_0x23ff('0x4f')],function(_0x2e8a92){var _0x4defea={};_0x4defea[_0x2e8a92]={'$like':'%'+_0x4bec3f['query'][_0x23ff('0xc0')]+'%'};return _0x4defea;})});}_0x46e0e3=_['merge']({},_0x46e0e3,_0x4bec3f[_0x23ff('0x5f')]);return _0x2906ee['getOpenchannelInteractions'](_0x46e0e3);}})[_0x23ff('0x20')](function(_0x45e655){if(_0x45e655){_0x31fabb=_0x45e655[_0x23ff('0x50')];if(!_0x4bec3f['query']['hasOwnProperty'](_0x23ff('0xbd'))){_0x46e0e3['limit']=qs[_0x23ff('0x51')](_0x4bec3f[_0x23ff('0x49')][_0x23ff('0x51')]);_0x46e0e3[_0x23ff('0x2e')]=qs['offset'](_0x4bec3f[_0x23ff('0x49')][_0x23ff('0x2e')]);}return _0x2906ee[_0x23ff('0xcb')](_0x46e0e3);}})[_0x23ff('0x20')](function(_0x3e440b){if(_0x3e440b){return _0x3e440b?{'count':_0x31fabb,'rows':_0x3e440b}:null;}})[_0x23ff('0x20')](respondWithResult(_0x3d3690,null))[_0x23ff('0x5d')](handleError(_0x3d3690,null));};exports['getMailInteractions']=function(_0x2e9536,_0x5606c5,_0xa60a6){var _0x369b7f={'raw':!![],'where':{}};var _0x4b2a85={};var _0x18eb7e={'count':0x0,'rows':[]};return db['User'][_0x23ff('0x8d')]({'where':{'id':_0x2e9536[_0x23ff('0x62')]['id']}})['then'](handleEntityNotFound(_0x5606c5,null))[_0x23ff('0x20')](function(_0xe4234d){if(_0xe4234d){_0x4b2a85[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db[_0x23ff('0xcd')][_0x23ff('0x44')]);_0x4b2a85[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x2e9536[_0x23ff('0x49')]);_0x4b2a85[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x4b2a85['model'],_0x4b2a85[_0x23ff('0x49')]);_0x369b7f['attributes']=_[_0x23ff('0x4c')](_0x4b2a85[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x2e9536[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x369b7f[_0x23ff('0x4f')]=_0x369b7f[_0x23ff('0x4f')]['length']?_0x369b7f[_0x23ff('0x4f')]:_0x4b2a85[_0x23ff('0x4d')];if(!_0x2e9536['query']['hasOwnProperty'](_0x23ff('0xbd'))){_0x369b7f[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x2e9536['query'][_0x23ff('0x51')]);_0x369b7f[_0x23ff('0x2e')]=qs[_0x23ff('0x2e')](_0x2e9536[_0x23ff('0x49')][_0x23ff('0x2e')]);}_0x369b7f[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x2e9536[_0x23ff('0x49')][_0x23ff('0x53')]);_0x369b7f[_0x23ff('0x54')]=qs[_0x23ff('0x4b')](_['pick'](_0x2e9536[_0x23ff('0x49')],_0x4b2a85['filters']));_0x369b7f['where'][_0x23ff('0xce')]=_0xe4234d['id'];if(_0x2e9536[_0x23ff('0x49')][_0x23ff('0xc0')]){_0x369b7f['where']=_[_0x23ff('0x55')](_0x369b7f['where'],{'$or':_[_0x23ff('0x3b')](_0x369b7f[_0x23ff('0x4f')],function(_0x17c40e){var _0x5bed31={};_0x5bed31[_0x17c40e]={'$like':'%'+_0x2e9536[_0x23ff('0x49')][_0x23ff('0xc0')]+'%'};return _0x5bed31;})});}_0x369b7f=_[_0x23ff('0x55')]({},_0x369b7f,_0x2e9536[_0x23ff('0x5f')]);return db[_0x23ff('0xcd')][_0x23ff('0x2d')]({'where':_0x369b7f[_0x23ff('0x54')]})[_0x23ff('0x20')](function(_0x24fbb8){_0x18eb7e[_0x23ff('0x2d')]=_0x24fbb8;if(_0x2e9536[_0x23ff('0x49')][_0x23ff('0x59')]){_0x369b7f[_0x23ff('0x5a')]=[{'all':!![]}];}return db[_0x23ff('0xcd')][_0x23ff('0x5b')](_0x369b7f);})[_0x23ff('0x20')](function(_0x3819b1){_0x18eb7e[_0x23ff('0x5c')]=_0x3819b1;return _0x18eb7e;});}})[_0x23ff('0x20')](respondWithFilteredResult(_0x5606c5,_0x369b7f))[_0x23ff('0x5d')](handleError(_0x5606c5,null));};exports[_0x23ff('0xcf')]=function(_0x5f3d8d,_0x2b7b13,_0x253940){var _0x32dec4={};var _0x3f057a={};var _0x4453bc;var _0x5bfd2b;return db['User']['findOne']({'where':{'id':_0x5f3d8d[_0x23ff('0x62')]['id']}})['then'](handleEntityNotFound(_0x2b7b13,null))[_0x23ff('0x20')](function(_0x52abc0){if(_0x52abc0){_0x4453bc=_0x52abc0;_0x3f057a[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db[_0x23ff('0xd0')]['rawAttributes']);_0x3f057a[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x5f3d8d['query']);_0x3f057a[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x3f057a[_0x23ff('0x4d')],_0x3f057a[_0x23ff('0x49')]);_0x32dec4[_0x23ff('0x4f')]=_[_0x23ff('0x4c')](_0x3f057a[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x5f3d8d[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x32dec4[_0x23ff('0x4f')]=_0x32dec4[_0x23ff('0x4f')][_0x23ff('0x50')]?_0x32dec4[_0x23ff('0x4f')]:_0x3f057a['model'];_0x32dec4[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x5f3d8d['query'][_0x23ff('0x53')]);_0x32dec4['where']=qs[_0x23ff('0x4b')](_[_0x23ff('0xb8')](_0x5f3d8d[_0x23ff('0x49')],_0x3f057a['filters']));if(_0x5f3d8d[_0x23ff('0x49')]['filter']){_0x32dec4[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0x32dec4[_0x23ff('0x54')],{'$or':_['map'](_0x32dec4[_0x23ff('0x4f')],function(_0x2996f9){var _0xa5a62b={};_0xa5a62b[_0x2996f9]={'$like':'%'+_0x5f3d8d[_0x23ff('0x49')][_0x23ff('0xc0')]+'%'};return _0xa5a62b;})});}_0x32dec4=_['merge']({},_0x32dec4,_0x5f3d8d[_0x23ff('0x5f')]);return _0x4453bc[_0x23ff('0xcf')](_0x32dec4);}})[_0x23ff('0x20')](function(_0x9ce52c){if(_0x9ce52c){_0x5bfd2b=_0x9ce52c['length'];if(!_0x5f3d8d[_0x23ff('0x49')][_0x23ff('0xbc')](_0x23ff('0xbd'))){_0x32dec4[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x5f3d8d[_0x23ff('0x49')][_0x23ff('0x51')]);_0x32dec4['offset']=qs[_0x23ff('0x2e')](_0x5f3d8d[_0x23ff('0x49')][_0x23ff('0x2e')]);}return _0x4453bc[_0x23ff('0xcf')](_0x32dec4);}})['then'](function(_0x3a1b47){if(_0x3a1b47){return _0x3a1b47?{'count':_0x5bfd2b,'rows':_0x3a1b47}:null;}})['then'](respondWithResult(_0x2b7b13,null))[_0x23ff('0x5d')](handleError(_0x2b7b13,null));};exports[_0x23ff('0xd1')]=function(_0x5ef696,_0x4f3ec6,_0x44551c){var _0x308e8d={};var _0x65a18a={};var _0x478c0a;var _0x446e2b;return db[_0x23ff('0x43')]['findOne']({'where':{'id':_0x5ef696['params']['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x4f3ec6,null))[_0x23ff('0x20')](function(_0x4e501a){if(_0x4e501a){_0x478c0a=_0x4e501a;_0x65a18a[_0x23ff('0x4d')]=_['keys'](db['FaxInteraction'][_0x23ff('0x44')]);_0x65a18a[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x5ef696[_0x23ff('0x49')]);_0x65a18a['filters']=_[_0x23ff('0x4c')](_0x65a18a[_0x23ff('0x4d')],_0x65a18a[_0x23ff('0x49')]);_0x308e8d[_0x23ff('0x4f')]=_[_0x23ff('0x4c')](_0x65a18a[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x5ef696[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x308e8d['attributes']=_0x308e8d[_0x23ff('0x4f')]['length']?_0x308e8d[_0x23ff('0x4f')]:_0x65a18a[_0x23ff('0x4d')];_0x308e8d[_0x23ff('0x52')]=qs['sort'](_0x5ef696['query'][_0x23ff('0x53')]);_0x308e8d[_0x23ff('0x54')]=qs['filters'](_[_0x23ff('0xb8')](_0x5ef696[_0x23ff('0x49')],_0x65a18a[_0x23ff('0x4b')]));if(_0x5ef696['query']['filter']){_0x308e8d[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0x308e8d[_0x23ff('0x54')],{'$or':_['map'](_0x308e8d['attributes'],function(_0x44b6d2){var _0x22be20={};_0x22be20[_0x44b6d2]={'$like':'%'+_0x5ef696[_0x23ff('0x49')]['filter']+'%'};return _0x22be20;})});}_0x308e8d=_[_0x23ff('0x55')]({},_0x308e8d,_0x5ef696['options']);return _0x478c0a[_0x23ff('0xd1')](_0x308e8d);}})[_0x23ff('0x20')](function(_0x40cc0b){if(_0x40cc0b){_0x446e2b=_0x40cc0b[_0x23ff('0x50')];if(!_0x5ef696[_0x23ff('0x49')][_0x23ff('0xbc')](_0x23ff('0xbd'))){_0x308e8d[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x5ef696[_0x23ff('0x49')][_0x23ff('0x51')]);_0x308e8d[_0x23ff('0x2e')]=qs[_0x23ff('0x2e')](_0x5ef696['query'][_0x23ff('0x2e')]);}return _0x478c0a[_0x23ff('0xd1')](_0x308e8d);}})['then'](function(_0x38e0a3){if(_0x38e0a3){return _0x38e0a3?{'count':_0x446e2b,'rows':_0x38e0a3}:null;}})[_0x23ff('0x20')](respondWithResult(_0x4f3ec6,null))[_0x23ff('0x5d')](handleError(_0x4f3ec6,null));};exports[_0x23ff('0xd2')]=function(_0x238951,_0x3b5689,_0x3ee862){var _0x594b38={};var _0x3109be={};var _0x5eb8d9;var _0x270130;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x238951[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x3b5689,null))[_0x23ff('0x20')](function(_0xcb439a){if(_0xcb439a){_0x5eb8d9=_0xcb439a;_0x3109be[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db[_0x23ff('0xd3')][_0x23ff('0x44')]);_0x3109be[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x238951[_0x23ff('0x49')]);_0x3109be['filters']=_['intersection'](_0x3109be[_0x23ff('0x4d')],_0x3109be[_0x23ff('0x49')]);_0x594b38[_0x23ff('0x4f')]=_[_0x23ff('0x4c')](_0x3109be[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x238951[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x594b38[_0x23ff('0x4f')]=_0x594b38[_0x23ff('0x4f')][_0x23ff('0x50')]?_0x594b38[_0x23ff('0x4f')]:_0x3109be[_0x23ff('0x4d')];_0x594b38['order']=qs[_0x23ff('0x53')](_0x238951[_0x23ff('0x49')][_0x23ff('0x53')]);_0x594b38['where']=qs[_0x23ff('0x4b')](_[_0x23ff('0xb8')](_0x238951[_0x23ff('0x49')],_0x3109be[_0x23ff('0x4b')]));if(_0x238951[_0x23ff('0x49')][_0x23ff('0xc0')]){_0x594b38[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0x594b38[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x594b38[_0x23ff('0x4f')],function(_0x3444de){var _0x4901e2={};_0x4901e2[_0x3444de]={'$like':'%'+_0x238951['query'][_0x23ff('0xc0')]+'%'};return _0x4901e2;})});}_0x594b38=_[_0x23ff('0x55')]({},_0x594b38,_0x238951[_0x23ff('0x5f')]);return _0x5eb8d9[_0x23ff('0xd2')](_0x594b38);}})[_0x23ff('0x20')](function(_0x50d781){if(_0x50d781){_0x270130=_0x50d781['length'];if(!_0x238951[_0x23ff('0x49')][_0x23ff('0xbc')]('nolimit')){_0x594b38[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x238951[_0x23ff('0x49')][_0x23ff('0x51')]);_0x594b38[_0x23ff('0x2e')]=qs[_0x23ff('0x2e')](_0x238951[_0x23ff('0x49')][_0x23ff('0x2e')]);}return _0x5eb8d9[_0x23ff('0xd2')](_0x594b38);}})[_0x23ff('0x20')](function(_0x56459b){if(_0x56459b){return _0x56459b?{'count':_0x270130,'rows':_0x56459b}:null;}})[_0x23ff('0x20')](respondWithResult(_0x3b5689,null))[_0x23ff('0x5d')](handleError(_0x3b5689,null));};exports[_0x23ff('0xd4')]=function(_0x382017,_0xa4ba2a,_0x335507){var _0x54ed18;var _0x225fc1;var _0x4c8092;var _0x19f0e6=!_[_0x23ff('0x6b')](_0x382017['params']['id'])?_0x382017['params']['id']:!_['isNil'](_0x382017[_0x23ff('0x36')]['id'])?_0x382017[_0x23ff('0x36')]['id']:null;return db[_0x23ff('0x43')]['find']({'where':{'id':_0x19f0e6,'role':{'$or':[_0x23ff('0x66'),_0x23ff('0x36'),_0x23ff('0x38')]}},'attributes':['id','name',_0x23ff('0xd5'),'mobile',_0x23ff('0x3f'),_0x23ff('0x6e'),_0x23ff('0xd6')]})[_0x23ff('0x20')](function(_0x358d12){if(_0x358d12){if(_0x358d12['role']===_0x23ff('0x38')){_0x54ed18=_0x358d12;if(_0x382017[_0x23ff('0x61')][_0x23ff('0x99')]){_0x4c8092=util[_0x23ff('0xd7')](_0x23ff('0xd8'),_0x54ed18[_0x382017['body'][_0x23ff('0x99')]]);}else if(_0x382017[_0x23ff('0x61')][_0x23ff('0xd9')]){_0x4c8092=util[_0x23ff('0xd7')](_0x23ff('0xa6'),_0x382017[_0x23ff('0x61')]['intrf']);}else{_0x4c8092=util[_0x23ff('0xd7')](_0x23ff('0xa6'),_0x54ed18[_0x23ff('0x40')]);}socket['to'](util['format']('user:%s',_0x54ed18[_0x23ff('0x40')]))[_0x23ff('0xa3')](_0x23ff('0xda'),{'ip':_0x382017[_0x23ff('0xdb')][_0x23ff('0xdc')]||_0x382017['connection']['remoteAddress']||_0x382017[_0x23ff('0xdd')][_0x23ff('0xde')]||_0x382017[_0x23ff('0xdf')][_0x23ff('0xdd')][_0x23ff('0xde')]});return db[_0x23ff('0xa9')]['destroy']({'where':{'membername':_0x54ed18[_0x23ff('0x40')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x23ff('0x91'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x23ff('0x20')](function(){if(_0x54ed18){return _0x54ed18[_0x23ff('0xe0')]({'raw':!![]});}})[_0x23ff('0x20')](function(_0x36b5b0){if(_0x54ed18){var _0x5d8c7b=[];if(_0x36b5b0){_0x225fc1=_0x36b5b0;if(_0x225fc1['length']){for(var _0x18a7ad=0x0;_0x18a7ad<_0x225fc1[_0x23ff('0x50')];_0x18a7ad++){_0x5d8c7b['push']({'membername':_0x54ed18[_0x23ff('0x40')],'UserId':_0x54ed18['id'],'queue_name':_0x225fc1[_0x18a7ad]['name'],'VoiceQueueId':_0x225fc1[_0x18a7ad]['id'],'interface':_0x4c8092,'paused':_0x54ed18[_0x23ff('0xd6')]||![],'penalty':_0x225fc1[_0x18a7ad][_0x23ff('0xe1')]||0x0});}return BPromise[_0x23ff('0xa8')](_0x5d8c7b,function(_0x23128d){return db[_0x23ff('0xa9')][_0x23ff('0xe2')](_0x23128d);});}}}})[_0x23ff('0x20')](function(){if(_0x54ed18){return db[_0x23ff('0xe3')][_0x23ff('0x5b')]({'where':{'membername':_0x54ed18[_0x23ff('0x40')],'exitAt':null}});}})[_0x23ff('0x20')](function(_0xe354fa){if(_0x54ed18){var _0x368364=[];_0xe354fa['forEach'](function(_0x503f8b){_0x368364[_0x23ff('0xa5')](_0x503f8b[_0x23ff('0x32')]({'exitAt':moment()[_0x23ff('0xd7')](_0x23ff('0xe4'))}));});return BPromise[_0x23ff('0xe5')](_0x368364);}})[_0x23ff('0x20')](function(){if(_0x54ed18){var _0x3a5af8=[];var _0x5e8559=[];var _0x1d9f3c=utils[_0x23ff('0xe6')]();var _0x90f6ea={'membername':_0x54ed18[_0x23ff('0x40')],'interface':_0x4c8092,'enterAt':moment()[_0x23ff('0xd7')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x54ed18[_0x23ff('0x3f')],'internal':_0x54ed18[_0x23ff('0x6e')]};_0x1d9f3c[_0x23ff('0xe7')](function(_0x98c4ea){_0x3a5af8[_0x23ff('0xa5')](_[_0x23ff('0x55')]({'channel':_0x98c4ea,'type':_0x23ff('0xe8'),'data1':_0x382017[_0x23ff('0x61')][_0x23ff('0xe9')],'data2':_0x4c8092},_0x90f6ea));if(_0x54ed18[_0x23ff('0xd6')]){_0x5e8559[_0x23ff('0xa5')](_[_0x23ff('0x55')]({'channel':_0x98c4ea,'type':'PAUSE','data1':'LOGININPAUSE'},_0x90f6ea));}});return db[_0x23ff('0xe3')]['bulkCreate'](_0x3a5af8[_0x23ff('0xea')](_0x5e8559),{'individualHooks':!![]});}})[_0x23ff('0x20')](function(){if(_0x54ed18){return _0x54ed18['update']({'online':!![],'lastLoginAt':moment()[_0x23ff('0xd7')](_0x23ff('0xe4')),'voicePause':_0x54ed18[_0x23ff('0xd6')]||![],'mailPause':_0x54ed18[_0x23ff('0xd6')]||![],'chatPause':_0x54ed18[_0x23ff('0xd6')]||![],'faxPause':_0x54ed18[_0x23ff('0xd6')]||![],'smsPause':_0x54ed18[_0x23ff('0xd6')]||![],'openchannelPause':_0x54ed18[_0x23ff('0xd6')]||![],'whatsappPause':_0x54ed18[_0x23ff('0xd6')]||![],'pauseType':_0x54ed18[_0x23ff('0xd6')]?_0x23ff('0xeb'):null,'interface':_0x4c8092,'lastPauseAt':moment()[_0x23ff('0xd7')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x23ff('0x20')](function(_0x2c7e21){if(_0x382017[_0x23ff('0xec')]){return _0x335507();}else{return BPromise[_0x23ff('0xed')](_0x2c7e21)[_0x23ff('0x20')](respondWithResult(_0xa4ba2a,null));}})[_0x23ff('0x5d')](handleError(_0xa4ba2a,null));};exports[_0x23ff('0xee')]=function(_0x470217,_0x234f5a,_0x3e35bf){var _0x18b2e0;return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x470217['params']['id'],'role':_0x23ff('0x38')},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x234f5a,null))[_0x23ff('0x20')](function(_0x156f28){if(_0x156f28){_0x18b2e0=_0x156f28;return db[_0x23ff('0xa9')][_0x23ff('0x33')]({'where':{'membername':_0x18b2e0[_0x23ff('0x40')]},'individualHooks':!![]});}})[_0x23ff('0x20')](function(){return db[_0x23ff('0xe3')]['findAll']({'where':{'membername':_0x18b2e0['name'],'exitAt':null}});})[_0x23ff('0x20')](function(_0x1342d9){var _0x40a17b=[];_0x1342d9['forEach'](function(_0xe98c51){_0x40a17b[_0x23ff('0xa5')](_0xe98c51[_0x23ff('0x32')]({'exitAt':moment()[_0x23ff('0xd7')](_0x23ff('0xe4'))}));});return BPromise[_0x23ff('0xe5')](_0x40a17b);})[_0x23ff('0x20')](function(){return _0x18b2e0[_0x23ff('0x32')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x23ff('0x20')](respondWithResult(_0x234f5a,null))[_0x23ff('0x5d')](handleError(_0x234f5a,null));};exports[_0x23ff('0xef')]=function(_0x51192b,_0x5db7bf,_0x21c5c6){var _0x314d72;return db[_0x23ff('0xa9')]['update']({'paused':0x1},{'where':{'UserId':_0x51192b['params']['id']},'individualHooks':!![]})[_0x23ff('0x20')](function(){return db[_0x23ff('0x43')]['find']({'where':{'id':_0x51192b[_0x23ff('0x62')]['id'],'role':'agent'},'attributes':['id','name',_0x23ff('0x3f'),_0x23ff('0x6e'),_0x23ff('0x99')]});})[_0x23ff('0x20')](handleEntityNotFound(_0x5db7bf,null))[_0x23ff('0x20')](function(_0x48f49e){if(_0x48f49e){_0x314d72=_0x48f49e;return respondWithRpcPromise(_0x23ff('0xf0'),_0x23ff('0xef'),{'id':_0x314d72['id'],'name':_0x314d72[_0x23ff('0x40')],'pause':!![]});}})[_0x23ff('0x20')](function(){if(_0x314d72){return db['MemberReport'][_0x23ff('0x5b')]({'where':{'membername':_0x314d72[_0x23ff('0x40')],'type':_0x23ff('0xf1'),'exitAt':null}});}})[_0x23ff('0x20')](function(_0x203a60){if(_0x203a60[_0x23ff('0x50')]){var _0x408c56=moment()[_0x23ff('0xd7')](_0x23ff('0xe4'));for(var _0x13c1c7=0x0,_0xd035be=_0x203a60[_0x23ff('0x50')];_0x13c1c7<_0xd035be;_0x13c1c7++){_0x203a60[_0x13c1c7][_0x23ff('0xf2')]({'exitAt':_0x408c56});}}})[_0x23ff('0x20')](function(){var _0x37db6a=[];var _0x43b63c=utils[_0x23ff('0xe6')]();_0x43b63c[_0x23ff('0xe7')](function(_0x16fe9b){_0x37db6a[_0x23ff('0xa5')]({'channel':_0x16fe9b,'membername':_0x314d72[_0x23ff('0x40')],'interface':_[_0x23ff('0x6b')](_0x314d72[_0x23ff('0x99')])?util[_0x23ff('0xd7')]('SIP/%s',_0x314d72[_0x23ff('0x40')]):_0x314d72[_0x23ff('0x99')],'type':_0x23ff('0xf1'),'enterAt':moment()[_0x23ff('0xd7')](_0x23ff('0xe4')),'data1':_0x51192b[_0x23ff('0x61')][_0x23ff('0x45')]||_0x23ff('0xf3'),'role':_0x314d72[_0x23ff('0x3f')],'internal':_0x314d72['internal']});});return db[_0x23ff('0xe3')][_0x23ff('0x60')](_0x37db6a,{'individualHooks':!![]});})[_0x23ff('0x20')](function(){return _0x314d72[_0x23ff('0x32')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x51192b[_0x23ff('0x61')]['type']||_0x23ff('0xf3'),'lastPauseAt':moment()[_0x23ff('0xd7')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x23ff('0x20')](respondWithResult(_0x5db7bf,null))[_0x23ff('0x5d')](handleError(_0x5db7bf,null));};exports['unpause']=function(_0x8bde00,_0x3a323f,_0x92fdda){var _0x3efbff;return db['User'][_0x23ff('0x3e')]({'where':{'id':_0x8bde00[_0x23ff('0x62')]['id']},'attributes':['id',_0x23ff('0x40'),'role',_0x23ff('0xa7'),_0x23ff('0xf4'),_0x23ff('0xf5'),_0x23ff('0xf6'),_0x23ff('0xf7'),_0x23ff('0xf8'),'whatsapppause','pauseType',_0x23ff('0xf9')]})[_0x23ff('0x20')](handleEntityNotFound(_0x3a323f,null))[_0x23ff('0x20')](function(_0x258397){if(_0x258397){_0x3efbff=_0x258397;if(_0x8bde00['body'][_0x23ff('0x98')]&&!utils[_0x23ff('0x9a')](_0x8bde00['body'][_0x23ff('0x98')])){throw new db[(_0x23ff('0x90'))][(_0x23ff('0x91'))](_0x23ff('0xfa'));}switch(_0x8bde00[_0x23ff('0x61')]['channel']){case _0x23ff('0xa4'):return respondWithRpcPromise(_0x23ff('0xf0'),_0x23ff('0xfb'),{'id':_0x3efbff['id'],'name':_0x3efbff[_0x23ff('0x40')],'pause':![]})[_0x23ff('0x20')](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x3efbff['id']},'individualHooks':!![]});})[_0x23ff('0x20')](function(){return db['MemberReport']['find']({'where':{'channel':_0x8bde00[_0x23ff('0x61')][_0x23ff('0x98')],'membername':_0x3efbff['name'],'type':_0x23ff('0xf1'),'exitAt':null}});})[_0x23ff('0x20')](function(_0x5c88be){if(_0x5c88be){return _0x5c88be[_0x23ff('0x32')]({'exitAt':moment()[_0x23ff('0xd7')](_0x23ff('0xe4')),'data2':_0x23ff('0xfc')},{'individualHooks':!![]});}return null;})[_0x23ff('0x20')](function(){return _0x3efbff[_0x23ff('0x32')]({'voicePause':![]});});case _0x23ff('0xfd'):case _0x23ff('0xfe'):case _0x23ff('0xff'):case _0x23ff('0x100'):case _0x23ff('0x101'):case'openchannel':return db[_0x23ff('0xe3')][_0x23ff('0x3e')]({'where':{'channel':_0x8bde00[_0x23ff('0x61')][_0x23ff('0x98')],'membername':_0x3efbff[_0x23ff('0x40')],'type':_0x23ff('0xf1'),'exitAt':null}})[_0x23ff('0x20')](function(_0x4af2fc){if(_0x4af2fc){return _0x4af2fc[_0x23ff('0x32')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x23ff('0xfc')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x3c2ac0={};_[_0x23ff('0x102')](_0x3c2ac0,util[_0x23ff('0xd7')]('%s%s',_0x8bde00[_0x23ff('0x61')][_0x23ff('0x98')],_0x23ff('0x103')),![]);return _0x3efbff[_0x23ff('0x32')](_0x3c2ac0);});default:return respondWithRpcPromise('QueuePause',_0x23ff('0xfb'),{'id':_0x3efbff['id'],'name':_0x3efbff[_0x23ff('0x40')],'pause':![]})[_0x23ff('0x20')](function(){return db[_0x23ff('0xa9')]['update']({'paused':0x0},{'where':{'UserId':_0x3efbff['id']}});})[_0x23ff('0x20')](function(){return db[_0x23ff('0xe3')][_0x23ff('0x5b')]({'where':{'membername':_0x3efbff[_0x23ff('0x40')],'type':_0x23ff('0xf1'),'exitAt':null}});})['then'](function(_0x479a7d){var _0x34dd0b=[];_0x479a7d[_0x23ff('0xe7')](function(_0x1bce45){_0x34dd0b['push'](_0x1bce45[_0x23ff('0x32')]({'exitAt':moment()['format'](_0x23ff('0xe4')),'data2':_0x23ff('0xfc')}));});return BPromise[_0x23ff('0xe5')](_0x34dd0b);})[_0x23ff('0x20')](function(){return _0x3efbff[_0x23ff('0x32')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x23ff('0x20')](respondWithResult(_0x3a323f,null))[_0x23ff('0x5d')](handleError(_0x3a323f,null));};exports[_0x23ff('0x104')]=function(_0x29f6ab,_0x5b7d02,_0x21ec96){var _0xfe101e={};var _0x4d1686={};var _0x2880af;var _0x118558;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x29f6ab['params']['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x5b7d02,null))[_0x23ff('0x20')](function(_0x4cd0a9){if(_0x4cd0a9){_0x2880af=_0x4cd0a9;_0x4d1686[_0x23ff('0x4d')]=_['keys'](db[_0x23ff('0x105')][_0x23ff('0x44')]);_0x4d1686[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x29f6ab['query']);_0x4d1686['filters']=_[_0x23ff('0x4c')](_0x4d1686['model'],_0x4d1686[_0x23ff('0x49')]);_0xfe101e[_0x23ff('0x4f')]=_[_0x23ff('0x4c')](_0x4d1686[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x29f6ab[_0x23ff('0x49')][_0x23ff('0x4e')]));_0xfe101e['attributes']=_0xfe101e[_0x23ff('0x4f')]['length']?_0xfe101e[_0x23ff('0x4f')]:_0x4d1686[_0x23ff('0x4d')];_0xfe101e[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x29f6ab[_0x23ff('0x49')][_0x23ff('0x53')]);_0xfe101e['where']=qs[_0x23ff('0x4b')](_[_0x23ff('0xb8')](_0x29f6ab['query'],_0x4d1686[_0x23ff('0x4b')]));if(_0x29f6ab[_0x23ff('0x49')][_0x23ff('0xc0')]){_0xfe101e[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0xfe101e[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0xfe101e[_0x23ff('0x4f')],function(_0xb14003){var _0x3735c6={};_0x3735c6[_0xb14003]={'$like':'%'+_0x29f6ab[_0x23ff('0x49')][_0x23ff('0xc0')]+'%'};return _0x3735c6;})});}_0xfe101e=_[_0x23ff('0x55')]({},_0xfe101e,_0x29f6ab[_0x23ff('0x5f')]);return _0x2880af[_0x23ff('0x104')](_0xfe101e);}})[_0x23ff('0x20')](function(_0x2c11d7){if(_0x2c11d7){_0x118558=_0x2c11d7['length'];if(!_0x29f6ab[_0x23ff('0x49')][_0x23ff('0xbc')](_0x23ff('0xbd'))){_0xfe101e[_0x23ff('0x51')]=qs['limit'](_0x29f6ab[_0x23ff('0x49')]['limit']);_0xfe101e[_0x23ff('0x2e')]=qs[_0x23ff('0x2e')](_0x29f6ab[_0x23ff('0x49')][_0x23ff('0x2e')]);}return _0x2880af['getTeams'](_0xfe101e);}})['then'](function(_0x45540a){if(_0x45540a){return _0x45540a?{'count':_0x118558,'rows':_0x45540a}:null;}})[_0x23ff('0x20')](respondWithResult(_0x5b7d02,null))['catch'](handleError(_0x5b7d02,null));};exports[_0x23ff('0x106')]=function(_0x253c6f,_0x5e6357){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x253c6f[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x5e6357,null))['then'](function(_0x1154db){if(_0x1154db){var _0x1b47ee=_0x1154db['get']({'plain':!![]});return _0x1154db[_0x23ff('0x106')](_0x253c6f['body'][_0x23ff('0xa2')],_[_0x23ff('0x107')](_0x253c6f[_0x23ff('0x61')],[_0x23ff('0xa2'),'id'])||{})[_0x23ff('0x20')](function(){for(var _0x8351ec=0x0;_0x8351ec<_0x253c6f[_0x23ff('0x61')][_0x23ff('0xa2')][_0x23ff('0x50')];_0x8351ec++){var _0x2c3ed3=[];db[_0x23ff('0x105')][_0x23ff('0x8d')]({'where':{'id':_0x253c6f['body'][_0x23ff('0xa2')][_0x8351ec]}})['then'](function(_0x1a8f5c){_0x2c3ed3[_0x23ff('0xa5')](_0x1a8f5c[_0x23ff('0xe0')]()['then'](function(_0xcd6893){for(var _0x14cae7=0x0;_0x14cae7<_0xcd6893['length'];_0x14cae7++){_0xcd6893[_0x14cae7][_0x23ff('0x108')](_0x23ff('0x98'),_0x23ff('0x109'));}return _0xcd6893;}));_0x2c3ed3[_0x23ff('0xa5')](_0x1a8f5c[_0x23ff('0x10a')]()[_0x23ff('0x20')](function(_0x159bb1){for(var _0xb602d9=0x0;_0xb602d9<_0x159bb1[_0x23ff('0x50')];_0xb602d9++){_0x159bb1[_0xb602d9][_0x23ff('0x108')]('channel',_0x23ff('0x10b'));}return _0x159bb1;}));_0x2c3ed3[_0x23ff('0xa5')](_0x1a8f5c[_0x23ff('0x10c')]()[_0x23ff('0x20')](function(_0x430cc8){for(var _0x239575=0x0;_0x239575<_0x430cc8[_0x23ff('0x50')];_0x239575++){_0x430cc8[_0x239575]['setDataValue']('channel','Mail');}return _0x430cc8;}));_0x2c3ed3[_0x23ff('0xa5')](_0x1a8f5c['getSmsQueues']()['then'](function(_0x3e53ca){for(var _0x4033b6=0x0;_0x4033b6<_0x3e53ca['length'];_0x4033b6++){_0x3e53ca[_0x4033b6][_0x23ff('0x108')](_0x23ff('0x98'),_0x23ff('0x10d'));}return _0x3e53ca;}));_0x2c3ed3[_0x23ff('0xa5')](_0x1a8f5c[_0x23ff('0x10e')]()[_0x23ff('0x20')](function(_0x3ed2b4){for(var _0x3e56dc=0x0;_0x3e56dc<_0x3ed2b4[_0x23ff('0x50')];_0x3e56dc++){_0x3ed2b4[_0x3e56dc]['setDataValue'](_0x23ff('0x98'),_0x23ff('0x10f'));}return _0x3ed2b4;}));_0x2c3ed3[_0x23ff('0xa5')](_0x1a8f5c[_0x23ff('0x110')]()['then'](function(_0xf04e22){for(var _0x581353=0x0;_0x581353<_0xf04e22['length'];_0x581353++){_0xf04e22[_0x581353][_0x23ff('0x108')](_0x23ff('0x98'),'Fax');}return _0xf04e22;}));_0x2c3ed3[_0x23ff('0xa5')](_0x1a8f5c['getOpenchannelQueues']()['then'](function(_0x28a43c){for(var _0x323efd=0x0;_0x323efd<_0x28a43c[_0x23ff('0x50')];_0x323efd++){_0x28a43c[_0x323efd]['setDataValue'](_0x23ff('0x98'),'Openchannel');}return _0x28a43c;}));return BPromise[_0x23ff('0xe5')](_0x2c3ed3);})['then'](function(_0xec44cf){var _0x3d72ea=_['flatten'](_0xec44cf);_0x2c3ed3=[];return db['sequelize'][_0x23ff('0x111')](function(_0x3bbcbe){for(var _0x9761be=0x0;_0x9761be<_0x3d72ea[_0x23ff('0x50')];_0x9761be++){_0x2c3ed3['push'](_0x3d72ea[_0x9761be][_0x23ff('0x112')](_0x1b47ee['id']),{'transaction':_0x3bbcbe});}return BPromise[_0x23ff('0xe5')](_0x2c3ed3)[_0x23ff('0x20')](function(){if(_0x1b47ee['online']){return BPromise['each'](_[_0x23ff('0xc0')](_0x3d72ea,function(_0x1118be){return _0x1118be[_0x23ff('0x113')]('channel')===_0x23ff('0x109');}),function(_0x3570aa){return db[_0x23ff('0xa9')][_0x23ff('0xe2')]({'membername':_0x1b47ee[_0x23ff('0x40')],'UserId':_0x1b47ee['id'],'queue_name':_0x3570aa['name'],'VoiceQueueId':_0x3570aa['id'],'interface':_[_0x23ff('0x6b')](_0x1b47ee['interface'])?util[_0x23ff('0xd7')]('SIP/%s',_0x1b47ee[_0x23ff('0x40')]):_0x1b47ee[_0x23ff('0x99')],'paused':_0x1b47ee[_0x23ff('0xa7')]||![],'penalty':_0x1b47ee[_0x23ff('0x9f')]},{'transaction':_0x3bbcbe});});}else{return;}})[_0x23ff('0x20')](function(){for(var _0x3f04b7=0x0;_0x3f04b7<_0x3d72ea[_0x23ff('0x50')];_0x3f04b7++){var _0x463f6c=_0x3d72ea[_0x3f04b7][_0x23ff('0x113')](_0x23ff('0x98'));var _0x1b43cd=_0x463f6c+'QueueId';socket[_0x23ff('0xa3')]('user'+_0x463f6c+_0x23ff('0x114'),{'UserId':_0x1b47ee['id'],['queueField']:_0x3d72ea[_0x3f04b7]['id']});}});});});}});}})[_0x23ff('0x20')](respondWithStatusCode(_0x5e6357,null))[_0x23ff('0x5d')](handleError(_0x5e6357,null));};exports[_0x23ff('0x115')]=function(_0xc98bf0,_0x3102fe){return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0xc98bf0['params']['id']}})['then'](handleEntityNotFound(_0x3102fe,null))[_0x23ff('0x20')](function(_0x2c9a24){if(_0x2c9a24){var _0x17286f=_0x2c9a24[_0x23ff('0x34')]({'plain':!![]});var _0x2ccfd6=_0xc98bf0[_0x23ff('0x49')][_0x23ff('0xa2')];return _0x2c9a24[_0x23ff('0x115')](_0x2ccfd6)[_0x23ff('0x20')](function(){for(var _0x53993a=0x0;_0x53993a<_0x2ccfd6[_0x23ff('0x50')];_0x53993a++){var _0x29991a=[];db['Team']['findOne']({'where':{'id':_0x2ccfd6[_0x53993a]}})['then'](function(_0x4e2b2c){_0x29991a[_0x23ff('0xa5')](_0x4e2b2c[_0x23ff('0xe0')]()[_0x23ff('0x20')](function(_0x3f2c12){for(var _0xfbf808=0x0;_0xfbf808<_0x3f2c12[_0x23ff('0x50')];_0xfbf808++){_0x3f2c12[_0xfbf808][_0x23ff('0x108')]('channel',_0x23ff('0x109'));}return _0x3f2c12;}));_0x29991a[_0x23ff('0xa5')](_0x4e2b2c[_0x23ff('0x10a')]()[_0x23ff('0x20')](function(_0x40e094){for(var _0x1ae87e=0x0;_0x1ae87e<_0x40e094[_0x23ff('0x50')];_0x1ae87e++){_0x40e094[_0x1ae87e][_0x23ff('0x108')](_0x23ff('0x98'),'Chat');}return _0x40e094;}));_0x29991a[_0x23ff('0xa5')](_0x4e2b2c[_0x23ff('0x10c')]()['then'](function(_0x529104){for(var _0x3c6cec=0x0;_0x3c6cec<_0x529104[_0x23ff('0x50')];_0x3c6cec++){_0x529104[_0x3c6cec][_0x23ff('0x108')](_0x23ff('0x98'),_0x23ff('0x116'));}return _0x529104;}));_0x29991a[_0x23ff('0xa5')](_0x4e2b2c['getSmsQueues']()[_0x23ff('0x20')](function(_0x5d238a){for(var _0x50e9f8=0x0;_0x50e9f8<_0x5d238a[_0x23ff('0x50')];_0x50e9f8++){_0x5d238a[_0x50e9f8]['setDataValue']('channel',_0x23ff('0x10d'));}return _0x5d238a;}));_0x29991a[_0x23ff('0xa5')](_0x4e2b2c[_0x23ff('0x10e')]()[_0x23ff('0x20')](function(_0x5c1e69){for(var _0x3aad70=0x0;_0x3aad70<_0x5c1e69[_0x23ff('0x50')];_0x3aad70++){_0x5c1e69[_0x3aad70]['setDataValue'](_0x23ff('0x98'),_0x23ff('0x10f'));}return _0x5c1e69;}));_0x29991a['push'](_0x4e2b2c[_0x23ff('0x110')]()[_0x23ff('0x20')](function(_0x37b719){for(var _0x5ca204=0x0;_0x5ca204<_0x37b719[_0x23ff('0x50')];_0x5ca204++){_0x37b719[_0x5ca204]['setDataValue'](_0x23ff('0x98'),_0x23ff('0x117'));}return _0x37b719;}));_0x29991a[_0x23ff('0xa5')](_0x4e2b2c['getOpenchannelQueues']()[_0x23ff('0x20')](function(_0x5bb81c){for(var _0x598bbc=0x0;_0x598bbc<_0x5bb81c[_0x23ff('0x50')];_0x598bbc++){_0x5bb81c[_0x598bbc]['setDataValue'](_0x23ff('0x98'),_0x23ff('0x118'));}return _0x5bb81c;}));return BPromise[_0x23ff('0xe5')](_0x29991a);})['then'](function(_0x1cf0c4){var _0x5ce8b5=_[_0x23ff('0x119')](_0x1cf0c4);_0x29991a=[];return db[_0x23ff('0x57')][_0x23ff('0x111')](function(_0x2fb45b){for(var _0x1541a2=0x0;_0x1541a2<_0x5ce8b5[_0x23ff('0x50')];_0x1541a2++){_0x29991a['push'](_0x5ce8b5[_0x1541a2][_0x23ff('0x11a')](_0x17286f['id']),{'transaction':_0x2fb45b});}return BPromise['all'](_0x29991a)['then'](function(){if(_0x17286f['online']){return BPromise['each'](_[_0x23ff('0xc0')](_0x5ce8b5,function(_0x447bec){return _0x447bec[_0x23ff('0x113')](_0x23ff('0x98'))===_0x23ff('0x109');}),function(_0x2856fa){return db[_0x23ff('0xa9')]['destroy']({'where':{'VoiceQueueId':_0x2856fa['id'],'UserId':_0x17286f['id']},'transaction':_0x2fb45b});});}else{return;}})[_0x23ff('0x20')](function(){for(var _0x577f5f=0x0;_0x577f5f<_0x5ce8b5[_0x23ff('0x50')];_0x577f5f++){var _0x5ad25a=_0x5ce8b5[_0x577f5f][_0x23ff('0x113')](_0x23ff('0x98'));var _0x9d8a2=_0x5ad25a+_0x23ff('0xa1');socket[_0x23ff('0xa3')](_0x23ff('0x36')+_0x5ad25a+_0x23ff('0xac'),{'UserId':_0x17286f['id'],['queueField']:_0x5ce8b5[_0x577f5f]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x3102fe,null))[_0x23ff('0x5d')](handleError(_0x3102fe,null));};exports[_0x23ff('0x11b')]=function(_0x88c1,_0x149cd1,_0x510ce9){var _0x5d00b0={};var _0x22e4b3={};var _0x58e9ba;var _0x5870ed;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x88c1[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x149cd1,null))[_0x23ff('0x20')](function(_0x2b5e35){if(_0x2b5e35){_0x58e9ba=_0x2b5e35;_0x22e4b3[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db[_0x23ff('0x11c')]['rawAttributes']);_0x22e4b3['query']=_['keys'](_0x88c1[_0x23ff('0x49')]);_0x22e4b3['filters']=_[_0x23ff('0x4c')](_0x22e4b3[_0x23ff('0x4d')],_0x22e4b3[_0x23ff('0x49')]);_0x5d00b0['attributes']=_[_0x23ff('0x4c')](_0x22e4b3[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x88c1[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x5d00b0[_0x23ff('0x4f')]=_0x5d00b0[_0x23ff('0x4f')][_0x23ff('0x50')]?_0x5d00b0['attributes']:_0x22e4b3[_0x23ff('0x4d')];_0x5d00b0[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x88c1[_0x23ff('0x49')]['sort']);_0x5d00b0[_0x23ff('0x54')]=qs['filters'](_[_0x23ff('0xb8')](_0x88c1['query'],_0x22e4b3[_0x23ff('0x4b')]));if(_0x88c1[_0x23ff('0x49')][_0x23ff('0xc0')]){_0x5d00b0['where']=_[_0x23ff('0x55')](_0x5d00b0[_0x23ff('0x54')],{'$or':_['map'](_0x5d00b0[_0x23ff('0x4f')],function(_0x5cb17b){var _0x5834e8={};_0x5834e8[_0x5cb17b]={'$like':'%'+_0x88c1[_0x23ff('0x49')][_0x23ff('0xc0')]+'%'};return _0x5834e8;})});}_0x5d00b0=_[_0x23ff('0x55')]({},_0x5d00b0,_0x88c1['options']);return _0x58e9ba['getLists'](_0x5d00b0);}})[_0x23ff('0x20')](function(_0x2d70cc){if(_0x2d70cc){_0x5870ed=_0x2d70cc[_0x23ff('0x50')];if(!_0x88c1[_0x23ff('0x49')][_0x23ff('0xbc')]('nolimit')){_0x5d00b0[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x88c1[_0x23ff('0x49')][_0x23ff('0x51')]);_0x5d00b0[_0x23ff('0x2e')]=qs['offset'](_0x88c1[_0x23ff('0x49')][_0x23ff('0x2e')]);}return _0x58e9ba[_0x23ff('0x11b')](_0x5d00b0);}})[_0x23ff('0x20')](function(_0x5bdf74){if(_0x5bdf74){return _0x5bdf74?{'count':_0x5870ed,'rows':_0x5bdf74}:null;}})[_0x23ff('0x20')](respondWithResult(_0x149cd1,null))[_0x23ff('0x5d')](handleError(_0x149cd1,null));};exports['getAgents']=function(_0x5e07d8,_0x53d4f9,_0x1c5b52){var _0x2f348b={};var _0x224280={};var _0x43771d;var _0x2ef319;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x5e07d8[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x53d4f9,null))[_0x23ff('0x20')](function(_0x4402b6){if(_0x4402b6){_0x43771d=_0x4402b6;_0x224280[_0x23ff('0x4d')]=_['keys'](db['User'][_0x23ff('0x44')]);_0x224280[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x5e07d8['query']);_0x224280[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x224280[_0x23ff('0x4d')],_0x224280['query']);_0x2f348b[_0x23ff('0x4f')]=_[_0x23ff('0x4c')](_0x224280[_0x23ff('0x4d')],qs['fields'](_0x5e07d8[_0x23ff('0x49')]['fields']));_0x2f348b[_0x23ff('0x4f')]=_0x2f348b['attributes'][_0x23ff('0x50')]?_0x2f348b[_0x23ff('0x4f')]:_0x224280[_0x23ff('0x4d')];_0x2f348b[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x5e07d8[_0x23ff('0x49')][_0x23ff('0x53')]);_0x2f348b['where']=qs[_0x23ff('0x4b')](_['pick'](_0x5e07d8[_0x23ff('0x49')],_0x224280['filters']));if(_0x5e07d8[_0x23ff('0x49')][_0x23ff('0xc0')]){_0x2f348b[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0x2f348b['where'],{'$or':_[_0x23ff('0x3b')](_0x2f348b[_0x23ff('0x4f')],function(_0x2585de){var _0x107990={};_0x107990[_0x2585de]={'$like':'%'+_0x5e07d8[_0x23ff('0x49')][_0x23ff('0xc0')]+'%'};return _0x107990;})});}_0x2f348b[_0x23ff('0x4d')]=db['User'];_0x2f348b['as']=_0x23ff('0x37');_0x2f348b=_[_0x23ff('0x55')]({},_0x2f348b,_0x5e07d8[_0x23ff('0x5f')]);return _0x43771d['getVoiceQueues']({'include':[_0x2f348b]});}})[_0x23ff('0x20')](function(_0x140377){if(_0x140377){var _0x49e916={},_0x11252f=[],_0x17fd89=0x0;for(var _0x4141ae=0x0;_0x4141ae<_0x140377['length'];_0x4141ae+=0x1){for(var _0x5418a0=0x0,_0x314dbd;_0x5418a0<_0x140377[_0x4141ae][_0x23ff('0x37')][_0x23ff('0x50')];_0x5418a0+=0x1){_0x314dbd=_0x140377[_0x4141ae][_0x23ff('0x37')][_0x5418a0][_0x23ff('0x34')]({'plain':!![]});_0x49e916[_0x314dbd['id']]=_0x314dbd;}}_0x49e916=_['values'](_0x49e916);for(var _0x5b6171=qs['offset'](_0x5e07d8[_0x23ff('0x49')][_0x23ff('0x2e')]);_0x5b6171<_0x49e916[_0x23ff('0x50')]&&_0x11252f[_0x23ff('0x50')]<qs[_0x23ff('0x51')](_0x5e07d8[_0x23ff('0x49')][_0x23ff('0x51')]);_0x5b6171+=0x1){if(_0x49e916[_0x5b6171]){_0x11252f[_0x23ff('0xa5')](_0x49e916[_0x5b6171]);}}return{'count':_0x49e916[_0x23ff('0x50')],'rows':_0x11252f};}})[_0x23ff('0x20')](respondWithResult(_0x53d4f9,null))[_0x23ff('0x5d')](handleError(_0x53d4f9,null));};exports[_0x23ff('0x33')]=function(_0x467a2d,_0x32b0dc){if(_0x467a2d[_0x23ff('0x36')]['id']==_0x467a2d[_0x23ff('0x62')]['id']){return _0x32b0dc['status'](0x1f4)[_0x23ff('0x41')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db['User']['find']({'where':{'id':_0x467a2d[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x32b0dc,null))[_0x23ff('0x20')](removeEntity(_0x32b0dc,null))[_0x23ff('0x5d')](handleError(_0x32b0dc,null));};exports[_0x23ff('0x11d')]=function(_0x31230b,_0x3e30d0,_0x167b75){return db['User'][_0x23ff('0x3e')]({'where':{'id':_0x31230b[_0x23ff('0x62')]['id']}})['then'](handleEntityNotFound(_0x3e30d0,null))[_0x23ff('0x20')](function(_0x11edfd){if(_0x11edfd){return _0x11edfd[_0x23ff('0x11d')](_0x31230b[_0x23ff('0x61')][_0x23ff('0xa2')],_[_0x23ff('0x107')](_0x31230b[_0x23ff('0x61')],[_0x23ff('0xa2'),'id'])||{})[_0x23ff('0xa0')](function(){for(var _0x19521b=0x0;_0x19521b<_0x31230b[_0x23ff('0x61')][_0x23ff('0xa2')][_0x23ff('0x50')];_0x19521b+=0x1){socket[_0x23ff('0xa3')]('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x31230b['body']['ids'][_0x19521b]),'UserId':Number(_0x31230b[_0x23ff('0x62')]['id'])});}return _0x31230b['body'][_0x23ff('0xa2')];});}})['then'](respondWithResult(_0x3e30d0,null))[_0x23ff('0x5d')](handleError(_0x3e30d0,null));};exports[_0x23ff('0x11e')]=function(_0x1ab75c,_0x2714e1,_0x4a4292){return db['User']['find']({'where':{'id':_0x1ab75c[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x2714e1,null))[_0x23ff('0x20')](function(_0x4c816e){if(_0x4c816e){return _0x4c816e[_0x23ff('0x11e')](_0x1ab75c[_0x23ff('0x49')][_0x23ff('0xa2')])['then'](function(){if(_['isArray'](_0x1ab75c[_0x23ff('0x49')]['ids'])){for(var _0x4e0aa8=0x0;_0x4e0aa8<_0x1ab75c[_0x23ff('0x49')][_0x23ff('0xa2')][_0x23ff('0x50')];_0x4e0aa8+=0x1){socket[_0x23ff('0xa3')](_0x23ff('0x11f'),{'ChatInteractionId':Number(_0x1ab75c['query'][_0x23ff('0xa2')][_0x4e0aa8]),'UserId':Number(_0x1ab75c[_0x23ff('0x62')]['id'])});}}else{socket['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x1ab75c[_0x23ff('0x49')][_0x23ff('0xa2')]),'UserId':Number(_0x1ab75c[_0x23ff('0x62')]['id'])});}});}})[_0x23ff('0x20')](respondWithStatusCode(_0x2714e1,null))[_0x23ff('0x5d')](handleError(_0x2714e1,null));};exports[_0x23ff('0x120')]=function(_0x1444c0,_0x34d2f7,_0x44a8da){return db[_0x23ff('0x43')]['find']({'where':{'id':_0x1444c0[_0x23ff('0x62')]['id']}})['then'](handleEntityNotFound(_0x34d2f7,null))[_0x23ff('0x20')](function(_0x251c49){if(_0x251c49){return _0x251c49['addMailInteractions'](_0x1444c0[_0x23ff('0x61')][_0x23ff('0xa2')],_[_0x23ff('0x107')](_0x1444c0[_0x23ff('0x61')],['ids','id'])||{})[_0x23ff('0xa0')](function(){for(var _0x49b7a0=0x0;_0x49b7a0<_0x1444c0[_0x23ff('0x61')][_0x23ff('0xa2')]['length'];_0x49b7a0+=0x1){socket[_0x23ff('0xa3')](_0x23ff('0x121'),{'MailInteractionId':Number(_0x1444c0['body']['ids'][_0x49b7a0]),'UserId':Number(_0x1444c0[_0x23ff('0x62')]['id'])});}return _0x1444c0[_0x23ff('0x61')][_0x23ff('0xa2')];});}})[_0x23ff('0x20')](respondWithResult(_0x34d2f7,null))['catch'](handleError(_0x34d2f7,null));};exports[_0x23ff('0x122')]=function(_0xecfa32,_0x2917d6,_0x3d860b){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0xecfa32[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x2917d6,null))[_0x23ff('0x20')](function(_0x101da3){if(_0x101da3){return _0x101da3['removeMailInteractions'](_0xecfa32[_0x23ff('0x49')][_0x23ff('0xa2')])[_0x23ff('0x20')](function(){if(_['isArray'](_0xecfa32[_0x23ff('0x49')][_0x23ff('0xa2')])){for(var _0x25ffd2=0x0;_0x25ffd2<_0xecfa32[_0x23ff('0x49')][_0x23ff('0xa2')][_0x23ff('0x50')];_0x25ffd2+=0x1){socket['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xecfa32[_0x23ff('0x49')][_0x23ff('0xa2')][_0x25ffd2]),'UserId':Number(_0xecfa32[_0x23ff('0x62')]['id'])});}}else{socket[_0x23ff('0xa3')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xecfa32['query']['ids']),'UserId':Number(_0xecfa32['params']['id'])});}});}})[_0x23ff('0x20')](respondWithStatusCode(_0x2917d6,null))[_0x23ff('0x5d')](handleError(_0x2917d6,null));};exports['addFaxInteractions']=function(_0x3c26d7,_0x29ed8c,_0x53cc2f){return db['User'][_0x23ff('0x3e')]({'where':{'id':_0x3c26d7['params']['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x29ed8c,null))[_0x23ff('0x20')](function(_0x473041){if(_0x473041){return _0x473041[_0x23ff('0x123')](_0x3c26d7[_0x23ff('0x61')][_0x23ff('0xa2')],_[_0x23ff('0x107')](_0x3c26d7[_0x23ff('0x61')],[_0x23ff('0xa2'),'id'])||{})[_0x23ff('0xa0')](function(){for(var _0x2725f1=0x0;_0x2725f1<_0x3c26d7['body'][_0x23ff('0xa2')][_0x23ff('0x50')];_0x2725f1+=0x1){socket[_0x23ff('0xa3')]('user_has_fax_interactions:save',{'FaxInteractionId':Number(_0x3c26d7[_0x23ff('0x61')][_0x23ff('0xa2')][_0x2725f1]),'UserId':Number(_0x3c26d7['params']['id'])});}return _0x3c26d7[_0x23ff('0x61')][_0x23ff('0xa2')];});}})[_0x23ff('0x20')](respondWithResult(_0x29ed8c,null))[_0x23ff('0x5d')](handleError(_0x29ed8c,null));};exports['removeFaxInteractions']=function(_0x27ec8f,_0x3fdcd8,_0x291fe1){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x27ec8f[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x3fdcd8,null))[_0x23ff('0x20')](function(_0x56b6b6){if(_0x56b6b6){return _0x56b6b6[_0x23ff('0x124')](_0x27ec8f[_0x23ff('0x49')]['ids'])['then'](function(){if(_[_0x23ff('0x125')](_0x27ec8f[_0x23ff('0x49')][_0x23ff('0xa2')])){for(var _0x515f7c=0x0;_0x515f7c<_0x27ec8f[_0x23ff('0x49')]['ids'][_0x23ff('0x50')];_0x515f7c+=0x1){socket[_0x23ff('0xa3')](_0x23ff('0x126'),{'FaxInteractionId':Number(_0x27ec8f['query'][_0x23ff('0xa2')][_0x515f7c]),'UserId':Number(_0x27ec8f[_0x23ff('0x62')]['id'])});}}else{socket['emit'](_0x23ff('0x126'),{'FaxInteractionId':Number(_0x27ec8f[_0x23ff('0x49')][_0x23ff('0xa2')]),'UserId':Number(_0x27ec8f[_0x23ff('0x62')]['id'])});}});}})[_0x23ff('0x20')](respondWithStatusCode(_0x3fdcd8,null))['catch'](handleError(_0x3fdcd8,null));};exports['addSmsInteractions']=function(_0x143bf6,_0x21be9f,_0x492352){return db['User'][_0x23ff('0x3e')]({'where':{'id':_0x143bf6[_0x23ff('0x62')]['id']}})['then'](handleEntityNotFound(_0x21be9f,null))[_0x23ff('0x20')](function(_0x44c75f){if(_0x44c75f){return _0x44c75f[_0x23ff('0x127')](_0x143bf6[_0x23ff('0x61')][_0x23ff('0xa2')],_[_0x23ff('0x107')](_0x143bf6[_0x23ff('0x61')],[_0x23ff('0xa2'),'id'])||{})[_0x23ff('0xa0')](function(){for(var _0x484a2d=0x0;_0x484a2d<_0x143bf6['body'][_0x23ff('0xa2')][_0x23ff('0x50')];_0x484a2d+=0x1){socket[_0x23ff('0xa3')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x143bf6[_0x23ff('0x61')][_0x23ff('0xa2')][_0x484a2d]),'UserId':Number(_0x143bf6['params']['id'])});}return _0x143bf6[_0x23ff('0x61')][_0x23ff('0xa2')];});}})[_0x23ff('0x20')](respondWithResult(_0x21be9f,null))[_0x23ff('0x5d')](handleError(_0x21be9f,null));};exports['removeSmsInteractions']=function(_0x3c0022,_0x409704,_0x23fd15){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x3c0022[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x409704,null))[_0x23ff('0x20')](function(_0x5dd769){if(_0x5dd769){return _0x5dd769['removeSmsInteractions'](_0x3c0022['query'][_0x23ff('0xa2')])[_0x23ff('0x20')](function(){if(_[_0x23ff('0x125')](_0x3c0022[_0x23ff('0x49')][_0x23ff('0xa2')])){for(var _0x4c6351=0x0;_0x4c6351<_0x3c0022[_0x23ff('0x49')]['ids'][_0x23ff('0x50')];_0x4c6351+=0x1){socket[_0x23ff('0xa3')](_0x23ff('0x128'),{'SmsInteractionId':Number(_0x3c0022[_0x23ff('0x49')][_0x23ff('0xa2')][_0x4c6351]),'UserId':Number(_0x3c0022[_0x23ff('0x62')]['id'])});}}else{socket[_0x23ff('0xa3')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x3c0022[_0x23ff('0x49')][_0x23ff('0xa2')]),'UserId':Number(_0x3c0022[_0x23ff('0x62')]['id'])});}});}})[_0x23ff('0x20')](respondWithStatusCode(_0x409704,null))[_0x23ff('0x5d')](handleError(_0x409704,null));};exports['addOpenchannelInteractions']=function(_0x1b41f2,_0x4497c0,_0x5465d0){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x1b41f2[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x4497c0,null))[_0x23ff('0x20')](function(_0x2177a2){if(_0x2177a2){return _0x2177a2[_0x23ff('0x129')](_0x1b41f2[_0x23ff('0x61')][_0x23ff('0xa2')],_[_0x23ff('0x107')](_0x1b41f2[_0x23ff('0x61')],['ids','id'])||{})['spread'](function(){for(var _0x14f82f=0x0;_0x14f82f<_0x1b41f2[_0x23ff('0x61')][_0x23ff('0xa2')][_0x23ff('0x50')];_0x14f82f+=0x1){socket[_0x23ff('0xa3')](_0x23ff('0x12a'),{'OpenchannelInteractionId':Number(_0x1b41f2[_0x23ff('0x61')][_0x23ff('0xa2')][_0x14f82f]),'UserId':Number(_0x1b41f2[_0x23ff('0x62')]['id'])});}return _0x1b41f2['body'][_0x23ff('0xa2')];});}})[_0x23ff('0x20')](respondWithResult(_0x4497c0,null))['catch'](handleError(_0x4497c0,null));};exports[_0x23ff('0x12b')]=function(_0x59951f,_0x1a7ce0,_0x1f99a0){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x59951f[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x1a7ce0,null))[_0x23ff('0x20')](function(_0x5d10ae){if(_0x5d10ae){return _0x5d10ae[_0x23ff('0x12b')](_0x59951f['query'][_0x23ff('0xa2')])['then'](function(){if(_['isArray'](_0x59951f[_0x23ff('0x49')][_0x23ff('0xa2')])){for(var _0x4013b0=0x0;_0x4013b0<_0x59951f[_0x23ff('0x49')][_0x23ff('0xa2')][_0x23ff('0x50')];_0x4013b0+=0x1){socket['emit'](_0x23ff('0x12c'),{'OpenchannelInteractionId':Number(_0x59951f[_0x23ff('0x49')][_0x23ff('0xa2')][_0x4013b0]),'UserId':Number(_0x59951f[_0x23ff('0x62')]['id'])});}}else{socket[_0x23ff('0xa3')](_0x23ff('0x12c'),{'OpenchannelInteractionId':Number(_0x59951f[_0x23ff('0x49')][_0x23ff('0xa2')]),'UserId':Number(_0x59951f[_0x23ff('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x1a7ce0,null))[_0x23ff('0x5d')](handleError(_0x1a7ce0,null));};exports[_0x23ff('0x12d')]=function(_0x57aeee,_0x594103,_0x20a85e){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x57aeee[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x594103,null))[_0x23ff('0x20')](function(_0x41bf1f){if(_0x41bf1f){return _0x41bf1f[_0x23ff('0x12d')](_0x57aeee[_0x23ff('0x61')][_0x23ff('0xa2')],_[_0x23ff('0x107')](_0x57aeee[_0x23ff('0x61')],[_0x23ff('0xa2'),'id'])||{})[_0x23ff('0xa0')](function(){for(var _0x55b21a=0x0;_0x55b21a<_0x57aeee['body'][_0x23ff('0xa2')]['length'];_0x55b21a+=0x1){socket[_0x23ff('0xa3')](_0x23ff('0x12e'),{'WhatsappInteractionId':Number(_0x57aeee[_0x23ff('0x61')][_0x23ff('0xa2')][_0x55b21a]),'UserId':Number(_0x57aeee[_0x23ff('0x62')]['id'])});}return _0x57aeee['body'][_0x23ff('0xa2')];});}})[_0x23ff('0x20')](respondWithResult(_0x594103,null))[_0x23ff('0x5d')](handleError(_0x594103,null));};exports[_0x23ff('0x12f')]=function(_0x47aabb,_0x177164,_0x276024){return db['User'][_0x23ff('0x3e')]({'where':{'id':_0x47aabb['params']['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x177164,null))[_0x23ff('0x20')](function(_0x59d464){if(_0x59d464){return _0x59d464[_0x23ff('0x12f')](_0x47aabb[_0x23ff('0x49')][_0x23ff('0xa2')]);}})[_0x23ff('0x20')](respondWithStatusCode(_0x177164,null))[_0x23ff('0x5d')](handleError(_0x177164,null));};exports[_0x23ff('0x130')]=function(_0x13a94c,_0x51e0a2,_0x465349){var _0x8de063={};var _0x514318={};var _0x563c02;var _0x271209;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x13a94c[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x51e0a2,null))['then'](function(_0x2d0719){if(_0x2d0719){_0x563c02=_0x2d0719;_0x514318[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db[_0x23ff('0x131')]['rawAttributes']);_0x514318[_0x23ff('0x49')]=_['keys'](_0x13a94c['query']);_0x514318[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x514318[_0x23ff('0x4d')],_0x514318[_0x23ff('0x49')]);_0x8de063[_0x23ff('0x4f')]=_['intersection'](_0x514318['model'],qs[_0x23ff('0x4e')](_0x13a94c[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x8de063[_0x23ff('0x4f')]=_0x8de063[_0x23ff('0x4f')][_0x23ff('0x50')]?_0x8de063[_0x23ff('0x4f')]:_0x514318[_0x23ff('0x4d')];_0x8de063[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x13a94c[_0x23ff('0x49')][_0x23ff('0x53')]);_0x8de063[_0x23ff('0x54')]=qs[_0x23ff('0x4b')](_[_0x23ff('0xb8')](_0x13a94c[_0x23ff('0x49')],_0x514318[_0x23ff('0x4b')]));if(_0x13a94c[_0x23ff('0x49')][_0x23ff('0xc0')]){_0x8de063['where']=_[_0x23ff('0x55')](_0x8de063[_0x23ff('0x54')],{'$or':_['map'](_0x8de063[_0x23ff('0x4f')],function(_0x144808){var _0x5872e9={};_0x5872e9[_0x144808]={'$like':'%'+_0x13a94c['query'][_0x23ff('0xc0')]+'%'};return _0x5872e9;})});}_0x8de063=_[_0x23ff('0x55')]({},_0x8de063,_0x13a94c[_0x23ff('0x5f')]);return _0x563c02['getVoicePrefixes'](_0x8de063);}})['then'](function(_0x5b903b){if(_0x5b903b){_0x271209=_0x5b903b[_0x23ff('0x50')];if(!_0x13a94c[_0x23ff('0x49')][_0x23ff('0xbc')](_0x23ff('0xbd'))){_0x8de063[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x13a94c[_0x23ff('0x49')][_0x23ff('0x51')]);_0x8de063[_0x23ff('0x2e')]=qs['offset'](_0x13a94c['query'][_0x23ff('0x2e')]);}return _0x563c02[_0x23ff('0x130')](_0x8de063);}})[_0x23ff('0x20')](function(_0x451c86){if(_0x451c86){return _0x451c86?{'count':_0x271209,'rows':_0x451c86}:null;}})[_0x23ff('0x20')](respondWithResult(_0x51e0a2,null))[_0x23ff('0x5d')](handleError(_0x51e0a2,null));};exports[_0x23ff('0x132')]=function(_0x38f996,_0x197ca9,_0x473bfc){var _0x50da52={};var _0x1ec64b={};var _0x1c03f3;var _0x429a11;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x38f996['params']['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x197ca9,null))['then'](function(_0xb28372){if(_0xb28372){_0x1c03f3=_0xb28372;_0x1ec64b['model']=_[_0x23ff('0x4a')](db[_0x23ff('0x133')][_0x23ff('0x44')]);_0x1ec64b['query']=_[_0x23ff('0x4a')](_0x38f996[_0x23ff('0x49')]);_0x1ec64b[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x1ec64b[_0x23ff('0x4d')],_0x1ec64b[_0x23ff('0x49')]);_0x50da52['attributes']=_[_0x23ff('0x4c')](_0x1ec64b[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x38f996[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x50da52[_0x23ff('0x4f')]=_0x50da52['attributes']['length']?_0x50da52['attributes']:_0x1ec64b[_0x23ff('0x4d')];_0x50da52[_0x23ff('0x52')]=qs['sort'](_0x38f996[_0x23ff('0x49')][_0x23ff('0x53')]);_0x50da52[_0x23ff('0x54')]=qs['filters'](_[_0x23ff('0xb8')](_0x38f996[_0x23ff('0x49')],_0x1ec64b[_0x23ff('0x4b')]));if(_0x38f996['query'][_0x23ff('0xc0')]){_0x50da52['where']=_[_0x23ff('0x55')](_0x50da52[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x50da52[_0x23ff('0x4f')],function(_0xd330c8){var _0x3d08d0={};_0x3d08d0[_0xd330c8]={'$like':'%'+_0x38f996[_0x23ff('0x49')][_0x23ff('0xc0')]+'%'};return _0x3d08d0;})});}_0x50da52=_[_0x23ff('0x55')]({},_0x50da52,_0x38f996[_0x23ff('0x5f')]);return _0x1c03f3['getFaxAccounts'](_0x50da52);}})['then'](function(_0x1e4be0){if(_0x1e4be0){_0x429a11=_0x1e4be0[_0x23ff('0x50')];if(!_0x38f996['query'][_0x23ff('0xbc')](_0x23ff('0xbd'))){_0x50da52[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x38f996[_0x23ff('0x49')]['limit']);_0x50da52[_0x23ff('0x2e')]=qs[_0x23ff('0x2e')](_0x38f996[_0x23ff('0x49')][_0x23ff('0x2e')]);}return _0x1c03f3['getFaxAccounts'](_0x50da52);}})['then'](function(_0x251740){if(_0x251740){return _0x251740?{'count':_0x429a11,'rows':_0x251740}:null;}})[_0x23ff('0x20')](respondWithResult(_0x197ca9,null))['catch'](handleError(_0x197ca9,null));};exports[_0x23ff('0x134')]=function(_0x4dc48d,_0x30bdb9,_0x711d7a){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x4dc48d[_0x23ff('0x62')]['id']}})['then'](handleEntityNotFound(_0x30bdb9,null))['then'](function(_0x4feb11){if(_0x4feb11){return _0x4feb11[_0x23ff('0x134')](_0x4dc48d[_0x23ff('0x61')][_0x23ff('0xa2')],_[_0x23ff('0x107')](_0x4dc48d[_0x23ff('0x61')],[_0x23ff('0xa2'),'id'])||{});}})['then'](respondWithResult(_0x30bdb9,null))[_0x23ff('0x5d')](handleError(_0x30bdb9,null));};exports[_0x23ff('0x135')]=function(_0xc4f281,_0x592d02,_0xf28916){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0xc4f281[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x592d02,null))[_0x23ff('0x20')](function(_0x3838e8){if(_0x3838e8){return _0x3838e8[_0x23ff('0x135')](_0xc4f281['query']['ids']);}})['then'](respondWithStatusCode(_0x592d02,null))['catch'](handleError(_0x592d02,null));};exports['getMailAccounts']=function(_0x1776d4,_0x46c2ec,_0x400117){var _0x4fb013={};var _0x373bb1={};var _0x3bbbf1;var _0x1dda33;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x1776d4[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x46c2ec,null))[_0x23ff('0x20')](function(_0x25b0f7){if(_0x25b0f7){_0x3bbbf1=_0x25b0f7;_0x373bb1[_0x23ff('0x4d')]=_['keys'](db[_0x23ff('0x136')][_0x23ff('0x44')]);_0x373bb1[_0x23ff('0x49')]=_['keys'](_0x1776d4['query']);_0x373bb1[_0x23ff('0x4b')]=_['intersection'](_0x373bb1[_0x23ff('0x4d')],_0x373bb1['query']);_0x4fb013[_0x23ff('0x4f')]=_[_0x23ff('0x4c')](_0x373bb1[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x1776d4[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x4fb013['attributes']=_0x4fb013[_0x23ff('0x4f')][_0x23ff('0x50')]?_0x4fb013[_0x23ff('0x4f')]:_0x373bb1['model'];_0x4fb013[_0x23ff('0x52')]=qs['sort'](_0x1776d4[_0x23ff('0x49')][_0x23ff('0x53')]);_0x4fb013[_0x23ff('0x54')]=qs['filters'](_['pick'](_0x1776d4['query'],_0x373bb1[_0x23ff('0x4b')]));if(_0x1776d4[_0x23ff('0x49')][_0x23ff('0xc0')]){_0x4fb013[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0x4fb013[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x4fb013[_0x23ff('0x4f')],function(_0x4dcc41){var _0x1f5ae9={};_0x1f5ae9[_0x4dcc41]={'$like':'%'+_0x1776d4[_0x23ff('0x49')]['filter']+'%'};return _0x1f5ae9;})});}_0x4fb013=_[_0x23ff('0x55')]({},_0x4fb013,_0x1776d4[_0x23ff('0x5f')]);return _0x3bbbf1[_0x23ff('0x137')](_0x4fb013);}})[_0x23ff('0x20')](function(_0x4b874e){if(_0x4b874e){_0x1dda33=_0x4b874e[_0x23ff('0x50')];if(!_0x1776d4[_0x23ff('0x49')][_0x23ff('0xbc')](_0x23ff('0xbd'))){_0x4fb013[_0x23ff('0x51')]=qs['limit'](_0x1776d4['query']['limit']);_0x4fb013['offset']=qs[_0x23ff('0x2e')](_0x1776d4['query'][_0x23ff('0x2e')]);}return _0x3bbbf1[_0x23ff('0x137')](_0x4fb013);}})[_0x23ff('0x20')](function(_0x247f28){if(_0x247f28){return _0x247f28?{'count':_0x1dda33,'rows':_0x247f28}:null;}})['then'](respondWithResult(_0x46c2ec,null))[_0x23ff('0x5d')](handleError(_0x46c2ec,null));};exports[_0x23ff('0x138')]=function(_0x4d947f,_0x48d203,_0x48ed06){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x4d947f['params']['id']}})['then'](handleEntityNotFound(_0x48d203,null))[_0x23ff('0x20')](function(_0x4ae0ed){if(_0x4ae0ed){return _0x4ae0ed[_0x23ff('0x138')](_0x4d947f['body'][_0x23ff('0xa2')],_[_0x23ff('0x107')](_0x4d947f[_0x23ff('0x61')],[_0x23ff('0xa2'),'id'])||{});}})[_0x23ff('0x20')](respondWithResult(_0x48d203,null))[_0x23ff('0x5d')](handleError(_0x48d203,null));};exports[_0x23ff('0x139')]=function(_0x4a77eb,_0x53ecaa,_0x3b9e3a){return db[_0x23ff('0x43')]['find']({'where':{'id':_0x4a77eb[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x53ecaa,null))['then'](function(_0x4b40d9){if(_0x4b40d9){return _0x4b40d9['removeMailAccounts'](_0x4a77eb[_0x23ff('0x49')][_0x23ff('0xa2')]);}})[_0x23ff('0x20')](respondWithStatusCode(_0x53ecaa,null))[_0x23ff('0x5d')](handleError(_0x53ecaa,null));};exports[_0x23ff('0x13a')]=function(_0x1aa2f4,_0x422db5,_0x5bbe29){var _0x27d88a={};var _0x5b77f0={};var _0x4c65f4;var _0xe7de7b;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x1aa2f4[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x422db5,null))[_0x23ff('0x20')](function(_0x38ac53){if(_0x38ac53){_0x4c65f4=_0x38ac53;_0x5b77f0[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db['OpenchannelAccount'][_0x23ff('0x44')]);_0x5b77f0['query']=_[_0x23ff('0x4a')](_0x1aa2f4['query']);_0x5b77f0[_0x23ff('0x4b')]=_['intersection'](_0x5b77f0['model'],_0x5b77f0[_0x23ff('0x49')]);_0x27d88a[_0x23ff('0x4f')]=_[_0x23ff('0x4c')](_0x5b77f0[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x1aa2f4[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x27d88a[_0x23ff('0x4f')]=_0x27d88a[_0x23ff('0x4f')][_0x23ff('0x50')]?_0x27d88a[_0x23ff('0x4f')]:_0x5b77f0['model'];_0x27d88a['order']=qs[_0x23ff('0x53')](_0x1aa2f4['query'][_0x23ff('0x53')]);_0x27d88a['where']=qs['filters'](_['pick'](_0x1aa2f4['query'],_0x5b77f0[_0x23ff('0x4b')]));if(_0x1aa2f4['query'][_0x23ff('0xc0')]){_0x27d88a[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0x27d88a['where'],{'$or':_[_0x23ff('0x3b')](_0x27d88a[_0x23ff('0x4f')],function(_0x31895d){var _0x5b30bf={};_0x5b30bf[_0x31895d]={'$like':'%'+_0x1aa2f4[_0x23ff('0x49')]['filter']+'%'};return _0x5b30bf;})});}_0x27d88a=_[_0x23ff('0x55')]({},_0x27d88a,_0x1aa2f4[_0x23ff('0x5f')]);return _0x4c65f4['getOpenchannelAccounts'](_0x27d88a);}})[_0x23ff('0x20')](function(_0x4e4c9a){if(_0x4e4c9a){_0xe7de7b=_0x4e4c9a[_0x23ff('0x50')];if(!_0x1aa2f4[_0x23ff('0x49')][_0x23ff('0xbc')]('nolimit')){_0x27d88a['limit']=qs[_0x23ff('0x51')](_0x1aa2f4['query']['limit']);_0x27d88a['offset']=qs[_0x23ff('0x2e')](_0x1aa2f4['query'][_0x23ff('0x2e')]);}return _0x4c65f4['getOpenchannelAccounts'](_0x27d88a);}})['then'](function(_0x404fbe){if(_0x404fbe){return _0x404fbe?{'count':_0xe7de7b,'rows':_0x404fbe}:null;}})['then'](respondWithResult(_0x422db5,null))[_0x23ff('0x5d')](handleError(_0x422db5,null));};exports['addOpenchannelAccounts']=function(_0x5d3be9,_0x468552,_0x568373){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x5d3be9[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x468552,null))[_0x23ff('0x20')](function(_0xb4f1d4){if(_0xb4f1d4){return _0xb4f1d4[_0x23ff('0x13b')](_0x5d3be9['body'][_0x23ff('0xa2')],_['omit'](_0x5d3be9[_0x23ff('0x61')],[_0x23ff('0xa2'),'id'])||{});}})[_0x23ff('0x20')](respondWithResult(_0x468552,null))['catch'](handleError(_0x468552,null));};exports[_0x23ff('0x13c')]=function(_0x254bb8,_0x2a6848,_0x2a0849){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x254bb8['params']['id']}})['then'](handleEntityNotFound(_0x2a6848,null))[_0x23ff('0x20')](function(_0x1eb7ec){if(_0x1eb7ec){return _0x1eb7ec[_0x23ff('0x13c')](_0x254bb8[_0x23ff('0x49')][_0x23ff('0xa2')]);}})[_0x23ff('0x20')](respondWithStatusCode(_0x2a6848,null))[_0x23ff('0x5d')](handleError(_0x2a6848,null));};exports[_0x23ff('0x13d')]=function(_0x51a2ba,_0x397019,_0x47265d){var _0x55c95c={};var _0x206225={};var _0x5bba50;var _0x56e72b;return db['User'][_0x23ff('0x8d')]({'where':{'id':_0x51a2ba[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x397019,null))[_0x23ff('0x20')](function(_0x4a95a8){if(_0x4a95a8){_0x5bba50=_0x4a95a8;_0x206225[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db['SmsAccount'][_0x23ff('0x44')]);_0x206225['query']=_[_0x23ff('0x4a')](_0x51a2ba[_0x23ff('0x49')]);_0x206225[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x206225[_0x23ff('0x4d')],_0x206225[_0x23ff('0x49')]);_0x55c95c['attributes']=_[_0x23ff('0x4c')](_0x206225['model'],qs['fields'](_0x51a2ba[_0x23ff('0x49')]['fields']));_0x55c95c[_0x23ff('0x4f')]=_0x55c95c[_0x23ff('0x4f')]['length']?_0x55c95c[_0x23ff('0x4f')]:_0x206225['model'];_0x55c95c[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x51a2ba[_0x23ff('0x49')][_0x23ff('0x53')]);_0x55c95c['where']=qs[_0x23ff('0x4b')](_['pick'](_0x51a2ba[_0x23ff('0x49')],_0x206225[_0x23ff('0x4b')]));if(_0x51a2ba[_0x23ff('0x49')][_0x23ff('0xc0')]){_0x55c95c[_0x23ff('0x54')]=_['merge'](_0x55c95c[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x55c95c[_0x23ff('0x4f')],function(_0x1bacc6){var _0x277e44={};_0x277e44[_0x1bacc6]={'$like':'%'+_0x51a2ba[_0x23ff('0x49')]['filter']+'%'};return _0x277e44;})});}_0x55c95c=_['merge']({},_0x55c95c,_0x51a2ba[_0x23ff('0x5f')]);return _0x5bba50[_0x23ff('0x13d')](_0x55c95c);}})[_0x23ff('0x20')](function(_0x49de12){if(_0x49de12){_0x56e72b=_0x49de12[_0x23ff('0x50')];if(!_0x51a2ba[_0x23ff('0x49')][_0x23ff('0xbc')]('nolimit')){_0x55c95c[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x51a2ba[_0x23ff('0x49')][_0x23ff('0x51')]);_0x55c95c['offset']=qs['offset'](_0x51a2ba[_0x23ff('0x49')][_0x23ff('0x2e')]);}return _0x5bba50[_0x23ff('0x13d')](_0x55c95c);}})[_0x23ff('0x20')](function(_0x11af05){if(_0x11af05){return _0x11af05?{'count':_0x56e72b,'rows':_0x11af05}:null;}})[_0x23ff('0x20')](respondWithResult(_0x397019,null))[_0x23ff('0x5d')](handleError(_0x397019,null));};exports[_0x23ff('0x13e')]=function(_0x37efb2,_0x39f6bd,_0xc4a4ad){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x37efb2['params']['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x39f6bd,null))['then'](function(_0x41c3cf){if(_0x41c3cf){return _0x41c3cf[_0x23ff('0x13e')](_0x37efb2[_0x23ff('0x61')][_0x23ff('0xa2')],_['omit'](_0x37efb2[_0x23ff('0x61')],['ids','id'])||{});}})[_0x23ff('0x20')](respondWithResult(_0x39f6bd,null))[_0x23ff('0x5d')](handleError(_0x39f6bd,null));};exports[_0x23ff('0x13f')]=function(_0xbaeaf0,_0x122b4c,_0x1d602f){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0xbaeaf0[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x122b4c,null))[_0x23ff('0x20')](function(_0x20e103){if(_0x20e103){return _0x20e103['removeSmsAccounts'](_0xbaeaf0[_0x23ff('0x49')][_0x23ff('0xa2')]);}})['then'](respondWithStatusCode(_0x122b4c,null))['catch'](handleError(_0x122b4c,null));};exports[_0x23ff('0x140')]=function(_0x5c119f,_0x82b210,_0x46fc31){var _0x7971fc={};var _0x27d983={};var _0x5d5620;var _0x3f9737;return db[_0x23ff('0x43')]['findOne']({'where':{'id':_0x5c119f['params']['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x82b210,null))[_0x23ff('0x20')](function(_0x3e34fd){if(_0x3e34fd){_0x5d5620=_0x3e34fd;_0x27d983[_0x23ff('0x4d')]=_['keys'](db['ChatWebsite'][_0x23ff('0x44')]);_0x27d983[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x5c119f[_0x23ff('0x49')]);_0x27d983[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x27d983[_0x23ff('0x4d')],_0x27d983['query']);_0x7971fc[_0x23ff('0x4f')]=_['intersection'](_0x27d983[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x5c119f[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x7971fc[_0x23ff('0x4f')]=_0x7971fc['attributes'][_0x23ff('0x50')]?_0x7971fc[_0x23ff('0x4f')]:_0x27d983[_0x23ff('0x4d')];_0x7971fc['order']=qs['sort'](_0x5c119f['query'][_0x23ff('0x53')]);_0x7971fc[_0x23ff('0x54')]=qs[_0x23ff('0x4b')](_[_0x23ff('0xb8')](_0x5c119f[_0x23ff('0x49')],_0x27d983['filters']));if(_0x5c119f['query'][_0x23ff('0xc0')]){_0x7971fc[_0x23ff('0x54')]=_['merge'](_0x7971fc[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x7971fc[_0x23ff('0x4f')],function(_0x19ad57){var _0x22b786={};_0x22b786[_0x19ad57]={'$like':'%'+_0x5c119f[_0x23ff('0x49')][_0x23ff('0xc0')]+'%'};return _0x22b786;})});}_0x7971fc=_[_0x23ff('0x55')]({},_0x7971fc,_0x5c119f[_0x23ff('0x5f')]);return _0x5d5620['getChatWebsites'](_0x7971fc);}})[_0x23ff('0x20')](function(_0x5e41e5){if(_0x5e41e5){_0x3f9737=_0x5e41e5[_0x23ff('0x50')];if(!_0x5c119f[_0x23ff('0x49')][_0x23ff('0xbc')]('nolimit')){_0x7971fc[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x5c119f['query']['limit']);_0x7971fc[_0x23ff('0x2e')]=qs[_0x23ff('0x2e')](_0x5c119f[_0x23ff('0x49')]['offset']);}return _0x5d5620[_0x23ff('0x140')](_0x7971fc);}})[_0x23ff('0x20')](function(_0xeff6d5){if(_0xeff6d5){return _0xeff6d5?{'count':_0x3f9737,'rows':_0xeff6d5}:null;}})['then'](respondWithResult(_0x82b210,null))[_0x23ff('0x5d')](handleError(_0x82b210,null));};exports[_0x23ff('0x141')]=function(_0x53baae,_0x1d6ca8,_0x36480e){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x53baae[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x1d6ca8,null))[_0x23ff('0x20')](function(_0x5c2c80){if(_0x5c2c80){return _0x5c2c80[_0x23ff('0x141')](_0x53baae[_0x23ff('0x61')]['ids'],_[_0x23ff('0x107')](_0x53baae['body'],[_0x23ff('0xa2'),'id'])||{});}})[_0x23ff('0x20')](respondWithResult(_0x1d6ca8,null))[_0x23ff('0x5d')](handleError(_0x1d6ca8,null));};exports[_0x23ff('0x142')]=function(_0x2c20c3,_0x40ee39,_0x544cd5){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x2c20c3[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x40ee39,null))[_0x23ff('0x20')](function(_0x2d7585){if(_0x2d7585){return _0x2d7585[_0x23ff('0x142')](_0x2c20c3['query'][_0x23ff('0xa2')]);}})['then'](respondWithStatusCode(_0x40ee39,null))['catch'](handleError(_0x40ee39,null));};exports['getWhatsappAccounts']=function(_0x3ec8d3,_0x3e67aa,_0xc8a95d){var _0x4fd2e2={};var _0x308cb3={};var _0x4a1ea2;var _0x463e5f;return db[_0x23ff('0x43')][_0x23ff('0x8d')]({'where':{'id':_0x3ec8d3['params']['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x3e67aa,null))[_0x23ff('0x20')](function(_0x1ccc4c){if(_0x1ccc4c){_0x4a1ea2=_0x1ccc4c;_0x308cb3[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db[_0x23ff('0x143')][_0x23ff('0x44')]);_0x308cb3[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x3ec8d3[_0x23ff('0x49')]);_0x308cb3[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x308cb3[_0x23ff('0x4d')],_0x308cb3[_0x23ff('0x49')]);_0x4fd2e2[_0x23ff('0x4f')]=_['intersection'](_0x308cb3[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x3ec8d3['query']['fields']));_0x4fd2e2[_0x23ff('0x4f')]=_0x4fd2e2[_0x23ff('0x4f')][_0x23ff('0x50')]?_0x4fd2e2[_0x23ff('0x4f')]:_0x308cb3[_0x23ff('0x4d')];_0x4fd2e2[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x3ec8d3['query']['sort']);_0x4fd2e2[_0x23ff('0x54')]=qs['filters'](_[_0x23ff('0xb8')](_0x3ec8d3[_0x23ff('0x49')],_0x308cb3[_0x23ff('0x4b')]));if(_0x3ec8d3[_0x23ff('0x49')][_0x23ff('0xc0')]){_0x4fd2e2[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0x4fd2e2[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x4fd2e2['attributes'],function(_0x4e0006){var _0x765dd1={};_0x765dd1[_0x4e0006]={'$like':'%'+_0x3ec8d3['query'][_0x23ff('0xc0')]+'%'};return _0x765dd1;})});}_0x4fd2e2=_[_0x23ff('0x55')]({},_0x4fd2e2,_0x3ec8d3[_0x23ff('0x5f')]);return _0x4a1ea2['getWhatsappAccounts'](_0x4fd2e2);}})[_0x23ff('0x20')](function(_0x5880c9){if(_0x5880c9){_0x463e5f=_0x5880c9[_0x23ff('0x50')];if(!_0x3ec8d3[_0x23ff('0x49')]['hasOwnProperty']('nolimit')){_0x4fd2e2[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x3ec8d3[_0x23ff('0x49')][_0x23ff('0x51')]);_0x4fd2e2['offset']=qs[_0x23ff('0x2e')](_0x3ec8d3[_0x23ff('0x49')][_0x23ff('0x2e')]);}return _0x4a1ea2['getWhatsappAccounts'](_0x4fd2e2);}})['then'](function(_0x589d4d){if(_0x589d4d){return _0x589d4d?{'count':_0x463e5f,'rows':_0x589d4d}:null;}})[_0x23ff('0x20')](respondWithResult(_0x3e67aa,null))[_0x23ff('0x5d')](handleError(_0x3e67aa,null));};exports['addWhatsappAccounts']=function(_0x3386c1,_0x37d8bb,_0x4c4c04){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x3386c1[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x37d8bb,null))[_0x23ff('0x20')](function(_0x91f322){if(_0x91f322){return _0x91f322[_0x23ff('0x144')](_0x3386c1[_0x23ff('0x61')][_0x23ff('0xa2')],_[_0x23ff('0x107')](_0x3386c1[_0x23ff('0x61')],[_0x23ff('0xa2'),'id'])||{});}})[_0x23ff('0x20')](respondWithResult(_0x37d8bb,null))['catch'](handleError(_0x37d8bb,null));};exports[_0x23ff('0x145')]=function(_0x431bb7,_0x1b5a59,_0x3b03bd){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x431bb7[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x1b5a59,null))[_0x23ff('0x20')](function(_0x30bc3b){if(_0x30bc3b){return _0x30bc3b[_0x23ff('0x145')](_0x431bb7[_0x23ff('0x49')]['ids']);}})[_0x23ff('0x20')](respondWithStatusCode(_0x1b5a59,null))[_0x23ff('0x5d')](handleError(_0x1b5a59,null));};exports[_0x23ff('0x146')]=function(_0x46378e,_0x2fc072,_0x3b55e3){var _0x33592c={};var _0x7bccc1={};var _0x2abb88;var _0x52561e;return db['User'][_0x23ff('0x8d')]({'where':{'id':_0x46378e['params']['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x2fc072,null))['then'](function(_0x4f01a8){if(_0x4f01a8){_0x2abb88=_0x4f01a8;_0x7bccc1[_0x23ff('0x4d')]=_[_0x23ff('0x4a')](db[_0x23ff('0x147')]['rawAttributes']);_0x7bccc1[_0x23ff('0x49')]=_[_0x23ff('0x4a')](_0x46378e[_0x23ff('0x49')]);_0x7bccc1[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x7bccc1['model'],_0x7bccc1['query']);_0x33592c[_0x23ff('0x4f')]=_[_0x23ff('0x4c')](_0x7bccc1[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x46378e[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x33592c[_0x23ff('0x4f')]=_0x33592c[_0x23ff('0x4f')]['length']?_0x33592c[_0x23ff('0x4f')]:_0x7bccc1[_0x23ff('0x4d')];_0x33592c['order']=qs[_0x23ff('0x53')](_0x46378e[_0x23ff('0x49')][_0x23ff('0x53')]);_0x33592c[_0x23ff('0x54')]=qs[_0x23ff('0x4b')](_[_0x23ff('0xb8')](_0x46378e[_0x23ff('0x49')],_0x7bccc1[_0x23ff('0x4b')]));if(_0x46378e['query'][_0x23ff('0xc0')]){_0x33592c[_0x23ff('0x54')]=_[_0x23ff('0x55')](_0x33592c[_0x23ff('0x54')],{'$or':_[_0x23ff('0x3b')](_0x33592c[_0x23ff('0x4f')],function(_0x72d694){var _0x290d36={};_0x290d36[_0x72d694]={'$like':'%'+_0x46378e[_0x23ff('0x49')][_0x23ff('0xc0')]+'%'};return _0x290d36;})});}_0x33592c=_[_0x23ff('0x55')]({},_0x33592c,_0x46378e[_0x23ff('0x5f')]);return _0x2abb88[_0x23ff('0x146')](_0x33592c);}})[_0x23ff('0x20')](function(_0x506c85){if(_0x506c85){_0x52561e=_0x506c85[_0x23ff('0x50')];if(!_0x46378e[_0x23ff('0x49')][_0x23ff('0xbc')](_0x23ff('0xbd'))){_0x33592c[_0x23ff('0x51')]=qs[_0x23ff('0x51')](_0x46378e['query'][_0x23ff('0x51')]);_0x33592c[_0x23ff('0x2e')]=qs['offset'](_0x46378e[_0x23ff('0x49')]['offset']);}return _0x2abb88[_0x23ff('0x146')](_0x33592c);}})['then'](function(_0x330207){if(_0x330207){return _0x330207?{'count':_0x52561e,'rows':_0x330207}:null;}})[_0x23ff('0x20')](respondWithResult(_0x2fc072,null))[_0x23ff('0x5d')](handleError(_0x2fc072,null));};exports['addSquareProjects']=function(_0xc4f9a1,_0x50d7c7,_0x13e038){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0xc4f9a1['params']['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x50d7c7,null))[_0x23ff('0x20')](function(_0x2a1c99){if(_0x2a1c99){return _0x2a1c99[_0x23ff('0x148')](_0xc4f9a1[_0x23ff('0x61')]['ids'],_['omit'](_0xc4f9a1['body'],['ids','id'])||{});}})[_0x23ff('0x20')](respondWithResult(_0x50d7c7,null))[_0x23ff('0x5d')](handleError(_0x50d7c7,null));};exports[_0x23ff('0x149')]=function(_0x220b47,_0x2986d5,_0x2ea6a0){return db['User'][_0x23ff('0x3e')]({'where':{'id':_0x220b47[_0x23ff('0x62')]['id']}})['then'](handleEntityNotFound(_0x2986d5,null))[_0x23ff('0x20')](function(_0x42507d){if(_0x42507d){return _0x42507d[_0x23ff('0x149')](_0x220b47[_0x23ff('0x49')][_0x23ff('0xa2')]);}})['then'](respondWithStatusCode(_0x2986d5,null))[_0x23ff('0x5d')](handleError(_0x2986d5,null));};exports['getScheduledCalls']=function(_0x54c83a,_0x1fefbd){var _0x322529={},_0x1a074d={},_0x4add1c={'count':0x0,'rows':[]};var _0x48e300=db[_0x23ff('0x14a')]['rawAttributes'];_0x1a074d['model']=_['keys'](_0x48e300);_0x1a074d[_0x23ff('0x49')]=_['keys'](_0x54c83a[_0x23ff('0x49')]);_0x1a074d[_0x23ff('0x4b')]=_[_0x23ff('0x4c')](_0x1a074d['model'],_0x1a074d[_0x23ff('0x49')]);_0x1a074d[_0x23ff('0x4b')]=_['concat'](_0x1a074d[_0x23ff('0x4b')],[_0x23ff('0x14b'),'$or',_0x23ff('0x14c'),'$gte','$lt',_0x23ff('0x14d'),_0x23ff('0x14e'),_0x23ff('0x14f'),_0x23ff('0x150'),_0x23ff('0x151'),_0x23ff('0x152'),'$in',_0x23ff('0x153'),'$like','$notLike',_0x23ff('0x154'),_0x23ff('0x155'),_0x23ff('0x156'),'$overlap',_0x23ff('0x157'),'$contained',_0x23ff('0x158')]);_0x322529[_0x23ff('0x4f')]=_[_0x23ff('0x4c')](_0x1a074d[_0x23ff('0x4d')],qs[_0x23ff('0x4e')](_0x54c83a[_0x23ff('0x49')][_0x23ff('0x4e')]));_0x322529['attributes']=_0x322529['attributes'][_0x23ff('0x50')]?_0x322529['attributes']:_0x1a074d[_0x23ff('0x4d')];if(!_0x54c83a[_0x23ff('0x49')][_0x23ff('0xbc')]('nolimit')){_0x322529['limit']=qs[_0x23ff('0x51')](_0x54c83a[_0x23ff('0x49')][_0x23ff('0x51')]);_0x322529[_0x23ff('0x2e')]=qs[_0x23ff('0x2e')](_0x54c83a[_0x23ff('0x49')][_0x23ff('0x2e')]);}_0x322529[_0x23ff('0x52')]=qs[_0x23ff('0x53')](_0x54c83a['query']['sort']);_0x322529[_0x23ff('0x54')]=qs[_0x23ff('0x4b')](_[_0x23ff('0xb8')](_0x54c83a['query'],_0x1a074d[_0x23ff('0x4b')]));if(_0x54c83a[_0x23ff('0x49')][_0x23ff('0xc0')]){_0x322529['where']=_['merge'](_0x322529['where'],{'$or':_[_0x23ff('0x3b')](_0x322529[_0x23ff('0x4f')],function(_0x3ceace){var _0x32685c={};_0x32685c[_0x3ceace]={'$like':'%'+_0x54c83a[_0x23ff('0x49')]['filter']+'%'};return _0x32685c;})});}_0x322529['where']={'$and':[_0x322529[_0x23ff('0x54')],{'$or':[{'UserId':_0x54c83a['params']['id']},{'OwnerId':_0x54c83a['params']['id']}]}]};_0x322529=_[_0x23ff('0x55')]({},_0x322529,_0x54c83a[_0x23ff('0x5f')]);var _0x53dc23={'where':_0x322529['where']};return db[_0x23ff('0x14a')][_0x23ff('0x2d')](_0x53dc23)[_0x23ff('0x20')](function(_0x2c3894){_0x4add1c[_0x23ff('0x2d')]=_0x2c3894;if(_0x54c83a[_0x23ff('0x49')][_0x23ff('0x59')]){_0x322529[_0x23ff('0x5a')]=[{'attributes':['id',_0x23ff('0x159'),_0x23ff('0x15a'),_0x23ff('0xd5')],'model':db[_0x23ff('0xb7')],'as':_0x23ff('0x15b')},{'attributes':['id',_0x23ff('0x40'),_0x23ff('0x15c')],'model':db[_0x23ff('0x15d')],'as':_0x23ff('0xbf')}];}return db[_0x23ff('0x14a')][_0x23ff('0x5b')](_0x322529);})[_0x23ff('0x20')](function(_0x1d6af9){_0x4add1c[_0x23ff('0x5c')]=_0x1d6af9;return _0x4add1c;})[_0x23ff('0x20')](respondWithFilteredResult(_0x1fefbd,_0x322529))[_0x23ff('0x5d')](handleError(_0x1fefbd,null));};exports[_0x23ff('0x15e')]=function(_0x5abc93,_0x51ac89,_0x4ca646){if(!_[_0x23ff('0x6b')](_0x5abc93[_0x23ff('0x36')]['id'])&&(_0x5abc93[_0x23ff('0x36')][_0x23ff('0x3f')]=='admin'||_0x5abc93['user']['role']=='user')){return db['User'][_0x23ff('0x8d')]({'where':{'id':_0x5abc93[_0x23ff('0x62')]['id']},'raw':!![]})[_0x23ff('0x20')](function(_0x191313){return authService[_0x23ff('0x15f')](_0x191313);})[_0x23ff('0x20')](function(_0x2121df){if(_0x2121df){return _0x51ac89[_0x23ff('0x2a')](0xc8)[_0x23ff('0x2c')]({'api_key':_0x2121df[_0x23ff('0x160')]});}else{return _0x51ac89['status'](0xcc)[_0x23ff('0x2c')]({'message':'No\x20API\x20access\x20key\x20found!'});}})['catch'](handleError(_0x51ac89,0x193));}else{return _0x51ac89[_0x23ff('0x2a')](0x191)[_0x23ff('0x2c')]({'message':_0x23ff('0x161')});}};exports[_0x23ff('0x162')]=function(_0x57e73f,_0x176972,_0x498853){if(!_[_0x23ff('0x6b')](_0x57e73f[_0x23ff('0x36')]['id'])&&(_0x57e73f[_0x23ff('0x36')][_0x23ff('0x3f')]=='admin'||_0x57e73f[_0x23ff('0x36')][_0x23ff('0x3f')]==_0x23ff('0x36'))){return db[_0x23ff('0x43')][_0x23ff('0x3e')]({'where':{'id':_0x57e73f[_0x23ff('0x62')]['id']}})['then'](function(_0x5d2ce2){return authService[_0x23ff('0x163')](_0x5d2ce2);})[_0x23ff('0x20')](function(_0x536213){return db[_0x23ff('0x43')]['update']({'apiKeyIat':_0x536213[_0x23ff('0x164')],'apiKeyNonce':_0x536213[_0x23ff('0x165')]},{'where':{'id':_0x57e73f[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](function(){return _0x176972[_0x23ff('0x2a')](0xc8)['json']({'api_key':_0x536213[_0x23ff('0x160')]});});})[_0x23ff('0x5d')](handleError(_0x176972,0x193));}else{return _0x176972[_0x23ff('0x2a')](0x191)[_0x23ff('0x2c')]({'message':_0x23ff('0x161')});}};exports['removeApiKey']=function(_0x4ac964,_0x48feec,_0x555beb){if(!_[_0x23ff('0x6b')](_0x4ac964['user']['id'])&&(_0x4ac964[_0x23ff('0x36')]['role']==_0x23ff('0x66')||_0x4ac964['user'][_0x23ff('0x3f')]==_0x23ff('0x36'))){return db['User']['find']({'where':{'id':_0x4ac964[_0x23ff('0x62')]['id']}})[_0x23ff('0x20')](handleEntityNotFound(_0x48feec,null))[_0x23ff('0x20')](function(_0x5dea47){if(_0x5dea47&&_0x5dea47[_0x23ff('0x166')]&&_0x5dea47[_0x23ff('0x167')])return _0x5dea47;else throw{'message':_0x23ff('0x168')};})['then'](function(_0x3bbc6a){return db[_0x23ff('0x43')][_0x23ff('0x32')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x4ac964[_0x23ff('0x62')]['id']}});})[_0x23ff('0x20')](respondWithStatusCode(_0x48feec,0xc8))[_0x23ff('0x5d')](handleError(_0x48feec,0x193));}else{return _0x48feec[_0x23ff('0x2a')](0x191)[_0x23ff('0x2c')]({'message':_0x23ff('0x161')});}};exports[_0x23ff('0x169')]=function(_0x31cbae,_0x51066d){var _0x34fcdf=_0x31cbae['user'][_0x23ff('0x34')]({'plain':!![]});if(!_0x34fcdf){return _0x51066d[_0x23ff('0x2a')](0x191)[_0x23ff('0x41')]('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{return _0x51066d[_0x23ff('0x2a')](0xc8)[_0x23ff('0x2c')](_0x34fcdf);}};
\ No newline at end of file
+var _0x84cb=['YYYY-MM-DD\x20HH:mm:ss','all','getChannels','PAUSE','LOGININPAUSE','isMiddleware','logout','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','whatsapppause','QueuePause','manual','chat','fax','sms','whatsapp','openchannel','%s%s','getTeams','Team','addTeams','getChatQueues','setDataValue','Chat','Mail','Sms','getWhatsappQueues','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','removeTeams','getSmsQueues','Whatsapp','removeAgent','Voice','Queue:remove','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','isArray','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','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$notLike','$notILike','$like','$overlap','$contains','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./user.socket','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','status','json','limit','set','Content-Range','reject','save','update','destroy','Users','agent','Telephones','telephone','filter','map','value','includes','role','UserProfileResource','sendStatus','stack','name','send','index','User','rawAttributes','fieldName','type','model','differenceBy','query','filters','attributes','intersection','fields','length','offset','sort','where','pick','merge','VIRTUAL','sequelize','lower','col','options','count','includeAll','include','findAll','rows','show','params','password','salt','bulkCreate','body','find','describe','addContacts','ids','omit','agent\x20role','admin','user','../../config/license/util','getLicense','telephones','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','internal','Setting','max','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','VoiceMail','email','permissions','102','103','113','104','107','108','109','100','111','114','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Agents','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','securePassword','oldPassword','newPassword','authenticate','ValidationError','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','channel','interface','isValidChannel','Unknown\x20channel','capitalize','Queues','penalty','spread','emit','toLowerCase','voice','VoiceQueue','online','push','SIP/%s','voicePause','each','UserVoiceQueueRt','removeQueues','remove','QueueId','userpic','file','filename','getAvatar','join','root','server/files/images/','download','keys','CmContact','order','getContacts','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','headers','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach'];(function(_0x2391ec,_0x4446ca){var _0xf93182=function(_0x2c825c){while(--_0x2c825c){_0x2391ec['push'](_0x2391ec['shift']());}};_0xf93182(++_0x4446ca);}(_0x84cb,0x88));var _0xb84c=function(_0x431d03,_0x171e9b){_0x431d03=_0x431d03-0x0;var _0x1941e7=_0x84cb[_0x431d03];return _0x1941e7;};'use strict';var pdf=require(_0xb84c('0x0'));var emlformat=require(_0xb84c('0x1'));var rimraf=require(_0xb84c('0x2'));var zipdir=require(_0xb84c('0x3'));var jsonpatch=require(_0xb84c('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb84c('0x5'));var Mustache=require(_0xb84c('0x6'));var util=require(_0xb84c('0x7'));var path=require(_0xb84c('0x8'));var sox=require(_0xb84c('0x9'));var csv=require('to-csv');var ejs=require(_0xb84c('0xa'));var fs=require('fs');var _=require(_0xb84c('0xb'));var squel=require(_0xb84c('0xc'));var crypto=require(_0xb84c('0xd'));var jsforce=require(_0xb84c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb84c('0xf'));var querystring=require(_0xb84c('0x10'));var Papa=require(_0xb84c('0x11'));var Redis=require(_0xb84c('0x12'));var authService=require(_0xb84c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb84c('0x14'));var hardwareService=require(_0xb84c('0x15'));var logger=require(_0xb84c('0x16'))('api');var utils=require(_0xb84c('0x17'));var config=require(_0xb84c('0x18'));var db=require(_0xb84c('0x19'))['db'];config[_0xb84c('0x1a')]=_[_0xb84c('0x1b')](config['redis'],{'host':_0xb84c('0x1c'),'port':0x18eb});var socket=require(_0xb84c('0x1d'))(new Redis(config[_0xb84c('0x1a')]));require(_0xb84c('0x1e'))['register'](socket);var jayson=require(_0xb84c('0x1f'));var client=jayson['client'][_0xb84c('0x20')]({'port':0x232a});function checkPasswordPattern(_0x3fa659,_0xc77fcf,_0x5f0a79){if(_0x5f0a79){var _0x3eedf9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3eedf9[_0xb84c('0x21')](_0xc77fcf)){return _0x3fa659;}else{throw new db[(_0xb84c('0x22'))]['ValidationError'](_0xb84c('0x23'));}}else{return _0x3fa659;}}function respondWithRpcPromise(_0x5aa795,_0x3adc3c,_0x4f0a6d,_0xf158b5){return new BPromise(function(_0x38e5fb,_0x4f8bdf){var _0x409d6c=_0xf158b5||client;return _0x409d6c['request'](_0x5aa795,_0x4f0a6d)[_0xb84c('0x24')](function(_0x3e89f3){logger[_0xb84c('0x25')](_0xb84c('0x26'),_0x3adc3c,_0xb84c('0x27'));logger[_0xb84c('0x28')](_0xb84c('0x29'),_0x3adc3c,_0xb84c('0x27'),JSON['stringify'](_0x3e89f3));if(_0x3e89f3[_0xb84c('0x2a')]){if(_0x3e89f3['error'][_0xb84c('0x2b')]===0x1f4){logger[_0xb84c('0x2a')]('User,\x20%s,\x20%s',_0x3adc3c,_0x3e89f3['error'][_0xb84c('0x2c')]);return _0x4f8bdf(_0x3e89f3[_0xb84c('0x2a')][_0xb84c('0x2c')]);}logger[_0xb84c('0x2a')](_0xb84c('0x26'),_0x3adc3c,_0x3e89f3[_0xb84c('0x2a')][_0xb84c('0x2c')]);return _0x38e5fb(_0x3e89f3['error'][_0xb84c('0x2c')]);}else{logger[_0xb84c('0x25')](_0xb84c('0x26'),_0x3adc3c,'request\x20sent');_0x38e5fb(_0x3e89f3[_0xb84c('0x2d')][_0xb84c('0x2c')]);}})[_0xb84c('0x2e')](function(_0xa9c064){logger[_0xb84c('0x2a')](_0xb84c('0x26'),_0x3adc3c,_0xa9c064);_0x4f8bdf(_0xa9c064);});});}function respondWithStatusCode(_0x4087b1,_0x4f92af){_0x4f92af=_0x4f92af||0xcc;return function(_0x4ad4b3){if(_0x4ad4b3){return _0x4087b1['sendStatus'](_0x4f92af);}return _0x4087b1['status'](_0x4f92af)[_0xb84c('0x2f')]();};}function respondWithResult(_0x3149c3,_0x17d218){_0x17d218=_0x17d218||0xc8;return function(_0x4bac30){if(_0x4bac30){return _0x3149c3[_0xb84c('0x30')](_0x17d218)[_0xb84c('0x31')](_0x4bac30);}};}function respondWithFilteredResult(_0x309d1a,_0x56821b){return function(_0x12b82d){if(_0x12b82d){var _0x46f1fe=_0x12b82d['count'],_0x29ec6b=_0x56821b['offset'],_0xc8341e=_0x56821b['offset']+_0x56821b[_0xb84c('0x32')],_0x34f7a8;if(_0xc8341e>=_0x46f1fe){_0xc8341e=_0x46f1fe;_0x34f7a8=0xc8;}else{_0x34f7a8=0xce;}_0x309d1a[_0xb84c('0x30')](_0x34f7a8);return _0x309d1a[_0xb84c('0x33')](_0xb84c('0x34'),_0x29ec6b+'-'+_0xc8341e+'/'+_0x46f1fe)[_0xb84c('0x31')](_0x12b82d);}return null;};}function patchUpdates(_0x33a641){return function(_0x1d1374){try{jsonpatch['apply'](_0x1d1374,_0x33a641,!![]);}catch(_0x191f98){return BPromise[_0xb84c('0x35')](_0x191f98);}return _0x1d1374[_0xb84c('0x36')]();};}function saveUpdates(_0x1783e3,_0xaf0a37){return function(_0x37f22f){if(_0x37f22f){return _0x37f22f[_0xb84c('0x37')](_0x1783e3)[_0xb84c('0x24')](function(_0x2d41b2){return _0x2d41b2;});}return null;};}function removeEntity(_0x4d4426,_0x5ae653){return function(_0x255dfc){if(_0x255dfc){return _0x255dfc[_0xb84c('0x38')]()[_0xb84c('0x24')](function(){var _0x18d813=_0x255dfc['get']({'plain':!![]});var _0x4515aa=[{'name':_0xb84c('0x39'),'value':'user','ignore':!![]},{'name':'Agents','value':_0xb84c('0x3a'),'ignore':![]},{'name':_0xb84c('0x3b'),'value':_0xb84c('0x3c'),'ignore':![]}];var _0x2f8d43=_(_0x4515aa)[_0xb84c('0x3d')]('ignore')[_0xb84c('0x3e')](_0xb84c('0x3f'))[_0xb84c('0x3f')]();if(_[_0xb84c('0x40')](_0x2f8d43,_0x18d813[_0xb84c('0x41')])){return;}var _0x3bf897=_['find'](_0x4515aa,[_0xb84c('0x3f'),_0x18d813[_0xb84c('0x41')]])['name'];return db[_0xb84c('0x42')][_0xb84c('0x38')]({'where':{'type':_0x3bf897,'resourceId':_0x18d813['id']}})[_0xb84c('0x24')](function(){return _0x255dfc;});})[_0xb84c('0x24')](function(){_0x4d4426['status'](0xcc)[_0xb84c('0x2f')]();});}};}function handleEntityNotFound(_0x3db862,_0x207774){return function(_0x483a5c){if(!_0x483a5c){_0x3db862[_0xb84c('0x43')](0x194);}return _0x483a5c;};}function handleError(_0x50f852,_0x2bb960){_0x2bb960=_0x2bb960||0x1f4;return function(_0x573193){logger['error'](_0x573193[_0xb84c('0x44')]);if(_0x573193[_0xb84c('0x45')]){delete _0x573193[_0xb84c('0x45')];}_0x50f852[_0xb84c('0x30')](_0x2bb960)[_0xb84c('0x46')](_0x573193);};}exports[_0xb84c('0x47')]=function(_0x1778f6,_0xb51e1b){var _0x459294={},_0x57d5ad={},_0x48260d={'count':0x0,'rows':[]};var _0x595d28=_[_0xb84c('0x3e')](db[_0xb84c('0x48')][_0xb84c('0x49')],function(_0x12fc29){return{'name':_0x12fc29[_0xb84c('0x4a')],'type':_0x12fc29[_0xb84c('0x4b')]['key']};});_0x57d5ad[_0xb84c('0x4c')]=_[_0xb84c('0x4d')](_[_0xb84c('0x3e')](_0x595d28,'name'),['password','salt']);_0x57d5ad['query']=_['keys'](_0x1778f6[_0xb84c('0x4e')]);_0x57d5ad[_0xb84c('0x4f')]=_['intersection'](_0x57d5ad[_0xb84c('0x4c')],_0x57d5ad[_0xb84c('0x4e')]);_0x459294[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0x57d5ad[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x1778f6[_0xb84c('0x4e')]['fields']));_0x459294[_0xb84c('0x50')]=_0x459294[_0xb84c('0x50')][_0xb84c('0x53')]?_0x459294['attributes']:_0x57d5ad[_0xb84c('0x4c')];if(!_0x1778f6[_0xb84c('0x4e')]['hasOwnProperty']('nolimit')){_0x459294['limit']=qs[_0xb84c('0x32')](_0x1778f6[_0xb84c('0x4e')][_0xb84c('0x32')]);_0x459294[_0xb84c('0x54')]=qs['offset'](_0x1778f6[_0xb84c('0x4e')][_0xb84c('0x54')]);}_0x459294['order']=qs[_0xb84c('0x55')](_0x1778f6[_0xb84c('0x4e')][_0xb84c('0x55')]);_0x459294[_0xb84c('0x56')]=qs['filters'](_[_0xb84c('0x57')](_0x1778f6[_0xb84c('0x4e')],_0x57d5ad['filters']),_0x595d28);if(_0x1778f6[_0xb84c('0x4e')]['filter']){_0x459294[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x459294[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x595d28,function(_0x4bc3db){if(_0x4bc3db['type']!==_0xb84c('0x59')){return db[_0xb84c('0x5a')]['where'](db[_0xb84c('0x5a')]['fn'](_0xb84c('0x5b'),db[_0xb84c('0x5a')][_0xb84c('0x5c')](_0x4bc3db[_0xb84c('0x45')])),{'$like':db['sequelize']['fn'](_0xb84c('0x5b'),'%'+_0x1778f6['query'][_0xb84c('0x3d')]+'%')});}})});}_0x459294=_[_0xb84c('0x58')]({},_0x459294,_0x1778f6[_0xb84c('0x5d')]);var _0x35da31={'where':_0x459294[_0xb84c('0x56')]};return db[_0xb84c('0x48')]['count'](_0x35da31)[_0xb84c('0x24')](function(_0x3f0c9a){_0x48260d[_0xb84c('0x5e')]=_0x3f0c9a;if(_0x1778f6['query'][_0xb84c('0x5f')]){_0x459294[_0xb84c('0x60')]=[{'all':!![]}];}return db['User'][_0xb84c('0x61')](_0x459294);})['then'](function(_0x54ac85){_0x48260d[_0xb84c('0x62')]=_0x54ac85;return _0x48260d;})['then'](respondWithFilteredResult(_0xb51e1b,_0x459294))[_0xb84c('0x2e')](handleError(_0xb51e1b,null));};exports[_0xb84c('0x63')]=function(_0x136fd2,_0x97b788){var _0x1792f2={'raw':![],'where':{'id':_0x136fd2[_0xb84c('0x64')]['id']}},_0x1f6357={};_0x1f6357[_0xb84c('0x4c')]=_[_0xb84c('0x4d')](_['keys'](db['User'][_0xb84c('0x49')]),[_0xb84c('0x65'),_0xb84c('0x66')]);_0x1f6357['query']=_['keys'](_0x136fd2[_0xb84c('0x4e')]);_0x1f6357[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x1f6357['model'],_0x1f6357[_0xb84c('0x4e')]);_0x1792f2[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0x1f6357[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x136fd2[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x1792f2[_0xb84c('0x50')]=_0x1792f2[_0xb84c('0x50')][_0xb84c('0x53')]?_0x1792f2[_0xb84c('0x50')]:_0x1f6357['model'];if(_0x136fd2[_0xb84c('0x4e')][_0xb84c('0x5f')]){_0x1792f2['include']=[{'all':!![]}];}_0x1792f2=_[_0xb84c('0x58')]({},_0x1792f2,_0x136fd2[_0xb84c('0x5d')]);return db[_0xb84c('0x48')]['find'](_0x1792f2)[_0xb84c('0x24')](handleEntityNotFound(_0x97b788,null))[_0xb84c('0x24')](respondWithResult(_0x97b788,null))['catch'](handleError(_0x97b788,null));};exports[_0xb84c('0x67')]=function(_0x1d583f,_0x2e1de8){return db[_0xb84c('0x48')][_0xb84c('0x67')](_0x1d583f[_0xb84c('0x68')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2e1de8,0xc9))['catch'](handleError(_0x2e1de8,null));};exports[_0xb84c('0x37')]=function(_0x40ad07,_0x384891){if(_0x40ad07[_0xb84c('0x68')]['id']){delete _0x40ad07[_0xb84c('0x68')]['id'];}delete _0x40ad07[_0xb84c('0x68')][_0xb84c('0x41')];return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x40ad07[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x384891,null))[_0xb84c('0x24')](saveUpdates(_0x40ad07[_0xb84c('0x68')],null))[_0xb84c('0x24')](respondWithResult(_0x384891,null))[_0xb84c('0x2e')](handleError(_0x384891,null));};exports[_0xb84c('0x6a')]=function(_0x1e3cac,_0x9cbc69){return db[_0xb84c('0x48')][_0xb84c('0x6a')]()[_0xb84c('0x24')](respondWithResult(_0x9cbc69,null))[_0xb84c('0x2e')](handleError(_0x9cbc69,null));};exports['addContacts']=function(_0x2c53bd,_0x11b630,_0x5c988e){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x2c53bd['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x11b630,null))[_0xb84c('0x24')](function(_0x3ef7e9){if(_0x3ef7e9){return _0x3ef7e9[_0xb84c('0x6b')](_0x2c53bd['body'][_0xb84c('0x6c')],_[_0xb84c('0x6d')](_0x2c53bd[_0xb84c('0x68')],[_0xb84c('0x6c'),'id'])||{});}})[_0xb84c('0x24')](respondWithResult(_0x11b630,null))[_0xb84c('0x2e')](handleError(_0x11b630,null));};var getLicense=function(_0xc27cd1){return new BPromise(function(_0x50a4cd,_0x373def){var _0x1c085a=0x0;_0xc27cd1[_0xb84c('0x68')]['role']==='agent'&&_0x50a4cd(_0xb84c('0x6e'));return db[_0xb84c('0x48')][_0xb84c('0x5e')]({'where':{'$or':[{'role':_0xc27cd1[_0xb84c('0x68')]['role']===_0xb84c('0x3c')?'telephone':[_0xb84c('0x6f'),_0xb84c('0x70')]}]}})[_0xb84c('0x24')](function(_0x418531){_0x1c085a=_0x418531;return require(_0xb84c('0x71'))[_0xb84c('0x72')]();})[_0xb84c('0x24')](function(_0x1aaeee){var _0x26cc92=_0xc27cd1[_0xb84c('0x68')]['role']===_0xb84c('0x3c')?_0xb84c('0x73'):'users';if(!_[_0xb84c('0x74')](_0x1aaeee[_0x26cc92])&&_0x1c085a>=_0x1aaeee[_0x26cc92]){return _0x373def({'message':_0xb84c('0x75')});}return _0x50a4cd(util[_0xb84c('0x76')](_0xb84c('0x77'),_0x26cc92,_0x1c085a));})[_0xb84c('0x2e')](function(_0x5927e1){return _0x373def(_0x5927e1);});});};exports[_0xb84c('0x78')]=function(_0xac562e,_0x1e5034){return getLicense(_0xac562e)[_0xb84c('0x24')](function(_0x410ce0){if(!_0xac562e[_0xb84c('0x68')][_0xb84c('0x79')]){var _0x5a47ea;return db[_0xb84c('0x7a')]['findById'](0x1)['then'](function(_0x128c0e){return checkPasswordPattern(_0x128c0e,_0xac562e[_0xb84c('0x68')]['password'],_0x128c0e['securePassword']);})[_0xb84c('0x24')](function(_0x470622){_0x5a47ea=_0x470622['min_internal'];return db[_0xb84c('0x48')][_0xb84c('0x7b')](_0xb84c('0x79'));})[_0xb84c('0x24')](function(_0x2ffda1){if(_['isNil'](_0x2ffda1)){if(_0x5a47ea){_0xac562e[_0xb84c('0x68')][_0xb84c('0x79')]=_0x5a47ea;}else{_0xac562e[_0xb84c('0x68')][_0xb84c('0x79')]=0x1;}}else{if(_[_0xb84c('0x74')](_0x5a47ea)||_0x5a47ea==_0x2ffda1){_0xac562e[_0xb84c('0x68')][_0xb84c('0x79')]=_0x2ffda1+0x1;}else if(_0x5a47ea>_0x2ffda1){_0xac562e[_0xb84c('0x68')][_0xb84c('0x79')]=_0x5a47ea;}else{return db['sequelize'][_0xb84c('0x4e')](_0xb84c('0x7c'),{'type':db[_0xb84c('0x5a')][_0xb84c('0x7d')][_0xb84c('0x7e')]})[_0xb84c('0x24')](function(_0x563d2e){if(_0x563d2e&&_0x563d2e['length']){for(var _0x2994d1=0x0,_0x3c028d=_0x563d2e[_0xb84c('0x53')];_0x2994d1<_0x3c028d&&_[_0xb84c('0x74')](_0xac562e[_0xb84c('0x68')]['internal']);_0x2994d1++){if(_0x5a47ea<=_0x563d2e[_0x2994d1][_0xb84c('0x7f')]){_0xac562e[_0xb84c('0x68')][_0xb84c('0x79')]=_0x563d2e[_0x2994d1][_0xb84c('0x7f')];}else if(_0x5a47ea>_0x563d2e[_0x2994d1][_0xb84c('0x7f')]&&_0x5a47ea<=_0x563d2e[_0x2994d1]['to']){_0xac562e[_0xb84c('0x68')][_0xb84c('0x79')]=_0x5a47ea;}}}if(_[_0xb84c('0x74')](_0xac562e[_0xb84c('0x68')][_0xb84c('0x79')])){_0xac562e['body']['internal']=_0x2ffda1+0x1;}});}}});}})['then'](function(){if(_0xac562e[_0xb84c('0x68')][_0xb84c('0x80')]){_0xac562e['body']['mailbox']=_0xac562e[_0xb84c('0x68')][_0xb84c('0x79')];_0xac562e[_0xb84c('0x68')][_0xb84c('0x81')]={'mailbox':_0xac562e[_0xb84c('0x68')][_0xb84c('0x79')],'password':_0xac562e[_0xb84c('0x68')][_0xb84c('0x65')],'fullname':_0xac562e[_0xb84c('0x68')]['fullname'],'email':_0xac562e['body'][_0xb84c('0x82')]};}if(_0xac562e[_0xb84c('0x68')]&&_0xac562e[_0xb84c('0x68')][_0xb84c('0x41')]===_0xb84c('0x3a')){if(!_0xac562e['body'][_0xb84c('0x83')]){_0xac562e['body'][_0xb84c('0x83')]=['101',_0xb84c('0x84'),_0xb84c('0x85'),_0xb84c('0x86'),'110',_0xb84c('0x87'),'105','106',_0xb84c('0x88'),_0xb84c('0x89'),_0xb84c('0x8a'),_0xb84c('0x8b'),_0xb84c('0x8c'),_0xb84c('0x8d')];}}return db['User'][_0xb84c('0x78')](_0xac562e[_0xb84c('0x68')],{'include':[{'model':db[_0xb84c('0x81')],'as':'VoiceMail'}]});})[_0xb84c('0x24')](function(_0x2aba5a){if(_0xac562e['body'][_0xb84c('0x41')]===_0xb84c('0x70'))return _0x2aba5a;var _0x3c2a4b=_0xac562e['user']['get']({'plain':!![]});if(!_0x3c2a4b)throw new Error(_0xb84c('0x8e'));if(_0x3c2a4b['role']===_0xb84c('0x70')){var _0x4b8193=_0x2aba5a[_0xb84c('0x8f')]({'plain':!![]});var _0x4ee694=[{'name':_0xb84c('0x90'),'value':_0xb84c('0x3a')},{'name':_0xb84c('0x3b'),'value':'telephone'}];var _0x3559c5=_[_0xb84c('0x69')](_0x4ee694,['value',_0x4b8193[_0xb84c('0x41')]])['name'];return db[_0xb84c('0x91')][_0xb84c('0x69')]({'where':{'name':_0x3559c5,'userProfileId':_0x3c2a4b[_0xb84c('0x92')]},'raw':!![]})[_0xb84c('0x24')](function(_0x42d69b){if(_0x42d69b&&_0x42d69b[_0xb84c('0x93')]===0x0){return db['UserProfileResource'][_0xb84c('0x78')]({'name':_0x4b8193[_0xb84c('0x45')],'resourceId':_0x4b8193['id'],'type':_0x42d69b[_0xb84c('0x45')],'sectionId':_0x42d69b['id']},{})[_0xb84c('0x24')](function(){return _0x2aba5a;});}else{return _0x2aba5a;}})[_0xb84c('0x2e')](function(_0x2b66dd){logger[_0xb84c('0x2a')](_0xb84c('0x94'),_0x2b66dd);throw _0x2b66dd;});}return _0x2aba5a;})[_0xb84c('0x24')](respondWithResult(_0x1e5034,0xc9))['catch'](handleError(_0x1e5034,null));};exports['changePassword']=function(_0x3fbace,_0xd4a41c,_0x5311cd){var _0x3c593f=![];if(_0x3fbace[_0xb84c('0x68')]['id']){delete _0x3fbace['body']['id'];}return db[_0xb84c('0x7a')][_0xb84c('0x95')]({'attributes':['id',_0xb84c('0x96')]})[_0xb84c('0x24')](function(_0x4facc7){_0x3c593f=_0x4facc7['securePassword'];return db['User'][_0xb84c('0x69')]({'where':{'id':_0x3fbace[_0xb84c('0x64')]['id']}});})[_0xb84c('0x24')](function(_0x338745){if(_0x338745){if(_0x338745['id']==_0x3fbace[_0xb84c('0x70')]['id']){if(!_0x3fbace[_0xb84c('0x68')][_0xb84c('0x97')]||!_0x3fbace[_0xb84c('0x68')][_0xb84c('0x98')]){throw new db[(_0xb84c('0x22'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x338745[_0xb84c('0x99')](_0x3fbace[_0xb84c('0x68')]['oldPassword'])){throw new db['Sequelize'][(_0xb84c('0x9a'))](_0xb84c('0x9b'));}if(_0x3fbace[_0xb84c('0x68')][_0xb84c('0x97')]==_0x3fbace[_0xb84c('0x68')][_0xb84c('0x98')]){throw new db['Sequelize']['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x338745;}else if(_0x3fbace[_0xb84c('0x70')][_0xb84c('0x41')]==_0xb84c('0x6f')){if(!_0x3fbace[_0xb84c('0x68')][_0xb84c('0x98')]){throw new db[(_0xb84c('0x22'))]['ValidationError'](_0xb84c('0x9c'));}return _0x338745;}else if(_0x3fbace[_0xb84c('0x70')][_0xb84c('0x41')]==_0xb84c('0x70')){if(!_0x3fbace[_0xb84c('0x68')]['newPassword']){throw new db[(_0xb84c('0x22'))][(_0xb84c('0x9a'))](_0xb84c('0x9c'));}if(_0x338745['role']!=_0xb84c('0x3a')){throw new db[(_0xb84c('0x22'))][(_0xb84c('0x9a'))](_0xb84c('0x9d'));}return _0x338745;}else{throw new db['Sequelize']['ValidationError']('Unauthorized');}}return null;})[_0xb84c('0x24')](handleEntityNotFound(_0xd4a41c,null))[_0xb84c('0x24')](function(_0x4682cb){return checkPasswordPattern(_0x4682cb,_0x3fbace[_0xb84c('0x68')][_0xb84c('0x98')],_0x3c593f);})[_0xb84c('0x24')](saveUpdates({'password':_0x3fbace[_0xb84c('0x68')]['newPassword'],'passwordResetAt':_0x3fbace[_0xb84c('0x70')]['id']==_0x3fbace['params']['id']?moment():null},null))[_0xb84c('0x24')](respondWithResult(_0xd4a41c,null))[_0xb84c('0x2e')](handleError(_0xd4a41c,null));};exports['addQueues']=function(_0x1b4365,_0x4544c9,_0x1b5185){var _0x14d24e=_0x1b4365[_0xb84c('0x68')][_0xb84c('0x9e')];return db['User'][_0xb84c('0x69')]({'where':{'id':_0x1b4365[_0xb84c('0x64')]['id']},'attributes':['id',_0xb84c('0x45'),_0xb84c('0x41'),'online','loginInPause','voicePause',_0xb84c('0x9f')]})['then'](handleEntityNotFound(_0x4544c9,null))['then'](function(_0x53a16d){if(_0x53a16d){if(!utils[_0xb84c('0xa0')](_0x14d24e)){throw new db['Sequelize'][(_0xb84c('0x9a'))](_0xb84c('0xa1'));}return _0x53a16d['add'+_[_0xb84c('0xa2')](_0x14d24e['toLowerCase']())+_0xb84c('0xa3')](_0x1b4365[_0xb84c('0x68')][_0xb84c('0x6c')],{'penalty':_0x1b4365[_0xb84c('0x68')][_0xb84c('0xa4')]||0x0})[_0xb84c('0xa5')](function(_0xb563c3){for(var _0x103e1e=0x0;_0x103e1e<_0x1b4365[_0xb84c('0x68')][_0xb84c('0x6c')]['length'];_0x103e1e+=0x1){var _0x19820f={'UserId':_0x1b4365['params']['id']};_0x19820f[_[_0xb84c('0xa2')](_0x14d24e['toLowerCase']())+'QueueId']=_0x1b4365[_0xb84c('0x68')][_0xb84c('0x6c')][_0x103e1e];socket[_0xb84c('0xa6')](_0xb84c('0x70')+_['capitalize'](_0x14d24e[_0xb84c('0xa7')]())+'Queue:save',_0x19820f);}return _0xb563c3;})[_0xb84c('0x24')](function(){if(_0x14d24e===_0xb84c('0xa8')){return db[_0xb84c('0xa9')][_0xb84c('0x61')]({'where':{'id':_0x1b4365['body'][_0xb84c('0x6c')]||[]},'raw':!![],'attributes':['id',_0xb84c('0x45')]});}})[_0xb84c('0x24')](function(_0x143ff1){var _0x596a97=_0x53a16d[_0xb84c('0x8f')]({'plain':!![]});var _0x3c9b11=[];if(_0x14d24e===_0xb84c('0xa8')&&_0x596a97[_0xb84c('0x41')]===_0xb84c('0x3a')&&_0x596a97[_0xb84c('0xaa')]){for(var _0x289f25=0x0;_0x289f25<_0x143ff1[_0xb84c('0x53')];_0x289f25+=0x1){_0x3c9b11[_0xb84c('0xab')]({'membername':_0x596a97[_0xb84c('0x45')],'UserId':_0x596a97['id'],'queue_name':_0x143ff1[_0x289f25][_0xb84c('0x45')],'VoiceQueueId':_0x143ff1[_0x289f25]['id'],'interface':_[_0xb84c('0x74')](_0x596a97[_0xb84c('0x9f')])?util[_0xb84c('0x76')](_0xb84c('0xac'),_0x596a97[_0xb84c('0x45')]):_0x596a97['interface'],'paused':_0x596a97[_0xb84c('0xad')]||![],'penalty':_0x1b4365[_0xb84c('0x68')][_0xb84c('0xa4')]||0x0});}return BPromise[_0xb84c('0xae')](_0x3c9b11,function(_0x2e06e3){return db[_0xb84c('0xaf')]['upsert'](_0x2e06e3);});}return _0x53a16d;});}})[_0xb84c('0x24')](respondWithStatusCode(_0x4544c9,null))['catch'](handleError(_0x4544c9,null));};exports[_0xb84c('0xb0')]=function(_0x2b9ec1,_0xdda659,_0x510e73){var _0x2ac583;return db['User'][_0xb84c('0x69')]({'where':{'id':_0x2b9ec1[_0xb84c('0x64')]['id']},'attributes':['id',_0xb84c('0x45'),_0xb84c('0x41')]})['then'](handleEntityNotFound(_0xdda659,null))[_0xb84c('0x24')](function(_0x5998d0){if(_0x5998d0){_0x2ac583=_0x5998d0;if(!_0x2b9ec1['query'][_0xb84c('0x9e')]||!utils[_0xb84c('0xa0')](_0x2b9ec1[_0xb84c('0x4e')][_0xb84c('0x9e')])){throw new db[(_0xb84c('0x22'))][(_0xb84c('0x9a'))](_0xb84c('0xa1'));}return _0x5998d0[_0xb84c('0xb1')+_[_0xb84c('0xa2')](_0x2b9ec1['query'][_0xb84c('0x9e')][_0xb84c('0xa7')]())+_0xb84c('0xa3')](_0x2b9ec1['query'][_0xb84c('0x6c')]);}})[_0xb84c('0x24')](function(_0x1595c8){for(var _0xb835c9=0x0;_0xb835c9<_0x2b9ec1[_0xb84c('0x4e')][_0xb84c('0x6c')][_0xb84c('0x53')];_0xb835c9+=0x1){var _0x4c8289={'UserId':_0x2b9ec1[_0xb84c('0x64')]['id']};_0x4c8289[_[_0xb84c('0xa2')](_0x2b9ec1[_0xb84c('0x4e')]['channel'][_0xb84c('0xa7')]())+_0xb84c('0xb2')]=_0x2b9ec1[_0xb84c('0x4e')][_0xb84c('0x6c')][_0xb835c9];socket[_0xb84c('0xa6')](_0xb84c('0x70')+_[_0xb84c('0xa2')](_0x2b9ec1['query'][_0xb84c('0x9e')][_0xb84c('0xa7')]())+'Queue:remove',_0x4c8289);}return _0x1595c8;})[_0xb84c('0x24')](function(){if(_0x2b9ec1[_0xb84c('0x4e')][_0xb84c('0x9e')]===_0xb84c('0xa8')){return db['UserVoiceQueueRt'][_0xb84c('0x38')]({'where':{'UserId':_0x2b9ec1['params']['id'],'VoiceQueueId':_0x2b9ec1[_0xb84c('0x4e')][_0xb84c('0x6c')]},'individualHooks':!![]})[_0xb84c('0x24')](function(){return _0x2ac583;});}return _0x2ac583;})[_0xb84c('0x24')](respondWithStatusCode(_0xdda659,null))['catch'](handleError(_0xdda659,null));};exports['addAvatar']=function(_0x16f2e0,_0x3f6457,_0x39be2e){_0x16f2e0[_0xb84c('0x68')][_0xb84c('0xb3')]=_0x16f2e0[_0xb84c('0xb4')][_0xb84c('0xb5')];return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x16f2e0[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x3f6457,null))[_0xb84c('0x24')](saveUpdates(_0x16f2e0['body'],null))[_0xb84c('0x24')](respondWithResult(_0x3f6457,null))[_0xb84c('0x2e')](handleError(_0x3f6457,null));};exports[_0xb84c('0xb6')]=function(_0x578ad7,_0x582755,_0x31b8a8){var _0x29f69b=path[_0xb84c('0xb7')](config[_0xb84c('0xb8')],'server/files/images/logos/default_profile.png');return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x578ad7['params']['id']},'attributes':['id',_0xb84c('0xb3')],'raw':!![]})[_0xb84c('0x24')](handleEntityNotFound(_0x582755,null))['then'](function(_0x5acd2d){if(_0x5acd2d){if(_[_0xb84c('0x74')](_0x5acd2d[_0xb84c('0xb3')])){return _0x582755['download'](_0x29f69b);}else{if(!fs['existsSync'](path['join'](config[_0xb84c('0xb8')],_0xb84c('0xb9'),_0x5acd2d[_0xb84c('0xb3')]))){return _0x582755['download'](_0x29f69b);}return _0x582755[_0xb84c('0xba')](path[_0xb84c('0xb7')](config[_0xb84c('0xb8')],_0xb84c('0xb9'),_0x5acd2d[_0xb84c('0xb3')]));}}})['catch'](handleError(_0x582755,null));};exports['getContacts']=function(_0x34fad1,_0x3fd484,_0x61d2b3){var _0x2d19c6={};var _0x4eefaa={};var _0xc3bcf8;var _0x9f6f03;return db[_0xb84c('0x48')][_0xb84c('0x95')]({'where':{'id':_0x34fad1[_0xb84c('0x64')]['id']}})['then'](handleEntityNotFound(_0x3fd484,null))['then'](function(_0x3e4e42){if(_0x3e4e42){_0xc3bcf8=_0x3e4e42;_0x4eefaa[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](db[_0xb84c('0xbc')][_0xb84c('0x49')]);_0x4eefaa[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x34fad1['query']);_0x4eefaa[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x4eefaa[_0xb84c('0x4c')],_0x4eefaa[_0xb84c('0x4e')]);_0x2d19c6[_0xb84c('0x50')]=_['intersection'](_0x4eefaa[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x34fad1[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x2d19c6[_0xb84c('0x50')]=_0x2d19c6[_0xb84c('0x50')][_0xb84c('0x53')]?_0x2d19c6[_0xb84c('0x50')]:_0x4eefaa[_0xb84c('0x4c')];_0x2d19c6[_0xb84c('0xbd')]=qs[_0xb84c('0x55')](_0x34fad1['query']['sort']);_0x2d19c6['where']=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x34fad1[_0xb84c('0x4e')],_0x4eefaa[_0xb84c('0x4f')]));if(_0x34fad1[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0x2d19c6[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x2d19c6[_0xb84c('0x56')],{'$or':_['map'](_0x2d19c6[_0xb84c('0x50')],function(_0x24ac6b){var _0x671065={};_0x671065[_0x24ac6b]={'$like':'%'+_0x34fad1[_0xb84c('0x4e')]['filter']+'%'};return _0x671065;})});}_0x2d19c6=_['merge']({},_0x2d19c6,_0x34fad1[_0xb84c('0x5d')]);return _0xc3bcf8[_0xb84c('0xbe')](_0x2d19c6);}})[_0xb84c('0x24')](function(_0xfafffe){if(_0xfafffe){_0x9f6f03=_0xfafffe[_0xb84c('0x53')];if(_0x34fad1[_0xb84c('0x4e')][_0xb84c('0xbf')](_0xb84c('0x5f'))){_0x2d19c6['include']=[{'model':db[_0xb84c('0xc0')],'as':_0xb84c('0xc1'),'required':![]},{'model':db[_0xb84c('0xc2')],'as':_0xb84c('0xc3'),'attributes':['id',_0xb84c('0x45'),_0xb84c('0xc4')],'where':_0x34fad1[_0xb84c('0x4e')]['tag']?{'id':_0x34fad1['query'][_0xb84c('0xc5')]}:undefined,'required':_0x34fad1[_0xb84c('0x4e')][_0xb84c('0xc5')]?!![]:![]}];}if(!_0x34fad1[_0xb84c('0x4e')][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x2d19c6['limit']=qs[_0xb84c('0x32')](_0x34fad1['query'][_0xb84c('0x32')]);_0x2d19c6[_0xb84c('0x54')]=qs[_0xb84c('0x54')](_0x34fad1[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0xc3bcf8[_0xb84c('0xbe')](_0x2d19c6);}})[_0xb84c('0x24')](function(_0x3e4512){if(_0x3e4512){return _0x3e4512?{'count':_0x9f6f03,'rows':_0x3e4512}:null;}})[_0xb84c('0x24')](respondWithResult(_0x3fd484,null))[_0xb84c('0x2e')](handleError(_0x3fd484,null));};exports[_0xb84c('0xc7')]=function(_0x40ce93,_0x29702e,_0x2d7649){var _0x55a457;var _0x255024;var _0x1172b4={};var _0x1dfd1d;return db[_0xb84c('0x48')]['findOne']({'where':{'id':_0x40ce93['params']['id']},'attributes':['id',_0xb84c('0x45'),_0xb84c('0x41')]})[_0xb84c('0x24')](handleEntityNotFound(_0x29702e,null))['then'](function(_0x378b11){if(!utils[_0xb84c('0xa0')](_0x40ce93[_0xb84c('0x4e')]['channel'])){throw new db[(_0xb84c('0x22'))][(_0xb84c('0x9a'))](_0xb84c('0xa1'));}_0x55a457=_0x378b11;var _0x2153c3={};_0x2153c3['model']=_[_0xb84c('0xbb')](db[_[_0xb84c('0xa2')](_0x40ce93[_0xb84c('0x4e')][_0xb84c('0x9e')])+'Queue'][_0xb84c('0x49')]);_0x2153c3[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x40ce93[_0xb84c('0x4e')]);_0x2153c3['filters']=_[_0xb84c('0x51')](_0x2153c3[_0xb84c('0x4c')],_0x2153c3['query']);_0x1172b4[_0xb84c('0x50')]=_['intersection'](_0x2153c3['model'],qs[_0xb84c('0x52')](_0x40ce93[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x1172b4[_0xb84c('0x50')]=_0x1172b4[_0xb84c('0x50')][_0xb84c('0x53')]?_0x1172b4[_0xb84c('0x50')]:_0x2153c3[_0xb84c('0x4c')];_0x1172b4[_0xb84c('0xbd')]=qs[_0xb84c('0x55')](_0x40ce93[_0xb84c('0x4e')][_0xb84c('0x55')]);_0x1172b4[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x40ce93['query'],_0x2153c3[_0xb84c('0x4f')]));if(_0x40ce93[_0xb84c('0x4e')]['filter']){_0x1172b4[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x1172b4[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x1172b4['attributes'],function(_0x111c9e){var _0x71b037={};_0x71b037[_0x111c9e]={'$like':'%'+_0x40ce93[_0xb84c('0x4e')]['filter']+'%'};return _0x71b037;})});}_0x1172b4=_[_0xb84c('0x58')]({},_0x1172b4,_0x40ce93['options']);switch(_0x55a457['role']){case _0xb84c('0x6f'):return db[_['capitalize'](_0x40ce93['query']['channel'])+_0xb84c('0xc8')][_0xb84c('0x61')](_0x1172b4);case _0xb84c('0x70'):case _0xb84c('0x3a'):return _0x55a457[_0xb84c('0x8f')+_[_0xb84c('0xa2')](_0x40ce93[_0xb84c('0x4e')][_0xb84c('0x9e')])+'Queues'](_0x1172b4);default:throw new db['Sequelize'][(_0xb84c('0x9a'))](_0xb84c('0xc9'));}})[_0xb84c('0x24')](function(_0x53f7ff){_0x1dfd1d=_0x53f7ff[_0xb84c('0x53')];if(!_0x40ce93['query'][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x1172b4[_0xb84c('0x32')]=qs[_0xb84c('0x32')](_0x40ce93[_0xb84c('0x4e')][_0xb84c('0x32')]);_0x1172b4[_0xb84c('0x54')]=qs['offset'](_0x40ce93['query'][_0xb84c('0x54')]);}switch(_0x55a457[_0xb84c('0x41')]){case _0xb84c('0x6f'):return db[_['capitalize'](_0x40ce93[_0xb84c('0x4e')][_0xb84c('0x9e')])+_0xb84c('0xc8')]['findAll'](_0x1172b4);case'user':case _0xb84c('0x3a'):return _0x55a457[_0xb84c('0x8f')+_[_0xb84c('0xa2')](_0x40ce93[_0xb84c('0x4e')][_0xb84c('0x9e')])+_0xb84c('0xa3')](_0x1172b4);}})['then'](function(_0x4f2d79){return{'count':_0x1dfd1d,'rows':_0x4f2d79};})[_0xb84c('0x24')](respondWithResult(_0x29702e,null))[_0xb84c('0x2e')](handleError(_0x29702e,null));};exports[_0xb84c('0xca')]=function(_0x10e219,_0x2fb857,_0x290180){var _0xcd4d26={};var _0x5db081={};var _0xa4e845;var _0x33baba;return db[_0xb84c('0x48')][_0xb84c('0x95')]({'where':{'id':_0x10e219['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x2fb857,null))[_0xb84c('0x24')](function(_0x53fd5c){if(_0x53fd5c){_0xa4e845=_0x53fd5c;_0x5db081[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](db[_0xb84c('0xaf')]['rawAttributes']);_0x5db081[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x10e219['query']);_0x5db081['filters']=_[_0xb84c('0x51')](_0x5db081['model'],_0x5db081[_0xb84c('0x4e')]);_0xcd4d26[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0x5db081[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x10e219['query'][_0xb84c('0x52')]));_0xcd4d26['attributes']=_0xcd4d26['attributes'][_0xb84c('0x53')]?_0xcd4d26[_0xb84c('0x50')]:_0x5db081[_0xb84c('0x4c')];_0xcd4d26[_0xb84c('0xbd')]=qs[_0xb84c('0x55')](_0x10e219[_0xb84c('0x4e')]['sort']);_0xcd4d26[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x10e219[_0xb84c('0x4e')],_0x5db081[_0xb84c('0x4f')]));if(_0x10e219['query']['filter']){_0xcd4d26['where']=_[_0xb84c('0x58')](_0xcd4d26[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0xcd4d26['attributes'],function(_0x9e2109){var _0x1686c5={};_0x1686c5[_0x9e2109]={'$like':'%'+_0x10e219[_0xb84c('0x4e')][_0xb84c('0x3d')]+'%'};return _0x1686c5;})});}_0xcd4d26=_[_0xb84c('0x58')]({},_0xcd4d26,_0x10e219[_0xb84c('0x5d')]);return _0xa4e845[_0xb84c('0xca')](_0xcd4d26);}})[_0xb84c('0x24')](function(_0x3e10a6){if(_0x3e10a6){_0x33baba=_0x3e10a6[_0xb84c('0x53')];if(!_0x10e219[_0xb84c('0x4e')][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0xcd4d26[_0xb84c('0x32')]=qs[_0xb84c('0x32')](_0x10e219[_0xb84c('0x4e')]['limit']);_0xcd4d26[_0xb84c('0x54')]=qs['offset'](_0x10e219[_0xb84c('0x4e')]['offset']);}return _0xa4e845[_0xb84c('0xca')](_0xcd4d26);}})['then'](function(_0x3898c6){if(_0x3898c6){return _0x3898c6?{'count':_0x33baba,'rows':_0x3898c6}:null;}})[_0xb84c('0x24')](respondWithResult(_0x2fb857,null))['catch'](handleError(_0x2fb857,null));};exports[_0xb84c('0xcb')]=function(_0x343577,_0x16fb99,_0x20c969){var _0x4e7292={};var _0xdca215={};var _0x46a49f;var _0x3c8bc0;return db[_0xb84c('0x48')][_0xb84c('0x95')]({'where':{'id':_0x343577[_0xb84c('0x64')]['id']}})['then'](handleEntityNotFound(_0x16fb99,null))[_0xb84c('0x24')](function(_0x43bf6c){if(_0x43bf6c){_0x46a49f=_0x43bf6c;_0xdca215[_0xb84c('0x4c')]=_['keys'](db[_0xb84c('0xcc')][_0xb84c('0x49')]);_0xdca215[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x343577[_0xb84c('0x4e')]);_0xdca215[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0xdca215[_0xb84c('0x4c')],_0xdca215['query']);_0x4e7292[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0xdca215[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x343577[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x4e7292[_0xb84c('0x50')]=_0x4e7292[_0xb84c('0x50')]['length']?_0x4e7292[_0xb84c('0x50')]:_0xdca215[_0xb84c('0x4c')];_0x4e7292[_0xb84c('0xbd')]=qs[_0xb84c('0x55')](_0x343577[_0xb84c('0x4e')][_0xb84c('0x55')]);_0x4e7292['where']=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x343577[_0xb84c('0x4e')],_0xdca215[_0xb84c('0x4f')]));if(_0x343577[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0x4e7292[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x4e7292[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x4e7292[_0xb84c('0x50')],function(_0x22fa35){var _0x559240={};_0x559240[_0x22fa35]={'$like':'%'+_0x343577['query'][_0xb84c('0x3d')]+'%'};return _0x559240;})});}_0x4e7292=_[_0xb84c('0x58')]({},_0x4e7292,_0x343577[_0xb84c('0x5d')]);return _0x46a49f[_0xb84c('0xcb')](_0x4e7292);}})[_0xb84c('0x24')](function(_0x52be64){if(_0x52be64){_0x3c8bc0=_0x52be64[_0xb84c('0x53')];if(!_0x343577[_0xb84c('0x4e')][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x4e7292['limit']=qs[_0xb84c('0x32')](_0x343577[_0xb84c('0x4e')]['limit']);_0x4e7292['offset']=qs[_0xb84c('0x54')](_0x343577[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0x46a49f['getGroups'](_0x4e7292);}})[_0xb84c('0x24')](function(_0x48fa4e){if(_0x48fa4e){return _0x48fa4e?{'count':_0x3c8bc0,'rows':_0x48fa4e}:null;}})[_0xb84c('0x24')](respondWithResult(_0x16fb99,null))[_0xb84c('0x2e')](handleError(_0x16fb99,null));};exports[_0xb84c('0xcd')]=function(_0x3f3103,_0x78302a,_0x5e6753){var _0x29bdda={'raw':!![],'where':{}};var _0x253496={};var _0x1d3a3c={'count':0x0,'rows':[]};return db[_0xb84c('0x48')][_0xb84c('0x95')]({'where':{'id':_0x3f3103[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x78302a,null))[_0xb84c('0x24')](function(_0xdabe1e){if(_0xdabe1e){_0x253496[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](db[_0xb84c('0xce')][_0xb84c('0x49')]);_0x253496['query']=_[_0xb84c('0xbb')](_0x3f3103[_0xb84c('0x4e')]);_0x253496[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x253496[_0xb84c('0x4c')],_0x253496[_0xb84c('0x4e')]);_0x29bdda['attributes']=_['intersection'](_0x253496[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x3f3103[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x29bdda[_0xb84c('0x50')]=_0x29bdda['attributes']['length']?_0x29bdda[_0xb84c('0x50')]:_0x253496[_0xb84c('0x4c')];if(!_0x3f3103['query'][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x29bdda[_0xb84c('0x32')]=qs[_0xb84c('0x32')](_0x3f3103[_0xb84c('0x4e')][_0xb84c('0x32')]);_0x29bdda['offset']=qs[_0xb84c('0x54')](_0x3f3103[_0xb84c('0x4e')][_0xb84c('0x54')]);}_0x29bdda[_0xb84c('0xbd')]=qs[_0xb84c('0x55')](_0x3f3103[_0xb84c('0x4e')][_0xb84c('0x55')]);_0x29bdda[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x3f3103[_0xb84c('0x4e')],_0x253496[_0xb84c('0x4f')]));_0x29bdda[_0xb84c('0x56')]['UserId']=_0xdabe1e['id'];if(_0x3f3103['query'][_0xb84c('0x3d')]){_0x29bdda[_0xb84c('0x56')]=_['merge'](_0x29bdda[_0xb84c('0x56')],{'$or':_['map'](_0x29bdda['attributes'],function(_0x2b8860){var _0x17c94b={};_0x17c94b[_0x2b8860]={'$like':'%'+_0x3f3103[_0xb84c('0x4e')][_0xb84c('0x3d')]+'%'};return _0x17c94b;})});}_0x29bdda=_[_0xb84c('0x58')]({},_0x29bdda,_0x3f3103[_0xb84c('0x5d')]);return db[_0xb84c('0xce')]['count']({'where':_0x29bdda[_0xb84c('0x56')]})[_0xb84c('0x24')](function(_0x5759eb){_0x1d3a3c[_0xb84c('0x5e')]=_0x5759eb;if(_0x3f3103[_0xb84c('0x4e')][_0xb84c('0x5f')]){_0x29bdda[_0xb84c('0x60')]=[{'all':!![]}];}return db['VoiceRecording'][_0xb84c('0x61')](_0x29bdda);})[_0xb84c('0x24')](function(_0x9917ef){_0x1d3a3c[_0xb84c('0x62')]=_0x9917ef;return _0x1d3a3c;});}})[_0xb84c('0x24')](respondWithFilteredResult(_0x78302a,_0x29bdda))['catch'](handleError(_0x78302a,null));};exports[_0xb84c('0xcf')]=function(_0x190f5c,_0x18979e,_0x1bb980){var _0x130232={'raw':!![],'where':{}};var _0x2b14ad={};var _0x3f8664={'count':0x0,'rows':[]};return db[_0xb84c('0x48')][_0xb84c('0x95')]({'where':{'id':_0x190f5c['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x18979e,null))[_0xb84c('0x24')](function(_0x138e00){if(_0x138e00){_0x2b14ad[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](db[_0xb84c('0xd0')][_0xb84c('0x49')]);_0x2b14ad['query']=_['keys'](_0x190f5c[_0xb84c('0x4e')]);_0x2b14ad[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x2b14ad[_0xb84c('0x4c')],_0x2b14ad[_0xb84c('0x4e')]);_0x130232[_0xb84c('0x50')]=_['intersection'](_0x2b14ad[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x190f5c['query'][_0xb84c('0x52')]));_0x130232[_0xb84c('0x50')]=_0x130232[_0xb84c('0x50')][_0xb84c('0x53')]?_0x130232[_0xb84c('0x50')]:_0x2b14ad[_0xb84c('0x4c')];if(!_0x190f5c[_0xb84c('0x4e')][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x130232[_0xb84c('0x32')]=qs[_0xb84c('0x32')](_0x190f5c[_0xb84c('0x4e')]['limit']);_0x130232['offset']=qs['offset'](_0x190f5c[_0xb84c('0x4e')]['offset']);}_0x130232[_0xb84c('0xbd')]=qs['sort'](_0x190f5c['query']['sort']);_0x130232['where']=qs['filters'](_['pick'](_0x190f5c[_0xb84c('0x4e')],_0x2b14ad[_0xb84c('0x4f')]));_0x130232[_0xb84c('0x56')][_0xb84c('0xd1')]=_0x138e00['id'];if(_0x190f5c[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0x130232[_0xb84c('0x56')]=_['merge'](_0x130232[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x130232['attributes'],function(_0x58a927){var _0x2f67a4={};_0x2f67a4[_0x58a927]={'$like':'%'+_0x190f5c[_0xb84c('0x4e')]['filter']+'%'};return _0x2f67a4;})});}_0x130232=_[_0xb84c('0x58')]({},_0x130232,_0x190f5c[_0xb84c('0x5d')]);return db[_0xb84c('0xd0')][_0xb84c('0x5e')]({'where':_0x130232[_0xb84c('0x56')]})['then'](function(_0x403388){_0x3f8664[_0xb84c('0x5e')]=_0x403388;if(_0x190f5c[_0xb84c('0x4e')]['includeAll']){_0x130232[_0xb84c('0x60')]=[{'all':!![]}];}return db[_0xb84c('0xd0')][_0xb84c('0x61')](_0x130232);})[_0xb84c('0x24')](function(_0x3a9fcc){_0x3f8664['rows']=_0x3a9fcc;return _0x3f8664;});}})[_0xb84c('0x24')](respondWithFilteredResult(_0x18979e,_0x130232))[_0xb84c('0x2e')](handleError(_0x18979e,null));};exports[_0xb84c('0xd2')]=function(_0x4fca25,_0x1bf535,_0x3b5d8e){var _0x3f0fa4={};var _0x424f07={};var _0x31875f;var _0x566c54;return db['User'][_0xb84c('0x95')]({'where':{'id':_0x4fca25[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x1bf535,null))[_0xb84c('0x24')](function(_0x409bd8){if(_0x409bd8){_0x31875f=_0x409bd8;_0x424f07[_0xb84c('0x4c')]=_['keys'](db[_0xb84c('0xd3')][_0xb84c('0x49')]);_0x424f07[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x4fca25[_0xb84c('0x4e')]);_0x424f07[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x424f07[_0xb84c('0x4c')],_0x424f07[_0xb84c('0x4e')]);_0x3f0fa4['attributes']=_['intersection'](_0x424f07[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x4fca25[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x3f0fa4[_0xb84c('0x50')]=_0x3f0fa4['attributes'][_0xb84c('0x53')]?_0x3f0fa4[_0xb84c('0x50')]:_0x424f07[_0xb84c('0x4c')];_0x3f0fa4['order']=qs[_0xb84c('0x55')](_0x4fca25['query'][_0xb84c('0x55')]);_0x3f0fa4['where']=qs[_0xb84c('0x4f')](_['pick'](_0x4fca25[_0xb84c('0x4e')],_0x424f07[_0xb84c('0x4f')]));if(_0x4fca25[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0x3f0fa4[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x3f0fa4['where'],{'$or':_['map'](_0x3f0fa4[_0xb84c('0x50')],function(_0x5b5982){var _0x347c71={};_0x347c71[_0x5b5982]={'$like':'%'+_0x4fca25[_0xb84c('0x4e')]['filter']+'%'};return _0x347c71;})});}_0x3f0fa4=_[_0xb84c('0x58')]({},_0x3f0fa4,_0x4fca25[_0xb84c('0x5d')]);return _0x31875f['getChatInteractions'](_0x3f0fa4);}})[_0xb84c('0x24')](function(_0x55ede3){if(_0x55ede3){_0x566c54=_0x55ede3[_0xb84c('0x53')];if(!_0x4fca25[_0xb84c('0x4e')]['hasOwnProperty'](_0xb84c('0xc6'))){_0x3f0fa4[_0xb84c('0x32')]=qs[_0xb84c('0x32')](_0x4fca25['query'][_0xb84c('0x32')]);_0x3f0fa4['offset']=qs[_0xb84c('0x54')](_0x4fca25[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0x31875f[_0xb84c('0xd2')](_0x3f0fa4);}})[_0xb84c('0x24')](function(_0x2e255f){if(_0x2e255f){return _0x2e255f?{'count':_0x566c54,'rows':_0x2e255f}:null;}})['then'](respondWithResult(_0x1bf535,null))['catch'](handleError(_0x1bf535,null));};exports[_0xb84c('0xd4')]=function(_0x2d1834,_0x31ab8d,_0x138bf4){var _0x26d6e4={};var _0xa80644={};var _0x5785d8;var _0x36bddb;return db[_0xb84c('0x48')]['findOne']({'where':{'id':_0x2d1834['params']['id']}})['then'](handleEntityNotFound(_0x31ab8d,null))['then'](function(_0x3b3b7f){if(_0x3b3b7f){_0x5785d8=_0x3b3b7f;_0xa80644['model']=_['keys'](db[_0xb84c('0xd5')][_0xb84c('0x49')]);_0xa80644[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x2d1834[_0xb84c('0x4e')]);_0xa80644[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0xa80644[_0xb84c('0x4c')],_0xa80644['query']);_0x26d6e4['attributes']=_['intersection'](_0xa80644[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x2d1834[_0xb84c('0x4e')]['fields']));_0x26d6e4[_0xb84c('0x50')]=_0x26d6e4[_0xb84c('0x50')][_0xb84c('0x53')]?_0x26d6e4[_0xb84c('0x50')]:_0xa80644[_0xb84c('0x4c')];_0x26d6e4[_0xb84c('0xbd')]=qs[_0xb84c('0x55')](_0x2d1834[_0xb84c('0x4e')]['sort']);_0x26d6e4[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_['pick'](_0x2d1834['query'],_0xa80644[_0xb84c('0x4f')]));if(_0x2d1834[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0x26d6e4[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x26d6e4['where'],{'$or':_[_0xb84c('0x3e')](_0x26d6e4['attributes'],function(_0x17e5ed){var _0xfb35b2={};_0xfb35b2[_0x17e5ed]={'$like':'%'+_0x2d1834[_0xb84c('0x4e')][_0xb84c('0x3d')]+'%'};return _0xfb35b2;})});}_0x26d6e4=_[_0xb84c('0x58')]({},_0x26d6e4,_0x2d1834['options']);return _0x5785d8[_0xb84c('0xd4')](_0x26d6e4);}})[_0xb84c('0x24')](function(_0xd00caa){if(_0xd00caa){_0x36bddb=_0xd00caa[_0xb84c('0x53')];if(!_0x2d1834[_0xb84c('0x4e')][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x26d6e4[_0xb84c('0x32')]=qs['limit'](_0x2d1834[_0xb84c('0x4e')][_0xb84c('0x32')]);_0x26d6e4[_0xb84c('0x54')]=qs[_0xb84c('0x54')](_0x2d1834[_0xb84c('0x4e')]['offset']);}return _0x5785d8[_0xb84c('0xd4')](_0x26d6e4);}})['then'](function(_0x37e9ae){if(_0x37e9ae){return _0x37e9ae?{'count':_0x36bddb,'rows':_0x37e9ae}:null;}})[_0xb84c('0x24')](respondWithResult(_0x31ab8d,null))[_0xb84c('0x2e')](handleError(_0x31ab8d,null));};exports['getMailInteractions']=function(_0x3295cd,_0xe46e94,_0x694750){var _0x48e0e4={'raw':!![],'where':{}};var _0x59149a={};var _0xa7a3cf={'count':0x0,'rows':[]};return db[_0xb84c('0x48')]['findOne']({'where':{'id':_0x3295cd[_0xb84c('0x64')]['id']}})['then'](handleEntityNotFound(_0xe46e94,null))[_0xb84c('0x24')](function(_0x4dc9c1){if(_0x4dc9c1){_0x59149a['model']=_['keys'](db[_0xb84c('0xd6')][_0xb84c('0x49')]);_0x59149a['query']=_[_0xb84c('0xbb')](_0x3295cd[_0xb84c('0x4e')]);_0x59149a[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x59149a[_0xb84c('0x4c')],_0x59149a[_0xb84c('0x4e')]);_0x48e0e4[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0x59149a[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x3295cd[_0xb84c('0x4e')]['fields']));_0x48e0e4[_0xb84c('0x50')]=_0x48e0e4[_0xb84c('0x50')][_0xb84c('0x53')]?_0x48e0e4['attributes']:_0x59149a['model'];if(!_0x3295cd[_0xb84c('0x4e')]['hasOwnProperty'](_0xb84c('0xc6'))){_0x48e0e4[_0xb84c('0x32')]=qs[_0xb84c('0x32')](_0x3295cd['query'][_0xb84c('0x32')]);_0x48e0e4[_0xb84c('0x54')]=qs[_0xb84c('0x54')](_0x3295cd[_0xb84c('0x4e')][_0xb84c('0x54')]);}_0x48e0e4[_0xb84c('0xbd')]=qs[_0xb84c('0x55')](_0x3295cd['query'][_0xb84c('0x55')]);_0x48e0e4[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x3295cd[_0xb84c('0x4e')],_0x59149a[_0xb84c('0x4f')]));_0x48e0e4[_0xb84c('0x56')][_0xb84c('0xd1')]=_0x4dc9c1['id'];if(_0x3295cd[_0xb84c('0x4e')]['filter']){_0x48e0e4['where']=_['merge'](_0x48e0e4[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x48e0e4[_0xb84c('0x50')],function(_0x348bda){var _0x4abf25={};_0x4abf25[_0x348bda]={'$like':'%'+_0x3295cd[_0xb84c('0x4e')][_0xb84c('0x3d')]+'%'};return _0x4abf25;})});}_0x48e0e4=_[_0xb84c('0x58')]({},_0x48e0e4,_0x3295cd[_0xb84c('0x5d')]);return db[_0xb84c('0xd6')][_0xb84c('0x5e')]({'where':_0x48e0e4[_0xb84c('0x56')]})[_0xb84c('0x24')](function(_0x53c991){_0xa7a3cf[_0xb84c('0x5e')]=_0x53c991;if(_0x3295cd[_0xb84c('0x4e')][_0xb84c('0x5f')]){_0x48e0e4[_0xb84c('0x60')]=[{'all':!![]}];}return db[_0xb84c('0xd6')][_0xb84c('0x61')](_0x48e0e4);})[_0xb84c('0x24')](function(_0x801d9d){_0xa7a3cf[_0xb84c('0x62')]=_0x801d9d;return _0xa7a3cf;});}})[_0xb84c('0x24')](respondWithFilteredResult(_0xe46e94,_0x48e0e4))['catch'](handleError(_0xe46e94,null));};exports[_0xb84c('0xd7')]=function(_0x265c54,_0x2aef80,_0x1bc7b0){var _0x52128a={};var _0x469bfb={};var _0x55eea4;var _0x1c3b44;return db[_0xb84c('0x48')][_0xb84c('0x95')]({'where':{'id':_0x265c54[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x2aef80,null))[_0xb84c('0x24')](function(_0x21cfc3){if(_0x21cfc3){_0x55eea4=_0x21cfc3;_0x469bfb[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](db['SmsInteraction'][_0xb84c('0x49')]);_0x469bfb[_0xb84c('0x4e')]=_['keys'](_0x265c54[_0xb84c('0x4e')]);_0x469bfb[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x469bfb['model'],_0x469bfb['query']);_0x52128a[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0x469bfb[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x265c54['query'][_0xb84c('0x52')]));_0x52128a[_0xb84c('0x50')]=_0x52128a[_0xb84c('0x50')][_0xb84c('0x53')]?_0x52128a[_0xb84c('0x50')]:_0x469bfb[_0xb84c('0x4c')];_0x52128a['order']=qs[_0xb84c('0x55')](_0x265c54[_0xb84c('0x4e')][_0xb84c('0x55')]);_0x52128a['where']=qs['filters'](_[_0xb84c('0x57')](_0x265c54[_0xb84c('0x4e')],_0x469bfb[_0xb84c('0x4f')]));if(_0x265c54[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0x52128a[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x52128a[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x52128a[_0xb84c('0x50')],function(_0x1da94f){var _0x56ad0c={};_0x56ad0c[_0x1da94f]={'$like':'%'+_0x265c54['query'][_0xb84c('0x3d')]+'%'};return _0x56ad0c;})});}_0x52128a=_['merge']({},_0x52128a,_0x265c54[_0xb84c('0x5d')]);return _0x55eea4[_0xb84c('0xd7')](_0x52128a);}})[_0xb84c('0x24')](function(_0x1f3c8f){if(_0x1f3c8f){_0x1c3b44=_0x1f3c8f[_0xb84c('0x53')];if(!_0x265c54[_0xb84c('0x4e')][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x52128a[_0xb84c('0x32')]=qs[_0xb84c('0x32')](_0x265c54[_0xb84c('0x4e')][_0xb84c('0x32')]);_0x52128a[_0xb84c('0x54')]=qs[_0xb84c('0x54')](_0x265c54[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0x55eea4[_0xb84c('0xd7')](_0x52128a);}})[_0xb84c('0x24')](function(_0x159551){if(_0x159551){return _0x159551?{'count':_0x1c3b44,'rows':_0x159551}:null;}})[_0xb84c('0x24')](respondWithResult(_0x2aef80,null))['catch'](handleError(_0x2aef80,null));};exports[_0xb84c('0xd8')]=function(_0x1b3fb9,_0x18280f,_0x3d3268){var _0x216f13={};var _0x2f1a64={};var _0x264493;var _0x3a7d24;return db['User'][_0xb84c('0x95')]({'where':{'id':_0x1b3fb9[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x18280f,null))[_0xb84c('0x24')](function(_0x26c8ef){if(_0x26c8ef){_0x264493=_0x26c8ef;_0x2f1a64[_0xb84c('0x4c')]=_['keys'](db[_0xb84c('0xd9')]['rawAttributes']);_0x2f1a64[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x1b3fb9[_0xb84c('0x4e')]);_0x2f1a64[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x2f1a64[_0xb84c('0x4c')],_0x2f1a64[_0xb84c('0x4e')]);_0x216f13[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0x2f1a64['model'],qs['fields'](_0x1b3fb9[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x216f13['attributes']=_0x216f13[_0xb84c('0x50')][_0xb84c('0x53')]?_0x216f13['attributes']:_0x2f1a64[_0xb84c('0x4c')];_0x216f13['order']=qs[_0xb84c('0x55')](_0x1b3fb9[_0xb84c('0x4e')]['sort']);_0x216f13['where']=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x1b3fb9[_0xb84c('0x4e')],_0x2f1a64[_0xb84c('0x4f')]));if(_0x1b3fb9[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0x216f13[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x216f13[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x216f13[_0xb84c('0x50')],function(_0x221f3a){var _0x3502ee={};_0x3502ee[_0x221f3a]={'$like':'%'+_0x1b3fb9['query']['filter']+'%'};return _0x3502ee;})});}_0x216f13=_[_0xb84c('0x58')]({},_0x216f13,_0x1b3fb9[_0xb84c('0x5d')]);return _0x264493[_0xb84c('0xd8')](_0x216f13);}})[_0xb84c('0x24')](function(_0x1b63f5){if(_0x1b63f5){_0x3a7d24=_0x1b63f5[_0xb84c('0x53')];if(!_0x1b3fb9['query']['hasOwnProperty'](_0xb84c('0xc6'))){_0x216f13[_0xb84c('0x32')]=qs['limit'](_0x1b3fb9[_0xb84c('0x4e')][_0xb84c('0x32')]);_0x216f13['offset']=qs[_0xb84c('0x54')](_0x1b3fb9[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0x264493[_0xb84c('0xd8')](_0x216f13);}})['then'](function(_0x42d3be){if(_0x42d3be){return _0x42d3be?{'count':_0x3a7d24,'rows':_0x42d3be}:null;}})['then'](respondWithResult(_0x18280f,null))['catch'](handleError(_0x18280f,null));};exports['getWhatsappInteractions']=function(_0x1e34b1,_0x370356,_0x292dce){var _0x3ec800={};var _0x4c7b7c={};var _0x28acea;var _0x39709a;return db[_0xb84c('0x48')]['findOne']({'where':{'id':_0x1e34b1['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x370356,null))[_0xb84c('0x24')](function(_0x384d03){if(_0x384d03){_0x28acea=_0x384d03;_0x4c7b7c['model']=_[_0xb84c('0xbb')](db['WhatsappInteraction'][_0xb84c('0x49')]);_0x4c7b7c[_0xb84c('0x4e')]=_['keys'](_0x1e34b1[_0xb84c('0x4e')]);_0x4c7b7c[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x4c7b7c[_0xb84c('0x4c')],_0x4c7b7c['query']);_0x3ec800[_0xb84c('0x50')]=_['intersection'](_0x4c7b7c[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x1e34b1[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x3ec800[_0xb84c('0x50')]=_0x3ec800[_0xb84c('0x50')][_0xb84c('0x53')]?_0x3ec800[_0xb84c('0x50')]:_0x4c7b7c[_0xb84c('0x4c')];_0x3ec800[_0xb84c('0xbd')]=qs['sort'](_0x1e34b1['query'][_0xb84c('0x55')]);_0x3ec800[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x1e34b1[_0xb84c('0x4e')],_0x4c7b7c[_0xb84c('0x4f')]));if(_0x1e34b1[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0x3ec800[_0xb84c('0x56')]=_['merge'](_0x3ec800[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x3ec800[_0xb84c('0x50')],function(_0x472619){var _0x1adae1={};_0x1adae1[_0x472619]={'$like':'%'+_0x1e34b1[_0xb84c('0x4e')]['filter']+'%'};return _0x1adae1;})});}_0x3ec800=_[_0xb84c('0x58')]({},_0x3ec800,_0x1e34b1[_0xb84c('0x5d')]);return _0x28acea[_0xb84c('0xda')](_0x3ec800);}})[_0xb84c('0x24')](function(_0x6e3100){if(_0x6e3100){_0x39709a=_0x6e3100[_0xb84c('0x53')];if(!_0x1e34b1[_0xb84c('0x4e')][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x3ec800[_0xb84c('0x32')]=qs[_0xb84c('0x32')](_0x1e34b1[_0xb84c('0x4e')][_0xb84c('0x32')]);_0x3ec800['offset']=qs[_0xb84c('0x54')](_0x1e34b1[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0x28acea[_0xb84c('0xda')](_0x3ec800);}})[_0xb84c('0x24')](function(_0x56675a){if(_0x56675a){return _0x56675a?{'count':_0x39709a,'rows':_0x56675a}:null;}})[_0xb84c('0x24')](respondWithResult(_0x370356,null))[_0xb84c('0x2e')](handleError(_0x370356,null));};exports[_0xb84c('0xdb')]=function(_0x326f80,_0x211166,_0x34b1de){var _0xd8a0bc;var _0x5a0cbc;var _0x2b93dc;var _0x1173b1=!_[_0xb84c('0x74')](_0x326f80[_0xb84c('0x64')]['id'])?_0x326f80[_0xb84c('0x64')]['id']:!_[_0xb84c('0x74')](_0x326f80[_0xb84c('0x70')]['id'])?_0x326f80[_0xb84c('0x70')]['id']:null;return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x1173b1,'role':{'$or':[_0xb84c('0x6f'),_0xb84c('0x70'),_0xb84c('0x3a')]}},'attributes':['id',_0xb84c('0x45'),_0xb84c('0xdc'),_0xb84c('0xdd'),'role','internal',_0xb84c('0xde')]})[_0xb84c('0x24')](function(_0x58721a){if(_0x58721a){if(_0x58721a[_0xb84c('0x41')]===_0xb84c('0x3a')){_0xd8a0bc=_0x58721a;if(_0x326f80[_0xb84c('0x68')][_0xb84c('0x9f')]){_0x2b93dc=util[_0xb84c('0x76')](_0xb84c('0xdf'),_0xd8a0bc[_0x326f80['body'][_0xb84c('0x9f')]]);}else if(_0x326f80[_0xb84c('0x68')][_0xb84c('0xe0')]){_0x2b93dc=util['format'](_0xb84c('0xac'),_0x326f80[_0xb84c('0x68')][_0xb84c('0xe0')]);}else{_0x2b93dc=util[_0xb84c('0x76')](_0xb84c('0xac'),_0xd8a0bc[_0xb84c('0x45')]);}socket['to'](util[_0xb84c('0x76')]('user:%s',_0xd8a0bc[_0xb84c('0x45')]))[_0xb84c('0xa6')]('user:forcelogout',{'ip':_0x326f80[_0xb84c('0xe1')][_0xb84c('0xe2')]||_0x326f80['connection'][_0xb84c('0xe3')]||_0x326f80[_0xb84c('0xe4')]['remoteAddress']||_0x326f80[_0xb84c('0xe5')][_0xb84c('0xe4')][_0xb84c('0xe3')]});return db[_0xb84c('0xaf')][_0xb84c('0x38')]({'where':{'membername':_0xd8a0bc[_0xb84c('0x45')]},'individualHooks':!![]});}}else{throw new db[(_0xb84c('0x22'))][(_0xb84c('0x9a'))](_0xb84c('0xe6'));}})[_0xb84c('0x24')](function(){if(_0xd8a0bc){return _0xd8a0bc[_0xb84c('0xe7')]({'raw':!![]});}})[_0xb84c('0x24')](function(_0x4e1355){if(_0xd8a0bc){var _0x292694=[];if(_0x4e1355){_0x5a0cbc=_0x4e1355;if(_0x5a0cbc[_0xb84c('0x53')]){for(var _0x5ee070=0x0;_0x5ee070<_0x5a0cbc[_0xb84c('0x53')];_0x5ee070++){_0x292694[_0xb84c('0xab')]({'membername':_0xd8a0bc[_0xb84c('0x45')],'UserId':_0xd8a0bc['id'],'queue_name':_0x5a0cbc[_0x5ee070][_0xb84c('0x45')],'VoiceQueueId':_0x5a0cbc[_0x5ee070]['id'],'interface':_0x2b93dc,'paused':_0xd8a0bc[_0xb84c('0xde')]||![],'penalty':_0x5a0cbc[_0x5ee070][_0xb84c('0xe8')]||0x0});}return BPromise[_0xb84c('0xae')](_0x292694,function(_0x428ce9){return db[_0xb84c('0xaf')][_0xb84c('0xe9')](_0x428ce9);});}}}})[_0xb84c('0x24')](function(){if(_0xd8a0bc){return db[_0xb84c('0xea')][_0xb84c('0x61')]({'where':{'membername':_0xd8a0bc[_0xb84c('0x45')],'exitAt':null}});}})[_0xb84c('0x24')](function(_0x478640){if(_0xd8a0bc){var _0x56a268=[];_0x478640[_0xb84c('0xeb')](function(_0x34d303){_0x56a268[_0xb84c('0xab')](_0x34d303['update']({'exitAt':moment()[_0xb84c('0x76')](_0xb84c('0xec'))}));});return BPromise[_0xb84c('0xed')](_0x56a268);}})[_0xb84c('0x24')](function(){if(_0xd8a0bc){var _0x1fad4d=[];var _0x574cf2=[];var _0x5258a7=utils[_0xb84c('0xee')]();var _0x218aab={'membername':_0xd8a0bc[_0xb84c('0x45')],'interface':_0x2b93dc,'enterAt':moment()['format'](_0xb84c('0xec')),'role':_0xd8a0bc[_0xb84c('0x41')],'internal':_0xd8a0bc['internal']};_0x5258a7[_0xb84c('0xeb')](function(_0x5beccd){_0x1fad4d[_0xb84c('0xab')](_[_0xb84c('0x58')]({'channel':_0x5beccd,'type':'LOGIN','data1':_0x326f80[_0xb84c('0x68')]['device'],'data2':_0x2b93dc},_0x218aab));if(_0xd8a0bc[_0xb84c('0xde')]){_0x574cf2[_0xb84c('0xab')](_[_0xb84c('0x58')]({'channel':_0x5beccd,'type':_0xb84c('0xef'),'data1':_0xb84c('0xf0')},_0x218aab));}});return db[_0xb84c('0xea')]['bulkCreate'](_0x1fad4d['concat'](_0x574cf2),{'individualHooks':!![]});}})[_0xb84c('0x24')](function(){if(_0xd8a0bc){return _0xd8a0bc[_0xb84c('0x37')]({'online':!![],'lastLoginAt':moment()[_0xb84c('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0xd8a0bc[_0xb84c('0xde')]||![],'mailPause':_0xd8a0bc['loginInPause']||![],'chatPause':_0xd8a0bc['loginInPause']||![],'faxPause':_0xd8a0bc['loginInPause']||![],'smsPause':_0xd8a0bc[_0xb84c('0xde')]||![],'openchannelPause':_0xd8a0bc[_0xb84c('0xde')]||![],'whatsappPause':_0xd8a0bc['loginInPause']||![],'pauseType':_0xd8a0bc[_0xb84c('0xde')]?_0xb84c('0xf0'):null,'interface':_0x2b93dc,'lastPauseAt':moment()[_0xb84c('0x76')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xb84c('0x24')](function(_0x1eb647){if(_0x326f80[_0xb84c('0xf1')]){return _0x34b1de();}else{return BPromise['resolve'](_0x1eb647)[_0xb84c('0x24')](respondWithResult(_0x211166,null));}})[_0xb84c('0x2e')](handleError(_0x211166,null));};exports[_0xb84c('0xf2')]=function(_0xa6ba3f,_0x1b8de7,_0x992b38){var _0x3561c0;return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0xa6ba3f[_0xb84c('0x64')]['id'],'role':_0xb84c('0x3a')},'attributes':['id',_0xb84c('0x45'),'role']})[_0xb84c('0x24')](handleEntityNotFound(_0x1b8de7,null))[_0xb84c('0x24')](function(_0x3ac477){if(_0x3ac477){_0x3561c0=_0x3ac477;return db[_0xb84c('0xaf')][_0xb84c('0x38')]({'where':{'membername':_0x3561c0['name']},'individualHooks':!![]});}})[_0xb84c('0x24')](function(){return db[_0xb84c('0xea')][_0xb84c('0x61')]({'where':{'membername':_0x3561c0[_0xb84c('0x45')],'exitAt':null}});})[_0xb84c('0x24')](function(_0x7539a5){var _0x246c68=[];_0x7539a5[_0xb84c('0xeb')](function(_0x54a320){_0x246c68[_0xb84c('0xab')](_0x54a320[_0xb84c('0x37')]({'exitAt':moment()[_0xb84c('0x76')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xb84c('0xed')](_0x246c68);})[_0xb84c('0x24')](function(){return _0x3561c0[_0xb84c('0x37')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xb84c('0x24')](respondWithResult(_0x1b8de7,null))[_0xb84c('0x2e')](handleError(_0x1b8de7,null));};exports['pause']=function(_0x1d2ec4,_0x151ca1,_0x2e2dfa){var _0x2cb8af;return db['UserVoiceQueueRt'][_0xb84c('0x37')]({'paused':0x1},{'where':{'UserId':_0x1d2ec4[_0xb84c('0x64')]['id']},'individualHooks':!![]})[_0xb84c('0x24')](function(){return db[_0xb84c('0x48')]['find']({'where':{'id':_0x1d2ec4[_0xb84c('0x64')]['id'],'role':_0xb84c('0x3a')},'attributes':['id','name',_0xb84c('0x41'),_0xb84c('0x79'),'interface']});})['then'](handleEntityNotFound(_0x151ca1,null))['then'](function(_0x6910b3){if(_0x6910b3){_0x2cb8af=_0x6910b3;return respondWithRpcPromise('QueuePause',_0xb84c('0xf3'),{'id':_0x2cb8af['id'],'name':_0x2cb8af[_0xb84c('0x45')],'pause':!![]});}})[_0xb84c('0x24')](function(){if(_0x2cb8af){return db['MemberReport'][_0xb84c('0x61')]({'where':{'membername':_0x2cb8af[_0xb84c('0x45')],'type':_0xb84c('0xef'),'exitAt':null}});}})['then'](function(_0x1d6ccc){if(_0x1d6ccc[_0xb84c('0x53')]){var _0xfc4987=moment()[_0xb84c('0x76')](_0xb84c('0xec'));for(var _0xee9522=0x0,_0x1e765b=_0x1d6ccc[_0xb84c('0x53')];_0xee9522<_0x1e765b;_0xee9522++){_0x1d6ccc[_0xee9522][_0xb84c('0xf4')]({'exitAt':_0xfc4987});}}})[_0xb84c('0x24')](function(){var _0x5d0b4b=[];var _0x56c55d=utils[_0xb84c('0xee')]();_0x56c55d['forEach'](function(_0x3be59a){_0x5d0b4b[_0xb84c('0xab')]({'channel':_0x3be59a,'membername':_0x2cb8af[_0xb84c('0x45')],'interface':_[_0xb84c('0x74')](_0x2cb8af['interface'])?util[_0xb84c('0x76')](_0xb84c('0xac'),_0x2cb8af[_0xb84c('0x45')]):_0x2cb8af[_0xb84c('0x9f')],'type':_0xb84c('0xef'),'enterAt':moment()[_0xb84c('0x76')](_0xb84c('0xec')),'data1':_0x1d2ec4['body'][_0xb84c('0x4b')]||'DEFAULT\x20PAUSE','role':_0x2cb8af['role'],'internal':_0x2cb8af[_0xb84c('0x79')]});});return db[_0xb84c('0xea')]['bulkCreate'](_0x5d0b4b,{'individualHooks':!![]});})[_0xb84c('0x24')](function(){return _0x2cb8af[_0xb84c('0x37')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1d2ec4['body']['type']||_0xb84c('0xf5'),'lastPauseAt':moment()[_0xb84c('0x76')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x151ca1,null))[_0xb84c('0x2e')](handleError(_0x151ca1,null));};exports[_0xb84c('0xf6')]=function(_0x4e6654,_0x38e884,_0x5dca17){var _0x5291f3;return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x4e6654[_0xb84c('0x64')]['id']},'attributes':['id',_0xb84c('0x45'),_0xb84c('0x41'),_0xb84c('0xad'),_0xb84c('0xf7'),'chatPause',_0xb84c('0xf8'),_0xb84c('0xf9'),_0xb84c('0xfa'),_0xb84c('0xfb'),'pauseType','lastPauseAt']})[_0xb84c('0x24')](handleEntityNotFound(_0x38e884,null))[_0xb84c('0x24')](function(_0x47e18c){if(_0x47e18c){_0x5291f3=_0x47e18c;if(_0x4e6654['body'][_0xb84c('0x9e')]&&!utils['isValidChannel'](_0x4e6654[_0xb84c('0x68')][_0xb84c('0x9e')])){throw new db[(_0xb84c('0x22'))][(_0xb84c('0x9a'))]('Unknown\x20channel');}switch(_0x4e6654['body'][_0xb84c('0x9e')]){case'voice':return respondWithRpcPromise(_0xb84c('0xfc'),'unpause',{'id':_0x5291f3['id'],'name':_0x5291f3['name'],'pause':![]})[_0xb84c('0x24')](function(){return db[_0xb84c('0xaf')][_0xb84c('0x37')]({'paused':0x0},{'where':{'UserId':_0x5291f3['id']},'individualHooks':!![]});})[_0xb84c('0x24')](function(){return db[_0xb84c('0xea')][_0xb84c('0x69')]({'where':{'channel':_0x4e6654[_0xb84c('0x68')][_0xb84c('0x9e')],'membername':_0x5291f3[_0xb84c('0x45')],'type':'PAUSE','exitAt':null}});})[_0xb84c('0x24')](function(_0x127572){if(_0x127572){return _0x127572[_0xb84c('0x37')]({'exitAt':moment()['format'](_0xb84c('0xec')),'data2':_0xb84c('0xfd')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x5291f3['update']({'voicePause':![]});});case'mail':case _0xb84c('0xfe'):case _0xb84c('0xff'):case _0xb84c('0x100'):case _0xb84c('0x101'):case _0xb84c('0x102'):return db[_0xb84c('0xea')][_0xb84c('0x69')]({'where':{'channel':_0x4e6654['body'][_0xb84c('0x9e')],'membername':_0x5291f3[_0xb84c('0x45')],'type':_0xb84c('0xef'),'exitAt':null}})[_0xb84c('0x24')](function(_0xad7703){if(_0xad7703){return _0xad7703[_0xb84c('0x37')]({'exitAt':moment()[_0xb84c('0x76')](_0xb84c('0xec')),'data2':_0xb84c('0xfd')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x46d25e={};_[_0xb84c('0x33')](_0x46d25e,util[_0xb84c('0x76')](_0xb84c('0x103'),_0x4e6654[_0xb84c('0x68')][_0xb84c('0x9e')],'Pause'),![]);return _0x5291f3[_0xb84c('0x37')](_0x46d25e);});default:return respondWithRpcPromise(_0xb84c('0xfc'),'unpause',{'id':_0x5291f3['id'],'name':_0x5291f3['name'],'pause':![]})[_0xb84c('0x24')](function(){return db[_0xb84c('0xaf')][_0xb84c('0x37')]({'paused':0x0},{'where':{'UserId':_0x5291f3['id']}});})['then'](function(){return db['MemberReport'][_0xb84c('0x61')]({'where':{'membername':_0x5291f3[_0xb84c('0x45')],'type':'PAUSE','exitAt':null}});})[_0xb84c('0x24')](function(_0x47db78){var _0x2186a1=[];_0x47db78[_0xb84c('0xeb')](function(_0x27d329){_0x2186a1[_0xb84c('0xab')](_0x27d329[_0xb84c('0x37')]({'exitAt':moment()[_0xb84c('0x76')](_0xb84c('0xec')),'data2':'manual'}));});return BPromise['all'](_0x2186a1);})[_0xb84c('0x24')](function(){return _0x5291f3['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x38e884,null))[_0xb84c('0x2e')](handleError(_0x38e884,null));};exports[_0xb84c('0x104')]=function(_0x45b747,_0x58b319,_0x1103a7){var _0x3873e7={};var _0x35efd4={};var _0x20c746;var _0x2ea845;return db['User'][_0xb84c('0x95')]({'where':{'id':_0x45b747[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x58b319,null))[_0xb84c('0x24')](function(_0x2e2077){if(_0x2e2077){_0x20c746=_0x2e2077;_0x35efd4['model']=_['keys'](db[_0xb84c('0x105')][_0xb84c('0x49')]);_0x35efd4[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x45b747[_0xb84c('0x4e')]);_0x35efd4['filters']=_[_0xb84c('0x51')](_0x35efd4['model'],_0x35efd4['query']);_0x3873e7['attributes']=_[_0xb84c('0x51')](_0x35efd4[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x45b747['query'][_0xb84c('0x52')]));_0x3873e7[_0xb84c('0x50')]=_0x3873e7['attributes'][_0xb84c('0x53')]?_0x3873e7[_0xb84c('0x50')]:_0x35efd4[_0xb84c('0x4c')];_0x3873e7[_0xb84c('0xbd')]=qs['sort'](_0x45b747[_0xb84c('0x4e')]['sort']);_0x3873e7['where']=qs['filters'](_['pick'](_0x45b747[_0xb84c('0x4e')],_0x35efd4['filters']));if(_0x45b747[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0x3873e7[_0xb84c('0x56')]=_['merge'](_0x3873e7[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x3873e7[_0xb84c('0x50')],function(_0xbd369f){var _0x25e96={};_0x25e96[_0xbd369f]={'$like':'%'+_0x45b747['query'][_0xb84c('0x3d')]+'%'};return _0x25e96;})});}_0x3873e7=_[_0xb84c('0x58')]({},_0x3873e7,_0x45b747['options']);return _0x20c746[_0xb84c('0x104')](_0x3873e7);}})[_0xb84c('0x24')](function(_0x349d47){if(_0x349d47){_0x2ea845=_0x349d47[_0xb84c('0x53')];if(!_0x45b747[_0xb84c('0x4e')][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x3873e7[_0xb84c('0x32')]=qs['limit'](_0x45b747['query']['limit']);_0x3873e7[_0xb84c('0x54')]=qs[_0xb84c('0x54')](_0x45b747[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0x20c746[_0xb84c('0x104')](_0x3873e7);}})[_0xb84c('0x24')](function(_0x5be95e){if(_0x5be95e){return _0x5be95e?{'count':_0x2ea845,'rows':_0x5be95e}:null;}})[_0xb84c('0x24')](respondWithResult(_0x58b319,null))[_0xb84c('0x2e')](handleError(_0x58b319,null));};exports['addTeams']=function(_0x199acb,_0xfec9c){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x199acb[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0xfec9c,null))[_0xb84c('0x24')](function(_0x1773ad){if(_0x1773ad){var _0x163d99=_0x1773ad[_0xb84c('0x8f')]({'plain':!![]});return _0x1773ad[_0xb84c('0x106')](_0x199acb[_0xb84c('0x68')][_0xb84c('0x6c')],_[_0xb84c('0x6d')](_0x199acb[_0xb84c('0x68')],[_0xb84c('0x6c'),'id'])||{})['then'](function(){for(var _0x466fc2=0x0;_0x466fc2<_0x199acb[_0xb84c('0x68')][_0xb84c('0x6c')][_0xb84c('0x53')];_0x466fc2++){var _0x3d0f68=[];db[_0xb84c('0x105')][_0xb84c('0x95')]({'where':{'id':_0x199acb[_0xb84c('0x68')]['ids'][_0x466fc2]}})[_0xb84c('0x24')](function(_0xebec61){_0x3d0f68[_0xb84c('0xab')](_0xebec61[_0xb84c('0xe7')]()[_0xb84c('0x24')](function(_0x3ffb3b){for(var _0x1de1e8=0x0;_0x1de1e8<_0x3ffb3b[_0xb84c('0x53')];_0x1de1e8++){_0x3ffb3b[_0x1de1e8]['setDataValue'](_0xb84c('0x9e'),'Voice');}return _0x3ffb3b;}));_0x3d0f68['push'](_0xebec61[_0xb84c('0x107')]()[_0xb84c('0x24')](function(_0x18fd3a){for(var _0x517059=0x0;_0x517059<_0x18fd3a['length'];_0x517059++){_0x18fd3a[_0x517059][_0xb84c('0x108')](_0xb84c('0x9e'),_0xb84c('0x109'));}return _0x18fd3a;}));_0x3d0f68[_0xb84c('0xab')](_0xebec61['getMailQueues']()[_0xb84c('0x24')](function(_0x51cd7f){for(var _0x441da4=0x0;_0x441da4<_0x51cd7f[_0xb84c('0x53')];_0x441da4++){_0x51cd7f[_0x441da4][_0xb84c('0x108')](_0xb84c('0x9e'),_0xb84c('0x10a'));}return _0x51cd7f;}));_0x3d0f68[_0xb84c('0xab')](_0xebec61['getSmsQueues']()[_0xb84c('0x24')](function(_0x4f0c59){for(var _0x147942=0x0;_0x147942<_0x4f0c59['length'];_0x147942++){_0x4f0c59[_0x147942]['setDataValue'](_0xb84c('0x9e'),_0xb84c('0x10b'));}return _0x4f0c59;}));_0x3d0f68[_0xb84c('0xab')](_0xebec61[_0xb84c('0x10c')]()['then'](function(_0x30f924){for(var _0x32267b=0x0;_0x32267b<_0x30f924[_0xb84c('0x53')];_0x32267b++){_0x30f924[_0x32267b][_0xb84c('0x108')](_0xb84c('0x9e'),'Whatsapp');}return _0x30f924;}));_0x3d0f68[_0xb84c('0xab')](_0xebec61[_0xb84c('0x10d')]()[_0xb84c('0x24')](function(_0x3c156f){for(var _0x516dd3=0x0;_0x516dd3<_0x3c156f[_0xb84c('0x53')];_0x516dd3++){_0x3c156f[_0x516dd3][_0xb84c('0x108')](_0xb84c('0x9e'),_0xb84c('0x10e'));}return _0x3c156f;}));_0x3d0f68['push'](_0xebec61[_0xb84c('0x10f')]()['then'](function(_0x5cf70f){for(var _0x2c994c=0x0;_0x2c994c<_0x5cf70f[_0xb84c('0x53')];_0x2c994c++){_0x5cf70f[_0x2c994c][_0xb84c('0x108')](_0xb84c('0x9e'),_0xb84c('0x110'));}return _0x5cf70f;}));return BPromise[_0xb84c('0xed')](_0x3d0f68);})[_0xb84c('0x24')](function(_0x20e9d9){var _0x327f8f=_[_0xb84c('0x111')](_0x20e9d9);_0x3d0f68=[];return db[_0xb84c('0x5a')][_0xb84c('0x112')](function(_0x1056f7){for(var _0x1fceac=0x0;_0x1fceac<_0x327f8f['length'];_0x1fceac++){_0x3d0f68[_0xb84c('0xab')](_0x327f8f[_0x1fceac][_0xb84c('0x113')](_0x163d99['id']),{'transaction':_0x1056f7});}return BPromise[_0xb84c('0xed')](_0x3d0f68)[_0xb84c('0x24')](function(){if(_0x163d99[_0xb84c('0xaa')]){return BPromise[_0xb84c('0xae')](_[_0xb84c('0x3d')](_0x327f8f,function(_0x1f397a){return _0x1f397a[_0xb84c('0x114')](_0xb84c('0x9e'))==='Voice';}),function(_0x371727){return db[_0xb84c('0xaf')][_0xb84c('0xe9')]({'membername':_0x163d99[_0xb84c('0x45')],'UserId':_0x163d99['id'],'queue_name':_0x371727[_0xb84c('0x45')],'VoiceQueueId':_0x371727['id'],'interface':_[_0xb84c('0x74')](_0x163d99['interface'])?util[_0xb84c('0x76')](_0xb84c('0xac'),_0x163d99[_0xb84c('0x45')]):_0x163d99[_0xb84c('0x9f')],'paused':_0x163d99['voicePause']||![],'penalty':_0x163d99[_0xb84c('0xa4')]},{'transaction':_0x1056f7});});}else{return;}})[_0xb84c('0x24')](function(){for(var _0x3673b1=0x0;_0x3673b1<_0x327f8f[_0xb84c('0x53')];_0x3673b1++){var _0xb7952f=_0x327f8f[_0x3673b1][_0xb84c('0x114')](_0xb84c('0x9e'));var _0x2cccce=_0xb7952f+_0xb84c('0xb2');socket['emit'](_0xb84c('0x70')+_0xb7952f+'Queue:save',{'UserId':_0x163d99['id'],['queueField']:_0x327f8f[_0x3673b1]['id']});}});});});}});}})[_0xb84c('0x24')](respondWithStatusCode(_0xfec9c,null))[_0xb84c('0x2e')](handleError(_0xfec9c,null));};exports[_0xb84c('0x115')]=function(_0x4a2922,_0x32b1af){return db['User'][_0xb84c('0x95')]({'where':{'id':_0x4a2922[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x32b1af,null))['then'](function(_0x4d4f4a){if(_0x4d4f4a){var _0x2af222=_0x4d4f4a['get']({'plain':!![]});var _0x530b3d=_0x4a2922[_0xb84c('0x4e')]['ids'];return _0x4d4f4a[_0xb84c('0x115')](_0x530b3d)['then'](function(){for(var _0x57478d=0x0;_0x57478d<_0x530b3d[_0xb84c('0x53')];_0x57478d++){var _0x5be411=[];db[_0xb84c('0x105')][_0xb84c('0x95')]({'where':{'id':_0x530b3d[_0x57478d]}})[_0xb84c('0x24')](function(_0x42b089){_0x5be411['push'](_0x42b089[_0xb84c('0xe7')]()[_0xb84c('0x24')](function(_0x16c65d){for(var _0xfc72db=0x0;_0xfc72db<_0x16c65d['length'];_0xfc72db++){_0x16c65d[_0xfc72db][_0xb84c('0x108')](_0xb84c('0x9e'),'Voice');}return _0x16c65d;}));_0x5be411[_0xb84c('0xab')](_0x42b089[_0xb84c('0x107')]()[_0xb84c('0x24')](function(_0x3b9bd9){for(var _0x3932c4=0x0;_0x3932c4<_0x3b9bd9[_0xb84c('0x53')];_0x3932c4++){_0x3b9bd9[_0x3932c4][_0xb84c('0x108')](_0xb84c('0x9e'),_0xb84c('0x109'));}return _0x3b9bd9;}));_0x5be411[_0xb84c('0xab')](_0x42b089['getMailQueues']()[_0xb84c('0x24')](function(_0x2d9005){for(var _0x57647e=0x0;_0x57647e<_0x2d9005[_0xb84c('0x53')];_0x57647e++){_0x2d9005[_0x57647e][_0xb84c('0x108')](_0xb84c('0x9e'),_0xb84c('0x10a'));}return _0x2d9005;}));_0x5be411['push'](_0x42b089[_0xb84c('0x116')]()[_0xb84c('0x24')](function(_0x1df5ae){for(var _0xbc5518=0x0;_0xbc5518<_0x1df5ae['length'];_0xbc5518++){_0x1df5ae[_0xbc5518][_0xb84c('0x108')](_0xb84c('0x9e'),_0xb84c('0x10b'));}return _0x1df5ae;}));_0x5be411[_0xb84c('0xab')](_0x42b089['getWhatsappQueues']()['then'](function(_0x8d8215){for(var _0x34c1fd=0x0;_0x34c1fd<_0x8d8215[_0xb84c('0x53')];_0x34c1fd++){_0x8d8215[_0x34c1fd][_0xb84c('0x108')](_0xb84c('0x9e'),_0xb84c('0x117'));}return _0x8d8215;}));_0x5be411[_0xb84c('0xab')](_0x42b089[_0xb84c('0x10d')]()['then'](function(_0x3e3d58){for(var _0x18543a=0x0;_0x18543a<_0x3e3d58[_0xb84c('0x53')];_0x18543a++){_0x3e3d58[_0x18543a][_0xb84c('0x108')](_0xb84c('0x9e'),_0xb84c('0x10e'));}return _0x3e3d58;}));_0x5be411[_0xb84c('0xab')](_0x42b089['getOpenchannelQueues']()['then'](function(_0x4102cd){for(var _0x5d0b23=0x0;_0x5d0b23<_0x4102cd['length'];_0x5d0b23++){_0x4102cd[_0x5d0b23][_0xb84c('0x108')](_0xb84c('0x9e'),'Openchannel');}return _0x4102cd;}));return BPromise['all'](_0x5be411);})[_0xb84c('0x24')](function(_0x5ce719){var _0x3e2694=_[_0xb84c('0x111')](_0x5ce719);_0x5be411=[];return db[_0xb84c('0x5a')]['transaction'](function(_0x102474){for(var _0x1e6c48=0x0;_0x1e6c48<_0x3e2694[_0xb84c('0x53')];_0x1e6c48++){_0x5be411[_0xb84c('0xab')](_0x3e2694[_0x1e6c48][_0xb84c('0x118')](_0x2af222['id']),{'transaction':_0x102474});}return BPromise['all'](_0x5be411)[_0xb84c('0x24')](function(){if(_0x2af222[_0xb84c('0xaa')]){return BPromise['each'](_[_0xb84c('0x3d')](_0x3e2694,function(_0x5d5b86){return _0x5d5b86[_0xb84c('0x114')](_0xb84c('0x9e'))===_0xb84c('0x119');}),function(_0x3b0e4f){return db[_0xb84c('0xaf')][_0xb84c('0x38')]({'where':{'VoiceQueueId':_0x3b0e4f['id'],'UserId':_0x2af222['id']},'transaction':_0x102474});});}else{return;}})[_0xb84c('0x24')](function(){for(var _0x59562a=0x0;_0x59562a<_0x3e2694[_0xb84c('0x53')];_0x59562a++){var _0x1a27cc=_0x3e2694[_0x59562a][_0xb84c('0x114')]('channel');var _0x26504f=_0x1a27cc+'QueueId';socket[_0xb84c('0xa6')](_0xb84c('0x70')+_0x1a27cc+_0xb84c('0x11a'),{'UserId':_0x2af222['id'],['queueField']:_0x3e2694[_0x59562a]['id']});}});});});}});}})[_0xb84c('0x24')](respondWithStatusCode(_0x32b1af,null))[_0xb84c('0x2e')](handleError(_0x32b1af,null));};exports[_0xb84c('0x11b')]=function(_0x1c11d4,_0x4a6798,_0x3f7fec){var _0x2d7382={};var _0x522234={};var _0x48b13d;var _0x28cbd2;return db[_0xb84c('0x48')]['findOne']({'where':{'id':_0x1c11d4[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x4a6798,null))[_0xb84c('0x24')](function(_0x545c23){if(_0x545c23){_0x48b13d=_0x545c23;_0x522234['model']=_['keys'](db[_0xb84c('0xc0')][_0xb84c('0x49')]);_0x522234[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x1c11d4[_0xb84c('0x4e')]);_0x522234[_0xb84c('0x4f')]=_['intersection'](_0x522234[_0xb84c('0x4c')],_0x522234['query']);_0x2d7382[_0xb84c('0x50')]=_['intersection'](_0x522234[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x1c11d4[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x2d7382[_0xb84c('0x50')]=_0x2d7382[_0xb84c('0x50')][_0xb84c('0x53')]?_0x2d7382[_0xb84c('0x50')]:_0x522234[_0xb84c('0x4c')];_0x2d7382[_0xb84c('0xbd')]=qs[_0xb84c('0x55')](_0x1c11d4[_0xb84c('0x4e')][_0xb84c('0x55')]);_0x2d7382[_0xb84c('0x56')]=qs['filters'](_['pick'](_0x1c11d4[_0xb84c('0x4e')],_0x522234[_0xb84c('0x4f')]));if(_0x1c11d4[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0x2d7382[_0xb84c('0x56')]=_['merge'](_0x2d7382[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x2d7382['attributes'],function(_0x382b8a){var _0x1e8d21={};_0x1e8d21[_0x382b8a]={'$like':'%'+_0x1c11d4['query'][_0xb84c('0x3d')]+'%'};return _0x1e8d21;})});}_0x2d7382=_[_0xb84c('0x58')]({},_0x2d7382,_0x1c11d4[_0xb84c('0x5d')]);return _0x48b13d[_0xb84c('0x11b')](_0x2d7382);}})[_0xb84c('0x24')](function(_0x5dce79){if(_0x5dce79){_0x28cbd2=_0x5dce79[_0xb84c('0x53')];if(!_0x1c11d4[_0xb84c('0x4e')]['hasOwnProperty'](_0xb84c('0xc6'))){_0x2d7382[_0xb84c('0x32')]=qs[_0xb84c('0x32')](_0x1c11d4[_0xb84c('0x4e')][_0xb84c('0x32')]);_0x2d7382[_0xb84c('0x54')]=qs[_0xb84c('0x54')](_0x1c11d4['query'][_0xb84c('0x54')]);}return _0x48b13d['getLists'](_0x2d7382);}})['then'](function(_0x18aae8){if(_0x18aae8){return _0x18aae8?{'count':_0x28cbd2,'rows':_0x18aae8}:null;}})['then'](respondWithResult(_0x4a6798,null))[_0xb84c('0x2e')](handleError(_0x4a6798,null));};exports[_0xb84c('0x11c')]=function(_0x55f9a5,_0x2a5c3c,_0xb34c5a){var _0xe2d08a={};var _0x4bd7a0={};var _0x4d7cff;var _0x50f241;return db[_0xb84c('0x48')][_0xb84c('0x95')]({'where':{'id':_0x55f9a5[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x2a5c3c,null))[_0xb84c('0x24')](function(_0x52d940){if(_0x52d940){_0x4d7cff=_0x52d940;_0x4bd7a0[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](db[_0xb84c('0x48')]['rawAttributes']);_0x4bd7a0[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x55f9a5[_0xb84c('0x4e')]);_0x4bd7a0['filters']=_['intersection'](_0x4bd7a0[_0xb84c('0x4c')],_0x4bd7a0['query']);_0xe2d08a[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0x4bd7a0[_0xb84c('0x4c')],qs['fields'](_0x55f9a5[_0xb84c('0x4e')][_0xb84c('0x52')]));_0xe2d08a[_0xb84c('0x50')]=_0xe2d08a[_0xb84c('0x50')][_0xb84c('0x53')]?_0xe2d08a[_0xb84c('0x50')]:_0x4bd7a0['model'];_0xe2d08a[_0xb84c('0xbd')]=qs[_0xb84c('0x55')](_0x55f9a5['query'][_0xb84c('0x55')]);_0xe2d08a[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_['pick'](_0x55f9a5['query'],_0x4bd7a0[_0xb84c('0x4f')]));if(_0x55f9a5[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0xe2d08a['where']=_['merge'](_0xe2d08a[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0xe2d08a[_0xb84c('0x50')],function(_0x45ab6b){var _0xf722e6={};_0xf722e6[_0x45ab6b]={'$like':'%'+_0x55f9a5[_0xb84c('0x4e')]['filter']+'%'};return _0xf722e6;})});}_0xe2d08a[_0xb84c('0x4c')]=db[_0xb84c('0x48')];_0xe2d08a['as']=_0xb84c('0x90');_0xe2d08a=_[_0xb84c('0x58')]({},_0xe2d08a,_0x55f9a5[_0xb84c('0x5d')]);return _0x4d7cff[_0xb84c('0xe7')]({'include':[_0xe2d08a]});}})[_0xb84c('0x24')](function(_0x4239e6){if(_0x4239e6){var _0x4cd889={},_0x2e5456=[],_0x1c9afd=0x0;for(var _0x2f911f=0x0;_0x2f911f<_0x4239e6['length'];_0x2f911f+=0x1){for(var _0x1e823f=0x0,_0x5555d6;_0x1e823f<_0x4239e6[_0x2f911f][_0xb84c('0x90')][_0xb84c('0x53')];_0x1e823f+=0x1){_0x5555d6=_0x4239e6[_0x2f911f][_0xb84c('0x90')][_0x1e823f]['get']({'plain':!![]});_0x4cd889[_0x5555d6['id']]=_0x5555d6;}}_0x4cd889=_[_0xb84c('0x11d')](_0x4cd889);for(var _0x12573b=qs[_0xb84c('0x54')](_0x55f9a5[_0xb84c('0x4e')]['offset']);_0x12573b<_0x4cd889['length']&&_0x2e5456[_0xb84c('0x53')]<qs[_0xb84c('0x32')](_0x55f9a5['query'][_0xb84c('0x32')]);_0x12573b+=0x1){if(_0x4cd889[_0x12573b]){_0x2e5456[_0xb84c('0xab')](_0x4cd889[_0x12573b]);}}return{'count':_0x4cd889[_0xb84c('0x53')],'rows':_0x2e5456};}})[_0xb84c('0x24')](respondWithResult(_0x2a5c3c,null))['catch'](handleError(_0x2a5c3c,null));};exports[_0xb84c('0x38')]=function(_0x1b0ef0,_0x92f37d){if(_0x1b0ef0[_0xb84c('0x70')]['id']==_0x1b0ef0[_0xb84c('0x64')]['id']){return _0x92f37d[_0xb84c('0x30')](0x1f4)['send']({'message':_0xb84c('0x11e')});}return db['User'][_0xb84c('0x69')]({'where':{'id':_0x1b0ef0['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x92f37d,null))[_0xb84c('0x24')](removeEntity(_0x92f37d,null))[_0xb84c('0x2e')](handleError(_0x92f37d,null));};exports['addChatInteractions']=function(_0x2bc610,_0xdb6015,_0x50f265){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x2bc610[_0xb84c('0x64')]['id']}})['then'](handleEntityNotFound(_0xdb6015,null))[_0xb84c('0x24')](function(_0x4828d6){if(_0x4828d6){return _0x4828d6[_0xb84c('0x11f')](_0x2bc610[_0xb84c('0x68')][_0xb84c('0x6c')],_[_0xb84c('0x6d')](_0x2bc610[_0xb84c('0x68')],[_0xb84c('0x6c'),'id'])||{})[_0xb84c('0xa5')](function(){for(var _0x52b7a9=0x0;_0x52b7a9<_0x2bc610['body'][_0xb84c('0x6c')][_0xb84c('0x53')];_0x52b7a9+=0x1){socket[_0xb84c('0xa6')](_0xb84c('0x120'),{'ChatInteractionId':Number(_0x2bc610[_0xb84c('0x68')][_0xb84c('0x6c')][_0x52b7a9]),'UserId':Number(_0x2bc610[_0xb84c('0x64')]['id'])});}return _0x2bc610[_0xb84c('0x68')][_0xb84c('0x6c')];});}})[_0xb84c('0x24')](respondWithResult(_0xdb6015,null))[_0xb84c('0x2e')](handleError(_0xdb6015,null));};exports[_0xb84c('0x121')]=function(_0x3a07c9,_0x2e41fd,_0x151249){return db['User'][_0xb84c('0x69')]({'where':{'id':_0x3a07c9['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x2e41fd,null))[_0xb84c('0x24')](function(_0xe91f6a){if(_0xe91f6a){return _0xe91f6a[_0xb84c('0x121')](_0x3a07c9[_0xb84c('0x4e')][_0xb84c('0x6c')])[_0xb84c('0x24')](function(){if(_['isArray'](_0x3a07c9[_0xb84c('0x4e')][_0xb84c('0x6c')])){for(var _0x57fb3f=0x0;_0x57fb3f<_0x3a07c9[_0xb84c('0x4e')]['ids'][_0xb84c('0x53')];_0x57fb3f+=0x1){socket[_0xb84c('0xa6')](_0xb84c('0x122'),{'ChatInteractionId':Number(_0x3a07c9[_0xb84c('0x4e')][_0xb84c('0x6c')][_0x57fb3f]),'UserId':Number(_0x3a07c9['params']['id'])});}}else{socket['emit'](_0xb84c('0x122'),{'ChatInteractionId':Number(_0x3a07c9[_0xb84c('0x4e')]['ids']),'UserId':Number(_0x3a07c9[_0xb84c('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0x2e41fd,null))['catch'](handleError(_0x2e41fd,null));};exports[_0xb84c('0x123')]=function(_0x2d9a24,_0x59bb7b,_0x114e7b){return db[_0xb84c('0x48')]['find']({'where':{'id':_0x2d9a24['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x59bb7b,null))[_0xb84c('0x24')](function(_0x20f2cd){if(_0x20f2cd){return _0x20f2cd[_0xb84c('0x123')](_0x2d9a24['body'][_0xb84c('0x6c')],_[_0xb84c('0x6d')](_0x2d9a24[_0xb84c('0x68')],[_0xb84c('0x6c'),'id'])||{})[_0xb84c('0xa5')](function(){for(var _0x240324=0x0;_0x240324<_0x2d9a24[_0xb84c('0x68')][_0xb84c('0x6c')][_0xb84c('0x53')];_0x240324+=0x1){socket[_0xb84c('0xa6')](_0xb84c('0x124'),{'MailInteractionId':Number(_0x2d9a24['body'][_0xb84c('0x6c')][_0x240324]),'UserId':Number(_0x2d9a24[_0xb84c('0x64')]['id'])});}return _0x2d9a24[_0xb84c('0x68')][_0xb84c('0x6c')];});}})[_0xb84c('0x24')](respondWithResult(_0x59bb7b,null))[_0xb84c('0x2e')](handleError(_0x59bb7b,null));};exports[_0xb84c('0x125')]=function(_0x4274cc,_0x2c7bf7,_0xe3f219){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x4274cc['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x2c7bf7,null))[_0xb84c('0x24')](function(_0xba611e){if(_0xba611e){return _0xba611e[_0xb84c('0x125')](_0x4274cc[_0xb84c('0x4e')]['ids'])[_0xb84c('0x24')](function(){if(_[_0xb84c('0x126')](_0x4274cc['query']['ids'])){for(var _0x9f3214=0x0;_0x9f3214<_0x4274cc[_0xb84c('0x4e')]['ids'][_0xb84c('0x53')];_0x9f3214+=0x1){socket[_0xb84c('0xa6')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x4274cc['query'][_0xb84c('0x6c')][_0x9f3214]),'UserId':Number(_0x4274cc[_0xb84c('0x64')]['id'])});}}else{socket[_0xb84c('0xa6')](_0xb84c('0x127'),{'MailInteractionId':Number(_0x4274cc[_0xb84c('0x4e')][_0xb84c('0x6c')]),'UserId':Number(_0x4274cc['params']['id'])});}});}})[_0xb84c('0x24')](respondWithStatusCode(_0x2c7bf7,null))[_0xb84c('0x2e')](handleError(_0x2c7bf7,null));};exports['addFaxInteractions']=function(_0x1f2145,_0x27c775,_0x313227){return db['User'][_0xb84c('0x69')]({'where':{'id':_0x1f2145[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x27c775,null))[_0xb84c('0x24')](function(_0x3f45ce){if(_0x3f45ce){return _0x3f45ce[_0xb84c('0x128')](_0x1f2145[_0xb84c('0x68')][_0xb84c('0x6c')],_[_0xb84c('0x6d')](_0x1f2145['body'],[_0xb84c('0x6c'),'id'])||{})[_0xb84c('0xa5')](function(){for(var _0x2027c7=0x0;_0x2027c7<_0x1f2145[_0xb84c('0x68')][_0xb84c('0x6c')][_0xb84c('0x53')];_0x2027c7+=0x1){socket['emit'](_0xb84c('0x129'),{'FaxInteractionId':Number(_0x1f2145[_0xb84c('0x68')][_0xb84c('0x6c')][_0x2027c7]),'UserId':Number(_0x1f2145[_0xb84c('0x64')]['id'])});}return _0x1f2145[_0xb84c('0x68')]['ids'];});}})[_0xb84c('0x24')](respondWithResult(_0x27c775,null))[_0xb84c('0x2e')](handleError(_0x27c775,null));};exports['removeFaxInteractions']=function(_0x14cf23,_0x2fc972,_0x2db838){return db['User'][_0xb84c('0x69')]({'where':{'id':_0x14cf23['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x2fc972,null))[_0xb84c('0x24')](function(_0x2cb359){if(_0x2cb359){return _0x2cb359[_0xb84c('0x12a')](_0x14cf23[_0xb84c('0x4e')][_0xb84c('0x6c')])['then'](function(){if(_['isArray'](_0x14cf23[_0xb84c('0x4e')][_0xb84c('0x6c')])){for(var _0x106056=0x0;_0x106056<_0x14cf23[_0xb84c('0x4e')]['ids'][_0xb84c('0x53')];_0x106056+=0x1){socket['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x14cf23[_0xb84c('0x4e')]['ids'][_0x106056]),'UserId':Number(_0x14cf23[_0xb84c('0x64')]['id'])});}}else{socket[_0xb84c('0xa6')](_0xb84c('0x12b'),{'FaxInteractionId':Number(_0x14cf23['query'][_0xb84c('0x6c')]),'UserId':Number(_0x14cf23[_0xb84c('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0x2fc972,null))['catch'](handleError(_0x2fc972,null));};exports[_0xb84c('0x12c')]=function(_0x12e354,_0x1d3a25,_0x2b8541){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x12e354[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x1d3a25,null))[_0xb84c('0x24')](function(_0x9c1b7f){if(_0x9c1b7f){return _0x9c1b7f[_0xb84c('0x12c')](_0x12e354[_0xb84c('0x68')][_0xb84c('0x6c')],_[_0xb84c('0x6d')](_0x12e354[_0xb84c('0x68')],[_0xb84c('0x6c'),'id'])||{})['spread'](function(){for(var _0x2c5b12=0x0;_0x2c5b12<_0x12e354['body'][_0xb84c('0x6c')][_0xb84c('0x53')];_0x2c5b12+=0x1){socket[_0xb84c('0xa6')](_0xb84c('0x12d'),{'SmsInteractionId':Number(_0x12e354[_0xb84c('0x68')][_0xb84c('0x6c')][_0x2c5b12]),'UserId':Number(_0x12e354[_0xb84c('0x64')]['id'])});}return _0x12e354[_0xb84c('0x68')]['ids'];});}})['then'](respondWithResult(_0x1d3a25,null))['catch'](handleError(_0x1d3a25,null));};exports[_0xb84c('0x12e')]=function(_0x481df0,_0x15be5f,_0x106f58){return db[_0xb84c('0x48')]['find']({'where':{'id':_0x481df0[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x15be5f,null))[_0xb84c('0x24')](function(_0x4f7816){if(_0x4f7816){return _0x4f7816['removeSmsInteractions'](_0x481df0[_0xb84c('0x4e')]['ids'])[_0xb84c('0x24')](function(){if(_[_0xb84c('0x126')](_0x481df0[_0xb84c('0x4e')][_0xb84c('0x6c')])){for(var _0xa82118=0x0;_0xa82118<_0x481df0['query'][_0xb84c('0x6c')]['length'];_0xa82118+=0x1){socket[_0xb84c('0xa6')](_0xb84c('0x12f'),{'SmsInteractionId':Number(_0x481df0[_0xb84c('0x4e')]['ids'][_0xa82118]),'UserId':Number(_0x481df0[_0xb84c('0x64')]['id'])});}}else{socket['emit'](_0xb84c('0x12f'),{'SmsInteractionId':Number(_0x481df0[_0xb84c('0x4e')]['ids']),'UserId':Number(_0x481df0[_0xb84c('0x64')]['id'])});}});}})[_0xb84c('0x24')](respondWithStatusCode(_0x15be5f,null))[_0xb84c('0x2e')](handleError(_0x15be5f,null));};exports[_0xb84c('0x130')]=function(_0x37d7d4,_0x21a3e3,_0x5d92ff){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x37d7d4[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x21a3e3,null))[_0xb84c('0x24')](function(_0x577c36){if(_0x577c36){return _0x577c36['addOpenchannelInteractions'](_0x37d7d4['body'][_0xb84c('0x6c')],_[_0xb84c('0x6d')](_0x37d7d4[_0xb84c('0x68')],[_0xb84c('0x6c'),'id'])||{})[_0xb84c('0xa5')](function(){for(var _0x37d11f=0x0;_0x37d11f<_0x37d7d4[_0xb84c('0x68')]['ids'][_0xb84c('0x53')];_0x37d11f+=0x1){socket[_0xb84c('0xa6')](_0xb84c('0x131'),{'OpenchannelInteractionId':Number(_0x37d7d4[_0xb84c('0x68')]['ids'][_0x37d11f]),'UserId':Number(_0x37d7d4['params']['id'])});}return _0x37d7d4[_0xb84c('0x68')][_0xb84c('0x6c')];});}})[_0xb84c('0x24')](respondWithResult(_0x21a3e3,null))[_0xb84c('0x2e')](handleError(_0x21a3e3,null));};exports[_0xb84c('0x132')]=function(_0x368c60,_0x52aeee,_0x25c6ba){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x368c60[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x52aeee,null))['then'](function(_0x51acf7){if(_0x51acf7){return _0x51acf7['removeOpenchannelInteractions'](_0x368c60[_0xb84c('0x4e')][_0xb84c('0x6c')])[_0xb84c('0x24')](function(){if(_[_0xb84c('0x126')](_0x368c60[_0xb84c('0x4e')][_0xb84c('0x6c')])){for(var _0xb1fe52=0x0;_0xb1fe52<_0x368c60['query'][_0xb84c('0x6c')][_0xb84c('0x53')];_0xb1fe52+=0x1){socket['emit'](_0xb84c('0x133'),{'OpenchannelInteractionId':Number(_0x368c60[_0xb84c('0x4e')][_0xb84c('0x6c')][_0xb1fe52]),'UserId':Number(_0x368c60[_0xb84c('0x64')]['id'])});}}else{socket[_0xb84c('0xa6')](_0xb84c('0x133'),{'OpenchannelInteractionId':Number(_0x368c60[_0xb84c('0x4e')][_0xb84c('0x6c')]),'UserId':Number(_0x368c60[_0xb84c('0x64')]['id'])});}});}})[_0xb84c('0x24')](respondWithStatusCode(_0x52aeee,null))['catch'](handleError(_0x52aeee,null));};exports['addWhatsappInteractions']=function(_0x49a644,_0x2a4718,_0x36d3c7){return db[_0xb84c('0x48')]['find']({'where':{'id':_0x49a644[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x2a4718,null))[_0xb84c('0x24')](function(_0x47a0c3){if(_0x47a0c3){return _0x47a0c3['addWhatsappInteractions'](_0x49a644[_0xb84c('0x68')][_0xb84c('0x6c')],_[_0xb84c('0x6d')](_0x49a644[_0xb84c('0x68')],['ids','id'])||{})[_0xb84c('0xa5')](function(){for(var _0x558c68=0x0;_0x558c68<_0x49a644[_0xb84c('0x68')]['ids']['length'];_0x558c68+=0x1){socket['emit'](_0xb84c('0x134'),{'WhatsappInteractionId':Number(_0x49a644['body'][_0xb84c('0x6c')][_0x558c68]),'UserId':Number(_0x49a644[_0xb84c('0x64')]['id'])});}return _0x49a644[_0xb84c('0x68')]['ids'];});}})[_0xb84c('0x24')](respondWithResult(_0x2a4718,null))['catch'](handleError(_0x2a4718,null));};exports['removeWhatsappInteractions']=function(_0xc13328,_0x337e8b,_0x2dfa02){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0xc13328['params']['id']}})['then'](handleEntityNotFound(_0x337e8b,null))[_0xb84c('0x24')](function(_0x3e3b62){if(_0x3e3b62){return _0x3e3b62[_0xb84c('0x135')](_0xc13328['query'][_0xb84c('0x6c')]);}})['then'](respondWithStatusCode(_0x337e8b,null))[_0xb84c('0x2e')](handleError(_0x337e8b,null));};exports[_0xb84c('0x136')]=function(_0x12f711,_0x38e2a4,_0x4cbddc){var _0x12c21d={};var _0xb90dd1={};var _0x25ae9a;var _0x3d8dd7;return db[_0xb84c('0x48')]['findOne']({'where':{'id':_0x12f711[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x38e2a4,null))[_0xb84c('0x24')](function(_0x1ec8fe){if(_0x1ec8fe){_0x25ae9a=_0x1ec8fe;_0xb90dd1[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](db['VoicePrefix'][_0xb84c('0x49')]);_0xb90dd1[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x12f711['query']);_0xb90dd1[_0xb84c('0x4f')]=_['intersection'](_0xb90dd1[_0xb84c('0x4c')],_0xb90dd1[_0xb84c('0x4e')]);_0x12c21d[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0xb90dd1[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x12f711['query'][_0xb84c('0x52')]));_0x12c21d[_0xb84c('0x50')]=_0x12c21d[_0xb84c('0x50')][_0xb84c('0x53')]?_0x12c21d[_0xb84c('0x50')]:_0xb90dd1[_0xb84c('0x4c')];_0x12c21d[_0xb84c('0xbd')]=qs[_0xb84c('0x55')](_0x12f711[_0xb84c('0x4e')]['sort']);_0x12c21d[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x12f711['query'],_0xb90dd1['filters']));if(_0x12f711['query'][_0xb84c('0x3d')]){_0x12c21d[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x12c21d[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x12c21d['attributes'],function(_0x3a77a2){var _0x27df69={};_0x27df69[_0x3a77a2]={'$like':'%'+_0x12f711[_0xb84c('0x4e')][_0xb84c('0x3d')]+'%'};return _0x27df69;})});}_0x12c21d=_['merge']({},_0x12c21d,_0x12f711['options']);return _0x25ae9a[_0xb84c('0x136')](_0x12c21d);}})['then'](function(_0x4b1a65){if(_0x4b1a65){_0x3d8dd7=_0x4b1a65[_0xb84c('0x53')];if(!_0x12f711[_0xb84c('0x4e')][_0xb84c('0xbf')]('nolimit')){_0x12c21d[_0xb84c('0x32')]=qs['limit'](_0x12f711[_0xb84c('0x4e')][_0xb84c('0x32')]);_0x12c21d['offset']=qs[_0xb84c('0x54')](_0x12f711['query'][_0xb84c('0x54')]);}return _0x25ae9a['getVoicePrefixes'](_0x12c21d);}})[_0xb84c('0x24')](function(_0x5c23c8){if(_0x5c23c8){return _0x5c23c8?{'count':_0x3d8dd7,'rows':_0x5c23c8}:null;}})[_0xb84c('0x24')](respondWithResult(_0x38e2a4,null))[_0xb84c('0x2e')](handleError(_0x38e2a4,null));};exports[_0xb84c('0x137')]=function(_0x48bf63,_0x16afcf,_0x2ea928){var _0x5d33ce={};var _0x5c2745={};var _0x13c67c;var _0x1f37e9;return db[_0xb84c('0x48')][_0xb84c('0x95')]({'where':{'id':_0x48bf63[_0xb84c('0x64')]['id']}})['then'](handleEntityNotFound(_0x16afcf,null))[_0xb84c('0x24')](function(_0x1b4359){if(_0x1b4359){_0x13c67c=_0x1b4359;_0x5c2745['model']=_[_0xb84c('0xbb')](db[_0xb84c('0x138')][_0xb84c('0x49')]);_0x5c2745['query']=_[_0xb84c('0xbb')](_0x48bf63['query']);_0x5c2745[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x5c2745[_0xb84c('0x4c')],_0x5c2745[_0xb84c('0x4e')]);_0x5d33ce['attributes']=_[_0xb84c('0x51')](_0x5c2745['model'],qs[_0xb84c('0x52')](_0x48bf63[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x5d33ce[_0xb84c('0x50')]=_0x5d33ce[_0xb84c('0x50')]['length']?_0x5d33ce[_0xb84c('0x50')]:_0x5c2745[_0xb84c('0x4c')];_0x5d33ce['order']=qs[_0xb84c('0x55')](_0x48bf63['query']['sort']);_0x5d33ce[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x48bf63[_0xb84c('0x4e')],_0x5c2745[_0xb84c('0x4f')]));if(_0x48bf63['query'][_0xb84c('0x3d')]){_0x5d33ce[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x5d33ce[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x5d33ce['attributes'],function(_0xed31cd){var _0x133733={};_0x133733[_0xed31cd]={'$like':'%'+_0x48bf63[_0xb84c('0x4e')][_0xb84c('0x3d')]+'%'};return _0x133733;})});}_0x5d33ce=_[_0xb84c('0x58')]({},_0x5d33ce,_0x48bf63[_0xb84c('0x5d')]);return _0x13c67c[_0xb84c('0x137')](_0x5d33ce);}})[_0xb84c('0x24')](function(_0x55d44e){if(_0x55d44e){_0x1f37e9=_0x55d44e[_0xb84c('0x53')];if(!_0x48bf63['query'][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x5d33ce[_0xb84c('0x32')]=qs[_0xb84c('0x32')](_0x48bf63[_0xb84c('0x4e')]['limit']);_0x5d33ce['offset']=qs[_0xb84c('0x54')](_0x48bf63[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0x13c67c[_0xb84c('0x137')](_0x5d33ce);}})[_0xb84c('0x24')](function(_0xf0414b){if(_0xf0414b){return _0xf0414b?{'count':_0x1f37e9,'rows':_0xf0414b}:null;}})['then'](respondWithResult(_0x16afcf,null))[_0xb84c('0x2e')](handleError(_0x16afcf,null));};exports['addFaxAccounts']=function(_0x38d020,_0x46efbe,_0x34772d){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x38d020[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x46efbe,null))['then'](function(_0x5e83f9){if(_0x5e83f9){return _0x5e83f9[_0xb84c('0x139')](_0x38d020['body']['ids'],_[_0xb84c('0x6d')](_0x38d020['body'],[_0xb84c('0x6c'),'id'])||{});}})[_0xb84c('0x24')](respondWithResult(_0x46efbe,null))['catch'](handleError(_0x46efbe,null));};exports[_0xb84c('0x13a')]=function(_0x22ace1,_0xa92760,_0x59b695){return db[_0xb84c('0x48')]['find']({'where':{'id':_0x22ace1[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0xa92760,null))[_0xb84c('0x24')](function(_0x5b2668){if(_0x5b2668){return _0x5b2668[_0xb84c('0x13a')](_0x22ace1['query'][_0xb84c('0x6c')]);}})[_0xb84c('0x24')](respondWithStatusCode(_0xa92760,null))['catch'](handleError(_0xa92760,null));};exports['getMailAccounts']=function(_0x31f105,_0x35ff74,_0x216421){var _0x58320e={};var _0x53a622={};var _0x3a5fa1;var _0x49378e;return db[_0xb84c('0x48')][_0xb84c('0x95')]({'where':{'id':_0x31f105[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x35ff74,null))['then'](function(_0x3692a4){if(_0x3692a4){_0x3a5fa1=_0x3692a4;_0x53a622[_0xb84c('0x4c')]=_['keys'](db[_0xb84c('0x13b')][_0xb84c('0x49')]);_0x53a622[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x31f105[_0xb84c('0x4e')]);_0x53a622[_0xb84c('0x4f')]=_['intersection'](_0x53a622[_0xb84c('0x4c')],_0x53a622[_0xb84c('0x4e')]);_0x58320e['attributes']=_[_0xb84c('0x51')](_0x53a622[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x31f105[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x58320e[_0xb84c('0x50')]=_0x58320e[_0xb84c('0x50')][_0xb84c('0x53')]?_0x58320e[_0xb84c('0x50')]:_0x53a622[_0xb84c('0x4c')];_0x58320e['order']=qs[_0xb84c('0x55')](_0x31f105[_0xb84c('0x4e')][_0xb84c('0x55')]);_0x58320e[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x31f105['query'],_0x53a622['filters']));if(_0x31f105['query'][_0xb84c('0x3d')]){_0x58320e[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x58320e['where'],{'$or':_[_0xb84c('0x3e')](_0x58320e[_0xb84c('0x50')],function(_0x5dd633){var _0xd286f5={};_0xd286f5[_0x5dd633]={'$like':'%'+_0x31f105[_0xb84c('0x4e')]['filter']+'%'};return _0xd286f5;})});}_0x58320e=_['merge']({},_0x58320e,_0x31f105[_0xb84c('0x5d')]);return _0x3a5fa1[_0xb84c('0x13c')](_0x58320e);}})[_0xb84c('0x24')](function(_0x2d4291){if(_0x2d4291){_0x49378e=_0x2d4291[_0xb84c('0x53')];if(!_0x31f105[_0xb84c('0x4e')][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x58320e[_0xb84c('0x32')]=qs['limit'](_0x31f105[_0xb84c('0x4e')]['limit']);_0x58320e[_0xb84c('0x54')]=qs[_0xb84c('0x54')](_0x31f105[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0x3a5fa1['getMailAccounts'](_0x58320e);}})['then'](function(_0x51b41e){if(_0x51b41e){return _0x51b41e?{'count':_0x49378e,'rows':_0x51b41e}:null;}})[_0xb84c('0x24')](respondWithResult(_0x35ff74,null))['catch'](handleError(_0x35ff74,null));};exports[_0xb84c('0x13d')]=function(_0x6ca5c0,_0x5bc1fb,_0x3d3f9f){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x6ca5c0[_0xb84c('0x64')]['id']}})['then'](handleEntityNotFound(_0x5bc1fb,null))[_0xb84c('0x24')](function(_0x251773){if(_0x251773){return _0x251773[_0xb84c('0x13d')](_0x6ca5c0[_0xb84c('0x68')][_0xb84c('0x6c')],_[_0xb84c('0x6d')](_0x6ca5c0['body'],[_0xb84c('0x6c'),'id'])||{});}})[_0xb84c('0x24')](respondWithResult(_0x5bc1fb,null))[_0xb84c('0x2e')](handleError(_0x5bc1fb,null));};exports['removeMailAccounts']=function(_0x17e509,_0x5703bc,_0x3c87ea){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x17e509[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x5703bc,null))['then'](function(_0x55751e){if(_0x55751e){return _0x55751e[_0xb84c('0x13e')](_0x17e509[_0xb84c('0x4e')][_0xb84c('0x6c')]);}})[_0xb84c('0x24')](respondWithStatusCode(_0x5703bc,null))[_0xb84c('0x2e')](handleError(_0x5703bc,null));};exports[_0xb84c('0x13f')]=function(_0x11517e,_0x2eb6e9,_0x16720c){var _0x253d97={};var _0x31052f={};var _0x129dc3;var _0x146401;return db[_0xb84c('0x48')]['findOne']({'where':{'id':_0x11517e[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x2eb6e9,null))['then'](function(_0x392a81){if(_0x392a81){_0x129dc3=_0x392a81;_0x31052f[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](db[_0xb84c('0x140')][_0xb84c('0x49')]);_0x31052f['query']=_['keys'](_0x11517e[_0xb84c('0x4e')]);_0x31052f[_0xb84c('0x4f')]=_['intersection'](_0x31052f[_0xb84c('0x4c')],_0x31052f[_0xb84c('0x4e')]);_0x253d97['attributes']=_[_0xb84c('0x51')](_0x31052f[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x11517e[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x253d97[_0xb84c('0x50')]=_0x253d97[_0xb84c('0x50')]['length']?_0x253d97[_0xb84c('0x50')]:_0x31052f[_0xb84c('0x4c')];_0x253d97[_0xb84c('0xbd')]=qs['sort'](_0x11517e['query']['sort']);_0x253d97[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x11517e[_0xb84c('0x4e')],_0x31052f[_0xb84c('0x4f')]));if(_0x11517e['query']['filter']){_0x253d97[_0xb84c('0x56')]=_['merge'](_0x253d97[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x253d97['attributes'],function(_0x73be75){var _0x147b18={};_0x147b18[_0x73be75]={'$like':'%'+_0x11517e['query'][_0xb84c('0x3d')]+'%'};return _0x147b18;})});}_0x253d97=_['merge']({},_0x253d97,_0x11517e[_0xb84c('0x5d')]);return _0x129dc3[_0xb84c('0x13f')](_0x253d97);}})[_0xb84c('0x24')](function(_0x2fdf62){if(_0x2fdf62){_0x146401=_0x2fdf62['length'];if(!_0x11517e['query'][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x253d97[_0xb84c('0x32')]=qs[_0xb84c('0x32')](_0x11517e[_0xb84c('0x4e')][_0xb84c('0x32')]);_0x253d97['offset']=qs[_0xb84c('0x54')](_0x11517e[_0xb84c('0x4e')]['offset']);}return _0x129dc3['getOpenchannelAccounts'](_0x253d97);}})[_0xb84c('0x24')](function(_0x40b3df){if(_0x40b3df){return _0x40b3df?{'count':_0x146401,'rows':_0x40b3df}:null;}})['then'](respondWithResult(_0x2eb6e9,null))[_0xb84c('0x2e')](handleError(_0x2eb6e9,null));};exports[_0xb84c('0x141')]=function(_0x487566,_0x5956ce,_0x24ca3a){return db[_0xb84c('0x48')]['find']({'where':{'id':_0x487566['params']['id']}})['then'](handleEntityNotFound(_0x5956ce,null))[_0xb84c('0x24')](function(_0x545b8b){if(_0x545b8b){return _0x545b8b[_0xb84c('0x141')](_0x487566[_0xb84c('0x68')]['ids'],_[_0xb84c('0x6d')](_0x487566['body'],[_0xb84c('0x6c'),'id'])||{});}})[_0xb84c('0x24')](respondWithResult(_0x5956ce,null))['catch'](handleError(_0x5956ce,null));};exports[_0xb84c('0x142')]=function(_0x3c4ff5,_0x117b3b,_0x5dc32f){return db['User']['find']({'where':{'id':_0x3c4ff5['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x117b3b,null))[_0xb84c('0x24')](function(_0x4ebaea){if(_0x4ebaea){return _0x4ebaea['removeOpenchannelAccounts'](_0x3c4ff5['query'][_0xb84c('0x6c')]);}})[_0xb84c('0x24')](respondWithStatusCode(_0x117b3b,null))[_0xb84c('0x2e')](handleError(_0x117b3b,null));};exports['getSmsAccounts']=function(_0x38f9e0,_0x223471,_0x3bbe37){var _0x1752cd={};var _0x21db1b={};var _0x5d1a56;var _0x1e9cb4;return db['User']['findOne']({'where':{'id':_0x38f9e0['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x223471,null))[_0xb84c('0x24')](function(_0x2cd08a){if(_0x2cd08a){_0x5d1a56=_0x2cd08a;_0x21db1b[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](db[_0xb84c('0x143')][_0xb84c('0x49')]);_0x21db1b[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x38f9e0[_0xb84c('0x4e')]);_0x21db1b[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x21db1b[_0xb84c('0x4c')],_0x21db1b[_0xb84c('0x4e')]);_0x1752cd[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0x21db1b[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x38f9e0[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x1752cd['attributes']=_0x1752cd[_0xb84c('0x50')][_0xb84c('0x53')]?_0x1752cd['attributes']:_0x21db1b[_0xb84c('0x4c')];_0x1752cd[_0xb84c('0xbd')]=qs[_0xb84c('0x55')](_0x38f9e0[_0xb84c('0x4e')][_0xb84c('0x55')]);_0x1752cd['where']=qs['filters'](_[_0xb84c('0x57')](_0x38f9e0[_0xb84c('0x4e')],_0x21db1b[_0xb84c('0x4f')]));if(_0x38f9e0['query'][_0xb84c('0x3d')]){_0x1752cd[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x1752cd[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x1752cd[_0xb84c('0x50')],function(_0x24999f){var _0x121f60={};_0x121f60[_0x24999f]={'$like':'%'+_0x38f9e0[_0xb84c('0x4e')][_0xb84c('0x3d')]+'%'};return _0x121f60;})});}_0x1752cd=_['merge']({},_0x1752cd,_0x38f9e0['options']);return _0x5d1a56[_0xb84c('0x144')](_0x1752cd);}})[_0xb84c('0x24')](function(_0x10582f){if(_0x10582f){_0x1e9cb4=_0x10582f[_0xb84c('0x53')];if(!_0x38f9e0[_0xb84c('0x4e')]['hasOwnProperty']('nolimit')){_0x1752cd[_0xb84c('0x32')]=qs['limit'](_0x38f9e0['query'][_0xb84c('0x32')]);_0x1752cd['offset']=qs['offset'](_0x38f9e0[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0x5d1a56[_0xb84c('0x144')](_0x1752cd);}})['then'](function(_0x3a5c30){if(_0x3a5c30){return _0x3a5c30?{'count':_0x1e9cb4,'rows':_0x3a5c30}:null;}})[_0xb84c('0x24')](respondWithResult(_0x223471,null))[_0xb84c('0x2e')](handleError(_0x223471,null));};exports[_0xb84c('0x145')]=function(_0x5d238c,_0x49549e,_0x519aa9){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x5d238c[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x49549e,null))['then'](function(_0x255acb){if(_0x255acb){return _0x255acb['addSmsAccounts'](_0x5d238c[_0xb84c('0x68')][_0xb84c('0x6c')],_['omit'](_0x5d238c['body'],[_0xb84c('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x49549e,null))[_0xb84c('0x2e')](handleError(_0x49549e,null));};exports[_0xb84c('0x146')]=function(_0x38bb64,_0x3d1e0c,_0x540b2d){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x38bb64[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x3d1e0c,null))[_0xb84c('0x24')](function(_0x5b3c7b){if(_0x5b3c7b){return _0x5b3c7b['removeSmsAccounts'](_0x38bb64[_0xb84c('0x4e')][_0xb84c('0x6c')]);}})[_0xb84c('0x24')](respondWithStatusCode(_0x3d1e0c,null))[_0xb84c('0x2e')](handleError(_0x3d1e0c,null));};exports['getChatWebsites']=function(_0x5ddbc4,_0x4d131a,_0x4e757f){var _0xc40110={};var _0x343d12={};var _0x3f33f6;var _0x52d313;return db['User']['findOne']({'where':{'id':_0x5ddbc4[_0xb84c('0x64')]['id']}})['then'](handleEntityNotFound(_0x4d131a,null))[_0xb84c('0x24')](function(_0x405000){if(_0x405000){_0x3f33f6=_0x405000;_0x343d12[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](db[_0xb84c('0x147')][_0xb84c('0x49')]);_0x343d12[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x5ddbc4[_0xb84c('0x4e')]);_0x343d12[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x343d12[_0xb84c('0x4c')],_0x343d12[_0xb84c('0x4e')]);_0xc40110[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0x343d12[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x5ddbc4[_0xb84c('0x4e')]['fields']));_0xc40110[_0xb84c('0x50')]=_0xc40110[_0xb84c('0x50')][_0xb84c('0x53')]?_0xc40110[_0xb84c('0x50')]:_0x343d12[_0xb84c('0x4c')];_0xc40110[_0xb84c('0xbd')]=qs[_0xb84c('0x55')](_0x5ddbc4[_0xb84c('0x4e')]['sort']);_0xc40110[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_['pick'](_0x5ddbc4[_0xb84c('0x4e')],_0x343d12[_0xb84c('0x4f')]));if(_0x5ddbc4[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0xc40110[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0xc40110[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0xc40110[_0xb84c('0x50')],function(_0x187a48){var _0x4d7265={};_0x4d7265[_0x187a48]={'$like':'%'+_0x5ddbc4['query'][_0xb84c('0x3d')]+'%'};return _0x4d7265;})});}_0xc40110=_[_0xb84c('0x58')]({},_0xc40110,_0x5ddbc4[_0xb84c('0x5d')]);return _0x3f33f6[_0xb84c('0x148')](_0xc40110);}})[_0xb84c('0x24')](function(_0x2c8197){if(_0x2c8197){_0x52d313=_0x2c8197[_0xb84c('0x53')];if(!_0x5ddbc4[_0xb84c('0x4e')]['hasOwnProperty'](_0xb84c('0xc6'))){_0xc40110[_0xb84c('0x32')]=qs[_0xb84c('0x32')](_0x5ddbc4[_0xb84c('0x4e')][_0xb84c('0x32')]);_0xc40110[_0xb84c('0x54')]=qs[_0xb84c('0x54')](_0x5ddbc4[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0x3f33f6[_0xb84c('0x148')](_0xc40110);}})['then'](function(_0x3183ae){if(_0x3183ae){return _0x3183ae?{'count':_0x52d313,'rows':_0x3183ae}:null;}})['then'](respondWithResult(_0x4d131a,null))[_0xb84c('0x2e')](handleError(_0x4d131a,null));};exports[_0xb84c('0x149')]=function(_0x2e67cb,_0x344eeb,_0x456cae){return db['User'][_0xb84c('0x69')]({'where':{'id':_0x2e67cb[_0xb84c('0x64')]['id']}})['then'](handleEntityNotFound(_0x344eeb,null))[_0xb84c('0x24')](function(_0x291ac0){if(_0x291ac0){return _0x291ac0[_0xb84c('0x149')](_0x2e67cb[_0xb84c('0x68')][_0xb84c('0x6c')],_[_0xb84c('0x6d')](_0x2e67cb[_0xb84c('0x68')],[_0xb84c('0x6c'),'id'])||{});}})[_0xb84c('0x24')](respondWithResult(_0x344eeb,null))[_0xb84c('0x2e')](handleError(_0x344eeb,null));};exports[_0xb84c('0x14a')]=function(_0x5588c0,_0x525dc2,_0x3852df){return db['User'][_0xb84c('0x69')]({'where':{'id':_0x5588c0[_0xb84c('0x64')]['id']}})['then'](handleEntityNotFound(_0x525dc2,null))['then'](function(_0xf7c2de){if(_0xf7c2de){return _0xf7c2de[_0xb84c('0x14a')](_0x5588c0['query'][_0xb84c('0x6c')]);}})[_0xb84c('0x24')](respondWithStatusCode(_0x525dc2,null))[_0xb84c('0x2e')](handleError(_0x525dc2,null));};exports['getWhatsappAccounts']=function(_0x3aad39,_0x34f4ed,_0x45866a){var _0x203300={};var _0x32b48e={};var _0x36d6ee;var _0x37f406;return db['User']['findOne']({'where':{'id':_0x3aad39['params']['id']}})['then'](handleEntityNotFound(_0x34f4ed,null))[_0xb84c('0x24')](function(_0x4e7db7){if(_0x4e7db7){_0x36d6ee=_0x4e7db7;_0x32b48e[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](db['WhatsappAccount'][_0xb84c('0x49')]);_0x32b48e['query']=_[_0xb84c('0xbb')](_0x3aad39['query']);_0x32b48e[_0xb84c('0x4f')]=_[_0xb84c('0x51')](_0x32b48e['model'],_0x32b48e[_0xb84c('0x4e')]);_0x203300[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0x32b48e[_0xb84c('0x4c')],qs['fields'](_0x3aad39[_0xb84c('0x4e')]['fields']));_0x203300['attributes']=_0x203300['attributes'][_0xb84c('0x53')]?_0x203300['attributes']:_0x32b48e[_0xb84c('0x4c')];_0x203300['order']=qs['sort'](_0x3aad39[_0xb84c('0x4e')][_0xb84c('0x55')]);_0x203300[_0xb84c('0x56')]=qs['filters'](_['pick'](_0x3aad39[_0xb84c('0x4e')],_0x32b48e[_0xb84c('0x4f')]));if(_0x3aad39[_0xb84c('0x4e')]['filter']){_0x203300[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x203300[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x203300[_0xb84c('0x50')],function(_0x514a62){var _0x56ff53={};_0x56ff53[_0x514a62]={'$like':'%'+_0x3aad39[_0xb84c('0x4e')][_0xb84c('0x3d')]+'%'};return _0x56ff53;})});}_0x203300=_[_0xb84c('0x58')]({},_0x203300,_0x3aad39[_0xb84c('0x5d')]);return _0x36d6ee[_0xb84c('0x14b')](_0x203300);}})[_0xb84c('0x24')](function(_0x7a94fd){if(_0x7a94fd){_0x37f406=_0x7a94fd[_0xb84c('0x53')];if(!_0x3aad39[_0xb84c('0x4e')]['hasOwnProperty']('nolimit')){_0x203300[_0xb84c('0x32')]=qs['limit'](_0x3aad39[_0xb84c('0x4e')][_0xb84c('0x32')]);_0x203300[_0xb84c('0x54')]=qs[_0xb84c('0x54')](_0x3aad39[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0x36d6ee['getWhatsappAccounts'](_0x203300);}})[_0xb84c('0x24')](function(_0x2485f4){if(_0x2485f4){return _0x2485f4?{'count':_0x37f406,'rows':_0x2485f4}:null;}})[_0xb84c('0x24')](respondWithResult(_0x34f4ed,null))[_0xb84c('0x2e')](handleError(_0x34f4ed,null));};exports[_0xb84c('0x14c')]=function(_0xe47f3d,_0xbcce09,_0x3955b9){return db['User'][_0xb84c('0x69')]({'where':{'id':_0xe47f3d[_0xb84c('0x64')]['id']}})['then'](handleEntityNotFound(_0xbcce09,null))[_0xb84c('0x24')](function(_0x55d583){if(_0x55d583){return _0x55d583[_0xb84c('0x14c')](_0xe47f3d[_0xb84c('0x68')]['ids'],_[_0xb84c('0x6d')](_0xe47f3d[_0xb84c('0x68')],[_0xb84c('0x6c'),'id'])||{});}})[_0xb84c('0x24')](respondWithResult(_0xbcce09,null))[_0xb84c('0x2e')](handleError(_0xbcce09,null));};exports[_0xb84c('0x14d')]=function(_0x24b136,_0x4d5c5e,_0x12dd84){return db[_0xb84c('0x48')]['find']({'where':{'id':_0x24b136['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x4d5c5e,null))[_0xb84c('0x24')](function(_0x4d8708){if(_0x4d8708){return _0x4d8708[_0xb84c('0x14d')](_0x24b136[_0xb84c('0x4e')]['ids']);}})[_0xb84c('0x24')](respondWithStatusCode(_0x4d5c5e,null))[_0xb84c('0x2e')](handleError(_0x4d5c5e,null));};exports[_0xb84c('0x14e')]=function(_0x4eeecf,_0xe13b2a,_0x542d8f){var _0x4519c0={};var _0x4a9653={};var _0x4086f3;var _0x245f02;return db[_0xb84c('0x48')]['findOne']({'where':{'id':_0x4eeecf['params']['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0xe13b2a,null))[_0xb84c('0x24')](function(_0x113708){if(_0x113708){_0x4086f3=_0x113708;_0x4a9653[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](db[_0xb84c('0x14f')][_0xb84c('0x49')]);_0x4a9653[_0xb84c('0x4e')]=_[_0xb84c('0xbb')](_0x4eeecf[_0xb84c('0x4e')]);_0x4a9653['filters']=_[_0xb84c('0x51')](_0x4a9653[_0xb84c('0x4c')],_0x4a9653['query']);_0x4519c0[_0xb84c('0x50')]=_[_0xb84c('0x51')](_0x4a9653[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x4eeecf[_0xb84c('0x4e')]['fields']));_0x4519c0[_0xb84c('0x50')]=_0x4519c0['attributes'][_0xb84c('0x53')]?_0x4519c0[_0xb84c('0x50')]:_0x4a9653[_0xb84c('0x4c')];_0x4519c0['order']=qs[_0xb84c('0x55')](_0x4eeecf['query'][_0xb84c('0x55')]);_0x4519c0[_0xb84c('0x56')]=qs['filters'](_[_0xb84c('0x57')](_0x4eeecf[_0xb84c('0x4e')],_0x4a9653['filters']));if(_0x4eeecf[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0x4519c0[_0xb84c('0x56')]=_[_0xb84c('0x58')](_0x4519c0['where'],{'$or':_['map'](_0x4519c0['attributes'],function(_0xa09c2e){var _0x190f6c={};_0x190f6c[_0xa09c2e]={'$like':'%'+_0x4eeecf['query'][_0xb84c('0x3d')]+'%'};return _0x190f6c;})});}_0x4519c0=_[_0xb84c('0x58')]({},_0x4519c0,_0x4eeecf['options']);return _0x4086f3[_0xb84c('0x14e')](_0x4519c0);}})['then'](function(_0x1a0c7f){if(_0x1a0c7f){_0x245f02=_0x1a0c7f[_0xb84c('0x53')];if(!_0x4eeecf['query'][_0xb84c('0xbf')]('nolimit')){_0x4519c0[_0xb84c('0x32')]=qs['limit'](_0x4eeecf['query'][_0xb84c('0x32')]);_0x4519c0[_0xb84c('0x54')]=qs[_0xb84c('0x54')](_0x4eeecf[_0xb84c('0x4e')][_0xb84c('0x54')]);}return _0x4086f3[_0xb84c('0x14e')](_0x4519c0);}})[_0xb84c('0x24')](function(_0x27b3d8){if(_0x27b3d8){return _0x27b3d8?{'count':_0x245f02,'rows':_0x27b3d8}:null;}})[_0xb84c('0x24')](respondWithResult(_0xe13b2a,null))[_0xb84c('0x2e')](handleError(_0xe13b2a,null));};exports[_0xb84c('0x150')]=function(_0x3cc5d8,_0x2b1245,_0x5e5f05){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x3cc5d8[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](handleEntityNotFound(_0x2b1245,null))[_0xb84c('0x24')](function(_0x1242b4){if(_0x1242b4){return _0x1242b4['addSquareProjects'](_0x3cc5d8['body'][_0xb84c('0x6c')],_[_0xb84c('0x6d')](_0x3cc5d8[_0xb84c('0x68')],[_0xb84c('0x6c'),'id'])||{});}})[_0xb84c('0x24')](respondWithResult(_0x2b1245,null))[_0xb84c('0x2e')](handleError(_0x2b1245,null));};exports[_0xb84c('0x151')]=function(_0x41212b,_0x5ab66c,_0x142f08){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x41212b[_0xb84c('0x64')]['id']}})['then'](handleEntityNotFound(_0x5ab66c,null))[_0xb84c('0x24')](function(_0x423763){if(_0x423763){return _0x423763['removeSquareProjects'](_0x41212b[_0xb84c('0x4e')][_0xb84c('0x6c')]);}})[_0xb84c('0x24')](respondWithStatusCode(_0x5ab66c,null))[_0xb84c('0x2e')](handleError(_0x5ab66c,null));};exports[_0xb84c('0x152')]=function(_0x3aafcf,_0xe82ab9){var _0x1cc9ba={},_0x11dfc6={},_0x4dc9b2={'count':0x0,'rows':[]};var _0x124644=db[_0xb84c('0x153')][_0xb84c('0x49')];_0x11dfc6[_0xb84c('0x4c')]=_[_0xb84c('0xbb')](_0x124644);_0x11dfc6['query']=_[_0xb84c('0xbb')](_0x3aafcf[_0xb84c('0x4e')]);_0x11dfc6[_0xb84c('0x4f')]=_['intersection'](_0x11dfc6[_0xb84c('0x4c')],_0x11dfc6[_0xb84c('0x4e')]);_0x11dfc6[_0xb84c('0x4f')]=_[_0xb84c('0x154')](_0x11dfc6['filters'],[_0xb84c('0x155'),_0xb84c('0x156'),_0xb84c('0x157'),_0xb84c('0x158'),_0xb84c('0x159'),_0xb84c('0x15a'),_0xb84c('0x15b'),_0xb84c('0x15c'),_0xb84c('0x15d'),_0xb84c('0x15e'),'$notBetween',_0xb84c('0x15f'),_0xb84c('0x160'),'$like',_0xb84c('0x161'),'$iLike',_0xb84c('0x162'),_0xb84c('0x163'),_0xb84c('0x164'),_0xb84c('0x165'),'$contained',_0xb84c('0x166')]);_0x1cc9ba[_0xb84c('0x50')]=_['intersection'](_0x11dfc6[_0xb84c('0x4c')],qs[_0xb84c('0x52')](_0x3aafcf[_0xb84c('0x4e')][_0xb84c('0x52')]));_0x1cc9ba[_0xb84c('0x50')]=_0x1cc9ba[_0xb84c('0x50')]['length']?_0x1cc9ba[_0xb84c('0x50')]:_0x11dfc6[_0xb84c('0x4c')];if(!_0x3aafcf[_0xb84c('0x4e')][_0xb84c('0xbf')](_0xb84c('0xc6'))){_0x1cc9ba[_0xb84c('0x32')]=qs['limit'](_0x3aafcf[_0xb84c('0x4e')][_0xb84c('0x32')]);_0x1cc9ba[_0xb84c('0x54')]=qs['offset'](_0x3aafcf[_0xb84c('0x4e')][_0xb84c('0x54')]);}_0x1cc9ba[_0xb84c('0xbd')]=qs['sort'](_0x3aafcf['query'][_0xb84c('0x55')]);_0x1cc9ba[_0xb84c('0x56')]=qs[_0xb84c('0x4f')](_[_0xb84c('0x57')](_0x3aafcf[_0xb84c('0x4e')],_0x11dfc6[_0xb84c('0x4f')]));if(_0x3aafcf[_0xb84c('0x4e')][_0xb84c('0x3d')]){_0x1cc9ba[_0xb84c('0x56')]=_['merge'](_0x1cc9ba[_0xb84c('0x56')],{'$or':_[_0xb84c('0x3e')](_0x1cc9ba['attributes'],function(_0x8dc247){var _0x353cdd={};_0x353cdd[_0x8dc247]={'$like':'%'+_0x3aafcf[_0xb84c('0x4e')][_0xb84c('0x3d')]+'%'};return _0x353cdd;})});}_0x1cc9ba[_0xb84c('0x56')]={'$and':[_0x1cc9ba[_0xb84c('0x56')],{'$or':[{'UserId':_0x3aafcf[_0xb84c('0x64')]['id']},{'OwnerId':_0x3aafcf[_0xb84c('0x64')]['id']}]}]};_0x1cc9ba=_[_0xb84c('0x58')]({},_0x1cc9ba,_0x3aafcf[_0xb84c('0x5d')]);var _0x4a2f27={'where':_0x1cc9ba[_0xb84c('0x56')]};return db['CmHopper'][_0xb84c('0x5e')](_0x4a2f27)[_0xb84c('0x24')](function(_0x11a2e8){_0x4dc9b2[_0xb84c('0x5e')]=_0x11a2e8;if(_0x3aafcf['query'][_0xb84c('0x5f')]){_0x1cc9ba[_0xb84c('0x60')]=[{'attributes':['id',_0xb84c('0x167'),_0xb84c('0x168'),_0xb84c('0xdc')],'model':db['CmContact'],'as':_0xb84c('0x169')},{'attributes':['id',_0xb84c('0x45'),_0xb84c('0x16a')],'model':db[_0xb84c('0xa9')],'as':_0xb84c('0xc8')}];}return db[_0xb84c('0x153')]['findAll'](_0x1cc9ba);})[_0xb84c('0x24')](function(_0x3206f3){_0x4dc9b2['rows']=_0x3206f3;return _0x4dc9b2;})[_0xb84c('0x24')](respondWithFilteredResult(_0xe82ab9,_0x1cc9ba))['catch'](handleError(_0xe82ab9,null));};exports[_0xb84c('0x16b')]=function(_0x52dfe3,_0x51edb2,_0x2e4f6c){if(!_[_0xb84c('0x74')](_0x52dfe3['user']['id'])&&(_0x52dfe3[_0xb84c('0x70')][_0xb84c('0x41')]==_0xb84c('0x6f')||_0x52dfe3[_0xb84c('0x70')]['role']=='user')){return db[_0xb84c('0x48')][_0xb84c('0x95')]({'where':{'id':_0x52dfe3['params']['id']},'raw':!![]})[_0xb84c('0x24')](function(_0x1acd39){return authService[_0xb84c('0x16c')](_0x1acd39);})[_0xb84c('0x24')](function(_0x25b0d1){if(_0x25b0d1){return _0x51edb2[_0xb84c('0x30')](0xc8)[_0xb84c('0x31')]({'api_key':_0x25b0d1[_0xb84c('0x16d')]});}else{return _0x51edb2['status'](0xcc)[_0xb84c('0x31')]({'message':_0xb84c('0x16e')});}})['catch'](handleError(_0x51edb2,0x193));}else{return _0x51edb2[_0xb84c('0x30')](0x191)[_0xb84c('0x31')]({'message':_0xb84c('0x16f')});}};exports[_0xb84c('0x170')]=function(_0x40b93e,_0x646e9b,_0x420909){if(!_[_0xb84c('0x74')](_0x40b93e['user']['id'])&&(_0x40b93e[_0xb84c('0x70')][_0xb84c('0x41')]==_0xb84c('0x6f')||_0x40b93e[_0xb84c('0x70')][_0xb84c('0x41')]==_0xb84c('0x70'))){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x40b93e[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](function(_0x1747fb){return authService['generateApiKey'](_0x1747fb);})[_0xb84c('0x24')](function(_0x5d4ed2){return db['User'][_0xb84c('0x37')]({'apiKeyIat':_0x5d4ed2['iat'],'apiKeyNonce':_0x5d4ed2['nonce']},{'where':{'id':_0x40b93e[_0xb84c('0x64')]['id']}})[_0xb84c('0x24')](function(){return _0x646e9b['status'](0xc8)[_0xb84c('0x31')]({'api_key':_0x5d4ed2[_0xb84c('0x16d')]});});})[_0xb84c('0x2e')](handleError(_0x646e9b,0x193));}else{return _0x646e9b['status'](0x191)[_0xb84c('0x31')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports['removeApiKey']=function(_0x5f5d2b,_0x1006fe,_0x8b609a){if(!_['isNil'](_0x5f5d2b[_0xb84c('0x70')]['id'])&&(_0x5f5d2b[_0xb84c('0x70')]['role']==_0xb84c('0x6f')||_0x5f5d2b[_0xb84c('0x70')][_0xb84c('0x41')]==_0xb84c('0x70'))){return db[_0xb84c('0x48')][_0xb84c('0x69')]({'where':{'id':_0x5f5d2b[_0xb84c('0x64')]['id']}})['then'](handleEntityNotFound(_0x1006fe,null))[_0xb84c('0x24')](function(_0x69a8f){if(_0x69a8f&&_0x69a8f['apiKeyNonce']&&_0x69a8f[_0xb84c('0x171')])return _0x69a8f;else throw{'message':_0xb84c('0x172')};})['then'](function(_0x348f0a){return db[_0xb84c('0x48')][_0xb84c('0x37')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x5f5d2b[_0xb84c('0x64')]['id']}});})['then'](respondWithStatusCode(_0x1006fe,0xc8))['catch'](handleError(_0x1006fe,0x193));}else{return _0x1006fe[_0xb84c('0x30')](0x191)[_0xb84c('0x31')]({'message':_0xb84c('0x16f')});}};exports[_0xb84c('0x173')]=function(_0x7939e3,_0x3342ef){var _0x1461b6=_0x7939e3[_0xb84c('0x70')][_0xb84c('0x8f')]({'plain':!![]});if(!_0x1461b6){return _0x3342ef[_0xb84c('0x30')](0x191)[_0xb84c('0x46')]('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{return _0x3342ef[_0xb84c('0x30')](0xc8)[_0xb84c('0x31')](_0x1461b6);}};
\ No newline at end of file
index 1c19ebc..303860e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cda=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','User','setMaxListeners','save','update'];(function(_0xc95c4c,_0x5e7ac){var _0x1ef11c=function(_0x371c76){while(--_0x371c76){_0xc95c4c['push'](_0xc95c4c['shift']());}};_0x1ef11c(++_0x5e7ac);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var User=require(_0xa8cd('0x0'))['db'][_0xa8cd('0x1')];var UserEvents=new EventEmitter();UserEvents[_0xa8cd('0x2')](0x0);var events={'afterCreate':_0xa8cd('0x3'),'afterUpdate':_0xa8cd('0x4'),'afterDestroy':_0xa8cd('0x5')};function emitEvent(_0x52a4ca){return function(_0x4116cf,_0x402139,_0x318ac3){UserEvents['emit'](_0x52a4ca+':'+_0x4116cf['id'],_0x4116cf);UserEvents[_0xa8cd('0x6')](_0x52a4ca,_0x4116cf);_0x318ac3(null);};}for(var e in events){if(events[_0xa8cd('0x7')](e)){var event=events[e];User[_0xa8cd('0x8')](e,emitEvent(event));}}module[_0xa8cd('0x9')]=UserEvents;
\ No newline at end of file
+var _0x3fc6=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','User'];(function(_0x309394,_0x12bb10){var _0x5bc4e7=function(_0x5884ba){while(--_0x5884ba){_0x309394['push'](_0x309394['shift']());}};_0x5bc4e7(++_0x12bb10);}(_0x3fc6,0x115));var _0x63fc=function(_0x400d92,_0x2cbf95){_0x400d92=_0x400d92-0x0;var _0x5350c5=_0x3fc6[_0x400d92];return _0x5350c5;};'use strict';var EventEmitter=require(_0x63fc('0x0'));var User=require('../../mysqldb')['db'][_0x63fc('0x1')];var UserEvents=new EventEmitter();UserEvents[_0x63fc('0x2')](0x0);var events={'afterCreate':_0x63fc('0x3'),'afterUpdate':_0x63fc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ceadb){return function(_0x26d57e,_0x237af7,_0x5ce071){UserEvents[_0x63fc('0x5')](_0x3ceadb+':'+_0x26d57e['id'],_0x26d57e);UserEvents['emit'](_0x3ceadb,_0x26d57e);_0x5ce071(null);};}for(var e in events){if(events[_0x63fc('0x6')](e)){var event=events[e];User[_0x63fc('0x7')](e,emitEvent(event));}}module[_0x63fc('0x8')]=UserEvents;
\ No newline at end of file
index 21e6288..15ec814 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2421=['length','context','system','format','%s%s','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','ChanSpy','SIP/%s,%s','name','options','join','from-sip','CDR(type)=internal','includes','_XCALLY_MIXMONITOR_FORMAT=%s','extensionMonitor','Dial','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','findAll','then','internal','concat','catch','exports','User','users','utf8','utf8_bin','updateMd5Password','changed','password','updatePassword','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync','pbkdf2','sha1','indexOf','provider','makeSalt',':asterisk:','md5secret','bluebird','crypto','util','md5','lodash','./user.attributes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2421,0x1d6));var _0x1242=function(_0x51580a,_0x37d0e2){_0x51580a=_0x51580a-0x0;var _0xc9367e=_0x2421[_0x51580a];return _0xc9367e;};'use strict';var BPromise=require(_0x1242('0x0'));var crypto=require(_0x1242('0x1'));var util=require(_0x1242('0x2'));var md5=require(_0x1242('0x3'));var _=require(_0x1242('0x4'));var attributes=require(_0x1242('0x5'));var authTypes=['google'];var validatePresenceOf=function(_0x12398e){return _0x12398e&&_0x12398e[_0x1242('0x6')];};var getChanSpyApplications=function(_0x2678a2,_0x48813d,_0xc5c45e){var _0x4713fd={'context':_0x2678a2[_0x1242('0x7')]||'from-sip','type':_0x1242('0x8'),'isApp':![],'UserId':_0x2678a2['id']};var _0x331807=[];for(var _0x1d17f1=0x0,_0x313626=0x1;_0x1d17f1<_0xc5c45e[_0x1242('0x6')];_0x1d17f1++,_0x313626=0x1){var _0x172af6={'exten':util[_0x1242('0x9')](_0x1242('0xa'),_0xc5c45e[_0x1d17f1]['prefix'],_0x48813d),'ChanSpyId':_0xc5c45e[_0x1d17f1]['id']};_0x331807[_0x1242('0xb')](_[_0x1242('0xc')]({'app':_0x1242('0xd'),'appdata':util[_0x1242('0x9')](_0x1242('0xe'),_0x1242('0xf')),'priority':_0x313626++},_0x4713fd,_0x172af6));if(_0xc5c45e[_0x1d17f1][_0x1242('0x10')]){_0x331807[_0x1242('0xb')](_[_0x1242('0xc')]({'app':_0x1242('0x11'),'appdata':util[_0x1242('0x9')]('${UNIQUEID}.%s,a',_0xc5c45e[_0x1d17f1][_0x1242('0x12')]),'priority':_0x313626++},_0x4713fd,_0x172af6));}if(_0xc5c45e[_0x1d17f1][_0x1242('0x13')]){_0x331807['push'](_[_0x1242('0xc')]({'app':'Authenticate','appdata':_0xc5c45e[_0x1d17f1]['password'],'priority':_0x313626++},_0x4713fd,_0x172af6));}_0x331807[_0x1242('0xb')](_[_0x1242('0xc')]({'app':_0x1242('0x14'),'appdata':util[_0x1242('0x9')](_0x1242('0x15'),_0x2678a2[_0x1242('0x16')],_0xc5c45e[_0x1d17f1][_0x1242('0x17')]?_0xc5c45e[_0x1d17f1][_0x1242('0x17')][_0x1242('0x18')](''):''),'priority':_0x313626++},_0x4713fd,_0x172af6));if(_0xc5c45e[_0x1d17f1][_0x1242('0x10')]){_0x331807[_0x1242('0xb')](_[_0x1242('0xc')]({'app':'StopMixMonitor','priority':_0x313626++},_0x4713fd,_0x172af6));}}return _0x331807;};var getUserApplications=function(_0x5d4d82,_0x5ba643){var _0x1d0ba1=['wav','WAV','gsm'];var _0x175e2b={'context':_0x5d4d82[_0x1242('0x7')]||_0x1242('0x19'),'exten':_0x5ba643,'type':'system','isApp':![],'UserId':_0x5d4d82['id']};var _0x1c850d=[{'app':'Set','appdata':_0x1242('0x1a')}];if(_0x5d4d82['extensionMonitor']&&_[_0x1242('0x1b')](_0x1d0ba1,_0x5d4d82['extensionMonitor'])){_0x1c850d['push']({'app':_0x1242('0xd'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0x1c850d[_0x1242('0xb')]({'app':'Set','appdata':util['format'](_0x1242('0x1c'),_0x5d4d82[_0x1242('0x1d')])});_0x1c850d[_0x1242('0xb')]({'app':_0x1242('0x1e'),'appdata':util[_0x1242('0x9')]('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x5d4d82['name'])});}else{_0x1c850d[_0x1242('0xb')]({'app':_0x1242('0x1e'),'appdata':util['format'](_0x1242('0x1f'),_0x5d4d82[_0x1242('0x16')])});}_0x1c850d[_0x1242('0xb')]({'app':_0x1242('0x20')});for(var _0xa9533d=0x0;_0xa9533d<_0x1c850d[_0x1242('0x6')];_0xa9533d++){_0x1c850d[_0xa9533d][_0x1242('0x21')]=_0xa9533d+0x1;_0x1c850d[_0xa9533d]=_[_0x1242('0x22')](_0x1c850d[_0xa9533d],_0x175e2b);}return _0x1c850d;};var getChanSpyPromise=function(_0x283dc1,_0x5f40bf){return new BPromise(function(_0x2eaa00,_0x902213){return _0x283dc1[_0x1242('0x23')][_0x1242('0x24')]()[_0x1242('0x25')](function(_0x28134d){if(_0x28134d){var _0x53e83a=getChanSpyApplications(_0x5f40bf,_0x5f40bf[_0x1242('0x26')],_0x28134d);if(_0x5f40bf['internal']!=_0x5f40bf[_0x1242('0x16')]){_0x53e83a=_0x53e83a[_0x1242('0x27')](getChanSpyApplications(_0x5f40bf,_0x5f40bf[_0x1242('0x16')],_0x28134d));}return _0x2eaa00(_0x53e83a);}return _0x2eaa00([]);})[_0x1242('0x28')](function(_0x36b588){_0x902213(_0x36b588);});});};module[_0x1242('0x29')]=function(_0x264669,_0x33f0c7){var _0x1deca4=_0x264669['models'];return _0x264669['define'](_0x1242('0x2a'),attributes,{'tableName':_0x1242('0x2b'),'charset':_0x1242('0x2c'),'collate':_0x1242('0x2d'),'hooks':{'beforeCreate':function(_0x44a6d6,_0x20ac1d,_0x54786c){_0x44a6d6[_0x1242('0x2e')]();_0x44a6d6['updatePassword'](_0x54786c);},'beforeUpdate':function(_0x27d5f9,_0x319ea1,_0x2438ff){if(_0x27d5f9[_0x1242('0x2f')](_0x1242('0x30'))){_0x27d5f9[_0x1242('0x2e')]();return _0x27d5f9[_0x1242('0x31')](_0x2438ff);}_0x2438ff();},'afterCreate':function(_0x37dbd8,_0x2f258e,_0x5060d7){var _0x5bdba4=getUserApplications(_0x37dbd8,_0x37dbd8['internal']);if(_0x37dbd8['internal']!=_0x37dbd8['name']){_0x5bdba4=_0x5bdba4[_0x1242('0x27')](getUserApplications(_0x37dbd8,_0x37dbd8[_0x1242('0x16')]));}return _0x1deca4[_0x1242('0x32')]['bulkCreate'](_0x5bdba4)[_0x1242('0x25')](function(){if(_0x37dbd8['chanspy']){return getChanSpyPromise(_0x1deca4,_0x37dbd8);}})[_0x1242('0x25')](function(_0x5e67b2){if(_0x5e67b2&&_0x5e67b2[_0x1242('0x6')]){return _0x1deca4[_0x1242('0x32')]['bulkCreate'](_0x5e67b2);}})[_0x1242('0x25')](function(){_0x5060d7();})[_0x1242('0x28')](function(_0x35c5be){_0x5060d7(_0x35c5be);});},'afterUpdate':function(_0x3aecd0,_0x2bbc45,_0x4c6dff){return BPromise['resolve']()['then'](function(){if(_0x3aecd0['changed'](_0x1242('0xf'))||_0x3aecd0['changed'](_0x1242('0x7'))){return _0x1deca4[_0x1242('0x32')]['destroy']({'where':{'UserId':_0x3aecd0['id'],'type':_0x1242('0x8'),'ChanSpyId':{'$ne':null}}})[_0x1242('0x25')](function(){if(_0x3aecd0[_0x1242('0xf')]){return getChanSpyPromise(_0x1deca4,_0x3aecd0)[_0x1242('0x25')](function(_0x5228d4){if(_0x5228d4&&_0x5228d4[_0x1242('0x6')]){return _0x1deca4[_0x1242('0x32')][_0x1242('0x33')](_0x5228d4);}});}});}})[_0x1242('0x25')](function(){if(_0x3aecd0[_0x1242('0x2f')](_0x1242('0x1d'))||_0x3aecd0[_0x1242('0x2f')](_0x1242('0x7'))){return _0x1deca4[_0x1242('0x32')][_0x1242('0x34')]({'where':{'UserId':_0x3aecd0['id'],'type':'system','ChanSpyId':null}})[_0x1242('0x25')](function(){var _0x3e9551=getUserApplications(_0x3aecd0,_0x3aecd0[_0x1242('0x26')]);if(_0x3aecd0['internal']!=_0x3aecd0[_0x1242('0x16')]){_0x3e9551=_0x3e9551['concat'](getUserApplications(_0x3aecd0,_0x3aecd0[_0x1242('0x16')]));}return _0x1deca4[_0x1242('0x32')][_0x1242('0x33')](_0x3e9551);});}})[_0x1242('0x25')](function(){_0x4c6dff();})[_0x1242('0x28')](function(_0xfe2507){_0x4c6dff(_0xfe2507);});},'afterDestroy':function(_0x382d8c,_0x97901a){return _0x1deca4[_0x1242('0x32')][_0x1242('0x34')]({'where':{'UserId':_0x382d8c['id'],'type':_0x1242('0x8')}});}},'instanceMethods':{'authenticate':function(_0x3000f4,_0x3f378b){if(!_0x3f378b){return this[_0x1242('0x30')]===this['encryptPassword'](_0x3000f4);}var _0x4bf1f3=this;this[_0x1242('0x35')](_0x3000f4,function(_0x51e04c,_0x1ba20d){if(_0x51e04c){_0x3f378b(_0x51e04c);}if(_0x4bf1f3[_0x1242('0x30')]===_0x1ba20d){_0x3f378b(null,!![]);}else{_0x3f378b(null,![]);}});},'makeSalt':function(_0x27f027,_0x3e238d){var _0x13fc0c=0x10;if(typeof arguments[0x0]===_0x1242('0x36')){_0x3e238d=arguments[0x0];_0x27f027=_0x13fc0c;}else if(typeof arguments[0x1]===_0x1242('0x36')){_0x3e238d=arguments[0x1];}else{throw new Error(_0x1242('0x37'));}if(!_0x27f027){_0x27f027=_0x13fc0c;}return crypto[_0x1242('0x38')](_0x27f027,function(_0x356c15,_0xfd6653){if(_0x356c15){_0x3e238d(_0x356c15);}return _0x3e238d(null,_0xfd6653[_0x1242('0x39')](_0x1242('0x3a')));});},'encryptPassword':function(_0x17156a,_0x5e25d0){if(!_0x17156a||!this[_0x1242('0x3b')]){return _0x5e25d0?_0x5e25d0(null):null;}var _0x3f463d=0x2710;var _0x2f5a30=0x40;var _0x475c97=new Buffer(this[_0x1242('0x3b')],'base64');if(!_0x5e25d0){return crypto[_0x1242('0x3c')](_0x17156a,_0x475c97,_0x3f463d,_0x2f5a30,'sha1')['toString'](_0x1242('0x3a'));}return crypto[_0x1242('0x3d')](_0x17156a,_0x475c97,_0x3f463d,_0x2f5a30,_0x1242('0x3e'),function(_0x16050e,_0xf3551a){if(_0x16050e){_0x5e25d0(_0x16050e);}return _0x5e25d0(null,_0xf3551a[_0x1242('0x39')](_0x1242('0x3a')));});},'updatePassword':function(_0x19be90){if(!this[_0x1242('0x30')]){return _0x19be90(null);}if(!validatePresenceOf(this['password'])&&authTypes[_0x1242('0x3f')](this[_0x1242('0x40')])===-0x1){_0x19be90(new Error('Invalid\x20password'));}var _0x853853=this;this[_0x1242('0x41')](function(_0x322276,_0x5c53e){if(_0x322276){return _0x19be90(_0x322276);}_0x853853['salt']=_0x5c53e;_0x853853[_0x1242('0x35')](_0x853853[_0x1242('0x30')],function(_0x52f492,_0x5b6b33){if(_0x52f492){_0x19be90(_0x52f492);}_0x853853[_0x1242('0x30')]=_0x5b6b33;_0x19be90(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this[_0x1242('0x16')]+_0x1242('0x42')+this[_0x1242('0x30')]);return this[_0x1242('0x43')];}}});};
\ No newline at end of file
+var _0x21f9=['md5secret',':asterisk:','util','md5','lodash','./user.attributes','google','length','context','from-sip','system','%s%s','prefix','push','merge','Set','format','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','options','join','WAV','gsm','CDR(type)=internal','includes','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','SIP/%s,,tTxXU(xcally-mixmonitor-context)','name','Dial','Hangup','priority','defaults','findAll','then','internal','concat','catch','exports','models','define','users','utf8','updateMd5Password','updatePassword','VoiceExtension','bulkCreate','resolve','changed','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','indexOf','provider','Invalid\x20password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21f9,0x16a));var _0x921f=function(_0x23b761,_0x520ff1){_0x23b761=_0x23b761-0x0;var _0x59dee9=_0x21f9[_0x23b761];return _0x59dee9;};'use strict';var BPromise=require('bluebird');var crypto=require('crypto');var util=require(_0x921f('0x0'));var md5=require(_0x921f('0x1'));var _=require(_0x921f('0x2'));var attributes=require(_0x921f('0x3'));var authTypes=[_0x921f('0x4')];var validatePresenceOf=function(_0x4849a9){return _0x4849a9&&_0x4849a9[_0x921f('0x5')];};var getChanSpyApplications=function(_0x151f5b,_0x10e201,_0x2d9279){var _0x7cbcde={'context':_0x151f5b[_0x921f('0x6')]||_0x921f('0x7'),'type':_0x921f('0x8'),'isApp':![],'UserId':_0x151f5b['id']};var _0x424b56=[];for(var _0x11f69e=0x0,_0x2b54d8=0x1;_0x11f69e<_0x2d9279['length'];_0x11f69e++,_0x2b54d8=0x1){var _0x597c59={'exten':util['format'](_0x921f('0x9'),_0x2d9279[_0x11f69e][_0x921f('0xa')],_0x10e201),'ChanSpyId':_0x2d9279[_0x11f69e]['id']};_0x424b56[_0x921f('0xb')](_[_0x921f('0xc')]({'app':_0x921f('0xd'),'appdata':util[_0x921f('0xe')](_0x921f('0xf'),_0x921f('0x10')),'priority':_0x2b54d8++},_0x7cbcde,_0x597c59));if(_0x2d9279[_0x11f69e][_0x921f('0x11')]){_0x424b56[_0x921f('0xb')](_['merge']({'app':_0x921f('0x12'),'appdata':util[_0x921f('0xe')](_0x921f('0x13'),_0x2d9279[_0x11f69e][_0x921f('0x14')]),'priority':_0x2b54d8++},_0x7cbcde,_0x597c59));}if(_0x2d9279[_0x11f69e][_0x921f('0x15')]){_0x424b56[_0x921f('0xb')](_[_0x921f('0xc')]({'app':'Authenticate','appdata':_0x2d9279[_0x11f69e][_0x921f('0x16')],'priority':_0x2b54d8++},_0x7cbcde,_0x597c59));}_0x424b56[_0x921f('0xb')](_[_0x921f('0xc')]({'app':_0x921f('0x17'),'appdata':util['format'](_0x921f('0x18'),_0x151f5b['name'],_0x2d9279[_0x11f69e][_0x921f('0x19')]?_0x2d9279[_0x11f69e][_0x921f('0x19')][_0x921f('0x1a')](''):''),'priority':_0x2b54d8++},_0x7cbcde,_0x597c59));if(_0x2d9279[_0x11f69e][_0x921f('0x11')]){_0x424b56['push'](_[_0x921f('0xc')]({'app':'StopMixMonitor','priority':_0x2b54d8++},_0x7cbcde,_0x597c59));}}return _0x424b56;};var getUserApplications=function(_0x21182f,_0x2bb27){var _0x2179e5=['wav',_0x921f('0x1b'),_0x921f('0x1c')];var _0x20f741={'context':_0x21182f['context']||_0x921f('0x7'),'exten':_0x2bb27,'type':_0x921f('0x8'),'isApp':![],'UserId':_0x21182f['id']};var _0x5a922c=[{'app':_0x921f('0xd'),'appdata':_0x921f('0x1d')}];if(_0x21182f['extensionMonitor']&&_[_0x921f('0x1e')](_0x2179e5,_0x21182f[_0x921f('0x1f')])){_0x5a922c[_0x921f('0xb')]({'app':_0x921f('0xd'),'appdata':_0x921f('0x20')});_0x5a922c[_0x921f('0xb')]({'app':_0x921f('0xd'),'appdata':util[_0x921f('0xe')](_0x921f('0x21'),_0x21182f[_0x921f('0x1f')])});_0x5a922c[_0x921f('0xb')]({'app':'Dial','appdata':util[_0x921f('0xe')](_0x921f('0x22'),_0x21182f[_0x921f('0x23')])});}else{_0x5a922c[_0x921f('0xb')]({'app':_0x921f('0x24'),'appdata':util[_0x921f('0xe')]('SIP/%s,,tTxX',_0x21182f[_0x921f('0x23')])});}_0x5a922c[_0x921f('0xb')]({'app':_0x921f('0x25')});for(var _0x4278a4=0x0;_0x4278a4<_0x5a922c[_0x921f('0x5')];_0x4278a4++){_0x5a922c[_0x4278a4][_0x921f('0x26')]=_0x4278a4+0x1;_0x5a922c[_0x4278a4]=_[_0x921f('0x27')](_0x5a922c[_0x4278a4],_0x20f741);}return _0x5a922c;};var getChanSpyPromise=function(_0x5f5007,_0x20c6a7){return new BPromise(function(_0x402bf2,_0x488ace){return _0x5f5007['VoiceChanSpy'][_0x921f('0x28')]()[_0x921f('0x29')](function(_0x4ed893){if(_0x4ed893){var _0x4e577f=getChanSpyApplications(_0x20c6a7,_0x20c6a7['internal'],_0x4ed893);if(_0x20c6a7[_0x921f('0x2a')]!=_0x20c6a7['name']){_0x4e577f=_0x4e577f[_0x921f('0x2b')](getChanSpyApplications(_0x20c6a7,_0x20c6a7[_0x921f('0x23')],_0x4ed893));}return _0x402bf2(_0x4e577f);}return _0x402bf2([]);})[_0x921f('0x2c')](function(_0x1189fd){_0x488ace(_0x1189fd);});});};module[_0x921f('0x2d')]=function(_0x3da2ca,_0x4cdccf){var _0x53b2d5=_0x3da2ca[_0x921f('0x2e')];return _0x3da2ca[_0x921f('0x2f')]('User',attributes,{'tableName':_0x921f('0x30'),'charset':_0x921f('0x31'),'collate':'utf8_bin','hooks':{'beforeCreate':function(_0x461eef,_0x43197a,_0x117903){_0x461eef[_0x921f('0x32')]();_0x461eef['updatePassword'](_0x117903);},'beforeUpdate':function(_0x230eaa,_0x6ef5f9,_0x11e60d){if(_0x230eaa['changed'](_0x921f('0x16'))){_0x230eaa[_0x921f('0x32')]();return _0x230eaa[_0x921f('0x33')](_0x11e60d);}_0x11e60d();},'afterCreate':function(_0x10c33a,_0x13ac97,_0x51e87f){var _0x365bcf=getUserApplications(_0x10c33a,_0x10c33a['internal']);if(_0x10c33a['internal']!=_0x10c33a['name']){_0x365bcf=_0x365bcf[_0x921f('0x2b')](getUserApplications(_0x10c33a,_0x10c33a['name']));}return _0x53b2d5[_0x921f('0x34')][_0x921f('0x35')](_0x365bcf)[_0x921f('0x29')](function(){if(_0x10c33a['chanspy']){return getChanSpyPromise(_0x53b2d5,_0x10c33a);}})[_0x921f('0x29')](function(_0x4dd40b){if(_0x4dd40b&&_0x4dd40b[_0x921f('0x5')]){return _0x53b2d5['VoiceExtension'][_0x921f('0x35')](_0x4dd40b);}})[_0x921f('0x29')](function(){_0x51e87f();})[_0x921f('0x2c')](function(_0x59d32f){_0x51e87f(_0x59d32f);});},'afterUpdate':function(_0x115173,_0x641003,_0xe71394){return BPromise[_0x921f('0x36')]()[_0x921f('0x29')](function(){if(_0x115173['changed'](_0x921f('0x10'))||_0x115173[_0x921f('0x37')](_0x921f('0x6'))){return _0x53b2d5[_0x921f('0x34')][_0x921f('0x38')]({'where':{'UserId':_0x115173['id'],'type':'system','ChanSpyId':{'$ne':null}}})[_0x921f('0x29')](function(){if(_0x115173[_0x921f('0x10')]){return getChanSpyPromise(_0x53b2d5,_0x115173)[_0x921f('0x29')](function(_0x3c0c3b){if(_0x3c0c3b&&_0x3c0c3b['length']){return _0x53b2d5['VoiceExtension'][_0x921f('0x35')](_0x3c0c3b);}});}});}})[_0x921f('0x29')](function(){if(_0x115173[_0x921f('0x37')](_0x921f('0x1f'))||_0x115173['changed']('context')){return _0x53b2d5[_0x921f('0x34')][_0x921f('0x38')]({'where':{'UserId':_0x115173['id'],'type':_0x921f('0x8'),'ChanSpyId':null}})[_0x921f('0x29')](function(){var _0x37db5c=getUserApplications(_0x115173,_0x115173[_0x921f('0x2a')]);if(_0x115173['internal']!=_0x115173[_0x921f('0x23')]){_0x37db5c=_0x37db5c[_0x921f('0x2b')](getUserApplications(_0x115173,_0x115173['name']));}return _0x53b2d5[_0x921f('0x34')][_0x921f('0x35')](_0x37db5c);});}})[_0x921f('0x29')](function(){_0xe71394();})[_0x921f('0x2c')](function(_0x292d7b){_0xe71394(_0x292d7b);});},'afterDestroy':function(_0x4fe292,_0x3e4861){return _0x53b2d5[_0x921f('0x34')][_0x921f('0x38')]({'where':{'UserId':_0x4fe292['id'],'type':_0x921f('0x8')}});}},'instanceMethods':{'authenticate':function(_0x5d9206,_0x4b5214){if(!_0x4b5214){return this[_0x921f('0x16')]===this[_0x921f('0x39')](_0x5d9206);}var _0x472f53=this;this[_0x921f('0x39')](_0x5d9206,function(_0x42d9df,_0x4df323){if(_0x42d9df){_0x4b5214(_0x42d9df);}if(_0x472f53[_0x921f('0x16')]===_0x4df323){_0x4b5214(null,!![]);}else{_0x4b5214(null,![]);}});},'makeSalt':function(_0x36c7d5,_0x13fefe){var _0x55b14a=0x10;if(typeof arguments[0x0]===_0x921f('0x3a')){_0x13fefe=arguments[0x0];_0x36c7d5=_0x55b14a;}else if(typeof arguments[0x1]==='function'){_0x13fefe=arguments[0x1];}else{throw new Error(_0x921f('0x3b'));}if(!_0x36c7d5){_0x36c7d5=_0x55b14a;}return crypto[_0x921f('0x3c')](_0x36c7d5,function(_0x1e09a4,_0xcda408){if(_0x1e09a4){_0x13fefe(_0x1e09a4);}return _0x13fefe(null,_0xcda408[_0x921f('0x3d')](_0x921f('0x3e')));});},'encryptPassword':function(_0x4d6691,_0x58e40b){if(!_0x4d6691||!this[_0x921f('0x3f')]){return _0x58e40b?_0x58e40b(null):null;}var _0x4e5d20=0x2710;var _0x57e302=0x40;var _0x5b6ea9=new Buffer(this['salt'],_0x921f('0x3e'));if(!_0x58e40b){return crypto[_0x921f('0x40')](_0x4d6691,_0x5b6ea9,_0x4e5d20,_0x57e302,_0x921f('0x41'))['toString'](_0x921f('0x3e'));}return crypto[_0x921f('0x42')](_0x4d6691,_0x5b6ea9,_0x4e5d20,_0x57e302,_0x921f('0x41'),function(_0x8a1537,_0x4bce9a){if(_0x8a1537){_0x58e40b(_0x8a1537);}return _0x58e40b(null,_0x4bce9a['toString'](_0x921f('0x3e')));});},'updatePassword':function(_0x1cadd6){if(!this[_0x921f('0x16')]){return _0x1cadd6(null);}if(!validatePresenceOf(this[_0x921f('0x16')])&&authTypes[_0x921f('0x43')](this[_0x921f('0x44')])===-0x1){_0x1cadd6(new Error(_0x921f('0x45')));}var _0x4437df=this;this['makeSalt'](function(_0x15a79a,_0x91e2cd){if(_0x15a79a){return _0x1cadd6(_0x15a79a);}_0x4437df['salt']=_0x91e2cd;_0x4437df[_0x921f('0x39')](_0x4437df['password'],function(_0x2de3ac,_0x1461eb){if(_0x2de3ac){_0x1cadd6(_0x2de3ac);}_0x4437df[_0x921f('0x16')]=_0x1461eb;_0x1cadd6(null);});});},'updateMd5Password':function(){this[_0x921f('0x46')]=md5(this['name']+_0x921f('0x47')+this['password']);return this[_0x921f('0x46')];}}});};
\ No newline at end of file
index 7e5c68f..894a11b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5e1=['map','ShowUser','find','stringify','PauseUser','name','internal','interface','UserVoiceQueueRt','update','MemberReport','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','forEach','push','isNil','SIP/%s','PAUSE','type','DEFAULT\x20PAUSE','role','body','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','system','mail','chat','fax','sms','set','%s%s','Pause','all','LogoutUser','destroy','LoginUser','phone','loginInPause','count','agent','getLicense','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','include','model'];(function(_0x307bcf,_0x7072c1){var _0x15d4bc=function(_0x4962dc){while(--_0x4962dc){_0x307bcf['push'](_0x307bcf['shift']());}};_0x15d4bc(++_0x7072c1);}(_0xf5e1,0x14e));var _0x1f5e=function(_0x473a79,_0x5e608b){_0x473a79=_0x473a79-0x0;var _0x5a91b3=_0xf5e1[_0x473a79];return _0x5a91b3;};'use strict';var _=require('lodash');var util=require(_0x1f5e('0x0'));var moment=require(_0x1f5e('0x1'));var BPromise=require(_0x1f5e('0x2'));var rs=require(_0x1f5e('0x3'));var fs=require('fs');var Redis=require(_0x1f5e('0x4'));var db=require(_0x1f5e('0x5'))['db'];var utils=require(_0x1f5e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1f5e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1f5e('0x8')][_0x1f5e('0x9')]({'port':0x232a});config[_0x1f5e('0xa')]=_[_0x1f5e('0xb')](config['redis'],{'host':_0x1f5e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./user.socket')[_0x1f5e('0xd')](socket);function respondWithRpcPromise(_0x57d9b5,_0x27320d,_0x3f6c6b){return new BPromise(function(_0x33150f,_0x4647ed){return client[_0x1f5e('0xe')](_0x57d9b5,_0x3f6c6b)[_0x1f5e('0xf')](function(_0x3315cc){logger[_0x1f5e('0x10')](_0x1f5e('0x11'),_0x27320d,_0x1f5e('0x12'));logger[_0x1f5e('0x13')]('User,\x20%s,\x20%s,\x20%s',_0x27320d,'request\x20sent',JSON['stringify'](_0x3315cc));if(_0x3315cc['error']){if(_0x3315cc[_0x1f5e('0x14')][_0x1f5e('0x15')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x27320d,_0x3315cc[_0x1f5e('0x14')][_0x1f5e('0x16')]);return _0x4647ed(_0x3315cc[_0x1f5e('0x14')][_0x1f5e('0x16')]);}logger['error']('User,\x20%s,\x20%s',_0x27320d,_0x3315cc[_0x1f5e('0x14')][_0x1f5e('0x16')]);return _0x33150f(_0x3315cc['error']['message']);}else{logger[_0x1f5e('0x10')](_0x1f5e('0x11'),_0x27320d,_0x1f5e('0x12'));_0x33150f(_0x3315cc[_0x1f5e('0x17')][_0x1f5e('0x16')]);}})[_0x1f5e('0x18')](function(_0xc75d69){logger[_0x1f5e('0x14')](_0x1f5e('0x11'),_0x27320d,_0xc75d69);_0x4647ed(_0xc75d69);});});}exports[_0x1f5e('0x19')]=function(_0x124260){var _0x16d004=this;return new Promise(function(_0x29497e,_0x2e4380){return db[_0x1f5e('0x1a')][_0x1f5e('0x1b')]({'raw':_0x124260[_0x1f5e('0x1c')]?_0x124260[_0x1f5e('0x1c')][_0x1f5e('0x1d')]===undefined?!![]:![]:!![],'where':_0x124260[_0x1f5e('0x1c')]?_0x124260['options'][_0x1f5e('0x1e')]||null:null,'attributes':_0x124260[_0x1f5e('0x1c')]?_0x124260[_0x1f5e('0x1c')][_0x1f5e('0x1f')]||null:null,'limit':_0x124260[_0x1f5e('0x1c')]?_0x124260[_0x1f5e('0x1c')]['limit']||null:null,'include':_0x124260[_0x1f5e('0x1c')]?_0x124260[_0x1f5e('0x1c')][_0x1f5e('0x20')]?_['map'](_0x124260[_0x1f5e('0x1c')][_0x1f5e('0x20')],function(_0x432c8b){return{'model':db[_0x432c8b[_0x1f5e('0x21')]],'as':_0x432c8b['as'],'attributes':_0x432c8b[_0x1f5e('0x1f')],'include':_0x432c8b[_0x1f5e('0x20')]?_[_0x1f5e('0x22')](_0x432c8b[_0x1f5e('0x20')],function(_0x438d77){return{'model':db[_0x438d77['model']],'as':_0x438d77['as'],'attributes':_0x438d77[_0x1f5e('0x1f')],'include':_0x438d77[_0x1f5e('0x20')]?_[_0x1f5e('0x22')](_0x438d77['include'],function(_0x533045){return{'model':db[_0x533045[_0x1f5e('0x21')]],'as':_0x533045['as'],'attributes':_0x533045[_0x1f5e('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1324a7){logger[_0x1f5e('0x10')](_0x1f5e('0x19'),_0x124260);logger[_0x1f5e('0x13')]('GetUser',_0x124260,JSON['stringify'](_0x1324a7));_0x29497e(_0x1324a7);})[_0x1f5e('0x18')](function(_0x1c97da){logger[_0x1f5e('0x14')]('GetUser',_0x1c97da[_0x1f5e('0x16')],_0x124260);_0x2e4380(_0x16d004[_0x1f5e('0x14')](0x1f4,_0x1c97da[_0x1f5e('0x16')]));});});};exports[_0x1f5e('0x23')]=function(_0x3536df){var _0x2d429f=this;return new Promise(function(_0x45c46b,_0x334c18){return db[_0x1f5e('0x1a')][_0x1f5e('0x24')]({'raw':_0x3536df[_0x1f5e('0x1c')]?_0x3536df[_0x1f5e('0x1c')][_0x1f5e('0x1d')]===undefined?!![]:![]:!![],'where':_0x3536df[_0x1f5e('0x1c')]?_0x3536df[_0x1f5e('0x1c')][_0x1f5e('0x1e')]||null:null,'attributes':_0x3536df[_0x1f5e('0x1c')]?_0x3536df[_0x1f5e('0x1c')][_0x1f5e('0x1f')]||null:null,'include':_0x3536df['options']?_0x3536df[_0x1f5e('0x1c')][_0x1f5e('0x20')]?_[_0x1f5e('0x22')](_0x3536df[_0x1f5e('0x1c')][_0x1f5e('0x20')],function(_0x5c2232){return{'model':db[_0x5c2232[_0x1f5e('0x21')]],'as':_0x5c2232['as'],'attributes':_0x5c2232[_0x1f5e('0x1f')],'include':_0x5c2232[_0x1f5e('0x20')]?_[_0x1f5e('0x22')](_0x5c2232[_0x1f5e('0x20')],function(_0x34012f){return{'model':db[_0x34012f[_0x1f5e('0x21')]],'as':_0x34012f['as'],'attributes':_0x34012f[_0x1f5e('0x1f')],'include':_0x34012f['include']?_[_0x1f5e('0x22')](_0x34012f[_0x1f5e('0x20')],function(_0x54b4e3){return{'model':db[_0x54b4e3['model']],'as':_0x54b4e3['as'],'attributes':_0x54b4e3['attributes']};}):[]};}):[]};}):[]:[]})[_0x1f5e('0xf')](function(_0x2dee14){logger['info']('ShowUser',_0x3536df);logger[_0x1f5e('0x13')]('ShowUser',_0x3536df,JSON[_0x1f5e('0x25')](_0x2dee14));_0x45c46b(_0x2dee14);})[_0x1f5e('0x18')](function(_0x4a3c71){logger[_0x1f5e('0x14')](_0x1f5e('0x23'),_0x4a3c71['message'],_0x3536df);_0x334c18(_0x2d429f[_0x1f5e('0x14')](0x1f4,_0x4a3c71['message']));});});};exports[_0x1f5e('0x26')]=function(_0x2704d9){var _0x59d6a3=this;return new Promise(function(_0x297d2c,_0x4a08c2){var _0x1f2227;return db[_0x1f5e('0x1a')]['find']({'where':_0x2704d9[_0x1f5e('0x1c')][_0x1f5e('0x1e')]||{},'attributes':['id',_0x1f5e('0x27'),'role',_0x1f5e('0x28'),_0x1f5e('0x29')]})[_0x1f5e('0xf')](function(_0x718671){if(_0x718671){_0x1f2227=_0x718671;return db[_0x1f5e('0x2a')][_0x1f5e('0x2b')]({'paused':0x1},{'where':{'UserId':_0x1f2227['id']},'individualHooks':!![]});}})[_0x1f5e('0xf')](function(){if(_0x1f2227){return db[_0x1f5e('0x2c')][_0x1f5e('0x1b')]({'where':{'membername':_0x1f2227[_0x1f5e('0x27')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x1d52d3){if(_0x1f2227){if(_0x1d52d3&&_0x1d52d3['length']){var _0x5c0056=moment()[_0x1f5e('0x2d')](_0x1f5e('0x2e'));for(var _0x240245=0x0,_0x538c06=_0x1d52d3[_0x1f5e('0x2f')];_0x240245<_0x538c06;_0x240245++){_0x1d52d3[_0x240245][_0x1f5e('0x30')]({'exitAt':_0x5c0056});}}}})[_0x1f5e('0xf')](function(){if(_0x1f2227){var _0x5ae391=[];var _0x172586=utils['getChannels']();_0x172586[_0x1f5e('0x31')](function(_0x2b078a){_0x5ae391[_0x1f5e('0x32')]({'channel':_0x2b078a,'membername':_0x1f2227[_0x1f5e('0x27')],'interface':_[_0x1f5e('0x33')](_0x1f2227[_0x1f5e('0x29')])?util['format'](_0x1f5e('0x34'),_0x1f2227[_0x1f5e('0x27')]):_0x1f2227['interface'],'type':_0x1f5e('0x35'),'enterAt':moment()['format'](_0x1f5e('0x2e')),'data1':_0x2704d9['body'][_0x1f5e('0x36')]||_0x1f5e('0x37'),'role':_0x1f2227[_0x1f5e('0x38')],'internal':_0x1f2227[_0x1f5e('0x28')],'uniqueid':_0x2704d9[_0x1f5e('0x39')][_0x1f5e('0x3a')]||null});});return db[_0x1f5e('0x2c')][_0x1f5e('0x3b')](_0x5ae391,{'individualHooks':!![]});}})['then'](function(){if(_0x1f2227){return _0x1f2227[_0x1f5e('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x2704d9[_0x1f5e('0x39')][_0x1f5e('0x36')]||_0x1f5e('0x37'),'lastPauseAt':moment()[_0x1f5e('0x2d')](_0x1f5e('0x2e'))});}})[_0x1f5e('0xf')](function(_0x3475e1){_0x297d2c(_0x3475e1);})[_0x1f5e('0x18')](function(_0x48e82c){_0x4a08c2(_0x59d6a3[_0x1f5e('0x14')](0x1f4,_0x48e82c[_0x1f5e('0x16')]));});});};exports[_0x1f5e('0x3c')]=function(_0x2cc1e1){var _0x4c80e3=this;return new Promise(function(_0x597129,_0x3d2488){var _0x2bbc5a;return db['User'][_0x1f5e('0x3d')]({'where':_0x2cc1e1[_0x1f5e('0x1c')][_0x1f5e('0x1e')]||{},'attributes':['id',_0x1f5e('0x27')]})['then'](function(_0x2676d8){if(_0x2676d8){_0x2bbc5a=_0x2676d8;if(_0x2cc1e1[_0x1f5e('0x39')][_0x1f5e('0x3e')]&&!utils[_0x1f5e('0x3f')](_0x2cc1e1['body'][_0x1f5e('0x3e')])){throw new Error(_0x1f5e('0x40'));}switch(_0x2cc1e1['body'][_0x1f5e('0x3e')]){case _0x1f5e('0x41'):return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x2bbc5a['id']}})['then'](function(){return db[_0x1f5e('0x2c')][_0x1f5e('0x24')]({'where':{'channel':_0x2cc1e1['body'][_0x1f5e('0x3e')],'membername':_0x2bbc5a['name'],'type':_0x1f5e('0x35'),'exitAt':null}});})[_0x1f5e('0xf')](function(_0xe646fc){if(_0xe646fc){return _0xe646fc[_0x1f5e('0x2b')]({'exitAt':moment()[_0x1f5e('0x2d')](_0x1f5e('0x2e')),'data2':_0x1f5e('0x42')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x2bbc5a[_0x1f5e('0x2b')]({'voicePause':![]});});case _0x1f5e('0x43'):case _0x1f5e('0x44'):case _0x1f5e('0x45'):case _0x1f5e('0x46'):case'openchannel':return db[_0x1f5e('0x2c')]['find']({'where':{'channel':_0x2cc1e1[_0x1f5e('0x39')][_0x1f5e('0x3e')],'membername':_0x2bbc5a[_0x1f5e('0x27')],'type':_0x1f5e('0x35'),'exitAt':null}})[_0x1f5e('0xf')](function(_0x4e74bf){return _0x4e74bf[_0x1f5e('0x2b')]({'exitAt':moment()[_0x1f5e('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x1f5e('0x42')},{'individualHooks':!![]});})['then'](function(){var _0x53b3de={};_[_0x1f5e('0x47')](_0x53b3de,util[_0x1f5e('0x2d')](_0x1f5e('0x48'),_0x2cc1e1['body'][_0x1f5e('0x3e')],_0x1f5e('0x49')),![]);return _0x2bbc5a[_0x1f5e('0x2b')](_0x53b3de);});default:return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x2bbc5a['id']}})[_0x1f5e('0xf')](function(){return db[_0x1f5e('0x2c')][_0x1f5e('0x1b')]({'where':{'membername':_0x2bbc5a[_0x1f5e('0x27')],'type':_0x1f5e('0x35'),'exitAt':null}});})[_0x1f5e('0xf')](function(_0x2cf0e4){var _0x4705d8=[];_0x2cf0e4['forEach'](function(_0x4ef26d){_0x4705d8['push'](_0x4ef26d[_0x1f5e('0x2b')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'}));});return BPromise[_0x1f5e('0x4a')](_0x4705d8);})['then'](function(){return _0x2bbc5a[_0x1f5e('0x2b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x434cf8){_0x597129(_0x434cf8);})[_0x1f5e('0x18')](function(_0x115233){_0x3d2488(_0x4c80e3[_0x1f5e('0x14')](0x1f4,_0x115233[_0x1f5e('0x16')]));});});};exports[_0x1f5e('0x4b')]=function(_0x3cf7f3){var _0x35af0e=this;return new Promise(function(_0x569892,_0x375eb6){var _0x2f74a9;return db[_0x1f5e('0x1a')][_0x1f5e('0x3d')]({'where':_0x3cf7f3[_0x1f5e('0x1c')][_0x1f5e('0x1e')]||{},'attributes':['id',_0x1f5e('0x27')]})[_0x1f5e('0xf')](function(_0x270dea){if(_0x270dea){_0x2f74a9=_0x270dea;return db[_0x1f5e('0x2a')][_0x1f5e('0x4c')]({'where':{'membername':_0x2f74a9[_0x1f5e('0x27')]},'individualHooks':!![]});}})['then'](function(){if(_0x2f74a9){return db[_0x1f5e('0x2c')][_0x1f5e('0x1b')]({'where':{'membername':_0x2f74a9['name'],'exitAt':null}});}})['then'](function(_0x308629){if(_0x2f74a9){if(_0x308629&&_0x308629[_0x1f5e('0x2f')]){var _0x2a00e5=[];_0x308629[_0x1f5e('0x31')](function(_0x5ce0a){_0x2a00e5[_0x1f5e('0x32')](_0x5ce0a['update']({'exitAt':moment()[_0x1f5e('0x2d')](_0x1f5e('0x2e'))}));});return BPromise[_0x1f5e('0x4a')](_0x2a00e5);}}})[_0x1f5e('0xf')](function(){if(_0x2f74a9){return _0x2f74a9[_0x1f5e('0x2b')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0xbbb864){_0x569892(_0xbbb864);})[_0x1f5e('0x18')](function(_0x20b914){_0x375eb6(_0x35af0e['error'](0x1f4,_0x20b914['message']));});});};exports[_0x1f5e('0x4d')]=function(_0x1b0002){var _0xc31f51=this;return new Promise(function(_0xb2c633,_0xcd9cc7){var _0x4ce052;var _0x2f917f;var _0x2f1087;var _0x4e95c;return db[_0x1f5e('0x1a')][_0x1f5e('0x3d')]({'where':_0x1b0002['options'][_0x1f5e('0x1e')]||{},'attributes':['id',_0x1f5e('0x27'),_0x1f5e('0x38'),'mobile',_0x1f5e('0x4e'),'internal',_0x1f5e('0x4f'),_0x1f5e('0x29')]})[_0x1f5e('0xf')](function(_0xab6ef7){if(_0xab6ef7){_0x4ce052=_0xab6ef7;_0x4e95c=_0x1b0002[_0x1f5e('0x39')][_0x1f5e('0x29')]?_0x1b0002['body'][_0x1f5e('0x29')]:util[_0x1f5e('0x2d')](_0x1f5e('0x34'),_0x4ce052[_0x1f5e('0x27')]);return db[_0x1f5e('0x1a')][_0x1f5e('0x50')]({'where':{'role':_0x1f5e('0x51'),'online':!![],'id':{'$ne':_0x4ce052['id']}}});}})[_0x1f5e('0xf')](function(_0x355e8e){if(_0x355e8e){_0x2f1087=_0x355e8e;return require('../../config/license/util')[_0x1f5e('0x52')]();}})[_0x1f5e('0xf')](function(_0x59342f){if(_0x59342f&&_0x59342f['agents']&&_0x2f1087>=_0x59342f[_0x1f5e('0x53')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x1f5e('0xf')](function(){if(_0x4ce052){return db['UserVoiceQueueRt'][_0x1f5e('0x4c')]({'where':{'membername':_0x4ce052[_0x1f5e('0x27')]},'individualHooks':!![]});}})[_0x1f5e('0xf')](function(){if(_0x4ce052){return _0x4ce052[_0x1f5e('0x54')]({'raw':!![]});}})['then'](function(_0x305840){if(_0x4ce052){if(_0x305840){var _0x4774fb=[];_0x2f917f=_0x305840;if(_0x2f917f[_0x1f5e('0x2f')]){for(var _0x6453ef=0x0;_0x6453ef<_0x2f917f[_0x1f5e('0x2f')];_0x6453ef++){_0x4774fb[_0x1f5e('0x32')](db['UserVoiceQueueRt'][_0x1f5e('0x55')]({'membername':_0x4ce052[_0x1f5e('0x27')],'UserId':_0x4ce052['id'],'queue_name':_0x2f917f[_0x6453ef][_0x1f5e('0x27')],'VoiceQueueId':_0x2f917f[_0x6453ef]['id'],'interface':_0x4e95c,'paused':_0x4ce052['loginInPause']||![],'penalty':_0x2f917f[_0x6453ef][_0x1f5e('0x56')]||0x0}));}return BPromise[_0x1f5e('0x4a')](_0x4774fb);}}}})['then'](function(){if(_0x4ce052){return db['MemberReport']['findAll']({'where':{'membername':_0x4ce052[_0x1f5e('0x27')],'exitAt':null}});}})['then'](function(_0x40750a){if(_0x4ce052){if(_0x40750a&&_0x40750a[_0x1f5e('0x2f')]){var _0x502c26=[];_0x40750a['forEach'](function(_0x50cb6b){_0x502c26[_0x1f5e('0x32')](_0x50cb6b[_0x1f5e('0x2b')]({'exitAt':moment()['format'](_0x1f5e('0x2e'))}));});return BPromise[_0x1f5e('0x4a')](_0x502c26);}}})['then'](function(_0x210c44){if(_0x4ce052){var _0x57860b=[];var _0x58a94c=[];var _0x40932e=utils['getChannels']();var _0x32124b={'membername':_0x4ce052[_0x1f5e('0x27')],'interface':_0x4e95c,'enterAt':moment()[_0x1f5e('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4ce052[_0x1f5e('0x38')],'internal':_0x4ce052[_0x1f5e('0x28')]};_0x40932e[_0x1f5e('0x31')](function(_0x360dc5){_0x57860b[_0x1f5e('0x32')](_[_0x1f5e('0x57')]({'channel':_0x360dc5,'type':_0x1f5e('0x58'),'data1':_0x1f5e('0x59'),'data2':_0x4e95c},_0x32124b));if(_0x4ce052[_0x1f5e('0x4f')]){_0x58a94c['push'](_[_0x1f5e('0x57')]({'channel':_0x360dc5,'type':_0x1f5e('0x35'),'data1':_0x1f5e('0x5a')},_0x32124b));}});return db['MemberReport'][_0x1f5e('0x3b')](_0x57860b[_0x1f5e('0x5b')](_0x58a94c),{'individualHooks':!![]});}})[_0x1f5e('0xf')](function(){if(_0x4ce052){return _0x4ce052['update']({'online':!![],'lastLoginAt':moment()[_0x1f5e('0x2d')](_0x1f5e('0x2e')),'voicePause':_0x4ce052[_0x1f5e('0x4f')]||![],'mailPause':_0x4ce052[_0x1f5e('0x4f')]||![],'chatPause':_0x4ce052[_0x1f5e('0x4f')]||![],'faxPause':_0x4ce052['loginInPause']||![],'smsPause':_0x4ce052[_0x1f5e('0x4f')]||![],'openchannelPause':_0x4ce052[_0x1f5e('0x4f')]||![],'pauseType':_0x4ce052[_0x1f5e('0x4f')]?_0x1f5e('0x5a'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x4e95c});}})[_0x1f5e('0xf')](function(_0x2026ca){_0xb2c633(_0x2026ca);})[_0x1f5e('0x18')](function(_0x2c9ab4){_0xcd9cc7(_0xc31f51[_0x1f5e('0x14')](0x1f4,_0x2c9ab4['message']));});});};
\ No newline at end of file
+var _0xaa75=['PAUSE','length','format','updateAttributes','getChannels','push','isNil','interface','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','YYYY-MM-DD\x20HH:mm:ss','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','system','mail','chat','fax','openchannel','set','%s%s','Pause','forEach','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','merge','callysquare','LOGININPAUSE','concat','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','localhost','./user.socket','register','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','options','raw','where','attributes','include','map','model','GetUser','stringify','ShowUser','User','find','then','PauseUser','name','role','internal','UserVoiceQueueRt','update','MemberReport','findAll'];(function(_0x51f1f6,_0x3f5be4){var _0x2be5fe=function(_0x3fb60e){while(--_0x3fb60e){_0x51f1f6['push'](_0x51f1f6['shift']());}};_0x2be5fe(++_0x3f5be4);}(_0xaa75,0x8d));var _0x5aa7=function(_0x1a92eb,_0x5a8eb9){_0x1a92eb=_0x1a92eb-0x0;var _0x284c2c=_0xaa75[_0x1a92eb];return _0x284c2c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5aa7('0x0'));var BPromise=require(_0x5aa7('0x1'));var rs=require(_0x5aa7('0x2'));var fs=require('fs');var Redis=require(_0x5aa7('0x3'));var db=require(_0x5aa7('0x4'))['db'];var utils=require(_0x5aa7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5aa7('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5aa7('0x7')]({'port':0x232a});config[_0x5aa7('0x8')]=_[_0x5aa7('0x9')](config[_0x5aa7('0x8')],{'host':_0x5aa7('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5aa7('0x8')]));require(_0x5aa7('0xb'))[_0x5aa7('0xc')](socket);function respondWithRpcPromise(_0x5f4add,_0x1ceb35,_0x588e75){return new BPromise(function(_0x43d0b8,_0x42c271){return client[_0x5aa7('0xd')](_0x5f4add,_0x588e75)['then'](function(_0x335608){logger[_0x5aa7('0xe')](_0x5aa7('0xf'),_0x1ceb35,_0x5aa7('0x10'));logger[_0x5aa7('0x11')](_0x5aa7('0x12'),_0x1ceb35,_0x5aa7('0x10'),JSON['stringify'](_0x335608));if(_0x335608[_0x5aa7('0x13')]){if(_0x335608[_0x5aa7('0x13')][_0x5aa7('0x14')]===0x1f4){logger[_0x5aa7('0x13')](_0x5aa7('0xf'),_0x1ceb35,_0x335608['error'][_0x5aa7('0x15')]);return _0x42c271(_0x335608[_0x5aa7('0x13')][_0x5aa7('0x15')]);}logger[_0x5aa7('0x13')](_0x5aa7('0xf'),_0x1ceb35,_0x335608[_0x5aa7('0x13')][_0x5aa7('0x15')]);return _0x43d0b8(_0x335608[_0x5aa7('0x13')]['message']);}else{logger[_0x5aa7('0xe')](_0x5aa7('0xf'),_0x1ceb35,_0x5aa7('0x10'));_0x43d0b8(_0x335608[_0x5aa7('0x16')]['message']);}})[_0x5aa7('0x17')](function(_0x29bf0d){logger[_0x5aa7('0x13')](_0x5aa7('0xf'),_0x1ceb35,_0x29bf0d);_0x42c271(_0x29bf0d);});});}exports['GetUser']=function(_0x5e5157){var _0xc2e3f6=this;return new Promise(function(_0x522e5a,_0x204828){return db['User']['findAll']({'raw':_0x5e5157[_0x5aa7('0x18')]?_0x5e5157[_0x5aa7('0x18')][_0x5aa7('0x19')]===undefined?!![]:![]:!![],'where':_0x5e5157[_0x5aa7('0x18')]?_0x5e5157['options'][_0x5aa7('0x1a')]||null:null,'attributes':_0x5e5157[_0x5aa7('0x18')]?_0x5e5157['options'][_0x5aa7('0x1b')]||null:null,'limit':_0x5e5157['options']?_0x5e5157[_0x5aa7('0x18')]['limit']||null:null,'include':_0x5e5157['options']?_0x5e5157[_0x5aa7('0x18')][_0x5aa7('0x1c')]?_[_0x5aa7('0x1d')](_0x5e5157[_0x5aa7('0x18')]['include'],function(_0x131998){return{'model':db[_0x131998[_0x5aa7('0x1e')]],'as':_0x131998['as'],'attributes':_0x131998[_0x5aa7('0x1b')],'include':_0x131998[_0x5aa7('0x1c')]?_[_0x5aa7('0x1d')](_0x131998[_0x5aa7('0x1c')],function(_0x1e4aae){return{'model':db[_0x1e4aae[_0x5aa7('0x1e')]],'as':_0x1e4aae['as'],'attributes':_0x1e4aae['attributes'],'include':_0x1e4aae['include']?_[_0x5aa7('0x1d')](_0x1e4aae[_0x5aa7('0x1c')],function(_0x3c07aa){return{'model':db[_0x3c07aa[_0x5aa7('0x1e')]],'as':_0x3c07aa['as'],'attributes':_0x3c07aa[_0x5aa7('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4503a6){logger[_0x5aa7('0xe')](_0x5aa7('0x1f'),_0x5e5157);logger[_0x5aa7('0x11')]('GetUser',_0x5e5157,JSON[_0x5aa7('0x20')](_0x4503a6));_0x522e5a(_0x4503a6);})[_0x5aa7('0x17')](function(_0x28336c){logger[_0x5aa7('0x13')](_0x5aa7('0x1f'),_0x28336c['message'],_0x5e5157);_0x204828(_0xc2e3f6[_0x5aa7('0x13')](0x1f4,_0x28336c[_0x5aa7('0x15')]));});});};exports[_0x5aa7('0x21')]=function(_0x140bfe){var _0x226140=this;return new Promise(function(_0x50a7ee,_0x20b7d1){return db[_0x5aa7('0x22')][_0x5aa7('0x23')]({'raw':_0x140bfe[_0x5aa7('0x18')]?_0x140bfe[_0x5aa7('0x18')][_0x5aa7('0x19')]===undefined?!![]:![]:!![],'where':_0x140bfe['options']?_0x140bfe[_0x5aa7('0x18')][_0x5aa7('0x1a')]||null:null,'attributes':_0x140bfe[_0x5aa7('0x18')]?_0x140bfe['options'][_0x5aa7('0x1b')]||null:null,'include':_0x140bfe[_0x5aa7('0x18')]?_0x140bfe[_0x5aa7('0x18')][_0x5aa7('0x1c')]?_['map'](_0x140bfe['options'][_0x5aa7('0x1c')],function(_0xbed927){return{'model':db[_0xbed927[_0x5aa7('0x1e')]],'as':_0xbed927['as'],'attributes':_0xbed927[_0x5aa7('0x1b')],'include':_0xbed927[_0x5aa7('0x1c')]?_[_0x5aa7('0x1d')](_0xbed927[_0x5aa7('0x1c')],function(_0x2ff2aa){return{'model':db[_0x2ff2aa[_0x5aa7('0x1e')]],'as':_0x2ff2aa['as'],'attributes':_0x2ff2aa[_0x5aa7('0x1b')],'include':_0x2ff2aa['include']?_[_0x5aa7('0x1d')](_0x2ff2aa[_0x5aa7('0x1c')],function(_0x537a5a){return{'model':db[_0x537a5a[_0x5aa7('0x1e')]],'as':_0x537a5a['as'],'attributes':_0x537a5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5aa7('0x24')](function(_0x13ca01){logger['info'](_0x5aa7('0x21'),_0x140bfe);logger[_0x5aa7('0x11')](_0x5aa7('0x21'),_0x140bfe,JSON['stringify'](_0x13ca01));_0x50a7ee(_0x13ca01);})[_0x5aa7('0x17')](function(_0x2be8fa){logger[_0x5aa7('0x13')]('ShowUser',_0x2be8fa[_0x5aa7('0x15')],_0x140bfe);_0x20b7d1(_0x226140[_0x5aa7('0x13')](0x1f4,_0x2be8fa['message']));});});};exports[_0x5aa7('0x25')]=function(_0x4641f7){var _0x5e922e=this;return new Promise(function(_0x5ebefc,_0x378130){var _0x4e2324;return db[_0x5aa7('0x22')][_0x5aa7('0x23')]({'where':_0x4641f7[_0x5aa7('0x18')][_0x5aa7('0x1a')]||{},'attributes':['id',_0x5aa7('0x26'),_0x5aa7('0x27'),_0x5aa7('0x28'),'interface']})[_0x5aa7('0x24')](function(_0x3966b6){if(_0x3966b6){_0x4e2324=_0x3966b6;return db[_0x5aa7('0x29')][_0x5aa7('0x2a')]({'paused':0x1},{'where':{'UserId':_0x4e2324['id']},'individualHooks':!![]});}})[_0x5aa7('0x24')](function(){if(_0x4e2324){return db[_0x5aa7('0x2b')][_0x5aa7('0x2c')]({'where':{'membername':_0x4e2324[_0x5aa7('0x26')],'type':_0x5aa7('0x2d'),'exitAt':null}});}})[_0x5aa7('0x24')](function(_0x5e22aa){if(_0x4e2324){if(_0x5e22aa&&_0x5e22aa[_0x5aa7('0x2e')]){var _0x58193e=moment()[_0x5aa7('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x461684=0x0,_0x97dcff=_0x5e22aa[_0x5aa7('0x2e')];_0x461684<_0x97dcff;_0x461684++){_0x5e22aa[_0x461684][_0x5aa7('0x30')]({'exitAt':_0x58193e});}}}})[_0x5aa7('0x24')](function(){if(_0x4e2324){var _0xc36153=[];var _0x48fcb8=utils[_0x5aa7('0x31')]();_0x48fcb8['forEach'](function(_0x4a5fd4){_0xc36153[_0x5aa7('0x32')]({'channel':_0x4a5fd4,'membername':_0x4e2324[_0x5aa7('0x26')],'interface':_[_0x5aa7('0x33')](_0x4e2324[_0x5aa7('0x34')])?util[_0x5aa7('0x2f')](_0x5aa7('0x35'),_0x4e2324[_0x5aa7('0x26')]):_0x4e2324[_0x5aa7('0x34')],'type':'PAUSE','enterAt':moment()[_0x5aa7('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4641f7[_0x5aa7('0x36')][_0x5aa7('0x37')]||_0x5aa7('0x38'),'role':_0x4e2324['role'],'internal':_0x4e2324['internal'],'uniqueid':_0x4641f7[_0x5aa7('0x36')][_0x5aa7('0x39')]||null});});return db['MemberReport'][_0x5aa7('0x3a')](_0xc36153,{'individualHooks':!![]});}})[_0x5aa7('0x24')](function(){if(_0x4e2324){return _0x4e2324[_0x5aa7('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x4641f7[_0x5aa7('0x36')]['type']||_0x5aa7('0x38'),'lastPauseAt':moment()[_0x5aa7('0x2f')](_0x5aa7('0x3b'))});}})[_0x5aa7('0x24')](function(_0x41b266){_0x5ebefc(_0x41b266);})[_0x5aa7('0x17')](function(_0x252cc0){_0x378130(_0x5e922e['error'](0x1f4,_0x252cc0[_0x5aa7('0x15')]));});});};exports[_0x5aa7('0x3c')]=function(_0x218640){var _0x51661e=this;return new Promise(function(_0x3a29ec,_0x35a54c){var _0x2c2a5d;return db['User'][_0x5aa7('0x3d')]({'where':_0x218640['options'][_0x5aa7('0x1a')]||{},'attributes':['id','name']})['then'](function(_0x186e06){if(_0x186e06){_0x2c2a5d=_0x186e06;if(_0x218640[_0x5aa7('0x36')][_0x5aa7('0x3e')]&&!utils[_0x5aa7('0x3f')](_0x218640['body'][_0x5aa7('0x3e')])){throw new Error(_0x5aa7('0x40'));}switch(_0x218640['body'][_0x5aa7('0x3e')]){case _0x5aa7('0x41'):return db[_0x5aa7('0x29')][_0x5aa7('0x2a')]({'paused':0x0},{'where':{'UserId':_0x2c2a5d['id']}})['then'](function(){return db[_0x5aa7('0x2b')]['find']({'where':{'channel':_0x218640[_0x5aa7('0x36')][_0x5aa7('0x3e')],'membername':_0x2c2a5d['name'],'type':_0x5aa7('0x2d'),'exitAt':null}});})[_0x5aa7('0x24')](function(_0x12c7e4){if(_0x12c7e4){return _0x12c7e4[_0x5aa7('0x2a')]({'exitAt':moment()[_0x5aa7('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x5aa7('0x42')},{'individualHooks':!![]});}return null;})[_0x5aa7('0x24')](function(){return _0x2c2a5d[_0x5aa7('0x2a')]({'voicePause':![]});});case _0x5aa7('0x43'):case _0x5aa7('0x44'):case _0x5aa7('0x45'):case'sms':case _0x5aa7('0x46'):return db[_0x5aa7('0x2b')][_0x5aa7('0x23')]({'where':{'channel':_0x218640['body'][_0x5aa7('0x3e')],'membername':_0x2c2a5d[_0x5aa7('0x26')],'type':_0x5aa7('0x2d'),'exitAt':null}})[_0x5aa7('0x24')](function(_0x35c05c){return _0x35c05c['update']({'exitAt':moment()[_0x5aa7('0x2f')](_0x5aa7('0x3b')),'data2':_0x5aa7('0x42')},{'individualHooks':!![]});})[_0x5aa7('0x24')](function(){var _0x4e3f85={};_[_0x5aa7('0x47')](_0x4e3f85,util[_0x5aa7('0x2f')](_0x5aa7('0x48'),_0x218640['body'][_0x5aa7('0x3e')],_0x5aa7('0x49')),![]);return _0x2c2a5d[_0x5aa7('0x2a')](_0x4e3f85);});default:return db[_0x5aa7('0x29')][_0x5aa7('0x2a')]({'paused':0x0},{'where':{'UserId':_0x2c2a5d['id']}})[_0x5aa7('0x24')](function(){return db[_0x5aa7('0x2b')][_0x5aa7('0x2c')]({'where':{'membername':_0x2c2a5d[_0x5aa7('0x26')],'type':_0x5aa7('0x2d'),'exitAt':null}});})[_0x5aa7('0x24')](function(_0xcf594e){var _0x143547=[];_0xcf594e[_0x5aa7('0x4a')](function(_0x2eb04d){_0x143547['push'](_0x2eb04d[_0x5aa7('0x2a')]({'exitAt':moment()[_0x5aa7('0x2f')](_0x5aa7('0x3b')),'data2':_0x5aa7('0x42')}));});return BPromise[_0x5aa7('0x4b')](_0x143547);})[_0x5aa7('0x24')](function(){return _0x2c2a5d[_0x5aa7('0x2a')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x4326ad){_0x3a29ec(_0x4326ad);})['catch'](function(_0x464d2e){_0x35a54c(_0x51661e[_0x5aa7('0x13')](0x1f4,_0x464d2e[_0x5aa7('0x15')]));});});};exports[_0x5aa7('0x4c')]=function(_0x29caed){var _0x466ea9=this;return new Promise(function(_0x4a591c,_0x46aa3f){var _0x144a19;return db[_0x5aa7('0x22')][_0x5aa7('0x3d')]({'where':_0x29caed['options'][_0x5aa7('0x1a')]||{},'attributes':['id',_0x5aa7('0x26')]})['then'](function(_0x8d265c){if(_0x8d265c){_0x144a19=_0x8d265c;return db[_0x5aa7('0x29')][_0x5aa7('0x4d')]({'where':{'membername':_0x144a19[_0x5aa7('0x26')]},'individualHooks':!![]});}})['then'](function(){if(_0x144a19){return db['MemberReport'][_0x5aa7('0x2c')]({'where':{'membername':_0x144a19[_0x5aa7('0x26')],'exitAt':null}});}})[_0x5aa7('0x24')](function(_0x31ba5f){if(_0x144a19){if(_0x31ba5f&&_0x31ba5f[_0x5aa7('0x2e')]){var _0x136bdb=[];_0x31ba5f[_0x5aa7('0x4a')](function(_0x1003c6){_0x136bdb['push'](_0x1003c6['update']({'exitAt':moment()['format'](_0x5aa7('0x3b'))}));});return BPromise[_0x5aa7('0x4b')](_0x136bdb);}}})[_0x5aa7('0x24')](function(){if(_0x144a19){return _0x144a19[_0x5aa7('0x2a')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x5aa7('0x24')](function(_0x58da2f){_0x4a591c(_0x58da2f);})['catch'](function(_0x1ad818){_0x46aa3f(_0x466ea9[_0x5aa7('0x13')](0x1f4,_0x1ad818['message']));});});};exports[_0x5aa7('0x4e')]=function(_0x201c48){var _0xa67413=this;return new Promise(function(_0x1497f7,_0x258f70){var _0x141b6e;var _0x3d3384;var _0x36c63d;var _0x4dcc14;return db[_0x5aa7('0x22')][_0x5aa7('0x3d')]({'where':_0x201c48[_0x5aa7('0x18')][_0x5aa7('0x1a')]||{},'attributes':['id',_0x5aa7('0x26'),_0x5aa7('0x27'),_0x5aa7('0x4f'),_0x5aa7('0x50'),_0x5aa7('0x28'),_0x5aa7('0x51'),'interface']})[_0x5aa7('0x24')](function(_0x586f45){if(_0x586f45){_0x141b6e=_0x586f45;_0x4dcc14=_0x201c48[_0x5aa7('0x36')][_0x5aa7('0x34')]?_0x201c48[_0x5aa7('0x36')][_0x5aa7('0x34')]:util[_0x5aa7('0x2f')](_0x5aa7('0x35'),_0x141b6e[_0x5aa7('0x26')]);return db[_0x5aa7('0x22')][_0x5aa7('0x52')]({'where':{'role':_0x5aa7('0x53'),'online':!![],'id':{'$ne':_0x141b6e['id']}}});}})['then'](function(_0x2714bb){if(_0x2714bb){_0x36c63d=_0x2714bb;return require(_0x5aa7('0x54'))[_0x5aa7('0x55')]();}})[_0x5aa7('0x24')](function(_0x54d83f){if(_0x54d83f&&_0x54d83f[_0x5aa7('0x56')]&&_0x36c63d>=_0x54d83f['agents']){throw new Error(_0x5aa7('0x57'));}})[_0x5aa7('0x24')](function(){if(_0x141b6e){return db[_0x5aa7('0x29')][_0x5aa7('0x4d')]({'where':{'membername':_0x141b6e[_0x5aa7('0x26')]},'individualHooks':!![]});}})['then'](function(){if(_0x141b6e){return _0x141b6e[_0x5aa7('0x58')]({'raw':!![]});}})['then'](function(_0x17cb85){if(_0x141b6e){if(_0x17cb85){var _0x4e002d=[];_0x3d3384=_0x17cb85;if(_0x3d3384[_0x5aa7('0x2e')]){for(var _0x745e6d=0x0;_0x745e6d<_0x3d3384[_0x5aa7('0x2e')];_0x745e6d++){_0x4e002d[_0x5aa7('0x32')](db['UserVoiceQueueRt']['upsert']({'membername':_0x141b6e[_0x5aa7('0x26')],'UserId':_0x141b6e['id'],'queue_name':_0x3d3384[_0x745e6d][_0x5aa7('0x26')],'VoiceQueueId':_0x3d3384[_0x745e6d]['id'],'interface':_0x4dcc14,'paused':_0x141b6e[_0x5aa7('0x51')]||![],'penalty':_0x3d3384[_0x745e6d]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x5aa7('0x4b')](_0x4e002d);}}}})[_0x5aa7('0x24')](function(){if(_0x141b6e){return db[_0x5aa7('0x2b')][_0x5aa7('0x2c')]({'where':{'membername':_0x141b6e[_0x5aa7('0x26')],'exitAt':null}});}})[_0x5aa7('0x24')](function(_0x2d2e30){if(_0x141b6e){if(_0x2d2e30&&_0x2d2e30[_0x5aa7('0x2e')]){var _0x54008a=[];_0x2d2e30[_0x5aa7('0x4a')](function(_0x29c1d7){_0x54008a[_0x5aa7('0x32')](_0x29c1d7[_0x5aa7('0x2a')]({'exitAt':moment()[_0x5aa7('0x2f')](_0x5aa7('0x3b'))}));});return BPromise[_0x5aa7('0x4b')](_0x54008a);}}})[_0x5aa7('0x24')](function(_0x269a7b){if(_0x141b6e){var _0x277129=[];var _0x2cf417=[];var _0x27d5c4=utils[_0x5aa7('0x31')]();var _0x126207={'membername':_0x141b6e[_0x5aa7('0x26')],'interface':_0x4dcc14,'enterAt':moment()[_0x5aa7('0x2f')](_0x5aa7('0x3b')),'role':_0x141b6e['role'],'internal':_0x141b6e['internal']};_0x27d5c4[_0x5aa7('0x4a')](function(_0x3abf0f){_0x277129[_0x5aa7('0x32')](_[_0x5aa7('0x59')]({'channel':_0x3abf0f,'type':'LOGIN','data1':_0x5aa7('0x5a'),'data2':_0x4dcc14},_0x126207));if(_0x141b6e[_0x5aa7('0x51')]){_0x2cf417['push'](_[_0x5aa7('0x59')]({'channel':_0x3abf0f,'type':_0x5aa7('0x2d'),'data1':_0x5aa7('0x5b')},_0x126207));}});return db[_0x5aa7('0x2b')][_0x5aa7('0x3a')](_0x277129[_0x5aa7('0x5c')](_0x2cf417),{'individualHooks':!![]});}})['then'](function(){if(_0x141b6e){return _0x141b6e[_0x5aa7('0x2a')]({'online':!![],'lastLoginAt':moment()['format'](_0x5aa7('0x3b')),'voicePause':_0x141b6e[_0x5aa7('0x51')]||![],'mailPause':_0x141b6e[_0x5aa7('0x51')]||![],'chatPause':_0x141b6e[_0x5aa7('0x51')]||![],'faxPause':_0x141b6e[_0x5aa7('0x51')]||![],'smsPause':_0x141b6e[_0x5aa7('0x51')]||![],'openchannelPause':_0x141b6e['loginInPause']||![],'pauseType':_0x141b6e['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x4dcc14});}})[_0x5aa7('0x24')](function(_0x49bc96){_0x1497f7(_0x49bc96);})['catch'](function(_0x3bf825){_0x258f70(_0xa67413[_0x5aa7('0x13')](0x1f4,_0x3bf825[_0x5aa7('0x15')]));});});};
\ No newline at end of file
index 919c18c..4228649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8add=['emit','removeListener','length','user:','./user.events','remove','update'];(function(_0xe963fd,_0x4f8181){var _0x46a847=function(_0x7443d4){while(--_0x7443d4){_0xe963fd['push'](_0xe963fd['shift']());}};_0x46a847(++_0x4f8181);}(_0x8add,0xcf));var _0xd8ad=function(_0xde5fd0,_0x505e7e){_0xde5fd0=_0xde5fd0-0x0;var _0x267273=_0x8add[_0xde5fd0];return _0x267273;};'use strict';var UserEvents=require(_0xd8ad('0x0'));var events=['save',_0xd8ad('0x1'),_0xd8ad('0x2')];function createListener(_0x174e3e,_0x3f4e5d){return function(_0x293adf){_0x3f4e5d[_0xd8ad('0x3')](_0x174e3e,_0x293adf);};}function removeListener(_0x45eb59,_0x467171){return function(){UserEvents[_0xd8ad('0x4')](_0x45eb59,_0x467171);};}exports['register']=function(_0x55a4ed){for(var _0x88e05=0x0,_0x4e2ad3=events[_0xd8ad('0x5')];_0x88e05<_0x4e2ad3;_0x88e05++){var _0x4888c3=events[_0x88e05];var _0x15dd18=createListener(_0xd8ad('0x6')+_0x4888c3,_0x55a4ed);UserEvents['on'](_0x4888c3,_0x15dd18);}};
\ No newline at end of file
+var _0x95c4=['remove','removeListener','length','./user.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x95c4,0x1ca));var _0x495c=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x95c4[_0x4e9d3c];return _0x2d0825;};'use strict';var UserEvents=require(_0x495c('0x0'));var events=[_0x495c('0x1'),_0x495c('0x2'),'update'];function createListener(_0x19a6cc,_0xa98668){return function(_0x3eee13){_0xa98668['emit'](_0x19a6cc,_0x3eee13);};}function removeListener(_0x1ac8ae,_0x116fcc){return function(){UserEvents[_0x495c('0x3')](_0x1ac8ae,_0x116fcc);};}exports['register']=function(_0x50fdb2){for(var _0x21d92f=0x0,_0x1ffdd9=events[_0x495c('0x4')];_0x21d92f<_0x1ffdd9;_0x21d92f++){var _0x3a1384=events[_0x21d92f];var _0x20b68c=createListener('user:'+_0x3a1384,_0x50fdb2);UserEvents['on'](_0x3a1384,_0x20b68c);}};
\ No newline at end of file
index ff8ad75..70e0311 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x332b=['multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x332b,0x15c));var _0xb332=function(_0x305dd9,_0x512697){_0x305dd9=_0x305dd9-0x0;var _0x20a140=_0x332b[_0x305dd9];return _0x20a140;};'use strict';var multer=require(_0xb332('0x0'));var util=require(_0xb332('0x1'));var path=require('path');var timeout=require(_0xb332('0x2'));var express=require(_0xb332('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb332('0x4'));var config=require(_0xb332('0x5'));module['exports']=router;
\ No newline at end of file
+var _0x9923=['../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0xe1b96a,_0x5d155d){var _0x4cf6b3=function(_0x25fbfb){while(--_0x25fbfb){_0xe1b96a['push'](_0xe1b96a['shift']());}};_0x4cf6b3(++_0x5d155d);}(_0x9923,0x1a9));var _0x3992=function(_0x314115,_0x22f606){_0x314115=_0x314115-0x0;var _0x1347df=_0x9923[_0x314115];return _0x1347df;};'use strict';var multer=require(_0x3992('0x0'));var util=require(_0x3992('0x1'));var path=require(_0x3992('0x2'));var timeout=require(_0x3992('0x3'));var express=require(_0x3992('0x4'));var router=express[_0x3992('0x5')]();var auth=require(_0x3992('0x6'));var interaction=require(_0x3992('0x7'));var config=require(_0x3992('0x8'));module['exports']=router;
\ No newline at end of file
index 640a038..6971152 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['exports','sequelize'];(function(_0x1b2839,_0x211891){var _0x30e7e8=function(_0x40c0b0){while(--_0x40c0b0){_0x1b2839['push'](_0x1b2839['shift']());}};_0x30e7e8(++_0x211891);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x3cdd31,_0x353422){var _0x5f3b7c=function(_0x3a6235){while(--_0x3a6235){_0x3cdd31['push'](_0x3cdd31['shift']());}};_0x5f3b7c(++_0x353422);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 712fdab..7eccdf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f37=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8f37,0x1b0));var _0x78f3=function(_0x532c7f,_0x524a72){_0x532c7f=_0x532c7f-0x0;var _0x1e4a96=_0x8f37[_0x532c7f];return _0x1e4a96;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x78f3('0x0'))(_0x78f3('0x1'));var moment=require('moment');var BPromise=require(_0x78f3('0x2'));var rp=require(_0x78f3('0x3'));var fs=require('fs');var path=require(_0x78f3('0x4'));var rimraf=require(_0x78f3('0x5'));var config=require(_0x78f3('0x6'));var attributes=require(_0x78f3('0x7'));module[_0x78f3('0x8')]=function(_0x24cc8f,_0x1b01e4){return _0x24cc8f[_0x78f3('0x9')](_0x78f3('0xa'),attributes,{'tableName':_0x78f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeda8=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserChatQueue','lodash'];(function(_0xb2b102,_0x158925){var _0x20f6b2=function(_0x4fa720){while(--_0x4fa720){_0xb2b102['push'](_0xb2b102['shift']());}};_0x20f6b2(++_0x158925);}(_0xeda8,0xaf));var _0x8eda=function(_0x1a1fcc,_0x32d090){_0x1a1fcc=_0x1a1fcc-0x0;var _0x2f5ff9=_0xeda8[_0x1a1fcc];return _0x2f5ff9;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require(_0x8eda('0x2'))('api');var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8eda('0x6'));var config=require(_0x8eda('0x7'));var attributes=require('./userChatQueue.attributes');module[_0x8eda('0x8')]=function(_0x55098f,_0x14f30b){return _0x55098f[_0x8eda('0x9')](_0x8eda('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bc4e07a..6efae64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85b2=['request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x45d174,_0x47c6bb){var _0x3a0128=function(_0xdd4c62){while(--_0xdd4c62){_0x45d174['push'](_0x45d174['shift']());}};_0x3a0128(++_0x47c6bb);}(_0x85b2,0x11f));var _0x285b=function(_0x71988b,_0x253aa1){_0x71988b=_0x71988b-0x0;var _0x192602=_0x85b2[_0x71988b];return _0x192602;};'use strict';var _=require(_0x285b('0x0'));var util=require(_0x285b('0x1'));var moment=require(_0x285b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x285b('0x3'))['db'];var utils=require(_0x285b('0x4'));var logger=require('../../config/logger')(_0x285b('0x5'));var config=require(_0x285b('0x6'));var jayson=require(_0x285b('0x7'));var client=jayson[_0x285b('0x8')][_0x285b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x164392,_0x485db7,_0x4bc965){return new BPromise(function(_0x192a68,_0x2091ef){return client[_0x285b('0xa')](_0x164392,_0x4bc965)['then'](function(_0x3c81ec){logger[_0x285b('0xb')](_0x285b('0xc'),_0x485db7,_0x285b('0xd'));logger[_0x285b('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x485db7,_0x285b('0xd'),JSON[_0x285b('0xf')](_0x3c81ec));if(_0x3c81ec[_0x285b('0x10')]){if(_0x3c81ec[_0x285b('0x10')][_0x285b('0x11')]===0x1f4){logger[_0x285b('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x485db7,_0x3c81ec[_0x285b('0x10')]['message']);return _0x2091ef(_0x3c81ec[_0x285b('0x10')][_0x285b('0x12')]);}logger['error'](_0x285b('0xc'),_0x485db7,_0x3c81ec[_0x285b('0x10')][_0x285b('0x12')]);return _0x192a68(_0x3c81ec[_0x285b('0x10')][_0x285b('0x12')]);}else{logger[_0x285b('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x485db7,_0x285b('0xd'));_0x192a68(_0x3c81ec['result'][_0x285b('0x12')]);}})[_0x285b('0x13')](function(_0x4fd4a7){logger[_0x285b('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x485db7,_0x4fd4a7);_0x2091ef(_0x4fd4a7);});});}
\ No newline at end of file
+var _0xabcb=['../../config/logger','rpc','../../config/environment','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment','randomstring','../../mysqldb'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xabcb,0xba));var _0xbabc=function(_0x459376,_0xc3e439){_0x459376=_0x459376-0x0;var _0x589d16=_0xabcb[_0x459376];return _0x589d16;};'use strict';var _=require('lodash');var util=require(_0xbabc('0x0'));var moment=require(_0xbabc('0x1'));var BPromise=require('bluebird');var rs=require(_0xbabc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbabc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbabc('0x4'))(_0xbabc('0x5'));var config=require(_0xbabc('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbabc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32cfbf,_0x254881,_0x1f81e9){return new BPromise(function(_0x1a6bc4,_0x9706f3){return client[_0xbabc('0x8')](_0x32cfbf,_0x1f81e9)[_0xbabc('0x9')](function(_0x5be235){logger['info'](_0xbabc('0xa'),_0x254881,_0xbabc('0xb'));logger[_0xbabc('0xc')](_0xbabc('0xd'),_0x254881,_0xbabc('0xb'),JSON[_0xbabc('0xe')](_0x5be235));if(_0x5be235[_0xbabc('0xf')]){if(_0x5be235[_0xbabc('0xf')]['code']===0x1f4){logger['error'](_0xbabc('0xa'),_0x254881,_0x5be235[_0xbabc('0xf')][_0xbabc('0x10')]);return _0x9706f3(_0x5be235[_0xbabc('0xf')][_0xbabc('0x10')]);}logger[_0xbabc('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x254881,_0x5be235['error'][_0xbabc('0x10')]);return _0x1a6bc4(_0x5be235[_0xbabc('0xf')][_0xbabc('0x10')]);}else{logger[_0xbabc('0x11')](_0xbabc('0xa'),_0x254881,'request\x20sent');_0x1a6bc4(_0x5be235[_0xbabc('0x12')][_0xbabc('0x10')]);}})['catch'](function(_0x35f568){logger[_0xbabc('0xf')](_0xbabc('0xa'),_0x254881,_0x35f568);_0x9706f3(_0x35f568);});});}
\ No newline at end of file
index a7f3271..d41a643 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5c4=['../../config/environment','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3e4b55,_0x6632f7){var _0x3a51ba=function(_0x3158e5){while(--_0x3158e5){_0x3e4b55['push'](_0x3e4b55['shift']());}};_0x3a51ba(++_0x6632f7);}(_0xa5c4,0x18e));var _0x4a5c=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0xa5c4[_0x297eea];return _0x1c42d2;};'use strict';var multer=require(_0x4a5c('0x0'));var util=require(_0x4a5c('0x1'));var path=require(_0x4a5c('0x2'));var timeout=require(_0x4a5c('0x3'));var express=require('express');var router=express[_0x4a5c('0x4')]();var auth=require(_0x4a5c('0x5'));var interaction=require(_0x4a5c('0x6'));var config=require(_0x4a5c('0x7'));module[_0x4a5c('0x8')]=router;
\ No newline at end of file
+var _0xa120=['express','Router','../../components/auth/service','exports','multer','util','path','connect-timeout'];(function(_0x70bf1e,_0x5ad93d){var _0x1b10a6=function(_0xed4f62){while(--_0xed4f62){_0x70bf1e['push'](_0x70bf1e['shift']());}};_0x1b10a6(++_0x5ad93d);}(_0xa120,0x64));var _0x0a12=function(_0xa3fa84,_0x5afa5f){_0xa3fa84=_0xa3fa84-0x0;var _0xfe226a=_0xa120[_0xa3fa84];return _0xfe226a;};'use strict';var multer=require(_0x0a12('0x0'));var util=require(_0x0a12('0x1'));var path=require(_0x0a12('0x2'));var timeout=require(_0x0a12('0x3'));var express=require(_0x0a12('0x4'));var router=express[_0x0a12('0x5')]();var auth=require(_0x0a12('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x0a12('0x7')]=router;
\ No newline at end of file
index df3b310..066821f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e3f=['STRING','sequelize','exports','INTEGER'];(function(_0x51df5e,_0x582a91){var _0x108d7d=function(_0x464a1e){while(--_0x464a1e){_0x51df5e['push'](_0x51df5e['shift']());}};_0x108d7d(++_0x582a91);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xf8e3('0x0'));module[_0xf8e3('0x1')]={'penalty':{'type':Sequelize[_0xf8e3('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xf8e3('0x3')]}};
\ No newline at end of file
+var _0x2547=['INTEGER','STRING','exports'];(function(_0x543a8e,_0x416b83){var _0x22d02b=function(_0x54ff4d){while(--_0x54ff4d){_0x543a8e['push'](_0x543a8e['shift']());}};_0x22d02b(++_0x416b83);}(_0x2547,0x1cd));var _0x7254=function(_0x525253,_0x27bb8a){_0x525253=_0x525253-0x0;var _0xe076ce=_0x2547[_0x525253];return _0xe076ce;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'penalty':{'type':Sequelize[_0x7254('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7254('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x7254('0x2')]}};
\ No newline at end of file
index 8cc1bb3..9695503 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','../../config/logger'];(function(_0xdd9a5f,_0x3ced93){var _0x3464b7=function(_0x35b534){while(--_0x35b534){_0xdd9a5f['push'](_0xdd9a5f['shift']());}};_0x3464b7(++_0x3ced93);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d4663,_0x17cb51){_0x1d4663=_0x1d4663-0x0;var _0x581eb5=_0xb10b[_0x1d4663];return _0x581eb5;};'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')]('UserFaxQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','../../config/logger'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0xb10b,0x12a));var _0xbb10=function(_0x49b0bf,_0x2c50e9){_0x49b0bf=_0x49b0bf-0x0;var _0x4e6b5c=_0xb10b[_0x49b0bf];return _0x4e6b5c;};'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')]('UserFaxQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5ce3ccb..0042eab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bf1=['debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x6bf1,0x71));var _0x16bf=function(_0x56ffb6,_0x27eab6){_0x56ffb6=_0x56ffb6-0x0;var _0x40b63=_0x6bf1[_0x56ffb6];return _0x40b63;};'use strict';var _=require(_0x16bf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x16bf('0x1'));var rs=require(_0x16bf('0x2'));var fs=require('fs');var Redis=require(_0x16bf('0x3'));var db=require(_0x16bf('0x4'))['db'];var utils=require(_0x16bf('0x5'));var logger=require('../../config/logger')(_0x16bf('0x6'));var config=require(_0x16bf('0x7'));var jayson=require(_0x16bf('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ff980,_0x166bb1,_0x248a00){return new BPromise(function(_0x3852d0,_0x150cf4){return client[_0x16bf('0x9')](_0x3ff980,_0x248a00)[_0x16bf('0xa')](function(_0x29a715){logger['info'](_0x16bf('0xb'),_0x166bb1,_0x16bf('0xc'));logger[_0x16bf('0xd')](_0x16bf('0xe'),_0x166bb1,_0x16bf('0xc'),JSON[_0x16bf('0xf')](_0x29a715));if(_0x29a715['error']){if(_0x29a715['error'][_0x16bf('0x10')]===0x1f4){logger[_0x16bf('0x11')](_0x16bf('0xb'),_0x166bb1,_0x29a715[_0x16bf('0x11')][_0x16bf('0x12')]);return _0x150cf4(_0x29a715[_0x16bf('0x11')][_0x16bf('0x12')]);}logger[_0x16bf('0x11')](_0x16bf('0xb'),_0x166bb1,_0x29a715['error'][_0x16bf('0x12')]);return _0x3852d0(_0x29a715[_0x16bf('0x11')]['message']);}else{logger[_0x16bf('0x13')](_0x16bf('0xb'),_0x166bb1,_0x16bf('0xc'));_0x3852d0(_0x29a715[_0x16bf('0x14')][_0x16bf('0x12')]);}})['catch'](function(_0x5456ee){logger['error'](_0x16bf('0xb'),_0x166bb1,_0x5456ee);_0x150cf4(_0x5456ee);});});}
\ No newline at end of file
+var _0xeff4=['util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0xb5be71,_0x402295){var _0x538c0a=function(_0x51db3d){while(--_0x51db3d){_0xb5be71['push'](_0xb5be71['shift']());}};_0x538c0a(++_0x402295);}(_0xeff4,0xe5));var _0x4eff=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xeff4[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0x4eff('0x0'));var util=require(_0x4eff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4eff('0x2'));var fs=require('fs');var Redis=require(_0x4eff('0x3'));var db=require(_0x4eff('0x4'))['db'];var utils=require(_0x4eff('0x5'));var logger=require('../../config/logger')(_0x4eff('0x6'));var config=require(_0x4eff('0x7'));var jayson=require(_0x4eff('0x8'));var client=jayson[_0x4eff('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5657,_0x3bde8e,_0x5a8c5a){return new BPromise(function(_0x5bf1e8,_0x760afd){return client[_0x4eff('0xa')](_0x3b5657,_0x5a8c5a)[_0x4eff('0xb')](function(_0x1fa28e){logger[_0x4eff('0xc')](_0x4eff('0xd'),_0x3bde8e,'request\x20sent');logger[_0x4eff('0xe')](_0x4eff('0xf'),_0x3bde8e,_0x4eff('0x10'),JSON[_0x4eff('0x11')](_0x1fa28e));if(_0x1fa28e[_0x4eff('0x12')]){if(_0x1fa28e[_0x4eff('0x12')][_0x4eff('0x13')]===0x1f4){logger[_0x4eff('0x12')](_0x4eff('0xd'),_0x3bde8e,_0x1fa28e['error']['message']);return _0x760afd(_0x1fa28e[_0x4eff('0x12')][_0x4eff('0x14')]);}logger[_0x4eff('0x12')](_0x4eff('0xd'),_0x3bde8e,_0x1fa28e[_0x4eff('0x12')]['message']);return _0x5bf1e8(_0x1fa28e[_0x4eff('0x12')][_0x4eff('0x14')]);}else{logger['info'](_0x4eff('0xd'),_0x3bde8e,_0x4eff('0x10'));_0x5bf1e8(_0x1fa28e[_0x4eff('0x15')][_0x4eff('0x14')]);}})[_0x4eff('0x16')](function(_0x597e0e){logger[_0x4eff('0x12')](_0x4eff('0xd'),_0x3bde8e,_0x597e0e);_0x760afd(_0x597e0e);});});}
\ No newline at end of file
index 58b1eb7..92c8728 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x081e=['../../components/interaction/service','../../config/environment','exports','multer','path','express','Router'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x081e,0x129));var _0xe081=function(_0x13915f,_0x3d90c6){_0x13915f=_0x13915f-0x0;var _0x373181=_0x081e[_0x13915f];return _0x373181;};'use strict';var multer=require(_0xe081('0x0'));var util=require('util');var path=require(_0xe081('0x1'));var timeout=require('connect-timeout');var express=require(_0xe081('0x2'));var router=express[_0xe081('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe081('0x4'));var config=require(_0xe081('0x5'));module[_0xe081('0x6')]=router;
\ No newline at end of file
+var _0xf3db=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports','multer'];(function(_0x217a3f,_0x25c079){var _0x58228f=function(_0x386e46){while(--_0x386e46){_0x217a3f['push'](_0x217a3f['shift']());}};_0x58228f(++_0x25c079);}(_0xf3db,0x195));var _0xbf3d=function(_0x38e170,_0x5b98b4){_0x38e170=_0x38e170-0x0;var _0x291be0=_0xf3db[_0x38e170];return _0x291be0;};'use strict';var multer=require(_0xbf3d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbf3d('0x1'));var express=require(_0xbf3d('0x2'));var router=express[_0xbf3d('0x3')]();var auth=require(_0xbf3d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbf3d('0x5'));module[_0xbf3d('0x6')]=router;
\ No newline at end of file
index dd8fee0..182f583 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['INTEGER','sequelize','exports'];(function(_0x469ab8,_0xeb5939){var _0x1f7a49=function(_0x3cb381){while(--_0x3cb381){_0x469ab8['push'](_0x469ab8['shift']());}};_0x1f7a49(++_0xeb5939);}(_0xe706,0xa3));var _0x6e70=function(_0x4612df,_0x37a8f7){_0x4612df=_0x4612df-0x0;var _0x2804c6=_0xe706[_0x4612df];return _0x2804c6;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x31826c,_0x1995c5){var _0x20bbd7=function(_0x2a98ab){while(--_0x2a98ab){_0x31826c['push'](_0x31826c['shift']());}};_0x20bbd7(++_0x1995c5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index b59612f..009a1f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3b8080,_0x5ba504){var _0x573bdc=function(_0x56f7b0){while(--_0x56f7b0){_0x3b8080['push'](_0x3b8080['shift']());}};_0x573bdc(++_0x5ba504);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5c4bf5,_0x28b32a){var _0x3625eb=function(_0xb5a66a){while(--_0xb5a66a){_0x5c4bf5['push'](_0x5c4bf5['shift']());}};_0x3625eb(++_0x28b32a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 02e59e6..2c3a042 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x254a=['http','request','info','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserMailQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x254a,0x138));var _0xa254=function(_0x29782b,_0x33ff83){_0x29782b=_0x29782b-0x0;var _0x5c2c1f=_0x254a[_0x29782b];return _0x5c2c1f;};'use strict';var _=require(_0xa254('0x0'));var util=require(_0xa254('0x1'));var moment=require(_0xa254('0x2'));var BPromise=require('bluebird');var rs=require(_0xa254('0x3'));var fs=require('fs');var Redis=require(_0xa254('0x4'));var db=require(_0xa254('0x5'))['db'];var utils=require(_0xa254('0x6'));var logger=require('../../config/logger')(_0xa254('0x7'));var config=require('../../config/environment');var jayson=require(_0xa254('0x8'));var client=jayson[_0xa254('0x9')][_0xa254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x597d72,_0x5951b2,_0xaeed42){return new BPromise(function(_0x352a44,_0x50c5a3){return client[_0xa254('0xb')](_0x597d72,_0xaeed42)['then'](function(_0x19d140){logger[_0xa254('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x5951b2,'request\x20sent');logger[_0xa254('0xd')](_0xa254('0xe'),_0x5951b2,_0xa254('0xf'),JSON[_0xa254('0x10')](_0x19d140));if(_0x19d140[_0xa254('0x11')]){if(_0x19d140['error'][_0xa254('0x12')]===0x1f4){logger['error']('UserMailQueue,\x20%s,\x20%s',_0x5951b2,_0x19d140[_0xa254('0x11')][_0xa254('0x13')]);return _0x50c5a3(_0x19d140['error'][_0xa254('0x13')]);}logger[_0xa254('0x11')](_0xa254('0x14'),_0x5951b2,_0x19d140[_0xa254('0x11')][_0xa254('0x13')]);return _0x352a44(_0x19d140['error'][_0xa254('0x13')]);}else{logger[_0xa254('0xc')](_0xa254('0x14'),_0x5951b2,_0xa254('0xf'));_0x352a44(_0x19d140[_0xa254('0x15')][_0xa254('0x13')]);}})[_0xa254('0x16')](function(_0x1f21ae){logger[_0xa254('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x5951b2,_0x1f21ae);_0x50c5a3(_0x1f21ae);});});}
\ No newline at end of file
+var _0xc4f5=['debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x54517c,_0x248d46){var _0x3e519a=function(_0x330326){while(--_0x330326){_0x54517c['push'](_0x54517c['shift']());}};_0x3e519a(++_0x248d46);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x1eb3f6,_0x3f8dc7){_0x1eb3f6=_0x1eb3f6-0x0;var _0x511f68=_0xc4f5[_0x1eb3f6];return _0x511f68;};'use strict';var _=require('lodash');var util=require(_0x5c4f('0x0'));var moment=require(_0x5c4f('0x1'));var BPromise=require(_0x5c4f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c4f('0x3'));var db=require(_0x5c4f('0x4'))['db'];var utils=require(_0x5c4f('0x5'));var logger=require(_0x5c4f('0x6'))(_0x5c4f('0x7'));var config=require('../../config/environment');var jayson=require(_0x5c4f('0x8'));var client=jayson[_0x5c4f('0x9')][_0x5c4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x123651,_0x51be50,_0x48f095){return new BPromise(function(_0x1ec0c8,_0x4a7bd4){return client[_0x5c4f('0xb')](_0x123651,_0x48f095)['then'](function(_0x381d46){logger[_0x5c4f('0xc')](_0x5c4f('0xd'),_0x51be50,_0x5c4f('0xe'));logger[_0x5c4f('0xf')](_0x5c4f('0x10'),_0x51be50,_0x5c4f('0xe'),JSON['stringify'](_0x381d46));if(_0x381d46[_0x5c4f('0x11')]){if(_0x381d46[_0x5c4f('0x11')]['code']===0x1f4){logger[_0x5c4f('0x11')](_0x5c4f('0xd'),_0x51be50,_0x381d46[_0x5c4f('0x11')][_0x5c4f('0x12')]);return _0x4a7bd4(_0x381d46[_0x5c4f('0x11')]['message']);}logger['error'](_0x5c4f('0xd'),_0x51be50,_0x381d46[_0x5c4f('0x11')][_0x5c4f('0x12')]);return _0x1ec0c8(_0x381d46[_0x5c4f('0x11')][_0x5c4f('0x12')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x51be50,_0x5c4f('0xe'));_0x1ec0c8(_0x381d46['result']['message']);}})[_0x5c4f('0x13')](function(_0x5154eb){logger[_0x5c4f('0x11')](_0x5c4f('0xd'),_0x51be50,_0x5154eb);_0x4a7bd4(_0x5154eb);});});}
\ No newline at end of file
index 0600081..e272920 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe49=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xbe49,0x1c1));var _0x9be4=function(_0x33678b,_0x528b1c){_0x33678b=_0x33678b-0x0;var _0x326df8=_0xbe49[_0x33678b];return _0x326df8;};'use strict';var multer=require('multer');var util=require(_0x9be4('0x0'));var path=require(_0x9be4('0x1'));var timeout=require(_0x9be4('0x2'));var express=require('express');var router=express[_0x9be4('0x3')]();var auth=require(_0x9be4('0x4'));var interaction=require(_0x9be4('0x5'));var config=require(_0x9be4('0x6'));module[_0x9be4('0x7')]=router;
\ No newline at end of file
+var _0xb276=['../../config/environment','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x488600,_0x1589f8){var _0x2df9cc=function(_0x129557){while(--_0x129557){_0x488600['push'](_0x488600['shift']());}};_0x2df9cc(++_0x1589f8);}(_0xb276,0x1bb));var _0x6b27=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0xb276[_0x4e1a49];return _0x136aae;};'use strict';var multer=require('multer');var util=require(_0x6b27('0x0'));var path=require(_0x6b27('0x1'));var timeout=require(_0x6b27('0x2'));var express=require(_0x6b27('0x3'));var router=express[_0x6b27('0x4')]();var auth=require(_0x6b27('0x5'));var interaction=require(_0x6b27('0x6'));var config=require(_0x6b27('0x7'));module[_0x6b27('0x8')]=router;
\ No newline at end of file
index 86cc148..7a22d92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['INTEGER','sequelize','exports'];(function(_0x1bab80,_0x4eee84){var _0x8a83ae=function(_0x3e6555){while(--_0x3e6555){_0x1bab80['push'](_0x1bab80['shift']());}};_0x8a83ae(++_0x4eee84);}(_0xe706,0xa3));var _0x6e70=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xe706[_0x18cd5b];return _0x5eaa52;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe706=['INTEGER','sequelize','exports'];(function(_0x1bba0f,_0x580616){var _0x4ae9d2=function(_0x47cf55){while(--_0x47cf55){_0x1bba0f['push'](_0x1bba0f['shift']());}};_0x4ae9d2(++_0x580616);}(_0xe706,0xa3));var _0x6e70=function(_0x1d1fdf,_0x33ba5a){_0x1d1fdf=_0x1d1fdf-0x0;var _0x3521d6=_0xe706[_0x1d1fdf];return _0x3521d6;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 2bdd176..6af9d9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3199=['user_has_openchannel_queues','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define'];(function(_0x11183a,_0x4b2f2b){var _0x2e779c=function(_0x4a2310){while(--_0x4a2310){_0x11183a['push'](_0x11183a['shift']());}};_0x2e779c(++_0x4b2f2b);}(_0x3199,0x169));var _0x9319=function(_0x344ebe,_0x43c595){_0x344ebe=_0x344ebe-0x0;var _0x54724a=_0x3199[_0x344ebe];return _0x54724a;};'use strict';var _=require(_0x9319('0x0'));var util=require('util');var logger=require(_0x9319('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9319('0x2'));var rp=require(_0x9319('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9319('0x4'));var config=require(_0x9319('0x5'));var attributes=require(_0x9319('0x6'));module[_0x9319('0x7')]=function(_0xa28833,_0x3a4082){return _0xa28833[_0x9319('0x8')]('UserOpenchannelQueue',attributes,{'tableName':_0x9319('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1ead=['request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','moment','bluebird'];(function(_0x29c77f,_0x24834e){var _0x574e4b=function(_0x2a7f51){while(--_0x2a7f51){_0x29c77f['push'](_0x29c77f['shift']());}};_0x574e4b(++_0x24834e);}(_0x1ead,0x76));var _0xd1ea=function(_0x145b6a,_0x61816){_0x145b6a=_0x145b6a-0x0;var _0x5010d6=_0x1ead[_0x145b6a];return _0x5010d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd1ea('0x0'));var BPromise=require(_0xd1ea('0x1'));var rp=require(_0xd1ea('0x2'));var fs=require('fs');var path=require(_0xd1ea('0x3'));var rimraf=require(_0xd1ea('0x4'));var config=require(_0xd1ea('0x5'));var attributes=require(_0xd1ea('0x6'));module[_0xd1ea('0x7')]=function(_0x4ea48f,_0x3e35c6){return _0x4ea48f['define'](_0xd1ea('0x8'),attributes,{'tableName':_0xd1ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cb1b83c..b441ed4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x792d=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client'];(function(_0x178bf7,_0x4e1f61){var _0x7080d6=function(_0xe253bb){while(--_0xe253bb){_0x178bf7['push'](_0x178bf7['shift']());}};_0x7080d6(++_0x4e1f61);}(_0x792d,0x160));var _0xd792=function(_0x3c95ba,_0x3355ea){_0x3c95ba=_0x3c95ba-0x0;var _0x2cdae7=_0x792d[_0x3c95ba];return _0x2cdae7;};'use strict';var _=require('lodash');var util=require(_0xd792('0x0'));var moment=require(_0xd792('0x1'));var BPromise=require('bluebird');var rs=require(_0xd792('0x2'));var fs=require('fs');var Redis=require(_0xd792('0x3'));var db=require(_0xd792('0x4'))['db'];var utils=require(_0xd792('0x5'));var logger=require('../../config/logger')(_0xd792('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd792('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41bbbc,_0x205ceb,_0x5c0ff0){return new BPromise(function(_0x52edaa,_0x3f4888){return client['request'](_0x41bbbc,_0x5c0ff0)[_0xd792('0x8')](function(_0x24aedf){logger[_0xd792('0x9')](_0xd792('0xa'),_0x205ceb,_0xd792('0xb'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x205ceb,_0xd792('0xb'),JSON[_0xd792('0xc')](_0x24aedf));if(_0x24aedf['error']){if(_0x24aedf[_0xd792('0xd')][_0xd792('0xe')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x205ceb,_0x24aedf[_0xd792('0xd')][_0xd792('0xf')]);return _0x3f4888(_0x24aedf[_0xd792('0xd')][_0xd792('0xf')]);}logger[_0xd792('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x205ceb,_0x24aedf[_0xd792('0xd')][_0xd792('0xf')]);return _0x52edaa(_0x24aedf[_0xd792('0xd')][_0xd792('0xf')]);}else{logger[_0xd792('0x9')](_0xd792('0xa'),_0x205ceb,_0xd792('0xb'));_0x52edaa(_0x24aedf[_0xd792('0x10')][_0xd792('0xf')]);}})[_0xd792('0x11')](function(_0x65426d){logger[_0xd792('0xd')](_0xd792('0xa'),_0x205ceb,_0x65426d);_0x3f4888(_0x65426d);});});}
\ No newline at end of file
+var _0xfea1=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug'];(function(_0x1d7feb,_0x4bf95e){var _0x275c84=function(_0x546cd1){while(--_0x546cd1){_0x1d7feb['push'](_0x1d7feb['shift']());}};_0x275c84(++_0x4bf95e);}(_0xfea1,0xaf));var _0x1fea=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0xfea1[_0x4bb145];return _0x4db596;};'use strict';var _=require(_0x1fea('0x0'));var util=require(_0x1fea('0x1'));var moment=require(_0x1fea('0x2'));var BPromise=require(_0x1fea('0x3'));var rs=require(_0x1fea('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1fea('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1fea('0x6'))('rpc');var config=require(_0x1fea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1fea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cb522,_0x23a167,_0x2f94ca){return new BPromise(function(_0x1a6ea4,_0xaff416){return client[_0x1fea('0x9')](_0x1cb522,_0x2f94ca)[_0x1fea('0xa')](function(_0x187586){logger[_0x1fea('0xb')](_0x1fea('0xc'),_0x23a167,'request\x20sent');logger[_0x1fea('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x23a167,_0x1fea('0xe'),JSON[_0x1fea('0xf')](_0x187586));if(_0x187586[_0x1fea('0x10')]){if(_0x187586[_0x1fea('0x10')][_0x1fea('0x11')]===0x1f4){logger[_0x1fea('0x10')](_0x1fea('0xc'),_0x23a167,_0x187586[_0x1fea('0x10')][_0x1fea('0x12')]);return _0xaff416(_0x187586[_0x1fea('0x10')]['message']);}logger[_0x1fea('0x10')](_0x1fea('0xc'),_0x23a167,_0x187586[_0x1fea('0x10')][_0x1fea('0x12')]);return _0x1a6ea4(_0x187586['error'][_0x1fea('0x12')]);}else{logger[_0x1fea('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x23a167,'request\x20sent');_0x1a6ea4(_0x187586[_0x1fea('0x13')][_0x1fea('0x12')]);}})[_0x1fea('0x14')](function(_0x49496d){logger[_0x1fea('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x23a167,_0x49496d);_0xaff416(_0x49496d);});});}
\ No newline at end of file
index 6492bdd..8cceb1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bf1=['index','/describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated'];(function(_0x52c4e9,_0x5412d0){var _0x252a03=function(_0x57857c){while(--_0x57857c){_0x52c4e9['push'](_0x52c4e9['shift']());}};_0x252a03(++_0x5412d0);}(_0x2bf1,0x1d4));var _0x12bf=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x2bf1[_0x23e7c1];return _0x1add43;};'use strict';var multer=require(_0x12bf('0x0'));var util=require(_0x12bf('0x1'));var path=require(_0x12bf('0x2'));var timeout=require(_0x12bf('0x3'));var express=require(_0x12bf('0x4'));var router=express[_0x12bf('0x5')]();var auth=require(_0x12bf('0x6'));var interaction=require(_0x12bf('0x7'));var config=require(_0x12bf('0x8'));var controller=require(_0x12bf('0x9'));router[_0x12bf('0xa')]('/',auth[_0x12bf('0xb')](),controller[_0x12bf('0xc')]);router[_0x12bf('0xa')](_0x12bf('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x12bf('0xa')](_0x12bf('0xe'),auth[_0x12bf('0xb')](),controller[_0x12bf('0xf')]);router[_0x12bf('0xa')](_0x12bf('0x10'),auth[_0x12bf('0xb')](),controller[_0x12bf('0x11')]);router[_0x12bf('0xa')](_0x12bf('0x12'),auth[_0x12bf('0xb')](),controller[_0x12bf('0x13')]);router[_0x12bf('0x14')]('/',auth[_0x12bf('0xb')](),controller[_0x12bf('0x15')]);router['post'](_0x12bf('0x16'),auth[_0x12bf('0xb')](),controller[_0x12bf('0x17')]);router['post']('/:id/sections',auth[_0x12bf('0xb')](),controller[_0x12bf('0x18')]);router['post'](_0x12bf('0x12'),auth[_0x12bf('0xb')](),controller[_0x12bf('0x19')]);router['put'](_0x12bf('0xe'),auth[_0x12bf('0xb')](),controller[_0x12bf('0x1a')]);router[_0x12bf('0x1b')](_0x12bf('0xe'),auth['isAuthenticated'](),controller[_0x12bf('0x1c')]);router[_0x12bf('0x1b')](_0x12bf('0x10'),auth[_0x12bf('0xb')](),controller[_0x12bf('0x1d')]);router[_0x12bf('0x1b')](_0x12bf('0x12'),auth[_0x12bf('0xb')](),controller[_0x12bf('0x1e')]);module[_0x12bf('0x1f')]=router;
\ No newline at end of file
+var _0x5ff1=['/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','put','destroy','delete','removeSections','removeResources','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x3452a8,_0x4bfaa4){var _0x233814=function(_0x40b537){while(--_0x40b537){_0x3452a8['push'](_0x3452a8['shift']());}};_0x233814(++_0x4bfaa4);}(_0x5ff1,0xa0));var _0x15ff=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0x5ff1[_0x256d6a];return _0x460058;};'use strict';var multer=require(_0x15ff('0x0'));var util=require(_0x15ff('0x1'));var path=require(_0x15ff('0x2'));var timeout=require('connect-timeout');var express=require(_0x15ff('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x15ff('0x4'));var config=require(_0x15ff('0x5'));var controller=require(_0x15ff('0x6'));router[_0x15ff('0x7')]('/',auth[_0x15ff('0x8')](),controller[_0x15ff('0x9')]);router['get'](_0x15ff('0xa'),auth['isAuthenticated'](),controller[_0x15ff('0xb')]);router[_0x15ff('0x7')](_0x15ff('0xc'),auth['isAuthenticated'](),controller[_0x15ff('0xd')]);router[_0x15ff('0x7')](_0x15ff('0xe'),auth[_0x15ff('0x8')](),controller[_0x15ff('0xf')]);router[_0x15ff('0x7')](_0x15ff('0x10'),auth['isAuthenticated'](),controller[_0x15ff('0x11')]);router[_0x15ff('0x12')]('/',auth[_0x15ff('0x8')](),controller['create']);router[_0x15ff('0x12')](_0x15ff('0x13'),auth[_0x15ff('0x8')](),controller[_0x15ff('0x14')]);router[_0x15ff('0x12')]('/:id/sections',auth[_0x15ff('0x8')](),controller[_0x15ff('0x15')]);router['post'](_0x15ff('0x10'),auth[_0x15ff('0x8')](),controller[_0x15ff('0x16')]);router[_0x15ff('0x17')]('/:id',auth[_0x15ff('0x8')](),controller['update']);router['delete']('/:id',auth[_0x15ff('0x8')](),controller[_0x15ff('0x18')]);router[_0x15ff('0x19')](_0x15ff('0xe'),auth[_0x15ff('0x8')](),controller[_0x15ff('0x1a')]);router[_0x15ff('0x19')](_0x15ff('0x10'),auth['isAuthenticated'](),controller[_0x15ff('0x1b')]);module[_0x15ff('0x1c')]=router;
\ No newline at end of file
index 4a7e2ee..e48b444 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e27=['crudPermissions','getDataValue','split','sequelize','exports','STRING','setDataValue'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x0e27,0x13e));var _0x70e2=function(_0x3d75da,_0x372212){_0x3d75da=_0x3d75da-0x0;var _0x1bd83f=_0x0e27[_0x3d75da];return _0x1bd83f;};'use strict';var Sequelize=require(_0x70e2('0x0'));module[_0x70e2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x70e2('0x2')],'set':function(_0x54c98e){this[_0x70e2('0x3')](_0x70e2('0x4'),_0x54c98e?_0x54c98e['join'](''):[]);},'get':function(){return this[_0x70e2('0x5')](_0x70e2('0x4'))?this[_0x70e2('0x5')]('crudPermissions')[_0x70e2('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x4df5=['STRING','name','setDataValue','join','getDataValue','sequelize','exports'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x4df5,0x140));var _0x54df=function(_0x39ecb8,_0x2b23e8){_0x39ecb8=_0x39ecb8-0x0;var _0x310c8b=_0x4df5[_0x39ecb8];return _0x310c8b;};'use strict';var Sequelize=require(_0x54df('0x0'));module[_0x54df('0x1')]={'name':{'type':Sequelize[_0x54df('0x2')],'allowNull':![],'unique':_0x54df('0x3')},'crudPermissions':{'type':Sequelize[_0x54df('0x2')],'set':function(_0x2a7a45){this[_0x54df('0x4')]('crudPermissions',_0x2a7a45?_0x2a7a45[_0x54df('0x5')](''):[]);},'get':function(){return this[_0x54df('0x6')]('crudPermissions')?this[_0x54df('0x6')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x54df('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 2d525ef..28281ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fc0=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','then','end','error','send','index','UserProfile','rawAttributes','type','key','model','map','name','query','filters','attributes','intersection','nolimit','order','sort','pick','where','filter','merge','options','include','findAll','rows','catch','show','params','keys','fields','includeAll','find','create','body','createdAt','updatedAt','crudPermissions','omit','sequelize','transaction','get','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','destroy','describe','sectionId','Resources','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','findOne','Dashboard','forEach','Plugin','addResources','bulkCreate','removeResources','getResources','section','Sequelize','Unknown\x20section','childModel','ValidationError','Invalid\x20section\x20\x27','parentSections','length','all','ignore','union','VIRTUAL','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','DefaultReports','reportId','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','resourceId','odbc','squarerecordings','SquareRecording','SquareProjects','projects','JscriptyProject','contacts','Lists','ListId','lists','companies','CmCompany','globalcustomfields','ChatWebsite','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','role','agent','Telephones','telephone','queue','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','teams','Team','VoiceQueues','User','Users','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','CannedAnswer','dispositions','Disposition','customdashboards','Interval','pauses','Pause','sounds','Sound','tags','triggers','Trigger','trunks','Trunk','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','WhatsappAccount','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x96a37b,_0x3ecb9e){var _0xb2d2f6=function(_0x319640){while(--_0x319640){_0x96a37b['push'](_0x96a37b['shift']());}};_0xb2d2f6(++_0x3ecb9e);}(_0x7fc0,0x1b7));var _0x07fc=function(_0xdeac17,_0x19ad66){_0xdeac17=_0xdeac17-0x0;var _0x33aabd=_0x7fc0[_0xdeac17];return _0x33aabd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x07fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x07fc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07fc('0x2'));var moment=require(_0x07fc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x07fc('0x4'));var util=require(_0x07fc('0x5'));var path=require(_0x07fc('0x6'));var sox=require('sox');var csv=require(_0x07fc('0x7'));var ejs=require(_0x07fc('0x8'));var fs=require('fs');var _=require(_0x07fc('0x9'));var squel=require('squel');var crypto=require(_0x07fc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x07fc('0xb'));var toCsv=require(_0x07fc('0x7'));var querystring=require(_0x07fc('0xc'));var Papa=require(_0x07fc('0xd'));var Redis=require(_0x07fc('0xe'));var authService=require(_0x07fc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x07fc('0x10'));var hardwareService=require(_0x07fc('0x11'));var logger=require('../../config/logger')(_0x07fc('0x12'));var utils=require(_0x07fc('0x13'));var config=require(_0x07fc('0x14'));var db=require(_0x07fc('0x15'))['db'];config[_0x07fc('0x16')]=_[_0x07fc('0x17')](config[_0x07fc('0x16')],{'host':_0x07fc('0x18'),'port':0x18eb});var socket=require(_0x07fc('0x19'))(new Redis(config[_0x07fc('0x16')]));require(_0x07fc('0x1a'))[_0x07fc('0x1b')](socket);function respondWithStatusCode(_0x9a1436,_0x2de9e3){_0x2de9e3=_0x2de9e3||0xcc;return function(_0x6f43e4){if(_0x6f43e4){return _0x9a1436[_0x07fc('0x1c')](_0x2de9e3);}return _0x9a1436[_0x07fc('0x1d')](_0x2de9e3)['end']();};}function respondWithResult(_0x3c254e,_0x1a9cb8){_0x1a9cb8=_0x1a9cb8||0xc8;return function(_0x502f90){if(_0x502f90){return _0x3c254e[_0x07fc('0x1d')](_0x1a9cb8)[_0x07fc('0x1e')](_0x502f90);}};}function respondWithFilteredResult(_0x49f894,_0x2b85b3){return function(_0x3d588d){if(_0x3d588d){var _0xa11506=_0x3d588d[_0x07fc('0x1f')],_0x3b4b6f=_0x2b85b3[_0x07fc('0x20')],_0x33870c=_0x2b85b3[_0x07fc('0x20')]+_0x2b85b3[_0x07fc('0x21')],_0x13051e;if(_0x33870c>=_0xa11506){_0x33870c=_0xa11506;_0x13051e=0xc8;}else{_0x13051e=0xce;}_0x49f894[_0x07fc('0x1d')](_0x13051e);return _0x49f894[_0x07fc('0x22')](_0x07fc('0x23'),_0x3b4b6f+'-'+_0x33870c+'/'+_0xa11506)[_0x07fc('0x1e')](_0x3d588d);}return null;};}function patchUpdates(_0x453395){return function(_0x5dc6f1){try{jsonpatch[_0x07fc('0x24')](_0x5dc6f1,_0x453395,!![]);}catch(_0x2133fc){return BPromise['reject'](_0x2133fc);}return _0x5dc6f1[_0x07fc('0x25')]();};}function saveUpdates(_0x4006e0,_0x3d1bd4){return function(_0x506fef){if(_0x506fef){return _0x506fef['update'](_0x4006e0)[_0x07fc('0x26')](function(_0x67001e){return _0x67001e;});}return null;};}function removeEntity(_0x36a506,_0x24599f){return function(_0x1e3ab8){if(_0x1e3ab8){return _0x1e3ab8['destroy']()[_0x07fc('0x26')](function(){_0x36a506[_0x07fc('0x1d')](0xcc)[_0x07fc('0x27')]();});}};}function handleEntityNotFound(_0x17e16a,_0x227165){return function(_0x31c7af){if(!_0x31c7af){_0x17e16a[_0x07fc('0x1c')](0x194);}return _0x31c7af;};}function handleError(_0x284773,_0x4434e1){_0x4434e1=_0x4434e1||0x1f4;return function(_0x5d181e){logger[_0x07fc('0x28')](_0x5d181e['stack']);if(_0x5d181e['name']){delete _0x5d181e['name'];}_0x284773[_0x07fc('0x1d')](_0x4434e1)[_0x07fc('0x29')](_0x5d181e);};}exports[_0x07fc('0x2a')]=function(_0x492cc5,_0x4b6a6c){var _0x5277ac={},_0x65e44f={},_0x198c77={'count':0x0,'rows':[]};var _0x12a8d5=_['map'](db[_0x07fc('0x2b')][_0x07fc('0x2c')],function(_0x2e9862){return{'name':_0x2e9862['fieldName'],'type':_0x2e9862[_0x07fc('0x2d')][_0x07fc('0x2e')]};});_0x65e44f[_0x07fc('0x2f')]=_[_0x07fc('0x30')](_0x12a8d5,_0x07fc('0x31'));_0x65e44f[_0x07fc('0x32')]=_['keys'](_0x492cc5[_0x07fc('0x32')]);_0x65e44f[_0x07fc('0x33')]=_['intersection'](_0x65e44f[_0x07fc('0x2f')],_0x65e44f['query']);_0x5277ac[_0x07fc('0x34')]=_[_0x07fc('0x35')](_0x65e44f[_0x07fc('0x2f')],qs['fields'](_0x492cc5[_0x07fc('0x32')]['fields']));_0x5277ac[_0x07fc('0x34')]=_0x5277ac[_0x07fc('0x34')]['length']?_0x5277ac['attributes']:_0x65e44f[_0x07fc('0x2f')];if(!_0x492cc5[_0x07fc('0x32')]['hasOwnProperty'](_0x07fc('0x36'))){_0x5277ac[_0x07fc('0x21')]=qs['limit'](_0x492cc5[_0x07fc('0x32')][_0x07fc('0x21')]);_0x5277ac['offset']=qs[_0x07fc('0x20')](_0x492cc5[_0x07fc('0x32')][_0x07fc('0x20')]);}_0x5277ac[_0x07fc('0x37')]=qs[_0x07fc('0x38')](_0x492cc5[_0x07fc('0x32')][_0x07fc('0x38')]);_0x5277ac['where']=qs[_0x07fc('0x33')](_[_0x07fc('0x39')](_0x492cc5['query'],_0x65e44f[_0x07fc('0x33')]),_0x12a8d5);if(_0x492cc5['query']['filter']){_0x5277ac[_0x07fc('0x3a')]=_['merge'](_0x5277ac[_0x07fc('0x3a')],{'$or':_[_0x07fc('0x30')](_0x12a8d5,function(_0x1d798a){if(_0x1d798a[_0x07fc('0x2d')]!=='VIRTUAL'){var _0x3f94fd={};_0x3f94fd[_0x1d798a['name']]={'$like':'%'+_0x492cc5[_0x07fc('0x32')][_0x07fc('0x3b')]+'%'};return _0x3f94fd;}})});}_0x5277ac=_[_0x07fc('0x3c')]({},_0x5277ac,_0x492cc5[_0x07fc('0x3d')]);var _0x1beb7a={'where':_0x5277ac[_0x07fc('0x3a')]};return db['UserProfile'][_0x07fc('0x1f')](_0x1beb7a)['then'](function(_0x4460d1){_0x198c77[_0x07fc('0x1f')]=_0x4460d1;if(_0x492cc5[_0x07fc('0x32')]['includeAll']){_0x5277ac[_0x07fc('0x3e')]=[{'all':!![]}];}return db[_0x07fc('0x2b')][_0x07fc('0x3f')](_0x5277ac);})[_0x07fc('0x26')](function(_0x4078a0){_0x198c77[_0x07fc('0x40')]=_0x4078a0;return _0x198c77;})[_0x07fc('0x26')](respondWithFilteredResult(_0x4b6a6c,_0x5277ac))[_0x07fc('0x41')](handleError(_0x4b6a6c,null));};exports[_0x07fc('0x42')]=function(_0x48badf,_0x2d0ec9){var _0x4f9ca9={'raw':![],'where':{'id':_0x48badf[_0x07fc('0x43')]['id']}},_0x42addd={};_0x42addd[_0x07fc('0x2f')]=_[_0x07fc('0x44')](db['UserProfile'][_0x07fc('0x2c')]);_0x42addd[_0x07fc('0x32')]=_[_0x07fc('0x44')](_0x48badf[_0x07fc('0x32')]);_0x42addd['filters']=_[_0x07fc('0x35')](_0x42addd[_0x07fc('0x2f')],_0x42addd[_0x07fc('0x32')]);_0x4f9ca9[_0x07fc('0x34')]=_['intersection'](_0x42addd[_0x07fc('0x2f')],qs[_0x07fc('0x45')](_0x48badf[_0x07fc('0x32')][_0x07fc('0x45')]));_0x4f9ca9['attributes']=_0x4f9ca9[_0x07fc('0x34')]['length']?_0x4f9ca9[_0x07fc('0x34')]:_0x42addd[_0x07fc('0x2f')];if(_0x48badf['query'][_0x07fc('0x46')]){_0x4f9ca9[_0x07fc('0x3e')]=[{'all':!![]}];}_0x4f9ca9=_['merge']({},_0x4f9ca9,_0x48badf[_0x07fc('0x3d')]);return db['UserProfile'][_0x07fc('0x47')](_0x4f9ca9)[_0x07fc('0x26')](handleEntityNotFound(_0x2d0ec9,null))[_0x07fc('0x26')](respondWithResult(_0x2d0ec9,null))[_0x07fc('0x41')](handleError(_0x2d0ec9,null));};exports[_0x07fc('0x48')]=function(_0x37c498,_0x4ac470){return db[_0x07fc('0x2b')][_0x07fc('0x48')](_0x37c498[_0x07fc('0x49')],{})[_0x07fc('0x26')](respondWithResult(_0x4ac470,0xc9))[_0x07fc('0x41')](handleError(_0x4ac470,null));};exports['clone']=function(_0x3f4995,_0x528344){var _0xad48a1={'where':{'id':_0x3f4995[_0x07fc('0x43')]['id']}},_0xf8c0e9={};_0xf8c0e9[_0x07fc('0x2f')]=_[_0x07fc('0x44')](db[_0x07fc('0x2b')][_0x07fc('0x2c')]);_0xad48a1[_0x07fc('0x34')]=_[_0x07fc('0x35')](_0xf8c0e9['model'],qs['fields'](_0x3f4995[_0x07fc('0x32')][_0x07fc('0x45')]));_0xad48a1['attributes']=_0xad48a1['attributes']['length']?_0xad48a1[_0x07fc('0x34')]:_0xf8c0e9['model'];if(_0x3f4995['query'][_0x07fc('0x46')]){_0xad48a1['include']=[{'all':!![]}];}_0xad48a1=_['merge']({},_0xad48a1,_0x3f4995[_0x07fc('0x3d')]);return db[_0x07fc('0x2b')][_0x07fc('0x47')](_0xad48a1)[_0x07fc('0x26')](handleEntityNotFound(_0x528344,null))[_0x07fc('0x26')](function(_0x4ad2a8){if(_0x4ad2a8){var _0x544ad7=_0x4ad2a8['get']({'plain':!![]});_0x544ad7=qs['omit'](_0x544ad7,['id',_0x07fc('0x4a'),_0x07fc('0x4b'),_0x07fc('0x4c')]);_0x3f4995[_0x07fc('0x49')]=_[_0x07fc('0x4d')](_0x3f4995[_0x07fc('0x49')],['id',_0x07fc('0x4a'),_0x07fc('0x4b')]);return db[_0x07fc('0x4e')][_0x07fc('0x4f')](function(_0x27a3cb){return db['UserProfile'][_0x07fc('0x48')](_[_0x07fc('0x3c')](_0x544ad7,_0x3f4995[_0x07fc('0x49')]),{'include':_0x3f4995[_0x07fc('0x32')][_0x07fc('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x27a3cb})['then'](function(_0x47187b){var _0x3c7e64=_0x47187b[_0x07fc('0x50')]({'plain':!![]});return db[_0x07fc('0x51')]['findAll']({'where':{'userProfileId':_0x3f4995['params']['id']},'raw':!![]})[_0x07fc('0x26')](function(_0x5610d8){if(_0x5610d8){return BPromise[_0x07fc('0x52')](_0x5610d8,function(_0x544ddc){return new BPromise(function(_0x1106d0,_0x571b32){if(_0x544ddc[_0x07fc('0x53')]===null||_0x544ddc[_0x07fc('0x53')]===0x1)_0x1106d0(null);return db[_0x07fc('0x54')]['findAll']({'where':{'sectionId':_0x544ddc['id']},'raw':!![]})['then'](function(_0x12680e){var _0x2ca473=_[_0x07fc('0x30')](_0x12680e,function(_0x475257){return qs[_0x07fc('0x4d')](_0x475257,['id',_0x07fc('0x4a'),'updatedAt','sectionId']);});_0x1106d0(_0x2ca473);})['catch'](function(_0x1059dc){_0x571b32(_0x1059dc);});})[_0x07fc('0x26')](function(_0x2c5919){var _0x5464c0=qs[_0x07fc('0x4d')](_0x544ddc,['id',_0x07fc('0x4a'),_0x07fc('0x4b')]);_0x5464c0[_0x07fc('0x55')]=_0x3c7e64['id'];if(_0x2c5919)_0x5464c0['Resources']=_0x2c5919;return _0x5464c0;})[_0x07fc('0x26')](function(_0x4c67ee){return db[_0x07fc('0x51')][_0x07fc('0x48')](_0x4c67ee,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x27a3cb});});})['then'](function(){return _0x3c7e64;});}});});});}})[_0x07fc('0x26')](respondWithResult(_0x528344,0xc9))[_0x07fc('0x41')](handleError(_0x528344,null));};exports['update']=function(_0x1d90c7,_0x2a9d50){if(_0x1d90c7['body']['id']){delete _0x1d90c7[_0x07fc('0x49')]['id'];}return db[_0x07fc('0x2b')][_0x07fc('0x47')]({'where':{'id':_0x1d90c7[_0x07fc('0x43')]['id']}})['then'](handleEntityNotFound(_0x2a9d50,null))[_0x07fc('0x26')](saveUpdates(_0x1d90c7[_0x07fc('0x49')],null))[_0x07fc('0x26')](respondWithResult(_0x2a9d50,null))['catch'](handleError(_0x2a9d50,null));};exports[_0x07fc('0x56')]=function(_0x579b34,_0x4087a0){return db[_0x07fc('0x2b')][_0x07fc('0x47')]({'where':{'id':_0x579b34[_0x07fc('0x43')]['id']}})[_0x07fc('0x26')](handleEntityNotFound(_0x4087a0,null))[_0x07fc('0x26')](removeEntity(_0x4087a0,null))[_0x07fc('0x41')](handleError(_0x4087a0,null));};exports[_0x07fc('0x57')]=function(_0x21e370,_0x3db253){return db[_0x07fc('0x2b')][_0x07fc('0x57')]()['then'](respondWithResult(_0x3db253,null))[_0x07fc('0x41')](handleError(_0x3db253,null));};exports['addSections']=function(_0x5aedf0,_0xe6d39c){var _0x283c78=_0x5aedf0[_0x07fc('0x49')];return db['UserProfile'][_0x07fc('0x47')]({'where':{'id':_0x5aedf0[_0x07fc('0x43')]['id']}})[_0x07fc('0x26')](handleEntityNotFound(_0xe6d39c,null))[_0x07fc('0x26')](function(_0x49e014){if(_0x49e014){return db[_0x07fc('0x4e')]['transaction'](function(_0x2ad17e){return db[_0x07fc('0x51')][_0x07fc('0x56')]({'where':{'userProfileId':_0x5aedf0['params']['id'],'sectionId':_['map'](_0x283c78,function(_0x35b099){return _0x35b099[_0x07fc('0x58')];})},'transaction':_0x2ad17e})[_0x07fc('0x26')](function(){var _0x5a10bc=_[_0x07fc('0x30')](_0x283c78,function(_0x5256a5){_0x5256a5[_0x07fc('0x55')]=_0x5aedf0['params']['id'];return _0x5256a5;});var _0x5c2a64=[];return BPromise['each'](_0x5a10bc,function(_0x289bd7){return db[_0x07fc('0x51')]['create'](_0x289bd7,{'include':[{'model':db['UserProfileResource'],'as':_0x07fc('0x59')}],'raw':!![],'transaction':_0x2ad17e})['then'](function(_0x3d17f2){_0x5c2a64[_0x07fc('0x5a')](_0x3d17f2['get']({'plain':!![]}));});})[_0x07fc('0x26')](function(){return _0x5c2a64;});});});}})['then'](function(_0x58a464){return _0x58a464;})[_0x07fc('0x26')](respondWithResult(_0xe6d39c,null))[_0x07fc('0x41')](handleError(_0xe6d39c,null));};exports[_0x07fc('0x5b')]=function(_0x1e8731,_0x1e8033){var _0x143e08;return db[_0x07fc('0x2b')][_0x07fc('0x47')]({'where':{'id':_0x1e8731['params']['id']},'attributes':['id',_0x07fc('0x31')]})[_0x07fc('0x26')](handleEntityNotFound(_0x1e8033,null))[_0x07fc('0x26')](function(_0x166aca){if(_0x166aca){_0x143e08=_0x166aca;return db[_0x07fc('0x51')][_0x07fc('0x56')]({'where':{'userProfileId':_0x1e8731[_0x07fc('0x43')]['id'],'sectionId':_0x1e8731[_0x07fc('0x32')][_0x07fc('0x5c')]}});}})['then'](function(){return _0x143e08;})['then'](respondWithStatusCode(_0x1e8033,null))[_0x07fc('0x41')](handleError(_0x1e8033,null));};exports[_0x07fc('0x5d')]=function(_0x23eb42,_0x50c7be){var _0x422a6c=[];var _0x20e5d3=[];return db['UserProfileSection'][_0x07fc('0x3f')]({'where':{'userProfileId':_0x23eb42[_0x07fc('0x43')]['id']},'raw':!![]})[_0x07fc('0x26')](function(_0xfef95d){_0x422a6c=_['filter'](_0xfef95d,function(_0x1fae8c){return _0x1fae8c[_0x07fc('0x5e')]===0x1||_['includes']([0x3eb,0x709],_0x1fae8c['sectionId']);});if(!_[_0x07fc('0x5f')](_0x422a6c)){return _[_0x07fc('0x30')](_0x422a6c,function(_0x505bda){return _0x505bda[_0x07fc('0x58')];});}else{return;}})[_0x07fc('0x26')](function(_0x586dc0){if(_0x586dc0)_0x20e5d3=_0x586dc0;if(_[_0x07fc('0x60')](_0x20e5d3,0x64)){var _0x563425=_[_0x07fc('0x47')](_0x422a6c,{'sectionId':0x64});return hasDefaultDashboard(_0x563425)[_0x07fc('0x26')](function(_0x3f21a1){return _[_0x07fc('0x30')](_0x422a6c,function(_0x10b10e){if(_0x10b10e[_0x07fc('0x58')]===0x64){_0x10b10e[_0x07fc('0x61')]=_0x3f21a1;}return _0x10b10e;});});}else{return;}})[_0x07fc('0x26')](function(_0xd096fc){if(_0xd096fc)_0x422a6c=_0xd096fc;if(_[_0x07fc('0x60')](_0x20e5d3,0x3eb)){var _0x47b311=_[_0x07fc('0x47')](_0x422a6c,{'sectionId':0x3eb});return getCustomDashboards(_0x47b311)[_0x07fc('0x26')](function(_0x200b4d){return _[_0x07fc('0x30')](_0x422a6c,function(_0x62e403){if(_0x47b311[_0x07fc('0x5e')]){if(_0x62e403[_0x07fc('0x58')]===0x3eb){_0x62e403[_0x07fc('0x61')]=_0x200b4d;}}else{if(_0x62e403[_0x07fc('0x58')]===0x64){_0x62e403[_0x07fc('0x61')]=_0x200b4d;}}return _0x62e403;});});}else{return;}})['then'](function(_0x527434){if(_0x527434)_0x422a6c=_0x527434;if(_[_0x07fc('0x60')](_0x20e5d3,0x709)){var _0x51683e=_[_0x07fc('0x47')](_0x422a6c,{'sectionId':0x709});return getPlugins(_0x51683e)[_0x07fc('0x26')](function(_0x35dbe4){if(_0x51683e[_0x07fc('0x5e')]){return _[_0x07fc('0x30')](_0x422a6c,function(_0x3bdfb7){if(_0x3bdfb7[_0x07fc('0x58')]===0x709){_0x3bdfb7[_0x07fc('0x61')]=_0x35dbe4;}return _0x3bdfb7;});}else{var _0xebe310={'sectionId':0x76c,'enabled':0x1,'subsections':_0x35dbe4};var _0x5b4196=_[_0x07fc('0x30')](_0x422a6c);_0x5b4196[_0x07fc('0x5a')](_0xebe310);return _0x5b4196;}});}else{return;}})[_0x07fc('0x26')](function(_0x32bc09){if(_0x32bc09)_0x422a6c=_0x32bc09;return _['filter'](_0x422a6c,[_0x07fc('0x5e'),0x1]);})['then'](respondWithResult(_0x50c7be,null))[_0x07fc('0x41')](handleError(_0x50c7be,null));};function hasDefaultDashboard(_0x533a6c){var _0x3e8ff0=[0x65];return new BPromise(function(_0x5dc286,_0x3a4b56){try{if(_0x533a6c['autoAssociation']){_0x5dc286(_0x3e8ff0);}else{return db[_0x07fc('0x54')][_0x07fc('0x62')]({'where':{'sectionId':_0x533a6c['id']},'raw':!![]})[_0x07fc('0x26')](function(_0x2658d0){_0x2658d0?_0x5dc286(_0x3e8ff0):_0x5dc286();});}}catch(_0x40adae){_0x3a4b56(_0x40adae);}});}function getCustomDashboards(_0x49eda9){var _0x2d1921=[];return new BPromise(function(_0x8a9bf,_0x54f7f6){try{if(_0x49eda9[_0x07fc('0x53')]){return db[_0x07fc('0x63')]['findAll']({'raw':!![]})[_0x07fc('0x26')](function(_0x648060){_0x648060[_0x07fc('0x64')](function(_0x525045){_0x2d1921['push'](_0x525045['id']+0x1869f);});_0x8a9bf(_0x2d1921);});}else{return db[_0x07fc('0x54')][_0x07fc('0x3f')]({'where':{'sectionId':_0x49eda9['id']},'raw':!![]})[_0x07fc('0x26')](function(_0x234dec){_0x234dec[_0x07fc('0x64')](function(_0x3e5868){_0x2d1921['push'](_0x3e5868['resourceId']+0x1869f);});_0x8a9bf(_0x2d1921);});}}catch(_0x4715bf){_0x54f7f6(_0x4715bf);}});}function getPlugins(_0x4f8fec){var _0x40b465=[];return new BPromise(function(_0x448a41,_0x39346c){try{if(_0x4f8fec['autoAssociation']){return db[_0x07fc('0x65')][_0x07fc('0x3f')]({'raw':!![]})[_0x07fc('0x26')](function(_0x2bd700){_0x2bd700[_0x07fc('0x64')](function(_0x5246bb){_0x40b465[_0x07fc('0x5a')](_0x5246bb['id']+0x15b38);});_0x448a41(_0x40b465);});}else{return db[_0x07fc('0x54')][_0x07fc('0x3f')]({'where':{'sectionId':_0x4f8fec['id']},'raw':!![]})[_0x07fc('0x26')](function(_0x5307a2){_0x5307a2[_0x07fc('0x64')](function(_0x291f41){_0x40b465[_0x07fc('0x5a')](_0x291f41['resourceId']+0x15b38);});_0x448a41(_0x40b465);});}}catch(_0x498fcb){_0x39346c(_0x498fcb);}});}exports[_0x07fc('0x66')]=function(_0x507857,_0x12c45d){return db[_0x07fc('0x2b')][_0x07fc('0x47')]({'where':{'id':_0x507857[_0x07fc('0x43')]['id']}})[_0x07fc('0x26')](handleEntityNotFound(_0x12c45d,null))[_0x07fc('0x26')](function(_0x389785){if(_0x389785){return db[_0x07fc('0x4e')][_0x07fc('0x4f')](function(_0x2f6461){return db[_0x07fc('0x51')][_0x07fc('0x3f')]({'where':{'userProfileId':_0x507857['params']['id']},'attributes':['id'],'raw':!![]})[_0x07fc('0x26')](function(_0x26a9b3){if(_0x26a9b3){return db[_0x07fc('0x51')][_0x07fc('0x56')]({'where':{'userProfileId':_0x507857[_0x07fc('0x43')]['id'],'id':_[_0x07fc('0x30')](_0x26a9b3,function(_0x359dee){return _0x359dee['id'];})},'transaction':_0x2f6461});}})['then'](function(_0x59ebaf){var _0x531fa8=_[_0x07fc('0x30')](_0x507857[_0x07fc('0x49')],function(_0x11232b){_0x11232b[_0x07fc('0x55')]=_0x507857[_0x07fc('0x43')]['id'];return _0x11232b;});return db[_0x07fc('0x51')][_0x07fc('0x67')](_0x531fa8,{'raw':!![],'transaction':_0x2f6461});})['then'](function(_0x394cda){var _0x505aea=_['filter'](_[_0x07fc('0x30')](_0x394cda,function(_0x59b536){return _0x59b536[_0x07fc('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x505aea){return db[_0x07fc('0x51')][_0x07fc('0x3f')]({'where':{'userProfileId':_0x507857[_0x07fc('0x43')]['id'],'sectionId':_[_0x07fc('0x30')](_0x505aea,function(_0x556695){return _0x556695[_0x07fc('0x58')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x07fc('0x26')](function(_0x10d54b){var _0xb15dd0=_[_0x07fc('0x30')](_0x507857[_0x07fc('0x49')],function(_0x19a482){_0x19a482[_0x07fc('0x55')]=_0x507857[_0x07fc('0x43')]['id'];return _0x19a482;});return db['UserProfileResource']['bulkCreate'](_0xb15dd0,{'raw':!![],'transaction':_0x2f6461});});}})['catch'](handleError(_0x12c45d,null));});}})['then'](function(_0xd8cd88){var _0x27cbcf=_[_0x07fc('0x30')](_0xd8cd88,function(_0x33eb59){return _0x33eb59[_0x07fc('0x50')]({'plain':!![]});});})[_0x07fc('0x26')](respondWithResult(_0x12c45d,null))[_0x07fc('0x41')](handleError(_0x12c45d,null));};exports[_0x07fc('0x68')]=function(_0x116949,_0x269092,_0x8c7031){return db[_0x07fc('0x2b')]['find']({'where':{'id':_0x116949['params']['id']}})[_0x07fc('0x26')](handleEntityNotFound(_0x269092,null))[_0x07fc('0x26')](function(_0xda8d76){if(_0xda8d76){return _0xda8d76[_0x07fc('0x68')](_0x116949[_0x07fc('0x32')][_0x07fc('0x5c')]);}})[_0x07fc('0x26')](respondWithStatusCode(_0x269092,null))[_0x07fc('0x41')](handleError(_0x269092,null));};exports[_0x07fc('0x69')]=function(_0x283528,_0x502e23){var _0x5118b3={'raw':![],'where':{}};var _0x14ab1c={};var _0x3b9c69={'count':0x0,'rows':[]};var _0x2b9efa=_0x283528[_0x07fc('0x32')][_0x07fc('0x6a')];if(typeof _0x2b9efa==='undefined'){throw new db[(_0x07fc('0x6b'))]['ValidationError'](_0x07fc('0x6c'));}var _0x20ca1b=_0x283528[_0x07fc('0x32')]['mergeResources']||![];var _0x2d2476=getQueryModels(_0x2b9efa,_0x20ca1b);if(typeof _0x2d2476[_0x07fc('0x6d')]==='undefined'){throw new db[(_0x07fc('0x6b'))][(_0x07fc('0x6e'))](_0x07fc('0x6f')+_0x2b9efa+'\x27');}var _0x15142f=[];if(!_[_0x07fc('0x5f')](_0x2d2476['parentSections'])){_0x15142f=_0x2d2476[_0x07fc('0x70')];}else{_0x15142f=[{'name':_0x2b9efa}];}return db['UserProfile'][_0x07fc('0x62')]({'where':{'id':_0x283528[_0x07fc('0x43')]['id']}})['then'](handleEntityNotFound(_0x502e23,null))['then'](function(_0xa7a1d6){if(_0xa7a1d6){var _0x4fed62=[];for(var _0x41d776=0x0;_0x41d776<_0x15142f[_0x07fc('0x71')];_0x41d776++){_0x4fed62[_0x07fc('0x5a')](db[_0x07fc('0x51')]['findOne']({'where':{'userProfileId':_0xa7a1d6['id'],'name':_0x15142f[_0x41d776]['name']},'raw':!![]}));}return BPromise[_0x07fc('0x72')](_0x4fed62);}})[_0x07fc('0x26')](function(_0x1aba14){var _0x3df80a=_[_0x07fc('0x3b')](_0x1aba14,function(_0x7ae692){return _0x7ae692?_0x7ae692:undefined;});var _0x958b36=_[_0x07fc('0x3b')](_0x15142f,[_0x07fc('0x73'),!![]]);var _0x565cd1=_[_0x07fc('0x5f')](_0x3df80a)&&_[_0x07fc('0x5f')](_0x958b36)?null:_[_0x07fc('0x74')](_0x958b36,_0x3df80a);if(_0x565cd1){var _0x17772f=[];for(var _0x585328=0x0;_0x585328<_0x565cd1[_0x07fc('0x71')];_0x585328++){var _0x218107=_[_0x07fc('0x47')](_0x15142f,function(_0x1cd31f){return _0x565cd1[_0x585328]?_0x1cd31f[_0x07fc('0x31')]===_0x565cd1[_0x585328][_0x07fc('0x31')]:null;});if(_0x218107){if(_0x565cd1[_0x585328][_0x07fc('0x73')]){_0x17772f['push'](getAllResources(_0x2d2476[_0x07fc('0x6d')],_0x565cd1[_0x585328]));}else{if(!_0x565cd1[_0x585328][_0x07fc('0x53')]){_0x17772f['push'](getAllowedResources(_0x218107,_0x565cd1[_0x585328],_0x2d2476[_0x07fc('0x6d')]));}else{if(_0x218107['model']){_0x17772f['push'](getAllFilteredResources(_0x218107,_0x565cd1[_0x585328]));}}}}}return BPromise['all'](_0x17772f);}else{return null;}})['then'](function(_0x54bb0a){var _0x5a0c4c=_0x54bb0a;var _0x1d5232=null;if(_0x5a0c4c){_0x1d5232=_0x5a0c4c['length']===0x1?_0x5a0c4c[0x0]:null;}if(_0x1d5232||_0x5a0c4c){var _0x32bc40=db[_0x2d2476['childModel']][_0x07fc('0x2c')];_0x14ab1c[_0x07fc('0x2f')]=_[_0x07fc('0x44')](_0x32bc40);_0x14ab1c[_0x07fc('0x32')]=_[_0x07fc('0x44')](_0x283528['query']);_0x14ab1c[_0x07fc('0x33')]=_[_0x07fc('0x35')](_0x14ab1c['model'],_0x14ab1c[_0x07fc('0x32')]);_0x5118b3[_0x07fc('0x34')]=_[_0x07fc('0x35')](_0x14ab1c[_0x07fc('0x2f')],qs[_0x07fc('0x45')](_0x283528[_0x07fc('0x32')][_0x07fc('0x45')]));_0x5118b3[_0x07fc('0x34')]=_0x5118b3[_0x07fc('0x34')]['length']?_0x5118b3[_0x07fc('0x34')]:_0x14ab1c['model'];if(!_0x283528[_0x07fc('0x32')]['hasOwnProperty']('nolimit')){_0x5118b3[_0x07fc('0x21')]=qs[_0x07fc('0x21')](_0x283528[_0x07fc('0x32')][_0x07fc('0x21')]);_0x5118b3[_0x07fc('0x20')]=qs[_0x07fc('0x20')](_0x283528[_0x07fc('0x32')][_0x07fc('0x20')]);}_0x5118b3[_0x07fc('0x37')]=qs[_0x07fc('0x38')](_0x283528[_0x07fc('0x32')][_0x07fc('0x38')]);_0x5118b3[_0x07fc('0x3a')]=qs[_0x07fc('0x33')](_['pick'](_0x283528[_0x07fc('0x32')],_0x14ab1c['filters']));if(_0x283528[_0x07fc('0x32')][_0x07fc('0x3b')]){_0x5118b3[_0x07fc('0x3a')]=_[_0x07fc('0x3c')](_0x5118b3[_0x07fc('0x3a')],{'$or':_['map'](_0x32bc40,function(_0x38a46b){if(_0x38a46b[_0x07fc('0x2d')][_0x07fc('0x2e')]!==_0x07fc('0x75')){var _0x200e90={};_0x200e90[_0x38a46b['field']]={'$like':'%'+_0x283528['query']['filter']+'%'};return _0x200e90;}})});}var _0x4ed8eb=[];if(_0x1d5232){var _0x272c87=_[_0x07fc('0x47')](_0x15142f,[_0x07fc('0x31'),_0x1d5232[_0x07fc('0x31')]]);if(_0x272c87[_0x07fc('0x76')]){var _0xbaf445={};if(_0x2d2476[_0x07fc('0x6d')]===_0x07fc('0x77')){_0xbaf445[_0x272c87[_0x07fc('0x78')]]=_['map'](_0x1d5232['associatedResources'],'id');}else{_0xbaf445[_0x272c87[_0x07fc('0x78')]]=_0x1d5232[_0x07fc('0x79')];}_0x4ed8eb[_0x07fc('0x5a')](_0xbaf445);}else{_0x5118b3[_0x07fc('0x3a')]['id']=_0x1d5232[_0x07fc('0x79')];}}else{for(var _0xb17c89=0x0;_0xb17c89<_0x5a0c4c[_0x07fc('0x71')];_0xb17c89++){var _0x272c87=_[_0x07fc('0x47')](_0x15142f,['name',_0x5a0c4c[_0xb17c89][_0x07fc('0x31')]]);if(_0x272c87['field']){var _0xbaf445={};_0xbaf445[_0x272c87[_0x07fc('0x78')]]=_0x5a0c4c[_0xb17c89][_0x07fc('0x79')];_0x4ed8eb[_0x07fc('0x5a')](_0xbaf445);}else{if(!_0x5118b3[_0x07fc('0x3a')]['id'])_0x5118b3['where']['id']=[];_0x5a0c4c[_0xb17c89][_0x07fc('0x79')][_0x07fc('0x64')](function(_0x2bc8af){_0x5118b3[_0x07fc('0x3a')]['id'][_0x07fc('0x5a')](_0x2bc8af);});}}}if(!_[_0x07fc('0x5f')](_0x4ed8eb)){_0x5118b3[_0x07fc('0x3a')]=_[_0x07fc('0x3c')](_0x5118b3[_0x07fc('0x3a')],{'$and':{'$or':_0x4ed8eb}});}_0x5118b3=_[_0x07fc('0x3c')]({},_0x5118b3,_0x283528[_0x07fc('0x3d')]);if(_0x1d5232&&!_0x1d5232[_0x07fc('0x53')]&&_0x2d2476[_0x07fc('0x6d')]==='AnalyticExtractedReport'){if(_0x283528['query'][_0x07fc('0x46')]){_0x5118b3['include']=[{'all':!![]}];}return db[_0x2d2476[_0x07fc('0x6d')]][_0x07fc('0x3f')](_0x5118b3)[_0x07fc('0x26')](function(_0x2f6af2){var _0x426aeb=[];_0x2f6af2[_0x07fc('0x64')](function(_0x2692c4){var _0x2c9956;switch(_0x2692c4[_0x07fc('0x7a')]){case _0x07fc('0x7b'):_0x2c9956=_[_0x07fc('0x47')](_0x1d5232[_0x07fc('0x79')],function(_0x41afb1){return _0x41afb1['id']===_0x2692c4['reportId']&&_0x41afb1[_0x07fc('0x2d')]===_0x07fc('0x7c');});break;case'custom':_0x2c9956=_[_0x07fc('0x47')](_0x1d5232[_0x07fc('0x79')],function(_0x1669e8){return _0x1669e8['id']===_0x2692c4[_0x07fc('0x7d')]&&_0x1669e8['type']===_0x07fc('0x7e');});break;}if(_0x2c9956)_0x426aeb['push'](_0x2692c4);});_0x3b9c69[_0x07fc('0x1f')]=_0x426aeb[_0x07fc('0x71')];_0x3b9c69[_0x07fc('0x40')]=_0x426aeb;return _0x3b9c69;});}else{return db[_0x2d2476[_0x07fc('0x6d')]][_0x07fc('0x1f')]({'where':_0x5118b3[_0x07fc('0x3a')]})[_0x07fc('0x26')](function(_0x5bf117){_0x3b9c69[_0x07fc('0x1f')]=_0x5bf117;if(_0x283528[_0x07fc('0x32')][_0x07fc('0x46')]){if(_0x2d2476[_0x07fc('0x6d')]===_0x07fc('0x7f')){_0x5118b3[_0x07fc('0x3e')]=[{'model':db[_0x07fc('0x80')],'as':_0x07fc('0x81'),'attributes':['id','name',_0x07fc('0x82')],'required':_0x283528['query'][_0x07fc('0x83')]?!![]:![]},{'model':db[_0x07fc('0x80')],'as':_0x07fc('0x84'),'attributes':['id',_0x07fc('0x31'),_0x07fc('0x82')],'through':_0x283528[_0x07fc('0x32')][_0x07fc('0x83')]?{'attributes':[],'where':{'TagId':_0x283528['query'][_0x07fc('0x83')]||undefined}}:{},'required':_0x283528[_0x07fc('0x32')][_0x07fc('0x83')]?!![]:![]}];}else{_0x5118b3[_0x07fc('0x3e')]=[{'all':!![]}];}}return db[_0x2d2476['childModel']][_0x07fc('0x3f')](_0x5118b3);})[_0x07fc('0x26')](function(_0x3a4616){_0x3b9c69[_0x07fc('0x40')]=_0x3a4616;return _0x3b9c69;});}}else{return _0x3b9c69;}})[_0x07fc('0x26')](respondWithFilteredResult(_0x502e23,_0x5118b3))['catch'](handleError(_0x502e23,null));};function getAllResources(_0x52ca82,_0x4fadcf){return new BPromise(function(_0x4339c4,_0x2ee03e){if(_0x4fadcf){var _0x4067fe=_0x4fadcf[_0x07fc('0x3b')]?{[_0x4fadcf[_0x07fc('0x3b')][_0x07fc('0x76')]]:_0x4fadcf[_0x07fc('0x3b')][_0x07fc('0x85')]}:undefined;return db[_0x52ca82][_0x07fc('0x3f')]({'where':_0x4067fe,'raw':!![]})[_0x07fc('0x26')](function(_0x116b16){_0x4fadcf['associatedResources']=_['map'](_0x116b16,'id');_0x4339c4(_0x4fadcf);})[_0x07fc('0x41')](function(_0x54afb6){_0x2ee03e(_0x54afb6);});}else{_0x4339c4(null);}});}function getAllFilteredResources(_0x3ae8dc,_0x53249d){return new BPromise(function(_0x37f334,_0x292584){var _0x429a77=_0x3ae8dc[_0x07fc('0x3b')]?{[_0x3ae8dc[_0x07fc('0x3b')]['field']]:_0x3ae8dc['filter'][_0x07fc('0x85')]}:undefined;return db[_0x3ae8dc[_0x07fc('0x2f')]][_0x07fc('0x3f')]({'where':_0x429a77,'raw':!![]})[_0x07fc('0x26')](function(_0xaf49c1){_0x53249d[_0x07fc('0x79')]=_[_0x07fc('0x30')](_0xaf49c1,function(_0x40e89e){return _0x40e89e[_0x07fc('0x31')];});_0x37f334(_0x53249d);})[_0x07fc('0x41')](function(_0x157581){_0x292584(_0x157581);});});}function getAllowedResources(_0x747f15,_0x14099d,_0x481bb9){return new BPromise(function(_0xa85fb9,_0x315b7b){if(_0x14099d){return db[_0x07fc('0x54')][_0x07fc('0x3f')]({'where':{'sectionId':_0x14099d['id']},'raw':!![]})[_0x07fc('0x26')](function(_0x27563a){if(_0x747f15[_0x07fc('0x76')]&&_0x747f15[_0x07fc('0x76')]!=='id'){_0x14099d[_0x07fc('0x79')]=_[_0x07fc('0x30')](_0x27563a,function(_0x54ee7c){return _0x54ee7c[_0x747f15['field']];});}else{if(_0x481bb9==='AnalyticExtractedReport'){_0x14099d['associatedResources']=_['map'](_0x27563a,function(_0x12cb2f){return{'id':_0x12cb2f[_0x07fc('0x86')],'type':_0x12cb2f[_0x07fc('0x2d')]};});}else{_0x14099d[_0x07fc('0x79')]=_[_0x07fc('0x30')](_0x27563a,function(_0x428bb7){return _0x428bb7[_0x07fc('0x86')];});}}_0xa85fb9(_0x14099d);})[_0x07fc('0x41')](function(_0x36b7f9){_0x315b7b(_0x36b7f9);});}else{_0xa85fb9(null);}});}function getQueryModels(_0x3a442b,_0x3dd25e){var _0x1ed10c=_0x3a442b['toLowerCase']();var _0x1f7ddb={'childModel':undefined,'parentSections':[]};switch(_0x1ed10c){case'squareprojects':_0x1f7ddb[_0x07fc('0x6d')]='SquareProject';break;case _0x07fc('0x87'):_0x1f7ddb[_0x07fc('0x6d')]='SquareOdbc';break;case _0x07fc('0x88'):_0x1f7ddb['childModel']=_0x07fc('0x89');_0x1f7ddb[_0x07fc('0x70')]=[{'name':_0x07fc('0x8a'),'field':'name','foreignKey':'projectName'}];break;case _0x07fc('0x8b'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0x8c');break;case _0x07fc('0x8d'):_0x1f7ddb[_0x07fc('0x6d')]='CmContact';_0x1f7ddb['parentSections']=[{'name':_0x07fc('0x8e'),'field':'id','foreignKey':_0x07fc('0x8f')}];break;case _0x07fc('0x90'):_0x1f7ddb[_0x07fc('0x6d')]='CmList';break;case _0x07fc('0x91'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0x92');break;case _0x07fc('0x93'):_0x1f7ddb[_0x07fc('0x6d')]='CmCustomField';break;case'chatqueues':_0x1f7ddb[_0x07fc('0x6d')]='ChatQueue';break;case'chatwebsites':_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0x94');break;case'faxqueues':_0x1f7ddb['childModel']=_0x07fc('0x95');break;case'faxaccounts':_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0x96');break;case _0x07fc('0x97'):case _0x07fc('0x98'):case _0x07fc('0x99'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0x9a');break;case'contexts':_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0x9b');break;case'voicemails':_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0x9c');break;case _0x07fc('0x9d'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0x9e');_0x1f7ddb[_0x07fc('0x70')]=[{'name':_0x07fc('0x9f'),'field':'name','foreignKey':'membername','model':'User','filter':{'field':_0x07fc('0xa0'),'value':[_0x07fc('0xa1')]}},{'name':_0x07fc('0xa2'),'field':_0x07fc('0x31'),'foreignKey':'membername','model':'User','filter':{'field':_0x07fc('0xa0'),'value':[_0x07fc('0xa3')]}},{'name':'VoiceQueues','field':'name','foreignKey':_0x07fc('0xa4'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x07fc('0xa5')]}},{'name':_0x07fc('0xa6'),'field':_0x07fc('0x31'),'foreignKey':_0x07fc('0xa4'),'model':_0x07fc('0xa7'),'filter':{'field':_0x07fc('0x2d'),'value':[_0x07fc('0xa8')]}}];break;case _0x07fc('0xa9'):_0x1f7ddb['childModel']=_0x07fc('0xaa');break;case _0x07fc('0xab'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xac');break;case _0x07fc('0xad'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xae');break;case _0x07fc('0xaf'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xb0');break;case'mailqueues':_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xb1');break;case _0x07fc('0xb2'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xb3');break;case _0x07fc('0xb4'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xb5');break;case _0x07fc('0xb6'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xb7');break;case _0x07fc('0xb8'):_0x1f7ddb['childModel']=_0x07fc('0xb9');break;case _0x07fc('0xba'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xbb');break;case _0x07fc('0xbc'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xbd');break;case _0x07fc('0xbe'):_0x1f7ddb[_0x07fc('0x6d')]='WhatsappQueue';break;case'whatsappaccounts':_0x1f7ddb[_0x07fc('0x6d')]='WhatsappAccount';break;case _0x07fc('0xbf'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xc0');break;case'voicequeues':case'queuecampaigns':_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xa7');if(_0x3dd25e){_0x1f7ddb[_0x07fc('0x70')]=[{'name':_0x07fc('0xc1')},{'name':'QueueCampaigns'}];}break;case'users':case'agents':case'telephones':_0x1f7ddb['childModel']=_0x07fc('0xc2');if(_0x3dd25e){_0x1f7ddb[_0x07fc('0x70')]=[{'name':_0x07fc('0xc3'),'filter':{'field':_0x07fc('0xa0'),'value':['admin',_0x07fc('0xc4')]},'ignore':!![]},{'name':_0x07fc('0x9f')},{'name':_0x07fc('0xa2')}];}break;case _0x07fc('0xc5'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xc6');break;case'salesforceaccounts':_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xc7');break;case _0x07fc('0xc8'):_0x1f7ddb[_0x07fc('0x6d')]='FreshdeskAccount';break;case _0x07fc('0xc9'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xca');break;case _0x07fc('0xcb'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xcc');break;case _0x07fc('0xcd'):_0x1f7ddb['childModel']=_0x07fc('0xce');break;case'vtigeraccounts':_0x1f7ddb['childModel']='User';break;case'cannedanswers':_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xcf');break;case _0x07fc('0xd0'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xd1');break;case _0x07fc('0xd2'):_0x1f7ddb['childModel']='Dashboard';break;case'intervals':_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xd3');break;case _0x07fc('0xd4'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xd5');break;case'scheduler':_0x1f7ddb[_0x07fc('0x6d')]='Schedule';break;case _0x07fc('0xd6'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xd7');break;case _0x07fc('0xd8'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0x80');break;case'templates':_0x1f7ddb[_0x07fc('0x6d')]='Template';break;case _0x07fc('0xd9'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xda');break;case _0x07fc('0xdb'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xdc');break;case'variables':_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xdd');break;case _0x07fc('0xde'):_0x1f7ddb['childModel']='Plugin';break;case _0x07fc('0xdf'):_0x1f7ddb[_0x07fc('0x6d')]='AnalyticExtractedReport';_0x1f7ddb[_0x07fc('0x70')]=[{'name':_0x07fc('0xe0'),'field':'id','foreignKey':_0x07fc('0x7d')}];break;case _0x07fc('0xe1'):_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xe2');break;case'whatsappaccounts':_0x1f7ddb[_0x07fc('0x6d')]=_0x07fc('0xe3');break;default:return _0x1f7ddb;}return _0x1f7ddb;}
\ No newline at end of file
+var _0x0669=['find','create','body','clone','get','omit','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','params','each','autoAssociation','UserProfileResource','createdAt','sectionId','userProfileId','Resources','describe','push','removeSections','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','ids','section','undefined','Sequelize','ValidationError','mergeResources','childModel','parentSections','all','ignore','field','foreignKey','associatedResources','AnalyticExtractedReport','default','reportId','DefaultReports','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','contacts','ListId','lists','companies','globalcustomfields','CmCustomField','chatqueues','chatwebsites','ChatWebsite','faxaccounts','FaxAccount','inboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','VoiceRecording','Agents','User','Telephones','membername','role','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','SmsAccount','WhatsappQueue','whatsappaccounts','Team','voicequeues','queuecampaigns','Users','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','extractedreports','Reports','AnalyticMetric','WhatsappAccount','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','./userProfile.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','update','then','destroy','error','stack','name','map','UserProfile','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll'];(function(_0x81e39d,_0x4c3934){var _0x548fbb=function(_0x1adda5){while(--_0x1adda5){_0x81e39d['push'](_0x81e39d['shift']());}};_0x548fbb(++_0x4c3934);}(_0x0669,0x181));var _0x9066=function(_0x11f4b5,_0x279f0d){_0x11f4b5=_0x11f4b5-0x0;var _0x59d5e0=_0x0669[_0x11f4b5];return _0x59d5e0;};'use strict';var pdf=require(_0x9066('0x0'));var emlformat=require(_0x9066('0x1'));var rimraf=require(_0x9066('0x2'));var zipdir=require(_0x9066('0x3'));var jsonpatch=require(_0x9066('0x4'));var rp=require(_0x9066('0x5'));var moment=require(_0x9066('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x9066('0x7'));var util=require('util');var path=require(_0x9066('0x8'));var sox=require(_0x9066('0x9'));var csv=require(_0x9066('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9066('0xb'));var crypto=require(_0x9066('0xc'));var jsforce=require(_0x9066('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9066('0xa'));var querystring=require(_0x9066('0xe'));var Papa=require(_0x9066('0xf'));var Redis=require(_0x9066('0x10'));var authService=require(_0x9066('0x11'));var qs=require(_0x9066('0x12'));var as=require(_0x9066('0x13'));var hardwareService=require(_0x9066('0x14'));var logger=require(_0x9066('0x15'))('api');var utils=require(_0x9066('0x16'));var config=require('../../config/environment');var db=require(_0x9066('0x17'))['db'];config[_0x9066('0x18')]=_[_0x9066('0x19')](config['redis'],{'host':_0x9066('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9066('0x18')]));require(_0x9066('0x1b'))[_0x9066('0x1c')](socket);function respondWithStatusCode(_0x27de3b,_0xe41b2e){_0xe41b2e=_0xe41b2e||0xcc;return function(_0x1f4ad1){if(_0x1f4ad1){return _0x27de3b[_0x9066('0x1d')](_0xe41b2e);}return _0x27de3b[_0x9066('0x1e')](_0xe41b2e)[_0x9066('0x1f')]();};}function respondWithResult(_0x26a35d,_0x259ea2){_0x259ea2=_0x259ea2||0xc8;return function(_0x215a3d){if(_0x215a3d){return _0x26a35d[_0x9066('0x1e')](_0x259ea2)['json'](_0x215a3d);}};}function respondWithFilteredResult(_0x5a7640,_0x58e819){return function(_0x6e284f){if(_0x6e284f){var _0x259c7b=_0x6e284f[_0x9066('0x20')],_0x548aa7=_0x58e819[_0x9066('0x21')],_0x58237d=_0x58e819[_0x9066('0x21')]+_0x58e819[_0x9066('0x22')],_0xb721a5;if(_0x58237d>=_0x259c7b){_0x58237d=_0x259c7b;_0xb721a5=0xc8;}else{_0xb721a5=0xce;}_0x5a7640[_0x9066('0x1e')](_0xb721a5);return _0x5a7640[_0x9066('0x23')](_0x9066('0x24'),_0x548aa7+'-'+_0x58237d+'/'+_0x259c7b)[_0x9066('0x25')](_0x6e284f);}return null;};}function patchUpdates(_0xbfbf4c){return function(_0x5873b2){try{jsonpatch[_0x9066('0x26')](_0x5873b2,_0xbfbf4c,!![]);}catch(_0x351a7b){return BPromise['reject'](_0x351a7b);}return _0x5873b2['save']();};}function saveUpdates(_0x4baa22,_0xb35417){return function(_0x3d3b97){if(_0x3d3b97){return _0x3d3b97[_0x9066('0x27')](_0x4baa22)[_0x9066('0x28')](function(_0x1ff554){return _0x1ff554;});}return null;};}function removeEntity(_0xb45901,_0x1ec7d6){return function(_0x419084){if(_0x419084){return _0x419084[_0x9066('0x29')]()[_0x9066('0x28')](function(){_0xb45901[_0x9066('0x1e')](0xcc)[_0x9066('0x1f')]();});}};}function handleEntityNotFound(_0x193a8c,_0x3a74fb){return function(_0x56dbe3){if(!_0x56dbe3){_0x193a8c['sendStatus'](0x194);}return _0x56dbe3;};}function handleError(_0x266642,_0x3ecbce){_0x3ecbce=_0x3ecbce||0x1f4;return function(_0x29e0a9){logger[_0x9066('0x2a')](_0x29e0a9[_0x9066('0x2b')]);if(_0x29e0a9['name']){delete _0x29e0a9[_0x9066('0x2c')];}_0x266642[_0x9066('0x1e')](_0x3ecbce)['send'](_0x29e0a9);};}exports['index']=function(_0x375b3e,_0x1159ec){var _0xf05cd1={},_0x328b6a={},_0x352774={'count':0x0,'rows':[]};var _0x479dd0=_[_0x9066('0x2d')](db[_0x9066('0x2e')][_0x9066('0x2f')],function(_0x3b1241){return{'name':_0x3b1241['fieldName'],'type':_0x3b1241[_0x9066('0x30')][_0x9066('0x31')]};});_0x328b6a[_0x9066('0x32')]=_[_0x9066('0x2d')](_0x479dd0,_0x9066('0x2c'));_0x328b6a[_0x9066('0x33')]=_['keys'](_0x375b3e[_0x9066('0x33')]);_0x328b6a[_0x9066('0x34')]=_[_0x9066('0x35')](_0x328b6a[_0x9066('0x32')],_0x328b6a[_0x9066('0x33')]);_0xf05cd1[_0x9066('0x36')]=_['intersection'](_0x328b6a[_0x9066('0x32')],qs[_0x9066('0x37')](_0x375b3e[_0x9066('0x33')][_0x9066('0x37')]));_0xf05cd1[_0x9066('0x36')]=_0xf05cd1[_0x9066('0x36')][_0x9066('0x38')]?_0xf05cd1[_0x9066('0x36')]:_0x328b6a[_0x9066('0x32')];if(!_0x375b3e[_0x9066('0x33')]['hasOwnProperty'](_0x9066('0x39'))){_0xf05cd1[_0x9066('0x22')]=qs[_0x9066('0x22')](_0x375b3e['query']['limit']);_0xf05cd1['offset']=qs['offset'](_0x375b3e[_0x9066('0x33')]['offset']);}_0xf05cd1[_0x9066('0x3a')]=qs['sort'](_0x375b3e[_0x9066('0x33')][_0x9066('0x3b')]);_0xf05cd1[_0x9066('0x3c')]=qs[_0x9066('0x34')](_[_0x9066('0x3d')](_0x375b3e[_0x9066('0x33')],_0x328b6a[_0x9066('0x34')]),_0x479dd0);if(_0x375b3e[_0x9066('0x33')][_0x9066('0x3e')]){_0xf05cd1[_0x9066('0x3c')]=_[_0x9066('0x3f')](_0xf05cd1[_0x9066('0x3c')],{'$or':_[_0x9066('0x2d')](_0x479dd0,function(_0x21b22e){if(_0x21b22e[_0x9066('0x30')]!==_0x9066('0x40')){var _0x9c93a3={};_0x9c93a3[_0x21b22e['name']]={'$like':'%'+_0x375b3e[_0x9066('0x33')][_0x9066('0x3e')]+'%'};return _0x9c93a3;}})});}_0xf05cd1=_[_0x9066('0x3f')]({},_0xf05cd1,_0x375b3e[_0x9066('0x41')]);var _0x532f6b={'where':_0xf05cd1[_0x9066('0x3c')]};return db[_0x9066('0x2e')][_0x9066('0x20')](_0x532f6b)[_0x9066('0x28')](function(_0x1f392e){_0x352774['count']=_0x1f392e;if(_0x375b3e[_0x9066('0x33')]['includeAll']){_0xf05cd1[_0x9066('0x42')]=[{'all':!![]}];}return db[_0x9066('0x2e')][_0x9066('0x43')](_0xf05cd1);})['then'](function(_0x249ca9){_0x352774[_0x9066('0x44')]=_0x249ca9;return _0x352774;})[_0x9066('0x28')](respondWithFilteredResult(_0x1159ec,_0xf05cd1))[_0x9066('0x45')](handleError(_0x1159ec,null));};exports[_0x9066('0x46')]=function(_0x449a7c,_0x530e8f){var _0x4c1b76={'raw':![],'where':{'id':_0x449a7c['params']['id']}},_0x2f8c80={};_0x2f8c80[_0x9066('0x32')]=_[_0x9066('0x47')](db[_0x9066('0x2e')][_0x9066('0x2f')]);_0x2f8c80[_0x9066('0x33')]=_[_0x9066('0x47')](_0x449a7c[_0x9066('0x33')]);_0x2f8c80[_0x9066('0x34')]=_[_0x9066('0x35')](_0x2f8c80[_0x9066('0x32')],_0x2f8c80['query']);_0x4c1b76[_0x9066('0x36')]=_[_0x9066('0x35')](_0x2f8c80[_0x9066('0x32')],qs[_0x9066('0x37')](_0x449a7c['query'][_0x9066('0x37')]));_0x4c1b76['attributes']=_0x4c1b76[_0x9066('0x36')][_0x9066('0x38')]?_0x4c1b76[_0x9066('0x36')]:_0x2f8c80[_0x9066('0x32')];if(_0x449a7c['query'][_0x9066('0x48')]){_0x4c1b76[_0x9066('0x42')]=[{'all':!![]}];}_0x4c1b76=_['merge']({},_0x4c1b76,_0x449a7c['options']);return db[_0x9066('0x2e')][_0x9066('0x49')](_0x4c1b76)['then'](handleEntityNotFound(_0x530e8f,null))[_0x9066('0x28')](respondWithResult(_0x530e8f,null))['catch'](handleError(_0x530e8f,null));};exports[_0x9066('0x4a')]=function(_0x565530,_0xb95df8){return db['UserProfile']['create'](_0x565530[_0x9066('0x4b')],{})[_0x9066('0x28')](respondWithResult(_0xb95df8,0xc9))[_0x9066('0x45')](handleError(_0xb95df8,null));};exports[_0x9066('0x4c')]=function(_0x30c0d2,_0x296bca){var _0x306460={'where':{'id':_0x30c0d2['params']['id']}},_0x47a3c={};_0x47a3c[_0x9066('0x32')]=_['keys'](db['UserProfile'][_0x9066('0x2f')]);_0x306460[_0x9066('0x36')]=_[_0x9066('0x35')](_0x47a3c[_0x9066('0x32')],qs[_0x9066('0x37')](_0x30c0d2[_0x9066('0x33')][_0x9066('0x37')]));_0x306460['attributes']=_0x306460[_0x9066('0x36')][_0x9066('0x38')]?_0x306460[_0x9066('0x36')]:_0x47a3c[_0x9066('0x32')];if(_0x30c0d2[_0x9066('0x33')][_0x9066('0x48')]){_0x306460[_0x9066('0x42')]=[{'all':!![]}];}_0x306460=_[_0x9066('0x3f')]({},_0x306460,_0x30c0d2[_0x9066('0x41')]);return db['UserProfile'][_0x9066('0x49')](_0x306460)[_0x9066('0x28')](handleEntityNotFound(_0x296bca,null))[_0x9066('0x28')](function(_0x1d6c46){if(_0x1d6c46){var _0x1b9760=_0x1d6c46[_0x9066('0x4d')]({'plain':!![]});_0x1b9760=qs[_0x9066('0x4e')](_0x1b9760,['id','createdAt',_0x9066('0x4f'),_0x9066('0x50')]);_0x30c0d2[_0x9066('0x4b')]=_['omit'](_0x30c0d2[_0x9066('0x4b')],['id','createdAt',_0x9066('0x4f')]);return db[_0x9066('0x51')][_0x9066('0x52')](function(_0x298234){return db[_0x9066('0x2e')][_0x9066('0x4a')](_[_0x9066('0x3f')](_0x1b9760,_0x30c0d2['body']),{'include':_0x30c0d2[_0x9066('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x298234})['then'](function(_0x27884e){var _0x546745=_0x27884e[_0x9066('0x4d')]({'plain':!![]});return db[_0x9066('0x53')][_0x9066('0x43')]({'where':{'userProfileId':_0x30c0d2[_0x9066('0x54')]['id']},'raw':!![]})[_0x9066('0x28')](function(_0x265202){if(_0x265202){return BPromise[_0x9066('0x55')](_0x265202,function(_0x33a28f){return new BPromise(function(_0x31e7c3,_0x4836ca){if(_0x33a28f['autoAssociation']===null||_0x33a28f[_0x9066('0x56')]===0x1)_0x31e7c3(null);return db[_0x9066('0x57')][_0x9066('0x43')]({'where':{'sectionId':_0x33a28f['id']},'raw':!![]})[_0x9066('0x28')](function(_0x542eab){var _0x5074b0=_[_0x9066('0x2d')](_0x542eab,function(_0x1e18f3){return qs[_0x9066('0x4e')](_0x1e18f3,['id',_0x9066('0x58'),_0x9066('0x4f'),_0x9066('0x59')]);});_0x31e7c3(_0x5074b0);})[_0x9066('0x45')](function(_0x5a2894){_0x4836ca(_0x5a2894);});})[_0x9066('0x28')](function(_0x1872d9){var _0x58aa6d=qs[_0x9066('0x4e')](_0x33a28f,['id',_0x9066('0x58'),_0x9066('0x4f')]);_0x58aa6d[_0x9066('0x5a')]=_0x546745['id'];if(_0x1872d9)_0x58aa6d[_0x9066('0x5b')]=_0x1872d9;return _0x58aa6d;})[_0x9066('0x28')](function(_0x2db951){return db[_0x9066('0x53')][_0x9066('0x4a')](_0x2db951,{'include':[{'model':db[_0x9066('0x57')],'as':_0x9066('0x5b')}],'raw':!![],'transaction':_0x298234});});})['then'](function(){return _0x546745;});}});});});}})[_0x9066('0x28')](respondWithResult(_0x296bca,0xc9))['catch'](handleError(_0x296bca,null));};exports['update']=function(_0x936551,_0x11b59c){if(_0x936551[_0x9066('0x4b')]['id']){delete _0x936551[_0x9066('0x4b')]['id'];}return db[_0x9066('0x2e')]['find']({'where':{'id':_0x936551[_0x9066('0x54')]['id']}})[_0x9066('0x28')](handleEntityNotFound(_0x11b59c,null))[_0x9066('0x28')](saveUpdates(_0x936551[_0x9066('0x4b')],null))[_0x9066('0x28')](respondWithResult(_0x11b59c,null))[_0x9066('0x45')](handleError(_0x11b59c,null));};exports[_0x9066('0x29')]=function(_0x45cea3,_0x25c4c7){return db[_0x9066('0x2e')][_0x9066('0x49')]({'where':{'id':_0x45cea3['params']['id']}})[_0x9066('0x28')](handleEntityNotFound(_0x25c4c7,null))[_0x9066('0x28')](removeEntity(_0x25c4c7,null))['catch'](handleError(_0x25c4c7,null));};exports[_0x9066('0x5c')]=function(_0x5dd8a9,_0x18ff98){return db[_0x9066('0x2e')][_0x9066('0x5c')]()[_0x9066('0x28')](respondWithResult(_0x18ff98,null))[_0x9066('0x45')](handleError(_0x18ff98,null));};exports['addSections']=function(_0x3a0ba8,_0x1c01a5){var _0x57a541=_0x3a0ba8[_0x9066('0x4b')];return db[_0x9066('0x2e')][_0x9066('0x49')]({'where':{'id':_0x3a0ba8[_0x9066('0x54')]['id']}})['then'](handleEntityNotFound(_0x1c01a5,null))[_0x9066('0x28')](function(_0x12dbdc){if(_0x12dbdc){return db[_0x9066('0x51')]['transaction'](function(_0xc72416){return db[_0x9066('0x53')]['destroy']({'where':{'userProfileId':_0x3a0ba8['params']['id'],'sectionId':_[_0x9066('0x2d')](_0x57a541,function(_0x5cd105){return _0x5cd105[_0x9066('0x59')];})},'transaction':_0xc72416})[_0x9066('0x28')](function(){var _0x336dac=_[_0x9066('0x2d')](_0x57a541,function(_0x243b67){_0x243b67[_0x9066('0x5a')]=_0x3a0ba8[_0x9066('0x54')]['id'];return _0x243b67;});var _0x3348b0=[];return BPromise[_0x9066('0x55')](_0x336dac,function(_0x42ef47){return db[_0x9066('0x53')][_0x9066('0x4a')](_0x42ef47,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0xc72416})[_0x9066('0x28')](function(_0x578b64){_0x3348b0[_0x9066('0x5d')](_0x578b64[_0x9066('0x4d')]({'plain':!![]}));});})['then'](function(){return _0x3348b0;});});});}})['then'](function(_0x281713){return _0x281713;})['then'](respondWithResult(_0x1c01a5,null))[_0x9066('0x45')](handleError(_0x1c01a5,null));};exports[_0x9066('0x5e')]=function(_0x88a677,_0x355b2e){var _0x31b46b;return db['UserProfile'][_0x9066('0x49')]({'where':{'id':_0x88a677[_0x9066('0x54')]['id']},'attributes':['id',_0x9066('0x2c')]})[_0x9066('0x28')](handleEntityNotFound(_0x355b2e,null))[_0x9066('0x28')](function(_0xc3d624){if(_0xc3d624){_0x31b46b=_0xc3d624;return db['UserProfileSection'][_0x9066('0x29')]({'where':{'userProfileId':_0x88a677[_0x9066('0x54')]['id'],'sectionId':_0x88a677[_0x9066('0x33')]['ids']}});}})[_0x9066('0x28')](function(){return _0x31b46b;})[_0x9066('0x28')](respondWithStatusCode(_0x355b2e,null))[_0x9066('0x45')](handleError(_0x355b2e,null));};exports[_0x9066('0x5f')]=function(_0x576635,_0x19c1ba){var _0x5f2f05=[];var _0x2d6c20=[];return db[_0x9066('0x53')][_0x9066('0x43')]({'where':{'userProfileId':_0x576635[_0x9066('0x54')]['id']},'raw':!![]})['then'](function(_0x3081a3){_0x5f2f05=_['filter'](_0x3081a3,function(_0x546e49){return _0x546e49[_0x9066('0x60')]===0x1||_[_0x9066('0x61')]([0x3eb,0x709],_0x546e49['sectionId']);});if(!_[_0x9066('0x62')](_0x5f2f05)){return _[_0x9066('0x2d')](_0x5f2f05,function(_0x58d415){return _0x58d415[_0x9066('0x59')];});}else{return;}})['then'](function(_0x2e7bea){if(_0x2e7bea)_0x2d6c20=_0x2e7bea;if(_[_0x9066('0x61')](_0x2d6c20,0x64)){var _0x558411=_[_0x9066('0x49')](_0x5f2f05,{'sectionId':0x64});return hasDefaultDashboard(_0x558411)[_0x9066('0x28')](function(_0x272853){return _[_0x9066('0x2d')](_0x5f2f05,function(_0x1319a5){if(_0x1319a5[_0x9066('0x59')]===0x64){_0x1319a5[_0x9066('0x63')]=_0x272853;}return _0x1319a5;});});}else{return;}})[_0x9066('0x28')](function(_0x3ffe0d){if(_0x3ffe0d)_0x5f2f05=_0x3ffe0d;if(_[_0x9066('0x61')](_0x2d6c20,0x3eb)){var _0x3c5d11=_[_0x9066('0x49')](_0x5f2f05,{'sectionId':0x3eb});return getCustomDashboards(_0x3c5d11)[_0x9066('0x28')](function(_0x4d50bd){return _[_0x9066('0x2d')](_0x5f2f05,function(_0x43b0ad){if(_0x3c5d11['enabled']){if(_0x43b0ad[_0x9066('0x59')]===0x3eb){_0x43b0ad[_0x9066('0x63')]=_0x4d50bd;}}else{if(_0x43b0ad['sectionId']===0x64){_0x43b0ad[_0x9066('0x63')]=_0x4d50bd;}}return _0x43b0ad;});});}else{return;}})['then'](function(_0x57f23b){if(_0x57f23b)_0x5f2f05=_0x57f23b;if(_[_0x9066('0x61')](_0x2d6c20,0x709)){var _0x4a6a74=_['find'](_0x5f2f05,{'sectionId':0x709});return getPlugins(_0x4a6a74)['then'](function(_0x55536f){if(_0x4a6a74[_0x9066('0x60')]){return _[_0x9066('0x2d')](_0x5f2f05,function(_0x392f93){if(_0x392f93[_0x9066('0x59')]===0x709){_0x392f93[_0x9066('0x63')]=_0x55536f;}return _0x392f93;});}else{var _0x54de3f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x55536f};var _0x42e638=_[_0x9066('0x2d')](_0x5f2f05);_0x42e638['push'](_0x54de3f);return _0x42e638;}});}else{return;}})[_0x9066('0x28')](function(_0x492972){if(_0x492972)_0x5f2f05=_0x492972;return _[_0x9066('0x3e')](_0x5f2f05,[_0x9066('0x60'),0x1]);})[_0x9066('0x28')](respondWithResult(_0x19c1ba,null))[_0x9066('0x45')](handleError(_0x19c1ba,null));};function hasDefaultDashboard(_0x28f2c7){var _0x156568=[0x65];return new BPromise(function(_0x18ef2b,_0x433083){try{if(_0x28f2c7['autoAssociation']){_0x18ef2b(_0x156568);}else{return db[_0x9066('0x57')][_0x9066('0x64')]({'where':{'sectionId':_0x28f2c7['id']},'raw':!![]})[_0x9066('0x28')](function(_0x5c4169){_0x5c4169?_0x18ef2b(_0x156568):_0x18ef2b();});}}catch(_0x238b84){_0x433083(_0x238b84);}});}function getCustomDashboards(_0x1f0734){var _0x417d35=[];return new BPromise(function(_0x5e2e19,_0x287e4c){try{if(_0x1f0734[_0x9066('0x56')]){return db[_0x9066('0x65')][_0x9066('0x43')]({'raw':!![]})['then'](function(_0x38dfae){_0x38dfae[_0x9066('0x66')](function(_0xf85d3d){_0x417d35[_0x9066('0x5d')](_0xf85d3d['id']+0x1869f);});_0x5e2e19(_0x417d35);});}else{return db[_0x9066('0x57')][_0x9066('0x43')]({'where':{'sectionId':_0x1f0734['id']},'raw':!![]})[_0x9066('0x28')](function(_0x735631){_0x735631[_0x9066('0x66')](function(_0x59cc0e){_0x417d35['push'](_0x59cc0e['resourceId']+0x1869f);});_0x5e2e19(_0x417d35);});}}catch(_0x4e16e4){_0x287e4c(_0x4e16e4);}});}function getPlugins(_0x2569e2){var _0x4b82cd=[];return new BPromise(function(_0x56c38f,_0x1df987){try{if(_0x2569e2[_0x9066('0x56')]){return db['Plugin'][_0x9066('0x43')]({'raw':!![]})[_0x9066('0x28')](function(_0x56c029){_0x56c029[_0x9066('0x66')](function(_0xd64127){_0x4b82cd['push'](_0xd64127['id']+0x15b38);});_0x56c38f(_0x4b82cd);});}else{return db[_0x9066('0x57')][_0x9066('0x43')]({'where':{'sectionId':_0x2569e2['id']},'raw':!![]})[_0x9066('0x28')](function(_0x12918f){_0x12918f[_0x9066('0x66')](function(_0x4b9e3a){_0x4b82cd[_0x9066('0x5d')](_0x4b9e3a[_0x9066('0x67')]+0x15b38);});_0x56c38f(_0x4b82cd);});}}catch(_0x1a20be){_0x1df987(_0x1a20be);}});}exports[_0x9066('0x68')]=function(_0x43b9be,_0xe5a794){return db[_0x9066('0x2e')]['find']({'where':{'id':_0x43b9be['params']['id']}})[_0x9066('0x28')](handleEntityNotFound(_0xe5a794,null))[_0x9066('0x28')](function(_0x4f7602){if(_0x4f7602){return db[_0x9066('0x51')][_0x9066('0x52')](function(_0x655f9c){return db[_0x9066('0x53')][_0x9066('0x43')]({'where':{'userProfileId':_0x43b9be['params']['id']},'attributes':['id'],'raw':!![]})[_0x9066('0x28')](function(_0x221f9b){if(_0x221f9b){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x43b9be[_0x9066('0x54')]['id'],'id':_[_0x9066('0x2d')](_0x221f9b,function(_0x1da6fa){return _0x1da6fa['id'];})},'transaction':_0x655f9c});}})[_0x9066('0x28')](function(_0xe9740){var _0x450089=_[_0x9066('0x2d')](_0x43b9be['body'],function(_0x2f227a){_0x2f227a['userProfileId']=_0x43b9be[_0x9066('0x54')]['id'];return _0x2f227a;});return db[_0x9066('0x53')][_0x9066('0x69')](_0x450089,{'raw':!![],'transaction':_0x655f9c});})[_0x9066('0x28')](function(_0x20a322){var _0x3f5064=_[_0x9066('0x3e')](_[_0x9066('0x2d')](_0x20a322,function(_0x1604dd){return _0x1604dd[_0x9066('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x3f5064){return db[_0x9066('0x53')]['findAll']({'where':{'userProfileId':_0x43b9be[_0x9066('0x54')]['id'],'sectionId':_['map'](_0x3f5064,function(_0x24d64c){return _0x24d64c[_0x9066('0x59')];})},'attributes':['id',_0x9066('0x59')],'raw':!![]})[_0x9066('0x28')](function(_0x1dafa4){var _0x494df2=_[_0x9066('0x2d')](_0x43b9be['body'],function(_0x38898a){_0x38898a[_0x9066('0x5a')]=_0x43b9be['params']['id'];return _0x38898a;});return db[_0x9066('0x57')]['bulkCreate'](_0x494df2,{'raw':!![],'transaction':_0x655f9c});});}})[_0x9066('0x45')](handleError(_0xe5a794,null));});}})[_0x9066('0x28')](function(_0x33409d){var _0x1e962a=_[_0x9066('0x2d')](_0x33409d,function(_0x10a70f){return _0x10a70f['get']({'plain':!![]});});})['then'](respondWithResult(_0xe5a794,null))[_0x9066('0x45')](handleError(_0xe5a794,null));};exports[_0x9066('0x6a')]=function(_0x5a2246,_0x15d843,_0x35f7c8){return db['UserProfile'][_0x9066('0x49')]({'where':{'id':_0x5a2246[_0x9066('0x54')]['id']}})[_0x9066('0x28')](handleEntityNotFound(_0x15d843,null))['then'](function(_0x4bd9b2){if(_0x4bd9b2){return _0x4bd9b2[_0x9066('0x6a')](_0x5a2246[_0x9066('0x33')][_0x9066('0x6b')]);}})[_0x9066('0x28')](respondWithStatusCode(_0x15d843,null))[_0x9066('0x45')](handleError(_0x15d843,null));};exports['getResources']=function(_0x3feaff,_0x5aa9da){var _0x1ff462={'raw':![],'where':{}};var _0x528e9a={};var _0x4c2a29={'count':0x0,'rows':[]};var _0x37bd35=_0x3feaff[_0x9066('0x33')][_0x9066('0x6c')];if(typeof _0x37bd35===_0x9066('0x6d')){throw new db[(_0x9066('0x6e'))][(_0x9066('0x6f'))]('Unknown\x20section');}var _0x1339bd=_0x3feaff[_0x9066('0x33')][_0x9066('0x70')]||![];var _0x46ee4a=getQueryModels(_0x37bd35,_0x1339bd);if(typeof _0x46ee4a[_0x9066('0x71')]===_0x9066('0x6d')){throw new db['Sequelize'][(_0x9066('0x6f'))]('Invalid\x20section\x20\x27'+_0x37bd35+'\x27');}var _0x47e931=[];if(!_[_0x9066('0x62')](_0x46ee4a[_0x9066('0x72')])){_0x47e931=_0x46ee4a[_0x9066('0x72')];}else{_0x47e931=[{'name':_0x37bd35}];}return db[_0x9066('0x2e')]['findOne']({'where':{'id':_0x3feaff['params']['id']}})[_0x9066('0x28')](handleEntityNotFound(_0x5aa9da,null))['then'](function(_0x54dc11){if(_0x54dc11){var _0x490147=[];for(var _0x29e338=0x0;_0x29e338<_0x47e931[_0x9066('0x38')];_0x29e338++){_0x490147[_0x9066('0x5d')](db['UserProfileSection'][_0x9066('0x64')]({'where':{'userProfileId':_0x54dc11['id'],'name':_0x47e931[_0x29e338][_0x9066('0x2c')]},'raw':!![]}));}return BPromise[_0x9066('0x73')](_0x490147);}})['then'](function(_0x1689a8){var _0xbd7512=_['filter'](_0x1689a8,function(_0x30edc7){return _0x30edc7?_0x30edc7:undefined;});var _0x277a50=_[_0x9066('0x3e')](_0x47e931,[_0x9066('0x74'),!![]]);var _0x17d11c=_['isEmpty'](_0xbd7512)&&_[_0x9066('0x62')](_0x277a50)?null:_['union'](_0x277a50,_0xbd7512);if(_0x17d11c){var _0x544b08=[];for(var _0x47afc0=0x0;_0x47afc0<_0x17d11c[_0x9066('0x38')];_0x47afc0++){var _0x55b7ea=_['find'](_0x47e931,function(_0x43263c){return _0x17d11c[_0x47afc0]?_0x43263c['name']===_0x17d11c[_0x47afc0]['name']:null;});if(_0x55b7ea){if(_0x17d11c[_0x47afc0][_0x9066('0x74')]){_0x544b08[_0x9066('0x5d')](getAllResources(_0x46ee4a[_0x9066('0x71')],_0x17d11c[_0x47afc0]));}else{if(!_0x17d11c[_0x47afc0][_0x9066('0x56')]){_0x544b08[_0x9066('0x5d')](getAllowedResources(_0x55b7ea,_0x17d11c[_0x47afc0],_0x46ee4a[_0x9066('0x71')]));}else{if(_0x55b7ea['model']){_0x544b08['push'](getAllFilteredResources(_0x55b7ea,_0x17d11c[_0x47afc0]));}}}}}return BPromise[_0x9066('0x73')](_0x544b08);}else{return null;}})[_0x9066('0x28')](function(_0xbb307d){var _0x44a13e=_0xbb307d;var _0x30fef2=null;if(_0x44a13e){_0x30fef2=_0x44a13e['length']===0x1?_0x44a13e[0x0]:null;}if(_0x30fef2||_0x44a13e){var _0xc5b823=db[_0x46ee4a[_0x9066('0x71')]][_0x9066('0x2f')];_0x528e9a[_0x9066('0x32')]=_[_0x9066('0x47')](_0xc5b823);_0x528e9a[_0x9066('0x33')]=_['keys'](_0x3feaff[_0x9066('0x33')]);_0x528e9a[_0x9066('0x34')]=_[_0x9066('0x35')](_0x528e9a['model'],_0x528e9a[_0x9066('0x33')]);_0x1ff462[_0x9066('0x36')]=_[_0x9066('0x35')](_0x528e9a['model'],qs[_0x9066('0x37')](_0x3feaff[_0x9066('0x33')]['fields']));_0x1ff462[_0x9066('0x36')]=_0x1ff462[_0x9066('0x36')][_0x9066('0x38')]?_0x1ff462[_0x9066('0x36')]:_0x528e9a[_0x9066('0x32')];if(!_0x3feaff[_0x9066('0x33')]['hasOwnProperty'](_0x9066('0x39'))){_0x1ff462['limit']=qs[_0x9066('0x22')](_0x3feaff['query'][_0x9066('0x22')]);_0x1ff462[_0x9066('0x21')]=qs['offset'](_0x3feaff[_0x9066('0x33')][_0x9066('0x21')]);}_0x1ff462['order']=qs['sort'](_0x3feaff[_0x9066('0x33')][_0x9066('0x3b')]);_0x1ff462[_0x9066('0x3c')]=qs[_0x9066('0x34')](_[_0x9066('0x3d')](_0x3feaff[_0x9066('0x33')],_0x528e9a['filters']));if(_0x3feaff[_0x9066('0x33')][_0x9066('0x3e')]){_0x1ff462[_0x9066('0x3c')]=_[_0x9066('0x3f')](_0x1ff462['where'],{'$or':_['map'](_0xc5b823,function(_0x2d7c51){if(_0x2d7c51[_0x9066('0x30')][_0x9066('0x31')]!==_0x9066('0x40')){var _0x54cfdb={};_0x54cfdb[_0x2d7c51[_0x9066('0x75')]]={'$like':'%'+_0x3feaff[_0x9066('0x33')][_0x9066('0x3e')]+'%'};return _0x54cfdb;}})});}var _0x1e9de9=[];if(_0x30fef2){var _0x2b579d=_[_0x9066('0x49')](_0x47e931,[_0x9066('0x2c'),_0x30fef2['name']]);if(_0x2b579d[_0x9066('0x75')]){var _0x579126={};if(_0x46ee4a[_0x9066('0x71')]==='AnalyticExtractedReport'){_0x579126[_0x2b579d[_0x9066('0x76')]]=_[_0x9066('0x2d')](_0x30fef2['associatedResources'],'id');}else{_0x579126[_0x2b579d[_0x9066('0x76')]]=_0x30fef2['associatedResources'];}_0x1e9de9['push'](_0x579126);}else{_0x1ff462[_0x9066('0x3c')]['id']=_0x30fef2['associatedResources'];}}else{for(var _0xd0138b=0x0;_0xd0138b<_0x44a13e[_0x9066('0x38')];_0xd0138b++){var _0x2b579d=_['find'](_0x47e931,[_0x9066('0x2c'),_0x44a13e[_0xd0138b][_0x9066('0x2c')]]);if(_0x2b579d[_0x9066('0x75')]){var _0x579126={};_0x579126[_0x2b579d[_0x9066('0x76')]]=_0x44a13e[_0xd0138b][_0x9066('0x77')];_0x1e9de9['push'](_0x579126);}else{if(!_0x1ff462[_0x9066('0x3c')]['id'])_0x1ff462[_0x9066('0x3c')]['id']=[];_0x44a13e[_0xd0138b][_0x9066('0x77')][_0x9066('0x66')](function(_0x29264b){_0x1ff462[_0x9066('0x3c')]['id'][_0x9066('0x5d')](_0x29264b);});}}}if(!_[_0x9066('0x62')](_0x1e9de9)){_0x1ff462['where']=_[_0x9066('0x3f')](_0x1ff462[_0x9066('0x3c')],{'$and':{'$or':_0x1e9de9}});}_0x1ff462=_['merge']({},_0x1ff462,_0x3feaff[_0x9066('0x41')]);if(_0x30fef2&&!_0x30fef2['autoAssociation']&&_0x46ee4a['childModel']===_0x9066('0x78')){if(_0x3feaff['query'][_0x9066('0x48')]){_0x1ff462['include']=[{'all':!![]}];}return db[_0x46ee4a[_0x9066('0x71')]][_0x9066('0x43')](_0x1ff462)[_0x9066('0x28')](function(_0x1fb5e1){var _0x59519a=[];_0x1fb5e1[_0x9066('0x66')](function(_0x4108d7){var _0x1041d1;switch(_0x4108d7['reportType']){case _0x9066('0x79'):_0x1041d1=_['find'](_0x30fef2[_0x9066('0x77')],function(_0x422a58){return _0x422a58['id']===_0x4108d7[_0x9066('0x7a')]&&_0x422a58[_0x9066('0x30')]===_0x9066('0x7b');});break;case'custom':_0x1041d1=_[_0x9066('0x49')](_0x30fef2[_0x9066('0x77')],function(_0xd20044){return _0xd20044['id']===_0x4108d7[_0x9066('0x7a')]&&_0xd20044['type']===_0x9066('0x7c');});break;}if(_0x1041d1)_0x59519a[_0x9066('0x5d')](_0x4108d7);});_0x4c2a29[_0x9066('0x20')]=_0x59519a[_0x9066('0x38')];_0x4c2a29[_0x9066('0x44')]=_0x59519a;return _0x4c2a29;});}else{return db[_0x46ee4a[_0x9066('0x71')]][_0x9066('0x20')]({'where':_0x1ff462[_0x9066('0x3c')]})[_0x9066('0x28')](function(_0x3496cd){_0x4c2a29['count']=_0x3496cd;if(_0x3feaff[_0x9066('0x33')]['includeAll']){if(_0x46ee4a[_0x9066('0x71')]===_0x9066('0x7d')){_0x1ff462[_0x9066('0x42')]=[{'model':db[_0x9066('0x7e')],'as':_0x9066('0x7f'),'attributes':['id',_0x9066('0x2c'),_0x9066('0x80')],'required':_0x3feaff['query'][_0x9066('0x81')]?!![]:![]},{'model':db['Tag'],'as':_0x9066('0x82'),'attributes':['id',_0x9066('0x2c'),_0x9066('0x80')],'through':_0x3feaff[_0x9066('0x33')]['tag']?{'attributes':[],'where':{'TagId':_0x3feaff[_0x9066('0x33')]['tag']||undefined}}:{},'required':_0x3feaff[_0x9066('0x33')]['tag']?!![]:![]}];}else{_0x1ff462['include']=[{'all':!![]}];}}return db[_0x46ee4a[_0x9066('0x71')]][_0x9066('0x43')](_0x1ff462);})['then'](function(_0x5a2a2a){_0x4c2a29[_0x9066('0x44')]=_0x5a2a2a;return _0x4c2a29;});}}else{return _0x4c2a29;}})[_0x9066('0x28')](respondWithFilteredResult(_0x5aa9da,_0x1ff462))[_0x9066('0x45')](handleError(_0x5aa9da,null));};function getAllResources(_0x3d8e4f,_0x327ecd){return new BPromise(function(_0x207b18,_0x3aa2f7){if(_0x327ecd){var _0xe37d3e=_0x327ecd[_0x9066('0x3e')]?{[_0x327ecd[_0x9066('0x3e')]['field']]:_0x327ecd[_0x9066('0x3e')][_0x9066('0x83')]}:undefined;return db[_0x3d8e4f]['findAll']({'where':_0xe37d3e,'raw':!![]})[_0x9066('0x28')](function(_0x5e07c3){_0x327ecd[_0x9066('0x77')]=_[_0x9066('0x2d')](_0x5e07c3,'id');_0x207b18(_0x327ecd);})[_0x9066('0x45')](function(_0x4e123e){_0x3aa2f7(_0x4e123e);});}else{_0x207b18(null);}});}function getAllFilteredResources(_0xd2852,_0x3f96f2){return new BPromise(function(_0x42cc4b,_0x4d85a0){var _0x2f145b=_0xd2852[_0x9066('0x3e')]?{[_0xd2852[_0x9066('0x3e')][_0x9066('0x75')]]:_0xd2852[_0x9066('0x3e')][_0x9066('0x83')]}:undefined;return db[_0xd2852[_0x9066('0x32')]][_0x9066('0x43')]({'where':_0x2f145b,'raw':!![]})[_0x9066('0x28')](function(_0x740dab){_0x3f96f2[_0x9066('0x77')]=_[_0x9066('0x2d')](_0x740dab,function(_0x23587d){return _0x23587d['name'];});_0x42cc4b(_0x3f96f2);})['catch'](function(_0x57a735){_0x4d85a0(_0x57a735);});});}function getAllowedResources(_0x27ad16,_0x5018e0,_0x5597bf){return new BPromise(function(_0x4a1253,_0x16353e){if(_0x5018e0){return db[_0x9066('0x57')]['findAll']({'where':{'sectionId':_0x5018e0['id']},'raw':!![]})['then'](function(_0x61d4dd){if(_0x27ad16[_0x9066('0x75')]&&_0x27ad16['field']!=='id'){_0x5018e0[_0x9066('0x77')]=_[_0x9066('0x2d')](_0x61d4dd,function(_0x39a5d2){return _0x39a5d2[_0x27ad16[_0x9066('0x75')]];});}else{if(_0x5597bf==='AnalyticExtractedReport'){_0x5018e0[_0x9066('0x77')]=_['map'](_0x61d4dd,function(_0x4d2b9a){return{'id':_0x4d2b9a['resourceId'],'type':_0x4d2b9a[_0x9066('0x30')]};});}else{_0x5018e0['associatedResources']=_[_0x9066('0x2d')](_0x61d4dd,function(_0x566028){return _0x566028[_0x9066('0x67')];});}}_0x4a1253(_0x5018e0);})[_0x9066('0x45')](function(_0x5242ea){_0x16353e(_0x5242ea);});}else{_0x4a1253(null);}});}function getQueryModels(_0x596681,_0x33ab87){var _0x5861a9=_0x596681[_0x9066('0x84')]();var _0x379ef0={'childModel':undefined,'parentSections':[]};switch(_0x5861a9){case _0x9066('0x85'):_0x379ef0[_0x9066('0x71')]=_0x9066('0x86');break;case _0x9066('0x87'):_0x379ef0[_0x9066('0x71')]=_0x9066('0x88');break;case _0x9066('0x89'):_0x379ef0['childModel']=_0x9066('0x8a');_0x379ef0[_0x9066('0x72')]=[{'name':_0x9066('0x8b'),'field':_0x9066('0x2c'),'foreignKey':_0x9066('0x8c')}];break;case _0x9066('0x8d'):_0x379ef0[_0x9066('0x71')]='JscriptyProject';break;case _0x9066('0x8e'):_0x379ef0[_0x9066('0x71')]=_0x9066('0x7d');_0x379ef0[_0x9066('0x72')]=[{'name':'Lists','field':'id','foreignKey':_0x9066('0x8f')}];break;case _0x9066('0x90'):_0x379ef0['childModel']='CmList';break;case _0x9066('0x91'):_0x379ef0['childModel']='CmCompany';break;case _0x9066('0x92'):_0x379ef0[_0x9066('0x71')]=_0x9066('0x93');break;case _0x9066('0x94'):_0x379ef0[_0x9066('0x71')]='ChatQueue';break;case _0x9066('0x95'):_0x379ef0[_0x9066('0x71')]=_0x9066('0x96');break;case'faxqueues':_0x379ef0['childModel']='FaxQueue';break;case _0x9066('0x97'):_0x379ef0[_0x9066('0x71')]=_0x9066('0x98');break;case _0x9066('0x99'):case'internalroutes':case'outboundroutes':_0x379ef0[_0x9066('0x71')]=_0x9066('0x9a');break;case _0x9066('0x9b'):_0x379ef0[_0x9066('0x71')]='VoiceContext';break;case _0x9066('0x9c'):_0x379ef0['childModel']=_0x9066('0x9d');break;case'voicerecordings':_0x379ef0[_0x9066('0x71')]=_0x9066('0x9e');_0x379ef0[_0x9066('0x72')]=[{'name':_0x9066('0x9f'),'field':'name','foreignKey':'membername','model':_0x9066('0xa0'),'filter':{'field':'role','value':['agent']}},{'name':_0x9066('0xa1'),'field':'name','foreignKey':_0x9066('0xa2'),'model':_0x9066('0xa0'),'filter':{'field':_0x9066('0xa3'),'value':['telephone']}},{'name':_0x9066('0xa4'),'field':'name','foreignKey':'queue','model':_0x9066('0xa5'),'filter':{'field':_0x9066('0x30'),'value':[_0x9066('0xa6')]}},{'name':_0x9066('0xa7'),'field':_0x9066('0x2c'),'foreignKey':'queue','model':_0x9066('0xa5'),'filter':{'field':_0x9066('0x30'),'value':[_0x9066('0xa8')]}}];break;case _0x9066('0xa9'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xaa');break;case _0x9066('0xab'):_0x379ef0['childModel']='VoiceChanSpy';break;case _0x9066('0xac'):_0x379ef0[_0x9066('0x71')]='VoicePrefix';break;case _0x9066('0xad'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xae');break;case _0x9066('0xaf'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xb0');break;case _0x9066('0xb1'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xb2');break;case _0x9066('0xb3'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xb4');break;case _0x9066('0xb5'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xb6');break;case _0x9066('0xb7'):_0x379ef0[_0x9066('0x71')]='OpenchannelAccount';break;case _0x9066('0xb8'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xb9');break;case'smsaccounts':_0x379ef0[_0x9066('0x71')]=_0x9066('0xba');break;case'whatsappqueues':_0x379ef0[_0x9066('0x71')]=_0x9066('0xbb');break;case _0x9066('0xbc'):_0x379ef0['childModel']='WhatsappAccount';break;case'teams':_0x379ef0[_0x9066('0x71')]=_0x9066('0xbd');break;case _0x9066('0xbe'):case _0x9066('0xbf'):_0x379ef0['childModel']=_0x9066('0xa5');if(_0x33ab87){_0x379ef0[_0x9066('0x72')]=[{'name':_0x9066('0xa4')},{'name':_0x9066('0xa7')}];}break;case'users':case'agents':case'telephones':_0x379ef0['childModel']=_0x9066('0xa0');if(_0x33ab87){_0x379ef0[_0x9066('0x72')]=[{'name':_0x9066('0xc0'),'filter':{'field':_0x9066('0xa3'),'value':['admin',_0x9066('0xc1')]},'ignore':!![]},{'name':_0x9066('0x9f')},{'name':'Telephones'}];}break;case _0x9066('0xc2'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xc3');break;case'salesforceaccounts':_0x379ef0[_0x9066('0x71')]=_0x9066('0xc4');break;case _0x9066('0xc5'):_0x379ef0['childModel']=_0x9066('0xc6');break;case _0x9066('0xc7'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xc8');break;case'deskaccounts':_0x379ef0[_0x9066('0x71')]=_0x9066('0xc9');break;case _0x9066('0xca'):_0x379ef0['childModel']=_0x9066('0xcb');break;case _0x9066('0xcc'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xa0');break;case'cannedanswers':_0x379ef0[_0x9066('0x71')]=_0x9066('0xcd');break;case _0x9066('0xce'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xcf');break;case _0x9066('0xd0'):_0x379ef0[_0x9066('0x71')]=_0x9066('0x65');break;case _0x9066('0xd1'):_0x379ef0['childModel']=_0x9066('0xd2');break;case _0x9066('0xd3'):_0x379ef0['childModel']=_0x9066('0xd4');break;case'scheduler':_0x379ef0[_0x9066('0x71')]=_0x9066('0xd5');break;case _0x9066('0xd6'):_0x379ef0['childModel']=_0x9066('0xd7');break;case'tags':_0x379ef0['childModel']=_0x9066('0x7e');break;case _0x9066('0xd8'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xd9');break;case _0x9066('0xda'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xdb');break;case _0x9066('0xdc'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xdd');break;case _0x9066('0xde'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xdf');break;case'plugins':_0x379ef0['childModel']=_0x9066('0xe0');break;case _0x9066('0xe1'):_0x379ef0[_0x9066('0x71')]=_0x9066('0x78');_0x379ef0[_0x9066('0x72')]=[{'name':_0x9066('0xe2'),'field':'id','foreignKey':_0x9066('0x7a')}];break;case'metrics':_0x379ef0[_0x9066('0x71')]=_0x9066('0xe3');break;case _0x9066('0xbc'):_0x379ef0[_0x9066('0x71')]=_0x9066('0xe4');break;default:return _0x379ef0;}return _0x379ef0;}
\ No newline at end of file
index fa7c31d..3b52dc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0bc=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe0bc,0x166));var _0xce0b=function(_0x5af9,_0x13fd78){_0x5af9=_0x5af9-0x0;var _0x57969d=_0xe0bc[_0x5af9];return _0x57969d;};'use strict';var EventEmitter=require(_0xce0b('0x0'));var UserProfile=require(_0xce0b('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xce0b('0x2'),'afterUpdate':_0xce0b('0x3'),'afterDestroy':_0xce0b('0x4')};function emitEvent(_0x13a124){return function(_0x16b0c4,_0x1b2219,_0x269246){UserProfileEvents[_0xce0b('0x5')](_0x13a124+':'+_0x16b0c4['id'],_0x16b0c4);UserProfileEvents['emit'](_0x13a124,_0x16b0c4);_0x269246(null);};}for(var e in events){if(events[_0xce0b('0x6')](e)){var event=events[e];UserProfile[_0xce0b('0x7')](e,emitEvent(event));}}module[_0xce0b('0x8')]=UserProfileEvents;
\ No newline at end of file
+var _0xd58c=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','UserProfile'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd58c,0x15b));var _0xcd58=function(_0x290578,_0x2d4981){_0x290578=_0x290578-0x0;var _0x387494=_0xd58c[_0x290578];return _0x387494;};'use strict';var EventEmitter=require(_0xcd58('0x0'));var UserProfile=require(_0xcd58('0x1'))['db'][_0xcd58('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xcd58('0x3')](0x0);var events={'afterCreate':_0xcd58('0x4'),'afterUpdate':_0xcd58('0x5'),'afterDestroy':_0xcd58('0x6')};function emitEvent(_0x3a22fe){return function(_0x489fa7,_0x425891,_0x29fb73){UserProfileEvents[_0xcd58('0x7')](_0x3a22fe+':'+_0x489fa7['id'],_0x489fa7);UserProfileEvents[_0xcd58('0x7')](_0x3a22fe,_0x489fa7);_0x29fb73(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xcd58('0x8')](e,emitEvent(event));}}module[_0xcd58('0x9')]=UserProfileEvents;
\ No newline at end of file
index ae8324f..a987fca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6806=['request-promise','path','rimraf','../../config/environment','./userProfile.attributes','exports','define','lodash','util','../../config/logger','api','bluebird'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6806,0x1cf));var _0x6680=function(_0xc7b78b,_0x1f852e){_0xc7b78b=_0xc7b78b-0x0;var _0x4b5e17=_0x6806[_0xc7b78b];return _0x4b5e17;};'use strict';var _=require(_0x6680('0x0'));var util=require(_0x6680('0x1'));var logger=require(_0x6680('0x2'))(_0x6680('0x3'));var moment=require('moment');var BPromise=require(_0x6680('0x4'));var rp=require(_0x6680('0x5'));var fs=require('fs');var path=require(_0x6680('0x6'));var rimraf=require(_0x6680('0x7'));var config=require(_0x6680('0x8'));var attributes=require(_0x6680('0x9'));module[_0x6680('0xa')]=function(_0x48fc8f,_0x5bf654){return _0x48fc8f[_0x6680('0xb')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1adc=['./userProfile.attributes','define','user_profiles','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x357ee9,_0x283b33){var _0x14ede1=function(_0x312d54){while(--_0x312d54){_0x357ee9['push'](_0x357ee9['shift']());}};_0x14ede1(++_0x283b33);}(_0x1adc,0x1d7));var _0xc1ad=function(_0x4da78a,_0x3792b9){_0x4da78a=_0x4da78a-0x0;var _0xe4165b=_0x1adc[_0x4da78a];return _0xe4165b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc1ad('0x0'))(_0xc1ad('0x1'));var moment=require(_0xc1ad('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1ad('0x3'));var rimraf=require(_0xc1ad('0x4'));var config=require(_0xc1ad('0x5'));var attributes=require(_0xc1ad('0x6'));module['exports']=function(_0xa3ac17,_0x538e8d){return _0xa3ac17[_0xc1ad('0x7')]('UserProfile',attributes,{'tableName':_0xc1ad('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3aed7a6..5614c06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8958=['UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','register','request','info'];(function(_0x347536,_0x372840){var _0x150450=function(_0x22117a){while(--_0x22117a){_0x347536['push'](_0x347536['shift']());}};_0x150450(++_0x372840);}(_0x8958,0x93));var _0x8895=function(_0x1a13a9,_0x45be9f){_0x1a13a9=_0x1a13a9-0x0;var _0x3ab895=_0x8958[_0x1a13a9];return _0x3ab895;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8895('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x8895('0x2'))(_0x8895('0x3'));var config=require(_0x8895('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8895('0x5')][_0x8895('0x6')]({'port':0x232a});config[_0x8895('0x7')]=_[_0x8895('0x8')](config[_0x8895('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x8895('0x9'))(new Redis(config[_0x8895('0x7')]));require(_0x8895('0xa'))[_0x8895('0xb')](socket);function respondWithRpcPromise(_0x6eab1e,_0x29c126,_0x22a12b){return new BPromise(function(_0xdb3d59,_0x46c467){return client[_0x8895('0xc')](_0x6eab1e,_0x22a12b)['then'](function(_0x1cf600){logger[_0x8895('0xd')](_0x8895('0xe'),_0x29c126,_0x8895('0xf'));logger[_0x8895('0x10')](_0x8895('0x11'),_0x29c126,'request\x20sent',JSON[_0x8895('0x12')](_0x1cf600));if(_0x1cf600[_0x8895('0x13')]){if(_0x1cf600[_0x8895('0x13')]['code']===0x1f4){logger['error'](_0x8895('0xe'),_0x29c126,_0x1cf600['error'][_0x8895('0x14')]);return _0x46c467(_0x1cf600[_0x8895('0x13')][_0x8895('0x14')]);}logger[_0x8895('0x13')](_0x8895('0xe'),_0x29c126,_0x1cf600['error'][_0x8895('0x14')]);return _0xdb3d59(_0x1cf600[_0x8895('0x13')][_0x8895('0x14')]);}else{logger[_0x8895('0xd')](_0x8895('0xe'),_0x29c126,_0x8895('0xf'));_0xdb3d59(_0x1cf600[_0x8895('0x15')][_0x8895('0x14')]);}})[_0x8895('0x16')](function(_0x2da618){logger[_0x8895('0x13')](_0x8895('0xe'),_0x29c126,_0x2da618);_0x46c467(_0x2da618);});});}
\ No newline at end of file
+var _0x687b=['request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register'];(function(_0x313ef7,_0x1b574e){var _0x2c8417=function(_0x2860b0){while(--_0x2860b0){_0x313ef7['push'](_0x313ef7['shift']());}};_0x2c8417(++_0x1b574e);}(_0x687b,0x14a));var _0xb687=function(_0x1c8fb1,_0xb39e81){_0x1c8fb1=_0x1c8fb1-0x0;var _0x57f8e8=_0x687b[_0x1c8fb1];return _0x57f8e8;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});config[_0xb687('0xc')]=_[_0xb687('0xd')](config['redis'],{'host':_0xb687('0xe'),'port':0x18eb});var socket=require(_0xb687('0xf'))(new Redis(config['redis']));require(_0xb687('0x10'))[_0xb687('0x11')](socket);function respondWithRpcPromise(_0x825ad,_0x15dc9a,_0x404fdb){return new BPromise(function(_0x309d84,_0x3e6271){return client[_0xb687('0x12')](_0x825ad,_0x404fdb)[_0xb687('0x13')](function(_0x5103b9){logger[_0xb687('0x14')](_0xb687('0x15'),_0x15dc9a,_0xb687('0x16'));logger[_0xb687('0x17')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x15dc9a,'request\x20sent',JSON[_0xb687('0x18')](_0x5103b9));if(_0x5103b9[_0xb687('0x19')]){if(_0x5103b9['error'][_0xb687('0x1a')]===0x1f4){logger[_0xb687('0x19')](_0xb687('0x15'),_0x15dc9a,_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);return _0x3e6271(_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);}logger[_0xb687('0x19')](_0xb687('0x15'),_0x15dc9a,_0x5103b9[_0xb687('0x19')][_0xb687('0x1b')]);return _0x309d84(_0x5103b9[_0xb687('0x19')]['message']);}else{logger[_0xb687('0x14')](_0xb687('0x15'),_0x15dc9a,_0xb687('0x16'));_0x309d84(_0x5103b9['result']['message']);}})[_0xb687('0x1c')](function(_0x3a10ef){logger[_0xb687('0x19')]('UserProfile,\x20%s,\x20%s',_0x15dc9a,_0x3a10ef);_0x3e6271(_0x3a10ef);});});}
\ No newline at end of file
index 84ac0fa..7386044 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa09a=['remove','emit','register','length','userProfile:','./userProfile.events','save'];(function(_0x56a3ff,_0x440807){var _0x1d94a7=function(_0x109289){while(--_0x109289){_0x56a3ff['push'](_0x56a3ff['shift']());}};_0x1d94a7(++_0x440807);}(_0xa09a,0xc2));var _0xaa09=function(_0x341253,_0x5ae6cc){_0x341253=_0x341253-0x0;var _0x34c558=_0xa09a[_0x341253];return _0x34c558;};'use strict';var UserProfileEvents=require(_0xaa09('0x0'));var events=[_0xaa09('0x1'),_0xaa09('0x2'),'update'];function createListener(_0xdacb9b,_0x32a54e){return function(_0x5982a6){_0x32a54e[_0xaa09('0x3')](_0xdacb9b,_0x5982a6);};}function removeListener(_0x36647e,_0x259a7f){return function(){UserProfileEvents['removeListener'](_0x36647e,_0x259a7f);};}exports[_0xaa09('0x4')]=function(_0x10d27f){for(var _0x1804cd=0x0,_0x7768b5=events[_0xaa09('0x5')];_0x1804cd<_0x7768b5;_0x1804cd++){var _0x4dd4c4=events[_0x1804cd];var _0x19a219=createListener(_0xaa09('0x6')+_0x4dd4c4,_0x10d27f);UserProfileEvents['on'](_0x4dd4c4,_0x19a219);}};
\ No newline at end of file
+var _0xd1ad=['removeListener','register','length','userProfile:','./userProfile.events','remove','update'];(function(_0x5e2152,_0x172f3d){var _0x5ddcf6=function(_0x30a5cc){while(--_0x30a5cc){_0x5e2152['push'](_0x5e2152['shift']());}};_0x5ddcf6(++_0x172f3d);}(_0xd1ad,0x170));var _0xdd1a=function(_0x3987a1,_0x447793){_0x3987a1=_0x3987a1-0x0;var _0xe2596e=_0xd1ad[_0x3987a1];return _0xe2596e;};'use strict';var UserProfileEvents=require(_0xdd1a('0x0'));var events=['save',_0xdd1a('0x1'),_0xdd1a('0x2')];function createListener(_0x46aff6,_0x308bee){return function(_0x5f4e97){_0x308bee['emit'](_0x46aff6,_0x5f4e97);};}function removeListener(_0x5a0556,_0x4b6453){return function(){UserProfileEvents[_0xdd1a('0x3')](_0x5a0556,_0x4b6453);};}exports[_0xdd1a('0x4')]=function(_0x1c411f){for(var _0x5ec268=0x0,_0x5b4395=events[_0xdd1a('0x5')];_0x5ec268<_0x5b4395;_0x5ec268++){var _0x49bb26=events[_0x5ec268];var _0x48a60a=createListener(_0xdd1a('0x6')+_0x49bb26,_0x1c411f);UserProfileEvents['on'](_0x49bb26,_0x48a60a);}};
\ No newline at end of file
index 2ad3bec..bcea467 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f0e=['delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','index','get','describe','/:id','isAuthenticated','show','put','update'];(function(_0x578c42,_0x2f51b2){var _0x13268d=function(_0x571a84){while(--_0x571a84){_0x578c42['push'](_0x578c42['shift']());}};_0x13268d(++_0x2f51b2);}(_0x0f0e,0x17e));var _0xe0f0=function(_0x4a7ca3,_0x52cc2e){_0x4a7ca3=_0x4a7ca3-0x0;var _0x21fd6e=_0x0f0e[_0x4a7ca3];return _0x21fd6e;};'use strict';var multer=require(_0xe0f0('0x0'));var util=require('util');var path=require(_0xe0f0('0x1'));var timeout=require(_0xe0f0('0x2'));var express=require(_0xe0f0('0x3'));var router=express[_0xe0f0('0x4')]();var auth=require(_0xe0f0('0x5'));var interaction=require(_0xe0f0('0x6'));var config=require(_0xe0f0('0x7'));var controller=require(_0xe0f0('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe0f0('0x9')]);router[_0xe0f0('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xe0f0('0xb')]);router[_0xe0f0('0xa')](_0xe0f0('0xc'),auth[_0xe0f0('0xd')](),controller[_0xe0f0('0xe')]);router['post']('/',auth[_0xe0f0('0xd')](),controller['create']);router[_0xe0f0('0xf')](_0xe0f0('0xc'),auth[_0xe0f0('0xd')](),controller[_0xe0f0('0x10')]);router[_0xe0f0('0x11')](_0xe0f0('0xc'),auth[_0xe0f0('0xd')](),controller['destroy']);module[_0xe0f0('0x12')]=router;
\ No newline at end of file
+var _0xd01c=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x382afa,_0x8d527){var _0x507337=function(_0x318b5e){while(--_0x318b5e){_0x382afa['push'](_0x382afa['shift']());}};_0x507337(++_0x8d527);}(_0xd01c,0xfb));var _0xcd01=function(_0x3b4da5,_0x472d48){_0x3b4da5=_0x3b4da5-0x0;var _0x122b22=_0xd01c[_0x3b4da5];return _0x122b22;};'use strict';var multer=require(_0xcd01('0x0'));var util=require(_0xcd01('0x1'));var path=require(_0xcd01('0x2'));var timeout=require(_0xcd01('0x3'));var express=require(_0xcd01('0x4'));var router=express['Router']();var auth=require(_0xcd01('0x5'));var interaction=require(_0xcd01('0x6'));var config=require(_0xcd01('0x7'));var controller=require('./userProfileResource.controller');router[_0xcd01('0x8')]('/',auth[_0xcd01('0x9')](),controller[_0xcd01('0xa')]);router[_0xcd01('0x8')]('/describe',auth[_0xcd01('0x9')](),controller[_0xcd01('0xb')]);router[_0xcd01('0x8')](_0xcd01('0xc'),auth[_0xcd01('0x9')](),controller['show']);router[_0xcd01('0xd')]('/',auth[_0xcd01('0x9')](),controller['create']);router['put'](_0xcd01('0xc'),auth[_0xcd01('0x9')](),controller[_0xcd01('0xe')]);router['delete'](_0xcd01('0xc'),auth[_0xcd01('0x9')](),controller[_0xcd01('0xf')]);module[_0xcd01('0x10')]=router;
\ No newline at end of file
index e50fc37..e9cf9da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad18=['STRING','INTEGER','sequelize','exports'];(function(_0x34dd85,_0xe4e875){var _0x34a973=function(_0x4ce53b){while(--_0x4ce53b){_0x34dd85['push'](_0x34dd85['shift']());}};_0x34a973(++_0xe4e875);}(_0xad18,0x12a));var _0x8ad1=function(_0xb381b2,_0x1d209f){_0xb381b2=_0xb381b2-0x0;var _0x3e24fd=_0xad18[_0xb381b2];return _0x3e24fd;};'use strict';var Sequelize=require(_0x8ad1('0x0'));module[_0x8ad1('0x1')]={'name':{'type':Sequelize[_0x8ad1('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x8ad1('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8ad1('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x47f3=['INTEGER','exports','STRING'];(function(_0x794294,_0x38fece){var _0x3f17cc=function(_0x4a87c5){while(--_0x4a87c5){_0x794294['push'](_0x794294['shift']());}};_0x3f17cc(++_0x38fece);}(_0x47f3,0x1c9));var _0x347f=function(_0x25c26c,_0x28f284){_0x25c26c=_0x25c26c-0x0;var _0x1f214d=_0x47f3[_0x25c26c];return _0x1f214d;};'use strict';var Sequelize=require('sequelize');module[_0x347f('0x0')]={'name':{'type':Sequelize[_0x347f('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x347f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x347f('0x1')],'allowNull':![]}};
\ No newline at end of file
index 6403338..a27073a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName'];(function(_0x1a2ed8,_0x1ea1ab){var _0x4b8ba0=function(_0x4b9bd8){while(--_0x4b9bd8){_0x1a2ed8['push'](_0x1a2ed8['shift']());}};_0x4b8ba0(++_0x1ea1ab);}(_0x7217,0x19e));var _0x7721=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7217[_0x1ac595];return _0x455fff;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];function respondWithStatusCode(_0x27b36b,_0x55b4ca){_0x55b4ca=_0x55b4ca||0xcc;return function(_0x2911ec){if(_0x2911ec){return _0x27b36b[_0x7721('0x1b')](_0x55b4ca);}return _0x27b36b['status'](_0x55b4ca)[_0x7721('0x1c')]();};}function respondWithResult(_0x30da54,_0x3f01c5){_0x3f01c5=_0x3f01c5||0xc8;return function(_0x2e9752){if(_0x2e9752){return _0x30da54['status'](_0x3f01c5)[_0x7721('0x1d')](_0x2e9752);}};}function respondWithFilteredResult(_0x25b1c0,_0x534f1b){return function(_0x4e199a){if(_0x4e199a){var _0x4b183e=_0x4e199a[_0x7721('0x1e')],_0x5ed54=_0x534f1b['offset'],_0x25a628=_0x534f1b[_0x7721('0x1f')]+_0x534f1b['limit'],_0x3cc909;if(_0x25a628>=_0x4b183e){_0x25a628=_0x4b183e;_0x3cc909=0xc8;}else{_0x3cc909=0xce;}_0x25b1c0[_0x7721('0x20')](_0x3cc909);return _0x25b1c0['set'](_0x7721('0x21'),_0x5ed54+'-'+_0x25a628+'/'+_0x4b183e)[_0x7721('0x1d')](_0x4e199a);}return null;};}function patchUpdates(_0x3ab5a5){return function(_0x3e140d){try{jsonpatch[_0x7721('0x22')](_0x3e140d,_0x3ab5a5,!![]);}catch(_0x40af90){return BPromise[_0x7721('0x23')](_0x40af90);}return _0x3e140d[_0x7721('0x24')]();};}function saveUpdates(_0x3b29ac,_0xaeccc4){return function(_0x4ce1db){if(_0x4ce1db){return _0x4ce1db[_0x7721('0x25')](_0x3b29ac)[_0x7721('0x26')](function(_0x3a053f){return _0x3a053f;});}return null;};}function removeEntity(_0xd8ad3c,_0x57140c){return function(_0x28f5a6){if(_0x28f5a6){return _0x28f5a6['destroy']()[_0x7721('0x26')](function(){_0xd8ad3c[_0x7721('0x20')](0xcc)[_0x7721('0x1c')]();});}};}function handleEntityNotFound(_0x1caad8,_0x121cc4){return function(_0x395b15){if(!_0x395b15){_0x1caad8[_0x7721('0x1b')](0x194);}return _0x395b15;};}function handleError(_0x5b4d74,_0x216f20){_0x216f20=_0x216f20||0x1f4;return function(_0x1abedb){logger[_0x7721('0x27')](_0x1abedb[_0x7721('0x28')]);if(_0x1abedb[_0x7721('0x29')]){delete _0x1abedb[_0x7721('0x29')];}_0x5b4d74[_0x7721('0x20')](_0x216f20)[_0x7721('0x2a')](_0x1abedb);};}exports[_0x7721('0x2b')]=function(_0x52316e,_0x258ddf){var _0x5b0551={},_0x499b87={},_0x315202={'count':0x0,'rows':[]};var _0x343c19=_[_0x7721('0x2c')](db[_0x7721('0x2d')][_0x7721('0x2e')],function(_0x37b9f0){return{'name':_0x37b9f0[_0x7721('0x2f')],'type':_0x37b9f0[_0x7721('0x30')]['key']};});_0x499b87[_0x7721('0x31')]=_[_0x7721('0x2c')](_0x343c19,'name');_0x499b87['query']=_[_0x7721('0x32')](_0x52316e[_0x7721('0x33')]);_0x499b87['filters']=_[_0x7721('0x34')](_0x499b87[_0x7721('0x31')],_0x499b87[_0x7721('0x33')]);_0x5b0551['attributes']=_[_0x7721('0x34')](_0x499b87[_0x7721('0x31')],qs[_0x7721('0x35')](_0x52316e[_0x7721('0x33')][_0x7721('0x35')]));_0x5b0551['attributes']=_0x5b0551[_0x7721('0x36')][_0x7721('0x37')]?_0x5b0551[_0x7721('0x36')]:_0x499b87['model'];if(!_0x52316e[_0x7721('0x33')][_0x7721('0x38')]('nolimit')){_0x5b0551[_0x7721('0x39')]=qs['limit'](_0x52316e[_0x7721('0x33')][_0x7721('0x39')]);_0x5b0551[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x52316e[_0x7721('0x33')][_0x7721('0x1f')]);}_0x5b0551[_0x7721('0x3a')]=qs[_0x7721('0x3b')](_0x52316e[_0x7721('0x33')][_0x7721('0x3b')]);_0x5b0551[_0x7721('0x3c')]=qs['filters'](_[_0x7721('0x3d')](_0x52316e['query'],_0x499b87[_0x7721('0x3e')]),_0x343c19);if(_0x52316e[_0x7721('0x33')][_0x7721('0x3f')]){_0x5b0551[_0x7721('0x3c')]=_[_0x7721('0x40')](_0x5b0551[_0x7721('0x3c')],{'$or':_['map'](_0x343c19,function(_0x557c34){if(_0x557c34['type']!=='VIRTUAL'){var _0x18001c={};_0x18001c[_0x557c34[_0x7721('0x29')]]={'$like':'%'+_0x52316e[_0x7721('0x33')][_0x7721('0x3f')]+'%'};return _0x18001c;}})});}_0x5b0551=_['merge']({},_0x5b0551,_0x52316e[_0x7721('0x41')]);var _0x4cf659={'where':_0x5b0551[_0x7721('0x3c')]};return db[_0x7721('0x2d')]['count'](_0x4cf659)[_0x7721('0x26')](function(_0x3a47c8){_0x315202['count']=_0x3a47c8;if(_0x52316e['query'][_0x7721('0x42')]){_0x5b0551[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x2d')][_0x7721('0x44')](_0x5b0551);})['then'](function(_0x2db173){_0x315202[_0x7721('0x45')]=_0x2db173;return _0x315202;})[_0x7721('0x26')](respondWithFilteredResult(_0x258ddf,_0x5b0551))[_0x7721('0x46')](handleError(_0x258ddf,null));};exports[_0x7721('0x47')]=function(_0x52ab67,_0x490d4){var _0x4a2c28={'raw':![],'where':{'id':_0x52ab67['params']['id']}},_0xaa3216={};_0xaa3216[_0x7721('0x31')]=_[_0x7721('0x32')](db[_0x7721('0x2d')]['rawAttributes']);_0xaa3216[_0x7721('0x33')]=_[_0x7721('0x32')](_0x52ab67[_0x7721('0x33')]);_0xaa3216['filters']=_[_0x7721('0x34')](_0xaa3216[_0x7721('0x31')],_0xaa3216[_0x7721('0x33')]);_0x4a2c28[_0x7721('0x36')]=_[_0x7721('0x34')](_0xaa3216[_0x7721('0x31')],qs[_0x7721('0x35')](_0x52ab67['query']['fields']));_0x4a2c28[_0x7721('0x36')]=_0x4a2c28[_0x7721('0x36')][_0x7721('0x37')]?_0x4a2c28[_0x7721('0x36')]:_0xaa3216[_0x7721('0x31')];if(_0x52ab67[_0x7721('0x33')][_0x7721('0x42')]){_0x4a2c28[_0x7721('0x43')]=[{'all':!![]}];}_0x4a2c28=_[_0x7721('0x40')]({},_0x4a2c28,_0x52ab67[_0x7721('0x41')]);return db['UserProfileResource']['find'](_0x4a2c28)[_0x7721('0x26')](handleEntityNotFound(_0x490d4,null))[_0x7721('0x26')](respondWithResult(_0x490d4,null))[_0x7721('0x46')](handleError(_0x490d4,null));};exports[_0x7721('0x48')]=function(_0x589e95,_0x30107e){return db[_0x7721('0x2d')]['create'](_0x589e95[_0x7721('0x49')],{})['then'](respondWithResult(_0x30107e,0xc9))[_0x7721('0x46')](handleError(_0x30107e,null));};exports['update']=function(_0x334f23,_0x196be4){if(_0x334f23[_0x7721('0x49')]['id']){delete _0x334f23['body']['id'];}return db[_0x7721('0x2d')][_0x7721('0x4a')]({'where':{'id':_0x334f23['params']['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x196be4,null))[_0x7721('0x26')](saveUpdates(_0x334f23[_0x7721('0x49')],null))['then'](respondWithResult(_0x196be4,null))[_0x7721('0x46')](handleError(_0x196be4,null));};exports['destroy']=function(_0xdb1ca8,_0x310549){return db[_0x7721('0x2d')][_0x7721('0x4a')]({'where':{'id':_0xdb1ca8[_0x7721('0x4b')]['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x310549,null))[_0x7721('0x26')](removeEntity(_0x310549,null))[_0x7721('0x46')](handleError(_0x310549,null));};exports[_0x7721('0x4c')]=function(_0x3386aa,_0x31770e){return db[_0x7721('0x2d')][_0x7721('0x4c')]()[_0x7721('0x26')](respondWithResult(_0x31770e,null))[_0x7721('0x46')](handleError(_0x31770e,null));};
\ No newline at end of file
+var _0xa630=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','params','keys','length','find','create','body','describe','html-pdf','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x56a290,_0x245e01){var _0x3842a2=function(_0x575513){while(--_0x575513){_0x56a290['push'](_0x56a290['shift']());}};_0x3842a2(++_0x245e01);}(_0xa630,0xbe));var _0x0a63=function(_0x4720d3,_0x522829){_0x4720d3=_0x4720d3-0x0;var _0xf202fd=_0xa630[_0x4720d3];return _0xf202fd;};'use strict';var pdf=require(_0x0a63('0x0'));var emlformat=require(_0x0a63('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0a63('0x2'));var rp=require('request-promise');var moment=require(_0x0a63('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a63('0x4'));var util=require(_0x0a63('0x5'));var path=require(_0x0a63('0x6'));var sox=require(_0x0a63('0x7'));var csv=require(_0x0a63('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0a63('0x9'));var squel=require(_0x0a63('0xa'));var crypto=require(_0x0a63('0xb'));var jsforce=require(_0x0a63('0xc'));var deskjs=require(_0x0a63('0xd'));var toCsv=require(_0x0a63('0x8'));var querystring=require('querystring');var Papa=require(_0x0a63('0xe'));var Redis=require(_0x0a63('0xf'));var authService=require(_0x0a63('0x10'));var qs=require(_0x0a63('0x11'));var as=require(_0x0a63('0x12'));var hardwareService=require(_0x0a63('0x13'));var logger=require(_0x0a63('0x14'))(_0x0a63('0x15'));var utils=require(_0x0a63('0x16'));var config=require(_0x0a63('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x345f56,_0x420043){_0x420043=_0x420043||0xcc;return function(_0x2fce86){if(_0x2fce86){return _0x345f56[_0x0a63('0x18')](_0x420043);}return _0x345f56['status'](_0x420043)[_0x0a63('0x19')]();};}function respondWithResult(_0x4d68c0,_0x331e99){_0x331e99=_0x331e99||0xc8;return function(_0x19e922){if(_0x19e922){return _0x4d68c0[_0x0a63('0x1a')](_0x331e99)[_0x0a63('0x1b')](_0x19e922);}};}function respondWithFilteredResult(_0x3ea3bb,_0x23b49d){return function(_0x552b1f){if(_0x552b1f){var _0x1e3251=_0x552b1f[_0x0a63('0x1c')],_0x524a98=_0x23b49d[_0x0a63('0x1d')],_0x47788e=_0x23b49d[_0x0a63('0x1d')]+_0x23b49d[_0x0a63('0x1e')],_0x56b314;if(_0x47788e>=_0x1e3251){_0x47788e=_0x1e3251;_0x56b314=0xc8;}else{_0x56b314=0xce;}_0x3ea3bb[_0x0a63('0x1a')](_0x56b314);return _0x3ea3bb[_0x0a63('0x1f')](_0x0a63('0x20'),_0x524a98+'-'+_0x47788e+'/'+_0x1e3251)[_0x0a63('0x1b')](_0x552b1f);}return null;};}function patchUpdates(_0x2fd06c){return function(_0x3cc74d){try{jsonpatch[_0x0a63('0x21')](_0x3cc74d,_0x2fd06c,!![]);}catch(_0x4ea56f){return BPromise['reject'](_0x4ea56f);}return _0x3cc74d[_0x0a63('0x22')]();};}function saveUpdates(_0x586190,_0x2fc87c){return function(_0x5937df){if(_0x5937df){return _0x5937df[_0x0a63('0x23')](_0x586190)[_0x0a63('0x24')](function(_0x145625){return _0x145625;});}return null;};}function removeEntity(_0x46b968,_0x5da46b){return function(_0x398a16){if(_0x398a16){return _0x398a16['destroy']()[_0x0a63('0x24')](function(){_0x46b968[_0x0a63('0x1a')](0xcc)[_0x0a63('0x19')]();});}};}function handleEntityNotFound(_0x20c114,_0x343273){return function(_0x1f929f){if(!_0x1f929f){_0x20c114[_0x0a63('0x18')](0x194);}return _0x1f929f;};}function handleError(_0x53c6e3,_0x567017){_0x567017=_0x567017||0x1f4;return function(_0x5e5987){logger['error'](_0x5e5987['stack']);if(_0x5e5987[_0x0a63('0x25')]){delete _0x5e5987['name'];}_0x53c6e3['status'](_0x567017)[_0x0a63('0x26')](_0x5e5987);};}exports[_0x0a63('0x27')]=function(_0x362d6a,_0x2e2526){var _0x52e7ef={},_0x402692={},_0x498371={'count':0x0,'rows':[]};var _0x25ab82=_['map'](db[_0x0a63('0x28')][_0x0a63('0x29')],function(_0x1b7bdb){return{'name':_0x1b7bdb[_0x0a63('0x2a')],'type':_0x1b7bdb[_0x0a63('0x2b')][_0x0a63('0x2c')]};});_0x402692[_0x0a63('0x2d')]=_[_0x0a63('0x2e')](_0x25ab82,'name');_0x402692[_0x0a63('0x2f')]=_['keys'](_0x362d6a[_0x0a63('0x2f')]);_0x402692[_0x0a63('0x30')]=_[_0x0a63('0x31')](_0x402692[_0x0a63('0x2d')],_0x402692[_0x0a63('0x2f')]);_0x52e7ef['attributes']=_[_0x0a63('0x31')](_0x402692[_0x0a63('0x2d')],qs[_0x0a63('0x32')](_0x362d6a[_0x0a63('0x2f')]['fields']));_0x52e7ef[_0x0a63('0x33')]=_0x52e7ef[_0x0a63('0x33')]['length']?_0x52e7ef['attributes']:_0x402692[_0x0a63('0x2d')];if(!_0x362d6a['query']['hasOwnProperty'](_0x0a63('0x34'))){_0x52e7ef[_0x0a63('0x1e')]=qs['limit'](_0x362d6a[_0x0a63('0x2f')][_0x0a63('0x1e')]);_0x52e7ef[_0x0a63('0x1d')]=qs[_0x0a63('0x1d')](_0x362d6a[_0x0a63('0x2f')]['offset']);}_0x52e7ef['order']=qs[_0x0a63('0x35')](_0x362d6a[_0x0a63('0x2f')][_0x0a63('0x35')]);_0x52e7ef[_0x0a63('0x36')]=qs[_0x0a63('0x30')](_[_0x0a63('0x37')](_0x362d6a['query'],_0x402692[_0x0a63('0x30')]),_0x25ab82);if(_0x362d6a[_0x0a63('0x2f')]['filter']){_0x52e7ef[_0x0a63('0x36')]=_['merge'](_0x52e7ef['where'],{'$or':_[_0x0a63('0x2e')](_0x25ab82,function(_0x232388){if(_0x232388[_0x0a63('0x2b')]!=='VIRTUAL'){var _0x209447={};_0x209447[_0x232388[_0x0a63('0x25')]]={'$like':'%'+_0x362d6a[_0x0a63('0x2f')][_0x0a63('0x38')]+'%'};return _0x209447;}})});}_0x52e7ef=_[_0x0a63('0x39')]({},_0x52e7ef,_0x362d6a[_0x0a63('0x3a')]);var _0x604a45={'where':_0x52e7ef['where']};return db[_0x0a63('0x28')][_0x0a63('0x1c')](_0x604a45)[_0x0a63('0x24')](function(_0x53d034){_0x498371['count']=_0x53d034;if(_0x362d6a[_0x0a63('0x2f')]['includeAll']){_0x52e7ef[_0x0a63('0x3b')]=[{'all':!![]}];}return db[_0x0a63('0x28')][_0x0a63('0x3c')](_0x52e7ef);})['then'](function(_0x2af987){_0x498371[_0x0a63('0x3d')]=_0x2af987;return _0x498371;})[_0x0a63('0x24')](respondWithFilteredResult(_0x2e2526,_0x52e7ef))[_0x0a63('0x3e')](handleError(_0x2e2526,null));};exports['show']=function(_0x1e3b70,_0x236617){var _0x4234cd={'raw':![],'where':{'id':_0x1e3b70[_0x0a63('0x3f')]['id']}},_0x2ccd99={};_0x2ccd99[_0x0a63('0x2d')]=_['keys'](db[_0x0a63('0x28')][_0x0a63('0x29')]);_0x2ccd99[_0x0a63('0x2f')]=_[_0x0a63('0x40')](_0x1e3b70[_0x0a63('0x2f')]);_0x2ccd99[_0x0a63('0x30')]=_[_0x0a63('0x31')](_0x2ccd99[_0x0a63('0x2d')],_0x2ccd99[_0x0a63('0x2f')]);_0x4234cd[_0x0a63('0x33')]=_[_0x0a63('0x31')](_0x2ccd99[_0x0a63('0x2d')],qs[_0x0a63('0x32')](_0x1e3b70[_0x0a63('0x2f')][_0x0a63('0x32')]));_0x4234cd[_0x0a63('0x33')]=_0x4234cd[_0x0a63('0x33')][_0x0a63('0x41')]?_0x4234cd['attributes']:_0x2ccd99[_0x0a63('0x2d')];if(_0x1e3b70['query']['includeAll']){_0x4234cd[_0x0a63('0x3b')]=[{'all':!![]}];}_0x4234cd=_[_0x0a63('0x39')]({},_0x4234cd,_0x1e3b70[_0x0a63('0x3a')]);return db[_0x0a63('0x28')][_0x0a63('0x42')](_0x4234cd)[_0x0a63('0x24')](handleEntityNotFound(_0x236617,null))[_0x0a63('0x24')](respondWithResult(_0x236617,null))[_0x0a63('0x3e')](handleError(_0x236617,null));};exports[_0x0a63('0x43')]=function(_0xf00c9a,_0x9e5009){return db[_0x0a63('0x28')][_0x0a63('0x43')](_0xf00c9a[_0x0a63('0x44')],{})[_0x0a63('0x24')](respondWithResult(_0x9e5009,0xc9))[_0x0a63('0x3e')](handleError(_0x9e5009,null));};exports[_0x0a63('0x23')]=function(_0x20b864,_0x366887){if(_0x20b864[_0x0a63('0x44')]['id']){delete _0x20b864['body']['id'];}return db[_0x0a63('0x28')][_0x0a63('0x42')]({'where':{'id':_0x20b864['params']['id']}})['then'](handleEntityNotFound(_0x366887,null))['then'](saveUpdates(_0x20b864['body'],null))[_0x0a63('0x24')](respondWithResult(_0x366887,null))[_0x0a63('0x3e')](handleError(_0x366887,null));};exports['destroy']=function(_0x1abf0b,_0x59c367){return db[_0x0a63('0x28')][_0x0a63('0x42')]({'where':{'id':_0x1abf0b['params']['id']}})['then'](handleEntityNotFound(_0x59c367,null))['then'](removeEntity(_0x59c367,null))[_0x0a63('0x3e')](handleError(_0x59c367,null));};exports[_0x0a63('0x45')]=function(_0x246d03,_0xfa1083){return db[_0x0a63('0x28')]['describe']()[_0x0a63('0x24')](respondWithResult(_0xfa1083,null))[_0x0a63('0x3e')](handleError(_0xfa1083,null));};
\ No newline at end of file
index be16a37..37726cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96cc=['request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','../../config/logger','moment','bluebird'];(function(_0x318066,_0x51636f){var _0x14f526=function(_0x46f895){while(--_0x46f895){_0x318066['push'](_0x318066['shift']());}};_0x14f526(++_0x51636f);}(_0x96cc,0x16c));var _0xc96c=function(_0x53ca92,_0x3af852){_0x53ca92=_0x53ca92-0x0;var _0x138062=_0x96cc[_0x53ca92];return _0x138062;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var logger=require(_0xc96c('0x1'))('api');var moment=require(_0xc96c('0x2'));var BPromise=require(_0xc96c('0x3'));var rp=require(_0xc96c('0x4'));var fs=require('fs');var path=require(_0xc96c('0x5'));var rimraf=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var attributes=require(_0xc96c('0x8'));module[_0xc96c('0x9')]=function(_0x3b7f45,_0x5142cd){return _0x3b7f45[_0xc96c('0xa')](_0xc96c('0xb'),attributes,{'tableName':_0xc96c('0xc'),'paranoid':![],'indexes':[{'name':_0xc96c('0xd'),'fields':[_0xc96c('0xe'),_0xc96c('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xee5b,0x1f4));var _0xbee5=function(_0x338e9d,_0x29ac4c){_0x338e9d=_0x338e9d-0x0;var _0x22d3d7=_0xee5b[_0x338e9d];return _0x22d3d7;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','sectionId']}],'timestamps':!![]});};
\ No newline at end of file
index 58633f9..4843f7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7fa=['http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x2dac51,_0x5530df){var _0x5d8b12=function(_0x55c837){while(--_0x55c837){_0x2dac51['push'](_0x2dac51['shift']());}};_0x5d8b12(++_0x5530df);}(_0xf7fa,0x14d));var _0xaf7f=function(_0x5e7721,_0x4ca59f){_0x5e7721=_0x5e7721-0x0;var _0x5a0f22=_0xf7fa[_0x5e7721];return _0x5a0f22;};'use strict';var _=require('lodash');var util=require(_0xaf7f('0x0'));var moment=require(_0xaf7f('0x1'));var BPromise=require(_0xaf7f('0x2'));var rs=require(_0xaf7f('0x3'));var fs=require('fs');var Redis=require(_0xaf7f('0x4'));var db=require(_0xaf7f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaf7f('0x6'));var config=require(_0xaf7f('0x7'));var jayson=require(_0xaf7f('0x8'));var client=jayson['client'][_0xaf7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5883,_0x43ccff,_0x421b2d){return new BPromise(function(_0x2e1046,_0x5c4aa9){return client[_0xaf7f('0xa')](_0x3c5883,_0x421b2d)['then'](function(_0x1d3377){logger[_0xaf7f('0xb')](_0xaf7f('0xc'),_0x43ccff,_0xaf7f('0xd'));logger['debug'](_0xaf7f('0xe'),_0x43ccff,_0xaf7f('0xd'),JSON['stringify'](_0x1d3377));if(_0x1d3377[_0xaf7f('0xf')]){if(_0x1d3377['error'][_0xaf7f('0x10')]===0x1f4){logger['error'](_0xaf7f('0xc'),_0x43ccff,_0x1d3377[_0xaf7f('0xf')]['message']);return _0x5c4aa9(_0x1d3377[_0xaf7f('0xf')][_0xaf7f('0x11')]);}logger[_0xaf7f('0xf')](_0xaf7f('0xc'),_0x43ccff,_0x1d3377[_0xaf7f('0xf')][_0xaf7f('0x11')]);return _0x2e1046(_0x1d3377[_0xaf7f('0xf')]['message']);}else{logger[_0xaf7f('0xb')](_0xaf7f('0xc'),_0x43ccff,'request\x20sent');_0x2e1046(_0x1d3377['result']['message']);}})[_0xaf7f('0x12')](function(_0x1613c9){logger[_0xaf7f('0xf')](_0xaf7f('0xc'),_0x43ccff,_0x1613c9);_0x5c4aa9(_0x1613c9);});});}
\ No newline at end of file
+var _0xed30=['rpc','../../config/environment','client','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x27f314,_0x48ee4f){var _0x5dcd67=function(_0x48884){while(--_0x48884){_0x27f314['push'](_0x27f314['shift']());}};_0x5dcd67(++_0x48ee4f);}(_0xed30,0xaf));var _0x0ed3=function(_0x3863f1,_0x3fdb93){_0x3863f1=_0x3863f1-0x0;var _0x1ba38f=_0xed30[_0x3863f1];return _0x1ba38f;};'use strict';var _=require(_0x0ed3('0x0'));var util=require(_0x0ed3('0x1'));var moment=require(_0x0ed3('0x2'));var BPromise=require(_0x0ed3('0x3'));var rs=require(_0x0ed3('0x4'));var fs=require('fs');var Redis=require(_0x0ed3('0x5'));var db=require(_0x0ed3('0x6'))['db'];var utils=require(_0x0ed3('0x7'));var logger=require(_0x0ed3('0x8'))(_0x0ed3('0x9'));var config=require(_0x0ed3('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0ed3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1731b8,_0x187633,_0x380720){return new BPromise(function(_0x1fff19,_0x471cf1){return client[_0x0ed3('0xc')](_0x1731b8,_0x380720)['then'](function(_0x4ef02f){logger[_0x0ed3('0xd')](_0x0ed3('0xe'),_0x187633,_0x0ed3('0xf'));logger[_0x0ed3('0x10')](_0x0ed3('0x11'),_0x187633,_0x0ed3('0xf'),JSON[_0x0ed3('0x12')](_0x4ef02f));if(_0x4ef02f[_0x0ed3('0x13')]){if(_0x4ef02f[_0x0ed3('0x13')][_0x0ed3('0x14')]===0x1f4){logger[_0x0ed3('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x187633,_0x4ef02f[_0x0ed3('0x13')][_0x0ed3('0x15')]);return _0x471cf1(_0x4ef02f[_0x0ed3('0x13')][_0x0ed3('0x15')]);}logger['error'](_0x0ed3('0xe'),_0x187633,_0x4ef02f[_0x0ed3('0x13')][_0x0ed3('0x15')]);return _0x1fff19(_0x4ef02f[_0x0ed3('0x13')][_0x0ed3('0x15')]);}else{logger['info'](_0x0ed3('0xe'),_0x187633,'request\x20sent');_0x1fff19(_0x4ef02f[_0x0ed3('0x16')][_0x0ed3('0x15')]);}})['catch'](function(_0x2dd5b8){logger[_0x0ed3('0x13')](_0x0ed3('0xe'),_0x187633,_0x2dd5b8);_0x471cf1(_0x2dd5b8);});});}
\ No newline at end of file
index adc274a..962d673 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6b4=['destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','/:id','show','post','create','put','delete'];(function(_0x4b25bc,_0x1a7c95){var _0x47ac96=function(_0x4d0c52){while(--_0x4d0c52){_0x4b25bc['push'](_0x4b25bc['shift']());}};_0x47ac96(++_0x1a7c95);}(_0xc6b4,0x1aa));var _0x4c6b=function(_0x18baf4,_0x33086b){_0x18baf4=_0x18baf4-0x0;var _0x278ed1=_0xc6b4[_0x18baf4];return _0x278ed1;};'use strict';var multer=require(_0x4c6b('0x0'));var util=require('util');var path=require(_0x4c6b('0x1'));var timeout=require('connect-timeout');var express=require(_0x4c6b('0x2'));var router=express[_0x4c6b('0x3')]();var auth=require(_0x4c6b('0x4'));var interaction=require(_0x4c6b('0x5'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x4c6b('0x6')]('/',auth['isAuthenticated'](),controller[_0x4c6b('0x7')]);router[_0x4c6b('0x6')](_0x4c6b('0x8'),auth[_0x4c6b('0x9')](),controller['describe']);router[_0x4c6b('0x6')](_0x4c6b('0xa'),auth[_0x4c6b('0x9')](),controller[_0x4c6b('0xb')]);router[_0x4c6b('0xc')]('/',auth[_0x4c6b('0x9')](),controller[_0x4c6b('0xd')]);router[_0x4c6b('0xe')]('/:id',auth[_0x4c6b('0x9')](),controller['update']);router[_0x4c6b('0xf')]('/:id',auth[_0x4c6b('0x9')](),controller[_0x4c6b('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x1fd2=['Router','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','/describe','isAuthenticated','/:id','show','post','create','update','destroy','exports','util','path','express'];(function(_0x43f155,_0x2057b1){var _0x21bc11=function(_0x6ebe70){while(--_0x6ebe70){_0x43f155['push'](_0x43f155['shift']());}};_0x21bc11(++_0x2057b1);}(_0x1fd2,0x184));var _0x21fd=function(_0x1339dd,_0xafc6f8){_0x1339dd=_0x1339dd-0x0;var _0x5e14a4=_0x1fd2[_0x1339dd];return _0x5e14a4;};'use strict';var multer=require('multer');var util=require(_0x21fd('0x0'));var path=require(_0x21fd('0x1'));var timeout=require('connect-timeout');var express=require(_0x21fd('0x2'));var router=express[_0x21fd('0x3')]();var auth=require(_0x21fd('0x4'));var interaction=require(_0x21fd('0x5'));var config=require('../../config/environment');var controller=require(_0x21fd('0x6'));router[_0x21fd('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x21fd('0x7')](_0x21fd('0x8'),auth[_0x21fd('0x9')](),controller['describe']);router[_0x21fd('0x7')](_0x21fd('0xa'),auth[_0x21fd('0x9')](),controller[_0x21fd('0xb')]);router[_0x21fd('0xc')]('/',auth[_0x21fd('0x9')](),controller[_0x21fd('0xd')]);router['put'](_0x21fd('0xa'),auth[_0x21fd('0x9')](),controller[_0x21fd('0xe')]);router['delete'](_0x21fd('0xa'),auth[_0x21fd('0x9')](),controller[_0x21fd('0xf')]);module[_0x21fd('0x10')]=router;
\ No newline at end of file
index 1571f30..8e6acd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e9f=['INTEGER','STRING','crudPermissions','join','split','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0e9f,0x116));var _0xf0e9=function(_0x47e28c,_0x5a76eb){_0x47e28c=_0x47e28c-0x0;var _0x3cda5d=_0x0e9f[_0x47e28c];return _0x3cda5d;};'use strict';var Sequelize=require(_0xf0e9('0x0'));module[_0xf0e9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xf0e9('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xf0e9('0x3')],'set':function(_0x559cad){this['setDataValue'](_0xf0e9('0x4'),_0x559cad?_0x559cad[_0xf0e9('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xf0e9('0x4'))?this['getDataValue'](_0xf0e9('0x4'))[_0xf0e9('0x6')](''):[];}}};
\ No newline at end of file
+var _0xa4de=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize'];(function(_0x29276c,_0x19512a){var _0x190a06=function(_0x55ea07){while(--_0x55ea07){_0x29276c['push'](_0x29276c['shift']());}};_0x190a06(++_0x19512a);}(_0xa4de,0x10d));var _0xea4d=function(_0x526168,_0x414b29){_0x526168=_0x526168-0x0;var _0x2b5b60=_0xa4de[_0x526168];return _0x2b5b60;};'use strict';var Sequelize=require(_0xea4d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xea4d('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xea4d('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xea4d('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xea4d('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xea4d('0x1')],'set':function(_0x111a9e){this[_0xea4d('0x4')](_0xea4d('0x5'),_0x111a9e?_0x111a9e[_0xea4d('0x6')](''):[]);},'get':function(){return this[_0xea4d('0x7')](_0xea4d('0x5'))?this[_0xea4d('0x7')]('crudPermissions')[_0xea4d('0x8')](''):[];}}};
\ No newline at end of file
index 17386d0..b512973 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed8c=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','merge','where','filter','UserProfileSection','includeAll','findAll','rows','show','params','length','include','options','find','create','catch','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','count','offset','set','json','reject','save','update','then','destroy','status','stack','name','send','map','rawAttributes','fieldName','type','query','keys'];(function(_0xe56fcb,_0x42f237){var _0x6037c7=function(_0x489ccf){while(--_0x489ccf){_0xe56fcb['push'](_0xe56fcb['shift']());}};_0x6037c7(++_0x42f237);}(_0xed8c,0x64));var _0xced8=function(_0x32d36b,_0x2a5044){_0x32d36b=_0x32d36b-0x0;var _0x261c3c=_0xed8c[_0x32d36b];return _0x261c3c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xced8('0x0'));var rimraf=require(_0xced8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xced8('0x2'));var rp=require(_0xced8('0x3'));var moment=require(_0xced8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xced8('0x5'));var util=require(_0xced8('0x6'));var path=require(_0xced8('0x7'));var sox=require(_0xced8('0x8'));var csv=require(_0xced8('0x9'));var ejs=require(_0xced8('0xa'));var fs=require('fs');var _=require(_0xced8('0xb'));var squel=require(_0xced8('0xc'));var crypto=require(_0xced8('0xd'));var jsforce=require(_0xced8('0xe'));var deskjs=require(_0xced8('0xf'));var toCsv=require(_0xced8('0x9'));var querystring=require('querystring');var Papa=require(_0xced8('0x10'));var Redis=require(_0xced8('0x11'));var authService=require(_0xced8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xced8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xced8('0x14'))(_0xced8('0x15'));var utils=require(_0xced8('0x16'));var config=require(_0xced8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a8756,_0x249f6b){_0x249f6b=_0x249f6b||0xcc;return function(_0x235e7d){if(_0x235e7d){return _0x3a8756[_0xced8('0x18')](_0x249f6b);}return _0x3a8756['status'](_0x249f6b)['end']();};}function respondWithResult(_0x474426,_0x4dc722){_0x4dc722=_0x4dc722||0xc8;return function(_0x3e1f5e){if(_0x3e1f5e){return _0x474426['status'](_0x4dc722)['json'](_0x3e1f5e);}};}function respondWithFilteredResult(_0x2397b5,_0x32b2b8){return function(_0x13a15d){if(_0x13a15d){var _0x454728=_0x13a15d[_0xced8('0x19')],_0x525381=_0x32b2b8[_0xced8('0x1a')],_0x1de61b=_0x32b2b8[_0xced8('0x1a')]+_0x32b2b8['limit'],_0x2abb98;if(_0x1de61b>=_0x454728){_0x1de61b=_0x454728;_0x2abb98=0xc8;}else{_0x2abb98=0xce;}_0x2397b5['status'](_0x2abb98);return _0x2397b5[_0xced8('0x1b')]('Content-Range',_0x525381+'-'+_0x1de61b+'/'+_0x454728)[_0xced8('0x1c')](_0x13a15d);}return null;};}function patchUpdates(_0xea88b1){return function(_0xb4e62a){try{jsonpatch['apply'](_0xb4e62a,_0xea88b1,!![]);}catch(_0x4c67fc){return BPromise[_0xced8('0x1d')](_0x4c67fc);}return _0xb4e62a[_0xced8('0x1e')]();};}function saveUpdates(_0x192715,_0xcd03ab){return function(_0x5ab2d4){if(_0x5ab2d4){return _0x5ab2d4[_0xced8('0x1f')](_0x192715)[_0xced8('0x20')](function(_0x73a08){return _0x73a08;});}return null;};}function removeEntity(_0x555856,_0x289777){return function(_0x44a94e){if(_0x44a94e){return _0x44a94e[_0xced8('0x21')]()[_0xced8('0x20')](function(){_0x555856[_0xced8('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdb7743,_0x5d0794){return function(_0x26ce56){if(!_0x26ce56){_0xdb7743[_0xced8('0x18')](0x194);}return _0x26ce56;};}function handleError(_0x3baca5,_0x111381){_0x111381=_0x111381||0x1f4;return function(_0x338cf2){logger['error'](_0x338cf2[_0xced8('0x23')]);if(_0x338cf2[_0xced8('0x24')]){delete _0x338cf2[_0xced8('0x24')];}_0x3baca5['status'](_0x111381)[_0xced8('0x25')](_0x338cf2);};}exports['index']=function(_0x223d04,_0xdb6325){var _0x569ccf={},_0x4db3b6={},_0x48eef3={'count':0x0,'rows':[]};var _0x578a66=_[_0xced8('0x26')](db['UserProfileSection'][_0xced8('0x27')],function(_0x3918dc){return{'name':_0x3918dc[_0xced8('0x28')],'type':_0x3918dc[_0xced8('0x29')]['key']};});_0x4db3b6['model']=_[_0xced8('0x26')](_0x578a66,_0xced8('0x24'));_0x4db3b6[_0xced8('0x2a')]=_[_0xced8('0x2b')](_0x223d04[_0xced8('0x2a')]);_0x4db3b6[_0xced8('0x2c')]=_[_0xced8('0x2d')](_0x4db3b6[_0xced8('0x2e')],_0x4db3b6[_0xced8('0x2a')]);_0x569ccf[_0xced8('0x2f')]=_['intersection'](_0x4db3b6[_0xced8('0x2e')],qs[_0xced8('0x30')](_0x223d04[_0xced8('0x2a')]['fields']));_0x569ccf[_0xced8('0x2f')]=_0x569ccf[_0xced8('0x2f')]['length']?_0x569ccf[_0xced8('0x2f')]:_0x4db3b6[_0xced8('0x2e')];if(!_0x223d04[_0xced8('0x2a')][_0xced8('0x31')](_0xced8('0x32'))){_0x569ccf[_0xced8('0x33')]=qs[_0xced8('0x33')](_0x223d04[_0xced8('0x2a')]['limit']);_0x569ccf['offset']=qs[_0xced8('0x1a')](_0x223d04[_0xced8('0x2a')]['offset']);}_0x569ccf[_0xced8('0x34')]=qs[_0xced8('0x35')](_0x223d04['query'][_0xced8('0x35')]);_0x569ccf['where']=qs[_0xced8('0x2c')](_[_0xced8('0x36')](_0x223d04[_0xced8('0x2a')],_0x4db3b6['filters']),_0x578a66);if(_0x223d04[_0xced8('0x2a')]['filter']){_0x569ccf['where']=_[_0xced8('0x37')](_0x569ccf[_0xced8('0x38')],{'$or':_[_0xced8('0x26')](_0x578a66,function(_0xb8c945){if(_0xb8c945[_0xced8('0x29')]!=='VIRTUAL'){var _0x37583a={};_0x37583a[_0xb8c945['name']]={'$like':'%'+_0x223d04[_0xced8('0x2a')][_0xced8('0x39')]+'%'};return _0x37583a;}})});}_0x569ccf=_[_0xced8('0x37')]({},_0x569ccf,_0x223d04['options']);var _0x3e26ad={'where':_0x569ccf[_0xced8('0x38')]};return db[_0xced8('0x3a')][_0xced8('0x19')](_0x3e26ad)['then'](function(_0x4dedbd){_0x48eef3[_0xced8('0x19')]=_0x4dedbd;if(_0x223d04[_0xced8('0x2a')][_0xced8('0x3b')]){_0x569ccf['include']=[{'all':!![]}];}return db[_0xced8('0x3a')][_0xced8('0x3c')](_0x569ccf);})[_0xced8('0x20')](function(_0xb3502c){_0x48eef3[_0xced8('0x3d')]=_0xb3502c;return _0x48eef3;})[_0xced8('0x20')](respondWithFilteredResult(_0xdb6325,_0x569ccf))['catch'](handleError(_0xdb6325,null));};exports[_0xced8('0x3e')]=function(_0x3dbd5d,_0x5ea098){var _0x4dd1c2={'raw':![],'where':{'id':_0x3dbd5d[_0xced8('0x3f')]['id']}},_0x45657b={};_0x45657b[_0xced8('0x2e')]=_['keys'](db['UserProfileSection']['rawAttributes']);_0x45657b[_0xced8('0x2a')]=_[_0xced8('0x2b')](_0x3dbd5d[_0xced8('0x2a')]);_0x45657b[_0xced8('0x2c')]=_['intersection'](_0x45657b[_0xced8('0x2e')],_0x45657b[_0xced8('0x2a')]);_0x4dd1c2[_0xced8('0x2f')]=_['intersection'](_0x45657b[_0xced8('0x2e')],qs[_0xced8('0x30')](_0x3dbd5d[_0xced8('0x2a')][_0xced8('0x30')]));_0x4dd1c2[_0xced8('0x2f')]=_0x4dd1c2[_0xced8('0x2f')][_0xced8('0x40')]?_0x4dd1c2[_0xced8('0x2f')]:_0x45657b['model'];if(_0x3dbd5d['query'][_0xced8('0x3b')]){_0x4dd1c2[_0xced8('0x41')]=[{'all':!![]}];}_0x4dd1c2=_['merge']({},_0x4dd1c2,_0x3dbd5d[_0xced8('0x42')]);return db['UserProfileSection'][_0xced8('0x43')](_0x4dd1c2)[_0xced8('0x20')](handleEntityNotFound(_0x5ea098,null))[_0xced8('0x20')](respondWithResult(_0x5ea098,null))['catch'](handleError(_0x5ea098,null));};exports['create']=function(_0x31e3e0,_0x25bea5){return db[_0xced8('0x3a')][_0xced8('0x44')](_0x31e3e0['body'],{})['then'](respondWithResult(_0x25bea5,0xc9))[_0xced8('0x45')](handleError(_0x25bea5,null));};exports[_0xced8('0x1f')]=function(_0x58a820,_0x40a82d){if(_0x58a820[_0xced8('0x46')]['id']){delete _0x58a820['body']['id'];}return db['UserProfileSection'][_0xced8('0x43')]({'where':{'id':_0x58a820[_0xced8('0x3f')]['id']}})[_0xced8('0x20')](handleEntityNotFound(_0x40a82d,null))[_0xced8('0x20')](saveUpdates(_0x58a820[_0xced8('0x46')],null))['then'](respondWithResult(_0x40a82d,null))['catch'](handleError(_0x40a82d,null));};exports[_0xced8('0x21')]=function(_0x220c22,_0x340bbb){return db['UserProfileSection'][_0xced8('0x43')]({'where':{'id':_0x220c22[_0xced8('0x3f')]['id']}})[_0xced8('0x20')](handleEntityNotFound(_0x340bbb,null))[_0xced8('0x20')](removeEntity(_0x340bbb,null))['catch'](handleError(_0x340bbb,null));};exports[_0xced8('0x47')]=function(_0x281a3a,_0x10ca5e){return db['UserProfileSection']['describe']()[_0xced8('0x20')](respondWithResult(_0x10ca5e,null))[_0xced8('0x45')](handleError(_0x10ca5e,null));};
\ No newline at end of file
+var _0xf1c9=['VIRTUAL','options','count','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','apply','reject','save','update','then','destroy','stack','name','send','map','UserProfileSection','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0xf1c9,0xa0));var _0x9f1c=function(_0x50c0ea,_0x2210e6){_0x50c0ea=_0x50c0ea-0x0;var _0x1e1168=_0xf1c9[_0x50c0ea];return _0x1e1168;};'use strict';var pdf=require(_0x9f1c('0x0'));var emlformat=require(_0x9f1c('0x1'));var rimraf=require(_0x9f1c('0x2'));var zipdir=require(_0x9f1c('0x3'));var jsonpatch=require(_0x9f1c('0x4'));var rp=require(_0x9f1c('0x5'));var moment=require(_0x9f1c('0x6'));var BPromise=require(_0x9f1c('0x7'));var Mustache=require(_0x9f1c('0x8'));var util=require(_0x9f1c('0x9'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9f1c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9f1c('0xb'));var crypto=require(_0x9f1c('0xc'));var jsforce=require(_0x9f1c('0xd'));var deskjs=require(_0x9f1c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9f1c('0xf'));var authService=require(_0x9f1c('0x10'));var qs=require(_0x9f1c('0x11'));var as=require(_0x9f1c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f1c('0x13'))(_0x9f1c('0x14'));var utils=require(_0x9f1c('0x15'));var config=require(_0x9f1c('0x16'));var db=require(_0x9f1c('0x17'))['db'];function respondWithStatusCode(_0xc9e7da,_0x11cd89){_0x11cd89=_0x11cd89||0xcc;return function(_0x158f79){if(_0x158f79){return _0xc9e7da[_0x9f1c('0x18')](_0x11cd89);}return _0xc9e7da[_0x9f1c('0x19')](_0x11cd89)[_0x9f1c('0x1a')]();};}function respondWithResult(_0x5dedd2,_0x5b203b){_0x5b203b=_0x5b203b||0xc8;return function(_0x11c04d){if(_0x11c04d){return _0x5dedd2[_0x9f1c('0x19')](_0x5b203b)[_0x9f1c('0x1b')](_0x11c04d);}};}function respondWithFilteredResult(_0x2b4cf9,_0x5a467c){return function(_0x429b4e){if(_0x429b4e){var _0x57cd97=_0x429b4e['count'],_0x5b47a4=_0x5a467c[_0x9f1c('0x1c')],_0xdd816e=_0x5a467c[_0x9f1c('0x1c')]+_0x5a467c['limit'],_0x2f5f7a;if(_0xdd816e>=_0x57cd97){_0xdd816e=_0x57cd97;_0x2f5f7a=0xc8;}else{_0x2f5f7a=0xce;}_0x2b4cf9['status'](_0x2f5f7a);return _0x2b4cf9[_0x9f1c('0x1d')]('Content-Range',_0x5b47a4+'-'+_0xdd816e+'/'+_0x57cd97)[_0x9f1c('0x1b')](_0x429b4e);}return null;};}function patchUpdates(_0x43060c){return function(_0x4b6e6e){try{jsonpatch[_0x9f1c('0x1e')](_0x4b6e6e,_0x43060c,!![]);}catch(_0x1c07f2){return BPromise[_0x9f1c('0x1f')](_0x1c07f2);}return _0x4b6e6e[_0x9f1c('0x20')]();};}function saveUpdates(_0x3288f7,_0x5037d5){return function(_0x43bd97){if(_0x43bd97){return _0x43bd97[_0x9f1c('0x21')](_0x3288f7)[_0x9f1c('0x22')](function(_0x10eb8f){return _0x10eb8f;});}return null;};}function removeEntity(_0x4d6eb1,_0x553d01){return function(_0x18c474){if(_0x18c474){return _0x18c474[_0x9f1c('0x23')]()[_0x9f1c('0x22')](function(){_0x4d6eb1[_0x9f1c('0x19')](0xcc)[_0x9f1c('0x1a')]();});}};}function handleEntityNotFound(_0x15c584,_0x464f3d){return function(_0x486771){if(!_0x486771){_0x15c584[_0x9f1c('0x18')](0x194);}return _0x486771;};}function handleError(_0x3423c1,_0x26943a){_0x26943a=_0x26943a||0x1f4;return function(_0x5a63ef){logger['error'](_0x5a63ef[_0x9f1c('0x24')]);if(_0x5a63ef[_0x9f1c('0x25')]){delete _0x5a63ef['name'];}_0x3423c1[_0x9f1c('0x19')](_0x26943a)[_0x9f1c('0x26')](_0x5a63ef);};}exports['index']=function(_0x358543,_0x5c411c){var _0x335df5={},_0x59fec5={},_0x686f10={'count':0x0,'rows':[]};var _0x26c3c3=_[_0x9f1c('0x27')](db[_0x9f1c('0x28')]['rawAttributes'],function(_0x4d5d89){return{'name':_0x4d5d89[_0x9f1c('0x29')],'type':_0x4d5d89[_0x9f1c('0x2a')][_0x9f1c('0x2b')]};});_0x59fec5[_0x9f1c('0x2c')]=_[_0x9f1c('0x27')](_0x26c3c3,'name');_0x59fec5[_0x9f1c('0x2d')]=_[_0x9f1c('0x2e')](_0x358543['query']);_0x59fec5[_0x9f1c('0x2f')]=_['intersection'](_0x59fec5[_0x9f1c('0x2c')],_0x59fec5[_0x9f1c('0x2d')]);_0x335df5['attributes']=_[_0x9f1c('0x30')](_0x59fec5[_0x9f1c('0x2c')],qs[_0x9f1c('0x31')](_0x358543[_0x9f1c('0x2d')]['fields']));_0x335df5[_0x9f1c('0x32')]=_0x335df5['attributes'][_0x9f1c('0x33')]?_0x335df5['attributes']:_0x59fec5['model'];if(!_0x358543[_0x9f1c('0x2d')][_0x9f1c('0x34')](_0x9f1c('0x35'))){_0x335df5[_0x9f1c('0x36')]=qs[_0x9f1c('0x36')](_0x358543[_0x9f1c('0x2d')][_0x9f1c('0x36')]);_0x335df5['offset']=qs[_0x9f1c('0x1c')](_0x358543['query']['offset']);}_0x335df5['order']=qs['sort'](_0x358543[_0x9f1c('0x2d')][_0x9f1c('0x37')]);_0x335df5[_0x9f1c('0x38')]=qs[_0x9f1c('0x2f')](_['pick'](_0x358543[_0x9f1c('0x2d')],_0x59fec5[_0x9f1c('0x2f')]),_0x26c3c3);if(_0x358543[_0x9f1c('0x2d')][_0x9f1c('0x39')]){_0x335df5[_0x9f1c('0x38')]=_[_0x9f1c('0x3a')](_0x335df5[_0x9f1c('0x38')],{'$or':_[_0x9f1c('0x27')](_0x26c3c3,function(_0x674a1f){if(_0x674a1f[_0x9f1c('0x2a')]!==_0x9f1c('0x3b')){var _0x88048a={};_0x88048a[_0x674a1f[_0x9f1c('0x25')]]={'$like':'%'+_0x358543[_0x9f1c('0x2d')][_0x9f1c('0x39')]+'%'};return _0x88048a;}})});}_0x335df5=_['merge']({},_0x335df5,_0x358543[_0x9f1c('0x3c')]);var _0x96c34e={'where':_0x335df5[_0x9f1c('0x38')]};return db[_0x9f1c('0x28')][_0x9f1c('0x3d')](_0x96c34e)[_0x9f1c('0x22')](function(_0x3593e3){_0x686f10[_0x9f1c('0x3d')]=_0x3593e3;if(_0x358543[_0x9f1c('0x2d')][_0x9f1c('0x3e')]){_0x335df5[_0x9f1c('0x3f')]=[{'all':!![]}];}return db['UserProfileSection'][_0x9f1c('0x40')](_0x335df5);})['then'](function(_0x477699){_0x686f10[_0x9f1c('0x41')]=_0x477699;return _0x686f10;})['then'](respondWithFilteredResult(_0x5c411c,_0x335df5))[_0x9f1c('0x42')](handleError(_0x5c411c,null));};exports['show']=function(_0x27a504,_0x5f0334){var _0x2be2fc={'raw':![],'where':{'id':_0x27a504['params']['id']}},_0x54b94f={};_0x54b94f[_0x9f1c('0x2c')]=_[_0x9f1c('0x2e')](db[_0x9f1c('0x28')][_0x9f1c('0x43')]);_0x54b94f['query']=_['keys'](_0x27a504[_0x9f1c('0x2d')]);_0x54b94f[_0x9f1c('0x2f')]=_[_0x9f1c('0x30')](_0x54b94f[_0x9f1c('0x2c')],_0x54b94f[_0x9f1c('0x2d')]);_0x2be2fc['attributes']=_[_0x9f1c('0x30')](_0x54b94f['model'],qs['fields'](_0x27a504[_0x9f1c('0x2d')][_0x9f1c('0x31')]));_0x2be2fc[_0x9f1c('0x32')]=_0x2be2fc[_0x9f1c('0x32')][_0x9f1c('0x33')]?_0x2be2fc[_0x9f1c('0x32')]:_0x54b94f[_0x9f1c('0x2c')];if(_0x27a504[_0x9f1c('0x2d')][_0x9f1c('0x3e')]){_0x2be2fc['include']=[{'all':!![]}];}_0x2be2fc=_[_0x9f1c('0x3a')]({},_0x2be2fc,_0x27a504[_0x9f1c('0x3c')]);return db[_0x9f1c('0x28')][_0x9f1c('0x44')](_0x2be2fc)['then'](handleEntityNotFound(_0x5f0334,null))['then'](respondWithResult(_0x5f0334,null))[_0x9f1c('0x42')](handleError(_0x5f0334,null));};exports['create']=function(_0x454e14,_0x1b0597){return db['UserProfileSection'][_0x9f1c('0x45')](_0x454e14[_0x9f1c('0x46')],{})[_0x9f1c('0x22')](respondWithResult(_0x1b0597,0xc9))[_0x9f1c('0x42')](handleError(_0x1b0597,null));};exports[_0x9f1c('0x21')]=function(_0x507cea,_0x2249d3){if(_0x507cea[_0x9f1c('0x46')]['id']){delete _0x507cea[_0x9f1c('0x46')]['id'];}return db['UserProfileSection'][_0x9f1c('0x44')]({'where':{'id':_0x507cea[_0x9f1c('0x47')]['id']}})[_0x9f1c('0x22')](handleEntityNotFound(_0x2249d3,null))[_0x9f1c('0x22')](saveUpdates(_0x507cea[_0x9f1c('0x46')],null))[_0x9f1c('0x22')](respondWithResult(_0x2249d3,null))[_0x9f1c('0x42')](handleError(_0x2249d3,null));};exports[_0x9f1c('0x23')]=function(_0x108741,_0x44138a){return db[_0x9f1c('0x28')][_0x9f1c('0x44')]({'where':{'id':_0x108741[_0x9f1c('0x47')]['id']}})[_0x9f1c('0x22')](handleEntityNotFound(_0x44138a,null))['then'](removeEntity(_0x44138a,null))[_0x9f1c('0x42')](handleError(_0x44138a,null));};exports[_0x9f1c('0x48')]=function(_0x462778,_0x1a151c){return db[_0x9f1c('0x28')]['describe']()[_0x9f1c('0x22')](respondWithResult(_0x1a151c,null))[_0x9f1c('0x42')](handleError(_0x1a151c,null));};
\ No newline at end of file
index 9028180..41d8e05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bc4=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7bc4,0x1ed));var _0x47bc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7bc4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x47bc('0x0'));var util=require(_0x47bc('0x1'));var logger=require(_0x47bc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x47bc('0x3'));var rp=require(_0x47bc('0x4'));var fs=require('fs');var path=require(_0x47bc('0x5'));var rimraf=require(_0x47bc('0x6'));var config=require(_0x47bc('0x7'));var attributes=require(_0x47bc('0x8'));module[_0x47bc('0x9')]=function(_0x4c7657,_0x1a5c5f){return _0x4c7657[_0x47bc('0xa')](_0x47bc('0xb'),attributes,{'tableName':_0x47bc('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x47bc('0xd'),_0x47bc('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9fe3=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9fe3,0x1a5));var _0x39fe=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9fe3[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require(_0x39fe('0x0'));var logger=require(_0x39fe('0x1'))(_0x39fe('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x39fe('0x3'));var rimraf=require(_0x39fe('0x4'));var config=require(_0x39fe('0x5'));var attributes=require('./userProfileSection.attributes');module[_0x39fe('0x6')]=function(_0x21a5af,_0x39cd8f){return _0x21a5af[_0x39fe('0x7')](_0x39fe('0x8'),attributes,{'tableName':_0x39fe('0x9'),'paranoid':![],'indexes':[{'name':_0x39fe('0xa'),'fields':[_0x39fe('0xb'),_0x39fe('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index befc620..0db8465 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb71c=['code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error'];(function(_0x406dfd,_0x3b48cb){var _0x5a9101=function(_0x11cd9e){while(--_0x11cd9e){_0x406dfd['push'](_0x406dfd['shift']());}};_0x5a9101(++_0x3b48cb);}(_0xb71c,0x174));var _0xcb71=function(_0x2d3d24,_0x460bbe){_0x2d3d24=_0x2d3d24-0x0;var _0x848554=_0xb71c[_0x2d3d24];return _0x848554;};'use strict';var _=require(_0xcb71('0x0'));var util=require(_0xcb71('0x1'));var moment=require(_0xcb71('0x2'));var BPromise=require(_0xcb71('0x3'));var rs=require(_0xcb71('0x4'));var fs=require('fs');var Redis=require(_0xcb71('0x5'));var db=require(_0xcb71('0x6'))['db'];var utils=require(_0xcb71('0x7'));var logger=require(_0xcb71('0x8'))(_0xcb71('0x9'));var config=require('../../config/environment');var jayson=require(_0xcb71('0xa'));var client=jayson[_0xcb71('0xb')][_0xcb71('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23cceb,_0x21803e,_0x4e5886){return new BPromise(function(_0x29b258,_0x316dbc){return client['request'](_0x23cceb,_0x4e5886)[_0xcb71('0xd')](function(_0x50dc4c){logger['info'](_0xcb71('0xe'),_0x21803e,_0xcb71('0xf'));logger[_0xcb71('0x10')](_0xcb71('0x11'),_0x21803e,'request\x20sent',JSON['stringify'](_0x50dc4c));if(_0x50dc4c[_0xcb71('0x12')]){if(_0x50dc4c[_0xcb71('0x12')][_0xcb71('0x13')]===0x1f4){logger[_0xcb71('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x21803e,_0x50dc4c['error']['message']);return _0x316dbc(_0x50dc4c[_0xcb71('0x12')][_0xcb71('0x14')]);}logger[_0xcb71('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x21803e,_0x50dc4c[_0xcb71('0x12')][_0xcb71('0x14')]);return _0x29b258(_0x50dc4c['error'][_0xcb71('0x14')]);}else{logger[_0xcb71('0x15')](_0xcb71('0xe'),_0x21803e,_0xcb71('0xf'));_0x29b258(_0x50dc4c[_0xcb71('0x16')][_0xcb71('0x14')]);}})['catch'](function(_0x42208c){logger[_0xcb71('0x12')](_0xcb71('0xe'),_0x21803e,_0x42208c);_0x316dbc(_0x42208c);});});}
\ No newline at end of file
+var _0x590e=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x334f31,_0x11fa0a){var _0x18222f=function(_0x53cfc7){while(--_0x53cfc7){_0x334f31['push'](_0x334f31['shift']());}};_0x18222f(++_0x11fa0a);}(_0x590e,0x17c));var _0xe590=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x590e[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe590('0x0'));var util=require(_0xe590('0x1'));var moment=require(_0xe590('0x2'));var BPromise=require(_0xe590('0x3'));var rs=require(_0xe590('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe590('0x5'))['db'];var utils=require(_0xe590('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe590('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe590('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fc81f,_0x3e2adb,_0x15779a){return new BPromise(function(_0x52df73,_0x5807b6){return client['request'](_0x3fc81f,_0x15779a)['then'](function(_0x5680de){logger[_0xe590('0x9')](_0xe590('0xa'),_0x3e2adb,_0xe590('0xb'));logger[_0xe590('0xc')](_0xe590('0xd'),_0x3e2adb,_0xe590('0xb'),JSON[_0xe590('0xe')](_0x5680de));if(_0x5680de[_0xe590('0xf')]){if(_0x5680de[_0xe590('0xf')][_0xe590('0x10')]===0x1f4){logger['error'](_0xe590('0xa'),_0x3e2adb,_0x5680de['error'][_0xe590('0x11')]);return _0x5807b6(_0x5680de['error'][_0xe590('0x11')]);}logger[_0xe590('0xf')](_0xe590('0xa'),_0x3e2adb,_0x5680de[_0xe590('0xf')][_0xe590('0x11')]);return _0x52df73(_0x5680de['error'][_0xe590('0x11')]);}else{logger[_0xe590('0x9')]('UserProfileSection,\x20%s,\x20%s',_0x3e2adb,_0xe590('0xb'));_0x52df73(_0x5680de[_0xe590('0x12')][_0xe590('0x11')]);}})[_0xe590('0x13')](function(_0x315e47){logger[_0xe590('0xf')](_0xe590('0xa'),_0x3e2adb,_0x315e47);_0x5807b6(_0x315e47);});});}
\ No newline at end of file
index a57c976..5e78763 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32dd=['Router','../../components/auth/service','../../config/environment','multer','util','path','connect-timeout','express'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x32dd,0xbb));var _0xd32d=function(_0x40e00e,_0xe3ddfa){_0x40e00e=_0x40e00e-0x0;var _0x1050de=_0x32dd[_0x40e00e];return _0x1050de;};'use strict';var multer=require(_0xd32d('0x0'));var util=require(_0xd32d('0x1'));var path=require(_0xd32d('0x2'));var timeout=require(_0xd32d('0x3'));var express=require(_0xd32d('0x4'));var router=express[_0xd32d('0x5')]();var auth=require(_0xd32d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd32d('0x7'));module['exports']=router;
\ No newline at end of file
+var _0x12ba=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x4a957e,_0x4391eb){var _0x24da15=function(_0x2c837f){while(--_0x2c837f){_0x4a957e['push'](_0x4a957e['shift']());}};_0x24da15(++_0x4391eb);}(_0x12ba,0xbf));var _0xa12b=function(_0x1316e6,_0x3b02de){_0x1316e6=_0x1316e6-0x0;var _0x53c041=_0x12ba[_0x1316e6];return _0x53c041;};'use strict';var multer=require(_0xa12b('0x0'));var util=require(_0xa12b('0x1'));var path=require(_0xa12b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa12b('0x3')]();var auth=require(_0xa12b('0x4'));var interaction=require(_0xa12b('0x5'));var config=require(_0xa12b('0x6'));module[_0xa12b('0x7')]=router;
\ No newline at end of file
index c92d938..73a237b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['exports','INTEGER'];(function(_0x5e89d8,_0x30a21a){var _0x5c1153=function(_0x2dcba0){while(--_0x2dcba0){_0x5e89d8['push'](_0x5e89d8['shift']());}};_0x5c1153(++_0x30a21a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x1389ae,_0x1caf91){var _0x1514d4=function(_0x41bb97){while(--_0x41bb97){_0x1389ae['push'](_0x1389ae['shift']());}};_0x1514d4(++_0x1caf91);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index d3ff5db..cf71228 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x292b=['rimraf','../../config/environment','define','UserSmsQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3ee351,_0x1b40c0){var _0x44364a=function(_0x1af16c){while(--_0x1af16c){_0x3ee351['push'](_0x3ee351['shift']());}};_0x44364a(++_0x1b40c0);}(_0x292b,0x64));var _0xb292=function(_0x19ad7b,_0x2ae8fa){_0x19ad7b=_0x19ad7b-0x0;var _0x8a0f00=_0x292b[_0x19ad7b];return _0x8a0f00;};'use strict';var _=require(_0xb292('0x0'));var util=require(_0xb292('0x1'));var logger=require(_0xb292('0x2'))(_0xb292('0x3'));var moment=require(_0xb292('0x4'));var BPromise=require(_0xb292('0x5'));var rp=require(_0xb292('0x6'));var fs=require('fs');var path=require(_0xb292('0x7'));var rimraf=require(_0xb292('0x8'));var config=require(_0xb292('0x9'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x4d2ef0,_0x13ffef){return _0x4d2ef0[_0xb292('0xa')](_0xb292('0xb'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa1e8=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa1e8,0x1af));var _0x8a1e=function(_0x4552e7,_0x308c21){_0x4552e7=_0x4552e7-0x0;var _0x442e02=_0xa1e8[_0x4552e7];return _0x442e02;};'use strict';var _=require(_0x8a1e('0x0'));var util=require('util');var logger=require(_0x8a1e('0x1'))(_0x8a1e('0x2'));var moment=require(_0x8a1e('0x3'));var BPromise=require('bluebird');var rp=require(_0x8a1e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a1e('0x5'));var config=require(_0x8a1e('0x6'));var attributes=require(_0x8a1e('0x7'));module[_0x8a1e('0x8')]=function(_0x5730e0,_0x2ddb27){return _0x5730e0[_0x8a1e('0x9')](_0x8a1e('0xa'),attributes,{'tableName':_0x8a1e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f7c6a83..474192c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96fc=['UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x3f5100,_0x2b4fef){var _0x32dea2=function(_0x37e48b){while(--_0x37e48b){_0x3f5100['push'](_0x3f5100['shift']());}};_0x32dea2(++_0x2b4fef);}(_0x96fc,0x169));var _0xc96f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x96fc[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xc96f('0x0'));var util=require(_0xc96f('0x1'));var moment=require(_0xc96f('0x2'));var BPromise=require('bluebird');var rs=require(_0xc96f('0x3'));var fs=require('fs');var Redis=require(_0xc96f('0x4'));var db=require(_0xc96f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc96f('0x6'))('rpc');var config=require(_0xc96f('0x7'));var jayson=require(_0xc96f('0x8'));var client=jayson[_0xc96f('0x9')][_0xc96f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1baf5a,_0x2b7d88,_0x87fd4b){return new BPromise(function(_0x2495f3,_0x564bb4){return client[_0xc96f('0xb')](_0x1baf5a,_0x87fd4b)['then'](function(_0x30ef83){logger[_0xc96f('0xc')](_0xc96f('0xd'),_0x2b7d88,_0xc96f('0xe'));logger[_0xc96f('0xf')](_0xc96f('0x10'),_0x2b7d88,_0xc96f('0xe'),JSON[_0xc96f('0x11')](_0x30ef83));if(_0x30ef83[_0xc96f('0x12')]){if(_0x30ef83[_0xc96f('0x12')][_0xc96f('0x13')]===0x1f4){logger[_0xc96f('0x12')](_0xc96f('0xd'),_0x2b7d88,_0x30ef83[_0xc96f('0x12')][_0xc96f('0x14')]);return _0x564bb4(_0x30ef83['error']['message']);}logger['error'](_0xc96f('0xd'),_0x2b7d88,_0x30ef83[_0xc96f('0x12')][_0xc96f('0x14')]);return _0x2495f3(_0x30ef83['error']['message']);}else{logger[_0xc96f('0xc')](_0xc96f('0xd'),_0x2b7d88,'request\x20sent');_0x2495f3(_0x30ef83['result']['message']);}})[_0xc96f('0x15')](function(_0x1cc28e){logger[_0xc96f('0x12')](_0xc96f('0xd'),_0x2b7d88,_0x1cc28e);_0x564bb4(_0x1cc28e);});});}
\ No newline at end of file
+var _0x9fdf=['util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x9fdf,0xdb));var _0xf9fd=function(_0x2b0063,_0x570d40){_0x2b0063=_0x2b0063-0x0;var _0x3eea72=_0x9fdf[_0x2b0063];return _0x3eea72;};'use strict';var _=require(_0xf9fd('0x0'));var util=require(_0xf9fd('0x1'));var moment=require('moment');var BPromise=require(_0xf9fd('0x2'));var rs=require(_0xf9fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf9fd('0x4'));var logger=require(_0xf9fd('0x5'))(_0xf9fd('0x6'));var config=require(_0xf9fd('0x7'));var jayson=require(_0xf9fd('0x8'));var client=jayson[_0xf9fd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41704c,_0x2e7062,_0x41d4fd){return new BPromise(function(_0x49d221,_0x1aa1f0){return client['request'](_0x41704c,_0x41d4fd)[_0xf9fd('0xa')](function(_0x10164f){logger['info'](_0xf9fd('0xb'),_0x2e7062,_0xf9fd('0xc'));logger[_0xf9fd('0xd')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x2e7062,_0xf9fd('0xc'),JSON[_0xf9fd('0xe')](_0x10164f));if(_0x10164f[_0xf9fd('0xf')]){if(_0x10164f['error'][_0xf9fd('0x10')]===0x1f4){logger[_0xf9fd('0xf')](_0xf9fd('0xb'),_0x2e7062,_0x10164f[_0xf9fd('0xf')][_0xf9fd('0x11')]);return _0x1aa1f0(_0x10164f['error'][_0xf9fd('0x11')]);}logger[_0xf9fd('0xf')](_0xf9fd('0xb'),_0x2e7062,_0x10164f['error'][_0xf9fd('0x11')]);return _0x49d221(_0x10164f['error'][_0xf9fd('0x11')]);}else{logger['info'](_0xf9fd('0xb'),_0x2e7062,_0xf9fd('0xc'));_0x49d221(_0x10164f[_0xf9fd('0x12')][_0xf9fd('0x11')]);}})[_0xf9fd('0x13')](function(_0x2576fb){logger[_0xf9fd('0xf')](_0xf9fd('0xb'),_0x2e7062,_0x2576fb);_0x1aa1f0(_0x2576fb);});});}
\ No newline at end of file
index 58aa074..76c0e22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf83=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x28510d,_0x1bdffe){var _0x4d9d2=function(_0x53b08b){while(--_0x53b08b){_0x28510d['push'](_0x28510d['shift']());}};_0x4d9d2(++_0x1bdffe);}(_0xdf83,0xe8));var _0x3df8=function(_0x2c3a47,_0x170687){_0x2c3a47=_0x2c3a47-0x0;var _0x1c04de=_0xdf83[_0x2c3a47];return _0x1c04de;};'use strict';var multer=require(_0x3df8('0x0'));var util=require('util');var path=require(_0x3df8('0x1'));var timeout=require(_0x3df8('0x2'));var express=require(_0x3df8('0x3'));var router=express['Router']();var auth=require(_0x3df8('0x4'));var interaction=require(_0x3df8('0x5'));var config=require('../../config/environment');module[_0x3df8('0x6')]=router;
\ No newline at end of file
+var _0x3d99=['exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x3b7a6e,_0x202afe){var _0x1412d2=function(_0x227435){while(--_0x227435){_0x3b7a6e['push'](_0x3b7a6e['shift']());}};_0x1412d2(++_0x202afe);}(_0x3d99,0xa1));var _0x93d9=function(_0x2589c0,_0x1ba4c4){_0x2589c0=_0x2589c0-0x0;var _0x46f640=_0x3d99[_0x2589c0];return _0x46f640;};'use strict';var multer=require(_0x93d9('0x0'));var util=require('util');var path=require(_0x93d9('0x1'));var timeout=require(_0x93d9('0x2'));var express=require(_0x93d9('0x3'));var router=express[_0x93d9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x93d9('0x5'));var config=require(_0x93d9('0x6'));module[_0x93d9('0x7')]=router;
\ No newline at end of file
index d516590..2c627cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['INTEGER','sequelize','exports'];(function(_0x387b84,_0x17c17b){var _0x572db8=function(_0x190d8c){while(--_0x190d8c){_0x387b84['push'](_0x387b84['shift']());}};_0x572db8(++_0x17c17b);}(_0xe706,0xa3));var _0x6e70=function(_0x2e5a17,_0x558f0e){_0x2e5a17=_0x2e5a17-0x0;var _0x24f53d=_0xe706[_0x2e5a17];return _0x24f53d;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbaf0=['exports','INTEGER'];(function(_0x56ea6f,_0x15535a){var _0x43ac31=function(_0x1b6d99){while(--_0x1b6d99){_0x56ea6f['push'](_0x56ea6f['shift']());}};_0x43ac31(++_0x15535a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index a9a600a..cd3b1b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad42=['define','user_has_voice_queues','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xad42,0xb6));var _0x2ad4=function(_0x3b075f,_0x58cb87){_0x3b075f=_0x3b075f-0x0;var _0x9cbb40=_0xad42[_0x3b075f];return _0x9cbb40;};'use strict';var _=require(_0x2ad4('0x0'));var util=require(_0x2ad4('0x1'));var logger=require(_0x2ad4('0x2'))('api');var moment=require(_0x2ad4('0x3'));var BPromise=require('bluebird');var rp=require(_0x2ad4('0x4'));var fs=require('fs');var path=require(_0x2ad4('0x5'));var rimraf=require(_0x2ad4('0x6'));var config=require(_0x2ad4('0x7'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x4ba45e,_0x4a1e3b){return _0x4ba45e[_0x2ad4('0x8')]('UserVoiceQueue',attributes,{'tableName':_0x2ad4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ef9=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','lodash','util'];(function(_0x10305f,_0x1c287e){var _0x4edc66=function(_0x577dde){while(--_0x577dde){_0x10305f['push'](_0x10305f['shift']());}};_0x4edc66(++_0x1c287e);}(_0x4ef9,0x11c));var _0x94ef=function(_0xfd3d87,_0x10aa44){_0xfd3d87=_0xfd3d87-0x0;var _0x21fc4a=_0x4ef9[_0xfd3d87];return _0x21fc4a;};'use strict';var _=require(_0x94ef('0x0'));var util=require(_0x94ef('0x1'));var logger=require(_0x94ef('0x2'))(_0x94ef('0x3'));var moment=require('moment');var BPromise=require(_0x94ef('0x4'));var rp=require(_0x94ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94ef('0x6'));var config=require(_0x94ef('0x7'));var attributes=require(_0x94ef('0x8'));module['exports']=function(_0x26e63b,_0x5aaf0b){return _0x26e63b[_0x94ef('0x9')](_0x94ef('0xa'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 11ac1a6..fe03df2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9772=['http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x291f3e,_0x5e5ca1){var _0x21962c=function(_0x1f8c6a){while(--_0x1f8c6a){_0x291f3e['push'](_0x291f3e['shift']());}};_0x21962c(++_0x5e5ca1);}(_0x9772,0x175));var _0x2977=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x9772[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x2977('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2977('0x1'));var db=require(_0x2977('0x2'))['db'];var utils=require(_0x2977('0x3'));var logger=require(_0x2977('0x4'))(_0x2977('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2977('0x6')][_0x2977('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x436e96,_0x39c50f,_0x48e753){return new BPromise(function(_0x5a3018,_0x43d233){return client[_0x2977('0x8')](_0x436e96,_0x48e753)[_0x2977('0x9')](function(_0x47f0e1){logger[_0x2977('0xa')](_0x2977('0xb'),_0x39c50f,_0x2977('0xc'));logger[_0x2977('0xd')](_0x2977('0xe'),_0x39c50f,_0x2977('0xc'),JSON[_0x2977('0xf')](_0x47f0e1));if(_0x47f0e1[_0x2977('0x10')]){if(_0x47f0e1[_0x2977('0x10')][_0x2977('0x11')]===0x1f4){logger[_0x2977('0x10')](_0x2977('0xb'),_0x39c50f,_0x47f0e1[_0x2977('0x10')][_0x2977('0x12')]);return _0x43d233(_0x47f0e1[_0x2977('0x10')][_0x2977('0x12')]);}logger['error'](_0x2977('0xb'),_0x39c50f,_0x47f0e1[_0x2977('0x10')][_0x2977('0x12')]);return _0x5a3018(_0x47f0e1[_0x2977('0x10')][_0x2977('0x12')]);}else{logger[_0x2977('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x39c50f,'request\x20sent');_0x5a3018(_0x47f0e1['result'][_0x2977('0x12')]);}})[_0x2977('0x13')](function(_0x2b0d92){logger[_0x2977('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x39c50f,_0x2b0d92);_0x43d233(_0x2b0d92);});});}
\ No newline at end of file
+var _0x2b4b=['catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2b4b,0x131));var _0xb2b4=function(_0x41dd60,_0x550220){_0x41dd60=_0x41dd60-0x0;var _0x1622b8=_0x2b4b[_0x41dd60];return _0x1622b8;};'use strict';var _=require(_0xb2b4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb2b4('0x1'));var rs=require(_0xb2b4('0x2'));var fs=require('fs');var Redis=require(_0xb2b4('0x3'));var db=require(_0xb2b4('0x4'))['db'];var utils=require(_0xb2b4('0x5'));var logger=require('../../config/logger')(_0xb2b4('0x6'));var config=require(_0xb2b4('0x7'));var jayson=require(_0xb2b4('0x8'));var client=jayson['client'][_0xb2b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a402c,_0x2017dc,_0x3e4675){return new BPromise(function(_0x32fe8b,_0xea1e82){return client['request'](_0x3a402c,_0x3e4675)['then'](function(_0x3345a2){logger[_0xb2b4('0xa')](_0xb2b4('0xb'),_0x2017dc,_0xb2b4('0xc'));logger[_0xb2b4('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2017dc,_0xb2b4('0xc'),JSON[_0xb2b4('0xe')](_0x3345a2));if(_0x3345a2[_0xb2b4('0xf')]){if(_0x3345a2[_0xb2b4('0xf')][_0xb2b4('0x10')]===0x1f4){logger[_0xb2b4('0xf')](_0xb2b4('0xb'),_0x2017dc,_0x3345a2['error'][_0xb2b4('0x11')]);return _0xea1e82(_0x3345a2[_0xb2b4('0xf')][_0xb2b4('0x11')]);}logger[_0xb2b4('0xf')](_0xb2b4('0xb'),_0x2017dc,_0x3345a2[_0xb2b4('0xf')][_0xb2b4('0x11')]);return _0x32fe8b(_0x3345a2[_0xb2b4('0xf')][_0xb2b4('0x11')]);}else{logger[_0xb2b4('0xa')]('UserVoiceQueue,\x20%s,\x20%s',_0x2017dc,_0xb2b4('0xc'));_0x32fe8b(_0x3345a2['result']['message']);}})[_0xb2b4('0x12')](function(_0x421650){logger[_0xb2b4('0xf')](_0xb2b4('0xb'),_0x2017dc,_0x421650);_0xea1e82(_0x421650);});});}
\ No newline at end of file
index 92dc7ea..6da39b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad7b=['../../config/environment','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x46f748,_0x1209d5){var _0x3f82fd=function(_0xa24ad5){while(--_0xa24ad5){_0x46f748['push'](_0x46f748['shift']());}};_0x3f82fd(++_0x1209d5);}(_0xad7b,0xec));var _0xbad7=function(_0x731802,_0xc9d169){_0x731802=_0x731802-0x0;var _0x5cede5=_0xad7b[_0x731802];return _0x5cede5;};'use strict';var multer=require(_0xbad7('0x0'));var util=require(_0xbad7('0x1'));var path=require(_0xbad7('0x2'));var timeout=require(_0xbad7('0x3'));var express=require('express');var router=express[_0xbad7('0x4')]();var auth=require(_0xbad7('0x5'));var interaction=require(_0xbad7('0x6'));var config=require(_0xbad7('0x7'));module[_0xbad7('0x8')]=router;
\ No newline at end of file
+var _0xd05b=['../../config/environment','exports','multer','util','path','Router','../../components/interaction/service'];(function(_0x1806a4,_0xa32e1d){var _0x73f8b=function(_0x4ceaa2){while(--_0x4ceaa2){_0x1806a4['push'](_0x1806a4['shift']());}};_0x73f8b(++_0xa32e1d);}(_0xd05b,0xa3));var _0xbd05=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xd05b[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0xbd05('0x0'));var util=require(_0xbd05('0x1'));var path=require(_0xbd05('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbd05('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbd05('0x4'));var config=require(_0xbd05('0x5'));module[_0xbd05('0x6')]=router;
\ No newline at end of file
index 19f9520..a4a66db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09c4=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x17283a,_0x1a3f0a){var _0x4b64bc=function(_0x8513ca){while(--_0x8513ca){_0x17283a['push'](_0x17283a['shift']());}};_0x4b64bc(++_0x1a3f0a);}(_0x09c4,0xd3));var _0x409c=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x09c4[_0x145b3c];return _0x1b6e36;};'use strict';var Sequelize=require(_0x409c('0x0'));module[_0x409c('0x1')]={'uniqueid':{'type':Sequelize[_0x409c('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x409c('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x409c('0x3')},'UserId':{'type':Sequelize[_0x409c('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x409c('0x4')],'allowNull':![],'unique':_0x409c('0x5'),'comment':_0x409c('0x3')},'VoiceQueueId':{'type':Sequelize[_0x409c('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x409c('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x409c('0x3')},'penalty':{'type':Sequelize[_0x409c('0x2')](0xb),'defaultValue':0x0,'comment':_0x409c('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x409c('0x3')}};
\ No newline at end of file
+var _0xaa55=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','queue_interface','STRING'];(function(_0xa5536c,_0x4cd48d){var _0x5f0121=function(_0x2f7aa1){while(--_0x2f7aa1){_0xa5536c['push'](_0xa5536c['shift']());}};_0x5f0121(++_0x4cd48d);}(_0xaa55,0x174));var _0x5aa5=function(_0x1722b2,_0x324080){_0x1722b2=_0x1722b2-0x0;var _0x5b098b=_0xaa55[_0x1722b2];return _0x5b098b;};'use strict';var Sequelize=require(_0x5aa5('0x0'));module[_0x5aa5('0x1')]={'uniqueid':{'type':Sequelize[_0x5aa5('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x5aa5('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x5aa5('0x3')},'UserId':{'type':Sequelize[_0x5aa5('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5aa5('0x4'),'comment':_0x5aa5('0x3')},'VoiceQueueId':{'type':Sequelize[_0x5aa5('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x5aa5('0x5')],'allowNull':![],'unique':_0x5aa5('0x4'),'comment':_0x5aa5('0x3')},'penalty':{'type':Sequelize[_0x5aa5('0x2')](0xb),'defaultValue':0x0,'comment':_0x5aa5('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x5aa5('0x3')}};
\ No newline at end of file
index 418904b..38491b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1285=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x864135,_0x364ac5){var _0x474a35=function(_0x3833a4){while(--_0x3833a4){_0x864135['push'](_0x864135['shift']());}};_0x474a35(++_0x364ac5);}(_0x1285,0x10e));var _0x5128=function(_0x4b9ce3,_0x5688da){_0x4b9ce3=_0x4b9ce3-0x0;var _0x124cfe=_0x1285[_0x4b9ce3];return _0x124cfe;};'use strict';var EventEmitter=require(_0x5128('0x0'));var UserVoiceQueueRt=require(_0x5128('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5128('0x2')](0x0);var events={'afterCreate':_0x5128('0x3'),'afterUpdate':_0x5128('0x4'),'afterDestroy':_0x5128('0x5')};function emitEvent(_0x2c5e64){return function(_0x5151e5,_0xd2a5e2,_0xb8696f){UserVoiceQueueRtEvents[_0x5128('0x6')](_0x2c5e64+':'+_0x5151e5['id'],_0x5151e5);UserVoiceQueueRtEvents[_0x5128('0x6')](_0x2c5e64,_0x5151e5);_0xb8696f(null);};}for(var e in events){if(events[_0x5128('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x5128('0x8')](e,emitEvent(event));}}module[_0x5128('0x9')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x06e0=['setMaxListeners','remove','emit','hook','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06e0,0xb3));var _0x006e=function(_0x4aba0e,_0x3cca89){_0x4aba0e=_0x4aba0e-0x0;var _0x240301=_0x06e0[_0x4aba0e];return _0x240301;};'use strict';var EventEmitter=require(_0x006e('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x006e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x006e('0x2')};function emitEvent(_0x314016){return function(_0x562e4e,_0x141a3b,_0x55e11f){UserVoiceQueueRtEvents[_0x006e('0x3')](_0x314016+':'+_0x562e4e['id'],_0x562e4e);UserVoiceQueueRtEvents['emit'](_0x314016,_0x562e4e);_0x55e11f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x006e('0x4')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
index b68f741..214a571 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9605=['rimraf','../../config/environment','UserVoiceQueueRt','user_has_voice_queues_rt','../../config/logger','api','moment','request-promise','path'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x9605,0x70));var _0x5960=function(_0x262d9f,_0x4b1a85){_0x262d9f=_0x262d9f-0x0;var _0xb2d592=_0x9605[_0x262d9f];return _0xb2d592;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5960('0x0'))(_0x5960('0x1'));var moment=require(_0x5960('0x2'));var BPromise=require('bluebird');var rp=require(_0x5960('0x3'));var fs=require('fs');var path=require(_0x5960('0x4'));var rimraf=require(_0x5960('0x5'));var config=require(_0x5960('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x199d25,_0xbbab11){return _0x199d25['define'](_0x5960('0x7'),attributes,{'tableName':_0x5960('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6361=['user_has_voice_queues_rt','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6361,0xa1));var _0x1636=function(_0x15efe1,_0x8a621e){_0x15efe1=_0x15efe1-0x0;var _0x2daae8=_0x6361[_0x15efe1];return _0x2daae8;};'use strict';var _=require(_0x1636('0x0'));var util=require(_0x1636('0x1'));var logger=require(_0x1636('0x2'))('api');var moment=require(_0x1636('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1636('0x4'));var rimraf=require(_0x1636('0x5'));var config=require(_0x1636('0x6'));var attributes=require(_0x1636('0x7'));module['exports']=function(_0x83a2c7,_0x71884f){return _0x83a2c7[_0x1636('0x8')]('UserVoiceQueueRt',attributes,{'tableName':_0x1636('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 530a020..609122a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb66d=['sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./userVoiceQueueRt.socket','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0xb66d,0xc5));var _0xdb66=function(_0x49d280,_0x33d68f){_0x49d280=_0x49d280-0x0;var _0x25274a=_0xb66d[_0x49d280];return _0x25274a;};'use strict';var _=require(_0xdb66('0x0'));var util=require(_0xdb66('0x1'));var moment=require('moment');var BPromise=require(_0xdb66('0x2'));var rs=require(_0xdb66('0x3'));var fs=require('fs');var Redis=require(_0xdb66('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdb66('0x5'));var logger=require(_0xdb66('0x6'))(_0xdb66('0x7'));var config=require(_0xdb66('0x8'));var jayson=require(_0xdb66('0x9'));var client=jayson['client'][_0xdb66('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xdb66('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb66('0xc'))(new Redis(config[_0xdb66('0xb')]));require(_0xdb66('0xd'))[_0xdb66('0xe')](socket);function respondWithRpcPromise(_0x1e1945,_0x1e4e5d,_0x4288ee){return new BPromise(function(_0x5d9b19,_0x251e38){return client[_0xdb66('0xf')](_0x1e1945,_0x4288ee)['then'](function(_0x547c72){logger[_0xdb66('0x10')](_0xdb66('0x11'),_0x1e4e5d,'request\x20sent');logger[_0xdb66('0x12')](_0xdb66('0x13'),_0x1e4e5d,_0xdb66('0x14'),JSON[_0xdb66('0x15')](_0x547c72));if(_0x547c72[_0xdb66('0x16')]){if(_0x547c72[_0xdb66('0x16')][_0xdb66('0x17')]===0x1f4){logger['error'](_0xdb66('0x11'),_0x1e4e5d,_0x547c72[_0xdb66('0x16')]['message']);return _0x251e38(_0x547c72[_0xdb66('0x16')][_0xdb66('0x18')]);}logger[_0xdb66('0x16')](_0xdb66('0x11'),_0x1e4e5d,_0x547c72[_0xdb66('0x16')][_0xdb66('0x18')]);return _0x5d9b19(_0x547c72[_0xdb66('0x16')]['message']);}else{logger[_0xdb66('0x10')](_0xdb66('0x11'),_0x1e4e5d,'request\x20sent');_0x5d9b19(_0x547c72[_0xdb66('0x19')][_0xdb66('0x18')]);}})['catch'](function(_0x146314){logger[_0xdb66('0x16')](_0xdb66('0x11'),_0x1e4e5d,_0x146314);_0x251e38(_0x146314);});});}exports[_0xdb66('0x1a')]=function(_0x159f00){var _0x2f442c=this;return new Promise(function(_0x449758,_0x266cfa){return db[_0xdb66('0x1b')][_0xdb66('0x1c')]({'raw':_0x159f00[_0xdb66('0x1d')]?_0x159f00[_0xdb66('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x159f00[_0xdb66('0x1d')]?_0x159f00['options'][_0xdb66('0x1e')]||null:null,'attributes':[[db[_0xdb66('0x1f')]['fn'](_0xdb66('0x20'),db['sequelize']['fn']('IF',db[_0xdb66('0x1f')][_0xdb66('0x21')](_0xdb66('0x22')))),_0xdb66('0x23')]]})[_0xdb66('0x24')](function(_0x22541c){logger['info']('GetVoiceQueueRtPauses',_0x159f00);logger[_0xdb66('0x12')](_0xdb66('0x1a'),_0x159f00,JSON[_0xdb66('0x15')](_0x22541c));_0x449758(_0x22541c);})[_0xdb66('0x25')](function(_0x133112){logger[_0xdb66('0x16')](_0xdb66('0x1a'),_0x133112[_0xdb66('0x18')],_0x159f00);_0x266cfa(_0x2f442c[_0xdb66('0x16')](0x1f4,_0x133112[_0xdb66('0x18')]));});});};
\ No newline at end of file
+var _0xf1ec=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','COUNT','sequelize','literal','outboundQueuePauses','catch','lodash','moment','randomstring','../../mysqldb','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf1ec,0x1db));var _0xcf1e=function(_0x2dac3f,_0x2408d7){_0x2dac3f=_0x2dac3f-0x0;var _0x3d20ba=_0xf1ec[_0x2dac3f];return _0x3d20ba;};'use strict';var _=require(_0xcf1e('0x0'));var util=require('util');var moment=require(_0xcf1e('0x1'));var BPromise=require('bluebird');var rs=require(_0xcf1e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xcf1e('0x4'));var jayson=require(_0xcf1e('0x5'));var client=jayson[_0xcf1e('0x6')][_0xcf1e('0x7')]({'port':0x232a});config[_0xcf1e('0x8')]=_[_0xcf1e('0x9')](config['redis'],{'host':_0xcf1e('0xa'),'port':0x18eb});var socket=require(_0xcf1e('0xb'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x3c730d,_0x33a638,_0x1c625e){return new BPromise(function(_0x25a181,_0x2fbd4d){return client[_0xcf1e('0xc')](_0x3c730d,_0x1c625e)[_0xcf1e('0xd')](function(_0xd3b829){logger[_0xcf1e('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x33a638,_0xcf1e('0xf'));logger[_0xcf1e('0x10')](_0xcf1e('0x11'),_0x33a638,'request\x20sent',JSON[_0xcf1e('0x12')](_0xd3b829));if(_0xd3b829['error']){if(_0xd3b829[_0xcf1e('0x13')][_0xcf1e('0x14')]===0x1f4){logger[_0xcf1e('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x33a638,_0xd3b829[_0xcf1e('0x13')][_0xcf1e('0x15')]);return _0x2fbd4d(_0xd3b829[_0xcf1e('0x13')]['message']);}logger[_0xcf1e('0x13')](_0xcf1e('0x16'),_0x33a638,_0xd3b829[_0xcf1e('0x13')][_0xcf1e('0x15')]);return _0x25a181(_0xd3b829[_0xcf1e('0x13')][_0xcf1e('0x15')]);}else{logger['info'](_0xcf1e('0x16'),_0x33a638,'request\x20sent');_0x25a181(_0xd3b829['result'][_0xcf1e('0x15')]);}})['catch'](function(_0x5f1b2e){logger['error'](_0xcf1e('0x16'),_0x33a638,_0x5f1b2e);_0x2fbd4d(_0x5f1b2e);});});}exports[_0xcf1e('0x17')]=function(_0x3d7d49){var _0xe5f2b0=this;return new Promise(function(_0x419f4e,_0x58271f){return db[_0xcf1e('0x18')]['findAll']({'raw':_0x3d7d49[_0xcf1e('0x19')]?_0x3d7d49[_0xcf1e('0x19')][_0xcf1e('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d7d49[_0xcf1e('0x19')]?_0x3d7d49[_0xcf1e('0x19')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xcf1e('0x1b'),db[_0xcf1e('0x1c')]['fn']('IF',db[_0xcf1e('0x1c')][_0xcf1e('0x1d')]('`paused`\x20=\x201,\x201,\x20null'))),_0xcf1e('0x1e')]]})[_0xcf1e('0xd')](function(_0x3a6927){logger[_0xcf1e('0xe')](_0xcf1e('0x17'),_0x3d7d49);logger[_0xcf1e('0x10')](_0xcf1e('0x17'),_0x3d7d49,JSON[_0xcf1e('0x12')](_0x3a6927));_0x419f4e(_0x3a6927);})[_0xcf1e('0x1f')](function(_0x1ec513){logger[_0xcf1e('0x13')](_0xcf1e('0x17'),_0x1ec513['message'],_0x3d7d49);_0x58271f(_0xe5f2b0[_0xcf1e('0x13')](0x1f4,_0x1ec513[_0xcf1e('0x15')]));});});};
\ No newline at end of file
index a72a1cf..ec5129a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b16=['removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update','emit'];(function(_0x515e0f,_0x41c828){var _0x1fe5fd=function(_0x59a99a){while(--_0x59a99a){_0x515e0f['push'](_0x515e0f['shift']());}};_0x1fe5fd(++_0x41c828);}(_0x4b16,0xf8));var _0x64b1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4b16[_0x20a584];return _0x4b41a8;};'use strict';var UserVoiceQueueRtEvents=require(_0x64b1('0x0'));var events=['save',_0x64b1('0x1'),_0x64b1('0x2')];function createListener(_0x16beb6,_0x539438){return function(_0x1dccc0){_0x539438[_0x64b1('0x3')](_0x16beb6,_0x1dccc0);};}function removeListener(_0x15aaec,_0x4175a6){return function(){UserVoiceQueueRtEvents[_0x64b1('0x4')](_0x15aaec,_0x4175a6);};}exports['register']=function(_0x43ed06){for(var _0x59817b=0x0,_0x854309=events[_0x64b1('0x5')];_0x59817b<_0x854309;_0x59817b++){var _0x256873=events[_0x59817b];var _0x324cdc=createListener(_0x64b1('0x6')+_0x256873,_0x43ed06);UserVoiceQueueRtEvents['on'](_0x256873,_0x324cdc);}};
\ No newline at end of file
+var _0x990b=['save','remove','update','register','length','userVoiceQueueRt:'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x990b,0x11a));var _0xb990=function(_0x9c69ab,_0x1feadd){_0x9c69ab=_0x9c69ab-0x0;var _0x85dfc5=_0x990b[_0x9c69ab];return _0x85dfc5;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xb990('0x0'),_0xb990('0x1'),_0xb990('0x2')];function createListener(_0x2fb21a,_0x1f6e66){return function(_0x376b2c){_0x1f6e66['emit'](_0x2fb21a,_0x376b2c);};}function removeListener(_0x17e4b3,_0x57dc5f){return function(){UserVoiceQueueRtEvents['removeListener'](_0x17e4b3,_0x57dc5f);};}exports[_0xb990('0x3')]=function(_0x5e4377){for(var _0x3d7363=0x0,_0x52ff70=events[_0xb990('0x4')];_0x3d7363<_0x52ff70;_0x3d7363++){var _0x54a827=events[_0x3d7363];var _0x13acff=createListener(_0xb990('0x5')+_0x54a827,_0x5e4377);UserVoiceQueueRtEvents['on'](_0x54a827,_0x13acff);}};
\ No newline at end of file
index 060ce41..446d5a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5947=['../../components/auth/service','exports','util','path','express'];(function(_0x68cae0,_0x7d78cd){var _0x5e7200=function(_0x4a709f){while(--_0x4a709f){_0x68cae0['push'](_0x68cae0['shift']());}};_0x5e7200(++_0x7d78cd);}(_0x5947,0x179));var _0x7594=function(_0x59ecce,_0x6482d7){_0x59ecce=_0x59ecce-0x0;var _0xdf1e7a=_0x5947[_0x59ecce];return _0xdf1e7a;};'use strict';var multer=require('multer');var util=require(_0x7594('0x0'));var path=require(_0x7594('0x1'));var timeout=require('connect-timeout');var express=require(_0x7594('0x2'));var router=express['Router']();var auth=require(_0x7594('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x7594('0x4')]=router;
\ No newline at end of file
+var _0xd314=['util','express','exports','multer'];(function(_0x4545fb,_0xdb9183){var _0x474cb4=function(_0x2fc4df){while(--_0x2fc4df){_0x4545fb['push'](_0x4545fb['shift']());}};_0x474cb4(++_0xdb9183);}(_0xd314,0xcb));var _0x4d31=function(_0x4fa1c1,_0x31626e){_0x4fa1c1=_0x4fa1c1-0x0;var _0x2e060f=_0xd314[_0x4fa1c1];return _0x2e060f;};'use strict';var multer=require(_0x4d31('0x0'));var util=require(_0x4d31('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4d31('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x4d31('0x3')]=router;
\ No newline at end of file
index 67d85c4..8bf34e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['exports','INTEGER'];(function(_0x3060e3,_0x14f2c6){var _0x497d2c=function(_0x2a274a){while(--_0x2a274a){_0x3060e3['push'](_0x3060e3['shift']());}};_0x497d2c(++_0x14f2c6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe706=['INTEGER','sequelize','exports'];(function(_0x29a2be,_0x595b42){var _0x82e874=function(_0x3312d6){while(--_0x3312d6){_0x29a2be['push'](_0x29a2be['shift']());}};_0x82e874(++_0x595b42);}(_0xe706,0xa3));var _0x6e70=function(_0x4f485f,_0x1db0f7){_0x4f485f=_0x4f485f-0x0;var _0x1e998e=_0xe706[_0x4f485f];return _0x1e998e;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 2dc7ad8..de73036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3469=['bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','exports','define','user_has_whatsapp_queues','../../config/logger','api','moment'];(function(_0x9c6822,_0x1e6b95){var _0x43dff3=function(_0x43493e){while(--_0x43493e){_0x9c6822['push'](_0x9c6822['shift']());}};_0x43dff3(++_0x1e6b95);}(_0x3469,0x168));var _0x9346=function(_0x59ff69,_0x459aee){_0x59ff69=_0x59ff69-0x0;var _0x2f846f=_0x3469[_0x59ff69];return _0x2f846f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9346('0x0'))(_0x9346('0x1'));var moment=require(_0x9346('0x2'));var BPromise=require(_0x9346('0x3'));var rp=require(_0x9346('0x4'));var fs=require('fs');var path=require(_0x9346('0x5'));var rimraf=require('rimraf');var config=require(_0x9346('0x6'));var attributes=require(_0x9346('0x7'));module[_0x9346('0x8')]=function(_0x4dd092,_0x20695e){return _0x4dd092[_0x9346('0x9')]('UserWhatsappQueue',attributes,{'tableName':_0x9346('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf0b4=['bluebird','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment'];(function(_0x51d303,_0x488aeb){var _0x1e259e=function(_0x2ef928){while(--_0x2ef928){_0x51d303['push'](_0x51d303['shift']());}};_0x1e259e(++_0x488aeb);}(_0xf0b4,0x14b));var _0x4f0b=function(_0x16b11d,_0x3688ca){_0x16b11d=_0x16b11d-0x0;var _0x564a5c=_0xf0b4[_0x16b11d];return _0x564a5c;};'use strict';var _=require(_0x4f0b('0x0'));var util=require(_0x4f0b('0x1'));var logger=require(_0x4f0b('0x2'))(_0x4f0b('0x3'));var moment=require(_0x4f0b('0x4'));var BPromise=require(_0x4f0b('0x5'));var rp=require(_0x4f0b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f0b('0x7'));var config=require(_0x4f0b('0x8'));var attributes=require(_0x4f0b('0x9'));module[_0x4f0b('0xa')]=function(_0x4e0e19,_0x27583e){return _0x4e0e19['define']('UserWhatsappQueue',attributes,{'tableName':_0x4f0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4463f2a..3865ece 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x186acf,_0x33d5ce){var _0x36062a=function(_0x1b295a){while(--_0x1b295a){_0x186acf['push'](_0x186acf['shift']());}};_0x36062a(++_0x33d5ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x18355b,_0x1b72b2){var _0x3b7722=function(_0x3fe689){while(--_0x3fe689){_0x18355b['push'](_0x18355b['shift']());}};_0x3b7722(++_0x1b72b2);}(_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 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 ca1459f..c4786e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3889=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x5876a6,_0x410ead){var _0x566826=function(_0x587874){while(--_0x587874){_0x5876a6['push'](_0x5876a6['shift']());}};_0x566826(++_0x410ead);}(_0x3889,0x130));var _0x9388=function(_0x2e77b8,_0x1a23e4){_0x2e77b8=_0x2e77b8-0x0;var _0x371ee9=_0x3889[_0x2e77b8];return _0x371ee9;};'use strict';var multer=require(_0x9388('0x0'));var util=require(_0x9388('0x1'));var path=require('path');var timeout=require(_0x9388('0x2'));var express=require(_0x9388('0x3'));var router=express[_0x9388('0x4')]();var auth=require(_0x9388('0x5'));var interaction=require(_0x9388('0x6'));var config=require(_0x9388('0x7'));var controller=require('./variable.controller');router['get']('/',auth[_0x9388('0x8')](),controller[_0x9388('0x9')]);router[_0x9388('0xa')](_0x9388('0xb'),auth[_0x9388('0x8')](),controller[_0x9388('0xc')]);router[_0x9388('0xd')]('/',auth['isAuthenticated'](),controller[_0x9388('0xe')]);router[_0x9388('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9388('0x10')]);router[_0x9388('0x11')](_0x9388('0xb'),auth[_0x9388('0x8')](),controller[_0x9388('0x12')]);module[_0x9388('0x13')]=router;
\ No newline at end of file
+var _0x1d3c=['index','/:id','post','create','put','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x833662,_0xe60bd){var _0x20e544=function(_0x471aee){while(--_0x471aee){_0x833662['push'](_0x833662['shift']());}};_0x20e544(++_0xe60bd);}(_0x1d3c,0xca));var _0xc1d3=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0x1d3c[_0x21353c];return _0xa99120;};'use strict';var multer=require(_0xc1d3('0x0'));var util=require(_0xc1d3('0x1'));var path=require('path');var timeout=require(_0xc1d3('0x2'));var express=require('express');var router=express[_0xc1d3('0x3')]();var auth=require(_0xc1d3('0x4'));var interaction=require(_0xc1d3('0x5'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0xc1d3('0x6')]('/',auth[_0xc1d3('0x7')](),controller[_0xc1d3('0x8')]);router[_0xc1d3('0x6')](_0xc1d3('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xc1d3('0xa')]('/',auth[_0xc1d3('0x7')](),controller[_0xc1d3('0xb')]);router[_0xc1d3('0xc')]('/:id',auth[_0xc1d3('0x7')](),controller['update']);router['delete']('/:id',auth[_0xc1d3('0x7')](),controller[_0xc1d3('0xd')]);module['exports']=router;
\ No newline at end of file
index c7ad404..6cd7f02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb8e=['STRING','exports'];(function(_0x18c627,_0x926f18){var _0x1e9cbf=function(_0x63fb22){while(--_0x63fb22){_0x18c627['push'](_0x18c627['shift']());}};_0x1e9cbf(++_0x926f18);}(_0xbb8e,0x93));var _0xebb8=function(_0x408599,_0x4db917){_0x408599=_0x408599-0x0;var _0x44e7d6=_0xbb8e[_0x408599];return _0x44e7d6;};'use strict';var Sequelize=require('sequelize');module[_0xebb8('0x0')]={'name':{'type':Sequelize[_0xebb8('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xebb8('0x1')]}};
\ No newline at end of file
+var _0x278e=['STRING','sequelize','name'];(function(_0x33c01d,_0x563c97){var _0x4c7422=function(_0x2f81cd){while(--_0x2f81cd){_0x33c01d['push'](_0x33c01d['shift']());}};_0x4c7422(++_0x563c97);}(_0x278e,0x133));var _0xe278=function(_0x17ad39,_0x4c230a){_0x17ad39=_0x17ad39-0x0;var _0x6e67bf=_0x278e[_0x17ad39];return _0x6e67bf;};'use strict';var Sequelize=require(_0xe278('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xe278('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe278('0x2')]}};
\ No newline at end of file
index c4bc78f..2a23ad5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc28e=['index','Variable','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','options','includeAll','include','findAll','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','get','Variables','UserProfileResource','destroy','stack','name','send'];(function(_0x3dc256,_0x1ee88b){var _0x76841=function(_0x488115){while(--_0x488115){_0x3dc256['push'](_0x3dc256['shift']());}};_0x76841(++_0x1ee88b);}(_0xc28e,0x1af));var _0xec28=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xc28e[_0x8de54f];return _0x14cba4;};'use strict';var pdf=require(_0xec28('0x0'));var emlformat=require(_0xec28('0x1'));var rimraf=require(_0xec28('0x2'));var zipdir=require(_0xec28('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xec28('0x4'));var BPromise=require(_0xec28('0x5'));var Mustache=require(_0xec28('0x6'));var util=require(_0xec28('0x7'));var path=require(_0xec28('0x8'));var sox=require(_0xec28('0x9'));var csv=require(_0xec28('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xec28('0xb'));var squel=require(_0xec28('0xc'));var crypto=require('crypto');var jsforce=require(_0xec28('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xec28('0xa'));var querystring=require('querystring');var Papa=require(_0xec28('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xec28('0xf'));var as=require(_0xec28('0x10'));var hardwareService=require(_0xec28('0x11'));var logger=require(_0xec28('0x12'))(_0xec28('0x13'));var utils=require(_0xec28('0x14'));var config=require(_0xec28('0x15'));var db=require(_0xec28('0x16'))['db'];function respondWithStatusCode(_0x1049a0,_0x25466f){_0x25466f=_0x25466f||0xcc;return function(_0x5bd9fd){if(_0x5bd9fd){return _0x1049a0[_0xec28('0x17')](_0x25466f);}return _0x1049a0[_0xec28('0x18')](_0x25466f)[_0xec28('0x19')]();};}function respondWithResult(_0x15554a,_0x53e1f5){_0x53e1f5=_0x53e1f5||0xc8;return function(_0x506d5d){if(_0x506d5d){return _0x15554a[_0xec28('0x18')](_0x53e1f5)[_0xec28('0x1a')](_0x506d5d);}};}function respondWithFilteredResult(_0x2ce43d,_0x33eb14){return function(_0x39e0b5){if(_0x39e0b5){var _0x5bd95f=_0x39e0b5[_0xec28('0x1b')],_0x1ab3c7=_0x33eb14[_0xec28('0x1c')],_0x50551f=_0x33eb14['offset']+_0x33eb14[_0xec28('0x1d')],_0x2c6eb2;if(_0x50551f>=_0x5bd95f){_0x50551f=_0x5bd95f;_0x2c6eb2=0xc8;}else{_0x2c6eb2=0xce;}_0x2ce43d[_0xec28('0x18')](_0x2c6eb2);return _0x2ce43d[_0xec28('0x1e')](_0xec28('0x1f'),_0x1ab3c7+'-'+_0x50551f+'/'+_0x5bd95f)[_0xec28('0x1a')](_0x39e0b5);}return null;};}function patchUpdates(_0x18cab3){return function(_0x980c5f){try{jsonpatch['apply'](_0x980c5f,_0x18cab3,!![]);}catch(_0x41d756){return BPromise[_0xec28('0x20')](_0x41d756);}return _0x980c5f[_0xec28('0x21')]();};}function saveUpdates(_0x4950e9,_0x1f2eac){return function(_0x435c5b){if(_0x435c5b){return _0x435c5b[_0xec28('0x22')](_0x4950e9)[_0xec28('0x23')](function(_0xb8c0a6){return _0xb8c0a6;});}return null;};}function removeEntity(_0x20ee1b,_0x4cafb1){return function(_0x2db3b9){if(_0x2db3b9){return _0x2db3b9['destroy']()['then'](function(){var _0x5811ab=_0x2db3b9[_0xec28('0x24')]({'plain':!![]});var _0x14f5e1=_0xec28('0x25');return db[_0xec28('0x26')][_0xec28('0x27')]({'where':{'type':_0x14f5e1,'resourceId':_0x5811ab['id']}})[_0xec28('0x23')](function(){return _0x2db3b9;});})['then'](function(){_0x20ee1b[_0xec28('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x475b61,_0x3828c9){return function(_0x5c5d51){if(!_0x5c5d51){_0x475b61['sendStatus'](0x194);}return _0x5c5d51;};}function handleError(_0x4b7122,_0x1c7d8a){_0x1c7d8a=_0x1c7d8a||0x1f4;return function(_0x5e9f32){logger['error'](_0x5e9f32[_0xec28('0x28')]);if(_0x5e9f32[_0xec28('0x29')]){delete _0x5e9f32[_0xec28('0x29')];}_0x4b7122['status'](_0x1c7d8a)[_0xec28('0x2a')](_0x5e9f32);};}exports[_0xec28('0x2b')]=function(_0x24c068,_0xda9f5e){var _0x37092c={},_0x337c1f={},_0x2a667e={'count':0x0,'rows':[]};var _0x3cc71f=_['map'](db[_0xec28('0x2c')][_0xec28('0x2d')],function(_0x59ba59){return{'name':_0x59ba59[_0xec28('0x2e')],'type':_0x59ba59['type'][_0xec28('0x2f')]};});_0x337c1f[_0xec28('0x30')]=_['map'](_0x3cc71f,_0xec28('0x29'));_0x337c1f['query']=_[_0xec28('0x31')](_0x24c068[_0xec28('0x32')]);_0x337c1f[_0xec28('0x33')]=_[_0xec28('0x34')](_0x337c1f[_0xec28('0x30')],_0x337c1f[_0xec28('0x32')]);_0x37092c[_0xec28('0x35')]=_[_0xec28('0x34')](_0x337c1f['model'],qs[_0xec28('0x36')](_0x24c068[_0xec28('0x32')][_0xec28('0x36')]));_0x37092c[_0xec28('0x35')]=_0x37092c[_0xec28('0x35')][_0xec28('0x37')]?_0x37092c['attributes']:_0x337c1f[_0xec28('0x30')];if(!_0x24c068[_0xec28('0x32')][_0xec28('0x38')](_0xec28('0x39'))){_0x37092c[_0xec28('0x1d')]=qs[_0xec28('0x1d')](_0x24c068[_0xec28('0x32')]['limit']);_0x37092c[_0xec28('0x1c')]=qs[_0xec28('0x1c')](_0x24c068[_0xec28('0x32')][_0xec28('0x1c')]);}_0x37092c[_0xec28('0x3a')]=qs[_0xec28('0x3b')](_0x24c068[_0xec28('0x32')]['sort']);_0x37092c[_0xec28('0x3c')]=qs[_0xec28('0x33')](_['pick'](_0x24c068['query'],_0x337c1f[_0xec28('0x33')]),_0x3cc71f);if(_0x24c068[_0xec28('0x32')][_0xec28('0x3d')]){_0x37092c[_0xec28('0x3c')]=_[_0xec28('0x3e')](_0x37092c[_0xec28('0x3c')],{'$or':_[_0xec28('0x3f')](_0x3cc71f,function(_0x6636f0){if(_0x6636f0[_0xec28('0x40')]!=='VIRTUAL'){var _0x70939b={};_0x70939b[_0x6636f0['name']]={'$like':'%'+_0x24c068[_0xec28('0x32')]['filter']+'%'};return _0x70939b;}})});}_0x37092c=_[_0xec28('0x3e')]({},_0x37092c,_0x24c068[_0xec28('0x41')]);var _0x4ae26c={'where':_0x37092c[_0xec28('0x3c')]};return db[_0xec28('0x2c')][_0xec28('0x1b')](_0x4ae26c)[_0xec28('0x23')](function(_0x33bfda){_0x2a667e[_0xec28('0x1b')]=_0x33bfda;if(_0x24c068[_0xec28('0x32')][_0xec28('0x42')]){_0x37092c[_0xec28('0x43')]=[{'all':!![]}];}return db[_0xec28('0x2c')][_0xec28('0x44')](_0x37092c);})['then'](function(_0xd7b639){_0x2a667e[_0xec28('0x45')]=_0xd7b639;return _0x2a667e;})[_0xec28('0x23')](respondWithFilteredResult(_0xda9f5e,_0x37092c))[_0xec28('0x46')](handleError(_0xda9f5e,null));};exports['show']=function(_0x2d7a2c,_0x1d26c6){var _0x2ca4bb={'raw':!![],'where':{'id':_0x2d7a2c['params']['id']}},_0xe599c={};_0xe599c['model']=_[_0xec28('0x31')](db[_0xec28('0x2c')]['rawAttributes']);_0xe599c[_0xec28('0x32')]=_[_0xec28('0x31')](_0x2d7a2c[_0xec28('0x32')]);_0xe599c['filters']=_[_0xec28('0x34')](_0xe599c[_0xec28('0x30')],_0xe599c[_0xec28('0x32')]);_0x2ca4bb[_0xec28('0x35')]=_[_0xec28('0x34')](_0xe599c['model'],qs['fields'](_0x2d7a2c[_0xec28('0x32')][_0xec28('0x36')]));_0x2ca4bb[_0xec28('0x35')]=_0x2ca4bb[_0xec28('0x35')][_0xec28('0x37')]?_0x2ca4bb['attributes']:_0xe599c[_0xec28('0x30')];if(_0x2d7a2c[_0xec28('0x32')][_0xec28('0x42')]){_0x2ca4bb[_0xec28('0x43')]=[{'all':!![]}];}_0x2ca4bb=_[_0xec28('0x3e')]({},_0x2ca4bb,_0x2d7a2c['options']);return db[_0xec28('0x2c')][_0xec28('0x47')](_0x2ca4bb)['then'](handleEntityNotFound(_0x1d26c6,null))[_0xec28('0x23')](respondWithResult(_0x1d26c6,null))[_0xec28('0x46')](handleError(_0x1d26c6,null));};exports[_0xec28('0x48')]=function(_0x375bfa,_0x5201fd){return db[_0xec28('0x2c')][_0xec28('0x48')](_0x375bfa[_0xec28('0x49')],{})['then'](function(_0x35faa2){var _0x120370=_0x375bfa['user'][_0xec28('0x24')]({'plain':!![]});if(!_0x120370)throw new Error(_0xec28('0x4a'));if(_0x120370[_0xec28('0x4b')]==='user'){var _0x1cf5de=_0x35faa2[_0xec28('0x24')]({'plain':!![]});var _0xbed68=_0xec28('0x25');return db['UserProfileSection'][_0xec28('0x47')]({'where':{'name':_0xbed68,'userProfileId':_0x120370[_0xec28('0x4c')]},'raw':!![]})[_0xec28('0x23')](function(_0x4d6580){if(_0x4d6580&&_0x4d6580[_0xec28('0x4d')]===0x0){return db[_0xec28('0x26')][_0xec28('0x48')]({'name':_0x1cf5de[_0xec28('0x29')],'resourceId':_0x1cf5de['id'],'type':_0x4d6580[_0xec28('0x29')],'sectionId':_0x4d6580['id']},{})[_0xec28('0x23')](function(){return _0x35faa2;});}else{return _0x35faa2;}})[_0xec28('0x46')](function(_0x5abcd6){logger['error'](_0xec28('0x4e'),_0x5abcd6);throw _0x5abcd6;});}return _0x35faa2;})[_0xec28('0x23')](respondWithResult(_0x5201fd,0xc9))[_0xec28('0x46')](handleError(_0x5201fd,null));};exports['update']=function(_0x114145,_0x259cf6){if(_0x114145[_0xec28('0x49')]['id']){delete _0x114145[_0xec28('0x49')]['id'];}return db[_0xec28('0x2c')]['find']({'where':{'id':_0x114145['params']['id']}})[_0xec28('0x23')](handleEntityNotFound(_0x259cf6,null))['then'](saveUpdates(_0x114145['body'],null))[_0xec28('0x23')](respondWithResult(_0x259cf6,null))['catch'](handleError(_0x259cf6,null));};exports[_0xec28('0x27')]=function(_0x3120b8,_0x10c0fd){return db['Variable'][_0xec28('0x47')]({'where':{'id':_0x3120b8['params']['id']}})[_0xec28('0x23')](handleEntityNotFound(_0x10c0fd,null))['then'](removeEntity(_0x10c0fd,null))[_0xec28('0x46')](handleError(_0x10c0fd,null));};
\ No newline at end of file
+var _0x5238=['limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll','include','rows','params','rawAttributes','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','destroy','get','Variables','UserProfileResource','then','error','stack','name','send','index','Variable','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty'];(function(_0x168ca2,_0x3ffbf7){var _0x21d2dc=function(_0x30495b){while(--_0x30495b){_0x168ca2['push'](_0x168ca2['shift']());}};_0x21d2dc(++_0x3ffbf7);}(_0x5238,0x6e));var _0x8523=function(_0x328058,_0x47ea36){_0x328058=_0x328058-0x0;var _0xe2ae19=_0x5238[_0x328058];return _0xe2ae19;};'use strict';var pdf=require(_0x8523('0x0'));var emlformat=require(_0x8523('0x1'));var rimraf=require(_0x8523('0x2'));var zipdir=require(_0x8523('0x3'));var jsonpatch=require(_0x8523('0x4'));var rp=require(_0x8523('0x5'));var moment=require(_0x8523('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x8523('0x7'));var util=require(_0x8523('0x8'));var path=require('path');var sox=require(_0x8523('0x9'));var csv=require(_0x8523('0xa'));var ejs=require(_0x8523('0xb'));var fs=require('fs');var _=require(_0x8523('0xc'));var squel=require(_0x8523('0xd'));var crypto=require(_0x8523('0xe'));var jsforce=require(_0x8523('0xf'));var deskjs=require(_0x8523('0x10'));var toCsv=require(_0x8523('0xa'));var querystring=require(_0x8523('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8523('0x12'));var qs=require(_0x8523('0x13'));var as=require(_0x8523('0x14'));var hardwareService=require(_0x8523('0x15'));var logger=require(_0x8523('0x16'))(_0x8523('0x17'));var utils=require('../../config/utils');var config=require(_0x8523('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x304afc,_0x4ea529){_0x4ea529=_0x4ea529||0xcc;return function(_0x3885d0){if(_0x3885d0){return _0x304afc[_0x8523('0x19')](_0x4ea529);}return _0x304afc[_0x8523('0x1a')](_0x4ea529)['end']();};}function respondWithResult(_0x2d90e2,_0x4e0219){_0x4e0219=_0x4e0219||0xc8;return function(_0x5d5291){if(_0x5d5291){return _0x2d90e2[_0x8523('0x1a')](_0x4e0219)[_0x8523('0x1b')](_0x5d5291);}};}function respondWithFilteredResult(_0x4d092d,_0x40eb82){return function(_0x31b975){if(_0x31b975){var _0x16aee1=_0x31b975['count'],_0x24f54e=_0x40eb82[_0x8523('0x1c')],_0x209f96=_0x40eb82[_0x8523('0x1c')]+_0x40eb82['limit'],_0x121a3a;if(_0x209f96>=_0x16aee1){_0x209f96=_0x16aee1;_0x121a3a=0xc8;}else{_0x121a3a=0xce;}_0x4d092d[_0x8523('0x1a')](_0x121a3a);return _0x4d092d[_0x8523('0x1d')](_0x8523('0x1e'),_0x24f54e+'-'+_0x209f96+'/'+_0x16aee1)[_0x8523('0x1b')](_0x31b975);}return null;};}function patchUpdates(_0x3207bd){return function(_0x15b900){try{jsonpatch[_0x8523('0x1f')](_0x15b900,_0x3207bd,!![]);}catch(_0x2db212){return BPromise[_0x8523('0x20')](_0x2db212);}return _0x15b900[_0x8523('0x21')]();};}function saveUpdates(_0x327fa9,_0x231e3e){return function(_0x3449a5){if(_0x3449a5){return _0x3449a5['update'](_0x327fa9)['then'](function(_0x370505){return _0x370505;});}return null;};}function removeEntity(_0x428c82,_0x2d0886){return function(_0x4c0d40){if(_0x4c0d40){return _0x4c0d40[_0x8523('0x22')]()['then'](function(){var _0x374eca=_0x4c0d40[_0x8523('0x23')]({'plain':!![]});var _0x5f25b8=_0x8523('0x24');return db[_0x8523('0x25')][_0x8523('0x22')]({'where':{'type':_0x5f25b8,'resourceId':_0x374eca['id']}})['then'](function(){return _0x4c0d40;});})[_0x8523('0x26')](function(){_0x428c82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17413c,_0x4e4d82){return function(_0x2dcc8f){if(!_0x2dcc8f){_0x17413c[_0x8523('0x19')](0x194);}return _0x2dcc8f;};}function handleError(_0x4ab56d,_0x378848){_0x378848=_0x378848||0x1f4;return function(_0x46ea80){logger[_0x8523('0x27')](_0x46ea80[_0x8523('0x28')]);if(_0x46ea80[_0x8523('0x29')]){delete _0x46ea80[_0x8523('0x29')];}_0x4ab56d[_0x8523('0x1a')](_0x378848)[_0x8523('0x2a')](_0x46ea80);};}exports[_0x8523('0x2b')]=function(_0x2a9e8d,_0x2781bd){var _0x1e3286={},_0x421b6a={},_0xf6c8bc={'count':0x0,'rows':[]};var _0xe41c2c=_['map'](db[_0x8523('0x2c')]['rawAttributes'],function(_0x774444){return{'name':_0x774444[_0x8523('0x2d')],'type':_0x774444[_0x8523('0x2e')][_0x8523('0x2f')]};});_0x421b6a[_0x8523('0x30')]=_[_0x8523('0x31')](_0xe41c2c,_0x8523('0x29'));_0x421b6a[_0x8523('0x32')]=_[_0x8523('0x33')](_0x2a9e8d[_0x8523('0x32')]);_0x421b6a['filters']=_[_0x8523('0x34')](_0x421b6a[_0x8523('0x30')],_0x421b6a['query']);_0x1e3286[_0x8523('0x35')]=_[_0x8523('0x34')](_0x421b6a[_0x8523('0x30')],qs[_0x8523('0x36')](_0x2a9e8d['query'][_0x8523('0x36')]));_0x1e3286[_0x8523('0x35')]=_0x1e3286[_0x8523('0x35')]['length']?_0x1e3286['attributes']:_0x421b6a[_0x8523('0x30')];if(!_0x2a9e8d['query'][_0x8523('0x37')]('nolimit')){_0x1e3286[_0x8523('0x38')]=qs[_0x8523('0x38')](_0x2a9e8d[_0x8523('0x32')][_0x8523('0x38')]);_0x1e3286['offset']=qs[_0x8523('0x1c')](_0x2a9e8d[_0x8523('0x32')][_0x8523('0x1c')]);}_0x1e3286[_0x8523('0x39')]=qs['sort'](_0x2a9e8d[_0x8523('0x32')][_0x8523('0x3a')]);_0x1e3286[_0x8523('0x3b')]=qs[_0x8523('0x3c')](_[_0x8523('0x3d')](_0x2a9e8d[_0x8523('0x32')],_0x421b6a[_0x8523('0x3c')]),_0xe41c2c);if(_0x2a9e8d[_0x8523('0x32')]['filter']){_0x1e3286[_0x8523('0x3b')]=_[_0x8523('0x3e')](_0x1e3286[_0x8523('0x3b')],{'$or':_[_0x8523('0x31')](_0xe41c2c,function(_0x1ac0c4){if(_0x1ac0c4[_0x8523('0x2e')]!==_0x8523('0x3f')){var _0x3305b4={};_0x3305b4[_0x1ac0c4[_0x8523('0x29')]]={'$like':'%'+_0x2a9e8d[_0x8523('0x32')][_0x8523('0x40')]+'%'};return _0x3305b4;}})});}_0x1e3286=_[_0x8523('0x3e')]({},_0x1e3286,_0x2a9e8d[_0x8523('0x41')]);var _0x2f4b1a={'where':_0x1e3286['where']};return db['Variable'][_0x8523('0x42')](_0x2f4b1a)[_0x8523('0x26')](function(_0x175453){_0xf6c8bc[_0x8523('0x42')]=_0x175453;if(_0x2a9e8d[_0x8523('0x32')][_0x8523('0x43')]){_0x1e3286[_0x8523('0x44')]=[{'all':!![]}];}return db[_0x8523('0x2c')]['findAll'](_0x1e3286);})[_0x8523('0x26')](function(_0x5a85d6){_0xf6c8bc[_0x8523('0x45')]=_0x5a85d6;return _0xf6c8bc;})['then'](respondWithFilteredResult(_0x2781bd,_0x1e3286))['catch'](handleError(_0x2781bd,null));};exports['show']=function(_0x5def51,_0x34e0a8){var _0x43b718={'raw':!![],'where':{'id':_0x5def51[_0x8523('0x46')]['id']}},_0x3c05b5={};_0x3c05b5[_0x8523('0x30')]=_['keys'](db[_0x8523('0x2c')][_0x8523('0x47')]);_0x3c05b5['query']=_[_0x8523('0x33')](_0x5def51[_0x8523('0x32')]);_0x3c05b5[_0x8523('0x3c')]=_[_0x8523('0x34')](_0x3c05b5[_0x8523('0x30')],_0x3c05b5[_0x8523('0x32')]);_0x43b718[_0x8523('0x35')]=_[_0x8523('0x34')](_0x3c05b5[_0x8523('0x30')],qs[_0x8523('0x36')](_0x5def51[_0x8523('0x32')][_0x8523('0x36')]));_0x43b718[_0x8523('0x35')]=_0x43b718['attributes'][_0x8523('0x48')]?_0x43b718[_0x8523('0x35')]:_0x3c05b5[_0x8523('0x30')];if(_0x5def51[_0x8523('0x32')][_0x8523('0x43')]){_0x43b718[_0x8523('0x44')]=[{'all':!![]}];}_0x43b718=_[_0x8523('0x3e')]({},_0x43b718,_0x5def51[_0x8523('0x41')]);return db[_0x8523('0x2c')][_0x8523('0x49')](_0x43b718)[_0x8523('0x26')](handleEntityNotFound(_0x34e0a8,null))[_0x8523('0x26')](respondWithResult(_0x34e0a8,null))[_0x8523('0x4a')](handleError(_0x34e0a8,null));};exports['create']=function(_0x32cbd1,_0x5eb6e5){return db[_0x8523('0x2c')][_0x8523('0x4b')](_0x32cbd1[_0x8523('0x4c')],{})[_0x8523('0x26')](function(_0x35d688){var _0x51ce83=_0x32cbd1[_0x8523('0x4d')][_0x8523('0x23')]({'plain':!![]});if(!_0x51ce83)throw new Error(_0x8523('0x4e'));if(_0x51ce83['role']===_0x8523('0x4d')){var _0x4ce329=_0x35d688[_0x8523('0x23')]({'plain':!![]});var _0x22c160=_0x8523('0x24');return db[_0x8523('0x4f')]['find']({'where':{'name':_0x22c160,'userProfileId':_0x51ce83[_0x8523('0x50')]},'raw':!![]})[_0x8523('0x26')](function(_0x1db42b){if(_0x1db42b&&_0x1db42b['autoAssociation']===0x0){return db['UserProfileResource'][_0x8523('0x4b')]({'name':_0x4ce329[_0x8523('0x29')],'resourceId':_0x4ce329['id'],'type':_0x1db42b[_0x8523('0x29')],'sectionId':_0x1db42b['id']},{})[_0x8523('0x26')](function(){return _0x35d688;});}else{return _0x35d688;}})[_0x8523('0x4a')](function(_0x4c2478){logger['error'](_0x8523('0x51'),_0x4c2478);throw _0x4c2478;});}return _0x35d688;})[_0x8523('0x26')](respondWithResult(_0x5eb6e5,0xc9))[_0x8523('0x4a')](handleError(_0x5eb6e5,null));};exports[_0x8523('0x52')]=function(_0x50f7f5,_0x4708df){if(_0x50f7f5[_0x8523('0x4c')]['id']){delete _0x50f7f5[_0x8523('0x4c')]['id'];}return db[_0x8523('0x2c')][_0x8523('0x49')]({'where':{'id':_0x50f7f5['params']['id']}})[_0x8523('0x26')](handleEntityNotFound(_0x4708df,null))[_0x8523('0x26')](saveUpdates(_0x50f7f5[_0x8523('0x4c')],null))[_0x8523('0x26')](respondWithResult(_0x4708df,null))['catch'](handleError(_0x4708df,null));};exports['destroy']=function(_0x339b19,_0x329a60){return db[_0x8523('0x2c')]['find']({'where':{'id':_0x339b19[_0x8523('0x46')]['id']}})[_0x8523('0x26')](handleEntityNotFound(_0x329a60,null))[_0x8523('0x26')](removeEntity(_0x329a60,null))[_0x8523('0x4a')](handleError(_0x329a60,null));};
\ No newline at end of file
index 67bf798..a8065b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf89b=['define','Variable','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf89b,0x157));var _0xbf89=function(_0x49e479,_0x30b274){_0x49e479=_0x49e479-0x0;var _0x27aa63=_0xf89b[_0x49e479];return _0x27aa63;};'use strict';var _=require(_0xbf89('0x0'));var util=require(_0xbf89('0x1'));var logger=require('../../config/logger')(_0xbf89('0x2'));var moment=require(_0xbf89('0x3'));var BPromise=require(_0xbf89('0x4'));var rp=require(_0xbf89('0x5'));var fs=require('fs');var path=require(_0xbf89('0x6'));var rimraf=require('rimraf');var config=require(_0xbf89('0x7'));var attributes=require('./variable.attributes');module[_0xbf89('0x8')]=function(_0x49e25f,_0x1b09d6){return _0x49e25f[_0xbf89('0x9')](_0xbf89('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1a43=['lodash','util','api','bluebird','request-promise','../../config/environment','exports','Variable'];(function(_0xe2276e,_0xab7ea4){var _0x4332c5=function(_0x4b9fca){while(--_0x4b9fca){_0xe2276e['push'](_0xe2276e['shift']());}};_0x4332c5(++_0xab7ea4);}(_0x1a43,0xa8));var _0x31a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a43[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x31a4('0x0'));var util=require(_0x31a4('0x1'));var logger=require('../../config/logger')(_0x31a4('0x2'));var moment=require('moment');var BPromise=require(_0x31a4('0x3'));var rp=require(_0x31a4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x31a4('0x5'));var attributes=require('./variable.attributes');module[_0x31a4('0x6')]=function(_0x3e6680,_0x19a420){return _0x3e6680['define'](_0x31a4('0x7'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0a1bea4..ed588fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b8c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','ShowVariable','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x19babd,_0x1d4ef7){var _0x314eaf=function(_0x24ea35){while(--_0x24ea35){_0x19babd['push'](_0x19babd['shift']());}};_0x314eaf(++_0x1d4ef7);}(_0x5b8c,0x110));var _0xc5b8=function(_0xdcda3,_0x4252fb){_0xdcda3=_0xdcda3-0x0;var _0x2bec82=_0x5b8c[_0xdcda3];return _0x2bec82;};'use strict';var _=require(_0xc5b8('0x0'));var util=require(_0xc5b8('0x1'));var moment=require(_0xc5b8('0x2'));var BPromise=require(_0xc5b8('0x3'));var rs=require(_0xc5b8('0x4'));var fs=require('fs');var Redis=require(_0xc5b8('0x5'));var db=require(_0xc5b8('0x6'))['db'];var utils=require(_0xc5b8('0x7'));var logger=require(_0xc5b8('0x8'))(_0xc5b8('0x9'));var config=require(_0xc5b8('0xa'));var jayson=require(_0xc5b8('0xb'));var client=jayson['client'][_0xc5b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1190a1,_0x4c2806,_0x88c24){return new BPromise(function(_0x4cb0d9,_0x294ae5){return client['request'](_0x1190a1,_0x88c24)[_0xc5b8('0xd')](function(_0x1d0d6b){logger[_0xc5b8('0xe')](_0xc5b8('0xf'),_0x4c2806,_0xc5b8('0x10'));logger[_0xc5b8('0x11')](_0xc5b8('0x12'),_0x4c2806,_0xc5b8('0x10'),JSON['stringify'](_0x1d0d6b));if(_0x1d0d6b[_0xc5b8('0x13')]){if(_0x1d0d6b[_0xc5b8('0x13')]['code']===0x1f4){logger[_0xc5b8('0x13')](_0xc5b8('0xf'),_0x4c2806,_0x1d0d6b['error']['message']);return _0x294ae5(_0x1d0d6b['error'][_0xc5b8('0x14')]);}logger[_0xc5b8('0x13')](_0xc5b8('0xf'),_0x4c2806,_0x1d0d6b[_0xc5b8('0x13')][_0xc5b8('0x14')]);return _0x4cb0d9(_0x1d0d6b['error'][_0xc5b8('0x14')]);}else{logger[_0xc5b8('0xe')]('Variable,\x20%s,\x20%s',_0x4c2806,_0xc5b8('0x10'));_0x4cb0d9(_0x1d0d6b[_0xc5b8('0x15')][_0xc5b8('0x14')]);}})['catch'](function(_0x527fb8){logger[_0xc5b8('0x13')](_0xc5b8('0xf'),_0x4c2806,_0x527fb8);_0x294ae5(_0x527fb8);});});}exports[_0xc5b8('0x16')]=function(_0x51e8f4){var _0x2f2127=this;return new Promise(function(_0x2b0747,_0x2fadba){return db['Variable']['find']({'raw':_0x51e8f4[_0xc5b8('0x17')]?_0x51e8f4['options'][_0xc5b8('0x18')]===undefined?!![]:![]:!![],'where':_0x51e8f4[_0xc5b8('0x17')]?_0x51e8f4[_0xc5b8('0x17')][_0xc5b8('0x19')]||null:null,'attributes':_0x51e8f4[_0xc5b8('0x17')]?_0x51e8f4[_0xc5b8('0x17')][_0xc5b8('0x1a')]||null:null,'include':_0x51e8f4[_0xc5b8('0x17')]?_0x51e8f4[_0xc5b8('0x17')][_0xc5b8('0x1b')]?_[_0xc5b8('0x1c')](_0x51e8f4[_0xc5b8('0x17')]['include'],function(_0x36bead){return{'model':db[_0x36bead['model']],'as':_0x36bead['as'],'attributes':_0x36bead['attributes'],'include':_0x36bead['include']?_[_0xc5b8('0x1c')](_0x36bead['include'],function(_0x163702){return{'model':db[_0x163702[_0xc5b8('0x1d')]],'as':_0x163702['as'],'attributes':_0x163702[_0xc5b8('0x1a')],'include':_0x163702['include']?_[_0xc5b8('0x1c')](_0x163702['include'],function(_0x4bda45){return{'model':db[_0x4bda45[_0xc5b8('0x1d')]],'as':_0x4bda45['as'],'attributes':_0x4bda45[_0xc5b8('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc5b8('0xd')](function(_0x26cb8b){logger[_0xc5b8('0xe')](_0xc5b8('0x16'),_0x51e8f4);logger[_0xc5b8('0x11')](_0xc5b8('0x16'),_0x51e8f4,JSON[_0xc5b8('0x1e')](_0x26cb8b));_0x2b0747(_0x26cb8b);})['catch'](function(_0x475f6b){logger['error'](_0xc5b8('0x16'),_0x475f6b[_0xc5b8('0x14')],_0x51e8f4);_0x2fadba(_0x2f2127[_0xc5b8('0x13')](0x1f4,_0x475f6b['message']));});});};
\ No newline at end of file
+var _0xd5d8=['attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','ShowVariable','find','options','raw','where'];(function(_0x5306fc,_0x2b7040){var _0x461e18=function(_0x40db01){while(--_0x40db01){_0x5306fc['push'](_0x5306fc['shift']());}};_0x461e18(++_0x2b7040);}(_0xd5d8,0x143));var _0x8d5d=function(_0x1a6d31,_0x2a5af9){_0x1a6d31=_0x1a6d31-0x0;var _0x1576fd=_0xd5d8[_0x1a6d31];return _0x1576fd;};'use strict';var _=require(_0x8d5d('0x0'));var util=require(_0x8d5d('0x1'));var moment=require(_0x8d5d('0x2'));var BPromise=require(_0x8d5d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d5d('0x4'));var db=require(_0x8d5d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8d5d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8d5d('0x7')][_0x8d5d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1721c8,_0x4b3610,_0x1df2d6){return new BPromise(function(_0x233846,_0x36bd36){return client[_0x8d5d('0x9')](_0x1721c8,_0x1df2d6)[_0x8d5d('0xa')](function(_0x697c50){logger['info'](_0x8d5d('0xb'),_0x4b3610,_0x8d5d('0xc'));logger[_0x8d5d('0xd')](_0x8d5d('0xe'),_0x4b3610,_0x8d5d('0xc'),JSON['stringify'](_0x697c50));if(_0x697c50[_0x8d5d('0xf')]){if(_0x697c50[_0x8d5d('0xf')][_0x8d5d('0x10')]===0x1f4){logger['error'](_0x8d5d('0xb'),_0x4b3610,_0x697c50[_0x8d5d('0xf')][_0x8d5d('0x11')]);return _0x36bd36(_0x697c50['error'][_0x8d5d('0x11')]);}logger['error']('Variable,\x20%s,\x20%s',_0x4b3610,_0x697c50[_0x8d5d('0xf')][_0x8d5d('0x11')]);return _0x233846(_0x697c50[_0x8d5d('0xf')][_0x8d5d('0x11')]);}else{logger[_0x8d5d('0x12')]('Variable,\x20%s,\x20%s',_0x4b3610,_0x8d5d('0xc'));_0x233846(_0x697c50['result'][_0x8d5d('0x11')]);}})[_0x8d5d('0x13')](function(_0x440518){logger[_0x8d5d('0xf')](_0x8d5d('0xb'),_0x4b3610,_0x440518);_0x36bd36(_0x440518);});});}exports[_0x8d5d('0x14')]=function(_0x268b9c){var _0x2669cb=this;return new Promise(function(_0x3bf1a9,_0x2665dc){return db['Variable'][_0x8d5d('0x15')]({'raw':_0x268b9c[_0x8d5d('0x16')]?_0x268b9c['options'][_0x8d5d('0x17')]===undefined?!![]:![]:!![],'where':_0x268b9c[_0x8d5d('0x16')]?_0x268b9c['options'][_0x8d5d('0x18')]||null:null,'attributes':_0x268b9c[_0x8d5d('0x16')]?_0x268b9c[_0x8d5d('0x16')][_0x8d5d('0x19')]||null:null,'include':_0x268b9c['options']?_0x268b9c[_0x8d5d('0x16')][_0x8d5d('0x1a')]?_[_0x8d5d('0x1b')](_0x268b9c['options']['include'],function(_0x1e7db9){return{'model':db[_0x1e7db9['model']],'as':_0x1e7db9['as'],'attributes':_0x1e7db9[_0x8d5d('0x19')],'include':_0x1e7db9[_0x8d5d('0x1a')]?_[_0x8d5d('0x1b')](_0x1e7db9[_0x8d5d('0x1a')],function(_0x3c9609){return{'model':db[_0x3c9609[_0x8d5d('0x1c')]],'as':_0x3c9609['as'],'attributes':_0x3c9609['attributes'],'include':_0x3c9609[_0x8d5d('0x1a')]?_[_0x8d5d('0x1b')](_0x3c9609[_0x8d5d('0x1a')],function(_0x284cdf){return{'model':db[_0x284cdf[_0x8d5d('0x1c')]],'as':_0x284cdf['as'],'attributes':_0x284cdf[_0x8d5d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8d5d('0xa')](function(_0x45d176){logger[_0x8d5d('0x12')](_0x8d5d('0x14'),_0x268b9c);logger[_0x8d5d('0xd')](_0x8d5d('0x14'),_0x268b9c,JSON['stringify'](_0x45d176));_0x3bf1a9(_0x45d176);})[_0x8d5d('0x13')](function(_0x559889){logger[_0x8d5d('0xf')]('ShowVariable',_0x559889[_0x8d5d('0x11')],_0x268b9c);_0x2665dc(_0x2669cb[_0x8d5d('0xf')](0x1f4,_0x559889[_0x8d5d('0x11')]));});});};
\ No newline at end of file
index a2c1610..2d0b063 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5a6=['get','/fetch','isAuthenticated','canUpdate','reset','/pull','restart','/migrations','exports','../../components/auth/service','./version.controller','index'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa5a6,0x1a1));var _0x6a5a=function(_0x82f586,_0x382c19){_0x82f586=_0x82f586-0x0;var _0x591ec8=_0xa5a6[_0x82f586];return _0x591ec8;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x6a5a('0x0'));var controller=require(_0x6a5a('0x1'));router['get']('/',controller[_0x6a5a('0x2')]);router[_0x6a5a('0x3')](_0x6a5a('0x4'),auth[_0x6a5a('0x5')](),auth[_0x6a5a('0x6')](),controller['fetch']);router[_0x6a5a('0x3')]('/reset',auth['isAuthenticated'](),auth[_0x6a5a('0x6')](),controller[_0x6a5a('0x7')]);router['get'](_0x6a5a('0x8'),auth[_0x6a5a('0x5')](),auth[_0x6a5a('0x6')](),controller['pull']);router[_0x6a5a('0x3')]('/restart',auth[_0x6a5a('0x5')](),controller[_0x6a5a('0x9')]);router[_0x6a5a('0x3')](_0x6a5a('0xa'),controller['migrations']);module[_0x6a5a('0xb')]=router;
\ No newline at end of file
+var _0xd95b=['Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','fetch','canUpdate','reset','/pull','pull','/restart','restart','migrations'];(function(_0x5c0c74,_0x44a20c){var _0x1bd22c=function(_0x5a6f3e){while(--_0x5a6f3e){_0x5c0c74['push'](_0x5c0c74['shift']());}};_0x1bd22c(++_0x44a20c);}(_0xd95b,0x126));var _0xbd95=function(_0x22e6d3,_0x5c863d){_0x22e6d3=_0x22e6d3-0x0;var _0x30782c=_0xd95b[_0x22e6d3];return _0x30782c;};'use strict';var express=require('express');var router=express[_0xbd95('0x0')]();var auth=require(_0xbd95('0x1'));var controller=require(_0xbd95('0x2'));router[_0xbd95('0x3')]('/',controller['index']);router[_0xbd95('0x3')](_0xbd95('0x4'),auth[_0xbd95('0x5')](),auth['canUpdate'](),controller[_0xbd95('0x6')]);router[_0xbd95('0x3')]('/reset',auth[_0xbd95('0x5')](),auth[_0xbd95('0x7')](),controller[_0xbd95('0x8')]);router['get'](_0xbd95('0x9'),auth['isAuthenticated'](),auth[_0xbd95('0x7')](),controller[_0xbd95('0xa')]);router['get'](_0xbd95('0xb'),auth['isAuthenticated'](),controller[_0xbd95('0xc')]);router[_0xbd95('0x3')]('/migrations',controller[_0xbd95('0xd')]);module['exports']=router;
\ No newline at end of file
index 80a9922..8537bab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68fd=['git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','root','length','.js','sort','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','index','exports','version','query','fetch','latest','2.0.0','origin','master','error','status','json'];(function(_0x2bc188,_0xbcc2fc){var _0x3b0a0a=function(_0x1aa31e){while(--_0x1aa31e){_0x2bc188['push'](_0x2bc188['shift']());}};_0x3b0a0a(++_0xbcc2fc);}(_0x68fd,0x1e9));var _0xd68f=function(_0x1fae76,_0x2d852d){_0x1fae76=_0x1fae76-0x0;var _0x5e5bf1=_0x68fd[_0x1fae76];return _0x5e5bf1;};'use strict';var Umzug=require(_0xd68f('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xd68f('0x1'));var pkginfo=require(_0xd68f('0x2'))(module,'version');var compareVersions=require(_0xd68f('0x3'));var exec=require(_0xd68f('0x4'))[_0xd68f('0x5')];var db=require(_0xd68f('0x6'))['db'];var config=require(_0xd68f('0x7'));var pm2=require(_0xd68f('0x8'));var logger=require(_0xd68f('0x9'))(_0xd68f('0xa'));var git=require(_0xd68f('0xb'))(config['root']);exports[_0xd68f('0xc')]=function(_0x182353,_0x26f6ca){var _0x22c199={'current':module[_0xd68f('0xd')][_0xd68f('0xe')],'phonebar':0x2};if(_0x182353[_0xd68f('0xf')]&&_0x182353['query']['latest']){return git[_0xd68f('0x10')]()['tags'](function(_0x114bda,_0x41a7e7){_0x22c199[_0xd68f('0x11')]=(_0x114bda?module[_0xd68f('0xd')][_0xd68f('0xe')]:_0x41a7e7[_0xd68f('0x11')])||_0xd68f('0x12');return _0x26f6ca['status'](0xc8)['json'](_0x22c199);});}else{return _0x26f6ca['status'](0xc8)['json'](_0x22c199);}};exports[_0xd68f('0x10')]=function(_0x305c19,_0x48f357){return git[_0xd68f('0x10')]([_0xd68f('0x13'),_0xd68f('0x14')],function(_0x36441f){if(_0x36441f){logger[_0xd68f('0x15')](_0x36441f);return _0x48f357[_0xd68f('0x16')](0x1f4)[_0xd68f('0x17')](_0x36441f);}logger['info'](_0xd68f('0x18'));return _0x48f357['status'](0xc8)['json']({'output':_0xd68f('0x19')});});};exports[_0xd68f('0x1a')]=function(_0x451450,_0x3fdfbf){return git[_0xd68f('0x1a')]([_0xd68f('0x1b'),_0xd68f('0x1c')],function(_0x47fdbc){if(_0x47fdbc){logger['error'](_0x47fdbc);return _0x3fdfbf[_0xd68f('0x16')](0x1f4)[_0xd68f('0x17')](_0x47fdbc);}logger[_0xd68f('0x1d')](_0xd68f('0x1e'));return _0x3fdfbf[_0xd68f('0x16')](0xc8)['json']({'output':_0xd68f('0x1f')});});};exports[_0xd68f('0x20')]=function(_0x3fbc0b,_0x4e00c0){exec(_0xd68f('0x21'),function(_0x1379e2,_0xeba444,_0x590e04){logger['info'](_0xeba444);logger[_0xd68f('0x1d')](_0x590e04);if(_0x1379e2){logger['error'](_0x1379e2);return _0x4e00c0['status'](0x1f4)[_0xd68f('0x17')](_0x1379e2);}return _0x4e00c0[_0xd68f('0x16')](0xc8)[_0xd68f('0x17')]({'output':_0xeba444});});};exports[_0xd68f('0x22')]=function(_0x4595bf,_0x434fde){return pm2[_0xd68f('0x22')](_0xd68f('0x23'))[_0xd68f('0x24')](function(_0x2d2df4){logger[_0xd68f('0x1d')](_0xd68f('0x25'),_0x2d2df4);return _0x434fde[_0xd68f('0x16')](0xc8)['json']({'output':_0xd68f('0x26')});})[_0xd68f('0x27')](function(_0x4b1515){logger[_0xd68f('0x15')](_0x4b1515);return _0x434fde['status'](0x1f4)['json'](_0x4b1515);});};exports[_0xd68f('0x28')]=function(_0x42f8d2,_0x1eaebc){var _0x52a2dc=fs[_0xd68f('0x29')](path['join'](config[_0xd68f('0x2a')],'server',_0xd68f('0x28')));var _0x2dd737=[];for(var _0x426ad2=0x0;_0x426ad2<_0x52a2dc[_0xd68f('0x2b')];_0x426ad2++){var _0x38df7f=_0x52a2dc[_0x426ad2]['replace'](_0xd68f('0x2c'),'');if(compareVersions(module['exports'][_0xd68f('0xe')],_0x38df7f)===-0x1){_0x2dd737['push'](_0x38df7f);}}if(_0x2dd737[_0xd68f('0x2b')]){var _0x2d3b04=_0x2dd737[_0xd68f('0x2d')](compareVersions);var _0x1f6266=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xd68f('0x2e')],'modelName':_0xd68f('0x2e'),'columnName':_0xd68f('0xe')},'migrations':{'params':[db[_0xd68f('0x2f')]['getQueryInterface'](),db[_0xd68f('0x2f')][_0xd68f('0x30')],function(){throw new Error(_0xd68f('0x31'));}],'path':path[_0xd68f('0x32')](config[_0xd68f('0x2a')],_0xd68f('0x33'),_0xd68f('0x28')),'pattern':/\.js$/}});_0x1f6266['up']({'migrations':_[_0xd68f('0x34')](_0x2d3b04,function(_0x5590e0){return _0x5590e0+_0xd68f('0x2c');})})[_0xd68f('0x24')](function(){return _0x1eaebc[_0xd68f('0x16')](0xc8)[_0xd68f('0x17')]({'output':_0xd68f('0x35')+module[_0xd68f('0xd')][_0xd68f('0xe')]+_0xd68f('0x36')+_['last'](_0x2d3b04),'migrations':_[_0xd68f('0x32')](_0x2d3b04)});})[_0xd68f('0x27')](function(_0x13f773){if(_0x13f773 instanceof db[_0xd68f('0x2f')][_0xd68f('0x37')]){return _0x1eaebc['status'](0xc8)[_0xd68f('0x17')]({'output':_0xd68f('0x38')});}else{return _0x1eaebc[_0xd68f('0x16')](0x1f4)[_0xd68f('0x17')](_0x13f773);}});}else{return _0x1eaebc[_0xd68f('0x16')](0xc8)[_0xd68f('0x17')]({'output':_0xd68f('0x38')});}};
\ No newline at end of file
+var _0x5324=['sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','exports','version','query','latest','fetch','tags','2.0.0','status','json','origin','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','replace','.js','push','length'];(function(_0x5d7583,_0x48a446){var _0x1e615c=function(_0x145946){while(--_0x145946){_0x5d7583['push'](_0x5d7583['shift']());}};_0x1e615c(++_0x48a446);}(_0x5324,0x154));var _0x4532=function(_0x1cc1b2,_0x33fe5d){_0x1cc1b2=_0x1cc1b2-0x0;var _0x48adf6=_0x5324[_0x1cc1b2];return _0x48adf6;};'use strict';var Umzug=require(_0x4532('0x0'));var path=require(_0x4532('0x1'));var fs=require('fs');var _=require(_0x4532('0x2'));var pkginfo=require(_0x4532('0x3'))(module,'version');var compareVersions=require(_0x4532('0x4'));var exec=require('child_process')[_0x4532('0x5')];var db=require(_0x4532('0x6'))['db'];var config=require(_0x4532('0x7'));var pm2=require(_0x4532('0x8'));var logger=require(_0x4532('0x9'))(_0x4532('0xa'));var git=require(_0x4532('0xb'))(config[_0x4532('0xc')]);exports['index']=function(_0x3b9865,_0x455819){var _0x138aac={'current':module[_0x4532('0xd')][_0x4532('0xe')],'phonebar':0x2};if(_0x3b9865[_0x4532('0xf')]&&_0x3b9865[_0x4532('0xf')][_0x4532('0x10')]){return git[_0x4532('0x11')]()[_0x4532('0x12')](function(_0x314e97,_0xfabd65){_0x138aac['latest']=(_0x314e97?module['exports'][_0x4532('0xe')]:_0xfabd65['latest'])||_0x4532('0x13');return _0x455819[_0x4532('0x14')](0xc8)[_0x4532('0x15')](_0x138aac);});}else{return _0x455819[_0x4532('0x14')](0xc8)['json'](_0x138aac);}};exports[_0x4532('0x11')]=function(_0x167859,_0x39acf3){return git[_0x4532('0x11')]([_0x4532('0x16'),'master'],function(_0x59075c){if(_0x59075c){logger['error'](_0x59075c);return _0x39acf3[_0x4532('0x14')](0x1f4)[_0x4532('0x15')](_0x59075c);}logger[_0x4532('0x17')](_0x4532('0x18'));return _0x39acf3[_0x4532('0x14')](0xc8)[_0x4532('0x15')]({'output':_0x4532('0x19')});});};exports[_0x4532('0x1a')]=function(_0xd479a9,_0x4db2a1){return git[_0x4532('0x1a')]([_0x4532('0x1b'),_0x4532('0x1c')],function(_0x530ce0){if(_0x530ce0){logger[_0x4532('0x1d')](_0x530ce0);return _0x4db2a1[_0x4532('0x14')](0x1f4)['json'](_0x530ce0);}logger[_0x4532('0x17')](_0x4532('0x1e'));return _0x4db2a1[_0x4532('0x14')](0xc8)[_0x4532('0x15')]({'output':_0x4532('0x1f')});});};exports[_0x4532('0x20')]=function(_0x6a669f,_0x53127c){exec('npm\x20install\x20--production',function(_0x94b670,_0x46dc73,_0x481c26){logger[_0x4532('0x17')](_0x46dc73);logger[_0x4532('0x17')](_0x481c26);if(_0x94b670){logger[_0x4532('0x1d')](_0x94b670);return _0x53127c[_0x4532('0x14')](0x1f4)['json'](_0x94b670);}return _0x53127c[_0x4532('0x14')](0xc8)['json']({'output':_0x46dc73});});};exports[_0x4532('0x21')]=function(_0x9353c0,_0x16e2c4){return pm2[_0x4532('0x21')](_0x4532('0x22'))[_0x4532('0x23')](function(_0x105338){logger[_0x4532('0x17')]('pm2\x20restart\x20motion\x20%s',_0x105338);return _0x16e2c4['status'](0xc8)[_0x4532('0x15')]({'output':_0x4532('0x24')});})[_0x4532('0x25')](function(_0x19f85c){logger[_0x4532('0x1d')](_0x19f85c);return _0x16e2c4[_0x4532('0x14')](0x1f4)['json'](_0x19f85c);});};exports[_0x4532('0x26')]=function(_0x239e85,_0x11d163){var _0x16836c=fs[_0x4532('0x27')](path['join'](config[_0x4532('0xc')],_0x4532('0x28'),_0x4532('0x26')));var _0x523f96=[];for(var _0x58602d=0x0;_0x58602d<_0x16836c['length'];_0x58602d++){var _0x3e4c89=_0x16836c[_0x58602d][_0x4532('0x29')](_0x4532('0x2a'),'');if(compareVersions(module[_0x4532('0xd')][_0x4532('0xe')],_0x3e4c89)===-0x1){_0x523f96[_0x4532('0x2b')](_0x3e4c89);}}if(_0x523f96[_0x4532('0x2c')]){var _0x4a119b=_0x523f96['sort'](compareVersions);var _0xb7b6d2=new Umzug({'storage':_0x4532('0x2d'),'storageOptions':{'model':db['Migration'],'modelName':_0x4532('0x2e'),'columnName':_0x4532('0xe')},'migrations':{'params':[db[_0x4532('0x2d')][_0x4532('0x2f')](),db[_0x4532('0x2d')][_0x4532('0x30')],function(){throw new Error(_0x4532('0x31'));}],'path':path[_0x4532('0x32')](config['root'],'server',_0x4532('0x26')),'pattern':/\.js$/}});_0xb7b6d2['up']({'migrations':_[_0x4532('0x33')](_0x4a119b,function(_0x53e03e){return _0x53e03e+_0x4532('0x2a');})})[_0x4532('0x23')](function(){return _0x11d163[_0x4532('0x14')](0xc8)[_0x4532('0x15')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x4532('0xd')]['version']+_0x4532('0x34')+_['last'](_0x4a119b),'migrations':_[_0x4532('0x32')](_0x4a119b)});})[_0x4532('0x25')](function(_0x32597a){if(_0x32597a instanceof db[_0x4532('0x2d')][_0x4532('0x35')]){return _0x11d163[_0x4532('0x14')](0xc8)[_0x4532('0x15')]({'output':_0x4532('0x36')});}else{return _0x11d163[_0x4532('0x14')](0x1f4)[_0x4532('0x15')](_0x32597a);}});}else{return _0x11d163[_0x4532('0x14')](0xc8)['json']({'output':_0x4532('0x36')});}};
\ No newline at end of file
index 3083d1f..5cdd662 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7124=['../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','exports','path','connect-timeout','express','Router'];(function(_0x46b756,_0x3ab820){var _0x3ec4ea=function(_0x26f76f){while(--_0x26f76f){_0x46b756['push'](_0x46b756['shift']());}};_0x3ec4ea(++_0x3ab820);}(_0x7124,0xc2));var _0x4712=function(_0x173452,_0x3aa870){_0x173452=_0x173452-0x0;var _0xee3fd0=_0x7124[_0x173452];return _0xee3fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4712('0x0'));var timeout=require(_0x4712('0x1'));var express=require(_0x4712('0x2'));var router=express[_0x4712('0x3')]();var auth=require(_0x4712('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4712('0x5'));var controller=require(_0x4712('0x6'));router[_0x4712('0x7')]('/',auth[_0x4712('0x8')](),controller['index']);router[_0x4712('0x7')](_0x4712('0x9'),auth[_0x4712('0x8')](),controller[_0x4712('0xa')]);router['get'](_0x4712('0xb'),auth['isAuthenticated'](),controller[_0x4712('0xc')]);router[_0x4712('0xd')]('/',auth[_0x4712('0x8')](),controller[_0x4712('0xe')]);router[_0x4712('0xf')](_0x4712('0xb'),auth[_0x4712('0x8')](),controller['update']);router[_0x4712('0x10')](_0x4712('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4712('0x11')]=router;
\ No newline at end of file
+var _0xa221=['../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','/describe','isAuthenticated','describe','show','post','create','update','delete','/:id','destroy','multer','connect-timeout','Router'];(function(_0x5cb7dd,_0x2e9c56){var _0x445713=function(_0x2d1e4d){while(--_0x2d1e4d){_0x5cb7dd['push'](_0x5cb7dd['shift']());}};_0x445713(++_0x2e9c56);}(_0xa221,0x96));var _0x1a22=function(_0x3c6bb3,_0x55333b){_0x3c6bb3=_0x3c6bb3-0x0;var _0x43c339=_0xa221[_0x3c6bb3];return _0x43c339;};'use strict';var multer=require(_0x1a22('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1a22('0x1'));var express=require('express');var router=express[_0x1a22('0x2')]();var auth=require(_0x1a22('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1a22('0x4'));var controller=require(_0x1a22('0x5'));router[_0x1a22('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1a22('0x6')](_0x1a22('0x7'),auth[_0x1a22('0x8')](),controller[_0x1a22('0x9')]);router[_0x1a22('0x6')]('/:id',auth[_0x1a22('0x8')](),controller[_0x1a22('0xa')]);router[_0x1a22('0xb')]('/',auth[_0x1a22('0x8')](),controller[_0x1a22('0xc')]);router['put']('/:id',auth[_0x1a22('0x8')](),controller[_0x1a22('0xd')]);router[_0x1a22('0xe')](_0x1a22('0xf'),auth['isAuthenticated'](),controller[_0x1a22('0x10')]);module['exports']=router;
\ No newline at end of file
index 01e2430..d57ecc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x2ab392,_0x25b98f){var _0x2c1a96=function(_0x592be3){while(--_0x592be3){_0x2ab392['push'](_0x2ab392['shift']());}};_0x2c1a96(++_0x25b98f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x192720,_0x12ae5c){_0x192720=_0x192720-0x0;var _0x4fe058=_0x1cb9[_0x192720];return _0x4fe058;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'type':{'type':Sequelize[_0x91cb('0x1')]},'uniqueid':{'type':Sequelize[_0x91cb('0x1')]},'calleridnum':{'type':Sequelize[_0x91cb('0x1')]},'calleridname':{'type':Sequelize[_0x91cb('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x91cb('0x1')]},'membername':{'type':Sequelize[_0x91cb('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x91cb('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x91cb('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x91cb('0x2')]},'agentdumpAt':{'type':Sequelize[_0x91cb('0x2')]},'holdtime':{'type':Sequelize[_0x91cb('0x3')]},'agentcomplete':{'type':Sequelize[_0x91cb('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x91cb('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x91cb('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x91cb('0x1')]},'lastevent':{'type':Sequelize[_0x91cb('0x1')]},'channel':{'type':Sequelize[_0x91cb('0x1')]},'channelstate':{'type':Sequelize[_0x91cb('0x3')]},'channelstatedesc':{'type':Sequelize[_0x91cb('0x1')]},'connectedlinenum':{'type':Sequelize[_0x91cb('0x1')]},'connectedlinename':{'type':Sequelize[_0x91cb('0x1')]},'language':{'type':Sequelize[_0x91cb('0x1')]},'accountcode':{'type':Sequelize[_0x91cb('0x1')]},'context':{'type':Sequelize[_0x91cb('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x91cb('0x1')]},'destchannel':{'type':Sequelize[_0x91cb('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x91cb('0x1')]},'destcalleridnum':{'type':Sequelize[_0x91cb('0x1')]},'destcalleridname':{'type':Sequelize[_0x91cb('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x91cb('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x91cb('0x1')]},'destcontext':{'type':Sequelize[_0x91cb('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x91cb('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x91cb('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x91cb('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x91cb('0x1')],'comment':_0x91cb('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x91cb('0x1')]},'agententerreason':{'type':Sequelize[_0x91cb('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x33c5=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','INTEGER'];(function(_0x2cec15,_0x486654){var _0x8d85ac=function(_0x244715){while(--_0x244715){_0x2cec15['push'](_0x2cec15['shift']());}};_0x8d85ac(++_0x486654);}(_0x33c5,0xe6));var _0x533c=function(_0x48f038,_0x2bde84){_0x48f038=_0x48f038-0x0;var _0x2edc62=_0x33c5[_0x48f038];return _0x2edc62;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'type':{'type':Sequelize[_0x533c('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x533c('0x1')]},'calleridname':{'type':Sequelize[_0x533c('0x1')]},'queue':{'type':Sequelize[_0x533c('0x1')]},'interface':{'type':Sequelize[_0x533c('0x1')]},'membername':{'type':Sequelize[_0x533c('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x533c('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x533c('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x533c('0x2')]},'agentdumpAt':{'type':Sequelize[_0x533c('0x2')]},'holdtime':{'type':Sequelize[_0x533c('0x3')]},'agentcomplete':{'type':Sequelize[_0x533c('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x533c('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x533c('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x533c('0x3')]},'agentacw':{'type':Sequelize[_0x533c('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x533c('0x3')]},'reason':{'type':Sequelize[_0x533c('0x1')]},'lastevent':{'type':Sequelize[_0x533c('0x1')]},'channel':{'type':Sequelize[_0x533c('0x1')]},'channelstate':{'type':Sequelize[_0x533c('0x3')]},'channelstatedesc':{'type':Sequelize[_0x533c('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x533c('0x1')]},'language':{'type':Sequelize[_0x533c('0x1')]},'accountcode':{'type':Sequelize[_0x533c('0x1')]},'context':{'type':Sequelize[_0x533c('0x1')]},'exten':{'type':Sequelize[_0x533c('0x1')]},'priority':{'type':Sequelize[_0x533c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x533c('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x533c('0x1')]},'destcalleridnum':{'type':Sequelize[_0x533c('0x1')]},'destcalleridname':{'type':Sequelize[_0x533c('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x533c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x533c('0x1')]},'destlanguage':{'type':Sequelize[_0x533c('0x1')]},'destaccountcode':{'type':Sequelize[_0x533c('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x533c('0x1')]},'destpriority':{'type':Sequelize[_0x533c('0x1')]},'destuniqueid':{'type':Sequelize[_0x533c('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x533c('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x533c('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x533c('0x1')],'comment':_0x533c('0x5')},'transferexten':{'type':Sequelize[_0x533c('0x1')]},'transferuniqueid':{'type':Sequelize[_0x533c('0x1')]},'agententerreason':{'type':Sequelize[_0x533c('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 45fcbc6..2ff485c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f80=['destroy','sendStatus','error','stack','name','send','index','map','VoiceAgentReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','limit','set','Content-Range','json','apply','save','update','then'];(function(_0x59166d,_0x415c2d){var _0x2184e1=function(_0xb7af45){while(--_0xb7af45){_0x59166d['push'](_0x59166d['shift']());}};_0x2184e1(++_0x415c2d);}(_0x5f80,0x1dd));var _0x05f8=function(_0x1e4638,_0x98fe2d){_0x1e4638=_0x1e4638-0x0;var _0x2c5a34=_0x5f80[_0x1e4638];return _0x2c5a34;};'use strict';var pdf=require(_0x05f8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x05f8('0x1'));var zipdir=require(_0x05f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x05f8('0x3'));var BPromise=require(_0x05f8('0x4'));var Mustache=require(_0x05f8('0x5'));var util=require('util');var path=require(_0x05f8('0x6'));var sox=require(_0x05f8('0x7'));var csv=require(_0x05f8('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x05f8('0x9'));var squel=require(_0x05f8('0xa'));var crypto=require(_0x05f8('0xb'));var jsforce=require(_0x05f8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x05f8('0x8'));var querystring=require(_0x05f8('0xd'));var Papa=require(_0x05f8('0xe'));var Redis=require(_0x05f8('0xf'));var authService=require(_0x05f8('0x10'));var qs=require(_0x05f8('0x11'));var as=require(_0x05f8('0x12'));var hardwareService=require(_0x05f8('0x13'));var logger=require(_0x05f8('0x14'))(_0x05f8('0x15'));var utils=require(_0x05f8('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31b73c,_0x4998fc){_0x4998fc=_0x4998fc||0xcc;return function(_0x4a1912){if(_0x4a1912){return _0x31b73c['sendStatus'](_0x4998fc);}return _0x31b73c[_0x05f8('0x17')](_0x4998fc)[_0x05f8('0x18')]();};}function respondWithResult(_0x4c857e,_0x5f5b37){_0x5f5b37=_0x5f5b37||0xc8;return function(_0xc1ba0c){if(_0xc1ba0c){return _0x4c857e[_0x05f8('0x17')](_0x5f5b37)['json'](_0xc1ba0c);}};}function respondWithFilteredResult(_0xaede42,_0x124bc9){return function(_0x285f2c){if(_0x285f2c){var _0x5e4989=_0x285f2c['count'],_0x914a41=_0x124bc9[_0x05f8('0x19')],_0x1c42c2=_0x124bc9['offset']+_0x124bc9[_0x05f8('0x1a')],_0x10d877;if(_0x1c42c2>=_0x5e4989){_0x1c42c2=_0x5e4989;_0x10d877=0xc8;}else{_0x10d877=0xce;}_0xaede42[_0x05f8('0x17')](_0x10d877);return _0xaede42[_0x05f8('0x1b')](_0x05f8('0x1c'),_0x914a41+'-'+_0x1c42c2+'/'+_0x5e4989)[_0x05f8('0x1d')](_0x285f2c);}return null;};}function patchUpdates(_0x1f932e){return function(_0x240aac){try{jsonpatch[_0x05f8('0x1e')](_0x240aac,_0x1f932e,!![]);}catch(_0x284aee){return BPromise['reject'](_0x284aee);}return _0x240aac[_0x05f8('0x1f')]();};}function saveUpdates(_0x346e3f,_0x328d70){return function(_0x51a552){if(_0x51a552){return _0x51a552[_0x05f8('0x20')](_0x346e3f)[_0x05f8('0x21')](function(_0x27b25b){return _0x27b25b;});}return null;};}function removeEntity(_0x276bb3,_0x46d879){return function(_0xf22666){if(_0xf22666){return _0xf22666[_0x05f8('0x22')]()[_0x05f8('0x21')](function(){_0x276bb3[_0x05f8('0x17')](0xcc)[_0x05f8('0x18')]();});}};}function handleEntityNotFound(_0x43fbc5,_0x462838){return function(_0x2c70e3){if(!_0x2c70e3){_0x43fbc5[_0x05f8('0x23')](0x194);}return _0x2c70e3;};}function handleError(_0x4d272a,_0x13c54d){_0x13c54d=_0x13c54d||0x1f4;return function(_0x28ce9f){logger[_0x05f8('0x24')](_0x28ce9f[_0x05f8('0x25')]);if(_0x28ce9f[_0x05f8('0x26')]){delete _0x28ce9f[_0x05f8('0x26')];}_0x4d272a[_0x05f8('0x17')](_0x13c54d)[_0x05f8('0x27')](_0x28ce9f);};}exports[_0x05f8('0x28')]=function(_0x46d1a9,_0x3a7fba){var _0x3176ac={},_0xdbb2f5={},_0x39ddfe={'count':0x0,'rows':[]};var _0x5b9d53=_[_0x05f8('0x29')](db[_0x05f8('0x2a')]['rawAttributes'],function(_0x36a7d1){return{'name':_0x36a7d1[_0x05f8('0x2b')],'type':_0x36a7d1['type'][_0x05f8('0x2c')]};});_0xdbb2f5[_0x05f8('0x2d')]=_[_0x05f8('0x29')](_0x5b9d53,_0x05f8('0x26'));_0xdbb2f5[_0x05f8('0x2e')]=_[_0x05f8('0x2f')](_0x46d1a9[_0x05f8('0x2e')]);_0xdbb2f5[_0x05f8('0x30')]=_[_0x05f8('0x31')](_0xdbb2f5[_0x05f8('0x2d')],_0xdbb2f5['query']);_0x3176ac[_0x05f8('0x32')]=_['intersection'](_0xdbb2f5[_0x05f8('0x2d')],qs['fields'](_0x46d1a9['query'][_0x05f8('0x33')]));_0x3176ac[_0x05f8('0x32')]=_0x3176ac['attributes'][_0x05f8('0x34')]?_0x3176ac[_0x05f8('0x32')]:_0xdbb2f5[_0x05f8('0x2d')];if(!_0x46d1a9[_0x05f8('0x2e')][_0x05f8('0x35')]('nolimit')){_0x3176ac[_0x05f8('0x1a')]=qs[_0x05f8('0x1a')](_0x46d1a9[_0x05f8('0x2e')][_0x05f8('0x1a')]);_0x3176ac[_0x05f8('0x19')]=qs[_0x05f8('0x19')](_0x46d1a9[_0x05f8('0x2e')][_0x05f8('0x19')]);}_0x3176ac[_0x05f8('0x36')]=qs[_0x05f8('0x37')](_0x46d1a9[_0x05f8('0x2e')][_0x05f8('0x37')]);_0x3176ac[_0x05f8('0x38')]=qs[_0x05f8('0x30')](_['pick'](_0x46d1a9[_0x05f8('0x2e')],_0xdbb2f5[_0x05f8('0x30')]),_0x5b9d53);if(_0x46d1a9[_0x05f8('0x2e')][_0x05f8('0x39')]){_0x3176ac[_0x05f8('0x38')]=_[_0x05f8('0x3a')](_0x3176ac['where'],{'$or':_['map'](_0x5b9d53,function(_0x6d9f3d){if(_0x6d9f3d[_0x05f8('0x3b')]!=='VIRTUAL'){var _0x2d3e33={};_0x2d3e33[_0x6d9f3d[_0x05f8('0x26')]]={'$like':'%'+_0x46d1a9['query'][_0x05f8('0x39')]+'%'};return _0x2d3e33;}})});}_0x3176ac=_[_0x05f8('0x3a')]({},_0x3176ac,_0x46d1a9[_0x05f8('0x3c')]);var _0x31d936={'where':_0x3176ac[_0x05f8('0x38')]};return db['VoiceAgentReport']['count'](_0x31d936)[_0x05f8('0x21')](function(_0x4ec369){_0x39ddfe[_0x05f8('0x3d')]=_0x4ec369;if(_0x46d1a9['query'][_0x05f8('0x3e')]){_0x3176ac[_0x05f8('0x3f')]=[{'all':!![]}];}return db[_0x05f8('0x2a')][_0x05f8('0x40')](_0x3176ac);})['then'](function(_0x3ea5a8){_0x39ddfe[_0x05f8('0x41')]=_0x3ea5a8;return _0x39ddfe;})['then'](respondWithFilteredResult(_0x3a7fba,_0x3176ac))[_0x05f8('0x42')](handleError(_0x3a7fba,null));};exports[_0x05f8('0x43')]=function(_0x5df9fd,_0x327e3e){var _0x1463a7={'raw':![],'where':{'id':_0x5df9fd['params']['id']}},_0x1c3898={};_0x1c3898[_0x05f8('0x2d')]=_[_0x05f8('0x2f')](db[_0x05f8('0x2a')]['rawAttributes']);_0x1c3898[_0x05f8('0x2e')]=_[_0x05f8('0x2f')](_0x5df9fd[_0x05f8('0x2e')]);_0x1c3898[_0x05f8('0x30')]=_['intersection'](_0x1c3898[_0x05f8('0x2d')],_0x1c3898[_0x05f8('0x2e')]);_0x1463a7[_0x05f8('0x32')]=_['intersection'](_0x1c3898['model'],qs[_0x05f8('0x33')](_0x5df9fd[_0x05f8('0x2e')][_0x05f8('0x33')]));_0x1463a7[_0x05f8('0x32')]=_0x1463a7[_0x05f8('0x32')]['length']?_0x1463a7[_0x05f8('0x32')]:_0x1c3898[_0x05f8('0x2d')];if(_0x5df9fd[_0x05f8('0x2e')][_0x05f8('0x3e')]){_0x1463a7[_0x05f8('0x3f')]=[{'all':!![]}];}_0x1463a7=_[_0x05f8('0x3a')]({},_0x1463a7,_0x5df9fd[_0x05f8('0x3c')]);return db[_0x05f8('0x2a')][_0x05f8('0x44')](_0x1463a7)[_0x05f8('0x21')](handleEntityNotFound(_0x327e3e,null))[_0x05f8('0x21')](respondWithResult(_0x327e3e,null))[_0x05f8('0x42')](handleError(_0x327e3e,null));};exports[_0x05f8('0x45')]=function(_0x3ccae3,_0x3e4ba3){return db['VoiceAgentReport']['create'](_0x3ccae3['body'],{})[_0x05f8('0x21')](respondWithResult(_0x3e4ba3,0xc9))[_0x05f8('0x42')](handleError(_0x3e4ba3,null));};exports[_0x05f8('0x20')]=function(_0x49dbb4,_0x1bb1cd){if(_0x49dbb4['body']['id']){delete _0x49dbb4[_0x05f8('0x46')]['id'];}return db[_0x05f8('0x2a')][_0x05f8('0x44')]({'where':{'id':_0x49dbb4[_0x05f8('0x47')]['id']}})[_0x05f8('0x21')](handleEntityNotFound(_0x1bb1cd,null))['then'](saveUpdates(_0x49dbb4[_0x05f8('0x46')],null))[_0x05f8('0x21')](respondWithResult(_0x1bb1cd,null))[_0x05f8('0x42')](handleError(_0x1bb1cd,null));};exports[_0x05f8('0x22')]=function(_0x13dcd1,_0x33a3cd){return db[_0x05f8('0x2a')]['find']({'where':{'id':_0x13dcd1['params']['id']}})[_0x05f8('0x21')](handleEntityNotFound(_0x33a3cd,null))[_0x05f8('0x21')](removeEntity(_0x33a3cd,null))[_0x05f8('0x42')](handleError(_0x33a3cd,null));};exports[_0x05f8('0x48')]=function(_0x23cfed,_0x4afdc1){return db[_0x05f8('0x2a')][_0x05f8('0x48')]()[_0x05f8('0x21')](respondWithResult(_0x4afdc1,null))['catch'](handleError(_0x4afdc1,null));};
\ No newline at end of file
+var _0x8483=['path','sox','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','VoiceAgentReport','findAll','rows','catch','params','include','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util'];(function(_0x4b0259,_0x41d4fc){var _0x4a3f85=function(_0x53f1ff){while(--_0x53f1ff){_0x4b0259['push'](_0x4b0259['shift']());}};_0x4a3f85(++_0x41d4fc);}(_0x8483,0x85));var _0x3848=function(_0x13b417,_0x5691b9){_0x13b417=_0x13b417-0x0;var _0x2ea0a2=_0x8483[_0x13b417];return _0x2ea0a2;};'use strict';var pdf=require(_0x3848('0x0'));var emlformat=require(_0x3848('0x1'));var rimraf=require(_0x3848('0x2'));var zipdir=require(_0x3848('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3848('0x4'));var Mustache=require(_0x3848('0x5'));var util=require(_0x3848('0x6'));var path=require(_0x3848('0x7'));var sox=require(_0x3848('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3848('0x9'));var crypto=require(_0x3848('0xa'));var jsforce=require(_0x3848('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3848('0xc'));var querystring=require('querystring');var Papa=require(_0x3848('0xd'));var Redis=require(_0x3848('0xe'));var authService=require(_0x3848('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3848('0x10'));var logger=require(_0x3848('0x11'))(_0x3848('0x12'));var utils=require(_0x3848('0x13'));var config=require(_0x3848('0x14'));var db=require(_0x3848('0x15'))['db'];function respondWithStatusCode(_0x1e16b2,_0x39b72d){_0x39b72d=_0x39b72d||0xcc;return function(_0x3cfcd8){if(_0x3cfcd8){return _0x1e16b2[_0x3848('0x16')](_0x39b72d);}return _0x1e16b2['status'](_0x39b72d)['end']();};}function respondWithResult(_0x2c5af1,_0x352a9d){_0x352a9d=_0x352a9d||0xc8;return function(_0x5bb139){if(_0x5bb139){return _0x2c5af1[_0x3848('0x17')](_0x352a9d)['json'](_0x5bb139);}};}function respondWithFilteredResult(_0x310945,_0x44089d){return function(_0x109dbc){if(_0x109dbc){var _0x569c2d=_0x109dbc[_0x3848('0x18')],_0xcde4cc=_0x44089d[_0x3848('0x19')],_0x449fdc=_0x44089d[_0x3848('0x19')]+_0x44089d[_0x3848('0x1a')],_0xd02b29;if(_0x449fdc>=_0x569c2d){_0x449fdc=_0x569c2d;_0xd02b29=0xc8;}else{_0xd02b29=0xce;}_0x310945[_0x3848('0x17')](_0xd02b29);return _0x310945[_0x3848('0x1b')](_0x3848('0x1c'),_0xcde4cc+'-'+_0x449fdc+'/'+_0x569c2d)['json'](_0x109dbc);}return null;};}function patchUpdates(_0x8d68cb){return function(_0x39bcbd){try{jsonpatch[_0x3848('0x1d')](_0x39bcbd,_0x8d68cb,!![]);}catch(_0x100604){return BPromise['reject'](_0x100604);}return _0x39bcbd[_0x3848('0x1e')]();};}function saveUpdates(_0x19bf45,_0x7fc5fb){return function(_0x2ef388){if(_0x2ef388){return _0x2ef388['update'](_0x19bf45)[_0x3848('0x1f')](function(_0x19dd14){return _0x19dd14;});}return null;};}function removeEntity(_0x505bee,_0x158147){return function(_0x261ef1){if(_0x261ef1){return _0x261ef1[_0x3848('0x20')]()['then'](function(){_0x505bee[_0x3848('0x17')](0xcc)[_0x3848('0x21')]();});}};}function handleEntityNotFound(_0xe0947b,_0x47ad3c){return function(_0x39c099){if(!_0x39c099){_0xe0947b[_0x3848('0x16')](0x194);}return _0x39c099;};}function handleError(_0x2df70c,_0x304e62){_0x304e62=_0x304e62||0x1f4;return function(_0x3c30f2){logger[_0x3848('0x22')](_0x3c30f2[_0x3848('0x23')]);if(_0x3c30f2[_0x3848('0x24')]){delete _0x3c30f2[_0x3848('0x24')];}_0x2df70c[_0x3848('0x17')](_0x304e62)[_0x3848('0x25')](_0x3c30f2);};}exports[_0x3848('0x26')]=function(_0x3361ce,_0x171796){var _0x1da3bd={},_0x26c25e={},_0x16bedb={'count':0x0,'rows':[]};var _0x5487ab=_['map'](db['VoiceAgentReport'][_0x3848('0x27')],function(_0x30e20a){return{'name':_0x30e20a['fieldName'],'type':_0x30e20a[_0x3848('0x28')][_0x3848('0x29')]};});_0x26c25e[_0x3848('0x2a')]=_[_0x3848('0x2b')](_0x5487ab,'name');_0x26c25e[_0x3848('0x2c')]=_[_0x3848('0x2d')](_0x3361ce[_0x3848('0x2c')]);_0x26c25e[_0x3848('0x2e')]=_[_0x3848('0x2f')](_0x26c25e[_0x3848('0x2a')],_0x26c25e[_0x3848('0x2c')]);_0x1da3bd[_0x3848('0x30')]=_['intersection'](_0x26c25e[_0x3848('0x2a')],qs[_0x3848('0x31')](_0x3361ce[_0x3848('0x2c')][_0x3848('0x31')]));_0x1da3bd[_0x3848('0x30')]=_0x1da3bd[_0x3848('0x30')][_0x3848('0x32')]?_0x1da3bd['attributes']:_0x26c25e[_0x3848('0x2a')];if(!_0x3361ce[_0x3848('0x2c')][_0x3848('0x33')]('nolimit')){_0x1da3bd[_0x3848('0x1a')]=qs[_0x3848('0x1a')](_0x3361ce[_0x3848('0x2c')][_0x3848('0x1a')]);_0x1da3bd['offset']=qs['offset'](_0x3361ce[_0x3848('0x2c')][_0x3848('0x19')]);}_0x1da3bd[_0x3848('0x34')]=qs[_0x3848('0x35')](_0x3361ce[_0x3848('0x2c')][_0x3848('0x35')]);_0x1da3bd[_0x3848('0x36')]=qs[_0x3848('0x2e')](_['pick'](_0x3361ce[_0x3848('0x2c')],_0x26c25e[_0x3848('0x2e')]),_0x5487ab);if(_0x3361ce[_0x3848('0x2c')][_0x3848('0x37')]){_0x1da3bd[_0x3848('0x36')]=_[_0x3848('0x38')](_0x1da3bd[_0x3848('0x36')],{'$or':_[_0x3848('0x2b')](_0x5487ab,function(_0x45d67b){if(_0x45d67b['type']!==_0x3848('0x39')){var _0x122704={};_0x122704[_0x45d67b['name']]={'$like':'%'+_0x3361ce[_0x3848('0x2c')][_0x3848('0x37')]+'%'};return _0x122704;}})});}_0x1da3bd=_[_0x3848('0x38')]({},_0x1da3bd,_0x3361ce[_0x3848('0x3a')]);var _0xcf27f0={'where':_0x1da3bd[_0x3848('0x36')]};return db['VoiceAgentReport'][_0x3848('0x18')](_0xcf27f0)[_0x3848('0x1f')](function(_0x3687ff){_0x16bedb[_0x3848('0x18')]=_0x3687ff;if(_0x3361ce[_0x3848('0x2c')][_0x3848('0x3b')]){_0x1da3bd['include']=[{'all':!![]}];}return db[_0x3848('0x3c')][_0x3848('0x3d')](_0x1da3bd);})[_0x3848('0x1f')](function(_0x596601){_0x16bedb[_0x3848('0x3e')]=_0x596601;return _0x16bedb;})[_0x3848('0x1f')](respondWithFilteredResult(_0x171796,_0x1da3bd))[_0x3848('0x3f')](handleError(_0x171796,null));};exports['show']=function(_0x5c865a,_0x1dc709){var _0x2bc9f1={'raw':![],'where':{'id':_0x5c865a[_0x3848('0x40')]['id']}},_0x461882={};_0x461882[_0x3848('0x2a')]=_[_0x3848('0x2d')](db[_0x3848('0x3c')]['rawAttributes']);_0x461882['query']=_[_0x3848('0x2d')](_0x5c865a[_0x3848('0x2c')]);_0x461882[_0x3848('0x2e')]=_['intersection'](_0x461882['model'],_0x461882[_0x3848('0x2c')]);_0x2bc9f1[_0x3848('0x30')]=_[_0x3848('0x2f')](_0x461882[_0x3848('0x2a')],qs[_0x3848('0x31')](_0x5c865a['query'][_0x3848('0x31')]));_0x2bc9f1[_0x3848('0x30')]=_0x2bc9f1[_0x3848('0x30')][_0x3848('0x32')]?_0x2bc9f1[_0x3848('0x30')]:_0x461882[_0x3848('0x2a')];if(_0x5c865a[_0x3848('0x2c')][_0x3848('0x3b')]){_0x2bc9f1[_0x3848('0x41')]=[{'all':!![]}];}_0x2bc9f1=_[_0x3848('0x38')]({},_0x2bc9f1,_0x5c865a[_0x3848('0x3a')]);return db[_0x3848('0x3c')][_0x3848('0x42')](_0x2bc9f1)[_0x3848('0x1f')](handleEntityNotFound(_0x1dc709,null))['then'](respondWithResult(_0x1dc709,null))['catch'](handleError(_0x1dc709,null));};exports['create']=function(_0x24b35f,_0xeddc9f){return db['VoiceAgentReport'][_0x3848('0x43')](_0x24b35f[_0x3848('0x44')],{})[_0x3848('0x1f')](respondWithResult(_0xeddc9f,0xc9))[_0x3848('0x3f')](handleError(_0xeddc9f,null));};exports[_0x3848('0x45')]=function(_0x5b40ed,_0x169ec2){if(_0x5b40ed[_0x3848('0x44')]['id']){delete _0x5b40ed[_0x3848('0x44')]['id'];}return db[_0x3848('0x3c')][_0x3848('0x42')]({'where':{'id':_0x5b40ed['params']['id']}})['then'](handleEntityNotFound(_0x169ec2,null))[_0x3848('0x1f')](saveUpdates(_0x5b40ed[_0x3848('0x44')],null))['then'](respondWithResult(_0x169ec2,null))[_0x3848('0x3f')](handleError(_0x169ec2,null));};exports[_0x3848('0x20')]=function(_0x1a4ca9,_0xbd67e6){return db['VoiceAgentReport']['find']({'where':{'id':_0x1a4ca9[_0x3848('0x40')]['id']}})[_0x3848('0x1f')](handleEntityNotFound(_0xbd67e6,null))[_0x3848('0x1f')](removeEntity(_0xbd67e6,null))[_0x3848('0x3f')](handleError(_0xbd67e6,null));};exports['describe']=function(_0xca8477,_0x1618a9){return db[_0x3848('0x3c')]['describe']()[_0x3848('0x1f')](respondWithResult(_0x1618a9,null))[_0x3848('0x3f')](handleError(_0x1618a9,null));};
\ No newline at end of file
index 7b9e41b..096f1a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['report_agent','destuniqueid','../../config/logger','api','moment','bluebird','request-promise','path','./voiceAgentReport.attributes','define','VoiceAgentReport'];(function(_0xfd3a03,_0x232f89){var _0x3b3380=function(_0x2b59fc){while(--_0x2b59fc){_0xfd3a03['push'](_0xfd3a03['shift']());}};_0x3b3380(++_0x232f89);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x49c4('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x395bfe,_0x4db521){var _0x35c81c=function(_0x484a1b){while(--_0x484a1b){_0x395bfe['push'](_0x395bfe['shift']());}};_0x35c81c(++_0x4db521);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'fields':[_0x3071('0xc'),_0x3071('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index d2e8ebb..cdc058e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x761a=['VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','update','where','attributes','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','debug'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x761a,0x1b2));var _0xa761=function(_0x373ce6,_0x1a0131){_0x373ce6=_0x373ce6-0x0;var _0x49c3b3=_0x761a[_0x373ce6];return _0x49c3b3;};'use strict';var _=require(_0xa761('0x0'));var util=require(_0xa761('0x1'));var moment=require(_0xa761('0x2'));var BPromise=require(_0xa761('0x3'));var rs=require(_0xa761('0x4'));var fs=require('fs');var Redis=require(_0xa761('0x5'));var db=require(_0xa761('0x6'))['db'];var utils=require(_0xa761('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa761('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa761('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b8e50,_0x385a40,_0x10057a){return new BPromise(function(_0xa75c70,_0x1220c5){return client[_0xa761('0xa')](_0x3b8e50,_0x10057a)[_0xa761('0xb')](function(_0x1372ee){logger[_0xa761('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x385a40,'request\x20sent');logger[_0xa761('0xd')](_0xa761('0xe'),_0x385a40,'request\x20sent',JSON[_0xa761('0xf')](_0x1372ee));if(_0x1372ee[_0xa761('0x10')]){if(_0x1372ee[_0xa761('0x10')][_0xa761('0x11')]===0x1f4){logger[_0xa761('0x10')](_0xa761('0x12'),_0x385a40,_0x1372ee[_0xa761('0x10')]['message']);return _0x1220c5(_0x1372ee[_0xa761('0x10')][_0xa761('0x13')]);}logger[_0xa761('0x10')](_0xa761('0x12'),_0x385a40,_0x1372ee[_0xa761('0x10')]['message']);return _0xa75c70(_0x1372ee[_0xa761('0x10')][_0xa761('0x13')]);}else{logger[_0xa761('0xc')](_0xa761('0x12'),_0x385a40,_0xa761('0x14'));_0xa75c70(_0x1372ee[_0xa761('0x15')][_0xa761('0x13')]);}})[_0xa761('0x16')](function(_0x3f302d){logger[_0xa761('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x385a40,_0x3f302d);_0x1220c5(_0x3f302d);});});}exports[_0xa761('0x17')]=function(_0x3cfcea){var _0x1af2d7=this;return new Promise(function(_0x388912,_0xa43ffc){return db[_0xa761('0x18')][_0xa761('0x19')](_0x3cfcea[_0xa761('0x1a')],{'raw':_0x3cfcea[_0xa761('0x1b')]?_0x3cfcea[_0xa761('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xa761('0xb')](function(_0x46cfca){logger[_0xa761('0xc')]('CreateVoiceAgentReport',_0x3cfcea);logger['debug'](_0xa761('0x17'),_0x3cfcea,JSON['stringify'](_0x46cfca));_0x388912(_0x46cfca);})[_0xa761('0x16')](function(_0x1e413b){logger[_0xa761('0x10')](_0xa761('0x17'),_0x1e413b[_0xa761('0x13')],_0x3cfcea);_0xa43ffc(_0x1af2d7['error'](0x1f4,_0x1e413b[_0xa761('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x199abb){var _0x5df178=this;return new Promise(function(_0xda9c42,_0x3ad18b){return db[_0xa761('0x18')][_0xa761('0x1c')](_0x199abb[_0xa761('0x1a')],{'raw':_0x199abb[_0xa761('0x1b')]?_0x199abb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x199abb[_0xa761('0x1b')]?_0x199abb[_0xa761('0x1b')][_0xa761('0x1d')]||null:null,'attributes':_0x199abb['options']?_0x199abb[_0xa761('0x1b')][_0xa761('0x1e')]||null:null,'limit':_0x199abb[_0xa761('0x1b')]?_0x199abb[_0xa761('0x1b')]['limit']||null:null})[_0xa761('0xb')](function(_0x14a3d2){logger[_0xa761('0xc')](_0xa761('0x1f'),_0x199abb);logger[_0xa761('0xd')](_0xa761('0x1f'),_0x199abb,JSON[_0xa761('0xf')](_0x14a3d2));_0xda9c42(_0x14a3d2);})[_0xa761('0x16')](function(_0x532469){logger['error'](_0xa761('0x1f'),_0x532469[_0xa761('0x13')],_0x199abb);_0x3ad18b(_0x5df178[_0xa761('0x10')](0x1f4,_0x532469['message']));});});};
\ No newline at end of file
+var _0xffc9=['create','options','stringify','UpdateVoiceAgentReport','update','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateVoiceAgentReport','VoiceAgentReport'];(function(_0x3cc525,_0x597ac8){var _0x3f69fe=function(_0xde6d80){while(--_0xde6d80){_0x3cc525['push'](_0x3cc525['shift']());}};_0x3f69fe(++_0x597ac8);}(_0xffc9,0x151));var _0x9ffc=function(_0x20f37d,_0x20a575){_0x20f37d=_0x20f37d-0x0;var _0x35e958=_0xffc9[_0x20f37d];return _0x35e958;};'use strict';var _=require(_0x9ffc('0x0'));var util=require(_0x9ffc('0x1'));var moment=require('moment');var BPromise=require(_0x9ffc('0x2'));var rs=require(_0x9ffc('0x3'));var fs=require('fs');var Redis=require(_0x9ffc('0x4'));var db=require(_0x9ffc('0x5'))['db'];var utils=require(_0x9ffc('0x6'));var logger=require(_0x9ffc('0x7'))(_0x9ffc('0x8'));var config=require(_0x9ffc('0x9'));var jayson=require(_0x9ffc('0xa'));var client=jayson['client'][_0x9ffc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a3a4e,_0x241585,_0x5521ed){return new BPromise(function(_0x4371f4,_0x6daf6c){return client[_0x9ffc('0xc')](_0x4a3a4e,_0x5521ed)[_0x9ffc('0xd')](function(_0x565319){logger[_0x9ffc('0xe')](_0x9ffc('0xf'),_0x241585,'request\x20sent');logger[_0x9ffc('0x10')](_0x9ffc('0x11'),_0x241585,'request\x20sent',JSON['stringify'](_0x565319));if(_0x565319[_0x9ffc('0x12')]){if(_0x565319[_0x9ffc('0x12')][_0x9ffc('0x13')]===0x1f4){logger['error'](_0x9ffc('0xf'),_0x241585,_0x565319[_0x9ffc('0x12')]['message']);return _0x6daf6c(_0x565319[_0x9ffc('0x12')][_0x9ffc('0x14')]);}logger[_0x9ffc('0x12')](_0x9ffc('0xf'),_0x241585,_0x565319[_0x9ffc('0x12')][_0x9ffc('0x14')]);return _0x4371f4(_0x565319[_0x9ffc('0x12')][_0x9ffc('0x14')]);}else{logger['info'](_0x9ffc('0xf'),_0x241585,_0x9ffc('0x15'));_0x4371f4(_0x565319[_0x9ffc('0x16')][_0x9ffc('0x14')]);}})[_0x9ffc('0x17')](function(_0xdda002){logger[_0x9ffc('0x12')](_0x9ffc('0xf'),_0x241585,_0xdda002);_0x6daf6c(_0xdda002);});});}exports[_0x9ffc('0x18')]=function(_0x4d2d73){var _0x58c905=this;return new Promise(function(_0x361fee,_0x304534){return db[_0x9ffc('0x19')][_0x9ffc('0x1a')](_0x4d2d73['body'],{'raw':_0x4d2d73[_0x9ffc('0x1b')]?_0x4d2d73['options']['raw']===undefined?!![]:![]:!![]})[_0x9ffc('0xd')](function(_0x2dfa46){logger[_0x9ffc('0xe')]('CreateVoiceAgentReport',_0x4d2d73);logger[_0x9ffc('0x10')](_0x9ffc('0x18'),_0x4d2d73,JSON[_0x9ffc('0x1c')](_0x2dfa46));_0x361fee(_0x2dfa46);})[_0x9ffc('0x17')](function(_0x40c7f0){logger[_0x9ffc('0x12')](_0x9ffc('0x18'),_0x40c7f0[_0x9ffc('0x14')],_0x4d2d73);_0x304534(_0x58c905[_0x9ffc('0x12')](0x1f4,_0x40c7f0[_0x9ffc('0x14')]));});});};exports[_0x9ffc('0x1d')]=function(_0x2a8c45){var _0x1d3607=this;return new Promise(function(_0x40ddae,_0xca5bc3){return db[_0x9ffc('0x19')][_0x9ffc('0x1e')](_0x2a8c45['body'],{'raw':_0x2a8c45[_0x9ffc('0x1b')]?_0x2a8c45[_0x9ffc('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a8c45['options']?_0x2a8c45[_0x9ffc('0x1b')][_0x9ffc('0x1f')]||null:null,'attributes':_0x2a8c45[_0x9ffc('0x1b')]?_0x2a8c45[_0x9ffc('0x1b')][_0x9ffc('0x20')]||null:null,'limit':_0x2a8c45[_0x9ffc('0x1b')]?_0x2a8c45['options']['limit']||null:null})[_0x9ffc('0xd')](function(_0x39d2ab){logger[_0x9ffc('0xe')](_0x9ffc('0x1d'),_0x2a8c45);logger['debug'](_0x9ffc('0x1d'),_0x2a8c45,JSON['stringify'](_0x39d2ab));_0x40ddae(_0x39d2ab);})[_0x9ffc('0x17')](function(_0x9728e2){logger[_0x9ffc('0x12')](_0x9ffc('0x1d'),_0x9728e2[_0x9ffc('0x14')],_0x2a8c45);_0xca5bc3(_0x1d3607[_0x9ffc('0x12')](0x1f4,_0x9728e2['message']));});});};
\ No newline at end of file
index 7b1dba3..4c50a9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8705=['index','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','./voiceCallReport.controller'];(function(_0x4342fa,_0x4bdb14){var _0x3d4c67=function(_0x385656){while(--_0x385656){_0x4342fa['push'](_0x4342fa['shift']());}};_0x3d4c67(++_0x4bdb14);}(_0x8705,0x7f));var _0x5870=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8705[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x5870('0x0'));var util=require(_0x5870('0x1'));var path=require(_0x5870('0x2'));var timeout=require('connect-timeout');var express=require(_0x5870('0x3'));var router=express['Router']();var auth=require(_0x5870('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5870('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x5870('0x6')]);router[_0x5870('0x7')](_0x5870('0x8'),auth[_0x5870('0x9')](),controller[_0x5870('0xa')]);router['get']('/:id',auth[_0x5870('0x9')](),controller['show']);router[_0x5870('0xb')]('/',auth[_0x5870('0x9')](),controller[_0x5870('0xc')]);router[_0x5870('0xd')](_0x5870('0xe'),auth[_0x5870('0x9')](),controller[_0x5870('0xf')]);router[_0x5870('0x10')](_0x5870('0xe'),auth[_0x5870('0x9')](),controller[_0x5870('0x11')]);module[_0x5870('0x12')]=router;
\ No newline at end of file
+var _0xff47=['update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','post','create','put'];(function(_0x3a31e4,_0x484658){var _0x26a847=function(_0x41cf43){while(--_0x41cf43){_0x3a31e4['push'](_0x3a31e4['shift']());}};_0x26a847(++_0x484658);}(_0xff47,0x1e8));var _0x7ff4=function(_0x4dcac4,_0x10e48a){_0x4dcac4=_0x4dcac4-0x0;var _0x2a238d=_0xff47[_0x4dcac4];return _0x2a238d;};'use strict';var multer=require(_0x7ff4('0x0'));var util=require(_0x7ff4('0x1'));var path=require(_0x7ff4('0x2'));var timeout=require('connect-timeout');var express=require(_0x7ff4('0x3'));var router=express[_0x7ff4('0x4')]();var auth=require(_0x7ff4('0x5'));var interaction=require(_0x7ff4('0x6'));var config=require(_0x7ff4('0x7'));var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0x7ff4('0x8')](),controller[_0x7ff4('0x9')]);router[_0x7ff4('0xa')](_0x7ff4('0xb'),auth[_0x7ff4('0x8')](),controller['describe']);router[_0x7ff4('0xa')](_0x7ff4('0xc'),auth[_0x7ff4('0x8')](),controller['show']);router[_0x7ff4('0xd')]('/',auth[_0x7ff4('0x8')](),controller[_0x7ff4('0xe')]);router[_0x7ff4('0xf')](_0x7ff4('0xc'),auth[_0x7ff4('0x8')](),controller[_0x7ff4('0x10')]);router[_0x7ff4('0x11')](_0x7ff4('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index ae4a07b..b9c2db2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x199d63,_0x89a1c8){var _0x42cea=function(_0x425d3d){while(--_0x425d3d){_0x199d63['push'](_0x199d63['shift']());}};_0x42cea(++_0x89a1c8);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
+var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x3a2699,_0x1de116){var _0x30f778=function(_0x1f0ffa){while(--_0x1f0ffa){_0x3a2699['push'](_0x3a2699['shift']());}};_0x30f778(++_0x1de116);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
index 21bf4c5..784de60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4aaf=['mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','fullname','User','findAll','rows','show','find','create','body','catch','describe','uniqueid','user','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x38dbfd,_0x2ebe55){var _0x217efe=function(_0x5d5114){while(--_0x5d5114){_0x38dbfd['push'](_0x38dbfd['shift']());}};_0x217efe(++_0x2ebe55);}(_0x4aaf,0xe1));var _0xf4aa=function(_0x27ac32,_0x42771f){_0x27ac32=_0x27ac32-0x0;var _0x20c811=_0x4aaf[_0x27ac32];return _0x20c811;};'use strict';var pdf=require(_0xf4aa('0x0'));var emlformat=require(_0xf4aa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf4aa('0x2'));var jsonpatch=require(_0xf4aa('0x3'));var rp=require(_0xf4aa('0x4'));var moment=require(_0xf4aa('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf4aa('0x6'));var util=require(_0xf4aa('0x7'));var path=require(_0xf4aa('0x8'));var sox=require('sox');var csv=require(_0xf4aa('0x9'));var ejs=require(_0xf4aa('0xa'));var fs=require('fs');var _=require(_0xf4aa('0xb'));var squel=require(_0xf4aa('0xc'));var crypto=require('crypto');var jsforce=require(_0xf4aa('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf4aa('0x9'));var querystring=require(_0xf4aa('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf4aa('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf4aa('0x10'));var hardwareService=require(_0xf4aa('0x11'));var logger=require(_0xf4aa('0x12'))(_0xf4aa('0x13'));var utils=require(_0xf4aa('0x14'));var config=require(_0xf4aa('0x15'));var db=require(_0xf4aa('0x16'))['db'];function respondWithStatusCode(_0x542ff1,_0x3eb79f){_0x3eb79f=_0x3eb79f||0xcc;return function(_0x4d35f1){if(_0x4d35f1){return _0x542ff1[_0xf4aa('0x17')](_0x3eb79f);}return _0x542ff1[_0xf4aa('0x18')](_0x3eb79f)[_0xf4aa('0x19')]();};}function respondWithResult(_0x5c8541,_0x2fc466){_0x2fc466=_0x2fc466||0xc8;return function(_0x2696da){if(_0x2696da){return _0x5c8541[_0xf4aa('0x18')](_0x2fc466)[_0xf4aa('0x1a')](_0x2696da);}};}function respondWithFilteredResult(_0x67347e,_0x4f7865){return function(_0x1b0662){if(_0x1b0662){var _0x24e072=_0x1b0662[_0xf4aa('0x1b')],_0x382f10=_0x4f7865['offset'],_0x16b727=_0x4f7865[_0xf4aa('0x1c')]+_0x4f7865[_0xf4aa('0x1d')],_0x48e809;if(_0x16b727>=_0x24e072){_0x16b727=_0x24e072;_0x48e809=0xc8;}else{_0x48e809=0xce;}_0x67347e[_0xf4aa('0x18')](_0x48e809);return _0x67347e[_0xf4aa('0x1e')]('Content-Range',_0x382f10+'-'+_0x16b727+'/'+_0x24e072)[_0xf4aa('0x1a')](_0x1b0662);}return null;};}function patchUpdates(_0x10ca37){return function(_0x5bed72){try{jsonpatch[_0xf4aa('0x1f')](_0x5bed72,_0x10ca37,!![]);}catch(_0x43c34a){return BPromise[_0xf4aa('0x20')](_0x43c34a);}return _0x5bed72[_0xf4aa('0x21')]();};}function saveUpdates(_0x13baa8,_0x13748d){return function(_0x1c5e41){if(_0x1c5e41){return _0x1c5e41[_0xf4aa('0x22')](_0x13baa8)[_0xf4aa('0x23')](function(_0x1db117){return _0x1db117;});}return null;};}function removeEntity(_0x4f9c19,_0x471d0c){return function(_0x376f0a){if(_0x376f0a){return _0x376f0a[_0xf4aa('0x24')]()[_0xf4aa('0x23')](function(){_0x4f9c19[_0xf4aa('0x18')](0xcc)[_0xf4aa('0x19')]();});}};}function handleEntityNotFound(_0xa73b7a,_0x76c1c6){return function(_0x3716e9){if(!_0x3716e9){_0xa73b7a[_0xf4aa('0x17')](0x194);}return _0x3716e9;};}function handleError(_0x4caab4,_0x35b7c9){_0x35b7c9=_0x35b7c9||0x1f4;return function(_0x12153e){logger[_0xf4aa('0x25')](_0x12153e['stack']);if(_0x12153e[_0xf4aa('0x26')]){delete _0x12153e['name'];}_0x4caab4['status'](_0x35b7c9)['send'](_0x12153e);};}exports[_0xf4aa('0x27')]=function(_0x34b761,_0x12f954){var _0x246253={},_0x7c2d56={},_0x38582a={'count':0x0,'rows':[]};var _0xd2cabe=_[_0xf4aa('0x28')](db[_0xf4aa('0x29')][_0xf4aa('0x2a')],function(_0x4b781d){return{'name':_0x4b781d[_0xf4aa('0x2b')],'type':_0x4b781d[_0xf4aa('0x2c')][_0xf4aa('0x2d')]};});_0x7c2d56[_0xf4aa('0x2e')]=_[_0xf4aa('0x28')](_0xd2cabe,_0xf4aa('0x26'));_0x7c2d56['query']=_[_0xf4aa('0x2f')](_0x34b761['query']);_0x7c2d56[_0xf4aa('0x30')]=_[_0xf4aa('0x31')](_0x7c2d56[_0xf4aa('0x2e')],_0x7c2d56[_0xf4aa('0x32')]);_0x246253[_0xf4aa('0x33')]=_[_0xf4aa('0x31')](_0x7c2d56[_0xf4aa('0x2e')],qs[_0xf4aa('0x34')](_0x34b761[_0xf4aa('0x32')][_0xf4aa('0x34')]));_0x246253[_0xf4aa('0x33')]=_0x246253[_0xf4aa('0x33')][_0xf4aa('0x35')]?_0x246253[_0xf4aa('0x33')]:_0x7c2d56[_0xf4aa('0x2e')];if(!_0x34b761[_0xf4aa('0x32')]['hasOwnProperty'](_0xf4aa('0x36'))){_0x246253[_0xf4aa('0x1d')]=qs[_0xf4aa('0x1d')](_0x34b761[_0xf4aa('0x32')]['limit']);_0x246253['offset']=qs['offset'](_0x34b761[_0xf4aa('0x32')][_0xf4aa('0x1c')]);}_0x246253[_0xf4aa('0x37')]=qs[_0xf4aa('0x38')](_0x34b761[_0xf4aa('0x32')][_0xf4aa('0x38')]);_0x246253[_0xf4aa('0x39')]=qs[_0xf4aa('0x30')](_[_0xf4aa('0x3a')](_0x34b761[_0xf4aa('0x32')],_0x7c2d56[_0xf4aa('0x30')]),_0xd2cabe);if(_0x34b761[_0xf4aa('0x32')]['filter']){_0x246253[_0xf4aa('0x39')]=_['merge'](_0x246253[_0xf4aa('0x39')],{'$or':_[_0xf4aa('0x28')](_0xd2cabe,function(_0x5b2f5d){if(_0x5b2f5d['type']!==_0xf4aa('0x3b')){var _0x56a53c={};_0x56a53c[_0x5b2f5d[_0xf4aa('0x26')]]={'$like':'%'+_0x34b761['query'][_0xf4aa('0x3c')]+'%'};return _0x56a53c;}})});}_0x246253=_[_0xf4aa('0x3d')]({},_0x246253,_0x34b761[_0xf4aa('0x3e')]);var _0x2832c7={'where':_0x246253['where']};return db['VoiceCallReport']['count'](_0x2832c7)[_0xf4aa('0x23')](function(_0x46a33c){_0x38582a[_0xf4aa('0x1b')]=_0x46a33c;if(_0x34b761['query'][_0xf4aa('0x3f')]){_0x246253[_0xf4aa('0x40')]=[{'attributes':['id','name',_0xf4aa('0x41'),'alias'],'model':db[_0xf4aa('0x42')],'as':'User'}];}return db[_0xf4aa('0x29')][_0xf4aa('0x43')](_0x246253);})[_0xf4aa('0x23')](function(_0x3c140b){_0x38582a[_0xf4aa('0x44')]=_0x3c140b;return _0x38582a;})[_0xf4aa('0x23')](respondWithFilteredResult(_0x12f954,_0x246253))['catch'](handleError(_0x12f954,null));};exports[_0xf4aa('0x45')]=function(_0x15d9e2,_0xcff104){var _0x4ca6f6={'raw':!![],'where':{'id':_0x15d9e2['params']['id']}},_0x22902d={};_0x22902d[_0xf4aa('0x2e')]=_['keys'](db[_0xf4aa('0x29')][_0xf4aa('0x2a')]);_0x22902d[_0xf4aa('0x32')]=_['keys'](_0x15d9e2['query']);_0x22902d[_0xf4aa('0x30')]=_['intersection'](_0x22902d[_0xf4aa('0x2e')],_0x22902d['query']);_0x4ca6f6[_0xf4aa('0x33')]=_[_0xf4aa('0x31')](_0x22902d[_0xf4aa('0x2e')],qs['fields'](_0x15d9e2[_0xf4aa('0x32')][_0xf4aa('0x34')]));_0x4ca6f6[_0xf4aa('0x33')]=_0x4ca6f6[_0xf4aa('0x33')][_0xf4aa('0x35')]?_0x4ca6f6[_0xf4aa('0x33')]:_0x22902d[_0xf4aa('0x2e')];if(_0x15d9e2[_0xf4aa('0x32')][_0xf4aa('0x3f')]){_0x4ca6f6[_0xf4aa('0x40')]=[{'all':!![]}];}_0x4ca6f6=_['merge']({},_0x4ca6f6,_0x15d9e2[_0xf4aa('0x3e')]);return db[_0xf4aa('0x29')][_0xf4aa('0x46')](_0x4ca6f6)[_0xf4aa('0x23')](handleEntityNotFound(_0xcff104,null))[_0xf4aa('0x23')](respondWithResult(_0xcff104,null))['catch'](handleError(_0xcff104,null));};exports[_0xf4aa('0x47')]=function(_0xcdba81,_0xbf4cc9){return db['VoiceCallReport'][_0xf4aa('0x47')](_0xcdba81[_0xf4aa('0x48')],{})[_0xf4aa('0x23')](respondWithResult(_0xbf4cc9,0xc9))[_0xf4aa('0x49')](handleError(_0xbf4cc9,null));};exports['destroy']=function(_0x448cb3,_0xd60d06){return db['VoiceCallReport'][_0xf4aa('0x46')]({'where':{'id':_0x448cb3['params']['id']}})['then'](handleEntityNotFound(_0xd60d06,null))[_0xf4aa('0x23')](removeEntity(_0xd60d06,null))[_0xf4aa('0x49')](handleError(_0xd60d06,null));};exports[_0xf4aa('0x4a')]=function(_0x38f13b,_0x321336){return db[_0xf4aa('0x29')][_0xf4aa('0x4a')]()[_0xf4aa('0x23')](respondWithResult(_0x321336,null))[_0xf4aa('0x49')](handleError(_0x321336,null));};exports['update']=function(_0x3a4021,_0x2a969d){if(_0x3a4021['body']['uniqueid']){delete _0x3a4021[_0xf4aa('0x48')][_0xf4aa('0x4b')];}return db[_0xf4aa('0x29')][_0xf4aa('0x46')]({'where':{'uniqueid':_0x3a4021['params']['id'],'UserId':{'$or':[null,_0x3a4021[_0xf4aa('0x4c')]['id']]}}})[_0xf4aa('0x23')](handleEntityNotFound(_0x2a969d,null))[_0xf4aa('0x23')](saveUpdates(_0x3a4021[_0xf4aa('0x48')],null))[_0xf4aa('0x23')](respondWithResult(_0x2a969d,null))['catch'](handleError(_0x2a969d,null));};
\ No newline at end of file
+var _0x25a5=['count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','fullname','User','findAll','rows','catch','show','params','keys','find','create','body','describe','uniqueid','user','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x308807,_0x5c9ed9){var _0x41b98f=function(_0x5509d5){while(--_0x5509d5){_0x308807['push'](_0x308807['shift']());}};_0x41b98f(++_0x5c9ed9);}(_0x25a5,0x1c4));var _0x525a=function(_0x5e5c57,_0x12e18c){_0x5e5c57=_0x5e5c57-0x0;var _0x2ebf60=_0x25a5[_0x5e5c57];return _0x2ebf60;};'use strict';var pdf=require(_0x525a('0x0'));var emlformat=require(_0x525a('0x1'));var rimraf=require(_0x525a('0x2'));var zipdir=require(_0x525a('0x3'));var jsonpatch=require(_0x525a('0x4'));var rp=require(_0x525a('0x5'));var moment=require(_0x525a('0x6'));var BPromise=require(_0x525a('0x7'));var Mustache=require(_0x525a('0x8'));var util=require('util');var path=require(_0x525a('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x525a('0xa'));var fs=require('fs');var _=require(_0x525a('0xb'));var squel=require(_0x525a('0xc'));var crypto=require(_0x525a('0xd'));var jsforce=require(_0x525a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x525a('0xf'));var Papa=require(_0x525a('0x10'));var Redis=require(_0x525a('0x11'));var authService=require(_0x525a('0x12'));var qs=require(_0x525a('0x13'));var as=require(_0x525a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x525a('0x15'));var config=require(_0x525a('0x16'));var db=require(_0x525a('0x17'))['db'];function respondWithStatusCode(_0x272128,_0x1940d8){_0x1940d8=_0x1940d8||0xcc;return function(_0x2c9c9a){if(_0x2c9c9a){return _0x272128[_0x525a('0x18')](_0x1940d8);}return _0x272128[_0x525a('0x19')](_0x1940d8)[_0x525a('0x1a')]();};}function respondWithResult(_0x102ae0,_0x2df6df){_0x2df6df=_0x2df6df||0xc8;return function(_0x24f258){if(_0x24f258){return _0x102ae0[_0x525a('0x19')](_0x2df6df)[_0x525a('0x1b')](_0x24f258);}};}function respondWithFilteredResult(_0x457e37,_0xb28196){return function(_0x3023b8){if(_0x3023b8){var _0x291415=_0x3023b8[_0x525a('0x1c')],_0x1eb6a1=_0xb28196[_0x525a('0x1d')],_0x144d11=_0xb28196[_0x525a('0x1d')]+_0xb28196[_0x525a('0x1e')],_0x4271f5;if(_0x144d11>=_0x291415){_0x144d11=_0x291415;_0x4271f5=0xc8;}else{_0x4271f5=0xce;}_0x457e37['status'](_0x4271f5);return _0x457e37[_0x525a('0x1f')](_0x525a('0x20'),_0x1eb6a1+'-'+_0x144d11+'/'+_0x291415)['json'](_0x3023b8);}return null;};}function patchUpdates(_0x1cd73a){return function(_0x229817){try{jsonpatch[_0x525a('0x21')](_0x229817,_0x1cd73a,!![]);}catch(_0x36a933){return BPromise[_0x525a('0x22')](_0x36a933);}return _0x229817[_0x525a('0x23')]();};}function saveUpdates(_0x1aec64,_0x2dcd49){return function(_0x49d678){if(_0x49d678){return _0x49d678['update'](_0x1aec64)[_0x525a('0x24')](function(_0xa4d152){return _0xa4d152;});}return null;};}function removeEntity(_0x29c216,_0x335d43){return function(_0x530fd5){if(_0x530fd5){return _0x530fd5[_0x525a('0x25')]()['then'](function(){_0x29c216[_0x525a('0x19')](0xcc)[_0x525a('0x1a')]();});}};}function handleEntityNotFound(_0x2b17df,_0x520bfe){return function(_0x27e0fe){if(!_0x27e0fe){_0x2b17df['sendStatus'](0x194);}return _0x27e0fe;};}function handleError(_0x520221,_0x44f18e){_0x44f18e=_0x44f18e||0x1f4;return function(_0x103507){logger[_0x525a('0x26')](_0x103507[_0x525a('0x27')]);if(_0x103507[_0x525a('0x28')]){delete _0x103507['name'];}_0x520221[_0x525a('0x19')](_0x44f18e)['send'](_0x103507);};}exports[_0x525a('0x29')]=function(_0x3a93c3,_0x4f97e1){var _0x1518b3={},_0x33132c={},_0x337ee6={'count':0x0,'rows':[]};var _0x5ec251=_[_0x525a('0x2a')](db[_0x525a('0x2b')][_0x525a('0x2c')],function(_0x1e7bde){return{'name':_0x1e7bde['fieldName'],'type':_0x1e7bde[_0x525a('0x2d')][_0x525a('0x2e')]};});_0x33132c[_0x525a('0x2f')]=_['map'](_0x5ec251,_0x525a('0x28'));_0x33132c[_0x525a('0x30')]=_['keys'](_0x3a93c3[_0x525a('0x30')]);_0x33132c[_0x525a('0x31')]=_[_0x525a('0x32')](_0x33132c[_0x525a('0x2f')],_0x33132c[_0x525a('0x30')]);_0x1518b3[_0x525a('0x33')]=_[_0x525a('0x32')](_0x33132c[_0x525a('0x2f')],qs['fields'](_0x3a93c3[_0x525a('0x30')][_0x525a('0x34')]));_0x1518b3[_0x525a('0x33')]=_0x1518b3[_0x525a('0x33')][_0x525a('0x35')]?_0x1518b3[_0x525a('0x33')]:_0x33132c[_0x525a('0x2f')];if(!_0x3a93c3[_0x525a('0x30')][_0x525a('0x36')](_0x525a('0x37'))){_0x1518b3['limit']=qs[_0x525a('0x1e')](_0x3a93c3[_0x525a('0x30')][_0x525a('0x1e')]);_0x1518b3[_0x525a('0x1d')]=qs['offset'](_0x3a93c3['query']['offset']);}_0x1518b3[_0x525a('0x38')]=qs[_0x525a('0x39')](_0x3a93c3[_0x525a('0x30')][_0x525a('0x39')]);_0x1518b3[_0x525a('0x3a')]=qs['filters'](_[_0x525a('0x3b')](_0x3a93c3[_0x525a('0x30')],_0x33132c[_0x525a('0x31')]),_0x5ec251);if(_0x3a93c3[_0x525a('0x30')]['filter']){_0x1518b3[_0x525a('0x3a')]=_['merge'](_0x1518b3[_0x525a('0x3a')],{'$or':_[_0x525a('0x2a')](_0x5ec251,function(_0x2eb9a6){if(_0x2eb9a6['type']!==_0x525a('0x3c')){var _0x580ee9={};_0x580ee9[_0x2eb9a6[_0x525a('0x28')]]={'$like':'%'+_0x3a93c3[_0x525a('0x30')][_0x525a('0x3d')]+'%'};return _0x580ee9;}})});}_0x1518b3=_[_0x525a('0x3e')]({},_0x1518b3,_0x3a93c3[_0x525a('0x3f')]);var _0xe75886={'where':_0x1518b3[_0x525a('0x3a')]};return db['VoiceCallReport']['count'](_0xe75886)['then'](function(_0x1b5ce5){_0x337ee6['count']=_0x1b5ce5;if(_0x3a93c3[_0x525a('0x30')][_0x525a('0x40')]){_0x1518b3[_0x525a('0x41')]=[{'attributes':['id',_0x525a('0x28'),_0x525a('0x42'),'alias'],'model':db[_0x525a('0x43')],'as':_0x525a('0x43')}];}return db[_0x525a('0x2b')][_0x525a('0x44')](_0x1518b3);})[_0x525a('0x24')](function(_0x321ef2){_0x337ee6[_0x525a('0x45')]=_0x321ef2;return _0x337ee6;})['then'](respondWithFilteredResult(_0x4f97e1,_0x1518b3))[_0x525a('0x46')](handleError(_0x4f97e1,null));};exports[_0x525a('0x47')]=function(_0x4ae060,_0x2a5b69){var _0x36b85a={'raw':!![],'where':{'id':_0x4ae060[_0x525a('0x48')]['id']}},_0x4e10dd={};_0x4e10dd[_0x525a('0x2f')]=_[_0x525a('0x49')](db[_0x525a('0x2b')][_0x525a('0x2c')]);_0x4e10dd[_0x525a('0x30')]=_[_0x525a('0x49')](_0x4ae060[_0x525a('0x30')]);_0x4e10dd[_0x525a('0x31')]=_[_0x525a('0x32')](_0x4e10dd[_0x525a('0x2f')],_0x4e10dd['query']);_0x36b85a['attributes']=_[_0x525a('0x32')](_0x4e10dd['model'],qs[_0x525a('0x34')](_0x4ae060[_0x525a('0x30')][_0x525a('0x34')]));_0x36b85a[_0x525a('0x33')]=_0x36b85a[_0x525a('0x33')][_0x525a('0x35')]?_0x36b85a[_0x525a('0x33')]:_0x4e10dd[_0x525a('0x2f')];if(_0x4ae060[_0x525a('0x30')][_0x525a('0x40')]){_0x36b85a['include']=[{'all':!![]}];}_0x36b85a=_['merge']({},_0x36b85a,_0x4ae060[_0x525a('0x3f')]);return db[_0x525a('0x2b')][_0x525a('0x4a')](_0x36b85a)['then'](handleEntityNotFound(_0x2a5b69,null))[_0x525a('0x24')](respondWithResult(_0x2a5b69,null))[_0x525a('0x46')](handleError(_0x2a5b69,null));};exports[_0x525a('0x4b')]=function(_0x361673,_0x8650d7){return db[_0x525a('0x2b')][_0x525a('0x4b')](_0x361673[_0x525a('0x4c')],{})['then'](respondWithResult(_0x8650d7,0xc9))[_0x525a('0x46')](handleError(_0x8650d7,null));};exports[_0x525a('0x25')]=function(_0x3bf8a4,_0x3aa52b){return db[_0x525a('0x2b')][_0x525a('0x4a')]({'where':{'id':_0x3bf8a4[_0x525a('0x48')]['id']}})['then'](handleEntityNotFound(_0x3aa52b,null))['then'](removeEntity(_0x3aa52b,null))[_0x525a('0x46')](handleError(_0x3aa52b,null));};exports[_0x525a('0x4d')]=function(_0x5af1c2,_0x3cf5ce){return db[_0x525a('0x2b')][_0x525a('0x4d')]()[_0x525a('0x24')](respondWithResult(_0x3cf5ce,null))['catch'](handleError(_0x3cf5ce,null));};exports['update']=function(_0x3e149d,_0x59154b){if(_0x3e149d[_0x525a('0x4c')][_0x525a('0x4e')]){delete _0x3e149d[_0x525a('0x4c')][_0x525a('0x4e')];}return db[_0x525a('0x2b')][_0x525a('0x4a')]({'where':{'uniqueid':_0x3e149d[_0x525a('0x48')]['id'],'UserId':{'$or':[null,_0x3e149d[_0x525a('0x4f')]['id']]}}})['then'](handleEntityNotFound(_0x59154b,null))['then'](saveUpdates(_0x3e149d[_0x525a('0x4c')],null))[_0x525a('0x24')](respondWithResult(_0x59154b,null))[_0x525a('0x46')](handleError(_0x59154b,null));};
\ No newline at end of file
index fba628e..d5bb859 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde11=['report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport'];(function(_0x488dd0,_0x1e0044){var _0xb0577d=function(_0x5045d0){while(--_0x5045d0){_0x488dd0['push'](_0x488dd0['shift']());}};_0xb0577d(++_0x1e0044);}(_0xde11,0x11f));var _0x1de1=function(_0x1a635e,_0x241651){_0x1a635e=_0x1a635e-0x0;var _0x5b3345=_0xde11[_0x1a635e];return _0x5b3345;};'use strict';var _=require(_0x1de1('0x0'));var util=require(_0x1de1('0x1'));var logger=require(_0x1de1('0x2'))(_0x1de1('0x3'));var moment=require(_0x1de1('0x4'));var BPromise=require(_0x1de1('0x5'));var rp=require(_0x1de1('0x6'));var fs=require('fs');var path=require(_0x1de1('0x7'));var rimraf=require('rimraf');var config=require(_0x1de1('0x8'));var attributes=require(_0x1de1('0x9'));module[_0x1de1('0xa')]=function(_0x19ba84,_0x4f1f11){return _0x19ba84[_0x1de1('0xb')](_0x1de1('0xc'),attributes,{'tableName':_0x1de1('0xd'),'paranoid':![],'indexes':[{'fields':[_0x1de1('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xef87=['../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef87,0xd5));var _0x7ef8=function(_0x9bc2ac,_0x20cc1b){_0x9bc2ac=_0x9bc2ac-0x0;var _0x141550=_0xef87[_0x9bc2ac];return _0x141550;};'use strict';var _=require('lodash');var util=require(_0x7ef8('0x0'));var logger=require(_0x7ef8('0x1'))(_0x7ef8('0x2'));var moment=require(_0x7ef8('0x3'));var BPromise=require('bluebird');var rp=require(_0x7ef8('0x4'));var fs=require('fs');var path=require(_0x7ef8('0x5'));var rimraf=require(_0x7ef8('0x6'));var config=require(_0x7ef8('0x7'));var attributes=require(_0x7ef8('0x8'));module[_0x7ef8('0x9')]=function(_0x4d9669,_0x58459c){return _0x4d9669['define'](_0x7ef8('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 6df0375..f98f977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2add=['raw','limit','map','include','attributes','model','info','GetVoiceCallReport','debug','create','body','CreateVoiceCallReport','VoiceCallReport','where','UpdateVoiceCallReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options'];(function(_0x1fbafd,_0x1ba0a5){var _0x2ccceb=function(_0x1b71cf){while(--_0x1b71cf){_0x1fbafd['push'](_0x1fbafd['shift']());}};_0x2ccceb(++_0x1ba0a5);}(_0x2add,0x7b));var _0xd2ad=function(_0x9e2b66,_0x1ee46f){_0x9e2b66=_0x9e2b66-0x0;var _0x2eb8ad=_0x2add[_0x9e2b66];return _0x2eb8ad;};'use strict';var _=require(_0xd2ad('0x0'));var util=require(_0xd2ad('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd2ad('0x2'));var fs=require('fs');var Redis=require(_0xd2ad('0x3'));var db=require(_0xd2ad('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2ad('0x5'))('rpc');var config=require(_0xd2ad('0x6'));var jayson=require(_0xd2ad('0x7'));var client=jayson['client'][_0xd2ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56a76b,_0x3d6f40,_0x5483ea){return new BPromise(function(_0x328a71,_0x56dc03){return client[_0xd2ad('0x9')](_0x56a76b,_0x5483ea)[_0xd2ad('0xa')](function(_0x12d0df){logger['info'](_0xd2ad('0xb'),_0x3d6f40,'request\x20sent');logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x3d6f40,_0xd2ad('0xc'),JSON[_0xd2ad('0xd')](_0x12d0df));if(_0x12d0df[_0xd2ad('0xe')]){if(_0x12d0df[_0xd2ad('0xe')][_0xd2ad('0xf')]===0x1f4){logger[_0xd2ad('0xe')](_0xd2ad('0xb'),_0x3d6f40,_0x12d0df[_0xd2ad('0xe')][_0xd2ad('0x10')]);return _0x56dc03(_0x12d0df[_0xd2ad('0xe')]['message']);}logger[_0xd2ad('0xe')](_0xd2ad('0xb'),_0x3d6f40,_0x12d0df['error'][_0xd2ad('0x10')]);return _0x328a71(_0x12d0df[_0xd2ad('0xe')]['message']);}else{logger['info'](_0xd2ad('0xb'),_0x3d6f40,_0xd2ad('0xc'));_0x328a71(_0x12d0df[_0xd2ad('0x11')]['message']);}})[_0xd2ad('0x12')](function(_0x5147c1){logger[_0xd2ad('0xe')](_0xd2ad('0xb'),_0x3d6f40,_0x5147c1);_0x56dc03(_0x5147c1);});});}exports['GetVoiceCallReport']=function(_0x6ab337){var _0x4beb4c=this;return new Promise(function(_0x1693b3,_0x1e9854){return db['VoiceCallReport'][_0xd2ad('0x13')]({'raw':_0x6ab337[_0xd2ad('0x14')]?_0x6ab337[_0xd2ad('0x14')][_0xd2ad('0x15')]===undefined?!![]:![]:!![],'where':_0x6ab337[_0xd2ad('0x14')]?_0x6ab337[_0xd2ad('0x14')]['where']||null:null,'attributes':_0x6ab337[_0xd2ad('0x14')]?_0x6ab337['options']['attributes']||null:null,'limit':_0x6ab337[_0xd2ad('0x14')]?_0x6ab337['options'][_0xd2ad('0x16')]||null:null,'include':_0x6ab337['options']?_0x6ab337[_0xd2ad('0x14')]['include']?_[_0xd2ad('0x17')](_0x6ab337[_0xd2ad('0x14')][_0xd2ad('0x18')],function(_0xdb3709){return{'model':db[_0xdb3709['model']],'as':_0xdb3709['as'],'attributes':_0xdb3709[_0xd2ad('0x19')],'include':_0xdb3709[_0xd2ad('0x18')]?_[_0xd2ad('0x17')](_0xdb3709['include'],function(_0x1ca6b1){return{'model':db[_0x1ca6b1[_0xd2ad('0x1a')]],'as':_0x1ca6b1['as'],'attributes':_0x1ca6b1['attributes'],'include':_0x1ca6b1[_0xd2ad('0x18')]?_[_0xd2ad('0x17')](_0x1ca6b1[_0xd2ad('0x18')],function(_0x58ce60){return{'model':db[_0x58ce60[_0xd2ad('0x1a')]],'as':_0x58ce60['as'],'attributes':_0x58ce60[_0xd2ad('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd2ad('0xa')](function(_0x40c6c2){logger[_0xd2ad('0x1b')](_0xd2ad('0x1c'),_0x6ab337);logger[_0xd2ad('0x1d')](_0xd2ad('0x1c'),_0x6ab337,JSON[_0xd2ad('0xd')](_0x40c6c2));_0x1693b3(_0x40c6c2);})[_0xd2ad('0x12')](function(_0x1597f7){logger['error'](_0xd2ad('0x1c'),_0x1597f7[_0xd2ad('0x10')],_0x6ab337);_0x1e9854(_0x4beb4c[_0xd2ad('0xe')](0x1f4,_0x1597f7[_0xd2ad('0x10')]));});});};exports['CreateVoiceCallReport']=function(_0x5b34aa){var _0x349f28=this;return new Promise(function(_0x1e21f6,_0x2db8d8){return db['VoiceCallReport'][_0xd2ad('0x1e')](_0x5b34aa[_0xd2ad('0x1f')],{'raw':_0x5b34aa[_0xd2ad('0x14')]?_0x5b34aa['options'][_0xd2ad('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x1a9cff){logger[_0xd2ad('0x1b')](_0xd2ad('0x20'),_0x5b34aa);logger[_0xd2ad('0x1d')](_0xd2ad('0x20'),_0x5b34aa,JSON[_0xd2ad('0xd')](_0x1a9cff));_0x1e21f6(_0x1a9cff);})['catch'](function(_0xa60174){logger['error'](_0xd2ad('0x20'),_0xa60174['message'],_0x5b34aa);_0x2db8d8(_0x349f28[_0xd2ad('0xe')](0x1f4,_0xa60174[_0xd2ad('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0x3ed217){var _0x4ca54d=this;return new Promise(function(_0x2a5d0a,_0x30d44d){return db[_0xd2ad('0x21')]['update'](_0x3ed217[_0xd2ad('0x1f')],{'raw':_0x3ed217[_0xd2ad('0x14')]?_0x3ed217[_0xd2ad('0x14')][_0xd2ad('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ed217[_0xd2ad('0x14')]?_0x3ed217[_0xd2ad('0x14')][_0xd2ad('0x22')]||null:null,'attributes':_0x3ed217[_0xd2ad('0x14')]?_0x3ed217['options'][_0xd2ad('0x19')]||null:null,'limit':_0x3ed217[_0xd2ad('0x14')]?_0x3ed217[_0xd2ad('0x14')][_0xd2ad('0x16')]||null:null})[_0xd2ad('0xa')](function(_0x5e9af1){logger['info'](_0xd2ad('0x23'),_0x3ed217);logger[_0xd2ad('0x1d')](_0xd2ad('0x23'),_0x3ed217,JSON[_0xd2ad('0xd')](_0x5e9af1));_0x2a5d0a(_0x5e9af1);})[_0xd2ad('0x12')](function(_0x475451){logger[_0xd2ad('0xe')](_0xd2ad('0x23'),_0x475451[_0xd2ad('0x10')],_0x3ed217);_0x30d44d(_0x4ca54d[_0xd2ad('0xe')](0x1f4,_0x475451[_0xd2ad('0x10')]));});});};
\ No newline at end of file
+var _0xa66c=['body','UpdateVoiceCallReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','limit','include','map','model','stringify','CreateVoiceCallReport','create'];(function(_0x39d024,_0x5c5797){var _0x311bdd=function(_0x4d644c){while(--_0x4d644c){_0x39d024['push'](_0x39d024['shift']());}};_0x311bdd(++_0x5c5797);}(_0xa66c,0x1ba));var _0xca66=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa66c[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xca66('0x0'));var util=require(_0xca66('0x1'));var moment=require(_0xca66('0x2'));var BPromise=require('bluebird');var rs=require(_0xca66('0x3'));var fs=require('fs');var Redis=require(_0xca66('0x4'));var db=require(_0xca66('0x5'))['db'];var utils=require(_0xca66('0x6'));var logger=require(_0xca66('0x7'))(_0xca66('0x8'));var config=require(_0xca66('0x9'));var jayson=require(_0xca66('0xa'));var client=jayson[_0xca66('0xb')][_0xca66('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5eb366,_0x114f42,_0x39be17){return new BPromise(function(_0x3cc7d4,_0x2fc33b){return client[_0xca66('0xd')](_0x5eb366,_0x39be17)[_0xca66('0xe')](function(_0x5704a4){logger[_0xca66('0xf')](_0xca66('0x10'),_0x114f42,_0xca66('0x11'));logger[_0xca66('0x12')](_0xca66('0x13'),_0x114f42,_0xca66('0x11'),JSON['stringify'](_0x5704a4));if(_0x5704a4[_0xca66('0x14')]){if(_0x5704a4[_0xca66('0x14')][_0xca66('0x15')]===0x1f4){logger[_0xca66('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x114f42,_0x5704a4['error'][_0xca66('0x16')]);return _0x2fc33b(_0x5704a4['error']['message']);}logger[_0xca66('0x14')](_0xca66('0x10'),_0x114f42,_0x5704a4[_0xca66('0x14')][_0xca66('0x16')]);return _0x3cc7d4(_0x5704a4[_0xca66('0x14')]['message']);}else{logger[_0xca66('0xf')](_0xca66('0x10'),_0x114f42,_0xca66('0x11'));_0x3cc7d4(_0x5704a4[_0xca66('0x17')][_0xca66('0x16')]);}})[_0xca66('0x18')](function(_0xf49967){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x114f42,_0xf49967);_0x2fc33b(_0xf49967);});});}exports[_0xca66('0x19')]=function(_0x45857b){var _0x1215e1=this;return new Promise(function(_0x318eb9,_0x3863b0){return db[_0xca66('0x1a')]['findAll']({'raw':_0x45857b[_0xca66('0x1b')]?_0x45857b[_0xca66('0x1b')][_0xca66('0x1c')]===undefined?!![]:![]:!![],'where':_0x45857b[_0xca66('0x1b')]?_0x45857b[_0xca66('0x1b')][_0xca66('0x1d')]||null:null,'attributes':_0x45857b[_0xca66('0x1b')]?_0x45857b[_0xca66('0x1b')][_0xca66('0x1e')]||null:null,'limit':_0x45857b[_0xca66('0x1b')]?_0x45857b['options'][_0xca66('0x1f')]||null:null,'include':_0x45857b[_0xca66('0x1b')]?_0x45857b[_0xca66('0x1b')][_0xca66('0x20')]?_[_0xca66('0x21')](_0x45857b[_0xca66('0x1b')][_0xca66('0x20')],function(_0x3dc20f){return{'model':db[_0x3dc20f[_0xca66('0x22')]],'as':_0x3dc20f['as'],'attributes':_0x3dc20f[_0xca66('0x1e')],'include':_0x3dc20f[_0xca66('0x20')]?_[_0xca66('0x21')](_0x3dc20f[_0xca66('0x20')],function(_0x46a0de){return{'model':db[_0x46a0de[_0xca66('0x22')]],'as':_0x46a0de['as'],'attributes':_0x46a0de[_0xca66('0x1e')],'include':_0x46a0de[_0xca66('0x20')]?_[_0xca66('0x21')](_0x46a0de[_0xca66('0x20')],function(_0x162ceb){return{'model':db[_0x162ceb[_0xca66('0x22')]],'as':_0x162ceb['as'],'attributes':_0x162ceb[_0xca66('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28e25c){logger[_0xca66('0xf')](_0xca66('0x19'),_0x45857b);logger['debug'](_0xca66('0x19'),_0x45857b,JSON[_0xca66('0x23')](_0x28e25c));_0x318eb9(_0x28e25c);})['catch'](function(_0x3160f0){logger['error'](_0xca66('0x19'),_0x3160f0['message'],_0x45857b);_0x3863b0(_0x1215e1['error'](0x1f4,_0x3160f0[_0xca66('0x16')]));});});};exports[_0xca66('0x24')]=function(_0x2d4c0f){var _0x5a696f=this;return new Promise(function(_0x4d6662,_0x5f5d64){return db['VoiceCallReport'][_0xca66('0x25')](_0x2d4c0f[_0xca66('0x26')],{'raw':_0x2d4c0f['options']?_0x2d4c0f[_0xca66('0x1b')][_0xca66('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x55cd59){logger[_0xca66('0xf')](_0xca66('0x24'),_0x2d4c0f);logger['debug']('CreateVoiceCallReport',_0x2d4c0f,JSON[_0xca66('0x23')](_0x55cd59));_0x4d6662(_0x55cd59);})[_0xca66('0x18')](function(_0x55780c){logger[_0xca66('0x14')](_0xca66('0x24'),_0x55780c['message'],_0x2d4c0f);_0x5f5d64(_0x5a696f[_0xca66('0x14')](0x1f4,_0x55780c[_0xca66('0x16')]));});});};exports[_0xca66('0x27')]=function(_0x13d1b9){var _0x527384=this;return new Promise(function(_0x50c099,_0x12b7ff){return db['VoiceCallReport']['update'](_0x13d1b9[_0xca66('0x26')],{'raw':_0x13d1b9[_0xca66('0x1b')]?_0x13d1b9[_0xca66('0x1b')][_0xca66('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13d1b9[_0xca66('0x1b')]?_0x13d1b9[_0xca66('0x1b')]['where']||null:null,'attributes':_0x13d1b9[_0xca66('0x1b')]?_0x13d1b9[_0xca66('0x1b')][_0xca66('0x1e')]||null:null,'limit':_0x13d1b9['options']?_0x13d1b9[_0xca66('0x1b')][_0xca66('0x1f')]||null:null})[_0xca66('0xe')](function(_0x582442){logger[_0xca66('0xf')]('UpdateVoiceCallReport',_0x13d1b9);logger[_0xca66('0x12')](_0xca66('0x27'),_0x13d1b9,JSON[_0xca66('0x23')](_0x582442));_0x50c099(_0x582442);})[_0xca66('0x18')](function(_0x395237){logger[_0xca66('0x14')]('UpdateVoiceCallReport',_0x395237[_0xca66('0x16')],_0x13d1b9);_0x12b7ff(_0x527384[_0xca66('0x14')](0x1f4,_0x395237['message']));});});};
\ No newline at end of file
index 968e70a..fa4aac5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc00e=['exports','multer','util','express','Router','../../config/environment','get','isAuthenticated','index','/:id','create','put','delete','destroy'];(function(_0x53a167,_0x4bf6c7){var _0x150263=function(_0x422191){while(--_0x422191){_0x53a167['push'](_0x53a167['shift']());}};_0x150263(++_0x4bf6c7);}(_0xc00e,0xe1));var _0xec00=function(_0x419c1c,_0x3a3c71){_0x419c1c=_0x419c1c-0x0;var _0x501f3b=_0xc00e[_0x419c1c];return _0x501f3b;};'use strict';var multer=require(_0xec00('0x0'));var util=require(_0xec00('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xec00('0x2'));var router=express[_0xec00('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xec00('0x4'));var controller=require('./voiceChanSpy.controller');router[_0xec00('0x5')]('/',auth[_0xec00('0x6')](),controller[_0xec00('0x7')]);router[_0xec00('0x5')](_0xec00('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xec00('0x6')](),controller[_0xec00('0x9')]);router[_0xec00('0xa')](_0xec00('0x8'),auth[_0xec00('0x6')](),controller['update']);router[_0xec00('0xb')]('/:id',auth[_0xec00('0x6')](),controller[_0xec00('0xc')]);module[_0xec00('0xd')]=router;
\ No newline at end of file
+var _0x5569=['update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','/:id','create','put'];(function(_0x426c6f,_0x3821bf){var _0x2ca544=function(_0x405ad2){while(--_0x405ad2){_0x426c6f['push'](_0x426c6f['shift']());}};_0x2ca544(++_0x3821bf);}(_0x5569,0x143));var _0x9556=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0x5569[_0x5d1044];return _0x3cd90e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9556('0x0'));var timeout=require(_0x9556('0x1'));var express=require(_0x9556('0x2'));var router=express[_0x9556('0x3')]();var auth=require(_0x9556('0x4'));var interaction=require(_0x9556('0x5'));var config=require(_0x9556('0x6'));var controller=require(_0x9556('0x7'));router[_0x9556('0x8')]('/',auth[_0x9556('0x9')](),controller['index']);router[_0x9556('0x8')](_0x9556('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x9556('0xb')]);router[_0x9556('0xc')](_0x9556('0xa'),auth[_0x9556('0x9')](),controller[_0x9556('0xd')]);router[_0x9556('0xe')](_0x9556('0xa'),auth[_0x9556('0x9')](),controller[_0x9556('0xf')]);module['exports']=router;
\ No newline at end of file
index 8b6067c..299143c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f10=['join','getDataValue','split','BOOLEAN','sequelize','exports','name','STRING','options'];(function(_0x4f80d3,_0x3b21a4){var _0x511219=function(_0x35888e){while(--_0x35888e){_0x4f80d3['push'](_0x4f80d3['shift']());}};_0x511219(++_0x3b21a4);}(_0x2f10,0xa6));var _0x02f1=function(_0x8d1e50,_0x42503f){_0x8d1e50=_0x8d1e50-0x0;var _0x99ba57=_0x2f10[_0x8d1e50];return _0x99ba57;};'use strict';var Sequelize=require(_0x02f1('0x0'));module[_0x02f1('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x02f1('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x02f1('0x3')],'set':function(_0x121703){this['setDataValue'](_0x02f1('0x4'),_0x121703?_0x121703[_0x02f1('0x5')](''):[]);},'get':function(){return this[_0x02f1('0x6')]('options')?this[_0x02f1('0x6')](_0x02f1('0x4'))[_0x02f1('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x02f1('0x3')]},'record':{'type':Sequelize[_0x02f1('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x02f1('0x3')]},'description':{'type':Sequelize[_0x02f1('0x3')]}};
\ No newline at end of file
+var _0x604c=['STRING','BOOLEAN','sequelize','exports','name','setDataValue','options','getDataValue','split'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x604c,0x65));var _0xc604=function(_0x3cb059,_0x10adac){_0x3cb059=_0x3cb059-0x0;var _0x264dd2=_0x604c[_0x3cb059];return _0x264dd2;};'use strict';var Sequelize=require(_0xc604('0x0'));module[_0xc604('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0xc604('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x5dd2fe){this[_0xc604('0x3')](_0xc604('0x4'),_0x5dd2fe?_0x5dd2fe['join'](''):[]);},'get':function(){return this[_0xc604('0x5')](_0xc604('0x4'))?this[_0xc604('0x5')]('options')[_0xc604('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xc604('0x7')]},'record':{'type':Sequelize[_0xc604('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc604('0x7')]},'description':{'type':Sequelize[_0xc604('0x7')]}};
\ No newline at end of file
index 9e637e9..6030339 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4700=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','options','includeAll','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','type','key'];(function(_0x367cb2,_0x2b6f7d){var _0x50f0cf=function(_0x1b87a3){while(--_0x1b87a3){_0x367cb2['push'](_0x367cb2['shift']());}};_0x50f0cf(++_0x2b6f7d);}(_0x4700,0x162));var _0x0470=function(_0x482583,_0x30bee4){_0x482583=_0x482583-0x0;var _0x2f7e42=_0x4700[_0x482583];return _0x2f7e42;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0470('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0470('0x1'));var jsonpatch=require(_0x0470('0x2'));var rp=require(_0x0470('0x3'));var moment=require(_0x0470('0x4'));var BPromise=require(_0x0470('0x5'));var Mustache=require(_0x0470('0x6'));var util=require(_0x0470('0x7'));var path=require(_0x0470('0x8'));var sox=require(_0x0470('0x9'));var csv=require(_0x0470('0xa'));var ejs=require(_0x0470('0xb'));var fs=require('fs');var _=require(_0x0470('0xc'));var squel=require(_0x0470('0xd'));var crypto=require(_0x0470('0xe'));var jsforce=require(_0x0470('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0470('0xa'));var querystring=require(_0x0470('0x10'));var Papa=require(_0x0470('0x11'));var Redis=require(_0x0470('0x12'));var authService=require(_0x0470('0x13'));var qs=require(_0x0470('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0470('0x15'));var logger=require(_0x0470('0x16'))(_0x0470('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0470('0x18'))['db'];function respondWithStatusCode(_0x303b80,_0x20324e){_0x20324e=_0x20324e||0xcc;return function(_0x15ccb1){if(_0x15ccb1){return _0x303b80['sendStatus'](_0x20324e);}return _0x303b80[_0x0470('0x19')](_0x20324e)[_0x0470('0x1a')]();};}function respondWithResult(_0x1a4aac,_0x7a936){_0x7a936=_0x7a936||0xc8;return function(_0x11da91){if(_0x11da91){return _0x1a4aac[_0x0470('0x19')](_0x7a936)[_0x0470('0x1b')](_0x11da91);}};}function respondWithFilteredResult(_0x24a7bb,_0x1d022c){return function(_0x1f6354){if(_0x1f6354){var _0x4707d1=_0x1f6354[_0x0470('0x1c')],_0x42a548=_0x1d022c[_0x0470('0x1d')],_0x5d4013=_0x1d022c['offset']+_0x1d022c[_0x0470('0x1e')],_0x40b816;if(_0x5d4013>=_0x4707d1){_0x5d4013=_0x4707d1;_0x40b816=0xc8;}else{_0x40b816=0xce;}_0x24a7bb[_0x0470('0x19')](_0x40b816);return _0x24a7bb[_0x0470('0x1f')](_0x0470('0x20'),_0x42a548+'-'+_0x5d4013+'/'+_0x4707d1)['json'](_0x1f6354);}return null;};}function patchUpdates(_0x49b0f0){return function(_0x391885){try{jsonpatch[_0x0470('0x21')](_0x391885,_0x49b0f0,!![]);}catch(_0x5aa035){return BPromise[_0x0470('0x22')](_0x5aa035);}return _0x391885[_0x0470('0x23')]();};}function saveUpdates(_0x592850,_0x424a2b){return function(_0x1d31e1){if(_0x1d31e1){return _0x1d31e1[_0x0470('0x24')](_0x592850)[_0x0470('0x25')](function(_0x2d314f){return _0x2d314f;});}return null;};}function removeEntity(_0xb74b55,_0x5196c8){return function(_0x277676){if(_0x277676){return _0x277676['destroy']()[_0x0470('0x25')](function(){var _0x38feb7=_0x277676['get']({'plain':!![]});var _0x69f809='ChanSpies';return db[_0x0470('0x26')][_0x0470('0x27')]({'where':{'type':_0x69f809,'resourceId':_0x38feb7['id']}})[_0x0470('0x25')](function(){return _0x277676;});})[_0x0470('0x25')](function(){_0xb74b55[_0x0470('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a2568,_0x50a451){return function(_0x3d59f6){if(!_0x3d59f6){_0x2a2568[_0x0470('0x28')](0x194);}return _0x3d59f6;};}function handleError(_0x255cb8,_0x2bcac9){_0x2bcac9=_0x2bcac9||0x1f4;return function(_0x15bb1c){logger[_0x0470('0x29')](_0x15bb1c[_0x0470('0x2a')]);if(_0x15bb1c['name']){delete _0x15bb1c[_0x0470('0x2b')];}_0x255cb8[_0x0470('0x19')](_0x2bcac9)[_0x0470('0x2c')](_0x15bb1c);};}exports[_0x0470('0x2d')]=function(_0x54dfbc,_0x2e631b){var _0x142993={},_0x2ee344={},_0x4a32e6={'count':0x0,'rows':[]};var _0xe6ed62=_['map'](db[_0x0470('0x2e')][_0x0470('0x2f')],function(_0x516297){return{'name':_0x516297[_0x0470('0x30')],'type':_0x516297[_0x0470('0x31')][_0x0470('0x32')]};});_0x2ee344[_0x0470('0x33')]=_['map'](_0xe6ed62,_0x0470('0x2b'));_0x2ee344[_0x0470('0x34')]=_[_0x0470('0x35')](_0x54dfbc[_0x0470('0x34')]);_0x2ee344[_0x0470('0x36')]=_['intersection'](_0x2ee344[_0x0470('0x33')],_0x2ee344[_0x0470('0x34')]);_0x142993[_0x0470('0x37')]=_[_0x0470('0x38')](_0x2ee344[_0x0470('0x33')],qs[_0x0470('0x39')](_0x54dfbc[_0x0470('0x34')][_0x0470('0x39')]));_0x142993[_0x0470('0x37')]=_0x142993[_0x0470('0x37')][_0x0470('0x3a')]?_0x142993[_0x0470('0x37')]:_0x2ee344[_0x0470('0x33')];if(!_0x54dfbc['query'][_0x0470('0x3b')](_0x0470('0x3c'))){_0x142993[_0x0470('0x1e')]=qs[_0x0470('0x1e')](_0x54dfbc['query'][_0x0470('0x1e')]);_0x142993[_0x0470('0x1d')]=qs[_0x0470('0x1d')](_0x54dfbc['query'][_0x0470('0x1d')]);}_0x142993[_0x0470('0x3d')]=qs[_0x0470('0x3e')](_0x54dfbc[_0x0470('0x34')][_0x0470('0x3e')]);_0x142993[_0x0470('0x3f')]=qs[_0x0470('0x36')](_[_0x0470('0x40')](_0x54dfbc['query'],_0x2ee344[_0x0470('0x36')]),_0xe6ed62);if(_0x54dfbc[_0x0470('0x34')]['filter']){_0x142993['where']=_[_0x0470('0x41')](_0x142993[_0x0470('0x3f')],{'$or':_[_0x0470('0x42')](_0xe6ed62,function(_0x310a38){if(_0x310a38[_0x0470('0x31')]!=='VIRTUAL'){var _0x5cccfd={};_0x5cccfd[_0x310a38[_0x0470('0x2b')]]={'$like':'%'+_0x54dfbc['query']['filter']+'%'};return _0x5cccfd;}})});}_0x142993=_['merge']({},_0x142993,_0x54dfbc[_0x0470('0x43')]);var _0x3956a8={'where':_0x142993[_0x0470('0x3f')]};return db['VoiceChanSpy'][_0x0470('0x1c')](_0x3956a8)[_0x0470('0x25')](function(_0x331406){_0x4a32e6[_0x0470('0x1c')]=_0x331406;if(_0x54dfbc[_0x0470('0x34')][_0x0470('0x44')]){_0x142993['include']=[{'all':!![]}];}return db[_0x0470('0x2e')]['findAll'](_0x142993);})[_0x0470('0x25')](function(_0x2ed3e9){_0x4a32e6['rows']=_0x2ed3e9;return _0x4a32e6;})[_0x0470('0x25')](respondWithFilteredResult(_0x2e631b,_0x142993))[_0x0470('0x45')](handleError(_0x2e631b,null));};exports['show']=function(_0x4632ac,_0x2b9018){var _0xe7b5d3={'raw':![],'where':{'id':_0x4632ac[_0x0470('0x46')]['id']}},_0x2107f7={};_0x2107f7['model']=_['keys'](db['VoiceChanSpy'][_0x0470('0x2f')]);_0x2107f7[_0x0470('0x34')]=_[_0x0470('0x35')](_0x4632ac[_0x0470('0x34')]);_0x2107f7['filters']=_[_0x0470('0x38')](_0x2107f7[_0x0470('0x33')],_0x2107f7[_0x0470('0x34')]);_0xe7b5d3['attributes']=_['intersection'](_0x2107f7[_0x0470('0x33')],qs[_0x0470('0x39')](_0x4632ac[_0x0470('0x34')][_0x0470('0x39')]));_0xe7b5d3[_0x0470('0x37')]=_0xe7b5d3[_0x0470('0x37')]['length']?_0xe7b5d3[_0x0470('0x37')]:_0x2107f7[_0x0470('0x33')];if(_0x4632ac[_0x0470('0x34')][_0x0470('0x44')]){_0xe7b5d3['include']=[{'all':!![]}];}_0xe7b5d3=_[_0x0470('0x41')]({},_0xe7b5d3,_0x4632ac[_0x0470('0x43')]);return db[_0x0470('0x2e')][_0x0470('0x47')](_0xe7b5d3)[_0x0470('0x25')](handleEntityNotFound(_0x2b9018,null))[_0x0470('0x25')](respondWithResult(_0x2b9018,null))[_0x0470('0x45')](handleError(_0x2b9018,null));};exports['create']=function(_0x2c30e4,_0x102a9b){return db[_0x0470('0x2e')][_0x0470('0x48')](_0x2c30e4[_0x0470('0x49')],{})[_0x0470('0x25')](function(_0x3d6351){var _0x140398=_0x2c30e4[_0x0470('0x4a')][_0x0470('0x4b')]({'plain':!![]});if(!_0x140398)throw new Error(_0x0470('0x4c'));if(_0x140398['role']===_0x0470('0x4a')){var _0x7ca8c=_0x3d6351['get']({'plain':!![]});var _0x4a1b7=_0x0470('0x4d');return db[_0x0470('0x4e')][_0x0470('0x47')]({'where':{'name':_0x4a1b7,'userProfileId':_0x140398[_0x0470('0x4f')]},'raw':!![]})['then'](function(_0x9c4037){if(_0x9c4037&&_0x9c4037['autoAssociation']===0x0){return db['UserProfileResource'][_0x0470('0x48')]({'name':_0x7ca8c[_0x0470('0x2b')],'resourceId':_0x7ca8c['id'],'type':_0x9c4037[_0x0470('0x2b')],'sectionId':_0x9c4037['id']},{})[_0x0470('0x25')](function(){return _0x3d6351;});}else{return _0x3d6351;}})[_0x0470('0x45')](function(_0x14ddef){logger['error'](_0x0470('0x50'),_0x14ddef);throw _0x14ddef;});}return _0x3d6351;})[_0x0470('0x25')](respondWithResult(_0x102a9b,0xc9))['catch'](handleError(_0x102a9b,null));};exports[_0x0470('0x24')]=function(_0x453000,_0x31558c){if(_0x453000[_0x0470('0x49')]['id']){delete _0x453000[_0x0470('0x49')]['id'];}return db['VoiceChanSpy'][_0x0470('0x47')]({'where':{'id':_0x453000[_0x0470('0x46')]['id']}})['then'](handleEntityNotFound(_0x31558c,null))[_0x0470('0x25')](saveUpdates(_0x453000[_0x0470('0x49')],null))[_0x0470('0x25')](respondWithResult(_0x31558c,null))[_0x0470('0x45')](handleError(_0x31558c,null));};exports[_0x0470('0x27')]=function(_0x4c17b3,_0x1ddba9){return db[_0x0470('0x2e')]['find']({'where':{'id':_0x4c17b3[_0x0470('0x46')]['id']}})[_0x0470('0x25')](handleEntityNotFound(_0x1ddba9,null))[_0x0470('0x25')](removeEntity(_0x1ddba9,null))[_0x0470('0x45')](handleError(_0x1ddba9,null));};
\ No newline at end of file
+var _0x94ae=['error','name','send','index','map','VoiceChanSpy','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','UserProfileResource','end'];(function(_0x20508a,_0x3dac2c){var _0x5846fd=function(_0x2371bf){while(--_0x2371bf){_0x20508a['push'](_0x20508a['shift']());}};_0x5846fd(++_0x3dac2c);}(_0x94ae,0x11f));var _0xe94a=function(_0x13ce6d,_0x5984bf){_0x13ce6d=_0x13ce6d-0x0;var _0x397a06=_0x94ae[_0x13ce6d];return _0x397a06;};'use strict';var pdf=require(_0xe94a('0x0'));var emlformat=require(_0xe94a('0x1'));var rimraf=require(_0xe94a('0x2'));var zipdir=require(_0xe94a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe94a('0x4'));var BPromise=require(_0xe94a('0x5'));var Mustache=require(_0xe94a('0x6'));var util=require(_0xe94a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe94a('0x8'));var ejs=require(_0xe94a('0x9'));var fs=require('fs');var _=require(_0xe94a('0xa'));var squel=require('squel');var crypto=require(_0xe94a('0xb'));var jsforce=require(_0xe94a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe94a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe94a('0xd'));var authService=require(_0xe94a('0xe'));var qs=require(_0xe94a('0xf'));var as=require(_0xe94a('0x10'));var hardwareService=require(_0xe94a('0x11'));var logger=require(_0xe94a('0x12'))(_0xe94a('0x13'));var utils=require(_0xe94a('0x14'));var config=require('../../config/environment');var db=require(_0xe94a('0x15'))['db'];function respondWithStatusCode(_0x587fd9,_0x133258){_0x133258=_0x133258||0xcc;return function(_0x4c4b3c){if(_0x4c4b3c){return _0x587fd9[_0xe94a('0x16')](_0x133258);}return _0x587fd9[_0xe94a('0x17')](_0x133258)['end']();};}function respondWithResult(_0x3d5f2d,_0x42bf13){_0x42bf13=_0x42bf13||0xc8;return function(_0x20f1e2){if(_0x20f1e2){return _0x3d5f2d[_0xe94a('0x17')](_0x42bf13)[_0xe94a('0x18')](_0x20f1e2);}};}function respondWithFilteredResult(_0x263ab7,_0x5299ad){return function(_0x3c84e6){if(_0x3c84e6){var _0xc8c42f=_0x3c84e6[_0xe94a('0x19')],_0x43cc9b=_0x5299ad[_0xe94a('0x1a')],_0x4eecbf=_0x5299ad[_0xe94a('0x1a')]+_0x5299ad['limit'],_0x5590ce;if(_0x4eecbf>=_0xc8c42f){_0x4eecbf=_0xc8c42f;_0x5590ce=0xc8;}else{_0x5590ce=0xce;}_0x263ab7[_0xe94a('0x17')](_0x5590ce);return _0x263ab7['set'](_0xe94a('0x1b'),_0x43cc9b+'-'+_0x4eecbf+'/'+_0xc8c42f)[_0xe94a('0x18')](_0x3c84e6);}return null;};}function patchUpdates(_0x19aa49){return function(_0x529da5){try{jsonpatch[_0xe94a('0x1c')](_0x529da5,_0x19aa49,!![]);}catch(_0x5aedd0){return BPromise[_0xe94a('0x1d')](_0x5aedd0);}return _0x529da5['save']();};}function saveUpdates(_0xa3f5d2,_0x495316){return function(_0x136e6f){if(_0x136e6f){return _0x136e6f[_0xe94a('0x1e')](_0xa3f5d2)[_0xe94a('0x1f')](function(_0x5dad35){return _0x5dad35;});}return null;};}function removeEntity(_0x340805,_0x2db001){return function(_0x6f809b){if(_0x6f809b){return _0x6f809b[_0xe94a('0x20')]()[_0xe94a('0x1f')](function(){var _0x480ba7=_0x6f809b[_0xe94a('0x21')]({'plain':!![]});var _0x51e9bd=_0xe94a('0x22');return db[_0xe94a('0x23')][_0xe94a('0x20')]({'where':{'type':_0x51e9bd,'resourceId':_0x480ba7['id']}})[_0xe94a('0x1f')](function(){return _0x6f809b;});})['then'](function(){_0x340805[_0xe94a('0x17')](0xcc)[_0xe94a('0x24')]();});}};}function handleEntityNotFound(_0x543438,_0x2018e0){return function(_0x110c06){if(!_0x110c06){_0x543438['sendStatus'](0x194);}return _0x110c06;};}function handleError(_0x21aa20,_0x4524de){_0x4524de=_0x4524de||0x1f4;return function(_0x55fe35){logger[_0xe94a('0x25')](_0x55fe35['stack']);if(_0x55fe35[_0xe94a('0x26')]){delete _0x55fe35[_0xe94a('0x26')];}_0x21aa20[_0xe94a('0x17')](_0x4524de)[_0xe94a('0x27')](_0x55fe35);};}exports[_0xe94a('0x28')]=function(_0x159a89,_0x56c26c){var _0xdf04c8={},_0x4200ae={},_0x2c0644={'count':0x0,'rows':[]};var _0x502870=_[_0xe94a('0x29')](db[_0xe94a('0x2a')]['rawAttributes'],function(_0x3b9d7a){return{'name':_0x3b9d7a[_0xe94a('0x2b')],'type':_0x3b9d7a['type'][_0xe94a('0x2c')]};});_0x4200ae[_0xe94a('0x2d')]=_['map'](_0x502870,_0xe94a('0x26'));_0x4200ae[_0xe94a('0x2e')]=_[_0xe94a('0x2f')](_0x159a89['query']);_0x4200ae[_0xe94a('0x30')]=_[_0xe94a('0x31')](_0x4200ae[_0xe94a('0x2d')],_0x4200ae[_0xe94a('0x2e')]);_0xdf04c8['attributes']=_[_0xe94a('0x31')](_0x4200ae['model'],qs[_0xe94a('0x32')](_0x159a89[_0xe94a('0x2e')][_0xe94a('0x32')]));_0xdf04c8[_0xe94a('0x33')]=_0xdf04c8['attributes'][_0xe94a('0x34')]?_0xdf04c8[_0xe94a('0x33')]:_0x4200ae['model'];if(!_0x159a89[_0xe94a('0x2e')][_0xe94a('0x35')](_0xe94a('0x36'))){_0xdf04c8[_0xe94a('0x37')]=qs[_0xe94a('0x37')](_0x159a89['query'][_0xe94a('0x37')]);_0xdf04c8[_0xe94a('0x1a')]=qs['offset'](_0x159a89[_0xe94a('0x2e')][_0xe94a('0x1a')]);}_0xdf04c8[_0xe94a('0x38')]=qs['sort'](_0x159a89[_0xe94a('0x2e')][_0xe94a('0x39')]);_0xdf04c8['where']=qs['filters'](_[_0xe94a('0x3a')](_0x159a89[_0xe94a('0x2e')],_0x4200ae[_0xe94a('0x30')]),_0x502870);if(_0x159a89[_0xe94a('0x2e')]['filter']){_0xdf04c8[_0xe94a('0x3b')]=_[_0xe94a('0x3c')](_0xdf04c8[_0xe94a('0x3b')],{'$or':_['map'](_0x502870,function(_0x21fb74){if(_0x21fb74[_0xe94a('0x3d')]!==_0xe94a('0x3e')){var _0x3fe580={};_0x3fe580[_0x21fb74[_0xe94a('0x26')]]={'$like':'%'+_0x159a89[_0xe94a('0x2e')]['filter']+'%'};return _0x3fe580;}})});}_0xdf04c8=_[_0xe94a('0x3c')]({},_0xdf04c8,_0x159a89['options']);var _0x2bab3a={'where':_0xdf04c8['where']};return db[_0xe94a('0x2a')][_0xe94a('0x19')](_0x2bab3a)['then'](function(_0x51acdb){_0x2c0644['count']=_0x51acdb;if(_0x159a89[_0xe94a('0x2e')][_0xe94a('0x3f')]){_0xdf04c8[_0xe94a('0x40')]=[{'all':!![]}];}return db[_0xe94a('0x2a')][_0xe94a('0x41')](_0xdf04c8);})[_0xe94a('0x1f')](function(_0x885576){_0x2c0644[_0xe94a('0x42')]=_0x885576;return _0x2c0644;})[_0xe94a('0x1f')](respondWithFilteredResult(_0x56c26c,_0xdf04c8))['catch'](handleError(_0x56c26c,null));};exports[_0xe94a('0x43')]=function(_0x57fef2,_0x5a3b53){var _0x27ea9d={'raw':![],'where':{'id':_0x57fef2[_0xe94a('0x44')]['id']}},_0x4ec268={};_0x4ec268[_0xe94a('0x2d')]=_[_0xe94a('0x2f')](db[_0xe94a('0x2a')][_0xe94a('0x45')]);_0x4ec268['query']=_[_0xe94a('0x2f')](_0x57fef2[_0xe94a('0x2e')]);_0x4ec268[_0xe94a('0x30')]=_[_0xe94a('0x31')](_0x4ec268[_0xe94a('0x2d')],_0x4ec268[_0xe94a('0x2e')]);_0x27ea9d['attributes']=_[_0xe94a('0x31')](_0x4ec268['model'],qs[_0xe94a('0x32')](_0x57fef2[_0xe94a('0x2e')][_0xe94a('0x32')]));_0x27ea9d[_0xe94a('0x33')]=_0x27ea9d[_0xe94a('0x33')][_0xe94a('0x34')]?_0x27ea9d[_0xe94a('0x33')]:_0x4ec268['model'];if(_0x57fef2[_0xe94a('0x2e')][_0xe94a('0x3f')]){_0x27ea9d[_0xe94a('0x40')]=[{'all':!![]}];}_0x27ea9d=_[_0xe94a('0x3c')]({},_0x27ea9d,_0x57fef2[_0xe94a('0x46')]);return db[_0xe94a('0x2a')][_0xe94a('0x47')](_0x27ea9d)[_0xe94a('0x1f')](handleEntityNotFound(_0x5a3b53,null))[_0xe94a('0x1f')](respondWithResult(_0x5a3b53,null))[_0xe94a('0x48')](handleError(_0x5a3b53,null));};exports['create']=function(_0x53d7e7,_0x2635df){return db[_0xe94a('0x2a')][_0xe94a('0x49')](_0x53d7e7[_0xe94a('0x4a')],{})['then'](function(_0x5917ee){var _0x37195a=_0x53d7e7['user'][_0xe94a('0x21')]({'plain':!![]});if(!_0x37195a)throw new Error(_0xe94a('0x4b'));if(_0x37195a[_0xe94a('0x4c')]===_0xe94a('0x4d')){var _0x492754=_0x5917ee[_0xe94a('0x21')]({'plain':!![]});var _0x583aae=_0xe94a('0x22');return db[_0xe94a('0x4e')][_0xe94a('0x47')]({'where':{'name':_0x583aae,'userProfileId':_0x37195a['userProfileId']},'raw':!![]})['then'](function(_0x2738a0){if(_0x2738a0&&_0x2738a0[_0xe94a('0x4f')]===0x0){return db[_0xe94a('0x23')][_0xe94a('0x49')]({'name':_0x492754[_0xe94a('0x26')],'resourceId':_0x492754['id'],'type':_0x2738a0[_0xe94a('0x26')],'sectionId':_0x2738a0['id']},{})['then'](function(){return _0x5917ee;});}else{return _0x5917ee;}})[_0xe94a('0x48')](function(_0x534a62){logger[_0xe94a('0x25')](_0xe94a('0x50'),_0x534a62);throw _0x534a62;});}return _0x5917ee;})[_0xe94a('0x1f')](respondWithResult(_0x2635df,0xc9))['catch'](handleError(_0x2635df,null));};exports[_0xe94a('0x1e')]=function(_0xb26b42,_0x8bf36){if(_0xb26b42[_0xe94a('0x4a')]['id']){delete _0xb26b42[_0xe94a('0x4a')]['id'];}return db[_0xe94a('0x2a')]['find']({'where':{'id':_0xb26b42['params']['id']}})['then'](handleEntityNotFound(_0x8bf36,null))[_0xe94a('0x1f')](saveUpdates(_0xb26b42[_0xe94a('0x4a')],null))[_0xe94a('0x1f')](respondWithResult(_0x8bf36,null))[_0xe94a('0x48')](handleError(_0x8bf36,null));};exports[_0xe94a('0x20')]=function(_0x7bfb68,_0x19af63){return db[_0xe94a('0x2a')][_0xe94a('0x47')]({'where':{'id':_0x7bfb68[_0xe94a('0x44')]['id']}})[_0xe94a('0x1f')](handleEntityNotFound(_0x19af63,null))[_0xe94a('0x1f')](removeEntity(_0x19af63,null))[_0xe94a('0x48')](handleError(_0x19af63,null));};
\ No newline at end of file
index 5574083..9828577 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x252b=['Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','then','catch','exports','models','define','VoiceChanSpy','VoiceExtension','bulkCreate','lodash','util','bluebird','context','%s%s','prefix','system','push','merge','Set','format','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','auth'];(function(_0x593d89,_0x45145f){var _0x4aa403=function(_0x21f674){while(--_0x21f674){_0x593d89['push'](_0x593d89['shift']());}};_0x4aa403(++_0x45145f);}(_0x252b,0x117));var _0xb252=function(_0x1fd8b3,_0x3bd29a){_0x1fd8b3=_0x1fd8b3-0x0;var _0x1f461f=_0x252b[_0x1fd8b3];return _0x1f461f;};'use strict';var _=require(_0xb252('0x0'));var util=require(_0xb252('0x1'));var BPromise=require(_0xb252('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x18267a,_0x26e43d,_0x5f545b){var _0x441e74=0x1;var _0x43947d=[];var _0x2519fa={'context':_0x26e43d[_0xb252('0x3')]||'from-sip','exten':util['format'](_0xb252('0x4'),_0x18267a[_0xb252('0x5')],_0x5f545b),'type':_0xb252('0x6'),'isApp':![],'ChanSpyId':_0x18267a['id'],'UserId':_0x26e43d['id']};_0x43947d[_0xb252('0x7')](_[_0xb252('0x8')]({'app':_0xb252('0x9'),'appdata':util[_0xb252('0xa')](_0xb252('0xb'),_0xb252('0xc')),'priority':_0x441e74++},_0x2519fa));if(_0x18267a[_0xb252('0xd')]){_0x43947d[_0xb252('0x7')](_[_0xb252('0x8')]({'app':_0xb252('0xe'),'appdata':util[_0xb252('0xa')](_0xb252('0xf'),_0x18267a['recordingFormat']),'priority':_0x441e74++},_0x2519fa));}if(_0x18267a[_0xb252('0x10')]){_0x43947d[_0xb252('0x7')](_['merge']({'app':_0xb252('0x11'),'appdata':_0x18267a['password'],'priority':_0x441e74++},_0x2519fa));}_0x43947d[_0xb252('0x7')](_['merge']({'app':_0xb252('0x12'),'appdata':util[_0xb252('0xa')](_0xb252('0x13'),_0x26e43d[_0xb252('0x14')],_0x18267a[_0xb252('0x15')]?_0x18267a[_0xb252('0x15')][_0xb252('0x16')](''):''),'priority':_0x441e74++},_0x2519fa));if(_0x18267a[_0xb252('0xd')]){_0x43947d[_0xb252('0x7')](_[_0xb252('0x8')]({'app':_0xb252('0x17'),'priority':_0x441e74++},_0x2519fa));}return _0x43947d;};var getChanSpyApplications=function(_0x1ea9d6,_0x386e0b){var _0x37d992=[];for(var _0x4d5977=0x0,_0xcc2aa6=0x1;_0x4d5977<_0x386e0b[_0xb252('0x18')];_0x4d5977++,_0xcc2aa6=0x1){_0x37d992=_0x37d992[_0xb252('0x19')](getUserApplications(_0x1ea9d6,_0x386e0b[_0x4d5977],_0x386e0b[_0x4d5977][_0xb252('0x1a')]));if(_0x386e0b[_0x4d5977][_0xb252('0x1a')]!=_0x386e0b[_0x4d5977]['name']){_0x37d992=_0x37d992[_0xb252('0x19')](getUserApplications(_0x1ea9d6,_0x386e0b[_0x4d5977],_0x386e0b[_0x4d5977]['name']));}}return _0x37d992;};var getChanSpyPromise=function(_0x5defed,_0x4c493b){return new BPromise(function(_0x566558,_0x40cfc2){return _0x5defed[_0xb252('0x1b')][_0xb252('0x1c')]({'attributes':['id',_0xb252('0x14'),_0xb252('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xb252('0x1d')](function(_0x163e8b){if(_0x163e8b){return _0x566558(getChanSpyApplications(_0x4c493b,_0x163e8b));}return _0x566558([]);})[_0xb252('0x1e')](function(_0x53c0a1){_0x40cfc2(_0x53c0a1);});});};module[_0xb252('0x1f')]=function(_0x1c65b6,_0x923f18){var _0x3d6bd7=_0x1c65b6[_0xb252('0x20')];return _0x1c65b6[_0xb252('0x21')](_0xb252('0x22'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4faa76,_0x3ed70c,_0x57d5e6){return getChanSpyPromise(_0x3d6bd7,_0x4faa76)['then'](function(_0x3e5cde){if(_0x3e5cde&&_0x3e5cde[_0xb252('0x18')]){return _0x3d6bd7[_0xb252('0x23')]['bulkCreate'](_0x3e5cde);}})[_0xb252('0x1d')](function(){_0x57d5e6();})[_0xb252('0x1e')](function(_0x53599c){_0x57d5e6(_0x53599c);});},'afterUpdate':function(_0x113644,_0x1031f8,_0x1110d9){return _0x3d6bd7[_0xb252('0x23')]['destroy']({'where':{'ChanSpyId':_0x113644['id']}})[_0xb252('0x1d')](function(){return getChanSpyPromise(_0x3d6bd7,_0x113644);})['then'](function(_0x324448){if(_0x324448&&_0x324448[_0xb252('0x18')]){return _0x3d6bd7[_0xb252('0x23')][_0xb252('0x24')](_0x324448);}})[_0xb252('0x1d')](function(){_0x1110d9();})['catch'](function(_0xc293ce){_0x1110d9(_0xc293ce);});},'afterDestroy':function(_0x50bd3e,_0x14f565,_0x3e464c){return _0x3d6bd7['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x50bd3e['id']}})[_0xb252('0x1d')](function(){_0x3e464c();})[_0xb252('0x1e')](function(_0x564c6d){_0x3e464c(_0x564c6d);});}}});};
\ No newline at end of file
+var _0x7aa2=['findAll','agent','exports','models','define','VoiceChanSpy','bulkCreate','then','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x7aa2,0x132));var _0x27aa=function(_0x2ad3fd,_0x24c202){_0x2ad3fd=_0x2ad3fd-0x0;var _0x30fe82=_0x7aa2[_0x2ad3fd];return _0x30fe82;};'use strict';var _=require(_0x27aa('0x0'));var util=require(_0x27aa('0x1'));var BPromise=require(_0x27aa('0x2'));var attributes=require(_0x27aa('0x3'));var getUserApplications=function(_0x314105,_0x12f901,_0x1b9507){var _0x544908=0x1;var _0x1c3b4d=[];var _0x18f9ec={'context':_0x12f901[_0x27aa('0x4')]||'from-sip','exten':util[_0x27aa('0x5')](_0x27aa('0x6'),_0x314105[_0x27aa('0x7')],_0x1b9507),'type':_0x27aa('0x8'),'isApp':![],'ChanSpyId':_0x314105['id'],'UserId':_0x12f901['id']};_0x1c3b4d[_0x27aa('0x9')](_[_0x27aa('0xa')]({'app':'Set','appdata':util[_0x27aa('0x5')](_0x27aa('0xb'),_0x27aa('0xc')),'priority':_0x544908++},_0x18f9ec));if(_0x314105[_0x27aa('0xd')]){_0x1c3b4d[_0x27aa('0x9')](_[_0x27aa('0xa')]({'app':_0x27aa('0xe'),'appdata':util['format'](_0x27aa('0xf'),_0x314105[_0x27aa('0x10')]),'priority':_0x544908++},_0x18f9ec));}if(_0x314105['auth']){_0x1c3b4d[_0x27aa('0x9')](_[_0x27aa('0xa')]({'app':'Authenticate','appdata':_0x314105[_0x27aa('0x11')],'priority':_0x544908++},_0x18f9ec));}_0x1c3b4d[_0x27aa('0x9')](_[_0x27aa('0xa')]({'app':_0x27aa('0x12'),'appdata':util[_0x27aa('0x5')](_0x27aa('0x13'),_0x12f901[_0x27aa('0x14')],_0x314105[_0x27aa('0x15')]?_0x314105[_0x27aa('0x15')][_0x27aa('0x16')](''):''),'priority':_0x544908++},_0x18f9ec));if(_0x314105[_0x27aa('0xd')]){_0x1c3b4d[_0x27aa('0x9')](_[_0x27aa('0xa')]({'app':_0x27aa('0x17'),'priority':_0x544908++},_0x18f9ec));}return _0x1c3b4d;};var getChanSpyApplications=function(_0x4ed3fb,_0x1b949a){var _0xeb2090=[];for(var _0x40a7a7=0x0,_0x4bcfe1=0x1;_0x40a7a7<_0x1b949a[_0x27aa('0x18')];_0x40a7a7++,_0x4bcfe1=0x1){_0xeb2090=_0xeb2090[_0x27aa('0x19')](getUserApplications(_0x4ed3fb,_0x1b949a[_0x40a7a7],_0x1b949a[_0x40a7a7][_0x27aa('0x1a')]));if(_0x1b949a[_0x40a7a7][_0x27aa('0x1a')]!=_0x1b949a[_0x40a7a7][_0x27aa('0x14')]){_0xeb2090=_0xeb2090['concat'](getUserApplications(_0x4ed3fb,_0x1b949a[_0x40a7a7],_0x1b949a[_0x40a7a7][_0x27aa('0x14')]));}}return _0xeb2090;};var getChanSpyPromise=function(_0x3519ea,_0x344e9e){return new BPromise(function(_0x2abe7b,_0x2788c7){return _0x3519ea['User'][_0x27aa('0x1b')]({'attributes':['id','name',_0x27aa('0x1a')],'where':{'role':_0x27aa('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x251e60){if(_0x251e60){return _0x2abe7b(getChanSpyApplications(_0x344e9e,_0x251e60));}return _0x2abe7b([]);})['catch'](function(_0x3a119f){_0x2788c7(_0x3a119f);});});};module[_0x27aa('0x1d')]=function(_0x216160,_0x19076a){var _0x466a69=_0x216160[_0x27aa('0x1e')];return _0x216160[_0x27aa('0x1f')](_0x27aa('0x20'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4bd438,_0x27782b,_0x49a75d){return getChanSpyPromise(_0x466a69,_0x4bd438)['then'](function(_0x171ac2){if(_0x171ac2&&_0x171ac2[_0x27aa('0x18')]){return _0x466a69['VoiceExtension'][_0x27aa('0x21')](_0x171ac2);}})[_0x27aa('0x22')](function(){_0x49a75d();})[_0x27aa('0x23')](function(_0x3909a4){_0x49a75d(_0x3909a4);});},'afterUpdate':function(_0x6bd317,_0x429586,_0x56d2b3){return _0x466a69['VoiceExtension'][_0x27aa('0x24')]({'where':{'ChanSpyId':_0x6bd317['id']}})[_0x27aa('0x22')](function(){return getChanSpyPromise(_0x466a69,_0x6bd317);})[_0x27aa('0x22')](function(_0x4f4ced){if(_0x4f4ced&&_0x4f4ced[_0x27aa('0x18')]){return _0x466a69['VoiceExtension'][_0x27aa('0x21')](_0x4f4ced);}})[_0x27aa('0x22')](function(){_0x56d2b3();})[_0x27aa('0x23')](function(_0x4296d9){_0x56d2b3(_0x4296d9);});},'afterDestroy':function(_0x308b44,_0x91a913,_0xcc83ae){return _0x466a69['VoiceExtension'][_0x27aa('0x24')]({'where':{'ChanSpyId':_0x308b44['id']}})[_0x27aa('0x22')](function(){_0xcc83ae();})[_0x27aa('0x23')](function(_0x1bf4c6){_0xcc83ae(_0x1bf4c6);});}}});};
\ No newline at end of file
index 47af315..edfb442 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdaa7=['util','moment','../../config/utils','rpc','jayson/promise','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x59fc9e,_0x4f40a5){var _0x4eb4e9=function(_0x58a134){while(--_0x58a134){_0x59fc9e['push'](_0x59fc9e['shift']());}};_0x4eb4e9(++_0x4f40a5);}(_0xdaa7,0x77));var _0x7daa=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xdaa7[_0x19babd];return _0x314eaf;};'use strict';var _=require(_0x7daa('0x0'));var util=require(_0x7daa('0x1'));var moment=require(_0x7daa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7daa('0x3'));var logger=require('../../config/logger')(_0x7daa('0x4'));var config=require('../../config/environment');var jayson=require(_0x7daa('0x5'));var client=jayson['client'][_0x7daa('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x39ff06,_0x4a9e2a,_0x20f4a3){return new BPromise(function(_0x4012f4,_0x411772){return client[_0x7daa('0x7')](_0x39ff06,_0x20f4a3)[_0x7daa('0x8')](function(_0x41fe66){logger['info'](_0x7daa('0x9'),_0x4a9e2a,_0x7daa('0xa'));logger[_0x7daa('0xb')](_0x7daa('0xc'),_0x4a9e2a,'request\x20sent',JSON[_0x7daa('0xd')](_0x41fe66));if(_0x41fe66['error']){if(_0x41fe66[_0x7daa('0xe')][_0x7daa('0xf')]===0x1f4){logger[_0x7daa('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x4a9e2a,_0x41fe66[_0x7daa('0xe')][_0x7daa('0x10')]);return _0x411772(_0x41fe66['error'][_0x7daa('0x10')]);}logger[_0x7daa('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x4a9e2a,_0x41fe66['error'][_0x7daa('0x10')]);return _0x4012f4(_0x41fe66[_0x7daa('0xe')][_0x7daa('0x10')]);}else{logger[_0x7daa('0x11')](_0x7daa('0x9'),_0x4a9e2a,_0x7daa('0xa'));_0x4012f4(_0x41fe66[_0x7daa('0x12')][_0x7daa('0x10')]);}})[_0x7daa('0x13')](function(_0xc43c40){logger[_0x7daa('0xe')](_0x7daa('0x9'),_0x4a9e2a,_0xc43c40);_0x411772(_0xc43c40);});});}
\ No newline at end of file
+var _0x33e1=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','debug','request\x20sent','error','code','VoiceChanSpy,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring'];(function(_0x10fe13,_0x3942a5){var _0x13d436=function(_0x2af9e8){while(--_0x2af9e8){_0x10fe13['push'](_0x10fe13['shift']());}};_0x13d436(++_0x3942a5);}(_0x33e1,0x1b1));var _0x133e=function(_0xe83481,_0x44f914){_0xe83481=_0xe83481-0x0;var _0x99576d=_0x33e1[_0xe83481];return _0x99576d;};'use strict';var _=require('lodash');var util=require(_0x133e('0x0'));var moment=require(_0x133e('0x1'));var BPromise=require(_0x133e('0x2'));var rs=require(_0x133e('0x3'));var fs=require('fs');var Redis=require(_0x133e('0x4'));var db=require(_0x133e('0x5'))['db'];var utils=require(_0x133e('0x6'));var logger=require(_0x133e('0x7'))(_0x133e('0x8'));var config=require('../../config/environment');var jayson=require(_0x133e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1dd918,_0x599007,_0x378c10){return new BPromise(function(_0x489e00,_0x23be06){return client['request'](_0x1dd918,_0x378c10)[_0x133e('0xa')](function(_0x20f525){logger[_0x133e('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x599007,'request\x20sent');logger[_0x133e('0xc')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x599007,_0x133e('0xd'),JSON['stringify'](_0x20f525));if(_0x20f525[_0x133e('0xe')]){if(_0x20f525[_0x133e('0xe')][_0x133e('0xf')]===0x1f4){logger['error'](_0x133e('0x10'),_0x599007,_0x20f525['error']['message']);return _0x23be06(_0x20f525[_0x133e('0xe')][_0x133e('0x11')]);}logger['error'](_0x133e('0x10'),_0x599007,_0x20f525[_0x133e('0xe')][_0x133e('0x11')]);return _0x489e00(_0x20f525[_0x133e('0xe')][_0x133e('0x11')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x599007,_0x133e('0xd'));_0x489e00(_0x20f525['result'][_0x133e('0x11')]);}})[_0x133e('0x12')](function(_0x56430a){logger['error'](_0x133e('0x10'),_0x599007,_0x56430a);_0x23be06(_0x56430a);});});}
\ No newline at end of file
index a9a73ea..88c57a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28a2=['util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28a2,0x76));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x228a('0x0'));var util=require(_0x228a('0x1'));var path=require(_0x228a('0x2'));var timeout=require('connect-timeout');var express=require(_0x228a('0x3'));var router=express['Router']();var auth=require(_0x228a('0x4'));var interaction=require(_0x228a('0x5'));var config=require(_0x228a('0x6'));var controller=require(_0x228a('0x7'));router['get']('/',auth[_0x228a('0x8')](),controller[_0x228a('0x9')]);router['get'](_0x228a('0xa'),auth[_0x228a('0x8')](),controller[_0x228a('0xb')]);router['post']('/',auth[_0x228a('0x8')](),controller[_0x228a('0xc')]);router[_0x228a('0xd')](_0x228a('0xa'),auth[_0x228a('0x8')](),controller[_0x228a('0xe')]);router[_0x228a('0xf')](_0x228a('0xa'),auth[_0x228a('0x8')](),controller[_0x228a('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x1b14=['post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x660afc,_0x361712){var _0x51d99f=function(_0x213048){while(--_0x213048){_0x660afc['push'](_0x660afc['shift']());}};_0x51d99f(++_0x361712);}(_0x1b14,0x15c));var _0x41b1=function(_0xabd4c3,_0x25d6f0){_0xabd4c3=_0xabd4c3-0x0;var _0x1a71fe=_0x1b14[_0xabd4c3];return _0x1a71fe;};'use strict';var multer=require(_0x41b1('0x0'));var util=require('util');var path=require(_0x41b1('0x1'));var timeout=require(_0x41b1('0x2'));var express=require(_0x41b1('0x3'));var router=express[_0x41b1('0x4')]();var auth=require(_0x41b1('0x5'));var interaction=require(_0x41b1('0x6'));var config=require(_0x41b1('0x7'));var controller=require('./voiceContext.controller');router['get']('/',auth[_0x41b1('0x8')](),controller[_0x41b1('0x9')]);router[_0x41b1('0xa')](_0x41b1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x41b1('0xc')]('/',auth['isAuthenticated'](),controller[_0x41b1('0xd')]);router['put'](_0x41b1('0xb'),auth['isAuthenticated'](),controller[_0x41b1('0xe')]);router[_0x41b1('0xf')](_0x41b1('0xb'),auth[_0x41b1('0x8')](),controller[_0x41b1('0x10')]);module[_0x41b1('0x11')]=router;
\ No newline at end of file
index f1b63df..3644809 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x5d7e06,_0x1d479e){var _0x30358e=function(_0x10a7f1){while(--_0x10a7f1){_0x5d7e06['push'](_0x5d7e06['shift']());}};_0x30358e(++_0x1d479e);}(_0x34e8,0x12c));var _0x834e=function(_0x412b36,_0x4ac287){_0x412b36=_0x412b36-0x0;var _0x3a61d3=_0x34e8[_0x412b36];return _0x3a61d3;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'unique':_0x834e('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x834e('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x51de81,_0x4d20ea){var _0x2703e2=function(_0x8929a8){while(--_0x8929a8){_0x51de81['push'](_0x51de81['shift']());}};_0x2703e2(++_0x4d20ea);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 0ebd24a..6eb6cf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','VoiceContext,\x20%s,\x20%s','error','message','info','request\x20sent','catch','sendStatus','status','end','count','offset','limit','apply','reject','save','update','get','Contexts','UserProfileResource','destroy','stack','name','index','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','create','body','join','root','server/files/templates/context.ejs','render','writeFileSync','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','/etc/asterisk/extensions_xcally_contexts.conf','readFileSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger'];(function(_0x179420,_0x32aa73){var _0x5e556a=function(_0x330216){while(--_0x330216){_0x179420['push'](_0x179420['shift']());}};_0x5e556a(++_0x32aa73);}(_0x008c,0x188));var _0xc008=function(_0xa6b022,_0x1a5f5d){_0xa6b022=_0xa6b022-0x0;var _0x143909=_0x008c[_0xa6b022];return _0x143909;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');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 db=require(_0xc008('0x16'))['db'];var jayson=require(_0xc008('0x17'));var client=jayson[_0xc008('0x18')][_0xc008('0x19')]({'port':0x232a});function checkPasswordPattern(_0x69726e,_0x593f7a,_0x560e28){if(_0x560e28){var _0x33f44c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33f44c['test'](_0x593f7a)){return _0x69726e;}else{throw new db[(_0xc008('0x1a'))][(_0xc008('0x1b'))](_0xc008('0x1c'));}}else{return _0x69726e;}}function respondWithRpcPromise(_0x339ffc,_0x3f0ecf,_0x5ee00b,_0x5e894e){return new BPromise(function(_0x4bd0f4,_0x11ef38){var _0x15a6ad=_0x5e894e||client;return _0x15a6ad[_0xc008('0x1d')](_0x339ffc,_0x5ee00b)[_0xc008('0x1e')](function(_0x4fe771){logger['info']('VoiceContext,\x20%s,\x20%s',_0x3f0ecf,'request\x20sent');logger[_0xc008('0x1f')](_0xc008('0x20'),_0x3f0ecf,'request\x20sent',JSON[_0xc008('0x21')](_0x4fe771));if(_0x4fe771['error']){if(_0x4fe771['error']['code']===0x1f4){logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771['error']['message']);return _0x11ef38(_0x4fe771['error']['message']);}logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);return _0x4bd0f4(_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);}else{logger[_0xc008('0x25')]('VoiceContext,\x20%s,\x20%s',_0x3f0ecf,_0xc008('0x26'));_0x4bd0f4(_0x4fe771['result']['message']);}})[_0xc008('0x27')](function(_0x36f358){logger[_0xc008('0x23')](_0xc008('0x22'),_0x3f0ecf,_0x36f358);_0x11ef38(_0x36f358);});});}function respondWithStatusCode(_0x5410f5,_0x48582b){_0x48582b=_0x48582b||0xcc;return function(_0x5de1e9){if(_0x5de1e9){return _0x5410f5[_0xc008('0x28')](_0x48582b);}return _0x5410f5[_0xc008('0x29')](_0x48582b)[_0xc008('0x2a')]();};}function respondWithResult(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0xc8;return function(_0x5e2aca){if(_0x5e2aca){return _0x2e31c2['status'](_0x5bebd9)['json'](_0x5e2aca);}};}function respondWithFilteredResult(_0x4caaf4,_0x3865c0){return function(_0x29ba43){if(_0x29ba43){var _0x25eae4=_0x29ba43[_0xc008('0x2b')],_0x529961=_0x3865c0[_0xc008('0x2c')],_0x24c14c=_0x3865c0['offset']+_0x3865c0[_0xc008('0x2d')],_0x32390d;if(_0x24c14c>=_0x25eae4){_0x24c14c=_0x25eae4;_0x32390d=0xc8;}else{_0x32390d=0xce;}_0x4caaf4[_0xc008('0x29')](_0x32390d);return _0x4caaf4['set']('Content-Range',_0x529961+'-'+_0x24c14c+'/'+_0x25eae4)['json'](_0x29ba43);}return null;};}function patchUpdates(_0x1032b2){return function(_0x267abd){try{jsonpatch[_0xc008('0x2e')](_0x267abd,_0x1032b2,!![]);}catch(_0x10889f){return BPromise[_0xc008('0x2f')](_0x10889f);}return _0x267abd[_0xc008('0x30')]();};}function saveUpdates(_0x294f97,_0x22d8e8){return function(_0x1fe1e1){if(_0x1fe1e1){return _0x1fe1e1[_0xc008('0x31')](_0x294f97)[_0xc008('0x1e')](function(_0x1ac7c8){return _0x1ac7c8;});}return null;};}function removeEntity(_0x596ee8,_0x334a09){return function(_0x4b7fd4){if(_0x4b7fd4){return _0x4b7fd4['destroy']()[_0xc008('0x1e')](function(){var _0x165a7b=_0x4b7fd4[_0xc008('0x32')]({'plain':!![]});var _0xca0520=_0xc008('0x33');return db[_0xc008('0x34')][_0xc008('0x35')]({'where':{'type':_0xca0520,'resourceId':_0x165a7b['id']}})[_0xc008('0x1e')](function(){return _0x4b7fd4;});})[_0xc008('0x1e')](function(){_0x596ee8['status'](0xcc)[_0xc008('0x2a')]();});}};}function handleEntityNotFound(_0x389a40,_0x459df4){return function(_0x344bad){if(!_0x344bad){_0x389a40[_0xc008('0x28')](0x194);}return _0x344bad;};}function handleError(_0x315562,_0x1667a0){_0x1667a0=_0x1667a0||0x1f4;return function(_0x5d0e06){logger[_0xc008('0x23')](_0x5d0e06[_0xc008('0x36')]);if(_0x5d0e06['name']){delete _0x5d0e06[_0xc008('0x37')];}_0x315562[_0xc008('0x29')](_0x1667a0)['send'](_0x5d0e06);};}exports[_0xc008('0x38')]=function(_0x2e4ae1,_0x280e9b){var _0x55ff48={},_0x53b353={},_0x478810={'count':0x0,'rows':[]};var _0x234f2a=_['map'](db[_0xc008('0x39')][_0xc008('0x3a')],function(_0x6a4ccb){return{'name':_0x6a4ccb[_0xc008('0x3b')],'type':_0x6a4ccb[_0xc008('0x3c')][_0xc008('0x3d')]};});_0x53b353[_0xc008('0x3e')]=_[_0xc008('0x3f')](_0x234f2a,_0xc008('0x37'));_0x53b353[_0xc008('0x40')]=_[_0xc008('0x41')](_0x2e4ae1[_0xc008('0x40')]);_0x53b353[_0xc008('0x42')]=_[_0xc008('0x43')](_0x53b353['model'],_0x53b353[_0xc008('0x40')]);_0x55ff48[_0xc008('0x44')]=_[_0xc008('0x43')](_0x53b353[_0xc008('0x3e')],qs['fields'](_0x2e4ae1[_0xc008('0x40')][_0xc008('0x45')]));_0x55ff48[_0xc008('0x44')]=_0x55ff48[_0xc008('0x44')][_0xc008('0x46')]?_0x55ff48['attributes']:_0x53b353[_0xc008('0x3e')];if(!_0x2e4ae1[_0xc008('0x40')][_0xc008('0x47')](_0xc008('0x48'))){_0x55ff48[_0xc008('0x2d')]=qs['limit'](_0x2e4ae1[_0xc008('0x40')][_0xc008('0x2d')]);_0x55ff48[_0xc008('0x2c')]=qs[_0xc008('0x2c')](_0x2e4ae1['query'][_0xc008('0x2c')]);}_0x55ff48[_0xc008('0x49')]=qs[_0xc008('0x4a')](_0x2e4ae1['query'][_0xc008('0x4a')]);_0x55ff48['where']=qs[_0xc008('0x42')](_['pick'](_0x2e4ae1[_0xc008('0x40')],_0x53b353[_0xc008('0x42')]),_0x234f2a);if(_0x2e4ae1['query'][_0xc008('0x4b')]){_0x55ff48[_0xc008('0x4c')]=_[_0xc008('0x4d')](_0x55ff48['where'],{'$or':_[_0xc008('0x3f')](_0x234f2a,function(_0x2a9b5c){if(_0x2a9b5c[_0xc008('0x3c')]!==_0xc008('0x4e')){var _0x347629={};_0x347629[_0x2a9b5c[_0xc008('0x37')]]={'$like':'%'+_0x2e4ae1['query']['filter']+'%'};return _0x347629;}})});}_0x55ff48=_['merge']({},_0x55ff48,_0x2e4ae1[_0xc008('0x4f')]);var _0x36417a={'where':_0x55ff48[_0xc008('0x4c')]};return db[_0xc008('0x39')][_0xc008('0x2b')](_0x36417a)[_0xc008('0x1e')](function(_0x2cf641){_0x478810[_0xc008('0x2b')]=_0x2cf641;if(_0x2e4ae1['query']['includeAll']){_0x55ff48['include']=[{'all':!![]}];}return db[_0xc008('0x39')][_0xc008('0x50')](_0x55ff48);})[_0xc008('0x1e')](function(_0x511383){_0x478810[_0xc008('0x51')]=_0x511383;return _0x478810;})[_0xc008('0x1e')](respondWithFilteredResult(_0x280e9b,_0x55ff48))[_0xc008('0x27')](handleError(_0x280e9b,null));};exports[_0xc008('0x52')]=function(_0x4981b4,_0x56e4ac){var _0x17ec90={'raw':![],'where':{'id':_0x4981b4[_0xc008('0x53')]['id']}},_0x405e87={};_0x405e87[_0xc008('0x3e')]=_['keys'](db['VoiceContext'][_0xc008('0x3a')]);_0x405e87['query']=_[_0xc008('0x41')](_0x4981b4[_0xc008('0x40')]);_0x405e87[_0xc008('0x42')]=_['intersection'](_0x405e87[_0xc008('0x3e')],_0x405e87[_0xc008('0x40')]);_0x17ec90[_0xc008('0x44')]=_[_0xc008('0x43')](_0x405e87[_0xc008('0x3e')],qs['fields'](_0x4981b4[_0xc008('0x40')][_0xc008('0x45')]));_0x17ec90['attributes']=_0x17ec90[_0xc008('0x44')][_0xc008('0x46')]?_0x17ec90['attributes']:_0x405e87['model'];if(_0x4981b4[_0xc008('0x40')][_0xc008('0x54')]){_0x17ec90[_0xc008('0x55')]=[{'all':!![]}];}_0x17ec90=_[_0xc008('0x4d')]({},_0x17ec90,_0x4981b4[_0xc008('0x4f')]);return db['VoiceContext']['find'](_0x17ec90)[_0xc008('0x1e')](handleEntityNotFound(_0x56e4ac,null))['then'](respondWithResult(_0x56e4ac,null))[_0xc008('0x27')](handleError(_0x56e4ac,null));};exports[_0xc008('0x56')]=function(_0xf94fcb,_0x2f1105,_0x44f42d){var _0x27a167;return db['VoiceContext'][_0xc008('0x56')](_0xf94fcb[_0xc008('0x57')],{'raw':!![]})[_0xc008('0x1e')](function(_0x2b350c){_0x27a167=_0x2b350c;return db[_0xc008('0x39')]['findAll']({'raw':!![]});})[_0xc008('0x1e')](function(_0x4fdab4){var _0x535e6e=fs['readFileSync'](path[_0xc008('0x58')](config[_0xc008('0x59')],_0xc008('0x5a')),'utf8');var _0x3aeeab=ejs[_0xc008('0x5b')](_0x535e6e,{'contexts':_0x4fdab4||[]});fs[_0xc008('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3aeeab);})[_0xc008('0x1e')](function(){return respondWithRpcPromise(_0xc008('0x5d'),_0xc008('0x56'),{'module':_0xc008('0x5e')});})['then'](function(){var _0x4022dd=_0xf94fcb['user'][_0xc008('0x32')]({'plain':!![]});if(!_0x4022dd)throw new Error(_0xc008('0x5f'));if(_0x4022dd[_0xc008('0x60')]===_0xc008('0x61')){var _0x192c87=_0x27a167[_0xc008('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xc008('0x62')]({'where':{'name':'Contexts','userProfileId':_0x4022dd['userProfileId']},'raw':!![]})[_0xc008('0x1e')](function(_0x30aa1e){if(_0x30aa1e&&_0x30aa1e['autoAssociation']===0x0){return db[_0xc008('0x34')][_0xc008('0x56')]({'name':_0x192c87[_0xc008('0x37')],'resourceId':_0x192c87['id'],'type':_0x30aa1e[_0xc008('0x37')],'sectionId':_0x30aa1e['id']},{})[_0xc008('0x1e')](function(){return _0x27a167;});}else{return _0x27a167;}})[_0xc008('0x27')](function(_0x12973b){logger['error'](_0xc008('0x63'),_0x12973b);throw _0x12973b;});}return _0x27a167;})[_0xc008('0x1e')](respondWithResult(_0x2f1105,0xc9))[_0xc008('0x27')](handleError(_0x2f1105,null));};exports[_0xc008('0x31')]=function(_0xb3ca0f,_0x167425,_0x249898){var _0x280249;return db[_0xc008('0x39')][_0xc008('0x62')]({'where':{'id':_0xb3ca0f[_0xc008('0x53')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x167425,null))[_0xc008('0x1e')](saveUpdates(_0xb3ca0f[_0xc008('0x57')],null))['then'](function(_0x36a08e){if(_0x36a08e){_0x280249=_0x36a08e;return db[_0xc008('0x39')][_0xc008('0x50')]({'raw':!![]});}})['then'](function(_0xd7d020){var _0x3214df=fs['readFileSync'](path['join'](config[_0xc008('0x59')],_0xc008('0x5a')),_0xc008('0x64'));var _0x39083c=ejs[_0xc008('0x5b')](_0x3214df,{'contexts':_0xd7d020||[]});fs[_0xc008('0x5c')](_0xc008('0x65'),_0x39083c);})[_0xc008('0x1e')](function(){return respondWithRpcPromise(_0xc008('0x5d'),_0xc008('0x31'),{'module':_0xc008('0x5e')});})['then'](function(){return _0x280249;})[_0xc008('0x1e')](respondWithResult(_0x167425,null))[_0xc008('0x27')](handleError(_0x167425,null));};exports[_0xc008('0x35')]=function(_0x27dc80,_0x521e67,_0x17ffb1){var _0x5975de;return db[_0xc008('0x39')][_0xc008('0x62')]({'where':{'id':_0x27dc80[_0xc008('0x53')]['id']}})['then'](handleEntityNotFound(_0x521e67,null))[_0xc008('0x1e')](removeEntity(_0x521e67,null))[_0xc008('0x1e')](function(){return db[_0xc008('0x39')]['findAll']({'raw':!![]});})[_0xc008('0x1e')](function(_0x539fc8){var _0x50ee03=fs[_0xc008('0x66')](path[_0xc008('0x58')](config[_0xc008('0x59')],_0xc008('0x5a')),'utf8');var _0x3c30db=ejs[_0xc008('0x5b')](_0x50ee03,{'contexts':_0x539fc8});fs['writeFileSync'](_0xc008('0x65'),_0x3c30db);return respondWithRpcPromise('Reload',_0xc008('0x35'),{'module':'chan_sip.so'});})[_0xc008('0x27')](handleError(_0x521e67,null));};
\ No newline at end of file
+var _0x34e8=['http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','Contexts','sendStatus','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','VoiceContext','includeAll','include','findAll','rows','show','length','create','body','join','root','utf8','render','writeFileSync','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','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/environment','../../mysqldb','client'];(function(_0x585259,_0x16f49a){var _0x385a36=function(_0x10cb5f){while(--_0x10cb5f){_0x585259['push'](_0x585259['shift']());}};_0x385a36(++_0x16f49a);}(_0x34e8,0x12c));var _0x834e=function(_0x17f774,_0x37393d){_0x17f774=_0x17f774-0x0;var _0x145a36=_0x34e8[_0x17f774];return _0x145a36;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x834e('0x1d')][_0x834e('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x58a27e,_0x23848e,_0x2d95f2){if(_0x2d95f2){var _0x28e659=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28e659[_0x834e('0x1f')](_0x23848e)){return _0x58a27e;}else{throw new db['Sequelize'][(_0x834e('0x20'))](_0x834e('0x21'));}}else{return _0x58a27e;}}function respondWithRpcPromise(_0x57274a,_0x316205,_0x4a9cdc,_0x38a8cd){return new BPromise(function(_0x36d443,_0x478afe){var _0x43ac41=_0x38a8cd||client;return _0x43ac41[_0x834e('0x22')](_0x57274a,_0x4a9cdc)[_0x834e('0x23')](function(_0x50b3f6){logger[_0x834e('0x24')](_0x834e('0x25'),_0x316205,_0x834e('0x26'));logger[_0x834e('0x27')](_0x834e('0x28'),_0x316205,_0x834e('0x26'),JSON[_0x834e('0x29')](_0x50b3f6));if(_0x50b3f6['error']){if(_0x50b3f6[_0x834e('0x2a')][_0x834e('0x2b')]===0x1f4){logger[_0x834e('0x2a')](_0x834e('0x25'),_0x316205,_0x50b3f6['error'][_0x834e('0x2c')]);return _0x478afe(_0x50b3f6[_0x834e('0x2a')]['message']);}logger[_0x834e('0x2a')](_0x834e('0x25'),_0x316205,_0x50b3f6[_0x834e('0x2a')]['message']);return _0x36d443(_0x50b3f6['error'][_0x834e('0x2c')]);}else{logger[_0x834e('0x24')]('VoiceContext,\x20%s,\x20%s',_0x316205,_0x834e('0x26'));_0x36d443(_0x50b3f6[_0x834e('0x2d')]['message']);}})[_0x834e('0x2e')](function(_0x2e1983){logger[_0x834e('0x2a')]('VoiceContext,\x20%s,\x20%s',_0x316205,_0x2e1983);_0x478afe(_0x2e1983);});});}function respondWithStatusCode(_0x24fcf7,_0x3e310f){_0x3e310f=_0x3e310f||0xcc;return function(_0x5e1cc5){if(_0x5e1cc5){return _0x24fcf7['sendStatus'](_0x3e310f);}return _0x24fcf7[_0x834e('0x2f')](_0x3e310f)['end']();};}function respondWithResult(_0x2826ec,_0x3f1b0b){_0x3f1b0b=_0x3f1b0b||0xc8;return function(_0x3db026){if(_0x3db026){return _0x2826ec[_0x834e('0x2f')](_0x3f1b0b)[_0x834e('0x30')](_0x3db026);}};}function respondWithFilteredResult(_0x130cc5,_0x491919){return function(_0x510780){if(_0x510780){var _0x4dc64a=_0x510780[_0x834e('0x31')],_0x58c1d7=_0x491919['offset'],_0x2c7a8d=_0x491919[_0x834e('0x32')]+_0x491919[_0x834e('0x33')],_0x567cea;if(_0x2c7a8d>=_0x4dc64a){_0x2c7a8d=_0x4dc64a;_0x567cea=0xc8;}else{_0x567cea=0xce;}_0x130cc5[_0x834e('0x2f')](_0x567cea);return _0x130cc5[_0x834e('0x34')](_0x834e('0x35'),_0x58c1d7+'-'+_0x2c7a8d+'/'+_0x4dc64a)[_0x834e('0x30')](_0x510780);}return null;};}function patchUpdates(_0x3d149d){return function(_0xfaf716){try{jsonpatch[_0x834e('0x36')](_0xfaf716,_0x3d149d,!![]);}catch(_0x493289){return BPromise[_0x834e('0x37')](_0x493289);}return _0xfaf716['save']();};}function saveUpdates(_0x2c75c2,_0x3787b0){return function(_0x9ab921){if(_0x9ab921){return _0x9ab921[_0x834e('0x38')](_0x2c75c2)[_0x834e('0x23')](function(_0x4689c2){return _0x4689c2;});}return null;};}function removeEntity(_0x4696a1,_0x38cd29){return function(_0x358c31){if(_0x358c31){return _0x358c31[_0x834e('0x39')]()['then'](function(){var _0x2a3c7f=_0x358c31[_0x834e('0x3a')]({'plain':!![]});var _0x24a9df=_0x834e('0x3b');return db['UserProfileResource'][_0x834e('0x39')]({'where':{'type':_0x24a9df,'resourceId':_0x2a3c7f['id']}})[_0x834e('0x23')](function(){return _0x358c31;});})['then'](function(){_0x4696a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e58fa,_0x41bf4d){return function(_0x20c6ae){if(!_0x20c6ae){_0x3e58fa[_0x834e('0x3c')](0x194);}return _0x20c6ae;};}function handleError(_0x339e28,_0x1b76dd){_0x1b76dd=_0x1b76dd||0x1f4;return function(_0x4c2ef6){logger[_0x834e('0x2a')](_0x4c2ef6['stack']);if(_0x4c2ef6[_0x834e('0x3d')]){delete _0x4c2ef6[_0x834e('0x3d')];}_0x339e28['status'](_0x1b76dd)[_0x834e('0x3e')](_0x4c2ef6);};}exports[_0x834e('0x3f')]=function(_0x491c28,_0x481f70){var _0x388711={},_0xd0d43a={},_0x2e9383={'count':0x0,'rows':[]};var _0x130c23=_[_0x834e('0x40')](db['VoiceContext'][_0x834e('0x41')],function(_0x548d1d){return{'name':_0x548d1d['fieldName'],'type':_0x548d1d[_0x834e('0x42')]['key']};});_0xd0d43a[_0x834e('0x43')]=_[_0x834e('0x40')](_0x130c23,_0x834e('0x3d'));_0xd0d43a[_0x834e('0x44')]=_[_0x834e('0x45')](_0x491c28['query']);_0xd0d43a[_0x834e('0x46')]=_[_0x834e('0x47')](_0xd0d43a[_0x834e('0x43')],_0xd0d43a['query']);_0x388711[_0x834e('0x48')]=_[_0x834e('0x47')](_0xd0d43a['model'],qs[_0x834e('0x49')](_0x491c28['query'][_0x834e('0x49')]));_0x388711[_0x834e('0x48')]=_0x388711['attributes']['length']?_0x388711[_0x834e('0x48')]:_0xd0d43a[_0x834e('0x43')];if(!_0x491c28[_0x834e('0x44')][_0x834e('0x4a')](_0x834e('0x4b'))){_0x388711[_0x834e('0x33')]=qs[_0x834e('0x33')](_0x491c28['query'][_0x834e('0x33')]);_0x388711['offset']=qs[_0x834e('0x32')](_0x491c28['query'][_0x834e('0x32')]);}_0x388711['order']=qs[_0x834e('0x4c')](_0x491c28[_0x834e('0x44')]['sort']);_0x388711[_0x834e('0x4d')]=qs[_0x834e('0x46')](_[_0x834e('0x4e')](_0x491c28[_0x834e('0x44')],_0xd0d43a[_0x834e('0x46')]),_0x130c23);if(_0x491c28[_0x834e('0x44')][_0x834e('0x4f')]){_0x388711[_0x834e('0x4d')]=_[_0x834e('0x50')](_0x388711[_0x834e('0x4d')],{'$or':_['map'](_0x130c23,function(_0x3124be){if(_0x3124be[_0x834e('0x42')]!=='VIRTUAL'){var _0x112306={};_0x112306[_0x3124be[_0x834e('0x3d')]]={'$like':'%'+_0x491c28[_0x834e('0x44')][_0x834e('0x4f')]+'%'};return _0x112306;}})});}_0x388711=_[_0x834e('0x50')]({},_0x388711,_0x491c28[_0x834e('0x51')]);var _0x4eab06={'where':_0x388711['where']};return db[_0x834e('0x52')][_0x834e('0x31')](_0x4eab06)[_0x834e('0x23')](function(_0x40ff5a){_0x2e9383[_0x834e('0x31')]=_0x40ff5a;if(_0x491c28[_0x834e('0x44')][_0x834e('0x53')]){_0x388711[_0x834e('0x54')]=[{'all':!![]}];}return db[_0x834e('0x52')][_0x834e('0x55')](_0x388711);})[_0x834e('0x23')](function(_0x385435){_0x2e9383[_0x834e('0x56')]=_0x385435;return _0x2e9383;})[_0x834e('0x23')](respondWithFilteredResult(_0x481f70,_0x388711))[_0x834e('0x2e')](handleError(_0x481f70,null));};exports[_0x834e('0x57')]=function(_0x3df078,_0x32b8f7){var _0x420841={'raw':![],'where':{'id':_0x3df078['params']['id']}},_0x1adf86={};_0x1adf86[_0x834e('0x43')]=_[_0x834e('0x45')](db['VoiceContext'][_0x834e('0x41')]);_0x1adf86[_0x834e('0x44')]=_['keys'](_0x3df078[_0x834e('0x44')]);_0x1adf86[_0x834e('0x46')]=_[_0x834e('0x47')](_0x1adf86[_0x834e('0x43')],_0x1adf86[_0x834e('0x44')]);_0x420841[_0x834e('0x48')]=_[_0x834e('0x47')](_0x1adf86['model'],qs[_0x834e('0x49')](_0x3df078[_0x834e('0x44')][_0x834e('0x49')]));_0x420841[_0x834e('0x48')]=_0x420841[_0x834e('0x48')][_0x834e('0x58')]?_0x420841[_0x834e('0x48')]:_0x1adf86[_0x834e('0x43')];if(_0x3df078['query'][_0x834e('0x53')]){_0x420841['include']=[{'all':!![]}];}_0x420841=_[_0x834e('0x50')]({},_0x420841,_0x3df078['options']);return db[_0x834e('0x52')]['find'](_0x420841)['then'](handleEntityNotFound(_0x32b8f7,null))[_0x834e('0x23')](respondWithResult(_0x32b8f7,null))[_0x834e('0x2e')](handleError(_0x32b8f7,null));};exports['create']=function(_0x5be43d,_0x2c8155,_0x2452b4){var _0x138ed2;return db[_0x834e('0x52')][_0x834e('0x59')](_0x5be43d[_0x834e('0x5a')],{'raw':!![]})[_0x834e('0x23')](function(_0x4273f1){_0x138ed2=_0x4273f1;return db['VoiceContext'][_0x834e('0x55')]({'raw':!![]});})[_0x834e('0x23')](function(_0x5d5ac2){var _0x281342=fs['readFileSync'](path[_0x834e('0x5b')](config[_0x834e('0x5c')],'server/files/templates/context.ejs'),_0x834e('0x5d'));var _0x37ee0e=ejs[_0x834e('0x5e')](_0x281342,{'contexts':_0x5d5ac2||[]});fs[_0x834e('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x37ee0e);})[_0x834e('0x23')](function(){return respondWithRpcPromise(_0x834e('0x60'),_0x834e('0x59'),{'module':'chan_sip.so'});})[_0x834e('0x23')](function(){var _0x1fcae9=_0x5be43d[_0x834e('0x61')][_0x834e('0x3a')]({'plain':!![]});if(!_0x1fcae9)throw new Error(_0x834e('0x62'));if(_0x1fcae9[_0x834e('0x63')]===_0x834e('0x61')){var _0x1def00=_0x138ed2[_0x834e('0x3a')]({'plain':!![]});return db[_0x834e('0x64')][_0x834e('0x65')]({'where':{'name':_0x834e('0x3b'),'userProfileId':_0x1fcae9[_0x834e('0x66')]},'raw':!![]})[_0x834e('0x23')](function(_0x460a7a){if(_0x460a7a&&_0x460a7a[_0x834e('0x67')]===0x0){return db[_0x834e('0x68')][_0x834e('0x59')]({'name':_0x1def00[_0x834e('0x3d')],'resourceId':_0x1def00['id'],'type':_0x460a7a[_0x834e('0x3d')],'sectionId':_0x460a7a['id']},{})[_0x834e('0x23')](function(){return _0x138ed2;});}else{return _0x138ed2;}})[_0x834e('0x2e')](function(_0x5c83eb){logger[_0x834e('0x2a')](_0x834e('0x69'),_0x5c83eb);throw _0x5c83eb;});}return _0x138ed2;})[_0x834e('0x23')](respondWithResult(_0x2c8155,0xc9))[_0x834e('0x2e')](handleError(_0x2c8155,null));};exports['update']=function(_0x30faa8,_0x5a9c70,_0x56a152){var _0x2fdb1b;return db[_0x834e('0x52')][_0x834e('0x65')]({'where':{'id':_0x30faa8[_0x834e('0x6a')]['id']}})[_0x834e('0x23')](handleEntityNotFound(_0x5a9c70,null))[_0x834e('0x23')](saveUpdates(_0x30faa8[_0x834e('0x5a')],null))[_0x834e('0x23')](function(_0x525ed3){if(_0x525ed3){_0x2fdb1b=_0x525ed3;return db[_0x834e('0x52')]['findAll']({'raw':!![]});}})[_0x834e('0x23')](function(_0xd35dda){var _0x514fe5=fs['readFileSync'](path[_0x834e('0x5b')](config[_0x834e('0x5c')],_0x834e('0x6b')),_0x834e('0x5d'));var _0x2c41bd=ejs['render'](_0x514fe5,{'contexts':_0xd35dda||[]});fs[_0x834e('0x5f')](_0x834e('0x6c'),_0x2c41bd);})[_0x834e('0x23')](function(){return respondWithRpcPromise(_0x834e('0x60'),_0x834e('0x38'),{'module':_0x834e('0x6d')});})[_0x834e('0x23')](function(){return _0x2fdb1b;})[_0x834e('0x23')](respondWithResult(_0x5a9c70,null))[_0x834e('0x2e')](handleError(_0x5a9c70,null));};exports[_0x834e('0x39')]=function(_0x5b2bf6,_0x1b158b,_0x2e4d80){var _0x42fc96;return db[_0x834e('0x52')]['find']({'where':{'id':_0x5b2bf6[_0x834e('0x6a')]['id']}})['then'](handleEntityNotFound(_0x1b158b,null))['then'](removeEntity(_0x1b158b,null))['then'](function(){return db[_0x834e('0x52')][_0x834e('0x55')]({'raw':!![]});})['then'](function(_0x2645df){var _0x1b200d=fs['readFileSync'](path[_0x834e('0x5b')](config[_0x834e('0x5c')],'server/files/templates/context.ejs'),'utf8');var _0x346be5=ejs[_0x834e('0x5e')](_0x1b200d,{'contexts':_0x2645df});fs[_0x834e('0x5f')](_0x834e('0x6c'),_0x346be5);return respondWithRpcPromise(_0x834e('0x60'),'destroy',{'module':_0x834e('0x6d')});})['catch'](handleError(_0x1b158b,null));};
\ No newline at end of file
index 1f6de56..513ebc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','VoiceContext','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceContext.attributes'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_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':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1624c5,_0x5c3a0d){var _0x18c17a=function(_0x51aa70){while(--_0x51aa70){_0x1624c5['push'](_0x1624c5['shift']());}};_0x18c17a(++_0x5c3a0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9b0ca97..f5e58f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa886=['randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','bluebird'];(function(_0x5b91ba,_0x49823f){var _0xbe782b=function(_0x136f89){while(--_0x136f89){_0x5b91ba['push'](_0x5b91ba['shift']());}};_0xbe782b(++_0x49823f);}(_0xa886,0x142));var _0x6a88=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa886[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6a88('0x0'));var rs=require(_0x6a88('0x1'));var fs=require('fs');var Redis=require(_0x6a88('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a88('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x6a88('0x4'));var jayson=require(_0x6a88('0x5'));var client=jayson[_0x6a88('0x6')][_0x6a88('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e10b9,_0xa1282c,_0x54b733){return new BPromise(function(_0x132010,_0x3e98c4){return client[_0x6a88('0x8')](_0x4e10b9,_0x54b733)[_0x6a88('0x9')](function(_0x13e6fb){logger[_0x6a88('0xa')](_0x6a88('0xb'),_0xa1282c,_0x6a88('0xc'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0xa1282c,_0x6a88('0xc'),JSON[_0x6a88('0xd')](_0x13e6fb));if(_0x13e6fb[_0x6a88('0xe')]){if(_0x13e6fb[_0x6a88('0xe')][_0x6a88('0xf')]===0x1f4){logger[_0x6a88('0xe')]('VoiceContext,\x20%s,\x20%s',_0xa1282c,_0x13e6fb[_0x6a88('0xe')][_0x6a88('0x10')]);return _0x3e98c4(_0x13e6fb['error']['message']);}logger['error'](_0x6a88('0xb'),_0xa1282c,_0x13e6fb[_0x6a88('0xe')]['message']);return _0x132010(_0x13e6fb['error'][_0x6a88('0x10')]);}else{logger['info'](_0x6a88('0xb'),_0xa1282c,_0x6a88('0xc'));_0x132010(_0x13e6fb[_0x6a88('0x11')][_0x6a88('0x10')]);}})[_0x6a88('0x12')](function(_0x4a0ff3){logger[_0x6a88('0xe')]('VoiceContext,\x20%s,\x20%s',_0xa1282c,_0x4a0ff3);_0x3e98c4(_0x4a0ff3);});});}
\ No newline at end of file
+var _0xf27b=['code','error','VoiceContext,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x54fb92,_0x5b0c8a){var _0x25e5c2=function(_0x5840a1){while(--_0x5840a1){_0x54fb92['push'](_0x54fb92['shift']());}};_0x25e5c2(++_0x5b0c8a);}(_0xf27b,0xf9));var _0xbf27=function(_0x58ceb9,_0x5601df){_0x58ceb9=_0x58ceb9-0x0;var _0x3d0ff5=_0xf27b[_0x58ceb9];return _0x3d0ff5;};'use strict';var _=require(_0xbf27('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbf27('0x1'));var rs=require(_0xbf27('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf27('0x3'))['db'];var utils=require(_0xbf27('0x4'));var logger=require(_0xbf27('0x5'))(_0xbf27('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf27('0x7')][_0xbf27('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x164d8f,_0xcd5c16,_0x129b46){return new BPromise(function(_0x205d55,_0x8fc4f9){return client[_0xbf27('0x9')](_0x164d8f,_0x129b46)[_0xbf27('0xa')](function(_0x4bb77b){logger['info']('VoiceContext,\x20%s,\x20%s',_0xcd5c16,_0xbf27('0xb'));logger[_0xbf27('0xc')](_0xbf27('0xd'),_0xcd5c16,_0xbf27('0xb'),JSON[_0xbf27('0xe')](_0x4bb77b));if(_0x4bb77b['error']){if(_0x4bb77b['error'][_0xbf27('0xf')]===0x1f4){logger[_0xbf27('0x10')](_0xbf27('0x11'),_0xcd5c16,_0x4bb77b[_0xbf27('0x10')][_0xbf27('0x12')]);return _0x8fc4f9(_0x4bb77b[_0xbf27('0x10')][_0xbf27('0x12')]);}logger[_0xbf27('0x10')](_0xbf27('0x11'),_0xcd5c16,_0x4bb77b[_0xbf27('0x10')][_0xbf27('0x12')]);return _0x205d55(_0x4bb77b[_0xbf27('0x10')][_0xbf27('0x12')]);}else{logger[_0xbf27('0x13')]('VoiceContext,\x20%s,\x20%s',_0xcd5c16,_0xbf27('0xb'));_0x205d55(_0x4bb77b[_0xbf27('0x14')][_0xbf27('0x12')]);}})[_0xbf27('0x15')](function(_0x57b519){logger[_0xbf27('0x10')](_0xbf27('0x11'),_0xcd5c16,_0x57b519);_0x8fc4f9(_0x57b519);});});}
\ No newline at end of file
index eca160d..7655f04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9561=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x9561,0x6a));var _0x1956=function(_0xc26c95,_0xed8018){_0xc26c95=_0xc26c95-0x0;var _0x5626f6=_0x9561[_0xc26c95];return _0x5626f6;};'use strict';var multer=require(_0x1956('0x0'));var util=require(_0x1956('0x1'));var path=require(_0x1956('0x2'));var timeout=require(_0x1956('0x3'));var express=require('express');var router=express[_0x1956('0x4')]();var auth=require(_0x1956('0x5'));var interaction=require(_0x1956('0x6'));var config=require(_0x1956('0x7'));var controller=require(_0x1956('0x8'));router[_0x1956('0x9')]('/',auth['isAuthenticated'](),controller[_0x1956('0xa')]);router[_0x1956('0x9')](_0x1956('0xb'),auth[_0x1956('0xc')](),controller[_0x1956('0xd')]);router[_0x1956('0x9')]('/:id',auth[_0x1956('0xc')](),controller[_0x1956('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1956('0xf')]);router[_0x1956('0x10')](_0x1956('0x11'),auth[_0x1956('0xc')](),controller[_0x1956('0x12')]);router[_0x1956('0x13')]('/:id',auth[_0x1956('0xc')](),controller[_0x1956('0x14')]);module[_0x1956('0x15')]=router;
\ No newline at end of file
+var _0x7670=['./voiceDialReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x5dcfdd,_0x433346){var _0x101ff2=function(_0x23ec19){while(--_0x23ec19){_0x5dcfdd['push'](_0x5dcfdd['shift']());}};_0x101ff2(++_0x433346);}(_0x7670,0xad));var _0x0767=function(_0x500649,_0x669569){_0x500649=_0x500649-0x0;var _0xec40d8=_0x7670[_0x500649];return _0xec40d8;};'use strict';var multer=require(_0x0767('0x0'));var util=require(_0x0767('0x1'));var path=require(_0x0767('0x2'));var timeout=require(_0x0767('0x3'));var express=require(_0x0767('0x4'));var router=express[_0x0767('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x0767('0x6'));var config=require('../../config/environment');var controller=require(_0x0767('0x7'));router[_0x0767('0x8')]('/',auth[_0x0767('0x9')](),controller['index']);router[_0x0767('0x8')](_0x0767('0xa'),auth['isAuthenticated'](),controller[_0x0767('0xb')]);router[_0x0767('0x8')](_0x0767('0xc'),auth[_0x0767('0x9')](),controller[_0x0767('0xd')]);router[_0x0767('0xe')]('/',auth[_0x0767('0x9')](),controller[_0x0767('0xf')]);router['put'](_0x0767('0xc'),auth[_0x0767('0x9')](),controller[_0x0767('0x10')]);router[_0x0767('0x11')](_0x0767('0xc'),auth[_0x0767('0x9')](),controller[_0x0767('0x12')]);module[_0x0767('0x13')]=router;
\ No newline at end of file
index 34ef915..8cf5272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc554=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x37a99e,_0x486383){var _0x4d2e2c=function(_0x55b08b){while(--_0x55b08b){_0x37a99e['push'](_0x37a99e['shift']());}};_0x4d2e2c(++_0x486383);}(_0xc554,0x1d0));var _0x4c55=function(_0x56ee15,_0x1effd1){_0x56ee15=_0x56ee15-0x0;var _0x94991f=_0xc554[_0x56ee15];return _0x94991f;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x4c55('0x0')]},'channel':{'type':Sequelize[_0x4c55('0x0')]},'channelstate':{'type':Sequelize[_0x4c55('0x1')]},'channelstatedesc':{'type':Sequelize[_0x4c55('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x4c55('0x0')]},'connectedlinename':{'type':Sequelize[_0x4c55('0x0')]},'language':{'type':Sequelize[_0x4c55('0x0')]},'accountcode':{'type':Sequelize[_0x4c55('0x0')]},'context':{'type':Sequelize[_0x4c55('0x0')]},'exten':{'type':Sequelize[_0x4c55('0x0')]},'priority':{'type':Sequelize[_0x4c55('0x1')]},'uniqueid':{'type':Sequelize[_0x4c55('0x0')]},'linkedid':{'type':Sequelize[_0x4c55('0x0')]},'destchannel':{'type':Sequelize[_0x4c55('0x0')]},'destchannelstate':{'type':Sequelize[_0x4c55('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x4c55('0x0')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x4c55('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x4c55('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4c55('0x0')]},'destcontext':{'type':Sequelize[_0x4c55('0x0')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x4c55('0x0')]},'dialstring':{'type':Sequelize[_0x4c55('0x0')]},'dialstatus':{'type':Sequelize[_0x4c55('0x0')]},'starttime':{'type':Sequelize[_0x4c55('0x2')]},'answertime':{'type':Sequelize[_0x4c55('0x2')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x4c55('0x0')],'comment':_0x4c55('0x3')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x4c55('0x1')]}};
\ No newline at end of file
+var _0xb054=['sequelize','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x3685be,_0x5f43db){var _0x2a26ae=function(_0x1bf6f6){while(--_0x1bf6f6){_0x3685be['push'](_0x3685be['shift']());}};_0x2a26ae(++_0x5f43db);}(_0xb054,0x1b3));var _0x4b05=function(_0x254d93,_0x250b89){_0x254d93=_0x254d93-0x0;var _0x467a51=_0xb054[_0x254d93];return _0x467a51;};'use strict';var Sequelize=require(_0x4b05('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x4b05('0x1')]},'channel':{'type':Sequelize[_0x4b05('0x1')]},'channelstate':{'type':Sequelize[_0x4b05('0x2')]},'channelstatedesc':{'type':Sequelize[_0x4b05('0x1')]},'calleridnum':{'type':Sequelize[_0x4b05('0x1')]},'calleridname':{'type':Sequelize[_0x4b05('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4b05('0x1')]},'connectedlinename':{'type':Sequelize[_0x4b05('0x1')]},'language':{'type':Sequelize[_0x4b05('0x1')]},'accountcode':{'type':Sequelize[_0x4b05('0x1')]},'context':{'type':Sequelize[_0x4b05('0x1')]},'exten':{'type':Sequelize[_0x4b05('0x1')]},'priority':{'type':Sequelize[_0x4b05('0x2')]},'uniqueid':{'type':Sequelize[_0x4b05('0x1')]},'linkedid':{'type':Sequelize[_0x4b05('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x4b05('0x1')]},'destcalleridname':{'type':Sequelize[_0x4b05('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x4b05('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x4b05('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4b05('0x1')]},'destcontext':{'type':Sequelize[_0x4b05('0x1')]},'destexten':{'type':Sequelize[_0x4b05('0x1')]},'destpriority':{'type':Sequelize[_0x4b05('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x4b05('0x1')]},'dialstring':{'type':Sequelize[_0x4b05('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x4b05('0x3')]},'answertime':{'type':Sequelize[_0x4b05('0x3')]},'endtime':{'type':Sequelize[_0x4b05('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x4b05('0x4')},'routeId':{'type':Sequelize[_0x4b05('0x2')]},'duration':{'type':Sequelize[_0x4b05('0x2')]},'holdtime':{'type':Sequelize[_0x4b05('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index d215a73..3235713 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bc3=['util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','json','offset','limit','status','set','Content-Range','apply','save','update','then','destroy','stack','name','VoiceDialReport','rawAttributes','type','key','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','options','count','includeAll','include','rows','catch','show','keys','create','body','find','params','describe','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x1a4748,_0x40c46e){var _0x28ca99=function(_0x99232c){while(--_0x99232c){_0x1a4748['push'](_0x1a4748['shift']());}};_0x28ca99(++_0x40c46e);}(_0x8bc3,0x82));var _0x38bc=function(_0x2b869b,_0x81ce74){_0x2b869b=_0x2b869b-0x0;var _0x494958=_0x8bc3[_0x2b869b];return _0x494958;};'use strict';var pdf=require(_0x38bc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x38bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38bc('0x2'));var rp=require(_0x38bc('0x3'));var moment=require('moment');var BPromise=require(_0x38bc('0x4'));var Mustache=require(_0x38bc('0x5'));var util=require(_0x38bc('0x6'));var path=require(_0x38bc('0x7'));var sox=require('sox');var csv=require(_0x38bc('0x8'));var ejs=require(_0x38bc('0x9'));var fs=require('fs');var _=require(_0x38bc('0xa'));var squel=require(_0x38bc('0xb'));var crypto=require(_0x38bc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x38bc('0x8'));var querystring=require(_0x38bc('0xd'));var Papa=require(_0x38bc('0xe'));var Redis=require(_0x38bc('0xf'));var authService=require(_0x38bc('0x10'));var qs=require(_0x38bc('0x11'));var as=require(_0x38bc('0x12'));var hardwareService=require(_0x38bc('0x13'));var logger=require(_0x38bc('0x14'))(_0x38bc('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x597e6a,_0x1a5f4b){_0x1a5f4b=_0x1a5f4b||0xcc;return function(_0x56fdcf){if(_0x56fdcf){return _0x597e6a['sendStatus'](_0x1a5f4b);}return _0x597e6a['status'](_0x1a5f4b)['end']();};}function respondWithResult(_0x437e10,_0x1a7903){_0x1a7903=_0x1a7903||0xc8;return function(_0x454eac){if(_0x454eac){return _0x437e10['status'](_0x1a7903)[_0x38bc('0x16')](_0x454eac);}};}function respondWithFilteredResult(_0x5115d9,_0x1ff95d){return function(_0x322c4e){if(_0x322c4e){var _0x2c223e=_0x322c4e['count'],_0x1c0cd2=_0x1ff95d[_0x38bc('0x17')],_0x110b36=_0x1ff95d['offset']+_0x1ff95d[_0x38bc('0x18')],_0x2f5e94;if(_0x110b36>=_0x2c223e){_0x110b36=_0x2c223e;_0x2f5e94=0xc8;}else{_0x2f5e94=0xce;}_0x5115d9[_0x38bc('0x19')](_0x2f5e94);return _0x5115d9[_0x38bc('0x1a')](_0x38bc('0x1b'),_0x1c0cd2+'-'+_0x110b36+'/'+_0x2c223e)[_0x38bc('0x16')](_0x322c4e);}return null;};}function patchUpdates(_0x405366){return function(_0x4a753f){try{jsonpatch[_0x38bc('0x1c')](_0x4a753f,_0x405366,!![]);}catch(_0x57b401){return BPromise['reject'](_0x57b401);}return _0x4a753f[_0x38bc('0x1d')]();};}function saveUpdates(_0x2c54ac,_0x325b14){return function(_0x19f3af){if(_0x19f3af){return _0x19f3af[_0x38bc('0x1e')](_0x2c54ac)[_0x38bc('0x1f')](function(_0xfea474){return _0xfea474;});}return null;};}function removeEntity(_0x5746c2,_0x4a43c7){return function(_0x2999b0){if(_0x2999b0){return _0x2999b0[_0x38bc('0x20')]()['then'](function(){_0x5746c2[_0x38bc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x897a6b,_0x4251ee){return function(_0x434007){if(!_0x434007){_0x897a6b['sendStatus'](0x194);}return _0x434007;};}function handleError(_0x128ddb,_0xa4d246){_0xa4d246=_0xa4d246||0x1f4;return function(_0x240bc5){logger['error'](_0x240bc5[_0x38bc('0x21')]);if(_0x240bc5[_0x38bc('0x22')]){delete _0x240bc5[_0x38bc('0x22')];}_0x128ddb[_0x38bc('0x19')](_0xa4d246)['send'](_0x240bc5);};}exports['index']=function(_0x1d39d8,_0x114cc8){var _0x2210ad={},_0x712745={},_0x5e6b11={'count':0x0,'rows':[]};var _0x5a4dd9=_['map'](db[_0x38bc('0x23')][_0x38bc('0x24')],function(_0x404759){return{'name':_0x404759['fieldName'],'type':_0x404759[_0x38bc('0x25')][_0x38bc('0x26')]};});_0x712745['model']=_['map'](_0x5a4dd9,_0x38bc('0x22'));_0x712745['query']=_['keys'](_0x1d39d8[_0x38bc('0x27')]);_0x712745[_0x38bc('0x28')]=_[_0x38bc('0x29')](_0x712745[_0x38bc('0x2a')],_0x712745[_0x38bc('0x27')]);_0x2210ad['attributes']=_[_0x38bc('0x29')](_0x712745[_0x38bc('0x2a')],qs[_0x38bc('0x2b')](_0x1d39d8[_0x38bc('0x27')][_0x38bc('0x2b')]));_0x2210ad['attributes']=_0x2210ad['attributes'][_0x38bc('0x2c')]?_0x2210ad[_0x38bc('0x2d')]:_0x712745[_0x38bc('0x2a')];if(!_0x1d39d8[_0x38bc('0x27')][_0x38bc('0x2e')](_0x38bc('0x2f'))){_0x2210ad[_0x38bc('0x18')]=qs['limit'](_0x1d39d8[_0x38bc('0x27')][_0x38bc('0x18')]);_0x2210ad['offset']=qs[_0x38bc('0x17')](_0x1d39d8[_0x38bc('0x27')][_0x38bc('0x17')]);}_0x2210ad[_0x38bc('0x30')]=qs[_0x38bc('0x31')](_0x1d39d8['query'][_0x38bc('0x31')]);_0x2210ad['where']=qs[_0x38bc('0x28')](_[_0x38bc('0x32')](_0x1d39d8[_0x38bc('0x27')],_0x712745[_0x38bc('0x28')]),_0x5a4dd9);if(_0x1d39d8[_0x38bc('0x27')][_0x38bc('0x33')]){_0x2210ad[_0x38bc('0x34')]=_[_0x38bc('0x35')](_0x2210ad['where'],{'$or':_[_0x38bc('0x36')](_0x5a4dd9,function(_0x151c2a){if(_0x151c2a[_0x38bc('0x25')]!=='VIRTUAL'){var _0x530786={};_0x530786[_0x151c2a[_0x38bc('0x22')]]={'$like':'%'+_0x1d39d8[_0x38bc('0x27')][_0x38bc('0x33')]+'%'};return _0x530786;}})});}_0x2210ad=_[_0x38bc('0x35')]({},_0x2210ad,_0x1d39d8[_0x38bc('0x37')]);var _0x198391={'where':_0x2210ad[_0x38bc('0x34')]};return db[_0x38bc('0x23')]['count'](_0x198391)[_0x38bc('0x1f')](function(_0x530ef5){_0x5e6b11[_0x38bc('0x38')]=_0x530ef5;if(_0x1d39d8[_0x38bc('0x27')][_0x38bc('0x39')]){_0x2210ad[_0x38bc('0x3a')]=[{'all':!![]}];}return db[_0x38bc('0x23')]['findAll'](_0x2210ad);})[_0x38bc('0x1f')](function(_0x3955fd){_0x5e6b11[_0x38bc('0x3b')]=_0x3955fd;return _0x5e6b11;})[_0x38bc('0x1f')](respondWithFilteredResult(_0x114cc8,_0x2210ad))[_0x38bc('0x3c')](handleError(_0x114cc8,null));};exports[_0x38bc('0x3d')]=function(_0x3a7cc0,_0x215dc4){var _0x2d1b29={'raw':!![],'where':{'id':_0x3a7cc0['params']['id']}},_0x456bb7={};_0x456bb7[_0x38bc('0x2a')]=_[_0x38bc('0x3e')](db[_0x38bc('0x23')]['rawAttributes']);_0x456bb7['query']=_[_0x38bc('0x3e')](_0x3a7cc0[_0x38bc('0x27')]);_0x456bb7['filters']=_[_0x38bc('0x29')](_0x456bb7[_0x38bc('0x2a')],_0x456bb7[_0x38bc('0x27')]);_0x2d1b29[_0x38bc('0x2d')]=_[_0x38bc('0x29')](_0x456bb7[_0x38bc('0x2a')],qs['fields'](_0x3a7cc0[_0x38bc('0x27')][_0x38bc('0x2b')]));_0x2d1b29[_0x38bc('0x2d')]=_0x2d1b29[_0x38bc('0x2d')][_0x38bc('0x2c')]?_0x2d1b29['attributes']:_0x456bb7[_0x38bc('0x2a')];if(_0x3a7cc0[_0x38bc('0x27')][_0x38bc('0x39')]){_0x2d1b29['include']=[{'all':!![]}];}_0x2d1b29=_[_0x38bc('0x35')]({},_0x2d1b29,_0x3a7cc0['options']);return db[_0x38bc('0x23')]['find'](_0x2d1b29)[_0x38bc('0x1f')](handleEntityNotFound(_0x215dc4,null))[_0x38bc('0x1f')](respondWithResult(_0x215dc4,null))[_0x38bc('0x3c')](handleError(_0x215dc4,null));};exports[_0x38bc('0x3f')]=function(_0x5cc7dd,_0x1a711a){return db['VoiceDialReport'][_0x38bc('0x3f')](_0x5cc7dd[_0x38bc('0x40')],{})[_0x38bc('0x1f')](respondWithResult(_0x1a711a,0xc9))[_0x38bc('0x3c')](handleError(_0x1a711a,null));};exports[_0x38bc('0x1e')]=function(_0x12ffea,_0x19005d){if(_0x12ffea[_0x38bc('0x40')]['id']){delete _0x12ffea[_0x38bc('0x40')]['id'];}return db['VoiceDialReport'][_0x38bc('0x41')]({'where':{'id':_0x12ffea[_0x38bc('0x42')]['id']}})['then'](handleEntityNotFound(_0x19005d,null))[_0x38bc('0x1f')](saveUpdates(_0x12ffea['body'],null))[_0x38bc('0x1f')](respondWithResult(_0x19005d,null))[_0x38bc('0x3c')](handleError(_0x19005d,null));};exports[_0x38bc('0x20')]=function(_0x33b186,_0x56d4c0){return db[_0x38bc('0x23')]['find']({'where':{'id':_0x33b186['params']['id']}})[_0x38bc('0x1f')](handleEntityNotFound(_0x56d4c0,null))[_0x38bc('0x1f')](removeEntity(_0x56d4c0,null))[_0x38bc('0x3c')](handleError(_0x56d4c0,null));};exports[_0x38bc('0x43')]=function(_0x4232ad,_0x37a222){return db['VoiceDialReport']['describe']()[_0x38bc('0x1f')](respondWithResult(_0x37a222,null))[_0x38bc('0x3c')](handleError(_0x37a222,null));};
\ No newline at end of file
+var _0xf5f8=['mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','rawAttributes','fieldName','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','VoiceDialReport','include','findAll','rows','show','keys','includeAll','find','catch','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2d4661,_0x2da65c){var _0x42ed1e=function(_0x263c50){while(--_0x263c50){_0x2d4661['push'](_0x2d4661['shift']());}};_0x42ed1e(++_0x2da65c);}(_0xf5f8,0x1bb));var _0x8f5f=function(_0x5ba4da,_0x3cb35c){_0x5ba4da=_0x5ba4da-0x0;var _0x269e6b=_0xf5f8[_0x5ba4da];return _0x269e6b;};'use strict';var pdf=require(_0x8f5f('0x0'));var emlformat=require(_0x8f5f('0x1'));var rimraf=require(_0x8f5f('0x2'));var zipdir=require(_0x8f5f('0x3'));var jsonpatch=require(_0x8f5f('0x4'));var rp=require(_0x8f5f('0x5'));var moment=require(_0x8f5f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x8f5f('0x7'));var util=require(_0x8f5f('0x8'));var path=require(_0x8f5f('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8f5f('0xa'));var fs=require('fs');var _=require(_0x8f5f('0xb'));var squel=require(_0x8f5f('0xc'));var crypto=require(_0x8f5f('0xd'));var jsforce=require(_0x8f5f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8f5f('0xf'));var querystring=require(_0x8f5f('0x10'));var Papa=require(_0x8f5f('0x11'));var Redis=require(_0x8f5f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8f5f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f5f('0x14'))(_0x8f5f('0x15'));var utils=require(_0x8f5f('0x16'));var config=require(_0x8f5f('0x17'));var db=require(_0x8f5f('0x18'))['db'];function respondWithStatusCode(_0x121865,_0x57b983){_0x57b983=_0x57b983||0xcc;return function(_0x2991a4){if(_0x2991a4){return _0x121865[_0x8f5f('0x19')](_0x57b983);}return _0x121865['status'](_0x57b983)['end']();};}function respondWithResult(_0x172b52,_0x4ec807){_0x4ec807=_0x4ec807||0xc8;return function(_0x50fdc0){if(_0x50fdc0){return _0x172b52[_0x8f5f('0x1a')](_0x4ec807)[_0x8f5f('0x1b')](_0x50fdc0);}};}function respondWithFilteredResult(_0x2861f3,_0x325d3c){return function(_0x378933){if(_0x378933){var _0x2beb54=_0x378933[_0x8f5f('0x1c')],_0x470e83=_0x325d3c['offset'],_0x3077f9=_0x325d3c[_0x8f5f('0x1d')]+_0x325d3c[_0x8f5f('0x1e')],_0x1afcb9;if(_0x3077f9>=_0x2beb54){_0x3077f9=_0x2beb54;_0x1afcb9=0xc8;}else{_0x1afcb9=0xce;}_0x2861f3[_0x8f5f('0x1a')](_0x1afcb9);return _0x2861f3[_0x8f5f('0x1f')](_0x8f5f('0x20'),_0x470e83+'-'+_0x3077f9+'/'+_0x2beb54)[_0x8f5f('0x1b')](_0x378933);}return null;};}function patchUpdates(_0x4250d5){return function(_0x47581d){try{jsonpatch[_0x8f5f('0x21')](_0x47581d,_0x4250d5,!![]);}catch(_0x3ebc13){return BPromise[_0x8f5f('0x22')](_0x3ebc13);}return _0x47581d[_0x8f5f('0x23')]();};}function saveUpdates(_0x3f8dd6,_0x3e8c2d){return function(_0x1c97a8){if(_0x1c97a8){return _0x1c97a8[_0x8f5f('0x24')](_0x3f8dd6)['then'](function(_0x12ed25){return _0x12ed25;});}return null;};}function removeEntity(_0x5e5007,_0xc0f360){return function(_0x49ea67){if(_0x49ea67){return _0x49ea67['destroy']()[_0x8f5f('0x25')](function(){_0x5e5007[_0x8f5f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2007e8,_0x56c6b5){return function(_0x426191){if(!_0x426191){_0x2007e8[_0x8f5f('0x19')](0x194);}return _0x426191;};}function handleError(_0xcf935f,_0x160736){_0x160736=_0x160736||0x1f4;return function(_0x29b34a){logger[_0x8f5f('0x26')](_0x29b34a['stack']);if(_0x29b34a[_0x8f5f('0x27')]){delete _0x29b34a[_0x8f5f('0x27')];}_0xcf935f['status'](_0x160736)[_0x8f5f('0x28')](_0x29b34a);};}exports[_0x8f5f('0x29')]=function(_0x512b9b,_0x230f79){var _0x464d83={},_0x2f9e06={},_0x1dfe9d={'count':0x0,'rows':[]};var _0x5356d7=_['map'](db['VoiceDialReport'][_0x8f5f('0x2a')],function(_0x49e817){return{'name':_0x49e817[_0x8f5f('0x2b')],'type':_0x49e817['type']['key']};});_0x2f9e06[_0x8f5f('0x2c')]=_[_0x8f5f('0x2d')](_0x5356d7,_0x8f5f('0x27'));_0x2f9e06['query']=_['keys'](_0x512b9b[_0x8f5f('0x2e')]);_0x2f9e06[_0x8f5f('0x2f')]=_[_0x8f5f('0x30')](_0x2f9e06[_0x8f5f('0x2c')],_0x2f9e06['query']);_0x464d83['attributes']=_[_0x8f5f('0x30')](_0x2f9e06[_0x8f5f('0x2c')],qs[_0x8f5f('0x31')](_0x512b9b[_0x8f5f('0x2e')][_0x8f5f('0x31')]));_0x464d83[_0x8f5f('0x32')]=_0x464d83[_0x8f5f('0x32')][_0x8f5f('0x33')]?_0x464d83[_0x8f5f('0x32')]:_0x2f9e06['model'];if(!_0x512b9b[_0x8f5f('0x2e')][_0x8f5f('0x34')](_0x8f5f('0x35'))){_0x464d83['limit']=qs[_0x8f5f('0x1e')](_0x512b9b[_0x8f5f('0x2e')][_0x8f5f('0x1e')]);_0x464d83[_0x8f5f('0x1d')]=qs[_0x8f5f('0x1d')](_0x512b9b['query']['offset']);}_0x464d83[_0x8f5f('0x36')]=qs[_0x8f5f('0x37')](_0x512b9b[_0x8f5f('0x2e')][_0x8f5f('0x37')]);_0x464d83['where']=qs['filters'](_['pick'](_0x512b9b[_0x8f5f('0x2e')],_0x2f9e06[_0x8f5f('0x2f')]),_0x5356d7);if(_0x512b9b[_0x8f5f('0x2e')][_0x8f5f('0x38')]){_0x464d83[_0x8f5f('0x39')]=_[_0x8f5f('0x3a')](_0x464d83['where'],{'$or':_[_0x8f5f('0x2d')](_0x5356d7,function(_0x5630ac){if(_0x5630ac['type']!==_0x8f5f('0x3b')){var _0x2f1506={};_0x2f1506[_0x5630ac[_0x8f5f('0x27')]]={'$like':'%'+_0x512b9b[_0x8f5f('0x2e')][_0x8f5f('0x38')]+'%'};return _0x2f1506;}})});}_0x464d83=_[_0x8f5f('0x3a')]({},_0x464d83,_0x512b9b[_0x8f5f('0x3c')]);var _0x472f65={'where':_0x464d83[_0x8f5f('0x39')]};return db[_0x8f5f('0x3d')][_0x8f5f('0x1c')](_0x472f65)[_0x8f5f('0x25')](function(_0x50c4d2){_0x1dfe9d['count']=_0x50c4d2;if(_0x512b9b['query']['includeAll']){_0x464d83[_0x8f5f('0x3e')]=[{'all':!![]}];}return db[_0x8f5f('0x3d')][_0x8f5f('0x3f')](_0x464d83);})['then'](function(_0x2f71fb){_0x1dfe9d[_0x8f5f('0x40')]=_0x2f71fb;return _0x1dfe9d;})[_0x8f5f('0x25')](respondWithFilteredResult(_0x230f79,_0x464d83))['catch'](handleError(_0x230f79,null));};exports[_0x8f5f('0x41')]=function(_0x2c059a,_0xe51254){var _0x462912={'raw':!![],'where':{'id':_0x2c059a['params']['id']}},_0x390fe8={};_0x390fe8[_0x8f5f('0x2c')]=_[_0x8f5f('0x42')](db[_0x8f5f('0x3d')][_0x8f5f('0x2a')]);_0x390fe8[_0x8f5f('0x2e')]=_[_0x8f5f('0x42')](_0x2c059a['query']);_0x390fe8['filters']=_['intersection'](_0x390fe8[_0x8f5f('0x2c')],_0x390fe8[_0x8f5f('0x2e')]);_0x462912['attributes']=_[_0x8f5f('0x30')](_0x390fe8[_0x8f5f('0x2c')],qs[_0x8f5f('0x31')](_0x2c059a[_0x8f5f('0x2e')][_0x8f5f('0x31')]));_0x462912[_0x8f5f('0x32')]=_0x462912[_0x8f5f('0x32')]['length']?_0x462912[_0x8f5f('0x32')]:_0x390fe8['model'];if(_0x2c059a[_0x8f5f('0x2e')][_0x8f5f('0x43')]){_0x462912[_0x8f5f('0x3e')]=[{'all':!![]}];}_0x462912=_[_0x8f5f('0x3a')]({},_0x462912,_0x2c059a[_0x8f5f('0x3c')]);return db['VoiceDialReport'][_0x8f5f('0x44')](_0x462912)['then'](handleEntityNotFound(_0xe51254,null))[_0x8f5f('0x25')](respondWithResult(_0xe51254,null))[_0x8f5f('0x45')](handleError(_0xe51254,null));};exports[_0x8f5f('0x46')]=function(_0x44b071,_0x15af41){return db[_0x8f5f('0x3d')][_0x8f5f('0x46')](_0x44b071[_0x8f5f('0x47')],{})[_0x8f5f('0x25')](respondWithResult(_0x15af41,0xc9))[_0x8f5f('0x45')](handleError(_0x15af41,null));};exports[_0x8f5f('0x24')]=function(_0x523806,_0x4ee2d2){if(_0x523806[_0x8f5f('0x47')]['id']){delete _0x523806['body']['id'];}return db['VoiceDialReport'][_0x8f5f('0x44')]({'where':{'id':_0x523806[_0x8f5f('0x48')]['id']}})[_0x8f5f('0x25')](handleEntityNotFound(_0x4ee2d2,null))[_0x8f5f('0x25')](saveUpdates(_0x523806[_0x8f5f('0x47')],null))['then'](respondWithResult(_0x4ee2d2,null))[_0x8f5f('0x45')](handleError(_0x4ee2d2,null));};exports[_0x8f5f('0x49')]=function(_0x2e264b,_0x55d788){return db[_0x8f5f('0x3d')]['find']({'where':{'id':_0x2e264b['params']['id']}})['then'](handleEntityNotFound(_0x55d788,null))['then'](removeEntity(_0x55d788,null))['catch'](handleError(_0x55d788,null));};exports['describe']=function(_0x13d72b,_0x47f2bd){return db[_0x8f5f('0x3d')][_0x8f5f('0x4a')]()[_0x8f5f('0x25')](respondWithResult(_0x47f2bd,null))[_0x8f5f('0x45')](handleError(_0x47f2bd,null));};
\ No newline at end of file
index 1e3a699..e027a7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6630=['lodash','util','api','request-promise','rimraf','./voiceDialReport.attributes','VoiceDialReport','report_dial','uniqueid'];(function(_0x1591b0,_0x31909f){var _0x29c8de=function(_0x2f629f){while(--_0x2f629f){_0x1591b0['push'](_0x1591b0['shift']());}};_0x29c8de(++_0x31909f);}(_0x6630,0x1dd));var _0x0663=function(_0x57fea1,_0x2862ea){_0x57fea1=_0x57fea1-0x0;var _0x83d6c6=_0x6630[_0x57fea1];return _0x83d6c6;};'use strict';var _=require(_0x0663('0x0'));var util=require(_0x0663('0x1'));var logger=require('../../config/logger')(_0x0663('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0663('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0663('0x4'));var config=require('../../config/environment');var attributes=require(_0x0663('0x5'));module['exports']=function(_0x23ed38,_0x556dcd){return _0x23ed38['define'](_0x0663('0x6'),attributes,{'tableName':_0x0663('0x7'),'paranoid':![],'indexes':[{'fields':[_0x0663('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf82b=['moment','bluebird','request-promise','path','define','report_dial','uniqueid','lodash','util','../../config/logger'];(function(_0x28902f,_0x2a8dbf){var _0x4a4f6d=function(_0x21ece8){while(--_0x21ece8){_0x28902f['push'](_0x28902f['shift']());}};_0x4a4f6d(++_0x2a8dbf);}(_0xf82b,0xf7));var _0xbf82=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf82b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xbf82('0x0'));var util=require(_0xbf82('0x1'));var logger=require(_0xbf82('0x2'))('api');var moment=require(_0xbf82('0x3'));var BPromise=require(_0xbf82('0x4'));var rp=require(_0xbf82('0x5'));var fs=require('fs');var path=require(_0xbf82('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x3db96c,_0x112b6d){return _0x3db96c[_0xbf82('0x7')]('VoiceDialReport',attributes,{'tableName':_0xbf82('0x8'),'paranoid':![],'indexes':[{'fields':[_0xbf82('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 000bd7f..8d87df4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf46a=['client','http','then','request\x20sent','debug','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','info','VoiceDialReport','create','options','CreateVoiceDialReport','UpdateVoiceDialReport','raw','where','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0xf46a,0xa4));var _0xaf46=function(_0x50f0c4,_0x58ad0a){_0x50f0c4=_0x50f0c4-0x0;var _0x38efa4=_0xf46a[_0x50f0c4];return _0x38efa4;};'use strict';var _=require(_0xaf46('0x0'));var util=require('util');var moment=require(_0xaf46('0x1'));var BPromise=require(_0xaf46('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf46('0x3'));var db=require(_0xaf46('0x4'))['db'];var utils=require(_0xaf46('0x5'));var logger=require(_0xaf46('0x6'))(_0xaf46('0x7'));var config=require(_0xaf46('0x8'));var jayson=require(_0xaf46('0x9'));var client=jayson[_0xaf46('0xa')][_0xaf46('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9e9887,_0x4f76cc,_0xa4a618){return new BPromise(function(_0x105943,_0x328d92){return client['request'](_0x9e9887,_0xa4a618)[_0xaf46('0xc')](function(_0x4e67c0){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x4f76cc,_0xaf46('0xd'));logger[_0xaf46('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x4f76cc,_0xaf46('0xd'),JSON[_0xaf46('0xf')](_0x4e67c0));if(_0x4e67c0[_0xaf46('0x10')]){if(_0x4e67c0['error'][_0xaf46('0x11')]===0x1f4){logger['error'](_0xaf46('0x12'),_0x4f76cc,_0x4e67c0['error'][_0xaf46('0x13')]);return _0x328d92(_0x4e67c0['error'][_0xaf46('0x13')]);}logger[_0xaf46('0x10')](_0xaf46('0x12'),_0x4f76cc,_0x4e67c0[_0xaf46('0x10')][_0xaf46('0x13')]);return _0x105943(_0x4e67c0[_0xaf46('0x10')][_0xaf46('0x13')]);}else{logger[_0xaf46('0x14')]('VoiceDialReport,\x20%s,\x20%s',_0x4f76cc,'request\x20sent');_0x105943(_0x4e67c0['result'][_0xaf46('0x13')]);}})['catch'](function(_0x498720){logger[_0xaf46('0x10')](_0xaf46('0x12'),_0x4f76cc,_0x498720);_0x328d92(_0x498720);});});}exports['CreateVoiceDialReport']=function(_0x128ad8){var _0x3a26f1=this;return new Promise(function(_0x224413,_0xd1b9ce){return db[_0xaf46('0x15')][_0xaf46('0x16')](_0x128ad8['body'],{'raw':_0x128ad8[_0xaf46('0x17')]?_0x128ad8[_0xaf46('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaf46('0xc')](function(_0x4459d5){logger['info']('CreateVoiceDialReport',_0x128ad8);logger['debug'](_0xaf46('0x18'),_0x128ad8,JSON[_0xaf46('0xf')](_0x4459d5));_0x224413(_0x4459d5);})['catch'](function(_0x183cb6){logger['error'](_0xaf46('0x18'),_0x183cb6[_0xaf46('0x13')],_0x128ad8);_0xd1b9ce(_0x3a26f1[_0xaf46('0x10')](0x1f4,_0x183cb6[_0xaf46('0x13')]));});});};exports[_0xaf46('0x19')]=function(_0x39946c){var _0x166a0e=this;return new Promise(function(_0x119a98,_0xabed9f){return db[_0xaf46('0x15')]['update'](_0x39946c['body'],{'raw':_0x39946c[_0xaf46('0x17')]?_0x39946c[_0xaf46('0x17')][_0xaf46('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39946c[_0xaf46('0x17')]?_0x39946c[_0xaf46('0x17')][_0xaf46('0x1b')]||null:null,'attributes':_0x39946c[_0xaf46('0x17')]?_0x39946c[_0xaf46('0x17')]['attributes']||null:null,'limit':_0x39946c[_0xaf46('0x17')]?_0x39946c[_0xaf46('0x17')]['limit']||null:null})[_0xaf46('0xc')](function(_0x1cbebe){logger[_0xaf46('0x14')](_0xaf46('0x19'),_0x39946c);logger[_0xaf46('0xe')](_0xaf46('0x19'),_0x39946c,JSON['stringify'](_0x1cbebe));_0x119a98(_0x1cbebe);})[_0xaf46('0x1c')](function(_0x15cba5){logger['error'](_0xaf46('0x19'),_0x15cba5[_0xaf46('0x13')],_0x39946c);_0xabed9f(_0x166a0e[_0xaf46('0x10')](0x1f4,_0x15cba5[_0xaf46('0x13')]));});});};
\ No newline at end of file
+var _0xd0b5=['catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','attributes','limit','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x4c687a,_0x227569){var _0x43b6e0=function(_0x157013){while(--_0x157013){_0x4c687a['push'](_0x4c687a['shift']());}};_0x43b6e0(++_0x227569);}(_0xd0b5,0x1b8));var _0x5d0b=function(_0x51136c,_0x2161c9){_0x51136c=_0x51136c-0x0;var _0x588202=_0xd0b5[_0x51136c];return _0x588202;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5d0b('0x0'));var BPromise=require(_0x5d0b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d0b('0x2'));var db=require(_0x5d0b('0x3'))['db'];var utils=require(_0x5d0b('0x4'));var logger=require(_0x5d0b('0x5'))(_0x5d0b('0x6'));var config=require(_0x5d0b('0x7'));var jayson=require(_0x5d0b('0x8'));var client=jayson[_0x5d0b('0x9')][_0x5d0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1db3b1,_0x2582f3,_0x1407d6){return new BPromise(function(_0x226be8,_0x59be08){return client[_0x5d0b('0xb')](_0x1db3b1,_0x1407d6)['then'](function(_0x5550fa){logger[_0x5d0b('0xc')](_0x5d0b('0xd'),_0x2582f3,'request\x20sent');logger[_0x5d0b('0xe')](_0x5d0b('0xf'),_0x2582f3,'request\x20sent',JSON[_0x5d0b('0x10')](_0x5550fa));if(_0x5550fa[_0x5d0b('0x11')]){if(_0x5550fa[_0x5d0b('0x11')][_0x5d0b('0x12')]===0x1f4){logger[_0x5d0b('0x11')](_0x5d0b('0xd'),_0x2582f3,_0x5550fa['error'][_0x5d0b('0x13')]);return _0x59be08(_0x5550fa[_0x5d0b('0x11')][_0x5d0b('0x13')]);}logger[_0x5d0b('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x2582f3,_0x5550fa[_0x5d0b('0x11')][_0x5d0b('0x13')]);return _0x226be8(_0x5550fa['error'][_0x5d0b('0x13')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x2582f3,_0x5d0b('0x14'));_0x226be8(_0x5550fa[_0x5d0b('0x15')][_0x5d0b('0x13')]);}})[_0x5d0b('0x16')](function(_0x4892a4){logger[_0x5d0b('0x11')](_0x5d0b('0xd'),_0x2582f3,_0x4892a4);_0x59be08(_0x4892a4);});});}exports[_0x5d0b('0x17')]=function(_0x32f522){var _0x292b30=this;return new Promise(function(_0x2299ad,_0x1aaed9){return db[_0x5d0b('0x18')][_0x5d0b('0x19')](_0x32f522[_0x5d0b('0x1a')],{'raw':_0x32f522[_0x5d0b('0x1b')]?_0x32f522[_0x5d0b('0x1b')][_0x5d0b('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4c6fb2){logger[_0x5d0b('0xc')](_0x5d0b('0x17'),_0x32f522);logger[_0x5d0b('0xe')](_0x5d0b('0x17'),_0x32f522,JSON[_0x5d0b('0x10')](_0x4c6fb2));_0x2299ad(_0x4c6fb2);})['catch'](function(_0xd710a9){logger[_0x5d0b('0x11')]('CreateVoiceDialReport',_0xd710a9[_0x5d0b('0x13')],_0x32f522);_0x1aaed9(_0x292b30[_0x5d0b('0x11')](0x1f4,_0xd710a9[_0x5d0b('0x13')]));});});};exports[_0x5d0b('0x1d')]=function(_0x49a5bb){var _0x4a6f66=this;return new Promise(function(_0x2c0928,_0x24c044){return db[_0x5d0b('0x18')][_0x5d0b('0x1e')](_0x49a5bb[_0x5d0b('0x1a')],{'raw':_0x49a5bb[_0x5d0b('0x1b')]?_0x49a5bb[_0x5d0b('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49a5bb[_0x5d0b('0x1b')]?_0x49a5bb['options']['where']||null:null,'attributes':_0x49a5bb[_0x5d0b('0x1b')]?_0x49a5bb[_0x5d0b('0x1b')][_0x5d0b('0x1f')]||null:null,'limit':_0x49a5bb['options']?_0x49a5bb[_0x5d0b('0x1b')][_0x5d0b('0x20')]||null:null})['then'](function(_0x20e28b){logger[_0x5d0b('0xc')](_0x5d0b('0x1d'),_0x49a5bb);logger['debug'](_0x5d0b('0x1d'),_0x49a5bb,JSON[_0x5d0b('0x10')](_0x20e28b));_0x2c0928(_0x20e28b);})[_0x5d0b('0x16')](function(_0x15e1b1){logger[_0x5d0b('0x11')](_0x5d0b('0x1d'),_0x15e1b1['message'],_0x49a5bb);_0x24c044(_0x4a6f66[_0x5d0b('0x11')](0x1f4,_0x15e1b1[_0x5d0b('0x13')]));});});};
\ No newline at end of file
index 40332af..bb740fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf606=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','create','/:id/applications','addApplications'];(function(_0x1078ef,_0x5605b2){var _0x51ba6a=function(_0x1360dc){while(--_0x1360dc){_0x1078ef['push'](_0x1078ef['shift']());}};_0x51ba6a(++_0x5605b2);}(_0xf606,0x169));var _0x6f60=function(_0x15a067,_0x5c8931){_0x15a067=_0x15a067-0x0;var _0x119fef=_0xf606[_0x15a067];return _0x119fef;};'use strict';var multer=require(_0x6f60('0x0'));var util=require(_0x6f60('0x1'));var path=require(_0x6f60('0x2'));var timeout=require(_0x6f60('0x3'));var express=require(_0x6f60('0x4'));var router=express[_0x6f60('0x5')]();var auth=require(_0x6f60('0x6'));var interaction=require(_0x6f60('0x7'));var config=require('../../config/environment');var controller=require(_0x6f60('0x8'));router[_0x6f60('0x9')]('/',auth[_0x6f60('0xa')](),controller[_0x6f60('0xb')]);router['get'](_0x6f60('0xc'),auth[_0x6f60('0xa')](),controller['show']);router[_0x6f60('0xd')]('/',auth['isAuthenticated'](),controller[_0x6f60('0xe')]);router[_0x6f60('0xd')](_0x6f60('0xf'),auth[_0x6f60('0xa')](),controller[_0x6f60('0x10')]);router['put'](_0x6f60('0xc'),auth[_0x6f60('0xa')](),controller[_0x6f60('0x11')]);router[_0x6f60('0x12')](_0x6f60('0xc'),auth[_0x6f60('0xa')](),controller[_0x6f60('0x13')]);module[_0x6f60('0x14')]=router;
\ No newline at end of file
+var _0x67b0=['post','create','/:id/applications','addApplications','put','update','delete','/:id','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated'];(function(_0x1081a3,_0x2ac784){var _0x5696a2=function(_0x23d2f6){while(--_0x23d2f6){_0x1081a3['push'](_0x1081a3['shift']());}};_0x5696a2(++_0x2ac784);}(_0x67b0,0xda));var _0x067b=function(_0x31219a,_0x45bf6c){_0x31219a=_0x31219a-0x0;var _0x16f25c=_0x67b0[_0x31219a];return _0x16f25c;};'use strict';var multer=require(_0x067b('0x0'));var util=require(_0x067b('0x1'));var path=require('path');var timeout=require(_0x067b('0x2'));var express=require(_0x067b('0x3'));var router=express[_0x067b('0x4')]();var auth=require(_0x067b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x067b('0x6'));var controller=require(_0x067b('0x7'));router[_0x067b('0x8')]('/',auth[_0x067b('0x9')](),controller['index']);router[_0x067b('0x8')]('/:id',auth[_0x067b('0x9')](),controller['show']);router[_0x067b('0xa')]('/',auth['isAuthenticated'](),controller[_0x067b('0xb')]);router[_0x067b('0xa')](_0x067b('0xc'),auth['isAuthenticated'](),controller[_0x067b('0xd')]);router[_0x067b('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x067b('0xf')]);router[_0x067b('0x10')](_0x067b('0x11'),auth[_0x067b('0x9')](),controller['destroy']);module[_0x067b('0x12')]=router;
\ No newline at end of file
index 3b0c72e..a4a8e68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x33a8c1,_0x4d75b9){var _0x291e29=function(_0x18030a){while(--_0x18030a){_0x33a8c1['push'](_0x33a8c1['shift']());}};_0x291e29(++_0x4d75b9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}};
\ No newline at end of file
+var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x596c13,_0x145337){var _0x24873f=function(_0x5d5ed3){while(--_0x5d5ed3){_0x596c13['push'](_0x596c13['shift']());}};_0x24873f(++_0x145337);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}};
\ No newline at end of file
index 839e00d..b3401f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['query','filters','intersection','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','fields','length','includeAll','include','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','internal','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus','status','count','offset','limit','set','json','reject','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','end','stack','send','VoiceExtension','rawAttributes','key'];(function(_0x4e53dd,_0x44f0f2){var _0x181a81=function(_0x43ed0e){while(--_0x43ed0e){_0x4e53dd['push'](_0x4e53dd['shift']());}};_0x181a81(++_0x44f0f2);}(_0x5fab,0x177));var _0xb5fa=function(_0x89a001,_0x3a9a8c){_0x89a001=_0x89a001-0x0;var _0x5f3ec2=_0x5fab[_0x89a001];return _0x5f3ec2;};'use strict';var pdf=require(_0xb5fa('0x0'));var emlformat=require(_0xb5fa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb5fa('0x2'));var jsonpatch=require(_0xb5fa('0x3'));var rp=require(_0xb5fa('0x4'));var moment=require(_0xb5fa('0x5'));var BPromise=require(_0xb5fa('0x6'));var Mustache=require(_0xb5fa('0x7'));var util=require(_0xb5fa('0x8'));var path=require(_0xb5fa('0x9'));var sox=require(_0xb5fa('0xa'));var csv=require(_0xb5fa('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xb'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var db=require(_0xb5fa('0x18'))['db'];config[_0xb5fa('0x19')]=_['defaults'](config[_0xb5fa('0x19')],{'host':_0xb5fa('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb5fa('0x19')]));require('./voiceExtension.socket')[_0xb5fa('0x1b')](socket);function respondWithStatusCode(_0x3fc372,_0x40c914){_0x40c914=_0x40c914||0xcc;return function(_0xca8d82){if(_0xca8d82){return _0x3fc372[_0xb5fa('0x1c')](_0x40c914);}return _0x3fc372['status'](_0x40c914)['end']();};}function respondWithResult(_0x38e964,_0x587043){_0x587043=_0x587043||0xc8;return function(_0x31f252){if(_0x31f252){return _0x38e964[_0xb5fa('0x1d')](_0x587043)['json'](_0x31f252);}};}function respondWithFilteredResult(_0x4fabcc,_0x451a55){return function(_0x1f7f05){if(_0x1f7f05){var _0x32e9e5=_0x1f7f05[_0xb5fa('0x1e')],_0x46eef0=_0x451a55[_0xb5fa('0x1f')],_0x324ba5=_0x451a55[_0xb5fa('0x1f')]+_0x451a55[_0xb5fa('0x20')],_0x13e82b;if(_0x324ba5>=_0x32e9e5){_0x324ba5=_0x32e9e5;_0x13e82b=0xc8;}else{_0x13e82b=0xce;}_0x4fabcc[_0xb5fa('0x1d')](_0x13e82b);return _0x4fabcc[_0xb5fa('0x21')]('Content-Range',_0x46eef0+'-'+_0x324ba5+'/'+_0x32e9e5)[_0xb5fa('0x22')](_0x1f7f05);}return null;};}function patchUpdates(_0x519e20){return function(_0x37ae06){try{jsonpatch['apply'](_0x37ae06,_0x519e20,!![]);}catch(_0xd0fe2b){return BPromise[_0xb5fa('0x23')](_0xd0fe2b);}return _0x37ae06['save']();};}function saveUpdates(_0x40dfdf,_0x3a2ab9){return function(_0x283a56){if(_0x283a56){return _0x283a56['update'](_0x40dfdf)[_0xb5fa('0x24')](function(_0xec108f){return _0xec108f;});}return null;};}function removeEntity(_0x444237,_0x542348){return function(_0x224ec8){if(_0x224ec8){return _0x224ec8['destroy']()[_0xb5fa('0x24')](function(){var _0x264591=_0x224ec8[_0xb5fa('0x25')]({'plain':!![]});var _0x543edf=[{'name':_0xb5fa('0x26'),'value':_0xb5fa('0x27'),'ignore':![]},{'name':_0xb5fa('0x28'),'value':_0xb5fa('0x29'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x5bdf11=_(_0x543edf)['filter'](_0xb5fa('0x2a'))[_0xb5fa('0x2b')](_0xb5fa('0x2c'))[_0xb5fa('0x2c')]();if(_[_0xb5fa('0x2d')](_0x5bdf11,_0x264591[_0xb5fa('0x2e')])){return;}var _0x358549=_[_0xb5fa('0x2f')](_0x543edf,[_0xb5fa('0x2c'),_0x264591[_0xb5fa('0x2e')]])[_0xb5fa('0x30')];return db[_0xb5fa('0x31')][_0xb5fa('0x32')]({'where':{'type':_0x358549,'resourceId':_0x264591['id']}})[_0xb5fa('0x24')](function(){return _0x224ec8;});})[_0xb5fa('0x24')](function(){_0x444237[_0xb5fa('0x1d')](0xcc)[_0xb5fa('0x33')]();});}};}function handleEntityNotFound(_0x3fd1fb,_0x21fc7e){return function(_0x319c48){if(!_0x319c48){_0x3fd1fb[_0xb5fa('0x1c')](0x194);}return _0x319c48;};}function handleError(_0x370d95,_0x10fb43){_0x10fb43=_0x10fb43||0x1f4;return function(_0x25fc7c){logger['error'](_0x25fc7c[_0xb5fa('0x34')]);if(_0x25fc7c['name']){delete _0x25fc7c['name'];}_0x370d95['status'](_0x10fb43)[_0xb5fa('0x35')](_0x25fc7c);};}exports['index']=function(_0x3bb4de,_0x5876f1){var _0x5518b1={},_0x1847bc={},_0x934b49={'count':0x0,'rows':[]};var _0x4a4bff=_['map'](db[_0xb5fa('0x36')][_0xb5fa('0x37')],function(_0x252421){return{'name':_0x252421['fieldName'],'type':_0x252421[_0xb5fa('0x2e')][_0xb5fa('0x38')]};});_0x1847bc['model']=_[_0xb5fa('0x2b')](_0x4a4bff,_0xb5fa('0x30'));_0x1847bc[_0xb5fa('0x39')]=_['keys'](_0x3bb4de[_0xb5fa('0x39')]);_0x1847bc[_0xb5fa('0x3a')]=_[_0xb5fa('0x3b')](_0x1847bc['model'],_0x1847bc[_0xb5fa('0x39')]);_0x5518b1[_0xb5fa('0x3c')]=_[_0xb5fa('0x3b')](_0x1847bc[_0xb5fa('0x3d')],qs['fields'](_0x3bb4de['query']['fields']));_0x5518b1['attributes']=_0x5518b1['attributes']['length']?_0x5518b1[_0xb5fa('0x3c')]:_0x1847bc['model'];if(!_0x3bb4de[_0xb5fa('0x39')][_0xb5fa('0x3e')](_0xb5fa('0x3f'))){_0x5518b1[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0x3bb4de[_0xb5fa('0x39')]['limit']);_0x5518b1['offset']=qs['offset'](_0x3bb4de[_0xb5fa('0x39')]['offset']);}_0x5518b1[_0xb5fa('0x40')]=qs['sort'](_0x3bb4de['query'][_0xb5fa('0x41')]);_0x5518b1[_0xb5fa('0x42')]=qs[_0xb5fa('0x3a')](_[_0xb5fa('0x43')](_0x3bb4de[_0xb5fa('0x39')],_0x1847bc[_0xb5fa('0x3a')]),_0x4a4bff);if(_0x3bb4de[_0xb5fa('0x39')][_0xb5fa('0x44')]){_0x5518b1[_0xb5fa('0x42')]=_[_0xb5fa('0x45')](_0x5518b1['where'],{'$or':_[_0xb5fa('0x2b')](_0x4a4bff,function(_0x4bc9df){if(_0x4bc9df[_0xb5fa('0x2e')]!==_0xb5fa('0x46')){var _0x2c7c5f={};_0x2c7c5f[_0x4bc9df[_0xb5fa('0x30')]]={'$like':'%'+_0x3bb4de[_0xb5fa('0x39')][_0xb5fa('0x44')]+'%'};return _0x2c7c5f;}})});}_0x5518b1=_[_0xb5fa('0x45')]({},_0x5518b1,_0x3bb4de[_0xb5fa('0x47')]);var _0x4da448={'where':_0x5518b1[_0xb5fa('0x42')]};return db[_0xb5fa('0x36')]['count'](_0x4da448)[_0xb5fa('0x24')](function(_0x5a6ae3){_0x934b49[_0xb5fa('0x1e')]=_0x5a6ae3;if(_0x3bb4de[_0xb5fa('0x39')]['includeAll']){_0x5518b1['include']=[{'all':!![]}];}return db[_0xb5fa('0x36')][_0xb5fa('0x48')](_0x5518b1);})[_0xb5fa('0x24')](function(_0x19e662){_0x934b49[_0xb5fa('0x49')]=_0x19e662;return _0x934b49;})[_0xb5fa('0x24')](respondWithFilteredResult(_0x5876f1,_0x5518b1))[_0xb5fa('0x4a')](handleError(_0x5876f1,null));};exports[_0xb5fa('0x4b')]=function(_0x499d36,_0x13bf04){var _0x3e8b1d={'raw':![],'where':{'id':_0x499d36[_0xb5fa('0x4c')]['id']}},_0x4e0fe7={};_0x4e0fe7[_0xb5fa('0x3d')]=_[_0xb5fa('0x4d')](db[_0xb5fa('0x36')][_0xb5fa('0x37')]);_0x4e0fe7[_0xb5fa('0x39')]=_[_0xb5fa('0x4d')](_0x499d36[_0xb5fa('0x39')]);_0x4e0fe7[_0xb5fa('0x3a')]=_[_0xb5fa('0x3b')](_0x4e0fe7[_0xb5fa('0x3d')],_0x4e0fe7[_0xb5fa('0x39')]);_0x3e8b1d[_0xb5fa('0x3c')]=_[_0xb5fa('0x3b')](_0x4e0fe7[_0xb5fa('0x3d')],qs[_0xb5fa('0x4e')](_0x499d36['query']['fields']));_0x3e8b1d[_0xb5fa('0x3c')]=_0x3e8b1d['attributes'][_0xb5fa('0x4f')]?_0x3e8b1d[_0xb5fa('0x3c')]:_0x4e0fe7['model'];if(_0x499d36[_0xb5fa('0x39')][_0xb5fa('0x50')]){_0x3e8b1d[_0xb5fa('0x51')]=[{'all':!![]}];}_0x3e8b1d=_[_0xb5fa('0x45')]({},_0x3e8b1d,_0x499d36[_0xb5fa('0x47')]);return db[_0xb5fa('0x36')]['find'](_0x3e8b1d)[_0xb5fa('0x24')](handleEntityNotFound(_0x13bf04,null))['then'](respondWithResult(_0x13bf04,null))[_0xb5fa('0x4a')](handleError(_0x13bf04,null));};exports[_0xb5fa('0x32')]=function(_0x177c3b,_0x51f96a){return db[_0xb5fa('0x36')][_0xb5fa('0x2f')]({'where':{'id':_0x177c3b['params']['id']}})['then'](handleEntityNotFound(_0x51f96a,null))[_0xb5fa('0x24')](removeEntity(_0x51f96a,null))[_0xb5fa('0x4a')](handleError(_0x51f96a,null));};exports[_0xb5fa('0x52')]=function(_0x3ffdb5,_0x353fed){if(_0x3ffdb5[_0xb5fa('0x53')][_0xb5fa('0x2e')]===_0xb5fa('0x29')&&!_[_0xb5fa('0x54')](_0x3ffdb5[_0xb5fa('0x53')][_0xb5fa('0x55')],'_')){_0x3ffdb5[_0xb5fa('0x53')][_0xb5fa('0x55')]='_'[_0xb5fa('0x56')](_0x3ffdb5[_0xb5fa('0x53')][_0xb5fa('0x55')]);}return db[_0xb5fa('0x36')][_0xb5fa('0x52')](_0x3ffdb5['body'],{'raw':![]})[_0xb5fa('0x24')](function(_0x347791){var _0x222016=_0x3ffdb5[_0xb5fa('0x57')][_0xb5fa('0x25')]({'plain':!![]});if(!_0x222016)throw new Error(_0xb5fa('0x58'));if(_0x222016[_0xb5fa('0x59')]===_0xb5fa('0x57')){var _0x1cb39e=_0x347791[_0xb5fa('0x25')]({'plain':!![]});var _0x4ea97d=[{'name':'InboundRoutes','value':_0xb5fa('0x27')},{'name':_0xb5fa('0x28'),'value':_0xb5fa('0x29')},{'name':'InternalRoutes','value':_0xb5fa('0x5a')}];var _0x367f7a=_[_0xb5fa('0x2f')](_0x4ea97d,[_0xb5fa('0x2c'),_0x1cb39e[_0xb5fa('0x2e')]])[_0xb5fa('0x30')];return db[_0xb5fa('0x5b')]['find']({'where':{'name':_0x367f7a,'userProfileId':_0x222016[_0xb5fa('0x5c')]},'raw':!![]})[_0xb5fa('0x24')](function(_0x4afc02){if(_0x4afc02&&_0x4afc02[_0xb5fa('0x5d')]===0x0){return db[_0xb5fa('0x31')]['create']({'name':_0x1cb39e[_0xb5fa('0x30')],'resourceId':_0x1cb39e['id'],'type':_0x4afc02[_0xb5fa('0x30')],'sectionId':_0x4afc02['id']},{})[_0xb5fa('0x24')](function(){return _0x347791;});}else{return _0x347791;}})[_0xb5fa('0x4a')](function(_0x567d1c){logger[_0xb5fa('0x5e')](_0xb5fa('0x5f'),_0x567d1c);throw _0x567d1c;});}return _0x347791;})[_0xb5fa('0x24')](respondWithResult(_0x353fed,0xc9))[_0xb5fa('0x4a')](handleError(_0x353fed,null));};exports[_0xb5fa('0x60')]=function(_0xfb88cc,_0x3caf48){if(_0xfb88cc[_0xb5fa('0x53')]['id']){delete _0xfb88cc[_0xb5fa('0x53')]['id'];}return db[_0xb5fa('0x36')][_0xb5fa('0x2f')]({'where':{'id':_0xfb88cc[_0xb5fa('0x4c')]['id']}})[_0xb5fa('0x24')](handleEntityNotFound(_0x3caf48,null))[_0xb5fa('0x24')](function(_0x16b382){if(_0x16b382){return db[_0xb5fa('0x36')][_0xb5fa('0x60')](_['pick'](_0xfb88cc[_0xb5fa('0x53')],[_0xb5fa('0x55'),_0xb5fa('0x61'),'description',_0xb5fa('0x62'),_0xb5fa('0x63'),'mandatoryDisposition']),{'where':{'context':_0x16b382[_0xb5fa('0x61')],'exten':_0x16b382[_0xb5fa('0x55')]},'individualHooks':!![]})[_0xb5fa('0x24')](function(_0x571bb9){return _0x571bb9;});}return null;})['then'](respondWithStatusCode(_0x3caf48,null))[_0xb5fa('0x4a')](handleError(_0x3caf48,null));};exports[_0xb5fa('0x64')]=function(_0x432f04,_0x57d8b7,_0x597206){return db[_0xb5fa('0x36')][_0xb5fa('0x65')]({'where':{'id':_0x432f04[_0xb5fa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57d8b7,null))['then'](function(_0x5cec07){if(_0x5cec07){return db[_0xb5fa('0x66')][_0xb5fa('0x67')](function(_0x1872aa){return db['VoiceExtension'][_0xb5fa('0x32')]({'where':{'VoiceExtensionId':_0x432f04[_0xb5fa('0x4c')]['id']},'transaction':_0x1872aa})[_0xb5fa('0x24')](function(_0x42a763){var _0x2a1872=_[_0xb5fa('0x2b')](_0x432f04[_0xb5fa('0x53')],function(_0x144599){_0x144599[_0xb5fa('0x68')]=_0x432f04[_0xb5fa('0x4c')]['id'];return _0x144599;});return db[_0xb5fa('0x36')][_0xb5fa('0x69')](_0x2a1872,{'transaction':_0x1872aa});});})[_0xb5fa('0x24')](function(){return db[_0xb5fa('0x36')][_0xb5fa('0x6a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x432f04['params']['id']},'order':_0xb5fa('0x6b')});});}})['then'](respondWithResult(_0x57d8b7,null))[_0xb5fa('0x4a')](handleError(_0x57d8b7,null));};
\ No newline at end of file
+var _0x0295=['where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','params','body','startsWith','exten','create','role','user','internal','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','recordingFormat','mandatoryDisposition','addApplications','sequelize','bulkCreate','cast(priority\x20as\x20unsigned)','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','./voiceExtension.socket','register','sendStatus','status','end','json','count','offset','Content-Range','reject','update','then','get','OutboundRoutes','outbound','InternalRoutes','filter','map','value','type','find','name','destroy','stack','index','VoiceExtension','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x2d7367,_0x202384){var _0x1584da=function(_0x506fd2){while(--_0x506fd2){_0x2d7367['push'](_0x2d7367['shift']());}};_0x1584da(++_0x202384);}(_0x0295,0x1f0));var _0x5029=function(_0x5a26db,_0x2c5ccd){_0x5a26db=_0x5a26db-0x0;var _0x4619dd=_0x0295[_0x5a26db];return _0x4619dd;};'use strict';var pdf=require(_0x5029('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5029('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5029('0x2'));var BPromise=require(_0x5029('0x3'));var Mustache=require(_0x5029('0x4'));var util=require(_0x5029('0x5'));var path=require(_0x5029('0x6'));var sox=require(_0x5029('0x7'));var csv=require(_0x5029('0x8'));var ejs=require(_0x5029('0x9'));var fs=require('fs');var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var db=require('../../mysqldb')['db'];config[_0x5029('0x14')]=_[_0x5029('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5029('0x16'))[_0x5029('0x17')](socket);function respondWithStatusCode(_0x12c237,_0x434630){_0x434630=_0x434630||0xcc;return function(_0x2c0b33){if(_0x2c0b33){return _0x12c237[_0x5029('0x18')](_0x434630);}return _0x12c237[_0x5029('0x19')](_0x434630)[_0x5029('0x1a')]();};}function respondWithResult(_0x10bf55,_0x326923){_0x326923=_0x326923||0xc8;return function(_0x457c73){if(_0x457c73){return _0x10bf55[_0x5029('0x19')](_0x326923)[_0x5029('0x1b')](_0x457c73);}};}function respondWithFilteredResult(_0x2c273c,_0x343918){return function(_0x4f7ab4){if(_0x4f7ab4){var _0x1ed567=_0x4f7ab4[_0x5029('0x1c')],_0x31a155=_0x343918[_0x5029('0x1d')],_0x35de81=_0x343918[_0x5029('0x1d')]+_0x343918['limit'],_0x4902f3;if(_0x35de81>=_0x1ed567){_0x35de81=_0x1ed567;_0x4902f3=0xc8;}else{_0x4902f3=0xce;}_0x2c273c[_0x5029('0x19')](_0x4902f3);return _0x2c273c['set'](_0x5029('0x1e'),_0x31a155+'-'+_0x35de81+'/'+_0x1ed567)[_0x5029('0x1b')](_0x4f7ab4);}return null;};}function patchUpdates(_0x2710aa){return function(_0x3cf0fb){try{jsonpatch['apply'](_0x3cf0fb,_0x2710aa,!![]);}catch(_0x47ecca){return BPromise[_0x5029('0x1f')](_0x47ecca);}return _0x3cf0fb['save']();};}function saveUpdates(_0x3f657d,_0x853a34){return function(_0x1eb228){if(_0x1eb228){return _0x1eb228[_0x5029('0x20')](_0x3f657d)[_0x5029('0x21')](function(_0x3a3e52){return _0x3a3e52;});}return null;};}function removeEntity(_0x125c26,_0x356dac){return function(_0x3e857d){if(_0x3e857d){return _0x3e857d['destroy']()['then'](function(){var _0x49f347=_0x3e857d[_0x5029('0x22')]({'plain':!![]});var _0x45666c=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x5029('0x23'),'value':_0x5029('0x24'),'ignore':![]},{'name':_0x5029('0x25'),'value':'internal','ignore':![]}];var _0x2c501f=_(_0x45666c)[_0x5029('0x26')]('ignore')[_0x5029('0x27')](_0x5029('0x28'))[_0x5029('0x28')]();if(_['includes'](_0x2c501f,_0x49f347[_0x5029('0x29')])){return;}var _0x251f99=_[_0x5029('0x2a')](_0x45666c,['value',_0x49f347[_0x5029('0x29')]])[_0x5029('0x2b')];return db['UserProfileResource'][_0x5029('0x2c')]({'where':{'type':_0x251f99,'resourceId':_0x49f347['id']}})[_0x5029('0x21')](function(){return _0x3e857d;});})[_0x5029('0x21')](function(){_0x125c26[_0x5029('0x19')](0xcc)[_0x5029('0x1a')]();});}};}function handleEntityNotFound(_0x2a1ed6,_0x44255a){return function(_0x465153){if(!_0x465153){_0x2a1ed6[_0x5029('0x18')](0x194);}return _0x465153;};}function handleError(_0x22559a,_0x358a2b){_0x358a2b=_0x358a2b||0x1f4;return function(_0x4519c8){logger['error'](_0x4519c8[_0x5029('0x2d')]);if(_0x4519c8['name']){delete _0x4519c8[_0x5029('0x2b')];}_0x22559a['status'](_0x358a2b)['send'](_0x4519c8);};}exports[_0x5029('0x2e')]=function(_0x447680,_0x1f9173){var _0x4b7330={},_0x2a1535={},_0x15d882={'count':0x0,'rows':[]};var _0x3f20fb=_[_0x5029('0x27')](db[_0x5029('0x2f')][_0x5029('0x30')],function(_0x46ec59){return{'name':_0x46ec59[_0x5029('0x31')],'type':_0x46ec59[_0x5029('0x29')]['key']};});_0x2a1535[_0x5029('0x32')]=_[_0x5029('0x27')](_0x3f20fb,_0x5029('0x2b'));_0x2a1535[_0x5029('0x33')]=_['keys'](_0x447680[_0x5029('0x33')]);_0x2a1535[_0x5029('0x34')]=_[_0x5029('0x35')](_0x2a1535['model'],_0x2a1535['query']);_0x4b7330[_0x5029('0x36')]=_[_0x5029('0x35')](_0x2a1535['model'],qs['fields'](_0x447680[_0x5029('0x33')][_0x5029('0x37')]));_0x4b7330[_0x5029('0x36')]=_0x4b7330[_0x5029('0x36')][_0x5029('0x38')]?_0x4b7330[_0x5029('0x36')]:_0x2a1535[_0x5029('0x32')];if(!_0x447680[_0x5029('0x33')][_0x5029('0x39')](_0x5029('0x3a'))){_0x4b7330[_0x5029('0x3b')]=qs[_0x5029('0x3b')](_0x447680[_0x5029('0x33')][_0x5029('0x3b')]);_0x4b7330['offset']=qs['offset'](_0x447680[_0x5029('0x33')][_0x5029('0x1d')]);}_0x4b7330[_0x5029('0x3c')]=qs['sort'](_0x447680[_0x5029('0x33')][_0x5029('0x3d')]);_0x4b7330['where']=qs[_0x5029('0x34')](_['pick'](_0x447680[_0x5029('0x33')],_0x2a1535['filters']),_0x3f20fb);if(_0x447680[_0x5029('0x33')][_0x5029('0x26')]){_0x4b7330[_0x5029('0x3e')]=_[_0x5029('0x3f')](_0x4b7330[_0x5029('0x3e')],{'$or':_[_0x5029('0x27')](_0x3f20fb,function(_0x4b2219){if(_0x4b2219[_0x5029('0x29')]!==_0x5029('0x40')){var _0x5a3e4d={};_0x5a3e4d[_0x4b2219[_0x5029('0x2b')]]={'$like':'%'+_0x447680[_0x5029('0x33')][_0x5029('0x26')]+'%'};return _0x5a3e4d;}})});}_0x4b7330=_[_0x5029('0x3f')]({},_0x4b7330,_0x447680[_0x5029('0x41')]);var _0x11ac2e={'where':_0x4b7330['where']};return db[_0x5029('0x2f')][_0x5029('0x1c')](_0x11ac2e)[_0x5029('0x21')](function(_0x1d6c1f){_0x15d882[_0x5029('0x1c')]=_0x1d6c1f;if(_0x447680['query'][_0x5029('0x42')]){_0x4b7330[_0x5029('0x43')]=[{'all':!![]}];}return db[_0x5029('0x2f')][_0x5029('0x44')](_0x4b7330);})[_0x5029('0x21')](function(_0x128aff){_0x15d882[_0x5029('0x45')]=_0x128aff;return _0x15d882;})[_0x5029('0x21')](respondWithFilteredResult(_0x1f9173,_0x4b7330))[_0x5029('0x46')](handleError(_0x1f9173,null));};exports['show']=function(_0x32d0fa,_0x27d2ad){var _0x3e64cf={'raw':![],'where':{'id':_0x32d0fa['params']['id']}},_0xdb3e78={};_0xdb3e78['model']=_[_0x5029('0x47')](db[_0x5029('0x2f')][_0x5029('0x30')]);_0xdb3e78[_0x5029('0x33')]=_[_0x5029('0x47')](_0x32d0fa[_0x5029('0x33')]);_0xdb3e78[_0x5029('0x34')]=_[_0x5029('0x35')](_0xdb3e78[_0x5029('0x32')],_0xdb3e78[_0x5029('0x33')]);_0x3e64cf[_0x5029('0x36')]=_[_0x5029('0x35')](_0xdb3e78[_0x5029('0x32')],qs[_0x5029('0x37')](_0x32d0fa[_0x5029('0x33')][_0x5029('0x37')]));_0x3e64cf[_0x5029('0x36')]=_0x3e64cf[_0x5029('0x36')][_0x5029('0x38')]?_0x3e64cf[_0x5029('0x36')]:_0xdb3e78[_0x5029('0x32')];if(_0x32d0fa['query'][_0x5029('0x42')]){_0x3e64cf['include']=[{'all':!![]}];}_0x3e64cf=_[_0x5029('0x3f')]({},_0x3e64cf,_0x32d0fa[_0x5029('0x41')]);return db['VoiceExtension']['find'](_0x3e64cf)[_0x5029('0x21')](handleEntityNotFound(_0x27d2ad,null))['then'](respondWithResult(_0x27d2ad,null))['catch'](handleError(_0x27d2ad,null));};exports[_0x5029('0x2c')]=function(_0x8d2eed,_0x2e4c4e){return db['VoiceExtension']['find']({'where':{'id':_0x8d2eed[_0x5029('0x48')]['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x2e4c4e,null))['then'](removeEntity(_0x2e4c4e,null))[_0x5029('0x46')](handleError(_0x2e4c4e,null));};exports['create']=function(_0xacd94e,_0x5f1e4f){if(_0xacd94e[_0x5029('0x49')][_0x5029('0x29')]===_0x5029('0x24')&&!_[_0x5029('0x4a')](_0xacd94e[_0x5029('0x49')][_0x5029('0x4b')],'_')){_0xacd94e[_0x5029('0x49')][_0x5029('0x4b')]='_'['concat'](_0xacd94e[_0x5029('0x49')]['exten']);}return db[_0x5029('0x2f')][_0x5029('0x4c')](_0xacd94e['body'],{'raw':![]})[_0x5029('0x21')](function(_0x4e51b5){var _0x58928f=_0xacd94e['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x58928f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58928f[_0x5029('0x4d')]===_0x5029('0x4e')){var _0x21d747=_0x4e51b5['get']({'plain':!![]});var _0xb43232=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x5029('0x23'),'value':_0x5029('0x24')},{'name':_0x5029('0x25'),'value':_0x5029('0x4f')}];var _0x164179=_['find'](_0xb43232,[_0x5029('0x28'),_0x21d747[_0x5029('0x29')]])[_0x5029('0x2b')];return db[_0x5029('0x50')]['find']({'where':{'name':_0x164179,'userProfileId':_0x58928f[_0x5029('0x51')]},'raw':!![]})[_0x5029('0x21')](function(_0x4d4a2d){if(_0x4d4a2d&&_0x4d4a2d['autoAssociation']===0x0){return db[_0x5029('0x52')][_0x5029('0x4c')]({'name':_0x21d747[_0x5029('0x2b')],'resourceId':_0x21d747['id'],'type':_0x4d4a2d[_0x5029('0x2b')],'sectionId':_0x4d4a2d['id']},{})['then'](function(){return _0x4e51b5;});}else{return _0x4e51b5;}})[_0x5029('0x46')](function(_0xb43d95){logger[_0x5029('0x53')](_0x5029('0x54'),_0xb43d95);throw _0xb43d95;});}return _0x4e51b5;})[_0x5029('0x21')](respondWithResult(_0x5f1e4f,0xc9))[_0x5029('0x46')](handleError(_0x5f1e4f,null));};exports['update']=function(_0x560324,_0x4314c0){if(_0x560324[_0x5029('0x49')]['id']){delete _0x560324[_0x5029('0x49')]['id'];}return db['VoiceExtension'][_0x5029('0x2a')]({'where':{'id':_0x560324[_0x5029('0x48')]['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x4314c0,null))[_0x5029('0x21')](function(_0x151663){if(_0x151663){return db['VoiceExtension'][_0x5029('0x20')](_[_0x5029('0x55')](_0x560324[_0x5029('0x49')],['exten',_0x5029('0x56'),'description',_0x5029('0x57'),'cutdigits',_0x5029('0x58')]),{'where':{'context':_0x151663[_0x5029('0x56')],'exten':_0x151663[_0x5029('0x4b')]},'individualHooks':!![]})[_0x5029('0x21')](function(_0x1d2a67){return _0x1d2a67;});}return null;})[_0x5029('0x21')](respondWithStatusCode(_0x4314c0,null))['catch'](handleError(_0x4314c0,null));};exports[_0x5029('0x59')]=function(_0x19220d,_0x1ff8df,_0x151562){return db[_0x5029('0x2f')]['findOne']({'where':{'id':_0x19220d[_0x5029('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ff8df,null))[_0x5029('0x21')](function(_0x539f80){if(_0x539f80){return db[_0x5029('0x5a')]['transaction'](function(_0x1c339e){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x19220d[_0x5029('0x48')]['id']},'transaction':_0x1c339e})['then'](function(_0x2d2a40){var _0xd0175d=_[_0x5029('0x27')](_0x19220d['body'],function(_0x234831){_0x234831['VoiceExtensionId']=_0x19220d[_0x5029('0x48')]['id'];return _0x234831;});return db[_0x5029('0x2f')][_0x5029('0x5b')](_0xd0175d,{'transaction':_0x1c339e});});})[_0x5029('0x21')](function(){return db[_0x5029('0x2f')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x19220d[_0x5029('0x48')]['id']},'order':_0x5029('0x5c')});});}})['then'](respondWithResult(_0x1ff8df,null))[_0x5029('0x46')](handleError(_0x1ff8df,null));};
\ No newline at end of file
index bf7259d..53cc1e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x926f=['hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x38035c,_0x5c272c){var _0x3e8cf2=function(_0x4f0ee1){while(--_0x4f0ee1){_0x38035c['push'](_0x38035c['shift']());}};_0x3e8cf2(++_0x5c272c);}(_0x926f,0xb6));var _0xf926=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x926f[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0xf926('0x0'));var VoiceExtension=require(_0xf926('0x1'))['db'][_0xf926('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xf926('0x3')](0x0);var events={'afterCreate':_0xf926('0x4'),'afterUpdate':_0xf926('0x5'),'afterDestroy':_0xf926('0x6')};function emitEvent(_0x579719){return function(_0x2b459c,_0x3a463b,_0x2cd78b){VoiceExtensionEvents[_0xf926('0x7')](_0x579719+':'+_0x2b459c['id'],_0x2b459c);VoiceExtensionEvents[_0xf926('0x7')](_0x579719,_0x2b459c);_0x2cd78b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xf926('0x8')](e,emitEvent(event));}}module[_0xf926('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x3a89=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x546c7d,_0x5e7bee){var _0x33bf10=function(_0x5eeae4){while(--_0x5eeae4){_0x546c7d['push'](_0x546c7d['shift']());}};_0x33bf10(++_0x5e7bee);}(_0x3a89,0x114));var _0x93a8=function(_0x59a68a,_0x91057b){_0x59a68a=_0x59a68a-0x0;var _0x4a3077=_0x3a89[_0x59a68a];return _0x4a3077;};'use strict';var EventEmitter=require(_0x93a8('0x0'));var VoiceExtension=require(_0x93a8('0x1'))['db'][_0x93a8('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x93a8('0x3')](0x0);var events={'afterCreate':_0x93a8('0x4'),'afterUpdate':'update','afterDestroy':_0x93a8('0x5')};function emitEvent(_0x2317f5){return function(_0x13d481,_0x5116f1,_0x1947cd){VoiceExtensionEvents[_0x93a8('0x6')](_0x2317f5+':'+_0x13d481['id'],_0x13d481);VoiceExtensionEvents[_0x93a8('0x6')](_0x2317f5,_0x13d481);_0x1947cd(null);};}for(var e in events){if(events[_0x93a8('0x7')](e)){var event=events[e];VoiceExtension[_0x93a8('0x8')](e,emitEvent(event));}}module[_0x93a8('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
index 8bdd83a..aa3e6dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceExtension.attributes','exports','VoiceExtension','voice_extensions','lodash','util'];(function(_0x3767ef,_0x29c168){var _0x14c673=function(_0x108c18){while(--_0x108c18){_0x3767ef['push'](_0x3767ef['shift']());}};_0x14c673(++_0x29c168);}(_0x7a54,0x106));var _0x47a5=function(_0x37fca0,_0x4952c4){_0x37fca0=_0x37fca0-0x0;var _0x25d46c=_0x7a54[_0x37fca0];return _0x25d46c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceExtension.attributes','exports','VoiceExtension','voice_extensions','lodash','util'];(function(_0x4e427d,_0x5c4aab){var _0x5a6b41=function(_0x12f76f){while(--_0x12f76f){_0x4e427d['push'](_0x4e427d['shift']());}};_0x5a6b41(++_0x5c4aab);}(_0x5fab,0x177));var _0xb5fa=function(_0x114c1c,_0x5bfd6d){_0x114c1c=_0x114c1c-0x0;var _0x50a0a6=_0x5fab[_0x114c1c];return _0x50a0a6;};'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 5d27d2e..6e7e28f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71d0=['message','result','GetVoiceExtension','findAll','options','where','attributes','limit','include','map','model','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x71d0,0x18d));var _0x071d=function(_0x46dc43,_0x9ad94){_0x46dc43=_0x46dc43-0x0;var _0x4a131b=_0x71d0[_0x46dc43];return _0x4a131b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x071d('0x0'));var BPromise=require(_0x071d('0x1'));var rs=require(_0x071d('0x2'));var fs=require('fs');var Redis=require(_0x071d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x071d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x071d('0x5'));var jayson=require(_0x071d('0x6'));var client=jayson[_0x071d('0x7')][_0x071d('0x8')]({'port':0x232a});config[_0x071d('0x9')]=_['defaults'](config[_0x071d('0x9')],{'host':_0x071d('0xa'),'port':0x18eb});var socket=require(_0x071d('0xb'))(new Redis(config[_0x071d('0x9')]));require('./voiceExtension.socket')[_0x071d('0xc')](socket);function respondWithRpcPromise(_0x32a13e,_0x985d5d,_0x1c3ad5){return new BPromise(function(_0x351866,_0x3776f7){return client[_0x071d('0xd')](_0x32a13e,_0x1c3ad5)[_0x071d('0xe')](function(_0x46aad5){logger[_0x071d('0xf')](_0x071d('0x10'),_0x985d5d,'request\x20sent');logger[_0x071d('0x11')](_0x071d('0x12'),_0x985d5d,_0x071d('0x13'),JSON[_0x071d('0x14')](_0x46aad5));if(_0x46aad5[_0x071d('0x15')]){if(_0x46aad5[_0x071d('0x15')][_0x071d('0x16')]===0x1f4){logger[_0x071d('0x15')](_0x071d('0x10'),_0x985d5d,_0x46aad5[_0x071d('0x15')][_0x071d('0x17')]);return _0x3776f7(_0x46aad5[_0x071d('0x15')]['message']);}logger[_0x071d('0x15')](_0x071d('0x10'),_0x985d5d,_0x46aad5[_0x071d('0x15')]['message']);return _0x351866(_0x46aad5[_0x071d('0x15')][_0x071d('0x17')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x985d5d,_0x071d('0x13'));_0x351866(_0x46aad5[_0x071d('0x18')][_0x071d('0x17')]);}})['catch'](function(_0x375c45){logger[_0x071d('0x15')](_0x071d('0x10'),_0x985d5d,_0x375c45);_0x3776f7(_0x375c45);});});}exports[_0x071d('0x19')]=function(_0x169888){var _0x1a5f78=this;return new Promise(function(_0x53f9ef,_0x3b2649){return db['VoiceExtension'][_0x071d('0x1a')]({'raw':_0x169888['options']?_0x169888[_0x071d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x169888[_0x071d('0x1b')]?_0x169888[_0x071d('0x1b')][_0x071d('0x1c')]||null:null,'attributes':_0x169888[_0x071d('0x1b')]?_0x169888['options'][_0x071d('0x1d')]||null:null,'limit':_0x169888[_0x071d('0x1b')]?_0x169888['options'][_0x071d('0x1e')]||null:null,'include':_0x169888[_0x071d('0x1b')]?_0x169888[_0x071d('0x1b')][_0x071d('0x1f')]?_[_0x071d('0x20')](_0x169888[_0x071d('0x1b')][_0x071d('0x1f')],function(_0x1461fb){return{'model':db[_0x1461fb['model']],'as':_0x1461fb['as'],'attributes':_0x1461fb[_0x071d('0x1d')],'include':_0x1461fb[_0x071d('0x1f')]?_['map'](_0x1461fb['include'],function(_0x37be05){return{'model':db[_0x37be05[_0x071d('0x21')]],'as':_0x37be05['as'],'attributes':_0x37be05['attributes'],'include':_0x37be05['include']?_['map'](_0x37be05['include'],function(_0x2a2061){return{'model':db[_0x2a2061['model']],'as':_0x2a2061['as'],'attributes':_0x2a2061[_0x071d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x071d('0xe')](function(_0x499b71){logger['info'](_0x071d('0x19'),_0x169888);logger[_0x071d('0x11')]('GetVoiceExtension',_0x169888,JSON[_0x071d('0x14')](_0x499b71));_0x53f9ef(_0x499b71);})[_0x071d('0x22')](function(_0xd5a371){logger[_0x071d('0x15')](_0x071d('0x19'),_0xd5a371[_0x071d('0x17')],_0x169888);_0x3b2649(_0x1a5f78[_0x071d('0x15')](0x1f4,_0xd5a371[_0x071d('0x17')]));});});};
\ No newline at end of file
+var _0xf0c1=['attributes','include','model','map','GetVoiceExtension','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','code','error','message','VoiceExtension,\x20%s,\x20%s','result','catch','VoiceExtension','options','raw'];(function(_0x23da4d,_0x63498c){var _0x4ae55=function(_0x323d75){while(--_0x323d75){_0x23da4d['push'](_0x23da4d['shift']());}};_0x4ae55(++_0x63498c);}(_0xf0c1,0x1a8));var _0x1f0c=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xf0c1[_0x1406ae];return _0x23a076;};'use strict';var _=require(_0x1f0c('0x0'));var util=require(_0x1f0c('0x1'));var moment=require('moment');var BPromise=require(_0x1f0c('0x2'));var rs=require(_0x1f0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f0c('0x4'))['db'];var utils=require(_0x1f0c('0x5'));var logger=require(_0x1f0c('0x6'))('rpc');var config=require(_0x1f0c('0x7'));var jayson=require(_0x1f0c('0x8'));var client=jayson[_0x1f0c('0x9')][_0x1f0c('0xa')]({'port':0x232a});config[_0x1f0c('0xb')]=_[_0x1f0c('0xc')](config[_0x1f0c('0xb')],{'host':_0x1f0c('0xd'),'port':0x18eb});var socket=require(_0x1f0c('0xe'))(new Redis(config[_0x1f0c('0xb')]));require(_0x1f0c('0xf'))[_0x1f0c('0x10')](socket);function respondWithRpcPromise(_0xd6babc,_0x285b70,_0x13ba10){return new BPromise(function(_0x1fa771,_0x5f004a){return client[_0x1f0c('0x11')](_0xd6babc,_0x13ba10)[_0x1f0c('0x12')](function(_0x385093){logger[_0x1f0c('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x285b70,_0x1f0c('0x14'));logger['debug'](_0x1f0c('0x15'),_0x285b70,_0x1f0c('0x14'),JSON[_0x1f0c('0x16')](_0x385093));if(_0x385093['error']){if(_0x385093['error'][_0x1f0c('0x17')]===0x1f4){logger[_0x1f0c('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x285b70,_0x385093[_0x1f0c('0x18')][_0x1f0c('0x19')]);return _0x5f004a(_0x385093['error']['message']);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x285b70,_0x385093[_0x1f0c('0x18')][_0x1f0c('0x19')]);return _0x1fa771(_0x385093['error'][_0x1f0c('0x19')]);}else{logger[_0x1f0c('0x13')](_0x1f0c('0x1a'),_0x285b70,_0x1f0c('0x14'));_0x1fa771(_0x385093[_0x1f0c('0x1b')][_0x1f0c('0x19')]);}})[_0x1f0c('0x1c')](function(_0xae25b5){logger['error'](_0x1f0c('0x1a'),_0x285b70,_0xae25b5);_0x5f004a(_0xae25b5);});});}exports['GetVoiceExtension']=function(_0x1ab2d6){var _0x18e461=this;return new Promise(function(_0xe42ccb,_0x1bc68b){return db[_0x1f0c('0x1d')]['findAll']({'raw':_0x1ab2d6[_0x1f0c('0x1e')]?_0x1ab2d6[_0x1f0c('0x1e')][_0x1f0c('0x1f')]===undefined?!![]:![]:!![],'where':_0x1ab2d6[_0x1f0c('0x1e')]?_0x1ab2d6[_0x1f0c('0x1e')]['where']||null:null,'attributes':_0x1ab2d6[_0x1f0c('0x1e')]?_0x1ab2d6['options'][_0x1f0c('0x20')]||null:null,'limit':_0x1ab2d6[_0x1f0c('0x1e')]?_0x1ab2d6[_0x1f0c('0x1e')]['limit']||null:null,'include':_0x1ab2d6['options']?_0x1ab2d6[_0x1f0c('0x1e')][_0x1f0c('0x21')]?_['map'](_0x1ab2d6[_0x1f0c('0x1e')]['include'],function(_0x100423){return{'model':db[_0x100423[_0x1f0c('0x22')]],'as':_0x100423['as'],'attributes':_0x100423[_0x1f0c('0x20')],'include':_0x100423['include']?_[_0x1f0c('0x23')](_0x100423[_0x1f0c('0x21')],function(_0x14103f){return{'model':db[_0x14103f[_0x1f0c('0x22')]],'as':_0x14103f['as'],'attributes':_0x14103f[_0x1f0c('0x20')],'include':_0x14103f[_0x1f0c('0x21')]?_[_0x1f0c('0x23')](_0x14103f[_0x1f0c('0x21')],function(_0xb9c49){return{'model':db[_0xb9c49[_0x1f0c('0x22')]],'as':_0xb9c49['as'],'attributes':_0xb9c49[_0x1f0c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1f0c('0x12')](function(_0xddb8f1){logger[_0x1f0c('0x13')](_0x1f0c('0x24'),_0x1ab2d6);logger[_0x1f0c('0x25')](_0x1f0c('0x24'),_0x1ab2d6,JSON[_0x1f0c('0x16')](_0xddb8f1));_0xe42ccb(_0xddb8f1);})['catch'](function(_0x367f22){logger[_0x1f0c('0x18')]('GetVoiceExtension',_0x367f22[_0x1f0c('0x19')],_0x1ab2d6);_0x1bc68b(_0x18e461[_0x1f0c('0x18')](0x1f4,_0x367f22[_0x1f0c('0x19')]));});});};
\ No newline at end of file
index 61d5f3b..fb5e59c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa671=['save','remove','removeListener','register','length','voiceExtension:','./voiceExtension.events'];(function(_0x226080,_0x5cb137){var _0x162f40=function(_0x4033ff){while(--_0x4033ff){_0x226080['push'](_0x226080['shift']());}};_0x162f40(++_0x5cb137);}(_0xa671,0x76));var _0x1a67=function(_0x572165,_0x6a45cc){_0x572165=_0x572165-0x0;var _0x8c8709=_0xa671[_0x572165];return _0x8c8709;};'use strict';var VoiceExtensionEvents=require(_0x1a67('0x0'));var events=[_0x1a67('0x1'),_0x1a67('0x2'),'update'];function createListener(_0x46a0a1,_0x46048b){return function(_0xc64f3a){_0x46048b['emit'](_0x46a0a1,_0xc64f3a);};}function removeListener(_0x1c4f29,_0x34d2bb){return function(){VoiceExtensionEvents[_0x1a67('0x3')](_0x1c4f29,_0x34d2bb);};}exports[_0x1a67('0x4')]=function(_0x4f232a){for(var _0x4a041d=0x0,_0x4741ac=events[_0x1a67('0x5')];_0x4a041d<_0x4741ac;_0x4a041d++){var _0xcdbf7d=events[_0x4a041d];var _0x1187b3=createListener(_0x1a67('0x6')+_0xcdbf7d,_0x4f232a);VoiceExtensionEvents['on'](_0xcdbf7d,_0x1187b3);}};
\ No newline at end of file
+var _0x2b46=['voiceExtension:','./voiceExtension.events','remove','update','emit','removeListener'];(function(_0x321021,_0x18cb40){var _0x22222f=function(_0x4644ee){while(--_0x4644ee){_0x321021['push'](_0x321021['shift']());}};_0x22222f(++_0x18cb40);}(_0x2b46,0x199));var _0x62b4=function(_0x3061f2,_0x11837b){_0x3061f2=_0x3061f2-0x0;var _0x2a7ba0=_0x2b46[_0x3061f2];return _0x2a7ba0;};'use strict';var VoiceExtensionEvents=require(_0x62b4('0x0'));var events=['save',_0x62b4('0x1'),_0x62b4('0x2')];function createListener(_0x297c65,_0x587411){return function(_0x3965a3){_0x587411[_0x62b4('0x3')](_0x297c65,_0x3965a3);};}function removeListener(_0x49bfa7,_0x2143c6){return function(){VoiceExtensionEvents[_0x62b4('0x4')](_0x49bfa7,_0x2143c6);};}exports['register']=function(_0x1dd294){for(var _0x3b4d43=0x0,_0x5aa803=events['length'];_0x3b4d43<_0x5aa803;_0x3b4d43++){var _0xf31571=events[_0x3b4d43];var _0x123408=createListener(_0x62b4('0x5')+_0xf31571,_0x1dd294);VoiceExtensionEvents['on'](_0xf31571,_0x123408);}};
\ No newline at end of file
index 4363e55..3b4f2df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc77a=['get','index','isAuthenticated','show','post','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','./voiceMail.controller'];(function(_0x1086d0,_0x57cd8c){var _0x599bfb=function(_0x5a7601){while(--_0x5a7601){_0x1086d0['push'](_0x1086d0['shift']());}};_0x599bfb(++_0x57cd8c);}(_0xc77a,0x13d));var _0xac77=function(_0x3b0b07,_0xc927c6){_0x3b0b07=_0x3b0b07-0x0;var _0x198e38=_0xc77a[_0x3b0b07];return _0x198e38;};'use strict';var multer=require(_0xac77('0x0'));var util=require(_0xac77('0x1'));var path=require(_0xac77('0x2'));var timeout=require(_0xac77('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xac77('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac77('0x5'));router[_0xac77('0x6')]('/',auth['isAuthenticated'](),controller[_0xac77('0x7')]);router[_0xac77('0x6')]('/:id',auth[_0xac77('0x8')](),controller[_0xac77('0x9')]);router[_0xac77('0x6')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0xac77('0xa')]('/',auth[_0xac77('0x8')](),controller['create']);router[_0xac77('0xb')]('/:id',auth[_0xac77('0x8')](),controller[_0xac77('0xc')]);router[_0xac77('0xd')](_0xac77('0xe'),auth[_0xac77('0x8')](),controller[_0xac77('0xf')]);module[_0xac77('0x10')]=router;
\ No newline at end of file
+var _0xf853=['isAuthenticated','index','show','get','getMessages','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller'];(function(_0x5aaaeb,_0x3ae52c){var _0x3c6401=function(_0xcc0899){while(--_0xcc0899){_0x5aaaeb['push'](_0x5aaaeb['shift']());}};_0x3c6401(++_0x3ae52c);}(_0xf853,0x19c));var _0x3f85=function(_0x4f0c2b,_0x2c9d14){_0x4f0c2b=_0x4f0c2b-0x0;var _0x526436=_0xf853[_0x4f0c2b];return _0x526436;};'use strict';var multer=require('multer');var util=require(_0x3f85('0x0'));var path=require(_0x3f85('0x1'));var timeout=require(_0x3f85('0x2'));var express=require(_0x3f85('0x3'));var router=express[_0x3f85('0x4')]();var auth=require(_0x3f85('0x5'));var interaction=require(_0x3f85('0x6'));var config=require('../../config/environment');var controller=require(_0x3f85('0x7'));router['get']('/',auth[_0x3f85('0x8')](),controller[_0x3f85('0x9')]);router['get']('/:id',auth[_0x3f85('0x8')](),controller[_0x3f85('0xa')]);router[_0x3f85('0xb')]('/:id/messages',auth['isAuthenticated'](),controller[_0x3f85('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3f85('0xd')]);router[_0x3f85('0xe')](_0x3f85('0xf'),auth['isAuthenticated'](),controller[_0x3f85('0x10')]);router[_0x3f85('0x11')](_0x3f85('0xf'),auth[_0x3f85('0x8')](),controller[_0x3f85('0x12')]);module[_0x3f85('0x13')]=router;
\ No newline at end of file
index 74e39cf..dadb178 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2547=['central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','trim'];(function(_0x331e07,_0x5aa6db){var _0x5716d4=function(_0x173b19){while(--_0x173b19){_0x331e07['push'](_0x331e07['shift']());}};_0x5716d4(++_0x5aa6db);}(_0x2547,0x1cd));var _0x7254=function(_0x36936c,_0x30c739){_0x36936c=_0x36936c-0x0;var _0x13eedb=_0x2547[_0x36936c];return _0x13eedb;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'customer_id':{'type':Sequelize[_0x7254('0x1')]},'context':{'type':Sequelize[_0x7254('0x1')],'defaultValue':_0x7254('0x2'),'unique':_0x7254('0x3')},'mailbox':{'type':Sequelize[_0x7254('0x1')],'defaultValue':'','allowNull':![],'unique':_0x7254('0x3')},'password':{'type':Sequelize[_0x7254('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7254('0x1')],'validate':{'isEmail':!![]},'set':function(_0x59705f){this[_0x7254('0x4')](_0x7254('0x5'),typeof _0x59705f==='string'&&_0x59705f[_0x7254('0x6')]()?_0x59705f[_0x7254('0x6')]():null);}},'pager':{'type':Sequelize[_0x7254('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x7254('0x7')},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x7254('0x8')](_0x7254('0x9'),'no'),'defaultValue':_0x7254('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7254('0x1')]},'callback':{'type':Sequelize[_0x7254('0x1')]},'review':{'type':Sequelize[_0x7254('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7254('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7254('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7254('0x8')](_0x7254('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7254('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7254('0x8')](_0x7254('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7254('0x8')](_0x7254('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7254('0x8')](_0x7254('0x9'),'no'),'defaultValue':_0x7254('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7254('0x8')](_0x7254('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7254('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7254('0x8')](_0x7254('0x9'),'no'),'defaultValue':_0x7254('0x9'),'allowNull':![]},'stamp':{'type':_0x7254('0xb')},'emailsubject':{'type':Sequelize[_0x7254('0x1')]},'emailbody':{'type':Sequelize[_0x7254('0x1')]},'maxsecs':{'type':Sequelize[_0x7254('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7254('0xd')],'get':function(){return this[_0x7254('0xe')](_0x7254('0xf'))+_0x7254('0x10')+this[_0x7254('0xe')](_0x7254('0x11'));}}};
\ No newline at end of file
+var _0x4cf8=['mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue'];(function(_0x3841de,_0x559542){var _0x5f3bd8=function(_0x5a2dca){while(--_0x5a2dca){_0x3841de['push'](_0x3841de['shift']());}};_0x5f3bd8(++_0x559542);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x4cf8[_0x411017];return _0x2adeea;};'use strict';var Sequelize=require(_0x84cf('0x0'));module[_0x84cf('0x1')]={'customer_id':{'type':Sequelize[_0x84cf('0x2')]},'context':{'type':Sequelize[_0x84cf('0x2')],'defaultValue':_0x84cf('0x3'),'unique':_0x84cf('0x4')},'mailbox':{'type':Sequelize[_0x84cf('0x2')],'defaultValue':'','allowNull':![],'unique':_0x84cf('0x4')},'password':{'type':Sequelize[_0x84cf('0x2')]},'fullname':{'type':Sequelize[_0x84cf('0x2')]},'email':{'type':Sequelize[_0x84cf('0x2')],'validate':{'isEmail':!![]},'set':function(_0x2c613d){this['setDataValue']('email',typeof _0x2c613d===_0x84cf('0x5')&&_0x2c613d['trim']()?_0x2c613d[_0x84cf('0x6')]():null);}},'pager':{'type':Sequelize[_0x84cf('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x84cf('0x7')},'attach':{'type':Sequelize[_0x84cf('0x8')]('yes','no'),'defaultValue':_0x84cf('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':_0x84cf('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x84cf('0x2')]},'review':{'type':Sequelize[_0x84cf('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x84cf('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':_0x84cf('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x84cf('0x8')](_0x84cf('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x84cf('0xb')},'emailsubject':{'type':Sequelize[_0x84cf('0x2')]},'emailbody':{'type':Sequelize[_0x84cf('0x2')]},'maxsecs':{'type':Sequelize[_0x84cf('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x84cf('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x84cf('0xd')],'get':function(){return this[_0x84cf('0xe')]('fullname')+'\x20-\x20'+this[_0x84cf('0xe')](_0x84cf('0xf'));}}};
\ No newline at end of file
index 66248a3..f66d736 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a57=['VoiceMail','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','limit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','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','params','getMessages','findOne','VoiceMailMessage','length','nolimit','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','then','destroy','Voicemails','UserProfileResource','error','name','send','index','map'];(function(_0x731b4f,_0x2e62fd){var _0xc85634=function(_0x1dfba4){while(--_0x1dfba4){_0x731b4f['push'](_0x731b4f['shift']());}};_0xc85634(++_0x2e62fd);}(_0x6a57,0xd5));var _0x76a5=function(_0x5b22e5,_0x50a727){_0x5b22e5=_0x5b22e5-0x0;var _0x50aa89=_0x6a57[_0x5b22e5];return _0x50aa89;};'use strict';var pdf=require(_0x76a5('0x0'));var emlformat=require(_0x76a5('0x1'));var rimraf=require(_0x76a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76a5('0x3'));var rp=require(_0x76a5('0x4'));var moment=require('moment');var BPromise=require(_0x76a5('0x5'));var Mustache=require(_0x76a5('0x6'));var util=require('util');var path=require(_0x76a5('0x7'));var sox=require(_0x76a5('0x8'));var csv=require('to-csv');var ejs=require(_0x76a5('0x9'));var fs=require('fs');var _=require(_0x76a5('0xa'));var squel=require('squel');var crypto=require(_0x76a5('0xb'));var jsforce=require(_0x76a5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x76a5('0xd'));var querystring=require(_0x76a5('0xe'));var Papa=require(_0x76a5('0xf'));var Redis=require(_0x76a5('0x10'));var authService=require(_0x76a5('0x11'));var qs=require(_0x76a5('0x12'));var as=require(_0x76a5('0x13'));var hardwareService=require(_0x76a5('0x14'));var logger=require(_0x76a5('0x15'))(_0x76a5('0x16'));var utils=require(_0x76a5('0x17'));var config=require(_0x76a5('0x18'));var db=require(_0x76a5('0x19'))['db'];function respondWithStatusCode(_0x2fdac2,_0x1766e0){_0x1766e0=_0x1766e0||0xcc;return function(_0x431574){if(_0x431574){return _0x2fdac2[_0x76a5('0x1a')](_0x1766e0);}return _0x2fdac2['status'](_0x1766e0)[_0x76a5('0x1b')]();};}function respondWithResult(_0x5680ed,_0x2477a1){_0x2477a1=_0x2477a1||0xc8;return function(_0x3766b6){if(_0x3766b6){return _0x5680ed[_0x76a5('0x1c')](_0x2477a1)[_0x76a5('0x1d')](_0x3766b6);}};}function respondWithFilteredResult(_0x131f4f,_0x390a94){return function(_0x7a2224){if(_0x7a2224){var _0x1bdf82=_0x7a2224[_0x76a5('0x1e')],_0x7e07b1=_0x390a94[_0x76a5('0x1f')],_0x513067=_0x390a94[_0x76a5('0x1f')]+_0x390a94['limit'],_0x3215f3;if(_0x513067>=_0x1bdf82){_0x513067=_0x1bdf82;_0x3215f3=0xc8;}else{_0x3215f3=0xce;}_0x131f4f[_0x76a5('0x1c')](_0x3215f3);return _0x131f4f['set'](_0x76a5('0x20'),_0x7e07b1+'-'+_0x513067+'/'+_0x1bdf82)[_0x76a5('0x1d')](_0x7a2224);}return null;};}function patchUpdates(_0x2d5fc3){return function(_0x79ae17){try{jsonpatch[_0x76a5('0x21')](_0x79ae17,_0x2d5fc3,!![]);}catch(_0xd04d1a){return BPromise[_0x76a5('0x22')](_0xd04d1a);}return _0x79ae17[_0x76a5('0x23')]();};}function saveUpdates(_0x1249c2,_0x1ea5e7){return function(_0x448502){if(_0x448502){return _0x448502['update'](_0x1249c2)[_0x76a5('0x24')](function(_0x382f28){return _0x382f28;});}return null;};}function removeEntity(_0x83c963,_0x6eb456){return function(_0x2edece){if(_0x2edece){return _0x2edece[_0x76a5('0x25')]()[_0x76a5('0x24')](function(){var _0x4ac451=_0x2edece['get']({'plain':!![]});var _0x233145=_0x76a5('0x26');return db[_0x76a5('0x27')][_0x76a5('0x25')]({'where':{'type':_0x233145,'resourceId':_0x4ac451['id']}})['then'](function(){return _0x2edece;});})[_0x76a5('0x24')](function(){_0x83c963['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ee4b0,_0x1aba38){return function(_0x3e79e2){if(!_0x3e79e2){_0x2ee4b0[_0x76a5('0x1a')](0x194);}return _0x3e79e2;};}function handleError(_0x18579d,_0x1a126a){_0x1a126a=_0x1a126a||0x1f4;return function(_0x40501e){logger[_0x76a5('0x28')](_0x40501e['stack']);if(_0x40501e[_0x76a5('0x29')]){delete _0x40501e['name'];}_0x18579d[_0x76a5('0x1c')](_0x1a126a)[_0x76a5('0x2a')](_0x40501e);};}exports[_0x76a5('0x2b')]=function(_0x3bf293,_0x47661d){var _0x18cf2b={},_0x274825={},_0x300b6={'count':0x0,'rows':[]};var _0x60e2f6=_[_0x76a5('0x2c')](db[_0x76a5('0x2d')][_0x76a5('0x2e')],function(_0x1dfbe3){return{'name':_0x1dfbe3[_0x76a5('0x2f')],'type':_0x1dfbe3[_0x76a5('0x30')][_0x76a5('0x31')]};});_0x274825['model']=_[_0x76a5('0x2c')](_0x60e2f6,_0x76a5('0x29'));_0x274825[_0x76a5('0x32')]=_[_0x76a5('0x33')](_0x3bf293[_0x76a5('0x32')]);_0x274825[_0x76a5('0x34')]=_[_0x76a5('0x35')](_0x274825[_0x76a5('0x36')],_0x274825[_0x76a5('0x32')]);_0x18cf2b['attributes']=_[_0x76a5('0x35')](_0x274825[_0x76a5('0x36')],qs[_0x76a5('0x37')](_0x3bf293[_0x76a5('0x32')][_0x76a5('0x37')]));_0x18cf2b[_0x76a5('0x38')]=_0x18cf2b[_0x76a5('0x38')]['length']?_0x18cf2b['attributes']:_0x274825[_0x76a5('0x36')];if(!_0x3bf293[_0x76a5('0x32')][_0x76a5('0x39')]('nolimit')){_0x18cf2b[_0x76a5('0x3a')]=qs[_0x76a5('0x3a')](_0x3bf293[_0x76a5('0x32')][_0x76a5('0x3a')]);_0x18cf2b[_0x76a5('0x1f')]=qs[_0x76a5('0x1f')](_0x3bf293[_0x76a5('0x32')][_0x76a5('0x1f')]);}_0x18cf2b['order']=qs[_0x76a5('0x3b')](_0x3bf293[_0x76a5('0x32')]['sort']);_0x18cf2b[_0x76a5('0x3c')]=qs[_0x76a5('0x34')](_[_0x76a5('0x3d')](_0x3bf293[_0x76a5('0x32')],_0x274825[_0x76a5('0x34')]),_0x60e2f6);if(_0x3bf293[_0x76a5('0x32')]['filter']){_0x18cf2b[_0x76a5('0x3c')]=_[_0x76a5('0x3e')](_0x18cf2b[_0x76a5('0x3c')],{'$or':_['map'](_0x60e2f6,function(_0x264638){if(_0x264638['type']!==_0x76a5('0x3f')){var _0x23c1f0={};_0x23c1f0[_0x264638[_0x76a5('0x29')]]={'$like':'%'+_0x3bf293['query'][_0x76a5('0x40')]+'%'};return _0x23c1f0;}})});}_0x18cf2b=_[_0x76a5('0x3e')]({},_0x18cf2b,_0x3bf293[_0x76a5('0x41')]);var _0x35162f={'where':_0x18cf2b[_0x76a5('0x3c')]};return db['VoiceMail']['count'](_0x35162f)[_0x76a5('0x24')](function(_0xff6f60){_0x300b6['count']=_0xff6f60;if(_0x3bf293[_0x76a5('0x32')][_0x76a5('0x42')]){_0x18cf2b[_0x76a5('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x76a5('0x44')](_0x18cf2b);})[_0x76a5('0x24')](function(_0x37f5f9){_0x300b6['rows']=_0x37f5f9;return _0x300b6;})[_0x76a5('0x24')](respondWithFilteredResult(_0x47661d,_0x18cf2b))[_0x76a5('0x45')](handleError(_0x47661d,null));};exports['show']=function(_0x530531,_0x4a75f0){var _0x403e54={'raw':!![],'where':{'id':_0x530531['params']['id']}},_0x90ca59={};_0x90ca59[_0x76a5('0x36')]=_[_0x76a5('0x33')](db['VoiceMail'][_0x76a5('0x2e')]);_0x90ca59['query']=_[_0x76a5('0x33')](_0x530531[_0x76a5('0x32')]);_0x90ca59[_0x76a5('0x34')]=_[_0x76a5('0x35')](_0x90ca59[_0x76a5('0x36')],_0x90ca59['query']);_0x403e54['attributes']=_[_0x76a5('0x35')](_0x90ca59[_0x76a5('0x36')],qs[_0x76a5('0x37')](_0x530531[_0x76a5('0x32')][_0x76a5('0x37')]));_0x403e54[_0x76a5('0x38')]=_0x403e54[_0x76a5('0x38')]['length']?_0x403e54[_0x76a5('0x38')]:_0x90ca59[_0x76a5('0x36')];if(_0x530531[_0x76a5('0x32')][_0x76a5('0x42')]){_0x403e54['include']=[{'all':!![]}];}_0x403e54=_[_0x76a5('0x3e')]({},_0x403e54,_0x530531[_0x76a5('0x41')]);return db[_0x76a5('0x2d')][_0x76a5('0x46')](_0x403e54)[_0x76a5('0x24')](handleEntityNotFound(_0x4a75f0,null))[_0x76a5('0x24')](respondWithResult(_0x4a75f0,null))['catch'](handleError(_0x4a75f0,null));};exports[_0x76a5('0x47')]=function(_0x36ba14,_0xa079c1){return db[_0x76a5('0x2d')][_0x76a5('0x47')](_0x36ba14['body'],{})[_0x76a5('0x24')](function(_0x5a1cd5){var _0x5044e4=_0x36ba14[_0x76a5('0x48')]['get']({'plain':!![]});if(!_0x5044e4)throw new Error(_0x76a5('0x49'));if(_0x5044e4[_0x76a5('0x4a')]===_0x76a5('0x48')){var _0x3b3be4=_0x5a1cd5['get']({'plain':!![]});var _0x27cc65=_0x76a5('0x26');return db[_0x76a5('0x4b')][_0x76a5('0x46')]({'where':{'name':_0x27cc65,'userProfileId':_0x5044e4[_0x76a5('0x4c')]},'raw':!![]})[_0x76a5('0x24')](function(_0x395591){if(_0x395591&&_0x395591[_0x76a5('0x4d')]===0x0){return db[_0x76a5('0x27')][_0x76a5('0x47')]({'name':_0x3b3be4[_0x76a5('0x29')],'resourceId':_0x3b3be4['id'],'type':_0x395591[_0x76a5('0x29')],'sectionId':_0x395591['id']},{})[_0x76a5('0x24')](function(){return _0x5a1cd5;});}else{return _0x5a1cd5;}})[_0x76a5('0x45')](function(_0x50dcce){logger[_0x76a5('0x28')](_0x76a5('0x4e'),_0x50dcce);throw _0x50dcce;});}return _0x5a1cd5;})['then'](respondWithResult(_0xa079c1,0xc9))[_0x76a5('0x45')](handleError(_0xa079c1,null));};exports['update']=function(_0x42f06e,_0x3c05a4){if(_0x42f06e[_0x76a5('0x4f')]['id']){delete _0x42f06e[_0x76a5('0x4f')]['id'];}return db['VoiceMail'][_0x76a5('0x46')]({'where':{'id':_0x42f06e[_0x76a5('0x50')]['id']}})[_0x76a5('0x24')](handleEntityNotFound(_0x3c05a4,null))[_0x76a5('0x24')](saveUpdates(_0x42f06e['body'],null))['then'](respondWithResult(_0x3c05a4,null))[_0x76a5('0x45')](handleError(_0x3c05a4,null));};exports['destroy']=function(_0x4e2481,_0x232738){return db[_0x76a5('0x2d')][_0x76a5('0x46')]({'where':{'id':_0x4e2481['params']['id']}})[_0x76a5('0x24')](handleEntityNotFound(_0x232738,null))['then'](removeEntity(_0x232738,null))[_0x76a5('0x45')](handleError(_0x232738,null));};exports[_0x76a5('0x51')]=function(_0x33b52e,_0x59419f,_0x1361d2){return db[_0x76a5('0x2d')][_0x76a5('0x52')]({'where':{'id':_0x33b52e[_0x76a5('0x50')]['id']}})[_0x76a5('0x24')](handleEntityNotFound(_0x59419f,null))[_0x76a5('0x24')](function(_0x564fc2){var _0x507ff6;var _0x38d5c8={},_0x2a9333={};_0x2a9333[_0x76a5('0x36')]=_[_0x76a5('0x33')](db[_0x76a5('0x53')][_0x76a5('0x2e')]);_0x2a9333[_0x76a5('0x32')]=_[_0x76a5('0x33')](_0x33b52e[_0x76a5('0x32')]);_0x2a9333['filters']=_['intersection'](_0x2a9333['model'],_0x2a9333[_0x76a5('0x32')]);_0x38d5c8[_0x76a5('0x38')]=_[_0x76a5('0x35')](_0x2a9333[_0x76a5('0x36')],qs[_0x76a5('0x37')](_0x33b52e['query'][_0x76a5('0x37')]));_0x38d5c8[_0x76a5('0x38')]=_0x38d5c8['attributes'][_0x76a5('0x54')]?_0x38d5c8[_0x76a5('0x38')]:_0x2a9333[_0x76a5('0x36')];if(!_0x33b52e[_0x76a5('0x32')][_0x76a5('0x39')](_0x76a5('0x55'))){_0x38d5c8[_0x76a5('0x3a')]=qs[_0x76a5('0x3a')](_0x33b52e[_0x76a5('0x32')][_0x76a5('0x3a')]);_0x38d5c8['offset']=qs['offset'](_0x33b52e[_0x76a5('0x32')]['offset']);}_0x38d5c8['order']=qs[_0x76a5('0x3b')](_0x33b52e['query'][_0x76a5('0x3b')]);_0x38d5c8[_0x76a5('0x3c')]=qs[_0x76a5('0x34')](_[_0x76a5('0x3d')](_0x33b52e['query'],_0x2a9333[_0x76a5('0x34')]));if(_0x33b52e['query'][_0x76a5('0x40')]){_0x38d5c8['where']=_[_0x76a5('0x3e')](_0x38d5c8['where'],{'$or':_[_0x76a5('0x2c')](_0x38d5c8[_0x76a5('0x38')],function(_0x7d3fd7){var _0x5a7ff7={};_0x5a7ff7[_0x7d3fd7]={'$like':'%'+_0x33b52e[_0x76a5('0x32')][_0x76a5('0x40')]+'%'};return _0x5a7ff7;})});}_0x38d5c8[_0x76a5('0x3c')]=_[_0x76a5('0x3e')](_0x38d5c8[_0x76a5('0x3c')],{'mailboxuser':_0x564fc2['mailbox']});_0x38d5c8=_['merge']({},_0x38d5c8,_0x33b52e[_0x76a5('0x41')]);return db[_0x76a5('0x53')]['findAndCountAll'](_0x38d5c8)[_0x76a5('0x24')](respondWithFilteredResult(_0x59419f,_0x38d5c8));})[_0x76a5('0x45')](handleError(_0x59419f,null));};
\ No newline at end of file
+var _0x9bd4=['fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','params','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','update','getMessages','findOne','hasOwnProperty','pick','mailbox','VoiceMailMessage','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','save','then','destroy','get','Voicemails','UserProfileResource','error','name','index','map','VoiceMail','rawAttributes'];(function(_0x5ab43c,_0xfa83ac){var _0x3b8f13=function(_0x10e59a){while(--_0x10e59a){_0x5ab43c['push'](_0x5ab43c['shift']());}};_0x3b8f13(++_0xfa83ac);}(_0x9bd4,0x1d0));var _0x49bd=function(_0x245ea9,_0x213f0f){_0x245ea9=_0x245ea9-0x0;var _0x407dbe=_0x9bd4[_0x245ea9];return _0x407dbe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x49bd('0x0'));var rimraf=require(_0x49bd('0x1'));var zipdir=require(_0x49bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x49bd('0x3'));var Mustache=require(_0x49bd('0x4'));var util=require(_0x49bd('0x5'));var path=require(_0x49bd('0x6'));var sox=require(_0x49bd('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x49bd('0x8'));var squel=require(_0x49bd('0x9'));var crypto=require(_0x49bd('0xa'));var jsforce=require(_0x49bd('0xb'));var deskjs=require(_0x49bd('0xc'));var toCsv=require(_0x49bd('0xd'));var querystring=require(_0x49bd('0xe'));var Papa=require(_0x49bd('0xf'));var Redis=require(_0x49bd('0x10'));var authService=require(_0x49bd('0x11'));var qs=require(_0x49bd('0x12'));var as=require(_0x49bd('0x13'));var hardwareService=require(_0x49bd('0x14'));var logger=require(_0x49bd('0x15'))(_0x49bd('0x16'));var utils=require('../../config/utils');var config=require(_0x49bd('0x17'));var db=require(_0x49bd('0x18'))['db'];function respondWithStatusCode(_0x152237,_0x348f9c){_0x348f9c=_0x348f9c||0xcc;return function(_0x11bee0){if(_0x11bee0){return _0x152237[_0x49bd('0x19')](_0x348f9c);}return _0x152237[_0x49bd('0x1a')](_0x348f9c)[_0x49bd('0x1b')]();};}function respondWithResult(_0x59edb6,_0x31b727){_0x31b727=_0x31b727||0xc8;return function(_0x4b1d37){if(_0x4b1d37){return _0x59edb6['status'](_0x31b727)['json'](_0x4b1d37);}};}function respondWithFilteredResult(_0x3c74df,_0x58e593){return function(_0x37d60c){if(_0x37d60c){var _0x4d4401=_0x37d60c[_0x49bd('0x1c')],_0x453b95=_0x58e593['offset'],_0x509908=_0x58e593[_0x49bd('0x1d')]+_0x58e593[_0x49bd('0x1e')],_0x3364ba;if(_0x509908>=_0x4d4401){_0x509908=_0x4d4401;_0x3364ba=0xc8;}else{_0x3364ba=0xce;}_0x3c74df[_0x49bd('0x1a')](_0x3364ba);return _0x3c74df['set'](_0x49bd('0x1f'),_0x453b95+'-'+_0x509908+'/'+_0x4d4401)[_0x49bd('0x20')](_0x37d60c);}return null;};}function patchUpdates(_0x22f3c4){return function(_0x7c04e1){try{jsonpatch['apply'](_0x7c04e1,_0x22f3c4,!![]);}catch(_0x1b9b46){return BPromise[_0x49bd('0x21')](_0x1b9b46);}return _0x7c04e1[_0x49bd('0x22')]();};}function saveUpdates(_0x521286,_0x4482c0){return function(_0x2014ec){if(_0x2014ec){return _0x2014ec['update'](_0x521286)[_0x49bd('0x23')](function(_0x221f98){return _0x221f98;});}return null;};}function removeEntity(_0x431583,_0x360abd){return function(_0x3eb903){if(_0x3eb903){return _0x3eb903[_0x49bd('0x24')]()[_0x49bd('0x23')](function(){var _0x106823=_0x3eb903[_0x49bd('0x25')]({'plain':!![]});var _0x22a2ac=_0x49bd('0x26');return db[_0x49bd('0x27')][_0x49bd('0x24')]({'where':{'type':_0x22a2ac,'resourceId':_0x106823['id']}})[_0x49bd('0x23')](function(){return _0x3eb903;});})[_0x49bd('0x23')](function(){_0x431583[_0x49bd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa1319c,_0x304c33){return function(_0x56ed67){if(!_0x56ed67){_0xa1319c[_0x49bd('0x19')](0x194);}return _0x56ed67;};}function handleError(_0x12593f,_0x564461){_0x564461=_0x564461||0x1f4;return function(_0x43c5db){logger[_0x49bd('0x28')](_0x43c5db['stack']);if(_0x43c5db[_0x49bd('0x29')]){delete _0x43c5db[_0x49bd('0x29')];}_0x12593f['status'](_0x564461)['send'](_0x43c5db);};}exports[_0x49bd('0x2a')]=function(_0x421b96,_0x59ee96){var _0x155d13={},_0x394016={},_0x4b14c8={'count':0x0,'rows':[]};var _0x57d3e6=_[_0x49bd('0x2b')](db[_0x49bd('0x2c')][_0x49bd('0x2d')],function(_0x45b90f){return{'name':_0x45b90f[_0x49bd('0x2e')],'type':_0x45b90f['type'][_0x49bd('0x2f')]};});_0x394016[_0x49bd('0x30')]=_[_0x49bd('0x2b')](_0x57d3e6,_0x49bd('0x29'));_0x394016[_0x49bd('0x31')]=_[_0x49bd('0x32')](_0x421b96[_0x49bd('0x31')]);_0x394016[_0x49bd('0x33')]=_[_0x49bd('0x34')](_0x394016['model'],_0x394016[_0x49bd('0x31')]);_0x155d13['attributes']=_[_0x49bd('0x34')](_0x394016['model'],qs[_0x49bd('0x35')](_0x421b96['query'][_0x49bd('0x35')]));_0x155d13['attributes']=_0x155d13['attributes']['length']?_0x155d13[_0x49bd('0x36')]:_0x394016[_0x49bd('0x30')];if(!_0x421b96[_0x49bd('0x31')]['hasOwnProperty'](_0x49bd('0x37'))){_0x155d13['limit']=qs['limit'](_0x421b96[_0x49bd('0x31')][_0x49bd('0x1e')]);_0x155d13['offset']=qs[_0x49bd('0x1d')](_0x421b96[_0x49bd('0x31')]['offset']);}_0x155d13[_0x49bd('0x38')]=qs[_0x49bd('0x39')](_0x421b96[_0x49bd('0x31')][_0x49bd('0x39')]);_0x155d13[_0x49bd('0x3a')]=qs[_0x49bd('0x33')](_['pick'](_0x421b96['query'],_0x394016['filters']),_0x57d3e6);if(_0x421b96['query'][_0x49bd('0x3b')]){_0x155d13[_0x49bd('0x3a')]=_[_0x49bd('0x3c')](_0x155d13[_0x49bd('0x3a')],{'$or':_['map'](_0x57d3e6,function(_0x3b3091){if(_0x3b3091[_0x49bd('0x3d')]!=='VIRTUAL'){var _0x2d6390={};_0x2d6390[_0x3b3091[_0x49bd('0x29')]]={'$like':'%'+_0x421b96['query'][_0x49bd('0x3b')]+'%'};return _0x2d6390;}})});}_0x155d13=_['merge']({},_0x155d13,_0x421b96[_0x49bd('0x3e')]);var _0x4fa785={'where':_0x155d13[_0x49bd('0x3a')]};return db[_0x49bd('0x2c')][_0x49bd('0x1c')](_0x4fa785)[_0x49bd('0x23')](function(_0x38c9f7){_0x4b14c8[_0x49bd('0x1c')]=_0x38c9f7;if(_0x421b96['query'][_0x49bd('0x3f')]){_0x155d13[_0x49bd('0x40')]=[{'all':!![]}];}return db[_0x49bd('0x2c')][_0x49bd('0x41')](_0x155d13);})[_0x49bd('0x23')](function(_0x146d6f){_0x4b14c8[_0x49bd('0x42')]=_0x146d6f;return _0x4b14c8;})[_0x49bd('0x23')](respondWithFilteredResult(_0x59ee96,_0x155d13))['catch'](handleError(_0x59ee96,null));};exports['show']=function(_0x2f53a0,_0x19fcce){var _0x1bef2d={'raw':!![],'where':{'id':_0x2f53a0[_0x49bd('0x43')]['id']}},_0x523657={};_0x523657[_0x49bd('0x30')]=_['keys'](db[_0x49bd('0x2c')][_0x49bd('0x2d')]);_0x523657[_0x49bd('0x31')]=_[_0x49bd('0x32')](_0x2f53a0[_0x49bd('0x31')]);_0x523657[_0x49bd('0x33')]=_[_0x49bd('0x34')](_0x523657['model'],_0x523657['query']);_0x1bef2d[_0x49bd('0x36')]=_[_0x49bd('0x34')](_0x523657['model'],qs[_0x49bd('0x35')](_0x2f53a0[_0x49bd('0x31')][_0x49bd('0x35')]));_0x1bef2d[_0x49bd('0x36')]=_0x1bef2d['attributes'][_0x49bd('0x44')]?_0x1bef2d[_0x49bd('0x36')]:_0x523657['model'];if(_0x2f53a0[_0x49bd('0x31')]['includeAll']){_0x1bef2d['include']=[{'all':!![]}];}_0x1bef2d=_[_0x49bd('0x3c')]({},_0x1bef2d,_0x2f53a0['options']);return db[_0x49bd('0x2c')]['find'](_0x1bef2d)['then'](handleEntityNotFound(_0x19fcce,null))[_0x49bd('0x23')](respondWithResult(_0x19fcce,null))[_0x49bd('0x45')](handleError(_0x19fcce,null));};exports[_0x49bd('0x46')]=function(_0x508eaf,_0x389189){return db[_0x49bd('0x2c')][_0x49bd('0x46')](_0x508eaf[_0x49bd('0x47')],{})[_0x49bd('0x23')](function(_0x110d67){var _0xd4501e=_0x508eaf[_0x49bd('0x48')]['get']({'plain':!![]});if(!_0xd4501e)throw new Error(_0x49bd('0x49'));if(_0xd4501e[_0x49bd('0x4a')]===_0x49bd('0x48')){var _0x5759a0=_0x110d67[_0x49bd('0x25')]({'plain':!![]});var _0x4471b1=_0x49bd('0x26');return db['UserProfileSection'][_0x49bd('0x4b')]({'where':{'name':_0x4471b1,'userProfileId':_0xd4501e[_0x49bd('0x4c')]},'raw':!![]})[_0x49bd('0x23')](function(_0x349015){if(_0x349015&&_0x349015[_0x49bd('0x4d')]===0x0){return db[_0x49bd('0x27')][_0x49bd('0x46')]({'name':_0x5759a0[_0x49bd('0x29')],'resourceId':_0x5759a0['id'],'type':_0x349015['name'],'sectionId':_0x349015['id']},{})[_0x49bd('0x23')](function(){return _0x110d67;});}else{return _0x110d67;}})[_0x49bd('0x45')](function(_0x1b4d8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b4d8e);throw _0x1b4d8e;});}return _0x110d67;})[_0x49bd('0x23')](respondWithResult(_0x389189,0xc9))[_0x49bd('0x45')](handleError(_0x389189,null));};exports[_0x49bd('0x4e')]=function(_0xef5d98,_0x238e14){if(_0xef5d98[_0x49bd('0x47')]['id']){delete _0xef5d98[_0x49bd('0x47')]['id'];}return db[_0x49bd('0x2c')][_0x49bd('0x4b')]({'where':{'id':_0xef5d98[_0x49bd('0x43')]['id']}})[_0x49bd('0x23')](handleEntityNotFound(_0x238e14,null))[_0x49bd('0x23')](saveUpdates(_0xef5d98[_0x49bd('0x47')],null))['then'](respondWithResult(_0x238e14,null))[_0x49bd('0x45')](handleError(_0x238e14,null));};exports[_0x49bd('0x24')]=function(_0x33aedd,_0x585b54){return db[_0x49bd('0x2c')][_0x49bd('0x4b')]({'where':{'id':_0x33aedd['params']['id']}})[_0x49bd('0x23')](handleEntityNotFound(_0x585b54,null))['then'](removeEntity(_0x585b54,null))[_0x49bd('0x45')](handleError(_0x585b54,null));};exports[_0x49bd('0x4f')]=function(_0x36774d,_0x2ff8f3,_0x432237){return db['VoiceMail'][_0x49bd('0x50')]({'where':{'id':_0x36774d[_0x49bd('0x43')]['id']}})[_0x49bd('0x23')](handleEntityNotFound(_0x2ff8f3,null))[_0x49bd('0x23')](function(_0x273aaa){var _0x3d97e8;var _0x22e44e={},_0x31c8d6={};_0x31c8d6[_0x49bd('0x30')]=_[_0x49bd('0x32')](db['VoiceMailMessage'][_0x49bd('0x2d')]);_0x31c8d6[_0x49bd('0x31')]=_[_0x49bd('0x32')](_0x36774d[_0x49bd('0x31')]);_0x31c8d6[_0x49bd('0x33')]=_['intersection'](_0x31c8d6[_0x49bd('0x30')],_0x31c8d6[_0x49bd('0x31')]);_0x22e44e[_0x49bd('0x36')]=_[_0x49bd('0x34')](_0x31c8d6['model'],qs[_0x49bd('0x35')](_0x36774d[_0x49bd('0x31')][_0x49bd('0x35')]));_0x22e44e['attributes']=_0x22e44e[_0x49bd('0x36')]['length']?_0x22e44e['attributes']:_0x31c8d6[_0x49bd('0x30')];if(!_0x36774d['query'][_0x49bd('0x51')](_0x49bd('0x37'))){_0x22e44e[_0x49bd('0x1e')]=qs[_0x49bd('0x1e')](_0x36774d['query']['limit']);_0x22e44e['offset']=qs[_0x49bd('0x1d')](_0x36774d[_0x49bd('0x31')]['offset']);}_0x22e44e[_0x49bd('0x38')]=qs['sort'](_0x36774d['query'][_0x49bd('0x39')]);_0x22e44e[_0x49bd('0x3a')]=qs[_0x49bd('0x33')](_[_0x49bd('0x52')](_0x36774d['query'],_0x31c8d6['filters']));if(_0x36774d[_0x49bd('0x31')]['filter']){_0x22e44e[_0x49bd('0x3a')]=_[_0x49bd('0x3c')](_0x22e44e[_0x49bd('0x3a')],{'$or':_[_0x49bd('0x2b')](_0x22e44e[_0x49bd('0x36')],function(_0x80c398){var _0x384ec3={};_0x384ec3[_0x80c398]={'$like':'%'+_0x36774d[_0x49bd('0x31')][_0x49bd('0x3b')]+'%'};return _0x384ec3;})});}_0x22e44e[_0x49bd('0x3a')]=_['merge'](_0x22e44e[_0x49bd('0x3a')],{'mailboxuser':_0x273aaa[_0x49bd('0x53')]});_0x22e44e=_[_0x49bd('0x3c')]({},_0x22e44e,_0x36774d[_0x49bd('0x3e')]);return db[_0x49bd('0x54')]['findAndCountAll'](_0x22e44e)[_0x49bd('0x23')](respondWithFilteredResult(_0x2ff8f3,_0x22e44e));})['catch'](handleError(_0x2ff8f3,null));};
\ No newline at end of file
index 4e64796..36d5111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x969b=['mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','VoiceMail'];(function(_0x290e9b,_0x146711){var _0x588154=function(_0x92c358){while(--_0x92c358){_0x290e9b['push'](_0x290e9b['shift']());}};_0x588154(++_0x146711);}(_0x969b,0x1a7));var _0xb969=function(_0x1c0ca7,_0x96134a){_0x1c0ca7=_0x1c0ca7-0x0;var _0x527ef6=_0x969b[_0x1c0ca7];return _0x527ef6;};'use strict';var _=require(_0xb969('0x0'));var util=require(_0xb969('0x1'));var logger=require(_0xb969('0x2'))(_0xb969('0x3'));var moment=require(_0xb969('0x4'));var BPromise=require(_0xb969('0x5'));var rp=require(_0xb969('0x6'));var fs=require('fs');var path=require(_0xb969('0x7'));var rimraf=require(_0xb969('0x8'));var config=require(_0xb969('0x9'));var attributes=require(_0xb969('0xa'));module['exports']=function(_0x527c0e,_0x597aae){return _0x527c0e['define'](_0xb969('0xb'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xb969('0xc'),'fields':[_0xb969('0xd'),_0xb969('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x68f4=['mailbox','context','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context'];(function(_0x439065,_0x46f77f){var _0x489ee8=function(_0x11fdd7){while(--_0x11fdd7){_0x439065['push'](_0x439065['shift']());}};_0x489ee8(++_0x46f77f);}(_0x68f4,0x1de));var _0x468f=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x68f4[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x468f('0x0'))('api');var moment=require(_0x468f('0x1'));var BPromise=require(_0x468f('0x2'));var rp=require(_0x468f('0x3'));var fs=require('fs');var path=require(_0x468f('0x4'));var rimraf=require('rimraf');var config=require(_0x468f('0x5'));var attributes=require(_0x468f('0x6'));module[_0x468f('0x7')]=function(_0x25b839,_0x5f15f3){return _0x25b839[_0x468f('0x8')](_0x468f('0x9'),attributes,{'tableName':_0x468f('0xa'),'paranoid':![],'indexes':[{'name':_0x468f('0xb'),'fields':[_0x468f('0xc'),_0x468f('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 4bdf52c..893c784 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b2d=['message','catch','lodash','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x203225,_0xe97446){var _0x29c45a=function(_0x5bdd71){while(--_0x5bdd71){_0x203225['push'](_0x203225['shift']());}};_0x29c45a(++_0xe97446);}(_0x1b2d,0x18e));var _0xd1b2=function(_0x36ad44,_0x390c18){_0x36ad44=_0x36ad44-0x0;var _0x5bb132=_0x1b2d[_0x36ad44];return _0x5bb132;};'use strict';var _=require(_0xd1b2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1b2('0x1'));var db=require(_0xd1b2('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd1b2('0x3'));var config=require(_0xd1b2('0x4'));var jayson=require(_0xd1b2('0x5'));var client=jayson[_0xd1b2('0x6')][_0xd1b2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x6c78ce,_0x462f98,_0x1e61b8){return new BPromise(function(_0x41bb21,_0x337b34){return client[_0xd1b2('0x8')](_0x6c78ce,_0x1e61b8)[_0xd1b2('0x9')](function(_0x4a3aed){logger[_0xd1b2('0xa')](_0xd1b2('0xb'),_0x462f98,'request\x20sent');logger['debug'](_0xd1b2('0xc'),_0x462f98,_0xd1b2('0xd'),JSON[_0xd1b2('0xe')](_0x4a3aed));if(_0x4a3aed['error']){if(_0x4a3aed['error']['code']===0x1f4){logger['error'](_0xd1b2('0xb'),_0x462f98,_0x4a3aed[_0xd1b2('0xf')][_0xd1b2('0x10')]);return _0x337b34(_0x4a3aed[_0xd1b2('0xf')]['message']);}logger[_0xd1b2('0xf')]('VoiceMail,\x20%s,\x20%s',_0x462f98,_0x4a3aed[_0xd1b2('0xf')][_0xd1b2('0x10')]);return _0x41bb21(_0x4a3aed[_0xd1b2('0xf')]['message']);}else{logger[_0xd1b2('0xa')](_0xd1b2('0xb'),_0x462f98,_0xd1b2('0xd'));_0x41bb21(_0x4a3aed['result'][_0xd1b2('0x10')]);}})[_0xd1b2('0x11')](function(_0x27f07f){logger[_0xd1b2('0xf')](_0xd1b2('0xb'),_0x462f98,_0x27f07f);_0x337b34(_0x27f07f);});});}
\ No newline at end of file
+var _0x09b9=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','result'];(function(_0xe30cce,_0x50db7d){var _0x495fd5=function(_0x726fbf){while(--_0x726fbf){_0xe30cce['push'](_0xe30cce['shift']());}};_0x495fd5(++_0x50db7d);}(_0x09b9,0x171));var _0x909b=function(_0x2ab1a7,_0x3bf265){_0x2ab1a7=_0x2ab1a7-0x0;var _0x4934e3=_0x09b9[_0x2ab1a7];return _0x4934e3;};'use strict';var _=require(_0x909b('0x0'));var util=require(_0x909b('0x1'));var moment=require(_0x909b('0x2'));var BPromise=require(_0x909b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x909b('0x4'));var db=require(_0x909b('0x5'))['db'];var utils=require(_0x909b('0x6'));var logger=require(_0x909b('0x7'))(_0x909b('0x8'));var config=require('../../config/environment');var jayson=require(_0x909b('0x9'));var client=jayson[_0x909b('0xa')][_0x909b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9c1d02,_0x27e931,_0x3b9296){return new BPromise(function(_0x19afe9,_0x5b1fba){return client[_0x909b('0xc')](_0x9c1d02,_0x3b9296)['then'](function(_0x1056d3){logger[_0x909b('0xd')]('VoiceMail,\x20%s,\x20%s',_0x27e931,_0x909b('0xe'));logger[_0x909b('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x27e931,_0x909b('0xe'),JSON[_0x909b('0x10')](_0x1056d3));if(_0x1056d3[_0x909b('0x11')]){if(_0x1056d3[_0x909b('0x11')][_0x909b('0x12')]===0x1f4){logger[_0x909b('0x11')]('VoiceMail,\x20%s,\x20%s',_0x27e931,_0x1056d3['error'][_0x909b('0x13')]);return _0x5b1fba(_0x1056d3['error'][_0x909b('0x13')]);}logger[_0x909b('0x11')](_0x909b('0x14'),_0x27e931,_0x1056d3[_0x909b('0x11')]['message']);return _0x19afe9(_0x1056d3[_0x909b('0x11')][_0x909b('0x13')]);}else{logger['info'](_0x909b('0x14'),_0x27e931,_0x909b('0xe'));_0x19afe9(_0x1056d3[_0x909b('0x15')][_0x909b('0x13')]);}})[_0x909b('0x16')](function(_0x1a9efa){logger[_0x909b('0x11')](_0x909b('0x14'),_0x27e931,_0x1a9efa);_0x5b1fba(_0x1a9efa);});});}
\ No newline at end of file
index 6ff81bd..2f84c47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x157162,_0xe1327a){var _0x2cd4ce=function(_0x3afe9c){while(--_0x3afe9c){_0x157162['push'](_0x157162['shift']());}};_0x2cd4ce(++_0xe1327a);}(_0x4975,0x86));var _0x5497=function(_0x46ad4f,_0x3ea9f1){_0x46ad4f=_0x46ad4f-0x0;var _0x5dafe0=_0x4975[_0x46ad4f];return _0x5dafe0;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var auth=require(_0x5497('0x5'));var interaction=require(_0x5497('0x6'));var config=require(_0x5497('0x7'));var controller=require(_0x5497('0x8'));router[_0x5497('0x9')]('/',auth[_0x5497('0xa')](),controller['index']);router[_0x5497('0x9')]('/:id',auth[_0x5497('0xa')](),controller[_0x5497('0xb')]);router[_0x5497('0x9')]('/:id/download',auth[_0x5497('0xa')](),controller['download']);router[_0x5497('0xc')]('/',auth[_0x5497('0xa')](),controller[_0x5497('0xd')]);router[_0x5497('0xe')](_0x5497('0xf'),auth[_0x5497('0xa')](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5497('0x12')]=router;
\ No newline at end of file
+var _0x4819=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','isAuthenticated','show','/:id/download','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x3cc90b,_0x1b69d9){var _0x34051b=function(_0x1f01f7){while(--_0x1f01f7){_0x3cc90b['push'](_0x3cc90b['shift']());}};_0x34051b(++_0x1b69d9);}(_0x4819,0xcd));var _0x9481=function(_0x5b0bc8,_0x3f86b0){_0x5b0bc8=_0x5b0bc8-0x0;var _0x1626a5=_0x4819[_0x5b0bc8];return _0x1626a5;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var auth=require(_0x9481('0x5'));var interaction=require(_0x9481('0x6'));var config=require(_0x9481('0x7'));var controller=require(_0x9481('0x8'));router[_0x9481('0x9')]('/',auth['isAuthenticated'](),controller[_0x9481('0xa')]);router['get']('/:id',auth[_0x9481('0xb')](),controller[_0x9481('0xc')]);router[_0x9481('0x9')](_0x9481('0xd'),auth[_0x9481('0xb')](),controller['download']);router[_0x9481('0xe')]('/',auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['put'](_0x9481('0x10'),auth[_0x9481('0xb')](),controller[_0x9481('0x11')]);router[_0x9481('0x12')](_0x9481('0x10'),auth[_0x9481('0xb')](),controller[_0x9481('0x13')]);module[_0x9481('0x14')]=router;
\ No newline at end of file
index d57e191..34359bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8723=['VIRTUAL','INTEGER','STRING','BLOB','long','TIMESTAMP','sequelize','exports'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x8723,0x11e));var _0x3872=function(_0x512911,_0x47ca9c){_0x512911=_0x512911-0x0;var _0x54d25d=_0x8723[_0x512911];return _0x54d25d;};'use strict';var Sequelize=require(_0x3872('0x0'));module[_0x3872('0x1')]={'name':{'type':Sequelize[_0x3872('0x2')],'get':function(_0x4484c1){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x3872('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3872('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x3872('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x3872('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x3872('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3872('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x3872('0x5')](_0x3872('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x3872('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3872('0x4')],'defaultValue':''},'stamp':{'type':_0x3872('0x7'),'allowNull':![]}};
\ No newline at end of file
+var _0x2db6=['VIRTUAL','getDataValue','STRING','BLOB','long','sequelize'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x2db6,0xa1));var _0x62db=function(_0x238827,_0x3f265d){_0x238827=_0x238827-0x0;var _0x2f3eda=_0x2db6[_0x238827];return _0x2f3eda;};'use strict';var Sequelize=require(_0x62db('0x0'));module['exports']={'name':{'type':Sequelize[_0x62db('0x1')],'get':function(_0x588609){return this[_0x62db('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x62db('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x62db('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x62db('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x62db('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x62db('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x62db('0x4')](_0x62db('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x62db('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}};
\ No newline at end of file
index 125aa43..514ce04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bb5=['html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','index','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','where','pick','filter','merge','VIRTUAL','count','then','includeAll','include','findAll','catch','show','params','options','find','create','body','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','send'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0bb5,0x148));var _0x50bb=function(_0x1917a4,_0x27d521){_0x1917a4=_0x1917a4-0x0;var _0xa05d84=_0x0bb5[_0x1917a4];return _0xa05d84;};'use strict';var pdf=require(_0x50bb('0x0'));var emlformat=require(_0x50bb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x50bb('0x2'));var rp=require(_0x50bb('0x3'));var moment=require(_0x50bb('0x4'));var BPromise=require(_0x50bb('0x5'));var Mustache=require(_0x50bb('0x6'));var util=require(_0x50bb('0x7'));var path=require(_0x50bb('0x8'));var sox=require(_0x50bb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var db=require(_0x50bb('0x18'))['db'];function respondWithStatusCode(_0x4d7e3d,_0x226370){_0x226370=_0x226370||0xcc;return function(_0x58837d){if(_0x58837d){return _0x4d7e3d[_0x50bb('0x19')](_0x226370);}return _0x4d7e3d[_0x50bb('0x1a')](_0x226370)[_0x50bb('0x1b')]();};}function respondWithResult(_0x502250,_0x17007f){_0x17007f=_0x17007f||0xc8;return function(_0x309986){if(_0x309986){return _0x502250[_0x50bb('0x1a')](_0x17007f)['json'](_0x309986);}};}function respondWithFilteredResult(_0xbbc6a0,_0x5e8478){return function(_0x21befa){if(_0x21befa){var _0x3e1a51=_0x21befa['count'],_0x253073=_0x5e8478[_0x50bb('0x1c')],_0x42ffab=_0x5e8478[_0x50bb('0x1c')]+_0x5e8478['limit'],_0x908950;if(_0x42ffab>=_0x3e1a51){_0x42ffab=_0x3e1a51;_0x908950=0xc8;}else{_0x908950=0xce;}_0xbbc6a0[_0x50bb('0x1a')](_0x908950);return _0xbbc6a0['set'](_0x50bb('0x1d'),_0x253073+'-'+_0x42ffab+'/'+_0x3e1a51)[_0x50bb('0x1e')](_0x21befa);}return null;};}function patchUpdates(_0x4b06f5){return function(_0x4f1c0a){try{jsonpatch[_0x50bb('0x1f')](_0x4f1c0a,_0x4b06f5,!![]);}catch(_0x1499dc){return BPromise[_0x50bb('0x20')](_0x1499dc);}return _0x4f1c0a[_0x50bb('0x21')]();};}function saveUpdates(_0x56b25a,_0x19dc5d){return function(_0x32bfc3){if(_0x32bfc3){return _0x32bfc3[_0x50bb('0x22')](_0x56b25a)['then'](function(_0x3104c8){return _0x3104c8;});}return null;};}function removeEntity(_0x879fea,_0x1344ec){return function(_0x4825f8){if(_0x4825f8){return _0x4825f8[_0x50bb('0x23')]()['then'](function(){_0x879fea[_0x50bb('0x1a')](0xcc)[_0x50bb('0x1b')]();});}};}function handleEntityNotFound(_0x1a2a0b,_0x2ee87a){return function(_0x846311){if(!_0x846311){_0x1a2a0b[_0x50bb('0x19')](0x194);}return _0x846311;};}function handleError(_0x4f7f73,_0xad17ac){_0xad17ac=_0xad17ac||0x1f4;return function(_0xee0af0){logger[_0x50bb('0x24')](_0xee0af0[_0x50bb('0x25')]);if(_0xee0af0['name']){delete _0xee0af0[_0x50bb('0x26')];}_0x4f7f73['status'](_0xad17ac)['send'](_0xee0af0);};}exports[_0x50bb('0x27')]=function(_0x491632,_0x5cfe4b){var _0x41fd89={},_0x12ee2c={},_0x3004a3={'count':0x0,'rows':[]};var _0x1b74f9=_[_0x50bb('0x28')](db[_0x50bb('0x29')][_0x50bb('0x2a')],function(_0x41d479){return{'name':_0x41d479['fieldName'],'type':_0x41d479[_0x50bb('0x2b')][_0x50bb('0x2c')]};});_0x12ee2c[_0x50bb('0x2d')]=_[_0x50bb('0x2e')](_['map'](_0x1b74f9,_0x50bb('0x26')),[_0x50bb('0x26')]);_0x12ee2c[_0x50bb('0x2f')]=_[_0x50bb('0x30')](_0x491632[_0x50bb('0x2f')]);_0x12ee2c[_0x50bb('0x31')]=_[_0x50bb('0x32')](_0x12ee2c[_0x50bb('0x2d')],_0x12ee2c[_0x50bb('0x2f')]);_0x41fd89[_0x50bb('0x33')]=_[_0x50bb('0x32')](_0x12ee2c[_0x50bb('0x2d')],qs['fields'](_0x491632[_0x50bb('0x2f')][_0x50bb('0x34')]));_0x41fd89[_0x50bb('0x33')]=_0x41fd89[_0x50bb('0x33')][_0x50bb('0x35')]?_0x41fd89[_0x50bb('0x33')]:_0x12ee2c[_0x50bb('0x2d')];if(!_0x491632[_0x50bb('0x2f')][_0x50bb('0x36')](_0x50bb('0x37'))){_0x41fd89[_0x50bb('0x38')]=qs['limit'](_0x491632[_0x50bb('0x2f')][_0x50bb('0x38')]);_0x41fd89[_0x50bb('0x1c')]=qs[_0x50bb('0x1c')](_0x491632[_0x50bb('0x2f')][_0x50bb('0x1c')]);}_0x41fd89['order']=qs['sort'](_0x491632[_0x50bb('0x2f')]['sort']);_0x41fd89[_0x50bb('0x39')]=qs[_0x50bb('0x31')](_[_0x50bb('0x3a')](_0x491632[_0x50bb('0x2f')],_0x12ee2c[_0x50bb('0x31')]),_0x1b74f9);if(_0x491632['query'][_0x50bb('0x3b')]){_0x41fd89['where']=_[_0x50bb('0x3c')](_0x41fd89[_0x50bb('0x39')],{'$or':_[_0x50bb('0x28')](_0x1b74f9,function(_0x4c29c9){if(_0x4c29c9['type']!==_0x50bb('0x3d')){var _0x2e904e={};_0x2e904e[_0x4c29c9[_0x50bb('0x26')]]={'$like':'%'+_0x491632[_0x50bb('0x2f')]['filter']+'%'};return _0x2e904e;}})});}_0x41fd89=_[_0x50bb('0x3c')]({},_0x41fd89,_0x491632['options']);var _0x52059b={'where':_0x41fd89[_0x50bb('0x39')]};return db['VoiceMailMessage'][_0x50bb('0x3e')](_0x52059b)[_0x50bb('0x3f')](function(_0x1ef231){_0x3004a3[_0x50bb('0x3e')]=_0x1ef231;if(_0x491632[_0x50bb('0x2f')][_0x50bb('0x40')]){_0x41fd89[_0x50bb('0x41')]=[{'all':!![]}];}return db[_0x50bb('0x29')][_0x50bb('0x42')](_0x41fd89);})[_0x50bb('0x3f')](function(_0x594f16){_0x3004a3['rows']=_0x594f16;return _0x3004a3;})[_0x50bb('0x3f')](respondWithFilteredResult(_0x5cfe4b,_0x41fd89))[_0x50bb('0x43')](handleError(_0x5cfe4b,null));};exports[_0x50bb('0x44')]=function(_0x1d929d,_0x5e8085){var _0x41243a={'raw':!![],'where':{'id':_0x1d929d[_0x50bb('0x45')]['id']}},_0x4d34f5={};_0x4d34f5[_0x50bb('0x2d')]=_[_0x50bb('0x30')](db[_0x50bb('0x29')][_0x50bb('0x2a')]);_0x4d34f5[_0x50bb('0x2f')]=_[_0x50bb('0x30')](_0x1d929d[_0x50bb('0x2f')]);_0x4d34f5[_0x50bb('0x31')]=_[_0x50bb('0x32')](_0x4d34f5[_0x50bb('0x2d')],_0x4d34f5[_0x50bb('0x2f')]);_0x41243a[_0x50bb('0x33')]=_[_0x50bb('0x32')](_0x4d34f5[_0x50bb('0x2d')],qs[_0x50bb('0x34')](_0x1d929d['query'][_0x50bb('0x34')]));_0x41243a['attributes']=_0x41243a[_0x50bb('0x33')][_0x50bb('0x35')]?_0x41243a[_0x50bb('0x33')]:_0x4d34f5[_0x50bb('0x2d')];if(_0x1d929d[_0x50bb('0x2f')][_0x50bb('0x40')]){_0x41243a[_0x50bb('0x41')]=[{'all':!![]}];}_0x41243a=_[_0x50bb('0x3c')]({},_0x41243a,_0x1d929d[_0x50bb('0x46')]);return db[_0x50bb('0x29')][_0x50bb('0x47')](_0x41243a)[_0x50bb('0x3f')](handleEntityNotFound(_0x5e8085,null))[_0x50bb('0x3f')](respondWithResult(_0x5e8085,null))[_0x50bb('0x43')](handleError(_0x5e8085,null));};exports['create']=function(_0x3eb429,_0x4e545f){return db[_0x50bb('0x29')][_0x50bb('0x48')](_0x3eb429[_0x50bb('0x49')],{})[_0x50bb('0x3f')](respondWithResult(_0x4e545f,0xc9))[_0x50bb('0x43')](handleError(_0x4e545f,null));};exports[_0x50bb('0x22')]=function(_0x133dd9,_0x358b3a){if(_0x133dd9['body']['id']){delete _0x133dd9[_0x50bb('0x49')]['id'];}return db[_0x50bb('0x29')][_0x50bb('0x47')]({'where':{'id':_0x133dd9[_0x50bb('0x45')]['id']}})[_0x50bb('0x3f')](handleEntityNotFound(_0x358b3a,null))['then'](saveUpdates(_0x133dd9[_0x50bb('0x49')],null))[_0x50bb('0x3f')](respondWithResult(_0x358b3a,null))[_0x50bb('0x43')](handleError(_0x358b3a,null));};exports[_0x50bb('0x23')]=function(_0x77f534,_0x5e050f){return db['VoiceMailMessage'][_0x50bb('0x47')]({'where':{'id':_0x77f534['params']['id']}})[_0x50bb('0x3f')](handleEntityNotFound(_0x5e050f,null))['then'](removeEntity(_0x5e050f,null))[_0x50bb('0x43')](handleError(_0x5e050f,null));};exports[_0x50bb('0x4a')]=function(_0x186bfb,_0x4e67c1,_0x2ce0a9){return db[_0x50bb('0x29')]['find']({'where':{'id':_0x186bfb[_0x50bb('0x45')]['id']},'attributes':['id',_0x50bb('0x4b'),_0x50bb('0x4c')]})[_0x50bb('0x3f')](handleEntityNotFound(_0x4e67c1,null))['then'](function(_0x33e71f){if(_0x33e71f){if(!_0x33e71f[_0x50bb('0x4b')]){throw new db[(_0x50bb('0x4d'))][(_0x50bb('0x4e'))](_0x50bb('0x4f'));}var _0x5e61fe={'Content-Type':_0x50bb('0x50'),'Content-Disposition':'attachment'};if(_0x33e71f[_0x50bb('0x4c')]){_0x5e61fe['Content-Disposition']='attachment;\x20filename=\x22'+_0x33e71f[_0x50bb('0x4c')]+'.wav\x22';}_0x4e67c1['set'](_0x5e61fe);return _0x4e67c1[_0x50bb('0x51')](new Buffer(_0x33e71f[_0x50bb('0x4b')]));}})[_0x50bb('0x43')](handleError(_0x4e67c1,null));};
\ No newline at end of file
+var _0x263f=['fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','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','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','count','includeAll','findAll','catch','show','params','keys','include','find','create','update','body','download','recording','msg_id','Sequelize','ValidationError','.wav\x22','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x263f,0x182));var _0xf263=function(_0x4ffc42,_0x2facd6){_0x4ffc42=_0x4ffc42-0x0;var _0x5882f9=_0x263f[_0x4ffc42];return _0x5882f9;};'use strict';var pdf=require(_0xf263('0x0'));var emlformat=require(_0xf263('0x1'));var rimraf=require(_0xf263('0x2'));var zipdir=require(_0xf263('0x3'));var jsonpatch=require(_0xf263('0x4'));var rp=require(_0xf263('0x5'));var moment=require('moment');var BPromise=require(_0xf263('0x6'));var Mustache=require(_0xf263('0x7'));var util=require(_0xf263('0x8'));var path=require('path');var sox=require(_0xf263('0x9'));var csv=require(_0xf263('0xa'));var ejs=require('ejs');var fs=require('fs');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 db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e46a6,_0x2fc9f0){_0x2fc9f0=_0x2fc9f0||0xcc;return function(_0x2b1145){if(_0x2b1145){return _0x5e46a6[_0xf263('0x18')](_0x2fc9f0);}return _0x5e46a6[_0xf263('0x19')](_0x2fc9f0)[_0xf263('0x1a')]();};}function respondWithResult(_0xc6a733,_0xc75366){_0xc75366=_0xc75366||0xc8;return function(_0x559c6c){if(_0x559c6c){return _0xc6a733[_0xf263('0x19')](_0xc75366)['json'](_0x559c6c);}};}function respondWithFilteredResult(_0x2a79aa,_0x27b16a){return function(_0x3ac432){if(_0x3ac432){var _0x402739=_0x3ac432['count'],_0x16b4dd=_0x27b16a['offset'],_0xf45ebe=_0x27b16a[_0xf263('0x1b')]+_0x27b16a[_0xf263('0x1c')],_0x506789;if(_0xf45ebe>=_0x402739){_0xf45ebe=_0x402739;_0x506789=0xc8;}else{_0x506789=0xce;}_0x2a79aa[_0xf263('0x19')](_0x506789);return _0x2a79aa[_0xf263('0x1d')](_0xf263('0x1e'),_0x16b4dd+'-'+_0xf45ebe+'/'+_0x402739)['json'](_0x3ac432);}return null;};}function patchUpdates(_0x1adb66){return function(_0x523061){try{jsonpatch[_0xf263('0x1f')](_0x523061,_0x1adb66,!![]);}catch(_0x22e399){return BPromise[_0xf263('0x20')](_0x22e399);}return _0x523061['save']();};}function saveUpdates(_0x4c44ea,_0x169328){return function(_0x127135){if(_0x127135){return _0x127135['update'](_0x4c44ea)[_0xf263('0x21')](function(_0x4202d1){return _0x4202d1;});}return null;};}function removeEntity(_0x431c10,_0x426667){return function(_0xa0695){if(_0xa0695){return _0xa0695[_0xf263('0x22')]()[_0xf263('0x21')](function(){_0x431c10[_0xf263('0x19')](0xcc)[_0xf263('0x1a')]();});}};}function handleEntityNotFound(_0xe32b07,_0x29eb45){return function(_0x4de045){if(!_0x4de045){_0xe32b07['sendStatus'](0x194);}return _0x4de045;};}function handleError(_0x5dc48f,_0x2de7aa){_0x2de7aa=_0x2de7aa||0x1f4;return function(_0x4175a6){logger[_0xf263('0x23')](_0x4175a6[_0xf263('0x24')]);if(_0x4175a6[_0xf263('0x25')]){delete _0x4175a6[_0xf263('0x25')];}_0x5dc48f[_0xf263('0x19')](_0x2de7aa)[_0xf263('0x26')](_0x4175a6);};}exports[_0xf263('0x27')]=function(_0xbeabe5,_0x2411a2){var _0x5e9ba3={},_0x2046d9={},_0x4ea2c4={'count':0x0,'rows':[]};var _0x3f74ed=_['map'](db[_0xf263('0x28')][_0xf263('0x29')],function(_0x5a11bf){return{'name':_0x5a11bf['fieldName'],'type':_0x5a11bf[_0xf263('0x2a')][_0xf263('0x2b')]};});_0x2046d9[_0xf263('0x2c')]=_[_0xf263('0x2d')](_[_0xf263('0x2e')](_0x3f74ed,_0xf263('0x25')),[_0xf263('0x25')]);_0x2046d9[_0xf263('0x2f')]=_['keys'](_0xbeabe5[_0xf263('0x2f')]);_0x2046d9[_0xf263('0x30')]=_[_0xf263('0x31')](_0x2046d9[_0xf263('0x2c')],_0x2046d9[_0xf263('0x2f')]);_0x5e9ba3[_0xf263('0x32')]=_[_0xf263('0x31')](_0x2046d9[_0xf263('0x2c')],qs[_0xf263('0x33')](_0xbeabe5['query'][_0xf263('0x33')]));_0x5e9ba3['attributes']=_0x5e9ba3['attributes'][_0xf263('0x34')]?_0x5e9ba3[_0xf263('0x32')]:_0x2046d9['model'];if(!_0xbeabe5[_0xf263('0x2f')][_0xf263('0x35')]('nolimit')){_0x5e9ba3[_0xf263('0x1c')]=qs[_0xf263('0x1c')](_0xbeabe5[_0xf263('0x2f')][_0xf263('0x1c')]);_0x5e9ba3[_0xf263('0x1b')]=qs[_0xf263('0x1b')](_0xbeabe5['query'][_0xf263('0x1b')]);}_0x5e9ba3[_0xf263('0x36')]=qs['sort'](_0xbeabe5['query'][_0xf263('0x37')]);_0x5e9ba3[_0xf263('0x38')]=qs[_0xf263('0x30')](_[_0xf263('0x39')](_0xbeabe5['query'],_0x2046d9[_0xf263('0x30')]),_0x3f74ed);if(_0xbeabe5[_0xf263('0x2f')][_0xf263('0x3a')]){_0x5e9ba3[_0xf263('0x38')]=_[_0xf263('0x3b')](_0x5e9ba3['where'],{'$or':_[_0xf263('0x2e')](_0x3f74ed,function(_0x3a6834){if(_0x3a6834[_0xf263('0x2a')]!=='VIRTUAL'){var _0x1ece85={};_0x1ece85[_0x3a6834[_0xf263('0x25')]]={'$like':'%'+_0xbeabe5[_0xf263('0x2f')][_0xf263('0x3a')]+'%'};return _0x1ece85;}})});}_0x5e9ba3=_[_0xf263('0x3b')]({},_0x5e9ba3,_0xbeabe5['options']);var _0x288c61={'where':_0x5e9ba3[_0xf263('0x38')]};return db[_0xf263('0x28')]['count'](_0x288c61)[_0xf263('0x21')](function(_0x2d20a5){_0x4ea2c4[_0xf263('0x3c')]=_0x2d20a5;if(_0xbeabe5['query'][_0xf263('0x3d')]){_0x5e9ba3['include']=[{'all':!![]}];}return db[_0xf263('0x28')][_0xf263('0x3e')](_0x5e9ba3);})[_0xf263('0x21')](function(_0x56fa52){_0x4ea2c4['rows']=_0x56fa52;return _0x4ea2c4;})['then'](respondWithFilteredResult(_0x2411a2,_0x5e9ba3))[_0xf263('0x3f')](handleError(_0x2411a2,null));};exports[_0xf263('0x40')]=function(_0x56303f,_0x5e33ba){var _0x188faa={'raw':!![],'where':{'id':_0x56303f[_0xf263('0x41')]['id']}},_0x1e1dbf={};_0x1e1dbf[_0xf263('0x2c')]=_[_0xf263('0x42')](db['VoiceMailMessage'][_0xf263('0x29')]);_0x1e1dbf[_0xf263('0x2f')]=_[_0xf263('0x42')](_0x56303f[_0xf263('0x2f')]);_0x1e1dbf[_0xf263('0x30')]=_['intersection'](_0x1e1dbf[_0xf263('0x2c')],_0x1e1dbf[_0xf263('0x2f')]);_0x188faa[_0xf263('0x32')]=_['intersection'](_0x1e1dbf['model'],qs[_0xf263('0x33')](_0x56303f['query']['fields']));_0x188faa[_0xf263('0x32')]=_0x188faa[_0xf263('0x32')][_0xf263('0x34')]?_0x188faa['attributes']:_0x1e1dbf[_0xf263('0x2c')];if(_0x56303f[_0xf263('0x2f')]['includeAll']){_0x188faa[_0xf263('0x43')]=[{'all':!![]}];}_0x188faa=_[_0xf263('0x3b')]({},_0x188faa,_0x56303f['options']);return db[_0xf263('0x28')][_0xf263('0x44')](_0x188faa)['then'](handleEntityNotFound(_0x5e33ba,null))[_0xf263('0x21')](respondWithResult(_0x5e33ba,null))[_0xf263('0x3f')](handleError(_0x5e33ba,null));};exports[_0xf263('0x45')]=function(_0x175db0,_0x291f7f){return db[_0xf263('0x28')][_0xf263('0x45')](_0x175db0['body'],{})[_0xf263('0x21')](respondWithResult(_0x291f7f,0xc9))[_0xf263('0x3f')](handleError(_0x291f7f,null));};exports[_0xf263('0x46')]=function(_0x146a90,_0x1a312d){if(_0x146a90[_0xf263('0x47')]['id']){delete _0x146a90[_0xf263('0x47')]['id'];}return db[_0xf263('0x28')]['find']({'where':{'id':_0x146a90[_0xf263('0x41')]['id']}})[_0xf263('0x21')](handleEntityNotFound(_0x1a312d,null))[_0xf263('0x21')](saveUpdates(_0x146a90[_0xf263('0x47')],null))['then'](respondWithResult(_0x1a312d,null))[_0xf263('0x3f')](handleError(_0x1a312d,null));};exports['destroy']=function(_0x773a03,_0x159852){return db[_0xf263('0x28')]['find']({'where':{'id':_0x773a03['params']['id']}})['then'](handleEntityNotFound(_0x159852,null))['then'](removeEntity(_0x159852,null))['catch'](handleError(_0x159852,null));};exports[_0xf263('0x48')]=function(_0x4105f2,_0x4dad15,_0x27e15d){return db[_0xf263('0x28')][_0xf263('0x44')]({'where':{'id':_0x4105f2[_0xf263('0x41')]['id']},'attributes':['id',_0xf263('0x49'),_0xf263('0x4a')]})[_0xf263('0x21')](handleEntityNotFound(_0x4dad15,null))[_0xf263('0x21')](function(_0x34afc5){if(_0x34afc5){if(!_0x34afc5[_0xf263('0x49')]){throw new db[(_0xf263('0x4b'))][(_0xf263('0x4c'))]('VoiceMailMessage\x20not\x20found');}var _0x2d8e12={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x34afc5[_0xf263('0x4a')]){_0x2d8e12['Content-Disposition']='attachment;\x20filename=\x22'+_0x34afc5[_0xf263('0x4a')]+_0xf263('0x4d');}_0x4dad15['set'](_0x2d8e12);return _0x4dad15[_0xf263('0x26')](new Buffer(_0x34afc5['recording']));}})[_0xf263('0x3f')](handleError(_0x4dad15,null));};
\ No newline at end of file
index 99ed663..c0d6583 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b47=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','util'];(function(_0x355959,_0x586702){var _0x210e41=function(_0x2de19c){while(--_0x2de19c){_0x355959['push'](_0x355959['shift']());}};_0x210e41(++_0x586702);}(_0x6b47,0xe9));var _0x76b4=function(_0x1c101f,_0x52141d){_0x1c101f=_0x1c101f-0x0;var _0xe02ee4=_0x6b47[_0x1c101f];return _0xe02ee4;};'use strict';var _=require('lodash');var util=require(_0x76b4('0x0'));var logger=require('../../config/logger')(_0x76b4('0x1'));var moment=require(_0x76b4('0x2'));var BPromise=require(_0x76b4('0x3'));var rp=require(_0x76b4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76b4('0x5'));var config=require(_0x76b4('0x6'));var attributes=require(_0x76b4('0x7'));module[_0x76b4('0x8')]=function(_0x292e27,_0x49fc2a){return _0x292e27[_0x76b4('0x9')](_0x76b4('0xa'),attributes,{'tableName':_0x76b4('0xb'),'paranoid':![],'indexes':[{'name':_0x76b4('0xc'),'fields':[_0x76b4('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x6947=['exports','define','voice_voicemail_messages','dir','util','api','moment','bluebird','request-promise','../../config/environment','./voiceMailMessage.attributes'];(function(_0x1790c1,_0x35b48b){var _0x1adb23=function(_0x5df873){while(--_0x5df873){_0x1790c1['push'](_0x1790c1['shift']());}};_0x1adb23(++_0x35b48b);}(_0x6947,0x72));var _0x7694=function(_0x28d2f3,_0x430638){_0x28d2f3=_0x28d2f3-0x0;var _0x15c841=_0x6947[_0x28d2f3];return _0x15c841;};'use strict';var _=require('lodash');var util=require(_0x7694('0x0'));var logger=require('../../config/logger')(_0x7694('0x1'));var moment=require(_0x7694('0x2'));var BPromise=require(_0x7694('0x3'));var rp=require(_0x7694('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7694('0x5'));var attributes=require(_0x7694('0x6'));module[_0x7694('0x7')]=function(_0x5730,_0x36776b){return _0x5730[_0x7694('0x8')]('VoiceMailMessage',attributes,{'tableName':_0x7694('0x9'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x7694('0xa')]}],'timestamps':![]});};
\ No newline at end of file
index 80c7b09..67e8f9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['client','http','request','info','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x41c6c4,_0x5aab3d){var _0x569b9b=function(_0x5cdef8){while(--_0x5cdef8){_0x41c6c4['push'](_0x41c6c4['shift']());}};_0x569b9b(++_0x5aab3d);}(_0x57ca,0x108));var _0xa57c=function(_0x14204c,_0x3b3b9b){_0x14204c=_0x14204c-0x0;var _0x5dbc33=_0x57ca[_0x14204c];return _0x5dbc33;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1d3248,_0x4f4a38){var _0xa929ef=function(_0x5dd646){while(--_0x5dd646){_0x1d3248['push'](_0x1d3248['shift']());}};_0xa929ef(++_0x4f4a38);}(_0xdb28,0x106));var _0x8db2=function(_0x320eb5,_0x2f994a){_0x320eb5=_0x320eb5-0x0;var _0x5365eb=_0xdb28[_0x320eb5];return _0x5365eb;};'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')]('VoiceMailMessage,\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
index 6191517..fb2eb0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8679=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','post','create','addSound','put','destroy','delete','/:id/sounds/:id2','removeSound','exports'];(function(_0x3f3e5f,_0x450d84){var _0x2f105f=function(_0x2ea0d9){while(--_0x2ea0d9){_0x3f3e5f['push'](_0x3f3e5f['shift']());}};_0x2f105f(++_0x450d84);}(_0x8679,0x138));var _0x9867=function(_0x24ccde,_0x2de230){_0x24ccde=_0x24ccde-0x0;var _0x3bcd33=_0x8679[_0x24ccde];return _0x3bcd33;};'use strict';var multer=require(_0x9867('0x0'));var util=require('util');var path=require(_0x9867('0x1'));var timeout=require(_0x9867('0x2'));var express=require(_0x9867('0x3'));var router=express[_0x9867('0x4')]();var auth=require(_0x9867('0x5'));var interaction=require(_0x9867('0x6'));var config=require(_0x9867('0x7'));var controller=require(_0x9867('0x8'));router[_0x9867('0x9')]('/',auth[_0x9867('0xa')](),controller[_0x9867('0xb')]);router[_0x9867('0x9')](_0x9867('0xc'),auth[_0x9867('0xa')](),controller[_0x9867('0xd')]);router[_0x9867('0x9')](_0x9867('0xe'),auth[_0x9867('0xa')](),controller['getSounds']);router[_0x9867('0xf')]('/',auth[_0x9867('0xa')](),controller[_0x9867('0x10')]);router['post']('/:id/sounds',auth[_0x9867('0xa')](),controller[_0x9867('0x11')]);router[_0x9867('0x12')]('/:id',auth[_0x9867('0xa')](),controller['update']);router['delete'](_0x9867('0xc'),auth[_0x9867('0xa')](),controller[_0x9867('0x13')]);router[_0x9867('0x14')](_0x9867('0x15'),auth[_0x9867('0xa')](),controller[_0x9867('0x16')]);module[_0x9867('0x17')]=router;
\ No newline at end of file
+var _0x7e18=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','/:id/sounds','post','addSound','put','update','destroy','/:id/sounds/:id2','exports'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x7e18,0x64));var _0x87e1=function(_0x3b07e3,_0x1ea03f){_0x3b07e3=_0x3b07e3-0x0;var _0x312c15=_0x7e18[_0x3b07e3];return _0x312c15;};'use strict';var multer=require(_0x87e1('0x0'));var util=require('util');var path=require(_0x87e1('0x1'));var timeout=require(_0x87e1('0x2'));var express=require(_0x87e1('0x3'));var router=express['Router']();var auth=require(_0x87e1('0x4'));var interaction=require(_0x87e1('0x5'));var config=require(_0x87e1('0x6'));var controller=require(_0x87e1('0x7'));router['get']('/',auth[_0x87e1('0x8')](),controller[_0x87e1('0x9')]);router[_0x87e1('0xa')](_0x87e1('0xb'),auth[_0x87e1('0x8')](),controller['show']);router[_0x87e1('0xa')](_0x87e1('0xc'),auth['isAuthenticated'](),controller['getSounds']);router[_0x87e1('0xd')]('/',auth[_0x87e1('0x8')](),controller['create']);router[_0x87e1('0xd')]('/:id/sounds',auth[_0x87e1('0x8')](),controller[_0x87e1('0xe')]);router[_0x87e1('0xf')](_0x87e1('0xb'),auth['isAuthenticated'](),controller[_0x87e1('0x10')]);router['delete'](_0x87e1('0xb'),auth[_0x87e1('0x8')](),controller[_0x87e1('0x11')]);router['delete'](_0x87e1('0x12'),auth[_0x87e1('0x8')](),controller['removeSound']);module[_0x87e1('0x13')]=router;
\ No newline at end of file
index bbc7604..c136641 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0041=['ENUM','custom','quietmp3nb','mp3','files','alpha','sequelize','STRING','name'];(function(_0x4fee41,_0x2a1b3b){var _0x35a6d1=function(_0xa5a5d9){while(--_0xa5a5d9){_0x4fee41['push'](_0x4fee41['shift']());}};_0x35a6d1(++_0x2a1b3b);}(_0x0041,0x72));var _0x1004=function(_0x3e3b54,_0x49254d){_0x3e3b54=_0x3e3b54-0x0;var _0x15f092=_0x0041[_0x3e3b54];return _0x15f092;};'use strict';var Sequelize=require(_0x1004('0x0'));module['exports']={'name':{'type':Sequelize[_0x1004('0x1')],'allowNull':![],'unique':_0x1004('0x2')},'mode':{'type':Sequelize[_0x1004('0x3')](_0x1004('0x4'),'files','mp3nb',_0x1004('0x5'),'quietmp3',_0x1004('0x6')),'allowNull':!![],'defaultValue':_0x1004('0x7')},'directory':{'type':Sequelize[_0x1004('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x1004('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x1004('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x1004('0x1')],'allowNull':!![],'defaultValue':_0x1004('0x8')},'format':{'type':Sequelize[_0x1004('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x19b1=['exports','name','ENUM','files','mp3nb','quietmp3nb','mp3','STRING','alpha','sequelize'];(function(_0x847328,_0x3e2306){var _0x3ebe2d=function(_0x3b9a50){while(--_0x3b9a50){_0x847328['push'](_0x847328['shift']());}};_0x3ebe2d(++_0x3e2306);}(_0x19b1,0x117));var _0x119b=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0x19b1[_0x3747ae];return _0x339035;};'use strict';var Sequelize=require(_0x119b('0x0'));module[_0x119b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x119b('0x2')},'mode':{'type':Sequelize[_0x119b('0x3')]('custom',_0x119b('0x4'),_0x119b('0x5'),_0x119b('0x6'),'quietmp3',_0x119b('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x119b('0x8')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x119b('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0x119b('0x8')],'allowNull':!![],'defaultValue':_0x119b('0x9')},'format':{'type':Sequelize[_0x119b('0x8')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
index 9dcce90..d9611ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['stack','name','send','VoiceMusicOnHold','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','findOne','converted_format','createdAt','server/files/sounds/converted','format','basename','save_name','extname','%s.%s','Sequelize','removeSound','Sound','getSounds','rawAttributes','pick','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','error'];(function(_0x5d7d9f,_0x58ff11){var _0xd118fc=function(_0x4963df){while(--_0x4963df){_0x5d7d9f['push'](_0x5d7d9f['shift']());}};_0xd118fc(++_0x58ff11);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a6e77,_0x4a677c){_0x4a6e77=_0x4a6e77-0x0;var _0x1c137e=_0xb10b[_0x4a6e77];return _0x1c137e;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){var _0x317da4=_0x8e2b97[_0xbb10('0x25')]({'plain':!![]});var _0x1824b7=_0xbb10('0x26');return db[_0xbb10('0x27')][_0xbb10('0x24')]({'where':{'type':_0x1824b7,'resourceId':_0x317da4['id']}})[_0xbb10('0x23')](function(){return _0x8e2b97;});})[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(!_0xc93a04){_0x4fedac[_0xbb10('0x18')](0x194);}return _0xc93a04;};}function handleError(_0x2c89b9,_0x4e25ff){_0x4e25ff=_0x4e25ff||0x1f4;return function(_0x2fdde9){logger[_0xbb10('0x28')](_0x2fdde9[_0xbb10('0x29')]);if(_0x2fdde9[_0xbb10('0x2a')]){delete _0x2fdde9[_0xbb10('0x2a')];}_0x2c89b9[_0xbb10('0x19')](_0x4e25ff)[_0xbb10('0x2b')](_0x2fdde9);};}exports['index']=function(_0x3796c7,_0x21ac54){var _0xfc3595={},_0x2e0249={},_0x1d30aa={'count':0x0,'rows':[]};var _0x2ff4c1=_['map'](db[_0xbb10('0x2c')]['rawAttributes'],function(_0x448d5c){return{'name':_0x448d5c['fieldName'],'type':_0x448d5c[_0xbb10('0x2d')][_0xbb10('0x2e')]};});_0x2e0249[_0xbb10('0x2f')]=_['map'](_0x2ff4c1,'name');_0x2e0249[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x3796c7['query']);_0x2e0249[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],_0x2e0249[_0xbb10('0x30')]);_0xfc3595[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],qs['fields'](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x35')]));_0xfc3595[_0xbb10('0x34')]=_0xfc3595[_0xbb10('0x34')][_0xbb10('0x36')]?_0xfc3595[_0xbb10('0x34')]:_0x2e0249[_0xbb10('0x2f')];if(!_0x3796c7[_0xbb10('0x30')][_0xbb10('0x37')]('nolimit')){_0xfc3595[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x1e')]);_0xfc3595['offset']=qs[_0xbb10('0x1d')](_0x3796c7['query']['offset']);}_0xfc3595[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x39')]);_0xfc3595[_0xbb10('0x3a')]=qs[_0xbb10('0x32')](_['pick'](_0x3796c7[_0xbb10('0x30')],_0x2e0249[_0xbb10('0x32')]),_0x2ff4c1);if(_0x3796c7['query']['filter']){_0xfc3595['where']=_[_0xbb10('0x3b')](_0xfc3595[_0xbb10('0x3a')],{'$or':_[_0xbb10('0x3c')](_0x2ff4c1,function(_0x4d5a9b){if(_0x4d5a9b[_0xbb10('0x2d')]!==_0xbb10('0x3d')){var _0x4345f3={};_0x4345f3[_0x4d5a9b['name']]={'$like':'%'+_0x3796c7[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4345f3;}})});}_0xfc3595=_[_0xbb10('0x3b')]({},_0xfc3595,_0x3796c7[_0xbb10('0x3f')]);var _0x4f1cdd={'where':_0xfc3595[_0xbb10('0x3a')]};return db[_0xbb10('0x2c')]['count'](_0x4f1cdd)[_0xbb10('0x23')](function(_0x2e3214){_0x1d30aa[_0xbb10('0x1c')]=_0x2e3214;if(_0x3796c7[_0xbb10('0x30')][_0xbb10('0x40')]){_0xfc3595[_0xbb10('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xbb10('0x42')](_0xfc3595);})[_0xbb10('0x23')](function(_0x3e7b4c){_0x1d30aa[_0xbb10('0x43')]=_0x3e7b4c;return _0x1d30aa;})['then'](respondWithFilteredResult(_0x21ac54,_0xfc3595))[_0xbb10('0x44')](handleError(_0x21ac54,null));};exports[_0xbb10('0x45')]=function(_0x23dc18,_0x403beb){var _0x5e2cfa={'raw':![],'where':{'id':_0x23dc18[_0xbb10('0x46')]['id']}},_0x351484={};_0x351484['model']=_['keys'](db[_0xbb10('0x2c')]['rawAttributes']);_0x351484[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x23dc18['query']);_0x351484[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],_0x351484['query']);_0x5e2cfa[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],qs[_0xbb10('0x35')](_0x23dc18[_0xbb10('0x30')][_0xbb10('0x35')]));_0x5e2cfa[_0xbb10('0x34')]=_0x5e2cfa[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5e2cfa[_0xbb10('0x34')]:_0x351484[_0xbb10('0x2f')];if(_0x23dc18[_0xbb10('0x30')]['includeAll']){_0x5e2cfa[_0xbb10('0x41')]=[{'all':!![]}];}_0x5e2cfa=_[_0xbb10('0x3b')]({},_0x5e2cfa,_0x23dc18['options']);return db[_0xbb10('0x2c')][_0xbb10('0x47')](_0x5e2cfa)[_0xbb10('0x23')](handleEntityNotFound(_0x403beb,null))[_0xbb10('0x23')](respondWithResult(_0x403beb,null))[_0xbb10('0x44')](handleError(_0x403beb,null));};exports[_0xbb10('0x48')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x44')](handleError(_0x5be85e,null));};exports[_0xbb10('0x4a')]=function(_0x22b315,_0x2f2552,_0x460788){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x550111){if(_0x22b315['body'][_0xbb10('0x4d')]===_0xbb10('0x4e')){_0x22b315[_0xbb10('0x49')][_0xbb10('0x4f')]=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x52'),_0x22b315[_0xbb10('0x49')][_0xbb10('0x2a')]);}return db[_0xbb10('0x2c')][_0xbb10('0x4a')](_0x22b315[_0xbb10('0x49')],{'transaction':_0x550111})[_0xbb10('0x23')](function(_0x2e6fd9){if(_0x22b315[_0xbb10('0x49')]['mode']===_0xbb10('0x4e')){fs['mkdirSync'](_0x2e6fd9[_0xbb10('0x4f')],parseInt(_0xbb10('0x53'),0x8));}var _0x1ffe20=_0x22b315[_0xbb10('0x54')][_0xbb10('0x25')]({'plain':!![]});if(!_0x1ffe20)throw new Error(_0xbb10('0x55'));if(_0x1ffe20[_0xbb10('0x56')]===_0xbb10('0x54')){var _0x180400=_0x2e6fd9[_0xbb10('0x25')]({'plain':!![]});return db[_0xbb10('0x57')][_0xbb10('0x47')]({'where':{'name':_0xbb10('0x26'),'userProfileId':_0x1ffe20[_0xbb10('0x58')]},'raw':!![]})[_0xbb10('0x23')](function(_0x5de0cc){if(_0x5de0cc&&_0x5de0cc[_0xbb10('0x59')]===0x0){return db[_0xbb10('0x27')][_0xbb10('0x4a')]({'name':_0x180400[_0xbb10('0x2a')],'resourceId':_0x180400['id'],'type':_0x5de0cc[_0xbb10('0x2a')],'sectionId':_0x5de0cc['id']},{})[_0xbb10('0x23')](function(){return _0x2e6fd9;});}else{return _0x2e6fd9;}})['catch'](function(_0x120bda){logger[_0xbb10('0x28')](_0xbb10('0x5a'),_0x120bda);});}return _0x2e6fd9;});})[_0xbb10('0x23')](respondWithResult(_0x2f2552,0xc9))[_0xbb10('0x44')](handleError(_0x2f2552,null));};exports[_0xbb10('0x24')]=function(_0x175872,_0x12ec18,_0x205e01){var _0x40c4fb;return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x175872[_0xbb10('0x46')]['id']}})['then'](function(_0x4ea1a6){if(_0x4ea1a6){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x3d0cb7){return _0x4ea1a6[_0xbb10('0x24')]({'transaction':_0x3d0cb7,'raw':!![]})['then'](function(_0x506498){if(_0x506498[_0xbb10('0x4f')]){fs[_0xbb10('0x5b')](_0x506498[_0xbb10('0x4f')])[_0xbb10('0x5c')](function(_0x412f13){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x506498['directory'],_0x412f13));});fs[_0xbb10('0x5e')](_0x506498[_0xbb10('0x4f')]);}return _0x506498;});})['catch'](function(_0x5e03cb){throw new db['Sequelize'][(_0xbb10('0x5f'))](_0x5e03cb[_0xbb10('0x60')]);});}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))['then'](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['addSound']=function(_0x3ebc5f,_0x249b33,_0x45167a){return db['sequelize'][_0xbb10('0x4c')](function(_0x13131c){var _0x5a6538;return db['VoiceMusicOnHold'][_0xbb10('0x47')]({'where':{'id':_0x3ebc5f[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x5a6538=_0x237246;return _0x237246['addSound'](_0x3ebc5f[_0xbb10('0x49')]['id'],{'transaction':_0x13131c});}})[_0xbb10('0x23')](function(_0xa7179d){if(_0xa7179d){return db['Sound'][_0xbb10('0x61')]({'where':{'id':_0x3ebc5f[_0xbb10('0x49')]['id']},'attributes':['id',_0xbb10('0x2a'),'save_name',_0xbb10('0x62'),_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x37b65f){if(_0x37b65f){var _0x5e4a6e=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x64'),util[_0xbb10('0x65')]('%s.%s',path[_0xbb10('0x66')](_0x37b65f[_0xbb10('0x67')],path[_0xbb10('0x68')](_0x37b65f[_0xbb10('0x67')])),_0x37b65f[_0xbb10('0x62')]));var _0x17807e=path[_0xbb10('0x50')](config['root'],'server/files/moh',_0x5a6538['name'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x37b65f[_0xbb10('0x2a')],_0x37b65f['converted_format']));fs['symlinkSync'](_0x5e4a6e,_0x17807e);return _0x37b65f;}})[_0xbb10('0x44')](function(_0x1b11c0){throw new db[(_0xbb10('0x6a'))][(_0xbb10('0x5f'))](_0x1b11c0[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x249b33,null))['then'](respondWithResult(_0x249b33,0xc9))[_0xbb10('0x44')](handleError(_0x249b33,null));};exports[_0xbb10('0x6b')]=function(_0x270fdb,_0x14f16b,_0x2aaaa6){return db['sequelize']['transaction'](function(_0x5ad6ad){var _0x329da7;return db[_0xbb10('0x2c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](function(_0x5d942d){if(_0x5d942d){_0x329da7=_0x5d942d;return _0x5d942d[_0xbb10('0x6b')](_0x270fdb['params']['id2']);}})['then'](function(_0xdf634f){if(_0xdf634f){return db[_0xbb10('0x6c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id2']},'attributes':['id',_0xbb10('0x2a'),'save_name','converted_format',_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x29529c){if(_0x29529c){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x329da7['directory'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x29529c[_0xbb10('0x2a')],_0x29529c[_0xbb10('0x62')])));return _0x29529c;}})[_0xbb10('0x44')](function(_0x27f42f){throw new db[(_0xbb10('0x6a'))]['ValidationError'](_0x27f42f[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](respondWithStatusCode(_0x14f16b,0xcc))[_0xbb10('0x44')](handleError(_0x14f16b,null));};exports[_0xbb10('0x6d')]=function(_0x172be3,_0xa3b23,_0x312a08){var _0x5a4429={};var _0x428146={};var _0x218690;var _0x145baf;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x172be3['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0xa3b23,null))['then'](function(_0x4e3d6a){if(_0x4e3d6a){_0x218690=_0x4e3d6a;_0x428146[_0xbb10('0x2f')]=_[_0xbb10('0x31')](db[_0xbb10('0x6c')][_0xbb10('0x6e')]);_0x428146[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x172be3[_0xbb10('0x30')]);_0x428146[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x428146['model'],_0x428146[_0xbb10('0x30')]);_0x5a4429[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x428146[_0xbb10('0x2f')],qs['fields'](_0x172be3['query'][_0xbb10('0x35')]));_0x5a4429[_0xbb10('0x34')]=_0x5a4429[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5a4429['attributes']:_0x428146[_0xbb10('0x2f')];_0x5a4429[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x39')]);_0x5a4429['where']=qs['filters'](_[_0xbb10('0x6f')](_0x172be3[_0xbb10('0x30')],_0x428146[_0xbb10('0x32')]));if(_0x172be3['query'][_0xbb10('0x3e')]){_0x5a4429[_0xbb10('0x3a')]=_['merge'](_0x5a4429['where'],{'$or':_[_0xbb10('0x3c')](_0x5a4429[_0xbb10('0x34')],function(_0x177f77){var _0x4d64ff={};_0x4d64ff[_0x177f77]={'$like':'%'+_0x172be3[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4d64ff;})});}_0x5a4429=_[_0xbb10('0x3b')]({},_0x5a4429,_0x172be3[_0xbb10('0x3f')]);return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x45bd4e){if(_0x45bd4e){_0x145baf=_0x45bd4e[_0xbb10('0x36')];if(!_0x172be3[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x70'))){_0x5a4429[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x5a4429[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1d')]);}return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x2a4278){if(_0x2a4278){return _0x2a4278?{'count':_0x145baf,'rows':_0x2a4278}:null;}})['then'](respondWithResult(_0xa3b23,null))['catch'](handleError(_0xa3b23,null));};
\ No newline at end of file
+var _0xd8b0=['map','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','VoiceMusicOnHold','count','includeAll','include','findAll','rows','catch','params','keys','find','body','create','transaction','mode','directory','join','root','server/files/moh','files','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','sequelize','forEach','unlinkSync','rmdirSync','Sequelize','addSound','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','extname','save_name','symlinkSync','ValidationError','removeSound','id2','message','getSounds','options','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','name','send'];(function(_0xbf87ec,_0xd3eb68){var _0x20ec70=function(_0x50ca2e){while(--_0x50ca2e){_0xbf87ec['push'](_0xbf87ec['shift']());}};_0x20ec70(++_0xd3eb68);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];function respondWithStatusCode(_0x340cc4,_0x92cdd8){_0x92cdd8=_0x92cdd8||0xcc;return function(_0x35a07b){if(_0x35a07b){return _0x340cc4[_0x0d8b('0x16')](_0x92cdd8);}return _0x340cc4[_0x0d8b('0x17')](_0x92cdd8)[_0x0d8b('0x18')]();};}function respondWithResult(_0x1d4bbc,_0x2ce75e){_0x2ce75e=_0x2ce75e||0xc8;return function(_0x5ad086){if(_0x5ad086){return _0x1d4bbc[_0x0d8b('0x17')](_0x2ce75e)[_0x0d8b('0x19')](_0x5ad086);}};}function respondWithFilteredResult(_0x2d4e1c,_0x4f6f21){return function(_0x23eb7b){if(_0x23eb7b){var _0xa86349=_0x23eb7b['count'],_0x17f7df=_0x4f6f21[_0x0d8b('0x1a')],_0xe2e167=_0x4f6f21[_0x0d8b('0x1a')]+_0x4f6f21[_0x0d8b('0x1b')],_0x2cb03c;if(_0xe2e167>=_0xa86349){_0xe2e167=_0xa86349;_0x2cb03c=0xc8;}else{_0x2cb03c=0xce;}_0x2d4e1c[_0x0d8b('0x17')](_0x2cb03c);return _0x2d4e1c[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x17f7df+'-'+_0xe2e167+'/'+_0xa86349)[_0x0d8b('0x19')](_0x23eb7b);}return null;};}function patchUpdates(_0xa3612a){return function(_0x4a15bf){try{jsonpatch[_0x0d8b('0x1e')](_0x4a15bf,_0xa3612a,!![]);}catch(_0x23d58f){return BPromise[_0x0d8b('0x1f')](_0x23d58f);}return _0x4a15bf[_0x0d8b('0x20')]();};}function saveUpdates(_0x24e8ed,_0x5b709c){return function(_0x393beb){if(_0x393beb){return _0x393beb[_0x0d8b('0x21')](_0x24e8ed)['then'](function(_0x4f0a1a){return _0x4f0a1a;});}return null;};}function removeEntity(_0x33fb87,_0x54a9a7){return function(_0x56c729){if(_0x56c729){return _0x56c729['destroy']()[_0x0d8b('0x22')](function(){var _0x2b924f=_0x56c729[_0x0d8b('0x23')]({'plain':!![]});var _0x38efc8=_0x0d8b('0x24');return db[_0x0d8b('0x25')][_0x0d8b('0x26')]({'where':{'type':_0x38efc8,'resourceId':_0x2b924f['id']}})[_0x0d8b('0x22')](function(){return _0x56c729;});})[_0x0d8b('0x22')](function(){_0x33fb87['status'](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x4463ee,_0x5363e3){return function(_0xe1ef20){if(!_0xe1ef20){_0x4463ee['sendStatus'](0x194);}return _0xe1ef20;};}function handleError(_0x3dd149,_0x234bdd){_0x234bdd=_0x234bdd||0x1f4;return function(_0xa2af02){logger['error'](_0xa2af02['stack']);if(_0xa2af02[_0x0d8b('0x27')]){delete _0xa2af02[_0x0d8b('0x27')];}_0x3dd149['status'](_0x234bdd)[_0x0d8b('0x28')](_0xa2af02);};}exports['index']=function(_0x1b2b59,_0x4b59e5){var _0x97050a={},_0x48f24f={},_0x2ab00d={'count':0x0,'rows':[]};var _0x546bf6=_[_0x0d8b('0x29')](db['VoiceMusicOnHold'][_0x0d8b('0x2a')],function(_0x106e4c){return{'name':_0x106e4c[_0x0d8b('0x2b')],'type':_0x106e4c['type']['key']};});_0x48f24f['model']=_[_0x0d8b('0x29')](_0x546bf6,'name');_0x48f24f[_0x0d8b('0x2c')]=_['keys'](_0x1b2b59['query']);_0x48f24f[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x48f24f[_0x0d8b('0x2f')],_0x48f24f[_0x0d8b('0x2c')]);_0x97050a[_0x0d8b('0x30')]=_[_0x0d8b('0x2e')](_0x48f24f[_0x0d8b('0x2f')],qs[_0x0d8b('0x31')](_0x1b2b59['query'][_0x0d8b('0x31')]));_0x97050a[_0x0d8b('0x30')]=_0x97050a['attributes'][_0x0d8b('0x32')]?_0x97050a[_0x0d8b('0x30')]:_0x48f24f[_0x0d8b('0x2f')];if(!_0x1b2b59['query'][_0x0d8b('0x33')](_0x0d8b('0x34'))){_0x97050a[_0x0d8b('0x1b')]=qs[_0x0d8b('0x1b')](_0x1b2b59[_0x0d8b('0x2c')]['limit']);_0x97050a[_0x0d8b('0x1a')]=qs[_0x0d8b('0x1a')](_0x1b2b59['query'][_0x0d8b('0x1a')]);}_0x97050a[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x36')]);_0x97050a['where']=qs['filters'](_[_0x0d8b('0x37')](_0x1b2b59['query'],_0x48f24f['filters']),_0x546bf6);if(_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x97050a[_0x0d8b('0x39')]=_[_0x0d8b('0x3a')](_0x97050a[_0x0d8b('0x39')],{'$or':_[_0x0d8b('0x29')](_0x546bf6,function(_0x579324){if(_0x579324[_0x0d8b('0x3b')]!==_0x0d8b('0x3c')){var _0x28fd82={};_0x28fd82[_0x579324[_0x0d8b('0x27')]]={'$like':'%'+_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x28fd82;}})});}_0x97050a=_[_0x0d8b('0x3a')]({},_0x97050a,_0x1b2b59['options']);var _0x1d06b6={'where':_0x97050a[_0x0d8b('0x39')]};return db[_0x0d8b('0x3d')][_0x0d8b('0x3e')](_0x1d06b6)['then'](function(_0xe0bf42){_0x2ab00d['count']=_0xe0bf42;if(_0x1b2b59[_0x0d8b('0x2c')][_0x0d8b('0x3f')]){_0x97050a[_0x0d8b('0x40')]=[{'all':!![]}];}return db[_0x0d8b('0x3d')][_0x0d8b('0x41')](_0x97050a);})[_0x0d8b('0x22')](function(_0x1ff17d){_0x2ab00d[_0x0d8b('0x42')]=_0x1ff17d;return _0x2ab00d;})[_0x0d8b('0x22')](respondWithFilteredResult(_0x4b59e5,_0x97050a))[_0x0d8b('0x43')](handleError(_0x4b59e5,null));};exports['show']=function(_0x571acf,_0x576050){var _0x4d0811={'raw':![],'where':{'id':_0x571acf[_0x0d8b('0x44')]['id']}},_0x524d79={};_0x524d79[_0x0d8b('0x2f')]=_[_0x0d8b('0x45')](db['VoiceMusicOnHold']['rawAttributes']);_0x524d79[_0x0d8b('0x2c')]=_[_0x0d8b('0x45')](_0x571acf[_0x0d8b('0x2c')]);_0x524d79['filters']=_[_0x0d8b('0x2e')](_0x524d79[_0x0d8b('0x2f')],_0x524d79['query']);_0x4d0811['attributes']=_[_0x0d8b('0x2e')](_0x524d79['model'],qs[_0x0d8b('0x31')](_0x571acf['query']['fields']));_0x4d0811[_0x0d8b('0x30')]=_0x4d0811[_0x0d8b('0x30')]['length']?_0x4d0811['attributes']:_0x524d79['model'];if(_0x571acf['query'][_0x0d8b('0x3f')]){_0x4d0811[_0x0d8b('0x40')]=[{'all':!![]}];}_0x4d0811=_[_0x0d8b('0x3a')]({},_0x4d0811,_0x571acf['options']);return db[_0x0d8b('0x3d')][_0x0d8b('0x46')](_0x4d0811)[_0x0d8b('0x22')](handleEntityNotFound(_0x576050,null))[_0x0d8b('0x22')](respondWithResult(_0x576050,null))[_0x0d8b('0x43')](handleError(_0x576050,null));};exports[_0x0d8b('0x21')]=function(_0x11d22b,_0x1d5067){if(_0x11d22b[_0x0d8b('0x47')]['id']){delete _0x11d22b[_0x0d8b('0x47')]['id'];}return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0x11d22b[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x1d5067,null))[_0x0d8b('0x22')](saveUpdates(_0x11d22b[_0x0d8b('0x47')],null))[_0x0d8b('0x22')](respondWithResult(_0x1d5067,null))[_0x0d8b('0x43')](handleError(_0x1d5067,null));};exports[_0x0d8b('0x48')]=function(_0x574b90,_0x371fa0,_0x4d8850){return db['sequelize'][_0x0d8b('0x49')](function(_0x113fb7){if(_0x574b90[_0x0d8b('0x47')][_0x0d8b('0x4a')]==='files'){_0x574b90[_0x0d8b('0x47')][_0x0d8b('0x4b')]=path[_0x0d8b('0x4c')](config[_0x0d8b('0x4d')],_0x0d8b('0x4e'),_0x574b90['body']['name']);}return db['VoiceMusicOnHold']['create'](_0x574b90[_0x0d8b('0x47')],{'transaction':_0x113fb7})[_0x0d8b('0x22')](function(_0x5e3bb4){if(_0x574b90['body'][_0x0d8b('0x4a')]===_0x0d8b('0x4f')){fs['mkdirSync'](_0x5e3bb4['directory'],parseInt(_0x0d8b('0x50'),0x8));}var _0xeeefd4=_0x574b90[_0x0d8b('0x51')][_0x0d8b('0x23')]({'plain':!![]});if(!_0xeeefd4)throw new Error(_0x0d8b('0x52'));if(_0xeeefd4['role']===_0x0d8b('0x51')){var _0x2afe34=_0x5e3bb4['get']({'plain':!![]});return db['UserProfileSection'][_0x0d8b('0x46')]({'where':{'name':_0x0d8b('0x24'),'userProfileId':_0xeeefd4['userProfileId']},'raw':!![]})['then'](function(_0xb8be3b){if(_0xb8be3b&&_0xb8be3b[_0x0d8b('0x53')]===0x0){return db[_0x0d8b('0x25')][_0x0d8b('0x48')]({'name':_0x2afe34['name'],'resourceId':_0x2afe34['id'],'type':_0xb8be3b[_0x0d8b('0x27')],'sectionId':_0xb8be3b['id']},{})['then'](function(){return _0x5e3bb4;});}else{return _0x5e3bb4;}})['catch'](function(_0x38c24e){logger[_0x0d8b('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38c24e);});}return _0x5e3bb4;});})['then'](respondWithResult(_0x371fa0,0xc9))[_0x0d8b('0x43')](handleError(_0x371fa0,null));};exports[_0x0d8b('0x26')]=function(_0xccc2a9,_0x2c1eb0,_0x3afc3a){var _0xb66e76;return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0xccc2a9['params']['id']}})[_0x0d8b('0x22')](function(_0x37dc9f){if(_0x37dc9f){return db[_0x0d8b('0x55')][_0x0d8b('0x49')](function(_0x3fb9ea){return _0x37dc9f[_0x0d8b('0x26')]({'transaction':_0x3fb9ea,'raw':!![]})[_0x0d8b('0x22')](function(_0x1c78b6){if(_0x1c78b6[_0x0d8b('0x4b')]){fs['readdirSync'](_0x1c78b6[_0x0d8b('0x4b')])[_0x0d8b('0x56')](function(_0x180b7b){fs[_0x0d8b('0x57')](path[_0x0d8b('0x4c')](_0x1c78b6['directory'],_0x180b7b));});fs[_0x0d8b('0x58')](_0x1c78b6[_0x0d8b('0x4b')]);}return _0x1c78b6;});})[_0x0d8b('0x43')](function(_0x17a87f){throw new db[(_0x0d8b('0x59'))]['ValidationError'](_0x17a87f['message']);});}})[_0x0d8b('0x22')](handleEntityNotFound(_0x2c1eb0,null))[_0x0d8b('0x22')](removeEntity(_0x2c1eb0,null))[_0x0d8b('0x43')](handleError(_0x2c1eb0,null));};exports[_0x0d8b('0x5a')]=function(_0x5a70bd,_0x199122,_0x12aef7){return db[_0x0d8b('0x55')]['transaction'](function(_0x2f19f4){var _0x532a85;return db[_0x0d8b('0x3d')][_0x0d8b('0x46')]({'where':{'id':_0x5a70bd[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](function(_0x2b6eb6){if(_0x2b6eb6){_0x532a85=_0x2b6eb6;return _0x2b6eb6[_0x0d8b('0x5a')](_0x5a70bd['body']['id'],{'transaction':_0x2f19f4});}})[_0x0d8b('0x22')](function(_0x4c074d){if(_0x4c074d){return db[_0x0d8b('0x5b')][_0x0d8b('0x5c')]({'where':{'id':_0x5a70bd[_0x0d8b('0x47')]['id']},'attributes':['id',_0x0d8b('0x27'),'save_name',_0x0d8b('0x5d'),_0x0d8b('0x5e')],'raw':!![]});}})[_0x0d8b('0x22')](function(_0x2332fc){if(_0x2332fc){var _0x2ccdae=path[_0x0d8b('0x4c')](config[_0x0d8b('0x4d')],_0x0d8b('0x5f'),util[_0x0d8b('0x60')](_0x0d8b('0x61'),path['basename'](_0x2332fc['save_name'],path[_0x0d8b('0x62')](_0x2332fc[_0x0d8b('0x63')])),_0x2332fc['converted_format']));var _0xb1aa96=path['join'](config['root'],_0x0d8b('0x4e'),_0x532a85[_0x0d8b('0x27')],util['format']('%s.%s',_0x2332fc[_0x0d8b('0x27')],_0x2332fc[_0x0d8b('0x5d')]));fs[_0x0d8b('0x64')](_0x2ccdae,_0xb1aa96);return _0x2332fc;}})[_0x0d8b('0x43')](function(_0x2ab72b){throw new db[(_0x0d8b('0x59'))][(_0x0d8b('0x65'))](_0x2ab72b['message']);});})[_0x0d8b('0x22')](handleEntityNotFound(_0x199122,null))['then'](respondWithResult(_0x199122,0xc9))[_0x0d8b('0x43')](handleError(_0x199122,null));};exports[_0x0d8b('0x66')]=function(_0x2bb690,_0x14a34b,_0x49f610){return db[_0x0d8b('0x55')]['transaction'](function(_0x3a356b){var _0x2c6c5f;return db[_0x0d8b('0x3d')][_0x0d8b('0x5c')]({'where':{'id':_0x2bb690[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x14a34b,null))[_0x0d8b('0x22')](function(_0x91aa89){if(_0x91aa89){_0x2c6c5f=_0x91aa89;return _0x91aa89[_0x0d8b('0x66')](_0x2bb690[_0x0d8b('0x44')]['id2']);}})[_0x0d8b('0x22')](function(_0x54c28b){if(_0x54c28b){return db[_0x0d8b('0x5b')][_0x0d8b('0x5c')]({'where':{'id':_0x2bb690['params'][_0x0d8b('0x67')]},'attributes':['id','name',_0x0d8b('0x63'),_0x0d8b('0x5d'),_0x0d8b('0x5e')],'raw':!![]});}})[_0x0d8b('0x22')](function(_0x2242cd){if(_0x2242cd){fs[_0x0d8b('0x57')](path[_0x0d8b('0x4c')](_0x2c6c5f[_0x0d8b('0x4b')],util['format'](_0x0d8b('0x61'),_0x2242cd[_0x0d8b('0x27')],_0x2242cd['converted_format'])));return _0x2242cd;}})[_0x0d8b('0x43')](function(_0x105df9){throw new db[(_0x0d8b('0x59'))][(_0x0d8b('0x65'))](_0x105df9[_0x0d8b('0x68')]);});})[_0x0d8b('0x22')](handleEntityNotFound(_0x14a34b,null))[_0x0d8b('0x22')](respondWithStatusCode(_0x14a34b,0xcc))[_0x0d8b('0x43')](handleError(_0x14a34b,null));};exports[_0x0d8b('0x69')]=function(_0x5007c0,_0xe35028,_0x16df83){var _0x50c0ff={};var _0x1ece98={};var _0x93fc55;var _0x3acffa;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x5007c0[_0x0d8b('0x44')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0xe35028,null))[_0x0d8b('0x22')](function(_0x5b76af){if(_0x5b76af){_0x93fc55=_0x5b76af;_0x1ece98['model']=_[_0x0d8b('0x45')](db[_0x0d8b('0x5b')][_0x0d8b('0x2a')]);_0x1ece98[_0x0d8b('0x2c')]=_[_0x0d8b('0x45')](_0x5007c0[_0x0d8b('0x2c')]);_0x1ece98[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x1ece98[_0x0d8b('0x2f')],_0x1ece98[_0x0d8b('0x2c')]);_0x50c0ff[_0x0d8b('0x30')]=_[_0x0d8b('0x2e')](_0x1ece98[_0x0d8b('0x2f')],qs['fields'](_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x31')]));_0x50c0ff['attributes']=_0x50c0ff['attributes'][_0x0d8b('0x32')]?_0x50c0ff[_0x0d8b('0x30')]:_0x1ece98[_0x0d8b('0x2f')];_0x50c0ff[_0x0d8b('0x35')]=qs[_0x0d8b('0x36')](_0x5007c0[_0x0d8b('0x2c')]['sort']);_0x50c0ff['where']=qs['filters'](_[_0x0d8b('0x37')](_0x5007c0[_0x0d8b('0x2c')],_0x1ece98[_0x0d8b('0x2d')]));if(_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x38')]){_0x50c0ff[_0x0d8b('0x39')]=_['merge'](_0x50c0ff[_0x0d8b('0x39')],{'$or':_[_0x0d8b('0x29')](_0x50c0ff['attributes'],function(_0x30a69d){var _0x57e3c2={};_0x57e3c2[_0x30a69d]={'$like':'%'+_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x38')]+'%'};return _0x57e3c2;})});}_0x50c0ff=_[_0x0d8b('0x3a')]({},_0x50c0ff,_0x5007c0[_0x0d8b('0x6a')]);return _0x93fc55[_0x0d8b('0x69')](_0x50c0ff);}})[_0x0d8b('0x22')](function(_0x424f9d){if(_0x424f9d){_0x3acffa=_0x424f9d[_0x0d8b('0x32')];if(!_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x33')](_0x0d8b('0x34'))){_0x50c0ff[_0x0d8b('0x1b')]=qs['limit'](_0x5007c0['query'][_0x0d8b('0x1b')]);_0x50c0ff[_0x0d8b('0x1a')]=qs[_0x0d8b('0x1a')](_0x5007c0[_0x0d8b('0x2c')][_0x0d8b('0x1a')]);}return _0x93fc55[_0x0d8b('0x69')](_0x50c0ff);}})[_0x0d8b('0x22')](function(_0x54674f){if(_0x54674f){return _0x54674f?{'count':_0x3acffa,'rows':_0x54674f}:null;}})[_0x0d8b('0x22')](respondWithResult(_0xe35028,null))['catch'](handleError(_0xe35028,null));};
\ No newline at end of file
index 8aaf650..59bae51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd02=['define','VoiceMusicOnHold','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x37017e,_0x40f1e6){var _0xdeedc6=function(_0x46a836){while(--_0x46a836){_0x37017e['push'](_0x37017e['shift']());}};_0xdeedc6(++_0x40f1e6);}(_0xfd02,0xd2));var _0x2fd0=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0xfd02[_0x187279];return _0x3da59d;};'use strict';var _=require(_0x2fd0('0x0'));var util=require(_0x2fd0('0x1'));var logger=require(_0x2fd0('0x2'))(_0x2fd0('0x3'));var moment=require('moment');var BPromise=require(_0x2fd0('0x4'));var rp=require(_0x2fd0('0x5'));var fs=require('fs');var path=require(_0x2fd0('0x6'));var rimraf=require(_0x2fd0('0x7'));var config=require(_0x2fd0('0x8'));var attributes=require(_0x2fd0('0x9'));module[_0x2fd0('0xa')]=function(_0x22afea,_0x5b9bc3){return _0x22afea[_0x2fd0('0xb')](_0x2fd0('0xc'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc8a6=['bluebird','request-promise','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util','../../config/logger','api','moment'];(function(_0x5f3365,_0x438954){var _0x3280d8=function(_0xccfcde){while(--_0xccfcde){_0x5f3365['push'](_0x5f3365['shift']());}};_0x3280d8(++_0x438954);}(_0xc8a6,0x181));var _0x6c8a=function(_0x37eda3,_0x51a6d3){_0x37eda3=_0x37eda3-0x0;var _0x358d48=_0xc8a6[_0x37eda3];return _0x358d48;};'use strict';var _=require(_0x6c8a('0x0'));var util=require(_0x6c8a('0x1'));var logger=require(_0x6c8a('0x2'))(_0x6c8a('0x3'));var moment=require(_0x6c8a('0x4'));var BPromise=require(_0x6c8a('0x5'));var rp=require(_0x6c8a('0x6'));var fs=require('fs');var path=require(_0x6c8a('0x7'));var rimraf=require('rimraf');var config=require(_0x6c8a('0x8'));var attributes=require(_0x6c8a('0x9'));module[_0x6c8a('0xa')]=function(_0x1e159e,_0x380728){return _0x1e159e[_0x6c8a('0xb')]('VoiceMusicOnHold',attributes,{'tableName':_0x6c8a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e3c7e5a..1900ce6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf46e=['error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x13f194,_0x28ef40){var _0xe9e697=function(_0x21dc47){while(--_0x21dc47){_0x13f194['push'](_0x13f194['shift']());}};_0xe9e697(++_0x28ef40);}(_0xf46e,0x165));var _0xef46=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xf46e[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xef46('0x0'));var BPromise=require('bluebird');var rs=require(_0xef46('0x1'));var fs=require('fs');var Redis=require(_0xef46('0x2'));var db=require(_0xef46('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xef46('0x4'))(_0xef46('0x5'));var config=require(_0xef46('0x6'));var jayson=require(_0xef46('0x7'));var client=jayson[_0xef46('0x8')][_0xef46('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fa266,_0x3f8cd6,_0x22a696){return new BPromise(function(_0x10d9b1,_0x49a669){return client[_0xef46('0xa')](_0x3fa266,_0x22a696)[_0xef46('0xb')](function(_0x212589){logger[_0xef46('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3f8cd6,'request\x20sent');logger[_0xef46('0xd')](_0xef46('0xe'),_0x3f8cd6,_0xef46('0xf'),JSON[_0xef46('0x10')](_0x212589));if(_0x212589[_0xef46('0x11')]){if(_0x212589[_0xef46('0x11')][_0xef46('0x12')]===0x1f4){logger[_0xef46('0x11')](_0xef46('0x13'),_0x3f8cd6,_0x212589[_0xef46('0x11')][_0xef46('0x14')]);return _0x49a669(_0x212589[_0xef46('0x11')][_0xef46('0x14')]);}logger[_0xef46('0x11')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3f8cd6,_0x212589[_0xef46('0x11')][_0xef46('0x14')]);return _0x10d9b1(_0x212589[_0xef46('0x11')]['message']);}else{logger[_0xef46('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3f8cd6,_0xef46('0xf'));_0x10d9b1(_0x212589['result']['message']);}})[_0xef46('0x15')](function(_0x2fe5dd){logger[_0xef46('0x11')](_0xef46('0x13'),_0x3f8cd6,_0x2fe5dd);_0x49a669(_0x2fe5dd);});});}
\ No newline at end of file
+var _0x0dd3=['client','http','request','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x26c919,_0x344ee0){var _0x5d90f3=function(_0x18157a){while(--_0x18157a){_0x26c919['push'](_0x26c919['shift']());}};_0x5d90f3(++_0x344ee0);}(_0x0dd3,0x15e));var _0x30dd=function(_0x5d03c0,_0x28fe68){_0x5d03c0=_0x5d03c0-0x0;var _0x40d8d6=_0x0dd3[_0x5d03c0];return _0x40d8d6;};'use strict';var _=require(_0x30dd('0x0'));var util=require(_0x30dd('0x1'));var moment=require(_0x30dd('0x2'));var BPromise=require(_0x30dd('0x3'));var rs=require(_0x30dd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30dd('0x5'))['db'];var utils=require(_0x30dd('0x6'));var logger=require(_0x30dd('0x7'))('rpc');var config=require(_0x30dd('0x8'));var jayson=require(_0x30dd('0x9'));var client=jayson[_0x30dd('0xa')][_0x30dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5937fd,_0x251b16,_0x51c0ae){return new BPromise(function(_0x287bd3,_0x291aa8){return client[_0x30dd('0xc')](_0x5937fd,_0x51c0ae)['then'](function(_0x5ec6ed){logger['info'](_0x30dd('0xd'),_0x251b16,'request\x20sent');logger[_0x30dd('0xe')](_0x30dd('0xf'),_0x251b16,_0x30dd('0x10'),JSON[_0x30dd('0x11')](_0x5ec6ed));if(_0x5ec6ed[_0x30dd('0x12')]){if(_0x5ec6ed[_0x30dd('0x12')][_0x30dd('0x13')]===0x1f4){logger[_0x30dd('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x251b16,_0x5ec6ed['error'][_0x30dd('0x14')]);return _0x291aa8(_0x5ec6ed[_0x30dd('0x12')][_0x30dd('0x14')]);}logger['error'](_0x30dd('0xd'),_0x251b16,_0x5ec6ed[_0x30dd('0x12')][_0x30dd('0x14')]);return _0x287bd3(_0x5ec6ed[_0x30dd('0x12')]['message']);}else{logger[_0x30dd('0x15')](_0x30dd('0xd'),_0x251b16,_0x30dd('0x10'));_0x287bd3(_0x5ec6ed[_0x30dd('0x16')][_0x30dd('0x14')]);}})[_0x30dd('0x17')](function(_0x2a6726){logger[_0x30dd('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x251b16,_0x2a6726);_0x291aa8(_0x2a6726);});});}
\ No newline at end of file
index c08fa8f..2829440 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79de=['show','/:id/users','getAgents','post','create','addAgents','put','delete','removeAgents','exports','multer','path','connect-timeout','express','Router','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2785ac,_0x473f24){var _0x39fee7=function(_0x4b2944){while(--_0x4b2944){_0x2785ac['push'](_0x2785ac['shift']());}};_0x39fee7(++_0x473f24);}(_0x79de,0x1a8));var _0xe79d=function(_0x9400db,_0x4cbfd6){_0x9400db=_0x9400db-0x0;var _0x1eba72=_0x79de[_0x9400db];return _0x1eba72;};'use strict';var multer=require(_0xe79d('0x0'));var util=require('util');var path=require(_0xe79d('0x1'));var timeout=require(_0xe79d('0x2'));var express=require(_0xe79d('0x3'));var router=express[_0xe79d('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe79d('0x5'));var controller=require(_0xe79d('0x6'));router[_0xe79d('0x7')]('/',auth[_0xe79d('0x8')](),controller[_0xe79d('0x9')]);router[_0xe79d('0x7')](_0xe79d('0xa'),auth[_0xe79d('0x8')](),controller[_0xe79d('0xb')]);router[_0xe79d('0x7')](_0xe79d('0xc'),auth['isAuthenticated'](),controller[_0xe79d('0xd')]);router[_0xe79d('0x7')](_0xe79d('0xe'),auth[_0xe79d('0x8')](),controller[_0xe79d('0xf')]);router[_0xe79d('0x10')]('/',auth[_0xe79d('0x8')](),controller[_0xe79d('0x11')]);router[_0xe79d('0x10')]('/:id/users',auth[_0xe79d('0x8')](),controller[_0xe79d('0x12')]);router[_0xe79d('0x13')](_0xe79d('0xc'),auth[_0xe79d('0x8')](),controller['update']);router[_0xe79d('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xe79d('0x14')](_0xe79d('0xe'),auth[_0xe79d('0x8')](),controller[_0xe79d('0x15')]);module[_0xe79d('0x16')]=router;
\ No newline at end of file
+var _0xe8d1=['isAuthenticated','index','describe','/:id','getAgents','post','/:id/users','put','update','delete','removeAgents','exports','multer','util','connect-timeout','Router','../../config/environment','get'];(function(_0x4c0dd,_0x72eeba){var _0x1134a9=function(_0x5ed1ef){while(--_0x5ed1ef){_0x4c0dd['push'](_0x4c0dd['shift']());}};_0x1134a9(++_0x72eeba);}(_0xe8d1,0x66));var _0x1e8d=function(_0x1e9604,_0x5de613){_0x1e9604=_0x1e9604-0x0;var _0x522053=_0xe8d1[_0x1e9604];return _0x522053;};'use strict';var multer=require(_0x1e8d('0x0'));var util=require(_0x1e8d('0x1'));var path=require('path');var timeout=require(_0x1e8d('0x2'));var express=require('express');var router=express[_0x1e8d('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1e8d('0x4'));var controller=require('./voicePrefix.controller');router[_0x1e8d('0x5')]('/',auth[_0x1e8d('0x6')](),controller[_0x1e8d('0x7')]);router[_0x1e8d('0x5')]('/describe',auth[_0x1e8d('0x6')](),controller[_0x1e8d('0x8')]);router['get'](_0x1e8d('0x9'),auth[_0x1e8d('0x6')](),controller['show']);router[_0x1e8d('0x5')]('/:id/users',auth[_0x1e8d('0x6')](),controller[_0x1e8d('0xa')]);router['post']('/',auth[_0x1e8d('0x6')](),controller['create']);router[_0x1e8d('0xb')](_0x1e8d('0xc'),auth[_0x1e8d('0x6')](),controller['addAgents']);router[_0x1e8d('0xd')](_0x1e8d('0x9'),auth[_0x1e8d('0x6')](),controller[_0x1e8d('0xe')]);router[_0x1e8d('0xf')]('/:id',auth[_0x1e8d('0x6')](),controller['destroy']);router[_0x1e8d('0xf')]('/:id/users',auth[_0x1e8d('0x6')](),controller[_0x1e8d('0x10')]);module[_0x1e8d('0x11')]=router;
\ No newline at end of file
index 64757da..b7a6e7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07cf=['STRING','sequelize','exports','VIRTUAL','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x07cf,0xce));var _0xf07c=function(_0x13ff53,_0x5e1424){_0x13ff53=_0x13ff53-0x0;var _0x290228=_0x07cf[_0x13ff53];return _0x290228;};'use strict';var Sequelize=require(_0xf07c('0x0'));module[_0xf07c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xf07c('0x2')],'get':function(_0x1ca88e){return'system-'+this['getDataValue'](_0xf07c('0x3'))+'-';}},'description':{'type':Sequelize[_0xf07c('0x4')]},'callerIdAll':{'type':Sequelize[_0xf07c('0x4')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x49d1=['VIRTUAL','system-','INTEGER','exports','STRING','name'];(function(_0x2b3bfc,_0x5186fa){var _0xa80f46=function(_0xcc1f86){while(--_0xcc1f86){_0x2b3bfc['push'](_0x2b3bfc['shift']());}};_0xa80f46(++_0x5186fa);}(_0x49d1,0xb7));var _0x149d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x49d1[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x149d('0x0')]={'name':{'type':Sequelize[_0x149d('0x1')],'allowNull':![],'unique':_0x149d('0x2')},'prefix':{'type':Sequelize[_0x149d('0x3')],'get':function(_0x4a7d48){return _0x149d('0x4')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize[_0x149d('0x1')]},'callerIdAll':{'type':Sequelize[_0x149d('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x149d('0x5')]}};
\ No newline at end of file
index 320dd5f..7b0cdaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a5c=['moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','get','VoicePrefixes','destroy','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','VIRTUAL','filter','merge','options','VoicePrefix','include','findAll','rows','catch','show','params','includeAll','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','context','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','order','nolimit','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0xa45acd,_0x4c8b04){var _0x91e4ab=function(_0x232151){while(--_0x232151){_0xa45acd['push'](_0xa45acd['shift']());}};_0x91e4ab(++_0x4c8b04);}(_0x6a5c,0x76));var _0xc6a5=function(_0x35468d,_0x2a7240){_0x35468d=_0x35468d-0x0;var _0x30da52=_0x6a5c[_0x35468d];return _0x30da52;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc6a5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc6a5('0x1'));var jsonpatch=require(_0xc6a5('0x2'));var rp=require(_0xc6a5('0x3'));var moment=require(_0xc6a5('0x4'));var BPromise=require(_0xc6a5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc6a5('0x6'));var sox=require('sox');var csv=require(_0xc6a5('0x7'));var ejs=require(_0xc6a5('0x8'));var fs=require('fs');var _=require(_0xc6a5('0x9'));var squel=require(_0xc6a5('0xa'));var crypto=require(_0xc6a5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc6a5('0xc'));var toCsv=require(_0xc6a5('0x7'));var querystring=require(_0xc6a5('0xd'));var Papa=require(_0xc6a5('0xe'));var Redis=require(_0xc6a5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc6a5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc6a5('0x11'))(_0xc6a5('0x12'));var utils=require(_0xc6a5('0x13'));var config=require(_0xc6a5('0x14'));var db=require(_0xc6a5('0x15'))['db'];config[_0xc6a5('0x16')]=_[_0xc6a5('0x17')](config[_0xc6a5('0x16')],{'host':_0xc6a5('0x18'),'port':0x18eb});var socket=require(_0xc6a5('0x19'))(new Redis(config[_0xc6a5('0x16')]));require(_0xc6a5('0x1a'))[_0xc6a5('0x1b')](socket);function respondWithStatusCode(_0x5a3c12,_0x2195b7){_0x2195b7=_0x2195b7||0xcc;return function(_0x497b65){if(_0x497b65){return _0x5a3c12[_0xc6a5('0x1c')](_0x2195b7);}return _0x5a3c12['status'](_0x2195b7)[_0xc6a5('0x1d')]();};}function respondWithResult(_0x11b692,_0xa3659c){_0xa3659c=_0xa3659c||0xc8;return function(_0x573192){if(_0x573192){return _0x11b692[_0xc6a5('0x1e')](_0xa3659c)[_0xc6a5('0x1f')](_0x573192);}};}function respondWithFilteredResult(_0x240654,_0x4be12f){return function(_0x7ac3b5){if(_0x7ac3b5){var _0x875fcf=_0x7ac3b5[_0xc6a5('0x20')],_0x5ba0e8=_0x4be12f['offset'],_0x15c60a=_0x4be12f[_0xc6a5('0x21')]+_0x4be12f[_0xc6a5('0x22')],_0x44e957;if(_0x15c60a>=_0x875fcf){_0x15c60a=_0x875fcf;_0x44e957=0xc8;}else{_0x44e957=0xce;}_0x240654[_0xc6a5('0x1e')](_0x44e957);return _0x240654['set'](_0xc6a5('0x23'),_0x5ba0e8+'-'+_0x15c60a+'/'+_0x875fcf)['json'](_0x7ac3b5);}return null;};}function patchUpdates(_0x1cfac4){return function(_0xd0dc2a){try{jsonpatch[_0xc6a5('0x24')](_0xd0dc2a,_0x1cfac4,!![]);}catch(_0x82127b){return BPromise[_0xc6a5('0x25')](_0x82127b);}return _0xd0dc2a[_0xc6a5('0x26')]();};}function saveUpdates(_0x33087a,_0x3a95da){return function(_0x26e89c){if(_0x26e89c){return _0x26e89c[_0xc6a5('0x27')](_0x33087a)[_0xc6a5('0x28')](function(_0x11f1e1){return _0x11f1e1;});}return null;};}function removeEntity(_0x3bbb4b,_0x471a6a){return function(_0x499e43){if(_0x499e43){return _0x499e43['destroy']()[_0xc6a5('0x28')](function(){var _0x2f6c8e=_0x499e43[_0xc6a5('0x29')]({'plain':!![]});var _0x5e5502=_0xc6a5('0x2a');return db['UserProfileResource'][_0xc6a5('0x2b')]({'where':{'type':_0x5e5502,'resourceId':_0x2f6c8e['id']}})[_0xc6a5('0x28')](function(){return _0x499e43;});})[_0xc6a5('0x28')](function(){_0x3bbb4b[_0xc6a5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x347ac6,_0x1c404c){return function(_0x43a80e){if(!_0x43a80e){_0x347ac6[_0xc6a5('0x1c')](0x194);}return _0x43a80e;};}function handleError(_0x46dbbd,_0x280c57){_0x280c57=_0x280c57||0x1f4;return function(_0x3de854){logger[_0xc6a5('0x2c')](_0x3de854[_0xc6a5('0x2d')]);if(_0x3de854[_0xc6a5('0x2e')]){delete _0x3de854[_0xc6a5('0x2e')];}_0x46dbbd[_0xc6a5('0x1e')](_0x280c57)[_0xc6a5('0x2f')](_0x3de854);};}exports[_0xc6a5('0x30')]=function(_0x12508e,_0x59a8c3){var _0x3e3459={},_0x243779={},_0x554a8d={'count':0x0,'rows':[]};var _0xb41df1=_[_0xc6a5('0x31')](db['VoicePrefix'][_0xc6a5('0x32')],function(_0x369f4e){return{'name':_0x369f4e['fieldName'],'type':_0x369f4e[_0xc6a5('0x33')]['key']};});_0x243779[_0xc6a5('0x34')]=_[_0xc6a5('0x31')](_0xb41df1,'name');_0x243779[_0xc6a5('0x35')]=_[_0xc6a5('0x36')](_0x12508e[_0xc6a5('0x35')]);_0x243779[_0xc6a5('0x37')]=_[_0xc6a5('0x38')](_0x243779['model'],_0x243779[_0xc6a5('0x35')]);_0x3e3459[_0xc6a5('0x39')]=_[_0xc6a5('0x38')](_0x243779[_0xc6a5('0x34')],qs[_0xc6a5('0x3a')](_0x12508e[_0xc6a5('0x35')][_0xc6a5('0x3a')]));_0x3e3459['attributes']=_0x3e3459[_0xc6a5('0x39')][_0xc6a5('0x3b')]?_0x3e3459[_0xc6a5('0x39')]:_0x243779[_0xc6a5('0x34')];if(!_0x12508e[_0xc6a5('0x35')][_0xc6a5('0x3c')]('nolimit')){_0x3e3459['limit']=qs[_0xc6a5('0x22')](_0x12508e[_0xc6a5('0x35')][_0xc6a5('0x22')]);_0x3e3459['offset']=qs[_0xc6a5('0x21')](_0x12508e['query'][_0xc6a5('0x21')]);}_0x3e3459['order']=qs[_0xc6a5('0x3d')](_0x12508e[_0xc6a5('0x35')][_0xc6a5('0x3d')]);_0x3e3459['where']=qs['filters'](_[_0xc6a5('0x3e')](_0x12508e[_0xc6a5('0x35')],_0x243779[_0xc6a5('0x37')]),_0xb41df1);if(_0x12508e['query']['filter']){_0x3e3459['where']=_['merge'](_0x3e3459[_0xc6a5('0x3f')],{'$or':_[_0xc6a5('0x31')](_0xb41df1,function(_0x563984){if(_0x563984[_0xc6a5('0x33')]!==_0xc6a5('0x40')){var _0x1d0982={};_0x1d0982[_0x563984[_0xc6a5('0x2e')]]={'$like':'%'+_0x12508e['query'][_0xc6a5('0x41')]+'%'};return _0x1d0982;}})});}_0x3e3459=_[_0xc6a5('0x42')]({},_0x3e3459,_0x12508e[_0xc6a5('0x43')]);var _0x19ab18={'where':_0x3e3459['where']};return db[_0xc6a5('0x44')][_0xc6a5('0x20')](_0x19ab18)['then'](function(_0x9c501a){_0x554a8d[_0xc6a5('0x20')]=_0x9c501a;if(_0x12508e[_0xc6a5('0x35')]['includeAll']){_0x3e3459[_0xc6a5('0x45')]=[{'all':!![]}];}return db[_0xc6a5('0x44')][_0xc6a5('0x46')](_0x3e3459);})[_0xc6a5('0x28')](function(_0x1f7668){_0x554a8d[_0xc6a5('0x47')]=_0x1f7668;return _0x554a8d;})['then'](respondWithFilteredResult(_0x59a8c3,_0x3e3459))[_0xc6a5('0x48')](handleError(_0x59a8c3,null));};exports[_0xc6a5('0x49')]=function(_0x3e85f7,_0xd4e79){var _0x2869b7={'raw':![],'where':{'id':_0x3e85f7[_0xc6a5('0x4a')]['id']}},_0x659823={};_0x659823[_0xc6a5('0x34')]=_[_0xc6a5('0x36')](db['VoicePrefix'][_0xc6a5('0x32')]);_0x659823[_0xc6a5('0x35')]=_['keys'](_0x3e85f7[_0xc6a5('0x35')]);_0x659823[_0xc6a5('0x37')]=_[_0xc6a5('0x38')](_0x659823['model'],_0x659823['query']);_0x2869b7[_0xc6a5('0x39')]=_[_0xc6a5('0x38')](_0x659823[_0xc6a5('0x34')],qs[_0xc6a5('0x3a')](_0x3e85f7['query'][_0xc6a5('0x3a')]));_0x2869b7[_0xc6a5('0x39')]=_0x2869b7[_0xc6a5('0x39')][_0xc6a5('0x3b')]?_0x2869b7[_0xc6a5('0x39')]:_0x659823[_0xc6a5('0x34')];if(_0x3e85f7[_0xc6a5('0x35')][_0xc6a5('0x4b')]){_0x2869b7[_0xc6a5('0x45')]=[{'all':!![]}];}_0x2869b7=_[_0xc6a5('0x42')]({},_0x2869b7,_0x3e85f7['options']);return db['VoicePrefix'][_0xc6a5('0x4c')](_0x2869b7)['then'](handleEntityNotFound(_0xd4e79,null))[_0xc6a5('0x28')](respondWithResult(_0xd4e79,null))[_0xc6a5('0x48')](handleError(_0xd4e79,null));};exports['destroy']=function(_0x1acce6,_0x4fbace){return db[_0xc6a5('0x44')][_0xc6a5('0x4c')]({'where':{'id':_0x1acce6[_0xc6a5('0x4a')]['id']}})[_0xc6a5('0x28')](handleEntityNotFound(_0x4fbace,null))[_0xc6a5('0x28')](removeEntity(_0x4fbace,null))[_0xc6a5('0x48')](handleError(_0x4fbace,null));};exports[_0xc6a5('0x4d')]=function(_0x1730fc,_0x437f0b){return db[_0xc6a5('0x44')][_0xc6a5('0x4d')]()[_0xc6a5('0x28')](respondWithResult(_0x437f0b,null))['catch'](handleError(_0x437f0b,null));};exports[_0xc6a5('0x4e')]=function(_0x6c0b6b,_0x2496c2){var _0x2bd64c;return db[_0xc6a5('0x4f')][_0xc6a5('0x50')](function(_0x1c68d6){return db[_0xc6a5('0x44')][_0xc6a5('0x4e')](_0x6c0b6b['body'],{'transaction':_0x1c68d6})[_0xc6a5('0x28')](function(_0x3b8deb){_0x2bd64c=_0x3b8deb['get']({'plain':!![]});return db[_0xc6a5('0x51')][_0xc6a5('0x4c')]({'where':{'id':_0x2bd64c[_0xc6a5('0x52')]},'raw':!![]})[_0xc6a5('0x28')](function(_0x4d8e71){return createVoicePrefixExtensions(_0x2bd64c,_0x4d8e71,_0x1c68d6);});});})['then'](function(){var _0x2a798c=_0x6c0b6b[_0xc6a5('0x53')][_0xc6a5('0x29')]({'plain':!![]});if(!_0x2a798c)throw new Error(_0xc6a5('0x54'));if(_0x2a798c['role']==='user'){var _0x160f70=_0x2bd64c;return db['UserProfileSection']['find']({'where':{'name':_0xc6a5('0x2a'),'userProfileId':_0x2a798c[_0xc6a5('0x55')]},'raw':!![]})[_0xc6a5('0x28')](function(_0x522741){if(_0x522741&&_0x522741[_0xc6a5('0x56')]===0x0){return db[_0xc6a5('0x57')][_0xc6a5('0x4e')]({'name':_0x160f70['name'],'resourceId':_0x160f70['id'],'type':_0x522741['name'],'sectionId':_0x522741['id']},{})[_0xc6a5('0x28')](function(){return _0x2bd64c;});}else{return _0x2bd64c;}})[_0xc6a5('0x48')](function(_0x276829){logger[_0xc6a5('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x276829);throw _0x276829;});}return _0x2bd64c;})[_0xc6a5('0x28')](respondWithResult(_0x2496c2,null))[_0xc6a5('0x48')](handleError(_0x2496c2,null));};function Extension(_0x113e43,_0x3ac204,_0x2e4950,_0x45b078){this[_0xc6a5('0x58')]=_0xc6a5('0x59');this[_0xc6a5('0x5a')]=_0x113e43;this['app']=_0x2e4950;this['type']=_0xc6a5('0x5b');this[_0xc6a5('0x5c')]=_0xc6a5('0x5d');this['priority']=_0x3ac204;this[_0xc6a5('0x5e')]=_0x45b078;}function createVoicePrefixExtensions(_0x1651ab,_0x2d4265,_0x171c4b){return new BPromise(function(_0x101663,_0x529862){var _0x3cb5f9=new Extension(formatPrefixName(_0x1651ab[_0xc6a5('0x5f')]),0x1,_0xc6a5('0x60'),_0xc6a5('0x61'));_0x3cb5f9[_0xc6a5('0x62')]=_0x1651ab['id'];return db[_0xc6a5('0x51')][_0xc6a5('0x4e')](_0x3cb5f9,{'transaction':_0x171c4b})[_0xc6a5('0x28')](function(_0x16ffca){var _0x10fa32=_0x16ffca[_0xc6a5('0x29')]({'plain':!![]});var _0x26b9d9=_[_0xc6a5('0x31')](addVoicePrefixExtensions(_0x1651ab,_0x2d4265),function(_0x31795a){_0x31795a[_0xc6a5('0x52')]=_0x10fa32['id'];_0x31795a['VoicePrefixId']=_0x1651ab['id'];return _0x31795a;});return db['VoiceExtension'][_0xc6a5('0x63')](_0x26b9d9,{'transaction':_0x171c4b})['then'](function(_0x4db184){if(!_0x4db184){return _0x529862(_0xc6a5('0x64'));}else{return _0x101663(_0x4db184);}})[_0xc6a5('0x48')](function(_0x32b2e2){return _0x529862(_0x32b2e2);});});;});};function addVoicePrefixExtensions(_0x20dcca,_0x26fce0){var _0x117b55=[];var _0x2bc22f=formatPrefixName(_0x20dcca[_0xc6a5('0x5f')]);_0x117b55[_0xc6a5('0x65')](new Extension(_0x2bc22f,0x2,_0xc6a5('0x66'),_0xc6a5('0x67')+_0x20dcca['name']));if(_0x20dcca['callerIdAll']){_0x117b55[_0xc6a5('0x65')](new Extension(_0x2bc22f,0x3,_0xc6a5('0x66'),'PREFIX-CALLERIDALL='+_0x20dcca['callerIdAll']));}else{_0x117b55[_0xc6a5('0x65')](new Extension(_0x2bc22f,0x3,_0xc6a5('0x60'),'No\x20callerid\x20available'));}_0x117b55[_0xc6a5('0x65')](new Extension(_0x2bc22f,0x4,'goto',_0x26fce0['context']+','+_0xc6a5('0x68')+(0x8+_0x20dcca[_0xc6a5('0x2e')]['length'])+'}'+','+0x1));return _0x117b55;}function formatPrefixName(_0x2b940b){var _0x1127d6='_';for(var _0x5d5cd6=0x0;_0x5d5cd6<_0x2b940b[_0xc6a5('0x3b')];_0x5d5cd6++){if(_0x2b940b['charAt'](_0x5d5cd6)=='-'){_0x1127d6+=_0x2b940b[_0xc6a5('0x69')](_0x5d5cd6);}else{_0x1127d6+='['+_0x2b940b[_0xc6a5('0x69')](_0x5d5cd6)+']';}}_0x1127d6+='.';return _0x1127d6;}exports[_0xc6a5('0x27')]=function(_0x51cf1d,_0x3771aa,_0x11208a){var _0x47d77e=_0x51cf1d[_0xc6a5('0x6a')];_0x47d77e[_0xc6a5('0x5f')]=_0xc6a5('0x6b')+_0x47d77e[_0xc6a5('0x2e')]+'-';return db[_0xc6a5('0x4f')][_0xc6a5('0x50')](function(_0x31b2e2){return db[_0xc6a5('0x44')][_0xc6a5('0x27')](_0x47d77e,{'where':{'id':_0x47d77e['id']},'transaction':_0x31b2e2})[_0xc6a5('0x28')](function(){return db[_0xc6a5('0x51')][_0xc6a5('0x2b')]({'where':{'VoicePrefixId':_0x47d77e['id']},'transaction':_0x31b2e2})[_0xc6a5('0x28')](function(){return db[_0xc6a5('0x51')][_0xc6a5('0x4c')]({'where':{'id':_0x47d77e[_0xc6a5('0x52')]},'raw':!![]})['then'](function(_0xdc230d){return createVoicePrefixExtensions(_0x47d77e,_0xdc230d,_0x31b2e2);});});});})[_0xc6a5('0x28')](function(){return db[_0xc6a5('0x44')][_0xc6a5('0x6c')](_0x47d77e['id']);})[_0xc6a5('0x28')](respondWithResult(_0x3771aa,null))['catch'](handleError(_0x3771aa,null));};exports[_0xc6a5('0x6d')]=function(_0x2ed1f7,_0x54eddd,_0x3172e1){return db[_0xc6a5('0x44')][_0xc6a5('0x4c')]({'where':{'id':_0x2ed1f7['params']['id']}})[_0xc6a5('0x28')](handleEntityNotFound(_0x54eddd,null))[_0xc6a5('0x28')](function(_0x16410d){if(_0x16410d){return _0x16410d[_0xc6a5('0x6d')](_0x2ed1f7[_0xc6a5('0x6a')][_0xc6a5('0x6e')],_[_0xc6a5('0x6f')](_0x2ed1f7[_0xc6a5('0x6a')],['ids','id'])||{})['spread'](function(_0x9af71e){for(var _0x4d228b=0x0;_0x4d228b<_0x2ed1f7['body'][_0xc6a5('0x6e')][_0xc6a5('0x3b')];_0x4d228b+=0x1){socket[_0xc6a5('0x70')](_0xc6a5('0x71'),{'UserId':_0x2ed1f7[_0xc6a5('0x6a')][_0xc6a5('0x6e')][_0x4d228b],'VoicePrefixId':_0x2ed1f7[_0xc6a5('0x4a')]['id']});}return _0x9af71e;});}})[_0xc6a5('0x28')](respondWithResult(_0x54eddd,null))['catch'](handleError(_0x54eddd,null));};exports[_0xc6a5('0x72')]=function(_0x4d1e58,_0x444648,_0x87afbd){return db[_0xc6a5('0x44')][_0xc6a5('0x4c')]({'where':{'id':_0x4d1e58[_0xc6a5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x444648,null))[_0xc6a5('0x28')](function(_0x11436b){if(_0x11436b){return _0x11436b[_0xc6a5('0x72')](_0x4d1e58[_0xc6a5('0x35')][_0xc6a5('0x6e')])[_0xc6a5('0x28')](function(){if(_[_0xc6a5('0x73')](_0x4d1e58[_0xc6a5('0x35')][_0xc6a5('0x6e')])){for(var _0x33e111=0x0;_0x33e111<_0x4d1e58[_0xc6a5('0x35')]['ids'][_0xc6a5('0x3b')];_0x33e111+=0x1){socket[_0xc6a5('0x70')](_0xc6a5('0x74'),{'UserId':Number(_0x4d1e58[_0xc6a5('0x35')][_0xc6a5('0x6e')][_0x33e111]),'VoicePrefixId':Number(_0x4d1e58[_0xc6a5('0x4a')]['id'])});}}else{socket[_0xc6a5('0x70')](_0xc6a5('0x74'),{'UserId':Number(_0x4d1e58[_0xc6a5('0x35')][_0xc6a5('0x6e')]),'VoicePrefixId':Number(_0x4d1e58[_0xc6a5('0x4a')]['id'])});}});}})[_0xc6a5('0x28')](respondWithStatusCode(_0x444648,null))[_0xc6a5('0x48')](handleError(_0x444648,null));};exports[_0xc6a5('0x75')]=function(_0x3e81bb,_0x7dc1bc,_0x18dc38){var _0x3f41ce={};var _0x27781a={};var _0x3ea507;var _0x473d9c;return db[_0xc6a5('0x44')][_0xc6a5('0x76')]({'where':{'id':_0x3e81bb[_0xc6a5('0x4a')]['id']}})[_0xc6a5('0x28')](handleEntityNotFound(_0x7dc1bc,null))['then'](function(_0x2b6a9f){if(_0x2b6a9f){_0x3ea507=_0x2b6a9f;_0x27781a[_0xc6a5('0x34')]=_['keys'](db[_0xc6a5('0x77')][_0xc6a5('0x32')]);_0x27781a[_0xc6a5('0x35')]=_[_0xc6a5('0x36')](_0x3e81bb[_0xc6a5('0x35')]);_0x27781a['filters']=_['intersection'](_0x27781a[_0xc6a5('0x34')],_0x27781a[_0xc6a5('0x35')]);_0x3f41ce[_0xc6a5('0x39')]=_[_0xc6a5('0x38')](_0x27781a[_0xc6a5('0x34')],qs['fields'](_0x3e81bb[_0xc6a5('0x35')][_0xc6a5('0x3a')]));_0x3f41ce[_0xc6a5('0x39')]=_0x3f41ce[_0xc6a5('0x39')]['length']?_0x3f41ce['attributes']:_0x27781a[_0xc6a5('0x34')];_0x3f41ce[_0xc6a5('0x78')]=qs[_0xc6a5('0x3d')](_0x3e81bb['query'][_0xc6a5('0x3d')]);_0x3f41ce[_0xc6a5('0x3f')]=qs[_0xc6a5('0x37')](_['pick'](_0x3e81bb[_0xc6a5('0x35')],_0x27781a[_0xc6a5('0x37')]));if(_0x3e81bb[_0xc6a5('0x35')][_0xc6a5('0x41')]){_0x3f41ce[_0xc6a5('0x3f')]=_[_0xc6a5('0x42')](_0x3f41ce[_0xc6a5('0x3f')],{'$or':_[_0xc6a5('0x31')](_0x3f41ce['attributes'],function(_0x19dace){var _0x3f9275={};_0x3f9275[_0x19dace]={'$like':'%'+_0x3e81bb['query']['filter']+'%'};return _0x3f9275;})});}_0x3f41ce=_[_0xc6a5('0x42')]({},_0x3f41ce,_0x3e81bb[_0xc6a5('0x43')]);return _0x3ea507[_0xc6a5('0x75')](_0x3f41ce);}})[_0xc6a5('0x28')](function(_0xee8e5){if(_0xee8e5){_0x473d9c=_0xee8e5[_0xc6a5('0x3b')];if(!_0x3e81bb[_0xc6a5('0x35')]['hasOwnProperty'](_0xc6a5('0x79'))){_0x3f41ce[_0xc6a5('0x22')]=qs[_0xc6a5('0x22')](_0x3e81bb['query']['limit']);_0x3f41ce['offset']=qs[_0xc6a5('0x21')](_0x3e81bb[_0xc6a5('0x35')][_0xc6a5('0x21')]);}return _0x3ea507[_0xc6a5('0x75')](_0x3f41ce);}})[_0xc6a5('0x28')](function(_0x2e6a82){if(_0x2e6a82){return _0x2e6a82?{'count':_0x473d9c,'rows':_0x2e6a82}:null;}})[_0xc6a5('0x28')](respondWithResult(_0x7dc1bc,null))['catch'](handleError(_0x7dc1bc,null));};
\ No newline at end of file
+var _0x369d=['lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','VoicePrefixes','UserProfileResource','error','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','VoicePrefix','length','find','catch','describe','create','transaction','body','get','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','userProfileId','autoAssociation','exten','app','description','appdata','prefix','VoicePrefixId','bulkCreate','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','sequelize','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','getAgents','findOne','User','rawAttributes','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x2623b2,_0x3a74f9){var _0x556fb0=function(_0x2beb2d){while(--_0x2beb2d){_0x2623b2['push'](_0x2623b2['shift']());}};_0x556fb0(++_0x3a74f9);}(_0x369d,0x1d1));var _0xd369=function(_0x10ed05,_0x422d32){_0x10ed05=_0x10ed05-0x0;var _0x23c7b8=_0x369d[_0x10ed05];return _0x23c7b8;};'use strict';var pdf=require(_0xd369('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd369('0x1'));var zipdir=require(_0xd369('0x2'));var jsonpatch=require(_0xd369('0x3'));var rp=require(_0xd369('0x4'));var moment=require(_0xd369('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd369('0x6'));var util=require(_0xd369('0x7'));var path=require(_0xd369('0x8'));var sox=require(_0xd369('0x9'));var csv=require(_0xd369('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd369('0xb'));var squel=require(_0xd369('0xc'));var crypto=require(_0xd369('0xd'));var jsforce=require(_0xd369('0xe'));var deskjs=require(_0xd369('0xf'));var toCsv=require(_0xd369('0xa'));var querystring=require('querystring');var Papa=require(_0xd369('0x10'));var Redis=require('ioredis');var authService=require(_0xd369('0x11'));var qs=require(_0xd369('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd369('0x13'))(_0xd369('0x14'));var utils=require(_0xd369('0x15'));var config=require('../../config/environment');var db=require(_0xd369('0x16'))['db'];config[_0xd369('0x17')]=_[_0xd369('0x18')](config[_0xd369('0x17')],{'host':_0xd369('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x4f6afd,_0x2b712){_0x2b712=_0x2b712||0xcc;return function(_0xc85839){if(_0xc85839){return _0x4f6afd[_0xd369('0x1a')](_0x2b712);}return _0x4f6afd[_0xd369('0x1b')](_0x2b712)[_0xd369('0x1c')]();};}function respondWithResult(_0x4cb063,_0x4acf75){_0x4acf75=_0x4acf75||0xc8;return function(_0x2e01dd){if(_0x2e01dd){return _0x4cb063[_0xd369('0x1b')](_0x4acf75)[_0xd369('0x1d')](_0x2e01dd);}};}function respondWithFilteredResult(_0x11b13f,_0x3536e4){return function(_0x2fe8c8){if(_0x2fe8c8){var _0x151ba4=_0x2fe8c8[_0xd369('0x1e')],_0x2b9af5=_0x3536e4[_0xd369('0x1f')],_0x1f9cb3=_0x3536e4[_0xd369('0x1f')]+_0x3536e4[_0xd369('0x20')],_0xbbfa03;if(_0x1f9cb3>=_0x151ba4){_0x1f9cb3=_0x151ba4;_0xbbfa03=0xc8;}else{_0xbbfa03=0xce;}_0x11b13f[_0xd369('0x1b')](_0xbbfa03);return _0x11b13f['set'](_0xd369('0x21'),_0x2b9af5+'-'+_0x1f9cb3+'/'+_0x151ba4)[_0xd369('0x1d')](_0x2fe8c8);}return null;};}function patchUpdates(_0x934d9b){return function(_0x5821b8){try{jsonpatch['apply'](_0x5821b8,_0x934d9b,!![]);}catch(_0x46ea74){return BPromise[_0xd369('0x22')](_0x46ea74);}return _0x5821b8[_0xd369('0x23')]();};}function saveUpdates(_0x503820,_0x5ab6c7){return function(_0x37d966){if(_0x37d966){return _0x37d966[_0xd369('0x24')](_0x503820)[_0xd369('0x25')](function(_0x30a936){return _0x30a936;});}return null;};}function removeEntity(_0x15f582,_0x39d85d){return function(_0x3438eb){if(_0x3438eb){return _0x3438eb[_0xd369('0x26')]()[_0xd369('0x25')](function(){var _0x185afe=_0x3438eb['get']({'plain':!![]});var _0x4864e5=_0xd369('0x27');return db[_0xd369('0x28')]['destroy']({'where':{'type':_0x4864e5,'resourceId':_0x185afe['id']}})[_0xd369('0x25')](function(){return _0x3438eb;});})['then'](function(){_0x15f582[_0xd369('0x1b')](0xcc)[_0xd369('0x1c')]();});}};}function handleEntityNotFound(_0x268702,_0x21d72b){return function(_0x16a337){if(!_0x16a337){_0x268702['sendStatus'](0x194);}return _0x16a337;};}function handleError(_0x39e024,_0x154fbf){_0x154fbf=_0x154fbf||0x1f4;return function(_0x19ac8f){logger[_0xd369('0x29')](_0x19ac8f['stack']);if(_0x19ac8f[_0xd369('0x2a')]){delete _0x19ac8f['name'];}_0x39e024['status'](_0x154fbf)[_0xd369('0x2b')](_0x19ac8f);};}exports[_0xd369('0x2c')]=function(_0x4cccc9,_0x24a69e){var _0x52314c={},_0x200b0d={},_0x53ac1c={'count':0x0,'rows':[]};var _0x1052f6=_[_0xd369('0x2d')](db['VoicePrefix']['rawAttributes'],function(_0x340bb7){return{'name':_0x340bb7[_0xd369('0x2e')],'type':_0x340bb7[_0xd369('0x2f')][_0xd369('0x30')]};});_0x200b0d[_0xd369('0x31')]=_[_0xd369('0x2d')](_0x1052f6,'name');_0x200b0d['query']=_[_0xd369('0x32')](_0x4cccc9[_0xd369('0x33')]);_0x200b0d[_0xd369('0x34')]=_[_0xd369('0x35')](_0x200b0d[_0xd369('0x31')],_0x200b0d['query']);_0x52314c[_0xd369('0x36')]=_[_0xd369('0x35')](_0x200b0d['model'],qs[_0xd369('0x37')](_0x4cccc9[_0xd369('0x33')][_0xd369('0x37')]));_0x52314c[_0xd369('0x36')]=_0x52314c[_0xd369('0x36')]['length']?_0x52314c['attributes']:_0x200b0d[_0xd369('0x31')];if(!_0x4cccc9[_0xd369('0x33')][_0xd369('0x38')](_0xd369('0x39'))){_0x52314c[_0xd369('0x20')]=qs[_0xd369('0x20')](_0x4cccc9[_0xd369('0x33')][_0xd369('0x20')]);_0x52314c['offset']=qs[_0xd369('0x1f')](_0x4cccc9[_0xd369('0x33')][_0xd369('0x1f')]);}_0x52314c['order']=qs[_0xd369('0x3a')](_0x4cccc9['query'][_0xd369('0x3a')]);_0x52314c[_0xd369('0x3b')]=qs['filters'](_[_0xd369('0x3c')](_0x4cccc9[_0xd369('0x33')],_0x200b0d[_0xd369('0x34')]),_0x1052f6);if(_0x4cccc9['query'][_0xd369('0x3d')]){_0x52314c['where']=_[_0xd369('0x3e')](_0x52314c[_0xd369('0x3b')],{'$or':_[_0xd369('0x2d')](_0x1052f6,function(_0x1472cf){if(_0x1472cf['type']!==_0xd369('0x3f')){var _0x6a39fb={};_0x6a39fb[_0x1472cf[_0xd369('0x2a')]]={'$like':'%'+_0x4cccc9[_0xd369('0x33')][_0xd369('0x3d')]+'%'};return _0x6a39fb;}})});}_0x52314c=_[_0xd369('0x3e')]({},_0x52314c,_0x4cccc9[_0xd369('0x40')]);var _0xc5e426={'where':_0x52314c[_0xd369('0x3b')]};return db['VoicePrefix'][_0xd369('0x1e')](_0xc5e426)[_0xd369('0x25')](function(_0xf1cbc4){_0x53ac1c[_0xd369('0x1e')]=_0xf1cbc4;if(_0x4cccc9[_0xd369('0x33')][_0xd369('0x41')]){_0x52314c[_0xd369('0x42')]=[{'all':!![]}];}return db['VoicePrefix'][_0xd369('0x43')](_0x52314c);})['then'](function(_0x5aff8a){_0x53ac1c[_0xd369('0x44')]=_0x5aff8a;return _0x53ac1c;})['then'](respondWithFilteredResult(_0x24a69e,_0x52314c))['catch'](handleError(_0x24a69e,null));};exports[_0xd369('0x45')]=function(_0x3acb47,_0x27cd3f){var _0x24a532={'raw':![],'where':{'id':_0x3acb47[_0xd369('0x46')]['id']}},_0x18c631={};_0x18c631[_0xd369('0x31')]=_[_0xd369('0x32')](db[_0xd369('0x47')]['rawAttributes']);_0x18c631['query']=_[_0xd369('0x32')](_0x3acb47[_0xd369('0x33')]);_0x18c631['filters']=_['intersection'](_0x18c631[_0xd369('0x31')],_0x18c631[_0xd369('0x33')]);_0x24a532[_0xd369('0x36')]=_[_0xd369('0x35')](_0x18c631[_0xd369('0x31')],qs['fields'](_0x3acb47[_0xd369('0x33')][_0xd369('0x37')]));_0x24a532['attributes']=_0x24a532['attributes'][_0xd369('0x48')]?_0x24a532[_0xd369('0x36')]:_0x18c631['model'];if(_0x3acb47[_0xd369('0x33')][_0xd369('0x41')]){_0x24a532[_0xd369('0x42')]=[{'all':!![]}];}_0x24a532=_[_0xd369('0x3e')]({},_0x24a532,_0x3acb47['options']);return db[_0xd369('0x47')][_0xd369('0x49')](_0x24a532)[_0xd369('0x25')](handleEntityNotFound(_0x27cd3f,null))[_0xd369('0x25')](respondWithResult(_0x27cd3f,null))[_0xd369('0x4a')](handleError(_0x27cd3f,null));};exports[_0xd369('0x26')]=function(_0x30fa9f,_0x17628d){return db['VoicePrefix'][_0xd369('0x49')]({'where':{'id':_0x30fa9f[_0xd369('0x46')]['id']}})['then'](handleEntityNotFound(_0x17628d,null))[_0xd369('0x25')](removeEntity(_0x17628d,null))[_0xd369('0x4a')](handleError(_0x17628d,null));};exports[_0xd369('0x4b')]=function(_0x4c8bae,_0x4978d5){return db[_0xd369('0x47')][_0xd369('0x4b')]()[_0xd369('0x25')](respondWithResult(_0x4978d5,null))['catch'](handleError(_0x4978d5,null));};exports[_0xd369('0x4c')]=function(_0x43785b,_0x385d28){var _0x208adb;return db['sequelize'][_0xd369('0x4d')](function(_0x21c228){return db[_0xd369('0x47')][_0xd369('0x4c')](_0x43785b[_0xd369('0x4e')],{'transaction':_0x21c228})[_0xd369('0x25')](function(_0x32b55e){_0x208adb=_0x32b55e[_0xd369('0x4f')]({'plain':!![]});return db[_0xd369('0x50')][_0xd369('0x49')]({'where':{'id':_0x208adb[_0xd369('0x51')]},'raw':!![]})[_0xd369('0x25')](function(_0x336880){return createVoicePrefixExtensions(_0x208adb,_0x336880,_0x21c228);});});})[_0xd369('0x25')](function(){var _0xf61c1b=_0x43785b[_0xd369('0x52')][_0xd369('0x4f')]({'plain':!![]});if(!_0xf61c1b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf61c1b[_0xd369('0x53')]===_0xd369('0x52')){var _0x3e9fb1=_0x208adb;return db[_0xd369('0x54')][_0xd369('0x49')]({'where':{'name':_0xd369('0x27'),'userProfileId':_0xf61c1b[_0xd369('0x55')]},'raw':!![]})[_0xd369('0x25')](function(_0x16d8ac){if(_0x16d8ac&&_0x16d8ac[_0xd369('0x56')]===0x0){return db['UserProfileResource'][_0xd369('0x4c')]({'name':_0x3e9fb1[_0xd369('0x2a')],'resourceId':_0x3e9fb1['id'],'type':_0x16d8ac[_0xd369('0x2a')],'sectionId':_0x16d8ac['id']},{})[_0xd369('0x25')](function(){return _0x208adb;});}else{return _0x208adb;}})[_0xd369('0x4a')](function(_0x37e428){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37e428);throw _0x37e428;});}return _0x208adb;})['then'](respondWithResult(_0x385d28,null))[_0xd369('0x4a')](handleError(_0x385d28,null));};function Extension(_0x37d8fd,_0x18b326,_0x3c9795,_0x208fee){this['context']='from-sip';this[_0xd369('0x57')]=_0x37d8fd;this[_0xd369('0x58')]=_0x3c9795;this[_0xd369('0x2f')]='system';this[_0xd369('0x59')]='Voice\x20Prefix\x20Extension';this['priority']=_0x18b326;this[_0xd369('0x5a')]=_0x208fee;}function createVoicePrefixExtensions(_0x3a84fe,_0x54bae0,_0x28fabd){return new BPromise(function(_0x5b07cd,_0x2f92b4){var _0xde0b54=new Extension(formatPrefixName(_0x3a84fe[_0xd369('0x5b')]),0x1,'NoOp','Voice\x20Prefix');_0xde0b54[_0xd369('0x5c')]=_0x3a84fe['id'];return db[_0xd369('0x50')][_0xd369('0x4c')](_0xde0b54,{'transaction':_0x28fabd})[_0xd369('0x25')](function(_0x192fa6){var _0x2f383b=_0x192fa6['get']({'plain':!![]});var _0x5327c1=_[_0xd369('0x2d')](addVoicePrefixExtensions(_0x3a84fe,_0x54bae0),function(_0x17e7d9){_0x17e7d9['VoiceExtensionId']=_0x2f383b['id'];_0x17e7d9[_0xd369('0x5c')]=_0x3a84fe['id'];return _0x17e7d9;});return db[_0xd369('0x50')][_0xd369('0x5d')](_0x5327c1,{'transaction':_0x28fabd})['then'](function(_0x14a730){if(!_0x14a730){return _0x2f92b4('Extensions\x20creation\x20failed');}else{return _0x5b07cd(_0x14a730);}})[_0xd369('0x4a')](function(_0x44b18d){return _0x2f92b4(_0x44b18d);});});;});};function addVoicePrefixExtensions(_0xbcecd6,_0x5cb4c2){var _0x14c44f=[];var _0x17819e=formatPrefixName(_0xbcecd6[_0xd369('0x5b')]);_0x14c44f['push'](new Extension(_0x17819e,0x2,_0xd369('0x5e'),_0xd369('0x5f')+_0xbcecd6[_0xd369('0x2a')]));if(_0xbcecd6[_0xd369('0x60')]){_0x14c44f[_0xd369('0x61')](new Extension(_0x17819e,0x3,_0xd369('0x5e'),_0xd369('0x62')+_0xbcecd6[_0xd369('0x60')]));}else{_0x14c44f[_0xd369('0x61')](new Extension(_0x17819e,0x3,_0xd369('0x63'),_0xd369('0x64')));}_0x14c44f[_0xd369('0x61')](new Extension(_0x17819e,0x4,_0xd369('0x65'),_0x5cb4c2['context']+','+_0xd369('0x66')+(0x8+_0xbcecd6[_0xd369('0x2a')][_0xd369('0x48')])+'}'+','+0x1));return _0x14c44f;}function formatPrefixName(_0x51889b){var _0x55d0f1='_';for(var _0x222336=0x0;_0x222336<_0x51889b['length'];_0x222336++){if(_0x51889b['charAt'](_0x222336)=='-'){_0x55d0f1+=_0x51889b[_0xd369('0x67')](_0x222336);}else{_0x55d0f1+='['+_0x51889b[_0xd369('0x67')](_0x222336)+']';}}_0x55d0f1+='.';return _0x55d0f1;}exports['update']=function(_0x2e18db,_0x3b60b1,_0x1b2ac6){var _0x138f8f=_0x2e18db[_0xd369('0x4e')];_0x138f8f[_0xd369('0x5b')]=_0xd369('0x68')+_0x138f8f['name']+'-';return db[_0xd369('0x69')][_0xd369('0x4d')](function(_0x5ce775){return db['VoicePrefix'][_0xd369('0x24')](_0x138f8f,{'where':{'id':_0x138f8f['id']},'transaction':_0x5ce775})['then'](function(){return db[_0xd369('0x50')][_0xd369('0x26')]({'where':{'VoicePrefixId':_0x138f8f['id']},'transaction':_0x5ce775})[_0xd369('0x25')](function(){return db[_0xd369('0x50')][_0xd369('0x49')]({'where':{'id':_0x138f8f[_0xd369('0x51')]},'raw':!![]})['then'](function(_0x383625){return createVoicePrefixExtensions(_0x138f8f,_0x383625,_0x5ce775);});});});})[_0xd369('0x25')](function(){return db['VoicePrefix'][_0xd369('0x6a')](_0x138f8f['id']);})[_0xd369('0x25')](respondWithResult(_0x3b60b1,null))[_0xd369('0x4a')](handleError(_0x3b60b1,null));};exports[_0xd369('0x6b')]=function(_0xa5690d,_0x573a0f,_0x392e46){return db['VoicePrefix']['find']({'where':{'id':_0xa5690d[_0xd369('0x46')]['id']}})[_0xd369('0x25')](handleEntityNotFound(_0x573a0f,null))[_0xd369('0x25')](function(_0x3666fb){if(_0x3666fb){return _0x3666fb[_0xd369('0x6b')](_0xa5690d['body'][_0xd369('0x6c')],_[_0xd369('0x6d')](_0xa5690d[_0xd369('0x4e')],['ids','id'])||{})[_0xd369('0x6e')](function(_0x1d0ae8){for(var _0x276d6a=0x0;_0x276d6a<_0xa5690d[_0xd369('0x4e')][_0xd369('0x6c')][_0xd369('0x48')];_0x276d6a+=0x1){socket[_0xd369('0x6f')](_0xd369('0x70'),{'UserId':_0xa5690d['body'][_0xd369('0x6c')][_0x276d6a],'VoicePrefixId':_0xa5690d[_0xd369('0x46')]['id']});}return _0x1d0ae8;});}})['then'](respondWithResult(_0x573a0f,null))[_0xd369('0x4a')](handleError(_0x573a0f,null));};exports[_0xd369('0x71')]=function(_0x28a700,_0x45f2a7,_0x2a14e2){return db['VoicePrefix']['find']({'where':{'id':_0x28a700[_0xd369('0x46')]['id']}})[_0xd369('0x25')](handleEntityNotFound(_0x45f2a7,null))[_0xd369('0x25')](function(_0x1eee0d){if(_0x1eee0d){return _0x1eee0d['removeAgents'](_0x28a700[_0xd369('0x33')]['ids'])['then'](function(){if(_[_0xd369('0x72')](_0x28a700[_0xd369('0x33')][_0xd369('0x6c')])){for(var _0x487a88=0x0;_0x487a88<_0x28a700[_0xd369('0x33')][_0xd369('0x6c')][_0xd369('0x48')];_0x487a88+=0x1){socket[_0xd369('0x6f')]('userVoicePrefix:remove',{'UserId':Number(_0x28a700['query'][_0xd369('0x6c')][_0x487a88]),'VoicePrefixId':Number(_0x28a700[_0xd369('0x46')]['id'])});}}else{socket[_0xd369('0x6f')]('userVoicePrefix:remove',{'UserId':Number(_0x28a700['query']['ids']),'VoicePrefixId':Number(_0x28a700[_0xd369('0x46')]['id'])});}});}})[_0xd369('0x25')](respondWithStatusCode(_0x45f2a7,null))[_0xd369('0x4a')](handleError(_0x45f2a7,null));};exports[_0xd369('0x73')]=function(_0xd1a501,_0x17b23e,_0x548012){var _0x228043={};var _0x1defee={};var _0x116bd6;var _0x2a516b;return db[_0xd369('0x47')][_0xd369('0x74')]({'where':{'id':_0xd1a501[_0xd369('0x46')]['id']}})[_0xd369('0x25')](handleEntityNotFound(_0x17b23e,null))[_0xd369('0x25')](function(_0x1f67ae){if(_0x1f67ae){_0x116bd6=_0x1f67ae;_0x1defee['model']=_['keys'](db[_0xd369('0x75')][_0xd369('0x76')]);_0x1defee[_0xd369('0x33')]=_[_0xd369('0x32')](_0xd1a501['query']);_0x1defee[_0xd369('0x34')]=_[_0xd369('0x35')](_0x1defee['model'],_0x1defee['query']);_0x228043[_0xd369('0x36')]=_[_0xd369('0x35')](_0x1defee[_0xd369('0x31')],qs[_0xd369('0x37')](_0xd1a501[_0xd369('0x33')][_0xd369('0x37')]));_0x228043[_0xd369('0x36')]=_0x228043[_0xd369('0x36')][_0xd369('0x48')]?_0x228043[_0xd369('0x36')]:_0x1defee[_0xd369('0x31')];_0x228043['order']=qs[_0xd369('0x3a')](_0xd1a501['query'][_0xd369('0x3a')]);_0x228043[_0xd369('0x3b')]=qs[_0xd369('0x34')](_['pick'](_0xd1a501['query'],_0x1defee[_0xd369('0x34')]));if(_0xd1a501[_0xd369('0x33')]['filter']){_0x228043[_0xd369('0x3b')]=_[_0xd369('0x3e')](_0x228043[_0xd369('0x3b')],{'$or':_['map'](_0x228043[_0xd369('0x36')],function(_0x607d76){var _0x6c25f5={};_0x6c25f5[_0x607d76]={'$like':'%'+_0xd1a501[_0xd369('0x33')][_0xd369('0x3d')]+'%'};return _0x6c25f5;})});}_0x228043=_[_0xd369('0x3e')]({},_0x228043,_0xd1a501[_0xd369('0x40')]);return _0x116bd6[_0xd369('0x73')](_0x228043);}})[_0xd369('0x25')](function(_0x384beb){if(_0x384beb){_0x2a516b=_0x384beb['length'];if(!_0xd1a501[_0xd369('0x33')][_0xd369('0x38')]('nolimit')){_0x228043['limit']=qs[_0xd369('0x20')](_0xd1a501[_0xd369('0x33')][_0xd369('0x20')]);_0x228043[_0xd369('0x1f')]=qs[_0xd369('0x1f')](_0xd1a501['query'][_0xd369('0x1f')]);}return _0x116bd6[_0xd369('0x73')](_0x228043);}})['then'](function(_0x1bc4ab){if(_0x1bc4ab){return _0x1bc4ab?{'count':_0x2a516b,'rows':_0x1bc4ab}:null;}})[_0xd369('0x25')](respondWithResult(_0x17b23e,null))[_0xd369('0x4a')](handleError(_0x17b23e,null));};
\ No newline at end of file
index 4898d82..5feb696 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x3b3ca5,_0x294c71){var _0x168567=function(_0x2b4066){while(--_0x2b4066){_0x3b3ca5['push'](_0x3b3ca5['shift']());}};_0x168567(++_0x294c71);}(_0x008c,0x188));var _0xc008=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0x008c[_0xbec8e6];return _0x4aa6f2;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoicePrefix=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoicePrefixEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoicePrefixEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoicePrefix[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
+var _0x70e0=['emit','events','../../mysqldb','VoicePrefix','update','remove'];(function(_0x3acc9c,_0x5697a4){var _0x11df29=function(_0x42b0a6){while(--_0x42b0a6){_0x3acc9c['push'](_0x3acc9c['shift']());}};_0x11df29(++_0x5697a4);}(_0x70e0,0x17b));var _0x070e=function(_0x3bd4bc,_0x1f7767){_0x3bd4bc=_0x3bd4bc-0x0;var _0x52ec25=_0x70e0[_0x3bd4bc];return _0x52ec25;};'use strict';var EventEmitter=require(_0x070e('0x0'));var VoicePrefix=require(_0x070e('0x1'))['db'][_0x070e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x070e('0x3'),'afterDestroy':_0x070e('0x4')};function emitEvent(_0x277d32){return function(_0x2593e5,_0x5c90fc,_0x7bce9b){VoicePrefixEvents['emit'](_0x277d32+':'+_0x2593e5['id'],_0x2593e5);VoicePrefixEvents[_0x070e('0x5')](_0x277d32,_0x2593e5);_0x7bce9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
index 58a5d37..bb5744b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9075=['exports','define','VoicePrefix','voice_prefixes','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes'];(function(_0x1c9cfb,_0x4efc3b){var _0x32436a=function(_0x6836da){while(--_0x6836da){_0x1c9cfb['push'](_0x1c9cfb['shift']());}};_0x32436a(++_0x4efc3b);}(_0x9075,0x154));var _0x5907=function(_0x35a140,_0x3aeac6){_0x35a140=_0x35a140-0x0;var _0x30ab82=_0x9075[_0x35a140];return _0x30ab82;};'use strict';var _=require(_0x5907('0x0'));var util=require('util');var logger=require(_0x5907('0x1'))(_0x5907('0x2'));var moment=require(_0x5907('0x3'));var BPromise=require(_0x5907('0x4'));var rp=require(_0x5907('0x5'));var fs=require('fs');var path=require(_0x5907('0x6'));var rimraf=require(_0x5907('0x7'));var config=require(_0x5907('0x8'));var attributes=require(_0x5907('0x9'));module[_0x5907('0xa')]=function(_0x5e3035,_0x3d2ff2){return _0x5e3035[_0x5907('0xb')](_0x5907('0xc'),attributes,{'tableName':_0x5907('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a7e=['exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x20ee9b,_0x1e40a7){var _0x4b9e3b=function(_0x1d8c60){while(--_0x1d8c60){_0x20ee9b['push'](_0x20ee9b['shift']());}};_0x4b9e3b(++_0x1e40a7);}(_0x9a7e,0x12f));var _0xe9a7=function(_0x53413e,_0xf3c222){_0x53413e=_0x53413e-0x0;var _0x168e93=_0x9a7e[_0x53413e];return _0x168e93;};'use strict';var _=require(_0xe9a7('0x0'));var util=require(_0xe9a7('0x1'));var logger=require(_0xe9a7('0x2'))(_0xe9a7('0x3'));var moment=require(_0xe9a7('0x4'));var BPromise=require(_0xe9a7('0x5'));var rp=require(_0xe9a7('0x6'));var fs=require('fs');var path=require(_0xe9a7('0x7'));var rimraf=require('rimraf');var config=require(_0xe9a7('0x8'));var attributes=require('./voicePrefix.attributes');module[_0xe9a7('0x9')]=function(_0x1890a8,_0x1d1cee){return _0x1890a8[_0xe9a7('0xa')](_0xe9a7('0xb'),attributes,{'tableName':_0xe9a7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a9d076d..3268ba8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5fd=['http','redis','defaults','localhost','./voicePrefix.socket','request','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe5fd,0x161));var _0xde5f=function(_0x146831,_0x4ca380){_0x146831=_0x146831-0x0;var _0x21cc9b=_0xe5fd[_0x146831];return _0x21cc9b;};'use strict';var _=require(_0xde5f('0x0'));var util=require(_0xde5f('0x1'));var moment=require('moment');var BPromise=require(_0xde5f('0x2'));var rs=require(_0xde5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde5f('0x4'))['db'];var utils=require(_0xde5f('0x5'));var logger=require(_0xde5f('0x6'))(_0xde5f('0x7'));var config=require(_0xde5f('0x8'));var jayson=require(_0xde5f('0x9'));var client=jayson[_0xde5f('0xa')][_0xde5f('0xb')]({'port':0x232a});config[_0xde5f('0xc')]=_[_0xde5f('0xd')](config[_0xde5f('0xc')],{'host':_0xde5f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde5f('0xc')]));require(_0xde5f('0xf'))['register'](socket);function respondWithRpcPromise(_0x579462,_0x2e7d66,_0x2355e8){return new BPromise(function(_0x541728,_0x21cd59){return client[_0xde5f('0x10')](_0x579462,_0x2355e8)['then'](function(_0x277376){logger[_0xde5f('0x11')](_0xde5f('0x12'),_0x2e7d66,'request\x20sent');logger[_0xde5f('0x13')](_0xde5f('0x14'),_0x2e7d66,'request\x20sent',JSON[_0xde5f('0x15')](_0x277376));if(_0x277376[_0xde5f('0x16')]){if(_0x277376['error'][_0xde5f('0x17')]===0x1f4){logger[_0xde5f('0x16')](_0xde5f('0x12'),_0x2e7d66,_0x277376[_0xde5f('0x16')][_0xde5f('0x18')]);return _0x21cd59(_0x277376[_0xde5f('0x16')][_0xde5f('0x18')]);}logger[_0xde5f('0x16')](_0xde5f('0x12'),_0x2e7d66,_0x277376[_0xde5f('0x16')][_0xde5f('0x18')]);return _0x541728(_0x277376[_0xde5f('0x16')]['message']);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x2e7d66,_0xde5f('0x19'));_0x541728(_0x277376[_0xde5f('0x1a')]['message']);}})[_0xde5f('0x1b')](function(_0x5d6680){logger[_0xde5f('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x2e7d66,_0x5d6680);_0x21cd59(_0x5d6680);});});}
\ No newline at end of file
+var _0x548f=['http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0xc6f348,_0x114617){var _0x3f6341=function(_0x194b16){while(--_0x194b16){_0xc6f348['push'](_0xc6f348['shift']());}};_0x3f6341(++_0x114617);}(_0x548f,0x104));var _0xf548=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x548f[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xf548('0x0'));var util=require(_0xf548('0x1'));var moment=require(_0xf548('0x2'));var BPromise=require('bluebird');var rs=require(_0xf548('0x3'));var fs=require('fs');var Redis=require(_0xf548('0x4'));var db=require(_0xf548('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf548('0x6'));var config=require(_0xf548('0x7'));var jayson=require(_0xf548('0x8'));var client=jayson[_0xf548('0x9')][_0xf548('0xa')]({'port':0x232a});config[_0xf548('0xb')]=_[_0xf548('0xc')](config['redis'],{'host':_0xf548('0xd'),'port':0x18eb});var socket=require(_0xf548('0xe'))(new Redis(config[_0xf548('0xb')]));require(_0xf548('0xf'))[_0xf548('0x10')](socket);function respondWithRpcPromise(_0x3fb518,_0x4dfe48,_0x433cb9){return new BPromise(function(_0x16e487,_0x485d27){return client[_0xf548('0x11')](_0x3fb518,_0x433cb9)[_0xf548('0x12')](function(_0x41207e){logger[_0xf548('0x13')](_0xf548('0x14'),_0x4dfe48,_0xf548('0x15'));logger[_0xf548('0x16')](_0xf548('0x17'),_0x4dfe48,'request\x20sent',JSON[_0xf548('0x18')](_0x41207e));if(_0x41207e[_0xf548('0x19')]){if(_0x41207e[_0xf548('0x19')][_0xf548('0x1a')]===0x1f4){logger[_0xf548('0x19')](_0xf548('0x14'),_0x4dfe48,_0x41207e[_0xf548('0x19')][_0xf548('0x1b')]);return _0x485d27(_0x41207e['error'][_0xf548('0x1b')]);}logger['error'](_0xf548('0x14'),_0x4dfe48,_0x41207e[_0xf548('0x19')][_0xf548('0x1b')]);return _0x16e487(_0x41207e[_0xf548('0x19')][_0xf548('0x1b')]);}else{logger[_0xf548('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x4dfe48,_0xf548('0x15'));_0x16e487(_0x41207e[_0xf548('0x1c')][_0xf548('0x1b')]);}})[_0xf548('0x1d')](function(_0x3a9446){logger[_0xf548('0x19')](_0xf548('0x14'),_0x4dfe48,_0x3a9446);_0x485d27(_0x3a9446);});});}
\ No newline at end of file
index 9207d64..4e62412 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x022a=['register','voicePrefix:','./voicePrefix.events','save','update','emit','removeListener'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0x022a,0x167));var _0xa022=function(_0x3fc287,_0x5c3f36){_0x3fc287=_0x3fc287-0x0;var _0x33af9f=_0x022a[_0x3fc287];return _0x33af9f;};'use strict';var VoicePrefixEvents=require(_0xa022('0x0'));var events=[_0xa022('0x1'),'remove',_0xa022('0x2')];function createListener(_0x556fa8,_0x4bab30){return function(_0x1cad0a){_0x4bab30[_0xa022('0x3')](_0x556fa8,_0x1cad0a);};}function removeListener(_0x3da026,_0x325cc1){return function(){VoicePrefixEvents[_0xa022('0x4')](_0x3da026,_0x325cc1);};}exports[_0xa022('0x5')]=function(_0x232a0a){for(var _0x29cd2b=0x0,_0x3a6d6c=events['length'];_0x29cd2b<_0x3a6d6c;_0x29cd2b++){var _0x14ae93=events[_0x29cd2b];var _0x4b9322=createListener(_0xa022('0x6')+_0x14ae93,_0x232a0a);VoicePrefixEvents['on'](_0x14ae93,_0x4b9322);}};
\ No newline at end of file
+var _0x756d=['remove','update','emit','removeListener','length','voicePrefix:','./voicePrefix.events','save'];(function(_0x9d7b5,_0x4bf586){var _0x1a4fc7=function(_0x4e5106){while(--_0x4e5106){_0x9d7b5['push'](_0x9d7b5['shift']());}};_0x1a4fc7(++_0x4bf586);}(_0x756d,0x14e));var _0xd756=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x756d[_0x57b54c];return _0x59cc19;};'use strict';var VoicePrefixEvents=require(_0xd756('0x0'));var events=[_0xd756('0x1'),_0xd756('0x2'),_0xd756('0x3')];function createListener(_0x25eda1,_0x19a0a0){return function(_0x1d59c5){_0x19a0a0[_0xd756('0x4')](_0x25eda1,_0x1d59c5);};}function removeListener(_0xfe787,_0x4683d8){return function(){VoicePrefixEvents[_0xd756('0x5')](_0xfe787,_0x4683d8);};}exports['register']=function(_0x373666){for(var _0x5acaab=0x0,_0x3eca1c=events[_0xd756('0x6')];_0x5acaab<_0x3eca1c;_0x5acaab++){var _0xb67e70=events[_0x5acaab];var _0x562155=createListener(_0xd756('0x7')+_0xb67e70,_0x373666);VoicePrefixEvents['on'](_0xb67e70,_0x562155);}};
\ No newline at end of file
index 9dd444d..9ed91b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1cb=['show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addTeams','/:id/users','addAgents','addLists','addBlackLists','put','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceQueue.controller','get','isAuthenticated','index','/:id'];(function(_0x4c05fc,_0x3a1282){var _0x5953b8=function(_0x15cdbb){while(--_0x15cdbb){_0x4c05fc['push'](_0x4c05fc['shift']());}};_0x5953b8(++_0x3a1282);}(_0xf1cb,0xa4));var _0xbf1c=function(_0xb2c246,_0x55ebaf){_0xb2c246=_0xb2c246-0x0;var _0x55a51f=_0xf1cb[_0xb2c246];return _0x55a51f;};'use strict';var multer=require(_0xbf1c('0x0'));var util=require(_0xbf1c('0x1'));var path=require(_0xbf1c('0x2'));var timeout=require(_0xbf1c('0x3'));var express=require(_0xbf1c('0x4'));var router=express[_0xbf1c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xbf1c('0x6'));var config=require('../../config/environment');var controller=require(_0xbf1c('0x7'));router[_0xbf1c('0x8')]('/',auth[_0xbf1c('0x9')](),controller[_0xbf1c('0xa')]);router['get'](_0xbf1c('0xb'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0xc')]);router[_0xbf1c('0x8')](_0xbf1c('0xd'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0xe')]);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xbf1c('0xf')]);router[_0xbf1c('0x8')](_0xbf1c('0x10'),auth[_0xbf1c('0x9')](),controller['getHopperFinals']);router[_0xbf1c('0x8')](_0xbf1c('0x11'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x12')]);router[_0xbf1c('0x8')](_0xbf1c('0x13'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x14')]);router[_0xbf1c('0x8')]('/:id/users',auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x15')]);router[_0xbf1c('0x8')](_0xbf1c('0x16'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x17')]);router[_0xbf1c('0x8')](_0xbf1c('0x18'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x19')]);router['get'](_0xbf1c('0x1a'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xbf1c('0x1b')]('/',auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x1c')]);router['post'](_0xbf1c('0x1d'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x1e')]);router[_0xbf1c('0x1b')](_0xbf1c('0x13'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x1f')]);router['post'](_0xbf1c('0x20'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x21')]);router[_0xbf1c('0x1b')]('/:id/lists',auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x22')]);router[_0xbf1c('0x1b')](_0xbf1c('0x1a'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x23')]);router[_0xbf1c('0x24')](_0xbf1c('0xb'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x25')]);router[_0xbf1c('0x26')](_0xbf1c('0xb'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x27')]);router[_0xbf1c('0x26')](_0xbf1c('0x13'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x28')]);router['delete']('/:id/users',auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x29')]);router['delete'](_0xbf1c('0x18'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x2a')]);router[_0xbf1c('0x26')](_0xbf1c('0x1a'),auth[_0xbf1c('0x9')](),controller[_0xbf1c('0x2b')]);module['exports']=router;
\ No newline at end of file
+var _0xcf3c=['put','update','destroy','removeTeams','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addAgents','/:id/lists','addLists'];(function(_0x835f74,_0x123452){var _0x46a4d6=function(_0x5b7adc){while(--_0x5b7adc){_0x835f74['push'](_0x835f74['shift']());}};_0x46a4d6(++_0x123452);}(_0xcf3c,0x150));var _0xccf3=function(_0x51c975,_0x3084b7){_0x51c975=_0x51c975-0x0;var _0x4580ab=_0xcf3c[_0x51c975];return _0x4580ab;};'use strict';var multer=require(_0xccf3('0x0'));var util=require(_0xccf3('0x1'));var path=require(_0xccf3('0x2'));var timeout=require(_0xccf3('0x3'));var express=require(_0xccf3('0x4'));var router=express['Router']();var auth=require(_0xccf3('0x5'));var interaction=require(_0xccf3('0x6'));var config=require(_0xccf3('0x7'));var controller=require('./voiceQueue.controller');router[_0xccf3('0x8')]('/',auth[_0xccf3('0x9')](),controller['index']);router[_0xccf3('0x8')](_0xccf3('0xa'),auth[_0xccf3('0x9')](),controller[_0xccf3('0xb')]);router[_0xccf3('0x8')](_0xccf3('0xc'),auth['isAuthenticated'](),controller[_0xccf3('0xd')]);router['get'](_0xccf3('0xe'),auth[_0xccf3('0x9')](),controller[_0xccf3('0xf')]);router[_0xccf3('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xccf3('0x10')]);router[_0xccf3('0x8')]('/:id/hopper_black',auth[_0xccf3('0x9')](),controller[_0xccf3('0x11')]);router['get'](_0xccf3('0x12'),auth[_0xccf3('0x9')](),controller[_0xccf3('0x13')]);router[_0xccf3('0x8')](_0xccf3('0x14'),auth[_0xccf3('0x9')](),controller[_0xccf3('0x15')]);router[_0xccf3('0x8')](_0xccf3('0x16'),auth['isAuthenticated'](),controller[_0xccf3('0x17')]);router['get']('/:id/lists',auth[_0xccf3('0x9')](),controller[_0xccf3('0x18')]);router['get'](_0xccf3('0x19'),auth[_0xccf3('0x9')](),controller[_0xccf3('0x1a')]);router[_0xccf3('0x1b')]('/',auth[_0xccf3('0x9')](),controller[_0xccf3('0x1c')]);router['post'](_0xccf3('0x1d'),auth[_0xccf3('0x9')](),controller['clone']);router['post'](_0xccf3('0x12'),auth[_0xccf3('0x9')](),controller['addTeams']);router['post'](_0xccf3('0x14'),auth[_0xccf3('0x9')](),controller[_0xccf3('0x1e')]);router[_0xccf3('0x1b')](_0xccf3('0x1f'),auth['isAuthenticated'](),controller[_0xccf3('0x20')]);router[_0xccf3('0x1b')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router[_0xccf3('0x21')]('/:id',auth['isAuthenticated'](),controller[_0xccf3('0x22')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xccf3('0x23')]);router['delete'](_0xccf3('0x12'),auth['isAuthenticated'](),controller[_0xccf3('0x24')]);router[_0xccf3('0x25')](_0xccf3('0x14'),auth[_0xccf3('0x9')](),controller['removeAgents']);router['delete'](_0xccf3('0x1f'),auth[_0xccf3('0x9')](),controller[_0xccf3('0x26')]);router[_0xccf3('0x25')]('/:id/blacklists',auth[_0xccf3('0x9')](),controller[_0xccf3('0x27')]);module[_0xccf3('0x28')]=router;
\ No newline at end of file
index e580a3b..3a473f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x29d60a,_0x2b4229){var _0x4efc39=function(_0x4844be){while(--_0x4844be){_0x29d60a['push'](_0x29d60a['shift']());}};_0x4efc39(++_0x2b4229);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x4afe3b,_0x255e0d){var _0x2c22d1=function(_0x313847){while(--_0x313847){_0x4afe3b['push'](_0x4afe3b['shift']());}};_0x2c22d1(++_0x255e0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
index 7d5359a..79425c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bf2=['ContactId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','VoiceQueueId\x20=\x20?','onlyIfOpen','insert','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','type','find','name','UserProfileResource','error','send','VoiceQueue','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','merge','VIRTUAL','options','includeAll','rows','show','length','include','catch','create','body','user','UserProfileSection','autoAssociation','clone','rawAttributes','omit','updatedAt','createdAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getHoppers','findOne','CmHopper','hasOwnProperty','pick','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','teams','Agents','online','voicePause','interface','forEach','penalty','sequelize','transaction','UserVoiceQueue','findOrCreate','each','UserVoiceQueueRt','upsert','isNil','emit','userVoiceQueue:save','removeTeams','ids','User','select','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','format','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','into','fromQuery','phone','scheduledAt','field','NOW()'];(function(_0x61a493,_0x54e11e){var _0x3c1bbe=function(_0x3d4634){while(--_0x3d4634){_0x61a493['push'](_0x61a493['shift']());}};_0x3c1bbe(++_0x54e11e);}(_0x7bf2,0xc8));var _0x27bf=function(_0x5a0555,_0x499709){_0x5a0555=_0x5a0555-0x0;var _0x39f18c=_0x7bf2[_0x5a0555];return _0x39f18c;};'use strict';var pdf=require(_0x27bf('0x0'));var emlformat=require(_0x27bf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x27bf('0x2'));var jsonpatch=require(_0x27bf('0x3'));var rp=require(_0x27bf('0x4'));var moment=require('moment');var BPromise=require(_0x27bf('0x5'));var Mustache=require('mustache');var util=require(_0x27bf('0x6'));var path=require(_0x27bf('0x7'));var sox=require(_0x27bf('0x8'));var csv=require(_0x27bf('0x9'));var ejs=require(_0x27bf('0xa'));var fs=require('fs');var _=require(_0x27bf('0xb'));var squel=require(_0x27bf('0xc'));var crypto=require(_0x27bf('0xd'));var jsforce=require(_0x27bf('0xe'));var deskjs=require(_0x27bf('0xf'));var toCsv=require(_0x27bf('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x27bf('0x10'));var authService=require(_0x27bf('0x11'));var qs=require(_0x27bf('0x12'));var as=require(_0x27bf('0x13'));var hardwareService=require(_0x27bf('0x14'));var logger=require('../../config/logger')(_0x27bf('0x15'));var utils=require(_0x27bf('0x16'));var config=require(_0x27bf('0x17'));var db=require(_0x27bf('0x18'))['db'];config[_0x27bf('0x19')]=_[_0x27bf('0x1a')](config['redis'],{'host':_0x27bf('0x1b'),'port':0x18eb});var socket=require(_0x27bf('0x1c'))(new Redis(config[_0x27bf('0x19')]));require('./voiceQueue.socket')[_0x27bf('0x1d')](socket);function respondWithStatusCode(_0x42ed48,_0x41908a){_0x41908a=_0x41908a||0xcc;return function(_0x3dca18){if(_0x3dca18){return _0x42ed48[_0x27bf('0x1e')](_0x41908a);}return _0x42ed48['status'](_0x41908a)[_0x27bf('0x1f')]();};}function respondWithResult(_0x4d0d43,_0xc92957){_0xc92957=_0xc92957||0xc8;return function(_0x18ce9b){if(_0x18ce9b){return _0x4d0d43[_0x27bf('0x20')](_0xc92957)[_0x27bf('0x21')](_0x18ce9b);}};}function respondWithFilteredResult(_0x22c19f,_0xfff594){return function(_0x294465){if(_0x294465){var _0x3b8e5e=_0x294465[_0x27bf('0x22')],_0x564bb5=_0xfff594[_0x27bf('0x23')],_0x9f9646=_0xfff594[_0x27bf('0x23')]+_0xfff594['limit'],_0x96f0cb;if(_0x9f9646>=_0x3b8e5e){_0x9f9646=_0x3b8e5e;_0x96f0cb=0xc8;}else{_0x96f0cb=0xce;}_0x22c19f['status'](_0x96f0cb);return _0x22c19f[_0x27bf('0x24')](_0x27bf('0x25'),_0x564bb5+'-'+_0x9f9646+'/'+_0x3b8e5e)[_0x27bf('0x21')](_0x294465);}return null;};}function patchUpdates(_0x265bb0){return function(_0x5c9a35){try{jsonpatch[_0x27bf('0x26')](_0x5c9a35,_0x265bb0,!![]);}catch(_0x69af7f){return BPromise[_0x27bf('0x27')](_0x69af7f);}return _0x5c9a35[_0x27bf('0x28')]();};}function saveUpdates(_0x265b7a,_0x14e049){return function(_0x312f2e){if(_0x312f2e){return _0x312f2e[_0x27bf('0x29')](_0x265b7a)[_0x27bf('0x2a')](function(_0x377715){return _0x377715;});}return null;};}function removeEntity(_0x127372,_0x2c2a45){return function(_0x3135f1){if(_0x3135f1){return _0x3135f1[_0x27bf('0x2b')]()[_0x27bf('0x2a')](function(){var _0x5ccac7=_0x3135f1[_0x27bf('0x2c')]({'plain':!![]});var _0x2b92b9=[{'name':_0x27bf('0x2d'),'value':_0x27bf('0x2e'),'ignore':![]},{'name':_0x27bf('0x2f'),'value':_0x27bf('0x30'),'ignore':![]}];var _0x7cce92=_(_0x2b92b9)[_0x27bf('0x31')]('ignore')[_0x27bf('0x32')]('value')[_0x27bf('0x33')]();if(_[_0x27bf('0x34')](_0x7cce92,_0x5ccac7[_0x27bf('0x35')])){return;}var _0x29d9b2=_[_0x27bf('0x36')](_0x2b92b9,[_0x27bf('0x33'),_0x5ccac7[_0x27bf('0x35')]])[_0x27bf('0x37')];return db[_0x27bf('0x38')][_0x27bf('0x2b')]({'where':{'type':_0x29d9b2,'resourceId':_0x5ccac7['id']}})[_0x27bf('0x2a')](function(){return _0x3135f1;});})[_0x27bf('0x2a')](function(){_0x127372[_0x27bf('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52ada0,_0x224644){return function(_0xabc95c){if(!_0xabc95c){_0x52ada0['sendStatus'](0x194);}return _0xabc95c;};}function handleError(_0x449855,_0x50ee62){_0x50ee62=_0x50ee62||0x1f4;return function(_0x427c16){logger[_0x27bf('0x39')](_0x427c16['stack']);if(_0x427c16[_0x27bf('0x37')]){delete _0x427c16[_0x27bf('0x37')];}_0x449855['status'](_0x50ee62)[_0x27bf('0x3a')](_0x427c16);};}exports['index']=function(_0x59c609,_0x4c4f89){var _0x12c9fb={},_0x1a4b26={},_0x22d502={'count':0x0,'rows':[]};var _0x170d16=_['map'](db[_0x27bf('0x3b')]['rawAttributes'],function(_0x14753a){return{'name':_0x14753a[_0x27bf('0x3c')],'type':_0x14753a[_0x27bf('0x35')]['key']};});_0x1a4b26[_0x27bf('0x3d')]=_[_0x27bf('0x32')](_0x170d16,_0x27bf('0x37'));_0x1a4b26[_0x27bf('0x3e')]=_[_0x27bf('0x3f')](_0x59c609['query']);_0x1a4b26[_0x27bf('0x40')]=_[_0x27bf('0x41')](_0x1a4b26[_0x27bf('0x3d')],_0x1a4b26[_0x27bf('0x3e')]);_0x12c9fb[_0x27bf('0x42')]=_[_0x27bf('0x41')](_0x1a4b26[_0x27bf('0x3d')],qs[_0x27bf('0x43')](_0x59c609['query'][_0x27bf('0x43')]));_0x12c9fb['attributes']=_0x12c9fb[_0x27bf('0x42')]['length']?_0x12c9fb[_0x27bf('0x42')]:_0x1a4b26[_0x27bf('0x3d')];if(!_0x59c609[_0x27bf('0x3e')]['hasOwnProperty'](_0x27bf('0x44'))){_0x12c9fb[_0x27bf('0x45')]=qs[_0x27bf('0x45')](_0x59c609['query'][_0x27bf('0x45')]);_0x12c9fb[_0x27bf('0x23')]=qs[_0x27bf('0x23')](_0x59c609['query'][_0x27bf('0x23')]);}_0x12c9fb[_0x27bf('0x46')]=qs[_0x27bf('0x47')](_0x59c609[_0x27bf('0x3e')][_0x27bf('0x47')]);_0x12c9fb[_0x27bf('0x48')]=qs[_0x27bf('0x40')](_['pick'](_0x59c609[_0x27bf('0x3e')],_0x1a4b26[_0x27bf('0x40')]),_0x170d16);if(_0x59c609['query'][_0x27bf('0x31')]){_0x12c9fb[_0x27bf('0x48')]=_[_0x27bf('0x49')](_0x12c9fb[_0x27bf('0x48')],{'$or':_[_0x27bf('0x32')](_0x170d16,function(_0x549401){if(_0x549401[_0x27bf('0x35')]!==_0x27bf('0x4a')){var _0x2807eb={};_0x2807eb[_0x549401[_0x27bf('0x37')]]={'$like':'%'+_0x59c609[_0x27bf('0x3e')][_0x27bf('0x31')]+'%'};return _0x2807eb;}})});}_0x12c9fb=_[_0x27bf('0x49')]({},_0x12c9fb,_0x59c609[_0x27bf('0x4b')]);var _0x2b4289={'where':_0x12c9fb[_0x27bf('0x48')]};return db[_0x27bf('0x3b')][_0x27bf('0x22')](_0x2b4289)[_0x27bf('0x2a')](function(_0x117596){_0x22d502[_0x27bf('0x22')]=_0x117596;if(_0x59c609[_0x27bf('0x3e')][_0x27bf('0x4c')]){_0x12c9fb['include']=[{'all':!![]}];}return db[_0x27bf('0x3b')]['findAll'](_0x12c9fb);})[_0x27bf('0x2a')](function(_0x4f4b14){_0x22d502[_0x27bf('0x4d')]=_0x4f4b14;return _0x22d502;})[_0x27bf('0x2a')](respondWithFilteredResult(_0x4c4f89,_0x12c9fb))['catch'](handleError(_0x4c4f89,null));};exports[_0x27bf('0x4e')]=function(_0x489b0f,_0x32fd18){var _0x39febb={'raw':![],'where':{'id':_0x489b0f['params']['id']}},_0x3af6d5={};_0x3af6d5['model']=_[_0x27bf('0x3f')](db['VoiceQueue']['rawAttributes']);_0x3af6d5[_0x27bf('0x3e')]=_[_0x27bf('0x3f')](_0x489b0f[_0x27bf('0x3e')]);_0x3af6d5[_0x27bf('0x40')]=_[_0x27bf('0x41')](_0x3af6d5[_0x27bf('0x3d')],_0x3af6d5[_0x27bf('0x3e')]);_0x39febb[_0x27bf('0x42')]=_['intersection'](_0x3af6d5[_0x27bf('0x3d')],qs[_0x27bf('0x43')](_0x489b0f[_0x27bf('0x3e')][_0x27bf('0x43')]));_0x39febb['attributes']=_0x39febb[_0x27bf('0x42')][_0x27bf('0x4f')]?_0x39febb[_0x27bf('0x42')]:_0x3af6d5[_0x27bf('0x3d')];if(_0x489b0f['query']['includeAll']){_0x39febb[_0x27bf('0x50')]=[{'all':!![]}];}_0x39febb=_[_0x27bf('0x49')]({},_0x39febb,_0x489b0f['options']);return db[_0x27bf('0x3b')][_0x27bf('0x36')](_0x39febb)[_0x27bf('0x2a')](handleEntityNotFound(_0x32fd18,null))[_0x27bf('0x2a')](respondWithResult(_0x32fd18,null))[_0x27bf('0x51')](handleError(_0x32fd18,null));};exports[_0x27bf('0x52')]=function(_0x1a2ba3,_0x3935c0){return db['VoiceQueue'][_0x27bf('0x52')](_0x1a2ba3[_0x27bf('0x53')],{})[_0x27bf('0x2a')](function(_0x241b20){var _0x4233e3=_0x1a2ba3[_0x27bf('0x54')]['get']({'plain':!![]});if(!_0x4233e3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4233e3['role']===_0x27bf('0x54')){var _0x3c9b7c=_0x241b20[_0x27bf('0x2c')]({'plain':!![]});var _0x291978=[{'name':_0x27bf('0x2d'),'value':_0x27bf('0x2e')},{'name':_0x27bf('0x2f'),'value':'outbound'}];var _0x3cb1a7=_['find'](_0x291978,[_0x27bf('0x33'),_0x3c9b7c['type']])['name'];return db[_0x27bf('0x55')]['find']({'where':{'name':_0x3cb1a7,'userProfileId':_0x4233e3['userProfileId']},'raw':!![]})['then'](function(_0x538917){if(_0x538917&&_0x538917[_0x27bf('0x56')]===0x0){return db[_0x27bf('0x38')][_0x27bf('0x52')]({'name':_0x3c9b7c[_0x27bf('0x37')],'resourceId':_0x3c9b7c['id'],'type':_0x538917['name'],'sectionId':_0x538917['id']},{})['then'](function(){return _0x241b20;});}else{return _0x241b20;}})[_0x27bf('0x51')](function(_0x41fd26){logger[_0x27bf('0x39')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41fd26);throw _0x41fd26;});}return _0x241b20;})[_0x27bf('0x2a')](respondWithResult(_0x3935c0,0xc9))[_0x27bf('0x51')](handleError(_0x3935c0,null));};exports[_0x27bf('0x57')]=function(_0x5b2dfe,_0x1f2fe0){var _0x37c93f={'where':{'id':_0x5b2dfe['params']['id']}},_0x172fe1={};_0x172fe1[_0x27bf('0x3d')]=_[_0x27bf('0x3f')](db[_0x27bf('0x3b')][_0x27bf('0x58')]);_0x37c93f['attributes']=_[_0x27bf('0x41')](_0x172fe1['model'],qs[_0x27bf('0x43')](_0x5b2dfe[_0x27bf('0x3e')][_0x27bf('0x43')]));_0x37c93f[_0x27bf('0x42')]=_0x37c93f['attributes'][_0x27bf('0x4f')]?_0x37c93f['attributes']:_0x172fe1['model'];if(_0x5b2dfe['query']['includeAll']){_0x37c93f[_0x27bf('0x50')]=[{'all':!![]}];}_0x37c93f=_[_0x27bf('0x49')]({},_0x37c93f,_0x5b2dfe['options']);return db[_0x27bf('0x3b')]['find'](_0x37c93f)[_0x27bf('0x2a')](handleEntityNotFound(_0x1f2fe0,null))[_0x27bf('0x2a')](function(_0x1d358a){if(_0x1d358a){var _0xa0b317=_0x1d358a[_0x27bf('0x2c')]({'plain':!![]});_0xa0b317=qs[_0x27bf('0x59')](_0xa0b317,['id','createdAt',_0x27bf('0x5a')]);_0x5b2dfe['body']=_['omit'](_0x5b2dfe['body'],['id',_0x27bf('0x5b'),_0x27bf('0x5a')]);return db[_0x27bf('0x3b')][_0x27bf('0x52')](_[_0x27bf('0x49')](_0xa0b317,_0x5b2dfe[_0x27bf('0x53')]),{'include':_0x5b2dfe[_0x27bf('0x3e')][_0x27bf('0x4c')]?[{'all':!![]}]:undefined})[_0x27bf('0x2a')](function(_0x3d577a){var _0x4052f2=_0x5b2dfe[_0x27bf('0x54')][_0x27bf('0x2c')]({'plain':!![]});if(!_0x4052f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4052f2['role']===_0x27bf('0x54')){var _0x47e674=_0x3d577a[_0x27bf('0x2c')]({'plain':!![]});var _0x5f18d9=[{'name':_0x27bf('0x2d'),'value':'inbound'},{'name':_0x27bf('0x2f'),'value':'outbound'}];var _0x4694fe=_[_0x27bf('0x36')](_0x5f18d9,[_0x27bf('0x33'),_0x47e674['type']])[_0x27bf('0x37')];return db[_0x27bf('0x55')][_0x27bf('0x36')]({'where':{'name':_0x4694fe,'userProfileId':_0x4052f2[_0x27bf('0x5c')]},'raw':!![]})['then'](function(_0xe8c69e){if(_0xe8c69e&&_0xe8c69e[_0x27bf('0x56')]===0x0){return db[_0x27bf('0x38')]['create']({'name':_0x47e674['name'],'resourceId':_0x47e674['id'],'type':_0xe8c69e[_0x27bf('0x37')],'sectionId':_0xe8c69e['id']},{})[_0x27bf('0x2a')](function(){return _0x3d577a;});}else{return _0x3d577a;}})['catch'](function(_0x48b65a){logger[_0x27bf('0x39')](_0x27bf('0x5d'),_0x48b65a);throw _0x48b65a;});}return _0x3d577a;});}})[_0x27bf('0x2a')](respondWithResult(_0x1f2fe0,0xc9))[_0x27bf('0x51')](handleError(_0x1f2fe0,null));};exports[_0x27bf('0x29')]=function(_0x4263c9,_0xdb48cf){if(_0x4263c9[_0x27bf('0x53')]['id']){delete _0x4263c9['body']['id'];}return db[_0x27bf('0x3b')]['find']({'where':{'id':_0x4263c9[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0xdb48cf,null))[_0x27bf('0x2a')](saveUpdates(_0x4263c9[_0x27bf('0x53')],null))[_0x27bf('0x2a')](respondWithResult(_0xdb48cf,null))[_0x27bf('0x51')](handleError(_0xdb48cf,null));};exports['destroy']=function(_0x4bae3a,_0x36150a){return db['VoiceQueue']['find']({'where':{'id':_0x4bae3a[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x36150a,null))['then'](removeEntity(_0x36150a,null))[_0x27bf('0x51')](handleError(_0x36150a,null));};exports[_0x27bf('0x5f')]=function(_0x13592f,_0x46eb7d,_0x17f7ff){var _0x578de0={'raw':![],'where':{}};var _0x53a4cf={};var _0x31a46b={'count':0x0,'rows':[]};return db[_0x27bf('0x3b')][_0x27bf('0x60')]({'where':{'id':_0x13592f['params']['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x46eb7d,null))[_0x27bf('0x2a')](function(_0x5783b3){if(_0x5783b3){_0x53a4cf[_0x27bf('0x3d')]=_['keys'](db[_0x27bf('0x61')][_0x27bf('0x58')]);_0x53a4cf['query']=_[_0x27bf('0x3f')](_0x13592f[_0x27bf('0x3e')]);_0x53a4cf[_0x27bf('0x40')]=_[_0x27bf('0x41')](_0x53a4cf[_0x27bf('0x3d')],_0x53a4cf['query']);_0x578de0['attributes']=_['intersection'](_0x53a4cf[_0x27bf('0x3d')],qs[_0x27bf('0x43')](_0x13592f[_0x27bf('0x3e')][_0x27bf('0x43')]));_0x578de0[_0x27bf('0x42')]=_0x578de0[_0x27bf('0x42')][_0x27bf('0x4f')]?_0x578de0[_0x27bf('0x42')]:_0x53a4cf[_0x27bf('0x3d')];if(!_0x13592f['query'][_0x27bf('0x62')](_0x27bf('0x44'))){_0x578de0[_0x27bf('0x45')]=qs[_0x27bf('0x45')](_0x13592f[_0x27bf('0x3e')][_0x27bf('0x45')]);_0x578de0[_0x27bf('0x23')]=qs[_0x27bf('0x23')](_0x13592f[_0x27bf('0x3e')][_0x27bf('0x23')]);}_0x578de0[_0x27bf('0x46')]=qs[_0x27bf('0x47')](_0x13592f[_0x27bf('0x3e')][_0x27bf('0x47')]);_0x578de0[_0x27bf('0x48')]=qs[_0x27bf('0x40')](_[_0x27bf('0x63')](_0x13592f[_0x27bf('0x3e')],_0x53a4cf[_0x27bf('0x40')]));_0x578de0['where'][_0x27bf('0x64')]=_0x5783b3['id'];if(_0x13592f['query']['filter']){_0x578de0[_0x27bf('0x48')]=_[_0x27bf('0x49')](_0x578de0[_0x27bf('0x48')],{'$or':_[_0x27bf('0x32')](_0x578de0[_0x27bf('0x42')],function(_0x12bc8f){var _0x924647={};_0x924647[_0x12bc8f]={'$like':'%'+_0x13592f[_0x27bf('0x3e')][_0x27bf('0x31')]+'%'};return _0x924647;})});}_0x578de0=_['merge']({},_0x578de0,_0x13592f[_0x27bf('0x4b')]);return db['CmHopper'][_0x27bf('0x22')]({'where':_0x578de0[_0x27bf('0x48')]})['then'](function(_0x5798b2){_0x31a46b[_0x27bf('0x22')]=_0x5798b2;if(_0x13592f[_0x27bf('0x3e')][_0x27bf('0x4c')]){_0x578de0[_0x27bf('0x50')]=[{'all':!![]}];}return db[_0x27bf('0x61')][_0x27bf('0x65')](_0x578de0);})[_0x27bf('0x2a')](function(_0x230553){_0x31a46b[_0x27bf('0x4d')]=_0x230553;return _0x31a46b;});}})['then'](respondWithFilteredResult(_0x46eb7d,_0x578de0))[_0x27bf('0x51')](handleError(_0x46eb7d,null));};exports[_0x27bf('0x66')]=function(_0x55702b,_0x5864df,_0x324585){var _0x289018={'raw':!![],'where':{}};var _0x4258be={};var _0x95c3c6={'count':0x0,'rows':[]};return db[_0x27bf('0x3b')]['findOne']({'where':{'id':_0x55702b['params']['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x5864df,null))[_0x27bf('0x2a')](function(_0x4f7eb9){if(_0x4f7eb9){_0x4258be[_0x27bf('0x3d')]=_[_0x27bf('0x3f')](db[_0x27bf('0x67')][_0x27bf('0x58')]);_0x4258be[_0x27bf('0x3e')]=_['keys'](_0x55702b[_0x27bf('0x3e')]);_0x4258be[_0x27bf('0x40')]=_['intersection'](_0x4258be[_0x27bf('0x3d')],_0x4258be['query']);_0x289018[_0x27bf('0x42')]=_[_0x27bf('0x41')](_0x4258be[_0x27bf('0x3d')],qs[_0x27bf('0x43')](_0x55702b[_0x27bf('0x3e')][_0x27bf('0x43')]));_0x289018[_0x27bf('0x42')]=_0x289018[_0x27bf('0x42')][_0x27bf('0x4f')]?_0x289018[_0x27bf('0x42')]:_0x4258be[_0x27bf('0x3d')];if(!_0x55702b[_0x27bf('0x3e')][_0x27bf('0x62')](_0x27bf('0x44'))){_0x289018['limit']=qs['limit'](_0x55702b['query'][_0x27bf('0x45')]);_0x289018[_0x27bf('0x23')]=qs[_0x27bf('0x23')](_0x55702b['query'][_0x27bf('0x23')]);}_0x289018['order']=qs[_0x27bf('0x47')](_0x55702b[_0x27bf('0x3e')][_0x27bf('0x47')]);_0x289018[_0x27bf('0x48')]=qs[_0x27bf('0x40')](_[_0x27bf('0x63')](_0x55702b[_0x27bf('0x3e')],_0x4258be[_0x27bf('0x40')]));_0x289018[_0x27bf('0x48')]['VoiceQueueId']=_0x4f7eb9['id'];if(_0x55702b['query'][_0x27bf('0x31')]){_0x289018[_0x27bf('0x48')]=_[_0x27bf('0x49')](_0x289018[_0x27bf('0x48')],{'$or':_['map'](_0x289018['attributes'],function(_0x53a401){var _0x1fd15f={};_0x1fd15f[_0x53a401]={'$like':'%'+_0x55702b[_0x27bf('0x3e')][_0x27bf('0x31')]+'%'};return _0x1fd15f;})});}_0x289018=_['merge']({},_0x289018,_0x55702b[_0x27bf('0x4b')]);return db[_0x27bf('0x67')][_0x27bf('0x22')]({'where':_0x289018[_0x27bf('0x48')]})['then'](function(_0x2729ff){_0x95c3c6[_0x27bf('0x22')]=_0x2729ff;if(_0x55702b[_0x27bf('0x3e')]['includeAll']){_0x289018[_0x27bf('0x50')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x27bf('0x65')](_0x289018);})['then'](function(_0x16974f){_0x95c3c6['rows']=_0x16974f;return _0x95c3c6;});}})['then'](respondWithFilteredResult(_0x5864df,_0x289018))['catch'](handleError(_0x5864df,null));};exports[_0x27bf('0x68')]=function(_0x4a6c48,_0x3d3eee,_0x59e032){var _0x239484={'raw':!![],'where':{}};var _0x199376={};var _0x458458={'count':0x0,'rows':[]};return db[_0x27bf('0x3b')][_0x27bf('0x60')]({'where':{'id':_0x4a6c48['params']['id']}})['then'](handleEntityNotFound(_0x3d3eee,null))['then'](function(_0x483bf2){if(_0x483bf2){_0x199376[_0x27bf('0x3d')]=_[_0x27bf('0x3f')](db['CmHopperFinal'][_0x27bf('0x58')]);_0x199376['query']=_[_0x27bf('0x3f')](_0x4a6c48[_0x27bf('0x3e')]);_0x199376[_0x27bf('0x40')]=_[_0x27bf('0x41')](_0x199376['model'],_0x199376[_0x27bf('0x3e')]);_0x239484[_0x27bf('0x42')]=_[_0x27bf('0x41')](_0x199376['model'],qs[_0x27bf('0x43')](_0x4a6c48[_0x27bf('0x3e')]['fields']));_0x239484[_0x27bf('0x42')]=_0x239484[_0x27bf('0x42')][_0x27bf('0x4f')]?_0x239484[_0x27bf('0x42')]:_0x199376[_0x27bf('0x3d')];if(!_0x4a6c48[_0x27bf('0x3e')]['hasOwnProperty']('nolimit')){_0x239484[_0x27bf('0x45')]=qs[_0x27bf('0x45')](_0x4a6c48[_0x27bf('0x3e')][_0x27bf('0x45')]);_0x239484[_0x27bf('0x23')]=qs[_0x27bf('0x23')](_0x4a6c48[_0x27bf('0x3e')]['offset']);}_0x239484['order']=qs['sort'](_0x4a6c48['query'][_0x27bf('0x47')]);_0x239484[_0x27bf('0x48')]=qs['filters'](_[_0x27bf('0x63')](_0x4a6c48[_0x27bf('0x3e')],_0x199376[_0x27bf('0x40')]));_0x239484[_0x27bf('0x48')][_0x27bf('0x64')]=_0x483bf2['id'];if(_0x4a6c48[_0x27bf('0x3e')][_0x27bf('0x31')]){_0x239484[_0x27bf('0x48')]=_[_0x27bf('0x49')](_0x239484[_0x27bf('0x48')],{'$or':_[_0x27bf('0x32')](_0x239484[_0x27bf('0x42')],function(_0x555395){var _0x8fb907={};_0x8fb907[_0x555395]={'$like':'%'+_0x4a6c48[_0x27bf('0x3e')][_0x27bf('0x31')]+'%'};return _0x8fb907;})});}_0x239484=_[_0x27bf('0x49')]({},_0x239484,_0x4a6c48[_0x27bf('0x4b')]);return db[_0x27bf('0x69')][_0x27bf('0x22')]({'where':_0x239484['where']})[_0x27bf('0x2a')](function(_0x12aa87){_0x458458[_0x27bf('0x22')]=_0x12aa87;if(_0x4a6c48['query'][_0x27bf('0x4c')]){_0x239484[_0x27bf('0x50')]=[{'all':!![]}];}return db[_0x27bf('0x69')]['findAll'](_0x239484);})[_0x27bf('0x2a')](function(_0x44d27d){_0x458458['rows']=_0x44d27d;return _0x458458;});}})['then'](respondWithFilteredResult(_0x3d3eee,_0x239484))[_0x27bf('0x51')](handleError(_0x3d3eee,null));};exports['getHopperBlacks']=function(_0x100afa,_0x2aa41f,_0x4da036){var _0x3b9ade={'raw':!![],'where':{}};var _0x1717d2={};var _0x57761f={'count':0x0,'rows':[]};return db[_0x27bf('0x3b')][_0x27bf('0x60')]({'where':{'id':_0x100afa[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x2aa41f,null))[_0x27bf('0x2a')](function(_0x4b1d02){if(_0x4b1d02){_0x1717d2[_0x27bf('0x3d')]=_[_0x27bf('0x3f')](db[_0x27bf('0x6a')]['rawAttributes']);_0x1717d2[_0x27bf('0x3e')]=_[_0x27bf('0x3f')](_0x100afa[_0x27bf('0x3e')]);_0x1717d2[_0x27bf('0x40')]=_[_0x27bf('0x41')](_0x1717d2[_0x27bf('0x3d')],_0x1717d2['query']);_0x3b9ade[_0x27bf('0x42')]=_[_0x27bf('0x41')](_0x1717d2[_0x27bf('0x3d')],qs['fields'](_0x100afa['query']['fields']));_0x3b9ade[_0x27bf('0x42')]=_0x3b9ade['attributes'][_0x27bf('0x4f')]?_0x3b9ade['attributes']:_0x1717d2['model'];if(!_0x100afa[_0x27bf('0x3e')][_0x27bf('0x62')]('nolimit')){_0x3b9ade[_0x27bf('0x45')]=qs[_0x27bf('0x45')](_0x100afa[_0x27bf('0x3e')]['limit']);_0x3b9ade[_0x27bf('0x23')]=qs[_0x27bf('0x23')](_0x100afa[_0x27bf('0x3e')][_0x27bf('0x23')]);}_0x3b9ade[_0x27bf('0x46')]=qs['sort'](_0x100afa[_0x27bf('0x3e')][_0x27bf('0x47')]);_0x3b9ade[_0x27bf('0x48')]=qs['filters'](_['pick'](_0x100afa['query'],_0x1717d2['filters']));_0x3b9ade[_0x27bf('0x48')][_0x27bf('0x64')]=_0x4b1d02['id'];if(_0x100afa[_0x27bf('0x3e')]['filter']){_0x3b9ade[_0x27bf('0x48')]=_[_0x27bf('0x49')](_0x3b9ade['where'],{'$or':_[_0x27bf('0x32')](_0x3b9ade[_0x27bf('0x42')],function(_0x385821){var _0x451922={};_0x451922[_0x385821]={'$like':'%'+_0x100afa[_0x27bf('0x3e')][_0x27bf('0x31')]+'%'};return _0x451922;})});}_0x3b9ade=_['merge']({},_0x3b9ade,_0x100afa[_0x27bf('0x4b')]);return db[_0x27bf('0x6a')]['count']({'where':_0x3b9ade['where']})[_0x27bf('0x2a')](function(_0x22af7c){_0x57761f[_0x27bf('0x22')]=_0x22af7c;if(_0x100afa[_0x27bf('0x3e')][_0x27bf('0x4c')]){_0x3b9ade['include']=[{'all':!![]}];}return db[_0x27bf('0x6a')][_0x27bf('0x65')](_0x3b9ade);})[_0x27bf('0x2a')](function(_0x3185df){_0x57761f[_0x27bf('0x4d')]=_0x3185df;return _0x57761f;});}})[_0x27bf('0x2a')](respondWithFilteredResult(_0x2aa41f,_0x3b9ade))[_0x27bf('0x51')](handleError(_0x2aa41f,null));};exports[_0x27bf('0x6b')]=function(_0x479722,_0x4de991,_0x2b4caa){var _0x2cbbec={};var _0x370544={};var _0x2451e6;var _0xcd6f24;return db['VoiceQueue'][_0x27bf('0x60')]({'where':{'id':_0x479722['params']['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x4de991,null))[_0x27bf('0x2a')](function(_0xf02578){if(_0xf02578){_0x2451e6=_0xf02578;_0x370544[_0x27bf('0x3d')]=_['keys'](db[_0x27bf('0x6c')][_0x27bf('0x58')]);_0x370544[_0x27bf('0x3e')]=_[_0x27bf('0x3f')](_0x479722['query']);_0x370544[_0x27bf('0x40')]=_[_0x27bf('0x41')](_0x370544[_0x27bf('0x3d')],_0x370544[_0x27bf('0x3e')]);_0x2cbbec['attributes']=_['intersection'](_0x370544['model'],qs[_0x27bf('0x43')](_0x479722['query'][_0x27bf('0x43')]));_0x2cbbec['attributes']=_0x2cbbec[_0x27bf('0x42')]['length']?_0x2cbbec['attributes']:_0x370544['model'];_0x2cbbec[_0x27bf('0x46')]=qs[_0x27bf('0x47')](_0x479722[_0x27bf('0x3e')][_0x27bf('0x47')]);_0x2cbbec[_0x27bf('0x48')]=qs[_0x27bf('0x40')](_[_0x27bf('0x63')](_0x479722[_0x27bf('0x3e')],_0x370544[_0x27bf('0x40')]));if(_0x479722['query'][_0x27bf('0x31')]){_0x2cbbec[_0x27bf('0x48')]=_[_0x27bf('0x49')](_0x2cbbec[_0x27bf('0x48')],{'$or':_[_0x27bf('0x32')](_0x2cbbec[_0x27bf('0x42')],function(_0x3f9bef){var _0x32d145={};_0x32d145[_0x3f9bef]={'$like':'%'+_0x479722[_0x27bf('0x3e')][_0x27bf('0x31')]+'%'};return _0x32d145;})});}_0x2cbbec=_[_0x27bf('0x49')]({},_0x2cbbec,_0x479722['options']);return _0x2451e6['getTeams'](_0x2cbbec);}})[_0x27bf('0x2a')](function(_0x216514){if(_0x216514){_0xcd6f24=_0x216514['length'];if(!_0x479722[_0x27bf('0x3e')]['hasOwnProperty'](_0x27bf('0x44'))){_0x2cbbec['limit']=qs[_0x27bf('0x45')](_0x479722[_0x27bf('0x3e')][_0x27bf('0x45')]);_0x2cbbec[_0x27bf('0x23')]=qs['offset'](_0x479722['query'][_0x27bf('0x23')]);}return _0x2451e6[_0x27bf('0x6b')](_0x2cbbec);}})[_0x27bf('0x2a')](function(_0x1a79b4){if(_0x1a79b4){return _0x1a79b4?{'count':_0xcd6f24,'rows':_0x1a79b4}:null;}})[_0x27bf('0x2a')](respondWithResult(_0x4de991,null))[_0x27bf('0x51')](handleError(_0x4de991,null));};exports['addTeams']=function(_0x5db708,_0x1f37b6,_0x4e44be){var _0x89ae45=_0x5db708[_0x27bf('0x53')][_0x27bf('0x6d')];var _0x1b59a2=_[_0x27bf('0x32')](_0x89ae45,'id');return db[_0x27bf('0x6c')][_0x27bf('0x65')]({'where':{'id':_0x1b59a2},'attributes':['id'],'include':[{'model':db['User'],'as':_0x27bf('0x6e'),'attributes':['id',_0x27bf('0x37'),_0x27bf('0x6f'),_0x27bf('0x70'),_0x27bf('0x71')],'raw':!![]}]})['then'](function(_0x22ce11){if(_0x22ce11){var _0x48d7ec=_['flatMap'](_0x22ce11,function(_0x14c720){var _0x38fe59=_0x14c720['get']({'plain':!![]});_0x38fe59[_0x27bf('0x6e')][_0x27bf('0x72')](function(_0x363be0){_0x363be0[_0x27bf('0x73')]=_['find'](_0x89ae45,{'id':_0x38fe59['id']})[_0x27bf('0x73')];});return _0x38fe59[_0x27bf('0x6e')];});return db[_0x27bf('0x3b')][_0x27bf('0x36')]({'where':{'id':_0x5db708[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](function(_0x1d5ef9){return db[_0x27bf('0x74')][_0x27bf('0x75')](function(_0x4bb204){return _0x1d5ef9['addTeams'](_0x1b59a2,{'transaction':_0x4bb204})[_0x27bf('0x2a')](function(){return BPromise['each'](_0x48d7ec,function(_0x1013a0){return db[_0x27bf('0x76')][_0x27bf('0x77')]({'where':{'UserId':_0x1013a0['id'],'VoiceQueueId':_0x5db708[_0x27bf('0x5e')]['id']},'defaults':{'penalty':_0x1013a0[_0x27bf('0x73')]},'transaction':_0x4bb204});});})[_0x27bf('0x2a')](function(){return BPromise[_0x27bf('0x78')](_[_0x27bf('0x31')](_0x48d7ec,{'online':!![]}),function(_0x12735c){return db[_0x27bf('0x79')][_0x27bf('0x7a')]({'membername':_0x12735c[_0x27bf('0x37')],'UserId':_0x12735c['id'],'queue_name':_0x1d5ef9[_0x27bf('0x37')],'VoiceQueueId':_0x1d5ef9['id'],'interface':_[_0x27bf('0x7b')](_0x12735c[_0x27bf('0x71')])?util['format']('SIP/%s',_0x12735c[_0x27bf('0x37')]):_0x12735c['interface'],'paused':_0x12735c['voicePause']||![],'penalty':_0x12735c[_0x27bf('0x73')]},{'transaction':_0x4bb204});});})[_0x27bf('0x2a')](function(){_0x48d7ec['forEach'](function(_0x2c7b00){socket[_0x27bf('0x7c')](_0x27bf('0x7d'),{'UserId':_0x2c7b00['id'],'VoiceQueueId':_0x1d5ef9['id']});});});});});}})[_0x27bf('0x2a')](respondWithStatusCode(_0x1f37b6,null))[_0x27bf('0x51')](handleError(_0x1f37b6,null));};exports[_0x27bf('0x7e')]=function(_0x40601b,_0x42a739,_0x12c3fe){return db[_0x27bf('0x6c')][_0x27bf('0x65')]({'where':{'id':_0x40601b[_0x27bf('0x3e')][_0x27bf('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x27bf('0x80')],'as':_0x27bf('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x27bf('0x2a')](handleEntityNotFound(_0x42a739,null))[_0x27bf('0x2a')](function(_0x6efd21){var _0x34ae91=_[_0x27bf('0x32')](_0x6efd21,'id');var _0x4819fc=[];var _0x376488=[];var _0x5c6fcd=squel[_0x27bf('0x81')]();_0x5c6fcd['field']('tq.TeamId')[_0x27bf('0x82')](_0x27bf('0x83'),'tq')[_0x27bf('0x84')](_0x27bf('0x85'),'ut',_0x27bf('0x86'))[_0x27bf('0x48')]('VoiceQueueId\x20=\x20?',_0x40601b[_0x27bf('0x5e')]['id']);for(var _0x5c42c7=0x0;_0x5c42c7<_0x6efd21['length'];_0x5c42c7+=0x1){let _0x5060ec=_0x6efd21[_0x5c42c7];for(var _0x383ab8=0x0;_0x383ab8<_0x5060ec[_0x27bf('0x6e')][_0x27bf('0x4f')];_0x383ab8+=0x1){let _0x5cde3a=_0x5060ec[_0x27bf('0x6e')][_0x383ab8];var _0x20c956=_0x5c6fcd['clone']();_0x20c956[_0x27bf('0x48')](_0x27bf('0x87'),_0x5cde3a['id']);_0x376488[_0x27bf('0x88')](db[_0x27bf('0x74')][_0x27bf('0x3e')](_0x20c956[_0x27bf('0x89')](),{'type':db[_0x27bf('0x74')][_0x27bf('0x8a')][_0x27bf('0x8b')]})[_0x27bf('0x2a')](function(_0x47ba29){if(_0x47ba29[_0x27bf('0x4f')]===0x1){return _0x5cde3a['id'];}else{var _0x327af2=_[_0x27bf('0x8c')](_[_0x27bf('0x32')](_0x47ba29,_0x27bf('0x8d')),function(_0x1c9f30){return _[_0x27bf('0x34')](_0x34ae91,_0x1c9f30);});if(_0x327af2){return _0x5cde3a['id'];}}}));}}return BPromise[_0x27bf('0x8e')](_0x376488)['then'](function(_0x53eaff){_0x4819fc=_(_0x4819fc)['union'](_0x53eaff)[_0x27bf('0x8f')]()[_0x27bf('0x33')]();return db[_0x27bf('0x3b')]['find']({'where':{'id':_0x40601b[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](function(_0x4ff4e9){return db[_0x27bf('0x74')][_0x27bf('0x75')](function(_0x2c904e){return _0x4ff4e9[_0x27bf('0x7e')](_0x40601b[_0x27bf('0x3e')][_0x27bf('0x7f')],{'transaction':_0x2c904e})[_0x27bf('0x2a')](function(){if(!_[_0x27bf('0x90')](_0x4819fc)){return _0x4ff4e9[_0x27bf('0x91')](_0x4819fc,{'transaction':_0x2c904e})[_0x27bf('0x2a')](function(){return db[_0x27bf('0x79')][_0x27bf('0x2b')]({'where':{'VoiceQueueId':_0x40601b[_0x27bf('0x5e')]['id'],'UserId':_0x4819fc},'transaction':_0x2c904e});});}})[_0x27bf('0x2a')](function(){_0x4819fc[_0x27bf('0x72')](function(_0x3a64e5){socket[_0x27bf('0x7c')](_0x27bf('0x92'),{'UserId':_0x3a64e5,'VoiceQueueId':_0x4ff4e9['id']});});});});});});})[_0x27bf('0x2a')](respondWithStatusCode(_0x42a739,null))[_0x27bf('0x51')](handleError(_0x42a739,null));};exports[_0x27bf('0x93')]=function(_0x10556e,_0x2939a2,_0x57fa19){var _0x2cef8b,_0xb705e7;return db[_0x27bf('0x3b')]['find']({'where':{'id':_0x10556e[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x2939a2,null))[_0x27bf('0x2a')](function(_0x3fc727){if(_0x3fc727){_0xb705e7=_0x3fc727;return _0x3fc727[_0x27bf('0x93')](_0x10556e['body'][_0x27bf('0x7f')],_[_0x27bf('0x59')](_0x10556e['body'],['ids','id'])||{})[_0x27bf('0x94')](function(_0x174d45){for(var _0x276394=0x0;_0x276394<_0x10556e['body']['ids'][_0x27bf('0x4f')];_0x276394+=0x1){socket[_0x27bf('0x7c')](_0x27bf('0x7d'),{'UserId':_0x10556e[_0x27bf('0x53')][_0x27bf('0x7f')][_0x276394],'VoiceQueueId':_0x10556e[_0x27bf('0x5e')]['id']});}return _0x174d45;});}})[_0x27bf('0x2a')](function(_0x53baf3){_0x2cef8b=_0x53baf3||[];if(_0xb705e7){return db['User']['findAll']({'where':{'id':_0x10556e[_0x27bf('0x53')][_0x27bf('0x7f')]},'attributes':['id',_0x27bf('0x37'),_0x27bf('0x6f'),_0x27bf('0x70'),_0x27bf('0x71')],'raw':!![]});}})['then'](function(_0x9ad88d){if(!_[_0x27bf('0x90')](_0x9ad88d)){var _0x3875f9=[];for(var _0x271814=0x0;_0x271814<_0x9ad88d[_0x27bf('0x4f')];_0x271814++){if(_0x9ad88d[_0x271814][_0x27bf('0x6f')]){_0x3875f9[_0x27bf('0x88')](db[_0x27bf('0x79')]['upsert']({'membername':_0x9ad88d[_0x271814][_0x27bf('0x37')],'UserId':_0x9ad88d[_0x271814]['id'],'queue_name':_0xb705e7['name'],'VoiceQueueId':_0xb705e7['id'],'interface':_[_0x27bf('0x7b')](_0x9ad88d[_0x271814][_0x27bf('0x71')])?util[_0x27bf('0x95')]('SIP/%s',_0x9ad88d[_0x271814][_0x27bf('0x37')]):_0x9ad88d[_0x271814]['interface'],'paused':_0x9ad88d[_0x271814]['voicePause']||![],'penalty':_0x10556e[_0x27bf('0x53')][_0x27bf('0x73')]||0x0}));}}return BPromise[_0x27bf('0x8e')](_0x3875f9);}})[_0x27bf('0x2a')](function(){return _0x2cef8b;})[_0x27bf('0x2a')](respondWithResult(_0x2939a2,null))[_0x27bf('0x51')](handleError(_0x2939a2,null));};exports[_0x27bf('0x91')]=function(_0x15369f,_0x34df2c,_0x371b3a){return db[_0x27bf('0x3b')]['find']({'where':{'id':_0x15369f[_0x27bf('0x5e')]['id']}})['then'](handleEntityNotFound(_0x34df2c,null))[_0x27bf('0x2a')](function(_0x2c643c){if(_0x2c643c){return _0x2c643c[_0x27bf('0x91')](_0x15369f[_0x27bf('0x3e')][_0x27bf('0x7f')])['then'](function(){if(_[_0x27bf('0x96')](_0x15369f['query'][_0x27bf('0x7f')])){for(var _0x6040f6=0x0;_0x6040f6<_0x15369f[_0x27bf('0x3e')][_0x27bf('0x7f')]['length'];_0x6040f6+=0x1){socket[_0x27bf('0x7c')](_0x27bf('0x92'),{'UserId':Number(_0x15369f[_0x27bf('0x3e')][_0x27bf('0x7f')][_0x6040f6]),'VoiceQueueId':Number(_0x15369f[_0x27bf('0x5e')]['id'])});}}else{socket[_0x27bf('0x7c')](_0x27bf('0x92'),{'UserId':Number(_0x15369f[_0x27bf('0x3e')]['ids']),'VoiceQueueId':Number(_0x15369f['params']['id'])});}});}})[_0x27bf('0x2a')](function(_0x481ef3){return db[_0x27bf('0x79')][_0x27bf('0x2b')]({'where':{'VoiceQueueId':_0x15369f[_0x27bf('0x5e')]['id'],'UserId':_0x15369f['query'][_0x27bf('0x7f')]}})[_0x27bf('0x2a')](function(){return _0x481ef3;});})['then'](respondWithStatusCode(_0x34df2c,null))[_0x27bf('0x51')](handleError(_0x34df2c,null));};exports[_0x27bf('0x97')]=function(_0x2e6263,_0x585023,_0x434bec){var _0x355aaa={};var _0x504faf={};var _0x18e8f0;var _0x22f4b3;return db[_0x27bf('0x3b')]['findOne']({'where':{'id':_0x2e6263['params']['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x585023,null))[_0x27bf('0x2a')](function(_0x3e5765){if(_0x3e5765){_0x18e8f0=_0x3e5765;_0x504faf[_0x27bf('0x3d')]=_[_0x27bf('0x3f')](db[_0x27bf('0x80')]['rawAttributes']);_0x504faf[_0x27bf('0x3e')]=_[_0x27bf('0x3f')](_0x2e6263[_0x27bf('0x3e')]);_0x504faf[_0x27bf('0x40')]=_[_0x27bf('0x41')](_0x504faf['model'],_0x504faf[_0x27bf('0x3e')]);_0x355aaa[_0x27bf('0x42')]=_[_0x27bf('0x41')](_0x504faf['model'],qs[_0x27bf('0x43')](_0x2e6263[_0x27bf('0x3e')][_0x27bf('0x43')]));_0x355aaa['attributes']=_0x355aaa[_0x27bf('0x42')][_0x27bf('0x4f')]?_0x355aaa['attributes']:_0x504faf[_0x27bf('0x3d')];_0x355aaa[_0x27bf('0x46')]=qs[_0x27bf('0x47')](_0x2e6263[_0x27bf('0x3e')][_0x27bf('0x47')]);_0x355aaa['where']=qs[_0x27bf('0x40')](_[_0x27bf('0x63')](_0x2e6263[_0x27bf('0x3e')],_0x504faf[_0x27bf('0x40')]));if(_0x2e6263['query'][_0x27bf('0x31')]){_0x355aaa[_0x27bf('0x48')]=_[_0x27bf('0x49')](_0x355aaa[_0x27bf('0x48')],{'$or':_[_0x27bf('0x32')](_0x355aaa['attributes'],function(_0xdf4fdf){var _0x3718ed={};_0x3718ed[_0xdf4fdf]={'$like':'%'+_0x2e6263[_0x27bf('0x3e')][_0x27bf('0x31')]+'%'};return _0x3718ed;})});}_0x355aaa=_['merge']({},_0x355aaa,_0x2e6263['options']);return _0x18e8f0[_0x27bf('0x97')](_0x355aaa);}})[_0x27bf('0x2a')](function(_0x99a3f6){if(_0x99a3f6){_0x22f4b3=_0x99a3f6[_0x27bf('0x4f')];if(!_0x2e6263[_0x27bf('0x3e')][_0x27bf('0x62')](_0x27bf('0x44'))){_0x355aaa[_0x27bf('0x45')]=qs[_0x27bf('0x45')](_0x2e6263[_0x27bf('0x3e')]['limit']);_0x355aaa['offset']=qs[_0x27bf('0x23')](_0x2e6263['query'][_0x27bf('0x23')]);}return _0x18e8f0[_0x27bf('0x97')](_0x355aaa);}})[_0x27bf('0x2a')](function(_0x3a897d){if(_0x3a897d){return _0x3a897d?{'count':_0x22f4b3,'rows':_0x3a897d}:null;}})[_0x27bf('0x2a')](respondWithResult(_0x585023,null))[_0x27bf('0x51')](handleError(_0x585023,null));};exports[_0x27bf('0x98')]=function(_0x335a7b,_0x5f495c,_0x55a1e2){var _0x5bdc11={};var _0x4525f5={};var _0x51b8e7;var _0x1bf921;return db[_0x27bf('0x3b')][_0x27bf('0x60')]({'where':{'id':_0x335a7b[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x5f495c,null))['then'](function(_0x48fef6){if(_0x48fef6){_0x51b8e7=_0x48fef6;_0x4525f5[_0x27bf('0x3d')]=_[_0x27bf('0x3f')](db['UserVoiceQueueRt'][_0x27bf('0x58')]);_0x4525f5[_0x27bf('0x3e')]=_['keys'](_0x335a7b[_0x27bf('0x3e')]);_0x4525f5[_0x27bf('0x40')]=_[_0x27bf('0x41')](_0x4525f5[_0x27bf('0x3d')],_0x4525f5[_0x27bf('0x3e')]);_0x5bdc11[_0x27bf('0x42')]=_[_0x27bf('0x41')](_0x4525f5['model'],qs[_0x27bf('0x43')](_0x335a7b['query']['fields']));_0x5bdc11[_0x27bf('0x42')]=_0x5bdc11[_0x27bf('0x42')][_0x27bf('0x4f')]?_0x5bdc11['attributes']:_0x4525f5['model'];_0x5bdc11['order']=qs[_0x27bf('0x47')](_0x335a7b[_0x27bf('0x3e')][_0x27bf('0x47')]);_0x5bdc11[_0x27bf('0x48')]=qs[_0x27bf('0x40')](_[_0x27bf('0x63')](_0x335a7b[_0x27bf('0x3e')],_0x4525f5['filters']));if(_0x335a7b[_0x27bf('0x3e')][_0x27bf('0x31')]){_0x5bdc11[_0x27bf('0x48')]=_[_0x27bf('0x49')](_0x5bdc11[_0x27bf('0x48')],{'$or':_['map'](_0x5bdc11[_0x27bf('0x42')],function(_0x2e90e9){var _0x19da18={};_0x19da18[_0x2e90e9]={'$like':'%'+_0x335a7b[_0x27bf('0x3e')]['filter']+'%'};return _0x19da18;})});}_0x5bdc11=_[_0x27bf('0x49')]({},_0x5bdc11,_0x335a7b[_0x27bf('0x4b')]);return _0x51b8e7[_0x27bf('0x98')](_0x5bdc11);}})['then'](function(_0x3179a9){if(_0x3179a9){_0x1bf921=_0x3179a9[_0x27bf('0x4f')];if(!_0x335a7b[_0x27bf('0x3e')][_0x27bf('0x62')](_0x27bf('0x44'))){_0x5bdc11[_0x27bf('0x45')]=qs[_0x27bf('0x45')](_0x335a7b['query'][_0x27bf('0x45')]);_0x5bdc11[_0x27bf('0x23')]=qs['offset'](_0x335a7b[_0x27bf('0x3e')]['offset']);}return _0x51b8e7[_0x27bf('0x98')](_0x5bdc11);}})[_0x27bf('0x2a')](function(_0x1e67f5){return _0x1e67f5?{'count':_0x1bf921,'rows':_0x1e67f5}:null;})[_0x27bf('0x2a')](respondWithResult(_0x5f495c,null))['catch'](handleError(_0x5f495c,null));};exports['getLists']=function(_0x125a9d,_0x5cda99,_0x22344a){var _0xd83d94={};var _0xb66456={};var _0x494622;var _0x9bfd9e;return db[_0x27bf('0x3b')][_0x27bf('0x60')]({'where':{'id':_0x125a9d[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x5cda99,null))[_0x27bf('0x2a')](function(_0x1e71de){if(_0x1e71de){_0x494622=_0x1e71de;_0xb66456['model']=_[_0x27bf('0x3f')](db[_0x27bf('0x99')]['rawAttributes']);_0xb66456[_0x27bf('0x3e')]=_['keys'](_0x125a9d[_0x27bf('0x3e')]);_0xb66456['filters']=_[_0x27bf('0x41')](_0xb66456[_0x27bf('0x3d')],_0xb66456[_0x27bf('0x3e')]);_0xd83d94[_0x27bf('0x42')]=_['intersection'](_0xb66456[_0x27bf('0x3d')],qs[_0x27bf('0x43')](_0x125a9d[_0x27bf('0x3e')]['fields']));_0xd83d94[_0x27bf('0x42')]=_0xd83d94[_0x27bf('0x42')]['length']?_0xd83d94['attributes']:_0xb66456[_0x27bf('0x3d')];_0xd83d94['order']=qs[_0x27bf('0x47')](_0x125a9d[_0x27bf('0x3e')][_0x27bf('0x47')]);_0xd83d94[_0x27bf('0x48')]=qs[_0x27bf('0x40')](_[_0x27bf('0x63')](_0x125a9d['query'],_0xb66456[_0x27bf('0x40')]));if(_0x125a9d['query'][_0x27bf('0x31')]){_0xd83d94['where']=_['merge'](_0xd83d94[_0x27bf('0x48')],{'$or':_[_0x27bf('0x32')](_0xd83d94['attributes'],function(_0x1af3e4){var _0x27d3fe={};_0x27d3fe[_0x1af3e4]={'$like':'%'+_0x125a9d[_0x27bf('0x3e')]['filter']+'%'};return _0x27d3fe;})});}_0xd83d94=_[_0x27bf('0x49')]({},_0xd83d94,_0x125a9d[_0x27bf('0x4b')]);return _0x494622[_0x27bf('0x9a')](_0xd83d94);}})[_0x27bf('0x2a')](function(_0x40fd10){if(_0x40fd10){_0x9bfd9e=_0x40fd10[_0x27bf('0x4f')];if(!_0x125a9d[_0x27bf('0x3e')][_0x27bf('0x62')](_0x27bf('0x44'))){_0xd83d94[_0x27bf('0x45')]=qs[_0x27bf('0x45')](_0x125a9d[_0x27bf('0x3e')][_0x27bf('0x45')]);_0xd83d94[_0x27bf('0x23')]=qs[_0x27bf('0x23')](_0x125a9d['query'][_0x27bf('0x23')]);}return _0x494622[_0x27bf('0x9a')](_0xd83d94);}})['then'](function(_0x416a24){if(_0x416a24){return _0x416a24?{'count':_0x9bfd9e,'rows':_0x416a24}:null;}})[_0x27bf('0x2a')](respondWithResult(_0x5cda99,null))[_0x27bf('0x51')](handleError(_0x5cda99,null));};exports[_0x27bf('0x9b')]=function(_0x3d24d2,_0x40885a,_0x3f9831){var _0x45dd20,_0x2ff07e;return db[_0x27bf('0x3b')][_0x27bf('0x36')]({'where':{'id':_0x3d24d2[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x40885a,null))[_0x27bf('0x2a')](function(_0x28a44b){if(_0x28a44b){_0x2ff07e=_0x28a44b;return _0x28a44b[_0x27bf('0x9b')](_0x3d24d2[_0x27bf('0x53')][_0x27bf('0x7f')],_['omit'](_0x3d24d2[_0x27bf('0x53')],[_0x27bf('0x7f'),'id'])||{});}return null;})[_0x27bf('0x94')](function(_0x5e0589){var _0xba8557;_0x45dd20=_0x5e0589||[];var _0x33020e=[];if(_0x5e0589){for(var _0x5c0d13=0x0;_0x5c0d13<_0x5e0589[_0x27bf('0x4f')];_0x5c0d13+=0x1){var _0x1d4a32=_0x5e0589[_0x5c0d13][_0x27bf('0x2c')]({'plain':!![]});_0x2ff07e[_0x27bf('0x9c')]=_0x3d24d2[_0x27bf('0x53')][_0x27bf('0x9c')]?_0x3d24d2[_0x27bf('0x53')][_0x27bf('0x9c')]:_0x2ff07e[_0x27bf('0x9c')];switch(_0x2ff07e[_0x27bf('0x9c')]){case _0x27bf('0x9d'):_0xba8557=squel['insert']()[_0x27bf('0x9e')]('cm_hopper')[_0x27bf('0x9f')]([_0x27bf('0xa0'),_0x27bf('0xa1'),'ContactId','ListId',_0x27bf('0x64'),'createdAt',_0x27bf('0x5a')],squel[_0x27bf('0x81')]()[_0x27bf('0xa2')]('phone',_0x27bf('0xa0'))[_0x27bf('0xa2')](_0x27bf('0xa3'),_0x27bf('0xa1'))[_0x27bf('0xa2')]('id',_0x27bf('0xa4'))[_0x27bf('0xa2')](_0x1d4a32['CmListId'][_0x27bf('0x89')](),_0x27bf('0xa5'))['field'](_0x3d24d2['params']['id']['toString'](),_0x27bf('0x64'))[_0x27bf('0xa2')]('NOW()',_0x27bf('0x5b'))[_0x27bf('0xa2')](_0x27bf('0xa3'),_0x27bf('0x5a'))[_0x27bf('0x82')](_0x27bf('0xa6'))['where'](_0x27bf('0xa7'))[_0x27bf('0x48')](_0x27bf('0xa8'),_0x1d4a32[_0x27bf('0xa9')][_0x27bf('0x89')]())[_0x27bf('0x48')](_0x27bf('0xaa'))[_0x27bf('0x48')](_0x27bf('0xab'),squel[_0x27bf('0x81')]()[_0x27bf('0xa2')]('COALESCE(calleridnum,\x27\x27)')[_0x27bf('0x82')](_0x27bf('0xac'))[_0x27bf('0x48')]('VoiceQueueId\x20=\x20?',_0x3d24d2[_0x27bf('0x5e')]['id'][_0x27bf('0x89')]()))[_0x27bf('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x27bf('0x81')]()['field'](_0x27bf('0xad'))[_0x27bf('0x82')](_0x27bf('0xae'))[_0x27bf('0x48')](_0x27bf('0xaf'),_0x3d24d2[_0x27bf('0x5e')]['id'][_0x27bf('0x89')]())))[_0x27bf('0x89')]();break;case _0x27bf('0xb0'):_0xba8557=squel['insert']()[_0x27bf('0x9e')](_0x27bf('0xae'))[_0x27bf('0x9f')](['phone',_0x27bf('0xa1'),_0x27bf('0xa4'),_0x27bf('0xa5'),_0x27bf('0x64'),_0x27bf('0x5b'),'updatedAt'],squel[_0x27bf('0x81')]()[_0x27bf('0xa2')](_0x27bf('0xa0'),_0x27bf('0xa0'))[_0x27bf('0xa2')](_0x27bf('0xa3'),'scheduledAt')[_0x27bf('0xa2')]('id',_0x27bf('0xa4'))['field'](_0x1d4a32['CmListId'][_0x27bf('0x89')](),_0x27bf('0xa5'))[_0x27bf('0xa2')](_0x3d24d2[_0x27bf('0x5e')]['id'][_0x27bf('0x89')](),_0x27bf('0x64'))[_0x27bf('0xa2')](_0x27bf('0xa3'),_0x27bf('0x5b'))[_0x27bf('0xa2')](_0x27bf('0xa3'),_0x27bf('0x5a'))[_0x27bf('0x82')](_0x27bf('0xa6'))[_0x27bf('0x48')](_0x27bf('0xa7'))['where'](_0x27bf('0xa8'),_0x1d4a32[_0x27bf('0xa9')][_0x27bf('0x89')]())[_0x27bf('0x48')](_0x27bf('0xaa'))[_0x27bf('0x48')](_0x27bf('0xab'),squel[_0x27bf('0x81')]()[_0x27bf('0xa2')](_0x27bf('0xad'))[_0x27bf('0x82')](_0x27bf('0xae'))[_0x27bf('0x48')](_0x27bf('0xaf'),_0x3d24d2['params']['id']['toString']())))['toString']();break;default:_0xba8557=squel[_0x27bf('0xb1')]()['into']('cm_hopper')[_0x27bf('0x9f')]([_0x27bf('0xa0'),_0x27bf('0xa1'),'ContactId',_0x27bf('0xa5'),_0x27bf('0x64'),_0x27bf('0x5b'),'updatedAt'],squel[_0x27bf('0x81')]()[_0x27bf('0xa2')](_0x27bf('0xa0'),_0x27bf('0xa0'))[_0x27bf('0xa2')](_0x27bf('0xa3'),'scheduledAt')[_0x27bf('0xa2')]('id',_0x27bf('0xa4'))[_0x27bf('0xa2')](_0x1d4a32['CmListId'][_0x27bf('0x89')](),_0x27bf('0xa5'))[_0x27bf('0xa2')](_0x3d24d2[_0x27bf('0x5e')]['id']['toString'](),'VoiceQueueId')[_0x27bf('0xa2')](_0x27bf('0xa3'),_0x27bf('0x5b'))[_0x27bf('0xa2')]('NOW()',_0x27bf('0x5a'))[_0x27bf('0x82')](_0x27bf('0xa6'))['where'](_0x27bf('0xa7'))[_0x27bf('0x48')](_0x27bf('0xa8'),_0x1d4a32[_0x27bf('0xa9')]['toString']())[_0x27bf('0x48')](_0x27bf('0xaa')))['toString']();}_0x33020e[_0x27bf('0x88')](db[_0x27bf('0x74')][_0x27bf('0x3e')](_0xba8557));}return BPromise['all'](_0x33020e);}})[_0x27bf('0x2a')](function(){return _0x45dd20;})[_0x27bf('0x2a')](respondWithResult(_0x40885a,null))[_0x27bf('0x51')](handleError(_0x40885a,null));};exports['removeLists']=function(_0xfaf305,_0x181bbc,_0x233f53){return db['VoiceQueue']['find']({'where':{'id':_0xfaf305['params']['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x181bbc,null))[_0x27bf('0x2a')](function(_0x3625e4){if(_0x3625e4){return _0x3625e4['removeLists'](_0xfaf305[_0x27bf('0x3e')][_0x27bf('0x7f')]);}})['then'](function(_0x28f8b9){if(_0x28f8b9){return db[_0x27bf('0x61')]['destroy']({'where':{'ListId':_0xfaf305[_0x27bf('0x3e')][_0x27bf('0x7f')],'VoiceQueueId':_0xfaf305[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](function(){return _0x28f8b9;});}})[_0x27bf('0x2a')](respondWithStatusCode(_0x181bbc,null))[_0x27bf('0x51')](handleError(_0x181bbc,null));};exports['getBlackLists']=function(_0x3dd3c1,_0x3345ad,_0x109757){var _0xa04565={};var _0x151b8c={};var _0x1fdb93;var _0x4eb66c;return db[_0x27bf('0x3b')][_0x27bf('0x60')]({'where':{'id':_0x3dd3c1[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x3345ad,null))['then'](function(_0x4656a6){if(_0x4656a6){_0x1fdb93=_0x4656a6;_0x151b8c[_0x27bf('0x3d')]=_[_0x27bf('0x3f')](db[_0x27bf('0x99')][_0x27bf('0x58')]);_0x151b8c['query']=_[_0x27bf('0x3f')](_0x3dd3c1[_0x27bf('0x3e')]);_0x151b8c['filters']=_['intersection'](_0x151b8c[_0x27bf('0x3d')],_0x151b8c[_0x27bf('0x3e')]);_0xa04565[_0x27bf('0x42')]=_['intersection'](_0x151b8c[_0x27bf('0x3d')],qs[_0x27bf('0x43')](_0x3dd3c1['query'][_0x27bf('0x43')]));_0xa04565[_0x27bf('0x42')]=_0xa04565['attributes'][_0x27bf('0x4f')]?_0xa04565[_0x27bf('0x42')]:_0x151b8c[_0x27bf('0x3d')];_0xa04565[_0x27bf('0x46')]=qs[_0x27bf('0x47')](_0x3dd3c1['query'][_0x27bf('0x47')]);_0xa04565[_0x27bf('0x48')]=qs['filters'](_[_0x27bf('0x63')](_0x3dd3c1[_0x27bf('0x3e')],_0x151b8c[_0x27bf('0x40')]));if(_0x3dd3c1['query'][_0x27bf('0x31')]){_0xa04565[_0x27bf('0x48')]=_[_0x27bf('0x49')](_0xa04565[_0x27bf('0x48')],{'$or':_['map'](_0xa04565[_0x27bf('0x42')],function(_0x1cbc37){var _0x5f3e03={};_0x5f3e03[_0x1cbc37]={'$like':'%'+_0x3dd3c1[_0x27bf('0x3e')]['filter']+'%'};return _0x5f3e03;})});}_0xa04565=_[_0x27bf('0x49')]({},_0xa04565,_0x3dd3c1['options']);return _0x1fdb93[_0x27bf('0xb2')](_0xa04565);}})[_0x27bf('0x2a')](function(_0x14b920){if(_0x14b920){_0x4eb66c=_0x14b920[_0x27bf('0x4f')];if(!_0x3dd3c1[_0x27bf('0x3e')]['hasOwnProperty'](_0x27bf('0x44'))){_0xa04565[_0x27bf('0x45')]=qs['limit'](_0x3dd3c1[_0x27bf('0x3e')][_0x27bf('0x45')]);_0xa04565[_0x27bf('0x23')]=qs[_0x27bf('0x23')](_0x3dd3c1[_0x27bf('0x3e')][_0x27bf('0x23')]);}return _0x1fdb93[_0x27bf('0xb2')](_0xa04565);}})['then'](function(_0x1a4424){if(_0x1a4424){return _0x1a4424?{'count':_0x4eb66c,'rows':_0x1a4424}:null;}})['then'](respondWithResult(_0x3345ad,null))['catch'](handleError(_0x3345ad,null));};exports['addBlackLists']=function(_0x5e9bd8,_0x42f0b2,_0x4f6f15){var _0x5e5cc7,_0x33bdfb;return db[_0x27bf('0x3b')][_0x27bf('0x36')]({'where':{'id':_0x5e9bd8['params']['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x42f0b2,null))[_0x27bf('0x2a')](function(_0x2e826c){if(_0x2e826c){_0x33bdfb=_0x2e826c;return _0x2e826c[_0x27bf('0xb3')](_0x5e9bd8['body'][_0x27bf('0x7f')],_[_0x27bf('0x59')](_0x5e9bd8['body'],['ids','id'])||{});}return null;})[_0x27bf('0x94')](function(_0x2b1054){var _0x3a73db;_0x5e5cc7=_0x2b1054||[];var _0x23c344=[];if(_0x2b1054){for(var _0x5c62ac=0x0;_0x5c62ac<_0x2b1054[_0x27bf('0x4f')];_0x5c62ac+=0x1){var _0x5b1675=_0x2b1054[_0x5c62ac]['get']({'plain':!![]});_0x3a73db=squel[_0x27bf('0xb1')]()[_0x27bf('0x9e')](_0x27bf('0xb4'))[_0x27bf('0x9f')]([_0x27bf('0xa0'),_0x27bf('0xa4'),_0x27bf('0xa5'),'VoiceQueueId','createdAt','updatedAt'],squel[_0x27bf('0x81')]()['field'](_0x27bf('0xa0'),_0x27bf('0xa0'))[_0x27bf('0xa2')]('id',_0x27bf('0xa4'))[_0x27bf('0xa2')](_0x5b1675[_0x27bf('0xa9')][_0x27bf('0x89')](),_0x27bf('0xa5'))['field'](_0x5e9bd8['params']['id']['toString'](),'VoiceQueueId')[_0x27bf('0xa2')](_0x27bf('0xa3'),_0x27bf('0x5b'))[_0x27bf('0xa2')](_0x27bf('0xa3'),'updatedAt')[_0x27bf('0x82')](_0x27bf('0xa6'))[_0x27bf('0x48')](_0x27bf('0xa7'))[_0x27bf('0x48')](_0x27bf('0xa8'),_0x5b1675[_0x27bf('0xa9')]['toString']())[_0x27bf('0x48')](_0x27bf('0xaa')))[_0x27bf('0x89')]();_0x23c344[_0x27bf('0x88')](db[_0x27bf('0x74')][_0x27bf('0x3e')](_0x3a73db));}return BPromise['all'](_0x23c344);}})['then'](function(){return _0x5e5cc7;})[_0x27bf('0x2a')](respondWithResult(_0x42f0b2,null))[_0x27bf('0x51')](handleError(_0x42f0b2,null));};exports[_0x27bf('0xb5')]=function(_0x252ffd,_0x2054b6,_0x19c3cc){return db[_0x27bf('0x3b')]['find']({'where':{'id':_0x252ffd[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](handleEntityNotFound(_0x2054b6,null))[_0x27bf('0x2a')](function(_0x952b54){if(_0x952b54){return _0x952b54[_0x27bf('0xb5')](_0x252ffd['query'][_0x27bf('0x7f')]);}})['then'](function(_0x1eb1cf){if(_0x1eb1cf){return db[_0x27bf('0x6a')][_0x27bf('0x2b')]({'where':{'ListId':_0x252ffd[_0x27bf('0x3e')][_0x27bf('0x7f')],'VoiceQueueId':_0x252ffd[_0x27bf('0x5e')]['id']}})[_0x27bf('0x2a')](function(){return _0x1eb1cf;});}})['then'](respondWithStatusCode(_0x2054b6,null))[_0x27bf('0x51')](handleError(_0x2054b6,null));};
\ No newline at end of file
+var _0xc758=['COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','type','name','UserProfileResource','destroy','error','stack','send','index','VoiceQueue','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','options','includeAll','rows','show','params','catch','create','body','user','find','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','length','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','getHoppers','order','VoiceQueueId','CmHopper','include','findAll','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','interface','flatMap','penalty','sequelize','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','voicePause','forEach','emit','ids','select','field','tq.TeamId','from','join','user_has_teams','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','upsert','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','cm_contacts','phone\x20IS\x20NOT\x20NULL'];(function(_0x19d8be,_0x2e4c8d){var _0x1b75bc=function(_0x1225bd){while(--_0x1225bd){_0x19d8be['push'](_0x19d8be['shift']());}};_0x1b75bc(++_0x2e4c8d);}(_0xc758,0xb9));var _0x8c75=function(_0x4d8343,_0x58919b){_0x4d8343=_0x4d8343-0x0;var _0xbf813c=_0xc758[_0x4d8343];return _0xbf813c;};'use strict';var pdf=require(_0x8c75('0x0'));var emlformat=require(_0x8c75('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8c75('0x2'));var jsonpatch=require(_0x8c75('0x3'));var rp=require('request-promise');var moment=require(_0x8c75('0x4'));var BPromise=require(_0x8c75('0x5'));var Mustache=require(_0x8c75('0x6'));var util=require(_0x8c75('0x7'));var path=require(_0x8c75('0x8'));var sox=require(_0x8c75('0x9'));var csv=require(_0x8c75('0xa'));var ejs=require(_0x8c75('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8c75('0xc'));var crypto=require(_0x8c75('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8c75('0xe'));var toCsv=require(_0x8c75('0xa'));var querystring=require(_0x8c75('0xf'));var Papa=require(_0x8c75('0x10'));var Redis=require('ioredis');var authService=require(_0x8c75('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8c75('0x12'));var hardwareService=require(_0x8c75('0x13'));var logger=require('../../config/logger')(_0x8c75('0x14'));var utils=require(_0x8c75('0x15'));var config=require(_0x8c75('0x16'));var db=require(_0x8c75('0x17'))['db'];config[_0x8c75('0x18')]=_[_0x8c75('0x19')](config[_0x8c75('0x18')],{'host':_0x8c75('0x1a'),'port':0x18eb});var socket=require(_0x8c75('0x1b'))(new Redis(config[_0x8c75('0x18')]));require(_0x8c75('0x1c'))[_0x8c75('0x1d')](socket);function respondWithStatusCode(_0x43e43d,_0x2f6446){_0x2f6446=_0x2f6446||0xcc;return function(_0x5edc73){if(_0x5edc73){return _0x43e43d[_0x8c75('0x1e')](_0x2f6446);}return _0x43e43d[_0x8c75('0x1f')](_0x2f6446)[_0x8c75('0x20')]();};}function respondWithResult(_0xa3b20,_0x5b2ef4){_0x5b2ef4=_0x5b2ef4||0xc8;return function(_0x216d26){if(_0x216d26){return _0xa3b20[_0x8c75('0x1f')](_0x5b2ef4)[_0x8c75('0x21')](_0x216d26);}};}function respondWithFilteredResult(_0x50176b,_0x3d20a7){return function(_0x31ddf9){if(_0x31ddf9){var _0x534410=_0x31ddf9[_0x8c75('0x22')],_0x2a452e=_0x3d20a7['offset'],_0x235274=_0x3d20a7[_0x8c75('0x23')]+_0x3d20a7['limit'],_0x67ee41;if(_0x235274>=_0x534410){_0x235274=_0x534410;_0x67ee41=0xc8;}else{_0x67ee41=0xce;}_0x50176b[_0x8c75('0x1f')](_0x67ee41);return _0x50176b['set'](_0x8c75('0x24'),_0x2a452e+'-'+_0x235274+'/'+_0x534410)[_0x8c75('0x21')](_0x31ddf9);}return null;};}function patchUpdates(_0x52027e){return function(_0x4d9b97){try{jsonpatch[_0x8c75('0x25')](_0x4d9b97,_0x52027e,!![]);}catch(_0x24101b){return BPromise['reject'](_0x24101b);}return _0x4d9b97[_0x8c75('0x26')]();};}function saveUpdates(_0x298f13,_0x2bd9ee){return function(_0x43b5ae){if(_0x43b5ae){return _0x43b5ae[_0x8c75('0x27')](_0x298f13)[_0x8c75('0x28')](function(_0x390eee){return _0x390eee;});}return null;};}function removeEntity(_0x4f6a93,_0x5d5c51){return function(_0x227ca3){if(_0x227ca3){return _0x227ca3['destroy']()[_0x8c75('0x28')](function(){var _0xb76ab6=_0x227ca3[_0x8c75('0x29')]({'plain':!![]});var _0x2360e6=[{'name':_0x8c75('0x2a'),'value':_0x8c75('0x2b'),'ignore':![]},{'name':_0x8c75('0x2c'),'value':_0x8c75('0x2d'),'ignore':![]}];var _0x117053=_(_0x2360e6)[_0x8c75('0x2e')]('ignore')[_0x8c75('0x2f')]('value')[_0x8c75('0x30')]();if(_['includes'](_0x117053,_0xb76ab6['type'])){return;}var _0x3faf17=_['find'](_0x2360e6,[_0x8c75('0x30'),_0xb76ab6[_0x8c75('0x31')]])[_0x8c75('0x32')];return db[_0x8c75('0x33')][_0x8c75('0x34')]({'where':{'type':_0x3faf17,'resourceId':_0xb76ab6['id']}})['then'](function(){return _0x227ca3;});})[_0x8c75('0x28')](function(){_0x4f6a93[_0x8c75('0x1f')](0xcc)[_0x8c75('0x20')]();});}};}function handleEntityNotFound(_0x4e4f9d,_0xde1164){return function(_0x44b290){if(!_0x44b290){_0x4e4f9d['sendStatus'](0x194);}return _0x44b290;};}function handleError(_0x440195,_0x266791){_0x266791=_0x266791||0x1f4;return function(_0x137685){logger[_0x8c75('0x35')](_0x137685[_0x8c75('0x36')]);if(_0x137685['name']){delete _0x137685[_0x8c75('0x32')];}_0x440195['status'](_0x266791)[_0x8c75('0x37')](_0x137685);};}exports[_0x8c75('0x38')]=function(_0x209b0c,_0x4cd795){var _0x36b93b={},_0x3bcec6={},_0x1db6d0={'count':0x0,'rows':[]};var _0x58f9cf=_[_0x8c75('0x2f')](db[_0x8c75('0x39')]['rawAttributes'],function(_0x3ab696){return{'name':_0x3ab696[_0x8c75('0x3a')],'type':_0x3ab696['type'][_0x8c75('0x3b')]};});_0x3bcec6[_0x8c75('0x3c')]=_[_0x8c75('0x2f')](_0x58f9cf,_0x8c75('0x32'));_0x3bcec6[_0x8c75('0x3d')]=_[_0x8c75('0x3e')](_0x209b0c['query']);_0x3bcec6[_0x8c75('0x3f')]=_[_0x8c75('0x40')](_0x3bcec6[_0x8c75('0x3c')],_0x3bcec6[_0x8c75('0x3d')]);_0x36b93b['attributes']=_[_0x8c75('0x40')](_0x3bcec6[_0x8c75('0x3c')],qs[_0x8c75('0x41')](_0x209b0c[_0x8c75('0x3d')][_0x8c75('0x41')]));_0x36b93b['attributes']=_0x36b93b[_0x8c75('0x42')]['length']?_0x36b93b['attributes']:_0x3bcec6['model'];if(!_0x209b0c[_0x8c75('0x3d')][_0x8c75('0x43')](_0x8c75('0x44'))){_0x36b93b[_0x8c75('0x45')]=qs[_0x8c75('0x45')](_0x209b0c[_0x8c75('0x3d')]['limit']);_0x36b93b[_0x8c75('0x23')]=qs['offset'](_0x209b0c[_0x8c75('0x3d')]['offset']);}_0x36b93b['order']=qs[_0x8c75('0x46')](_0x209b0c[_0x8c75('0x3d')][_0x8c75('0x46')]);_0x36b93b[_0x8c75('0x47')]=qs[_0x8c75('0x3f')](_[_0x8c75('0x48')](_0x209b0c[_0x8c75('0x3d')],_0x3bcec6[_0x8c75('0x3f')]),_0x58f9cf);if(_0x209b0c[_0x8c75('0x3d')]['filter']){_0x36b93b[_0x8c75('0x47')]=_[_0x8c75('0x49')](_0x36b93b[_0x8c75('0x47')],{'$or':_[_0x8c75('0x2f')](_0x58f9cf,function(_0x4d21af){if(_0x4d21af[_0x8c75('0x31')]!==_0x8c75('0x4a')){var _0x7c3b82={};_0x7c3b82[_0x4d21af[_0x8c75('0x32')]]={'$like':'%'+_0x209b0c['query'][_0x8c75('0x2e')]+'%'};return _0x7c3b82;}})});}_0x36b93b=_['merge']({},_0x36b93b,_0x209b0c[_0x8c75('0x4b')]);var _0x27d674={'where':_0x36b93b[_0x8c75('0x47')]};return db[_0x8c75('0x39')][_0x8c75('0x22')](_0x27d674)[_0x8c75('0x28')](function(_0xf3201d){_0x1db6d0[_0x8c75('0x22')]=_0xf3201d;if(_0x209b0c['query'][_0x8c75('0x4c')]){_0x36b93b['include']=[{'all':!![]}];}return db[_0x8c75('0x39')]['findAll'](_0x36b93b);})[_0x8c75('0x28')](function(_0x45ac96){_0x1db6d0[_0x8c75('0x4d')]=_0x45ac96;return _0x1db6d0;})['then'](respondWithFilteredResult(_0x4cd795,_0x36b93b))['catch'](handleError(_0x4cd795,null));};exports[_0x8c75('0x4e')]=function(_0x1ba1a4,_0x41ae51){var _0x286619={'raw':![],'where':{'id':_0x1ba1a4[_0x8c75('0x4f')]['id']}},_0x58c3d5={};_0x58c3d5['model']=_['keys'](db['VoiceQueue']['rawAttributes']);_0x58c3d5['query']=_['keys'](_0x1ba1a4['query']);_0x58c3d5[_0x8c75('0x3f')]=_[_0x8c75('0x40')](_0x58c3d5[_0x8c75('0x3c')],_0x58c3d5['query']);_0x286619[_0x8c75('0x42')]=_[_0x8c75('0x40')](_0x58c3d5[_0x8c75('0x3c')],qs['fields'](_0x1ba1a4[_0x8c75('0x3d')][_0x8c75('0x41')]));_0x286619[_0x8c75('0x42')]=_0x286619[_0x8c75('0x42')]['length']?_0x286619[_0x8c75('0x42')]:_0x58c3d5['model'];if(_0x1ba1a4[_0x8c75('0x3d')][_0x8c75('0x4c')]){_0x286619['include']=[{'all':!![]}];}_0x286619=_[_0x8c75('0x49')]({},_0x286619,_0x1ba1a4[_0x8c75('0x4b')]);return db['VoiceQueue']['find'](_0x286619)[_0x8c75('0x28')](handleEntityNotFound(_0x41ae51,null))[_0x8c75('0x28')](respondWithResult(_0x41ae51,null))[_0x8c75('0x50')](handleError(_0x41ae51,null));};exports['create']=function(_0x4d2b0f,_0x4ab00e){return db['VoiceQueue'][_0x8c75('0x51')](_0x4d2b0f[_0x8c75('0x52')],{})[_0x8c75('0x28')](function(_0x5096bb){var _0x2abefd=_0x4d2b0f['user'][_0x8c75('0x29')]({'plain':!![]});if(!_0x2abefd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2abefd['role']===_0x8c75('0x53')){var _0x4a7bf4=_0x5096bb[_0x8c75('0x29')]({'plain':!![]});var _0x1c1e34=[{'name':_0x8c75('0x2a'),'value':'inbound'},{'name':_0x8c75('0x2c'),'value':_0x8c75('0x2d')}];var _0x4ee870=_[_0x8c75('0x54')](_0x1c1e34,[_0x8c75('0x30'),_0x4a7bf4[_0x8c75('0x31')]])['name'];return db[_0x8c75('0x55')]['find']({'where':{'name':_0x4ee870,'userProfileId':_0x2abefd['userProfileId']},'raw':!![]})['then'](function(_0x15ecc9){if(_0x15ecc9&&_0x15ecc9[_0x8c75('0x56')]===0x0){return db[_0x8c75('0x33')]['create']({'name':_0x4a7bf4[_0x8c75('0x32')],'resourceId':_0x4a7bf4['id'],'type':_0x15ecc9[_0x8c75('0x32')],'sectionId':_0x15ecc9['id']},{})['then'](function(){return _0x5096bb;});}else{return _0x5096bb;}})['catch'](function(_0x2a5f34){logger['error'](_0x8c75('0x57'),_0x2a5f34);throw _0x2a5f34;});}return _0x5096bb;})['then'](respondWithResult(_0x4ab00e,0xc9))[_0x8c75('0x50')](handleError(_0x4ab00e,null));};exports['clone']=function(_0x559185,_0x5130be){var _0x142895={'where':{'id':_0x559185['params']['id']}},_0x1d1d4c={};_0x1d1d4c[_0x8c75('0x3c')]=_[_0x8c75('0x3e')](db[_0x8c75('0x39')][_0x8c75('0x58')]);_0x142895['attributes']=_[_0x8c75('0x40')](_0x1d1d4c['model'],qs[_0x8c75('0x41')](_0x559185[_0x8c75('0x3d')][_0x8c75('0x41')]));_0x142895[_0x8c75('0x42')]=_0x142895[_0x8c75('0x42')][_0x8c75('0x59')]?_0x142895[_0x8c75('0x42')]:_0x1d1d4c[_0x8c75('0x3c')];if(_0x559185[_0x8c75('0x3d')]['includeAll']){_0x142895['include']=[{'all':!![]}];}_0x142895=_['merge']({},_0x142895,_0x559185[_0x8c75('0x4b')]);return db['VoiceQueue'][_0x8c75('0x54')](_0x142895)[_0x8c75('0x28')](handleEntityNotFound(_0x5130be,null))[_0x8c75('0x28')](function(_0x181af1){if(_0x181af1){var _0x59762e=_0x181af1[_0x8c75('0x29')]({'plain':!![]});_0x59762e=qs[_0x8c75('0x5a')](_0x59762e,['id',_0x8c75('0x5b'),_0x8c75('0x5c')]);_0x559185['body']=_[_0x8c75('0x5a')](_0x559185['body'],['id',_0x8c75('0x5b'),'updatedAt']);return db['VoiceQueue']['create'](_['merge'](_0x59762e,_0x559185[_0x8c75('0x52')]),{'include':_0x559185[_0x8c75('0x3d')][_0x8c75('0x4c')]?[{'all':!![]}]:undefined})[_0x8c75('0x28')](function(_0x224a79){var _0x4adc8a=_0x559185[_0x8c75('0x53')][_0x8c75('0x29')]({'plain':!![]});if(!_0x4adc8a)throw new Error(_0x8c75('0x5d'));if(_0x4adc8a[_0x8c75('0x5e')]===_0x8c75('0x53')){var _0x376af8=_0x224a79[_0x8c75('0x29')]({'plain':!![]});var _0x1d3082=[{'name':_0x8c75('0x2a'),'value':_0x8c75('0x2b')},{'name':'QueueCampaigns','value':_0x8c75('0x2d')}];var _0x50562f=_[_0x8c75('0x54')](_0x1d3082,[_0x8c75('0x30'),_0x376af8['type']])[_0x8c75('0x32')];return db[_0x8c75('0x55')][_0x8c75('0x54')]({'where':{'name':_0x50562f,'userProfileId':_0x4adc8a[_0x8c75('0x5f')]},'raw':!![]})[_0x8c75('0x28')](function(_0x391dc4){if(_0x391dc4&&_0x391dc4[_0x8c75('0x56')]===0x0){return db[_0x8c75('0x33')][_0x8c75('0x51')]({'name':_0x376af8[_0x8c75('0x32')],'resourceId':_0x376af8['id'],'type':_0x391dc4['name'],'sectionId':_0x391dc4['id']},{})[_0x8c75('0x28')](function(){return _0x224a79;});}else{return _0x224a79;}})['catch'](function(_0xa6f8a5){logger[_0x8c75('0x35')](_0x8c75('0x57'),_0xa6f8a5);throw _0xa6f8a5;});}return _0x224a79;});}})['then'](respondWithResult(_0x5130be,0xc9))[_0x8c75('0x50')](handleError(_0x5130be,null));};exports[_0x8c75('0x27')]=function(_0x5e9c5e,_0x1b975c){if(_0x5e9c5e[_0x8c75('0x52')]['id']){delete _0x5e9c5e[_0x8c75('0x52')]['id'];}return db[_0x8c75('0x39')][_0x8c75('0x54')]({'where':{'id':_0x5e9c5e[_0x8c75('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1b975c,null))[_0x8c75('0x28')](saveUpdates(_0x5e9c5e[_0x8c75('0x52')],null))['then'](respondWithResult(_0x1b975c,null))[_0x8c75('0x50')](handleError(_0x1b975c,null));};exports['destroy']=function(_0x56b1af,_0x20ac0e){return db[_0x8c75('0x39')][_0x8c75('0x54')]({'where':{'id':_0x56b1af[_0x8c75('0x4f')]['id']}})[_0x8c75('0x28')](handleEntityNotFound(_0x20ac0e,null))[_0x8c75('0x28')](removeEntity(_0x20ac0e,null))[_0x8c75('0x50')](handleError(_0x20ac0e,null));};exports[_0x8c75('0x60')]=function(_0x4e1d3f,_0x3f4273,_0x3a853e){var _0x3a8e43={'raw':![],'where':{}};var _0x197f7b={};var _0xfb1901={'count':0x0,'rows':[]};return db[_0x8c75('0x39')]['findOne']({'where':{'id':_0x4e1d3f[_0x8c75('0x4f')]['id']}})[_0x8c75('0x28')](handleEntityNotFound(_0x3f4273,null))[_0x8c75('0x28')](function(_0x84d162){if(_0x84d162){_0x197f7b[_0x8c75('0x3c')]=_['keys'](db['CmHopper']['rawAttributes']);_0x197f7b[_0x8c75('0x3d')]=_[_0x8c75('0x3e')](_0x4e1d3f[_0x8c75('0x3d')]);_0x197f7b[_0x8c75('0x3f')]=_[_0x8c75('0x40')](_0x197f7b[_0x8c75('0x3c')],_0x197f7b['query']);_0x3a8e43['attributes']=_[_0x8c75('0x40')](_0x197f7b[_0x8c75('0x3c')],qs[_0x8c75('0x41')](_0x4e1d3f[_0x8c75('0x3d')][_0x8c75('0x41')]));_0x3a8e43['attributes']=_0x3a8e43[_0x8c75('0x42')][_0x8c75('0x59')]?_0x3a8e43['attributes']:_0x197f7b[_0x8c75('0x3c')];if(!_0x4e1d3f[_0x8c75('0x3d')][_0x8c75('0x43')](_0x8c75('0x44'))){_0x3a8e43['limit']=qs[_0x8c75('0x45')](_0x4e1d3f[_0x8c75('0x3d')][_0x8c75('0x45')]);_0x3a8e43[_0x8c75('0x23')]=qs['offset'](_0x4e1d3f[_0x8c75('0x3d')][_0x8c75('0x23')]);}_0x3a8e43[_0x8c75('0x61')]=qs['sort'](_0x4e1d3f['query'][_0x8c75('0x46')]);_0x3a8e43[_0x8c75('0x47')]=qs[_0x8c75('0x3f')](_[_0x8c75('0x48')](_0x4e1d3f[_0x8c75('0x3d')],_0x197f7b[_0x8c75('0x3f')]));_0x3a8e43[_0x8c75('0x47')][_0x8c75('0x62')]=_0x84d162['id'];if(_0x4e1d3f[_0x8c75('0x3d')][_0x8c75('0x2e')]){_0x3a8e43['where']=_[_0x8c75('0x49')](_0x3a8e43[_0x8c75('0x47')],{'$or':_[_0x8c75('0x2f')](_0x3a8e43[_0x8c75('0x42')],function(_0x15adf2){var _0x58bd13={};_0x58bd13[_0x15adf2]={'$like':'%'+_0x4e1d3f['query'][_0x8c75('0x2e')]+'%'};return _0x58bd13;})});}_0x3a8e43=_[_0x8c75('0x49')]({},_0x3a8e43,_0x4e1d3f[_0x8c75('0x4b')]);return db[_0x8c75('0x63')][_0x8c75('0x22')]({'where':_0x3a8e43[_0x8c75('0x47')]})[_0x8c75('0x28')](function(_0x4ec81c){_0xfb1901[_0x8c75('0x22')]=_0x4ec81c;if(_0x4e1d3f[_0x8c75('0x3d')][_0x8c75('0x4c')]){_0x3a8e43[_0x8c75('0x64')]=[{'all':!![]}];}return db[_0x8c75('0x63')][_0x8c75('0x65')](_0x3a8e43);})[_0x8c75('0x28')](function(_0xcfca17){_0xfb1901[_0x8c75('0x4d')]=_0xcfca17;return _0xfb1901;});}})[_0x8c75('0x28')](respondWithFilteredResult(_0x3f4273,_0x3a8e43))[_0x8c75('0x50')](handleError(_0x3f4273,null));};exports[_0x8c75('0x66')]=function(_0x2d5ba9,_0x6803bd,_0x22df63){var _0x4daff2={'raw':!![],'where':{}};var _0x14baf5={};var _0x4cb142={'count':0x0,'rows':[]};return db[_0x8c75('0x39')][_0x8c75('0x67')]({'where':{'id':_0x2d5ba9[_0x8c75('0x4f')]['id']}})[_0x8c75('0x28')](handleEntityNotFound(_0x6803bd,null))[_0x8c75('0x28')](function(_0x138f09){if(_0x138f09){_0x14baf5[_0x8c75('0x3c')]=_['keys'](db[_0x8c75('0x68')][_0x8c75('0x58')]);_0x14baf5[_0x8c75('0x3d')]=_[_0x8c75('0x3e')](_0x2d5ba9[_0x8c75('0x3d')]);_0x14baf5[_0x8c75('0x3f')]=_[_0x8c75('0x40')](_0x14baf5[_0x8c75('0x3c')],_0x14baf5[_0x8c75('0x3d')]);_0x4daff2[_0x8c75('0x42')]=_['intersection'](_0x14baf5[_0x8c75('0x3c')],qs[_0x8c75('0x41')](_0x2d5ba9['query'][_0x8c75('0x41')]));_0x4daff2[_0x8c75('0x42')]=_0x4daff2['attributes'][_0x8c75('0x59')]?_0x4daff2[_0x8c75('0x42')]:_0x14baf5[_0x8c75('0x3c')];if(!_0x2d5ba9['query'][_0x8c75('0x43')]('nolimit')){_0x4daff2[_0x8c75('0x45')]=qs[_0x8c75('0x45')](_0x2d5ba9['query'][_0x8c75('0x45')]);_0x4daff2[_0x8c75('0x23')]=qs[_0x8c75('0x23')](_0x2d5ba9[_0x8c75('0x3d')][_0x8c75('0x23')]);}_0x4daff2[_0x8c75('0x61')]=qs[_0x8c75('0x46')](_0x2d5ba9['query'][_0x8c75('0x46')]);_0x4daff2[_0x8c75('0x47')]=qs[_0x8c75('0x3f')](_[_0x8c75('0x48')](_0x2d5ba9[_0x8c75('0x3d')],_0x14baf5[_0x8c75('0x3f')]));_0x4daff2[_0x8c75('0x47')][_0x8c75('0x62')]=_0x138f09['id'];if(_0x2d5ba9['query'][_0x8c75('0x2e')]){_0x4daff2['where']=_[_0x8c75('0x49')](_0x4daff2[_0x8c75('0x47')],{'$or':_[_0x8c75('0x2f')](_0x4daff2[_0x8c75('0x42')],function(_0x212ec1){var _0x218a0a={};_0x218a0a[_0x212ec1]={'$like':'%'+_0x2d5ba9[_0x8c75('0x3d')][_0x8c75('0x2e')]+'%'};return _0x218a0a;})});}_0x4daff2=_[_0x8c75('0x49')]({},_0x4daff2,_0x2d5ba9[_0x8c75('0x4b')]);return db[_0x8c75('0x68')][_0x8c75('0x22')]({'where':_0x4daff2[_0x8c75('0x47')]})[_0x8c75('0x28')](function(_0x2a6e3d){_0x4cb142[_0x8c75('0x22')]=_0x2a6e3d;if(_0x2d5ba9[_0x8c75('0x3d')][_0x8c75('0x4c')]){_0x4daff2['include']=[{'all':!![]}];}return db[_0x8c75('0x68')][_0x8c75('0x65')](_0x4daff2);})[_0x8c75('0x28')](function(_0x14a5b5){_0x4cb142[_0x8c75('0x4d')]=_0x14a5b5;return _0x4cb142;});}})[_0x8c75('0x28')](respondWithFilteredResult(_0x6803bd,_0x4daff2))[_0x8c75('0x50')](handleError(_0x6803bd,null));};exports['getHopperFinals']=function(_0x2879cb,_0x3050ea,_0x465e35){var _0x3747ea={'raw':!![],'where':{}};var _0x59f7ec={};var _0x3b32fd={'count':0x0,'rows':[]};return db[_0x8c75('0x39')][_0x8c75('0x67')]({'where':{'id':_0x2879cb['params']['id']}})['then'](handleEntityNotFound(_0x3050ea,null))['then'](function(_0x219ddf){if(_0x219ddf){_0x59f7ec[_0x8c75('0x3c')]=_[_0x8c75('0x3e')](db[_0x8c75('0x69')][_0x8c75('0x58')]);_0x59f7ec[_0x8c75('0x3d')]=_[_0x8c75('0x3e')](_0x2879cb[_0x8c75('0x3d')]);_0x59f7ec[_0x8c75('0x3f')]=_[_0x8c75('0x40')](_0x59f7ec[_0x8c75('0x3c')],_0x59f7ec[_0x8c75('0x3d')]);_0x3747ea[_0x8c75('0x42')]=_[_0x8c75('0x40')](_0x59f7ec[_0x8c75('0x3c')],qs[_0x8c75('0x41')](_0x2879cb[_0x8c75('0x3d')][_0x8c75('0x41')]));_0x3747ea[_0x8c75('0x42')]=_0x3747ea['attributes'][_0x8c75('0x59')]?_0x3747ea['attributes']:_0x59f7ec['model'];if(!_0x2879cb[_0x8c75('0x3d')]['hasOwnProperty'](_0x8c75('0x44'))){_0x3747ea[_0x8c75('0x45')]=qs['limit'](_0x2879cb[_0x8c75('0x3d')]['limit']);_0x3747ea[_0x8c75('0x23')]=qs[_0x8c75('0x23')](_0x2879cb['query'][_0x8c75('0x23')]);}_0x3747ea['order']=qs[_0x8c75('0x46')](_0x2879cb[_0x8c75('0x3d')][_0x8c75('0x46')]);_0x3747ea[_0x8c75('0x47')]=qs[_0x8c75('0x3f')](_[_0x8c75('0x48')](_0x2879cb['query'],_0x59f7ec[_0x8c75('0x3f')]));_0x3747ea[_0x8c75('0x47')][_0x8c75('0x62')]=_0x219ddf['id'];if(_0x2879cb[_0x8c75('0x3d')][_0x8c75('0x2e')]){_0x3747ea[_0x8c75('0x47')]=_[_0x8c75('0x49')](_0x3747ea['where'],{'$or':_[_0x8c75('0x2f')](_0x3747ea[_0x8c75('0x42')],function(_0x23c194){var _0x402438={};_0x402438[_0x23c194]={'$like':'%'+_0x2879cb['query']['filter']+'%'};return _0x402438;})});}_0x3747ea=_[_0x8c75('0x49')]({},_0x3747ea,_0x2879cb[_0x8c75('0x4b')]);return db[_0x8c75('0x69')]['count']({'where':_0x3747ea['where']})[_0x8c75('0x28')](function(_0x18cfae){_0x3b32fd[_0x8c75('0x22')]=_0x18cfae;if(_0x2879cb[_0x8c75('0x3d')][_0x8c75('0x4c')]){_0x3747ea[_0x8c75('0x64')]=[{'all':!![]}];}return db[_0x8c75('0x69')][_0x8c75('0x65')](_0x3747ea);})[_0x8c75('0x28')](function(_0x29ecfe){_0x3b32fd['rows']=_0x29ecfe;return _0x3b32fd;});}})['then'](respondWithFilteredResult(_0x3050ea,_0x3747ea))[_0x8c75('0x50')](handleError(_0x3050ea,null));};exports['getHopperBlacks']=function(_0x5a54d8,_0x347baf,_0x34c202){var _0x304ead={'raw':!![],'where':{}};var _0x1a7479={};var _0xaf1fe9={'count':0x0,'rows':[]};return db[_0x8c75('0x39')][_0x8c75('0x67')]({'where':{'id':_0x5a54d8['params']['id']}})[_0x8c75('0x28')](handleEntityNotFound(_0x347baf,null))[_0x8c75('0x28')](function(_0x1bbd6b){if(_0x1bbd6b){_0x1a7479['model']=_[_0x8c75('0x3e')](db[_0x8c75('0x6a')][_0x8c75('0x58')]);_0x1a7479['query']=_[_0x8c75('0x3e')](_0x5a54d8[_0x8c75('0x3d')]);_0x1a7479['filters']=_[_0x8c75('0x40')](_0x1a7479[_0x8c75('0x3c')],_0x1a7479[_0x8c75('0x3d')]);_0x304ead[_0x8c75('0x42')]=_[_0x8c75('0x40')](_0x1a7479['model'],qs[_0x8c75('0x41')](_0x5a54d8[_0x8c75('0x3d')][_0x8c75('0x41')]));_0x304ead[_0x8c75('0x42')]=_0x304ead[_0x8c75('0x42')][_0x8c75('0x59')]?_0x304ead[_0x8c75('0x42')]:_0x1a7479[_0x8c75('0x3c')];if(!_0x5a54d8[_0x8c75('0x3d')][_0x8c75('0x43')](_0x8c75('0x44'))){_0x304ead[_0x8c75('0x45')]=qs[_0x8c75('0x45')](_0x5a54d8[_0x8c75('0x3d')][_0x8c75('0x45')]);_0x304ead[_0x8c75('0x23')]=qs['offset'](_0x5a54d8[_0x8c75('0x3d')]['offset']);}_0x304ead[_0x8c75('0x61')]=qs[_0x8c75('0x46')](_0x5a54d8[_0x8c75('0x3d')][_0x8c75('0x46')]);_0x304ead[_0x8c75('0x47')]=qs[_0x8c75('0x3f')](_['pick'](_0x5a54d8[_0x8c75('0x3d')],_0x1a7479[_0x8c75('0x3f')]));_0x304ead['where'][_0x8c75('0x62')]=_0x1bbd6b['id'];if(_0x5a54d8['query'][_0x8c75('0x2e')]){_0x304ead['where']=_[_0x8c75('0x49')](_0x304ead[_0x8c75('0x47')],{'$or':_['map'](_0x304ead[_0x8c75('0x42')],function(_0x2fb576){var _0x4a4ad2={};_0x4a4ad2[_0x2fb576]={'$like':'%'+_0x5a54d8[_0x8c75('0x3d')]['filter']+'%'};return _0x4a4ad2;})});}_0x304ead=_[_0x8c75('0x49')]({},_0x304ead,_0x5a54d8[_0x8c75('0x4b')]);return db[_0x8c75('0x6a')][_0x8c75('0x22')]({'where':_0x304ead['where']})['then'](function(_0x31161a){_0xaf1fe9[_0x8c75('0x22')]=_0x31161a;if(_0x5a54d8['query'][_0x8c75('0x4c')]){_0x304ead[_0x8c75('0x64')]=[{'all':!![]}];}return db[_0x8c75('0x6a')][_0x8c75('0x65')](_0x304ead);})[_0x8c75('0x28')](function(_0x41520a){_0xaf1fe9[_0x8c75('0x4d')]=_0x41520a;return _0xaf1fe9;});}})['then'](respondWithFilteredResult(_0x347baf,_0x304ead))['catch'](handleError(_0x347baf,null));};exports[_0x8c75('0x6b')]=function(_0x41168a,_0x100371,_0x2c5f3b){var _0x145ece={};var _0x4c7f56={};var _0x255ec7;var _0x51c56f;return db[_0x8c75('0x39')][_0x8c75('0x67')]({'where':{'id':_0x41168a['params']['id']}})[_0x8c75('0x28')](handleEntityNotFound(_0x100371,null))[_0x8c75('0x28')](function(_0x15f10f){if(_0x15f10f){_0x255ec7=_0x15f10f;_0x4c7f56[_0x8c75('0x3c')]=_[_0x8c75('0x3e')](db[_0x8c75('0x6c')][_0x8c75('0x58')]);_0x4c7f56[_0x8c75('0x3d')]=_[_0x8c75('0x3e')](_0x41168a[_0x8c75('0x3d')]);_0x4c7f56[_0x8c75('0x3f')]=_[_0x8c75('0x40')](_0x4c7f56[_0x8c75('0x3c')],_0x4c7f56[_0x8c75('0x3d')]);_0x145ece[_0x8c75('0x42')]=_[_0x8c75('0x40')](_0x4c7f56[_0x8c75('0x3c')],qs[_0x8c75('0x41')](_0x41168a[_0x8c75('0x3d')]['fields']));_0x145ece[_0x8c75('0x42')]=_0x145ece['attributes'][_0x8c75('0x59')]?_0x145ece['attributes']:_0x4c7f56['model'];_0x145ece[_0x8c75('0x61')]=qs[_0x8c75('0x46')](_0x41168a[_0x8c75('0x3d')][_0x8c75('0x46')]);_0x145ece[_0x8c75('0x47')]=qs['filters'](_[_0x8c75('0x48')](_0x41168a[_0x8c75('0x3d')],_0x4c7f56[_0x8c75('0x3f')]));if(_0x41168a['query'][_0x8c75('0x2e')]){_0x145ece['where']=_[_0x8c75('0x49')](_0x145ece[_0x8c75('0x47')],{'$or':_[_0x8c75('0x2f')](_0x145ece[_0x8c75('0x42')],function(_0x176871){var _0x16c203={};_0x16c203[_0x176871]={'$like':'%'+_0x41168a[_0x8c75('0x3d')]['filter']+'%'};return _0x16c203;})});}_0x145ece=_[_0x8c75('0x49')]({},_0x145ece,_0x41168a['options']);return _0x255ec7[_0x8c75('0x6b')](_0x145ece);}})[_0x8c75('0x28')](function(_0x5bf9d8){if(_0x5bf9d8){_0x51c56f=_0x5bf9d8[_0x8c75('0x59')];if(!_0x41168a['query'][_0x8c75('0x43')]('nolimit')){_0x145ece['limit']=qs[_0x8c75('0x45')](_0x41168a[_0x8c75('0x3d')]['limit']);_0x145ece[_0x8c75('0x23')]=qs[_0x8c75('0x23')](_0x41168a[_0x8c75('0x3d')][_0x8c75('0x23')]);}return _0x255ec7['getTeams'](_0x145ece);}})[_0x8c75('0x28')](function(_0x107b62){if(_0x107b62){return _0x107b62?{'count':_0x51c56f,'rows':_0x107b62}:null;}})[_0x8c75('0x28')](respondWithResult(_0x100371,null))[_0x8c75('0x50')](handleError(_0x100371,null));};exports[_0x8c75('0x6d')]=function(_0x12ef65,_0x2127f9,_0x16e3e8){var _0x25f6bb=_0x12ef65[_0x8c75('0x52')][_0x8c75('0x6e')];var _0x5c5edb=_['map'](_0x25f6bb,'id');return db[_0x8c75('0x6c')][_0x8c75('0x65')]({'where':{'id':_0x5c5edb},'attributes':['id'],'include':[{'model':db[_0x8c75('0x6f')],'as':_0x8c75('0x70'),'attributes':['id',_0x8c75('0x32'),_0x8c75('0x71'),'voicePause',_0x8c75('0x72')],'raw':!![]}]})[_0x8c75('0x28')](function(_0x1a03af){if(_0x1a03af){var _0x24b3f4=_[_0x8c75('0x73')](_0x1a03af,function(_0x2fe7da){var _0x52fc5d=_0x2fe7da[_0x8c75('0x29')]({'plain':!![]});_0x52fc5d[_0x8c75('0x70')]['forEach'](function(_0x51496e){_0x51496e[_0x8c75('0x74')]=_[_0x8c75('0x54')](_0x25f6bb,{'id':_0x52fc5d['id']})[_0x8c75('0x74')];});return _0x52fc5d['Agents'];});return db[_0x8c75('0x39')][_0x8c75('0x54')]({'where':{'id':_0x12ef65[_0x8c75('0x4f')]['id']}})[_0x8c75('0x28')](function(_0x4d1130){return db[_0x8c75('0x75')]['transaction'](function(_0x5c8ef1){return _0x4d1130['addTeams'](_0x5c5edb,{'transaction':_0x5c8ef1})['then'](function(){return BPromise[_0x8c75('0x76')](_0x24b3f4,function(_0x297e0d){return db[_0x8c75('0x77')][_0x8c75('0x78')]({'where':{'UserId':_0x297e0d['id'],'VoiceQueueId':_0x12ef65[_0x8c75('0x4f')]['id']},'defaults':{'penalty':_0x297e0d[_0x8c75('0x74')]},'transaction':_0x5c8ef1});});})['then'](function(){return BPromise[_0x8c75('0x76')](_[_0x8c75('0x2e')](_0x24b3f4,{'online':!![]}),function(_0x31223e){return db[_0x8c75('0x79')]['upsert']({'membername':_0x31223e[_0x8c75('0x32')],'UserId':_0x31223e['id'],'queue_name':_0x4d1130[_0x8c75('0x32')],'VoiceQueueId':_0x4d1130['id'],'interface':_[_0x8c75('0x7a')](_0x31223e['interface'])?util[_0x8c75('0x7b')]('SIP/%s',_0x31223e[_0x8c75('0x32')]):_0x31223e[_0x8c75('0x72')],'paused':_0x31223e[_0x8c75('0x7c')]||![],'penalty':_0x31223e[_0x8c75('0x74')]},{'transaction':_0x5c8ef1});});})[_0x8c75('0x28')](function(){_0x24b3f4[_0x8c75('0x7d')](function(_0x533b4a){socket[_0x8c75('0x7e')]('userVoiceQueue:save',{'UserId':_0x533b4a['id'],'VoiceQueueId':_0x4d1130['id']});});});});});}})[_0x8c75('0x28')](respondWithStatusCode(_0x2127f9,null))[_0x8c75('0x50')](handleError(_0x2127f9,null));};exports['removeTeams']=function(_0xef4cf,_0x229130,_0x31cc79){return db['Team'][_0x8c75('0x65')]({'where':{'id':_0xef4cf['query'][_0x8c75('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x8c75('0x6f')],'as':_0x8c75('0x70'),'attributes':['id'],'raw':!![]}]})[_0x8c75('0x28')](handleEntityNotFound(_0x229130,null))[_0x8c75('0x28')](function(_0x1bda24){var _0x53d686=_['map'](_0x1bda24,'id');var _0x56eaa9=[];var _0x1eb98b=[];var _0x3f02b0=squel[_0x8c75('0x80')]();_0x3f02b0[_0x8c75('0x81')](_0x8c75('0x82'))[_0x8c75('0x83')]('team_has_voice_queues','tq')[_0x8c75('0x84')](_0x8c75('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8c75('0x47')](_0x8c75('0x86'),_0xef4cf['params']['id']);for(var _0x2ec5e2=0x0;_0x2ec5e2<_0x1bda24[_0x8c75('0x59')];_0x2ec5e2+=0x1){let _0x5052d9=_0x1bda24[_0x2ec5e2];for(var _0x145e15=0x0;_0x145e15<_0x5052d9[_0x8c75('0x70')][_0x8c75('0x59')];_0x145e15+=0x1){let _0x223df4=_0x5052d9['Agents'][_0x145e15];var _0x1b7426=_0x3f02b0[_0x8c75('0x87')]();_0x1b7426[_0x8c75('0x47')](_0x8c75('0x88'),_0x223df4['id']);_0x1eb98b[_0x8c75('0x89')](db[_0x8c75('0x75')][_0x8c75('0x3d')](_0x1b7426[_0x8c75('0x8a')](),{'type':db[_0x8c75('0x75')][_0x8c75('0x8b')][_0x8c75('0x8c')]})[_0x8c75('0x28')](function(_0x4a87df){if(_0x4a87df[_0x8c75('0x59')]===0x1){return _0x223df4['id'];}else{var _0x38e984=_['every'](_[_0x8c75('0x2f')](_0x4a87df,_0x8c75('0x8d')),function(_0x2c4d16){return _[_0x8c75('0x8e')](_0x53d686,_0x2c4d16);});if(_0x38e984){return _0x223df4['id'];}}}));}}return BPromise[_0x8c75('0x8f')](_0x1eb98b)[_0x8c75('0x28')](function(_0x277ba8){_0x56eaa9=_(_0x56eaa9)[_0x8c75('0x90')](_0x277ba8)[_0x8c75('0x91')]()['value']();return db[_0x8c75('0x39')][_0x8c75('0x54')]({'where':{'id':_0xef4cf[_0x8c75('0x4f')]['id']}})[_0x8c75('0x28')](function(_0x5b449c){return db[_0x8c75('0x75')]['transaction'](function(_0x48ade8){return _0x5b449c[_0x8c75('0x92')](_0xef4cf['query'][_0x8c75('0x7f')],{'transaction':_0x48ade8})[_0x8c75('0x28')](function(){if(!_[_0x8c75('0x93')](_0x56eaa9)){return _0x5b449c[_0x8c75('0x94')](_0x56eaa9,{'transaction':_0x48ade8})[_0x8c75('0x28')](function(){return db['UserVoiceQueueRt'][_0x8c75('0x34')]({'where':{'VoiceQueueId':_0xef4cf[_0x8c75('0x4f')]['id'],'UserId':_0x56eaa9},'transaction':_0x48ade8});});}})[_0x8c75('0x28')](function(){_0x56eaa9[_0x8c75('0x7d')](function(_0x587539){socket[_0x8c75('0x7e')](_0x8c75('0x95'),{'UserId':_0x587539,'VoiceQueueId':_0x5b449c['id']});});});});});});})[_0x8c75('0x28')](respondWithStatusCode(_0x229130,null))[_0x8c75('0x50')](handleError(_0x229130,null));};exports[_0x8c75('0x96')]=function(_0x2a13c3,_0x1ea6f8,_0x449fec){var _0x291994,_0x3746d1;return db[_0x8c75('0x39')][_0x8c75('0x54')]({'where':{'id':_0x2a13c3['params']['id']}})[_0x8c75('0x28')](handleEntityNotFound(_0x1ea6f8,null))[_0x8c75('0x28')](function(_0x5b2c11){if(_0x5b2c11){_0x3746d1=_0x5b2c11;return _0x5b2c11[_0x8c75('0x96')](_0x2a13c3['body'][_0x8c75('0x7f')],_[_0x8c75('0x5a')](_0x2a13c3['body'],[_0x8c75('0x7f'),'id'])||{})['spread'](function(_0x1100c3){for(var _0x542409=0x0;_0x542409<_0x2a13c3[_0x8c75('0x52')]['ids'][_0x8c75('0x59')];_0x542409+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':_0x2a13c3[_0x8c75('0x52')][_0x8c75('0x7f')][_0x542409],'VoiceQueueId':_0x2a13c3[_0x8c75('0x4f')]['id']});}return _0x1100c3;});}})['then'](function(_0x260dfe){_0x291994=_0x260dfe||[];if(_0x3746d1){return db[_0x8c75('0x6f')][_0x8c75('0x65')]({'where':{'id':_0x2a13c3[_0x8c75('0x52')][_0x8c75('0x7f')]},'attributes':['id',_0x8c75('0x32'),_0x8c75('0x71'),_0x8c75('0x7c'),_0x8c75('0x72')],'raw':!![]});}})['then'](function(_0x5c52ef){if(!_[_0x8c75('0x93')](_0x5c52ef)){var _0x49a37e=[];for(var _0x284bd9=0x0;_0x284bd9<_0x5c52ef[_0x8c75('0x59')];_0x284bd9++){if(_0x5c52ef[_0x284bd9][_0x8c75('0x71')]){_0x49a37e[_0x8c75('0x89')](db[_0x8c75('0x79')][_0x8c75('0x97')]({'membername':_0x5c52ef[_0x284bd9][_0x8c75('0x32')],'UserId':_0x5c52ef[_0x284bd9]['id'],'queue_name':_0x3746d1[_0x8c75('0x32')],'VoiceQueueId':_0x3746d1['id'],'interface':_[_0x8c75('0x7a')](_0x5c52ef[_0x284bd9][_0x8c75('0x72')])?util[_0x8c75('0x7b')]('SIP/%s',_0x5c52ef[_0x284bd9][_0x8c75('0x32')]):_0x5c52ef[_0x284bd9][_0x8c75('0x72')],'paused':_0x5c52ef[_0x284bd9][_0x8c75('0x7c')]||![],'penalty':_0x2a13c3[_0x8c75('0x52')][_0x8c75('0x74')]||0x0}));}}return BPromise[_0x8c75('0x8f')](_0x49a37e);}})[_0x8c75('0x28')](function(){return _0x291994;})[_0x8c75('0x28')](respondWithResult(_0x1ea6f8,null))[_0x8c75('0x50')](handleError(_0x1ea6f8,null));};exports['removeAgents']=function(_0x4bb11c,_0x1d9ef5,_0x3c7bb6){return db['VoiceQueue'][_0x8c75('0x54')]({'where':{'id':_0x4bb11c['params']['id']}})[_0x8c75('0x28')](handleEntityNotFound(_0x1d9ef5,null))['then'](function(_0x2aa103){if(_0x2aa103){return _0x2aa103[_0x8c75('0x94')](_0x4bb11c[_0x8c75('0x3d')][_0x8c75('0x7f')])[_0x8c75('0x28')](function(){if(_['isArray'](_0x4bb11c['query'][_0x8c75('0x7f')])){for(var _0x1dec22=0x0;_0x1dec22<_0x4bb11c[_0x8c75('0x3d')][_0x8c75('0x7f')][_0x8c75('0x59')];_0x1dec22+=0x1){socket[_0x8c75('0x7e')](_0x8c75('0x95'),{'UserId':Number(_0x4bb11c[_0x8c75('0x3d')][_0x8c75('0x7f')][_0x1dec22]),'VoiceQueueId':Number(_0x4bb11c[_0x8c75('0x4f')]['id'])});}}else{socket[_0x8c75('0x7e')](_0x8c75('0x95'),{'UserId':Number(_0x4bb11c[_0x8c75('0x3d')]['ids']),'VoiceQueueId':Number(_0x4bb11c[_0x8c75('0x4f')]['id'])});}});}})[_0x8c75('0x28')](function(_0x33fc46){return db['UserVoiceQueueRt'][_0x8c75('0x34')]({'where':{'VoiceQueueId':_0x4bb11c['params']['id'],'UserId':_0x4bb11c['query'][_0x8c75('0x7f')]}})['then'](function(){return _0x33fc46;});})[_0x8c75('0x28')](respondWithStatusCode(_0x1d9ef5,null))['catch'](handleError(_0x1d9ef5,null));};exports[_0x8c75('0x98')]=function(_0x5aa3d9,_0xe95bbb,_0x1b82da){var _0x2d3d4c={};var _0x1a4a50={};var _0x335414;var _0x2efc5c;return db[_0x8c75('0x39')][_0x8c75('0x67')]({'where':{'id':_0x5aa3d9[_0x8c75('0x4f')]['id']}})['then'](handleEntityNotFound(_0xe95bbb,null))[_0x8c75('0x28')](function(_0x3b37f0){if(_0x3b37f0){_0x335414=_0x3b37f0;_0x1a4a50[_0x8c75('0x3c')]=_['keys'](db[_0x8c75('0x6f')][_0x8c75('0x58')]);_0x1a4a50[_0x8c75('0x3d')]=_[_0x8c75('0x3e')](_0x5aa3d9[_0x8c75('0x3d')]);_0x1a4a50[_0x8c75('0x3f')]=_[_0x8c75('0x40')](_0x1a4a50[_0x8c75('0x3c')],_0x1a4a50[_0x8c75('0x3d')]);_0x2d3d4c[_0x8c75('0x42')]=_[_0x8c75('0x40')](_0x1a4a50[_0x8c75('0x3c')],qs[_0x8c75('0x41')](_0x5aa3d9[_0x8c75('0x3d')][_0x8c75('0x41')]));_0x2d3d4c[_0x8c75('0x42')]=_0x2d3d4c[_0x8c75('0x42')][_0x8c75('0x59')]?_0x2d3d4c[_0x8c75('0x42')]:_0x1a4a50['model'];_0x2d3d4c[_0x8c75('0x61')]=qs['sort'](_0x5aa3d9[_0x8c75('0x3d')][_0x8c75('0x46')]);_0x2d3d4c[_0x8c75('0x47')]=qs['filters'](_[_0x8c75('0x48')](_0x5aa3d9[_0x8c75('0x3d')],_0x1a4a50[_0x8c75('0x3f')]));if(_0x5aa3d9[_0x8c75('0x3d')][_0x8c75('0x2e')]){_0x2d3d4c[_0x8c75('0x47')]=_[_0x8c75('0x49')](_0x2d3d4c['where'],{'$or':_[_0x8c75('0x2f')](_0x2d3d4c[_0x8c75('0x42')],function(_0x3f4b47){var _0x213ac9={};_0x213ac9[_0x3f4b47]={'$like':'%'+_0x5aa3d9[_0x8c75('0x3d')][_0x8c75('0x2e')]+'%'};return _0x213ac9;})});}_0x2d3d4c=_['merge']({},_0x2d3d4c,_0x5aa3d9[_0x8c75('0x4b')]);return _0x335414[_0x8c75('0x98')](_0x2d3d4c);}})[_0x8c75('0x28')](function(_0x5b4b0c){if(_0x5b4b0c){_0x2efc5c=_0x5b4b0c[_0x8c75('0x59')];if(!_0x5aa3d9[_0x8c75('0x3d')]['hasOwnProperty'](_0x8c75('0x44'))){_0x2d3d4c[_0x8c75('0x45')]=qs[_0x8c75('0x45')](_0x5aa3d9[_0x8c75('0x3d')][_0x8c75('0x45')]);_0x2d3d4c[_0x8c75('0x23')]=qs[_0x8c75('0x23')](_0x5aa3d9[_0x8c75('0x3d')][_0x8c75('0x23')]);}return _0x335414[_0x8c75('0x98')](_0x2d3d4c);}})[_0x8c75('0x28')](function(_0xa67e9f){if(_0xa67e9f){return _0xa67e9f?{'count':_0x2efc5c,'rows':_0xa67e9f}:null;}})['then'](respondWithResult(_0xe95bbb,null))[_0x8c75('0x50')](handleError(_0xe95bbb,null));};exports['getMembers']=function(_0x296885,_0x1ebd32,_0x4e568d){var _0xbf2b2e={};var _0x347c71={};var _0x1af246;var _0x309163;return db[_0x8c75('0x39')][_0x8c75('0x67')]({'where':{'id':_0x296885['params']['id']}})[_0x8c75('0x28')](handleEntityNotFound(_0x1ebd32,null))[_0x8c75('0x28')](function(_0x4549a3){if(_0x4549a3){_0x1af246=_0x4549a3;_0x347c71[_0x8c75('0x3c')]=_['keys'](db[_0x8c75('0x79')]['rawAttributes']);_0x347c71[_0x8c75('0x3d')]=_[_0x8c75('0x3e')](_0x296885[_0x8c75('0x3d')]);_0x347c71[_0x8c75('0x3f')]=_['intersection'](_0x347c71[_0x8c75('0x3c')],_0x347c71['query']);_0xbf2b2e['attributes']=_[_0x8c75('0x40')](_0x347c71[_0x8c75('0x3c')],qs[_0x8c75('0x41')](_0x296885[_0x8c75('0x3d')][_0x8c75('0x41')]));_0xbf2b2e['attributes']=_0xbf2b2e[_0x8c75('0x42')][_0x8c75('0x59')]?_0xbf2b2e[_0x8c75('0x42')]:_0x347c71[_0x8c75('0x3c')];_0xbf2b2e[_0x8c75('0x61')]=qs['sort'](_0x296885[_0x8c75('0x3d')]['sort']);_0xbf2b2e[_0x8c75('0x47')]=qs[_0x8c75('0x3f')](_['pick'](_0x296885[_0x8c75('0x3d')],_0x347c71[_0x8c75('0x3f')]));if(_0x296885[_0x8c75('0x3d')][_0x8c75('0x2e')]){_0xbf2b2e[_0x8c75('0x47')]=_['merge'](_0xbf2b2e[_0x8c75('0x47')],{'$or':_['map'](_0xbf2b2e[_0x8c75('0x42')],function(_0xb2f440){var _0x4db2c8={};_0x4db2c8[_0xb2f440]={'$like':'%'+_0x296885[_0x8c75('0x3d')]['filter']+'%'};return _0x4db2c8;})});}_0xbf2b2e=_['merge']({},_0xbf2b2e,_0x296885['options']);return _0x1af246[_0x8c75('0x99')](_0xbf2b2e);}})['then'](function(_0x46bf2d){if(_0x46bf2d){_0x309163=_0x46bf2d[_0x8c75('0x59')];if(!_0x296885[_0x8c75('0x3d')]['hasOwnProperty']('nolimit')){_0xbf2b2e[_0x8c75('0x45')]=qs[_0x8c75('0x45')](_0x296885['query'][_0x8c75('0x45')]);_0xbf2b2e[_0x8c75('0x23')]=qs[_0x8c75('0x23')](_0x296885[_0x8c75('0x3d')][_0x8c75('0x23')]);}return _0x1af246[_0x8c75('0x99')](_0xbf2b2e);}})[_0x8c75('0x28')](function(_0x15a67a){return _0x15a67a?{'count':_0x309163,'rows':_0x15a67a}:null;})['then'](respondWithResult(_0x1ebd32,null))[_0x8c75('0x50')](handleError(_0x1ebd32,null));};exports[_0x8c75('0x9a')]=function(_0x3c4ede,_0x17281d,_0x582aa1){var _0x31429f={};var _0x1dad62={};var _0x45b8db;var _0x566ef4;return db['VoiceQueue'][_0x8c75('0x67')]({'where':{'id':_0x3c4ede[_0x8c75('0x4f')]['id']}})['then'](handleEntityNotFound(_0x17281d,null))[_0x8c75('0x28')](function(_0x512349){if(_0x512349){_0x45b8db=_0x512349;_0x1dad62[_0x8c75('0x3c')]=_['keys'](db[_0x8c75('0x9b')][_0x8c75('0x58')]);_0x1dad62[_0x8c75('0x3d')]=_[_0x8c75('0x3e')](_0x3c4ede['query']);_0x1dad62[_0x8c75('0x3f')]=_[_0x8c75('0x40')](_0x1dad62['model'],_0x1dad62[_0x8c75('0x3d')]);_0x31429f[_0x8c75('0x42')]=_['intersection'](_0x1dad62[_0x8c75('0x3c')],qs['fields'](_0x3c4ede['query']['fields']));_0x31429f[_0x8c75('0x42')]=_0x31429f[_0x8c75('0x42')]['length']?_0x31429f['attributes']:_0x1dad62[_0x8c75('0x3c')];_0x31429f[_0x8c75('0x61')]=qs[_0x8c75('0x46')](_0x3c4ede['query'][_0x8c75('0x46')]);_0x31429f[_0x8c75('0x47')]=qs['filters'](_[_0x8c75('0x48')](_0x3c4ede[_0x8c75('0x3d')],_0x1dad62['filters']));if(_0x3c4ede[_0x8c75('0x3d')]['filter']){_0x31429f['where']=_[_0x8c75('0x49')](_0x31429f[_0x8c75('0x47')],{'$or':_['map'](_0x31429f[_0x8c75('0x42')],function(_0x1e130b){var _0x60f18c={};_0x60f18c[_0x1e130b]={'$like':'%'+_0x3c4ede[_0x8c75('0x3d')][_0x8c75('0x2e')]+'%'};return _0x60f18c;})});}_0x31429f=_[_0x8c75('0x49')]({},_0x31429f,_0x3c4ede[_0x8c75('0x4b')]);return _0x45b8db[_0x8c75('0x9a')](_0x31429f);}})[_0x8c75('0x28')](function(_0x55d1fa){if(_0x55d1fa){_0x566ef4=_0x55d1fa[_0x8c75('0x59')];if(!_0x3c4ede[_0x8c75('0x3d')]['hasOwnProperty'](_0x8c75('0x44'))){_0x31429f[_0x8c75('0x45')]=qs[_0x8c75('0x45')](_0x3c4ede[_0x8c75('0x3d')][_0x8c75('0x45')]);_0x31429f[_0x8c75('0x23')]=qs[_0x8c75('0x23')](_0x3c4ede['query']['offset']);}return _0x45b8db[_0x8c75('0x9a')](_0x31429f);}})['then'](function(_0x2a7955){if(_0x2a7955){return _0x2a7955?{'count':_0x566ef4,'rows':_0x2a7955}:null;}})[_0x8c75('0x28')](respondWithResult(_0x17281d,null))[_0x8c75('0x50')](handleError(_0x17281d,null));};exports[_0x8c75('0x9c')]=function(_0x1d65c3,_0x27555e,_0xdc1aa8){var _0x3ecfd1,_0x21f0ee;return db[_0x8c75('0x39')][_0x8c75('0x54')]({'where':{'id':_0x1d65c3['params']['id']}})[_0x8c75('0x28')](handleEntityNotFound(_0x27555e,null))['then'](function(_0x5dde29){if(_0x5dde29){_0x21f0ee=_0x5dde29;return _0x5dde29[_0x8c75('0x9c')](_0x1d65c3[_0x8c75('0x52')][_0x8c75('0x7f')],_[_0x8c75('0x5a')](_0x1d65c3[_0x8c75('0x52')],[_0x8c75('0x7f'),'id'])||{});}return null;})['spread'](function(_0x3795ee){var _0x2206b1;_0x3ecfd1=_0x3795ee||[];var _0x59d945=[];if(_0x3795ee){for(var _0x49d7f3=0x0;_0x49d7f3<_0x3795ee[_0x8c75('0x59')];_0x49d7f3+=0x1){var _0x1793a1=_0x3795ee[_0x49d7f3]['get']({'plain':!![]});_0x21f0ee[_0x8c75('0x9d')]=_0x1d65c3[_0x8c75('0x52')][_0x8c75('0x9d')]?_0x1d65c3['body'][_0x8c75('0x9d')]:_0x21f0ee[_0x8c75('0x9d')];switch(_0x21f0ee[_0x8c75('0x9d')]){case _0x8c75('0x9e'):_0x2206b1=squel[_0x8c75('0x9f')]()[_0x8c75('0xa0')]('cm_hopper')[_0x8c75('0xa1')](['phone',_0x8c75('0xa2'),_0x8c75('0xa3'),_0x8c75('0xa4'),_0x8c75('0x62'),'createdAt','updatedAt'],squel[_0x8c75('0x80')]()['field']('phone',_0x8c75('0xa5'))['field'](_0x8c75('0xa6'),'scheduledAt')[_0x8c75('0x81')]('id',_0x8c75('0xa3'))['field'](_0x1793a1['CmListId']['toString'](),'ListId')[_0x8c75('0x81')](_0x1d65c3[_0x8c75('0x4f')]['id'][_0x8c75('0x8a')](),_0x8c75('0x62'))[_0x8c75('0x81')](_0x8c75('0xa6'),_0x8c75('0x5b'))[_0x8c75('0x81')](_0x8c75('0xa6'),_0x8c75('0x5c'))[_0x8c75('0x83')]('cm_contacts')['where'](_0x8c75('0xa7'))[_0x8c75('0x47')](_0x8c75('0xa8'),_0x1793a1[_0x8c75('0xa9')][_0x8c75('0x8a')]())[_0x8c75('0x47')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x8c75('0xaa'),squel[_0x8c75('0x80')]()[_0x8c75('0x81')]('COALESCE(calleridnum,\x27\x27)')[_0x8c75('0x83')]('cm_hopper_final')[_0x8c75('0x47')]('VoiceQueueId\x20=\x20?',_0x1d65c3[_0x8c75('0x4f')]['id']['toString']()))[_0x8c75('0x47')](_0x8c75('0xaa'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x8c75('0x83')](_0x8c75('0xab'))['where'](_0x8c75('0x86'),_0x1d65c3[_0x8c75('0x4f')]['id'][_0x8c75('0x8a')]())))[_0x8c75('0x8a')]();break;case _0x8c75('0xac'):_0x2206b1=squel['insert']()['into'](_0x8c75('0xab'))['fromQuery']([_0x8c75('0xa5'),_0x8c75('0xa2'),'ContactId',_0x8c75('0xa4'),'VoiceQueueId',_0x8c75('0x5b'),_0x8c75('0x5c')],squel[_0x8c75('0x80')]()['field'](_0x8c75('0xa5'),_0x8c75('0xa5'))[_0x8c75('0x81')]('NOW()','scheduledAt')[_0x8c75('0x81')]('id',_0x8c75('0xa3'))[_0x8c75('0x81')](_0x1793a1['CmListId'][_0x8c75('0x8a')](),_0x8c75('0xa4'))['field'](_0x1d65c3[_0x8c75('0x4f')]['id']['toString'](),_0x8c75('0x62'))['field']('NOW()',_0x8c75('0x5b'))['field'](_0x8c75('0xa6'),_0x8c75('0x5c'))['from'](_0x8c75('0xad'))[_0x8c75('0x47')]('deletedAt\x20IS\x20NULL')[_0x8c75('0x47')](_0x8c75('0xa8'),_0x1793a1['CmListId'][_0x8c75('0x8a')]())[_0x8c75('0x47')](_0x8c75('0xae'))[_0x8c75('0x47')](_0x8c75('0xaa'),squel['select']()[_0x8c75('0x81')](_0x8c75('0xaf'))[_0x8c75('0x83')](_0x8c75('0xab'))['where'](_0x8c75('0x86'),_0x1d65c3[_0x8c75('0x4f')]['id']['toString']())))[_0x8c75('0x8a')]();break;default:_0x2206b1=squel[_0x8c75('0x9f')]()[_0x8c75('0xa0')]('cm_hopper')[_0x8c75('0xa1')]([_0x8c75('0xa5'),_0x8c75('0xa2'),_0x8c75('0xa3'),'ListId',_0x8c75('0x62'),_0x8c75('0x5b'),'updatedAt'],squel['select']()[_0x8c75('0x81')](_0x8c75('0xa5'),_0x8c75('0xa5'))[_0x8c75('0x81')](_0x8c75('0xa6'),'scheduledAt')[_0x8c75('0x81')]('id',_0x8c75('0xa3'))[_0x8c75('0x81')](_0x1793a1[_0x8c75('0xa9')][_0x8c75('0x8a')](),_0x8c75('0xa4'))['field'](_0x1d65c3[_0x8c75('0x4f')]['id'][_0x8c75('0x8a')](),_0x8c75('0x62'))[_0x8c75('0x81')](_0x8c75('0xa6'),_0x8c75('0x5b'))[_0x8c75('0x81')](_0x8c75('0xa6'),_0x8c75('0x5c'))['from'](_0x8c75('0xad'))['where'](_0x8c75('0xa7'))[_0x8c75('0x47')](_0x8c75('0xa8'),_0x1793a1[_0x8c75('0xa9')][_0x8c75('0x8a')]())[_0x8c75('0x47')](_0x8c75('0xae')))[_0x8c75('0x8a')]();}_0x59d945['push'](db['sequelize'][_0x8c75('0x3d')](_0x2206b1));}return BPromise[_0x8c75('0x8f')](_0x59d945);}})['then'](function(){return _0x3ecfd1;})[_0x8c75('0x28')](respondWithResult(_0x27555e,null))[_0x8c75('0x50')](handleError(_0x27555e,null));};exports[_0x8c75('0xb0')]=function(_0x248049,_0x4bcabf,_0x5042b7){return db['VoiceQueue'][_0x8c75('0x54')]({'where':{'id':_0x248049[_0x8c75('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4bcabf,null))[_0x8c75('0x28')](function(_0x907ce8){if(_0x907ce8){return _0x907ce8[_0x8c75('0xb0')](_0x248049[_0x8c75('0x3d')][_0x8c75('0x7f')]);}})[_0x8c75('0x28')](function(_0x435b58){if(_0x435b58){return db[_0x8c75('0x63')]['destroy']({'where':{'ListId':_0x248049[_0x8c75('0x3d')][_0x8c75('0x7f')],'VoiceQueueId':_0x248049['params']['id']}})['then'](function(){return _0x435b58;});}})['then'](respondWithStatusCode(_0x4bcabf,null))[_0x8c75('0x50')](handleError(_0x4bcabf,null));};exports[_0x8c75('0xb1')]=function(_0x564dbb,_0xdc863b,_0x2fa4a9){var _0x187728={};var _0x4f6af1={};var _0x128108;var _0x2ba3d0;return db[_0x8c75('0x39')]['findOne']({'where':{'id':_0x564dbb['params']['id']}})[_0x8c75('0x28')](handleEntityNotFound(_0xdc863b,null))[_0x8c75('0x28')](function(_0x1337b4){if(_0x1337b4){_0x128108=_0x1337b4;_0x4f6af1['model']=_[_0x8c75('0x3e')](db[_0x8c75('0x9b')][_0x8c75('0x58')]);_0x4f6af1[_0x8c75('0x3d')]=_[_0x8c75('0x3e')](_0x564dbb[_0x8c75('0x3d')]);_0x4f6af1[_0x8c75('0x3f')]=_[_0x8c75('0x40')](_0x4f6af1['model'],_0x4f6af1[_0x8c75('0x3d')]);_0x187728['attributes']=_[_0x8c75('0x40')](_0x4f6af1[_0x8c75('0x3c')],qs['fields'](_0x564dbb[_0x8c75('0x3d')][_0x8c75('0x41')]));_0x187728['attributes']=_0x187728[_0x8c75('0x42')][_0x8c75('0x59')]?_0x187728[_0x8c75('0x42')]:_0x4f6af1[_0x8c75('0x3c')];_0x187728['order']=qs['sort'](_0x564dbb['query']['sort']);_0x187728[_0x8c75('0x47')]=qs['filters'](_[_0x8c75('0x48')](_0x564dbb[_0x8c75('0x3d')],_0x4f6af1[_0x8c75('0x3f')]));if(_0x564dbb[_0x8c75('0x3d')]['filter']){_0x187728[_0x8c75('0x47')]=_[_0x8c75('0x49')](_0x187728[_0x8c75('0x47')],{'$or':_['map'](_0x187728[_0x8c75('0x42')],function(_0x8bf939){var _0x33fc67={};_0x33fc67[_0x8bf939]={'$like':'%'+_0x564dbb['query']['filter']+'%'};return _0x33fc67;})});}_0x187728=_[_0x8c75('0x49')]({},_0x187728,_0x564dbb[_0x8c75('0x4b')]);return _0x128108[_0x8c75('0xb1')](_0x187728);}})[_0x8c75('0x28')](function(_0x409f36){if(_0x409f36){_0x2ba3d0=_0x409f36[_0x8c75('0x59')];if(!_0x564dbb[_0x8c75('0x3d')]['hasOwnProperty'](_0x8c75('0x44'))){_0x187728['limit']=qs[_0x8c75('0x45')](_0x564dbb[_0x8c75('0x3d')][_0x8c75('0x45')]);_0x187728[_0x8c75('0x23')]=qs[_0x8c75('0x23')](_0x564dbb['query']['offset']);}return _0x128108[_0x8c75('0xb1')](_0x187728);}})[_0x8c75('0x28')](function(_0x148d6b){if(_0x148d6b){return _0x148d6b?{'count':_0x2ba3d0,'rows':_0x148d6b}:null;}})[_0x8c75('0x28')](respondWithResult(_0xdc863b,null))[_0x8c75('0x50')](handleError(_0xdc863b,null));};exports['addBlackLists']=function(_0x4d7625,_0x5a5021,_0x4024bf){var _0x5e03d1,_0x1f380b;return db['VoiceQueue'][_0x8c75('0x54')]({'where':{'id':_0x4d7625[_0x8c75('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5a5021,null))[_0x8c75('0x28')](function(_0x517344){if(_0x517344){_0x1f380b=_0x517344;return _0x517344[_0x8c75('0xb2')](_0x4d7625[_0x8c75('0x52')]['ids'],_[_0x8c75('0x5a')](_0x4d7625[_0x8c75('0x52')],[_0x8c75('0x7f'),'id'])||{});}return null;})['spread'](function(_0x27ffaf){var _0x1a73b8;_0x5e03d1=_0x27ffaf||[];var _0x52789c=[];if(_0x27ffaf){for(var _0x1ffa4d=0x0;_0x1ffa4d<_0x27ffaf['length'];_0x1ffa4d+=0x1){var _0xf87f1d=_0x27ffaf[_0x1ffa4d]['get']({'plain':!![]});_0x1a73b8=squel[_0x8c75('0x9f')]()[_0x8c75('0xa0')](_0x8c75('0xb3'))[_0x8c75('0xa1')]([_0x8c75('0xa5'),_0x8c75('0xa3'),_0x8c75('0xa4'),'VoiceQueueId',_0x8c75('0x5b'),_0x8c75('0x5c')],squel[_0x8c75('0x80')]()['field'](_0x8c75('0xa5'),'phone')[_0x8c75('0x81')]('id',_0x8c75('0xa3'))[_0x8c75('0x81')](_0xf87f1d[_0x8c75('0xa9')][_0x8c75('0x8a')](),_0x8c75('0xa4'))[_0x8c75('0x81')](_0x4d7625[_0x8c75('0x4f')]['id'][_0x8c75('0x8a')](),_0x8c75('0x62'))[_0x8c75('0x81')]('NOW()',_0x8c75('0x5b'))['field'](_0x8c75('0xa6'),_0x8c75('0x5c'))['from'](_0x8c75('0xad'))[_0x8c75('0x47')](_0x8c75('0xa7'))[_0x8c75('0x47')](_0x8c75('0xa8'),_0xf87f1d[_0x8c75('0xa9')]['toString']())[_0x8c75('0x47')](_0x8c75('0xae')))[_0x8c75('0x8a')]();_0x52789c['push'](db[_0x8c75('0x75')][_0x8c75('0x3d')](_0x1a73b8));}return BPromise[_0x8c75('0x8f')](_0x52789c);}})[_0x8c75('0x28')](function(){return _0x5e03d1;})[_0x8c75('0x28')](respondWithResult(_0x5a5021,null))[_0x8c75('0x50')](handleError(_0x5a5021,null));};exports['removeBlackLists']=function(_0xf047ba,_0xebc7bd,_0x5b50ef){return db['VoiceQueue']['find']({'where':{'id':_0xf047ba[_0x8c75('0x4f')]['id']}})[_0x8c75('0x28')](handleEntityNotFound(_0xebc7bd,null))[_0x8c75('0x28')](function(_0x471bba){if(_0x471bba){return _0x471bba['removeBlackLists'](_0xf047ba[_0x8c75('0x3d')][_0x8c75('0x7f')]);}})[_0x8c75('0x28')](function(_0x36172b){if(_0x36172b){return db['CmHopperBlack'][_0x8c75('0x34')]({'where':{'ListId':_0xf047ba['query'][_0x8c75('0x7f')],'VoiceQueueId':_0xf047ba[_0x8c75('0x4f')]['id']}})['then'](function(){return _0x36172b;});}})[_0x8c75('0x28')](respondWithStatusCode(_0xebc7bd,null))['catch'](handleError(_0xebc7bd,null));};
\ No newline at end of file
index b708a87..e1dacba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf056=['events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x8176c8,_0x185fa3){var _0x10f731=function(_0x13359f){while(--_0x13359f){_0x8176c8['push'](_0x8176c8['shift']());}};_0x10f731(++_0x185fa3);}(_0xf056,0x186));var _0x6f05=function(_0x3a04f1,_0x365f94){_0x3a04f1=_0x3a04f1-0x0;var _0x2b4d99=_0xf056[_0x3a04f1];return _0x2b4d99;};'use strict';var EventEmitter=require(_0x6f05('0x0'));var VoiceQueue=require(_0x6f05('0x1'))['db'][_0x6f05('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6f05('0x3')](0x0);var events={'afterCreate':_0x6f05('0x4'),'afterUpdate':_0x6f05('0x5'),'afterDestroy':'remove'};function emitEvent(_0x19bcab){return function(_0x8c1c1d,_0x331136,_0x2305a8){VoiceQueueEvents[_0x6f05('0x6')](_0x19bcab+':'+_0x8c1c1d['id'],_0x8c1c1d);VoiceQueueEvents[_0x6f05('0x6')](_0x19bcab,_0x8c1c1d);_0x2305a8(null);};}for(var e in events){if(events[_0x6f05('0x7')](e)){var event=events[e];VoiceQueue[_0x6f05('0x8')](e,emitEvent(event));}}module[_0x6f05('0x9')]=VoiceQueueEvents;
\ No newline at end of file
+var _0x2957=['hook','events','save','update','remove','emit'];(function(_0x1849fe,_0x568b96){var _0x3ab401=function(_0x95d462){while(--_0x95d462){_0x1849fe['push'](_0x1849fe['shift']());}};_0x3ab401(++_0x568b96);}(_0x2957,0xe5));var _0x7295=function(_0x23ad11,_0x3e7ad4){_0x23ad11=_0x23ad11-0x0;var _0x56128d=_0x2957[_0x23ad11];return _0x56128d;};'use strict';var EventEmitter=require(_0x7295('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7295('0x1'),'afterUpdate':_0x7295('0x2'),'afterDestroy':_0x7295('0x3')};function emitEvent(_0x8d3d8d){return function(_0x19f6a7,_0x3c1e09,_0x5d7897){VoiceQueueEvents[_0x7295('0x4')](_0x8d3d8d+':'+_0x19f6a7['id'],_0x19f6a7);VoiceQueueEvents[_0x7295('0x4')](_0x8d3d8d,_0x19f6a7);_0x5d7897(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x7295('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
index fe47aa0..7e140d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39d0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','VoiceQueue','voice_queues','lodash'];(function(_0x5d6480,_0x5c57d5){var _0x1d8a4a=function(_0x1e24be){while(--_0x1e24be){_0x5d6480['push'](_0x5d6480['shift']());}};_0x1d8a4a(++_0x5c57d5);}(_0x39d0,0x1b7));var _0x039d=function(_0x2cd352,_0x2387f2){_0x2cd352=_0x2cd352-0x0;var _0x35dd70=_0x39d0[_0x2cd352];return _0x35dd70;};'use strict';var _=require(_0x039d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x039d('0x1'));var moment=require(_0x039d('0x2'));var BPromise=require(_0x039d('0x3'));var rp=require(_0x039d('0x4'));var fs=require('fs');var path=require(_0x039d('0x5'));var rimraf=require(_0x039d('0x6'));var config=require(_0x039d('0x7'));var attributes=require(_0x039d('0x8'));module['exports']=function(_0x535d78,_0x10c18e){return _0x535d78['define'](_0x039d('0x9'),attributes,{'tableName':_0x039d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f62=['request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue','lodash','util','../../config/logger','moment','bluebird'];(function(_0x556477,_0x1b7214){var _0x552276=function(_0xf0e2ef){while(--_0xf0e2ef){_0x556477['push'](_0x556477['shift']());}};_0x552276(++_0x1b7214);}(_0x7f62,0xc7));var _0x27f6=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0x7f62[_0x3cea78];return _0x33b66b;};'use strict';var _=require(_0x27f6('0x0'));var util=require(_0x27f6('0x1'));var logger=require(_0x27f6('0x2'))('api');var moment=require(_0x27f6('0x3'));var BPromise=require(_0x27f6('0x4'));var rp=require(_0x27f6('0x5'));var fs=require('fs');var path=require(_0x27f6('0x6'));var rimraf=require(_0x27f6('0x7'));var config=require(_0x27f6('0x8'));var attributes=require(_0x27f6('0x9'));module[_0x27f6('0xa')]=function(_0xdd8cb4,_0x280810){return _0xdd8cb4['define'](_0x27f6('0xb'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index adfe69f..e70e7b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1017=['VoiceQueue','findAll','options','where','attributes','limit','include','map','model','ShowVoiceQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueue'];(function(_0x1a01cb,_0x203627){var _0x544841=function(_0x163394){while(--_0x163394){_0x1a01cb['push'](_0x1a01cb['shift']());}};_0x544841(++_0x203627);}(_0x1017,0x164));var _0x7101=function(_0xecf33f,_0x8ce7ec){_0xecf33f=_0xecf33f-0x0;var _0x2eb0f4=_0x1017[_0xecf33f];return _0x2eb0f4;};'use strict';var _=require(_0x7101('0x0'));var util=require(_0x7101('0x1'));var moment=require(_0x7101('0x2'));var BPromise=require(_0x7101('0x3'));var rs=require(_0x7101('0x4'));var fs=require('fs');var Redis=require(_0x7101('0x5'));var db=require(_0x7101('0x6'))['db'];var utils=require(_0x7101('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x7101('0x8'));var jayson=require(_0x7101('0x9'));var client=jayson[_0x7101('0xa')][_0x7101('0xb')]({'port':0x232a});config[_0x7101('0xc')]=_[_0x7101('0xd')](config[_0x7101('0xc')],{'host':_0x7101('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7101('0xc')]));require(_0x7101('0xf'))[_0x7101('0x10')](socket);function respondWithRpcPromise(_0x59af00,_0x1b4b74,_0x1232d1){return new BPromise(function(_0x43e794,_0x32f0e2){return client[_0x7101('0x11')](_0x59af00,_0x1232d1)[_0x7101('0x12')](function(_0x3cc212){logger['info'](_0x7101('0x13'),_0x1b4b74,'request\x20sent');logger[_0x7101('0x14')](_0x7101('0x15'),_0x1b4b74,_0x7101('0x16'),JSON[_0x7101('0x17')](_0x3cc212));if(_0x3cc212['error']){if(_0x3cc212[_0x7101('0x18')][_0x7101('0x19')]===0x1f4){logger[_0x7101('0x18')](_0x7101('0x13'),_0x1b4b74,_0x3cc212[_0x7101('0x18')][_0x7101('0x1a')]);return _0x32f0e2(_0x3cc212[_0x7101('0x18')][_0x7101('0x1a')]);}logger[_0x7101('0x18')](_0x7101('0x13'),_0x1b4b74,_0x3cc212[_0x7101('0x18')]['message']);return _0x43e794(_0x3cc212[_0x7101('0x18')][_0x7101('0x1a')]);}else{logger[_0x7101('0x1b')]('VoiceQueue,\x20%s,\x20%s',_0x1b4b74,_0x7101('0x16'));_0x43e794(_0x3cc212[_0x7101('0x1c')][_0x7101('0x1a')]);}})[_0x7101('0x1d')](function(_0x196802){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x1b4b74,_0x196802);_0x32f0e2(_0x196802);});});}exports[_0x7101('0x1e')]=function(_0x7b4d63){var _0x5803a8=this;return new Promise(function(_0x2e8e32,_0x45ce44){return db[_0x7101('0x1f')][_0x7101('0x20')]({'raw':_0x7b4d63['options']?_0x7b4d63[_0x7101('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x7b4d63[_0x7101('0x21')]?_0x7b4d63[_0x7101('0x21')][_0x7101('0x22')]||null:null,'attributes':_0x7b4d63['options']?_0x7b4d63[_0x7101('0x21')][_0x7101('0x23')]||null:null,'limit':_0x7b4d63['options']?_0x7b4d63[_0x7101('0x21')][_0x7101('0x24')]||null:null,'include':_0x7b4d63[_0x7101('0x21')]?_0x7b4d63[_0x7101('0x21')][_0x7101('0x25')]?_[_0x7101('0x26')](_0x7b4d63[_0x7101('0x21')][_0x7101('0x25')],function(_0x43dda0){return{'model':db[_0x43dda0['model']],'as':_0x43dda0['as'],'attributes':_0x43dda0[_0x7101('0x23')],'include':_0x43dda0['include']?_[_0x7101('0x26')](_0x43dda0[_0x7101('0x25')],function(_0xb10d1a){return{'model':db[_0xb10d1a[_0x7101('0x27')]],'as':_0xb10d1a['as'],'attributes':_0xb10d1a[_0x7101('0x23')],'include':_0xb10d1a[_0x7101('0x25')]?_[_0x7101('0x26')](_0xb10d1a[_0x7101('0x25')],function(_0x1c3c58){return{'model':db[_0x1c3c58[_0x7101('0x27')]],'as':_0x1c3c58['as'],'attributes':_0x1c3c58['attributes']};}):[]};}):[]};}):[]:[]})[_0x7101('0x12')](function(_0x49f18c){logger[_0x7101('0x1b')](_0x7101('0x1e'),_0x7b4d63);logger[_0x7101('0x14')]('GetVoiceQueue',_0x7b4d63,JSON[_0x7101('0x17')](_0x49f18c));_0x2e8e32(_0x49f18c);})['catch'](function(_0x1fe43e){logger[_0x7101('0x18')](_0x7101('0x1e'),_0x1fe43e[_0x7101('0x1a')],_0x7b4d63);_0x45ce44(_0x5803a8[_0x7101('0x18')](0x1f4,_0x1fe43e[_0x7101('0x1a')]));});});};exports[_0x7101('0x28')]=function(_0x2bd726){var _0x50f95b=this;return new Promise(function(_0x512b1e,_0xf33ec6){return db['VoiceQueue'][_0x7101('0x29')]({'raw':_0x2bd726[_0x7101('0x21')]?_0x2bd726[_0x7101('0x21')][_0x7101('0x2a')]===undefined?!![]:![]:!![],'where':_0x2bd726[_0x7101('0x21')]?_0x2bd726[_0x7101('0x21')][_0x7101('0x22')]||null:null,'attributes':_0x2bd726['options']?_0x2bd726[_0x7101('0x21')]['attributes']||null:null,'include':_0x2bd726[_0x7101('0x21')]?_0x2bd726[_0x7101('0x21')][_0x7101('0x25')]?_[_0x7101('0x26')](_0x2bd726[_0x7101('0x21')]['include'],function(_0x2675d9){return{'model':db[_0x2675d9[_0x7101('0x27')]],'as':_0x2675d9['as'],'attributes':_0x2675d9['attributes'],'include':_0x2675d9[_0x7101('0x25')]?_[_0x7101('0x26')](_0x2675d9['include'],function(_0x11c340){return{'model':db[_0x11c340[_0x7101('0x27')]],'as':_0x11c340['as'],'attributes':_0x11c340[_0x7101('0x23')],'include':_0x11c340[_0x7101('0x25')]?_[_0x7101('0x26')](_0x11c340[_0x7101('0x25')],function(_0x56973c){return{'model':db[_0x56973c[_0x7101('0x27')]],'as':_0x56973c['as'],'attributes':_0x56973c[_0x7101('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7e5964){logger[_0x7101('0x1b')](_0x7101('0x28'),_0x2bd726);logger[_0x7101('0x14')](_0x7101('0x28'),_0x2bd726,JSON[_0x7101('0x17')](_0x7e5964));_0x512b1e(_0x7e5964);})['catch'](function(_0x285dc3){logger[_0x7101('0x18')](_0x7101('0x28'),_0x285dc3[_0x7101('0x1a')],_0x2bd726);_0xf33ec6(_0x50f95b[_0x7101('0x18')](0x1f4,_0x285dc3['message']));});});};
\ No newline at end of file
+var _0x7e05=['./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','options','raw','limit','map','attributes','include','model','debug','ShowVoiceQueue','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost'];(function(_0x499194,_0x43eb12){var _0xeea9f4=function(_0x18eb4b){while(--_0x18eb4b){_0x499194['push'](_0x499194['shift']());}};_0xeea9f4(++_0x43eb12);}(_0x7e05,0x166));var _0x57e0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7e05[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x57e0('0x0'));var util=require(_0x57e0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x57e0('0x2'));var fs=require('fs');var Redis=require(_0x57e0('0x3'));var db=require(_0x57e0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x57e0('0x5'))(_0x57e0('0x6'));var config=require(_0x57e0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x57e0('0x8')][_0x57e0('0x9')]({'port':0x232a});config[_0x57e0('0xa')]=_['defaults'](config[_0x57e0('0xa')],{'host':_0x57e0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57e0('0xa')]));require(_0x57e0('0xc'))[_0x57e0('0xd')](socket);function respondWithRpcPromise(_0x3a0569,_0xe4bed1,_0x1adf9f){return new BPromise(function(_0x5db29e,_0x47943a){return client[_0x57e0('0xe')](_0x3a0569,_0x1adf9f)[_0x57e0('0xf')](function(_0x419f8d){logger[_0x57e0('0x10')](_0x57e0('0x11'),_0xe4bed1,_0x57e0('0x12'));logger['debug'](_0x57e0('0x13'),_0xe4bed1,_0x57e0('0x12'),JSON[_0x57e0('0x14')](_0x419f8d));if(_0x419f8d[_0x57e0('0x15')]){if(_0x419f8d['error'][_0x57e0('0x16')]===0x1f4){logger['error'](_0x57e0('0x11'),_0xe4bed1,_0x419f8d['error'][_0x57e0('0x17')]);return _0x47943a(_0x419f8d[_0x57e0('0x15')][_0x57e0('0x17')]);}logger['error'](_0x57e0('0x11'),_0xe4bed1,_0x419f8d[_0x57e0('0x15')][_0x57e0('0x17')]);return _0x5db29e(_0x419f8d[_0x57e0('0x15')][_0x57e0('0x17')]);}else{logger[_0x57e0('0x10')]('VoiceQueue,\x20%s,\x20%s',_0xe4bed1,'request\x20sent');_0x5db29e(_0x419f8d['result'][_0x57e0('0x17')]);}})[_0x57e0('0x18')](function(_0xf81b28){logger[_0x57e0('0x15')](_0x57e0('0x11'),_0xe4bed1,_0xf81b28);_0x47943a(_0xf81b28);});});}exports[_0x57e0('0x19')]=function(_0x3f3db5){var _0x2bd6e2=this;return new Promise(function(_0x481abc,_0x7b2fc8){return db[_0x57e0('0x1a')]['findAll']({'raw':_0x3f3db5[_0x57e0('0x1b')]?_0x3f3db5[_0x57e0('0x1b')][_0x57e0('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f3db5[_0x57e0('0x1b')]?_0x3f3db5['options']['where']||null:null,'attributes':_0x3f3db5[_0x57e0('0x1b')]?_0x3f3db5[_0x57e0('0x1b')]['attributes']||null:null,'limit':_0x3f3db5[_0x57e0('0x1b')]?_0x3f3db5[_0x57e0('0x1b')][_0x57e0('0x1d')]||null:null,'include':_0x3f3db5[_0x57e0('0x1b')]?_0x3f3db5[_0x57e0('0x1b')]['include']?_[_0x57e0('0x1e')](_0x3f3db5[_0x57e0('0x1b')]['include'],function(_0x3d3a7b){return{'model':db[_0x3d3a7b['model']],'as':_0x3d3a7b['as'],'attributes':_0x3d3a7b[_0x57e0('0x1f')],'include':_0x3d3a7b[_0x57e0('0x20')]?_[_0x57e0('0x1e')](_0x3d3a7b[_0x57e0('0x20')],function(_0x299205){return{'model':db[_0x299205[_0x57e0('0x21')]],'as':_0x299205['as'],'attributes':_0x299205[_0x57e0('0x1f')],'include':_0x299205[_0x57e0('0x20')]?_[_0x57e0('0x1e')](_0x299205['include'],function(_0xd2b71b){return{'model':db[_0xd2b71b['model']],'as':_0xd2b71b['as'],'attributes':_0xd2b71b[_0x57e0('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x181fd6){logger[_0x57e0('0x10')](_0x57e0('0x19'),_0x3f3db5);logger[_0x57e0('0x22')](_0x57e0('0x19'),_0x3f3db5,JSON['stringify'](_0x181fd6));_0x481abc(_0x181fd6);})[_0x57e0('0x18')](function(_0x2f92cd){logger[_0x57e0('0x15')](_0x57e0('0x19'),_0x2f92cd[_0x57e0('0x17')],_0x3f3db5);_0x7b2fc8(_0x2bd6e2['error'](0x1f4,_0x2f92cd[_0x57e0('0x17')]));});});};exports[_0x57e0('0x23')]=function(_0x11db5d){var _0x1ff278=this;return new Promise(function(_0x831646,_0x5db704){return db[_0x57e0('0x1a')]['find']({'raw':_0x11db5d[_0x57e0('0x1b')]?_0x11db5d[_0x57e0('0x1b')][_0x57e0('0x1c')]===undefined?!![]:![]:!![],'where':_0x11db5d[_0x57e0('0x1b')]?_0x11db5d[_0x57e0('0x1b')][_0x57e0('0x24')]||null:null,'attributes':_0x11db5d[_0x57e0('0x1b')]?_0x11db5d[_0x57e0('0x1b')]['attributes']||null:null,'include':_0x11db5d[_0x57e0('0x1b')]?_0x11db5d[_0x57e0('0x1b')]['include']?_[_0x57e0('0x1e')](_0x11db5d[_0x57e0('0x1b')][_0x57e0('0x20')],function(_0x58651c){return{'model':db[_0x58651c[_0x57e0('0x21')]],'as':_0x58651c['as'],'attributes':_0x58651c[_0x57e0('0x1f')],'include':_0x58651c[_0x57e0('0x20')]?_['map'](_0x58651c[_0x57e0('0x20')],function(_0x126331){return{'model':db[_0x126331['model']],'as':_0x126331['as'],'attributes':_0x126331[_0x57e0('0x1f')],'include':_0x126331['include']?_[_0x57e0('0x1e')](_0x126331['include'],function(_0x4f620e){return{'model':db[_0x4f620e[_0x57e0('0x21')]],'as':_0x4f620e['as'],'attributes':_0x4f620e[_0x57e0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x57e0('0xf')](function(_0x389ee4){logger[_0x57e0('0x10')]('ShowVoiceQueue',_0x11db5d);logger['debug'](_0x57e0('0x23'),_0x11db5d,JSON[_0x57e0('0x14')](_0x389ee4));_0x831646(_0x389ee4);})[_0x57e0('0x18')](function(_0x49154f){logger[_0x57e0('0x15')](_0x57e0('0x23'),_0x49154f[_0x57e0('0x17')],_0x11db5d);_0x5db704(_0x1ff278[_0x57e0('0x15')](0x1f4,_0x49154f['message']));});});};
\ No newline at end of file
index 9caedde..85cbc77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb575=['voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x43de93,_0x5daf15){var _0x168e48=function(_0x2f9c2e){while(--_0x2f9c2e){_0x43de93['push'](_0x43de93['shift']());}};_0x168e48(++_0x5daf15);}(_0xb575,0x1a8));var _0x5b57=function(_0x2e4e65,_0x2f3342){_0x2e4e65=_0x2e4e65-0x0;var _0x241ab0=_0xb575[_0x2e4e65];return _0x241ab0;};'use strict';var VoiceQueueEvents=require(_0x5b57('0x0'));var events=[_0x5b57('0x1'),_0x5b57('0x2'),_0x5b57('0x3')];function createListener(_0x1d4265,_0x26e258){return function(_0x5a5c67){_0x26e258[_0x5b57('0x4')](_0x1d4265,_0x5a5c67);};}function removeListener(_0x10b56f,_0x4d2871){return function(){VoiceQueueEvents[_0x5b57('0x5')](_0x10b56f,_0x4d2871);};}exports[_0x5b57('0x6')]=function(_0x4e3dca){for(var _0x50fd34=0x0,_0x3e4992=events[_0x5b57('0x7')];_0x50fd34<_0x3e4992;_0x50fd34++){var _0x4685fd=events[_0x50fd34];var _0x3095d3=createListener(_0x5b57('0x8')+_0x4685fd,_0x4e3dca);VoiceQueueEvents['on'](_0x4685fd,_0x3095d3);}};
\ No newline at end of file
+var _0x976b=['removeListener','length','voiceQueue:','./voiceQueue.events','remove','update','emit'];(function(_0x43c7a0,_0x302a63){var _0x56ac52=function(_0x26930b){while(--_0x26930b){_0x43c7a0['push'](_0x43c7a0['shift']());}};_0x56ac52(++_0x302a63);}(_0x976b,0x10d));var _0xb976=function(_0x39de09,_0x3e99a7){_0x39de09=_0x39de09-0x0;var _0x4c268b=_0x976b[_0x39de09];return _0x4c268b;};'use strict';var VoiceQueueEvents=require(_0xb976('0x0'));var events=['save',_0xb976('0x1'),_0xb976('0x2')];function createListener(_0x5cb335,_0x56b80e){return function(_0xfa1754){_0x56b80e[_0xb976('0x3')](_0x5cb335,_0xfa1754);};}function removeListener(_0x133816,_0x1665a4){return function(){VoiceQueueEvents[_0xb976('0x4')](_0x133816,_0x1665a4);};}exports['register']=function(_0x391c51){for(var _0xaa4036=0x0,_0x58dbf6=events[_0xb976('0x5')];_0xaa4036<_0x58dbf6;_0xaa4036++){var _0xa61774=events[_0xaa4036];var _0x2703ea=createListener(_0xb976('0x6')+_0xa61774,_0x391c51);VoiceQueueEvents['on'](_0xa61774,_0x2703ea);}};
\ No newline at end of file
index 7a42f48..cae01b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0424=['delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport','show','post','create','put','/:id'];(function(_0x5f38ae,_0x4b964a){var _0x530936=function(_0x209d89){while(--_0x209d89){_0x5f38ae['push'](_0x5f38ae['shift']());}};_0x530936(++_0x4b964a);}(_0x0424,0x159));var _0x4042=function(_0x26721d,_0x448ba5){_0x26721d=_0x26721d-0x0;var _0x1035c5=_0x0424[_0x26721d];return _0x1035c5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4042('0x0'));var timeout=require(_0x4042('0x1'));var express=require(_0x4042('0x2'));var router=express[_0x4042('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4042('0x4'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0x4042('0x5')]('/',auth[_0x4042('0x6')](),controller[_0x4042('0x7')]);router[_0x4042('0x5')](_0x4042('0x8'),auth[_0x4042('0x6')](),controller[_0x4042('0x9')]);router['get']('/index',auth[_0x4042('0x6')](),controller[_0x4042('0xa')]);router[_0x4042('0x5')]('/:id',auth[_0x4042('0x6')](),controller[_0x4042('0xb')]);router[_0x4042('0xc')]('/',auth[_0x4042('0x6')](),controller[_0x4042('0xd')]);router[_0x4042('0xe')](_0x4042('0xf'),auth[_0x4042('0x6')](),controller['update']);router[_0x4042('0x10')](_0x4042('0xf'),auth['isAuthenticated'](),controller[_0x4042('0x11')]);module[_0x4042('0x12')]=router;
\ No newline at end of file
+var _0xdb8b=['update','destroy','util','path','connect-timeout','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xdb8b,0x1c4));var _0xbdb8=function(_0xfcf1b3,_0x27ceb5){_0xfcf1b3=_0xfcf1b3-0x0;var _0x4abcde=_0xdb8b[_0xfcf1b3];return _0x4abcde;};'use strict';var multer=require('multer');var util=require(_0xbdb8('0x0'));var path=require(_0xbdb8('0x1'));var timeout=require(_0xbdb8('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xbdb8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbdb8('0x4'));var controller=require(_0xbdb8('0x5'));router[_0xbdb8('0x6')]('/',auth[_0xbdb8('0x7')](),controller['index']);router[_0xbdb8('0x6')]('/describe',auth[_0xbdb8('0x7')](),controller[_0xbdb8('0x8')]);router[_0xbdb8('0x6')](_0xbdb8('0x9'),auth[_0xbdb8('0x7')](),controller[_0xbdb8('0xa')]);router['get'](_0xbdb8('0xb'),auth[_0xbdb8('0x7')](),controller[_0xbdb8('0xc')]);router[_0xbdb8('0xd')]('/',auth[_0xbdb8('0x7')](),controller[_0xbdb8('0xe')]);router[_0xbdb8('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xbdb8('0x10')]);router['delete'](_0xbdb8('0xb'),auth['isAuthenticated'](),controller[_0xbdb8('0x11')]);module['exports']=router;
\ No newline at end of file
index 990d186..d921cd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cad=['exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','setDataValue','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment'];(function(_0x4bbb56,_0xc28037){var _0x523793=function(_0x2f9f4e){while(--_0x2f9f4e){_0x4bbb56['push'](_0x4bbb56['shift']());}};_0x523793(++_0xc28037);}(_0x5cad,0x116));var _0xd5ca=function(_0x32b9c9,_0x5881e6){_0x32b9c9=_0x32b9c9-0x0;var _0x1a837f=_0x5cad[_0x32b9c9];return _0x1a837f;};'use strict';var Sequelize=require(_0xd5ca('0x0'));var moment=require(_0xd5ca('0x1'));module[_0xd5ca('0x2')]={'type':{'type':Sequelize[_0xd5ca('0x3')]},'uniqueid':{'type':Sequelize[_0xd5ca('0x3')]},'calleridnum':{'type':Sequelize[_0xd5ca('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xd5ca('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xd5ca('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xd5ca('0x4')],'set':function(_0x1085b7){var _0x560c84=moment(_0x1085b7);var _0x3af403=moment(this[_0xd5ca('0x5')](_0xd5ca('0x6')))[_0xd5ca('0x7')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5fc51f=_0x560c84[_0xd5ca('0x8')](_0x3af403,_0xd5ca('0x9'));this[_0xd5ca('0xa')]('queuecallerleaveAt',_0x1085b7);this[_0xd5ca('0xa')]('holdtime',_0x5fc51f||null);}},'position':{'type':Sequelize[_0xd5ca('0xb')]},'count':{'type':Sequelize[_0xd5ca('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xd5ca('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xd5ca('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xd5ca('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xd5ca('0x4')]},'queuecallerexit':{'type':Sequelize[_0xd5ca('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xd5ca('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xd5ca('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd5ca('0x3')]},'connectedlinename':{'type':Sequelize[_0xd5ca('0x3')]},'accountcode':{'type':Sequelize[_0xd5ca('0x3')]},'context':{'type':Sequelize[_0xd5ca('0x3')]},'exten':{'type':Sequelize[_0xd5ca('0x3')]},'priority':{'type':Sequelize[_0xd5ca('0x3')]},'holdtime':{'type':Sequelize[_0xd5ca('0xb')]},'mohtime':{'type':Sequelize[_0xd5ca('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xd5ca('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xd5ca('0x3')]},'transfer':{'type':Sequelize[_0xd5ca('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd5ca('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xd5ca('0x3')]},'disposition':{'type':Sequelize[_0xd5ca('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xeb3b=['setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds'];(function(_0x5f3f76,_0x307789){var _0x6e992c=function(_0x526049){while(--_0x526049){_0x5f3f76['push'](_0x5f3f76['shift']());}};_0x6e992c(++_0x307789);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0xeb3b[_0x1ca890];return _0x3f8e01;};'use strict';var Sequelize=require(_0xbeb3('0x0'));var moment=require(_0xbeb3('0x1'));module[_0xbeb3('0x2')]={'type':{'type':Sequelize[_0xbeb3('0x3')]},'uniqueid':{'type':Sequelize[_0xbeb3('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xbeb3('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xbeb3('0x4')],'set':function(_0x4852ca){var _0x2e8a69=moment(_0x4852ca);var _0x5ae6f9=moment(this[_0xbeb3('0x5')](_0xbeb3('0x6')))[_0xbeb3('0x7')](_0xbeb3('0x8'));var _0x5a6a06=_0x2e8a69[_0xbeb3('0x9')](_0x5ae6f9,_0xbeb3('0xa'));this[_0xbeb3('0xb')](_0xbeb3('0xc'),_0x4852ca);this[_0xbeb3('0xb')](_0xbeb3('0xd'),_0x5a6a06||null);}},'position':{'type':Sequelize[_0xbeb3('0xe')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xbeb3('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xbeb3('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xbeb3('0x4')]},'queuecallerexit':{'type':Sequelize[_0xbeb3('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xbeb3('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xbeb3('0x3')],'comment':_0xbeb3('0x10')},'originalposition':{'type':Sequelize[_0xbeb3('0xe')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xbeb3('0x3')]},'accountcode':{'type':Sequelize[_0xbeb3('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbeb3('0x3')]},'holdtime':{'type':Sequelize[_0xbeb3('0xe')]},'mohtime':{'type':Sequelize[_0xbeb3('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xbeb3('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xbeb3('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xbeb3('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xbeb3('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index cf6744f..99c56e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','set','json','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','VoiceQueueReport','count','include','catch','show','params','keys','length','includeAll','find','create','body','describe','getVoiceQueuesReport','fields','limit','rows','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x2b4e94,_0x2233dd){_0x2233dd=_0x2233dd||0xcc;return function(_0x24b5bb){if(_0x24b5bb){return _0x2b4e94[_0x7995('0x1e')](_0x2233dd);}return _0x2b4e94[_0x7995('0x1f')](_0x2233dd)[_0x7995('0x20')]();};}function respondWithResult(_0x2202ce,_0x41cbf0){_0x41cbf0=_0x41cbf0||0xc8;return function(_0x5377e5){if(_0x5377e5){return _0x2202ce[_0x7995('0x1f')](_0x41cbf0)['json'](_0x5377e5);}};}function respondWithFilteredResult(_0x2f832e,_0x37f297){return function(_0x43d4b8){if(_0x43d4b8){var _0x291317=_0x43d4b8['count'],_0x1e1415=_0x37f297[_0x7995('0x21')],_0x37a7d4=_0x37f297['offset']+_0x37f297['limit'],_0x4faa60;if(_0x37a7d4>=_0x291317){_0x37a7d4=_0x291317;_0x4faa60=0xc8;}else{_0x4faa60=0xce;}_0x2f832e[_0x7995('0x1f')](_0x4faa60);return _0x2f832e[_0x7995('0x22')]('Content-Range',_0x1e1415+'-'+_0x37a7d4+'/'+_0x291317)[_0x7995('0x23')](_0x43d4b8);}return null;};}function patchUpdates(_0x51f276){return function(_0x4b1a8e){try{jsonpatch[_0x7995('0x24')](_0x4b1a8e,_0x51f276,!![]);}catch(_0x327b1f){return BPromise[_0x7995('0x25')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x26')]();};}function saveUpdates(_0x460924,_0x1c278a){return function(_0x5d40ae){if(_0x5d40ae){return _0x5d40ae[_0x7995('0x27')](_0x460924)[_0x7995('0x28')](function(_0x204507){return _0x204507;});}return null;};}function removeEntity(_0x285437,_0x563799){return function(_0x13bc35){if(_0x13bc35){return _0x13bc35[_0x7995('0x29')]()[_0x7995('0x28')](function(){_0x285437['status'](0xcc)[_0x7995('0x20')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1e')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x2a')]);if(_0x47625f[_0x7995('0x2b')]){delete _0x47625f[_0x7995('0x2b')];}_0x2a307e[_0x7995('0x1f')](_0x56691a)[_0x7995('0x2c')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['VoiceQueueReport'][_0x7995('0x2d')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2e')],'type':_0xe6b0b3[_0x7995('0x2f')][_0x7995('0x30')]};});_0x3250e0[_0x7995('0x31')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x32')]=_['keys'](_0x9b2a15[_0x7995('0x32')]);_0x3250e0[_0x7995('0x33')]=_[_0x7995('0x34')](_0x3250e0[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]);_0x456a28['attributes']=_[_0x7995('0x34')](_0x3250e0[_0x7995('0x31')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x35')]=_0x456a28[_0x7995('0x35')]['length']?_0x456a28[_0x7995('0x35')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x32')][_0x7995('0x36')](_0x7995('0x37'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x32')]['limit']);_0x456a28['offset']=qs[_0x7995('0x21')](_0x9b2a15[_0x7995('0x32')]['offset']);}_0x456a28[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x9b2a15[_0x7995('0x32')][_0x7995('0x39')]);_0x456a28[_0x7995('0x3a')]=qs['filters'](_[_0x7995('0x3b')](_0x9b2a15[_0x7995('0x32')],_0x3250e0[_0x7995('0x33')]),_0x574574);if(_0x9b2a15[_0x7995('0x32')]['filter']){_0x456a28[_0x7995('0x3a')]=_[_0x7995('0x3c')](_0x456a28[_0x7995('0x3a')],{'$or':_[_0x7995('0x3d')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2f')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2b')]]={'$like':'%'+_0x9b2a15[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3c')]({},_0x456a28,_0x9b2a15[_0x7995('0x3f')]);var _0x14d638={'where':_0x456a28[_0x7995('0x3a')]};return db[_0x7995('0x40')][_0x7995('0x41')](_0x14d638)[_0x7995('0x28')](function(_0x270d52){_0x4253e5[_0x7995('0x41')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x42')]=[{'all':!![]}];}return db[_0x7995('0x40')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x43')](handleError(_0x514445,null));};exports[_0x7995('0x44')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':![],'where':{'id':_0x35c8ff[_0x7995('0x45')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x40')][_0x7995('0x2d')]);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x46')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x33')]=_[_0x7995('0x34')](_0x5e85b9[_0x7995('0x31')],_0x5e85b9[_0x7995('0x32')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x31')],qs['fields'](_0x35c8ff[_0x7995('0x32')]['fields']));_0x46ac4f[_0x7995('0x35')]=_0x46ac4f['attributes'][_0x7995('0x47')]?_0x46ac4f[_0x7995('0x35')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x32')][_0x7995('0x48')]){_0x46ac4f[_0x7995('0x42')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3c')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x40')][_0x7995('0x49')](_0x46ac4f)[_0x7995('0x28')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x43')](handleError(_0x576b96,null));};exports[_0x7995('0x4a')]=function(_0x511567,_0x3d8ae3){return db[_0x7995('0x40')]['create'](_0x511567[_0x7995('0x4b')],{})[_0x7995('0x28')](respondWithResult(_0x3d8ae3,0xc9))['catch'](handleError(_0x3d8ae3,null));};exports[_0x7995('0x27')]=function(_0x5843ba,_0x1d87f9){if(_0x5843ba[_0x7995('0x4b')]['id']){delete _0x5843ba[_0x7995('0x4b')]['id'];}return db[_0x7995('0x40')][_0x7995('0x49')]({'where':{'id':_0x5843ba[_0x7995('0x45')]['id']}})[_0x7995('0x28')](handleEntityNotFound(_0x1d87f9,null))['then'](saveUpdates(_0x5843ba[_0x7995('0x4b')],null))[_0x7995('0x28')](respondWithResult(_0x1d87f9,null))[_0x7995('0x43')](handleError(_0x1d87f9,null));};exports['destroy']=function(_0x19da63,_0x1fe77e){return db[_0x7995('0x40')]['find']({'where':{'id':_0x19da63['params']['id']}})['then'](handleEntityNotFound(_0x1fe77e,null))[_0x7995('0x28')](removeEntity(_0x1fe77e,null))[_0x7995('0x43')](handleError(_0x1fe77e,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x28')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x4d')]=function(_0x4ab09f,_0x14fe7f){var _0x33c801={},_0x206d2a={},_0x50c7b5={'count':0x0,'rows':[]};_0x206d2a['model']=_['keys'](db['VoiceQueueReport'][_0x7995('0x2d')]);_0x206d2a[_0x7995('0x32')]=_[_0x7995('0x46')](_0x4ab09f[_0x7995('0x32')]);_0x206d2a[_0x7995('0x33')]=_[_0x7995('0x34')](_0x206d2a[_0x7995('0x31')],_0x206d2a[_0x7995('0x32')]);_0x33c801[_0x7995('0x35')]=_[_0x7995('0x34')](_0x206d2a[_0x7995('0x31')],qs[_0x7995('0x4e')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x4e')]));_0x33c801[_0x7995('0x35')]=_0x33c801[_0x7995('0x35')][_0x7995('0x47')]?_0x33c801[_0x7995('0x35')]:_0x206d2a[_0x7995('0x31')];if(!_0x4ab09f['query'][_0x7995('0x36')](_0x7995('0x37'))){_0x33c801[_0x7995('0x4f')]=qs[_0x7995('0x4f')](_0x4ab09f['query']['limit']);_0x33c801[_0x7995('0x21')]=qs[_0x7995('0x21')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x21')]);}_0x33c801['order']=qs[_0x7995('0x39')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x39')]);_0x33c801[_0x7995('0x3a')]=qs['filters'](_['pick'](_0x4ab09f[_0x7995('0x32')],_0x206d2a[_0x7995('0x33')]));if(_0x4ab09f[_0x7995('0x32')][_0x7995('0x3e')]){_0x33c801[_0x7995('0x3a')]=_[_0x7995('0x3c')](_0x33c801[_0x7995('0x3a')],{'$or':_[_0x7995('0x3d')](_0x33c801[_0x7995('0x35')],function(_0x50caf5){var _0x18f230={};_0x18f230[_0x50caf5]={'$like':'%'+_0x4ab09f[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x18f230;})});}_0x33c801=_[_0x7995('0x3c')]({},_0x33c801,_0x4ab09f['options']);var _0x51bf6a={'where':_0x33c801[_0x7995('0x3a')]};return db[_0x7995('0x40')]['count'](_0x51bf6a)[_0x7995('0x28')](function(_0x375fc9){_0x50c7b5[_0x7995('0x41')]=_0x375fc9;if(_0x4ab09f[_0x7995('0x32')][_0x7995('0x48')]){_0x33c801['include']=[{'all':!![]}];}return db[_0x7995('0x40')]['findAll'](_0x33c801);})[_0x7995('0x28')](function(_0xe31dcb){_0x50c7b5[_0x7995('0x50')]=_0xe31dcb;return _0x50c7b5;})[_0x7995('0x28')](respondWithFilteredResult(_0x14fe7f,_0x33c801,_0x7995('0x4d')))[_0x7995('0x43')](handleError(_0x14fe7f,null,_0x7995('0x4d')));};
\ No newline at end of file
+var _0x7a54=['hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','getVoiceQueuesReport','intersection','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x7a54,0x106));var _0x47a5=function(_0x1a734d,_0x4a0571){_0x1a734d=_0x1a734d-0x0;var _0x3efa8d=_0x7a54[_0x1a734d];return _0x3efa8d;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}exports[_0x47a5('0x2b')]=function(_0x16631f,_0x361bfa){var _0x1127f8={},_0x11a4fa={},_0x3ad507={'count':0x0,'rows':[]};var _0x528582=_[_0x47a5('0x2c')](db['VoiceQueueReport'][_0x47a5('0x2d')],function(_0x9ac908){return{'name':_0x9ac908[_0x47a5('0x2e')],'type':_0x9ac908['type'][_0x47a5('0x2f')]};});_0x11a4fa[_0x47a5('0x30')]=_[_0x47a5('0x2c')](_0x528582,_0x47a5('0x29'));_0x11a4fa['query']=_['keys'](_0x16631f[_0x47a5('0x31')]);_0x11a4fa[_0x47a5('0x32')]=_['intersection'](_0x11a4fa['model'],_0x11a4fa[_0x47a5('0x31')]);_0x1127f8[_0x47a5('0x33')]=_['intersection'](_0x11a4fa[_0x47a5('0x30')],qs['fields'](_0x16631f[_0x47a5('0x31')][_0x47a5('0x34')]));_0x1127f8['attributes']=_0x1127f8['attributes'][_0x47a5('0x35')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x30')];if(!_0x16631f[_0x47a5('0x31')][_0x47a5('0x36')]('nolimit')){_0x1127f8[_0x47a5('0x1f')]=qs['limit'](_0x16631f['query'][_0x47a5('0x1f')]);_0x1127f8['offset']=qs[_0x47a5('0x1e')](_0x16631f['query'][_0x47a5('0x1e')]);}_0x1127f8[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0x16631f[_0x47a5('0x31')][_0x47a5('0x38')]);_0x1127f8[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0x16631f[_0x47a5('0x31')],_0x11a4fa['filters']),_0x528582);if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x1127f8['where']=_[_0x47a5('0x3c')](_0x1127f8[_0x47a5('0x39')],{'$or':_[_0x47a5('0x2c')](_0x528582,function(_0x49c4b5){if(_0x49c4b5[_0x47a5('0x3d')]!==_0x47a5('0x3e')){var _0x596097={};_0x596097[_0x49c4b5[_0x47a5('0x29')]]={'$like':'%'+_0x16631f[_0x47a5('0x31')]['filter']+'%'};return _0x596097;}})});}_0x1127f8=_['merge']({},_0x1127f8,_0x16631f['options']);var _0x12d9f2={'where':_0x1127f8['where']};return db[_0x47a5('0x3f')][_0x47a5('0x1d')](_0x12d9f2)[_0x47a5('0x26')](function(_0x111f0d){_0x3ad507[_0x47a5('0x1d')]=_0x111f0d;if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x40')]){_0x1127f8[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x1127f8);})[_0x47a5('0x26')](function(_0x1658e8){_0x3ad507[_0x47a5('0x43')]=_0x1658e8;return _0x3ad507;})['then'](respondWithFilteredResult(_0x361bfa,_0x1127f8))[_0x47a5('0x44')](handleError(_0x361bfa,null));};exports[_0x47a5('0x45')]=function(_0x331474,_0x23bd8d){var _0x586f4f={'raw':![],'where':{'id':_0x331474['params']['id']}},_0x7de536={};_0x7de536['model']=_['keys'](db['VoiceQueueReport'][_0x47a5('0x2d')]);_0x7de536['query']=_[_0x47a5('0x46')](_0x331474[_0x47a5('0x31')]);_0x7de536[_0x47a5('0x32')]=_['intersection'](_0x7de536[_0x47a5('0x30')],_0x7de536[_0x47a5('0x31')]);_0x586f4f['attributes']=_['intersection'](_0x7de536[_0x47a5('0x30')],qs['fields'](_0x331474[_0x47a5('0x31')][_0x47a5('0x34')]));_0x586f4f[_0x47a5('0x33')]=_0x586f4f[_0x47a5('0x33')][_0x47a5('0x35')]?_0x586f4f[_0x47a5('0x33')]:_0x7de536[_0x47a5('0x30')];if(_0x331474[_0x47a5('0x31')][_0x47a5('0x40')]){_0x586f4f[_0x47a5('0x41')]=[{'all':!![]}];}_0x586f4f=_[_0x47a5('0x3c')]({},_0x586f4f,_0x331474[_0x47a5('0x47')]);return db[_0x47a5('0x3f')][_0x47a5('0x48')](_0x586f4f)[_0x47a5('0x26')](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x26')](respondWithResult(_0x23bd8d,null))['catch'](handleError(_0x23bd8d,null));};exports[_0x47a5('0x49')]=function(_0x23bb04,_0x49eab1){return db['VoiceQueueReport'][_0x47a5('0x49')](_0x23bb04['body'],{})[_0x47a5('0x26')](respondWithResult(_0x49eab1,0xc9))[_0x47a5('0x44')](handleError(_0x49eab1,null));};exports['update']=function(_0x4f62d3,_0x3d85cc){if(_0x4f62d3['body']['id']){delete _0x4f62d3[_0x47a5('0x4a')]['id'];}return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x4f62d3[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x26')](saveUpdates(_0x4f62d3[_0x47a5('0x4a')],null))['then'](respondWithResult(_0x3d85cc,null))['catch'](handleError(_0x3d85cc,null));};exports[_0x47a5('0x25')]=function(_0x411230,_0x1163e3){return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x411230[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x1163e3,null))['then'](removeEntity(_0x1163e3,null))[_0x47a5('0x44')](handleError(_0x1163e3,null));};exports[_0x47a5('0x4c')]=function(_0x5f6a,_0x5c3c75){return db[_0x47a5('0x3f')]['describe']()[_0x47a5('0x26')](respondWithResult(_0x5c3c75,null))[_0x47a5('0x44')](handleError(_0x5c3c75,null));};exports[_0x47a5('0x4d')]=function(_0xf03bd5,_0x588551){var _0x3adf14={},_0x1e6de3={},_0x2f66e9={'count':0x0,'rows':[]};_0x1e6de3[_0x47a5('0x30')]=_[_0x47a5('0x46')](db[_0x47a5('0x3f')][_0x47a5('0x2d')]);_0x1e6de3['query']=_[_0x47a5('0x46')](_0xf03bd5[_0x47a5('0x31')]);_0x1e6de3[_0x47a5('0x32')]=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],_0x1e6de3[_0x47a5('0x31')]);_0x3adf14['attributes']=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],qs[_0x47a5('0x34')](_0xf03bd5['query'][_0x47a5('0x34')]));_0x3adf14[_0x47a5('0x33')]=_0x3adf14[_0x47a5('0x33')]['length']?_0x3adf14['attributes']:_0x1e6de3[_0x47a5('0x30')];if(!_0xf03bd5[_0x47a5('0x31')]['hasOwnProperty']('nolimit')){_0x3adf14[_0x47a5('0x1f')]=qs['limit'](_0xf03bd5[_0x47a5('0x31')]['limit']);_0x3adf14['offset']=qs[_0x47a5('0x1e')](_0xf03bd5[_0x47a5('0x31')]['offset']);}_0x3adf14[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0xf03bd5['query']['sort']);_0x3adf14[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0xf03bd5[_0x47a5('0x31')],_0x1e6de3['filters']));if(_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x3adf14[_0x47a5('0x39')]=_['merge'](_0x3adf14[_0x47a5('0x39')],{'$or':_['map'](_0x3adf14[_0x47a5('0x33')],function(_0x470da6){var _0x943a15={};_0x943a15[_0x470da6]={'$like':'%'+_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]+'%'};return _0x943a15;})});}_0x3adf14=_['merge']({},_0x3adf14,_0xf03bd5[_0x47a5('0x47')]);var _0x5d1550={'where':_0x3adf14['where']};return db['VoiceQueueReport']['count'](_0x5d1550)[_0x47a5('0x26')](function(_0x6cd4ea){_0x2f66e9[_0x47a5('0x1d')]=_0x6cd4ea;if(_0xf03bd5['query']['includeAll']){_0x3adf14[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x3adf14);})[_0x47a5('0x26')](function(_0xc45e25){_0x2f66e9['rows']=_0xc45e25;return _0x2f66e9;})[_0x47a5('0x26')](respondWithFilteredResult(_0x588551,_0x3adf14,'getVoiceQueuesReport'))[_0x47a5('0x44')](handleError(_0x588551,null,_0x47a5('0x4d')));};
\ No newline at end of file
index bea9a9c..a8586a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a09=['../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove','hasOwnProperty','hook','exports'];(function(_0x22b9c0,_0x50df78){var _0x1970ed=function(_0x3207da){while(--_0x3207da){_0x22b9c0['push'](_0x22b9c0['shift']());}};_0x1970ed(++_0x50df78);}(_0x0a09,0x1b8));var _0x90a0=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x0a09[_0x40bffc];return _0x3007e9;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x90a0('0x0'))['db'][_0x90a0('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x90a0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x90a0('0x3'),'afterDestroy':_0x90a0('0x4')};function emitEvent(_0x3725fd){return function(_0x1f1421,_0x4e0aa4,_0x586b88){VoiceQueueReportEvents['emit'](_0x3725fd+':'+_0x1f1421['id'],_0x1f1421);VoiceQueueReportEvents['emit'](_0x3725fd,_0x1f1421);_0x586b88(null);};}for(var e in events){if(events[_0x90a0('0x5')](e)){var event=events[e];VoiceQueueReport[_0x90a0('0x6')](e,emitEvent(event));}}module[_0x90a0('0x7')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xb9d6=['hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit'];(function(_0x45a1bf,_0x3b43ae){var _0x17a06e=function(_0x188dfc){while(--_0x188dfc){_0x45a1bf['push'](_0x45a1bf['shift']());}};_0x17a06e(++_0x3b43ae);}(_0xb9d6,0x1d5));var _0x6b9d=function(_0x1c7377,_0x8a8698){_0x1c7377=_0x1c7377-0x0;var _0x5d03e3=_0xb9d6[_0x1c7377];return _0x5d03e3;};'use strict';var EventEmitter=require(_0x6b9d('0x0'));var VoiceQueueReport=require(_0x6b9d('0x1'))['db'][_0x6b9d('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6b9d('0x3')](0x0);var events={'afterCreate':_0x6b9d('0x4'),'afterUpdate':_0x6b9d('0x5'),'afterDestroy':_0x6b9d('0x6')};function emitEvent(_0x3ef192){return function(_0x1872ed,_0x451f15,_0x46e0f0){VoiceQueueReportEvents[_0x6b9d('0x7')](_0x3ef192+':'+_0x1872ed['id'],_0x1872ed);VoiceQueueReportEvents[_0x6b9d('0x7')](_0x3ef192,_0x1872ed);_0x46e0f0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x6b9d('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
index edd54fc..3f9f64b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe171=['bluebird','request-promise','path','rimraf','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api'];(function(_0x47e0a0,_0x2c06bc){var _0x14c9bc=function(_0x381974){while(--_0x381974){_0x47e0a0['push'](_0x47e0a0['shift']());}};_0x14c9bc(++_0x2c06bc);}(_0xe171,0x1d1));var _0x1e17=function(_0x34010b,_0x255a63){_0x34010b=_0x34010b-0x0;var _0x186bde=_0xe171[_0x34010b];return _0x186bde;};'use strict';var _=require(_0x1e17('0x0'));var util=require('util');var logger=require(_0x1e17('0x1'))(_0x1e17('0x2'));var moment=require('moment');var BPromise=require(_0x1e17('0x3'));var rp=require(_0x1e17('0x4'));var fs=require('fs');var path=require(_0x1e17('0x5'));var rimraf=require(_0x1e17('0x6'));var config=require('../../config/environment');var attributes=require(_0x1e17('0x7'));module['exports']=function(_0x546b7d,_0x9d1691){return _0x546b7d[_0x1e17('0x8')](_0x1e17('0x9'),attributes,{'tableName':_0x1e17('0xa'),'paranoid':![],'indexes':[{'fields':[_0x1e17('0xb')]},{'fields':[_0x1e17('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fb2=['report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueueReport'];(function(_0x285db,_0x4f4926){var _0x2ebec6=function(_0x3a08c3){while(--_0x3a08c3){_0x285db['push'](_0x285db['shift']());}};_0x2ebec6(++_0x4f4926);}(_0x0fb2,0xa3));var _0x20fb=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0x0fb2[_0x13843f];return _0x1063ae;};'use strict';var _=require(_0x20fb('0x0'));var util=require(_0x20fb('0x1'));var logger=require(_0x20fb('0x2'))(_0x20fb('0x3'));var moment=require(_0x20fb('0x4'));var BPromise=require(_0x20fb('0x5'));var rp=require(_0x20fb('0x6'));var fs=require('fs');var path=require(_0x20fb('0x7'));var rimraf=require(_0x20fb('0x8'));var config=require(_0x20fb('0x9'));var attributes=require('./voiceQueueReport.attributes');module[_0x20fb('0xa')]=function(_0x123250,_0x2770b0){return _0x123250[_0x20fb('0xb')](_0x20fb('0xc'),attributes,{'tableName':_0x20fb('0xd'),'paranoid':![],'indexes':[{'fields':[_0x20fb('0xe')]},{'fields':[_0x20fb('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 73d5fc5..bece04f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60dd=['update','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','map','include','model','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport'];(function(_0x35c774,_0x512268){var _0x1c4cd2=function(_0x5127bf){while(--_0x5127bf){_0x35c774['push'](_0x35c774['shift']());}};_0x1c4cd2(++_0x512268);}(_0x60dd,0x1af));var _0xd60d=function(_0x5e7f28,_0x233446){_0x5e7f28=_0x5e7f28-0x0;var _0x1532eb=_0x60dd[_0x5e7f28];return _0x1532eb;};'use strict';var _=require(_0xd60d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd60d('0x1'));var rs=require(_0xd60d('0x2'));var fs=require('fs');var Redis=require(_0xd60d('0x3'));var db=require(_0xd60d('0x4'))['db'];var utils=require(_0xd60d('0x5'));var logger=require('../../config/logger')(_0xd60d('0x6'));var config=require(_0xd60d('0x7'));var jayson=require(_0xd60d('0x8'));var client=jayson[_0xd60d('0x9')][_0xd60d('0xa')]({'port':0x232a});config[_0xd60d('0xb')]=_[_0xd60d('0xc')](config['redis'],{'host':_0xd60d('0xd'),'port':0x18eb});var socket=require(_0xd60d('0xe'))(new Redis(config[_0xd60d('0xb')]));require(_0xd60d('0xf'))[_0xd60d('0x10')](socket);function respondWithRpcPromise(_0x14e2d1,_0x230c4b,_0xef8320){return new BPromise(function(_0x2c9efd,_0x245d97){return client[_0xd60d('0x11')](_0x14e2d1,_0xef8320)[_0xd60d('0x12')](function(_0x3079e1){logger[_0xd60d('0x13')](_0xd60d('0x14'),_0x230c4b,'request\x20sent');logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x230c4b,_0xd60d('0x15'),JSON[_0xd60d('0x16')](_0x3079e1));if(_0x3079e1[_0xd60d('0x17')]){if(_0x3079e1[_0xd60d('0x17')][_0xd60d('0x18')]===0x1f4){logger[_0xd60d('0x17')](_0xd60d('0x14'),_0x230c4b,_0x3079e1['error'][_0xd60d('0x19')]);return _0x245d97(_0x3079e1['error'][_0xd60d('0x19')]);}logger[_0xd60d('0x17')](_0xd60d('0x14'),_0x230c4b,_0x3079e1[_0xd60d('0x17')]['message']);return _0x2c9efd(_0x3079e1[_0xd60d('0x17')][_0xd60d('0x19')]);}else{logger['info'](_0xd60d('0x14'),_0x230c4b,_0xd60d('0x15'));_0x2c9efd(_0x3079e1['result'][_0xd60d('0x19')]);}})[_0xd60d('0x1a')](function(_0x21997c){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x230c4b,_0x21997c);_0x245d97(_0x21997c);});});}exports[_0xd60d('0x1b')]=function(_0x387576){var _0x323065=this;return new Promise(function(_0x251841,_0x399866){return db[_0xd60d('0x1c')]['findAll']({'raw':_0x387576[_0xd60d('0x1d')]?_0x387576[_0xd60d('0x1d')][_0xd60d('0x1e')]===undefined?!![]:![]:!![],'where':_0x387576[_0xd60d('0x1d')]?_0x387576[_0xd60d('0x1d')][_0xd60d('0x1f')]||null:null,'attributes':_0x387576['options']?_0x387576[_0xd60d('0x1d')][_0xd60d('0x20')]||null:null,'limit':_0x387576[_0xd60d('0x1d')]?_0x387576['options'][_0xd60d('0x21')]||null:null,'include':_0x387576['options']?_0x387576[_0xd60d('0x1d')]['include']?_[_0xd60d('0x22')](_0x387576[_0xd60d('0x1d')][_0xd60d('0x23')],function(_0x4d8350){return{'model':db[_0x4d8350[_0xd60d('0x24')]],'as':_0x4d8350['as'],'attributes':_0x4d8350[_0xd60d('0x20')],'include':_0x4d8350[_0xd60d('0x23')]?_[_0xd60d('0x22')](_0x4d8350[_0xd60d('0x23')],function(_0x4b9602){return{'model':db[_0x4b9602[_0xd60d('0x24')]],'as':_0x4b9602['as'],'attributes':_0x4b9602[_0xd60d('0x20')],'include':_0x4b9602[_0xd60d('0x23')]?_[_0xd60d('0x22')](_0x4b9602['include'],function(_0x1b6d0c){return{'model':db[_0x1b6d0c[_0xd60d('0x24')]],'as':_0x1b6d0c['as'],'attributes':_0x1b6d0c[_0xd60d('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd60d('0x12')](function(_0xcd7513){logger[_0xd60d('0x13')]('GetVoiceQueueReport',_0x387576);logger[_0xd60d('0x25')](_0xd60d('0x1b'),_0x387576,JSON['stringify'](_0xcd7513));_0x251841(_0xcd7513);})['catch'](function(_0x23e468){logger[_0xd60d('0x17')]('GetVoiceQueueReport',_0x23e468[_0xd60d('0x19')],_0x387576);_0x399866(_0x323065[_0xd60d('0x17')](0x1f4,_0x23e468['message']));});});};exports[_0xd60d('0x26')]=function(_0x1e0865){var _0x1da526=this;return new Promise(function(_0x21c7a9,_0x4283be){return db[_0xd60d('0x1c')][_0xd60d('0x27')](_0x1e0865[_0xd60d('0x28')],{'raw':_0x1e0865[_0xd60d('0x1d')]?_0x1e0865[_0xd60d('0x1d')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x341931){logger[_0xd60d('0x13')]('CreateVoiceQueueReport',_0x1e0865);logger[_0xd60d('0x25')]('CreateVoiceQueueReport',_0x1e0865,JSON['stringify'](_0x341931));_0x21c7a9(_0x341931);})['catch'](function(_0x528fe1){logger[_0xd60d('0x17')](_0xd60d('0x26'),_0x528fe1['message'],_0x1e0865);_0x4283be(_0x1da526[_0xd60d('0x17')](0x1f4,_0x528fe1[_0xd60d('0x19')]));});});};exports[_0xd60d('0x29')]=function(_0x8ec3de){var _0x20aa57=this;return new Promise(function(_0x1b2e22,_0xe326c1){return db['VoiceQueueReport'][_0xd60d('0x2a')](_0x8ec3de[_0xd60d('0x28')],{'raw':_0x8ec3de[_0xd60d('0x1d')]?_0x8ec3de['options'][_0xd60d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8ec3de[_0xd60d('0x1d')]?_0x8ec3de[_0xd60d('0x1d')]['where']||null:null,'attributes':_0x8ec3de[_0xd60d('0x1d')]?_0x8ec3de[_0xd60d('0x1d')][_0xd60d('0x20')]||null:null,'limit':_0x8ec3de['options']?_0x8ec3de['options'][_0xd60d('0x21')]||null:null})[_0xd60d('0x12')](function(_0xe9e018){logger[_0xd60d('0x13')](_0xd60d('0x29'),_0x8ec3de);logger[_0xd60d('0x25')](_0xd60d('0x29'),_0x8ec3de,JSON[_0xd60d('0x16')](_0xe9e018));_0x1b2e22(_0xe9e018);})[_0xd60d('0x1a')](function(_0xd08070){logger[_0xd60d('0x17')](_0xd60d('0x29'),_0xd08070['message'],_0x8ec3de);_0xe326c1(_0x20aa57[_0xd60d('0x17')](0x1f4,_0xd08070['message']));});});};
\ No newline at end of file
+var _0x6b19=['catch','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x1a7395,_0x24cd8b){var _0x16d4ee=function(_0x4fa5d4){while(--_0x4fa5d4){_0x1a7395['push'](_0x1a7395['shift']());}};_0x16d4ee(++_0x24cd8b);}(_0x6b19,0x165));var _0x96b1=function(_0x55d533,_0x71409e){_0x55d533=_0x55d533-0x0;var _0x31c425=_0x6b19[_0x55d533];return _0x31c425;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var moment=require(_0x96b1('0x2'));var BPromise=require(_0x96b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96b1('0x4'));var db=require(_0x96b1('0x5'))['db'];var utils=require(_0x96b1('0x6'));var logger=require(_0x96b1('0x7'))(_0x96b1('0x8'));var config=require(_0x96b1('0x9'));var jayson=require(_0x96b1('0xa'));var client=jayson[_0x96b1('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x96b1('0xc')],{'host':_0x96b1('0xd'),'port':0x18eb});var socket=require(_0x96b1('0xe'))(new Redis(config[_0x96b1('0xc')]));require(_0x96b1('0xf'))[_0x96b1('0x10')](socket);function respondWithRpcPromise(_0x160458,_0xa66fc6,_0x4161bb){return new BPromise(function(_0x2b3b48,_0xf4473f){return client[_0x96b1('0x11')](_0x160458,_0x4161bb)[_0x96b1('0x12')](function(_0x53c3d1){logger[_0x96b1('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0xa66fc6,_0x96b1('0x14'));logger[_0x96b1('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0xa66fc6,_0x96b1('0x14'),JSON[_0x96b1('0x16')](_0x53c3d1));if(_0x53c3d1[_0x96b1('0x17')]){if(_0x53c3d1['error'][_0x96b1('0x18')]===0x1f4){logger['error'](_0x96b1('0x19'),_0xa66fc6,_0x53c3d1[_0x96b1('0x17')]['message']);return _0xf4473f(_0x53c3d1[_0x96b1('0x17')]['message']);}logger[_0x96b1('0x17')](_0x96b1('0x19'),_0xa66fc6,_0x53c3d1[_0x96b1('0x17')][_0x96b1('0x1a')]);return _0x2b3b48(_0x53c3d1[_0x96b1('0x17')][_0x96b1('0x1a')]);}else{logger[_0x96b1('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0xa66fc6,_0x96b1('0x14'));_0x2b3b48(_0x53c3d1[_0x96b1('0x1b')]['message']);}})['catch'](function(_0x232fd9){logger[_0x96b1('0x17')](_0x96b1('0x19'),_0xa66fc6,_0x232fd9);_0xf4473f(_0x232fd9);});});}exports[_0x96b1('0x1c')]=function(_0x24f8f7){var _0xb5d073=this;return new Promise(function(_0x18193e,_0x1a9849){return db[_0x96b1('0x1d')][_0x96b1('0x1e')]({'raw':_0x24f8f7[_0x96b1('0x1f')]?_0x24f8f7[_0x96b1('0x1f')][_0x96b1('0x20')]===undefined?!![]:![]:!![],'where':_0x24f8f7[_0x96b1('0x1f')]?_0x24f8f7[_0x96b1('0x1f')][_0x96b1('0x21')]||null:null,'attributes':_0x24f8f7[_0x96b1('0x1f')]?_0x24f8f7[_0x96b1('0x1f')][_0x96b1('0x22')]||null:null,'limit':_0x24f8f7[_0x96b1('0x1f')]?_0x24f8f7[_0x96b1('0x1f')][_0x96b1('0x23')]||null:null,'include':_0x24f8f7[_0x96b1('0x1f')]?_0x24f8f7[_0x96b1('0x1f')][_0x96b1('0x24')]?_[_0x96b1('0x25')](_0x24f8f7[_0x96b1('0x1f')][_0x96b1('0x24')],function(_0x57027b){return{'model':db[_0x57027b[_0x96b1('0x26')]],'as':_0x57027b['as'],'attributes':_0x57027b[_0x96b1('0x22')],'include':_0x57027b['include']?_[_0x96b1('0x25')](_0x57027b[_0x96b1('0x24')],function(_0x54b1ff){return{'model':db[_0x54b1ff[_0x96b1('0x26')]],'as':_0x54b1ff['as'],'attributes':_0x54b1ff[_0x96b1('0x22')],'include':_0x54b1ff['include']?_[_0x96b1('0x25')](_0x54b1ff[_0x96b1('0x24')],function(_0x2fc1d3){return{'model':db[_0x2fc1d3[_0x96b1('0x26')]],'as':_0x2fc1d3['as'],'attributes':_0x2fc1d3[_0x96b1('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36569f){logger[_0x96b1('0x13')]('GetVoiceQueueReport',_0x24f8f7);logger[_0x96b1('0x15')](_0x96b1('0x1c'),_0x24f8f7,JSON[_0x96b1('0x16')](_0x36569f));_0x18193e(_0x36569f);})[_0x96b1('0x27')](function(_0x4b49ca){logger[_0x96b1('0x17')](_0x96b1('0x1c'),_0x4b49ca[_0x96b1('0x1a')],_0x24f8f7);_0x1a9849(_0xb5d073[_0x96b1('0x17')](0x1f4,_0x4b49ca[_0x96b1('0x1a')]));});});};exports['CreateVoiceQueueReport']=function(_0x12b860){var _0xe4991f=this;return new Promise(function(_0x14339d,_0x5d3edd){return db['VoiceQueueReport'][_0x96b1('0x28')](_0x12b860[_0x96b1('0x29')],{'raw':_0x12b860[_0x96b1('0x1f')]?_0x12b860['options'][_0x96b1('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x57b758){logger[_0x96b1('0x13')](_0x96b1('0x2a'),_0x12b860);logger[_0x96b1('0x15')](_0x96b1('0x2a'),_0x12b860,JSON[_0x96b1('0x16')](_0x57b758));_0x14339d(_0x57b758);})[_0x96b1('0x27')](function(_0x8d0f6a){logger['error']('CreateVoiceQueueReport',_0x8d0f6a[_0x96b1('0x1a')],_0x12b860);_0x5d3edd(_0xe4991f[_0x96b1('0x17')](0x1f4,_0x8d0f6a[_0x96b1('0x1a')]));});});};exports[_0x96b1('0x2b')]=function(_0x365842){var _0x49fd56=this;return new Promise(function(_0x533147,_0x1f989f){return db[_0x96b1('0x1d')]['update'](_0x365842[_0x96b1('0x29')],{'raw':_0x365842[_0x96b1('0x1f')]?_0x365842[_0x96b1('0x1f')][_0x96b1('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x365842['options']?_0x365842[_0x96b1('0x1f')]['where']||null:null,'attributes':_0x365842[_0x96b1('0x1f')]?_0x365842[_0x96b1('0x1f')][_0x96b1('0x22')]||null:null,'limit':_0x365842[_0x96b1('0x1f')]?_0x365842[_0x96b1('0x1f')][_0x96b1('0x23')]||null:null})[_0x96b1('0x12')](function(_0x2f0acb){logger['info'](_0x96b1('0x2b'),_0x365842);logger[_0x96b1('0x15')](_0x96b1('0x2b'),_0x365842,JSON['stringify'](_0x2f0acb));_0x533147(_0x2f0acb);})['catch'](function(_0x2eb699){logger[_0x96b1('0x17')](_0x96b1('0x2b'),_0x2eb699[_0x96b1('0x1a')],_0x365842);_0x1f989f(_0x49fd56['error'](0x1f4,_0x2eb699[_0x96b1('0x1a')]));});});};
\ No newline at end of file
index 10c70ef..6c8333e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2780=['length','voiceQueueReport:','save','emit','register'];(function(_0x274c25,_0x2dc079){var _0x24d285=function(_0x166383){while(--_0x166383){_0x274c25['push'](_0x274c25['shift']());}};_0x24d285(++_0x2dc079);}(_0x2780,0x1a1));var _0x0278=function(_0x5ba103,_0x1e1f82){_0x5ba103=_0x5ba103-0x0;var _0x4d413c=_0x2780[_0x5ba103];return _0x4d413c;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x0278('0x0'),'remove','update'];function createListener(_0x3f44f1,_0x30027e){return function(_0x54ef61){_0x30027e[_0x0278('0x1')](_0x3f44f1,_0x54ef61);};}function removeListener(_0x15c628,_0x4d309f){return function(){VoiceQueueReportEvents['removeListener'](_0x15c628,_0x4d309f);};}exports[_0x0278('0x2')]=function(_0x4f1450){for(var _0x59bf51=0x0,_0x24d036=events[_0x0278('0x3')];_0x59bf51<_0x24d036;_0x59bf51++){var _0x4a78b1=events[_0x59bf51];var _0x4f3049=createListener(_0x0278('0x4')+_0x4a78b1,_0x4f1450);VoiceQueueReportEvents['on'](_0x4a78b1,_0x4f3049);}};
\ No newline at end of file
+var _0x7aa2=['update','removeListener','voiceQueueReport:','./voiceQueueReport.events','remove'];(function(_0x31247b,_0xede9e1){var _0x99045=function(_0x4a11cb){while(--_0x4a11cb){_0x31247b['push'](_0x31247b['shift']());}};_0x99045(++_0xede9e1);}(_0x7aa2,0xee));var _0x27aa=function(_0x571461,_0x6f7b6b){_0x571461=_0x571461-0x0;var _0x15abf5=_0x7aa2[_0x571461];return _0x15abf5;};'use strict';var VoiceQueueReportEvents=require(_0x27aa('0x0'));var events=['save',_0x27aa('0x1'),_0x27aa('0x2')];function createListener(_0x46e869,_0x1fb746){return function(_0xd0133f){_0x1fb746['emit'](_0x46e869,_0xd0133f);};}function removeListener(_0xe2143d,_0x43980a){return function(){VoiceQueueReportEvents[_0x27aa('0x3')](_0xe2143d,_0x43980a);};}exports['register']=function(_0x55ecb9){for(var _0x572780=0x0,_0x20d17b=events['length'];_0x572780<_0x20d17b;_0x572780++){var _0x391b3f=events[_0x572780];var _0xf16b20=createListener(_0x27aa('0x4')+_0x391b3f,_0x55ecb9);VoiceQueueReportEvents['on'](_0x391b3f,_0xf16b20);}};
\ No newline at end of file
index 2b8822f..ebd45fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec68=['./voiceQueuesLog.controller','get','index','isAuthenticated','/:id','update','delete','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x4dafc1,_0x1ab01e){var _0x5e3d61=function(_0x48ea4f){while(--_0x48ea4f){_0x4dafc1['push'](_0x4dafc1['shift']());}};_0x5e3d61(++_0x1ab01e);}(_0xec68,0x174));var _0x8ec6=function(_0x280439,_0x553616){_0x280439=_0x280439-0x0;var _0x13109c=_0xec68[_0x280439];return _0x13109c;};'use strict';var multer=require(_0x8ec6('0x0'));var util=require('util');var path=require(_0x8ec6('0x1'));var timeout=require(_0x8ec6('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x8ec6('0x3'));var interaction=require(_0x8ec6('0x4'));var config=require('../../config/environment');var controller=require(_0x8ec6('0x5'));router[_0x8ec6('0x6')]('/',auth['isAuthenticated'](),controller[_0x8ec6('0x7')]);router[_0x8ec6('0x6')]('/:id',auth[_0x8ec6('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8ec6('0x9'),auth[_0x8ec6('0x8')](),controller[_0x8ec6('0xa')]);router[_0x8ec6('0xb')]('/:id',auth[_0x8ec6('0x8')](),controller['destroy']);module[_0x8ec6('0xc')]=router;
\ No newline at end of file
+var _0xd965=['get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd965,0xe7));var _0x5d96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd965[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5d96('0x0'));var util=require('util');var path=require(_0x5d96('0x1'));var timeout=require(_0x5d96('0x2'));var express=require(_0x5d96('0x3'));var router=express['Router']();var auth=require(_0x5d96('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5d96('0x5'));var controller=require(_0x5d96('0x6'));router[_0x5d96('0x7')]('/',auth[_0x5d96('0x8')](),controller[_0x5d96('0x9')]);router[_0x5d96('0x7')](_0x5d96('0xa'),auth['isAuthenticated'](),controller[_0x5d96('0xb')]);router[_0x5d96('0xc')]('/',auth[_0x5d96('0x8')](),controller[_0x5d96('0xd')]);router[_0x5d96('0xe')](_0x5d96('0xa'),auth[_0x5d96('0x8')](),controller[_0x5d96('0xf')]);router['delete'](_0x5d96('0xa'),auth[_0x5d96('0x8')](),controller[_0x5d96('0x10')]);module['exports']=router;
\ No newline at end of file
index 5273b8a..c4ebb16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x221f=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x6087b1,_0x41ce5e){var _0x103865=function(_0x4abb3a){while(--_0x4abb3a){_0x6087b1['push'](_0x6087b1['shift']());}};_0x103865(++_0x41ce5e);}(_0x221f,0x19d));var _0xf221=function(_0x3d8d0a,_0x11bb87){_0x3d8d0a=_0x3d8d0a-0x0;var _0x5b9df5=_0x221f[_0x3d8d0a];return _0x5b9df5;};'use strict';var Sequelize=require(_0xf221('0x0'));var moment=require('moment');module[_0xf221('0x1')]={'time':{'type':Sequelize[_0xf221('0x2')]},'callid':{'type':Sequelize[_0xf221('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xf221('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xf221('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xf221('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xf221('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xf221('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xf221('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xf221('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xf221('0x3')],'allowNull':![],'defaultValue':moment()[_0xf221('0x4')](_0xf221('0x5'))}};
\ No newline at end of file
+var _0x56aa=['YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0x56aa,0xb5));var _0xa56a=function(_0x271474,_0x248441){_0x271474=_0x271474-0x0;var _0x72f117=_0x56aa[_0x271474];return _0x72f117;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa56a('0x0'));module[_0xa56a('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xa56a('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xa56a('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xa56a('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xa56a('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xa56a('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xa56a('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xa56a('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()['format'](_0xa56a('0x3'))}};
\ No newline at end of file
index d0ba03e..0e918a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['where','merge','VoiceQueuesLog','include','rows','catch','show','params','includeAll','options','find','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x5b1efe,_0x31a192){var _0x1d601f=function(_0x33560a){while(--_0x33560a){_0x5b1efe['push'](_0x5b1efe['shift']());}};_0x1d601f(++_0x31a192);}(_0xb10b,0x12a));var _0xbb10=function(_0x477491,_0x5ca700){_0x477491=_0x477491-0x0;var _0xac6aec=_0xb10b[_0x477491];return _0xac6aec;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['VoiceQueuesLog'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]),_0x20d946);if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]!=='VIRTUAL'){var _0x5e3fbd={};_0x5e3fbd[_0x1e5bbd['name']]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5e3fbd;}})});}_0x6ed43b=_[_0xbb10('0x3a')]({},_0x6ed43b,_0x2fdde9['options']);var _0x3c0cd7={'where':_0x6ed43b[_0xbb10('0x39')]};return db[_0xbb10('0x3b')]['count'](_0x3c0cd7)[_0xbb10('0x23')](function(_0x12238a){_0x1acce9[_0xbb10('0x1c')]=_0x12238a;if(_0x2fdde9[_0xbb10('0x30')]['includeAll']){_0x6ed43b[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x3b')]['findAll'](_0x6ed43b);})[_0xbb10('0x23')](function(_0x2e3214){_0x1acce9[_0xbb10('0x3d')]=_0x2e3214;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x3e')](handleError(_0x24d586,null));};exports[_0xbb10('0x3f')]=function(_0x5f3d67,_0x1e8f79){var _0x1c7fae={'raw':!![],'where':{'id':_0x5f3d67[_0xbb10('0x40')]['id']}},_0x3e7b4c={};_0x3e7b4c['model']=_[_0xbb10('0x2d')](db[_0xbb10('0x3b')][_0xbb10('0x28')]);_0x3e7b4c[_0xbb10('0x30')]=_['keys'](_0x5f3d67[_0xbb10('0x30')]);_0x3e7b4c[_0xbb10('0x2e')]=_['intersection'](_0x3e7b4c['model'],_0x3e7b4c[_0xbb10('0x30')]);_0x1c7fae['attributes']=_[_0xbb10('0x2f')](_0x3e7b4c[_0xbb10('0x2c')],qs['fields'](_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x31')]));_0x1c7fae[_0xbb10('0x32')]=_0x1c7fae['attributes'][_0xbb10('0x33')]?_0x1c7fae[_0xbb10('0x32')]:_0x3e7b4c[_0xbb10('0x2c')];if(_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x41')]){_0x1c7fae[_0xbb10('0x3c')]=[{'all':!![]}];}_0x1c7fae=_[_0xbb10('0x3a')]({},_0x1c7fae,_0x5f3d67[_0xbb10('0x42')]);return db[_0xbb10('0x3b')][_0xbb10('0x43')](_0x1c7fae)[_0xbb10('0x23')](handleEntityNotFound(_0x1e8f79,null))[_0xbb10('0x23')](respondWithResult(_0x1e8f79,null))['catch'](handleError(_0x1e8f79,null));};exports[_0xbb10('0x44')]=function(_0x41bbf8,_0x4a1248){return db[_0xbb10('0x3b')][_0xbb10('0x44')](_0x41bbf8[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x4a1248,0xc9))[_0xbb10('0x3e')](handleError(_0x4a1248,null));};exports[_0xbb10('0x46')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x3e')](handleError(_0x5be85e,null));};exports[_0xbb10('0x24')]=function(_0x22b315,_0x2f2552){return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x22b315[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f2552,null))['then'](removeEntity(_0x2f2552,null))[_0xbb10('0x3e')](handleError(_0x2f2552,null));};
\ No newline at end of file
+var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x17a39b,_0x255da4){var _0x4e6603=function(_0x1c46c5){while(--_0x1c46c5){_0x17a39b['push'](_0x17a39b['shift']());}};_0x4e6603(++_0x255da4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};
\ No newline at end of file
index 348d630..bd20227 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a6d=['../../config/environment','./voiceQueuesLog.attributes','exports','define','voice_queues_log','event_dtm','event','dtm','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x567889,_0x17f310){var _0x1d3bd5=function(_0x1bafb8){while(--_0x1bafb8){_0x567889['push'](_0x567889['shift']());}};_0x1d3bd5(++_0x17f310);}(_0x3a6d,0x143));var _0xd3a6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3a6d[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var logger=require('../../config/logger')(_0xd3a6('0x2'));var moment=require(_0xd3a6('0x3'));var BPromise=require(_0xd3a6('0x4'));var rp=require(_0xd3a6('0x5'));var fs=require('fs');var path=require(_0xd3a6('0x6'));var rimraf=require('rimraf');var config=require(_0xd3a6('0x7'));var attributes=require(_0xd3a6('0x8'));module[_0xd3a6('0x9')]=function(_0x1fc450,_0x25b042){return _0x1fc450[_0xd3a6('0xa')]('VoiceQueuesLog',attributes,{'tableName':_0xd3a6('0xb'),'paranoid':![],'indexes':[{'name':_0xd3a6('0xc'),'fields':[_0xd3a6('0xd'),_0xd3a6('0xe')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xfb65=['VoiceQueuesLog','voice_queues_log','event_dtm','dtm','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define'];(function(_0x419546,_0x4656d5){var _0x516f66=function(_0x30c0f8){while(--_0x30c0f8){_0x419546['push'](_0x419546['shift']());}};_0x516f66(++_0x4656d5);}(_0xfb65,0x82));var _0x5fb6=function(_0x19f000,_0x39ac54){_0x19f000=_0x19f000-0x0;var _0x81cee0=_0xfb65[_0x19f000];return _0x81cee0;};'use strict';var _=require('lodash');var util=require(_0x5fb6('0x0'));var logger=require(_0x5fb6('0x1'))('api');var moment=require(_0x5fb6('0x2'));var BPromise=require('bluebird');var rp=require(_0x5fb6('0x3'));var fs=require('fs');var path=require(_0x5fb6('0x4'));var rimraf=require(_0x5fb6('0x5'));var config=require(_0x5fb6('0x6'));var attributes=require(_0x5fb6('0x7'));module[_0x5fb6('0x8')]=function(_0x4dec8f,_0x50782b){return _0x4dec8f[_0x5fb6('0x9')](_0x5fb6('0xa'),attributes,{'tableName':_0x5fb6('0xb'),'paranoid':![],'indexes':[{'name':_0x5fb6('0xc'),'fields':['event',_0x5fb6('0xd')]}],'timestamps':![]});};
\ No newline at end of file
index 67b5e98..a79d7c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa699=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x306c77,_0x3861bf){var _0x5951ea=function(_0xc63121){while(--_0xc63121){_0x306c77['push'](_0x306c77['shift']());}};_0x5951ea(++_0x3861bf);}(_0xa699,0x6b));var _0x9a69=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa699[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x9a69('0x0'));var util=require(_0x9a69('0x1'));var moment=require(_0x9a69('0x2'));var BPromise=require(_0x9a69('0x3'));var rs=require(_0x9a69('0x4'));var fs=require('fs');var Redis=require(_0x9a69('0x5'));var db=require(_0x9a69('0x6'))['db'];var utils=require(_0x9a69('0x7'));var logger=require(_0x9a69('0x8'))(_0x9a69('0x9'));var config=require(_0x9a69('0xa'));var jayson=require(_0x9a69('0xb'));var client=jayson[_0x9a69('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26b842,_0x3f9bce,_0x3bb021){return new BPromise(function(_0x4665a9,_0x5031b0){return client[_0x9a69('0xd')](_0x26b842,_0x3bb021)[_0x9a69('0xe')](function(_0x3fb953){logger[_0x9a69('0xf')](_0x9a69('0x10'),_0x3f9bce,'request\x20sent');logger['debug'](_0x9a69('0x11'),_0x3f9bce,'request\x20sent',JSON[_0x9a69('0x12')](_0x3fb953));if(_0x3fb953[_0x9a69('0x13')]){if(_0x3fb953['error'][_0x9a69('0x14')]===0x1f4){logger[_0x9a69('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x3f9bce,_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x5031b0(_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);}logger[_0x9a69('0x13')](_0x9a69('0x10'),_0x3f9bce,_0x3fb953[_0x9a69('0x13')][_0x9a69('0x15')]);return _0x4665a9(_0x3fb953[_0x9a69('0x13')]['message']);}else{logger[_0x9a69('0xf')](_0x9a69('0x10'),_0x3f9bce,_0x9a69('0x16'));_0x4665a9(_0x3fb953['result'][_0x9a69('0x15')]);}})[_0x9a69('0x17')](function(_0x380e46){logger[_0x9a69('0x13')](_0x9a69('0x10'),_0x3f9bce,_0x380e46);_0x5031b0(_0x380e46);});});}
\ No newline at end of file
+var _0x0db9=['code','message','catch','lodash','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x20a9c9,_0x56f7db){var _0x5949c6=function(_0x2ed372){while(--_0x2ed372){_0x20a9c9['push'](_0x20a9c9['shift']());}};_0x5949c6(++_0x56f7db);}(_0x0db9,0xa3));var _0x90db=function(_0x15cdcb,_0x4340e9){_0x15cdcb=_0x15cdcb-0x0;var _0x37b069=_0x0db9[_0x15cdcb];return _0x37b069;};'use strict';var _=require(_0x90db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x90db('0x1'));var fs=require('fs');var Redis=require(_0x90db('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x90db('0x3'));var logger=require('../../config/logger')(_0x90db('0x4'));var config=require(_0x90db('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x90db('0x6')][_0x90db('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x476491,_0xee21f8,_0x915ca){return new BPromise(function(_0x9b6d0d,_0x4b0c1d){return client[_0x90db('0x8')](_0x476491,_0x915ca)[_0x90db('0x9')](function(_0x39512e){logger[_0x90db('0xa')](_0x90db('0xb'),_0xee21f8,_0x90db('0xc'));logger[_0x90db('0xd')](_0x90db('0xe'),_0xee21f8,_0x90db('0xc'),JSON[_0x90db('0xf')](_0x39512e));if(_0x39512e[_0x90db('0x10')]){if(_0x39512e['error'][_0x90db('0x11')]===0x1f4){logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);return _0x4b0c1d(_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);}logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);return _0x9b6d0d(_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);}else{logger[_0x90db('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0xee21f8,_0x90db('0xc'));_0x9b6d0d(_0x39512e['result'][_0x90db('0x12')]);}})[_0x90db('0x13')](function(_0x3de860){logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x3de860);_0x4b0c1d(_0x3de860);});});}
\ No newline at end of file
index 96006ba..679d056 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x205a12,_0x5d1d07){var _0x2ae9cc=function(_0x3b2e01){while(--_0x3b2e01){_0x205a12['push'](_0x205a12['shift']());}};_0x2ae9cc(++_0x5d1d07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x36ec2b,_0x183c5a){var _0x51a5f9=function(_0x420731){while(--_0x420731){_0x36ec2b['push'](_0x36ec2b['shift']());}};_0x51a5f9(++_0x183c5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router;
\ No newline at end of file
index d3335b0..4a09dd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x472c=['membername','INTEGER','TEXT','NEW','FLOAT','BOOLEAN','DATE','createdAt','MM-DD-YYYY\x20HH:mm','toString','updatedAt','format','sequelize','moment','path','getDataValue','value','STRING','setDataValue','channel'];(function(_0x473d87,_0x3069dd){var _0x17c64c=function(_0x36386f){while(--_0x36386f){_0x473d87['push'](_0x473d87['shift']());}};_0x17c64c(++_0x3069dd);}(_0x472c,0x188));var _0xc472=function(_0x160fec,_0x2c1a2f){_0x160fec=_0x160fec-0x0;var _0x53a804=_0x472c[_0x160fec];return _0x53a804;};'use strict';var Sequelize=require(_0xc472('0x0'));var moment=require(_0xc472('0x1'));var path=require(_0xc472('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc472('0x3')](_0xc472('0x4'))?path['extname'](this[_0xc472('0x3')](_0xc472('0x4'))):undefined;}},'uniqueid':{'type':Sequelize[_0xc472('0x5')]},'channel':{'type':Sequelize[_0xc472('0x5')],'set':function(_0x2adc2a){if(_0x2adc2a){this[_0xc472('0x6')](_0xc472('0x7'),_0x2adc2a);this[_0xc472('0x6')](_0xc472('0x8'),_0x2adc2a['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xc472('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc472('0x5')]},'connectedlinenum':{'type':Sequelize[_0xc472('0x5')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc472('0x5')]},'context':{'type':Sequelize[_0xc472('0x5')]},'exten':{'type':Sequelize[_0xc472('0x5')]},'value':{'type':Sequelize[_0xc472('0x5')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0xc472('0x9')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xc472('0x5')]},'userDisposition':{'type':Sequelize[_0xc472('0x5')]},'location':{'type':Sequelize[_0xc472('0xa')]},'transcribeName':{'type':Sequelize[_0xc472('0x5')]},'transcribeStatus':{'type':Sequelize[_0xc472('0x5')],'defaultValue':_0xc472('0xb')},'fileUri':{'type':Sequelize[_0xc472('0xa')]},'fileText':{'type':Sequelize[_0xc472('0xa')]},'failureReason':{'type':Sequelize['TEXT']},'sentiment':{'type':Sequelize[_0xc472('0x5')]},'sPositive':{'type':Sequelize[_0xc472('0xc')]},'sNegative':{'type':Sequelize[_0xc472('0xc')]},'sNeutral':{'type':Sequelize[_0xc472('0xc')]},'sMixed':{'type':Sequelize[_0xc472('0xc')]},'tempSentiment':{'type':Sequelize[_0xc472('0xd')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0xc472('0xe')],'get':function(){return moment(this[_0xc472('0x3')](_0xc472('0xf')))['format'](_0xc472('0x10'))[_0xc472('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xc472('0x12')))[_0xc472('0x13')](_0xc472('0x10'))[_0xc472('0x11')]();}}};
\ No newline at end of file
+var _0x7094=['membername','split','INTEGER','TEXT','NEW','FLOAT','BOOLEAN','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue'];(function(_0x3c447d,_0x3e72f2){var _0x45f75f=function(_0x3d5665){while(--_0x3d5665){_0x3c447d['push'](_0x3c447d['shift']());}};_0x45f75f(++_0x3e72f2);}(_0x7094,0x157));var _0x4709=function(_0x41d5dd,_0x29cb1a){_0x41d5dd=_0x41d5dd-0x0;var _0x52b2e9=_0x7094[_0x41d5dd];return _0x52b2e9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4709('0x0'));var path=require(_0x4709('0x1'));module[_0x4709('0x2')]={'format':{'type':Sequelize[_0x4709('0x3')],'get':function(){return this[_0x4709('0x4')](_0x4709('0x5'))?path[_0x4709('0x6')](this[_0x4709('0x4')](_0x4709('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x4709('0x7')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x592614){if(_0x592614){this[_0x4709('0x8')]('channel',_0x592614);this['setDataValue'](_0x4709('0x9'),_0x592614[_0x4709('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x4709('0x7')]},'calleridnum':{'type':Sequelize[_0x4709('0x7')]},'calleridname':{'type':Sequelize[_0x4709('0x7')]},'connectedlinenum':{'type':Sequelize[_0x4709('0x7')]},'connectedlinename':{'type':Sequelize[_0x4709('0x7')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4709('0x7')]},'exten':{'type':Sequelize[_0x4709('0x7')]},'value':{'type':Sequelize[_0x4709('0x7')]},'type':{'type':Sequelize[_0x4709('0x7')]},'rating':{'type':Sequelize[_0x4709('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x4709('0x7')]},'userDisposition':{'type':Sequelize[_0x4709('0x7')]},'location':{'type':Sequelize[_0x4709('0xc')]},'transcribeName':{'type':Sequelize[_0x4709('0x7')]},'transcribeStatus':{'type':Sequelize[_0x4709('0x7')],'defaultValue':_0x4709('0xd')},'fileUri':{'type':Sequelize[_0x4709('0xc')]},'fileText':{'type':Sequelize[_0x4709('0xc')]},'failureReason':{'type':Sequelize[_0x4709('0xc')]},'sentiment':{'type':Sequelize[_0x4709('0x7')]},'sPositive':{'type':Sequelize[_0x4709('0xe')]},'sNegative':{'type':Sequelize[_0x4709('0xe')]},'sNeutral':{'type':Sequelize[_0x4709('0xe')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x4709('0xf')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0x4709('0x10')],'get':function(){return moment(this[_0x4709('0x4')](_0x4709('0x11')))[_0x4709('0x12')](_0x4709('0x13'))[_0x4709('0x14')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4709('0x4')](_0x4709('0x15')))['format'](_0x4709('0x13'))['toString']();}}};
\ No newline at end of file
index 0b56f3c..b501119 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0824=['recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','token','$and','push','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','bucket','Transcribe\x20not\x20configured','sentiment','sentimentRegion','language','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','VoiceRecording','rawAttributes','type','model','differenceBy','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','keys','options','find','create','body','describe','download','../../components/encryptor','uniqueid','params','value','%s.cypher','existsSync','decryptFile','secrets'];(function(_0x332c1b,_0x28d711){var _0x21b49b=function(_0x3f00fd){while(--_0x3f00fd){_0x332c1b['push'](_0x332c1b['shift']());}};_0x21b49b(++_0x28d711);}(_0x0824,0x176));var _0x4082=function(_0x28645f,_0x1f27bb){_0x28645f=_0x28645f-0x0;var _0x1906ff=_0x0824[_0x28645f];return _0x1906ff;};'use strict';var pdf=require(_0x4082('0x0'));var emlformat=require(_0x4082('0x1'));var rimraf=require(_0x4082('0x2'));var zipdir=require(_0x4082('0x3'));var jsonpatch=require(_0x4082('0x4'));var rp=require(_0x4082('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4082('0x6'));var util=require(_0x4082('0x7'));var path=require(_0x4082('0x8'));var sox=require('sox');var csv=require(_0x4082('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4082('0xa'));var jsforce=require(_0x4082('0xb'));var deskjs=require(_0x4082('0xc'));var toCsv=require(_0x4082('0x9'));var querystring=require(_0x4082('0xd'));var Papa=require(_0x4082('0xe'));var AWS=require(_0x4082('0xf'));var uuidv4=require('uuid/v4');var Redis=require(_0x4082('0x10'));var authService=require(_0x4082('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4082('0x12'));var hardwareService=require(_0x4082('0x13'));var logger=require(_0x4082('0x14'))(_0x4082('0x15'));var utils=require(_0x4082('0x16'));var config=require(_0x4082('0x17'));var db=require(_0x4082('0x18'))['db'];function respondWithStatusCode(_0x4eeb90,_0x27dbb1){_0x27dbb1=_0x27dbb1||0xcc;return function(_0x172350){if(_0x172350){return _0x4eeb90['sendStatus'](_0x27dbb1);}return _0x4eeb90[_0x4082('0x19')](_0x27dbb1)['end']();};}function respondWithResult(_0x444e32,_0x267f86){_0x267f86=_0x267f86||0xc8;return function(_0xdb9601){if(_0xdb9601){return _0x444e32[_0x4082('0x19')](_0x267f86)[_0x4082('0x1a')](_0xdb9601);}};}function respondWithFilteredResult(_0x22e0f2,_0x13621e){return function(_0x421acc){if(_0x421acc){var _0xe53b52=_0x421acc[_0x4082('0x1b')],_0x5485b1=_0x13621e['offset'],_0x5a2a1c=_0x13621e[_0x4082('0x1c')]+_0x13621e[_0x4082('0x1d')],_0x40d1a9;if(_0x5a2a1c>=_0xe53b52){_0x5a2a1c=_0xe53b52;_0x40d1a9=0xc8;}else{_0x40d1a9=0xce;}_0x22e0f2[_0x4082('0x19')](_0x40d1a9);return _0x22e0f2[_0x4082('0x1e')](_0x4082('0x1f'),_0x5485b1+'-'+_0x5a2a1c+'/'+_0xe53b52)[_0x4082('0x1a')](_0x421acc);}return null;};}function patchUpdates(_0x409fa8){return function(_0x1d9c0a){try{jsonpatch['apply'](_0x1d9c0a,_0x409fa8,!![]);}catch(_0x211095){return BPromise[_0x4082('0x20')](_0x211095);}return _0x1d9c0a[_0x4082('0x21')]();};}function saveUpdates(_0x18e084,_0x5f20d8){return function(_0x2939ee){if(_0x2939ee){return _0x2939ee[_0x4082('0x22')](_0x18e084)['then'](function(_0x326b5b){return _0x326b5b;});}return null;};}function removeEntity(_0x44cf2e,_0xf639d6){return function(_0x31d817){if(_0x31d817){return _0x31d817[_0x4082('0x23')]()[_0x4082('0x24')](function(){_0x44cf2e[_0x4082('0x19')](0xcc)[_0x4082('0x25')]();});}};}function handleEntityNotFound(_0x55c017,_0x2fa712){return function(_0x2df2d5){if(!_0x2df2d5){_0x55c017[_0x4082('0x26')](0x194);}return _0x2df2d5;};}function handleError(_0x47fa74,_0x5154c7){_0x5154c7=_0x5154c7||0x1f4;return function(_0x1877b5){logger[_0x4082('0x27')](_0x1877b5[_0x4082('0x28')]);if(_0x1877b5[_0x4082('0x29')]){delete _0x1877b5['name'];}_0x47fa74[_0x4082('0x19')](_0x5154c7)[_0x4082('0x2a')](_0x1877b5);};}exports[_0x4082('0x2b')]=function(_0x417730,_0x1090e9){var _0xd933a2={},_0x2ceb97={},_0x3a6d77={'count':0x0,'rows':[]};var _0x320172=_[_0x4082('0x2c')](db[_0x4082('0x2d')][_0x4082('0x2e')],function(_0x1c49a7){return{'name':_0x1c49a7['fieldName'],'type':_0x1c49a7[_0x4082('0x2f')]['key']};});_0x2ceb97[_0x4082('0x30')]=_[_0x4082('0x31')](_[_0x4082('0x2c')](_0x320172,_0x4082('0x29')),[_0x4082('0x32')]);_0x2ceb97[_0x4082('0x33')]=_['keys'](_0x417730[_0x4082('0x33')]);_0x2ceb97[_0x4082('0x34')]=_[_0x4082('0x35')](_0x2ceb97[_0x4082('0x30')],_0x2ceb97[_0x4082('0x33')]);_0xd933a2['attributes']=_[_0x4082('0x35')](_0x2ceb97[_0x4082('0x30')],qs[_0x4082('0x36')](_0x417730[_0x4082('0x33')]['fields']));_0xd933a2['attributes']=_0xd933a2[_0x4082('0x37')][_0x4082('0x38')]?_0xd933a2[_0x4082('0x37')]:_0x2ceb97['model'];if(!_0x417730[_0x4082('0x33')][_0x4082('0x39')](_0x4082('0x3a'))){_0xd933a2[_0x4082('0x1d')]=qs[_0x4082('0x1d')](_0x417730[_0x4082('0x33')][_0x4082('0x1d')]);_0xd933a2['offset']=qs[_0x4082('0x1c')](_0x417730[_0x4082('0x33')]['offset']);}_0xd933a2[_0x4082('0x3b')]=qs[_0x4082('0x3c')](_0x417730[_0x4082('0x33')][_0x4082('0x3c')]);_0xd933a2[_0x4082('0x3d')]=qs[_0x4082('0x34')](_[_0x4082('0x3e')](_0x417730[_0x4082('0x33')],_0x2ceb97[_0x4082('0x34')]),_0x320172);if(_0x417730[_0x4082('0x33')][_0x4082('0x3f')]){_0xd933a2[_0x4082('0x3d')]=_['merge'](_0xd933a2[_0x4082('0x3d')],{'$or':_[_0x4082('0x2c')](_0x320172,function(_0x42cee8){if(_0x42cee8['type']!=='VIRTUAL'){var _0x4c8994={};_0x4c8994[_0x42cee8[_0x4082('0x29')]]={'$like':'%'+_0x417730[_0x4082('0x33')][_0x4082('0x3f')]+'%'};return _0x4c8994;}})});}_0xd933a2=_[_0x4082('0x40')]({},_0xd933a2,_0x417730['options']);var _0x2928d8={'where':_0xd933a2[_0x4082('0x3d')]};return db['VoiceRecording']['count'](_0x2928d8)[_0x4082('0x24')](function(_0x41c869){_0x3a6d77['count']=_0x41c869;if(_0x417730[_0x4082('0x33')][_0x4082('0x41')]){_0xd933a2[_0x4082('0x42')]=[{'all':!![]}];}return db[_0x4082('0x2d')][_0x4082('0x43')](_0xd933a2);})[_0x4082('0x24')](function(_0x29a5f2){_0x3a6d77['rows']=_0x29a5f2;return _0x3a6d77;})['then'](respondWithFilteredResult(_0x1090e9,_0xd933a2))[_0x4082('0x44')](handleError(_0x1090e9,null));};exports[_0x4082('0x45')]=function(_0x21d2a9,_0x5cbbf3){var _0x222e72={'raw':![],'where':{'id':_0x21d2a9['params']['id']}},_0xe7b2a={};_0xe7b2a[_0x4082('0x30')]=_[_0x4082('0x46')](db[_0x4082('0x2d')][_0x4082('0x2e')]);_0xe7b2a['query']=_[_0x4082('0x46')](_0x21d2a9[_0x4082('0x33')]);_0xe7b2a[_0x4082('0x34')]=_['intersection'](_0xe7b2a['model'],_0xe7b2a[_0x4082('0x33')]);_0x222e72[_0x4082('0x37')]=_['intersection'](_0xe7b2a[_0x4082('0x30')],qs['fields'](_0x21d2a9['query'][_0x4082('0x36')]));_0x222e72[_0x4082('0x37')]=_0x222e72[_0x4082('0x37')][_0x4082('0x38')]?_0x222e72[_0x4082('0x37')]:_0xe7b2a[_0x4082('0x30')];if(_0x21d2a9[_0x4082('0x33')][_0x4082('0x41')]){_0x222e72[_0x4082('0x42')]=[{'all':!![]}];}_0x222e72=_[_0x4082('0x40')]({},_0x222e72,_0x21d2a9[_0x4082('0x47')]);return db[_0x4082('0x2d')][_0x4082('0x48')](_0x222e72)[_0x4082('0x24')](handleEntityNotFound(_0x5cbbf3,null))['then'](respondWithResult(_0x5cbbf3,null))['catch'](handleError(_0x5cbbf3,null));};exports[_0x4082('0x49')]=function(_0x1502b6,_0x1f858c){return db[_0x4082('0x2d')][_0x4082('0x49')](_0x1502b6[_0x4082('0x4a')],{})[_0x4082('0x24')](respondWithResult(_0x1f858c,0xc9))[_0x4082('0x44')](handleError(_0x1f858c,null));};exports[_0x4082('0x22')]=function(_0x198b07,_0x54985f){if(_0x198b07[_0x4082('0x4a')]['id']){delete _0x198b07[_0x4082('0x4a')]['id'];}return db['VoiceRecording'][_0x4082('0x48')]({'where':{'id':_0x198b07['params']['id']}})[_0x4082('0x24')](handleEntityNotFound(_0x54985f,null))[_0x4082('0x24')](saveUpdates(_0x198b07['body'],null))[_0x4082('0x24')](respondWithResult(_0x54985f,null))[_0x4082('0x44')](handleError(_0x54985f,null));};exports[_0x4082('0x4b')]=function(_0x4dc08c,_0x50c6e8){return db[_0x4082('0x2d')][_0x4082('0x4b')]()[_0x4082('0x24')](respondWithResult(_0x50c6e8,null))[_0x4082('0x44')](handleError(_0x50c6e8,null));};exports[_0x4082('0x4c')]=function(_0x150f7f,_0x5b090d,_0x51fab3){var _0x270fc9=require(_0x4082('0x4d'));var _0x1e0b58=![];var _0x674912={};if(_0x150f7f[_0x4082('0x33')][_0x4082('0x2f')]&&_0x150f7f[_0x4082('0x33')][_0x4082('0x2f')]==='uniqueid'){_0x674912[_0x4082('0x4e')]=_0x150f7f[_0x4082('0x4f')]['id'];}else{_0x674912['id']=_0x150f7f[_0x4082('0x4f')]['id'];}return db[_0x4082('0x2d')][_0x4082('0x48')]({'where':_0x674912,'attributes':['id',_0x4082('0x50')],'raw':!![]})[_0x4082('0x24')](handleEntityNotFound(_0x5b090d,null))[_0x4082('0x24')](function(_0x522ba7){if(_0x522ba7){var _0x4f8681=_0x522ba7['value'];var _0x5c8fa2=util['format'](_0x4082('0x51'),_0x4f8681);if(fs[_0x4082('0x52')](_0x5c8fa2)){_0x1e0b58=!![];return _0x270fc9[_0x4082('0x53')](_0x5c8fa2,_0x4f8681,config[_0x4082('0x54')][_0x4082('0x55')])[_0x4082('0x24')](function(){return _0x522ba7;});}return _0x522ba7;}})[_0x4082('0x24')](function(_0x11c1c5){if(_0x11c1c5){var _0x5bc12c=_0x11c1c5[_0x4082('0x50')];if(!fs['existsSync'](_0x5bc12c)){throw new db[(_0x4082('0x56'))][(_0x4082('0x57'))](_0x4082('0x58'));}if(_0x11c1c5[_0x4082('0x59')]){return _0x5b090d['download'](_0x5bc12c,_0x11c1c5['filename']+path[_0x4082('0x5a')](_0x5bc12c),function(){if(_0x1e0b58){fs['unlink'](_0x5bc12c);}});}else{return _0x5b090d[_0x4082('0x4c')](_0x5bc12c,function(_0x5f0ce5){if(_0x1e0b58){fs[_0x4082('0x5b')](_0x5bc12c);}});}}})[_0x4082('0x44')](function(_0x575faf){if(_0x575faf[_0x4082('0x5c')]===_0x4082('0x58')){_0x5b090d[_0x4082('0x19')](0x194)[_0x4082('0x2a')]('Not\x20found');}else{return handleError(_0x5b090d,null);}});};exports[_0x4082('0x5d')]=function(_0x57a75c,_0x5bbcd0,_0x3b2027){var _0x211c3a=require(_0x4082('0x4d'));var _0x3b48ed=![];var _0x411af6={'$and':[db[_0x4082('0x5e')][_0x4082('0x3d')](db[_0x4082('0x5e')]['fn'](_0x4082('0x5f'),db[_0x4082('0x5e')]['col']('uniqueid')),_0x57a75c[_0x4082('0x33')][_0x4082('0x60')])]};if(_0x57a75c[_0x4082('0x33')][_0x4082('0x2f')]&&_0x57a75c[_0x4082('0x33')][_0x4082('0x2f')]===_0x4082('0x4e')){_0x411af6[_0x4082('0x61')][_0x4082('0x62')]({'uniqueid':_0x57a75c[_0x4082('0x4f')]['id']});}else{_0x411af6[_0x4082('0x61')]['push']({'id':_0x57a75c[_0x4082('0x4f')]['id']});}return db[_0x4082('0x2d')]['find']({'where':_0x411af6,'attributes':['id',_0x4082('0x50')],'raw':!![]})[_0x4082('0x24')](handleEntityNotFound(_0x5bbcd0,null))[_0x4082('0x24')](function(_0x1c3161){if(_0x1c3161){var _0x1b7030=util['format'](_0x4082('0x51'),_0x1c3161['value']);if(fs[_0x4082('0x52')](_0x1b7030)){_0x3b48ed=!![];return _0x211c3a[_0x4082('0x53')](_0x1b7030,_0x1c3161[_0x4082('0x50')],config[_0x4082('0x54')][_0x4082('0x55')])[_0x4082('0x24')](function(){return _0x1c3161;});}return _0x1c3161;}})['then'](function(_0x15eff6){if(_0x15eff6){if(!fs['existsSync'](_0x15eff6[_0x4082('0x50')])){throw new db[(_0x4082('0x56'))]['ValidationError'](_0x4082('0x58'));}if(_0x15eff6[_0x4082('0x59')]){return _0x5bbcd0[_0x4082('0x4c')](_0x15eff6[_0x4082('0x50')],_0x15eff6[_0x4082('0x59')]+path[_0x4082('0x5a')](_0x15eff6['value']),function(){if(_0x3b48ed){fs[_0x4082('0x5b')](_0x15eff6[_0x4082('0x50')]);}});}else{return _0x5bbcd0[_0x4082('0x4c')](_0x15eff6[_0x4082('0x50')],function(_0x39bbc6){if(_0x3b48ed){fs[_0x4082('0x5b')](_0x15eff6[_0x4082('0x50')]);}});}}})[_0x4082('0x44')](handleError(_0x5bbcd0,null));};exports[_0x4082('0x23')]=function(_0x138469,_0xa4af9d){return db[_0x4082('0x2d')][_0x4082('0x48')]({'where':{'id':_0x138469[_0x4082('0x4f')]['id']}})['then'](function(_0x3944d9){if(!_0x3944d9)throw new ReferenceError(_0x4082('0x63'));return _0x3944d9;})[_0x4082('0x24')](function(_0x4603a4){var _0x39d873=_0x4603a4[_0x4082('0x50')];logger[_0x4082('0x64')](_0x4082('0x65'),_0x39d873);if(!_[_0x4082('0x66')](_0x4603a4['value'])&&fs[_0x4082('0x52')](_0x39d873)){logger['info'](_0x4082('0x67')+_0x39d873+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4082('0x68')](_0x39d873);}_0x39d873=_0x39d873+'.cypher';if(!_['isNil'](_0x4603a4['value'])&&fs[_0x4082('0x52')](_0x39d873)){logger[_0x4082('0x64')]('File:\x20\x22'+_0x39d873+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x4082('0x68')](_0x39d873);}return _0x4603a4;})['then'](function(_0x23de4f){if(!_0x23de4f)throw new InternalError();return _0x23de4f[_0x4082('0x23')]();})[_0x4082('0x24')](function(){_0xa4af9d['status'](0xcc)[_0x4082('0x25')]();})[_0x4082('0x44')](handleError(_0xa4af9d,null));};function getBucketslist(_0x3f65fa,_0xadcaeb,_0xf3aa4b){return new Promise(function(_0x250f06,_0x31104e){var _0x52af98=new AWS['S3']({'accessKeyId':_0xadcaeb,'secretAccessKey':_0x3f65fa,'region':_0xf3aa4b});_0x52af98[_0x4082('0x69')]({},function(_0x5664a2,_0x38640e){if(_0x5664a2){return _0x31104e(_0x5664a2);}else{return _0x250f06(_0x38640e);}});});}function createBucket(_0x41d097,_0x29420d,_0x574c81,_0x3c4fe1){return new Promise(function(_0x4c2cfb,_0xa35130){var _0x265aee=new AWS['S3']({'accessKeyId':_0x29420d,'secretAccessKey':_0x41d097,'region':_0x574c81});_0x265aee[_0x4082('0x6a')]({'Bucket':_0x3c4fe1},function(_0x2b694d,_0x3fd153){if(_0x2b694d){return _0xa35130(_0x2b694d);}else{return _0x4c2cfb(_0x3fd153);}});});}function uploadFile(_0xb3812d,_0x3651ba,_0x368376,_0x2b6253,_0x44dbdf,_0x5e3da3){return new Promise(function(_0xb0648a,_0x4a40a3){var _0x2a93fd=new AWS['S3']({'accessKeyId':_0x3651ba,'secretAccessKey':_0xb3812d,'region':_0x368376});_0x2a93fd[_0x4082('0x6b')]({'Bucket':_0x2b6253,'Key':_0x44dbdf,'Body':_0x5e3da3},function(_0x25d2ca,_0x2dd017){if(_0x25d2ca){return _0x4a40a3(_0x25d2ca);}else{return _0xb0648a(_0x2dd017);}});});}function startTranscribe(_0x56ddca,_0x3c2c17,_0x565cea,_0x202e31,_0x3e58ea,_0x568421){return new Promise(function(_0x35db81,_0x5dae88){var _0x8317aa=new AWS[(_0x4082('0x6c'))]({'accessKeyId':_0x3c2c17,'secretAccessKey':_0x56ddca,'region':_0x565cea});_0x8317aa['startTranscriptionJob']({'TranscriptionJobName':_0x202e31,'LanguageCode':_0x3e58ea,'Media':{'MediaFileUri':_0x568421}},function(_0x5371b9,_0x2845fa){if(_0x5371b9){return _0x5dae88(_0x5371b9);}else{return _0x35db81(_0x2845fa);}});});}function transcribe(_0x38a0f5,_0x2af5dd,_0x1017e9,_0x56ff87,_0x3f0f7f,_0x4ed50b,_0x298f36){return new Promise(function(_0x757fc3,_0x2072fe){var _0x26c993={};logger[_0x4082('0x64')](util[_0x4082('0x32')](_0x4082('0x6d'),_0x38a0f5,_0x3f0f7f));return uploadFile(_0x2af5dd,_0x1017e9,_0x56ff87,_0x3f0f7f,path[_0x4082('0x6e')](_0x4ed50b),fs[_0x4082('0x6f')](_0x4ed50b))[_0x4082('0x24')](function(_0x34a28f){logger[_0x4082('0x64')](util[_0x4082('0x32')](_0x4082('0x70'),_0x38a0f5,_0x3f0f7f,_0x34a28f[_0x4082('0x71')]));_0x26c993['bucket']=_0x34a28f[_0x4082('0x72')];_0x26c993[_0x4082('0x73')]=_0x34a28f[_0x4082('0x71')];logger[_0x4082('0x64')](util[_0x4082('0x32')](_0x4082('0x74'),_0x38a0f5));return startTranscribe(_0x2af5dd,_0x1017e9,_0x56ff87,uuidv4(),_0x298f36,_0x34a28f[_0x4082('0x71')]);})[_0x4082('0x24')](function(_0x37a692){logger[_0x4082('0x64')](util[_0x4082('0x32')](_0x4082('0x75'),_0x38a0f5,_0x37a692[_0x4082('0x76')]['TranscriptionJobName']));_0x26c993['transcribeName']=_0x37a692[_0x4082('0x76')][_0x4082('0x77')];_0x26c993[_0x4082('0x78')]=_0x37a692[_0x4082('0x76')][_0x4082('0x79')];return _0x757fc3(_0x26c993);})[_0x4082('0x44')](function(_0x4e15af){return _0x2072fe(_0x4e15af);});});}exports[_0x4082('0x7a')]=function(_0xc9d8ee,_0x2d70a3,_0x22a9a0){var _0xf5dfdc;var _0x2a1006;var _0xdbc8b7;var _0x42faf2=require(_0x4082('0x4d'));return db[_0x4082('0x2d')][_0x4082('0x7b')]({'where':{'id':_0xc9d8ee['params']['id']}})['then'](function(_0x250181){if(_0x250181){var _0x512d28=util[_0x4082('0x32')]('%s.cypher',_0x250181[_0x4082('0x50')]);if(fs[_0x4082('0x52')](_0x512d28)){cypher=!![];return _0x42faf2[_0x4082('0x53')](_0x512d28,_0x250181[_0x4082('0x50')],config[_0x4082('0x54')][_0x4082('0x55')])['then'](function(){return _0x250181;});}return _0x250181;}})['then'](function(_0x5b22e9){if(!_0x5b22e9){throw new db[(_0x4082('0x56'))][(_0x4082('0x57'))](_0x4082('0x7c'));}_0x2a1006=_0x5b22e9;return db[_0x4082('0x7d')][_0x4082('0x7b')]({'where':{'id':0x1}});})[_0x4082('0x24')](handleEntityNotFound(_0x2d70a3,null))[_0x4082('0x24')](function(_0x5b81e8){if(_0x5b81e8){_0xf5dfdc=_0x5b81e8;if(!_0xf5dfdc[_0x4082('0x7e')]||!_0xf5dfdc[_0x4082('0x7f')]||!_0xf5dfdc[_0x4082('0x80')]||!_0xf5dfdc['language']||!_0xf5dfdc[_0x4082('0x81')]){throw new db[(_0x4082('0x56'))][(_0x4082('0x57'))](_0x4082('0x82'));}if(_0xc9d8ee[_0x4082('0x4a')]['runSentiment']&&(!_0xf5dfdc[_0x4082('0x83')]||!_0xf5dfdc['sentimentAccountId']||!_0xf5dfdc[_0x4082('0x84')]||!_0xf5dfdc[_0x4082('0x85')]||!_0xf5dfdc[_0x4082('0x81')])){throw new db[(_0x4082('0x56'))][(_0x4082('0x57'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x4082('0x86')][_0x4082('0x7b')]({'where':{'id':_0xf5dfdc[_0x4082('0x7f')]}});}})[_0x4082('0x24')](function(_0x504798){if(!_0x504798){throw new db[(_0x4082('0x56'))]['ValidationError'](_0x4082('0x87'));}if(!_0x504798[_0x4082('0x88')]||!_0x504798['data2']){throw new db['Sequelize'][(_0x4082('0x57'))](_0x4082('0x89'));}_0xdbc8b7=_0x504798;return getBucketslist(_0xdbc8b7['data1'],_0xdbc8b7[_0x4082('0x8a')],_0xf5dfdc[_0x4082('0x80')]);})[_0x4082('0x24')](function(_0xa7fcd9){if(_0xa7fcd9&&_0xa7fcd9[_0x4082('0x8b')]){var _0x38bc26=_[_0x4082('0x48')](_0xa7fcd9[_0x4082('0x8b')],function(_0x17a6e7){return _0x17a6e7[_0x4082('0x8c')]===_0xf5dfdc[_0x4082('0x81')];});if(!_0x38bc26){logger[_0x4082('0x64')](util[_0x4082('0x32')](_0x4082('0x8d'),_0xc9d8ee['params']['id'],_0xf5dfdc['bucket']));return createBucket(_0xdbc8b7[_0x4082('0x88')],_0xdbc8b7[_0x4082('0x8a')],_0xf5dfdc[_0x4082('0x80')],_0xf5dfdc['bucket']);}logger[_0x4082('0x64')](util['format'](_0x4082('0x8e'),_0xc9d8ee['params']['id'],_0xf5dfdc[_0x4082('0x81')]));return;}})['then'](function(_0x3cc8be){if(_0x2a1006['transcribeStatus']===_0x4082('0x8f')){return transcribe(_0xc9d8ee[_0x4082('0x4f')]['id'],_0xdbc8b7[_0x4082('0x88')],_0xdbc8b7[_0x4082('0x8a')],_0xf5dfdc[_0x4082('0x80')],_0xf5dfdc[_0x4082('0x81')],_0x2a1006[_0x4082('0x50')],_0xf5dfdc[_0x4082('0x85')]);}else{logger[_0x4082('0x64')](util[_0x4082('0x32')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0xc9d8ee[_0x4082('0x4f')]['id']));return{'transcribeStatus':_0x4082('0x90')};}})[_0x4082('0x24')](function(_0x2716e0){if(_0x2716e0){_0x2716e0[_0x4082('0x91')]=_0xc9d8ee[_0x4082('0x4a')]['runSentiment'];return _0x2a1006[_0x4082('0x92')](_0x2716e0);}})[_0x4082('0x24')](respondWithResult(_0x2d70a3,null))['catch'](handleError(_0x2d70a3,null));};function writeFile(_0x4015e0,_0x2607f2){return new Promise(function(_0x8cc218,_0x16e924){fs[_0x4082('0x93')](_0x2607f2,_0x4015e0,function(_0x4d05c4,_0x2ac3a0){if(_0x4d05c4){return _0x16e924(_0x4d05c4);}else{return _0x8cc218(_0x2ac3a0);}});});}exports[_0x4082('0x94')]=function(_0x35b763,_0x366f14,_0x213c49){return db[_0x4082('0x2d')][_0x4082('0x7b')]({'where':{'id':_0x35b763[_0x4082('0x4f')]['id']}})[_0x4082('0x24')](handleEntityNotFound(_0x366f14))[_0x4082('0x24')](function(_0x5759aa){if(_0x5759aa&&_0x5759aa[_0x4082('0x95')]){var _0x4a15f3=_0x5759aa[_0x4082('0x95')];var _0x191e2f=config[_0x4082('0x96')]+_0x4082('0x97')+_0x5759aa['id']+'.txt';if(fs[_0x4082('0x52')](_0x191e2f)){return _0x191e2f;}return writeFile(_0x4a15f3,_0x191e2f)['then'](function(){return _0x191e2f;});}else{throw new db[(_0x4082('0x56'))][(_0x4082('0x57'))](_0x4082('0x98'));}})[_0x4082('0x24')](function(_0x171df6){return _0x366f14[_0x4082('0x4c')](_0x171df6);})[_0x4082('0x44')](handleError(_0x366f14));};
\ No newline at end of file
+var _0x1b83=['/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','VoiceRecording','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','download','../../components/encryptor','type','uniqueid','value','existsSync','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','extname','unlink','message','downloads','sequelize','MD5','token','$and','push','format','%s.cypher','decryptFile','filename','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','ValidationError','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','fileText','root'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1b83,0x1cb));var _0x31b8=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x1b83[_0x4cf98e];return _0x1623ac;};'use strict';var pdf=require(_0x31b8('0x0'));var emlformat=require(_0x31b8('0x1'));var rimraf=require(_0x31b8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x31b8('0x3'));var rp=require(_0x31b8('0x4'));var moment=require(_0x31b8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x31b8('0x6'));var util=require(_0x31b8('0x7'));var path=require('path');var sox=require(_0x31b8('0x8'));var csv=require('to-csv');var ejs=require(_0x31b8('0x9'));var fs=require('fs');var _=require(_0x31b8('0xa'));var squel=require(_0x31b8('0xb'));var crypto=require(_0x31b8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x31b8('0xd'));var toCsv=require(_0x31b8('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0x31b8('0xf'));var Redis=require(_0x31b8('0x10'));var authService=require(_0x31b8('0x11'));var qs=require(_0x31b8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x31b8('0x13'))('api');var utils=require(_0x31b8('0x14'));var config=require('../../config/environment');var db=require(_0x31b8('0x15'))['db'];function respondWithStatusCode(_0x355aab,_0x402960){_0x402960=_0x402960||0xcc;return function(_0x45b55b){if(_0x45b55b){return _0x355aab['sendStatus'](_0x402960);}return _0x355aab[_0x31b8('0x16')](_0x402960)[_0x31b8('0x17')]();};}function respondWithResult(_0x59f68d,_0x37e0ec){_0x37e0ec=_0x37e0ec||0xc8;return function(_0x5584b0){if(_0x5584b0){return _0x59f68d['status'](_0x37e0ec)['json'](_0x5584b0);}};}function respondWithFilteredResult(_0x3bebda,_0x3768d9){return function(_0x475fd1){if(_0x475fd1){var _0x203131=_0x475fd1[_0x31b8('0x18')],_0x4e9885=_0x3768d9['offset'],_0xff53ec=_0x3768d9[_0x31b8('0x19')]+_0x3768d9[_0x31b8('0x1a')],_0x39c533;if(_0xff53ec>=_0x203131){_0xff53ec=_0x203131;_0x39c533=0xc8;}else{_0x39c533=0xce;}_0x3bebda[_0x31b8('0x16')](_0x39c533);return _0x3bebda[_0x31b8('0x1b')](_0x31b8('0x1c'),_0x4e9885+'-'+_0xff53ec+'/'+_0x203131)[_0x31b8('0x1d')](_0x475fd1);}return null;};}function patchUpdates(_0x5812ef){return function(_0x1bef65){try{jsonpatch[_0x31b8('0x1e')](_0x1bef65,_0x5812ef,!![]);}catch(_0x3a5afc){return BPromise[_0x31b8('0x1f')](_0x3a5afc);}return _0x1bef65[_0x31b8('0x20')]();};}function saveUpdates(_0x19302e,_0x55cff0){return function(_0x2c0529){if(_0x2c0529){return _0x2c0529[_0x31b8('0x21')](_0x19302e)[_0x31b8('0x22')](function(_0x2e1002){return _0x2e1002;});}return null;};}function removeEntity(_0x776d4d,_0x29f998){return function(_0xa66caa){if(_0xa66caa){return _0xa66caa['destroy']()[_0x31b8('0x22')](function(){_0x776d4d[_0x31b8('0x16')](0xcc)[_0x31b8('0x17')]();});}};}function handleEntityNotFound(_0xb19b81,_0xe362){return function(_0x30879d){if(!_0x30879d){_0xb19b81[_0x31b8('0x23')](0x194);}return _0x30879d;};}function handleError(_0x382c16,_0x47105c){_0x47105c=_0x47105c||0x1f4;return function(_0x532d1c){logger[_0x31b8('0x24')](_0x532d1c[_0x31b8('0x25')]);if(_0x532d1c[_0x31b8('0x26')]){delete _0x532d1c[_0x31b8('0x26')];}_0x382c16[_0x31b8('0x16')](_0x47105c)[_0x31b8('0x27')](_0x532d1c);};}exports['index']=function(_0xc0be48,_0x44f77e){var _0x4e4761={},_0x5f3657={},_0x31879e={'count':0x0,'rows':[]};var _0x3b06e5=_[_0x31b8('0x28')](db['VoiceRecording'][_0x31b8('0x29')],function(_0x548944){return{'name':_0x548944[_0x31b8('0x2a')],'type':_0x548944['type'][_0x31b8('0x2b')]};});_0x5f3657[_0x31b8('0x2c')]=_[_0x31b8('0x2d')](_['map'](_0x3b06e5,'name'),['format']);_0x5f3657[_0x31b8('0x2e')]=_[_0x31b8('0x2f')](_0xc0be48['query']);_0x5f3657[_0x31b8('0x30')]=_[_0x31b8('0x31')](_0x5f3657[_0x31b8('0x2c')],_0x5f3657['query']);_0x4e4761[_0x31b8('0x32')]=_['intersection'](_0x5f3657[_0x31b8('0x2c')],qs[_0x31b8('0x33')](_0xc0be48[_0x31b8('0x2e')][_0x31b8('0x33')]));_0x4e4761[_0x31b8('0x32')]=_0x4e4761[_0x31b8('0x32')][_0x31b8('0x34')]?_0x4e4761[_0x31b8('0x32')]:_0x5f3657['model'];if(!_0xc0be48['query'][_0x31b8('0x35')](_0x31b8('0x36'))){_0x4e4761[_0x31b8('0x1a')]=qs[_0x31b8('0x1a')](_0xc0be48[_0x31b8('0x2e')][_0x31b8('0x1a')]);_0x4e4761[_0x31b8('0x19')]=qs[_0x31b8('0x19')](_0xc0be48[_0x31b8('0x2e')][_0x31b8('0x19')]);}_0x4e4761[_0x31b8('0x37')]=qs['sort'](_0xc0be48[_0x31b8('0x2e')]['sort']);_0x4e4761[_0x31b8('0x38')]=qs[_0x31b8('0x30')](_[_0x31b8('0x39')](_0xc0be48['query'],_0x5f3657[_0x31b8('0x30')]),_0x3b06e5);if(_0xc0be48[_0x31b8('0x2e')][_0x31b8('0x3a')]){_0x4e4761['where']=_[_0x31b8('0x3b')](_0x4e4761[_0x31b8('0x38')],{'$or':_[_0x31b8('0x28')](_0x3b06e5,function(_0x26f2ce){if(_0x26f2ce['type']!==_0x31b8('0x3c')){var _0x4bd2bd={};_0x4bd2bd[_0x26f2ce[_0x31b8('0x26')]]={'$like':'%'+_0xc0be48[_0x31b8('0x2e')][_0x31b8('0x3a')]+'%'};return _0x4bd2bd;}})});}_0x4e4761=_[_0x31b8('0x3b')]({},_0x4e4761,_0xc0be48['options']);var _0x12f0f5={'where':_0x4e4761[_0x31b8('0x38')]};return db[_0x31b8('0x3d')][_0x31b8('0x18')](_0x12f0f5)[_0x31b8('0x22')](function(_0x5049fd){_0x31879e['count']=_0x5049fd;if(_0xc0be48['query'][_0x31b8('0x3e')]){_0x4e4761[_0x31b8('0x3f')]=[{'all':!![]}];}return db[_0x31b8('0x3d')][_0x31b8('0x40')](_0x4e4761);})['then'](function(_0x4d5419){_0x31879e[_0x31b8('0x41')]=_0x4d5419;return _0x31879e;})['then'](respondWithFilteredResult(_0x44f77e,_0x4e4761))[_0x31b8('0x42')](handleError(_0x44f77e,null));};exports[_0x31b8('0x43')]=function(_0x8d8bf,_0x3676b6){var _0x57e851={'raw':![],'where':{'id':_0x8d8bf[_0x31b8('0x44')]['id']}},_0x2e9c27={};_0x2e9c27[_0x31b8('0x2c')]=_[_0x31b8('0x2f')](db[_0x31b8('0x3d')][_0x31b8('0x29')]);_0x2e9c27['query']=_[_0x31b8('0x2f')](_0x8d8bf[_0x31b8('0x2e')]);_0x2e9c27['filters']=_[_0x31b8('0x31')](_0x2e9c27['model'],_0x2e9c27['query']);_0x57e851[_0x31b8('0x32')]=_[_0x31b8('0x31')](_0x2e9c27[_0x31b8('0x2c')],qs[_0x31b8('0x33')](_0x8d8bf[_0x31b8('0x2e')][_0x31b8('0x33')]));_0x57e851['attributes']=_0x57e851[_0x31b8('0x32')][_0x31b8('0x34')]?_0x57e851['attributes']:_0x2e9c27[_0x31b8('0x2c')];if(_0x8d8bf[_0x31b8('0x2e')]['includeAll']){_0x57e851[_0x31b8('0x3f')]=[{'all':!![]}];}_0x57e851=_['merge']({},_0x57e851,_0x8d8bf['options']);return db[_0x31b8('0x3d')][_0x31b8('0x45')](_0x57e851)[_0x31b8('0x22')](handleEntityNotFound(_0x3676b6,null))['then'](respondWithResult(_0x3676b6,null))[_0x31b8('0x42')](handleError(_0x3676b6,null));};exports[_0x31b8('0x46')]=function(_0x17cc5e,_0x19b8a6){return db[_0x31b8('0x3d')][_0x31b8('0x46')](_0x17cc5e[_0x31b8('0x47')],{})[_0x31b8('0x22')](respondWithResult(_0x19b8a6,0xc9))[_0x31b8('0x42')](handleError(_0x19b8a6,null));};exports[_0x31b8('0x21')]=function(_0x27ba9c,_0xf652eb){if(_0x27ba9c['body']['id']){delete _0x27ba9c[_0x31b8('0x47')]['id'];}return db[_0x31b8('0x3d')][_0x31b8('0x45')]({'where':{'id':_0x27ba9c['params']['id']}})[_0x31b8('0x22')](handleEntityNotFound(_0xf652eb,null))[_0x31b8('0x22')](saveUpdates(_0x27ba9c[_0x31b8('0x47')],null))[_0x31b8('0x22')](respondWithResult(_0xf652eb,null))['catch'](handleError(_0xf652eb,null));};exports[_0x31b8('0x48')]=function(_0x41abef,_0x2c38f2){return db[_0x31b8('0x3d')][_0x31b8('0x48')]()[_0x31b8('0x22')](respondWithResult(_0x2c38f2,null))[_0x31b8('0x42')](handleError(_0x2c38f2,null));};exports[_0x31b8('0x49')]=function(_0x5966ba,_0x10d10c,_0x4003c5){var _0x489465=require(_0x31b8('0x4a'));var _0x419417=![];var _0x4456cf={};if(_0x5966ba[_0x31b8('0x2e')]['type']&&_0x5966ba['query'][_0x31b8('0x4b')]===_0x31b8('0x4c')){_0x4456cf[_0x31b8('0x4c')]=_0x5966ba['params']['id'];}else{_0x4456cf['id']=_0x5966ba[_0x31b8('0x44')]['id'];}return db[_0x31b8('0x3d')][_0x31b8('0x45')]({'where':_0x4456cf,'attributes':['id',_0x31b8('0x4d')],'raw':!![]})[_0x31b8('0x22')](handleEntityNotFound(_0x10d10c,null))[_0x31b8('0x22')](function(_0x1577ea){if(_0x1577ea){var _0x5c2090=_0x1577ea[_0x31b8('0x4d')];var _0x353eaf=util['format']('%s.cypher',_0x5c2090);if(fs[_0x31b8('0x4e')](_0x353eaf)){_0x419417=!![];return _0x489465['decryptFile'](_0x353eaf,_0x5c2090,config[_0x31b8('0x4f')][_0x31b8('0x50')])[_0x31b8('0x22')](function(){return _0x1577ea;});}return _0x1577ea;}})[_0x31b8('0x22')](function(_0x211664){if(_0x211664){var _0x115ef9=_0x211664[_0x31b8('0x4d')];if(!fs[_0x31b8('0x4e')](_0x115ef9)){throw new db[(_0x31b8('0x51'))]['ValidationError'](_0x31b8('0x52'));}if(_0x211664['filename']){return _0x10d10c['download'](_0x115ef9,_0x211664['filename']+path[_0x31b8('0x53')](_0x115ef9),function(){if(_0x419417){fs[_0x31b8('0x54')](_0x115ef9);}});}else{return _0x10d10c[_0x31b8('0x49')](_0x115ef9,function(_0x365cca){if(_0x419417){fs[_0x31b8('0x54')](_0x115ef9);}});}}})[_0x31b8('0x42')](function(_0x5c8306){if(_0x5c8306[_0x31b8('0x55')]===_0x31b8('0x52')){_0x10d10c[_0x31b8('0x16')](0x194)[_0x31b8('0x27')]('Not\x20found');}else{return handleError(_0x10d10c,null);}});};exports[_0x31b8('0x56')]=function(_0x21f492,_0x3b267d,_0x4c60ec){var _0x7c6777=require(_0x31b8('0x4a'));var _0x411e5f=![];var _0x4e3ce2={'$and':[db['sequelize'][_0x31b8('0x38')](db[_0x31b8('0x57')]['fn'](_0x31b8('0x58'),db[_0x31b8('0x57')]['col']('uniqueid')),_0x21f492[_0x31b8('0x2e')][_0x31b8('0x59')])]};if(_0x21f492[_0x31b8('0x2e')][_0x31b8('0x4b')]&&_0x21f492[_0x31b8('0x2e')][_0x31b8('0x4b')]==='uniqueid'){_0x4e3ce2[_0x31b8('0x5a')][_0x31b8('0x5b')]({'uniqueid':_0x21f492['params']['id']});}else{_0x4e3ce2[_0x31b8('0x5a')][_0x31b8('0x5b')]({'id':_0x21f492[_0x31b8('0x44')]['id']});}return db[_0x31b8('0x3d')][_0x31b8('0x45')]({'where':_0x4e3ce2,'attributes':['id',_0x31b8('0x4d')],'raw':!![]})[_0x31b8('0x22')](handleEntityNotFound(_0x3b267d,null))[_0x31b8('0x22')](function(_0x4e87e1){if(_0x4e87e1){var _0x296944=util[_0x31b8('0x5c')](_0x31b8('0x5d'),_0x4e87e1[_0x31b8('0x4d')]);if(fs[_0x31b8('0x4e')](_0x296944)){_0x411e5f=!![];return _0x7c6777[_0x31b8('0x5e')](_0x296944,_0x4e87e1[_0x31b8('0x4d')],config[_0x31b8('0x4f')][_0x31b8('0x50')])[_0x31b8('0x22')](function(){return _0x4e87e1;});}return _0x4e87e1;}})[_0x31b8('0x22')](function(_0x348e06){if(_0x348e06){if(!fs['existsSync'](_0x348e06[_0x31b8('0x4d')])){throw new db[(_0x31b8('0x51'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x348e06[_0x31b8('0x5f')]){return _0x3b267d[_0x31b8('0x49')](_0x348e06['value'],_0x348e06['filename']+path[_0x31b8('0x53')](_0x348e06[_0x31b8('0x4d')]),function(){if(_0x411e5f){fs[_0x31b8('0x54')](_0x348e06[_0x31b8('0x4d')]);}});}else{return _0x3b267d[_0x31b8('0x49')](_0x348e06[_0x31b8('0x4d')],function(_0x357d7a){if(_0x411e5f){fs[_0x31b8('0x54')](_0x348e06['value']);}});}}})[_0x31b8('0x42')](handleError(_0x3b267d,null));};exports[_0x31b8('0x60')]=function(_0x336cc5,_0x2bb138){return db[_0x31b8('0x3d')]['find']({'where':{'id':_0x336cc5[_0x31b8('0x44')]['id']}})[_0x31b8('0x22')](function(_0x57125c){if(!_0x57125c)throw new ReferenceError(_0x31b8('0x61'));return _0x57125c;})['then'](function(_0x5bf5ab){var _0x34dd3d=_0x5bf5ab[_0x31b8('0x4d')];logger[_0x31b8('0x62')](_0x31b8('0x63'),_0x34dd3d);if(!_[_0x31b8('0x64')](_0x5bf5ab['value'])&&fs['existsSync'](_0x34dd3d)){logger[_0x31b8('0x62')](_0x31b8('0x65')+_0x34dd3d+_0x31b8('0x66'));fs[_0x31b8('0x67')](_0x34dd3d);}_0x34dd3d=_0x34dd3d+_0x31b8('0x68');if(!_['isNil'](_0x5bf5ab[_0x31b8('0x4d')])&&fs['existsSync'](_0x34dd3d)){logger[_0x31b8('0x62')](_0x31b8('0x65')+_0x34dd3d+_0x31b8('0x66'));fs[_0x31b8('0x67')](_0x34dd3d);}return _0x5bf5ab;})['then'](function(_0x24d9f5){if(!_0x24d9f5)throw new InternalError();return _0x24d9f5[_0x31b8('0x60')]();})[_0x31b8('0x22')](function(){_0x2bb138[_0x31b8('0x16')](0xcc)[_0x31b8('0x17')]();})[_0x31b8('0x42')](handleError(_0x2bb138,null));};function getBucketslist(_0x43ebaa,_0x3c258c,_0x41455b){return new Promise(function(_0x1d13c1,_0x5cdf0f){var _0x540fa6=new AWS['S3']({'accessKeyId':_0x3c258c,'secretAccessKey':_0x43ebaa,'region':_0x41455b});_0x540fa6[_0x31b8('0x69')]({},function(_0x15f932,_0x45cde7){if(_0x15f932){return _0x5cdf0f(_0x15f932);}else{return _0x1d13c1(_0x45cde7);}});});}function createBucket(_0x2e0b44,_0x1bcb61,_0x419ffc,_0x4efc4f){return new Promise(function(_0x378ccf,_0x3db6ee){var _0x3a7865=new AWS['S3']({'accessKeyId':_0x1bcb61,'secretAccessKey':_0x2e0b44,'region':_0x419ffc});_0x3a7865[_0x31b8('0x6a')]({'Bucket':_0x4efc4f},function(_0x396c52,_0x7a7942){if(_0x396c52){return _0x3db6ee(_0x396c52);}else{return _0x378ccf(_0x7a7942);}});});}function uploadFile(_0x3f2486,_0x5606f4,_0x21f7cf,_0x5f15a7,_0x286e33,_0x1f7130){return new Promise(function(_0x23d519,_0x5d9cd4){var _0x4d5892=new AWS['S3']({'accessKeyId':_0x5606f4,'secretAccessKey':_0x3f2486,'region':_0x21f7cf});_0x4d5892['upload']({'Bucket':_0x5f15a7,'Key':_0x286e33,'Body':_0x1f7130},function(_0x27c67e,_0x4b3437){if(_0x27c67e){return _0x5d9cd4(_0x27c67e);}else{return _0x23d519(_0x4b3437);}});});}function startTranscribe(_0x3eb2ff,_0x9dd0d,_0x2245ec,_0x44240b,_0x2d9390,_0x331557){return new Promise(function(_0x31f928,_0x533df2){var _0x127f24=new AWS['TranscribeService']({'accessKeyId':_0x9dd0d,'secretAccessKey':_0x3eb2ff,'region':_0x2245ec});_0x127f24[_0x31b8('0x6b')]({'TranscriptionJobName':_0x44240b,'LanguageCode':_0x2d9390,'Media':{'MediaFileUri':_0x331557}},function(_0x438b2a,_0x496f81){if(_0x438b2a){return _0x533df2(_0x438b2a);}else{return _0x31f928(_0x496f81);}});});}function transcribe(_0x183fd3,_0x46d0bd,_0x2557f4,_0x423bd,_0x5bf2be,_0x45c362,_0x402d15){return new Promise(function(_0x48f457,_0x420d23){var _0x83b37a={};logger['info'](util[_0x31b8('0x5c')](_0x31b8('0x6c'),_0x183fd3,_0x5bf2be));return uploadFile(_0x46d0bd,_0x2557f4,_0x423bd,_0x5bf2be,path[_0x31b8('0x6d')](_0x45c362),fs[_0x31b8('0x6e')](_0x45c362))['then'](function(_0x56c4bd){logger[_0x31b8('0x62')](util[_0x31b8('0x5c')](_0x31b8('0x6f'),_0x183fd3,_0x5bf2be,_0x56c4bd[_0x31b8('0x70')]));_0x83b37a[_0x31b8('0x71')]=_0x56c4bd[_0x31b8('0x72')];_0x83b37a['location']=_0x56c4bd[_0x31b8('0x70')];logger[_0x31b8('0x62')](util[_0x31b8('0x5c')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x183fd3));return startTranscribe(_0x46d0bd,_0x2557f4,_0x423bd,uuidv4(),_0x402d15,_0x56c4bd['Location']);})[_0x31b8('0x22')](function(_0xd09871){logger[_0x31b8('0x62')](util['format'](_0x31b8('0x73'),_0x183fd3,_0xd09871[_0x31b8('0x74')][_0x31b8('0x75')]));_0x83b37a[_0x31b8('0x76')]=_0xd09871['TranscriptionJob']['TranscriptionJobName'];_0x83b37a[_0x31b8('0x77')]=_0xd09871['TranscriptionJob'][_0x31b8('0x78')];return _0x48f457(_0x83b37a);})[_0x31b8('0x42')](function(_0x344f68){return _0x420d23(_0x344f68);});});}exports[_0x31b8('0x79')]=function(_0xe2532b,_0x238132,_0x2d77b5){var _0xafd005;var _0x1f6b57;var _0x4edd6b;var _0x261dc0=require('../../components/encryptor');return db[_0x31b8('0x3d')][_0x31b8('0x7a')]({'where':{'id':_0xe2532b[_0x31b8('0x44')]['id']}})[_0x31b8('0x22')](function(_0x6c0d1a){if(_0x6c0d1a){var _0x339ef2=util['format'](_0x31b8('0x5d'),_0x6c0d1a[_0x31b8('0x4d')]);if(fs[_0x31b8('0x4e')](_0x339ef2)){cypher=!![];return _0x261dc0[_0x31b8('0x5e')](_0x339ef2,_0x6c0d1a[_0x31b8('0x4d')],config['secrets'][_0x31b8('0x50')])[_0x31b8('0x22')](function(){return _0x6c0d1a;});}return _0x6c0d1a;}})[_0x31b8('0x22')](function(_0x5cb61){if(!_0x5cb61){throw new db[(_0x31b8('0x51'))][(_0x31b8('0x7b'))](_0x31b8('0x7c'));}_0x1f6b57=_0x5cb61;return db['Setting'][_0x31b8('0x7a')]({'where':{'id':0x1}});})[_0x31b8('0x22')](handleEntityNotFound(_0x238132,null))[_0x31b8('0x22')](function(_0x2905b7){if(_0x2905b7){_0xafd005=_0x2905b7;if(!_0xafd005[_0x31b8('0x7d')]||!_0xafd005[_0x31b8('0x7e')]||!_0xafd005['transcribeRegion']||!_0xafd005[_0x31b8('0x7f')]||!_0xafd005[_0x31b8('0x71')]){throw new db[(_0x31b8('0x51'))]['ValidationError'](_0x31b8('0x80'));}if(_0xe2532b[_0x31b8('0x47')][_0x31b8('0x81')]&&(!_0xafd005[_0x31b8('0x82')]||!_0xafd005[_0x31b8('0x83')]||!_0xafd005[_0x31b8('0x84')]||!_0xafd005[_0x31b8('0x7f')]||!_0xafd005[_0x31b8('0x71')])){throw new db[(_0x31b8('0x51'))][(_0x31b8('0x7b'))](_0x31b8('0x85'));}return db[_0x31b8('0x86')]['findOne']({'where':{'id':_0xafd005[_0x31b8('0x7e')]}});}})['then'](function(_0xb7c57e){if(!_0xb7c57e){throw new db[(_0x31b8('0x51'))]['ValidationError'](_0x31b8('0x87'));}if(!_0xb7c57e[_0x31b8('0x88')]||!_0xb7c57e[_0x31b8('0x89')]){throw new db[(_0x31b8('0x51'))][(_0x31b8('0x7b'))](_0x31b8('0x8a'));}_0x4edd6b=_0xb7c57e;return getBucketslist(_0x4edd6b['data1'],_0x4edd6b['data2'],_0xafd005['transcribeRegion']);})[_0x31b8('0x22')](function(_0x3e16a3){if(_0x3e16a3&&_0x3e16a3[_0x31b8('0x8b')]){var _0x3a52c2=_[_0x31b8('0x45')](_0x3e16a3[_0x31b8('0x8b')],function(_0x240b6d){return _0x240b6d[_0x31b8('0x8c')]===_0xafd005[_0x31b8('0x71')];});if(!_0x3a52c2){logger[_0x31b8('0x62')](util[_0x31b8('0x5c')](_0x31b8('0x8d'),_0xe2532b[_0x31b8('0x44')]['id'],_0xafd005[_0x31b8('0x71')]));return createBucket(_0x4edd6b[_0x31b8('0x88')],_0x4edd6b[_0x31b8('0x89')],_0xafd005[_0x31b8('0x8e')],_0xafd005[_0x31b8('0x71')]);}logger['info'](util[_0x31b8('0x5c')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xe2532b[_0x31b8('0x44')]['id'],_0xafd005[_0x31b8('0x71')]));return;}})[_0x31b8('0x22')](function(_0x5ef55e){if(_0x1f6b57[_0x31b8('0x77')]===_0x31b8('0x8f')){return transcribe(_0xe2532b['params']['id'],_0x4edd6b[_0x31b8('0x88')],_0x4edd6b['data2'],_0xafd005[_0x31b8('0x8e')],_0xafd005[_0x31b8('0x71')],_0x1f6b57[_0x31b8('0x4d')],_0xafd005[_0x31b8('0x7f')]);}else{logger[_0x31b8('0x62')](util['format'](_0x31b8('0x90'),_0xe2532b[_0x31b8('0x44')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x31b8('0x22')](function(_0x5d775e){if(_0x5d775e){_0x5d775e[_0x31b8('0x91')]=_0xe2532b[_0x31b8('0x47')][_0x31b8('0x81')];return _0x1f6b57[_0x31b8('0x92')](_0x5d775e);}})[_0x31b8('0x22')](respondWithResult(_0x238132,null))[_0x31b8('0x42')](handleError(_0x238132,null));};function writeFile(_0x59081,_0x5d5486){return new Promise(function(_0x335da0,_0x280295){fs['writeFile'](_0x5d5486,_0x59081,function(_0x34370c,_0x202568){if(_0x34370c){return _0x280295(_0x34370c);}else{return _0x335da0(_0x202568);}});});}exports['downloadTranscribe']=function(_0x43db2f,_0x261403,_0x23071e){return db[_0x31b8('0x3d')][_0x31b8('0x7a')]({'where':{'id':_0x43db2f[_0x31b8('0x44')]['id']}})[_0x31b8('0x22')](handleEntityNotFound(_0x261403))[_0x31b8('0x22')](function(_0x40e652){if(_0x40e652&&_0x40e652[_0x31b8('0x93')]){var _0x249756=_0x40e652[_0x31b8('0x93')];var _0x23e4e2=config[_0x31b8('0x94')]+_0x31b8('0x95')+_0x40e652['id']+_0x31b8('0x96');if(fs[_0x31b8('0x4e')](_0x23e4e2)){return _0x23e4e2;}return writeFile(_0x249756,_0x23e4e2)[_0x31b8('0x22')](function(){return _0x23e4e2;});}else{throw new db[(_0x31b8('0x51'))][(_0x31b8('0x7b'))](_0x31b8('0x97'));}})['then'](function(_0x1d7559){return _0x261403[_0x31b8('0x49')](_0x1d7559);})[_0x31b8('0x42')](handleError(_0x261403));};
\ No newline at end of file
index 898a546..90a847f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf03a=['request-promise','path','../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','util','../../config/logger','api','moment'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0xf03a,0x1a0));var _0xaf03=function(_0x1103c2,_0x49de54){_0x1103c2=_0x1103c2-0x0;var _0x2446bb=_0xf03a[_0x1103c2];return _0x2446bb;};'use strict';var _=require('lodash');var util=require(_0xaf03('0x0'));var logger=require(_0xaf03('0x1'))(_0xaf03('0x2'));var moment=require(_0xaf03('0x3'));var BPromise=require('bluebird');var rp=require(_0xaf03('0x4'));var fs=require('fs');var path=require(_0xaf03('0x5'));var rimraf=require('rimraf');var config=require(_0xaf03('0x6'));var attributes=require(_0xaf03('0x7'));module[_0xaf03('0x8')]=function(_0x2e05f7,_0x58a29b){return _0x2e05f7[_0xaf03('0x9')]('VoiceRecording',attributes,{'tableName':_0xaf03('0xa'),'paranoid':![],'indexes':[{'name':_0xaf03('0xb'),'fields':[_0xaf03('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8fb=['exports','VoiceRecording','uniqueid','lodash','util','../../config/logger','api','path','rimraf','./voiceRecording.attributes'];(function(_0x7c6154,_0x820b95){var _0x16a6b3=function(_0x2f3651){while(--_0x2f3651){_0x7c6154['push'](_0x7c6154['shift']());}};_0x16a6b3(++_0x820b95);}(_0xd8fb,0x99));var _0xbd8f=function(_0x2e449f,_0x2eb0a0){_0x2e449f=_0x2e449f-0x0;var _0x3ddbb2=_0xd8fb[_0x2e449f];return _0x3ddbb2;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));module[_0xbd8f('0x7')]=function(_0x5543b2,_0x33d541){return _0x5543b2['define'](_0xbd8f('0x8'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xbd8f('0x9'),'fields':[_0xbd8f('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 675e604..1259cdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x46723d,_0x3d6bd5){var _0x5e2b3a=function(_0x1a3c33){while(--_0x1a3c33){_0x46723d['push'](_0x46723d['shift']());}};_0x5e2b3a(++_0x3d6bd5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x2e4a84,_0x3de6e1){var _0x16ffe8=function(_0x43382f){while(--_0x43382f){_0x2e4a84['push'](_0x2e4a84['shift']());}};_0x16ffe8(++_0x3de6e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});};
\ No newline at end of file
index 9df829d..671623b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x244932,_0x457590){var _0x570100=function(_0x2272cc){while(--_0x2272cc){_0x244932['push'](_0x244932['shift']());}};_0x570100(++_0x457590);}(_0x46ed,0x168));var _0xd46e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46ed[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd46e('0x5'));var config=require(_0xd46e('0x6'));var controller=require('./voiceTransferReport.controller');router[_0xd46e('0x7')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0x9')]);router[_0xd46e('0x7')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')]('/:id',auth[_0xd46e('0x8')](),controller[_0xd46e('0xf')]);router['delete'](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0x10')]);module[_0xd46e('0x11')]=router;
\ No newline at end of file
+var _0x038b=['update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put'];(function(_0x4f1e52,_0x3f2100){var _0x213a54=function(_0x91aaf2){while(--_0x91aaf2){_0x4f1e52['push'](_0x4f1e52['shift']());}};_0x213a54(++_0x3f2100);}(_0x038b,0x114));var _0xb038=function(_0x4d5f5a,_0x121ef8){_0x4d5f5a=_0x4d5f5a-0x0;var _0x4adbab=_0x038b[_0x4d5f5a];return _0x4adbab;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb038('0x4'));var config=require(_0xb038('0x5'));var controller=require('./voiceTransferReport.controller');router[_0xb038('0x6')]('/',auth[_0xb038('0x7')](),controller['index']);router['get'](_0xb038('0x8'),auth[_0xb038('0x7')](),controller[_0xb038('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb038('0xa')]);router[_0xb038('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0xc')]);router[_0xb038('0xd')]('/:id',auth[_0xb038('0x7')](),controller[_0xb038('0xe')]);module[_0xb038('0xf')]=router;
\ No newline at end of file
index 7efbaa6..6a22c60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dab=['STRING','Yes','sequelize','moment','exports','ENUM','blind'];(function(_0x1c1e15,_0x566245){var _0x3b8679=function(_0x3437f1){while(--_0x3437f1){_0x1c1e15['push'](_0x1c1e15['shift']());}};_0x3b8679(++_0x566245);}(_0x3dab,0xd4));var _0xb3da=function(_0x11943f,_0x2b4caf){_0x11943f=_0x11943f-0x0;var _0x2a3d5c=_0x3dab[_0x11943f];return _0x2a3d5c;};'use strict';var Sequelize=require(_0xb3da('0x0'));var moment=require(_0xb3da('0x1'));module[_0xb3da('0x2')]={'type':{'type':Sequelize[_0xb3da('0x3')](_0xb3da('0x4'),'attended')},'result':{'type':Sequelize[_0xb3da('0x5')]},'transfererchannel':{'type':Sequelize[_0xb3da('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xb3da('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xb3da('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xb3da('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xb3da('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xb3da('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xb3da('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xb3da('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xb3da('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xb3da('0x5')]},'transfereecontext':{'type':Sequelize[_0xb3da('0x5')]},'transfereeexten':{'type':Sequelize[_0xb3da('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xb3da('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0xb3da('0x6'),'No')},'context':{'type':Sequelize[_0xb3da('0x5')]},'extension':{'type':Sequelize[_0xb3da('0x5')]}};
\ No newline at end of file
+var _0xe1b7=['ENUM','blind','STRING','Yes','sequelize','moment','exports'];(function(_0x4511a6,_0xc66ccb){var _0x445a13=function(_0x2e8859){while(--_0x2e8859){_0x4511a6['push'](_0x4511a6['shift']());}};_0x445a13(++_0xc66ccb);}(_0xe1b7,0x146));var _0x7e1b=function(_0xbf946a,_0x2a48f2){_0xbf946a=_0xbf946a-0x0;var _0x4d18ec=_0xe1b7[_0xbf946a];return _0x4d18ec;};'use strict';var Sequelize=require(_0x7e1b('0x0'));var moment=require(_0x7e1b('0x1'));module[_0x7e1b('0x2')]={'type':{'type':Sequelize[_0x7e1b('0x3')](_0x7e1b('0x4'),'attended')},'result':{'type':Sequelize[_0x7e1b('0x5')]},'transfererchannel':{'type':Sequelize[_0x7e1b('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x7e1b('0x5')]},'transferercalleridname':{'type':Sequelize[_0x7e1b('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x7e1b('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x7e1b('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x7e1b('0x5')]},'transferercontext':{'type':Sequelize[_0x7e1b('0x5')]},'transfererexten':{'type':Sequelize[_0x7e1b('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x7e1b('0x5')]},'transfereechannel':{'type':Sequelize[_0x7e1b('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x7e1b('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x7e1b('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x7e1b('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x7e1b('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0x7e1b('0x6'),'No')},'context':{'type':Sequelize[_0x7e1b('0x5')]},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f32a77e..9c6db9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1764=['map','VoiceTransferReport','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','rawAttributes','intersection','includeAll','find','create','catch','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','json','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x1764,0x18e));var _0x4176=function(_0x359633,_0x4ec8fb){_0x359633=_0x359633-0x0;var _0x6dc7d6=_0x1764[_0x359633];return _0x6dc7d6;};'use strict';var pdf=require(_0x4176('0x0'));var emlformat=require(_0x4176('0x1'));var rimraf=require(_0x4176('0x2'));var zipdir=require(_0x4176('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4176('0x4'));var moment=require(_0x4176('0x5'));var BPromise=require(_0x4176('0x6'));var Mustache=require(_0x4176('0x7'));var util=require(_0x4176('0x8'));var path=require('path');var sox=require(_0x4176('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4176('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4176('0xb'));var toCsv=require(_0x4176('0xc'));var querystring=require('querystring');var Papa=require(_0x4176('0xd'));var Redis=require(_0x4176('0xe'));var authService=require(_0x4176('0xf'));var qs=require(_0x4176('0x10'));var as=require(_0x4176('0x11'));var hardwareService=require(_0x4176('0x12'));var logger=require(_0x4176('0x13'))('api');var utils=require(_0x4176('0x14'));var config=require(_0x4176('0x15'));var db=require(_0x4176('0x16'))['db'];function respondWithStatusCode(_0x14b66e,_0x3b28ed){_0x3b28ed=_0x3b28ed||0xcc;return function(_0x36c5a2){if(_0x36c5a2){return _0x14b66e['sendStatus'](_0x3b28ed);}return _0x14b66e[_0x4176('0x17')](_0x3b28ed)['end']();};}function respondWithResult(_0x39e70f,_0x511836){_0x511836=_0x511836||0xc8;return function(_0x379b50){if(_0x379b50){return _0x39e70f[_0x4176('0x17')](_0x511836)['json'](_0x379b50);}};}function respondWithFilteredResult(_0x27792b,_0x56a8b8){return function(_0x217803){if(_0x217803){var _0x592887=_0x217803[_0x4176('0x18')],_0x48511c=_0x56a8b8[_0x4176('0x19')],_0x33f1b4=_0x56a8b8[_0x4176('0x19')]+_0x56a8b8[_0x4176('0x1a')],_0x4b6bc6;if(_0x33f1b4>=_0x592887){_0x33f1b4=_0x592887;_0x4b6bc6=0xc8;}else{_0x4b6bc6=0xce;}_0x27792b[_0x4176('0x17')](_0x4b6bc6);return _0x27792b[_0x4176('0x1b')]('Content-Range',_0x48511c+'-'+_0x33f1b4+'/'+_0x592887)[_0x4176('0x1c')](_0x217803);}return null;};}function patchUpdates(_0x35e330){return function(_0x3d2b1a){try{jsonpatch[_0x4176('0x1d')](_0x3d2b1a,_0x35e330,!![]);}catch(_0x44a022){return BPromise[_0x4176('0x1e')](_0x44a022);}return _0x3d2b1a[_0x4176('0x1f')]();};}function saveUpdates(_0x337be4,_0x47b2c1){return function(_0x2bda61){if(_0x2bda61){return _0x2bda61[_0x4176('0x20')](_0x337be4)['then'](function(_0x1105a3){return _0x1105a3;});}return null;};}function removeEntity(_0x39e985,_0x503dba){return function(_0x3b7c74){if(_0x3b7c74){return _0x3b7c74[_0x4176('0x21')]()[_0x4176('0x22')](function(){_0x39e985['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1889b3,_0x5e2b94){return function(_0x1e809e){if(!_0x1e809e){_0x1889b3[_0x4176('0x23')](0x194);}return _0x1e809e;};}function handleError(_0x3bbbb3,_0x45d743){_0x45d743=_0x45d743||0x1f4;return function(_0x543b53){logger[_0x4176('0x24')](_0x543b53['stack']);if(_0x543b53[_0x4176('0x25')]){delete _0x543b53[_0x4176('0x25')];}_0x3bbbb3[_0x4176('0x17')](_0x45d743)[_0x4176('0x26')](_0x543b53);};}exports[_0x4176('0x27')]=function(_0x3082ed,_0x46e1a1){var _0x4a4247={},_0x395038={},_0x598472={'count':0x0,'rows':[]};var _0x25f747=_[_0x4176('0x28')](db[_0x4176('0x29')]['rawAttributes'],function(_0x280a88){return{'name':_0x280a88[_0x4176('0x2a')],'type':_0x280a88[_0x4176('0x2b')][_0x4176('0x2c')]};});_0x395038[_0x4176('0x2d')]=_[_0x4176('0x28')](_0x25f747,'name');_0x395038[_0x4176('0x2e')]=_[_0x4176('0x2f')](_0x3082ed[_0x4176('0x2e')]);_0x395038[_0x4176('0x30')]=_['intersection'](_0x395038[_0x4176('0x2d')],_0x395038[_0x4176('0x2e')]);_0x4a4247[_0x4176('0x31')]=_['intersection'](_0x395038[_0x4176('0x2d')],qs[_0x4176('0x32')](_0x3082ed[_0x4176('0x2e')]['fields']));_0x4a4247[_0x4176('0x31')]=_0x4a4247[_0x4176('0x31')][_0x4176('0x33')]?_0x4a4247[_0x4176('0x31')]:_0x395038[_0x4176('0x2d')];if(!_0x3082ed[_0x4176('0x2e')][_0x4176('0x34')](_0x4176('0x35'))){_0x4a4247[_0x4176('0x1a')]=qs[_0x4176('0x1a')](_0x3082ed['query']['limit']);_0x4a4247[_0x4176('0x19')]=qs['offset'](_0x3082ed[_0x4176('0x2e')]['offset']);}_0x4a4247[_0x4176('0x36')]=qs[_0x4176('0x37')](_0x3082ed[_0x4176('0x2e')]['sort']);_0x4a4247[_0x4176('0x38')]=qs['filters'](_[_0x4176('0x39')](_0x3082ed[_0x4176('0x2e')],_0x395038['filters']),_0x25f747);if(_0x3082ed['query'][_0x4176('0x3a')]){_0x4a4247[_0x4176('0x38')]=_[_0x4176('0x3b')](_0x4a4247[_0x4176('0x38')],{'$or':_[_0x4176('0x28')](_0x25f747,function(_0xcb4bec){if(_0xcb4bec['type']!==_0x4176('0x3c')){var _0x480be3={};_0x480be3[_0xcb4bec[_0x4176('0x25')]]={'$like':'%'+_0x3082ed['query'][_0x4176('0x3a')]+'%'};return _0x480be3;}})});}_0x4a4247=_[_0x4176('0x3b')]({},_0x4a4247,_0x3082ed[_0x4176('0x3d')]);var _0xbb28a5={'where':_0x4a4247['where']};return db['VoiceTransferReport'][_0x4176('0x18')](_0xbb28a5)[_0x4176('0x22')](function(_0x3b0110){_0x598472[_0x4176('0x18')]=_0x3b0110;if(_0x3082ed[_0x4176('0x2e')]['includeAll']){_0x4a4247[_0x4176('0x3e')]=[{'all':!![]}];}return db[_0x4176('0x29')][_0x4176('0x3f')](_0x4a4247);})[_0x4176('0x22')](function(_0x16d896){_0x598472['rows']=_0x16d896;return _0x598472;})['then'](respondWithFilteredResult(_0x46e1a1,_0x4a4247))['catch'](handleError(_0x46e1a1,null));};exports[_0x4176('0x40')]=function(_0x34a9f1,_0xeb1bee){var _0x2af8ba={'raw':!![],'where':{'id':_0x34a9f1[_0x4176('0x41')]['id']}},_0x165064={};_0x165064[_0x4176('0x2d')]=_[_0x4176('0x2f')](db[_0x4176('0x29')][_0x4176('0x42')]);_0x165064[_0x4176('0x2e')]=_['keys'](_0x34a9f1['query']);_0x165064[_0x4176('0x30')]=_[_0x4176('0x43')](_0x165064[_0x4176('0x2d')],_0x165064['query']);_0x2af8ba[_0x4176('0x31')]=_[_0x4176('0x43')](_0x165064[_0x4176('0x2d')],qs['fields'](_0x34a9f1[_0x4176('0x2e')][_0x4176('0x32')]));_0x2af8ba[_0x4176('0x31')]=_0x2af8ba[_0x4176('0x31')]['length']?_0x2af8ba[_0x4176('0x31')]:_0x165064['model'];if(_0x34a9f1[_0x4176('0x2e')][_0x4176('0x44')]){_0x2af8ba[_0x4176('0x3e')]=[{'all':!![]}];}_0x2af8ba=_[_0x4176('0x3b')]({},_0x2af8ba,_0x34a9f1[_0x4176('0x3d')]);return db[_0x4176('0x29')][_0x4176('0x45')](_0x2af8ba)['then'](handleEntityNotFound(_0xeb1bee,null))[_0x4176('0x22')](respondWithResult(_0xeb1bee,null))['catch'](handleError(_0xeb1bee,null));};exports['create']=function(_0xafff96,_0x364e7f){return db[_0x4176('0x29')][_0x4176('0x46')](_0xafff96['body'],{})[_0x4176('0x22')](respondWithResult(_0x364e7f,0xc9))[_0x4176('0x47')](handleError(_0x364e7f,null));};exports[_0x4176('0x20')]=function(_0x167a43,_0x5edca5){if(_0x167a43[_0x4176('0x48')]['id']){delete _0x167a43[_0x4176('0x48')]['id'];}return db[_0x4176('0x29')][_0x4176('0x45')]({'where':{'id':_0x167a43['params']['id']}})[_0x4176('0x22')](handleEntityNotFound(_0x5edca5,null))[_0x4176('0x22')](saveUpdates(_0x167a43[_0x4176('0x48')],null))[_0x4176('0x22')](respondWithResult(_0x5edca5,null))[_0x4176('0x47')](handleError(_0x5edca5,null));};exports[_0x4176('0x21')]=function(_0xf81c0b,_0x4f6133){return db[_0x4176('0x29')]['find']({'where':{'id':_0xf81c0b[_0x4176('0x41')]['id']}})[_0x4176('0x22')](handleEntityNotFound(_0x4f6133,null))[_0x4176('0x22')](removeEntity(_0x4f6133,null))[_0x4176('0x47')](handleError(_0x4f6133,null));};
\ No newline at end of file
+var _0xa8c1=['../../mysqldb','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','stack','name','index','VoiceTransferReport','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','filters','length','include','find','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x27866b,_0xeebabe){var _0x52960b=function(_0x43dfd5){while(--_0x43dfd5){_0x27866b['push'](_0x27866b['shift']());}};_0x52960b(++_0xeebabe);}(_0xa8c1,0x1d4));var _0x1a8c=function(_0xa3c06b,_0x490f99){_0xa3c06b=_0xa3c06b-0x0;var _0x33aa1d=_0xa8c1[_0xa3c06b];return _0x33aa1d;};'use strict';var pdf=require(_0x1a8c('0x0'));var emlformat=require(_0x1a8c('0x1'));var rimraf=require(_0x1a8c('0x2'));var zipdir=require(_0x1a8c('0x3'));var jsonpatch=require(_0x1a8c('0x4'));var rp=require(_0x1a8c('0x5'));var moment=require(_0x1a8c('0x6'));var BPromise=require(_0x1a8c('0x7'));var Mustache=require(_0x1a8c('0x8'));var util=require(_0x1a8c('0x9'));var path=require(_0x1a8c('0xa'));var sox=require(_0x1a8c('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1a8c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1a8c('0xd'));var toCsv=require(_0x1a8c('0xe'));var querystring=require('querystring');var Papa=require(_0x1a8c('0xf'));var Redis=require(_0x1a8c('0x10'));var authService=require(_0x1a8c('0x11'));var qs=require(_0x1a8c('0x12'));var as=require(_0x1a8c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a8c('0x14'))('api');var utils=require(_0x1a8c('0x15'));var config=require('../../config/environment');var db=require(_0x1a8c('0x16'))['db'];function respondWithStatusCode(_0x3125da,_0x403f45){_0x403f45=_0x403f45||0xcc;return function(_0x40dbc4){if(_0x40dbc4){return _0x3125da['sendStatus'](_0x403f45);}return _0x3125da[_0x1a8c('0x17')](_0x403f45)['end']();};}function respondWithResult(_0x3fc495,_0x53c81f){_0x53c81f=_0x53c81f||0xc8;return function(_0x12f500){if(_0x12f500){return _0x3fc495['status'](_0x53c81f)[_0x1a8c('0x18')](_0x12f500);}};}function respondWithFilteredResult(_0x2f341b,_0x3477c7){return function(_0x4cce1a){if(_0x4cce1a){var _0xb314b7=_0x4cce1a[_0x1a8c('0x19')],_0x31e049=_0x3477c7['offset'],_0x735182=_0x3477c7[_0x1a8c('0x1a')]+_0x3477c7[_0x1a8c('0x1b')],_0x3e7af9;if(_0x735182>=_0xb314b7){_0x735182=_0xb314b7;_0x3e7af9=0xc8;}else{_0x3e7af9=0xce;}_0x2f341b[_0x1a8c('0x17')](_0x3e7af9);return _0x2f341b[_0x1a8c('0x1c')](_0x1a8c('0x1d'),_0x31e049+'-'+_0x735182+'/'+_0xb314b7)[_0x1a8c('0x18')](_0x4cce1a);}return null;};}function patchUpdates(_0x3b90ef){return function(_0x3f788e){try{jsonpatch['apply'](_0x3f788e,_0x3b90ef,!![]);}catch(_0x431b5f){return BPromise[_0x1a8c('0x1e')](_0x431b5f);}return _0x3f788e[_0x1a8c('0x1f')]();};}function saveUpdates(_0x5f2b36,_0x36bb03){return function(_0x21ff76){if(_0x21ff76){return _0x21ff76[_0x1a8c('0x20')](_0x5f2b36)[_0x1a8c('0x21')](function(_0x1a05ea){return _0x1a05ea;});}return null;};}function removeEntity(_0x2fe122,_0x2dc99c){return function(_0x3db32b){if(_0x3db32b){return _0x3db32b[_0x1a8c('0x22')]()['then'](function(){_0x2fe122[_0x1a8c('0x17')](0xcc)[_0x1a8c('0x23')]();});}};}function handleEntityNotFound(_0x3c7321,_0x3ff03e){return function(_0x3dae08){if(!_0x3dae08){_0x3c7321['sendStatus'](0x194);}return _0x3dae08;};}function handleError(_0x4c2777,_0x239c76){_0x239c76=_0x239c76||0x1f4;return function(_0x1b81ec){logger['error'](_0x1b81ec[_0x1a8c('0x24')]);if(_0x1b81ec[_0x1a8c('0x25')]){delete _0x1b81ec[_0x1a8c('0x25')];}_0x4c2777[_0x1a8c('0x17')](_0x239c76)['send'](_0x1b81ec);};}exports[_0x1a8c('0x26')]=function(_0x5c5b78,_0x1cc9a7){var _0x15181f={},_0x163ff7={},_0x10502b={'count':0x0,'rows':[]};var _0x1e2cad=_['map'](db[_0x1a8c('0x27')][_0x1a8c('0x28')],function(_0x45ff3b){return{'name':_0x45ff3b[_0x1a8c('0x29')],'type':_0x45ff3b['type'][_0x1a8c('0x2a')]};});_0x163ff7[_0x1a8c('0x2b')]=_[_0x1a8c('0x2c')](_0x1e2cad,'name');_0x163ff7[_0x1a8c('0x2d')]=_[_0x1a8c('0x2e')](_0x5c5b78[_0x1a8c('0x2d')]);_0x163ff7['filters']=_[_0x1a8c('0x2f')](_0x163ff7['model'],_0x163ff7[_0x1a8c('0x2d')]);_0x15181f['attributes']=_['intersection'](_0x163ff7[_0x1a8c('0x2b')],qs['fields'](_0x5c5b78[_0x1a8c('0x2d')][_0x1a8c('0x30')]));_0x15181f[_0x1a8c('0x31')]=_0x15181f[_0x1a8c('0x31')]['length']?_0x15181f['attributes']:_0x163ff7['model'];if(!_0x5c5b78[_0x1a8c('0x2d')][_0x1a8c('0x32')]('nolimit')){_0x15181f[_0x1a8c('0x1b')]=qs[_0x1a8c('0x1b')](_0x5c5b78[_0x1a8c('0x2d')][_0x1a8c('0x1b')]);_0x15181f[_0x1a8c('0x1a')]=qs[_0x1a8c('0x1a')](_0x5c5b78[_0x1a8c('0x2d')][_0x1a8c('0x1a')]);}_0x15181f[_0x1a8c('0x33')]=qs[_0x1a8c('0x34')](_0x5c5b78[_0x1a8c('0x2d')][_0x1a8c('0x34')]);_0x15181f[_0x1a8c('0x35')]=qs['filters'](_['pick'](_0x5c5b78[_0x1a8c('0x2d')],_0x163ff7['filters']),_0x1e2cad);if(_0x5c5b78[_0x1a8c('0x2d')][_0x1a8c('0x36')]){_0x15181f[_0x1a8c('0x35')]=_[_0x1a8c('0x37')](_0x15181f[_0x1a8c('0x35')],{'$or':_[_0x1a8c('0x2c')](_0x1e2cad,function(_0x4fc3d2){if(_0x4fc3d2[_0x1a8c('0x38')]!==_0x1a8c('0x39')){var _0x208e2d={};_0x208e2d[_0x4fc3d2['name']]={'$like':'%'+_0x5c5b78['query'][_0x1a8c('0x36')]+'%'};return _0x208e2d;}})});}_0x15181f=_[_0x1a8c('0x37')]({},_0x15181f,_0x5c5b78[_0x1a8c('0x3a')]);var _0x399ebe={'where':_0x15181f[_0x1a8c('0x35')]};return db[_0x1a8c('0x27')]['count'](_0x399ebe)[_0x1a8c('0x21')](function(_0x432e66){_0x10502b[_0x1a8c('0x19')]=_0x432e66;if(_0x5c5b78['query'][_0x1a8c('0x3b')]){_0x15181f['include']=[{'all':!![]}];}return db[_0x1a8c('0x27')][_0x1a8c('0x3c')](_0x15181f);})[_0x1a8c('0x21')](function(_0x489260){_0x10502b[_0x1a8c('0x3d')]=_0x489260;return _0x10502b;})[_0x1a8c('0x21')](respondWithFilteredResult(_0x1cc9a7,_0x15181f))[_0x1a8c('0x3e')](handleError(_0x1cc9a7,null));};exports[_0x1a8c('0x3f')]=function(_0x1fc65c,_0x5b3fa1){var _0x517c63={'raw':!![],'where':{'id':_0x1fc65c['params']['id']}},_0x2eaf2d={};_0x2eaf2d[_0x1a8c('0x2b')]=_[_0x1a8c('0x2e')](db[_0x1a8c('0x27')][_0x1a8c('0x28')]);_0x2eaf2d[_0x1a8c('0x2d')]=_[_0x1a8c('0x2e')](_0x1fc65c[_0x1a8c('0x2d')]);_0x2eaf2d[_0x1a8c('0x40')]=_[_0x1a8c('0x2f')](_0x2eaf2d[_0x1a8c('0x2b')],_0x2eaf2d[_0x1a8c('0x2d')]);_0x517c63['attributes']=_[_0x1a8c('0x2f')](_0x2eaf2d[_0x1a8c('0x2b')],qs['fields'](_0x1fc65c[_0x1a8c('0x2d')][_0x1a8c('0x30')]));_0x517c63[_0x1a8c('0x31')]=_0x517c63[_0x1a8c('0x31')][_0x1a8c('0x41')]?_0x517c63[_0x1a8c('0x31')]:_0x2eaf2d[_0x1a8c('0x2b')];if(_0x1fc65c['query'][_0x1a8c('0x3b')]){_0x517c63[_0x1a8c('0x42')]=[{'all':!![]}];}_0x517c63=_[_0x1a8c('0x37')]({},_0x517c63,_0x1fc65c[_0x1a8c('0x3a')]);return db[_0x1a8c('0x27')][_0x1a8c('0x43')](_0x517c63)[_0x1a8c('0x21')](handleEntityNotFound(_0x5b3fa1,null))[_0x1a8c('0x21')](respondWithResult(_0x5b3fa1,null))[_0x1a8c('0x3e')](handleError(_0x5b3fa1,null));};exports['create']=function(_0x16b96a,_0x7b8438){return db[_0x1a8c('0x27')]['create'](_0x16b96a['body'],{})['then'](respondWithResult(_0x7b8438,0xc9))[_0x1a8c('0x3e')](handleError(_0x7b8438,null));};exports[_0x1a8c('0x20')]=function(_0x5ade96,_0x30a030){if(_0x5ade96[_0x1a8c('0x44')]['id']){delete _0x5ade96[_0x1a8c('0x44')]['id'];}return db['VoiceTransferReport'][_0x1a8c('0x43')]({'where':{'id':_0x5ade96[_0x1a8c('0x45')]['id']}})[_0x1a8c('0x21')](handleEntityNotFound(_0x30a030,null))[_0x1a8c('0x21')](saveUpdates(_0x5ade96[_0x1a8c('0x44')],null))[_0x1a8c('0x21')](respondWithResult(_0x30a030,null))[_0x1a8c('0x3e')](handleError(_0x30a030,null));};exports[_0x1a8c('0x22')]=function(_0x1d4516,_0x55548e){return db[_0x1a8c('0x27')][_0x1a8c('0x43')]({'where':{'id':_0x1d4516['params']['id']}})[_0x1a8c('0x21')](handleEntityNotFound(_0x55548e,null))[_0x1a8c('0x21')](removeEntity(_0x55548e,null))[_0x1a8c('0x3e')](handleError(_0x55548e,null));};
\ No newline at end of file
index 600da3c..8d443a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdb0=['../../config/environment','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcdb0,0x71));var _0x0cdb=function(_0x428a08,_0x226897){_0x428a08=_0x428a08-0x0;var _0xecd17b=_0xcdb0[_0x428a08];return _0xecd17b;};'use strict';var _=require(_0x0cdb('0x0'));var util=require(_0x0cdb('0x1'));var logger=require(_0x0cdb('0x2'))(_0x0cdb('0x3'));var moment=require('moment');var BPromise=require(_0x0cdb('0x4'));var rp=require(_0x0cdb('0x5'));var fs=require('fs');var path=require(_0x0cdb('0x6'));var rimraf=require('rimraf');var config=require(_0x0cdb('0x7'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x54f9e9,_0x26f5e7){return _0x54f9e9['define'](_0x0cdb('0x8'),attributes,{'tableName':_0x0cdb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd35=['./voiceTransferReport.attributes','exports','report_call_transfer','lodash','../../config/logger','bluebird','request-promise','../../config/environment'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0xfd35,0x173));var _0x5fd3=function(_0x5a66e6,_0x296d7d){_0x5a66e6=_0x5a66e6-0x0;var _0x5502bd=_0xfd35[_0x5a66e6];return _0x5502bd;};'use strict';var _=require(_0x5fd3('0x0'));var util=require('util');var logger=require(_0x5fd3('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5fd3('0x2'));var rp=require(_0x5fd3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5fd3('0x4'));var attributes=require(_0x5fd3('0x5'));module[_0x5fd3('0x6')]=function(_0x4ff57c,_0x345233){return _0x4ff57c['define']('VoiceTransferReport',attributes,{'tableName':_0x5fd3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 62dafc8..48a9abd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfabb=['then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x44feaf,_0x46068f){var _0x19ea54=function(_0x530743){while(--_0x530743){_0x44feaf['push'](_0x44feaf['shift']());}};_0x19ea54(++_0x46068f);}(_0xfabb,0x198));var _0xbfab=function(_0x44216f,_0x187779){_0x44216f=_0x44216f-0x0;var _0x3b6d3c=_0xfabb[_0x44216f];return _0x3b6d3c;};'use strict';var _=require(_0xbfab('0x0'));var util=require(_0xbfab('0x1'));var moment=require(_0xbfab('0x2'));var BPromise=require(_0xbfab('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfab('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfab('0x5'));var logger=require(_0xbfab('0x6'))(_0xbfab('0x7'));var config=require(_0xbfab('0x8'));var jayson=require(_0xbfab('0x9'));var client=jayson[_0xbfab('0xa')][_0xbfab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x349326,_0x27877e,_0x1ae879){return new BPromise(function(_0x2b665a,_0xba3846){return client['request'](_0x349326,_0x1ae879)[_0xbfab('0xc')](function(_0x153a0b){logger[_0xbfab('0xd')](_0xbfab('0xe'),_0x27877e,_0xbfab('0xf'));logger[_0xbfab('0x10')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x27877e,'request\x20sent',JSON[_0xbfab('0x11')](_0x153a0b));if(_0x153a0b[_0xbfab('0x12')]){if(_0x153a0b[_0xbfab('0x12')]['code']===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x27877e,_0x153a0b[_0xbfab('0x12')][_0xbfab('0x13')]);return _0xba3846(_0x153a0b[_0xbfab('0x12')][_0xbfab('0x13')]);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x27877e,_0x153a0b['error'][_0xbfab('0x13')]);return _0x2b665a(_0x153a0b[_0xbfab('0x12')][_0xbfab('0x13')]);}else{logger['info'](_0xbfab('0xe'),_0x27877e,_0xbfab('0xf'));_0x2b665a(_0x153a0b[_0xbfab('0x14')][_0xbfab('0x13')]);}})[_0xbfab('0x15')](function(_0x5185e9){logger[_0xbfab('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x27877e,_0x5185e9);_0xba3846(_0x5185e9);});});}exports[_0xbfab('0x16')]=function(_0x3d4d09){var _0x151113=this;return new Promise(function(_0xb57133,_0x1eb656){return db[_0xbfab('0x17')][_0xbfab('0x18')](_0x3d4d09[_0xbfab('0x19')],{'raw':_0x3d4d09[_0xbfab('0x1a')]?_0x3d4d09['options'][_0xbfab('0x1b')]===undefined?!![]:![]:!![]})[_0xbfab('0xc')](function(_0x349b29){logger[_0xbfab('0xd')]('CreateVoiceTransferReport',_0x3d4d09);logger[_0xbfab('0x10')](_0xbfab('0x16'),_0x3d4d09,JSON[_0xbfab('0x11')](_0x349b29));_0xb57133(_0x349b29);})['catch'](function(_0x2ae730){logger[_0xbfab('0x12')](_0xbfab('0x16'),_0x2ae730[_0xbfab('0x13')],_0x3d4d09);_0x1eb656(_0x151113[_0xbfab('0x12')](0x1f4,_0x2ae730['message']));});});};
\ No newline at end of file
+var _0x9c19=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','lodash','util','randomstring','../../mysqldb'];(function(_0x5855aa,_0x4c9518){var _0x218fee=function(_0x5b2ff1){while(--_0x5b2ff1){_0x5855aa['push'](_0x5855aa['shift']());}};_0x218fee(++_0x4c9518);}(_0x9c19,0x1f4));var _0x99c1=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x9c19[_0x5d860f];return _0x236490;};'use strict';var _=require(_0x99c1('0x0'));var util=require(_0x99c1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x99c1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99c1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x99c1('0x4'))(_0x99c1('0x5'));var config=require(_0x99c1('0x6'));var jayson=require(_0x99c1('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18c779,_0x3193f8,_0x418644){return new BPromise(function(_0x173225,_0x20a233){return client[_0x99c1('0x8')](_0x18c779,_0x418644)[_0x99c1('0x9')](function(_0x3f56f6){logger[_0x99c1('0xa')](_0x99c1('0xb'),_0x3193f8,_0x99c1('0xc'));logger[_0x99c1('0xd')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x3193f8,_0x99c1('0xc'),JSON[_0x99c1('0xe')](_0x3f56f6));if(_0x3f56f6[_0x99c1('0xf')]){if(_0x3f56f6[_0x99c1('0xf')][_0x99c1('0x10')]===0x1f4){logger[_0x99c1('0xf')](_0x99c1('0xb'),_0x3193f8,_0x3f56f6[_0x99c1('0xf')][_0x99c1('0x11')]);return _0x20a233(_0x3f56f6[_0x99c1('0xf')][_0x99c1('0x11')]);}logger[_0x99c1('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x3193f8,_0x3f56f6['error'][_0x99c1('0x11')]);return _0x173225(_0x3f56f6[_0x99c1('0xf')][_0x99c1('0x11')]);}else{logger[_0x99c1('0xa')](_0x99c1('0xb'),_0x3193f8,'request\x20sent');_0x173225(_0x3f56f6['result'][_0x99c1('0x11')]);}})[_0x99c1('0x12')](function(_0x205c0b){logger[_0x99c1('0xf')](_0x99c1('0xb'),_0x3193f8,_0x205c0b);_0x20a233(_0x205c0b);});});}exports[_0x99c1('0x13')]=function(_0x1ac371){var _0x1006d7=this;return new Promise(function(_0xa74372,_0xe067bd){return db[_0x99c1('0x14')][_0x99c1('0x15')](_0x1ac371[_0x99c1('0x16')],{'raw':_0x1ac371['options']?_0x1ac371[_0x99c1('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x99c1('0x9')](function(_0x24c7d7){logger[_0x99c1('0xa')](_0x99c1('0x13'),_0x1ac371);logger['debug']('CreateVoiceTransferReport',_0x1ac371,JSON[_0x99c1('0xe')](_0x24c7d7));_0xa74372(_0x24c7d7);})[_0x99c1('0x12')](function(_0xe18b59){logger['error'](_0x99c1('0x13'),_0xe18b59[_0x99c1('0x11')],_0x1ac371);_0xe067bd(_0x1006d7[_0x99c1('0xf')](0x1f4,_0xe18b59['message']));});});};
\ No newline at end of file
index e2eb068..82927c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce9b=['express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','/hangup','hangup','/answer','answer','/unhold','/calls','calls','/transfer','transfer','exports'];(function(_0x67624f,_0x335844){var _0x2235c9=function(_0x4a2df2){while(--_0x4a2df2){_0x67624f['push'](_0x67624f['shift']());}};_0x2235c9(++_0x335844);}(_0xce9b,0xc6));var _0xbce9=function(_0x21557f,_0x4a5291){_0x21557f=_0x21557f-0x0;var _0x22e491=_0xce9b[_0x21557f];return _0x22e491;};'use strict';var express=require(_0xbce9('0x0'));var router=express[_0xbce9('0x1')]();var auth=require(_0xbce9('0x2'));var controller=require(_0xbce9('0x3'));router[_0xbce9('0x4')](_0xbce9('0x5'),auth[_0xbce9('0x6')](),auth[_0xbce9('0x7')](),controller['originate']);router[_0xbce9('0x4')](_0xbce9('0x8'),auth[_0xbce9('0x6')](),auth[_0xbce9('0x7')](),controller[_0xbce9('0x9')]);router[_0xbce9('0x4')](_0xbce9('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xbce9('0xb')]);router[_0xbce9('0x4')]('/hold',auth[_0xbce9('0x6')](),auth[_0xbce9('0x7')](),controller['hold']);router['post'](_0xbce9('0xc'),auth[_0xbce9('0x6')](),auth[_0xbce9('0x7')](),controller['unhold']);router['post'](_0xbce9('0xd'),auth[_0xbce9('0x6')](),auth[_0xbce9('0x7')](),controller[_0xbce9('0xe')]);router[_0xbce9('0x4')](_0xbce9('0xf'),auth[_0xbce9('0x6')](),auth[_0xbce9('0x7')](),controller[_0xbce9('0x10')]);module[_0xbce9('0x11')]=router;
\ No newline at end of file
+var _0x8ebf=['answer','/hold','hold','unhold','/calls','calls','/transfer','transfer','express','Router','../../components/auth/service','post','/originate','canUpdate','originate','isAuthenticated','/answer'];(function(_0xfcebe9,_0x30867d){var _0x52a587=function(_0x4eaece){while(--_0x4eaece){_0xfcebe9['push'](_0xfcebe9['shift']());}};_0x52a587(++_0x30867d);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x8ebf[_0x2be8c2];return _0x97f531;};'use strict';var express=require(_0xf8eb('0x0'));var router=express[_0xf8eb('0x1')]();var auth=require(_0xf8eb('0x2'));var controller=require('./webbar.controller');router[_0xf8eb('0x3')](_0xf8eb('0x4'),auth['isAuthenticated'](),auth[_0xf8eb('0x5')](),controller[_0xf8eb('0x6')]);router[_0xf8eb('0x3')]('/hangup',auth[_0xf8eb('0x7')](),auth[_0xf8eb('0x5')](),controller['hangup']);router[_0xf8eb('0x3')](_0xf8eb('0x8'),auth[_0xf8eb('0x7')](),auth['canUpdate'](),controller[_0xf8eb('0x9')]);router['post'](_0xf8eb('0xa'),auth['isAuthenticated'](),auth[_0xf8eb('0x5')](),controller[_0xf8eb('0xb')]);router[_0xf8eb('0x3')]('/unhold',auth[_0xf8eb('0x7')](),auth[_0xf8eb('0x5')](),controller[_0xf8eb('0xc')]);router[_0xf8eb('0x3')](_0xf8eb('0xd'),auth[_0xf8eb('0x7')](),auth[_0xf8eb('0x5')](),controller[_0xf8eb('0xe')]);router['post'](_0xf8eb('0xf'),auth[_0xf8eb('0x7')](),auth[_0xf8eb('0x5')](),controller[_0xf8eb('0x10')]);module['exports']=router;
\ No newline at end of file
index cae681b..10fc18a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6315=['format','user:%s','webbar:originate','json','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','UserId','conference','conference\x20fired:','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','defaults','redis','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','handleError:','error','stack','name','send','status','request','then','code','catch','User','findOne','agent','VoiceChannels','all','filter','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','userId','callNumber','callbackUrl','entityFound:'];(function(_0x375fcf,_0x3c9ed8){var _0x10bfef=function(_0x3434e3){while(--_0x3434e3){_0x375fcf['push'](_0x375fcf['shift']());}};_0x10bfef(++_0x3c9ed8);}(_0x6315,0x65));var _0x5631=function(_0x494d76,_0x10f1e9){_0x494d76=_0x494d76-0x0;var _0x44cefa=_0x6315[_0x494d76];return _0x44cefa;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x5631('0x0'));var db=require(_0x5631('0x1'))['db'];var config=require(_0x5631('0x2'));var util=require(_0x5631('0x3'));var BPromise=require(_0x5631('0x4'));var jayson=require(_0x5631('0x5'));var amiClient=jayson[_0x5631('0x6')][_0x5631('0x7')]({'port':0x232a});var logger=require(_0x5631('0x8'))(_0x5631('0x9'));var Redis=require(_0x5631('0xa'));config['redis']=_[_0x5631('0xb')](config[_0x5631('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x5631('0xd'))(new Redis(config[_0x5631('0xc')]));var Schema=require(_0x5631('0xe'));var originateValidation=new Schema({'userId':{'type':_0x5631('0xf'),'required':[!![],_0x5631('0x10')]},'callNumber':{'type':_0x5631('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x5631('0x11')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x5631('0xf'),'required':[!![],_0x5631('0x10')]},'sessionId':{'type':_0x5631('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5631('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5631('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x5631('0x11'),'required':[!![],_0x5631('0x12')]},'transferNumber':{'type':_0x5631('0x11'),'required':[!![],_0x5631('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x5631('0xf'),'required':[!![],_0x5631('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5631('0xf'),'required':[!![],_0x5631('0x10')]},'sessionId':{'type':_0x5631('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5631('0xf'),'required':[!![],_0x5631('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5631('0xf'),'required':[!![],_0x5631('0x10')]}});function emit(_0x510b5d,_0xa391cb,_0x54ab09){logger[_0x5631('0x14')](_0x510b5d,_0xa391cb,JSON['stringify'](_0x54ab09));io['to'](_0x510b5d)['emit'](_0xa391cb,_0x54ab09);}function handleError(_0x3fe62d){return function(_0x26a279){console['log'](_0x5631('0x15'),_0x26a279,_0x26a279 instanceof RangeError);logger[_0x5631('0x16')](_0x26a279[_0x5631('0x17')]);if(_0x26a279 instanceof RangeError){if(_0x26a279[_0x5631('0x18')]){delete _0x26a279[_0x5631('0x18')];}_0x3fe62d['status'](0x194)[_0x5631('0x19')](_0x26a279);}else{if(_0x26a279[_0x5631('0x18')]){delete _0x26a279[_0x5631('0x18')];}_0x3fe62d[_0x5631('0x1a')](0x1f4)[_0x5631('0x19')](_0x26a279);}};}function checkError(){return function(_0x1153d6){if(!_0x1153d6){throw new RangeError('NotFound');}return _0x1153d6;};}function respondWithRpcPromise(_0x1bc80b,_0x14a011){return new BPromise(function(_0x112ad5,_0x1b1c7a){var _0x176c14=amiClient;return _0x176c14[_0x5631('0x1b')](_0x1bc80b,_0x14a011)[_0x5631('0x1c')](function(_0x257a1a){if(_0x257a1a[_0x5631('0x16')]){if(_0x257a1a[_0x5631('0x16')][_0x5631('0x1d')]===0x1f4){return _0x1b1c7a(_0x257a1a[_0x5631('0x16')]['message']);}return _0x112ad5(_0x257a1a[_0x5631('0x16')]['message']);}else{_0x112ad5(_0x257a1a['result']);}})[_0x5631('0x1e')](function(_0x5dd1c1){_0x1b1c7a(_0x5dd1c1);});});}function getAgent(_0x50f9b7){return db[_0x5631('0x1f')][_0x5631('0x20')]({'where':{'id':_0x50f9b7,'role':_0x5631('0x21')}})['then'](checkError());}function getAgentCheckSession(_0x27f456,_0x2907f3){return new BPromise(function(_0x6a53f3,_0xff9ad5){var _0x52bb38=respondWithRpcPromise(_0x5631('0x22'));var _0x11d514=getAgent(_0x27f456);Promise[_0x5631('0x23')]([_0x52bb38,_0x11d514])['then'](function(_0x473234){var _0x41a4b0=_0x473234[0x0];var _0x96f5af=_0x473234[0x1];var _0x36e208=_[_0x5631('0x24')](_0x41a4b0[_0x5631('0x25')],function(_0x448367){return _0x448367['UserId']==_0x96f5af['id']&&_0x448367[_0x5631('0x26')]==_0x2907f3;});if(_0x36e208[_0x5631('0x27')]==0x1){_0x6a53f3(_0x96f5af);}else{_0xff9ad5(new RangeError(_0x5631('0x28')+_0x2907f3+_0x5631('0x29')));}});});}exports[_0x5631('0x2a')]=function(_0x198eda,_0x24317b){logger['info'](_0x5631('0x2b'),_0x198eda[_0x5631('0x2c')]);var _0x4e3bbd=originateValidation[_0x5631('0xe')](_0x198eda['body']);if(_0x4e3bbd[_0x5631('0x27')]>0x0){return _0x24317b[_0x5631('0x1a')](0x190)['json'](_0x4e3bbd);}var _0x3b3893=_0x198eda[_0x5631('0x2c')][_0x5631('0x2d')];var _0x10d872=_0x198eda[_0x5631('0x2c')][_0x5631('0x2e')];var _0x37aa41=_0x198eda[_0x5631('0x2c')]['callerId'];var _0x105e73=_0x198eda[_0x5631('0x2c')][_0x5631('0x2f')];return getAgent(_0x3b3893)[_0x5631('0x1c')](function(_0x55e455){logger[_0x5631('0x14')](_0x5631('0x30'),_0x55e455[_0x5631('0x18')]);emit(util[_0x5631('0x31')](_0x5631('0x32'),_0x55e455[_0x5631('0x18')]),_0x5631('0x33'),{'callNumber':_0x10d872,'callerId':_0x37aa41,'callbackUrl':_0x105e73});return _0x24317b['status'](0xc8)[_0x5631('0x34')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x24317b));};exports[_0x5631('0x35')]=function(_0x115d04,_0x14288b){logger['info'](_0x5631('0x36'),_0x115d04[_0x5631('0x2c')]);var _0x5738c0=hangupValidation[_0x5631('0xe')](_0x115d04[_0x5631('0x2c')]);if(_0x5738c0['length']>0x0){return _0x14288b['status'](0x190)[_0x5631('0x34')](_0x5738c0);}var _0x4a6213=_0x115d04[_0x5631('0x2c')][_0x5631('0x2d')];var _0x4b9e68=_0x115d04[_0x5631('0x2c')]['sessionId'];return getAgent(_0x4a6213)[_0x5631('0x1c')](function(_0x3fd5e2){logger[_0x5631('0x14')](_0x5631('0x30'),_0x3fd5e2['name']);emit(util[_0x5631('0x31')]('user:%s',_0x3fd5e2[_0x5631('0x18')]),_0x5631('0x37'),{'sessionId':_0x4b9e68});return _0x14288b['status'](0xc8)[_0x5631('0x34')]({'error':![],'message':_0x5631('0x38')});})[_0x5631('0x1e')](handleError(_0x14288b));};exports[_0x5631('0x39')]=function(_0x3f26d1,_0x322195){logger['info'](_0x5631('0x3a'),_0x3f26d1['body']);var _0x182619=answerValidation[_0x5631('0xe')](_0x3f26d1[_0x5631('0x2c')]);if(_0x182619['length']>0x0){return _0x322195['status'](0x190)['json'](_0x182619);}var _0x4ff5ba=_0x3f26d1[_0x5631('0x2c')][_0x5631('0x2d')];var _0x5a6633=_0x3f26d1['body'][_0x5631('0x26')];return getAgent(_0x4ff5ba)['then'](function(_0x1493a0){logger['info'](_0x5631('0x30'),_0x1493a0[_0x5631('0x18')]);emit(util['format'](_0x5631('0x32'),_0x1493a0[_0x5631('0x18')]),_0x5631('0x3b'),{'sessionId':_0x5a6633});return _0x322195[_0x5631('0x1a')](0xc8)[_0x5631('0x34')]({'error':![],'message':_0x5631('0x3c')});})['catch'](handleError(_0x322195));};exports[_0x5631('0x3d')]=function(_0xfb7ad6,_0x2992eb){logger[_0x5631('0x14')](_0x5631('0x3e'),_0xfb7ad6[_0x5631('0x2c')]);var _0x42b193=holdValidation['validate'](_0xfb7ad6[_0x5631('0x2c')]);if(_0x42b193['length']>0x0){return _0x2992eb[_0x5631('0x1a')](0x190)[_0x5631('0x34')](_0x42b193);}var _0x29ea4b=_0xfb7ad6[_0x5631('0x2c')][_0x5631('0x2d')];var _0x2c0d39=_0xfb7ad6[_0x5631('0x2c')][_0x5631('0x26')];return getAgent(_0x29ea4b)[_0x5631('0x1c')](function(_0x55db8e){logger[_0x5631('0x14')](_0x5631('0x30'),_0x55db8e[_0x5631('0x18')]);emit(util['format'](_0x5631('0x32'),_0x55db8e['name']),_0x5631('0x3f'),{'sessionId':_0x2c0d39});return _0x2992eb[_0x5631('0x1a')](0xc8)[_0x5631('0x34')]({'error':![],'message':'hold\x20executed!'});})[_0x5631('0x1e')](handleError(_0x2992eb));};exports['unhold']=function(_0x4e1b4f,_0x5c126d){logger[_0x5631('0x14')](_0x5631('0x40'),_0x4e1b4f[_0x5631('0x2c')]);var _0x1f5c73=unholdValidation[_0x5631('0xe')](_0x4e1b4f[_0x5631('0x2c')]);if(_0x1f5c73[_0x5631('0x27')]>0x0){return _0x5c126d[_0x5631('0x1a')](0x190)[_0x5631('0x34')](_0x1f5c73);}var _0x15e59a=_0x4e1b4f['body'][_0x5631('0x2d')];var _0x1e277e=_0x4e1b4f[_0x5631('0x2c')][_0x5631('0x26')];return getAgent(_0x15e59a)[_0x5631('0x1c')](function(_0x3e045c){logger[_0x5631('0x14')](_0x5631('0x30'),_0x3e045c[_0x5631('0x18')]);emit(util['format'](_0x5631('0x32'),_0x3e045c[_0x5631('0x18')]),'webbar:unhold',{'sessionId':_0x1e277e});return _0x5c126d[_0x5631('0x1a')](0xc8)[_0x5631('0x34')]({'error':![],'message':_0x5631('0x41')});})[_0x5631('0x1e')](handleError(_0x5c126d));};exports['calls']=function(_0x10c77f,_0x29bcac){logger[_0x5631('0x14')](_0x5631('0x42'),_0x29bcac[_0x5631('0x2c')]);var _0x17c6b3=callsValidation[_0x5631('0xe')](_0x10c77f[_0x5631('0x2c')]);if(_0x17c6b3[_0x5631('0x27')]>0x0){return _0x29bcac[_0x5631('0x1a')](0x190)[_0x5631('0x34')](_0x17c6b3);}var _0x426732=_0x10c77f[_0x5631('0x2c')][_0x5631('0x2d')];var _0x4afbf5=respondWithRpcPromise(_0x5631('0x22'));var _0x2c548d=getAgent(_0x426732);return Promise[_0x5631('0x23')]([_0x4afbf5,_0x2c548d])[_0x5631('0x1c')](function(_0x1ea6a2){var _0x551a0f=_0x1ea6a2[0x0];var _0x317747=_0x1ea6a2[0x1];var _0x1bfff8=_[_0x5631('0x24')](_0x551a0f[_0x5631('0x25')],function(_0x1c1764){return _0x1c1764[_0x5631('0x43')]==_0x317747['id'];});return _0x29bcac[_0x5631('0x1a')](0xc8)[_0x5631('0x34')]({'count':_0x1bfff8[_0x5631('0x27')],'rows':_0x1bfff8});})[_0x5631('0x1e')](handleError(_0x29bcac));};exports[_0x5631('0x44')]=function(_0x486256,_0x338159){logger[_0x5631('0x14')](_0x5631('0x45'),_0x486256[_0x5631('0x2c')]);var _0x1ce1c4=conferenceValidation[_0x5631('0xe')](_0x486256[_0x5631('0x2c')]);if(_0x1ce1c4[_0x5631('0x27')]>0x0){return _0x338159[_0x5631('0x1a')](0x190)[_0x5631('0x34')](_0x1ce1c4);}var _0x4cf4d9=_0x486256[_0x5631('0x2c')][_0x5631('0x2d')];return getAgent(_0x4cf4d9)[_0x5631('0x1c')](function(_0x2ab615){logger[_0x5631('0x14')]('entityFound:',_0x2ab615[_0x5631('0x18')]);emit(util[_0x5631('0x31')]('user:%s',_0x2ab615['name']),'webbar:conference');return _0x338159[_0x5631('0x1a')](0xc8)[_0x5631('0x34')]({'error':![],'message':_0x5631('0x46')});})[_0x5631('0x1e')](handleError(_0x338159));};exports[_0x5631('0x47')]=function(_0x391213,_0x12a7b6){logger[_0x5631('0x14')]('transfer\x20fired:',_0x391213[_0x5631('0x2c')]);var _0xdfaed2=transferValidation[_0x5631('0xe')](_0x391213['body']);if(_0xdfaed2['length']>0x0){return _0x12a7b6[_0x5631('0x1a')](0x190)['json'](_0xdfaed2);}var _0x38ce72=_0x391213[_0x5631('0x2c')][_0x5631('0x2d')];var _0x526a99=_0x391213[_0x5631('0x2c')][_0x5631('0x26')];var _0xc92573=_0x391213[_0x5631('0x2c')][_0x5631('0x48')];return getAgent(_0x38ce72)[_0x5631('0x1c')](function(_0x1da041){logger['info'](_0x5631('0x30'),_0x1da041[_0x5631('0x18')]);emit(util[_0x5631('0x31')](_0x5631('0x32'),_0x1da041[_0x5631('0x18')]),_0x5631('0x49'),{'sessionId':_0x526a99,'transferNumber':_0xc92573});return _0x12a7b6[_0x5631('0x1a')](0xc8)[_0x5631('0x34')]({'error':![],'message':_0x5631('0x4a')});})[_0x5631('0x1e')](handleError(_0x12a7b6));};
\ No newline at end of file
+var _0x6b61=['name','status','NotFound','request','then','message','result','findOne','agent','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','json','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','userId','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','all','filter','conference','conference\x20fired:','webbar:conference','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','ioredis','redis','localhost','validate','callNumber\x20is\x20required','string','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','log','handleError:','error','stack'];(function(_0x314916,_0x112f3d){var _0x4edc73=function(_0x12d3ce){while(--_0x12d3ce){_0x314916['push'](_0x314916['shift']());}};_0x4edc73(++_0x112f3d);}(_0x6b61,0x16a));var _0x16b6=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x6b61[_0x373dee];return _0x46798f;};'use strict';var path=require(_0x16b6('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x16b6('0x1'))['db'];var config=require(_0x16b6('0x2'));var util=require(_0x16b6('0x3'));var BPromise=require(_0x16b6('0x4'));var jayson=require(_0x16b6('0x5'));var amiClient=jayson[_0x16b6('0x6')][_0x16b6('0x7')]({'port':0x232a});var logger=require(_0x16b6('0x8'))('webbarapi');var Redis=require(_0x16b6('0x9'));config[_0x16b6('0xa')]=_['defaults'](config[_0x16b6('0xa')],{'host':_0x16b6('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x16b6('0xa')]));var Schema=require(_0x16b6('0xc'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x16b6('0xd')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x16b6('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x16b6('0xf'),'required':[!![],_0x16b6('0x10')]},'sessionId':{'type':_0x16b6('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x16b6('0xf'),'required':[!![],_0x16b6('0x10')]},'sessionId':{'type':_0x16b6('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],_0x16b6('0x11')]},'transferNumber':{'type':_0x16b6('0xe'),'required':[!![],_0x16b6('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x16b6('0xf'),'required':[!![],_0x16b6('0x10')]},'sessionId':{'type':_0x16b6('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x16b6('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x16b6('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x5f42bc,_0x4833a0,_0xf6ec42){logger['info'](_0x5f42bc,_0x4833a0,JSON['stringify'](_0xf6ec42));io['to'](_0x5f42bc)['emit'](_0x4833a0,_0xf6ec42);}function handleError(_0x367edd){return function(_0x2d6cb9){console[_0x16b6('0x13')](_0x16b6('0x14'),_0x2d6cb9,_0x2d6cb9 instanceof RangeError);logger[_0x16b6('0x15')](_0x2d6cb9[_0x16b6('0x16')]);if(_0x2d6cb9 instanceof RangeError){if(_0x2d6cb9[_0x16b6('0x17')]){delete _0x2d6cb9[_0x16b6('0x17')];}_0x367edd[_0x16b6('0x18')](0x194)['send'](_0x2d6cb9);}else{if(_0x2d6cb9[_0x16b6('0x17')]){delete _0x2d6cb9['name'];}_0x367edd[_0x16b6('0x18')](0x1f4)['send'](_0x2d6cb9);}};}function checkError(){return function(_0x52e86c){if(!_0x52e86c){throw new RangeError(_0x16b6('0x19'));}return _0x52e86c;};}function respondWithRpcPromise(_0x375f2c,_0x1b5424){return new BPromise(function(_0x360d4a,_0x22d2f7){var _0x32f4f7=amiClient;return _0x32f4f7[_0x16b6('0x1a')](_0x375f2c,_0x1b5424)[_0x16b6('0x1b')](function(_0x4a3dc4){if(_0x4a3dc4[_0x16b6('0x15')]){if(_0x4a3dc4[_0x16b6('0x15')]['code']===0x1f4){return _0x22d2f7(_0x4a3dc4[_0x16b6('0x15')][_0x16b6('0x1c')]);}return _0x360d4a(_0x4a3dc4['error'][_0x16b6('0x1c')]);}else{_0x360d4a(_0x4a3dc4[_0x16b6('0x1d')]);}})['catch'](function(_0x22012e){_0x22d2f7(_0x22012e);});});}function getAgent(_0x385855){return db['User'][_0x16b6('0x1e')]({'where':{'id':_0x385855,'role':_0x16b6('0x1f')}})[_0x16b6('0x1b')](checkError());}function getAgentCheckSession(_0x35b127,_0x599aa0){return new BPromise(function(_0x44fa79,_0x499618){var _0x372843=respondWithRpcPromise('VoiceChannels');var _0x43c77a=getAgent(_0x35b127);Promise['all']([_0x372843,_0x43c77a])[_0x16b6('0x1b')](function(_0x416244){var _0x19e669=_0x416244[0x0];var _0x2c1e63=_0x416244[0x1];var _0x4e3191=_['filter'](_0x19e669[_0x16b6('0x20')],function(_0x45b632){return _0x45b632[_0x16b6('0x21')]==_0x2c1e63['id']&&_0x45b632[_0x16b6('0x22')]==_0x599aa0;});if(_0x4e3191[_0x16b6('0x23')]==0x1){_0x44fa79(_0x2c1e63);}else{_0x499618(new RangeError(_0x16b6('0x24')+_0x599aa0+_0x16b6('0x25')));}});});}exports[_0x16b6('0x26')]=function(_0x1c870e,_0x4fa98e){logger[_0x16b6('0x27')](_0x16b6('0x28'),_0x1c870e[_0x16b6('0x29')]);var _0x1224b8=originateValidation[_0x16b6('0xc')](_0x1c870e[_0x16b6('0x29')]);if(_0x1224b8['length']>0x0){return _0x4fa98e[_0x16b6('0x18')](0x190)[_0x16b6('0x2a')](_0x1224b8);}var _0x5c04d9=_0x1c870e[_0x16b6('0x29')]['userId'];var _0x14f4e1=_0x1c870e[_0x16b6('0x29')][_0x16b6('0x2b')];var _0x13af30=_0x1c870e[_0x16b6('0x29')][_0x16b6('0x2c')];var _0x3950ed=_0x1c870e[_0x16b6('0x29')][_0x16b6('0x2d')];return getAgent(_0x5c04d9)[_0x16b6('0x1b')](function(_0x12de4b){logger[_0x16b6('0x27')](_0x16b6('0x2e'),_0x12de4b[_0x16b6('0x17')]);emit(util[_0x16b6('0x2f')](_0x16b6('0x30'),_0x12de4b[_0x16b6('0x17')]),_0x16b6('0x31'),{'callNumber':_0x14f4e1,'callerId':_0x13af30,'callbackUrl':_0x3950ed});return _0x4fa98e['status'](0xc8)['json']({'error':![],'message':_0x16b6('0x32')});})[_0x16b6('0x33')](handleError(_0x4fa98e));};exports[_0x16b6('0x34')]=function(_0x44d567,_0x4eef72){logger[_0x16b6('0x27')](_0x16b6('0x35'),_0x44d567['body']);var _0x386f9d=hangupValidation[_0x16b6('0xc')](_0x44d567[_0x16b6('0x29')]);if(_0x386f9d['length']>0x0){return _0x4eef72[_0x16b6('0x18')](0x190)['json'](_0x386f9d);}var _0x1989d8=_0x44d567['body'][_0x16b6('0x36')];var _0x2be4e5=_0x44d567[_0x16b6('0x29')][_0x16b6('0x22')];return getAgent(_0x1989d8)['then'](function(_0x5d2ba0){logger[_0x16b6('0x27')](_0x16b6('0x2e'),_0x5d2ba0['name']);emit(util[_0x16b6('0x2f')]('user:%s',_0x5d2ba0[_0x16b6('0x17')]),'webbar:hangup',{'sessionId':_0x2be4e5});return _0x4eef72['status'](0xc8)[_0x16b6('0x2a')]({'error':![],'message':'hangup\x20executed!'});})[_0x16b6('0x33')](handleError(_0x4eef72));};exports[_0x16b6('0x37')]=function(_0x2997c9,_0x1be8cd){logger[_0x16b6('0x27')](_0x16b6('0x38'),_0x2997c9[_0x16b6('0x29')]);var _0x3b8476=answerValidation[_0x16b6('0xc')](_0x2997c9[_0x16b6('0x29')]);if(_0x3b8476[_0x16b6('0x23')]>0x0){return _0x1be8cd[_0x16b6('0x18')](0x190)[_0x16b6('0x2a')](_0x3b8476);}var _0x2a2fe2=_0x2997c9[_0x16b6('0x29')][_0x16b6('0x36')];var _0x9c8e8=_0x2997c9[_0x16b6('0x29')]['sessionId'];return getAgent(_0x2a2fe2)['then'](function(_0x4ae2e5){logger[_0x16b6('0x27')]('entityFound:',_0x4ae2e5['name']);emit(util[_0x16b6('0x2f')](_0x16b6('0x30'),_0x4ae2e5['name']),_0x16b6('0x39'),{'sessionId':_0x9c8e8});return _0x1be8cd[_0x16b6('0x18')](0xc8)['json']({'error':![],'message':_0x16b6('0x3a')});})[_0x16b6('0x33')](handleError(_0x1be8cd));};exports[_0x16b6('0x3b')]=function(_0x58ee76,_0x41938e){logger[_0x16b6('0x27')](_0x16b6('0x3c'),_0x58ee76['body']);var _0x269f94=holdValidation['validate'](_0x58ee76[_0x16b6('0x29')]);if(_0x269f94[_0x16b6('0x23')]>0x0){return _0x41938e[_0x16b6('0x18')](0x190)[_0x16b6('0x2a')](_0x269f94);}var _0x1b3dc3=_0x58ee76['body'][_0x16b6('0x36')];var _0x36ab91=_0x58ee76[_0x16b6('0x29')]['sessionId'];return getAgent(_0x1b3dc3)[_0x16b6('0x1b')](function(_0x24b9f3){logger['info'](_0x16b6('0x2e'),_0x24b9f3[_0x16b6('0x17')]);emit(util['format']('user:%s',_0x24b9f3[_0x16b6('0x17')]),_0x16b6('0x3d'),{'sessionId':_0x36ab91});return _0x41938e[_0x16b6('0x18')](0xc8)[_0x16b6('0x2a')]({'error':![],'message':_0x16b6('0x3e')});})[_0x16b6('0x33')](handleError(_0x41938e));};exports[_0x16b6('0x3f')]=function(_0x5c06e9,_0x2fd5a2){logger[_0x16b6('0x27')]('unhold\x20fired:',_0x5c06e9[_0x16b6('0x29')]);var _0x401192=unholdValidation[_0x16b6('0xc')](_0x5c06e9[_0x16b6('0x29')]);if(_0x401192['length']>0x0){return _0x2fd5a2['status'](0x190)[_0x16b6('0x2a')](_0x401192);}var _0x286e71=_0x5c06e9[_0x16b6('0x29')][_0x16b6('0x36')];var _0x1a6248=_0x5c06e9[_0x16b6('0x29')][_0x16b6('0x22')];return getAgent(_0x286e71)[_0x16b6('0x1b')](function(_0x39ac08){logger['info'](_0x16b6('0x2e'),_0x39ac08[_0x16b6('0x17')]);emit(util[_0x16b6('0x2f')](_0x16b6('0x30'),_0x39ac08[_0x16b6('0x17')]),'webbar:unhold',{'sessionId':_0x1a6248});return _0x2fd5a2[_0x16b6('0x18')](0xc8)['json']({'error':![],'message':_0x16b6('0x40')});})[_0x16b6('0x33')](handleError(_0x2fd5a2));};exports[_0x16b6('0x41')]=function(_0x404501,_0x43894e){logger['info'](_0x16b6('0x42'),_0x43894e[_0x16b6('0x29')]);var _0x1e00b3=callsValidation[_0x16b6('0xc')](_0x404501[_0x16b6('0x29')]);if(_0x1e00b3[_0x16b6('0x23')]>0x0){return _0x43894e[_0x16b6('0x18')](0x190)[_0x16b6('0x2a')](_0x1e00b3);}var _0x31c6b6=_0x404501[_0x16b6('0x29')][_0x16b6('0x36')];var _0x1465e8=respondWithRpcPromise(_0x16b6('0x43'));var _0x42c5ea=getAgent(_0x31c6b6);return Promise[_0x16b6('0x44')]([_0x1465e8,_0x42c5ea])[_0x16b6('0x1b')](function(_0x52275c){var _0x2e88eb=_0x52275c[0x0];var _0x3c4492=_0x52275c[0x1];var _0x4e61d8=_[_0x16b6('0x45')](_0x2e88eb[_0x16b6('0x20')],function(_0x4c72df){return _0x4c72df[_0x16b6('0x21')]==_0x3c4492['id'];});return _0x43894e[_0x16b6('0x18')](0xc8)['json']({'count':_0x4e61d8[_0x16b6('0x23')],'rows':_0x4e61d8});})[_0x16b6('0x33')](handleError(_0x43894e));};exports[_0x16b6('0x46')]=function(_0x150514,_0x4bc42b){logger[_0x16b6('0x27')](_0x16b6('0x47'),_0x150514[_0x16b6('0x29')]);var _0x1a47ba=conferenceValidation[_0x16b6('0xc')](_0x150514[_0x16b6('0x29')]);if(_0x1a47ba['length']>0x0){return _0x4bc42b[_0x16b6('0x18')](0x190)[_0x16b6('0x2a')](_0x1a47ba);}var _0x3f26a0=_0x150514[_0x16b6('0x29')][_0x16b6('0x36')];return getAgent(_0x3f26a0)[_0x16b6('0x1b')](function(_0x1673b1){logger[_0x16b6('0x27')]('entityFound:',_0x1673b1[_0x16b6('0x17')]);emit(util[_0x16b6('0x2f')](_0x16b6('0x30'),_0x1673b1[_0x16b6('0x17')]),_0x16b6('0x48'));return _0x4bc42b[_0x16b6('0x18')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x16b6('0x33')](handleError(_0x4bc42b));};exports['transfer']=function(_0x150607,_0x348046){logger[_0x16b6('0x27')](_0x16b6('0x49'),_0x150607[_0x16b6('0x29')]);var _0x348fa8=transferValidation[_0x16b6('0xc')](_0x150607[_0x16b6('0x29')]);if(_0x348fa8[_0x16b6('0x23')]>0x0){return _0x348046[_0x16b6('0x18')](0x190)[_0x16b6('0x2a')](_0x348fa8);}var _0x3e099a=_0x150607[_0x16b6('0x29')]['userId'];var _0x5a53c7=_0x150607['body']['sessionId'];var _0x494dc8=_0x150607[_0x16b6('0x29')][_0x16b6('0x4a')];return getAgent(_0x3e099a)['then'](function(_0x43909e){logger['info']('entityFound:',_0x43909e[_0x16b6('0x17')]);emit(util[_0x16b6('0x2f')](_0x16b6('0x30'),_0x43909e[_0x16b6('0x17')]),_0x16b6('0x4b'),{'sessionId':_0x5a53c7,'transferNumber':_0x494dc8});return _0x348046[_0x16b6('0x18')](0xc8)[_0x16b6('0x2a')]({'error':![],'message':_0x16b6('0x4c')});})['catch'](handleError(_0x348046));};
\ No newline at end of file
index 0bd8cf5..0e3d0e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3303=['removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','put','update','delete','destroy'];(function(_0x5960cd,_0x3bb2a1){var _0x472f93=function(_0xf44d6b){while(--_0xf44d6b){_0x5960cd['push'](_0x5960cd['shift']());}};_0x472f93(++_0x3bb2a1);}(_0x3303,0x8a));var _0x3330=function(_0x4811b2,_0x1296a4){_0x4811b2=_0x4811b2-0x0;var _0x703bc3=_0x3303[_0x4811b2];return _0x703bc3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3330('0x0'));var timeout=require(_0x3330('0x1'));var express=require(_0x3330('0x2'));var router=express[_0x3330('0x3')]();var auth=require(_0x3330('0x4'));var interaction=require(_0x3330('0x5'));var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x3330('0x6')]('/',auth[_0x3330('0x7')](),controller[_0x3330('0x8')]);router[_0x3330('0x6')](_0x3330('0x9'),auth[_0x3330('0x7')](),controller[_0x3330('0xa')]);router[_0x3330('0x6')](_0x3330('0xb'),auth[_0x3330('0x7')](),controller[_0x3330('0xc')]);router['get'](_0x3330('0xd'),auth[_0x3330('0x7')](),controller[_0x3330('0xe')]);router['get'](_0x3330('0xf'),auth[_0x3330('0x7')](),controller['getAnswers']);router['get'](_0x3330('0x10'),auth[_0x3330('0x7')](),controller['getAgents']);router[_0x3330('0x6')]('/:id/applications',auth[_0x3330('0x7')](),controller[_0x3330('0x11')]);router[_0x3330('0x12')]('/',auth['isAuthenticated'](),controller[_0x3330('0x13')]);router['post'](_0x3330('0xd'),auth[_0x3330('0x7')](),controller[_0x3330('0x14')]);router[_0x3330('0x12')](_0x3330('0xf'),auth['isAuthenticated'](),controller[_0x3330('0x15')]);router[_0x3330('0x12')](_0x3330('0x10'),auth[_0x3330('0x7')](),controller[_0x3330('0x16')]);router[_0x3330('0x12')](_0x3330('0x17'),auth['isAuthenticated'](),controller[_0x3330('0x18')]);router[_0x3330('0x12')](_0x3330('0x19'),controller[_0x3330('0x1a')]);router['post'](_0x3330('0x1b'),auth[_0x3330('0x7')](),controller['send']);router[_0x3330('0x1c')](_0x3330('0xb'),auth[_0x3330('0x7')](),controller[_0x3330('0x1d')]);router[_0x3330('0x1e')]('/:id',auth[_0x3330('0x7')](),controller[_0x3330('0x1f')]);router[_0x3330('0x1e')](_0x3330('0xd'),auth[_0x3330('0x7')](),controller['removeDispositions']);router[_0x3330('0x1e')](_0x3330('0xf'),auth[_0x3330('0x7')](),controller['removeAnswers']);router[_0x3330('0x1e')](_0x3330('0x10'),auth['isAuthenticated'](),controller[_0x3330('0x20')]);module[_0x3330('0x21')]=router;
\ No newline at end of file
+var _0xfd8f=['/:id/canned_answers','getAnswers','/:id/users','getApplications','post','create','/:id/dispositions','addDisposition','addAnswer','addAgents','/:id/applications','addApplications','/:id/notify','notify','send','put','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions'];(function(_0x4506c8,_0x2939ba){var _0x45b90f=function(_0x2cd7ef){while(--_0x2cd7ef){_0x4506c8['push'](_0x4506c8['shift']());}};_0x45b90f(++_0x2939ba);}(_0xfd8f,0xae));var _0xffd8=function(_0x2e1091,_0x3eeec8){_0x2e1091=_0x2e1091-0x0;var _0x2040cd=_0xfd8f[_0x2e1091];return _0x2040cd;};'use strict';var multer=require(_0xffd8('0x0'));var util=require(_0xffd8('0x1'));var path=require('path');var timeout=require(_0xffd8('0x2'));var express=require(_0xffd8('0x3'));var router=express[_0xffd8('0x4')]();var auth=require(_0xffd8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffd8('0x6'));var controller=require(_0xffd8('0x7'));router['get']('/',auth[_0xffd8('0x8')](),controller[_0xffd8('0x9')]);router[_0xffd8('0xa')](_0xffd8('0xb'),auth[_0xffd8('0x8')](),controller[_0xffd8('0xc')]);router['get'](_0xffd8('0xd'),auth[_0xffd8('0x8')](),controller[_0xffd8('0xe')]);router[_0xffd8('0xa')]('/:id/dispositions',auth[_0xffd8('0x8')](),controller[_0xffd8('0xf')]);router[_0xffd8('0xa')](_0xffd8('0x10'),auth[_0xffd8('0x8')](),controller[_0xffd8('0x11')]);router[_0xffd8('0xa')](_0xffd8('0x12'),auth[_0xffd8('0x8')](),controller['getAgents']);router['get']('/:id/applications',auth[_0xffd8('0x8')](),controller[_0xffd8('0x13')]);router[_0xffd8('0x14')]('/',auth[_0xffd8('0x8')](),controller[_0xffd8('0x15')]);router['post'](_0xffd8('0x16'),auth[_0xffd8('0x8')](),controller[_0xffd8('0x17')]);router[_0xffd8('0x14')](_0xffd8('0x10'),auth['isAuthenticated'](),controller[_0xffd8('0x18')]);router[_0xffd8('0x14')]('/:id/users',auth[_0xffd8('0x8')](),controller[_0xffd8('0x19')]);router[_0xffd8('0x14')](_0xffd8('0x1a'),auth[_0xffd8('0x8')](),controller[_0xffd8('0x1b')]);router['post'](_0xffd8('0x1c'),controller[_0xffd8('0x1d')]);router[_0xffd8('0x14')]('/:id/send',auth['isAuthenticated'](),controller[_0xffd8('0x1e')]);router[_0xffd8('0x1f')](_0xffd8('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xffd8('0xd'),auth[_0xffd8('0x8')](),controller[_0xffd8('0x20')]);router[_0xffd8('0x21')]('/:id/dispositions',auth[_0xffd8('0x8')](),controller[_0xffd8('0x22')]);router[_0xffd8('0x21')](_0xffd8('0x10'),auth['isAuthenticated'](),controller[_0xffd8('0x23')]);router[_0xffd8('0x21')](_0xffd8('0x12'),auth['isAuthenticated'](),controller[_0xffd8('0x24')]);module[_0xffd8('0x25')]=router;
\ No newline at end of file
index c88751e..ec914cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe346=['twilio','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','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate'];(function(_0x4784a8,_0x33480a){var _0x295886=function(_0x1d6d41){while(--_0x1d6d41){_0x4784a8['push'](_0x4784a8['shift']());}};_0x295886(++_0x33480a);}(_0xe346,0x13f));var _0x6e34=function(_0xdb09a8,_0x471a1c){_0xdb09a8=_0xdb09a8-0x0;var _0x40c1ad=_0xe346[_0xdb09a8];return _0x40c1ad;};'use strict';var Sequelize=require(_0x6e34('0x0'));var rs=require(_0x6e34('0x1'));module[_0x6e34('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x6e34('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x6e34('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x6e34('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x6e34('0x4')],'defaultValue':function(){return rs[_0x6e34('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x6e34('0x6'))},'accountSid':{'type':Sequelize[_0x6e34('0x4')]},'authToken':{'type':Sequelize[_0x6e34('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6e34('0x7');}},'notificationSound':{'type':Sequelize[_0x6e34('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e34('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6e34('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e34('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e34('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6e34('0x9')],'comment':_0x6e34('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2750f2){if(!_0x2750f2){this[_0x6e34('0xb')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x6e34('0xc'),_0x2750f2);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1eeb=['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','STRING','generate','ENUM','twilio'];(function(_0x47b7c9,_0x3848b2){var _0x435aaf=function(_0x3befc4){while(--_0x3befc4){_0x47b7c9['push'](_0x47b7c9['shift']());}};_0x435aaf(++_0x3848b2);}(_0x1eeb,0x1cf));var _0xb1ee=function(_0xafedec,_0x32ac5d){_0xafedec=_0xafedec-0x0;var _0xdefa7=_0x1eeb[_0xafedec];return _0xdefa7;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb1ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xb1ee('0x1')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xb1ee('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xb1ee('0x1')],'defaultValue':function(){return rs[_0xb1ee('0x2')]();}},'phone':{'type':Sequelize[_0xb1ee('0x1')]},'type':{'type':Sequelize[_0xb1ee('0x3')](_0xb1ee('0x4'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xb1ee('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb1ee('0x5');}},'notificationSound':{'type':Sequelize[_0xb1ee('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xb1ee('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb1ee('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb1ee('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb1ee('0x7')],'comment':_0xb1ee('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xb1ee('0x6')],'defaultValue':![],'comment':_0xb1ee('0x9'),'set':function(_0x1dd75a){if(!_0x1dd75a){this[_0xb1ee('0xa')](_0xb1ee('0xb'),null);}this['setDataValue'](_0xb1ee('0xc'),_0x1dd75a);}},'description':{'type':Sequelize[_0xb1ee('0x1')]}};
\ No newline at end of file
index f385d6f..5d570b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9354=['then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','status','json','count','offset','Content-Range','reject','update','WhatsappAccounts','UserProfileResource','destroy','end','sendStatus','stack','name','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','length','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','whatsapp','Applications','account','applications','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','messageId','MessageSid','isNil','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','list','Contacts','contact','WhatsappInteraction','interaction','autoclose','push','unmanaged','*,*,*,*','created','WhatsappMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','send','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x82775c,_0x103c6e){var _0x36c571=function(_0x5e240f){while(--_0x5e240f){_0x82775c['push'](_0x82775c['shift']());}};_0x36c571(++_0x103c6e);}(_0x9354,0x96));var _0x4935=function(_0x4aa4af,_0x210cde){_0x4aa4af=_0x4aa4af-0x0;var _0x3bf44a=_0x9354[_0x4aa4af];return _0x3bf44a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4935('0x0'));var rimraf=require(_0x4935('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4935('0x2'));var rp=require(_0x4935('0x3'));var moment=require(_0x4935('0x4'));var BPromise=require(_0x4935('0x5'));var Mustache=require('mustache');var util=require(_0x4935('0x6'));var path=require(_0x4935('0x7'));var sox=require(_0x4935('0x8'));var csv=require(_0x4935('0x9'));var ejs=require(_0x4935('0xa'));var fs=require('fs');var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x9'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4935('0x16')]=_[_0x4935('0x17')](config[_0x4935('0x16')],{'host':_0x4935('0x18'),'port':0x18eb});var socket=require(_0x4935('0x19'))(new Redis(config[_0x4935('0x16')]));require(_0x4935('0x1a'))[_0x4935('0x1b')](socket);var jayson=require(_0x4935('0x1c'));var client=jayson[_0x4935('0x1d')][_0x4935('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x1799e4,_0xa41961,_0x3652c4){if(_0x3652c4){var _0x24cc99=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24cc99[_0x4935('0x1f')](_0xa41961)){return _0x1799e4;}else{throw new db['Sequelize'][(_0x4935('0x20'))](_0x4935('0x21'));}}else{return _0x1799e4;}}function respondWithRpcPromise(_0x165ed3,_0x123300,_0x1f0e81,_0x429ef3){return new BPromise(function(_0x4ebc63,_0xd70eff){var _0x145277=_0x429ef3||client;return _0x145277['request'](_0x165ed3,_0x1f0e81)[_0x4935('0x22')](function(_0x10407f){logger[_0x4935('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x123300,'request\x20sent');logger[_0x4935('0x24')](_0x4935('0x25'),_0x123300,_0x4935('0x26'),JSON[_0x4935('0x27')](_0x10407f));if(_0x10407f[_0x4935('0x28')]){if(_0x10407f[_0x4935('0x28')][_0x4935('0x29')]===0x1f4){logger[_0x4935('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x123300,_0x10407f[_0x4935('0x28')][_0x4935('0x2a')]);return _0xd70eff(_0x10407f[_0x4935('0x28')][_0x4935('0x2a')]);}logger[_0x4935('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x123300,_0x10407f['error'][_0x4935('0x2a')]);return _0x4ebc63(_0x10407f[_0x4935('0x28')][_0x4935('0x2a')]);}else{logger[_0x4935('0x23')](_0x4935('0x2b'),_0x123300,_0x4935('0x26'));_0x4ebc63(_0x10407f[_0x4935('0x2c')][_0x4935('0x2a')]);}})[_0x4935('0x2d')](function(_0xf4abb2){logger[_0x4935('0x28')](_0x4935('0x2b'),_0x123300,_0xf4abb2);_0xd70eff(_0xf4abb2);});});}function respondWithStatusCode(_0x2c47ab,_0xbb00d6){_0xbb00d6=_0xbb00d6||0xcc;return function(_0x359522){if(_0x359522){return _0x2c47ab['sendStatus'](_0xbb00d6);}return _0x2c47ab['status'](_0xbb00d6)['end']();};}function respondWithResult(_0x1fc218,_0x76ea7d){_0x76ea7d=_0x76ea7d||0xc8;return function(_0x4f1163){if(_0x4f1163){return _0x1fc218[_0x4935('0x2e')](_0x76ea7d)[_0x4935('0x2f')](_0x4f1163);}};}function respondWithFilteredResult(_0x24a3b6,_0x9fe9f6){return function(_0x1198e5){if(_0x1198e5){var _0x24262e=_0x1198e5[_0x4935('0x30')],_0x28afc2=_0x9fe9f6[_0x4935('0x31')],_0x2fe6da=_0x9fe9f6['offset']+_0x9fe9f6['limit'],_0x5b3c8e;if(_0x2fe6da>=_0x24262e){_0x2fe6da=_0x24262e;_0x5b3c8e=0xc8;}else{_0x5b3c8e=0xce;}_0x24a3b6[_0x4935('0x2e')](_0x5b3c8e);return _0x24a3b6['set'](_0x4935('0x32'),_0x28afc2+'-'+_0x2fe6da+'/'+_0x24262e)[_0x4935('0x2f')](_0x1198e5);}return null;};}function patchUpdates(_0x30fbc9){return function(_0x53722a){try{jsonpatch['apply'](_0x53722a,_0x30fbc9,!![]);}catch(_0x415260){return BPromise[_0x4935('0x33')](_0x415260);}return _0x53722a['save']();};}function saveUpdates(_0x47003b,_0x3260d2){return function(_0x9bfd48){if(_0x9bfd48){return _0x9bfd48[_0x4935('0x34')](_0x47003b)[_0x4935('0x22')](function(_0x4a69bc){return _0x4a69bc;});}return null;};}function removeEntity(_0x4b5c01,_0x3d8795){return function(_0x1016cc){if(_0x1016cc){return _0x1016cc['destroy']()['then'](function(){var _0xb3d934=_0x1016cc['get']({'plain':!![]});var _0x7b45d1=_0x4935('0x35');return db[_0x4935('0x36')][_0x4935('0x37')]({'where':{'type':_0x7b45d1,'resourceId':_0xb3d934['id']}})[_0x4935('0x22')](function(){return _0x1016cc;});})[_0x4935('0x22')](function(){_0x4b5c01['status'](0xcc)[_0x4935('0x38')]();});}};}function handleEntityNotFound(_0x51b7ac,_0x365e83){return function(_0x5db44b){if(!_0x5db44b){_0x51b7ac[_0x4935('0x39')](0x194);}return _0x5db44b;};}function handleError(_0x4c5a4e,_0x27ead0){_0x27ead0=_0x27ead0||0x1f4;return function(_0x59b749){logger[_0x4935('0x28')](_0x59b749[_0x4935('0x3a')]);if(_0x59b749[_0x4935('0x3b')]){delete _0x59b749[_0x4935('0x3b')];}_0x4c5a4e[_0x4935('0x2e')](_0x27ead0)['send'](_0x59b749);};}exports['index']=function(_0x2efc45,_0x4e4820){var _0x4e8b2e={'include':[{'model':db[_0x4935('0x3c')],'as':_0x4935('0x3d')}]},_0x1552b2={},_0x5c8012={'count':0x0,'rows':[]};var _0x2d67e3=_[_0x4935('0x3e')](db[_0x4935('0x3f')]['rawAttributes'],function(_0x5d4d7f){return{'name':_0x5d4d7f[_0x4935('0x40')],'type':_0x5d4d7f[_0x4935('0x41')][_0x4935('0x42')]};});_0x1552b2[_0x4935('0x43')]=_[_0x4935('0x3e')](_0x2d67e3,_0x4935('0x3b'));_0x1552b2[_0x4935('0x44')]=_[_0x4935('0x45')](_0x2efc45['query']);_0x1552b2['filters']=_[_0x4935('0x46')](_0x1552b2[_0x4935('0x43')],_0x1552b2['query']);_0x4e8b2e[_0x4935('0x47')]=_[_0x4935('0x46')](_0x1552b2[_0x4935('0x43')],qs[_0x4935('0x48')](_0x2efc45['query']['fields']));_0x4e8b2e[_0x4935('0x47')]=_0x4e8b2e[_0x4935('0x47')]['length']?_0x4e8b2e[_0x4935('0x47')]:_0x1552b2[_0x4935('0x43')];if(!_0x2efc45[_0x4935('0x44')]['hasOwnProperty'](_0x4935('0x49'))){_0x4e8b2e[_0x4935('0x4a')]=qs[_0x4935('0x4a')](_0x2efc45[_0x4935('0x44')][_0x4935('0x4a')]);_0x4e8b2e[_0x4935('0x31')]=qs[_0x4935('0x31')](_0x2efc45[_0x4935('0x44')][_0x4935('0x31')]);}_0x4e8b2e[_0x4935('0x4b')]=qs[_0x4935('0x4c')](_0x2efc45[_0x4935('0x44')][_0x4935('0x4c')]);_0x4e8b2e[_0x4935('0x4d')]=qs[_0x4935('0x4e')](_[_0x4935('0x4f')](_0x2efc45[_0x4935('0x44')],_0x1552b2[_0x4935('0x4e')]),_0x2d67e3);if(_0x2efc45['query'][_0x4935('0x50')]){_0x4e8b2e['where']=_[_0x4935('0x51')](_0x4e8b2e[_0x4935('0x4d')],{'$or':_[_0x4935('0x3e')](_0x2d67e3,function(_0x33e94a){if(_0x33e94a['type']!==_0x4935('0x52')){var _0x9c8bad={};_0x9c8bad[_0x33e94a[_0x4935('0x3b')]]={'$like':'%'+_0x2efc45[_0x4935('0x44')][_0x4935('0x50')]+'%'};return _0x9c8bad;}})});}_0x4e8b2e=_[_0x4935('0x51')]({},_0x4e8b2e,_0x2efc45[_0x4935('0x53')]);var _0x31d137={'where':_0x4e8b2e[_0x4935('0x4d')]};return db[_0x4935('0x3f')]['count'](_0x31d137)[_0x4935('0x22')](function(_0x1c3d9c){_0x5c8012['count']=_0x1c3d9c;if(_0x2efc45[_0x4935('0x44')][_0x4935('0x54')]){_0x4e8b2e[_0x4935('0x55')]=[{'all':!![]}];}return db[_0x4935('0x3f')][_0x4935('0x56')](_0x4e8b2e);})[_0x4935('0x22')](function(_0x289c5e){_0x5c8012[_0x4935('0x57')]=_0x289c5e;return _0x5c8012;})['then'](respondWithFilteredResult(_0x4e4820,_0x4e8b2e))[_0x4935('0x2d')](handleError(_0x4e4820,null));};exports['show']=function(_0x561fa3,_0x15ce51){var _0x189071={'raw':![],'where':{'id':_0x561fa3[_0x4935('0x58')]['id']},'include':[{'model':db[_0x4935('0x3c')],'as':'mandatoryDispositionPause'}]},_0x41c6d0={};_0x41c6d0[_0x4935('0x43')]=_[_0x4935('0x45')](db[_0x4935('0x3f')][_0x4935('0x59')]);_0x41c6d0[_0x4935('0x44')]=_[_0x4935('0x45')](_0x561fa3[_0x4935('0x44')]);_0x41c6d0[_0x4935('0x4e')]=_[_0x4935('0x46')](_0x41c6d0[_0x4935('0x43')],_0x41c6d0['query']);_0x189071[_0x4935('0x47')]=_['intersection'](_0x41c6d0[_0x4935('0x43')],qs[_0x4935('0x48')](_0x561fa3['query'][_0x4935('0x48')]));_0x189071['attributes']=_0x189071['attributes']['length']?_0x189071[_0x4935('0x47')]:_0x41c6d0[_0x4935('0x43')];if(_0x561fa3[_0x4935('0x44')][_0x4935('0x54')]){_0x189071[_0x4935('0x55')]=[{'all':!![]}];}_0x189071=_['merge']({},_0x189071,_0x561fa3['options']);return db[_0x4935('0x3f')][_0x4935('0x5a')](_0x189071)[_0x4935('0x22')](handleEntityNotFound(_0x15ce51,null))['then'](respondWithResult(_0x15ce51,null))[_0x4935('0x2d')](handleError(_0x15ce51,null));};exports[_0x4935('0x5b')]=function(_0x24141a,_0xc92288){return db['WhatsappAccount'][_0x4935('0x5b')](_0x24141a['body'],{})['then'](function(_0x513b0e){var _0x24d870=_0x24141a[_0x4935('0x5c')]['get']({'plain':!![]});if(!_0x24d870)throw new Error(_0x4935('0x5d'));if(_0x24d870[_0x4935('0x5e')]==='user'){var _0x114a96=_0x513b0e[_0x4935('0x5f')]({'plain':!![]});var _0x3551b6=_0x4935('0x35');return db[_0x4935('0x60')][_0x4935('0x5a')]({'where':{'name':_0x3551b6,'userProfileId':_0x24d870[_0x4935('0x61')]},'raw':!![]})['then'](function(_0x31b426){if(_0x31b426&&_0x31b426['autoAssociation']===0x0){return db['UserProfileResource'][_0x4935('0x5b')]({'name':_0x114a96[_0x4935('0x3b')],'resourceId':_0x114a96['id'],'type':_0x31b426['name'],'sectionId':_0x31b426['id']},{})['then'](function(){return _0x513b0e;});}else{return _0x513b0e;}})[_0x4935('0x2d')](function(_0x24841d){logger[_0x4935('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24841d);throw _0x24841d;});}return _0x513b0e;})[_0x4935('0x22')](respondWithResult(_0xc92288,0xc9))['catch'](handleError(_0xc92288,null));};exports[_0x4935('0x34')]=function(_0x3d2005,_0x10b18b){if(_0x3d2005[_0x4935('0x62')]['id']){delete _0x3d2005[_0x4935('0x62')]['id'];}return db['WhatsappAccount'][_0x4935('0x5a')]({'where':{'id':_0x3d2005[_0x4935('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x4935('0x3d')}]})[_0x4935('0x22')](handleEntityNotFound(_0x10b18b,null))[_0x4935('0x22')](saveUpdates(_0x3d2005[_0x4935('0x62')],null))[_0x4935('0x22')](respondWithResult(_0x10b18b,null))[_0x4935('0x2d')](handleError(_0x10b18b,null));};exports[_0x4935('0x37')]=function(_0x3e8b18,_0x15ebcc){return db[_0x4935('0x3f')][_0x4935('0x5a')]({'where':{'id':_0x3e8b18['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x15ebcc,null))[_0x4935('0x22')](removeEntity(_0x15ebcc,null))[_0x4935('0x2d')](handleError(_0x15ebcc,null));};exports[_0x4935('0x63')]=function(_0x45c56c,_0x95da52){return db[_0x4935('0x3f')][_0x4935('0x63')]()[_0x4935('0x22')](respondWithResult(_0x95da52,null))[_0x4935('0x2d')](handleError(_0x95da52,null));};exports[_0x4935('0x64')]=function(_0x225a1a,_0x3a427c,_0x4824fd){if(_0x225a1a['body']['id']){delete _0x225a1a[_0x4935('0x62')]['id'];}return db[_0x4935('0x3f')]['find']({'where':{'id':_0x225a1a[_0x4935('0x58')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x3a427c,null))['then'](function(_0x4c5cdc){if(_0x4c5cdc){_0x225a1a[_0x4935('0x62')][_0x4935('0x65')]=_0x4c5cdc['id'];return db[_0x4935('0x66')][_0x4935('0x5b')](_0x225a1a[_0x4935('0x62')]);}})['then'](respondWithResult(_0x3a427c,null))[_0x4935('0x2d')](handleError(_0x3a427c,null));};exports[_0x4935('0x67')]=function(_0x26bbe,_0x15232f,_0x583964){var _0xd97c04={'raw':![],'where':{}};var _0x4c235f={};var _0x54be3b={'count':0x0,'rows':[]};return db[_0x4935('0x3f')][_0x4935('0x68')]({'where':{'id':_0x26bbe['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x15232f,null))[_0x4935('0x22')](function(_0xfa309e){if(_0xfa309e){_0x4c235f['model']=_[_0x4935('0x45')](db['Disposition']['rawAttributes']);_0x4c235f[_0x4935('0x44')]=_[_0x4935('0x45')](_0x26bbe[_0x4935('0x44')]);_0x4c235f[_0x4935('0x4e')]=_[_0x4935('0x46')](_0x4c235f[_0x4935('0x43')],_0x4c235f[_0x4935('0x44')]);_0xd97c04[_0x4935('0x47')]=_['intersection'](_0x4c235f[_0x4935('0x43')],qs[_0x4935('0x48')](_0x26bbe[_0x4935('0x44')]['fields']));_0xd97c04['attributes']=_0xd97c04[_0x4935('0x47')][_0x4935('0x69')]?_0xd97c04['attributes']:_0x4c235f[_0x4935('0x43')];if(!_0x26bbe['query']['hasOwnProperty'](_0x4935('0x49'))){_0xd97c04[_0x4935('0x4a')]=qs[_0x4935('0x4a')](_0x26bbe['query']['limit']);_0xd97c04[_0x4935('0x31')]=qs['offset'](_0x26bbe[_0x4935('0x44')]['offset']);}_0xd97c04[_0x4935('0x4b')]=qs[_0x4935('0x4c')](_0x26bbe[_0x4935('0x44')][_0x4935('0x4c')]);_0xd97c04[_0x4935('0x4d')]=qs[_0x4935('0x4e')](_[_0x4935('0x4f')](_0x26bbe['query'],_0x4c235f[_0x4935('0x4e')]));_0xd97c04['where'][_0x4935('0x65')]=_0xfa309e['id'];if(_0x26bbe[_0x4935('0x44')]['filter']){_0xd97c04[_0x4935('0x4d')]=_['merge'](_0xd97c04[_0x4935('0x4d')],{'$or':_[_0x4935('0x3e')](_0xd97c04['attributes'],function(_0x582a2c){var _0x530e9f={};_0x530e9f[_0x582a2c]={'$like':'%'+_0x26bbe[_0x4935('0x44')]['filter']+'%'};return _0x530e9f;})});}_0xd97c04=_['merge']({},_0xd97c04,_0x26bbe[_0x4935('0x53')]);return db['Disposition'][_0x4935('0x30')]({'where':_0xd97c04['where']})['then'](function(_0x5c5978){_0x54be3b[_0x4935('0x30')]=_0x5c5978;if(_0x26bbe['query'][_0x4935('0x54')]){_0xd97c04[_0x4935('0x55')]=[{'all':!![]}];}return db[_0x4935('0x66')][_0x4935('0x56')](_0xd97c04);})[_0x4935('0x22')](function(_0x4a240b){_0x54be3b[_0x4935('0x57')]=_0x4a240b;return _0x54be3b;});}})[_0x4935('0x22')](respondWithFilteredResult(_0x15232f,_0xd97c04))['catch'](handleError(_0x15232f,null));};exports[_0x4935('0x6a')]=function(_0x9d01a9,_0x50df2a,_0x1ffef1){return db[_0x4935('0x3f')]['find']({'where':{'id':_0x9d01a9[_0x4935('0x58')]['id']}})['then'](handleEntityNotFound(_0x50df2a,null))[_0x4935('0x22')](function(_0x453bb1){if(_0x453bb1){return _0x453bb1['removeDispositions'](_0x9d01a9[_0x4935('0x44')][_0x4935('0x6b')]);}})['then'](respondWithStatusCode(_0x50df2a,null))['catch'](handleError(_0x50df2a,null));};exports[_0x4935('0x6c')]=function(_0x14dbfa,_0x49a767,_0x27ce22){if(_0x14dbfa[_0x4935('0x62')]['id']){delete _0x14dbfa[_0x4935('0x62')]['id'];}return db[_0x4935('0x3f')]['find']({'where':{'id':_0x14dbfa[_0x4935('0x58')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x49a767,null))['then'](function(_0x2f7897){if(_0x2f7897){_0x14dbfa[_0x4935('0x62')][_0x4935('0x65')]=_0x2f7897['id'];return db[_0x4935('0x6d')][_0x4935('0x5b')](_0x14dbfa[_0x4935('0x62')]);}})[_0x4935('0x22')](respondWithResult(_0x49a767,null))[_0x4935('0x2d')](handleError(_0x49a767,null));};exports[_0x4935('0x6e')]=function(_0x2978d7,_0x34f3d4,_0x50a14b){var _0x394367={'raw':![],'where':{}};var _0x3e8e54={};var _0x1e6d84={'count':0x0,'rows':[]};return db[_0x4935('0x3f')][_0x4935('0x68')]({'where':{'id':_0x2978d7['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x34f3d4,null))[_0x4935('0x22')](function(_0x4b9b39){if(_0x4b9b39){_0x3e8e54[_0x4935('0x43')]=_[_0x4935('0x45')](db['CannedAnswer'][_0x4935('0x59')]);_0x3e8e54[_0x4935('0x44')]=_[_0x4935('0x45')](_0x2978d7['query']);_0x3e8e54[_0x4935('0x4e')]=_[_0x4935('0x46')](_0x3e8e54[_0x4935('0x43')],_0x3e8e54[_0x4935('0x44')]);_0x394367[_0x4935('0x47')]=_['intersection'](_0x3e8e54[_0x4935('0x43')],qs[_0x4935('0x48')](_0x2978d7[_0x4935('0x44')][_0x4935('0x48')]));_0x394367[_0x4935('0x47')]=_0x394367[_0x4935('0x47')]['length']?_0x394367[_0x4935('0x47')]:_0x3e8e54[_0x4935('0x43')];if(!_0x2978d7[_0x4935('0x44')][_0x4935('0x6f')](_0x4935('0x49'))){_0x394367[_0x4935('0x4a')]=qs[_0x4935('0x4a')](_0x2978d7['query'][_0x4935('0x4a')]);_0x394367[_0x4935('0x31')]=qs[_0x4935('0x31')](_0x2978d7[_0x4935('0x44')][_0x4935('0x31')]);}_0x394367['order']=qs['sort'](_0x2978d7[_0x4935('0x44')][_0x4935('0x4c')]);_0x394367[_0x4935('0x4d')]=qs[_0x4935('0x4e')](_[_0x4935('0x4f')](_0x2978d7['query'],_0x3e8e54[_0x4935('0x4e')]));_0x394367[_0x4935('0x4d')][_0x4935('0x65')]=_0x4b9b39['id'];if(_0x2978d7['query'][_0x4935('0x50')]){_0x394367[_0x4935('0x4d')]=_[_0x4935('0x51')](_0x394367[_0x4935('0x4d')],{'$or':_[_0x4935('0x3e')](_0x394367[_0x4935('0x47')],function(_0xe60fe){var _0x47e1dd={};_0x47e1dd[_0xe60fe]={'$like':'%'+_0x2978d7[_0x4935('0x44')]['filter']+'%'};return _0x47e1dd;})});}_0x394367=_[_0x4935('0x51')]({},_0x394367,_0x2978d7['options']);return db['CannedAnswer'][_0x4935('0x30')]({'where':_0x394367['where']})['then'](function(_0x213fe3){_0x1e6d84[_0x4935('0x30')]=_0x213fe3;if(_0x2978d7['query'][_0x4935('0x54')]){_0x394367['include']=[{'all':!![]}];}return db[_0x4935('0x6d')][_0x4935('0x56')](_0x394367);})[_0x4935('0x22')](function(_0x22a8b8){_0x1e6d84[_0x4935('0x57')]=_0x22a8b8;return _0x1e6d84;});}})[_0x4935('0x22')](respondWithFilteredResult(_0x34f3d4,_0x394367))['catch'](handleError(_0x34f3d4,null));};exports[_0x4935('0x70')]=function(_0x16b1bb,_0xce134a,_0x5d53e6){return db[_0x4935('0x3f')][_0x4935('0x5a')]({'where':{'id':_0x16b1bb[_0x4935('0x58')]['id']}})['then'](handleEntityNotFound(_0xce134a,null))[_0x4935('0x22')](function(_0x44031e){if(_0x44031e){return _0x44031e[_0x4935('0x70')](_0x16b1bb[_0x4935('0x44')][_0x4935('0x6b')]);}})['then'](respondWithStatusCode(_0xce134a,null))[_0x4935('0x2d')](handleError(_0xce134a,null));};exports['addAgents']=function(_0x19fe30,_0x4bc3e7,_0x17dc59){return db['WhatsappAccount'][_0x4935('0x5a')]({'where':{'id':_0x19fe30[_0x4935('0x58')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x4bc3e7,null))['then'](function(_0x31d209){if(_0x31d209){return _0x31d209[_0x4935('0x71')](_0x19fe30[_0x4935('0x62')][_0x4935('0x6b')],_[_0x4935('0x72')](_0x19fe30[_0x4935('0x62')],[_0x4935('0x6b'),'id'])||{})[_0x4935('0x73')](function(_0xc4ce1d){for(var _0x575ca2=0x0;_0x575ca2<_0x19fe30[_0x4935('0x62')][_0x4935('0x6b')][_0x4935('0x69')];_0x575ca2+=0x1){socket[_0x4935('0x74')](_0x4935('0x75'),{'UserId':_0x19fe30[_0x4935('0x62')][_0x4935('0x6b')][_0x575ca2],'WhatsappAccountId':_0x19fe30['params']['id']});}return _0xc4ce1d;});}})['then'](respondWithResult(_0x4bc3e7,null))[_0x4935('0x2d')](handleError(_0x4bc3e7,null));};exports['removeAgents']=function(_0x47ee06,_0x451ea8,_0x3a4266){return db[_0x4935('0x3f')][_0x4935('0x5a')]({'where':{'id':_0x47ee06['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x451ea8,null))[_0x4935('0x22')](function(_0x59e6b4){if(_0x59e6b4){return _0x59e6b4['removeAgents'](_0x47ee06['query']['ids'])['then'](function(){if(_[_0x4935('0x76')](_0x47ee06[_0x4935('0x44')]['ids'])){for(var _0x492bfb=0x0;_0x492bfb<_0x47ee06['query'][_0x4935('0x6b')][_0x4935('0x69')];_0x492bfb+=0x1){socket[_0x4935('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x47ee06['query']['ids'][_0x492bfb]),'WhatsappAccountId':Number(_0x47ee06[_0x4935('0x58')]['id'])});}}else{socket[_0x4935('0x74')](_0x4935('0x77'),{'UserId':Number(_0x47ee06[_0x4935('0x44')]['ids']),'WhatsappAccountId':Number(_0x47ee06[_0x4935('0x58')]['id'])});}});}})[_0x4935('0x22')](respondWithStatusCode(_0x451ea8,null))[_0x4935('0x2d')](handleError(_0x451ea8,null));};exports['getAgents']=function(_0x4f6984,_0x3568ea,_0x2f4b61){var _0x81f969={};var _0x281db3={};var _0x415fc2;var _0x255a60;return db[_0x4935('0x3f')][_0x4935('0x68')]({'where':{'id':_0x4f6984[_0x4935('0x58')]['id']}})['then'](handleEntityNotFound(_0x3568ea,null))[_0x4935('0x22')](function(_0x4120db){if(_0x4120db){_0x415fc2=_0x4120db;_0x281db3['model']=_['keys'](db[_0x4935('0x78')]['rawAttributes']);_0x281db3[_0x4935('0x44')]=_[_0x4935('0x45')](_0x4f6984['query']);_0x281db3[_0x4935('0x4e')]=_['intersection'](_0x281db3[_0x4935('0x43')],_0x281db3[_0x4935('0x44')]);_0x81f969['attributes']=_['intersection'](_0x281db3[_0x4935('0x43')],qs[_0x4935('0x48')](_0x4f6984[_0x4935('0x44')][_0x4935('0x48')]));_0x81f969[_0x4935('0x47')]=_0x81f969[_0x4935('0x47')][_0x4935('0x69')]?_0x81f969[_0x4935('0x47')]:_0x281db3['model'];_0x81f969['order']=qs[_0x4935('0x4c')](_0x4f6984[_0x4935('0x44')][_0x4935('0x4c')]);_0x81f969[_0x4935('0x4d')]=qs[_0x4935('0x4e')](_[_0x4935('0x4f')](_0x4f6984[_0x4935('0x44')],_0x281db3[_0x4935('0x4e')]));if(_0x4f6984['query'][_0x4935('0x50')]){_0x81f969['where']=_[_0x4935('0x51')](_0x81f969['where'],{'$or':_[_0x4935('0x3e')](_0x81f969[_0x4935('0x47')],function(_0x31eaee){var _0x409d86={};_0x409d86[_0x31eaee]={'$like':'%'+_0x4f6984[_0x4935('0x44')]['filter']+'%'};return _0x409d86;})});}_0x81f969=_[_0x4935('0x51')]({},_0x81f969,_0x4f6984[_0x4935('0x53')]);return _0x415fc2[_0x4935('0x79')](_0x81f969);}})['then'](function(_0x4d4085){if(_0x4d4085){_0x255a60=_0x4d4085[_0x4935('0x69')];if(!_0x4f6984['query'][_0x4935('0x6f')](_0x4935('0x49'))){_0x81f969[_0x4935('0x4a')]=qs[_0x4935('0x4a')](_0x4f6984[_0x4935('0x44')]['limit']);_0x81f969[_0x4935('0x31')]=qs[_0x4935('0x31')](_0x4f6984[_0x4935('0x44')][_0x4935('0x31')]);}return _0x415fc2[_0x4935('0x79')](_0x81f969);}})['then'](function(_0x1058f2){if(_0x1058f2){return _0x1058f2?{'count':_0x255a60,'rows':_0x1058f2}:null;}})[_0x4935('0x22')](respondWithResult(_0x3568ea,null))[_0x4935('0x2d')](handleError(_0x3568ea,null));};exports[_0x4935('0x7a')]=function(_0x51a95e,_0x4aa286,_0x5b303b){return db['WhatsappAccount'][_0x4935('0x68')]({'where':{'id':_0x51a95e[_0x4935('0x58')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x4aa286,null))[_0x4935('0x22')](function(_0x13921c){if(_0x13921c){return db[_0x4935('0x7b')][_0x4935('0x7c')](function(_0x9afab9){return db[_0x4935('0x7d')][_0x4935('0x37')]({'where':{'WhatsappAccountId':_0x51a95e['params']['id']},'transaction':_0x9afab9})[_0x4935('0x22')](function(_0x3508ac){var _0x37f88a=_[_0x4935('0x3e')](_0x51a95e[_0x4935('0x62')],function(_0x8ef56f){_0x8ef56f[_0x4935('0x65')]=_0x51a95e[_0x4935('0x58')]['id'];return _0x8ef56f;});return db[_0x4935('0x7d')]['bulkCreate'](_0x37f88a,{'transaction':_0x9afab9});});})['then'](function(){return db[_0x4935('0x7d')][_0x4935('0x7e')]({'where':{'WhatsappAccountId':_0x51a95e[_0x4935('0x58')]['id']},'order':_0x4935('0x7f')});});}})[_0x4935('0x22')](respondWithResult(_0x4aa286,null))[_0x4935('0x2d')](handleError(_0x4aa286,null));};exports[_0x4935('0x80')]=function(_0x15b50e,_0x4c6b62,_0xc2892a){var _0x290e25={};var _0x4f968d={};var _0x46f309;var _0x4bfd8f;return db[_0x4935('0x3f')][_0x4935('0x68')]({'where':{'id':_0x15b50e[_0x4935('0x58')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x4c6b62,null))[_0x4935('0x22')](function(_0x37a095){if(_0x37a095){_0x46f309=_0x37a095;_0x4f968d[_0x4935('0x43')]=_[_0x4935('0x45')](db[_0x4935('0x7d')][_0x4935('0x59')]);_0x4f968d['query']=_[_0x4935('0x45')](_0x15b50e['query']);_0x4f968d[_0x4935('0x4e')]=_[_0x4935('0x46')](_0x4f968d[_0x4935('0x43')],_0x4f968d[_0x4935('0x44')]);_0x290e25[_0x4935('0x47')]=_['intersection'](_0x4f968d[_0x4935('0x43')],qs[_0x4935('0x48')](_0x15b50e[_0x4935('0x44')][_0x4935('0x48')]));_0x290e25[_0x4935('0x47')]=_0x290e25[_0x4935('0x47')][_0x4935('0x69')]?_0x290e25[_0x4935('0x47')]:_0x4f968d[_0x4935('0x43')];_0x290e25[_0x4935('0x4b')]=qs[_0x4935('0x4c')](_0x15b50e[_0x4935('0x44')]['sort']);_0x290e25[_0x4935('0x4d')]=qs[_0x4935('0x4e')](_[_0x4935('0x4f')](_0x15b50e['query'],_0x4f968d[_0x4935('0x4e')]));if(_0x15b50e['query'][_0x4935('0x50')]){_0x290e25[_0x4935('0x4d')]=_[_0x4935('0x51')](_0x290e25[_0x4935('0x4d')],{'$or':_[_0x4935('0x3e')](_0x290e25['attributes'],function(_0x3450d2){var _0x380f3d={};_0x380f3d[_0x3450d2]={'$like':'%'+_0x15b50e[_0x4935('0x44')][_0x4935('0x50')]+'%'};return _0x380f3d;})});}_0x290e25=_['merge']({},_0x290e25,_0x15b50e[_0x4935('0x53')]);return _0x46f309[_0x4935('0x80')](_0x290e25);}})[_0x4935('0x22')](function(_0x44de80){if(_0x44de80){_0x4bfd8f=_0x44de80[_0x4935('0x69')];if(!_0x15b50e[_0x4935('0x44')][_0x4935('0x6f')](_0x4935('0x49'))){_0x290e25['limit']=qs[_0x4935('0x4a')](_0x15b50e[_0x4935('0x44')][_0x4935('0x4a')]);_0x290e25['offset']=qs[_0x4935('0x31')](_0x15b50e[_0x4935('0x44')]['offset']);}return _0x46f309['getApplications'](_0x290e25);}})[_0x4935('0x22')](function(_0x30f6cd){if(_0x30f6cd){return _0x30f6cd?{'count':_0x4bfd8f,'rows':_0x30f6cd}:null;}})[_0x4935('0x22')](respondWithResult(_0x4c6b62,null))['catch'](handleError(_0x4c6b62,null));};exports['notify']=function(_0x4d0fc2,_0x1488f3,_0x8ca869){var _0x215de6={'channel':_0x4935('0x81')};var _0x303e9e=[];var _0x4ccbb7=[];var _0x15c87c={};return db['WhatsappAccount']['find']({'where':{'id':_0x4d0fc2['params']['id']},'include':[{'model':db[_0x4935('0x7d')],'as':_0x4935('0x82')}]})[_0x4935('0x22')](handleEntityNotFound(_0x1488f3,null))['then'](function(_0x384144){_0x215de6[_0x4935('0x83')]=_0x384144;_0x215de6[_0x4935('0x84')]=_['orderBy'](_0x384144[_0x4935('0x82')],[_0x4935('0x7f')],['asc']);if(_0x215de6['account'][_0x4935('0x82')]){delete _0x215de6['account'][_0x4935('0x82')];}return db[_0x4935('0x85')]['describe']();})[_0x4935('0x22')](function(_0x47a116){if(!_0x47a116){throw new db['Sequelize'][(_0x4935('0x20'))](_0x4935('0x86'));}_0x303e9e=_[_0x4935('0x87')](_[_0x4935('0x45')](_0x47a116),[_0x4935('0x88'),_0x4935('0x89')]);_0x4ccbb7=_[_0x4935('0x87')](_['keys'](_0x47a116),[_0x4935('0x88'),'updatedAt',_0x4935('0x8a'),_0x4935('0x8b')]);_0x215de6[_0x4935('0x62')]={'mapKey':_0x4935('0x8c')};if(_0x215de6[_0x4935('0x83')][_0x4935('0x41')]&&_0x215de6['account']['type']===_0x4935('0x8d')){_0x215de6[_0x4935('0x62')][_0x4935('0x8e')]=_0x4d0fc2[_0x4935('0x62')][_0x4935('0x8f')][_0x4935('0x90')]('whatsapp:','');_0x215de6[_0x4935('0x62')][_0x4935('0x62')]=_0x4d0fc2[_0x4935('0x62')]['Body'];_0x215de6['body'][_0x4935('0x91')]=_0x4d0fc2[_0x4935('0x62')][_0x4935('0x92')];}if(_0x215de6[_0x4935('0x62')]['id']){delete _0x215de6['body']['id'];}if(_[_0x4935('0x93')](_0x215de6[_0x4935('0x62')][_0x4935('0x8e')])){throw new db['Sequelize']['ValidationError'](_0x4935('0x94'));}if(_[_0x4935('0x93')](_0x215de6['body']['body'])||_0x215de6[_0x4935('0x62')][_0x4935('0x62')]===''){throw new db[(_0x4935('0x95'))][(_0x4935('0x20'))](_0x4935('0x96'));}if(_[_0x4935('0x93')](_0x215de6['body'][_0x4935('0x97')])){throw new db[(_0x4935('0x95'))][(_0x4935('0x20'))](_0x4935('0x98')+_0x4ccbb7);}if(!_[_0x4935('0x99')](_0x4ccbb7,_0x215de6[_0x4935('0x62')]['mapKey'])){throw new db[(_0x4935('0x95'))][(_0x4935('0x20'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4ccbb7);}_0x15c87c[_0x215de6[_0x4935('0x62')][_0x4935('0x97')]]=_0x215de6[_0x4935('0x62')]['from'];return db[_0x4935('0x9a')]['find']({'where':{'id':_0x215de6[_0x4935('0x83')]['ListId']},'include':[{'model':db[_0x4935('0x85')],'as':'Contacts','where':_0x15c87c,'limit':0x1,'order':[[_0x4935('0x89'),_0x4935('0x9b')]]}]});})[_0x4935('0x22')](handleEntityNotFound(_0x1488f3,null))[_0x4935('0x22')](function(_0x480708){if(_0x480708){_0x215de6[_0x4935('0x9c')]=_[_0x4935('0x72')](_0x480708,[_0x4935('0x9d')]);if(_0x480708[_0x4935('0x9d')][_0x4935('0x69')]){return _0x480708[_0x4935('0x9d')][0x0];}var _0x512e48=_['defaults'](_0x215de6['body'],{'firstName':_0x215de6['body']['from'],'ListId':_0x480708['id']});_0x512e48[_0x215de6[_0x4935('0x62')][_0x4935('0x97')]]=_0x215de6['body'][_0x4935('0x8e')];return db['CmContact'][_0x4935('0x5b')](_0x512e48,{'fields':_0x303e9e,'raw':!![]});}})[_0x4935('0x22')](handleEntityNotFound(_0x1488f3,null))['then'](function(_0x59154b){if(_0x59154b){_0x215de6[_0x4935('0x9e')]=_0x59154b;var _0x9d154a={'ContactId':_0x59154b['id'],'phone':_0x215de6['body']['from'],'WhatsappAccountId':_0x4d0fc2[_0x4935('0x58')]['id']};var _0x5bc89d={'ContactId':_0x59154b['id'],'WhatsappAccountId':_0x4d0fc2[_0x4935('0x58')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x4935('0x5a')]({'where':_0x5bc89d})[_0x4935('0x22')](function(_0x2b47e8){if(_0x2b47e8){return[_0x2b47e8,![]];}return db[_0x4935('0x9f')][_0x4935('0x5b')](_0x9d154a)[_0x4935('0x22')](function(_0x3c61a9){return[_0x3c61a9,!![]];});});}})[_0x4935('0x73')](function(_0x4e1079,_0x48b8f5){_0x215de6[_0x4935('0xa0')]=_0x4e1079[_0x4935('0x5f')]({'plain':!![]});_0x215de6[_0x4935('0xa0')]['created']=![];if(_0x48b8f5){if(_0x215de6['account'][_0x4935('0xa1')]){_0x215de6['applications'][_0x4935('0xa2')]({'id':0x0,'priority':_0x215de6[_0x4935('0x84')][_0x4935('0x69')]+0x1,'app':'close','appdata':_0x4935('0xa3'),'interval':_0x4935('0xa4')});}_0x215de6[_0x4935('0xa0')][_0x4935('0xa5')]=!![];}return db[_0x4935('0xa6')][_0x4935('0x5b')]({'phone':_0x215de6[_0x4935('0x62')][_0x4935('0x8e')],'messageId':_0x215de6[_0x4935('0x62')][_0x4935('0x91')],'body':_0x215de6[_0x4935('0x62')][_0x4935('0x62')],'WhatsappAccountId':_0x4d0fc2[_0x4935('0x58')]['id'],'WhatsappInteractionId':_0x4e1079['id'],'direction':'in','ContactId':_0x4e1079[_0x4935('0xa7')],'AttachmentId':_0x215de6['body'][_0x4935('0xa8')]});})[_0x4935('0x22')](function(_0x445218){_0x215de6[_0x4935('0x2a')]=_0x445218;if(_0x215de6[_0x4935('0xa0')][_0x4935('0xa9')]){return db[_0x4935('0x78')][_0x4935('0x5a')]({'attributes':['id',_0x4935('0x3b')],'where':{'id':_0x215de6[_0x4935('0xa0')][_0x4935('0xa9')]}})[_0x4935('0x22')](function(_0x3a3f21){if(_0x3a3f21){_0x215de6[_0x4935('0x84')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4935('0xaa'),'appdata':_0x3a3f21[_0x4935('0x3b')]+','+(_0x215de6[_0x4935('0x83')][_0x4935('0xab')]||0xa),'interval':_0x4935('0xa4')});}return respondWithRpcPromise(_0x4935('0xac'),_0x4935('0xad'),_0x215de6);});}return respondWithRpcPromise(_0x4935('0xac'),'startRouting',_0x215de6);})['then'](function(_0x4ec0bb){if(_0x4ec0bb){var _0x1e0387=0xc8;var _0xbdfff=_0x4935('0xae');logger['info'](_0x4935('0x25'),_0xbdfff,_0x1e0387,_0x4935('0xaf'));logger[_0x4935('0x24')](_0x4935('0xb0'),_0xbdfff,_0x1e0387,_0x4935('0xaf'),JSON[_0x4935('0x27')](_0x4ec0bb));if(_0x215de6[_0x4935('0x83')]['type']===_0x4935('0x8d')){return _0x1488f3[_0x4935('0x2e')](_0x1e0387)[_0x4935('0xb1')](_0x4935('0xb2'),'text/xml')[_0x4935('0xb3')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x1488f3[_0x4935('0x2e')](_0x1e0387)['json'](_0x4ec0bb);}}})[_0x4935('0x2d')](handleError(_0x1488f3,null));};exports[_0x4935('0xb3')]=function(_0x4d26cc,_0x21d58e,_0x1603a3){var _0x12b0be,_0x80f86f,_0x594ae5;if(_[_0x4935('0x93')](_0x4d26cc[_0x4935('0x62')][_0x4935('0x62')])||_0x4d26cc[_0x4935('0x62')]['body']===''){throw new db[(_0x4935('0x95'))][(_0x4935('0x20'))](_0x4935('0x96'));}if(_[_0x4935('0x93')](_0x4d26cc[_0x4935('0x62')]['to'])){throw new db[(_0x4935('0x95'))][(_0x4935('0x20'))]('to\x20is\x20mandatory');}_0x12b0be=_0x4d26cc[_0x4935('0x62')]['to'];return db[_0x4935('0x3f')]['find']({'where':{'id':_0x4d26cc[_0x4935('0x58')]['id']},'include':[{'model':db[_0x4935('0x9a')],'as':'List','include':[{'model':db[_0x4935('0x85')],'as':_0x4935('0x9d'),'where':{'mobile':_0x12b0be},'limit':0x1,'order':[[_0x4935('0x89'),'DESC']]}]}]})[_0x4935('0x22')](handleEntityNotFound(_0x21d58e,null))[_0x4935('0x22')](function(_0x3414ef){if(_0x3414ef&&_0x3414ef['List']){_0x80f86f=_0x3414ef[_0x4935('0x5f')]({'plain':!![]});if(_0x80f86f[_0x4935('0xb4')]&&_0x80f86f[_0x4935('0xb4')][_0x4935('0x9d')][_0x4935('0x69')]){return _0x80f86f[_0x4935('0xb4')][_0x4935('0x9d')][0x0];}return db[_0x4935('0x85')][_0x4935('0x5b')](_[_0x4935('0x17')](_0x4d26cc[_0x4935('0x62')],{'firstName':_0x12b0be,'mobile':_0x12b0be,'phone':_0x12b0be,'ListId':_0x80f86f['ListId']}));}})[_0x4935('0x22')](handleEntityNotFound(_0x21d58e,null))['then'](function(_0x1f705e){if(_0x1f705e){_0x594ae5=_0x1f705e;return db[_0x4935('0x9f')][_0x4935('0x5a')]({'where':{'ContactId':_0x594ae5['id'],'closed':![],'WhatsappAccountId':_0x80f86f['id']}})[_0x4935('0x22')](function(_0x1ed5c3){if(_0x1ed5c3){return[_0x1ed5c3,![]];}return db['WhatsappInteraction'][_0x4935('0x5b')]({'UserId':_0x4d26cc['user']['id'],'ContactId':_0x594ae5['id'],'WhatsappAccountId':_0x80f86f['id'],'phone':_0x12b0be,'firstMsgDirection':_0x4935('0xb5'),'Messages':[_[_0x4935('0x51')](_0x4d26cc[_0x4935('0x62')],{'read':![],'body':_0x4d26cc[_0x4935('0x62')][_0x4935('0x62')],'phone':_0x12b0be,'WhatsappAccountId':_0x80f86f['id'],'UserId':_0x4d26cc[_0x4935('0x5c')]['id'],'ContactId':_0x594ae5['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x4935('0xb6')}]})[_0x4935('0x22')](function(_0xb8fab5){return[_0xb8fab5,!![]];});});}})[_0x4935('0x73')](function(_0x5a6050,_0x16f8e2){if(_0x16f8e2){return _0x5a6050;}return db['WhatsappMessage']['create'](_[_0x4935('0x51')](_0x4d26cc['body'],{'read':![],'body':_0x4d26cc[_0x4935('0x62')][_0x4935('0x62')],'phone':_0x12b0be,'WhatsappAccountId':_0x80f86f['id'],'WhatsappInteractionId':_0x5a6050['id'],'UserId':_0x4d26cc[_0x4935('0x5c')]['id'],'ContactId':_0x594ae5['id']}))[_0x4935('0x22')](function(_0x37f9b6){_0x5a6050[_0x4935('0xb7')]['Messages']=[];_0x5a6050['dataValues'][_0x4935('0xb6')][_0x4935('0xa2')](_0x37f9b6['dataValues']);return _0x5a6050;});})[_0x4935('0x22')](respondWithResult(_0x21d58e,null))[_0x4935('0x2d')](handleError(_0x21d58e,null));};
\ No newline at end of file
+var _0xd8b0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','code','message','error','sendStatus','end','status','limit','set','apply','reject','save','update','then','get','WhatsappAccounts','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','offset','sort','filter','merge','where','type','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','fields','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','params','describe','addDisposition','getDispositions','findOne','Disposition','order','pick','WhatsappAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','removeAgents','emit','getAgents','User','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','applications','orderBy','account','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','replace','whatsapp:','Body','messageId','MessageSid','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmContact','Contacts','DESC','contact','interaction','created','autoclose','push','close','*,*,*,*','WhatsappMessage','ContactId','UserId','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','json','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','WhatsappInteraction','out','Messages','dataValues','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse'];(function(_0xe770ee,_0x537d4b){var _0x14979b=function(_0x2ae936){while(--_0x2ae936){_0xe770ee['push'](_0xe770ee['shift']());}};_0x14979b(++_0x537d4b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];config[_0x0d8b('0x16')]=_[_0x0d8b('0x17')](config[_0x0d8b('0x16')],{'host':_0x0d8b('0x18'),'port':0x18eb});var socket=require(_0x0d8b('0x19'))(new Redis(config[_0x0d8b('0x16')]));require(_0x0d8b('0x1a'))[_0x0d8b('0x1b')](socket);var jayson=require(_0x0d8b('0x1c'));var client=jayson[_0x0d8b('0x1d')][_0x0d8b('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x2d4e1c,_0x4f6f21,_0x23eb7b){if(_0x23eb7b){var _0xa86349=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa86349[_0x0d8b('0x1f')](_0x4f6f21)){return _0x2d4e1c;}else{throw new db[(_0x0d8b('0x20'))][(_0x0d8b('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2d4e1c;}}function respondWithRpcPromise(_0x106a01,_0x4586c2,_0x2fd0fc,_0x5fecbd){return new BPromise(function(_0x333674,_0x18dd2d){var _0x264b39=_0x5fecbd||client;return _0x264b39[_0x0d8b('0x22')](_0x106a01,_0x2fd0fc)['then'](function(_0x27512e){logger[_0x0d8b('0x23')](_0x0d8b('0x24'),_0x4586c2,_0x0d8b('0x25'));logger[_0x0d8b('0x26')](_0x0d8b('0x27'),_0x4586c2,_0x0d8b('0x25'),JSON[_0x0d8b('0x28')](_0x27512e));if(_0x27512e['error']){if(_0x27512e['error'][_0x0d8b('0x29')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x4586c2,_0x27512e['error'][_0x0d8b('0x2a')]);return _0x18dd2d(_0x27512e[_0x0d8b('0x2b')][_0x0d8b('0x2a')]);}logger[_0x0d8b('0x2b')](_0x0d8b('0x24'),_0x4586c2,_0x27512e[_0x0d8b('0x2b')][_0x0d8b('0x2a')]);return _0x333674(_0x27512e[_0x0d8b('0x2b')][_0x0d8b('0x2a')]);}else{logger['info'](_0x0d8b('0x24'),_0x4586c2,_0x0d8b('0x25'));_0x333674(_0x27512e['result'][_0x0d8b('0x2a')]);}})['catch'](function(_0x3dd149){logger[_0x0d8b('0x2b')](_0x0d8b('0x24'),_0x4586c2,_0x3dd149);_0x18dd2d(_0x3dd149);});});}function respondWithStatusCode(_0x4fe6f9,_0x59a905){_0x59a905=_0x59a905||0xcc;return function(_0x28f639){if(_0x28f639){return _0x4fe6f9[_0x0d8b('0x2c')](_0x59a905);}return _0x4fe6f9['status'](_0x59a905)[_0x0d8b('0x2d')]();};}function respondWithResult(_0x59aa83,_0x1b2b59){_0x1b2b59=_0x1b2b59||0xc8;return function(_0x4b59e5){if(_0x4b59e5){return _0x59aa83[_0x0d8b('0x2e')](_0x1b2b59)['json'](_0x4b59e5);}};}function respondWithFilteredResult(_0x2ab00d,_0x546bf6){return function(_0x3829c6){if(_0x3829c6){var _0x544735=_0x3829c6['count'],_0x3c8887=_0x546bf6['offset'],_0x106e4c=_0x546bf6['offset']+_0x546bf6[_0x0d8b('0x2f')],_0x2c058d;if(_0x106e4c>=_0x544735){_0x106e4c=_0x544735;_0x2c058d=0xc8;}else{_0x2c058d=0xce;}_0x2ab00d['status'](_0x2c058d);return _0x2ab00d[_0x0d8b('0x30')]('Content-Range',_0x3c8887+'-'+_0x106e4c+'/'+_0x544735)['json'](_0x3829c6);}return null;};}function patchUpdates(_0x36017a){return function(_0x1b6920){try{jsonpatch[_0x0d8b('0x31')](_0x1b6920,_0x36017a,!![]);}catch(_0xdeee5d){return BPromise[_0x0d8b('0x32')](_0xdeee5d);}return _0x1b6920[_0x0d8b('0x33')]();};}function saveUpdates(_0x4a99d3,_0x6f93c7){return function(_0x553e03){if(_0x553e03){return _0x553e03[_0x0d8b('0x34')](_0x4a99d3)[_0x0d8b('0x35')](function(_0x4b3ea0){return _0x4b3ea0;});}return null;};}function removeEntity(_0xb18586,_0x23f7f6){return function(_0x18a905){if(_0x18a905){return _0x18a905['destroy']()[_0x0d8b('0x35')](function(){var _0x2c507e=_0x18a905[_0x0d8b('0x36')]({'plain':!![]});var _0x31ceba=_0x0d8b('0x37');return db['UserProfileResource'][_0x0d8b('0x38')]({'where':{'type':_0x31ceba,'resourceId':_0x2c507e['id']}})[_0x0d8b('0x35')](function(){return _0x18a905;});})['then'](function(){_0xb18586[_0x0d8b('0x2e')](0xcc)[_0x0d8b('0x2d')]();});}};}function handleEntityNotFound(_0x188af2,_0x974b9b){return function(_0x373544){if(!_0x373544){_0x188af2['sendStatus'](0x194);}return _0x373544;};}function handleError(_0x497a71,_0x41b4f9){_0x41b4f9=_0x41b4f9||0x1f4;return function(_0x5c2c04){logger['error'](_0x5c2c04[_0x0d8b('0x39')]);if(_0x5c2c04[_0x0d8b('0x3a')]){delete _0x5c2c04[_0x0d8b('0x3a')];}_0x497a71[_0x0d8b('0x2e')](_0x41b4f9)[_0x0d8b('0x3b')](_0x5c2c04);};}exports[_0x0d8b('0x3c')]=function(_0x579324,_0x6e5bab){var _0x6a02ad={'include':[{'model':db[_0x0d8b('0x3d')],'as':_0x0d8b('0x3e')}]},_0x28fd82={},_0xe8fad={'count':0x0,'rows':[]};var _0xf1680e=_['map'](db[_0x0d8b('0x3f')][_0x0d8b('0x40')],function(_0x3fa955){return{'name':_0x3fa955[_0x0d8b('0x41')],'type':_0x3fa955['type'][_0x0d8b('0x42')]};});_0x28fd82['model']=_[_0x0d8b('0x43')](_0xf1680e,_0x0d8b('0x3a'));_0x28fd82[_0x0d8b('0x44')]=_[_0x0d8b('0x45')](_0x579324[_0x0d8b('0x44')]);_0x28fd82[_0x0d8b('0x46')]=_[_0x0d8b('0x47')](_0x28fd82[_0x0d8b('0x48')],_0x28fd82[_0x0d8b('0x44')]);_0x6a02ad[_0x0d8b('0x49')]=_['intersection'](_0x28fd82['model'],qs['fields'](_0x579324['query']['fields']));_0x6a02ad[_0x0d8b('0x49')]=_0x6a02ad[_0x0d8b('0x49')][_0x0d8b('0x4a')]?_0x6a02ad['attributes']:_0x28fd82['model'];if(!_0x579324[_0x0d8b('0x44')][_0x0d8b('0x4b')](_0x0d8b('0x4c'))){_0x6a02ad['limit']=qs[_0x0d8b('0x2f')](_0x579324[_0x0d8b('0x44')]['limit']);_0x6a02ad['offset']=qs[_0x0d8b('0x4d')](_0x579324['query'][_0x0d8b('0x4d')]);}_0x6a02ad['order']=qs['sort'](_0x579324[_0x0d8b('0x44')][_0x0d8b('0x4e')]);_0x6a02ad['where']=qs['filters'](_['pick'](_0x579324['query'],_0x28fd82[_0x0d8b('0x46')]),_0xf1680e);if(_0x579324[_0x0d8b('0x44')][_0x0d8b('0x4f')]){_0x6a02ad['where']=_[_0x0d8b('0x50')](_0x6a02ad[_0x0d8b('0x51')],{'$or':_[_0x0d8b('0x43')](_0xf1680e,function(_0x98a67a){if(_0x98a67a[_0x0d8b('0x52')]!==_0x0d8b('0x53')){var _0x11d22b={};_0x11d22b[_0x98a67a[_0x0d8b('0x3a')]]={'$like':'%'+_0x579324[_0x0d8b('0x44')][_0x0d8b('0x4f')]+'%'};return _0x11d22b;}})});}_0x6a02ad=_[_0x0d8b('0x50')]({},_0x6a02ad,_0x579324[_0x0d8b('0x54')]);var _0x84ef1c={'where':_0x6a02ad[_0x0d8b('0x51')]};return db[_0x0d8b('0x3f')][_0x0d8b('0x55')](_0x84ef1c)[_0x0d8b('0x35')](function(_0x1e162c){_0xe8fad[_0x0d8b('0x55')]=_0x1e162c;if(_0x579324['query'][_0x0d8b('0x56')]){_0x6a02ad['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0x0d8b('0x57')](_0x6a02ad);})[_0x0d8b('0x35')](function(_0x3f943a){_0xe8fad[_0x0d8b('0x58')]=_0x3f943a;return _0xe8fad;})['then'](respondWithFilteredResult(_0x6e5bab,_0x6a02ad))[_0x0d8b('0x59')](handleError(_0x6e5bab,null));};exports[_0x0d8b('0x5a')]=function(_0x386074,_0x241587){var _0x45cd22={'raw':![],'where':{'id':_0x386074['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4cd85a={};_0x4cd85a[_0x0d8b('0x48')]=_[_0x0d8b('0x45')](db['WhatsappAccount']['rawAttributes']);_0x4cd85a[_0x0d8b('0x44')]=_[_0x0d8b('0x45')](_0x386074['query']);_0x4cd85a['filters']=_[_0x0d8b('0x47')](_0x4cd85a[_0x0d8b('0x48')],_0x4cd85a[_0x0d8b('0x44')]);_0x45cd22[_0x0d8b('0x49')]=_[_0x0d8b('0x47')](_0x4cd85a['model'],qs[_0x0d8b('0x5b')](_0x386074[_0x0d8b('0x44')]['fields']));_0x45cd22['attributes']=_0x45cd22[_0x0d8b('0x49')][_0x0d8b('0x4a')]?_0x45cd22['attributes']:_0x4cd85a['model'];if(_0x386074[_0x0d8b('0x44')][_0x0d8b('0x56')]){_0x45cd22[_0x0d8b('0x5c')]=[{'all':!![]}];}_0x45cd22=_[_0x0d8b('0x50')]({},_0x45cd22,_0x386074['options']);return db[_0x0d8b('0x3f')]['find'](_0x45cd22)['then'](handleEntityNotFound(_0x241587,null))[_0x0d8b('0x35')](respondWithResult(_0x241587,null))[_0x0d8b('0x59')](handleError(_0x241587,null));};exports['create']=function(_0x4a8f33,_0x44ed23){return db[_0x0d8b('0x3f')][_0x0d8b('0x5d')](_0x4a8f33[_0x0d8b('0x5e')],{})[_0x0d8b('0x35')](function(_0xb66e76){var _0x3978e5=_0x4a8f33[_0x0d8b('0x5f')]['get']({'plain':!![]});if(!_0x3978e5)throw new Error(_0x0d8b('0x60'));if(_0x3978e5[_0x0d8b('0x61')]===_0x0d8b('0x5f')){var _0x3c7efb=_0xb66e76[_0x0d8b('0x36')]({'plain':!![]});var _0x47104e=_0x0d8b('0x37');return db[_0x0d8b('0x62')][_0x0d8b('0x63')]({'where':{'name':_0x47104e,'userProfileId':_0x3978e5['userProfileId']},'raw':!![]})[_0x0d8b('0x35')](function(_0x451940){if(_0x451940&&_0x451940[_0x0d8b('0x64')]===0x0){return db[_0x0d8b('0x65')][_0x0d8b('0x5d')]({'name':_0x3c7efb['name'],'resourceId':_0x3c7efb['id'],'type':_0x451940[_0x0d8b('0x3a')],'sectionId':_0x451940['id']},{})[_0x0d8b('0x35')](function(){return _0xb66e76;});}else{return _0xb66e76;}})[_0x0d8b('0x59')](function(_0x17a87f){logger[_0x0d8b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17a87f);throw _0x17a87f;});}return _0xb66e76;})['then'](respondWithResult(_0x44ed23,0xc9))[_0x0d8b('0x59')](handleError(_0x44ed23,null));};exports[_0x0d8b('0x34')]=function(_0x3e4a41,_0xbbb520){if(_0x3e4a41['body']['id']){delete _0x3e4a41[_0x0d8b('0x5e')]['id'];}return db[_0x0d8b('0x3f')][_0x0d8b('0x63')]({'where':{'id':_0x3e4a41['params']['id']},'include':[{'model':db[_0x0d8b('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x0d8b('0x35')](handleEntityNotFound(_0xbbb520,null))[_0x0d8b('0x35')](saveUpdates(_0x3e4a41[_0x0d8b('0x5e')],null))[_0x0d8b('0x35')](respondWithResult(_0xbbb520,null))[_0x0d8b('0x59')](handleError(_0xbbb520,null));};exports[_0x0d8b('0x38')]=function(_0x5b5fdb,_0x382d2e){return db['WhatsappAccount'][_0x0d8b('0x63')]({'where':{'id':_0x5b5fdb[_0x0d8b('0x66')]['id']}})[_0x0d8b('0x35')](handleEntityNotFound(_0x382d2e,null))[_0x0d8b('0x35')](removeEntity(_0x382d2e,null))['catch'](handleError(_0x382d2e,null));};exports[_0x0d8b('0x67')]=function(_0x34d01f,_0x1a1ba7){return db[_0x0d8b('0x3f')][_0x0d8b('0x67')]()[_0x0d8b('0x35')](respondWithResult(_0x1a1ba7,null))[_0x0d8b('0x59')](handleError(_0x1a1ba7,null));};exports[_0x0d8b('0x68')]=function(_0x2ce282,_0x34affb,_0x57e39a){if(_0x2ce282['body']['id']){delete _0x2ce282[_0x0d8b('0x5e')]['id'];}return db[_0x0d8b('0x3f')]['find']({'where':{'id':_0x2ce282[_0x0d8b('0x66')]['id']}})['then'](handleEntityNotFound(_0x34affb,null))['then'](function(_0x22ee20){if(_0x22ee20){_0x2ce282[_0x0d8b('0x5e')]['WhatsappAccountId']=_0x22ee20['id'];return db['Disposition'][_0x0d8b('0x5d')](_0x2ce282[_0x0d8b('0x5e')]);}})[_0x0d8b('0x35')](respondWithResult(_0x34affb,null))[_0x0d8b('0x59')](handleError(_0x34affb,null));};exports[_0x0d8b('0x69')]=function(_0x156859,_0x40d265,_0x5b4402){var _0x1ca60c={'raw':![],'where':{}};var _0x5878c2={};var _0x1a203e={'count':0x0,'rows':[]};return db[_0x0d8b('0x3f')][_0x0d8b('0x6a')]({'where':{'id':_0x156859[_0x0d8b('0x66')]['id']}})['then'](handleEntityNotFound(_0x40d265,null))[_0x0d8b('0x35')](function(_0x4a1c4a){if(_0x4a1c4a){_0x5878c2[_0x0d8b('0x48')]=_[_0x0d8b('0x45')](db[_0x0d8b('0x6b')][_0x0d8b('0x40')]);_0x5878c2[_0x0d8b('0x44')]=_[_0x0d8b('0x45')](_0x156859[_0x0d8b('0x44')]);_0x5878c2[_0x0d8b('0x46')]=_[_0x0d8b('0x47')](_0x5878c2[_0x0d8b('0x48')],_0x5878c2['query']);_0x1ca60c[_0x0d8b('0x49')]=_['intersection'](_0x5878c2[_0x0d8b('0x48')],qs[_0x0d8b('0x5b')](_0x156859['query'][_0x0d8b('0x5b')]));_0x1ca60c['attributes']=_0x1ca60c[_0x0d8b('0x49')][_0x0d8b('0x4a')]?_0x1ca60c[_0x0d8b('0x49')]:_0x5878c2[_0x0d8b('0x48')];if(!_0x156859[_0x0d8b('0x44')][_0x0d8b('0x4b')](_0x0d8b('0x4c'))){_0x1ca60c[_0x0d8b('0x2f')]=qs['limit'](_0x156859[_0x0d8b('0x44')][_0x0d8b('0x2f')]);_0x1ca60c['offset']=qs[_0x0d8b('0x4d')](_0x156859[_0x0d8b('0x44')][_0x0d8b('0x4d')]);}_0x1ca60c[_0x0d8b('0x6c')]=qs[_0x0d8b('0x4e')](_0x156859[_0x0d8b('0x44')][_0x0d8b('0x4e')]);_0x1ca60c[_0x0d8b('0x51')]=qs[_0x0d8b('0x46')](_[_0x0d8b('0x6d')](_0x156859[_0x0d8b('0x44')],_0x5878c2[_0x0d8b('0x46')]));_0x1ca60c['where'][_0x0d8b('0x6e')]=_0x4a1c4a['id'];if(_0x156859[_0x0d8b('0x44')][_0x0d8b('0x4f')]){_0x1ca60c['where']=_['merge'](_0x1ca60c[_0x0d8b('0x51')],{'$or':_[_0x0d8b('0x43')](_0x1ca60c[_0x0d8b('0x49')],function(_0x5b76af){var _0x5bd5c8={};_0x5bd5c8[_0x5b76af]={'$like':'%'+_0x156859[_0x0d8b('0x44')][_0x0d8b('0x4f')]+'%'};return _0x5bd5c8;})});}_0x1ca60c=_[_0x0d8b('0x50')]({},_0x1ca60c,_0x156859[_0x0d8b('0x54')]);return db[_0x0d8b('0x6b')][_0x0d8b('0x55')]({'where':_0x1ca60c[_0x0d8b('0x51')]})[_0x0d8b('0x35')](function(_0x20a3dd){_0x1a203e[_0x0d8b('0x55')]=_0x20a3dd;if(_0x156859[_0x0d8b('0x44')][_0x0d8b('0x56')]){_0x1ca60c[_0x0d8b('0x5c')]=[{'all':!![]}];}return db['Disposition'][_0x0d8b('0x57')](_0x1ca60c);})[_0x0d8b('0x35')](function(_0x48c965){_0x1a203e['rows']=_0x48c965;return _0x1a203e;});}})[_0x0d8b('0x35')](respondWithFilteredResult(_0x40d265,_0x1ca60c))[_0x0d8b('0x59')](handleError(_0x40d265,null));};exports[_0x0d8b('0x6f')]=function(_0x14b1b8,_0x23e2e0,_0x354208){return db['WhatsappAccount']['find']({'where':{'id':_0x14b1b8['params']['id']}})[_0x0d8b('0x35')](handleEntityNotFound(_0x23e2e0,null))[_0x0d8b('0x35')](function(_0x466442){if(_0x466442){return _0x466442[_0x0d8b('0x6f')](_0x14b1b8[_0x0d8b('0x44')][_0x0d8b('0x70')]);}})['then'](respondWithStatusCode(_0x23e2e0,null))[_0x0d8b('0x59')](handleError(_0x23e2e0,null));};exports[_0x0d8b('0x71')]=function(_0x4b3363,_0x30a69d,_0x57e3c2){if(_0x4b3363[_0x0d8b('0x5e')]['id']){delete _0x4b3363[_0x0d8b('0x5e')]['id'];}return db[_0x0d8b('0x3f')][_0x0d8b('0x63')]({'where':{'id':_0x4b3363[_0x0d8b('0x66')]['id']}})[_0x0d8b('0x35')](handleEntityNotFound(_0x30a69d,null))[_0x0d8b('0x35')](function(_0xb73e32){if(_0xb73e32){_0x4b3363[_0x0d8b('0x5e')][_0x0d8b('0x6e')]=_0xb73e32['id'];return db[_0x0d8b('0x72')][_0x0d8b('0x5d')](_0x4b3363['body']);}})['then'](respondWithResult(_0x30a69d,null))[_0x0d8b('0x59')](handleError(_0x30a69d,null));};exports[_0x0d8b('0x73')]=function(_0xb4cb89,_0x165ca6,_0xf91ecd){var _0x3c659e={'raw':![],'where':{}};var _0xeadc0c={};var _0x54674f={'count':0x0,'rows':[]};return db[_0x0d8b('0x3f')]['findOne']({'where':{'id':_0xb4cb89[_0x0d8b('0x66')]['id']}})['then'](handleEntityNotFound(_0x165ca6,null))['then'](function(_0x21a914){if(_0x21a914){_0xeadc0c[_0x0d8b('0x48')]=_[_0x0d8b('0x45')](db[_0x0d8b('0x72')][_0x0d8b('0x40')]);_0xeadc0c[_0x0d8b('0x44')]=_[_0x0d8b('0x45')](_0xb4cb89[_0x0d8b('0x44')]);_0xeadc0c[_0x0d8b('0x46')]=_[_0x0d8b('0x47')](_0xeadc0c[_0x0d8b('0x48')],_0xeadc0c[_0x0d8b('0x44')]);_0x3c659e['attributes']=_[_0x0d8b('0x47')](_0xeadc0c[_0x0d8b('0x48')],qs[_0x0d8b('0x5b')](_0xb4cb89['query']['fields']));_0x3c659e[_0x0d8b('0x49')]=_0x3c659e[_0x0d8b('0x49')][_0x0d8b('0x4a')]?_0x3c659e[_0x0d8b('0x49')]:_0xeadc0c[_0x0d8b('0x48')];if(!_0xb4cb89[_0x0d8b('0x44')]['hasOwnProperty'](_0x0d8b('0x4c'))){_0x3c659e[_0x0d8b('0x2f')]=qs[_0x0d8b('0x2f')](_0xb4cb89[_0x0d8b('0x44')][_0x0d8b('0x2f')]);_0x3c659e['offset']=qs['offset'](_0xb4cb89[_0x0d8b('0x44')][_0x0d8b('0x4d')]);}_0x3c659e[_0x0d8b('0x6c')]=qs['sort'](_0xb4cb89[_0x0d8b('0x44')][_0x0d8b('0x4e')]);_0x3c659e[_0x0d8b('0x51')]=qs['filters'](_[_0x0d8b('0x6d')](_0xb4cb89[_0x0d8b('0x44')],_0xeadc0c[_0x0d8b('0x46')]));_0x3c659e[_0x0d8b('0x51')][_0x0d8b('0x6e')]=_0x21a914['id'];if(_0xb4cb89[_0x0d8b('0x44')][_0x0d8b('0x4f')]){_0x3c659e[_0x0d8b('0x51')]=_[_0x0d8b('0x50')](_0x3c659e['where'],{'$or':_[_0x0d8b('0x43')](_0x3c659e[_0x0d8b('0x49')],function(_0x499e9f){var _0x455a08={};_0x455a08[_0x499e9f]={'$like':'%'+_0xb4cb89[_0x0d8b('0x44')][_0x0d8b('0x4f')]+'%'};return _0x455a08;})});}_0x3c659e=_[_0x0d8b('0x50')]({},_0x3c659e,_0xb4cb89[_0x0d8b('0x54')]);return db[_0x0d8b('0x72')]['count']({'where':_0x3c659e['where']})[_0x0d8b('0x35')](function(_0x3c6ae1){_0x54674f[_0x0d8b('0x55')]=_0x3c6ae1;if(_0xb4cb89[_0x0d8b('0x44')]['includeAll']){_0x3c659e[_0x0d8b('0x5c')]=[{'all':!![]}];}return db[_0x0d8b('0x72')]['findAll'](_0x3c659e);})[_0x0d8b('0x35')](function(_0x4e1b5b){_0x54674f[_0x0d8b('0x58')]=_0x4e1b5b;return _0x54674f;});}})[_0x0d8b('0x35')](respondWithFilteredResult(_0x165ca6,_0x3c659e))[_0x0d8b('0x59')](handleError(_0x165ca6,null));};exports[_0x0d8b('0x74')]=function(_0x36a82f,_0x12c39a,_0x242e6c){return db[_0x0d8b('0x3f')]['find']({'where':{'id':_0x36a82f[_0x0d8b('0x66')]['id']}})['then'](handleEntityNotFound(_0x12c39a,null))['then'](function(_0x35bd36){if(_0x35bd36){return _0x35bd36['removeAnswers'](_0x36a82f[_0x0d8b('0x44')][_0x0d8b('0x70')]);}})['then'](respondWithStatusCode(_0x12c39a,null))[_0x0d8b('0x59')](handleError(_0x12c39a,null));};exports['addAgents']=function(_0x5f3f6f,_0x456642,_0x52c895){return db[_0x0d8b('0x3f')][_0x0d8b('0x63')]({'where':{'id':_0x5f3f6f[_0x0d8b('0x66')]['id']}})['then'](handleEntityNotFound(_0x456642,null))['then'](function(_0x32a60d){if(_0x32a60d){return _0x32a60d[_0x0d8b('0x75')](_0x5f3f6f[_0x0d8b('0x5e')][_0x0d8b('0x70')],_[_0x0d8b('0x76')](_0x5f3f6f[_0x0d8b('0x5e')],[_0x0d8b('0x70'),'id'])||{})[_0x0d8b('0x77')](function(_0x4e3dd1){for(var _0x5ab046=0x0;_0x5ab046<_0x5f3f6f[_0x0d8b('0x5e')][_0x0d8b('0x70')]['length'];_0x5ab046+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':_0x5f3f6f[_0x0d8b('0x5e')][_0x0d8b('0x70')][_0x5ab046],'WhatsappAccountId':_0x5f3f6f[_0x0d8b('0x66')]['id']});}return _0x4e3dd1;});}})['then'](respondWithResult(_0x456642,null))[_0x0d8b('0x59')](handleError(_0x456642,null));};exports[_0x0d8b('0x78')]=function(_0x16afb8,_0x4e428d,_0x3c7f16){return db['WhatsappAccount'][_0x0d8b('0x63')]({'where':{'id':_0x16afb8['params']['id']}})[_0x0d8b('0x35')](handleEntityNotFound(_0x4e428d,null))[_0x0d8b('0x35')](function(_0x43be3c){if(_0x43be3c){return _0x43be3c[_0x0d8b('0x78')](_0x16afb8[_0x0d8b('0x44')]['ids'])[_0x0d8b('0x35')](function(){if(_['isArray'](_0x16afb8[_0x0d8b('0x44')]['ids'])){for(var _0x165baa=0x0;_0x165baa<_0x16afb8['query']['ids'][_0x0d8b('0x4a')];_0x165baa+=0x1){socket[_0x0d8b('0x79')]('userWhatsappAccount:remove',{'UserId':Number(_0x16afb8[_0x0d8b('0x44')][_0x0d8b('0x70')][_0x165baa]),'WhatsappAccountId':Number(_0x16afb8[_0x0d8b('0x66')]['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x16afb8['query'][_0x0d8b('0x70')]),'WhatsappAccountId':Number(_0x16afb8[_0x0d8b('0x66')]['id'])});}});}})[_0x0d8b('0x35')](respondWithStatusCode(_0x4e428d,null))[_0x0d8b('0x59')](handleError(_0x4e428d,null));};exports[_0x0d8b('0x7a')]=function(_0x2a8e14,_0x1d3817,_0x123b77){var _0xa17410={};var _0xba602f={};var _0x4dc5bd;var _0x2e7343;return db[_0x0d8b('0x3f')][_0x0d8b('0x6a')]({'where':{'id':_0x2a8e14['params']['id']}})[_0x0d8b('0x35')](handleEntityNotFound(_0x1d3817,null))[_0x0d8b('0x35')](function(_0x13bce2){if(_0x13bce2){_0x4dc5bd=_0x13bce2;_0xba602f[_0x0d8b('0x48')]=_[_0x0d8b('0x45')](db[_0x0d8b('0x7b')][_0x0d8b('0x40')]);_0xba602f[_0x0d8b('0x44')]=_[_0x0d8b('0x45')](_0x2a8e14[_0x0d8b('0x44')]);_0xba602f[_0x0d8b('0x46')]=_[_0x0d8b('0x47')](_0xba602f['model'],_0xba602f[_0x0d8b('0x44')]);_0xa17410[_0x0d8b('0x49')]=_[_0x0d8b('0x47')](_0xba602f[_0x0d8b('0x48')],qs['fields'](_0x2a8e14['query'][_0x0d8b('0x5b')]));_0xa17410[_0x0d8b('0x49')]=_0xa17410[_0x0d8b('0x49')]['length']?_0xa17410['attributes']:_0xba602f['model'];_0xa17410[_0x0d8b('0x6c')]=qs['sort'](_0x2a8e14[_0x0d8b('0x44')][_0x0d8b('0x4e')]);_0xa17410[_0x0d8b('0x51')]=qs[_0x0d8b('0x46')](_[_0x0d8b('0x6d')](_0x2a8e14[_0x0d8b('0x44')],_0xba602f[_0x0d8b('0x46')]));if(_0x2a8e14[_0x0d8b('0x44')]['filter']){_0xa17410[_0x0d8b('0x51')]=_[_0x0d8b('0x50')](_0xa17410[_0x0d8b('0x51')],{'$or':_[_0x0d8b('0x43')](_0xa17410['attributes'],function(_0x3b4a92){var _0x62fedf={};_0x62fedf[_0x3b4a92]={'$like':'%'+_0x2a8e14[_0x0d8b('0x44')][_0x0d8b('0x4f')]+'%'};return _0x62fedf;})});}_0xa17410=_['merge']({},_0xa17410,_0x2a8e14[_0x0d8b('0x54')]);return _0x4dc5bd[_0x0d8b('0x7a')](_0xa17410);}})[_0x0d8b('0x35')](function(_0x127d6b){if(_0x127d6b){_0x2e7343=_0x127d6b['length'];if(!_0x2a8e14[_0x0d8b('0x44')]['hasOwnProperty'](_0x0d8b('0x4c'))){_0xa17410['limit']=qs[_0x0d8b('0x2f')](_0x2a8e14['query'][_0x0d8b('0x2f')]);_0xa17410['offset']=qs[_0x0d8b('0x4d')](_0x2a8e14['query'][_0x0d8b('0x4d')]);}return _0x4dc5bd['getAgents'](_0xa17410);}})[_0x0d8b('0x35')](function(_0x5ebfe0){if(_0x5ebfe0){return _0x5ebfe0?{'count':_0x2e7343,'rows':_0x5ebfe0}:null;}})[_0x0d8b('0x35')](respondWithResult(_0x1d3817,null))[_0x0d8b('0x59')](handleError(_0x1d3817,null));};exports['addApplications']=function(_0x4ea6fb,_0x4cff45,_0x42b956){return db['WhatsappAccount'][_0x0d8b('0x6a')]({'where':{'id':_0x4ea6fb['params']['id']}})[_0x0d8b('0x35')](handleEntityNotFound(_0x4cff45,null))[_0x0d8b('0x35')](function(_0x120350){if(_0x120350){return db[_0x0d8b('0x7c')][_0x0d8b('0x7d')](function(_0x3d5e21){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x4ea6fb[_0x0d8b('0x66')]['id']},'transaction':_0x3d5e21})['then'](function(_0xf3c16a){var _0x28393f=_[_0x0d8b('0x43')](_0x4ea6fb['body'],function(_0x47251c){_0x47251c['WhatsappAccountId']=_0x4ea6fb[_0x0d8b('0x66')]['id'];return _0x47251c;});return db[_0x0d8b('0x7e')][_0x0d8b('0x7f')](_0x28393f,{'transaction':_0x3d5e21});});})[_0x0d8b('0x35')](function(){return db['WhatsappApplication'][_0x0d8b('0x80')]({'where':{'WhatsappAccountId':_0x4ea6fb[_0x0d8b('0x66')]['id']},'order':_0x0d8b('0x81')});});}})['then'](respondWithResult(_0x4cff45,null))[_0x0d8b('0x59')](handleError(_0x4cff45,null));};exports['getApplications']=function(_0x3a2d0e,_0x28868a,_0x2c00b6){var _0xfc414a={};var _0x19f64c={};var _0x2f4cfd;var _0x278b23;return db[_0x0d8b('0x3f')][_0x0d8b('0x6a')]({'where':{'id':_0x3a2d0e[_0x0d8b('0x66')]['id']}})[_0x0d8b('0x35')](handleEntityNotFound(_0x28868a,null))[_0x0d8b('0x35')](function(_0x50b987){if(_0x50b987){_0x2f4cfd=_0x50b987;_0x19f64c[_0x0d8b('0x48')]=_[_0x0d8b('0x45')](db['WhatsappApplication'][_0x0d8b('0x40')]);_0x19f64c['query']=_[_0x0d8b('0x45')](_0x3a2d0e['query']);_0x19f64c[_0x0d8b('0x46')]=_['intersection'](_0x19f64c['model'],_0x19f64c[_0x0d8b('0x44')]);_0xfc414a[_0x0d8b('0x49')]=_['intersection'](_0x19f64c['model'],qs['fields'](_0x3a2d0e['query'][_0x0d8b('0x5b')]));_0xfc414a[_0x0d8b('0x49')]=_0xfc414a[_0x0d8b('0x49')][_0x0d8b('0x4a')]?_0xfc414a[_0x0d8b('0x49')]:_0x19f64c[_0x0d8b('0x48')];_0xfc414a[_0x0d8b('0x6c')]=qs[_0x0d8b('0x4e')](_0x3a2d0e['query'][_0x0d8b('0x4e')]);_0xfc414a['where']=qs[_0x0d8b('0x46')](_['pick'](_0x3a2d0e[_0x0d8b('0x44')],_0x19f64c[_0x0d8b('0x46')]));if(_0x3a2d0e[_0x0d8b('0x44')][_0x0d8b('0x4f')]){_0xfc414a[_0x0d8b('0x51')]=_[_0x0d8b('0x50')](_0xfc414a[_0x0d8b('0x51')],{'$or':_[_0x0d8b('0x43')](_0xfc414a[_0x0d8b('0x49')],function(_0x2f63fe){var _0x44dac0={};_0x44dac0[_0x2f63fe]={'$like':'%'+_0x3a2d0e[_0x0d8b('0x44')][_0x0d8b('0x4f')]+'%'};return _0x44dac0;})});}_0xfc414a=_['merge']({},_0xfc414a,_0x3a2d0e[_0x0d8b('0x54')]);return _0x2f4cfd['getApplications'](_0xfc414a);}})[_0x0d8b('0x35')](function(_0xd682dc){if(_0xd682dc){_0x278b23=_0xd682dc['length'];if(!_0x3a2d0e[_0x0d8b('0x44')]['hasOwnProperty'](_0x0d8b('0x4c'))){_0xfc414a['limit']=qs[_0x0d8b('0x2f')](_0x3a2d0e[_0x0d8b('0x44')][_0x0d8b('0x2f')]);_0xfc414a[_0x0d8b('0x4d')]=qs[_0x0d8b('0x4d')](_0x3a2d0e[_0x0d8b('0x44')]['offset']);}return _0x2f4cfd[_0x0d8b('0x82')](_0xfc414a);}})['then'](function(_0x4402a0){if(_0x4402a0){return _0x4402a0?{'count':_0x278b23,'rows':_0x4402a0}:null;}})[_0x0d8b('0x35')](respondWithResult(_0x28868a,null))[_0x0d8b('0x59')](handleError(_0x28868a,null));};exports[_0x0d8b('0x83')]=function(_0x831064,_0x5cfca3,_0x15e78b){var _0x22ca75={'channel':'whatsapp'};var _0x1f6044=[];var _0x2edc22=[];var _0x29f6c0={};return db[_0x0d8b('0x3f')]['find']({'where':{'id':_0x831064[_0x0d8b('0x66')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x0d8b('0x84')}]})['then'](handleEntityNotFound(_0x5cfca3,null))[_0x0d8b('0x35')](function(_0x34f234){_0x22ca75['account']=_0x34f234;_0x22ca75[_0x0d8b('0x85')]=_[_0x0d8b('0x86')](_0x34f234[_0x0d8b('0x84')],[_0x0d8b('0x81')],['asc']);if(_0x22ca75[_0x0d8b('0x87')]['Applications']){delete _0x22ca75[_0x0d8b('0x87')][_0x0d8b('0x84')];}return db['CmContact'][_0x0d8b('0x67')]();})[_0x0d8b('0x35')](function(_0x3e8e3c){if(!_0x3e8e3c){throw new db[(_0x0d8b('0x20'))][(_0x0d8b('0x21'))](_0x0d8b('0x88'));}_0x1f6044=_[_0x0d8b('0x89')](_[_0x0d8b('0x45')](_0x3e8e3c),['createdAt',_0x0d8b('0x8a')]);_0x2edc22=_['difference'](_[_0x0d8b('0x45')](_0x3e8e3c),[_0x0d8b('0x8b'),_0x0d8b('0x8a'),_0x0d8b('0x8c'),_0x0d8b('0x8d')]);_0x22ca75[_0x0d8b('0x5e')]={'mapKey':_0x0d8b('0x8e')};if(_0x22ca75[_0x0d8b('0x87')][_0x0d8b('0x52')]&&_0x22ca75['account'][_0x0d8b('0x52')]===_0x0d8b('0x8f')){_0x22ca75['body'][_0x0d8b('0x90')]=_0x831064[_0x0d8b('0x5e')]['From'][_0x0d8b('0x91')](_0x0d8b('0x92'),'');_0x22ca75[_0x0d8b('0x5e')][_0x0d8b('0x5e')]=_0x831064[_0x0d8b('0x5e')][_0x0d8b('0x93')];_0x22ca75[_0x0d8b('0x5e')][_0x0d8b('0x94')]=_0x831064['body'][_0x0d8b('0x95')];}if(_0x22ca75[_0x0d8b('0x5e')]['id']){delete _0x22ca75[_0x0d8b('0x5e')]['id'];}if(_[_0x0d8b('0x96')](_0x22ca75[_0x0d8b('0x5e')][_0x0d8b('0x90')])){throw new db[(_0x0d8b('0x20'))][(_0x0d8b('0x21'))](_0x0d8b('0x97'));}if(_[_0x0d8b('0x96')](_0x22ca75[_0x0d8b('0x5e')]['body'])||_0x22ca75['body']['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0d8b('0x96')](_0x22ca75['body'][_0x0d8b('0x98')])){throw new db[(_0x0d8b('0x20'))][(_0x0d8b('0x21'))](_0x0d8b('0x99')+_0x2edc22);}if(!_[_0x0d8b('0x9a')](_0x2edc22,_0x22ca75[_0x0d8b('0x5e')][_0x0d8b('0x98')])){throw new db[(_0x0d8b('0x20'))][(_0x0d8b('0x21'))](_0x0d8b('0x9b')+_0x2edc22);}_0x29f6c0[_0x22ca75[_0x0d8b('0x5e')][_0x0d8b('0x98')]]=_0x22ca75['body'][_0x0d8b('0x90')];return db['CmList'][_0x0d8b('0x63')]({'where':{'id':_0x22ca75['account'][_0x0d8b('0x8d')]},'include':[{'model':db[_0x0d8b('0x9c')],'as':_0x0d8b('0x9d'),'where':_0x29f6c0,'limit':0x1,'order':[[_0x0d8b('0x8a'),_0x0d8b('0x9e')]]}]});})['then'](handleEntityNotFound(_0x5cfca3,null))[_0x0d8b('0x35')](function(_0x363518){if(_0x363518){_0x22ca75['list']=_[_0x0d8b('0x76')](_0x363518,['Contacts']);if(_0x363518['Contacts'][_0x0d8b('0x4a')]){return _0x363518[_0x0d8b('0x9d')][0x0];}var _0x427369=_[_0x0d8b('0x17')](_0x22ca75[_0x0d8b('0x5e')],{'firstName':_0x22ca75['body']['from'],'ListId':_0x363518['id']});_0x427369[_0x22ca75['body'][_0x0d8b('0x98')]]=_0x22ca75[_0x0d8b('0x5e')][_0x0d8b('0x90')];return db[_0x0d8b('0x9c')][_0x0d8b('0x5d')](_0x427369,{'fields':_0x1f6044,'raw':!![]});}})[_0x0d8b('0x35')](handleEntityNotFound(_0x5cfca3,null))['then'](function(_0x20becd){if(_0x20becd){_0x22ca75[_0x0d8b('0x9f')]=_0x20becd;var _0x591816={'ContactId':_0x20becd['id'],'phone':_0x22ca75[_0x0d8b('0x5e')][_0x0d8b('0x90')],'WhatsappAccountId':_0x831064[_0x0d8b('0x66')]['id']};var _0xfe53a={'ContactId':_0x20becd['id'],'WhatsappAccountId':_0x831064[_0x0d8b('0x66')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0xfe53a})[_0x0d8b('0x35')](function(_0xaf1c9c){if(_0xaf1c9c){return[_0xaf1c9c,![]];}return db['WhatsappInteraction'][_0x0d8b('0x5d')](_0x591816)[_0x0d8b('0x35')](function(_0x3a8bee){return[_0x3a8bee,!![]];});});}})['spread'](function(_0x52f5cc,_0x367c57){_0x22ca75[_0x0d8b('0xa0')]=_0x52f5cc['get']({'plain':!![]});_0x22ca75['interaction'][_0x0d8b('0xa1')]=![];if(_0x367c57){if(_0x22ca75['account'][_0x0d8b('0xa2')]){_0x22ca75['applications'][_0x0d8b('0xa3')]({'id':0x0,'priority':_0x22ca75[_0x0d8b('0x85')]['length']+0x1,'app':_0x0d8b('0xa4'),'appdata':'unmanaged','interval':_0x0d8b('0xa5')});}_0x22ca75[_0x0d8b('0xa0')][_0x0d8b('0xa1')]=!![];}return db[_0x0d8b('0xa6')][_0x0d8b('0x5d')]({'phone':_0x22ca75['body'][_0x0d8b('0x90')],'messageId':_0x22ca75[_0x0d8b('0x5e')][_0x0d8b('0x94')],'body':_0x22ca75['body'][_0x0d8b('0x5e')],'WhatsappAccountId':_0x831064['params']['id'],'WhatsappInteractionId':_0x52f5cc['id'],'direction':'in','ContactId':_0x52f5cc[_0x0d8b('0xa7')],'AttachmentId':_0x22ca75[_0x0d8b('0x5e')]['AttachmentId']});})['then'](function(_0x4b69b6){_0x22ca75[_0x0d8b('0x2a')]=_0x4b69b6;if(_0x22ca75[_0x0d8b('0xa0')]['UserId']){return db[_0x0d8b('0x7b')]['find']({'attributes':['id',_0x0d8b('0x3a')],'where':{'id':_0x22ca75[_0x0d8b('0xa0')][_0x0d8b('0xa8')]}})[_0x0d8b('0x35')](function(_0x2c6aed){if(_0x2c6aed){_0x22ca75[_0x0d8b('0x85')][_0x0d8b('0xa9')]({'id':0x0,'priority':0x0,'app':_0x0d8b('0xaa'),'appdata':_0x2c6aed['name']+','+(_0x22ca75[_0x0d8b('0x87')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x0d8b('0xab'),_0x0d8b('0xac'),_0x22ca75);});}return respondWithRpcPromise(_0x0d8b('0xab'),_0x0d8b('0xac'),_0x22ca75);})[_0x0d8b('0x35')](function(_0x25ec9d){if(_0x25ec9d){var _0x2098ed=0xc8;var _0x567b75=_0x0d8b('0xad');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x567b75,_0x2098ed,_0x0d8b('0xae'));logger['debug'](_0x0d8b('0xaf'),_0x567b75,_0x2098ed,'entity\x20found',JSON['stringify'](_0x25ec9d));if(_0x22ca75[_0x0d8b('0x87')][_0x0d8b('0x52')]===_0x0d8b('0x8f')){return _0x5cfca3[_0x0d8b('0x2e')](_0x2098ed)[_0x0d8b('0x30')](_0x0d8b('0xb0'),'text/xml')['send'](_0x0d8b('0xb1'));}else{return _0x5cfca3[_0x0d8b('0x2e')](_0x2098ed)[_0x0d8b('0xb2')](_0x25ec9d);}}})[_0x0d8b('0x59')](handleError(_0x5cfca3,null));};exports[_0x0d8b('0x3b')]=function(_0x206dfd,_0x12816b,_0x474bca){var _0x13d965,_0x228e6c,_0x26fb03;if(_[_0x0d8b('0x96')](_0x206dfd[_0x0d8b('0x5e')]['body'])||_0x206dfd['body']['body']===''){throw new db[(_0x0d8b('0x20'))][(_0x0d8b('0x21'))](_0x0d8b('0xb3'));}if(_[_0x0d8b('0x96')](_0x206dfd[_0x0d8b('0x5e')]['to'])){throw new db[(_0x0d8b('0x20'))][(_0x0d8b('0x21'))](_0x0d8b('0xb4'));}_0x13d965=_0x206dfd[_0x0d8b('0x5e')]['to'];return db[_0x0d8b('0x3f')][_0x0d8b('0x63')]({'where':{'id':_0x206dfd[_0x0d8b('0x66')]['id']},'include':[{'model':db[_0x0d8b('0xb5')],'as':_0x0d8b('0xb6'),'include':[{'model':db[_0x0d8b('0x9c')],'as':_0x0d8b('0x9d'),'where':{'mobile':_0x13d965},'limit':0x1,'order':[[_0x0d8b('0x8a'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x12816b,null))[_0x0d8b('0x35')](function(_0x4d41ea){if(_0x4d41ea&&_0x4d41ea['List']){_0x228e6c=_0x4d41ea['get']({'plain':!![]});if(_0x228e6c[_0x0d8b('0xb6')]&&_0x228e6c[_0x0d8b('0xb6')][_0x0d8b('0x9d')][_0x0d8b('0x4a')]){return _0x228e6c[_0x0d8b('0xb6')]['Contacts'][0x0];}return db[_0x0d8b('0x9c')][_0x0d8b('0x5d')](_[_0x0d8b('0x17')](_0x206dfd[_0x0d8b('0x5e')],{'firstName':_0x13d965,'mobile':_0x13d965,'phone':_0x13d965,'ListId':_0x228e6c['ListId']}));}})['then'](handleEntityNotFound(_0x12816b,null))[_0x0d8b('0x35')](function(_0x593e46){if(_0x593e46){_0x26fb03=_0x593e46;return db[_0x0d8b('0xb7')][_0x0d8b('0x63')]({'where':{'ContactId':_0x26fb03['id'],'closed':![],'WhatsappAccountId':_0x228e6c['id']}})[_0x0d8b('0x35')](function(_0x32237b){if(_0x32237b){return[_0x32237b,![]];}return db[_0x0d8b('0xb7')][_0x0d8b('0x5d')]({'UserId':_0x206dfd['user']['id'],'ContactId':_0x26fb03['id'],'WhatsappAccountId':_0x228e6c['id'],'phone':_0x13d965,'firstMsgDirection':_0x0d8b('0xb8'),'Messages':[_['merge'](_0x206dfd[_0x0d8b('0x5e')],{'read':![],'body':_0x206dfd[_0x0d8b('0x5e')][_0x0d8b('0x5e')],'phone':_0x13d965,'WhatsappAccountId':_0x228e6c['id'],'UserId':_0x206dfd[_0x0d8b('0x5f')]['id'],'ContactId':_0x26fb03['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})['then'](function(_0x58e346){return[_0x58e346,!![]];});});}})[_0x0d8b('0x77')](function(_0x2f4067,_0x3c4315){if(_0x3c4315){return _0x2f4067;}return db[_0x0d8b('0xa6')][_0x0d8b('0x5d')](_[_0x0d8b('0x50')](_0x206dfd['body'],{'read':![],'body':_0x206dfd['body']['body'],'phone':_0x13d965,'WhatsappAccountId':_0x228e6c['id'],'WhatsappInteractionId':_0x2f4067['id'],'UserId':_0x206dfd['user']['id'],'ContactId':_0x26fb03['id']}))[_0x0d8b('0x35')](function(_0x100c54){_0x2f4067['dataValues'][_0x0d8b('0xb9')]=[];_0x2f4067[_0x0d8b('0xba')][_0x0d8b('0xb9')][_0x0d8b('0xa3')](_0x100c54[_0x0d8b('0xba')]);return _0x2f4067;});})[_0x0d8b('0x35')](respondWithResult(_0x12816b,null))[_0x0d8b('0x59')](handleError(_0x12816b,null));};
\ No newline at end of file
index d101d8d..ff50dfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['save','update','remove','emit','hasOwnProperty','hook','exports','events','WhatsappAccount','setMaxListeners'];(function(_0x2fcf16,_0x344dcb){var _0x54013e=function(_0x167ef3){while(--_0x167ef3){_0x2fcf16['push'](_0x2fcf16['shift']());}};_0x54013e(++_0x344dcb);}(_0x187d,0x93));var _0xd187=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x187d[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xd187('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xd187('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xd187('0x2')](0x0);var events={'afterCreate':_0xd187('0x3'),'afterUpdate':_0xd187('0x4'),'afterDestroy':_0xd187('0x5')};function emitEvent(_0x201b79){return function(_0x58622a,_0x28fa0b,_0x163807){WhatsappAccountEvents['emit'](_0x201b79+':'+_0x58622a['id'],_0x58622a);WhatsappAccountEvents[_0xd187('0x6')](_0x201b79,_0x58622a);_0x163807(null);};}for(var e in events){if(events[_0xd187('0x7')](e)){var event=events[e];WhatsappAccount[_0xd187('0x8')](e,emitEvent(event));}}module[_0xd187('0x9')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0xb934=['hasOwnProperty','hook','events','../../mysqldb','WhatsappAccount','save','update','remove','emit'];(function(_0x5eb78d,_0x326f9b){var _0x2b827b=function(_0x5d1076){while(--_0x5d1076){_0x5eb78d['push'](_0x5eb78d['shift']());}};_0x2b827b(++_0x326f9b);}(_0xb934,0x92));var _0x4b93=function(_0x97e133,_0x4e5180){_0x97e133=_0x97e133-0x0;var _0x45dd44=_0xb934[_0x97e133];return _0x45dd44;};'use strict';var EventEmitter=require(_0x4b93('0x0'));var WhatsappAccount=require(_0x4b93('0x1'))['db'][_0x4b93('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4b93('0x3'),'afterUpdate':_0x4b93('0x4'),'afterDestroy':_0x4b93('0x5')};function emitEvent(_0x2b2930){return function(_0x17c638,_0x50c02e,_0x5e6389){WhatsappAccountEvents[_0x4b93('0x6')](_0x2b2930+':'+_0x17c638['id'],_0x17c638);WhatsappAccountEvents[_0x4b93('0x6')](_0x2b2930,_0x17c638);_0x5e6389(null);};}for(var e in events){if(events[_0x4b93('0x7')](e)){var event=events[e];WhatsappAccount[_0x4b93('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;
\ No newline at end of file
index 3847675..734cba6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0414=['./whatsappAccount.attributes','exports','define','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x442c96,_0x5c2947){var _0x97951d=function(_0xe0cc47){while(--_0xe0cc47){_0x442c96['push'](_0x442c96['shift']());}};_0x97951d(++_0x5c2947);}(_0x0414,0x1cb));var _0x4041=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0x0414[_0x5dc03e];return _0x466a07;};'use strict';var _=require(_0x4041('0x0'));var util=require(_0x4041('0x1'));var logger=require('../../config/logger')(_0x4041('0x2'));var moment=require(_0x4041('0x3'));var BPromise=require(_0x4041('0x4'));var rp=require(_0x4041('0x5'));var fs=require('fs');var path=require(_0x4041('0x6'));var rimraf=require(_0x4041('0x7'));var config=require(_0x4041('0x8'));var attributes=require(_0x4041('0x9'));module[_0x4041('0xa')]=function(_0x1b62d1,_0x543cb2){return _0x1b62d1[_0x4041('0xb')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4de9=['util','moment','bluebird','request-promise','rimraf','exports','WhatsappAccount','whatsapp_accounts','lodash'];(function(_0x8542b4,_0x59a73f){var _0xea4fc1=function(_0x33d176){while(--_0x33d176){_0x8542b4['push'](_0x8542b4['shift']());}};_0xea4fc1(++_0x59a73f);}(_0x4de9,0x15e));var _0x94de=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x4de9[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0x94de('0x0'));var util=require(_0x94de('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x94de('0x2'));var BPromise=require(_0x94de('0x3'));var rp=require(_0x94de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x94de('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0x94de('0x6')]=function(_0x5f49b6,_0x520ccd){return _0x5f49b6['define'](_0x94de('0x7'),attributes,{'tableName':_0x94de('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0454f4f..0e36f8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee0=['client','http','defaults','redis','localhost','socket.io-emitter','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowWhatsappAccount','find','options','attributes','include','model','map','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x4e4b61,_0x40a4a3){var _0x406690=function(_0x14df38){while(--_0x14df38){_0x4e4b61['push'](_0x4e4b61['shift']());}};_0x406690(++_0x40a4a3);}(_0xbee0,0xae));var _0x0bee=function(_0xc7e06,_0x3f0146){_0xc7e06=_0xc7e06-0x0;var _0x3e57c8=_0xbee0[_0xc7e06];return _0x3e57c8;};'use strict';var _=require(_0x0bee('0x0'));var util=require(_0x0bee('0x1'));var moment=require(_0x0bee('0x2'));var BPromise=require(_0x0bee('0x3'));var rs=require(_0x0bee('0x4'));var fs=require('fs');var Redis=require(_0x0bee('0x5'));var db=require(_0x0bee('0x6'))['db'];var utils=require(_0x0bee('0x7'));var logger=require('../../config/logger')(_0x0bee('0x8'));var config=require(_0x0bee('0x9'));var jayson=require(_0x0bee('0xa'));var client=jayson[_0x0bee('0xb')][_0x0bee('0xc')]({'port':0x232a});config['redis']=_[_0x0bee('0xd')](config[_0x0bee('0xe')],{'host':_0x0bee('0xf'),'port':0x18eb});var socket=require(_0x0bee('0x10'))(new Redis(config[_0x0bee('0xe')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x43ba40,_0x119cec,_0x2d7b4f){return new BPromise(function(_0x596948,_0x36a5ac){return client[_0x0bee('0x11')](_0x43ba40,_0x2d7b4f)[_0x0bee('0x12')](function(_0x301fa2){logger[_0x0bee('0x13')](_0x0bee('0x14'),_0x119cec,_0x0bee('0x15'));logger[_0x0bee('0x16')](_0x0bee('0x17'),_0x119cec,_0x0bee('0x15'),JSON['stringify'](_0x301fa2));if(_0x301fa2[_0x0bee('0x18')]){if(_0x301fa2['error'][_0x0bee('0x19')]===0x1f4){logger[_0x0bee('0x18')](_0x0bee('0x14'),_0x119cec,_0x301fa2[_0x0bee('0x18')][_0x0bee('0x1a')]);return _0x36a5ac(_0x301fa2['error'][_0x0bee('0x1a')]);}logger[_0x0bee('0x18')](_0x0bee('0x14'),_0x119cec,_0x301fa2[_0x0bee('0x18')][_0x0bee('0x1a')]);return _0x596948(_0x301fa2[_0x0bee('0x18')][_0x0bee('0x1a')]);}else{logger['info'](_0x0bee('0x14'),_0x119cec,'request\x20sent');_0x596948(_0x301fa2[_0x0bee('0x1b')][_0x0bee('0x1a')]);}})[_0x0bee('0x1c')](function(_0x320f21){logger[_0x0bee('0x18')](_0x0bee('0x14'),_0x119cec,_0x320f21);_0x36a5ac(_0x320f21);});});}exports[_0x0bee('0x1d')]=function(_0x13ee09){var _0x453c25=this;return new Promise(function(_0x19e099,_0x3715de){return db['WhatsappAccount'][_0x0bee('0x1e')]({'raw':_0x13ee09[_0x0bee('0x1f')]?_0x13ee09[_0x0bee('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x13ee09[_0x0bee('0x1f')]?_0x13ee09[_0x0bee('0x1f')]['where']||null:null,'attributes':_0x13ee09[_0x0bee('0x1f')]?_0x13ee09['options'][_0x0bee('0x20')]||null:null,'include':_0x13ee09['options']?_0x13ee09[_0x0bee('0x1f')][_0x0bee('0x21')]?_['map'](_0x13ee09[_0x0bee('0x1f')][_0x0bee('0x21')],function(_0x49274e){return{'model':db[_0x49274e[_0x0bee('0x22')]],'as':_0x49274e['as'],'attributes':_0x49274e[_0x0bee('0x20')],'include':_0x49274e['include']?_[_0x0bee('0x23')](_0x49274e['include'],function(_0xdc3ee3){return{'model':db[_0xdc3ee3['model']],'as':_0xdc3ee3['as'],'attributes':_0xdc3ee3[_0x0bee('0x20')],'include':_0xdc3ee3[_0x0bee('0x21')]?_['map'](_0xdc3ee3[_0x0bee('0x21')],function(_0x4339b4){return{'model':db[_0x4339b4[_0x0bee('0x22')]],'as':_0x4339b4['as'],'attributes':_0x4339b4[_0x0bee('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0bee('0x12')](function(_0x4c221c){logger[_0x0bee('0x13')](_0x0bee('0x1d'),_0x13ee09);logger['debug'](_0x0bee('0x1d'),_0x13ee09,JSON[_0x0bee('0x24')](_0x4c221c));_0x19e099(_0x4c221c);})[_0x0bee('0x1c')](function(_0x3323d6){logger['error'](_0x0bee('0x1d'),_0x3323d6[_0x0bee('0x1a')],_0x13ee09);_0x3715de(_0x453c25['error'](0x1f4,_0x3323d6['message']));});});};
\ No newline at end of file
+var _0x93c1=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','find','options','raw','where','attributes','include','map','model'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x93c1,0x181));var _0x193c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x93c1[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x193c('0x0'));var moment=require(_0x193c('0x1'));var BPromise=require(_0x193c('0x2'));var rs=require(_0x193c('0x3'));var fs=require('fs');var Redis=require(_0x193c('0x4'));var db=require(_0x193c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x193c('0x6'))(_0x193c('0x7'));var config=require(_0x193c('0x8'));var jayson=require(_0x193c('0x9'));var client=jayson[_0x193c('0xa')]['http']({'port':0x232a});config[_0x193c('0xb')]=_[_0x193c('0xc')](config['redis'],{'host':_0x193c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x27c7ca,_0x1795c5,_0x48b16b){return new BPromise(function(_0x12ca80,_0x4091af){return client[_0x193c('0xe')](_0x27c7ca,_0x48b16b)[_0x193c('0xf')](function(_0x17b37f){logger[_0x193c('0x10')](_0x193c('0x11'),_0x1795c5,_0x193c('0x12'));logger[_0x193c('0x13')](_0x193c('0x14'),_0x1795c5,'request\x20sent',JSON[_0x193c('0x15')](_0x17b37f));if(_0x17b37f[_0x193c('0x16')]){if(_0x17b37f['error']['code']===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x1795c5,_0x17b37f[_0x193c('0x16')]['message']);return _0x4091af(_0x17b37f[_0x193c('0x16')][_0x193c('0x17')]);}logger[_0x193c('0x16')](_0x193c('0x11'),_0x1795c5,_0x17b37f[_0x193c('0x16')][_0x193c('0x17')]);return _0x12ca80(_0x17b37f['error'][_0x193c('0x17')]);}else{logger[_0x193c('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x1795c5,_0x193c('0x12'));_0x12ca80(_0x17b37f[_0x193c('0x18')][_0x193c('0x17')]);}})[_0x193c('0x19')](function(_0xf76ea1){logger[_0x193c('0x16')](_0x193c('0x11'),_0x1795c5,_0xf76ea1);_0x4091af(_0xf76ea1);});});}exports[_0x193c('0x1a')]=function(_0x5eb6fc){var _0x59ee7b=this;return new Promise(function(_0xe62a56,_0x1e2ab7){return db['WhatsappAccount'][_0x193c('0x1b')]({'raw':_0x5eb6fc[_0x193c('0x1c')]?_0x5eb6fc[_0x193c('0x1c')][_0x193c('0x1d')]===undefined?!![]:![]:!![],'where':_0x5eb6fc[_0x193c('0x1c')]?_0x5eb6fc['options'][_0x193c('0x1e')]||null:null,'attributes':_0x5eb6fc['options']?_0x5eb6fc[_0x193c('0x1c')][_0x193c('0x1f')]||null:null,'include':_0x5eb6fc[_0x193c('0x1c')]?_0x5eb6fc[_0x193c('0x1c')][_0x193c('0x20')]?_[_0x193c('0x21')](_0x5eb6fc['options'][_0x193c('0x20')],function(_0x43cf2c){return{'model':db[_0x43cf2c[_0x193c('0x22')]],'as':_0x43cf2c['as'],'attributes':_0x43cf2c[_0x193c('0x1f')],'include':_0x43cf2c[_0x193c('0x20')]?_[_0x193c('0x21')](_0x43cf2c[_0x193c('0x20')],function(_0x44869b){return{'model':db[_0x44869b['model']],'as':_0x44869b['as'],'attributes':_0x44869b['attributes'],'include':_0x44869b[_0x193c('0x20')]?_[_0x193c('0x21')](_0x44869b['include'],function(_0x30dcdd){return{'model':db[_0x30dcdd['model']],'as':_0x30dcdd['as'],'attributes':_0x30dcdd[_0x193c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11cf2a){logger[_0x193c('0x10')](_0x193c('0x1a'),_0x5eb6fc);logger[_0x193c('0x13')](_0x193c('0x1a'),_0x5eb6fc,JSON[_0x193c('0x15')](_0x11cf2a));_0xe62a56(_0x11cf2a);})[_0x193c('0x19')](function(_0x363878){logger[_0x193c('0x16')]('ShowWhatsappAccount',_0x363878['message'],_0x5eb6fc);_0x1e2ab7(_0x59ee7b[_0x193c('0x16')](0x1f4,_0x363878[_0x193c('0x17')]));});});};
\ No newline at end of file
index 42bfb2e..63543a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9b0=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','remove','emit'];(function(_0x7841f9,_0x227504){var _0x2d8151=function(_0x144fd0){while(--_0x144fd0){_0x7841f9['push'](_0x7841f9['shift']());}};_0x2d8151(++_0x227504);}(_0xa9b0,0x13f));var _0x0a9b=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xa9b0[_0x82129b];return _0x2ae5dc;};'use strict';var WhatsappAccountEvents=require(_0x0a9b('0x0'));var events=['save',_0x0a9b('0x1'),'update'];function createListener(_0x2ecdc0,_0x3a1553){return function(_0x3299ce){_0x3a1553[_0x0a9b('0x2')](_0x2ecdc0,_0x3299ce);};}function removeListener(_0x220a76,_0x32f369){return function(){WhatsappAccountEvents[_0x0a9b('0x3')](_0x220a76,_0x32f369);};}exports[_0x0a9b('0x4')]=function(_0x16c6a4){for(var _0x5def20=0x0,_0x3fbbfb=events[_0x0a9b('0x5')];_0x5def20<_0x3fbbfb;_0x5def20++){var _0x54ac96=events[_0x5def20];var _0x320ecd=createListener(_0x0a9b('0x6')+_0x54ac96,_0x16c6a4);WhatsappAccountEvents['on'](_0x54ac96,_0x320ecd);}};
\ No newline at end of file
+var _0x0f1e=['length','./whatsappAccount.events','emit','removeListener','register'];(function(_0x4475a8,_0x51d1f4){var _0x4cc5b2=function(_0x1fd375){while(--_0x1fd375){_0x4475a8['push'](_0x4475a8['shift']());}};_0x4cc5b2(++_0x51d1f4);}(_0x0f1e,0x1dc));var _0xe0f1=function(_0x538ae7,_0x2defb1){_0x538ae7=_0x538ae7-0x0;var _0x70f194=_0x0f1e[_0x538ae7];return _0x70f194;};'use strict';var WhatsappAccountEvents=require(_0xe0f1('0x0'));var events=['save','remove','update'];function createListener(_0x330482,_0x196dc5){return function(_0x4bfa23){_0x196dc5[_0xe0f1('0x1')](_0x330482,_0x4bfa23);};}function removeListener(_0xeb99f3,_0x21bccf){return function(){WhatsappAccountEvents[_0xe0f1('0x2')](_0xeb99f3,_0x21bccf);};}exports[_0xe0f1('0x3')]=function(_0x8f0576){for(var _0x35d8ec=0x0,_0x1bdfbb=events[_0xe0f1('0x4')];_0x35d8ec<_0x1bdfbb;_0x35d8ec++){var _0x54dcbe=events[_0x35d8ec];var _0x3cc936=createListener('whatsappAccount:'+_0x54dcbe,_0x8f0576);WhatsappAccountEvents['on'](_0x54dcbe,_0x3cc936);}};
\ No newline at end of file
index e7452fd..138ab04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27de=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x41daa3,_0x27f14f){var _0x9d8d5a=function(_0x4bc598){while(--_0x4bc598){_0x41daa3['push'](_0x41daa3['shift']());}};_0x9d8d5a(++_0x27f14f);}(_0x27de,0x160));var _0xe27d=function(_0x34d0f6,_0x3298a0){_0x34d0f6=_0x34d0f6-0x0;var _0x57daf1=_0x27de[_0x34d0f6];return _0x57daf1;};'use strict';var multer=require(_0xe27d('0x0'));var util=require(_0xe27d('0x1'));var path=require(_0xe27d('0x2'));var timeout=require(_0xe27d('0x3'));var express=require('express');var router=express[_0xe27d('0x4')]();var auth=require(_0xe27d('0x5'));var interaction=require(_0xe27d('0x6'));var config=require(_0xe27d('0x7'));var controller=require(_0xe27d('0x8'));router[_0xe27d('0x9')]('/',auth['isAuthenticated'](),controller[_0xe27d('0xa')]);router[_0xe27d('0x9')](_0xe27d('0xb'),auth[_0xe27d('0xc')](),controller[_0xe27d('0xd')]);router[_0xe27d('0xe')]('/',auth['isAuthenticated'](),controller[_0xe27d('0xf')]);router[_0xe27d('0x10')]('/:id',auth[_0xe27d('0xc')](),controller[_0xe27d('0x11')]);router[_0xe27d('0x12')](_0xe27d('0xb'),auth[_0xe27d('0xc')](),controller[_0xe27d('0x13')]);module[_0xe27d('0x14')]=router;
\ No newline at end of file
+var _0x12fe=['../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','multer','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12fe,0x1b5));var _0xe12f=function(_0x4c48f4,_0x5885ae){_0x4c48f4=_0x4c48f4-0x0;var _0x303490=_0x12fe[_0x4c48f4];return _0x303490;};'use strict';var multer=require(_0xe12f('0x0'));var util=require('util');var path=require(_0xe12f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe12f('0x2')]();var auth=require(_0xe12f('0x3'));var interaction=require(_0xe12f('0x4'));var config=require(_0xe12f('0x5'));var controller=require(_0xe12f('0x6'));router['get']('/',auth[_0xe12f('0x7')](),controller[_0xe12f('0x8')]);router[_0xe12f('0x9')](_0xe12f('0xa'),auth['isAuthenticated'](),controller[_0xe12f('0xb')]);router['post']('/',auth[_0xe12f('0x7')](),controller[_0xe12f('0xc')]);router[_0xe12f('0xd')](_0xe12f('0xa'),auth[_0xe12f('0x7')](),controller[_0xe12f('0xe')]);router[_0xe12f('0xf')](_0xe12f('0xa'),auth['isAuthenticated'](),controller[_0xe12f('0x10')]);module['exports']=router;
\ No newline at end of file
index 13a20a5..76c4b7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed3d=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x13fdf5,_0x219c79){var _0x875d04=function(_0x2ae43c){while(--_0x2ae43c){_0x13fdf5['push'](_0x13fdf5['shift']());}};_0x875d04(++_0x219c79);}(_0xed3d,0x1ea));var _0xded3=function(_0x5866dc,_0x5a3003){_0x5866dc=_0x5866dc-0x0;var _0x428d91=_0xed3d[_0x5866dc];return _0x428d91;};'use strict';var Sequelize=require(_0xded3('0x0'));module[_0xded3('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xded3('0x2')],'allowNull':![],'defaultValue':_0xded3('0x3')},'appdata':{'type':Sequelize[_0xded3('0x4')]()},'description':{'type':Sequelize[_0xded3('0x2')]},'interval':{'type':Sequelize[_0xded3('0x2')],'defaultValue':_0xded3('0x5')}};
\ No newline at end of file
+var _0xdf48=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x49f384,_0x354853){var _0x1acaac=function(_0x56a7b1){while(--_0x56a7b1){_0x49f384['push'](_0x49f384['shift']());}};_0x1acaac(++_0x354853);}(_0xdf48,0x75));var _0x8df4=function(_0x46e15f,_0x551aec){_0x46e15f=_0x46e15f-0x0;var _0x522f15=_0xdf48[_0x46e15f];return _0x522f15;};'use strict';var Sequelize=require(_0x8df4('0x0'));module[_0x8df4('0x1')]={'priority':{'type':Sequelize[_0x8df4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8df4('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x8df4('0x4')]()},'description':{'type':Sequelize[_0x8df4('0x3')]},'interval':{'type':Sequelize[_0x8df4('0x3')],'defaultValue':_0x8df4('0x5')}};
\ No newline at end of file
index 03240ae..aeb57de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8481=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','WhatsappApplication','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','update','body','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv'];(function(_0x19c957,_0x4d8840){var _0x2ae926=function(_0x4796b4){while(--_0x4796b4){_0x19c957['push'](_0x19c957['shift']());}};_0x2ae926(++_0x4d8840);}(_0x8481,0x123));var _0x1848=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0x8481[_0x3747ae];return _0x339035;};'use strict';var pdf=require(_0x1848('0x0'));var emlformat=require(_0x1848('0x1'));var rimraf=require(_0x1848('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1848('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1848('0x4'));var Mustache=require('mustache');var util=require(_0x1848('0x5'));var path=require(_0x1848('0x6'));var sox=require(_0x1848('0x7'));var csv=require(_0x1848('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1848('0x9'));var squel=require(_0x1848('0xa'));var crypto=require(_0x1848('0xb'));var jsforce=require(_0x1848('0xc'));var deskjs=require(_0x1848('0xd'));var toCsv=require(_0x1848('0x8'));var querystring=require(_0x1848('0xe'));var Papa=require(_0x1848('0xf'));var Redis=require(_0x1848('0x10'));var authService=require(_0x1848('0x11'));var qs=require(_0x1848('0x12'));var as=require(_0x1848('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1848('0x14'))(_0x1848('0x15'));var utils=require('../../config/utils');var config=require(_0x1848('0x16'));var db=require(_0x1848('0x17'))['db'];function respondWithStatusCode(_0x1686d9,_0x21eb8d){_0x21eb8d=_0x21eb8d||0xcc;return function(_0x2664da){if(_0x2664da){return _0x1686d9[_0x1848('0x18')](_0x21eb8d);}return _0x1686d9[_0x1848('0x19')](_0x21eb8d)[_0x1848('0x1a')]();};}function respondWithResult(_0x24bca9,_0x1a7913){_0x1a7913=_0x1a7913||0xc8;return function(_0x56673f){if(_0x56673f){return _0x24bca9[_0x1848('0x19')](_0x1a7913)[_0x1848('0x1b')](_0x56673f);}};}function respondWithFilteredResult(_0x1fe7d1,_0x3c67d1){return function(_0x7feca){if(_0x7feca){var _0x3818aa=_0x7feca['count'],_0x4202eb=_0x3c67d1[_0x1848('0x1c')],_0x57e7ba=_0x3c67d1[_0x1848('0x1c')]+_0x3c67d1[_0x1848('0x1d')],_0x300e69;if(_0x57e7ba>=_0x3818aa){_0x57e7ba=_0x3818aa;_0x300e69=0xc8;}else{_0x300e69=0xce;}_0x1fe7d1[_0x1848('0x19')](_0x300e69);return _0x1fe7d1[_0x1848('0x1e')](_0x1848('0x1f'),_0x4202eb+'-'+_0x57e7ba+'/'+_0x3818aa)[_0x1848('0x1b')](_0x7feca);}return null;};}function patchUpdates(_0x3b1bdf){return function(_0x16e729){try{jsonpatch[_0x1848('0x20')](_0x16e729,_0x3b1bdf,!![]);}catch(_0x17bd52){return BPromise[_0x1848('0x21')](_0x17bd52);}return _0x16e729[_0x1848('0x22')]();};}function saveUpdates(_0x4ff051,_0x1055a){return function(_0x32c640){if(_0x32c640){return _0x32c640['update'](_0x4ff051)[_0x1848('0x23')](function(_0x181ffd){return _0x181ffd;});}return null;};}function removeEntity(_0x172b37,_0x295f9a){return function(_0x46e97a){if(_0x46e97a){return _0x46e97a[_0x1848('0x24')]()[_0x1848('0x23')](function(){_0x172b37[_0x1848('0x19')](0xcc)[_0x1848('0x1a')]();});}};}function handleEntityNotFound(_0x1aea51,_0x5922cd){return function(_0x14dd34){if(!_0x14dd34){_0x1aea51[_0x1848('0x18')](0x194);}return _0x14dd34;};}function handleError(_0x5abf9c,_0x3f23b1){_0x3f23b1=_0x3f23b1||0x1f4;return function(_0x4f38d8){logger[_0x1848('0x25')](_0x4f38d8['stack']);if(_0x4f38d8['name']){delete _0x4f38d8[_0x1848('0x26')];}_0x5abf9c[_0x1848('0x19')](_0x3f23b1)[_0x1848('0x27')](_0x4f38d8);};}exports['index']=function(_0x25b62b,_0x40acfd){var _0x48dfc8={},_0xc3e55c={},_0x36624a={'count':0x0,'rows':[]};var _0x17e94c=_['map'](db[_0x1848('0x28')][_0x1848('0x29')],function(_0x541eff){return{'name':_0x541eff[_0x1848('0x2a')],'type':_0x541eff[_0x1848('0x2b')][_0x1848('0x2c')]};});_0xc3e55c[_0x1848('0x2d')]=_[_0x1848('0x2e')](_0x17e94c,'name');_0xc3e55c[_0x1848('0x2f')]=_['keys'](_0x25b62b[_0x1848('0x2f')]);_0xc3e55c[_0x1848('0x30')]=_['intersection'](_0xc3e55c[_0x1848('0x2d')],_0xc3e55c[_0x1848('0x2f')]);_0x48dfc8[_0x1848('0x31')]=_[_0x1848('0x32')](_0xc3e55c[_0x1848('0x2d')],qs[_0x1848('0x33')](_0x25b62b[_0x1848('0x2f')][_0x1848('0x33')]));_0x48dfc8['attributes']=_0x48dfc8[_0x1848('0x31')][_0x1848('0x34')]?_0x48dfc8[_0x1848('0x31')]:_0xc3e55c[_0x1848('0x2d')];if(!_0x25b62b[_0x1848('0x2f')][_0x1848('0x35')](_0x1848('0x36'))){_0x48dfc8[_0x1848('0x1d')]=qs[_0x1848('0x1d')](_0x25b62b[_0x1848('0x2f')][_0x1848('0x1d')]);_0x48dfc8[_0x1848('0x1c')]=qs[_0x1848('0x1c')](_0x25b62b[_0x1848('0x2f')][_0x1848('0x1c')]);}_0x48dfc8['order']=qs[_0x1848('0x37')](_0x25b62b[_0x1848('0x2f')][_0x1848('0x37')]);_0x48dfc8['where']=qs['filters'](_[_0x1848('0x38')](_0x25b62b[_0x1848('0x2f')],_0xc3e55c[_0x1848('0x30')]),_0x17e94c);if(_0x25b62b[_0x1848('0x2f')][_0x1848('0x39')]){_0x48dfc8['where']=_[_0x1848('0x3a')](_0x48dfc8[_0x1848('0x3b')],{'$or':_[_0x1848('0x2e')](_0x17e94c,function(_0x1a0708){if(_0x1a0708[_0x1848('0x2b')]!==_0x1848('0x3c')){var _0x6175c7={};_0x6175c7[_0x1a0708[_0x1848('0x26')]]={'$like':'%'+_0x25b62b[_0x1848('0x2f')]['filter']+'%'};return _0x6175c7;}})});}_0x48dfc8=_[_0x1848('0x3a')]({},_0x48dfc8,_0x25b62b[_0x1848('0x3d')]);var _0x5905d6={'where':_0x48dfc8[_0x1848('0x3b')]};return db[_0x1848('0x28')][_0x1848('0x3e')](_0x5905d6)[_0x1848('0x23')](function(_0x2f3ac6){_0x36624a[_0x1848('0x3e')]=_0x2f3ac6;if(_0x25b62b[_0x1848('0x2f')][_0x1848('0x3f')]){_0x48dfc8[_0x1848('0x40')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x1848('0x41')](_0x48dfc8);})['then'](function(_0x103cac){_0x36624a[_0x1848('0x42')]=_0x103cac;return _0x36624a;})['then'](respondWithFilteredResult(_0x40acfd,_0x48dfc8))[_0x1848('0x43')](handleError(_0x40acfd,null));};exports[_0x1848('0x44')]=function(_0x4f9933,_0x48a532){var _0x12aaa6={'raw':!![],'where':{'id':_0x4f9933[_0x1848('0x45')]['id']}},_0x430bd2={};_0x430bd2['model']=_[_0x1848('0x46')](db[_0x1848('0x28')][_0x1848('0x29')]);_0x430bd2[_0x1848('0x2f')]=_['keys'](_0x4f9933[_0x1848('0x2f')]);_0x430bd2[_0x1848('0x30')]=_[_0x1848('0x32')](_0x430bd2[_0x1848('0x2d')],_0x430bd2['query']);_0x12aaa6[_0x1848('0x31')]=_['intersection'](_0x430bd2[_0x1848('0x2d')],qs[_0x1848('0x33')](_0x4f9933[_0x1848('0x2f')][_0x1848('0x33')]));_0x12aaa6[_0x1848('0x31')]=_0x12aaa6[_0x1848('0x31')]['length']?_0x12aaa6[_0x1848('0x31')]:_0x430bd2[_0x1848('0x2d')];if(_0x4f9933['query'][_0x1848('0x3f')]){_0x12aaa6['include']=[{'all':!![]}];}_0x12aaa6=_[_0x1848('0x3a')]({},_0x12aaa6,_0x4f9933[_0x1848('0x3d')]);return db[_0x1848('0x28')][_0x1848('0x47')](_0x12aaa6)['then'](handleEntityNotFound(_0x48a532,null))[_0x1848('0x23')](respondWithResult(_0x48a532,null))[_0x1848('0x43')](handleError(_0x48a532,null));};exports[_0x1848('0x48')]=function(_0x234270,_0xccbdab){return db[_0x1848('0x28')][_0x1848('0x48')](_0x234270['body'],{})[_0x1848('0x23')](respondWithResult(_0xccbdab,0xc9))[_0x1848('0x43')](handleError(_0xccbdab,null));};exports[_0x1848('0x49')]=function(_0x511cdf,_0x104f47){if(_0x511cdf['body']['id']){delete _0x511cdf['body']['id'];}return db[_0x1848('0x28')][_0x1848('0x47')]({'where':{'id':_0x511cdf[_0x1848('0x45')]['id']}})['then'](handleEntityNotFound(_0x104f47,null))[_0x1848('0x23')](saveUpdates(_0x511cdf[_0x1848('0x4a')],null))[_0x1848('0x23')](respondWithResult(_0x104f47,null))[_0x1848('0x43')](handleError(_0x104f47,null));};exports[_0x1848('0x24')]=function(_0xbe738b,_0x7d714c){return db[_0x1848('0x28')][_0x1848('0x47')]({'where':{'id':_0xbe738b[_0x1848('0x45')]['id']}})[_0x1848('0x23')](handleEntityNotFound(_0x7d714c,null))[_0x1848('0x23')](removeEntity(_0x7d714c,null))[_0x1848('0x43')](handleError(_0x7d714c,null));};
\ No newline at end of file
+var _0x51f2=['attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','WhatsappApplication','rawAttributes','type','key','model','query','filters','intersection'];(function(_0x804eb7,_0x4833e2){var _0x2810b1=function(_0x1ea012){while(--_0x1ea012){_0x804eb7['push'](_0x804eb7['shift']());}};_0x2810b1(++_0x4833e2);}(_0x51f2,0x130));var _0x251f=function(_0x3ae9a0,_0x5e87d6){_0x3ae9a0=_0x3ae9a0-0x0;var _0x58bd36=_0x51f2[_0x3ae9a0];return _0x58bd36;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x251f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x251f('0x1'));var jsonpatch=require(_0x251f('0x2'));var rp=require(_0x251f('0x3'));var moment=require(_0x251f('0x4'));var BPromise=require(_0x251f('0x5'));var Mustache=require('mustache');var util=require(_0x251f('0x6'));var path=require(_0x251f('0x7'));var sox=require(_0x251f('0x8'));var csv=require(_0x251f('0x9'));var ejs=require(_0x251f('0xa'));var fs=require('fs');var _=require(_0x251f('0xb'));var squel=require(_0x251f('0xc'));var crypto=require(_0x251f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x251f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x251f('0xf'));var Papa=require(_0x251f('0x10'));var Redis=require(_0x251f('0x11'));var authService=require(_0x251f('0x12'));var qs=require(_0x251f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x251f('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x251f('0x15'));var config=require(_0x251f('0x16'));var db=require(_0x251f('0x17'))['db'];function respondWithStatusCode(_0x1d44aa,_0x4dc2f1){_0x4dc2f1=_0x4dc2f1||0xcc;return function(_0x447cbc){if(_0x447cbc){return _0x1d44aa[_0x251f('0x18')](_0x4dc2f1);}return _0x1d44aa[_0x251f('0x19')](_0x4dc2f1)[_0x251f('0x1a')]();};}function respondWithResult(_0x216dd7,_0x53bf99){_0x53bf99=_0x53bf99||0xc8;return function(_0x2b27af){if(_0x2b27af){return _0x216dd7['status'](_0x53bf99)[_0x251f('0x1b')](_0x2b27af);}};}function respondWithFilteredResult(_0x5bc2a7,_0x4af0de){return function(_0x391b86){if(_0x391b86){var _0x10eff8=_0x391b86[_0x251f('0x1c')],_0x3a6573=_0x4af0de[_0x251f('0x1d')],_0x34d16e=_0x4af0de['offset']+_0x4af0de[_0x251f('0x1e')],_0x468f4a;if(_0x34d16e>=_0x10eff8){_0x34d16e=_0x10eff8;_0x468f4a=0xc8;}else{_0x468f4a=0xce;}_0x5bc2a7[_0x251f('0x19')](_0x468f4a);return _0x5bc2a7[_0x251f('0x1f')](_0x251f('0x20'),_0x3a6573+'-'+_0x34d16e+'/'+_0x10eff8)[_0x251f('0x1b')](_0x391b86);}return null;};}function patchUpdates(_0x5a2857){return function(_0x150443){try{jsonpatch[_0x251f('0x21')](_0x150443,_0x5a2857,!![]);}catch(_0x4c3fb1){return BPromise[_0x251f('0x22')](_0x4c3fb1);}return _0x150443[_0x251f('0x23')]();};}function saveUpdates(_0x57f79f,_0x433014){return function(_0x5c78c6){if(_0x5c78c6){return _0x5c78c6[_0x251f('0x24')](_0x57f79f)[_0x251f('0x25')](function(_0x4e527c){return _0x4e527c;});}return null;};}function removeEntity(_0x31e8c6,_0x1ddc10){return function(_0xe5c984){if(_0xe5c984){return _0xe5c984[_0x251f('0x26')]()[_0x251f('0x25')](function(){_0x31e8c6[_0x251f('0x19')](0xcc)[_0x251f('0x1a')]();});}};}function handleEntityNotFound(_0x5ee8e9,_0x561ecb){return function(_0x5ea26b){if(!_0x5ea26b){_0x5ee8e9['sendStatus'](0x194);}return _0x5ea26b;};}function handleError(_0x1221b1,_0x36d241){_0x36d241=_0x36d241||0x1f4;return function(_0xb0a7b6){logger[_0x251f('0x27')](_0xb0a7b6[_0x251f('0x28')]);if(_0xb0a7b6[_0x251f('0x29')]){delete _0xb0a7b6[_0x251f('0x29')];}_0x1221b1[_0x251f('0x19')](_0x36d241)['send'](_0xb0a7b6);};}exports['index']=function(_0x16e1b6,_0x417ebb){var _0x16f1a9={},_0x4de712={},_0x41b448={'count':0x0,'rows':[]};var _0x28d6c1=_[_0x251f('0x2a')](db[_0x251f('0x2b')][_0x251f('0x2c')],function(_0x5581a3){return{'name':_0x5581a3['fieldName'],'type':_0x5581a3[_0x251f('0x2d')][_0x251f('0x2e')]};});_0x4de712[_0x251f('0x2f')]=_['map'](_0x28d6c1,_0x251f('0x29'));_0x4de712[_0x251f('0x30')]=_['keys'](_0x16e1b6[_0x251f('0x30')]);_0x4de712[_0x251f('0x31')]=_[_0x251f('0x32')](_0x4de712['model'],_0x4de712[_0x251f('0x30')]);_0x16f1a9[_0x251f('0x33')]=_[_0x251f('0x32')](_0x4de712[_0x251f('0x2f')],qs[_0x251f('0x34')](_0x16e1b6['query'][_0x251f('0x34')]));_0x16f1a9[_0x251f('0x33')]=_0x16f1a9[_0x251f('0x33')]['length']?_0x16f1a9[_0x251f('0x33')]:_0x4de712['model'];if(!_0x16e1b6[_0x251f('0x30')][_0x251f('0x35')]('nolimit')){_0x16f1a9[_0x251f('0x1e')]=qs[_0x251f('0x1e')](_0x16e1b6[_0x251f('0x30')][_0x251f('0x1e')]);_0x16f1a9[_0x251f('0x1d')]=qs[_0x251f('0x1d')](_0x16e1b6[_0x251f('0x30')][_0x251f('0x1d')]);}_0x16f1a9[_0x251f('0x36')]=qs[_0x251f('0x37')](_0x16e1b6[_0x251f('0x30')][_0x251f('0x37')]);_0x16f1a9[_0x251f('0x38')]=qs[_0x251f('0x31')](_[_0x251f('0x39')](_0x16e1b6['query'],_0x4de712[_0x251f('0x31')]),_0x28d6c1);if(_0x16e1b6[_0x251f('0x30')][_0x251f('0x3a')]){_0x16f1a9[_0x251f('0x38')]=_['merge'](_0x16f1a9[_0x251f('0x38')],{'$or':_[_0x251f('0x2a')](_0x28d6c1,function(_0x4c93d3){if(_0x4c93d3['type']!==_0x251f('0x3b')){var _0x5bf157={};_0x5bf157[_0x4c93d3[_0x251f('0x29')]]={'$like':'%'+_0x16e1b6[_0x251f('0x30')][_0x251f('0x3a')]+'%'};return _0x5bf157;}})});}_0x16f1a9=_[_0x251f('0x3c')]({},_0x16f1a9,_0x16e1b6[_0x251f('0x3d')]);var _0x4cb737={'where':_0x16f1a9['where']};return db[_0x251f('0x2b')][_0x251f('0x1c')](_0x4cb737)[_0x251f('0x25')](function(_0x2b0884){_0x41b448[_0x251f('0x1c')]=_0x2b0884;if(_0x16e1b6[_0x251f('0x30')][_0x251f('0x3e')]){_0x16f1a9[_0x251f('0x3f')]=[{'all':!![]}];}return db[_0x251f('0x2b')]['findAll'](_0x16f1a9);})[_0x251f('0x25')](function(_0x1da952){_0x41b448[_0x251f('0x40')]=_0x1da952;return _0x41b448;})[_0x251f('0x25')](respondWithFilteredResult(_0x417ebb,_0x16f1a9))[_0x251f('0x41')](handleError(_0x417ebb,null));};exports['show']=function(_0x13a7ed,_0x451b60){var _0x5dc686={'raw':!![],'where':{'id':_0x13a7ed[_0x251f('0x42')]['id']}},_0x8f8df4={};_0x8f8df4[_0x251f('0x2f')]=_[_0x251f('0x43')](db[_0x251f('0x2b')][_0x251f('0x2c')]);_0x8f8df4['query']=_[_0x251f('0x43')](_0x13a7ed[_0x251f('0x30')]);_0x8f8df4['filters']=_[_0x251f('0x32')](_0x8f8df4['model'],_0x8f8df4[_0x251f('0x30')]);_0x5dc686[_0x251f('0x33')]=_[_0x251f('0x32')](_0x8f8df4['model'],qs['fields'](_0x13a7ed[_0x251f('0x30')][_0x251f('0x34')]));_0x5dc686['attributes']=_0x5dc686[_0x251f('0x33')]['length']?_0x5dc686['attributes']:_0x8f8df4[_0x251f('0x2f')];if(_0x13a7ed['query'][_0x251f('0x3e')]){_0x5dc686[_0x251f('0x3f')]=[{'all':!![]}];}_0x5dc686=_[_0x251f('0x3c')]({},_0x5dc686,_0x13a7ed[_0x251f('0x3d')]);return db[_0x251f('0x2b')][_0x251f('0x44')](_0x5dc686)[_0x251f('0x25')](handleEntityNotFound(_0x451b60,null))[_0x251f('0x25')](respondWithResult(_0x451b60,null))['catch'](handleError(_0x451b60,null));};exports[_0x251f('0x45')]=function(_0x309b5b,_0x1590bc){return db[_0x251f('0x2b')][_0x251f('0x45')](_0x309b5b[_0x251f('0x46')],{})['then'](respondWithResult(_0x1590bc,0xc9))[_0x251f('0x41')](handleError(_0x1590bc,null));};exports[_0x251f('0x24')]=function(_0x3c2d37,_0x153d5d){if(_0x3c2d37[_0x251f('0x46')]['id']){delete _0x3c2d37[_0x251f('0x46')]['id'];}return db['WhatsappApplication'][_0x251f('0x44')]({'where':{'id':_0x3c2d37['params']['id']}})[_0x251f('0x25')](handleEntityNotFound(_0x153d5d,null))[_0x251f('0x25')](saveUpdates(_0x3c2d37['body'],null))['then'](respondWithResult(_0x153d5d,null))[_0x251f('0x41')](handleError(_0x153d5d,null));};exports[_0x251f('0x26')]=function(_0x4a9faa,_0x81e838){return db['WhatsappApplication']['find']({'where':{'id':_0x4a9faa['params']['id']}})[_0x251f('0x25')](handleEntityNotFound(_0x81e838,null))['then'](removeEntity(_0x81e838,null))[_0x251f('0x41')](handleError(_0x81e838,null));};
\ No newline at end of file
index 634be75..4d02e58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb59=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbb59,0xec));var _0x9bb5=function(_0x55d14b,_0x3c8aa1){_0x55d14b=_0x55d14b-0x0;var _0x2f8248=_0xbb59[_0x55d14b];return _0x2f8248;};'use strict';var _=require(_0x9bb5('0x0'));var util=require(_0x9bb5('0x1'));var logger=require(_0x9bb5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9bb5('0x3'));var rp=require(_0x9bb5('0x4'));var fs=require('fs');var path=require(_0x9bb5('0x5'));var rimraf=require(_0x9bb5('0x6'));var config=require(_0x9bb5('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0x9bb5('0x8')]=function(_0x2c85f4,_0x1e57b2){return _0x2c85f4[_0x9bb5('0x9')](_0x9bb5('0xa'),attributes,{'tableName':_0x9bb5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9bb5('0xc'),'collate':_0x9bb5('0xd')});};
\ No newline at end of file
+var _0x0565=['exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xee2163,_0x45c470){var _0x3e3ba3=function(_0x1f0a9c){while(--_0x1f0a9c){_0xee2163['push'](_0xee2163['shift']());}};_0x3e3ba3(++_0x45c470);}(_0x0565,0xf2));var _0x5056=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x0565[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var logger=require(_0x5056('0x2'))(_0x5056('0x3'));var moment=require(_0x5056('0x4'));var BPromise=require(_0x5056('0x5'));var rp=require(_0x5056('0x6'));var fs=require('fs');var path=require(_0x5056('0x7'));var rimraf=require(_0x5056('0x8'));var config=require(_0x5056('0x9'));var attributes=require('./whatsappApplication.attributes');module[_0x5056('0xa')]=function(_0x105ea8,_0x1143df){return _0x105ea8[_0x5056('0xb')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5056('0xc'),'collate':_0x5056('0xd')});};
\ No newline at end of file
index 4714671..1454e58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x363e=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x363e,0x179));var _0xe363=function(_0x42015a,_0x459f91){_0x42015a=_0x42015a-0x0;var _0xdafdfb=_0x363e[_0x42015a];return _0xdafdfb;};'use strict';var _=require(_0xe363('0x0'));var util=require(_0xe363('0x1'));var moment=require('moment');var BPromise=require(_0xe363('0x2'));var rs=require(_0xe363('0x3'));var fs=require('fs');var Redis=require(_0xe363('0x4'));var db=require(_0xe363('0x5'))['db'];var utils=require(_0xe363('0x6'));var logger=require(_0xe363('0x7'))(_0xe363('0x8'));var config=require(_0xe363('0x9'));var jayson=require(_0xe363('0xa'));var client=jayson[_0xe363('0xb')][_0xe363('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4fe10b,_0x1fc808,_0x30bffc){return new BPromise(function(_0xc5df66,_0x29d330){return client['request'](_0x4fe10b,_0x30bffc)[_0xe363('0xd')](function(_0x308de7){logger[_0xe363('0xe')](_0xe363('0xf'),_0x1fc808,_0xe363('0x10'));logger[_0xe363('0x11')](_0xe363('0x12'),_0x1fc808,'request\x20sent',JSON[_0xe363('0x13')](_0x308de7));if(_0x308de7[_0xe363('0x14')]){if(_0x308de7['error'][_0xe363('0x15')]===0x1f4){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x1fc808,_0x308de7[_0xe363('0x14')][_0xe363('0x16')]);return _0x29d330(_0x308de7[_0xe363('0x14')][_0xe363('0x16')]);}logger[_0xe363('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x1fc808,_0x308de7[_0xe363('0x14')][_0xe363('0x16')]);return _0xc5df66(_0x308de7['error'][_0xe363('0x16')]);}else{logger[_0xe363('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1fc808,_0xe363('0x10'));_0xc5df66(_0x308de7[_0xe363('0x17')]['message']);}})[_0xe363('0x18')](function(_0xc94d0a){logger['error'](_0xe363('0xf'),_0x1fc808,_0xc94d0a);_0x29d330(_0xc94d0a);});});}
\ No newline at end of file
+var _0xc1c6=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x31f9be,_0x11e505){var _0x19e7cd=function(_0x3f8af5){while(--_0x3f8af5){_0x31f9be['push'](_0x31f9be['shift']());}};_0x19e7cd(++_0x11e505);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x46a0bf,_0x52e7ed){_0x46a0bf=_0x46a0bf-0x0;var _0x40e456=_0xc1c6[_0x46a0bf];return _0x40e456;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});}
\ No newline at end of file
index f61fbdf..e1d927a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc52=['Router','../../config/environment','get','index','isAuthenticated','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','addTags','put','whatsapp','whatsappinteraction:update','update','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc52,0x1bd));var _0x2dc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc52[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2dc5('0x0'));var util=require(_0x2dc5('0x1'));var path=require(_0x2dc5('0x2'));var timeout=require(_0x2dc5('0x3'));var express=require(_0x2dc5('0x4'));var router=express[_0x2dc5('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2dc5('0x6'));var controller=require('./whatsappInteraction.controller');router[_0x2dc5('0x7')]('/',auth['isAuthenticated'](),controller[_0x2dc5('0x8')]);router[_0x2dc5('0x7')]('/describe',auth[_0x2dc5('0x9')](),controller['describe']);router[_0x2dc5('0x7')](_0x2dc5('0xa'),auth['isAuthenticated'](),controller[_0x2dc5('0xb')]);router[_0x2dc5('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x2dc5('0xc')]);router[_0x2dc5('0x7')](_0x2dc5('0xd'),auth['isAuthenticated'](),controller[_0x2dc5('0xe')]);router[_0x2dc5('0xf')]('/',auth[_0x2dc5('0x9')](),controller[_0x2dc5('0x10')]);router[_0x2dc5('0xf')](_0x2dc5('0x11'),auth['isAuthenticated'](),controller[_0x2dc5('0x12')]);router[_0x2dc5('0xf')](_0x2dc5('0x13'),auth[_0x2dc5('0x9')](),interaction[_0x2dc5('0x14')]('whatsapp','whatsappinteraction:addtags'),controller[_0x2dc5('0x15')]);router[_0x2dc5('0x16')]('/:id',auth[_0x2dc5('0x9')](),interaction[_0x2dc5('0x14')](_0x2dc5('0x17'),_0x2dc5('0x18')),controller[_0x2dc5('0x19')]);router['delete']('/:id',auth[_0x2dc5('0x9')](),interaction['tracked'](_0x2dc5('0x17'),'whatsappinteraction:destroy'),controller[_0x2dc5('0x1a')]);router[_0x2dc5('0x1b')]('/:id/tags',auth[_0x2dc5('0x9')](),controller[_0x2dc5('0x1c')]);module[_0x2dc5('0x1d')]=router;
\ No newline at end of file
+var _0x6071=['tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags'];(function(_0x347966,_0x5b4df0){var _0xf1c8cc=function(_0x484f3e){while(--_0x484f3e){_0x347966['push'](_0x347966['shift']());}};_0xf1c8cc(++_0x5b4df0);}(_0x6071,0x10e));var _0x1607=function(_0x4b11a8,_0x3e9d1f){_0x4b11a8=_0x4b11a8-0x0;var _0x115e6d=_0x6071[_0x4b11a8];return _0x115e6d;};'use strict';var multer=require(_0x1607('0x0'));var util=require('util');var path=require(_0x1607('0x1'));var timeout=require(_0x1607('0x2'));var express=require(_0x1607('0x3'));var router=express[_0x1607('0x4')]();var auth=require(_0x1607('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0x1607('0x6')](),controller[_0x1607('0x7')]);router[_0x1607('0x8')](_0x1607('0x9'),auth[_0x1607('0x6')](),controller[_0x1607('0xa')]);router[_0x1607('0x8')](_0x1607('0xb'),auth[_0x1607('0x6')](),controller[_0x1607('0xc')]);router[_0x1607('0x8')](_0x1607('0xd'),auth[_0x1607('0x6')](),controller[_0x1607('0xe')]);router[_0x1607('0x8')](_0x1607('0xf'),auth[_0x1607('0x6')](),controller['download']);router[_0x1607('0x10')]('/',auth[_0x1607('0x6')](),controller[_0x1607('0x11')]);router[_0x1607('0x10')](_0x1607('0xd'),auth['isAuthenticated'](),controller[_0x1607('0x12')]);router[_0x1607('0x10')](_0x1607('0x13'),auth[_0x1607('0x6')](),interaction[_0x1607('0x14')](_0x1607('0x15'),_0x1607('0x16')),controller[_0x1607('0x17')]);router[_0x1607('0x18')](_0x1607('0xb'),auth[_0x1607('0x6')](),interaction[_0x1607('0x14')]('whatsapp',_0x1607('0x19')),controller['update']);router[_0x1607('0x1a')]('/:id',auth[_0x1607('0x6')](),interaction['tracked']('whatsapp','whatsappinteraction:destroy'),controller['destroy']);router[_0x1607('0x1a')]('/:id/tags',auth[_0x1607('0x6')](),controller[_0x1607('0x1b')]);module[_0x1607('0x1c')]=router;
\ No newline at end of file
index e8fb09b..422aa1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76a1=['DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0xdb1bf2,_0x243b95){var _0x1f76d1=function(_0x8cf2c1){while(--_0x8cf2c1){_0xdb1bf2['push'](_0xdb1bf2['shift']());}};_0x1f76d1(++_0x243b95);}(_0x76a1,0x115));var _0x176a=function(_0x5b037a,_0x18cfbc){_0x5b037a=_0x5b037a-0x0;var _0x3240e7=_0x76a1[_0x5b037a];return _0x3240e7;};'use strict';var Sequelize=require(_0x176a('0x0'));var moment=require(_0x176a('0x1'));module[_0x176a('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x176a('0x3')]},'disposition':{'type':Sequelize[_0x176a('0x4')]},'note':{'type':Sequelize[_0x176a('0x4')]},'phone':{'type':Sequelize[_0x176a('0x4')]},'read1stAt':{'type':Sequelize[_0x176a('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x176a('0x5')]('in',_0x176a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x176a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x176a('0x5')]('in',_0x176a('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xa40c=['exports','BOOLEAN','DATE','STRING','out','ENUM','sequelize'];(function(_0x1f95eb,_0x42244b){var _0x291849=function(_0x1d796b){while(--_0x1d796b){_0x1f95eb['push'](_0x1f95eb['shift']());}};_0x291849(++_0x42244b);}(_0xa40c,0x16b));var _0xca40=function(_0x324640,_0x654697){_0x324640=_0x324640-0x0;var _0x10f89=_0xa40c[_0x324640];return _0x10f89;};'use strict';var Sequelize=require(_0xca40('0x0'));var moment=require('moment');module[_0xca40('0x1')]={'closed':{'type':Sequelize[_0xca40('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xca40('0x3')]},'disposition':{'type':Sequelize[_0xca40('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xca40('0x4')]},'read1stAt':{'type':Sequelize[_0xca40('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xca40('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xca40('0x6')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 8ff9e2d..1ab3e36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['attachments','Attachment','direction','secret','WhatsappAccount','Account','Owner','mkdirSync','30px','%s\x20#%d','Whatsapp','YYYY-MM-DD','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','System','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','select','color','tools_tags','u.id','field','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','whatsapp_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','buildExpression','start','body','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','forEach','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','rows','show','params','includeAll','include','WhatsappInteraction','create','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','format','options','findAll','emit','removeTags','unix','root','files','tmp','server','join','transcript-%d-%s.zip','User','firstName','lastName'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x7a54,0x106));var _0x47a5=function(_0x5a2e1b,_0x55bd53){_0x5a2e1b=_0x5a2e1b-0x0;var _0x956bc3=_0x7a54[_0x5a2e1b];return _0x956bc3;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}function getInteractionUsers(_0x136b14,_0x16631f){return new BPromise(function(_0x361bfa,_0x1127f8){try{if(_0x16631f[_0x136b14['id']]){_0x136b14[_0x47a5('0x2b')]=_[_0x47a5('0x2c')](_0x16631f[_0x136b14['id']],function(_0x528582){return{'id':_0x528582['id'],'fullname':_0x528582[_0x47a5('0x2d')]};});}}catch(_0x51833b){_0x1127f8(_0x51833b);}_0x361bfa(_0x136b14);});}function getInteractionTags(_0x2ef875,_0x9ac908){return new BPromise(function(_0x16901f,_0x4d6b57){try{if(_0x2ef875[_0x47a5('0x2e')]){_0x2ef875[_0x47a5('0x2f')]=[];_0x2ef875[_0x47a5('0x2e')][_0x47a5('0x30')](',')['forEach'](function(_0x50d875){_0x2ef875[_0x47a5('0x2f')][_0x47a5('0x31')](_0x9ac908[_0x50d875]);});}delete _0x2ef875['TagIds'];}catch(_0x4e1006){_0x4d6b57(_0x4e1006);}_0x16901f(_0x2ef875);});}function updateWhatsappInteraction(_0x836303,_0x51544e,_0x57bff6){return new BPromise(function(_0x42f70c,_0x53119b){return getInteractionUsers(_0x836303,_0x57bff6)[_0x47a5('0x26')](function(_0xd972c){return getInteractionTags(_0xd972c,_0x51544e);})['then'](function(_0x4843c0){_0x42f70c(_0x4843c0);})[_0x47a5('0x32')](function(_0x5910bb){_0x53119b(_0x5910bb);});});}exports[_0x47a5('0x33')]=function(_0x87e4c9,_0xf269a8){var _0x52749b={},_0x18f7e9={},_0x50c086={'count':0x0,'rows':[]};var _0x53c754=_[_0x47a5('0x2c')](db['WhatsappInteraction'][_0x47a5('0x34')],function(_0x5ef577){return{'name':_0x5ef577[_0x47a5('0x35')],'type':_0x5ef577[_0x47a5('0x36')][_0x47a5('0x37')]};});_0x18f7e9[_0x47a5('0x38')]=_[_0x47a5('0x2c')](_0x53c754,_0x47a5('0x29'));_0x18f7e9[_0x47a5('0x39')]=_[_0x47a5('0x3a')](_0x87e4c9[_0x47a5('0x39')]);_0x18f7e9['filters']=_[_0x47a5('0x3b')](_0x18f7e9[_0x47a5('0x38')],_0x18f7e9['query']);_0x52749b[_0x47a5('0x3c')]=_[_0x47a5('0x3b')](_0x18f7e9[_0x47a5('0x38')],qs['fields'](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x3d')]));_0x52749b['attributes']=_0x52749b[_0x47a5('0x3c')][_0x47a5('0x3e')]?_0x52749b['attributes']:_0x18f7e9['model'];if(!_0x87e4c9['query'][_0x47a5('0x3f')]('nolimit')){_0x52749b[_0x47a5('0x1f')]=qs[_0x47a5('0x1f')](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x1f')]);_0x52749b[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x1e')]);}_0x52749b[_0x47a5('0x40')]=qs[_0x47a5('0x41')](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x41')]);_0x52749b[_0x47a5('0x42')]=qs['filters'](_[_0x47a5('0x43')](_0x87e4c9[_0x47a5('0x39')],_0x18f7e9[_0x47a5('0x44')]),_0x53c754);var _0x23bd8d=[];var _0x586f4f=squel[_0x47a5('0x45')]()['field']('id')['field']('name')['field'](_0x47a5('0x46'))['from'](_0x47a5('0x47'));var _0x3a740b=squel[_0x47a5('0x45')]()['field'](_0x47a5('0x48'))[_0x47a5('0x49')]('u.fullname')['field'](_0x47a5('0x4a'))['from'](_0x47a5('0x4b'),'ui')[_0x47a5('0x4c')](_0x47a5('0x4d'),'u',_0x47a5('0x4e'));var _0x34a9ae=squel[_0x47a5('0x45')]()[_0x47a5('0x4f')](_0x47a5('0x50'),'i')[_0x47a5('0x4c')](_0x47a5('0x51'),'c',_0x47a5('0x52'))[_0x47a5('0x4c')](_0x47a5('0x4d'),'o',_0x47a5('0x53'))[_0x47a5('0x4c')](_0x47a5('0x54'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x47a5('0x4c')](_0x47a5('0x55'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x47a5('0x56'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x47a5('0x4c')](_0x47a5('0x47'),'t','t.id\x20=\x20it.TagId');var _0x4f62d3=squel[_0x47a5('0x57')]();var _0x52d409=[];var _0x2d147c=squel[_0x47a5('0x57')]();var _0x3548bc;if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x58')]){_0x3548bc=as[_0x47a5('0x59')](_0x87e4c9[_0x47a5('0x39')]['search']);var _0x48a0ef=_0x3548bc[_0x47a5('0x5a')];for(var _0x411230=0x0;_0x411230<_0x3548bc[_0x47a5('0x5b')][_0x47a5('0x3e')];_0x411230++){var _0x2c7020=_0x3548bc[_0x47a5('0x5b')][_0x411230];var _0x249de5='i';var _0x492cf7=_[_0x47a5('0x5c')](_0x53c754,[_0x47a5('0x29'),_0x2c7020[_0x47a5('0x49')]]);if(!_0x492cf7){switch(_0x2c7020['field']){case _0x47a5('0x5d'):if(_0x2c7020['value']==0x1){_0x34a9ae[_0x47a5('0x5e')]('`'+_0x2c7020[_0x47a5('0x49')]+_0x47a5('0x5f'));}else{_0x34a9ae[_0x47a5('0x5e')]('`'+_0x2c7020['field']+_0x47a5('0x60'));}break;case _0x47a5('0x61'):if(_0x2c7020[_0x47a5('0x62')]===_0x47a5('0x63')){if(_0x2c7020[_0x47a5('0x64')][_0x47a5('0x30')]('\x20')[_0x47a5('0x3e')]>0x1){_0x4f62d3[_0x48a0ef]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x47a5('0x65')](_0x2c7020[_0x47a5('0x64')]),null);}else{var _0x187d7e='%'+_0x2c7020[_0x47a5('0x64')]+'%';_0x4f62d3[_0x48a0ef](_0x47a5('0x66'),_0x187d7e,_0x187d7e,_0x187d7e);}}else{_0x492cf7=_[_0x47a5('0x5c')](_0x53c754,['name',_0x47a5('0x67')]);_0x2c7020[_0x47a5('0x49')]=_0x47a5('0x67');_0x5cbe97=as['buildExpression'](_0x249de5,_0x492cf7[_0x47a5('0x36')],_0x2c7020);_0x4f62d3[_0x48a0ef](_0x5cbe97[_0x47a5('0x68')],_0x5cbe97[_0x47a5('0x64')]['start'],_0x5cbe97['value'][_0x47a5('0x1b')]);}break;case _0x47a5('0x69'):var _0x4fa1da=_0x2c7020['value'][_0x47a5('0x30')](',')['map'](function(_0x16bb8a){return Number(_0x16bb8a);});_0x4fa1da['forEach'](function(_0x482de6){_0x2d147c['or'](_0x47a5('0x6a'),'%,'+_0x482de6+',%');});_0x52d409=_[_0x47a5('0x6b')](_0x52d409,_0x4fa1da);break;case'User':if(_0x2c7020[_0x47a5('0x62')]===_0x47a5('0x63')){_0x4f62d3[_0x48a0ef]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2c7020['value']+'%',null);}else{_0x492cf7=_[_0x47a5('0x5c')](_0x53c754,[_0x47a5('0x29'),_0x47a5('0x6c')]);_0x2c7020[_0x47a5('0x49')]='UserId';_0x5cbe97=as[_0x47a5('0x6d')](_0x249de5,_0x492cf7[_0x47a5('0x36')],_0x2c7020);_0x4f62d3[_0x48a0ef](_0x5cbe97[_0x47a5('0x68')],_0x5cbe97['value'][_0x47a5('0x6e')],_0x5cbe97['value'][_0x47a5('0x1b')]);}break;case _0x47a5('0x6f'):_0x5cbe97=as[_0x47a5('0x6d')]('me',null,_0x2c7020);_0x4f62d3[_0x48a0ef](_0x5cbe97[_0x47a5('0x68')],_0x5cbe97[_0x47a5('0x64')]['start'],_0x5cbe97[_0x47a5('0x64')]['end']);break;}}else{var _0x5cbe97=as['buildExpression'](_0x249de5,_0x492cf7['type'],_0x2c7020);_0x4f62d3[_0x48a0ef](_0x5cbe97[_0x47a5('0x68')],_0x5cbe97[_0x47a5('0x64')][_0x47a5('0x6e')],_0x5cbe97['value']['end']);}}}else{var _0x139229=_(_0x87e4c9[_0x47a5('0x39')])[_0x47a5('0x3a')]()[_0x47a5('0x2c')](function(_0xc45e25){return _['some'](_0x53c754,[_0x47a5('0x29'),_0xc45e25])?_0xc45e25:undefined;})['compact']()[_0x47a5('0x64')]();if(!_[_0x47a5('0x70')](_0x139229)){_0x139229['forEach'](function(_0x32b4de){if(_0x32b4de===_0x47a5('0x71')){_0x34a9ae[_0x47a5('0x42')](_0x47a5('0x72'),[][_0x47a5('0x73')](_0x87e4c9[_0x47a5('0x39')][_0x32b4de]));}else if(_0x32b4de===_0x47a5('0x74')){var _0x3ac38c=JSON['parse'](_0x87e4c9[_0x47a5('0x39')][_0x32b4de])[_0x47a5('0x75')];var _0x3c75c6=JSON[_0x47a5('0x76')](_0x87e4c9[_0x47a5('0x39')][_0x32b4de])['$lte'];_0x34a9ae[_0x47a5('0x42')](_0x47a5('0x77'),_0x3ac38c,_0x3c75c6);}else{if(_0x87e4c9[_0x47a5('0x39')][_0x32b4de]===_0x47a5('0x78')){_0x34a9ae[_0x47a5('0x42')]('i.'+_0x32b4de+_0x47a5('0x79'));}else{_0x34a9ae[_0x47a5('0x42')]('i.'+_0x32b4de+_0x47a5('0x7a'),_0x87e4c9[_0x47a5('0x39')][_0x32b4de]);}}});}if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7b')]){if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7b')]==0x1){_0x34a9ae[_0x47a5('0x5e')](_0x47a5('0x7c'));}else{_0x34a9ae['having'](_0x47a5('0x7d'));}}if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7e')]){_0x52d409=_['isArray'](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7e')])?_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7e')]:new Array(_0x87e4c9['query'][_0x47a5('0x7e')]);_0x52d409['forEach'](function(_0x2d5ee6){_0x2d147c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2d5ee6+',%');});}if(_0x87e4c9[_0x47a5('0x39')]['filter']){var _0x7c1190=_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7f')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x47a5('0x80')](_0x7c1190)){_0x4f62d3['or'](_0x47a5('0x81'),_0x7c1190+'%')['or'](_0x47a5('0x82'),_0x7c1190+'%');}else{_0x4f62d3['or'](_0x47a5('0x83'),qs['getFullTextValue'](_0x7c1190))['or'](_0x47a5('0x84'),_0x7c1190+'%');}}}_0x34a9ae[_0x47a5('0x42')](_0x4f62d3);_0x34a9ae[_0x47a5('0x85')](_0x47a5('0x86'));var _0x308c9a={'type':db[_0x47a5('0x87')][_0x47a5('0x88')][_0x47a5('0x89')],'raw':!![]};var _0x4618a0=_0x34a9ae[_0x47a5('0x8a')]();_0x4618a0[_0x47a5('0x49')](_0x47a5('0x86'));_0x4618a0['field'](_0x47a5('0x8b'),'unreadMessages');if(_0x52749b[_0x47a5('0x40')]){_0x52749b[_0x47a5('0x40')][_0x47a5('0x8c')](function(_0x12fec9){_0x34a9ae[_0x47a5('0x40')]('i.'+_0x12fec9[0x0],_0x12fec9[0x1]===_0x47a5('0x8d')?![]:!![]);});}if(!_[_0x47a5('0x70')](_0x52d409)){_0x34a9ae[_0x47a5('0x5e')](_0x2d147c);_0x4618a0[_0x47a5('0x42')](_0x47a5('0x8e'),_0x52d409);}BPromise[_0x47a5('0x8f')]()[_0x47a5('0x26')](function(){if(!_0x3548bc){if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x71')]||_0x87e4c9[_0x47a5('0x39')]['journey'])return;_0x4618a0['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x34a9ae['where'](_0x47a5('0x90'));return;}return _0x87e4c9[_0x47a5('0x91')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x47a5('0x26')](function(_0x44dda2){if(_[_0x47a5('0x70')](_0x44dda2)){_0x4618a0[_0x47a5('0x42')](_0x47a5('0x92'));_0x34a9ae[_0x47a5('0x42')](_0x47a5('0x92'));}else{_0x4618a0[_0x47a5('0x42')](_0x47a5('0x72'),_[_0x47a5('0x2c')](_0x44dda2,'id'));_0x34a9ae[_0x47a5('0x42')]('i.WhatsappAccountId\x20IN\x20?',_[_0x47a5('0x2c')](_0x44dda2,'id'));}});})[_0x47a5('0x26')](function(){db[_0x47a5('0x93')]['query'](_0x4618a0[_0x47a5('0x94')](),_0x308c9a)[_0x47a5('0x26')](function(_0x17b61d){_0x50c086['count']=_0x17b61d[_0x47a5('0x3e')];if(_0x50c086['count']===0x0)return[];return db['sequelize'][_0x47a5('0x39')](_0x586f4f[_0x47a5('0x94')](),_0x308c9a)[_0x47a5('0x26')](function(_0x27333e){_0x23bd8d=_[_0x47a5('0x95')](_0x27333e,'id');_0x308c9a=_[_0x47a5('0x96')](_0x308c9a,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x87e4c9['query'][_0x47a5('0x3d')]){_0x52749b['attributes'][_0x47a5('0x8c')](function(_0x3fffd1){_0x34a9ae[_0x47a5('0x49')]('i.'+_0x3fffd1);});}else{_0x34a9ae[_0x47a5('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x47a5('0x5d'));_0x34a9ae['field']('a.key',_0x47a5('0x97'));_0x34a9ae[_0x47a5('0x49')]('a.mandatoryDisposition',_0x47a5('0x98'));_0x34a9ae[_0x47a5('0x49')](_0x47a5('0x99'));_0x34a9ae['field'](_0x47a5('0x9a'),'Contact.firstName');_0x34a9ae[_0x47a5('0x49')](_0x47a5('0x9b'),_0x47a5('0x9c'));_0x34a9ae['field'](_0x47a5('0x9d'),_0x47a5('0x9e'));_0x34a9ae[_0x47a5('0x49')]('c.phone',_0x47a5('0x9f'));_0x34a9ae['field'](_0x47a5('0xa0'),'Contact.mobile');_0x34a9ae[_0x47a5('0x49')](_0x47a5('0xa1'),_0x47a5('0xa2'));_0x34a9ae[_0x47a5('0x49')]('o.fullname',_0x47a5('0xa3'));_0x34a9ae[_0x47a5('0x49')](_0x47a5('0xa4'),_0x47a5('0xa5'));_0x34a9ae[_0x47a5('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x52749b[_0x47a5('0x1f')])_0x34a9ae['limit'](_0x52749b[_0x47a5('0x1f')]);if(_0x52749b[_0x47a5('0x1e')])_0x34a9ae[_0x47a5('0x1e')](_0x52749b['offset']);return db[_0x47a5('0x93')][_0x47a5('0x39')](_0x34a9ae['toString'](),_0x308c9a);})[_0x47a5('0x26')](function(_0x8a9dea){_0x3a740b[_0x47a5('0x42')](_0x47a5('0xa6'),_['map'](_0x8a9dea,'id'));return db['sequelize'][_0x47a5('0x39')](_0x3a740b[_0x47a5('0x94')](),_0x308c9a)['then'](function(_0x27d422){var _0x23f055=_['groupBy'](_0x27d422,_0x47a5('0xa7'));var _0x2a02cd=[];_0x8a9dea[_0x47a5('0x8c')](function(_0x59f010){_0x2a02cd[_0x47a5('0x31')](updateWhatsappInteraction(_0x59f010,_0x23bd8d,_0x23f055));});return BPromise['all'](_0x2a02cd);});});})[_0x47a5('0x26')](function(_0x5e2946){_0x50c086[_0x47a5('0xa8')]=_0x5e2946;return _0x50c086;})[_0x47a5('0x26')](respondWithFilteredResult(_0xf269a8,_0x52749b));})['catch'](handleError(_0xf269a8,null));};exports[_0x47a5('0xa9')]=function(_0x597cb2,_0x1eabef){var _0x36f619={'raw':![],'where':{'id':_0x597cb2[_0x47a5('0xaa')]['id']}},_0x37e045={};_0x37e045['model']=_[_0x47a5('0x3a')](db['WhatsappInteraction']['rawAttributes']);_0x37e045[_0x47a5('0x39')]=_[_0x47a5('0x3a')](_0x597cb2[_0x47a5('0x39')]);_0x37e045[_0x47a5('0x44')]=_[_0x47a5('0x3b')](_0x37e045['model'],_0x37e045[_0x47a5('0x39')]);_0x36f619[_0x47a5('0x3c')]=_[_0x47a5('0x3b')](_0x37e045[_0x47a5('0x38')],qs['fields'](_0x597cb2[_0x47a5('0x39')]['fields']));_0x36f619[_0x47a5('0x3c')]=_0x36f619[_0x47a5('0x3c')][_0x47a5('0x3e')]?_0x36f619[_0x47a5('0x3c')]:_0x37e045[_0x47a5('0x38')];if(_0x597cb2[_0x47a5('0x39')][_0x47a5('0xab')]){_0x36f619[_0x47a5('0xac')]=[{'all':!![]}];}_0x36f619=_[_0x47a5('0x96')]({},_0x36f619,_0x597cb2['options']);return db[_0x47a5('0xad')][_0x47a5('0x5c')](_0x36f619)['then'](handleEntityNotFound(_0x1eabef,null))[_0x47a5('0x26')](respondWithResult(_0x1eabef,null))[_0x47a5('0x32')](handleError(_0x1eabef,null));};exports[_0x47a5('0xae')]=function(_0x5b85cd,_0x4bf1f5){return db[_0x47a5('0xad')][_0x47a5('0xae')](_0x5b85cd['body'],{})['then'](respondWithResult(_0x4bf1f5,0xc9))[_0x47a5('0x32')](handleError(_0x4bf1f5,null));};exports[_0x47a5('0x24')]=function(_0x54eab1,_0x29e384){if(_0x54eab1[_0x47a5('0x6f')]['id']){delete _0x54eab1['body']['id'];}return db[_0x47a5('0xad')][_0x47a5('0x5c')]({'where':{'id':_0x54eab1[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x29e384,null))[_0x47a5('0x26')](saveUpdates(_0x54eab1[_0x47a5('0x6f')],null))['then'](respondWithResult(_0x29e384,null))['catch'](handleError(_0x29e384,null));};exports['destroy']=function(_0x133b7a,_0xce5ada){return db['WhatsappInteraction'][_0x47a5('0x5c')]({'where':{'id':_0x133b7a[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0xce5ada,null))[_0x47a5('0x26')](removeEntity(_0xce5ada,null))[_0x47a5('0x32')](handleError(_0xce5ada,null));};exports['describe']=function(_0x3e7750,_0x548a06){return db['WhatsappInteraction']['describe']()[_0x47a5('0x26')](respondWithResult(_0x548a06,null))['catch'](handleError(_0x548a06,null));};exports[_0x47a5('0xaf')]=function(_0xf3edc8,_0x5a316e,_0x49f791){return db[_0x47a5('0xb0')][_0x47a5('0x5c')]({'where':{'id':_0xf3edc8[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x5a316e,null))[_0x47a5('0x26')](function(_0x581a87){if(_0x581a87){return _0x581a87[_0x47a5('0xaf')](_0xf3edc8[_0x47a5('0x6f')]['ids'],_[_0x47a5('0xb1')](_0xf3edc8[_0x47a5('0x6f')],[_0x47a5('0xb2'),'id'])||{});}})[_0x47a5('0x26')](respondWithResult(_0x5a316e,null))[_0x47a5('0x32')](handleError(_0x5a316e,null));};exports[_0x47a5('0xb3')]=function(_0x5112d7,_0x6a8174,_0x2e418d){var _0x50b236={'raw':![],'where':{}};var _0x263521={};var _0x9769b5={'count':0x0,'rows':[]};return db[_0x47a5('0xad')][_0x47a5('0xb4')]({'where':{'id':_0x5112d7['params']['id']}})['then'](handleEntityNotFound(_0x6a8174,null))['then'](function(_0x4eee99){if(_0x4eee99){_0x263521[_0x47a5('0x38')]=_[_0x47a5('0x3a')](db[_0x47a5('0xb0')][_0x47a5('0x34')]);_0x263521[_0x47a5('0x39')]=_[_0x47a5('0x3a')](_0x5112d7[_0x47a5('0x39')]);_0x263521[_0x47a5('0x44')]=_['intersection'](_0x263521[_0x47a5('0x38')],_0x263521[_0x47a5('0x39')]);_0x50b236[_0x47a5('0x3c')]=_[_0x47a5('0x3b')](_0x263521['model'],qs['fields'](_0x5112d7[_0x47a5('0x39')]['fields']));_0x50b236['attributes']=_0x50b236[_0x47a5('0x3c')][_0x47a5('0x3e')]?_0x50b236['attributes']:_0x263521[_0x47a5('0x38')];if(!_0x5112d7[_0x47a5('0x39')][_0x47a5('0x3f')]('nolimit')){_0x50b236[_0x47a5('0x1f')]=qs[_0x47a5('0x1f')](_0x5112d7['query'][_0x47a5('0x1f')]);_0x50b236[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x5112d7[_0x47a5('0x39')][_0x47a5('0x1e')]);}_0x50b236[_0x47a5('0x40')]=qs['sort'](_0x5112d7[_0x47a5('0x39')]['sort']);_0x50b236[_0x47a5('0x42')]=qs[_0x47a5('0x44')](_[_0x47a5('0x43')](_0x5112d7[_0x47a5('0x39')],_0x263521['filters']));_0x50b236[_0x47a5('0x42')][_0x47a5('0xa7')]=_0x4eee99['id'];if(_0x5112d7[_0x47a5('0x39')][_0x47a5('0x7f')]){_0x50b236[_0x47a5('0x42')]=_[_0x47a5('0x96')](_0x50b236[_0x47a5('0x42')],{'$or':_[_0x47a5('0x2c')](_0x50b236[_0x47a5('0x3c')],function(_0xa2045c){var _0x109738={};_0x109738[_0xa2045c]={'$like':'%'+_0x5112d7[_0x47a5('0x39')]['filter']+'%'};return _0x109738;})});}if(_0x5112d7[_0x47a5('0x39')][_0x47a5('0x75')]){var _0x591bde=_0x5112d7[_0x47a5('0x39')][_0x47a5('0x75')][_0x47a5('0x30')](',');var _0x2ccf21={};_0x2ccf21[_0x591bde[0x0]]={'$gte':moment(_0x591bde[0x1])[_0x47a5('0xb5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x50b236[_0x47a5('0x42')]=_[_0x47a5('0x96')](_0x50b236[_0x47a5('0x42')],_0x2ccf21);}_0x50b236=_[_0x47a5('0x96')]({},_0x50b236,_0x5112d7[_0x47a5('0xb6')]);return db[_0x47a5('0xb0')][_0x47a5('0x1d')]({'where':_0x50b236['where']})['then'](function(_0xa3d578){_0x9769b5['count']=_0xa3d578;if(_0x5112d7[_0x47a5('0x39')]['includeAll']){_0x50b236[_0x47a5('0xac')]=[{'all':!![]}];}return db[_0x47a5('0xb0')][_0x47a5('0xb7')](_0x50b236);})[_0x47a5('0x26')](function(_0x49cb8c){_0x9769b5[_0x47a5('0xa8')]=_0x49cb8c;return _0x9769b5;});}})[_0x47a5('0x26')](respondWithFilteredResult(_0x6a8174,_0x50b236))[_0x47a5('0x32')](handleError(_0x6a8174,null));};exports['addTags']=function(_0x581759,_0x30375f,_0x29015a){return db[_0x47a5('0xad')][_0x47a5('0x5c')]({'where':{'id':_0x581759[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x30375f,null))[_0x47a5('0x26')](function(_0xe662d7){if(_0xe662d7){return _0xe662d7['setTags'](_0x581759[_0x47a5('0x6f')]['ids'],_[_0x47a5('0xb1')](_0x581759[_0x47a5('0x6f')],['ids','id'])||{})['spread'](function(){return db[_0x47a5('0x69')][_0x47a5('0xb7')]({'attributes':['id','name',_0x47a5('0x46')],'where':{'id':_0x581759[_0x47a5('0x6f')][_0x47a5('0xb2')]}});})[_0x47a5('0x26')](function(_0x5a7f32){socket[_0x47a5('0xb8')]('whatsappInteractionTags:save',{'id':Number(_0x581759['params']['id']),'tags':_0x5a7f32||[]});return{'id':Number(_0x581759['params']['id']),'tags':_0x5a7f32||[]};});}})[_0x47a5('0x26')](respondWithResult(_0x30375f,null))['catch'](handleError(_0x30375f,null));};exports[_0x47a5('0xb9')]=function(_0x156d51,_0x401139,_0x2005d5){return db[_0x47a5('0xad')][_0x47a5('0x5c')]({'where':{'id':_0x156d51[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x401139,null))[_0x47a5('0x26')](function(_0x2200f9){if(_0x2200f9){return _0x2200f9[_0x47a5('0xb9')](_0x156d51[_0x47a5('0x39')][_0x47a5('0xb2')]);}})[_0x47a5('0x26')](respondWithStatusCode(_0x401139,null))[_0x47a5('0x32')](handleError(_0x401139,null));};exports['download']=function(_0xdd95c8,_0x40aee5){var _0x322cee=moment()[_0x47a5('0xba')]()['toString']();var _0x367662=path['join'](config[_0x47a5('0xbb')],'server',_0x47a5('0xbc'),_0x47a5('0xbd'));var _0x3b894d=path['join'](config[_0x47a5('0xbb')],_0x47a5('0xbe'),_0x47a5('0xbc'),'attachments');var _0x52798d=path[_0x47a5('0xbf')](_0x367662,_0x322cee);var _0x1a5e07=util[_0x47a5('0xb5')](_0x47a5('0xc0'),_0xdd95c8[_0x47a5('0xaa')]['id'],_0x322cee);var _0x579e5c=path[_0x47a5('0xbf')](_0x367662,_0x1a5e07);var _0x4b3ae4=[];_0x4b3ae4[_0x47a5('0x31')]({'model':db[_0x47a5('0xc1')],'as':_0x47a5('0xc1'),'attributes':['id',_0x47a5('0x2d')],'raw':!![]});_0x4b3ae4['push']({'model':db['CmContact'],'as':_0x47a5('0x61'),'attributes':['id',_0x47a5('0xc2'),_0x47a5('0xc3')],'raw':!![]});if(_0xdd95c8[_0x47a5('0x39')][_0x47a5('0xc4')]){_0x4b3ae4[_0x47a5('0x31')]({'model':db[_0x47a5('0xc5')],'as':_0x47a5('0xc5'),'raw':!![]});}var _0x2c2245=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0x47a5('0x6f'),'createdAt',_0x47a5('0xc6'),_0x47a5('0xc7'),_0x47a5('0x7b')],'include':_0x4b3ae4}];_0x2c2245['push']({'model':db[_0x47a5('0xc8')],'as':_0x47a5('0xc9'),'attributes':['id','name']});_0x2c2245[_0x47a5('0x31')]({'model':db['User'],'as':_0x47a5('0xca'),'attributes':['id',_0x47a5('0x2d')]});return db[_0x47a5('0xad')]['find']({'where':{'id':_0xdd95c8['params']['id']},'include':_0x2c2245})['then'](handleEntityNotFound(_0x40aee5,null))['then'](function(_0x5075a6){if(_0x5075a6){var _0x1ba5b6=_0x5075a6['get']({'plain':!![]});fs[_0x47a5('0xcb')](_0x52798d);var _0x2287b0={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':'<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>'}},'footer':{'height':_0x47a5('0xcc'),'contents':{'default':util['format']('<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>',util['format'](_0x47a5('0xcd'),_0x47a5('0xce'),_0x1ba5b6['id']),moment()[_0x47a5('0xb5')](_0x47a5('0xcf'))['toString']())}}};var _0xdda046={'channel':'Whatsapp','account':_0x1ba5b6[_0x47a5('0xc9')]['name'],'agent':_0x1ba5b6[_0x47a5('0xca')]?_0x1ba5b6[_0x47a5('0xca')][_0x47a5('0x2d')]:'N.A.','createdAt':moment(_0x1ba5b6[_0x47a5('0x74')])[_0x47a5('0xb5')](_0x47a5('0xd0'))[_0x47a5('0x94')](),'closedAt':_0x1ba5b6['closed']?moment(_0x1ba5b6[_0x47a5('0xd1')])[_0x47a5('0xb5')](_0x47a5('0xd0'))[_0x47a5('0x94')]():'','disposition':_0x1ba5b6[_0x47a5('0xd2')],'messages':_(_0x1ba5b6[_0x47a5('0xd3')])['filter']({'secret':![]})[_0x47a5('0x2c')](function(_0xe245ca){if(_0xe245ca[_0x47a5('0xc5')]){var _0xac8d4f=path[_0x47a5('0xbf')](_0x3b894d,_0xe245ca[_0x47a5('0xc5')][_0x47a5('0xd4')]);if(fs[_0x47a5('0xd5')](_0xac8d4f)){fs[_0x47a5('0xd6')](_0xac8d4f)[_0x47a5('0xd7')](fs[_0x47a5('0xd8')](path[_0x47a5('0xbf')](_0x52798d,_0xe245ca[_0x47a5('0xc5')][_0x47a5('0xd4')])));}}return{'date':moment(_0xe245ca[_0x47a5('0x74')])[_0x47a5('0xb5')](_0x47a5('0xd0'))['toString'](),'sender':_0xe245ca[_0x47a5('0xc6')]==='out'?_0xe245ca['User']?_0xe245ca[_0x47a5('0xc1')][_0x47a5('0x2d')]:_0x47a5('0xd9'):_0xe245ca['Contact'][_0x47a5('0xc2')]+(_0xe245ca[_0x47a5('0x61')][_0x47a5('0xc3')]?'\x20'+_0xe245ca[_0x47a5('0x61')][_0x47a5('0xc3')]:''),'body':_0xe245ca[_0x47a5('0xc5')]?_0xe245ca[_0x47a5('0xc5')][_0x47a5('0xd4')]:_0xe245ca[_0x47a5('0x6f')],'direction':_0xe245ca[_0x47a5('0xc6')]===_0x47a5('0xda')?'A':'C','secret':_0xe245ca[_0x47a5('0xc7')],'read':_0xe245ca[_0x47a5('0x7b')],'attachment':_0xe245ca['Attachment']};})['value']()};return ejs[_0x47a5('0xdb')](path['join'](config[_0x47a5('0xbb')],_0x47a5('0xbe'),_0x47a5('0xdc'),_0x47a5('0xdd')),{'interaction':_0xdda046})[_0x47a5('0x26')](function(_0x3708ea){return new BPromise(function(_0x583b37,_0x2b4039){pdf[_0x47a5('0xae')](_0x3708ea,_0x2287b0)[_0x47a5('0xde')](path['join'](_0x52798d,_0x47a5('0xdf')+_0x1ba5b6['id']+'-'+_0x322cee+_0x47a5('0xe0')),function(_0x3ecc41,_0x3e4148){if(_0x3ecc41)return _0x2b4039(_0x3ecc41);_0x583b37(_0x3e4148);});});})[_0x47a5('0x26')](function(){return new BPromise(function(_0x23e649,_0x35e20f){zipdir(_0x52798d,{'saveTo':_0x579e5c},function(_0x46615a,_0xd6e255){if(_0x46615a)return _0x35e20f(_0x46615a);return _0x23e649(_0xd6e255);});})[_0x47a5('0x26')](function(){return new BPromise(function(_0x1b91ad,_0x40b7a5){rimraf(_0x52798d,function(_0x28e998){if(_0x28e998)_0x40b7a5(_0x28e998);return _0x1b91ad();});});})[_0x47a5('0x26')](function(){return _0x40aee5[_0x47a5('0xe1')](_0x579e5c,_0x1a5e07,function(_0x3f7fdc){if(_0x3f7fdc){console[_0x47a5('0xe2')](_0x47a5('0xe3'),_0x3f7fdc);}else{fs[_0x47a5('0xe4')](_0x579e5c);}});});});}else{return _0x40aee5[_0x47a5('0x1a')](0xc8);}})[_0x47a5('0x32')](handleError(_0x40aee5,null));};
\ No newline at end of file
+var _0x814b=['index','rawAttributes','type','key','model','query','intersection','attributes','length','nolimit','limit','order','sort','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','keys','some','compact','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','toString','count','sequelize','fields','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','WhatsappInteraction','includeAll','merge','options','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','10px','<div\x20class=\x22header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h5>Interaction\x20Transcript</h5>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>','%s\x20#%d','Whatsapp','YYYY-MM-DD','closedAt','disposition','existsSync','basename','out','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','TagIds','split','forEach','push','catch'];(function(_0x20ff9b,_0x50df75){var _0x5f49cf=function(_0x490def){while(--_0x490def){_0x20ff9b['push'](_0x20ff9b['shift']());}};_0x5f49cf(++_0x50df75);}(_0x814b,0x1a2));var _0xb814=function(_0x545fe3,_0x3b191f){_0x545fe3=_0x545fe3-0x0;var _0x480702=_0x814b[_0x545fe3];return _0x480702;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];config[_0xb814('0x1a')]=_[_0xb814('0x1b')](config[_0xb814('0x1a')],{'host':_0xb814('0x1c'),'port':0x18eb});var socket=require(_0xb814('0x1d'))(new Redis(config[_0xb814('0x1a')]));require(_0xb814('0x1e'))[_0xb814('0x1f')](socket);function respondWithStatusCode(_0x2ab627,_0x3f4881){_0x3f4881=_0x3f4881||0xcc;return function(_0x44fb96){if(_0x44fb96){return _0x2ab627[_0xb814('0x20')](_0x3f4881);}return _0x2ab627[_0xb814('0x21')](_0x3f4881)[_0xb814('0x22')]();};}function respondWithResult(_0x3a71d6,_0x45e0d0){_0x45e0d0=_0x45e0d0||0xc8;return function(_0x265a83){if(_0x265a83){return _0x3a71d6[_0xb814('0x21')](_0x45e0d0)[_0xb814('0x23')](_0x265a83);}};}function respondWithFilteredResult(_0x7a21ef,_0x48c9df){return function(_0x168a48){if(_0x168a48){var _0x55ba16=_0x168a48['count'],_0x270598=_0x48c9df['offset'],_0xfac75b=_0x48c9df[_0xb814('0x24')]+_0x48c9df['limit'],_0x4c3007;if(_0xfac75b>=_0x55ba16){_0xfac75b=_0x55ba16;_0x4c3007=0xc8;}else{_0x4c3007=0xce;}_0x7a21ef['status'](_0x4c3007);return _0x7a21ef[_0xb814('0x25')](_0xb814('0x26'),_0x270598+'-'+_0xfac75b+'/'+_0x55ba16)[_0xb814('0x23')](_0x168a48);}return null;};}function patchUpdates(_0x4e139e){return function(_0xf5b8aa){try{jsonpatch['apply'](_0xf5b8aa,_0x4e139e,!![]);}catch(_0x1e6393){return BPromise[_0xb814('0x27')](_0x1e6393);}return _0xf5b8aa[_0xb814('0x28')]();};}function saveUpdates(_0x470e81,_0x27352e){return function(_0x2bd039){if(_0x2bd039){return _0x2bd039[_0xb814('0x29')](_0x470e81)['then'](function(_0x2ead86){return _0x2ead86;});}return null;};}function removeEntity(_0x52b7a3,_0x3f81d0){return function(_0x457dac){if(_0x457dac){return _0x457dac[_0xb814('0x2a')]()[_0xb814('0x2b')](function(){_0x52b7a3[_0xb814('0x21')](0xcc)[_0xb814('0x22')]();});}};}function handleEntityNotFound(_0x3d836c,_0x5755ea){return function(_0x392222){if(!_0x392222){_0x3d836c[_0xb814('0x20')](0x194);}return _0x392222;};}function handleError(_0x1c2625,_0x349394){_0x349394=_0x349394||0x1f4;return function(_0x32ed56){logger[_0xb814('0x2c')](_0x32ed56[_0xb814('0x2d')]);if(_0x32ed56[_0xb814('0x2e')]){delete _0x32ed56['name'];}_0x1c2625[_0xb814('0x21')](_0x349394)[_0xb814('0x2f')](_0x32ed56);};}function getInteractionUsers(_0x52ed64,_0x9008b2){return new BPromise(function(_0x37d24d,_0x530744){try{if(_0x9008b2[_0x52ed64['id']]){_0x52ed64['Users']=_[_0xb814('0x30')](_0x9008b2[_0x52ed64['id']],function(_0x2051d0){return{'id':_0x2051d0['id'],'fullname':_0x2051d0['fullname']};});}}catch(_0x338a28){_0x530744(_0x338a28);}_0x37d24d(_0x52ed64);});}function getInteractionTags(_0x526610,_0x6efe9a){return new BPromise(function(_0x5f3e9b,_0x4cfc58){try{if(_0x526610[_0xb814('0x31')]){_0x526610['Tags']=[];_0x526610[_0xb814('0x31')][_0xb814('0x32')](',')[_0xb814('0x33')](function(_0x599f9f){_0x526610['Tags'][_0xb814('0x34')](_0x6efe9a[_0x599f9f]);});}delete _0x526610[_0xb814('0x31')];}catch(_0x523566){_0x4cfc58(_0x523566);}_0x5f3e9b(_0x526610);});}function updateWhatsappInteraction(_0x2c8943,_0xe558d5,_0x692c72){return new BPromise(function(_0x217b7e,_0x1b78de){return getInteractionUsers(_0x2c8943,_0x692c72)[_0xb814('0x2b')](function(_0x3672f3){return getInteractionTags(_0x3672f3,_0xe558d5);})['then'](function(_0x3207ec){_0x217b7e(_0x3207ec);})[_0xb814('0x35')](function(_0x30de5a){_0x1b78de(_0x30de5a);});});}exports[_0xb814('0x36')]=function(_0x14100d,_0x4ff31a){var _0x16ef82={},_0x57e6e6={},_0x43db67={'count':0x0,'rows':[]};var _0x16e21c=_[_0xb814('0x30')](db['WhatsappInteraction'][_0xb814('0x37')],function(_0xbdb3e9){return{'name':_0xbdb3e9['fieldName'],'type':_0xbdb3e9[_0xb814('0x38')][_0xb814('0x39')]};});_0x57e6e6[_0xb814('0x3a')]=_[_0xb814('0x30')](_0x16e21c,_0xb814('0x2e'));_0x57e6e6[_0xb814('0x3b')]=_['keys'](_0x14100d[_0xb814('0x3b')]);_0x57e6e6['filters']=_[_0xb814('0x3c')](_0x57e6e6['model'],_0x57e6e6[_0xb814('0x3b')]);_0x16ef82['attributes']=_[_0xb814('0x3c')](_0x57e6e6[_0xb814('0x3a')],qs['fields'](_0x14100d['query']['fields']));_0x16ef82['attributes']=_0x16ef82[_0xb814('0x3d')][_0xb814('0x3e')]?_0x16ef82[_0xb814('0x3d')]:_0x57e6e6[_0xb814('0x3a')];if(!_0x14100d['query']['hasOwnProperty'](_0xb814('0x3f'))){_0x16ef82['limit']=qs[_0xb814('0x40')](_0x14100d[_0xb814('0x3b')][_0xb814('0x40')]);_0x16ef82[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x14100d[_0xb814('0x3b')][_0xb814('0x24')]);}_0x16ef82[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x14100d['query']['sort']);_0x16ef82['where']=qs[_0xb814('0x43')](_['pick'](_0x14100d[_0xb814('0x3b')],_0x57e6e6['filters']),_0x16e21c);var _0x411723=[];var _0x44ff56=squel[_0xb814('0x44')]()[_0xb814('0x45')]('id')['field'](_0xb814('0x2e'))[_0xb814('0x45')](_0xb814('0x46'))[_0xb814('0x47')](_0xb814('0x48'));var _0x450a08=squel['select']()[_0xb814('0x45')](_0xb814('0x49'))[_0xb814('0x45')](_0xb814('0x4a'))[_0xb814('0x45')](_0xb814('0x4b'))[_0xb814('0x47')]('user_has_whatsapp_interactions','ui')['left_join'](_0xb814('0x4c'),'u',_0xb814('0x4d'));var _0x4c08d6=squel[_0xb814('0x44')]()[_0xb814('0x47')](_0xb814('0x4e'),'i')[_0xb814('0x4f')](_0xb814('0x50'),'c',_0xb814('0x51'))[_0xb814('0x4f')](_0xb814('0x4c'),'o','o.id\x20=\x20i.UserId')[_0xb814('0x4f')](_0xb814('0x52'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0xb814('0x4f')]('whatsapp_messages','me',_0xb814('0x53'))[_0xb814('0x4f')](_0xb814('0x54'),'it',_0xb814('0x55'))[_0xb814('0x4f')](_0xb814('0x48'),'t',_0xb814('0x56'));var _0x45480e=squel[_0xb814('0x57')]();var _0x2a422a=[];var _0x5e6df7=squel['expr']();var _0x32eca6;if(_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]){_0x32eca6=as[_0xb814('0x59')](_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]);var _0x135208=_0x32eca6['sqlOperator'];for(var _0x26fd0b=0x0;_0x26fd0b<_0x32eca6[_0xb814('0x5a')][_0xb814('0x3e')];_0x26fd0b++){var _0x5a916d=_0x32eca6[_0xb814('0x5a')][_0x26fd0b];var _0x4e6f3c='i';var _0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),_0x5a916d[_0xb814('0x45')]]);if(!_0x252293){switch(_0x5a916d['field']){case _0xb814('0x5b'):if(_0x5a916d[_0xb814('0x5c')]==0x1){_0x4c08d6[_0xb814('0x5d')]('`'+_0x5a916d['field']+_0xb814('0x5e'));}else{_0x4c08d6['having']('`'+_0x5a916d[_0xb814('0x45')]+_0xb814('0x5f'));}break;case'Contact':if(_0x5a916d[_0xb814('0x60')]==='$substring'){if(_0x5a916d['value'][_0xb814('0x32')]('\x20')[_0xb814('0x3e')]>0x1){_0x45480e[_0x135208](_0xb814('0x61'),qs['getFullTextValue'](_0x5a916d[_0xb814('0x5c')]),null);}else{var _0x538b0f='%'+_0x5a916d[_0xb814('0x5c')]+'%';_0x45480e[_0x135208](_0xb814('0x62'),_0x538b0f,_0x538b0f,_0x538b0f);}}else{_0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),'ContactId']);_0x5a916d[_0xb814('0x45')]=_0xb814('0x63');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x67'):var _0x5441c5=_0x5a916d['value'][_0xb814('0x32')](',')[_0xb814('0x30')](function(_0x4d13db){return Number(_0x4d13db);});_0x5441c5[_0xb814('0x33')](function(_0x58b9a6){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x58b9a6+',%');});_0x2a422a=_[_0xb814('0x68')](_0x2a422a,_0x5441c5);break;case'User':if(_0x5a916d[_0xb814('0x60')]===_0xb814('0x69')){_0x45480e[_0x135208](_0xb814('0x6a'),'%'+_0x5a916d['value']+'%',null);}else{_0x252293=_[_0xb814('0x6b')](_0x16e21c,['name',_0xb814('0x6c')]);_0x5a916d[_0xb814('0x45')]=_0xb814('0x6c');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x6d'):_0x135e13=as[_0xb814('0x64')]('me',null,_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);break;}}else{var _0x135e13=as['buildExpression'](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')]['start'],_0x135e13[_0xb814('0x5c')]['end']);}}}else{var _0x37e9c5=_(_0x14100d['query'])[_0xb814('0x6e')]()[_0xb814('0x30')](function(_0xa03cd2){return _[_0xb814('0x6f')](_0x16e21c,[_0xb814('0x2e'),_0xa03cd2])?_0xa03cd2:undefined;})[_0xb814('0x70')]()[_0xb814('0x5c')]();if(!_['isEmpty'](_0x37e9c5)){_0x37e9c5[_0xb814('0x33')](function(_0x51ca51){if(_0x51ca51===_0xb814('0x71')){_0x4c08d6[_0xb814('0x72')](_0xb814('0x73'),[][_0xb814('0x74')](_0x14100d[_0xb814('0x3b')][_0x51ca51]));}else if(_0x51ca51===_0xb814('0x75')){var _0x514dab=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])['$gte'];var _0x3bb2b4=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])[_0xb814('0x77')];_0x4c08d6[_0xb814('0x72')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x514dab,_0x3bb2b4);}else{if(_0x14100d[_0xb814('0x3b')][_0x51ca51]==='null'){_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x78'));}else{_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x79'),_0x14100d[_0xb814('0x3b')][_0x51ca51]);}}});}if(_0x14100d[_0xb814('0x3b')]['read']){if(_0x14100d['query']['read']==0x1){_0x4c08d6[_0xb814('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x4c08d6[_0xb814('0x5d')](_0xb814('0x7a'));}}if(_0x14100d[_0xb814('0x3b')]['tag']){_0x2a422a=_[_0xb814('0x7b')](_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')])?_0x14100d['query'][_0xb814('0x7c')]:new Array(_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')]);_0x2a422a[_0xb814('0x33')](function(_0x555be0){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x555be0+',%');});}if(_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')]){var _0x39863d=_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')][_0xb814('0x7e')]('\x5c','\x5c\x5c')[_0xb814('0x7e')]('\x27\x27',_0xb814('0x7f'));if(qs[_0xb814('0x80')](_0x39863d)){_0x45480e['or'](_0xb814('0x81'),_0x39863d+'%')['or'](_0xb814('0x82'),_0x39863d+'%');}else{_0x45480e['or'](_0xb814('0x83'),qs[_0xb814('0x84')](_0x39863d))['or'](_0xb814('0x85'),_0x39863d+'%');}}}_0x4c08d6[_0xb814('0x72')](_0x45480e);_0x4c08d6['group'](_0xb814('0x86'));var _0x33cfc4={'type':db[_0xb814('0x87')][_0xb814('0x88')][_0xb814('0x89')],'raw':!![]};var _0x283b0f=_0x4c08d6['clone']();_0x283b0f[_0xb814('0x45')]('i.id');_0x283b0f[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));if(_0x16ef82[_0xb814('0x41')]){_0x16ef82[_0xb814('0x41')]['forEach'](function(_0x4c44ee){_0x4c08d6[_0xb814('0x41')]('i.'+_0x4c44ee[0x0],_0x4c44ee[0x1]===_0xb814('0x8b')?![]:!![]);});}if(!_[_0xb814('0x8c')](_0x2a422a)){_0x4c08d6[_0xb814('0x5d')](_0x5e6df7);_0x283b0f['where'](_0xb814('0x8d'),_0x2a422a);}BPromise['resolve']()[_0xb814('0x2b')](function(){if(!_0x32eca6){if(_0x14100d[_0xb814('0x3b')]['WhatsappAccountId']||_0x14100d['query'][_0xb814('0x8e')])return;_0x283b0f['where'](_0xb814('0x8f'));_0x4c08d6[_0xb814('0x72')](_0xb814('0x8f'));return;}return _0x14100d[_0xb814('0x90')][_0xb814('0x91')]({'attributes':['id'],'raw':!![]})[_0xb814('0x2b')](function(_0x40fe4a){if(_['isEmpty'](_0x40fe4a)){_0x283b0f[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x283b0f[_0xb814('0x72')](_0xb814('0x73'),_['map'](_0x40fe4a,'id'));_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IN\x20?',_[_0xb814('0x30')](_0x40fe4a,'id'));}});})[_0xb814('0x2b')](function(){db['sequelize']['query'](_0x283b0f[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x3309c5){_0x43db67[_0xb814('0x93')]=_0x3309c5[_0xb814('0x3e')];if(_0x43db67[_0xb814('0x93')]===0x0)return[];return db[_0xb814('0x94')][_0xb814('0x3b')](_0x44ff56[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x53e705){_0x411723=_['keyBy'](_0x53e705,'id');_0x33cfc4=_['merge'](_0x33cfc4,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14100d['query'][_0xb814('0x95')]){_0x16ef82[_0xb814('0x3d')][_0xb814('0x33')](function(_0x59f3ff){_0x4c08d6[_0xb814('0x45')]('i.'+_0x59f3ff);});}else{_0x4c08d6[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x96'),_0xb814('0x97'));_0x4c08d6[_0xb814('0x45')]('a.mandatoryDisposition',_0xb814('0x98'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x99'));_0x4c08d6[_0xb814('0x45')]('c.firstName',_0xb814('0x9a'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x9b'),_0xb814('0x9c'));_0x4c08d6[_0xb814('0x45')]('c.email','Contact.email');_0x4c08d6[_0xb814('0x45')]('c.phone',_0xb814('0x9d'));_0x4c08d6[_0xb814('0x45')]('c.mobile',_0xb814('0x9e'));_0x4c08d6['field'](_0xb814('0x9f'),'Contact.fax');_0x4c08d6[_0xb814('0x45')](_0xb814('0xa0'),_0xb814('0xa1'));_0x4c08d6[_0xb814('0x45')](_0xb814('0xa2'),_0xb814('0xa3'));_0x4c08d6[_0xb814('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x16ef82[_0xb814('0x40')])_0x4c08d6['limit'](_0x16ef82['limit']);if(_0x16ef82[_0xb814('0x24')])_0x4c08d6[_0xb814('0x24')](_0x16ef82[_0xb814('0x24')]);return db['sequelize'][_0xb814('0x3b')](_0x4c08d6['toString'](),_0x33cfc4);})[_0xb814('0x2b')](function(_0x19d508){_0x450a08[_0xb814('0x72')](_0xb814('0xa4'),_['map'](_0x19d508,'id'));return db[_0xb814('0x94')][_0xb814('0x3b')](_0x450a08[_0xb814('0x92')](),_0x33cfc4)['then'](function(_0x1ebbf6){var _0x3fc77d=_[_0xb814('0xa5')](_0x1ebbf6,'WhatsappInteractionId');var _0x5d8626=[];_0x19d508[_0xb814('0x33')](function(_0x9dc06b){_0x5d8626[_0xb814('0x34')](updateWhatsappInteraction(_0x9dc06b,_0x411723,_0x3fc77d));});return BPromise[_0xb814('0xa6')](_0x5d8626);});});})[_0xb814('0x2b')](function(_0x37a7ab){_0x43db67[_0xb814('0xa7')]=_0x37a7ab;return _0x43db67;})[_0xb814('0x2b')](respondWithFilteredResult(_0x4ff31a,_0x16ef82));})[_0xb814('0x35')](handleError(_0x4ff31a,null));};exports[_0xb814('0xa8')]=function(_0x2569a5,_0x2a13fb){var _0x5b8d2e={'raw':![],'where':{'id':_0x2569a5[_0xb814('0xa9')]['id']}},_0x5416dc={};_0x5416dc['model']=_[_0xb814('0x6e')](db[_0xb814('0xaa')][_0xb814('0x37')]);_0x5416dc[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x2569a5[_0xb814('0x3b')]);_0x5416dc[_0xb814('0x43')]=_['intersection'](_0x5416dc['model'],_0x5416dc[_0xb814('0x3b')]);_0x5b8d2e['attributes']=_[_0xb814('0x3c')](_0x5416dc[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x2569a5['query'][_0xb814('0x95')]));_0x5b8d2e[_0xb814('0x3d')]=_0x5b8d2e[_0xb814('0x3d')][_0xb814('0x3e')]?_0x5b8d2e[_0xb814('0x3d')]:_0x5416dc['model'];if(_0x2569a5[_0xb814('0x3b')][_0xb814('0xab')]){_0x5b8d2e['include']=[{'all':!![]}];}_0x5b8d2e=_[_0xb814('0xac')]({},_0x5b8d2e,_0x2569a5[_0xb814('0xad')]);return db[_0xb814('0xaa')]['find'](_0x5b8d2e)[_0xb814('0x2b')](handleEntityNotFound(_0x2a13fb,null))[_0xb814('0x2b')](respondWithResult(_0x2a13fb,null))['catch'](handleError(_0x2a13fb,null));};exports[_0xb814('0xae')]=function(_0x171f83,_0x5b5634){return db[_0xb814('0xaa')][_0xb814('0xae')](_0x171f83[_0xb814('0x6d')],{})[_0xb814('0x2b')](respondWithResult(_0x5b5634,0xc9))[_0xb814('0x35')](handleError(_0x5b5634,null));};exports[_0xb814('0x29')]=function(_0x40ae0b,_0x336a8f){if(_0x40ae0b[_0xb814('0x6d')]['id']){delete _0x40ae0b[_0xb814('0x6d')]['id'];}return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x40ae0b['params']['id']}})['then'](handleEntityNotFound(_0x336a8f,null))[_0xb814('0x2b')](saveUpdates(_0x40ae0b['body'],null))['then'](respondWithResult(_0x336a8f,null))[_0xb814('0x35')](handleError(_0x336a8f,null));};exports['destroy']=function(_0x4f0427,_0x50cb34){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x4f0427[_0xb814('0xa9')]['id']}})['then'](handleEntityNotFound(_0x50cb34,null))[_0xb814('0x2b')](removeEntity(_0x50cb34,null))['catch'](handleError(_0x50cb34,null));};exports[_0xb814('0xaf')]=function(_0x2e6660,_0x49a8de){return db[_0xb814('0xaa')]['describe']()[_0xb814('0x2b')](respondWithResult(_0x49a8de,null))[_0xb814('0x35')](handleError(_0x49a8de,null));};exports[_0xb814('0xb0')]=function(_0x39ce17,_0x11efb8,_0xaf705d){return db[_0xb814('0xb1')][_0xb814('0x6b')]({'where':{'id':_0x39ce17[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x11efb8,null))[_0xb814('0x2b')](function(_0x3e7a9a){if(_0x3e7a9a){return _0x3e7a9a[_0xb814('0xb0')](_0x39ce17[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x39ce17[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{});}})['then'](respondWithResult(_0x11efb8,null))[_0xb814('0x35')](handleError(_0x11efb8,null));};exports[_0xb814('0xb3')]=function(_0x1868d9,_0x570191,_0x56b2aa){var _0x473b30={'raw':![],'where':{}};var _0x4af71e={};var _0x2d40e6={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xb814('0xb4')]({'where':{'id':_0x1868d9['params']['id']}})['then'](handleEntityNotFound(_0x570191,null))[_0xb814('0x2b')](function(_0x32c956){if(_0x32c956){_0x4af71e[_0xb814('0x3a')]=_[_0xb814('0x6e')](db[_0xb814('0xb1')][_0xb814('0x37')]);_0x4af71e[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x1868d9[_0xb814('0x3b')]);_0x4af71e[_0xb814('0x43')]=_[_0xb814('0x3c')](_0x4af71e['model'],_0x4af71e[_0xb814('0x3b')]);_0x473b30['attributes']=_[_0xb814('0x3c')](_0x4af71e[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x1868d9['query'][_0xb814('0x95')]));_0x473b30[_0xb814('0x3d')]=_0x473b30[_0xb814('0x3d')][_0xb814('0x3e')]?_0x473b30[_0xb814('0x3d')]:_0x4af71e[_0xb814('0x3a')];if(!_0x1868d9[_0xb814('0x3b')][_0xb814('0xb5')](_0xb814('0x3f'))){_0x473b30[_0xb814('0x40')]=qs[_0xb814('0x40')](_0x1868d9[_0xb814('0x3b')][_0xb814('0x40')]);_0x473b30[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x1868d9['query'][_0xb814('0x24')]);}_0x473b30[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x1868d9['query']['sort']);_0x473b30[_0xb814('0x72')]=qs['filters'](_['pick'](_0x1868d9['query'],_0x4af71e['filters']));_0x473b30[_0xb814('0x72')][_0xb814('0xb6')]=_0x32c956['id'];if(_0x1868d9['query'][_0xb814('0x7d')]){_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],{'$or':_[_0xb814('0x30')](_0x473b30[_0xb814('0x3d')],function(_0x20e608){var _0x7b9948={};_0x7b9948[_0x20e608]={'$like':'%'+_0x1868d9[_0xb814('0x3b')][_0xb814('0x7d')]+'%'};return _0x7b9948;})});}if(_0x1868d9[_0xb814('0x3b')]['$gte']){var _0x2a5dff=_0x1868d9['query'][_0xb814('0xb7')][_0xb814('0x32')](',');var _0x35e8f7={};_0x35e8f7[_0x2a5dff[0x0]]={'$gte':moment(_0x2a5dff[0x1])[_0xb814('0xb8')](_0xb814('0xb9'))};_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],_0x35e8f7);}_0x473b30=_['merge']({},_0x473b30,_0x1868d9['options']);return db['WhatsappMessage'][_0xb814('0x93')]({'where':_0x473b30[_0xb814('0x72')]})[_0xb814('0x2b')](function(_0x3b7bee){_0x2d40e6[_0xb814('0x93')]=_0x3b7bee;if(_0x1868d9[_0xb814('0x3b')][_0xb814('0xab')]){_0x473b30[_0xb814('0xba')]=[{'all':!![]}];}return db[_0xb814('0xb1')][_0xb814('0xbb')](_0x473b30);})['then'](function(_0x5c989a){_0x2d40e6[_0xb814('0xa7')]=_0x5c989a;return _0x2d40e6;});}})[_0xb814('0x2b')](respondWithFilteredResult(_0x570191,_0x473b30))[_0xb814('0x35')](handleError(_0x570191,null));};exports[_0xb814('0xbc')]=function(_0x3f0c9c,_0x2642ab,_0x48358c){return db[_0xb814('0xaa')]['find']({'where':{'id':_0x3f0c9c[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x2642ab,null))[_0xb814('0x2b')](function(_0x94aa05){if(_0x94aa05){return _0x94aa05[_0xb814('0xbd')](_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x3f0c9c[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{})[_0xb814('0xbe')](function(){return db[_0xb814('0x67')]['findAll']({'attributes':['id',_0xb814('0x2e'),_0xb814('0x46')],'where':{'id':_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')]}});})[_0xb814('0x2b')](function(_0x4a2aa5){socket[_0xb814('0xbf')](_0xb814('0xc0'),{'id':Number(_0x3f0c9c[_0xb814('0xa9')]['id']),'tags':_0x4a2aa5||[]});return{'id':Number(_0x3f0c9c['params']['id']),'tags':_0x4a2aa5||[]};});}})[_0xb814('0x2b')](respondWithResult(_0x2642ab,null))['catch'](handleError(_0x2642ab,null));};exports[_0xb814('0xc1')]=function(_0x5b4315,_0x22f6f1,_0x3467bd){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x5b4315['params']['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x22f6f1,null))[_0xb814('0x2b')](function(_0x3fda0d){if(_0x3fda0d){return _0x3fda0d[_0xb814('0xc1')](_0x5b4315[_0xb814('0x3b')][_0xb814('0xb2')]);}})[_0xb814('0x2b')](respondWithStatusCode(_0x22f6f1,null))[_0xb814('0x35')](handleError(_0x22f6f1,null));};exports[_0xb814('0xc2')]=function(_0x152260,_0x3bc03a){var _0x368696=moment()[_0xb814('0xc3')]()[_0xb814('0x92')]();var _0x8e882a=path['join'](config[_0xb814('0xc4')],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc7'));var _0x4017b6=path[_0xb814('0xc8')](config['root'],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc9'));var _0x31b4f5=path['join'](_0x8e882a,_0x368696);var _0x5b5a26=util[_0xb814('0xb8')](_0xb814('0xca'),_0x152260[_0xb814('0xa9')]['id'],_0x368696);var _0x667ca1=path[_0xb814('0xc8')](_0x8e882a,_0x5b5a26);var _0x2c510a=[];_0x2c510a['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xcb'),'attributes':['id',_0xb814('0xcc')],'raw':!![]});_0x2c510a[_0xb814('0x34')]({'model':db['CmContact'],'as':_0xb814('0xcd'),'attributes':['id',_0xb814('0xce'),_0xb814('0xcf')],'raw':!![]});if(_0x152260[_0xb814('0x3b')][_0xb814('0xc9')]){_0x2c510a['push']({'model':db[_0xb814('0xd0')],'as':_0xb814('0xd0'),'raw':!![]});}var _0x371dd7=[{'model':db[_0xb814('0xb1')],'as':_0xb814('0xd1'),'attributes':['id',_0xb814('0x6d'),_0xb814('0x75'),_0xb814('0xd2'),_0xb814('0xd3'),_0xb814('0xd4')],'include':_0x2c510a}];_0x371dd7[_0xb814('0x34')]({'model':db[_0xb814('0xd5')],'as':_0xb814('0xd6'),'attributes':['id','name']});_0x371dd7['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xd7'),'attributes':['id',_0xb814('0xcc')]});return db['WhatsappInteraction'][_0xb814('0x6b')]({'where':{'id':_0x152260[_0xb814('0xa9')]['id']},'include':_0x371dd7})[_0xb814('0x2b')](handleEntityNotFound(_0x3bc03a,null))['then'](function(_0x10537d){if(_0x10537d){var _0xa651a=_0x10537d[_0xb814('0xd8')]({'plain':!![]});fs[_0xb814('0xd9')](_0x31b4f5);var _0x6ec0f5={'format':'A4','border':_0xb814('0xda'),'header':{'height':'40px','contents':{'first':_0xb814('0xdb')}},'footer':{'height':'30px','contents':{'default':util[_0xb814('0xb8')]('<hr\x20class=\x22separator\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22left\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22center\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>{{page}}/{{pages}}</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22right\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>%s</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>',util[_0xb814('0xb8')](_0xb814('0xdc'),_0xb814('0xdd'),_0xa651a['id']),moment()['format'](_0xb814('0xde'))[_0xb814('0x92')]())}}};var _0x164304={'channel':'Whatsapp','account':_0xa651a[_0xb814('0xd6')]['name'],'agent':_0xa651a[_0xb814('0xd7')]?_0xa651a[_0xb814('0xd7')][_0xb814('0xcc')]:'N.A.','createdAt':moment(_0xa651a[_0xb814('0x75')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')](),'closedAt':_0xa651a['closed']?moment(_0xa651a[_0xb814('0xdf')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')]():'','disposition':_0xa651a[_0xb814('0xe0')],'messages':_(_0xa651a[_0xb814('0xd1')])[_0xb814('0x7d')]({'secret':![]})[_0xb814('0x30')](function(_0x9a33d0){if(_0x9a33d0['Attachment']){var _0x2fe47b=path[_0xb814('0xc8')](_0x4017b6,_0x9a33d0[_0xb814('0xd0')]['basename']);if(fs[_0xb814('0xe1')](_0x2fe47b)){fs['createReadStream'](_0x2fe47b)['pipe'](fs['createWriteStream'](path[_0xb814('0xc8')](_0x31b4f5,_0x9a33d0['Attachment'][_0xb814('0xe2')])));}}return{'date':moment(_0x9a33d0[_0xb814('0x75')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xb814('0x92')](),'sender':_0x9a33d0['direction']===_0xb814('0xe3')?_0x9a33d0['User']?_0x9a33d0[_0xb814('0xcb')][_0xb814('0xcc')]:_0xb814('0xe4'):_0x9a33d0['Contact']['firstName']+(_0x9a33d0['Contact'][_0xb814('0xcf')]?'\x20'+_0x9a33d0['Contact']['lastName']:''),'body':_0x9a33d0[_0xb814('0xd0')]?_0x9a33d0['Attachment']['basename']:_0x9a33d0['body'],'direction':_0x9a33d0[_0xb814('0xd2')]===_0xb814('0xe3')?'A':'C','secret':_0x9a33d0[_0xb814('0xd3')],'read':_0x9a33d0['read'],'attachment':_0x9a33d0[_0xb814('0xd0')]};})[_0xb814('0x5c')]()};return ejs[_0xb814('0xe5')](path[_0xb814('0xc8')](config[_0xb814('0xc4')],_0xb814('0xc5'),'views',_0xb814('0xe6')),{'interaction':_0x164304})[_0xb814('0x2b')](function(_0x28b818){return new BPromise(function(_0x171845,_0x4f2db2){pdf[_0xb814('0xae')](_0x28b818,_0x6ec0f5)[_0xb814('0xe7')](path[_0xb814('0xc8')](_0x31b4f5,_0xb814('0xe8')+_0xa651a['id']+'-'+_0x368696+_0xb814('0xe9')),function(_0x2cb01d,_0x1f4540){if(_0x2cb01d)return _0x4f2db2(_0x2cb01d);_0x171845(_0x1f4540);});});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x81ebc0,_0x2e7959){zipdir(_0x31b4f5,{'saveTo':_0x667ca1},function(_0x47f054,_0x1aa70b){if(_0x47f054)return _0x2e7959(_0x47f054);return _0x81ebc0(_0x1aa70b);});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x5706ad,_0x3b8438){rimraf(_0x31b4f5,function(_0x56e231){if(_0x56e231)_0x3b8438(_0x56e231);return _0x5706ad();});});})[_0xb814('0x2b')](function(){return _0x3bc03a[_0xb814('0xc2')](_0x667ca1,_0x5b5a26,function(_0x5e2273){if(_0x5e2273){console[_0xb814('0xea')]('err',_0x5e2273);}else{fs[_0xb814('0xeb')](_0x667ca1);}});});});}else{return _0x3bc03a[_0xb814('0x20')](0xc8);}})[_0xb814('0x35')](handleError(_0x3bc03a,null));};
\ No newline at end of file
index 99111f5..aa66da4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8a9=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','remove','getUsers','setDataValue','map','findAll','then','unreadMessages','length','emit'];(function(_0x5413eb,_0x108c04){var _0x6bf7c9=function(_0x2ddcbd){while(--_0x2ddcbd){_0x5413eb['push'](_0x5413eb['shift']());}};_0x6bf7c9(++_0x108c04);}(_0xb8a9,0x1f2));var _0x9b8a=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0xb8a9[_0x5216e0];return _0x5b3f40;};'use strict';var EventEmitter=require(_0x9b8a('0x0'));var WhatsappInteraction=require(_0x9b8a('0x1'))['db'][_0x9b8a('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x9b8a('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x9b8a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9b8a('0x5'),'afterDestroy':_0x9b8a('0x6')};function emitEvent(_0x3cee91){return function(_0x579257,_0x36b479,_0x1cc118){_0x579257[_0x9b8a('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x43cdb8){_0x579257[_0x9b8a('0x8')]('Users',_0x43cdb8[_0x9b8a('0x9')](function(_0x13255c){return{'id':_0x13255c['id']};}));return WhatsappMessage[_0x9b8a('0xa')]({'where':{'WhatsappInteractionId':_0x579257['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9b8a('0xb')](function(_0x55746e){_0x579257['setDataValue'](_0x9b8a('0xc'),_0x55746e[_0x9b8a('0xd')]);WhatsappInteractionEvents[_0x9b8a('0xe')](_0x3cee91+':'+_0x579257['id'],_0x579257);WhatsappInteractionEvents['emit'](_0x3cee91,_0x579257);_0x1cc118(null);})[_0x9b8a('0xf')](_0x1cc118(null));};}for(var e in events){if(events[_0x9b8a('0x10')](e)){var event=events[e];WhatsappInteraction[_0x9b8a('0x11')](e,emitEvent(event));}}module[_0x9b8a('0x12')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xc759=['WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','events','WhatsappInteraction','../../mysqldb'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xc759,0x1d8));var _0x9c75=function(_0x281b36,_0xbe7388){_0x281b36=_0x281b36-0x0;var _0x3fa722=_0xc759[_0x281b36];return _0x3fa722;};'use strict';var EventEmitter=require(_0x9c75('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x9c75('0x1')];var WhatsappMessage=require(_0x9c75('0x2'))['db'][_0x9c75('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x9c75('0x4')](0x0);var events={'afterCreate':_0x9c75('0x5'),'afterUpdate':_0x9c75('0x6'),'afterDestroy':_0x9c75('0x7')};function emitEvent(_0x39a2ec){return function(_0x5ab19f,_0x5451b7,_0x2e3a99){_0x5ab19f[_0x9c75('0x8')]({'attributes':['id'],'raw':!![]})[_0x9c75('0x9')](function(_0x2db3db){_0x5ab19f[_0x9c75('0xa')](_0x9c75('0xb'),_0x2db3db[_0x9c75('0xc')](function(_0x42d6b0){return{'id':_0x42d6b0['id']};}));return WhatsappMessage[_0x9c75('0xd')]({'where':{'WhatsappInteractionId':_0x5ab19f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x93935c){_0x5ab19f[_0x9c75('0xa')](_0x9c75('0xe'),_0x93935c[_0x9c75('0xf')]);WhatsappInteractionEvents['emit'](_0x39a2ec+':'+_0x5ab19f['id'],_0x5ab19f);WhatsappInteractionEvents[_0x9c75('0x10')](_0x39a2ec,_0x5ab19f);_0x2e3a99(null);})[_0x9c75('0x11')](_0x2e3a99(null));};}for(var e in events){if(events[_0x9c75('0x12')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
index 41d0e1f..76394fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['define','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x2efafb,_0x15c166){var _0xb3ffce=function(_0x5c8bc4){while(--_0x5c8bc4){_0x2efafb['push'](_0x2efafb['shift']());}};_0xb3ffce(++_0x15c166);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x503809,_0xe42b77,_0x56465b){if(_0x503809['changed'](_0x0a9e('0xb'))){_0x503809[_0x0a9e('0xc')]=moment()[_0x0a9e('0xd')](_0x0a9e('0xe'));}_0x56465b(null,_0x503809);}}});};
\ No newline at end of file
+var _0xa9e0=['define','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x218495,_0x386c45){var _0x4c33fb=function(_0x29febe){while(--_0x29febe){_0x218495['push'](_0x218495['shift']());}};_0x4c33fb(++_0x386c45);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x503809,_0xe42b77,_0x56465b){if(_0x503809['changed'](_0x0a9e('0xb'))){_0x503809[_0x0a9e('0xc')]=moment()[_0x0a9e('0xd')](_0x0a9e('0xe'));}_0x56465b(null,_0x503809);}}});};
\ No newline at end of file
index 7071176..b1d56d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb6b=['rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateWhatsappInteraction','update','body','options','raw','AddTagsToWhatsappInteraction','WhatsappInteraction','find','where','addTags','ids','spread','AddTags','debug','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26baca,_0x1b0e33){var _0xbb37e5=function(_0xa7bf28){while(--_0xa7bf28){_0x26baca['push'](_0x26baca['shift']());}};_0xbb37e5(++_0x1b0e33);}(_0xdb6b,0x139));var _0xbdb6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdb6b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbdb6('0x0'));var util=require(_0xbdb6('0x1'));var moment=require(_0xbdb6('0x2'));var BPromise=require('bluebird');var rs=require(_0xbdb6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbdb6('0x4'))['db'];var utils=require(_0xbdb6('0x5'));var logger=require(_0xbdb6('0x6'))(_0xbdb6('0x7'));var config=require(_0xbdb6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbdb6('0x9')]['http']({'port':0x232a});config['redis']=_[_0xbdb6('0xa')](config[_0xbdb6('0xb')],{'host':_0xbdb6('0xc'),'port':0x18eb});var socket=require(_0xbdb6('0xd'))(new Redis(config[_0xbdb6('0xb')]));require(_0xbdb6('0xe'))[_0xbdb6('0xf')](socket);function respondWithRpcPromise(_0x37b907,_0x4e920d,_0x8410e9){return new BPromise(function(_0x2dae85,_0x502db9){return client[_0xbdb6('0x10')](_0x37b907,_0x8410e9)[_0xbdb6('0x11')](function(_0xe17f1a){logger[_0xbdb6('0x12')](_0xbdb6('0x13'),_0x4e920d,_0xbdb6('0x14'));logger['debug'](_0xbdb6('0x15'),_0x4e920d,'request\x20sent',JSON[_0xbdb6('0x16')](_0xe17f1a));if(_0xe17f1a[_0xbdb6('0x17')]){if(_0xe17f1a[_0xbdb6('0x17')]['code']===0x1f4){logger['error'](_0xbdb6('0x13'),_0x4e920d,_0xe17f1a[_0xbdb6('0x17')][_0xbdb6('0x18')]);return _0x502db9(_0xe17f1a['error'][_0xbdb6('0x18')]);}logger[_0xbdb6('0x17')](_0xbdb6('0x13'),_0x4e920d,_0xe17f1a['error'][_0xbdb6('0x18')]);return _0x2dae85(_0xe17f1a[_0xbdb6('0x17')]['message']);}else{logger['info'](_0xbdb6('0x13'),_0x4e920d,'request\x20sent');_0x2dae85(_0xe17f1a['result'][_0xbdb6('0x18')]);}})['catch'](function(_0x3ca2b9){logger[_0xbdb6('0x17')](_0xbdb6('0x13'),_0x4e920d,_0x3ca2b9);_0x502db9(_0x3ca2b9);});});}exports[_0xbdb6('0x19')]=function(_0x5d0326){var _0x3e1550=this;return new Promise(function(_0x1fbba2,_0x7d2d35){return db['WhatsappInteraction'][_0xbdb6('0x1a')](_0x5d0326[_0xbdb6('0x1b')],{'raw':_0x5d0326[_0xbdb6('0x1c')]?_0x5d0326[_0xbdb6('0x1c')][_0xbdb6('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d0326['options']?_0x5d0326[_0xbdb6('0x1c')]['where']||null:null,'attributes':_0x5d0326[_0xbdb6('0x1c')]?_0x5d0326['options']['attributes']||null:null,'limit':_0x5d0326[_0xbdb6('0x1c')]?_0x5d0326['options']['limit']||null:null})['then'](function(_0x1f7fb7){logger[_0xbdb6('0x12')]('UpdateWhatsappInteraction',_0x5d0326);logger['debug'](_0xbdb6('0x19'),_0x5d0326,JSON['stringify'](_0x1f7fb7));_0x1fbba2(_0x1f7fb7);})['catch'](function(_0x3e5599){logger['error'](_0xbdb6('0x19'),_0x3e5599['message'],_0x5d0326);_0x7d2d35(_0x3e1550[_0xbdb6('0x17')](0x1f4,_0x3e5599[_0xbdb6('0x18')]));});});};exports[_0xbdb6('0x1e')]=function(_0x3370ac){return new Promise(function(_0x2779c3,_0x362681){return db[_0xbdb6('0x1f')][_0xbdb6('0x20')]({'where':_0x3370ac[_0xbdb6('0x1c')]?_0x3370ac[_0xbdb6('0x1c')][_0xbdb6('0x21')]||null:null})['then'](function(_0x47d8e4){if(_0x47d8e4){return _0x47d8e4[_0xbdb6('0x22')](_0x3370ac[_0xbdb6('0x1b')][_0xbdb6('0x23')],_['omit'](_0x3370ac[_0xbdb6('0x1b')],['ids','id'])||{});}})[_0xbdb6('0x24')](function(_0x7cb20f){logger['info'](_0xbdb6('0x25'),_0x3370ac);logger[_0xbdb6('0x26')](_0xbdb6('0x25'),_0x3370ac,JSON[_0xbdb6('0x16')](_0x7cb20f));_0x2779c3(_0x7cb20f);})[_0xbdb6('0x27')](function(_0x21b9ad){logger['error'](_0xbdb6('0x25'),_0x21b9ad[_0xbdb6('0x18')],_0x3370ac);_0x362681(_this[_0xbdb6('0x17')](0x1f4,_0x21b9ad['message']));});});};
\ No newline at end of file
+var _0xd0d0=['WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','attributes','AddTagsToWhatsappInteraction','find','where','addTags','omit','spread','AddTags','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x23c2c3,_0x27ecc8){var _0x41e09f=function(_0x5e6873){while(--_0x5e6873){_0x23c2c3['push'](_0x23c2c3['shift']());}};_0x41e09f(++_0x27ecc8);}(_0xd0d0,0xe1));var _0x0d0d=function(_0x84f908,_0x425a60){_0x84f908=_0x84f908-0x0;var _0x5def0f=_0xd0d0[_0x84f908];return _0x5def0f;};'use strict';var _=require(_0x0d0d('0x0'));var util=require(_0x0d0d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d0d('0x2'));var db=require(_0x0d0d('0x3'))['db'];var utils=require(_0x0d0d('0x4'));var logger=require(_0x0d0d('0x5'))(_0x0d0d('0x6'));var config=require(_0x0d0d('0x7'));var jayson=require(_0x0d0d('0x8'));var client=jayson[_0x0d0d('0x9')][_0x0d0d('0xa')]({'port':0x232a});config[_0x0d0d('0xb')]=_['defaults'](config[_0x0d0d('0xb')],{'host':_0x0d0d('0xc'),'port':0x18eb});var socket=require(_0x0d0d('0xd'))(new Redis(config[_0x0d0d('0xb')]));require(_0x0d0d('0xe'))[_0x0d0d('0xf')](socket);function respondWithRpcPromise(_0x73f82,_0x3b0c63,_0x4da9cd){return new BPromise(function(_0x97a2b9,_0x32fff6){return client['request'](_0x73f82,_0x4da9cd)[_0x0d0d('0x10')](function(_0xd6c677){logger[_0x0d0d('0x11')](_0x0d0d('0x12'),_0x3b0c63,_0x0d0d('0x13'));logger[_0x0d0d('0x14')](_0x0d0d('0x15'),_0x3b0c63,'request\x20sent',JSON[_0x0d0d('0x16')](_0xd6c677));if(_0xd6c677[_0x0d0d('0x17')]){if(_0xd6c677[_0x0d0d('0x17')][_0x0d0d('0x18')]===0x1f4){logger[_0x0d0d('0x17')](_0x0d0d('0x12'),_0x3b0c63,_0xd6c677['error'][_0x0d0d('0x19')]);return _0x32fff6(_0xd6c677[_0x0d0d('0x17')][_0x0d0d('0x19')]);}logger[_0x0d0d('0x17')](_0x0d0d('0x12'),_0x3b0c63,_0xd6c677['error']['message']);return _0x97a2b9(_0xd6c677[_0x0d0d('0x17')][_0x0d0d('0x19')]);}else{logger[_0x0d0d('0x11')](_0x0d0d('0x12'),_0x3b0c63,_0x0d0d('0x13'));_0x97a2b9(_0xd6c677[_0x0d0d('0x1a')]['message']);}})[_0x0d0d('0x1b')](function(_0x3a7d54){logger[_0x0d0d('0x17')](_0x0d0d('0x12'),_0x3b0c63,_0x3a7d54);_0x32fff6(_0x3a7d54);});});}exports[_0x0d0d('0x1c')]=function(_0xcc5a7c){var _0x4cfa71=this;return new Promise(function(_0x3cada3,_0x5efd08){return db[_0x0d0d('0x1d')][_0x0d0d('0x1e')](_0xcc5a7c[_0x0d0d('0x1f')],{'raw':_0xcc5a7c['options']?_0xcc5a7c[_0x0d0d('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcc5a7c[_0x0d0d('0x20')]?_0xcc5a7c[_0x0d0d('0x20')]['where']||null:null,'attributes':_0xcc5a7c[_0x0d0d('0x20')]?_0xcc5a7c[_0x0d0d('0x20')][_0x0d0d('0x21')]||null:null,'limit':_0xcc5a7c[_0x0d0d('0x20')]?_0xcc5a7c[_0x0d0d('0x20')]['limit']||null:null})[_0x0d0d('0x10')](function(_0x51f06d){logger[_0x0d0d('0x11')]('UpdateWhatsappInteraction',_0xcc5a7c);logger[_0x0d0d('0x14')](_0x0d0d('0x1c'),_0xcc5a7c,JSON['stringify'](_0x51f06d));_0x3cada3(_0x51f06d);})[_0x0d0d('0x1b')](function(_0x16e0a0){logger[_0x0d0d('0x17')]('UpdateWhatsappInteraction',_0x16e0a0[_0x0d0d('0x19')],_0xcc5a7c);_0x5efd08(_0x4cfa71[_0x0d0d('0x17')](0x1f4,_0x16e0a0[_0x0d0d('0x19')]));});});};exports[_0x0d0d('0x22')]=function(_0x1b3177){return new Promise(function(_0xe25b0f,_0x34ea20){return db['WhatsappInteraction'][_0x0d0d('0x23')]({'where':_0x1b3177[_0x0d0d('0x20')]?_0x1b3177[_0x0d0d('0x20')][_0x0d0d('0x24')]||null:null})['then'](function(_0x18cabd){if(_0x18cabd){return _0x18cabd[_0x0d0d('0x25')](_0x1b3177[_0x0d0d('0x1f')]['ids'],_[_0x0d0d('0x26')](_0x1b3177['body'],['ids','id'])||{});}})[_0x0d0d('0x27')](function(_0x25a7f6){logger[_0x0d0d('0x11')]('AddTags',_0x1b3177);logger[_0x0d0d('0x14')](_0x0d0d('0x28'),_0x1b3177,JSON[_0x0d0d('0x16')](_0x25a7f6));_0xe25b0f(_0x25a7f6);})[_0x0d0d('0x1b')](function(_0x4e62d3){logger['error'](_0x0d0d('0x28'),_0x4e62d3[_0x0d0d('0x19')],_0x1b3177);_0x34ea20(_this[_0x0d0d('0x17')](0x1f4,_0x4e62d3['message']));});});};
\ No newline at end of file
index 69d637a..c1fb2c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d48=['removeListener','register','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit'];(function(_0x4324e3,_0x17d826){var _0x114577=function(_0x65c5bb){while(--_0x65c5bb){_0x4324e3['push'](_0x4324e3['shift']());}};_0x114577(++_0x17d826);}(_0x2d48,0x153));var _0x82d4=function(_0x426323,_0x2ce530){_0x426323=_0x426323-0x0;var _0xa347f6=_0x2d48[_0x426323];return _0xa347f6;};'use strict';var WhatsappInteractionEvents=require(_0x82d4('0x0'));var events=[_0x82d4('0x1'),_0x82d4('0x2'),_0x82d4('0x3')];function createListener(_0x58b08d,_0x3cde8b){return function(_0x5b8ea5){_0x3cde8b[_0x82d4('0x4')](_0x58b08d,_0x5b8ea5);};}function removeListener(_0x2fe022,_0x2d0fc9){return function(){WhatsappInteractionEvents[_0x82d4('0x5')](_0x2fe022,_0x2d0fc9);};}exports[_0x82d4('0x6')]=function(_0x37c8ae){for(var _0x332ca4=0x0,_0x174a36=events['length'];_0x332ca4<_0x174a36;_0x332ca4++){var _0x3a90bb=events[_0x332ca4];var _0x58c16d=createListener(_0x82d4('0x7')+_0x3a90bb,_0x37c8ae);WhatsappInteractionEvents['on'](_0x3a90bb,_0x58c16d);}};
\ No newline at end of file
+var _0x8e6e=['./whatsappInteraction.events','save','remove','removeListener','register','length','whatsappInteraction:'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x8e6e,0x165));var _0xe8e6=function(_0x3a23c1,_0x495d49){_0x3a23c1=_0x3a23c1-0x0;var _0x286863=_0x8e6e[_0x3a23c1];return _0x286863;};'use strict';var WhatsappInteractionEvents=require(_0xe8e6('0x0'));var events=[_0xe8e6('0x1'),_0xe8e6('0x2'),'update'];function createListener(_0x52c349,_0x287bd6){return function(_0x11cd90){_0x287bd6['emit'](_0x52c349,_0x11cd90);};}function removeListener(_0xa2cde2,_0x4050da){return function(){WhatsappInteractionEvents[_0xe8e6('0x3')](_0xa2cde2,_0x4050da);};}exports[_0xe8e6('0x4')]=function(_0x7401b){for(var _0x3a746a=0x0,_0xe931c9=events[_0xe8e6('0x5')];_0x3a746a<_0xe931c9;_0x3a746a++){var _0x361c5a=events[_0x3a746a];var _0x2aa759=createListener(_0xe8e6('0x6')+_0x361c5a,_0x7401b);WhatsappInteractionEvents['on'](_0x361c5a,_0x2aa759);}};
\ No newline at end of file
index 5ca192f..d233206 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7780=['post','/:id/status','status','put','update','accept','/:id/reject','delete','/:id','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','show','whatsappmessage:create','create'];(function(_0x4853a3,_0x2661bf){var _0x2d2f30=function(_0x5716f0){while(--_0x5716f0){_0x4853a3['push'](_0x4853a3['shift']());}};_0x2d2f30(++_0x2661bf);}(_0x7780,0x181));var _0x0778=function(_0x4d93c9,_0x4775ae){_0x4d93c9=_0x4d93c9-0x0;var _0x48536d=_0x7780[_0x4d93c9];return _0x48536d;};'use strict';var multer=require(_0x0778('0x0'));var util=require(_0x0778('0x1'));var path=require(_0x0778('0x2'));var timeout=require(_0x0778('0x3'));var express=require(_0x0778('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0778('0x5'));var config=require(_0x0778('0x6'));var controller=require(_0x0778('0x7'));router[_0x0778('0x8')]('/',auth[_0x0778('0x9')](),controller[_0x0778('0xa')]);router[_0x0778('0x8')](_0x0778('0xb'),auth[_0x0778('0x9')](),controller['describe']);router[_0x0778('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0778('0xc')]);router['post']('/',auth[_0x0778('0x9')](),interaction['tracked']('whatsapp',_0x0778('0xd')),controller[_0x0778('0xe')]);router[_0x0778('0xf')](_0x0778('0x10'),controller[_0x0778('0x11')]);router[_0x0778('0x12')]('/:id',auth[_0x0778('0x9')](),controller[_0x0778('0x13')]);router['put']('/:id/accept',auth[_0x0778('0x9')](),controller[_0x0778('0x14')]);router[_0x0778('0x12')](_0x0778('0x15'),auth[_0x0778('0x9')](),controller['reject']);router[_0x0778('0x16')](_0x0778('0x17'),auth[_0x0778('0x9')](),controller[_0x0778('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x3949=['/:id/status','status','put','update','/:id/accept','accept','reject','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','whatsapp','whatsappmessage:create'];(function(_0x3f4098,_0x3365b2){var _0x3d5d0c=function(_0x3a7cdb){while(--_0x3a7cdb){_0x3f4098['push'](_0x3f4098['shift']());}};_0x3d5d0c(++_0x3365b2);}(_0x3949,0x6d));var _0x9394=function(_0x37eb5c,_0x477cc0){_0x37eb5c=_0x37eb5c-0x0;var _0x243e31=_0x3949[_0x37eb5c];return _0x243e31;};'use strict';var multer=require(_0x9394('0x0'));var util=require(_0x9394('0x1'));var path=require(_0x9394('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9394('0x3')]();var auth=require(_0x9394('0x4'));var interaction=require(_0x9394('0x5'));var config=require(_0x9394('0x6'));var controller=require('./whatsappMessage.controller');router[_0x9394('0x7')]('/',auth[_0x9394('0x8')](),controller['index']);router[_0x9394('0x7')](_0x9394('0x9'),auth[_0x9394('0x8')](),controller[_0x9394('0xa')]);router[_0x9394('0x7')](_0x9394('0xb'),auth['isAuthenticated'](),controller[_0x9394('0xc')]);router[_0x9394('0xd')]('/',auth[_0x9394('0x8')](),interaction['tracked'](_0x9394('0xe'),_0x9394('0xf')),controller['create']);router[_0x9394('0xd')](_0x9394('0x10'),controller[_0x9394('0x11')]);router[_0x9394('0x12')](_0x9394('0xb'),auth[_0x9394('0x8')](),controller[_0x9394('0x13')]);router[_0x9394('0x12')](_0x9394('0x14'),auth[_0x9394('0x8')](),controller[_0x9394('0x15')]);router['put']('/:id/reject',auth[_0x9394('0x8')](),controller[_0x9394('0x16')]);router[_0x9394('0x17')](_0x9394('0xb'),auth['isAuthenticated'](),controller[_0x9394('0x18')]);module['exports']=router;
\ No newline at end of file
index 7510638..a7a0bf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba92=['DATE','BOOLEAN','sequelize','exports','TEXT','ENUM','out','STRING'];(function(_0x3bd36e,_0x4b29df){var _0x1f731f=function(_0x2fd8aa){while(--_0x2fd8aa){_0x3bd36e['push'](_0x3bd36e['shift']());}};_0x1f731f(++_0x4b29df);}(_0xba92,0x1e2));var _0x2ba9=function(_0xff41d7,_0x3fde9c){_0xff41d7=_0xff41d7-0x0;var _0x4f831e=_0xba92[_0xff41d7];return _0x4f831e;};'use strict';var Sequelize=require(_0x2ba9('0x0'));module[_0x2ba9('0x1')]={'body':{'type':Sequelize[_0x2ba9('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2ba9('0x3')]('in',_0x2ba9('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x2ba9('0x5')](0xbe)},'phone':{'type':Sequelize[_0x2ba9('0x5')]},'readAt':{'type':Sequelize[_0x2ba9('0x6')]},'secret':{'type':Sequelize[_0x2ba9('0x7')],'defaultValue':![]}};
\ No newline at end of file
+var _0x02b3=['ENUM','out','STRING','sequelize','medium','BOOLEAN'];(function(_0x1c452f,_0x49dbb8){var _0x40db4e=function(_0x177108){while(--_0x177108){_0x1c452f['push'](_0x1c452f['shift']());}};_0x40db4e(++_0x49dbb8);}(_0x02b3,0x171));var _0x302b=function(_0x4ce028,_0x526d4b){_0x4ce028=_0x4ce028-0x0;var _0x583d0c=_0x02b3[_0x4ce028];return _0x583d0c;};'use strict';var Sequelize=require(_0x302b('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x302b('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x302b('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x302b('0x3')]('in',_0x302b('0x4')),'defaultValue':_0x302b('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x302b('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x302b('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 8bc6a5f..e4d91db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71a0=['redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','test','Sequelize','ValidationError','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','keys','include','find','create','body','destroy','whatsapp-interactions','accept','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','WhatsappInteraction','read1stAt','interaction','role','null','acceptMessage','interface','channel','EventManager','acceptmessage','params','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SIP/%s','event','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','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'];(function(_0xfe6afe,_0xa1a594){var _0x406ff5=function(_0x377ede){while(--_0x377ede){_0xfe6afe['push'](_0xfe6afe['shift']());}};_0x406ff5(++_0xa1a594);}(_0x71a0,0xe9));var _0x071a=function(_0x163ebb,_0x12848e){_0x163ebb=_0x163ebb-0x0;var _0x24675d=_0x71a0[_0x163ebb];return _0x24675d;};'use strict';var pdf=require(_0x071a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x071a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x071a('0x2'));var rp=require(_0x071a('0x3'));var moment=require(_0x071a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x071a('0x5'));var util=require(_0x071a('0x6'));var path=require(_0x071a('0x7'));var sox=require(_0x071a('0x8'));var csv=require(_0x071a('0x9'));var ejs=require(_0x071a('0xa'));var fs=require('fs');var _=require(_0x071a('0xb'));var squel=require(_0x071a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x071a('0xd'));var toCsv=require(_0x071a('0x9'));var querystring=require(_0x071a('0xe'));var Papa=require(_0x071a('0xf'));var Redis=require(_0x071a('0x10'));var authService=require(_0x071a('0x11'));var qs=require(_0x071a('0x12'));var as=require(_0x071a('0x13'));var hardwareService=require(_0x071a('0x14'));var logger=require(_0x071a('0x15'))(_0x071a('0x16'));var utils=require(_0x071a('0x17'));var config=require(_0x071a('0x18'));var db=require('../../mysqldb')['db'];config[_0x071a('0x19')]=_[_0x071a('0x1a')](config[_0x071a('0x19')],{'host':_0x071a('0x1b'),'port':0x18eb});var socket=require(_0x071a('0x1c'))(new Redis(config[_0x071a('0x19')]));require(_0x071a('0x1d'))[_0x071a('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x071a('0x1f')][_0x071a('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x071a('0x20')]({'port':0x232a});function checkPasswordPattern(_0xe0cdca,_0x1e7426,_0x1a31c1){if(_0x1a31c1){var _0x3680a7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3680a7[_0x071a('0x21')](_0x1e7426)){return _0xe0cdca;}else{throw new db[(_0x071a('0x22'))][(_0x071a('0x23'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xe0cdca;}}function respondWithRpcPromise(_0x77ac07,_0x29b127,_0x4d4687,_0x4e848f){return new BPromise(function(_0x2d2b5b,_0x162b26){var _0x230b5e=_0x4e848f||client;return _0x230b5e[_0x071a('0x24')](_0x77ac07,_0x4d4687)[_0x071a('0x25')](function(_0x25cec5){logger[_0x071a('0x26')](_0x071a('0x27'),_0x29b127,_0x071a('0x28'));logger['debug'](_0x071a('0x29'),_0x29b127,'request\x20sent',JSON[_0x071a('0x2a')](_0x25cec5));if(_0x25cec5['error']){if(_0x25cec5[_0x071a('0x2b')]['code']===0x1f4){logger[_0x071a('0x2b')](_0x071a('0x27'),_0x29b127,_0x25cec5[_0x071a('0x2b')][_0x071a('0x2c')]);return _0x162b26(_0x25cec5[_0x071a('0x2b')]['message']);}logger[_0x071a('0x2b')]('WhatsappMessage,\x20%s,\x20%s',_0x29b127,_0x25cec5[_0x071a('0x2b')][_0x071a('0x2c')]);return _0x2d2b5b(_0x25cec5[_0x071a('0x2b')][_0x071a('0x2c')]);}else{logger[_0x071a('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x29b127,'request\x20sent');_0x2d2b5b(_0x25cec5[_0x071a('0x2d')][_0x071a('0x2c')]);}})[_0x071a('0x2e')](function(_0x3587e1){logger[_0x071a('0x2b')](_0x071a('0x27'),_0x29b127,_0x3587e1);_0x162b26(_0x3587e1);});});}function respondWithStatusCode(_0x2b5ecd,_0x28a868){_0x28a868=_0x28a868||0xcc;return function(_0x456f0e){if(_0x456f0e){return _0x2b5ecd[_0x071a('0x2f')](_0x28a868);}return _0x2b5ecd[_0x071a('0x30')](_0x28a868)[_0x071a('0x31')]();};}function respondWithResult(_0x5a2211,_0x3c790b){_0x3c790b=_0x3c790b||0xc8;return function(_0x141c58){if(_0x141c58){return _0x5a2211['status'](_0x3c790b)[_0x071a('0x32')](_0x141c58);}};}function respondWithFilteredResult(_0x5a709a,_0x33df43){return function(_0x2f6975){if(_0x2f6975){var _0x21bba8=_0x2f6975[_0x071a('0x33')],_0x49811f=_0x33df43[_0x071a('0x34')],_0x107667=_0x33df43['offset']+_0x33df43[_0x071a('0x35')],_0x433d75;if(_0x107667>=_0x21bba8){_0x107667=_0x21bba8;_0x433d75=0xc8;}else{_0x433d75=0xce;}_0x5a709a[_0x071a('0x30')](_0x433d75);return _0x5a709a['set'](_0x071a('0x36'),_0x49811f+'-'+_0x107667+'/'+_0x21bba8)['json'](_0x2f6975);}return null;};}function patchUpdates(_0x9ebfb6){return function(_0x340407){try{jsonpatch['apply'](_0x340407,_0x9ebfb6,!![]);}catch(_0x4fd2da){return BPromise[_0x071a('0x37')](_0x4fd2da);}return _0x340407[_0x071a('0x38')]();};}function saveUpdates(_0x22c116,_0x11a0ee){return function(_0x7828c8){if(_0x7828c8){return _0x7828c8[_0x071a('0x39')](_0x22c116)[_0x071a('0x25')](function(_0x446d81){return _0x446d81;});}return null;};}function removeEntity(_0x58e0a5,_0x20b3b0){return function(_0x1a6aca){if(_0x1a6aca){return _0x1a6aca['destroy']()['then'](function(){_0x58e0a5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cc070,_0x55d1c5){return function(_0x1501e0){if(!_0x1501e0){_0x1cc070[_0x071a('0x2f')](0x194);}return _0x1501e0;};}function handleError(_0x426b41,_0x5cf1bd){_0x5cf1bd=_0x5cf1bd||0x1f4;return function(_0x5de58e){logger[_0x071a('0x2b')](_0x5de58e[_0x071a('0x3a')]);if(_0x5de58e[_0x071a('0x3b')]){delete _0x5de58e[_0x071a('0x3b')];}_0x426b41[_0x071a('0x30')](_0x5cf1bd)[_0x071a('0x3c')](_0x5de58e);};}exports[_0x071a('0x3d')]=function(_0xed92e6,_0x39546b){var _0x186253={},_0x44b40c={},_0x39cea8={'count':0x0,'rows':[]};var _0x474e30=_[_0x071a('0x3e')](db[_0x071a('0x3f')][_0x071a('0x40')],function(_0x10cf6a){return{'name':_0x10cf6a[_0x071a('0x41')],'type':_0x10cf6a['type']['key']};});_0x44b40c[_0x071a('0x42')]=_['map'](_0x474e30,'name');_0x44b40c[_0x071a('0x43')]=_['keys'](_0xed92e6['query']);_0x44b40c['filters']=_[_0x071a('0x44')](_0x44b40c[_0x071a('0x42')],_0x44b40c[_0x071a('0x43')]);_0x186253['attributes']=_[_0x071a('0x44')](_0x44b40c[_0x071a('0x42')],qs[_0x071a('0x45')](_0xed92e6[_0x071a('0x43')][_0x071a('0x45')]));_0x186253['attributes']=_0x186253['attributes'][_0x071a('0x46')]?_0x186253[_0x071a('0x47')]:_0x44b40c[_0x071a('0x42')];if(!_0xed92e6['query'][_0x071a('0x48')](_0x071a('0x49'))){_0x186253[_0x071a('0x35')]=qs[_0x071a('0x35')](_0xed92e6[_0x071a('0x43')]['limit']);_0x186253[_0x071a('0x34')]=qs['offset'](_0xed92e6[_0x071a('0x43')]['offset']);}_0x186253['order']=qs[_0x071a('0x4a')](_0xed92e6[_0x071a('0x43')]['sort']);_0x186253[_0x071a('0x4b')]=qs[_0x071a('0x4c')](_['pick'](_0xed92e6['query'],_0x44b40c['filters']),_0x474e30);if(_0xed92e6['query'][_0x071a('0x4d')]){_0x186253[_0x071a('0x4b')]=_[_0x071a('0x4e')](_0x186253['where'],{'$or':_[_0x071a('0x3e')](_0x474e30,function(_0x5a320b){if(_0x5a320b[_0x071a('0x4f')]!==_0x071a('0x50')){var _0x5e95b7={};_0x5e95b7[_0x5a320b[_0x071a('0x3b')]]={'$like':'%'+_0xed92e6['query'][_0x071a('0x4d')]+'%'};return _0x5e95b7;}})});}_0x186253=_[_0x071a('0x4e')]({},_0x186253,_0xed92e6[_0x071a('0x51')]);var _0x1df46e={'where':_0x186253[_0x071a('0x4b')]};return db['WhatsappMessage']['count'](_0x1df46e)[_0x071a('0x25')](function(_0x290acb){_0x39cea8[_0x071a('0x33')]=_0x290acb;if(_0xed92e6[_0x071a('0x43')][_0x071a('0x52')]){_0x186253['include']=[{'all':!![]}];}return db[_0x071a('0x3f')][_0x071a('0x53')](_0x186253);})[_0x071a('0x25')](function(_0x425a81){_0x39cea8['rows']=_0x425a81;return _0x39cea8;})[_0x071a('0x25')](respondWithFilteredResult(_0x39546b,_0x186253))[_0x071a('0x2e')](handleError(_0x39546b,null));};exports['show']=function(_0x3ff646,_0x6013f4){var _0x502c76={'raw':!![],'where':{'id':_0x3ff646['params']['id']}},_0x3abf12={};_0x3abf12[_0x071a('0x42')]=_[_0x071a('0x54')](db[_0x071a('0x3f')][_0x071a('0x40')]);_0x3abf12[_0x071a('0x43')]=_[_0x071a('0x54')](_0x3ff646[_0x071a('0x43')]);_0x3abf12[_0x071a('0x4c')]=_[_0x071a('0x44')](_0x3abf12[_0x071a('0x42')],_0x3abf12['query']);_0x502c76[_0x071a('0x47')]=_[_0x071a('0x44')](_0x3abf12[_0x071a('0x42')],qs['fields'](_0x3ff646[_0x071a('0x43')][_0x071a('0x45')]));_0x502c76[_0x071a('0x47')]=_0x502c76['attributes']['length']?_0x502c76[_0x071a('0x47')]:_0x3abf12[_0x071a('0x42')];if(_0x3ff646[_0x071a('0x43')][_0x071a('0x52')]){_0x502c76[_0x071a('0x55')]=[{'all':!![]}];}_0x502c76=_[_0x071a('0x4e')]({},_0x502c76,_0x3ff646[_0x071a('0x51')]);return db[_0x071a('0x3f')][_0x071a('0x56')](_0x502c76)[_0x071a('0x25')](handleEntityNotFound(_0x6013f4,null))[_0x071a('0x25')](respondWithResult(_0x6013f4,null))[_0x071a('0x2e')](handleError(_0x6013f4,null));};exports['create']=function(_0x39f50e,_0x33f0d5){return db[_0x071a('0x3f')][_0x071a('0x57')](_0x39f50e[_0x071a('0x58')],{})[_0x071a('0x25')](respondWithResult(_0x33f0d5,0xc9))['catch'](handleError(_0x33f0d5,null));};exports[_0x071a('0x39')]=function(_0x96fc56,_0x1d1b4f){if(_0x96fc56[_0x071a('0x58')]['id']){delete _0x96fc56['body']['id'];}return db[_0x071a('0x3f')]['find']({'where':{'id':_0x96fc56['params']['id']}})['then'](handleEntityNotFound(_0x1d1b4f,null))['then'](saveUpdates(_0x96fc56['body'],null))[_0x071a('0x25')](respondWithResult(_0x1d1b4f,null))['catch'](handleError(_0x1d1b4f,null));};exports[_0x071a('0x59')]=function(_0xb94ae9,_0x137e8e){return db[_0x071a('0x3f')]['find']({'where':{'id':_0xb94ae9['params']['id']}})[_0x071a('0x25')](handleEntityNotFound(_0x137e8e,null))[_0x071a('0x25')](removeEntity(_0x137e8e,null))[_0x071a('0x2e')](handleError(_0x137e8e,null));};exports['describe']=function(_0x1105d0,_0x243b17){return db['WhatsappMessage']['describe']()[_0x071a('0x25')](respondWithResult(_0x243b17,null))[_0x071a('0x2e')](handleError(_0x243b17,null));};var interaction_log=require(_0x071a('0x15'))(_0x071a('0x5a'));exports[_0x071a('0x5b')]=function(_0x2b701e,_0x35bea2,_0x231d5a){var _0x555ec1={'channel':_0x071a('0x5c')};if(_0x2b701e[_0x071a('0x58')]['id']){delete _0x2b701e[_0x071a('0x58')]['id'];}_0x2b701e[_0x071a('0x58')]['read']=!![];_0x2b701e['body'][_0x071a('0x5d')]=moment()[_0x071a('0x5e')](_0x071a('0x5f'));_0x2b701e[_0x071a('0x58')][_0x071a('0x60')]=_0x2b701e[_0x071a('0x58')][_0x071a('0x60')]||_0x2b701e[_0x071a('0x61')]['id'];return db[_0x071a('0x3f')][_0x071a('0x56')]({'where':{'id':_0x2b701e['params']['id'],'UserId':null},'include':[{'model':db[_0x071a('0x62')],'as':_0x071a('0x63')}]})['then'](handleEntityNotFound(_0x35bea2,null))['then'](saveUpdates(_0x2b701e[_0x071a('0x58')],null))[_0x071a('0x25')](function(_0xae274){if(_0xae274){_0x555ec1[_0x071a('0x2c')]=_0xae274[_0x071a('0x64')]({'plain':!![]});return db[_0x071a('0x65')][_0x071a('0x56')]({'where':{'id':_0xae274['WhatsappInteractionId']}});}return null;})[_0x071a('0x25')](handleEntityNotFound(_0x35bea2,null))[_0x071a('0x25')](function(_0x208fce){if(_0x208fce){return _0x208fce[_0x071a('0x39')]({'UserId':_0x2b701e['body'][_0x071a('0x60')],'read1stAt':_['isNil'](_0x208fce[_0x071a('0x66')])?moment()[_0x071a('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x071a('0x25')](function(_0x4d1f80){if(_0x4d1f80){_0x555ec1[_0x071a('0x67')]=_0x4d1f80['get']({'plain':!![]});interaction_log[_0x071a('0x26')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2b701e[_0x071a('0x61')]['id'],_0x2b701e['user']['name'],_0x2b701e[_0x071a('0x61')][_0x071a('0x68')],_0x555ec1['interaction']['id'],_0x2b701e[_0x071a('0x58')]?JSON[_0x071a('0x2a')](_0x2b701e[_0x071a('0x58')]):_0x071a('0x69'));return respondWithRpcPromise('AcceptMessage',_0x071a('0x6a'),_0x555ec1);}return null;})[_0x071a('0x25')](function(_0x4e907e){if(_0x4e907e){if(_0x2b701e[_0x071a('0x58')]['manual']){_0x555ec1['message'][_0x071a('0x6b')]=util[_0x071a('0x5e')]('SIP/%s',_0x2b701e['user']['name']);_0x555ec1[_0x071a('0x2c')][_0x071a('0x6c')]=_0x555ec1[_0x071a('0x6c')];_0x555ec1[_0x071a('0x2c')]['event']=_0x071a('0x5b');return respondWithRpcPromise(_0x071a('0x6d'),'EventManager',{'event':_0x071a('0x6e'),'message':_0x555ec1[_0x071a('0x2c')]},client9002)['then'](function(){return _0x555ec1;});}return _0x555ec1;}return null;})[_0x071a('0x25')](respondWithResult(_0x35bea2,null))['catch'](handleError(_0x35bea2,null));};var interaction_log=require('../../config/logger')(_0x071a('0x5a'));exports[_0x071a('0x37')]=function(_0x3f47f8,_0x19286b,_0x17e46d){var _0x5e930d={'agent':{},'channel':_0x071a('0x5c')};if(_0x3f47f8[_0x071a('0x58')]['id']){delete _0x3f47f8[_0x071a('0x58')]['id'];}_0x3f47f8[_0x071a('0x58')][_0x071a('0x60')]=_0x3f47f8[_0x071a('0x58')][_0x071a('0x60')]||_0x3f47f8[_0x071a('0x61')]['id'];_0x5e930d['agent']['id']=_0x3f47f8[_0x071a('0x58')][_0x071a('0x60')];return db['WhatsappMessage'][_0x071a('0x56')]({'where':{'id':_0x3f47f8[_0x071a('0x6f')]['id'],'UserId':null}})[_0x071a('0x25')](handleEntityNotFound(_0x19286b,null))['then'](function(_0x18b253){if(_0x18b253){_0x5e930d[_0x071a('0x2c')]=_0x18b253['get']({'plain':!![]});return db['WhatsappInteraction'][_0x071a('0x56')]({'where':{'id':_0x18b253[_0x071a('0x70')]}});}return null;})[_0x071a('0x25')](handleEntityNotFound(_0x19286b,null))[_0x071a('0x25')](function(_0x33d2de){if(_0x33d2de){_0x5e930d['interaction']=_0x33d2de[_0x071a('0x64')]({'plain':!![]});interaction_log[_0x071a('0x26')](_0x071a('0x71'),_0x3f47f8['user']['id'],_0x3f47f8['user'][_0x071a('0x3b')],_0x3f47f8[_0x071a('0x61')][_0x071a('0x68')],_0x5e930d[_0x071a('0x67')]['id'],_0x3f47f8[_0x071a('0x58')]?JSON[_0x071a('0x2a')](_0x3f47f8[_0x071a('0x58')]):_0x071a('0x69'));return respondWithRpcPromise('RejectMessage',_0x071a('0x72'),_0x5e930d);}return null;})[_0x071a('0x25')](function(_0x4119c7){if(_0x4119c7){_0x4119c7[_0x071a('0x2c')][_0x071a('0x6b')]=util[_0x071a('0x5e')](_0x071a('0x73'),_0x3f47f8['user'][_0x071a('0x3b')]);_0x4119c7[_0x071a('0x2c')]['channel']=_0x5e930d['channel'];_0x4119c7['message'][_0x071a('0x74')]='reject';respondWithRpcPromise(_0x071a('0x6d'),_0x071a('0x6d'),{'event':_0x071a('0x75'),'message':_0x4119c7['message']},client9002);return _0x5e930d;}return null;})[_0x071a('0x25')](respondWithResult(_0x19286b,null))['catch'](handleError(_0x19286b,null));};exports[_0x071a('0x30')]=function(_0x4134bd,_0x1d9efa,_0x5d638a){if(_0x4134bd['body']['id']){delete _0x4134bd[_0x071a('0x58')]['id'];}var _0x4124a8;return db[_0x071a('0x3f')]['find']({'where':{'id':_0x4134bd[_0x071a('0x6f')]['id']}})['then'](handleEntityNotFound(_0x1d9efa,null))[_0x071a('0x25')](function(_0x41ac0a){if(_0x41ac0a){_0x4124a8=_0x41ac0a;return db[_0x071a('0x76')][_0x071a('0x56')]({'where':{'id':_0x41ac0a[_0x071a('0x77')]}});}})[_0x071a('0x25')](handleEntityNotFound(_0x1d9efa,null))['then'](function(_0x4a20c9){if(_0x4a20c9){logger[_0x071a('0x78')](_0x071a('0x79'),_0x071a('0x30'),'received\x20delivery\x20report\x20from',_0x4a20c9[_0x071a('0x4f')],util['inspect'](_0x4134bd[_0x071a('0x58')],{'showHidden':![],'depth':null}));switch(_0x4a20c9[_0x071a('0x4f')]){case _0x071a('0x7a'):if(_0x4134bd[_0x071a('0x58')][_0x071a('0x7b')]&&_0x4134bd[_0x071a('0x58')][_0x071a('0x7b')]===_0x4124a8[_0x071a('0x7c')]&&_0x4134bd[_0x071a('0x58')][_0x071a('0x7d')]&&_0x4134bd[_0x071a('0x58')]['MessageStatus']===_0x071a('0x7e')){return _0x4124a8[_0x071a('0x39')]({'read':!![]});}else{logger[_0x071a('0x2b')](_0x071a('0x7f'),_0x071a('0x30'),_0x071a('0x7a'),util[_0x071a('0x80')](_0x4134bd[_0x071a('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x4124a8;}})[_0x071a('0x25')](respondWithResult(_0x1d9efa,null))[_0x071a('0x2e')](handleError(_0x1d9efa,null));};
\ No newline at end of file
+var _0x136d=['rejectMessage','SIP/%s','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../mysqldb','defaults','redis','./whatsappMessage.socket','register','jayson/promise','http','client','test','ValidationError','request','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','Content-Range','apply','save','update','then','stack','name','send','map','rawAttributes','keys','filters','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','WhatsappMessage','count','includeAll','include','findAll','rows','show','params','options','create','body','destroy','find','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','CmContact','Contact','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','user','AcceptMessage','manual','interface','channel','event','EventManager','acceptmessage','reject','agent','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null'];(function(_0x112236,_0x2d9819){var _0x19bfea=function(_0x51819e){while(--_0x51819e){_0x112236['push'](_0x112236['shift']());}};_0x19bfea(++_0x2d9819);}(_0x136d,0x92));var _0xd136=function(_0x310eb9,_0x1aed15){_0x310eb9=_0x310eb9-0x0;var _0x28915c=_0x136d[_0x310eb9];return _0x28915c;};'use strict';var pdf=require(_0xd136('0x0'));var emlformat=require(_0xd136('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd136('0x2'));var rp=require(_0xd136('0x3'));var moment=require(_0xd136('0x4'));var BPromise=require(_0xd136('0x5'));var Mustache=require(_0xd136('0x6'));var util=require('util');var path=require(_0xd136('0x7'));var sox=require(_0xd136('0x8'));var csv=require(_0xd136('0x9'));var ejs=require(_0xd136('0xa'));var fs=require('fs');var _=require(_0xd136('0xb'));var squel=require(_0xd136('0xc'));var crypto=require(_0xd136('0xd'));var jsforce=require(_0xd136('0xe'));var deskjs=require(_0xd136('0xf'));var toCsv=require(_0xd136('0x9'));var querystring=require(_0xd136('0x10'));var Papa=require(_0xd136('0x11'));var Redis=require(_0xd136('0x12'));var authService=require(_0xd136('0x13'));var qs=require(_0xd136('0x14'));var as=require(_0xd136('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd136('0x16'))(_0xd136('0x17'));var utils=require(_0xd136('0x18'));var config=require(_0xd136('0x19'));var db=require(_0xd136('0x1a'))['db'];config['redis']=_[_0xd136('0x1b')](config[_0xd136('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd136('0x1d'))[_0xd136('0x1e')](socket);var jayson=require(_0xd136('0x1f'));var client=jayson['client'][_0xd136('0x20')]({'port':0x232c});var client9002=jayson[_0xd136('0x21')][_0xd136('0x20')]({'port':0x232a});function checkPasswordPattern(_0x43bcd3,_0x418c7a,_0x1abbe9){if(_0x1abbe9){var _0x2271bd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2271bd[_0xd136('0x22')](_0x418c7a)){return _0x43bcd3;}else{throw new db['Sequelize'][(_0xd136('0x23'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x43bcd3;}}function respondWithRpcPromise(_0x341a49,_0x13bd96,_0xaefaa,_0x876e36){return new BPromise(function(_0x5a3fa3,_0x5d4ce9){var _0x159b88=_0x876e36||client;return _0x159b88[_0xd136('0x24')](_0x341a49,_0xaefaa)['then'](function(_0x3c1b02){logger['info'](_0xd136('0x25'),_0x13bd96,_0xd136('0x26'));logger[_0xd136('0x27')](_0xd136('0x28'),_0x13bd96,_0xd136('0x26'),JSON[_0xd136('0x29')](_0x3c1b02));if(_0x3c1b02[_0xd136('0x2a')]){if(_0x3c1b02['error'][_0xd136('0x2b')]===0x1f4){logger[_0xd136('0x2a')](_0xd136('0x25'),_0x13bd96,_0x3c1b02[_0xd136('0x2a')][_0xd136('0x2c')]);return _0x5d4ce9(_0x3c1b02[_0xd136('0x2a')][_0xd136('0x2c')]);}logger[_0xd136('0x2a')](_0xd136('0x25'),_0x13bd96,_0x3c1b02[_0xd136('0x2a')][_0xd136('0x2c')]);return _0x5a3fa3(_0x3c1b02['error'][_0xd136('0x2c')]);}else{logger[_0xd136('0x2d')](_0xd136('0x25'),_0x13bd96,'request\x20sent');_0x5a3fa3(_0x3c1b02[_0xd136('0x2e')][_0xd136('0x2c')]);}})[_0xd136('0x2f')](function(_0x253e89){logger[_0xd136('0x2a')](_0xd136('0x25'),_0x13bd96,_0x253e89);_0x5d4ce9(_0x253e89);});});}function respondWithStatusCode(_0x23f103,_0x2c52f4){_0x2c52f4=_0x2c52f4||0xcc;return function(_0x5d74c2){if(_0x5d74c2){return _0x23f103[_0xd136('0x30')](_0x2c52f4);}return _0x23f103[_0xd136('0x31')](_0x2c52f4)[_0xd136('0x32')]();};}function respondWithResult(_0x3ab10d,_0xba0454){_0xba0454=_0xba0454||0xc8;return function(_0x320f8f){if(_0x320f8f){return _0x3ab10d[_0xd136('0x31')](_0xba0454)[_0xd136('0x33')](_0x320f8f);}};}function respondWithFilteredResult(_0x15cffb,_0x3917dc){return function(_0x5e5d69){if(_0x5e5d69){var _0x35b306=_0x5e5d69['count'],_0x555313=_0x3917dc[_0xd136('0x34')],_0x17d7ea=_0x3917dc['offset']+_0x3917dc['limit'],_0x3d58db;if(_0x17d7ea>=_0x35b306){_0x17d7ea=_0x35b306;_0x3d58db=0xc8;}else{_0x3d58db=0xce;}_0x15cffb[_0xd136('0x31')](_0x3d58db);return _0x15cffb['set'](_0xd136('0x35'),_0x555313+'-'+_0x17d7ea+'/'+_0x35b306)[_0xd136('0x33')](_0x5e5d69);}return null;};}function patchUpdates(_0xf995d8){return function(_0x107a9c){try{jsonpatch[_0xd136('0x36')](_0x107a9c,_0xf995d8,!![]);}catch(_0x147d29){return BPromise['reject'](_0x147d29);}return _0x107a9c[_0xd136('0x37')]();};}function saveUpdates(_0x331e44,_0xa6278d){return function(_0x3d618d){if(_0x3d618d){return _0x3d618d[_0xd136('0x38')](_0x331e44)[_0xd136('0x39')](function(_0xa716e){return _0xa716e;});}return null;};}function removeEntity(_0x525382,_0x2b7da4){return function(_0x222848){if(_0x222848){return _0x222848['destroy']()[_0xd136('0x39')](function(){_0x525382[_0xd136('0x31')](0xcc)[_0xd136('0x32')]();});}};}function handleEntityNotFound(_0x32c209,_0x3c74e3){return function(_0x35fd35){if(!_0x35fd35){_0x32c209[_0xd136('0x30')](0x194);}return _0x35fd35;};}function handleError(_0x4dbf1a,_0x1b6421){_0x1b6421=_0x1b6421||0x1f4;return function(_0x1c568c){logger['error'](_0x1c568c[_0xd136('0x3a')]);if(_0x1c568c['name']){delete _0x1c568c[_0xd136('0x3b')];}_0x4dbf1a[_0xd136('0x31')](_0x1b6421)[_0xd136('0x3c')](_0x1c568c);};}exports['index']=function(_0x333431,_0x22c464){var _0x55a761={},_0x1b6ee7={},_0x2caa39={'count':0x0,'rows':[]};var _0x52d3e9=_[_0xd136('0x3d')](db['WhatsappMessage'][_0xd136('0x3e')],function(_0x4c2331){return{'name':_0x4c2331['fieldName'],'type':_0x4c2331['type']['key']};});_0x1b6ee7['model']=_[_0xd136('0x3d')](_0x52d3e9,'name');_0x1b6ee7['query']=_[_0xd136('0x3f')](_0x333431['query']);_0x1b6ee7[_0xd136('0x40')]=_['intersection'](_0x1b6ee7[_0xd136('0x41')],_0x1b6ee7[_0xd136('0x42')]);_0x55a761['attributes']=_[_0xd136('0x43')](_0x1b6ee7['model'],qs[_0xd136('0x44')](_0x333431[_0xd136('0x42')][_0xd136('0x44')]));_0x55a761[_0xd136('0x45')]=_0x55a761['attributes'][_0xd136('0x46')]?_0x55a761[_0xd136('0x45')]:_0x1b6ee7[_0xd136('0x41')];if(!_0x333431[_0xd136('0x42')][_0xd136('0x47')](_0xd136('0x48'))){_0x55a761[_0xd136('0x49')]=qs[_0xd136('0x49')](_0x333431['query'][_0xd136('0x49')]);_0x55a761[_0xd136('0x34')]=qs['offset'](_0x333431['query']['offset']);}_0x55a761[_0xd136('0x4a')]=qs[_0xd136('0x4b')](_0x333431[_0xd136('0x42')][_0xd136('0x4b')]);_0x55a761['where']=qs[_0xd136('0x40')](_[_0xd136('0x4c')](_0x333431[_0xd136('0x42')],_0x1b6ee7['filters']),_0x52d3e9);if(_0x333431['query'][_0xd136('0x4d')]){_0x55a761[_0xd136('0x4e')]=_['merge'](_0x55a761[_0xd136('0x4e')],{'$or':_[_0xd136('0x3d')](_0x52d3e9,function(_0x4f341b){if(_0x4f341b['type']!==_0xd136('0x4f')){var _0x21cf74={};_0x21cf74[_0x4f341b[_0xd136('0x3b')]]={'$like':'%'+_0x333431[_0xd136('0x42')][_0xd136('0x4d')]+'%'};return _0x21cf74;}})});}_0x55a761=_['merge']({},_0x55a761,_0x333431['options']);var _0x23e248={'where':_0x55a761[_0xd136('0x4e')]};return db[_0xd136('0x50')][_0xd136('0x51')](_0x23e248)[_0xd136('0x39')](function(_0x150c38){_0x2caa39[_0xd136('0x51')]=_0x150c38;if(_0x333431['query'][_0xd136('0x52')]){_0x55a761[_0xd136('0x53')]=[{'all':!![]}];}return db[_0xd136('0x50')][_0xd136('0x54')](_0x55a761);})['then'](function(_0x500ab1){_0x2caa39[_0xd136('0x55')]=_0x500ab1;return _0x2caa39;})[_0xd136('0x39')](respondWithFilteredResult(_0x22c464,_0x55a761))[_0xd136('0x2f')](handleError(_0x22c464,null));};exports[_0xd136('0x56')]=function(_0x2b425b,_0x571358){var _0x10b75f={'raw':!![],'where':{'id':_0x2b425b[_0xd136('0x57')]['id']}},_0x17a796={};_0x17a796[_0xd136('0x41')]=_[_0xd136('0x3f')](db[_0xd136('0x50')][_0xd136('0x3e')]);_0x17a796['query']=_[_0xd136('0x3f')](_0x2b425b['query']);_0x17a796[_0xd136('0x40')]=_['intersection'](_0x17a796[_0xd136('0x41')],_0x17a796[_0xd136('0x42')]);_0x10b75f['attributes']=_['intersection'](_0x17a796[_0xd136('0x41')],qs[_0xd136('0x44')](_0x2b425b[_0xd136('0x42')][_0xd136('0x44')]));_0x10b75f[_0xd136('0x45')]=_0x10b75f[_0xd136('0x45')]['length']?_0x10b75f[_0xd136('0x45')]:_0x17a796['model'];if(_0x2b425b[_0xd136('0x42')]['includeAll']){_0x10b75f['include']=[{'all':!![]}];}_0x10b75f=_['merge']({},_0x10b75f,_0x2b425b[_0xd136('0x58')]);return db[_0xd136('0x50')]['find'](_0x10b75f)[_0xd136('0x39')](handleEntityNotFound(_0x571358,null))['then'](respondWithResult(_0x571358,null))[_0xd136('0x2f')](handleError(_0x571358,null));};exports[_0xd136('0x59')]=function(_0x404f70,_0x1e96f2){return db['WhatsappMessage'][_0xd136('0x59')](_0x404f70[_0xd136('0x5a')],{})[_0xd136('0x39')](respondWithResult(_0x1e96f2,0xc9))[_0xd136('0x2f')](handleError(_0x1e96f2,null));};exports[_0xd136('0x38')]=function(_0x5ece0d,_0x2eaca4){if(_0x5ece0d[_0xd136('0x5a')]['id']){delete _0x5ece0d[_0xd136('0x5a')]['id'];}return db[_0xd136('0x50')]['find']({'where':{'id':_0x5ece0d[_0xd136('0x57')]['id']}})[_0xd136('0x39')](handleEntityNotFound(_0x2eaca4,null))[_0xd136('0x39')](saveUpdates(_0x5ece0d[_0xd136('0x5a')],null))[_0xd136('0x39')](respondWithResult(_0x2eaca4,null))[_0xd136('0x2f')](handleError(_0x2eaca4,null));};exports[_0xd136('0x5b')]=function(_0x3c3254,_0x3c7493){return db[_0xd136('0x50')][_0xd136('0x5c')]({'where':{'id':_0x3c3254[_0xd136('0x57')]['id']}})['then'](handleEntityNotFound(_0x3c7493,null))['then'](removeEntity(_0x3c7493,null))[_0xd136('0x2f')](handleError(_0x3c7493,null));};exports['describe']=function(_0x1a3e94,_0x232b5b){return db['WhatsappMessage']['describe']()[_0xd136('0x39')](respondWithResult(_0x232b5b,null))[_0xd136('0x2f')](handleError(_0x232b5b,null));};var interaction_log=require(_0xd136('0x16'))(_0xd136('0x5d'));exports[_0xd136('0x5e')]=function(_0x2360d2,_0x28df57,_0x47d649){var _0x16e534={'channel':_0xd136('0x5f')};if(_0x2360d2[_0xd136('0x5a')]['id']){delete _0x2360d2[_0xd136('0x5a')]['id'];}_0x2360d2[_0xd136('0x5a')][_0xd136('0x60')]=!![];_0x2360d2[_0xd136('0x5a')][_0xd136('0x61')]=moment()[_0xd136('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x2360d2[_0xd136('0x5a')][_0xd136('0x63')]=_0x2360d2['body'][_0xd136('0x63')]||_0x2360d2['user']['id'];return db['WhatsappMessage'][_0xd136('0x5c')]({'where':{'id':_0x2360d2['params']['id'],'UserId':null},'include':[{'model':db[_0xd136('0x64')],'as':_0xd136('0x65')}]})[_0xd136('0x39')](handleEntityNotFound(_0x28df57,null))[_0xd136('0x39')](saveUpdates(_0x2360d2['body'],null))[_0xd136('0x39')](function(_0x1ec983){if(_0x1ec983){_0x16e534[_0xd136('0x2c')]=_0x1ec983[_0xd136('0x66')]({'plain':!![]});return db[_0xd136('0x67')][_0xd136('0x5c')]({'where':{'id':_0x1ec983[_0xd136('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x28df57,null))[_0xd136('0x39')](function(_0x1399e0){if(_0x1399e0){return _0x1399e0[_0xd136('0x38')]({'UserId':_0x2360d2['body'][_0xd136('0x63')],'read1stAt':_['isNil'](_0x1399e0[_0xd136('0x69')])?moment()[_0xd136('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xd136('0x39')](function(_0x164c31){if(_0x164c31){_0x16e534[_0xd136('0x6a')]=_0x164c31['get']({'plain':!![]});interaction_log[_0xd136('0x2d')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2360d2['user']['id'],_0x2360d2[_0xd136('0x6b')][_0xd136('0x3b')],_0x2360d2[_0xd136('0x6b')]['role'],_0x16e534[_0xd136('0x6a')]['id'],_0x2360d2[_0xd136('0x5a')]?JSON[_0xd136('0x29')](_0x2360d2[_0xd136('0x5a')]):'null');return respondWithRpcPromise(_0xd136('0x6c'),'acceptMessage',_0x16e534);}return null;})['then'](function(_0x5f3c28){if(_0x5f3c28){if(_0x2360d2[_0xd136('0x5a')][_0xd136('0x6d')]){_0x16e534['message'][_0xd136('0x6e')]=util[_0xd136('0x62')]('SIP/%s',_0x2360d2['user']['name']);_0x16e534[_0xd136('0x2c')][_0xd136('0x6f')]=_0x16e534['channel'];_0x16e534[_0xd136('0x2c')][_0xd136('0x70')]='accept';return respondWithRpcPromise(_0xd136('0x71'),'EventManager',{'event':_0xd136('0x72'),'message':_0x16e534[_0xd136('0x2c')]},client9002)[_0xd136('0x39')](function(){return _0x16e534;});}return _0x16e534;}return null;})[_0xd136('0x39')](respondWithResult(_0x28df57,null))[_0xd136('0x2f')](handleError(_0x28df57,null));};var interaction_log=require(_0xd136('0x16'))(_0xd136('0x5d'));exports[_0xd136('0x73')]=function(_0x5c76c5,_0x307298,_0x2b631a){var _0x348c01={'agent':{},'channel':_0xd136('0x5f')};if(_0x5c76c5[_0xd136('0x5a')]['id']){delete _0x5c76c5[_0xd136('0x5a')]['id'];}_0x5c76c5[_0xd136('0x5a')]['UserId']=_0x5c76c5[_0xd136('0x5a')][_0xd136('0x63')]||_0x5c76c5[_0xd136('0x6b')]['id'];_0x348c01[_0xd136('0x74')]['id']=_0x5c76c5[_0xd136('0x5a')][_0xd136('0x63')];return db[_0xd136('0x50')][_0xd136('0x5c')]({'where':{'id':_0x5c76c5[_0xd136('0x57')]['id'],'UserId':null}})[_0xd136('0x39')](handleEntityNotFound(_0x307298,null))[_0xd136('0x39')](function(_0x1d65fb){if(_0x1d65fb){_0x348c01[_0xd136('0x2c')]=_0x1d65fb['get']({'plain':!![]});return db[_0xd136('0x67')][_0xd136('0x5c')]({'where':{'id':_0x1d65fb[_0xd136('0x68')]}});}return null;})[_0xd136('0x39')](handleEntityNotFound(_0x307298,null))['then'](function(_0x76c2da){if(_0x76c2da){_0x348c01[_0xd136('0x6a')]=_0x76c2da[_0xd136('0x66')]({'plain':!![]});interaction_log['info'](_0xd136('0x75'),_0x5c76c5[_0xd136('0x6b')]['id'],_0x5c76c5['user'][_0xd136('0x3b')],_0x5c76c5[_0xd136('0x6b')][_0xd136('0x76')],_0x348c01[_0xd136('0x6a')]['id'],_0x5c76c5['body']?JSON['stringify'](_0x5c76c5[_0xd136('0x5a')]):_0xd136('0x77'));return respondWithRpcPromise('RejectMessage',_0xd136('0x78'),_0x348c01);}return null;})[_0xd136('0x39')](function(_0x3d43ef){if(_0x3d43ef){_0x3d43ef[_0xd136('0x2c')][_0xd136('0x6e')]=util['format'](_0xd136('0x79'),_0x5c76c5['user'][_0xd136('0x3b')]);_0x3d43ef['message']['channel']=_0x348c01[_0xd136('0x6f')];_0x3d43ef[_0xd136('0x2c')][_0xd136('0x70')]=_0xd136('0x73');respondWithRpcPromise(_0xd136('0x71'),_0xd136('0x71'),{'event':_0xd136('0x7a'),'message':_0x3d43ef[_0xd136('0x2c')]},client9002);return _0x348c01;}return null;})[_0xd136('0x39')](respondWithResult(_0x307298,null))[_0xd136('0x2f')](handleError(_0x307298,null));};exports['status']=function(_0x1a4313,_0x56d6a6,_0x4279b3){if(_0x1a4313[_0xd136('0x5a')]['id']){delete _0x1a4313['body']['id'];}var _0x3d41eb;return db[_0xd136('0x50')][_0xd136('0x5c')]({'where':{'id':_0x1a4313[_0xd136('0x57')]['id']}})[_0xd136('0x39')](handleEntityNotFound(_0x56d6a6,null))['then'](function(_0x6fd613){if(_0x6fd613){_0x3d41eb=_0x6fd613;return db['WhatsappAccount'][_0xd136('0x5c')]({'where':{'id':_0x6fd613[_0xd136('0x7b')]}});}})[_0xd136('0x39')](handleEntityNotFound(_0x56d6a6,null))[_0xd136('0x39')](function(_0x321922){if(_0x321922){logger[_0xd136('0x27')](_0xd136('0x7c'),_0xd136('0x31'),_0xd136('0x7d'),_0x321922[_0xd136('0x7e')],util[_0xd136('0x7f')](_0x1a4313[_0xd136('0x5a')],{'showHidden':![],'depth':null}));switch(_0x321922[_0xd136('0x7e')]){case _0xd136('0x80'):if(_0x1a4313[_0xd136('0x5a')][_0xd136('0x81')]&&_0x1a4313[_0xd136('0x5a')][_0xd136('0x81')]===_0x3d41eb[_0xd136('0x82')]&&_0x1a4313['body'][_0xd136('0x83')]&&_0x1a4313[_0xd136('0x5a')][_0xd136('0x83')]==='read'){return _0x3d41eb[_0xd136('0x38')]({'read':!![]});}else{logger[_0xd136('0x2a')](_0xd136('0x84'),_0xd136('0x31'),'twilio',util[_0xd136('0x7f')](_0x1a4313[_0xd136('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x3d41eb;}})[_0xd136('0x39')](respondWithResult(_0x56d6a6,null))[_0xd136('0x2f')](handleError(_0x56d6a6,null));};
\ No newline at end of file
index 850366d..b38c34a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0xb097d5,_0x581be5){var _0x1587bd=function(_0x4f1f0d){while(--_0x4f1f0d){_0xb097d5['push'](_0xb097d5['shift']());}};_0x1587bd(++_0x581be5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x457d60,_0x2347ce){_0x457d60=_0x457d60-0x0;var _0x59fa2d=_0x5f2f[_0x457d60];return _0x59fa2d;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var WhatsappMessage=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];WhatsappMessage[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x4ab75f,_0x6c6da1){var _0x810c30=function(_0x315f7c){while(--_0x315f7c){_0x4ab75f['push'](_0x4ab75f['shift']());}};_0x810c30(++_0x6c6da1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1b423b,_0x48afc1){_0x1b423b=_0x1b423b-0x0;var _0x482b03=_0x5f2f[_0x1b423b];return _0x482b03;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var WhatsappMessage=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];WhatsappMessage[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=WhatsappMessageEvents;
\ No newline at end of file
index 2da241f..d8a3104 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ebd=['twilio','authToken','phone','accountSid','whatsapp:','remote','/api/whatsapp/messages/','token','sid','catch','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','findOne','then','update','createdAt','WhatsappAccount','find','WhatsappAccountId','type'];(function(_0x4d931c,_0x340eaa){var _0x2d61c8=function(_0x5591f9){while(--_0x5591f9){_0x4d931c['push'](_0x4d931c['shift']());}};_0x2d61c8(++_0x340eaa);}(_0x3ebd,0x1f1));var _0xd3eb=function(_0xf2b128,_0x2f0464){_0xf2b128=_0xf2b128-0x0;var _0x149252=_0x3ebd[_0xf2b128];return _0x149252;};'use strict';var _=require(_0xd3eb('0x0'));var util=require('util');var logger=require(_0xd3eb('0x1'))(_0xd3eb('0x2'));var moment=require(_0xd3eb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3eb('0x4'));var rimraf=require(_0xd3eb('0x5'));var config=require(_0xd3eb('0x6'));var attributes=require(_0xd3eb('0x7'));module[_0xd3eb('0x8')]=function(_0x4b8917,_0x3dc6c0){return _0x4b8917[_0xd3eb('0x9')](_0xd3eb('0xa'),attributes,{'tableName':_0xd3eb('0xb'),'paranoid':![],'indexes':[{'name':_0xd3eb('0xc'),'fields':[_0xd3eb('0xc')]},{'name':_0xd3eb('0xd'),'fields':[_0xd3eb('0xe')],'type':_0xd3eb('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3dd144,_0x34e39b,_0x3e8ca5){var _0x3706a0=_0x4b8917['models'];var _0x36fa8f=_0x3dd144[_0xd3eb('0x10')]({'plain':!![]});if(_0x36fa8f[_0xd3eb('0x11')][_0xd3eb('0x12')]()==='in'||_0x36fa8f['direction']['toLowerCase']()===_0xd3eb('0x13')&&!_0x36fa8f[_0xd3eb('0x14')]&&!_[_0xd3eb('0x15')](_0x36fa8f['UserId'])){_0x3706a0[_0xd3eb('0x16')][_0xd3eb('0x17')]({'where':{'id':_0x36fa8f['WhatsappInteractionId']}})[_0xd3eb('0x18')](function(_0x38e93e){if(_0x38e93e){_0x38e93e[_0xd3eb('0x19')]({'lastMsgAt':_0x36fa8f[_0xd3eb('0x1a')],'lastMsgDirection':_0x36fa8f[_0xd3eb('0x11')][_0xd3eb('0x12')]()});}})['catch'](function(_0x5278db){console['error'](_0x5278db);});}if(_0x36fa8f['direction']===_0xd3eb('0x13')&&!_0x36fa8f['secret']){var _0x34d367;_0x3706a0[_0xd3eb('0x1b')][_0xd3eb('0x1c')]({'where':{'id':_0x36fa8f[_0xd3eb('0x1d')]},'raw':!![]})[_0xd3eb('0x18')](function(_0x43ee32){_0x34d367=_0x43ee32;if(_0x34d367&&_0x34d367[_0xd3eb('0x1e')]){switch(_0x34d367['type']){case'twilio':var _0x150739=require(_0xd3eb('0x1f'));if(_0x34d367['accountSid']&&_0x34d367[_0xd3eb('0x20')]&&_0x34d367[_0xd3eb('0x21')]){var _0x186c15=new _0x150739(_0x34d367[_0xd3eb('0x22')],_0x34d367['authToken']);_0x186c15['messages']['create']({'body':_0x36fa8f[_0xd3eb('0xe')],'to':_0xd3eb('0x23')+_0x36fa8f[_0xd3eb('0x21')],'from':_0xd3eb('0x23')+_0x34d367[_0xd3eb('0x21')],'statusCallback':_0x34d367[_0xd3eb('0x24')]+_0xd3eb('0x25')+_0x36fa8f['id']+'/status?token='+_0x34d367[_0xd3eb('0x26')]})[_0xd3eb('0x18')](function(_0x249e11){if(_0x249e11[_0xd3eb('0x27')]){return _0x3dd144[_0xd3eb('0x19')]({'messageId':_0x249e11[_0xd3eb('0x27')]});}})[_0xd3eb('0x28')](function(_0x367f4b){logger[_0xd3eb('0x29')](_0xd3eb('0x2a'),'afterCreate',_0xd3eb('0x1f'),util[_0xd3eb('0x2b')](_0x367f4b,{'showHidden':![],'depth':null}));});}else{logger[_0xd3eb('0x29')](_0xd3eb('0x2a'),_0xd3eb('0x2c'),_0xd3eb('0x1f'),_0xd3eb('0x2d'));}break;}}})['finally'](function(){_0x3e8ca5();});}else{_0x3e8ca5();}}},'charset':_0xd3eb('0x2e'),'collate':_0xd3eb('0x2f')});};
\ No newline at end of file
+var _0x0fb5=['WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','findOne','WhatsappInteractionId','update','createdAt','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','whatsapp:','/status?token=','token','then','sid','catch','error'];(function(_0x39165e,_0x1585ef){var _0x5b5d83=function(_0x2488c1){while(--_0x2488c1){_0x39165e['push'](_0x39165e['shift']());}};_0x5b5d83(++_0x1585ef);}(_0x0fb5,0x1c8));var _0x50fb=function(_0x1979a5,_0x480949){_0x1979a5=_0x1979a5-0x0;var _0xe50855=_0x0fb5[_0x1979a5];return _0xe50855;};'use strict';var _=require(_0x50fb('0x0'));var util=require(_0x50fb('0x1'));var logger=require(_0x50fb('0x2'))(_0x50fb('0x3'));var moment=require(_0x50fb('0x4'));var BPromise=require(_0x50fb('0x5'));var rp=require(_0x50fb('0x6'));var fs=require('fs');var path=require(_0x50fb('0x7'));var rimraf=require(_0x50fb('0x8'));var config=require(_0x50fb('0x9'));var attributes=require('./whatsappMessage.attributes');module[_0x50fb('0xa')]=function(_0x2ed5de,_0x112f0f){return _0x2ed5de[_0x50fb('0xb')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x50fb('0xc')]},{'name':_0x50fb('0xd'),'fields':['body'],'type':_0x50fb('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40d8ef,_0x27cfed,_0xf15456){var _0x472aa6=_0x2ed5de[_0x50fb('0xf')];var _0x47fbc2=_0x40d8ef[_0x50fb('0x10')]({'plain':!![]});if(_0x47fbc2[_0x50fb('0x11')][_0x50fb('0x12')]()==='in'||_0x47fbc2['direction'][_0x50fb('0x12')]()===_0x50fb('0x13')&&!_0x47fbc2[_0x50fb('0x14')]&&!_[_0x50fb('0x15')](_0x47fbc2['UserId'])){_0x472aa6['WhatsappInteraction'][_0x50fb('0x16')]({'where':{'id':_0x47fbc2[_0x50fb('0x17')]}})['then'](function(_0x4c13ce){if(_0x4c13ce){_0x4c13ce[_0x50fb('0x18')]({'lastMsgAt':_0x47fbc2[_0x50fb('0x19')],'lastMsgDirection':_0x47fbc2[_0x50fb('0x11')]['toLowerCase']()});}})['catch'](function(_0x3a3ddb){console['error'](_0x3a3ddb);});}if(_0x47fbc2[_0x50fb('0x11')]===_0x50fb('0x13')&&!_0x47fbc2[_0x50fb('0x14')]){var _0x10ed81;_0x472aa6[_0x50fb('0x1a')][_0x50fb('0x1b')]({'where':{'id':_0x47fbc2[_0x50fb('0x1c')]},'raw':!![]})['then'](function(_0x57d23a){_0x10ed81=_0x57d23a;if(_0x10ed81&&_0x10ed81[_0x50fb('0x1d')]){switch(_0x10ed81[_0x50fb('0x1d')]){case _0x50fb('0x1e'):var _0x53cf19=require(_0x50fb('0x1e'));if(_0x10ed81[_0x50fb('0x1f')]&&_0x10ed81[_0x50fb('0x20')]&&_0x10ed81[_0x50fb('0x21')]){var _0x319a0e=new _0x53cf19(_0x10ed81[_0x50fb('0x1f')],_0x10ed81[_0x50fb('0x20')]);_0x319a0e[_0x50fb('0x22')][_0x50fb('0x23')]({'body':_0x47fbc2[_0x50fb('0x24')],'to':_0x50fb('0x25')+_0x47fbc2['phone'],'from':_0x50fb('0x25')+_0x10ed81[_0x50fb('0x21')],'statusCallback':_0x10ed81['remote']+'/api/whatsapp/messages/'+_0x47fbc2['id']+_0x50fb('0x26')+_0x10ed81[_0x50fb('0x27')]})[_0x50fb('0x28')](function(_0x11fc1f){if(_0x11fc1f[_0x50fb('0x29')]){return _0x40d8ef[_0x50fb('0x18')]({'messageId':_0x11fc1f[_0x50fb('0x29')]});}})[_0x50fb('0x2a')](function(_0x8838c8){logger[_0x50fb('0x2b')](_0x50fb('0x2c'),_0x50fb('0x2d'),_0x50fb('0x1e'),util['inspect'](_0x8838c8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x50fb('0x2c'),_0x50fb('0x2d'),'twilio',_0x50fb('0x2e'));}break;}}})[_0x50fb('0x2f')](function(){_0xf15456();});}else{_0xf15456();}}},'charset':_0x50fb('0x30'),'collate':_0x50fb('0x31')});};
\ No newline at end of file
index 06e8409..935f034 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bdc=['stringify','error','code','message','CreateWhatsappMessage','WhatsappMessage','body','options','raw','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x7bdc,0x8a));var _0xc7bd=function(_0x318183,_0x179842){_0x318183=_0x318183-0x0;var _0x49914c=_0x7bdc[_0x318183];return _0x49914c;};'use strict';var _=require('lodash');var util=require(_0xc7bd('0x0'));var moment=require('moment');var BPromise=require(_0xc7bd('0x1'));var rs=require(_0xc7bd('0x2'));var fs=require('fs');var Redis=require(_0xc7bd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc7bd('0x4'));var logger=require(_0xc7bd('0x5'))(_0xc7bd('0x6'));var config=require(_0xc7bd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc7bd('0x8')][_0xc7bd('0x9')]({'port':0x232a});config[_0xc7bd('0xa')]=_[_0xc7bd('0xb')](config['redis'],{'host':_0xc7bd('0xc'),'port':0x18eb});var socket=require(_0xc7bd('0xd'))(new Redis(config[_0xc7bd('0xa')]));require(_0xc7bd('0xe'))[_0xc7bd('0xf')](socket);function respondWithRpcPromise(_0xd38afb,_0x305a28,_0x2c458a){return new BPromise(function(_0x49892b,_0x5ddbce){return client[_0xc7bd('0x10')](_0xd38afb,_0x2c458a)[_0xc7bd('0x11')](function(_0x5978b4){logger[_0xc7bd('0x12')](_0xc7bd('0x13'),_0x305a28,_0xc7bd('0x14'));logger[_0xc7bd('0x15')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x305a28,'request\x20sent',JSON[_0xc7bd('0x16')](_0x5978b4));if(_0x5978b4['error']){if(_0x5978b4[_0xc7bd('0x17')][_0xc7bd('0x18')]===0x1f4){logger[_0xc7bd('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x305a28,_0x5978b4[_0xc7bd('0x17')][_0xc7bd('0x19')]);return _0x5ddbce(_0x5978b4[_0xc7bd('0x17')][_0xc7bd('0x19')]);}logger[_0xc7bd('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x305a28,_0x5978b4[_0xc7bd('0x17')][_0xc7bd('0x19')]);return _0x49892b(_0x5978b4['error']['message']);}else{logger[_0xc7bd('0x12')](_0xc7bd('0x13'),_0x305a28,_0xc7bd('0x14'));_0x49892b(_0x5978b4['result']['message']);}})['catch'](function(_0x39a13c){logger['error'](_0xc7bd('0x13'),_0x305a28,_0x39a13c);_0x5ddbce(_0x39a13c);});});}exports[_0xc7bd('0x1a')]=function(_0x972ffb){var _0x584dc9=this;return new Promise(function(_0x27e7cf,_0x15e5d3){return db[_0xc7bd('0x1b')]['create'](_0x972ffb[_0xc7bd('0x1c')],{'raw':_0x972ffb[_0xc7bd('0x1d')]?_0x972ffb[_0xc7bd('0x1d')][_0xc7bd('0x1e')]===undefined?!![]:![]:!![]})[_0xc7bd('0x11')](function(_0x219d2a){logger['info'](_0xc7bd('0x1a'),_0x972ffb);logger['debug'](_0xc7bd('0x1a'),_0x972ffb,JSON['stringify'](_0x219d2a));_0x27e7cf(_0x219d2a);})[_0xc7bd('0x1f')](function(_0x201854){logger[_0xc7bd('0x17')]('CreateWhatsappMessage',_0x201854[_0xc7bd('0x19')],_0x972ffb);_0x15e5d3(_0x584dc9[_0xc7bd('0x17')](0x1f4,_0x201854[_0xc7bd('0x19')]));});});};
\ No newline at end of file
+var _0xeb3e=['localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0xb8bc2a,_0x1a8f96){var _0x3511cd=function(_0x2275fd){while(--_0x2275fd){_0xb8bc2a['push'](_0xb8bc2a['shift']());}};_0x3511cd(++_0x1a8f96);}(_0xeb3e,0x17d));var _0xeeb3=function(_0x3dbe69,_0x16677e){_0x3dbe69=_0x3dbe69-0x0;var _0x1ec686=_0xeb3e[_0x3dbe69];return _0x1ec686;};'use strict';var _=require(_0xeeb3('0x0'));var util=require(_0xeeb3('0x1'));var moment=require(_0xeeb3('0x2'));var BPromise=require(_0xeeb3('0x3'));var rs=require(_0xeeb3('0x4'));var fs=require('fs');var Redis=require(_0xeeb3('0x5'));var db=require(_0xeeb3('0x6'))['db'];var utils=require(_0xeeb3('0x7'));var logger=require(_0xeeb3('0x8'))('rpc');var config=require(_0xeeb3('0x9'));var jayson=require(_0xeeb3('0xa'));var client=jayson[_0xeeb3('0xb')][_0xeeb3('0xc')]({'port':0x232a});config[_0xeeb3('0xd')]=_[_0xeeb3('0xe')](config[_0xeeb3('0xd')],{'host':_0xeeb3('0xf'),'port':0x18eb});var socket=require(_0xeeb3('0x10'))(new Redis(config[_0xeeb3('0xd')]));require(_0xeeb3('0x11'))[_0xeeb3('0x12')](socket);function respondWithRpcPromise(_0xd890cf,_0xd3c8f,_0x188289){return new BPromise(function(_0x14c265,_0x366bc5){return client[_0xeeb3('0x13')](_0xd890cf,_0x188289)['then'](function(_0x678686){logger[_0xeeb3('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0xd3c8f,_0xeeb3('0x15'));logger[_0xeeb3('0x16')](_0xeeb3('0x17'),_0xd3c8f,_0xeeb3('0x15'),JSON[_0xeeb3('0x18')](_0x678686));if(_0x678686[_0xeeb3('0x19')]){if(_0x678686[_0xeeb3('0x19')][_0xeeb3('0x1a')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0xd3c8f,_0x678686['error'][_0xeeb3('0x1b')]);return _0x366bc5(_0x678686['error'][_0xeeb3('0x1b')]);}logger['error'](_0xeeb3('0x1c'),_0xd3c8f,_0x678686['error']['message']);return _0x14c265(_0x678686[_0xeeb3('0x19')][_0xeeb3('0x1b')]);}else{logger[_0xeeb3('0x14')](_0xeeb3('0x1c'),_0xd3c8f,_0xeeb3('0x15'));_0x14c265(_0x678686[_0xeeb3('0x1d')][_0xeeb3('0x1b')]);}})[_0xeeb3('0x1e')](function(_0x3a7111){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0xd3c8f,_0x3a7111);_0x366bc5(_0x3a7111);});});}exports[_0xeeb3('0x1f')]=function(_0x418e93){var _0x1fd488=this;return new Promise(function(_0x26743e,_0x5b00fe){return db[_0xeeb3('0x20')]['create'](_0x418e93[_0xeeb3('0x21')],{'raw':_0x418e93[_0xeeb3('0x22')]?_0x418e93[_0xeeb3('0x22')]['raw']===undefined?!![]:![]:!![]})[_0xeeb3('0x23')](function(_0x51add4){logger[_0xeeb3('0x14')](_0xeeb3('0x1f'),_0x418e93);logger['debug'](_0xeeb3('0x1f'),_0x418e93,JSON[_0xeeb3('0x18')](_0x51add4));_0x26743e(_0x51add4);})['catch'](function(_0x2b2fcd){logger[_0xeeb3('0x19')]('CreateWhatsappMessage',_0x2b2fcd[_0xeeb3('0x1b')],_0x418e93);_0x5b00fe(_0x1fd488['error'](0x1f4,_0x2b2fcd[_0xeeb3('0x1b')]));});});};
\ No newline at end of file
index bcaeb18..f993627 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14ee=['whatsappMessage:','./whatsappMessage.events','update','emit','removeListener','length'];(function(_0x338708,_0x211f8d){var _0x24188a=function(_0x1001a6){while(--_0x1001a6){_0x338708['push'](_0x338708['shift']());}};_0x24188a(++_0x211f8d);}(_0x14ee,0x115));var _0xe14e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14ee[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappMessageEvents=require(_0xe14e('0x0'));var events=['save','remove',_0xe14e('0x1')];function createListener(_0x43dba9,_0x9df8cf){return function(_0xdff449){_0x9df8cf[_0xe14e('0x2')](_0x43dba9,_0xdff449);};}function removeListener(_0x5db128,_0x1c8074){return function(){WhatsappMessageEvents[_0xe14e('0x3')](_0x5db128,_0x1c8074);};}exports['register']=function(_0x55d396){for(var _0x4c78d1=0x0,_0x1113a9=events[_0xe14e('0x4')];_0x4c78d1<_0x1113a9;_0x4c78d1++){var _0x29b76d=events[_0x4c78d1];var _0x10b6ac=createListener(_0xe14e('0x5')+_0x29b76d,_0x55d396);WhatsappMessageEvents['on'](_0x29b76d,_0x10b6ac);}};
\ No newline at end of file
+var _0x9b39=['save','remove','update','register','whatsappMessage:','./whatsappMessage.events'];(function(_0x4add67,_0x5a57c3){var _0x336e8d=function(_0x111030){while(--_0x111030){_0x4add67['push'](_0x4add67['shift']());}};_0x336e8d(++_0x5a57c3);}(_0x9b39,0x161));var _0x99b3=function(_0x21c271,_0x547b3e){_0x21c271=_0x21c271-0x0;var _0x2c6694=_0x9b39[_0x21c271];return _0x2c6694;};'use strict';var WhatsappMessageEvents=require(_0x99b3('0x0'));var events=[_0x99b3('0x1'),_0x99b3('0x2'),_0x99b3('0x3')];function createListener(_0x33a110,_0x1bd3dd){return function(_0xa40151){_0x1bd3dd['emit'](_0x33a110,_0xa40151);};}function removeListener(_0x441de7,_0x33e734){return function(){WhatsappMessageEvents['removeListener'](_0x441de7,_0x33e734);};}exports[_0x99b3('0x4')]=function(_0xc11fb0){for(var _0x24f491=0x0,_0x51ca52=events['length'];_0x24f491<_0x51ca52;_0x24f491++){var _0x23d2ab=events[_0x24f491];var _0x22f26d=createListener(_0x99b3('0x5')+_0x23d2ab,_0xc11fb0);WhatsappMessageEvents['on'](_0x23d2ab,_0x22f26d);}};
\ No newline at end of file
index ca00675..ee3cdb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bdd=['getAgents','post','create','addTeams','put','update','delete','destroy','removeAgents','exports','multer','path','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users'];(function(_0x1139d0,_0x41e5f8){var _0xcc01a6=function(_0x504ffa){while(--_0x504ffa){_0x1139d0['push'](_0x1139d0['shift']());}};_0xcc01a6(++_0x41e5f8);}(_0x3bdd,0x1e5));var _0xd3bd=function(_0x50ab6c,_0x1dafb4){_0x50ab6c=_0x50ab6c-0x0;var _0x1198b0=_0x3bdd[_0x50ab6c];return _0x1198b0;};'use strict';var multer=require(_0xd3bd('0x0'));var util=require('util');var path=require(_0xd3bd('0x1'));var timeout=require(_0xd3bd('0x2'));var express=require('express');var router=express[_0xd3bd('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd3bd('0x4'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0xd3bd('0x5')]('/',auth[_0xd3bd('0x6')](),controller[_0xd3bd('0x7')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd3bd('0x8')]);router[_0xd3bd('0x5')](_0xd3bd('0x9'),auth[_0xd3bd('0x6')](),controller[_0xd3bd('0xa')]);router['get'](_0xd3bd('0xb'),auth[_0xd3bd('0x6')](),controller[_0xd3bd('0xc')]);router[_0xd3bd('0x5')](_0xd3bd('0xd'),auth[_0xd3bd('0x6')](),controller['getTeams']);router[_0xd3bd('0x5')](_0xd3bd('0xe'),auth[_0xd3bd('0x6')](),controller[_0xd3bd('0xf')]);router[_0xd3bd('0x10')]('/',auth[_0xd3bd('0x6')](),controller[_0xd3bd('0x11')]);router[_0xd3bd('0x10')](_0xd3bd('0xd'),auth[_0xd3bd('0x6')](),controller[_0xd3bd('0x12')]);router[_0xd3bd('0x10')]('/:id/users',auth[_0xd3bd('0x6')](),controller['addAgents']);router[_0xd3bd('0x13')](_0xd3bd('0x9'),auth[_0xd3bd('0x6')](),controller[_0xd3bd('0x14')]);router[_0xd3bd('0x15')](_0xd3bd('0x9'),auth[_0xd3bd('0x6')](),controller[_0xd3bd('0x16')]);router[_0xd3bd('0x15')](_0xd3bd('0xd'),auth[_0xd3bd('0x6')](),controller['removeTeams']);router['delete'](_0xd3bd('0xe'),auth[_0xd3bd('0x6')](),controller[_0xd3bd('0x17')]);module[_0xd3bd('0x18')]=router;
\ No newline at end of file
+var _0x06f7=['getAgents','post','/:id/teams','addTeams','update','destroy','removeTeams','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getTeams','/:id/users'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0x06f7,0x14e));var _0x706f=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x06f7[_0x433a86];return _0x23000c;};'use strict';var multer=require('multer');var util=require(_0x706f('0x0'));var path=require(_0x706f('0x1'));var timeout=require(_0x706f('0x2'));var express=require(_0x706f('0x3'));var router=express[_0x706f('0x4')]();var auth=require(_0x706f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x706f('0x6'));var controller=require('./whatsappQueue.controller');router[_0x706f('0x7')]('/',auth[_0x706f('0x8')](),controller['index']);router['get'](_0x706f('0x9'),auth[_0x706f('0x8')](),controller[_0x706f('0xa')]);router[_0x706f('0x7')](_0x706f('0xb'),auth[_0x706f('0x8')](),controller[_0x706f('0xc')]);router[_0x706f('0x7')](_0x706f('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0x706f('0x7')]('/:id/teams',auth[_0x706f('0x8')](),controller[_0x706f('0xe')]);router['get'](_0x706f('0xf'),auth['isAuthenticated'](),controller[_0x706f('0x10')]);router[_0x706f('0x11')]('/',auth[_0x706f('0x8')](),controller['create']);router[_0x706f('0x11')](_0x706f('0x12'),auth[_0x706f('0x8')](),controller[_0x706f('0x13')]);router[_0x706f('0x11')](_0x706f('0xf'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x706f('0xb'),auth[_0x706f('0x8')](),controller[_0x706f('0x14')]);router['delete']('/:id',auth[_0x706f('0x8')](),controller[_0x706f('0x15')]);router['delete']('/:id/teams',auth[_0x706f('0x8')](),controller[_0x706f('0x16')]);router[_0x706f('0x17')](_0x706f('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x706f('0x18')]=router;
\ No newline at end of file
index 51ec32f..380c80c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96e7=['roundrobin','STRING','sequelize','exports','name','beepall'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x96e7,0x1b8));var _0x796e=function(_0x1b25c1,_0x2c6ce6){_0x1b25c1=_0x1b25c1-0x0;var _0x1e4447=_0x96e7[_0x1b25c1];return _0x1e4447;};'use strict';var Sequelize=require(_0x796e('0x0'));module[_0x796e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x796e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x796e('0x3'),_0x796e('0x4'))},'description':{'type':Sequelize[_0x796e('0x5')]}};
\ No newline at end of file
+var _0x116f=['roundrobin','sequelize','STRING','name','INTEGER','ENUM','beepall'];(function(_0x458401,_0x16016e){var _0x336984=function(_0x1c2a8f){while(--_0x1c2a8f){_0x458401['push'](_0x458401['shift']());}};_0x336984(++_0x16016e);}(_0x116f,0x94));var _0xf116=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x116f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf116('0x0'));module['exports']={'name':{'type':Sequelize[_0xf116('0x1')],'unique':_0xf116('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xf116('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf116('0x4')]('rrmemory',_0xf116('0x5'),_0xf116('0x6'))},'description':{'type':Sequelize[_0xf116('0x1')]}};
\ No newline at end of file
index fc8acaa..c6c7292 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x283b=['redis','defaults','localhost','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','get','WhatsappQueues','destroy','error','name','send','map','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','WhatsappQueue','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserWhatsappQueue','intersection','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','whatsappPause','getTeams','findOne','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','includes','all','union','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','ejs','lodash','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/environment','../../mysqldb'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x283b,0x188));var _0xb283=function(_0x57b27a,_0x2b05da){_0x57b27a=_0x57b27a-0x0;var _0x4187a3=_0x283b[_0x57b27a];return _0x4187a3;};'use strict';var pdf=require(_0xb283('0x0'));var emlformat=require(_0xb283('0x1'));var rimraf=require(_0xb283('0x2'));var zipdir=require(_0xb283('0x3'));var jsonpatch=require(_0xb283('0x4'));var rp=require(_0xb283('0x5'));var moment=require(_0xb283('0x6'));var BPromise=require(_0xb283('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb283('0x8'));var fs=require('fs');var _=require(_0xb283('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb283('0xa'));var deskjs=require(_0xb283('0xb'));var toCsv=require(_0xb283('0xc'));var querystring=require(_0xb283('0xd'));var Papa=require(_0xb283('0xe'));var Redis=require(_0xb283('0xf'));var authService=require(_0xb283('0x10'));var qs=require(_0xb283('0x11'));var as=require(_0xb283('0x12'));var hardwareService=require(_0xb283('0x13'));var logger=require(_0xb283('0x14'))(_0xb283('0x15'));var utils=require(_0xb283('0x16'));var config=require(_0xb283('0x17'));var db=require(_0xb283('0x18'))['db'];config[_0xb283('0x19')]=_[_0xb283('0x1a')](config[_0xb283('0x19')],{'host':_0xb283('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb283('0x19')]));require('./whatsappQueue.socket')[_0xb283('0x1c')](socket);function respondWithStatusCode(_0x129380,_0x26796e){_0x26796e=_0x26796e||0xcc;return function(_0x3b63aa){if(_0x3b63aa){return _0x129380[_0xb283('0x1d')](_0x26796e);}return _0x129380[_0xb283('0x1e')](_0x26796e)[_0xb283('0x1f')]();};}function respondWithResult(_0x283d6a,_0x32bf95){_0x32bf95=_0x32bf95||0xc8;return function(_0x5137ca){if(_0x5137ca){return _0x283d6a[_0xb283('0x1e')](_0x32bf95)[_0xb283('0x20')](_0x5137ca);}};}function respondWithFilteredResult(_0x18cfaa,_0x20c66b){return function(_0xdc07e2){if(_0xdc07e2){var _0x391509=_0xdc07e2[_0xb283('0x21')],_0x270291=_0x20c66b[_0xb283('0x22')],_0x47aed7=_0x20c66b[_0xb283('0x22')]+_0x20c66b[_0xb283('0x23')],_0x49ac3c;if(_0x47aed7>=_0x391509){_0x47aed7=_0x391509;_0x49ac3c=0xc8;}else{_0x49ac3c=0xce;}_0x18cfaa[_0xb283('0x1e')](_0x49ac3c);return _0x18cfaa[_0xb283('0x24')](_0xb283('0x25'),_0x270291+'-'+_0x47aed7+'/'+_0x391509)['json'](_0xdc07e2);}return null;};}function patchUpdates(_0x4c9183){return function(_0x409afc){try{jsonpatch[_0xb283('0x26')](_0x409afc,_0x4c9183,!![]);}catch(_0x3aa7ae){return BPromise['reject'](_0x3aa7ae);}return _0x409afc[_0xb283('0x27')]();};}function saveUpdates(_0x291f38,_0xc235cd){return function(_0x19d50c){if(_0x19d50c){return _0x19d50c['update'](_0x291f38)[_0xb283('0x28')](function(_0x8c33d8){return _0x8c33d8;});}return null;};}function removeEntity(_0x4a195c,_0x1bf2d5){return function(_0x4419bb){if(_0x4419bb){return _0x4419bb['destroy']()[_0xb283('0x28')](function(){var _0xa08b51=_0x4419bb[_0xb283('0x29')]({'plain':!![]});var _0x1d7c41=_0xb283('0x2a');return db['UserProfileResource'][_0xb283('0x2b')]({'where':{'type':_0x1d7c41,'resourceId':_0xa08b51['id']}})['then'](function(){return _0x4419bb;});})['then'](function(){_0x4a195c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49eb44,_0x141c8d){return function(_0x2b9dfd){if(!_0x2b9dfd){_0x49eb44[_0xb283('0x1d')](0x194);}return _0x2b9dfd;};}function handleError(_0x3bfe30,_0x293e30){_0x293e30=_0x293e30||0x1f4;return function(_0x2a3fa4){logger[_0xb283('0x2c')](_0x2a3fa4['stack']);if(_0x2a3fa4[_0xb283('0x2d')]){delete _0x2a3fa4[_0xb283('0x2d')];}_0x3bfe30[_0xb283('0x1e')](_0x293e30)[_0xb283('0x2e')](_0x2a3fa4);};}exports['index']=function(_0x38fd53,_0x948007){var _0x1cfb96={},_0x5db127={},_0x55d7b3={'count':0x0,'rows':[]};var _0x5b0bb4=_[_0xb283('0x2f')](db['WhatsappQueue']['rawAttributes'],function(_0x5609c5){return{'name':_0x5609c5[_0xb283('0x30')],'type':_0x5609c5[_0xb283('0x31')][_0xb283('0x32')]};});_0x5db127[_0xb283('0x33')]=_[_0xb283('0x2f')](_0x5b0bb4,_0xb283('0x2d'));_0x5db127[_0xb283('0x34')]=_[_0xb283('0x35')](_0x38fd53[_0xb283('0x34')]);_0x5db127[_0xb283('0x36')]=_['intersection'](_0x5db127['model'],_0x5db127[_0xb283('0x34')]);_0x1cfb96['attributes']=_['intersection'](_0x5db127[_0xb283('0x33')],qs['fields'](_0x38fd53['query']['fields']));_0x1cfb96[_0xb283('0x37')]=_0x1cfb96['attributes'][_0xb283('0x38')]?_0x1cfb96['attributes']:_0x5db127[_0xb283('0x33')];if(!_0x38fd53[_0xb283('0x34')][_0xb283('0x39')]('nolimit')){_0x1cfb96['limit']=qs[_0xb283('0x23')](_0x38fd53['query']['limit']);_0x1cfb96[_0xb283('0x22')]=qs[_0xb283('0x22')](_0x38fd53[_0xb283('0x34')][_0xb283('0x22')]);}_0x1cfb96[_0xb283('0x3a')]=qs[_0xb283('0x3b')](_0x38fd53[_0xb283('0x34')][_0xb283('0x3b')]);_0x1cfb96[_0xb283('0x3c')]=qs[_0xb283('0x36')](_[_0xb283('0x3d')](_0x38fd53[_0xb283('0x34')],_0x5db127[_0xb283('0x36')]),_0x5b0bb4);if(_0x38fd53[_0xb283('0x34')][_0xb283('0x3e')]){_0x1cfb96[_0xb283('0x3c')]=_[_0xb283('0x3f')](_0x1cfb96[_0xb283('0x3c')],{'$or':_[_0xb283('0x2f')](_0x5b0bb4,function(_0x103a2e){if(_0x103a2e[_0xb283('0x31')]!==_0xb283('0x40')){var _0x3c54f9={};_0x3c54f9[_0x103a2e[_0xb283('0x2d')]]={'$like':'%'+_0x38fd53[_0xb283('0x34')]['filter']+'%'};return _0x3c54f9;}})});}_0x1cfb96=_[_0xb283('0x3f')]({},_0x1cfb96,_0x38fd53[_0xb283('0x41')]);var _0x1bac2b={'where':_0x1cfb96[_0xb283('0x3c')]};return db['WhatsappQueue']['count'](_0x1bac2b)[_0xb283('0x28')](function(_0x33bf89){_0x55d7b3['count']=_0x33bf89;if(_0x38fd53[_0xb283('0x34')][_0xb283('0x42')]){_0x1cfb96[_0xb283('0x43')]=[{'all':!![]}];}return db[_0xb283('0x44')][_0xb283('0x45')](_0x1cfb96);})['then'](function(_0x47a27f){_0x55d7b3[_0xb283('0x46')]=_0x47a27f;return _0x55d7b3;})[_0xb283('0x28')](respondWithFilteredResult(_0x948007,_0x1cfb96))[_0xb283('0x47')](handleError(_0x948007,null));};exports[_0xb283('0x48')]=function(_0x3ba2fb,_0x2942e5){var _0x238dc8={'raw':!![],'where':{'id':_0x3ba2fb[_0xb283('0x49')]['id']}},_0x2eeabe={};_0x2eeabe[_0xb283('0x33')]=_['keys'](db[_0xb283('0x44')][_0xb283('0x4a')]);_0x2eeabe[_0xb283('0x34')]=_['keys'](_0x3ba2fb[_0xb283('0x34')]);_0x2eeabe['filters']=_['intersection'](_0x2eeabe[_0xb283('0x33')],_0x2eeabe[_0xb283('0x34')]);_0x238dc8[_0xb283('0x37')]=_['intersection'](_0x2eeabe[_0xb283('0x33')],qs['fields'](_0x3ba2fb[_0xb283('0x34')][_0xb283('0x4b')]));_0x238dc8[_0xb283('0x37')]=_0x238dc8[_0xb283('0x37')][_0xb283('0x38')]?_0x238dc8[_0xb283('0x37')]:_0x2eeabe[_0xb283('0x33')];if(_0x3ba2fb[_0xb283('0x34')]['includeAll']){_0x238dc8['include']=[{'all':!![]}];}_0x238dc8=_[_0xb283('0x3f')]({},_0x238dc8,_0x3ba2fb[_0xb283('0x41')]);return db[_0xb283('0x44')][_0xb283('0x4c')](_0x238dc8)[_0xb283('0x28')](handleEntityNotFound(_0x2942e5,null))['then'](respondWithResult(_0x2942e5,null))[_0xb283('0x47')](handleError(_0x2942e5,null));};exports[_0xb283('0x4d')]=function(_0x390cf1,_0x5994ce){return db[_0xb283('0x44')][_0xb283('0x4d')](_0x390cf1[_0xb283('0x4e')],{})[_0xb283('0x28')](function(_0x11788d){var _0x7bcfa8=_0x390cf1[_0xb283('0x4f')]['get']({'plain':!![]});if(!_0x7bcfa8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7bcfa8[_0xb283('0x50')]===_0xb283('0x4f')){var _0x36ce59=_0x11788d['get']({'plain':!![]});var _0x5360cd=_0xb283('0x2a');return db[_0xb283('0x51')][_0xb283('0x4c')]({'where':{'name':_0x5360cd,'userProfileId':_0x7bcfa8['userProfileId']},'raw':!![]})[_0xb283('0x28')](function(_0x6ed273){if(_0x6ed273&&_0x6ed273[_0xb283('0x52')]===0x0){return db['UserProfileResource'][_0xb283('0x4d')]({'name':_0x36ce59['name'],'resourceId':_0x36ce59['id'],'type':_0x6ed273[_0xb283('0x2d')],'sectionId':_0x6ed273['id']},{})[_0xb283('0x28')](function(){return _0x11788d;});}else{return _0x11788d;}})[_0xb283('0x47')](function(_0x15abac){logger[_0xb283('0x2c')](_0xb283('0x53'),_0x15abac);throw _0x15abac;});}return _0x11788d;})[_0xb283('0x28')](respondWithResult(_0x5994ce,0xc9))[_0xb283('0x47')](handleError(_0x5994ce,null));};exports[_0xb283('0x54')]=function(_0x3a2c2d,_0xfea5ce){if(_0x3a2c2d[_0xb283('0x4e')]['id']){delete _0x3a2c2d[_0xb283('0x4e')]['id'];}return db[_0xb283('0x44')][_0xb283('0x4c')]({'where':{'id':_0x3a2c2d[_0xb283('0x49')]['id']}})[_0xb283('0x28')](handleEntityNotFound(_0xfea5ce,null))[_0xb283('0x28')](saveUpdates(_0x3a2c2d[_0xb283('0x4e')],null))[_0xb283('0x28')](respondWithResult(_0xfea5ce,null))[_0xb283('0x47')](handleError(_0xfea5ce,null));};exports['destroy']=function(_0x51851f,_0x1d01ac){return db[_0xb283('0x44')][_0xb283('0x4c')]({'where':{'id':_0x51851f[_0xb283('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d01ac,null))[_0xb283('0x28')](removeEntity(_0x1d01ac,null))[_0xb283('0x47')](handleError(_0x1d01ac,null));};exports['describe']=function(_0x3bdc61,_0x31ae32){return db[_0xb283('0x44')][_0xb283('0x55')]()[_0xb283('0x28')](respondWithResult(_0x31ae32,null))['catch'](handleError(_0x31ae32,null));};exports[_0xb283('0x56')]=function(_0x4852e1,_0x22a2ce,_0x20c2d1){var _0x41bd3c={'raw':!![],'where':{}},_0x3f5495={},_0x421aa5;return db[_0xb283('0x44')]['findOne']({'where':{'id':_0x4852e1[_0xb283('0x49')]['id']}})[_0xb283('0x28')](handleEntityNotFound(_0x22a2ce,null))[_0xb283('0x28')](function(_0x5e4d00){if(_0x5e4d00){_0x421aa5=_0x5e4d00[_0xb283('0x29')]({'plain':!![]});_0x3f5495[_0xb283('0x33')]=_[_0xb283('0x35')](db[_0xb283('0x57')][_0xb283('0x4a')]);_0x3f5495[_0xb283('0x34')]=_['keys'](_0x4852e1['query']);_0x3f5495['filters']=_[_0xb283('0x58')](_0x3f5495[_0xb283('0x33')],_0x3f5495[_0xb283('0x34')]);_0x41bd3c['attributes']=_[_0xb283('0x58')](_0x3f5495[_0xb283('0x33')],qs[_0xb283('0x4b')](_0x4852e1['query'][_0xb283('0x4b')]));_0x41bd3c[_0xb283('0x37')]=_0x41bd3c[_0xb283('0x37')][_0xb283('0x38')]?_0x41bd3c['attributes']:_0x3f5495[_0xb283('0x33')];if(!_0x4852e1[_0xb283('0x34')][_0xb283('0x39')](_0xb283('0x59'))){_0x41bd3c[_0xb283('0x23')]=qs[_0xb283('0x23')](_0x4852e1[_0xb283('0x34')][_0xb283('0x23')]);_0x41bd3c[_0xb283('0x22')]=qs['offset'](_0x4852e1[_0xb283('0x34')]['offset']);}_0x41bd3c[_0xb283('0x3a')]=qs[_0xb283('0x3b')](_0x4852e1[_0xb283('0x34')][_0xb283('0x3b')]);_0x41bd3c[_0xb283('0x3c')]=qs['filters'](_[_0xb283('0x3d')](_0x4852e1['query'],_0x3f5495['filters']));_0x41bd3c[_0xb283('0x3c')][_0xb283('0x5a')]=_0x5e4d00['id'];if(_0x4852e1[_0xb283('0x34')]['filter']){_0x41bd3c[_0xb283('0x3c')]=_[_0xb283('0x3f')](_0x41bd3c[_0xb283('0x3c')],{'$or':_['map'](_0x41bd3c[_0xb283('0x37')],function(_0x2d3cb4){var _0x3e6da4={};_0x3e6da4[_0x2d3cb4]={'$like':'%'+_0x4852e1[_0xb283('0x34')][_0xb283('0x3e')]+'%'};return _0x3e6da4;})});}_0x41bd3c=_[_0xb283('0x3f')]({},_0x41bd3c,_0x4852e1[_0xb283('0x41')]);return db[_0xb283('0x57')]['findAll'](_0x41bd3c);}})['then'](function(_0xc06853){if(_0xc06853){return db[_0xb283('0x5b')][_0xb283('0x5c')]({'where':{'id':_[_0xb283('0x2f')](_0xc06853,_0xb283('0x5d')),'role':_0xb283('0x5e')},'attributes':['id',_0xb283('0x2d'),'whatsappPause',_0xb283('0x5f'),_0xb283('0x60')]});}})[_0xb283('0x28')](function(_0x5522e0){if(_0x5522e0){return{'count':_0x5522e0[_0xb283('0x21')],'rows':_[_0xb283('0x2f')](_0x5522e0[_0xb283('0x46')],function(_0x22197e){return{'membername':_0x22197e[_0xb283('0x2d')],'UserId':_0x22197e['id'],'queue_name':_0x421aa5['name'],'WhatsappQueueId':_0x421aa5['id'],'interface':util[_0xb283('0x61')]('%s/%s',_0xb283('0x62'),_0x22197e[_0xb283('0x2d')]),'penalty':0x0,'paused':_0x22197e[_0xb283('0x63')],'createdAt':_0x22197e[_0xb283('0x60')],'updatedAt':_0x22197e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb283('0x28')](respondWithFilteredResult(_0x22a2ce,_0x41bd3c))[_0xb283('0x47')](handleError(_0x22a2ce,null));};exports[_0xb283('0x64')]=function(_0x2725c2,_0xf17198,_0x22a621){var _0x5cf8b9={};var _0x45be30={};var _0x2d3d40;var _0x420056;return db[_0xb283('0x44')][_0xb283('0x65')]({'where':{'id':_0x2725c2[_0xb283('0x49')]['id']}})[_0xb283('0x28')](handleEntityNotFound(_0xf17198,null))[_0xb283('0x28')](function(_0x53cde4){if(_0x53cde4){_0x2d3d40=_0x53cde4;_0x45be30[_0xb283('0x33')]=_[_0xb283('0x35')](db['Team'][_0xb283('0x4a')]);_0x45be30[_0xb283('0x34')]=_[_0xb283('0x35')](_0x2725c2['query']);_0x45be30[_0xb283('0x36')]=_['intersection'](_0x45be30[_0xb283('0x33')],_0x45be30[_0xb283('0x34')]);_0x5cf8b9[_0xb283('0x37')]=_[_0xb283('0x58')](_0x45be30[_0xb283('0x33')],qs[_0xb283('0x4b')](_0x2725c2[_0xb283('0x34')][_0xb283('0x4b')]));_0x5cf8b9[_0xb283('0x37')]=_0x5cf8b9[_0xb283('0x37')]['length']?_0x5cf8b9[_0xb283('0x37')]:_0x45be30[_0xb283('0x33')];_0x5cf8b9[_0xb283('0x3a')]=qs[_0xb283('0x3b')](_0x2725c2[_0xb283('0x34')][_0xb283('0x3b')]);_0x5cf8b9[_0xb283('0x3c')]=qs[_0xb283('0x36')](_[_0xb283('0x3d')](_0x2725c2[_0xb283('0x34')],_0x45be30[_0xb283('0x36')]));if(_0x2725c2[_0xb283('0x34')][_0xb283('0x3e')]){_0x5cf8b9[_0xb283('0x3c')]=_[_0xb283('0x3f')](_0x5cf8b9[_0xb283('0x3c')],{'$or':_[_0xb283('0x2f')](_0x5cf8b9['attributes'],function(_0x1fe3a6){var _0x12f6ab={};_0x12f6ab[_0x1fe3a6]={'$like':'%'+_0x2725c2['query'][_0xb283('0x3e')]+'%'};return _0x12f6ab;})});}_0x5cf8b9=_[_0xb283('0x3f')]({},_0x5cf8b9,_0x2725c2['options']);return _0x2d3d40[_0xb283('0x64')](_0x5cf8b9);}})['then'](function(_0xaad7ab){if(_0xaad7ab){_0x420056=_0xaad7ab[_0xb283('0x38')];if(!_0x2725c2['query'][_0xb283('0x39')]('nolimit')){_0x5cf8b9[_0xb283('0x23')]=qs[_0xb283('0x23')](_0x2725c2[_0xb283('0x34')][_0xb283('0x23')]);_0x5cf8b9[_0xb283('0x22')]=qs['offset'](_0x2725c2[_0xb283('0x34')][_0xb283('0x22')]);}return _0x2d3d40[_0xb283('0x64')](_0x5cf8b9);}})[_0xb283('0x28')](function(_0x2a7148){if(_0x2a7148){return _0x2a7148?{'count':_0x420056,'rows':_0x2a7148}:null;}})['then'](respondWithResult(_0xf17198,null))[_0xb283('0x47')](handleError(_0xf17198,null));};exports[_0xb283('0x66')]=function(_0x13a64f,_0x281dc6,_0x663075){var _0x23f8b9=_0x13a64f[_0xb283('0x4e')][_0xb283('0x67')];return db[_0xb283('0x68')]['findAll']({'where':{'id':_0x23f8b9},'attributes':['id'],'include':[{'model':db[_0xb283('0x5b')],'as':_0xb283('0x69'),'attributes':['id',_0xb283('0x2d'),_0xb283('0x6a'),_0xb283('0x6b'),_0xb283('0x6c')],'raw':!![]}]})[_0xb283('0x28')](function(_0xe27d34){if(_0xe27d34){var _0x22bb31=_[_0xb283('0x6d')](_0xe27d34,function(_0x51f7d1){var _0x538dbd=_0x51f7d1[_0xb283('0x29')]({'plain':!![]});return _0x538dbd[_0xb283('0x69')];});return db['WhatsappQueue'][_0xb283('0x4c')]({'where':{'id':_0x13a64f[_0xb283('0x49')]['id']}})[_0xb283('0x28')](function(_0x5b7554){return db[_0xb283('0x6e')]['transaction'](function(_0x52a5d4){return _0x5b7554['addTeams'](_0x23f8b9,{'transaction':_0x52a5d4})['then'](function(){return BPromise[_0xb283('0x6f')](_0x22bb31,function(_0x419498){return db['UserWhatsappQueue'][_0xb283('0x70')]({'where':{'UserId':_0x419498['id'],'WhatsappQueueId':_0x13a64f[_0xb283('0x49')]['id']},'transaction':_0x52a5d4});});})[_0xb283('0x28')](function(){_0x22bb31['forEach'](function(_0x3ba081){socket[_0xb283('0x71')](_0xb283('0x72'),{'UserId':_0x3ba081['id'],'WhatsappQueueId':_0x5b7554['id']});});});});});}})[_0xb283('0x28')](respondWithStatusCode(_0x281dc6,null))[_0xb283('0x47')](handleError(_0x281dc6,null));};exports[_0xb283('0x73')]=function(_0xfd8b30,_0x54d457,_0x52c4a9){return db[_0xb283('0x68')][_0xb283('0x45')]({'where':{'id':_0xfd8b30[_0xb283('0x34')][_0xb283('0x67')]},'attributes':['id'],'include':[{'model':db[_0xb283('0x5b')],'as':_0xb283('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x54d457,null))[_0xb283('0x28')](function(_0x497676){var _0x5347e0=_[_0xb283('0x2f')](_0x497676,'id');var _0xf40c52=[];var _0x433afb=[];var _0x154f45=squel[_0xb283('0x74')]();_0x154f45[_0xb283('0x75')](_0xb283('0x76'))[_0xb283('0x77')]('team_has_whatsapp_queues','tq')[_0xb283('0x78')](_0xb283('0x79'),'ut',_0xb283('0x7a'))['where'](_0xb283('0x7b'),_0xfd8b30[_0xb283('0x49')]['id']);for(var _0x395547=0x0;_0x395547<_0x497676[_0xb283('0x38')];_0x395547+=0x1){let _0x55242e=_0x497676[_0x395547];for(var _0x342257=0x0;_0x342257<_0x55242e[_0xb283('0x69')][_0xb283('0x38')];_0x342257+=0x1){let _0x1b7d8f=_0x55242e['Agents'][_0x342257];var _0x5a56aa=_0x154f45[_0xb283('0x7c')]();_0x5a56aa[_0xb283('0x3c')](_0xb283('0x7d'),_0x1b7d8f['id']);_0x433afb['push'](db['sequelize'][_0xb283('0x34')](_0x5a56aa['toString'](),{'type':db[_0xb283('0x6e')][_0xb283('0x7e')]['SELECT']})[_0xb283('0x28')](function(_0x5e737f){if(_0x5e737f[_0xb283('0x38')]===0x1){return _0x1b7d8f['id'];}else{var _0x45a2c0=_[_0xb283('0x7f')](_[_0xb283('0x2f')](_0x5e737f,'TeamId'),function(_0x374460){return _[_0xb283('0x80')](_0x5347e0,_0x374460);});if(_0x45a2c0){return _0x1b7d8f['id'];}}}));}}return BPromise[_0xb283('0x81')](_0x433afb)[_0xb283('0x28')](function(_0x5c3393){_0xf40c52=_(_0xf40c52)[_0xb283('0x82')](_0x5c3393)['compact']()['value']();return db[_0xb283('0x44')][_0xb283('0x4c')]({'where':{'id':_0xfd8b30['params']['id']}})[_0xb283('0x28')](function(_0x313930){return db[_0xb283('0x6e')]['transaction'](function(_0x3739ca){return _0x313930[_0xb283('0x73')](_0xfd8b30[_0xb283('0x34')]['ids'],{'transaction':_0x3739ca})['then'](function(){if(!_[_0xb283('0x83')](_0xf40c52)){return _0x313930[_0xb283('0x84')](_0xf40c52,{'transaction':_0x3739ca});}})[_0xb283('0x28')](function(){_0xf40c52[_0xb283('0x85')](function(_0x295674){socket[_0xb283('0x71')](_0xb283('0x86'),{'UserId':_0x295674,'WhatsappQueueId':_0x313930['id']});});});});});});})[_0xb283('0x28')](respondWithStatusCode(_0x54d457,null))['catch'](handleError(_0x54d457,null));};exports[_0xb283('0x87')]=function(_0x628116,_0x58543a,_0x37468e){return db[_0xb283('0x44')][_0xb283('0x4c')]({'where':{'id':_0x628116['params']['id']}})[_0xb283('0x28')](handleEntityNotFound(_0x58543a,null))[_0xb283('0x28')](function(_0x56735c){if(_0x56735c){return _0x56735c['addAgents'](_0x628116[_0xb283('0x4e')][_0xb283('0x67')],_[_0xb283('0x88')](_0x628116[_0xb283('0x4e')],[_0xb283('0x67'),'id'])||{})['spread'](function(_0x227bc2){for(var _0x3d2536=0x0;_0x3d2536<_0x628116[_0xb283('0x4e')][_0xb283('0x67')][_0xb283('0x38')];_0x3d2536+=0x1){socket['emit'](_0xb283('0x72'),{'UserId':_0x628116[_0xb283('0x4e')][_0xb283('0x67')][_0x3d2536],'WhatsappQueueId':_0x628116['params']['id']});}return _0x227bc2;});}})['then'](respondWithResult(_0x58543a,null))['catch'](handleError(_0x58543a,null));};exports[_0xb283('0x84')]=function(_0x3bb49b,_0x3a75e7,_0x128570){return db[_0xb283('0x44')][_0xb283('0x4c')]({'where':{'id':_0x3bb49b[_0xb283('0x49')]['id']}})[_0xb283('0x28')](handleEntityNotFound(_0x3a75e7,null))['then'](function(_0x5cf8cf){if(_0x5cf8cf){return _0x5cf8cf[_0xb283('0x84')](_0x3bb49b['query'][_0xb283('0x67')])[_0xb283('0x28')](function(){if(_[_0xb283('0x89')](_0x3bb49b['query'][_0xb283('0x67')])){for(var _0x401e7a=0x0;_0x401e7a<_0x3bb49b[_0xb283('0x34')][_0xb283('0x67')][_0xb283('0x38')];_0x401e7a+=0x1){socket['emit'](_0xb283('0x86'),{'UserId':Number(_0x3bb49b[_0xb283('0x34')][_0xb283('0x67')][_0x401e7a]),'WhatsappQueueId':Number(_0x3bb49b[_0xb283('0x49')]['id'])});}}else{socket[_0xb283('0x71')](_0xb283('0x86'),{'UserId':Number(_0x3bb49b[_0xb283('0x34')][_0xb283('0x67')]),'WhatsappQueueId':Number(_0x3bb49b['params']['id'])});}});}})[_0xb283('0x28')](respondWithStatusCode(_0x3a75e7,null))[_0xb283('0x47')](handleError(_0x3a75e7,null));};exports[_0xb283('0x8a')]=function(_0x173986,_0x4c4cf6,_0x1b29b8){var _0x50f904={};var _0x55210c={};var _0x3a20ec;var _0x3f55d7;return db[_0xb283('0x44')]['findOne']({'where':{'id':_0x173986[_0xb283('0x49')]['id']}})[_0xb283('0x28')](handleEntityNotFound(_0x4c4cf6,null))[_0xb283('0x28')](function(_0x3dd4b5){if(_0x3dd4b5){_0x3a20ec=_0x3dd4b5;_0x55210c[_0xb283('0x33')]=_['keys'](db[_0xb283('0x5b')][_0xb283('0x4a')]);_0x55210c['query']=_[_0xb283('0x35')](_0x173986['query']);_0x55210c[_0xb283('0x36')]=_[_0xb283('0x58')](_0x55210c[_0xb283('0x33')],_0x55210c[_0xb283('0x34')]);_0x50f904[_0xb283('0x37')]=_[_0xb283('0x58')](_0x55210c['model'],qs[_0xb283('0x4b')](_0x173986[_0xb283('0x34')]['fields']));_0x50f904[_0xb283('0x37')]=_0x50f904[_0xb283('0x37')]['length']?_0x50f904[_0xb283('0x37')]:_0x55210c[_0xb283('0x33')];_0x50f904[_0xb283('0x3a')]=qs['sort'](_0x173986[_0xb283('0x34')][_0xb283('0x3b')]);_0x50f904[_0xb283('0x3c')]=qs[_0xb283('0x36')](_[_0xb283('0x3d')](_0x173986['query'],_0x55210c[_0xb283('0x36')]));if(_0x173986[_0xb283('0x34')][_0xb283('0x3e')]){_0x50f904['where']=_[_0xb283('0x3f')](_0x50f904['where'],{'$or':_[_0xb283('0x2f')](_0x50f904[_0xb283('0x37')],function(_0x5166de){var _0x53eb84={};_0x53eb84[_0x5166de]={'$like':'%'+_0x173986[_0xb283('0x34')]['filter']+'%'};return _0x53eb84;})});}_0x50f904=_['merge']({},_0x50f904,_0x173986['options']);return _0x3a20ec[_0xb283('0x8a')](_0x50f904);}})[_0xb283('0x28')](function(_0xba35d7){if(_0xba35d7){_0x3f55d7=_0xba35d7[_0xb283('0x38')];if(!_0x173986['query'][_0xb283('0x39')](_0xb283('0x59'))){_0x50f904[_0xb283('0x23')]=qs[_0xb283('0x23')](_0x173986['query']['limit']);_0x50f904[_0xb283('0x22')]=qs[_0xb283('0x22')](_0x173986['query'][_0xb283('0x22')]);}return _0x3a20ec[_0xb283('0x8a')](_0x50f904);}})[_0xb283('0x28')](function(_0x2fb4e3){if(_0x2fb4e3){return _0x2fb4e3?{'count':_0x3f55d7,'rows':_0x2fb4e3}:null;}})['then'](respondWithResult(_0x4c4cf6,null))[_0xb283('0x47')](handleError(_0x4c4cf6,null));};
\ No newline at end of file
+var _0xd81b=['options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','describe','UserWhatsappQueue','order','WhatsappQueueId','User','findAndCountAll','UserId','whatsappPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','findOne','Team','nolimit','addTeams','ids','Agents','online','interface','flatMap','transaction','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','includes','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','./whatsappQueue.socket','register','status','end','json','offset','limit','Content-Range','reject','save','update','destroy','then','get','WhatsappQueues','sendStatus','error','stack','name','index','map','WhatsappQueue','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL'];(function(_0x71c2ac,_0x32eb1f){var _0x47582e=function(_0x2365f8){while(--_0x2365f8){_0x71c2ac['push'](_0x71c2ac['shift']());}};_0x47582e(++_0x32eb1f);}(_0xd81b,0x152));var _0xbd81=function(_0x58e87c,_0x471d93){_0x58e87c=_0x58e87c-0x0;var _0x3a8bb5=_0xd81b[_0x58e87c];return _0x3a8bb5;};'use strict';var pdf=require(_0xbd81('0x0'));var emlformat=require(_0xbd81('0x1'));var rimraf=require(_0xbd81('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbd81('0x3'));var moment=require(_0xbd81('0x4'));var BPromise=require(_0xbd81('0x5'));var Mustache=require(_0xbd81('0x6'));var util=require(_0xbd81('0x7'));var path=require('path');var sox=require(_0xbd81('0x8'));var csv=require(_0xbd81('0x9'));var ejs=require(_0xbd81('0xa'));var fs=require('fs');var _=require(_0xbd81('0xb'));var squel=require(_0xbd81('0xc'));var crypto=require(_0xbd81('0xd'));var jsforce=require(_0xbd81('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbd81('0x9'));var querystring=require(_0xbd81('0xf'));var Papa=require(_0xbd81('0x10'));var Redis=require('ioredis');var authService=require(_0xbd81('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbd81('0x12'));var hardwareService=require(_0xbd81('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xbd81('0x14'));var db=require(_0xbd81('0x15'))['db'];config[_0xbd81('0x16')]=_[_0xbd81('0x17')](config[_0xbd81('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd81('0x16')]));require(_0xbd81('0x18'))[_0xbd81('0x19')](socket);function respondWithStatusCode(_0x1ed37f,_0x16210e){_0x16210e=_0x16210e||0xcc;return function(_0x4ffbae){if(_0x4ffbae){return _0x1ed37f['sendStatus'](_0x16210e);}return _0x1ed37f[_0xbd81('0x1a')](_0x16210e)[_0xbd81('0x1b')]();};}function respondWithResult(_0x22cdef,_0x267a8d){_0x267a8d=_0x267a8d||0xc8;return function(_0x3095e6){if(_0x3095e6){return _0x22cdef[_0xbd81('0x1a')](_0x267a8d)[_0xbd81('0x1c')](_0x3095e6);}};}function respondWithFilteredResult(_0x52e0bd,_0x333b90){return function(_0x156c25){if(_0x156c25){var _0x3e527c=_0x156c25['count'],_0x5b7d89=_0x333b90[_0xbd81('0x1d')],_0x26b96d=_0x333b90[_0xbd81('0x1d')]+_0x333b90[_0xbd81('0x1e')],_0x2022d6;if(_0x26b96d>=_0x3e527c){_0x26b96d=_0x3e527c;_0x2022d6=0xc8;}else{_0x2022d6=0xce;}_0x52e0bd[_0xbd81('0x1a')](_0x2022d6);return _0x52e0bd['set'](_0xbd81('0x1f'),_0x5b7d89+'-'+_0x26b96d+'/'+_0x3e527c)[_0xbd81('0x1c')](_0x156c25);}return null;};}function patchUpdates(_0x356ca1){return function(_0x53c3b0){try{jsonpatch['apply'](_0x53c3b0,_0x356ca1,!![]);}catch(_0x28c0d1){return BPromise[_0xbd81('0x20')](_0x28c0d1);}return _0x53c3b0[_0xbd81('0x21')]();};}function saveUpdates(_0x56187d,_0x4a4bcf){return function(_0x24198c){if(_0x24198c){return _0x24198c[_0xbd81('0x22')](_0x56187d)['then'](function(_0x351c84){return _0x351c84;});}return null;};}function removeEntity(_0x33b14b,_0x1653c1){return function(_0xc9d31f){if(_0xc9d31f){return _0xc9d31f[_0xbd81('0x23')]()[_0xbd81('0x24')](function(){var _0x54bf6a=_0xc9d31f[_0xbd81('0x25')]({'plain':!![]});var _0x5b51f4=_0xbd81('0x26');return db['UserProfileResource'][_0xbd81('0x23')]({'where':{'type':_0x5b51f4,'resourceId':_0x54bf6a['id']}})[_0xbd81('0x24')](function(){return _0xc9d31f;});})[_0xbd81('0x24')](function(){_0x33b14b[_0xbd81('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b022a,_0x50c578){return function(_0x359c9f){if(!_0x359c9f){_0x2b022a[_0xbd81('0x27')](0x194);}return _0x359c9f;};}function handleError(_0x39d7af,_0x44576a){_0x44576a=_0x44576a||0x1f4;return function(_0x3fb5ef){logger[_0xbd81('0x28')](_0x3fb5ef[_0xbd81('0x29')]);if(_0x3fb5ef[_0xbd81('0x2a')]){delete _0x3fb5ef[_0xbd81('0x2a')];}_0x39d7af['status'](_0x44576a)['send'](_0x3fb5ef);};}exports[_0xbd81('0x2b')]=function(_0x5c3496,_0x162af0){var _0x21368a={},_0x364826={},_0x591f4f={'count':0x0,'rows':[]};var _0x2e2c1c=_[_0xbd81('0x2c')](db[_0xbd81('0x2d')]['rawAttributes'],function(_0x51fb0d){return{'name':_0x51fb0d[_0xbd81('0x2e')],'type':_0x51fb0d[_0xbd81('0x2f')][_0xbd81('0x30')]};});_0x364826['model']=_[_0xbd81('0x2c')](_0x2e2c1c,_0xbd81('0x2a'));_0x364826[_0xbd81('0x31')]=_[_0xbd81('0x32')](_0x5c3496[_0xbd81('0x31')]);_0x364826['filters']=_[_0xbd81('0x33')](_0x364826[_0xbd81('0x34')],_0x364826[_0xbd81('0x31')]);_0x21368a[_0xbd81('0x35')]=_[_0xbd81('0x33')](_0x364826[_0xbd81('0x34')],qs[_0xbd81('0x36')](_0x5c3496['query'][_0xbd81('0x36')]));_0x21368a[_0xbd81('0x35')]=_0x21368a[_0xbd81('0x35')][_0xbd81('0x37')]?_0x21368a[_0xbd81('0x35')]:_0x364826[_0xbd81('0x34')];if(!_0x5c3496[_0xbd81('0x31')][_0xbd81('0x38')]('nolimit')){_0x21368a[_0xbd81('0x1e')]=qs[_0xbd81('0x1e')](_0x5c3496[_0xbd81('0x31')][_0xbd81('0x1e')]);_0x21368a[_0xbd81('0x1d')]=qs[_0xbd81('0x1d')](_0x5c3496[_0xbd81('0x31')][_0xbd81('0x1d')]);}_0x21368a['order']=qs[_0xbd81('0x39')](_0x5c3496[_0xbd81('0x31')][_0xbd81('0x39')]);_0x21368a[_0xbd81('0x3a')]=qs['filters'](_[_0xbd81('0x3b')](_0x5c3496[_0xbd81('0x31')],_0x364826[_0xbd81('0x3c')]),_0x2e2c1c);if(_0x5c3496[_0xbd81('0x31')][_0xbd81('0x3d')]){_0x21368a[_0xbd81('0x3a')]=_[_0xbd81('0x3e')](_0x21368a[_0xbd81('0x3a')],{'$or':_[_0xbd81('0x2c')](_0x2e2c1c,function(_0x308158){if(_0x308158[_0xbd81('0x2f')]!==_0xbd81('0x3f')){var _0x15c503={};_0x15c503[_0x308158['name']]={'$like':'%'+_0x5c3496[_0xbd81('0x31')][_0xbd81('0x3d')]+'%'};return _0x15c503;}})});}_0x21368a=_[_0xbd81('0x3e')]({},_0x21368a,_0x5c3496[_0xbd81('0x40')]);var _0x48e1b3={'where':_0x21368a['where']};return db[_0xbd81('0x2d')]['count'](_0x48e1b3)[_0xbd81('0x24')](function(_0x3a5b34){_0x591f4f[_0xbd81('0x41')]=_0x3a5b34;if(_0x5c3496['query'][_0xbd81('0x42')]){_0x21368a[_0xbd81('0x43')]=[{'all':!![]}];}return db[_0xbd81('0x2d')][_0xbd81('0x44')](_0x21368a);})[_0xbd81('0x24')](function(_0xdfa3f8){_0x591f4f[_0xbd81('0x45')]=_0xdfa3f8;return _0x591f4f;})[_0xbd81('0x24')](respondWithFilteredResult(_0x162af0,_0x21368a))[_0xbd81('0x46')](handleError(_0x162af0,null));};exports[_0xbd81('0x47')]=function(_0x20f570,_0x136dcb){var _0x227768={'raw':!![],'where':{'id':_0x20f570[_0xbd81('0x48')]['id']}},_0xf1f350={};_0xf1f350['model']=_[_0xbd81('0x32')](db[_0xbd81('0x2d')][_0xbd81('0x49')]);_0xf1f350[_0xbd81('0x31')]=_[_0xbd81('0x32')](_0x20f570[_0xbd81('0x31')]);_0xf1f350[_0xbd81('0x3c')]=_['intersection'](_0xf1f350[_0xbd81('0x34')],_0xf1f350[_0xbd81('0x31')]);_0x227768[_0xbd81('0x35')]=_['intersection'](_0xf1f350['model'],qs[_0xbd81('0x36')](_0x20f570[_0xbd81('0x31')][_0xbd81('0x36')]));_0x227768[_0xbd81('0x35')]=_0x227768[_0xbd81('0x35')][_0xbd81('0x37')]?_0x227768[_0xbd81('0x35')]:_0xf1f350[_0xbd81('0x34')];if(_0x20f570[_0xbd81('0x31')]['includeAll']){_0x227768['include']=[{'all':!![]}];}_0x227768=_[_0xbd81('0x3e')]({},_0x227768,_0x20f570[_0xbd81('0x40')]);return db[_0xbd81('0x2d')][_0xbd81('0x4a')](_0x227768)[_0xbd81('0x24')](handleEntityNotFound(_0x136dcb,null))[_0xbd81('0x24')](respondWithResult(_0x136dcb,null))[_0xbd81('0x46')](handleError(_0x136dcb,null));};exports[_0xbd81('0x4b')]=function(_0x82032a,_0x102164){return db['WhatsappQueue'][_0xbd81('0x4b')](_0x82032a[_0xbd81('0x4c')],{})[_0xbd81('0x24')](function(_0xb7b197){var _0x42a9b3=_0x82032a['user'][_0xbd81('0x25')]({'plain':!![]});if(!_0x42a9b3)throw new Error(_0xbd81('0x4d'));if(_0x42a9b3[_0xbd81('0x4e')]==='user'){var _0x503549=_0xb7b197['get']({'plain':!![]});var _0x3d35ff=_0xbd81('0x26');return db['UserProfileSection'][_0xbd81('0x4a')]({'where':{'name':_0x3d35ff,'userProfileId':_0x42a9b3[_0xbd81('0x4f')]},'raw':!![]})[_0xbd81('0x24')](function(_0x50b9bf){if(_0x50b9bf&&_0x50b9bf['autoAssociation']===0x0){return db[_0xbd81('0x50')][_0xbd81('0x4b')]({'name':_0x503549['name'],'resourceId':_0x503549['id'],'type':_0x50b9bf['name'],'sectionId':_0x50b9bf['id']},{})[_0xbd81('0x24')](function(){return _0xb7b197;});}else{return _0xb7b197;}})[_0xbd81('0x46')](function(_0x41d8ea){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41d8ea);throw _0x41d8ea;});}return _0xb7b197;})[_0xbd81('0x24')](respondWithResult(_0x102164,0xc9))['catch'](handleError(_0x102164,null));};exports[_0xbd81('0x22')]=function(_0x24c2de,_0x57336f){if(_0x24c2de[_0xbd81('0x4c')]['id']){delete _0x24c2de[_0xbd81('0x4c')]['id'];}return db[_0xbd81('0x2d')]['find']({'where':{'id':_0x24c2de['params']['id']}})[_0xbd81('0x24')](handleEntityNotFound(_0x57336f,null))[_0xbd81('0x24')](saveUpdates(_0x24c2de[_0xbd81('0x4c')],null))[_0xbd81('0x24')](respondWithResult(_0x57336f,null))['catch'](handleError(_0x57336f,null));};exports[_0xbd81('0x23')]=function(_0x4ea22d,_0x92a555){return db[_0xbd81('0x2d')][_0xbd81('0x4a')]({'where':{'id':_0x4ea22d[_0xbd81('0x48')]['id']}})[_0xbd81('0x24')](handleEntityNotFound(_0x92a555,null))[_0xbd81('0x24')](removeEntity(_0x92a555,null))['catch'](handleError(_0x92a555,null));};exports[_0xbd81('0x51')]=function(_0x1c6e88,_0x46ad50){return db[_0xbd81('0x2d')][_0xbd81('0x51')]()[_0xbd81('0x24')](respondWithResult(_0x46ad50,null))['catch'](handleError(_0x46ad50,null));};exports['getMembers']=function(_0x5d55a8,_0x45fb3e,_0x4fd6fa){var _0xce1941={'raw':!![],'where':{}},_0x2d98f3={},_0x5ed11d;return db[_0xbd81('0x2d')]['findOne']({'where':{'id':_0x5d55a8[_0xbd81('0x48')]['id']}})[_0xbd81('0x24')](handleEntityNotFound(_0x45fb3e,null))[_0xbd81('0x24')](function(_0xc6a9dd){if(_0xc6a9dd){_0x5ed11d=_0xc6a9dd[_0xbd81('0x25')]({'plain':!![]});_0x2d98f3[_0xbd81('0x34')]=_['keys'](db[_0xbd81('0x52')][_0xbd81('0x49')]);_0x2d98f3['query']=_[_0xbd81('0x32')](_0x5d55a8[_0xbd81('0x31')]);_0x2d98f3[_0xbd81('0x3c')]=_['intersection'](_0x2d98f3[_0xbd81('0x34')],_0x2d98f3['query']);_0xce1941[_0xbd81('0x35')]=_[_0xbd81('0x33')](_0x2d98f3[_0xbd81('0x34')],qs['fields'](_0x5d55a8[_0xbd81('0x31')][_0xbd81('0x36')]));_0xce1941[_0xbd81('0x35')]=_0xce1941[_0xbd81('0x35')][_0xbd81('0x37')]?_0xce1941[_0xbd81('0x35')]:_0x2d98f3[_0xbd81('0x34')];if(!_0x5d55a8['query'][_0xbd81('0x38')]('nolimit')){_0xce1941[_0xbd81('0x1e')]=qs[_0xbd81('0x1e')](_0x5d55a8[_0xbd81('0x31')][_0xbd81('0x1e')]);_0xce1941['offset']=qs['offset'](_0x5d55a8['query'][_0xbd81('0x1d')]);}_0xce1941[_0xbd81('0x53')]=qs['sort'](_0x5d55a8['query']['sort']);_0xce1941['where']=qs[_0xbd81('0x3c')](_[_0xbd81('0x3b')](_0x5d55a8['query'],_0x2d98f3[_0xbd81('0x3c')]));_0xce1941[_0xbd81('0x3a')][_0xbd81('0x54')]=_0xc6a9dd['id'];if(_0x5d55a8[_0xbd81('0x31')][_0xbd81('0x3d')]){_0xce1941[_0xbd81('0x3a')]=_['merge'](_0xce1941['where'],{'$or':_[_0xbd81('0x2c')](_0xce1941[_0xbd81('0x35')],function(_0x204dc0){var _0x3040d1={};_0x3040d1[_0x204dc0]={'$like':'%'+_0x5d55a8[_0xbd81('0x31')]['filter']+'%'};return _0x3040d1;})});}_0xce1941=_[_0xbd81('0x3e')]({},_0xce1941,_0x5d55a8[_0xbd81('0x40')]);return db[_0xbd81('0x52')][_0xbd81('0x44')](_0xce1941);}})[_0xbd81('0x24')](function(_0x53f511){if(_0x53f511){return db[_0xbd81('0x55')][_0xbd81('0x56')]({'where':{'id':_[_0xbd81('0x2c')](_0x53f511,_0xbd81('0x57')),'role':'agent'},'attributes':['id',_0xbd81('0x2a'),_0xbd81('0x58'),_0xbd81('0x59'),'createdAt']});}})[_0xbd81('0x24')](function(_0x1dfbcb){if(_0x1dfbcb){return{'count':_0x1dfbcb[_0xbd81('0x41')],'rows':_[_0xbd81('0x2c')](_0x1dfbcb[_0xbd81('0x45')],function(_0xf87a64){return{'membername':_0xf87a64['name'],'UserId':_0xf87a64['id'],'queue_name':_0x5ed11d[_0xbd81('0x2a')],'WhatsappQueueId':_0x5ed11d['id'],'interface':util[_0xbd81('0x5a')](_0xbd81('0x5b'),_0xbd81('0x5c'),_0xf87a64[_0xbd81('0x2a')]),'penalty':0x0,'paused':_0xf87a64['whatsappPause'],'createdAt':_0xf87a64[_0xbd81('0x5d')],'updatedAt':_0xf87a64[_0xbd81('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbd81('0x24')](respondWithFilteredResult(_0x45fb3e,_0xce1941))[_0xbd81('0x46')](handleError(_0x45fb3e,null));};exports[_0xbd81('0x5e')]=function(_0x47fb86,_0x17c001,_0x2e5a63){var _0x521595={};var _0x4ea3c5={};var _0x5aaeab;var _0xafb9e0;return db[_0xbd81('0x2d')][_0xbd81('0x5f')]({'where':{'id':_0x47fb86[_0xbd81('0x48')]['id']}})[_0xbd81('0x24')](handleEntityNotFound(_0x17c001,null))[_0xbd81('0x24')](function(_0x4b338c){if(_0x4b338c){_0x5aaeab=_0x4b338c;_0x4ea3c5[_0xbd81('0x34')]=_[_0xbd81('0x32')](db[_0xbd81('0x60')]['rawAttributes']);_0x4ea3c5[_0xbd81('0x31')]=_[_0xbd81('0x32')](_0x47fb86[_0xbd81('0x31')]);_0x4ea3c5[_0xbd81('0x3c')]=_['intersection'](_0x4ea3c5[_0xbd81('0x34')],_0x4ea3c5['query']);_0x521595[_0xbd81('0x35')]=_['intersection'](_0x4ea3c5[_0xbd81('0x34')],qs['fields'](_0x47fb86[_0xbd81('0x31')][_0xbd81('0x36')]));_0x521595[_0xbd81('0x35')]=_0x521595[_0xbd81('0x35')][_0xbd81('0x37')]?_0x521595[_0xbd81('0x35')]:_0x4ea3c5[_0xbd81('0x34')];_0x521595[_0xbd81('0x53')]=qs['sort'](_0x47fb86['query'][_0xbd81('0x39')]);_0x521595[_0xbd81('0x3a')]=qs[_0xbd81('0x3c')](_['pick'](_0x47fb86[_0xbd81('0x31')],_0x4ea3c5[_0xbd81('0x3c')]));if(_0x47fb86['query'][_0xbd81('0x3d')]){_0x521595[_0xbd81('0x3a')]=_[_0xbd81('0x3e')](_0x521595[_0xbd81('0x3a')],{'$or':_[_0xbd81('0x2c')](_0x521595['attributes'],function(_0x3584ff){var _0x5eae4f={};_0x5eae4f[_0x3584ff]={'$like':'%'+_0x47fb86[_0xbd81('0x31')][_0xbd81('0x3d')]+'%'};return _0x5eae4f;})});}_0x521595=_[_0xbd81('0x3e')]({},_0x521595,_0x47fb86[_0xbd81('0x40')]);return _0x5aaeab[_0xbd81('0x5e')](_0x521595);}})[_0xbd81('0x24')](function(_0x34310c){if(_0x34310c){_0xafb9e0=_0x34310c[_0xbd81('0x37')];if(!_0x47fb86[_0xbd81('0x31')]['hasOwnProperty'](_0xbd81('0x61'))){_0x521595[_0xbd81('0x1e')]=qs[_0xbd81('0x1e')](_0x47fb86[_0xbd81('0x31')]['limit']);_0x521595[_0xbd81('0x1d')]=qs[_0xbd81('0x1d')](_0x47fb86[_0xbd81('0x31')][_0xbd81('0x1d')]);}return _0x5aaeab[_0xbd81('0x5e')](_0x521595);}})[_0xbd81('0x24')](function(_0x4ec232){if(_0x4ec232){return _0x4ec232?{'count':_0xafb9e0,'rows':_0x4ec232}:null;}})[_0xbd81('0x24')](respondWithResult(_0x17c001,null))['catch'](handleError(_0x17c001,null));};exports[_0xbd81('0x62')]=function(_0x54abc3,_0x1490c4,_0x253e7b){var _0xb0221=_0x54abc3[_0xbd81('0x4c')][_0xbd81('0x63')];return db[_0xbd81('0x60')]['findAll']({'where':{'id':_0xb0221},'attributes':['id'],'include':[{'model':db[_0xbd81('0x55')],'as':_0xbd81('0x64'),'attributes':['id',_0xbd81('0x2a'),_0xbd81('0x65'),'voicePause',_0xbd81('0x66')],'raw':!![]}]})[_0xbd81('0x24')](function(_0x44b5fa){if(_0x44b5fa){var _0x509051=_[_0xbd81('0x67')](_0x44b5fa,function(_0x439fb4){var _0x9c2ca=_0x439fb4[_0xbd81('0x25')]({'plain':!![]});return _0x9c2ca[_0xbd81('0x64')];});return db[_0xbd81('0x2d')]['find']({'where':{'id':_0x54abc3[_0xbd81('0x48')]['id']}})[_0xbd81('0x24')](function(_0x19043e){return db['sequelize'][_0xbd81('0x68')](function(_0x133731){return _0x19043e[_0xbd81('0x62')](_0xb0221,{'transaction':_0x133731})[_0xbd81('0x24')](function(){return BPromise['each'](_0x509051,function(_0x39b3d0){return db[_0xbd81('0x52')]['findOrCreate']({'where':{'UserId':_0x39b3d0['id'],'WhatsappQueueId':_0x54abc3['params']['id']},'transaction':_0x133731});});})['then'](function(){_0x509051[_0xbd81('0x69')](function(_0x1e9b46){socket[_0xbd81('0x6a')](_0xbd81('0x6b'),{'UserId':_0x1e9b46['id'],'WhatsappQueueId':_0x19043e['id']});});});});});}})['then'](respondWithStatusCode(_0x1490c4,null))[_0xbd81('0x46')](handleError(_0x1490c4,null));};exports['removeTeams']=function(_0x55da9c,_0x5132e7,_0x58ddc9){return db[_0xbd81('0x60')][_0xbd81('0x44')]({'where':{'id':_0x55da9c['query'][_0xbd81('0x63')]},'attributes':['id'],'include':[{'model':db[_0xbd81('0x55')],'as':_0xbd81('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5132e7,null))[_0xbd81('0x24')](function(_0x135ad1){var _0x94d50d=_[_0xbd81('0x2c')](_0x135ad1,'id');var _0x10087c=[];var _0x52f9b2=[];var _0x46ee9e=squel[_0xbd81('0x6c')]();_0x46ee9e[_0xbd81('0x6d')](_0xbd81('0x6e'))[_0xbd81('0x6f')](_0xbd81('0x70'),'tq')[_0xbd81('0x71')](_0xbd81('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbd81('0x3a')]('WhatsappQueueId\x20=\x20?',_0x55da9c[_0xbd81('0x48')]['id']);for(var _0x83faf1=0x0;_0x83faf1<_0x135ad1[_0xbd81('0x37')];_0x83faf1+=0x1){let _0x2c7a0e=_0x135ad1[_0x83faf1];for(var _0x5bb6dd=0x0;_0x5bb6dd<_0x2c7a0e['Agents'][_0xbd81('0x37')];_0x5bb6dd+=0x1){let _0x156253=_0x2c7a0e[_0xbd81('0x64')][_0x5bb6dd];var _0xef4d64=_0x46ee9e[_0xbd81('0x73')]();_0xef4d64[_0xbd81('0x3a')](_0xbd81('0x74'),_0x156253['id']);_0x52f9b2[_0xbd81('0x75')](db[_0xbd81('0x76')][_0xbd81('0x31')](_0xef4d64[_0xbd81('0x77')](),{'type':db['sequelize'][_0xbd81('0x78')]['SELECT']})[_0xbd81('0x24')](function(_0xae74a8){if(_0xae74a8['length']===0x1){return _0x156253['id'];}else{var _0xb02690=_['every'](_[_0xbd81('0x2c')](_0xae74a8,'TeamId'),function(_0x4f2578){return _[_0xbd81('0x79')](_0x94d50d,_0x4f2578);});if(_0xb02690){return _0x156253['id'];}}}));}}return BPromise[_0xbd81('0x7a')](_0x52f9b2)[_0xbd81('0x24')](function(_0x1f6701){_0x10087c=_(_0x10087c)[_0xbd81('0x7b')](_0x1f6701)[_0xbd81('0x7c')]()[_0xbd81('0x7d')]();return db['WhatsappQueue'][_0xbd81('0x4a')]({'where':{'id':_0x55da9c[_0xbd81('0x48')]['id']}})['then'](function(_0x58d53f){return db[_0xbd81('0x76')][_0xbd81('0x68')](function(_0x58a288){return _0x58d53f['removeTeams'](_0x55da9c[_0xbd81('0x31')]['ids'],{'transaction':_0x58a288})['then'](function(){if(!_[_0xbd81('0x7e')](_0x10087c)){return _0x58d53f[_0xbd81('0x7f')](_0x10087c,{'transaction':_0x58a288});}})[_0xbd81('0x24')](function(){_0x10087c[_0xbd81('0x69')](function(_0xce9b0c){socket[_0xbd81('0x6a')](_0xbd81('0x80'),{'UserId':_0xce9b0c,'WhatsappQueueId':_0x58d53f['id']});});});});});});})[_0xbd81('0x24')](respondWithStatusCode(_0x5132e7,null))[_0xbd81('0x46')](handleError(_0x5132e7,null));};exports['addAgents']=function(_0x18ab83,_0x1c9708,_0x42aaf6){return db[_0xbd81('0x2d')]['find']({'where':{'id':_0x18ab83[_0xbd81('0x48')]['id']}})[_0xbd81('0x24')](handleEntityNotFound(_0x1c9708,null))[_0xbd81('0x24')](function(_0x53f0c7){if(_0x53f0c7){return _0x53f0c7[_0xbd81('0x81')](_0x18ab83[_0xbd81('0x4c')][_0xbd81('0x63')],_[_0xbd81('0x82')](_0x18ab83['body'],['ids','id'])||{})[_0xbd81('0x83')](function(_0x3322f1){for(var _0x1555fb=0x0;_0x1555fb<_0x18ab83['body'][_0xbd81('0x63')][_0xbd81('0x37')];_0x1555fb+=0x1){socket[_0xbd81('0x6a')](_0xbd81('0x6b'),{'UserId':_0x18ab83[_0xbd81('0x4c')][_0xbd81('0x63')][_0x1555fb],'WhatsappQueueId':_0x18ab83[_0xbd81('0x48')]['id']});}return _0x3322f1;});}})[_0xbd81('0x24')](respondWithResult(_0x1c9708,null))[_0xbd81('0x46')](handleError(_0x1c9708,null));};exports['removeAgents']=function(_0x2a2a6a,_0x35eb0e,_0x16f5ea){return db[_0xbd81('0x2d')][_0xbd81('0x4a')]({'where':{'id':_0x2a2a6a['params']['id']}})['then'](handleEntityNotFound(_0x35eb0e,null))[_0xbd81('0x24')](function(_0xc2bedb){if(_0xc2bedb){return _0xc2bedb[_0xbd81('0x7f')](_0x2a2a6a[_0xbd81('0x31')]['ids'])[_0xbd81('0x24')](function(){if(_[_0xbd81('0x84')](_0x2a2a6a[_0xbd81('0x31')]['ids'])){for(var _0x54a5e0=0x0;_0x54a5e0<_0x2a2a6a[_0xbd81('0x31')][_0xbd81('0x63')]['length'];_0x54a5e0+=0x1){socket[_0xbd81('0x6a')]('userWhatsappQueue:remove',{'UserId':Number(_0x2a2a6a[_0xbd81('0x31')][_0xbd81('0x63')][_0x54a5e0]),'WhatsappQueueId':Number(_0x2a2a6a[_0xbd81('0x48')]['id'])});}}else{socket['emit'](_0xbd81('0x80'),{'UserId':Number(_0x2a2a6a[_0xbd81('0x31')][_0xbd81('0x63')]),'WhatsappQueueId':Number(_0x2a2a6a['params']['id'])});}});}})[_0xbd81('0x24')](respondWithStatusCode(_0x35eb0e,null))['catch'](handleError(_0x35eb0e,null));};exports[_0xbd81('0x85')]=function(_0x4d3521,_0x4332a5,_0x11b8f2){var _0x4c7557={};var _0x498a9e={};var _0x3de2ab;var _0xc675b2;return db[_0xbd81('0x2d')]['findOne']({'where':{'id':_0x4d3521[_0xbd81('0x48')]['id']}})[_0xbd81('0x24')](handleEntityNotFound(_0x4332a5,null))[_0xbd81('0x24')](function(_0x17548b){if(_0x17548b){_0x3de2ab=_0x17548b;_0x498a9e[_0xbd81('0x34')]=_['keys'](db[_0xbd81('0x55')]['rawAttributes']);_0x498a9e[_0xbd81('0x31')]=_[_0xbd81('0x32')](_0x4d3521['query']);_0x498a9e[_0xbd81('0x3c')]=_['intersection'](_0x498a9e[_0xbd81('0x34')],_0x498a9e[_0xbd81('0x31')]);_0x4c7557[_0xbd81('0x35')]=_[_0xbd81('0x33')](_0x498a9e['model'],qs[_0xbd81('0x36')](_0x4d3521[_0xbd81('0x31')][_0xbd81('0x36')]));_0x4c7557[_0xbd81('0x35')]=_0x4c7557[_0xbd81('0x35')][_0xbd81('0x37')]?_0x4c7557[_0xbd81('0x35')]:_0x498a9e[_0xbd81('0x34')];_0x4c7557['order']=qs['sort'](_0x4d3521['query'][_0xbd81('0x39')]);_0x4c7557[_0xbd81('0x3a')]=qs[_0xbd81('0x3c')](_[_0xbd81('0x3b')](_0x4d3521[_0xbd81('0x31')],_0x498a9e[_0xbd81('0x3c')]));if(_0x4d3521['query'][_0xbd81('0x3d')]){_0x4c7557['where']=_[_0xbd81('0x3e')](_0x4c7557[_0xbd81('0x3a')],{'$or':_[_0xbd81('0x2c')](_0x4c7557[_0xbd81('0x35')],function(_0x30bfdc){var _0x954e3e={};_0x954e3e[_0x30bfdc]={'$like':'%'+_0x4d3521[_0xbd81('0x31')][_0xbd81('0x3d')]+'%'};return _0x954e3e;})});}_0x4c7557=_[_0xbd81('0x3e')]({},_0x4c7557,_0x4d3521[_0xbd81('0x40')]);return _0x3de2ab[_0xbd81('0x85')](_0x4c7557);}})[_0xbd81('0x24')](function(_0x342712){if(_0x342712){_0xc675b2=_0x342712[_0xbd81('0x37')];if(!_0x4d3521[_0xbd81('0x31')]['hasOwnProperty'](_0xbd81('0x61'))){_0x4c7557[_0xbd81('0x1e')]=qs[_0xbd81('0x1e')](_0x4d3521[_0xbd81('0x31')][_0xbd81('0x1e')]);_0x4c7557[_0xbd81('0x1d')]=qs['offset'](_0x4d3521[_0xbd81('0x31')][_0xbd81('0x1d')]);}return _0x3de2ab[_0xbd81('0x85')](_0x4c7557);}})[_0xbd81('0x24')](function(_0x22978e){if(_0x22978e){return _0x22978e?{'count':_0xc675b2,'rows':_0x22978e}:null;}})[_0xbd81('0x24')](respondWithResult(_0x4332a5,null))[_0xbd81('0x46')](handleError(_0x4332a5,null));};
\ No newline at end of file
index 1dbaf12..997a9ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bac=['hook','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x9bac,0x17b));var _0xc9ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9bac[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xc9ba('0x0'))['db'][_0xc9ba('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc9ba('0x2')](0x0);var events={'afterCreate':_0xc9ba('0x3'),'afterUpdate':_0xc9ba('0x4'),'afterDestroy':_0xc9ba('0x5')};function emitEvent(_0x524e56){return function(_0x18dc51,_0x5c0223,_0xd721bf){WhatsappQueueEvents[_0xc9ba('0x6')](_0x524e56+':'+_0x18dc51['id'],_0x18dc51);WhatsappQueueEvents[_0xc9ba('0x6')](_0x524e56,_0x18dc51);_0xd721bf(null);};}for(var e in events){if(events[_0xc9ba('0x7')](e)){var event=events[e];WhatsappQueue[_0xc9ba('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
+var _0x108f=['setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb','WhatsappQueue'];(function(_0x33cd9b,_0xfa877d){var _0x33be3d=function(_0xb1a8e9){while(--_0xb1a8e9){_0x33cd9b['push'](_0x33cd9b['shift']());}};_0x33be3d(++_0xfa877d);}(_0x108f,0xd5));var _0xf108=function(_0xcfca7e,_0x2e86aa){_0xcfca7e=_0xcfca7e-0x0;var _0x5a7672=_0x108f[_0xcfca7e];return _0x5a7672;};'use strict';var EventEmitter=require(_0xf108('0x0'));var WhatsappQueue=require(_0xf108('0x1'))['db'][_0xf108('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf108('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf108('0x4'),'afterDestroy':_0xf108('0x5')};function emitEvent(_0x20ff1b){return function(_0x1feba5,_0x21344b,_0x1f009d){WhatsappQueueEvents[_0xf108('0x6')](_0x20ff1b+':'+_0x1feba5['id'],_0x1feba5);WhatsappQueueEvents['emit'](_0x20ff1b,_0x1feba5);_0x1f009d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xf108('0x7')](e,emitEvent(event));}}module[_0xf108('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
index 5ffff4d..59164e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2890=['path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','whatsapp_queues','lodash','util','../../config/logger','moment','request-promise'];(function(_0x4ff236,_0x4cb8b6){var _0x138b9d=function(_0x168b74){while(--_0x168b74){_0x4ff236['push'](_0x4ff236['shift']());}};_0x138b9d(++_0x4cb8b6);}(_0x2890,0x119));var _0x0289=function(_0x2ebe9e,_0x5e3747){_0x2ebe9e=_0x2ebe9e-0x0;var _0x44b434=_0x2890[_0x2ebe9e];return _0x44b434;};'use strict';var _=require(_0x0289('0x0'));var util=require(_0x0289('0x1'));var logger=require(_0x0289('0x2'))('api');var moment=require(_0x0289('0x3'));var BPromise=require('bluebird');var rp=require(_0x0289('0x4'));var fs=require('fs');var path=require(_0x0289('0x5'));var rimraf=require(_0x0289('0x6'));var config=require(_0x0289('0x7'));var attributes=require(_0x0289('0x8'));module[_0x0289('0x9')]=function(_0x3475ad,_0x401657){return _0x3475ad['define']('WhatsappQueue',attributes,{'tableName':_0x0289('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf757=['define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','path','rimraf','./whatsappQueue.attributes','exports'];(function(_0x5a84c7,_0x10c10f){var _0x3f2015=function(_0xbb3f5b){while(--_0xbb3f5b){_0x5a84c7['push'](_0x5a84c7['shift']());}};_0x3f2015(++_0x10c10f);}(_0xf757,0x18f));var _0x7f75=function(_0x2ab76b,_0x176579){_0x2ab76b=_0x2ab76b-0x0;var _0x201126=_0xf757[_0x2ab76b];return _0x201126;};'use strict';var _=require(_0x7f75('0x0'));var util=require(_0x7f75('0x1'));var logger=require(_0x7f75('0x2'))(_0x7f75('0x3'));var moment=require(_0x7f75('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f75('0x5'));var rimraf=require(_0x7f75('0x6'));var config=require('../../config/environment');var attributes=require(_0x7f75('0x7'));module[_0x7f75('0x8')]=function(_0x8e8268,_0x4aa736){return _0x8e8268[_0x7f75('0x9')](_0x7f75('0xa'),attributes,{'tableName':_0x7f75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2edfa04..c2ad54e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9edc=['attributes','limit','include','map','model','info','GetWhatsappQueue','catch','ShowWhatsappQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','then','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','WhatsappQueue','findAll','options','where'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x9edc,0x8c));var _0xc9ed=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0x9edc[_0x39caaa];return _0x9b9c7d;};'use strict';var _=require(_0xc9ed('0x0'));var util=require(_0xc9ed('0x1'));var moment=require(_0xc9ed('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9ed('0x3'));var fs=require('fs');var Redis=require(_0xc9ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9ed('0x5'));var logger=require(_0xc9ed('0x6'))(_0xc9ed('0x7'));var config=require(_0xc9ed('0x8'));var jayson=require(_0xc9ed('0x9'));var client=jayson[_0xc9ed('0xa')][_0xc9ed('0xb')]({'port':0x232a});config[_0xc9ed('0xc')]=_[_0xc9ed('0xd')](config[_0xc9ed('0xc')],{'host':_0xc9ed('0xe'),'port':0x18eb});var socket=require(_0xc9ed('0xf'))(new Redis(config[_0xc9ed('0xc')]));require(_0xc9ed('0x10'))[_0xc9ed('0x11')](socket);function respondWithRpcPromise(_0x19aca0,_0x39aa10,_0x3f06d6){return new BPromise(function(_0x2369f0,_0x5800f3){return client['request'](_0x19aca0,_0x3f06d6)[_0xc9ed('0x12')](function(_0x42a225){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x39aa10,'request\x20sent');logger[_0xc9ed('0x13')](_0xc9ed('0x14'),_0x39aa10,_0xc9ed('0x15'),JSON[_0xc9ed('0x16')](_0x42a225));if(_0x42a225[_0xc9ed('0x17')]){if(_0x42a225['error'][_0xc9ed('0x18')]===0x1f4){logger[_0xc9ed('0x17')](_0xc9ed('0x19'),_0x39aa10,_0x42a225[_0xc9ed('0x17')][_0xc9ed('0x1a')]);return _0x5800f3(_0x42a225[_0xc9ed('0x17')]['message']);}logger[_0xc9ed('0x17')](_0xc9ed('0x19'),_0x39aa10,_0x42a225[_0xc9ed('0x17')][_0xc9ed('0x1a')]);return _0x2369f0(_0x42a225[_0xc9ed('0x17')][_0xc9ed('0x1a')]);}else{logger['info'](_0xc9ed('0x19'),_0x39aa10,_0xc9ed('0x15'));_0x2369f0(_0x42a225[_0xc9ed('0x1b')]['message']);}})['catch'](function(_0x38c15b){logger[_0xc9ed('0x17')](_0xc9ed('0x19'),_0x39aa10,_0x38c15b);_0x5800f3(_0x38c15b);});});}exports['GetWhatsappQueue']=function(_0x28620f){var _0x5eacb0=this;return new Promise(function(_0x5ed13b,_0x4bb55b){return db[_0xc9ed('0x1c')][_0xc9ed('0x1d')]({'raw':_0x28620f[_0xc9ed('0x1e')]?_0x28620f['options']['raw']===undefined?!![]:![]:!![],'where':_0x28620f['options']?_0x28620f[_0xc9ed('0x1e')][_0xc9ed('0x1f')]||null:null,'attributes':_0x28620f[_0xc9ed('0x1e')]?_0x28620f[_0xc9ed('0x1e')][_0xc9ed('0x20')]||null:null,'limit':_0x28620f['options']?_0x28620f[_0xc9ed('0x1e')][_0xc9ed('0x21')]||null:null,'include':_0x28620f[_0xc9ed('0x1e')]?_0x28620f[_0xc9ed('0x1e')][_0xc9ed('0x22')]?_[_0xc9ed('0x23')](_0x28620f[_0xc9ed('0x1e')][_0xc9ed('0x22')],function(_0x1e4060){return{'model':db[_0x1e4060[_0xc9ed('0x24')]],'as':_0x1e4060['as'],'attributes':_0x1e4060[_0xc9ed('0x20')],'include':_0x1e4060[_0xc9ed('0x22')]?_[_0xc9ed('0x23')](_0x1e4060[_0xc9ed('0x22')],function(_0x39288e){return{'model':db[_0x39288e[_0xc9ed('0x24')]],'as':_0x39288e['as'],'attributes':_0x39288e[_0xc9ed('0x20')],'include':_0x39288e[_0xc9ed('0x22')]?_[_0xc9ed('0x23')](_0x39288e[_0xc9ed('0x22')],function(_0xfad844){return{'model':db[_0xfad844[_0xc9ed('0x24')]],'as':_0xfad844['as'],'attributes':_0xfad844[_0xc9ed('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc9ed('0x12')](function(_0x77d4e4){logger[_0xc9ed('0x25')](_0xc9ed('0x26'),_0x28620f);logger[_0xc9ed('0x13')](_0xc9ed('0x26'),_0x28620f,JSON[_0xc9ed('0x16')](_0x77d4e4));_0x5ed13b(_0x77d4e4);})[_0xc9ed('0x27')](function(_0x16c215){logger['error'](_0xc9ed('0x26'),_0x16c215[_0xc9ed('0x1a')],_0x28620f);_0x4bb55b(_0x5eacb0[_0xc9ed('0x17')](0x1f4,_0x16c215[_0xc9ed('0x1a')]));});});};exports[_0xc9ed('0x28')]=function(_0x428c20){var _0x1f6998=this;return new Promise(function(_0x4afbee,_0x508a48){return db['WhatsappQueue'][_0xc9ed('0x29')]({'raw':_0x428c20[_0xc9ed('0x1e')]?_0x428c20[_0xc9ed('0x1e')][_0xc9ed('0x2a')]===undefined?!![]:![]:!![],'where':_0x428c20[_0xc9ed('0x1e')]?_0x428c20[_0xc9ed('0x1e')][_0xc9ed('0x1f')]||null:null,'attributes':_0x428c20[_0xc9ed('0x1e')]?_0x428c20[_0xc9ed('0x1e')]['attributes']||null:null,'include':_0x428c20[_0xc9ed('0x1e')]?_0x428c20[_0xc9ed('0x1e')][_0xc9ed('0x22')]?_[_0xc9ed('0x23')](_0x428c20[_0xc9ed('0x1e')]['include'],function(_0x5210ca){return{'model':db[_0x5210ca[_0xc9ed('0x24')]],'as':_0x5210ca['as'],'attributes':_0x5210ca[_0xc9ed('0x20')],'include':_0x5210ca[_0xc9ed('0x22')]?_['map'](_0x5210ca[_0xc9ed('0x22')],function(_0x6b6565){return{'model':db[_0x6b6565[_0xc9ed('0x24')]],'as':_0x6b6565['as'],'attributes':_0x6b6565['attributes'],'include':_0x6b6565[_0xc9ed('0x22')]?_[_0xc9ed('0x23')](_0x6b6565[_0xc9ed('0x22')],function(_0x3609e0){return{'model':db[_0x3609e0[_0xc9ed('0x24')]],'as':_0x3609e0['as'],'attributes':_0x3609e0[_0xc9ed('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5be582){logger[_0xc9ed('0x25')](_0xc9ed('0x28'),_0x428c20);logger[_0xc9ed('0x13')](_0xc9ed('0x28'),_0x428c20,JSON['stringify'](_0x5be582));_0x4afbee(_0x5be582);})[_0xc9ed('0x27')](function(_0x37bc8d){logger[_0xc9ed('0x17')](_0xc9ed('0x28'),_0x37bc8d[_0xc9ed('0x1a')],_0x428c20);_0x508a48(_0x1f6998[_0xc9ed('0x17')](0x1f4,_0x37bc8d['message']));});});};
\ No newline at end of file
+var _0x72b0=['socket.io-emitter','./whatsappQueue.socket','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowWhatsappQueue','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x244f6c,_0x20f81b){var _0x5bdfb3=function(_0x2997a9){while(--_0x2997a9){_0x244f6c['push'](_0x244f6c['shift']());}};_0x5bdfb3(++_0x20f81b);}(_0x72b0,0x135));var _0x072b=function(_0x4a807c,_0x475779){_0x4a807c=_0x4a807c-0x0;var _0x5284ba=_0x72b0[_0x4a807c];return _0x5284ba;};'use strict';var _=require(_0x072b('0x0'));var util=require(_0x072b('0x1'));var moment=require('moment');var BPromise=require(_0x072b('0x2'));var rs=require(_0x072b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x072b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x072b('0x5'));var config=require(_0x072b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x072b('0x7')][_0x072b('0x8')]({'port':0x232a});config[_0x072b('0x9')]=_[_0x072b('0xa')](config[_0x072b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x072b('0xb'))(new Redis(config[_0x072b('0x9')]));require(_0x072b('0xc'))[_0x072b('0xd')](socket);function respondWithRpcPromise(_0x33feb7,_0x45503b,_0x5c7233){return new BPromise(function(_0x27cd5b,_0x4a1c48){return client[_0x072b('0xe')](_0x33feb7,_0x5c7233)[_0x072b('0xf')](function(_0x483874){logger[_0x072b('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x45503b,_0x072b('0x11'));logger[_0x072b('0x12')](_0x072b('0x13'),_0x45503b,_0x072b('0x11'),JSON[_0x072b('0x14')](_0x483874));if(_0x483874[_0x072b('0x15')]){if(_0x483874[_0x072b('0x15')][_0x072b('0x16')]===0x1f4){logger[_0x072b('0x15')](_0x072b('0x17'),_0x45503b,_0x483874['error'][_0x072b('0x18')]);return _0x4a1c48(_0x483874['error'][_0x072b('0x18')]);}logger['error'](_0x072b('0x17'),_0x45503b,_0x483874[_0x072b('0x15')][_0x072b('0x18')]);return _0x27cd5b(_0x483874[_0x072b('0x15')][_0x072b('0x18')]);}else{logger[_0x072b('0x10')](_0x072b('0x17'),_0x45503b,_0x072b('0x11'));_0x27cd5b(_0x483874[_0x072b('0x19')][_0x072b('0x18')]);}})[_0x072b('0x1a')](function(_0x22adbb){logger[_0x072b('0x15')](_0x072b('0x17'),_0x45503b,_0x22adbb);_0x4a1c48(_0x22adbb);});});}exports[_0x072b('0x1b')]=function(_0x5ec50e){var _0x1bf00c=this;return new Promise(function(_0x5d0a8f,_0xa7708c){return db[_0x072b('0x1c')][_0x072b('0x1d')]({'raw':_0x5ec50e[_0x072b('0x1e')]?_0x5ec50e[_0x072b('0x1e')][_0x072b('0x1f')]===undefined?!![]:![]:!![],'where':_0x5ec50e['options']?_0x5ec50e[_0x072b('0x1e')][_0x072b('0x20')]||null:null,'attributes':_0x5ec50e[_0x072b('0x1e')]?_0x5ec50e[_0x072b('0x1e')][_0x072b('0x21')]||null:null,'limit':_0x5ec50e[_0x072b('0x1e')]?_0x5ec50e['options'][_0x072b('0x22')]||null:null,'include':_0x5ec50e[_0x072b('0x1e')]?_0x5ec50e[_0x072b('0x1e')][_0x072b('0x23')]?_[_0x072b('0x24')](_0x5ec50e[_0x072b('0x1e')][_0x072b('0x23')],function(_0x3bf776){return{'model':db[_0x3bf776[_0x072b('0x25')]],'as':_0x3bf776['as'],'attributes':_0x3bf776[_0x072b('0x21')],'include':_0x3bf776[_0x072b('0x23')]?_[_0x072b('0x24')](_0x3bf776['include'],function(_0xe6b38){return{'model':db[_0xe6b38[_0x072b('0x25')]],'as':_0xe6b38['as'],'attributes':_0xe6b38['attributes'],'include':_0xe6b38['include']?_[_0x072b('0x24')](_0xe6b38['include'],function(_0x4d7c66){return{'model':db[_0x4d7c66[_0x072b('0x25')]],'as':_0x4d7c66['as'],'attributes':_0x4d7c66[_0x072b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x072b('0xf')](function(_0xf2d58){logger['info'](_0x072b('0x1b'),_0x5ec50e);logger['debug'](_0x072b('0x1b'),_0x5ec50e,JSON[_0x072b('0x14')](_0xf2d58));_0x5d0a8f(_0xf2d58);})[_0x072b('0x1a')](function(_0x283754){logger['error']('GetWhatsappQueue',_0x283754[_0x072b('0x18')],_0x5ec50e);_0xa7708c(_0x1bf00c['error'](0x1f4,_0x283754[_0x072b('0x18')]));});});};exports['ShowWhatsappQueue']=function(_0x5bb629){var _0x40cbfd=this;return new Promise(function(_0x25b420,_0x30d57e){return db[_0x072b('0x1c')][_0x072b('0x26')]({'raw':_0x5bb629[_0x072b('0x1e')]?_0x5bb629['options'][_0x072b('0x1f')]===undefined?!![]:![]:!![],'where':_0x5bb629['options']?_0x5bb629[_0x072b('0x1e')][_0x072b('0x20')]||null:null,'attributes':_0x5bb629[_0x072b('0x1e')]?_0x5bb629[_0x072b('0x1e')][_0x072b('0x21')]||null:null,'include':_0x5bb629[_0x072b('0x1e')]?_0x5bb629[_0x072b('0x1e')][_0x072b('0x23')]?_[_0x072b('0x24')](_0x5bb629[_0x072b('0x1e')]['include'],function(_0x283b94){return{'model':db[_0x283b94['model']],'as':_0x283b94['as'],'attributes':_0x283b94[_0x072b('0x21')],'include':_0x283b94[_0x072b('0x23')]?_[_0x072b('0x24')](_0x283b94[_0x072b('0x23')],function(_0x30348f){return{'model':db[_0x30348f['model']],'as':_0x30348f['as'],'attributes':_0x30348f[_0x072b('0x21')],'include':_0x30348f[_0x072b('0x23')]?_[_0x072b('0x24')](_0x30348f[_0x072b('0x23')],function(_0x596da6){return{'model':db[_0x596da6[_0x072b('0x25')]],'as':_0x596da6['as'],'attributes':_0x596da6[_0x072b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2afba6){logger[_0x072b('0x10')](_0x072b('0x27'),_0x5bb629);logger[_0x072b('0x12')]('ShowWhatsappQueue',_0x5bb629,JSON['stringify'](_0x2afba6));_0x25b420(_0x2afba6);})[_0x072b('0x1a')](function(_0xc91b79){logger[_0x072b('0x15')](_0x072b('0x27'),_0xc91b79[_0x072b('0x18')],_0x5bb629);_0x30d57e(_0x40cbfd[_0x072b('0x15')](0x1f4,_0xc91b79[_0x072b('0x18')]));});});};
\ No newline at end of file
index bcc7cc8..80238d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac3d=['removeListener','whatsappQueue:','./whatsappQueue.events','save','update','emit'];(function(_0x55dbd0,_0x5c6216){var _0x293891=function(_0x29fe42){while(--_0x29fe42){_0x55dbd0['push'](_0x55dbd0['shift']());}};_0x293891(++_0x5c6216);}(_0xac3d,0x92));var _0xdac3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac3d[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappQueueEvents=require(_0xdac3('0x0'));var events=[_0xdac3('0x1'),'remove',_0xdac3('0x2')];function createListener(_0x13a3c5,_0x42e49f){return function(_0x16a51e){_0x42e49f[_0xdac3('0x3')](_0x13a3c5,_0x16a51e);};}function removeListener(_0x3ba5ab,_0x8dbbda){return function(){WhatsappQueueEvents[_0xdac3('0x4')](_0x3ba5ab,_0x8dbbda);};}exports['register']=function(_0x29b537){for(var _0x56cda3=0x0,_0x1731f3=events['length'];_0x56cda3<_0x1731f3;_0x56cda3++){var _0x1218be=events[_0x56cda3];var _0xafc0f8=createListener(_0xdac3('0x5')+_0x1218be,_0x29b537);WhatsappQueueEvents['on'](_0x1218be,_0xafc0f8);}};
\ No newline at end of file
+var _0x2dac=['removeListener','register','length','save','remove','update','emit'];(function(_0x7dd57,_0x265605){var _0x544e10=function(_0x39274c){while(--_0x39274c){_0x7dd57['push'](_0x7dd57['shift']());}};_0x544e10(++_0x265605);}(_0x2dac,0x14c));var _0xc2da=function(_0x483965,_0x140c6d){_0x483965=_0x483965-0x0;var _0x24c2c3=_0x2dac[_0x483965];return _0x24c2c3;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xc2da('0x0'),_0xc2da('0x1'),_0xc2da('0x2')];function createListener(_0x2e68a2,_0x1236f3){return function(_0x3a77e5){_0x1236f3[_0xc2da('0x3')](_0x2e68a2,_0x3a77e5);};}function removeListener(_0x576fcc,_0x16164d){return function(){WhatsappQueueEvents[_0xc2da('0x4')](_0x576fcc,_0x16164d);};}exports[_0xc2da('0x5')]=function(_0x23998c){for(var _0x59c95f=0x0,_0x3f7f0f=events[_0xc2da('0x6')];_0x59c95f<_0x3f7f0f;_0x59c95f++){var _0xd7b830=events[_0x59c95f];var _0x5c55d1=createListener('whatsappQueue:'+_0xd7b830,_0x23998c);WhatsappQueueEvents['on'](_0xd7b830,_0x5c55d1);}};
\ No newline at end of file
index 954c753..96409a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe135=['connect-timeout','express','../../components/auth/service','get','isAuthenticated','index','describe','/:id','show','post','create','update','delete','destroy','exports','util','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe135,0x1a7));var _0x5e13=function(_0x5162ed,_0x386cb7){_0x5162ed=_0x5162ed-0x0;var _0x4c579b=_0xe135[_0x5162ed];return _0x4c579b;};'use strict';var multer=require('multer');var util=require(_0x5e13('0x0'));var path=require(_0x5e13('0x1'));var timeout=require(_0x5e13('0x2'));var express=require(_0x5e13('0x3'));var router=express['Router']();var auth=require(_0x5e13('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router[_0x5e13('0x5')]('/',auth[_0x5e13('0x6')](),controller[_0x5e13('0x7')]);router[_0x5e13('0x5')]('/describe',auth[_0x5e13('0x6')](),controller[_0x5e13('0x8')]);router[_0x5e13('0x5')](_0x5e13('0x9'),auth['isAuthenticated'](),controller[_0x5e13('0xa')]);router[_0x5e13('0xb')]('/',auth['isAuthenticated'](),controller[_0x5e13('0xc')]);router['put']('/:id',auth[_0x5e13('0x6')](),controller[_0x5e13('0xd')]);router[_0x5e13('0xe')](_0x5e13('0x9'),auth['isAuthenticated'](),controller[_0x5e13('0xf')]);module[_0x5e13('0x10')]=router;
\ No newline at end of file
+var _0x44e8=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','post','create','put','exports'];(function(_0x2afbb7,_0x81941d){var _0x4a258a=function(_0x1b78fa){while(--_0x1b78fa){_0x2afbb7['push'](_0x2afbb7['shift']());}};_0x4a258a(++_0x81941d);}(_0x44e8,0x10e));var _0x844e=function(_0x5f53e1,_0x5498d5){_0x5f53e1=_0x5f53e1-0x0;var _0xa5727e=_0x44e8[_0x5f53e1];return _0xa5727e;};'use strict';var multer=require(_0x844e('0x0'));var util=require('util');var path=require(_0x844e('0x1'));var timeout=require('connect-timeout');var express=require(_0x844e('0x2'));var router=express[_0x844e('0x3')]();var auth=require(_0x844e('0x4'));var interaction=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0x844e('0x7')](),controller['index']);router[_0x844e('0x8')](_0x844e('0x9'),auth[_0x844e('0x7')](),controller[_0x844e('0xa')]);router['get']('/:id',auth[_0x844e('0x7')](),controller['show']);router[_0x844e('0xb')]('/',auth[_0x844e('0x7')](),controller[_0x844e('0xc')]);router[_0x844e('0xd')]('/:id',auth[_0x844e('0x7')](),controller['update']);router['delete']('/:id',auth[_0x844e('0x7')](),controller['destroy']);module[_0x844e('0xe')]=router;
\ No newline at end of file
index 7549e17..a7d12b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['DATE','STRING','sequelize','exports'];(function(_0x224521,_0x389675){var _0x22ff46=function(_0x19277c){while(--_0x19277c){_0x224521['push'](_0x224521['shift']());}};_0x22ff46(++_0x389675);}(_0x55ca,0x126));var _0xa55c=function(_0x166146,_0x1f34c6){_0x166146=_0x166146-0x0;var _0x9c7390=_0x55ca[_0x166146];return _0x9c7390;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa55c('0x2')]},'acceptAt':{'type':Sequelize[_0xa55c('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa55c('0x3')]}};
\ No newline at end of file
+var _0x7217=['sequelize','STRING','DATE'];(function(_0x14496b,_0x35d4bd){var _0x40d862=function(_0x41d087){while(--_0x41d087){_0x14496b['push'](_0x14496b['shift']());}};_0x40d862(++_0x35d4bd);}(_0x7217,0x19e));var _0x7721=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x7217[_0x5c3c0b];return _0x52ecd2;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7721('0x1')]},'joinAt':{'type':Sequelize[_0x7721('0x2')]},'leaveAt':{'type':Sequelize[_0x7721('0x2')]},'acceptAt':{'type':Sequelize[_0x7721('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 179904d..5596830 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f48=['attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','show','params','WhatsappQueueReport','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0x3f48,0x17c));var _0x83f4=function(_0x214f60,_0x47cf14){_0x214f60=_0x214f60-0x0;var _0x495b37=_0x3f48[_0x214f60];return _0x495b37;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x83f4('0x0'));var zipdir=require(_0x83f4('0x1'));var jsonpatch=require(_0x83f4('0x2'));var rp=require(_0x83f4('0x3'));var moment=require('moment');var BPromise=require(_0x83f4('0x4'));var Mustache=require(_0x83f4('0x5'));var util=require('util');var path=require(_0x83f4('0x6'));var sox=require('sox');var csv=require(_0x83f4('0x7'));var ejs=require(_0x83f4('0x8'));var fs=require('fs');var _=require(_0x83f4('0x9'));var squel=require(_0x83f4('0xa'));var crypto=require(_0x83f4('0xb'));var jsforce=require(_0x83f4('0xc'));var deskjs=require(_0x83f4('0xd'));var toCsv=require(_0x83f4('0x7'));var querystring=require('querystring');var Papa=require(_0x83f4('0xe'));var Redis=require(_0x83f4('0xf'));var authService=require(_0x83f4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x83f4('0x11'))(_0x83f4('0x12'));var utils=require(_0x83f4('0x13'));var config=require('../../config/environment');var db=require(_0x83f4('0x14'))['db'];function respondWithStatusCode(_0x54ec95,_0x51b5b6){_0x51b5b6=_0x51b5b6||0xcc;return function(_0x455e42){if(_0x455e42){return _0x54ec95[_0x83f4('0x15')](_0x51b5b6);}return _0x54ec95[_0x83f4('0x16')](_0x51b5b6)[_0x83f4('0x17')]();};}function respondWithResult(_0xdcfc5e,_0x3aee93){_0x3aee93=_0x3aee93||0xc8;return function(_0xcdaf6c){if(_0xcdaf6c){return _0xdcfc5e['status'](_0x3aee93)[_0x83f4('0x18')](_0xcdaf6c);}};}function respondWithFilteredResult(_0x18c56d,_0x204164){return function(_0x8062f){if(_0x8062f){var _0x38f762=_0x8062f[_0x83f4('0x19')],_0x11dc6d=_0x204164[_0x83f4('0x1a')],_0x4f0f62=_0x204164[_0x83f4('0x1a')]+_0x204164[_0x83f4('0x1b')],_0x1b5626;if(_0x4f0f62>=_0x38f762){_0x4f0f62=_0x38f762;_0x1b5626=0xc8;}else{_0x1b5626=0xce;}_0x18c56d['status'](_0x1b5626);return _0x18c56d[_0x83f4('0x1c')]('Content-Range',_0x11dc6d+'-'+_0x4f0f62+'/'+_0x38f762)[_0x83f4('0x18')](_0x8062f);}return null;};}function patchUpdates(_0x3b08d8){return function(_0x411b03){try{jsonpatch[_0x83f4('0x1d')](_0x411b03,_0x3b08d8,!![]);}catch(_0x30ac1d){return BPromise[_0x83f4('0x1e')](_0x30ac1d);}return _0x411b03['save']();};}function saveUpdates(_0x79c248,_0x14575b){return function(_0x2fa788){if(_0x2fa788){return _0x2fa788[_0x83f4('0x1f')](_0x79c248)['then'](function(_0x596ec8){return _0x596ec8;});}return null;};}function removeEntity(_0x2522da,_0x32e3b0){return function(_0x23b228){if(_0x23b228){return _0x23b228[_0x83f4('0x20')]()['then'](function(){_0x2522da[_0x83f4('0x16')](0xcc)[_0x83f4('0x17')]();});}};}function handleEntityNotFound(_0x4115da,_0x10c3b8){return function(_0x5e4f28){if(!_0x5e4f28){_0x4115da[_0x83f4('0x15')](0x194);}return _0x5e4f28;};}function handleError(_0x570ec3,_0x386530){_0x386530=_0x386530||0x1f4;return function(_0x201b2f){logger[_0x83f4('0x21')](_0x201b2f[_0x83f4('0x22')]);if(_0x201b2f[_0x83f4('0x23')]){delete _0x201b2f[_0x83f4('0x23')];}_0x570ec3[_0x83f4('0x16')](_0x386530)[_0x83f4('0x24')](_0x201b2f);};}exports[_0x83f4('0x25')]=function(_0x22ff3f,_0x3ab54d){var _0x4fa94f={},_0x2530be={},_0x4eeab6={'count':0x0,'rows':[]};var _0x5d260d=_[_0x83f4('0x26')](db['WhatsappQueueReport'][_0x83f4('0x27')],function(_0xbc819e){return{'name':_0xbc819e[_0x83f4('0x28')],'type':_0xbc819e['type']['key']};});_0x2530be['model']=_[_0x83f4('0x26')](_0x5d260d,_0x83f4('0x23'));_0x2530be[_0x83f4('0x29')]=_[_0x83f4('0x2a')](_0x22ff3f['query']);_0x2530be[_0x83f4('0x2b')]=_[_0x83f4('0x2c')](_0x2530be[_0x83f4('0x2d')],_0x2530be[_0x83f4('0x29')]);_0x4fa94f[_0x83f4('0x2e')]=_[_0x83f4('0x2c')](_0x2530be[_0x83f4('0x2d')],qs[_0x83f4('0x2f')](_0x22ff3f['query'][_0x83f4('0x2f')]));_0x4fa94f['attributes']=_0x4fa94f[_0x83f4('0x2e')]['length']?_0x4fa94f[_0x83f4('0x2e')]:_0x2530be['model'];if(!_0x22ff3f[_0x83f4('0x29')][_0x83f4('0x30')]('nolimit')){_0x4fa94f[_0x83f4('0x1b')]=qs['limit'](_0x22ff3f[_0x83f4('0x29')]['limit']);_0x4fa94f[_0x83f4('0x1a')]=qs['offset'](_0x22ff3f[_0x83f4('0x29')][_0x83f4('0x1a')]);}_0x4fa94f[_0x83f4('0x31')]=qs[_0x83f4('0x32')](_0x22ff3f[_0x83f4('0x29')][_0x83f4('0x32')]);_0x4fa94f['where']=qs[_0x83f4('0x2b')](_[_0x83f4('0x33')](_0x22ff3f[_0x83f4('0x29')],_0x2530be[_0x83f4('0x2b')]),_0x5d260d);if(_0x22ff3f[_0x83f4('0x29')][_0x83f4('0x34')]){_0x4fa94f[_0x83f4('0x35')]=_[_0x83f4('0x36')](_0x4fa94f[_0x83f4('0x35')],{'$or':_[_0x83f4('0x26')](_0x5d260d,function(_0x2bd764){if(_0x2bd764[_0x83f4('0x37')]!==_0x83f4('0x38')){var _0x6370fa={};_0x6370fa[_0x2bd764[_0x83f4('0x23')]]={'$like':'%'+_0x22ff3f[_0x83f4('0x29')][_0x83f4('0x34')]+'%'};return _0x6370fa;}})});}_0x4fa94f=_[_0x83f4('0x36')]({},_0x4fa94f,_0x22ff3f[_0x83f4('0x39')]);var _0x437853={'where':_0x4fa94f[_0x83f4('0x35')]};return db['WhatsappQueueReport'][_0x83f4('0x19')](_0x437853)['then'](function(_0x583edd){_0x4eeab6[_0x83f4('0x19')]=_0x583edd;if(_0x22ff3f[_0x83f4('0x29')][_0x83f4('0x3a')]){_0x4fa94f[_0x83f4('0x3b')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x83f4('0x3c')](_0x4fa94f);})[_0x83f4('0x3d')](function(_0x357112){_0x4eeab6[_0x83f4('0x3e')]=_0x357112;return _0x4eeab6;})['then'](respondWithFilteredResult(_0x3ab54d,_0x4fa94f))[_0x83f4('0x3f')](handleError(_0x3ab54d,null));};exports[_0x83f4('0x40')]=function(_0x116f62,_0x1f9e8c){var _0x224ec8={'raw':!![],'where':{'id':_0x116f62[_0x83f4('0x41')]['id']}},_0x2ebe5b={};_0x2ebe5b[_0x83f4('0x2d')]=_['keys'](db[_0x83f4('0x42')][_0x83f4('0x27')]);_0x2ebe5b['query']=_['keys'](_0x116f62[_0x83f4('0x29')]);_0x2ebe5b[_0x83f4('0x2b')]=_[_0x83f4('0x2c')](_0x2ebe5b[_0x83f4('0x2d')],_0x2ebe5b[_0x83f4('0x29')]);_0x224ec8[_0x83f4('0x2e')]=_[_0x83f4('0x2c')](_0x2ebe5b[_0x83f4('0x2d')],qs['fields'](_0x116f62[_0x83f4('0x29')]['fields']));_0x224ec8[_0x83f4('0x2e')]=_0x224ec8[_0x83f4('0x2e')][_0x83f4('0x43')]?_0x224ec8[_0x83f4('0x2e')]:_0x2ebe5b[_0x83f4('0x2d')];if(_0x116f62['query']['includeAll']){_0x224ec8[_0x83f4('0x3b')]=[{'all':!![]}];}_0x224ec8=_[_0x83f4('0x36')]({},_0x224ec8,_0x116f62[_0x83f4('0x39')]);return db[_0x83f4('0x42')][_0x83f4('0x44')](_0x224ec8)['then'](handleEntityNotFound(_0x1f9e8c,null))[_0x83f4('0x3d')](respondWithResult(_0x1f9e8c,null))[_0x83f4('0x3f')](handleError(_0x1f9e8c,null));};exports[_0x83f4('0x45')]=function(_0x2668b7,_0xe90704){return db['WhatsappQueueReport'][_0x83f4('0x45')](_0x2668b7[_0x83f4('0x46')],{})[_0x83f4('0x3d')](respondWithResult(_0xe90704,0xc9))['catch'](handleError(_0xe90704,null));};exports[_0x83f4('0x1f')]=function(_0x515ad7,_0x5014f1){if(_0x515ad7['body']['id']){delete _0x515ad7[_0x83f4('0x46')]['id'];}return db[_0x83f4('0x42')][_0x83f4('0x44')]({'where':{'id':_0x515ad7[_0x83f4('0x41')]['id']}})[_0x83f4('0x3d')](handleEntityNotFound(_0x5014f1,null))[_0x83f4('0x3d')](saveUpdates(_0x515ad7[_0x83f4('0x46')],null))[_0x83f4('0x3d')](respondWithResult(_0x5014f1,null))[_0x83f4('0x3f')](handleError(_0x5014f1,null));};exports[_0x83f4('0x20')]=function(_0x2a2e77,_0x4ec4a7){return db['WhatsappQueueReport']['find']({'where':{'id':_0x2a2e77[_0x83f4('0x41')]['id']}})[_0x83f4('0x3d')](handleEntityNotFound(_0x4ec4a7,null))[_0x83f4('0x3d')](removeEntity(_0x4ec4a7,null))[_0x83f4('0x3f')](handleError(_0x4ec4a7,null));};exports['describe']=function(_0x3d5d61,_0x459c26){return db['WhatsappQueueReport']['describe']()[_0x83f4('0x3d')](respondWithResult(_0x459c26,null))[_0x83f4('0x3f')](handleError(_0x459c26,null));};
\ No newline at end of file
+var _0xd0f5=['body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','limit','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','name','send','index','WhatsappQueueReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','merge','find','create'];(function(_0x155fcf,_0x2e41b0){var _0x2cdfa4=function(_0x166dcd){while(--_0x166dcd){_0x155fcf['push'](_0x155fcf['shift']());}};_0x2cdfa4(++_0x2e41b0);}(_0xd0f5,0xda));var _0x5d0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0f5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x5d0f('0x0'));var emlformat=require(_0x5d0f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5d0f('0x2'));var jsonpatch=require(_0x5d0f('0x3'));var rp=require(_0x5d0f('0x4'));var moment=require(_0x5d0f('0x5'));var BPromise=require(_0x5d0f('0x6'));var Mustache=require(_0x5d0f('0x7'));var util=require(_0x5d0f('0x8'));var path=require(_0x5d0f('0x9'));var sox=require('sox');var csv=require(_0x5d0f('0xa'));var ejs=require(_0x5d0f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5d0f('0xc'));var crypto=require(_0x5d0f('0xd'));var jsforce=require(_0x5d0f('0xe'));var deskjs=require(_0x5d0f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5d0f('0x10'));var Papa=require(_0x5d0f('0x11'));var Redis=require(_0x5d0f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5d0f('0x13'));var as=require(_0x5d0f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d0f('0x15'))(_0x5d0f('0x16'));var utils=require('../../config/utils');var config=require(_0x5d0f('0x17'));var db=require(_0x5d0f('0x18'))['db'];function respondWithStatusCode(_0x2a1efd,_0x434684){_0x434684=_0x434684||0xcc;return function(_0x4e59fa){if(_0x4e59fa){return _0x2a1efd['sendStatus'](_0x434684);}return _0x2a1efd[_0x5d0f('0x19')](_0x434684)['end']();};}function respondWithResult(_0x3e5f38,_0x39dca4){_0x39dca4=_0x39dca4||0xc8;return function(_0x229ff7){if(_0x229ff7){return _0x3e5f38[_0x5d0f('0x19')](_0x39dca4)[_0x5d0f('0x1a')](_0x229ff7);}};}function respondWithFilteredResult(_0x3fda79,_0x91a3a){return function(_0x16821a){if(_0x16821a){var _0x2ba72a=_0x16821a['count'],_0x1d7fda=_0x91a3a[_0x5d0f('0x1b')],_0x100b97=_0x91a3a[_0x5d0f('0x1b')]+_0x91a3a[_0x5d0f('0x1c')],_0x5cb37a;if(_0x100b97>=_0x2ba72a){_0x100b97=_0x2ba72a;_0x5cb37a=0xc8;}else{_0x5cb37a=0xce;}_0x3fda79[_0x5d0f('0x19')](_0x5cb37a);return _0x3fda79['set'](_0x5d0f('0x1d'),_0x1d7fda+'-'+_0x100b97+'/'+_0x2ba72a)[_0x5d0f('0x1a')](_0x16821a);}return null;};}function patchUpdates(_0x1c3976){return function(_0x44646b){try{jsonpatch[_0x5d0f('0x1e')](_0x44646b,_0x1c3976,!![]);}catch(_0x1fb791){return BPromise[_0x5d0f('0x1f')](_0x1fb791);}return _0x44646b[_0x5d0f('0x20')]();};}function saveUpdates(_0x4a8fdb,_0x1679e2){return function(_0x204e5e){if(_0x204e5e){return _0x204e5e[_0x5d0f('0x21')](_0x4a8fdb)[_0x5d0f('0x22')](function(_0x4550d9){return _0x4550d9;});}return null;};}function removeEntity(_0x44e38a,_0xc07658){return function(_0x2f65ab){if(_0x2f65ab){return _0x2f65ab['destroy']()['then'](function(){_0x44e38a[_0x5d0f('0x19')](0xcc)[_0x5d0f('0x23')]();});}};}function handleEntityNotFound(_0x5e0c01,_0x43fd14){return function(_0x2abe2){if(!_0x2abe2){_0x5e0c01[_0x5d0f('0x24')](0x194);}return _0x2abe2;};}function handleError(_0x5ceb62,_0x7304a){_0x7304a=_0x7304a||0x1f4;return function(_0x2d283c){logger['error'](_0x2d283c[_0x5d0f('0x25')]);if(_0x2d283c[_0x5d0f('0x26')]){delete _0x2d283c[_0x5d0f('0x26')];}_0x5ceb62[_0x5d0f('0x19')](_0x7304a)[_0x5d0f('0x27')](_0x2d283c);};}exports[_0x5d0f('0x28')]=function(_0x1ed738,_0x2a35eb){var _0x16fcf8={},_0x1facaf={},_0x107612={'count':0x0,'rows':[]};var _0x372a6f=_['map'](db[_0x5d0f('0x29')]['rawAttributes'],function(_0x2a2c0e){return{'name':_0x2a2c0e[_0x5d0f('0x2a')],'type':_0x2a2c0e['type'][_0x5d0f('0x2b')]};});_0x1facaf[_0x5d0f('0x2c')]=_[_0x5d0f('0x2d')](_0x372a6f,'name');_0x1facaf[_0x5d0f('0x2e')]=_[_0x5d0f('0x2f')](_0x1ed738['query']);_0x1facaf[_0x5d0f('0x30')]=_[_0x5d0f('0x31')](_0x1facaf[_0x5d0f('0x2c')],_0x1facaf[_0x5d0f('0x2e')]);_0x16fcf8[_0x5d0f('0x32')]=_['intersection'](_0x1facaf['model'],qs[_0x5d0f('0x33')](_0x1ed738[_0x5d0f('0x2e')][_0x5d0f('0x33')]));_0x16fcf8[_0x5d0f('0x32')]=_0x16fcf8[_0x5d0f('0x32')]['length']?_0x16fcf8['attributes']:_0x1facaf[_0x5d0f('0x2c')];if(!_0x1ed738[_0x5d0f('0x2e')][_0x5d0f('0x34')]('nolimit')){_0x16fcf8[_0x5d0f('0x1c')]=qs[_0x5d0f('0x1c')](_0x1ed738[_0x5d0f('0x2e')][_0x5d0f('0x1c')]);_0x16fcf8['offset']=qs[_0x5d0f('0x1b')](_0x1ed738[_0x5d0f('0x2e')][_0x5d0f('0x1b')]);}_0x16fcf8[_0x5d0f('0x35')]=qs[_0x5d0f('0x36')](_0x1ed738[_0x5d0f('0x2e')][_0x5d0f('0x36')]);_0x16fcf8[_0x5d0f('0x37')]=qs[_0x5d0f('0x30')](_[_0x5d0f('0x38')](_0x1ed738[_0x5d0f('0x2e')],_0x1facaf['filters']),_0x372a6f);if(_0x1ed738[_0x5d0f('0x2e')][_0x5d0f('0x39')]){_0x16fcf8[_0x5d0f('0x37')]=_['merge'](_0x16fcf8['where'],{'$or':_[_0x5d0f('0x2d')](_0x372a6f,function(_0x52555b){if(_0x52555b['type']!==_0x5d0f('0x3a')){var _0x1f1441={};_0x1f1441[_0x52555b['name']]={'$like':'%'+_0x1ed738[_0x5d0f('0x2e')][_0x5d0f('0x39')]+'%'};return _0x1f1441;}})});}_0x16fcf8=_['merge']({},_0x16fcf8,_0x1ed738[_0x5d0f('0x3b')]);var _0x2b5c15={'where':_0x16fcf8[_0x5d0f('0x37')]};return db[_0x5d0f('0x29')][_0x5d0f('0x3c')](_0x2b5c15)[_0x5d0f('0x22')](function(_0x4c064e){_0x107612[_0x5d0f('0x3c')]=_0x4c064e;if(_0x1ed738[_0x5d0f('0x2e')][_0x5d0f('0x3d')]){_0x16fcf8[_0x5d0f('0x3e')]=[{'all':!![]}];}return db[_0x5d0f('0x29')]['findAll'](_0x16fcf8);})[_0x5d0f('0x22')](function(_0x222cf3){_0x107612[_0x5d0f('0x3f')]=_0x222cf3;return _0x107612;})[_0x5d0f('0x22')](respondWithFilteredResult(_0x2a35eb,_0x16fcf8))[_0x5d0f('0x40')](handleError(_0x2a35eb,null));};exports[_0x5d0f('0x41')]=function(_0x533c77,_0x5aab82){var _0x332ee3={'raw':!![],'where':{'id':_0x533c77[_0x5d0f('0x42')]['id']}},_0x1ae9a5={};_0x1ae9a5[_0x5d0f('0x2c')]=_[_0x5d0f('0x2f')](db['WhatsappQueueReport']['rawAttributes']);_0x1ae9a5[_0x5d0f('0x2e')]=_['keys'](_0x533c77[_0x5d0f('0x2e')]);_0x1ae9a5[_0x5d0f('0x30')]=_[_0x5d0f('0x31')](_0x1ae9a5[_0x5d0f('0x2c')],_0x1ae9a5[_0x5d0f('0x2e')]);_0x332ee3['attributes']=_[_0x5d0f('0x31')](_0x1ae9a5[_0x5d0f('0x2c')],qs[_0x5d0f('0x33')](_0x533c77[_0x5d0f('0x2e')][_0x5d0f('0x33')]));_0x332ee3['attributes']=_0x332ee3[_0x5d0f('0x32')]['length']?_0x332ee3[_0x5d0f('0x32')]:_0x1ae9a5['model'];if(_0x533c77['query']['includeAll']){_0x332ee3[_0x5d0f('0x3e')]=[{'all':!![]}];}_0x332ee3=_[_0x5d0f('0x43')]({},_0x332ee3,_0x533c77[_0x5d0f('0x3b')]);return db['WhatsappQueueReport'][_0x5d0f('0x44')](_0x332ee3)[_0x5d0f('0x22')](handleEntityNotFound(_0x5aab82,null))[_0x5d0f('0x22')](respondWithResult(_0x5aab82,null))[_0x5d0f('0x40')](handleError(_0x5aab82,null));};exports[_0x5d0f('0x45')]=function(_0x599308,_0x4a5d61){return db['WhatsappQueueReport'][_0x5d0f('0x45')](_0x599308[_0x5d0f('0x46')],{})[_0x5d0f('0x22')](respondWithResult(_0x4a5d61,0xc9))['catch'](handleError(_0x4a5d61,null));};exports[_0x5d0f('0x21')]=function(_0x1c358f,_0x1a2de5){if(_0x1c358f[_0x5d0f('0x46')]['id']){delete _0x1c358f[_0x5d0f('0x46')]['id'];}return db[_0x5d0f('0x29')][_0x5d0f('0x44')]({'where':{'id':_0x1c358f[_0x5d0f('0x42')]['id']}})[_0x5d0f('0x22')](handleEntityNotFound(_0x1a2de5,null))[_0x5d0f('0x22')](saveUpdates(_0x1c358f[_0x5d0f('0x46')],null))['then'](respondWithResult(_0x1a2de5,null))['catch'](handleError(_0x1a2de5,null));};exports['destroy']=function(_0x376f6c,_0x5a4b66){return db[_0x5d0f('0x29')][_0x5d0f('0x44')]({'where':{'id':_0x376f6c['params']['id']}})[_0x5d0f('0x22')](handleEntityNotFound(_0x5a4b66,null))['then'](removeEntity(_0x5a4b66,null))[_0x5d0f('0x40')](handleError(_0x5a4b66,null));};exports[_0x5d0f('0x47')]=function(_0x41f9c2,_0x5e6cb7){return db[_0x5d0f('0x29')][_0x5d0f('0x47')]()[_0x5d0f('0x22')](respondWithResult(_0x5e6cb7,null))['catch'](handleError(_0x5e6cb7,null));};
\ No newline at end of file
index f571198..401f0df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cb6=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport'];(function(_0x21e97b,_0x65a77f){var _0x10ba44=function(_0x239ef2){while(--_0x239ef2){_0x21e97b['push'](_0x21e97b['shift']());}};_0x10ba44(++_0x65a77f);}(_0x6cb6,0x120));var _0x66cb=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x6cb6[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x66cb('0x0'));var util=require(_0x66cb('0x1'));var logger=require(_0x66cb('0x2'))('api');var moment=require(_0x66cb('0x3'));var BPromise=require(_0x66cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x66cb('0x5'));var rimraf=require(_0x66cb('0x6'));var config=require(_0x66cb('0x7'));var attributes=require(_0x66cb('0x8'));module[_0x66cb('0x9')]=function(_0x3cb408,_0x103ef8){return _0x3cb408['define'](_0x66cb('0xa'),attributes,{'tableName':_0x66cb('0xb'),'paranoid':![],'indexes':[{'name':_0x66cb('0xc'),'fields':[_0x66cb('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x47f2=['api','request-promise','path','rimraf','define','uniqueid','lodash','util'];(function(_0x2e96e5,_0xc15aab){var _0xce741d=function(_0x431e04){while(--_0x431e04){_0x2e96e5['push'](_0x2e96e5['shift']());}};_0xce741d(++_0xc15aab);}(_0x47f2,0xb6));var _0x247f=function(_0x59bc74,_0xfe861b){_0x59bc74=_0x59bc74-0x0;var _0xe44f33=_0x47f2[_0x59bc74];return _0xe44f33;};'use strict';var _=require(_0x247f('0x0'));var util=require(_0x247f('0x1'));var logger=require('../../config/logger')(_0x247f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x247f('0x3'));var fs=require('fs');var path=require(_0x247f('0x4'));var rimraf=require(_0x247f('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x2d4d31,_0x51e7b9){return _0x2d4d31[_0x247f('0x6')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x247f('0x7'),'fields':[_0x247f('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
index 7190441..7066f31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94c5=['message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','UpdateWhatsappQueueReport','where','limit','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5124e1,_0x47efc6){var _0x5e4a22=function(_0x2a4ba8){while(--_0x2a4ba8){_0x5124e1['push'](_0x5124e1['shift']());}};_0x5e4a22(++_0x47efc6);}(_0x94c5,0x1ad));var _0x594c=function(_0x61bb5e,_0x626cf7){_0x61bb5e=_0x61bb5e-0x0;var _0x4f4258=_0x94c5[_0x61bb5e];return _0x4f4258;};'use strict';var _=require(_0x594c('0x0'));var util=require('util');var moment=require(_0x594c('0x1'));var BPromise=require(_0x594c('0x2'));var rs=require(_0x594c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x594c('0x4'))['db'];var utils=require(_0x594c('0x5'));var logger=require(_0x594c('0x6'))('rpc');var config=require(_0x594c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x594c('0x8')][_0x594c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x291f59,_0x54b43f,_0x42db27){return new BPromise(function(_0x585199,_0x39efde){return client[_0x594c('0xa')](_0x291f59,_0x42db27)['then'](function(_0x1e5511){logger[_0x594c('0xb')](_0x594c('0xc'),_0x54b43f,_0x594c('0xd'));logger[_0x594c('0xe')](_0x594c('0xf'),_0x54b43f,_0x594c('0xd'),JSON[_0x594c('0x10')](_0x1e5511));if(_0x1e5511[_0x594c('0x11')]){if(_0x1e5511[_0x594c('0x11')][_0x594c('0x12')]===0x1f4){logger[_0x594c('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x54b43f,_0x1e5511[_0x594c('0x11')][_0x594c('0x13')]);return _0x39efde(_0x1e5511[_0x594c('0x11')][_0x594c('0x13')]);}logger[_0x594c('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x54b43f,_0x1e5511[_0x594c('0x11')][_0x594c('0x13')]);return _0x585199(_0x1e5511[_0x594c('0x11')]['message']);}else{logger[_0x594c('0xb')](_0x594c('0xc'),_0x54b43f,'request\x20sent');_0x585199(_0x1e5511[_0x594c('0x14')][_0x594c('0x13')]);}})['catch'](function(_0xb67288){logger[_0x594c('0x11')](_0x594c('0xc'),_0x54b43f,_0xb67288);_0x39efde(_0xb67288);});});}exports[_0x594c('0x15')]=function(_0x532765){var _0x24e497=this;return new Promise(function(_0x41e1b3,_0x56e1c7){return db[_0x594c('0x16')][_0x594c('0x17')](_0x532765[_0x594c('0x18')],{'raw':_0x532765[_0x594c('0x19')]?_0x532765[_0x594c('0x19')][_0x594c('0x1a')]===undefined?!![]:![]:!![]})[_0x594c('0x1b')](function(_0x3b1d07){logger[_0x594c('0xb')](_0x594c('0x15'),_0x532765);logger[_0x594c('0xe')](_0x594c('0x15'),_0x532765,JSON[_0x594c('0x10')](_0x3b1d07));_0x41e1b3(_0x3b1d07);})['catch'](function(_0x2d3d5d){logger[_0x594c('0x11')]('CreateWhatsappQueueReport',_0x2d3d5d[_0x594c('0x13')],_0x532765);_0x56e1c7(_0x24e497['error'](0x1f4,_0x2d3d5d[_0x594c('0x13')]));});});};exports[_0x594c('0x1c')]=function(_0x55b598){var _0x3ffb8b=this;return new Promise(function(_0x21c182,_0xb1ffcd){return db[_0x594c('0x16')]['update'](_0x55b598['body'],{'raw':_0x55b598[_0x594c('0x19')]?_0x55b598['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55b598[_0x594c('0x19')]?_0x55b598[_0x594c('0x19')][_0x594c('0x1d')]||null:null,'attributes':_0x55b598[_0x594c('0x19')]?_0x55b598[_0x594c('0x19')]['attributes']||null:null,'limit':_0x55b598['options']?_0x55b598[_0x594c('0x19')][_0x594c('0x1e')]||null:null})[_0x594c('0x1b')](function(_0x234ac9){logger[_0x594c('0xb')](_0x594c('0x1c'),_0x55b598);logger['debug'](_0x594c('0x1c'),_0x55b598,JSON[_0x594c('0x10')](_0x234ac9));_0x21c182(_0x234ac9);})[_0x594c('0x1f')](function(_0x32b6bb){logger['error'](_0x594c('0x1c'),_0x32b6bb[_0x594c('0x13')],_0x55b598);_0xb1ffcd(_0x3ffb8b['error'](0x1f4,_0x32b6bb[_0x594c('0x13')]));});});};
\ No newline at end of file
+var _0xad67=['request\x20sent','result','CreateWhatsappQueueReport','create','body','options','raw','catch','UpdateWhatsappQueueReport','update','where','attributes','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1c6b4b,_0x17ca80){var _0x1b16ae=function(_0x3f31f1){while(--_0x3f31f1){_0x1c6b4b['push'](_0x1c6b4b['shift']());}};_0x1b16ae(++_0x17ca80);}(_0xad67,0xd2));var _0x7ad6=function(_0x4f8886,_0x9be826){_0x4f8886=_0x4f8886-0x0;var _0x3c49e4=_0xad67[_0x4f8886];return _0x3c49e4;};'use strict';var _=require(_0x7ad6('0x0'));var util=require(_0x7ad6('0x1'));var moment=require(_0x7ad6('0x2'));var BPromise=require(_0x7ad6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ad6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ad6('0x5'));var logger=require('../../config/logger')(_0x7ad6('0x6'));var config=require(_0x7ad6('0x7'));var jayson=require(_0x7ad6('0x8'));var client=jayson[_0x7ad6('0x9')][_0x7ad6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x105889,_0x1c4ebb,_0x307fbd){return new BPromise(function(_0x285bd2,_0x180d7a){return client[_0x7ad6('0xb')](_0x105889,_0x307fbd)[_0x7ad6('0xc')](function(_0x1e8aec){logger[_0x7ad6('0xd')](_0x7ad6('0xe'),_0x1c4ebb,'request\x20sent');logger[_0x7ad6('0xf')](_0x7ad6('0x10'),_0x1c4ebb,'request\x20sent',JSON[_0x7ad6('0x11')](_0x1e8aec));if(_0x1e8aec[_0x7ad6('0x12')]){if(_0x1e8aec['error'][_0x7ad6('0x13')]===0x1f4){logger[_0x7ad6('0x12')](_0x7ad6('0xe'),_0x1c4ebb,_0x1e8aec[_0x7ad6('0x12')][_0x7ad6('0x14')]);return _0x180d7a(_0x1e8aec['error'][_0x7ad6('0x14')]);}logger[_0x7ad6('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1c4ebb,_0x1e8aec[_0x7ad6('0x12')][_0x7ad6('0x14')]);return _0x285bd2(_0x1e8aec[_0x7ad6('0x12')]['message']);}else{logger[_0x7ad6('0xd')](_0x7ad6('0xe'),_0x1c4ebb,_0x7ad6('0x15'));_0x285bd2(_0x1e8aec[_0x7ad6('0x16')]['message']);}})['catch'](function(_0x2c13ae){logger['error'](_0x7ad6('0xe'),_0x1c4ebb,_0x2c13ae);_0x180d7a(_0x2c13ae);});});}exports[_0x7ad6('0x17')]=function(_0x49e28a){var _0x5a375a=this;return new Promise(function(_0x9e5db1,_0x5dc4c8){return db['WhatsappQueueReport'][_0x7ad6('0x18')](_0x49e28a[_0x7ad6('0x19')],{'raw':_0x49e28a[_0x7ad6('0x1a')]?_0x49e28a[_0x7ad6('0x1a')][_0x7ad6('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1c336b){logger[_0x7ad6('0xd')](_0x7ad6('0x17'),_0x49e28a);logger[_0x7ad6('0xf')](_0x7ad6('0x17'),_0x49e28a,JSON[_0x7ad6('0x11')](_0x1c336b));_0x9e5db1(_0x1c336b);})[_0x7ad6('0x1c')](function(_0x3c7828){logger['error'](_0x7ad6('0x17'),_0x3c7828[_0x7ad6('0x14')],_0x49e28a);_0x5dc4c8(_0x5a375a[_0x7ad6('0x12')](0x1f4,_0x3c7828[_0x7ad6('0x14')]));});});};exports[_0x7ad6('0x1d')]=function(_0x5c0fc2){var _0xee1556=this;return new Promise(function(_0x10338f,_0x24de26){return db['WhatsappQueueReport'][_0x7ad6('0x1e')](_0x5c0fc2[_0x7ad6('0x19')],{'raw':_0x5c0fc2[_0x7ad6('0x1a')]?_0x5c0fc2[_0x7ad6('0x1a')][_0x7ad6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c0fc2[_0x7ad6('0x1a')]?_0x5c0fc2[_0x7ad6('0x1a')][_0x7ad6('0x1f')]||null:null,'attributes':_0x5c0fc2[_0x7ad6('0x1a')]?_0x5c0fc2['options'][_0x7ad6('0x20')]||null:null,'limit':_0x5c0fc2[_0x7ad6('0x1a')]?_0x5c0fc2[_0x7ad6('0x1a')]['limit']||null:null})['then'](function(_0x2dfc67){logger[_0x7ad6('0xd')]('UpdateWhatsappQueueReport',_0x5c0fc2);logger[_0x7ad6('0xf')](_0x7ad6('0x1d'),_0x5c0fc2,JSON[_0x7ad6('0x11')](_0x2dfc67));_0x10338f(_0x2dfc67);})['catch'](function(_0x53b6d4){logger[_0x7ad6('0x12')](_0x7ad6('0x1d'),_0x53b6d4['message'],_0x5c0fc2);_0x24de26(_0xee1556[_0x7ad6('0x12')](0x1f4,_0x53b6d4[_0x7ad6('0x14')]));});});};
\ No newline at end of file
index 536e879..af078ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46c1=['put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x46c1,0x7c));var _0x146c=function(_0x4054cb,_0x10c1b9){_0x4054cb=_0x4054cb-0x0;var _0xd384a6=_0x46c1[_0x4054cb];return _0xd384a6;};'use strict';var multer=require('multer');var util=require(_0x146c('0x0'));var path=require(_0x146c('0x1'));var timeout=require(_0x146c('0x2'));var express=require(_0x146c('0x3'));var router=express[_0x146c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x146c('0x5'));var config=require(_0x146c('0x6'));var controller=require(_0x146c('0x7'));router[_0x146c('0x8')]('/',auth[_0x146c('0x9')](),controller['index']);router['get'](_0x146c('0xa'),auth[_0x146c('0x9')](),controller[_0x146c('0xb')]);router['get'](_0x146c('0xc'),auth['isAuthenticated'](),controller[_0x146c('0xd')]);router[_0x146c('0xe')]('/',auth['isAuthenticated'](),controller[_0x146c('0xf')]);router[_0x146c('0x10')](_0x146c('0xc'),auth[_0x146c('0x9')](),controller['update']);router[_0x146c('0x11')]('/:id',auth[_0x146c('0x9')](),controller[_0x146c('0x12')]);module[_0x146c('0x13')]=router;
\ No newline at end of file
+var _0x221c=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','describe','show','create','put','update','delete','/:id','destroy','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x221c,0x17c));var _0xc221=function(_0x347a52,_0x40b38f){_0x347a52=_0x347a52-0x0;var _0xfb8a6e=_0x221c[_0x347a52];return _0xfb8a6e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc221('0x0'));var timeout=require(_0xc221('0x1'));var express=require(_0xc221('0x2'));var router=express[_0xc221('0x3')]();var auth=require(_0xc221('0x4'));var interaction=require(_0xc221('0x5'));var config=require(_0xc221('0x6'));var controller=require(_0xc221('0x7'));router[_0xc221('0x8')]('/',auth[_0xc221('0x9')](),controller[_0xc221('0xa')]);router[_0xc221('0x8')]('/describe',auth[_0xc221('0x9')](),controller[_0xc221('0xb')]);router['get']('/:id',auth[_0xc221('0x9')](),controller[_0xc221('0xc')]);router['post']('/',auth[_0xc221('0x9')](),controller[_0xc221('0xd')]);router[_0xc221('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xc221('0xf')]);router[_0xc221('0x10')](_0xc221('0x11'),auth['isAuthenticated'](),controller[_0xc221('0x12')]);module[_0xc221('0x13')]=router;
\ No newline at end of file
index c56ee1f..740d802 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['DATE','sequelize','STRING','account','agent','queue'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2f37e0,_0x393ef9){_0x2f37e0=_0x2f37e0-0x0;var _0x43ccce=_0x0b0e[_0x2f37e0];return _0x43ccce;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xe0b0('0x5')]}};
\ No newline at end of file
+var _0xb10b=['ENUM','account','queue','DATE','sequelize','STRING'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xb10b,0x12a));var _0xbb10=function(_0x24ccd7,_0x2eeca9){_0x24ccd7=_0x24ccd7-0x0;var _0x26aa79=_0xb10b[_0x24ccd7];return _0x26aa79;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbb10('0x2')](_0xbb10('0x3'),'agent',_0xbb10('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xbb10('0x5')]}};
\ No newline at end of file
index f77b0de..a628b86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a01=['fields','length','order','sort','where','pick','merge','VIRTUAL','filter','count','findAll','rows','show','includeAll','include','options','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection'];(function(_0x398fdb,_0x3ab81d){var _0x344d14=function(_0x1cb8cd){while(--_0x1cb8cd){_0x398fdb['push'](_0x398fdb['shift']());}};_0x344d14(++_0x3ab81d);}(_0x9a01,0x1d8));var _0x19a0=function(_0x1b4165,_0x443661){_0x1b4165=_0x1b4165-0x0;var _0x44c1b1=_0x9a01[_0x1b4165];return _0x44c1b1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x19a0('0x0'));var rimraf=require(_0x19a0('0x1'));var zipdir=require(_0x19a0('0x2'));var jsonpatch=require(_0x19a0('0x3'));var rp=require(_0x19a0('0x4'));var moment=require('moment');var BPromise=require(_0x19a0('0x5'));var Mustache=require(_0x19a0('0x6'));var util=require(_0x19a0('0x7'));var path=require(_0x19a0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x19a0('0x9'));var fs=require('fs');var _=require(_0x19a0('0xa'));var squel=require(_0x19a0('0xb'));var crypto=require(_0x19a0('0xc'));var jsforce=require(_0x19a0('0xd'));var deskjs=require(_0x19a0('0xe'));var toCsv=require(_0x19a0('0xf'));var querystring=require(_0x19a0('0x10'));var Papa=require(_0x19a0('0x11'));var Redis=require(_0x19a0('0x12'));var authService=require(_0x19a0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x19a0('0x14'));var hardwareService=require(_0x19a0('0x15'));var logger=require(_0x19a0('0x16'))(_0x19a0('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x19a0('0x18'))['db'];function respondWithStatusCode(_0x443a3c,_0xdbb0e0){_0xdbb0e0=_0xdbb0e0||0xcc;return function(_0x12254c){if(_0x12254c){return _0x443a3c[_0x19a0('0x19')](_0xdbb0e0);}return _0x443a3c[_0x19a0('0x1a')](_0xdbb0e0)[_0x19a0('0x1b')]();};}function respondWithResult(_0x5562e8,_0x1cee6a){_0x1cee6a=_0x1cee6a||0xc8;return function(_0x429c47){if(_0x429c47){return _0x5562e8[_0x19a0('0x1a')](_0x1cee6a)['json'](_0x429c47);}};}function respondWithFilteredResult(_0x195665,_0xb2c84c){return function(_0x2e8942){if(_0x2e8942){var _0xa2a430=_0x2e8942['count'],_0x5d2d8d=_0xb2c84c[_0x19a0('0x1c')],_0x46614f=_0xb2c84c[_0x19a0('0x1c')]+_0xb2c84c[_0x19a0('0x1d')],_0x2ef32a;if(_0x46614f>=_0xa2a430){_0x46614f=_0xa2a430;_0x2ef32a=0xc8;}else{_0x2ef32a=0xce;}_0x195665['status'](_0x2ef32a);return _0x195665[_0x19a0('0x1e')]('Content-Range',_0x5d2d8d+'-'+_0x46614f+'/'+_0xa2a430)[_0x19a0('0x1f')](_0x2e8942);}return null;};}function patchUpdates(_0x2d866f){return function(_0x4e462d){try{jsonpatch[_0x19a0('0x20')](_0x4e462d,_0x2d866f,!![]);}catch(_0x2174e4){return BPromise[_0x19a0('0x21')](_0x2174e4);}return _0x4e462d[_0x19a0('0x22')]();};}function saveUpdates(_0x306780,_0x5c6006){return function(_0x169bca){if(_0x169bca){return _0x169bca[_0x19a0('0x23')](_0x306780)[_0x19a0('0x24')](function(_0x4c73a4){return _0x4c73a4;});}return null;};}function removeEntity(_0x3d227e,_0x3c747a){return function(_0x3d9ee9){if(_0x3d9ee9){return _0x3d9ee9[_0x19a0('0x25')]()[_0x19a0('0x24')](function(){_0x3d227e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e1186,_0x430d57){return function(_0x5d13b8){if(!_0x5d13b8){_0x5e1186[_0x19a0('0x19')](0x194);}return _0x5d13b8;};}function handleError(_0x5420ff,_0x2a5391){_0x2a5391=_0x2a5391||0x1f4;return function(_0x2ae650){logger[_0x19a0('0x26')](_0x2ae650[_0x19a0('0x27')]);if(_0x2ae650[_0x19a0('0x28')]){delete _0x2ae650['name'];}_0x5420ff[_0x19a0('0x1a')](_0x2a5391)['send'](_0x2ae650);};}exports[_0x19a0('0x29')]=function(_0x357842,_0x56653d){var _0x3f984e={},_0x5f3217={},_0x448719={'count':0x0,'rows':[]};var _0x32adbc=_[_0x19a0('0x2a')](db[_0x19a0('0x2b')][_0x19a0('0x2c')],function(_0x233a94){return{'name':_0x233a94[_0x19a0('0x2d')],'type':_0x233a94[_0x19a0('0x2e')]['key']};});_0x5f3217[_0x19a0('0x2f')]=_[_0x19a0('0x2a')](_0x32adbc,_0x19a0('0x28'));_0x5f3217['query']=_[_0x19a0('0x30')](_0x357842[_0x19a0('0x31')]);_0x5f3217[_0x19a0('0x32')]=_['intersection'](_0x5f3217[_0x19a0('0x2f')],_0x5f3217[_0x19a0('0x31')]);_0x3f984e[_0x19a0('0x33')]=_[_0x19a0('0x34')](_0x5f3217[_0x19a0('0x2f')],qs['fields'](_0x357842[_0x19a0('0x31')][_0x19a0('0x35')]));_0x3f984e['attributes']=_0x3f984e[_0x19a0('0x33')][_0x19a0('0x36')]?_0x3f984e[_0x19a0('0x33')]:_0x5f3217[_0x19a0('0x2f')];if(!_0x357842[_0x19a0('0x31')]['hasOwnProperty']('nolimit')){_0x3f984e['limit']=qs[_0x19a0('0x1d')](_0x357842[_0x19a0('0x31')][_0x19a0('0x1d')]);_0x3f984e['offset']=qs[_0x19a0('0x1c')](_0x357842[_0x19a0('0x31')][_0x19a0('0x1c')]);}_0x3f984e[_0x19a0('0x37')]=qs[_0x19a0('0x38')](_0x357842['query'][_0x19a0('0x38')]);_0x3f984e[_0x19a0('0x39')]=qs[_0x19a0('0x32')](_[_0x19a0('0x3a')](_0x357842['query'],_0x5f3217[_0x19a0('0x32')]),_0x32adbc);if(_0x357842[_0x19a0('0x31')]['filter']){_0x3f984e['where']=_[_0x19a0('0x3b')](_0x3f984e['where'],{'$or':_[_0x19a0('0x2a')](_0x32adbc,function(_0x1a6ac1){if(_0x1a6ac1['type']!==_0x19a0('0x3c')){var _0x4a228b={};_0x4a228b[_0x1a6ac1[_0x19a0('0x28')]]={'$like':'%'+_0x357842[_0x19a0('0x31')][_0x19a0('0x3d')]+'%'};return _0x4a228b;}})});}_0x3f984e=_['merge']({},_0x3f984e,_0x357842['options']);var _0x435c34={'where':_0x3f984e['where']};return db[_0x19a0('0x2b')][_0x19a0('0x3e')](_0x435c34)['then'](function(_0x4282eb){_0x448719[_0x19a0('0x3e')]=_0x4282eb;if(_0x357842['query']['includeAll']){_0x3f984e['include']=[{'all':!![]}];}return db[_0x19a0('0x2b')][_0x19a0('0x3f')](_0x3f984e);})[_0x19a0('0x24')](function(_0x48c2ba){_0x448719[_0x19a0('0x40')]=_0x48c2ba;return _0x448719;})[_0x19a0('0x24')](respondWithFilteredResult(_0x56653d,_0x3f984e))['catch'](handleError(_0x56653d,null));};exports[_0x19a0('0x41')]=function(_0x401533,_0x5bf487){var _0x64a15={'raw':!![],'where':{'id':_0x401533['params']['id']}},_0xeb36cc={};_0xeb36cc['model']=_[_0x19a0('0x30')](db[_0x19a0('0x2b')][_0x19a0('0x2c')]);_0xeb36cc['query']=_[_0x19a0('0x30')](_0x401533[_0x19a0('0x31')]);_0xeb36cc['filters']=_[_0x19a0('0x34')](_0xeb36cc[_0x19a0('0x2f')],_0xeb36cc[_0x19a0('0x31')]);_0x64a15[_0x19a0('0x33')]=_[_0x19a0('0x34')](_0xeb36cc['model'],qs[_0x19a0('0x35')](_0x401533[_0x19a0('0x31')][_0x19a0('0x35')]));_0x64a15[_0x19a0('0x33')]=_0x64a15['attributes'][_0x19a0('0x36')]?_0x64a15[_0x19a0('0x33')]:_0xeb36cc[_0x19a0('0x2f')];if(_0x401533['query'][_0x19a0('0x42')]){_0x64a15[_0x19a0('0x43')]=[{'all':!![]}];}_0x64a15=_['merge']({},_0x64a15,_0x401533[_0x19a0('0x44')]);return db[_0x19a0('0x2b')][_0x19a0('0x45')](_0x64a15)['then'](handleEntityNotFound(_0x5bf487,null))[_0x19a0('0x24')](respondWithResult(_0x5bf487,null))[_0x19a0('0x46')](handleError(_0x5bf487,null));};exports[_0x19a0('0x47')]=function(_0x438227,_0x5315eb){return db[_0x19a0('0x2b')][_0x19a0('0x47')](_0x438227[_0x19a0('0x48')],{})['then'](respondWithResult(_0x5315eb,0xc9))[_0x19a0('0x46')](handleError(_0x5315eb,null));};exports[_0x19a0('0x23')]=function(_0x1ba18a,_0x195cba){if(_0x1ba18a[_0x19a0('0x48')]['id']){delete _0x1ba18a[_0x19a0('0x48')]['id'];}return db['WhatsappTransferReport'][_0x19a0('0x45')]({'where':{'id':_0x1ba18a[_0x19a0('0x49')]['id']}})['then'](handleEntityNotFound(_0x195cba,null))[_0x19a0('0x24')](saveUpdates(_0x1ba18a[_0x19a0('0x48')],null))[_0x19a0('0x24')](respondWithResult(_0x195cba,null))[_0x19a0('0x46')](handleError(_0x195cba,null));};exports[_0x19a0('0x25')]=function(_0x340410,_0x3004e8){return db[_0x19a0('0x2b')][_0x19a0('0x45')]({'where':{'id':_0x340410[_0x19a0('0x49')]['id']}})['then'](handleEntityNotFound(_0x3004e8,null))['then'](removeEntity(_0x3004e8,null))[_0x19a0('0x46')](handleError(_0x3004e8,null));};exports[_0x19a0('0x4a')]=function(_0x598c98,_0x4f4aaf){return db['WhatsappTransferReport'][_0x19a0('0x4a')]()['then'](respondWithResult(_0x4f4aaf,null))[_0x19a0('0x46')](handleError(_0x4f4aaf,null));};
\ No newline at end of file
+var _0xdf4c=['squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','WhatsappTransferReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','options','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash'];(function(_0x10f2f8,_0x3c763a){var _0x19266a=function(_0x4bf56b){while(--_0x4bf56b){_0x10f2f8['push'](_0x10f2f8['shift']());}};_0x19266a(++_0x3c763a);}(_0xdf4c,0x8e));var _0xcdf4=function(_0x133851,_0x4d6780){_0x133851=_0x133851-0x0;var _0x188215=_0xdf4c[_0x133851];return _0x188215;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcdf4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcdf4('0x1'));var rp=require(_0xcdf4('0x2'));var moment=require(_0xcdf4('0x3'));var BPromise=require(_0xcdf4('0x4'));var Mustache=require(_0xcdf4('0x5'));var util=require(_0xcdf4('0x6'));var path=require(_0xcdf4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcdf4('0x8'));var fs=require('fs');var _=require(_0xcdf4('0x9'));var squel=require(_0xcdf4('0xa'));var crypto=require(_0xcdf4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcdf4('0xc'));var toCsv=require(_0xcdf4('0xd'));var querystring=require('querystring');var Papa=require(_0xcdf4('0xe'));var Redis=require(_0xcdf4('0xf'));var authService=require(_0xcdf4('0x10'));var qs=require(_0xcdf4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcdf4('0x12'));var logger=require(_0xcdf4('0x13'))(_0xcdf4('0x14'));var utils=require('../../config/utils');var config=require(_0xcdf4('0x15'));var db=require(_0xcdf4('0x16'))['db'];function respondWithStatusCode(_0x5457fa,_0x3e36b2){_0x3e36b2=_0x3e36b2||0xcc;return function(_0x4e8a3b){if(_0x4e8a3b){return _0x5457fa[_0xcdf4('0x17')](_0x3e36b2);}return _0x5457fa[_0xcdf4('0x18')](_0x3e36b2)[_0xcdf4('0x19')]();};}function respondWithResult(_0x494811,_0x2a7898){_0x2a7898=_0x2a7898||0xc8;return function(_0xd6b3eb){if(_0xd6b3eb){return _0x494811[_0xcdf4('0x18')](_0x2a7898)[_0xcdf4('0x1a')](_0xd6b3eb);}};}function respondWithFilteredResult(_0x2017cb,_0x35d774){return function(_0x4d5cff){if(_0x4d5cff){var _0x4684a9=_0x4d5cff[_0xcdf4('0x1b')],_0x4a6fa0=_0x35d774[_0xcdf4('0x1c')],_0x40238d=_0x35d774[_0xcdf4('0x1c')]+_0x35d774[_0xcdf4('0x1d')],_0x5c728c;if(_0x40238d>=_0x4684a9){_0x40238d=_0x4684a9;_0x5c728c=0xc8;}else{_0x5c728c=0xce;}_0x2017cb['status'](_0x5c728c);return _0x2017cb['set'](_0xcdf4('0x1e'),_0x4a6fa0+'-'+_0x40238d+'/'+_0x4684a9)[_0xcdf4('0x1a')](_0x4d5cff);}return null;};}function patchUpdates(_0x4232f1){return function(_0x15cc77){try{jsonpatch[_0xcdf4('0x1f')](_0x15cc77,_0x4232f1,!![]);}catch(_0x27482c){return BPromise[_0xcdf4('0x20')](_0x27482c);}return _0x15cc77[_0xcdf4('0x21')]();};}function saveUpdates(_0x5777b9,_0xc09437){return function(_0x5746e4){if(_0x5746e4){return _0x5746e4[_0xcdf4('0x22')](_0x5777b9)[_0xcdf4('0x23')](function(_0x526623){return _0x526623;});}return null;};}function removeEntity(_0x2090d7,_0x52e566){return function(_0x4de1b3){if(_0x4de1b3){return _0x4de1b3['destroy']()[_0xcdf4('0x23')](function(){_0x2090d7[_0xcdf4('0x18')](0xcc)[_0xcdf4('0x19')]();});}};}function handleEntityNotFound(_0xd4034,_0x32a0c1){return function(_0x50994e){if(!_0x50994e){_0xd4034[_0xcdf4('0x17')](0x194);}return _0x50994e;};}function handleError(_0x512f09,_0x502f5d){_0x502f5d=_0x502f5d||0x1f4;return function(_0x3b6828){logger[_0xcdf4('0x24')](_0x3b6828[_0xcdf4('0x25')]);if(_0x3b6828[_0xcdf4('0x26')]){delete _0x3b6828[_0xcdf4('0x26')];}_0x512f09[_0xcdf4('0x18')](_0x502f5d)[_0xcdf4('0x27')](_0x3b6828);};}exports['index']=function(_0x8fc8a5,_0x250427){var _0x1879e2={},_0x3fa2d6={},_0x382e40={'count':0x0,'rows':[]};var _0x4fdbf6=_[_0xcdf4('0x28')](db[_0xcdf4('0x29')]['rawAttributes'],function(_0x288769){return{'name':_0x288769[_0xcdf4('0x2a')],'type':_0x288769[_0xcdf4('0x2b')][_0xcdf4('0x2c')]};});_0x3fa2d6[_0xcdf4('0x2d')]=_[_0xcdf4('0x28')](_0x4fdbf6,_0xcdf4('0x26'));_0x3fa2d6[_0xcdf4('0x2e')]=_['keys'](_0x8fc8a5[_0xcdf4('0x2e')]);_0x3fa2d6[_0xcdf4('0x2f')]=_[_0xcdf4('0x30')](_0x3fa2d6[_0xcdf4('0x2d')],_0x3fa2d6[_0xcdf4('0x2e')]);_0x1879e2[_0xcdf4('0x31')]=_['intersection'](_0x3fa2d6[_0xcdf4('0x2d')],qs[_0xcdf4('0x32')](_0x8fc8a5[_0xcdf4('0x2e')][_0xcdf4('0x32')]));_0x1879e2[_0xcdf4('0x31')]=_0x1879e2[_0xcdf4('0x31')][_0xcdf4('0x33')]?_0x1879e2['attributes']:_0x3fa2d6[_0xcdf4('0x2d')];if(!_0x8fc8a5[_0xcdf4('0x2e')][_0xcdf4('0x34')](_0xcdf4('0x35'))){_0x1879e2[_0xcdf4('0x1d')]=qs[_0xcdf4('0x1d')](_0x8fc8a5[_0xcdf4('0x2e')]['limit']);_0x1879e2[_0xcdf4('0x1c')]=qs[_0xcdf4('0x1c')](_0x8fc8a5[_0xcdf4('0x2e')][_0xcdf4('0x1c')]);}_0x1879e2[_0xcdf4('0x36')]=qs[_0xcdf4('0x37')](_0x8fc8a5[_0xcdf4('0x2e')]['sort']);_0x1879e2[_0xcdf4('0x38')]=qs[_0xcdf4('0x2f')](_[_0xcdf4('0x39')](_0x8fc8a5['query'],_0x3fa2d6[_0xcdf4('0x2f')]),_0x4fdbf6);if(_0x8fc8a5[_0xcdf4('0x2e')]['filter']){_0x1879e2[_0xcdf4('0x38')]=_[_0xcdf4('0x3a')](_0x1879e2[_0xcdf4('0x38')],{'$or':_[_0xcdf4('0x28')](_0x4fdbf6,function(_0x21ebc4){if(_0x21ebc4['type']!==_0xcdf4('0x3b')){var _0x30aaf={};_0x30aaf[_0x21ebc4[_0xcdf4('0x26')]]={'$like':'%'+_0x8fc8a5[_0xcdf4('0x2e')][_0xcdf4('0x3c')]+'%'};return _0x30aaf;}})});}_0x1879e2=_[_0xcdf4('0x3a')]({},_0x1879e2,_0x8fc8a5['options']);var _0x5df352={'where':_0x1879e2[_0xcdf4('0x38')]};return db[_0xcdf4('0x29')][_0xcdf4('0x1b')](_0x5df352)[_0xcdf4('0x23')](function(_0xe7efb7){_0x382e40[_0xcdf4('0x1b')]=_0xe7efb7;if(_0x8fc8a5['query'][_0xcdf4('0x3d')]){_0x1879e2[_0xcdf4('0x3e')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xcdf4('0x3f')](_0x1879e2);})[_0xcdf4('0x23')](function(_0x502c6f){_0x382e40[_0xcdf4('0x40')]=_0x502c6f;return _0x382e40;})[_0xcdf4('0x23')](respondWithFilteredResult(_0x250427,_0x1879e2))[_0xcdf4('0x41')](handleError(_0x250427,null));};exports[_0xcdf4('0x42')]=function(_0x177aa9,_0x417779){var _0xcfe538={'raw':!![],'where':{'id':_0x177aa9[_0xcdf4('0x43')]['id']}},_0x37c2bb={};_0x37c2bb[_0xcdf4('0x2d')]=_['keys'](db[_0xcdf4('0x29')][_0xcdf4('0x44')]);_0x37c2bb[_0xcdf4('0x2e')]=_[_0xcdf4('0x45')](_0x177aa9[_0xcdf4('0x2e')]);_0x37c2bb[_0xcdf4('0x2f')]=_[_0xcdf4('0x30')](_0x37c2bb['model'],_0x37c2bb[_0xcdf4('0x2e')]);_0xcfe538[_0xcdf4('0x31')]=_['intersection'](_0x37c2bb[_0xcdf4('0x2d')],qs['fields'](_0x177aa9[_0xcdf4('0x2e')][_0xcdf4('0x32')]));_0xcfe538['attributes']=_0xcfe538[_0xcdf4('0x31')][_0xcdf4('0x33')]?_0xcfe538[_0xcdf4('0x31')]:_0x37c2bb[_0xcdf4('0x2d')];if(_0x177aa9[_0xcdf4('0x2e')][_0xcdf4('0x3d')]){_0xcfe538[_0xcdf4('0x3e')]=[{'all':!![]}];}_0xcfe538=_[_0xcdf4('0x3a')]({},_0xcfe538,_0x177aa9[_0xcdf4('0x46')]);return db[_0xcdf4('0x29')][_0xcdf4('0x47')](_0xcfe538)[_0xcdf4('0x23')](handleEntityNotFound(_0x417779,null))[_0xcdf4('0x23')](respondWithResult(_0x417779,null))[_0xcdf4('0x41')](handleError(_0x417779,null));};exports[_0xcdf4('0x48')]=function(_0x2b14d7,_0x4a1f1b){return db['WhatsappTransferReport'][_0xcdf4('0x48')](_0x2b14d7[_0xcdf4('0x49')],{})[_0xcdf4('0x23')](respondWithResult(_0x4a1f1b,0xc9))['catch'](handleError(_0x4a1f1b,null));};exports[_0xcdf4('0x22')]=function(_0x3e66cb,_0x3a6ccd){if(_0x3e66cb['body']['id']){delete _0x3e66cb[_0xcdf4('0x49')]['id'];}return db[_0xcdf4('0x29')][_0xcdf4('0x47')]({'where':{'id':_0x3e66cb['params']['id']}})[_0xcdf4('0x23')](handleEntityNotFound(_0x3a6ccd,null))['then'](saveUpdates(_0x3e66cb[_0xcdf4('0x49')],null))[_0xcdf4('0x23')](respondWithResult(_0x3a6ccd,null))[_0xcdf4('0x41')](handleError(_0x3a6ccd,null));};exports[_0xcdf4('0x4a')]=function(_0x3ca55d,_0x42366){return db[_0xcdf4('0x29')]['find']({'where':{'id':_0x3ca55d[_0xcdf4('0x43')]['id']}})[_0xcdf4('0x23')](handleEntityNotFound(_0x42366,null))[_0xcdf4('0x23')](removeEntity(_0x42366,null))[_0xcdf4('0x41')](handleError(_0x42366,null));};exports['describe']=function(_0x2d493a,_0x1dbd1c){return db[_0xcdf4('0x29')][_0xcdf4('0x4b')]()[_0xcdf4('0x23')](respondWithResult(_0x1dbd1c,null))['catch'](handleError(_0x1dbd1c,null));};
\ No newline at end of file
index 90762e9..95fac3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebf3=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x1de38f,_0x5da597){var _0x3a053f=function(_0x1ee8da){while(--_0x1ee8da){_0x1de38f['push'](_0x1de38f['shift']());}};_0x3a053f(++_0x5da597);}(_0xebf3,0xef));var _0x3ebf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xebf3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ebf('0x0'));var util=require(_0x3ebf('0x1'));var logger=require(_0x3ebf('0x2'))(_0x3ebf('0x3'));var moment=require(_0x3ebf('0x4'));var BPromise=require('bluebird');var rp=require(_0x3ebf('0x5'));var fs=require('fs');var path=require(_0x3ebf('0x6'));var rimraf=require(_0x3ebf('0x7'));var config=require(_0x3ebf('0x8'));var attributes=require(_0x3ebf('0x9'));module[_0x3ebf('0xa')]=function(_0x3a4a4f,_0x1b9615){return _0x3a4a4f['define'](_0x3ebf('0xb'),attributes,{'tableName':_0x3ebf('0xc'),'paranoid':![],'indexes':[{'name':_0x3ebf('0xd'),'fields':[_0x3ebf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x58c5=['path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x6c8f5b,_0x16c8f3){var _0x7cd9cc=function(_0x6e0e1f){while(--_0x6e0e1f){_0x6c8f5b['push'](_0x6c8f5b['shift']());}};_0x7cd9cc(++_0x16c8f3);}(_0x58c5,0xe7));var _0x558c=function(_0x2cfc00,_0x1e5154){_0x2cfc00=_0x2cfc00-0x0;var _0x5eaee2=_0x58c5[_0x2cfc00];return _0x5eaee2;};'use strict';var _=require(_0x558c('0x0'));var util=require(_0x558c('0x1'));var logger=require(_0x558c('0x2'))(_0x558c('0x3'));var moment=require(_0x558c('0x4'));var BPromise=require(_0x558c('0x5'));var rp=require(_0x558c('0x6'));var fs=require('fs');var path=require(_0x558c('0x7'));var rimraf=require(_0x558c('0x8'));var config=require(_0x558c('0x9'));var attributes=require(_0x558c('0xa'));module[_0x558c('0xb')]=function(_0x49e456,_0x81e715){return _0x49e456['define'](_0x558c('0xc'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x558c('0xd'),'fields':[_0x558c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 598e5df..68b117b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x577e3c,_0x5a51bb){var _0x2edfb3=function(_0x3c2dc5){while(--_0x3c2dc5){_0x577e3c['push'](_0x577e3c['shift']());}};_0x2edfb3(++_0x5a51bb);}(_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 moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x20341a,_0x233f23){var _0x4eb449=function(_0x1403bb){while(--_0x1403bb){_0x20341a['push'](_0x20341a['shift']());}};_0x4eb449(++_0x233f23);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 77259a6..0d40ea3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd27d=['./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','then','listen','info','start','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','None','./config/license','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment'];(function(_0x1e76be,_0x24ee32){var _0x519556=function(_0x3bff62){while(--_0x3bff62){_0x1e76be['push'](_0x1e76be['shift']());}};_0x519556(++_0x24ee32);}(_0xd27d,0x71));var _0xdd27=function(_0x459879,_0x16b25d){_0x459879=_0x459879-0x0;var _0xa84228=_0xd27d[_0x459879];return _0xa84228;};'use strict';var _=require('lodash');var mysqldb=require(_0xdd27('0x0'));var rpc=require(_0xdd27('0x1'));var config=require(_0xdd27('0x2'));var logger=require(_0xdd27('0x3'))(_0xdd27('0x4'));var pm2=require(_0xdd27('0x5'));var pm2Config=require(_0xdd27('0x6'));var schedule=require(_0xdd27('0x7'));var chat=require(_0xdd27('0x8'));var transcribe=require(_0xdd27('0x9'));function main(){return mysqldb['db']['sequelize']['sync']()[_0xdd27('0xa')](function(){return rpc[_0xdd27('0xb')]();})[_0xdd27('0xa')](function(_0x1285e8){logger[_0xdd27('0xc')](_0x1285e8);return chat[_0xdd27('0xd')]();})[_0xdd27('0xa')](function(){return schedule[_0xdd27('0xd')]();})[_0xdd27('0xa')](function(){return transcribe[_0xdd27('0xd')]();})[_0xdd27('0xa')](function(_0x3aa426){logger[_0xdd27('0xc')](_0x3aa426);return pm2[_0xdd27('0xd')](pm2Config);})['then'](function(_0x2eed14){logger[_0xdd27('0xc')](_0xdd27('0xe'),_[_0xdd27('0xf')](_[_0xdd27('0x10')](_0x2eed14,{'status':_0xdd27('0x11')}),_0xdd27('0x12'))[_0xdd27('0x13')]());logger[_0xdd27('0xc')](_0xdd27('0x14'),_[_0xdd27('0xf')](_['filter'](_0x2eed14,function(_0x29d45b){return _0x29d45b[_0xdd27('0x15')]!==_0xdd27('0x11');}),_0xdd27('0x12'))[_0xdd27('0x13')]()||_0xdd27('0x16'));config['seedDB']&&require('./config/seedDB')['default']();require(_0xdd27('0x17'))[_0xdd27('0x18')]();})[_0xdd27('0x19')](function(_0x21b75a){logger[_0xdd27('0x1a')](_0xdd27('0x1b'),_0x21b75a);process[_0xdd27('0x1c')](0x1);});}main();
\ No newline at end of file
+var _0xa674=['./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','info','start','Online\x20apps:','map','online','name','join','status','None','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/pm2'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa674,0x13f));var _0x4a67=function(_0x7a6289,_0x34365e){_0x7a6289=_0x7a6289-0x0;var _0x139c92=_0xa674[_0x7a6289];return _0x139c92;};'use strict';var _=require(_0x4a67('0x0'));var mysqldb=require(_0x4a67('0x1'));var rpc=require(_0x4a67('0x2'));var config=require(_0x4a67('0x3'));var logger=require('./config/logger')('app');var pm2=require(_0x4a67('0x4'));var pm2Config=require(_0x4a67('0x5'));var schedule=require(_0x4a67('0x6'));var chat=require(_0x4a67('0x7'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x4a67('0x8')][_0x4a67('0x9')]()[_0x4a67('0xa')](function(){return rpc['listen']();})[_0x4a67('0xa')](function(_0x286033){logger[_0x4a67('0xb')](_0x286033);return chat[_0x4a67('0xc')]();})[_0x4a67('0xa')](function(){return schedule['start']();})[_0x4a67('0xa')](function(){return transcribe[_0x4a67('0xc')]();})['then'](function(_0x2d7798){logger['info'](_0x2d7798);return pm2['start'](pm2Config);})[_0x4a67('0xa')](function(_0x5ebc78){logger[_0x4a67('0xb')](_0x4a67('0xd'),_[_0x4a67('0xe')](_['filter'](_0x5ebc78,{'status':_0x4a67('0xf')}),_0x4a67('0x10'))[_0x4a67('0x11')]());logger['info']('Offline\x20apps:',_['map'](_['filter'](_0x5ebc78,function(_0x364197){return _0x364197[_0x4a67('0x12')]!=='online';}),_0x4a67('0x10'))[_0x4a67('0x11')]()||_0x4a67('0x13'));config[_0x4a67('0x14')]&&require(_0x4a67('0x15'))[_0x4a67('0x16')]();require(_0x4a67('0x17'))['default']();})[_0x4a67('0x18')](function(_0x3ad577){logger['error'](_0x4a67('0x19'),_0x3ad577);process[_0x4a67('0x1a')](0x1);});}main();
\ No newline at end of file
index 1799311..240e19c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a9b=['phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','status','json','unmanaged','Forbidden.','headers','startsWith','authorization','Basic','User','find','pass','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','then','sub','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','Forbidden','isMiddleware','signToken','cookie','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','options','verify','toString','hex','floor','now','HS512','../../mysqldb','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','secrets','session','role','fullname','name','internal','email','userpic','permissions','md5secret','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires'];(function(_0x18c08a,_0x46e340){var _0x388429=function(_0x27d239){while(--_0x27d239){_0x18c08a['push'](_0x18c08a['shift']());}};_0x388429(++_0x46e340);}(_0x6a9b,0x97));var _0xb6a9=function(_0x2d1f6f,_0x239dec){_0x2d1f6f=_0x2d1f6f-0x0;var _0x2b8c80=_0x6a9b[_0x2d1f6f];return _0x2b8c80;};'use strict';var db=require(_0xb6a9('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var _=require(_0xb6a9('0x1'));var jwt=require(_0xb6a9('0x2'));var expressJwt=require(_0xb6a9('0x3'));var compose=require(_0xb6a9('0x4'));var basicAuth=require(_0xb6a9('0x5'));var crypto=require(_0xb6a9('0x6'));var BPromise=require('bluebird');var validateJwt=expressJwt({'secret':config[_0xb6a9('0x7')][_0xb6a9('0x8')]});var userAttributes=['id',_0xb6a9('0x9'),_0xb6a9('0xa'),_0xb6a9('0xb'),_0xb6a9('0xc'),_0xb6a9('0xd'),_0xb6a9('0xe'),_0xb6a9('0xf'),_0xb6a9('0x10'),'voicePause',_0xb6a9('0x11'),_0xb6a9('0x12'),_0xb6a9('0x13'),_0xb6a9('0x14'),_0xb6a9('0x15'),_0xb6a9('0x16'),_0xb6a9('0x17'),'lastLoginAt','lastPauseAt',_0xb6a9('0x18'),'allowmessenger',_0xb6a9('0x19'),_0xb6a9('0x1a'),_0xb6a9('0x1b'),_0xb6a9('0x1c'),_0xb6a9('0x1d'),_0xb6a9('0x1e'),'phoneBarEnableDtmfTone',_0xb6a9('0x1f'),_0xb6a9('0x20'),_0xb6a9('0x21'),_0xb6a9('0x22'),_0xb6a9('0x23'),_0xb6a9('0x24'),_0xb6a9('0x25'),'userProfileId'];exports[_0xb6a9('0x26')]=function(){return this[_0xb6a9('0x27')](!![])[_0xb6a9('0x28')](function(_0x29204f,_0x239aa3,_0x348bb8){if(_0x29204f[_0xb6a9('0x29')]){_0x348bb8();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x29204f[_0xb6a9('0x2a')]['id']},'attributes':['id',_0xb6a9('0x2b'),'disposition'],'raw':!![]})['then'](function(_0x718cbb){if(_0x718cbb&&_0x718cbb[_0xb6a9('0x2b')]){return _0x239aa3[_0xb6a9('0x2c')](_0x718cbb['disposition']==='unmanaged'?0x195:0x193)[_0xb6a9('0x2d')]({'message':_0x718cbb['disposition']===_0xb6a9('0x2e')?'Unmanaged.':_0xb6a9('0x2f')});}else{_0x348bb8();}})['catch'](function(_0x16538f){_0x348bb8(_0x16538f);});}});};exports[_0xb6a9('0x27')]=function isAuthenticated(_0xc8da1f){return compose()['use'](function(_0x22f04f,_0x41e186,_0x47e5c3){if(_0x22f04f[_0xb6a9('0x30')]['authorization']){if(_[_0xb6a9('0x31')](_0x22f04f['headers'][_0xb6a9('0x32')],_0xb6a9('0x33'))){var _0x1dafe6=basicAuth(_0x22f04f);db[_0xb6a9('0x34')][_0xb6a9('0x35')]({'where':{'name':_0x1dafe6[_0xb6a9('0xb')]}})['then'](function(_0x28d95f){if(!_0x28d95f||!_0x28d95f['authenticate'](_0x1dafe6[_0xb6a9('0x36')])){return _0x41e186[_0xb6a9('0x2c')](0x191)[_0xb6a9('0x2d')]({'message':_0xb6a9('0x37')});}_0x22f04f[_0xb6a9('0x29')]={'id':_0x28d95f['id']};_0x47e5c3();})[_0xb6a9('0x38')](function(_0x296175){_0x47e5c3(_0x296175);});}else if(_['startsWith'](_0x22f04f['headers'][_0xb6a9('0x32')],_0xb6a9('0x39'))){validateJwt(_0x22f04f,_0x41e186,_0x47e5c3);}else{if(_0xc8da1f){_0x47e5c3();}else{return _0x41e186['status'](0x193)[_0xb6a9('0x2d')]({'message':_0xb6a9('0x3a')});}}}else if(_0x22f04f[_0xb6a9('0x3b')]['apikey']){try{var _0x3e35b1={'audience':hardwareConf[_0xb6a9('0x3c')](),'issuer':hardwareConf[_0xb6a9('0x3c')]()};verifyJwt(_0x22f04f[_0xb6a9('0x3b')][_0xb6a9('0x3d')],_0x3e35b1)[_0xb6a9('0x3e')](function(_0x518caa){return db[_0xb6a9('0x34')][_0xb6a9('0x35')]({'where':{'id':_0x518caa[_0xb6a9('0x3f')]}})[_0xb6a9('0x3e')](function(_0xaf0ba3){if(!_0xaf0ba3||!_[_0xb6a9('0x40')](_0xaf0ba3[_0xb6a9('0x41')],_0x518caa['nonce'])){return _0x41e186[_0xb6a9('0x2c')](0x191)[_0xb6a9('0x2d')]({'message':_0xb6a9('0x42')});}_0x22f04f['user']={'id':_0xaf0ba3['id']};_0x47e5c3();});})['catch'](function(){return _0x41e186['status'](0x191)[_0xb6a9('0x2d')]({'message':_0xb6a9('0x43')});});}catch(_0x34973f){_0x47e5c3(_0x34973f);}}else if(_0xc8da1f){_0x47e5c3();}else{return _0x41e186[_0xb6a9('0x2c')](0x193)[_0xb6a9('0x2d')]({'message':_0xb6a9('0x3a')});}})[_0xb6a9('0x28')](function(_0x2130e3,_0x1acc47,_0x83c725){if(_0x2130e3['user']){db['User']['find']({'where':{'id':_0x2130e3[_0xb6a9('0x29')]['id']},'attributes':userAttributes})[_0xb6a9('0x3e')](function(_0x137ec2){if(!_0x137ec2){return _0x1acc47[_0xb6a9('0x2c')](0x194)[_0xb6a9('0x2d')]({'message':_0xb6a9('0x44')});}_0x2130e3['user']=_0x137ec2;_0x83c725();})['catch'](function(_0x3455bd){_0x83c725(_0x3455bd);});}else if(_0xc8da1f){_0x83c725();}else{return _0x1acc47[_0xb6a9('0x2c')](0x194)[_0xb6a9('0x2d')]({'message':_0xb6a9('0x45')});}});};exports[_0xb6a9('0x46')]=function canUpdate(){return compose()[_0xb6a9('0x28')](function(_0x2231f9,_0x12ca82,_0x3b64d2){return require(_0xb6a9('0x47'))['getLicense']()[_0xb6a9('0x3e')](function(_0x28b6d1){if(_0x28b6d1['update']){_0x3b64d2();}else{return _0x12ca82[_0xb6a9('0x2c')](0x193)['json']({'message':_0xb6a9('0x48')});}})[_0xb6a9('0x38')](function(_0x94b9b5){_0x3b64d2(_0x94b9b5);});});};exports[_0xb6a9('0x49')]=function(_0x5ae362,_0x1fde14,_0xb1640c){_0x5ae362['isMiddleware']=!![];return _0xb1640c();};exports[_0xb6a9('0x4a')]=function signToken(_0x5e974d){return signJwt(_0x5e974d);};exports['setTokenCookie']=function(_0x1e527c,_0x2408d5){if(!_0x1e527c[_0xb6a9('0x29')]){return _0x2408d5[_0xb6a9('0x2c')](0x194)[_0xb6a9('0x2d')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x789ce4={'payload':{'id':_0x1e527c['user']['id'],'role':_0x1e527c[_0xb6a9('0x29')][_0xb6a9('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x789ce4)[_0xb6a9('0x3e')](function(_0x459675){_0x2408d5[_0xb6a9('0x4b')]('motion.token',_0x459675);_0x2408d5['redirect']('/dashboards/general');})['catch'](function(_0x3cd523){return _0x2408d5[_0xb6a9('0x2c')](0x1f4)['send'](_0x3cd523);});};exports[_0xb6a9('0x4c')]=function(_0x264110){if(_[_0xb6a9('0x4d')](_0x264110[_0xb6a9('0x41')])||_['isNil'](_0x264110[_0xb6a9('0x4e')])){return null;}else{return createJwt(_0x264110);}};exports[_0xb6a9('0x4f')]=function(_0x462a1b){_0x462a1b[_0xb6a9('0x41')]=generateNonce();_0x462a1b[_0xb6a9('0x4e')]=generateIssuedAt();return createJwt(_0x462a1b);};exports[_0xb6a9('0x50')]=function(_0x1a0e76,_0x5e5b29){var _0x1408f8=_0x1a0e76['query'][_0xb6a9('0x3d')];if(_0x1408f8){var _0xefdbd5={'nonce':_0x5e5b29[_0xb6a9('0x41')],'iat':_0x5e5b29['apiKeyIat'],'audience':hardwareConf[_0xb6a9('0x3c')](),'issuer':hardwareConf[_0xb6a9('0x3c')]()};return verifyJwt(_0x1408f8,_0xefdbd5)[_0xb6a9('0x3e')](function(){return generateApiKey(_0x5e5b29);});}else{throw{'message':_0xb6a9('0x51')};}};function signJwt(_0x1495bb){var _0x458f95=BPromise[_0xb6a9('0x52')](jwt[_0xb6a9('0x53')],{'context':jwt});var _0x5ea92d=_0x1495bb[_0xb6a9('0x54')]||config['secrets'][_0xb6a9('0x8')];return new BPromise(function(_0x336304,_0x45fa77){_0x458f95(_0x1495bb['payload'],_0x5ea92d,_0x1495bb[_0xb6a9('0x55')])['then'](function(_0x538c31){_0x336304(_0x538c31);})[_0xb6a9('0x38')](function(_0x1ce246){_0x45fa77(_0x1ce246);});});}function verifyJwt(_0x326849,_0x2f11db,_0x2867ae){var _0x2ebe15=BPromise[_0xb6a9('0x52')](jwt[_0xb6a9('0x56')],{'context':jwt});var _0x1206ec=_0x2867ae||config[_0xb6a9('0x7')]['session'];return new BPromise(function(_0x1cf25a,_0x5e79bc){_0x2ebe15(_0x326849,_0x1206ec,_0x2f11db)[_0xb6a9('0x3e')](function(_0x5cd003){_0x1cf25a(_0x5cd003);})[_0xb6a9('0x38')](function(_0x5a686c){_0x5e79bc(_0x5a686c);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb6a9('0x57')](_0xb6a9('0x58'));}function generateIssuedAt(){return Math[_0xb6a9('0x59')](Date[_0xb6a9('0x5a')]()/0x3e8)[_0xb6a9('0x57')]();}function createJwt(_0x4f8ba){var _0x583de8={'payload':{'iat':_0x4f8ba[_0xb6a9('0x4e')],'nonce':_0x4f8ba['apiKeyNonce']},'options':{'algorithm':_0xb6a9('0x5b'),'subject':_0x4f8ba['id'][_0xb6a9('0x57')](),'issuer':hardwareConf[_0xb6a9('0x3c')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x583de8)[_0xb6a9('0x3e')](function(_0xd741a7){return{'iat':_0x4f8ba[_0xb6a9('0x4e')],'nonce':_0x4f8ba[_0xb6a9('0x41')],'token':_0xd741a7};});}
\ No newline at end of file
+var _0xe747=['phoneBarPrefixRequired','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','user','findOne','params','disposition','then','closed','status','unmanaged','json','Unmanaged.','Forbidden.','catch','startsWith','headers','authorization','Basic','User','find','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','/dashboards/general','send','retrieveApiKey','apiKeyNonce','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','secrets','session','payload','options','verify','randomBytes','toString','hex','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','role','fullname','name','internal','userpic','md5secret','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires'];(function(_0x8bd147,_0x1064b3){var _0x424e20=function(_0x5c9e2c){while(--_0x5c9e2c){_0x8bd147['push'](_0x8bd147['shift']());}};_0x424e20(++_0x1064b3);}(_0xe747,0x1d0));var _0x7e74=function(_0x5e2157,_0x126007){_0x5e2157=_0x5e2157-0x0;var _0x4a3ac0=_0xe747[_0x5e2157];return _0x4a3ac0;};'use strict';var db=require(_0x7e74('0x0'))['db'];var config=require(_0x7e74('0x1'));var hardwareConf=require(_0x7e74('0x2'));var _=require('lodash');var jwt=require(_0x7e74('0x3'));var expressJwt=require(_0x7e74('0x4'));var compose=require(_0x7e74('0x5'));var basicAuth=require(_0x7e74('0x6'));var crypto=require(_0x7e74('0x7'));var BPromise=require(_0x7e74('0x8'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0x7e74('0x9'),_0x7e74('0xa'),_0x7e74('0xb'),_0x7e74('0xc'),'email',_0x7e74('0xd'),'permissions',_0x7e74('0xe'),'voicePause','chatPause',_0x7e74('0xf'),_0x7e74('0x10'),'smsPause',_0x7e74('0x11'),_0x7e74('0x12'),_0x7e74('0x13'),_0x7e74('0x14'),_0x7e74('0x15'),_0x7e74('0x16'),'allowmessenger',_0x7e74('0x17'),_0x7e74('0x18'),_0x7e74('0x19'),_0x7e74('0x1a'),_0x7e74('0x1b'),_0x7e74('0x1c'),'phoneBarEnableDtmfTone',_0x7e74('0x1d'),_0x7e74('0x1e'),_0x7e74('0x1f'),'phoneBarRemoteControl','phoneBarRemoteControlPort',_0x7e74('0x20'),_0x7e74('0x21'),_0x7e74('0x22')];exports[_0x7e74('0x23')]=function(){return this[_0x7e74('0x24')](!![])[_0x7e74('0x25')](function(_0x46c356,_0x36b173,_0x2f1998){if(_0x46c356[_0x7e74('0x26')]){_0x2f1998();}else{return db['ChatInteraction'][_0x7e74('0x27')]({'where':{'id':_0x46c356[_0x7e74('0x28')]['id']},'attributes':['id','closed',_0x7e74('0x29')],'raw':!![]})[_0x7e74('0x2a')](function(_0x2511e9){if(_0x2511e9&&_0x2511e9[_0x7e74('0x2b')]){return _0x36b173[_0x7e74('0x2c')](_0x2511e9[_0x7e74('0x29')]===_0x7e74('0x2d')?0x195:0x193)[_0x7e74('0x2e')]({'message':_0x2511e9[_0x7e74('0x29')]===_0x7e74('0x2d')?_0x7e74('0x2f'):_0x7e74('0x30')});}else{_0x2f1998();}})[_0x7e74('0x31')](function(_0x52e5a7){_0x2f1998(_0x52e5a7);});}});};exports[_0x7e74('0x24')]=function isAuthenticated(_0x526583){return compose()[_0x7e74('0x25')](function(_0x5aa32c,_0x195fee,_0x5e216){if(_0x5aa32c['headers']['authorization']){if(_[_0x7e74('0x32')](_0x5aa32c[_0x7e74('0x33')][_0x7e74('0x34')],_0x7e74('0x35'))){var _0x22aee8=basicAuth(_0x5aa32c);db[_0x7e74('0x36')][_0x7e74('0x37')]({'where':{'name':_0x22aee8['name']}})[_0x7e74('0x2a')](function(_0x1b2829){if(!_0x1b2829||!_0x1b2829[_0x7e74('0x38')](_0x22aee8['pass'])){return _0x195fee['status'](0x191)['json']({'message':_0x7e74('0x39')});}_0x5aa32c[_0x7e74('0x26')]={'id':_0x1b2829['id']};_0x5e216();})[_0x7e74('0x31')](function(_0x1796c2){_0x5e216(_0x1796c2);});}else if(_['startsWith'](_0x5aa32c[_0x7e74('0x33')][_0x7e74('0x34')],_0x7e74('0x3a'))){validateJwt(_0x5aa32c,_0x195fee,_0x5e216);}else{if(_0x526583){_0x5e216();}else{return _0x195fee[_0x7e74('0x2c')](0x193)[_0x7e74('0x2e')]({'message':_0x7e74('0x3b')});}}}else if(_0x5aa32c[_0x7e74('0x3c')][_0x7e74('0x3d')]){try{var _0x274f5a={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x7e74('0x3e')]()};verifyJwt(_0x5aa32c[_0x7e74('0x3c')][_0x7e74('0x3d')],_0x274f5a)[_0x7e74('0x2a')](function(_0x387eb6){return db[_0x7e74('0x36')]['find']({'where':{'id':_0x387eb6['sub']}})['then'](function(_0x1d63bd){if(!_0x1d63bd||!_[_0x7e74('0x3f')](_0x1d63bd['apiKeyNonce'],_0x387eb6[_0x7e74('0x40')])){return _0x195fee[_0x7e74('0x2c')](0x191)[_0x7e74('0x2e')]({'message':_0x7e74('0x41')});}_0x5aa32c[_0x7e74('0x26')]={'id':_0x1d63bd['id']};_0x5e216();});})['catch'](function(){return _0x195fee['status'](0x191)[_0x7e74('0x2e')]({'message':_0x7e74('0x42')});});}catch(_0x5c2015){_0x5e216(_0x5c2015);}}else if(_0x526583){_0x5e216();}else{return _0x195fee[_0x7e74('0x2c')](0x193)[_0x7e74('0x2e')]({'message':_0x7e74('0x3b')});}})['use'](function(_0x526929,_0x447293,_0x573a16){if(_0x526929[_0x7e74('0x26')]){db[_0x7e74('0x36')][_0x7e74('0x37')]({'where':{'id':_0x526929[_0x7e74('0x26')]['id']},'attributes':userAttributes})[_0x7e74('0x2a')](function(_0x429d5a){if(!_0x429d5a){return _0x447293[_0x7e74('0x2c')](0x194)[_0x7e74('0x2e')]({'message':'User\x20not\x20found.'});}_0x526929[_0x7e74('0x26')]=_0x429d5a;_0x573a16();})[_0x7e74('0x31')](function(_0x333b09){_0x573a16(_0x333b09);});}else if(_0x526583){_0x573a16();}else{return _0x447293['status'](0x194)['json']({'message':_0x7e74('0x43')});}});};exports[_0x7e74('0x44')]=function canUpdate(){return compose()[_0x7e74('0x25')](function(_0x36a272,_0x24ac12,_0x2edbb9){return require(_0x7e74('0x45'))[_0x7e74('0x46')]()[_0x7e74('0x2a')](function(_0x2e26d1){if(_0x2e26d1[_0x7e74('0x47')]){_0x2edbb9();}else{return _0x24ac12[_0x7e74('0x2c')](0x193)['json']({'message':_0x7e74('0x48')});}})[_0x7e74('0x31')](function(_0x1bc1d2){_0x2edbb9(_0x1bc1d2);});});};exports[_0x7e74('0x49')]=function(_0x12074d,_0x6da2e9,_0x51bb1b){_0x12074d[_0x7e74('0x49')]=!![];return _0x51bb1b();};exports[_0x7e74('0x4a')]=function signToken(_0x220532){return signJwt(_0x220532);};exports[_0x7e74('0x4b')]=function(_0x425389,_0x524ef9){if(!_0x425389[_0x7e74('0x26')]){return _0x524ef9['status'](0x194)[_0x7e74('0x2e')]({'message':_0x7e74('0x4c')});}var _0x2f62a2={'payload':{'id':_0x425389[_0x7e74('0x26')]['id'],'role':_0x425389[_0x7e74('0x26')][_0x7e74('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2f62a2)['then'](function(_0x437abd){_0x524ef9[_0x7e74('0x4d')]('motion.token',_0x437abd);_0x524ef9['redirect'](_0x7e74('0x4e'));})['catch'](function(_0x4f8816){return _0x524ef9[_0x7e74('0x2c')](0x1f4)[_0x7e74('0x4f')](_0x4f8816);});};exports[_0x7e74('0x50')]=function(_0x109e5a){if(_['isNil'](_0x109e5a[_0x7e74('0x51')])||_[_0x7e74('0x52')](_0x109e5a['apiKeyIat'])){return null;}else{return createJwt(_0x109e5a);}};exports[_0x7e74('0x53')]=function(_0x51f142){_0x51f142[_0x7e74('0x51')]=generateNonce();_0x51f142[_0x7e74('0x54')]=generateIssuedAt();return createJwt(_0x51f142);};exports[_0x7e74('0x55')]=function(_0x1de83a,_0xa46e92){var _0x56b7c8=_0x1de83a[_0x7e74('0x3c')][_0x7e74('0x3d')];if(_0x56b7c8){var _0x33de78={'nonce':_0xa46e92[_0x7e74('0x51')],'iat':_0xa46e92[_0x7e74('0x54')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x7e74('0x3e')]()};return verifyJwt(_0x56b7c8,_0x33de78)['then'](function(){return generateApiKey(_0xa46e92);});}else{throw{'message':_0x7e74('0x56')};}};function signJwt(_0x48dfed){var _0x431370=BPromise[_0x7e74('0x57')](jwt[_0x7e74('0x58')],{'context':jwt});var _0x13fa0b=_0x48dfed[_0x7e74('0x59')]||config[_0x7e74('0x5a')][_0x7e74('0x5b')];return new BPromise(function(_0x594781,_0x305e9a){_0x431370(_0x48dfed[_0x7e74('0x5c')],_0x13fa0b,_0x48dfed[_0x7e74('0x5d')])['then'](function(_0x16df8c){_0x594781(_0x16df8c);})[_0x7e74('0x31')](function(_0x4aacf8){_0x305e9a(_0x4aacf8);});});}function verifyJwt(_0x10a719,_0x42aa6a,_0x220729){var _0x520593=BPromise[_0x7e74('0x57')](jwt[_0x7e74('0x5e')],{'context':jwt});var _0x243340=_0x220729||config[_0x7e74('0x5a')][_0x7e74('0x5b')];return new BPromise(function(_0x2c227c,_0x2701fa){_0x520593(_0x10a719,_0x243340,_0x42aa6a)[_0x7e74('0x2a')](function(_0x5be784){_0x2c227c(_0x5be784);})[_0x7e74('0x31')](function(_0x38ee81){_0x2701fa(_0x38ee81);});});}function generateNonce(){return crypto[_0x7e74('0x5f')](0x10)[_0x7e74('0x60')](_0x7e74('0x61'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x7e74('0x60')]();}function createJwt(_0x5eaba0){var _0x5de36c={'payload':{'iat':_0x5eaba0[_0x7e74('0x54')],'nonce':_0x5eaba0[_0x7e74('0x51')]},'options':{'algorithm':_0x7e74('0x62'),'subject':_0x5eaba0['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x7e74('0x3e')]()}};return signJwt(_0x5de36c)[_0x7e74('0x2a')](function(_0x57a430){return{'iat':_0x5eaba0[_0x7e74('0x54')],'nonce':_0x5eaba0[_0x7e74('0x51')],'token':_0x57a430};});}
\ No newline at end of file
index e608bbd..c9c4c8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['data','binary','end','final','write','close','unlink','decryptFile','createReadStream','createDecipher','update','crypto','bluebird','hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm'];(function(_0x3c6310,_0x13601d){var _0x320122=function(_0x596176){while(--_0x596176){_0x3c6310['push'](_0x3c6310['shift']());}};_0x320122(++_0x13601d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var crypto=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x585166){var _0x4b72b0={};for(var _0x3ff8df in defaultOptions){if(defaultOptions[_0x0d8b('0x2')](_0x3ff8df)){_0x4b72b0[_0x3ff8df]=defaultOptions[_0x3ff8df];}}if(_0x585166){for(var _0x43bca1 in _0x585166){if(_0x585166[_0x0d8b('0x2')](_0x43bca1)){_0x4b72b0[_0x43bca1]=_0x585166[_0x43bca1];}}}return _0x4b72b0;}exports[_0x0d8b('0x3')]=function(_0x577834,_0x5e15e6,_0x3f8b6f,_0x227c63){return new BPromise(function(_0x39f43a,_0x4a4470){_0x227c63=combineOptions(_0x227c63);var _0x413284=new Buffer(_0x3f8b6f);var _0x284169=fs['createReadStream'](_0x577834);var _0x129310=fs[_0x0d8b('0x4')](_0x5e15e6);var _0x3b027f=crypto[_0x0d8b('0x5')](_0x227c63[_0x0d8b('0x6')],_0x413284);_0x284169['on'](_0x0d8b('0x7'),function(_0x2c5e9e){var _0x28f87c=new Buffer(_0x3b027f['update'](_0x2c5e9e),_0x0d8b('0x8'));_0x129310['write'](_0x28f87c);});_0x284169['on'](_0x0d8b('0x9'),function(){try{var _0xc574a3=new Buffer(_0x3b027f[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x129310[_0x0d8b('0xb')](_0xc574a3);_0x129310[_0x0d8b('0x9')]();_0x129310['on'](_0x0d8b('0xc'),function(){return _0x39f43a(_0x5e15e6);});}catch(_0x1d4bbc){fs[_0x0d8b('0xd')](_0x5e15e6);return _0x4a4470(_0x1d4bbc);}});});};exports[_0x0d8b('0xe')]=function(_0xe65334,_0x1567ce,_0x2d4e1c,_0x4f6f21){return new BPromise(function(_0x23eb7b,_0xa86349){_0x4f6f21=combineOptions(_0x4f6f21);var _0x17f7df=new Buffer(_0x2d4e1c);var _0xe2e167=fs[_0x0d8b('0xf')](_0xe65334);var _0x5cd485=fs[_0x0d8b('0x4')](_0x1567ce);var _0x4586c2=crypto[_0x0d8b('0x10')](_0x4f6f21[_0x0d8b('0x6')],_0x17f7df);_0xe2e167['on'](_0x0d8b('0x7'),function(_0x18dd2d){var _0x264b39=new Buffer(_0x4586c2[_0x0d8b('0x11')](_0x18dd2d),'binary');_0x5cd485[_0x0d8b('0xb')](_0x264b39);});_0xe2e167['on'](_0x0d8b('0x9'),function(){try{var _0x196c0a=new Buffer(_0x4586c2[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x5cd485[_0x0d8b('0xb')](_0x196c0a);_0x5cd485[_0x0d8b('0x9')]();_0x5cd485['on']('close',function(){return _0x23eb7b(_0x1567ce);});}catch(_0x4f0a1a){fs[_0x0d8b('0xd')](_0x1567ce);return _0xa86349(_0x4f0a1a);}});});};
\ No newline at end of file
+var _0xe706=['unlink','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','update','end','final','binary','write','close','createDecipher'];(function(_0x4cad64,_0x13a1d1){var _0x1ebb2d=function(_0x564d94){while(--_0x564d94){_0x4cad64['push'](_0x4cad64['shift']());}};_0x1ebb2d(++_0x13a1d1);}(_0xe706,0xa3));var _0x6e70=function(_0x2706f2,_0x9a058){_0x2706f2=_0x2706f2-0x0;var _0x595bab=_0xe706[_0x2706f2];return _0x595bab;};'use strict';var crypto=require(_0x6e70('0x0'));var fs=require('fs');var BPromise=require(_0x6e70('0x1'));var defaultOptions={'algorithm':_0x6e70('0x2')};function combineOptions(_0x5e8446){var _0x2cae77={};for(var _0x315629 in defaultOptions){if(defaultOptions[_0x6e70('0x3')](_0x315629)){_0x2cae77[_0x315629]=defaultOptions[_0x315629];}}if(_0x5e8446){for(var _0x7dfbc3 in _0x5e8446){if(_0x5e8446[_0x6e70('0x3')](_0x7dfbc3)){_0x2cae77[_0x7dfbc3]=_0x5e8446[_0x7dfbc3];}}}return _0x2cae77;}exports[_0x6e70('0x4')]=function(_0x376a8d,_0x506db9,_0x1b0389,_0x4381d1){return new BPromise(function(_0x36357b,_0x293ce7){_0x4381d1=combineOptions(_0x4381d1);var _0x45a2d4=new Buffer(_0x1b0389);var _0x188ed3=fs[_0x6e70('0x5')](_0x376a8d);var _0x449b48=fs[_0x6e70('0x6')](_0x506db9);var _0x25e61c=crypto[_0x6e70('0x7')](_0x4381d1[_0x6e70('0x8')],_0x45a2d4);_0x188ed3['on'](_0x6e70('0x9'),function(_0x3f474a){var _0x37b3e0=new Buffer(_0x25e61c[_0x6e70('0xa')](_0x3f474a),'binary');_0x449b48['write'](_0x37b3e0);});_0x188ed3['on'](_0x6e70('0xb'),function(){try{var _0x15a1a5=new Buffer(_0x25e61c[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x449b48[_0x6e70('0xe')](_0x15a1a5);_0x449b48[_0x6e70('0xb')]();_0x449b48['on'](_0x6e70('0xf'),function(){return _0x36357b(_0x506db9);});}catch(_0x5dfbaa){fs['unlink'](_0x506db9);return _0x293ce7(_0x5dfbaa);}});});};exports['decryptFile']=function(_0x257e81,_0x5a37a6,_0x53aed0,_0x304716){return new BPromise(function(_0x22c50c,_0x5d9263){_0x304716=combineOptions(_0x304716);var _0x24f3ac=new Buffer(_0x53aed0);var _0x5c3fe7=fs[_0x6e70('0x5')](_0x257e81);var _0x161f23=fs['createWriteStream'](_0x5a37a6);var _0x49029f=crypto[_0x6e70('0x10')](_0x304716['algorithm'],_0x24f3ac);_0x5c3fe7['on'](_0x6e70('0x9'),function(_0x173afe){var _0x53acdc=new Buffer(_0x49029f['update'](_0x173afe),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x53acdc);});_0x5c3fe7['on'](_0x6e70('0xb'),function(){try{var _0x3a9978=new Buffer(_0x49029f[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x3a9978);_0x161f23[_0x6e70('0xb')]();_0x161f23['on'](_0x6e70('0xf'),function(){return _0x22c50c(_0x5a37a6);});}catch(_0x4a0cfe){fs[_0x6e70('0x11')](_0x5a37a6);return _0x5d9263(_0x4a0cfe);}});});};
\ No newline at end of file
index 219197e..dffceb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a7=['push','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','lodash','to-csv','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','%s\x20limit\x20%d\x20OFFSET\x20%d','query','dirname','basename','.csv','length','existsSync','join','each'];(function(_0x187399,_0x40c56d){var _0x40fa92=function(_0x36058c){while(--_0x36058c){_0x187399['push'](_0x187399['shift']());}};_0x40fa92(++_0x40c56d);}(_0x91a7,0xe7));var _0x791a=function(_0x6c8fc3,_0x439e62){_0x6c8fc3=_0x6c8fc3-0x0;var _0x48d628=_0x91a7[_0x6c8fc3];return _0x48d628;};'use strict';var util=require('util');var path=require(_0x791a('0x0'));var _=require(_0x791a('0x1'));var csv=require(_0x791a('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x791a('0x3'));var rimraf=require('rimraf');var db=require(_0x791a('0x4'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x791a('0x5'))(_0x791a('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x791a('0x7')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x33baac,_0x159e24){var _0x5aa10a={'status':_0x33baac};var _0x1a32b4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x159e24){_0x5aa10a[_0x791a('0x8')]=_0x159e24;}return db[_0x791a('0x9')][_0x791a('0xa')](_0x5aa10a,_0x1a32b4);}function main(){var _0x266e4b=0x1388;var _0x5249d5;logger[_0x791a('0xb')](util[_0x791a('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x791a('0xd')));return db[_0x791a('0xe')][_0x791a('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x791a('0x10'),_0x791a('0x11')]})[_0x791a('0x12')](function(_0x53dc41){if(_0x53dc41){_0x5249d5=_0x53dc41;_0x266e4b=_0x5249d5['splitSizeCsv']||0x1388;}})[_0x791a('0x12')](function(){return dbH[_0x791a('0x13')]['query'](util[_0x791a('0xc')](_0x791a('0x14'),QUERY),{'type':dbH['sequelize'][_0x791a('0x15')][_0x791a('0x16')]});})[_0x791a('0x12')](function(_0x5cdf2){if(!_0x5cdf2[0x0]['num']){return analyticExtractedReport(_0x791a('0x17'));}var _0x575d11=[];var _0x43dea6=0x0;var _0x355155=!![];if(_0x5cdf2&&_0x5cdf2['length']){var _0x237adb=_0x5cdf2[0x0]['num']%(_0x43dea6+_0x266e4b);if(_0x5249d5[_0x791a('0x10')]){for(;_0x355155;_0x43dea6+=_0x266e4b,_0x237adb=_0x5cdf2[0x0]['num']%(_0x43dea6+_0x266e4b)){if(_0x237adb==0x0||_0x237adb==_0x5cdf2[0x0]['num']){_0x355155=![];}_0x575d11['push'](dbH[_0x791a('0x13')]['query'](util['format'](_0x791a('0x18'),QUERY,_0x266e4b,_0x43dea6),{'type':dbH[_0x791a('0x13')][_0x791a('0x15')][_0x791a('0x16')]}));}}else{_0x575d11['push'](dbH[_0x791a('0x13')][_0x791a('0x19')](QUERY,{'type':dbH[_0x791a('0x13')][_0x791a('0x15')]['SELECT']}));}}var _0x448085=path[_0x791a('0x1a')](PATH);var _0x25bae5=path[_0x791a('0x1b')](PATH,_0x791a('0x1c'));var _0x1091af=_0x5249d5[_0x791a('0x10')]&&_0x575d11[_0x791a('0x1d')]>0x1;var _0x323c6a=[];if(!fs[_0x791a('0x1e')](path[_0x791a('0x1f')](_0x448085,_0x25bae5))&&_0x1091af){fs['mkdirSync'](path[_0x791a('0x1f')](_0x448085,_0x25bae5));}return BPromise[_0x791a('0x20')](_0x575d11,function(_0x380329){_0x323c6a[_0x791a('0x21')](_0x380329);})['then'](function(){for(var _0x456480=0x0;_0x456480<_0x323c6a[_0x791a('0x1d')];_0x456480+=0x1){var _0x51dcca;var _0xdfa84f=_0x323c6a[_0x456480];if(_0x1091af){_0x51dcca=path[_0x791a('0x1f')](_0x448085,_0x25bae5,util[_0x791a('0xc')]('%s%d.%s',_0x25bae5,_0x456480,_0x791a('0x22')));}else{_0x51dcca=path[_0x791a('0x1f')](_0x448085,util[_0x791a('0xc')](_0x791a('0x23'),_0x25bae5,_0x791a('0x22')));}fs[_0x791a('0x24')](_0x51dcca,csv(_0xdfa84f));}})[_0x791a('0x12')](function(){if(_0x1091af){zipdir(path[_0x791a('0x1f')](_0x448085,_0x25bae5),{'saveTo':path['join'](_0x448085,util[_0x791a('0xc')](_0x791a('0x23'),_0x25bae5,_0x791a('0x25')))},function(_0x59d2c0,_0x1cdda9){});rimraf(path['join'](_0x448085,_0x25bae5),function(){});}})[_0x791a('0x12')](function(){logger[_0x791a('0xb')](util[_0x791a('0xc')](_0x791a('0x26'),EXTRACTED_REPORT_ID,_0x791a('0xd')));return analyticExtractedReport(_0x791a('0x27'),_0x1091af?util[_0x791a('0xc')]('%s.%s',_0x25bae5,_0x1091af?_0x791a('0x25'):_0x791a('0x22')):null);});})[_0x791a('0x28')](function(_0x27f758){logger[_0x791a('0xb')](util['format'](_0x791a('0x29'),EXTRACTED_REPORT_ID,_0x791a('0xd')),util[_0x791a('0x2a')](_0x27f758,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x791a('0x2b'));});}main();
\ No newline at end of file
+var _0xb43b=['basename','.csv','existsSync','join','length','%s%d.%s','csv','%s.%s','writeFileSync','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','sequelize','QueryTypes','num','Empty','split','push','query','SELECT','dirname'];(function(_0x44400c,_0x4469e7){var _0x5d3d53=function(_0x2a4102){while(--_0x2a4102){_0x44400c['push'](_0x44400c['shift']());}};_0x5d3d53(++_0x4469e7);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1c8cde,_0x299c5a){_0x1c8cde=_0x1c8cde-0x0;var _0x55b330=_0xb43b[_0x1c8cde];return _0x55b330;};'use strict';var util=require(_0xbb43('0x0'));var path=require(_0xbb43('0x1'));var _=require('lodash');var csv=require(_0xbb43('0x2'));var fs=require('fs');var BPromise=require(_0xbb43('0x3'));var zipdir=require(_0xbb43('0x4'));var rimraf=require('rimraf');var db=require(_0xbb43('0x5'))['db'];var dbH=require(_0xbb43('0x5'))[_0xbb43('0x6')];var logger=require(_0xbb43('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xbb43('0x8')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x80fe61,_0x1ccd49){var _0x2a2f11={'status':_0x80fe61};var _0x29ae1a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1ccd49){_0x2a2f11[_0xbb43('0x9')]=_0x1ccd49;}return db['AnalyticExtractedReport'][_0xbb43('0xa')](_0x2a2f11,_0x29ae1a);}function main(){var _0xf54ac5=0x1388;var _0x5d5b11;logger[_0xbb43('0xb')](util[_0xbb43('0xc')](_0xbb43('0xd'),EXTRACTED_REPORT_ID,_0xbb43('0xe')));return db[_0xbb43('0xf')][_0xbb43('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xbb43('0x11')]})[_0xbb43('0x12')](function(_0x50e2c0){if(_0x50e2c0){_0x5d5b11=_0x50e2c0;_0xf54ac5=_0x5d5b11['splitSizeCsv']||0x1388;}})[_0xbb43('0x12')](function(){return dbH['sequelize']['query'](util[_0xbb43('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xbb43('0x13')][_0xbb43('0x14')]['SELECT']});})['then'](function(_0x4d5bcf){if(!_0x4d5bcf[0x0][_0xbb43('0x15')]){return analyticExtractedReport(_0xbb43('0x16'));}var _0x57bd1d=[];var _0x526330=0x0;var _0x202980=!![];if(_0x4d5bcf&&_0x4d5bcf['length']){var _0x5923dc=_0x4d5bcf[0x0][_0xbb43('0x15')]%(_0x526330+_0xf54ac5);if(_0x5d5b11[_0xbb43('0x17')]){for(;_0x202980;_0x526330+=_0xf54ac5,_0x5923dc=_0x4d5bcf[0x0][_0xbb43('0x15')]%(_0x526330+_0xf54ac5)){if(_0x5923dc==0x0||_0x5923dc==_0x4d5bcf[0x0]['num']){_0x202980=![];}_0x57bd1d[_0xbb43('0x18')](dbH['sequelize'][_0xbb43('0x19')](util[_0xbb43('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xf54ac5,_0x526330),{'type':dbH['sequelize'][_0xbb43('0x14')][_0xbb43('0x1a')]}));}}else{_0x57bd1d[_0xbb43('0x18')](dbH[_0xbb43('0x13')]['query'](QUERY,{'type':dbH[_0xbb43('0x13')]['QueryTypes'][_0xbb43('0x1a')]}));}}var _0x4bfaca=path[_0xbb43('0x1b')](PATH);var _0x565256=path[_0xbb43('0x1c')](PATH,_0xbb43('0x1d'));var _0x577ddd=_0x5d5b11[_0xbb43('0x17')]&&_0x57bd1d['length']>0x1;var _0xf24e60=[];if(!fs[_0xbb43('0x1e')](path[_0xbb43('0x1f')](_0x4bfaca,_0x565256))&&_0x577ddd){fs['mkdirSync'](path['join'](_0x4bfaca,_0x565256));}return BPromise['each'](_0x57bd1d,function(_0x269ca5){_0xf24e60[_0xbb43('0x18')](_0x269ca5);})['then'](function(){for(var _0x3b3083=0x0;_0x3b3083<_0xf24e60[_0xbb43('0x20')];_0x3b3083+=0x1){var _0x226827;var _0x3874fb=_0xf24e60[_0x3b3083];if(_0x577ddd){_0x226827=path['join'](_0x4bfaca,_0x565256,util['format'](_0xbb43('0x21'),_0x565256,_0x3b3083,_0xbb43('0x22')));}else{_0x226827=path[_0xbb43('0x1f')](_0x4bfaca,util[_0xbb43('0xc')](_0xbb43('0x23'),_0x565256,_0xbb43('0x22')));}fs[_0xbb43('0x24')](_0x226827,csv(_0x3874fb));}})[_0xbb43('0x12')](function(){if(_0x577ddd){zipdir(path['join'](_0x4bfaca,_0x565256),{'saveTo':path[_0xbb43('0x1f')](_0x4bfaca,util['format'](_0xbb43('0x23'),_0x565256,_0xbb43('0x25')))},function(_0x34f5b2,_0x1880cd){});rimraf(path['join'](_0x4bfaca,_0x565256),function(){});}})[_0xbb43('0x12')](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xbb43('0xe')));return analyticExtractedReport('Completed',_0x577ddd?util[_0xbb43('0xc')](_0xbb43('0x23'),_0x565256,_0x577ddd?_0xbb43('0x25'):'csv'):null);});})[_0xbb43('0x26')](function(_0x1bdf91){logger[_0xbb43('0xb')](util[_0xbb43('0xc')](_0xbb43('0x27'),EXTRACTED_REPORT_ID,_0xbb43('0xe')),util[_0xbb43('0x28')](_0x1bdf91,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb43('0x29'));});}main();
\ No newline at end of file
index 519c1eb..a23e663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x16ba76,_0x3cf3f9){var _0xd87418=function(_0x1a8628){while(--_0x1a8628){_0x16ba76['push'](_0x16ba76['shift']());}};_0xd87418(++_0x3cf3f9);}(_0xb10b,0x12a));var _0xbb10=function(_0x174202,_0x5c5292){_0x174202=_0x174202-0x0;var _0x4daa4a=_0xb10b[_0x174202];return _0x4daa4a;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main();
\ No newline at end of file
+var _0x5f2f=['hasOwnProperty','push','num','Empty','dirname','basename','Setting','find','split','splitSizePdf','then','length','query','format','QueryTypes','SELECT','sequelize','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','landscape','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','createWriteStream','finish','err','end','info','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x139bce,_0x135eaa){var _0x4c291d=function(_0x239962){while(--_0x239962){_0x139bce['push'](_0x139bce['shift']());}};_0x4c291d(++_0x135eaa);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5d7dc8,_0x14a0fc){_0x5d7dc8=_0x5d7dc8-0x0;var _0x4b99bb=_0x5f2f[_0x5d7dc8];return _0x4b99bb;};'use strict';var _=require(_0xf5f2('0x0'));var fs=require('fs');var BPromise=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var path=require(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var PdfPrinter=require(_0xf5f2('0x5'));var zipdir=require(_0xf5f2('0x6'));var rimraf=require(_0xf5f2('0x7'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf5f2('0x8')];var logger=require(_0xf5f2('0x9'))(_0xf5f2('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xf5f2('0xb')][0x2]);var QUERY=process[_0xf5f2('0xb')][0x3];var PATH=process[_0xf5f2('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf5f2('0xc');var _extractedReport;function analyticExtractedReport(_0x46cd9c,_0x2ec345){var _0x56a69f={'status':_0x46cd9c};var _0x375da4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ec345){_0x56a69f[_0xf5f2('0xd')]=_0x2ec345;}return db[_0xf5f2('0xe')]['update'](_0x56a69f,_0x375da4);}function getHeader(_0x977a59){var _0x4ebbbe=[];for(var _0x53fb33 in _0x977a59){if(_0x977a59[_0xf5f2('0xf')](_0x53fb33)){_0x4ebbbe[_0xf5f2('0x10')]({'text':_0x53fb33,'style':'tableHeader'});}}return _0x4ebbbe;}function extractReport(_0x336f6b){var _0x14b51f=0x1388;var _0x331482;if(!_0x336f6b[0x0][_0xf5f2('0x11')]){return analyticExtractedReport(_0xf5f2('0x12'));}var _0x3e5956=[];var _0x5c01b8=0x0;var _0x5850f4=!![];var _0xea612c=path[_0xf5f2('0x13')](PATH);var _0x1c1a5c=path[_0xf5f2('0x14')](PATH,'.pdf');var _0xafe430=![];var _0x286197=[];return db[_0xf5f2('0x15')][_0xf5f2('0x16')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf5f2('0x17'),_0xf5f2('0x18')]})[_0xf5f2('0x19')](function(_0x395a5a){if(_0x395a5a){_0x331482=_0x395a5a;_0x14b51f=_0x331482[_0xf5f2('0x18')]||0x3e8;}})[_0xf5f2('0x19')](function(){if(_0x336f6b&&_0x336f6b[_0xf5f2('0x1a')]){var _0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f);if(_0x331482[_0xf5f2('0x17')]){for(;_0x5850f4;_0x5c01b8+=_0x14b51f,_0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f)){if(_0x28e097==0x0||_0x28e097==_0x336f6b[0x0][_0xf5f2('0x11')]){_0x5850f4=![];}_0x3e5956[_0xf5f2('0x10')](dbH['sequelize'][_0xf5f2('0x1b')](util[_0xf5f2('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x14b51f,_0x5c01b8),{'type':dbH['sequelize'][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}else{_0x3e5956['push'](dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](QUERY,{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}_0xafe430=_0x331482['split']&&_0x3e5956[_0xf5f2('0x1a')]>0x1;if(!fs[_0xf5f2('0x20')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c))&&_0xafe430){fs[_0xf5f2('0x22')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c));}return BPromise['each'](_0x3e5956,function(_0x529f07){_0x286197[_0xf5f2('0x10')](_0x529f07);});})[_0xf5f2('0x19')](function(){return BPromise[_0xf5f2('0x23')](_0x3e5956,function(_0x1a5bb3,_0xf6c58d){var _0x788a8d;var _0x13a3be=util[_0xf5f2('0x1c')](_0xf5f2('0x24'),NAME,_extractedReport['name'],moment(_extractedReport[_0xf5f2('0x25')])[_0xf5f2('0x1c')](FORMAT),moment(_extractedReport[_0xf5f2('0x26')])[_0xf5f2('0x1c')](FORMAT));var _0x198c73={'pageSize':'A4','pageOrientation':_0xf5f2('0x27'),'content':[{'text':_0x13a3be,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x22c826={'headerRows':0x1,'body':[]};_0x22c826[_0xf5f2('0x28')][_0xf5f2('0x10')](getHeader(_0x1a5bb3[0x0]));var _0x5027ab;for(var _0x5a2c7e=0x0;_0x5a2c7e<_0x1a5bb3[_0xf5f2('0x1a')];_0x5a2c7e+=0x1){_0x5027ab=[];for(var _0x50b8a2 in _0x1a5bb3[_0x5a2c7e]){if(_0x1a5bb3[_0x5a2c7e][_0xf5f2('0xf')](_0x50b8a2)){_0x5027ab[_0xf5f2('0x10')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]?_[_0xf5f2('0x29')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]):'');}}_0x22c826['body']['push'](_0x5027ab);}_0x198c73[_0xf5f2('0x2a')]['push']({'table':_0x22c826});return new BPromise(function(_0xb744b9,_0x58a4df){var _0x45b643=new PdfPrinter({'Roboto':{'normal':__dirname+_0xf5f2('0x2b'),'bold':__dirname+_0xf5f2('0x2c'),'italics':__dirname+_0xf5f2('0x2d'),'bolditalics':__dirname+_0xf5f2('0x2e')}});var _0x277eee=_0x45b643[_0xf5f2('0x2f')](_0x198c73);if(_0xafe430){_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c,util['format'](_0xf5f2('0x30'),_0x1c1a5c,_0xf6c58d,_0xf5f2('0x31')));}else{_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xf5f2('0x31')));}var _0x297c0c=_0x277eee['pipe'](fs[_0xf5f2('0x33')](_0x788a8d));_0x297c0c['on'](_0xf5f2('0x34'),function(){_0xb744b9();});_0x297c0c['on']('error',function(_0x3fc168){console['log'](_0xf5f2('0x35'),_0x3fc168);_0x58a4df(_0x3fc168);});_0x277eee[_0xf5f2('0x36')]();});});})[_0xf5f2('0x19')](function(){if(_0xafe430){return new BPromise(function(_0x2e3cca,_0x59a6dd){zipdir(path['join'](_0xea612c,_0x1c1a5c),{'saveTo':path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,'zip'))},function(_0x41447f){if(_0x41447f){_0x59a6dd(_0x41447f);}else{_0x2e3cca();}});});}})['then'](function(){if(_0xafe430){rimraf(path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c),function(){});}})['then'](function(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf5f2('0x38')));return analyticExtractedReport(_0xf5f2('0x39'),_0xafe430?util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xafe430?'zip':'pdf'):null);});}function main(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')](_0xf5f2('0x3a'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')));return db[_0xf5f2('0xe')][_0xf5f2('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf5f2('0x19')](function(_0x4c0ac7){_extractedReport=_0x4c0ac7;return dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](util['format'](_0xf5f2('0x3d'),QUERY),{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]});})[_0xf5f2('0x19')](extractReport)[_0xf5f2('0x3e')](function(_0x462ea3){logger[_0xf5f2('0x37')](util['format'](_0xf5f2('0x3f'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')),util[_0xf5f2('0x40')](_0x462ea3,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main();
\ No newline at end of file
index b7f3f1f..f90efe2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bcf=['Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','xlsx','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','XLSX','Setting','splitSizeXlsx','then','sequelize','SELECT','num','Empty','split','query','push','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','length','writeFileSync','binary','%s.%s','zip'];(function(_0x3f7879,_0x32cca7){var _0x2817ac=function(_0x5e963e){while(--_0x5e963e){_0x3f7879['push'](_0x3f7879['shift']());}};_0x2817ac(++_0x32cca7);}(_0x8bcf,0x1be));var _0xf8bc=function(_0x193b5c,_0x8bd1f9){_0x193b5c=_0x193b5c-0x0;var _0x40c961=_0x8bcf[_0x193b5c];return _0x40c961;};'use strict';var util=require(_0xf8bc('0x0'));var path=require('path');var _=require(_0xf8bc('0x1'));var fs=require('fs');var json2xls=require(_0xf8bc('0x2'));var BPromise=require(_0xf8bc('0x3'));var zipdir=require(_0xf8bc('0x4'));var rimraf=require(_0xf8bc('0x5'));var db=require(_0xf8bc('0x6'))['db'];var dbH=require(_0xf8bc('0x6'))[_0xf8bc('0x7')];var logger=require(_0xf8bc('0x8'))(_0xf8bc('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xf8bc('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xf8bc('0xa')][0x4];function analyticExtractedReport(_0x3d2f85,_0x454a2f){var _0x37df5b={'status':_0x3d2f85};var _0x287723={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x454a2f){_0x37df5b['savename']=_0x454a2f;}return db[_0xf8bc('0xb')][_0xf8bc('0xc')](_0x37df5b,_0x287723);}function main(){var _0x5b656c=0x1388;var _0x437de3;logger[_0xf8bc('0xd')](util[_0xf8bc('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf8bc('0xf')));return db[_0xf8bc('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf8bc('0x11')]})[_0xf8bc('0x12')](function(_0x320946){if(_0x320946){_0x437de3=_0x320946;_0x5b656c=_0x437de3[_0xf8bc('0x11')]||0x1388;}})[_0xf8bc('0x12')](function(){return dbH[_0xf8bc('0x13')]['query'](util[_0xf8bc('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xf8bc('0x13')]['QueryTypes'][_0xf8bc('0x14')]});})[_0xf8bc('0x12')](function(_0x52be1f){if(!_0x52be1f[0x0][_0xf8bc('0x15')]){return analyticExtractedReport(_0xf8bc('0x16'));}var _0x2f31b0=[];var _0x10ad98=0x0;var _0x146ffe=!![];if(_0x437de3[_0xf8bc('0x17')]){if(_0x52be1f&&_0x52be1f['length']){var _0x3a2f98=_0x52be1f[0x0][_0xf8bc('0x15')]%(_0x10ad98+_0x5b656c);for(;_0x146ffe;_0x10ad98+=_0x5b656c,_0x3a2f98=_0x52be1f[0x0][_0xf8bc('0x15')]%(_0x10ad98+_0x5b656c)){if(_0x3a2f98==0x0||_0x3a2f98==_0x52be1f[0x0][_0xf8bc('0x15')]){_0x146ffe=![];}_0x2f31b0['push'](dbH[_0xf8bc('0x13')][_0xf8bc('0x18')](util[_0xf8bc('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5b656c,_0x10ad98),{'type':dbH[_0xf8bc('0x13')]['QueryTypes'][_0xf8bc('0x14')]}));}}}else{_0x2f31b0[_0xf8bc('0x19')](dbH[_0xf8bc('0x13')][_0xf8bc('0x18')](QUERY,{'type':dbH[_0xf8bc('0x13')]['QueryTypes'][_0xf8bc('0x14')]}));}var _0x1a531e=path[_0xf8bc('0x1a')](PATH);var _0x4169a2=path[_0xf8bc('0x1b')](PATH,_0xf8bc('0x1c'));var _0x4459a2=_0x437de3['split']&&_0x2f31b0['length']>0x1;var _0x211715=[];if(!fs[_0xf8bc('0x1d')](path[_0xf8bc('0x1e')](_0x1a531e,_0x4169a2))&&_0x4459a2){fs[_0xf8bc('0x1f')](path[_0xf8bc('0x1e')](_0x1a531e,_0x4169a2));}return BPromise[_0xf8bc('0x20')](_0x2f31b0,function(_0x4457fc){_0x211715[_0xf8bc('0x19')](_0x4457fc);})[_0xf8bc('0x12')](function(){for(var _0x5a5d44=0x0;_0x5a5d44<_0x211715[_0xf8bc('0x21')];_0x5a5d44+=0x1){var _0x24bfba;var _0x34f569=_0x211715[_0x5a5d44];if(_0x4459a2){_0x24bfba=path['join'](_0x1a531e,_0x4169a2,util['format']('%s%d.%s',_0x4169a2,_0x5a5d44,'xlsx'));}else{_0x24bfba=path['join'](_0x1a531e,util['format']('%s.%s',_0x4169a2,'xlsx'));}fs[_0xf8bc('0x22')](_0x24bfba,json2xls(_0x34f569),_0xf8bc('0x23'));}})[_0xf8bc('0x12')](function(){if(_0x4459a2){zipdir(path[_0xf8bc('0x1e')](_0x1a531e,_0x4169a2),{'saveTo':path[_0xf8bc('0x1e')](_0x1a531e,util['format'](_0xf8bc('0x24'),_0x4169a2,_0xf8bc('0x25')))},function(_0x2cd54d,_0x233c0b){});rimraf(path[_0xf8bc('0x1e')](_0x1a531e,_0x4169a2),function(){});}})['then'](function(){logger['info'](util[_0xf8bc('0xe')](_0xf8bc('0x26'),EXTRACTED_REPORT_ID,_0xf8bc('0xf')));return analyticExtractedReport(_0xf8bc('0x27'),_0x4459a2?util[_0xf8bc('0xe')](_0xf8bc('0x24'),_0x4169a2,_0x4459a2?'zip':_0xf8bc('0x28')):null);});})['catch'](function(_0x1eba5e){logger[_0xf8bc('0xd')](util['format'](_0xf8bc('0x29'),EXTRACTED_REPORT_ID,_0xf8bc('0xf')),util[_0xf8bc('0x2a')](_0x1eba5e,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xf8bc('0x2b'));});}main();
\ No newline at end of file
+var _0xc5c6=['%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','lodash','json2xls','bluebird','../../mysqldb','dbH','../../config/logger','argv','savename','update','info','XLSX','Setting','find','split','splitSizeXlsx','then','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','push'];(function(_0x14490c,_0x50e8ab){var _0x2f6825=function(_0x477b03){while(--_0x477b03){_0x14490c['push'](_0x14490c['shift']());}};_0x2f6825(++_0x50e8ab);}(_0xc5c6,0x184));var _0x6c5c=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xc5c6[_0x29d915];return _0x160f86;};'use strict';var util=require('util');var path=require(_0x6c5c('0x0'));var _=require(_0x6c5c('0x1'));var fs=require('fs');var json2xls=require(_0x6c5c('0x2'));var BPromise=require(_0x6c5c('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x6c5c('0x4'))['db'];var dbH=require(_0x6c5c('0x4'))[_0x6c5c('0x5')];var logger=require(_0x6c5c('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6c5c('0x7')][0x2]);var QUERY=process[_0x6c5c('0x7')][0x3];var PATH=process[_0x6c5c('0x7')][0x4];function analyticExtractedReport(_0x5e7603,_0x21ecfc){var _0x2d3b3f={'status':_0x5e7603};var _0x1266fc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x21ecfc){_0x2d3b3f[_0x6c5c('0x8')]=_0x21ecfc;}return db['AnalyticExtractedReport'][_0x6c5c('0x9')](_0x2d3b3f,_0x1266fc);}function main(){var _0x5a690d=0x1388;var _0xdf41bb;logger[_0x6c5c('0xa')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6c5c('0xb')));return db[_0x6c5c('0xc')][_0x6c5c('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6c5c('0xe'),_0x6c5c('0xf')]})[_0x6c5c('0x10')](function(_0x3d3c7b){if(_0x3d3c7b){_0xdf41bb=_0x3d3c7b;_0x5a690d=_0xdf41bb[_0x6c5c('0xf')]||0x1388;}})[_0x6c5c('0x10')](function(){return dbH['sequelize']['query'](util[_0x6c5c('0x11')](_0x6c5c('0x12'),QUERY),{'type':dbH[_0x6c5c('0x13')][_0x6c5c('0x14')][_0x6c5c('0x15')]});})[_0x6c5c('0x10')](function(_0x509e08){if(!_0x509e08[0x0][_0x6c5c('0x16')]){return analyticExtractedReport(_0x6c5c('0x17'));}var _0x197586=[];var _0x1af7ce=0x0;var _0x3dbc91=!![];if(_0xdf41bb[_0x6c5c('0xe')]){if(_0x509e08&&_0x509e08[_0x6c5c('0x18')]){var _0x3b50dd=_0x509e08[0x0][_0x6c5c('0x16')]%(_0x1af7ce+_0x5a690d);for(;_0x3dbc91;_0x1af7ce+=_0x5a690d,_0x3b50dd=_0x509e08[0x0][_0x6c5c('0x16')]%(_0x1af7ce+_0x5a690d)){if(_0x3b50dd==0x0||_0x3b50dd==_0x509e08[0x0][_0x6c5c('0x16')]){_0x3dbc91=![];}_0x197586['push'](dbH[_0x6c5c('0x13')][_0x6c5c('0x19')](util['format'](_0x6c5c('0x1a'),QUERY,_0x5a690d,_0x1af7ce),{'type':dbH[_0x6c5c('0x13')]['QueryTypes'][_0x6c5c('0x15')]}));}}}else{_0x197586['push'](dbH[_0x6c5c('0x13')][_0x6c5c('0x19')](QUERY,{'type':dbH[_0x6c5c('0x13')][_0x6c5c('0x14')][_0x6c5c('0x15')]}));}var _0x2bce16=path[_0x6c5c('0x1b')](PATH);var _0x3d48f4=path[_0x6c5c('0x1c')](PATH,_0x6c5c('0x1d'));var _0x47b142=_0xdf41bb[_0x6c5c('0xe')]&&_0x197586[_0x6c5c('0x18')]>0x1;var _0x2de33c=[];if(!fs[_0x6c5c('0x1e')](path[_0x6c5c('0x1f')](_0x2bce16,_0x3d48f4))&&_0x47b142){fs[_0x6c5c('0x20')](path[_0x6c5c('0x1f')](_0x2bce16,_0x3d48f4));}return BPromise[_0x6c5c('0x21')](_0x197586,function(_0x37fd9){_0x2de33c[_0x6c5c('0x22')](_0x37fd9);})[_0x6c5c('0x10')](function(){for(var _0x1846fe=0x0;_0x1846fe<_0x2de33c[_0x6c5c('0x18')];_0x1846fe+=0x1){var _0x2b62c5;var _0x2e9022=_0x2de33c[_0x1846fe];if(_0x47b142){_0x2b62c5=path[_0x6c5c('0x1f')](_0x2bce16,_0x3d48f4,util[_0x6c5c('0x11')](_0x6c5c('0x23'),_0x3d48f4,_0x1846fe,_0x6c5c('0x24')));}else{_0x2b62c5=path[_0x6c5c('0x1f')](_0x2bce16,util[_0x6c5c('0x11')]('%s.%s',_0x3d48f4,_0x6c5c('0x24')));}fs[_0x6c5c('0x25')](_0x2b62c5,json2xls(_0x2e9022),_0x6c5c('0x26'));}})['then'](function(){if(_0x47b142){zipdir(path[_0x6c5c('0x1f')](_0x2bce16,_0x3d48f4),{'saveTo':path['join'](_0x2bce16,util['format'](_0x6c5c('0x27'),_0x3d48f4,_0x6c5c('0x28')))},function(_0x4bcb62,_0x379433){});rimraf(path[_0x6c5c('0x1f')](_0x2bce16,_0x3d48f4),function(){});}})[_0x6c5c('0x10')](function(){logger[_0x6c5c('0xa')](util[_0x6c5c('0x11')](_0x6c5c('0x29'),EXTRACTED_REPORT_ID,_0x6c5c('0xb')));return analyticExtractedReport(_0x6c5c('0x2a'),_0x47b142?util[_0x6c5c('0x11')](_0x6c5c('0x27'),_0x3d48f4,_0x47b142?_0x6c5c('0x28'):_0x6c5c('0x24')):null);});})[_0x6c5c('0x2b')](function(_0x1b44fa){logger[_0x6c5c('0xa')](util[_0x6c5c('0x11')](_0x6c5c('0x2c'),EXTRACTED_REPORT_ID,_0x6c5c('0xb')),util[_0x6c5c('0x2d')](_0x1b44fa,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x6c5c('0x2e'));});}main();
\ No newline at end of file
index 94d474a..9efc21c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46f0=['splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','util','Interval','then','VoiceExtension','findAll','IntervalId','models','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','find','extensions','type','Set','format','CDR(type)=%s','VoiceExtensionId','outbound','push','CDR(destination)=','extension','cutdigits','${EXTEN}','context','CDR(routeid)=','ExecIf','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','intervals','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1'];(function(_0x56730a,_0x9055fb){var _0x12125a=function(_0x298fe6){while(--_0x298fe6){_0x56730a['push'](_0x56730a['shift']());}};_0x12125a(++_0x9055fb);}(_0x46f0,0x1a7));var _0x046f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46f0[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x046f('0x0'));function rewrite(_0x235819,_0x9a4ff5){var _0x104c05=this;return _0x235819['models'][_0x046f('0x1')]['findAll']({'raw':!![]})[_0x046f('0x2')](function(_0x1cb4a1){_0x104c05['intervals']=_0x1cb4a1;return _0x235819['models'][_0x046f('0x3')][_0x046f('0x4')]({'where':{'IntervalId':_0x9a4ff5[_0x046f('0x5')]},'raw':!![]});})[_0x046f('0x2')](function(_0x57930f){return _0x235819[_0x046f('0x6')][_0x046f('0x3')][_0x046f('0x4')]({'where':{'exten':{'$in':_[_0x046f('0x7')](_[_0x046f('0x8')](_0x57930f,_0x046f('0x9')))}},'order':[{'raw':_0x046f('0xa')}],'raw':!![]});})[_0x046f('0x2')](function(_0x27c9f2){var _0x1f556f=_[_0x046f('0xb')](_0x27c9f2,{'priority':'1'});var _0x16ee3c=_[_0x046f('0xb')](_0x27c9f2,{'isApp':0x1});var _0x2dfc81=_[_0x046f('0xc')](_0x16ee3c,'exten');var _0x2fa862=[_0x046f('0xd'),_0x046f('0xe')];var _0x81a26d=[];var _0x574460=[];for(var _0x38a2a8 in _0x2dfc81){if(_0x2dfc81['hasOwnProperty'](_0x38a2a8)){_0x104c05[_0x046f('0xf')]=0x2;_0x104c05['extensions']=[];_0x104c05['extension']=_[_0x046f('0x10')](_0x1f556f,{'exten':_0x2dfc81[_0x38a2a8][0x0]['exten']});_0x104c05[_0x046f('0x11')]['push']({'type':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x12')],'app':_0x046f('0x13'),'appdata':util[_0x046f('0x14')](_0x046f('0x15'),_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x12')]),'context':_0x2dfc81[_0x38a2a8][0x0]['context'],'exten':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x9')],'priority':_0x104c05[_0x046f('0xf')]++,'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')]});if(_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x12')]===_0x046f('0x17')){if(_0x104c05['extension']){_0x104c05[_0x046f('0x11')][_0x046f('0x18')]({'type':_0x2dfc81[_0x38a2a8][0x0]['type'],'app':_0x046f('0x13'),'appdata':_0x046f('0x19')+(_0x104c05[_0x046f('0x1a')][_0x046f('0x1b')]?'${EXTEN:'+_0x104c05[_0x046f('0x1a')][_0x046f('0x1b')]+'}':_0x046f('0x1c')),'context':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x1d')],'exten':_0x2dfc81[_0x38a2a8][0x0]['exten'],'priority':_0x104c05[_0x046f('0xf')]++,'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')]});}_0x104c05['extensions'][_0x046f('0x18')]({'type':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x12')],'app':_0x046f('0x13'),'appdata':_0x046f('0x1e')+_0x2dfc81[_0x38a2a8][0x0]['VoiceExtensionId'],'context':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x1d')],'exten':_0x2dfc81[_0x38a2a8][0x0]['exten'],'priority':_0x104c05[_0x046f('0xf')]++,'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')]});var _0xca550c=_0x104c05[_0x046f('0xf')]++;_0x104c05[_0x046f('0x11')][_0x046f('0x18')]({'type':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x12')],'app':_0x046f('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0xca550c+0x2)+'):Goto('+(_0xca550c+0x1)+')','context':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x1d')],'exten':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x9')],'priority':_0xca550c,'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0]['VoiceExtensionId']});if(_0x104c05['extension']){_0x104c05[_0x046f('0x11')]['push']({'type':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x12')],'app':'Set','appdata':_0x104c05[_0x046f('0x1a')][_0x046f('0x1b')]?_0x046f('0x20')+_0x104c05[_0x046f('0x1a')][_0x046f('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x2dfc81[_0x38a2a8][0x0]['context'],'exten':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x9')],'priority':_0x104c05['priority']++,'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')]});}_0x104c05[_0x046f('0x11')][_0x046f('0x18')]({'type':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x12')],'app':_0x046f('0x13'),'appdata':_0x046f('0x21')+_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')],'context':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x1d')],'exten':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x9')],'priority':_0x104c05['priority']++,'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')]});if(_0x104c05['extension']&&_0x104c05[_0x046f('0x1a')][_0x046f('0x22')](_0x046f('0x23'))&&_0x104c05[_0x046f('0x1a')][_0x046f('0x23')]!==_0x046f('0x24')){_0x104c05[_0x046f('0x11')]['push']({'type':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x12')],'app':'Set','appdata':_0x046f('0x25'),'context':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x1d')],'exten':_0x2dfc81[_0x38a2a8][0x0]['exten'],'priority':_0x104c05['priority']++,'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')]});_0x104c05[_0x046f('0x11')][_0x046f('0x18')]({'type':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x12')],'app':_0x046f('0x13'),'appdata':_0x046f('0x26')+_0x104c05[_0x046f('0x1a')][_0x046f('0x23')]||_0x046f('0x27'),'context':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x1d')],'exten':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x9')],'priority':_0x104c05[_0x046f('0xf')]++,'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')]});}}_0x104c05[_0x046f('0x11')][_0x046f('0x18')]({'type':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x12')],'app':_0x046f('0x13'),'appdata':_0x046f('0x28'),'context':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x1d')],'exten':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x9')],'priority':_0x104c05[_0x046f('0xf')]++,'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')]});_0x104c05[_0x046f('0x11')]['push']({'type':_0x2dfc81[_0x38a2a8][0x0]['type'],'app':_0x046f('0x13'),'appdata':_0x046f('0x29'),'context':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x1d')],'exten':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x9')],'priority':_0x104c05['priority']++,'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')]});_0x104c05[_0x046f('0x11')][_0x046f('0x18')]({'type':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x12')],'app':'Set','appdata':_0x046f('0x2a'),'context':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x1d')],'exten':_0x2dfc81[_0x38a2a8][0x0]['exten'],'priority':_0x104c05[_0x046f('0xf')]++,'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')]});for(var _0x4c92bc=0x0,_0x40e508=0x0;_0x4c92bc<_0x2dfc81[_0x38a2a8][_0x046f('0x2b')];_0x4c92bc+=0x1,_0x40e508=0x0){var _0x33b411=_0x2dfc81[_0x38a2a8][_0x4c92bc];if(_0x33b411[_0x046f('0x12')]){_0x33b411['type']=_0x33b411[_0x046f('0x12')][_0x046f('0x2c')]();}var _0x52dabf=[];var _0x287528=[];delete _0x33b411['id'];delete _0x33b411[_0x046f('0x2d')];delete _0x33b411['updatedAt'];var _0x30922e=_0x33b411[_0x046f('0x2e')]!==_0x046f('0x2f')?[_0x33b411[_0x046f('0x2e')]]:_0x33b411[_0x046f('0x5')]?_['map'](_[_0x046f('0xb')](_0x104c05[_0x046f('0x30')],{'IntervalId':_0x33b411['IntervalId']}),_0x046f('0x2e')):[];if(_0x33b411[_0x046f('0x22')](_0x046f('0x31'))){if(_0x33b411[_0x046f('0x31')]&&_0x33b411[_0x046f('0x31')]!=='--'){_0x52dabf[_0x046f('0x18')]({'type':_0x33b411[_0x046f('0x12')],'app':_0x046f('0x13'),'appdata':'CDR(tag)='+_0x33b411['tag'],'context':_0x33b411[_0x046f('0x1d')],'exten':_0x33b411[_0x046f('0x9')],'priority':_0x30922e[_0x046f('0x2b')]+_0x104c05[_0x046f('0xf')]+_0x40e508++,'VoiceExtensionId':_0x33b411[_0x046f('0x16')]});}}if(_0x33b411[_0x046f('0x12')]===_0x046f('0x17')&&_0x33b411[_0x046f('0x22')](_0x046f('0x32'))){if(_0x33b411['callerID']){_0x52dabf['push']({'type':_0x33b411[_0x046f('0x12')],'app':'ExecIf','appdata':_0x046f('0x33')+_0x33b411[_0x046f('0x32')]+')','context':_0x33b411['context'],'exten':_0x33b411[_0x046f('0x9')],'priority':_0x30922e[_0x046f('0x2b')]+_0x104c05[_0x046f('0xf')]+_0x40e508++,'VoiceExtensionId':_0x33b411[_0x046f('0x16')]});}else{_0x52dabf[_0x046f('0x18')]({'type':_0x33b411['type'],'app':_0x046f('0x1f'),'appdata':_0x046f('0x34'),'context':_0x33b411[_0x046f('0x1d')],'exten':_0x33b411['exten'],'priority':_0x30922e[_0x046f('0x2b')]+_0x104c05[_0x046f('0xf')]+_0x40e508++,'VoiceExtensionId':_0x33b411[_0x046f('0x16')]});}}if(_0x33b411[_0x046f('0x22')](_0x046f('0x35'))){if(_0x2fa862[_0x046f('0x36')](_0x33b411['app']['toLowerCase']())>=0x0&&_0x33b411[_0x046f('0x37')]!==_0x046f('0x38')){if(_0x33b411['answer']){_0x52dabf[_0x046f('0x18')]({'type':_0x33b411[_0x046f('0x12')],'app':_0x046f('0x1f'),'appdata':_0x046f('0x39'),'context':_0x33b411[_0x046f('0x1d')],'exten':_0x33b411[_0x046f('0x9')],'priority':_0x30922e[_0x046f('0x2b')]+_0x104c05[_0x046f('0xf')]+_0x40e508++,'VoiceExtensionId':_0x33b411[_0x046f('0x16')]});_0x52dabf[_0x046f('0x18')]({'type':_0x33b411[_0x046f('0x12')],'app':_0x046f('0x13'),'appdata':_0x046f('0x3a'),'context':_0x33b411[_0x046f('0x1d')],'exten':_0x33b411['exten'],'priority':_0x30922e[_0x046f('0x2b')]+_0x104c05[_0x046f('0xf')]+_0x40e508++,'VoiceExtensionId':_0x33b411[_0x046f('0x16')]});}else{_0x52dabf[_0x046f('0x18')]({'type':_0x33b411['type'],'app':_0x046f('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x33b411[_0x046f('0x1d')],'exten':_0x33b411[_0x046f('0x9')],'priority':_0x30922e[_0x046f('0x2b')]+_0x104c05[_0x046f('0xf')]+_0x40e508++,'VoiceExtensionId':_0x33b411[_0x046f('0x16')]});_0x52dabf[_0x046f('0x18')]({'type':_0x33b411[_0x046f('0x12')],'app':_0x046f('0x13'),'appdata':_0x046f('0x3b'),'context':_0x33b411[_0x046f('0x1d')],'exten':_0x33b411[_0x046f('0x9')],'priority':_0x30922e[_0x046f('0x2b')]+_0x104c05[_0x046f('0xf')]+_0x40e508++,'VoiceExtensionId':_0x33b411[_0x046f('0x16')]});}}}for(var _0x1362d5=0x0;_0x1362d5<_0x30922e[_0x046f('0x2b')];_0x1362d5+=0x1){var _0x225f54=_0x104c05['priority']+_0x30922e['length'];var _0x33b7d1=_0x1362d5===_0x30922e['length']-0x1?_0x104c05[_0x046f('0xf')]+_0x52dabf[_0x046f('0x2b')]+_0x287528[_0x046f('0x2b')]+0x2:_0x104c05[_0x046f('0xf')]+_0x1362d5+0x1;_0x52dabf[_0x046f('0x3c')](_0x1362d5,0x0,{'type':_0x33b411['type'],'app':_0x046f('0x3d'),'appdata':_0x30922e[_0x1362d5]+'?'+_0x33b411[_0x046f('0x1d')]+_0x046f('0x3e')+_0x225f54+':'+_0x33b411[_0x046f('0x1d')]+',${EXTEN},'+_0x33b7d1,'exten':_0x33b411[_0x046f('0x9')],'context':_0x33b411[_0x046f('0x1d')],'priority':_0x104c05[_0x046f('0xf')]+_0x1362d5,'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')]});}_0x33b411[_0x046f('0xf')]=_0x52dabf[_0x046f('0x2b')]?_[_0x046f('0x3f')](_0x52dabf)['priority']+0x1:_0x104c05[_0x046f('0xf')];_0x104c05[_0x046f('0xf')]=(_0x287528[_0x046f('0x2b')]?_[_0x046f('0x3f')](_0x287528)[_0x046f('0xf')]:_0x33b411[_0x046f('0xf')])+0x1;_0x104c05[_0x046f('0x11')]=_[_0x046f('0x40')](_0x104c05[_0x046f('0x11')],_0x52dabf,[_0x33b411],_0x287528);}_0x104c05[_0x046f('0x11')][_0x046f('0x18')]({'type':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x12')],'app':_0x046f('0x41'),'exten':_0x2dfc81[_0x38a2a8][0x0]['exten'],'context':_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x1d')],'priority':_0x104c05[_0x046f('0xf')],'VoiceExtensionId':_0x2dfc81[_0x38a2a8][0x0]['VoiceExtensionId']});_0x81a26d['push'](_0x2dfc81[_0x38a2a8][0x0][_0x046f('0x16')]);_0x574460=_[_0x046f('0x40')](_0x574460,_0x104c05[_0x046f('0x11')]);}}return _0x235819[_0x046f('0x42')](function(_0x34252e){return _0x235819['models']['VoiceExtension'][_0x046f('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x81a26d}},'transaction':_0x34252e})[_0x046f('0x2')](function(_0x46e946){return _0x235819[_0x046f('0x6')][_0x046f('0x3')]['bulkCreate'](_[_0x046f('0x44')](_0x574460,_0x046f('0xf')),{'transaction':_0x34252e});});});})['catch'](function(_0x5880d7){console['error'](_0x5880d7);});}exports['rewrite']=rewrite;
\ No newline at end of file
+var _0xd030=['recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','Hangup','transaction','destroy','bulkCreate','catch','error','util','models','Interval','findAll','then','intervals','VoiceExtension','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extension','find','extensions','type','Set','format','context','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN}','push','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:'];(function(_0x105896,_0x2b1b8e){var _0x397ad0=function(_0xa176ec){while(--_0xa176ec){_0x105896['push'](_0x105896['shift']());}};_0x397ad0(++_0x2b1b8e);}(_0xd030,0x16c));var _0x0d03=function(_0x5e495f,_0x21fd3e){_0x5e495f=_0x5e495f-0x0;var _0x3e2d26=_0xd030[_0x5e495f];return _0x3e2d26;};'use strict';var _=require('lodash');var util=require(_0x0d03('0x0'));function rewrite(_0x575392,_0x3407ef){var _0x16403d=this;return _0x575392[_0x0d03('0x1')][_0x0d03('0x2')][_0x0d03('0x3')]({'raw':!![]})[_0x0d03('0x4')](function(_0x2aba51){_0x16403d[_0x0d03('0x5')]=_0x2aba51;return _0x575392['models'][_0x0d03('0x6')][_0x0d03('0x3')]({'where':{'IntervalId':_0x3407ef['IntervalId']},'raw':!![]});})[_0x0d03('0x4')](function(_0x522f3c){return _0x575392[_0x0d03('0x1')][_0x0d03('0x6')][_0x0d03('0x3')]({'where':{'exten':{'$in':_['uniq'](_['map'](_0x522f3c,'exten'))}},'order':[{'raw':_0x0d03('0x7')}],'raw':!![]});})[_0x0d03('0x4')](function(_0x290817){var _0x20fdb3=_[_0x0d03('0x8')](_0x290817,{'priority':'1'});var _0x1ddd6f=_[_0x0d03('0x8')](_0x290817,{'isApp':0x1});var _0x370096=_[_0x0d03('0x9')](_0x1ddd6f,_0x0d03('0xa'));var _0x59adf5=[_0x0d03('0xb'),_0x0d03('0xc')];var _0x298b00=[];var _0x485370=[];for(var _0x292863 in _0x370096){if(_0x370096[_0x0d03('0xd')](_0x292863)){_0x16403d[_0x0d03('0xe')]=0x2;_0x16403d['extensions']=[];_0x16403d[_0x0d03('0xf')]=_[_0x0d03('0x10')](_0x20fdb3,{'exten':_0x370096[_0x292863][0x0][_0x0d03('0xa')]});_0x16403d[_0x0d03('0x11')]['push']({'type':_0x370096[_0x292863][0x0][_0x0d03('0x12')],'app':_0x0d03('0x13'),'appdata':util[_0x0d03('0x14')]('CDR(type)=%s',_0x370096[_0x292863][0x0][_0x0d03('0x12')]),'context':_0x370096[_0x292863][0x0][_0x0d03('0x15')],'exten':_0x370096[_0x292863][0x0][_0x0d03('0xa')],'priority':_0x16403d[_0x0d03('0xe')]++,'VoiceExtensionId':_0x370096[_0x292863][0x0][_0x0d03('0x16')]});if(_0x370096[_0x292863][0x0][_0x0d03('0x12')]===_0x0d03('0x17')){if(_0x16403d[_0x0d03('0xf')]){_0x16403d[_0x0d03('0x11')]['push']({'type':_0x370096[_0x292863][0x0][_0x0d03('0x12')],'app':_0x0d03('0x13'),'appdata':_0x0d03('0x18')+(_0x16403d['extension'][_0x0d03('0x19')]?'${EXTEN:'+_0x16403d[_0x0d03('0xf')][_0x0d03('0x19')]+'}':_0x0d03('0x1a')),'context':_0x370096[_0x292863][0x0][_0x0d03('0x15')],'exten':_0x370096[_0x292863][0x0][_0x0d03('0xa')],'priority':_0x16403d[_0x0d03('0xe')]++,'VoiceExtensionId':_0x370096[_0x292863][0x0][_0x0d03('0x16')]});}_0x16403d[_0x0d03('0x11')][_0x0d03('0x1b')]({'type':_0x370096[_0x292863][0x0][_0x0d03('0x12')],'app':'Set','appdata':_0x0d03('0x1c')+_0x370096[_0x292863][0x0]['VoiceExtensionId'],'context':_0x370096[_0x292863][0x0][_0x0d03('0x15')],'exten':_0x370096[_0x292863][0x0]['exten'],'priority':_0x16403d[_0x0d03('0xe')]++,'VoiceExtensionId':_0x370096[_0x292863][0x0]['VoiceExtensionId']});var _0x507ef7=_0x16403d[_0x0d03('0xe')]++;_0x16403d['extensions'][_0x0d03('0x1b')]({'type':_0x370096[_0x292863][0x0][_0x0d03('0x12')],'app':'ExecIf','appdata':_0x0d03('0x1d')+(_0x507ef7+0x2)+_0x0d03('0x1e')+(_0x507ef7+0x1)+')','context':_0x370096[_0x292863][0x0]['context'],'exten':_0x370096[_0x292863][0x0][_0x0d03('0xa')],'priority':_0x507ef7,'VoiceExtensionId':_0x370096[_0x292863][0x0][_0x0d03('0x16')]});if(_0x16403d[_0x0d03('0xf')]){_0x16403d[_0x0d03('0x11')][_0x0d03('0x1b')]({'type':_0x370096[_0x292863][0x0][_0x0d03('0x12')],'app':'Set','appdata':_0x16403d[_0x0d03('0xf')][_0x0d03('0x19')]?_0x0d03('0x1f')+_0x16403d[_0x0d03('0xf')][_0x0d03('0x19')]+'}':'CDR(prefix)=noprefix','context':_0x370096[_0x292863][0x0]['context'],'exten':_0x370096[_0x292863][0x0]['exten'],'priority':_0x16403d[_0x0d03('0xe')]++,'VoiceExtensionId':_0x370096[_0x292863][0x0][_0x0d03('0x16')]});}_0x16403d[_0x0d03('0x11')][_0x0d03('0x1b')]({'type':_0x370096[_0x292863][0x0]['type'],'app':_0x0d03('0x13'),'appdata':'outboundrouteid='+_0x370096[_0x292863][0x0][_0x0d03('0x16')],'context':_0x370096[_0x292863][0x0][_0x0d03('0x15')],'exten':_0x370096[_0x292863][0x0]['exten'],'priority':_0x16403d[_0x0d03('0xe')]++,'VoiceExtensionId':_0x370096[_0x292863][0x0][_0x0d03('0x16')]});if(_0x16403d['extension']&&_0x16403d['extension'][_0x0d03('0xd')](_0x0d03('0x20'))&&_0x16403d[_0x0d03('0xf')]['recordingFormat']!=='none'){_0x16403d[_0x0d03('0x11')][_0x0d03('0x1b')]({'type':_0x370096[_0x292863][0x0]['type'],'app':'Set','appdata':_0x0d03('0x21'),'context':_0x370096[_0x292863][0x0][_0x0d03('0x15')],'exten':_0x370096[_0x292863][0x0][_0x0d03('0xa')],'priority':_0x16403d[_0x0d03('0xe')]++,'VoiceExtensionId':_0x370096[_0x292863][0x0]['VoiceExtensionId']});_0x16403d[_0x0d03('0x11')][_0x0d03('0x1b')]({'type':_0x370096[_0x292863][0x0]['type'],'app':_0x0d03('0x13'),'appdata':_0x0d03('0x22')+_0x16403d[_0x0d03('0xf')][_0x0d03('0x20')]||_0x0d03('0x23'),'context':_0x370096[_0x292863][0x0][_0x0d03('0x15')],'exten':_0x370096[_0x292863][0x0][_0x0d03('0xa')],'priority':_0x16403d['priority']++,'VoiceExtensionId':_0x370096[_0x292863][0x0][_0x0d03('0x16')]});}}_0x16403d[_0x0d03('0x11')][_0x0d03('0x1b')]({'type':_0x370096[_0x292863][0x0][_0x0d03('0x12')],'app':_0x0d03('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x370096[_0x292863][0x0][_0x0d03('0x15')],'exten':_0x370096[_0x292863][0x0]['exten'],'priority':_0x16403d['priority']++,'VoiceExtensionId':_0x370096[_0x292863][0x0]['VoiceExtensionId']});_0x16403d[_0x0d03('0x11')]['push']({'type':_0x370096[_0x292863][0x0][_0x0d03('0x12')],'app':'Set','appdata':_0x0d03('0x24'),'context':_0x370096[_0x292863][0x0][_0x0d03('0x15')],'exten':_0x370096[_0x292863][0x0]['exten'],'priority':_0x16403d[_0x0d03('0xe')]++,'VoiceExtensionId':_0x370096[_0x292863][0x0]['VoiceExtensionId']});_0x16403d[_0x0d03('0x11')][_0x0d03('0x1b')]({'type':_0x370096[_0x292863][0x0]['type'],'app':_0x0d03('0x13'),'appdata':_0x0d03('0x25'),'context':_0x370096[_0x292863][0x0][_0x0d03('0x15')],'exten':_0x370096[_0x292863][0x0][_0x0d03('0xa')],'priority':_0x16403d[_0x0d03('0xe')]++,'VoiceExtensionId':_0x370096[_0x292863][0x0][_0x0d03('0x16')]});for(var _0x5eae8e=0x0,_0xe38f06=0x0;_0x5eae8e<_0x370096[_0x292863][_0x0d03('0x26')];_0x5eae8e+=0x1,_0xe38f06=0x0){var _0x44407e=_0x370096[_0x292863][_0x5eae8e];if(_0x44407e[_0x0d03('0x12')]){_0x44407e[_0x0d03('0x12')]=_0x44407e[_0x0d03('0x12')][_0x0d03('0x27')]();}var _0x47dc85=[];var _0x33be48=[];delete _0x44407e['id'];delete _0x44407e[_0x0d03('0x28')];delete _0x44407e[_0x0d03('0x29')];var _0x2806eb=_0x44407e['interval']!=='*,*,*,*'?[_0x44407e[_0x0d03('0x2a')]]:_0x44407e[_0x0d03('0x2b')]?_['map'](_[_0x0d03('0x8')](_0x16403d[_0x0d03('0x5')],{'IntervalId':_0x44407e[_0x0d03('0x2b')]}),_0x0d03('0x2a')):[];if(_0x44407e[_0x0d03('0xd')](_0x0d03('0x2c'))){if(_0x44407e[_0x0d03('0x2c')]&&_0x44407e[_0x0d03('0x2c')]!=='--'){_0x47dc85[_0x0d03('0x1b')]({'type':_0x44407e[_0x0d03('0x12')],'app':_0x0d03('0x13'),'appdata':_0x0d03('0x2d')+_0x44407e[_0x0d03('0x2c')],'context':_0x44407e[_0x0d03('0x15')],'exten':_0x44407e[_0x0d03('0xa')],'priority':_0x2806eb[_0x0d03('0x26')]+_0x16403d['priority']+_0xe38f06++,'VoiceExtensionId':_0x44407e[_0x0d03('0x16')]});}}if(_0x44407e[_0x0d03('0x12')]===_0x0d03('0x17')&&_0x44407e['hasOwnProperty']('callerID')){if(_0x44407e[_0x0d03('0x2e')]){_0x47dc85[_0x0d03('0x1b')]({'type':_0x44407e[_0x0d03('0x12')],'app':'ExecIf','appdata':_0x0d03('0x2f')+_0x44407e[_0x0d03('0x2e')]+')','context':_0x44407e[_0x0d03('0x15')],'exten':_0x44407e[_0x0d03('0xa')],'priority':_0x2806eb[_0x0d03('0x26')]+_0x16403d[_0x0d03('0xe')]+_0xe38f06++,'VoiceExtensionId':_0x44407e[_0x0d03('0x16')]});}else{_0x47dc85[_0x0d03('0x1b')]({'type':_0x44407e[_0x0d03('0x12')],'app':_0x0d03('0x30'),'appdata':_0x0d03('0x31'),'context':_0x44407e[_0x0d03('0x15')],'exten':_0x44407e['exten'],'priority':_0x2806eb[_0x0d03('0x26')]+_0x16403d[_0x0d03('0xe')]+_0xe38f06++,'VoiceExtensionId':_0x44407e[_0x0d03('0x16')]});}}if(_0x44407e[_0x0d03('0xd')]('answer')){if(_0x59adf5[_0x0d03('0x32')](_0x44407e['app'][_0x0d03('0x27')]())>=0x0&&_0x44407e[_0x0d03('0x33')]!==_0x0d03('0x34')){if(_0x44407e['answer']){_0x47dc85[_0x0d03('0x1b')]({'type':_0x44407e['type'],'app':_0x0d03('0x30'),'appdata':_0x0d03('0x35'),'context':_0x44407e['context'],'exten':_0x44407e[_0x0d03('0xa')],'priority':_0x2806eb[_0x0d03('0x26')]+_0x16403d[_0x0d03('0xe')]+_0xe38f06++,'VoiceExtensionId':_0x44407e[_0x0d03('0x16')]});_0x47dc85['push']({'type':_0x44407e[_0x0d03('0x12')],'app':_0x0d03('0x13'),'appdata':_0x0d03('0x36'),'context':_0x44407e[_0x0d03('0x15')],'exten':_0x44407e[_0x0d03('0xa')],'priority':_0x2806eb['length']+_0x16403d[_0x0d03('0xe')]+_0xe38f06++,'VoiceExtensionId':_0x44407e[_0x0d03('0x16')]});}else{_0x47dc85[_0x0d03('0x1b')]({'type':_0x44407e['type'],'app':_0x0d03('0x30'),'appdata':_0x0d03('0x37'),'context':_0x44407e[_0x0d03('0x15')],'exten':_0x44407e['exten'],'priority':_0x2806eb[_0x0d03('0x26')]+_0x16403d[_0x0d03('0xe')]+_0xe38f06++,'VoiceExtensionId':_0x44407e[_0x0d03('0x16')]});_0x47dc85[_0x0d03('0x1b')]({'type':_0x44407e[_0x0d03('0x12')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x44407e[_0x0d03('0x15')],'exten':_0x44407e[_0x0d03('0xa')],'priority':_0x2806eb['length']+_0x16403d['priority']+_0xe38f06++,'VoiceExtensionId':_0x44407e[_0x0d03('0x16')]});}}}for(var _0x3d78a5=0x0;_0x3d78a5<_0x2806eb[_0x0d03('0x26')];_0x3d78a5+=0x1){var _0x238a1c=_0x16403d[_0x0d03('0xe')]+_0x2806eb[_0x0d03('0x26')];var _0x35c4f4=_0x3d78a5===_0x2806eb[_0x0d03('0x26')]-0x1?_0x16403d[_0x0d03('0xe')]+_0x47dc85[_0x0d03('0x26')]+_0x33be48[_0x0d03('0x26')]+0x2:_0x16403d[_0x0d03('0xe')]+_0x3d78a5+0x1;_0x47dc85[_0x0d03('0x38')](_0x3d78a5,0x0,{'type':_0x44407e[_0x0d03('0x12')],'app':_0x0d03('0x39'),'appdata':_0x2806eb[_0x3d78a5]+'?'+_0x44407e['context']+_0x0d03('0x3a')+_0x238a1c+':'+_0x44407e[_0x0d03('0x15')]+_0x0d03('0x3a')+_0x35c4f4,'exten':_0x44407e[_0x0d03('0xa')],'context':_0x44407e[_0x0d03('0x15')],'priority':_0x16403d['priority']+_0x3d78a5,'VoiceExtensionId':_0x370096[_0x292863][0x0]['VoiceExtensionId']});}_0x44407e['priority']=_0x47dc85[_0x0d03('0x26')]?_[_0x0d03('0x3b')](_0x47dc85)[_0x0d03('0xe')]+0x1:_0x16403d[_0x0d03('0xe')];_0x16403d[_0x0d03('0xe')]=(_0x33be48[_0x0d03('0x26')]?_['last'](_0x33be48)[_0x0d03('0xe')]:_0x44407e[_0x0d03('0xe')])+0x1;_0x16403d[_0x0d03('0x11')]=_['concat'](_0x16403d['extensions'],_0x47dc85,[_0x44407e],_0x33be48);}_0x16403d[_0x0d03('0x11')]['push']({'type':_0x370096[_0x292863][0x0][_0x0d03('0x12')],'app':_0x0d03('0x3c'),'exten':_0x370096[_0x292863][0x0][_0x0d03('0xa')],'context':_0x370096[_0x292863][0x0][_0x0d03('0x15')],'priority':_0x16403d['priority'],'VoiceExtensionId':_0x370096[_0x292863][0x0][_0x0d03('0x16')]});_0x298b00[_0x0d03('0x1b')](_0x370096[_0x292863][0x0]['VoiceExtensionId']);_0x485370=_['concat'](_0x485370,_0x16403d[_0x0d03('0x11')]);}}return _0x575392[_0x0d03('0x3d')](function(_0xd51a3a){return _0x575392[_0x0d03('0x1')][_0x0d03('0x6')][_0x0d03('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x298b00}},'transaction':_0xd51a3a})[_0x0d03('0x4')](function(_0x4f0bb9){return _0x575392['models'][_0x0d03('0x6')][_0x0d03('0x3f')](_['sortBy'](_0x485370,_0x0d03('0xe')),{'transaction':_0xd51a3a});});});})[_0x0d03('0x40')](function(_0x5d5821){console[_0x0d03('0x41')](_0x5d5821);});}exports['rewrite']=rewrite;
\ No newline at end of file
index 8e60199..d4a6bcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','into','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','fromQuery','cm_contacts','str','cm_hopper_final','\x20=\x20?','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','BlackLists','get','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','duplicate','pause','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate'];(function(_0x372d65,_0x3dd521){var _0x424e26=function(_0x48be9d){while(--_0x48be9d){_0x372d65['push'](_0x372d65['shift']());}};_0x424e26(++_0x3dd521);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require('bluebird');var util=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var fs=require('fs');var squel=require(_0x0baf('0x2'));var Papa=require(_0x0baf('0x3'));var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));config[_0x0baf('0x8')]=_[_0x0baf('0x9')](config[_0x0baf('0x8')],{'host':_0x0baf('0xa'),'port':0x18eb});var socket=require(_0x0baf('0xb'))(new Redis(config[_0x0baf('0x8')]));require(_0x0baf('0xc'))['register'](socket);try{if(!process[_0x0baf('0xd')][0x2]||process['argv'][0x2]===_0x0baf('0xe')||process[_0x0baf('0xd')][0x2]===_0x0baf('0xf')){throw new Error(_0x0baf('0x10'));}var FILEPATH=process[_0x0baf('0xd')][0x2];if(!process[_0x0baf('0xd')][0x3]||process[_0x0baf('0xd')][0x3]===_0x0baf('0xe')||process[_0x0baf('0xd')][0x3]===_0x0baf('0xf')||!process[_0x0baf('0xd')][0x4]||process['argv'][0x4]==='undefined'||process[_0x0baf('0xd')][0x4]===_0x0baf('0xf')){throw new Error(_0x0baf('0x11'));}var FIELDS=_[_0x0baf('0x12')](process['argv'][0x3][_0x0baf('0x13')](','),process['argv'][0x4][_0x0baf('0x13')](','));if(!process[_0x0baf('0xd')][0x5]||process[_0x0baf('0xd')][0x5]===_0x0baf('0xe')||process[_0x0baf('0xd')][0x5]===_0x0baf('0xf')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x0baf('0xd')][0x6]&&process[_0x0baf('0xd')][0x6]!==_0x0baf('0xe')&&process[_0x0baf('0xd')][0x6]!==_0x0baf('0xf')?process[_0x0baf('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x0baf('0xd')][0x7]!==_0x0baf('0xe')&&process[_0x0baf('0xd')][0x7]!==_0x0baf('0xf')?process[_0x0baf('0xd')][0x7]:null;if(!process[_0x0baf('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0x0baf('0xd')][0x8]===_0x0baf('0xf')){throw new Error(_0x0baf('0x14'));}var SOCKET_TIMESTAMP=process[_0x0baf('0xd')][0x8];}catch(_0x1fa92b){logger[_0x0baf('0x15')](_0x1fa92b);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(_0x210cd8,_0x636a13,_0x2c42e2,_0x15a2c3){var _0x54f2fa={'message':_0x636a13};_0x54f2fa[_0x210cd8]=!![];if(_0x2c42e2){_0x54f2fa[_0x0baf('0x16')]=_0x2c42e2;}if(_0x15a2c3){_0x54f2fa['index']=_0x15a2c3;}return _0x54f2fa;}function isEmail(_0xf6c158){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'](_0xf6c158);}function checkRow(_0x4de74c,_0x2ef0aa,_0x48a0e9){return new BPromise(function(_0x4be1b9,_0x47c4b){if(_[_0x0baf('0x17')](_0x4de74c)){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x18'),null,_0x48a0e9));}if(_0x4de74c[_0x0baf('0x19')]&&_0x4de74c['errors'][_0x0baf('0x1a')]){var _0x4681c5=_[_0x0baf('0x1b')](_0x4de74c[_0x0baf('0x19')],_0x0baf('0x1c'))[_0x0baf('0x1d')](';');return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x4681c5,null,_0x48a0e9));}var _0x549fd0={};for(var _0x1590b4 in FIELDS){if(FIELDS[_0x0baf('0x1e')](_0x1590b4)&&FIELDS[_0x1590b4]){_0x549fd0[_0x1590b4]=_0x4de74c[_0x0baf('0x1f')][0x0][FIELDS[_0x1590b4]]||_0x4de74c[_0x0baf('0x1f')][0x0]['\ufeff'+FIELDS[_0x1590b4]];}}if(!_0x549fd0['firstName']){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x20'),null,_0x48a0e9));}if(!_0x549fd0['phone']){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x21'),null,_0x48a0e9));}if(_0x549fd0[_0x0baf('0x22')]){var _0xb4dbb1=moment(_0x549fd0[_0x0baf('0x22')],_0x0baf('0x23'));if(!_0xb4dbb1[_0x0baf('0x24')]()){return _0x47c4b(handleCheckRowError('error',_0x0baf('0x25'),null,_0x48a0e9));}}if(_0x549fd0[_0x0baf('0x26')]){if(!isEmail(_0x549fd0[_0x0baf('0x26')])){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x27'),null,_0x48a0e9));}}_0x549fd0[_0x0baf('0x28')]=LISTID;_0x549fd0[_0x0baf('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x0baf('0x1a')]&&_0x2ef0aa){var _0x59431b={};for(var _0x3ded64=0x0,_0x2adfd7=DUPLICATES[_0x0baf('0x1a')];_0x3ded64<_0x2adfd7;_0x3ded64+=0x1){_0x59431b[DUPLICATES[_0x3ded64]]=_0x549fd0[DUPLICATES[_0x3ded64]];}var _0x45294a=_[_0x0baf('0x2a')](_0x2ef0aa,_0x59431b);if(_0x45294a){return _0x47c4b(handleCheckRowError('duplicate',_0x0baf('0x2b'),_0x45294a,_0x48a0e9));}}return db['CmContact'][_0x0baf('0x2c')](_0x549fd0,{'raw':!![],'hooks':![],'fields':_[_0x0baf('0x2d')](_0x549fd0)})[_0x0baf('0x2e')](function(_0x3d65f2){if(DUPLICATES&&DUPLICATES['length']&&_0x2ef0aa){_0x2ef0aa[_0x0baf('0x2f')](_[_0x0baf('0x30')](_0x549fd0,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3d65f2['id'];return _0x4be1b9();})['catch'](function(_0x23d890){return _0x47c4b(handleCheckRowError(_0x0baf('0x15'),_0x0baf('0x31')+(_0x23d890[_0x0baf('0x1c')]||JSON[_0x0baf('0x32')](_0x23d890)),null,_0x48a0e9));});});}function checkHopper(){function _0x1b0991(){return function(_0xe03d82){logger[_0x0baf('0x15')]('cmContact',_0x0baf('0x33'),util[_0x0baf('0x34')](_0xe03d82,{'showHidden':![],'depth':null}));};}var _0x5b991f=function(_0x32c022,_0x57783c){var _0x5c545f=squel[_0x0baf('0x35')]()[_0x0baf('0x36')]('cm_hopper')['fromQuery']([_0x0baf('0x37'),_0x0baf('0x38'),_0x0baf('0x39'),_0x0baf('0x28'),_0x57783c,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'),_0x0baf('0x37'))[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x38'))[_0x0baf('0x3d')]('id','ContactId')[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),'ListId')[_0x0baf('0x3d')](_0x32c022['id'][_0x0baf('0x3f')](),_0x57783c)[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x3a'))[_0x0baf('0x3d')]('NOW()',_0x0baf('0x3b'))[_0x0baf('0x40')]('cm_contacts')[_0x0baf('0x41')](_0x0baf('0x42'))[_0x0baf('0x41')](_0x0baf('0x43'),LISTID['toString']())[_0x0baf('0x41')](_0x0baf('0x44'))[_0x0baf('0x41')](_0x0baf('0x45'),squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'))[_0x0baf('0x40')](_0x0baf('0x46'))[_0x0baf('0x41')](_0x57783c+'\x20=\x20?',_0x32c022['id'][_0x0baf('0x3f')]())))[_0x0baf('0x3f')]();return _0x5c545f;};var _0x1daf1d=function(_0x339aff,_0x22207a){var _0x55f4f8=squel[_0x0baf('0x35')]()[_0x0baf('0x36')](_0x0baf('0x46'))[_0x0baf('0x47')]([_0x0baf('0x37'),'scheduledAt',_0x0baf('0x39'),_0x0baf('0x28'),_0x22207a,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'),'phone')[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x38'))['field']('id',_0x0baf('0x39'))[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),_0x0baf('0x28'))[_0x0baf('0x3d')](_0x339aff['id'][_0x0baf('0x3f')](),_0x22207a)[_0x0baf('0x3d')]('NOW()',_0x0baf('0x3a'))[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x3b'))[_0x0baf('0x40')](_0x0baf('0x48'))[_0x0baf('0x41')](_0x0baf('0x42'))[_0x0baf('0x41')](_0x0baf('0x43'),LISTID[_0x0baf('0x3f')]())['where']('id\x20IN\x20?',squel[_0x0baf('0x49')](hopperContacts))[_0x0baf('0x41')](_0x0baf('0x44'))[_0x0baf('0x41')](_0x0baf('0x45'),squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')]('calleridnum')[_0x0baf('0x40')](_0x0baf('0x4a'))[_0x0baf('0x41')](_0x22207a+_0x0baf('0x4b'),_0x339aff['id'][_0x0baf('0x3f')]()))[_0x0baf('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0baf('0x3c')]()['field'](_0x0baf('0x37'))['from'](_0x0baf('0x46'))['where'](_0x22207a+_0x0baf('0x4b'),_0x339aff['id']['toString']())))[_0x0baf('0x3f')]();return _0x55f4f8;};function _0xcf7b8d(_0x411c1f,_0x4520d1){var _0x42a68b=squel['insert']()[_0x0baf('0x36')](_0x0baf('0x46'))[_0x0baf('0x47')]([_0x0baf('0x37'),_0x0baf('0x38'),_0x0baf('0x39'),'ListId',_0x4520d1,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()[_0x0baf('0x3d')](_0x0baf('0x37'),_0x0baf('0x37'))[_0x0baf('0x3d')]('NOW()','scheduledAt')[_0x0baf('0x3d')]('id',_0x0baf('0x39'))[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),_0x0baf('0x28'))[_0x0baf('0x3d')](_0x411c1f['id'][_0x0baf('0x3f')](),_0x4520d1)[_0x0baf('0x3d')](_0x0baf('0x3e'),'createdAt')[_0x0baf('0x3d')](_0x0baf('0x3e'),_0x0baf('0x3b'))[_0x0baf('0x40')](_0x0baf('0x48'))[_0x0baf('0x41')](_0x0baf('0x42'))['where'](_0x0baf('0x43'),LISTID[_0x0baf('0x3f')]())[_0x0baf('0x41')](_0x0baf('0x4c'),squel[_0x0baf('0x49')](hopperContacts))[_0x0baf('0x41')](_0x0baf('0x44')))[_0x0baf('0x3f')]();return _0x42a68b;}function _0x498405(_0x178495,_0x5dc434){var _0x3c00e7=squel['insert']()['into'](_0x0baf('0x4d'))['fromQuery']([_0x0baf('0x37'),_0x0baf('0x39'),'ListId',_0x5dc434,_0x0baf('0x3a'),_0x0baf('0x3b')],squel[_0x0baf('0x3c')]()['field']('phone',_0x0baf('0x37'))[_0x0baf('0x3d')]('id',_0x0baf('0x39'))[_0x0baf('0x3d')](LISTID[_0x0baf('0x3f')](),'ListId')[_0x0baf('0x3d')](_0x178495['id']['toString'](),_0x5dc434)['field']('NOW()',_0x0baf('0x3a'))['field']('NOW()',_0x0baf('0x3b'))[_0x0baf('0x40')](_0x0baf('0x48'))[_0x0baf('0x41')](_0x0baf('0x42'))[_0x0baf('0x41')]('ListId\x20=\x20?',LISTID[_0x0baf('0x3f')]())[_0x0baf('0x41')](_0x0baf('0x4c'),squel[_0x0baf('0x49')](hopperContacts))[_0x0baf('0x41')](_0x0baf('0x44')))['toString']();return _0x3c00e7;}return db[_0x0baf('0x4e')][_0x0baf('0x4f')]({'where':{'type':_0x0baf('0x50')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x0baf('0x51')],'as':_0x0baf('0x52'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x2c20fe){var _0x125906=[];if(_0x2c20fe){var _0x27a959;for(var _0x4cc046=0x0,_0x5874cc;_0x4cc046<_0x2c20fe['length'];_0x4cc046+=0x1){_0x5874cc=_0x2c20fe[_0x4cc046]['get']({'plain':!![]});switch(_0x5874cc[_0x0baf('0x53')]){case _0x0baf('0x54'):_0x125906[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x1daf1d(_0x5874cc,_0x0baf('0x57')))['then'](function(){})['catch'](_0x1b0991()));break;case _0x0baf('0x58'):_0x125906['push'](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x5b991f(_0x5874cc,'VoiceQueueId'))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));break;default:_0x125906[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0xcf7b8d(_0x5874cc,_0x0baf('0x57')))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));}}}return _0x125906;})[_0x0baf('0x5a')]()['then'](function(){return db['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x0baf('0x5b'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x333b07){var _0x20a514=[];if(_0x333b07){var _0x5093f5;for(var _0x1be7f2=0x0,_0x410f6c;_0x1be7f2<_0x333b07['length'];_0x1be7f2+=0x1){_0x410f6c=_0x333b07[_0x1be7f2]['get']({'plain':!![]});_0x20a514[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x498405(_0x410f6c,_0x0baf('0x57')))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));}}return _0x20a514;})[_0x0baf('0x5a')]();})[_0x0baf('0x2e')](function(){return db['Campaign'][_0x0baf('0x4f')]({'attributes':['id',_0x0baf('0x53')],'include':[{'model':db['CmList'],'as':_0x0baf('0x52'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x538f24){var _0x97d385=[];if(_0x538f24){for(var _0x4043d5=0x0,_0x421ca0;_0x4043d5<_0x538f24[_0x0baf('0x1a')];_0x4043d5+=0x1){_0x421ca0=_0x538f24[_0x4043d5][_0x0baf('0x5c')]({'plain':!![]});switch(_0x421ca0['dialCheckDuplicateType']){case'always':_0x97d385[_0x0baf('0x2f')](db[_0x0baf('0x55')]['query'](_0x1daf1d(_0x421ca0,_0x0baf('0x5d')))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));break;case'onlyIfOpen':_0x97d385[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0x5b991f(_0x421ca0,'CampaignId'))[_0x0baf('0x2e')](function(){})['catch'](_0x1b0991()));break;default:_0x97d385[_0x0baf('0x2f')](db[_0x0baf('0x55')][_0x0baf('0x56')](_0xcf7b8d(_0x421ca0,_0x0baf('0x5d')))[_0x0baf('0x2e')](function(){})['catch'](_0x1b0991()));}}}return _0x97d385;})[_0x0baf('0x5a')]();})[_0x0baf('0x2e')](function(){return db['Campaign'][_0x0baf('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x0baf('0x51')],'as':_0x0baf('0x5b'),'where':{'id':LISTID}}]})[_0x0baf('0x2e')](function(_0x1cbbcc){var _0x250df2=[];if(_0x1cbbcc){for(var _0xa4fd1b=0x0,_0x1cda78;_0xa4fd1b<_0x1cbbcc[_0x0baf('0x1a')];_0xa4fd1b+=0x1){_0x1cda78=_0x1cbbcc[_0xa4fd1b][_0x0baf('0x5c')]({'plain':!![]});_0x250df2[_0x0baf('0x2f')](db[_0x0baf('0x55')]['query'](_0x498405(_0x1cda78,'CampaignId'))[_0x0baf('0x2e')](function(){})[_0x0baf('0x59')](_0x1b0991()));}}return _0x250df2;})[_0x0baf('0x5a')]();})['catch'](function(_0x507783){logger[_0x0baf('0x15')](_0x0baf('0x5e'),_0x0baf('0x5f'),_0x507783[_0x0baf('0x1c')]);});}var processPromises=function(_0x2dcdfe){return BPromise[_0x0baf('0x5a')](promises)[_0x0baf('0x2e')](function(_0xa2d315){})[_0x0baf('0x59')](function(_0x4e8e85){logger[_0x0baf('0x15')](_0x0baf('0x60'),JSON[_0x0baf('0x32')](_0x4e8e85));})[_0x0baf('0x61')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2dcdfe){return _0x2dcdfe['resume']();}});};var endCsv=function(){return BPromise[_0x0baf('0x62')]()[_0x0baf('0x2e')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0x0baf('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x0baf('0x64')](FILEPATH);}catch(_0x52e0c4){logger[_0x0baf('0x15')](_0x0baf('0x65'),JSON[_0x0baf('0x32')](_0x52e0c4));}finally{process[_0x0baf('0x66')](0x0);}});};process['on'](_0x0baf('0x67'),function(){logger[_0x0baf('0x68')](_0x0baf('0x69'));endCsv();});function main(){return BPromise[_0x0baf('0x62')]()[_0x0baf('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x0baf('0x13')](',');return db[_0x0baf('0x6a')][_0x0baf('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1ed607){var _0xd0f63b=fs[_0x0baf('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x0baf('0x6c')](_0xd0f63b,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c37b4,_0x195303){total+=0x1;var _0x49d411=total;promises[_0x0baf('0x2f')](checkRow(_0x3c37b4,_0x1ed607,_0x49d411)[_0x0baf('0x2e')](function(){success+=0x1;})[_0x0baf('0x59')](function(_0x457ae8){if(_0x457ae8[_0x0baf('0x15')]){errors+=0x1;delete _0x457ae8['error'];}else if(_0x457ae8[_0x0baf('0x6d')]){duplicates+=0x1;delete _0x457ae8[_0x0baf('0x6d')];}rows[_0x0baf('0x2f')](_0x457ae8);}));if(total%0xc8===0x0){_0x195303[_0x0baf('0x6e')]();return processPromises(_0x195303);}},'complete':function(){return processPromises()[_0x0baf('0x2e')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0xb5f4e5,_0x5a2454){logger[_0x0baf('0x68')]('CSV\x20parse\x20error',JSON[_0x0baf('0x32')](_0xb5f4e5));endCsv();}});})[_0x0baf('0x59')](function(_0x1ce7bb){logger[_0x0baf('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x0baf('0x32')](_0x1ce7bb));});}main();
\ No newline at end of file
+var _0x0713=['papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','fromQuery','phone','scheduledAt','updatedAt','field','NOW()','ContactId','toString','createdAt','from','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','cm_contacts','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','CmList','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x3071('0x0'));var fs=require('fs');var squel=require(_0x3071('0x1'));var Papa=require(_0x3071('0x2'));var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));config[_0x3071('0x7')]=_[_0x3071('0x8')](config[_0x3071('0x7')],{'host':_0x3071('0x9'),'port':0x18eb});var socket=require(_0x3071('0xa'))(new Redis(config[_0x3071('0x7')]));require(_0x3071('0xb'))[_0x3071('0xc')](socket);try{if(!process[_0x3071('0xd')][0x2]||process[_0x3071('0xd')][0x2]===_0x3071('0xe')||process['argv'][0x2]===_0x3071('0xf')){throw new Error(_0x3071('0x10'));}var FILEPATH=process[_0x3071('0xd')][0x2];if(!process[_0x3071('0xd')][0x3]||process[_0x3071('0xd')][0x3]==='undefined'||process[_0x3071('0xd')][0x3]===_0x3071('0xf')||!process[_0x3071('0xd')][0x4]||process[_0x3071('0xd')][0x4]===_0x3071('0xe')||process['argv'][0x4]==='null'){throw new Error(_0x3071('0x11'));}var FIELDS=_['zipObject'](process[_0x3071('0xd')][0x3][_0x3071('0x12')](','),process['argv'][0x4][_0x3071('0x12')](','));if(!process['argv'][0x5]||process[_0x3071('0xd')][0x5]===_0x3071('0xe')||process[_0x3071('0xd')][0x5]===_0x3071('0xf')){throw new Error(_0x3071('0x13'));}var LISTID=process[_0x3071('0xd')][0x5];var COMPANYID=process[_0x3071('0xd')][0x6]&&process[_0x3071('0xd')][0x6]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x6]!=='null'?process[_0x3071('0xd')][0x6]:null;var DUPLICATES=process[_0x3071('0xd')][0x7]&&process[_0x3071('0xd')][0x7]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x7]!==_0x3071('0xf')?process[_0x3071('0xd')][0x7]:null;if(!process[_0x3071('0xd')][0x8]||process['argv'][0x8]===_0x3071('0xe')||process[_0x3071('0xd')][0x8]===_0x3071('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x3071('0xd')][0x8];}catch(_0x5cd80d){logger[_0x3071('0x14')](_0x5cd80d);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x43128c,_0x3762d8,_0x457b57,_0x33090c){var _0x34c50e={'message':_0x3762d8};_0x34c50e[_0x43128c]=!![];if(_0x457b57){_0x34c50e[_0x3071('0x15')]=_0x457b57;}if(_0x33090c){_0x34c50e[_0x3071('0x16')]=_0x33090c;}return _0x34c50e;}function isEmail(_0x542646){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x542646);}function checkRow(_0x2ce48a,_0xb05b1d,_0x412652){return new BPromise(function(_0x13df9f,_0x2793ef){if(_[_0x3071('0x17')](_0x2ce48a)){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x18'),null,_0x412652));}if(_0x2ce48a[_0x3071('0x19')]&&_0x2ce48a['errors'][_0x3071('0x1a')]){var _0x3f1e6e=_[_0x3071('0x1b')](_0x2ce48a['errors'],_0x3071('0x1c'))[_0x3071('0x1d')](';');return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3f1e6e,null,_0x412652));}var _0x950fde={};for(var _0x3fa3b8 in FIELDS){if(FIELDS[_0x3071('0x1e')](_0x3fa3b8)&&FIELDS[_0x3fa3b8]){_0x950fde[_0x3fa3b8]=_0x2ce48a[_0x3071('0x1f')][0x0][FIELDS[_0x3fa3b8]]||_0x2ce48a[_0x3071('0x1f')][0x0]['\ufeff'+FIELDS[_0x3fa3b8]];}}if(!_0x950fde[_0x3071('0x20')]){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x21'),null,_0x412652));}if(!_0x950fde['phone']){return _0x2793ef(handleCheckRowError('error',_0x3071('0x22'),null,_0x412652));}if(_0x950fde[_0x3071('0x23')]){var _0x6ddf96=moment(_0x950fde[_0x3071('0x23')],_0x3071('0x24'));if(!_0x6ddf96[_0x3071('0x25')]()){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x26'),null,_0x412652));}}if(_0x950fde['email']){if(!isEmail(_0x950fde['email'])){return _0x2793ef(handleCheckRowError('error',_0x3071('0x27'),null,_0x412652));}}_0x950fde[_0x3071('0x28')]=LISTID;_0x950fde['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){var _0x28747d={};for(var _0x25250e=0x0,_0x13ae2c=DUPLICATES['length'];_0x25250e<_0x13ae2c;_0x25250e+=0x1){_0x28747d[DUPLICATES[_0x25250e]]=_0x950fde[DUPLICATES[_0x25250e]];}var _0x218a82=_[_0x3071('0x29')](_0xb05b1d,_0x28747d);if(_0x218a82){return _0x2793ef(handleCheckRowError(_0x3071('0x2a'),_0x3071('0x2b'),_0x218a82,_0x412652));}}return db[_0x3071('0x2c')][_0x3071('0x2d')](_0x950fde,{'raw':!![],'hooks':![],'fields':_[_0x3071('0x2e')](_0x950fde)})[_0x3071('0x2f')](function(_0x596cc3){if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){_0xb05b1d['push'](_['pick'](_0x950fde,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x596cc3['id'];return _0x13df9f();})[_0x3071('0x30')](function(_0xa3a7ae){return _0x2793ef(handleCheckRowError('error',_0x3071('0x31')+(_0xa3a7ae[_0x3071('0x1c')]||JSON[_0x3071('0x32')](_0xa3a7ae)),null,_0x412652));});});}function checkHopper(){function _0x14ac42(){return function(_0xc60572){logger[_0x3071('0x14')]('cmContact',_0x3071('0x33'),util[_0x3071('0x34')](_0xc60572,{'showHidden':![],'depth':null}));};}var _0x4ce6d4=function(_0x44ad05,_0x5b1392){var _0x28f855=squel[_0x3071('0x35')]()['into']('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),'ContactId',_0x3071('0x28'),_0x5b1392,'createdAt',_0x3071('0x39')],squel['select']()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x44ad05['id'][_0x3071('0x3d')](),_0x5b1392)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),'updatedAt')[_0x3071('0x3f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x3071('0x40'),LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x5b1392+_0x3071('0x46'),_0x44ad05['id'][_0x3071('0x3d')]())))['toString']();return _0x28f855;};var _0x5c93c7=function(_0x1721d0,_0x3c2f5e){var _0x1fe5e0=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')](['phone',_0x3071('0x38'),'ContactId','ListId',_0x3c2f5e,_0x3071('0x3e'),'updatedAt'],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')[_0x3071('0x3a')]('id','ContactId')[_0x3071('0x3a')](LISTID['toString'](),_0x3071('0x28'))[_0x3071('0x3a')](_0x1721d0['id']['toString'](),_0x3c2f5e)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')](_0x3071('0x40'),LISTID['toString']())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x4b'))[_0x3071('0x3f')](_0x3071('0x4c'))[_0x3071('0x41')](_0x3c2f5e+_0x3071('0x46'),_0x1721d0['id'][_0x3071('0x3d')]()))[_0x3071('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x3c2f5e+'\x20=\x20?',_0x1721d0['id'][_0x3071('0x3d')]())))[_0x3071('0x3d')]();return _0x1fe5e0;};function _0x5bc69e(_0x4b8ec0,_0x1b89ea){var _0x15abc4=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),_0x3071('0x3c'),_0x3071('0x28'),_0x1b89ea,'createdAt',_0x3071('0x39')],squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))['field'](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x4b8ec0['id'][_0x3071('0x3d')](),_0x1b89ea)[_0x3071('0x3a')]('NOW()',_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')]('ListId\x20=\x20?',LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))[_0x3071('0x3d')]();return _0x15abc4;}function _0x2e39ff(_0x3b47e8,_0x5cb3b3){var _0x5d1316=squel[_0x3071('0x35')]()[_0x3071('0x47')](_0x3071('0x4d'))[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x3c'),_0x3071('0x28'),_0x5cb3b3,_0x3071('0x3e'),_0x3071('0x39')],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')]('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))[_0x3071('0x3a')](_0x3b47e8['id']['toString'](),_0x5cb3b3)[_0x3071('0x3a')](_0x3071('0x3b'),'createdAt')['field'](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')](_0x3071('0x4e'))['where']('deletedAt\x20IS\x20NULL')[_0x3071('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))['toString']();return _0x5d1316;}return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id',_0x3071('0x52')],'include':[{'model':db['CmList'],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x588406){var _0x1b35d3=[];if(_0x588406){var _0x29ee70;for(var _0x388cd1=0x0,_0x40c258;_0x388cd1<_0x588406[_0x3071('0x1a')];_0x388cd1+=0x1){_0x40c258=_0x588406[_0x388cd1][_0x3071('0x54')]({'plain':!![]});switch(_0x40c258[_0x3071('0x52')]){case'always':_0x1b35d3['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x40c258,_0x3071('0x57')))['then'](function(){})['catch'](_0x14ac42()));break;case _0x3071('0x58'):_0x1b35d3[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x40c258,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x1b35d3[_0x3071('0x59')](db['sequelize'][_0x3071('0x56')](_0x5bc69e(_0x40c258,'VoiceQueueId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x1b35d3;})[_0x3071('0x5a')]()[_0x3071('0x2f')](function(){return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x138a94){var _0x1da477=[];if(_0x138a94){var _0x4f06c0;for(var _0x2a2e7a=0x0,_0x22ec7b;_0x2a2e7a<_0x138a94[_0x3071('0x1a')];_0x2a2e7a+=0x1){_0x22ec7b=_0x138a94[_0x2a2e7a]['get']({'plain':!![]});_0x1da477['push'](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x22ec7b,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}return _0x1da477;})[_0x3071('0x5a')]();})[_0x3071('0x2f')](function(){return db[_0x3071('0x5c')][_0x3071('0x50')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x3cc937){var _0x98d0fb=[];if(_0x3cc937){for(var _0x1fea60=0x0,_0x435dcb;_0x1fea60<_0x3cc937[_0x3071('0x1a')];_0x1fea60+=0x1){_0x435dcb=_0x3cc937[_0x1fea60]['get']({'plain':!![]});switch(_0x435dcb[_0x3071('0x52')]){case'always':_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;case _0x3071('0x58'):_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x435dcb,'CampaignId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x98d0fb['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5bc69e(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x98d0fb;})['all']();})['then'](function(){return db[_0x3071('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x5e'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x136278){var _0x22783b=[];if(_0x136278){for(var _0x2f31b7=0x0,_0x568386;_0x2f31b7<_0x136278[_0x3071('0x1a')];_0x2f31b7+=0x1){_0x568386=_0x136278[_0x2f31b7][_0x3071('0x54')]({'plain':!![]});_0x22783b[_0x3071('0x59')](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x568386,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})['catch'](_0x14ac42()));}}return _0x22783b;})[_0x3071('0x5a')]();})[_0x3071('0x30')](function(_0x391887){logger[_0x3071('0x14')](_0x3071('0x5f'),'generalCheckHopper',_0x391887[_0x3071('0x1c')]);});}var processPromises=function(_0x479fe7){return BPromise[_0x3071('0x5a')](promises)[_0x3071('0x2f')](function(_0x39060f){})[_0x3071('0x30')](function(_0x1120ec){logger[_0x3071('0x14')](_0x3071('0x60'),JSON[_0x3071('0x32')](_0x1120ec));})['finally'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x479fe7){return _0x479fe7[_0x3071('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x3071('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3071('0x64')](FILEPATH);}catch(_0x5e0cbd){logger[_0x3071('0x14')](_0x3071('0x65'),JSON[_0x3071('0x32')](_0x5e0cbd));}finally{process[_0x3071('0x66')](0x0);}});};process['on'](_0x3071('0x67'),function(){logger[_0x3071('0x68')](_0x3071('0x69'));endCsv();});function main(){return BPromise[_0x3071('0x6a')]()[_0x3071('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x3071('0x2c')][_0x3071('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3071('0x2f')](function(_0x5b2830){var _0x561030=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x561030,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4eb9e2,_0x8c77b7){total+=0x1;var _0x44b4c9=total;promises['push'](checkRow(_0x4eb9e2,_0x5b2830,_0x44b4c9)[_0x3071('0x2f')](function(){success+=0x1;})[_0x3071('0x30')](function(_0x1f61df){if(_0x1f61df['error']){errors+=0x1;delete _0x1f61df['error'];}else if(_0x1f61df[_0x3071('0x2a')]){duplicates+=0x1;delete _0x1f61df[_0x3071('0x2a')];}rows[_0x3071('0x59')](_0x1f61df);}));if(total%0xc8===0x0){_0x8c77b7[_0x3071('0x6b')]();return processPromises(_0x8c77b7);}},'complete':function(){return processPromises()[_0x3071('0x2f')](function(){logger[_0x3071('0x68')](_0x3071('0x6c'));endCsv();});},'error':function(_0x5eb60d,_0x58b62c){logger[_0x3071('0x68')](_0x3071('0x6d'),JSON[_0x3071('0x32')](_0x5eb60d));endCsv();}});})[_0x3071('0x30')](function(_0x5a3b64){logger[_0x3071('0x14')](_0x3071('0x6e'),JSON[_0x3071('0x32')](_0x5a3b64));});}main();
\ No newline at end of file
index 591a27b..be07ced 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['.CmListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.priority','UserId','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','spread','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','query','length','all','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','header',',utcOffset','writeFileSync','parse','createReadStream','data','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','then','format','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_lists','DROP\x20TABLE\x20','finish','affectedRows','emit','unlink','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','localhost','test','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.updatedAt','insert','into','cm_hopper_black','fields','cm_contacts.ListId\x20=\x20'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x7a54,0x106));var _0x47a5=function(_0x4d250b,_0xeff66b){_0x4d250b=_0x4d250b-0x0;var _0x10a3b2=_0x7a54[_0x4d250b];return _0x10a3b2;};'use strict';var fs=require('fs');var path=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var Papa=require(_0x47a5('0x2'));var util=require('util');var BPromise=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var squel=require('squel');var Redis=require(_0x47a5('0x5'));var db=require(_0x47a5('0x6'))['db'];var config=require(_0x47a5('0x7'));var shared=require(_0x47a5('0x8'));var logger=require(_0x47a5('0x9'))('import');config[_0x47a5('0xa')]=_['defaults'](config[_0x47a5('0xa')],{'host':_0x47a5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x582352){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))*$/[_0x47a5('0xc')](_0x582352);}function selectNotIn(_0x2baee7,_0x5e31dd,_0x2eb0dd,_0x49e844,_0x5de6d7){return squel[_0x47a5('0xd')]()[_0x47a5('0xe')](_0x47a5('0xf'))[_0x47a5('0x10')](_0x49e844)[_0x47a5('0x11')](_0x5e31dd,null,_0x5e31dd+_0x47a5('0x12')+_0x49e844+'.'+_0x2eb0dd)[_0x47a5('0x13')](_0x49e844+'.'+_0x2eb0dd+'\x20=\x20'+_0x2baee7+'.'+_0x2eb0dd)[_0x47a5('0x13')](_0x5e31dd+_0x47a5('0x14')+_0x5de6d7[_0x47a5('0x11')]()+')');}function insertCmHopper(_0x711793,_0x139f25,_0x620ee9,_0x3c6c46,_0x190faa){var _0x4e99a8=[_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18'),_0x139f25+'.'+_0x3c6c46,_0x47a5('0x19'),'cm_contacts.updatedAt','cm_contacts.priority',_0x47a5('0x1a'),'\x22'+_0x190faa+'\x22'];return squel['insert']()['into'](_0x47a5('0x1b'))[_0x47a5('0x1c')]([_0x47a5('0xf'),_0x47a5('0x1d'),_0x47a5('0x1e'),_0x47a5('0x1f'),_0x3c6c46,_0x47a5('0x20'),_0x47a5('0x21'),_0x47a5('0x22'),'UserId',_0x47a5('0x23')],squel[_0x47a5('0xd')]()['fields'](_0x4e99a8)[_0x47a5('0x10')](_0x139f25)[_0x47a5('0x11')](_0x47a5('0x24'),null,'cm_contacts.ListId\x20=\x20'+_0x139f25+_0x47a5('0x25'))[_0x47a5('0x11')](_0x620ee9,null,_0x620ee9+_0x47a5('0x12')+_0x139f25+'.'+_0x3c6c46)[_0x47a5('0x13')](_0x139f25+'.CmListId\x20=\x20?',_0x711793)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)['where'](_0x47a5('0x27'),selectNotIn(_0x139f25,_0x620ee9,_0x3c6c46,_0x47a5('0x1b'),[_0x47a5('0x28'),_0x47a5('0x29')]))[_0x47a5('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x139f25,_0x620ee9,_0x3c6c46,'cm_hopper',[_0x47a5('0x28')])))['toString']();}function insertCmHopperBlack(_0x1ea9c8,_0x5b6c4e,_0x23cb77,_0x378208){var _0x36ad34=[_0x47a5('0x15'),_0x47a5('0x17'),_0x47a5('0x18'),_0x5b6c4e+'.'+_0x378208,_0x47a5('0x19'),_0x47a5('0x2a')];return squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')](_0x47a5('0x2d'))[_0x47a5('0x1c')]([_0x47a5('0xf'),'ContactId',_0x47a5('0x1f'),_0x378208,'createdAt',_0x47a5('0x21')],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x36ad34)['from'](_0x5b6c4e)[_0x47a5('0x11')](_0x47a5('0x24'),null,_0x47a5('0x2f')+_0x5b6c4e+_0x47a5('0x25'))['join'](_0x23cb77,null,_0x23cb77+'.id\x20=\x20'+_0x5b6c4e+'.'+_0x378208)[_0x47a5('0x13')](_0x5b6c4e+_0x47a5('0x30'),_0x1ea9c8)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x47a5('0x13')](_0x47a5('0x27'),squel['select']()[_0x47a5('0xe')]('phone')[_0x47a5('0x10')](_0x47a5('0x2d'))['where']('ListId\x20=\x20?',_0x1ea9c8)[_0x47a5('0x13')](_0x378208+'\x20=\x20?',_0x5b6c4e+'.'+_0x378208)))[_0x47a5('0x31')]();}function insertTzCmHopper(_0x87e4c9,_0xf269a8,_0x52749b,_0x18f7e9,_0x50c086,_0x53c754){var _0x65542e=['cm_contacts.phone',_0x47a5('0x32')+_0x53c754+'.offset-cm_contacts.utcOffset\x20minute)',_0x47a5('0x17'),_0x47a5('0x18'),_0xf269a8+'.'+_0x18f7e9,_0x47a5('0x19'),_0x47a5('0x2a'),_0x47a5('0x33'),_0x47a5('0x1a'),'\x22'+_0x50c086+'\x22'];var _0xee582c=squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')]('cm_hopper')[_0x47a5('0x1c')]([_0x47a5('0xf'),'scheduledat',_0x47a5('0x1e'),_0x47a5('0x1f'),_0x18f7e9,_0x47a5('0x20'),'updatedAt',_0x47a5('0x22'),_0x47a5('0x34'),'recallme'],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x65542e)['from'](_0xf269a8)['join']('cm_contacts',null,_0x47a5('0x2f')+_0xf269a8+'.CmListId')[_0x47a5('0x11')](_0x52749b,null,_0x52749b+_0x47a5('0x12')+_0xf269a8+'.'+_0x18f7e9)[_0x47a5('0x11')](_0x53c754,null,_0x53c754+_0x47a5('0x12')+_0xf269a8+'.'+_0x18f7e9)[_0x47a5('0x13')](_0xf269a8+_0x47a5('0x30'),_0x87e4c9)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)[_0x47a5('0x13')](_0x47a5('0x27'),selectNotIn(_0xf269a8,_0x52749b,_0x18f7e9,_0x47a5('0x1b'),[_0x47a5('0x28'),_0x47a5('0x29')]))['where'](_0x47a5('0x27'),selectNotIn(_0xf269a8,_0x52749b,_0x18f7e9,_0x47a5('0x1b'),[_0x47a5('0x28')])))[_0x47a5('0x31')]();return _0xee582c;}function insertTzCmHopperBlack(_0x586f4f,_0x7de536,_0x528ef3,_0x47c7a2){var _0x55c43d=['cm_contacts.phone',_0x47a5('0x17'),'cm_contacts.ListId',_0x7de536+'.'+_0x47c7a2,_0x47a5('0x19'),_0x47a5('0x2a')];return squel[_0x47a5('0x2b')]()['into'](_0x47a5('0x2d'))[_0x47a5('0x1c')](['phone','ContactId',_0x47a5('0x1f'),_0x47c7a2,'createdAt',_0x47a5('0x21')],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x55c43d)[_0x47a5('0x10')](_0x7de536)[_0x47a5('0x11')](_0x47a5('0x24'),null,_0x47a5('0x2f')+_0x7de536+_0x47a5('0x25'))[_0x47a5('0x11')](_0x528ef3,null,_0x528ef3+_0x47a5('0x12')+_0x7de536+'.'+_0x47c7a2)[_0x47a5('0x13')](_0x7de536+_0x47a5('0x30'),_0x586f4f)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)[_0x47a5('0x13')](_0x47a5('0x27'),squel['select']()[_0x47a5('0xe')](_0x47a5('0xf'))['from']('cm_hopper_black')[_0x47a5('0x13')]('ListId\x20=\x20?',_0x586f4f)[_0x47a5('0x13')](_0x47c7a2+_0x47a5('0x35'),_0x7de536+'.'+_0x47c7a2)))['toString']();}function insertCmContact(_0x4f62d3,_0x3d85cc,_0x52d409,_0x2d147c){var _0x1d1039=_[_0x47a5('0x36')](_[_0x47a5('0x37')](_0x2d147c),[_0x47a5('0x1f'),_0x47a5('0x38'),_0x47a5('0x20'),'updatedAt']);return squel['insert']()[_0x47a5('0x2c')](_0x47a5('0x24'))[_0x47a5('0x1c')](_0x1d1039,squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x1d1039)[_0x47a5('0x10')](_0x3d85cc)[_0x47a5('0x13')]('('+_0x52d409['join'](',')+_0x47a5('0x39'),squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x52d409)['from'](_0x47a5('0x24'))['where'](_0x47a5('0x3a'),_0x4f62d3)[_0x47a5('0x13')](_0x47a5('0x3b')))[_0x47a5('0x13')]('id\x20IN\x20?',squel[_0x47a5('0xd')]()[_0x47a5('0xe')](_0x47a5('0x3c'),_0x47a5('0x3d'))[_0x47a5('0x10')](_0x3d85cc)[_0x47a5('0x3e')](_0x52d409[_0x47a5('0x11')](','))))['toString']();}function handleStop(){logger[_0x47a5('0x3f')](_0x47a5('0x40'));stopped=!![];}function handleUncaughtException(_0x187d7e){logger[_0x47a5('0x41')](_0x187d7e[_0x47a5('0x42')]);process[_0x47a5('0x43')](0x1);}function handleError(_0x572233,_0x1ad6a9){stats[_0x47a5('0x44')][_0x47a5('0x45')]({'name':_0x1ad6a9['code'],'message':_0x1ad6a9[_0x47a5('0x42')],'row':_0x572233});}function handleQuery(_0x3c78b7){logger[_0x47a5('0x3f')](_0x3c78b7);return db['sequelize']['query'](_0x3c78b7)[_0x47a5('0x46')](function(_0x376e1d){results['push'](_0x376e1d);})['catch'](function(_0x6d6b2b){logger['error'](_0x6d6b2b[_0x47a5('0x42')]);});}function updateTzCampaigns(_0x5d383d){return new Promise(function(_0x482de6,_0x389ed9){var _0x46d2d3=squel['select']()[_0x47a5('0x2e')]([_0x47a5('0x47'),'campaigns.dialTimezone'])['from'](_0x47a5('0x48'))[_0x47a5('0x11')](_0x47a5('0x49'),null,_0x47a5('0x4a'))['where'](_0x47a5('0x4b')+_0x5d383d);db[_0x47a5('0x4c')][_0x47a5('0x4d')](_0x46d2d3['toString']())[_0x47a5('0x46')](function(_0x4db625){var _0x485e3c=[];for(var _0x470da6=0x0;_0x470da6<_0x4db625[_0x47a5('0x4e')];_0x470da6++){_0x485e3c[_0x47a5('0x45')](getTimezoneData(_0x4db625[_0x470da6],tmp_campaigns));}BPromise[_0x47a5('0x4f')](_0x485e3c)['then'](function(){_0x482de6({'val':0x1});});})[_0x47a5('0x50')](function(_0x5d1550){logger['error'](_0x5d1550['message']);_0x482de6({'val':0x0});});});}function updateTzVoiceQueues(_0x4f8564){return new Promise(function(_0x212d92,_0x6cd4ea){var _0x1e2bb4=squel['select']()['fields']([_0x47a5('0x51'),_0x47a5('0x52')])[_0x47a5('0x10')](_0x47a5('0x53'))[_0x47a5('0x11')]('voice_queues_has_cm_lists',null,_0x47a5('0x54'))['where'](_0x47a5('0x55')+_0x4f8564);db[_0x47a5('0x4c')]['query'](_0x1e2bb4[_0x47a5('0x31')]())[_0x47a5('0x46')](function(_0x132854){var _0x3e8274=[];for(var _0x2d6494=0x0;_0x2d6494<_0x132854[_0x47a5('0x4e')];_0x2d6494++){_0x3e8274[_0x47a5('0x45')](getTimezoneData(_0x132854[_0x2d6494],tmp_voice_queues));}BPromise[_0x47a5('0x4f')](_0x3e8274)['then'](function(){_0x212d92({'val':0x1});});})[_0x47a5('0x50')](function(_0x2a3a57){logger[_0x47a5('0x41')](_0x2a3a57[_0x47a5('0x42')]);_0x212d92({'val':0x0});});});}function getTimezoneData(_0x396cb0,_0x4bbe14){return new Promise(function(_0xbec033,_0xdfcecc){var _0x1224bc=shared[_0x47a5('0x56')];var _0x4228a3=_0x1224bc[_0x396cb0[_0x47a5('0x57')]];if(_[_0x47a5('0x58')](_0x4228a3)){_0xbec033({'ret':0x1});}else{var _0x149d34=_0x4228a3[_0x47a5('0x59')];var _0x44cb90=squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')](_0x4bbe14)[_0x47a5('0x5a')]('id',_0x396cb0['id'])[_0x47a5('0x5a')](_0x47a5('0x5b'),_0x149d34)['set'](_0x47a5('0x57'),_0x396cb0[_0x47a5('0x57')])[_0x47a5('0x31')]();return db['sequelize'][_0x47a5('0x4d')](_0x44cb90)[_0x47a5('0x46')](function(_0x36c67){_0xbec033({'ret':0x1});})[_0x47a5('0x50')](function(_0x5d9822){logger[_0x47a5('0x41')](_0x5d9822['message']);_0xdfcecc({'ret':0x1});});}});}function handleTZQuery(_0x2d5ee6){logger['info'](_0x2d5ee6);return db[_0x47a5('0x4c')]['query'](_0x2d5ee6)[_0x47a5('0x46')](function(_0x2f27c3){})[_0x47a5('0x50')](function(_0x58473b){logger['error'](_0x58473b['message']);});}function main(_0x4164a3,_0x2b1303,_0xe3c0a7,_0x117510){logger['info'](_0x47a5('0x5c'),_0x4164a3,JSON[_0x47a5('0x5d')](_0x2b1303));process[_0x47a5('0x5e')](_0x47a5('0x5f'));var _0x308c9a=_0x2b1303[_0x47a5('0x60')];var _0x1155f6=_0x2b1303[_0x47a5('0x61')];var _0x4618a0=path[_0x47a5('0x11')](config[_0x47a5('0x62')],_0x47a5('0x63'),_0x1155f6+'.csv');hasTZ=_[_0x47a5('0x37')](_0x308c9a)['includes'](_0x47a5('0x57'));var _0x2ac30f=_[_0x47a5('0x37')](_0x308c9a)[_0x47a5('0x11')]();logger[_0x47a5('0x3f')](_0x47a5('0x64'),_0x2ac30f);if(hasTZ)_0x2ac30f+=_0x47a5('0x65');fs[_0x47a5('0x66')](_0x4618a0,_0x2ac30f+'\x0a');Papa[_0x47a5('0x67')](fs[_0x47a5('0x68')](_0x4164a3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1cfb37,_0x1f07ac){try{for(var _0x8f0035=0x0,_0x2d434c=[];_0x8f0035<_0x1cfb37[_0x47a5('0x69')]['length'];_0x8f0035++){stats['rows']+=0x1;if(_0x1cfb37['errors'][_0x8f0035]){handleError(_0x1cfb37['data'][_0x8f0035],_0x1cfb37[_0x47a5('0x44')][_0x8f0035]);}else{var _0x28b8e9=[];for(var _0x5d6916 in _0x308c9a){if(_0x308c9a[_0x47a5('0x6a')](_0x5d6916)){if(_0x1cfb37[_0x47a5('0x69')][_0x8f0035][_0x308c9a[_0x5d6916]]){var _0x1baa5a=_[_0x47a5('0x6b')](_0x1cfb37[_0x47a5('0x69')][_0x8f0035][_0x308c9a[_0x5d6916]][_0x47a5('0x6c')](/"/g,'\x27'));switch(_0x5d6916){case _0x47a5('0x1d'):var _0x1c7302=moment(_0x1baa5a,_0x47a5('0x6d'),!![]);if(_0x1c7302[_0x47a5('0x6e')]()){_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9['push'](_0x47a5('0x6f'));}break;case _0x47a5('0x22'):var _0x420671=parseInt(_0x1baa5a);_0x1baa5a=_['isNaN'](_0x420671)||_0x420671<0x0||_0x420671>0x4?_0x117510?0x3:0x2:_0x420671;_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');break;case _0x47a5('0x34'):var _0x17b61d=parseInt(_0x1baa5a);if(_['isNumber'](_0x17b61d)&&_[_0x47a5('0x70')](_0xe3c0a7,_0x17b61d)){_0x2d434c['push']('\x22'+_0x17b61d+'\x22');}else{_0x28b8e9['push'](_0x47a5('0x71'));}break;case _0x47a5('0x72'):if(isEmail(_0x1baa5a)){_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9[_0x47a5('0x45')](_0x47a5('0x73'));}break;case _0x47a5('0x74'):var _0x479a82=moment(_0x1baa5a,'YYYY-MM-DD',!![]);if(_0x479a82[_0x47a5('0x6e')]()){_0x2d434c['push']('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9[_0x47a5('0x45')](_0x47a5('0x75'));}break;case _0x47a5('0x57'):var _0xb16bdd=shared['timezones'];var _0x3c66e3=_0xb16bdd[_0x1baa5a];if(!_['isNil'](_0x3c66e3)){var _0x5f3a04=_0x3c66e3[_0x47a5('0x59')];_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');_0x2d434c['push']('\x22'+_0x5f3a04+'\x22');}break;default:_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}}else{switch(_0x5d6916){case _0x47a5('0x76'):case _0x47a5('0xf'):_0x28b8e9['push'](_0x5d6916+_0x47a5('0x77'));break;default:_0x2d434c['push']('\x22\x22');}}}}if(_0x28b8e9[_0x47a5('0x4e')]){handleError(_0x1cfb37[_0x47a5('0x69')][_0x8f0035],{'code':_0x47a5('0x78'),'message':_0x28b8e9['join']()});}else{fs[_0x47a5('0x79')](_0x4618a0,_0x2d434c[_0x47a5('0x11')]()+'\x0a');}_0x2d434c=[];}if(!(stats[_0x47a5('0x7a')]%0xc8)){socket['emit'](_0x47a5('0x7b')+_0x1155f6,stats);stats['errors']=[];}}if(stopped){logger[_0x47a5('0x3f')]('Abort\x20parser');_0x1f07ac[_0x47a5('0x7c')]();}}catch(_0x20d8bd){handleError(_0x1cfb37[_0x47a5('0x69')][_0x8f0035],{'code':_0x47a5('0x7d'),'message':_0x20d8bd['message']});logger[_0x47a5('0x41')](_0x47a5('0x7e'),_0x20d8bd[_0x47a5('0x42')]);}},'complete':function(){try{var _0x1bbfba=[];var _0x22d84a=[];var _0x57ac25='cm_contacts';if(_0x2b1303[_0x47a5('0x7f')]&&_0x2b1303['duplicates'][_0x47a5('0x4e')]){_0x57ac25=_0x47a5('0x80')+_0x1155f6;_0x1bbfba[_0x47a5('0x45')]('CREATE\x20TABLE\x20'+_0x57ac25+_0x47a5('0x81'));}tmp_campaigns=_0x47a5('0x82')+_0x1155f6;tmp_voice_queues='voice_queues_'+_0x1155f6;_0x22d84a[_0x47a5('0x45')](_0x47a5('0x83')+tmp_campaigns+_0x47a5('0x84'));_0x22d84a[_0x47a5('0x45')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x47a5('0x85')](_0x22d84a,handleTZQuery)[_0x47a5('0x86')](function(_0x48e7f3){updateTzCampaigns(_0x2b1303[_0x47a5('0x1f')])[_0x47a5('0x86')](function(_0x5a0901){updateTzVoiceQueues(_0x2b1303[_0x47a5('0x1f')])[_0x47a5('0x86')](function(_0x2930d9){var _0x59f010=util[_0x47a5('0x87')]('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',_0x4618a0,_0x57ac25,_0x2ac30f,_0x2b1303[_0x47a5('0x1f')],_0x2b1303['CompanyId']||null,NOW,NOW);if(_[_0x47a5('0x58')](_0x308c9a[_0x47a5('0x1d')])){_0x59f010+=',\x20scheduledAt\x20=\x20NOW()';}_0x1bbfba[_0x47a5('0x45')](_0x59f010);if(_0x2b1303['duplicates']&&_0x2b1303[_0x47a5('0x7f')][_0x47a5('0x4e')]){_0x1bbfba[_0x47a5('0x45')](insertCmContact(_0x2b1303[_0x47a5('0x1f')],_0x57ac25,_0x2b1303['duplicates'],_0x308c9a));}if(hasTZ){_0x1bbfba[_0x47a5('0x45')](insertTzCmHopper(_0x2b1303['ListId'],'voice_queues_has_cm_lists',_0x47a5('0x53'),_0x47a5('0x88'),_0x117510,tmp_voice_queues));_0x1bbfba[_0x47a5('0x45')](insertTzCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x89'),'voice_queues',_0x47a5('0x88')));_0x1bbfba[_0x47a5('0x45')](insertTzCmHopper(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x49'),'campaigns',_0x47a5('0x8a'),_0x117510,tmp_campaigns));_0x1bbfba['push'](insertTzCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x8b'),_0x47a5('0x48'),_0x47a5('0x8a')));}else{_0x1bbfba[_0x47a5('0x45')](insertCmHopper(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x8c'),_0x47a5('0x53'),_0x47a5('0x88'),_0x117510));_0x1bbfba['push'](insertCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x89'),'voice_queues',_0x47a5('0x88')));_0x1bbfba[_0x47a5('0x45')](insertCmHopper(_0x2b1303[_0x47a5('0x1f')],'campaigns_has_cm_lists','campaigns',_0x47a5('0x8a'),_0x117510));_0x1bbfba[_0x47a5('0x45')](insertCmHopperBlack(_0x2b1303['ListId'],'campaigns_has_cm_blacklists',_0x47a5('0x48'),_0x47a5('0x8a')));}_0x1bbfba['push'](_0x47a5('0x8d')+tmp_campaigns+';');_0x1bbfba[_0x47a5('0x45')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0x47a5('0x85')](_0x1bbfba,handleQuery)[_0x47a5('0x86')](function(_0x109805){stats[_0x47a5('0x8e')]=!![];stats[_0x47a5('0x8f')]=_0x2b1303[_0x47a5('0x7f')]&&_0x2b1303['duplicates']['length']?results[0x2]['affectedRows']:results[0x0][_0x47a5('0x8f')];socket[_0x47a5('0x90')]('contact:import:'+_0x1155f6,stats);fs[_0x47a5('0x91')](_0x4164a3);fs[_0x47a5('0x91')](_0x4618a0);process[_0x47a5('0x43')](0x0);})[_0x47a5('0x50')](function(_0xcdbfd7){logger['error'](_0xcdbfd7[_0x47a5('0x42')]);process['exit'](0x1);});})['catch'](function(_0x5db0ed){logger[_0x47a5('0x41')](_0x5db0ed['message']);process[_0x47a5('0x43')](0x1);});});});}catch(_0xf3edc8){logger[_0x47a5('0x41')]('complete',_0xf3edc8[_0x47a5('0x42')]);process[_0x47a5('0x43')](0x1);}},'error':function(_0x35bf37,_0x121750,_0x392ad7,_0x581a87){throw new Error(_0x581a87);}});}function validate(){if(process[_0x47a5('0x92')]&&process[_0x47a5('0x92')]['length']<0x4){throw new Error(_0x47a5('0x93'));}var _0x419870=path[_0x47a5('0x11')](config[_0x47a5('0x62')],_0x47a5('0x63'),process[_0x47a5('0x92')][0x2]);if(!fs['existsSync'](_0x419870)){throw new Error(_0x47a5('0x94'));}var _0x2e418d={};try{_0x2e418d=JSON['parse'](process[_0x47a5('0x92')][0x3]);if(!_0x2e418d[_0x47a5('0x60')]){throw new Error(_0x47a5('0x95'));}if(!_0x2e418d[_0x47a5('0x60')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x2e418d['binding']['firstName']){throw new Error(_0x47a5('0x96'));}var _0x27793e=0x0;if(_0x2e418d[_0x47a5('0x60')][_0x47a5('0x34')]){_0x27793e=0x1;}if(!_0x2e418d[_0x47a5('0x1f')]){throw new Error(_0x47a5('0x97'));}}catch(_0xac1f9e){throw new Error(_0x47a5('0x98'));}var _0x4bd164=[];try{_0x4bd164=_[_0x47a5('0x99')](JSON[_0x47a5('0x67')](process[_0x47a5('0x92')][0x4]),'id');}catch(_0x399528){logger['info']('No\x20agent\x20available');}main(_0x419870,_0x2e418d,_0x4bd164,_0x27793e);}validate();process['on'](_0x47a5('0x9a'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0x7a54=['.CmListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.priority','UserId','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','spread','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','query','length','all','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','header',',utcOffset','writeFileSync','parse','createReadStream','data','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','then','format','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_lists','DROP\x20TABLE\x20','finish','affectedRows','emit','unlink','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','localhost','test','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.updatedAt','insert','into','cm_hopper_black','fields','cm_contacts.ListId\x20=\x20'];(function(_0x3a0ebd,_0x47f368){var _0x51a660=function(_0x4023e6){while(--_0x4023e6){_0x3a0ebd['push'](_0x3a0ebd['shift']());}};_0x51a660(++_0x47f368);}(_0x7a54,0x106));var _0x47a5=function(_0x33569c,_0x36896e){_0x33569c=_0x33569c-0x0;var _0x4900d5=_0x7a54[_0x33569c];return _0x4900d5;};'use strict';var fs=require('fs');var path=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var Papa=require(_0x47a5('0x2'));var util=require('util');var BPromise=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var squel=require('squel');var Redis=require(_0x47a5('0x5'));var db=require(_0x47a5('0x6'))['db'];var config=require(_0x47a5('0x7'));var shared=require(_0x47a5('0x8'));var logger=require(_0x47a5('0x9'))('import');config[_0x47a5('0xa')]=_['defaults'](config[_0x47a5('0xa')],{'host':_0x47a5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x582352){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))*$/[_0x47a5('0xc')](_0x582352);}function selectNotIn(_0x2baee7,_0x5e31dd,_0x2eb0dd,_0x49e844,_0x5de6d7){return squel[_0x47a5('0xd')]()[_0x47a5('0xe')](_0x47a5('0xf'))[_0x47a5('0x10')](_0x49e844)[_0x47a5('0x11')](_0x5e31dd,null,_0x5e31dd+_0x47a5('0x12')+_0x49e844+'.'+_0x2eb0dd)[_0x47a5('0x13')](_0x49e844+'.'+_0x2eb0dd+'\x20=\x20'+_0x2baee7+'.'+_0x2eb0dd)[_0x47a5('0x13')](_0x5e31dd+_0x47a5('0x14')+_0x5de6d7[_0x47a5('0x11')]()+')');}function insertCmHopper(_0x711793,_0x139f25,_0x620ee9,_0x3c6c46,_0x190faa){var _0x4e99a8=[_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18'),_0x139f25+'.'+_0x3c6c46,_0x47a5('0x19'),'cm_contacts.updatedAt','cm_contacts.priority',_0x47a5('0x1a'),'\x22'+_0x190faa+'\x22'];return squel['insert']()['into'](_0x47a5('0x1b'))[_0x47a5('0x1c')]([_0x47a5('0xf'),_0x47a5('0x1d'),_0x47a5('0x1e'),_0x47a5('0x1f'),_0x3c6c46,_0x47a5('0x20'),_0x47a5('0x21'),_0x47a5('0x22'),'UserId',_0x47a5('0x23')],squel[_0x47a5('0xd')]()['fields'](_0x4e99a8)[_0x47a5('0x10')](_0x139f25)[_0x47a5('0x11')](_0x47a5('0x24'),null,'cm_contacts.ListId\x20=\x20'+_0x139f25+_0x47a5('0x25'))[_0x47a5('0x11')](_0x620ee9,null,_0x620ee9+_0x47a5('0x12')+_0x139f25+'.'+_0x3c6c46)[_0x47a5('0x13')](_0x139f25+'.CmListId\x20=\x20?',_0x711793)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)['where'](_0x47a5('0x27'),selectNotIn(_0x139f25,_0x620ee9,_0x3c6c46,_0x47a5('0x1b'),[_0x47a5('0x28'),_0x47a5('0x29')]))[_0x47a5('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x139f25,_0x620ee9,_0x3c6c46,'cm_hopper',[_0x47a5('0x28')])))['toString']();}function insertCmHopperBlack(_0x1ea9c8,_0x5b6c4e,_0x23cb77,_0x378208){var _0x36ad34=[_0x47a5('0x15'),_0x47a5('0x17'),_0x47a5('0x18'),_0x5b6c4e+'.'+_0x378208,_0x47a5('0x19'),_0x47a5('0x2a')];return squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')](_0x47a5('0x2d'))[_0x47a5('0x1c')]([_0x47a5('0xf'),'ContactId',_0x47a5('0x1f'),_0x378208,'createdAt',_0x47a5('0x21')],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x36ad34)['from'](_0x5b6c4e)[_0x47a5('0x11')](_0x47a5('0x24'),null,_0x47a5('0x2f')+_0x5b6c4e+_0x47a5('0x25'))['join'](_0x23cb77,null,_0x23cb77+'.id\x20=\x20'+_0x5b6c4e+'.'+_0x378208)[_0x47a5('0x13')](_0x5b6c4e+_0x47a5('0x30'),_0x1ea9c8)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x47a5('0x13')](_0x47a5('0x27'),squel['select']()[_0x47a5('0xe')]('phone')[_0x47a5('0x10')](_0x47a5('0x2d'))['where']('ListId\x20=\x20?',_0x1ea9c8)[_0x47a5('0x13')](_0x378208+'\x20=\x20?',_0x5b6c4e+'.'+_0x378208)))[_0x47a5('0x31')]();}function insertTzCmHopper(_0x87e4c9,_0xf269a8,_0x52749b,_0x18f7e9,_0x50c086,_0x53c754){var _0x65542e=['cm_contacts.phone',_0x47a5('0x32')+_0x53c754+'.offset-cm_contacts.utcOffset\x20minute)',_0x47a5('0x17'),_0x47a5('0x18'),_0xf269a8+'.'+_0x18f7e9,_0x47a5('0x19'),_0x47a5('0x2a'),_0x47a5('0x33'),_0x47a5('0x1a'),'\x22'+_0x50c086+'\x22'];var _0xee582c=squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')]('cm_hopper')[_0x47a5('0x1c')]([_0x47a5('0xf'),'scheduledat',_0x47a5('0x1e'),_0x47a5('0x1f'),_0x18f7e9,_0x47a5('0x20'),'updatedAt',_0x47a5('0x22'),_0x47a5('0x34'),'recallme'],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x65542e)['from'](_0xf269a8)['join']('cm_contacts',null,_0x47a5('0x2f')+_0xf269a8+'.CmListId')[_0x47a5('0x11')](_0x52749b,null,_0x52749b+_0x47a5('0x12')+_0xf269a8+'.'+_0x18f7e9)[_0x47a5('0x11')](_0x53c754,null,_0x53c754+_0x47a5('0x12')+_0xf269a8+'.'+_0x18f7e9)[_0x47a5('0x13')](_0xf269a8+_0x47a5('0x30'),_0x87e4c9)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)[_0x47a5('0x13')](_0x47a5('0x27'),selectNotIn(_0xf269a8,_0x52749b,_0x18f7e9,_0x47a5('0x1b'),[_0x47a5('0x28'),_0x47a5('0x29')]))['where'](_0x47a5('0x27'),selectNotIn(_0xf269a8,_0x52749b,_0x18f7e9,_0x47a5('0x1b'),[_0x47a5('0x28')])))[_0x47a5('0x31')]();return _0xee582c;}function insertTzCmHopperBlack(_0x586f4f,_0x7de536,_0x528ef3,_0x47c7a2){var _0x55c43d=['cm_contacts.phone',_0x47a5('0x17'),'cm_contacts.ListId',_0x7de536+'.'+_0x47c7a2,_0x47a5('0x19'),_0x47a5('0x2a')];return squel[_0x47a5('0x2b')]()['into'](_0x47a5('0x2d'))[_0x47a5('0x1c')](['phone','ContactId',_0x47a5('0x1f'),_0x47c7a2,'createdAt',_0x47a5('0x21')],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x55c43d)[_0x47a5('0x10')](_0x7de536)[_0x47a5('0x11')](_0x47a5('0x24'),null,_0x47a5('0x2f')+_0x7de536+_0x47a5('0x25'))[_0x47a5('0x11')](_0x528ef3,null,_0x528ef3+_0x47a5('0x12')+_0x7de536+'.'+_0x47c7a2)[_0x47a5('0x13')](_0x7de536+_0x47a5('0x30'),_0x586f4f)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)[_0x47a5('0x13')](_0x47a5('0x27'),squel['select']()[_0x47a5('0xe')](_0x47a5('0xf'))['from']('cm_hopper_black')[_0x47a5('0x13')]('ListId\x20=\x20?',_0x586f4f)[_0x47a5('0x13')](_0x47c7a2+_0x47a5('0x35'),_0x7de536+'.'+_0x47c7a2)))['toString']();}function insertCmContact(_0x4f62d3,_0x3d85cc,_0x52d409,_0x2d147c){var _0x1d1039=_[_0x47a5('0x36')](_[_0x47a5('0x37')](_0x2d147c),[_0x47a5('0x1f'),_0x47a5('0x38'),_0x47a5('0x20'),'updatedAt']);return squel['insert']()[_0x47a5('0x2c')](_0x47a5('0x24'))[_0x47a5('0x1c')](_0x1d1039,squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x1d1039)[_0x47a5('0x10')](_0x3d85cc)[_0x47a5('0x13')]('('+_0x52d409['join'](',')+_0x47a5('0x39'),squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x52d409)['from'](_0x47a5('0x24'))['where'](_0x47a5('0x3a'),_0x4f62d3)[_0x47a5('0x13')](_0x47a5('0x3b')))[_0x47a5('0x13')]('id\x20IN\x20?',squel[_0x47a5('0xd')]()[_0x47a5('0xe')](_0x47a5('0x3c'),_0x47a5('0x3d'))[_0x47a5('0x10')](_0x3d85cc)[_0x47a5('0x3e')](_0x52d409[_0x47a5('0x11')](','))))['toString']();}function handleStop(){logger[_0x47a5('0x3f')](_0x47a5('0x40'));stopped=!![];}function handleUncaughtException(_0x187d7e){logger[_0x47a5('0x41')](_0x187d7e[_0x47a5('0x42')]);process[_0x47a5('0x43')](0x1);}function handleError(_0x572233,_0x1ad6a9){stats[_0x47a5('0x44')][_0x47a5('0x45')]({'name':_0x1ad6a9['code'],'message':_0x1ad6a9[_0x47a5('0x42')],'row':_0x572233});}function handleQuery(_0x3c78b7){logger[_0x47a5('0x3f')](_0x3c78b7);return db['sequelize']['query'](_0x3c78b7)[_0x47a5('0x46')](function(_0x376e1d){results['push'](_0x376e1d);})['catch'](function(_0x6d6b2b){logger['error'](_0x6d6b2b[_0x47a5('0x42')]);});}function updateTzCampaigns(_0x5d383d){return new Promise(function(_0x482de6,_0x389ed9){var _0x46d2d3=squel['select']()[_0x47a5('0x2e')]([_0x47a5('0x47'),'campaigns.dialTimezone'])['from'](_0x47a5('0x48'))[_0x47a5('0x11')](_0x47a5('0x49'),null,_0x47a5('0x4a'))['where'](_0x47a5('0x4b')+_0x5d383d);db[_0x47a5('0x4c')][_0x47a5('0x4d')](_0x46d2d3['toString']())[_0x47a5('0x46')](function(_0x4db625){var _0x485e3c=[];for(var _0x470da6=0x0;_0x470da6<_0x4db625[_0x47a5('0x4e')];_0x470da6++){_0x485e3c[_0x47a5('0x45')](getTimezoneData(_0x4db625[_0x470da6],tmp_campaigns));}BPromise[_0x47a5('0x4f')](_0x485e3c)['then'](function(){_0x482de6({'val':0x1});});})[_0x47a5('0x50')](function(_0x5d1550){logger['error'](_0x5d1550['message']);_0x482de6({'val':0x0});});});}function updateTzVoiceQueues(_0x4f8564){return new Promise(function(_0x212d92,_0x6cd4ea){var _0x1e2bb4=squel['select']()['fields']([_0x47a5('0x51'),_0x47a5('0x52')])[_0x47a5('0x10')](_0x47a5('0x53'))[_0x47a5('0x11')]('voice_queues_has_cm_lists',null,_0x47a5('0x54'))['where'](_0x47a5('0x55')+_0x4f8564);db[_0x47a5('0x4c')]['query'](_0x1e2bb4[_0x47a5('0x31')]())[_0x47a5('0x46')](function(_0x132854){var _0x3e8274=[];for(var _0x2d6494=0x0;_0x2d6494<_0x132854[_0x47a5('0x4e')];_0x2d6494++){_0x3e8274[_0x47a5('0x45')](getTimezoneData(_0x132854[_0x2d6494],tmp_voice_queues));}BPromise[_0x47a5('0x4f')](_0x3e8274)['then'](function(){_0x212d92({'val':0x1});});})[_0x47a5('0x50')](function(_0x2a3a57){logger[_0x47a5('0x41')](_0x2a3a57[_0x47a5('0x42')]);_0x212d92({'val':0x0});});});}function getTimezoneData(_0x396cb0,_0x4bbe14){return new Promise(function(_0xbec033,_0xdfcecc){var _0x1224bc=shared[_0x47a5('0x56')];var _0x4228a3=_0x1224bc[_0x396cb0[_0x47a5('0x57')]];if(_[_0x47a5('0x58')](_0x4228a3)){_0xbec033({'ret':0x1});}else{var _0x149d34=_0x4228a3[_0x47a5('0x59')];var _0x44cb90=squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')](_0x4bbe14)[_0x47a5('0x5a')]('id',_0x396cb0['id'])[_0x47a5('0x5a')](_0x47a5('0x5b'),_0x149d34)['set'](_0x47a5('0x57'),_0x396cb0[_0x47a5('0x57')])[_0x47a5('0x31')]();return db['sequelize'][_0x47a5('0x4d')](_0x44cb90)[_0x47a5('0x46')](function(_0x36c67){_0xbec033({'ret':0x1});})[_0x47a5('0x50')](function(_0x5d9822){logger[_0x47a5('0x41')](_0x5d9822['message']);_0xdfcecc({'ret':0x1});});}});}function handleTZQuery(_0x2d5ee6){logger['info'](_0x2d5ee6);return db[_0x47a5('0x4c')]['query'](_0x2d5ee6)[_0x47a5('0x46')](function(_0x2f27c3){})[_0x47a5('0x50')](function(_0x58473b){logger['error'](_0x58473b['message']);});}function main(_0x4164a3,_0x2b1303,_0xe3c0a7,_0x117510){logger['info'](_0x47a5('0x5c'),_0x4164a3,JSON[_0x47a5('0x5d')](_0x2b1303));process[_0x47a5('0x5e')](_0x47a5('0x5f'));var _0x308c9a=_0x2b1303[_0x47a5('0x60')];var _0x1155f6=_0x2b1303[_0x47a5('0x61')];var _0x4618a0=path[_0x47a5('0x11')](config[_0x47a5('0x62')],_0x47a5('0x63'),_0x1155f6+'.csv');hasTZ=_[_0x47a5('0x37')](_0x308c9a)['includes'](_0x47a5('0x57'));var _0x2ac30f=_[_0x47a5('0x37')](_0x308c9a)[_0x47a5('0x11')]();logger[_0x47a5('0x3f')](_0x47a5('0x64'),_0x2ac30f);if(hasTZ)_0x2ac30f+=_0x47a5('0x65');fs[_0x47a5('0x66')](_0x4618a0,_0x2ac30f+'\x0a');Papa[_0x47a5('0x67')](fs[_0x47a5('0x68')](_0x4164a3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1cfb37,_0x1f07ac){try{for(var _0x8f0035=0x0,_0x2d434c=[];_0x8f0035<_0x1cfb37[_0x47a5('0x69')]['length'];_0x8f0035++){stats['rows']+=0x1;if(_0x1cfb37['errors'][_0x8f0035]){handleError(_0x1cfb37['data'][_0x8f0035],_0x1cfb37[_0x47a5('0x44')][_0x8f0035]);}else{var _0x28b8e9=[];for(var _0x5d6916 in _0x308c9a){if(_0x308c9a[_0x47a5('0x6a')](_0x5d6916)){if(_0x1cfb37[_0x47a5('0x69')][_0x8f0035][_0x308c9a[_0x5d6916]]){var _0x1baa5a=_[_0x47a5('0x6b')](_0x1cfb37[_0x47a5('0x69')][_0x8f0035][_0x308c9a[_0x5d6916]][_0x47a5('0x6c')](/"/g,'\x27'));switch(_0x5d6916){case _0x47a5('0x1d'):var _0x1c7302=moment(_0x1baa5a,_0x47a5('0x6d'),!![]);if(_0x1c7302[_0x47a5('0x6e')]()){_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9['push'](_0x47a5('0x6f'));}break;case _0x47a5('0x22'):var _0x420671=parseInt(_0x1baa5a);_0x1baa5a=_['isNaN'](_0x420671)||_0x420671<0x0||_0x420671>0x4?_0x117510?0x3:0x2:_0x420671;_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');break;case _0x47a5('0x34'):var _0x17b61d=parseInt(_0x1baa5a);if(_['isNumber'](_0x17b61d)&&_[_0x47a5('0x70')](_0xe3c0a7,_0x17b61d)){_0x2d434c['push']('\x22'+_0x17b61d+'\x22');}else{_0x28b8e9['push'](_0x47a5('0x71'));}break;case _0x47a5('0x72'):if(isEmail(_0x1baa5a)){_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9[_0x47a5('0x45')](_0x47a5('0x73'));}break;case _0x47a5('0x74'):var _0x479a82=moment(_0x1baa5a,'YYYY-MM-DD',!![]);if(_0x479a82[_0x47a5('0x6e')]()){_0x2d434c['push']('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9[_0x47a5('0x45')](_0x47a5('0x75'));}break;case _0x47a5('0x57'):var _0xb16bdd=shared['timezones'];var _0x3c66e3=_0xb16bdd[_0x1baa5a];if(!_['isNil'](_0x3c66e3)){var _0x5f3a04=_0x3c66e3[_0x47a5('0x59')];_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');_0x2d434c['push']('\x22'+_0x5f3a04+'\x22');}break;default:_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}}else{switch(_0x5d6916){case _0x47a5('0x76'):case _0x47a5('0xf'):_0x28b8e9['push'](_0x5d6916+_0x47a5('0x77'));break;default:_0x2d434c['push']('\x22\x22');}}}}if(_0x28b8e9[_0x47a5('0x4e')]){handleError(_0x1cfb37[_0x47a5('0x69')][_0x8f0035],{'code':_0x47a5('0x78'),'message':_0x28b8e9['join']()});}else{fs[_0x47a5('0x79')](_0x4618a0,_0x2d434c[_0x47a5('0x11')]()+'\x0a');}_0x2d434c=[];}if(!(stats[_0x47a5('0x7a')]%0xc8)){socket['emit'](_0x47a5('0x7b')+_0x1155f6,stats);stats['errors']=[];}}if(stopped){logger[_0x47a5('0x3f')]('Abort\x20parser');_0x1f07ac[_0x47a5('0x7c')]();}}catch(_0x20d8bd){handleError(_0x1cfb37[_0x47a5('0x69')][_0x8f0035],{'code':_0x47a5('0x7d'),'message':_0x20d8bd['message']});logger[_0x47a5('0x41')](_0x47a5('0x7e'),_0x20d8bd[_0x47a5('0x42')]);}},'complete':function(){try{var _0x1bbfba=[];var _0x22d84a=[];var _0x57ac25='cm_contacts';if(_0x2b1303[_0x47a5('0x7f')]&&_0x2b1303['duplicates'][_0x47a5('0x4e')]){_0x57ac25=_0x47a5('0x80')+_0x1155f6;_0x1bbfba[_0x47a5('0x45')]('CREATE\x20TABLE\x20'+_0x57ac25+_0x47a5('0x81'));}tmp_campaigns=_0x47a5('0x82')+_0x1155f6;tmp_voice_queues='voice_queues_'+_0x1155f6;_0x22d84a[_0x47a5('0x45')](_0x47a5('0x83')+tmp_campaigns+_0x47a5('0x84'));_0x22d84a[_0x47a5('0x45')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x47a5('0x85')](_0x22d84a,handleTZQuery)[_0x47a5('0x86')](function(_0x48e7f3){updateTzCampaigns(_0x2b1303[_0x47a5('0x1f')])[_0x47a5('0x86')](function(_0x5a0901){updateTzVoiceQueues(_0x2b1303[_0x47a5('0x1f')])[_0x47a5('0x86')](function(_0x2930d9){var _0x59f010=util[_0x47a5('0x87')]('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',_0x4618a0,_0x57ac25,_0x2ac30f,_0x2b1303[_0x47a5('0x1f')],_0x2b1303['CompanyId']||null,NOW,NOW);if(_[_0x47a5('0x58')](_0x308c9a[_0x47a5('0x1d')])){_0x59f010+=',\x20scheduledAt\x20=\x20NOW()';}_0x1bbfba[_0x47a5('0x45')](_0x59f010);if(_0x2b1303['duplicates']&&_0x2b1303[_0x47a5('0x7f')][_0x47a5('0x4e')]){_0x1bbfba[_0x47a5('0x45')](insertCmContact(_0x2b1303[_0x47a5('0x1f')],_0x57ac25,_0x2b1303['duplicates'],_0x308c9a));}if(hasTZ){_0x1bbfba[_0x47a5('0x45')](insertTzCmHopper(_0x2b1303['ListId'],'voice_queues_has_cm_lists',_0x47a5('0x53'),_0x47a5('0x88'),_0x117510,tmp_voice_queues));_0x1bbfba[_0x47a5('0x45')](insertTzCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x89'),'voice_queues',_0x47a5('0x88')));_0x1bbfba[_0x47a5('0x45')](insertTzCmHopper(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x49'),'campaigns',_0x47a5('0x8a'),_0x117510,tmp_campaigns));_0x1bbfba['push'](insertTzCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x8b'),_0x47a5('0x48'),_0x47a5('0x8a')));}else{_0x1bbfba[_0x47a5('0x45')](insertCmHopper(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x8c'),_0x47a5('0x53'),_0x47a5('0x88'),_0x117510));_0x1bbfba['push'](insertCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x89'),'voice_queues',_0x47a5('0x88')));_0x1bbfba[_0x47a5('0x45')](insertCmHopper(_0x2b1303[_0x47a5('0x1f')],'campaigns_has_cm_lists','campaigns',_0x47a5('0x8a'),_0x117510));_0x1bbfba[_0x47a5('0x45')](insertCmHopperBlack(_0x2b1303['ListId'],'campaigns_has_cm_blacklists',_0x47a5('0x48'),_0x47a5('0x8a')));}_0x1bbfba['push'](_0x47a5('0x8d')+tmp_campaigns+';');_0x1bbfba[_0x47a5('0x45')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0x47a5('0x85')](_0x1bbfba,handleQuery)[_0x47a5('0x86')](function(_0x109805){stats[_0x47a5('0x8e')]=!![];stats[_0x47a5('0x8f')]=_0x2b1303[_0x47a5('0x7f')]&&_0x2b1303['duplicates']['length']?results[0x2]['affectedRows']:results[0x0][_0x47a5('0x8f')];socket[_0x47a5('0x90')]('contact:import:'+_0x1155f6,stats);fs[_0x47a5('0x91')](_0x4164a3);fs[_0x47a5('0x91')](_0x4618a0);process[_0x47a5('0x43')](0x0);})[_0x47a5('0x50')](function(_0xcdbfd7){logger['error'](_0xcdbfd7[_0x47a5('0x42')]);process['exit'](0x1);});})['catch'](function(_0x5db0ed){logger[_0x47a5('0x41')](_0x5db0ed['message']);process[_0x47a5('0x43')](0x1);});});});}catch(_0xf3edc8){logger[_0x47a5('0x41')]('complete',_0xf3edc8[_0x47a5('0x42')]);process[_0x47a5('0x43')](0x1);}},'error':function(_0x35bf37,_0x121750,_0x392ad7,_0x581a87){throw new Error(_0x581a87);}});}function validate(){if(process[_0x47a5('0x92')]&&process[_0x47a5('0x92')]['length']<0x4){throw new Error(_0x47a5('0x93'));}var _0x419870=path[_0x47a5('0x11')](config[_0x47a5('0x62')],_0x47a5('0x63'),process[_0x47a5('0x92')][0x2]);if(!fs['existsSync'](_0x419870)){throw new Error(_0x47a5('0x94'));}var _0x2e418d={};try{_0x2e418d=JSON['parse'](process[_0x47a5('0x92')][0x3]);if(!_0x2e418d[_0x47a5('0x60')]){throw new Error(_0x47a5('0x95'));}if(!_0x2e418d[_0x47a5('0x60')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x2e418d['binding']['firstName']){throw new Error(_0x47a5('0x96'));}var _0x27793e=0x0;if(_0x2e418d[_0x47a5('0x60')][_0x47a5('0x34')]){_0x27793e=0x1;}if(!_0x2e418d[_0x47a5('0x1f')]){throw new Error(_0x47a5('0x97'));}}catch(_0xac1f9e){throw new Error(_0x47a5('0x98'));}var _0x4bd164=[];try{_0x4bd164=_[_0x47a5('0x99')](JSON[_0x47a5('0x67')](process[_0x47a5('0x92')][0x4]),'id');}catch(_0x399528){logger['info']('No\x20agent\x20available');}main(_0x419870,_0x2e418d,_0x4bd164,_0x27793e);}validate();process['on'](_0x47a5('0x9a'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
index 1688b52..548691e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9c8=['YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','spread','length','phone','isNil','push','all','then','message','AdditionalPhones','split','filter','findOne','CmContactHasItem','update','updated','create','PHONE','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','UserId','fields','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','toString','into','cm_hopper_black','ContactId','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','cm_contacts',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','Received\x20SIGINT','errors','code','info','catch','binding','clone','socket_timestamp','root','.csv','ContactItemType','findAll','name','keys','header','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','includes','agent\x20not\x20exists','email','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','error','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','CompanyId',',\x20scheduledAt\x20=\x20NOW()','each','contactId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','exit','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','socket.io-emitter','format'];(function(_0x1734ab,_0x254bb2){var _0x41008e=function(_0x131727){while(--_0x131727){_0x1734ab['push'](_0x1734ab['shift']());}};_0x41008e(++_0x254bb2);}(_0xf9c8,0x1c6));var _0x8f9c=function(_0x2fd160,_0x53c0d6){_0x2fd160=_0x2fd160-0x0;var _0x5c2031=_0xf9c8[_0x2fd160];return _0x5c2031;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x8f9c('0x0'));var Papa=require(_0x8f9c('0x1'));var util=require(_0x8f9c('0x2'));var BPromise=require(_0x8f9c('0x3'));var moment=require(_0x8f9c('0x4'));var squel=require(_0x8f9c('0x5'));var Redis=require(_0x8f9c('0x6'));var db=require(_0x8f9c('0x7'))['db'];var config=require(_0x8f9c('0x8'));var logger=require('../../../config/logger')(_0x8f9c('0x9'));config[_0x8f9c('0xa')]=_[_0x8f9c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8f9c('0xc'))(new Redis(config[_0x8f9c('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x8f9c('0xd')](_0x8f9c('0xe'));var tempTableName=_0x8f9c('0xf')+moment()[_0x8f9c('0xd')](_0x8f9c('0x10'));var contactItemTypes=[];var hasAdditionalPhones=![];function isEmail(_0x6b1f0a){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))*$/[_0x8f9c('0x11')](_0x6b1f0a);}function selectNotIn(_0x25bf1c,_0x1a22ba,_0x3f5828,_0x1c36dc,_0x130836){return squel[_0x8f9c('0x12')]()[_0x8f9c('0x13')]('phone')[_0x8f9c('0x14')](_0x1c36dc)[_0x8f9c('0x15')](_0x1a22ba,null,_0x1a22ba+_0x8f9c('0x16')+_0x1c36dc+'.'+_0x3f5828)[_0x8f9c('0x17')](_0x1c36dc+'.'+_0x3f5828+_0x8f9c('0x18')+_0x25bf1c+'.'+_0x3f5828)[_0x8f9c('0x17')](_0x1a22ba+_0x8f9c('0x19')+_0x130836[_0x8f9c('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x43908f,_0x2e0d15){promisesAdditionalPhones=[];promisesContact=[];return db[_0x8f9c('0x1a')][_0x8f9c('0x1b')]('select\x20*\x20from\x20'+tempTableName)[_0x8f9c('0x1c')](function(_0x167346){if(_0x167346!==null){var _0x343df6=[];for(var _0x4f30e2=0x0;_0x4f30e2<_0x167346[_0x8f9c('0x1d')];_0x4f30e2++){var _0x5174f2=_0x167346[_0x4f30e2];if(!_['isNil'](_0x5174f2[_0x8f9c('0x1e')])){if(!_[_0x8f9c('0x1f')](_0x5174f2['AdditionalPhones']))_0x343df6[_0x8f9c('0x20')](insertAdditionalPhones(_0x5174f2));promisesContact[_0x8f9c('0x20')]({'contact':_0x5174f2});}}}Promise[_0x8f9c('0x21')](_0x343df6)[_0x8f9c('0x22')](function(){_0x43908f({'val':0x1});});})['catch'](function(_0x238f08){logger['error'](_0x238f08[_0x8f9c('0x23')]);});});}function insertAdditionalPhones(_0x403736){return new Promise(function(_0x285c88,_0x52d31d){var _0x565e17=_0x403736[_0x8f9c('0x24')];if(_['isNil'](_0x565e17))_0x52d31d({'val':0x0});else{var _0x422d11=_0x565e17[_0x8f9c('0x25')](';');var _0x3da1d0=[];orderBy=0x0;for(var _0x5b452d=0x0;_0x5b452d<_0x422d11[_0x8f9c('0x1d')];_0x5b452d++){_0x3da1d0[_0x8f9c('0x20')](splitAdditionalPhone(_0x403736['id'],_0x422d11[_0x5b452d]));}Promise[_0x8f9c('0x21')](_0x3da1d0)[_0x8f9c('0x22')](function(){_0x285c88({'val':_0x422d11[_0x8f9c('0x1d')]});});}});}function splitAdditionalPhone(_0x24029a,_0x36aad5){return new Promise(function(_0x4d8de4,_0x40065a){var _0x12eeb3=_0x36aad5[_0x8f9c('0x25')](':');var _0x5b353d=_0x12eeb3[0x0];var _0x42700=_0x12eeb3[0x1];if(_0x42700!==''){var _0x5977e5=_0x42700[_0x8f9c('0x25')]('|');var _0x4f67f0=[];for(var _0x1c953d=0x0;_0x1c953d<_0x5977e5[_0x8f9c('0x1d')];_0x1c953d++){if(_0x5977e5[_0x1c953d]!==''){var _0x2717e4=_[_0x8f9c('0x26')](promisesAdditionalPhones,{'contactId':_0x24029a,'phone':_0x5977e5[_0x1c953d]});if(_0x2717e4[_0x8f9c('0x1d')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x24029a,'contactTypeId':_0x5b353d,'phone':_0x5977e5[_0x1c953d],'orderBy':orderBy});}}}_0x4d8de4({'ok':0x1});}else _0x4d8de4({'res':0x0});});}function createAdditionalPhone(_0x4497cd,_0x2cbbd5,_0x49fcbe,_0x160110){return new Promise(function(_0x22444f,_0x131e09){return db['CmContactHasItem'][_0x8f9c('0x27')]({'where':{'CmContactId':_0x4497cd,'item':_0x49fcbe}})[_0x8f9c('0x22')](function(_0x221d3d){if(_0x221d3d){return db[_0x8f9c('0x28')][_0x8f9c('0x29')]({'ItemTypeId':_0x2cbbd5,'OrderBy':_0x160110},{'where':{'CmContactId':_0x4497cd,'item':_0x49fcbe}})[_0x8f9c('0x22')](function(_0x333979){_0x22444f({'res':_0x8f9c('0x2a')});});}else{return db[_0x8f9c('0x28')][_0x8f9c('0x2b')]({'CmContactId':_0x4497cd,'item':_0x49fcbe,'ItemTypeId':_0x2cbbd5,'OrderBy':_0x160110,'ItemClass':_0x8f9c('0x2c')})['then'](function(_0x1003ee){_0x22444f({'res':'inserted'});});}});});}function updateContact(_0x583ec4){return new Promise(function(_0x43183b,_0x417810){var _0x47f0d1=_0x583ec4['id'];delete _0x583ec4['id'];return db['CmContact'][_0x8f9c('0x29')](_0x583ec4,{'where':{'id':_0x47f0d1}})[_0x8f9c('0x22')](function(_0x4ed2d5){updatedRows+=0x1;return db['CmHopper'][_0x8f9c('0x29')]({'phone':_0x583ec4['phone']},{'where':{'ContactId':_0x47f0d1}})[_0x8f9c('0x22')](function(_0x38cb83){_0x43183b({'ret':'OK'});});});});}function insertCmHopper(_0x266cdb,_0x2db82b,_0x3ccd67,_0x297267,_0x3da55f){var _0x2dc872=[_0x8f9c('0x2d'),_0x8f9c('0x2e'),_0x8f9c('0x2f'),_0x8f9c('0x30'),_0x2db82b+'.'+_0x297267,_0x8f9c('0x31'),_0x8f9c('0x32'),'cm_contacts.priority',_0x8f9c('0x33'),'\x22'+_0x3da55f+'\x22'];return squel[_0x8f9c('0x34')]()['into'](_0x8f9c('0x35'))[_0x8f9c('0x36')](['phone',_0x8f9c('0x37'),'ContactId',_0x8f9c('0x38'),_0x297267,_0x8f9c('0x39'),_0x8f9c('0x3a'),'priority',_0x8f9c('0x3b'),'recallme'],squel[_0x8f9c('0x12')]()[_0x8f9c('0x3c')](_0x2dc872)[_0x8f9c('0x14')](_0x2db82b)[_0x8f9c('0x15')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x2db82b+_0x8f9c('0x3d'))[_0x8f9c('0x15')](_0x3ccd67,null,_0x3ccd67+'.id\x20=\x20'+_0x2db82b+'.'+_0x297267)[_0x8f9c('0x17')](_0x2db82b+_0x8f9c('0x3e'),_0x266cdb)[_0x8f9c('0x17')](_0x8f9c('0x3f'),NOW)['where'](_0x8f9c('0x40'),selectNotIn(_0x2db82b,_0x3ccd67,_0x297267,_0x8f9c('0x35'),['\x22always\x22',_0x8f9c('0x41')]))['where'](_0x8f9c('0x40'),selectNotIn(_0x2db82b,_0x3ccd67,_0x297267,_0x8f9c('0x35'),['\x22always\x22'])))[_0x8f9c('0x42')]();}function insertCmHopperBlack(_0x25c601,_0x1c06a1,_0x4e9b79,_0x5c0060){var _0x40be09=[_0x8f9c('0x2d'),_0x8f9c('0x2f'),_0x8f9c('0x30'),_0x1c06a1+'.'+_0x5c0060,_0x8f9c('0x31'),_0x8f9c('0x32')];return squel[_0x8f9c('0x34')]()[_0x8f9c('0x43')](_0x8f9c('0x44'))[_0x8f9c('0x36')]([_0x8f9c('0x1e'),_0x8f9c('0x45'),_0x8f9c('0x38'),_0x5c0060,_0x8f9c('0x39'),'updatedAt'],squel['select']()['fields'](_0x40be09)[_0x8f9c('0x14')](_0x1c06a1)[_0x8f9c('0x15')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x1c06a1+'.CmListId')[_0x8f9c('0x15')](_0x4e9b79,null,_0x4e9b79+_0x8f9c('0x16')+_0x1c06a1+'.'+_0x5c0060)['where'](_0x1c06a1+_0x8f9c('0x3e'),_0x25c601)[_0x8f9c('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x8f9c('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x8f9c('0x12')]()['field'](_0x8f9c('0x1e'))['from'](_0x8f9c('0x44'))[_0x8f9c('0x17')](_0x8f9c('0x46'),_0x25c601)[_0x8f9c('0x17')](_0x5c0060+_0x8f9c('0x47'),_0x1c06a1+'.'+_0x5c0060)))[_0x8f9c('0x42')]();}function insertCmHopperAdditionalPhones(_0x2d52c3){var _0x4069b7=['cm_hopper.id',_0x8f9c('0x48'),_0x8f9c('0x49'),_0x8f9c('0x4a'),_0x8f9c('0x4b')];return squel[_0x8f9c('0x34')]()['into'](_0x8f9c('0x4c'))[_0x8f9c('0x36')]([_0x8f9c('0x4d'),_0x8f9c('0x1e'),_0x8f9c('0x4e'),_0x8f9c('0x39'),_0x8f9c('0x3a')],squel[_0x8f9c('0x12')]()['fields'](_0x4069b7)[_0x8f9c('0x14')](_0x8f9c('0x35'))[_0x8f9c('0x15')]('cm_contacts',null,_0x8f9c('0x4f'))[_0x8f9c('0x15')](_0x8f9c('0x50'),null,_0x8f9c('0x51'))[_0x8f9c('0x17')](_0x8f9c('0x52'),_0x2d52c3)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x8f9c('0x42')]();}function insertCmContact(_0x2967c8,_0x3e5398,_0x44d253,_0x11d29b){var _0x1f6f68=_[_0x8f9c('0x53')](_['keys'](_0x11d29b),[_0x8f9c('0x38'),'CompanyId',_0x8f9c('0x39'),_0x8f9c('0x3a')]);return squel['insert']()['into'](_0x8f9c('0x54'))[_0x8f9c('0x36')](_0x1f6f68,squel[_0x8f9c('0x12')]()[_0x8f9c('0x3c')](_0x1f6f68)[_0x8f9c('0x14')](_0x3e5398)['where']('('+_0x44d253[_0x8f9c('0x15')](',')+_0x8f9c('0x55'),squel['select']()[_0x8f9c('0x3c')](_0x44d253)['from'](_0x8f9c('0x54'))['where'](_0x8f9c('0x46'),_0x2967c8))[_0x8f9c('0x17')]('id\x20IN\x20?',squel[_0x8f9c('0x12')]()[_0x8f9c('0x13')](_0x8f9c('0x56'),_0x8f9c('0x57'))[_0x8f9c('0x14')](_0x3e5398)[_0x8f9c('0x58')](_0x44d253[_0x8f9c('0x15')](','))))[_0x8f9c('0x42')]();}function handleStop(){logger['info'](_0x8f9c('0x59'));stopped=!![];}function handleUncaughtException(_0x49b3b7){logger['error'](_0x49b3b7[_0x8f9c('0x23')]);process['exit'](0x1);}function handleError(_0x91f0b0,_0x5b148c){stats[_0x8f9c('0x5a')][_0x8f9c('0x20')]({'name':_0x5b148c[_0x8f9c('0x5b')],'message':_0x5b148c[_0x8f9c('0x23')],'row':_0x91f0b0});}function handleQuery(_0x51afb4){logger[_0x8f9c('0x5c')](_0x51afb4);return db['sequelize'][_0x8f9c('0x1b')](_0x51afb4)[_0x8f9c('0x1c')](function(_0x4a5483){results['push'](_0x4a5483);})[_0x8f9c('0x5d')](function(_0x26a798){logger['error'](_0x26a798[_0x8f9c('0x23')]);});}function main(_0x1879a0,_0x458086,_0x37b97,_0x162300){logger['info']('main',_0x1879a0,JSON['stringify'](_0x458086));process['send']('start');var _0x47b739=_0x458086[_0x8f9c('0x5e')];var _0x20282a=_[_0x8f9c('0x5f')](_0x47b739);var _0x58bd82=_0x458086[_0x8f9c('0x60')];var _0x4d5cf9=path[_0x8f9c('0x15')](config[_0x8f9c('0x61')],'server/files/tmp',_0x58bd82+_0x8f9c('0x62'));logger[_0x8f9c('0x5c')]('body',_0x458086);db[_0x8f9c('0x63')][_0x8f9c('0x64')]({'raw':!![],'attributes':['id','name']})[_0x8f9c('0x22')](function(_0x31dc0b){for(var _0x4d8771=0x0;_0x4d8771<_0x31dc0b['length'];_0x4d8771++){if(_0x31dc0b[_0x4d8771][_0x8f9c('0x65')]in _0x47b739){contactItemTypes[_0x8f9c('0x20')](_0x31dc0b[_0x4d8771]);delete _0x20282a[_0x31dc0b[_0x4d8771]['name']];hasAdditionalPhones=!![];}else{}}if(hasAdditionalPhones)_0x20282a[_0x8f9c('0x24')]='';var _0x2756cd=_[_0x8f9c('0x66')](_0x20282a)[_0x8f9c('0x15')]();logger['info'](_0x8f9c('0x67'),_0x2756cd);fs[_0x8f9c('0x68')](_0x4d5cf9,_0x2756cd+'\x0a');Papa[_0x8f9c('0x69')](fs[_0x8f9c('0x6a')](_0x1879a0),{'header':!![],'skipEmptyLines':!![],'step':function(_0x362570,_0x415e5b){try{for(var _0x2a2fa5=0x0,_0xf84b56=[];_0x2a2fa5<_0x362570[_0x8f9c('0x6b')][_0x8f9c('0x1d')];_0x2a2fa5++){stats[_0x8f9c('0x6c')]+=0x1;if(_0x362570[_0x8f9c('0x5a')][_0x2a2fa5]){handleError(_0x362570[_0x8f9c('0x6b')][_0x2a2fa5],_0x362570['errors'][_0x2a2fa5]);}else{var _0x897a1b=[];var _0x415bc8=[];for(var _0x5820d9 in _0x47b739){let _0x314a4f=contactItemTypes[_0x8f9c('0x6d')](_0x20d7ea=>_0x20d7ea['name']===_0x5820d9);if(_[_0x8f9c('0x1f')](_0x314a4f)){if(_0x47b739[_0x8f9c('0x6e')](_0x5820d9)){if(_0x362570['data'][_0x2a2fa5][_0x47b739[_0x5820d9]]){var _0x5ba0e1=_[_0x8f9c('0x6f')](_0x362570['data'][_0x2a2fa5][_0x47b739[_0x5820d9]][_0x8f9c('0x70')](/"/g,'\x27'));switch(_0x5820d9){case _0x8f9c('0x37'):var _0x1b0e83=moment(_0x5ba0e1,_0x8f9c('0xe'),!![]);if(_0x1b0e83[_0x8f9c('0x71')]()){_0xf84b56[_0x8f9c('0x20')]('\x22'+_0x5ba0e1+'\x22');}else{_0x897a1b['push'](_0x8f9c('0x72'));}break;case _0x8f9c('0x73'):var _0x104271=parseInt(_0x5ba0e1);_0x5ba0e1=_[_0x8f9c('0x74')](_0x104271)||_0x104271<0x0||_0x104271>0x4?_0x162300?0x3:0x2:_0x104271;_0xf84b56[_0x8f9c('0x20')]('\x22'+_0x5ba0e1+'\x22');break;case _0x8f9c('0x3b'):var _0x15d3fa=parseInt(_0x5ba0e1);if(_['isNumber'](_0x15d3fa)&&_[_0x8f9c('0x75')](_0x37b97,_0x15d3fa)){_0xf84b56['push']('\x22'+_0x15d3fa+'\x22');}else{_0x897a1b[_0x8f9c('0x20')](_0x8f9c('0x76'));}break;case _0x8f9c('0x77'):if(isEmail(_0x5ba0e1)){_0xf84b56['push']('\x22'+_0x5ba0e1+'\x22');}else{_0x897a1b[_0x8f9c('0x20')]('email\x20wrong\x20format');}break;case _0x8f9c('0x78'):var _0x392581=moment(_0x5ba0e1,'YYYY-MM-DD',!![]);if(_0x392581[_0x8f9c('0x71')]()){_0xf84b56[_0x8f9c('0x20')]('\x22'+_0x5ba0e1+'\x22');}else{_0x897a1b['push'](_0x8f9c('0x79'));}break;default:_0xf84b56['push']('\x22'+_0x5ba0e1+'\x22');}}else{switch(_0x5820d9){case _0x8f9c('0x7a'):case'phone':_0x897a1b[_0x8f9c('0x20')](_0x5820d9+_0x8f9c('0x7b'));break;default:_0xf84b56[_0x8f9c('0x20')]('\x22\x22');}}}}else{var _0x3ecee5='';for(var _0x260c71=0x0;_0x260c71<_0x47b739[_0x5820d9][_0x8f9c('0x1d')];_0x260c71++){var _0x5ba0e1=_[_0x8f9c('0x6f')](_0x362570[_0x8f9c('0x6b')][_0x2a2fa5][_0x47b739[_0x5820d9][_0x260c71]][_0x8f9c('0x70')](/"/g,'\x27'));if(_0x3ecee5=='')_0x3ecee5=_0x5ba0e1;else _0x3ecee5+='|'+_0x5ba0e1;}_0x415bc8[_0x8f9c('0x20')](_0x314a4f['id']+':'+_0x3ecee5);}}if(hasAdditionalPhones){_0xf84b56[_0x8f9c('0x20')]('\x22'+_0x415bc8[_0x8f9c('0x15')](';')+'\x22');}if(_0x897a1b[_0x8f9c('0x1d')]){handleError(_0x362570[_0x8f9c('0x6b')][_0x2a2fa5],{'code':_0x8f9c('0x7c'),'message':_0x897a1b[_0x8f9c('0x15')]()});}else{fs[_0x8f9c('0x7d')](_0x4d5cf9,_0xf84b56[_0x8f9c('0x15')]()+'\x0a');}_0xf84b56=[];}if(!(stats[_0x8f9c('0x6c')]%0xc8)){socket[_0x8f9c('0x7e')](_0x8f9c('0x7f')+_0x58bd82,stats);stats[_0x8f9c('0x5a')]=[];}}if(stopped){logger[_0x8f9c('0x5c')](_0x8f9c('0x80'));_0x415e5b[_0x8f9c('0x81')]();}}catch(_0xb23fa6){handleError(_0x362570[_0x8f9c('0x6b')][_0x2a2fa5],{'code':_0x8f9c('0x82'),'message':_0xb23fa6[_0x8f9c('0x23')]});logger[_0x8f9c('0x83')](_0x8f9c('0x84'),_0xb23fa6[_0x8f9c('0x23')]);}},'complete':function(){try{var _0xea9be0=[];var _0x295460=tempTableName;_0xea9be0[_0x8f9c('0x20')](_0x8f9c('0x85')+_0x295460+_0x8f9c('0x86'));logger[_0x8f9c('0x5c')](_0x8f9c('0x87'),contactItemTypes['length']);var _0x44748f=util[_0x8f9c('0xd')]('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',_0x4d5cf9,_0x295460,_0x2756cd,_0x458086[_0x8f9c('0x38')],_0x458086[_0x8f9c('0x88')]||null,NOW,NOW);if(_['isNil'](_0x47b739[_0x8f9c('0x37')])){_0x44748f+=_0x8f9c('0x89');}_0xea9be0[_0x8f9c('0x20')](_0x44748f);BPromise[_0x8f9c('0x8a')](_0xea9be0,handleQuery)['then'](function(_0x289ec0){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0xea9be0=[];for(var _0x587e38=0x0;_0x587e38<promisesContact[_0x8f9c('0x1d')];_0x587e38++){_0xea9be0[_0x8f9c('0x20')](updateContact(promisesContact[_0x587e38]['contact']));}BPromise[_0x8f9c('0x21')](_0xea9be0)[_0x8f9c('0x22')](function(){_0xea9be0=[];for(var _0x3d524c=0x0;_0x3d524c<promisesAdditionalPhones[_0x8f9c('0x1d')];_0x3d524c++){_0xea9be0[_0x8f9c('0x20')](createAdditionalPhone(promisesAdditionalPhones[_0x3d524c][_0x8f9c('0x8b')],promisesAdditionalPhones[_0x3d524c]['contactTypeId'],promisesAdditionalPhones[_0x3d524c][_0x8f9c('0x1e')],promisesAdditionalPhones[_0x3d524c][_0x8f9c('0x8c')]));}BPromise['all'](_0xea9be0)[_0x8f9c('0x22')](function(){_0xea9be0=[];_0xea9be0[_0x8f9c('0x20')](insertCmHopperAdditionalPhones(_0x458086[_0x8f9c('0x38')]));_0xea9be0[_0x8f9c('0x20')](_0x8f9c('0x8d')+_0x295460+';');BPromise[_0x8f9c('0x8a')](_0xea9be0,handleQuery)[_0x8f9c('0x22')](function(_0x14568e){stats[_0x8f9c('0x8e')]=!![];stats[_0x8f9c('0x8f')]=updatedRows;socket[_0x8f9c('0x7e')](_0x8f9c('0x7f')+_0x58bd82,stats);fs[_0x8f9c('0x90')](_0x1879a0);fs[_0x8f9c('0x90')](_0x4d5cf9);process['exit'](0x0);})[_0x8f9c('0x5d')](function(_0x2a0076){logger[_0x8f9c('0x83')](_0x2a0076[_0x8f9c('0x23')]);process['exit'](0x1);});});});});})[_0x8f9c('0x5d')](function(_0x48fb86){logger[_0x8f9c('0x83')](_0x48fb86['message']);process['exit'](0x1);});}catch(_0x50172d){logger[_0x8f9c('0x83')](_0x8f9c('0x91'),_0x50172d[_0x8f9c('0x23')]);process[_0x8f9c('0x92')](0x1);}},'error':function(_0xdf09cb,_0x13dfc2,_0x5e9797,_0x1c11f6){throw new Error(_0x1c11f6);}});});}function validate(){if(process[_0x8f9c('0x93')]&&process[_0x8f9c('0x93')]['length']<0x4){throw new Error(_0x8f9c('0x94'));}var _0x5d4e7d=path[_0x8f9c('0x15')](config[_0x8f9c('0x61')],'server/files/tmp',process[_0x8f9c('0x93')][0x2]);if(!fs['existsSync'](_0x5d4e7d)){throw new Error(_0x8f9c('0x95'));}var _0x3d2fa5={};try{_0x3d2fa5=JSON[_0x8f9c('0x69')](process[_0x8f9c('0x93')][0x3]);if(!_0x3d2fa5[_0x8f9c('0x5e')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x13c324=0x0;if(_0x3d2fa5[_0x8f9c('0x5e')]['UserId']){_0x13c324=0x1;}if(!_0x3d2fa5[_0x8f9c('0x38')]){throw new Error(_0x8f9c('0x96'));}}catch(_0x53b6a6){throw new Error(_0x8f9c('0x97'));}var _0x3035c6=[];try{_0x3035c6=_[_0x8f9c('0x98')](JSON[_0x8f9c('0x69')](process[_0x8f9c('0x93')][0x4]),'id');}catch(_0x44ae44){logger[_0x8f9c('0x5c')](_0x8f9c('0x99'));}main(_0x5d4e7d,_0x3d2fa5,_0x3035c6,_0x13c324);}validate();process['on'](_0x8f9c('0x9a'),handleStop);process['on'](_0x8f9c('0x9b'),handleUncaughtException);
\ No newline at end of file
+var _0xbb95=['file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','cm_contacts_temp_','select','field','phone','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','error','message','split','filter','findOne','CmContactHasItem','update','updated','create','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','insert','cm_hopper_black','fromQuery','fields','.CmListId','from','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','code','stringify','send','start','binding','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','header','parse','createReadStream','rows','errors','data','find','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','Abort\x20parser','SystemError','step','CREATE\x20TABLE\x20',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','exit','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync'];(function(_0x5443ca,_0x5ad082){var _0x505ade=function(_0x24b1b7){while(--_0x24b1b7){_0x5443ca['push'](_0x5443ca['shift']());}};_0x505ade(++_0x5ad082);}(_0xbb95,0x1d8));var _0x5bb9=function(_0x2625ee,_0x44821d){_0x2625ee=_0x2625ee-0x0;var _0x5db885=_0xbb95[_0x2625ee];return _0x5db885;};'use strict';var fs=require('fs');var path=require(_0x5bb9('0x0'));var _=require(_0x5bb9('0x1'));var Papa=require(_0x5bb9('0x2'));var util=require(_0x5bb9('0x3'));var BPromise=require(_0x5bb9('0x4'));var moment=require(_0x5bb9('0x5'));var squel=require(_0x5bb9('0x6'));var Redis=require(_0x5bb9('0x7'));var db=require(_0x5bb9('0x8'))['db'];var config=require(_0x5bb9('0x9'));var logger=require(_0x5bb9('0xa'))(_0x5bb9('0xb'));config[_0x5bb9('0xc')]=_[_0x5bb9('0xd')](config['redis'],{'host':_0x5bb9('0xe'),'port':0x18eb});var socket=require(_0x5bb9('0xf'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x5bb9('0x10')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0x5bb9('0x11')+moment()[_0x5bb9('0x10')]('YYYYMMDDHHmmss');var contactItemTypes=[];var hasAdditionalPhones=![];function isEmail(_0x562055){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'](_0x562055);}function selectNotIn(_0xb5ad59,_0x221d84,_0x27d542,_0x5b1e55,_0x3c93b2){return squel[_0x5bb9('0x12')]()[_0x5bb9('0x13')](_0x5bb9('0x14'))['from'](_0x5b1e55)['join'](_0x221d84,null,_0x221d84+_0x5bb9('0x15')+_0x5b1e55+'.'+_0x27d542)['where'](_0x5b1e55+'.'+_0x27d542+_0x5bb9('0x16')+_0xb5ad59+'.'+_0x27d542)[_0x5bb9('0x17')](_0x221d84+_0x5bb9('0x18')+_0x3c93b2[_0x5bb9('0x19')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5b7274,_0x32f2ee){promisesAdditionalPhones=[];promisesContact=[];return db[_0x5bb9('0x1a')][_0x5bb9('0x1b')](_0x5bb9('0x1c')+tempTableName)[_0x5bb9('0x1d')](function(_0x35c808){if(_0x35c808!==null){var _0x5bd733=[];for(var _0x2073e7=0x0;_0x2073e7<_0x35c808[_0x5bb9('0x1e')];_0x2073e7++){var _0x11d47e=_0x35c808[_0x2073e7];if(!_[_0x5bb9('0x1f')](_0x11d47e[_0x5bb9('0x14')])){if(!_['isNil'](_0x11d47e[_0x5bb9('0x20')]))_0x5bd733[_0x5bb9('0x21')](insertAdditionalPhones(_0x11d47e));promisesContact['push']({'contact':_0x11d47e});}}}Promise[_0x5bb9('0x22')](_0x5bd733)[_0x5bb9('0x23')](function(){_0x5b7274({'val':0x1});});})[_0x5bb9('0x24')](function(_0x307386){logger[_0x5bb9('0x25')](_0x307386[_0x5bb9('0x26')]);});});}function insertAdditionalPhones(_0x5a1d78){return new Promise(function(_0x83e79f,_0x30dbd3){var _0x4242bc=_0x5a1d78[_0x5bb9('0x20')];if(_[_0x5bb9('0x1f')](_0x4242bc))_0x30dbd3({'val':0x0});else{var _0x51de9a=_0x4242bc['split'](';');var _0x47907f=[];orderBy=0x0;for(var _0x217ff7=0x0;_0x217ff7<_0x51de9a[_0x5bb9('0x1e')];_0x217ff7++){_0x47907f[_0x5bb9('0x21')](splitAdditionalPhone(_0x5a1d78['id'],_0x51de9a[_0x217ff7]));}Promise[_0x5bb9('0x22')](_0x47907f)[_0x5bb9('0x23')](function(){_0x83e79f({'val':_0x51de9a['length']});});}});}function splitAdditionalPhone(_0x1566eb,_0x4c87c5){return new Promise(function(_0x4d9858,_0x4ac4d2){var _0x532af1=_0x4c87c5['split'](':');var _0x56933a=_0x532af1[0x0];var _0x257224=_0x532af1[0x1];if(_0x257224!==''){var _0x3e9dcb=_0x257224[_0x5bb9('0x27')]('|');var _0x5f4153=[];for(var _0x51d477=0x0;_0x51d477<_0x3e9dcb[_0x5bb9('0x1e')];_0x51d477++){if(_0x3e9dcb[_0x51d477]!==''){var _0x3941ec=_[_0x5bb9('0x28')](promisesAdditionalPhones,{'contactId':_0x1566eb,'phone':_0x3e9dcb[_0x51d477]});if(_0x3941ec['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x1566eb,'contactTypeId':_0x56933a,'phone':_0x3e9dcb[_0x51d477],'orderBy':orderBy});}}}_0x4d9858({'ok':0x1});}else _0x4d9858({'res':0x0});});}function createAdditionalPhone(_0xb5e8f9,_0x549fac,_0x4e1041,_0x41bc6b){return new Promise(function(_0x3b64b6,_0x569af0){return db['CmContactHasItem'][_0x5bb9('0x29')]({'where':{'CmContactId':_0xb5e8f9,'item':_0x4e1041}})[_0x5bb9('0x23')](function(_0x58a6c7){if(_0x58a6c7){return db[_0x5bb9('0x2a')][_0x5bb9('0x2b')]({'ItemTypeId':_0x549fac,'OrderBy':_0x41bc6b},{'where':{'CmContactId':_0xb5e8f9,'item':_0x4e1041}})['then'](function(_0x43360e){_0x3b64b6({'res':_0x5bb9('0x2c')});});}else{return db['CmContactHasItem'][_0x5bb9('0x2d')]({'CmContactId':_0xb5e8f9,'item':_0x4e1041,'ItemTypeId':_0x549fac,'OrderBy':_0x41bc6b,'ItemClass':'PHONE'})[_0x5bb9('0x23')](function(_0x540e1e){_0x3b64b6({'res':_0x5bb9('0x2e')});});}});});}function updateContact(_0x5d9f9c){return new Promise(function(_0x33015a,_0x434953){var _0x4062cc=_0x5d9f9c['id'];delete _0x5d9f9c['id'];return db[_0x5bb9('0x2f')][_0x5bb9('0x2b')](_0x5d9f9c,{'where':{'id':_0x4062cc}})[_0x5bb9('0x23')](function(_0x1bdb4f){updatedRows+=0x1;return db[_0x5bb9('0x30')]['update']({'phone':_0x5d9f9c['phone']},{'where':{'ContactId':_0x4062cc}})[_0x5bb9('0x23')](function(_0x47fb8e){_0x33015a({'ret':'OK'});});});});}function insertCmHopper(_0x5b864a,_0xc22745,_0x3987dd,_0x32aa39,_0x296624){var _0x300a7a=[_0x5bb9('0x31'),_0x5bb9('0x32'),_0x5bb9('0x33'),_0x5bb9('0x34'),_0xc22745+'.'+_0x32aa39,_0x5bb9('0x35'),'cm_contacts.updatedAt',_0x5bb9('0x36'),_0x5bb9('0x37'),'\x22'+_0x296624+'\x22'];return squel['insert']()[_0x5bb9('0x38')](_0x5bb9('0x39'))['fromQuery']([_0x5bb9('0x14'),_0x5bb9('0x3a'),_0x5bb9('0x3b'),_0x5bb9('0x3c'),_0x32aa39,_0x5bb9('0x3d'),_0x5bb9('0x3e'),_0x5bb9('0x3f'),_0x5bb9('0x40'),_0x5bb9('0x41')],squel['select']()['fields'](_0x300a7a)['from'](_0xc22745)[_0x5bb9('0x19')](_0x5bb9('0x42'),null,'cm_contacts.ListId\x20=\x20'+_0xc22745+'.CmListId')[_0x5bb9('0x19')](_0x3987dd,null,_0x3987dd+_0x5bb9('0x15')+_0xc22745+'.'+_0x32aa39)['where'](_0xc22745+_0x5bb9('0x43'),_0x5b864a)['where'](_0x5bb9('0x44'),NOW)[_0x5bb9('0x17')](_0x5bb9('0x45'),selectNotIn(_0xc22745,_0x3987dd,_0x32aa39,_0x5bb9('0x39'),[_0x5bb9('0x46'),_0x5bb9('0x47')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xc22745,_0x3987dd,_0x32aa39,_0x5bb9('0x39'),[_0x5bb9('0x46')])))[_0x5bb9('0x48')]();}function insertCmHopperBlack(_0x4617a3,_0x6504ab,_0x5a6102,_0x483520){var _0x1c209c=[_0x5bb9('0x31'),_0x5bb9('0x33'),_0x5bb9('0x34'),_0x6504ab+'.'+_0x483520,'cm_contacts.createdAt',_0x5bb9('0x49')];return squel[_0x5bb9('0x4a')]()[_0x5bb9('0x38')](_0x5bb9('0x4b'))[_0x5bb9('0x4c')](['phone',_0x5bb9('0x3b'),_0x5bb9('0x3c'),_0x483520,_0x5bb9('0x3d'),_0x5bb9('0x3e')],squel[_0x5bb9('0x12')]()[_0x5bb9('0x4d')](_0x1c209c)['from'](_0x6504ab)[_0x5bb9('0x19')](_0x5bb9('0x42'),null,'cm_contacts.ListId\x20=\x20'+_0x6504ab+_0x5bb9('0x4e'))[_0x5bb9('0x19')](_0x5a6102,null,_0x5a6102+_0x5bb9('0x15')+_0x6504ab+'.'+_0x483520)[_0x5bb9('0x17')](_0x6504ab+_0x5bb9('0x43'),_0x4617a3)[_0x5bb9('0x17')](_0x5bb9('0x44'),NOW)[_0x5bb9('0x17')](_0x5bb9('0x45'),squel['select']()[_0x5bb9('0x13')]('phone')[_0x5bb9('0x4f')](_0x5bb9('0x4b'))[_0x5bb9('0x17')](_0x5bb9('0x50'),_0x4617a3)[_0x5bb9('0x17')](_0x483520+_0x5bb9('0x51'),_0x6504ab+'.'+_0x483520)))[_0x5bb9('0x48')]();}function insertCmHopperAdditionalPhones(_0x294404){var _0x290c68=[_0x5bb9('0x52'),_0x5bb9('0x53'),_0x5bb9('0x54'),'cm_contact_has_items.createdAt',_0x5bb9('0x55')];return squel[_0x5bb9('0x4a')]()[_0x5bb9('0x38')](_0x5bb9('0x56'))['fromQuery'](['CmHopperId',_0x5bb9('0x14'),'OrderBy',_0x5bb9('0x3d'),_0x5bb9('0x3e')],squel[_0x5bb9('0x12')]()[_0x5bb9('0x4d')](_0x290c68)[_0x5bb9('0x4f')]('cm_hopper')[_0x5bb9('0x19')]('cm_contacts',null,_0x5bb9('0x57'))[_0x5bb9('0x19')]('cm_contact_has_items',null,_0x5bb9('0x58'))[_0x5bb9('0x17')](_0x5bb9('0x59'),_0x294404)[_0x5bb9('0x17')](_0x5bb9('0x44'),NOW))['toString']();}function insertCmContact(_0xef0166,_0x39aab5,_0x307ebf,_0x47c1d0){var _0x253e47=_[_0x5bb9('0x5a')](_[_0x5bb9('0x5b')](_0x47c1d0),['ListId',_0x5bb9('0x5c'),_0x5bb9('0x3d'),'updatedAt']);return squel[_0x5bb9('0x4a')]()[_0x5bb9('0x38')](_0x5bb9('0x42'))[_0x5bb9('0x4c')](_0x253e47,squel[_0x5bb9('0x12')]()[_0x5bb9('0x4d')](_0x253e47)[_0x5bb9('0x4f')](_0x39aab5)['where']('('+_0x307ebf[_0x5bb9('0x19')](',')+_0x5bb9('0x5d'),squel[_0x5bb9('0x12')]()[_0x5bb9('0x4d')](_0x307ebf)[_0x5bb9('0x4f')](_0x5bb9('0x42'))[_0x5bb9('0x17')]('ListId\x20=\x20?',_0xef0166))['where'](_0x5bb9('0x5e'),squel[_0x5bb9('0x12')]()[_0x5bb9('0x13')](_0x5bb9('0x5f'),_0x5bb9('0x60'))[_0x5bb9('0x4f')](_0x39aab5)[_0x5bb9('0x61')](_0x307ebf[_0x5bb9('0x19')](','))))['toString']();}function handleStop(){logger[_0x5bb9('0x62')](_0x5bb9('0x63'));stopped=!![];}function handleUncaughtException(_0x54f5b1){logger['error'](_0x54f5b1['message']);process['exit'](0x1);}function handleError(_0x42c2a0,_0x1d1fa1){stats['errors'][_0x5bb9('0x21')]({'name':_0x1d1fa1[_0x5bb9('0x64')],'message':_0x1d1fa1[_0x5bb9('0x26')],'row':_0x42c2a0});}function handleQuery(_0x41a7fe){logger[_0x5bb9('0x62')](_0x41a7fe);return db[_0x5bb9('0x1a')][_0x5bb9('0x1b')](_0x41a7fe)['spread'](function(_0x3c86a3){results[_0x5bb9('0x21')](_0x3c86a3);})['catch'](function(_0x8c0c7c){logger[_0x5bb9('0x25')](_0x8c0c7c[_0x5bb9('0x26')]);});}function main(_0x10200b,_0x48f006,_0x4b9b6e,_0x1986eb){logger[_0x5bb9('0x62')]('main',_0x10200b,JSON[_0x5bb9('0x65')](_0x48f006));process[_0x5bb9('0x66')](_0x5bb9('0x67'));var _0x273643=_0x48f006[_0x5bb9('0x68')];var _0x2c6c93=_['clone'](_0x273643);var _0x4237d5=_0x48f006['socket_timestamp'];var _0x4c1eee=path[_0x5bb9('0x19')](config[_0x5bb9('0x69')],_0x5bb9('0x6a'),_0x4237d5+_0x5bb9('0x6b'));logger[_0x5bb9('0x62')](_0x5bb9('0x6c'),_0x48f006);db[_0x5bb9('0x6d')][_0x5bb9('0x6e')]({'raw':!![],'attributes':['id','name']})[_0x5bb9('0x23')](function(_0x1dbf4a){for(var _0x24d99b=0x0;_0x24d99b<_0x1dbf4a['length'];_0x24d99b++){if(_0x1dbf4a[_0x24d99b][_0x5bb9('0x6f')]in _0x273643){contactItemTypes[_0x5bb9('0x21')](_0x1dbf4a[_0x24d99b]);delete _0x2c6c93[_0x1dbf4a[_0x24d99b][_0x5bb9('0x6f')]];hasAdditionalPhones=!![];}else{}}if(hasAdditionalPhones)_0x2c6c93[_0x5bb9('0x20')]='';var _0x2ee1b4=_[_0x5bb9('0x5b')](_0x2c6c93)[_0x5bb9('0x19')]();logger[_0x5bb9('0x62')](_0x5bb9('0x70'),_0x2ee1b4);fs['writeFileSync'](_0x4c1eee,_0x2ee1b4+'\x0a');Papa[_0x5bb9('0x71')](fs[_0x5bb9('0x72')](_0x10200b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1b8cbf,_0x48d269){try{for(var _0x516dcc=0x0,_0x31b83e=[];_0x516dcc<_0x1b8cbf['data'][_0x5bb9('0x1e')];_0x516dcc++){stats[_0x5bb9('0x73')]+=0x1;if(_0x1b8cbf[_0x5bb9('0x74')][_0x516dcc]){handleError(_0x1b8cbf[_0x5bb9('0x75')][_0x516dcc],_0x1b8cbf[_0x5bb9('0x74')][_0x516dcc]);}else{var _0x4e4bf2=[];var _0x28fc39=[];for(var _0x15c739 in _0x273643){let _0x514f6e=contactItemTypes[_0x5bb9('0x76')](_0x1ac97e=>_0x1ac97e['name']===_0x15c739);if(_[_0x5bb9('0x1f')](_0x514f6e)){if(_0x273643['hasOwnProperty'](_0x15c739)){if(_0x1b8cbf[_0x5bb9('0x75')][_0x516dcc][_0x273643[_0x15c739]]){var _0x3943a6=_[_0x5bb9('0x77')](_0x1b8cbf[_0x5bb9('0x75')][_0x516dcc][_0x273643[_0x15c739]][_0x5bb9('0x78')](/"/g,'\x27'));switch(_0x15c739){case _0x5bb9('0x3a'):var _0x54dc8b=moment(_0x3943a6,_0x5bb9('0x79'),!![]);if(_0x54dc8b[_0x5bb9('0x7a')]()){_0x31b83e[_0x5bb9('0x21')]('\x22'+_0x3943a6+'\x22');}else{_0x4e4bf2['push'](_0x5bb9('0x7b'));}break;case'priority':var _0x372883=parseInt(_0x3943a6);_0x3943a6=_[_0x5bb9('0x7c')](_0x372883)||_0x372883<0x0||_0x372883>0x4?_0x1986eb?0x3:0x2:_0x372883;_0x31b83e[_0x5bb9('0x21')]('\x22'+_0x3943a6+'\x22');break;case'UserId':var _0x557efc=parseInt(_0x3943a6);if(_['isNumber'](_0x557efc)&&_['includes'](_0x4b9b6e,_0x557efc)){_0x31b83e[_0x5bb9('0x21')]('\x22'+_0x557efc+'\x22');}else{_0x4e4bf2[_0x5bb9('0x21')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x3943a6)){_0x31b83e[_0x5bb9('0x21')]('\x22'+_0x3943a6+'\x22');}else{_0x4e4bf2[_0x5bb9('0x21')](_0x5bb9('0x7d'));}break;case'dateOfBirth':var _0x364bcf=moment(_0x3943a6,_0x5bb9('0x7e'),!![]);if(_0x364bcf[_0x5bb9('0x7a')]()){_0x31b83e[_0x5bb9('0x21')]('\x22'+_0x3943a6+'\x22');}else{_0x4e4bf2[_0x5bb9('0x21')](_0x5bb9('0x7f'));}break;default:_0x31b83e['push']('\x22'+_0x3943a6+'\x22');}}else{switch(_0x15c739){case _0x5bb9('0x80'):case'phone':_0x4e4bf2[_0x5bb9('0x21')](_0x15c739+_0x5bb9('0x81'));break;default:_0x31b83e[_0x5bb9('0x21')]('\x22\x22');}}}}else{var _0x2ad967='';for(var _0x4f37cd=0x0;_0x4f37cd<_0x273643[_0x15c739][_0x5bb9('0x1e')];_0x4f37cd++){var _0x3943a6=_[_0x5bb9('0x77')](_0x1b8cbf['data'][_0x516dcc][_0x273643[_0x15c739][_0x4f37cd]][_0x5bb9('0x78')](/"/g,'\x27'));if(_0x2ad967=='')_0x2ad967=_0x3943a6;else _0x2ad967+='|'+_0x3943a6;}_0x28fc39['push'](_0x514f6e['id']+':'+_0x2ad967);}}if(hasAdditionalPhones){_0x31b83e[_0x5bb9('0x21')]('\x22'+_0x28fc39[_0x5bb9('0x19')](';')+'\x22');}if(_0x4e4bf2['length']){handleError(_0x1b8cbf[_0x5bb9('0x75')][_0x516dcc],{'code':_0x5bb9('0x82'),'message':_0x4e4bf2[_0x5bb9('0x19')]()});}else{fs[_0x5bb9('0x83')](_0x4c1eee,_0x31b83e[_0x5bb9('0x19')]()+'\x0a');}_0x31b83e=[];}if(!(stats[_0x5bb9('0x73')]%0xc8)){socket['emit']('contact:import:'+_0x4237d5,stats);stats[_0x5bb9('0x74')]=[];}}if(stopped){logger[_0x5bb9('0x62')](_0x5bb9('0x84'));_0x48d269['abort']();}}catch(_0x11fe4d){handleError(_0x1b8cbf[_0x5bb9('0x75')][_0x516dcc],{'code':_0x5bb9('0x85'),'message':_0x11fe4d[_0x5bb9('0x26')]});logger[_0x5bb9('0x25')](_0x5bb9('0x86'),_0x11fe4d[_0x5bb9('0x26')]);}},'complete':function(){try{var _0x3c46f4=[];var _0x46fbec=tempTableName;_0x3c46f4[_0x5bb9('0x21')](_0x5bb9('0x87')+_0x46fbec+'\x20LIKE\x20cm_contacts;');logger[_0x5bb9('0x62')]('CIS\x20len',contactItemTypes[_0x5bb9('0x1e')]);var _0x1df321=util[_0x5bb9('0x10')]('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',_0x4c1eee,_0x46fbec,_0x2ee1b4,_0x48f006[_0x5bb9('0x3c')],_0x48f006[_0x5bb9('0x5c')]||null,NOW,NOW);if(_['isNil'](_0x273643['scheduledat'])){_0x1df321+=_0x5bb9('0x88');}_0x3c46f4['push'](_0x1df321);BPromise[_0x5bb9('0x89')](_0x3c46f4,handleQuery)['then'](function(_0x198ac4){BPromise[_0x5bb9('0x22')]([handleAdditionalPhones()])[_0x5bb9('0x23')](function(){_0x3c46f4=[];for(var _0x3c616e=0x0;_0x3c616e<promisesContact[_0x5bb9('0x1e')];_0x3c616e++){_0x3c46f4['push'](updateContact(promisesContact[_0x3c616e][_0x5bb9('0x8a')]));}BPromise['all'](_0x3c46f4)[_0x5bb9('0x23')](function(){_0x3c46f4=[];for(var _0x55b36f=0x0;_0x55b36f<promisesAdditionalPhones[_0x5bb9('0x1e')];_0x55b36f++){_0x3c46f4['push'](createAdditionalPhone(promisesAdditionalPhones[_0x55b36f]['contactId'],promisesAdditionalPhones[_0x55b36f][_0x5bb9('0x8b')],promisesAdditionalPhones[_0x55b36f][_0x5bb9('0x14')],promisesAdditionalPhones[_0x55b36f][_0x5bb9('0x8c')]));}BPromise['all'](_0x3c46f4)[_0x5bb9('0x23')](function(){_0x3c46f4=[];_0x3c46f4[_0x5bb9('0x21')](insertCmHopperAdditionalPhones(_0x48f006[_0x5bb9('0x3c')]));_0x3c46f4[_0x5bb9('0x21')](_0x5bb9('0x8d')+_0x46fbec+';');BPromise['each'](_0x3c46f4,handleQuery)['then'](function(_0x3bf429){stats[_0x5bb9('0x8e')]=!![];stats[_0x5bb9('0x8f')]=updatedRows;socket['emit']('contact:import:'+_0x4237d5,stats);fs['unlink'](_0x10200b);fs['unlink'](_0x4c1eee);process[_0x5bb9('0x90')](0x0);})[_0x5bb9('0x24')](function(_0x1fdedd){logger['error'](_0x1fdedd[_0x5bb9('0x26')]);process['exit'](0x1);});});});});})['catch'](function(_0x248d90){logger[_0x5bb9('0x25')](_0x248d90['message']);process[_0x5bb9('0x90')](0x1);});}catch(_0x22af5){logger[_0x5bb9('0x25')]('complete',_0x22af5[_0x5bb9('0x26')]);process[_0x5bb9('0x90')](0x1);}},'error':function(_0x50cb05,_0x4e84ce,_0x3c0784,_0x59b3e9){throw new Error(_0x59b3e9);}});});}function validate(){if(process[_0x5bb9('0x91')]&&process[_0x5bb9('0x91')][_0x5bb9('0x1e')]<0x4){throw new Error(_0x5bb9('0x92'));}var _0x2b2415=path[_0x5bb9('0x19')](config['root'],'server/files/tmp',process[_0x5bb9('0x91')][0x2]);if(!fs[_0x5bb9('0x93')](_0x2b2415)){throw new Error(_0x5bb9('0x94'));}var _0x4a9d44={};try{_0x4a9d44=JSON[_0x5bb9('0x71')](process[_0x5bb9('0x91')][0x3]);if(!_0x4a9d44[_0x5bb9('0x68')]){throw new Error(_0x5bb9('0x95'));}var _0x48d32d=0x0;if(_0x4a9d44[_0x5bb9('0x68')][_0x5bb9('0x40')]){_0x48d32d=0x1;}if(!_0x4a9d44[_0x5bb9('0x3c')]){throw new Error(_0x5bb9('0x96'));}}catch(_0x39e142){throw new Error(_0x5bb9('0x97'));}var _0x3b5f7f=[];try{_0x3b5f7f=_[_0x5bb9('0x98')](JSON[_0x5bb9('0x71')](process['argv'][0x4]),'id');}catch(_0x34a46a){logger[_0x5bb9('0x62')](_0x5bb9('0x99'));}main(_0x2b2415,_0x4a9d44,_0x3b5f7f,_0x48d32d);}validate();process['on']('SIGINT',handleStop);process['on'](_0x5bb9('0x9a'),handleUncaughtException);
\ No newline at end of file
index 9971afd..beb806e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd914=['inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','UniqueId','starttime','Answer\x20Time','endtime','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','queue','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions'];(function(_0x5da58e,_0x3c9428){var _0x2a3d47=function(_0x4562da){while(--_0x4562da){_0x5da58e['push'](_0x5da58e['shift']());}};_0x2a3d47(++_0x3c9428);}(_0xd914,0x17f));var _0x4d91=function(_0x41582d,_0x291b1c){_0x41582d=_0x41582d-0x0;var _0x59c504=_0xd914[_0x41582d];return _0x59c504;};'use strict';exports[_0x4d91('0x0')]=function(_0x200f66,_0x4c9a1f){var _0x212202=[{'type':_0x4d91('0x1'),'content':_0x4d91('0x2'),'variableName':null}];switch(_0x200f66[_0x4d91('0x3')]()){case _0x4d91('0x4'):switch(_0x4c9a1f[_0x4d91('0x3')]()){case'inbound':_0x212202[_0x4d91('0x5')]({'type':'variable','content':'','variableName':_0x4d91('0x6')});_0x212202[_0x4d91('0x5')]({'type':_0x4d91('0x7'),'content':'','variableName':_0x4d91('0x8')});break;case _0x4d91('0x9'):_0x212202[_0x4d91('0x5')]({'type':_0x4d91('0x1'),'content':_0x4d91('0xa'),'variableName':null});_0x212202['push']({'type':_0x4d91('0x7'),'content':'','variableName':_0x4d91('0xb')});break;}}return _0x212202;};exports[_0x4d91('0xc')]=function(_0x278648,_0xb234d2){var _0x266b31=[];switch(_0x278648['toLowerCase']()){case'voice':switch(_0xb234d2[_0x4d91('0x3')]()){case _0x4d91('0xd'):_0x266b31=[{'type':_0x4d91('0x1'),'content':_0x4d91('0xe'),'key':null,'keyType':null,'variableName':null},{'type':_0x4d91('0xf'),'content':'','key':_0x4d91('0x10'),'keyType':'variable','variableName':'calleridnum'},{'type':_0x4d91('0xf'),'content':'','key':_0x4d91('0x11'),'keyType':_0x4d91('0x7'),'variableName':_0x4d91('0x12')},{'type':_0x4d91('0xf'),'content':'','key':_0x4d91('0x13'),'keyType':_0x4d91('0x7'),'variableName':'destexten'},{'type':_0x4d91('0xf'),'content':'','key':_0x4d91('0x14'),'keyType':_0x4d91('0x7'),'variableName':_0x4d91('0x6')},{'type':_0x4d91('0xf'),'content':'','key':'UniqueId','keyType':_0x4d91('0x7'),'variableName':_0x4d91('0x15')},{'type':_0x4d91('0xf'),'content':'','key':_0x4d91('0x16'),'keyType':'variable','variableName':_0x4d91('0x17')},{'type':_0x4d91('0x1'),'content':_0x4d91('0x18'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x4d91('0x19'),'keyType':_0x4d91('0x7'),'variableName':_0x4d91('0x1a')},{'type':_0x4d91('0xf'),'content':'','key':_0x4d91('0x1b'),'keyType':_0x4d91('0x7'),'variableName':_0x4d91('0xb')},{'type':_0x4d91('0x1'),'content':_0x4d91('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':_0x4d91('0xf'),'content':'','key':'Agent\x20Ring','keyType':_0x4d91('0x7'),'variableName':'agentcalledAt'},{'type':'keyValue','content':'','key':_0x4d91('0x1d'),'keyType':_0x4d91('0x7'),'variableName':_0x4d91('0x1e')},{'type':_0x4d91('0xf'),'content':'','key':_0x4d91('0x1f'),'keyType':_0x4d91('0x7'),'variableName':_0x4d91('0x20')},{'type':_0x4d91('0xf'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':_0x4d91('0x21')},{'type':_0x4d91('0xf'),'content':'','key':_0x4d91('0x22'),'keyType':_0x4d91('0x7'),'variableName':_0x4d91('0x23')}];break;case _0x4d91('0x9'):_0x266b31=[{'type':_0x4d91('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x4d91('0xf'),'content':'','key':_0x4d91('0x24'),'keyType':_0x4d91('0x7'),'keyContent':'','variableName':'destcalleridnum'},{'type':'keyValue','content':'','key':_0x4d91('0x25'),'keyType':_0x4d91('0x7'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0x4d91('0x26'),'keyType':_0x4d91('0x7'),'keyContent':'','variableName':_0x4d91('0x15')},{'type':_0x4d91('0xf'),'content':'','key':'Date','keyType':_0x4d91('0x7'),'keyContent':'','variableName':_0x4d91('0x27')},{'type':_0x4d91('0x1'),'content':_0x4d91('0x1c')},{'type':_0x4d91('0xf'),'content':'','key':_0x4d91('0x28'),'keyType':_0x4d91('0x7'),'keyContent':'','variableName':'answertime'},{'type':_0x4d91('0xf'),'content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':_0x4d91('0x29')},{'type':_0x4d91('0xf'),'content':'','key':'Duration','keyType':_0x4d91('0x7'),'keyContent':'','variableName':_0x4d91('0x2a')},{'type':_0x4d91('0xf'),'content':'','key':_0x4d91('0x2b'),'keyType':_0x4d91('0x7'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x266b31;};
\ No newline at end of file
+var _0x26f9=['voice','inbound','push','variable','queue','calleridnum','outbound','string','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Call\x20To','destexten','Queue','Date','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','Called\x20Number','membername','uniqueid','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects','toLowerCase'];(function(_0x2af08e,_0x11964d){var _0x21537c=function(_0xc3acb5){while(--_0xc3acb5){_0x2af08e['push'](_0x2af08e['shift']());}};_0x21537c(++_0x11964d);}(_0x26f9,0x16f));var _0x926f=function(_0x57a9e5,_0x5009df){_0x57a9e5=_0x57a9e5-0x0;var _0x36d39e=_0x26f9[_0x57a9e5];return _0x36d39e;};'use strict';exports[_0x926f('0x0')]=function(_0x25c3af,_0x4fdca2){var _0x39ab6f=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x25c3af[_0x926f('0x1')]()){case _0x926f('0x2'):switch(_0x4fdca2['toLowerCase']()){case _0x926f('0x3'):_0x39ab6f[_0x926f('0x4')]({'type':_0x926f('0x5'),'content':'','variableName':_0x926f('0x6')});_0x39ab6f[_0x926f('0x4')]({'type':_0x926f('0x5'),'content':'','variableName':_0x926f('0x7')});break;case _0x926f('0x8'):_0x39ab6f[_0x926f('0x4')]({'type':_0x926f('0x9'),'content':'Outbound\x20Call','variableName':null});_0x39ab6f[_0x926f('0x4')]({'type':'variable','content':'','variableName':_0x926f('0xa')});break;}}return _0x39ab6f;};exports[_0x926f('0xb')]=function(_0x4f7d2c,_0x3d3802){var _0x2ae81c=[];switch(_0x4f7d2c[_0x926f('0x1')]()){case _0x926f('0x2'):switch(_0x3d3802[_0x926f('0x1')]()){case'inbound':_0x2ae81c=[{'type':_0x926f('0x9'),'content':_0x926f('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x926f('0xd'),'content':'','key':_0x926f('0xe'),'keyType':_0x926f('0x5'),'variableName':_0x926f('0x7')},{'type':_0x926f('0xd'),'content':'','key':'Caller\x20Name','keyType':'variable','variableName':'calleridname'},{'type':_0x926f('0xd'),'content':'','key':_0x926f('0xf'),'keyType':_0x926f('0x5'),'variableName':_0x926f('0x10')},{'type':'keyValue','content':'','key':_0x926f('0x11'),'keyType':_0x926f('0x5'),'variableName':'queue'},{'type':_0x926f('0xd'),'content':'','key':'UniqueId','keyType':_0x926f('0x5'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x926f('0x12'),'keyType':_0x926f('0x5'),'variableName':'agentcalledAt'},{'type':_0x926f('0x9'),'content':_0x926f('0x13'),'key':null,'keyType':null,'variableName':null},{'type':_0x926f('0xd'),'content':'','key':'Agent\x20Name','keyType':_0x926f('0x5'),'variableName':_0x926f('0x14')},{'type':'keyValue','content':'','key':_0x926f('0x15'),'keyType':_0x926f('0x5'),'variableName':'destcalleridnum'},{'type':_0x926f('0x9'),'content':_0x926f('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x926f('0xd'),'content':'','key':_0x926f('0x17'),'keyType':_0x926f('0x5'),'variableName':_0x926f('0x18')},{'type':_0x926f('0xd'),'content':'','key':_0x926f('0x19'),'keyType':_0x926f('0x5'),'variableName':_0x926f('0x1a')},{'type':_0x926f('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0x926f('0x5'),'variableName':_0x926f('0x1b')},{'type':'keyValue','content':'','key':_0x926f('0x1c'),'keyType':_0x926f('0x5'),'variableName':_0x926f('0x1d')},{'type':_0x926f('0xd'),'content':'','key':_0x926f('0x1e'),'keyType':_0x926f('0x5'),'variableName':'talktime'}];break;case _0x926f('0x8'):_0x2ae81c=[{'type':'string','content':_0x926f('0xc'),'variableName':null},{'type':_0x926f('0xd'),'content':'','key':_0x926f('0x1f'),'keyType':_0x926f('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x926f('0xd'),'content':'','key':'Member\x20Name','keyType':_0x926f('0x5'),'keyContent':'','variableName':_0x926f('0x20')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x926f('0x5'),'keyContent':'','variableName':_0x926f('0x21')},{'type':'keyValue','content':'','key':_0x926f('0x12'),'keyType':_0x926f('0x5'),'keyContent':'','variableName':'starttime'},{'type':'string','content':_0x926f('0x16')},{'type':_0x926f('0xd'),'content':'','key':_0x926f('0x22'),'keyType':'variable','keyContent':'','variableName':_0x926f('0x23')},{'type':_0x926f('0xd'),'content':'','key':_0x926f('0x24'),'keyType':'variable','keyContent':'','variableName':_0x926f('0x25')},{'type':_0x926f('0xd'),'content':'','key':_0x926f('0x26'),'keyType':_0x926f('0x5'),'keyContent':'','variableName':_0x926f('0x27')},{'type':_0x926f('0xd'),'content':'','key':'Billable\x20Time','keyType':_0x926f('0x5'),'keyContent':'','variableName':_0x926f('0x28')}];break;}}return _0x2ae81c;};
\ No newline at end of file
index f14be8b..4904079 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x710b=['unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','findOne','then','catch','error','tracked','user','query','clone','body','omit','html','phone','fax','lodash','openchannel-interactions','../../config/logger','mail-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x710b,0x110));var _0xb710=function(_0x30b7b0,_0x5255cf){_0x30b7b0=_0x30b7b0-0x0;var _0x5024ef=_0x710b[_0x30b7b0];return _0x5024ef;};'use strict';var _=require(_0xb710('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0xb710('0x1')),'mail':require(_0xb710('0x2'))(_0xb710('0x3')),'fax':require(_0xb710('0x2'))('fax-interactions'),'sms':require(_0xb710('0x2'))(_0xb710('0x4')),'chat':require(_0xb710('0x2'))(_0xb710('0x5')),'whatsapp':require(_0xb710('0x2'))('whatsapp-interactions')};function getInteractionId(_0x376bef,_0x3a3561,_0x5aac4e){if(_0x376bef&&_0x376bef[_[_0xb710('0x6')](_0x5aac4e)+_0xb710('0x7')]){return _0x376bef[_['upperFirst'](_0x5aac4e)+_0xb710('0x7')];}else if(_0x376bef&&_0x376bef['id']){return _0x376bef['id'];}else if(_0x3a3561&&_0x3a3561['id']){return _0x3a3561['id'];}else{return _0xb710('0x8');}}function log(_0x52ba8f,_0x4f995f,_0x3d3c60,_0x459d39,_0x17c9bb,_0x48debd){loggers[_0x17c9bb[_0xb710('0x9')]()][_0x52ba8f](_0xb710('0xa'),_0x48debd['toUpperCase'](),_0x4f995f?_0x4f995f['id']:null,_0x4f995f?_0x4f995f[_0xb710('0xb')]:null,_0x4f995f?_0x4f995f[_0xb710('0xc')]:null,getInteractionId(_0x3d3c60,_0x459d39,_0x17c9bb),_0x3d3c60?JSON[_0xb710('0xd')](_0x3d3c60):_0xb710('0xe'));}function updateUser(_0x2b63b8,_0x48ecf4,_0x33d698,_0xfafe23,_0xf7c1bd){db[_[_0xb710('0x6')](_0xfafe23)+'Interaction'][_0xb710('0xf')]({'where':{'id':getInteractionId(_0x48ecf4,_0x33d698,_0xfafe23)}})[_0xb710('0x10')](function(_0x3862c2){if(_0x3862c2){return _0x3862c2['update']({'UserId':_0x2b63b8?_0x2b63b8['id']:null});}})['then'](function(_0x22f2c9){if(_0x22f2c9){log('info',_0x2b63b8,_0x48ecf4,_0x33d698,_0xfafe23,_0xf7c1bd);}})[_0xb710('0x11')](function(){log(_0xb710('0x12'),_0x2b63b8,_0x48ecf4,_0x33d698,_0xfafe23,_0xf7c1bd);});}exports[_0xb710('0x13')]=function(_0x1e0700,_0x2e0a66){return function(_0x1d6f6d,_0x33d51d,_0x21324c){var _0x45be95=_0x1d6f6d[_0xb710('0x14')];var _0x2b85dd={};var _0x4fe0c1=_0x1d6f6d[_0xb710('0x15')];if(_0x2b85dd){_0x2b85dd=_[_0xb710('0x16')](_0x1d6f6d[_0xb710('0x17')]);_0x2b85dd=_[_0xb710('0x18')](_0x2b85dd,[_0xb710('0x17'),_0xb710('0x19'),_0xb710('0x1a'),_0xb710('0x1b'),'mobile']);}updateUser(_0x45be95,_0x2b85dd,_0x4fe0c1,_0x1e0700,_0x2e0a66);_0x21324c(null);};};
\ No newline at end of file
+var _0x14d8=['mail-interactions','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','Interaction','findOne','then','update','error','user','phone','fax','mobile','lodash','../../mysqldb','openchannel-interactions'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x14d8,0x19d));var _0x814d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x14d8[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x814d('0x0'));var db=require(_0x814d('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x814d('0x2')),'mail':require('../../config/logger')(_0x814d('0x3')),'fax':require(_0x814d('0x4'))(_0x814d('0x5')),'sms':require(_0x814d('0x4'))(_0x814d('0x6')),'chat':require('../../config/logger')(_0x814d('0x7')),'whatsapp':require(_0x814d('0x4'))(_0x814d('0x8'))};function getInteractionId(_0x214b1b,_0x33e556,_0x3e40f3){if(_0x214b1b&&_0x214b1b[_[_0x814d('0x9')](_0x3e40f3)+_0x814d('0xa')]){return _0x214b1b[_[_0x814d('0x9')](_0x3e40f3)+_0x814d('0xa')];}else if(_0x214b1b&&_0x214b1b['id']){return _0x214b1b['id'];}else if(_0x33e556&&_0x33e556['id']){return _0x33e556['id'];}else{return'unknown';}}function log(_0x10771d,_0x2f2efc,_0x13d1f6,_0x21d598,_0x1e3e4a,_0x2a5ca8){loggers[_0x1e3e4a[_0x814d('0xb')]()][_0x10771d](_0x814d('0xc'),_0x2a5ca8[_0x814d('0xd')](),_0x2f2efc?_0x2f2efc['id']:null,_0x2f2efc?_0x2f2efc[_0x814d('0xe')]:null,_0x2f2efc?_0x2f2efc[_0x814d('0xf')]:null,getInteractionId(_0x13d1f6,_0x21d598,_0x1e3e4a),_0x13d1f6?JSON[_0x814d('0x10')](_0x13d1f6):'null');}function updateUser(_0x95034,_0x4f96da,_0x2a424b,_0x1b2334,_0x314a72){db[_[_0x814d('0x9')](_0x1b2334)+_0x814d('0x11')][_0x814d('0x12')]({'where':{'id':getInteractionId(_0x4f96da,_0x2a424b,_0x1b2334)}})[_0x814d('0x13')](function(_0x4e36e0){if(_0x4e36e0){return _0x4e36e0[_0x814d('0x14')]({'UserId':_0x95034?_0x95034['id']:null});}})['then'](function(_0x43acf3){if(_0x43acf3){log('info',_0x95034,_0x4f96da,_0x2a424b,_0x1b2334,_0x314a72);}})['catch'](function(){log(_0x814d('0x15'),_0x95034,_0x4f96da,_0x2a424b,_0x1b2334,_0x314a72);});}exports['tracked']=function(_0x117b10,_0x2a378a){return function(_0x54b428,_0x1eaa05,_0x4c394b){var _0x874900=_0x54b428[_0x814d('0x16')];var _0x7ea747={};var _0x17b6c8=_0x54b428['query'];if(_0x7ea747){_0x7ea747=_['clone'](_0x54b428['body']);_0x7ea747=_['omit'](_0x7ea747,['body','html',_0x814d('0x17'),_0x814d('0x18'),_0x814d('0x19')]);}updateUser(_0x874900,_0x7ea747,_0x17b6c8,_0x117b10,_0x2a378a);_0x4c394b(null);};};
\ No newline at end of file
index 5e748ea..e5656a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0218=['count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','use','License','findOne','then'];(function(_0x399fa6,_0x5cce5b){var _0x5320c2=function(_0x768e6a){while(--_0x768e6a){_0x399fa6['push'](_0x399fa6['shift']());}};_0x5320c2(++_0x5cce5b);}(_0x0218,0x120));var _0x8021=function(_0x41cdde,_0x4bd78c){_0x41cdde=_0x41cdde-0x0;var _0x2dec1e=_0x0218[_0x41cdde];return _0x2dec1e;};'use strict';var crypto=require(_0x8021('0x0'));var util=require(_0x8021('0x1'));var compose=require(_0x8021('0x2'));var db=require(_0x8021('0x3'))['db'];var config=require(_0x8021('0x4'));function getValueFromLicense(_0x52cb0c,_0x5544ec){if(_0x52cb0c&&_0x5544ec){if(_0x5544ec[_0x8021('0x5')]&&_0x5544ec[_0x8021('0x6')]){var _0x5e12de=_0x5544ec[_0x8021('0x5')];var _0x55681a=_0x5544ec['license'];var _0x9d599a=_0x5e12de[_0x8021('0x7')]('-')[0x4];var _0x240283=_0x5e12de['split']('-')[0x0];var _0x5a5f97=crypto[_0x8021('0x8')](_0x8021('0x9'),util[_0x8021('0xa')](_0x8021('0xb'),_0x9d599a,_0x5e12de,_0x240283));var _0x48e8e4=_0x5a5f97[_0x8021('0xc')](_0x55681a,_0x8021('0xd'),_0x8021('0xe'));_0x48e8e4+=_0x5a5f97['final'](_0x8021('0xe'));var _0x1db499=JSON[_0x8021('0xf')](_0x48e8e4);return _0x1db499['hasOwnProperty'](_0x52cb0c)?_0x1db499[_0x52cb0c]:null;}}return null;}function isLimit(_0xcf04a5,_0x3cdd03,_0x41fd1e,_0x36fe1a){var _0x24e0f9=_0x3cdd03;return compose()[_0x8021('0x10')](function(_0x1e0f1d,_0x43f587,_0x494d17){return db[_0x8021('0x11')][_0x8021('0x12')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x339ce0){var _0x527437=getValueFromLicense(_0xcf04a5,_0x339ce0);return _0x527437?_0x527437:_0x24e0f9;})[_0x8021('0x13')](function(_0x498253){_0x24e0f9=_0x498253;return _0x41fd1e[_0x8021('0x14')](_0x36fe1a);})[_0x8021('0x13')](function(_0x831508){if(_0x831508>=_0x24e0f9){return _0x43f587['status'](0x193)[_0x8021('0x15')]({'message':util[_0x8021('0xa')](_0x8021('0x16'),_0xcf04a5)});}_0x494d17();})[_0x8021('0x17')](function(_0x592664){_0x494d17(_0x592664);});});}function isUserLimit(){return isLimit(_0x8021('0x18'),0x1,db[_0x8021('0x19')],{'where':{'$or':[{'role':'admin'},{'role':_0x8021('0x1a')}]}});}exports[_0x8021('0x1b')]=isUserLimit;
\ No newline at end of file
+var _0x7d36=['createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','split'];(function(_0x925102,_0x2d9f9b){var _0xdc7531=function(_0x34efe5){while(--_0x34efe5){_0x925102['push'](_0x925102['shift']());}};_0xdc7531(++_0x2d9f9b);}(_0x7d36,0xbd));var _0x67d3=function(_0x56b6b1,_0x76e73e){_0x56b6b1=_0x56b6b1-0x0;var _0x4b8284=_0x7d36[_0x56b6b1];return _0x4b8284;};'use strict';var crypto=require(_0x67d3('0x0'));var util=require('util');var compose=require(_0x67d3('0x1'));var db=require(_0x67d3('0x2'))['db'];var config=require(_0x67d3('0x3'));function getValueFromLicense(_0x92be94,_0x304b4){if(_0x92be94&&_0x304b4){if(_0x304b4[_0x67d3('0x4')]&&_0x304b4['license']){var _0x65a916=_0x304b4['data1'];var _0x395b61=_0x304b4[_0x67d3('0x5')];var _0x2b925e=_0x65a916[_0x67d3('0x6')]('-')[0x4];var _0x568ff1=_0x65a916[_0x67d3('0x6')]('-')[0x0];var _0x32f3dd=crypto[_0x67d3('0x7')](_0x67d3('0x8'),util[_0x67d3('0x9')](_0x67d3('0xa'),_0x2b925e,_0x65a916,_0x568ff1));var _0x57d9a2=_0x32f3dd[_0x67d3('0xb')](_0x395b61,_0x67d3('0xc'),_0x67d3('0xd'));_0x57d9a2+=_0x32f3dd[_0x67d3('0xe')](_0x67d3('0xd'));var _0xbfffa6=JSON[_0x67d3('0xf')](_0x57d9a2);return _0xbfffa6['hasOwnProperty'](_0x92be94)?_0xbfffa6[_0x92be94]:null;}}return null;}function isLimit(_0x2d94f3,_0x317e50,_0x23049b,_0x2f4332){var _0x1e3bab=_0x317e50;return compose()[_0x67d3('0x10')](function(_0x16030c,_0x4ea9f4,_0x21035a){return db[_0x67d3('0x11')][_0x67d3('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x67d3('0x13')](function(_0xd6b18d){var _0x2a3fb3=getValueFromLicense(_0x2d94f3,_0xd6b18d);return _0x2a3fb3?_0x2a3fb3:_0x1e3bab;})['then'](function(_0x1f361f){_0x1e3bab=_0x1f361f;return _0x23049b[_0x67d3('0x14')](_0x2f4332);})[_0x67d3('0x13')](function(_0x55778f){if(_0x55778f>=_0x1e3bab){return _0x4ea9f4[_0x67d3('0x15')](0x193)[_0x67d3('0x16')]({'message':util[_0x67d3('0x9')](_0x67d3('0x17'),_0x2d94f3)});}_0x21035a();})[_0x67d3('0x18')](function(_0x155527){_0x21035a(_0x155527);});});}function isUserLimit(){return isLimit(_0x67d3('0x19'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x67d3('0x1a')}]}});}exports[_0x67d3('0x1b')]=isUserLimit;
\ No newline at end of file
index 7d17d5b..960b961 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4654=['value','$lte','format','castTo','CAST(','text','field','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','$gt','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','DATE','utcOffset','add','hours','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','split','forEach','shift','match','indexOf','conditions','push','buildExpression','operator','$between'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4654,0x167));var _0x4465=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4654[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4465('0x0'));var moment=require(_0x4465('0x1'));exports[_0x4465('0x2')]=function(_0x4bc8af){var _0x4e1681={'conditions':[]};_0x4e1681[_0x4465('0x3')]=_[_0x4465('0x4')](_0x4bc8af,_0x4465('0x5'))?'or':'and';var _0x4fefa0=_0x4bc8af[_0x4465('0x6')]('[$and]','')[_0x4465('0x6')](_0x4465('0x5'),'')[_0x4465('0x7')]('||');for(var _0x470f55=0x0;_0x470f55<_0x4fefa0['length'];_0x470f55++){var _0x4a07c0=_0x4fefa0[_0x470f55][_0x4465('0x7')](':=');var _0x3f8e74=_0x4a07c0[0x0];var _0x37ad77=_0x4a07c0['slice'](0x1);_0x37ad77[_0x4465('0x8')](function(_0x244afd){var _0x4edbb2=_0x244afd[_0x4465('0x7')]('[')[_0x4465('0x9')]();var _0x4429e2=_0x244afd[_0x4465('0xa')](/\[(.*?)\]/g);_0x4429e2[_0x4465('0x8')](function(_0x58dbe7){var _0xa65fd5=_0x58dbe7[_0x4465('0x7')]('[')['filter'](function(_0x27698e){return _0x27698e[_0x4465('0xb')](']')>-0x1;})['map'](function(_0x1b294b){return _0x1b294b[_0x4465('0x7')](']')[0x0];})[0x0];_0x4e1681[_0x4465('0xc')][_0x4465('0xd')]({'field':_0x3f8e74,'operator':_0x4edbb2,'value':_0xa65fd5});});});}return _0x4e1681;};exports[_0x4465('0xe')]=function(_0x364bec,_0x1a3e36,_0x37941b){var _0x155c2b={};if(_0x1a3e36==='DATE'){if(_0x37941b[_0x4465('0xf')]==='$eq'){_0x37941b[_0x4465('0xf')]=_0x4465('0x10');_0x37941b[_0x4465('0x11')]+=','+_0x37941b['value'];}else if(_['includes'](['$gt',_0x4465('0x12')],_0x37941b['operator'])){_0x37941b['value']=moment(_0x37941b['value'])['add'](0x1,'days')[_0x4465('0x13')]('YYYY-MM-DD');}}if(_0x37941b['castTo']){_0x1a3e36=_0x37941b[_0x4465('0x14')];_0x155c2b['text']=_0x4465('0x15')+_0x364bec+'.'+_0x37941b['field']+'\x20AS\x20'+_0x37941b[_0x4465('0x14')]+')\x20'+parseOperator(_0x37941b[_0x4465('0xf')]);}else{_0x155c2b[_0x4465('0x16')]=_0x364bec+'.'+_0x37941b[_0x4465('0x17')]+'\x20'+parseOperator(_0x37941b[_0x4465('0xf')]);}if(_[_0x4465('0x18')]([_0x4465('0x19'),_0x4465('0x1a')],_0x37941b['operator']))_0x155c2b[_0x4465('0x16')]='('+_0x155c2b['text']+_0x4465('0x1b')+_0x364bec+'.'+_0x37941b[_0x4465('0x17')]+_0x4465('0x1c');_0x155c2b['value']=parseValue(_0x1a3e36,_0x37941b['operator'],_0x37941b[_0x4465('0x11')]);return _0x155c2b;};function parseOperator(_0x291084){var _0x82d8ba;switch(_0x291084){case _0x4465('0x1d'):_0x82d8ba=_0x4465('0x1e');break;case'$notIn':_0x82d8ba=_0x4465('0x1f');break;case'$eq':_0x82d8ba='=\x20?';break;case _0x4465('0x19'):_0x82d8ba='<>\x20?';break;case _0x4465('0x20'):case _0x4465('0x21'):case _0x4465('0x22'):_0x82d8ba=_0x4465('0x23');break;case'$lt':_0x82d8ba=_0x4465('0x24');break;case _0x4465('0x25'):_0x82d8ba='>\x20?';break;case'$lte':_0x82d8ba='<=\x20?';break;case'$gte':_0x82d8ba=_0x4465('0x26');break;case _0x4465('0x10'):_0x82d8ba=_0x4465('0x27');break;}return _0x82d8ba;}function parseValue(_0x414577,_0x5dad91,_0x171e57){var _0x4a2517={'start':undefined,'end':undefined};switch(_0x5dad91){case'$in':case _0x4465('0x1a'):_0x4a2517[_0x4465('0x28')]=_0x171e57[_0x4465('0x7')](',');break;case _0x4465('0x20'):_0x4a2517[_0x4465('0x28')]='%'+_0x171e57+'%';break;case'$startsWith':_0x4a2517[_0x4465('0x28')]=_0x171e57+'%';break;case _0x4465('0x22'):_0x4a2517['start']='%'+_0x171e57;break;case _0x4465('0x10'):var _0x33665d=_0x171e57[_0x4465('0x7')](',');var _0x171e57=_0x33665d[_0x4465('0x9')]();var _0x343a96=_0x33665d[_0x4465('0x29')]();if(_0x414577===_0x4465('0x2a')){_0x171e57=moment(_0x171e57)['utcOffset'](0x0,!![])[_0x4465('0x13')]();_0x343a96=moment(_0x343a96)[_0x4465('0x2b')](0x0,!![])[_0x4465('0x2c')](0x17,_0x4465('0x2d'))[_0x4465('0x2c')](0x3b,'minutes')[_0x4465('0x2c')](0x3b,_0x4465('0x2e'))[_0x4465('0x13')]();}_0x4a2517={'start':_0x171e57,'end':_0x343a96};break;default:_0x4a2517[_0x4465('0x28')]=_0x171e57;break;}return _0x4a2517;}
\ No newline at end of file
+var _0xbb11=['>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$endsWith','pop','utcOffset','hours','minutes','lodash','parseSearch','sqlOperator','and','replace','[$and]','[$or]','split','forEach','shift','match','filter','indexOf','map','conditions','DATE','operator','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0xbb11,0x78));var _0x1bb1=function(_0x1b2ed6,_0x306609){_0x1b2ed6=_0x1b2ed6-0x0;var _0x426956=_0xbb11[_0x1b2ed6];return _0x426956;};'use strict';var _=require(_0x1bb1('0x0'));var moment=require('moment');exports[_0x1bb1('0x1')]=function(_0x239017){var _0x4aa90c={'conditions':[]};_0x4aa90c[_0x1bb1('0x2')]=_['startsWith'](_0x239017,'[$or]')?'or':_0x1bb1('0x3');var _0x337a40=_0x239017[_0x1bb1('0x4')](_0x1bb1('0x5'),'')[_0x1bb1('0x4')](_0x1bb1('0x6'),'')['split']('||');for(var _0x41f701=0x0;_0x41f701<_0x337a40['length'];_0x41f701++){var _0x3fad40=_0x337a40[_0x41f701][_0x1bb1('0x7')](':=');var _0x59b3f0=_0x3fad40[0x0];var _0x58be07=_0x3fad40['slice'](0x1);_0x58be07[_0x1bb1('0x8')](function(_0x51b406){var _0x24b42e=_0x51b406[_0x1bb1('0x7')]('[')[_0x1bb1('0x9')]();var _0x2eae5f=_0x51b406[_0x1bb1('0xa')](/\[(.*?)\]/g);_0x2eae5f['forEach'](function(_0x50bcd4){var _0x3060f5=_0x50bcd4[_0x1bb1('0x7')]('[')[_0x1bb1('0xb')](function(_0x181479){return _0x181479[_0x1bb1('0xc')](']')>-0x1;})[_0x1bb1('0xd')](function(_0x8c8cae){return _0x8c8cae[_0x1bb1('0x7')](']')[0x0];})[0x0];_0x4aa90c[_0x1bb1('0xe')]['push']({'field':_0x59b3f0,'operator':_0x24b42e,'value':_0x3060f5});});});}return _0x4aa90c;};exports['buildExpression']=function(_0x237fa4,_0x1dbd3a,_0xb48418){var _0x31e218={};if(_0x1dbd3a===_0x1bb1('0xf')){if(_0xb48418[_0x1bb1('0x10')]==='$eq'){_0xb48418[_0x1bb1('0x10')]=_0x1bb1('0x11');_0xb48418[_0x1bb1('0x12')]+=','+_0xb48418[_0x1bb1('0x12')];}else if(_['includes']([_0x1bb1('0x13'),_0x1bb1('0x14')],_0xb48418['operator'])){_0xb48418[_0x1bb1('0x12')]=moment(_0xb48418['value'])[_0x1bb1('0x15')](0x1,_0x1bb1('0x16'))[_0x1bb1('0x17')](_0x1bb1('0x18'));}}if(_0xb48418[_0x1bb1('0x19')]){_0x1dbd3a=_0xb48418[_0x1bb1('0x19')];_0x31e218[_0x1bb1('0x1a')]=_0x1bb1('0x1b')+_0x237fa4+'.'+_0xb48418[_0x1bb1('0x1c')]+_0x1bb1('0x1d')+_0xb48418['castTo']+')\x20'+parseOperator(_0xb48418['operator']);}else{_0x31e218[_0x1bb1('0x1a')]=_0x237fa4+'.'+_0xb48418['field']+'\x20'+parseOperator(_0xb48418[_0x1bb1('0x10')]);}if(_[_0x1bb1('0x1e')]([_0x1bb1('0x1f'),_0x1bb1('0x20')],_0xb48418[_0x1bb1('0x10')]))_0x31e218[_0x1bb1('0x1a')]='('+_0x31e218['text']+_0x1bb1('0x21')+_0x237fa4+'.'+_0xb48418['field']+_0x1bb1('0x22');_0x31e218[_0x1bb1('0x12')]=parseValue(_0x1dbd3a,_0xb48418['operator'],_0xb48418[_0x1bb1('0x12')]);return _0x31e218;};function parseOperator(_0xb21b70){var _0x226508;switch(_0xb21b70){case _0x1bb1('0x23'):_0x226508=_0x1bb1('0x24');break;case _0x1bb1('0x20'):_0x226508='NOT\x20IN\x20?';break;case _0x1bb1('0x25'):_0x226508=_0x1bb1('0x26');break;case _0x1bb1('0x1f'):_0x226508=_0x1bb1('0x27');break;case _0x1bb1('0x28'):case _0x1bb1('0x29'):case'$endsWith':_0x226508=_0x1bb1('0x2a');break;case _0x1bb1('0x2b'):_0x226508=_0x1bb1('0x2c');break;case _0x1bb1('0x13'):_0x226508=_0x1bb1('0x2d');break;case _0x1bb1('0x14'):_0x226508=_0x1bb1('0x2e');break;case _0x1bb1('0x2f'):_0x226508=_0x1bb1('0x30');break;case _0x1bb1('0x11'):_0x226508=_0x1bb1('0x31');break;}return _0x226508;}function parseValue(_0xc1fb90,_0x1a0cf9,_0x8a1d65){var _0x5f4d3b={'start':undefined,'end':undefined};switch(_0x1a0cf9){case _0x1bb1('0x23'):case _0x1bb1('0x20'):_0x5f4d3b[_0x1bb1('0x32')]=_0x8a1d65[_0x1bb1('0x7')](',');break;case _0x1bb1('0x28'):_0x5f4d3b[_0x1bb1('0x32')]='%'+_0x8a1d65+'%';break;case _0x1bb1('0x29'):_0x5f4d3b[_0x1bb1('0x32')]=_0x8a1d65+'%';break;case _0x1bb1('0x33'):_0x5f4d3b[_0x1bb1('0x32')]='%'+_0x8a1d65;break;case'$between':var _0x32bde2=_0x8a1d65[_0x1bb1('0x7')](',');var _0x8a1d65=_0x32bde2[_0x1bb1('0x9')]();var _0x107bbe=_0x32bde2[_0x1bb1('0x34')]();if(_0xc1fb90===_0x1bb1('0xf')){_0x8a1d65=moment(_0x8a1d65)[_0x1bb1('0x35')](0x0,!![])[_0x1bb1('0x17')]();_0x107bbe=moment(_0x107bbe)[_0x1bb1('0x35')](0x0,!![])[_0x1bb1('0x15')](0x17,_0x1bb1('0x36'))[_0x1bb1('0x15')](0x3b,_0x1bb1('0x37'))[_0x1bb1('0x15')](0x3b,'seconds')[_0x1bb1('0x17')]();}_0x5f4d3b={'start':_0x8a1d65,'end':_0x107bbe};break;default:_0x5f4d3b[_0x1bb1('0x32')]=_0x8a1d65;break;}return _0x5f4d3b;}
\ No newline at end of file
index d4b9e90..4099e63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8f8=['cast','col','unsigned','substr','DESC','priority','omit','length','isString','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','forEach','push','toString','join','lodash','moment','filters','isEmpty','find','isPlainObject','parse','$gte','format','YYYY-MM-DD','utc','$lte','subtract','isArray','split','limit','offset','sort','map','indexOf'];(function(_0xc42ecf,_0x2819ee){var _0x5d8dc3=function(_0x472e88){while(--_0x472e88){_0xc42ecf['push'](_0xc42ecf['shift']());}};_0x5d8dc3(++_0x2819ee);}(_0xe8f8,0x1da));var _0x8e8f=function(_0x2d6abe,_0x29fd4c){_0x2d6abe=_0x2d6abe-0x0;var _0x5b983f=_0xe8f8[_0x2d6abe];return _0x5b983f;};'use strict';var _=require(_0x8e8f('0x0'));var sequelize=require('sequelize');var moment=require(_0x8e8f('0x1'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0xff13f0){var _0x122d85=null;if(_0xff13f0){_0x122d85=_0xff13f0['split'](',');}return _0x122d85;};exports[_0x8e8f('0x2')]=function(_0x4b3528,_0x5a82ca){var _0x2896af={};if(!_[_0x8e8f('0x3')](_0x4b3528)){_['forOwn'](_0x4b3528,function(_0x10df4c,_0x388dc2){try{if(_0x5a82ca){var _0x1b227d=_[_0x8e8f('0x4')](_0x5a82ca,{'name':_0x388dc2})||{};if(_0x1b227d['type']==='DATE'&&_[_0x8e8f('0x5')](_0x10df4c)){var _0x191a1b=JSON[_0x8e8f('0x6')](_0x10df4c);var _0x599601={'$gte':moment(moment(_0x191a1b[_0x8e8f('0x7')])[_0x8e8f('0x8')](_0x8e8f('0x9')))[_0x8e8f('0xa')]()[_0x8e8f('0x8')](),'$lte':moment(moment(_0x191a1b[_0x8e8f('0xb')])['format']('YYYY-MM-DD'))[_0x8e8f('0xa')]()[_0x8e8f('0xc')](0x1,'s')[_0x8e8f('0x8')]()};_0x2896af[_0x388dc2]=_0x599601;}else{_0x2896af[_0x388dc2]=_[_0x8e8f('0xd')](_0x10df4c)?_0x10df4c:JSON[_0x8e8f('0x6')](_0x10df4c);}}else{_0x2896af[_0x388dc2]=_[_0x8e8f('0xd')](_0x10df4c)?_0x10df4c:JSON[_0x8e8f('0x6')](_0x10df4c);}}catch(_0xce87fa){_0x2896af[_0x388dc2]=_0x10df4c[_0x8e8f('0xe')](',');}});}return _0x2896af;};exports[_0x8e8f('0xf')]=function(_0xc68ee){_0xc68ee=parseInt(_0xc68ee,0xa);if(!_0xc68ee||_0xc68ee<0x0){_0xc68ee=LIMIT_VALUE;}return _0xc68ee;};exports[_0x8e8f('0x10')]=function(_0x363de0){_0x363de0=parseInt(_0x363de0,0xa);if(!_0x363de0||_0x363de0<0x0){_0x363de0=0x0;}return _0x363de0;};exports[_0x8e8f('0x11')]=function(_0x5c2ef4){var _0x206671,_0x222001=null;if(_0x5c2ef4){_0x206671=_0x5c2ef4['split'](',');_0x222001=_[_0x8e8f('0x12')](_0x206671,function(_0x2e0f47){if(_0x2e0f47[_0x8e8f('0x13')]('-')===0x0){return[_0x2e0f47==='priority'?sequelize[_0x8e8f('0x14')](sequelize[_0x8e8f('0x15')]('priority'),_0x8e8f('0x16')):_0x2e0f47[_0x8e8f('0x17')](0x1),_0x8e8f('0x18')];}else{return[_0x2e0f47===_0x8e8f('0x19')?sequelize[_0x8e8f('0x14')](sequelize[_0x8e8f('0x15')](_0x8e8f('0x19')),_0x8e8f('0x16')):_0x2e0f47,'ASC'];}});}return _0x222001;};exports[_0x8e8f('0x1a')]=function(_0x235f9f,_0x4e0e4b){if(_[_0x8e8f('0x3')](_0x235f9f)){return _0x235f9f;}if(_[_0x8e8f('0xd')](_0x235f9f)){for(var _0xae10c0=0x0;_0xae10c0<_0x235f9f[_0x8e8f('0x1b')];_0xae10c0+=0x1){_0x235f9f[_0xae10c0]=this['omit'](_0x235f9f[_0xae10c0],_0x4e0e4b);}return _0x235f9f;}if(!_['isObject'](_0x235f9f)){return _0x235f9f;}if(_[_0x8e8f('0x1c')](_0x4e0e4b)){_0x4e0e4b=[_0x4e0e4b];}if(!_[_0x8e8f('0xd')](_0x4e0e4b)){return _0x235f9f;}for(var _0xafb002=0x0;_0xafb002<_0x4e0e4b[_0x8e8f('0x1b')];_0xafb002+=0x1){_['unset'](_0x235f9f,_0x4e0e4b[_0xafb002]);}for(var _0x2b31af in _0x235f9f){if(_0x235f9f[_0x8e8f('0x1d')](_0x2b31af)){_0x235f9f[_0x2b31af]=this[_0x8e8f('0x1a')](_0x235f9f[_0x2b31af],_0x4e0e4b);}}return _0x235f9f;};exports[_0x8e8f('0x1e')]=function(_0xf71aec){return _0xf71aec[_0x8e8f('0x1f')](RegExp(_0x8e8f('0x20')))?!![]:![];};exports[_0x8e8f('0x21')]=function(_0x14d8a4){return _0x14d8a4[_0x8e8f('0x1f')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x27c888){var _0x9ae544=[];_0x27c888['split']('\x20')[_0x8e8f('0x22')](function(_0x4a68b3){_0x9ae544[_0x8e8f('0x23')]('+'+_0x4a68b3[_0x8e8f('0x24')]()+'*');});return _0x9ae544[_0x8e8f('0x25')]('\x20');};
\ No newline at end of file
+var _0x89ba=['isArray','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isObject','unset','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','getFullTextValue','push','toString','join','lodash','sequelize','moment','split','filters','isEmpty','forOwn','find','type','isPlainObject','parse','$gte','YYYY-MM-DD','format','$lte','utc','subtract'];(function(_0x3d0f05,_0x1e245c){var _0x25f316=function(_0x533969){while(--_0x533969){_0x3d0f05['push'](_0x3d0f05['shift']());}};_0x25f316(++_0x1e245c);}(_0x89ba,0x107));var _0xa89b=function(_0x1e6f1a,_0x598c23){_0x1e6f1a=_0x1e6f1a-0x0;var _0x1240a3=_0x89ba[_0x1e6f1a];return _0x1240a3;};'use strict';var _=require(_0xa89b('0x0'));var sequelize=require(_0xa89b('0x1'));var moment=require(_0xa89b('0x2'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x5bdec9){var _0x4ced8f=null;if(_0x5bdec9){_0x4ced8f=_0x5bdec9[_0xa89b('0x3')](',');}return _0x4ced8f;};exports[_0xa89b('0x4')]=function(_0xcfc567,_0x2323f4){var _0x300202={};if(!_[_0xa89b('0x5')](_0xcfc567)){_[_0xa89b('0x6')](_0xcfc567,function(_0x3fd293,_0x4c2deb){try{if(_0x2323f4){var _0xc5804c=_[_0xa89b('0x7')](_0x2323f4,{'name':_0x4c2deb})||{};if(_0xc5804c[_0xa89b('0x8')]==='DATE'&&_[_0xa89b('0x9')](_0x3fd293)){var _0x50a774=JSON[_0xa89b('0xa')](_0x3fd293);var _0x2ca65b={'$gte':moment(moment(_0x50a774[_0xa89b('0xb')])['format'](_0xa89b('0xc')))['utc']()[_0xa89b('0xd')](),'$lte':moment(moment(_0x50a774[_0xa89b('0xe')])['format'](_0xa89b('0xc')))[_0xa89b('0xf')]()[_0xa89b('0x10')](0x1,'s')[_0xa89b('0xd')]()};_0x300202[_0x4c2deb]=_0x2ca65b;}else{_0x300202[_0x4c2deb]=_[_0xa89b('0x11')](_0x3fd293)?_0x3fd293:JSON[_0xa89b('0xa')](_0x3fd293);}}else{_0x300202[_0x4c2deb]=_['isArray'](_0x3fd293)?_0x3fd293:JSON['parse'](_0x3fd293);}}catch(_0x2dd35){_0x300202[_0x4c2deb]=_0x3fd293[_0xa89b('0x3')](',');}});}return _0x300202;};exports['limit']=function(_0x1e6ba4){_0x1e6ba4=parseInt(_0x1e6ba4,0xa);if(!_0x1e6ba4||_0x1e6ba4<0x0){_0x1e6ba4=LIMIT_VALUE;}return _0x1e6ba4;};exports['offset']=function(_0x5d96ef){_0x5d96ef=parseInt(_0x5d96ef,0xa);if(!_0x5d96ef||_0x5d96ef<0x0){_0x5d96ef=0x0;}return _0x5d96ef;};exports[_0xa89b('0x12')]=function(_0x2d2db0){var _0x207119,_0x38c68e=null;if(_0x2d2db0){_0x207119=_0x2d2db0[_0xa89b('0x3')](',');_0x38c68e=_[_0xa89b('0x13')](_0x207119,function(_0x2594c0){if(_0x2594c0[_0xa89b('0x14')]('-')===0x0){return[_0x2594c0===_0xa89b('0x15')?sequelize[_0xa89b('0x16')](sequelize[_0xa89b('0x17')]('priority'),_0xa89b('0x18')):_0x2594c0[_0xa89b('0x19')](0x1),_0xa89b('0x1a')];}else{return[_0x2594c0===_0xa89b('0x15')?sequelize[_0xa89b('0x16')](sequelize[_0xa89b('0x17')](_0xa89b('0x15')),_0xa89b('0x18')):_0x2594c0,_0xa89b('0x1b')];}});}return _0x38c68e;};exports['omit']=function(_0x4a0b91,_0x16f55c){if(_[_0xa89b('0x5')](_0x4a0b91)){return _0x4a0b91;}if(_[_0xa89b('0x11')](_0x4a0b91)){for(var _0x4774c9=0x0;_0x4774c9<_0x4a0b91['length'];_0x4774c9+=0x1){_0x4a0b91[_0x4774c9]=this[_0xa89b('0x1c')](_0x4a0b91[_0x4774c9],_0x16f55c);}return _0x4a0b91;}if(!_[_0xa89b('0x1d')](_0x4a0b91)){return _0x4a0b91;}if(_['isString'](_0x16f55c)){_0x16f55c=[_0x16f55c];}if(!_[_0xa89b('0x11')](_0x16f55c)){return _0x4a0b91;}for(var _0x51a702=0x0;_0x51a702<_0x16f55c['length'];_0x51a702+=0x1){_[_0xa89b('0x1e')](_0x4a0b91,_0x16f55c[_0x51a702]);}for(var _0x70278d in _0x4a0b91){if(_0x4a0b91[_0xa89b('0x1f')](_0x70278d)){_0x4a0b91[_0x70278d]=this[_0xa89b('0x1c')](_0x4a0b91[_0x70278d],_0x16f55c);}}return _0x4a0b91;};exports[_0xa89b('0x20')]=function(_0x3e4211){return _0x3e4211[_0xa89b('0x21')](RegExp(_0xa89b('0x22')))?!![]:![];};exports[_0xa89b('0x23')]=function(_0x4cd284){return _0x4cd284['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xa89b('0x24')]=function(_0x420022){var _0x545469=[];_0x420022[_0xa89b('0x3')]('\x20')['forEach'](function(_0x2623b1){_0x545469[_0xa89b('0x25')]('+'+_0x2623b1[_0xa89b('0x26')]()+'*');});return _0x545469[_0xa89b('0x27')]('\x20');};
\ No newline at end of file
index 5644f68..4678bee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa60b=['use','static','views','root','/server/views','ejs','renderFile','view\x20engine','html','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','method-override','errorhandler','passport','./environment','../mysqldb','default','get','set','join','public','test','appPath','client','json\x20replacer','toISOString','split'];(function(_0x3db9ff,_0x437eb7){var _0x184158=function(_0x3f0884){while(--_0x3f0884){_0x3db9ff['push'](_0x3db9ff['shift']());}};_0x184158(++_0x437eb7);}(_0xa60b,0x10d));var _0xba60=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa60b[_0x21a9d9];return _0x46adce;};'use strict';var express=require(_0xba60('0x0'));var favicon=require(_0xba60('0x1'));var bodyParser=require(_0xba60('0x2'));var methodOverride=require(_0xba60('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xba60('0x4'));var path=require('path');var passport=require(_0xba60('0x5'));var cors=require('cors');var moment=require('moment');var config=require(_0xba60('0x6'));var db=require(_0xba60('0x7'))['db'];exports[_0xba60('0x8')]=function(_0xc839b7){var _0x1b6e83=_0xc839b7[_0xba60('0x9')]('env');if(_0x1b6e83==='production'){_0xc839b7[_0xba60('0xa')]('appPath',path[_0xba60('0xb')](config['root'],_0xba60('0xc')));}if(_0x1b6e83==='development'||_0x1b6e83===_0xba60('0xd')){_0xc839b7['set'](_0xba60('0xe'),path[_0xba60('0xb')](config['root'],_0xba60('0xf')));_0xc839b7['use'](errorHandler());}_0xc839b7['set'](_0xba60('0x10'),function(_0x1481bf,_0x3a365e){if(this[_0x1481bf]instanceof Date){_0x3a365e=this[_0x1481bf][_0xba60('0x11')]()[_0xba60('0x12')]('.')[0x0]+'Z';}return _0x3a365e;});_0xc839b7[_0xba60('0x13')](express[_0xba60('0x14')](_0xc839b7['get']('appPath')));_0xc839b7['set'](_0xba60('0x15'),config[_0xba60('0x16')]+_0xba60('0x17'));_0xc839b7['engine']('html',require(_0xba60('0x18'))[_0xba60('0x19')]);_0xc839b7['set'](_0xba60('0x1a'),_0xba60('0x1b'));_0xc839b7[_0xba60('0x13')](bodyParser[_0xba60('0x1c')]({'limit':_0xba60('0x1d'),'extended':!![]}));_0xc839b7[_0xba60('0x13')](bodyParser[_0xba60('0x1e')]({'limit':'50mb'}));_0xc839b7[_0xba60('0x13')](cors());_0xc839b7[_0xba60('0x13')](methodOverride());_0xc839b7[_0xba60('0x13')](cookieParser());_0xc839b7[_0xba60('0x13')](passport[_0xba60('0x1f')]());};
\ No newline at end of file
+var _0xf49c=['client','use','json\x20replacer','toISOString','split','static','appPath','/server/views','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','default','get','env','production','set','join','root','public','development','test'];(function(_0xc4e894,_0x427134){var _0x3b864e=function(_0x285e61){while(--_0x285e61){_0xc4e894['push'](_0xc4e894['shift']());}};_0x3b864e(++_0x427134);}(_0xf49c,0x16e));var _0xcf49=function(_0xe463ab,_0x406be7){_0xe463ab=_0xe463ab-0x0;var _0xdebb2a=_0xf49c[_0xe463ab];return _0xdebb2a;};'use strict';var express=require('express');var favicon=require(_0xcf49('0x0'));var bodyParser=require(_0xcf49('0x1'));var methodOverride=require(_0xcf49('0x2'));var cookieParser=require(_0xcf49('0x3'));var errorHandler=require(_0xcf49('0x4'));var path=require(_0xcf49('0x5'));var passport=require('passport');var cors=require(_0xcf49('0x6'));var moment=require(_0xcf49('0x7'));var config=require(_0xcf49('0x8'));var db=require('../mysqldb')['db'];exports[_0xcf49('0x9')]=function(_0x50e802){var _0x3cece4=_0x50e802[_0xcf49('0xa')](_0xcf49('0xb'));if(_0x3cece4===_0xcf49('0xc')){_0x50e802[_0xcf49('0xd')]('appPath',path[_0xcf49('0xe')](config[_0xcf49('0xf')],_0xcf49('0x10')));}if(_0x3cece4===_0xcf49('0x11')||_0x3cece4===_0xcf49('0x12')){_0x50e802[_0xcf49('0xd')]('appPath',path[_0xcf49('0xe')](config[_0xcf49('0xf')],_0xcf49('0x13')));_0x50e802[_0xcf49('0x14')](errorHandler());}_0x50e802[_0xcf49('0xd')](_0xcf49('0x15'),function(_0x3d10f1,_0x438a8f){if(this[_0x3d10f1]instanceof Date){_0x438a8f=this[_0x3d10f1][_0xcf49('0x16')]()[_0xcf49('0x17')]('.')[0x0]+'Z';}return _0x438a8f;});_0x50e802[_0xcf49('0x14')](express[_0xcf49('0x18')](_0x50e802['get'](_0xcf49('0x19'))));_0x50e802[_0xcf49('0xd')]('views',config[_0xcf49('0xf')]+_0xcf49('0x1a'));_0x50e802['engine'](_0xcf49('0x1b'),require(_0xcf49('0x1c'))[_0xcf49('0x1d')]);_0x50e802[_0xcf49('0xd')](_0xcf49('0x1e'),_0xcf49('0x1b'));_0x50e802[_0xcf49('0x14')](bodyParser[_0xcf49('0x1f')]({'limit':_0xcf49('0x20'),'extended':!![]}));_0x50e802[_0xcf49('0x14')](bodyParser[_0xcf49('0x21')]({'limit':_0xcf49('0x20')}));_0x50e802[_0xcf49('0x14')](cors());_0x50e802[_0xcf49('0x14')](methodOverride());_0x50e802[_0xcf49('0x14')](cookieParser());_0x50e802[_0xcf49('0x14')](passport[_0xcf49('0x22')]());};
\ No newline at end of file
index e0ad2f4..d913f12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21d1=['join','md5','update','digest','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','address','127.0.0.1','cpus','map'];(function(_0xc5c6aa,_0x29fa3a){var _0x4e379d=function(_0x1f881f){while(--_0x1f881f){_0xc5c6aa['push'](_0xc5c6aa['shift']());}};_0x4e379d(++_0x29fa3a);}(_0x21d1,0x1c9));var _0x121d=function(_0x3aae45,_0x2da6de){_0x3aae45=_0x3aae45-0x0;var _0x2004cd=_0x21d1[_0x3aae45];return _0x2004cd;};'use strict';var _=require(_0x121d('0x0'));var os=require('os');var crypto=require(_0x121d('0x1'));var machine=require(_0x121d('0x2'));var exec=require(_0x121d('0x3'))[_0x121d('0x4')];function getInterfaces(){var _0x14fd65=[];var _0x550ab5=os['networkInterfaces']();var _0x20b991=_[_0x121d('0x5')](_[_0x121d('0x6')](_0x550ab5));for(var _0x44fa5c=0x0;_0x44fa5c<_0x20b991[_0x121d('0x7')];_0x44fa5c++){var _0x4c47ee=_0x550ab5[_0x20b991[_0x44fa5c]][_0x121d('0x8')](function(_0x2bd1e8){return _0x2bd1e8[_0x121d('0x9')]===_0x121d('0xa')&&_0x2bd1e8[_0x121d('0xb')]===![];});_0x14fd65=_0x14fd65[_0x121d('0xc')](_0x4c47ee);}return _0x14fd65;}function getFirstInterface(){var _0x12df3e=_[_0x121d('0xd')](getInterfaces());return{'macAddress':_0x12df3e&&_0x12df3e[_0x121d('0xe')]?_0x12df3e[_0x121d('0xe')]:'00:00:00:00:00:00','ipAddress':_0x12df3e&&_0x12df3e[_0x121d('0xf')]?_0x12df3e[_0x121d('0xf')]:_0x121d('0x10')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x54b308=_[_0x121d('0x5')](os[_0x121d('0x11')]()[_0x121d('0x12')](function(_0x50c279){return _0x50c279['model'];}))[_0x121d('0x13')](':');return crypto['createHash'](_0x121d('0x14'))[_0x121d('0x15')](_0x54b308)[_0x121d('0x16')]('hex');}exports[_0x121d('0x17')]=function(){switch(os[_0x121d('0x18')]()){case _0x121d('0x19'):return exec(_0x121d('0x1a'),{'encoding':_0x121d('0x1b')})[_0x121d('0x1c')]('\x0d\x0a','');default:var _0xbd872f=getFirstInterface();var _0x317b8a=getCPUhash();var _0x37cb0d=_0x317b8a+'|'+os[_0x121d('0x1d')]()+'|'+_0xbd872f[_0x121d('0x1e')]+'|'+_0xbd872f[_0x121d('0x1f')];var _0x1f93d=crypto['createHash']('md5')['update'](_0x37cb0d)[_0x121d('0x16')](_0x121d('0x20'));return _0x1f93d['substring'](0x0,0x8)+'-'+_0x1f93d[_0x121d('0x21')](0x8,0xc)+'-'+_0x1f93d[_0x121d('0x21')](0xc,0x10)+'-'+_0x1f93d[_0x121d('0x21')](0x10,0x14)+'-'+_0x1f93d[_0x121d('0x21')](0x14);}};
\ No newline at end of file
+var _0x17c4=['child_process','execSync','networkInterfaces','orderBy','keys','length','filter','family','concat','head','mac','address','127.0.0.1','getFirstInterface','md5','digest','hex','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','ipAddress','createHash','update','substring','lodash','crypto','bimedia-machine-uuid'];(function(_0x5b4c5d,_0x10026d){var _0x194ef4=function(_0x10fbdd){while(--_0x10fbdd){_0x5b4c5d['push'](_0x5b4c5d['shift']());}};_0x194ef4(++_0x10026d);}(_0x17c4,0x102));var _0x417c=function(_0x4fef08,_0x4c98c7){_0x4fef08=_0x4fef08-0x0;var _0x1bde5d=_0x17c4[_0x4fef08];return _0x1bde5d;};'use strict';var _=require(_0x417c('0x0'));var os=require('os');var crypto=require(_0x417c('0x1'));var machine=require(_0x417c('0x2'));var exec=require(_0x417c('0x3'))[_0x417c('0x4')];function getInterfaces(){var _0x2e9ccf=[];var _0x6579e5=os[_0x417c('0x5')]();var _0x212ac0=_[_0x417c('0x6')](_[_0x417c('0x7')](_0x6579e5));for(var _0x5d1971=0x0;_0x5d1971<_0x212ac0[_0x417c('0x8')];_0x5d1971++){var _0x117c5d=_0x6579e5[_0x212ac0[_0x5d1971]][_0x417c('0x9')](function(_0xc418d9){return _0xc418d9[_0x417c('0xa')]==='IPv4'&&_0xc418d9['internal']===![];});_0x2e9ccf=_0x2e9ccf[_0x417c('0xb')](_0x117c5d);}return _0x2e9ccf;}function getFirstInterface(){var _0x3d5db1=_[_0x417c('0xc')](getInterfaces());return{'macAddress':_0x3d5db1&&_0x3d5db1[_0x417c('0xd')]?_0x3d5db1[_0x417c('0xd')]:'00:00:00:00:00:00','ipAddress':_0x3d5db1&&_0x3d5db1[_0x417c('0xe')]?_0x3d5db1['address']:_0x417c('0xf')};}exports[_0x417c('0x10')]=getFirstInterface;function getCPUhash(){var _0x413a4b=_[_0x417c('0x6')](os['cpus']()['map'](function(_0x23b22f){return _0x23b22f['model'];}))['join'](':');return crypto['createHash'](_0x417c('0x11'))['update'](_0x413a4b)[_0x417c('0x12')](_0x417c('0x13'));}exports['getUuid']=function(){switch(os[_0x417c('0x14')]()){case _0x417c('0x15'):return exec(_0x417c('0x16'),{'encoding':_0x417c('0x17')})['replace']('\x0d\x0a','');default:var _0x56d121=getFirstInterface();var _0x28bd1d=getCPUhash();var _0x467999=_0x28bd1d+'|'+os[_0x417c('0x18')]()+'|'+_0x56d121['macAddress']+'|'+_0x56d121[_0x417c('0x19')];var _0x1f4824=crypto[_0x417c('0x1a')](_0x417c('0x11'))[_0x417c('0x1b')](_0x467999)[_0x417c('0x12')](_0x417c('0x13'));return _0x1f4824[_0x417c('0x1c')](0x0,0x8)+'-'+_0x1f4824[_0x417c('0x1c')](0x8,0xc)+'-'+_0x1f4824[_0x417c('0x1c')](0xc,0x10)+'-'+_0x1f4824[_0x417c('0x1c')](0x10,0x14)+'-'+_0x1f4824[_0x417c('0x1c')](0x14);}};
\ No newline at end of file
index b42339b..3fc6090 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d91=['../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','createCipher','aes-256-ctr','session','update','utf8','base64','final','createDecipher','secrets','User','findOne','email','|reason|','|machineUuid|','|name|','fullname','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','info','data2','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','catch','error','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','crypto','moment','request-promise','pkginfo','version'];(function(_0x23099a,_0x2b5805){var _0x37d69c=function(_0xd2830e){while(--_0xd2830e){_0x23099a['push'](_0x23099a['shift']());}};_0x37d69c(++_0x2b5805);}(_0x0d91,0x76));var _0x10d9=function(_0x28bc89,_0x1edcd4){_0x28bc89=_0x28bc89-0x0;var _0x31aaa2=_0x0d91[_0x28bc89];return _0x31aaa2;};'use strict';var util=require(_0x10d9('0x0'));var crypto=require(_0x10d9('0x1'));var moment=require(_0x10d9('0x2'));var rp=require(_0x10d9('0x3'));var BPromise=require('bluebird');var pkginfo=require(_0x10d9('0x4'))(module,_0x10d9('0x5'));var db=require(_0x10d9('0x6'))['db'];var config=require('../environment');var hardware=require(_0x10d9('0x7'));var logger=require(_0x10d9('0x8'))(_0x10d9('0x9'));var jira=require('../../api/jira/jira.controller');var HOST=_0x10d9('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x3a49ab){return new BPromise(function(_0x946fc7,_0x26b6cf){var _0x2558bb=util[_0x10d9('0xb')](_0x10d9('0xc'),HOST,_0x3a49ab,module[_0x10d9('0xd')][_0x10d9('0x5')]);if(oldToken){_0x2558bb=util[_0x10d9('0xb')](_0x10d9('0xe'),HOST,_0x3a49ab,module[_0x10d9('0xd')][_0x10d9('0x5')],oldToken);}var _0x2332c7={'uri':_0x2558bb,'method':_0x10d9('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x2332c7)[_0x10d9('0x10')](function(_0x273a4c){_0x946fc7(_0x273a4c);})['catch'](function(_0x2e327c){_0x26b6cf(_0x2e327c);});});}function encryptDate(_0x23f582){var _0x12a2b4=crypto[_0x10d9('0x11')](_0x10d9('0x12'),config['secrets'][_0x10d9('0x13')]);var _0x5b3be6=_0x12a2b4[_0x10d9('0x14')](_0x23f582,_0x10d9('0x15'),_0x10d9('0x16'));_0x5b3be6+=_0x12a2b4[_0x10d9('0x17')](_0x10d9('0x16'));return _0x5b3be6;}function decryptDate(_0x198778){var _0x211df6=crypto[_0x10d9('0x18')](_0x10d9('0x12'),config[_0x10d9('0x19')]['session']);var _0x5658b5=_0x211df6[_0x10d9('0x14')](_0x198778,_0x10d9('0x16'),_0x10d9('0x15'));_0x5658b5+=_0x211df6[_0x10d9('0x17')]('utf8');return _0x5658b5;}function sendJiraAlert(_0x3f5819,_0x206045,_0x1cff55){var _0x8441a5='||FIELD||VALUE||\x0a';return db[_0x10d9('0x1a')][_0x10d9('0x1b')]({'where':{'role':'admin'},'attributes':['fullname',_0x10d9('0x1c')],'raw':!![]})['then'](function(_0x11be56){ADMIN=_0x11be56;_0x8441a5+=_0x10d9('0x1d')+_0x1cff55+'|\x0a';_0x8441a5+='|uuid|'+_0x3f5819+'|\x0a';_0x8441a5+=_0x10d9('0x1e')+_0x206045+'|\x0a';_0x8441a5+=_0x10d9('0x1f')+ADMIN[_0x10d9('0x20')]+'|\x0a';_0x8441a5+=_0x10d9('0x21')+ADMIN[_0x10d9('0x1c')]+'|\x0a';return _0x8441a5;})[_0x10d9('0x10')](function(_0x26ff84){var _0x3a2e97=hardware[_0x10d9('0x22')]()[_0x10d9('0x23')];return jira[_0x10d9('0x24')]({'key':_0x10d9('0x25'),'summary':_0x10d9('0x26'),'description':_0x26ff84,'issuetype':_0x10d9('0x27'),'oldToken':_0x3f5819,'newToken':_0x206045,'email':ADMIN[_0x10d9('0x1c')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x3a2e97});});}function manageLicense(_0x14c4ec,_0x295489){var _0xce87ca=_0x295489[_0x10d9('0x28')]({'plain':!![]});httpRequest(_0x14c4ec)['then'](function(_0x3ba01f){if(oldToken){oldToken=undefined;}if(_0x3ba01f[_0x10d9('0x29')]){if(!_0xce87ca[_0x10d9('0x9')]&&_0xce87ca[_0x10d9('0x9')]!=_0x3ba01f[_0x10d9('0x9')]||_0xce87ca[_0x10d9('0x9')]&&_0xce87ca['data2']){logger[_0x10d9('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0xce87ca[_0x10d9('0x9')]&&!_0xce87ca[_0x10d9('0x2b')]&&_0xce87ca[_0x10d9('0x9')]!=_0x3ba01f[_0x10d9('0x9')]){logger[_0x10d9('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0xce87ca['license']&&!_0xce87ca[_0x10d9('0x2b')]&&_0xce87ca[_0x10d9('0x9')]==_0x3ba01f['license']){return _0x295489;}return _0x295489['update']({'data1':_0x14c4ec,'data2':null,'license':_0x3ba01f[_0x10d9('0x9')]});}else{if(_0x3ba01f[_0x10d9('0x9')]||_0xce87ca[_0x10d9('0x9')]){if(!_0xce87ca['data2']){if(_0xce87ca[_0x10d9('0x2c')]==_0x14c4ec){GRAY_PERIOD_REASON='Disabled';logger[_0x10d9('0x2a')](_0x10d9('0x2d'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0xce87ca['data1'];logger[_0x10d9('0x2a')](_0x10d9('0x2e'),_0xce87ca['data1'],_0x14c4ec);}sendJiraAlert(_0xce87ca[_0x10d9('0x2c')],_0x3ba01f[_0x10d9('0x2f')],GRAY_PERIOD_REASON);logger['info'](_0x10d9('0x30'),GRAY_PERIOD_REASON[_0x10d9('0x31')](),moment()[_0x10d9('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x295489[_0x10d9('0x14')]({'data2':encryptDate(moment()[_0x10d9('0xb')](_0x10d9('0x32')))});}else{if(moment()['diff'](decryptDate(_0xce87ca[_0x10d9('0x2b')]),_0x10d9('0x33'))>DAYS){logger['info'](_0x10d9('0x34'),moment()[_0x10d9('0xb')](_0x10d9('0x32')));return _0x295489[_0x10d9('0x14')]({'data1':_0x14c4ec,'data2':null,'license':null});}}}else{if(_0xce87ca[_0x10d9('0x2c')]!=_0x14c4ec){logger[_0x10d9('0x2a')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xce87ca['data1'],_0x14c4ec);return _0x295489['update']({'data1':_0x14c4ec,'data2':null,'license':null});}}}return _0x295489;})[_0x10d9('0x10')](function(_0x3d4ee8){_0x295489=_0x3d4ee8;})[_0x10d9('0x35')](function(_0x3bc4ab){logger[_0x10d9('0x36')](_0x3bc4ab['message']);})[_0x10d9('0x37')](function(){setTimeout(function(){manageLicense(hardware[_0x10d9('0x38')](),_0x295489);},TIME);});}function defaultLicense(){var _0x24e998=hardware[_0x10d9('0x38')]();if(_0x24e998){return db['License'][_0x10d9('0x39')]({'where':{'id':0x1},'defaults':{'data1':_0x24e998}})[_0x10d9('0x3a')](function(_0xdd2c0d,_0x36a13f){logger[_0x10d9('0x2a')](_0x10d9('0x3b'),_0x24e998);manageLicense(_0x24e998,_0xdd2c0d);})['catch'](function(_0x1eebad){logger[_0x10d9('0x36')](_0x1eebad[_0x10d9('0x3c')]);});}}exports[_0x10d9('0x3d')]=defaultLicense;
\ No newline at end of file
+var _0x341c=['THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','bluebird','pkginfo','version','../../mysqldb','../environment','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','aes-256-ctr','secrets','session','utf8','base64','final','createDecipher','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','|reason|','|uuid|','|machineUuid|','|name|','email','ipAddress','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','data1'];(function(_0xba655c,_0xfcde9c){var _0x1c6573=function(_0x25dbbe){while(--_0x25dbbe){_0xba655c['push'](_0xba655c['shift']());}};_0x1c6573(++_0xfcde9c);}(_0x341c,0xcc));var _0xc341=function(_0xdd2348,_0x5d3232){_0xdd2348=_0xdd2348-0x0;var _0x2e0a02=_0x341c[_0xdd2348];return _0x2e0a02;};'use strict';var util=require(_0xc341('0x0'));var crypto=require('crypto');var moment=require(_0xc341('0x1'));var rp=require('request-promise');var BPromise=require(_0xc341('0x2'));var pkginfo=require(_0xc341('0x3'))(module,_0xc341('0x4'));var db=require(_0xc341('0x5'))['db'];var config=require(_0xc341('0x6'));var hardware=require(_0xc341('0x7'));var logger=require(_0xc341('0x8'))(_0xc341('0x9'));var jira=require('../../api/jira/jira.controller');var HOST=_0xc341('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x13c5b4){return new BPromise(function(_0x296387,_0x31ce96){var _0x3e83c9=util['format'](_0xc341('0xb'),HOST,_0x13c5b4,module[_0xc341('0xc')][_0xc341('0x4')]);if(oldToken){_0x3e83c9=util[_0xc341('0xd')](_0xc341('0xe'),HOST,_0x13c5b4,module[_0xc341('0xc')]['version'],oldToken);}var _0x2d08da={'uri':_0x3e83c9,'method':_0xc341('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x2d08da)[_0xc341('0x10')](function(_0xa0ae63){_0x296387(_0xa0ae63);})[_0xc341('0x11')](function(_0x47591d){_0x31ce96(_0x47591d);});});}function encryptDate(_0x5dd1f8){var _0x551f9d=crypto[_0xc341('0x12')](_0xc341('0x13'),config[_0xc341('0x14')][_0xc341('0x15')]);var _0x245595=_0x551f9d['update'](_0x5dd1f8,_0xc341('0x16'),_0xc341('0x17'));_0x245595+=_0x551f9d[_0xc341('0x18')](_0xc341('0x17'));return _0x245595;}function decryptDate(_0x989024){var _0x2bd235=crypto[_0xc341('0x19')](_0xc341('0x13'),config[_0xc341('0x14')][_0xc341('0x15')]);var _0x1d499c=_0x2bd235['update'](_0x989024,'base64',_0xc341('0x16'));_0x1d499c+=_0x2bd235[_0xc341('0x18')](_0xc341('0x16'));return _0x1d499c;}function sendJiraAlert(_0x31f1ae,_0x1017fc,_0x3555c1){var _0x40242a=_0xc341('0x1a');return db[_0xc341('0x1b')][_0xc341('0x1c')]({'where':{'role':_0xc341('0x1d')},'attributes':[_0xc341('0x1e'),'email'],'raw':!![]})['then'](function(_0x13ae28){ADMIN=_0x13ae28;_0x40242a+=_0xc341('0x1f')+_0x3555c1+'|\x0a';_0x40242a+=_0xc341('0x20')+_0x31f1ae+'|\x0a';_0x40242a+=_0xc341('0x21')+_0x1017fc+'|\x0a';_0x40242a+=_0xc341('0x22')+ADMIN[_0xc341('0x1e')]+'|\x0a';_0x40242a+='|email|'+ADMIN[_0xc341('0x23')]+'|\x0a';return _0x40242a;})[_0xc341('0x10')](function(_0x190599){var _0x5a4912=hardware['getFirstInterface']()[_0xc341('0x24')];return jira['openIssue']({'key':_0xc341('0x25'),'summary':_0xc341('0x26'),'description':_0x190599,'issuetype':_0xc341('0x27'),'oldToken':_0x31f1ae,'newToken':_0x1017fc,'email':ADMIN[_0xc341('0x23')],'name':ADMIN[_0xc341('0x1e')],'reason':GRAY_PERIOD_REASON,'ip':_0x5a4912});});}function manageLicense(_0x56831d,_0x929c58){var _0x3cd7ba=_0x929c58[_0xc341('0x28')]({'plain':!![]});httpRequest(_0x56831d)[_0xc341('0x10')](function(_0x3446b3){if(oldToken){oldToken=undefined;}if(_0x3446b3[_0xc341('0x29')]){if(!_0x3cd7ba[_0xc341('0x9')]&&_0x3cd7ba['license']!=_0x3446b3[_0xc341('0x9')]||_0x3cd7ba[_0xc341('0x9')]&&_0x3cd7ba[_0xc341('0x2a')]){logger[_0xc341('0x2b')](_0xc341('0x2c'));}if(_0x3cd7ba[_0xc341('0x9')]&&!_0x3cd7ba[_0xc341('0x2a')]&&_0x3cd7ba[_0xc341('0x9')]!=_0x3446b3[_0xc341('0x9')]){logger['info'](_0xc341('0x2d'));}if(_0x3cd7ba[_0xc341('0x9')]&&!_0x3cd7ba[_0xc341('0x2a')]&&_0x3cd7ba[_0xc341('0x9')]==_0x3446b3[_0xc341('0x9')]){return _0x929c58;}return _0x929c58[_0xc341('0x2e')]({'data1':_0x56831d,'data2':null,'license':_0x3446b3[_0xc341('0x9')]});}else{if(_0x3446b3[_0xc341('0x9')]||_0x3cd7ba[_0xc341('0x9')]){if(!_0x3cd7ba[_0xc341('0x2a')]){if(_0x3cd7ba[_0xc341('0x2f')]==_0x56831d){GRAY_PERIOD_REASON='Disabled';logger['info'](_0xc341('0x30'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x3cd7ba[_0xc341('0x2f')];logger[_0xc341('0x2b')](_0xc341('0x31'),_0x3cd7ba[_0xc341('0x2f')],_0x56831d);}sendJiraAlert(_0x3cd7ba[_0xc341('0x2f')],_0x3446b3[_0xc341('0x32')],GRAY_PERIOD_REASON);logger[_0xc341('0x2b')](_0xc341('0x33'),GRAY_PERIOD_REASON[_0xc341('0x34')](),moment()['format'](_0xc341('0x35')));return _0x929c58[_0xc341('0x2e')]({'data2':encryptDate(moment()[_0xc341('0xd')](_0xc341('0x35')))});}else{if(moment()[_0xc341('0x36')](decryptDate(_0x3cd7ba['data2']),'days')>DAYS){logger['info'](_0xc341('0x37'),moment()[_0xc341('0xd')](_0xc341('0x35')));return _0x929c58[_0xc341('0x2e')]({'data1':_0x56831d,'data2':null,'license':null});}}}else{if(_0x3cd7ba['data1']!=_0x56831d){logger['info'](_0xc341('0x31'),_0x3cd7ba[_0xc341('0x2f')],_0x56831d);return _0x929c58[_0xc341('0x2e')]({'data1':_0x56831d,'data2':null,'license':null});}}}return _0x929c58;})[_0xc341('0x10')](function(_0x546c73){_0x929c58=_0x546c73;})[_0xc341('0x11')](function(_0x3030df){logger['error'](_0x3030df[_0xc341('0x38')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xc341('0x39')](),_0x929c58);},TIME);});}function defaultLicense(){var _0x2a0cbd=hardware[_0xc341('0x39')]();if(_0x2a0cbd){return db[_0xc341('0x3a')][_0xc341('0x3b')]({'where':{'id':0x1},'defaults':{'data1':_0x2a0cbd}})[_0xc341('0x3c')](function(_0x3aac1a,_0x28a962){logger[_0xc341('0x2b')](_0xc341('0x3d'),_0x2a0cbd);manageLicense(_0x2a0cbd,_0x3aac1a);})[_0xc341('0x11')](function(_0xaf5a3b){logger['error'](_0xaf5a3b[_0xc341('0x38')]);});}}exports[_0xc341('0x3e')]=defaultLicense;
\ No newline at end of file
index 0566929..e8a8098 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21dc=['message','Demo\x20license','getLicense','License','defaults','crypto','util','lodash','moment','./hardware','../../mysqldb','license','data1','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','uuid','getUuid','createDecipher','secrets','gray','add','days','grayReason','machineUuid','changed','2027-01-01T00:00:00.000Z','Breaking\x20license'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x21dc,0x170));var _0xc21d=function(_0x575462,_0xca5071){_0x575462=_0x575462-0x0;var _0x4ef256=_0x21dc[_0x575462];return _0x4ef256;};'use strict';var crypto=require(_0xc21d('0x0'));var util=require(_0xc21d('0x1'));var _=require(_0xc21d('0x2'));var moment=require(_0xc21d('0x3'));var hardware=require(_0xc21d('0x4'));var config=require('../environment');var db=require(_0xc21d('0x5'))['db'];function checkLicense(_0x3de1d3,_0x57fa4e){if(_0x3de1d3){try{var _0x57cdaa=_0x57fa4e||_0x3de1d3[_0xc21d('0x6')];if(_['isEmpty'](_0x57cdaa)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x51637a=_0x3de1d3[_0xc21d('0x7')];var _0x49cd82=_0x3de1d3['data2'];var _0x4be453=_0x51637a[_0xc21d('0x8')]('-')[0x4];var _0xa1366c=_0x51637a[_0xc21d('0x8')]('-')[0x0];var _0x14cf59=crypto['createDecipher'](_0xc21d('0x9'),util[_0xc21d('0xa')](_0xc21d('0xb'),_0x4be453,_0x51637a,_0xa1366c));var _0x3dfbdb=_0x14cf59[_0xc21d('0xc')](_0x57cdaa,_0xc21d('0xd'),_0xc21d('0xe'));_0x3dfbdb+=_0x14cf59[_0xc21d('0xf')]('utf8');var _0xfab17=JSON['parse'](_0x3dfbdb);_0xfab17['demo']=![];_0xfab17[_0xc21d('0x10')]=_0x51637a;_0xfab17['machineUuid']=hardware[_0xc21d('0x11')]();if(_0x49cd82){var _0x4aaee9=crypto[_0xc21d('0x12')](_0xc21d('0x9'),config[_0xc21d('0x13')]['session']);var _0x48d27a=_0x4aaee9[_0xc21d('0xc')](_0x49cd82,_0xc21d('0xd'),_0xc21d('0xe'));_0x48d27a+=_0x4aaee9[_0xc21d('0xf')](_0xc21d('0xe'));_0xfab17[_0xc21d('0x14')]=_0x48d27a;_0xfab17['deadline']=moment(_0x48d27a)[_0xc21d('0x15')](0x7,_0xc21d('0x16'))[_0xc21d('0xa')]();_0xfab17[_0xc21d('0x17')]=_0xfab17[_0xc21d('0x10')]!=_0xfab17[_0xc21d('0x18')]?_0xc21d('0x19'):'disabled';}return _0xfab17;}catch(_0x2bb1bc){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc21d('0x1a'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xc21d('0x1b'),'uuid':_0x3de1d3[_0xc21d('0x7')],'machineUuid':hardware['getUuid'](),'message':_0x2bb1bc[_0xc21d('0x1c')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc21d('0x1a'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xc21d('0x1d'),'uuid':_0x3de1d3[_0xc21d('0x7')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports[_0xc21d('0x1e')]=function(_0x2cb418){return db[_0xc21d('0x1f')]['find'](_[_0xc21d('0x20')](_0x2cb418,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x3536ab){return checkLicense(_0x3536ab,null);});};exports['checkLicense']=checkLicense;
\ No newline at end of file
+var _0xf1b6=['gray','deadline','add','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','getLicense','find','checkLicense','util','moment','./hardware','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','aes-256-ctr','format','%s:%s:%s','update','base64','final','utf8','parse','demo','uuid','machineUuid','getUuid','createDecipher','secrets','session'];(function(_0x517b6b,_0xb51ef0){var _0x597207=function(_0x502b69){while(--_0x502b69){_0x517b6b['push'](_0x517b6b['shift']());}};_0x597207(++_0xb51ef0);}(_0xf1b6,0xd1));var _0x6f1b=function(_0x3626e7,_0x249e28){_0x3626e7=_0x3626e7-0x0;var _0x527270=_0xf1b6[_0x3626e7];return _0x527270;};'use strict';var crypto=require('crypto');var util=require(_0x6f1b('0x0'));var _=require('lodash');var moment=require(_0x6f1b('0x1'));var hardware=require(_0x6f1b('0x2'));var config=require(_0x6f1b('0x3'));var db=require(_0x6f1b('0x4'))['db'];function checkLicense(_0x34b6ec,_0x50602d){if(_0x34b6ec){try{var _0x269ff3=_0x50602d||_0x34b6ec[_0x6f1b('0x5')];if(_[_0x6f1b('0x6')](_0x269ff3)){throw new Error(_0x6f1b('0x7'));}var _0x29734c=_0x34b6ec[_0x6f1b('0x8')];var _0x1449d6=_0x34b6ec[_0x6f1b('0x9')];var _0x23945f=_0x29734c['split']('-')[0x4];var _0x2ca186=_0x29734c['split']('-')[0x0];var _0x400a4c=crypto['createDecipher'](_0x6f1b('0xa'),util[_0x6f1b('0xb')](_0x6f1b('0xc'),_0x23945f,_0x29734c,_0x2ca186));var _0x2b2da4=_0x400a4c[_0x6f1b('0xd')](_0x269ff3,_0x6f1b('0xe'),'utf8');_0x2b2da4+=_0x400a4c[_0x6f1b('0xf')](_0x6f1b('0x10'));var _0x5dc825=JSON[_0x6f1b('0x11')](_0x2b2da4);_0x5dc825[_0x6f1b('0x12')]=![];_0x5dc825[_0x6f1b('0x13')]=_0x29734c;_0x5dc825[_0x6f1b('0x14')]=hardware[_0x6f1b('0x15')]();if(_0x1449d6){var _0x3a6329=crypto[_0x6f1b('0x16')](_0x6f1b('0xa'),config[_0x6f1b('0x17')][_0x6f1b('0x18')]);var _0x52c662=_0x3a6329[_0x6f1b('0xd')](_0x1449d6,_0x6f1b('0xe'),_0x6f1b('0x10'));_0x52c662+=_0x3a6329['final'](_0x6f1b('0x10'));_0x5dc825[_0x6f1b('0x19')]=_0x52c662;_0x5dc825[_0x6f1b('0x1a')]=moment(_0x52c662)[_0x6f1b('0x1b')](0x7,_0x6f1b('0x1c'))[_0x6f1b('0xb')]();_0x5dc825[_0x6f1b('0x1d')]=_0x5dc825[_0x6f1b('0x13')]!=_0x5dc825[_0x6f1b('0x14')]?_0x6f1b('0x1e'):_0x6f1b('0x1f');}return _0x5dc825;}catch(_0x17d535){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6f1b('0x20'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x6f1b('0x21'),'uuid':_0x34b6ec[_0x6f1b('0x8')],'machineUuid':hardware[_0x6f1b('0x15')](),'message':_0x17d535[_0x6f1b('0x22')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6f1b('0x20'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x6f1b('0x23'),'uuid':_0x34b6ec['data1'],'machineUuid':hardware[_0x6f1b('0x15')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports[_0x6f1b('0x24')]=function(_0x26b3c1){return db['License'][_0x6f1b('0x25')](_['defaults'](_0x26b3c1,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x2be32e){return checkLicense(_0x2be32e,null);});};exports[_0x6f1b('0x26')]=checkLicense;
\ No newline at end of file
index a570cfd..62c9d68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3f6=['myappanuglar-secret','app-id','secret','exports','http://localhost:9000'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xb3f6,0x198));var _0x6b3f=function(_0x3cca75,_0x20543b){_0x3cca75=_0x3cca75-0x0;var _0x54658b=_0xb3f6[_0x3cca75];return _0x54658b;};'use strict';module[_0x6b3f('0x0')]={'DOMAIN':_0x6b3f('0x1'),'SESSION_SECRET':_0x6b3f('0x2'),'GOOGLE_ID':_0x6b3f('0x3'),'GOOGLE_SECRET':_0x6b3f('0x4'),'DEBUG':''};
\ No newline at end of file
+var _0x0f6c=['secret','exports','myappanuglar-secret','app-id'];(function(_0x2b863a,_0x48a65e){var _0x2781c8=function(_0x1b2f41){while(--_0x1b2f41){_0x2b863a['push'](_0x2b863a['shift']());}};_0x2781c8(++_0x48a65e);}(_0x0f6c,0xe1));var _0xc0f6=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0f6c[_0x5b644e];return _0x49c6bf;};'use strict';module[_0xc0f6('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xc0f6('0x1'),'GOOGLE_ID':_0xc0f6('0x2'),'GOOGLE_SECRET':_0xc0f6('0x3'),'DEBUG':''};
\ No newline at end of file
index 5e2efcc..f98333f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a9b=['%s-%s.log','level','message','Logger','transports','File','%s-%s','error','info','Console','env','moment','winston','util','path','INFO','join','/var','xcally','format'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x0a9b,0x10f));var _0xb0a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a9b[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xb0a9('0x0'));var winston=require(_0xb0a9('0x1'));var util=require(_0xb0a9('0x2'));var path=require(_0xb0a9('0x3'));var debugLevel=_0xb0a9('0x4');function filename(_0x5e68c7,_0x2e10db){return path[_0xb0a9('0x5')](_0xb0a9('0x6'),'log',_0xb0a9('0x7'),util[_0xb0a9('0x8')](_0xb0a9('0x9'),_0x5e68c7,_0x2e10db));}function formatter(_0x3bdb90,_0x17c436){return util[_0xb0a9('0x8')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xb0a9('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),_0x17c436[_0xb0a9('0xa')]['toUpperCase'](),_0x3bdb90,_0x17c436[_0xb0a9('0xb')]);}module['exports']=function(_0x515530){return new winston[(_0xb0a9('0xc'))]({'transports':[new winston[(_0xb0a9('0xd'))][(_0xb0a9('0xe'))]({'name':util['format'](_0xb0a9('0xf'),_0x515530,_0xb0a9('0x10')),'filename':filename(_0x515530,_0xb0a9('0x10')),'level':_0xb0a9('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x101ce8){return formatter(_0x515530,_0x101ce8);}}),new winston[(_0xb0a9('0xd'))][(_0xb0a9('0xe'))]({'name':util[_0xb0a9('0x8')](_0xb0a9('0xf'),_0x515530,'info'),'filename':filename(_0x515530,_0xb0a9('0x11')),'level':_0xb0a9('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1449fb){return formatter(_0x515530,_0x1449fb);}}),new winston[(_0xb0a9('0xd'))][(_0xb0a9('0x12'))]({'level':process[_0xb0a9('0x13')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x25a244){return formatter(_0x515530,_0x25a244);}})]});};
\ No newline at end of file
+var _0x056f=['format','%s-%s.log','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','exports','Logger','File','error','transports','info','moment','winston','util','path','INFO','/var','xcally'];(function(_0x368587,_0x1b6554){var _0x42d33c=function(_0xfdccf){while(--_0xfdccf){_0x368587['push'](_0x368587['shift']());}};_0x42d33c(++_0x1b6554);}(_0x056f,0x185));var _0xf056=function(_0xcbbfc2,_0x14ffd2){_0xcbbfc2=_0xcbbfc2-0x0;var _0x499cea=_0x056f[_0xcbbfc2];return _0x499cea;};'use strict';var moment=require(_0xf056('0x0'));var winston=require(_0xf056('0x1'));var util=require(_0xf056('0x2'));var path=require(_0xf056('0x3'));var debugLevel=_0xf056('0x4');function filename(_0x171d5d,_0x2e2120){return path['join'](_0xf056('0x5'),'log',_0xf056('0x6'),util[_0xf056('0x7')](_0xf056('0x8'),_0x171d5d,_0x2e2120));}function formatter(_0x4b2d73,_0x225728){return util[_0xf056('0x7')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xf056('0x7')](_0xf056('0x9')),_0x225728['level'][_0xf056('0xa')](),_0x4b2d73,_0x225728[_0xf056('0xb')]);}module[_0xf056('0xc')]=function(_0x19c83a){return new winston[(_0xf056('0xd'))]({'transports':[new winston['transports'][(_0xf056('0xe'))]({'name':util[_0xf056('0x7')]('%s-%s',_0x19c83a,_0xf056('0xf')),'filename':filename(_0x19c83a,_0xf056('0xf')),'level':_0xf056('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x50500e){return formatter(_0x19c83a,_0x50500e);}}),new winston[(_0xf056('0x10'))]['File']({'name':util[_0xf056('0x7')]('%s-%s',_0x19c83a,'info'),'filename':filename(_0x19c83a,_0xf056('0x11')),'level':_0xf056('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x6b7ad3){return formatter(_0x19c83a,_0x6b7ad3);}}),new winston['transports']['Console']({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x4313de){return formatter(_0x19c83a,_0x4313de);}})]});};
\ No newline at end of file
index 348ac59..197721f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8521=['../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi'];(function(_0x9c173a,_0x461c9c){var _0x88d611=function(_0x4900c7){while(--_0x4900c7){_0x9c173a['push'](_0x9c173a['shift']());}};_0x88d611(++_0x461c9c);}(_0x8521,0xf1));var _0x1852=function(_0x4b4d75,_0x18d077){_0x4b4d75=_0x4b4d75-0x0;var _0x54c7a7=_0x8521[_0x4b4d75];return _0x54c7a7;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x1852('0x0'),'script':path[_0x1852('0x1')](__dirname,_0x1852('0x2'))},{'name':_0x1852('0x3'),'script':path[_0x1852('0x1')](__dirname,_0x1852('0x4'))},{'name':_0x1852('0x5'),'script':path[_0x1852('0x1')](__dirname,_0x1852('0x6'))},{'name':_0x1852('0x7'),'script':path['join'](__dirname,_0x1852('0x8'))},{'name':_0x1852('0x9'),'script':path['join'](__dirname,_0x1852('0xa'))},{'name':'xdr','script':path[_0x1852('0x1')](__dirname,_0x1852('0xb'))}]};module[_0x1852('0xc')]=config;
\ No newline at end of file
+var _0x32f6=['join','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x24390a,_0x2d6784){var _0xb4e146=function(_0x17e0a6){while(--_0x17e0a6){_0x24390a['push'](_0x24390a['shift']());}};_0xb4e146(++_0x2d6784);}(_0x32f6,0xbd));var _0x632f=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x32f6[_0x88cd7b];return _0x56fcc8;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path[_0x632f('0x0')](__dirname,_0x632f('0x1'))},{'name':'ami','script':path[_0x632f('0x0')](__dirname,_0x632f('0x2'))},{'name':_0x632f('0x3'),'script':path[_0x632f('0x0')](__dirname,_0x632f('0x4'))},{'name':'email','script':path['join'](__dirname,'../../services/email/index.js')},{'name':'routing','script':path[_0x632f('0x0')](__dirname,_0x632f('0x5'))},{'name':_0x632f('0x6'),'script':path[_0x632f('0x0')](__dirname,_0x632f('0x7'))}]};module[_0x632f('0x8')]=config;
\ No newline at end of file
index fb26165..3f030b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c94=['start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected'];(function(_0x5c619e,_0x1bccdf){var _0x445cf8=function(_0x2eaa64){while(--_0x2eaa64){_0x5c619e['push'](_0x5c619e['shift']());}};_0x445cf8(++_0x1bccdf);}(_0x3c94,0xcd));var _0x43c9=function(_0x49ff3f,_0x531e8f){_0x49ff3f=_0x49ff3f-0x0;var _0x4f9703=_0x3c94[_0x49ff3f];return _0x4f9703;};'use strict';var pm2=require(_0x43c9('0x0'));var BPromise=require(_0x43c9('0x1'));var config=require(_0x43c9('0x2'));function connect(){return new BPromise(function(_0x20116b,_0x188507){return pm2[_0x43c9('0x3')](function(_0xe05adb){if(_0xe05adb){return _0x188507(_0xe05adb);}return _0x20116b(_0x43c9('0x4'));});});};exports[_0x43c9('0x5')]=function(_0x44fc3){return connect()[_0x43c9('0x6')](function(){return new BPromise(function(_0x3da043,_0x4fdfc2){return pm2[_0x43c9('0x5')](_0x44fc3,function(_0xf03007,_0x695b4f){if(_0xf03007){return _0x4fdfc2(_0xf03007);}pm2[_0x43c9('0x7')]();return _0x3da043(_0x695b4f);});});});};exports[_0x43c9('0x8')]=function(_0x7a0f6b){return connect()[_0x43c9('0x6')](function(){return new BPromise(function(_0x4725aa,_0x45f3a1){return pm2['stop'](_0x7a0f6b,function(_0x31d997,_0x18a5c9){if(_0x31d997){return _0x45f3a1(_0x31d997);}pm2[_0x43c9('0x7')]();return _0x4725aa(_0x18a5c9);});});});};exports[_0x43c9('0x9')]=function(_0x27ad97){return connect()[_0x43c9('0x6')](function(){return new BPromise(function(_0x690bde,_0x305fcb){return pm2[_0x43c9('0x9')](_0x27ad97,function(_0x18f520,_0x62bb3b){if(_0x18f520){return _0x305fcb(_0x18f520);}pm2[_0x43c9('0x7')]();return _0x690bde(_0x62bb3b);});});});};exports[_0x43c9('0xa')]=function(){return connect()[_0x43c9('0x6')](function(){return new BPromise(function(_0xa98d2f,_0x45546d){return pm2[_0x43c9('0xa')](function(_0x569fa9,_0x37932f){if(_0x569fa9){return _0x45546d(_0x569fa9);}pm2[_0x43c9('0x7')]();return _0xa98d2f(_0x37932f);});});});};exports[_0x43c9('0xb')]=function(_0xe02707){return connect()[_0x43c9('0x6')](function(){return new BPromise(function(_0x5cc1fa,_0x549d3f){return pm2[_0x43c9('0xb')](_0xe02707,function(_0x9a0f50,_0x15035a){if(_0x9a0f50){return _0x549d3f(_0x9a0f50);}pm2[_0x43c9('0x7')]();return _0x5cc1fa(_0x15035a);});});});};exports['delete']=function(_0x1d63cf){return connect()[_0x43c9('0x6')](function(){return new BPromise(function(_0x38fe46,_0x22bf3d){return pm2[_0x43c9('0xc')](_0x1d63cf,function(_0x2ab239,_0x24db4e){if(_0x2ab239){return _0x22bf3d(_0x2ab239);}pm2[_0x43c9('0x7')]();return _0x38fe46(_0x24db4e);});});});};exports[_0x43c9('0xd')]=function(){return connect()[_0x43c9('0x6')](function(){return new BPromise(function(_0x3f841a,_0x4847b2){return pm2[_0x43c9('0xd')](function(_0x772b71){if(_0x772b71){return _0x4847b2(_0x772b71);}return _0x3f841a(_0x43c9('0xe'));});});});};
\ No newline at end of file
+var _0xf6c1=['start','then','disconnect','stop','restart','list','describe','delete','dump','saved','./config'];(function(_0x4b26b5,_0x4f71fd){var _0x4dec71=function(_0x184329){while(--_0x184329){_0x4b26b5['push'](_0x4b26b5['shift']());}};_0x4dec71(++_0x4f71fd);}(_0xf6c1,0x99));var _0x1f6c=function(_0x2fac81,_0x2f283c){_0x2fac81=_0x2fac81-0x0;var _0x515503=_0xf6c1[_0x2fac81];return _0x515503;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x1f6c('0x0'));function connect(){return new BPromise(function(_0xd137f,_0x2007f8){return pm2['connect'](function(_0x217f74){if(_0x217f74){return _0x2007f8(_0x217f74);}return _0xd137f('connected');});});};exports[_0x1f6c('0x1')]=function(_0x83b4a6){return connect()[_0x1f6c('0x2')](function(){return new BPromise(function(_0x44eef2,_0x25e99a){return pm2[_0x1f6c('0x1')](_0x83b4a6,function(_0x530b25,_0x3c7569){if(_0x530b25){return _0x25e99a(_0x530b25);}pm2[_0x1f6c('0x3')]();return _0x44eef2(_0x3c7569);});});});};exports[_0x1f6c('0x4')]=function(_0xcf5c23){return connect()[_0x1f6c('0x2')](function(){return new BPromise(function(_0x373713,_0x1e7287){return pm2[_0x1f6c('0x4')](_0xcf5c23,function(_0x3c8805,_0x4ccc34){if(_0x3c8805){return _0x1e7287(_0x3c8805);}pm2['disconnect']();return _0x373713(_0x4ccc34);});});});};exports['restart']=function(_0x28cb2d){return connect()[_0x1f6c('0x2')](function(){return new BPromise(function(_0x2fd5b0,_0x4739ec){return pm2[_0x1f6c('0x5')](_0x28cb2d,function(_0x1ffbd0,_0x507a06){if(_0x1ffbd0){return _0x4739ec(_0x1ffbd0);}pm2[_0x1f6c('0x3')]();return _0x2fd5b0(_0x507a06);});});});};exports[_0x1f6c('0x6')]=function(){return connect()[_0x1f6c('0x2')](function(){return new BPromise(function(_0x3e461f,_0x103f5d){return pm2[_0x1f6c('0x6')](function(_0x31fc67,_0x147c01){if(_0x31fc67){return _0x103f5d(_0x31fc67);}pm2['disconnect']();return _0x3e461f(_0x147c01);});});});};exports[_0x1f6c('0x7')]=function(_0x302026){return connect()[_0x1f6c('0x2')](function(){return new BPromise(function(_0x43ce04,_0xc8b6f2){return pm2[_0x1f6c('0x7')](_0x302026,function(_0x47955d,_0x521c4c){if(_0x47955d){return _0xc8b6f2(_0x47955d);}pm2[_0x1f6c('0x3')]();return _0x43ce04(_0x521c4c);});});});};exports[_0x1f6c('0x8')]=function(_0x596996){return connect()[_0x1f6c('0x2')](function(){return new BPromise(function(_0x580056,_0x31c887){return pm2[_0x1f6c('0x8')](_0x596996,function(_0xb6eddb,_0x34c7ad){if(_0xb6eddb){return _0x31c887(_0xb6eddb);}pm2[_0x1f6c('0x3')]();return _0x580056(_0x34c7ad);});});});};exports[_0x1f6c('0x9')]=function(){return connect()[_0x1f6c('0x2')](function(){return new BPromise(function(_0x301e14,_0x471120){return pm2[_0x1f6c('0x9')](function(_0x44b1c5){if(_0x44b1c5){return _0x471120(_0x44b1c5);}return _0x301e14(_0x1f6c('0xa'));});});});};
\ No newline at end of file
index 14f3209..628ca19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf740=['localhost','Setting','find','chatTimeout','ChatInteraction','findAll','subtract','minutes','then','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','chatInteraction:update','catch','error','start','lodash','moment','ioredis','../../mysqldb','../../config/environment','redis','defaults'];(function(_0x142c7e,_0x8fe03a){var _0x1978dd=function(_0x4cd1f1){while(--_0x4cd1f1){_0x142c7e['push'](_0x142c7e['shift']());}};_0x1978dd(++_0x8fe03a);}(_0xf740,0x9b));var _0x0f74=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0xf740[_0x48326a];return _0x466709;};'use strict';var _=require(_0x0f74('0x0'));var moment=require(_0x0f74('0x1'));var Redis=require(_0x0f74('0x2'));var db=require(_0x0f74('0x3'))['db'];var config=require(_0x0f74('0x4'));config[_0x0f74('0x5')]=_[_0x0f74('0x6')](config[_0x0f74('0x5')],{'host':_0x0f74('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0f74('0x5')]));function closeInteractions(){var _0x264c5c=0x0;var _0x38131f=[];return db[_0x0f74('0x8')][_0x0f74('0x9')]({'raw':!![],'attributes':['id',_0x0f74('0xa')],'where':{'id':0x1}})['then'](function(_0x2f4baa){_0x264c5c=_0x2f4baa[_0x0f74('0xa')];if(_0x264c5c){return db[_0x0f74('0xb')][_0x0f74('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0f74('0xd')](_0x2f4baa[_0x0f74('0xa')],_0x0f74('0xe'))}}});}else{return[];}})[_0x0f74('0xf')](function(_0x107c9a){_0x38131f=_0x107c9a;if(_0x264c5c){return db[_0x0f74('0xb')]['update']({'closeReason':_0x0f74('0x10'),'disposition':_0x0f74('0x11'),'closed':!![],'closedAt':moment()[_0x0f74('0x12')](_0x0f74('0x13'))},{'where':{'id':_[_0x0f74('0x14')](_0x38131f||[],'id')}});}})[_0x0f74('0xf')](function(_0x4f02c9){for(var _0x50c09d=0x0;_0x50c09d<_0x38131f[_0x0f74('0x15')];_0x50c09d++){io[_0x0f74('0x16')](_0x0f74('0x17'),{'id':_0x38131f[_0x50c09d]['id'],'closed':!![]});}})[_0x0f74('0x18')](function(_0x3f143e){console[_0x0f74('0x19')](_0x3f143e);});}exports[_0x0f74('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xefe4=['defaults','localhost','socket.io-emitter','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','chatInteraction:update','catch','start','lodash','ioredis','../../mysqldb','redis'];(function(_0x545311,_0x5ab372){var _0x2fdf85=function(_0x4564ec){while(--_0x4564ec){_0x545311['push'](_0x545311['shift']());}};_0x2fdf85(++_0x5ab372);}(_0xefe4,0xec));var _0x4efe=function(_0x52c0f2,_0x72ec06){_0x52c0f2=_0x52c0f2-0x0;var _0x11f124=_0xefe4[_0x52c0f2];return _0x11f124;};'use strict';var _=require(_0x4efe('0x0'));var moment=require('moment');var Redis=require(_0x4efe('0x1'));var db=require(_0x4efe('0x2'))['db'];var config=require('../../config/environment');config[_0x4efe('0x3')]=_[_0x4efe('0x4')](config[_0x4efe('0x3')],{'host':_0x4efe('0x5'),'port':0x18eb});var io=require(_0x4efe('0x6'))(new Redis(config[_0x4efe('0x3')]));function closeInteractions(){var _0x3b95d9=0x0;var _0x2a04a6=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0x4efe('0x7')],'where':{'id':0x1}})[_0x4efe('0x8')](function(_0x429846){_0x3b95d9=_0x429846['chatTimeout'];if(_0x3b95d9){return db[_0x4efe('0x9')][_0x4efe('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4efe('0xb')](_0x429846['chatTimeout'],_0x4efe('0xc'))}}});}else{return[];}})[_0x4efe('0x8')](function(_0x1482ca){_0x2a04a6=_0x1482ca;if(_0x3b95d9){return db[_0x4efe('0x9')]['update']({'closeReason':'system','disposition':_0x4efe('0xd'),'closed':!![],'closedAt':moment()[_0x4efe('0xe')](_0x4efe('0xf'))},{'where':{'id':_['map'](_0x2a04a6||[],'id')}});}})['then'](function(_0x4d8f88){for(var _0x1b86c=0x0;_0x1b86c<_0x2a04a6[_0x4efe('0x10')];_0x1b86c++){io['emit'](_0x4efe('0x11'),{'id':_0x2a04a6[_0x1b86c]['id'],'closed':!![]});}})[_0x4efe('0x12')](function(_0x22d1f8){console['error'](_0x22d1f8);});}exports[_0x4efe('0x13')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index d501045..c1b1ce1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb297=['auth','user','pass','bcc','format','Report\x20%s\x20last\x20%s\x20%s','name','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','then','error','email\x20sent','catch','error\x20mail','isNil','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','CustomReportId','runReport','no\x20report\x20id','Schedule','MailServerOut','jobs','map','toString','keyBy','intersection','difference','exists','stop','length','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','start','deleteJob','stop\x20cron','update','run','util','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','secure','authentication'];(function(_0x5be7aa,_0x5de661){var _0x215408=function(_0x353715){while(--_0x353715){_0x5be7aa['push'](_0x5be7aa['shift']());}};_0x215408(++_0x5de661);}(_0xb297,0x135));var _0x7b29=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xb297[_0x19babd];return _0x314eaf;};'use strict';var fs=require('fs');var util=require(_0x7b29('0x0'));var path=require('path');var _=require(_0x7b29('0x1'));var moment=require(_0x7b29('0x2'));var CronJobManager=require(_0x7b29('0x3'));var jayson=require(_0x7b29('0x4'));var BPromise=require('bluebird');var logger=require(_0x7b29('0x5'))(_0x7b29('0x6'));var db=require(_0x7b29('0x7'))['db'];var analyticCustomReportController=require(_0x7b29('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x7b29('0x9')][_0x7b29('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xc57220,_0x4ca514){return function(){logger['info'](_0x7b29('0xb'),_0xc57220[_0x7b29('0xc')]);var _0x3cf3cc=!![];var _0x23d082={'tls':{'rejectUnauthorized':![]}};if(_0xc57220[_0x7b29('0xd')][_0x7b29('0xe')][_0x7b29('0xf')]){_0x23d082['service']=_0xc57220['MailAccount']['Smtp']['service'];}else{_0x23d082[_0x7b29('0x10')]=_0xc57220['MailAccount'][_0x7b29('0xe')][_0x7b29('0x10')];_0x23d082['port']=_0xc57220['MailAccount'][_0x7b29('0xe')]['port'];_0x23d082[_0x7b29('0x11')]=_0xc57220[_0x7b29('0xd')][_0x7b29('0xe')][_0x7b29('0x11')];}if(_0xc57220[_0x7b29('0xd')][_0x7b29('0xe')][_0x7b29('0x12')]){_0x23d082[_0x7b29('0x13')]={'user':_0xc57220['MailAccount'][_0x7b29('0xe')][_0x7b29('0x14')],'pass':_0xc57220[_0x7b29('0xd')][_0x7b29('0xe')][_0x7b29('0x15')]};}var _0x472ec1={'account':_0x23d082,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0xc57220[_0x7b29('0xd')]['name'],_0xc57220[_0x7b29('0xd')]['email']||_0xc57220[_0x7b29('0xd')][_0x7b29('0xe')][_0x7b29('0x14')]),'to':_0xc57220[_0x7b29('0xc')],'cc':_0xc57220['cc'],'bcc':_0xc57220[_0x7b29('0x16')],'subject':util[_0x7b29('0x17')](_0x7b29('0x18'),_0x4ca514[_0x7b29('0x19')],_0xc57220[_0x7b29('0x1a')],_0xc57220[_0x7b29('0x1b')])}};var _0x25b71c=path[_0x7b29('0x1c')](__dirname,_0x7b29('0x1d'));var _0x59a19f=_0x4ca514[_0x7b29('0x1e')];var _0x3b63c0=util[_0x7b29('0x17')]('%s.%s',path[_0x7b29('0x1f')](_0x4ca514[_0x7b29('0x1e')],path['extname'](_0x4ca514['savename'])),_0x7b29('0x20'));var _0x10b1a9=path['join'](_0x25b71c,_0x59a19f);var _0x5c8180=path[_0x7b29('0x1c')](_0x25b71c,_0x3b63c0);if(fs[_0x7b29('0x21')](_0x10b1a9)){_0x4ca514[_0x7b29('0x22')]=_0x7b29('0x23');_0x472ec1[_0x7b29('0x24')][_0x7b29('0x25')]=[{'filename':_0x59a19f,'path':_0x10b1a9}];_0x472ec1[_0x7b29('0x24')][_0x7b29('0x26')]=util[_0x7b29('0x17')](_0x7b29('0x27'),JSON[_0x7b29('0x28')](_0x4ca514,null,0x2));}else if(fs[_0x7b29('0x21')](_0x5c8180)){_0x4ca514[_0x7b29('0x22')]=_0x7b29('0x23');_0x472ec1[_0x7b29('0x24')][_0x7b29('0x25')]=[{'filename':_0x3b63c0,'path':_0x5c8180}];}else{_0x472ec1[_0x7b29('0x24')][_0x7b29('0x26')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0xc57220[_0x7b29('0x29')]){_0x3cf3cc=![];logger[_0x7b29('0x2a')](_0x7b29('0x2b'));}}if(_0x3cf3cc){return client[_0x7b29('0x2c')]('SendMail',_0x472ec1)[_0x7b29('0x2d')](function(_0x72a21c){if(_0x72a21c[_0x7b29('0x2e')]){return logger[_0x7b29('0x2e')]('error\x20mail',JSON['stringify'](_0x72a21c));}return logger[_0x7b29('0x2a')](_0x7b29('0x2f'));})[_0x7b29('0x30')](function(_0x3d61a3){return logger[_0x7b29('0x2e')](_0x7b29('0x31'),JSON[_0x7b29('0x28')](_0x3d61a3));});}};}function handleError(){return function(_0x52c0b0){return logger['error'](JSON[_0x7b29('0x28')](_0x52c0b0));};}function handleResult(_0x445ae6){return function(_0x3f4f5c){logger[_0x7b29('0x2a')]('data',JSON[_0x7b29('0x28')](_0x3f4f5c));if(_0x445ae6[_0x7b29('0xd')]&&_0x445ae6[_0x7b29('0xd')][_0x7b29('0xe')]&&!_['isNil'](_0x445ae6[_0x7b29('0xc')])){setTimeout(handleSendEmail(_0x445ae6,_0x3f4f5c),0x3c*0x3e8);}};}function handleJob(_0x13f086){return function(){try{if(_[_0x7b29('0x32')](_0x13f086[_0x7b29('0x1a')])){return logger[_0x7b29('0x2a')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x7b29('0x32')](_0x13f086[_0x7b29('0x1b')])){return logger[_0x7b29('0x2a')]('subtractUnit\x20null\x20or\x20undefined');}var _0x414110={'startDate':moment()['subtract'](_0x13f086['subtractNumber'],_0x13f086[_0x7b29('0x1b')])[_0x7b29('0x17')](_0x7b29('0x33')),'endDate':moment()['format'](_0x7b29('0x33')),'type':_0x7b29('0x34'),'output':_0x13f086['output'],'name':_0x13f086[_0x7b29('0x19')]};if(!_[_0x7b29('0x32')](_0x13f086[_0x7b29('0x35')])){logger[_0x7b29('0x2a')]('exec\x20defaul\x20report\x20id:%s',_0x13f086[_0x7b29('0x35')]);return analyticDefaultReportController['runReport']({'id':_0x13f086[_0x7b29('0x35')]},_0x414110)[_0x7b29('0x2d')](handleResult(_0x13f086))[_0x7b29('0x30')](handleError());}if(!_['isNil'](_0x13f086[_0x7b29('0x36')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x13f086[_0x7b29('0x36')]);return analyticCustomReportController[_0x7b29('0x37')]({'id':_0x13f086['CustomReportId']},_0x414110)[_0x7b29('0x2d')](handleResult(_0x13f086))[_0x7b29('0x30')](handleError());}}catch(_0x2ecb98){logger[_0x7b29('0x2e')](JSON[_0x7b29('0x28')](_0x2ecb98));}return logger[_0x7b29('0x2a')](_0x7b29('0x38'));};}function getJobs(_0x4fd55f){var _0x1e2012={};if(_0x4fd55f){_0x1e2012['id']=_0x4fd55f;}return db[_0x7b29('0x39')]['findAll']({'where':_0x1e2012,'include':[{'model':db[_0x7b29('0xd')],'attributes':['id',_0x7b29('0x19'),_0x7b29('0xc')],'include':[{'model':db[_0x7b29('0x3a')],'as':_0x7b29('0xe')}]}]})[_0x7b29('0x2d')](function(_0x18308e){var _0x46ac86=_['keys'](manager[_0x7b29('0x3b')]);var _0x39fe43=_[_0x7b29('0x3c')](_0x18308e,function(_0x2753aa){return _0x2753aa['id'][_0x7b29('0x3d')]();});var _0x234040=_[_0x7b29('0x3e')](_0x18308e,function(_0x21d607){return _0x21d607['id'][_0x7b29('0x3d')]();});var _0x4c082f=_0x4fd55f?_0x39fe43:_['difference'](_0x39fe43,_0x46ac86);var _0x30ba9f=_[_0x7b29('0x3f')](_0x39fe43,_0x46ac86);var _0x356e6b=_[_0x7b29('0x40')](_0x46ac86,_0x39fe43);var _0x5b1849;var _0x3f5cd7;for(_0x5b1849=0x0;_0x5b1849<_0x356e6b['length']&&!_0x4fd55f;_0x5b1849+=0x1){_0x3f5cd7=_0x356e6b[_0x5b1849][_0x7b29('0x3d')]();if(manager[_0x7b29('0x41')](_0x3f5cd7)){manager[_0x7b29('0x42')](_0x3f5cd7);manager['deleteJob'](_0x3f5cd7);logger[_0x7b29('0x2a')]('delete\x20cron',_0x3f5cd7);}}logger[_0x7b29('0x2a')]('toRun',JSON['stringify'](_0x4c082f));for(_0x5b1849=0x0;_0x5b1849<_0x4c082f[_0x7b29('0x43')];_0x5b1849+=0x1){_0x3f5cd7=_0x4c082f[_0x5b1849][_0x7b29('0x3d')]();logger[_0x7b29('0x2a')](_0x7b29('0x44'),_0x3f5cd7);if(_0x4fd55f){logger[_0x7b29('0x2a')](_0x7b29('0x45'),_0x4fd55f);logger[_0x7b29('0x2a')](JSON[_0x7b29('0x28')](_0x234040[_0x3f5cd7]));BPromise[_0x7b29('0x46')]()[_0x7b29('0x2d')](handleJob(_0x234040[_0x3f5cd7]));logger[_0x7b29('0x2a')]('run\x20job',_0x234040[_0x3f5cd7][_0x7b29('0x19')],_0x234040[_0x3f5cd7][_0x7b29('0x47')]);}else if(_0x234040[_0x3f5cd7]['cron']&&_0x234040[_0x3f5cd7][_0x7b29('0x48')]&&moment()[_0x7b29('0x49')](_0x234040[_0x3f5cd7][_0x7b29('0x4a')],_0x234040[_0x3f5cd7][_0x7b29('0x4b')])){manager[_0x7b29('0x4c')](_0x3f5cd7,_0x234040[_0x3f5cd7][_0x7b29('0x47')],handleJob(_0x234040[_0x3f5cd7]));manager[_0x7b29('0x4d')](_0x3f5cd7);logger['info']('add\x20cron',_0x234040[_0x3f5cd7][_0x7b29('0x19')],_0x234040[_0x3f5cd7]['cron']);}else if(manager[_0x7b29('0x41')](_0x3f5cd7)){manager[_0x7b29('0x42')](_0x3f5cd7);manager[_0x7b29('0x4e')](_0x3f5cd7);logger[_0x7b29('0x2a')](_0x7b29('0x4f'),_0x234040[_0x3f5cd7][_0x7b29('0x19')],_0x234040[_0x3f5cd7][_0x7b29('0x47')]);}}for(_0x5b1849=0x0,_0x3f5cd7;_0x5b1849<_0x30ba9f[_0x7b29('0x43')]&&!_0x4fd55f;_0x5b1849+=0x1){_0x3f5cd7=_0x30ba9f[_0x5b1849][_0x7b29('0x3d')]();if(manager['exists'](_0x3f5cd7)){if(_0x234040[_0x3f5cd7][_0x7b29('0x47')]&&_0x234040[_0x3f5cd7][_0x7b29('0x48')]&&moment()[_0x7b29('0x49')](_0x234040[_0x3f5cd7][_0x7b29('0x4a')],_0x234040[_0x3f5cd7][_0x7b29('0x4b')])){manager[_0x7b29('0x50')](_0x3f5cd7,_0x234040[_0x3f5cd7][_0x7b29('0x47')],handleJob(_0x234040[_0x3f5cd7]));logger['info']('update\x20cron',_0x234040[_0x3f5cd7][_0x7b29('0x19')],_0x234040[_0x3f5cd7][_0x7b29('0x47')]);}else{manager[_0x7b29('0x42')](_0x3f5cd7);manager['deleteJob'](_0x3f5cd7);logger[_0x7b29('0x2a')]('stop\x20cron',_0x234040[_0x3f5cd7][_0x7b29('0x19')],_0x234040[_0x3f5cd7][_0x7b29('0x47')]);}}}})['catch'](function(_0x526c5d){logger[_0x7b29('0x2e')](JSON[_0x7b29('0x28')](_0x526c5d));});}exports[_0x7b29('0x51')]=function(_0x327566){return getJobs(_0x327566);};exports[_0x7b29('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x39de=['extname','savename','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','exec\x20custom\x20report\x20id:%s','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','toString','keyBy','intersection','difference','exists','stop','deleteJob','delete\x20cron','length','index','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','add','start','add\x20cron','isBetween','update','update\x20cron','stop\x20cron','util','path','lodash','moment','cron-job-manager','bluebird','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','name','bcc','format','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','basename'];(function(_0x106fe9,_0x158e9d){var _0x5e5459=function(_0x1f346d){while(--_0x1f346d){_0x106fe9['push'](_0x106fe9['shift']());}};_0x5e5459(++_0x158e9d);}(_0x39de,0x1ac));var _0xe39d=function(_0x4b90b3,_0x164fb2){_0x4b90b3=_0x4b90b3-0x0;var _0x45472e=_0x39de[_0x4b90b3];return _0x45472e;};'use strict';var fs=require('fs');var util=require(_0xe39d('0x0'));var path=require(_0xe39d('0x1'));var _=require(_0xe39d('0x2'));var moment=require(_0xe39d('0x3'));var CronJobManager=require(_0xe39d('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0xe39d('0x5'));var logger=require('../logger')(_0xe39d('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xe39d('0x7'));var analyticDefaultReportController=require(_0xe39d('0x8'));var client=jayson[_0xe39d('0x9')][_0xe39d('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x433bff,_0x154191){return function(){logger[_0xe39d('0xb')](_0xe39d('0xc'),_0x433bff[_0xe39d('0xd')]);var _0xf86066=!![];var _0x2afa68={'tls':{'rejectUnauthorized':![]}};if(_0x433bff[_0xe39d('0xe')][_0xe39d('0xf')]['service']){_0x2afa68['service']=_0x433bff[_0xe39d('0xe')][_0xe39d('0xf')][_0xe39d('0x10')];}else{_0x2afa68['host']=_0x433bff['MailAccount'][_0xe39d('0xf')][_0xe39d('0x11')];_0x2afa68[_0xe39d('0x12')]=_0x433bff[_0xe39d('0xe')][_0xe39d('0xf')][_0xe39d('0x12')];_0x2afa68['secure']=_0x433bff[_0xe39d('0xe')][_0xe39d('0xf')][_0xe39d('0x13')];}if(_0x433bff[_0xe39d('0xe')][_0xe39d('0xf')][_0xe39d('0x14')]){_0x2afa68[_0xe39d('0x15')]={'user':_0x433bff['MailAccount'][_0xe39d('0xf')]['user'],'pass':_0x433bff[_0xe39d('0xe')]['Smtp'][_0xe39d('0x16')]};}var _0x4d456c={'account':_0x2afa68,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x433bff[_0xe39d('0xe')][_0xe39d('0x17')],_0x433bff[_0xe39d('0xe')]['email']||_0x433bff[_0xe39d('0xe')]['Smtp']['user']),'to':_0x433bff[_0xe39d('0xd')],'cc':_0x433bff['cc'],'bcc':_0x433bff[_0xe39d('0x18')],'subject':util[_0xe39d('0x19')]('Report\x20%s\x20last\x20%s\x20%s',_0x154191[_0xe39d('0x17')],_0x433bff[_0xe39d('0x1a')],_0x433bff[_0xe39d('0x1b')])}};var _0x2173af=path[_0xe39d('0x1c')](__dirname,_0xe39d('0x1d'));var _0x374771=_0x154191['savename'];var _0x7e4ee3=util['format'](_0xe39d('0x1e'),path[_0xe39d('0x1f')](_0x154191['savename'],path[_0xe39d('0x20')](_0x154191[_0xe39d('0x21')])),_0xe39d('0x22'));var _0x42c074=path[_0xe39d('0x1c')](_0x2173af,_0x374771);var _0xc080b8=path[_0xe39d('0x1c')](_0x2173af,_0x7e4ee3);if(fs[_0xe39d('0x23')](_0x42c074)){_0x154191[_0xe39d('0x24')]=_0xe39d('0x25');_0x4d456c[_0xe39d('0x26')][_0xe39d('0x27')]=[{'filename':_0x374771,'path':_0x42c074}];_0x4d456c[_0xe39d('0x26')][_0xe39d('0x28')]=util[_0xe39d('0x19')](_0xe39d('0x29'),JSON['stringify'](_0x154191,null,0x2));}else if(fs['existsSync'](_0xc080b8)){_0x154191['status']=_0xe39d('0x25');_0x4d456c[_0xe39d('0x26')][_0xe39d('0x27')]=[{'filename':_0x7e4ee3,'path':_0xc080b8}];}else{_0x4d456c[_0xe39d('0x26')][_0xe39d('0x28')]=_0xe39d('0x2a');if(!_0x433bff[_0xe39d('0x2b')]){_0xf86066=![];logger[_0xe39d('0xb')](_0xe39d('0x2c'));}}if(_0xf86066){return client[_0xe39d('0x2d')](_0xe39d('0x2e'),_0x4d456c)[_0xe39d('0x2f')](function(_0x55edb7){if(_0x55edb7[_0xe39d('0x30')]){return logger['error'](_0xe39d('0x31'),JSON[_0xe39d('0x32')](_0x55edb7));}return logger[_0xe39d('0xb')]('email\x20sent');})[_0xe39d('0x33')](function(_0x3267c7){return logger['error'](_0xe39d('0x31'),JSON[_0xe39d('0x32')](_0x3267c7));});}};}function handleError(){return function(_0x13fe9){return logger[_0xe39d('0x30')](JSON[_0xe39d('0x32')](_0x13fe9));};}function handleResult(_0x1a19a7){return function(_0x13a192){logger[_0xe39d('0xb')](_0xe39d('0x34'),JSON[_0xe39d('0x32')](_0x13a192));if(_0x1a19a7[_0xe39d('0xe')]&&_0x1a19a7['MailAccount'][_0xe39d('0xf')]&&!_['isNil'](_0x1a19a7['email'])){setTimeout(handleSendEmail(_0x1a19a7,_0x13a192),0x3c*0x3e8);}};}function handleJob(_0x14419d){return function(){try{if(_[_0xe39d('0x35')](_0x14419d[_0xe39d('0x1a')])){return logger[_0xe39d('0xb')](_0xe39d('0x36'));}if(_[_0xe39d('0x35')](_0x14419d[_0xe39d('0x1b')])){return logger[_0xe39d('0xb')]('subtractUnit\x20null\x20or\x20undefined');}var _0x253d41={'startDate':moment()[_0xe39d('0x37')](_0x14419d['subtractNumber'],_0x14419d['subtractUnit'])[_0xe39d('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xe39d('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x14419d[_0xe39d('0x38')],'name':_0x14419d[_0xe39d('0x17')]};if(!_['isNil'](_0x14419d['DefaultReportId'])){logger[_0xe39d('0xb')](_0xe39d('0x39'),_0x14419d[_0xe39d('0x3a')]);return analyticDefaultReportController[_0xe39d('0x3b')]({'id':_0x14419d[_0xe39d('0x3a')]},_0x253d41)[_0xe39d('0x2f')](handleResult(_0x14419d))[_0xe39d('0x33')](handleError());}if(!_[_0xe39d('0x35')](_0x14419d['CustomReportId'])){logger['info'](_0xe39d('0x3c'),_0x14419d[_0xe39d('0x3d')]);return analyticCustomReportController[_0xe39d('0x3b')]({'id':_0x14419d[_0xe39d('0x3d')]},_0x253d41)[_0xe39d('0x2f')](handleResult(_0x14419d))[_0xe39d('0x33')](handleError());}}catch(_0xb5768e){logger[_0xe39d('0x30')](JSON[_0xe39d('0x32')](_0xb5768e));}return logger[_0xe39d('0xb')](_0xe39d('0x3e'));};}function getJobs(_0x305b05){var _0x2cd7f4={};if(_0x305b05){_0x2cd7f4['id']=_0x305b05;}return db[_0xe39d('0x3f')][_0xe39d('0x40')]({'where':_0x2cd7f4,'include':[{'model':db['MailAccount'],'attributes':['id',_0xe39d('0x17'),'email'],'include':[{'model':db[_0xe39d('0x41')],'as':_0xe39d('0xf')}]}]})['then'](function(_0xede8e8){var _0x5dd6de=_[_0xe39d('0x42')](manager[_0xe39d('0x43')]);var _0x2cae53=_['map'](_0xede8e8,function(_0x41b457){return _0x41b457['id'][_0xe39d('0x44')]();});var _0x33b9e3=_[_0xe39d('0x45')](_0xede8e8,function(_0x59a8ba){return _0x59a8ba['id']['toString']();});var _0x33079c=_0x305b05?_0x2cae53:_['difference'](_0x2cae53,_0x5dd6de);var _0x2e9b69=_[_0xe39d('0x46')](_0x2cae53,_0x5dd6de);var _0x2ef282=_[_0xe39d('0x47')](_0x5dd6de,_0x2cae53);var _0xb47eed;var _0x29e37d;for(_0xb47eed=0x0;_0xb47eed<_0x2ef282['length']&&!_0x305b05;_0xb47eed+=0x1){_0x29e37d=_0x2ef282[_0xb47eed][_0xe39d('0x44')]();if(manager[_0xe39d('0x48')](_0x29e37d)){manager[_0xe39d('0x49')](_0x29e37d);manager[_0xe39d('0x4a')](_0x29e37d);logger['info'](_0xe39d('0x4b'),_0x29e37d);}}logger[_0xe39d('0xb')]('toRun',JSON[_0xe39d('0x32')](_0x33079c));for(_0xb47eed=0x0;_0xb47eed<_0x33079c[_0xe39d('0x4c')];_0xb47eed+=0x1){_0x29e37d=_0x33079c[_0xb47eed][_0xe39d('0x44')]();logger[_0xe39d('0xb')](_0xe39d('0x4d'),_0x29e37d);if(_0x305b05){logger[_0xe39d('0xb')](_0xe39d('0x4e'),_0x305b05);logger[_0xe39d('0xb')](JSON[_0xe39d('0x32')](_0x33b9e3[_0x29e37d]));BPromise[_0xe39d('0x4f')]()[_0xe39d('0x2f')](handleJob(_0x33b9e3[_0x29e37d]));logger[_0xe39d('0xb')](_0xe39d('0x50'),_0x33b9e3[_0x29e37d][_0xe39d('0x17')],_0x33b9e3[_0x29e37d][_0xe39d('0x51')]);}else if(_0x33b9e3[_0x29e37d][_0xe39d('0x51')]&&_0x33b9e3[_0x29e37d][_0xe39d('0x52')]&&moment()['isBetween'](_0x33b9e3[_0x29e37d][_0xe39d('0x53')],_0x33b9e3[_0x29e37d][_0xe39d('0x54')])){manager[_0xe39d('0x55')](_0x29e37d,_0x33b9e3[_0x29e37d][_0xe39d('0x51')],handleJob(_0x33b9e3[_0x29e37d]));manager[_0xe39d('0x56')](_0x29e37d);logger[_0xe39d('0xb')](_0xe39d('0x57'),_0x33b9e3[_0x29e37d][_0xe39d('0x17')],_0x33b9e3[_0x29e37d][_0xe39d('0x51')]);}else if(manager[_0xe39d('0x48')](_0x29e37d)){manager[_0xe39d('0x49')](_0x29e37d);manager[_0xe39d('0x4a')](_0x29e37d);logger['info']('stop\x20cron',_0x33b9e3[_0x29e37d][_0xe39d('0x17')],_0x33b9e3[_0x29e37d][_0xe39d('0x51')]);}}for(_0xb47eed=0x0,_0x29e37d;_0xb47eed<_0x2e9b69[_0xe39d('0x4c')]&&!_0x305b05;_0xb47eed+=0x1){_0x29e37d=_0x2e9b69[_0xb47eed][_0xe39d('0x44')]();if(manager[_0xe39d('0x48')](_0x29e37d)){if(_0x33b9e3[_0x29e37d][_0xe39d('0x51')]&&_0x33b9e3[_0x29e37d][_0xe39d('0x52')]&&moment()[_0xe39d('0x58')](_0x33b9e3[_0x29e37d]['startAt'],_0x33b9e3[_0x29e37d][_0xe39d('0x54')])){manager[_0xe39d('0x59')](_0x29e37d,_0x33b9e3[_0x29e37d][_0xe39d('0x51')],handleJob(_0x33b9e3[_0x29e37d]));logger[_0xe39d('0xb')](_0xe39d('0x5a'),_0x33b9e3[_0x29e37d][_0xe39d('0x17')],_0x33b9e3[_0x29e37d]['cron']);}else{manager[_0xe39d('0x49')](_0x29e37d);manager[_0xe39d('0x4a')](_0x29e37d);logger[_0xe39d('0xb')](_0xe39d('0x5b'),_0x33b9e3[_0x29e37d]['name'],_0x33b9e3[_0x29e37d][_0xe39d('0x51')]);}}}})['catch'](function(_0x52ef51){logger[_0xe39d('0x30')](JSON[_0xe39d('0x32')](_0x52ef51));});}exports['run']=function(_0x113da7){return getJobs(_0x113da7);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index c705135..dab9d2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x804d=['transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','results','transcripts','length','transcript','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','CloudProvider','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Positive','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','Cloud\x20Provider\x20not\x20available','forEach','push','all','catch','SequelizeValidationError','error','aws-sdk','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2'];(function(_0x1beaff,_0x51653a){var _0xa12999=function(_0x37df29){while(--_0x37df29){_0x1beaff['push'](_0x1beaff['shift']());}};_0xa12999(++_0x51653a);}(_0x804d,0x1a8));var _0xd804=function(_0x3e08f3,_0x35bf04){_0x3e08f3=_0x3e08f3-0x0;var _0x4cdb44=_0x804d[_0x3e08f3];return _0x4cdb44;};var _=require('lodash');var AWS=require(_0xd804('0x0'));var rp=require('request-promise');var util=require('util');var BPromise=require(_0xd804('0x1'));var db=require(_0xd804('0x2'))['db'];var logger=require(_0xd804('0x3'))('transcribe');function getTranscriptionJob(_0x57ce8c,_0x123668,_0x12a2a6,_0x168424){return new Promise(function(_0x41b470,_0x437998){var _0x8fd4a1=new AWS[(_0xd804('0x4'))]({'accessKeyId':_0x123668,'secretAccessKey':_0x57ce8c,'region':_0x12a2a6});_0x8fd4a1[_0xd804('0x5')]({'TranscriptionJobName':_0x168424},function(_0x253ac7,_0x48bd97){if(_0x253ac7){return _0x437998(_0x253ac7);}else{return _0x41b470(_0x48bd97);}});});}function sentiment(_0x278c5a,_0x710ee8,_0x2adb7c,_0x262d27,_0x46039f){return new Promise(function(_0x500864,_0x24000e){var _0x2e1651=new AWS[(_0xd804('0x6'))]({'accessKeyId':_0x710ee8,'secretAccessKey':_0x278c5a,'region':_0x2adb7c});_0x2e1651[_0xd804('0x7')]({'Text':_0x262d27,'LanguageCode':_0x46039f[_0xd804('0x8')](0x0,0x2)},function(_0x71f99e,_0x58f4bd){if(_0x71f99e){return _0x24000e(_0x71f99e);}else{return _0x500864(_0x58f4bd);}});});}function checkTranscribeJob(_0x18fdc3,_0x2f1539,_0x202d1c){var _0x16f4c6;return new BPromise(function(_0x3ac407,_0x43ba02){logger[_0xd804('0x9')](util['format'](_0xd804('0xa'),_0x18fdc3['id'],_0x18fdc3[_0xd804('0xb')]));return getTranscriptionJob(_0x202d1c[_0xd804('0xc')],_0x202d1c[_0xd804('0xd')],_0x2f1539[_0xd804('0xe')],_0x18fdc3['transcribeName'])[_0xd804('0xf')](function(_0x2757d5){logger['info'](util[_0xd804('0x10')](_0xd804('0x11'),_0x18fdc3['id'],_0x18fdc3[_0xd804('0xb')],_0x2757d5['TranscriptionJob'][_0xd804('0x12')]));if(!_0x18fdc3[_0xd804('0x13')]){switch(_0x2757d5['TranscriptionJob'][_0xd804('0x12')]){case _0xd804('0x14'):var _0x364592={'transcribeStatus':_0x2757d5[_0xd804('0x15')][_0xd804('0x12')],'fileUri':_0x2757d5[_0xd804('0x15')]['Transcript'][_0xd804('0x16')]};logger[_0xd804('0x9')](util[_0xd804('0x10')](_0xd804('0x17'),_0x18fdc3['id']));return rp({'uri':_0x2757d5[_0xd804('0x15')][_0xd804('0x18')][_0xd804('0x16')],'json':!![]})[_0xd804('0xf')](function(_0x5b9f03){logger[_0xd804('0x9')](util[_0xd804('0x10')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x18fdc3['id']));if(_0x5b9f03&&_0x5b9f03[_0xd804('0x19')]&&_0x5b9f03['results']['transcripts']&&_0x5b9f03[_0xd804('0x19')][_0xd804('0x1a')][_0xd804('0x1b')]){_0x364592[_0xd804('0x13')]='';for(var _0x3e1799=0x0;_0x3e1799<_0x5b9f03[_0xd804('0x19')]['transcripts']['length'];_0x3e1799++){_0x364592[_0xd804('0x13')]+=_0x5b9f03[_0xd804('0x19')][_0xd804('0x1a')][_0x3e1799][_0xd804('0x1c')]+'';}}return _0x18fdc3[_0xd804('0x1d')](_0x364592);})[_0xd804('0xf')](function(){logger[_0xd804('0x9')](util[_0xd804('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x18fdc3['id']));if(!_0x18fdc3[_0xd804('0x1e')]){throw new db[(_0xd804('0x1f'))][(_0xd804('0x20'))](_0xd804('0x21'));}if(!_0x2f1539[_0xd804('0x22')]||!_0x2f1539['sentimentAccountId']||!_0x2f1539[_0xd804('0x23')]||!_0x2f1539[_0xd804('0x24')]||!_0x2f1539[_0xd804('0x25')]){throw new db[(_0xd804('0x1f'))][(_0xd804('0x20'))](_0xd804('0x26'));}if(!_0x364592[_0xd804('0x13')]){throw new Error(_0xd804('0x27'));}if(_0x2f1539[_0xd804('0x28')]===_0x202d1c['id']){return _0x202d1c;}else{return db['CloudProvider'][_0xd804('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xd804('0xf')](function(_0x2201c4){if(!_0x2201c4){throw new db[(_0xd804('0x1f'))][(_0xd804('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2201c4[_0xd804('0xc')]||!_0x2201c4[_0xd804('0xd')]){throw new db['Sequelize'][(_0xd804('0x20'))](_0xd804('0x2a'));}_0x16f4c6=_0x2201c4;logger['info'](util[_0xd804('0x10')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x18fdc3['id']));return sentiment(_0x16f4c6['data1'],_0x16f4c6[_0xd804('0xd')],_0x2f1539[_0xd804('0x23')],_0x364592[_0xd804('0x13')],_0x2f1539[_0xd804('0x24')]);})['then'](function(_0x1b93ad){logger[_0xd804('0x9')](util[_0xd804('0x10')](_0xd804('0x2b'),_0x18fdc3['id']));return _0x18fdc3[_0xd804('0x1d')]({'sentiment':_0x1b93ad['Sentiment'],'sPositive':_0x1b93ad[_0xd804('0x2c')]['Positive'],'sNegative':_0x1b93ad[_0xd804('0x2c')][_0xd804('0x2d')],'sMixed':_0x1b93ad[_0xd804('0x2c')][_0xd804('0x2e')],'sNeutral':_0x1b93ad[_0xd804('0x2c')][_0xd804('0x2f')]});})[_0xd804('0xf')](function(){logger[_0xd804('0x9')](util[_0xd804('0x10')](_0xd804('0x30'),_0x18fdc3['id']));_0x3ac407();});case'FAILED':return _0x18fdc3['update']({'transcribeStatus':_0xd804('0x31'),'failureReason':_0x2757d5[_0xd804('0x15')][_0xd804('0x32')]})[_0xd804('0xf')](function(){logger[_0xd804('0x9')](util[_0xd804('0x10')](_0xd804('0x30'),_0x18fdc3['id']));_0x3ac407();});default:logger[_0xd804('0x9')](util[_0xd804('0x10')](_0xd804('0x33'),_0x18fdc3['id']));break;}}else{return BPromise[_0xd804('0x34')]()[_0xd804('0xf')](function(){if(!_0x18fdc3[_0xd804('0x1e')]){throw new db[(_0xd804('0x1f'))][(_0xd804('0x20'))](_0xd804('0x21'));}if(!_0x2f1539['sentiment']||!_0x2f1539[_0xd804('0x28')]||!_0x2f1539[_0xd804('0x23')]||!_0x2f1539['language']||!_0x2f1539['bucket']){throw new db[(_0xd804('0x1f'))]['ValidationError'](_0xd804('0x26'));}if(!_0x18fdc3['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x2f1539['sentimentAccountId']===_0x202d1c['id']){return _0x202d1c;}else{return db[_0xd804('0x35')]['findOne']({'where':{'id':_settings[_0xd804('0x28')]}});}})['then'](function(_0x33acf8){if(!_0x33acf8){throw new db['Sequelize'][(_0xd804('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x33acf8['data1']||!_0x33acf8[_0xd804('0xd')]){throw new db[(_0xd804('0x1f'))][(_0xd804('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x16f4c6=_0x33acf8;logger[_0xd804('0x9')](util[_0xd804('0x10')](_0xd804('0x36'),_0x18fdc3['id']));return sentiment(_0x16f4c6['data1'],_0x16f4c6[_0xd804('0xd')],_0x2f1539[_0xd804('0x23')],_0x18fdc3[_0xd804('0x13')],_0x2f1539['language']);})[_0xd804('0xf')](function(_0x12f781){logger[_0xd804('0x9')](util[_0xd804('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x18fdc3['id']));return _0x18fdc3['update']({'sentiment':_0x12f781['Sentiment'],'sPositive':_0x12f781['SentimentScore'][_0xd804('0x37')],'sNegative':_0x12f781[_0xd804('0x2c')][_0xd804('0x2d')],'sMixed':_0x12f781[_0xd804('0x2c')]['Mixed'],'sNeutral':_0x12f781[_0xd804('0x2c')][_0xd804('0x2f')],'transcribeStatus':_0xd804('0x14')});})[_0xd804('0xf')](function(){logger[_0xd804('0x9')](util['format'](_0xd804('0x30'),_0x18fdc3['id']));_0x3ac407();});}})['catch'](function(_0x46e1d4){if(_0x46e1d4){if(!_0x46e1d4['name']||_0x46e1d4[_0xd804('0x38')]!=='SequelizeValidationError'){logger['error'](util[_0xd804('0x10')](_0xd804('0x39'),_0x18fdc3['id']),util[_0xd804('0x3a')](_0x46e1d4,{'showHidden':![],'depth':null}));}}_0x3ac407();});});}function checkTranscribe(){var _0x636009;var _0x209c55;var _0x3dd725;return db[_0xd804('0x3b')]['findAll']({'where':{'transcribeStatus':_0xd804('0x3c')}})[_0xd804('0xf')](function(_0x37ca14){if(!_0x37ca14||!_0x37ca14[_0xd804('0x1b')]){throw new db[(_0xd804('0x1f'))][(_0xd804('0x20'))](_0xd804('0x3d'));}_0x636009=_0x37ca14;return db[_0xd804('0x3e')]['findOne']({'where':{'id':0x1}});})[_0xd804('0xf')](function(_0x3bf537){if(!_0x3bf537){throw new db[(_0xd804('0x1f'))]['ValidationError'](_0xd804('0x3f'));}_0x209c55=_0x3bf537;if(!_0x209c55['transcribe']||!_0x209c55['transcribeAccountId']||!_0x209c55[_0xd804('0xe')]||!_0x209c55[_0xd804('0x24')]||!_0x209c55['bucket']){throw new db['Sequelize'][(_0xd804('0x20'))](_0xd804('0x40'));}return db[_0xd804('0x35')][_0xd804('0x29')]({'where':{'id':_0x209c55[_0xd804('0x41')]}});})[_0xd804('0xf')](function(_0x3e68e8){if(!_0x3e68e8){throw new db[(_0xd804('0x1f'))]['ValidationError'](_0xd804('0x42'));}if(!_0x3e68e8[_0xd804('0xc')]||!_0x3e68e8['data2']){throw new db[(_0xd804('0x1f'))][(_0xd804('0x20'))](_0xd804('0x2a'));}_0x3dd725=_0x3e68e8;var _0x495f0e=[];_0x636009[_0xd804('0x43')](function(_0x1f407f){_0x495f0e[_0xd804('0x44')](checkTranscribeJob(_0x1f407f,_0x209c55,_0x3dd725));});return BPromise[_0xd804('0x45')](_0x495f0e);})[_0xd804('0x46')](function(_0x517617){if(_0x517617){if(!_0x517617['name']||_0x517617[_0xd804('0x38')]!==_0xd804('0x47')){logger[_0xd804('0x48')](util[_0xd804('0x3a')](_0x517617,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0xac78=['TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','language','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','inspect','start','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s'];(function(_0x15e3fa,_0x2815a6){var _0x4aa579=function(_0x232cd7){while(--_0x232cd7){_0x15e3fa['push'](_0x15e3fa['shift']());}};_0x4aa579(++_0x2815a6);}(_0xac78,0x82));var _0x8ac7=function(_0x38eadf,_0x5f94ef){_0x38eadf=_0x38eadf-0x0;var _0xbb56b3=_0xac78[_0x38eadf];return _0xbb56b3;};var _=require('lodash');var AWS=require(_0x8ac7('0x0'));var rp=require(_0x8ac7('0x1'));var util=require(_0x8ac7('0x2'));var BPromise=require(_0x8ac7('0x3'));var db=require(_0x8ac7('0x4'))['db'];var logger=require(_0x8ac7('0x5'))(_0x8ac7('0x6'));function getTranscriptionJob(_0x3757a5,_0x508bd5,_0x3ac045,_0x186da1){return new Promise(function(_0x3cb0b2,_0x54ce13){var _0x40ff4f=new AWS[(_0x8ac7('0x7'))]({'accessKeyId':_0x508bd5,'secretAccessKey':_0x3757a5,'region':_0x3ac045});_0x40ff4f[_0x8ac7('0x8')]({'TranscriptionJobName':_0x186da1},function(_0x407830,_0x54c57f){if(_0x407830){return _0x54ce13(_0x407830);}else{return _0x3cb0b2(_0x54c57f);}});});}function sentiment(_0x2b1fd7,_0x50f018,_0x4259a2,_0x2479a8,_0x5dd3d3){return new Promise(function(_0xa07850,_0x843f90){var _0x36d01e=new AWS[(_0x8ac7('0x9'))]({'accessKeyId':_0x50f018,'secretAccessKey':_0x2b1fd7,'region':_0x4259a2});_0x36d01e[_0x8ac7('0xa')]({'Text':_0x2479a8,'LanguageCode':_0x5dd3d3[_0x8ac7('0xb')](0x0,0x2)},function(_0x112a0a,_0x3c5a0e){if(_0x112a0a){return _0x843f90(_0x112a0a);}else{return _0xa07850(_0x3c5a0e);}});});}function checkTranscribeJob(_0x5b761e,_0x1a5547,_0x4dca6c){var _0x12a9bf;return new BPromise(function(_0x588f38,_0x21de33){logger['info'](util[_0x8ac7('0xc')](_0x8ac7('0xd'),_0x5b761e['id'],_0x5b761e[_0x8ac7('0xe')]));return getTranscriptionJob(_0x4dca6c[_0x8ac7('0xf')],_0x4dca6c['data2'],_0x1a5547[_0x8ac7('0x10')],_0x5b761e[_0x8ac7('0xe')])[_0x8ac7('0x11')](function(_0x4fa70f){logger[_0x8ac7('0x12')](util[_0x8ac7('0xc')](_0x8ac7('0x13'),_0x5b761e['id'],_0x5b761e[_0x8ac7('0xe')],_0x4fa70f[_0x8ac7('0x14')][_0x8ac7('0x15')]));if(!_0x5b761e[_0x8ac7('0x16')]){switch(_0x4fa70f['TranscriptionJob'][_0x8ac7('0x15')]){case _0x8ac7('0x17'):var _0x435286={'transcribeStatus':_0x4fa70f[_0x8ac7('0x14')]['TranscriptionJobStatus'],'fileUri':_0x4fa70f[_0x8ac7('0x14')][_0x8ac7('0x18')]['TranscriptFileUri']};logger[_0x8ac7('0x12')](util[_0x8ac7('0xc')]('[RECORDING:%d]\x20Get\x20transcript',_0x5b761e['id']));return rp({'uri':_0x4fa70f[_0x8ac7('0x14')][_0x8ac7('0x18')][_0x8ac7('0x19')],'json':!![]})[_0x8ac7('0x11')](function(_0x1bd30d){logger[_0x8ac7('0x12')](util['format'](_0x8ac7('0x1a'),_0x5b761e['id']));if(_0x1bd30d&&_0x1bd30d[_0x8ac7('0x1b')]&&_0x1bd30d[_0x8ac7('0x1b')][_0x8ac7('0x1c')]&&_0x1bd30d[_0x8ac7('0x1b')][_0x8ac7('0x1c')][_0x8ac7('0x1d')]){_0x435286['fileText']='';for(var _0x3dd176=0x0;_0x3dd176<_0x1bd30d[_0x8ac7('0x1b')]['transcripts'][_0x8ac7('0x1d')];_0x3dd176++){_0x435286['fileText']+=_0x1bd30d[_0x8ac7('0x1b')][_0x8ac7('0x1c')][_0x3dd176][_0x8ac7('0x1e')]+'';}}return _0x5b761e['update'](_0x435286);})[_0x8ac7('0x11')](function(){logger[_0x8ac7('0x12')](util[_0x8ac7('0xc')](_0x8ac7('0x1f'),_0x5b761e['id']));if(!_0x5b761e[_0x8ac7('0x20')]){throw new db['Sequelize'][(_0x8ac7('0x21'))](_0x8ac7('0x22'));}if(!_0x1a5547[_0x8ac7('0x23')]||!_0x1a5547['sentimentAccountId']||!_0x1a5547['sentimentRegion']||!_0x1a5547['language']||!_0x1a5547[_0x8ac7('0x24')]){throw new db[(_0x8ac7('0x25'))]['ValidationError'](_0x8ac7('0x26'));}if(!_0x435286['fileText']){throw new Error(_0x8ac7('0x27'));}if(_0x1a5547[_0x8ac7('0x28')]===_0x4dca6c['id']){return _0x4dca6c;}else{return db[_0x8ac7('0x29')][_0x8ac7('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x8ac7('0x11')](function(_0x5ee1da){if(!_0x5ee1da){throw new db[(_0x8ac7('0x25'))][(_0x8ac7('0x21'))](_0x8ac7('0x2b'));}if(!_0x5ee1da[_0x8ac7('0xf')]||!_0x5ee1da[_0x8ac7('0x2c')]){throw new db['Sequelize'][(_0x8ac7('0x21'))](_0x8ac7('0x2d'));}_0x12a9bf=_0x5ee1da;logger[_0x8ac7('0x12')](util['format'](_0x8ac7('0x2e'),_0x5b761e['id']));return sentiment(_0x12a9bf['data1'],_0x12a9bf['data2'],_0x1a5547[_0x8ac7('0x2f')],_0x435286[_0x8ac7('0x16')],_0x1a5547[_0x8ac7('0x30')]);})[_0x8ac7('0x11')](function(_0x4c443d){logger['info'](util[_0x8ac7('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5b761e['id']));return _0x5b761e[_0x8ac7('0x31')]({'sentiment':_0x4c443d[_0x8ac7('0x32')],'sPositive':_0x4c443d[_0x8ac7('0x33')][_0x8ac7('0x34')],'sNegative':_0x4c443d[_0x8ac7('0x33')]['Negative'],'sMixed':_0x4c443d[_0x8ac7('0x33')][_0x8ac7('0x35')],'sNeutral':_0x4c443d[_0x8ac7('0x33')][_0x8ac7('0x36')]});})[_0x8ac7('0x11')](function(){logger['info'](util['format'](_0x8ac7('0x1f'),_0x5b761e['id']));_0x588f38();});case _0x8ac7('0x37'):return _0x5b761e[_0x8ac7('0x31')]({'transcribeStatus':'FAILED','failureReason':_0x4fa70f[_0x8ac7('0x14')][_0x8ac7('0x38')]})[_0x8ac7('0x11')](function(){logger[_0x8ac7('0x12')](util[_0x8ac7('0xc')](_0x8ac7('0x1f'),_0x5b761e['id']));_0x588f38();});default:logger['info'](util[_0x8ac7('0xc')](_0x8ac7('0x39'),_0x5b761e['id']));break;}}else{return BPromise[_0x8ac7('0x3a')]()[_0x8ac7('0x11')](function(){if(!_0x5b761e[_0x8ac7('0x20')]){throw new db[(_0x8ac7('0x25'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1a5547[_0x8ac7('0x23')]||!_0x1a5547[_0x8ac7('0x28')]||!_0x1a5547[_0x8ac7('0x2f')]||!_0x1a5547['language']||!_0x1a5547[_0x8ac7('0x24')]){throw new db['Sequelize'][(_0x8ac7('0x21'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5b761e[_0x8ac7('0x16')]){throw new Error(_0x8ac7('0x27'));}if(_0x1a5547[_0x8ac7('0x28')]===_0x4dca6c['id']){return _0x4dca6c;}else{return db[_0x8ac7('0x29')]['findOne']({'where':{'id':_settings[_0x8ac7('0x28')]}});}})['then'](function(_0x1a158a){if(!_0x1a158a){throw new db[(_0x8ac7('0x25'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x1a158a[_0x8ac7('0xf')]||!_0x1a158a['data2']){throw new db[(_0x8ac7('0x25'))][(_0x8ac7('0x21'))](_0x8ac7('0x2d'));}_0x12a9bf=_0x1a158a;logger['info'](util[_0x8ac7('0xc')](_0x8ac7('0x2e'),_0x5b761e['id']));return sentiment(_0x12a9bf['data1'],_0x12a9bf['data2'],_0x1a5547[_0x8ac7('0x2f')],_0x5b761e[_0x8ac7('0x16')],_0x1a5547[_0x8ac7('0x30')]);})[_0x8ac7('0x11')](function(_0x185d8c){logger[_0x8ac7('0x12')](util[_0x8ac7('0xc')](_0x8ac7('0x3b'),_0x5b761e['id']));return _0x5b761e[_0x8ac7('0x31')]({'sentiment':_0x185d8c[_0x8ac7('0x32')],'sPositive':_0x185d8c[_0x8ac7('0x33')][_0x8ac7('0x34')],'sNegative':_0x185d8c[_0x8ac7('0x33')]['Negative'],'sMixed':_0x185d8c[_0x8ac7('0x33')][_0x8ac7('0x35')],'sNeutral':_0x185d8c[_0x8ac7('0x33')][_0x8ac7('0x36')],'transcribeStatus':_0x8ac7('0x17')});})[_0x8ac7('0x11')](function(){logger[_0x8ac7('0x12')](util[_0x8ac7('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5b761e['id']));_0x588f38();});}})[_0x8ac7('0x3c')](function(_0xe83488){if(_0xe83488){if(!_0xe83488[_0x8ac7('0x3d')]||_0xe83488['name']!==_0x8ac7('0x3e')){logger[_0x8ac7('0x3f')](util[_0x8ac7('0xc')](_0x8ac7('0x40'),_0x5b761e['id']),util['inspect'](_0xe83488,{'showHidden':![],'depth':null}));}}_0x588f38();});});}function checkTranscribe(){var _0x7a27ba;var _0x2a73a8;var _0x3ecf14;return db[_0x8ac7('0x41')][_0x8ac7('0x42')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x2fd52f){if(!_0x2fd52f||!_0x2fd52f[_0x8ac7('0x1d')]){throw new db[(_0x8ac7('0x25'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x7a27ba=_0x2fd52f;return db[_0x8ac7('0x43')]['findOne']({'where':{'id':0x1}});})[_0x8ac7('0x11')](function(_0x588755){if(!_0x588755){throw new db['Sequelize']['ValidationError'](_0x8ac7('0x44'));}_0x2a73a8=_0x588755;if(!_0x2a73a8['transcribe']||!_0x2a73a8[_0x8ac7('0x45')]||!_0x2a73a8[_0x8ac7('0x10')]||!_0x2a73a8[_0x8ac7('0x30')]||!_0x2a73a8[_0x8ac7('0x24')]){throw new db[(_0x8ac7('0x25'))][(_0x8ac7('0x21'))](_0x8ac7('0x46'));}return db[_0x8ac7('0x29')][_0x8ac7('0x2a')]({'where':{'id':_0x2a73a8[_0x8ac7('0x45')]}});})[_0x8ac7('0x11')](function(_0x3024e2){if(!_0x3024e2){throw new db[(_0x8ac7('0x25'))][(_0x8ac7('0x21'))](_0x8ac7('0x2b'));}if(!_0x3024e2[_0x8ac7('0xf')]||!_0x3024e2[_0x8ac7('0x2c')]){throw new db['Sequelize'][(_0x8ac7('0x21'))](_0x8ac7('0x2d'));}_0x3ecf14=_0x3024e2;var _0x398b62=[];_0x7a27ba[_0x8ac7('0x47')](function(_0x17fe59){_0x398b62[_0x8ac7('0x48')](checkTranscribeJob(_0x17fe59,_0x2a73a8,_0x3ecf14));});return BPromise['all'](_0x398b62);})[_0x8ac7('0x3c')](function(_0x5d1a2c){if(_0x5d1a2c){if(!_0x5d1a2c[_0x8ac7('0x3d')]||_0x5d1a2c[_0x8ac7('0x3d')]!=='SequelizeValidationError'){logger['error'](util[_0x8ac7('0x49')](_0x5d1a2c,{'showHidden':![],'depth':null}));}}});}exports[_0x8ac7('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 4f9e063..f1a5fb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c79=['util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','push','now','CmContact','destroy','then','finished\x20populating','contacts1','bulkCreate','log','CmHopper','hopper2','catch'];(function(_0x245bce,_0x28a015){var _0x5e625e=function(_0x6c73b0){while(--_0x6c73b0){_0x245bce['push'](_0x245bce['shift']());}};_0x5e625e(++_0x28a015);}(_0x5c79,0x1dc));var _0x95c7=function(_0x21233e,_0x2d39c1){_0x21233e=_0x21233e-0x0;var _0x3752c9=_0x5c79[_0x21233e];return _0x3752c9;};'use strict';var util=require(_0x95c7('0x0'));var db=require(_0x95c7('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x95c7('0x2')+i,'lastName':_0x95c7('0x3')+i,'phone':0xf879fb460+i,'email':_0x95c7('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x95c7('0x5')]({'id':i,'active':![],'scheduledat':Date['now'](),'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[_0x95c7('0x5')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x95c7('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x95c7('0x5')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x95c7('0x6')]()});}db[_0x95c7('0x7')][_0x95c7('0x8')]({'where':{}})[_0x95c7('0x9')](function(){return db[_0x95c7('0x7')]['bulkCreate'](contacts);})[_0x95c7('0x9')](function(){console['log'](_0x95c7('0xa'),_0x95c7('0xb'));return db['CmHopper'][_0x95c7('0x8')]({'where':{}});})['then'](function(){return db['CmHopper'][_0x95c7('0xc')](hopper);})[_0x95c7('0x9')](function(){console[_0x95c7('0xd')]('finished\x20populating','hopper1');return db[_0x95c7('0x7')][_0x95c7('0xc')](contacts2);})[_0x95c7('0x9')](function(){console['log'](_0x95c7('0xa'),'contacts2');return db[_0x95c7('0xe')][_0x95c7('0xc')](hopper2);})[_0x95c7('0x9')](function(){console[_0x95c7('0xd')](_0x95c7('0xa'),_0x95c7('0xf'));})[_0x95c7('0x10')](function(_0x250679){console[_0x95c7('0xd')](_0x250679);});
\ No newline at end of file
+var _0x0cd7=['contacts1','CmHopper','hopper1','catch','util','../mysqldb','innocenzo.biondo','@xcally.com','push','now','Innocenzo','Biondo','CmContact','destroy','then','bulkCreate','log','finished\x20populating'];(function(_0x185cfe,_0x2edf62){var _0x37b8f0=function(_0x571a5e){while(--_0x571a5e){_0x185cfe['push'](_0x185cfe['shift']());}};_0x37b8f0(++_0x2edf62);}(_0x0cd7,0x1ea));var _0x70cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0cd7[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x70cd('0x0'));var db=require(_0x70cd('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x70cd('0x2')+i+_0x70cd('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x70cd('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x70cd('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x70cd('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x70cd('0x6')+i,'lastName':_0x70cd('0x7')+i,'phone':0xf879fb460+i,'email':_0x70cd('0x2')+i+_0x70cd('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x70cd('0x5')](),'updatedAt':Date['now']()});}db[_0x70cd('0x8')][_0x70cd('0x9')]({'where':{}})[_0x70cd('0xa')](function(){return db[_0x70cd('0x8')][_0x70cd('0xb')](contacts);})[_0x70cd('0xa')](function(){console[_0x70cd('0xc')](_0x70cd('0xd'),_0x70cd('0xe'));return db[_0x70cd('0xf')][_0x70cd('0x9')]({'where':{}});})[_0x70cd('0xa')](function(){return db[_0x70cd('0xf')][_0x70cd('0xb')](hopper);})[_0x70cd('0xa')](function(){console[_0x70cd('0xc')](_0x70cd('0xd'),_0x70cd('0x10'));return db['CmContact'][_0x70cd('0xb')](contacts2);})[_0x70cd('0xa')](function(){console['log']('finished\x20populating','contacts2');return db[_0x70cd('0xf')][_0x70cd('0xb')](hopper2);})[_0x70cd('0xa')](function(){console[_0x70cd('0xc')](_0x70cd('0xd'),'hopper2');})[_0x70cd('0x11')](function(_0x1a9e67){console['log'](_0x1a9e67);});
\ No newline at end of file
index ca6a2b8..166335e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dd1=['catch','util','../mysqldb','format','%s%s','%s%s@xcally.com','agent','password','friend','wss','all','ulaw','yes','User','bulkCreate','then','log','add\x20user'];(function(_0x8153e3,_0x12a706){var _0x14f2b3=function(_0x722b5a){while(--_0x722b5a){_0x8153e3['push'](_0x8153e3['shift']());}};_0x14f2b3(++_0x12a706);}(_0x8dd1,0x1d5));var _0x18dd=function(_0x35e4e8,_0x231074){_0x35e4e8=_0x35e4e8-0x0;var _0x3cc5a3=_0x8dd1[_0x35e4e8];return _0x3cc5a3;};'use strict';var util=require(_0x18dd('0x0'));var db=require(_0x18dd('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format']('%s%s','agent',i),'fullname':util[_0x18dd('0x2')](_0x18dd('0x3'),'agent',i),'email':util[_0x18dd('0x2')](_0x18dd('0x4'),_0x18dd('0x5'),i),'role':_0x18dd('0x5'),'password':_0x18dd('0x6'),'internal':0xfa0+i,'type':_0x18dd('0x7'),'transport':['udp','ws',_0x18dd('0x8')],'disallow':[_0x18dd('0x9')],'allow':[_0x18dd('0xa')],'defaultuser':util['format']('%s%s',_0x18dd('0x5'),i),'encryption':_0x18dd('0xb'),'avpf':_0x18dd('0xb'),'force_avp':'yes','icesupport':_0x18dd('0xb'),'dtlsenable':_0x18dd('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0x18dd('0x2')]('\x22%s\x22\x20<%s>',util[_0x18dd('0x2')]('%s%s',_0x18dd('0x5'),i),0xfa0+i)});}db[_0x18dd('0xc')][_0x18dd('0xd')](users)[_0x18dd('0xe')](function(){console[_0x18dd('0xf')](_0x18dd('0x10'));})[_0x18dd('0x11')](function(_0x34416d){console[_0x18dd('0xf')](_0x34416d);});
\ No newline at end of file
+var _0xf867=['/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','friend','udp','wss','ulaw','yes'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xf867,0x95));var _0x7f86=function(_0x359708,_0x199a31){_0x359708=_0x359708-0x0;var _0x17000a=_0xf867[_0x359708];return _0x17000a;};'use strict';var util=require('util');var db=require(_0x7f86('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7f86('0x1')]({'name':util['format'](_0x7f86('0x2'),_0x7f86('0x3'),i),'fullname':util[_0x7f86('0x4')](_0x7f86('0x2'),'agent',i),'email':util[_0x7f86('0x4')](_0x7f86('0x5'),_0x7f86('0x3'),i),'role':_0x7f86('0x3'),'password':'password','internal':0xfa0+i,'type':_0x7f86('0x6'),'transport':[_0x7f86('0x7'),'ws',_0x7f86('0x8')],'disallow':['all'],'allow':[_0x7f86('0x9')],'defaultuser':util['format'](_0x7f86('0x2'),'agent',i),'encryption':_0x7f86('0xa'),'avpf':_0x7f86('0xa'),'force_avp':_0x7f86('0xa'),'icesupport':_0x7f86('0xa'),'dtlsenable':_0x7f86('0xa'),'dtlsverify':'no','dtlscertfile':_0x7f86('0xb'),'dtlsprivatekey':_0x7f86('0xc'),'dtlssetup':_0x7f86('0xd'),'callerid':util[_0x7f86('0x4')](_0x7f86('0xe'),util[_0x7f86('0x4')](_0x7f86('0x2'),_0x7f86('0x3'),i),0xfa0+i)});}db[_0x7f86('0xf')]['bulkCreate'](users)[_0x7f86('0x10')](function(){console[_0x7f86('0x11')](_0x7f86('0x12'));})[_0x7f86('0x13')](function(_0x173e5c){console['log'](_0x173e5c);});
\ No newline at end of file
index 7b1aa09..ecc3bc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe285=['ivr','UserProfileSection','VoiceQueues','ChatQueues','FaxQueues','findAll','Trunks','UserProfileResource','resourceId','then','map','User','where','Campaign','format','Agents','length','user:%s','handshake','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','Trunk','user','VoiceQueue','SmsQueues','OpenchannelQueues','OpenchannelQueue','Telephones','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','voice','chat','fax','sms','mail','openchannel','telephone:%s','leave','emit','user_has_chat_interactions:remove','MailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','remoteAddress','connection','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','bluebird','./environment','name','role','agent','telephone','type'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0xe285,0x10b));var _0x5e28=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe285[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x5e28('0x0'));var util=require(_0x5e28('0x1'));var BPromise=require(_0x5e28('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x5e28('0x3'));var queryQueues={'attributes':['id',_0x5e28('0x4')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x5e28('0x4'),_0x5e28('0x5')],'raw':!![],'where':{'role':_0x5e28('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5e28('0x4')],'where':{'role':_0x5e28('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5e28('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x5e28('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5e28('0x4'),_0x5e28('0x8')],'where':{'type':_0x5e28('0x9')}};function getAssociatedResources(_0x301005,_0x2d7966,_0x3f18c){return db[_0x5e28('0xa')]['findOne']({'where':{'name':_0x301005,'userProfileId':_0x2d7966},'raw':!![]})['then'](function(_0x560d22){if(_0x560d22){if(_0x560d22['autoAssociation']){switch(_0x301005){case _0x5e28('0xb'):case _0x5e28('0xc'):case _0x5e28('0xd'):case'SmsQueues':case'MailQueues':case'OpenchannelQueues':case'WhatsappQueues':return db[_0x3f18c][_0x5e28('0xe')](queryQueues);case'Telephones':return db[_0x3f18c][_0x5e28('0xe')](queryTelephones);case _0x5e28('0xf'):return db[_0x3f18c][_0x5e28('0xe')](queryTrunks);case'IvrCampaigns':return db[_0x3f18c]['findAll'](queryCampaigns);}}else{return db[_0x5e28('0x10')][_0x5e28('0xe')]({'attributes':[_0x5e28('0x11')],'where':{'sectionId':_0x560d22['id']},'raw':!![]})[_0x5e28('0x12')](function(_0x1edeff){if(_0x1edeff){var _0x10c918={'where':{'id':_[_0x5e28('0x13')](_0x1edeff,'resourceId')},'raw':!![]};switch(_0x3f18c){case _0x5e28('0x14'):_0x10c918[_0x5e28('0x15')][_0x5e28('0x5')]='telephone';break;case _0x5e28('0x16'):_0x10c918[_0x5e28('0x15')]['type']=_0x5e28('0x9');break;}return db[_0x3f18c]['findAll'](_0x10c918);}else{return[];}});}}else{return[];}})[_0x5e28('0x12')](function(_0x4886b4){return _0x4886b4;});}function joinOrLeaveQueues(_0x2343d1,_0xca6b7c,_0x1fd8c2,_0x2efc8a){_0x2343d1[_0xca6b7c](util[_0x5e28('0x17')]('%s:queue:%s',_0x1fd8c2,_0x2efc8a['name']));if(_0x2efc8a['Agents']){for(var _0x3897d4=0x0;_0x3897d4<_0x2efc8a[_0x5e28('0x18')][_0x5e28('0x19')];_0x3897d4+=0x1){_0x2343d1[_0xca6b7c](util[_0x5e28('0x17')](_0x5e28('0x1a'),_0x2efc8a[_0x5e28('0x18')][_0x3897d4][_0x5e28('0x4')]));}}}function joinOrLeave(_0x5e4ecb,_0x3b3176,_0x32630e){var _0x12300e;if(_0x5e4ecb[_0x5e28('0x1b')]['query']['id']){db['User']['find']({'attributes':['id',_0x5e28('0x4'),_0x5e28('0x5'),_0x5e28('0x1c')],'where':{'id':_0x5e4ecb['handshake']['query']['id']},'include':[{'model':db[_0x5e28('0x1d')],'as':_0x5e28('0x1e'),'attributes':['id'],'raw':!![]},{'model':db[_0x5e28('0x1f')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x5e28('0x20')],'as':_0x5e28('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x5e28('0x22')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x5e28('0x23')],'as':_0x5e28('0x24'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x5e28('0x25'),'attributes':['id'],'raw':!![]}]})[_0x5e28('0x12')](function(_0x30bd8f){if(_0x30bd8f){_0x12300e=_0x30bd8f;_0x5e4ecb[_0x3b3176](util[_0x5e28('0x17')](_0x5e28('0x1a'),_0x30bd8f['name']));var _0x81c354=[];switch(_0x30bd8f[_0x5e28('0x5')]){case'admin':_0x5e4ecb[_0x3b3176](_0x5e28('0x26'));_0x5e4ecb[_0x3b3176](_0x5e28('0x27'));if(queryQueues[_0x5e28('0x28')](_0x5e28('0x29'))){delete queryQueues['include'];}_0x81c354['push'](db['VoiceQueue']['findAll'](queryQueues));_0x81c354[_0x5e28('0x2a')](db[_0x5e28('0x2b')][_0x5e28('0xe')](queryQueues));_0x81c354[_0x5e28('0x2a')](db[_0x5e28('0x2c')][_0x5e28('0xe')](queryQueues));_0x81c354[_0x5e28('0x2a')](db[_0x5e28('0x2d')][_0x5e28('0xe')](queryQueues));_0x81c354[_0x5e28('0x2a')](db[_0x5e28('0x2e')][_0x5e28('0xe')](queryQueues));_0x81c354[_0x5e28('0x2a')](db['OpenchannelQueue'][_0x5e28('0xe')](queryQueues));_0x81c354[_0x5e28('0x2a')](db['WhatsappQueue'][_0x5e28('0xe')](queryQueues));_0x81c354[_0x5e28('0x2a')](db[_0x5e28('0x14')]['findAll'](queryTelephones));_0x81c354[_0x5e28('0x2a')](db[_0x5e28('0x2f')][_0x5e28('0xe')](queryTrunks));_0x81c354[_0x5e28('0x2a')](db[_0x5e28('0x16')][_0x5e28('0xe')](queryCampaigns));_0x81c354[_0x5e28('0x2a')](db[_0x5e28('0x14')][_0x5e28('0xe')](queryAgents));break;case _0x5e28('0x30'):_0x5e4ecb[_0x3b3176](_0x5e28('0x26'));_0x5e4ecb[_0x3b3176]('voice:outbound');_0x81c354[_0x5e28('0x2a')](getAssociatedResources(_0x5e28('0xb'),_0x30bd8f[_0x5e28('0x1c')],_0x5e28('0x31')));_0x81c354[_0x5e28('0x2a')](getAssociatedResources('ChatQueues',_0x30bd8f[_0x5e28('0x1c')],_0x5e28('0x2b')));_0x81c354[_0x5e28('0x2a')](getAssociatedResources(_0x5e28('0xd'),_0x30bd8f[_0x5e28('0x1c')],'FaxQueue'));_0x81c354[_0x5e28('0x2a')](getAssociatedResources(_0x5e28('0x32'),_0x30bd8f[_0x5e28('0x1c')],_0x5e28('0x2d')));_0x81c354[_0x5e28('0x2a')](getAssociatedResources('MailQueues',_0x30bd8f[_0x5e28('0x1c')],_0x5e28('0x2e')));_0x81c354[_0x5e28('0x2a')](getAssociatedResources(_0x5e28('0x33'),_0x30bd8f['userProfileId'],_0x5e28('0x34')));_0x81c354[_0x5e28('0x2a')](getAssociatedResources('WhatsappQueues',_0x30bd8f['userProfileId'],'WhatsappQueue'));_0x81c354['push'](getAssociatedResources(_0x5e28('0x35'),_0x30bd8f[_0x5e28('0x1c')],_0x5e28('0x14')));_0x81c354[_0x5e28('0x2a')](getAssociatedResources('Trunks',_0x30bd8f[_0x5e28('0x1c')],_0x5e28('0x2f')));_0x81c354['push'](getAssociatedResources('IvrCampaigns',_0x30bd8f['userProfileId'],_0x5e28('0x16')));_0x81c354[_0x5e28('0x2a')](db[_0x5e28('0x14')][_0x5e28('0xe')](queryAgents));break;case'agent':_0x5e4ecb[_0x3b3176](_0x5e28('0x26'));_0x5e4ecb[_0x3b3176](_0x5e28('0x27'));_0x81c354[_0x5e28('0x2a')](_0x30bd8f['getVoiceQueues']({'attributes':['id',_0x5e28('0x4')]}));_0x81c354[_0x5e28('0x2a')](_0x30bd8f[_0x5e28('0x36')]({'attributes':['id',_0x5e28('0x4')]}));_0x81c354[_0x5e28('0x2a')](_0x30bd8f[_0x5e28('0x37')]({'attributes':['id',_0x5e28('0x4')]}));_0x81c354['push'](_0x30bd8f[_0x5e28('0x38')]({'attributes':['id',_0x5e28('0x4')]}));_0x81c354[_0x5e28('0x2a')](_0x30bd8f[_0x5e28('0x39')]({'attributes':['id',_0x5e28('0x4')]}));_0x81c354['push'](_0x30bd8f['getOpenchannelQueues']({'attributes':['id',_0x5e28('0x4')]}));_0x81c354[_0x5e28('0x2a')](_0x30bd8f[_0x5e28('0x3a')]({'attributes':['id',_0x5e28('0x4')]}));break;}return BPromise['all'](_0x81c354);}})['then'](function(_0x4891f6){if(_0x4891f6&&_0x4891f6[_0x5e28('0x19')]){for(var _0x18a7ab=0x0;_0x18a7ab<_0x4891f6[_0x5e28('0x19')];_0x18a7ab+=0x1){for(var _0x17a9f8=0x0;_0x17a9f8<_0x4891f6[_0x18a7ab][_0x5e28('0x19')];_0x17a9f8+=0x1){switch(_0x18a7ab){case 0x0:joinOrLeaveQueues(_0x5e4ecb,_0x3b3176,_0x5e28('0x3b'),_0x4891f6[_0x18a7ab][_0x17a9f8]);break;case 0x1:joinOrLeaveQueues(_0x5e4ecb,_0x3b3176,_0x5e28('0x3c'),_0x4891f6[_0x18a7ab][_0x17a9f8]);break;case 0x2:joinOrLeaveQueues(_0x5e4ecb,_0x3b3176,_0x5e28('0x3d'),_0x4891f6[_0x18a7ab][_0x17a9f8]);break;case 0x3:joinOrLeaveQueues(_0x5e4ecb,_0x3b3176,_0x5e28('0x3e'),_0x4891f6[_0x18a7ab][_0x17a9f8]);break;case 0x4:joinOrLeaveQueues(_0x5e4ecb,_0x3b3176,_0x5e28('0x3f'),_0x4891f6[_0x18a7ab][_0x17a9f8]);break;case 0x5:joinOrLeaveQueues(_0x5e4ecb,_0x3b3176,_0x5e28('0x40'),_0x4891f6[_0x18a7ab][_0x17a9f8]);break;case 0x6:joinOrLeaveQueues(_0x5e4ecb,_0x3b3176,'whatsapp',_0x4891f6[_0x18a7ab][_0x17a9f8]);break;case 0x7:_0x5e4ecb[_0x3b3176](util[_0x5e28('0x17')](_0x5e28('0x41'),_0x4891f6[_0x18a7ab][_0x17a9f8][_0x5e28('0x4')]));break;case 0x8:_0x5e4ecb[_0x3b3176](util[_0x5e28('0x17')]('trunk:%s',_0x4891f6[_0x18a7ab][_0x17a9f8]['name']));break;case 0x9:_0x5e4ecb[_0x3b3176](util[_0x5e28('0x17')]('campaign:%s:%s',_0x4891f6[_0x18a7ab][_0x17a9f8]['type'],_0x4891f6[_0x18a7ab][_0x17a9f8][_0x5e28('0x4')]));break;case 0xa:_0x5e4ecb[_0x3b3176](util[_0x5e28('0x17')](_0x5e28('0x1a'),_0x4891f6[_0x18a7ab][_0x17a9f8]['name']));break;}}}}})[_0x5e28('0x12')](function(){if(_0x3b3176===_0x5e28('0x42')){var _0x5bb86f=_['map'](_0x12300e['ChatInteractions'],'id');return _0x12300e['removeChatInteractions'](_0x5bb86f)[_0x5e28('0x12')](function(){for(var _0x1e0d83=0x0;_0x1e0d83<_0x5bb86f[_0x5e28('0x19')];_0x1e0d83+=0x1){_0x32630e[_0x5e28('0x43')](_0x5e28('0x44'),{'ChatInteractionId':Number(_0x5bb86f[_0x1e0d83]),'UserId':Number(_0x12300e['id'])});}});}})[_0x5e28('0x12')](function(){if(_0x3b3176===_0x5e28('0x42')){var _0x568015=_['map'](_0x12300e[_0x5e28('0x45')],'id');return _0x12300e['removeMailInteractions'](_0x568015)[_0x5e28('0x12')](function(){for(var _0x4afc08=0x0;_0x4afc08<_0x568015[_0x5e28('0x19')];_0x4afc08+=0x1){_0x32630e[_0x5e28('0x43')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x568015[_0x4afc08]),'UserId':Number(_0x12300e['id'])});}});}})[_0x5e28('0x12')](function(){if(_0x3b3176===_0x5e28('0x42')){var _0x2797ba=_[_0x5e28('0x13')](_0x12300e[_0x5e28('0x21')],'id');return _0x12300e[_0x5e28('0x46')](_0x2797ba)[_0x5e28('0x12')](function(){for(var _0x1e0831=0x0;_0x1e0831<_0x2797ba[_0x5e28('0x19')];_0x1e0831+=0x1){_0x32630e[_0x5e28('0x43')](_0x5e28('0x47'),{'FaxInteractionId':Number(_0x2797ba[_0x1e0831]),'UserId':Number(_0x12300e['id'])});}});}})[_0x5e28('0x12')](function(){if(_0x3b3176===_0x5e28('0x42')){var _0x5262b7=_[_0x5e28('0x13')](_0x12300e[_0x5e28('0x48')],'id');return _0x12300e[_0x5e28('0x49')](_0x5262b7)[_0x5e28('0x12')](function(){for(var _0x1365b2=0x0;_0x1365b2<_0x5262b7[_0x5e28('0x19')];_0x1365b2+=0x1){_0x32630e[_0x5e28('0x43')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x5262b7[_0x1365b2]),'UserId':Number(_0x12300e['id'])});}});}})[_0x5e28('0x12')](function(){if(_0x3b3176==='leave'){var _0x3eda4d=_[_0x5e28('0x13')](_0x12300e['OpenchannelInteractions'],'id');return _0x12300e[_0x5e28('0x4a')](_0x3eda4d)[_0x5e28('0x12')](function(){for(var _0x4fd54b=0x0;_0x4fd54b<_0x3eda4d[_0x5e28('0x19')];_0x4fd54b+=0x1){_0x32630e[_0x5e28('0x43')](_0x5e28('0x4b'),{'OpenchannelInteractionId':Number(_0x3eda4d[_0x4fd54b]),'UserId':Number(_0x12300e['id'])});}});}})[_0x5e28('0x12')](function(){if(_0x3b3176===_0x5e28('0x42')){var _0x3d625b=_['map'](_0x12300e[_0x5e28('0x25')],'id');return _0x12300e['removeWhatsappInteractions'](_0x3d625b)[_0x5e28('0x12')](function(){for(var _0x5e5d69=0x0;_0x5e5d69<_0x3d625b['length'];_0x5e5d69+=0x1){_0x32630e[_0x5e28('0x43')](_0x5e28('0x4c'),{'WhatsappInteractionId':Number(_0x3d625b[_0x5e5d69]),'UserId':Number(_0x12300e['id'])});}});}})[_0x5e28('0x4d')](function(_0x14ca18){_0x5e4ecb[_0x5e28('0x4e')](_0x14ca18);});}}function onDisconnect(_0x7a8a0f,_0x5ed8ad){joinOrLeave(_0x7a8a0f,_0x5e28('0x42'),_0x5ed8ad);}function onConnect(_0x4e816e){joinOrLeave(_0x4e816e,_0x5e28('0x4f'));}exports[_0x5e28('0x50')]=function(_0x56801e){_0x56801e['on']('connection',function(_0x2a5812){_0x2a5812[_0x5e28('0x51')](0x0);_0x2a5812[_0x5e28('0x52')]=_0x2a5812[_0x5e28('0x53')]['connection'][_0x5e28('0x54')]+':'+_0x2a5812['request'][_0x5e28('0x55')][_0x5e28('0x56')];_0x2a5812[_0x5e28('0x57')]=new Date();_0x2a5812['log']=function(_0x336fac){console['log'](_0x5e28('0x58')+_0x2a5812[_0x5e28('0x59')][_0x5e28('0x4')]+'['+_0x2a5812['address']+']',_0x336fac);};_0x2a5812['on'](_0x5e28('0x5a'),function(){onDisconnect(_0x2a5812,_0x56801e);_0x2a5812[_0x5e28('0x4e')]('DISCONNECTED');});onConnect(_0x2a5812);_0x2a5812[_0x5e28('0x4e')](_0x5e28('0x5b'));});};
\ No newline at end of file
+var _0x252b=['telephone','Campaign','where','format','%s:queue:%s','Agents','length','user:%s','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:outbound','MailQueues','WhatsappQueues','Telephones','voice:inbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','mail','openchannel','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt','nsp','disconnect','CONNECTED','lodash','util','bluebird','./environment','name','User','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','OpenchannelQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map'];(function(_0x11fcdf,_0x5d6088){var _0x144bfe=function(_0x4678ab){while(--_0x4678ab){_0x11fcdf['push'](_0x11fcdf['shift']());}};_0x144bfe(++_0x5d6088);}(_0x252b,0x117));var _0xb252=function(_0x178f9c,_0x9dc87a){_0x178f9c=_0x178f9c-0x0;var _0x413f4a=_0x252b[_0x178f9c];return _0x413f4a;};'use strict';var _=require(_0xb252('0x0'));var util=require(_0xb252('0x1'));var BPromise=require(_0xb252('0x2'));var db=require('../mysqldb')['db'];var config=require(_0xb252('0x3'));var queryQueues={'attributes':['id',_0xb252('0x4')],'include':[{'as':'Agents','model':db[_0xb252('0x5')],'attributes':['id',_0xb252('0x4'),_0xb252('0x6')],'raw':!![],'where':{'role':_0xb252('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xb252('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xb252('0x4')],'where':{'role':_0xb252('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb252('0x4'),_0xb252('0x8')],'where':{'type':_0xb252('0x9')}};function getAssociatedResources(_0x3be9c0,_0x17a963,_0x444cf4){return db[_0xb252('0xa')][_0xb252('0xb')]({'where':{'name':_0x3be9c0,'userProfileId':_0x17a963},'raw':!![]})[_0xb252('0xc')](function(_0x395414){if(_0x395414){if(_0x395414[_0xb252('0xd')]){switch(_0x3be9c0){case _0xb252('0xe'):case'ChatQueues':case _0xb252('0xf'):case _0xb252('0x10'):case'MailQueues':case _0xb252('0x11'):case'WhatsappQueues':return db[_0x444cf4][_0xb252('0x12')](queryQueues);case'Telephones':return db[_0x444cf4][_0xb252('0x12')](queryTelephones);case _0xb252('0x13'):return db[_0x444cf4][_0xb252('0x12')](queryTrunks);case _0xb252('0x14'):return db[_0x444cf4][_0xb252('0x12')](queryCampaigns);}}else{return db[_0xb252('0x15')][_0xb252('0x12')]({'attributes':[_0xb252('0x16')],'where':{'sectionId':_0x395414['id']},'raw':!![]})[_0xb252('0xc')](function(_0x3c09f7){if(_0x3c09f7){var _0x424c66={'where':{'id':_[_0xb252('0x17')](_0x3c09f7,_0xb252('0x16'))},'raw':!![]};switch(_0x444cf4){case _0xb252('0x5'):_0x424c66['where'][_0xb252('0x6')]=_0xb252('0x18');break;case _0xb252('0x19'):_0x424c66[_0xb252('0x1a')][_0xb252('0x8')]='ivr';break;}return db[_0x444cf4][_0xb252('0x12')](_0x424c66);}else{return[];}});}}else{return[];}})['then'](function(_0x5defed){return _0x5defed;});}function joinOrLeaveQueues(_0x4c493b,_0x566558,_0x40cfc2,_0x2c1421){_0x4c493b[_0x566558](util[_0xb252('0x1b')](_0xb252('0x1c'),_0x40cfc2,_0x2c1421[_0xb252('0x4')]));if(_0x2c1421['Agents']){for(var _0x436df6=0x0;_0x436df6<_0x2c1421[_0xb252('0x1d')][_0xb252('0x1e')];_0x436df6+=0x1){_0x4c493b[_0x566558](util['format'](_0xb252('0x1f'),_0x2c1421[_0xb252('0x1d')][_0x436df6][_0xb252('0x4')]));}}}function joinOrLeave(_0x3d6bd7,_0x1badc6,_0xf87fd2){var _0x2eb0d6;if(_0x3d6bd7['handshake']['query']['id']){db[_0xb252('0x5')]['find']({'attributes':['id','name',_0xb252('0x6'),_0xb252('0x20')],'where':{'id':_0x3d6bd7[_0xb252('0x21')]['query']['id']},'include':[{'model':db[_0xb252('0x22')],'as':_0xb252('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xb252('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xb252('0x25')],'as':_0xb252('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xb252('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb252('0x28')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xb252('0x29')],'as':_0xb252('0x2a'),'attributes':['id'],'raw':!![]}]})[_0xb252('0xc')](function(_0xfc44af){if(_0xfc44af){_0x2eb0d6=_0xfc44af;_0x3d6bd7[_0x1badc6](util[_0xb252('0x1b')]('user:%s',_0xfc44af[_0xb252('0x4')]));var _0x50bd3e=[];switch(_0xfc44af[_0xb252('0x6')]){case _0xb252('0x2b'):_0x3d6bd7[_0x1badc6]('voice:inbound');_0x3d6bd7[_0x1badc6]('voice:outbound');if(queryQueues[_0xb252('0x2c')](_0xb252('0x2d'))){delete queryQueues['include'];}_0x50bd3e[_0xb252('0x2e')](db[_0xb252('0x2f')][_0xb252('0x12')](queryQueues));_0x50bd3e['push'](db[_0xb252('0x30')][_0xb252('0x12')](queryQueues));_0x50bd3e[_0xb252('0x2e')](db[_0xb252('0x31')][_0xb252('0x12')](queryQueues));_0x50bd3e[_0xb252('0x2e')](db[_0xb252('0x32')][_0xb252('0x12')](queryQueues));_0x50bd3e['push'](db[_0xb252('0x33')][_0xb252('0x12')](queryQueues));_0x50bd3e[_0xb252('0x2e')](db[_0xb252('0x34')]['findAll'](queryQueues));_0x50bd3e['push'](db[_0xb252('0x35')][_0xb252('0x12')](queryQueues));_0x50bd3e['push'](db[_0xb252('0x5')][_0xb252('0x12')](queryTelephones));_0x50bd3e[_0xb252('0x2e')](db[_0xb252('0x36')]['findAll'](queryTrunks));_0x50bd3e[_0xb252('0x2e')](db['Campaign'][_0xb252('0x12')](queryCampaigns));_0x50bd3e[_0xb252('0x2e')](db[_0xb252('0x5')][_0xb252('0x12')](queryAgents));break;case'user':_0x3d6bd7[_0x1badc6]('voice:inbound');_0x3d6bd7[_0x1badc6](_0xb252('0x37'));_0x50bd3e[_0xb252('0x2e')](getAssociatedResources(_0xb252('0xe'),_0xfc44af[_0xb252('0x20')],_0xb252('0x2f')));_0x50bd3e[_0xb252('0x2e')](getAssociatedResources('ChatQueues',_0xfc44af['userProfileId'],'ChatQueue'));_0x50bd3e[_0xb252('0x2e')](getAssociatedResources('FaxQueues',_0xfc44af[_0xb252('0x20')],_0xb252('0x31')));_0x50bd3e[_0xb252('0x2e')](getAssociatedResources(_0xb252('0x10'),_0xfc44af[_0xb252('0x20')],'SmsQueue'));_0x50bd3e[_0xb252('0x2e')](getAssociatedResources(_0xb252('0x38'),_0xfc44af[_0xb252('0x20')],_0xb252('0x33')));_0x50bd3e[_0xb252('0x2e')](getAssociatedResources(_0xb252('0x11'),_0xfc44af['userProfileId'],'OpenchannelQueue'));_0x50bd3e[_0xb252('0x2e')](getAssociatedResources(_0xb252('0x39'),_0xfc44af['userProfileId'],_0xb252('0x35')));_0x50bd3e[_0xb252('0x2e')](getAssociatedResources(_0xb252('0x3a'),_0xfc44af[_0xb252('0x20')],_0xb252('0x5')));_0x50bd3e[_0xb252('0x2e')](getAssociatedResources(_0xb252('0x13'),_0xfc44af[_0xb252('0x20')],_0xb252('0x36')));_0x50bd3e['push'](getAssociatedResources('IvrCampaigns',_0xfc44af[_0xb252('0x20')],'Campaign'));_0x50bd3e[_0xb252('0x2e')](db[_0xb252('0x5')][_0xb252('0x12')](queryAgents));break;case _0xb252('0x7'):_0x3d6bd7[_0x1badc6](_0xb252('0x3b'));_0x3d6bd7[_0x1badc6](_0xb252('0x37'));_0x50bd3e['push'](_0xfc44af[_0xb252('0x3c')]({'attributes':['id',_0xb252('0x4')]}));_0x50bd3e['push'](_0xfc44af[_0xb252('0x3d')]({'attributes':['id',_0xb252('0x4')]}));_0x50bd3e[_0xb252('0x2e')](_0xfc44af[_0xb252('0x3e')]({'attributes':['id','name']}));_0x50bd3e[_0xb252('0x2e')](_0xfc44af[_0xb252('0x3f')]({'attributes':['id',_0xb252('0x4')]}));_0x50bd3e['push'](_0xfc44af[_0xb252('0x40')]({'attributes':['id','name']}));_0x50bd3e[_0xb252('0x2e')](_0xfc44af[_0xb252('0x41')]({'attributes':['id',_0xb252('0x4')]}));_0x50bd3e[_0xb252('0x2e')](_0xfc44af[_0xb252('0x42')]({'attributes':['id',_0xb252('0x4')]}));break;}return BPromise[_0xb252('0x43')](_0x50bd3e);}})[_0xb252('0xc')](function(_0x18cd40){if(_0x18cd40&&_0x18cd40[_0xb252('0x1e')]){for(var _0x267af9=0x0;_0x267af9<_0x18cd40[_0xb252('0x1e')];_0x267af9+=0x1){for(var _0x5f4a77=0x0;_0x5f4a77<_0x18cd40[_0x267af9][_0xb252('0x1e')];_0x5f4a77+=0x1){switch(_0x267af9){case 0x0:joinOrLeaveQueues(_0x3d6bd7,_0x1badc6,'voice',_0x18cd40[_0x267af9][_0x5f4a77]);break;case 0x1:joinOrLeaveQueues(_0x3d6bd7,_0x1badc6,_0xb252('0x44'),_0x18cd40[_0x267af9][_0x5f4a77]);break;case 0x2:joinOrLeaveQueues(_0x3d6bd7,_0x1badc6,'fax',_0x18cd40[_0x267af9][_0x5f4a77]);break;case 0x3:joinOrLeaveQueues(_0x3d6bd7,_0x1badc6,'sms',_0x18cd40[_0x267af9][_0x5f4a77]);break;case 0x4:joinOrLeaveQueues(_0x3d6bd7,_0x1badc6,_0xb252('0x45'),_0x18cd40[_0x267af9][_0x5f4a77]);break;case 0x5:joinOrLeaveQueues(_0x3d6bd7,_0x1badc6,_0xb252('0x46'),_0x18cd40[_0x267af9][_0x5f4a77]);break;case 0x6:joinOrLeaveQueues(_0x3d6bd7,_0x1badc6,'whatsapp',_0x18cd40[_0x267af9][_0x5f4a77]);break;case 0x7:_0x3d6bd7[_0x1badc6](util[_0xb252('0x1b')]('telephone:%s',_0x18cd40[_0x267af9][_0x5f4a77][_0xb252('0x4')]));break;case 0x8:_0x3d6bd7[_0x1badc6](util[_0xb252('0x1b')](_0xb252('0x47'),_0x18cd40[_0x267af9][_0x5f4a77]['name']));break;case 0x9:_0x3d6bd7[_0x1badc6](util[_0xb252('0x1b')](_0xb252('0x48'),_0x18cd40[_0x267af9][_0x5f4a77][_0xb252('0x8')],_0x18cd40[_0x267af9][_0x5f4a77]['name']));break;case 0xa:_0x3d6bd7[_0x1badc6](util[_0xb252('0x1b')](_0xb252('0x1f'),_0x18cd40[_0x267af9][_0x5f4a77]['name']));break;}}}}})['then'](function(){if(_0x1badc6===_0xb252('0x49')){var _0x3d5c35=_[_0xb252('0x17')](_0x2eb0d6[_0xb252('0x23')],'id');return _0x2eb0d6[_0xb252('0x4a')](_0x3d5c35)['then'](function(){for(var _0x2ce313=0x0;_0x2ce313<_0x3d5c35[_0xb252('0x1e')];_0x2ce313+=0x1){_0xf87fd2[_0xb252('0x4b')](_0xb252('0x4c'),{'ChatInteractionId':Number(_0x3d5c35[_0x2ce313]),'UserId':Number(_0x2eb0d6['id'])});}});}})[_0xb252('0xc')](function(){if(_0x1badc6===_0xb252('0x49')){var _0x1b79f4=_[_0xb252('0x17')](_0x2eb0d6[_0xb252('0x24')],'id');return _0x2eb0d6[_0xb252('0x4d')](_0x1b79f4)[_0xb252('0xc')](function(){for(var _0x5d92c8=0x0;_0x5d92c8<_0x1b79f4[_0xb252('0x1e')];_0x5d92c8+=0x1){_0xf87fd2[_0xb252('0x4b')](_0xb252('0x4e'),{'MailInteractionId':Number(_0x1b79f4[_0x5d92c8]),'UserId':Number(_0x2eb0d6['id'])});}});}})[_0xb252('0xc')](function(){if(_0x1badc6===_0xb252('0x49')){var _0x5767b=_['map'](_0x2eb0d6['FaxInteractions'],'id');return _0x2eb0d6['removeFaxInteractions'](_0x5767b)[_0xb252('0xc')](function(){for(var _0x257895=0x0;_0x257895<_0x5767b[_0xb252('0x1e')];_0x257895+=0x1){_0xf87fd2['emit'](_0xb252('0x4f'),{'FaxInteractionId':Number(_0x5767b[_0x257895]),'UserId':Number(_0x2eb0d6['id'])});}});}})[_0xb252('0xc')](function(){if(_0x1badc6===_0xb252('0x49')){var _0x1a89ee=_[_0xb252('0x17')](_0x2eb0d6[_0xb252('0x50')],'id');return _0x2eb0d6[_0xb252('0x51')](_0x1a89ee)[_0xb252('0xc')](function(){for(var _0x1896af=0x0;_0x1896af<_0x1a89ee['length'];_0x1896af+=0x1){_0xf87fd2[_0xb252('0x4b')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x1a89ee[_0x1896af]),'UserId':Number(_0x2eb0d6['id'])});}});}})[_0xb252('0xc')](function(){if(_0x1badc6===_0xb252('0x49')){var _0x30c6fd=_[_0xb252('0x17')](_0x2eb0d6[_0xb252('0x52')],'id');return _0x2eb0d6[_0xb252('0x53')](_0x30c6fd)[_0xb252('0xc')](function(){for(var _0x41e28e=0x0;_0x41e28e<_0x30c6fd['length'];_0x41e28e+=0x1){_0xf87fd2[_0xb252('0x4b')](_0xb252('0x54'),{'OpenchannelInteractionId':Number(_0x30c6fd[_0x41e28e]),'UserId':Number(_0x2eb0d6['id'])});}});}})[_0xb252('0xc')](function(){if(_0x1badc6===_0xb252('0x49')){var _0x2c8382=_[_0xb252('0x17')](_0x2eb0d6['WhatsappInteractions'],'id');return _0x2eb0d6[_0xb252('0x55')](_0x2c8382)[_0xb252('0xc')](function(){for(var _0x40d656=0x0;_0x40d656<_0x2c8382[_0xb252('0x1e')];_0x40d656+=0x1){_0xf87fd2[_0xb252('0x4b')](_0xb252('0x56'),{'WhatsappInteractionId':Number(_0x2c8382[_0x40d656]),'UserId':Number(_0x2eb0d6['id'])});}});}})[_0xb252('0x57')](function(_0x19ade7){_0x3d6bd7[_0xb252('0x58')](_0x19ade7);});}}function onDisconnect(_0xd688a7,_0x1f9313){joinOrLeave(_0xd688a7,_0xb252('0x49'),_0x1f9313);}function onConnect(_0x39fae1){joinOrLeave(_0x39fae1,_0xb252('0x59'));}exports[_0xb252('0x5a')]=function(_0x51e5cb){_0x51e5cb['on'](_0xb252('0x5b'),function(_0x4e1828){_0x4e1828[_0xb252('0x5c')](0x0);_0x4e1828[_0xb252('0x5d')]=_0x4e1828['request'][_0xb252('0x5b')][_0xb252('0x5e')]+':'+_0x4e1828[_0xb252('0x5f')][_0xb252('0x5b')][_0xb252('0x60')];_0x4e1828[_0xb252('0x61')]=new Date();_0x4e1828[_0xb252('0x58')]=function(_0x35cf4f){console['log']('SocketIO\x20'+_0x4e1828[_0xb252('0x62')][_0xb252('0x4')]+'['+_0x4e1828[_0xb252('0x5d')]+']',_0x35cf4f);};_0x4e1828['on'](_0xb252('0x63'),function(){onDisconnect(_0x4e1828,_0x51e5cb);_0x4e1828[_0xb252('0x58')]('DISCONNECTED');});onConnect(_0x4e1828);_0x4e1828[_0xb252('0x58')](_0xb252('0x64'));});};
\ No newline at end of file
index 1c0308a..01cdc4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7aed=['client','http','Chat','ChatInteraction','afterCreate','afterUpdate','closedinteraction','ChatMessage','newmessage','SmsInteraction','Sms','SmsMessage','Whatsapp','newinteraction','Fax','FaxInteraction','FaxMessage','MailInteraction','OpenchannelInteraction','Openchannel','request','EventManager','then','Trigger,\x20%s','error','code','catch','get','channel','event','direction','User','find','UserId','name','format','SIP/%s','incomingmessage','outgoingmessage','opened','changed','closed','interface','length','hasOwnProperty','model','hook','condition','util','../../mysqldb','../logger'];(function(_0x140682,_0x5a3ca0){var _0x32b3d9=function(_0x3b50fd){while(--_0x3b50fd){_0x140682['push'](_0x140682['shift']());}};_0x32b3d9(++_0x5a3ca0);}(_0x7aed,0x195));var _0xd7ae=function(_0x2552c9,_0x47c37a){_0x2552c9=_0x2552c9-0x0;var _0x34ef3f=_0x7aed[_0x2552c9];return _0x34ef3f;};'use strict';var util=require(_0xd7ae('0x0'));var db=require(_0xd7ae('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0xd7ae('0x2'))('triggers');var client=jayson[_0xd7ae('0x3')][_0xd7ae('0x4')]({'port':0x232a});var triggers=[{'channel':_0xd7ae('0x5'),'model':_0xd7ae('0x6'),'event':_0xd7ae('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xd7ae('0x5'),'model':_0xd7ae('0x6'),'event':_0xd7ae('0x8'),'condition':_0xd7ae('0x9'),'callback':afterUpdate},{'channel':'Chat','model':_0xd7ae('0xa'),'event':_0xd7ae('0x7'),'condition':_0xd7ae('0xb'),'callback':afterCreateMessage},{'channel':'Sms','model':_0xd7ae('0xc'),'event':_0xd7ae('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xd7ae('0xd'),'model':'SmsInteraction','event':'afterUpdate','condition':_0xd7ae('0x9'),'callback':afterUpdate},{'channel':_0xd7ae('0xd'),'model':_0xd7ae('0xe'),'event':_0xd7ae('0x7'),'condition':_0xd7ae('0xb'),'callback':afterCreateMessage},{'channel':_0xd7ae('0xf'),'model':'WhatsappInteraction','event':_0xd7ae('0x7'),'condition':_0xd7ae('0x10'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0xd7ae('0x8'),'condition':_0xd7ae('0x9'),'callback':afterUpdate},{'channel':_0xd7ae('0xf'),'model':'WhatsappMessage','event':_0xd7ae('0x7'),'condition':_0xd7ae('0xb'),'callback':afterCreateMessage},{'channel':_0xd7ae('0x11'),'model':_0xd7ae('0x12'),'event':_0xd7ae('0x7'),'condition':_0xd7ae('0x10'),'callback':afterCreate},{'channel':_0xd7ae('0x11'),'model':_0xd7ae('0x12'),'event':_0xd7ae('0x8'),'condition':_0xd7ae('0x9'),'callback':afterUpdate},{'channel':'Fax','model':_0xd7ae('0x13'),'event':_0xd7ae('0x7'),'condition':_0xd7ae('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':_0xd7ae('0x14'),'event':_0xd7ae('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Mail','model':'MailInteraction','event':_0xd7ae('0x8'),'condition':_0xd7ae('0x9'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0xd7ae('0x7'),'condition':_0xd7ae('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xd7ae('0x15'),'event':_0xd7ae('0x7'),'condition':_0xd7ae('0x10'),'callback':afterCreate},{'channel':_0xd7ae('0x16'),'model':_0xd7ae('0x15'),'event':_0xd7ae('0x8'),'condition':_0xd7ae('0x9'),'callback':afterUpdate},{'channel':_0xd7ae('0x16'),'model':'OpenchannelMessage','event':_0xd7ae('0x7'),'condition':_0xd7ae('0xb'),'callback':afterCreateMessage}];function request(_0xe1c3ad){return client[_0xd7ae('0x17')](_0xd7ae('0x18'),_0xe1c3ad)[_0xd7ae('0x19')](function(_0x5bea82){logger['info'](_0xd7ae('0x1a'),_0xd7ae('0x18'),_0x5bea82);if(_0x5bea82[_0xd7ae('0x1b')]){if(_0x5bea82[_0xd7ae('0x1b')][_0xd7ae('0x1c')]===0x1f4){logger[_0xd7ae('0x1b')](_0xd7ae('0x1a'),_0xd7ae('0x18'),_0x5bea82[_0xd7ae('0x1b')]);}}})[_0xd7ae('0x1d')](function(_0x21a916){logger['error'](_0xd7ae('0x1a'),_0xd7ae('0x18'),_0x21a916);});}function afterCreateMessage(_0x12b041,_0x1fc6e4){return function(_0x2fa578,_0x2159af){_0x2fa578=_0x2fa578[_0xd7ae('0x1e')]({'plain':!![]});_0x2fa578[_0xd7ae('0x1f')]=_0x12b041;_0x2fa578[_0xd7ae('0x20')]=_0x2fa578[_0xd7ae('0x21')];if(_0x2fa578['UserId']){return db[_0xd7ae('0x22')][_0xd7ae('0x23')]({'where':{'id':_0x2fa578[_0xd7ae('0x24')]},'attributes':['id',_0xd7ae('0x25')],'raw':!![]})['then'](function(_0x43daeb){_0x2fa578['interface']=util[_0xd7ae('0x26')](_0xd7ae('0x27'),_0x43daeb['name']);_0x2fa578[_0xd7ae('0x1f')]=_0x12b041;return request({'event':_0xd7ae('0x28'),'message':_0x2fa578});})['catch'](function(_0x3a0948){console['error'](_0x3a0948);});}else{return request({'event':_0xd7ae('0x29'),'message':_0x2fa578});}};}function afterCreate(_0xbed21e,_0x5324a3){return function(_0x5661b5,_0x1976cf){_0x5661b5=_0x5661b5[_0xd7ae('0x1e')]({'plain':!![]});_0x5661b5['channel']=_0xbed21e;_0x5661b5[_0xd7ae('0x20')]=_0xd7ae('0x2a');return request({'event':_0x5324a3,'message':_0x5661b5});};}function afterUpdate(_0x2c439a,_0x5b68f8){return function(_0x3fb82c,_0x131a6e){if(_0x3fb82c[_0xd7ae('0x2b')](_0xd7ae('0x2c'))&&_0x3fb82c[_0xd7ae('0x2c')]){_0x3fb82c=_0x3fb82c['get']({'plain':!![]});_0x3fb82c[_0xd7ae('0x1f')]=_0x2c439a;_0x3fb82c[_0xd7ae('0x20')]=_0xd7ae('0x2c');if(_0x3fb82c['UserId']){return db[_0xd7ae('0x22')][_0xd7ae('0x23')]({'where':{'id':_0x3fb82c['UserId']},'attributes':['id',_0xd7ae('0x25')],'raw':!![]})[_0xd7ae('0x19')](function(_0x3bb012){_0x3fb82c[_0xd7ae('0x2d')]=util[_0xd7ae('0x26')]('SIP/%s',_0x3bb012[_0xd7ae('0x25')]);return request({'event':_0x5b68f8,'message':_0x3fb82c});})[_0xd7ae('0x1d')](function(_0xdd38ee){console[_0xd7ae('0x1b')](_0xdd38ee);});}else{return request({'event':_0x5b68f8,'message':_0x3fb82c});}}};}exports['default']=function(){for(var _0x5ce556=0x0;_0x5ce556<triggers[_0xd7ae('0x2e')];_0x5ce556+=0x1){if(db[_0xd7ae('0x2f')](triggers[_0x5ce556][_0xd7ae('0x30')])){db[triggers[_0x5ce556][_0xd7ae('0x30')]][_0xd7ae('0x31')](triggers[_0x5ce556][_0xd7ae('0x20')],triggers[_0x5ce556]['callback'](triggers[_0x5ce556][_0xd7ae('0x1f')]['toLowerCase'](),triggers[_0x5ce556][_0xd7ae('0x32')]));}}};
\ No newline at end of file
+var _0x5121=['newmessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','error','code','Trigger,\x20%s','catch','get','event','direction','UserId','User','find','name','format','SIP/%s','incomingmessage','outgoingmessage','opened','changed','closed','channel','default','length','hasOwnProperty','hook','callback','toLowerCase','condition','util','../../mysqldb','../logger','triggers','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage'];(function(_0x349204,_0xd65f54){var _0x5ec406=function(_0x4b7eeb){while(--_0x4b7eeb){_0x349204['push'](_0x349204['shift']());}};_0x5ec406(++_0xd65f54);}(_0x5121,0x110));var _0x1512=function(_0x1a6007,_0x350755){_0x1a6007=_0x1a6007-0x0;var _0x120665=_0x5121[_0x1a6007];return _0x120665;};'use strict';var util=require(_0x1512('0x0'));var db=require(_0x1512('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x1512('0x2'))(_0x1512('0x3'));var client=jayson[_0x1512('0x4')][_0x1512('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x1512('0x6'),'event':_0x1512('0x7'),'condition':_0x1512('0x8'),'callback':afterCreate},{'channel':_0x1512('0x9'),'model':_0x1512('0x6'),'event':_0x1512('0xa'),'condition':_0x1512('0xb'),'callback':afterUpdate},{'channel':_0x1512('0x9'),'model':_0x1512('0xc'),'event':_0x1512('0x7'),'condition':_0x1512('0xd'),'callback':afterCreateMessage},{'channel':_0x1512('0xe'),'model':'SmsInteraction','event':_0x1512('0x7'),'condition':_0x1512('0x8'),'callback':afterCreate},{'channel':'Sms','model':_0x1512('0xf'),'event':_0x1512('0xa'),'condition':_0x1512('0xb'),'callback':afterUpdate},{'channel':_0x1512('0xe'),'model':'SmsMessage','event':_0x1512('0x7'),'condition':_0x1512('0xd'),'callback':afterCreateMessage},{'channel':_0x1512('0x10'),'model':_0x1512('0x11'),'event':_0x1512('0x7'),'condition':_0x1512('0x8'),'callback':afterCreate},{'channel':_0x1512('0x10'),'model':_0x1512('0x11'),'event':_0x1512('0xa'),'condition':_0x1512('0xb'),'callback':afterUpdate},{'channel':_0x1512('0x10'),'model':_0x1512('0x12'),'event':_0x1512('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x1512('0x13'),'model':_0x1512('0x14'),'event':_0x1512('0x7'),'condition':_0x1512('0x8'),'callback':afterCreate},{'channel':_0x1512('0x13'),'model':_0x1512('0x14'),'event':_0x1512('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1512('0x13'),'model':_0x1512('0x15'),'event':_0x1512('0x7'),'condition':_0x1512('0xd'),'callback':afterCreateMessage},{'channel':_0x1512('0x16'),'model':_0x1512('0x17'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Mail','model':'MailInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x1512('0x16'),'model':_0x1512('0x18'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x1512('0x19'),'model':_0x1512('0x1a'),'event':_0x1512('0x7'),'condition':_0x1512('0x8'),'callback':afterCreate},{'channel':_0x1512('0x19'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x1512('0xb'),'callback':afterUpdate},{'channel':_0x1512('0x19'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0x1512('0xd'),'callback':afterCreateMessage}];function request(_0x5dbd86){return client[_0x1512('0x1b')](_0x1512('0x1c'),_0x5dbd86)[_0x1512('0x1d')](function(_0xa3c2cc){logger[_0x1512('0x1e')]('Trigger,\x20%s',_0x1512('0x1c'),_0xa3c2cc);if(_0xa3c2cc[_0x1512('0x1f')]){if(_0xa3c2cc[_0x1512('0x1f')][_0x1512('0x20')]===0x1f4){logger[_0x1512('0x1f')](_0x1512('0x21'),'EventManager',_0xa3c2cc[_0x1512('0x1f')]);}}})[_0x1512('0x22')](function(_0x4050b5){logger['error']('Trigger,\x20%s',_0x1512('0x1c'),_0x4050b5);});}function afterCreateMessage(_0x55f208,_0x54ac91){return function(_0x856917,_0x5b8166){_0x856917=_0x856917[_0x1512('0x23')]({'plain':!![]});_0x856917['channel']=_0x55f208;_0x856917[_0x1512('0x24')]=_0x856917[_0x1512('0x25')];if(_0x856917[_0x1512('0x26')]){return db[_0x1512('0x27')][_0x1512('0x28')]({'where':{'id':_0x856917[_0x1512('0x26')]},'attributes':['id',_0x1512('0x29')],'raw':!![]})[_0x1512('0x1d')](function(_0x39e616){_0x856917['interface']=util[_0x1512('0x2a')](_0x1512('0x2b'),_0x39e616[_0x1512('0x29')]);_0x856917['channel']=_0x55f208;return request({'event':_0x1512('0x2c'),'message':_0x856917});})[_0x1512('0x22')](function(_0x5640a6){console[_0x1512('0x1f')](_0x5640a6);});}else{return request({'event':_0x1512('0x2d'),'message':_0x856917});}};}function afterCreate(_0x3ab71a,_0x2ac5ee){return function(_0x337437,_0x5c0c39){_0x337437=_0x337437[_0x1512('0x23')]({'plain':!![]});_0x337437['channel']=_0x3ab71a;_0x337437[_0x1512('0x24')]=_0x1512('0x2e');return request({'event':_0x2ac5ee,'message':_0x337437});};}function afterUpdate(_0x3ffa0f,_0x1f85f0){return function(_0x14e8d2,_0x4bb80b){if(_0x14e8d2[_0x1512('0x2f')](_0x1512('0x30'))&&_0x14e8d2[_0x1512('0x30')]){_0x14e8d2=_0x14e8d2['get']({'plain':!![]});_0x14e8d2[_0x1512('0x31')]=_0x3ffa0f;_0x14e8d2[_0x1512('0x24')]=_0x1512('0x30');if(_0x14e8d2[_0x1512('0x26')]){return db['User']['find']({'where':{'id':_0x14e8d2['UserId']},'attributes':['id','name'],'raw':!![]})[_0x1512('0x1d')](function(_0xcbf3e9){_0x14e8d2['interface']=util[_0x1512('0x2a')](_0x1512('0x2b'),_0xcbf3e9['name']);return request({'event':_0x1f85f0,'message':_0x14e8d2});})[_0x1512('0x22')](function(_0x314ecc){console[_0x1512('0x1f')](_0x314ecc);});}else{return request({'event':_0x1f85f0,'message':_0x14e8d2});}}};}exports[_0x1512('0x32')]=function(){for(var _0x18bae5=0x0;_0x18bae5<triggers[_0x1512('0x33')];_0x18bae5+=0x1){if(db[_0x1512('0x34')](triggers[_0x18bae5]['model'])){db[triggers[_0x18bae5]['model']][_0x1512('0x35')](triggers[_0x18bae5][_0x1512('0x24')],triggers[_0x18bae5][_0x1512('0x36')](triggers[_0x18bae5][_0x1512('0x31')][_0x1512('0x37')](),triggers[_0x18bae5][_0x1512('0x38')]));}}};
\ No newline at end of file
index 0cadda2..cd9dd54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eaf=['../mysqldb','./license/util','voice','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','updateAttributes','role','agent','User','getLicense','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash'];(function(_0x1ea08c,_0x1f3243){var _0x51bfca=function(_0x477561){while(--_0x477561){_0x1ea08c['push'](_0x1ea08c['shift']());}};_0x51bfca(++_0x1f3243);}(_0x1eaf,0x113));var _0xf1ea=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1eaf[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xf1ea('0x0'));var BPromise=require('bluebird');var db=require(_0xf1ea('0x1'))['db'];var util=require(_0xf1ea('0x2'));var channels=[_0xf1ea('0x3'),'mail','chat',_0xf1ea('0x4'),_0xf1ea('0x5'),_0xf1ea('0x6'),_0xf1ea('0x7')];exports[_0xf1ea('0x8')]=function(){return channels;};exports[_0xf1ea('0x9')]=function(_0x31d0b9){_0x31d0b9=_0x31d0b9[_0xf1ea('0xa')]();return _[_0xf1ea('0xb')](channels,_0x31d0b9);};exports[_0xf1ea('0xc')]=function(_0x5b9bda,_0x22176d,_0xf69c76,_0x1608fe){var _0x2dd3bd={'loginAttempts':_0x22176d,'blocked':_0xf69c76};if(!_[_0xf1ea('0xd')](_0x1608fe)){_0x2dd3bd['blockedAt']=_0x1608fe;}return _0x5b9bda[_0xf1ea('0xe')](_0x2dd3bd);};exports['getLicense']=function(_0x183087){return new BPromise(function(_0xdfb536,_0x1f3120){var _0x456d59=0x0;if(_0x183087[_0xf1ea('0xf')]!==_0xf1ea('0x10')){_0xdfb536(_0x183087);}db[_0xf1ea('0x11')]['count']({'where':{'role':_0xf1ea('0x10'),'online':!![],'id':{'$ne':_0x183087['id']}}})['then'](function(_0x1174fd){_0x456d59=_0x1174fd;return util[_0xf1ea('0x12')]();})[_0xf1ea('0x13')](function(_0x577c4d){if(_0x577c4d&&_0x577c4d['agents']&&_0x456d59>=_0x577c4d[_0xf1ea('0x14')]){throw Error(_0xf1ea('0x15'));}_0xdfb536(_0x183087);})[_0xf1ea('0x16')](function(_0x306764){_0x1f3120(_0x306764);});});};
\ No newline at end of file
+var _0x9ddb=['bluebird','./license/util','voice','mail','chat','sms','getChannels','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch'];(function(_0x442ab1,_0x379fa4){var _0x1f10a1=function(_0x29b4f9){while(--_0x29b4f9){_0x442ab1['push'](_0x442ab1['shift']());}};_0x1f10a1(++_0x379fa4);}(_0x9ddb,0x1b8));var _0xb9dd=function(_0x22d79e,_0x50587c){_0x22d79e=_0x22d79e-0x0;var _0x53acff=_0x9ddb[_0x22d79e];return _0x53acff;};'use strict';var _=require('lodash');var BPromise=require(_0xb9dd('0x0'));var db=require('../mysqldb')['db'];var util=require(_0xb9dd('0x1'));var channels=[_0xb9dd('0x2'),_0xb9dd('0x3'),_0xb9dd('0x4'),'fax',_0xb9dd('0x5'),'whatsapp','openchannel'];exports[_0xb9dd('0x6')]=function(){return channels;};exports['isValidChannel']=function(_0xcd94d3){_0xcd94d3=_0xcd94d3['toLowerCase']();return _[_0xb9dd('0x7')](channels,_0xcd94d3);};exports[_0xb9dd('0x8')]=function(_0x12c7e5,_0x217069,_0x13b4a7,_0x493f65){var _0x14a9df={'loginAttempts':_0x217069,'blocked':_0x13b4a7};if(!_[_0xb9dd('0x9')](_0x493f65)){_0x14a9df[_0xb9dd('0xa')]=_0x493f65;}return _0x12c7e5[_0xb9dd('0xb')](_0x14a9df);};exports[_0xb9dd('0xc')]=function(_0x31c8fa){return new BPromise(function(_0x1c2ce3,_0x445503){var _0x3adcab=0x0;if(_0x31c8fa['role']!==_0xb9dd('0xd')){_0x1c2ce3(_0x31c8fa);}db[_0xb9dd('0xe')][_0xb9dd('0xf')]({'where':{'role':_0xb9dd('0xd'),'online':!![],'id':{'$ne':_0x31c8fa['id']}}})[_0xb9dd('0x10')](function(_0x15a00e){_0x3adcab=_0x15a00e;return util[_0xb9dd('0xc')]();})['then'](function(_0x2c718e){if(_0x2c718e&&_0x2c718e[_0xb9dd('0x11')]&&_0x3adcab>=_0x2c718e['agents']){throw Error(_0xb9dd('0x12'));}_0x1c2ce3(_0x31c8fa);})[_0xb9dd('0x13')](function(_0x796725){_0x445503(_0x796725);});});};
\ No newline at end of file
index 668ccda..9a19066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7033=['json','send','404','status','render'];(function(_0x3e5bd7,_0x22ace9){var _0x1c8458=function(_0x2ab914){while(--_0x2ab914){_0x3e5bd7['push'](_0x3e5bd7['shift']());}};_0x1c8458(++_0x22ace9);}(_0x7033,0x1ba));var _0x3703=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7033[_0x199572];return _0x13cfa3;};'use strict';module['exports'][0x194]=function pageNotFound(_0x20e2c7,_0x11715f){var _0x3bc325=_0x3703('0x0');var _0x15c69c=0x194;var _0x29c817={'status':_0x15c69c};_0x11715f[_0x3703('0x1')](_0x29c817['status']);_0x11715f[_0x3703('0x2')](_0x3bc325,{},function(_0x9c5ad1,_0x32f70e){if(_0x9c5ad1){return _0x11715f['status'](_0x29c817['status'])[_0x3703('0x3')](_0x29c817);}_0x11715f[_0x3703('0x4')](_0x32f70e);});};
\ No newline at end of file
+var _0x0f21=['send','exports','404','status'];(function(_0x111e51,_0x586666){var _0x51f35c=function(_0x3b29ae){while(--_0x3b29ae){_0x111e51['push'](_0x111e51['shift']());}};_0x51f35c(++_0x586666);}(_0x0f21,0x185));var _0x10f2=function(_0xb4b557,_0x3c7c8b){_0xb4b557=_0xb4b557-0x0;var _0x21068c=_0x0f21[_0xb4b557];return _0x21068c;};'use strict';module[_0x10f2('0x0')][0x194]=function pageNotFound(_0x4eb2af,_0x40d52b){var _0x118ddf=_0x10f2('0x1');var _0x394067=0x194;var _0x26e68f={'status':_0x394067};_0x40d52b[_0x10f2('0x2')](_0x26e68f[_0x10f2('0x2')]);_0x40d52b['render'](_0x118ddf,{},function(_0x4ef0d9,_0x15dd8b){if(_0x4ef0d9){return _0x40d52b[_0x10f2('0x2')](_0x26e68f['status'])['json'](_0x26e68f);}_0x40d52b[_0x10f2('0x3')](_0x15dd8b);});};
\ No newline at end of file
index 3d1fca3..d46a104 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fc5=['SmsAccounts','user_has_sms_accounts','WhatsappAccount','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','moh_has_sounds','VoiceQueue','Members','CmHopper','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Imap','Smtp','Dispositions','Interactions','MailApplication','List','Template','TemplateId','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Interaction','restrict','ListId','FaxAccountId','Answers','Exntensions','TagId','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','Agent','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatInternalMessage','ChatGroupId','ChatProactiveAction','CompanyId','cm_contact_has_tags','Queue','Campaign','OwnerId','CampaignId','All','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','VoiceMusicOnHold','Mohs','whatsapp_interaction_has_tags','AllConditions','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','AnalyticFieldReport','MetricId','SalesforceAccount','SalesforceConfiguration','AccountId','Subjects','Descriptions','DescriptionId','Subject','SubjectId','Description','Field','VariableId','SugarcrmConfiguration','FieldId','Configurations','DeskField','int_desk_configuration_has_tags','ZohoField','ZendeskField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowField','FreshsalesConfiguration','FreshsalesField','FromId','SessionId','JscriptyProject','ProjectId','MailQueues','team_has_fax_queues','team_has_whatsapp_queues','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAccount','FromAgent','ToUserId','ToChatQueueId','FaxTransferReport','ToFaxQueueId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','CustomFields','Queues','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','name','utf8_general_ci','sequelizeHistory','utf8','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','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','../api/pause/pause.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','FreshdeskField','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','Notification','../api/notification/notification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','FaxInteractions','WhatsappInteractions','Notifications','SenderId','belongsTo','belongsToMany','ChatGroup','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','MailInteractions','user_has_mail_interactions','FaxInteraction','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fc5,0xb6));var _0x59fc=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0x9fc5[_0x2cc8bb];return _0x140e40;};'use strict';var path=require('path');var config=require(_0x59fc('0x0'));var Sequelize=require(_0x59fc('0x1'));var _=require('lodash');var jstz=require(_0x59fc('0x2'));var timezone=jstz[_0x59fc('0x3')]();config[_0x59fc('0x1')]=_[_0x59fc('0x4')](config[_0x59fc('0x1')],{'database':_0x59fc('0x5'),'username':_0x59fc('0x6'),'password':_0x59fc('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x59fc('0x8'),'dialectOptions':{'charset':_0x59fc('0x9')},'logging':![],'timezone':timezone[_0x59fc('0xa')](),'define':{'charset':'utf8','collate':_0x59fc('0xb')}}});config[_0x59fc('0xc')]=_[_0x59fc('0x4')](config[_0x59fc('0xc')],{'database':_0x59fc('0x5'),'username':_0x59fc('0x6'),'password':_0x59fc('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x59fc('0x8'),'dialectOptions':{'charset':_0x59fc('0x9')},'logging':![],'timezone':timezone[_0x59fc('0xa')](),'define':{'charset':_0x59fc('0xd'),'collate':_0x59fc('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x59fc('0x1')][_0x59fc('0xe')],config['sequelize'][_0x59fc('0xf')],config[_0x59fc('0x1')][_0x59fc('0x10')],config[_0x59fc('0x1')][_0x59fc('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x59fc('0xc')][_0x59fc('0xe')],config[_0x59fc('0xc')][_0x59fc('0xf')],config[_0x59fc('0xc')][_0x59fc('0x10')],config['sequelizeHistory'][_0x59fc('0x11')])};db[_0x59fc('0x12')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x14'));db[_0x59fc('0x15')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x59fc('0x16')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x17'));db[_0x59fc('0x18')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x19'));db['VoiceMusicOnHold']=db[_0x59fc('0x1')]['import'](_0x59fc('0x1a'));db['VoiceQueue']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x1b'));db[_0x59fc('0x1c')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x59fc('0x1d')]=db[_0x59fc('0x1')]['import']('../api/screenRecording/screenRecording.model');db[_0x59fc('0x1e')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x1f'));db[_0x59fc('0x20')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x21'));db[_0x59fc('0x22')]=db['sequelize'][_0x59fc('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0x59fc('0x23')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x24'));db['VoiceAgentReport']=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x59fc('0x25')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x26'));db[_0x59fc('0x27')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x28'));db[_0x59fc('0x29')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x2a'));db[_0x59fc('0x2b')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x2c'));db[_0x59fc('0x2d')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x2e'));db[_0x59fc('0x2f')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x30'));db['UserChatQueue']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x31'));db['UserMailQueue']=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x32'));db[_0x59fc('0x33')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x34'));db[_0x59fc('0x35')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x36'));db[_0x59fc('0x37')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x38'));db[_0x59fc('0x39')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x59fc('0x3a')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db['sequelize']['import'](_0x59fc('0x3b'));db[_0x59fc('0x3c')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x3d'));db[_0x59fc('0x3e')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x3f'));db['MailSubstatus']=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x40'));db[_0x59fc('0x41')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x42'));db[_0x59fc('0x43')]=db['sequelize']['import'](_0x59fc('0x44'));db['MailApplication']=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x45'));db[_0x59fc('0x46')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x47'));db[_0x59fc('0x48')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x49'));db[_0x59fc('0x4a')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x4b'));db['FaxAccount']=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/faxAccount/faxAccount.model');db[_0x59fc('0x4c')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x4d'));db['FaxInteraction']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x4e'));db[_0x59fc('0x4f')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x50'));db[_0x59fc('0x51')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x52'));db[_0x59fc('0x53')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x54'));db[_0x59fc('0x55')]=db['sequelize'][_0x59fc('0x13')]('../api/smsAccount/smsAccount.model');db[_0x59fc('0x56')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x57'));db[_0x59fc('0x58')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x59'));db[_0x59fc('0x5a')]=db['sequelize'][_0x59fc('0x13')]('../api/smsMessage/smsMessage.model');db[_0x59fc('0x5b')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x5c'));db[_0x59fc('0x5d')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x5e'));db[_0x59fc('0x5f')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x60'));db['OpenchannelInteraction']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x61'));db[_0x59fc('0x62')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x63'));db['OpenchannelQueue']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x64'));db[_0x59fc('0x65')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x66'));db[_0x59fc('0x67')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x68'));db[_0x59fc('0x69')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/chatApplication/chatApplication.model');db[_0x59fc('0x6a')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x6b'));db[_0x59fc('0x6c')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x6d'));db[_0x59fc('0x6e')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x59fc('0x6f')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x70'));db['ChatGroup']=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x71'));db['ChatProactiveAction']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x72'));db[_0x59fc('0x73')]=db['sequelize'][_0x59fc('0x13')]('../api/cmCompany/cmCompany.model');db[_0x59fc('0x74')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x75'));db['CmHopper']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x76'));db[_0x59fc('0x77')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x78'));db[_0x59fc('0x79')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x7a'));db[_0x59fc('0x7b')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x7c'));db[_0x59fc('0x7d')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x7e'));db[_0x59fc('0x7f')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/cmCustomField/cmCustomField.model');db[_0x59fc('0x80')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x81'));db[_0x59fc('0x82')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x83'));db[_0x59fc('0x84')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x85'));db[_0x59fc('0x86')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x87'));db[_0x59fc('0x88')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x89'));db[_0x59fc('0x8a')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x8b'));db[_0x59fc('0x8c')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x8d'));db['Cdr']=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/cdr/cdr.model');db[_0x59fc('0x8e')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x8f'));db[_0x59fc('0x90')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x91'));db[_0x59fc('0x92')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x93'));db[_0x59fc('0x94')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x95'));db['Template']=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/template/template.model');db[_0x59fc('0x96')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x97'));db[_0x59fc('0x98')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x99'));db[_0x59fc('0x9a')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x9b'));db['IntegrationReport']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x9c'));db['AnalyticCustomReport']=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x59fc('0x9d')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x9e'));db[_0x59fc('0x9f')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xa0'));db[_0x59fc('0xa1')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xa2'));db['AnalyticFieldReport']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xa3'));db[_0x59fc('0xa4')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xa5'));db['SalesforceAccount']=db['sequelize']['import'](_0x59fc('0xa6'));db['SalesforceConfiguration']=db[_0x59fc('0x1')]['import'](_0x59fc('0xa7'));db[_0x59fc('0xa8')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xa9'));db[_0x59fc('0xaa')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xab'));db['SugarcrmConfiguration']=db['sequelize']['import'](_0x59fc('0xac'));db[_0x59fc('0xad')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xae'));db[_0x59fc('0xaf')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xb0'));db[_0x59fc('0xb1')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xb2'));db['DeskField']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xb3'));db[_0x59fc('0xb4')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xb5'));db[_0x59fc('0xb6')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xb7'));db[_0x59fc('0xb8')]=db[_0x59fc('0x1')]['import'](_0x59fc('0xb9'));db[_0x59fc('0xba')]=db[_0x59fc('0x1')]['import'](_0x59fc('0xbb'));db['ZendeskField']=db['sequelize']['import'](_0x59fc('0xbc'));db[_0x59fc('0xbd')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x59fc('0xbe')]=db[_0x59fc('0x1')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x59fc('0xbf')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db['sequelize'][_0x59fc('0x13')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x59fc('0xc0')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xc1'));db[_0x59fc('0xc2')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xc3'));db[_0x59fc('0xc4')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xc5'));db[_0x59fc('0xc6')]=db[_0x59fc('0x1')]['import'](_0x59fc('0xc7'));db['ServicenowField']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xc8'));db[_0x59fc('0xc9')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xca'));db[_0x59fc('0xcb')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xcc'));db[_0x59fc('0xcd')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x59fc('0xce')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xcf'));db['FreshsalesConfiguration']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xd0'));db['FreshsalesField']=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xd1'));db['Integration']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x9b'));db[_0x59fc('0xd2')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xd3'));db[_0x59fc('0xd4')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xd5'));db['ChatInternalMessage']=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x59fc('0xd6')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xd7'));db[_0x59fc('0xd8')]=db[_0x59fc('0x1')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x59fc('0xd9')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xda'));db[_0x59fc('0xdb')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xdc'));db[_0x59fc('0xdd')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xde'));db[_0x59fc('0xdf')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xe0'));db['JscriptyProject']=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xe1'));db[_0x59fc('0xe2')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xe3'));db[_0x59fc('0xe4')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xe5'));db[_0x59fc('0xe6')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xe7'));db[_0x59fc('0xe8')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xe9'));db['Team']=db['sequelize']['import'](_0x59fc('0xea'));db[_0x59fc('0xeb')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/license/license.model');db['Campaign']=db['sequelize']['import'](_0x59fc('0xec'));db[_0x59fc('0xed')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xee'));db['Attachment']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xef'));db['Plugin']=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xf0'));db[_0x59fc('0xf1')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xf2'));db[_0x59fc('0xf3')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xf4'));db['FaxTransferReport']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xf5'));db['OpenchannelTransferReport']=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x59fc('0xf6')]=db[_0x59fc('0x1')]['import']('../api/smsTransferReport/smsTransferReport.model');db[_0x59fc('0xf7')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0xf8'));db[_0x59fc('0xf9')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xfa'));db[_0x59fc('0xfb')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xfc'));db[_0x59fc('0xfd')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0xfe'));db[_0x59fc('0xff')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x100'));db[_0x59fc('0x101')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x102'));db['WhatsappAccount']=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x103'));db[_0x59fc('0x104')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0x59fc('0x105')]=db[_0x59fc('0x1')]['import'](_0x59fc('0x106'));db[_0x59fc('0x107')]=db[_0x59fc('0x1')][_0x59fc('0x13')]('../api/whatsappMessage/whatsappMessage.model');db[_0x59fc('0x108')]=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x109'));db['WhatsappTransferReport']=db['sequelize'][_0x59fc('0x13')](_0x59fc('0x10a'));db[_0x59fc('0x10b')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x10c'));db[_0x59fc('0x10d')]=db[_0x59fc('0x1')][_0x59fc('0x13')](_0x59fc('0x10e'));db[_0x59fc('0x12')][_0x59fc('0x10f')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x111')});db[_0x59fc('0x12')][_0x59fc('0x112')](db[_0x59fc('0x1c')],{'as':_0x59fc('0x113'),'foreignKey':_0x59fc('0x111')});db['User'][_0x59fc('0x112')](db[_0x59fc('0x2d')],{'as':_0x59fc('0x114'),'foreignKey':_0x59fc('0x111')});db['User'][_0x59fc('0x112')](db[_0x59fc('0x18')],{'as':_0x59fc('0x115'),'onDelete':'cascade','hooks':!![]});db[_0x59fc('0x12')][_0x59fc('0x112')](db[_0x59fc('0x79')],{'as':_0x59fc('0x116'),'foreignKey':'UserId'});db['User'][_0x59fc('0x112')](db[_0x59fc('0x7b')],{'as':_0x59fc('0x117'),'foreignKey':_0x59fc('0x111')});db['User'][_0x59fc('0x112')](db[_0x59fc('0x7d')],{'as':_0x59fc('0x7d'),'foreignKey':_0x59fc('0x111')});db[_0x59fc('0x12')][_0x59fc('0x112')](db[_0x59fc('0x118')],{'as':_0x59fc('0x119'),'foreignKey':_0x59fc('0x111')});db[_0x59fc('0x12')]['hasMany'](db[_0x59fc('0x6a')],{'as':_0x59fc('0x11a'),'foreignKey':_0x59fc('0x111')});db[_0x59fc('0x12')]['hasMany'](db[_0x59fc('0x58')],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0x59fc('0x12')][_0x59fc('0x112')](db['FaxInteraction'],{'as':_0x59fc('0x11b'),'foreignKey':_0x59fc('0x111')});db[_0x59fc('0x12')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x59fc('0x111')});db['User'][_0x59fc('0x112')](db[_0x59fc('0x105')],{'as':_0x59fc('0x11c'),'foreignKey':_0x59fc('0x111')});db[_0x59fc('0x12')][_0x59fc('0x112')](db['Notification'],{'as':_0x59fc('0x11d'),'foreignKey':_0x59fc('0x11e')});db[_0x59fc('0x12')][_0x59fc('0x11f')](db[_0x59fc('0xfb')],{'as':_0x59fc('0xfb'),'foreignKey':'userProfileId'});db[_0x59fc('0x12')][_0x59fc('0x120')](db[_0x59fc('0x121')],{'as':_0x59fc('0x122'),'through':_0x59fc('0x123')});db[_0x59fc('0x12')]['belongsToMany'](db[_0x59fc('0x74')],{'as':_0x59fc('0x124'),'through':_0x59fc('0x125')});db['User'][_0x59fc('0x120')](db[_0x59fc('0xf7')],{'as':_0x59fc('0x126'),'through':_0x59fc('0x127')});db[_0x59fc('0x12')][_0x59fc('0x120')](db[_0x59fc('0x128')],{'through':_0x59fc('0x129')});db['User'][_0x59fc('0x120')](db['MailInteraction'],{'as':_0x59fc('0x12a'),'through':_0x59fc('0x12b')});db['User']['belongsToMany'](db[_0x59fc('0x6a')],{'as':_0x59fc('0x11a'),'through':'user_has_chat_interactions'});db[_0x59fc('0x12')][_0x59fc('0x120')](db[_0x59fc('0x12c')],{'as':_0x59fc('0x11b'),'through':'user_has_fax_interactions'});db['User'][_0x59fc('0x120')](db[_0x59fc('0x58')],{'as':_0x59fc('0x12d'),'through':_0x59fc('0x12e')});db[_0x59fc('0x12')][_0x59fc('0x120')](db['OpenchannelInteraction'],{'as':_0x59fc('0x119'),'through':_0x59fc('0x12f')});db[_0x59fc('0x12')][_0x59fc('0x120')](db[_0x59fc('0x105')],{'as':_0x59fc('0x11c'),'through':_0x59fc('0x130')});db[_0x59fc('0x12')][_0x59fc('0x120')](db['VoiceQueue'],{'as':_0x59fc('0x131'),'through':_0x59fc('0x2f'),'required':![]});db[_0x59fc('0x12')]['belongsToMany'](db[_0x59fc('0x3e')],{'as':'MailQueues','through':_0x59fc('0x132'),'required':![]});db[_0x59fc('0x12')]['belongsToMany'](db['ChatQueue'],{'as':_0x59fc('0x133'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x59fc('0x12')][_0x59fc('0x120')](db[_0x59fc('0x51')],{'as':_0x59fc('0x134'),'through':_0x59fc('0x33'),'required':![]});db[_0x59fc('0x12')][_0x59fc('0x120')](db[_0x59fc('0x5b')],{'as':_0x59fc('0x135'),'through':_0x59fc('0x35'),'required':![]});db['User'][_0x59fc('0x120')](db[_0x59fc('0x136')],{'as':_0x59fc('0x137'),'through':_0x59fc('0x37'),'required':![]});db['User'][_0x59fc('0x120')](db[_0x59fc('0x10b')],{'as':_0x59fc('0x138'),'through':'UserWhatsappQueue','required':![]});db[_0x59fc('0x12')]['belongsToMany'](db[_0x59fc('0xf7')],{'through':_0x59fc('0x127')});db[_0x59fc('0x12')][_0x59fc('0x120')](db[_0x59fc('0xf9')],{'as':_0x59fc('0x139'),'through':_0x59fc('0x13a'),'required':![]});db[_0x59fc('0x12')][_0x59fc('0x120')](db['ChatWebsite'],{'as':_0x59fc('0x13b'),'through':_0x59fc('0x13c')});db[_0x59fc('0x12')][_0x59fc('0x120')](db[_0x59fc('0x13d')],{'as':_0x59fc('0x13e'),'through':_0x59fc('0x13f')});db[_0x59fc('0x12')]['belongsToMany'](db[_0x59fc('0x3c')],{'as':_0x59fc('0x140'),'through':_0x59fc('0x141')});db[_0x59fc('0x12')][_0x59fc('0x120')](db[_0x59fc('0x5d')],{'as':_0x59fc('0x142'),'through':'user_has_openchannel_accounts'});db['User'][_0x59fc('0x120')](db[_0x59fc('0x55')],{'as':_0x59fc('0x143'),'through':_0x59fc('0x144')});db['User']['belongsToMany'](db[_0x59fc('0x145')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x59fc('0x12')][_0x59fc('0x120')](db[_0x59fc('0xe4')],{'as':_0x59fc('0x146'),'through':_0x59fc('0x147')});db[_0x59fc('0x15')][_0x59fc('0x112')](db[_0x59fc('0x18')],{'as':_0x59fc('0x148'),'onDelete':'cascade','foreignKey':_0x59fc('0x149')});db['VoiceContext'][_0x59fc('0x112')](db[_0x59fc('0x18')],{'onDelete':_0x59fc('0x110')});db[_0x59fc('0x18')][_0x59fc('0x112')](db[_0x59fc('0x18')],{'as':_0x59fc('0x14a'),'onDelete':_0x59fc('0x110')});db['VoiceMusicOnHold']['belongsToMany'](db[_0x59fc('0x92')],{'as':'Sounds','through':_0x59fc('0x14b')});db[_0x59fc('0x14c')][_0x59fc('0x112')](db[_0x59fc('0x2d')],{'as':_0x59fc('0x14d'),'foreignKey':'VoiceQueueId'});db[_0x59fc('0x14c')][_0x59fc('0x112')](db[_0x59fc('0x14e')],{'as':_0x59fc('0x14f'),'foreignKey':_0x59fc('0x150')});db[_0x59fc('0x14c')][_0x59fc('0x112')](db[_0x59fc('0x79')],{'as':_0x59fc('0x116'),'foreignKey':_0x59fc('0x150')});db[_0x59fc('0x14c')][_0x59fc('0x112')](db[_0x59fc('0x7b')],{'as':_0x59fc('0x151'),'foreignKey':_0x59fc('0x150')});db['VoiceQueue']['hasMany'](db[_0x59fc('0x7d')],{'as':_0x59fc('0x7d'),'foreignKey':'VoiceQueueId'});db[_0x59fc('0x14c')][_0x59fc('0x112')](db[_0x59fc('0x77')],{'as':_0x59fc('0x152'),'foreignKey':_0x59fc('0x150')});db[_0x59fc('0x14c')][_0x59fc('0x112')](db[_0x59fc('0xd9')],{'as':_0x59fc('0x153'),'foreignKey':_0x59fc('0x150')});db['VoiceQueue'][_0x59fc('0x11f')](db['Trunk'],{'as':_0x59fc('0x29'),'foreignKey':_0x59fc('0x154')});db[_0x59fc('0x14c')]['belongsTo'](db[_0x59fc('0x29')],{'as':_0x59fc('0x155'),'foreignKey':_0x59fc('0x156')});db[_0x59fc('0x14c')]['belongsTo'](db[_0x59fc('0x8a')],{'as':_0x59fc('0x8a'),'foreignKey':_0x59fc('0x157')});db[_0x59fc('0x14c')][_0x59fc('0x11f')](db[_0x59fc('0x8c')],{'as':'mandatoryDispositionPause','foreignKey':_0x59fc('0x158')});db[_0x59fc('0x14c')][_0x59fc('0x120')](db['CmList'],{'as':'Lists','through':_0x59fc('0x159')});db[_0x59fc('0x14c')][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x15a'),'through':_0x59fc('0x2f')});db['VoiceQueue'][_0x59fc('0x120')](db[_0x59fc('0x128')],{'as':_0x59fc('0x15b'),'through':_0x59fc('0x15c')});db[_0x59fc('0x14c')]['belongsToMany'](db[_0x59fc('0xf7')],{'as':_0x59fc('0x15d'),'through':_0x59fc('0x15e')});db['VoiceRecording'][_0x59fc('0x11f')](db['User'],{'as':_0x59fc('0x12'),'foreignKey':_0x59fc('0x111')});db[_0x59fc('0x1d')]['belongsTo'](db['User'],{'as':'User','foreignKey':_0x59fc('0x111')});db[_0x59fc('0x1e')][_0x59fc('0x112')](db[_0x59fc('0x20')],{'as':_0x59fc('0x15f'),'onDelete':_0x59fc('0x110'),'foreignKey':'mailboxuser','sourceKey':_0x59fc('0x160')});db[_0x59fc('0x20')]['belongsTo'](db[_0x59fc('0x1e')],{'foreignKey':_0x59fc('0x161'),'targetKey':_0x59fc('0x160')});db[_0x59fc('0x22')][_0x59fc('0x112')](db[_0x59fc('0x25')],{'as':_0x59fc('0x162'),'foreignKey':_0x59fc('0x163'),'constraints':![]});db['VoiceCallReport'][_0x59fc('0x112')](db['VoiceAgentReport'],{'as':_0x59fc('0x164'),'foreignKey':'uniqueid','constraints':![]});db[_0x59fc('0x22')][_0x59fc('0x11f')](db['User'],{'as':_0x59fc('0x12'),'foreignKey':_0x59fc('0x111')});db['VoiceCallReport'][_0x59fc('0x11f')](db[_0x59fc('0x74')],{'as':_0x59fc('0x165'),'foreignKey':_0x59fc('0x166')});db['MailServerIn'][_0x59fc('0x11f')](db['MailAccount'],{'as':_0x59fc('0x3c'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x59fc('0x11f')](db['MailAccount'],{'as':_0x59fc('0x3c'),'foreignKey':_0x59fc('0x167')});db[_0x59fc('0x3c')][_0x59fc('0x10f')](db[_0x59fc('0x3a')],{'as':_0x59fc('0x168'),'onDelete':_0x59fc('0x110')});db['MailAccount'][_0x59fc('0x10f')](db['MailServerOut'],{'as':_0x59fc('0x169'),'onDelete':'cascade'});db[_0x59fc('0x3c')][_0x59fc('0x112')](db[_0x59fc('0x86')],{'as':_0x59fc('0x16a'),'foreignKey':_0x59fc('0x167')});db[_0x59fc('0x3c')][_0x59fc('0x112')](db[_0x59fc('0x84')],{'as':'Answers','foreignKey':_0x59fc('0x167')});db[_0x59fc('0x3c')][_0x59fc('0x112')](db[_0x59fc('0x43')],{'as':_0x59fc('0x15f'),'foreignKey':_0x59fc('0x167')});db[_0x59fc('0x3c')][_0x59fc('0x112')](db[_0x59fc('0x41')],{'as':_0x59fc('0x16b')});db[_0x59fc('0x3c')][_0x59fc('0x112')](db[_0x59fc('0x16c')],{'as':_0x59fc('0x14a')});db[_0x59fc('0x3c')][_0x59fc('0x11f')](db[_0x59fc('0xf7')],{'as':_0x59fc('0x16d'),'foreignKey':'ListId'});db[_0x59fc('0x3c')][_0x59fc('0x11f')](db[_0x59fc('0x16e')],{'as':'Template','foreignKey':_0x59fc('0x16f')});db[_0x59fc('0x3c')][_0x59fc('0x11f')](db[_0x59fc('0x8c')],{'as':_0x59fc('0x170'),'foreignKey':_0x59fc('0x158')});db[_0x59fc('0x3c')][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x15a'),'through':_0x59fc('0x141')});db[_0x59fc('0x3e')][_0x59fc('0x120')](db['User'],{'as':_0x59fc('0x15a'),'through':_0x59fc('0x132')});db[_0x59fc('0x3e')][_0x59fc('0x120')](db[_0x59fc('0x128')],{'through':_0x59fc('0x171'),'as':_0x59fc('0x15b')});db[_0x59fc('0x41')][_0x59fc('0x112')](db[_0x59fc('0x43')],{'as':_0x59fc('0x15f'),'onDelete':'cascade','foreignKey':_0x59fc('0x172')});db['MailInteraction'][_0x59fc('0x11f')](db[_0x59fc('0x3c')],{'as':_0x59fc('0x173'),'foreignKey':_0x59fc('0x167')});db[_0x59fc('0x41')][_0x59fc('0x11f')](db['CmContact'],{'as':_0x59fc('0x165'),'foreignKey':'ContactId'});db['MailInteraction']['belongsTo'](db[_0x59fc('0x12')],{'as':_0x59fc('0x174'),'foreignKey':_0x59fc('0x111')});db[_0x59fc('0x41')]['belongsToMany'](db['Tag'],{'through':_0x59fc('0x175'),'as':_0x59fc('0x176')});db[_0x59fc('0x41')][_0x59fc('0x120')](db['Tag'],{'through':_0x59fc('0x175'),'as':_0x59fc('0x177')});db['MailInteraction'][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x178'),'through':_0x59fc('0x12b'),'foreignKey':'MailInteractionId'});db[_0x59fc('0x43')][_0x59fc('0x112')](db[_0x59fc('0x179')],{'as':'Attachments','onDelete':_0x59fc('0x110')});db[_0x59fc('0x43')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'as':'User'});db[_0x59fc('0x43')][_0x59fc('0x11f')](db['CmContact'],{'onDelete':_0x59fc('0x110'),'as':_0x59fc('0x165')});db[_0x59fc('0x43')][_0x59fc('0x11f')](db[_0x59fc('0x41')],{'as':_0x59fc('0x17a'),'foreignKey':_0x59fc('0x172')});db['MailMessage']['belongsTo'](db[_0x59fc('0x3c')],{'as':_0x59fc('0x173'),'foreignKey':_0x59fc('0x167')});db[_0x59fc('0x16c')]['belongsTo'](db['User'],{'onDelete':_0x59fc('0x17b')});db['MailApplication'][_0x59fc('0x11f')](db[_0x59fc('0x3e')],{'onDelete':_0x59fc('0x17b')});db[_0x59fc('0x16c')][_0x59fc('0x11f')](db[_0x59fc('0x3c')],{'onDelete':_0x59fc('0x17b')});db[_0x59fc('0x16c')][_0x59fc('0x11f')](db[_0x59fc('0x8a')],{'onDelete':_0x59fc('0x17b'),'foreignKey':'IntervalId'});db['MailApplication'][_0x59fc('0x11f')](db['Tag'],{'onDelete':_0x59fc('0x17b'),'foreignKey':'TagId'});db[_0x59fc('0x46')]['belongsTo'](db[_0x59fc('0x3c')],{});db[_0x59fc('0x46')][_0x59fc('0x11f')](db[_0x59fc('0xf7')],{'as':_0x59fc('0x16d'),'foreignKey':_0x59fc('0x17c')});db[_0x59fc('0x46')][_0x59fc('0x11f')](db[_0x59fc('0x74')],{'as':_0x59fc('0x165'),'foreignKey':_0x59fc('0x166')});db[_0x59fc('0x46')][_0x59fc('0x11f')](db['MailInteraction'],{});db[_0x59fc('0x46')][_0x59fc('0x11f')](db[_0x59fc('0x43')],{});db[_0x59fc('0x46')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{});db['MailQueueReport'][_0x59fc('0x11f')](db['MailQueue'],{});db['Dashboard'][_0x59fc('0x112')](db[_0x59fc('0x4a')],{'as':'Items','onDelete':'cascade'});db[_0x59fc('0x13d')][_0x59fc('0x112')](db['Disposition'],{'as':_0x59fc('0x16a'),'foreignKey':_0x59fc('0x17d')});db[_0x59fc('0x13d')][_0x59fc('0x112')](db[_0x59fc('0x84')],{'as':_0x59fc('0x17e'),'foreignKey':'FaxAccountId'});db[_0x59fc('0x13d')][_0x59fc('0x112')](db[_0x59fc('0x12c')],{'as':_0x59fc('0x16b')});db['FaxAccount'][_0x59fc('0x112')](db[_0x59fc('0x4c')],{'as':_0x59fc('0x14a')});db[_0x59fc('0x13d')]['hasMany'](db[_0x59fc('0x18')],{'as':_0x59fc('0x17f'),'onDelete':_0x59fc('0x110')});db['FaxAccount'][_0x59fc('0x112')](db['FaxMessage'],{'as':'Messages'});db[_0x59fc('0x13d')]['belongsTo'](db[_0x59fc('0x29')],{'as':'Trunk'});db['FaxAccount'][_0x59fc('0x11f')](db[_0x59fc('0xf7')],{'as':_0x59fc('0x16d'),'foreignKey':_0x59fc('0x17c')});db[_0x59fc('0x13d')][_0x59fc('0x11f')](db[_0x59fc('0x8c')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount']['belongsToMany'](db[_0x59fc('0x12')],{'as':'Agents','through':_0x59fc('0x13f')});db[_0x59fc('0x4c')]['belongsTo'](db[_0x59fc('0x12')],{'onDelete':_0x59fc('0x17b')});db['FaxApplication'][_0x59fc('0x11f')](db[_0x59fc('0x51')],{'onDelete':_0x59fc('0x17b')});db['FaxApplication']['belongsTo'](db[_0x59fc('0x13d')],{'onDelete':_0x59fc('0x17b')});db['FaxApplication'][_0x59fc('0x11f')](db['Tag'],{'onDelete':_0x59fc('0x17b'),'foreignKey':_0x59fc('0x180')});db['FaxInteraction'][_0x59fc('0x112')](db['FaxMessage'],{'as':_0x59fc('0x15f'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x181')});db[_0x59fc('0x12c')][_0x59fc('0x11f')](db[_0x59fc('0x13d')],{'as':_0x59fc('0x173'),'foreignKey':'FaxAccountId'});db[_0x59fc('0x12c')][_0x59fc('0x11f')](db['CmContact'],{'as':_0x59fc('0x165'),'foreignKey':_0x59fc('0x166')});db['FaxInteraction']['belongsTo'](db[_0x59fc('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0x59fc('0x12c')][_0x59fc('0x120')](db[_0x59fc('0x94')],{'through':_0x59fc('0x182'),'as':_0x59fc('0x176')});db[_0x59fc('0x12c')][_0x59fc('0x120')](db[_0x59fc('0x94')],{'through':_0x59fc('0x182'),'as':'ThroughTags'});db[_0x59fc('0x12c')][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x178'),'through':_0x59fc('0x183'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'onDelete':_0x59fc('0x110'),'as':_0x59fc('0x12')});db[_0x59fc('0x4f')][_0x59fc('0x11f')](db['FaxInteraction'],{'as':_0x59fc('0x17a'),'foreignKey':_0x59fc('0x181')});db[_0x59fc('0x4f')]['belongsTo'](db[_0x59fc('0x74')],{'onDelete':_0x59fc('0x110'),'as':_0x59fc('0x165')});db['FaxMessage'][_0x59fc('0x11f')](db[_0x59fc('0x179')],{'as':_0x59fc('0x179'),'foreignKey':_0x59fc('0x184')});db[_0x59fc('0x4f')][_0x59fc('0x11f')](db['FaxAccount'],{'as':_0x59fc('0x173'),'foreignKey':_0x59fc('0x17d')});db[_0x59fc('0x51')][_0x59fc('0x120')](db['User'],{'as':_0x59fc('0x15a'),'through':_0x59fc('0x33')});db[_0x59fc('0x51')][_0x59fc('0x120')](db['Team'],{'through':'team_has_fax_queues','as':_0x59fc('0x15b')});db[_0x59fc('0x53')][_0x59fc('0x11f')](db['FaxAccount'],{});db[_0x59fc('0x53')][_0x59fc('0x11f')](db[_0x59fc('0xf7')],{'as':_0x59fc('0x16d'),'foreignKey':_0x59fc('0x17c')});db[_0x59fc('0x53')][_0x59fc('0x11f')](db[_0x59fc('0x74')],{'as':_0x59fc('0x165'),'foreignKey':_0x59fc('0x166')});db[_0x59fc('0x53')][_0x59fc('0x11f')](db[_0x59fc('0x12c')],{});db[_0x59fc('0x53')][_0x59fc('0x11f')](db[_0x59fc('0x4f')],{});db[_0x59fc('0x53')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{});db[_0x59fc('0x53')]['belongsTo'](db[_0x59fc('0x51')],{});db[_0x59fc('0x55')]['hasMany'](db[_0x59fc('0x86')],{'as':_0x59fc('0x16a'),'foreignKey':'SmsAccountId'});db[_0x59fc('0x55')][_0x59fc('0x112')](db[_0x59fc('0x84')],{'as':'Answers','foreignKey':_0x59fc('0x185')});db[_0x59fc('0x55')][_0x59fc('0x112')](db[_0x59fc('0x5a')],{'as':_0x59fc('0x15f'),'foreignKey':'SmsAccountId'});db[_0x59fc('0x55')][_0x59fc('0x112')](db[_0x59fc('0x58')],{'as':_0x59fc('0x16b')});db['SmsAccount']['hasMany'](db[_0x59fc('0x56')],{'as':_0x59fc('0x14a')});db[_0x59fc('0x55')][_0x59fc('0x11f')](db[_0x59fc('0xf7')],{'as':_0x59fc('0x16d'),'foreignKey':_0x59fc('0x17c')});db[_0x59fc('0x55')][_0x59fc('0x11f')](db[_0x59fc('0x8c')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x59fc('0x55')]['belongsToMany'](db[_0x59fc('0x12')],{'as':_0x59fc('0x15a'),'through':_0x59fc('0x144')});db[_0x59fc('0x56')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'onDelete':_0x59fc('0x17b')});db[_0x59fc('0x56')]['belongsTo'](db[_0x59fc('0x5b')],{'onDelete':_0x59fc('0x17b')});db[_0x59fc('0x56')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x59fc('0x17b')});db[_0x59fc('0x56')][_0x59fc('0x11f')](db[_0x59fc('0x8a')],{'onDelete':_0x59fc('0x17b'),'foreignKey':_0x59fc('0x157')});db[_0x59fc('0x56')][_0x59fc('0x11f')](db['Tag'],{'onDelete':_0x59fc('0x17b'),'foreignKey':_0x59fc('0x180')});db[_0x59fc('0x58')]['hasMany'](db[_0x59fc('0x5a')],{'as':_0x59fc('0x15f'),'onDelete':'cascade','foreignKey':_0x59fc('0x186')});db[_0x59fc('0x58')][_0x59fc('0x11f')](db['SmsAccount'],{'as':_0x59fc('0x173'),'foreignKey':'SmsAccountId'});db[_0x59fc('0x58')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x59fc('0x166')});db[_0x59fc('0x58')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'as':_0x59fc('0x174'),'foreignKey':'UserId'});db[_0x59fc('0x58')][_0x59fc('0x120')](db[_0x59fc('0x94')],{'through':'sms_interaction_has_tags','as':_0x59fc('0x176')});db[_0x59fc('0x58')][_0x59fc('0x120')](db[_0x59fc('0x94')],{'through':_0x59fc('0x187'),'as':_0x59fc('0x177')});db['SmsInteraction'][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':'Users','through':_0x59fc('0x12e'),'foreignKey':_0x59fc('0x186')});db[_0x59fc('0x5a')]['belongsTo'](db['User'],{'as':'User'});db[_0x59fc('0x5a')]['belongsTo'](db[_0x59fc('0x74')],{'onDelete':_0x59fc('0x110'),'as':_0x59fc('0x165')});db[_0x59fc('0x5a')]['belongsTo'](db[_0x59fc('0x58')],{'onDelete':'cascade','as':_0x59fc('0x17a'),'foreignKey':_0x59fc('0x186')});db[_0x59fc('0x5a')][_0x59fc('0x11f')](db[_0x59fc('0x55')],{'as':_0x59fc('0x173'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x15a'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x59fc('0x5b')][_0x59fc('0x120')](db['Team'],{'through':_0x59fc('0x188'),'as':_0x59fc('0x15b')});db['OpenchannelAccount']['hasMany'](db[_0x59fc('0x86')],{'as':'Dispositions','foreignKey':_0x59fc('0x189')});db[_0x59fc('0x5d')]['hasMany'](db[_0x59fc('0x84')],{'as':'Answers','foreignKey':_0x59fc('0x189')});db['OpenchannelAccount'][_0x59fc('0x112')](db[_0x59fc('0x118')],{'as':_0x59fc('0x16b'),'foreignKey':_0x59fc('0x189')});db[_0x59fc('0x5d')][_0x59fc('0x112')](db[_0x59fc('0x62')],{'as':_0x59fc('0x15f'),'foreignKey':_0x59fc('0x189')});db[_0x59fc('0x5d')]['hasMany'](db['OpenchannelApplication'],{'as':_0x59fc('0x14a'),'foreignKey':_0x59fc('0x189')});db[_0x59fc('0x5d')][_0x59fc('0x11f')](db[_0x59fc('0xf7')],{'as':_0x59fc('0x16d'),'foreignKey':'ListId'});db[_0x59fc('0x5d')][_0x59fc('0x11f')](db[_0x59fc('0x8c')],{'as':'mandatoryDispositionPause','foreignKey':_0x59fc('0x158')});db[_0x59fc('0x5d')][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x15a'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication']['belongsTo'](db['User'],{'onDelete':_0x59fc('0x17b')});db[_0x59fc('0x5f')][_0x59fc('0x11f')](db['OpenchannelQueue'],{'onDelete':_0x59fc('0x17b'),'foreignKey':'OpenchannelQueueId'});db[_0x59fc('0x5f')]['belongsTo'](db[_0x59fc('0x5d')],{'onDelete':_0x59fc('0x17b'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication'][_0x59fc('0x11f')](db['Interval'],{'onDelete':_0x59fc('0x17b'),'foreignKey':_0x59fc('0x157')});db[_0x59fc('0x5f')][_0x59fc('0x11f')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x59fc('0x180')});db['OpenchannelInteraction'][_0x59fc('0x112')](db['OpenchannelMessage'],{'as':_0x59fc('0x15f'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x18a')});db[_0x59fc('0x118')][_0x59fc('0x11f')](db[_0x59fc('0x5d')],{'as':_0x59fc('0x173'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x59fc('0x11f')](db[_0x59fc('0x74')],{'as':_0x59fc('0x165'),'foreignKey':_0x59fc('0x166')});db[_0x59fc('0x118')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'as':_0x59fc('0x174'),'foreignKey':'UserId'});db[_0x59fc('0x118')][_0x59fc('0x120')](db[_0x59fc('0x94')],{'through':_0x59fc('0x18b'),'as':_0x59fc('0x176')});db['OpenchannelInteraction']['belongsToMany'](db[_0x59fc('0x94')],{'through':_0x59fc('0x18b'),'as':_0x59fc('0x177')});db['OpenchannelInteraction'][_0x59fc('0x120')](db['User'],{'as':_0x59fc('0x178'),'through':_0x59fc('0x12f'),'foreignKey':_0x59fc('0x18a')});db[_0x59fc('0x62')]['belongsTo'](db[_0x59fc('0x12')],{'onDelete':_0x59fc('0x110'),'as':_0x59fc('0x12')});db['OpenchannelMessage'][_0x59fc('0x11f')](db[_0x59fc('0x74')],{'onDelete':_0x59fc('0x110'),'as':_0x59fc('0x165')});db[_0x59fc('0x62')][_0x59fc('0x11f')](db[_0x59fc('0x118')],{'onDelete':_0x59fc('0x110'),'as':_0x59fc('0x17a'),'foreignKey':'OpenchannelInteractionId'});db[_0x59fc('0x62')][_0x59fc('0x11f')](db[_0x59fc('0x179')],{'as':_0x59fc('0x179'),'foreignKey':_0x59fc('0x184')});db['OpenchannelMessage'][_0x59fc('0x11f')](db[_0x59fc('0x5d')],{'as':'Account','foreignKey':_0x59fc('0x189')});db[_0x59fc('0x136')][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x15a'),'through':'UserOpenchannelQueue','foreignKey':_0x59fc('0x18c')});db['OpenchannelQueue'][_0x59fc('0x120')](db[_0x59fc('0x128')],{'through':_0x59fc('0x18d'),'as':_0x59fc('0x15b')});db['ChatWebsite'][_0x59fc('0x112')](db[_0x59fc('0x86')],{'as':_0x59fc('0x16a'),'foreignKey':_0x59fc('0x18e')});db[_0x59fc('0x65')][_0x59fc('0x112')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x59fc('0x18e')});db[_0x59fc('0x65')][_0x59fc('0x112')](db['ChatProactiveAction'],{'as':'ProactiveActions'});db[_0x59fc('0x65')][_0x59fc('0x112')](db['ChatInteraction'],{'as':_0x59fc('0x16b')});db[_0x59fc('0x65')][_0x59fc('0x112')](db['ChatApplication'],{'as':'Applications'});db[_0x59fc('0x65')][_0x59fc('0x112')](db[_0x59fc('0x6c')],{'as':_0x59fc('0x15f')});db[_0x59fc('0x65')][_0x59fc('0x11f')](db[_0x59fc('0xf7')],{'as':'List','foreignKey':_0x59fc('0x17c')});db['ChatWebsite'][_0x59fc('0x11f')](db['Interval'],{'as':'Interval','foreignKey':'IntervalId'});db[_0x59fc('0x65')]['belongsTo'](db[_0x59fc('0x8c')],{'as':'mandatoryDispositionPause','foreignKey':_0x59fc('0x158')});db[_0x59fc('0x65')][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x15a'),'through':_0x59fc('0x13c')});db['OpenchannelQueueReport'][_0x59fc('0x11f')](db['OpenchannelAccount'],{});db[_0x59fc('0x67')][_0x59fc('0x11f')](db['CmList'],{'as':_0x59fc('0x16d'),'foreignKey':_0x59fc('0x17c')});db[_0x59fc('0x67')][_0x59fc('0x11f')](db[_0x59fc('0x74')],{'as':_0x59fc('0x165'),'foreignKey':_0x59fc('0x166')});db[_0x59fc('0x67')][_0x59fc('0x11f')](db[_0x59fc('0x118')],{});db[_0x59fc('0x67')]['belongsTo'](db[_0x59fc('0x62')],{});db[_0x59fc('0x67')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{});db['OpenchannelQueueReport'][_0x59fc('0x11f')](db[_0x59fc('0x136')],{});db[_0x59fc('0x69')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'as':_0x59fc('0x18f'),'foreignKey':_0x59fc('0x111'),'onDelete':_0x59fc('0x17b')});db['ChatApplication'][_0x59fc('0x11f')](db[_0x59fc('0x6f')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0x59fc('0x17b')});db[_0x59fc('0x69')][_0x59fc('0x11f')](db[_0x59fc('0x65')],{'as':_0x59fc('0x190'),'foreignKey':'ChatWebsiteId','onDelete':_0x59fc('0x17b')});db[_0x59fc('0x69')]['belongsTo'](db[_0x59fc('0x94')],{'onDelete':_0x59fc('0x17b'),'foreignKey':'TagId'});db[_0x59fc('0x6a')][_0x59fc('0x112')](db[_0x59fc('0x6c')],{'as':_0x59fc('0x15f'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x191')});db['ChatInteraction'][_0x59fc('0x11f')](db[_0x59fc('0x65')],{'as':_0x59fc('0x173'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x59fc('0x11f')](db[_0x59fc('0x74')],{'as':_0x59fc('0x165'),'foreignKey':_0x59fc('0x166')});db[_0x59fc('0x6a')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'as':_0x59fc('0x174'),'foreignKey':_0x59fc('0x111')});db[_0x59fc('0x6a')][_0x59fc('0x120')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x59fc('0x176')});db[_0x59fc('0x6a')][_0x59fc('0x120')](db[_0x59fc('0x94')],{'through':_0x59fc('0x192'),'as':'ThroughTags'});db[_0x59fc('0x6a')][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x178'),'through':_0x59fc('0x193'),'foreignKey':_0x59fc('0x191')});db['ChatMessage'][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'onDelete':_0x59fc('0x110'),'as':_0x59fc('0x12')});db[_0x59fc('0x6c')]['belongsTo'](db[_0x59fc('0x74')],{'onDelete':_0x59fc('0x110'),'as':_0x59fc('0x165'),'foreignKey':_0x59fc('0x166')});db[_0x59fc('0x6c')][_0x59fc('0x11f')](db['ChatInteraction'],{'onDelete':_0x59fc('0x110'),'as':'Interaction','foreignKey':_0x59fc('0x191')});db['ChatMessage'][_0x59fc('0x11f')](db[_0x59fc('0x179')],{'as':_0x59fc('0x179'),'foreignKey':'AttachmentId'});db[_0x59fc('0x6c')]['belongsTo'](db[_0x59fc('0x65')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x59fc('0x6e')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x59fc('0x165'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x59fc('0x11f')](db['ChatWebsite'],{'as':_0x59fc('0x173'),'foreignKey':_0x59fc('0x18e')});db[_0x59fc('0x6f')][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x15a'),'through':'UserChatQueue','hooks':!![]});db[_0x59fc('0x6f')][_0x59fc('0x120')](db[_0x59fc('0x128')],{'through':_0x59fc('0x194'),'as':_0x59fc('0x15b')});db['ChatGroup']['hasMany'](db[_0x59fc('0x195')],{'as':'Messages','foreignKey':_0x59fc('0x196'),'onDelete':'cascade'});db['ChatGroup'][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x14d'),'through':'chat_group_has_users'});db[_0x59fc('0x197')]['belongsTo'](db[_0x59fc('0x65')],{'as':_0x59fc('0x190'),'foreignKey':'ChatWebsiteId'});db[_0x59fc('0x73')][_0x59fc('0x112')](db[_0x59fc('0x74')],{'as':_0x59fc('0x124'),'foreignKey':_0x59fc('0x198')});db[_0x59fc('0x74')][_0x59fc('0x112')](db[_0x59fc('0x14e')],{'as':_0x59fc('0x14f'),'foreignKey':'ContactId'});db[_0x59fc('0x74')][_0x59fc('0x112')](db[_0x59fc('0x79')],{'as':_0x59fc('0x116'),'foreignKey':_0x59fc('0x166')});db[_0x59fc('0x74')][_0x59fc('0x112')](db[_0x59fc('0x7b')],{'as':'HopperHistories','foreignKey':_0x59fc('0x166')});db[_0x59fc('0x74')][_0x59fc('0x112')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x59fc('0x166')});db['CmContact'][_0x59fc('0x112')](db[_0x59fc('0xd9')],{'as':_0x59fc('0x153'),'foreignKey':'ContactId'});db[_0x59fc('0x74')][_0x59fc('0x112')](db[_0x59fc('0x118')],{'as':_0x59fc('0x119'),'foreignKey':_0x59fc('0x166'),'onDelete':'restrict'});db[_0x59fc('0x74')]['hasMany'](db[_0x59fc('0x6a')],{'as':_0x59fc('0x11a'),'foreignKey':_0x59fc('0x166'),'onDelete':'restrict'});db['CmContact']['hasMany'](db['SmsInteraction'],{'as':_0x59fc('0x12d'),'foreignKey':_0x59fc('0x166'),'onDelete':'restrict'});db[_0x59fc('0x74')]['hasMany'](db['FaxInteraction'],{'as':_0x59fc('0x11b'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0x59fc('0x112')](db[_0x59fc('0x41')],{'as':_0x59fc('0x12a'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x59fc('0x74')][_0x59fc('0x11f')](db[_0x59fc('0x73')],{'as':'Company','foreignKey':_0x59fc('0x198')});db[_0x59fc('0x74')][_0x59fc('0x11f')](db[_0x59fc('0xf7')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0x59fc('0x74')][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x178'),'through':_0x59fc('0x125')});db['CmContact'][_0x59fc('0x120')](db[_0x59fc('0x94')],{'as':'Tags','through':_0x59fc('0x199')});db['CmContact'][_0x59fc('0x120')](db[_0x59fc('0x94')],{'through':_0x59fc('0x199'),'as':_0x59fc('0x177')});db[_0x59fc('0x14e')]['belongsTo'](db[_0x59fc('0x74')],{'as':'Contact','foreignKey':_0x59fc('0x166'),'onDelete':_0x59fc('0x110')});db[_0x59fc('0x14e')][_0x59fc('0x11f')](db[_0x59fc('0xf7')],{'as':'List','foreignKey':'ListId','onDelete':_0x59fc('0x110')});db[_0x59fc('0x14e')]['belongsTo'](db[_0x59fc('0x12')],{'as':'Agent','foreignKey':_0x59fc('0x111')});db['CmHopper'][_0x59fc('0x11f')](db[_0x59fc('0x14c')],{'as':_0x59fc('0x19a'),'foreignKey':_0x59fc('0x150'),'onDelete':'cascade'});db[_0x59fc('0x14e')]['belongsTo'](db[_0x59fc('0x19b')],{'as':_0x59fc('0x19b'),'foreignKey':'CampaignId','onDelete':_0x59fc('0x110')});db[_0x59fc('0x14e')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'as':'Owner','foreignKey':_0x59fc('0x19c')});db['CmHopperBlack'][_0x59fc('0x11f')](db['CmContact'],{'as':_0x59fc('0x165'),'foreignKey':'ContactId','onDelete':_0x59fc('0x110')});db[_0x59fc('0x77')][_0x59fc('0x11f')](db[_0x59fc('0xf7')],{'as':_0x59fc('0x16d'),'foreignKey':_0x59fc('0x17c'),'onDelete':_0x59fc('0x110')});db[_0x59fc('0x77')][_0x59fc('0x11f')](db[_0x59fc('0x14c')],{'as':'Queue','foreignKey':_0x59fc('0x150'),'onDelete':'cascade'});db[_0x59fc('0x77')][_0x59fc('0x11f')](db[_0x59fc('0x19b')],{'as':_0x59fc('0x19b'),'foreignKey':_0x59fc('0x19d'),'onDelete':_0x59fc('0x110')});db[_0x59fc('0x82')]['hasMany'](db[_0x59fc('0x88')],{'as':{'plural':_0x59fc('0x19e'),'singular':_0x59fc('0x19f')},'foreignKey':'AutomationAllId','onDelete':_0x59fc('0x110'),'hooks':!![]});db[_0x59fc('0x82')][_0x59fc('0x112')](db[_0x59fc('0x88')],{'as':{'plural':_0x59fc('0x1a0'),'singular':_0x59fc('0x1a1')},'foreignKey':_0x59fc('0x1a2'),'onDelete':_0x59fc('0x110'),'hooks':!![]});db[_0x59fc('0x82')][_0x59fc('0x112')](db['Action'],{'as':_0x59fc('0x1a3'),'foreignKey':_0x59fc('0x1a4'),'onDelete':_0x59fc('0x110'),'hooks':!![]});db[_0x59fc('0x8a')][_0x59fc('0x112')](db['Interval'],{'as':_0x59fc('0x1a5'),'foreignKey':_0x59fc('0x157'),'onDelete':_0x59fc('0x110'),'hooks':!![],'required':![]});db['Interval'][_0x59fc('0x112')](db['VoiceExtension'],{'as':_0x59fc('0x115'),'foreignKey':_0x59fc('0x157'),'onDelete':_0x59fc('0x17b')});db[_0x59fc('0x8a')][_0x59fc('0x112')](db[_0x59fc('0x16c')],{'as':_0x59fc('0x1a6'),'foreignKey':_0x59fc('0x157')});db[_0x59fc('0x8a')][_0x59fc('0x112')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0x59fc('0x8a')]['hasMany'](db['FaxApplication'],{'as':_0x59fc('0x1a7'),'foreignKey':'IntervalId'});db[_0x59fc('0x8a')]['hasMany'](db[_0x59fc('0x56')],{'as':_0x59fc('0x1a8'),'foreignKey':'IntervalId'});db[_0x59fc('0x90')]['belongsTo'](db[_0x59fc('0x3c')],{});db[_0x59fc('0x90')][_0x59fc('0x11f')](db[_0x59fc('0x9d')],{'foreignKey':_0x59fc('0x1a9')});db[_0x59fc('0x90')][_0x59fc('0x11f')](db[_0x59fc('0x1aa')],{'foreignKey':_0x59fc('0x1ab')});db['Sound']['belongsToMany'](db[_0x59fc('0x1ac')],{'as':_0x59fc('0x1ad'),'through':_0x59fc('0x14b'),'onDelete':_0x59fc('0x17b')});db[_0x59fc('0x94')][_0x59fc('0x120')](db[_0x59fc('0x74')],{'through':'cm_contact_has_tags'});db[_0x59fc('0x94')][_0x59fc('0x120')](db[_0x59fc('0x6a')],{'through':'chat_interaction_has_tags'});db[_0x59fc('0x94')][_0x59fc('0x120')](db[_0x59fc('0x41')],{'through':_0x59fc('0x175')});db[_0x59fc('0x94')][_0x59fc('0x120')](db[_0x59fc('0x58')],{'through':'sms_interaction_has_tags'});db[_0x59fc('0x94')][_0x59fc('0x120')](db[_0x59fc('0x12c')],{'through':'fax_interaction_has_tags'});db[_0x59fc('0x94')][_0x59fc('0x120')](db[_0x59fc('0x118')],{'through':_0x59fc('0x18b')});db[_0x59fc('0x94')][_0x59fc('0x120')](db[_0x59fc('0x105')],{'through':_0x59fc('0x1ae')});db[_0x59fc('0x96')][_0x59fc('0x112')](db[_0x59fc('0x88')],{'as':{'plural':_0x59fc('0x1af'),'singular':'AllCondition'},'foreignKey':_0x59fc('0x1b0'),'onDelete':'cascade','hooks':!![]});db['Trigger']['hasMany'](db[_0x59fc('0x88')],{'as':{'plural':_0x59fc('0x1b1'),'singular':'AnyCondition'},'foreignKey':_0x59fc('0x1b2'),'onDelete':_0x59fc('0x110'),'hooks':!![]});db[_0x59fc('0x96')][_0x59fc('0x112')](db[_0x59fc('0x80')],{'as':_0x59fc('0x1a3'),'foreignKey':_0x59fc('0x1b3'),'onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0x59fc('0x112')](db['AnalyticFieldReport'],{'as':_0x59fc('0x1b4'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1ab'),'hooks':!![]});db[_0x59fc('0x9d')][_0x59fc('0x112')](db['AnalyticFieldReport'],{'as':_0x59fc('0x1b4'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x59fc('0xa1')][_0x59fc('0x112')](db[_0x59fc('0x1b5')],{'as':_0x59fc('0x1b4'),'onDelete':'cascade','foreignKey':_0x59fc('0x1b6')});db[_0x59fc('0x1b5')][_0x59fc('0x11f')](db[_0x59fc('0xa1')],{'foreignKey':_0x59fc('0x1b6')});db[_0x59fc('0x1b7')][_0x59fc('0x112')](db[_0x59fc('0x1b8')],{'as':'Configurations','onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1b9')});db[_0x59fc('0x1b8')]['hasMany'](db[_0x59fc('0xa8')],{'as':_0x59fc('0x1ba'),'onDelete':_0x59fc('0x110'),'foreignKey':'SubjectId'});db[_0x59fc('0x1b8')][_0x59fc('0x112')](db[_0x59fc('0xa8')],{'as':_0x59fc('0x1bb'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1bc')});db[_0x59fc('0x1b8')]['hasMany'](db['SalesforceField'],{'as':_0x59fc('0x1b4'),'onDelete':_0x59fc('0x110'),'foreignKey':'FieldId'});db[_0x59fc('0x1b8')][_0x59fc('0x11f')](db[_0x59fc('0x1b7')],{'as':_0x59fc('0x173'),'foreignKey':_0x59fc('0x1b9')});db['SalesforceField'][_0x59fc('0x112')](db['SalesforceField'],{'as':_0x59fc('0x1bd'),'foreignKey':_0x59fc('0x1be')});db[_0x59fc('0xa8')][_0x59fc('0x112')](db['SalesforceField'],{'as':_0x59fc('0x1bf'),'foreignKey':_0x59fc('0x1bc')});db['SalesforceField'][_0x59fc('0x112')](db[_0x59fc('0xa8')],{'as':_0x59fc('0x1c0'),'foreignKey':'FieldId'});db[_0x59fc('0xa8')][_0x59fc('0x11f')](db[_0x59fc('0x98')],{'as':'Variable','foreignKey':_0x59fc('0x1c1')});db[_0x59fc('0xaa')][_0x59fc('0x112')](db[_0x59fc('0x1c2')],{'as':'Configurations','onDelete':_0x59fc('0x110'),'foreignKey':'AccountId'});db[_0x59fc('0x1c2')]['hasMany'](db[_0x59fc('0xad')],{'as':_0x59fc('0x1ba'),'onDelete':_0x59fc('0x110'),'foreignKey':'SubjectId'});db[_0x59fc('0x1c2')][_0x59fc('0x112')](db[_0x59fc('0xad')],{'as':_0x59fc('0x1bb'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1bc')});db[_0x59fc('0x1c2')][_0x59fc('0x112')](db[_0x59fc('0xad')],{'as':_0x59fc('0x1b4'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1c3')});db['SugarcrmConfiguration'][_0x59fc('0x11f')](db['SugarcrmAccount'],{'as':_0x59fc('0x173'),'foreignKey':'AccountId'});db[_0x59fc('0xad')][_0x59fc('0x112')](db[_0x59fc('0xad')],{'as':_0x59fc('0x1bd'),'foreignKey':_0x59fc('0x1be')});db[_0x59fc('0xad')][_0x59fc('0x112')](db[_0x59fc('0xad')],{'as':_0x59fc('0x1bf'),'foreignKey':_0x59fc('0x1bc')});db[_0x59fc('0xad')][_0x59fc('0x112')](db['SugarcrmField'],{'as':_0x59fc('0x1c0'),'foreignKey':_0x59fc('0x1c3')});db[_0x59fc('0xad')][_0x59fc('0x11f')](db['Variable'],{'as':'Variable','foreignKey':_0x59fc('0x1c1')});db[_0x59fc('0xaf')][_0x59fc('0x112')](db[_0x59fc('0xb1')],{'as':_0x59fc('0x1c4'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1b9')});db[_0x59fc('0xb1')][_0x59fc('0x112')](db['DeskField'],{'as':_0x59fc('0x1ba'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1be')});db['DeskConfiguration']['hasMany'](db[_0x59fc('0x1c5')],{'as':_0x59fc('0x1bb'),'onDelete':'cascade','foreignKey':_0x59fc('0x1bc')});db[_0x59fc('0xb1')][_0x59fc('0x112')](db['DeskField'],{'as':_0x59fc('0x1b4'),'onDelete':_0x59fc('0x110'),'foreignKey':'FieldId'});db[_0x59fc('0xb1')]['belongsTo'](db[_0x59fc('0xaf')],{'as':_0x59fc('0x173'),'foreignKey':_0x59fc('0x1b9')});db[_0x59fc('0xb1')][_0x59fc('0x120')](db['Tag'],{'through':_0x59fc('0x1c6')});db['DeskField'][_0x59fc('0x112')](db['DeskField'],{'as':_0x59fc('0x1bd'),'foreignKey':'SubjectId'});db[_0x59fc('0x1c5')]['hasMany'](db['DeskField'],{'as':'Description','foreignKey':_0x59fc('0x1bc')});db[_0x59fc('0x1c5')]['hasMany'](db[_0x59fc('0x1c5')],{'as':_0x59fc('0x1c0'),'foreignKey':_0x59fc('0x1c3')});db[_0x59fc('0x1c5')][_0x59fc('0x11f')](db[_0x59fc('0x98')],{'as':_0x59fc('0x98'),'foreignKey':_0x59fc('0x1c1')});db[_0x59fc('0xb4')]['hasMany'](db['ZohoConfiguration'],{'as':_0x59fc('0x1c4'),'onDelete':_0x59fc('0x110'),'foreignKey':'AccountId'});db['ZohoConfiguration'][_0x59fc('0x112')](db[_0x59fc('0x1c7')],{'as':_0x59fc('0x1ba'),'onDelete':'cascade','foreignKey':_0x59fc('0x1be')});db['ZohoConfiguration'][_0x59fc('0x112')](db[_0x59fc('0x1c7')],{'as':_0x59fc('0x1bb'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1bc')});db[_0x59fc('0xb6')][_0x59fc('0x112')](db[_0x59fc('0x1c7')],{'as':_0x59fc('0x1b4'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1c3')});db[_0x59fc('0xb6')][_0x59fc('0x11f')](db['ZohoAccount'],{'as':_0x59fc('0x173'),'foreignKey':_0x59fc('0x1b9')});db['ZohoField'][_0x59fc('0x112')](db[_0x59fc('0x1c7')],{'as':_0x59fc('0x1bd'),'foreignKey':_0x59fc('0x1be')});db[_0x59fc('0x1c7')][_0x59fc('0x112')](db[_0x59fc('0x1c7')],{'as':_0x59fc('0x1bf'),'foreignKey':_0x59fc('0x1bc')});db[_0x59fc('0x1c7')]['hasMany'](db[_0x59fc('0x1c7')],{'as':_0x59fc('0x1c0'),'foreignKey':_0x59fc('0x1c3')});db[_0x59fc('0x1c7')]['belongsTo'](db[_0x59fc('0x98')],{'as':_0x59fc('0x98'),'foreignKey':_0x59fc('0x1c1')});db[_0x59fc('0xb8')]['hasMany'](db[_0x59fc('0xba')],{'as':_0x59fc('0x1c4'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1b9')});db[_0x59fc('0xba')][_0x59fc('0x112')](db[_0x59fc('0x1c8')],{'as':'Subjects','foreignKey':_0x59fc('0x1be')});db[_0x59fc('0xba')][_0x59fc('0x112')](db['ZendeskField'],{'as':_0x59fc('0x1bb'),'foreignKey':_0x59fc('0x1bc')});db[_0x59fc('0xba')][_0x59fc('0x112')](db[_0x59fc('0x1c8')],{'as':_0x59fc('0x1b4'),'foreignKey':_0x59fc('0x1c3')});db[_0x59fc('0xba')][_0x59fc('0x11f')](db[_0x59fc('0xb8')],{'as':'Account','foreignKey':'AccountId'});db[_0x59fc('0xba')]['belongsToMany'](db[_0x59fc('0x94')],{'through':_0x59fc('0x1c9')});db[_0x59fc('0x1c8')]['hasMany'](db['ZendeskField'],{'as':_0x59fc('0x1bd'),'foreignKey':'SubjectId'});db[_0x59fc('0x1c8')][_0x59fc('0x112')](db[_0x59fc('0x1c8')],{'as':'Description','foreignKey':_0x59fc('0x1bc')});db['ZendeskField']['hasMany'](db[_0x59fc('0x1c8')],{'as':'Field','foreignKey':'FieldId'});db[_0x59fc('0x1c8')][_0x59fc('0x11f')](db[_0x59fc('0x98')],{'as':_0x59fc('0x98'),'foreignKey':_0x59fc('0x1c1')});db['FreshdeskAccount'][_0x59fc('0x112')](db[_0x59fc('0xbe')],{'as':_0x59fc('0x1c4'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1b9')});db[_0x59fc('0xbe')][_0x59fc('0x112')](db[_0x59fc('0xbf')],{'as':_0x59fc('0x1ba'),'onDelete':'cascade','foreignKey':_0x59fc('0x1be')});db[_0x59fc('0xbe')][_0x59fc('0x112')](db[_0x59fc('0xbf')],{'as':_0x59fc('0x1bb'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1bc')});db['FreshdeskConfiguration'][_0x59fc('0x112')](db[_0x59fc('0xbf')],{'as':_0x59fc('0x1b4'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1c3')});db[_0x59fc('0xbe')]['belongsTo'](db[_0x59fc('0xbd')],{'as':'Account','foreignKey':'AccountId'});db[_0x59fc('0xbe')]['belongsToMany'](db[_0x59fc('0x94')],{'through':_0x59fc('0x1ca')});db['FreshdeskField'][_0x59fc('0x112')](db['FreshdeskField'],{'as':_0x59fc('0x1bd'),'foreignKey':'SubjectId'});db[_0x59fc('0xbf')][_0x59fc('0x112')](db[_0x59fc('0xbf')],{'as':_0x59fc('0x1bf'),'foreignKey':'DescriptionId'});db['FreshdeskField']['hasMany'](db[_0x59fc('0xbf')],{'as':'Field','foreignKey':'FieldId'});db[_0x59fc('0xbf')][_0x59fc('0x11f')](db['Variable'],{'as':'Variable','foreignKey':_0x59fc('0x1c1')});db[_0x59fc('0x1cb')]['hasMany'](db['VtigerConfiguration'],{'as':_0x59fc('0x1c4'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1b9')});db[_0x59fc('0xc0')][_0x59fc('0x112')](db['VtigerField'],{'as':'Subjects','foreignKey':_0x59fc('0x1be')});db[_0x59fc('0xc0')][_0x59fc('0x112')](db[_0x59fc('0xc2')],{'as':_0x59fc('0x1bb'),'foreignKey':_0x59fc('0x1bc')});db['VtigerConfiguration']['hasMany'](db[_0x59fc('0xc2')],{'as':_0x59fc('0x1b4'),'foreignKey':_0x59fc('0x1c3')});db[_0x59fc('0xc0')][_0x59fc('0x11f')](db[_0x59fc('0x1cb')],{'as':'Account','foreignKey':_0x59fc('0x1b9')});db[_0x59fc('0xc2')][_0x59fc('0x112')](db[_0x59fc('0xc2')],{'as':_0x59fc('0x1bd'),'foreignKey':_0x59fc('0x1be')});db[_0x59fc('0xc2')]['hasMany'](db['VtigerField'],{'as':_0x59fc('0x1bf'),'foreignKey':_0x59fc('0x1bc')});db['VtigerField'][_0x59fc('0x112')](db['VtigerField'],{'as':'Field','foreignKey':'FieldId'});db[_0x59fc('0xc2')][_0x59fc('0x11f')](db[_0x59fc('0x98')],{'as':_0x59fc('0x98'),'foreignKey':'VariableId'});db[_0x59fc('0xc4')][_0x59fc('0x112')](db[_0x59fc('0xc6')],{'as':_0x59fc('0x1c4'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1b9')});db[_0x59fc('0xc6')][_0x59fc('0x112')](db[_0x59fc('0x1cc')],{'as':_0x59fc('0x1ba'),'foreignKey':_0x59fc('0x1be')});db[_0x59fc('0xc6')]['hasMany'](db[_0x59fc('0x1cc')],{'as':_0x59fc('0x1bb'),'foreignKey':'DescriptionId'});db[_0x59fc('0xc6')][_0x59fc('0x112')](db[_0x59fc('0x1cc')],{'as':_0x59fc('0x1b4'),'foreignKey':_0x59fc('0x1c3')});db[_0x59fc('0xc6')][_0x59fc('0x11f')](db[_0x59fc('0xc4')],{'as':_0x59fc('0x173'),'foreignKey':'AccountId'});db[_0x59fc('0x1cc')][_0x59fc('0x112')](db['ServicenowField'],{'as':_0x59fc('0x1bd'),'foreignKey':_0x59fc('0x1be')});db[_0x59fc('0x1cc')][_0x59fc('0x112')](db['ServicenowField'],{'as':_0x59fc('0x1bf'),'foreignKey':'DescriptionId'});db[_0x59fc('0x1cc')]['hasMany'](db[_0x59fc('0x1cc')],{'as':_0x59fc('0x1c0'),'foreignKey':_0x59fc('0x1c3')});db[_0x59fc('0x1cc')]['belongsTo'](db[_0x59fc('0x98')],{'as':_0x59fc('0x98'),'foreignKey':_0x59fc('0x1c1')});db[_0x59fc('0xc9')]['hasMany'](db[_0x59fc('0xcb')],{'as':_0x59fc('0x1c4'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1b9')});db['Dynamics365Configuration'][_0x59fc('0x112')](db[_0x59fc('0xcd')],{'as':_0x59fc('0x1ba'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1be')});db['Dynamics365Configuration'][_0x59fc('0x112')](db[_0x59fc('0xcd')],{'as':_0x59fc('0x1bb'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1bc')});db[_0x59fc('0xcb')][_0x59fc('0x112')](db[_0x59fc('0xcd')],{'as':'Fields','onDelete':_0x59fc('0x110'),'foreignKey':'FieldId'});db[_0x59fc('0xcb')][_0x59fc('0x11f')](db[_0x59fc('0xc9')],{'as':_0x59fc('0x173'),'foreignKey':'AccountId'});db['Dynamics365Field'][_0x59fc('0x112')](db[_0x59fc('0xcd')],{'as':_0x59fc('0x1bd'),'foreignKey':_0x59fc('0x1be')});db[_0x59fc('0xcd')][_0x59fc('0x112')](db['Dynamics365Field'],{'as':_0x59fc('0x1bf'),'foreignKey':_0x59fc('0x1bc')});db['Dynamics365Field']['hasMany'](db[_0x59fc('0xcd')],{'as':'Field','foreignKey':'FieldId'});db[_0x59fc('0xcd')][_0x59fc('0x11f')](db[_0x59fc('0x98')],{'as':_0x59fc('0x98'),'foreignKey':_0x59fc('0x1c1')});db[_0x59fc('0xce')][_0x59fc('0x112')](db[_0x59fc('0x1cd')],{'as':_0x59fc('0x1c4'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1b9')});db['FreshsalesConfiguration'][_0x59fc('0x112')](db[_0x59fc('0x1ce')],{'as':_0x59fc('0x1ba'),'foreignKey':_0x59fc('0x1be')});db[_0x59fc('0x1cd')]['hasMany'](db['FreshsalesField'],{'as':_0x59fc('0x1bb'),'foreignKey':'DescriptionId'});db[_0x59fc('0x1cd')][_0x59fc('0x112')](db[_0x59fc('0x1ce')],{'as':_0x59fc('0x1b4'),'foreignKey':'FieldId'});db[_0x59fc('0x1cd')][_0x59fc('0x11f')](db[_0x59fc('0xce')],{'as':_0x59fc('0x173'),'foreignKey':'AccountId'});db[_0x59fc('0x1ce')][_0x59fc('0x112')](db[_0x59fc('0x1ce')],{'as':_0x59fc('0x1bd'),'foreignKey':_0x59fc('0x1be')});db[_0x59fc('0x1ce')][_0x59fc('0x112')](db[_0x59fc('0x1ce')],{'as':_0x59fc('0x1bf'),'foreignKey':_0x59fc('0x1bc')});db['FreshsalesField'][_0x59fc('0x112')](db[_0x59fc('0x1ce')],{'as':'Field','foreignKey':'FieldId'});db[_0x59fc('0x1ce')][_0x59fc('0x11f')](db[_0x59fc('0x98')],{'as':'Variable','foreignKey':'VariableId'});db[_0x59fc('0xd4')]['belongsTo'](db['ChatWebsite'],{});db[_0x59fc('0xd4')]['belongsTo'](db[_0x59fc('0xf7')],{'as':'List','foreignKey':_0x59fc('0x17c')});db[_0x59fc('0xd4')][_0x59fc('0x11f')](db['CmContact'],{'as':'Contact','foreignKey':_0x59fc('0x166')});db[_0x59fc('0xd4')][_0x59fc('0x11f')](db[_0x59fc('0x6a')],{});db[_0x59fc('0xd4')][_0x59fc('0x11f')](db['ChatMessage'],{});db[_0x59fc('0xd4')]['belongsTo'](db[_0x59fc('0x12')],{});db[_0x59fc('0xd4')][_0x59fc('0x11f')](db['ChatQueue'],{});db[_0x59fc('0x195')][_0x59fc('0x11f')](db['User'],{'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1cf')});db[_0x59fc('0x195')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'onDelete':_0x59fc('0x110'),'foreignKey':'ToId'});db[_0x59fc('0xd9')]['hasMany'](db[_0x59fc('0xd8')],{'foreignKey':'SessionId','onDelete':_0x59fc('0x110')});db[_0x59fc('0xd9')]['hasMany'](db[_0x59fc('0xd6')],{'foreignKey':_0x59fc('0x1d0'),'onDelete':_0x59fc('0x110')});db['SmsQueueReport'][_0x59fc('0x11f')](db[_0x59fc('0x55')],{});db[_0x59fc('0xdb')][_0x59fc('0x11f')](db[_0x59fc('0xf7')],{'as':_0x59fc('0x16d'),'foreignKey':'ListId'});db[_0x59fc('0xdb')][_0x59fc('0x11f')](db['CmContact'],{'as':_0x59fc('0x165'),'foreignKey':'ContactId'});db[_0x59fc('0xdb')][_0x59fc('0x11f')](db[_0x59fc('0x58')],{});db[_0x59fc('0xdb')][_0x59fc('0x11f')](db[_0x59fc('0x5a')],{});db[_0x59fc('0xdb')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{});db['SmsQueueReport'][_0x59fc('0x11f')](db[_0x59fc('0x5b')],{});db[_0x59fc('0x1d1')][_0x59fc('0x112')](db[_0x59fc('0xd9')],{'foreignKey':_0x59fc('0x1d2')});db[_0x59fc('0x1d1')][_0x59fc('0x112')](db[_0x59fc('0xd8')],{'foreignKey':_0x59fc('0x1d2')});db[_0x59fc('0x1d1')][_0x59fc('0x112')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0x59fc('0xe4')]['belongsToMany'](db[_0x59fc('0x12')],{'as':_0x59fc('0x178'),'through':_0x59fc('0x147')});db['Team'][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x15a'),'through':_0x59fc('0x129')});db[_0x59fc('0x128')][_0x59fc('0x120')](db[_0x59fc('0x14c')],{'through':_0x59fc('0x15c'),'as':'VoiceQueues'});db['Team'][_0x59fc('0x120')](db['MailQueue'],{'through':_0x59fc('0x171'),'as':_0x59fc('0x1d3')});db[_0x59fc('0x128')][_0x59fc('0x120')](db['ChatQueue'],{'through':_0x59fc('0x194'),'as':_0x59fc('0x133')});db[_0x59fc('0x128')][_0x59fc('0x120')](db[_0x59fc('0x51')],{'through':_0x59fc('0x1d4'),'as':_0x59fc('0x134')});db['Team']['belongsToMany'](db[_0x59fc('0x5b')],{'through':_0x59fc('0x188'),'as':_0x59fc('0x135')});db[_0x59fc('0x128')][_0x59fc('0x120')](db[_0x59fc('0x136')],{'through':_0x59fc('0x18d'),'as':_0x59fc('0x137')});db[_0x59fc('0x128')][_0x59fc('0x120')](db[_0x59fc('0x10b')],{'through':_0x59fc('0x1d5'),'as':'WhatsappQueues'});db['Campaign'][_0x59fc('0x112')](db[_0x59fc('0x14e')],{'as':_0x59fc('0x14f'),'foreignKey':'CampaignId'});db['Campaign'][_0x59fc('0x112')](db[_0x59fc('0x79')],{'as':_0x59fc('0x116'),'foreignKey':'CampaignId'});db[_0x59fc('0x19b')][_0x59fc('0x112')](db[_0x59fc('0x7b')],{'as':_0x59fc('0x151'),'foreignKey':'CampaignId'});db[_0x59fc('0x19b')][_0x59fc('0x112')](db['CmHopperBlack'],{'as':_0x59fc('0x152'),'foreignKey':_0x59fc('0x19d')});db['Campaign'][_0x59fc('0x11f')](db[_0x59fc('0x29')],{'as':_0x59fc('0x29'),'foreignKey':_0x59fc('0x154')});db[_0x59fc('0x19b')][_0x59fc('0x11f')](db[_0x59fc('0x29')],{'as':_0x59fc('0x155'),'foreignKey':_0x59fc('0x156')});db['Campaign']['belongsTo'](db[_0x59fc('0x8a')],{'as':_0x59fc('0x8a'),'foreignKey':'IntervalId'});db[_0x59fc('0x19b')]['belongsTo'](db[_0x59fc('0xe4')],{'as':_0x59fc('0xe4'),'foreignKey':'SquareProjectId'});db[_0x59fc('0x19b')]['belongsToMany'](db[_0x59fc('0xf7')],{'as':_0x59fc('0x126'),'through':'campaigns_has_cm_lists'});db[_0x59fc('0x19b')]['belongsToMany'](db[_0x59fc('0xf7')],{'as':'BlackLists','through':_0x59fc('0x1d6')});db[_0x59fc('0xf1')][_0x59fc('0x11f')](db[_0x59fc('0x43')],{});db[_0x59fc('0xf1')]['belongsTo'](db['MailInteraction'],{});db[_0x59fc('0xf1')]['belongsTo'](db[_0x59fc('0x3c')],{'foreignKey':_0x59fc('0x1d7'),'as':'FromAccount'});db[_0x59fc('0xf1')][_0x59fc('0x11f')](db['User'],{'foreignKey':_0x59fc('0x1d8'),'as':'FromAgent'});db[_0x59fc('0xf1')][_0x59fc('0x11f')](db['User'],{'foreignKey':'ToUserId','as':_0x59fc('0x1d9')});db[_0x59fc('0xf1')][_0x59fc('0x11f')](db[_0x59fc('0x3e')],{'foreignKey':_0x59fc('0x1da'),'as':_0x59fc('0x1db')});db[_0x59fc('0xf1')][_0x59fc('0x11f')](db[_0x59fc('0x3c')],{'foreignKey':_0x59fc('0x1dc'),'as':_0x59fc('0x1dd')});db[_0x59fc('0xf3')]['belongsTo'](db[_0x59fc('0x6c')],{});db['ChatTransferReport'][_0x59fc('0x11f')](db['ChatInteraction'],{});db[_0x59fc('0xf3')]['belongsTo'](db[_0x59fc('0x65')],{'foreignKey':_0x59fc('0x1de'),'as':_0x59fc('0x1df')});db['ChatTransferReport'][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'foreignKey':'FromUserId','as':_0x59fc('0x1e0')});db[_0x59fc('0xf3')]['belongsTo'](db[_0x59fc('0x12')],{'foreignKey':_0x59fc('0x1e1'),'as':_0x59fc('0x1d9')});db[_0x59fc('0xf3')][_0x59fc('0x11f')](db['ChatQueue'],{'foreignKey':_0x59fc('0x1e2'),'as':_0x59fc('0x1db')});db[_0x59fc('0xf3')][_0x59fc('0x11f')](db[_0x59fc('0x65')],{'foreignKey':'ToChatWebsiteId','as':_0x59fc('0x1dd')});db[_0x59fc('0x1e3')][_0x59fc('0x11f')](db[_0x59fc('0x4f')],{});db[_0x59fc('0x1e3')][_0x59fc('0x11f')](db[_0x59fc('0x12c')],{});db['FaxTransferReport'][_0x59fc('0x11f')](db[_0x59fc('0x13d')],{'foreignKey':'FromFaxAccountId','as':_0x59fc('0x1df')});db[_0x59fc('0x1e3')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'foreignKey':_0x59fc('0x1d8'),'as':_0x59fc('0x1e0')});db['FaxTransferReport']['belongsTo'](db[_0x59fc('0x12')],{'foreignKey':_0x59fc('0x1e1'),'as':_0x59fc('0x1d9')});db['FaxTransferReport']['belongsTo'](db['FaxQueue'],{'foreignKey':_0x59fc('0x1e4'),'as':_0x59fc('0x1db')});db[_0x59fc('0x1e3')][_0x59fc('0x11f')](db[_0x59fc('0x13d')],{'foreignKey':'ToFaxAccountId','as':_0x59fc('0x1dd')});db[_0x59fc('0x1e5')][_0x59fc('0x11f')](db['OpenchannelMessage'],{});db[_0x59fc('0x1e5')][_0x59fc('0x11f')](db['OpenchannelInteraction'],{});db[_0x59fc('0x1e5')][_0x59fc('0x11f')](db[_0x59fc('0x5d')],{'foreignKey':_0x59fc('0x1e6'),'as':_0x59fc('0x1df')});db[_0x59fc('0x1e5')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'foreignKey':_0x59fc('0x1d8'),'as':'FromAgent'});db[_0x59fc('0x1e5')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'foreignKey':_0x59fc('0x1e1'),'as':_0x59fc('0x1d9')});db[_0x59fc('0x1e5')][_0x59fc('0x11f')](db['OpenchannelQueue'],{'foreignKey':_0x59fc('0x1e7'),'as':_0x59fc('0x1db')});db['OpenchannelTransferReport'][_0x59fc('0x11f')](db[_0x59fc('0x5d')],{'foreignKey':_0x59fc('0x1e8'),'as':_0x59fc('0x1dd')});db[_0x59fc('0xf6')]['belongsTo'](db[_0x59fc('0x5a')],{});db[_0x59fc('0xf6')][_0x59fc('0x11f')](db[_0x59fc('0x58')],{});db[_0x59fc('0xf6')][_0x59fc('0x11f')](db[_0x59fc('0x55')],{'foreignKey':'FromSmsAccountId','as':_0x59fc('0x1df')});db[_0x59fc('0xf6')]['belongsTo'](db[_0x59fc('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db['SmsTransferReport'][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'foreignKey':_0x59fc('0x1e1'),'as':_0x59fc('0x1d9')});db[_0x59fc('0xf6')][_0x59fc('0x11f')](db[_0x59fc('0x5b')],{'foreignKey':_0x59fc('0x1e9'),'as':_0x59fc('0x1db')});db[_0x59fc('0xf6')][_0x59fc('0x11f')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0x59fc('0x1dd')});db[_0x59fc('0xf7')][_0x59fc('0x112')](db[_0x59fc('0x86')],{'as':_0x59fc('0x16a'),'foreignKey':_0x59fc('0x17c')});db[_0x59fc('0xf7')][_0x59fc('0x112')](db[_0x59fc('0x7f')],{'as':_0x59fc('0x1ea'),'foreignKey':_0x59fc('0x17c')});db['CmList'][_0x59fc('0x112')](db[_0x59fc('0x74')],{'as':'Contacts','onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x17c')});db[_0x59fc('0xf7')][_0x59fc('0x112')](db['CmHopperFinal'],{'as':_0x59fc('0x116'),'foreignKey':_0x59fc('0x17c')});db[_0x59fc('0xf7')]['hasMany'](db[_0x59fc('0x7b')],{'as':_0x59fc('0x117'),'foreignKey':_0x59fc('0x17c')});db['CmList']['hasMany'](db[_0x59fc('0x7d')],{'as':'ReportAgentPreview','foreignKey':_0x59fc('0x17c')});db[_0x59fc('0xf7')][_0x59fc('0x120')](db['VoiceQueue'],{'as':_0x59fc('0x1eb'),'through':_0x59fc('0x159')});db[_0x59fc('0xf7')][_0x59fc('0x120')](db['User'],{'as':_0x59fc('0x15a'),'through':_0x59fc('0x127')});db[_0x59fc('0xf9')][_0x59fc('0x112')](db['VoiceExtension'],{'as':_0x59fc('0x115'),'onDelete':'cascade'});db[_0x59fc('0xf9')][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x15a'),'through':_0x59fc('0x13a')});db[_0x59fc('0xfb')][_0x59fc('0x112')](db[_0x59fc('0x12')],{'as':_0x59fc('0x178'),'foreignKey':_0x59fc('0x1ec')});db[_0x59fc('0xfb')][_0x59fc('0x112')](db[_0x59fc('0xfd')],{'as':_0x59fc('0x1ed'),'foreignKey':_0x59fc('0x1ec'),'onDelete':_0x59fc('0x110')});db['UserProfileSection'][_0x59fc('0x112')](db[_0x59fc('0xff')],{'as':_0x59fc('0x1ee'),'foreignKey':_0x59fc('0x1ef'),'onDelete':'cascade'});db[_0x59fc('0x145')][_0x59fc('0x112')](db[_0x59fc('0x86')],{'as':_0x59fc('0x16a'),'foreignKey':_0x59fc('0x1f0')});db[_0x59fc('0x145')]['hasMany'](db['CannedAnswer'],{'as':_0x59fc('0x17e'),'foreignKey':_0x59fc('0x1f0')});db['WhatsappAccount'][_0x59fc('0x112')](db['WhatsappMessage'],{'as':_0x59fc('0x15f'),'foreignKey':_0x59fc('0x1f0')});db[_0x59fc('0x145')][_0x59fc('0x112')](db[_0x59fc('0x105')],{'as':'Interactions'});db[_0x59fc('0x145')][_0x59fc('0x112')](db[_0x59fc('0x104')],{'as':_0x59fc('0x14a')});db[_0x59fc('0x145')][_0x59fc('0x11f')](db['CmList'],{'as':'List','foreignKey':_0x59fc('0x17c')});db[_0x59fc('0x145')][_0x59fc('0x11f')](db[_0x59fc('0x8c')],{'as':'mandatoryDispositionPause','foreignKey':_0x59fc('0x158')});db[_0x59fc('0x145')][_0x59fc('0x120')](db['User'],{'as':_0x59fc('0x15a'),'through':_0x59fc('0x1f1')});db['WhatsappApplication']['belongsTo'](db[_0x59fc('0x12')],{'onDelete':_0x59fc('0x17b')});db[_0x59fc('0x104')][_0x59fc('0x11f')](db[_0x59fc('0x10b')],{'onDelete':_0x59fc('0x17b')});db[_0x59fc('0x104')]['belongsTo'](db['WhatsappAccount'],{'onDelete':_0x59fc('0x17b')});db['WhatsappApplication'][_0x59fc('0x11f')](db[_0x59fc('0x8a')],{'onDelete':_0x59fc('0x17b'),'foreignKey':'IntervalId'});db[_0x59fc('0x104')][_0x59fc('0x11f')](db[_0x59fc('0x94')],{'onDelete':_0x59fc('0x17b'),'foreignKey':'TagId'});db[_0x59fc('0x105')][_0x59fc('0x112')](db[_0x59fc('0x107')],{'as':_0x59fc('0x15f'),'onDelete':_0x59fc('0x110'),'foreignKey':_0x59fc('0x1f2')});db[_0x59fc('0x105')][_0x59fc('0x11f')](db[_0x59fc('0x145')],{'as':'Account','foreignKey':_0x59fc('0x1f0')});db[_0x59fc('0x105')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x59fc('0x105')]['belongsTo'](db[_0x59fc('0x12')],{'as':'Owner','foreignKey':_0x59fc('0x111')});db['WhatsappInteraction'][_0x59fc('0x120')](db[_0x59fc('0x94')],{'through':'whatsapp_interaction_has_tags','as':_0x59fc('0x176')});db[_0x59fc('0x105')]['belongsToMany'](db[_0x59fc('0x94')],{'through':_0x59fc('0x1ae'),'as':_0x59fc('0x177')});db[_0x59fc('0x105')][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':'Users','through':_0x59fc('0x130'),'foreignKey':'WhatsappInteractionId'});db[_0x59fc('0x107')][_0x59fc('0x11f')](db['User'],{'as':_0x59fc('0x12')});db[_0x59fc('0x107')][_0x59fc('0x11f')](db[_0x59fc('0x74')],{'onDelete':_0x59fc('0x110'),'as':'Contact'});db[_0x59fc('0x107')][_0x59fc('0x11f')](db[_0x59fc('0x105')],{'onDelete':'cascade','as':_0x59fc('0x17a'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage']['belongsTo'](db[_0x59fc('0x145')],{'as':_0x59fc('0x173'),'foreignKey':_0x59fc('0x1f0')});db['WhatsappQueueReport'][_0x59fc('0x11f')](db[_0x59fc('0x145')],{});db[_0x59fc('0x108')][_0x59fc('0x11f')](db['CmList'],{'as':_0x59fc('0x16d'),'foreignKey':_0x59fc('0x17c')});db[_0x59fc('0x108')][_0x59fc('0x11f')](db[_0x59fc('0x74')],{'as':_0x59fc('0x165'),'foreignKey':_0x59fc('0x166')});db['WhatsappQueueReport'][_0x59fc('0x11f')](db[_0x59fc('0x105')],{});db['WhatsappQueueReport'][_0x59fc('0x11f')](db[_0x59fc('0x10b')],{});db['WhatsappQueueReport'][_0x59fc('0x11f')](db[_0x59fc('0x107')],{});db[_0x59fc('0x108')][_0x59fc('0x11f')](db[_0x59fc('0x12')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x59fc('0x107')],{});db[_0x59fc('0x1f3')][_0x59fc('0x11f')](db[_0x59fc('0x105')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x59fc('0x145')],{'foreignKey':_0x59fc('0x1f4'),'as':_0x59fc('0x1df')});db[_0x59fc('0x1f3')][_0x59fc('0x11f')](db[_0x59fc('0x145')],{'foreignKey':_0x59fc('0x1f5'),'as':'ToAccount'});db[_0x59fc('0x1f3')][_0x59fc('0x11f')](db[_0x59fc('0x10b')],{'foreignKey':_0x59fc('0x1f6'),'as':'ToQueue'});db['WhatsappTransferReport']['belongsTo'](db[_0x59fc('0x12')],{'foreignKey':'FromUserId','as':_0x59fc('0x1e0')});db['WhatsappTransferReport'][_0x59fc('0x11f')](db[_0x59fc('0x12')],{'foreignKey':_0x59fc('0x1e1'),'as':_0x59fc('0x1d9')});db[_0x59fc('0x10b')][_0x59fc('0x120')](db[_0x59fc('0x12')],{'as':_0x59fc('0x15a'),'through':_0x59fc('0x39'),'foreignKey':_0x59fc('0x1f7')});db['WhatsappQueue'][_0x59fc('0x120')](db[_0x59fc('0x128')],{'through':'team_has_whatsapp_queues','as':_0x59fc('0x15b')});module[_0x59fc('0x1f8')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x8958=['Teams','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','MailInteractionId','Attachment','Attachments','Interaction','restrict','Interval','List','Items','FaxAccountId','Exntensions','user_has_fax_accounts','TagId','FaxInteractionId','fax_interaction_has_tags','Users','AttachmentId','UserFaxQueue','team_has_fax_queues','SmsAccountId','Applications','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatWebsiteId','ChatProactiveAction','ProactiveActions','ChatMessage','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroup','ChatInternalMessage','ChatGroupId','CmCompany','CompanyId','HopperHistories','Company','cm_contact_has_tags','OwnerId','CampaignId','Automation','All','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','CustomReportId','AnalyticMetric','MetricId','SalesforceConfiguration','Configurations','Subjects','SubjectId','DescriptionId','Fields','FieldId','AccountId','Subject','Description','Field','Variable','VariableId','Descriptions','DeskAccount','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','VtigerAccount','ServicenowField','Dynamics365Configuration','Dynamics365Field','FreshsalesField','ToId','JscriptyProject','ProjectId','user_has_square_projects','team_has_voice_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromUserId','ToUserId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','ToAccount','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','CmCustomField','voice_queues_has_cm_lists','user_has_voice_prefixes','userProfileId','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','motion2','xcall','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','defaultsDeep','xC@LL1234','utf8_general_ci','database','username','options','password','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailQueueReport','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopperBlack/cmHopperBlack.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Integration','../api/integration/integration.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','VoicePrefix','../api/userProfile/userProfile.model','UserProfileResource','../api/notification/notification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','cascade','UserId','Recordings','UserVoiceQueueRt','hasMany','Extensions','HopperHistory','OpenchannelInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','Notification','Notifications','SenderId','belongsTo','UserProfile','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueue','MailQueues','ChatQueues','UserChatQueue','FaxQueues','UserOpenchannelQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccount','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','VoiceMusicOnHold','Sounds','Members','Hoppers','CmHopperFinal','HopperFinals','VoiceQueueId','CmHopperBlack','HopperBlacks','JscriptySessionReport','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','Agents','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','AgentReports','uniqueid','Contact','ContactId','MailAccountId','MailServerOut','hasOne','Imap','Dispositions','Answers','Interactions','MailApplication','ListId','Template','TemplateId','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues'];(function(_0x2c1799,_0x5c2d41){var _0x343a49=function(_0x354b87){while(--_0x354b87){_0x2c1799['push'](_0x2c1799['shift']());}};_0x343a49(++_0x5c2d41);}(_0x8958,0x93));var _0x8895=function(_0x421cbc,_0x7c2f9c){_0x421cbc=_0x421cbc-0x0;var _0x15fe7c=_0x8958[_0x421cbc];return _0x15fe7c;};'use strict';var path=require('path');var config=require(_0x8895('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require('jstz');var timezone=jstz['determine']();config[_0x8895('0x1')]=_['defaultsDeep'](config[_0x8895('0x1')],{'database':_0x8895('0x2'),'username':_0x8895('0x3'),'password':'xC@LL1234','options':{'host':_0x8895('0x4'),'port':0xcea,'dialect':_0x8895('0x5'),'dialectOptions':{'charset':_0x8895('0x6')},'logging':![],'timezone':timezone[_0x8895('0x7')](),'define':{'charset':_0x8895('0x8'),'collate':'utf8_general_ci'}}});config[_0x8895('0x9')]=_[_0x8895('0xa')](config[_0x8895('0x9')],{'database':_0x8895('0x2'),'username':_0x8895('0x3'),'password':_0x8895('0xb'),'options':{'host':_0x8895('0x4'),'port':0xcea,'dialect':_0x8895('0x5'),'dialectOptions':{'charset':_0x8895('0x6')},'logging':![],'timezone':timezone[_0x8895('0x7')](),'define':{'charset':'utf8','collate':_0x8895('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8895('0x1')][_0x8895('0xd')],config[_0x8895('0x1')][_0x8895('0xe')],config[_0x8895('0x1')]['password'],config[_0x8895('0x1')][_0x8895('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8895('0x9')]['database'],config['sequelizeHistory'][_0x8895('0xe')],config['sequelizeHistory'][_0x8895('0x10')],config[_0x8895('0x9')][_0x8895('0xf')])};db[_0x8895('0x11')]=db[_0x8895('0x1')]['import'](_0x8895('0x12'));db[_0x8895('0x13')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x15'));db[_0x8895('0x16')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x17'));db[_0x8895('0x18')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x19'));db['VoiceMusicOnHold']=db['sequelize']['import'](_0x8895('0x1a'));db[_0x8895('0x1b')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x1c'));db[_0x8895('0x1d')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/voiceRecording/voiceRecording.model');db[_0x8895('0x1e')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x1f'));db[_0x8895('0x20')]=db['sequelize']['import'](_0x8895('0x21'));db[_0x8895('0x22')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x8895('0x23')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0x8895('0x1')]['import'](_0x8895('0x24'));db[_0x8895('0x25')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x26'));db['VoiceQueueReport']=db['sequelize'][_0x8895('0x14')](_0x8895('0x27'));db[_0x8895('0x28')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/memberReport/memberReport.model');db['Trunk']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x29'));db[_0x8895('0x2a')]=db[_0x8895('0x1')]['import'](_0x8895('0x2b'));db['UserVoiceQueueRt']=db[_0x8895('0x1')]['import'](_0x8895('0x2c'));db[_0x8895('0x2d')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x2e'));db['UserChatQueue']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x2f'));db[_0x8895('0x30')]=db[_0x8895('0x1')]['import'](_0x8895('0x31'));db['UserFaxQueue']=db[_0x8895('0x1')]['import'](_0x8895('0x32'));db[_0x8895('0x33')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x34'));db['UserOpenchannelQueue']=db[_0x8895('0x1')]['import'](_0x8895('0x35'));db[_0x8895('0x36')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x37'));db[_0x8895('0x38')]=db['sequelize'][_0x8895('0x14')](_0x8895('0x39'));db['MailServerOut']=db[_0x8895('0x1')]['import'](_0x8895('0x3a'));db[_0x8895('0x3b')]=db['sequelize'][_0x8895('0x14')](_0x8895('0x3c'));db['MailQueue']=db['sequelize'][_0x8895('0x14')](_0x8895('0x3d'));db[_0x8895('0x3e')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0x8895('0x3f')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x40'));db[_0x8895('0x41')]=db[_0x8895('0x1')]['import'](_0x8895('0x42'));db['MailApplication']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/mailApplication/mailApplication.model');db[_0x8895('0x43')]=db['sequelize'][_0x8895('0x14')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db['sequelize']['import']('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/faxAccount/faxAccount.model');db[_0x8895('0x44')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x45'));db[_0x8895('0x46')]=db['sequelize']['import']('../api/faxInteraction/faxInteraction.model');db[_0x8895('0x47')]=db['sequelize'][_0x8895('0x14')](_0x8895('0x48'));db[_0x8895('0x49')]=db[_0x8895('0x1')]['import'](_0x8895('0x4a'));db[_0x8895('0x4b')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x4c'));db[_0x8895('0x4d')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/smsAccount/smsAccount.model');db[_0x8895('0x4e')]=db[_0x8895('0x1')]['import'](_0x8895('0x4f'));db['SmsInteraction']=db['sequelize'][_0x8895('0x14')](_0x8895('0x50'));db[_0x8895('0x51')]=db['sequelize'][_0x8895('0x14')]('../api/smsMessage/smsMessage.model');db[_0x8895('0x52')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x53'));db[_0x8895('0x54')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/openchannelApplication/openchannelApplication.model');db[_0x8895('0x55')]=db['sequelize']['import'](_0x8895('0x56'));db['OpenchannelMessage']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x57'));db[_0x8895('0x58')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x59'));db[_0x8895('0x5a')]=db['sequelize'][_0x8895('0x14')](_0x8895('0x5b'));db[_0x8895('0x5c')]=db['sequelize'][_0x8895('0x14')](_0x8895('0x5d'));db[_0x8895('0x5e')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x5f'));db[_0x8895('0x60')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x61'));db['ChatMessage']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x62'));db[_0x8895('0x63')]=db[_0x8895('0x1')]['import'](_0x8895('0x64'));db[_0x8895('0x65')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x66'));db['ChatGroup']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x67'));db['ChatProactiveAction']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x68'));db['CmCompany']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/cmCompany/cmCompany.model');db[_0x8895('0x69')]=db[_0x8895('0x1')]['import'](_0x8895('0x6a'));db[_0x8895('0x6b')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x6c'));db['CmHopperFinal']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x8895('0x6d')]=db['sequelize'][_0x8895('0x14')](_0x8895('0x6e'));db[_0x8895('0x6f')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/cmCustomField/cmCustomField.model');db[_0x8895('0x70')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x71'));db['Automation']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x72'));db[_0x8895('0x73')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x74'));db[_0x8895('0x75')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x76'));db[_0x8895('0x77')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x78'));db['Interval']=db['sequelize']['import'](_0x8895('0x79'));db[_0x8895('0x7a')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x7b'));db['Cdr']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/cdr/cdr.model');db[_0x8895('0x7c')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x7d'));db[_0x8895('0x7e')]=db['sequelize'][_0x8895('0x14')](_0x8895('0x7f'));db[_0x8895('0x80')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x81'));db[_0x8895('0x82')]=db['sequelize'][_0x8895('0x14')](_0x8895('0x83'));db['Template']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x84'));db[_0x8895('0x85')]=db[_0x8895('0x1')]['import'](_0x8895('0x86'));db['Variable']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/variable/variable.model');db[_0x8895('0x87')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x88'));db['IntegrationReport']=db[_0x8895('0x1')]['import']('../api/integrationReport/integrationReport.model');db[_0x8895('0x89')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x8895('0x8a')]=db['sequelize'][_0x8895('0x14')](_0x8895('0x8b'));db[_0x8895('0x8c')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0x8895('0x1')]['import'](_0x8895('0x8d'));db[_0x8895('0x8e')]=db['sequelize'][_0x8895('0x14')](_0x8895('0x8f'));db[_0x8895('0x90')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x8895('0x91')]=db['sequelize']['import'](_0x8895('0x92'));db['SalesforceConfiguration']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x93'));db[_0x8895('0x94')]=db['sequelize']['import']('../api/intSalesforceField/intSalesforceField.model');db[_0x8895('0x95')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x96'));db[_0x8895('0x97')]=db[_0x8895('0x1')]['import'](_0x8895('0x98'));db[_0x8895('0x99')]=db[_0x8895('0x1')]['import'](_0x8895('0x9a'));db['DeskAccount']=db[_0x8895('0x1')]['import'](_0x8895('0x9b'));db[_0x8895('0x9c')]=db['sequelize'][_0x8895('0x14')](_0x8895('0x9d'));db['DeskField']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x9e'));db[_0x8895('0x9f')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xa0'));db['ZohoConfiguration']=db[_0x8895('0x1')]['import'](_0x8895('0xa1'));db[_0x8895('0xa2')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/intZohoField/intZohoField.model');db[_0x8895('0xa3')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xa4'));db[_0x8895('0xa5')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xa6'));db['ZendeskField']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xa7'));db[_0x8895('0xa8')]=db['sequelize']['import'](_0x8895('0xa9'));db[_0x8895('0xaa')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xab'));db['VtigerAccount']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x8895('0xac')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xad'));db[_0x8895('0xae')]=db[_0x8895('0x1')]['import'](_0x8895('0xaf'));db[_0x8895('0xb0')]=db['sequelize']['import']('../api/intServicenowAccount/intServicenowAccount.model');db[_0x8895('0xb1')]=db[_0x8895('0x1')]['import'](_0x8895('0xb2'));db['ServicenowField']=db['sequelize']['import'](_0x8895('0xb3'));db[_0x8895('0xb4')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xb5'));db['Dynamics365Configuration']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xb6'));db['Dynamics365Field']=db['sequelize']['import'](_0x8895('0xb7'));db[_0x8895('0xb8')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xb9'));db[_0x8895('0xba')]=db[_0x8895('0x1')]['import'](_0x8895('0xbb'));db['FreshsalesField']=db[_0x8895('0x1')]['import'](_0x8895('0xbc'));db[_0x8895('0x87')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0x88'));db[_0x8895('0xbd')]=db[_0x8895('0x1')]['import'](_0x8895('0xbe'));db[_0x8895('0xbf')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xc0'));db['ChatInternalMessage']=db[_0x8895('0x1')]['import'](_0x8895('0xc1'));db[_0x8895('0xc2')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xc3'));db[_0x8895('0xc4')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xc5'));db['JscriptySessionReport']=db[_0x8895('0x1')]['import'](_0x8895('0xc6'));db[_0x8895('0xc7')]=db[_0x8895('0x1')]['import'](_0x8895('0xc8'));db['SquareReport']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xc9'));db[_0x8895('0xca')]=db['sequelize']['import'](_0x8895('0xcb'));db['JscriptyProject']=db['sequelize'][_0x8895('0x14')]('../api/jscriptyProject/jscriptyProject.model');db[_0x8895('0xcc')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xcd'));db[_0x8895('0xce')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xcf'));db[_0x8895('0xd0')]=db['sequelize'][_0x8895('0x14')](_0x8895('0xd1'));db[_0x8895('0xd2')]=db['sequelize'][_0x8895('0x14')](_0x8895('0xd3'));db[_0x8895('0xd4')]=db['sequelize'][_0x8895('0x14')](_0x8895('0xd5'));db[_0x8895('0xd6')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xd7'));db[_0x8895('0xd8')]=db['sequelize'][_0x8895('0x14')](_0x8895('0xd9'));db[_0x8895('0xda')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xdb'));db['Migration']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/migration/migration.model');db['Attachment']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/attachment/attachment.model');db[_0x8895('0xdc')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xdd'));db[_0x8895('0xde')]=db['sequelize'][_0x8895('0x14')](_0x8895('0xdf'));db[_0x8895('0xe0')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xe1'));db[_0x8895('0xe2')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xe3'));db[_0x8895('0xe4')]=db[_0x8895('0x1')]['import'](_0x8895('0xe5'));db[_0x8895('0xe6')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/smsTransferReport/smsTransferReport.model');db[_0x8895('0xe7')]=db[_0x8895('0x1')]['import']('../api/cmList/cmList.model');db[_0x8895('0xe8')]=db['sequelize'][_0x8895('0x14')]('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0x8895('0x1')]['import'](_0x8895('0xe9'));db['UserProfileSection']=db[_0x8895('0x1')][_0x8895('0x14')]('../api/userProfileSection/userProfileSection.model');db[_0x8895('0xea')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/userProfileResource/userProfileResource.model');db['Notification']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xeb'));db[_0x8895('0xec')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xed'));db[_0x8895('0xee')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xef'));db[_0x8895('0xf0')]=db[_0x8895('0x1')][_0x8895('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x8895('0xf1')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xf2'));db['WhatsappQueueReport']=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xf3'));db[_0x8895('0xf4')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xf5'));db[_0x8895('0xf6')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xf7'));db[_0x8895('0xf8')]=db[_0x8895('0x1')][_0x8895('0x14')](_0x8895('0xf9'));db[_0x8895('0x11')]['hasOne'](db[_0x8895('0x20')],{'as':'VoiceMail','onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0xfb')});db[_0x8895('0x11')]['hasMany'](db[_0x8895('0x1d')],{'as':_0x8895('0xfc'),'foreignKey':'UserId'});db[_0x8895('0x11')]['hasMany'](db[_0x8895('0xfd')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0x8895('0x11')][_0x8895('0xfe')](db[_0x8895('0x18')],{'as':_0x8895('0xff'),'onDelete':_0x8895('0xfa'),'hooks':!![]});db['User'][_0x8895('0xfe')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x8895('0xfb')});db[_0x8895('0x11')]['hasMany'](db[_0x8895('0x6d')],{'as':_0x8895('0x100'),'foreignKey':_0x8895('0xfb')});db['User'][_0x8895('0xfe')](db[_0x8895('0x6f')],{'as':_0x8895('0x6f'),'foreignKey':'UserId'});db[_0x8895('0x11')][_0x8895('0xfe')](db[_0x8895('0x55')],{'as':_0x8895('0x101'),'foreignKey':_0x8895('0xfb')});db[_0x8895('0x11')][_0x8895('0xfe')](db[_0x8895('0x60')],{'as':'ChatInteractions','foreignKey':'UserId'});db[_0x8895('0x11')]['hasMany'](db[_0x8895('0x102')],{'as':_0x8895('0x103'),'foreignKey':_0x8895('0xfb')});db[_0x8895('0x11')][_0x8895('0xfe')](db[_0x8895('0x46')],{'as':_0x8895('0x104'),'foreignKey':_0x8895('0xfb')});db[_0x8895('0x11')][_0x8895('0xfe')](db[_0x8895('0x3f')],{'as':_0x8895('0x105'),'foreignKey':'UserId'});db[_0x8895('0x11')][_0x8895('0xfe')](db[_0x8895('0xf0')],{'as':_0x8895('0x106'),'foreignKey':_0x8895('0xfb')});db[_0x8895('0x11')][_0x8895('0xfe')](db[_0x8895('0x107')],{'as':_0x8895('0x108'),'foreignKey':_0x8895('0x109')});db[_0x8895('0x11')][_0x8895('0x10a')](db[_0x8895('0x10b')],{'as':_0x8895('0x10b'),'foreignKey':'userProfileId'});db[_0x8895('0x11')]['belongsToMany'](db['ChatGroup'],{'as':'Groups','through':_0x8895('0x10c')});db[_0x8895('0x11')][_0x8895('0x10d')](db['CmContact'],{'as':_0x8895('0x10e'),'through':_0x8895('0x10f')});db[_0x8895('0x11')]['belongsToMany'](db[_0x8895('0xe7')],{'as':_0x8895('0x110'),'through':_0x8895('0x111')});db['User'][_0x8895('0x10d')](db[_0x8895('0xd6')],{'through':_0x8895('0x112')});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0x3f')],{'as':'MailInteractions','through':_0x8895('0x113')});db[_0x8895('0x11')]['belongsToMany'](db[_0x8895('0x60')],{'as':_0x8895('0x114'),'through':_0x8895('0x115')});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0x46')],{'as':_0x8895('0x104'),'through':_0x8895('0x116')});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0x102')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0x55')],{'as':_0x8895('0x101'),'through':_0x8895('0x117')});db[_0x8895('0x11')][_0x8895('0x10d')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0x8895('0x118')});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0x1b')],{'as':_0x8895('0x119'),'through':_0x8895('0x2d'),'required':![]});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0x11a')],{'as':_0x8895('0x11b'),'through':'UserMailQueue','required':![]});db[_0x8895('0x11')]['belongsToMany'](db[_0x8895('0x65')],{'as':_0x8895('0x11c'),'through':_0x8895('0x11d'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db['FaxQueue'],{'as':_0x8895('0x11e'),'through':'UserFaxQueue','required':![]});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0x52')],{'as':'SmsQueues','through':_0x8895('0x33'),'required':![]});db[_0x8895('0x11')]['belongsToMany'](db[_0x8895('0x58')],{'as':'OpenchannelQueues','through':_0x8895('0x11f'),'required':![]});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0xf6')],{'as':_0x8895('0x120'),'through':'UserWhatsappQueue','required':![]});db['User'][_0x8895('0x10d')](db[_0x8895('0xe7')],{'through':_0x8895('0x111')});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0xe8')],{'as':'VoicePrefixes','through':'user_has_voice_prefixes','required':![]});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0x5a')],{'as':_0x8895('0x121'),'through':_0x8895('0x122')});db['User']['belongsToMany'](db[_0x8895('0x123')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0x8895('0x11')][_0x8895('0x10d')](db['MailAccount'],{'as':_0x8895('0x124'),'through':'user_has_mail_accounts'});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0x54')],{'as':_0x8895('0x125'),'through':_0x8895('0x126')});db[_0x8895('0x11')]['belongsToMany'](db[_0x8895('0x4d')],{'as':_0x8895('0x127'),'through':_0x8895('0x128')});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0xec')],{'as':'WhatsappAccounts','through':_0x8895('0x129')});db[_0x8895('0x11')][_0x8895('0x10d')](db[_0x8895('0xd0')],{'as':_0x8895('0x12a'),'through':'user_has_square_projects'});db['VoiceChanSpy']['hasMany'](db[_0x8895('0x18')],{'as':_0x8895('0x12b'),'onDelete':_0x8895('0xfa'),'foreignKey':'ChanSpyId'});db['VoiceContext'][_0x8895('0xfe')](db[_0x8895('0x18')],{'onDelete':_0x8895('0xfa')});db[_0x8895('0x18')][_0x8895('0xfe')](db[_0x8895('0x18')],{'as':'Applications','onDelete':'cascade'});db[_0x8895('0x12c')][_0x8895('0x10d')](db['Sound'],{'as':_0x8895('0x12d'),'through':'moh_has_sounds'});db['VoiceQueue'][_0x8895('0xfe')](db[_0x8895('0xfd')],{'as':_0x8895('0x12e'),'foreignKey':'VoiceQueueId'});db[_0x8895('0x1b')]['hasMany'](db[_0x8895('0x6b')],{'as':_0x8895('0x12f'),'foreignKey':'VoiceQueueId'});db[_0x8895('0x1b')]['hasMany'](db[_0x8895('0x130')],{'as':_0x8895('0x131'),'foreignKey':_0x8895('0x132')});db[_0x8895('0x1b')]['hasMany'](db[_0x8895('0x6d')],{'as':'HopperHistories','foreignKey':_0x8895('0x132')});db[_0x8895('0x1b')][_0x8895('0xfe')](db[_0x8895('0x6f')],{'as':_0x8895('0x6f'),'foreignKey':_0x8895('0x132')});db[_0x8895('0x1b')][_0x8895('0xfe')](db[_0x8895('0x133')],{'as':_0x8895('0x134'),'foreignKey':_0x8895('0x132')});db['VoiceQueue'][_0x8895('0xfe')](db[_0x8895('0x135')],{'as':_0x8895('0x136'),'foreignKey':'VoiceQueueId'});db[_0x8895('0x1b')][_0x8895('0x10a')](db['Trunk'],{'as':_0x8895('0x137'),'foreignKey':_0x8895('0x138')});db[_0x8895('0x1b')][_0x8895('0x10a')](db[_0x8895('0x137')],{'as':_0x8895('0x139'),'foreignKey':_0x8895('0x13a')});db[_0x8895('0x1b')][_0x8895('0x10a')](db['Interval'],{'as':'Interval','foreignKey':_0x8895('0x13b')});db['VoiceQueue'][_0x8895('0x10a')](db[_0x8895('0x7a')],{'as':_0x8895('0x13c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8895('0x1b')]['belongsToMany'](db[_0x8895('0xe7')],{'as':_0x8895('0x110'),'through':'voice_queues_has_cm_lists'});db[_0x8895('0x1b')][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':_0x8895('0x13d'),'through':_0x8895('0x2d')});db['VoiceQueue'][_0x8895('0x10d')](db[_0x8895('0xd6')],{'as':'Teams','through':'team_has_voice_queues'});db[_0x8895('0x1b')]['belongsToMany'](db[_0x8895('0xe7')],{'as':_0x8895('0x13e'),'through':_0x8895('0x13f')});db[_0x8895('0x1d')][_0x8895('0x10a')](db[_0x8895('0x11')],{'as':'User','foreignKey':_0x8895('0xfb')});db[_0x8895('0x1e')][_0x8895('0x10a')](db[_0x8895('0x11')],{'as':_0x8895('0x11'),'foreignKey':_0x8895('0xfb')});db[_0x8895('0x20')]['hasMany'](db['VoiceMailMessage'],{'as':_0x8895('0x140'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x141'),'sourceKey':_0x8895('0x142')});db['VoiceMailMessage']['belongsTo'](db[_0x8895('0x20')],{'foreignKey':_0x8895('0x141'),'targetKey':_0x8895('0x142')});db[_0x8895('0x23')][_0x8895('0xfe')](db[_0x8895('0x143')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db[_0x8895('0x23')][_0x8895('0xfe')](db[_0x8895('0x25')],{'as':_0x8895('0x144'),'foreignKey':_0x8895('0x145'),'constraints':![]});db[_0x8895('0x23')][_0x8895('0x10a')](db[_0x8895('0x11')],{'as':_0x8895('0x11'),'foreignKey':'UserId'});db[_0x8895('0x23')][_0x8895('0x10a')](db['CmContact'],{'as':_0x8895('0x146'),'foreignKey':_0x8895('0x147')});db[_0x8895('0x38')][_0x8895('0x10a')](db[_0x8895('0x3b')],{'as':_0x8895('0x3b'),'foreignKey':_0x8895('0x148')});db[_0x8895('0x149')]['belongsTo'](db['MailAccount'],{'as':_0x8895('0x3b'),'foreignKey':_0x8895('0x148')});db[_0x8895('0x3b')][_0x8895('0x14a')](db[_0x8895('0x38')],{'as':_0x8895('0x14b'),'onDelete':'cascade'});db[_0x8895('0x3b')][_0x8895('0x14a')](db[_0x8895('0x149')],{'as':'Smtp','onDelete':_0x8895('0xfa')});db[_0x8895('0x3b')][_0x8895('0xfe')](db['Disposition'],{'as':_0x8895('0x14c'),'foreignKey':'MailAccountId'});db[_0x8895('0x3b')][_0x8895('0xfe')](db[_0x8895('0x73')],{'as':_0x8895('0x14d'),'foreignKey':_0x8895('0x148')});db['MailAccount']['hasMany'](db[_0x8895('0x41')],{'as':'Messages','foreignKey':_0x8895('0x148')});db[_0x8895('0x3b')][_0x8895('0xfe')](db[_0x8895('0x3f')],{'as':_0x8895('0x14e')});db[_0x8895('0x3b')][_0x8895('0xfe')](db[_0x8895('0x14f')],{'as':'Applications'});db[_0x8895('0x3b')][_0x8895('0x10a')](db[_0x8895('0xe7')],{'as':'List','foreignKey':_0x8895('0x150')});db['MailAccount'][_0x8895('0x10a')](db[_0x8895('0x151')],{'as':_0x8895('0x151'),'foreignKey':_0x8895('0x152')});db[_0x8895('0x3b')][_0x8895('0x10a')](db['Pause'],{'as':_0x8895('0x13c'),'foreignKey':_0x8895('0x153')});db[_0x8895('0x3b')]['belongsToMany'](db[_0x8895('0x11')],{'as':'Agents','through':_0x8895('0x154')});db[_0x8895('0x11a')][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':_0x8895('0x13d'),'through':_0x8895('0x30')});db[_0x8895('0x11a')][_0x8895('0x10d')](db[_0x8895('0xd6')],{'through':_0x8895('0x155'),'as':_0x8895('0x156')});db['MailInteraction']['hasMany'](db[_0x8895('0x41')],{'as':_0x8895('0x140'),'onDelete':_0x8895('0xfa'),'foreignKey':'MailInteractionId'});db[_0x8895('0x3f')][_0x8895('0x10a')](db['MailAccount'],{'as':_0x8895('0x157'),'foreignKey':'MailAccountId'});db[_0x8895('0x3f')][_0x8895('0x10a')](db[_0x8895('0x69')],{'as':_0x8895('0x146'),'foreignKey':_0x8895('0x147')});db[_0x8895('0x3f')]['belongsTo'](db[_0x8895('0x11')],{'as':_0x8895('0x158'),'foreignKey':_0x8895('0xfb')});db[_0x8895('0x3f')][_0x8895('0x10d')](db[_0x8895('0x82')],{'through':_0x8895('0x159'),'as':_0x8895('0x15a')});db['MailInteraction'][_0x8895('0x10d')](db[_0x8895('0x82')],{'through':_0x8895('0x159'),'as':_0x8895('0x15b')});db[_0x8895('0x3f')][_0x8895('0x10d')](db['User'],{'as':'Users','through':_0x8895('0x113'),'foreignKey':_0x8895('0x15c')});db[_0x8895('0x41')][_0x8895('0xfe')](db[_0x8895('0x15d')],{'as':_0x8895('0x15e'),'onDelete':_0x8895('0xfa')});db['MailMessage']['belongsTo'](db[_0x8895('0x11')],{'as':'User'});db[_0x8895('0x41')][_0x8895('0x10a')](db[_0x8895('0x69')],{'onDelete':_0x8895('0xfa'),'as':'Contact'});db[_0x8895('0x41')][_0x8895('0x10a')](db[_0x8895('0x3f')],{'as':_0x8895('0x15f'),'foreignKey':'MailInteractionId'});db[_0x8895('0x41')][_0x8895('0x10a')](db['MailAccount'],{'as':_0x8895('0x157'),'foreignKey':_0x8895('0x148')});db[_0x8895('0x14f')][_0x8895('0x10a')](db[_0x8895('0x11')],{'onDelete':_0x8895('0x160')});db[_0x8895('0x14f')]['belongsTo'](db[_0x8895('0x11a')],{'onDelete':_0x8895('0x160')});db['MailApplication'][_0x8895('0x10a')](db[_0x8895('0x3b')],{'onDelete':'restrict'});db['MailApplication'][_0x8895('0x10a')](db[_0x8895('0x161')],{'onDelete':_0x8895('0x160'),'foreignKey':_0x8895('0x13b')});db[_0x8895('0x14f')][_0x8895('0x10a')](db[_0x8895('0x82')],{'onDelete':_0x8895('0x160'),'foreignKey':'TagId'});db[_0x8895('0x43')]['belongsTo'](db[_0x8895('0x3b')],{});db[_0x8895('0x43')][_0x8895('0x10a')](db[_0x8895('0xe7')],{'as':_0x8895('0x162'),'foreignKey':'ListId'});db[_0x8895('0x43')][_0x8895('0x10a')](db[_0x8895('0x69')],{'as':_0x8895('0x146'),'foreignKey':_0x8895('0x147')});db['MailQueueReport'][_0x8895('0x10a')](db[_0x8895('0x3f')],{});db['MailQueueReport']['belongsTo'](db[_0x8895('0x41')],{});db[_0x8895('0x43')][_0x8895('0x10a')](db[_0x8895('0x11')],{});db[_0x8895('0x43')][_0x8895('0x10a')](db[_0x8895('0x11a')],{});db['Dashboard'][_0x8895('0xfe')](db['DashboardItem'],{'as':_0x8895('0x163'),'onDelete':_0x8895('0xfa')});db['FaxAccount']['hasMany'](db[_0x8895('0x75')],{'as':_0x8895('0x14c'),'foreignKey':_0x8895('0x164')});db['FaxAccount'][_0x8895('0xfe')](db[_0x8895('0x73')],{'as':'Answers','foreignKey':_0x8895('0x164')});db[_0x8895('0x123')][_0x8895('0xfe')](db[_0x8895('0x46')],{'as':'Interactions'});db[_0x8895('0x123')]['hasMany'](db[_0x8895('0x44')],{'as':'Applications'});db[_0x8895('0x123')]['hasMany'](db['VoiceExtension'],{'as':_0x8895('0x165'),'onDelete':_0x8895('0xfa')});db[_0x8895('0x123')][_0x8895('0xfe')](db[_0x8895('0x47')],{'as':_0x8895('0x140')});db[_0x8895('0x123')]['belongsTo'](db['Trunk'],{'as':_0x8895('0x137')});db[_0x8895('0x123')][_0x8895('0x10a')](db[_0x8895('0xe7')],{'as':_0x8895('0x162'),'foreignKey':_0x8895('0x150')});db['FaxAccount'][_0x8895('0x10a')](db[_0x8895('0x7a')],{'as':_0x8895('0x13c'),'foreignKey':_0x8895('0x153')});db[_0x8895('0x123')][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':'Agents','through':_0x8895('0x166')});db[_0x8895('0x44')][_0x8895('0x10a')](db[_0x8895('0x11')],{'onDelete':_0x8895('0x160')});db[_0x8895('0x44')][_0x8895('0x10a')](db[_0x8895('0x49')],{'onDelete':_0x8895('0x160')});db['FaxApplication'][_0x8895('0x10a')](db[_0x8895('0x123')],{'onDelete':_0x8895('0x160')});db[_0x8895('0x44')][_0x8895('0x10a')](db[_0x8895('0x82')],{'onDelete':_0x8895('0x160'),'foreignKey':_0x8895('0x167')});db[_0x8895('0x46')]['hasMany'](db[_0x8895('0x47')],{'as':_0x8895('0x140'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x168')});db[_0x8895('0x46')][_0x8895('0x10a')](db[_0x8895('0x123')],{'as':_0x8895('0x157'),'foreignKey':_0x8895('0x164')});db[_0x8895('0x46')][_0x8895('0x10a')](db[_0x8895('0x69')],{'as':_0x8895('0x146'),'foreignKey':'ContactId'});db[_0x8895('0x46')][_0x8895('0x10a')](db[_0x8895('0x11')],{'as':_0x8895('0x158'),'foreignKey':_0x8895('0xfb')});db[_0x8895('0x46')]['belongsToMany'](db[_0x8895('0x82')],{'through':'fax_interaction_has_tags','as':_0x8895('0x15a')});db[_0x8895('0x46')][_0x8895('0x10d')](db[_0x8895('0x82')],{'through':_0x8895('0x169'),'as':_0x8895('0x15b')});db[_0x8895('0x46')][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':_0x8895('0x16a'),'through':_0x8895('0x116'),'foreignKey':_0x8895('0x168')});db[_0x8895('0x47')][_0x8895('0x10a')](db['User'],{'onDelete':'cascade','as':_0x8895('0x11')});db[_0x8895('0x47')]['belongsTo'](db[_0x8895('0x46')],{'as':_0x8895('0x15f'),'foreignKey':_0x8895('0x168')});db[_0x8895('0x47')][_0x8895('0x10a')](db[_0x8895('0x69')],{'onDelete':_0x8895('0xfa'),'as':_0x8895('0x146')});db[_0x8895('0x47')][_0x8895('0x10a')](db[_0x8895('0x15d')],{'as':_0x8895('0x15d'),'foreignKey':_0x8895('0x16b')});db[_0x8895('0x47')][_0x8895('0x10a')](db[_0x8895('0x123')],{'as':'Account','foreignKey':_0x8895('0x164')});db['FaxQueue'][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':_0x8895('0x13d'),'through':_0x8895('0x16c')});db['FaxQueue'][_0x8895('0x10d')](db['Team'],{'through':_0x8895('0x16d'),'as':'Teams'});db['FaxQueueReport']['belongsTo'](db[_0x8895('0x123')],{});db[_0x8895('0x4b')][_0x8895('0x10a')](db[_0x8895('0xe7')],{'as':'List','foreignKey':_0x8895('0x150')});db['FaxQueueReport'][_0x8895('0x10a')](db[_0x8895('0x69')],{'as':_0x8895('0x146'),'foreignKey':'ContactId'});db['FaxQueueReport']['belongsTo'](db[_0x8895('0x46')],{});db[_0x8895('0x4b')][_0x8895('0x10a')](db['FaxMessage'],{});db[_0x8895('0x4b')][_0x8895('0x10a')](db[_0x8895('0x11')],{});db[_0x8895('0x4b')][_0x8895('0x10a')](db['FaxQueue'],{});db[_0x8895('0x4d')]['hasMany'](db[_0x8895('0x75')],{'as':_0x8895('0x14c'),'foreignKey':'SmsAccountId'});db[_0x8895('0x4d')]['hasMany'](db[_0x8895('0x73')],{'as':_0x8895('0x14d'),'foreignKey':_0x8895('0x16e')});db[_0x8895('0x4d')]['hasMany'](db['SmsMessage'],{'as':_0x8895('0x140'),'foreignKey':_0x8895('0x16e')});db[_0x8895('0x4d')]['hasMany'](db['SmsInteraction'],{'as':_0x8895('0x14e')});db[_0x8895('0x4d')]['hasMany'](db[_0x8895('0x4e')],{'as':_0x8895('0x16f')});db['SmsAccount'][_0x8895('0x10a')](db[_0x8895('0xe7')],{'as':_0x8895('0x162'),'foreignKey':_0x8895('0x150')});db['SmsAccount'][_0x8895('0x10a')](db['Pause'],{'as':_0x8895('0x13c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8895('0x4d')]['belongsToMany'](db[_0x8895('0x11')],{'as':_0x8895('0x13d'),'through':_0x8895('0x128')});db[_0x8895('0x4e')][_0x8895('0x10a')](db[_0x8895('0x11')],{'onDelete':_0x8895('0x160')});db[_0x8895('0x4e')][_0x8895('0x10a')](db[_0x8895('0x52')],{'onDelete':_0x8895('0x160')});db[_0x8895('0x4e')][_0x8895('0x10a')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x8895('0x4e')]['belongsTo'](db[_0x8895('0x161')],{'onDelete':_0x8895('0x160'),'foreignKey':'IntervalId'});db[_0x8895('0x4e')]['belongsTo'](db[_0x8895('0x82')],{'onDelete':'restrict','foreignKey':_0x8895('0x167')});db[_0x8895('0x102')][_0x8895('0xfe')](db[_0x8895('0x51')],{'as':_0x8895('0x140'),'onDelete':'cascade','foreignKey':_0x8895('0x170')});db['SmsInteraction'][_0x8895('0x10a')](db['SmsAccount'],{'as':_0x8895('0x157'),'foreignKey':_0x8895('0x16e')});db[_0x8895('0x102')][_0x8895('0x10a')](db[_0x8895('0x69')],{'as':'Contact','foreignKey':_0x8895('0x147')});db[_0x8895('0x102')][_0x8895('0x10a')](db[_0x8895('0x11')],{'as':_0x8895('0x158'),'foreignKey':_0x8895('0xfb')});db[_0x8895('0x102')][_0x8895('0x10d')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x8895('0x15a')});db[_0x8895('0x102')]['belongsToMany'](db['Tag'],{'through':_0x8895('0x171'),'as':_0x8895('0x15b')});db[_0x8895('0x102')][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':_0x8895('0x16a'),'through':'user_has_sms_interactions','foreignKey':_0x8895('0x170')});db[_0x8895('0x51')]['belongsTo'](db[_0x8895('0x11')],{'as':_0x8895('0x11')});db['SmsMessage'][_0x8895('0x10a')](db['CmContact'],{'onDelete':'cascade','as':_0x8895('0x146')});db['SmsMessage'][_0x8895('0x10a')](db[_0x8895('0x102')],{'onDelete':'cascade','as':_0x8895('0x15f'),'foreignKey':_0x8895('0x170')});db[_0x8895('0x51')][_0x8895('0x10a')](db[_0x8895('0x4d')],{'as':'Account','foreignKey':_0x8895('0x16e')});db[_0x8895('0x52')]['belongsToMany'](db[_0x8895('0x11')],{'as':_0x8895('0x13d'),'through':'UserSmsQueue','foreignKey':_0x8895('0x172')});db[_0x8895('0x52')][_0x8895('0x10d')](db[_0x8895('0xd6')],{'through':'team_has_sms_queues','as':_0x8895('0x156')});db[_0x8895('0x54')][_0x8895('0xfe')](db[_0x8895('0x75')],{'as':_0x8895('0x14c'),'foreignKey':'OpenchannelAccountId'});db[_0x8895('0x54')][_0x8895('0xfe')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x8895('0x173')});db[_0x8895('0x54')][_0x8895('0xfe')](db[_0x8895('0x55')],{'as':_0x8895('0x14e'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x8895('0xfe')](db[_0x8895('0x174')],{'as':_0x8895('0x140'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0x8895('0x175')],{'as':'Applications','foreignKey':_0x8895('0x173')});db[_0x8895('0x54')][_0x8895('0x10a')](db[_0x8895('0xe7')],{'as':_0x8895('0x162'),'foreignKey':_0x8895('0x150')});db[_0x8895('0x54')]['belongsTo'](db[_0x8895('0x7a')],{'as':_0x8895('0x13c'),'foreignKey':_0x8895('0x153')});db[_0x8895('0x54')][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':_0x8895('0x13d'),'through':'user_has_openchannel_accounts'});db[_0x8895('0x175')][_0x8895('0x10a')](db['User'],{'onDelete':_0x8895('0x160')});db[_0x8895('0x175')][_0x8895('0x10a')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x8895('0x176')});db[_0x8895('0x175')]['belongsTo'](db[_0x8895('0x54')],{'onDelete':_0x8895('0x160'),'foreignKey':_0x8895('0x173')});db[_0x8895('0x175')][_0x8895('0x10a')](db[_0x8895('0x161')],{'onDelete':_0x8895('0x160'),'foreignKey':_0x8895('0x13b')});db[_0x8895('0x175')][_0x8895('0x10a')](db[_0x8895('0x82')],{'onDelete':'restrict','foreignKey':_0x8895('0x167')});db[_0x8895('0x55')][_0x8895('0xfe')](db[_0x8895('0x174')],{'as':_0x8895('0x140'),'onDelete':_0x8895('0xfa'),'foreignKey':'OpenchannelInteractionId'});db[_0x8895('0x55')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x8895('0x157'),'foreignKey':_0x8895('0x173')});db[_0x8895('0x55')][_0x8895('0x10a')](db['CmContact'],{'as':_0x8895('0x146'),'foreignKey':_0x8895('0x147')});db[_0x8895('0x55')][_0x8895('0x10a')](db[_0x8895('0x11')],{'as':_0x8895('0x158'),'foreignKey':_0x8895('0xfb')});db[_0x8895('0x55')][_0x8895('0x10d')](db[_0x8895('0x82')],{'through':_0x8895('0x177'),'as':'Tags'});db[_0x8895('0x55')][_0x8895('0x10d')](db[_0x8895('0x82')],{'through':_0x8895('0x177'),'as':_0x8895('0x15b')});db[_0x8895('0x55')][_0x8895('0x10d')](db['User'],{'as':_0x8895('0x16a'),'through':_0x8895('0x117'),'foreignKey':_0x8895('0x178')});db[_0x8895('0x174')][_0x8895('0x10a')](db['User'],{'onDelete':_0x8895('0xfa'),'as':_0x8895('0x11')});db['OpenchannelMessage'][_0x8895('0x10a')](db[_0x8895('0x69')],{'onDelete':_0x8895('0xfa'),'as':_0x8895('0x146')});db[_0x8895('0x174')][_0x8895('0x10a')](db[_0x8895('0x55')],{'onDelete':'cascade','as':_0x8895('0x15f'),'foreignKey':_0x8895('0x178')});db[_0x8895('0x174')][_0x8895('0x10a')](db[_0x8895('0x15d')],{'as':_0x8895('0x15d'),'foreignKey':_0x8895('0x16b')});db['OpenchannelMessage']['belongsTo'](db[_0x8895('0x54')],{'as':_0x8895('0x157'),'foreignKey':'OpenchannelAccountId'});db[_0x8895('0x58')][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':_0x8895('0x13d'),'through':'UserOpenchannelQueue','foreignKey':_0x8895('0x176')});db[_0x8895('0x58')]['belongsToMany'](db['Team'],{'through':_0x8895('0x179'),'as':_0x8895('0x156')});db['ChatWebsite']['hasMany'](db[_0x8895('0x75')],{'as':'Dispositions','foreignKey':_0x8895('0x17a')});db['ChatWebsite']['hasMany'](db[_0x8895('0x73')],{'as':_0x8895('0x14d'),'foreignKey':_0x8895('0x17a')});db[_0x8895('0x5a')]['hasMany'](db[_0x8895('0x17b')],{'as':_0x8895('0x17c')});db['ChatWebsite'][_0x8895('0xfe')](db['ChatInteraction'],{'as':_0x8895('0x14e')});db[_0x8895('0x5a')][_0x8895('0xfe')](db[_0x8895('0x5e')],{'as':_0x8895('0x16f')});db[_0x8895('0x5a')][_0x8895('0xfe')](db[_0x8895('0x17d')],{'as':_0x8895('0x140')});db['ChatWebsite']['belongsTo'](db[_0x8895('0xe7')],{'as':_0x8895('0x162'),'foreignKey':_0x8895('0x150')});db[_0x8895('0x5a')][_0x8895('0x10a')](db[_0x8895('0x161')],{'as':_0x8895('0x161'),'foreignKey':'IntervalId'});db['ChatWebsite']['belongsTo'](db[_0x8895('0x7a')],{'as':'mandatoryDispositionPause','foreignKey':_0x8895('0x153')});db[_0x8895('0x5a')][_0x8895('0x10d')](db['User'],{'as':_0x8895('0x13d'),'through':_0x8895('0x122')});db['OpenchannelQueueReport'][_0x8895('0x10a')](db[_0x8895('0x54')],{});db['OpenchannelQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x8895('0x150')});db['OpenchannelQueueReport'][_0x8895('0x10a')](db[_0x8895('0x69')],{'as':'Contact','foreignKey':_0x8895('0x147')});db['OpenchannelQueueReport'][_0x8895('0x10a')](db[_0x8895('0x55')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x8895('0x174')],{});db[_0x8895('0x5c')][_0x8895('0x10a')](db[_0x8895('0x11')],{});db[_0x8895('0x5c')][_0x8895('0x10a')](db[_0x8895('0x58')],{});db['ChatApplication'][_0x8895('0x10a')](db['User'],{'as':_0x8895('0x17e'),'foreignKey':_0x8895('0xfb'),'onDelete':'restrict'});db[_0x8895('0x5e')][_0x8895('0x10a')](db[_0x8895('0x65')],{'as':_0x8895('0x17f'),'foreignKey':_0x8895('0x180'),'onDelete':'restrict'});db[_0x8895('0x5e')]['belongsTo'](db['ChatWebsite'],{'as':_0x8895('0x181'),'foreignKey':'ChatWebsiteId','onDelete':_0x8895('0x160')});db['ChatApplication'][_0x8895('0x10a')](db[_0x8895('0x82')],{'onDelete':_0x8895('0x160'),'foreignKey':_0x8895('0x167')});db[_0x8895('0x60')][_0x8895('0xfe')](db[_0x8895('0x17d')],{'as':_0x8895('0x140'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x182')});db[_0x8895('0x60')][_0x8895('0x10a')](db[_0x8895('0x5a')],{'as':_0x8895('0x157'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x8895('0x10a')](db[_0x8895('0x69')],{'as':'Contact','foreignKey':_0x8895('0x147')});db[_0x8895('0x60')][_0x8895('0x10a')](db[_0x8895('0x11')],{'as':_0x8895('0x158'),'foreignKey':_0x8895('0xfb')});db[_0x8895('0x60')][_0x8895('0x10d')](db[_0x8895('0x82')],{'through':_0x8895('0x183'),'as':'Tags'});db['ChatInteraction']['belongsToMany'](db[_0x8895('0x82')],{'through':_0x8895('0x183'),'as':_0x8895('0x15b')});db['ChatInteraction'][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':'Users','through':_0x8895('0x115'),'foreignKey':_0x8895('0x182')});db[_0x8895('0x17d')][_0x8895('0x10a')](db['User'],{'onDelete':_0x8895('0xfa'),'as':'User'});db[_0x8895('0x17d')][_0x8895('0x10a')](db[_0x8895('0x69')],{'onDelete':_0x8895('0xfa'),'as':_0x8895('0x146'),'foreignKey':_0x8895('0x147')});db[_0x8895('0x17d')][_0x8895('0x10a')](db[_0x8895('0x60')],{'onDelete':_0x8895('0xfa'),'as':_0x8895('0x15f'),'foreignKey':_0x8895('0x182')});db[_0x8895('0x17d')]['belongsTo'](db[_0x8895('0x15d')],{'as':'Attachment','foreignKey':_0x8895('0x16b')});db[_0x8895('0x17d')][_0x8895('0x10a')](db[_0x8895('0x5a')],{'as':_0x8895('0x157'),'foreignKey':_0x8895('0x17a')});db[_0x8895('0x63')]['belongsTo'](db[_0x8895('0x69')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x8895('0x147')});db[_0x8895('0x63')][_0x8895('0x10a')](db[_0x8895('0x5a')],{'as':_0x8895('0x157'),'foreignKey':_0x8895('0x17a')});db[_0x8895('0x65')]['belongsToMany'](db[_0x8895('0x11')],{'as':_0x8895('0x13d'),'through':_0x8895('0x11d'),'hooks':!![]});db[_0x8895('0x65')][_0x8895('0x10d')](db[_0x8895('0xd6')],{'through':'team_has_chat_queues','as':_0x8895('0x156')});db[_0x8895('0x184')][_0x8895('0xfe')](db[_0x8895('0x185')],{'as':_0x8895('0x140'),'foreignKey':_0x8895('0x186'),'onDelete':'cascade'});db['ChatGroup'][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':_0x8895('0x12e'),'through':_0x8895('0x10c')});db[_0x8895('0x17b')][_0x8895('0x10a')](db[_0x8895('0x5a')],{'as':_0x8895('0x181'),'foreignKey':_0x8895('0x17a')});db[_0x8895('0x187')][_0x8895('0xfe')](db['CmContact'],{'as':_0x8895('0x10e'),'foreignKey':_0x8895('0x188')});db['CmContact'][_0x8895('0xfe')](db[_0x8895('0x6b')],{'as':_0x8895('0x12f'),'foreignKey':'ContactId'});db[_0x8895('0x69')][_0x8895('0xfe')](db['CmHopperFinal'],{'as':_0x8895('0x131'),'foreignKey':'ContactId'});db[_0x8895('0x69')][_0x8895('0xfe')](db['CmHopperHistory'],{'as':_0x8895('0x189'),'foreignKey':_0x8895('0x147')});db[_0x8895('0x69')][_0x8895('0xfe')](db[_0x8895('0x6f')],{'as':_0x8895('0x6f'),'foreignKey':_0x8895('0x147')});db[_0x8895('0x69')][_0x8895('0xfe')](db[_0x8895('0x135')],{'as':_0x8895('0x136'),'foreignKey':_0x8895('0x147')});db['CmContact']['hasMany'](db[_0x8895('0x55')],{'as':_0x8895('0x101'),'foreignKey':_0x8895('0x147'),'onDelete':_0x8895('0x160')});db[_0x8895('0x69')][_0x8895('0xfe')](db[_0x8895('0x60')],{'as':_0x8895('0x114'),'foreignKey':_0x8895('0x147'),'onDelete':_0x8895('0x160')});db[_0x8895('0x69')]['hasMany'](db[_0x8895('0x102')],{'as':_0x8895('0x103'),'foreignKey':_0x8895('0x147'),'onDelete':_0x8895('0x160')});db[_0x8895('0x69')][_0x8895('0xfe')](db[_0x8895('0x46')],{'as':_0x8895('0x104'),'foreignKey':_0x8895('0x147'),'onDelete':'restrict'});db[_0x8895('0x69')][_0x8895('0xfe')](db[_0x8895('0x3f')],{'as':_0x8895('0x105'),'foreignKey':_0x8895('0x147'),'onDelete':'restrict'});db[_0x8895('0x69')][_0x8895('0x10a')](db[_0x8895('0x187')],{'as':_0x8895('0x18a'),'foreignKey':_0x8895('0x188')});db[_0x8895('0x69')][_0x8895('0x10a')](db['CmList'],{'as':_0x8895('0x162'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x8895('0x69')][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':_0x8895('0x16a'),'through':_0x8895('0x10f')});db[_0x8895('0x69')]['belongsToMany'](db[_0x8895('0x82')],{'as':_0x8895('0x15a'),'through':_0x8895('0x18b')});db[_0x8895('0x69')][_0x8895('0x10d')](db[_0x8895('0x82')],{'through':_0x8895('0x18b'),'as':_0x8895('0x15b')});db[_0x8895('0x6b')][_0x8895('0x10a')](db[_0x8895('0x69')],{'as':_0x8895('0x146'),'foreignKey':_0x8895('0x147'),'onDelete':_0x8895('0xfa')});db[_0x8895('0x6b')][_0x8895('0x10a')](db[_0x8895('0xe7')],{'as':_0x8895('0x162'),'foreignKey':_0x8895('0x150'),'onDelete':_0x8895('0xfa')});db[_0x8895('0x6b')][_0x8895('0x10a')](db[_0x8895('0x11')],{'as':_0x8895('0x17e'),'foreignKey':_0x8895('0xfb')});db['CmHopper']['belongsTo'](db[_0x8895('0x1b')],{'as':_0x8895('0x17f'),'foreignKey':_0x8895('0x132'),'onDelete':_0x8895('0xfa')});db[_0x8895('0x6b')][_0x8895('0x10a')](db[_0x8895('0xda')],{'as':_0x8895('0xda'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x8895('0x6b')][_0x8895('0x10a')](db[_0x8895('0x11')],{'as':'Owner','foreignKey':_0x8895('0x18c')});db[_0x8895('0x133')]['belongsTo'](db[_0x8895('0x69')],{'as':_0x8895('0x146'),'foreignKey':_0x8895('0x147'),'onDelete':_0x8895('0xfa')});db[_0x8895('0x133')][_0x8895('0x10a')](db[_0x8895('0xe7')],{'as':'List','foreignKey':_0x8895('0x150'),'onDelete':_0x8895('0xfa')});db['CmHopperBlack'][_0x8895('0x10a')](db['VoiceQueue'],{'as':_0x8895('0x17f'),'foreignKey':_0x8895('0x132'),'onDelete':_0x8895('0xfa')});db[_0x8895('0x133')][_0x8895('0x10a')](db[_0x8895('0xda')],{'as':_0x8895('0xda'),'foreignKey':_0x8895('0x18d'),'onDelete':'cascade'});db[_0x8895('0x18e')]['hasMany'](db['Condition'],{'as':{'plural':_0x8895('0x18f'),'singular':'OneAll'},'foreignKey':_0x8895('0x190'),'onDelete':_0x8895('0xfa'),'hooks':!![]});db[_0x8895('0x18e')][_0x8895('0xfe')](db[_0x8895('0x77')],{'as':{'plural':_0x8895('0x191'),'singular':_0x8895('0x192')},'foreignKey':_0x8895('0x193'),'onDelete':_0x8895('0xfa'),'hooks':!![]});db['Automation'][_0x8895('0xfe')](db[_0x8895('0x70')],{'as':_0x8895('0x194'),'foreignKey':'AutomationId','onDelete':_0x8895('0xfa'),'hooks':!![]});db[_0x8895('0x161')]['hasMany'](db[_0x8895('0x161')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':_0x8895('0xfa'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db['VoiceExtension'],{'as':_0x8895('0xff'),'foreignKey':_0x8895('0x13b'),'onDelete':_0x8895('0x160')});db[_0x8895('0x161')][_0x8895('0xfe')](db[_0x8895('0x14f')],{'as':_0x8895('0x195'),'foreignKey':_0x8895('0x13b')});db['Interval'][_0x8895('0xfe')](db['ChatApplication'],{'as':_0x8895('0x196'),'foreignKey':_0x8895('0x13b')});db[_0x8895('0x161')][_0x8895('0xfe')](db[_0x8895('0x44')],{'as':_0x8895('0x197'),'foreignKey':'IntervalId'});db[_0x8895('0x161')][_0x8895('0xfe')](db['SmsApplication'],{'as':_0x8895('0x198'),'foreignKey':_0x8895('0x13b')});db[_0x8895('0x7e')][_0x8895('0x10a')](db['MailAccount'],{});db[_0x8895('0x7e')][_0x8895('0x10a')](db[_0x8895('0x8a')],{'foreignKey':_0x8895('0x199')});db[_0x8895('0x7e')][_0x8895('0x10a')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db['Sound'][_0x8895('0x10d')](db['VoiceMusicOnHold'],{'as':_0x8895('0x19a'),'through':_0x8895('0x19b'),'onDelete':_0x8895('0x160')});db['Tag']['belongsToMany'](db[_0x8895('0x69')],{'through':_0x8895('0x18b')});db[_0x8895('0x82')][_0x8895('0x10d')](db[_0x8895('0x60')],{'through':_0x8895('0x183')});db['Tag'][_0x8895('0x10d')](db[_0x8895('0x3f')],{'through':_0x8895('0x159')});db[_0x8895('0x82')][_0x8895('0x10d')](db[_0x8895('0x102')],{'through':_0x8895('0x171')});db['Tag'][_0x8895('0x10d')](db[_0x8895('0x46')],{'through':'fax_interaction_has_tags'});db[_0x8895('0x82')][_0x8895('0x10d')](db[_0x8895('0x55')],{'through':_0x8895('0x177')});db[_0x8895('0x82')][_0x8895('0x10d')](db[_0x8895('0xf0')],{'through':_0x8895('0x19c')});db[_0x8895('0x85')][_0x8895('0xfe')](db[_0x8895('0x77')],{'as':{'plural':'AllConditions','singular':_0x8895('0x19d')},'foreignKey':_0x8895('0x19e'),'onDelete':_0x8895('0xfa'),'hooks':!![]});db['Trigger'][_0x8895('0xfe')](db[_0x8895('0x77')],{'as':{'plural':_0x8895('0x19f'),'singular':_0x8895('0x1a0')},'foreignKey':_0x8895('0x1a1'),'onDelete':_0x8895('0xfa'),'hooks':!![]});db[_0x8895('0x85')][_0x8895('0xfe')](db[_0x8895('0x70')],{'as':_0x8895('0x194'),'foreignKey':_0x8895('0x1a2'),'onDelete':_0x8895('0xfa'),'hooks':!![]});db[_0x8895('0x89')][_0x8895('0xfe')](db[_0x8895('0x8e')],{'as':'Fields','onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1a3'),'hooks':!![]});db[_0x8895('0x8a')]['hasMany'](db[_0x8895('0x8e')],{'as':'Fields','onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x199')});db[_0x8895('0x1a4')][_0x8895('0xfe')](db[_0x8895('0x8e')],{'as':'Fields','onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1a5')});db[_0x8895('0x8e')][_0x8895('0x10a')](db[_0x8895('0x1a4')],{'foreignKey':_0x8895('0x1a5')});db[_0x8895('0x91')][_0x8895('0xfe')](db[_0x8895('0x1a6')],{'as':_0x8895('0x1a7'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x8895('0x1a6')]['hasMany'](db['SalesforceField'],{'as':_0x8895('0x1a8'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1a9')});db[_0x8895('0x1a6')]['hasMany'](db[_0x8895('0x94')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x8895('0x1aa')});db[_0x8895('0x1a6')]['hasMany'](db[_0x8895('0x94')],{'as':_0x8895('0x1ab'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1ac')});db[_0x8895('0x1a6')][_0x8895('0x10a')](db[_0x8895('0x91')],{'as':'Account','foreignKey':_0x8895('0x1ad')});db['SalesforceField']['hasMany'](db[_0x8895('0x94')],{'as':_0x8895('0x1ae'),'foreignKey':_0x8895('0x1a9')});db[_0x8895('0x94')]['hasMany'](db['SalesforceField'],{'as':_0x8895('0x1af'),'foreignKey':'DescriptionId'});db[_0x8895('0x94')]['hasMany'](db[_0x8895('0x94')],{'as':_0x8895('0x1b0'),'foreignKey':_0x8895('0x1ac')});db[_0x8895('0x94')][_0x8895('0x10a')](db[_0x8895('0x1b1')],{'as':_0x8895('0x1b1'),'foreignKey':_0x8895('0x1b2')});db[_0x8895('0x95')][_0x8895('0xfe')](db[_0x8895('0x97')],{'as':'Configurations','onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1ad')});db[_0x8895('0x97')][_0x8895('0xfe')](db[_0x8895('0x99')],{'as':_0x8895('0x1a8'),'onDelete':_0x8895('0xfa'),'foreignKey':'SubjectId'});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0x8895('0x1b3'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1aa')});db['SugarcrmConfiguration'][_0x8895('0xfe')](db[_0x8895('0x99')],{'as':_0x8895('0x1ab'),'onDelete':_0x8895('0xfa'),'foreignKey':'FieldId'});db[_0x8895('0x97')]['belongsTo'](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0x8895('0x1ad')});db[_0x8895('0x99')][_0x8895('0xfe')](db[_0x8895('0x99')],{'as':_0x8895('0x1ae'),'foreignKey':_0x8895('0x1a9')});db['SugarcrmField'][_0x8895('0xfe')](db['SugarcrmField'],{'as':_0x8895('0x1af'),'foreignKey':_0x8895('0x1aa')});db[_0x8895('0x99')][_0x8895('0xfe')](db[_0x8895('0x99')],{'as':_0x8895('0x1b0'),'foreignKey':'FieldId'});db['SugarcrmField'][_0x8895('0x10a')](db['Variable'],{'as':_0x8895('0x1b1'),'foreignKey':_0x8895('0x1b2')});db[_0x8895('0x1b4')]['hasMany'](db[_0x8895('0x9c')],{'as':_0x8895('0x1a7'),'onDelete':'cascade','foreignKey':'AccountId'});db['DeskConfiguration']['hasMany'](db[_0x8895('0x1b5')],{'as':'Subjects','onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1a9')});db['DeskConfiguration'][_0x8895('0xfe')](db[_0x8895('0x1b5')],{'as':'Descriptions','onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1aa')});db[_0x8895('0x9c')]['hasMany'](db[_0x8895('0x1b5')],{'as':_0x8895('0x1ab'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1ac')});db['DeskConfiguration']['belongsTo'](db[_0x8895('0x1b4')],{'as':_0x8895('0x157'),'foreignKey':_0x8895('0x1ad')});db['DeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0x8895('0x1b6')});db[_0x8895('0x1b5')]['hasMany'](db[_0x8895('0x1b5')],{'as':_0x8895('0x1ae'),'foreignKey':_0x8895('0x1a9')});db[_0x8895('0x1b5')][_0x8895('0xfe')](db[_0x8895('0x1b5')],{'as':_0x8895('0x1af'),'foreignKey':_0x8895('0x1aa')});db['DeskField'][_0x8895('0xfe')](db[_0x8895('0x1b5')],{'as':_0x8895('0x1b0'),'foreignKey':_0x8895('0x1ac')});db[_0x8895('0x1b5')][_0x8895('0x10a')](db['Variable'],{'as':_0x8895('0x1b1'),'foreignKey':_0x8895('0x1b2')});db[_0x8895('0x9f')][_0x8895('0xfe')](db[_0x8895('0x1b7')],{'as':_0x8895('0x1a7'),'onDelete':_0x8895('0xfa'),'foreignKey':'AccountId'});db[_0x8895('0x1b7')][_0x8895('0xfe')](db[_0x8895('0xa2')],{'as':_0x8895('0x1a8'),'onDelete':'cascade','foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x8895('0xfe')](db['ZohoField'],{'as':_0x8895('0x1b3'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1aa')});db[_0x8895('0x1b7')][_0x8895('0xfe')](db['ZohoField'],{'as':_0x8895('0x1ab'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1ac')});db[_0x8895('0x1b7')]['belongsTo'](db['ZohoAccount'],{'as':'Account','foreignKey':_0x8895('0x1ad')});db[_0x8895('0xa2')][_0x8895('0xfe')](db[_0x8895('0xa2')],{'as':_0x8895('0x1ae'),'foreignKey':_0x8895('0x1a9')});db[_0x8895('0xa2')][_0x8895('0xfe')](db[_0x8895('0xa2')],{'as':_0x8895('0x1af'),'foreignKey':_0x8895('0x1aa')});db['ZohoField'][_0x8895('0xfe')](db[_0x8895('0xa2')],{'as':'Field','foreignKey':_0x8895('0x1ac')});db[_0x8895('0xa2')][_0x8895('0x10a')](db[_0x8895('0x1b1')],{'as':'Variable','foreignKey':_0x8895('0x1b2')});db[_0x8895('0xa3')][_0x8895('0xfe')](db[_0x8895('0xa5')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x8895('0x1ad')});db[_0x8895('0xa5')][_0x8895('0xfe')](db[_0x8895('0x1b8')],{'as':_0x8895('0x1a8'),'foreignKey':_0x8895('0x1a9')});db[_0x8895('0xa5')][_0x8895('0xfe')](db[_0x8895('0x1b8')],{'as':_0x8895('0x1b3'),'foreignKey':_0x8895('0x1aa')});db[_0x8895('0xa5')][_0x8895('0xfe')](db[_0x8895('0x1b8')],{'as':_0x8895('0x1ab'),'foreignKey':_0x8895('0x1ac')});db[_0x8895('0xa5')][_0x8895('0x10a')](db[_0x8895('0xa3')],{'as':_0x8895('0x157'),'foreignKey':_0x8895('0x1ad')});db[_0x8895('0xa5')]['belongsToMany'](db[_0x8895('0x82')],{'through':_0x8895('0x1b9')});db[_0x8895('0x1b8')]['hasMany'](db[_0x8895('0x1b8')],{'as':_0x8895('0x1ae'),'foreignKey':_0x8895('0x1a9')});db[_0x8895('0x1b8')][_0x8895('0xfe')](db[_0x8895('0x1b8')],{'as':_0x8895('0x1af'),'foreignKey':_0x8895('0x1aa')});db[_0x8895('0x1b8')][_0x8895('0xfe')](db[_0x8895('0x1b8')],{'as':_0x8895('0x1b0'),'foreignKey':'FieldId'});db[_0x8895('0x1b8')][_0x8895('0x10a')](db[_0x8895('0x1b1')],{'as':'Variable','foreignKey':'VariableId'});db['FreshdeskAccount'][_0x8895('0xfe')](db[_0x8895('0xa8')],{'as':_0x8895('0x1a7'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x8895('0xa8')]['hasMany'](db[_0x8895('0xaa')],{'as':_0x8895('0x1a8'),'onDelete':'cascade','foreignKey':_0x8895('0x1a9')});db[_0x8895('0xa8')][_0x8895('0xfe')](db[_0x8895('0xaa')],{'as':_0x8895('0x1b3'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1aa')});db[_0x8895('0xa8')][_0x8895('0xfe')](db[_0x8895('0xaa')],{'as':'Fields','onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1ac')});db[_0x8895('0xa8')]['belongsTo'](db[_0x8895('0x1ba')],{'as':'Account','foreignKey':_0x8895('0x1ad')});db[_0x8895('0xa8')][_0x8895('0x10d')](db[_0x8895('0x82')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x8895('0xaa')]['hasMany'](db['FreshdeskField'],{'as':'Subject','foreignKey':_0x8895('0x1a9')});db[_0x8895('0xaa')]['hasMany'](db[_0x8895('0xaa')],{'as':'Description','foreignKey':_0x8895('0x1aa')});db[_0x8895('0xaa')][_0x8895('0xfe')](db['FreshdeskField'],{'as':_0x8895('0x1b0'),'foreignKey':_0x8895('0x1ac')});db[_0x8895('0xaa')][_0x8895('0x10a')](db[_0x8895('0x1b1')],{'as':_0x8895('0x1b1'),'foreignKey':'VariableId'});db[_0x8895('0x1bb')][_0x8895('0xfe')](db[_0x8895('0xac')],{'as':_0x8895('0x1a7'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1ad')});db[_0x8895('0xac')][_0x8895('0xfe')](db[_0x8895('0xae')],{'as':_0x8895('0x1a8'),'foreignKey':'SubjectId'});db[_0x8895('0xac')][_0x8895('0xfe')](db['VtigerField'],{'as':_0x8895('0x1b3'),'foreignKey':_0x8895('0x1aa')});db[_0x8895('0xac')]['hasMany'](db['VtigerField'],{'as':'Fields','foreignKey':'FieldId'});db['VtigerConfiguration'][_0x8895('0x10a')](db[_0x8895('0x1bb')],{'as':'Account','foreignKey':_0x8895('0x1ad')});db[_0x8895('0xae')][_0x8895('0xfe')](db['VtigerField'],{'as':_0x8895('0x1ae'),'foreignKey':'SubjectId'});db['VtigerField']['hasMany'](db[_0x8895('0xae')],{'as':_0x8895('0x1af'),'foreignKey':_0x8895('0x1aa')});db[_0x8895('0xae')][_0x8895('0xfe')](db[_0x8895('0xae')],{'as':_0x8895('0x1b0'),'foreignKey':_0x8895('0x1ac')});db[_0x8895('0xae')][_0x8895('0x10a')](db[_0x8895('0x1b1')],{'as':'Variable','foreignKey':_0x8895('0x1b2')});db[_0x8895('0xb0')][_0x8895('0xfe')](db[_0x8895('0xb1')],{'as':_0x8895('0x1a7'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1ad')});db[_0x8895('0xb1')][_0x8895('0xfe')](db[_0x8895('0x1bc')],{'as':_0x8895('0x1a8'),'foreignKey':_0x8895('0x1a9')});db['ServicenowConfiguration'][_0x8895('0xfe')](db[_0x8895('0x1bc')],{'as':_0x8895('0x1b3'),'foreignKey':_0x8895('0x1aa')});db[_0x8895('0xb1')]['hasMany'](db[_0x8895('0x1bc')],{'as':_0x8895('0x1ab'),'foreignKey':_0x8895('0x1ac')});db[_0x8895('0xb1')][_0x8895('0x10a')](db[_0x8895('0xb0')],{'as':_0x8895('0x157'),'foreignKey':_0x8895('0x1ad')});db[_0x8895('0x1bc')][_0x8895('0xfe')](db[_0x8895('0x1bc')],{'as':'Subject','foreignKey':_0x8895('0x1a9')});db['ServicenowField'][_0x8895('0xfe')](db[_0x8895('0x1bc')],{'as':_0x8895('0x1af'),'foreignKey':_0x8895('0x1aa')});db[_0x8895('0x1bc')]['hasMany'](db[_0x8895('0x1bc')],{'as':_0x8895('0x1b0'),'foreignKey':_0x8895('0x1ac')});db['ServicenowField'][_0x8895('0x10a')](db[_0x8895('0x1b1')],{'as':_0x8895('0x1b1'),'foreignKey':'VariableId'});db[_0x8895('0xb4')][_0x8895('0xfe')](db[_0x8895('0x1bd')],{'as':_0x8895('0x1a7'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1ad')});db[_0x8895('0x1bd')][_0x8895('0xfe')](db['Dynamics365Field'],{'as':_0x8895('0x1a8'),'onDelete':'cascade','foreignKey':_0x8895('0x1a9')});db['Dynamics365Configuration'][_0x8895('0xfe')](db[_0x8895('0x1be')],{'as':_0x8895('0x1b3'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1aa')});db[_0x8895('0x1bd')][_0x8895('0xfe')](db[_0x8895('0x1be')],{'as':_0x8895('0x1ab'),'onDelete':_0x8895('0xfa'),'foreignKey':_0x8895('0x1ac')});db[_0x8895('0x1bd')][_0x8895('0x10a')](db['Dynamics365Account'],{'as':_0x8895('0x157'),'foreignKey':'AccountId'});db[_0x8895('0x1be')]['hasMany'](db[_0x8895('0x1be')],{'as':_0x8895('0x1ae'),'foreignKey':_0x8895('0x1a9')});db['Dynamics365Field'][_0x8895('0xfe')](db[_0x8895('0x1be')],{'as':'Description','foreignKey':_0x8895('0x1aa')});db[_0x8895('0x1be')][_0x8895('0xfe')](db[_0x8895('0x1be')],{'as':_0x8895('0x1b0'),'foreignKey':_0x8895('0x1ac')});db[_0x8895('0x1be')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x8895('0xb8')][_0x8895('0xfe')](db[_0x8895('0xba')],{'as':_0x8895('0x1a7'),'onDelete':'cascade','foreignKey':_0x8895('0x1ad')});db[_0x8895('0xba')][_0x8895('0xfe')](db['FreshsalesField'],{'as':_0x8895('0x1a8'),'foreignKey':'SubjectId'});db[_0x8895('0xba')][_0x8895('0xfe')](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0x8895('0x1aa')});db[_0x8895('0xba')][_0x8895('0xfe')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x8895('0x1ac')});db[_0x8895('0xba')]['belongsTo'](db[_0x8895('0xb8')],{'as':'Account','foreignKey':_0x8895('0x1ad')});db['FreshsalesField'][_0x8895('0xfe')](db['FreshsalesField'],{'as':_0x8895('0x1ae'),'foreignKey':_0x8895('0x1a9')});db['FreshsalesField']['hasMany'](db[_0x8895('0x1bf')],{'as':_0x8895('0x1af'),'foreignKey':_0x8895('0x1aa')});db['FreshsalesField'][_0x8895('0xfe')](db[_0x8895('0x1bf')],{'as':_0x8895('0x1b0'),'foreignKey':_0x8895('0x1ac')});db[_0x8895('0x1bf')][_0x8895('0x10a')](db[_0x8895('0x1b1')],{'as':_0x8895('0x1b1'),'foreignKey':_0x8895('0x1b2')});db['ChatQueueReport'][_0x8895('0x10a')](db[_0x8895('0x5a')],{});db['ChatQueueReport'][_0x8895('0x10a')](db[_0x8895('0xe7')],{'as':_0x8895('0x162'),'foreignKey':_0x8895('0x150')});db[_0x8895('0xbf')][_0x8895('0x10a')](db['CmContact'],{'as':_0x8895('0x146'),'foreignKey':_0x8895('0x147')});db[_0x8895('0xbf')][_0x8895('0x10a')](db['ChatInteraction'],{});db[_0x8895('0xbf')][_0x8895('0x10a')](db[_0x8895('0x17d')],{});db['ChatQueueReport'][_0x8895('0x10a')](db[_0x8895('0x11')],{});db[_0x8895('0xbf')]['belongsTo'](db['ChatQueue'],{});db[_0x8895('0x185')][_0x8895('0x10a')](db['User'],{'onDelete':_0x8895('0xfa'),'foreignKey':'FromId'});db[_0x8895('0x185')][_0x8895('0x10a')](db[_0x8895('0x11')],{'onDelete':'cascade','foreignKey':_0x8895('0x1c0')});db['JscriptySessionReport'][_0x8895('0xfe')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0x8895('0xfa')});db[_0x8895('0x135')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x8895('0xc7')]['belongsTo'](db[_0x8895('0x4d')],{});db[_0x8895('0xc7')][_0x8895('0x10a')](db['CmList'],{'as':_0x8895('0x162'),'foreignKey':_0x8895('0x150')});db[_0x8895('0xc7')][_0x8895('0x10a')](db[_0x8895('0x69')],{'as':_0x8895('0x146'),'foreignKey':_0x8895('0x147')});db[_0x8895('0xc7')]['belongsTo'](db[_0x8895('0x102')],{});db[_0x8895('0xc7')][_0x8895('0x10a')](db[_0x8895('0x51')],{});db[_0x8895('0xc7')][_0x8895('0x10a')](db[_0x8895('0x11')],{});db['SmsQueueReport']['belongsTo'](db['SmsQueue'],{});db[_0x8895('0x1c1')][_0x8895('0xfe')](db['JscriptySessionReport'],{'foreignKey':_0x8895('0x1c2')});db[_0x8895('0x1c1')][_0x8895('0xfe')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x8895('0xfe')](db['JscriptyAnswerReport'],{'foreignKey':_0x8895('0x1c2')});db['SquareProject'][_0x8895('0x10d')](db['User'],{'as':_0x8895('0x16a'),'through':_0x8895('0x1c3')});db[_0x8895('0xd6')][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':'Agents','through':_0x8895('0x112')});db[_0x8895('0xd6')][_0x8895('0x10d')](db[_0x8895('0x1b')],{'through':_0x8895('0x1c4'),'as':'VoiceQueues'});db['Team']['belongsToMany'](db['MailQueue'],{'through':_0x8895('0x155'),'as':_0x8895('0x11b')});db[_0x8895('0xd6')][_0x8895('0x10d')](db[_0x8895('0x65')],{'through':'team_has_chat_queues','as':_0x8895('0x11c')});db['Team'][_0x8895('0x10d')](db[_0x8895('0x49')],{'through':_0x8895('0x16d'),'as':'FaxQueues'});db[_0x8895('0xd6')][_0x8895('0x10d')](db['SmsQueue'],{'through':'team_has_sms_queues','as':'SmsQueues'});db['Team'][_0x8895('0x10d')](db['OpenchannelQueue'],{'through':_0x8895('0x179'),'as':'OpenchannelQueues'});db[_0x8895('0xd6')]['belongsToMany'](db['WhatsappQueue'],{'through':_0x8895('0x1c5'),'as':_0x8895('0x120')});db[_0x8895('0xda')][_0x8895('0xfe')](db[_0x8895('0x6b')],{'as':'Hoppers','foreignKey':_0x8895('0x18d')});db[_0x8895('0xda')][_0x8895('0xfe')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x8895('0x18d')});db[_0x8895('0xda')][_0x8895('0xfe')](db[_0x8895('0x6d')],{'as':'HopperHistories','foreignKey':_0x8895('0x18d')});db[_0x8895('0xda')][_0x8895('0xfe')](db[_0x8895('0x133')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x8895('0xda')][_0x8895('0x10a')](db[_0x8895('0x137')],{'as':_0x8895('0x137'),'foreignKey':_0x8895('0x138')});db['Campaign'][_0x8895('0x10a')](db[_0x8895('0x137')],{'as':_0x8895('0x139'),'foreignKey':_0x8895('0x13a')});db[_0x8895('0xda')][_0x8895('0x10a')](db[_0x8895('0x161')],{'as':'Interval','foreignKey':_0x8895('0x13b')});db[_0x8895('0xda')][_0x8895('0x10a')](db['SquareProject'],{'as':_0x8895('0xd0'),'foreignKey':_0x8895('0x1c6')});db[_0x8895('0xda')][_0x8895('0x10d')](db['CmList'],{'as':_0x8895('0x110'),'through':_0x8895('0x1c7')});db['Campaign'][_0x8895('0x10d')](db[_0x8895('0xe7')],{'as':_0x8895('0x13e'),'through':_0x8895('0x1c8')});db[_0x8895('0xde')][_0x8895('0x10a')](db['MailMessage'],{});db['MailTransferReport'][_0x8895('0x10a')](db[_0x8895('0x3f')],{});db['MailTransferReport'][_0x8895('0x10a')](db[_0x8895('0x3b')],{'foreignKey':_0x8895('0x1c9'),'as':_0x8895('0x1ca')});db[_0x8895('0xde')][_0x8895('0x10a')](db[_0x8895('0x11')],{'foreignKey':'FromUserId','as':_0x8895('0x1cb')});db[_0x8895('0xde')][_0x8895('0x10a')](db[_0x8895('0x11')],{'foreignKey':'ToUserId','as':_0x8895('0x1cc')});db[_0x8895('0xde')]['belongsTo'](db['MailQueue'],{'foreignKey':_0x8895('0x1cd'),'as':_0x8895('0x1ce')});db[_0x8895('0xde')][_0x8895('0x10a')](db['MailAccount'],{'foreignKey':_0x8895('0x1cf'),'as':'ToAccount'});db[_0x8895('0xe0')][_0x8895('0x10a')](db['ChatMessage'],{});db[_0x8895('0xe0')][_0x8895('0x10a')](db[_0x8895('0x60')],{});db[_0x8895('0xe0')][_0x8895('0x10a')](db[_0x8895('0x5a')],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0x8895('0xe0')]['belongsTo'](db['User'],{'foreignKey':_0x8895('0x1d0'),'as':_0x8895('0x1cb')});db[_0x8895('0xe0')]['belongsTo'](db[_0x8895('0x11')],{'foreignKey':_0x8895('0x1d1'),'as':'ToAgent'});db['ChatTransferReport']['belongsTo'](db[_0x8895('0x65')],{'foreignKey':'ToChatQueueId','as':_0x8895('0x1ce')});db['ChatTransferReport'][_0x8895('0x10a')](db[_0x8895('0x5a')],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db['FaxTransferReport'][_0x8895('0x10a')](db[_0x8895('0x47')],{});db['FaxTransferReport']['belongsTo'](db[_0x8895('0x46')],{});db[_0x8895('0xe2')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0x8895('0x1d2'),'as':'FromAccount'});db[_0x8895('0xe2')][_0x8895('0x10a')](db[_0x8895('0x11')],{'foreignKey':_0x8895('0x1d0'),'as':_0x8895('0x1cb')});db['FaxTransferReport'][_0x8895('0x10a')](db[_0x8895('0x11')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x8895('0xe2')][_0x8895('0x10a')](db['FaxQueue'],{'foreignKey':_0x8895('0x1d3'),'as':'ToQueue'});db['FaxTransferReport'][_0x8895('0x10a')](db[_0x8895('0x123')],{'foreignKey':_0x8895('0x1d4'),'as':_0x8895('0x1d5')});db[_0x8895('0xe4')]['belongsTo'](db[_0x8895('0x174')],{});db[_0x8895('0xe4')][_0x8895('0x10a')](db[_0x8895('0x55')],{});db[_0x8895('0xe4')][_0x8895('0x10a')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0x8895('0x1ca')});db[_0x8895('0xe4')][_0x8895('0x10a')](db[_0x8895('0x11')],{'foreignKey':_0x8895('0x1d0'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0x8895('0x10a')](db[_0x8895('0x11')],{'foreignKey':'ToUserId','as':_0x8895('0x1cc')});db['OpenchannelTransferReport'][_0x8895('0x10a')](db[_0x8895('0x58')],{'foreignKey':_0x8895('0x1d6'),'as':_0x8895('0x1ce')});db[_0x8895('0xe4')]['belongsTo'](db[_0x8895('0x54')],{'foreignKey':_0x8895('0x1d7'),'as':_0x8895('0x1d5')});db[_0x8895('0xe6')][_0x8895('0x10a')](db['SmsMessage'],{});db[_0x8895('0xe6')][_0x8895('0x10a')](db['SmsInteraction'],{});db[_0x8895('0xe6')][_0x8895('0x10a')](db[_0x8895('0x4d')],{'foreignKey':_0x8895('0x1d8'),'as':_0x8895('0x1ca')});db['SmsTransferReport'][_0x8895('0x10a')](db[_0x8895('0x11')],{'foreignKey':'FromUserId','as':_0x8895('0x1cb')});db['SmsTransferReport']['belongsTo'](db[_0x8895('0x11')],{'foreignKey':_0x8895('0x1d1'),'as':_0x8895('0x1cc')});db[_0x8895('0xe6')]['belongsTo'](db[_0x8895('0x52')],{'foreignKey':'ToSmsQueueId','as':_0x8895('0x1ce')});db[_0x8895('0xe6')][_0x8895('0x10a')](db[_0x8895('0x4d')],{'foreignKey':'ToSmsAccountId','as':_0x8895('0x1d5')});db[_0x8895('0xe7')][_0x8895('0xfe')](db[_0x8895('0x75')],{'as':'Dispositions','foreignKey':_0x8895('0x150')});db[_0x8895('0xe7')][_0x8895('0xfe')](db[_0x8895('0x1d9')],{'as':'CustomFields','foreignKey':_0x8895('0x150')});db[_0x8895('0xe7')][_0x8895('0xfe')](db[_0x8895('0x69')],{'as':'Contacts','onDelete':'cascade','foreignKey':'ListId'});db['CmList'][_0x8895('0xfe')](db[_0x8895('0x130')],{'as':_0x8895('0x131'),'foreignKey':'ListId'});db[_0x8895('0xe7')][_0x8895('0xfe')](db[_0x8895('0x6d')],{'as':_0x8895('0x100'),'foreignKey':_0x8895('0x150')});db[_0x8895('0xe7')][_0x8895('0xfe')](db[_0x8895('0x6f')],{'as':_0x8895('0x6f'),'foreignKey':'ListId'});db[_0x8895('0xe7')][_0x8895('0x10d')](db[_0x8895('0x1b')],{'as':'Queues','through':_0x8895('0x1da')});db[_0x8895('0xe7')][_0x8895('0x10d')](db['User'],{'as':_0x8895('0x13d'),'through':_0x8895('0x111')});db[_0x8895('0xe8')][_0x8895('0xfe')](db[_0x8895('0x18')],{'as':_0x8895('0xff'),'onDelete':_0x8895('0xfa')});db[_0x8895('0xe8')][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':_0x8895('0x13d'),'through':_0x8895('0x1db')});db[_0x8895('0x10b')][_0x8895('0xfe')](db[_0x8895('0x11')],{'as':_0x8895('0x16a'),'foreignKey':_0x8895('0x1dc')});db['UserProfile'][_0x8895('0xfe')](db[_0x8895('0x1dd')],{'as':_0x8895('0x1de'),'foreignKey':_0x8895('0x1dc'),'onDelete':_0x8895('0xfa')});db['UserProfileSection']['hasMany'](db[_0x8895('0xea')],{'as':_0x8895('0x1df'),'foreignKey':_0x8895('0x1e0'),'onDelete':_0x8895('0xfa')});db[_0x8895('0xec')]['hasMany'](db['Disposition'],{'as':_0x8895('0x14c'),'foreignKey':_0x8895('0x1e1')});db[_0x8895('0xec')][_0x8895('0xfe')](db[_0x8895('0x73')],{'as':_0x8895('0x14d'),'foreignKey':'WhatsappAccountId'});db[_0x8895('0xec')][_0x8895('0xfe')](db[_0x8895('0xf1')],{'as':_0x8895('0x140'),'foreignKey':_0x8895('0x1e1')});db['WhatsappAccount'][_0x8895('0xfe')](db[_0x8895('0xf0')],{'as':_0x8895('0x14e')});db[_0x8895('0xec')][_0x8895('0xfe')](db[_0x8895('0xee')],{'as':_0x8895('0x16f')});db[_0x8895('0xec')]['belongsTo'](db['CmList'],{'as':_0x8895('0x162'),'foreignKey':_0x8895('0x150')});db[_0x8895('0xec')][_0x8895('0x10a')](db[_0x8895('0x7a')],{'as':_0x8895('0x13c'),'foreignKey':_0x8895('0x153')});db[_0x8895('0xec')]['belongsToMany'](db['User'],{'as':_0x8895('0x13d'),'through':_0x8895('0x129')});db[_0x8895('0xee')][_0x8895('0x10a')](db[_0x8895('0x11')],{'onDelete':_0x8895('0x160')});db[_0x8895('0xee')]['belongsTo'](db['WhatsappQueue'],{'onDelete':_0x8895('0x160')});db[_0x8895('0xee')][_0x8895('0x10a')](db[_0x8895('0xec')],{'onDelete':_0x8895('0x160')});db[_0x8895('0xee')][_0x8895('0x10a')](db['Interval'],{'onDelete':_0x8895('0x160'),'foreignKey':_0x8895('0x13b')});db[_0x8895('0xee')][_0x8895('0x10a')](db[_0x8895('0x82')],{'onDelete':_0x8895('0x160'),'foreignKey':_0x8895('0x167')});db['WhatsappInteraction'][_0x8895('0xfe')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0x8895('0xfa'),'foreignKey':'WhatsappInteractionId'});db[_0x8895('0xf0')]['belongsTo'](db[_0x8895('0xec')],{'as':_0x8895('0x157'),'foreignKey':'WhatsappAccountId'});db[_0x8895('0xf0')][_0x8895('0x10a')](db[_0x8895('0x69')],{'as':'Contact','foreignKey':_0x8895('0x147')});db['WhatsappInteraction'][_0x8895('0x10a')](db[_0x8895('0x11')],{'as':_0x8895('0x158'),'foreignKey':_0x8895('0xfb')});db[_0x8895('0xf0')]['belongsToMany'](db[_0x8895('0x82')],{'through':_0x8895('0x19c'),'as':_0x8895('0x15a')});db[_0x8895('0xf0')]['belongsToMany'](db[_0x8895('0x82')],{'through':'whatsapp_interaction_has_tags','as':_0x8895('0x15b')});db[_0x8895('0xf0')][_0x8895('0x10d')](db[_0x8895('0x11')],{'as':_0x8895('0x16a'),'through':_0x8895('0x118'),'foreignKey':_0x8895('0x1e2')});db['WhatsappMessage'][_0x8895('0x10a')](db[_0x8895('0x11')],{'as':'User'});db[_0x8895('0xf1')]['belongsTo'](db[_0x8895('0x69')],{'onDelete':_0x8895('0xfa'),'as':_0x8895('0x146')});db[_0x8895('0xf1')]['belongsTo'](db[_0x8895('0xf0')],{'onDelete':_0x8895('0xfa'),'as':'Interaction','foreignKey':_0x8895('0x1e2')});db[_0x8895('0xf1')][_0x8895('0x10a')](db[_0x8895('0xec')],{'as':'Account','foreignKey':_0x8895('0x1e1')});db['WhatsappQueueReport'][_0x8895('0x10a')](db['WhatsappAccount'],{});db[_0x8895('0x1e3')][_0x8895('0x10a')](db[_0x8895('0xe7')],{'as':_0x8895('0x162'),'foreignKey':'ListId'});db[_0x8895('0x1e3')][_0x8895('0x10a')](db[_0x8895('0x69')],{'as':_0x8895('0x146'),'foreignKey':'ContactId'});db[_0x8895('0x1e3')][_0x8895('0x10a')](db[_0x8895('0xf0')],{});db[_0x8895('0x1e3')]['belongsTo'](db[_0x8895('0xf6')],{});db[_0x8895('0x1e3')][_0x8895('0x10a')](db['WhatsappMessage'],{});db['WhatsappQueueReport'][_0x8895('0x10a')](db[_0x8895('0x11')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x8895('0xf1')],{});db[_0x8895('0xf4')][_0x8895('0x10a')](db['WhatsappInteraction'],{});db[_0x8895('0xf4')][_0x8895('0x10a')](db[_0x8895('0xec')],{'foreignKey':_0x8895('0x1e4'),'as':'FromAccount'});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x8895('0x1e5'),'as':_0x8895('0x1d5')});db[_0x8895('0xf4')][_0x8895('0x10a')](db[_0x8895('0xf6')],{'foreignKey':_0x8895('0x1e6'),'as':_0x8895('0x1ce')});db['WhatsappTransferReport'][_0x8895('0x10a')](db[_0x8895('0x11')],{'foreignKey':_0x8895('0x1d0'),'as':_0x8895('0x1cb')});db[_0x8895('0xf4')][_0x8895('0x10a')](db[_0x8895('0x11')],{'foreignKey':_0x8895('0x1d1'),'as':_0x8895('0x1cc')});db[_0x8895('0xf6')]['belongsToMany'](db[_0x8895('0x11')],{'as':'Agents','through':_0x8895('0x36'),'foreignKey':_0x8895('0x1e7')});db[_0x8895('0xf6')][_0x8895('0x10d')](db[_0x8895('0xd6')],{'through':'team_has_whatsapp_queues','as':_0x8895('0x156')});module[_0x8895('0x1e8')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 0da67ab..d00d8c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a4c=['./api/template','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskConfiguration','/api/integrations/desk/fields','./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/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','/api/square/messages','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/notifications','./api/notification','/api/whatsapp/accounts','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappQueue','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','static','root','/www','join','/demo','/snippet','1.0.16','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','util','./errors','./config/environment','./config/logger','auth','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','url','user','name','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','responseTime','role','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/screenRecording','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates'];(function(_0x77e3fd,_0x2d48c0){var _0x4e0079=function(_0x2939ea){while(--_0x2939ea){_0x77e3fd['push'](_0x77e3fd['shift']());}};_0x4e0079(++_0x2d48c0);}(_0x4a4c,0x93));var _0xc4a4=function(_0x19ec7c,_0x5765f1){_0x19ec7c=_0x19ec7c-0x0;var _0x435150=_0x4a4c[_0x19ec7c];return _0x435150;};'use strict';var path=require(_0xc4a4('0x0'));var express=require(_0xc4a4('0x1'));var ewinston=require('express-winston');var util=require(_0xc4a4('0x2'));var errors=require(_0xc4a4('0x3'));var config=require(_0xc4a4('0x4'));var logger=require('./config/logger')('api');var authLogger=require(_0xc4a4('0x5'))(_0xc4a4('0x6'));exports['default']=function(_0x39b3f4){_0x39b3f4[_0xc4a4('0x7')](ewinston[_0xc4a4('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x561e0b,_0x478e1a){return util[_0xc4a4('0x9')](_0xc4a4('0xa'),_0x561e0b[_0xc4a4('0xb')],_0x561e0b[_0xc4a4('0xc')]['x-forwarded-for']?_0x561e0b['headers'][_0xc4a4('0xd')]:_0x561e0b[_0xc4a4('0xe')]['remoteAddress']||_0x561e0b['ip'],_0x561e0b[_0xc4a4('0xf')],_0x478e1a['statusCode'],_0x478e1a['responseTime'],_0x561e0b[_0xc4a4('0x10')]?_0x561e0b[_0xc4a4('0x10')]['id']:null,_0x561e0b[_0xc4a4('0x10')]?_0x561e0b['user'][_0xc4a4('0x11')]:null,_0x561e0b['user']?_0x561e0b[_0xc4a4('0x10')]['role']:null);}}));_0x39b3f4[_0xc4a4('0x7')](ewinston[_0xc4a4('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xa4a23,_0x3507e0){var _0xf20605='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0xa4a23['body']&&_0xa4a23[_0xc4a4('0x12')][_0xc4a4('0x13')]&&_0xa4a23[_0xc4a4('0x12')][_0xc4a4('0x14')]){_0xf20605=_0xc4a4('0x15');}return util[_0xc4a4('0x9')](_0xf20605,_0xa4a23[_0xc4a4('0xb')],_0xa4a23['headers'][_0xc4a4('0xd')]?_0xa4a23[_0xc4a4('0xc')]['x-forwarded-for']:_0xa4a23[_0xc4a4('0xe')][_0xc4a4('0x16')]||_0xa4a23['ip'],_0xa4a23[_0xc4a4('0xf')],_0x3507e0['statusCode'],_0x3507e0[_0xc4a4('0x17')],_0xa4a23['user']?_0xa4a23[_0xc4a4('0x10')]['id']:null,_0xa4a23[_0xc4a4('0x10')]?_0xa4a23[_0xc4a4('0x10')][_0xc4a4('0x11')]:null,_0xa4a23['user']?_0xa4a23[_0xc4a4('0x10')][_0xc4a4('0x18')]:null,_0xa4a23[_0xc4a4('0x12')]&&_0xa4a23[_0xc4a4('0x12')][_0xc4a4('0x13')]?_0xa4a23['body'][_0xc4a4('0x13')]:'other',_0xa4a23[_0xc4a4('0x12')]&&_0xa4a23[_0xc4a4('0x12')][_0xc4a4('0x14')]?_0xa4a23[_0xc4a4('0x12')]['agent_id']:'',_0xa4a23[_0xc4a4('0x12')]&&_0xa4a23[_0xc4a4('0x12')][_0xc4a4('0x19')]?_0xa4a23['body']['agent_name']:'');},'ignoreRoute':function(_0x54ab94){var _0x3fd998=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3fd998[_0xc4a4('0x1a')](_0x54ab94[_0xc4a4('0xf')]);}}));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x1b'),require(_0xc4a4('0x1c')));_0x39b3f4['use'](_0xc4a4('0x1d'),require(_0xc4a4('0x1e')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x1f'),require('./api/voiceContext'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x20'),require('./api/voiceExtension'));_0x39b3f4[_0xc4a4('0x7')]('/api/voice/mohs',require(_0xc4a4('0x21')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x22'),require(_0xc4a4('0x23')));_0x39b3f4['use']('/api/voice/recordings',require('./api/voiceRecording'));_0x39b3f4[_0xc4a4('0x7')]('/api/screen/recordings',require(_0xc4a4('0x24')));_0x39b3f4[_0xc4a4('0x7')]('/api/voice/mails',require(_0xc4a4('0x25')));_0x39b3f4[_0xc4a4('0x7')]('/api/voice/mails/messages',require(_0xc4a4('0x26')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x27'),require(_0xc4a4('0x28')));_0x39b3f4[_0xc4a4('0x7')]('/api/voice/dials/reports',require(_0xc4a4('0x29')));_0x39b3f4[_0xc4a4('0x7')]('/api/voice/agents/reports',require(_0xc4a4('0x2a')));_0x39b3f4[_0xc4a4('0x7')]('/api/voice/queues/reports',require(_0xc4a4('0x2b')));_0x39b3f4['use'](_0xc4a4('0x2c'),require(_0xc4a4('0x2d')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x2e'),require(_0xc4a4('0x2f')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x30'),require(_0xc4a4('0x31')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x32'),require(_0xc4a4('0x33')));_0x39b3f4[_0xc4a4('0x7')]('/api/mail/accounts',require('./api/mailAccount'));_0x39b3f4[_0xc4a4('0x7')]('/api/mail/queues',require(_0xc4a4('0x34')));_0x39b3f4[_0xc4a4('0x7')]('/api/mail/substatuses',require(_0xc4a4('0x35')));_0x39b3f4['use'](_0xc4a4('0x36'),require(_0xc4a4('0x37')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x38'),require(_0xc4a4('0x39')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x3a'),require(_0xc4a4('0x3b')));_0x39b3f4[_0xc4a4('0x7')]('/api/mail/reports/queue',require(_0xc4a4('0x3c')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x3d'),require(_0xc4a4('0x3e')));_0x39b3f4['use']('/api/dashboards/items',require(_0xc4a4('0x3f')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x40'),require(_0xc4a4('0x41')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x42'),require('./api/faxApplication'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x43'),require(_0xc4a4('0x44')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x45'),require('./api/faxMessage'));_0x39b3f4['use'](_0xc4a4('0x46'),require(_0xc4a4('0x47')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x48'),require('./api/faxQueueReport'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x49'),require('./api/smsAccount'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x4a'),require(_0xc4a4('0x4b')));_0x39b3f4['use'](_0xc4a4('0x4c'),require(_0xc4a4('0x4d')));_0x39b3f4['use'](_0xc4a4('0x4e'),require(_0xc4a4('0x4f')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x50'),require(_0xc4a4('0x51')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x52'),require(_0xc4a4('0x53')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x54'),require(_0xc4a4('0x55')));_0x39b3f4[_0xc4a4('0x7')]('/api/openchannel/interactions',require(_0xc4a4('0x56')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x57'),require('./api/openchannelMessage'));_0x39b3f4['use']('/api/openchannel/queues',require(_0xc4a4('0x58')));_0x39b3f4['use'](_0xc4a4('0x59'),require(_0xc4a4('0x5a')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x5b'),require('./api/openchannelQueueReport'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x5c'),require(_0xc4a4('0x5d')));_0x39b3f4[_0xc4a4('0x7')]('/api/chat/interactions',require(_0xc4a4('0x5e')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x5f'),require(_0xc4a4('0x60')));_0x39b3f4['use'](_0xc4a4('0x61'),require('./api/chatOfflineMessage'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x62'),require(_0xc4a4('0x63')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x64'),require(_0xc4a4('0x65')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x66'),require(_0xc4a4('0x67')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x68'),require(_0xc4a4('0x69')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x6a'),require(_0xc4a4('0x6b')));_0x39b3f4[_0xc4a4('0x7')]('/api/cm/hopper',require('./api/cmHopper'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x6c'),require(_0xc4a4('0x6d')));_0x39b3f4['use']('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x6e'),require(_0xc4a4('0x6f')));_0x39b3f4[_0xc4a4('0x7')]('/api/cm/custom_fields',require(_0xc4a4('0x70')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x71'),require(_0xc4a4('0x72')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x73'),require(_0xc4a4('0x74')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x75'),require(_0xc4a4('0x76')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x77'),require(_0xc4a4('0x78')));_0x39b3f4['use'](_0xc4a4('0x79'),require('./api/condition'));_0x39b3f4['use'](_0xc4a4('0x7a'),require('./api/interval'));_0x39b3f4[_0xc4a4('0x7')]('/api/pauses',require('./api/pause'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x7b'),require(_0xc4a4('0x7c')));_0x39b3f4['use'](_0xc4a4('0x7d'),require(_0xc4a4('0x7e')));_0x39b3f4['use'](_0xc4a4('0x7f'),require(_0xc4a4('0x80')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x81'),require(_0xc4a4('0x82')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x83'),require(_0xc4a4('0x84')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x85'),require(_0xc4a4('0x86')));_0x39b3f4['use']('/api/triggers',require(_0xc4a4('0x87')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x88'),require('./api/variable'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x89'),require(_0xc4a4('0x8a')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x8b'),require(_0xc4a4('0x8c')));_0x39b3f4['use'](_0xc4a4('0x8d'),require(_0xc4a4('0x8e')));_0x39b3f4['use']('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x39b3f4['use'](_0xc4a4('0x8f'),require(_0xc4a4('0x90')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x91'),require('./api/analyticMetric'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x92'),require(_0xc4a4('0x93')));_0x39b3f4['use'](_0xc4a4('0x94'),require(_0xc4a4('0x95')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x96'),require(_0xc4a4('0x97')));_0x39b3f4[_0xc4a4('0x7')]('/api/integrations/salesforce/configurations',require(_0xc4a4('0x98')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x99'),require(_0xc4a4('0x9a')));_0x39b3f4['use']('/api/integrations/sugarcrm/accounts',require(_0xc4a4('0x9b')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x9c'),require(_0xc4a4('0x9d')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x9e'),require(_0xc4a4('0x9f')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xa0'),require('./api/intDeskAccount'));_0x39b3f4[_0xc4a4('0x7')]('/api/integrations/desk/configurations',require(_0xc4a4('0xa1')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xa2'),require(_0xc4a4('0xa3')));_0x39b3f4['use'](_0xc4a4('0xa4'),require(_0xc4a4('0xa5')));_0x39b3f4['use'](_0xc4a4('0xa6'),require(_0xc4a4('0xa7')));_0x39b3f4[_0xc4a4('0x7')]('/api/integrations/zoho/fields',require(_0xc4a4('0xa8')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xa9'),require(_0xc4a4('0xaa')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xab'),require('./api/intZendeskConfiguration'));_0x39b3f4['use'](_0xc4a4('0xac'),require(_0xc4a4('0xad')));_0x39b3f4['use'](_0xc4a4('0xae'),require('./api/intFreshdeskAccount'));_0x39b3f4['use'](_0xc4a4('0xaf'),require('./api/intFreshdeskConfiguration'));_0x39b3f4['use'](_0xc4a4('0xb0'),require(_0xc4a4('0xb1')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xb2'),require('./api/intVtigerAccount'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xb3'),require(_0xc4a4('0xb4')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xb5'),require('./api/intVtigerField'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xb6'),require('./api/intServicenowAccount'));_0x39b3f4['use'](_0xc4a4('0xb7'),require('./api/intServicenowConfiguration'));_0x39b3f4[_0xc4a4('0x7')]('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xb8'),require(_0xc4a4('0xb9')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xba'),require(_0xc4a4('0xbb')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xbc'),require(_0xc4a4('0xbd')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xbe'),require(_0xc4a4('0xbf')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xc0'),require(_0xc4a4('0xc1')));_0x39b3f4[_0xc4a4('0x7')]('/api/integrations/freshsales/fields',require(_0xc4a4('0xc2')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xc3'),require(_0xc4a4('0xc4')));_0x39b3f4['use'](_0xc4a4('0xc5'),require(_0xc4a4('0xc6')));_0x39b3f4[_0xc4a4('0x7')]('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xc7'),require('./api/jscriptyAnswerReport'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xc8'),require(_0xc4a4('0xc9')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xca'),require(_0xc4a4('0xcb')));_0x39b3f4[_0xc4a4('0x7')]('/api/sms/reports/queue',require(_0xc4a4('0xcc')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xcd'),require('./api/squareReport'));_0x39b3f4[_0xc4a4('0x7')]('/api/square/details/reports',require(_0xc4a4('0xce')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xcf'),require(_0xc4a4('0xd0')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xd1'),require('./api/setting'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xd2'),require(_0xc4a4('0xd3')));_0x39b3f4['use'](_0xc4a4('0xd4'),require('./api/squareProject'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xd5'),require('./api/squareRecording'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xd6'),require('./api/squareMessage'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xd7'),require('./api/team'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xd8'),require(_0xc4a4('0xd9')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xda'),require(_0xc4a4('0xdb')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xdc'),require(_0xc4a4('0xdd')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xde'),require('./api/attachment'));_0x39b3f4['use'](_0xc4a4('0xdf'),require(_0xc4a4('0xe0')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xe1'),require(_0xc4a4('0xe2')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xe3'),require('./api/chatTransferReport'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xe4'),require(_0xc4a4('0xe5')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xe6'),require(_0xc4a4('0xe7')));_0x39b3f4['use']('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xe8'),require(_0xc4a4('0xe9')));_0x39b3f4[_0xc4a4('0x7')]('/api/voice/prefixes',require(_0xc4a4('0xea')));_0x39b3f4[_0xc4a4('0x7')]('/api/userProfiles',require(_0xc4a4('0xeb')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xec'),require(_0xc4a4('0xed')));_0x39b3f4[_0xc4a4('0x7')]('/api/userProfile/resources',require(_0xc4a4('0xee')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xef'),require(_0xc4a4('0xf0')));_0x39b3f4['use'](_0xc4a4('0xf1'),require('./api/whatsappAccount'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xf2'),require('./api/whatsappApplication'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xf3'),require(_0xc4a4('0xf4')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xf5'),require(_0xc4a4('0xf6')));_0x39b3f4[_0xc4a4('0x7')]('/api/whatsapp/reports/queue',require(_0xc4a4('0xf7')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xf8'),require('./api/whatsappTransferReport'));_0x39b3f4['use']('/api/whatsapp/queues',require(_0xc4a4('0xf9')));_0x39b3f4[_0xc4a4('0x7')]('/api/cloudProviders',require(_0xc4a4('0xfa')));_0x39b3f4['use'](_0xc4a4('0xfb'),require(_0xc4a4('0xfc')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0xfd'),require(_0xc4a4('0xfe')));_0x39b3f4['use'](_0xc4a4('0xff'),require(_0xc4a4('0x100')));_0x39b3f4['use'](_0xc4a4('0x101'),require(_0xc4a4('0x102')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x103'),require(_0xc4a4('0x104')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x105'),require('./api/system'));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x106'),require(_0xc4a4('0x107')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x108'),require(_0xc4a4('0x109')));_0x39b3f4[_0xc4a4('0x7')]('/apidoc',express[_0xc4a4('0x10a')](path['join'](config[_0xc4a4('0x10b')],'/apidoc')));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x10c'),express[_0xc4a4('0x10a')](path[_0xc4a4('0x10d')](config[_0xc4a4('0x10b')],_0xc4a4('0x10c'))));_0x39b3f4['use'](_0xc4a4('0x10e'),express[_0xc4a4('0x10a')](path[_0xc4a4('0x10d')](config['root'],_0xc4a4('0x10e'))));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x10f'),express['static'](path[_0xc4a4('0x10d')](config[_0xc4a4('0x10b')],'snippet',_0xc4a4('0x110'))));_0x39b3f4[_0xc4a4('0x7')](_0xc4a4('0x111'),express[_0xc4a4('0x10a')](path[_0xc4a4('0x10d')](config[_0xc4a4('0x10b')],'/server/files/plugins')));_0x39b3f4[_0xc4a4('0x112')](_0xc4a4('0x113'))[_0xc4a4('0x114')](errors[0x194]);_0x39b3f4[_0xc4a4('0x112')]('/*')['get'](function(_0x62245b,_0x2959d1){_0x2959d1[_0xc4a4('0x115')](path[_0xc4a4('0x116')](_0x39b3f4[_0xc4a4('0x114')](_0xc4a4('0x117'))+_0xc4a4('0x118')));});};
\ No newline at end of file
+var _0x5394=['./api/smsInteraction','/api/sms/messages','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/interactions','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/proactive_actions','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./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/schedule','/api/sounds','./api/sound','./api/tag','/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/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','/api/attachments','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/notifications','./api/notification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','1.0.16','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express-winston','./errors','./config/environment','api','./config/logger','auth','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','connection','remoteAddress','url','statusCode','user','name','role','device','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','x-forwarded-for','other','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions'];(function(_0x328470,_0x215663){var _0x62c82b=function(_0x5daf7f){while(--_0x5daf7f){_0x328470['push'](_0x328470['shift']());}};_0x62c82b(++_0x215663);}(_0x5394,0xc5));var _0x4539=function(_0x3871d7,_0x3cfcc5){_0x3871d7=_0x3871d7-0x0;var _0x28ec09=_0x5394[_0x3871d7];return _0x28ec09;};'use strict';var path=require(_0x4539('0x0'));var express=require('express');var ewinston=require(_0x4539('0x1'));var util=require('util');var errors=require(_0x4539('0x2'));var config=require(_0x4539('0x3'));var logger=require('./config/logger')(_0x4539('0x4'));var authLogger=require(_0x4539('0x5'))(_0x4539('0x6'));exports[_0x4539('0x7')]=function(_0x5922eb){_0x5922eb[_0x4539('0x8')](ewinston[_0x4539('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x48fb99,_0x57379a){return util[_0x4539('0xa')](_0x4539('0xb'),_0x48fb99[_0x4539('0xc')],_0x48fb99[_0x4539('0xd')]['x-forwarded-for']?_0x48fb99[_0x4539('0xd')]['x-forwarded-for']:_0x48fb99[_0x4539('0xe')][_0x4539('0xf')]||_0x48fb99['ip'],_0x48fb99[_0x4539('0x10')],_0x57379a[_0x4539('0x11')],_0x57379a['responseTime'],_0x48fb99[_0x4539('0x12')]?_0x48fb99[_0x4539('0x12')]['id']:null,_0x48fb99[_0x4539('0x12')]?_0x48fb99[_0x4539('0x12')][_0x4539('0x13')]:null,_0x48fb99[_0x4539('0x12')]?_0x48fb99['user'][_0x4539('0x14')]:null);}}));_0x5922eb['use'](ewinston[_0x4539('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4bdeaf,_0x5c315b){var _0x462885='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x4bdeaf['body']&&_0x4bdeaf['body'][_0x4539('0x15')]&&_0x4bdeaf[_0x4539('0x16')][_0x4539('0x17')]){_0x462885=_0x4539('0x18');}return util['format'](_0x462885,_0x4bdeaf['method'],_0x4bdeaf[_0x4539('0xd')][_0x4539('0x19')]?_0x4bdeaf[_0x4539('0xd')][_0x4539('0x19')]:_0x4bdeaf[_0x4539('0xe')][_0x4539('0xf')]||_0x4bdeaf['ip'],_0x4bdeaf[_0x4539('0x10')],_0x5c315b[_0x4539('0x11')],_0x5c315b['responseTime'],_0x4bdeaf['user']?_0x4bdeaf[_0x4539('0x12')]['id']:null,_0x4bdeaf['user']?_0x4bdeaf['user']['name']:null,_0x4bdeaf[_0x4539('0x12')]?_0x4bdeaf['user']['role']:null,_0x4bdeaf['body']&&_0x4bdeaf[_0x4539('0x16')][_0x4539('0x15')]?_0x4bdeaf[_0x4539('0x16')][_0x4539('0x15')]:_0x4539('0x1a'),_0x4bdeaf[_0x4539('0x16')]&&_0x4bdeaf[_0x4539('0x16')][_0x4539('0x17')]?_0x4bdeaf[_0x4539('0x16')][_0x4539('0x17')]:'',_0x4bdeaf['body']&&_0x4bdeaf['body']['agent_name']?_0x4bdeaf[_0x4539('0x16')]['agent_name']:'');},'ignoreRoute':function(_0x4ffd4d){var _0x508790=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x508790[_0x4539('0x1b')](_0x4ffd4d[_0x4539('0x10')]);}}));_0x5922eb[_0x4539('0x8')](_0x4539('0x1c'),require(_0x4539('0x1d')));_0x5922eb[_0x4539('0x8')](_0x4539('0x1e'),require(_0x4539('0x1f')));_0x5922eb[_0x4539('0x8')](_0x4539('0x20'),require(_0x4539('0x21')));_0x5922eb[_0x4539('0x8')]('/api/voice/extensions',require(_0x4539('0x22')));_0x5922eb[_0x4539('0x8')](_0x4539('0x23'),require('./api/voiceMusicOnHold'));_0x5922eb[_0x4539('0x8')]('/api/voice/queues',require(_0x4539('0x24')));_0x5922eb[_0x4539('0x8')](_0x4539('0x25'),require(_0x4539('0x26')));_0x5922eb[_0x4539('0x8')](_0x4539('0x27'),require(_0x4539('0x28')));_0x5922eb[_0x4539('0x8')](_0x4539('0x29'),require('./api/voiceMail'));_0x5922eb[_0x4539('0x8')](_0x4539('0x2a'),require(_0x4539('0x2b')));_0x5922eb[_0x4539('0x8')](_0x4539('0x2c'),require(_0x4539('0x2d')));_0x5922eb['use']('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x5922eb[_0x4539('0x8')](_0x4539('0x2e'),require(_0x4539('0x2f')));_0x5922eb[_0x4539('0x8')](_0x4539('0x30'),require(_0x4539('0x31')));_0x5922eb[_0x4539('0x8')](_0x4539('0x32'),require(_0x4539('0x33')));_0x5922eb[_0x4539('0x8')](_0x4539('0x34'),require('./api/trunk'));_0x5922eb[_0x4539('0x8')](_0x4539('0x35'),require('./api/voiceTransferReport'));_0x5922eb[_0x4539('0x8')](_0x4539('0x36'),require(_0x4539('0x37')));_0x5922eb[_0x4539('0x8')]('/api/mail/accounts',require(_0x4539('0x38')));_0x5922eb[_0x4539('0x8')](_0x4539('0x39'),require('./api/mailQueue'));_0x5922eb['use'](_0x4539('0x3a'),require(_0x4539('0x3b')));_0x5922eb[_0x4539('0x8')]('/api/mail/interactions',require(_0x4539('0x3c')));_0x5922eb['use'](_0x4539('0x3d'),require('./api/mailMessage'));_0x5922eb[_0x4539('0x8')]('/api/mail/applications',require(_0x4539('0x3e')));_0x5922eb[_0x4539('0x8')](_0x4539('0x3f'),require(_0x4539('0x40')));_0x5922eb[_0x4539('0x8')](_0x4539('0x41'),require(_0x4539('0x42')));_0x5922eb[_0x4539('0x8')]('/api/dashboards/items',require(_0x4539('0x43')));_0x5922eb[_0x4539('0x8')](_0x4539('0x44'),require(_0x4539('0x45')));_0x5922eb[_0x4539('0x8')](_0x4539('0x46'),require(_0x4539('0x47')));_0x5922eb[_0x4539('0x8')](_0x4539('0x48'),require('./api/faxInteraction'));_0x5922eb[_0x4539('0x8')]('/api/fax/messages',require(_0x4539('0x49')));_0x5922eb[_0x4539('0x8')](_0x4539('0x4a'),require(_0x4539('0x4b')));_0x5922eb[_0x4539('0x8')]('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x5922eb[_0x4539('0x8')]('/api/sms/accounts',require(_0x4539('0x4c')));_0x5922eb[_0x4539('0x8')](_0x4539('0x4d'),require(_0x4539('0x4e')));_0x5922eb[_0x4539('0x8')](_0x4539('0x4f'),require(_0x4539('0x50')));_0x5922eb[_0x4539('0x8')](_0x4539('0x51'),require('./api/smsMessage'));_0x5922eb[_0x4539('0x8')](_0x4539('0x52'),require('./api/smsQueue'));_0x5922eb['use'](_0x4539('0x53'),require(_0x4539('0x54')));_0x5922eb[_0x4539('0x8')](_0x4539('0x55'),require('./api/openchannelApplication'));_0x5922eb[_0x4539('0x8')](_0x4539('0x56'),require(_0x4539('0x57')));_0x5922eb[_0x4539('0x8')](_0x4539('0x58'),require('./api/openchannelMessage'));_0x5922eb['use'](_0x4539('0x59'),require(_0x4539('0x5a')));_0x5922eb[_0x4539('0x8')](_0x4539('0x5b'),require(_0x4539('0x5c')));_0x5922eb[_0x4539('0x8')](_0x4539('0x5d'),require('./api/openchannelQueueReport'));_0x5922eb[_0x4539('0x8')]('/api/chat/applications',require('./api/chatApplication'));_0x5922eb[_0x4539('0x8')](_0x4539('0x5e'),require('./api/chatInteraction'));_0x5922eb[_0x4539('0x8')](_0x4539('0x5f'),require('./api/chatMessage'));_0x5922eb[_0x4539('0x8')]('/api/chat/offline_messages',require(_0x4539('0x60')));_0x5922eb[_0x4539('0x8')](_0x4539('0x61'),require(_0x4539('0x62')));_0x5922eb[_0x4539('0x8')]('/api/chat/groups',require('./api/chatGroup'));_0x5922eb[_0x4539('0x8')](_0x4539('0x63'),require('./api/chatProactiveAction'));_0x5922eb[_0x4539('0x8')]('/api/cm/companies',require(_0x4539('0x64')));_0x5922eb['use'](_0x4539('0x65'),require(_0x4539('0x66')));_0x5922eb[_0x4539('0x8')](_0x4539('0x67'),require('./api/cmHopper'));_0x5922eb[_0x4539('0x8')](_0x4539('0x68'),require('./api/cmHopperBlack'));_0x5922eb[_0x4539('0x8')]('/api/cm/hopper_final',require(_0x4539('0x69')));_0x5922eb[_0x4539('0x8')](_0x4539('0x6a'),require(_0x4539('0x6b')));_0x5922eb['use'](_0x4539('0x6c'),require(_0x4539('0x6d')));_0x5922eb[_0x4539('0x8')]('/api/actions',require(_0x4539('0x6e')));_0x5922eb[_0x4539('0x8')]('/api/automations',require(_0x4539('0x6f')));_0x5922eb[_0x4539('0x8')](_0x4539('0x70'),require(_0x4539('0x71')));_0x5922eb[_0x4539('0x8')]('/api/dispositions',require(_0x4539('0x72')));_0x5922eb['use'](_0x4539('0x73'),require(_0x4539('0x74')));_0x5922eb[_0x4539('0x8')]('/api/intervals',require(_0x4539('0x75')));_0x5922eb[_0x4539('0x8')](_0x4539('0x76'),require(_0x4539('0x77')));_0x5922eb[_0x4539('0x8')]('/api/cdr',require(_0x4539('0x78')));_0x5922eb[_0x4539('0x8')](_0x4539('0x79'),require(_0x4539('0x7a')));_0x5922eb[_0x4539('0x8')](_0x4539('0x7b'),require(_0x4539('0x7c')));_0x5922eb['use'](_0x4539('0x7d'),require(_0x4539('0x7e')));_0x5922eb[_0x4539('0x8')]('/api/tags',require(_0x4539('0x7f')));_0x5922eb[_0x4539('0x8')](_0x4539('0x80'),require('./api/template'));_0x5922eb['use'](_0x4539('0x81'),require('./api/trigger'));_0x5922eb[_0x4539('0x8')]('/api/variables',require(_0x4539('0x82')));_0x5922eb[_0x4539('0x8')](_0x4539('0x83'),require(_0x4539('0x84')));_0x5922eb[_0x4539('0x8')](_0x4539('0x85'),require(_0x4539('0x86')));_0x5922eb[_0x4539('0x8')](_0x4539('0x87'),require(_0x4539('0x88')));_0x5922eb['use'](_0x4539('0x89'),require(_0x4539('0x8a')));_0x5922eb[_0x4539('0x8')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x5922eb[_0x4539('0x8')]('/api/analytics/metrics',require(_0x4539('0x8b')));_0x5922eb[_0x4539('0x8')](_0x4539('0x8c'),require(_0x4539('0x8d')));_0x5922eb[_0x4539('0x8')](_0x4539('0x8e'),require(_0x4539('0x8f')));_0x5922eb[_0x4539('0x8')]('/api/integrations/salesforce/accounts',require(_0x4539('0x90')));_0x5922eb[_0x4539('0x8')](_0x4539('0x91'),require('./api/intSalesforceConfiguration'));_0x5922eb['use']('/api/integrations/salesforce/fields',require(_0x4539('0x92')));_0x5922eb['use'](_0x4539('0x93'),require('./api/intSugarcrmAccount'));_0x5922eb[_0x4539('0x8')]('/api/integrations/sugarcrm/configurations',require(_0x4539('0x94')));_0x5922eb[_0x4539('0x8')](_0x4539('0x95'),require(_0x4539('0x96')));_0x5922eb['use']('/api/integrations/desk/accounts',require(_0x4539('0x97')));_0x5922eb[_0x4539('0x8')](_0x4539('0x98'),require(_0x4539('0x99')));_0x5922eb[_0x4539('0x8')](_0x4539('0x9a'),require(_0x4539('0x9b')));_0x5922eb[_0x4539('0x8')](_0x4539('0x9c'),require('./api/intZohoAccount'));_0x5922eb[_0x4539('0x8')](_0x4539('0x9d'),require(_0x4539('0x9e')));_0x5922eb[_0x4539('0x8')](_0x4539('0x9f'),require(_0x4539('0xa0')));_0x5922eb[_0x4539('0x8')]('/api/integrations/zendesk/accounts',require(_0x4539('0xa1')));_0x5922eb['use'](_0x4539('0xa2'),require('./api/intZendeskConfiguration'));_0x5922eb[_0x4539('0x8')]('/api/integrations/zendesk/fields',require(_0x4539('0xa3')));_0x5922eb[_0x4539('0x8')](_0x4539('0xa4'),require(_0x4539('0xa5')));_0x5922eb[_0x4539('0x8')](_0x4539('0xa6'),require(_0x4539('0xa7')));_0x5922eb['use'](_0x4539('0xa8'),require(_0x4539('0xa9')));_0x5922eb[_0x4539('0x8')](_0x4539('0xaa'),require(_0x4539('0xab')));_0x5922eb[_0x4539('0x8')](_0x4539('0xac'),require(_0x4539('0xad')));_0x5922eb[_0x4539('0x8')](_0x4539('0xae'),require(_0x4539('0xaf')));_0x5922eb[_0x4539('0x8')](_0x4539('0xb0'),require(_0x4539('0xb1')));_0x5922eb['use'](_0x4539('0xb2'),require('./api/intServicenowConfiguration'));_0x5922eb['use']('/api/integrations/servicenow/fields',require(_0x4539('0xb3')));_0x5922eb[_0x4539('0x8')]('/api/integrations/dynamics365/accounts',require(_0x4539('0xb4')));_0x5922eb[_0x4539('0x8')]('/api/integrations/dynamics365/configurations',require(_0x4539('0xb5')));_0x5922eb[_0x4539('0x8')](_0x4539('0xb6'),require('./api/intDynamics365Field'));_0x5922eb[_0x4539('0x8')](_0x4539('0xb7'),require(_0x4539('0xb8')));_0x5922eb[_0x4539('0x8')](_0x4539('0xb9'),require(_0x4539('0xba')));_0x5922eb[_0x4539('0x8')](_0x4539('0xbb'),require('./api/intFreshsalesField'));_0x5922eb[_0x4539('0x8')](_0x4539('0xbc'),require(_0x4539('0xbd')));_0x5922eb[_0x4539('0x8')](_0x4539('0xbe'),require(_0x4539('0xbf')));_0x5922eb['use'](_0x4539('0xc0'),require(_0x4539('0xc1')));_0x5922eb['use']('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x5922eb[_0x4539('0x8')]('/api/jscripty/questions/reports',require(_0x4539('0xc2')));_0x5922eb[_0x4539('0x8')](_0x4539('0xc3'),require('./api/jscriptySessionReport'));_0x5922eb['use'](_0x4539('0xc4'),require(_0x4539('0xc5')));_0x5922eb['use'](_0x4539('0xc6'),require(_0x4539('0xc7')));_0x5922eb[_0x4539('0x8')](_0x4539('0xc8'),require(_0x4539('0xc9')));_0x5922eb[_0x4539('0x8')](_0x4539('0xca'),require(_0x4539('0xcb')));_0x5922eb[_0x4539('0x8')](_0x4539('0xcc'),require(_0x4539('0xcd')));_0x5922eb[_0x4539('0x8')](_0x4539('0xce'),require(_0x4539('0xcf')));_0x5922eb[_0x4539('0x8')](_0x4539('0xd0'),require(_0x4539('0xd1')));_0x5922eb[_0x4539('0x8')]('/api/square/recordings',require(_0x4539('0xd2')));_0x5922eb['use'](_0x4539('0xd3'),require(_0x4539('0xd4')));_0x5922eb[_0x4539('0x8')](_0x4539('0xd5'),require(_0x4539('0xd6')));_0x5922eb[_0x4539('0x8')]('/api/license',require(_0x4539('0xd7')));_0x5922eb[_0x4539('0x8')](_0x4539('0xd8'),require(_0x4539('0xd9')));_0x5922eb[_0x4539('0x8')]('/api/migrations',require('./api/migration'));_0x5922eb['use'](_0x4539('0xda'),require('./api/attachment'));_0x5922eb[_0x4539('0x8')](_0x4539('0xdb'),require(_0x4539('0xdc')));_0x5922eb[_0x4539('0x8')]('/api/mail/reports/transfer',require(_0x4539('0xdd')));_0x5922eb[_0x4539('0x8')](_0x4539('0xde'),require(_0x4539('0xdf')));_0x5922eb['use'](_0x4539('0xe0'),require(_0x4539('0xe1')));_0x5922eb[_0x4539('0x8')](_0x4539('0xe2'),require(_0x4539('0xe3')));_0x5922eb[_0x4539('0x8')]('/api/sms/reports/transfer',require(_0x4539('0xe4')));_0x5922eb['use']('/api/cm/lists',require(_0x4539('0xe5')));_0x5922eb['use'](_0x4539('0xe6'),require('./api/voicePrefix'));_0x5922eb[_0x4539('0x8')]('/api/userProfiles',require(_0x4539('0xe7')));_0x5922eb[_0x4539('0x8')](_0x4539('0xe8'),require(_0x4539('0xe9')));_0x5922eb[_0x4539('0x8')](_0x4539('0xea'),require(_0x4539('0xeb')));_0x5922eb[_0x4539('0x8')](_0x4539('0xec'),require(_0x4539('0xed')));_0x5922eb[_0x4539('0x8')](_0x4539('0xee'),require(_0x4539('0xef')));_0x5922eb[_0x4539('0x8')]('/api/whatsapp/applications',require(_0x4539('0xf0')));_0x5922eb[_0x4539('0x8')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0x5922eb[_0x4539('0x8')](_0x4539('0xf1'),require(_0x4539('0xf2')));_0x5922eb[_0x4539('0x8')]('/api/whatsapp/reports/queue',require(_0x4539('0xf3')));_0x5922eb[_0x4539('0x8')]('/api/whatsapp/reports/transfer',require(_0x4539('0xf4')));_0x5922eb['use'](_0x4539('0xf5'),require('./api/whatsappQueue'));_0x5922eb['use'](_0x4539('0xf6'),require(_0x4539('0xf7')));_0x5922eb[_0x4539('0x8')]('/api/auth/local',require(_0x4539('0xf8')));_0x5922eb[_0x4539('0x8')](_0x4539('0xf9'),require(_0x4539('0xfa')));_0x5922eb[_0x4539('0x8')](_0x4539('0xfb'),require(_0x4539('0xfc')));_0x5922eb[_0x4539('0x8')](_0x4539('0xfd'),require(_0x4539('0xfe')));_0x5922eb[_0x4539('0x8')]('/api/version',require(_0x4539('0xff')));_0x5922eb[_0x4539('0x8')](_0x4539('0x100'),require(_0x4539('0x101')));_0x5922eb[_0x4539('0x8')]('/api/pm2',require(_0x4539('0x102')));_0x5922eb[_0x4539('0x8')](_0x4539('0x103'),require(_0x4539('0x104')));_0x5922eb[_0x4539('0x8')](_0x4539('0x105'),express[_0x4539('0x106')](path[_0x4539('0x107')](config[_0x4539('0x108')],_0x4539('0x105'))));_0x5922eb[_0x4539('0x8')]('/www',express['static'](path[_0x4539('0x107')](config[_0x4539('0x108')],_0x4539('0x109'))));_0x5922eb[_0x4539('0x8')](_0x4539('0x10a'),express[_0x4539('0x106')](path[_0x4539('0x107')](config[_0x4539('0x108')],_0x4539('0x10a'))));_0x5922eb[_0x4539('0x8')](_0x4539('0x10b'),express[_0x4539('0x106')](path[_0x4539('0x107')](config[_0x4539('0x108')],_0x4539('0x10c'),_0x4539('0x10d'))));_0x5922eb[_0x4539('0x8')]('/plugins',express[_0x4539('0x106')](path[_0x4539('0x107')](config[_0x4539('0x108')],_0x4539('0x10e'))));_0x5922eb[_0x4539('0x10f')](_0x4539('0x110'))[_0x4539('0x111')](errors[0x194]);_0x5922eb['route']('/*')[_0x4539('0x111')](function(_0x21c0c9,_0x48ea75){_0x48ea75[_0x4539('0x112')](path['resolve'](_0x5922eb[_0x4539('0x111')](_0x4539('0x113'))+_0x4539('0x114')));});};
\ No newline at end of file
index 4b66696..3439b7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16c4=['../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','bluebird','lodash','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.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/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16c4,0xa4));var _0x416c=function(_0x456bd2,_0x156c79){_0x456bd2=_0x456bd2-0x0;var _0x2218c1=_0x16c4[_0x456bd2];return _0x2218c1;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x416c('0x0'));var _=require(_0x416c('0x1'));var config=require('../config/environment');exports[_0x416c('0x2')]=function(){return new BPromise(function(_0x276b70,_0x1b1d30){var _0xb1649f={};_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x3')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x5')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x6')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x7')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x8')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x9')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0xa')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0xb')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require('../api/memberReport/memberReport.rpc'));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0xc')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0xd')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0xe')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0xf')));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x10')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x11')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x12')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x13')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x14')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x15')));_0xb1649f=_['merge'](_0xb1649f,require('../api/faxApplication/faxApplication.rpc'));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x16')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x17')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x18')));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x19')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x1a')));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x1b')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require('../api/smsMessage/smsMessage.rpc'));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x1c')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x1d')));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x1e')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x1f')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x20')));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x21')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require('../api/chatInteraction/chatInteraction.rpc'));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x22')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require('../api/chatQueue/chatQueue.rpc'));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x23')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require('../api/cmHopper/cmHopper.rpc'));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x24')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x25')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x26')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x27')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x28')));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x29')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x2a')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x2b')));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x2c')));_0xb1649f=_['merge'](_0xb1649f,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x2d')));_0xb1649f=_['merge'](_0xb1649f,require('../api/intDeskAccount/intDeskAccount.rpc'));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x2e')));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x2f')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0xb1649f=_['merge'](_0xb1649f,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x30')));_0xb1649f=_['merge'](_0xb1649f,require(_0x416c('0x31')));_0xb1649f=_['merge'](_0xb1649f,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x32')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x33')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x34')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x35')));_0xb1649f=_['merge'](_0xb1649f,require('../api/squareOdbc/squareOdbc.rpc'));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require('../api/squareProject/squareProject.rpc'));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x36')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x37')));_0xb1649f=_['merge'](_0xb1649f,require('../api/campaign/campaign.rpc'));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x38')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x39')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require('../api/whatsappAccount/whatsappAccount.rpc'));_0xb1649f=_['merge'](_0xb1649f,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require('../api/whatsappMessage/whatsappMessage.rpc'));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x3a')));_0xb1649f=_[_0x416c('0x4')](_0xb1649f,require(_0x416c('0x3b')));var _0x34ba45=jayson[_0x416c('0x3c')](_0xb1649f)[_0x416c('0x3d')]();var _0x29e99e=config['rpc']['port']||config[_0x416c('0x3e')]+0x1;var _0xe730f5=config[_0x416c('0x3f')]['ip']||'localhost';_0x34ba45['on'](_0x416c('0x40'),function(_0x51d9ee){return _0x1b1d30(_0x51d9ee);});_0x34ba45[_0x416c('0x2')](_0x29e99e,_0xe730f5,function(){console[_0x416c('0x41')](_0x416c('0x42'),_0xe730f5,_0x29e99e);require(_0x416c('0x43'))[_0x416c('0x44')]();return _0x276b70('RPC\x20listening\x20on\x20'+_0xe730f5+':'+_0x29e99e);});});};
\ No newline at end of file
+var _0xdb2b=['../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','bluebird','lodash','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../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/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/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/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xdb2b,0x1bc));var _0xbdb2=function(_0x8c9741,_0x1362c8){_0x8c9741=_0x8c9741-0x0;var _0x580e3e=_0xdb2b[_0x8c9741];return _0x580e3e;};'use strict';var jayson=require(_0xbdb2('0x0'));var BPromise=require(_0xbdb2('0x1'));var _=require(_0xbdb2('0x2'));var config=require('../config/environment');exports[_0xbdb2('0x3')]=function(){return new BPromise(function(_0x1d05cd,_0x5cb95b){var _0x18fe99={};_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x4')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x6')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/voiceQueue/voiceQueue.rpc'));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/voiceRecording/voiceRecording.rpc'));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x7')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x8')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x9')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0xa')));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0xb')));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0xc')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0xd')));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0xe')));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0xf')));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x10')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x11')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/mailInteraction/mailInteraction.rpc'));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x12')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x13')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x14')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x15')));_0x18fe99=_['merge'](_0x18fe99,require('../api/faxApplication/faxApplication.rpc'));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x16')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/faxMessage/faxMessage.rpc'));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x17')));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x18')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x19')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x1a')));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x1b')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x1c')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x1d')));_0x18fe99=_['merge'](_0x18fe99,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x1e')));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x1f')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x20')));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x21')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x22')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x23')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x24')));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x25')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x26')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x27')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x28')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x29')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x2a')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x2b')));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x2c')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x2d')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x2e')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/variable/variable.rpc'));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x2f')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x30')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x31')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x32')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x33')));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x34')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x35')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x36')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x37')));_0x18fe99=_['merge'](_0x18fe99,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x38')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/squareProject/squareProject.rpc'));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/squareRecording/squareRecording.rpc'));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x39')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x3a')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/attachment/attachment.rpc'));_0x18fe99=_['merge'](_0x18fe99,require(_0xbdb2('0x3b')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require(_0xbdb2('0x3c')));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x18fe99=_[_0xbdb2('0x5')](_0x18fe99,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x18fe99=_['merge'](_0x18fe99,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x189ed2=jayson[_0xbdb2('0x3d')](_0x18fe99)[_0xbdb2('0x3e')]();var _0x43d938=config[_0xbdb2('0x3f')][_0xbdb2('0x40')]||config[_0xbdb2('0x40')]+0x1;var _0x698b6e=config[_0xbdb2('0x3f')]['ip']||_0xbdb2('0x41');_0x189ed2['on'](_0xbdb2('0x42'),function(_0x44ea8f){return _0x5cb95b(_0x44ea8f);});_0x189ed2[_0xbdb2('0x3')](_0x43d938,_0x698b6e,function(){console[_0xbdb2('0x43')](_0xbdb2('0x44'),_0x698b6e,_0x43d938);require(_0xbdb2('0x45'))[_0xbdb2('0x46')]();return _0x1d05cd('RPC\x20listening\x20on\x20'+_0x698b6e+':'+_0x43d938);});});};
\ No newline at end of file
index d6b1d72..8eb904a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6610=['toString','replace','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','getvariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','label','exports','util','lodash','EventEmitter','./reply','./error','call','setEncoding','utf8','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','result=','indexOf','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','log','write','inherits','sendRequest','sync','prototype','answer','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isNumber'];(function(_0x389da3,_0x1208ed){var _0x5a8e6c=function(_0x1387d5){while(--_0x1387d5){_0x389da3['push'](_0x389da3['shift']());}};_0x5a8e6c(++_0x1208ed);}(_0x6610,0xfb));var _0x0661=function(_0xbacfc2,_0x1f50bb){_0xbacfc2=_0xbacfc2-0x0;var _0x21c6c3=_0x6610[_0xbacfc2];return _0x21c6c3;};'use strict';var util=require(_0x0661('0x0'));var _=require(_0x0661('0x1'));var EventEmitter=require('events')[_0x0661('0x2')];var AGIReply=require(_0x0661('0x3'));var AGIError=require(_0x0661('0x4'));function AGIChannel(_0x1a736f){var _0x9912da=this,_0x1ff388=new AGIReply(),_0x545c4f=![],_0x8c0382={};EventEmitter[_0x0661('0x5')](_0x9912da);_0x1a736f[_0x0661('0x6')](_0x0661('0x7'));_0x1a736f['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1ff388['setEncoding'](_0x0661('0x7'));_0x1ff388['on']('headers',function(_0xe31352){for(var _0x3fa280 in _0xe31352){_0x9912da[_0x3fa280]=_0xe31352[_0x3fa280];}_0x9912da[_0x0661('0x8')](_0x0661('0x9'));});_0x1ff388['on'](_0x0661('0xa'),function(_0x3878f5){if(_0x3878f5[_0x0661('0xb')]()==_0x0661('0xc')){_0x9912da[_0x0661('0x8')](_0x0661('0xc'));return;}if(_0x3878f5['substring'](0x0,0xb)==_0x0661('0xd')){_0x545c4f=!![];}if(_0x545c4f){_0x8c0382['rx']+=_0x3878f5+'\x0a';if(_0x3878f5[_0x0661('0xe')](_0x0661('0xf'))!=-0x1){_0x545c4f=![];}}else{_0x8c0382['rx']=_0x3878f5;}if(_0x545c4f){return;}if(typeof _0x8c0382['cb']==_0x0661('0x10')){var _0x1f3542=_0x8c0382['rx'][_0x0661('0x11')](0x0,0x3),_0x1f09e7=null,_0xb80e35=null;_0x1f3542=parseInt(_0x1f3542);if(isNaN(_0x1f3542)){_0x8c0382['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x0661('0x12')});return;}if(_0x1f3542!=0xc8){_0x8c0382['cb'](null,{'code':_0x1f3542,'result':-0x1,'extra':'KO'});return;}_0x1f09e7=_0x8c0382['rx'][_0x0661('0x11')](0x4)['replace'](_0x0661('0x13'),'');if(_0x1f09e7[_0x0661('0x14')]('\x20')!=-0x1){_0x1f09e7=_0x1f09e7['substr'](0x0,_0x1f09e7[_0x0661('0x14')]('\x20'));}if(_[_0x0661('0x15')](_0x1f09e7,'-1')){_0x1f09e7=parseInt(_0x1f09e7);}_0xb80e35=_0x8c0382['rx'][_0x0661('0x16')]('\x20');if(_0xb80e35['length']==0x3){_0xb80e35=_0xb80e35[0x2][_0x0661('0x11')](0x1,_0xb80e35[0x2][_0x0661('0x17')]-0x1);}else if(_0xb80e35[_0x0661('0x17')]>0x3){var _0x1e8956=/\((.+)\)/;var _0x5d2d01=_0x8c0382['rx'][_0x0661('0x18')](_0x1e8956);if(_0x5d2d01){_0xb80e35=_0x5d2d01[0x1];}else{_0xb80e35=null;}}else{_0xb80e35=null;}_0x8c0382['cb'](null,{'code':_0x1f3542,'result':_0x1f09e7,'extra':_0xb80e35});}});_0x1a736f['on']('error',function(_0x3352cf){_0x9912da[_0x0661('0x8')](_0x0661('0x19'),new AGIError('E_AGI_SOCKET_ERROR',_0x3352cf[_0x0661('0x1a')]));});_0x1a736f['on'](_0x0661('0x1b'),function(){_0x9912da[_0x0661('0x8')](_0x0661('0x1b'),new AGIError(_0x0661('0x1c')));});_0x1a736f['on']('timeout',function(){_0x9912da[_0x0661('0x8')](_0x0661('0x1d'),new AGIError(_0x0661('0x1e')));_0x1a736f[_0x0661('0x1f')]();});_0x1a736f[_0x0661('0x20')](_0x1ff388);this[_0x0661('0x21')]=function(_0x27fcbc,_0x48164f){console[_0x0661('0x22')]('command=',_0x27fcbc);var _0x27fcbc=_0x27fcbc||'',_0x48164f=typeof _0x48164f==_0x0661('0x10')?_0x48164f:new Function();_0x8c0382={'tx':_0x27fcbc,'rx':'','cb':_0x48164f};_0x1a736f[_0x0661('0x23')](_0x27fcbc+'\x0a');},this[_0x0661('0x1b')]=function(){_0x1a736f['destroy']();};}util[_0x0661('0x24')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x0661('0x25')]=function(_0x2dd2e2){return this['command'][_0x0661('0x26')](this,_0x2dd2e2);};AGIChannel[_0x0661('0x27')][_0x0661('0x28')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x0661('0x27')]['getData']=function(_0x4b0211,_0x22f3ea,_0xb938a1){_0x4b0211=_0x4b0211===undefined?_0x0661('0x29'):_0x4b0211;_0x22f3ea=_0x22f3ea===undefined?'5':_0x22f3ea;_0xb938a1=_0xb938a1===undefined?'1':_0xb938a1;return this[_0x0661('0x25')](util['format'](_0x0661('0x2a'),_0x4b0211,_0x22f3ea*0x3e8,_0xb938a1));};AGIChannel[_0x0661('0x27')][_0x0661('0x2b')]=function(_0x35fe87){_0x35fe87=_0x35fe87||'NO\x20MESSAGE';return this['sendRequest'](util[_0x0661('0x2c')](_0x0661('0x2d'),_0x35fe87));};AGIChannel[_0x0661('0x27')][_0x0661('0x2e')]=function(_0x46ccba,_0x1437b4){if(_[_0x0661('0x2f')](_0x1437b4)){return this[_0x0661('0x25')](util[_0x0661('0x2c')](_0x0661('0x30'),_0x46ccba,_0x1437b4['join'](',')));}return this['sendRequest'](util['format'](_0x0661('0x30'),_0x46ccba,_0x1437b4));};AGIChannel[_0x0661('0x27')][_0x0661('0x31')]=function(_0x531dd3){return this[_0x0661('0x25')](util['format'](_0x0661('0x32'),_0x531dd3));};AGIChannel[_0x0661('0x27')][_0x0661('0x33')]=function(_0x4a8253){return this['sendRequest'](util[_0x0661('0x2c')](_0x0661('0x34'),_0x4a8253));};AGIChannel[_0x0661('0x27')][_0x0661('0x35')]=function(_0x52a19a){return this[_0x0661('0x25')](util[_0x0661('0x2c')](_0x0661('0x36'),_0x52a19a));};AGIChannel[_0x0661('0x27')][_0x0661('0xc')]=function(){return this[_0x0661('0x25')](_0x0661('0x37'));};AGIChannel['prototype']['setVariable']=function(_0x53124b,_0x31059d){var _0xe63015=_['isBoolean'](_0x31059d)||_[_0x0661('0x38')](_0x31059d)?_0x31059d[_0x0661('0x39')]():_0x31059d;return this[_0x0661('0x25')](util[_0x0661('0x2c')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x53124b,_0xe63015?_0xe63015[_0x0661('0x39')]()[_0x0661('0x3a')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x0661('0x27')]['sayNumber']=function(_0x5055ff,_0x5610be){return this[_0x0661('0x25')](util[_0x0661('0x2c')]('SAY\x20NUMBER\x20%s\x20%s',_0x5055ff,_0x5610be));};AGIChannel[_0x0661('0x27')][_0x0661('0x3b')]=function(_0x327338,_0x3f1dac){return this[_0x0661('0x25')](util['format'](_0x0661('0x3c'),_0x327338,_0x3f1dac));};AGIChannel[_0x0661('0x27')][_0x0661('0x3d')]=function(_0x55210d,_0x15b574){return this['sendRequest'](util[_0x0661('0x2c')](_0x0661('0x3e'),_0x55210d,_0x15b574));};AGIChannel[_0x0661('0x27')][_0x0661('0x3f')]=function(_0x4e48ce,_0x399429,_0x2e4463){_0x399429=_0x399429||this['extension'];_0x2e4463=_0x2e4463||0x1;this[_0x0661('0x31')](_0x4e48ce);this[_0x0661('0x33')](_0x399429);this[_0x0661('0x35')](_0x2e4463);return this[_0x0661('0x2b')](util[_0x0661('0x2c')]('GOTO\x20%s\x20%s\x20%s',_0x4e48ce,_0x399429,_0x2e4463));};AGIChannel[_0x0661('0x27')]['getVariable']=function(_0x566fc2){console[_0x0661('0x22')](_0x0661('0x40'),_0x566fc2);return this[_0x0661('0x25')](util['format'](_0x0661('0x41'),_0x566fc2));};AGIChannel['prototype'][_0x0661('0x42')]=function(_0x26db20,_0x1949dd,_0x385823,_0x1a33be,_0x31b1d5,_0x144c85){_0x1949dd=_0x1949dd||_0x0661('0x43');_0x385823=_0x385823||'';_0x1a33be=_0x1a33be===undefined?-0x1:_0x1a33be==='-1'?-0x1:_0x1a33be*0x3e8;_0x31b1d5=_0x31b1d5===undefined?'':'s='+_0x31b1d5;_0x144c85=_0x144c85?'BEEP':'';return this['sendRequest'](util[_0x0661('0x2c')](_0x0661('0x44'),_0x26db20,_0x1949dd,_0x385823,_0x1a33be,_0x144c85,_0x31b1d5));};AGIChannel['prototype'][_0x0661('0x45')]=function(_0x4bae36,_0x10ff31){_0x10ff31=_0x10ff31||'';return this[_0x0661('0x25')](util[_0x0661('0x2c')](_0x0661('0x46'),_0x4bae36,_0x10ff31));};AGIChannel[_0x0661('0x27')][_0x0661('0x47')]=function(_0x1594f3){return this[_0x0661('0x2e')](_0x0661('0x48'),_0x1594f3);};AGIChannel[_0x0661('0x27')][_0x0661('0x49')]=function(_0x5339cd){return this['exec'](_0x0661('0x4a'),_0x5339cd);};AGIChannel[_0x0661('0x27')][_0x0661('0x19')]=function(_0x29f3ee,_0x40c268){this['noop'](util[_0x0661('0x2c')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x29f3ee['id'],_0x29f3ee[_0x0661('0x4b')],_0x40c268));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0661('0x4c')]=AGIChannel;
\ No newline at end of file
+var _0xa9e0=['utf8','setTimeout','setEncoding','ready','line','toLowerCase','hangup','emit','520\x20End\x20of\x20proper','function','substring','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','write','inherits','prototype','sendRequest','command','sync','ANSWER','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','label','exports','util','lodash','events','./error','call'];(function(_0x2bcda4,_0x946be){var _0x3b7bca=function(_0x5acf34){while(--_0x5acf34){_0x2bcda4['push'](_0x2bcda4['shift']());}};_0x3b7bca(++_0x946be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x0a9e('0x3'));function AGIChannel(_0x4ce2f1){var _0x333808=this,_0x432180=new AGIReply(),_0x2ab90b=![],_0x991246={};EventEmitter[_0x0a9e('0x4')](_0x333808);_0x4ce2f1['setEncoding'](_0x0a9e('0x5'));_0x4ce2f1[_0x0a9e('0x6')](0x8*0x3c*0x3c*0x3e8);_0x432180[_0x0a9e('0x7')]('utf8');_0x432180['on']('headers',function(_0xe42b77){for(var _0x56465b in _0xe42b77){_0x333808[_0x56465b]=_0xe42b77[_0x56465b];}_0x333808['emit'](_0x0a9e('0x8'));});_0x432180['on'](_0x0a9e('0x9'),function(_0x307b3e){if(_0x307b3e[_0x0a9e('0xa')]()==_0x0a9e('0xb')){_0x333808[_0x0a9e('0xc')]('hangup');return;}if(_0x307b3e['substring'](0x0,0xb)=='520-Invalid'){_0x2ab90b=!![];}if(_0x2ab90b){_0x991246['rx']+=_0x307b3e+'\x0a';if(_0x307b3e['search'](_0x0a9e('0xd'))!=-0x1){_0x2ab90b=![];}}else{_0x991246['rx']=_0x307b3e;}if(_0x2ab90b){return;}if(typeof _0x991246['cb']==_0x0a9e('0xe')){var _0xd5b662=_0x991246['rx'][_0x0a9e('0xf')](0x0,0x3),_0x26d672=null,_0x32d742=null;_0xd5b662=parseInt(_0xd5b662);if(isNaN(_0xd5b662)){_0x991246['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xd5b662!=0xc8){_0x991246['cb'](null,{'code':_0xd5b662,'result':-0x1,'extra':'KO'});return;}_0x26d672=_0x991246['rx'][_0x0a9e('0xf')](0x4)[_0x0a9e('0x10')](_0x0a9e('0x11'),'');if(_0x26d672[_0x0a9e('0x12')]('\x20')!=-0x1){_0x26d672=_0x26d672[_0x0a9e('0x13')](0x0,_0x26d672[_0x0a9e('0x12')]('\x20'));}if(_['startsWith'](_0x26d672,'-1')){_0x26d672=parseInt(_0x26d672);}_0x32d742=_0x991246['rx'][_0x0a9e('0x14')]('\x20');if(_0x32d742['length']==0x3){_0x32d742=_0x32d742[0x2][_0x0a9e('0xf')](0x1,_0x32d742[0x2]['length']-0x1);}else if(_0x32d742[_0x0a9e('0x15')]>0x3){var _0x12066b=/\((.+)\)/;var _0x48f32d=_0x991246['rx'][_0x0a9e('0x16')](_0x12066b);if(_0x48f32d){_0x32d742=_0x48f32d[0x1];}else{_0x32d742=null;}}else{_0x32d742=null;}_0x991246['cb'](null,{'code':_0xd5b662,'result':_0x26d672,'extra':_0x32d742});}});_0x4ce2f1['on']('error',function(_0x459eb1){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x17'),new AGIError(_0x0a9e('0x18'),_0x459eb1[_0x0a9e('0x19')]));});_0x4ce2f1['on'](_0x0a9e('0x1a'),function(){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x1a'),new AGIError(_0x0a9e('0x1b')));});_0x4ce2f1['on'](_0x0a9e('0x1c'),function(){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x4ce2f1[_0x0a9e('0x1d')]();});_0x4ce2f1[_0x0a9e('0x1e')](_0x432180);this['command']=function(_0x20f109,_0x5a09ef){var _0x20f109=_0x20f109||'',_0x5a09ef=typeof _0x5a09ef==_0x0a9e('0xe')?_0x5a09ef:new Function();_0x991246={'tx':_0x20f109,'rx':'','cb':_0x5a09ef};_0x4ce2f1[_0x0a9e('0x1f')](_0x20f109+'\x0a');},this[_0x0a9e('0x1a')]=function(){_0x4ce2f1['destroy']();};}util[_0x0a9e('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x22')]=function(_0x4d00e6){return this[_0x0a9e('0x23')][_0x0a9e('0x24')](this,_0x4d00e6);};AGIChannel[_0x0a9e('0x21')]['answer']=function(){return this['sendRequest'](_0x0a9e('0x25'));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x26')]=function(_0x33161b,_0x526cf3,_0x384319){_0x33161b=_0x33161b===undefined?'beep':_0x33161b;_0x526cf3=_0x526cf3===undefined?'5':_0x526cf3;_0x384319=_0x384319===undefined?'1':_0x384319;return this[_0x0a9e('0x22')](util['format'](_0x0a9e('0x27'),_0x33161b,_0x526cf3*0x3e8,_0x384319));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x28')]=function(_0x14433c){_0x14433c=_0x14433c||_0x0a9e('0x29');return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x14433c));};AGIChannel['prototype'][_0x0a9e('0x2c')]=function(_0x468813,_0x2b1f27){if(_[_0x0a9e('0x2d')](_0x2b1f27)){return this['sendRequest'](util[_0x0a9e('0x2a')](_0x0a9e('0x2e'),_0x468813,_0x2b1f27[_0x0a9e('0x2f')](',')));}return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x2e'),_0x468813,_0x2b1f27));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x30')]=function(_0x1dbde2){return this['sendRequest'](util[_0x0a9e('0x2a')]('SET\x20CONTEXT\x20%s',_0x1dbde2));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x31')]=function(_0x1122db){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SET\x20EXTENSION\x20%s',_0x1122db));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x32')]=function(_0x40cb85){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x33'),_0x40cb85));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0xb')]=function(){return this['sendRequest'](_0x0a9e('0x34'));};AGIChannel['prototype'][_0x0a9e('0x35')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41=_['isBoolean'](_0x2b7e7f)||_[_0x0a9e('0x36')](_0x2b7e7f)?_0x2b7e7f[_0x0a9e('0x37')]():_0x2b7e7f;return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x14b13f,_0x3f3d41?_0x3f3d41['toString']()[_0x0a9e('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){return this[_0x0a9e('0x22')](util['format'](_0x0a9e('0x39'),_0x3d9717,_0x381c37));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x3a')]=function(_0x533942,_0x1dbf74){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x533942,_0x1dbf74));};AGIChannel['prototype'][_0x0a9e('0x3b')]=function(_0x40d766,_0x5adda1){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x3c'),_0x40d766,_0x5adda1));};AGIChannel[_0x0a9e('0x21')]['continueAt']=function(_0x5a594b,_0x15e37d,_0x45b3d0){_0x15e37d=_0x15e37d||this['extension'];_0x45b3d0=_0x45b3d0||0x1;this[_0x0a9e('0x30')](_0x5a594b);this[_0x0a9e('0x31')](_0x15e37d);this[_0x0a9e('0x32')](_0x45b3d0);return this['noop'](util[_0x0a9e('0x2a')](_0x0a9e('0x3d'),_0x5a594b,_0x15e37d,_0x45b3d0));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x3e')]=function(_0x13cb1f){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x3f'),_0x13cb1f));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x40')]=function(_0x2c3711,_0x148007,_0x1a7bce,_0x11ca30,_0x37f6cc,_0x4d04c8){_0x148007=_0x148007||'wav';_0x1a7bce=_0x1a7bce||'';_0x11ca30=_0x11ca30===undefined?-0x1:_0x11ca30==='-1'?-0x1:_0x11ca30*0x3e8;_0x37f6cc=_0x37f6cc===undefined?'':'s='+_0x37f6cc;_0x4d04c8=_0x4d04c8?_0x0a9e('0x41'):'';return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x42'),_0x2c3711,_0x148007,_0x1a7bce,_0x11ca30,_0x4d04c8,_0x37f6cc));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x43')]=function(_0x10b040,_0x445e25){_0x445e25=_0x445e25||'';return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x44'),_0x10b040,_0x445e25));};AGIChannel[_0x0a9e('0x21')]['agi']=function(_0x117c99){return this[_0x0a9e('0x2c')](_0x0a9e('0x45'),_0x117c99);};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x46')]=function(_0xbe9d19){return this[_0x0a9e('0x2c')](_0x0a9e('0x47'),_0xbe9d19);};AGIChannel['prototype'][_0x0a9e('0x17')]=function(_0x48fd45,_0x473dc8){this[_0x0a9e('0x28')](util[_0x0a9e('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x48fd45['id'],_0x48fd45[_0x0a9e('0x48')],_0x473dc8));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0a9e('0x49')]=AGIChannel;
\ No newline at end of file
index a2a0265..4ee3ed7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x074a=['E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0xea4811,_0x563cf8){var _0x2e583c=function(_0x4b6d78){while(--_0x4b6d78){_0xea4811['push'](_0xea4811['shift']());}};_0x2e583c(++_0x563cf8);}(_0x074a,0x97));var _0xa074=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x074a[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0xa074('0x0'));var error={'E_AGI_UNDEFINED':_0xa074('0x1'),'E_AGI_ARGUMENT_PORT':_0xa074('0x2'),'E_AGI_SERVER_ERROR':_0xa074('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xa074('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xa074('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xa074('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa074('0x7'),'E_AGI_IVR_ENTRY':_0xa074('0x8')};function AGIError(_0x321e7d){var _0x321e7d=_0x321e7d||null,_0x5badb6=_0x5badb6||[],_0x3456aa=0x1,_0x1eee21='';if(!error[_0x321e7d]){_0x321e7d=_0xa074('0x9');}_0x5badb6[_0xa074('0xa')](error[_0x321e7d]);while(arguments[_0x3456aa]){_0x5badb6[_0xa074('0xa')](arguments[_0x3456aa]);_0x3456aa++;}_0x1eee21=util[_0xa074('0xb')][_0xa074('0xc')](util,_0x5badb6);this[_0xa074('0xd')]=_0x1eee21;this[_0xa074('0xe')]=_0x321e7d;}module[_0xa074('0xf')]=AGIError;
\ No newline at end of file
+var _0x7857=['E_AGI_UNDEFINED','push','format','message','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0xe98641,_0x4ba011){var _0x57a156=function(_0x1b5367){while(--_0x1b5367){_0xe98641['push'](_0xe98641['shift']());}};_0x57a156(++_0x4ba011);}(_0x7857,0x1a9));var _0x7785=function(_0x509900,_0x16bd53){_0x509900=_0x509900-0x0;var _0x3c10bc=_0x7857[_0x509900];return _0x3c10bc;};'use strict';var util=require(_0x7785('0x0'));var error={'E_AGI_UNDEFINED':_0x7785('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x7785('0x2'),'E_AGI_SERVER_CLOSE':_0x7785('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x7785('0x4'),'E_AGI_SOCKET_ERROR':_0x7785('0x5'),'E_AGI_SOCKET_CLOSE':_0x7785('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x7785('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x7785('0x8'),'E_AGI_IVR_ENTRY':_0x7785('0x9')};function AGIError(_0x555024){var _0x555024=_0x555024||null,_0x12015f=_0x12015f||[],_0x27300b=0x1,_0x497757='';if(!error[_0x555024]){_0x555024=_0x7785('0xa');}_0x12015f[_0x7785('0xb')](error[_0x555024]);while(arguments[_0x27300b]){_0x12015f[_0x7785('0xb')](arguments[_0x27300b]);_0x27300b++;}_0x497757=util[_0x7785('0xc')]['apply'](util,_0x12015f);this[_0x7785('0xd')]=_0x497757;this['name']=_0x555024;}module[_0x7785('0xe')]=AGIError;
\ No newline at end of file
index 9d006f6..523d378 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7be1=['split','vswitch','target','agicommand','menu','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','agi','getdigits','getsecretdigits','vertices','edges','numberOfEdges','addEdge','push','prototype','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition'];(function(_0x316367,_0x40ec60){var _0x4cd800=function(_0x373766){while(--_0x373766){_0x316367['push'](_0x316367['shift']());}};_0x4cd800(++_0x40ec60);}(_0x7be1,0x165));var _0x17be=function(_0x478dbb,_0x48b454){_0x478dbb=_0x478dbb-0x0;var _0x3ff700=_0x7be1[_0x478dbb];return _0x3ff700;};'use strict';var _=require(_0x17be('0x0'));var logger=require(_0x17be('0x1'))(_0x17be('0x2'));var verticesWithRetry=['menu',_0x17be('0x3'),_0x17be('0x4')];var Graph=function(){this[_0x17be('0x5')]={};this[_0x17be('0x6')]={};this[_0x17be('0x7')]=0x0;};Graph['prototype']['addVertex']=function(_0x55257a){this[_0x17be('0x5')][_0x55257a['id']]=_0x55257a;this[_0x17be('0x6')][_0x55257a['id']]=[];};Graph['prototype'][_0x17be('0x8')]=function(_0x23f19f,_0x2c74b2,_0xfd9c5){this[_0x17be('0x6')][_0x23f19f][_0x17be('0x9')]({'target':_0x2c74b2,'condition':_0xfd9c5});this['numberOfEdges']+=0x1;};Graph[_0x17be('0xa')]['size']=function(){return _[_0x17be('0xb')](this[_0x17be('0x5')]);};Graph['prototype'][_0x17be('0xc')]=function(){return this[_0x17be('0x7')];};Graph[_0x17be('0xa')][_0x17be('0xd')]=function(_0x4ddc25){return this[_0x17be('0x5')][_0x4ddc25];};Graph['prototype'][_0x17be('0xe')]=function(_0x4f4ad6,_0x2af298){if(!this[_0x17be('0x5')][_0x4f4ad6]){return logger[_0x17be('0xf')](_0x17be('0x10'));}var _0xfbfeeb=_0x2af298(this['vertices'][_0x4f4ad6]);if(!_0xfbfeeb){return logger[_0x17be('0xf')]('stop\x20traverse');}if(this['edges'][_0x4f4ad6][_0x17be('0x11')]===0x0){return logger['info'](_0x17be('0x12'));}for(var _0x4abdbc=0x0,_0x2aa9a6=[],_0x312b2e=![];_0x4abdbc<this['edges'][_0x4f4ad6][_0x17be('0x11')];_0x4abdbc+=0x1){if(this['edges'][_0x4f4ad6][_0x4abdbc][_0x17be('0x13')]){_0x2aa9a6=this['edges'][_0x4f4ad6][_0x4abdbc][_0x17be('0x13')][_0x17be('0x14')](',');for(var _0x416f81=0x0;_0x416f81<_0x2aa9a6[_0x17be('0x11')];_0x416f81+=0x1){if(this[_0x17be('0x5')][_0x4f4ad6]['agicommand']===_0x17be('0x15')&&_0x2aa9a6[_0x416f81]==='-'){_0x312b2e=this[_0x17be('0x6')][_0x4f4ad6][_0x4abdbc][_0x17be('0x16')];logger[_0x17be('0xf')]('default',_0x2aa9a6[_0x416f81],this[_0x17be('0x6')][_0x4f4ad6][_0x4abdbc]['target']);}else if(this['vertices'][_0x4f4ad6][_0x17be('0x17')]===_0x17be('0x18')&&_0x2aa9a6[_0x416f81]==='i'){_0x312b2e=this[_0x17be('0x6')][_0x4f4ad6][_0x4abdbc][_0x17be('0x16')];logger['info'](_0x17be('0x19'),_0x2aa9a6[_0x416f81],this[_0x17be('0x6')][_0x4f4ad6][_0x4abdbc]['target']);}if(_0x2aa9a6[_0x416f81]===_0xfbfeeb){return this[_0x17be('0xe')](this['edges'][_0x4f4ad6][_0x4abdbc][_0x17be('0x16')],_0x2af298);}}}else{return this[_0x17be('0xe')](this[_0x17be('0x6')][_0x4f4ad6][_0x4abdbc][_0x17be('0x16')],_0x2af298);}}if(_0x2aa9a6['length']){if(this[_0x17be('0x5')][_0x4f4ad6]['agicommand']==='vswitch'){if(_0x312b2e){return this[_0x17be('0xe')](_0x312b2e,_0x2af298);}return logger['info'](_0x17be('0x1a'));}else if(_['includes'](verticesWithRetry,this[_0x17be('0x5')][_0x4f4ad6][_0x17be('0x17')])){if(_0xfbfeeb==='-'){return logger[_0x17be('0xf')](_0x17be('0x1b'));}if(_0x312b2e&&_0xfbfeeb!=='t'){return this[_0x17be('0xe')](_0x312b2e,_0x2af298);}return this[_0x17be('0xe')](_0x4f4ad6,_0x2af298);}return logger[_0x17be('0xf')](_0x17be('0x1c'));}};module['exports']=Graph;
\ No newline at end of file
+var _0xa45c=['invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','lodash','../../../config/logger','getdigits','vertices','numberOfEdges','edges','prototype','push','size','relations','getVertex','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','agicommand','target','default','menu'];(function(_0x2b03af,_0x1722ec){var _0x22e325=function(_0x21129b){while(--_0x21129b){_0x2b03af['push'](_0x2b03af['shift']());}};_0x22e325(++_0x1722ec);}(_0xa45c,0x6d));var _0xca45=function(_0x521403,_0x102c6c){_0x521403=_0x521403-0x0;var _0x19480a=_0xa45c[_0x521403];return _0x19480a;};'use strict';var _=require(_0xca45('0x0'));var logger=require(_0xca45('0x1'))('agi');var verticesWithRetry=['menu',_0xca45('0x2'),'getsecretdigits'];var Graph=function(){this[_0xca45('0x3')]={};this['edges']={};this[_0xca45('0x4')]=0x0;};Graph['prototype']['addVertex']=function(_0x33a162){this[_0xca45('0x3')][_0x33a162['id']]=_0x33a162;this[_0xca45('0x5')][_0x33a162['id']]=[];};Graph[_0xca45('0x6')]['addEdge']=function(_0x1a8b9c,_0x276897,_0x7ceab1){this[_0xca45('0x5')][_0x1a8b9c][_0xca45('0x7')]({'target':_0x276897,'condition':_0x7ceab1});this['numberOfEdges']+=0x1;};Graph[_0xca45('0x6')][_0xca45('0x8')]=function(){return _[_0xca45('0x8')](this[_0xca45('0x3')]);};Graph[_0xca45('0x6')][_0xca45('0x9')]=function(){return this[_0xca45('0x4')];};Graph['prototype'][_0xca45('0xa')]=function(_0x360ee9){return this[_0xca45('0x3')][_0x360ee9];};Graph[_0xca45('0x6')]['traverseBFS']=function(_0x3044b1,_0x711b03){if(!this[_0xca45('0x3')][_0x3044b1]){return logger['info'](_0xca45('0xb'));}var _0x569ba6=_0x711b03(this[_0xca45('0x3')][_0x3044b1]);if(!_0x569ba6){return logger[_0xca45('0xc')](_0xca45('0xd'));}if(this[_0xca45('0x5')][_0x3044b1][_0xca45('0xe')]===0x0){return logger[_0xca45('0xc')](_0xca45('0xf'));}for(var _0x570784=0x0,_0x571baa=[],_0x5b4e29=![];_0x570784<this['edges'][_0x3044b1][_0xca45('0xe')];_0x570784+=0x1){if(this[_0xca45('0x5')][_0x3044b1][_0x570784]['condition']){_0x571baa=this[_0xca45('0x5')][_0x3044b1][_0x570784][_0xca45('0x10')]['split'](',');for(var _0x40540f=0x0;_0x40540f<_0x571baa[_0xca45('0xe')];_0x40540f+=0x1){if(this[_0xca45('0x3')][_0x3044b1][_0xca45('0x11')]==='vswitch'&&_0x571baa[_0x40540f]==='-'){_0x5b4e29=this[_0xca45('0x5')][_0x3044b1][_0x570784][_0xca45('0x12')];logger[_0xca45('0xc')](_0xca45('0x13'),_0x571baa[_0x40540f],this['edges'][_0x3044b1][_0x570784][_0xca45('0x12')]);}else if(this[_0xca45('0x3')][_0x3044b1][_0xca45('0x11')]===_0xca45('0x14')&&_0x571baa[_0x40540f]==='i'){_0x5b4e29=this[_0xca45('0x5')][_0x3044b1][_0x570784][_0xca45('0x12')];logger[_0xca45('0xc')](_0xca45('0x15'),_0x571baa[_0x40540f],this[_0xca45('0x5')][_0x3044b1][_0x570784]['target']);}if(_0x571baa[_0x40540f]===_0x569ba6){return this[_0xca45('0x16')](this[_0xca45('0x5')][_0x3044b1][_0x570784][_0xca45('0x12')],_0x711b03);}}}else{return this[_0xca45('0x16')](this[_0xca45('0x5')][_0x3044b1][_0x570784]['target'],_0x711b03);}}if(_0x571baa['length']){if(this['vertices'][_0x3044b1][_0xca45('0x11')]==='vswitch'){if(_0x5b4e29){return this['traverseBFS'](_0x5b4e29,_0x711b03);}return logger[_0xca45('0xc')](_0xca45('0x17'));}else if(_[_0xca45('0x18')](verticesWithRetry,this[_0xca45('0x3')][_0x3044b1][_0xca45('0x11')])){if(_0x569ba6==='-'){return logger['info'](_0xca45('0x19'));}if(_0x5b4e29&&_0x569ba6!=='t'){return this[_0xca45('0x16')](_0x5b4e29,_0x711b03);}return this[_0xca45('0x16')](_0x3044b1,_0x711b03);}return logger['info']('condition\x20not\x20found');}};module['exports']=Graph;
\ No newline at end of file
index 05eceb2..9ee045c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0554=['extension','priority','response','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','listening','connection','xml2json','lodash','util','../../config/environment','../../config/logger','agi','../../config/license/util','./graph','./vertices','127.0.0.1','nextTick','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','error','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','evtHangup','toJson','mxGraphModel','root','agicommand','maxRetry','retry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','addEdge','source','target','value','getSquareProject','createSquareReport','then','catch','substring','inspect','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','sync','production','SQUAREROOT','start','debug','joinAt','traverseBFS','clear','gotoc\x20block\x20stop\x20traverse\x20BFS','context'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x0554,0x176));var _0x4055=function(_0x14a0a0,_0x45d0cf){_0x14a0a0=_0x14a0a0-0x0;var _0x56b651=_0x0554[_0x14a0a0];return _0x56b651;};'use strict';var parser=require(_0x4055('0x0'));var _=require(_0x4055('0x1'));var syncho=require('syncho');var util=require(_0x4055('0x2'));var moment=require('moment');var config=require(_0x4055('0x3'));var logger=require(_0x4055('0x4'))(_0x4055('0x5'));var utilLicense=require(_0x4055('0x6'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x4055('0x7'));var Vertices=require(_0x4055('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0x4055('0x5')],{'ip':_0x4055('0x9'),'port':0x11dd});function connectionHandler(_0x509871){process[_0x4055('0xa')](function(){syncho(function(){try{setChannelVariables(_0x509871);agiHandler(_0x509871);}catch(_0x3829b4){logger['error'](_0x3829b4[_0x4055('0xb')]);}});});}function listeningHandler(){console[_0x4055('0xc')](_0x4055('0xd'),config['agi'][_0x4055('0xe')]);logger['info'](util[_0x4055('0xf')](_0x4055('0x10'),config[_0x4055('0x5')]['ip'],config[_0x4055('0x5')]['port']));}function errorHandler(_0x5dcc55){if(_0x5dcc55&&_0x5dcc55[_0x4055('0x11')]&&_0x5dcc55['message']){logger[_0x4055('0x12')](util['format'](_0x4055('0x13'),_0x5dcc55['name'],_0x5dcc55['message']));}else{logger[_0x4055('0x12')](util[_0x4055('0xf')](_0x4055('0x14'),_0x5dcc55[_0x4055('0xb')]));}}function closeHandler(){logger[_0x4055('0x15')](util['format'](_0x4055('0x16'),this[_0x4055('0x17')],this[_0x4055('0x18')],this['callerid'],this[_0x4055('0x19')],this[_0x4055('0x1a')]));try{createSquareReport(this);}catch(_0x3de065){logger[_0x4055('0x12')](_0x3de065[_0x4055('0xb')]);}}function timeoutHandler(){logger[_0x4055('0x15')](util['format'](_0x4055('0x1b'),this[_0x4055('0x17')],this[_0x4055('0x18')],this[_0x4055('0x1c')],this[_0x4055('0x19')],this['uniqueid']));}function hangupHandler(){logger[_0x4055('0x15')](util[_0x4055('0xf')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x4055('0x17')],this[_0x4055('0x18')],this[_0x4055('0x1c')],this[_0x4055('0x19')],this[_0x4055('0x1a')]));this[_0x4055('0x1d')]=!![];}function getRoot(_0x779021){return parser[_0x4055('0x1e')](_0x779021,{'object':!![]})[_0x4055('0x1f')][_0x4055('0x20')];}function addVertex(_0x2182f4,_0x3c961e,_0x5838d1){_0x3c961e[_0x4055('0x21')]=_0x5838d1;if(_0x3c961e['hasOwnProperty']('retry')){_0x3c961e[_0x4055('0x22')]=parseInt(_0x3c961e[_0x4055('0x23')],0xa);}_0x2182f4[_0x4055('0x24')](_[_0x4055('0x25')](_0x3c961e,_0x4055('0x26')));}function initGraph(_0x31ac58,_0x50c85c){var _0x185f0b=new Graph();for(var _0x2df9bf in _0x31ac58){if(_0x31ac58[_0x4055('0x27')](_0x2df9bf)){if(_[_0x4055('0x28')](_0x31ac58[_0x2df9bf])){for(var _0x379f52=0x0;_0x379f52<_0x31ac58[_0x2df9bf][_0x4055('0x29')];_0x379f52+=0x1){addVertex(_0x185f0b,_0x31ac58[_0x2df9bf][_0x379f52],_0x2df9bf);}}else{addVertex(_0x185f0b,_0x31ac58[_0x2df9bf],_0x2df9bf);}}}for(var _0x1e71d7=0x0;_0x1e71d7<_0x50c85c[_0x4055('0x29')];_0x1e71d7+=0x1){if(_0x50c85c[_0x1e71d7]['source']&&_0x50c85c[_0x1e71d7]['target']){_0x185f0b[_0x4055('0x2a')](_0x50c85c[_0x1e71d7][_0x4055('0x2b')],_0x50c85c[_0x1e71d7][_0x4055('0x2c')],_0x50c85c[_0x1e71d7][_0x4055('0x2d')]);}}return _0x185f0b;}function getSquareProject(_0x31379b,_0x157b9a){rpc[_0x4055('0x2e')](_0x31379b)['then'](function(_0x3e3540){_0x157b9a(null,_0x3e3540);})['catch'](function(_0x422175){_0x157b9a(null,_0x422175);});}function createSquareReport(_0x16b719,_0x472244){rpc[_0x4055('0x2f')](_0x16b719)[_0x4055('0x30')](function(_0x3f557d){if(_0x472244){_0x472244(null,_0x3f557d);}})[_0x4055('0x31')](function(_0x2d87ce){if(_0x472244){_0x472244(null,_0x2d87ce);}});}function setChannelVariables(_0x52629e){for(var _0x30c3a9 in _0x52629e){if(_0x52629e[_0x4055('0x27')](_0x30c3a9)){if(_0x30c3a9['indexOf']('agi_')===0x0){_0x52629e[_0x30c3a9[_0x4055('0x32')](0x4)]=_0x52629e[_0x30c3a9];delete _0x52629e[_0x30c3a9];}}}}function getLogFromObject(_0x43e7a3){return util[_0x4055('0x33')](_0x43e7a3,{'showHidden':![],'depth':null});}function agiHandler(_0x111c9c){var _0x566bac,_0x1ee83b,_0x300fba,_0x49fbb1,_0x48210a;logger['debug']('variables',JSON[_0x4055('0x34')](_0x111c9c,null,0x2));logger[_0x4055('0x15')](util[_0x4055('0xf')](_0x4055('0x35'),_0x111c9c['arg_1'],_0x111c9c[_0x4055('0x18')],_0x111c9c[_0x4055('0x1c')],_0x111c9c[_0x4055('0x19')],_0x111c9c['uniqueid']));_0x111c9c['on']('error',errorHandler);_0x111c9c['on']('close',closeHandler);_0x111c9c['on'](_0x4055('0x36'),timeoutHandler);_0x111c9c['evtHangup']=![];_0x111c9c['on'](_0x4055('0x37'),hangupHandler);var _0x3e62ef=getSquareProject[_0x4055('0x38')](null,_0x111c9c['arg_1']);if(_0x3e62ef){if(_0x3e62ef[_0x4055('0x39')]){_0x566bac=getRoot(_0x3e62ef[_0x4055('0x39')]);console[_0x4055('0xc')](_0x4055('0x3a'),_0x566bac);if(_0x566bac&&_0x566bac[_0x4055('0x3b')]){logger[_0x4055('0x3c')](_0x4055('0x20'),JSON[_0x4055('0x34')](_0x566bac,null,0x2));_0x111c9c[_0x4055('0x3d')]=moment()[_0x4055('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x1ee83b=initGraph(_[_0x4055('0x25')](_0x566bac,_0x4055('0x26')),_0x566bac[_0x4055('0x26')]);_0x300fba=new Vertices(_0x111c9c,rpc,mailRpc);console['log']('vertices',_0x300fba);logger[_0x4055('0x15')](util[_0x4055('0xf')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x111c9c[_0x4055('0x17')],_0x111c9c['calleridname'],_0x111c9c[_0x4055('0x1c')],_0x111c9c[_0x4055('0x19')],_0x111c9c[_0x4055('0x1a')]));console['log']('LOOP\x20through\x20graph');_0x1ee83b[_0x4055('0x3e')](_0x566bac[_0x4055('0x3b')]['id'],function(_0x1c496e){try{_0x1c496e=_0x300fba[_0x4055('0x3f')](_0x1c496e);logger[_0x4055('0x3c')]('vertex',JSON[_0x4055('0x34')](_0x1c496e,null,0x2));console[_0x4055('0xc')]('VERTEX',_0x1c496e);if(_0x1c496e[_0x4055('0x21')]==='gotoc'){logger[_0x4055('0x15')](_0x4055('0x40'));_0x111c9c['context']=_0x1c496e[_0x4055('0x41')]||_0x111c9c[_0x4055('0x41')];_0x111c9c[_0x4055('0x42')]=_0x1c496e[_0x4055('0x42')];_0x111c9c[_0x4055('0x43')]=_0x1c496e['priority']?_0x1c496e[_0x4055('0x43')]-0x1:0x1;return null;}else if(_0x1c496e&&_0x300fba[_0x1c496e[_0x4055('0x21')]]){_0x48210a=_0x300fba[_0x1c496e[_0x4055('0x21')]](_0x1c496e);console[_0x4055('0xc')]('vresponse',_0x48210a);logger[_0x4055('0x15')](_0x4055('0x44'),JSON[_0x4055('0x34')](_0x48210a,null,0x2));if(_0x48210a&&_0x48210a['code']===AGI_CODE_SUCCESS&&_0x48210a[_0x4055('0x45')]!==AGI_RESULT_ERROR&&!_0x111c9c[_0x4055('0x1d')]){logger[_0x4055('0x3c')](_0x4055('0x44'),getLogFromObject(_0x48210a));return _[_0x4055('0x46')](_0x48210a['result'])?null:_0x48210a[_0x4055('0x45')][_0x4055('0x47')]();}else{logger['error']('response',getLogFromObject(_0x48210a));return null;}}else{logger[_0x4055('0x12')](_0x4055('0x48'));return null;}}catch(_0x19970e){logger['error'](_0x19970e[_0x4055('0xb')]);return null;}});if(_0x566bac[_0x4055('0x49')]){logger[_0x4055('0x15')](util[_0x4055('0xf')](_0x4055('0x4a'),_0x111c9c[_0x4055('0x17')],_0x111c9c[_0x4055('0x18')],_0x111c9c['callerid'],_0x111c9c['dnid'],_0x111c9c['uniqueid']));_0x1ee83b['traverseBFS'](_0x566bac[_0x4055('0x49')]['id'],function(_0x2ef34d){try{_0x2ef34d=_0x300fba[_0x4055('0x3f')](_0x2ef34d);logger[_0x4055('0x3c')](_0x4055('0x4b'),JSON[_0x4055('0x34')](_0x2ef34d,null,0x2));if(_0x2ef34d&&_0x300fba[_0x2ef34d[_0x4055('0x21')]]){_0x48210a=_0x300fba[_0x2ef34d[_0x4055('0x21')]](_0x2ef34d);if(_0x48210a){logger['debug'](_0x4055('0x44'),getLogFromObject(_0x48210a));return _[_0x4055('0x46')](_0x48210a[_0x4055('0x45')])?null:_0x48210a[_0x4055('0x45')]['toString']();}else{logger['error'](_0x4055('0x44'),getLogFromObject(_0x48210a));return null;}}else{logger[_0x4055('0x12')](_0x4055('0x48'));return null;}}catch(_0x56c39d){logger[_0x4055('0x12')](_0x56c39d[_0x4055('0xb')]);return null;}});}logger[_0x4055('0x15')](util[_0x4055('0xf')](_0x4055('0x4c'),_0x111c9c[_0x4055('0x17')],_0x111c9c[_0x4055('0x18')],_0x111c9c['callerid'],_0x111c9c[_0x4055('0x19')],_0x111c9c[_0x4055('0x1a')]));logger['info'](util[_0x4055('0xf')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x111c9c[_0x4055('0x41')],_0x111c9c[_0x4055('0x42')],parseInt(_0x111c9c[_0x4055('0x43')],0xa)+0x1));_0x111c9c[_0x4055('0x4d')](_0x111c9c[_0x4055('0x41')],_0x111c9c['extension'],parseInt(_0x111c9c[_0x4055('0x43')],0xa)+0x1);_0x111c9c[_0x4055('0x4e')]();}}else{logger['error'](util['format'](_0x4055('0x4f'),_0x111c9c['arg_1']));_0x111c9c[_0x4055('0x4d')](_0x111c9c[_0x4055('0x41')],_0x111c9c[_0x4055('0x42')],parseInt(_0x111c9c[_0x4055('0x43')],0xa)+0x1);_0x111c9c[_0x4055('0x4e')]();}}else{logger[_0x4055('0x12')](util[_0x4055('0xf')](_0x4055('0x50'),_0x111c9c[_0x4055('0x17')]));_0x111c9c[_0x4055('0x4d')](_0x111c9c['context'],_0x111c9c[_0x4055('0x42')],parseInt(_0x111c9c['priority'],0xa)+0x1);_0x111c9c['close']();}}function main(){var _0x4cde96;return utilLicense[_0x4055('0x51')]()[_0x4055('0x30')](function(_0xec3fcf){if(_0xec3fcf){if(_0xec3fcf['voice']){if(_0xec3fcf[_0x4055('0x52')]&&_0xec3fcf['callysquare']>0x0){logger[_0x4055('0x15')](util[_0x4055('0xf')](_0x4055('0x53'),_0xec3fcf[_0x4055('0x52')]));_0x4cde96=_0xec3fcf['callysquare'];}else{logger[_0x4055('0x15')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x4055('0x15')](_0x4055('0x54'));_0x4cde96=-0x1;}}})['catch'](function(_0x5c7b3e){logger[_0x4055('0x12')]('[LICENSE]',_0x5c7b3e[_0x4055('0xb')]);})[_0x4055('0x49')](function(){var _0xd68ea3=require(_0x4055('0x55'))(config[_0x4055('0x5')]['port'],config['agi']['ip'],_0x4cde96);_0xd68ea3['on'](_0x4055('0x12'),errorHandler);_0xd68ea3['on'](_0x4055('0x56'),listeningHandler);_0xd68ea3['on'](_0x4055('0x57'),connectionHandler);_0xd68ea3['on'](_0x4055('0x4e'),closeHandler);});}main();
\ No newline at end of file
+var _0xf328=['createSquareReport','then','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','sync','production','SQUAREROOT','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','agicommand\x20not\x20found','toString','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','finally','./server','connection','xml2json','lodash','syncho','util','moment','../../config/logger','../../config/license/util','./rpc','./graph','agi','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','root','agicommand','hasOwnProperty','retry','addVertex','mxCell','length','source','target','addEdge','value','getSquareProject','catch'];(function(_0x2d1c52,_0x123621){var _0xc15187=function(_0x46a6de){while(--_0x46a6de){_0x2d1c52['push'](_0x2d1c52['shift']());}};_0xc15187(++_0x123621);}(_0xf328,0x196));var _0x8f32=function(_0xcbe1e6,_0x2db60c){_0xcbe1e6=_0xcbe1e6-0x0;var _0x23f373=_0xf328[_0xcbe1e6];return _0x23f373;};'use strict';var parser=require(_0x8f32('0x0'));var _=require(_0x8f32('0x1'));var syncho=require(_0x8f32('0x2'));var util=require(_0x8f32('0x3'));var moment=require(_0x8f32('0x4'));var config=require('../../config/environment');var logger=require(_0x8f32('0x5'))('agi');var utilLicense=require(_0x8f32('0x6'));var rpc=require(_0x8f32('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0x8f32('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8f32('0x9')]=_['defaults'](config['agi'],{'ip':_0x8f32('0xa'),'port':0x11dd});function connectionHandler(_0x5e846a){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x5e846a);agiHandler(_0x5e846a);}catch(_0x2af893){logger[_0x8f32('0xb')](_0x2af893[_0x8f32('0xc')]);}});});}function listeningHandler(){console[_0x8f32('0xd')](_0x8f32('0xe'),config['agi'][_0x8f32('0xf')]);logger[_0x8f32('0x10')](util[_0x8f32('0x11')](_0x8f32('0x12'),config[_0x8f32('0x9')]['ip'],config[_0x8f32('0x9')][_0x8f32('0xf')]));}function errorHandler(_0x3bd130){if(_0x3bd130&&_0x3bd130[_0x8f32('0x13')]&&_0x3bd130['message']){logger[_0x8f32('0xb')](util[_0x8f32('0x11')](_0x8f32('0x14'),_0x3bd130[_0x8f32('0x13')],_0x3bd130[_0x8f32('0x15')]));}else{logger[_0x8f32('0xb')](util[_0x8f32('0x11')]('[ERROR]\x20%s',_0x3bd130[_0x8f32('0xc')]));}}function closeHandler(){logger['info'](util['format'](_0x8f32('0x16'),this[_0x8f32('0x17')],this['calleridname'],this[_0x8f32('0x18')],this[_0x8f32('0x19')],this[_0x8f32('0x1a')]));try{createSquareReport(this);}catch(_0x310b30){logger[_0x8f32('0xb')](_0x310b30[_0x8f32('0xc')]);}}function timeoutHandler(){logger[_0x8f32('0x10')](util[_0x8f32('0x11')](_0x8f32('0x1b'),this['arg_1'],this[_0x8f32('0x1c')],this['callerid'],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x8f32('0x10')](util[_0x8f32('0x11')](_0x8f32('0x1d'),this[_0x8f32('0x17')],this[_0x8f32('0x1c')],this['callerid'],this['dnid'],this[_0x8f32('0x1a')]));this['evtHangup']=!![];}function getRoot(_0x121175){return parser[_0x8f32('0x1e')](_0x121175,{'object':!![]})['mxGraphModel'][_0x8f32('0x1f')];}function addVertex(_0x340fa8,_0x38e780,_0x46e78c){_0x38e780[_0x8f32('0x20')]=_0x46e78c;if(_0x38e780[_0x8f32('0x21')]('retry')){_0x38e780['maxRetry']=parseInt(_0x38e780[_0x8f32('0x22')],0xa);}_0x340fa8[_0x8f32('0x23')](_['omit'](_0x38e780,_0x8f32('0x24')));}function initGraph(_0x463d4d,_0x326229){var _0x20565b=new Graph();for(var _0x1a24c0 in _0x463d4d){if(_0x463d4d[_0x8f32('0x21')](_0x1a24c0)){if(_['isArray'](_0x463d4d[_0x1a24c0])){for(var _0x1c2c4b=0x0;_0x1c2c4b<_0x463d4d[_0x1a24c0][_0x8f32('0x25')];_0x1c2c4b+=0x1){addVertex(_0x20565b,_0x463d4d[_0x1a24c0][_0x1c2c4b],_0x1a24c0);}}else{addVertex(_0x20565b,_0x463d4d[_0x1a24c0],_0x1a24c0);}}}for(var _0x46dd1e=0x0;_0x46dd1e<_0x326229[_0x8f32('0x25')];_0x46dd1e+=0x1){if(_0x326229[_0x46dd1e][_0x8f32('0x26')]&&_0x326229[_0x46dd1e][_0x8f32('0x27')]){_0x20565b[_0x8f32('0x28')](_0x326229[_0x46dd1e][_0x8f32('0x26')],_0x326229[_0x46dd1e][_0x8f32('0x27')],_0x326229[_0x46dd1e][_0x8f32('0x29')]);}}return _0x20565b;}function getSquareProject(_0x49b62b,_0x217aaa){rpc[_0x8f32('0x2a')](_0x49b62b)['then'](function(_0x28c3ce){_0x217aaa(null,_0x28c3ce);})[_0x8f32('0x2b')](function(_0x4f8188){_0x217aaa(null,_0x4f8188);});}function createSquareReport(_0x44be17,_0x373ce4){rpc[_0x8f32('0x2c')](_0x44be17)[_0x8f32('0x2d')](function(_0x1e79b2){if(_0x373ce4){_0x373ce4(null,_0x1e79b2);}})[_0x8f32('0x2b')](function(_0x96bb17){if(_0x373ce4){_0x373ce4(null,_0x96bb17);}});}function setChannelVariables(_0xae393){for(var _0x33f007 in _0xae393){if(_0xae393['hasOwnProperty'](_0x33f007)){if(_0x33f007[_0x8f32('0x2e')](_0x8f32('0x2f'))===0x0){_0xae393[_0x33f007[_0x8f32('0x30')](0x4)]=_0xae393[_0x33f007];delete _0xae393[_0x33f007];}}}}function getLogFromObject(_0x58017f){return util[_0x8f32('0x31')](_0x58017f,{'showHidden':![],'depth':null});}function agiHandler(_0x364537){var _0x4c4fe9,_0xef44a6,_0x32d544,_0x5002b9,_0xa475d0;logger[_0x8f32('0x32')](_0x8f32('0x33'),JSON[_0x8f32('0x34')](_0x364537,null,0x2));logger[_0x8f32('0x10')](util[_0x8f32('0x11')](_0x8f32('0x35'),_0x364537[_0x8f32('0x17')],_0x364537[_0x8f32('0x1c')],_0x364537[_0x8f32('0x18')],_0x364537[_0x8f32('0x19')],_0x364537[_0x8f32('0x1a')]));_0x364537['on'](_0x8f32('0xb'),errorHandler);_0x364537['on'](_0x8f32('0x36'),closeHandler);_0x364537['on'](_0x8f32('0x37'),timeoutHandler);_0x364537[_0x8f32('0x38')]=![];_0x364537['on'](_0x8f32('0x39'),hangupHandler);var _0xc867b1=getSquareProject[_0x8f32('0x3a')](null,_0x364537[_0x8f32('0x17')]);if(_0xc867b1){if(_0xc867b1[_0x8f32('0x3b')]){_0x4c4fe9=getRoot(_0xc867b1[_0x8f32('0x3b')]);console[_0x8f32('0xd')](_0x8f32('0x3c'),_0x4c4fe9);if(_0x4c4fe9&&_0x4c4fe9[_0x8f32('0x3d')]){logger[_0x8f32('0x32')](_0x8f32('0x1f'),JSON[_0x8f32('0x34')](_0x4c4fe9,null,0x2));_0x364537[_0x8f32('0x3e')]=moment()[_0x8f32('0x11')](_0x8f32('0x3f'));_0xef44a6=initGraph(_[_0x8f32('0x40')](_0x4c4fe9,_0x8f32('0x24')),_0x4c4fe9[_0x8f32('0x24')]);_0x32d544=new Vertices(_0x364537,rpc,mailRpc);logger[_0x8f32('0x10')](util[_0x8f32('0x11')](_0x8f32('0x41'),_0x364537[_0x8f32('0x17')],_0x364537['calleridname'],_0x364537[_0x8f32('0x18')],_0x364537[_0x8f32('0x19')],_0x364537[_0x8f32('0x1a')]));_0xef44a6['traverseBFS'](_0x4c4fe9[_0x8f32('0x3d')]['id'],function(_0x2d83e1){try{_0x2d83e1=_0x32d544[_0x8f32('0x42')](_0x2d83e1);logger[_0x8f32('0x32')](_0x8f32('0x43'),JSON[_0x8f32('0x34')](_0x2d83e1,null,0x2));if(_0x2d83e1['agicommand']===_0x8f32('0x44')){logger[_0x8f32('0x10')](_0x8f32('0x45'));_0x364537[_0x8f32('0x46')]=_0x2d83e1['context']||_0x364537[_0x8f32('0x46')];_0x364537[_0x8f32('0x47')]=_0x2d83e1[_0x8f32('0x47')];_0x364537[_0x8f32('0x48')]=_0x2d83e1[_0x8f32('0x48')]?_0x2d83e1[_0x8f32('0x48')]-0x1:0x1;return null;}else if(_0x2d83e1&&_0x32d544[_0x2d83e1['agicommand']]){_0xa475d0=_0x32d544[_0x2d83e1[_0x8f32('0x20')]](_0x2d83e1);logger['info'](_0x8f32('0x49'),JSON['stringify'](_0xa475d0,null,0x2));if(_0xa475d0&&_0xa475d0[_0x8f32('0x4a')]===AGI_CODE_SUCCESS&&_0xa475d0[_0x8f32('0x4b')]!==AGI_RESULT_ERROR&&!_0x364537[_0x8f32('0x38')]){logger[_0x8f32('0x32')]('response',getLogFromObject(_0xa475d0));return _[_0x8f32('0x4c')](_0xa475d0['result'])?null:_0xa475d0[_0x8f32('0x4b')]['toString']();}else{logger[_0x8f32('0xb')]('response',getLogFromObject(_0xa475d0));return null;}}else{logger[_0x8f32('0xb')](_0x8f32('0x4d'));return null;}}catch(_0x4b6571){logger['error'](_0x4b6571[_0x8f32('0xc')]);return null;}});if(_0x4c4fe9['finally']){logger[_0x8f32('0x10')](util[_0x8f32('0x11')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x364537[_0x8f32('0x17')],_0x364537['calleridname'],_0x364537['callerid'],_0x364537[_0x8f32('0x19')],_0x364537[_0x8f32('0x1a')]));_0xef44a6['traverseBFS'](_0x4c4fe9['finally']['id'],function(_0x43c212){try{_0x43c212=_0x32d544[_0x8f32('0x42')](_0x43c212);logger[_0x8f32('0x32')](_0x8f32('0x43'),JSON[_0x8f32('0x34')](_0x43c212,null,0x2));if(_0x43c212&&_0x32d544[_0x43c212[_0x8f32('0x20')]]){_0xa475d0=_0x32d544[_0x43c212[_0x8f32('0x20')]](_0x43c212);if(_0xa475d0){logger['debug'](_0x8f32('0x49'),getLogFromObject(_0xa475d0));return _['isUndefined'](_0xa475d0[_0x8f32('0x4b')])?null:_0xa475d0[_0x8f32('0x4b')][_0x8f32('0x4e')]();}else{logger['error'](_0x8f32('0x49'),getLogFromObject(_0xa475d0));return null;}}else{logger[_0x8f32('0xb')](_0x8f32('0x4d'));return null;}}catch(_0x4cc12c){logger[_0x8f32('0xb')](_0x4cc12c['stack']);return null;}});}logger[_0x8f32('0x10')](util[_0x8f32('0x11')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x364537[_0x8f32('0x17')],_0x364537[_0x8f32('0x1c')],_0x364537['callerid'],_0x364537[_0x8f32('0x19')],_0x364537['uniqueid']));logger[_0x8f32('0x10')](util[_0x8f32('0x11')](_0x8f32('0x4f'),_0x364537[_0x8f32('0x46')],_0x364537[_0x8f32('0x47')],parseInt(_0x364537['priority'],0xa)+0x1));_0x364537[_0x8f32('0x50')](_0x364537[_0x8f32('0x46')],_0x364537[_0x8f32('0x47')],parseInt(_0x364537[_0x8f32('0x48')],0xa)+0x1);_0x364537[_0x8f32('0x36')]();}}else{logger[_0x8f32('0xb')](util['format'](_0x8f32('0x51'),_0x364537['arg_1']));_0x364537['continueAt'](_0x364537[_0x8f32('0x46')],_0x364537['extension'],parseInt(_0x364537['priority'],0xa)+0x1);_0x364537[_0x8f32('0x36')]();}}else{logger['error'](util[_0x8f32('0x11')]('Project\x20%s\x20not\x20found',_0x364537['arg_1']));_0x364537[_0x8f32('0x50')](_0x364537['context'],_0x364537['extension'],parseInt(_0x364537[_0x8f32('0x48')],0xa)+0x1);_0x364537['close']();}}function main(){var _0xbc292b;return utilLicense[_0x8f32('0x52')]()[_0x8f32('0x2d')](function(_0xe61006){if(_0xe61006){if(_0xe61006[_0x8f32('0x53')]){if(_0xe61006['callysquare']&&_0xe61006[_0x8f32('0x54')]>0x0){logger[_0x8f32('0x10')](util[_0x8f32('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0xe61006['callysquare']));_0xbc292b=_0xe61006[_0x8f32('0x54')];}else{logger['info'](_0x8f32('0x55'));}}else{logger[_0x8f32('0x10')](_0x8f32('0x56'));_0xbc292b=-0x1;}}})['catch'](function(_0x58396d){logger[_0x8f32('0xb')]('[LICENSE]',_0x58396d['stack']);})[_0x8f32('0x57')](function(){var _0x429ce5=require(_0x8f32('0x58'))(config[_0x8f32('0x9')][_0x8f32('0xf')],config[_0x8f32('0x9')]['ip'],_0xbc292b);_0x429ce5['on'](_0x8f32('0xb'),errorHandler);_0x429ce5['on']('listening',listeningHandler);_0x429ce5['on'](_0x8f32('0x59'),connectionHandler);_0x429ce5['on'](_0x8f32('0x36'),closeHandler);});}main();
\ No newline at end of file
index d4e5568..06c0ddb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x292f92,_0x1eb310){var _0x1f3493=function(_0xd6a465){while(--_0xd6a465){_0x292f92['push'](_0x292f92['shift']());}};_0x1f3493(++_0x1eb310);}(_0x814b,0x1a2));var _0xb814=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0x814b[_0x1627ae];return _0x34b38f;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});};
\ No newline at end of file
+var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x170cf1,_0x48fb57){var _0x39e82=function(_0x4cafec){while(--_0x4cafec){_0x170cf1['push'](_0x170cf1['shift']());}};_0x39e82(++_0x48fb57);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
index c3e038c..efb3b90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x1af80e,_0x8a8525){var _0x347585=function(_0x462d98){while(--_0x462d98){_0x1af80e['push'](_0x1af80e['shift']());}};_0x347585(++_0x8a8525);}(_0x7a54,0x106));var _0x47a5=function(_0xa1c91e,_0x47ed34){_0xa1c91e=_0xa1c91e-0x0;var _0x4b1a14=_0x7a54[_0xa1c91e];return _0x4b1a14;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply;
\ No newline at end of file
+var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x3403d5,_0x3d99fc){var _0xf9df4f=function(_0x33d748){while(--_0x33d748){_0x3403d5['push'](_0x3403d5['shift']());}};_0xf9df4f(++_0x3d99fc);}(_0xb10b,0x12a));var _0xbb10=function(_0xca2488,_0x14de01){_0xca2488=_0xca2488-0x0;var _0xa77bb9=_0xb10b[_0xca2488];return _0xa77bb9;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply;
\ No newline at end of file
index e39788e..34c0b53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d20=['getContactByPhone','log','GetContactByPhone','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ListId','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','bluebird','moment','lodash','util','jayson/promise','http','then','error','message','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','name','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser'];(function(_0x5ab805,_0x74f5a9){var _0x177893=function(_0x185221){while(--_0x185221){_0x5ab805['push'](_0x5ab805['shift']());}};_0x177893(++_0x74f5a9);}(_0x6d20,0x10f));var _0x06d2=function(_0x5f170f,_0x553d8e){_0x5f170f=_0x5f170f-0x0;var _0x2419de=_0x6d20[_0x5f170f];return _0x2419de;};'use strict';var BPromise=require(_0x06d2('0x0'));var moment=require(_0x06d2('0x1'));var _=require(_0x06d2('0x2'));var util=require(_0x06d2('0x3'));var jayson=require(_0x06d2('0x4'));var client=jayson['client'][_0x06d2('0x5')]({'port':0x2329});function request(_0x3c7ef7,_0x30c70e){return new BPromise(function(_0x505c7f,_0x82e71){return client['request'](_0x3c7ef7,_0x30c70e)[_0x06d2('0x6')](function(_0x3cee76){if(_0x3cee76['error']){return _0x82e71(_0x3cee76[_0x06d2('0x7')][_0x06d2('0x8')]);}else{return _0x505c7f(_0x3cee76['result']);}})[_0x06d2('0x9')](function(_0x3206d2){return _0x82e71(_0x3206d2);});});}exports[_0x06d2('0xa')]=function(_0x78c1ae){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x78c1ae},'attributes':[_0x06d2('0xb')]}});};exports[_0x06d2('0xc')]=function(_0x2cfd66){return request(_0x06d2('0xd'),{'options':{'raw':![],'where':{'id':_0x2cfd66},'include':[{'model':_0x06d2('0xe'),'as':_0x06d2('0xf')}],'attributes':['id','name',_0x06d2('0x10')]}});};exports[_0x06d2('0x11')]=function(_0x27da14){return request(_0x06d2('0x12'),{'options':{'where':{'id':_0x27da14},'attributes':['name']}});};exports[_0x06d2('0x13')]=function(_0x3998d4){return request(_0x06d2('0x14'),{'options':{'where':{'id':_0x3998d4},'attributes':[_0x06d2('0x15')]}});};exports[_0x06d2('0x16')]=function(_0x14cffe){return request(_0x06d2('0x17'),{'options':{'where':{'id':_0x14cffe},'attributes':[_0x06d2('0x15')]}});};exports[_0x06d2('0x18')]=function(_0x3026ae){return request(_0x06d2('0x19'),{'options':{'where':{'id':_0x3026ae},'attributes':[_0x06d2('0x1a')]}});};exports[_0x06d2('0x1b')]=function(_0x293074){return request(_0x06d2('0x1c'),{'options':{'where':{'id':_0x293074},'attributes':[_0x06d2('0x15')]}});};exports[_0x06d2('0x1d')]=function(_0x17959e){console[_0x06d2('0x1e')]('rpcreq',_0x17959e);return request(_0x06d2('0x1f'),{'options':{'where':{'phone':_0x17959e['phone']},'attributes':['id']}});};exports['getTrunkById']=function(_0x3ea83e){return request(_0x06d2('0x20'),{'options':{'where':{'id':_0x3ea83e},'attributes':[_0x06d2('0x15')]}});};exports[_0x06d2('0x21')]=function(_0x4aafdc){return request(_0x06d2('0x22'),{'options':{'where':{'id':_0x4aafdc},'attributes':['save_name']}});};exports[_0x06d2('0x23')]=function(_0x130988){return request(_0x06d2('0x24'),{'options':{'raw':![],'where':{'id':_0x130988},'include':[{'model':_0x06d2('0x25'),'as':_0x06d2('0x26')}]}});};exports['getSmsAccountById']=function(_0x2b902e){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2b902e},'attributes':['id',_0x06d2('0x15')]}});};exports['createSmsMessage']=function(_0x5c78b8){return request(_0x06d2('0x27'),{'body':_0x5c78b8});};exports[_0x06d2('0x28')]=function(_0x1aced9){return request(_0x06d2('0x29'),{'body':_0x1aced9});};exports['createSquareReport']=function(_0x20046a){return request(_0x06d2('0x2a'),{'body':_['merge'](_0x20046a,{'project_name':_0x20046a['arg_1'],'prev_project_name':_0x20046a[_0x06d2('0x2b')]||'','is_subproject':_0x20046a[_0x06d2('0x2b')]?!![]:![],'leaveAt':moment()[_0x06d2('0x2c')](_0x06d2('0x2d'))})});};exports[_0x06d2('0x2e')]=function(_0xed3352){return request(_0x06d2('0x2f'),{'body':_0xed3352});};exports[_0x06d2('0x30')]=function(_0x8cd512){return request(_0x06d2('0x31'),{'body':_0x8cd512});};exports[_0x06d2('0x32')]=function(_0x4b210f){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x4b210f['phone'],'ListId':_0x4b210f[_0x06d2('0x33')]}}})['then'](function(_0x4de744){if(_0x4de744){return _0x4de744;}return request('CreateCmContact',{'body':_0x4b210f});});};exports[_0x06d2('0x34')]=function(_0x92d623){return request('ShowPause',{'options':{'where':{'id':_0x92d623},'attributes':['name']}});};exports[_0x06d2('0x35')]=function(_0x1e3f89,_0x200245){return request(_0x06d2('0x36'),{'body':{'interface':_0x200245},'options':{'where':_0x1e3f89}});};exports[_0x06d2('0x37')]=function(_0x2c5d51,_0x417fb6,_0x236061){return request(_0x06d2('0x38'),{'body':{'type':_0x417fb6,'uniqueid':_0x236061},'options':{'where':_0x2c5d51}});};exports[_0x06d2('0x39')]=function(_0x10ffdc){return request(_0x06d2('0x3a'),{'body':{},'options':{'where':_0x10ffdc}});};exports['agentLogout']=function(_0x1c2d26){return request(_0x06d2('0x3b'),{'body':{},'options':{'where':_0x1c2d26}});};
\ No newline at end of file
+var _0x59ce=['agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','jayson/promise','client','http','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','GetContactByPhone','phone','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser'];(function(_0xc94434,_0x2502a5){var _0x35d16f=function(_0x3af9ed){while(--_0x3af9ed){_0xc94434['push'](_0xc94434['shift']());}};_0x35d16f(++_0x2502a5);}(_0x59ce,0x162));var _0xe59c=function(_0x5350a9,_0x260d2b){_0x5350a9=_0x5350a9-0x0;var _0x562584=_0x59ce[_0x5350a9];return _0x562584;};'use strict';var BPromise=require(_0xe59c('0x0'));var moment=require(_0xe59c('0x1'));var _=require(_0xe59c('0x2'));var util=require('util');var jayson=require(_0xe59c('0x3'));var client=jayson[_0xe59c('0x4')][_0xe59c('0x5')]({'port':0x2329});function request(_0xd4510,_0xd199dc){return new BPromise(function(_0x12902e,_0x4bbfd0){return client['request'](_0xd4510,_0xd199dc)['then'](function(_0x116aa9){if(_0x116aa9['error']){return _0x4bbfd0(_0x116aa9['error']['message']);}else{return _0x12902e(_0x116aa9[_0xe59c('0x6')]);}})[_0xe59c('0x7')](function(_0x2fc5b0){return _0x4bbfd0(_0x2fc5b0);});});}exports[_0xe59c('0x8')]=function(_0x3af107){return request(_0xe59c('0x9'),{'options':{'raw':![],'where':{'name':_0x3af107},'attributes':['production']}});};exports[_0xe59c('0xa')]=function(_0x4598fb){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x4598fb},'include':[{'model':_0xe59c('0xb'),'as':'Smtp'}],'attributes':['id',_0xe59c('0xc'),'email']}});};exports[_0xe59c('0xd')]=function(_0x2fb6a7){return request(_0xe59c('0x9'),{'options':{'where':{'id':_0x2fb6a7},'attributes':['name']}});};exports[_0xe59c('0xe')]=function(_0x2a8ed3){return request(_0xe59c('0xf'),{'options':{'where':{'id':_0x2a8ed3},'attributes':[_0xe59c('0xc')]}});};exports[_0xe59c('0x10')]=function(_0x3e8bf9){return request(_0xe59c('0x11'),{'options':{'where':{'id':_0x3e8bf9},'attributes':[_0xe59c('0xc')]}});};exports['getSquareOdbcById']=function(_0x2feabb){return request(_0xe59c('0x12'),{'options':{'where':{'id':_0x2feabb},'attributes':[_0xe59c('0x13')]}});};exports[_0xe59c('0x14')]=function(_0x563b27){return request('ShowUser',{'options':{'where':{'id':_0x563b27},'attributes':[_0xe59c('0xc')]}});};exports['getContactByPhone']=function(_0x469a49){return request(_0xe59c('0x15'),{'options':{'where':{'phone':_0x469a49[_0xe59c('0x16')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x5d4ae0){return request(_0xe59c('0x17'),{'options':{'where':{'id':_0x5d4ae0},'attributes':[_0xe59c('0xc')]}});};exports[_0xe59c('0x18')]=function(_0x46cb87){return request('ShowSound',{'options':{'where':{'id':_0x46cb87},'attributes':[_0xe59c('0x19')]}});};exports[_0xe59c('0x1a')]=function(_0x2696ab){return request(_0xe59c('0x1b'),{'options':{'raw':![],'where':{'id':_0x2696ab},'include':[{'model':_0xe59c('0x1c'),'as':_0xe59c('0x1d')}]}});};exports['getSmsAccountById']=function(_0x1eaeb1){return request(_0xe59c('0x1e'),{'options':{'where':{'id':_0x1eaeb1},'attributes':['id',_0xe59c('0xc')]}});};exports[_0xe59c('0x1f')]=function(_0x3e979c){return request(_0xe59c('0x20'),{'body':_0x3e979c});};exports[_0xe59c('0x21')]=function(_0x55f80d){return request(_0xe59c('0x22'),{'body':_0x55f80d});};exports[_0xe59c('0x23')]=function(_0x495be8){return request(_0xe59c('0x24'),{'body':_[_0xe59c('0x25')](_0x495be8,{'project_name':_0x495be8[_0xe59c('0x26')],'prev_project_name':_0x495be8[_0xe59c('0x27')]||'','is_subproject':_0x495be8[_0xe59c('0x27')]?!![]:![],'leaveAt':moment()[_0xe59c('0x28')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xe59c('0x29')]=function(_0x4b22ab){return request('CreateSquareRecording',{'body':_0x4b22ab});};exports[_0xe59c('0x2a')]=function(_0x37f205){return request(_0xe59c('0x2b'),{'body':_0x37f205});};exports['createCmContact']=function(_0x1da0fc){return request(_0xe59c('0x2c'),{'options':{'raw':![],'where':{'phone':_0x1da0fc[_0xe59c('0x16')],'ListId':_0x1da0fc[_0xe59c('0x2d')]}}})[_0xe59c('0x2e')](function(_0x585310){if(_0x585310){return _0x585310;}return request(_0xe59c('0x2f'),{'body':_0x1da0fc});});};exports[_0xe59c('0x30')]=function(_0x1fdc20){return request(_0xe59c('0x31'),{'options':{'where':{'id':_0x1fdc20},'attributes':[_0xe59c('0xc')]}});};exports[_0xe59c('0x32')]=function(_0x396950,_0x301e46){return request(_0xe59c('0x33'),{'body':{'interface':_0x301e46},'options':{'where':_0x396950}});};exports[_0xe59c('0x34')]=function(_0x162822,_0x4ae6e8,_0x18d994){return request(_0xe59c('0x35'),{'body':{'type':_0x4ae6e8,'uniqueid':_0x18d994},'options':{'where':_0x162822}});};exports[_0xe59c('0x36')]=function(_0x3282fb){return request(_0xe59c('0x37'),{'body':{},'options':{'where':_0x3282fb}});};exports[_0xe59c('0x38')]=function(_0x4bfa1e){return request(_0xe59c('0x39'),{'body':{},'options':{'where':_0x4bfa1e}});};
\ No newline at end of file
index 370c1ed..078d846 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6737=['./lex','exports'];(function(_0x1cb783,_0x197145){var _0x4fae14=function(_0x2d9771){while(--_0x2d9771){_0x1cb783['push'](_0x1cb783['shift']());}};_0x4fae14(++_0x197145);}(_0x6737,0xe2));var _0x7673=function(_0x16c0fe,_0x38f056){_0x16c0fe=_0x16c0fe-0x0;var _0x4f7e0a=_0x6737[_0x16c0fe];return _0x4f7e0a;};var polly=require('./polly');var lex=require(_0x7673('0x0'));module[_0x7673('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0xd6d6=['exports','./polly','./lex'];(function(_0x1de8f9,_0x4b42ff){var _0x1a03dc=function(_0x42c883){while(--_0x42c883){_0x1de8f9['push'](_0x1de8f9['shift']());}};_0x1a03dc(++_0x4b42ff);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x1ef295,_0x3ed144){_0x1ef295=_0x1ef295-0x0;var _0x167ed9=_0xd6d6[_0x1ef295];return _0x167ed9;};var polly=require(_0x6d6d('0x0'));var lex=require(_0x6d6d('0x1'));module[_0x6d6d('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
index 5bfae52..55c9d6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e85=['./lib/api','exports'];(function(_0x5854a6,_0x4111dd){var _0x32c7ee=function(_0x4a28dd){while(--_0x4a28dd){_0x5854a6['push'](_0x5854a6['shift']());}};_0x32c7ee(++_0x4111dd);}(_0x0e85,0x7c));var _0x50e8=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x0e85[_0x4dc7b9];return _0x3ab114;};'use strict';var lex=require(_0x50e8('0x0'));module[_0x50e8('0x1')]=function(_0x5a568b,_0x11a13a,_0x682d10,_0x55e515,_0x55cba3,_0x4ce6cd){return lex(_0x5a568b,_0x11a13a,_0x682d10,_0x55e515,_0x55cba3,_0x4ce6cd);};
\ No newline at end of file
+var _0x16d2=['exports','./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16d2,0x123));var _0x216d=function(_0x3a968e,_0x105c4d){_0x3a968e=_0x3a968e-0x0;var _0x9c978e=_0x16d2[_0x3a968e];return _0x9c978e;};'use strict';var lex=require(_0x216d('0x0'));module[_0x216d('0x1')]=function(_0x398c34,_0x371e93,_0x1688cc,_0x3a2589,_0x34cf5b,_0x239b49){return lex(_0x398c34,_0x371e93,_0x1688cc,_0x3a2589,_0x34cf5b,_0x239b49);};
\ No newline at end of file
index d424256..e0351a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f48=['bluebird','aws-sdk','postText','slots','hasOwnProperty','slot_','exports'];(function(_0x579924,_0x3cec6d){var _0x44531c=function(_0x239c47){while(--_0x239c47){_0x579924['push'](_0x579924['shift']());}};_0x44531c(++_0x3cec6d);}(_0x8f48,0x18f));var _0x88f4=function(_0x4d2993,_0x1c9473){_0x4d2993=_0x4d2993-0x0;var _0x427374=_0x8f48[_0x4d2993];return _0x427374;};'use strict';var BPromise=require(_0x88f4('0x0'));var AWS=require(_0x88f4('0x1'));function lexResult(_0x17a294,_0x58696f){return new BPromise(function(_0xdaf327,_0x86af3){_0x17a294[_0x88f4('0x2')](_0x58696f,function(_0x5670c9,_0x18e4b9){if(_0x5670c9){_0x86af3(_0x5670c9);}if(_0x18e4b9['slots']){for(const _0x9d0485 in _0x18e4b9[_0x88f4('0x3')]){if(_0x18e4b9[_0x88f4('0x3')][_0x88f4('0x4')](_0x9d0485)){var _0x4242f5=_0x18e4b9[_0x88f4('0x3')][_0x9d0485];_0x18e4b9[_0x88f4('0x5')+_0x9d0485]=_0x4242f5;}}}_0xdaf327(_0x18e4b9);});});}module[_0x88f4('0x6')]=function(_0x16a851,_0x4d7cd7,_0x1a89b3,_0x5cfa58,_0xf792e0,_0x486dfc){var _0x20d3cd=new AWS['LexRuntime']({'accessKeyId':_0x4d7cd7,'secretAccessKey':_0x1a89b3,'region':_0x5cfa58});var _0x3527b0={'botAlias':'$LATEST','botName':_0x486dfc,'inputText':_0xf792e0,'userId':_0x16a851};return lexResult(_0x20d3cd,_0x3527b0);};
\ No newline at end of file
+var _0xe14e=['slots','slot_','LexRuntime','$LATEST','bluebird','aws-sdk','postText'];(function(_0x152985,_0x256196){var _0x163470=function(_0x464ba4){while(--_0x464ba4){_0x152985['push'](_0x152985['shift']());}};_0x163470(++_0x256196);}(_0xe14e,0x1a1));var _0xee14=function(_0x40fee8,_0x122f8e){_0x40fee8=_0x40fee8-0x0;var _0x40ab1f=_0xe14e[_0x40fee8];return _0x40ab1f;};'use strict';var BPromise=require(_0xee14('0x0'));var AWS=require(_0xee14('0x1'));function lexResult(_0x3b536f,_0x1cb1b7){return new BPromise(function(_0x16c869,_0x8052aa){_0x3b536f[_0xee14('0x2')](_0x1cb1b7,function(_0x4b96ba,_0x30f4fe){if(_0x4b96ba){_0x8052aa(_0x4b96ba);}if(_0x30f4fe[_0xee14('0x3')]){for(const _0x4e75c7 in _0x30f4fe[_0xee14('0x3')]){if(_0x30f4fe[_0xee14('0x3')]['hasOwnProperty'](_0x4e75c7)){var _0x48ea11=_0x30f4fe[_0xee14('0x3')][_0x4e75c7];_0x30f4fe[_0xee14('0x4')+_0x4e75c7]=_0x48ea11;}}}_0x16c869(_0x30f4fe);});});}module['exports']=function(_0x1f45d4,_0x5a07b9,_0x930de4,_0x3f80ac,_0x33e761,_0x34bf24){var _0x50e4a0=new AWS[(_0xee14('0x5'))]({'accessKeyId':_0x5a07b9,'secretAccessKey':_0x930de4,'region':_0x3f80ac});var _0x31d080={'botAlias':_0xee14('0x6'),'botName':_0x34bf24,'inputText':_0x33e761,'userId':_0x1f45d4};return lexResult(_0x50e4a0,_0x31d080);};
\ No newline at end of file
index f3f2303..52c0640 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8274=['./lib/api'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8274,0x16d));var _0x4827=function(_0x47713a,_0xb8dc3a){_0x47713a=_0x47713a-0x0;var _0x345645=_0x8274[_0x47713a];return _0x345645;};'use strict';var polly=require(_0x4827('0x0'));module['exports']=function(_0x39c2e3,_0x287b76,_0x37b001,_0x24401b,_0x5e8391,_0x5559e0,_0x2871b9){return polly(_0x39c2e3,_0x287b76,_0x37b001,_0x24401b,_0x5e8391,_0x5559e0,_0x2871b9);};
\ No newline at end of file
+var _0x2326=['exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2326,0xa0));var _0x6232=function(_0x40a98e,_0x5467e0){_0x40a98e=_0x40a98e-0x0;var _0x2fbb34=_0x2326[_0x40a98e];return _0x2fbb34;};'use strict';var polly=require('./lib/api');module[_0x6232('0x0')]=function(_0x2f9811,_0xc5fae1,_0xdda819,_0x521cf9,_0x1bb9d2,_0x5a6bdc,_0xa33df9){return polly(_0x2f9811,_0xc5fae1,_0xdda819,_0x521cf9,_0x1bb9d2,_0x5a6bdc,_0xa33df9);};
\ No newline at end of file
index 8e0d1c7..31b1806 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50e4=['AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','randomstring','aws-sdk'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x50e4,0x1a0));var _0x450e=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x50e4[_0x2235bf];return _0x4c3a64;};'use strict';var fs=require('fs');var path=require(_0x450e('0x0'));var BPromise=require(_0x450e('0x1'));var rs=require(_0x450e('0x2'));var AWS=require(_0x450e('0x3'));function pollyResult(_0x535ccb,_0x3dbe12,_0x35ee8a){return new BPromise(function(_0x5c0984,_0x25921e){_0x535ccb['synthesizeSpeech'](_0x3dbe12,function(_0x59f41e,_0x91de7e){if(_0x59f41e){_0x25921e(_0x59f41e);}else if(_0x91de7e){if(_0x91de7e[_0x450e('0x4')]instanceof Buffer){fs[_0x450e('0x5')](_0x35ee8a,_0x91de7e[_0x450e('0x4')],function(_0x57b21b){if(_0x57b21b){_0x25921e(_0x57b21b);}else{_0x5c0984();}});}else{_0x25921e(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x25921e(new Error(_0x450e('0x6')));}});});}module[_0x450e('0x7')]=function(_0x1452e9,_0x571fcc,_0x1bd31d,_0x3d96e9,_0x3a0c9e,_0x326ff0,_0x2fd067){var _0x117ca9=new AWS['Polly']({'accessKeyId':_0x1452e9,'secretAccessKey':_0x571fcc,'region':_0x1bd31d});var _0x3928b3={'Text':_0x3a0c9e,'TextType':_0x326ff0||_0x450e('0x8'),'OutputFormat':_0x450e('0x9'),'VoiceId':_0x3d96e9};return pollyResult(_0x117ca9,_0x3928b3,_0x2fd067);};
\ No newline at end of file
+var _0x28b9=['writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','path','bluebird','aws-sdk','synthesizeSpeech'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x28b9,0x7e));var _0x928b=function(_0x63500b,_0x508aa1){_0x63500b=_0x63500b-0x0;var _0x492332=_0x28b9[_0x63500b];return _0x492332;};'use strict';var fs=require('fs');var path=require(_0x928b('0x0'));var BPromise=require(_0x928b('0x1'));var rs=require('randomstring');var AWS=require(_0x928b('0x2'));function pollyResult(_0x532c61,_0x101cf9,_0x2c0a17){return new BPromise(function(_0x26a5d3,_0x5ecc13){_0x532c61[_0x928b('0x3')](_0x101cf9,function(_0xa1bb3e,_0x1086c5){if(_0xa1bb3e){_0x5ecc13(_0xa1bb3e);}else if(_0x1086c5){if(_0x1086c5['AudioStream']instanceof Buffer){fs[_0x928b('0x4')](_0x2c0a17,_0x1086c5[_0x928b('0x5')],function(_0xbe3768){if(_0xbe3768){_0x5ecc13(_0xbe3768);}else{_0x26a5d3();}});}else{_0x5ecc13(new Error(_0x928b('0x6')));}}else{_0x5ecc13(new Error(_0x928b('0x7')));}});});}module[_0x928b('0x8')]=function(_0xf41820,_0x522090,_0x20964d,_0x160a97,_0x24f1ec,_0x59297d,_0x10f4b4){var _0x10d5bf=new AWS[(_0x928b('0x9'))]({'accessKeyId':_0xf41820,'secretAccessKey':_0x522090,'region':_0x20964d});var _0x448fb={'Text':_0x24f1ec,'TextType':_0x59297d||'text','OutputFormat':'mp3','VoiceId':_0x160a97};return pollyResult(_0x10d5bf,_0x448fb,_0x10f4b4);};
\ No newline at end of file
index 9a70b06..56d9031 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcba7=['exports','./lib/api'];(function(_0x4ff30f,_0x1647b4){var _0x27fd11=function(_0x1d4ed9){while(--_0x1d4ed9){_0x4ff30f['push'](_0x4ff30f['shift']());}};_0x27fd11(++_0x1647b4);}(_0xcba7,0x147));var _0x7cba=function(_0x40b13e,_0x2837ab){_0x40b13e=_0x40b13e-0x0;var _0x3a949a=_0xcba7[_0x40b13e];return _0x3a949a;};'use strict';var asr=require(_0x7cba('0x0'));module[_0x7cba('0x1')]=function(_0x5843d7,_0x5d2cad,_0x2aa945,_0xf0ccda){return asr(_0x5843d7,_0x5d2cad,_0x2aa945);};
\ No newline at end of file
+var _0xcd09=['exports','./lib/api'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0xcd09,0xab));var _0x9cd0=function(_0x4a1e37,_0x2eef28){_0x4a1e37=_0x4a1e37-0x0;var _0xeb1f8b=_0xcd09[_0x4a1e37];return _0xeb1f8b;};'use strict';var asr=require(_0x9cd0('0x0'));module[_0x9cd0('0x1')]=function(_0x208210,_0x470e98,_0x141d02,_0xfadda7){return asr(_0x208210,_0x470e98,_0x141d02);};
\ No newline at end of file
index ef9bde3..6fab0f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc648=['LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','readFileSync','base64'];(function(_0x393365,_0x2b254e){var _0x58fb5=function(_0x46e5f1){while(--_0x46e5f1){_0x393365['push'](_0x393365['shift']());}};_0x58fb5(++_0x2b254e);}(_0xc648,0xb1));var _0x8c64=function(_0x9120d7,_0x481127){_0x9120d7=_0x9120d7-0x0;var _0x352601=_0xc648[_0x9120d7];return _0x352601;};'use strict';var url=require(_0x8c64('0x0'));var BPromise=require(_0x8c64('0x1'));var fs=require('fs');var host=_0x8c64('0x2');module[_0x8c64('0x3')]=function(_0x24ba55,_0x552700,_0x45921c){return new BPromise(function(_0x2120af,_0x5f3068){var _0x5d40cf;if(typeof _0x24ba55!==_0x8c64('0x4')||_0x24ba55[_0x8c64('0x5')]===0x0){return _0x5f3068(_0x8c64('0x6'));}if(typeof _0x552700!=='string'||_0x552700[_0x8c64('0x5')]===0x0){return _0x5f3068('key\x20should\x20be\x20a\x20string');}if(typeof _0x45921c!==_0x8c64('0x7')&&(typeof _0x45921c!==_0x8c64('0x4')||_0x45921c[_0x8c64('0x5')]===0x0)){return _0x5f3068('lang\x20should\x20be\x20a\x20string');}try{_0x5d40cf=fs[_0x8c64('0x8')](_0x24ba55)['toString'](_0x8c64('0x9'));}catch(_0x49b00f){return _0x5f3068(_0x49b00f);}return _0x2120af({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x552700,'body':{'config':{'encoding':_0x8c64('0xa'),'sampleRateHertz':'8000','languageCode':_0x45921c},'audio':{'content':_0x5d40cf}},'json':!![]});});};
\ No newline at end of file
+var _0x2153=['base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','exports','length','filepath\x20should\x20be\x20a\x20string','undefined','string','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x2153,0x6e));var _0x3215=function(_0x39a5d4,_0x3c72c2){_0x39a5d4=_0x39a5d4-0x0;var _0xb29a0c=_0x2153[_0x39a5d4];return _0xb29a0c;};'use strict';var url=require(_0x3215('0x0'));var BPromise=require(_0x3215('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x3215('0x2')]=function(_0x55f010,_0x59eeab,_0x18fc74){return new BPromise(function(_0x529336,_0x2f09dd){var _0x2a6c3e;if(typeof _0x55f010!=='string'||_0x55f010[_0x3215('0x3')]===0x0){return _0x2f09dd(_0x3215('0x4'));}if(typeof _0x59eeab!=='string'||_0x59eeab[_0x3215('0x3')]===0x0){return _0x2f09dd('key\x20should\x20be\x20a\x20string');}if(typeof _0x18fc74!==_0x3215('0x5')&&(typeof _0x18fc74!==_0x3215('0x6')||_0x18fc74[_0x3215('0x3')]===0x0)){return _0x2f09dd(_0x3215('0x7'));}try{_0x2a6c3e=fs[_0x3215('0x8')](_0x55f010)[_0x3215('0x9')](_0x3215('0xa'));}catch(_0x4312da){return _0x2f09dd(_0x4312da);}return _0x529336({'method':_0x3215('0xb'),'uri':host+_0x3215('0xc')+_0x59eeab,'body':{'config':{'encoding':_0x3215('0xd'),'sampleRateHertz':_0x3215('0xe'),'languageCode':_0x18fc74},'audio':{'content':_0x2a6c3e}},'json':!![]});});};
\ No newline at end of file
index 2160425..7cb48e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1af1=['exports','./asr'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x1af1,0x133));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};var asr=require(_0x11af('0x0'));module[_0x11af('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xe742=['./asr'];(function(_0x1e81f6,_0x15e762){var _0xa05916=function(_0x319e21){while(--_0x319e21){_0x1e81f6['push'](_0x1e81f6['shift']());}};_0xa05916(++_0x15e762);}(_0xe742,0xa4));var _0x2e74=function(_0x220b24,_0x2e5d6c){_0x220b24=_0x220b24-0x0;var _0xbed38d=_0xe742[_0x220b24];return _0xbed38d;};var asr=require(_0x2e74('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
index 206880c..a57a49b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x230e=['https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','resolve','.mp3','from','writeFile','777','.wav','googleTTS','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','endConversation','metadata','isFallbackIntent','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','path','http','https','randomstring','sox','request-promise','util','google-tts-api','md5','./google','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','https:','data','end','transcode','finish\x20to\x20convert','start','tmp','generate','writeFileSync','base64','then','chmodSync','split','readFileSync','toString','googleCloudTTS'];(function(_0x37dd41,_0x48f9cc){var _0x4b01c0=function(_0x257133){while(--_0x257133){_0x37dd41['push'](_0x37dd41['shift']());}};_0x4b01c0(++_0x48f9cc);}(_0x230e,0xb6));var _0xe230=function(_0x5b6f6d,_0x35a6de){_0x5b6f6d=_0x5b6f6d-0x0;var _0x434b0c=_0x230e[_0x5b6f6d];return _0x434b0c;};'use strict';var fs=require('fs');var path=require(_0xe230('0x0'));var http=require(_0xe230('0x1'));var https=require(_0xe230('0x2'));var urlParse=require('url')['parse'];var BPromise=require('bluebird');var rs=require(_0xe230('0x3'));var sox=require(_0xe230('0x4'));var rp=require(_0xe230('0x5'));var util=require(_0xe230('0x6'));var querystring=require('querystring');var tts=require(_0xe230('0x7'));var apiai=require('apiai-promise');var md5=require(_0xe230('0x8'));var google=require(_0xe230('0x9'));var aws=require(_0xe230('0xa'));var tilde=require(_0xe230('0xb'));var sestek=require(_0xe230('0xc'));var logger=require(_0xe230('0xd'))(_0xe230('0xe'));var ISPEECH_API=_0xe230('0xf');function downloadFile(_0x1acf85,_0x124aa8){return new BPromise(function(_0x57c2e3,_0x11d534){var _0x458353=urlParse(_0x1acf85);var _0x25a4e6=_0x458353[_0xe230('0x10')]==='https:'?https:http;var _0x5d7909={'host':_0x458353[_0xe230('0x11')],'path':_0x458353[_0xe230('0x0')],'headers':{'user-agent':_0xe230('0x12')}};_0x25a4e6[_0xe230('0x13')](_0x5d7909,function(_0x3ed44e){if(_0x3ed44e[_0xe230('0x14')]!==0xc8){logger['error'](_0xe230('0x15')+_0x1acf85+_0xe230('0x16')+_0x3ed44e[_0xe230('0x14')]+'\x20('+_0x3ed44e[_0xe230('0x17')]+')');_0x11d534(new Error(_0xe230('0x15')+_0x1acf85+'\x20failed,\x20status\x20code\x20=\x20'+_0x3ed44e[_0xe230('0x14')]+'\x20('+_0x3ed44e[_0xe230('0x17')]+')'));return;}var _0x3eb314=fs['createWriteStream'](_0x124aa8);_0x3eb314['on'](_0xe230('0x18'),function(){logger[_0xe230('0x19')](_0xe230('0x1a'));_0x3eb314[_0xe230('0x1b')](_0x57c2e3);});_0x3eb314['on'](_0xe230('0x1c'),function(_0x454020){fs[_0xe230('0x1d')](_0x124aa8);logger[_0xe230('0x1c')](_0xe230('0x1e'),_0x454020);_0x11d534(_0x454020);});_0x3ed44e[_0xe230('0x1f')](_0x3eb314);})['on'](_0xe230('0x1c'),function(_0x57c1d2){logger[_0xe230('0x1c')](_0x57c1d2);_0x11d534(_0x57c1d2);})['end']();});}function uploadFile(_0x488b4a){return new BPromise(function(_0x1ef5a5,_0x5266e8){var _0xe95513=urlParse(_0x488b4a);var _0x15ce88=_0xe95513[_0xe230('0x10')]===_0xe230('0x20')?https:http;var _0x3b3c44={'host':_0xe95513[_0xe230('0x11')],'path':_0xe95513['path'],'headers':{'user-agent':_0xe230('0x12')}};_0x15ce88[_0xe230('0x13')](_0x3b3c44,function(_0x5bb15d){if(_0x5bb15d[_0xe230('0x14')]!==0xc8){_0x5266e8(new Error(_0xe230('0x15')+_0x488b4a+_0xe230('0x16')+_0x5bb15d['statusCode']+'\x20('+_0x5bb15d[_0xe230('0x17')]+')'));return;}var _0x4c3729='';_0x5bb15d['on'](_0xe230('0x21'),function(_0x195d33){_0x4c3729+=_0x195d33;});_0x5bb15d['on'](_0xe230('0x22'),function(){_0x1ef5a5(_0x4c3729);});})['on']('error',function(_0x43f268){_0x5266e8(_0x43f268);})[_0xe230('0x22')]();});}function convertFile(_0x17ef64,_0x1bb8cf){return new BPromise(function(_0x43143c,_0x218c36){var _0x2314f6=sox[_0xe230('0x23')](_0x17ef64,_0x1bb8cf,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2314f6['on'](_0xe230('0x1c'),function(_0x29c18c){logger[_0xe230('0x1c')]('error\x20convert',_0x29c18c);_0x218c36(_0x29c18c);});_0x2314f6['on'](_0xe230('0x22'),function(){logger['info'](_0xe230('0x24'));_0x43143c();});_0x2314f6[_0xe230('0x25')]();});}function base64Decode(_0x4b9fd1,_0xc4cfe3){var _0x2b8aa6=path['resolve'](__dirname,_0xe230('0x26'),rs[_0xe230('0x27')](0x4)+'.wav');fs[_0xe230('0x28')](_0x2b8aa6,_0x4b9fd1,_0xe230('0x29'));return convertFile(_0x2b8aa6,_0xc4cfe3)[_0xe230('0x2a')](function(){try{fs[_0xe230('0x1d')](_0x2b8aa6);fs[_0xe230('0x2b')](_0xc4cfe3,'777');}catch(_0x13098d){logger[_0xe230('0x1c')](_0x13098d);}return _0xc4cfe3[_0xe230('0x2c')]('.')[0x0];});}function base64Encode(_0x146815){var _0x4f1602=fs[_0xe230('0x2d')](_0x146815);return new Buffer(_0x4f1602)[_0xe230('0x2e')](_0xe230('0x29'));}exports[_0xe230('0x2f')]=function(_0x105b6d,_0x3a7c23,_0x532ab,_0x21ec47,_0x158632,_0x3d0ee2){var _0x5fbb28,_0x4fa960;var _0x4d8ad3=_0xe230('0x30');var _0x4dc84b='?key='+_0x105b6d;var _0x17bd5c={};if(_0x3a7c23===_0xe230('0x31')){_0x17bd5c['input']={'ssml':_0x532ab};}else{_0x17bd5c[_0xe230('0x32')]={'text':_0x532ab};};_0x17bd5c[_0xe230('0x33')]={'languageCode':_0x21ec47,'ssmlGender':_0x158632};_0x17bd5c[_0xe230('0x34')]={'audioEncoding':_0xe230('0x35'),'sampleRateHertz':0x1f40};var _0x445afb={'url':_0x4d8ad3+_0xe230('0x36')+_0x4dc84b,'method':_0xe230('0x37'),'json':!![],'body':_0x17bd5c};return rp(_0x445afb)[_0xe230('0x2a')](function(_0x2cbdc1){return new BPromise(function(_0x2019b4,_0x56eec8){_0x5fbb28=path[_0xe230('0x38')](__dirname,'tmp',rs[_0xe230('0x27')](0x4)+_0xe230('0x39'));var _0x379688=Buffer[_0xe230('0x3a')](_0x2cbdc1['audioContent'],'base64');return fs[_0xe230('0x3b')](_0x5fbb28,_0x379688,function(_0x42c77f){_0x56eec8(_0x42c77f);},function(_0x2b6877){fs[_0xe230('0x2b')](_0x5fbb28,_0xe230('0x3c'));_0x2019b4(_0x2b6877);});});})[_0xe230('0x2a')](function(_0x553f06){_0x4fa960=path[_0xe230('0x38')](__dirname,_0xe230('0x26'),rs[_0xe230('0x27')](0x4)+_0xe230('0x3d'));return convertFile(_0x5fbb28,_0x4fa960);})[_0xe230('0x2a')](function(){try{fs['unlink'](_0x5fbb28);fs[_0xe230('0x2b')](_0x4fa960,_0xe230('0x3c'));}catch(_0x425eb4){logger['error'](_0x425eb4);}logger[_0xe230('0x19')]('googleCloudTTS\x20path',_0x4fa960[_0xe230('0x2c')]('.')[0x0]);return _0x4fa960[_0xe230('0x2c')]('.')[0x0];});};exports[_0xe230('0x3e')]=function(_0x37149f,_0x491197){var _0x5b988a,_0x5871b7;return tts(_0x37149f,_0x491197||'en',0x1)['then'](function(_0x3afda2){logger['info'](_0x3afda2);_0x5b988a=path['resolve'](__dirname,_0xe230('0x26'),rs[_0xe230('0x27')](0x4)+_0xe230('0x39'));return downloadFile(_0x3afda2,_0x5b988a);})[_0xe230('0x2a')](function(){_0x5871b7=path[_0xe230('0x38')](__dirname,_0xe230('0x26'),rs[_0xe230('0x27')](0x4)+_0xe230('0x3d'));return convertFile(_0x5b988a,_0x5871b7);})[_0xe230('0x2a')](function(){try{fs['unlink'](_0x5b988a);fs['chmodSync'](_0x5871b7,_0xe230('0x3c'));}catch(_0x56e6eb){logger[_0xe230('0x1c')](_0x56e6eb);}logger['info'](_0xe230('0x3f'),_0x5871b7[_0xe230('0x2c')]('.')[0x0]);return _0x5871b7[_0xe230('0x2c')]('.')[0x0];});};exports['googleASR']=function(_0x4c19ae,_0x389481,_0x698e04){return google[_0xe230('0x40')](_0x4c19ae,_0x389481,_0x698e04)[_0xe230('0x2a')](function(_0x444119){logger[_0xe230('0x19')](_0x444119[_0xe230('0x41')]);return rp(_0x444119);})['then'](function(_0x59cd9b){var _0x5adf0a='';var _0x25baac=0x0;try{fs[_0xe230('0x1d')](_0x4c19ae);}catch(_0x540a94){logger[_0xe230('0x1c')](_0x540a94);}if(_0x59cd9b&&_0x59cd9b[_0xe230('0x42')]){_0x5adf0a=_0x59cd9b[_0xe230('0x42')][_0xe230('0x43')](function(_0x4c8d94){return _0x4c8d94&&_0x4c8d94[_0xe230('0x44')][0x0]&&_0x4c8d94['alternatives'][0x0][_0xe230('0x45')]?_0x4c8d94[_0xe230('0x44')][0x0][_0xe230('0x45')]:'';})['join']('\x0a');_0x25baac=_0x59cd9b['results'][_0xe230('0x43')](function(_0x486514){return _0x486514&&_0x486514[_0xe230('0x44')][0x0]&&_0x486514['alternatives'][0x0]['confidence']?_0x486514[_0xe230('0x44')][0x0][_0xe230('0x46')]:0x0;})[_0xe230('0x47')]('\x0a');}logger[_0xe230('0x19')](_0xe230('0x48'),_0x5adf0a);logger[_0xe230('0x19')](_0xe230('0x49'),_0x25baac);return{'transcript':_0x5adf0a,'confidence':_0x25baac};})[_0xe230('0x4a')](function(_0x424c0c){logger[_0xe230('0x1c')](_0xe230('0x4b'),_0x424c0c[_0xe230('0x14')],_0x424c0c[_0xe230('0x4c')],_0x424c0c[_0xe230('0x4d')]);});};exports[_0xe230('0x4e')]=function(_0x55a39a,_0x3959ff,_0x2efb61,_0x5d68f0){var _0x4f63b0=apiai(_0x3959ff,{'language':_0x5d68f0||'en'});return _0x4f63b0['textRequest'](_0x2efb61,{'sessionId':md5(_0x55a39a)})['then'](function(_0x2212ca){logger[_0xe230('0x19')](JSON[_0xe230('0x4f')](_0x2212ca));return{'source':_0x2212ca[_0xe230('0x50')][_0xe230('0x51')],'resolvedQuery':_0x2212ca['result'][_0xe230('0x52')],'action':_0x2212ca['result'][_0xe230('0x53')],'actionIncomplete':_0x2212ca[_0xe230('0x50')][_0xe230('0x54')],'speech':_0x2212ca[_0xe230('0x50')][_0xe230('0x55')]['speech'],'score':_0x2212ca['result'][_0xe230('0x56')],'statusCode':_0x2212ca[_0xe230('0x57')][_0xe230('0x58')],'endConversation':_0x2212ca[_0xe230('0x50')]['metadata'][_0xe230('0x59')]||![],'isFallbackIntent':_0x2212ca[_0xe230('0x50')][_0xe230('0x5a')][_0xe230('0x5b')]};});};exports['tildeASR']=function(_0x47bd6f,_0x2fe05b,_0x5d760d,_0x8d2512){return tilde[_0xe230('0x40')](_0x47bd6f,_0x2fe05b,_0x5d760d,_0x8d2512)[_0xe230('0x2a')](function(_0x1b711f){try{fs[_0xe230('0x1d')](_0x47bd6f);}catch(_0x460b8c){logger[_0xe230('0x1c')](_0x460b8c);}logger['info'](_0xe230('0x5c'),_0x1b711f[_0xe230('0x45')]);logger[_0xe230('0x19')](_0xe230('0x5d'),_0x1b711f[_0xe230('0x46')]);return _0x1b711f;});};exports[_0xe230('0x5e')]=function(_0x27f4f6,_0xade667,_0x1ecad6,_0x488b8c,_0x16411d,_0x38b816){var _0x531dc5=path[_0xe230('0x38')](__dirname,'tmp',rs[_0xe230('0x27')](0x4)+_0xe230('0x39'));var _0x11dc43;return aws[_0xe230('0x5f')](_0x27f4f6,_0xade667,_0x1ecad6,_0x488b8c,_0x16411d,_0x38b816,_0x531dc5)[_0xe230('0x2a')](function(){_0x11dc43=path[_0xe230('0x38')](__dirname,_0xe230('0x26'),rs[_0xe230('0x27')](0x4)+_0xe230('0x3d'));return convertFile(_0x531dc5,_0x11dc43);})[_0xe230('0x2a')](function(){try{fs[_0xe230('0x1d')](_0x531dc5);fs[_0xe230('0x2b')](_0x11dc43,_0xe230('0x3c'));}catch(_0x2964e1){logger[_0xe230('0x1c')](_0x2964e1);}return _0x11dc43['split']('.')[0x0];});};exports[_0xe230('0x60')]=function(_0x22d2ec,_0x49a05b,_0x54fe66,_0x514fab,_0xbb6c50,_0x61d134){return aws[_0xe230('0x61')](_0x22d2ec,_0x49a05b,_0x54fe66,_0x514fab,_0xbb6c50,_0x61d134)[_0xe230('0x2a')](function(_0x54d4b3){logger[_0xe230('0x19')](JSON[_0xe230('0x4f')](_0x54d4b3));return _0x54d4b3;});};exports[_0xe230('0x62')]=function(_0x314906,_0x417afd,_0x3459a0,_0x50f2a0){var _0x4f0a1b=util[_0xe230('0x63')](_0xe230('0x64'),ISPEECH_API,_0x314906,encodeURIComponent(_0x417afd),_0x3459a0,_0x50f2a0);var _0x25dfdd=path[_0xe230('0x38')](__dirname,_0xe230('0x26'),rs['generate'](0x4)+_0xe230('0x39'));var _0x4f745a;return downloadFile(_0x4f0a1b,_0x25dfdd)[_0xe230('0x2a')](function(){_0x4f745a=path[_0xe230('0x38')](__dirname,_0xe230('0x26'),rs['generate'](0x4)+'.wav');return convertFile(_0x25dfdd,_0x4f745a);})['then'](function(){try{fs[_0xe230('0x1d')](_0x25dfdd);fs[_0xe230('0x2b')](_0x4f745a,_0xe230('0x3c'));}catch(_0x5ae6eb){logger[_0xe230('0x1c')](_0x5ae6eb);}return _0x4f745a[_0xe230('0x2c')]('.')[0x0];});};exports[_0xe230('0x65')]=function(_0x4ff9f9,_0x494d7d,_0x41c55d,_0x2ffaa6){var _0x472612=util[_0xe230('0x63')](_0xe230('0x66'),ISPEECH_API,_0x494d7d,_0x41c55d,base64Encode(_0x4ff9f9),_0x2ffaa6?util['format'](_0xe230('0x67'),encodeURIComponent(_0x2ffaa6)):_0xe230('0x68'));return uploadFile(_0x472612)[_0xe230('0x2a')](function(_0x471530){return querystring[_0xe230('0x69')](_0x471530);});};exports[_0xe230('0x6a')]=function(_0x350b72,_0x23e2dc){return sestek[_0xe230('0x6b')](_0x350b72,_0x23e2dc)[_0xe230('0x2a')](function(_0x4de112){logger[_0xe230('0x19')](JSON['stringify'](_0x4de112));var _0x955280={'speech':_0x4de112[_0xe230('0x6c')],'action':_0x4de112[_0xe230('0x6d')]?_0x4de112[_0xe230('0x6d')][_0xe230('0x6e')]:undefined,'actiondata':_0x4de112[_0xe230('0x6d')]?_0x4de112[_0xe230('0x6d')]['CustomActionData']:undefined};if(_0x4de112[_0xe230('0x6d')]&&_0x4de112[_0xe230('0x6d')][_0xe230('0x6f')]){return base64Decode(_0x4de112[_0xe230('0x6d')][_0xe230('0x6f')][_0xe230('0x70')],path[_0xe230('0x38')](__dirname,_0xe230('0x26'),rs[_0xe230('0x27')](0x4)+'.wav'))[_0xe230('0x2a')](function(_0x279acd){_0x955280[_0xe230('0x71')]=_0x279acd;return _0x955280;});}return _0x955280;});};exports[_0xe230('0x72')]=function(){return __dirname;};
\ No newline at end of file
+var _0x5baa=['speech','score','status','code','metadata','isFallbackIntent','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','model=%s','freeform=3','text','channelData','CustomAction','AudioFromTts','path','https','url','parse','randomstring','sox','request-promise','util','apiai-promise','md5','./google','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','WHAT_EVER','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','finish\x20download\x20file','unlink','error','download\x20error','pipe','end','https:','host','data','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','777','split','ssml','input','MP3','text:synthesize','POST','then','from','audioContent','base64','writeFile','chmodSync','resolve','.mp3','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','actionIncomplete','fulfillment'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x5baa,0x1b2));var _0xa5ba=function(_0x4eeda9,_0x28dc1d){_0x4eeda9=_0x4eeda9-0x0;var _0x3872b8=_0x5baa[_0x4eeda9];return _0x3872b8;};'use strict';var fs=require('fs');var path=require(_0xa5ba('0x0'));var http=require('http');var https=require(_0xa5ba('0x1'));var urlParse=require(_0xa5ba('0x2'))[_0xa5ba('0x3')];var BPromise=require('bluebird');var rs=require(_0xa5ba('0x4'));var sox=require(_0xa5ba('0x5'));var rp=require(_0xa5ba('0x6'));var util=require(_0xa5ba('0x7'));var querystring=require('querystring');var tts=require('google-tts-api');var apiai=require(_0xa5ba('0x8'));var md5=require(_0xa5ba('0x9'));var google=require(_0xa5ba('0xa'));var aws=require('./aws');var tilde=require(_0xa5ba('0xb'));var sestek=require(_0xa5ba('0xc'));var logger=require(_0xa5ba('0xd'))(_0xa5ba('0xe'));var ISPEECH_API=_0xa5ba('0xf');function downloadFile(_0x2f8da3,_0x580c3d){return new BPromise(function(_0x2a64d2,_0x39fb7c){var _0xde4ee5=urlParse(_0x2f8da3);var _0x21d3a1=_0xde4ee5[_0xa5ba('0x10')]==='https:'?https:http;var _0x54e8ac={'host':_0xde4ee5['host'],'path':_0xde4ee5[_0xa5ba('0x0')],'headers':{'user-agent':_0xa5ba('0x11')}};_0x21d3a1[_0xa5ba('0x12')](_0x54e8ac,function(_0x220def){if(_0x220def[_0xa5ba('0x13')]!==0xc8){logger['error']('request\x20to\x20'+_0x2f8da3+_0xa5ba('0x14')+_0x220def[_0xa5ba('0x13')]+'\x20('+_0x220def[_0xa5ba('0x15')]+')');_0x39fb7c(new Error(_0xa5ba('0x16')+_0x2f8da3+_0xa5ba('0x14')+_0x220def[_0xa5ba('0x13')]+'\x20('+_0x220def[_0xa5ba('0x15')]+')'));return;}var _0x587fc0=fs[_0xa5ba('0x17')](_0x580c3d);_0x587fc0['on'](_0xa5ba('0x18'),function(){logger['info'](_0xa5ba('0x19'));_0x587fc0['close'](_0x2a64d2);});_0x587fc0['on']('error',function(_0x54b7bb){fs[_0xa5ba('0x1a')](_0x580c3d);logger[_0xa5ba('0x1b')](_0xa5ba('0x1c'),_0x54b7bb);_0x39fb7c(_0x54b7bb);});_0x220def[_0xa5ba('0x1d')](_0x587fc0);})['on'](_0xa5ba('0x1b'),function(_0x1c9bd6){logger[_0xa5ba('0x1b')](_0x1c9bd6);_0x39fb7c(_0x1c9bd6);})[_0xa5ba('0x1e')]();});}function uploadFile(_0xfda229){return new BPromise(function(_0x24bdae,_0x589319){var _0x56c5df=urlParse(_0xfda229);var _0x243e6d=_0x56c5df[_0xa5ba('0x10')]===_0xa5ba('0x1f')?https:http;var _0x1c916b={'host':_0x56c5df[_0xa5ba('0x20')],'path':_0x56c5df[_0xa5ba('0x0')],'headers':{'user-agent':_0xa5ba('0x11')}};_0x243e6d['get'](_0x1c916b,function(_0x573653){if(_0x573653[_0xa5ba('0x13')]!==0xc8){_0x589319(new Error(_0xa5ba('0x16')+_0xfda229+_0xa5ba('0x14')+_0x573653[_0xa5ba('0x13')]+'\x20('+_0x573653['statusMessage']+')'));return;}var _0x545139='';_0x573653['on'](_0xa5ba('0x21'),function(_0x348b43){_0x545139+=_0x348b43;});_0x573653['on'](_0xa5ba('0x1e'),function(){_0x24bdae(_0x545139);});})['on']('error',function(_0x21d206){_0x589319(_0x21d206);})[_0xa5ba('0x1e')]();});}function convertFile(_0x992503,_0x11b904){return new BPromise(function(_0x19a15f,_0x8a8749){var _0x43376b=sox[_0xa5ba('0x22')](_0x992503,_0x11b904,{'sampleRate':0x1f40,'format':_0xa5ba('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x43376b['on'](_0xa5ba('0x1b'),function(_0x3686d9){logger[_0xa5ba('0x1b')](_0xa5ba('0x24'),_0x3686d9);_0x8a8749(_0x3686d9);});_0x43376b['on'](_0xa5ba('0x1e'),function(){logger[_0xa5ba('0x25')](_0xa5ba('0x26'));_0x19a15f();});_0x43376b[_0xa5ba('0x27')]();});}function base64Decode(_0x4bf3f9,_0x5958d5){var _0x4b6cbb=path['resolve'](__dirname,_0xa5ba('0x28'),rs[_0xa5ba('0x29')](0x4)+_0xa5ba('0x2a'));fs[_0xa5ba('0x2b')](_0x4b6cbb,_0x4bf3f9,'base64');return convertFile(_0x4b6cbb,_0x5958d5)['then'](function(){try{fs[_0xa5ba('0x1a')](_0x4b6cbb);fs['chmodSync'](_0x5958d5,_0xa5ba('0x2c'));}catch(_0x24174b){logger[_0xa5ba('0x1b')](_0x24174b);}return _0x5958d5[_0xa5ba('0x2d')]('.')[0x0];});}function base64Encode(_0x2d0895){var _0x872867=fs['readFileSync'](_0x2d0895);return new Buffer(_0x872867)['toString']('base64');}exports['googleCloudTTS']=function(_0x3ac144,_0x53e30a,_0x129e36,_0x495790,_0xad4b26,_0x1e8893){var _0x18946f,_0x22a6ae;var _0x343241='https://texttospeech.googleapis.com/v1/';var _0x2b3b1a='?key='+_0x3ac144;var _0x13bf4a={};if(_0x53e30a===_0xa5ba('0x2e')){_0x13bf4a[_0xa5ba('0x2f')]={'ssml':_0x129e36};}else{_0x13bf4a[_0xa5ba('0x2f')]={'text':_0x129e36};};_0x13bf4a['voice']={'languageCode':_0x495790,'ssmlGender':_0xad4b26};_0x13bf4a['audioConfig']={'audioEncoding':_0xa5ba('0x30'),'sampleRateHertz':0x1f40};var _0x5d3345={'url':_0x343241+_0xa5ba('0x31')+_0x2b3b1a,'method':_0xa5ba('0x32'),'json':!![],'body':_0x13bf4a};return rp(_0x5d3345)[_0xa5ba('0x33')](function(_0x22fb45){return new BPromise(function(_0x55744f,_0x1700c5){_0x18946f=path['resolve'](__dirname,_0xa5ba('0x28'),rs[_0xa5ba('0x29')](0x4)+'.mp3');var _0x50dc40=Buffer[_0xa5ba('0x34')](_0x22fb45[_0xa5ba('0x35')],_0xa5ba('0x36'));return fs[_0xa5ba('0x37')](_0x18946f,_0x50dc40,function(_0x2e712e){_0x1700c5(_0x2e712e);},function(_0x5c8276){fs[_0xa5ba('0x38')](_0x18946f,_0xa5ba('0x2c'));_0x55744f(_0x5c8276);});});})[_0xa5ba('0x33')](function(_0x54951a){_0x22a6ae=path[_0xa5ba('0x39')](__dirname,'tmp',rs[_0xa5ba('0x29')](0x4)+'.wav');return convertFile(_0x18946f,_0x22a6ae);})['then'](function(){try{fs['unlink'](_0x18946f);fs[_0xa5ba('0x38')](_0x22a6ae,_0xa5ba('0x2c'));}catch(_0x233d13){logger['error'](_0x233d13);}logger[_0xa5ba('0x25')]('googleCloudTTS\x20path',_0x22a6ae[_0xa5ba('0x2d')]('.')[0x0]);return _0x22a6ae[_0xa5ba('0x2d')]('.')[0x0];});};exports['googleTTS']=function(_0x385961,_0x1bac75){var _0x5cf185,_0x5c699c;return tts(_0x385961,_0x1bac75||'en',0x1)[_0xa5ba('0x33')](function(_0x531710){logger[_0xa5ba('0x25')](_0x531710);_0x5cf185=path[_0xa5ba('0x39')](__dirname,_0xa5ba('0x28'),rs[_0xa5ba('0x29')](0x4)+_0xa5ba('0x3a'));return downloadFile(_0x531710,_0x5cf185);})[_0xa5ba('0x33')](function(){_0x5c699c=path[_0xa5ba('0x39')](__dirname,_0xa5ba('0x28'),rs[_0xa5ba('0x29')](0x4)+'.wav');return convertFile(_0x5cf185,_0x5c699c);})[_0xa5ba('0x33')](function(){try{fs[_0xa5ba('0x1a')](_0x5cf185);fs[_0xa5ba('0x38')](_0x5c699c,_0xa5ba('0x2c'));}catch(_0x111cf5){logger[_0xa5ba('0x1b')](_0x111cf5);}logger[_0xa5ba('0x25')](_0xa5ba('0x3b'),_0x5c699c[_0xa5ba('0x2d')]('.')[0x0]);return _0x5c699c[_0xa5ba('0x2d')]('.')[0x0];});};exports['googleASR']=function(_0x23e6fe,_0x3fbf1d,_0x4e59a8){return google[_0xa5ba('0x3c')](_0x23e6fe,_0x3fbf1d,_0x4e59a8)[_0xa5ba('0x33')](function(_0x371cb1){logger[_0xa5ba('0x25')](_0x371cb1[_0xa5ba('0x3d')]);return rp(_0x371cb1);})[_0xa5ba('0x33')](function(_0x487ff7){var _0x518178='';var _0x4fe088=0x0;try{fs['unlink'](_0x23e6fe);}catch(_0x68481a){logger[_0xa5ba('0x1b')](_0x68481a);}if(_0x487ff7&&_0x487ff7[_0xa5ba('0x3e')]){_0x518178=_0x487ff7[_0xa5ba('0x3e')][_0xa5ba('0x3f')](function(_0x274eb7){return _0x274eb7&&_0x274eb7[_0xa5ba('0x40')][0x0]&&_0x274eb7['alternatives'][0x0][_0xa5ba('0x41')]?_0x274eb7[_0xa5ba('0x40')][0x0][_0xa5ba('0x41')]:'';})[_0xa5ba('0x42')]('\x0a');_0x4fe088=_0x487ff7['results']['map'](function(_0x4f1ad2){return _0x4f1ad2&&_0x4f1ad2['alternatives'][0x0]&&_0x4f1ad2[_0xa5ba('0x40')][0x0][_0xa5ba('0x43')]?_0x4f1ad2[_0xa5ba('0x40')][0x0][_0xa5ba('0x43')]:0x0;})['join']('\x0a');}logger['info'](_0xa5ba('0x44'),_0x518178);logger['info'](_0xa5ba('0x45'),_0x4fe088);return{'transcript':_0x518178,'confidence':_0x4fe088};})[_0xa5ba('0x46')](function(_0x20a6d0){logger[_0xa5ba('0x1b')](_0xa5ba('0x47'),_0x20a6d0[_0xa5ba('0x13')],_0x20a6d0[_0xa5ba('0x48')],_0x20a6d0['message']);});};exports[_0xa5ba('0x49')]=function(_0x5b4ea0,_0x1728e9,_0x22dc40,_0xeb00f0){var _0x48dac5=apiai(_0x1728e9,{'language':_0xeb00f0||'en'});return _0x48dac5[_0xa5ba('0x4a')](_0x22dc40,{'sessionId':md5(_0x5b4ea0)})[_0xa5ba('0x33')](function(_0x5733f4){logger[_0xa5ba('0x25')](JSON[_0xa5ba('0x4b')](_0x5733f4));return{'source':_0x5733f4[_0xa5ba('0x4c')][_0xa5ba('0x4d')],'resolvedQuery':_0x5733f4[_0xa5ba('0x4c')][_0xa5ba('0x4e')],'action':_0x5733f4[_0xa5ba('0x4c')]['action'],'actionIncomplete':_0x5733f4[_0xa5ba('0x4c')][_0xa5ba('0x4f')],'speech':_0x5733f4[_0xa5ba('0x4c')][_0xa5ba('0x50')][_0xa5ba('0x51')],'score':_0x5733f4['result'][_0xa5ba('0x52')],'statusCode':_0x5733f4[_0xa5ba('0x53')][_0xa5ba('0x54')],'endConversation':_0x5733f4['result'][_0xa5ba('0x55')]['endConversation']||![],'isFallbackIntent':_0x5733f4[_0xa5ba('0x4c')][_0xa5ba('0x55')][_0xa5ba('0x56')]};});};exports['tildeASR']=function(_0x266cb3,_0x8e49ab,_0x45b82f,_0x2e060b){return tilde[_0xa5ba('0x3c')](_0x266cb3,_0x8e49ab,_0x45b82f,_0x2e060b)['then'](function(_0x4b6728){try{fs[_0xa5ba('0x1a')](_0x266cb3);}catch(_0x194a86){logger['error'](_0x194a86);}logger[_0xa5ba('0x25')](_0xa5ba('0x57'),_0x4b6728[_0xa5ba('0x41')]);logger[_0xa5ba('0x25')](_0xa5ba('0x58'),_0x4b6728[_0xa5ba('0x43')]);return _0x4b6728;});};exports[_0xa5ba('0x59')]=function(_0x5babeb,_0x8069c9,_0x335ae3,_0x1b9a70,_0x7f4eab,_0x30038d){var _0x211da9=path['resolve'](__dirname,_0xa5ba('0x28'),rs['generate'](0x4)+_0xa5ba('0x3a'));var _0x3f7a0e;return aws[_0xa5ba('0x5a')](_0x5babeb,_0x8069c9,_0x335ae3,_0x1b9a70,_0x7f4eab,_0x30038d,_0x211da9)[_0xa5ba('0x33')](function(){_0x3f7a0e=path[_0xa5ba('0x39')](__dirname,'tmp',rs[_0xa5ba('0x29')](0x4)+_0xa5ba('0x2a'));return convertFile(_0x211da9,_0x3f7a0e);})[_0xa5ba('0x33')](function(){try{fs[_0xa5ba('0x1a')](_0x211da9);fs[_0xa5ba('0x38')](_0x3f7a0e,_0xa5ba('0x2c'));}catch(_0x2333a3){logger[_0xa5ba('0x1b')](_0x2333a3);}return _0x3f7a0e['split']('.')[0x0];});};exports[_0xa5ba('0x5b')]=function(_0x1709a0,_0x400be5,_0x556a8d,_0x1212e0,_0x36a851,_0x43c2ca){return aws[_0xa5ba('0x5c')](_0x1709a0,_0x400be5,_0x556a8d,_0x1212e0,_0x36a851,_0x43c2ca)[_0xa5ba('0x33')](function(_0x5da4d4){logger[_0xa5ba('0x25')](JSON[_0xa5ba('0x4b')](_0x5da4d4));return _0x5da4d4;});};exports[_0xa5ba('0x5d')]=function(_0x55c76d,_0x358a7f,_0x65ae9b,_0xf1c3c7){var _0x4150a0=util['format'](_0xa5ba('0x5e'),ISPEECH_API,_0x55c76d,encodeURIComponent(_0x358a7f),_0x65ae9b,_0xf1c3c7);var _0x1f6dac=path[_0xa5ba('0x39')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x2180e8;return downloadFile(_0x4150a0,_0x1f6dac)['then'](function(){_0x2180e8=path[_0xa5ba('0x39')](__dirname,'tmp',rs[_0xa5ba('0x29')](0x4)+_0xa5ba('0x2a'));return convertFile(_0x1f6dac,_0x2180e8);})[_0xa5ba('0x33')](function(){try{fs[_0xa5ba('0x1a')](_0x1f6dac);fs[_0xa5ba('0x38')](_0x2180e8,'777');}catch(_0x352d6a){logger[_0xa5ba('0x1b')](_0x352d6a);}return _0x2180e8[_0xa5ba('0x2d')]('.')[0x0];});};exports[_0xa5ba('0x5f')]=function(_0x306ec4,_0x4547c8,_0x1db3ac,_0x3796ff){var _0x3457c0=util[_0xa5ba('0x60')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x4547c8,_0x1db3ac,base64Encode(_0x306ec4),_0x3796ff?util[_0xa5ba('0x60')](_0xa5ba('0x61'),encodeURIComponent(_0x3796ff)):_0xa5ba('0x62'));return uploadFile(_0x3457c0)[_0xa5ba('0x33')](function(_0x19fa8a){return querystring[_0xa5ba('0x3')](_0x19fa8a);});};exports['sestekNDA']=function(_0x45544a,_0x298942){return sestek['nda'](_0x45544a,_0x298942)['then'](function(_0x14b399){logger[_0xa5ba('0x25')](JSON[_0xa5ba('0x4b')](_0x14b399));var _0x5e28e6={'speech':_0x14b399[_0xa5ba('0x63')],'action':_0x14b399[_0xa5ba('0x64')]?_0x14b399[_0xa5ba('0x64')][_0xa5ba('0x65')]:undefined,'actiondata':_0x14b399[_0xa5ba('0x64')]?_0x14b399[_0xa5ba('0x64')]['CustomActionData']:undefined};if(_0x14b399['channelData']&&_0x14b399[_0xa5ba('0x64')][_0xa5ba('0x66')]){return base64Decode(_0x14b399[_0xa5ba('0x64')]['AudioFromTts']['Data'],path[_0xa5ba('0x39')](__dirname,'tmp',rs[_0xa5ba('0x29')](0x4)+_0xa5ba('0x2a')))[_0xa5ba('0x33')](function(_0x2bf5b1){_0x5e28e6['audiofile']=_0x2bf5b1;return _0x5e28e6;});}return _0x5e28e6;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
index ca10aad..3042b46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3caa=['./nda','exports'];(function(_0x7a93cc,_0x45615f){var _0x13a451=function(_0x497988){while(--_0x497988){_0x7a93cc['push'](_0x7a93cc['shift']());}};_0x13a451(++_0x45615f);}(_0x3caa,0x112));var _0xa3ca=function(_0x33609f,_0x571673){_0x33609f=_0x33609f-0x0;var _0x16d468=_0x3caa[_0x33609f];return _0x16d468;};var nda=require(_0xa3ca('0x0'));module[_0xa3ca('0x1')]={'nda':nda};
\ No newline at end of file
+var _0xf4f1=['exports'];(function(_0x555c5e,_0x120e1d){var _0x550669=function(_0x48d0c6){while(--_0x48d0c6){_0x555c5e['push'](_0x555c5e['shift']());}};_0x550669(++_0x120e1d);}(_0xf4f1,0x1a2));var _0x1f4f=function(_0x508a77,_0x610279){_0x508a77=_0x508a77-0x0;var _0x3d8fda=_0xf4f1[_0x508a77];return _0x3d8fda;};var nda=require('./nda');module[_0x1f4f('0x0')]={'nda':nda};
\ No newline at end of file
index f7107b7..2fd9a84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1d4=['text','Bearer\x20','access_token','project','body','channelData','ProjectName','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','request-promise','url','../../../../../config/logger','POST','ndauth_url','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1d4,0x157));var _0x4d1d=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xd1d4[_0x68ee8b];return _0x5148f7;};'use strict';var rp=require(_0x4d1d('0x0'));var url=require(_0x4d1d('0x1'));var logger=require(_0x4d1d('0x2'))('agi');module['exports']=function(_0x2bd18f,_0x3b5e9a){var _0x49110d={'method':_0x4d1d('0x3'),'uri':url['resolve'](_0x3b5e9a[_0x4d1d('0x4')],'/token'),'form':{'grant_type':'password','username':_0x3b5e9a[_0x4d1d('0x5')],'password':_0x3b5e9a['password']},'json':!![]};return rp(_0x49110d)[_0x4d1d('0x6')](function(_0x55fa74){var _0x3b9853={'method':_0x4d1d('0x3'),'uri':url[_0x4d1d('0x7')](_0x3b5e9a[_0x4d1d('0x8')],_0x4d1d('0x9')),'body':{'type':_0x3b5e9a['ndaactivity_type']||_0x4d1d('0xa'),'channelId':_0x4d1d('0xb'),'conversation':{'id':_0x2bd18f[_0x4d1d('0xc')]},'from':{'id':_0x2bd18f[_0x4d1d('0xd')],'name':_0x2bd18f[_0x4d1d('0xe')]},'recipient':{'id':_0x2bd18f[_0x4d1d('0xf')],'name':_0x2bd18f[_0x4d1d('0x10')]},'text':_0x3b5e9a[_0x4d1d('0x11')],'channelData':{}},'headers':{'Authorization':_0x4d1d('0x12')+_0x55fa74[_0x4d1d('0x13')]},'json':!![]};if(_0x3b5e9a[_0x4d1d('0x14')]){_0x3b9853[_0x4d1d('0x15')][_0x4d1d('0x16')][_0x4d1d('0x17')]=_0x3b5e9a[_0x4d1d('0x14')];}if(_0x3b5e9a['ndagenerate_audio']=='1'){_0x3b9853[_0x4d1d('0x15')][_0x4d1d('0x16')][_0x4d1d('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4d1d('0x19')};}if(_0x3b5e9a['custom_action']){_0x3b9853[_0x4d1d('0x15')][_0x4d1d('0x16')][_0x4d1d('0x1a')]=_0x3b5e9a[_0x4d1d('0x1b')];if(_0x3b5e9a[_0x4d1d('0x1c')]){_0x3b9853[_0x4d1d('0x15')][_0x4d1d('0x16')][_0x4d1d('0x1d')]=_0x3b5e9a[_0x4d1d('0x1c')];}}logger['info'](JSON['stringify'](_0x3b9853));return rp(_0x3b9853);});};
\ No newline at end of file
+var _0x85af=['access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','custom_action_data','info','request-promise','agi','exports','POST','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','text','Bearer\x20'];(function(_0x426257,_0x1f0a84){var _0x1aedf3=function(_0xb44304){while(--_0xb44304){_0x426257['push'](_0x426257['shift']());}};_0x1aedf3(++_0x1f0a84);}(_0x85af,0x119));var _0xf85a=function(_0x2af2ec,_0xde4a27){_0x2af2ec=_0x2af2ec-0x0;var _0x17f012=_0x85af[_0x2af2ec];return _0x17f012;};'use strict';var rp=require(_0xf85a('0x0'));var url=require('url');var logger=require('../../../../../config/logger')(_0xf85a('0x1'));module[_0xf85a('0x2')]=function(_0xa4b22c,_0x5ef7a6){var _0xf0a6d2={'method':_0xf85a('0x3'),'uri':url['resolve'](_0x5ef7a6['ndauth_url'],'/token'),'form':{'grant_type':'password','username':_0x5ef7a6['username'],'password':_0x5ef7a6['password']},'json':!![]};return rp(_0xf0a6d2)['then'](function(_0x1dc0c0){var _0x416f29={'method':_0xf85a('0x3'),'uri':url[_0xf85a('0x4')](_0x5ef7a6[_0xf85a('0x5')],_0xf85a('0x6')),'body':{'type':_0x5ef7a6[_0xf85a('0x7')]||_0xf85a('0x8'),'channelId':_0xf85a('0x9'),'conversation':{'id':_0xa4b22c['uniqueid']},'from':{'id':_0xa4b22c[_0xf85a('0xa')],'name':_0xa4b22c[_0xf85a('0xb')]},'recipient':{'id':_0xa4b22c[_0xf85a('0xc')],'name':_0xa4b22c[_0xf85a('0xd')]},'text':_0x5ef7a6[_0xf85a('0xe')],'channelData':{}},'headers':{'Authorization':_0xf85a('0xf')+_0x1dc0c0[_0xf85a('0x10')]},'json':!![]};if(_0x5ef7a6[_0xf85a('0x11')]){_0x416f29[_0xf85a('0x12')][_0xf85a('0x13')][_0xf85a('0x14')]=_0x5ef7a6[_0xf85a('0x11')];}if(_0x5ef7a6[_0xf85a('0x15')]=='1'){_0x416f29[_0xf85a('0x12')]['channelData'][_0xf85a('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf85a('0x17')};}if(_0x5ef7a6[_0xf85a('0x18')]){_0x416f29['body'][_0xf85a('0x13')]['CustomAction']=_0x5ef7a6[_0xf85a('0x18')];if(_0x5ef7a6[_0xf85a('0x19')]){_0x416f29['body'][_0xf85a('0x13')]['CustomActionData']=_0x5ef7a6[_0xf85a('0x19')];}}logger[_0xf85a('0x1a')](JSON['stringify'](_0x416f29));return rp(_0x416f29);});};
\ No newline at end of file
index e0aad3e..d9a76ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cd7=['exports','./lib/api'];(function(_0x4d83fc,_0x3b415d){var _0x584078=function(_0x54c82f){while(--_0x54c82f){_0x4d83fc['push'](_0x4d83fc['shift']());}};_0x584078(++_0x3b415d);}(_0x6cd7,0xdb));var _0x76cd=function(_0x273f92,_0x5e6ea2){_0x273f92=_0x273f92-0x0;var _0x38b53c=_0x6cd7[_0x273f92];return _0x38b53c;};'use strict';var asr=require(_0x76cd('0x0'));module[_0x76cd('0x1')]=function(_0x303242,_0x47d113,_0x2102f1,_0x47a396){return asr(_0x303242,_0x47d113,_0x2102f1,_0x47a396);};
\ No newline at end of file
+var _0xbb68=['./lib/api','exports'];(function(_0x204ed4,_0x150b9b){var _0x1df2a2=function(_0x2a8f6a){while(--_0x2a8f6a){_0x204ed4['push'](_0x204ed4['shift']());}};_0x1df2a2(++_0x150b9b);}(_0xbb68,0x1e4));var _0x8bb6=function(_0x2c52c0,_0x1661e7){_0x2c52c0=_0x2c52c0-0x0;var _0x495c10=_0xbb68[_0x2c52c0];return _0x495c10;};'use strict';var asr=require(_0x8bb6('0x0'));module[_0x8bb6('0x1')]=function(_0x4955ae,_0xbb0bb1,_0x13645b,_0x224a87){return asr(_0x4955ae,_0xbb0bb1,_0x13645b,_0x224a87);};
\ No newline at end of file
index 541d2e7..1a52839 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0370=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','createReadStream','data','send','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','stringify','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE'];(function(_0x5b2dd5,_0x12d45e){var _0xf79a8b=function(_0x2e13b7){while(--_0x2e13b7){_0x5b2dd5['push'](_0x5b2dd5['shift']());}};_0xf79a8b(++_0x12d45e);}(_0x0370,0x147));var _0x0037=function(_0x120c25,_0x42d8c2){_0x120c25=_0x120c25-0x0;var _0x162120=_0x0370[_0x120c25];return _0x162120;};'use strict';var BPromise=require('bluebird');var _=require(_0x0037('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x0037('0x1'));var crypto=require(_0x0037('0x2'));var logger=require(_0x0037('0x3'))(_0x0037('0x4'));module[_0x0037('0x5')]=function(_0x296f73,_0x3c7ce9,_0x3702b5,_0x1df353){return new BPromise(function(_0x4f8552,_0x12e94d){logger[_0x0037('0x6')](_0x0037('0x7'),_0x1df353||_0x0037('0x8'));var _0x22738c=new WebSocket(_0x1df353||_0x0037('0x8'),{'perMessageDeflate':![]});var _0x1f8429='';var _0x2a898e='0';var _0x1d2a5f='1';var _0x30af09=_0x0037('0x9');function _0x325f0e(_0x89de8f){var _0x11685d=crypto[_0x0037('0xa')]('sha1');_0x11685d[_0x0037('0xb')](_0x89de8f);return _0x11685d[_0x0037('0xc')](_0x0037('0xd'));}function _0x5d08a2(){try{logger['info'](_0x0037('0xe'));var _0x1d0401=moment()['unix']();var _0x379314=_0x325f0e(_0x1d0401+_0x3c7ce9+_0x3702b5);_0x22738c['send'](JSON['stringify']({'appID':_0x3c7ce9,'timestamp':_0x1d0401,'appKey':_0x379314}));var _0x2c2fae=fs[_0x0037('0xf')](_0x296f73);_0x2c2fae['on'](_0x0037('0x10'),function(_0x43421b){_0x22738c[_0x0037('0x11')](_0x43421b);});_0x2c2fae['on'](_0x0037('0x12'),function(){_0x22738c[_0x0037('0x11')](_0x0037('0x13'));});}catch(_0x1e4e6a){logger['error'](_0x0037('0x14'),JSON['stringify'](_0x1e4e6a));_0x22738c[_0x0037('0x15')]();}}function _0x3cb269(_0x5e203a){try{if(_0x5e203a){var _0x1f076d=JSON[_0x0037('0x16')](_0x5e203a);switch(_0x1f076d[_0x0037('0x17')]){case 0x0:if(_0x1f076d['result']){if(_0x1f076d[_0x0037('0x18')][_0x0037('0x19')]){logger['info'](_0x0037('0x1a'),JSON['stringify'](_0x1f076d[_0x0037('0x18')][_0x0037('0x1b')]));_0x1f8429=_0x1f076d[_0x0037('0x18')]['hypotheses'][0x0][_0x0037('0x1c')];_0x2a898e=_0x1f076d[_0x0037('0x18')][_0x0037('0x1b')][0x0]['likelihood'];_0x1d2a5f='0';_0x30af09=_0x0037('0x1d');_0x22738c[_0x0037('0x15')]();}}break;case 0x1:logger[_0x0037('0x6')](_0x0037('0x9'));_0x1d2a5f='1';_0x30af09=_0x0037('0x9');break;case 0x2:logger[_0x0037('0x6')](_0x0037('0x1e'));_0x1d2a5f='2';_0x30af09=_0x0037('0x1e');break;case 0x9:logger['info'](_0x0037('0x1f'));_0x1d2a5f='9';_0x30af09=_0x0037('0x1f');break;case 0xa:logger[_0x0037('0x6')](_0x0037('0x20'));_0x1d2a5f='10';_0x30af09=_0x0037('0x20');break;case 0xb:logger[_0x0037('0x6')](_0x0037('0x21'));_0x1d2a5f='11';_0x30af09=_0x0037('0x21');}}}catch(_0x3556f0){logger[_0x0037('0x22')](_0x0037('0x23'),JSON[_0x0037('0x24')](_0x3556f0));_0x22738c['terminate']();}}function _0x11ddef(){logger['info'](_0x0037('0x25'));_0x4f8552({'transcript':_0x1f8429,'confidence':_0x2a898e,'status':_0x1d2a5f,'status_message':_0x30af09});}function _0x41a4db(_0xa7383a){logger['error'](_0x0037('0x26'));if(!_[_0x0037('0x27')](_0xa7383a)){logger[_0x0037('0x22')](_[_0x0037('0x28')](_0xa7383a)?JSON[_0x0037('0x24')](_0xa7383a):_0xa7383a);}}_0x22738c['on']('open',_0x5d08a2);_0x22738c['on'](_0x0037('0x29'),_0x3cb269);_0x22738c['on'](_0x0037('0x12'),_0x11ddef);_0x22738c['on'](_0x0037('0x22'),_0x41a4db);});};
\ No newline at end of file
+var _0xa7ae=['data','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','terminate','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream'];(function(_0x470210,_0xc10d77){var _0x44361a=function(_0xf8155){while(--_0xf8155){_0x470210['push'](_0x470210['shift']());}};_0x44361a(++_0xc10d77);}(_0xa7ae,0xb0));var _0xea7a=function(_0x58f4de,_0x25c683){_0x58f4de=_0x58f4de-0x0;var _0xc9e1cd=_0xa7ae[_0x58f4de];return _0xc9e1cd;};'use strict';var BPromise=require(_0xea7a('0x0'));var _=require(_0xea7a('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xea7a('0x2'));var crypto=require(_0xea7a('0x3'));var logger=require(_0xea7a('0x4'))(_0xea7a('0x5'));module['exports']=function(_0x5d43e5,_0x3a4623,_0x247306,_0x519ec7){return new BPromise(function(_0xd40bf7,_0x37d367){logger[_0xea7a('0x6')]('Tilde\x20URI',_0x519ec7||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x436435=new WebSocket(_0x519ec7||_0xea7a('0x7'),{'perMessageDeflate':![]});var _0x4446af='';var _0x1b720c='0';var _0x8edaef='1';var _0x34a0f9='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x34b59f(_0x3b0929){var _0x2abcbc=crypto['createHash'](_0xea7a('0x8'));_0x2abcbc[_0xea7a('0x9')](_0x3b0929);return _0x2abcbc['digest']('hex');}function _0x4c9f7d(){try{logger[_0xea7a('0x6')](_0xea7a('0xa'));var _0x50ebda=moment()[_0xea7a('0xb')]();var _0x2a95d2=_0x34b59f(_0x50ebda+_0x3a4623+_0x247306);_0x436435['send'](JSON[_0xea7a('0xc')]({'appID':_0x3a4623,'timestamp':_0x50ebda,'appKey':_0x2a95d2}));var _0xa9e78=fs[_0xea7a('0xd')](_0x5d43e5);_0xa9e78['on'](_0xea7a('0xe'),function(_0x1c347a){_0x436435['send'](_0x1c347a);});_0xa9e78['on']('close',function(){_0x436435['send'](_0xea7a('0xf'));});}catch(_0x3864b6){logger[_0xea7a('0x10')](_0xea7a('0x11'),JSON[_0xea7a('0xc')](_0x3864b6));_0x436435['terminate']();}}function _0x5e1630(_0x38db79){try{if(_0x38db79){var _0x3b443f=JSON[_0xea7a('0x12')](_0x38db79);switch(_0x3b443f[_0xea7a('0x13')]){case 0x0:if(_0x3b443f['result']){if(_0x3b443f[_0xea7a('0x14')]['final']){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0xea7a('0xc')](_0x3b443f[_0xea7a('0x14')][_0xea7a('0x15')]));_0x4446af=_0x3b443f[_0xea7a('0x14')][_0xea7a('0x15')][0x0][_0xea7a('0x16')];_0x1b720c=_0x3b443f[_0xea7a('0x14')][_0xea7a('0x15')][0x0][_0xea7a('0x17')];_0x8edaef='0';_0x34a0f9=_0xea7a('0x18');_0x436435['terminate']();}}break;case 0x1:logger[_0xea7a('0x6')](_0xea7a('0x19'));_0x8edaef='1';_0x34a0f9='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xea7a('0x6')](_0xea7a('0x1a'));_0x8edaef='2';_0x34a0f9=_0xea7a('0x1a');break;case 0x9:logger['info'](_0xea7a('0x1b'));_0x8edaef='9';_0x34a0f9=_0xea7a('0x1b');break;case 0xa:logger['info'](_0xea7a('0x1c'));_0x8edaef='10';_0x34a0f9=_0xea7a('0x1c');break;case 0xb:logger[_0xea7a('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x8edaef='11';_0x34a0f9=_0xea7a('0x1d');}}}catch(_0x99686d){logger[_0xea7a('0x10')](_0xea7a('0x1e'),JSON[_0xea7a('0xc')](_0x99686d));_0x436435[_0xea7a('0x1f')]();}}function _0x875fb1(){logger[_0xea7a('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0xd40bf7({'transcript':_0x4446af,'confidence':_0x1b720c,'status':_0x8edaef,'status_message':_0x34a0f9});}function _0x5e1e14(_0x260f0f){logger[_0xea7a('0x10')](_0xea7a('0x20'));if(!_[_0xea7a('0x21')](_0x260f0f)){logger[_0xea7a('0x10')](_[_0xea7a('0x22')](_0x260f0f)?JSON['stringify'](_0x260f0f):_0x260f0f);}}_0x436435['on'](_0xea7a('0x23'),_0x4c9f7d);_0x436435['on'](_0xea7a('0x24'),_0x5e1630);_0x436435['on'](_0xea7a('0x25'),_0x875fb1);_0x436435['on']('error',_0x5e1e14);});};
\ No newline at end of file
index 9807f30..7c45a42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd00d=['./asr'];(function(_0xabbd65,_0x546d99){var _0x1d005a=function(_0x11694e){while(--_0x11694e){_0xabbd65['push'](_0xabbd65['shift']());}};_0x1d005a(++_0x546d99);}(_0xd00d,0xec));var _0xdd00=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0xd00d[_0x597484];return _0x218e64;};var asr=require(_0xdd00('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
+var _0x3970=['./asr','exports'];(function(_0x4126b1,_0x467a88){var _0x3acefb=function(_0x10b923){while(--_0x10b923){_0x4126b1['push'](_0x4126b1['shift']());}};_0x3acefb(++_0x467a88);}(_0x3970,0x1d4));var _0x0397=function(_0x1c0f41,_0x26d95d){_0x1c0f41=_0x1c0f41-0x0;var _0x369a9f=_0x3970[_0x1c0f41];return _0x369a9f;};var asr=require(_0x0397('0x0'));module[_0x0397('0x1')]={'asr':asr};
\ No newline at end of file
index 692a8ff..dc17972 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc73=['127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','net','events','./channel'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xcc73[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require('util');var net=require(_0x3cc7('0x0'));var EventEmitter=require(_0x3cc7('0x1'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x3cc7('0x2'));var AGIServer=function(_0x571514,_0x445dce,_0x5054fb){var _0x5de4be=this,_0x571514=_0x571514||0x11dd,_0x445dce=_0x445dce||_0x3cc7('0x3'),_0x1ccad1=null,_0x10d0f9=0x0;EventEmitter['call'](_0x5de4be);function _0x416c48(){if(!_0x571514){_0x5de4be[_0x3cc7('0x4')](_0x3cc7('0x5'),new AGIError(_0x3cc7('0x6')));return![];}_0x1ccad1=net['createServer']();_0x1ccad1[_0x3cc7('0x7')](_0x571514,_0x445dce);_0x1ccad1['on'](_0x3cc7('0x8'),function(){_0x5de4be[_0x3cc7('0x4')](_0x3cc7('0x8'));});_0x1ccad1['on'](_0x3cc7('0x9'),function(_0xaa9aa1){_0x1ccad1[_0x3cc7('0xa')](function(_0x57d9de,_0x5390c7){if(_0x57d9de){_0x5de4be[_0x3cc7('0x4')]('error',new AGIError(_0x3cc7('0xb'),_0x57d9de));}else if(_0x5054fb&&_0x5054fb<0x0){_0x5de4be[_0x3cc7('0x4')](_0x3cc7('0x5'),new AGIError(_0x3cc7('0xc')));_0xaa9aa1[_0x3cc7('0xd')]();}else if(_0x5054fb&&_0x5054fb>0x0&&_0x5054fb<_0x5390c7){_0x10d0f9+=0x1;_0x5de4be[_0x3cc7('0x4')](_0x3cc7('0x5'),new AGIError(_0x3cc7('0xe'),_0x10d0f9));_0xaa9aa1[_0x3cc7('0xd')]();}else{var _0xab7f06=new AGIChannel(_0xaa9aa1);_0xab7f06['on'](_0x3cc7('0xf'),function(){_0x5de4be[_0x3cc7('0x4')](_0x3cc7('0x9'),_0xab7f06);});}});});_0x1ccad1['on'](_0x3cc7('0x5'),function(_0x1e7568){_0x5de4be[_0x3cc7('0x4')](_0x3cc7('0x5'),new AGIError(_0x3cc7('0xb'),_0x1e7568[_0x3cc7('0x10')]));});_0x1ccad1['on'](_0x3cc7('0x11'),function(){_0x5de4be[_0x3cc7('0x4')](_0x3cc7('0x11'),new AGIError(_0x3cc7('0x12')));});}process[_0x3cc7('0x13')](function(){_0x416c48();});};util[_0x3cc7('0x14')](AGIServer,EventEmitter);module[_0x3cc7('0x15')]=function(_0x1545a0,_0x2483c9,_0x382727){return new AGIServer(_0x1545a0,_0x2483c9,_0x382727);};
\ No newline at end of file
+var _0x2917=['events','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2917,0x142));var _0x7291=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x2917[_0x49ca18];return _0x145d54;};'use strict';var util=require(_0x7291('0x0'));var net=require(_0x7291('0x1'));var EventEmitter=require(_0x7291('0x2'))[_0x7291('0x3')];var AGIError=require(_0x7291('0x4'));var AGIChannel=require(_0x7291('0x5'));var AGIServer=function(_0x90e67,_0x535c15,_0x5d5d51){var _0x22afb9=this,_0x90e67=_0x90e67||0x11dd,_0x535c15=_0x535c15||_0x7291('0x6'),_0x6aac19=null,_0x1ee790=0x0;EventEmitter[_0x7291('0x7')](_0x22afb9);function _0x1f0fd8(){if(!_0x90e67){_0x22afb9[_0x7291('0x8')](_0x7291('0x9'),new AGIError(_0x7291('0xa')));return![];}_0x6aac19=net[_0x7291('0xb')]();_0x6aac19[_0x7291('0xc')](_0x90e67,_0x535c15);_0x6aac19['on'](_0x7291('0xd'),function(){_0x22afb9[_0x7291('0x8')]('listening');});_0x6aac19['on'](_0x7291('0xe'),function(_0x9e681a){_0x6aac19[_0x7291('0xf')](function(_0x463e52,_0x2beb53){if(_0x463e52){_0x22afb9[_0x7291('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x463e52));}else if(_0x5d5d51&&_0x5d5d51<0x0){_0x22afb9[_0x7291('0x8')](_0x7291('0x9'),new AGIError(_0x7291('0x10')));_0x9e681a[_0x7291('0x11')]();}else if(_0x5d5d51&&_0x5d5d51>0x0&&_0x5d5d51<_0x2beb53){_0x1ee790+=0x1;_0x22afb9[_0x7291('0x8')](_0x7291('0x9'),new AGIError(_0x7291('0x12'),_0x1ee790));_0x9e681a['destroy']();}else{var _0xa667c8=new AGIChannel(_0x9e681a);_0xa667c8['on'](_0x7291('0x13'),function(){_0x22afb9[_0x7291('0x8')]('connection',_0xa667c8);});}});});_0x6aac19['on']('error',function(_0x34808c){_0x22afb9[_0x7291('0x8')](_0x7291('0x9'),new AGIError(_0x7291('0x14'),_0x34808c[_0x7291('0x15')]));});_0x6aac19['on'](_0x7291('0x16'),function(){_0x22afb9['emit'](_0x7291('0x16'),new AGIError(_0x7291('0x17')));});}process[_0x7291('0x18')](function(){_0x1f0fd8();});};util[_0x7291('0x19')](AGIServer,EventEmitter);module[_0x7291('0x1a')]=function(_0x4f6fea,_0x365e3c,_0x52d5a7){return new AGIServer(_0x4f6fea,_0x365e3c,_0x52d5a7);};
\ No newline at end of file
index 071908c..42255ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbffa=['context','extension','priority','accountcode','dnid','createSquareMessage','log','in\x20createcmcontact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','has','dialTimezone','CALLERID(dialTimezone)','getContactByPhone','RES1','timezones','minutestoadd','scheduledat\x20before','scheduledat','add','minutes','scheduledat\x20after','insertContact','utcOffset','createCmContact','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','format','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','MALE','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','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','googleASR','google_asr_language','tildeASR','appid','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceall\x20init','split','nextbracket','replaceall\x20end','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','label','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','getAndSetVariable','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','enter\x20in\x20callbackblock','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','before\x20createcmcontact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','odbc_id','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','appsecret','beep','NOBEEP','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','condition','no\x20condition\x20configured','true','false','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','%s/recordings/%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','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','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','QUEUE','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','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','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','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','join','exports','util','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','rpc','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','map','Intervals','interval','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording'];(function(_0x57b80f,_0x1c5b14){var _0x11b781=function(_0xda3c1d){while(--_0xda3c1d){_0x57b80f['push'](_0x57b80f['shift']());}};_0x11b781(++_0x1c5b14);}(_0xbffa,0x189));var _0xabff=function(_0x1d792f,_0x4cc4df){_0x1d792f=_0x1d792f-0x0;var _0x68ea73=_0xbffa[_0x1d792f];return _0x68ea73;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xabff('0x0'));var _=require('lodash');var sh=require(_0xabff('0x1'));var odbc=require('odbc')();var rs=require(_0xabff('0x2'));var moment=require(_0xabff('0x3'));var Mustache=require(_0xabff('0x4'));var rp=require(_0xabff('0x5'));var logger=require(_0xabff('0x6'))('agi');var config=require(_0xabff('0x7'));var shared=require(_0xabff('0x8'));var scripts=require(_0xabff('0x9'));var FILES_PATH=_0xabff('0xa');var recursiveMapAttributes=[_0xabff('0xb'),_0xabff('0xc')];var verticesWithRetry=[_0xabff('0xd'),_0xabff('0xe'),_0xabff('0xf')];var AGIVertices=function(_0x184a65,_0x16059e,_0x555e6c){this[_0xabff('0x10')]=_0x184a65;this['rpc']=_0x16059e;this[_0xabff('0x11')]=_0x555e6c;};AGIVertices[_0xabff('0x12')][_0xabff('0x13')]=function(_0x1e738c,_0x46856c){this['rpc']['getVariableById'](_0x1e738c)[_0xabff('0x14')](function(_0x1abc40){_0x46856c(null,_0x1abc40?_0x1abc40[_0xabff('0x15')]:![]);})[_0xabff('0x16')](function(_0x1d72ed){_0x46856c(_0x1d72ed);});};AGIVertices['prototype'][_0xabff('0x17')]=function(_0x5b54cc,_0x2a4d99){this[_0xabff('0x18')][_0xabff('0x19')](_0x5b54cc)[_0xabff('0x14')](function(_0x216612){_0x2a4d99(null,_0x216612?_0x216612[_0xabff('0x15')]:![]);})[_0xabff('0x16')](function(_0x25ebf6){_0x2a4d99(_0x25ebf6);});};AGIVertices[_0xabff('0x12')][_0xabff('0x1a')]=function(_0x9e1ba0,_0x5b9ae0){this[_0xabff('0x18')][_0xabff('0x1b')](_0x9e1ba0)[_0xabff('0x14')](function(_0x5e4174){_0x5b9ae0(null,_0x5e4174?_0x5e4174[_0xabff('0x15')]:![]);})[_0xabff('0x16')](function(_0x1d6ed1){_0x5b9ae0(_0x1d6ed1);});};AGIVertices['prototype'][_0xabff('0x1c')]=function(_0x440701,_0x448abe){this[_0xabff('0x18')][_0xabff('0x1d')](_0x440701)[_0xabff('0x14')](function(_0x7327be){_0x448abe(null,_0x7327be?_0x7327be[_0xabff('0x1e')]:![]);})[_0xabff('0x16')](function(_0x38e424){_0x448abe(_0x38e424);});};AGIVertices[_0xabff('0x12')][_0xabff('0x1f')]=function(_0xe0ca37,_0x40f60c){this['rpc'][_0xabff('0x20')](_0xe0ca37)[_0xabff('0x14')](function(_0x263078){_0x40f60c(null,_0x263078?_0x263078[_0xabff('0x15')]:![]);})['catch'](function(_0x1e2f5a){_0x40f60c(_0x1e2f5a);});};AGIVertices[_0xabff('0x12')]['getTrunk']=function(_0x1bd29e,_0x584ad2){this[_0xabff('0x18')][_0xabff('0x21')](_0x1bd29e)['then'](function(_0x3b5332){_0x584ad2(null,_0x3b5332?_0x3b5332[_0xabff('0x15')]:![]);})['catch'](function(_0x5b409b){_0x584ad2(_0x5b409b);});};AGIVertices[_0xabff('0x12')][_0xabff('0x22')]=function(_0x9871f6,_0x536f23){var _0x5ce0cd=this;this[_0xabff('0x18')][_0xabff('0x23')](_0x9871f6)[_0xabff('0x14')](function(_0x26040f){_0x536f23(null,_0x26040f?_0x5ce0cd['getSoundPath'](_0x26040f[_0xabff('0x24')]):![]);})[_0xabff('0x16')](function(_0x5e274a){_0x536f23(_0x5e274a);});};AGIVertices['prototype'][_0xabff('0x25')]=function(_0x245e40,_0x5bb14c){this[_0xabff('0x18')][_0xabff('0x26')](_0x245e40)[_0xabff('0x14')](function(_0x2790ce){_0x5bb14c(null,_0x2790ce?_0x2790ce:![]);})[_0xabff('0x16')](function(_0x3f95b6){_0x5bb14c(_0x3f95b6);});};AGIVertices['prototype'][_0xabff('0x27')]=function(_0x2b52e5,_0x4b8898,_0x118f99){this[_0xabff('0x11')]['sendMailMessage'](_0x2b52e5,_0x4b8898)[_0xabff('0x14')](function(){_0x118f99(null);})[_0xabff('0x16')](function(_0x2f9f8d){_0x118f99(_0x2f9f8d);});};AGIVertices['prototype'][_0xabff('0x28')]=function(_0x2a7248,_0x3a0595){this[_0xabff('0x18')]['getIntervalById'](_0x2a7248)[_0xabff('0x14')](function(_0x342252){if(_0x342252){if(_0x342252[_0xabff('0x29')]){_0x3a0595(null,[_0x342252['interval']]);}else{_0x3a0595(null,_[_0xabff('0x2a')](_0x342252[_0xabff('0x2b')],_0xabff('0x2c')));}}else{_0x3a0595(null,![]);}})['catch'](function(_0x5dc38e){_0x3a0595(_0x5dc38e);});};AGIVertices[_0xabff('0x12')]['getSoundPath']=function(_0x290711){return util['format'](_0xabff('0x2d'),FILES_PATH,_0x290711);};AGIVertices['prototype'][_0xabff('0x2e')]=function(_0x4d41d6,_0x512f03,_0x47a04b){odbc[_0xabff('0x2f')](_0x4d41d6,function(_0x581159){if(_0x581159){logger[_0xabff('0x30')](_0xabff('0x31'),_0x581159);_0x47a04b(_0x581159);}else{logger['info'](_0xabff('0x32'));odbc[_0xabff('0x33')](_0x512f03,function(_0xb79bcd,_0x472504){if(_0xb79bcd){logger[_0xabff('0x34')](_0xabff('0x35'),_0x512f03);_0x47a04b(_0xb79bcd);}else{logger[_0xabff('0x34')]('Query\x20executed\x20correctly\x20%s',_0x512f03);odbc['close'](function(_0x30144f){if(_0x30144f){logger[_0xabff('0x30')](_0xabff('0x36'),_0x30144f);}_0x47a04b(null,_0x472504);});}});}});};AGIVertices[_0xabff('0x12')][_0xabff('0x37')]=function(_0x31d816,_0x45c6a7){this[_0xabff('0x18')]['getSmsAccountById'](_0x31d816)['then'](function(_0x2d1826){_0x45c6a7(null,_0x2d1826?_0x2d1826:![]);})[_0xabff('0x16')](function(_0x383b57){_0x45c6a7(_0x383b57);});};AGIVertices[_0xabff('0x12')][_0xabff('0x38')]=function(_0x5c0b42,_0x580ffd){this[_0xabff('0x18')][_0xabff('0x38')](_0x5c0b42)[_0xabff('0x14')](function(_0x5d2c84){_0x580ffd(null,_0x5d2c84);})[_0xabff('0x16')](function(_0x1bb23f){_0x580ffd(_0x1bb23f);});};AGIVertices['prototype'][_0xabff('0x39')]=function(_0x4db709,_0x2c91cc,_0x16fbac){this['rpc'][_0xabff('0x39')]({'uniqueid':this[_0xabff('0x10')][_0xabff('0x3a')],'node':_0x4db709['label'],'application':_0x4db709[_0xabff('0x3b')],'data':_0x2c91cc||null,'project_name':this['channel'][_0xabff('0x3c')],'callerid':this[_0xabff('0x10')][_0xabff('0x3d')]})[_0xabff('0x14')](function(_0x56f458){if(_0x16fbac){_0x16fbac(null,_0x56f458);}})[_0xabff('0x16')](function(_0x2be524){if(_0x16fbac){_0x16fbac(_0x2be524);}});};AGIVertices[_0xabff('0x12')][_0xabff('0x3e')]=function(_0x2b1229,_0x29f3c5,_0x345202,_0x149e30){this[_0xabff('0x18')][_0xabff('0x3e')]({'uniqueid':this[_0xabff('0x10')][_0xabff('0x3a')],'callerid':this['channel'][_0xabff('0x3d')],'calleridname':this[_0xabff('0x10')]['calleridname'],'context':this['channel'][_0xabff('0x3f')],'extension':this[_0xabff('0x10')][_0xabff('0x40')],'priority':this[_0xabff('0x10')][_0xabff('0x41')],'accountcode':this[_0xabff('0x10')][_0xabff('0x42')],'dnid':this['channel'][_0xabff('0x43')],'projectName':this[_0xabff('0x10')]['arg_1'],'saveName':_0x29f3c5,'filename':_0x2b1229['file']||_0x29f3c5,'savePath':_0x345202})['then'](function(_0x218fb5){_0x149e30(null,_0x218fb5);})[_0xabff('0x16')](function(_0x14f3bd){_0x149e30(_0x14f3bd);});};AGIVertices[_0xabff('0x12')][_0xabff('0x44')]=function(_0x535aeb,_0x12d357,_0x26cba1){this[_0xabff('0x18')]['createSquareMessage']({'uniqueid':this[_0xabff('0x10')][_0xabff('0x3a')],'body':_0x535aeb,'direction':_0x12d357})['then'](function(_0x19be98){if(_0x26cba1){_0x26cba1(null,_0x19be98);}})[_0xabff('0x16')](function(_0x41729f){if(_0x26cba1){_0x26cba1(_0x41729f);}});};AGIVertices[_0xabff('0x12')]['createCmContact']=function(_0x286755,_0xc5ab8){console[_0xabff('0x45')](_0xabff('0x46'),_0x286755);console[_0xabff('0x45')]('in\x20createcmcontact\x20callback',_0xc5ab8);var _0xcf330f=this;var _0x2552da=0x0;var _0x176bd7={'firstName':_[_0xabff('0x47')](_0x286755[_0xabff('0x15')])||_[_0xabff('0x48')](_0x286755['name'])?_0xabff('0x49')+Math[_0xabff('0x4a')]():_0x286755[_0xabff('0x15')],'lastName':_['isEmpty'](_0x286755[_0xabff('0x4b')])||_[_0xabff('0x48')](_0x286755['lastName'])?null:_0x286755[_0xabff('0x4b')],'phone':_0x286755[_0xabff('0x4c')],'ListId':_0x286755[_0xabff('0x4d')],'scheduledat':_0x286755[_0xabff('0x4e')],'callbackUniqueid':this['channel'][_0xabff('0x3a')],'tags':_0xabff('0x4f'),'description':_0xabff('0x50')+_0x286755['scheduledAt'][_0xabff('0x51')](),'priority':_0x286755[_0xabff('0x52')]};if(_[_0xabff('0x53')](_0x286755,_0xabff('0x54'))){if(!_[_0xabff('0x48')](_0x286755['dialTimezone'])){var _0x528ad6=_0x286755[_0xabff('0x54')];console[_0xabff('0x45')]('VALUE\x20TZ',_0x528ad6);if(_0x286755['dialTimezone']==_0xabff('0x55')){this['rpc'][_0xabff('0x56')]({'phone':_0x286755[_0xabff('0x4c')]})[_0xabff('0x14')](function(_0x3a02d6){console[_0xabff('0x45')](_0xabff('0x57'),_0x3a02d6);if(!_['isNil'](_0x3a02d6)){var _0x51622d=_0x3a02d6[_0xabff('0x54')];console[_0xabff('0x45')]('dialtimezone',_0x51622d);if(!_[_0xabff('0x48')](_0x51622d)){var _0x506687=shared[_0xabff('0x58')][_0x51622d];console['log']('tz',_0x506687);if(!_['isNil'](_0x506687)){var _0x2c3fdd=-0x1*_0x506687['utcOffset'];console['log'](_0xabff('0x59'),_0x2c3fdd);console[_0xabff('0x45')](_0xabff('0x5a'),_0x176bd7['scheduledat']);_0x176bd7[_0xabff('0x5b')]=moment(_0x286755[_0xabff('0x5b')])[_0xabff('0x5c')](_0x2c3fdd,_0xabff('0x5d'));console[_0xabff('0x45')](_0xabff('0x5e'),_0x176bd7[_0xabff('0x5b')]);_0xcf330f[_0xabff('0x5f')](_0x176bd7,_0x286755,_0xc5ab8);}else{_0xcf330f[_0xabff('0x5f')](_0x176bd7,_0x286755,_0xc5ab8);}}else{_0xcf330f['insertContact'](_0x176bd7,_0x286755,_0xc5ab8);}}else{_0xcf330f[_0xabff('0x5f')](_0x176bd7,_0x286755,_0xc5ab8);}});}else{var _0x2552da=shared['timezones'][_0x528ad6];if(!_[_0xabff('0x48')](_0x2552da)){var _0x35f838=-0x1*_0x2552da[_0xabff('0x60')];_0x176bd7[_0xabff('0x5b')]=moment(_0x286755[_0xabff('0x5b')])['add'](_0x35f838,'minutes');_0xcf330f[_0xabff('0x5f')](_0x176bd7,_0x286755,_0xc5ab8);}else{_0xcf330f[_0xabff('0x5f')](_0x176bd7,_0x286755,_0xc5ab8);}}}else{_0xcf330f[_0xabff('0x5f')](_0x176bd7,_0x286755,_0xc5ab8);}}else{_0xcf330f['insertContact'](_0x176bd7,_0x286755,_0xc5ab8);}};AGIVertices[_0xabff('0x12')][_0xabff('0x5f')]=function(_0x26c832,_0x314fba,_0x2c8af5){this[_0xabff('0x18')][_0xabff('0x61')](_0x26c832)['then'](function(_0x50b9a3){_0x2c8af5(null,_0x50b9a3);})[_0xabff('0x16')](function(_0x2a9fb3){_0x2c8af5(_0x2a9fb3);});};AGIVertices[_0xabff('0x12')][_0xabff('0x62')]=function(_0x39914e,_0x451822){this[_0xabff('0x18')][_0xabff('0x63')](_0x39914e)[_0xabff('0x14')](function(_0x3856d8){_0x451822(null,_0x3856d8?_0x3856d8[_0xabff('0x15')]:![]);})[_0xabff('0x16')](function(_0x3a8858){_0x451822(_0x3a8858);});};AGIVertices[_0xabff('0x12')][_0xabff('0x64')]=function(_0x17ae44,_0x20c858,_0x4f4bd2){var _0x35de6d={'role':_0xabff('0x65')};_0x35de6d[_0x17ae44]=this[_0xabff('0x10')][_0xabff('0x3d')];this['rpc'][_0xabff('0x64')](_0x35de6d,_0x20c858,this[_0xabff('0x10')][_0xabff('0x3a')])[_0xabff('0x14')](function(_0x31e3de){_0x4f4bd2(null,_[_0xabff('0x48')](_0x31e3de)?![]:!![]);})['catch'](function(_0x5e1870){logger['error'](_0x5e1870);_0x4f4bd2(null,![]);});};AGIVertices[_0xabff('0x12')][_0xabff('0x66')]=function(_0x5d8e6d,_0x4bb4b2){var _0x1db830={'role':'agent'};_0x1db830[_0x5d8e6d]=this[_0xabff('0x10')][_0xabff('0x3d')];this[_0xabff('0x18')][_0xabff('0x66')](_0x1db830)['then'](function(_0x4fae68){_0x4bb4b2(null,_[_0xabff('0x48')](_0x4fae68)?![]:!![]);})[_0xabff('0x16')](function(_0x3811aa){logger[_0xabff('0x30')](_0x3811aa);_0x4bb4b2(null,![]);});};AGIVertices[_0xabff('0x12')][_0xabff('0x67')]=function(_0x219061,_0x5ba0cd){var _0x38fbe4={'role':'agent'};_0x38fbe4[_0x219061]=this['channel']['callerid'];this[_0xabff('0x18')][_0xabff('0x67')](_0x38fbe4)[_0xabff('0x14')](function(_0x4b826d){_0x5ba0cd(null,_[_0xabff('0x48')](_0x4b826d)?![]:!![]);})[_0xabff('0x16')](function(_0x2b1d91){logger[_0xabff('0x30')](_0x2b1d91);_0x5ba0cd(null,![]);});};AGIVertices[_0xabff('0x12')]['agentLogin']=function(_0x34d19e,_0x337d1f){var _0x1c219a={'role':_0xabff('0x65')};_0x1c219a[_0x34d19e]=this[_0xabff('0x10')][_0xabff('0x3d')];var _0x2bc72e=_0x34d19e!=_0xabff('0x68')?util[_0xabff('0x69')]('%s/%s@from-sip/n',_0xabff('0x6a'),this[_0xabff('0x10')]['callerid']):undefined;this[_0xabff('0x18')][_0xabff('0x6b')](_0x1c219a,_0x2bc72e)[_0xabff('0x14')](function(_0x5338b3){_0x337d1f(null,_['isNil'](_0x5338b3)?![]:!![]);})['catch'](function(_0x4a85b0){logger['error'](_0x4a85b0);_0x337d1f(null,![]);});};AGIVertices['prototype'][_0xabff('0x6c')]=function(_0x563d78,_0x2c9051){sh[_0xabff('0x6d')](_[_0xabff('0x6e')](_0x563d78),function(_0x2ee8c1,_0x2edf1e){var _0x3d6787=_0x2edf1e[_0xabff('0x6f')](/(\r\n|\n|\r)/gm,'');_0x2c9051(null,_0x3d6787);});};AGIVertices[_0xabff('0x12')][_0xabff('0x70')]=function(_0x50dc1c,_0x9cfc5b){scripts[_0xabff('0x70')](_0x50dc1c[_0xabff('0x71')],_0x50dc1c['google_cloud_tts_text_type']||_0xabff('0x72'),_0x50dc1c[_0xabff('0x72')],_0x50dc1c[_0xabff('0x73')]||'en-US',_0x50dc1c['ssmlGender']||_0xabff('0x74'),_0x50dc1c['audioEncoding']||'MP3')[_0xabff('0x14')](function(_0x4639f0){_0x9cfc5b(null,_0x4639f0);})[_0xabff('0x16')](function(_0xe25737){_0x9cfc5b(_0xe25737);});};AGIVertices[_0xabff('0x12')][_0xabff('0x75')]=function(_0x435331,_0x3c772a){scripts[_0xabff('0x75')](_0x435331['text'],_0x435331[_0xabff('0x76')]||'en',0x1)[_0xabff('0x14')](function(_0x739fbc){_0x3c772a(null,_0x739fbc);})[_0xabff('0x16')](function(_0x30f654){_0x3c772a(_0x30f654);});};AGIVertices[_0xabff('0x12')][_0xabff('0x77')]=function(_0x2f5966,_0x56cd66){var _0x424b8e={'uri':_0x2f5966[_0xabff('0x78')],'method':_0x2f5966[_0xabff('0x79')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2f5966[_0xabff('0x7a')])===_0xabff('0x7b')&&parseInt(_0x2f5966['timeout'])>=0x1?parseInt(_0x2f5966[_0xabff('0x7a')])*0x3e8:0x5*0x3e8};if(_[_0xabff('0x7c')]([_0xabff('0x7d'),'PUT'],_0x424b8e[_0xabff('0x79')][_0xabff('0x7e')]())){try{_0x424b8e[_0xabff('0x7f')]=_0x2f5966[_0xabff('0xc')]?JSON[_0xabff('0x80')](_0x2f5966[_0xabff('0xc')]):{};}catch(_0x3bdbde){logger[_0xabff('0x30')](_0xabff('0x81'),_0x3bdbde);}}try{_0x424b8e[_0xabff('0x82')]=_0x2f5966[_0xabff('0xb')]?JSON[_0xabff('0x80')](_0x2f5966['rawHeaders']):{};}catch(_0x136116){logger[_0xabff('0x30')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x136116);}if(_0x2f5966[_0xabff('0x83')]){try{var _0x2d84d1=require(_0x2f5966[_0xabff('0x83')])[_0xabff('0x84')](this,_0x424b8e);_0x424b8e[_0xabff('0x85')]=Mustache[_0xabff('0x86')](_0x2f5966[_0xabff('0x78')],_0x2d84d1,{},['$$','$$']);if(_0x424b8e['headers']){_0x424b8e[_0xabff('0x82')]=JSON[_0xabff('0x80')](Mustache[_0xabff('0x86')](JSON[_0xabff('0x87')](_0x424b8e[_0xabff('0x82')]),_0x2d84d1,{},['$$','$$']));}if(_0x424b8e[_0xabff('0x7f')]){_0x424b8e['body']=JSON[_0xabff('0x80')](Mustache[_0xabff('0x86')](JSON[_0xabff('0x87')](_0x424b8e[_0xabff('0x7f')]),_0x2d84d1,{},['$$','$$']));}}catch(_0x5c698a){logger['error'](_0xabff('0x88'),_0x5c698a);}}rp(_0x424b8e)[_0xabff('0x14')](function(_0x37ea46){var _0x1db997={'statusCode':_0x37ea46[_0xabff('0x89')]||0xc8,'statusMessage':_0x37ea46[_0xabff('0x8a')]||'OK','headers':_0x37ea46['headers']||{},'body':_0x37ea46[_0xabff('0x7f')]||{}};_0x56cd66(null,_0x1db997);})[_0xabff('0x16')](function(_0x4948f7){var _0x280fa9={'statusCode':_0x4948f7['statusCode']||0x1f4,'statusMessage':_0x4948f7[_0xabff('0x8b')]||_0xabff('0x8c'),'headers':_0x4948f7[_0xabff('0x8d')][_0xabff('0x82')]||{},'body':_0x4948f7['options']['body']||{}};_0x56cd66(null,_0x280fa9);});};AGIVertices[_0xabff('0x12')]['googleDialogflow']=function(_0xa2f6c,_0x24e238){scripts[_0xabff('0x8e')](this[_0xabff('0x10')]['uniqueid'],_0xa2f6c[_0xabff('0x8f')],_0xa2f6c[_0xabff('0x72')],_0xa2f6c[_0xabff('0x90')]||'en')[_0xabff('0x14')](function(_0x353614){_0x24e238(null,_0x353614);})[_0xabff('0x16')](function(_0x3b7ebf){_0x24e238(_0x3b7ebf);});};AGIVertices['prototype'][_0xabff('0x91')]=function(_0xa53a6e,_0x546fdd){scripts[_0xabff('0x91')](this['channel'],_0xa53a6e)[_0xabff('0x14')](function(_0x54c089){_0x546fdd(null,_0x54c089);})[_0xabff('0x16')](function(_0x266219){_0x546fdd(_0x266219);});};AGIVertices[_0xabff('0x12')][_0xabff('0x92')]=function(_0x2c0006,_0x2dcd49){scripts[_0xabff('0x92')](_0x2c0006['key'],_0x2c0006[_0xabff('0x72')],_0x2c0006['ispeech_tts_language']||_0xabff('0x93'),_0x2c0006[_0xabff('0x94')])['then'](function(_0x4e4825){_0x2dcd49(null,_0x4e4825);})[_0xabff('0x16')](function(_0x5e6232){_0x2dcd49(_0x5e6232);});};AGIVertices[_0xabff('0x12')][_0xabff('0x95')]=function(_0x1fe464,_0x27b495,_0x95e23f){scripts[_0xabff('0x95')](_0x27b495,_0x1fe464['key'],_0x1fe464[_0xabff('0x96')]||_0xabff('0x93'),this[_0xabff('0x97')](_0x1fe464[_0xabff('0x98')])?_0x1fe464['model']:undefined)[_0xabff('0x14')](function(_0x56359e){_0x95e23f(null,_0x56359e);})[_0xabff('0x16')](function(_0xb05d3c){_0x95e23f(_0xb05d3c);});};AGIVertices[_0xabff('0x12')][_0xabff('0x99')]=function(_0x91c11,_0x52e24a){scripts[_0xabff('0x99')](_0x91c11[_0xabff('0x9a')],_0x91c11[_0xabff('0x9b')],_0x91c11[_0xabff('0x9c')],_0x91c11[_0xabff('0x9d')]||'Amy',_0x91c11[_0xabff('0x72')],_0x91c11[_0xabff('0x9e')]||_0xabff('0x72'))[_0xabff('0x14')](function(_0x17c81c){_0x52e24a(null,_0x17c81c);})[_0xabff('0x16')](function(_0x368972){_0x52e24a(_0x368972);});};AGIVertices[_0xabff('0x12')][_0xabff('0x9f')]=function(_0x120779,_0x3fb7e7){scripts[_0xabff('0x9f')](this['channel'][_0xabff('0x3a')],_0x120779[_0xabff('0x9a')],_0x120779['aws_secret_access_key'],_0x120779[_0xabff('0xa0')],_0x120779['text'],_0x120779[_0xabff('0xa1')])[_0xabff('0x14')](function(_0x4fc77b){_0x3fb7e7(null,_0x4fc77b);})['catch'](function(_0xbd4c29){_0x3fb7e7(_0xbd4c29);});};AGIVertices[_0xabff('0x12')][_0xabff('0xa2')]=function(_0x5b6a90,_0x128259,_0x3fb94c){scripts['googleASR'](_0x128259,_0x5b6a90[_0xabff('0x8f')],_0x5b6a90[_0xabff('0xa3')]||_0xabff('0x93'))[_0xabff('0x14')](function(_0x33060e){_0x3fb94c(null,_0x33060e);})[_0xabff('0x16')](function(_0x19f8b3){_0x3fb94c(_0x19f8b3);});};AGIVertices[_0xabff('0x12')][_0xabff('0xa4')]=function(_0x34d66a,_0x2e0146,_0x257383){scripts[_0xabff('0xa4')](_0x2e0146,_0x34d66a[_0xabff('0xa5')],_0x34d66a['appsecret'],_0x34d66a[_0xabff('0x85')])['then'](function(_0x31a8ce){_0x257383(null,_0x31a8ce);})[_0xabff('0x16')](function(_0x532f3c){_0x257383(_0x532f3c);});};AGIVertices[_0xabff('0x12')][_0xabff('0xa6')]=function(_0x36bb5d){var _0x28ae3e=_[_0xabff('0x7c')](verticesWithRetry,_0x36bb5d[_0xabff('0x3b')])?_0x36bb5d:_[_0xabff('0xa7')](_0x36bb5d);for(var _0x257922 in _0x28ae3e){if(_0x28ae3e[_0xabff('0xa8')](_0x257922)){if(_0x28ae3e[_0x257922]&&_[_0xabff('0xa9')](_0x28ae3e[_0x257922])){if(_['includes'](recursiveMapAttributes,_0x257922)){_0x28ae3e[_0x257922]=this[_0xabff('0xaa')](_0x28ae3e[_0x257922]);}else{_0x28ae3e[_0x257922]=this[_0xabff('0xab')](_0x28ae3e[_0x257922]);}}}}return _0x28ae3e;};AGIVertices[_0xabff('0x12')][_0xabff('0xac')]=function(_0x39f72e){for(var _0x509631 in _0x39f72e){if(_0x39f72e['hasOwnProperty'](_0x509631)){if(_[_0xabff('0xad')](_0x39f72e[_0x509631])){this['recursiveNodeIndex'](_0x39f72e[_0x509631]);}else if(_[_0xabff('0xae')](_0x39f72e[_0x509631])){for(var _0x45a40f=0x0;_0x45a40f<_0x39f72e[_0x509631][_0xabff('0xaf')];_0x45a40f++){this['recursiveNodeIndex'](_0x39f72e[_0x509631][_0x45a40f]);}}else if(_['isString'](_0x39f72e[_0x509631])){_0x39f72e[_0x509631]=this[_0xabff('0xab')](_0x39f72e[_0x509631]);}}}};AGIVertices[_0xabff('0x12')]['saveRestApiResult']=function(_0xb9ce3b,_0x526802){for(var _0x335da7 in _0xb9ce3b){if(_0xb9ce3b[_0xabff('0xa8')](_0x335da7)){if(_['isPlainObject'](_0xb9ce3b[_0x335da7])){if(!_['isEmpty'](_0xb9ce3b[_0x335da7])){this[_0xabff('0xb0')](_0xb9ce3b[_0x335da7],util[_0xabff('0x69')](_0xabff('0xb1'),_0x526802,_0x335da7));}}else if(_[_0xabff('0xae')](_0xb9ce3b[_0x335da7])){for(var _0x236510=0x0;_0x236510<_0xb9ce3b[_0x335da7][_0xabff('0xaf')];_0x236510++){this[_0xabff('0xb0')](_0xb9ce3b[_0x335da7][_0x236510],util[_0xabff('0x69')]('%s.%s',_0x526802,_0x335da7+'['+_0x236510+']'));}}else{if(!_[_0xabff('0x48')](_0xb9ce3b[_0x335da7])){this['channel'][_0xabff('0xb2')](util[_0xabff('0x69')](_0xabff('0xb1'),_0x526802,_0x335da7),_0xb9ce3b[_0x335da7]);}}}}};AGIVertices[_0xabff('0x12')][_0xabff('0xaa')]=function(_0x4fec6c){try{var _0x129f8b=JSON[_0xabff('0x80')](_0x4fec6c);this['recursiveNodeIndex'](_0x129f8b);return JSON['stringify'](_0x129f8b);}catch(_0x2b18d2){return this['replaceAllVariables'](_0x4fec6c);}};AGIVertices['prototype'][_0xabff('0xab')]=function(_0x29f09c){console[_0xabff('0x45')](_0xabff('0xb3'),_0x29f09c);var _0x2abba8=_0x29f09c[_0xabff('0xb4')]('{');for(var _0x2e2155=0x1;_0x2e2155<_0x2abba8[_0xabff('0xaf')];_0x2e2155+=0x1){var _0x4327c1=_0x2abba8[_0x2e2155]['split']('}');console[_0xabff('0x45')](_0xabff('0xb5'),_0x4327c1);if(_0x4327c1[_0xabff('0xaf')]>0x1){_0x29f09c=_0x29f09c['replaceAll']('{'+_0x4327c1[0x0]+'}',this['channel']['getVariable'](_0x4327c1[0x0])['extra']||_0x4327c1[0x0]);}}if(_0x2abba8[_0xabff('0xaf')]===0x1){return _0x29f09c['toString']();}console[_0xabff('0x45')](_0xabff('0xb6'),_0x29f09c);return this[_0xabff('0xab')](_0x29f09c);};AGIVertices[_0xabff('0x12')]['getAndSetVariable']=function(_0x18f139,_0x324a1d){var _0x200c4d=this[_0xabff('0x10')][_0xabff('0x13')](_0x18f139);if(_0x200c4d[_0xabff('0xb7')]===-0x1){return _0x200c4d;}logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0xb8'),_0x324a1d,_0x200c4d[_0xabff('0xb9')]));return this[_0xabff('0x10')]['setVariable'](_0x324a1d,_0x200c4d[_0xabff('0xb9')]);};AGIVertices['prototype'][_0xabff('0x97')]=function(_0x67065b){return _0x67065b&&_0x67065b!=='0'&&_0x67065b!=='-1'&&_0x67065b!=='';};AGIVertices['prototype'][_0xabff('0xba')]=function(_0x206e26){this['createSquareDetailsReport'][_0xabff('0x84')](this,_0x206e26,'-');_0x206e26['retry']=_0x206e26[_0xabff('0xba')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x303a9d){logger[_0xabff('0x34')](util[_0xabff('0x69')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x303a9d[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x303a9d['text'])){return this['channel']['noop'](_0xabff('0xbc'));}var _0x1318c4='\x22'+_0x303a9d[_0xabff('0x72')]+'\x22';if(this['isConfigured'](_0x303a9d[_0xabff('0x8d')])){_0x1318c4+=','+_0x303a9d[_0xabff('0x8d')];}var _0x22e439=this['channel'][_0xabff('0x6d')](_0xabff('0xbd'),_0x1318c4);if(_0x22e439[_0xabff('0xb7')]===-0x1){return _0x22e439;}return this[_0xabff('0x10')]['noop'](util[_0xabff('0x69')](_0xabff('0xbe'),_0x1318c4));};AGIVertices[_0xabff('0x12')][_0xabff('0xbf')]=function(_0x2e0874){logger[_0xabff('0x34')](util['format'](_0xabff('0xc0'),_0x2e0874[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x2e0874[_0xabff('0xc1')])){return this['channel'][_0xabff('0xc2')]('no\x20grammar\x20configured');}var _0x5d3240=_0x2e0874[_0xabff('0xc1')];if(this[_0xabff('0x97')](_0x2e0874[_0xabff('0x8d')])){_0x5d3240+=','+_0x2e0874['options'];}var _0x7e22fa=this['channel'][_0xabff('0x6d')]('MRCPRecog',_0x5d3240);if(_0x7e22fa[_0xabff('0xb7')]===-0x1){return _0x7e22fa;}var _0x129168=this[_0xabff('0xc3')]('RECOG_CONFIDENCE()',_0xabff('0xc4'));if(_0x129168[_0xabff('0xb7')]===-0x1){return _0x129168;}var _0x175f7a=this[_0xabff('0xc3')](_0xabff('0xc5'),'MRCP_RECOG_TRANSCRIPT');if(_0x175f7a[_0xabff('0xb7')]===-0x1){return _0x175f7a;}var _0x365445=this['getAndSetVariable']('RECOG_INSTANCE()',_0xabff('0xc6'));if(_0x365445['result']===-0x1){return _0x365445;}return this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0xc7'),_0x5d3240));};AGIVertices['prototype'][_0xabff('0xc8')]=function(_0x2dcc2d){logger[_0xabff('0x34')](util['format'](_0xabff('0xc9'),_0x2dcc2d[_0xabff('0xbb')]));return this[_0xabff('0x10')]['agi']([_0x2dcc2d[_0xabff('0xca')],_0x2dcc2d[_0xabff('0xcb')]]);};AGIVertices[_0xabff('0x12')][_0xabff('0xcc')]=function(_0x25c4a0){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0xcd'),_0x25c4a0['label']));if(this['isConfigured'](_0x25c4a0[_0xabff('0x7a')])){logger['info'](util[_0xabff('0x69')](_0xabff('0xce'),_0x25c4a0[_0xabff('0x7a')]));var _0x33c34f=this[_0xabff('0x10')][_0xabff('0xcf')](_0x25c4a0[_0xabff('0x7a')]);if(_0x33c34f[_0xabff('0xb7')]===-0x1){return _0x33c34f;}}return this[_0xabff('0x10')][_0xabff('0xcc')]();};AGIVertices[_0xabff('0x12')]['callback']=function(_0x39d93c){console['log'](_0xabff('0xd0'),_0x39d93c);logger['info'](util[_0xabff('0x69')](_0xabff('0xd1'),_0x39d93c[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x39d93c[_0xabff('0x4d')])){return this[_0xabff('0x10')]['error'](_0x39d93c,'no\x20list\x20selected');}_0x39d93c[_0xabff('0x4e')]=moment();if(this[_0xabff('0x97')](_0x39d93c[_0xabff('0xd2')])){_0x39d93c[_0xabff('0x4e')]=moment()[_0xabff('0x5c')](_0x39d93c['delay'],_0xabff('0x5d'));}if(!this[_0xabff('0x97')](_0x39d93c[_0xabff('0x52')])){_0x39d93c[_0xabff('0x52')]=0x2;}console['log'](_0xabff('0xd3'),_0x39d93c);this[_0xabff('0x61')]['sync'](this,_0x39d93c);return this[_0xabff('0x10')]['noop'](util[_0xabff('0x69')](_0xabff('0xd4'),_0x39d93c[_0xabff('0x4c')],_0x39d93c[_0xabff('0x4d')],_0x39d93c[_0xabff('0x4e')]));};AGIVertices[_0xabff('0x12')]['custom_app']=function(_0x12edde){logger[_0xabff('0x34')](util['format'](_0xabff('0xd5'),_0x12edde[_0xabff('0xbb')]));var _0x2e605d=this[_0xabff('0x10')][_0xabff('0x6d')](_0x12edde[_0xabff('0xd6')],_0x12edde['options']);if(_0x2e605d['result']===-0x1){return _0x2e605d;}return this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0xd7'),_0x12edde[_0xabff('0xd6')],_0x12edde[_0xabff('0x8d')]));};AGIVertices[_0xabff('0x12')][_0xabff('0xd8')]=function(_0x23194b){logger['info'](util[_0xabff('0x69')](_0xabff('0xd9'),_0x23194b[_0xabff('0xbb')]));if(!this['isConfigured'](_0x23194b[_0xabff('0x72')])){return this[_0xabff('0x10')][_0xabff('0xc2')]('no\x20text\x20configured');}var _0x5ef3c9='\x22'+_0x23194b[_0xabff('0x72')]+'\x22';if(this['isConfigured'](_0x23194b['options'])){_0x5ef3c9+=','+_0x23194b[_0xabff('0x8d')];}var _0x5c6f21=this['channel'][_0xabff('0x6d')](_0xabff('0xbd'),_0x5ef3c9);if(_0x5c6f21['result']===-0x1){return _0x5c6f21;}return this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5ef3c9));};AGIVertices[_0xabff('0x12')]['sestektts']=function(_0x4a77c8){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0xda'),_0x4a77c8[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x4a77c8['text'])){return this['channel'][_0xabff('0xc2')](_0xabff('0xbc'));}var _0x2d98a6='\x22'+_0x4a77c8[_0xabff('0x72')]+'\x22';if(this['isConfigured'](_0x4a77c8[_0xabff('0x8d')])){_0x2d98a6+=','+_0x4a77c8[_0xabff('0x8d')];}var _0x3f6d5d=this[_0xabff('0x10')]['exec'](_0xabff('0xbd'),_0x2d98a6);if(_0x3f6d5d[_0xabff('0xb7')]===-0x1){return _0x3f6d5d;}return this['channel'][_0xabff('0xc2')](util[_0xabff('0x69')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2d98a6));};AGIVertices[_0xabff('0x12')][_0xabff('0xdb')]=function(_0x5ede72){logger[_0xabff('0x34')](util['format'](_0xabff('0xdc'),_0x5ede72['label']));if(!this[_0xabff('0x97')](_0x5ede72[_0xabff('0xc1')])){return this[_0xabff('0x10')]['noop']('no\x20grammar\x20configured');}var _0x12d43d=_0x5ede72[_0xabff('0xc1')];if(this[_0xabff('0x97')](_0x5ede72['options'])){_0x12d43d+=','+_0x5ede72['options'];}var _0x339e7d=this[_0xabff('0x10')][_0xabff('0x6d')](_0xabff('0xdd'),_0x12d43d);if(_0x339e7d[_0xabff('0xb7')]===-0x1){return _0x339e7d;}var _0x31f505=this[_0xabff('0xc3')]('RECOG_CONFIDENCE()',_0xabff('0xde'));if(_0x31f505[_0xabff('0xb7')]===-0x1){return _0x31f505;}var _0x2d10a0=this[_0xabff('0xc3')](_0xabff('0xc5'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x2d10a0[_0xabff('0xb7')]===-0x1){return _0x2d10a0;}var _0x19750f=this[_0xabff('0xc3')](_0xabff('0xdf'),_0xabff('0xe0'));if(_0x19750f[_0xabff('0xb7')]===-0x1){return _0x19750f;}return this[_0xabff('0x10')]['noop'](util['format'](_0xabff('0xc7'),_0x12d43d));};AGIVertices[_0xabff('0x12')]['sestekasr']=function(_0x18ef3a){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0xe1'),_0x18ef3a[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x18ef3a[_0xabff('0xc1')])){return this[_0xabff('0x10')]['noop']('no\x20grammar\x20configured');}var _0x810670=_0x18ef3a['grammar'];if(this[_0xabff('0x97')](_0x18ef3a[_0xabff('0x8d')])){_0x810670+=','+_0x18ef3a[_0xabff('0x8d')];}var _0x3886d0=this[_0xabff('0x10')]['exec'](_0xabff('0xdd'),_0x810670);if(_0x3886d0[_0xabff('0xb7')]===-0x1){return _0x3886d0;}var _0xb99ea6=this[_0xabff('0xc3')]('RECOG_CONFIDENCE()',_0xabff('0xe2'));if(_0xb99ea6[_0xabff('0xb7')]===-0x1){return _0xb99ea6;}var _0x5c8f29=this['getAndSetVariable'](_0xabff('0xc5'),_0xabff('0xe3'));if(_0x5c8f29['result']===-0x1){return _0x5c8f29;}var _0x388578=this[_0xabff('0xc3')](_0xabff('0xdf'),'SESTEK_ASR_INSTANCE');if(_0x388578['result']===-0x1){return _0x388578;}return this['channel']['noop'](util[_0xabff('0x69')](_0xabff('0xc7'),_0x810670));};AGIVertices['prototype'][_0xabff('0xe4')]=function(_0x316a4d){logger['info'](util[_0xabff('0x69')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x316a4d[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x316a4d[_0xabff('0xe5')])){return this['channel'][_0xabff('0x30')](_0x316a4d,'no\x20database\x20selected');}var _0x3dd83a=this[_0xabff('0x1c')][_0xabff('0x84')](this,_0x316a4d[_0xabff('0xe5')]);if(!_0x3dd83a){return this[_0xabff('0x10')]['error'](_0x316a4d,'no\x20odbc\x20database\x20found');}if(!this[_0xabff('0x97')](_0x316a4d[_0xabff('0x33')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x316a4d,_0xabff('0xe6'));}var _0x52ce25=_0x316a4d['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0xe7'),_0x52ce25));var _0x2aa351=this['getQueryOdbc']['sync'](this,_0x3dd83a,_0x52ce25);this[_0xabff('0x39')][_0xabff('0x84')](this,_0x316a4d,_0x52ce25);if(!this[_0xabff('0x97')](_0x316a4d[_0xabff('0xe8')])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0xe9'));}var _0x14b71c=this[_0xabff('0x13')][_0xabff('0x84')](this,_0x316a4d[_0xabff('0xe8')]);if(!_0x14b71c){return this[_0xabff('0x10')]['error'](_0x316a4d,_0xabff('0xea'));}var _0x210fa5=this;_0x2aa351[_0xabff('0xeb')](function(_0x59bbc3,_0x560406){Object[_0xabff('0xec')](_0x59bbc3)['forEach'](function(_0x337af7){_0x210fa5[_0xabff('0x10')][_0xabff('0xb2')](util[_0xabff('0x69')]('%s[%s][%s]',_0x14b71c,_0x560406,_0x337af7),_0x59bbc3[_0x337af7]);});});this[_0xabff('0x10')][_0xabff('0xb2')](util['format'](_0xabff('0xed'),_0x14b71c),_0x2aa351[_0xabff('0xaf')]);return this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')]('variable\x20%s\x20set',_0x14b71c));};AGIVertices[_0xabff('0x12')]['dial']=function(_0x554b60){logger[_0xabff('0xee')](util[_0xabff('0x69')](_0xabff('0xef'),_0x554b60[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x554b60[_0xabff('0xf0')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x554b60,_0xabff('0xf1'));}var _0x1436f1=this[_0xabff('0x1f')][_0xabff('0x84')](this,_0x554b60[_0xabff('0xf0')]);if(!_0x1436f1){return this[_0xabff('0x10')]['error'](_0x554b60,_0xabff('0xf2'));}var _0x46b569=this[_0xabff('0x10')]['exec'](_0xabff('0xf3'),[util['format']('SIP/%s',_0x1436f1),_0x554b60[_0xabff('0x7a')],_0x554b60[_0xabff('0xf4')],_0x554b60['url']]);if(_0x46b569[_0xabff('0xb7')]===-0x1){return _0x46b569;}return this[_0xabff('0x10')]['noop'](util[_0xabff('0x69')](_0xabff('0xf5'),_0xabff('0xf3')));};AGIVertices[_0xabff('0x12')][_0xabff('0xf6')]=function(_0x5d2428){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0xf7'),_0x5d2428[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x5d2428[_0xabff('0x8f')])){return this['channel'][_0xabff('0xc2')](_0xabff('0xf8'));}if(!this[_0xabff('0x97')](_0x5d2428['text'])){return this[_0xabff('0x10')][_0xabff('0xc2')]('no\x20text\x20configured');}this[_0xabff('0x10')][_0xabff('0xf9')]=!![];this[_0xabff('0x39')](_0x5d2428);this[_0xabff('0x44')](_0x5d2428[_0xabff('0x72')],'in');this['channel'][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0xfa'),_0x5d2428[_0xabff('0x72')]));var _0x5948da=this[_0xabff('0x8e')]['sync'](this,_0x5d2428);if(_0x5948da){for(var _0x2539d0 in _0x5948da){if(_0x5948da[_0xabff('0xa8')](_0x2539d0)){this['channel'][_0xabff('0xb2')](util[_0xabff('0x69')]('DIALOGFLOW_%s',_0x2539d0[_0xabff('0x7e')]()),_0x5948da[_0x2539d0]);}}this[_0xabff('0x44')](_0x5948da[_0xabff('0xfb')],_0xabff('0xfc'));return this['channel'][_0xabff('0xc2')](util[_0xabff('0x69')]('Dialogflow\x20Result\x20%s',_0x5948da[_0xabff('0xfb')]));}return this['channel'][_0xabff('0x30')](_0x5d2428,_0xabff('0xfd'));};AGIVertices['prototype']['sesteknda']=function(_0x122129){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0xfe'),_0x122129['label']));if(!this[_0xabff('0x97')](_0x122129[_0xabff('0xff')])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0x100'));}if(!this[_0xabff('0x97')](_0x122129[_0xabff('0x101')])){return this[_0xabff('0x10')]['noop'](_0xabff('0x102'));}if(!this[_0xabff('0x97')](_0x122129[_0xabff('0x103')])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0x104'));}if(!this['isConfigured'](_0x122129[_0xabff('0x105')])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0xbc'));}this['channel'][_0xabff('0xf9')]=!![];this[_0xabff('0x39')](_0x122129);this['createSquareMessage'](_0x122129[_0xabff('0x72')],'in');this[_0xabff('0x10')]['noop'](util[_0xabff('0x69')]('Trying\x20SestekNDA:\x20%s',_0x122129['text']));var _0x1ef24e=this[_0xabff('0x91')][_0xabff('0x84')](this,_0x122129);if(_0x1ef24e){for(var _0x575551 in _0x1ef24e){if(_0x1ef24e[_0xabff('0xa8')](_0x575551)){this[_0xabff('0x10')][_0xabff('0xb2')](util[_0xabff('0x69')](_0xabff('0x106'),_0x575551[_0xabff('0x7e')]()),_0x1ef24e[_0x575551]);}}this[_0xabff('0x44')](_0x1ef24e[_0xabff('0xfb')],_0xabff('0xfc'));if(_0x1ef24e['audiofile']){this[_0xabff('0x10')]['noop'](util['format'](_0xabff('0x107'),_0x1ef24e[_0xabff('0x108')]));var _0x2ee3fd=this[_0xabff('0x10')][_0xabff('0x109')](_0x1ef24e[_0xabff('0x108')]);try{fs[_0xabff('0x10a')](_0x1ef24e['audiofile']+_0xabff('0x10b'));}catch(_0x3a60e7){logger['error'](_0x3a60e7);}return _0x2ee3fd;}else{return this[_0xabff('0x10')][_0xabff('0xc2')](util['format'](_0xabff('0x10c'),_0x1ef24e[_0xabff('0xfb')]));}}return this['channel'][_0xabff('0x30')](_0x122129,_0xabff('0x10d'));};AGIVertices['prototype'][_0xabff('0x10e')]=function(_0x3d2fba){logger[_0xabff('0x34')](util[_0xabff('0x69')]('Enter\x20in\x20END\x20(%s)\x20block',_0x3d2fba['label']));return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0x10e'));};AGIVertices[_0xabff('0x12')][_0xabff('0x10f')]=function(_0x37e1f7){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x110'),_0x37e1f7[_0xabff('0xbb')]));var _0x3cfb38='';if(_0x37e1f7['trunk_id']){if(!this[_0xabff('0x97')](_0x37e1f7[_0xabff('0x111')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x37e1f7,_0xabff('0x112'));}else{var _0x33914e=parseInt(_0x37e1f7[_0xabff('0x111')],0xa);if(isNaN(_0x33914e)){_0x3cfb38=_0x37e1f7['trunk_id'];}else{_0x3cfb38=this[_0xabff('0x113')]['sync'](this,_0x37e1f7[_0xabff('0x111')]);if(!_0x3cfb38){return this['channel']['error'](_0x37e1f7,_0xabff('0x114'));}}}}else if(_0x37e1f7['trunk_name']){_0x3cfb38=_0x37e1f7['trunk_name'];}else{return this['channel']['error'](_0x37e1f7,_0xabff('0x112'));}var _0x4da2b8=this[_0xabff('0x10')][_0xabff('0x6d')]('DIAL',[util[_0xabff('0x69')]('SIP/%s/%s',_0x3cfb38,_0x37e1f7[_0xabff('0x4c')]),_0x37e1f7[_0xabff('0x7a')],_0x37e1f7['opts'],_0x37e1f7['url']]);if(_0x4da2b8[_0xabff('0xb7')]===-0x1){return _0x4da2b8;}return this[_0xabff('0x10')][_0xabff('0xc2')](util['format']('Executed\x20command\x20%s',_0xabff('0xf3')));};AGIVertices['prototype'][_0xabff('0x115')]=function(_0x214839){logger['info'](util[_0xabff('0x69')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x214839[_0xabff('0xbb')]));return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0x115'));};AGIVertices[_0xabff('0x12')]['getdigits']=function(_0x4a8a13){logger['info'](util[_0xabff('0x69')](_0xabff('0x116'),_0x4a8a13['label']));if(_0x4a8a13[_0xabff('0x117')]===0x0){return this[_0xabff('0xba')](_0x4a8a13);}_0x4a8a13[_0xabff('0x117')]-=0x1;if(!this['isConfigured'](_0x4a8a13[_0xabff('0x118')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x4a8a13,_0xabff('0x119'));}var _0x4c2e68=this['getSound']['sync'](this,_0x4a8a13[_0xabff('0x118')]);if(!_0x4c2e68){return this[_0xabff('0x10')]['error'](_0x4a8a13,_0xabff('0x11a'));}if(!this[_0xabff('0x97')](_0x4a8a13[_0xabff('0xe8')])){return this[_0xabff('0x10')][_0xabff('0x30')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x6079fe=this[_0xabff('0x10')][_0xabff('0x11b')](_0x4c2e68,_0x4a8a13[_0xabff('0x11c')],_0x4a8a13[_0xabff('0x11d')]);var _0x4c7d26=_0x6079fe[_0xabff('0xb7')]?_0x6079fe[_0xabff('0xb7')]['toString']():'';logger[_0xabff('0x34')]('test',JSON[_0xabff('0x87')](_0x6079fe));if(_0x6079fe[_0xabff('0xb7')]===-0x1){this[_0xabff('0x39')][_0xabff('0x84')](this,_0x4a8a13,_0x4c7d26);return _0x6079fe;}else if(_0x6079fe[_0xabff('0xb9')]==='timeout'){_0x6079fe[_0xabff('0xb7')]=_0x4c7d26['length']>=parseInt(_0x4a8a13[_0xabff('0x11e')])?'x':'i';}else{_0x6079fe[_0xabff('0xb7')]=_0x4c7d26['length']>=parseInt(_0x4a8a13['mindigit'])&&_0x4c7d26['length']<=parseInt(_0x4a8a13['maxdigit'])?'x':'i';}var _0x58e9e5=this[_0xabff('0x13')][_0xabff('0x84')](this,_0x4a8a13[_0xabff('0xe8')]);if(!_0x58e9e5){return this[_0xabff('0x10')][_0xabff('0x30')](_0x4a8a13,_0xabff('0xea'));}this[_0xabff('0x10')][_0xabff('0xb2')](_0x58e9e5,_0x4c7d26);if(this[_0xabff('0x97')](_0x4a8a13[_0xabff('0x11f')])){var _0x1d39b7=parseInt(_0x4a8a13[_0xabff('0x11f')],0xa);var _0x38a95a=rs[_0xabff('0x120')]({'charset':'*','length':_0x1d39b7});var _0x58b041=_0x4c7d26[_0xabff('0xaf')];if(_0x58b041>0x0){if(_0x58b041>_0x1d39b7){this[_0xabff('0x39')][_0xabff('0x84')](this,_0x4a8a13,_0x4a8a13[_0xabff('0x121')]==='first'?_0x38a95a+_0x4c7d26[_0xabff('0x122')](_0x1d39b7):_0x4c7d26['substr'](0x0,_0x58b041-_0x1d39b7)+_0x38a95a);}else{this['createSquareDetailsReport'][_0xabff('0x84')](this,_0x4a8a13,rs[_0xabff('0x120')]({'charset':'*','length':_0x58b041}));}}else{this[_0xabff('0x39')]['sync'](this,_0x4a8a13,'');}}else{this['createSquareDetailsReport'][_0xabff('0x84')](this,_0x4a8a13,_0x4c7d26);}return _0x6079fe;};AGIVertices[_0xabff('0x12')][_0xabff('0xf')]=function(_0x371064){logger['info'](util['format'](_0xabff('0x123'),_0x371064[_0xabff('0xbb')]));return this[_0xabff('0xe')](_0x371064);};AGIVertices['prototype']['goal']=function(_0xdb7daf){logger[_0xabff('0x34')](util[_0xabff('0x69')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0xdb7daf['label']));this[_0xabff('0x39')]['sync'](this,_0xdb7daf,_0xdb7daf[_0xabff('0x124')]);return this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x125'),_0xdb7daf[_0xabff('0x124')]));};AGIVertices[_0xabff('0x12')][_0xabff('0x126')]=function(_0x2607dc){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x127'),_0x2607dc['label']));if(!this[_0xabff('0x97')](_0x2607dc[_0xabff('0x9a')])||!this[_0xabff('0x97')](_0x2607dc['aws_secret_access_key'])){return this[_0xabff('0x10')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0xabff('0x97')](_0x2607dc[_0xabff('0x72')])){return this['channel']['noop'](_0xabff('0xbc'));}this[_0xabff('0x10')][_0xabff('0xc2')](util['format'](_0xabff('0x128'),_0x2607dc['text']));var _0x49aa1e=this['awsPolly'][_0xabff('0x84')](this,_0x2607dc);if(_0x49aa1e){this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')]('aws\x20Polly\x20%s\x20file\x20created',_0x49aa1e));var _0xc117a6=this[_0xabff('0x10')][_0xabff('0x109')](_0x49aa1e);try{fs['unlink'](_0x49aa1e+_0xabff('0x10b'));}catch(_0x5aac05){logger[_0xabff('0x30')](_0x5aac05);}return _0xc117a6;}return this[_0xabff('0x10')]['error'](_0x2607dc,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xabff('0x12')][_0xabff('0x129')]=function(_0x5bf0a5){logger['info'](util[_0xabff('0x69')](_0xabff('0x12a'),_0x5bf0a5[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x5bf0a5[_0xabff('0x9a')])||!this['isConfigured'](_0x5bf0a5[_0xabff('0x9b')])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0x12b'));}if(!this[_0xabff('0x97')](_0x5bf0a5[_0xabff('0xa1')])){return this['channel'][_0xabff('0xc2')](_0xabff('0x12c'));}if(!this['isConfigured'](_0x5bf0a5['text'])){return this['channel'][_0xabff('0xc2')](_0xabff('0xbc'));}this[_0xabff('0x10')]['bot']=!![];this[_0xabff('0x39')](_0x5bf0a5);this['createSquareMessage'](_0x5bf0a5[_0xabff('0x72')],'in');this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')]('Trying\x20Amazon\x20Lex:\x20%s',_0x5bf0a5[_0xabff('0x72')]));var _0x41cea9=this[_0xabff('0x9f')][_0xabff('0x84')](this,_0x5bf0a5);if(_0x41cea9){for(var _0x251fcb in _0x41cea9){if(_0x41cea9[_0xabff('0xa8')](_0x251fcb)&&_['isString'](_0x41cea9[_0x251fcb])){this[_0xabff('0x10')][_0xabff('0xb2')](util[_0xabff('0x69')](_0xabff('0x12d'),_0x251fcb[_0xabff('0x7e')]()),_0x41cea9[_0x251fcb]);}}if(_[_0xabff('0x48')](_0x41cea9[_0xabff('0x8b')])){return this[_0xabff('0x10')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this['createSquareMessage'](_0x41cea9[_0xabff('0x8b')],_0xabff('0xfc'));return this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')]('Amazon\x20Lex\x20Result\x20%s',_0x41cea9['message']));}}return this['channel'][_0xabff('0x30')](_0x5bf0a5,_0xabff('0x12e'));};AGIVertices['prototype'][_0xabff('0x12f')]=function(_0x12ce75){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x130'),_0x12ce75[_0xabff('0xbb')],_0x12ce75[_0xabff('0x7a')]));if(!this[_0xabff('0x97')](_0x12ce75[_0xabff('0x8f')])){return this[_0xabff('0x10')][_0xabff('0xc2')]('no\x20key\x20configured');}var _0x5e7624=_0xabff('0x131');var _0x1a66bb=util[_0xabff('0x69')]('%s/recordings/%s',FILES_PATH,rs[_0xabff('0x120')](0x4));var _0xd7f67c=util[_0xabff('0x69')](_0xabff('0xb1'),_0x1a66bb,_0x5e7624);var _0x279515=!![];if(_0x12ce75['beep']==='NOBEEP'){_0x279515=![];}var _0x40407b=this[_0xabff('0x10')][_0xabff('0x132')](_0x1a66bb,_0x5e7624,_0x12ce75[_0xabff('0x133')],_0x12ce75[_0xabff('0x7a')],undefined,_0x279515);if(_0x40407b[_0xabff('0xb7')]!==-0x1){this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x134'),_0xd7f67c));var _0x1cf1c3=this['googleASR'][_0xabff('0x84')](this,_0x12ce75,_0xd7f67c);if(_0x1cf1c3){for(var _0x5bc162 in _0x1cf1c3){if(_0x1cf1c3['hasOwnProperty'](_0x5bc162)){this[_0xabff('0x10')][_0xabff('0xb2')](util[_0xabff('0x69')](_0xabff('0x135'),_0x5bc162['toUpperCase']()),_0x1cf1c3[_0x5bc162]);}}return this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x136'),JSON[_0xabff('0x87')](_0x1cf1c3)));}}return _0x40407b;};AGIVertices[_0xabff('0x12')][_0xabff('0x137')]=function(_0x5024a5){logger[_0xabff('0x34')](util[_0xabff('0x69')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x5024a5[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x5024a5[_0xabff('0xa5')])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0x138'));}if(!this[_0xabff('0x97')](_0x5024a5[_0xabff('0x139')])){return this[_0xabff('0x10')]['noop']('no\x20appsecret\x20configured');}var _0x199184=_0xabff('0x131');var _0x4173a7=util[_0xabff('0x69')]('%s/recordings/%s',FILES_PATH,rs[_0xabff('0x120')](0x4));var _0x44ad5a=util[_0xabff('0x69')](_0xabff('0xb1'),_0x4173a7,_0x199184);var _0x30181d=!![];if(_0x5024a5[_0xabff('0x13a')]===_0xabff('0x13b')){_0x30181d=![];}var _0x4289c1=this['channel'][_0xabff('0x132')](_0x4173a7,_0x199184,_0x5024a5[_0xabff('0x133')],_0x5024a5[_0xabff('0x7a')],undefined,_0x30181d);if(_0x4289c1[_0xabff('0xb7')]!==-0x1){this[_0xabff('0x10')][_0xabff('0xc2')](util['format'](_0xabff('0x13c'),_0x44ad5a));var _0x3452c3=this['tildeASR']['sync'](this,_0x5024a5,_0x44ad5a);if(_0x3452c3){for(var _0x562976 in _0x3452c3){if(_0x3452c3[_0xabff('0xa8')](_0x562976)){this[_0xabff('0x10')]['setVariable'](util[_0xabff('0x69')]('TILDE_ASR_%s',_0x562976['toUpperCase']()),_0x3452c3[_0x562976]);}}return this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x13d'),JSON[_0xabff('0x87')](_0x3452c3)));}}return _0x4289c1;};AGIVertices[_0xabff('0x12')][_0xabff('0x13e')]=function(_0xc4a447){logger[_0xabff('0x34')](util[_0xabff('0x69')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0xc4a447[_0xabff('0xbb')]));return this[_0xabff('0x10')][_0xabff('0x13f')](_0xc4a447[_0xabff('0x3f')],_0xc4a447[_0xabff('0x40')],_0xc4a447[_0xabff('0x41')]);};AGIVertices[_0xabff('0x12')][_0xabff('0x140')]=function(_0x36666a){logger[_0xabff('0x34')](util[_0xabff('0x69')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x36666a[_0xabff('0xbb')]));if(!this['isConfigured'](_0x36666a[_0xabff('0x141')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x36666a,_0xabff('0x142'));}try{var _0x6ab883=eval(_0x36666a[_0xabff('0x141')])?_0xabff('0x143'):_0xabff('0x144');this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')]('EVAL\x20CONDITION\x20%s\x20%s',_0x36666a[_0xabff('0x141')],_0x6ab883));return{'code':0xc8,'result':_0x6ab883};}catch(_0x7a1f90){return{'code':0xc8,'result':_0xabff('0x144')};}};AGIVertices[_0xabff('0x12')]['gotoiftime']=function(_0x519f86){logger[_0xabff('0x34')](util[_0xabff('0x69')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x519f86[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x519f86[_0xabff('0x145')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x519f86,_0xabff('0x146'));}var _0x2f3e9c=this[_0xabff('0x28')][_0xabff('0x84')](this,_0x519f86[_0xabff('0x145')]);if(!_0x2f3e9c){return this[_0xabff('0x10')][_0xabff('0x30')](_0x519f86,_0xabff('0x147'));}for(var _0x379f4f=0x0;_0x379f4f<_0x2f3e9c[_0xabff('0xaf')];_0x379f4f+=0x1){var _0x5426ab=this['channel'][_0xabff('0x13')](util[_0xabff('0x69')](_0xabff('0x148'),_0x2f3e9c[_0x379f4f]));if(_0x5426ab[_0xabff('0xb7')]===-0x1){return _0x5426ab;}logger['info'](util[_0xabff('0x69')]('IFTIME\x20%s\x20%s',_0x2f3e9c[_0x379f4f],_0x5426ab['extra']));if(_0x5426ab[_0xabff('0xb9')]===_0xabff('0x143')){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x149'),_0x2f3e9c[_0x379f4f],'true'));this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x149'),_0x2f3e9c[_0x379f4f],_0xabff('0x143')));return{'code':0xc8,'result':'true'};}else{logger[_0xabff('0x34')](util['format'](_0xabff('0x149'),_0x2f3e9c[_0x379f4f],_0xabff('0x144')));this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x149'),_0x2f3e9c[_0x379f4f],_0xabff('0x144')));}}return{'code':0xc8,'result':_0xabff('0x144')};};AGIVertices[_0xabff('0x12')][_0xabff('0x14a')]=function(_0x50eb68){logger['info'](util[_0xabff('0x69')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x50eb68[_0xabff('0xbb')]));return this[_0xabff('0x10')][_0xabff('0x14a')]();};AGIVertices[_0xabff('0x12')]['ispeechasr']=function(_0x449f66){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x14b'),_0x449f66['label']));if(!this[_0xabff('0x97')](_0x449f66['key'])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0xf8'));}var _0x217cec='wav';var _0x188e74=util['format'](_0xabff('0x14c'),FILES_PATH,rs[_0xabff('0x120')](0x4));var _0x43e7e0=util['format'](_0xabff('0xb1'),_0x188e74,_0x217cec);var _0x26e91b=!![];if(_0x449f66['beep']===_0xabff('0x13b')){_0x26e91b=![];}var _0x4fba59=this[_0xabff('0x10')][_0xabff('0x132')](_0x188e74,_0x217cec,_0x449f66['intKey'],_0x449f66[_0xabff('0x7a')],undefined,_0x26e91b);if(_0x4fba59[_0xabff('0xb7')]!==-0x1){this[_0xabff('0x10')][_0xabff('0xc2')](util['format']('ispeech\x20%s\x20file\x20created',_0x43e7e0));var _0x5d775f=this[_0xabff('0x95')][_0xabff('0x84')](this,_0x449f66,_0x43e7e0);if(_0x5d775f){for(var _0x51bf9f in _0x5d775f){if(_0x5d775f[_0xabff('0xa8')](_0x51bf9f)){this[_0xabff('0x10')][_0xabff('0xb2')](util['format']('ISPEECH_ASR_%s',_0x51bf9f['toUpperCase']()),_0x5d775f[_0x51bf9f]);}}return this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')]('IspeechASR\x20Result\x20%s',JSON[_0xabff('0x87')](_0x5d775f)));}}return _0x4fba59;};AGIVertices[_0xabff('0x12')]['ispeechtts']=function(_0x563707){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x14d'),_0x563707['label']));if(!this['isConfigured'](_0x563707['key'])){return this[_0xabff('0x10')]['noop'](_0xabff('0xf8'));}if(!this['isConfigured'](_0x563707['text'])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0xbc'));}this[_0xabff('0x10')][_0xabff('0xc2')](util['format'](_0xabff('0x14e'),_0x563707['text']));var _0x2e9e1b=this[_0xabff('0x92')][_0xabff('0x84')](this,_0x563707);if(_0x2e9e1b){this[_0xabff('0x10')][_0xabff('0xc2')](util['format']('ispeech\x20%s\x20file\x20created',_0x2e9e1b));var _0x329c22=this['channel'][_0xabff('0x109')](_0x2e9e1b,_0x563707[_0xabff('0x133')]);try{fs[_0xabff('0x10a')](_0x2e9e1b+_0xabff('0x10b'));}catch(_0x429893){logger['error'](_0x429893);}return _0x329c22;}return this['channel'][_0xabff('0x30')](_0x563707,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xabff('0x12')][_0xabff('0x14f')]=function(_0x52bdc2){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x150'),_0x52bdc2[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x52bdc2[_0xabff('0x151')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x52bdc2,_0xabff('0x152'));}logger['info'](util[_0xabff('0x69')](_0xabff('0x153'),this[_0xabff('0x10')][_0xabff('0x3d')],_0x52bdc2[_0xabff('0x151')]));var _0x28c131=this[_0xabff('0x6b')][_0xabff('0x84')](this,_0x52bdc2['findBy']);if(_0x28c131){logger[_0xabff('0x34')](util['format'](_0xabff('0x154'),this[_0xabff('0x10')][_0xabff('0x3d')],_0x52bdc2['findBy']));this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x154'),this[_0xabff('0x10')][_0xabff('0x3d')],_0x52bdc2['findBy']));return{'code':0xc8,'result':_0xabff('0x155')};}else{logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x156'),this['channel'][_0xabff('0x3d')],_0x52bdc2[_0xabff('0x151')]));this['channel'][_0xabff('0xc2')](util['format'](_0xabff('0x156'),this[_0xabff('0x10')]['callerid'],_0x52bdc2[_0xabff('0x151')]));return{'code':0xc8,'result':_0xabff('0x157')};}};AGIVertices['prototype']['logout']=function(_0x44eb3b){logger['info'](util[_0xabff('0x69')](_0xabff('0x158'),_0x44eb3b['label']));if(!this[_0xabff('0x97')](_0x44eb3b['findBy'])){return this['channel'][_0xabff('0x30')](_0x44eb3b,_0xabff('0x152'));}logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x153'),this['channel']['callerid'],_0x44eb3b[_0xabff('0x151')]));var _0x328b2a=this[_0xabff('0x67')][_0xabff('0x84')](this,_0x44eb3b[_0xabff('0x151')]);if(_0x328b2a){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x154'),this[_0xabff('0x10')][_0xabff('0x3d')],_0x44eb3b[_0xabff('0x151')]));this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x154'),this[_0xabff('0x10')][_0xabff('0x3d')],_0x44eb3b['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x156'),this['channel'][_0xabff('0x3d')],_0x44eb3b[_0xabff('0x151')]));this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x156'),this[_0xabff('0x10')][_0xabff('0x3d')],_0x44eb3b['findBy']));return{'code':0xc8,'result':_0xabff('0x157')};}};AGIVertices[_0xabff('0x12')][_0xabff('0x159')]=function(_0x22c8e0){logger[_0xabff('0x34')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x22c8e0[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x22c8e0[_0xabff('0x15a')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x22c8e0,'no\x20operation\x20configured');}this[_0xabff('0x10')][_0xabff('0xc2')](util['format'](_0xabff('0x15b'),_0x22c8e0['operation']));var _0x397d66=eval(_0x22c8e0[_0xabff('0x15a')]);if(!this[_0xabff('0x97')](_0x22c8e0['variable_id'])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0xe9'));}var _0x36d92c=this[_0xabff('0x13')][_0xabff('0x84')](this,_0x22c8e0[_0xabff('0xe8')]);if(!_0x36d92c){return this[_0xabff('0x10')][_0xabff('0x30')](_0x22c8e0,_0xabff('0xea'));}if(_[_0xabff('0xae')](_0x397d66)){var _0xf32446=this;_0x397d66['forEach'](function(_0x5d62b4,_0x573d30){_0xf32446[_0xabff('0x10')][_0xabff('0xb2')](util[_0xabff('0x69')](_0xabff('0x15c'),_0x36d92c,_0x573d30),_0x5d62b4);});return this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x15d'),_0x36d92c));}else{return this[_0xabff('0x10')][_0xabff('0xb2')](_0x36d92c,_0x397d66);}};AGIVertices['prototype'][_0xabff('0xd')]=function(_0x112e19){logger[_0xabff('0x34')](util[_0xabff('0x69')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x112e19[_0xabff('0xbb')]));if(_0x112e19[_0xabff('0x117')]===0x0){return this[_0xabff('0xba')](_0x112e19);}_0x112e19[_0xabff('0x117')]-=0x1;if(!this[_0xabff('0x97')](_0x112e19[_0xabff('0x118')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x112e19,'no\x20file\x20audio\x20selected');}var _0x455b85=this[_0xabff('0x22')][_0xabff('0x84')](this,_0x112e19[_0xabff('0x118')]);if(!_0x455b85){return this['channel'][_0xabff('0x30')](_0x112e19,_0xabff('0x11a'));}var _0x44407a=this[_0xabff('0x10')]['getData'](_0x455b85,_0x112e19['response'],_0x112e19['digit']);var _0x29ee62=_0x44407a[_0xabff('0xb7')];if(_0x44407a['result']===-0x1){this[_0xabff('0x39')]['sync'](this,_0x112e19,'-1');return _0x44407a;}else if(_0x44407a['extra']===_0xabff('0x7a')){_0x44407a[_0xabff('0xb7')]=_0x44407a[_0xabff('0xb7')][_0xabff('0xaf')]>0x0?_0x44407a[_0xabff('0xb7')]:'t';}else if(_[_0xabff('0x47')](_0x44407a[_0xabff('0xb7')])){_0x44407a[_0xabff('0xb7')]='#';_0x29ee62='#';}if(!this[_0xabff('0x97')](_0x112e19['variable_id'])){this[_0xabff('0x10')][_0xabff('0xc2')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x518aab=this[_0xabff('0x13')][_0xabff('0x84')](this,_0x112e19['variable_id']);if(!_0x518aab){return this[_0xabff('0x10')][_0xabff('0x30')](_0x112e19,_0xabff('0xea'));}this['channel']['setVariable'](_0x518aab,_0x29ee62);}this['createSquareDetailsReport']['sync'](this,_0x112e19,_0x29ee62);return _0x44407a;};AGIVertices[_0xabff('0x12')][_0xabff('0xc2')]=function(_0x4405ea){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x15e'),_0x4405ea['label']));return this[_0xabff('0x10')][_0xabff('0xc2')](_0x4405ea[_0xabff('0x15f')]||_0x4405ea[_0xabff('0xbb')]);};AGIVertices[_0xabff('0x12')][_0xabff('0x160')]=function(_0x3ec6da){logger[_0xabff('0x34')](util[_0xabff('0x69')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x3ec6da[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x3ec6da['findBy'])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x3ec6da,_0xabff('0x152'));}logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x153'),this['channel']['callerid'],_0x3ec6da[_0xabff('0x151')]));var _0x523ec5=this[_0xabff('0x62')][_0xabff('0x84')](this,_0x3ec6da[_0xabff('0x161')]);var _0x50ca1b=this[_0xabff('0x64')][_0xabff('0x84')](this,_0x3ec6da[_0xabff('0x151')],_0x523ec5);if(_0x50ca1b){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x154'),this[_0xabff('0x10')][_0xabff('0x3d')],_0x3ec6da[_0xabff('0x151')]));this['channel']['noop'](util[_0xabff('0x69')](_0xabff('0x154'),this['channel'][_0xabff('0x3d')],_0x3ec6da[_0xabff('0x151')]));return{'code':0xc8,'result':'success'};}else{logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x156'),this[_0xabff('0x10')][_0xabff('0x3d')],_0x3ec6da['findBy']));this[_0xabff('0x10')][_0xabff('0xc2')](util['format'](_0xabff('0x154'),this[_0xabff('0x10')][_0xabff('0x3d')],_0x3ec6da[_0xabff('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xabff('0x12')][_0xabff('0x162')]=function(_0x16b512){logger['info'](util['format'](_0xabff('0x163'),_0x16b512[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x16b512[_0xabff('0x118')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x16b512,_0xabff('0x119'));}var _0x2da914=this[_0xabff('0x22')][_0xabff('0x84')](this,_0x16b512[_0xabff('0x118')]);if(!_0x2da914){return this[_0xabff('0x10')][_0xabff('0x30')](_0x16b512,_0xabff('0x11a'));}var _0x56bbc9=this[_0xabff('0x10')][_0xabff('0x6d')](_0xabff('0x164'),[_0x2da914,_0x16b512[_0xabff('0xf4')]]);if(_0x56bbc9[_0xabff('0xb7')]===-0x1){return _0x56bbc9;}return this['channel'][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0xd7'),_0xabff('0x164'),_0x2da914));};AGIVertices[_0xabff('0x12')][_0xabff('0x165')]=function(_0x396c58){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x166'),_0x396c58[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x396c58[_0xabff('0x167')])){return this['channel']['error'](_0x396c58,_0xabff('0x168'));}var _0x232585='';var _0x3ad0d1=parseInt(_0x396c58['queue_id'],0xa);if(isNaN(_0x3ad0d1)){_0x232585=_0x396c58[_0xabff('0x167')];}else{_0x232585=this[_0xabff('0x17')][_0xabff('0x84')](this,_0x396c58[_0xabff('0x167')]);if(!_0x232585){return this[_0xabff('0x10')][_0xabff('0x30')](_0x396c58,'no\x20queue\x20found');}}var _0x102a8f='';if(this[_0xabff('0x97')](_0x396c58[_0xabff('0x118')])){var _0xfe9899=this[_0xabff('0x22')][_0xabff('0x84')](this,_0x396c58[_0xabff('0x118')]);if(_0xfe9899){_0x102a8f=_0xfe9899;}}this[_0xabff('0x39')][_0xabff('0x84')](this,_0x396c58,_0x232585);if(_0x396c58[_0xabff('0xf4')][_0xabff('0x169')]('x')<0x0){_0x396c58[_0xabff('0xf4')]+='x';}if(_0x396c58[_0xabff('0xf4')]['indexOf']('X')<0x0){_0x396c58[_0xabff('0xf4')]+='X';}this['channel'][_0xabff('0xb2')]('XMCS-QUEUE',_0x232585?_0x232585['toLowerCase']():'');var _0x13e3aa=this[_0xabff('0x10')][_0xabff('0x6d')](_0xabff('0x16a'),[_0x232585,_0x396c58['opts'],_0x396c58['url'],_0x102a8f,_0x396c58[_0xabff('0x7a')],_0x396c58[_0xabff('0xc8')],_0x396c58['macro'],_0x396c58[_0xabff('0x16b')],'',_0x396c58['position']]);if(_0x13e3aa[_0xabff('0xb7')]===-0x1){return _0x13e3aa;}return this[_0xabff('0x10')][_0xabff('0xc2')](util['format'](_0xabff('0xd7'),'QUEUE',_0x232585));};AGIVertices[_0xabff('0x12')]['record']=function(_0x424ed8){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x16c'),_0x424ed8['label']));var _0x47c5b5=_0x424ed8[_0xabff('0x16d')]||_0xabff('0x131');var _0x15fa98=util[_0xabff('0x69')](_0xabff('0x16e'),this[_0xabff('0x10')][_0xabff('0x3a')],rs[_0xabff('0x120')](0x5));var _0x12b45e=util['format'](_0xabff('0x16f'),FILES_PATH,_0x15fa98,_0x47c5b5);var _0x1c95e4=util[_0xabff('0x69')](_0xabff('0x14c'),FILES_PATH,_0x15fa98);this[_0xabff('0x3e')][_0xabff('0x84')](this,_0x424ed8,_0x15fa98,_0x12b45e);this[_0xabff('0x10')][_0xabff('0xb2')](_0xabff('0x170'),_0x15fa98);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0x1c95e4,_0x47c5b5,_0x424ed8[_0xabff('0x171')],_0x424ed8[_0xabff('0x7a')]);return this[_0xabff('0x10')][_0xabff('0x132')](_0x1c95e4,_0x47c5b5,_0x424ed8[_0xabff('0x171')],_0x424ed8['timeout'],undefined,!![]);};AGIVertices[_0xabff('0x12')][_0xabff('0x172')]=function(_0x59e5f5){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x173'),_0x59e5f5['label']));if(!this[_0xabff('0x97')](_0x59e5f5[_0xabff('0x78')])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0x174'));}var _0x21163e=this[_0xabff('0x77')][_0xabff('0x84')](this,_0x59e5f5);logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x175'),util[_0xabff('0x176')](_0x21163e,{'showHidden':![],'depth':null})));if(!this[_0xabff('0x97')](_0x59e5f5[_0xabff('0xe8')])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0x177'));}var _0x57707a=this[_0xabff('0x13')][_0xabff('0x84')](this,_0x59e5f5[_0xabff('0xe8')]);if(!_0x57707a){return this['channel'][_0xabff('0x30')](_0x59e5f5,_0xabff('0xea'));}this[_0xabff('0x10')][_0xabff('0xb2')](util[_0xabff('0x69')](_0xabff('0x178'),_0x57707a),_0x21163e[_0xabff('0x89')]?_0x21163e[_0xabff('0x89')]:_0xabff('0x179'));this[_0xabff('0x10')][_0xabff('0xb2')](util[_0xabff('0x69')](_0xabff('0x17a'),_0x57707a),_0x21163e[_0xabff('0x8a')]?_0x21163e['statusMessage']:'OK');if(_0x21163e[_0xabff('0x7f')]){try{this[_0xabff('0xb0')](_0x21163e[_0xabff('0x7f')],_0x57707a);}catch(_0x19d995){logger[_0xabff('0x30')](util[_0xabff('0x69')](_0xabff('0x17b'),_0x57707a));}}return this['channel'][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x17c'),_0x57707a));};AGIVertices[_0xabff('0x12')][_0xabff('0x17d')]=function(_0x3ff22a){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x17e'),_0x3ff22a['label']));return this[_0xabff('0x10')][_0xabff('0x17f')](_0x3ff22a[_0xabff('0x180')][_0xabff('0x6f')](/\s+/g,''),_0x3ff22a[_0xabff('0x171')]);};AGIVertices[_0xabff('0x12')][_0xabff('0x181')]=function(_0x283ced){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x182'),_0x283ced[_0xabff('0xbb')]));return this[_0xabff('0x10')][_0xabff('0x183')](_0x283ced[_0xabff('0x7b')][_0xabff('0x6f')](/\s+/g,''),_0x283ced[_0xabff('0x171')]);};AGIVertices['prototype'][_0xabff('0x184')]=function(_0x40dd67){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x185'),_0x40dd67[_0xabff('0xbb')]));return this[_0xabff('0x10')][_0xabff('0x186')](_0x40dd67[_0xabff('0x72')],_0x40dd67[_0xabff('0x171')]);};AGIVertices[_0xabff('0x12')][_0xabff('0x187')]=function(_0x80be05){logger['info'](util[_0xabff('0x69')](_0xabff('0x188'),_0x80be05[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x80be05[_0xabff('0x189')])){return this[_0xabff('0x10')]['noop'](_0xabff('0x18a'));}var _0x53b402=this['getMailAccount'][_0xabff('0x84')](this,_0x80be05[_0xabff('0x189')]);if(!_0x53b402||!_0x53b402['Smtp']){return this[_0xabff('0x10')][_0xabff('0x30')](_0x80be05,'no\x20mail\x20account\x20found');}var _0x99dcb7={'from':util[_0xabff('0x69')](_0xabff('0x18b'),_0x53b402[_0xabff('0x15')],_0x53b402[_0xabff('0x18c')]||_0x53b402[_0xabff('0x18d')][_0xabff('0x18e')]),'to':_0x80be05['to']||'','cc':_0x80be05['cc']||'','bcc':_0x80be05[_0xabff('0x18f')]||'','subject':_0x80be05[_0xabff('0x190')],'html':_0x80be05['text'],'text':_0x80be05[_0xabff('0x72')]};var _0x906bf6={'tls':{'rejectUnauthorized':![]}};if(_0x53b402[_0xabff('0x18d')][_0xabff('0x191')]){_0x906bf6[_0xabff('0x191')]=_0x53b402[_0xabff('0x18d')][_0xabff('0x191')];}else{_0x906bf6[_0xabff('0x192')]=_0x53b402['Smtp'][_0xabff('0x192')];_0x906bf6[_0xabff('0x193')]=_0x53b402[_0xabff('0x18d')][_0xabff('0x193')];_0x906bf6['secure']=_0x53b402[_0xabff('0x18d')][_0xabff('0x194')];}if(_0x53b402['Smtp'][_0xabff('0x195')]){_0x906bf6[_0xabff('0x196')]={'user':_0x53b402[_0xabff('0x18d')][_0xabff('0x18e')],'pass':_0x53b402[_0xabff('0x18d')][_0xabff('0x197')]};}if(this[_0xabff('0x97')](_0x80be05[_0xabff('0x198')])){}logger[_0xabff('0xee')](_0xabff('0x199'),JSON[_0xabff('0x87')](_0x99dcb7));this[_0xabff('0x39')][_0xabff('0x84')](this,_0x80be05,_0x80be05[_0xabff('0x189')]);this['channel']['noop'](util[_0xabff('0x69')](_0xabff('0x19a'),_0x53b402[_0xabff('0x15')]));this[_0xabff('0x27')][_0xabff('0x84')](this,_0x906bf6,_0x99dcb7);return this[_0xabff('0x10')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xabff('0x12')][_0xabff('0x19b')]=function(_0x7c72e0){logger['info'](util['format'](_0xabff('0x19c'),_0x7c72e0[_0xabff('0xbb')]));return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0x19d'));};AGIVertices['prototype'][_0xabff('0x19e')]=function(_0x17457d){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x19f'),_0x17457d[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x17457d['sms_account_id'])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0x1a0'));}var _0x5d2967=this['getSmsAccount'][_0xabff('0x84')](this,_0x17457d[_0xabff('0x1a1')]);if(!_0x5d2967){return this[_0xabff('0x10')][_0xabff('0x30')](_0x17457d,_0xabff('0x1a2'));}var _0x57fbb8={'body':_0x17457d['sms_text'],'phone':_0x17457d['to']||'','SmsAccountId':_0x5d2967['id']};logger[_0xabff('0xee')](_0xabff('0x1a3'),JSON[_0xabff('0x87')](_0x57fbb8));this['createSquareDetailsReport'][_0xabff('0x84')](this,_0x17457d,_0x17457d[_0xabff('0x1a1')]);this['channel'][_0xabff('0xc2')](util[_0xabff('0x69')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x5d2967[_0xabff('0x15')]));this[_0xabff('0x38')][_0xabff('0x84')](this,_0x57fbb8);return this[_0xabff('0x10')][_0xabff('0xc2')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xabff('0x12')][_0xabff('0x1a4')]=function(_0x10d36a){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x1a5'),_0x10d36a[_0xabff('0xbb')]));if(!this['isConfigured'](_0x10d36a[_0xabff('0xe8')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x10d36a,'no\x20variable\x20selected');}var _0x322d30=this[_0xabff('0x13')][_0xabff('0x84')](this,_0x10d36a[_0xabff('0xe8')]);if(!_0x322d30){return this[_0xabff('0x10')]['error'](_0x10d36a,_0xabff('0xea'));}return this['channel'][_0xabff('0xb2')](_0x322d30,_0x10d36a[_0xabff('0x1a6')]);};AGIVertices[_0xabff('0x12')][_0xabff('0x1a7')]=function(_0x2a7fb6){logger['info'](util[_0xabff('0x69')](_0xabff('0x1a8'),_0x2a7fb6[_0xabff('0xbb')]));this['channel'][_0xabff('0xc2')](_0xabff('0x1a9'));if(_0x2a7fb6[_0xabff('0xcc')]===_0xabff('0x1aa')){this[_0xabff('0x10')]['noop'](_0xabff('0x1ab'));return this[_0xabff('0x10')][_0xabff('0xcc')]();}return this['channel']['noop']('Skipped\x20Answer');};AGIVertices[_0xabff('0x12')]['subproject']=function(_0x13c2e9){logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x1ac'),_0x13c2e9[_0xabff('0xbb')]));if(!this['isConfigured'](_0x13c2e9[_0xabff('0x1ad')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x13c2e9,_0xabff('0x1ae'));}var _0x2aed84=this[_0xabff('0x1a')][_0xabff('0x84')](this,_0x13c2e9['project_id']);if(!this['isConfigured'](_0x2aed84)){return this['channel'][_0xabff('0x30')](_0x13c2e9,util[_0xabff('0x69')](_0xabff('0x1af'),_0x13c2e9['project_id']));}if(_0x2aed84===this[_0xabff('0x10')]['arg_1']){return this[_0xabff('0x10')][_0xabff('0x30')](_0x13c2e9,_0xabff('0x1b0'));}this[_0xabff('0x39')][_0xabff('0x84')](this,_0x13c2e9,_0x2aed84);var _0x1a5ab1=this[_0xabff('0x10')]['exec'](_0xabff('0x1b1'),util[_0xabff('0x69')](_0xabff('0x1b2'),config[_0xabff('0xc8')][_0xabff('0x192')]||_0xabff('0x1b3'),_0x2aed84,this[_0xabff('0x10')]['arg_1']));if(_0x1a5ab1['result']===-0x1){return _0x1a5ab1;}return this[_0xabff('0x10')]['noop'](util[_0xabff('0x69')](_0xabff('0xd7'),_0xabff('0x1b1'),_0x2aed84));};AGIVertices[_0xabff('0x12')][_0xabff('0x1b4')]=function(_0x48bc35){logger[_0xabff('0x34')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x48bc35['label']));var _0x4d8785=this[_0xabff('0x6c')][_0xabff('0x84')](this,_0x48bc35['command']);this['createSquareDetailsReport'][_0xabff('0x84')](this,_0x48bc35,_0x48bc35[_0xabff('0xca')]);if(this[_0xabff('0x97')](_0x48bc35['variable_id'])){var _0x2cd667=this[_0xabff('0x13')][_0xabff('0x84')](this,_0x48bc35['variable_id']);if(_0x2cd667){this['channel']['setVariable'](_0x2cd667,_0x4d8785);return this['channel'][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x1b5'),_0x48bc35['command'],_0x2cd667));}}return this['channel'][_0xabff('0xc2')](util[_0xabff('0x69')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x48bc35['command']));};AGIVertices[_0xabff('0x12')][_0xabff('0x1b6')]=function(_0x3ace67){logger['info'](util[_0xabff('0x69')](_0xabff('0x1b7'),_0x3ace67[_0xabff('0xbb')]));_0x3ace67['text']=_0x3ace67[_0xabff('0x72')][_0xabff('0x6f')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3ace67[_0xabff('0x71')])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0x1b8'));}if(!this[_0xabff('0x97')](_0x3ace67[_0xabff('0x72')])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0xbc'));}this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x1b9'),_0x3ace67['text']));var _0x39a3d1=this[_0xabff('0x70')][_0xabff('0x84')](this,_0x3ace67);if(_0x39a3d1){this[_0xabff('0x10')][_0xabff('0xc2')](util['format'](_0xabff('0x1ba'),_0x39a3d1));var _0x1ecea5=this['channel']['streamFile'](_0x39a3d1);try{fs['unlink'](_0x39a3d1+_0xabff('0x10b'));}catch(_0x1170b4){logger[_0xabff('0x30')](_0x1170b4);}return _0x1ecea5;}return this[_0xabff('0x10')][_0xabff('0x30')](_0x3ace67,_0xabff('0x1bb'));};AGIVertices[_0xabff('0x12')][_0xabff('0x1bc')]=function(_0x3d97b6){logger['info'](util[_0xabff('0x69')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x3d97b6[_0xabff('0xbb')]));_0x3d97b6[_0xabff('0x72')]=_0x3d97b6['text'][_0xabff('0x6f')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xabff('0x97')](_0x3d97b6[_0xabff('0x72')])){return this[_0xabff('0x10')][_0xabff('0xc2')](_0xabff('0xbc'));}this['channel'][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x1bd'),_0x3d97b6[_0xabff('0x72')]));var _0x47463d=this[_0xabff('0x75')]['sync'](this,_0x3d97b6);if(_0x47463d){this['channel']['noop'](util[_0xabff('0x69')]('Google\x20TTS\x20%s\x20file\x20created',_0x47463d));var _0x3b2b3e=this[_0xabff('0x10')][_0xabff('0x109')](_0x47463d);try{fs[_0xabff('0x10a')](_0x47463d+_0xabff('0x10b'));}catch(_0x136c37){logger[_0xabff('0x30')](_0x136c37);}return _0x3b2b3e;}return this[_0xabff('0x10')][_0xabff('0x30')](_0x3d97b6,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xabff('0x12')][_0xabff('0x1be')]=function(_0x10d01d){logger['info'](util[_0xabff('0x69')](_0xabff('0x1bf'),_0x10d01d[_0xabff('0xbb')]));if(!this[_0xabff('0x97')](_0x10d01d[_0xabff('0x151')])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x10d01d,'no\x20find\x20by\x20configured');}logger['info'](util[_0xabff('0x69')](_0xabff('0x153'),this[_0xabff('0x10')]['callerid'],_0x10d01d[_0xabff('0x151')]));var _0x5d6a0a=this[_0xabff('0x66')][_0xabff('0x84')](this,_0x10d01d[_0xabff('0x151')]);if(_0x5d6a0a){logger[_0xabff('0x34')](util['format'](_0xabff('0x154'),this[_0xabff('0x10')]['callerid'],_0x10d01d[_0xabff('0x151')]));this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')](_0xabff('0x154'),this[_0xabff('0x10')][_0xabff('0x3d')],_0x10d01d[_0xabff('0x151')]));return{'code':0xc8,'result':_0xabff('0x155')};}else{logger[_0xabff('0x34')](util[_0xabff('0x69')](_0xabff('0x156'),this[_0xabff('0x10')][_0xabff('0x3d')],_0x10d01d[_0xabff('0x151')]));this[_0xabff('0x10')]['noop'](util[_0xabff('0x69')](_0xabff('0x156'),this[_0xabff('0x10')][_0xabff('0x3d')],_0x10d01d[_0xabff('0x151')]));return{'code':0xc8,'result':_0xabff('0x157')};}};AGIVertices[_0xabff('0x12')][_0xabff('0x1c0')]=function(_0x1cde11){logger[_0xabff('0x34')](util[_0xabff('0x69')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x1cde11[_0xabff('0xbb')]));var _0x53aa1b=this[_0xabff('0x10')][_0xabff('0x6d')](_0xabff('0x1c1'),[_0x1cde11[_0xabff('0x1c2')],_0x1cde11[_0xabff('0x8d')]]);if(_0x53aa1b['result']===-0x1){return _0x53aa1b;}return this[_0xabff('0x10')][_0xabff('0xc2')](util[_0xabff('0x69')]('Executed\x20command\x20%s\x20%s',_0xabff('0x1c1'),_0x1cde11[_0xabff('0x1c2')]));};AGIVertices[_0xabff('0x12')]['vswitch']=function(_0x3bded2){logger['info'](util['format'](_0xabff('0x1c3'),_0x3bded2[_0xabff('0xbb')]));if(!this['isConfigured'](_0x3bded2['variable_id'])){return this[_0xabff('0x10')][_0xabff('0x30')](_0x3bded2,_0xabff('0x1c4'));}var _0x36dfe8=this['getVariable'][_0xabff('0x84')](this,_0x3bded2[_0xabff('0xe8')]);if(!_0x36dfe8){return this[_0xabff('0x10')][_0xabff('0x30')](_0x3bded2,_0xabff('0xea'));}var _0x4d55ca=this[_0xabff('0x10')][_0xabff('0x13')](_0x36dfe8);return{'code':0xc8,'result':_0x4d55ca[_0xabff('0xb9')]?_0x4d55ca['extra']:'-'};};String[_0xabff('0x12')][_0xabff('0x1c5')]=function(_0x345db5,_0x410271){return this['split'](_0x345db5)[_0xabff('0x1c6')](_0x410271);};module[_0xabff('0x1c7')]=AGIVertices;
\ No newline at end of file
+var _0x2064=['gotoiftime','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','getData','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','saydigits','sayDigits','digits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','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\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','exports','path','util','lodash','shelljs','odbc','moment','request-promise','../../config/logger','agi','../../config/environment/shared','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','getVoiceQueue','getVoiceQueueById','then','name','catch','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','priority','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','scheduledAt','callback','toString','callback_priority','has','dialTimezone','CALLERID(dialTimezone)','getContactByPhone','timezones','scheduledat','add','insertContact','utcOffset','getPauseById','agent','agentPause','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','body','statusCode','statusMessage','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','%s.%s','saveRestApiResult','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','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','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','no\x20grammar\x20configured','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','keys','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','SESTEK_NDA_%s','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','beep','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false'];(function(_0x104685,_0x3356b7){var _0x1637d0=function(_0x57c783){while(--_0x57c783){_0x104685['push'](_0x104685['shift']());}};_0x1637d0(++_0x3356b7);}(_0x2064,0x8f));var _0x4206=function(_0x30af1b,_0x4c9d2e){_0x30af1b=_0x30af1b-0x0;var _0x53b77b=_0x2064[_0x30af1b];return _0x53b77b;};'use strict';var fs=require('fs');var path=require(_0x4206('0x0'));var util=require(_0x4206('0x1'));var _=require(_0x4206('0x2'));var sh=require(_0x4206('0x3'));var odbc=require(_0x4206('0x4'))();var rs=require('randomstring');var moment=require(_0x4206('0x5'));var Mustache=require('mustache');var rp=require(_0x4206('0x6'));var logger=require(_0x4206('0x7'))(_0x4206('0x8'));var config=require('../../config/environment');var shared=require(_0x4206('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0x4206('0xa')];var verticesWithRetry=['menu',_0x4206('0xb'),_0x4206('0xc')];var AGIVertices=function(_0x4af453,_0x5c53bf,_0x14bad9){this[_0x4206('0xd')]=_0x4af453;this[_0x4206('0xe')]=_0x5c53bf;this[_0x4206('0xf')]=_0x14bad9;};AGIVertices[_0x4206('0x10')][_0x4206('0x11')]=function(_0x415935,_0x27dbaa){this['rpc'][_0x4206('0x12')](_0x415935)['then'](function(_0x29e2c3){_0x27dbaa(null,_0x29e2c3?_0x29e2c3['name']:![]);})['catch'](function(_0x23fb03){_0x27dbaa(_0x23fb03);});};AGIVertices[_0x4206('0x10')][_0x4206('0x13')]=function(_0x34196f,_0x1e63b4){this[_0x4206('0xe')][_0x4206('0x14')](_0x34196f)[_0x4206('0x15')](function(_0x294afb){_0x1e63b4(null,_0x294afb?_0x294afb[_0x4206('0x16')]:![]);})[_0x4206('0x17')](function(_0x13e004){_0x1e63b4(_0x13e004);});};AGIVertices[_0x4206('0x10')]['getSquareProject']=function(_0x9cafd6,_0x3d6c02){this['rpc'][_0x4206('0x18')](_0x9cafd6)['then'](function(_0x5b6a7b){_0x3d6c02(null,_0x5b6a7b?_0x5b6a7b['name']:![]);})[_0x4206('0x17')](function(_0x23b380){_0x3d6c02(_0x23b380);});};AGIVertices[_0x4206('0x10')][_0x4206('0x19')]=function(_0x285fab,_0xfc846e){this['rpc'][_0x4206('0x1a')](_0x285fab)[_0x4206('0x15')](function(_0x34b155){_0xfc846e(null,_0x34b155?_0x34b155[_0x4206('0x1b')]:![]);})['catch'](function(_0x2b24e2){_0xfc846e(_0x2b24e2);});};AGIVertices[_0x4206('0x10')][_0x4206('0x1c')]=function(_0x1c6a42,_0xcfb41){this[_0x4206('0xe')][_0x4206('0x1d')](_0x1c6a42)[_0x4206('0x15')](function(_0x355b2e){_0xcfb41(null,_0x355b2e?_0x355b2e[_0x4206('0x16')]:![]);})[_0x4206('0x17')](function(_0x2d802e){_0xcfb41(_0x2d802e);});};AGIVertices[_0x4206('0x10')][_0x4206('0x1e')]=function(_0x238cc4,_0x40f641){this[_0x4206('0xe')][_0x4206('0x1f')](_0x238cc4)[_0x4206('0x15')](function(_0x4d5f62){_0x40f641(null,_0x4d5f62?_0x4d5f62[_0x4206('0x16')]:![]);})[_0x4206('0x17')](function(_0x535aea){_0x40f641(_0x535aea);});};AGIVertices[_0x4206('0x10')][_0x4206('0x20')]=function(_0x17d5d0,_0x298417){var _0x482dfd=this;this[_0x4206('0xe')][_0x4206('0x21')](_0x17d5d0)[_0x4206('0x15')](function(_0x2a50ad){_0x298417(null,_0x2a50ad?_0x482dfd[_0x4206('0x22')](_0x2a50ad[_0x4206('0x23')]):![]);})['catch'](function(_0x42176b){_0x298417(_0x42176b);});};AGIVertices['prototype'][_0x4206('0x24')]=function(_0x3e82cb,_0x5baae6){this[_0x4206('0xe')][_0x4206('0x25')](_0x3e82cb)[_0x4206('0x15')](function(_0x410e23){_0x5baae6(null,_0x410e23?_0x410e23:![]);})[_0x4206('0x17')](function(_0x2c80ca){_0x5baae6(_0x2c80ca);});};AGIVertices['prototype']['sendMailMessage']=function(_0x1b16c7,_0x319032,_0x26a762){this['mailRpc'][_0x4206('0x26')](_0x1b16c7,_0x319032)[_0x4206('0x15')](function(){_0x26a762(null);})[_0x4206('0x17')](function(_0x21bac8){_0x26a762(_0x21bac8);});};AGIVertices[_0x4206('0x10')]['getIntervals']=function(_0x20823b,_0x1e2c8c){this[_0x4206('0xe')][_0x4206('0x27')](_0x20823b)[_0x4206('0x15')](function(_0x24b595){if(_0x24b595){if(_0x24b595[_0x4206('0x28')]){_0x1e2c8c(null,[_0x24b595[_0x4206('0x29')]]);}else{_0x1e2c8c(null,_[_0x4206('0x2a')](_0x24b595[_0x4206('0x2b')],'interval'));}}else{_0x1e2c8c(null,![]);}})[_0x4206('0x17')](function(_0x1933bb){_0x1e2c8c(_0x1933bb);});};AGIVertices['prototype'][_0x4206('0x22')]=function(_0x1257d3){return util[_0x4206('0x2c')](_0x4206('0x2d'),FILES_PATH,_0x1257d3);};AGIVertices[_0x4206('0x10')][_0x4206('0x2e')]=function(_0x43d3a8,_0x34ad2a,_0x3cdefe){odbc[_0x4206('0x2f')](_0x43d3a8,function(_0x58d26a){if(_0x58d26a){logger[_0x4206('0x30')](_0x4206('0x31'),_0x58d26a);_0x3cdefe(_0x58d26a);}else{logger[_0x4206('0x32')](_0x4206('0x33'));odbc[_0x4206('0x34')](_0x34ad2a,function(_0x41cb38,_0x3f1b0d){if(_0x41cb38){logger[_0x4206('0x32')]('Error\x20executing\x20query\x20%s',_0x34ad2a);_0x3cdefe(_0x41cb38);}else{logger['info'](_0x4206('0x35'),_0x34ad2a);odbc[_0x4206('0x36')](function(_0x3b70f0){if(_0x3b70f0){logger[_0x4206('0x30')](_0x4206('0x37'),_0x3b70f0);}_0x3cdefe(null,_0x3f1b0d);});}});}});};AGIVertices[_0x4206('0x10')]['getSmsAccount']=function(_0x117a77,_0xc060dc){this[_0x4206('0xe')][_0x4206('0x38')](_0x117a77)['then'](function(_0x3cbedc){_0xc060dc(null,_0x3cbedc?_0x3cbedc:![]);})[_0x4206('0x17')](function(_0x5efbd2){_0xc060dc(_0x5efbd2);});};AGIVertices[_0x4206('0x10')][_0x4206('0x39')]=function(_0x2e4e4b,_0x1d863d){this[_0x4206('0xe')][_0x4206('0x39')](_0x2e4e4b)['then'](function(_0x5d57f8){_0x1d863d(null,_0x5d57f8);})['catch'](function(_0x2afbea){_0x1d863d(_0x2afbea);});};AGIVertices[_0x4206('0x10')]['createSquareDetailsReport']=function(_0x3343b0,_0xa4e4cd,_0x2bea4e){this[_0x4206('0xe')][_0x4206('0x3a')]({'uniqueid':this['channel'][_0x4206('0x3b')],'node':_0x3343b0['label'],'application':_0x3343b0[_0x4206('0x3c')],'data':_0xa4e4cd||null,'project_name':this[_0x4206('0xd')][_0x4206('0x3d')],'callerid':this['channel']['callerid']})[_0x4206('0x15')](function(_0x3a433c){if(_0x2bea4e){_0x2bea4e(null,_0x3a433c);}})['catch'](function(_0xcfe951){if(_0x2bea4e){_0x2bea4e(_0xcfe951);}});};AGIVertices[_0x4206('0x10')][_0x4206('0x3e')]=function(_0x55c0d4,_0x44ddb8,_0x5d7db3,_0x5345d9){this[_0x4206('0xe')][_0x4206('0x3e')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0x4206('0xd')][_0x4206('0x3f')],'calleridname':this[_0x4206('0xd')][_0x4206('0x40')],'context':this['channel'][_0x4206('0x41')],'extension':this[_0x4206('0xd')]['extension'],'priority':this['channel'][_0x4206('0x42')],'accountcode':this[_0x4206('0xd')]['accountcode'],'dnid':this[_0x4206('0xd')]['dnid'],'projectName':this['channel'][_0x4206('0x3d')],'saveName':_0x44ddb8,'filename':_0x55c0d4[_0x4206('0x43')]||_0x44ddb8,'savePath':_0x5d7db3})[_0x4206('0x15')](function(_0x1ff1c9){_0x5345d9(null,_0x1ff1c9);})[_0x4206('0x17')](function(_0x9ee738){_0x5345d9(_0x9ee738);});};AGIVertices[_0x4206('0x10')]['createSquareMessage']=function(_0x58bbec,_0x2e1408,_0x17a2ed){this['rpc'][_0x4206('0x44')]({'uniqueid':this[_0x4206('0xd')][_0x4206('0x3b')],'body':_0x58bbec,'direction':_0x2e1408})[_0x4206('0x15')](function(_0x49e6f0){if(_0x17a2ed){_0x17a2ed(null,_0x49e6f0);}})[_0x4206('0x17')](function(_0x479fcd){if(_0x17a2ed){_0x17a2ed(_0x479fcd);}});};AGIVertices[_0x4206('0x10')][_0x4206('0x45')]=function(_0x29e60b,_0x1e0a74){var _0x3d5bf5=this;var _0x529f9c=0x0;var _0x3eef5d={'firstName':_['isEmpty'](_0x29e60b[_0x4206('0x16')])||_[_0x4206('0x46')](_0x29e60b[_0x4206('0x16')])?_0x4206('0x47')+Math[_0x4206('0x48')]():_0x29e60b[_0x4206('0x16')],'lastName':_[_0x4206('0x49')](_0x29e60b[_0x4206('0x4a')])||_['isNil'](_0x29e60b[_0x4206('0x4a')])?null:_0x29e60b[_0x4206('0x4a')],'phone':_0x29e60b[_0x4206('0x4b')],'ListId':_0x29e60b['list_id'],'scheduledat':_0x29e60b[_0x4206('0x4c')],'callbackUniqueid':this[_0x4206('0xd')]['uniqueid'],'tags':_0x4206('0x4d'),'description':'Callback\x20scheduled\x20at\x20'+_0x29e60b['scheduledAt'][_0x4206('0x4e')](),'priority':_0x29e60b[_0x4206('0x4f')]};if(_[_0x4206('0x50')](_0x29e60b,_0x4206('0x51'))){if(!_['isNil'](_0x29e60b[_0x4206('0x51')])){var _0xfcce68=_0x29e60b[_0x4206('0x51')];if(_0x29e60b[_0x4206('0x51')]==_0x4206('0x52')){this['rpc'][_0x4206('0x53')]({'phone':_0x29e60b[_0x4206('0x4b')]})[_0x4206('0x15')](function(_0x7ad3f0){if(!_['isNil'](_0x7ad3f0)){var _0x5431bc=_0x7ad3f0['dialTimezone'];if(!_[_0x4206('0x46')](_0x5431bc)){var _0x407a19=shared[_0x4206('0x54')][_0x5431bc];if(!_['isNil'](_0x407a19)){var _0x22e773=-0x1*_0x407a19['utcOffset'];_0x3eef5d[_0x4206('0x55')]=moment(_0x29e60b[_0x4206('0x55')])[_0x4206('0x56')](_0x22e773,'minutes');_0x3d5bf5['insertContact'](_0x3eef5d,_0x29e60b,_0x1e0a74);}else{_0x3d5bf5[_0x4206('0x57')](_0x3eef5d,_0x29e60b,_0x1e0a74);}}else{_0x3d5bf5[_0x4206('0x57')](_0x3eef5d,_0x29e60b,_0x1e0a74);}}else{_0x3d5bf5[_0x4206('0x57')](_0x3eef5d,_0x29e60b,_0x1e0a74);}});}else{var _0x529f9c=shared['timezones'][_0xfcce68];if(!_['isNil'](_0x529f9c)){var _0x3c7cb5=-0x1*_0x529f9c[_0x4206('0x58')];_0x3eef5d[_0x4206('0x55')]=moment(_0x29e60b[_0x4206('0x55')])[_0x4206('0x56')](_0x3c7cb5,'minutes');_0x3d5bf5['insertContact'](_0x3eef5d,_0x29e60b,_0x1e0a74);}else{_0x3d5bf5[_0x4206('0x57')](_0x3eef5d,_0x29e60b,_0x1e0a74);}}}else{_0x3d5bf5[_0x4206('0x57')](_0x3eef5d,_0x29e60b,_0x1e0a74);}}else{_0x3d5bf5['insertContact'](_0x3eef5d,_0x29e60b,_0x1e0a74);}};AGIVertices[_0x4206('0x10')]['insertContact']=function(_0x6ce38e,_0x4c0ba6,_0x51d27f){this['rpc'][_0x4206('0x45')](_0x6ce38e)[_0x4206('0x15')](function(_0x4200e0){_0x51d27f(null,_0x4200e0);})[_0x4206('0x17')](function(_0x39d175){_0x51d27f(_0x39d175);});};AGIVertices['prototype']['getPause']=function(_0x570761,_0x2bda7f){this['rpc'][_0x4206('0x59')](_0x570761)[_0x4206('0x15')](function(_0x1dcc71){_0x2bda7f(null,_0x1dcc71?_0x1dcc71[_0x4206('0x16')]:![]);})[_0x4206('0x17')](function(_0x385892){_0x2bda7f(_0x385892);});};AGIVertices[_0x4206('0x10')]['agentPause']=function(_0x4e0253,_0x199434,_0x436c56){var _0x2001d1={'role':_0x4206('0x5a')};_0x2001d1[_0x4e0253]=this[_0x4206('0xd')][_0x4206('0x3f')];this[_0x4206('0xe')][_0x4206('0x5b')](_0x2001d1,_0x199434,this[_0x4206('0xd')][_0x4206('0x3b')])[_0x4206('0x15')](function(_0x2d5a82){_0x436c56(null,_[_0x4206('0x46')](_0x2d5a82)?![]:!![]);})[_0x4206('0x17')](function(_0x35476f){logger[_0x4206('0x30')](_0x35476f);_0x436c56(null,![]);});};AGIVertices[_0x4206('0x10')][_0x4206('0x5c')]=function(_0x461a2f,_0x28ea64){var _0x3146cd={'role':_0x4206('0x5a')};_0x3146cd[_0x461a2f]=this[_0x4206('0xd')][_0x4206('0x3f')];this[_0x4206('0xe')][_0x4206('0x5c')](_0x3146cd)['then'](function(_0x49a254){_0x28ea64(null,_[_0x4206('0x46')](_0x49a254)?![]:!![]);})[_0x4206('0x17')](function(_0x2108e9){logger[_0x4206('0x30')](_0x2108e9);_0x28ea64(null,![]);});};AGIVertices[_0x4206('0x10')][_0x4206('0x5d')]=function(_0xcf2aa9,_0x5e3f1e){var _0x2ca3d7={'role':'agent'};_0x2ca3d7[_0xcf2aa9]=this[_0x4206('0xd')][_0x4206('0x3f')];this[_0x4206('0xe')]['agentLogout'](_0x2ca3d7)[_0x4206('0x15')](function(_0x104239){_0x5e3f1e(null,_[_0x4206('0x46')](_0x104239)?![]:!![]);})['catch'](function(_0x3e8df9){logger['error'](_0x3e8df9);_0x5e3f1e(null,![]);});};AGIVertices[_0x4206('0x10')]['agentLogin']=function(_0x66d176,_0x1d757e){var _0x108863={'role':_0x4206('0x5a')};_0x108863[_0x66d176]=this['channel'][_0x4206('0x3f')];var _0x1b54e9=_0x66d176!=_0x4206('0x5e')?util['format'](_0x4206('0x5f'),_0x4206('0x60'),this[_0x4206('0xd')][_0x4206('0x3f')]):undefined;this[_0x4206('0xe')]['agentLogin'](_0x108863,_0x1b54e9)['then'](function(_0x33b2c3){_0x1d757e(null,_[_0x4206('0x46')](_0x33b2c3)?![]:!![]);})[_0x4206('0x17')](function(_0x3e927c){logger[_0x4206('0x30')](_0x3e927c);_0x1d757e(null,![]);});};AGIVertices[_0x4206('0x10')][_0x4206('0x61')]=function(_0x41f375,_0x2592d1){sh[_0x4206('0x62')](_[_0x4206('0x63')](_0x41f375),function(_0x102279,_0x274979){var _0x59aabc=_0x274979[_0x4206('0x64')](/(\r\n|\n|\r)/gm,'');_0x2592d1(null,_0x59aabc);});};AGIVertices['prototype'][_0x4206('0x65')]=function(_0x95815e,_0x19b7b3){scripts['googleCloudTTS'](_0x95815e[_0x4206('0x66')],_0x95815e[_0x4206('0x67')]||_0x4206('0x68'),_0x95815e['text'],_0x95815e[_0x4206('0x69')]||_0x4206('0x6a'),_0x95815e[_0x4206('0x6b')]||'MALE',_0x95815e[_0x4206('0x6c')]||_0x4206('0x6d'))[_0x4206('0x15')](function(_0x26062a){_0x19b7b3(null,_0x26062a);})[_0x4206('0x17')](function(_0x341bca){_0x19b7b3(_0x341bca);});};AGIVertices['prototype'][_0x4206('0x6e')]=function(_0x2770d4,_0x54210c){scripts['googleTTS'](_0x2770d4[_0x4206('0x68')],_0x2770d4[_0x4206('0x6f')]||'en',0x1)['then'](function(_0x43242d){_0x54210c(null,_0x43242d);})[_0x4206('0x17')](function(_0xbc6005){_0x54210c(_0xbc6005);});};AGIVertices[_0x4206('0x10')][_0x4206('0x70')]=function(_0x588d0c,_0x574768){var _0x41528f={'uri':_0x588d0c[_0x4206('0x71')],'method':_0x588d0c[_0x4206('0x72')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x588d0c[_0x4206('0x73')])===_0x4206('0x74')&&parseInt(_0x588d0c[_0x4206('0x73')])>=0x1?parseInt(_0x588d0c['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x4206('0x75')](['POST',_0x4206('0x76')],_0x41528f[_0x4206('0x72')][_0x4206('0x77')]())){try{_0x41528f['body']=_0x588d0c['rawBody']?JSON[_0x4206('0x78')](_0x588d0c[_0x4206('0xa')]):{};}catch(_0x51f853){logger[_0x4206('0x30')](_0x4206('0x79'),_0x51f853);}}try{_0x41528f[_0x4206('0x7a')]=_0x588d0c['rawHeaders']?JSON[_0x4206('0x78')](_0x588d0c[_0x4206('0x7b')]):{};}catch(_0x2467c0){logger[_0x4206('0x30')](_0x4206('0x7c'),_0x2467c0);}if(_0x588d0c[_0x4206('0x7d')]){try{var _0x4b2d8a=require(_0x588d0c[_0x4206('0x7d')])['sync'](this,_0x41528f);_0x41528f[_0x4206('0x7e')]=Mustache['render'](_0x588d0c[_0x4206('0x71')],_0x4b2d8a,{},['$$','$$']);if(_0x41528f['headers']){_0x41528f[_0x4206('0x7a')]=JSON['parse'](Mustache[_0x4206('0x7f')](JSON[_0x4206('0x80')](_0x41528f[_0x4206('0x7a')]),_0x4b2d8a,{},['$$','$$']));}if(_0x41528f[_0x4206('0x81')]){_0x41528f[_0x4206('0x81')]=JSON['parse'](Mustache[_0x4206('0x7f')](JSON[_0x4206('0x80')](_0x41528f[_0x4206('0x81')]),_0x4b2d8a,{},['$$','$$']));}}catch(_0x3fb8e5){logger[_0x4206('0x30')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3fb8e5);}}rp(_0x41528f)[_0x4206('0x15')](function(_0x471726){var _0x518e59={'statusCode':_0x471726[_0x4206('0x82')]||0xc8,'statusMessage':_0x471726[_0x4206('0x83')]||'OK','headers':_0x471726[_0x4206('0x7a')]||{},'body':_0x471726['body']||{}};_0x574768(null,_0x518e59);})[_0x4206('0x17')](function(_0x16be24){var _0x527141={'statusCode':_0x16be24['statusCode']||0x1f4,'statusMessage':_0x16be24['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x16be24['options'][_0x4206('0x7a')]||{},'body':_0x16be24[_0x4206('0x84')][_0x4206('0x81')]||{}};_0x574768(null,_0x527141);});};AGIVertices['prototype'][_0x4206('0x85')]=function(_0x52a39c,_0x343ec5){scripts[_0x4206('0x85')](this['channel'][_0x4206('0x3b')],_0x52a39c[_0x4206('0x86')],_0x52a39c[_0x4206('0x68')],_0x52a39c[_0x4206('0x87')]||'en')[_0x4206('0x15')](function(_0x9b0110){_0x343ec5(null,_0x9b0110);})[_0x4206('0x17')](function(_0x17c9b7){_0x343ec5(_0x17c9b7);});};AGIVertices['prototype']['sestekNDA']=function(_0x1dc8bb,_0xc84ea3){scripts[_0x4206('0x88')](this[_0x4206('0xd')],_0x1dc8bb)[_0x4206('0x15')](function(_0x133d1c){_0xc84ea3(null,_0x133d1c);})[_0x4206('0x17')](function(_0x158d52){_0xc84ea3(_0x158d52);});};AGIVertices['prototype'][_0x4206('0x89')]=function(_0x4be7c3,_0x5502bb){scripts['ispeechTTS'](_0x4be7c3[_0x4206('0x86')],_0x4be7c3[_0x4206('0x68')],_0x4be7c3[_0x4206('0x8a')]||_0x4206('0x6a'),_0x4be7c3['speed'])['then'](function(_0x3eff8a){_0x5502bb(null,_0x3eff8a);})['catch'](function(_0xa3cf86){_0x5502bb(_0xa3cf86);});};AGIVertices[_0x4206('0x10')]['ispeechASR']=function(_0x5ace60,_0x3603d1,_0x17fe4f){scripts[_0x4206('0x8b')](_0x3603d1,_0x5ace60['key'],_0x5ace60[_0x4206('0x8c')]||_0x4206('0x6a'),this[_0x4206('0x8d')](_0x5ace60[_0x4206('0x8e')])?_0x5ace60[_0x4206('0x8e')]:undefined)[_0x4206('0x15')](function(_0x1d3c48){_0x17fe4f(null,_0x1d3c48);})[_0x4206('0x17')](function(_0x135bd2){_0x17fe4f(_0x135bd2);});};AGIVertices[_0x4206('0x10')][_0x4206('0x8f')]=function(_0x44439a,_0x522df4){scripts['awsPolly'](_0x44439a[_0x4206('0x90')],_0x44439a[_0x4206('0x91')],_0x44439a['aws_polly_region'],_0x44439a['aws_polly_voice']||_0x4206('0x92'),_0x44439a[_0x4206('0x68')],_0x44439a[_0x4206('0x93')]||_0x4206('0x68'))['then'](function(_0x366b0c){_0x522df4(null,_0x366b0c);})[_0x4206('0x17')](function(_0x3602ef){_0x522df4(_0x3602ef);});};AGIVertices[_0x4206('0x10')][_0x4206('0x94')]=function(_0xc35524,_0x4155ff){scripts[_0x4206('0x94')](this['channel']['uniqueid'],_0xc35524[_0x4206('0x90')],_0xc35524[_0x4206('0x91')],_0xc35524['aws_lex_region'],_0xc35524[_0x4206('0x68')],_0xc35524[_0x4206('0x95')])['then'](function(_0x214523){_0x4155ff(null,_0x214523);})['catch'](function(_0x6f5c24){_0x4155ff(_0x6f5c24);});};AGIVertices[_0x4206('0x10')][_0x4206('0x96')]=function(_0x2b2f77,_0x3e532c,_0x576808){scripts[_0x4206('0x96')](_0x3e532c,_0x2b2f77[_0x4206('0x86')],_0x2b2f77[_0x4206('0x97')]||_0x4206('0x6a'))[_0x4206('0x15')](function(_0x52b61f){_0x576808(null,_0x52b61f);})[_0x4206('0x17')](function(_0x422c46){_0x576808(_0x422c46);});};AGIVertices[_0x4206('0x10')]['tildeASR']=function(_0x80276f,_0x2095e9,_0x407dc1){scripts[_0x4206('0x98')](_0x2095e9,_0x80276f[_0x4206('0x99')],_0x80276f[_0x4206('0x9a')],_0x80276f[_0x4206('0x7e')])['then'](function(_0x3e3509){_0x407dc1(null,_0x3e3509);})[_0x4206('0x17')](function(_0x52034e){_0x407dc1(_0x52034e);});};AGIVertices[_0x4206('0x10')][_0x4206('0x9b')]=function(_0x365c34){var _0x284221=_[_0x4206('0x75')](verticesWithRetry,_0x365c34[_0x4206('0x3c')])?_0x365c34:_[_0x4206('0x9c')](_0x365c34);for(var _0x1a3886 in _0x284221){if(_0x284221[_0x4206('0x9d')](_0x1a3886)){if(_0x284221[_0x1a3886]&&_['isString'](_0x284221[_0x1a3886])){if(_[_0x4206('0x75')](recursiveMapAttributes,_0x1a3886)){_0x284221[_0x1a3886]=this[_0x4206('0x9e')](_0x284221[_0x1a3886]);}else{_0x284221[_0x1a3886]=this[_0x4206('0x9f')](_0x284221[_0x1a3886]);}}}}return _0x284221;};AGIVertices['prototype'][_0x4206('0xa0')]=function(_0x2caf66){for(var _0x1f1c9f in _0x2caf66){if(_0x2caf66['hasOwnProperty'](_0x1f1c9f)){if(_[_0x4206('0xa1')](_0x2caf66[_0x1f1c9f])){this[_0x4206('0xa0')](_0x2caf66[_0x1f1c9f]);}else if(_[_0x4206('0xa2')](_0x2caf66[_0x1f1c9f])){for(var _0x58de8a=0x0;_0x58de8a<_0x2caf66[_0x1f1c9f][_0x4206('0xa3')];_0x58de8a++){this[_0x4206('0xa0')](_0x2caf66[_0x1f1c9f][_0x58de8a]);}}else if(_[_0x4206('0xa4')](_0x2caf66[_0x1f1c9f])){_0x2caf66[_0x1f1c9f]=this[_0x4206('0x9f')](_0x2caf66[_0x1f1c9f]);}}}};AGIVertices[_0x4206('0x10')]['saveRestApiResult']=function(_0x410493,_0x34de9b){for(var _0x416494 in _0x410493){if(_0x410493[_0x4206('0x9d')](_0x416494)){if(_[_0x4206('0xa1')](_0x410493[_0x416494])){if(!_[_0x4206('0x49')](_0x410493[_0x416494])){this['saveRestApiResult'](_0x410493[_0x416494],util['format'](_0x4206('0xa5'),_0x34de9b,_0x416494));}}else if(_['isArray'](_0x410493[_0x416494])){for(var _0x5d28ef=0x0;_0x5d28ef<_0x410493[_0x416494][_0x4206('0xa3')];_0x5d28ef++){this[_0x4206('0xa6')](_0x410493[_0x416494][_0x5d28ef],util[_0x4206('0x2c')](_0x4206('0xa5'),_0x34de9b,_0x416494+'['+_0x5d28ef+']'));}}else{if(!_[_0x4206('0x46')](_0x410493[_0x416494])){this[_0x4206('0xd')]['setVariable'](util[_0x4206('0x2c')](_0x4206('0xa5'),_0x34de9b,_0x416494),_0x410493[_0x416494]);}}}}};AGIVertices[_0x4206('0x10')]['replaceObjectAllVariables']=function(_0x51f040){try{var _0x14534a=JSON[_0x4206('0x78')](_0x51f040);this[_0x4206('0xa0')](_0x14534a);return JSON[_0x4206('0x80')](_0x14534a);}catch(_0x182966){return this['replaceAllVariables'](_0x51f040);}};AGIVertices[_0x4206('0x10')][_0x4206('0x9f')]=function(_0x54547c){var _0x3c8edc=_0x54547c[_0x4206('0xa7')]('{');for(var _0x2c0a77=0x1;_0x2c0a77<_0x3c8edc[_0x4206('0xa3')];_0x2c0a77+=0x1){var _0x37ee40=_0x3c8edc[_0x2c0a77][_0x4206('0xa7')]('}');if(_0x37ee40[_0x4206('0xa3')]>0x1){_0x54547c=_0x54547c['replaceAll']('{'+_0x37ee40[0x0]+'}',this[_0x4206('0xd')][_0x4206('0x11')](_0x37ee40[0x0])[_0x4206('0xa8')]||_0x37ee40[0x0]);}}if(_0x3c8edc['length']===0x1){return _0x54547c['toString']();}return this['replaceAllVariables'](_0x54547c);};AGIVertices[_0x4206('0x10')][_0x4206('0xa9')]=function(_0x38167d,_0x21d7c3){var _0x48041f=this['channel'][_0x4206('0x11')](_0x38167d);if(_0x48041f[_0x4206('0xaa')]===-0x1){return _0x48041f;}logger['info'](util[_0x4206('0x2c')](_0x4206('0xab'),_0x21d7c3,_0x48041f[_0x4206('0xa8')]));return this['channel'][_0x4206('0xac')](_0x21d7c3,_0x48041f[_0x4206('0xa8')]);};AGIVertices[_0x4206('0x10')]['isConfigured']=function(_0x2c4691){return _0x2c4691&&_0x2c4691!=='0'&&_0x2c4691!=='-1'&&_0x2c4691!=='';};AGIVertices['prototype'][_0x4206('0xad')]=function(_0x42b43b){this['createSquareDetailsReport'][_0x4206('0xae')](this,_0x42b43b,'-');_0x42b43b[_0x4206('0xaf')]=_0x42b43b[_0x4206('0xad')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x4206('0x10')][_0x4206('0xb0')]=function(_0x202b44){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0xb1'),_0x202b44[_0x4206('0xb2')]));if(!this['isConfigured'](_0x202b44[_0x4206('0x68')])){return this[_0x4206('0xd')]['noop'](_0x4206('0xb3'));}var _0x3ec95b='\x22'+_0x202b44[_0x4206('0x68')]+'\x22';if(this[_0x4206('0x8d')](_0x202b44[_0x4206('0x84')])){_0x3ec95b+=','+_0x202b44[_0x4206('0x84')];}var _0x590f3a=this[_0x4206('0xd')][_0x4206('0x62')](_0x4206('0xb4'),_0x3ec95b);if(_0x590f3a['result']===-0x1){return _0x590f3a;}return this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0xb6'),_0x3ec95b));};AGIVertices[_0x4206('0x10')]['mrcprecog']=function(_0xdcc4ea){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0xb7'),_0xdcc4ea[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0xdcc4ea[_0x4206('0xb8')])){return this[_0x4206('0xd')][_0x4206('0xb5')]('no\x20grammar\x20configured');}var _0x2ca2ce=_0xdcc4ea[_0x4206('0xb8')];if(this[_0x4206('0x8d')](_0xdcc4ea['options'])){_0x2ca2ce+=','+_0xdcc4ea[_0x4206('0x84')];}var _0x39af43=this[_0x4206('0xd')]['exec'](_0x4206('0xb9'),_0x2ca2ce);if(_0x39af43[_0x4206('0xaa')]===-0x1){return _0x39af43;}var _0x2ece00=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x4206('0xba'));if(_0x2ece00['result']===-0x1){return _0x2ece00;}var _0x40d907=this[_0x4206('0xa9')](_0x4206('0xbb'),_0x4206('0xbc'));if(_0x40d907[_0x4206('0xaa')]===-0x1){return _0x40d907;}var _0x44ddc3=this[_0x4206('0xa9')](_0x4206('0xbd'),_0x4206('0xbe'));if(_0x44ddc3[_0x4206('0xaa')]===-0x1){return _0x44ddc3;}return this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0xbf'),_0x2ca2ce));};AGIVertices[_0x4206('0x10')]['agi']=function(_0x2dfe6d){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0xc0'),_0x2dfe6d['label']));return this[_0x4206('0xd')][_0x4206('0x8')]([_0x2dfe6d[_0x4206('0xc1')],_0x2dfe6d['args']]);};AGIVertices[_0x4206('0x10')]['answer']=function(_0x2f080d){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0xc2'),_0x2f080d[_0x4206('0xb2')]));if(this[_0x4206('0x8d')](_0x2f080d['timeout'])){logger['info'](util[_0x4206('0x2c')](_0x4206('0xc3'),_0x2f080d[_0x4206('0x73')]));var _0x13d31f=this['channel'][_0x4206('0xc4')](_0x2f080d[_0x4206('0x73')]);if(_0x13d31f['result']===-0x1){return _0x13d31f;}}return this['channel'][_0x4206('0xc5')]();};AGIVertices[_0x4206('0x10')]['callback']=function(_0x3839af){logger['info'](util[_0x4206('0x2c')](_0x4206('0xc6'),_0x3839af[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x3839af[_0x4206('0xc7')])){return this[_0x4206('0xd')][_0x4206('0x30')](_0x3839af,'no\x20list\x20selected');}_0x3839af[_0x4206('0x4c')]=moment();if(this[_0x4206('0x8d')](_0x3839af[_0x4206('0xc8')])){_0x3839af[_0x4206('0x4c')]=moment()['add'](_0x3839af['delay'],_0x4206('0xc9'));}if(!this[_0x4206('0x8d')](_0x3839af[_0x4206('0x4f')])){_0x3839af[_0x4206('0x4f')]=0x2;}this[_0x4206('0x45')][_0x4206('0xae')](this,_0x3839af);return this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0xca'),_0x3839af[_0x4206('0x4b')],_0x3839af[_0x4206('0xc7')],_0x3839af[_0x4206('0x4c')]));};AGIVertices[_0x4206('0x10')]['custom_app']=function(_0x5c71ee){logger[_0x4206('0x32')](util[_0x4206('0x2c')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x5c71ee[_0x4206('0xb2')]));var _0x32ba47=this[_0x4206('0xd')]['exec'](_0x5c71ee[_0x4206('0xcb')],_0x5c71ee['options']);if(_0x32ba47[_0x4206('0xaa')]===-0x1){return _0x32ba47;}return this['channel'][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0xcc'),_0x5c71ee[_0x4206('0xcb')],_0x5c71ee[_0x4206('0x84')]));};AGIVertices[_0x4206('0x10')]['lumenvoxtts']=function(_0x2f83fb){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0xcd'),_0x2f83fb['label']));if(!this[_0x4206('0x8d')](_0x2f83fb[_0x4206('0x68')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xb3'));}var _0x406272='\x22'+_0x2f83fb['text']+'\x22';if(this[_0x4206('0x8d')](_0x2f83fb[_0x4206('0x84')])){_0x406272+=','+_0x2f83fb[_0x4206('0x84')];}var _0x107c13=this['channel'][_0x4206('0x62')]('MRCPSynth',_0x406272);if(_0x107c13[_0x4206('0xaa')]===-0x1){return _0x107c13;}return this[_0x4206('0xd')]['noop'](util[_0x4206('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x406272));};AGIVertices[_0x4206('0x10')]['sestektts']=function(_0x248cdd){logger['info'](util[_0x4206('0x2c')](_0x4206('0xce'),_0x248cdd[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x248cdd[_0x4206('0x68')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xb3'));}var _0x21865a='\x22'+_0x248cdd[_0x4206('0x68')]+'\x22';if(this[_0x4206('0x8d')](_0x248cdd[_0x4206('0x84')])){_0x21865a+=','+_0x248cdd[_0x4206('0x84')];}var _0x4ee0a6=this[_0x4206('0xd')]['exec'](_0x4206('0xb4'),_0x21865a);if(_0x4ee0a6[_0x4206('0xaa')]===-0x1){return _0x4ee0a6;}return this[_0x4206('0xd')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x21865a));};AGIVertices[_0x4206('0x10')][_0x4206('0xcf')]=function(_0x58b6b4){logger['info'](util[_0x4206('0x2c')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x58b6b4[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x58b6b4[_0x4206('0xb8')])){return this[_0x4206('0xd')]['noop'](_0x4206('0xd0'));}var _0x3820b6=_0x58b6b4['grammar'];if(this[_0x4206('0x8d')](_0x58b6b4[_0x4206('0x84')])){_0x3820b6+=','+_0x58b6b4['options'];}var _0x2c0f=this[_0x4206('0xd')][_0x4206('0x62')]('MRCPRecog',_0x3820b6);if(_0x2c0f[_0x4206('0xaa')]===-0x1){return _0x2c0f;}var _0x47c11e=this[_0x4206('0xa9')](_0x4206('0xd1'),_0x4206('0xd2'));if(_0x47c11e[_0x4206('0xaa')]===-0x1){return _0x47c11e;}var _0x4d1403=this[_0x4206('0xa9')](_0x4206('0xbb'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x4d1403[_0x4206('0xaa')]===-0x1){return _0x4d1403;}var _0x4215f6=this[_0x4206('0xa9')]('RECOG_INSTANCE()',_0x4206('0xd3'));if(_0x4215f6[_0x4206('0xaa')]===-0x1){return _0x4215f6;}return this['channel'][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0xbf'),_0x3820b6));};AGIVertices['prototype']['sestekasr']=function(_0x2994d8){logger['info'](util[_0x4206('0x2c')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x2994d8['label']));if(!this[_0x4206('0x8d')](_0x2994d8['grammar'])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xd0'));}var _0xe14855=_0x2994d8[_0x4206('0xb8')];if(this[_0x4206('0x8d')](_0x2994d8[_0x4206('0x84')])){_0xe14855+=','+_0x2994d8[_0x4206('0x84')];}var _0x508389=this[_0x4206('0xd')][_0x4206('0x62')](_0x4206('0xb9'),_0xe14855);if(_0x508389[_0x4206('0xaa')]===-0x1){return _0x508389;}var _0x24ae8c=this[_0x4206('0xa9')](_0x4206('0xd1'),_0x4206('0xd4'));if(_0x24ae8c[_0x4206('0xaa')]===-0x1){return _0x24ae8c;}var _0x124d24=this['getAndSetVariable'](_0x4206('0xbb'),_0x4206('0xd5'));if(_0x124d24[_0x4206('0xaa')]===-0x1){return _0x124d24;}var _0x1a4846=this[_0x4206('0xa9')](_0x4206('0xbd'),'SESTEK_ASR_INSTANCE');if(_0x1a4846[_0x4206('0xaa')]===-0x1){return _0x1a4846;}return this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')]('Executed\x20command\x20MRCPRecog\x20%s',_0xe14855));};AGIVertices[_0x4206('0x10')][_0x4206('0xd6')]=function(_0x41703f){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0xd7'),_0x41703f[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x41703f[_0x4206('0xd8')])){return this[_0x4206('0xd')][_0x4206('0x30')](_0x41703f,_0x4206('0xd9'));}var _0x72edd7=this[_0x4206('0x19')][_0x4206('0xae')](this,_0x41703f[_0x4206('0xd8')]);if(!_0x72edd7){return this['channel']['error'](_0x41703f,_0x4206('0xda'));}if(!this[_0x4206('0x8d')](_0x41703f[_0x4206('0x34')])){return this[_0x4206('0xd')][_0x4206('0x30')](_0x41703f,_0x4206('0xdb'));}var _0x2e16a3=_0x41703f['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x4206('0xd')][_0x4206('0xb5')](util['format'](_0x4206('0xdc'),_0x2e16a3));var _0x520cbb=this['getQueryOdbc'][_0x4206('0xae')](this,_0x72edd7,_0x2e16a3);this['createSquareDetailsReport']['sync'](this,_0x41703f,_0x2e16a3);if(!this[_0x4206('0x8d')](_0x41703f[_0x4206('0xdd')])){return this['channel'][_0x4206('0xb5')](_0x4206('0xde'));}var _0x5caef9=this['getVariable'][_0x4206('0xae')](this,_0x41703f[_0x4206('0xdd')]);if(!_0x5caef9){return this[_0x4206('0xd')][_0x4206('0x30')](_0x41703f,'no\x20variable\x20found');}var _0x53ca08=this;_0x520cbb['forEach'](function(_0xb0a899,_0x3427be){Object[_0x4206('0xdf')](_0xb0a899)['forEach'](function(_0x578ce1){_0x53ca08[_0x4206('0xd')][_0x4206('0xac')](util['format']('%s[%s][%s]',_0x5caef9,_0x3427be,_0x578ce1),_0xb0a899[_0x578ce1]);});});this[_0x4206('0xd')][_0x4206('0xac')](util[_0x4206('0x2c')]('%s_ROWS_COUNT',_0x5caef9),_0x520cbb[_0x4206('0xa3')]);return this['channel']['noop'](util['format'](_0x4206('0xe0'),_0x5caef9));};AGIVertices[_0x4206('0x10')][_0x4206('0xe1')]=function(_0x54b0f1){logger['debug'](util[_0x4206('0x2c')](_0x4206('0xe2'),_0x54b0f1[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x54b0f1[_0x4206('0xe3')])){return this[_0x4206('0xd')][_0x4206('0x30')](_0x54b0f1,_0x4206('0xe4'));}var _0x3acc30=this[_0x4206('0x1c')]['sync'](this,_0x54b0f1[_0x4206('0xe3')]);if(!_0x3acc30){return this['channel']['error'](_0x54b0f1,_0x4206('0xe5'));}var _0xa7b30=this[_0x4206('0xd')]['exec']('DIAL',[util[_0x4206('0x2c')](_0x4206('0xe6'),_0x3acc30),_0x54b0f1[_0x4206('0x73')],_0x54b0f1[_0x4206('0xe7')],_0x54b0f1['url']]);if(_0xa7b30[_0x4206('0xaa')]===-0x1){return _0xa7b30;}return this['channel'][_0x4206('0xb5')](util['format'](_0x4206('0xe8'),_0x4206('0xe9')));};AGIVertices[_0x4206('0x10')][_0x4206('0xea')]=function(_0x27401d){logger['info'](util[_0x4206('0x2c')](_0x4206('0xeb'),_0x27401d[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x27401d[_0x4206('0x86')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xec'));}if(!this['isConfigured'](_0x27401d['text'])){return this['channel']['noop'](_0x4206('0xb3'));}this[_0x4206('0xd')][_0x4206('0xed')]=!![];this['createSquareDetailsReport'](_0x27401d);this[_0x4206('0x44')](_0x27401d[_0x4206('0x68')],'in');this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0xee'),_0x27401d[_0x4206('0x68')]));var _0xca3f20=this[_0x4206('0x85')][_0x4206('0xae')](this,_0x27401d);if(_0xca3f20){for(var _0x48efc5 in _0xca3f20){if(_0xca3f20[_0x4206('0x9d')](_0x48efc5)){this['channel'][_0x4206('0xac')](util[_0x4206('0x2c')](_0x4206('0xef'),_0x48efc5[_0x4206('0x77')]()),_0xca3f20[_0x48efc5]);}}this[_0x4206('0x44')](_0xca3f20[_0x4206('0xf0')],_0x4206('0xf1'));return this[_0x4206('0xd')][_0x4206('0xb5')](util['format'](_0x4206('0xf2'),_0xca3f20[_0x4206('0xf0')]));}return this[_0x4206('0xd')][_0x4206('0x30')](_0x27401d,_0x4206('0xf3'));};AGIVertices[_0x4206('0x10')][_0x4206('0xf4')]=function(_0x2688d4){logger['info'](util[_0x4206('0x2c')](_0x4206('0xf5'),_0x2688d4[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x2688d4[_0x4206('0xf6')])){return this[_0x4206('0xd')]['noop'](_0x4206('0xf7'));}if(!this[_0x4206('0x8d')](_0x2688d4[_0x4206('0xf8')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xf9'));}if(!this[_0x4206('0x8d')](_0x2688d4[_0x4206('0xfa')])){return this['channel'][_0x4206('0xb5')](_0x4206('0xfb'));}if(!this[_0x4206('0x8d')](_0x2688d4['ndassistant_url'])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xb3'));}this[_0x4206('0xd')]['bot']=!![];this['createSquareDetailsReport'](_0x2688d4);this[_0x4206('0x44')](_0x2688d4['text'],'in');this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')]('Trying\x20SestekNDA:\x20%s',_0x2688d4[_0x4206('0x68')]));var _0x195fa=this['sestekNDA'][_0x4206('0xae')](this,_0x2688d4);if(_0x195fa){for(var _0x59feed in _0x195fa){if(_0x195fa[_0x4206('0x9d')](_0x59feed)){this[_0x4206('0xd')][_0x4206('0xac')](util['format'](_0x4206('0xfc'),_0x59feed[_0x4206('0x77')]()),_0x195fa[_0x59feed]);}}this['createSquareMessage'](_0x195fa[_0x4206('0xf0')],_0x4206('0xf1'));if(_0x195fa[_0x4206('0xfd')]){this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x195fa[_0x4206('0xfd')]));var _0x328021=this[_0x4206('0xd')][_0x4206('0xfe')](_0x195fa[_0x4206('0xfd')]);try{fs[_0x4206('0xff')](_0x195fa[_0x4206('0xfd')]+_0x4206('0x100'));}catch(_0x7f388b){logger[_0x4206('0x30')](_0x7f388b);}return _0x328021;}else{return this['channel'][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x101'),_0x195fa[_0x4206('0xf0')]));}}return this[_0x4206('0xd')]['error'](_0x2688d4,_0x4206('0x102'));};AGIVertices[_0x4206('0x10')][_0x4206('0x103')]=function(_0x2787cd){logger[_0x4206('0x32')](util[_0x4206('0x2c')]('Enter\x20in\x20END\x20(%s)\x20block',_0x2787cd[_0x4206('0xb2')]));return this[_0x4206('0xd')]['noop'](_0x4206('0x103'));};AGIVertices[_0x4206('0x10')][_0x4206('0x104')]=function(_0x26fd4c){logger[_0x4206('0x32')](util['format'](_0x4206('0x105'),_0x26fd4c[_0x4206('0xb2')]));var _0x18d794='';if(_0x26fd4c['trunk_id']){if(!this['isConfigured'](_0x26fd4c[_0x4206('0x106')])){return this[_0x4206('0xd')][_0x4206('0x30')](_0x26fd4c,'no\x20trunk\x20selected');}else{var _0x334eed=parseInt(_0x26fd4c[_0x4206('0x106')],0xa);if(isNaN(_0x334eed)){_0x18d794=_0x26fd4c[_0x4206('0x106')];}else{_0x18d794=this[_0x4206('0x1e')][_0x4206('0xae')](this,_0x26fd4c[_0x4206('0x106')]);if(!_0x18d794){return this[_0x4206('0xd')][_0x4206('0x30')](_0x26fd4c,_0x4206('0x107'));}}}}else if(_0x26fd4c[_0x4206('0x108')]){_0x18d794=_0x26fd4c['trunk_name'];}else{return this[_0x4206('0xd')][_0x4206('0x30')](_0x26fd4c,_0x4206('0x109'));}var _0x35f5c0=this[_0x4206('0xd')][_0x4206('0x62')](_0x4206('0xe9'),[util[_0x4206('0x2c')](_0x4206('0x10a'),_0x18d794,_0x26fd4c[_0x4206('0x4b')]),_0x26fd4c[_0x4206('0x73')],_0x26fd4c['opts'],_0x26fd4c['url']]);if(_0x35f5c0[_0x4206('0xaa')]===-0x1){return _0x35f5c0;}return this['channel'][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0xe8'),_0x4206('0xe9')));};AGIVertices[_0x4206('0x10')]['finally']=function(_0x593bb6){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x10b'),_0x593bb6[_0x4206('0xb2')]));return this['channel'][_0x4206('0xb5')]('finally');};AGIVertices[_0x4206('0x10')][_0x4206('0xb')]=function(_0x11e9e3){logger[_0x4206('0x32')](util['format'](_0x4206('0x10c'),_0x11e9e3[_0x4206('0xb2')]));if(_0x11e9e3[_0x4206('0xaf')]===0x0){return this['maxRetry'](_0x11e9e3);}_0x11e9e3[_0x4206('0xaf')]-=0x1;if(!this[_0x4206('0x8d')](_0x11e9e3[_0x4206('0x10d')])){return this['channel'][_0x4206('0x30')](_0x11e9e3,_0x4206('0x10e'));}var _0x8da1a9=this[_0x4206('0x20')][_0x4206('0xae')](this,_0x11e9e3[_0x4206('0x10d')]);if(!_0x8da1a9){return this['channel'][_0x4206('0x30')](_0x11e9e3,_0x4206('0x10f'));}if(!this[_0x4206('0x8d')](_0x11e9e3[_0x4206('0xdd')])){return this[_0x4206('0xd')][_0x4206('0x30')](_0x4206('0xde'));}var _0x30c8fb=this[_0x4206('0xd')]['getData'](_0x8da1a9,_0x11e9e3['response'],_0x11e9e3[_0x4206('0x110')]);var _0xa42ca0=_0x30c8fb[_0x4206('0xaa')]?_0x30c8fb[_0x4206('0xaa')][_0x4206('0x4e')]():'';logger['info'](_0x4206('0x111'),JSON['stringify'](_0x30c8fb));if(_0x30c8fb[_0x4206('0xaa')]===-0x1){this['createSquareDetailsReport'][_0x4206('0xae')](this,_0x11e9e3,_0xa42ca0);return _0x30c8fb;}else if(_0x30c8fb[_0x4206('0xa8')]===_0x4206('0x73')){_0x30c8fb[_0x4206('0xaa')]=_0xa42ca0[_0x4206('0xa3')]>=parseInt(_0x11e9e3[_0x4206('0x112')])?'x':'i';}else{_0x30c8fb['result']=_0xa42ca0['length']>=parseInt(_0x11e9e3[_0x4206('0x112')])&&_0xa42ca0['length']<=parseInt(_0x11e9e3[_0x4206('0x110')])?'x':'i';}var _0x3dc6eb=this[_0x4206('0x11')][_0x4206('0xae')](this,_0x11e9e3['variable_id']);if(!_0x3dc6eb){return this['channel']['error'](_0x11e9e3,_0x4206('0x113'));}this[_0x4206('0xd')][_0x4206('0xac')](_0x3dc6eb,_0xa42ca0);if(this[_0x4206('0x8d')](_0x11e9e3['hiddendigitsnum'])){var _0x29d3dd=parseInt(_0x11e9e3[_0x4206('0x114')],0xa);var _0x8bb822=rs[_0x4206('0x115')]({'charset':'*','length':_0x29d3dd});var _0x14a0bc=_0xa42ca0[_0x4206('0xa3')];if(_0x14a0bc>0x0){if(_0x14a0bc>_0x29d3dd){this[_0x4206('0x3a')][_0x4206('0xae')](this,_0x11e9e3,_0x11e9e3[_0x4206('0x116')]===_0x4206('0x117')?_0x8bb822+_0xa42ca0['substr'](_0x29d3dd):_0xa42ca0[_0x4206('0x118')](0x0,_0x14a0bc-_0x29d3dd)+_0x8bb822);}else{this[_0x4206('0x3a')][_0x4206('0xae')](this,_0x11e9e3,rs['generate']({'charset':'*','length':_0x14a0bc}));}}else{this[_0x4206('0x3a')][_0x4206('0xae')](this,_0x11e9e3,'');}}else{this[_0x4206('0x3a')][_0x4206('0xae')](this,_0x11e9e3,_0xa42ca0);}return _0x30c8fb;};AGIVertices[_0x4206('0x10')][_0x4206('0xc')]=function(_0x109c43){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x119'),_0x109c43[_0x4206('0xb2')]));return this[_0x4206('0xb')](_0x109c43);};AGIVertices[_0x4206('0x10')][_0x4206('0x11a')]=function(_0x318a38){logger['info'](util[_0x4206('0x2c')](_0x4206('0x11b'),_0x318a38['label']));this[_0x4206('0x3a')][_0x4206('0xae')](this,_0x318a38,_0x318a38[_0x4206('0x11c')]);return this['channel'][_0x4206('0xb5')](util['format'](_0x4206('0x11d'),_0x318a38[_0x4206('0x11c')]));};AGIVertices[_0x4206('0x10')][_0x4206('0x11e')]=function(_0x53c64b){logger['info'](util[_0x4206('0x2c')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x53c64b['label']));if(!this[_0x4206('0x8d')](_0x53c64b[_0x4206('0x90')])||!this[_0x4206('0x8d')](_0x53c64b[_0x4206('0x91')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0x11f'));}if(!this[_0x4206('0x8d')](_0x53c64b[_0x4206('0x68')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xb3'));}this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')]('Trying\x20aws\x20Polly\x20%s',_0x53c64b[_0x4206('0x68')]));var _0x3ddcbf=this[_0x4206('0x8f')][_0x4206('0xae')](this,_0x53c64b);if(_0x3ddcbf){this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x120'),_0x3ddcbf));var _0x2f8419=this['channel'][_0x4206('0xfe')](_0x3ddcbf);try{fs['unlink'](_0x3ddcbf+_0x4206('0x100'));}catch(_0x36180f){logger[_0x4206('0x30')](_0x36180f);}return _0x2f8419;}return this['channel'][_0x4206('0x30')](_0x53c64b,_0x4206('0x121'));};AGIVertices['prototype'][_0x4206('0x122')]=function(_0x53e2f8){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x123'),_0x53e2f8[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x53e2f8[_0x4206('0x90')])||!this[_0x4206('0x8d')](_0x53e2f8[_0x4206('0x91')])){return this[_0x4206('0xd')][_0x4206('0xb5')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x4206('0x8d')](_0x53e2f8[_0x4206('0x95')])){return this['channel'][_0x4206('0xb5')](_0x4206('0x124'));}if(!this['isConfigured'](_0x53e2f8[_0x4206('0x68')])){return this[_0x4206('0xd')]['noop'](_0x4206('0xb3'));}this['channel'][_0x4206('0xed')]=!![];this[_0x4206('0x3a')](_0x53e2f8);this[_0x4206('0x44')](_0x53e2f8['text'],'in');this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x125'),_0x53e2f8[_0x4206('0x68')]));var _0x1ce198=this[_0x4206('0x94')]['sync'](this,_0x53e2f8);if(_0x1ce198){for(var _0x5a31e7 in _0x1ce198){if(_0x1ce198[_0x4206('0x9d')](_0x5a31e7)&&_[_0x4206('0xa4')](_0x1ce198[_0x5a31e7])){this[_0x4206('0xd')][_0x4206('0xac')](util[_0x4206('0x2c')](_0x4206('0x126'),_0x5a31e7[_0x4206('0x77')]()),_0x1ce198[_0x5a31e7]);}}if(_['isNil'](_0x1ce198[_0x4206('0x127')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0x128'));}else{this[_0x4206('0x44')](_0x1ce198[_0x4206('0x127')],_0x4206('0xf1'));return this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x129'),_0x1ce198[_0x4206('0x127')]));}}return this[_0x4206('0xd')][_0x4206('0x30')](_0x53e2f8,_0x4206('0x12a'));};AGIVertices['prototype']['googleasr']=function(_0x3c21e0){logger[_0x4206('0x32')](util[_0x4206('0x2c')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x3c21e0['label'],_0x3c21e0['timeout']));if(!this[_0x4206('0x8d')](_0x3c21e0[_0x4206('0x86')])){return this[_0x4206('0xd')]['noop'](_0x4206('0xec'));}var _0x4d2fe1='wav';var _0x39e1c4=util['format'](_0x4206('0x12b'),FILES_PATH,rs['generate'](0x4));var _0x5738a5=util[_0x4206('0x2c')](_0x4206('0xa5'),_0x39e1c4,_0x4d2fe1);var _0x55fa01=!![];if(_0x3c21e0['beep']===_0x4206('0x12c')){_0x55fa01=![];}var _0x2e8708=this[_0x4206('0xd')][_0x4206('0x12d')](_0x39e1c4,_0x4d2fe1,_0x3c21e0[_0x4206('0x12e')],_0x3c21e0[_0x4206('0x73')],undefined,_0x55fa01);if(_0x2e8708[_0x4206('0xaa')]!==-0x1){this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x12f'),_0x5738a5));var _0x1061de=this[_0x4206('0x96')][_0x4206('0xae')](this,_0x3c21e0,_0x5738a5);if(_0x1061de){for(var _0x200180 in _0x1061de){if(_0x1061de[_0x4206('0x9d')](_0x200180)){this[_0x4206('0xd')][_0x4206('0xac')](util[_0x4206('0x2c')](_0x4206('0x130'),_0x200180[_0x4206('0x77')]()),_0x1061de[_0x200180]);}}return this[_0x4206('0xd')]['noop'](util[_0x4206('0x2c')](_0x4206('0x131'),JSON[_0x4206('0x80')](_0x1061de)));}}return _0x2e8708;};AGIVertices['prototype'][_0x4206('0x132')]=function(_0x234d9d){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x133'),_0x234d9d[_0x4206('0xb2')]));if(!this['isConfigured'](_0x234d9d[_0x4206('0x99')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0x134'));}if(!this[_0x4206('0x8d')](_0x234d9d[_0x4206('0x9a')])){return this['channel'][_0x4206('0xb5')](_0x4206('0x135'));}var _0x38400a=_0x4206('0x136');var _0x57399b=util['format'](_0x4206('0x12b'),FILES_PATH,rs['generate'](0x4));var _0xd589ed=util[_0x4206('0x2c')](_0x4206('0xa5'),_0x57399b,_0x38400a);var _0x31b25e=!![];if(_0x234d9d[_0x4206('0x137')]===_0x4206('0x12c')){_0x31b25e=![];}var _0x469508=this['channel'][_0x4206('0x12d')](_0x57399b,_0x38400a,_0x234d9d[_0x4206('0x12e')],_0x234d9d[_0x4206('0x73')],undefined,_0x31b25e);if(_0x469508[_0x4206('0xaa')]!==-0x1){this['channel']['noop'](util[_0x4206('0x2c')]('tilde\x20%s\x20file\x20created',_0xd589ed));var _0x42aa83=this[_0x4206('0x98')][_0x4206('0xae')](this,_0x234d9d,_0xd589ed);if(_0x42aa83){for(var _0x52a353 in _0x42aa83){if(_0x42aa83[_0x4206('0x9d')](_0x52a353)){this['channel'][_0x4206('0xac')](util['format'](_0x4206('0x138'),_0x52a353[_0x4206('0x77')]()),_0x42aa83[_0x52a353]);}}return this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x139'),JSON[_0x4206('0x80')](_0x42aa83)));}}return _0x469508;};AGIVertices['prototype'][_0x4206('0x13a')]=function(_0x4f39e8){logger[_0x4206('0x32')](util[_0x4206('0x2c')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x4f39e8[_0x4206('0xb2')]));return this[_0x4206('0xd')][_0x4206('0x13b')](_0x4f39e8[_0x4206('0x41')],_0x4f39e8[_0x4206('0x13c')],_0x4f39e8[_0x4206('0x42')]);};AGIVertices[_0x4206('0x10')][_0x4206('0x13d')]=function(_0x48ef77){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x13e'),_0x48ef77['label']));if(!this['isConfigured'](_0x48ef77[_0x4206('0x13f')])){return this[_0x4206('0xd')][_0x4206('0x30')](_0x48ef77,_0x4206('0x140'));}try{var _0x571d3d=eval(_0x48ef77[_0x4206('0x13f')])?_0x4206('0x141'):'false';this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x142'),_0x48ef77[_0x4206('0x13f')],_0x571d3d));return{'code':0xc8,'result':_0x571d3d};}catch(_0x4930af){return{'code':0xc8,'result':_0x4206('0x143')};}};AGIVertices[_0x4206('0x10')][_0x4206('0x144')]=function(_0x387aa6){logger[_0x4206('0x32')](util[_0x4206('0x2c')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x387aa6[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x387aa6[_0x4206('0x145')])){return this[_0x4206('0xd')][_0x4206('0x30')](_0x387aa6,_0x4206('0x146'));}var _0x1b6f72=this[_0x4206('0x147')][_0x4206('0xae')](this,_0x387aa6['interval_id']);if(!_0x1b6f72){return this[_0x4206('0xd')][_0x4206('0x30')](_0x387aa6,_0x4206('0x148'));}for(var _0x640682=0x0;_0x640682<_0x1b6f72['length'];_0x640682+=0x1){var _0x47ced1=this[_0x4206('0xd')][_0x4206('0x11')](util['format'](_0x4206('0x149'),_0x1b6f72[_0x640682]));if(_0x47ced1[_0x4206('0xaa')]===-0x1){return _0x47ced1;}logger['info'](util[_0x4206('0x2c')]('IFTIME\x20%s\x20%s',_0x1b6f72[_0x640682],_0x47ced1[_0x4206('0xa8')]));if(_0x47ced1[_0x4206('0xa8')]==='true'){logger['info'](util['format'](_0x4206('0x14a'),_0x1b6f72[_0x640682],_0x4206('0x141')));this['channel']['noop'](util[_0x4206('0x2c')](_0x4206('0x14a'),_0x1b6f72[_0x640682],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x4206('0x2c')](_0x4206('0x14a'),_0x1b6f72[_0x640682],_0x4206('0x143')));this[_0x4206('0xd')]['noop'](util[_0x4206('0x2c')](_0x4206('0x14a'),_0x1b6f72[_0x640682],_0x4206('0x143')));}}return{'code':0xc8,'result':_0x4206('0x143')};};AGIVertices[_0x4206('0x10')]['hangup']=function(_0x5c2b99){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x14b'),_0x5c2b99[_0x4206('0xb2')]));return this[_0x4206('0xd')][_0x4206('0x14c')]();};AGIVertices[_0x4206('0x10')][_0x4206('0x14d')]=function(_0x43f02e){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x14e'),_0x43f02e[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x43f02e[_0x4206('0x86')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xec'));}var _0x5aa2a9=_0x4206('0x136');var _0x4614c4=util[_0x4206('0x2c')](_0x4206('0x12b'),FILES_PATH,rs['generate'](0x4));var _0x8b19c8=util[_0x4206('0x2c')](_0x4206('0xa5'),_0x4614c4,_0x5aa2a9);var _0x19910a=!![];if(_0x43f02e[_0x4206('0x137')]==='NOBEEP'){_0x19910a=![];}var _0x24f63c=this[_0x4206('0xd')][_0x4206('0x12d')](_0x4614c4,_0x5aa2a9,_0x43f02e[_0x4206('0x12e')],_0x43f02e[_0x4206('0x73')],undefined,_0x19910a);if(_0x24f63c[_0x4206('0xaa')]!==-0x1){this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x14f'),_0x8b19c8));var _0x182aa9=this[_0x4206('0x8b')][_0x4206('0xae')](this,_0x43f02e,_0x8b19c8);if(_0x182aa9){for(var _0xcac88c in _0x182aa9){if(_0x182aa9[_0x4206('0x9d')](_0xcac88c)){this[_0x4206('0xd')][_0x4206('0xac')](util['format']('ISPEECH_ASR_%s',_0xcac88c['toUpperCase']()),_0x182aa9[_0xcac88c]);}}return this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x150'),JSON[_0x4206('0x80')](_0x182aa9)));}}return _0x24f63c;};AGIVertices[_0x4206('0x10')][_0x4206('0x151')]=function(_0x1087d5){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x152'),_0x1087d5['label']));if(!this[_0x4206('0x8d')](_0x1087d5[_0x4206('0x86')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xec'));}if(!this[_0x4206('0x8d')](_0x1087d5[_0x4206('0x68')])){return this[_0x4206('0xd')]['noop'](_0x4206('0xb3'));}this[_0x4206('0xd')][_0x4206('0xb5')](util['format'](_0x4206('0x153'),_0x1087d5[_0x4206('0x68')]));var _0x3c611d=this[_0x4206('0x89')]['sync'](this,_0x1087d5);if(_0x3c611d){this['channel'][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x14f'),_0x3c611d));var _0x4535eb=this[_0x4206('0xd')][_0x4206('0xfe')](_0x3c611d,_0x1087d5[_0x4206('0x12e')]);try{fs[_0x4206('0xff')](_0x3c611d+_0x4206('0x100'));}catch(_0x1496ac){logger[_0x4206('0x30')](_0x1496ac);}return _0x4535eb;}return this[_0x4206('0xd')][_0x4206('0x30')](_0x1087d5,_0x4206('0x154'));};AGIVertices['prototype']['login']=function(_0x3ad6e8){logger['info'](util[_0x4206('0x2c')](_0x4206('0x155'),_0x3ad6e8[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x3ad6e8[_0x4206('0x156')])){return this[_0x4206('0xd')]['error'](_0x3ad6e8,_0x4206('0x157'));}logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x158'),this[_0x4206('0xd')][_0x4206('0x3f')],_0x3ad6e8[_0x4206('0x156')]));var _0x348cad=this[_0x4206('0x159')][_0x4206('0xae')](this,_0x3ad6e8[_0x4206('0x156')]);if(_0x348cad){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x15a'),this['channel'][_0x4206('0x3f')],_0x3ad6e8[_0x4206('0x156')]));this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x15a'),this[_0x4206('0xd')][_0x4206('0x3f')],_0x3ad6e8[_0x4206('0x156')]));return{'code':0xc8,'result':_0x4206('0x15b')};}else{logger[_0x4206('0x32')](util['format'](_0x4206('0x15c'),this[_0x4206('0xd')][_0x4206('0x3f')],_0x3ad6e8[_0x4206('0x156')]));this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x15c'),this['channel'][_0x4206('0x3f')],_0x3ad6e8[_0x4206('0x156')]));return{'code':0xc8,'result':_0x4206('0x15d')};}};AGIVertices[_0x4206('0x10')][_0x4206('0x15e')]=function(_0x274c2b){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x15f'),_0x274c2b[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x274c2b['findBy'])){return this[_0x4206('0xd')][_0x4206('0x30')](_0x274c2b,_0x4206('0x157'));}logger[_0x4206('0x32')](util['format'](_0x4206('0x158'),this[_0x4206('0xd')][_0x4206('0x3f')],_0x274c2b[_0x4206('0x156')]));var _0x466f47=this[_0x4206('0x5d')]['sync'](this,_0x274c2b['findBy']);if(_0x466f47){logger[_0x4206('0x32')](util['format'](_0x4206('0x15a'),this[_0x4206('0xd')][_0x4206('0x3f')],_0x274c2b[_0x4206('0x156')]));this[_0x4206('0xd')]['noop'](util[_0x4206('0x2c')](_0x4206('0x15a'),this[_0x4206('0xd')]['callerid'],_0x274c2b['findBy']));return{'code':0xc8,'result':_0x4206('0x15b')};}else{logger[_0x4206('0x32')](util['format'](_0x4206('0x15c'),this[_0x4206('0xd')][_0x4206('0x3f')],_0x274c2b['findBy']));this['channel'][_0x4206('0xb5')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x4206('0x3f')],_0x274c2b[_0x4206('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4206('0x10')][_0x4206('0x160')]=function(_0x4a905f){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x161'),_0x4a905f[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x4a905f['operation'])){return this[_0x4206('0xd')][_0x4206('0x30')](_0x4a905f,'no\x20operation\x20configured');}this['channel'][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x162'),_0x4a905f['operation']));var _0x1b0572=eval(_0x4a905f[_0x4206('0x163')]);if(!this[_0x4206('0x8d')](_0x4a905f['variable_id'])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xde'));}var _0xee1f88=this[_0x4206('0x11')]['sync'](this,_0x4a905f[_0x4206('0xdd')]);if(!_0xee1f88){return this['channel'][_0x4206('0x30')](_0x4a905f,_0x4206('0x113'));}if(_[_0x4206('0xa2')](_0x1b0572)){var _0x282c5b=this;_0x1b0572['forEach'](function(_0x185c68,_0x36ba98){_0x282c5b[_0x4206('0xd')][_0x4206('0xac')](util[_0x4206('0x2c')](_0x4206('0x164'),_0xee1f88,_0x36ba98),_0x185c68);});return this['channel']['noop'](util['format'](_0x4206('0x165'),_0xee1f88));}else{return this['channel'][_0x4206('0xac')](_0xee1f88,_0x1b0572);}};AGIVertices[_0x4206('0x10')]['menu']=function(_0x3c5460){logger[_0x4206('0x32')](util[_0x4206('0x2c')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x3c5460['label']));if(_0x3c5460[_0x4206('0xaf')]===0x0){return this[_0x4206('0xad')](_0x3c5460);}_0x3c5460['retry']-=0x1;if(!this[_0x4206('0x8d')](_0x3c5460[_0x4206('0x10d')])){return this['channel']['error'](_0x3c5460,_0x4206('0x10e'));}var _0x252759=this[_0x4206('0x20')][_0x4206('0xae')](this,_0x3c5460[_0x4206('0x10d')]);if(!_0x252759){return this[_0x4206('0xd')]['error'](_0x3c5460,_0x4206('0x10f'));}var _0x1be609=this['channel'][_0x4206('0x166')](_0x252759,_0x3c5460[_0x4206('0x167')],_0x3c5460[_0x4206('0x168')]);var _0x3f728c=_0x1be609[_0x4206('0xaa')];if(_0x1be609[_0x4206('0xaa')]===-0x1){this['createSquareDetailsReport'][_0x4206('0xae')](this,_0x3c5460,'-1');return _0x1be609;}else if(_0x1be609[_0x4206('0xa8')]===_0x4206('0x73')){_0x1be609[_0x4206('0xaa')]=_0x1be609[_0x4206('0xaa')][_0x4206('0xa3')]>0x0?_0x1be609[_0x4206('0xaa')]:'t';}else if(_[_0x4206('0x49')](_0x1be609[_0x4206('0xaa')])){_0x1be609[_0x4206('0xaa')]='#';_0x3f728c='#';}if(!this[_0x4206('0x8d')](_0x3c5460[_0x4206('0xdd')])){this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xde'));}else{var _0x1212de=this[_0x4206('0x11')][_0x4206('0xae')](this,_0x3c5460['variable_id']);if(!_0x1212de){return this[_0x4206('0xd')][_0x4206('0x30')](_0x3c5460,_0x4206('0x113'));}this[_0x4206('0xd')][_0x4206('0xac')](_0x1212de,_0x3f728c);}this[_0x4206('0x3a')][_0x4206('0xae')](this,_0x3c5460,_0x3f728c);return _0x1be609;};AGIVertices[_0x4206('0x10')][_0x4206('0xb5')]=function(_0x3d066e){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x169'),_0x3d066e[_0x4206('0xb2')]));return this[_0x4206('0xd')][_0x4206('0xb5')](_0x3d066e[_0x4206('0x16a')]||_0x3d066e[_0x4206('0xb2')]);};AGIVertices[_0x4206('0x10')][_0x4206('0x16b')]=function(_0x3075f7){logger[_0x4206('0x32')](util[_0x4206('0x2c')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x3075f7['label']));if(!this[_0x4206('0x8d')](_0x3075f7[_0x4206('0x156')])){return this['channel']['error'](_0x3075f7,_0x4206('0x157'));}logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x158'),this[_0x4206('0xd')][_0x4206('0x3f')],_0x3075f7[_0x4206('0x156')]));var _0x5a71bc=this['getPause'][_0x4206('0xae')](this,_0x3075f7[_0x4206('0x16c')]);var _0x34f1dd=this[_0x4206('0x5b')][_0x4206('0xae')](this,_0x3075f7[_0x4206('0x156')],_0x5a71bc);if(_0x34f1dd){logger['info'](util[_0x4206('0x2c')](_0x4206('0x15a'),this[_0x4206('0xd')]['callerid'],_0x3075f7[_0x4206('0x156')]));this[_0x4206('0xd')]['noop'](util[_0x4206('0x2c')](_0x4206('0x15a'),this[_0x4206('0xd')][_0x4206('0x3f')],_0x3075f7[_0x4206('0x156')]));return{'code':0xc8,'result':'success'};}else{logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x15c'),this[_0x4206('0xd')][_0x4206('0x3f')],_0x3075f7[_0x4206('0x156')]));this['channel'][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x15a'),this[_0x4206('0xd')][_0x4206('0x3f')],_0x3075f7['findBy']));return{'code':0xc8,'result':_0x4206('0x15d')};}};AGIVertices[_0x4206('0x10')]['playback']=function(_0x321b3b){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x16d'),_0x321b3b[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x321b3b['file_id'])){return this['channel'][_0x4206('0x30')](_0x321b3b,_0x4206('0x10e'));}var _0x1780bc=this[_0x4206('0x20')][_0x4206('0xae')](this,_0x321b3b['file_id']);if(!_0x1780bc){return this[_0x4206('0xd')][_0x4206('0x30')](_0x321b3b,_0x4206('0x10f'));}var _0x4424fe=this['channel'][_0x4206('0x62')](_0x4206('0x16e'),[_0x1780bc,_0x321b3b[_0x4206('0xe7')]]);if(_0x4424fe[_0x4206('0xaa')]===-0x1){return _0x4424fe;}return this['channel'][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0xcc'),'PLAYBACK',_0x1780bc));};AGIVertices[_0x4206('0x10')][_0x4206('0x16f')]=function(_0x5b5bfd){logger[_0x4206('0x32')](util['format'](_0x4206('0x170'),_0x5b5bfd[_0x4206('0xb2')]));if(!this['isConfigured'](_0x5b5bfd['queue_id'])){return this[_0x4206('0xd')][_0x4206('0x30')](_0x5b5bfd,_0x4206('0x171'));}var _0x4ce108='';var _0x989ee=parseInt(_0x5b5bfd[_0x4206('0x172')],0xa);if(isNaN(_0x989ee)){_0x4ce108=_0x5b5bfd[_0x4206('0x172')];}else{_0x4ce108=this[_0x4206('0x13')][_0x4206('0xae')](this,_0x5b5bfd['queue_id']);if(!_0x4ce108){return this[_0x4206('0xd')][_0x4206('0x30')](_0x5b5bfd,_0x4206('0x173'));}}var _0x6bddbc='';if(this[_0x4206('0x8d')](_0x5b5bfd[_0x4206('0x10d')])){var _0x71faf4=this['getSound'][_0x4206('0xae')](this,_0x5b5bfd[_0x4206('0x10d')]);if(_0x71faf4){_0x6bddbc=_0x71faf4;}}this[_0x4206('0x3a')]['sync'](this,_0x5b5bfd,_0x4ce108);if(_0x5b5bfd['opts'][_0x4206('0x174')]('x')<0x0){_0x5b5bfd[_0x4206('0xe7')]+='x';}if(_0x5b5bfd[_0x4206('0xe7')][_0x4206('0x174')]('X')<0x0){_0x5b5bfd[_0x4206('0xe7')]+='X';}this['channel']['setVariable'](_0x4206('0x175'),_0x4ce108?_0x4ce108['toLowerCase']():'');var _0x475990=this[_0x4206('0xd')][_0x4206('0x62')](_0x4206('0x176'),[_0x4ce108,_0x5b5bfd[_0x4206('0xe7')],_0x5b5bfd[_0x4206('0x71')],_0x6bddbc,_0x5b5bfd[_0x4206('0x73')],_0x5b5bfd[_0x4206('0x8')],_0x5b5bfd[_0x4206('0x177')],_0x5b5bfd[_0x4206('0x178')],'',_0x5b5bfd['position']]);if(_0x475990[_0x4206('0xaa')]===-0x1){return _0x475990;}return this['channel']['noop'](util['format'](_0x4206('0xcc'),_0x4206('0x176'),_0x4ce108));};AGIVertices['prototype']['record']=function(_0x5276ae){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x179'),_0x5276ae[_0x4206('0xb2')]));var _0x538c4c=_0x5276ae[_0x4206('0x17a')]||_0x4206('0x136');var _0x6004a6=util[_0x4206('0x2c')](_0x4206('0x17b'),this['channel'][_0x4206('0x3b')],rs[_0x4206('0x115')](0x5));var _0x49a6c4=util['format'](_0x4206('0x17c'),FILES_PATH,_0x6004a6,_0x538c4c);var _0x51b836=util[_0x4206('0x2c')](_0x4206('0x12b'),FILES_PATH,_0x6004a6);this[_0x4206('0x3e')][_0x4206('0xae')](this,_0x5276ae,_0x6004a6,_0x49a6c4);this[_0x4206('0xd')][_0x4206('0xac')](_0x4206('0x17d'),_0x6004a6);logger[_0x4206('0x32')](_0x4206('0x17e'),_0x51b836,_0x538c4c,_0x5276ae['escape_digits'],_0x5276ae['timeout']);return this[_0x4206('0xd')]['recordFile'](_0x51b836,_0x538c4c,_0x5276ae['escape_digits'],_0x5276ae['timeout'],undefined,!![]);};AGIVertices[_0x4206('0x10')]['restapi']=function(_0xa3a56a){logger[_0x4206('0x32')](util[_0x4206('0x2c')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0xa3a56a[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0xa3a56a['url'])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0x17f'));}var _0x5b5fff=this[_0x4206('0x70')][_0x4206('0xae')](this,_0xa3a56a);logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x180'),util['inspect'](_0x5b5fff,{'showHidden':![],'depth':null})));if(!this[_0x4206('0x8d')](_0xa3a56a[_0x4206('0xdd')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0x181'));}var _0x183044=this[_0x4206('0x11')][_0x4206('0xae')](this,_0xa3a56a[_0x4206('0xdd')]);if(!_0x183044){return this[_0x4206('0xd')][_0x4206('0x30')](_0xa3a56a,_0x4206('0x113'));}this[_0x4206('0xd')]['setVariable'](util['format'](_0x4206('0x182'),_0x183044),_0x5b5fff[_0x4206('0x82')]?_0x5b5fff[_0x4206('0x82')]:_0x4206('0x183'));this[_0x4206('0xd')][_0x4206('0xac')](util[_0x4206('0x2c')]('%s_STATUS_MESSAGE',_0x183044),_0x5b5fff[_0x4206('0x83')]?_0x5b5fff[_0x4206('0x83')]:'OK');if(_0x5b5fff['body']){try{this[_0x4206('0xa6')](_0x5b5fff[_0x4206('0x81')],_0x183044);}catch(_0xc8a3d){logger[_0x4206('0x30')](util[_0x4206('0x2c')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x183044));}}return this[_0x4206('0xd')]['noop'](util['format'](_0x4206('0xe0'),_0x183044));};AGIVertices[_0x4206('0x10')][_0x4206('0x184')]=function(_0x3f5040){logger['info'](util[_0x4206('0x2c')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x3f5040[_0x4206('0xb2')]));return this['channel'][_0x4206('0x185')](_0x3f5040[_0x4206('0x186')][_0x4206('0x64')](/\s+/g,''),_0x3f5040[_0x4206('0x187')]);};AGIVertices[_0x4206('0x10')][_0x4206('0x188')]=function(_0x2ecf82){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x189'),_0x2ecf82[_0x4206('0xb2')]));return this[_0x4206('0xd')]['sayNumber'](_0x2ecf82[_0x4206('0x74')][_0x4206('0x64')](/\s+/g,''),_0x2ecf82[_0x4206('0x187')]);};AGIVertices[_0x4206('0x10')][_0x4206('0x18a')]=function(_0x5aa784){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x18b'),_0x5aa784['label']));return this[_0x4206('0xd')][_0x4206('0x18c')](_0x5aa784[_0x4206('0x68')],_0x5aa784['escape_digits']);};AGIVertices[_0x4206('0x10')]['sendMail']=function(_0x13b1b3){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x18d'),_0x13b1b3[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x13b1b3[_0x4206('0x18e')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0x18f'));}var _0x1929e1=this[_0x4206('0x24')][_0x4206('0xae')](this,_0x13b1b3[_0x4206('0x18e')]);if(!_0x1929e1||!_0x1929e1[_0x4206('0x190')]){return this[_0x4206('0xd')][_0x4206('0x30')](_0x13b1b3,_0x4206('0x191'));}var _0x5742e5={'from':util[_0x4206('0x2c')](_0x4206('0x192'),_0x1929e1[_0x4206('0x16')],_0x1929e1[_0x4206('0x193')]||_0x1929e1['Smtp'][_0x4206('0x194')]),'to':_0x13b1b3['to']||'','cc':_0x13b1b3['cc']||'','bcc':_0x13b1b3[_0x4206('0x195')]||'','subject':_0x13b1b3[_0x4206('0x196')],'html':_0x13b1b3[_0x4206('0x68')],'text':_0x13b1b3[_0x4206('0x68')]};var _0x3be493={'tls':{'rejectUnauthorized':![]}};if(_0x1929e1[_0x4206('0x190')][_0x4206('0x197')]){_0x3be493[_0x4206('0x197')]=_0x1929e1[_0x4206('0x190')][_0x4206('0x197')];}else{_0x3be493[_0x4206('0x198')]=_0x1929e1[_0x4206('0x190')]['host'];_0x3be493[_0x4206('0x199')]=_0x1929e1[_0x4206('0x190')][_0x4206('0x199')];_0x3be493[_0x4206('0x19a')]=_0x1929e1[_0x4206('0x190')][_0x4206('0x19a')];}if(_0x1929e1[_0x4206('0x190')][_0x4206('0x19b')]){_0x3be493[_0x4206('0x19c')]={'user':_0x1929e1['Smtp'][_0x4206('0x194')],'pass':_0x1929e1[_0x4206('0x190')]['pass']};}if(this[_0x4206('0x8d')](_0x13b1b3[_0x4206('0x19d')])){}logger['debug'](_0x4206('0x19e'),JSON['stringify'](_0x5742e5));this[_0x4206('0x3a')][_0x4206('0xae')](this,_0x13b1b3,_0x13b1b3[_0x4206('0x18e')]);this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x19f'),_0x1929e1[_0x4206('0x16')]));this['sendMailMessage'][_0x4206('0xae')](this,_0x3be493,_0x5742e5);return this['channel'][_0x4206('0xb5')](_0x4206('0x1a0'));};AGIVertices[_0x4206('0x10')][_0x4206('0x1a1')]=function(_0x387f54){logger['info'](util[_0x4206('0x2c')](_0x4206('0x1a2'),_0x387f54[_0x4206('0xb2')]));return this[_0x4206('0xd')]['noop'](_0x4206('0x1a3'));};AGIVertices[_0x4206('0x10')][_0x4206('0x1a4')]=function(_0x316e55){logger[_0x4206('0x32')](util[_0x4206('0x2c')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x316e55[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x316e55[_0x4206('0x1a5')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0x1a6'));}var _0x213b71=this[_0x4206('0x1a7')][_0x4206('0xae')](this,_0x316e55[_0x4206('0x1a5')]);if(!_0x213b71){return this[_0x4206('0xd')]['error'](_0x316e55,_0x4206('0x1a8'));}var _0x34cd6b={'body':_0x316e55[_0x4206('0x1a9')],'phone':_0x316e55['to']||'','SmsAccountId':_0x213b71['id']};logger['debug'](_0x4206('0x1aa'),JSON[_0x4206('0x80')](_0x34cd6b));this['createSquareDetailsReport'][_0x4206('0xae')](this,_0x316e55,_0x316e55[_0x4206('0x1a5')]);this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x1ab'),_0x213b71['name']));this['createSmsMessage']['sync'](this,_0x34cd6b);return this[_0x4206('0xd')][_0x4206('0xb5')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x4206('0x10')]['set']=function(_0x42ce36){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x1ac'),_0x42ce36[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x42ce36[_0x4206('0xdd')])){return this[_0x4206('0xd')]['error'](_0x42ce36,_0x4206('0x1ad'));}var _0x447926=this[_0x4206('0x11')][_0x4206('0xae')](this,_0x42ce36['variable_id']);if(!_0x447926){return this[_0x4206('0xd')][_0x4206('0x30')](_0x42ce36,_0x4206('0x113'));}return this[_0x4206('0xd')][_0x4206('0xac')](_0x447926,_0x42ce36[_0x4206('0x1ae')]);};AGIVertices['prototype'][_0x4206('0x1af')]=function(_0x532fe2){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x1b0'),_0x532fe2['label']));this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0x1b1'));if(_0x532fe2['answer']===_0x4206('0x1b2')){this[_0x4206('0xd')][_0x4206('0xb5')]('Answer');return this['channel']['answer']();}return this[_0x4206('0xd')][_0x4206('0xb5')]('Skipped\x20Answer');};AGIVertices[_0x4206('0x10')][_0x4206('0x1b3')]=function(_0x34531b){logger['info'](util[_0x4206('0x2c')](_0x4206('0x1b4'),_0x34531b[_0x4206('0xb2')]));if(!this[_0x4206('0x8d')](_0x34531b[_0x4206('0x1b5')])){return this['channel']['error'](_0x34531b,_0x4206('0x1b6'));}var _0x17c76d=this[_0x4206('0x1b7')][_0x4206('0xae')](this,_0x34531b[_0x4206('0x1b5')]);if(!this['isConfigured'](_0x17c76d)){return this[_0x4206('0xd')][_0x4206('0x30')](_0x34531b,util[_0x4206('0x2c')](_0x4206('0x1b8'),_0x34531b[_0x4206('0x1b5')]));}if(_0x17c76d===this[_0x4206('0xd')][_0x4206('0x3d')]){return this[_0x4206('0xd')][_0x4206('0x30')](_0x34531b,_0x4206('0x1b9'));}this[_0x4206('0x3a')]['sync'](this,_0x34531b,_0x17c76d);var _0x2ec947=this[_0x4206('0xd')]['exec'](_0x4206('0x1ba'),util[_0x4206('0x2c')](_0x4206('0x1bb'),config[_0x4206('0x8')][_0x4206('0x198')]||_0x4206('0x1bc'),_0x17c76d,this[_0x4206('0xd')][_0x4206('0x3d')]));if(_0x2ec947[_0x4206('0xaa')]===-0x1){return _0x2ec947;}return this[_0x4206('0xd')][_0x4206('0xb5')](util['format'](_0x4206('0xcc'),_0x4206('0x1ba'),_0x17c76d));};AGIVertices[_0x4206('0x10')]['system']=function(_0x544719){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x1bd'),_0x544719[_0x4206('0xb2')]));var _0x36fcd9=this['shellCommand'][_0x4206('0xae')](this,_0x544719[_0x4206('0xc1')]);this[_0x4206('0x3a')][_0x4206('0xae')](this,_0x544719,_0x544719[_0x4206('0xc1')]);if(this['isConfigured'](_0x544719[_0x4206('0xdd')])){var _0xecde71=this[_0x4206('0x11')][_0x4206('0xae')](this,_0x544719[_0x4206('0xdd')]);if(_0xecde71){this[_0x4206('0xd')]['setVariable'](_0xecde71,_0x36fcd9);return this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x1be'),_0x544719[_0x4206('0xc1')],_0xecde71));}}return this['channel'][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x1bf'),_0x544719['command']));};AGIVertices[_0x4206('0x10')][_0x4206('0x1c0')]=function(_0x3cd243){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x1c1'),_0x3cd243[_0x4206('0xb2')]));_0x3cd243[_0x4206('0x68')]=_0x3cd243[_0x4206('0x68')][_0x4206('0x64')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4206('0x8d')](_0x3cd243[_0x4206('0x66')])){return this[_0x4206('0xd')]['noop'](_0x4206('0x1c2'));}if(!this['isConfigured'](_0x3cd243[_0x4206('0x68')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xb3'));}this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')](_0x4206('0x1c3'),_0x3cd243[_0x4206('0x68')]));var _0xf5062c=this[_0x4206('0x65')]['sync'](this,_0x3cd243);if(_0xf5062c){this[_0x4206('0xd')]['noop'](util[_0x4206('0x2c')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0xf5062c));var _0x269e8e=this[_0x4206('0xd')][_0x4206('0xfe')](_0xf5062c);try{fs[_0x4206('0xff')](_0xf5062c+_0x4206('0x100'));}catch(_0xa19e30){logger['error'](_0xa19e30);}return _0x269e8e;}return this[_0x4206('0xd')][_0x4206('0x30')](_0x3cd243,_0x4206('0x1c4'));};AGIVertices[_0x4206('0x10')][_0x4206('0x1c5')]=function(_0x2375e8){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x1c6'),_0x2375e8[_0x4206('0xb2')]));_0x2375e8[_0x4206('0x68')]=_0x2375e8['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x4206('0x8d')](_0x2375e8[_0x4206('0x68')])){return this[_0x4206('0xd')][_0x4206('0xb5')](_0x4206('0xb3'));}this[_0x4206('0xd')]['noop'](util[_0x4206('0x2c')](_0x4206('0x1c7'),_0x2375e8[_0x4206('0x68')]));var _0x3029d2=this[_0x4206('0x6e')]['sync'](this,_0x2375e8);if(_0x3029d2){this[_0x4206('0xd')]['noop'](util[_0x4206('0x2c')](_0x4206('0x1c8'),_0x3029d2));var _0x48968b=this[_0x4206('0xd')][_0x4206('0xfe')](_0x3029d2);try{fs[_0x4206('0xff')](_0x3029d2+_0x4206('0x100'));}catch(_0x53fc58){logger[_0x4206('0x30')](_0x53fc58);}return _0x48968b;}return this[_0x4206('0xd')][_0x4206('0x30')](_0x2375e8,_0x4206('0x1c9'));};AGIVertices[_0x4206('0x10')]['unpause']=function(_0x2b3992){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x1ca'),_0x2b3992['label']));if(!this['isConfigured'](_0x2b3992[_0x4206('0x156')])){return this[_0x4206('0xd')][_0x4206('0x30')](_0x2b3992,_0x4206('0x157'));}logger[_0x4206('0x32')](util['format'](_0x4206('0x158'),this['channel'][_0x4206('0x3f')],_0x2b3992[_0x4206('0x156')]));var _0x205cf3=this['agentUnpause']['sync'](this,_0x2b3992[_0x4206('0x156')]);if(_0x205cf3){logger[_0x4206('0x32')](util['format'](_0x4206('0x15a'),this['channel'][_0x4206('0x3f')],_0x2b3992[_0x4206('0x156')]));this['channel']['noop'](util[_0x4206('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4206('0xd')]['callerid'],_0x2b3992[_0x4206('0x156')]));return{'code':0xc8,'result':_0x4206('0x15b')};}else{logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x15c'),this[_0x4206('0xd')][_0x4206('0x3f')],_0x2b3992[_0x4206('0x156')]));this[_0x4206('0xd')][_0x4206('0xb5')](util['format'](_0x4206('0x15c'),this[_0x4206('0xd')][_0x4206('0x3f')],_0x2b3992['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4206('0x10')][_0x4206('0x1cb')]=function(_0x583d30){logger[_0x4206('0x32')](util['format'](_0x4206('0x1cc'),_0x583d30[_0x4206('0xb2')]));var _0xacd276=this[_0x4206('0xd')][_0x4206('0x62')](_0x4206('0x1cd'),[_0x583d30[_0x4206('0x1ce')],_0x583d30[_0x4206('0x84')]]);if(_0xacd276[_0x4206('0xaa')]===-0x1){return _0xacd276;}return this[_0x4206('0xd')][_0x4206('0xb5')](util[_0x4206('0x2c')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x583d30['mailbox']));};AGIVertices[_0x4206('0x10')][_0x4206('0x1cf')]=function(_0x1dea2b){logger[_0x4206('0x32')](util[_0x4206('0x2c')](_0x4206('0x1d0'),_0x1dea2b['label']));if(!this['isConfigured'](_0x1dea2b['variable_id'])){return this['channel'][_0x4206('0x30')](_0x1dea2b,'no\x20variable\x20selected');}var _0x386efe=this['getVariable'][_0x4206('0xae')](this,_0x1dea2b[_0x4206('0xdd')]);if(!_0x386efe){return this[_0x4206('0xd')][_0x4206('0x30')](_0x1dea2b,_0x4206('0x113'));}var _0x1196f8=this[_0x4206('0xd')][_0x4206('0x11')](_0x386efe);return{'code':0xc8,'result':_0x1196f8[_0x4206('0xa8')]?_0x1196f8[_0x4206('0xa8')]:'-'};};String[_0x4206('0x10')][_0x4206('0x1d1')]=function(_0xebf48,_0x369a0e){return this[_0x4206('0xa7')](_0xebf48)['join'](_0x369a0e);};module[_0x4206('0x1d2')]=AGIVertices;
\ No newline at end of file
index 1023a7a..503d9d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','channels','interface','queue','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','attended','destlinkedid','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer'];(function(_0x4b4f5d,_0x22e3fb){var _0x4bfb64=function(_0xea48e9){while(--_0xea48e9){_0x4b4f5d['push'](_0x4b4f5d['shift']());}};_0x4bfb64(++_0x22e3fb);}(_0xa41a,0x6b));var _0xaa41=function(_0x5f287c,_0x12ae13){_0x5f287c=_0x5f287c-0x0;var _0xf41400=_0xa41a[_0x5f287c];return _0xf41400;};'use strict';var util=require(_0xaa41('0x0'));var _=require(_0xaa41('0x1'));var moment=require('moment');var ami=require(_0xaa41('0x2'));var logger=require(_0xaa41('0x3'))(_0xaa41('0x4'));var RpcUser=require(_0xaa41('0x5'));var RpcVoiceAgentReport=require(_0xaa41('0x6'));function Acw(_0x3168be){this[_0xaa41('0x7')]=_0x3168be[_0xaa41('0x7')];this['agents']=_0x3168be[_0xaa41('0x8')];this[_0xaa41('0x9')]=_0x3168be['timers'];this['channels']={};ami['on'](_0xaa41('0xa'),this[_0xaa41('0xb')]['bind'](this));ami['on'](_0xaa41('0xc'),this[_0xaa41('0xd')][_0xaa41('0xe')](this));ami['on'](_0xaa41('0xf'),this[_0xaa41('0x10')][_0xaa41('0xe')](this));ami['on'](_0xaa41('0x11'),this[_0xaa41('0x12')][_0xaa41('0xe')](this));ami['on']('attendedtransfer',this[_0xaa41('0x13')][_0xaa41('0xe')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xaa41('0xe')](this));ami['on']('custom:agentConnectPreview',this[_0xaa41('0x14')][_0xaa41('0xe')](this));}function getDiff(_0x2f64bc){var _0x889d44=moment()[_0xaa41('0x15')](0x0);var _0x4eaf81=moment(_0x2f64bc)[_0xaa41('0x15')](0x0);return _0x889d44[_0xaa41('0x16')](_0x4eaf81,_0xaa41('0x17'));}Acw[_0xaa41('0x18')][_0xaa41('0x19')]=function(_0x2005ae){try{var _0x1e1e02=this;var _0x550ad5=this[_0xaa41('0x1a')][_0x2005ae][_0xaa41('0x1b')];var _0x4210fa=this[_0xaa41('0x1a')][_0x2005ae][_0xaa41('0x1c')];var _0xd20ddf=this[_0xaa41('0x7')][_0x4210fa];var _0x46e6d3=![];var _0x150ddf='ACW';if(_0xd20ddf['mandatoryDisposition']){if(_0xd20ddf[_0xaa41('0x1d')][_0xaa41('0x1e')]){_0x46e6d3=!![];_0x150ddf=_0xd20ddf[_0xaa41('0x1d')]['name'];}}ami[_0xaa41('0x1f')]({'action':_0xaa41('0x20'),'interface':_0x550ad5,'paused':!![],'reason':_0x150ddf})['then'](function(_0x513c61){if(_0x1e1e02[_0xaa41('0x8')][_0x550ad5]){return RpcUser['getAgent'](_0x1e1e02[_0xaa41('0x8')][_0x550ad5]['id'])[_0xaa41('0x21')](function(_0x3e2175){if(_0x3e2175&&!_0x3e2175[_0xaa41('0x22')]){logger[_0xaa41('0x23')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x2005ae,_0x550ad5,_0x4210fa);var _0x43c430=_0x1e1e02[_0xaa41('0x1a')][_0x2005ae][_0xaa41('0x24')]&&_0x1e1e02[_0xaa41('0x1a')][_0x2005ae][_0xaa41('0x25')]?_0x1e1e02[_0xaa41('0x1a')][_0x2005ae]['destlinkedid']:_0x2005ae;return RpcUser['savePause'](_0x1e1e02[_0xaa41('0x8')][_0x550ad5],_0x150ddf,_0x43c430)['then'](function(_0x493a10){if(!_0x46e6d3){_0x1e1e02[_0xaa41('0x9')][_0x550ad5]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2005ae,_0x1e1e02[_0xaa41('0x7')][_0x4210fa][_0xaa41('0x26')],_0x550ad5,_0x4210fa);_0x1e1e02[_0xaa41('0x9')][_0x550ad5][_0xaa41('0x27')]=setTimeout(_0x1e1e02[_0xaa41('0x28')][_0xaa41('0xe')](_0x1e1e02,_0x550ad5),_0x1e1e02['voiceQueues'][_0x4210fa][_0xaa41('0x26')]*0x3e8);_0x1e1e02[_0xaa41('0x9')][_0x550ad5][_0xaa41('0x29')]=moment()[_0xaa41('0x2a')](_0xaa41('0x2b'));_0x1e1e02[_0xaa41('0x9')][_0x550ad5][_0xaa41('0x2c')]=_0x2005ae;_0x1e1e02[_0xaa41('0x9')][_0x550ad5]['queue']=_0x4210fa;_0x1e1e02[_0xaa41('0x9')][_0x550ad5]['updateAcw']=function(){var _0x5dad80=getDiff(_0x1e1e02[_0xaa41('0x9')][_0x550ad5][_0xaa41('0x29')]);clearTimeout(_0x1e1e02['timers'][_0x550ad5][_0xaa41('0x27')]);_0x1e1e02[_0xaa41('0x9')][_0x550ad5]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x5dad80},_0x1e1e02['timers'][_0x550ad5][_0xaa41('0x2c')],_0x550ad5)[_0xaa41('0x21')](function(_0x2a186e){logger[_0xaa41('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x2005ae,_0x5dad80,_0x2a186e);})[_0xaa41('0x2d')](function(_0x45c8fe){logger[_0xaa41('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x2005ae,_0x45c8fe);});delete _0x1e1e02[_0xaa41('0x9')][_0x550ad5];};}});}else{logger[_0xaa41('0x23')](_0xaa41('0x2f'),_0x2005ae,_0x550ad5,_0x4210fa);}});}})['catch'](function(_0x252c62){logger[_0xaa41('0x2e')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2005ae,_0x1e1e02[_0xaa41('0x7')][_0x4210fa][_0xaa41('0x26')],_0x550ad5,_0x4210fa);})[_0xaa41('0x30')](function(){delete _0x1e1e02['channels'][_0x2005ae];});}catch(_0x22b272){logger['error'](_0xaa41('0x31'),_0x22b272[_0xaa41('0x32')]);}};Acw[_0xaa41('0x18')]['stopAcw']=function(_0x526377){try{var _0x4cdd42=this;if(_0x4cdd42[_0xaa41('0x9')][_0x526377]){_0x4cdd42[_0xaa41('0x9')][_0x526377][_0xaa41('0x27')]=![];var _0x224eb3=_0x4cdd42['timers'][_0x526377]['uniqueid'];var _0x267999=_0x4cdd42[_0xaa41('0x9')][_0x526377][_0xaa41('0x1c')];var _0x4e8d2e=_0x4cdd42[_0xaa41('0x7')][_0x267999][_0xaa41('0x26')];logger[_0xaa41('0x23')]('[TIMER][STOP][AGENT:%s]',_0x526377);RpcUser[_0xaa41('0x33')](this[_0xaa41('0x8')][_0x526377]);RpcVoiceAgentReport[_0xaa41('0x34')]({'acwtime':_0x4e8d2e,'agentacw':!![]},_0x224eb3,_0x526377)[_0xaa41('0x21')](function(_0x57f1bf){logger['info'](_0xaa41('0x35'),_0x224eb3,_0x4e8d2e,_0x57f1bf);})[_0xaa41('0x2d')](function(_0x5eae08){logger[_0xaa41('0x2e')]('[%s][UPDATE][ERRORS:%s]',_0x224eb3,_0x5eae08);});}else{logger[_0xaa41('0x2e')](_0xaa41('0x36'),_0x526377);if(_0x4cdd42[_0xaa41('0x9')]){logger[_0xaa41('0x23')](_0xaa41('0x37'),JSON[_0xaa41('0x38')](_0x4cdd42[_0xaa41('0x9')]));}}}catch(_0x21f204){logger['error'](_0xaa41('0x39'),_0x21f204[_0xaa41('0x32')]);}};Acw[_0xaa41('0x18')][_0xaa41('0xb')]=function(_0xc84fb8){try{if(this[_0xaa41('0x7')][_0xc84fb8['queue']]&&(this['voiceQueues'][_0xc84fb8[_0xaa41('0x1c')]]['acw']||this[_0xaa41('0x7')][_0xc84fb8[_0xaa41('0x1c')]][_0xaa41('0x3a')])){if(this[_0xaa41('0x8')][_0xc84fb8[_0xaa41('0x1b')]]){this[_0xaa41('0x1a')][_0xc84fb8[_0xaa41('0x2c')]]={'queue':_0xc84fb8['queue'],'interface':_0xc84fb8[_0xaa41('0x1b')],'destlinkedid':_0xc84fb8['destlinkedid']};}}}catch(_0x4dd842){logger[_0xaa41('0x2e')]('[ACW][syncAgentConnect]\x20%s',_0x4dd842['message']);}};Acw['prototype'][_0xaa41('0x14')]=function(_0x525b09){try{if(this[_0xaa41('0x7')][_0x525b09[_0xaa41('0x1c')]]&&(this['voiceQueues'][_0x525b09['queue']][_0xaa41('0x4')]||this[_0xaa41('0x7')][_0x525b09[_0xaa41('0x1c')]][_0xaa41('0x3a')])){if(this[_0xaa41('0x8')][_0x525b09[_0xaa41('0x1b')]]){this[_0xaa41('0x1a')][_0x525b09[_0xaa41('0x2c')]]={'queue':_0x525b09[_0xaa41('0x1c')],'interface':_0x525b09['interface']};}}}catch(_0x2eec35){logger[_0xaa41('0x2e')](_0xaa41('0x3b'),_0x2eec35[_0xaa41('0x32')]);}};Acw[_0xaa41('0x18')][_0xaa41('0xd')]=function(_0x538b12){try{if(this[_0xaa41('0x1a')][_0x538b12[_0xaa41('0x2c')]]&&_[_0xaa41('0x3c')](this[_0xaa41('0x1a')][_0x538b12['uniqueid']][_0xaa41('0x24')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x538b12[_0xaa41('0x2c')]);this[_0xaa41('0x19')](_0x538b12[_0xaa41('0x2c')]);}else if(this['channels'][_0x538b12[_0xaa41('0x3d')]]&&_[_0xaa41('0x3c')](this[_0xaa41('0x1a')][_0x538b12['linkedid']][_0xaa41('0x24')])){logger[_0xaa41('0x23')](_0xaa41('0x3e'),_0x538b12[_0xaa41('0x3d')]);this[_0xaa41('0x19')](_0x538b12[_0xaa41('0x3d')]);}}catch(_0x333a9f){logger[_0xaa41('0x2e')]('[ACW][syncHangupRequest]\x20%s',_0x333a9f[_0xaa41('0x32')]);}};Acw['prototype']['syncHangup']=function(_0x1bdcd6){try{if(this[_0xaa41('0x1a')][_0x1bdcd6[_0xaa41('0x2c')]]&&this[_0xaa41('0x1a')][_0x1bdcd6[_0xaa41('0x2c')]][_0xaa41('0x24')]){logger[_0xaa41('0x23')](_0xaa41('0x3f'),_0x1bdcd6['uniqueid']);this[_0xaa41('0x19')](_0x1bdcd6[_0xaa41('0x2c')]);}else if(this[_0xaa41('0x1a')][_0x1bdcd6['linkedid']]&&this[_0xaa41('0x1a')][_0x1bdcd6[_0xaa41('0x3d')]]['attended']){logger[_0xaa41('0x23')](_0xaa41('0x40'),_0x1bdcd6[_0xaa41('0x3d')]);this['startAcw'](_0x1bdcd6[_0xaa41('0x3d')]);}}catch(_0xc8e626){logger['error']('[ACW][syncHangup]\x20%s',_0xc8e626[_0xaa41('0x32')]);}};Acw[_0xaa41('0x18')][_0xaa41('0x13')]=function(_0x4d20c6){try{if(!_[_0xaa41('0x41')](this[_0xaa41('0x1a')][_0x4d20c6[_0xaa41('0x42')]])){this[_0xaa41('0x19')](_0x4d20c6[_0xaa41('0x42')]);if(this['channels'][_0x4d20c6[_0xaa41('0x43')]]){this['channels'][_0x4d20c6['secondtransfereruniqueid']][_0xaa41('0x24')]=!![];this['channels'][_0x4d20c6[_0xaa41('0x44')]]=this[_0xaa41('0x1a')][_0x4d20c6[_0xaa41('0x43')]];delete this['channels'][_0x4d20c6[_0xaa41('0x43')]];}}else if(!_[_0xaa41('0x41')](this[_0xaa41('0x1a')][_0x4d20c6[_0xaa41('0x44')]])){this[_0xaa41('0x19')](_0x4d20c6[_0xaa41('0x44')]);if(this[_0xaa41('0x1a')][_0x4d20c6[_0xaa41('0x45')]]){this[_0xaa41('0x1a')][_0x4d20c6['origtransfereruniqueid']][_0xaa41('0x24')]=!![];this[_0xaa41('0x1a')][_0x4d20c6[_0xaa41('0x42')]]=this['channels'][_0x4d20c6[_0xaa41('0x45')]];delete this[_0xaa41('0x1a')][_0x4d20c6[_0xaa41('0x45')]];}}}catch(_0x134579){logger[_0xaa41('0x2e')](_0xaa41('0x46'),_0x134579[_0xaa41('0x32')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x5cb34d){try{if(this['channels'][_0x5cb34d['transfereruniqueid']]){logger['info'](_0xaa41('0x47'),JSON['stringify'](_0x5cb34d['transfereruniqueid']));this[_0xaa41('0x19')](_0x5cb34d[_0xaa41('0x48')]);}else if(this[_0xaa41('0x1a')][_0x5cb34d[_0xaa41('0x49')]]){logger['info'](_0xaa41('0x4a'),JSON[_0xaa41('0x38')](_0x5cb34d[_0xaa41('0x49')]));this[_0xaa41('0x19')](_0x5cb34d[_0xaa41('0x49')]);}}catch(_0x41ca40){logger[_0xaa41('0x2e')](_0xaa41('0x4b'),_0x41ca40[_0xaa41('0x32')]);}};Acw['prototype'][_0xaa41('0x12')]=function(_0x2d2af8){try{if(this['voiceQueues'][_0x2d2af8['queue']]&&this['voiceQueues'][_0x2d2af8[_0xaa41('0x1c')]]['autopause']===_0xaa41('0x4c')){if(this['agents'][_0x2d2af8[_0xaa41('0x1b')]]){logger[_0xaa41('0x23')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x2d2af8[_0xaa41('0x2c')],_0x2d2af8[_0xaa41('0x1b')],_0x2d2af8[_0xaa41('0x1c')]);return RpcUser[_0xaa41('0x4d')](this['agents'][_0x2d2af8['interface']],_0xaa41('0x4e'),_0x2d2af8[_0xaa41('0x2c')]);}}}catch(_0x4d6d0c){logger['error'](_0xaa41('0x4f'),_0x4d6d0c[_0xaa41('0x32')]);}};module[_0xaa41('0x50')]=Acw;
\ No newline at end of file
+var _0x81bd=['YYYY-MM-DD\x20HH:mm:ss','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','uniqueid','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','syncAgentConnect','hanguprequest','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','getAgent','then','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x81bd,0x7c));var _0xd81b=function(_0x1e06c4,_0x38a792){_0x1e06c4=_0x1e06c4-0x0;var _0x529a41=_0x81bd[_0x1e06c4];return _0x529a41;};'use strict';var util=require(_0xd81b('0x0'));var _=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var ami=require(_0xd81b('0x3'));var logger=require(_0xd81b('0x4'))(_0xd81b('0x5'));var RpcUser=require(_0xd81b('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x16e8de){this[_0xd81b('0x7')]=_0x16e8de[_0xd81b('0x7')];this['agents']=_0x16e8de[_0xd81b('0x8')];this[_0xd81b('0x9')]=_0x16e8de[_0xd81b('0x9')];this['channels']={};ami['on']('agentconnect',this[_0xd81b('0xa')]['bind'](this));ami['on'](_0xd81b('0xb'),this[_0xd81b('0xc')][_0xd81b('0xd')](this));ami['on'](_0xd81b('0xe'),this[_0xd81b('0xf')][_0xd81b('0xd')](this));ami['on'](_0xd81b('0x10'),this[_0xd81b('0x11')][_0xd81b('0xd')](this));ami['on'](_0xd81b('0x12'),this[_0xd81b('0x13')][_0xd81b('0xd')](this));ami['on'](_0xd81b('0x14'),this['syncBlindTransfer'][_0xd81b('0xd')](this));ami['on']('custom:agentConnectPreview',this[_0xd81b('0x15')][_0xd81b('0xd')](this));}function getDiff(_0x5f0b6b){var _0x35a053=moment()['milliseconds'](0x0);var _0x13dd00=moment(_0x5f0b6b)[_0xd81b('0x16')](0x0);return _0x35a053[_0xd81b('0x17')](_0x13dd00,_0xd81b('0x18'));}Acw[_0xd81b('0x19')]['startAcw']=function(_0x1c620d){try{var _0x27b7a0=this;var _0x5c2863=this[_0xd81b('0x1a')][_0x1c620d][_0xd81b('0x1b')];var _0x4657cf=this[_0xd81b('0x1a')][_0x1c620d][_0xd81b('0x1c')];var _0xc49b8d=this[_0xd81b('0x7')][_0x4657cf];var _0x3d4d34=![];var _0x1c34c5=_0xd81b('0x1d');if(_0xc49b8d[_0xd81b('0x1e')]){if(_0xc49b8d[_0xd81b('0x1f')][_0xd81b('0x20')]){_0x3d4d34=!![];_0x1c34c5=_0xc49b8d[_0xd81b('0x1f')][_0xd81b('0x20')];}}ami[_0xd81b('0x21')]({'action':'QueuePause','interface':_0x5c2863,'paused':!![],'reason':_0x1c34c5})['then'](function(_0xc16ad0){if(_0x27b7a0[_0xd81b('0x8')][_0x5c2863]){return RpcUser[_0xd81b('0x22')](_0x27b7a0['agents'][_0x5c2863]['id'])[_0xd81b('0x23')](function(_0x6571a6){if(_0x6571a6&&!_0x6571a6['voicePause']){logger[_0xd81b('0x24')](_0xd81b('0x25'),_0x1c620d,_0x5c2863,_0x4657cf);var _0x1670cd=_0x27b7a0[_0xd81b('0x1a')][_0x1c620d][_0xd81b('0x26')]&&_0x27b7a0[_0xd81b('0x1a')][_0x1c620d][_0xd81b('0x27')]?_0x27b7a0[_0xd81b('0x1a')][_0x1c620d][_0xd81b('0x27')]:_0x1c620d;return RpcUser[_0xd81b('0x28')](_0x27b7a0[_0xd81b('0x8')][_0x5c2863],_0x1c34c5,_0x1670cd)[_0xd81b('0x23')](function(_0x596389){if(!_0x3d4d34){_0x27b7a0[_0xd81b('0x9')][_0x5c2863]={};logger[_0xd81b('0x24')](_0xd81b('0x29'),_0x1c620d,_0x27b7a0[_0xd81b('0x7')][_0x4657cf][_0xd81b('0x2a')],_0x5c2863,_0x4657cf);_0x27b7a0[_0xd81b('0x9')][_0x5c2863][_0xd81b('0x2b')]=setTimeout(_0x27b7a0[_0xd81b('0x2c')][_0xd81b('0xd')](_0x27b7a0,_0x5c2863),_0x27b7a0['voiceQueues'][_0x4657cf][_0xd81b('0x2a')]*0x3e8);_0x27b7a0['timers'][_0x5c2863]['lastPauseAt']=moment()[_0xd81b('0x2d')](_0xd81b('0x2e'));_0x27b7a0['timers'][_0x5c2863]['uniqueid']=_0x1c620d;_0x27b7a0[_0xd81b('0x9')][_0x5c2863][_0xd81b('0x1c')]=_0x4657cf;_0x27b7a0[_0xd81b('0x9')][_0x5c2863][_0xd81b('0x2f')]=function(){var _0x1a1572=getDiff(_0x27b7a0[_0xd81b('0x9')][_0x5c2863]['lastPauseAt']);clearTimeout(_0x27b7a0[_0xd81b('0x9')][_0x5c2863][_0xd81b('0x2b')]);_0x27b7a0['timers'][_0x5c2863]['timer']=![];RpcVoiceAgentReport[_0xd81b('0x30')]({'acwtime':_0x1a1572},_0x27b7a0[_0xd81b('0x9')][_0x5c2863]['uniqueid'],_0x5c2863)['then'](function(_0x5317b2){logger[_0xd81b('0x24')](_0xd81b('0x31'),_0x1c620d,_0x1a1572,_0x5317b2);})[_0xd81b('0x32')](function(_0x1c4cf7){logger[_0xd81b('0x33')](_0xd81b('0x34'),_0x1c620d,_0x1c4cf7);});delete _0x27b7a0[_0xd81b('0x9')][_0x5c2863];};}});}else{logger['info'](_0xd81b('0x35'),_0x1c620d,_0x5c2863,_0x4657cf);}});}})['catch'](function(_0x34634a){logger[_0xd81b('0x33')](_0xd81b('0x29'),_0x1c620d,_0x27b7a0[_0xd81b('0x7')][_0x4657cf][_0xd81b('0x2a')],_0x5c2863,_0x4657cf);})[_0xd81b('0x36')](function(){delete _0x27b7a0[_0xd81b('0x1a')][_0x1c620d];});}catch(_0x2d23b9){logger[_0xd81b('0x33')](_0xd81b('0x37'),_0x2d23b9[_0xd81b('0x38')]);}};Acw[_0xd81b('0x19')][_0xd81b('0x2c')]=function(_0x57bc0c){try{var _0x49deb8=this;if(_0x49deb8[_0xd81b('0x9')][_0x57bc0c]){_0x49deb8[_0xd81b('0x9')][_0x57bc0c][_0xd81b('0x2b')]=![];var _0x59c066=_0x49deb8[_0xd81b('0x9')][_0x57bc0c][_0xd81b('0x39')];var _0x5a236a=_0x49deb8[_0xd81b('0x9')][_0x57bc0c][_0xd81b('0x1c')];var _0x512e39=_0x49deb8[_0xd81b('0x7')][_0x5a236a]['acwTimeout'];logger[_0xd81b('0x24')](_0xd81b('0x3a'),_0x57bc0c);RpcUser[_0xd81b('0x3b')](this[_0xd81b('0x8')][_0x57bc0c]);RpcVoiceAgentReport['update']({'acwtime':_0x512e39,'agentacw':!![]},_0x59c066,_0x57bc0c)[_0xd81b('0x23')](function(_0x3444d4){logger[_0xd81b('0x24')](_0xd81b('0x31'),_0x59c066,_0x512e39,_0x3444d4);})[_0xd81b('0x32')](function(_0x466e98){logger[_0xd81b('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x59c066,_0x466e98);});}else{logger[_0xd81b('0x33')](_0xd81b('0x3c'),_0x57bc0c);if(_0x49deb8[_0xd81b('0x9')]){logger['info'](_0xd81b('0x3d'),JSON[_0xd81b('0x3e')](_0x49deb8[_0xd81b('0x9')]));}}}catch(_0x1cd745){logger[_0xd81b('0x33')]('[ACW][STOP]\x20%s',_0x1cd745[_0xd81b('0x38')]);}};Acw[_0xd81b('0x19')][_0xd81b('0xa')]=function(_0x43ea38){try{if(this[_0xd81b('0x7')][_0x43ea38[_0xd81b('0x1c')]]&&(this[_0xd81b('0x7')][_0x43ea38[_0xd81b('0x1c')]][_0xd81b('0x5')]||this[_0xd81b('0x7')][_0x43ea38[_0xd81b('0x1c')]]['mandatoryDisposition'])){if(this[_0xd81b('0x8')][_0x43ea38[_0xd81b('0x1b')]]){this[_0xd81b('0x1a')][_0x43ea38[_0xd81b('0x39')]]={'queue':_0x43ea38[_0xd81b('0x1c')],'interface':_0x43ea38[_0xd81b('0x1b')],'destlinkedid':_0x43ea38[_0xd81b('0x27')]};}}}catch(_0x475bcf){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x475bcf[_0xd81b('0x38')]);}};Acw[_0xd81b('0x19')][_0xd81b('0x15')]=function(_0x222c5e){try{if(this[_0xd81b('0x7')][_0x222c5e[_0xd81b('0x1c')]]&&(this[_0xd81b('0x7')][_0x222c5e[_0xd81b('0x1c')]][_0xd81b('0x5')]||this[_0xd81b('0x7')][_0x222c5e[_0xd81b('0x1c')]][_0xd81b('0x1e')])){if(this['agents'][_0x222c5e[_0xd81b('0x1b')]]){this[_0xd81b('0x1a')][_0x222c5e[_0xd81b('0x39')]]={'queue':_0x222c5e[_0xd81b('0x1c')],'interface':_0x222c5e[_0xd81b('0x1b')]};}}}catch(_0x410ef3){logger[_0xd81b('0x33')](_0xd81b('0x3f'),_0x410ef3[_0xd81b('0x38')]);}};Acw['prototype'][_0xd81b('0xc')]=function(_0x2368dd){try{if(this[_0xd81b('0x1a')][_0x2368dd[_0xd81b('0x39')]]&&_['isUndefined'](this[_0xd81b('0x1a')][_0x2368dd[_0xd81b('0x39')]][_0xd81b('0x26')])){logger[_0xd81b('0x24')](_0xd81b('0x40'),_0x2368dd[_0xd81b('0x39')]);this[_0xd81b('0x41')](_0x2368dd[_0xd81b('0x39')]);}else if(this[_0xd81b('0x1a')][_0x2368dd['linkedid']]&&_['isUndefined'](this[_0xd81b('0x1a')][_0x2368dd[_0xd81b('0x42')]][_0xd81b('0x26')])){logger[_0xd81b('0x24')](_0xd81b('0x43'),_0x2368dd[_0xd81b('0x42')]);this[_0xd81b('0x41')](_0x2368dd[_0xd81b('0x42')]);}}catch(_0x4e039e){logger[_0xd81b('0x33')](_0xd81b('0x44'),_0x4e039e[_0xd81b('0x38')]);}};Acw[_0xd81b('0x19')][_0xd81b('0xf')]=function(_0x59b13b){try{if(this[_0xd81b('0x1a')][_0x59b13b[_0xd81b('0x39')]]&&this['channels'][_0x59b13b[_0xd81b('0x39')]][_0xd81b('0x26')]){logger[_0xd81b('0x24')](_0xd81b('0x45'),_0x59b13b[_0xd81b('0x39')]);this[_0xd81b('0x41')](_0x59b13b[_0xd81b('0x39')]);}else if(this[_0xd81b('0x1a')][_0x59b13b[_0xd81b('0x42')]]&&this[_0xd81b('0x1a')][_0x59b13b[_0xd81b('0x42')]]['attended']){logger[_0xd81b('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x59b13b[_0xd81b('0x42')]);this[_0xd81b('0x41')](_0x59b13b[_0xd81b('0x42')]);}}catch(_0x3c2a9f){logger[_0xd81b('0x33')](_0xd81b('0x46'),_0x3c2a9f['message']);}};Acw[_0xd81b('0x19')][_0xd81b('0x13')]=function(_0x51f5a1){try{if(!_['isNil'](this[_0xd81b('0x1a')][_0x51f5a1['transfereeuniqueid']])){this[_0xd81b('0x41')](_0x51f5a1['transfereeuniqueid']);if(this[_0xd81b('0x1a')][_0x51f5a1[_0xd81b('0x47')]]){this[_0xd81b('0x1a')][_0x51f5a1['secondtransfereruniqueid']][_0xd81b('0x26')]=!![];this[_0xd81b('0x1a')][_0x51f5a1['transfertargetuniqueid']]=this[_0xd81b('0x1a')][_0x51f5a1[_0xd81b('0x47')]];delete this['channels'][_0x51f5a1[_0xd81b('0x47')]];}}else if(!_['isNil'](this[_0xd81b('0x1a')][_0x51f5a1[_0xd81b('0x48')]])){this[_0xd81b('0x41')](_0x51f5a1[_0xd81b('0x48')]);if(this[_0xd81b('0x1a')][_0x51f5a1[_0xd81b('0x49')]]){this[_0xd81b('0x1a')][_0x51f5a1[_0xd81b('0x49')]][_0xd81b('0x26')]=!![];this[_0xd81b('0x1a')][_0x51f5a1['transfereeuniqueid']]=this[_0xd81b('0x1a')][_0x51f5a1[_0xd81b('0x49')]];delete this[_0xd81b('0x1a')][_0x51f5a1[_0xd81b('0x49')]];}}}catch(_0x1bdf37){logger[_0xd81b('0x33')](_0xd81b('0x4a'),_0x1bdf37['message']);}};Acw['prototype']['syncBlindTransfer']=function(_0x2afe84){try{if(this[_0xd81b('0x1a')][_0x2afe84[_0xd81b('0x4b')]]){logger[_0xd81b('0x24')](_0xd81b('0x4c'),JSON[_0xd81b('0x3e')](_0x2afe84[_0xd81b('0x4b')]));this['startAcw'](_0x2afe84[_0xd81b('0x4b')]);}else if(this[_0xd81b('0x1a')][_0x2afe84[_0xd81b('0x4d')]]){logger[_0xd81b('0x24')](_0xd81b('0x4e'),JSON[_0xd81b('0x3e')](_0x2afe84[_0xd81b('0x4d')]));this['startAcw'](_0x2afe84[_0xd81b('0x4d')]);}}catch(_0x15f003){logger[_0xd81b('0x33')](_0xd81b('0x4f'),_0x15f003[_0xd81b('0x38')]);}};Acw[_0xd81b('0x19')][_0xd81b('0x11')]=function(_0x19d4f0){try{if(this[_0xd81b('0x7')][_0x19d4f0[_0xd81b('0x1c')]]&&this[_0xd81b('0x7')][_0x19d4f0[_0xd81b('0x1c')]]['autopause']===_0xd81b('0x50')){if(this['agents'][_0x19d4f0[_0xd81b('0x1b')]]){logger[_0xd81b('0x24')](_0xd81b('0x51'),_0x19d4f0[_0xd81b('0x39')],_0x19d4f0[_0xd81b('0x1b')],_0x19d4f0[_0xd81b('0x1c')]);return RpcUser[_0xd81b('0x28')](this[_0xd81b('0x8')][_0x19d4f0[_0xd81b('0x1b')]],_0xd81b('0x52'),_0x19d4f0['uniqueid']);}}}catch(_0xfa2a13){logger[_0xd81b('0x33')](_0xd81b('0x53'),_0xfa2a13[_0xd81b('0x38')]);}};module[_0xd81b('0x54')]=Acw;
\ No newline at end of file
index 77d5894..ad8ada1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2a8=['exports','asterisk-manager','moment','lodash','port','username','password','keepConnected','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','asterisk','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','format','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','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','catch'];(function(_0x37564b,_0x5b7e5b){var _0x12a817=function(_0x4cc01c){while(--_0x4cc01c){_0x37564b['push'](_0x37564b['shift']());}};_0x12a817(++_0x5b7e5b);}(_0xa2a8,0x1dd));var _0x8a2a=function(_0x243439,_0x89863d){_0x243439=_0x243439-0x0;var _0x48b04d=_0xa2a8[_0x243439];return _0x48b04d;};'use strict';var Manager=require(_0x8a2a('0x0'));var BPromise=require('bluebird');var moment=require(_0x8a2a('0x1'));var util=require('util');var _=require(_0x8a2a('0x2'));var logger=require('../../config/logger')('ami');var config=require('../../config/environment');var ami=new Manager(config['asterisk'][_0x8a2a('0x3')],config['asterisk']['ip'],config['asterisk'][_0x8a2a('0x4')],config['asterisk'][_0x8a2a('0x5')],!![]);ami[_0x8a2a('0x6')]();ami['Action']=BPromise['promisify'](ami['action']);function error(_0x58203e){logger[_0x8a2a('0x7')](util['format'](_0x8a2a('0x8'),config['asterisk'][_0x8a2a('0x4')],config[_0x8a2a('0x9')]['ip'],config[_0x8a2a('0x9')]['port'],util[_0x8a2a('0xa')](_0x58203e,![],null)));}function close(){logger[_0x8a2a('0x7')](util['format'](_0x8a2a('0xb'),config['asterisk'][_0x8a2a('0x4')],config['asterisk']['ip'],config[_0x8a2a('0x9')][_0x8a2a('0x3')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x8a2a('0xc')]({'action':_0x8a2a('0xd')});};};ami[_0x8a2a('0xe')]=function(){return function(){return ami[_0x8a2a('0xc')]({'action':_0x8a2a('0xf')});};};ami[_0x8a2a('0x10')]=function(){return function(){return ami[_0x8a2a('0xc')]({'action':_0x8a2a('0x11')});};};ami[_0x8a2a('0x12')]=function(){return function(){return ami[_0x8a2a('0xc')]({'action':'queuesummary'});};};ami[_0x8a2a('0x13')]=function(){return function(){return ami[_0x8a2a('0xc')]({'action':_0x8a2a('0x14')});};};function connect(_0x49b9cd){logger[_0x8a2a('0x15')](util[_0x8a2a('0x16')](_0x8a2a('0x17'),config[_0x8a2a('0x9')][_0x8a2a('0x4')],config[_0x8a2a('0x9')]['ip'],config[_0x8a2a('0x9')][_0x8a2a('0x3')]));ami['once'](_0x8a2a('0x7'),error);ami[_0x8a2a('0x18')](_0x8a2a('0x19'),close);}ami['on']('connect',connect);ami['on'](_0x8a2a('0x1a'),function(_0xe4e06e){logger[_0x8a2a('0x15')](util[_0x8a2a('0x16')](_0x8a2a('0x1b'),config[_0x8a2a('0x9')][_0x8a2a('0x4')],config[_0x8a2a('0x9')]['ip'],config[_0x8a2a('0x9')][_0x8a2a('0x3')],util[_0x8a2a('0xa')](_0xe4e06e,![],null)));});ami['on']('fullybooted',function(_0x35f621){logger[_0x8a2a('0x15')](util[_0x8a2a('0x16')](_0x8a2a('0x1c'),config[_0x8a2a('0x9')][_0x8a2a('0x4')],config[_0x8a2a('0x9')]['ip'],config[_0x8a2a('0x9')]['port']));return BPromise[_0x8a2a('0x1d')]()[_0x8a2a('0x1e')](ami[_0x8a2a('0x1f')]())[_0x8a2a('0x1e')](ami[_0x8a2a('0xe')]())[_0x8a2a('0x1e')](ami['actionSipPeerStatus']())[_0x8a2a('0x1e')](ami[_0x8a2a('0x12')]())[_0x8a2a('0x1e')](ami[_0x8a2a('0x13')]())[_0x8a2a('0x20')](function(_0xb3b506){console['log'](_0xb3b506);});});ami[_0x8a2a('0x18')](_0x8a2a('0x7'),error);ami['once'](_0x8a2a('0x19'),close);module[_0x8a2a('0x21')]=ami;
\ No newline at end of file
+var _0x84d5=['Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','actionDeviceStateList','then','catch','log','exports','moment','util','../../config/logger','ami','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','action','error','format'];(function(_0x3e432a,_0x345ec3){var _0x2a9693=function(_0x2c7873){while(--_0x2c7873){_0x3e432a['push'](_0x3e432a['shift']());}};_0x2a9693(++_0x345ec3);}(_0x84d5,0x103));var _0x584d=function(_0x9bc045,_0x566fdb){_0x9bc045=_0x9bc045-0x0;var _0x27a8e3=_0x84d5[_0x9bc045];return _0x27a8e3;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var moment=require(_0x584d('0x0'));var util=require(_0x584d('0x1'));var _=require('lodash');var logger=require(_0x584d('0x2'))(_0x584d('0x3'));var config=require(_0x584d('0x4'));var ami=new Manager(config[_0x584d('0x5')][_0x584d('0x6')],config['asterisk']['ip'],config[_0x584d('0x5')]['username'],config[_0x584d('0x5')][_0x584d('0x7')],!![]);ami[_0x584d('0x8')]();ami[_0x584d('0x9')]=BPromise[_0x584d('0xa')](ami[_0x584d('0xb')]);function error(_0x4e3a79){logger[_0x584d('0xc')](util[_0x584d('0xd')](_0x584d('0xe'),config['asterisk'][_0x584d('0xf')],config[_0x584d('0x5')]['ip'],config['asterisk'][_0x584d('0x6')],util[_0x584d('0x10')](_0x4e3a79,![],null)));}function close(){logger['error'](util[_0x584d('0xd')](_0x584d('0x11'),config[_0x584d('0x5')][_0x584d('0xf')],config['asterisk']['ip'],config[_0x584d('0x5')]['port']));}ami[_0x584d('0x12')]=function(){return function(){return ami['Action']({'action':_0x584d('0x13')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0x584d('0x14')});};};ami[_0x584d('0x15')]=function(){return function(){return ami[_0x584d('0x9')]({'action':_0x584d('0x16')});};};ami[_0x584d('0x17')]=function(){return function(){return ami[_0x584d('0x9')]({'action':_0x584d('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x584d('0x9')]({'action':'coreshowchannels'});};};function connect(_0x464042){logger[_0x584d('0x19')](util['format'](_0x584d('0x1a'),config[_0x584d('0x5')][_0x584d('0xf')],config[_0x584d('0x5')]['ip'],config[_0x584d('0x5')][_0x584d('0x6')]));ami[_0x584d('0x1b')](_0x584d('0xc'),error);ami[_0x584d('0x1b')](_0x584d('0x1c'),close);}ami['on'](_0x584d('0x1d'),connect);ami['on']('shutdown',function(_0x332a6f){logger['info'](util[_0x584d('0xd')](_0x584d('0x1e'),config[_0x584d('0x5')][_0x584d('0xf')],config[_0x584d('0x5')]['ip'],config[_0x584d('0x5')][_0x584d('0x6')],util[_0x584d('0x10')](_0x332a6f,![],null)));});ami['on'](_0x584d('0x1f'),function(_0x41b82d){logger['info'](util[_0x584d('0xd')](_0x584d('0x20'),config[_0x584d('0x5')]['username'],config[_0x584d('0x5')]['ip'],config['asterisk'][_0x584d('0x6')]));return BPromise[_0x584d('0x21')]()['then'](ami['actionSipShowRegistry']())['then'](ami[_0x584d('0x22')]())['then'](ami[_0x584d('0x15')]())[_0x584d('0x23')](ami[_0x584d('0x17')]())[_0x584d('0x23')](ami['actionCoreShowChannels']())[_0x584d('0x24')](function(_0x2cfeef){console[_0x584d('0x25')](_0x2cfeef);});});ami[_0x584d('0x1b')](_0x584d('0xc'),error);ami['once'](_0x584d('0x1c'),close);module[_0x584d('0x26')]=ami;
\ No newline at end of file
index 2c45a40..c296b4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9546=['../../config/logger','request','then','debug','rpc','error','memberReport','message','result','catch','exports'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x9546,0x1ef));var _0x6954=function(_0x3dc96c,_0x4b8246){_0x3dc96c=_0x3dc96c-0x0;var _0x1f3df7=_0x9546[_0x3dc96c];return _0x1f3df7;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x6954('0x0'))('ami');var client=jayson['client']['http']({'port':0x2329});client['Request']=function(_0x311e5a,_0x15075e){return new BPromise(function(_0x4427a5,_0x5209f6){return client[_0x6954('0x1')](_0x311e5a,_0x15075e)[_0x6954('0x2')](function(_0x220cd8){logger[_0x6954('0x3')](_0x6954('0x4'),'memberReport',_0x311e5a,_0x15075e,_0x220cd8);if(_0x220cd8[_0x6954('0x5')]){logger[_0x6954('0x5')]('rpc',_0x6954('0x6'),_0x311e5a,_0x220cd8[_0x6954('0x5')]['message'],_0x15075e);return _0x5209f6(_0x220cd8[_0x6954('0x5')][_0x6954('0x7')]);}else{return _0x4427a5(_0x220cd8[_0x6954('0x8')]);}})[_0x6954('0x9')](function(_0x4f71d4){logger[_0x6954('0x5')](_0x6954('0x4'),_0x6954('0x6'),_0x311e5a,_0x4f71d4,_0x15075e);return _0x5209f6(_0x4f71d4);});});};module[_0x6954('0xa')]=client;
\ No newline at end of file
+var _0xfb71=['../../config/logger','ami','client','http','Request','debug','rpc','memberReport','error','message','result','exports','jayson/promise','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb71,0x124));var _0x1fb7=function(_0x15866c,_0x174230){_0x15866c=_0x15866c-0x0;var _0x16cce2=_0xfb71[_0x15866c];return _0x16cce2;};'use strict';var jayson=require(_0x1fb7('0x0'));var BPromise=require(_0x1fb7('0x1'));var logger=require(_0x1fb7('0x2'))(_0x1fb7('0x3'));var client=jayson[_0x1fb7('0x4')][_0x1fb7('0x5')]({'port':0x2329});client[_0x1fb7('0x6')]=function(_0x443154,_0x2a64c0){return new BPromise(function(_0x15af80,_0x2b22c2){return client['request'](_0x443154,_0x2a64c0)['then'](function(_0x7d425){logger[_0x1fb7('0x7')](_0x1fb7('0x8'),_0x1fb7('0x9'),_0x443154,_0x2a64c0,_0x7d425);if(_0x7d425['error']){logger[_0x1fb7('0xa')](_0x1fb7('0x8'),'memberReport',_0x443154,_0x7d425[_0x1fb7('0xa')][_0x1fb7('0xb')],_0x2a64c0);return _0x2b22c2(_0x7d425[_0x1fb7('0xa')][_0x1fb7('0xb')]);}else{return _0x15af80(_0x7d425[_0x1fb7('0xc')]);}})['catch'](function(_0x2d859b){logger[_0x1fb7('0xa')](_0x1fb7('0x8'),_0x1fb7('0x9'),_0x443154,_0x2d859b,_0x2a64c0);return _0x2b22c2(_0x2d859b);});});};module[_0x1fb7('0xd')]=client;
\ No newline at end of file
index 475e818..ae20f4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x902b=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','dialCutDigit','substring','voiceQueue','getQueue','util','moment','isNil','Contact','firstName','number','phone','queue','name','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x2557c8,_0x5edc43){var _0x585fc6=function(_0x573abb){while(--_0x573abb){_0x2557c8['push'](_0x2557c8['shift']());}};_0x585fc6(++_0x5edc43);}(_0x902b,0x6a));var _0xb902=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x902b[_0x243b59];return _0x3e1676;};'use strict';var util=require(_0xb902('0x0'));var _=require('lodash');var moment=require(_0xb902('0x1'));function checkNameSurname(_0x1dba3d,_0x26d7c7,_0x20a412){var _0xa2acb9='';if(!_[_0xb902('0x2')](_0x26d7c7)&&'string'===typeof _0x26d7c7){_0xa2acb9+=_0x26d7c7;}if(!_[_0xb902('0x2')](_0x20a412)&&'string'===typeof _0x20a412){_0xa2acb9+='\x20'+_0x20a412;}if(_0xa2acb9!==''){return _0xa2acb9;}return _0x1dba3d;}function Action(_0x98a793,_0x5d38bb,_0x157e14){this['voiceQueue']=_0x98a793;this['uniqueid']=_0x157e14||undefined;this['name']=checkNameSurname(_0x5d38bb['Contact']['phone'],_0x5d38bb[_0xb902('0x3')][_0xb902('0x4')],_0x5d38bb['Contact']['lastName']);this[_0xb902('0x5')]=_0x5d38bb[_0xb902('0x3')][_0xb902('0x6')];this[_0xb902('0x7')]=_0x98a793[_0xb902('0x8')];this[_0xb902('0x9')]=_0x5d38bb[_0xb902('0x9')]||![];this[_0xb902('0xa')]=_0x98a793['type'];this[_0xb902('0xb')]=_0x98a793[_0xb902('0xb')]||0x3;this[_0xb902('0xc')]=_0x5d38bb[_0xb902('0xc')];this['countbusyretry']=_0x5d38bb['countbusyretry'];this[_0xb902('0xd')]=_0x5d38bb[_0xb902('0xd')];this['countnoanswerretry']=_0x5d38bb[_0xb902('0xe')];this[_0xb902('0xf')]=_0x5d38bb[_0xb902('0xf')];this[_0xb902('0x10')]=_0x5d38bb[_0xb902('0x10')];this[_0xb902('0x11')]=_0x5d38bb['countabandonedretry'];this[_0xb902('0x12')]=_0x5d38bb[_0xb902('0x12')];this[_0xb902('0x13')]=_0x5d38bb[_0xb902('0x13')];this[_0xb902('0x14')]=_0x5d38bb['ContactId'];this[_0xb902('0x15')]=_0x5d38bb[_0xb902('0x15')];this[_0xb902('0x16')]=_0x5d38bb[_0xb902('0x16')];this['VoiceQueueId']=_0x5d38bb[_0xb902('0x17')];this['CampaignId']=_0x5d38bb[_0xb902('0x18')];this[_0xb902('0x19')]=_0x5d38bb['id'];this[_0xb902('0x1a')]=_0x5d38bb['Contact']['firstName']||'';this[_0xb902('0x1b')]=moment()[_0xb902('0x1c')](_0xb902('0x1d'));this['callback']=_0x5d38bb[_0xb902('0x1e')];this[_0xb902('0x1f')]=_0x5d38bb[_0xb902('0x1f')];this[_0xb902('0x20')]=_0x5d38bb[_0xb902('0x20')];this[_0xb902('0x21')]=_0x5d38bb[_0xb902('0x21')];this[_0xb902('0x22')]='';this[_0xb902('0x23')]='';}Action[_0xb902('0x24')]['getCaller']=function(){return util[_0xb902('0x1c')](_0xb902('0x25'),this[_0xb902('0x8')],this['voiceQueue'][_0xb902('0x26')]>0x0?this['number'][_0xb902('0x27')](this[_0xb902('0x28')]['dialCutDigit']):this[_0xb902('0x5')]);};Action[_0xb902('0x24')][_0xb902('0x29')]=function(){return this[_0xb902('0x7')];};module['exports']=Action;
\ No newline at end of file
+var _0x980c=['VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x980c,0x100));var _0xc980=function(_0x4b71a1,_0x2aabce){_0x4b71a1=_0x4b71a1-0x0;var _0x161af2=_0x980c[_0x4b71a1];return _0x161af2;};'use strict';var util=require(_0xc980('0x0'));var _=require(_0xc980('0x1'));var moment=require(_0xc980('0x2'));function checkNameSurname(_0x8f18bd,_0x2121b0,_0x4aaba){var _0x444b7f='';if(!_[_0xc980('0x3')](_0x2121b0)&&_0xc980('0x4')===typeof _0x2121b0){_0x444b7f+=_0x2121b0;}if(!_[_0xc980('0x3')](_0x4aaba)&&_0xc980('0x4')===typeof _0x4aaba){_0x444b7f+='\x20'+_0x4aaba;}if(_0x444b7f!==''){return _0x444b7f;}return _0x8f18bd;}function Action(_0x5793bf,_0x472ece,_0x311a54){this[_0xc980('0x5')]=_0x5793bf;this[_0xc980('0x6')]=_0x311a54||undefined;this[_0xc980('0x7')]=checkNameSurname(_0x472ece[_0xc980('0x8')][_0xc980('0x9')],_0x472ece['Contact']['firstName'],_0x472ece['Contact'][_0xc980('0xa')]);this['number']=_0x472ece[_0xc980('0x8')][_0xc980('0x9')];this[_0xc980('0xb')]=_0x5793bf['name'];this[_0xc980('0xc')]=_0x472ece[_0xc980('0xc')]||![];this[_0xc980('0xd')]=_0x5793bf['type'];this[_0xc980('0xe')]=_0x5793bf[_0xc980('0xe')]||0x3;this[_0xc980('0xf')]=_0x472ece[_0xc980('0xf')];this[_0xc980('0x10')]=_0x472ece[_0xc980('0x10')];this[_0xc980('0x11')]=_0x472ece[_0xc980('0x11')];this[_0xc980('0x12')]=_0x472ece[_0xc980('0x12')];this[_0xc980('0x13')]=_0x472ece[_0xc980('0x13')];this[_0xc980('0x14')]=_0x472ece['countdropretry'];this['countabandonedretry']=_0x472ece[_0xc980('0x15')];this['countmachineretry']=_0x472ece['countmachineretry'];this[_0xc980('0x16')]=_0x472ece[_0xc980('0x16')];this[_0xc980('0x17')]=_0x472ece[_0xc980('0x17')];this[_0xc980('0x18')]=_0x472ece[_0xc980('0x18')];this['UserId']=_0x472ece[_0xc980('0x19')];this[_0xc980('0x1a')]=_0x472ece[_0xc980('0x1a')];this['CampaignId']=_0x472ece[_0xc980('0x1b')];this[_0xc980('0x1c')]=_0x472ece['id'];this[_0xc980('0x1d')]=_0x472ece[_0xc980('0x8')][_0xc980('0x1e')]||'';this[_0xc980('0x1f')]=moment()['format'](_0xc980('0x20'));this[_0xc980('0x21')]=_0x472ece[_0xc980('0x21')];this[_0xc980('0x22')]=_0x472ece[_0xc980('0x22')];this[_0xc980('0x23')]=_0x472ece[_0xc980('0x23')];this['recallme']=_0x472ece['recallme'];this[_0xc980('0x24')]='';this[_0xc980('0x25')]='';}Action[_0xc980('0x26')][_0xc980('0x27')]=function(){return util[_0xc980('0x28')](_0xc980('0x29'),this['name'],this[_0xc980('0x5')][_0xc980('0x2a')]>0x0?this[_0xc980('0x2b')][_0xc980('0x2c')](this[_0xc980('0x5')][_0xc980('0x2a')]):this[_0xc980('0x2b')]);};Action[_0xc980('0x26')][_0xc980('0x2d')]=function(){return this[_0xc980('0xb')];};module[_0xc980('0x2e')]=Action;
\ No newline at end of file
index 4f97e9a..ac37fce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bcb=['calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0x4bcb,0x168));var _0xb4bc=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0x4bcb[_0x5534fe];return _0x3d1dc2;};'use strict';var util=require(_0xb4bc('0x0'));var _=require(_0xb4bc('0x1'));var moment=require(_0xb4bc('0x2'));function getSeconds(_0x441693,_0x18425d){var _0x3fe28e=moment(_0x441693)['milliseconds'](0x0);var _0x38e4f8=moment(_0x18425d)[_0xb4bc('0x3')](0x0);return _0x3fe28e[_0xb4bc('0x4')](_0x38e4f8,_0xb4bc('0x5'));}function AdditionalPhone(_0x5c430a){this[_0xb4bc('0x6')]=_0x5c430a[_0xb4bc('0x6')];this['scheduledat']=_0x5c430a['scheduledat']||undefined;this[_0xb4bc('0x7')]=_0x5c430a[_0xb4bc('0x7')];this[_0xb4bc('0x8')]=_0x5c430a[_0xb4bc('0x7')]===_0xb4bc('0x9')?_0xb4bc('0xa'):_0x5c430a[_0xb4bc('0x7')];this[_0xb4bc('0xb')]=_0x5c430a[_0xb4bc('0xb')];this[_0xb4bc('0xc')]=_0x5c430a[_0xb4bc('0xc')];this[_0xb4bc('0xd')]=_0x5c430a[_0xb4bc('0xd')];this[_0xb4bc('0xe')]=_0x5c430a[_0xb4bc('0xb')]+_0x5c430a[_0xb4bc('0xc')]+_0x5c430a[_0xb4bc('0xd')]+_0x5c430a[_0xb4bc('0xf')]+_0x5c430a[_0xb4bc('0x10')]+_0x5c430a[_0xb4bc('0x11')]+_0x5c430a[_0xb4bc('0x12')]+_0x5c430a[_0xb4bc('0x13')];this[_0xb4bc('0xf')]=_0x5c430a['countnosuchnumberretry'];this[_0xb4bc('0x10')]=_0x5c430a[_0xb4bc('0x10')];this[_0xb4bc('0x11')]=_0x5c430a['countabandonedretry'];this[_0xb4bc('0x12')]=_0x5c430a['countmachineretry'];this[_0xb4bc('0x13')]=_0x5c430a['countagentrejectretry'];this[_0xb4bc('0xa')]=_0x5c430a[_0xb4bc('0xa')];this[_0xb4bc('0x14')]=_0x5c430a[_0xb4bc('0x15')];this[_0xb4bc('0x16')]=_0x5c430a['number'];this[_0xb4bc('0x17')]=_0x5c430a[_0xb4bc('0x17')];this['responsetime']=_0x5c430a[_0xb4bc('0x18')];this[_0xb4bc('0x19')]=_0x5c430a['responsetime'];this[_0xb4bc('0x1a')]=getSeconds(_0x5c430a[_0xb4bc('0x18')],_0x5c430a[_0xb4bc('0x17')]);this[_0xb4bc('0x1b')]=0x0;this['talktime']=0x0;this[_0xb4bc('0x1c')]=_0x5c430a['callback'];this[_0xb4bc('0x1d')]=_0x5c430a[_0xb4bc('0x1d')];this[_0xb4bc('0x1e')]=_0x5c430a[_0xb4bc('0x1e')];this[_0xb4bc('0x1f')]=_0x5c430a[_0xb4bc('0x1f')];this['ContactId']=_0x5c430a[_0xb4bc('0x20')];this[_0xb4bc('0x21')]=_0x5c430a[_0xb4bc('0x21')];this[_0xb4bc('0x22')]=_0x5c430a[_0xb4bc('0x22')];this['VoiceQueueId']=_0x5c430a[_0xb4bc('0x23')];this[_0xb4bc('0x24')]=_0x5c430a['CampaignId'];this['originatecalleridnum']=_0x5c430a['originatecalleridnum']||'';this['originatecalleridname']=_0x5c430a[_0xb4bc('0x25')]||'';}module['exports']=History;
\ No newline at end of file
+var _0xf70d=['milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','name','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','exports','util','moment'];(function(_0x2cf4b5,_0x372215){var _0x30bf63=function(_0x52aff3){while(--_0x52aff3){_0x2cf4b5['push'](_0x2cf4b5['shift']());}};_0x30bf63(++_0x372215);}(_0xf70d,0x11e));var _0xdf70=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xf70d[_0x409353];return _0x4f4b59;};'use strict';var util=require(_0xdf70('0x0'));var _=require('lodash');var moment=require(_0xdf70('0x1'));function getSeconds(_0x33d446,_0x3f204b){var _0x119d60=moment(_0x33d446)[_0xdf70('0x2')](0x0);var _0x77523=moment(_0x3f204b)[_0xdf70('0x2')](0x0);return _0x119d60[_0xdf70('0x3')](_0x77523,_0xdf70('0x4'));}function AdditionalPhone(_0x13c516){this[_0xdf70('0x5')]=_0x13c516[_0xdf70('0x5')];this['scheduledat']=_0x13c516[_0xdf70('0x6')]||undefined;this['type']=_0x13c516[_0xdf70('0x7')];this[_0xdf70('0x8')]=_0x13c516[_0xdf70('0x7')]==='outbound'?_0xdf70('0x9'):_0x13c516[_0xdf70('0x7')];this[_0xdf70('0xa')]=_0x13c516[_0xdf70('0xa')];this['countcongestionretry']=_0x13c516[_0xdf70('0xb')];this[_0xdf70('0xc')]=_0x13c516[_0xdf70('0xc')];this['countglobal']=_0x13c516[_0xdf70('0xa')]+_0x13c516[_0xdf70('0xb')]+_0x13c516[_0xdf70('0xc')]+_0x13c516[_0xdf70('0xd')]+_0x13c516[_0xdf70('0xe')]+_0x13c516[_0xdf70('0xf')]+_0x13c516['countmachineretry']+_0x13c516[_0xdf70('0x10')];this[_0xdf70('0xd')]=_0x13c516[_0xdf70('0xd')];this[_0xdf70('0xe')]=_0x13c516['countdropretry'];this[_0xdf70('0xf')]=_0x13c516[_0xdf70('0xf')];this[_0xdf70('0x11')]=_0x13c516[_0xdf70('0x11')];this[_0xdf70('0x10')]=_0x13c516[_0xdf70('0x10')];this[_0xdf70('0x9')]=_0x13c516[_0xdf70('0x9')];this[_0xdf70('0x12')]=_0x13c516[_0xdf70('0x13')];this[_0xdf70('0x14')]=_0x13c516['number'];this[_0xdf70('0x15')]=_0x13c516[_0xdf70('0x15')];this['responsetime']=_0x13c516['responsetime'];this['endtime']=_0x13c516[_0xdf70('0x16')];this[_0xdf70('0x17')]=getSeconds(_0x13c516[_0xdf70('0x16')],_0x13c516[_0xdf70('0x15')]);this[_0xdf70('0x18')]=0x0;this[_0xdf70('0x19')]=0x0;this[_0xdf70('0x1a')]=_0x13c516[_0xdf70('0x1a')];this['callbackuniqueid']=_0x13c516[_0xdf70('0x1b')];this[_0xdf70('0x1c')]=_0x13c516[_0xdf70('0x1c')];this[_0xdf70('0x1d')]=_0x13c516[_0xdf70('0x1d')];this[_0xdf70('0x1e')]=_0x13c516[_0xdf70('0x1e')];this['ListId']=_0x13c516[_0xdf70('0x1f')];this[_0xdf70('0x20')]=_0x13c516[_0xdf70('0x20')];this['VoiceQueueId']=_0x13c516['VoiceQueueId'];this['CampaignId']=_0x13c516[_0xdf70('0x21')];this[_0xdf70('0x22')]=_0x13c516[_0xdf70('0x22')]||'';this['originatecalleridname']=_0x13c516['originatecalleridname']||'';}module[_0xdf70('0x23')]=History;
\ No newline at end of file
index dd664bd..7daaa9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb47d=['type','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat'];(function(_0x23355e,_0x584a54){var _0x433468=function(_0x5d326b){while(--_0x5d326b){_0x23355e['push'](_0x23355e['shift']());}};_0x433468(++_0x584a54);}(_0xb47d,0x1e5));var _0xdb47=function(_0x15a11c,_0x2dec34){_0x15a11c=_0x15a11c-0x0;var _0x3041d2=_0xb47d[_0x15a11c];return _0x3041d2;};'use strict';var util=require(_0xdb47('0x0'));var _=require(_0xdb47('0x1'));var moment=require(_0xdb47('0x2'));function getSeconds(_0x472edf,_0x5316f0){var _0x596aeb=moment(_0x472edf)[_0xdb47('0x3')](0x0);var _0x19f5fd=moment(_0x5316f0)[_0xdb47('0x3')](0x0);return _0x596aeb[_0xdb47('0x4')](_0x19f5fd,_0xdb47('0x5'));}function AgentComplete(_0x620451,_0x2fcabf){this[_0xdb47('0x6')]=0x4;this[_0xdb47('0x7')]=_0xdb47('0x8');this[_0xdb47('0x9')]=_0x620451[_0xdb47('0x9')];this['type']=_0x620451[_0xdb47('0xa')];this['campaigntype']=_0x620451['type']===_0xdb47('0xb')?_0xdb47('0xc'):_0x620451[_0xdb47('0xa')];this[_0xdb47('0xd')]=_0x620451['countbusyretry'];this['countcongestionretry']=_0x620451['countcongestionretry'];this[_0xdb47('0xe')]=_0x620451['countnoanswerretry'];this['countglobal']=_0x620451[_0xdb47('0xd')]+_0x620451[_0xdb47('0xf')]+_0x620451[_0xdb47('0xe')]+_0x620451[_0xdb47('0x10')]+_0x620451[_0xdb47('0x11')]+_0x620451[_0xdb47('0x12')]+_0x620451[_0xdb47('0x13')]+_0x620451[_0xdb47('0x14')];this['countnosuchnumberretry']=_0x620451[_0xdb47('0x10')];this[_0xdb47('0x11')]=_0x620451[_0xdb47('0x11')];this[_0xdb47('0x12')]=_0x620451['countabandonedretry'];this[_0xdb47('0x13')]=_0x620451[_0xdb47('0x13')];this[_0xdb47('0x14')]=_0x620451['countagentrejectretry'];this[_0xdb47('0x15')]=_0x2fcabf[_0xdb47('0x15')];this['calleridname']=_0x620451[_0xdb47('0x16')];this[_0xdb47('0x17')]=_0x620451[_0xdb47('0x18')];this[_0xdb47('0x19')]=_0x620451['starttime'];this[_0xdb47('0x1a')]=_0x620451[_0xdb47('0x1a')];this[_0xdb47('0x1b')]=_0x620451[_0xdb47('0x1b')];this[_0xdb47('0x1c')]=moment()[_0xdb47('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xdb47('0x1e')]=getSeconds(_0x620451[_0xdb47('0x1a')],_0x620451[_0xdb47('0x19')]);this[_0xdb47('0x1f')]=getSeconds(_0x620451['answertime'],_0x620451[_0xdb47('0x1a')]);this[_0xdb47('0x20')]=getSeconds(this[_0xdb47('0x1c')],_0x620451[_0xdb47('0x1b')]);this[_0xdb47('0xc')]=_0x2fcabf[_0xdb47('0xc')];this[_0xdb47('0x21')]=_0x2fcabf[_0xdb47('0x21')];this[_0xdb47('0x22')]=_0x2fcabf['reason'];this[_0xdb47('0x23')]=_0x620451['callback'];this[_0xdb47('0x24')]=_0x620451[_0xdb47('0x24')];this['callbackat']=_0x620451['callbackat'];this[_0xdb47('0x25')]=_0x620451[_0xdb47('0x25')];this[_0xdb47('0x26')]=_0x620451[_0xdb47('0x26')];this[_0xdb47('0x27')]=_0x620451['ListId'];this[_0xdb47('0x28')]=_0x620451[_0xdb47('0x28')];this[_0xdb47('0x29')]=_0x620451[_0xdb47('0x29')];this['CampaignId']=_0x620451['CampaignId'];this[_0xdb47('0x2a')]=_0x620451[_0xdb47('0x2a')]||'';this[_0xdb47('0x2b')]=_0x620451[_0xdb47('0x2b')]||'';}module[_0xdb47('0x2c')]=AgentComplete;
\ No newline at end of file
+var _0xb9fc=['calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name'];(function(_0xbdd93d,_0x1c0726){var _0x565767=function(_0x3c2251){while(--_0x3c2251){_0xbdd93d['push'](_0xbdd93d['shift']());}};_0x565767(++_0x1c0726);}(_0xb9fc,0xa0));var _0xcb9f=function(_0xfa2639,_0xf2eb32){_0xfa2639=_0xfa2639-0x0;var _0x507a78=_0xb9fc[_0xfa2639];return _0x507a78;};'use strict';var util=require(_0xcb9f('0x0'));var _=require('lodash');var moment=require(_0xcb9f('0x1'));function getSeconds(_0x2dbf5b,_0x2f0965){var _0x32e2ce=moment(_0x2dbf5b)[_0xcb9f('0x2')](0x0);var _0x5243b4=moment(_0x2f0965)['milliseconds'](0x0);return _0x32e2ce[_0xcb9f('0x3')](_0x5243b4,_0xcb9f('0x4'));}function AgentComplete(_0x109689,_0x2e2607){this[_0xcb9f('0x5')]=0x4;this[_0xcb9f('0x6')]=_0xcb9f('0x7');this[_0xcb9f('0x8')]=_0x109689[_0xcb9f('0x8')];this[_0xcb9f('0x9')]=_0x109689[_0xcb9f('0x9')];this[_0xcb9f('0xa')]=_0x109689[_0xcb9f('0x9')]===_0xcb9f('0xb')?'queue':_0x109689[_0xcb9f('0x9')];this[_0xcb9f('0xc')]=_0x109689[_0xcb9f('0xc')];this[_0xcb9f('0xd')]=_0x109689[_0xcb9f('0xd')];this['countnoanswerretry']=_0x109689[_0xcb9f('0xe')];this[_0xcb9f('0xf')]=_0x109689[_0xcb9f('0xc')]+_0x109689[_0xcb9f('0xd')]+_0x109689['countnoanswerretry']+_0x109689['countnosuchnumberretry']+_0x109689[_0xcb9f('0x10')]+_0x109689[_0xcb9f('0x11')]+_0x109689['countmachineretry']+_0x109689[_0xcb9f('0x12')];this[_0xcb9f('0x13')]=_0x109689[_0xcb9f('0x13')];this['countdropretry']=_0x109689[_0xcb9f('0x10')];this[_0xcb9f('0x11')]=_0x109689['countabandonedretry'];this[_0xcb9f('0x14')]=_0x109689[_0xcb9f('0x14')];this['countagentrejectretry']=_0x109689['countagentrejectretry'];this[_0xcb9f('0x15')]=_0x2e2607[_0xcb9f('0x15')];this[_0xcb9f('0x16')]=_0x109689[_0xcb9f('0x17')];this[_0xcb9f('0x18')]=_0x109689[_0xcb9f('0x19')];this[_0xcb9f('0x1a')]=_0x109689[_0xcb9f('0x1a')];this[_0xcb9f('0x1b')]=_0x109689[_0xcb9f('0x1b')];this[_0xcb9f('0x1c')]=_0x109689[_0xcb9f('0x1c')];this[_0xcb9f('0x1d')]=moment()[_0xcb9f('0x1e')](_0xcb9f('0x1f'));this['ringtime']=getSeconds(_0x109689[_0xcb9f('0x1b')],_0x109689[_0xcb9f('0x1a')]);this['holdtime']=getSeconds(_0x109689['answertime'],_0x109689[_0xcb9f('0x1b')]);this[_0xcb9f('0x20')]=getSeconds(this[_0xcb9f('0x1d')],_0x109689[_0xcb9f('0x1c')]);this[_0xcb9f('0x21')]=_0x2e2607[_0xcb9f('0x21')];this[_0xcb9f('0x22')]=_0x2e2607['membername'];this[_0xcb9f('0x23')]=_0x2e2607[_0xcb9f('0x23')];this[_0xcb9f('0x24')]=_0x109689[_0xcb9f('0x24')];this['callbackuniqueid']=_0x109689[_0xcb9f('0x25')];this[_0xcb9f('0x26')]=_0x109689['callbackat'];this[_0xcb9f('0x27')]=_0x109689[_0xcb9f('0x27')];this[_0xcb9f('0x28')]=_0x109689[_0xcb9f('0x28')];this[_0xcb9f('0x29')]=_0x109689['ListId'];this['UserId']=_0x109689['UserId'];this[_0xcb9f('0x2a')]=_0x109689['VoiceQueueId'];this[_0xcb9f('0x2b')]=_0x109689['CampaignId'];this[_0xcb9f('0x2c')]=_0x109689[_0xcb9f('0x2c')]||'';this[_0xcb9f('0x2d')]=_0x109689[_0xcb9f('0x2d')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
index 1348c96..6bf9dd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde33=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime'];(function(_0x4e6605,_0x507557){var _0x12067c=function(_0x6154c){while(--_0x6154c){_0x4e6605['push'](_0x4e6605['shift']());}};_0x12067c(++_0x507557);}(_0xde33,0x1d3));var _0x3de3=function(_0x387ea0,_0x142434){_0x387ea0=_0x387ea0-0x0;var _0x53c083=_0xde33[_0x387ea0];return _0x53c083;};'use strict';var util=require(_0x3de3('0x0'));var _=require('lodash');var moment=require(_0x3de3('0x1'));function getSeconds(_0x6d351b,_0x357486){var _0x3a08c2=moment(_0x6d351b)['milliseconds'](0x0);var _0x36b60f=moment(_0x357486)['milliseconds'](0x0);return _0x3a08c2['diff'](_0x36b60f,_0x3de3('0x2'));}function Final(_0x1d3def){this['uniqueid']=_0x1d3def['uniqueid'];this[_0x3de3('0x3')]=_0x1d3def[_0x3de3('0x3')];this['type']=_0x1d3def[_0x3de3('0x4')];this[_0x3de3('0x5')]=_0x1d3def[_0x3de3('0x4')]===_0x3de3('0x6')?_0x3de3('0x7'):_0x1d3def['type'];this[_0x3de3('0x8')]=_0x1d3def['countbusyretry'];this['countcongestionretry']=_0x1d3def['countcongestionretry'];this[_0x3de3('0x9')]=_0x1d3def[_0x3de3('0x9')];this[_0x3de3('0xa')]=_0x1d3def[_0x3de3('0x8')]+_0x1d3def['countcongestionretry']+_0x1d3def[_0x3de3('0x9')]+_0x1d3def[_0x3de3('0xb')]+_0x1d3def[_0x3de3('0xc')]+_0x1d3def[_0x3de3('0xd')]+_0x1d3def['countmachineretry']+_0x1d3def[_0x3de3('0xe')];this[_0x3de3('0xb')]=_0x1d3def[_0x3de3('0xb')];this[_0x3de3('0xc')]=_0x1d3def[_0x3de3('0xc')];this[_0x3de3('0xd')]=_0x1d3def[_0x3de3('0xd')];this[_0x3de3('0xf')]=_0x1d3def[_0x3de3('0xf')];this['countagentrejectretry']=_0x1d3def['countagentrejectretry'];this[_0x3de3('0x7')]=_0x1d3def[_0x3de3('0x7')];this[_0x3de3('0x10')]=_0x1d3def[_0x3de3('0x10')];this[_0x3de3('0x11')]=_0x1d3def[_0x3de3('0x11')];this[_0x3de3('0x12')]=_0x1d3def[_0x3de3('0x12')];this[_0x3de3('0x13')]=_0x1d3def[_0x3de3('0x13')];this[_0x3de3('0x14')]=_0x1d3def[_0x3de3('0x13')];this['ringtime']=_0x1d3def[_0x3de3('0x15')]||0x0;this[_0x3de3('0x16')]=_0x1d3def['holdtime']||0x0;this[_0x3de3('0x17')]=_0x1d3def[_0x3de3('0x17')]||0x0;this[_0x3de3('0x18')]=_0x1d3def[_0x3de3('0x18')];this[_0x3de3('0x19')]=_0x1d3def[_0x3de3('0x19')];this[_0x3de3('0x1a')]=_0x1d3def[_0x3de3('0x1a')];this[_0x3de3('0x1b')]=_0x1d3def[_0x3de3('0x1b')];this['ContactId']=_0x1d3def[_0x3de3('0x1c')];this[_0x3de3('0x1d')]=_0x1d3def['ListId'];this[_0x3de3('0x1e')]=_0x1d3def[_0x3de3('0x1e')];this['VoiceQueueId']=_0x1d3def[_0x3de3('0x1f')];this[_0x3de3('0x20')]=_0x1d3def['CampaignId'];this[_0x3de3('0x21')]=_0x1d3def['originatecalleridnum']||'';this[_0x3de3('0x22')]=_0x1d3def[_0x3de3('0x22')]||'';}module['exports']=Final;
\ No newline at end of file
+var _0x16d5=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x37cc43,_0x4598ef){var _0x52843b=function(_0x482c8a){while(--_0x482c8a){_0x37cc43['push'](_0x37cc43['shift']());}};_0x52843b(++_0x4598ef);}(_0x16d5,0x151));var _0x516d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16d5[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x516d('0x0'));var _=require(_0x516d('0x1'));var moment=require(_0x516d('0x2'));function getSeconds(_0x1c1276,_0x1eef5f){var _0x4b80d8=moment(_0x1c1276)[_0x516d('0x3')](0x0);var _0x278b7c=moment(_0x1eef5f)['milliseconds'](0x0);return _0x4b80d8[_0x516d('0x4')](_0x278b7c,_0x516d('0x5'));}function Final(_0x494458){this['uniqueid']=_0x494458[_0x516d('0x6')];this['scheduledat']=_0x494458['scheduledat'];this[_0x516d('0x7')]=_0x494458[_0x516d('0x7')];this[_0x516d('0x8')]=_0x494458[_0x516d('0x7')]===_0x516d('0x9')?'queue':_0x494458[_0x516d('0x7')];this['countbusyretry']=_0x494458[_0x516d('0xa')];this[_0x516d('0xb')]=_0x494458['countcongestionretry'];this[_0x516d('0xc')]=_0x494458[_0x516d('0xc')];this[_0x516d('0xd')]=_0x494458[_0x516d('0xa')]+_0x494458['countcongestionretry']+_0x494458[_0x516d('0xc')]+_0x494458[_0x516d('0xe')]+_0x494458[_0x516d('0xf')]+_0x494458[_0x516d('0x10')]+_0x494458[_0x516d('0x11')]+_0x494458[_0x516d('0x12')];this['countnosuchnumberretry']=_0x494458['countnosuchnumberretry'];this[_0x516d('0xf')]=_0x494458[_0x516d('0xf')];this[_0x516d('0x10')]=_0x494458[_0x516d('0x10')];this[_0x516d('0x11')]=_0x494458[_0x516d('0x11')];this[_0x516d('0x12')]=_0x494458['countagentrejectretry'];this[_0x516d('0x13')]=_0x494458[_0x516d('0x13')];this['calleridname']=_0x494458[_0x516d('0x14')];this[_0x516d('0x15')]=_0x494458['calleridnum'];this[_0x516d('0x16')]=_0x494458[_0x516d('0x16')];this['responsetime']=_0x494458[_0x516d('0x17')];this[_0x516d('0x18')]=_0x494458[_0x516d('0x17')];this[_0x516d('0x19')]=_0x494458[_0x516d('0x19')]||0x0;this[_0x516d('0x1a')]=_0x494458['holdtime']||0x0;this[_0x516d('0x1b')]=_0x494458[_0x516d('0x1b')]||0x0;this[_0x516d('0x1c')]=_0x494458['callback'];this[_0x516d('0x1d')]=_0x494458['callbackuniqueid'];this['callbackat']=_0x494458['callbackat'];this[_0x516d('0x1e')]=_0x494458[_0x516d('0x1e')];this[_0x516d('0x1f')]=_0x494458[_0x516d('0x1f')];this[_0x516d('0x20')]=_0x494458[_0x516d('0x20')];this[_0x516d('0x21')]=_0x494458[_0x516d('0x21')];this[_0x516d('0x22')]=_0x494458[_0x516d('0x22')];this[_0x516d('0x23')]=_0x494458['CampaignId'];this[_0x516d('0x24')]=_0x494458[_0x516d('0x24')]||'';this[_0x516d('0x25')]=_0x494458[_0x516d('0x25')]||'';}module[_0x516d('0x26')]=Final;
\ No newline at end of file
index 570b84c..86f7da4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe52f=['reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','number','starttime','responsetime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername'];(function(_0x4508c7,_0x5ed41a){var _0x335e9e=function(_0x1cbc91){while(--_0x1cbc91){_0x4508c7['push'](_0x4508c7['shift']());}};_0x335e9e(++_0x5ed41a);}(_0xe52f,0x15b));var _0xfe52=function(_0x349cf5,_0x36cd79){_0x349cf5=_0x349cf5-0x0;var _0x1754af=_0xe52f[_0x349cf5];return _0x1754af;};'use strict';var util=require(_0xfe52('0x0'));var _=require('lodash');var moment=require(_0xfe52('0x1'));function getSeconds(_0x5dbde6,_0x231bd1){var _0x1ca5b9=moment(_0x5dbde6)[_0xfe52('0x2')](0x0);var _0x2bc282=moment(_0x231bd1)['milliseconds'](0x0);return _0x1ca5b9[_0xfe52('0x3')](_0x2bc282,_0xfe52('0x4'));}function Hangup(_0x1c522c,_0xea9a03){this['state']=0x4;this[_0xfe52('0x5')]=_0xfe52('0x6');this['scheduledat']=_0x1c522c[_0xfe52('0x7')];this[_0xfe52('0x8')]=_0x1c522c[_0xfe52('0x8')];this['campaigntype']=_0x1c522c[_0xfe52('0x8')]===_0xfe52('0x9')?_0xfe52('0xa'):_0x1c522c['type'];this['countbusyretry']=_0x1c522c[_0xfe52('0xb')];this['countcongestionretry']=_0x1c522c['countcongestionretry'];this['countnoanswerretry']=_0x1c522c[_0xfe52('0xc')];this[_0xfe52('0xd')]=_0x1c522c[_0xfe52('0xb')]+_0x1c522c[_0xfe52('0xe')]+_0x1c522c[_0xfe52('0xc')]+_0x1c522c[_0xfe52('0xf')]+_0x1c522c[_0xfe52('0x10')]+_0x1c522c[_0xfe52('0x11')]+_0x1c522c[_0xfe52('0x12')]+_0x1c522c['countagentrejectretry'];this[_0xfe52('0xf')]=_0x1c522c[_0xfe52('0xf')];this[_0xfe52('0x10')]=_0x1c522c[_0xfe52('0x10')];this[_0xfe52('0x11')]=_0x1c522c[_0xfe52('0x11')];this[_0xfe52('0x12')]=_0x1c522c['countmachineretry'];this[_0xfe52('0x13')]=_0x1c522c['countagentrejectretry'];this[_0xfe52('0x14')]=_0xea9a03[_0xfe52('0x14')];this[_0xfe52('0x15')]=_0x1c522c['name'];this['calleridnum']=_0x1c522c[_0xfe52('0x16')];this[_0xfe52('0x17')]=_0x1c522c['starttime'];this[_0xfe52('0x18')]=_0x1c522c[_0xfe52('0x18')];this['endtime']=moment()['format'](_0xfe52('0x19'));this[_0xfe52('0x1a')]=getSeconds(_0x1c522c[_0xfe52('0x18')],_0x1c522c[_0xfe52('0x17')]);this[_0xfe52('0x1b')]=0x0;this[_0xfe52('0x1c')]=getSeconds(this[_0xfe52('0x1d')],_0x1c522c[_0xfe52('0x18')]);this[_0xfe52('0xa')]=_0x1c522c[_0xfe52('0xa')];this[_0xfe52('0x1e')]='IVR';this[_0xfe52('0x1f')]=_0xea9a03[_0xfe52('0x20')];this[_0xfe52('0x21')]=_0x1c522c['callback'];this[_0xfe52('0x22')]=_0x1c522c[_0xfe52('0x22')];this['callbackat']=_0x1c522c[_0xfe52('0x23')];this[_0xfe52('0x24')]=_0x1c522c[_0xfe52('0x24')];this[_0xfe52('0x25')]=_0x1c522c[_0xfe52('0x25')];this[_0xfe52('0x26')]=_0x1c522c[_0xfe52('0x26')];this['UserId']=_0x1c522c['UserId'];this[_0xfe52('0x27')]=_0x1c522c[_0xfe52('0x27')];this[_0xfe52('0x28')]=_0x1c522c['CampaignId'];}module[_0xfe52('0x29')]=Hangup;
\ No newline at end of file
+var _0x888e=['calleridnum','number','starttime','responsetime','endtime','format','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name'];(function(_0xb8dcd7,_0x5d832b){var _0x121a74=function(_0x5af714){while(--_0x5af714){_0xb8dcd7['push'](_0xb8dcd7['shift']());}};_0x121a74(++_0x5d832b);}(_0x888e,0x97));var _0xe888=function(_0x1123ab,_0x57be3c){_0x1123ab=_0x1123ab-0x0;var _0x26ccbf=_0x888e[_0x1123ab];return _0x26ccbf;};'use strict';var util=require(_0xe888('0x0'));var _=require(_0xe888('0x1'));var moment=require('moment');function getSeconds(_0x28a433,_0x5cc2f8){var _0x3907b5=moment(_0x28a433)[_0xe888('0x2')](0x0);var _0x2a0c2d=moment(_0x5cc2f8)[_0xe888('0x2')](0x0);return _0x3907b5['diff'](_0x2a0c2d,_0xe888('0x3'));}function Hangup(_0x304885,_0x1a5585){this[_0xe888('0x4')]=0x4;this[_0xe888('0x5')]=_0xe888('0x6');this[_0xe888('0x7')]=_0x304885[_0xe888('0x7')];this[_0xe888('0x8')]=_0x304885[_0xe888('0x8')];this['campaigntype']=_0x304885[_0xe888('0x8')]==='outbound'?_0xe888('0x9'):_0x304885[_0xe888('0x8')];this[_0xe888('0xa')]=_0x304885[_0xe888('0xa')];this['countcongestionretry']=_0x304885[_0xe888('0xb')];this[_0xe888('0xc')]=_0x304885[_0xe888('0xc')];this['countglobal']=_0x304885[_0xe888('0xa')]+_0x304885[_0xe888('0xb')]+_0x304885[_0xe888('0xc')]+_0x304885[_0xe888('0xd')]+_0x304885['countdropretry']+_0x304885[_0xe888('0xe')]+_0x304885['countmachineretry']+_0x304885[_0xe888('0xf')];this[_0xe888('0xd')]=_0x304885['countnosuchnumberretry'];this[_0xe888('0x10')]=_0x304885[_0xe888('0x10')];this[_0xe888('0xe')]=_0x304885[_0xe888('0xe')];this[_0xe888('0x11')]=_0x304885['countmachineretry'];this['countagentrejectretry']=_0x304885['countagentrejectretry'];this[_0xe888('0x12')]=_0x1a5585['uniqueid'];this[_0xe888('0x13')]=_0x304885[_0xe888('0x14')];this[_0xe888('0x15')]=_0x304885[_0xe888('0x16')];this[_0xe888('0x17')]=_0x304885[_0xe888('0x17')];this[_0xe888('0x18')]=_0x304885[_0xe888('0x18')];this[_0xe888('0x19')]=moment()[_0xe888('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe888('0x1b')]=getSeconds(_0x304885[_0xe888('0x18')],_0x304885[_0xe888('0x17')]);this[_0xe888('0x1c')]=0x0;this[_0xe888('0x1d')]=getSeconds(this[_0xe888('0x19')],_0x304885[_0xe888('0x18')]);this[_0xe888('0x9')]=_0x304885[_0xe888('0x9')];this[_0xe888('0x1e')]=_0xe888('0x1f');this[_0xe888('0x20')]=_0x1a5585[_0xe888('0x21')];this[_0xe888('0x22')]=_0x304885['callback'];this['callbackuniqueid']=_0x304885['callbackuniqueid'];this[_0xe888('0x23')]=_0x304885[_0xe888('0x23')];this['recallme']=_0x304885[_0xe888('0x24')];this['ContactId']=_0x304885[_0xe888('0x25')];this['ListId']=_0x304885[_0xe888('0x26')];this[_0xe888('0x27')]=_0x304885[_0xe888('0x27')];this[_0xe888('0x28')]=_0x304885['VoiceQueueId'];this[_0xe888('0x29')]=_0x304885['CampaignId'];}module[_0xe888('0x2a')]=Hangup;
\ No newline at end of file
index f5f5d56..a4dbbcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd93c=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','name','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue'];(function(_0x23a8b9,_0x5923a2){var _0x21fe72=function(_0x4d3380){while(--_0x4d3380){_0x23a8b9['push'](_0x23a8b9['shift']());}};_0x21fe72(++_0x5923a2);}(_0xd93c,0x1bd));var _0xcd93=function(_0x4560e4,_0x37b712){_0x4560e4=_0x4560e4-0x0;var _0x1d1227=_0xd93c[_0x4560e4];return _0x1d1227;};'use strict';var util=require(_0xcd93('0x0'));var _=require(_0xcd93('0x1'));var moment=require(_0xcd93('0x2'));function getSeconds(_0x338a12,_0x5e7022){var _0x22dbbc=moment(_0x338a12)[_0xcd93('0x3')](0x0);var _0xecb4f2=moment(_0x5e7022)[_0xcd93('0x3')](0x0);return _0x22dbbc['diff'](_0xecb4f2,_0xcd93('0x4'));}function History(_0x5d7990){this['uniqueid']=_0x5d7990[_0xcd93('0x5')];this[_0xcd93('0x6')]=_0x5d7990[_0xcd93('0x6')]||undefined;this[_0xcd93('0x7')]=_0x5d7990[_0xcd93('0x7')];this[_0xcd93('0x8')]=_0x5d7990['type']===_0xcd93('0x9')?_0xcd93('0xa'):_0x5d7990[_0xcd93('0x7')];this[_0xcd93('0xb')]=_0x5d7990[_0xcd93('0xb')];this[_0xcd93('0xc')]=_0x5d7990[_0xcd93('0xc')];this['countnoanswerretry']=_0x5d7990[_0xcd93('0xd')];this[_0xcd93('0xe')]=_0x5d7990[_0xcd93('0xb')]+_0x5d7990[_0xcd93('0xc')]+_0x5d7990[_0xcd93('0xd')]+_0x5d7990['countnosuchnumberretry']+_0x5d7990[_0xcd93('0xf')]+_0x5d7990[_0xcd93('0x10')]+_0x5d7990[_0xcd93('0x11')]+_0x5d7990['countagentrejectretry'];this[_0xcd93('0x12')]=_0x5d7990[_0xcd93('0x12')];this['countdropretry']=_0x5d7990['countdropretry'];this[_0xcd93('0x10')]=_0x5d7990[_0xcd93('0x10')];this[_0xcd93('0x11')]=_0x5d7990[_0xcd93('0x11')];this[_0xcd93('0x13')]=_0x5d7990[_0xcd93('0x13')];this[_0xcd93('0xa')]=_0x5d7990[_0xcd93('0xa')];this['calleridname']=_0x5d7990[_0xcd93('0x14')];this['calleridnum']=_0x5d7990['number'];this[_0xcd93('0x15')]=_0x5d7990[_0xcd93('0x15')];this[_0xcd93('0x16')]=_0x5d7990[_0xcd93('0x16')];this['endtime']=_0x5d7990[_0xcd93('0x16')];this[_0xcd93('0x17')]=getSeconds(_0x5d7990[_0xcd93('0x16')],_0x5d7990[_0xcd93('0x15')]);this[_0xcd93('0x18')]=0x0;this[_0xcd93('0x19')]=0x0;this[_0xcd93('0x1a')]=_0x5d7990[_0xcd93('0x1a')];this[_0xcd93('0x1b')]=_0x5d7990[_0xcd93('0x1b')];this[_0xcd93('0x1c')]=_0x5d7990['callbackat'];this[_0xcd93('0x1d')]=_0x5d7990[_0xcd93('0x1d')];this[_0xcd93('0x1e')]=_0x5d7990[_0xcd93('0x1e')];this[_0xcd93('0x1f')]=_0x5d7990[_0xcd93('0x1f')];this[_0xcd93('0x20')]=_0x5d7990['UserId'];this[_0xcd93('0x21')]=_0x5d7990[_0xcd93('0x21')];this[_0xcd93('0x22')]=_0x5d7990[_0xcd93('0x22')];this[_0xcd93('0x23')]=_0x5d7990[_0xcd93('0x23')]||'';this[_0xcd93('0x24')]=_0x5d7990[_0xcd93('0x24')]||'';}module[_0xcd93('0x25')]=History;
\ No newline at end of file
+var _0x80bf=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','calleridnum','number','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x80bf,0x148));var _0xf80b=function(_0x4b3dbd,_0x2ce11e){_0x4b3dbd=_0x4b3dbd-0x0;var _0xa1d42c=_0x80bf[_0x4b3dbd];return _0xa1d42c;};'use strict';var util=require(_0xf80b('0x0'));var _=require(_0xf80b('0x1'));var moment=require('moment');function getSeconds(_0x3a92cf,_0x3534df){var _0x47fce7=moment(_0x3a92cf)[_0xf80b('0x2')](0x0);var _0x486f2f=moment(_0x3534df)[_0xf80b('0x2')](0x0);return _0x47fce7['diff'](_0x486f2f,_0xf80b('0x3'));}function History(_0x285862){this['uniqueid']=_0x285862['uniqueid'];this[_0xf80b('0x4')]=_0x285862['scheduledat']||undefined;this[_0xf80b('0x5')]=_0x285862[_0xf80b('0x5')];this[_0xf80b('0x6')]=_0x285862[_0xf80b('0x5')]===_0xf80b('0x7')?_0xf80b('0x8'):_0x285862[_0xf80b('0x5')];this[_0xf80b('0x9')]=_0x285862['countbusyretry'];this['countcongestionretry']=_0x285862[_0xf80b('0xa')];this[_0xf80b('0xb')]=_0x285862['countnoanswerretry'];this[_0xf80b('0xc')]=_0x285862[_0xf80b('0x9')]+_0x285862[_0xf80b('0xa')]+_0x285862[_0xf80b('0xb')]+_0x285862['countnosuchnumberretry']+_0x285862[_0xf80b('0xd')]+_0x285862[_0xf80b('0xe')]+_0x285862['countmachineretry']+_0x285862[_0xf80b('0xf')];this[_0xf80b('0x10')]=_0x285862['countnosuchnumberretry'];this[_0xf80b('0xd')]=_0x285862[_0xf80b('0xd')];this['countabandonedretry']=_0x285862[_0xf80b('0xe')];this[_0xf80b('0x11')]=_0x285862[_0xf80b('0x11')];this[_0xf80b('0xf')]=_0x285862[_0xf80b('0xf')];this[_0xf80b('0x8')]=_0x285862[_0xf80b('0x8')];this['calleridname']=_0x285862['name'];this[_0xf80b('0x12')]=_0x285862[_0xf80b('0x13')];this['starttime']=_0x285862[_0xf80b('0x14')];this['responsetime']=_0x285862['responsetime'];this[_0xf80b('0x15')]=_0x285862[_0xf80b('0x16')];this[_0xf80b('0x17')]=getSeconds(_0x285862[_0xf80b('0x16')],_0x285862[_0xf80b('0x14')]);this[_0xf80b('0x18')]=0x0;this[_0xf80b('0x19')]=0x0;this[_0xf80b('0x1a')]=_0x285862[_0xf80b('0x1a')];this[_0xf80b('0x1b')]=_0x285862[_0xf80b('0x1b')];this[_0xf80b('0x1c')]=_0x285862[_0xf80b('0x1c')];this['recallme']=_0x285862[_0xf80b('0x1d')];this['ContactId']=_0x285862['ContactId'];this[_0xf80b('0x1e')]=_0x285862[_0xf80b('0x1e')];this[_0xf80b('0x1f')]=_0x285862[_0xf80b('0x1f')];this[_0xf80b('0x20')]=_0x285862[_0xf80b('0x20')];this[_0xf80b('0x21')]=_0x285862[_0xf80b('0x21')];this[_0xf80b('0x22')]=_0x285862['originatecalleridnum']||'';this[_0xf80b('0x23')]=_0x285862[_0xf80b('0x23')]||'';}module['exports']=History;
\ No newline at end of file
index 1eeff2c..9c966e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81cb=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','pTalking','sendMessageOneNotActive','NOT_ACTIVE','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','endtime','loopClearZombieChannels','[uniqueid]','actions','[actions]','clearZombieChannels','hasOwnProperty','sequence','isNil','Action','status','channel','catch','No\x20such\x20channel','queue','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','merge','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','SIP/%s','reachable','saveInDb','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','state','statedesc','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','countcongestionretry','stateGlobal','dialMachineMaxRetry','minutes','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','syncQueueCallerAbandon','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','syncQueueMember','actionid','strategy','locked','stateinterface','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','iftime\x20%s,%s','interval','content','indexOf','true','timezones','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','checkIfTime','dialTimezone','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','pow','replace','match','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','dialPrefix','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','syncOriginateResponse','responsetime','getQueue','callProgressDetecting','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','checkRetriveMax','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','createStateFinal','reason\x203\x20ringing\x20no\x20answer','buildObj','busy','dialBusyMaxRetry','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','predictiveIntervalPauses','check\x20failure','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','log','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','dialLimitQueue','ACTIVE','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[countReScheduled]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Error','Ts\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','p\x20=\x20','interval\x20=\x20','Umin\x20=\x20','exports','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopper','./history','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','originateresponse','bind','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','name','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','[ifTime][Action]','milliseconds','diff','seconds','emit','type','outbound','answered','available','loggedIn','sumBillable','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay'];(function(_0x35a441,_0x3a2ec6){var _0x571ce3=function(_0x161827){while(--_0x161827){_0x35a441['push'](_0x35a441['shift']());}};_0x571ce3(++_0x3a2ec6);}(_0x81cb,0x1c4));var _0xb81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81cb[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0xb81c('0x0'));var uuid=require(_0xb81c('0x1'));var moment=require('moment');var rr=require('rr');var md5=require(_0xb81c('0x2'));var Redis=require(_0xb81c('0x3'));var ut=require(_0xb81c('0x4'));var config=require(_0xb81c('0x5'));var logger=require(_0xb81c('0x6'))(_0xb81c('0x7'));var loggerBooked=require(_0xb81c('0x6'))(_0xb81c('0x8'));var loggerPredictive=require(_0xb81c('0x6'))('predictive');var loggerPredictiveCalls=require(_0xb81c('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xb81c('0x6'))('syncQueueSummary');var ami=require(_0xb81c('0x9'));config['redis']=_[_0xb81c('0xa')](config[_0xb81c('0xb')],{'host':_0xb81c('0xc'),'port':0x18eb});var io=require(_0xb81c('0xd'))(new Redis(config[_0xb81c('0xb')]));var cmHopper=require(_0xb81c('0xe'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require(_0xb81c('0xf'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xb81c('0x10'));var Hangup=require(_0xb81c('0x11'));var ipAgi=process[_0xb81c('0x12')]['XCALLY_IP_AGI']||_0xb81c('0x13');var strategy={'rrmemory':_0xb81c('0x14'),'roundrobin':_0xb81c('0x15')};var Sequence=function(){};Sequence[_0xb81c('0x16')][_0xb81c('0x17')]=function(_0x194281){this['tail']=this[_0xb81c('0x18')]?this[_0xb81c('0x18')][_0xb81c('0x19')](_0x194281):_0x194281();};function Dialer(_0x292a13,_0x2be89c){this['sequence']=new Sequence();this[_0xb81c('0x1a')]=_0x2be89c;this[_0xb81c('0x1b')]=_0x292a13[_0xb81c('0x1b')];this[_0xb81c('0x1c')]=_0x292a13['campaigns'];this[_0xb81c('0x1d')]=_0x292a13[_0xb81c('0x1d')];this[_0xb81c('0x1e')]=_0x292a13[_0xb81c('0x1e')];this['maxNumberOriginate']=config[_0xb81c('0x1f')]||0x2;this['channels']={};this['actions']={};this['contactsId']={};this[_0xb81c('0x20')]={};this[_0xb81c('0x21')]={};this[_0xb81c('0x22')]={};this[_0xb81c('0x23')]={};this['ivrOriginated']={};this[_0xb81c('0x24')]={};this[_0xb81c('0x25')]={};ami['on'](_0xb81c('0x26'),this[_0xb81c('0x27')]['bind'](this));ami['on'](_0xb81c('0x28'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xb81c('0x29'),this['syncOriginateResponse'][_0xb81c('0x2a')](this));ami['on'](_0xb81c('0x2b'),this[_0xb81c('0x2c')][_0xb81c('0x2a')](this));ami['on'](_0xb81c('0x2d'),this[_0xb81c('0x2e')][_0xb81c('0x2a')](this));ami['on'](_0xb81c('0x2f'),this[_0xb81c('0x30')][_0xb81c('0x2a')](this));ami['on'](_0xb81c('0x31'),this[_0xb81c('0x32')]['bind'](this));ami['on']('varset',this[_0xb81c('0x33')][_0xb81c('0x2a')](this));ami['on'](_0xb81c('0x34'),this['syncQueueMember'][_0xb81c('0x2a')](this));ami['on'](_0xb81c('0x35'),this[_0xb81c('0x36')]['bind'](this));this[_0xb81c('0x37')]();this['loopClearZombieChannels']();}function isNotNull(_0x65a45d){return _0x65a45d!==null&&!_[_0xb81c('0x38')](_0x65a45d);}function checkIsLoggedIn(_0x3ca734,_0x4a47ca){return function(){if(_0x4a47ca<=0x0){_0x3ca734[_0xb81c('0x39')]=_0xb81c('0x3a');throw _0x3ca734['name']+_0xb81c('0x3b');}};}function isActive(_0x3e0cf4){return _0x3e0cf4;}function checkIsActive(_0x2f66be,_0x47eb21){return function(){if(!isActive(_0x47eb21)){_0x2f66be['message']='NOT_ACTIVE';throw _0x2f66be[_0xb81c('0x3c')]+_0xb81c('0x3d');}};}function checkInterval(_0x571413){return function(){if(!isNotNull(_0x571413[_0xb81c('0x3e')])){_0x571413[_0xb81c('0x39')]='INTERVAL_IS_NULL';throw _0x571413[_0xb81c('0x3c')]+_0xb81c('0x3f');}if(!isNotNull(_0x571413[_0xb81c('0x3e')][_0xb81c('0x40')])){_0x571413[_0xb81c('0x39')]='INTERVAL_IS_NULL';throw _0x571413[_0xb81c('0x3c')]+_0xb81c('0x3f');}if(!isNotNull(_['isEmpty'](_0x571413['Interval']['Intervals']))){_0x571413['message']=_0xb81c('0x41');throw _0x571413[_0xb81c('0x3c')]+_0xb81c('0x3f');}};}function msgResponse(_0x52553d,_0x37d50a,_0xf5fe67){return{'action':_0x52553d,'response':_0x37d50a,'message':_0xf5fe67,'stack':_0xf5fe67};}function myreject(_0x24afb3){return function(_0x3a32d8){return _0x24afb3(msgResponse(_0xb81c('0x42'),'Error',JSON['stringify'](_0x3a32d8)));};}function getSeconds(_0x2ca953,_0x6d4aec){var _0x3ff6b5=moment(_0x2ca953)[_0xb81c('0x43')](0x0);var _0x1f3ed6=moment(_0x6d4aec)[_0xb81c('0x43')](0x0);return _0x3ff6b5[_0xb81c('0x44')](_0x1f3ed6,_0xb81c('0x45'));}function emit(_0xd8f54f,_0x47e82d,_0x132568){io['to'](_0xd8f54f)[_0xb81c('0x46')](_0x47e82d,_0x132568);}function emitVoiceQueueSummary(_0xc452fa){if(_0xc452fa[_0xb81c('0x47')]===_0xb81c('0x48')){var _0x46f886={'id':_0xc452fa['id'],'name':_0xc452fa[_0xb81c('0x3c')],'strategy':_0xc452fa['strategy'],'answered':_0xc452fa[_0xb81c('0x49')],'available':_0xc452fa[_0xb81c('0x4a')],'loggedIn':_0xc452fa[_0xb81c('0x4b')],'pTalking':_0xc452fa['pTalking'],'sumBillable':_0xc452fa[_0xb81c('0x4c')],'sumDuration':_0xc452fa['sumDuration'],'sumHoldTime':_0xc452fa['sumHoldTime']||0x0,'talking':_0xc452fa[_0xb81c('0x4d')],'total':_0xc452fa[_0xb81c('0x4e')],'type':_0xc452fa[_0xb81c('0x47')],'unmanaged':_0xc452fa[_0xb81c('0x4f')],'abandoned':_0xc452fa[_0xb81c('0x50')],'waiting':_0xc452fa[_0xb81c('0x51')],'loggedInDb':_0xc452fa[_0xb81c('0x52')],'dialActive':_0xc452fa[_0xb81c('0x53')],'dialMethod':_0xc452fa[_0xb81c('0x54')],'dialOriginateCallerIdName':_0xc452fa[_0xb81c('0x55')],'dialOriginateCallerIdNumber':_0xc452fa[_0xb81c('0x56')],'dialOriginateTimeout':_0xc452fa[_0xb81c('0x57')],'dialPrefix':_0xc452fa['dialPrefix'],'outboundAnswerAgiCallsDay':_0xc452fa[_0xb81c('0x58')],'outboundAnswerCallsDay':_0xc452fa[_0xb81c('0x59')],'outboundBlacklistCallsDay':_0xc452fa[_0xb81c('0x5a')],'outboundBusyCallsDay':_0xc452fa[_0xb81c('0x5b')],'outboundCongestionCallsDay':_0xc452fa[_0xb81c('0x5c')],'outboundDropCallsDayACS':_0xc452fa[_0xb81c('0x5d')],'outboundDropCallsDayCallersExit':_0xc452fa[_0xb81c('0x5e')],'outboundDropCallsDayTimeout':_0xc452fa['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0xc452fa[_0xb81c('0x5f')],'outboundNoSuchCallsDay':_0xc452fa['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0xc452fa[_0xb81c('0x60')],'outboundReCallsDay':_0xc452fa[_0xb81c('0x61')],'outboundRejectCallsDay':_0xc452fa[_0xb81c('0x62')],'outboundUnknownCallsDay':_0xc452fa['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0xc452fa[_0xb81c('0x63')],'predictiveIntervalAvgHoldtime':_0xc452fa[_0xb81c('0x64')],'predictiveIntervalAvgTalktime':_0xc452fa[_0xb81c('0x65')],'predictiveIntervalDroppedCallsCallersExit':_0xc452fa[_0xb81c('0x66')],'predictiveIntervalDroppedCallsTimeout':_0xc452fa[_0xb81c('0x67')],'predictiveIntervalErlangCalls':_0xc452fa[_0xb81c('0x68')],'predictiveIntervalErlangCallsDroppedCalls':_0xc452fa[_0xb81c('0x69')],'predictiveIntervalHitRate':_0xc452fa[_0xb81c('0x6a')],'predictiveIntervalMultiplicativeFactor':_0xc452fa[_0xb81c('0x6b')],'predictiveIntervalPauses':_0xc452fa['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0xc452fa[_0xb81c('0x6c')],'predictiveIntervalTotalCalls':_0xc452fa[_0xb81c('0x6d')],'message':_0xc452fa[_0xb81c('0x39')],'originated':_0xc452fa['originated'],'erlangCalls':_0xc452fa[_0xb81c('0x6e')],'erlangCallToSecond':_0xc452fa[_0xb81c('0x6f')],'erlangAbandonmentRate':_0xc452fa['erlangAbandonmentRate'],'erlangBusyFactor':_0xc452fa[_0xb81c('0x70')],'startPredictive':_0xc452fa[_0xb81c('0x22')],'startProgressive':_0xc452fa[_0xb81c('0x23')]};if(_0xc452fa[_0xb81c('0x71')]){_0x46f886['Trunk']={'id':_0xc452fa[_0xb81c('0x71')]['id'],'name':_0xc452fa[_0xb81c('0x71')][_0xb81c('0x3c')],'active':_0xc452fa['Trunk'][_0xb81c('0x72')],'callerid':_0xc452fa[_0xb81c('0x71')][_0xb81c('0x73')]};}if(_0xc452fa[_0xb81c('0x3e')]){_0x46f886[_0xb81c('0x3e')]={'id':_0xc452fa[_0xb81c('0x3e')]['id'],'name':_0xc452fa[_0xb81c('0x3e')][_0xb81c('0x3c')]};}var _0x544c0f=md5(JSON[_0xb81c('0x74')](_0x46f886));if(_0xc452fa['md5']!==_0x544c0f){_0xc452fa[_0xb81c('0x2')]=_0x544c0f;emit(util[_0xb81c('0x75')](_0xb81c('0x76'),_0x46f886[_0xb81c('0x3c')]),_0xb81c('0x77'),_0x46f886);}}}function emitCampaignSummary(_0x5dc586){if(_0x5dc586['type']===_0xb81c('0x78')){emit(util[_0xb81c('0x75')](_0xb81c('0x79'),_0x5dc586[_0xb81c('0x3c')]),'campaign:save',_0x5dc586);}}function checkGetDataPredictive(_0x32930f){if(isNotNull(_0x32930f)){if(!_[_0xb81c('0x7a')](_0x32930f)){loggerPredictive['info'](_0xb81c('0x7b'));loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x7d'),_0x32930f[_0xb81c('0x6d')]);loggerPredictive['info'](_0xb81c('0x7e'),_0x32930f[_0xb81c('0x63')]);loggerPredictive['info'](_0xb81c('0x7f'),_0x32930f[_0xb81c('0x67')]);loggerPredictive[_0xb81c('0x7c')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x32930f[_0xb81c('0x66')]);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x80'),_0x32930f[_0xb81c('0x64')]);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x81'),_0x32930f['predictiveIntervalAvgTalktime']);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x82'));if(_0x32930f[_0xb81c('0x6d')]>0x0){if(!_[_0xb81c('0x38')](_0x32930f[_0xb81c('0x65')])&&_0x32930f[_0xb81c('0x65')]>0x0){return!![];}else{loggerPredictive[_0xb81c('0x7c')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_['isUndefined'](_0x32930f[_0xb81c('0x64')])&&_0x32930f[_0xb81c('0x64')]>0x0){return!![];}else{loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x83'));}}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x84'));}}else{loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x84'));}return![];}function mergeDataErlangB(_0x2812cc){return function(_0x398524){loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x85'));loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x86'),_0x398524[_0xb81c('0x6e')]);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x87'),_0x398524[_0xb81c('0x6f')]);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x88'),_0x398524[_0xb81c('0x89')]);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x8a'),_0x398524[_0xb81c('0x70')]);loggerPredictive['info'](_0xb81c('0x88'),_0x398524[_0xb81c('0x89')]);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x82'));_['merge'](_0x2812cc,_0x398524);};}function getDiff(_0x36a105){var _0x569b00=moment()['milliseconds'](0x0);var _0xc83524=moment(_0x36a105)[_0xb81c('0x43')](0x0);return _0x569b00[_0xb81c('0x44')](_0xc83524,_0xb81c('0x45'));}function ifInterval(_0xc1d9e8,_0x24b193){if(_[_0xb81c('0x38')](_0x24b193)){return![];}if(getDiff(_0x24b193)<_0xc1d9e8*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x3d4335){if(isNotNull(_0x3d4335)){if(!_[_0xb81c('0x38')](_0x3d4335[_0xb81c('0x23')])){_0x3d4335[_0xb81c('0x23')]=undefined;loggerPredictive[_0xb81c('0x7c')](_0x3d4335[_0xb81c('0x3c')],_0xb81c('0x8b'));}if(!_[_0xb81c('0x38')](_0x3d4335[_0xb81c('0x22')])){_0x3d4335['startPredictive']=undefined;loggerPredictive[_0xb81c('0x7c')](_0x3d4335[_0xb81c('0x3c')],_0xb81c('0x8c'));}if(!_['isUndefined'](_0x3d4335[_0xb81c('0x8d')])){clearInterval(_0x3d4335[_0xb81c('0x8d')]);_0x3d4335[_0xb81c('0x8d')]=undefined;loggerPredictive[_0xb81c('0x7c')](_0x3d4335['name'],_0xb81c('0x8e'));}}}function erlangb(_0x2dbbfb,_0x12851a){if(_0x12851a===0x0){return 0x0;}var _0x4621c9=0x1;for(var _0x40d9e0=0x1;_0x40d9e0<=_0x12851a;_0x40d9e0+=0x1){_0x4621c9=0x1+_0x4621c9*_0x40d9e0/_0x2dbbfb;}return 0x1/_0x4621c9;}function isVoiceQueueOutbound(_0x241cac){return _0x241cac==='outbound';}function isNotPreview(_0x1f7967){return _0x1f7967!==_0xb81c('0x1a');}function isCampaignIvr(_0x28799e){return _0x28799e==='ivr';}function getCallerId(_0x239891,_0x787e8,_0x4a1915){if(!_[_0xb81c('0x38')](_0x4a1915)&&'string'===typeof _0x4a1915&&!_[_0xb81c('0x7a')](_0x4a1915)){if(!_[_0xb81c('0x38')](_0x787e8)&&'string'===typeof _0x787e8&&!_[_0xb81c('0x7a')](_0x787e8)){return util[_0xb81c('0x75')]('\x22%s\x22\x20<%s>',_0x787e8,_0x4a1915);}return util[_0xb81c('0x75')](_0xb81c('0x8f'),_0x4a1915,_0x4a1915);}if(!_['isUndefined'](_0x239891)&&'string'===typeof _0x239891&&!_[_0xb81c('0x7a')](_0x239891)){return _0x239891;}return _0xb81c('0x90');}function loggerCatchQueueSummary(_0x3c1c56,_0x429651){return function(_0x1517be){freeVariablesPredictive(_0x429651);emitVoiceQueueSummary(_0x429651);emitCampaignSummary(_0x429651);loggerSyncQueueSummary[_0xb81c('0x91')](_0x3c1c56,util[_0xb81c('0x92')](_0x1517be,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4f70f2,_0xf8a7a2){return function(_0xeb699b){loggerPredictive[_0xb81c('0x91')](_0xf8a7a2['name'],_0x4f70f2);loggerPredictive[_0xb81c('0x91')](_0xeb699b[_0xb81c('0x93')]);freeVariablesPredictive(_0xf8a7a2);};}function loggerCatch(_0x1bfd6e){return function(_0x574fac){logger[_0xb81c('0x91')](_0x1bfd6e,util[_0xb81c('0x92')](_0x574fac,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5d2707){return _0x5d2707&&!_[_0xb81c('0x38')](_0x5d2707)&&_0x5d2707[_0xb81c('0x94')]>0x0;}function decremetOriginate(_0x35bb9f){if(!_[_0xb81c('0x38')](_0x35bb9f)&&_0x35bb9f!==null){if(_0x35bb9f['hasOwnProperty']('originated')){if(_0x35bb9f[_0xb81c('0x95')]>0x0){_0x35bb9f[_0xb81c('0x95')]-=0x1;}else{logger[_0xb81c('0x91')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xb81c('0x91')](_0xb81c('0x96'));}}function checkContactLowerLimitOriginate(_0x14e774,_0x5dda35,_0x4b21db){if(_0x5dda35>_0x4b21db){for(var _0x5ced74=0x0;_0x5ced74<_0x5dda35-_0x4b21db;_0x5ced74+=0x1){decremetOriginate(_0x14e774);}}}function loggerGetContactDialer(_0x4f34e1,_0x375154,_0xd40af2){return function(_0x35f975){checkContactLowerLimitOriginate(_0x375154,_0xd40af2,0x0);logger['error'](_0x4f34e1,util[_0xb81c('0x92')](_0x35f975,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x504e18){return function(_0x348d33){if(isNotNull(_0x348d33)&&isNotNull(_0x348d33[0x0])){if(_0x348d33[0x0][_0xb81c('0x97')]>0x0){_0x504e18[_0xb81c('0x39')]=_0xb81c('0x98');logger[_0xb81c('0x7c')](_0xb81c('0x99')+_0x504e18[_0xb81c('0x3c')],_0x348d33[0x0][_0xb81c('0x97')],_0xb81c('0x9a'));}else{_0x504e18['message']=_0xb81c('0x9b');logger[_0xb81c('0x7c')](_0xb81c('0x9c')+_0x504e18[_0xb81c('0x3c')]);}}};}function notSendMessagesQueue(_0x416e67){if(_0x416e67['sendMessageOneNotActive']){freeVariablesPredictive(_0x416e67);if(_0x416e67[_0xb81c('0x95')]===0x0&&_0x416e67[_0xb81c('0x4d')]===0x0&&_0x416e67[_0xb81c('0x51')]===0x0&&(_0x416e67[_0xb81c('0x9d')]||0x0)===0x0){_0x416e67[_0xb81c('0x9e')]=![];_0x416e67[_0xb81c('0x4a')]=0x0;_0x416e67[_0xb81c('0x39')]=_0xb81c('0x9f');loggerSyncQueueSummary[_0xb81c('0x91')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x416e67['name'],_0xb81c('0xa0'));}else{_0x416e67[_0xb81c('0x39')]=_0xb81c('0xa1');loggerSyncQueueSummary[_0xb81c('0x91')](_0xb81c('0xa2'),_0x416e67['name'],_0xb81c('0xa3'));}emitVoiceQueueSummary(_0x416e67);}}function notSendMessagesCampaign(_0x55ec7f){if(_0x55ec7f['sendMessageOneNotActive']){if(_0x55ec7f[_0xb81c('0x95')]===0x0){_0x55ec7f['sendMessageOneNotActive']=![];_0x55ec7f[_0xb81c('0x39')]=_0xb81c('0x9f');loggerSyncQueueSummary[_0xb81c('0x91')](_0xb81c('0xa4'),_0x55ec7f[_0xb81c('0x3c')],_0xb81c('0xa0'));}else{_0x55ec7f[_0xb81c('0x39')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xb81c('0xa4'),_0x55ec7f['name'],_0xb81c('0xa3'));}emitCampaignSummary(_0x55ec7f);}}function createObjHistory(_0xba2d7,_0x433bdb,_0x3c0f0e,_0x18b8c8,_0x4e3559){_0xba2d7[_0xb81c('0x39')]=_0x3c0f0e;var _0x57faf3=new Action(_0xba2d7,_0x433bdb);var _0x56b601=new History(_0x57faf3);_0x56b601['state']=_0x18b8c8;_0x56b601['statedesc']=_0x4e3559;_0x56b601[_0xb81c('0xa5')]=_0x57faf3['starttime'];return _0x56b601;}Dialer['prototype'][_0xb81c('0xa6')]=function(){var _0x369835=this;setInterval(function(){_0x369835['clearZombieChannels'](_0x369835[_0xb81c('0x20')],_0xb81c('0xa7'));_0x369835['clearZombieChannels'](_0x369835[_0xb81c('0xa8')],_0xb81c('0xa9'));},0x32c8);};Dialer[_0xb81c('0x16')][_0xb81c('0xaa')]=function(_0x28907e,_0xb96be4){var _0xc499ea=this;for(var _0x18f44b in _0x28907e){if(_0x28907e[_0xb81c('0xab')](_0x18f44b)){this[_0xb81c('0xac')][_0xb81c('0x17')](function(){if(!_[_0xb81c('0xad')](_0x28907e[_0x18f44b])){return ami[_0xb81c('0xae')]({'action':_0xb81c('0xaf'),'channel':_0x28907e[_0x18f44b][_0xb81c('0xb0')]})[_0xb81c('0xb1')](function(_0x4245c1){if(_0x4245c1['message']===_0xb81c('0xb2')){setTimeout(function(){if(_0x28907e[_0x18f44b]&&_0x28907e[_0x18f44b][_0xb81c('0x47')]!==_0xb81c('0x78')){_0xc499ea['updateOriginated'](_0xc499ea[_0xb81c('0x1b')][_0x28907e[_0x18f44b][_0xb81c('0xb3')]]);logger[_0xb81c('0x91')]('[Dialer][checkChannel]',_0xb96be4,_0x18f44b,_0x28907e[_0x18f44b]['queue']);delete _0x28907e[_0x18f44b];}if(_0x28907e[_0x18f44b]&&_0x28907e[_0x18f44b][_0xb81c('0x47')]===_0xb81c('0x78')){_0xc499ea[_0xb81c('0xb4')](_0xc499ea[_0xb81c('0x1c')][_0x28907e[_0x18f44b][_0xb81c('0xb3')]]);logger[_0xb81c('0x91')](_0xb81c('0xb5'),_0xb96be4,_0x18f44b,_0x28907e[_0x18f44b][_0xb81c('0xb3')]);delete _0x28907e[_0x18f44b];}},0x2328);}});}});}}};Dialer[_0xb81c('0x16')][_0xb81c('0xb6')]=function(_0x1cfceb){return BPromise[_0xb81c('0xb7')]()[_0xb81c('0xb8')](cmHopper[_0xb81c('0xb6')](_0x1cfceb))[_0xb81c('0xb1')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xb81c('0x16')][_0xb81c('0xb9')]=function(_0x4d6bf6){return BPromise[_0xb81c('0xb7')]()['then'](cmHopperBlack[_0xb81c('0xb9')](_0x4d6bf6))[_0xb81c('0xb1')](loggerCatch(_0xb81c('0xba')));};Dialer['prototype'][_0xb81c('0xbb')]=function(_0x3ded57){return BPromise[_0xb81c('0xb7')]()['then'](cmHopperBlack[_0xb81c('0xbb')](_0x3ded57))[_0xb81c('0xb1')](loggerCatch(_0xb81c('0xbc')));};Dialer[_0xb81c('0x16')][_0xb81c('0xbd')]=function(_0x1516b4){return BPromise[_0xb81c('0xb7')]()[_0xb81c('0xb8')](cmHopperHistory[_0xb81c('0xbe')](_0x1516b4))[_0xb81c('0xb1')](loggerCatch(_0xb81c('0xbf')));};Dialer[_0xb81c('0x16')][_0xb81c('0xc0')]=function(_0x5ac4cf){return BPromise['resolve']()['then'](cmHopper[_0xb81c('0xc0')](_0x5ac4cf))[_0xb81c('0xb1')](loggerCatch(_0xb81c('0xc1')));};Dialer[_0xb81c('0x16')][_0xb81c('0xc2')]=function(_0x4650a8,_0x147a71,_0x579f28){return BPromise[_0xb81c('0xb7')]()[_0xb81c('0xb8')](cmHopper[_0xb81c('0xc2')](_0x4650a8,_0x147a71,_0x579f28))['catch'](loggerCatch(_0xb81c('0xc3')));};Dialer['prototype'][_0xb81c('0xc4')]=function(_0x18c588,_0x5cf0c3,_0xdc71a5,_0x59ad4f){return BPromise['resolve']()[_0xb81c('0xb8')](cmHopper[_0xb81c('0xc4')](_0x18c588,_0x5cf0c3,_0xdc71a5,_0x59ad4f))[_0xb81c('0xb1')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xb81c('0x16')][_0xb81c('0xc5')]=function(_0xd79665,_0x503137,_0x24ae7c){return BPromise['resolve']()['then'](cmHopper[_0xb81c('0xc5')](_0xd79665,_0x503137,_0x24ae7c))[_0xb81c('0xb1')](loggerCatch(_0xb81c('0xc6')));};Dialer[_0xb81c('0x16')][_0xb81c('0xc7')]=function(_0x37d3d8){return BPromise[_0xb81c('0xb7')]()[_0xb81c('0xb8')](voiceQueueRt['getVoiceQueueRtPauses'](_0x37d3d8))['catch'](loggerCatch(_0xb81c('0xc8')));};Dialer[_0xb81c('0x16')][_0xb81c('0xc9')]=function(_0x2538f7){return BPromise[_0xb81c('0xb7')]()[_0xb81c('0xb8')](cmHopper[_0xb81c('0xc9')](_0x2538f7))[_0xb81c('0xb1')](loggerCatch(_0xb81c('0xca')));};Dialer[_0xb81c('0x16')][_0xb81c('0xcb')]=function(_0x263a7a){return BPromise[_0xb81c('0xb7')]()['then'](cmHopperHistory[_0xb81c('0xcb')](_0x263a7a))[_0xb81c('0xb1')](loggerCatch(_0xb81c('0xcc')));};Dialer[_0xb81c('0x16')][_0xb81c('0xb4')]=function(_0x52d092){if(!_['isUndefined'](_0x52d092)&&_0x52d092!==null){if(_0x52d092[_0xb81c('0xab')](_0xb81c('0x95'))){if(_0x52d092[_0xb81c('0x95')]>0x0){_0x52d092[_0xb81c('0x95')]-=0x1;}else{logger[_0xb81c('0x91')](_0xb81c('0xcd'));}}}else{logger[_0xb81c('0x91')](_0xb81c('0xce'));}};Dialer[_0xb81c('0x16')][_0xb81c('0xcf')]=function(_0x45fdb2,_0x117c2){var _0x4f852a=this;return function(_0x1bb857){_0x4f852a[_0xb81c('0xb4')](_0x117c2);logger[_0xb81c('0x91')](_0x45fdb2,util[_0xb81c('0x92')](_0x1bb857,{'showHidden':![],'depth':null}));};};Dialer[_0xb81c('0x16')]['emptyContact']=function(_0x2f57ef,_0xfb44cb,_0xba056d){var _0x2c821a={'state':0x19,'statedesc':_0xb81c('0xd0')};this[_0xb81c('0xb4')](_0xfb44cb);this['saveInDb'](_[_0xb81c('0xd1')](_0x2c821a,_[_0xb81c('0xd2')](_0xba056d,[_0xb81c('0xd3'),_0xb81c('0xd4'),_0xb81c('0xd5'),_0xb81c('0xd6'),_0xb81c('0xd7')])),_0xb81c('0xd8'),_0xb81c('0xd9'));logger[_0xb81c('0x91')](_0x2f57ef);};Dialer[_0xb81c('0x16')][_0xb81c('0xda')]=function(_0x8848b6){return _0x8848b6===_0xb81c('0xdb');};Dialer[_0xb81c('0x16')]['isTrunkReachable']=function(_0x48b235){return!_[_0xb81c('0x38')](_0x48b235)&&_0x48b235&&!_[_0xb81c('0x38')](_0x48b235['name'])&&!_[_0xb81c('0x38')](_0x48b235[_0xb81c('0x72')])&&_0x48b235['active']&&(this['trunks'][util[_0xb81c('0x75')](_0xb81c('0xdc'),_0x48b235[_0xb81c('0x3c')])]['status']===_0xb81c('0xdd')||this[_0xb81c('0x1e')][util[_0xb81c('0x75')]('SIP/%s',_0x48b235['name'])][_0xb81c('0xaf')]==='unmonitored');};Dialer[_0xb81c('0x16')][_0xb81c('0xde')]=function(_0x4a8485,_0xa22aa4,_0x20098d){this[_0xb81c('0xcb')](_0x4a8485)['catch'](loggerCatch(_0xa22aa4));this[_0xb81c('0xc9')](_0x4a8485)[_0xb81c('0xb1')](loggerCatch(_0x20098d));};Dialer['prototype'][_0xb81c('0x33')]=function(_0x2723e9){var _0x3f7df1=this[_0xb81c('0x20')][_0x2723e9[_0xb81c('0xdf')]];var _0x5d41c9;if(!_[_0xb81c('0xad')](_0x2723e9)&&!_[_0xb81c('0xad')](_0x2723e9['variable'])&&!_[_0xb81c('0xad')](_0x2723e9[_0xb81c('0xe0')][_0xb81c('0xe1')])&&_0x2723e9[_0xb81c('0xe2')]===_0xb81c('0xe3')&&_0x3f7df1){if(_0x3f7df1['type']!==_0xb81c('0x78')&&this[_0xb81c('0x1b')][_0x3f7df1[_0xb81c('0xb3')]][_0xb81c('0xe4')]&&_0x2723e9[_0xb81c('0xe5')]==='HANGUP'){delete this[_0xb81c('0x20')][_0x2723e9['uniqueid']];this['updateOriginated'](this[_0xb81c('0x1b')][_0x3f7df1[_0xb81c('0xb3')]]);this[_0xb81c('0x1b')][_0x3f7df1['queue']][_0xb81c('0x59')]+=0x1;this[_0xb81c('0x1b')][_0x3f7df1[_0xb81c('0xb3')]][_0xb81c('0x58')]+=0x1;_0x5d41c9=new Hangup(_0x3f7df1,_0x2723e9);_0x5d41c9[_0xb81c('0xe6')]=0x12;_0x5d41c9[_0xb81c('0xe7')]=_0xb81c('0xe8');_0x5d41c9[_0xb81c('0xe9')]=_0xb81c('0xea');this['saveInDb'](_0x5d41c9,_0xb81c('0xeb'),_0xb81c('0xec'));}if(_0x3f7df1[_0xb81c('0x47')]!==_0xb81c('0x78')&&this[_0xb81c('0x1b')][_0x3f7df1['queue']][_0xb81c('0xe4')]&&_0x2723e9[_0xb81c('0xe5')]==='MACHINE'){var _0x248c87=this;return new BPromise(function(_0x4d9310,_0x5202fa){delete _0x248c87[_0xb81c('0x20')][_0x2723e9[_0xb81c('0xdf')]];_0x248c87['updateOriginated'](_0x248c87[_0xb81c('0x1b')][_0x3f7df1[_0xb81c('0xb3')]]);_0x248c87[_0xb81c('0x1b')][_0x3f7df1[_0xb81c('0xb3')]][_0xb81c('0x59')]+=0x1;_0x248c87[_0xb81c('0x1b')][_0x3f7df1['queue']][_0xb81c('0x58')]+=0x1;var _0x2624a9=_0x248c87[_0xb81c('0x1b')][_0x3f7df1[_0xb81c('0xb3')]];var _0xf47e58=new Hangup(_0x3f7df1,_0x2723e9);_0xf47e58['state']=0x13;_0xf47e58[_0xb81c('0xe7')]='Machine';_0xf47e58[_0xb81c('0xe9')]=_0xb81c('0xea');_0xf47e58[_0xb81c('0xed')]+=0x1;_0xf47e58[_0xb81c('0xee')]+=0x1;_0xf47e58[_0xb81c('0xef')]=!![];_0x248c87['createHistory'](_0xf47e58)[_0xb81c('0xb1')](loggerCatch(_0xb81c('0xf0')));if(_0xf47e58[_0xb81c('0xf1')]+_0xf47e58['countcongestionretry']+_0xf47e58[_0xb81c('0xf2')]+_0xf47e58[_0xb81c('0xf3')]+_0xf47e58[_0xb81c('0xf4')]+_0xf47e58[_0xb81c('0xf5')]+_0xf47e58[_0xb81c('0xed')]+_0xf47e58[_0xb81c('0xf6')]>=_0x2624a9[_0xb81c('0xf7')]){_0x248c87['stateGlobal'](_0xf47e58,_0x4d9310,_0x5202fa,_0xb81c('0xf8'));}else{if(_0xf47e58[_0xb81c('0xed')]>=_0x2624a9['dialMachineMaxRetry']){_0x248c87['createStateFinal'](_0xf47e58,_0x4d9310,_0x5202fa,_0xb81c('0xf9'));}else{_0x248c87[_0xb81c('0xc0')]({'active':![],'countmachineretry':_0xf47e58['countmachineretry'],'scheduledat':moment()[_0xb81c('0xfa')](_0x2624a9[_0xb81c('0xfb')],'minutes')['format'](_0xb81c('0xfc')),'ContactId':_0xf47e58[_0xb81c('0xd3')],'ListId':_0xf47e58[_0xb81c('0xd4')],'VoiceQueueId':_0xf47e58['VoiceQueueId']||undefined,'CampaignId':_0xf47e58[_0xb81c('0xd7')]||undefined})[_0xb81c('0xb1')](loggerCatch(_0xb81c('0xfd')));_0x4d9310({'reschedule':0x1});}}});}if(_0x3f7df1[_0xb81c('0x47')]===_0xb81c('0x78')&&this[_0xb81c('0x1c')][_0x3f7df1[_0xb81c('0xb3')]][_0xb81c('0xe4')]&&_0x2723e9['value']===_0xb81c('0xfe')){delete this[_0xb81c('0x20')][_0x2723e9[_0xb81c('0xdf')]];this[_0xb81c('0xb4')](this[_0xb81c('0x1c')][_0x3f7df1[_0xb81c('0xb3')]]);_0x5d41c9=new Hangup(_0x3f7df1,_0x2723e9);_0x5d41c9[_0xb81c('0xe6')]=0x12;_0x5d41c9['statedesc']='HangupInAMD';_0x5d41c9[_0xb81c('0xe9')]=_0xb81c('0xea');this[_0xb81c('0xde')](_0x5d41c9,_0xb81c('0xff'),_0xb81c('0x100'));}if(_0x3f7df1[_0xb81c('0x47')]===_0xb81c('0x78')&&this['campaigns'][_0x3f7df1[_0xb81c('0xb3')]]['dialAMDActive']&&_0x2723e9[_0xb81c('0xe5')]===_0xb81c('0x101')){var _0x248c87=this;return new BPromise(function(_0x3e8f56,_0x52c927){delete _0x248c87[_0xb81c('0x20')][_0x2723e9['uniqueid']];_0x248c87[_0xb81c('0xb4')](_0x248c87['campaigns'][_0x3f7df1[_0xb81c('0xb3')]]);_0x248c87['campaigns'][_0x3f7df1[_0xb81c('0xb3')]][_0xb81c('0x59')]+=0x1;_0x248c87['campaigns'][_0x3f7df1[_0xb81c('0xb3')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x28db18=_0x248c87[_0xb81c('0x1c')][_0x3f7df1[_0xb81c('0xb3')]];var _0x4bd25e=new Hangup(_0x3f7df1,_0x2723e9);_0x4bd25e['state']=0x13;_0x4bd25e[_0xb81c('0xe7')]=_0xb81c('0x102');_0x4bd25e[_0xb81c('0xe9')]='AMD';_0x4bd25e['countmachineretry']+=0x1;_0x4bd25e['countglobal']+=0x1;_0x4bd25e['amd']=!![];_0x248c87[_0xb81c('0xcb')](_0x4bd25e)['catch'](loggerCatch(_0xb81c('0xf0')));if(_0x4bd25e['countbusyretry']+_0x4bd25e[_0xb81c('0x103')]+_0x4bd25e[_0xb81c('0xf2')]+_0x4bd25e[_0xb81c('0xf3')]+_0x4bd25e[_0xb81c('0xf4')]+_0x4bd25e[_0xb81c('0xf5')]+_0x4bd25e[_0xb81c('0xed')]+_0x4bd25e[_0xb81c('0xf6')]>=_0x28db18[_0xb81c('0xf7')]){_0x248c87[_0xb81c('0x104')](_0x4bd25e,_0x3e8f56,_0x52c927,_0xb81c('0xf8'));}else{if(_0x4bd25e['countmachineretry']>=_0x28db18[_0xb81c('0x105')]){_0x248c87['createStateFinal'](_0x4bd25e,_0x3e8f56,_0x52c927,_0xb81c('0xf9'));}else{_0x248c87[_0xb81c('0xc0')]({'active':![],'countmachineretry':_0x4bd25e[_0xb81c('0xed')],'scheduledat':moment()[_0xb81c('0xfa')](_0x28db18['dialMachineRetryFrequency'],_0xb81c('0x106'))['format'](_0xb81c('0xfc')),'ContactId':_0x4bd25e['ContactId'],'ListId':_0x4bd25e['ListId'],'VoiceQueueId':_0x4bd25e['VoiceQueueId']||undefined,'CampaignId':_0x4bd25e['CampaignId']||undefined})['catch'](loggerCatch(_0xb81c('0xfd')));_0x3e8f56({'reschedule':0x1});}}});}}};Dialer[_0xb81c('0x16')][_0xb81c('0x30')]=function(_0x27822e){var _0xfeb3f5=this[_0xb81c('0x20')][_0x27822e['uniqueid']];var _0x17e6a0=this;var _0x39a211;if(_0xfeb3f5&&_0xfeb3f5[_0xb81c('0x47')]===_0xb81c('0x78')){delete this[_0xb81c('0x20')][_0x27822e[_0xb81c('0xdf')]];this[_0xb81c('0xb4')](this[_0xb81c('0x1c')][_0xfeb3f5[_0xb81c('0xb3')]]);this[_0xb81c('0x1c')][_0xfeb3f5[_0xb81c('0xb3')]][_0xb81c('0x107')]+=0x1;_0x39a211=new Hangup(_0xfeb3f5,_0x27822e);this[_0xb81c('0xcb')](_0x39a211)[_0xb81c('0xb1')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xb81c('0xc9')](_0x39a211)[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x108')));}if(_0xfeb3f5&&_0xfeb3f5[_0xb81c('0x47')]!==_0xb81c('0x78')&&isNotNull(this[_0xb81c('0x1b')][_0xfeb3f5[_0xb81c('0xb3')]][_0xb81c('0x109')])){delete this[_0xb81c('0x20')][_0x27822e['uniqueid']];this['updateOriginated'](this[_0xb81c('0x1b')][_0xfeb3f5[_0xb81c('0xb3')]]);this['voiceQueues'][_0xfeb3f5[_0xb81c('0xb3')]][_0xb81c('0x59')]+=0x1;this[_0xb81c('0x1b')][_0xfeb3f5[_0xb81c('0xb3')]][_0xb81c('0x58')]+=0x1;_0x39a211=new Hangup(_0xfeb3f5,_0x27822e);_0x39a211[_0xb81c('0xe6')]=0x10;_0x39a211[_0xb81c('0xe7')]='AnswerAGI';_0x39a211[_0xb81c('0xe9')]=_0xb81c('0x10a');this[_0xb81c('0xcb')](_0x39a211)[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x10b')));this['moveContactManagedDialer'](_0x39a211)['catch'](loggerCatch(_0xb81c('0x108')));}if(_0xfeb3f5&&_0xfeb3f5[_0xb81c('0x47')]!==_0xb81c('0x78')&&!isNotNull(this['voiceQueues'][_0xfeb3f5[_0xb81c('0xb3')]][_0xb81c('0x109')])){delete this[_0xb81c('0x20')][_0x27822e['uniqueid']];this[_0xb81c('0xb4')](this[_0xb81c('0x1b')][_0xfeb3f5[_0xb81c('0xb3')]]);this[_0xb81c('0x1b')][_0xfeb3f5[_0xb81c('0xb3')]][_0xb81c('0x10c')]+=0x1;_0x39a211=new Hangup(_0xfeb3f5,_0x27822e);_0x39a211['state']=0xc;_0x39a211['statedesc']=_0x27822e[_0xb81c('0x10d')];_0x39a211[_0xb81c('0xe9')]=_0xb81c('0x10e');this[_0xb81c('0xcb')](_0x39a211)[_0xb81c('0xb1')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xb81c('0xc9')](_0x39a211)[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x108')));}};Dialer['prototype'][_0xb81c('0x2c')]=function(_0x16b509){var _0x250978=this['uniqueId'][_0x16b509[_0xb81c('0xdf')]];var _0x41f46c=this;if(this[_0xb81c('0x1b')][_0x16b509[_0xb81c('0xb3')]]){if(_0x250978&&_0x250978[_0xb81c('0x47')]!==_0xb81c('0x78')){delete this[_0xb81c('0x20')][_0x16b509[_0xb81c('0xdf')]];this[_0xb81c('0x1b')][_0x16b509['queue']][_0xb81c('0x59')]+=0x1;var _0x336fb9=new AgentComplete(_0x250978,_0x16b509);if(_0x16b509[_0xb81c('0x10f')]===_0xb81c('0x110')){_0x336fb9[_0xb81c('0x111')]=this[_0xb81c('0x1b')][_0x16b509[_0xb81c('0xb3')]]['dialQueueProject2']&&this[_0xb81c('0x1b')][_0x16b509[_0xb81c('0xb3')]][_0xb81c('0x112')]?moment()['format'](_0xb81c('0xfc')):undefined;}this[_0xb81c('0xcb')](_0x336fb9)[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x113')));this['moveContactManagedDialer'](_0x336fb9)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xb81c('0x16')][_0xb81c('0x27')]=function(_0xe3d361){if(this['voiceQueues'][_0xe3d361['queue']]){if(this[_0xb81c('0x20')][_0xe3d361['uniqueid']]&&this[_0xb81c('0x20')][_0xe3d361['uniqueid']]['type']!==_0xb81c('0x78')){this[_0xb81c('0xb4')](this[_0xb81c('0x1b')][_0xe3d361[_0xb81c('0xb3')]]);this[_0xb81c('0x20')][_0xe3d361[_0xb81c('0xdf')]][_0xb81c('0x114')]=moment()['format'](_0xb81c('0xfc'));}}};Dialer[_0xb81c('0x16')][_0xb81c('0x115')]=function(_0x259cad){this[_0xb81c('0xcb')](_0x259cad)[_0xb81c('0xb1')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xb81c('0xc9')](_0x259cad)[_0xb81c('0xb1')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xb81c('0x16')][_0xb81c('0x116')]=function(_0x272e1c){var _0xafc124=this[_0xb81c('0x20')][_0x272e1c[_0xb81c('0xdf')]];var _0x5180f6=this;if(this[_0xb81c('0x1b')][_0x272e1c[_0xb81c('0xb3')]]){if(_0xafc124&&_0xafc124[_0xb81c('0x47')]!=='ivr'){delete this[_0xb81c('0x20')][_0x272e1c[_0xb81c('0xdf')]];this[_0xb81c('0xb4')](this['voiceQueues'][_0x272e1c[_0xb81c('0xb3')]]);_0xafc124[_0xb81c('0x117')]=moment()['format'](_0xb81c('0xfc'));var _0x217b20=new QueueCallerAbandon(_0xafc124,_0x272e1c);if(getSeconds(_0xafc124[_0xb81c('0x117')],_0xafc124['responsetime'])>=_0xafc124[_0xb81c('0x118')]){this[_0xb81c('0x1b')][_0x272e1c[_0xb81c('0xb3')]][_0xb81c('0x67')]+=0x1;this['voiceQueues'][_0x272e1c[_0xb81c('0xb3')]][_0xb81c('0x119')]+=0x1;this[_0xb81c('0x1b')][_0x272e1c[_0xb81c('0xb3')]][_0xb81c('0x69')]+=0x1;_0x217b20[_0xb81c('0xe6')]=0xa;_0x217b20[_0xb81c('0xe7')]=_0xb81c('0x11a');_0x217b20['dropreason']=_0xb81c('0x11b');_0x217b20['agiafterat']=this[_0xb81c('0x1b')][_0x272e1c[_0xb81c('0xb3')]]['dialQueueProject2']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x217b20['countdropretry']+=0x1;_0x217b20[_0xb81c('0xee')]+=0x1;if(_0x217b20['countdropretry']>=this['voiceQueues'][_0x272e1c['queue']][_0xb81c('0x11c')]){this[_0xb81c('0x115')](_0x217b20);}else{this[_0xb81c('0xc0')]({'active':![],'countdropretry':_0x217b20[_0xb81c('0xf4')],'scheduledat':moment()[_0xb81c('0xfa')](this[_0xb81c('0x1b')][_0x272e1c['queue']][_0xb81c('0x11d')],_0xb81c('0x106'))[_0xb81c('0x75')](_0xb81c('0xfc')),'ContactId':_0xafc124[_0xb81c('0xd3')],'ListId':_0xafc124[_0xb81c('0xd4')],'VoiceQueueId':_0xafc124[_0xb81c('0xd6')]||undefined,'CampaignId':_0xafc124[_0xb81c('0xd7')]||undefined})[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x11e')));var _0x2f85d0=new History(_0x217b20);_0x2f85d0['state']=0xa;_0x2f85d0['statedesc']='Drop';_0x2f85d0[_0xb81c('0x11f')]=moment()[_0xb81c('0x75')](_0xb81c('0xfc'));_0x2f85d0[_0xb81c('0xa5')]=_0x2f85d0[_0xb81c('0x11f')];_0x2f85d0[_0xb81c('0x120')]=_0x217b20[_0xb81c('0x120')];_0x2f85d0[_0xb81c('0x121')]=_0x217b20[_0xb81c('0x121')];this[_0xb81c('0xcb')](_0x2f85d0)[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x122')));}}else{this[_0xb81c('0x1b')][_0x272e1c[_0xb81c('0xb3')]][_0xb81c('0x66')]+=0x1;this[_0xb81c('0x1b')][_0x272e1c['queue']][_0xb81c('0x5e')]+=0x1;_0x217b20[_0xb81c('0xe6')]=0xb;_0x217b20[_0xb81c('0xe7')]=_0xb81c('0x123');_0x217b20[_0xb81c('0x124')]=_0xb81c('0x125');_0x217b20['countabandonedretry']+=0x1;_0x217b20[_0xb81c('0xee')]+=0x1;if(_0x217b20[_0xb81c('0xf5')]>=this['voiceQueues'][_0x272e1c[_0xb81c('0xb3')]][_0xb81c('0x126')]){this[_0xb81c('0x115')](_0x217b20);}else{this[_0xb81c('0xc0')]({'active':![],'countabandonedretry':_0x217b20[_0xb81c('0xf5')],'scheduledat':moment()[_0xb81c('0xfa')](this[_0xb81c('0x1b')][_0x272e1c[_0xb81c('0xb3')]][_0xb81c('0x127')],_0xb81c('0x106'))['format'](_0xb81c('0xfc')),'ContactId':_0xafc124[_0xb81c('0xd3')],'ListId':_0xafc124[_0xb81c('0xd4')],'VoiceQueueId':_0xafc124[_0xb81c('0xd6')]||undefined,'CampaignId':_0xafc124[_0xb81c('0xd7')]||undefined})[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x128')));var _0x2f85d0=new History(_0x217b20);_0x2f85d0[_0xb81c('0xe6')]=0xb;_0x2f85d0['statedesc']=_0xb81c('0x123');_0x2f85d0['starttime']=moment()[_0xb81c('0x75')](_0xb81c('0xfc'));_0x2f85d0[_0xb81c('0xa5')]=_0x2f85d0[_0xb81c('0x11f')];_0x2f85d0[_0xb81c('0x120')]=_0x217b20['calleridname'];_0x2f85d0[_0xb81c('0x121')]=_0x217b20[_0xb81c('0x121')];this['createHistory'](_0x2f85d0)[_0xb81c('0xb1')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0xb81c('0x16')]['syncNewExten']=function(_0xa7beaf){if(this[_0xb81c('0xa8')][_0xa7beaf[_0xb81c('0xdf')]]){this[_0xb81c('0xa8')][_0xa7beaf['uniqueid']]['channel']=_0xa7beaf[_0xb81c('0xb0')];}if(this['uniqueId'][_0xa7beaf[_0xb81c('0xdf')]]){this[_0xb81c('0x20')][_0xa7beaf[_0xb81c('0xdf')]][_0xb81c('0xb0')]=_0xa7beaf['channel'];}};Dialer[_0xb81c('0x16')][_0xb81c('0x129')]=function(_0x38d7ad){if(strategy[this[_0xb81c('0x1b')][this[_0xb81c('0xa8')][_0x38d7ad[_0xb81c('0x12a')]][_0xb81c('0xb3')]][_0xb81c('0x12b')]]===_0xb81c('0x15')){if(this[_0xb81c('0xa8')][_0x38d7ad[_0xb81c('0x12a')]]&&_[_0xb81c('0xad')](this['actions'][_0x38d7ad[_0xb81c('0x12a')]][_0xb81c('0x12c')])&&_0x38d7ad['status']==='1'&&_0x38d7ad['paused']==='0'){if(this[_0xb81c('0x1d')][_0x38d7ad[_0xb81c('0x12d')]]){if(!this[_0xb81c('0x1d')][_0x38d7ad[_0xb81c('0x12d')]][_0xb81c('0x12c')]){this[_0xb81c('0x1d')][_0x38d7ad[_0xb81c('0x12d')]][_0xb81c('0x12c')]=!![];this['actions'][_0x38d7ad[_0xb81c('0x12a')]][_0xb81c('0x12c')]=!![];this[_0xb81c('0xa8')][_0x38d7ad[_0xb81c('0x12a')]][_0xb81c('0x12d')]=_0x38d7ad[_0xb81c('0x12d')];}}}}else if((strategy[this[_0xb81c('0x1b')][this['actions'][_0x38d7ad[_0xb81c('0x12a')]][_0xb81c('0xb3')]][_0xb81c('0x12b')]]||_0xb81c('0x14'))===_0xb81c('0x14')){if(this[_0xb81c('0xa8')][_0x38d7ad[_0xb81c('0x12a')]]){if(this[_0xb81c('0x1d')][_0x38d7ad[_0xb81c('0x12d')]]){this[_0xb81c('0xa8')][_0x38d7ad['actionid']]['stateinterface']=_0x38d7ad[_0xb81c('0x12d')];if(_[_0xb81c('0xad')](this[_0xb81c('0x24')][this['actions'][_0x38d7ad[_0xb81c('0x12a')]][_0xb81c('0xb3')]])){this[_0xb81c('0x24')][this[_0xb81c('0xa8')][_0x38d7ad[_0xb81c('0x12a')]][_0xb81c('0xb3')]]=[];}this[_0xb81c('0x24')][this[_0xb81c('0xa8')][_0x38d7ad[_0xb81c('0x12a')]]['queue']]['push'](_[_0xb81c('0xd1')](_['pick'](this[_0xb81c('0xa8')][_0x38d7ad[_0xb81c('0x12a')]],[_0xb81c('0x12e'),_0xb81c('0x12d')]),{'status':_0x38d7ad[_0xb81c('0xaf')],'paused':_0x38d7ad[_0xb81c('0x12f')]}));}}}};function unlockQueueStatus(_0x134955,_0x515858){setTimeout(function(){if(_[_0xb81c('0x38')](_0x134955[_0xb81c('0x130')])){loggerBooked['error'](_0xb81c('0x131'),_0x515858);}_0x134955[_0xb81c('0x130')]=!![];loggerBooked['info'](_0xb81c('0x132'),_0x515858,JSON[_0xb81c('0x74')](_[_0xb81c('0xd2')](_0x134955,['name',_0xb81c('0x130')])));},0x1f3);}Dialer[_0xb81c('0x16')]['syncQueueStatusComplete']=function(_0x43e46b){var _0x17b744=this;var _0x169a6c=_0x17b744['voiceQueues'][_0x17b744[_0xb81c('0xa8')][_0x43e46b['actionid']][_0xb81c('0xb3')]];if(strategy[this[_0xb81c('0x1b')][this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xb3')]]['strategy']]===_0xb81c('0x15')){if(this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]]&&this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0x12d')]){this[_0xb81c('0x1a')]['run'](this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0x12e')],this[_0xb81c('0xa8')][_0x43e46b['actionid']][_0xb81c('0x12d')])['catch'](function(_0x2ac8e5){logger[_0xb81c('0x91')](_0xb81c('0x133'),util[_0xb81c('0x92')](_0x2ac8e5,{'showHidden':![],'depth':null}));})['finally'](function(){_0x17b744[_0xb81c('0xb4')](_0x17b744[_0xb81c('0x1b')][_0x17b744[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xb3')]]);_0x17b744['agents'][_0x17b744['actions'][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0x12d')]]['locked']=![];delete _0x17b744['actions'][_0x43e46b['actionid']];unlockQueueStatus(_0x169a6c);});}else{this[_0xb81c('0xb4')](this[_0xb81c('0x1b')][this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]]['ContactId'],'ListId':this['actions'][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xd4')],'VoiceQueueId':this['actions'][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xd6')]||undefined,'CampaignId':this[_0xb81c('0xa8')][_0x43e46b['actionid']][_0xb81c('0xd7')]||undefined})[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x134')));delete this[_0xb81c('0xa8')][_0x43e46b['actionid']];unlockQueueStatus(_0x169a6c);}}else if((strategy[this[_0xb81c('0x1b')][this['actions'][_0x43e46b[_0xb81c('0x12a')]]['queue']][_0xb81c('0x12b')]]||_0xb81c('0x14'))===_0xb81c('0x14')){var _0x259947;if(this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]]&&!_[_0xb81c('0x7a')](this['queueBooked'][this[_0xb81c('0xa8')][_0x43e46b['actionid']][_0xb81c('0xb3')]])){if(this[_0xb81c('0x25')][_0x17b744[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xb3')]]){this['queueBookedRR'][_0x17b744['actions'][_0x43e46b[_0xb81c('0x12a')]]['queue']]=this[_0xb81c('0x25')][this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xb3')]]?this[_0xb81c('0x25')][this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xb3')]]:this[_0xb81c('0x24')][this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xb3')]]?this[_0xb81c('0x24')][this['actions'][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xb3')]][_0xb81c('0x135')]||0x0:0x0;}this[_0xb81c('0x24')][this['actions'][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xb3')]]['_rr']=this[_0xb81c('0x25')][this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]]['queue']];for(var _0x21b491=0x0;_0x21b491<this['queueBooked'][this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]]['queue']][_0xb81c('0x94')];_0x21b491+=0x1){_0x259947=rr(this[_0xb81c('0x24')][this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]]['queue']]);this[_0xb81c('0x25')][_0x17b744[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]]['queue']]=this[_0xb81c('0x24')][this['actions'][_0x43e46b['actionid']][_0xb81c('0xb3')]][_0xb81c('0x135')];if(_0x259947[_0xb81c('0xaf')]==='1'&&_0x259947['paused']==='0'){break;}}if(!_['isNil'](_0x259947)){this['agents'][_0x259947[_0xb81c('0x12d')]][_0xb81c('0x136')]=_[_0xb81c('0x38')](this[_0xb81c('0x1d')][_0x259947[_0xb81c('0x12d')]][_0xb81c('0x136')])?!![]:this[_0xb81c('0x1d')][_0x259947[_0xb81c('0x12d')]][_0xb81c('0x136')];}loggerBooked[_0xb81c('0x7c')](_0xb81c('0x137'),_0x43e46b[_0xb81c('0x12a')],_0xb81c('0x138'),JSON[_0xb81c('0x74')](_['pick'](this['agents'][_0x259947[_0xb81c('0x12d')]],[_0xb81c('0x3c'),_0xb81c('0x136')])),_0xb81c('0x139'),JSON[_0xb81c('0x74')](_0x259947[_0xb81c('0x12e')]));if(!_[_0xb81c('0xad')](_0x259947)&&_0x259947['status']==='1'&&_0x259947[_0xb81c('0x12f')]==='0'&&this[_0xb81c('0x1d')][_0x259947[_0xb81c('0x12d')]][_0xb81c('0x136')]){this['agents'][_0x259947[_0xb81c('0x12d')]]['unlockRR']=![];this[_0xb81c('0x24')][_0x17b744[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]]['queue']]=[];this['preview']['run'](_0x259947[_0xb81c('0x12e')],_0x259947[_0xb81c('0x12d')])[_0xb81c('0xb1')](function(_0x6bbc23){logger[_0xb81c('0x91')](_0xb81c('0x133'),util[_0xb81c('0x92')](_0x6bbc23,{'showHidden':![],'depth':null}));})[_0xb81c('0x19')](function(){_0x17b744[_0xb81c('0xb4')](_0x17b744[_0xb81c('0x1b')][_0x17b744[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]]['queue']]);setTimeout(function(){_0x17b744[_0xb81c('0x1d')][_0x259947[_0xb81c('0x12d')]][_0xb81c('0x136')]=!![];loggerBooked[_0xb81c('0x7c')](_0xb81c('0x13a'),_0x43e46b[_0xb81c('0x12a')],_0xb81c('0x138'),JSON[_0xb81c('0x74')](_['pick'](_0x17b744['agents'][_0x259947[_0xb81c('0x12d')]],['name',_0xb81c('0x136')])),_0xb81c('0x139'),JSON[_0xb81c('0x74')](_0x259947[_0xb81c('0x12e')]));},0xc7);delete _0x17b744[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]];unlockQueueStatus(_0x169a6c,_0x43e46b['actionid']);});}else{loggerBooked[_0xb81c('0x7c')](_0xb81c('0x13b'));this[_0xb81c('0xb4')](this['voiceQueues'][this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xb3')]]);this[_0xb81c('0xc0')]({'active':![],'ContactId':this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]]['ContactId'],'ListId':this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xd4')],'VoiceQueueId':this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xd7')]||undefined})[_0xb81c('0xb1')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x43e46b[_0xb81c('0x12a')]];unlockQueueStatus(_0x169a6c);}}else{loggerBooked[_0xb81c('0x7c')](_0xb81c('0x13c'));this['updateOriginated'](this[_0xb81c('0x1b')][this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xb3')]]);this[_0xb81c('0xc0')]({'active':![],'ContactId':this[_0xb81c('0xa8')][_0x43e46b['actionid']][_0xb81c('0xd3')],'ListId':this[_0xb81c('0xa8')][_0x43e46b['actionid']][_0xb81c('0xd4')],'VoiceQueueId':this['actions'][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xd6')]||undefined,'CampaignId':this['actions'][_0x43e46b['actionid']][_0xb81c('0xd7')]||undefined})['catch'](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this['actions'][_0x43e46b[_0xb81c('0x12a')]];unlockQueueStatus(_0x169a6c);}}else{loggerBooked[_0xb81c('0x7c')](_0xb81c('0x13d'));this[_0xb81c('0xb4')](this[_0xb81c('0x1b')][this[_0xb81c('0xa8')][_0x43e46b['actionid']][_0xb81c('0xb3')]]);this[_0xb81c('0xc0')]({'active':![],'ContactId':this[_0xb81c('0xa8')][_0x43e46b['actionid']]['ContactId'],'ListId':this['actions'][_0x43e46b['actionid']][_0xb81c('0xd4')],'VoiceQueueId':this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xd6')]||undefined,'CampaignId':this[_0xb81c('0xa8')][_0x43e46b[_0xb81c('0x12a')]][_0xb81c('0xd7')]||undefined})['catch'](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0xb81c('0xa8')][_0x43e46b['actionid']];unlockQueueStatus(_0x169a6c);}};Dialer['prototype'][_0xb81c('0x37')]=function(){var _0x53db95=this;setInterval(function(){_0x53db95[_0xb81c('0x13e')]();},0x3e8);};Dialer[_0xb81c('0x16')][_0xb81c('0x13f')]=function(_0xa20e40){var _0x41bcee=this;return function(){if(!_0x41bcee[_0xb81c('0x140')](_0xa20e40['Trunk'])){if(!_0x41bcee[_0xb81c('0x140')](_0xa20e40[_0xb81c('0x141')])){_0xa20e40['message']=_0xb81c('0x142');throw _0xa20e40[_0xb81c('0x3c')]+_0xb81c('0x143');}}};};Dialer['prototype']['checkIfTime']=function(_0x4706fe,_0x191164,_0x437704,_0x40c4a0){var _0x9f82f6=this;return function(){var _0x56e67a=!![];return _0x9f82f6[_0xb81c('0x144')](_0x4706fe,_0x191164,_0x437704,_0x40c4a0,_0x56e67a);};};Dialer['prototype'][_0xb81c('0x145')]=function(_0x881911,_0x1a1dc6,_0x486c06,_0x4df61e){var _0x312fc8=this;return function(){var _0x1fd5ac=![];return _0x312fc8[_0xb81c('0x144')](_0x881911[_0xb81c('0x40')],_0x1a1dc6,_0x486c06,_0x4df61e,_0x1fd5ac);};};Dialer[_0xb81c('0x16')][_0xb81c('0x144')]=function(_0x4a19,_0x1d3abc,_0x310c62,_0x3a402a,_0x54657a){var _0x6c436e=[];return new BPromise(function(_0xb0a765,_0x99295e){if(!isNotNull(_0x4a19)){_0x3a402a[_0xb81c('0x39')]='INTERVAL_IS_NULL';return _0x99295e(msgResponse('ifTime',_0xb81c('0x146'),_0x310c62+_0xb81c('0x147')));}if(_['isEmpty'](_0x4a19)){_0x3a402a[_0xb81c('0x39')]='INTERVAL_IS_EMPTY';return _0x99295e(msgResponse(_0xb81c('0x144'),_0xb81c('0x146'),_0x310c62+_0xb81c('0x148')));}if(_0x1d3abc&&_[_0xb81c('0x38')](config['timezones'][_0x1d3abc])){_0x3a402a[_0xb81c('0x39')]=_0xb81c('0x149');return _0x99295e(msgResponse(_0xb81c('0x144'),_0xb81c('0x146'),_0x310c62+_0xb81c('0x14a')+_0x1d3abc));}if(_[_0xb81c('0x14b')](_0x4a19)){for(var _0x1634ac=0x0;_0x1634ac<_0x4a19[_0xb81c('0x94')];_0x1634ac+=0x1){_0x6c436e[_0xb81c('0x14c')](ami[_0xb81c('0xae')]({'action':'command','command':util[_0xb81c('0x75')](_0xb81c('0x14d'),_0x4a19[_0x1634ac][_0xb81c('0x14e')],!_['isUndefined'](config['timezones'][_0x1d3abc])?_0x1d3abc:'')})[_0xb81c('0xb8')](function(_0x36cce2){return _0x36cce2[_0xb81c('0x14f')][_0xb81c('0x150')](_0xb81c('0x151'))>=0x0?!![]:![];})[_0xb81c('0xb1')](myreject(_0x99295e)));}}else{_0x6c436e[_0xb81c('0x14c')](ami[_0xb81c('0xae')]({'action':'command','command':util[_0xb81c('0x75')](_0xb81c('0x14d'),_0x4a19,!_[_0xb81c('0x38')](config[_0xb81c('0x152')][_0x1d3abc])?_0x1d3abc:'')})[_0xb81c('0xb8')](function(_0x372911){return _0x372911[_0xb81c('0x14f')][_0xb81c('0x150')](_0xb81c('0x151'))>=0x0?!![]:![];})['catch'](myreject(_0x99295e)));}BPromise[_0xb81c('0x153')](_0x6c436e)[_0xb81c('0xb8')](function(_0x3f597e){var _0x2a6958=_[_0xb81c('0x154')](_0x3f597e);if(_0x2a6958){return _0xb0a765(_0x2a6958);}else{_0x3a402a['message']=_0x54657a?'GLOBAL_INTERVAL_IS_OVERTIME':_0xb81c('0x155');return _0x99295e(msgResponse(_0xb81c('0x156'),_0xb81c('0x146'),'Global:\x20'+_0x54657a+'\x20'+_0x310c62+_0xb81c('0x157')+util[_0xb81c('0x92')](_0x4a19,{'showHidden':![],'depth':null})+_0xb81c('0x158')+_0x1d3abc));}})['catch'](function(_0x14b106){return _0x99295e(msgResponse(_0xb81c('0x144'),'Failure',JSON['stringify'](_0x14b106)));});});};Dialer['prototype'][_0xb81c('0x159')]=function(_0x44221a){var _0x386e20=this;return function(){switch(_0x44221a['dialMethod']){case'progressive':freeVariablesPredictive(_0x44221a);_0x386e20[_0xb81c('0x15a')](_0x44221a,0x1);break;case _0xb81c('0x15b'):freeVariablesPredictive(_0x44221a);_0x386e20['handlePower'](_0x44221a,_0x44221a['dialPowerLevel']);break;case _0xb81c('0x15c'):_0x386e20[_0xb81c('0x15c')](_0x44221a);break;case _0xb81c('0x8'):freeVariablesPredictive(_0x44221a);_0x386e20[_0xb81c('0x15a')](_0x44221a,0x1);break;default:freeVariablesPredictive(_0x44221a);logger['error'](_0xb81c('0x15d'),_0x44221a[_0xb81c('0x3c')],_0xb81c('0x15e'));}};};Dialer['prototype'][_0xb81c('0x15f')]=function(_0x4332b2){var _0x4c1e66=this;return function(){_0x4c1e66['handleIvr'](_0x4332b2);};};Dialer[_0xb81c('0x16')]['syncQueueSummary']=function(_0xad7643){var _0x384c4a=this;if(isNotPreview(_0xad7643[_0xb81c('0x54')])){if(isVoiceQueueOutbound(_0xad7643[_0xb81c('0x47')])&&isActive(_0xad7643['dialActive'])){_0xad7643['sendMessageOneNotActive']=!![];BPromise[_0xb81c('0xb7')]()[_0xb81c('0xb8')](checkIsLoggedIn(_0xad7643,_0xad7643[_0xb81c('0x4b')]))[_0xb81c('0xb8')](checkIsActive(_0xad7643,_0xad7643[_0xb81c('0x53')]))[_0xb81c('0xb8')](checkInterval(_0xad7643))[_0xb81c('0xb8')](_0x384c4a['checkIsTrunkReachable'](_0xad7643))[_0xb81c('0xb8')](_0x384c4a[_0xb81c('0x160')](_0xad7643['dialGlobalInterval'],_0xad7643[_0xb81c('0x161')],_0xad7643['name'],_0xad7643))[_0xb81c('0xb8')](_0x384c4a[_0xb81c('0x145')](_0xad7643[_0xb81c('0x3e')],_0xad7643[_0xb81c('0x161')],_0xad7643['name'],_0xad7643))[_0xb81c('0xb8')](_0x384c4a['checkDialMethod'](_0xad7643))['catch'](loggerCatchQueueSummary(_0xb81c('0x162'),_0xad7643));}else{notSendMessagesQueue(_0xad7643);}}else{freeVariablesPredictive(_0xad7643);}};Dialer[_0xb81c('0x16')][_0xb81c('0x13e')]=function(){var _0x4325ea=this;var _0x16436d;for(var _0x5e741c in this[_0xb81c('0x1c')]){if(this['campaigns'][_0xb81c('0xab')](_0x5e741c)){_0x16436d=this[_0xb81c('0x1c')][_0x5e741c];if(isCampaignIvr(_0x16436d[_0xb81c('0x47')])&&isActive(_0x16436d[_0xb81c('0x72')])){_0x16436d[_0xb81c('0x9e')]=!![];BPromise[_0xb81c('0xb7')]()[_0xb81c('0xb8')](checkIsActive(_0x16436d,_0x16436d[_0xb81c('0x72')]))['then'](checkInterval(_0x16436d))[_0xb81c('0xb8')](_0x4325ea[_0xb81c('0x13f')](_0x16436d))[_0xb81c('0xb8')](_0x4325ea[_0xb81c('0x160')](_0x16436d[_0xb81c('0x163')],_0x16436d['dialTimezone'],_0x16436d[_0xb81c('0x3c')],_0x16436d))[_0xb81c('0xb8')](_0x4325ea['checkIfTimeIntervals'](_0x16436d[_0xb81c('0x3e')],_0x16436d['dialTimezone'],_0x16436d['name'],_0x16436d))[_0xb81c('0xb8')](_0x4325ea['launchHandleIvr'](_0x16436d))[_0xb81c('0xb1')](loggerCatchQueueSummary(_0xb81c('0x164'),_0x16436d));}else{notSendMessagesCampaign(_0x16436d);}}}};function getCallerIdRandom(_0x1947b8,_0x22c63f){var _0x51e10e,_0x2f75b4,_0x3d856b;if(_0x22c63f<=0x0){_0x22c63f=0x1;}_0x51e10e=new RegExp('\x5cw{0,'+_0x22c63f+'}$');_0x2f75b4=Math['pow'](0xa,_0x22c63f-0x1);_0x3d856b=Math[_0xb81c('0x165')](0xa,_0x22c63f)-0x1;return util[_0xb81c('0x75')]('%s',_[_0xb81c('0x166')](_0x1947b8,_0x51e10e,_['random'](_0x2f75b4,_0x3d856b)));}function extractCalleridName(_0x15d3dd){var _0x503815=_0x15d3dd[_0xb81c('0x167')](/"(.*?)"/);return _0x503815?_0x503815[0x1]:_0x15d3dd;}function extractCalleridNumber(_0x55d281){var _0x3090e7=_0x55d281[_0xb81c('0x167')](/<(.*?)>/);return _0x3090e7?_0x3090e7[0x1]:_0x55d281;}Dialer[_0xb81c('0x16')]['actionOriginate']=function(_0x3ae7ba,_0x5bd280){var _0x1089a1=this;var _0x1fd7c8=uuid['v4']();this[_0xb81c('0xa8')][_0x1fd7c8]=new Action(_0x3ae7ba,_0x5bd280,_0x1fd7c8);return new BPromise(function(_0xee2ecd,_0x22e5d8){if(_['isUndefined'](_0x3ae7ba)&&'object'!==typeof _0x3ae7ba){return _0x22e5d8(msgResponse('originate',_0xb81c('0x146'),'voiceQueue\x20is\x20undefine'));}if(_[_0xb81c('0x38')](_0x5bd280[_0xb81c('0x168')][_0xb81c('0x169')])||_0x5bd280[_0xb81c('0x168')]['phone']===null){return _0x22e5d8(msgResponse(_0xb81c('0x16a'),_0xb81c('0x146'),_0xb81c('0x16b')));}var _0x10b2ea={'XMD-CALLERID':_0x1089a1[_0xb81c('0xa8')][_0x1fd7c8][_0xb81c('0x16c')](),'XMD-AGI':_0x3ae7ba[_0xb81c('0x109')]?util[_0xb81c('0x75')](_0xb81c('0x16d'),ipAgi,_0x3ae7ba[_0xb81c('0x109')]):_0xb81c('0x16e'),'XMD-AGIAFTER':_0x3ae7ba[_0xb81c('0x16f')]?util[_0xb81c('0x75')](_0xb81c('0x16d'),ipAgi,_0x3ae7ba[_0xb81c('0x16f')]):_0xb81c('0x16e'),'XMD-QUEUE':_0x3ae7ba['type']===_0xb81c('0x48')?util[_0xb81c('0x75')](_0xb81c('0x170'),_0x3ae7ba[_0xb81c('0x3c')],_0x3ae7ba[_0xb81c('0x171')]||'',_0x3ae7ba[_0xb81c('0x112')]?'c':'',_0x3ae7ba['dialQueueTimeout']||0x3):_0xb81c('0x16e'),'XMD-CONTACTID':_0x5bd280[_0xb81c('0xd3')],'XMD-CDRTYPE':_0xb81c('0x7'),'CALLERID(all)':_0x1089a1[_0xb81c('0xa8')][_0x1fd7c8][_0xb81c('0x16c')](),'XMD-AMD':_0x3ae7ba[_0xb81c('0xe4')]?'ACTIVE':_0xb81c('0x16e'),'XMD-DESTINATION':_0xb81c('0xe3')};if(_0x3ae7ba[_0xb81c('0xe4')]){_0x10b2ea[_0xb81c('0x172')]=_0x3ae7ba[_0xb81c('0x173')]||0x9c4;_0x10b2ea[_0xb81c('0x174')]=_0x3ae7ba[_0xb81c('0x175')]||0x5dc;_0x10b2ea[_0xb81c('0x176')]=_0x3ae7ba[_0xb81c('0x177')]||0x320;_0x10b2ea[_0xb81c('0x178')]=_0x3ae7ba['dialAMDTotalAnalysisTime']||0x1388;_0x10b2ea[_0xb81c('0x179')]=_0x3ae7ba[_0xb81c('0x17a')]||0x64;_0x10b2ea[_0xb81c('0x17b')]=_0x3ae7ba[_0xb81c('0x17c')]||0x32;_0x10b2ea[_0xb81c('0x17d')]=_0x3ae7ba['dialAMDMaximumNumberOfWords']||0x3;_0x10b2ea[_0xb81c('0x17e')]=_0x3ae7ba[_0xb81c('0x17f')]||0x100;_0x10b2ea[_0xb81c('0x180')]=_0x3ae7ba['dialAMDMaximumWordLength']||0x1388;}if(_0x3ae7ba[_0xb81c('0x47')]===_0xb81c('0x48')){_0x10b2ea[_0xb81c('0x181')]=_0x5bd280[_0xb81c('0xd6')];}else{_0x10b2ea[_0xb81c('0x182')]=_0x5bd280[_0xb81c('0xd7')];}for(var _0xe2cdf9 in _0x5bd280[_0xb81c('0x168')]){if(_0x5bd280['Contact']['hasOwnProperty'](_0xe2cdf9)){if(isNotNull(_0x5bd280[_0xb81c('0x168')][_0xe2cdf9])&&_0xe2cdf9!=='id'&&_0xe2cdf9!==_0xb81c('0x183')&&_0xe2cdf9!==_0xb81c('0x184')&&_0xe2cdf9!==_0xb81c('0x185')){_0x10b2ea[util[_0xb81c('0x75')](_0xb81c('0x186'),_0xb81c('0x187'),_[_0xb81c('0x188')](_0xe2cdf9))]=_0x5bd280[_0xb81c('0x168')][_0xe2cdf9];}}}var _0x2fea05=_0x1089a1[_0xb81c('0x140')](_0x3ae7ba[_0xb81c('0x71')])?getCallerId(_0x3ae7ba[_0xb81c('0x71')][_0xb81c('0x73')],_0x3ae7ba[_0xb81c('0x55')],_0x3ae7ba[_0xb81c('0x189')]>0x0?getCallerIdRandom(_0x3ae7ba['dialOriginateCallerIdNumber'],_0x3ae7ba[_0xb81c('0x189')]):_0x3ae7ba['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x3ae7ba[_0xb81c('0x141')])?_0x3ae7ba[_0xb81c('0x71')][_0xb81c('0x73')]:_0x3ae7ba['TrunkBackup'][_0xb81c('0x73')],_0x3ae7ba[_0xb81c('0x55')],_0x3ae7ba[_0xb81c('0x189')]>0x0?getCallerIdRandom(_0x3ae7ba[_0xb81c('0x56')],_0x3ae7ba[_0xb81c('0x189')]):_0x3ae7ba[_0xb81c('0x56')]);if(_0x2fea05){_0x10b2ea[_0xb81c('0x18a')]=_0x1089a1[_0xb81c('0xa8')][_0x1fd7c8][_0xb81c('0x18b')]=extractCalleridName(_0x2fea05);_0x10b2ea[_0xb81c('0x18c')]=_0x1089a1[_0xb81c('0xa8')][_0x1fd7c8][_0xb81c('0x18d')]=extractCalleridNumber(_0x2fea05);}return ami[_0xb81c('0xae')]({'actionid':_0x1fd7c8,'action':'originate','channel':_0x1089a1[_0xb81c('0x140')](_0x3ae7ba[_0xb81c('0x71')])?util[_0xb81c('0x75')](_0xb81c('0x18e'),_0x3ae7ba[_0xb81c('0x71')][_0xb81c('0x3c')],isNotNull(_0x3ae7ba['dialPrefix'])?_0x3ae7ba['dialPrefix'][_0xb81c('0x18f')]()||'':'',_0x3ae7ba[_0xb81c('0x190')]>0x0?_0x5bd280[_0xb81c('0x168')]['phone'][_0xb81c('0x191')](_0x3ae7ba['dialCutDigit']):_0x5bd280[_0xb81c('0x168')][_0xb81c('0x169')]):util[_0xb81c('0x75')]('SIP/%s/%s%s',_['isNil'](_0x3ae7ba[_0xb81c('0x141')])?_0x3ae7ba[_0xb81c('0x71')][_0xb81c('0x3c')]:_0x3ae7ba[_0xb81c('0x141')]['name'],isNotNull(_0x3ae7ba[_0xb81c('0x192')])?_0x3ae7ba['dialPrefix']['trim']()||'':'',_0x3ae7ba[_0xb81c('0x190')]>0x0?_0x5bd280['Contact'][_0xb81c('0x169')][_0xb81c('0x191')](_0x3ae7ba[_0xb81c('0x190')]):_0x5bd280[_0xb81c('0x168')][_0xb81c('0x169')]),'callerid':_0x2fea05,'Exten':_0xb81c('0xe3'),'Context':_0xb81c('0x193'),'Priority':'1','variable':_0x10b2ea,'timeout':(_0x3ae7ba['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1fd7c8})[_0xb81c('0xb8')](function(_0x38b4ca){return _0xee2ecd(_0x38b4ca);})['catch'](function(_0x5d80f6){_0x3ae7ba[_0xb81c('0x60')]+=0x1;var _0xc01b2f=new History(_0x1089a1['actions'][_0x1fd7c8]);logger[_0xb81c('0x91')](util[_0xb81c('0x75')](_0xb81c('0x194'),JSON[_0xb81c('0x74')](_0x5d80f6)));_0xc01b2f[_0xb81c('0xe6')]=0xe;_0xc01b2f[_0xb81c('0xe7')]=_0xb81c('0x195');_0xc01b2f['starttime']=moment()[_0xb81c('0x75')]('YYYY-MM-DD\x20HH:mm:ss');_0xc01b2f[_0xb81c('0xa5')]=_0xc01b2f[_0xb81c('0x11f')];_0x1089a1[_0xb81c('0xcb')](_0xc01b2f)[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x196')));_0x1089a1[_0xb81c('0xc9')](_0xc01b2f)['catch'](loggerCatch(_0xb81c('0x196')))[_0xb81c('0x19')](function(){delete _0x1089a1[_0xb81c('0xa8')][_0x1fd7c8];return _0x22e5d8(msgResponse('originate','Error','originate\x20action\x20Error'));});});});};Dialer['prototype'][_0xb81c('0x197')]=function(_0x1fbdb2){var _0x2b3d52=this[_0xb81c('0xa8')][_0x1fbdb2['actionid']];var _0x4ecdf3=this;if(_0x2b3d52){delete this['actions'][_0x1fbdb2[_0xb81c('0x12a')]];_0x2b3d52[_0xb81c('0x198')]=moment()['format'](_0xb81c('0xfc'));var _0x50cfc2=_0x2b3d52[_0xb81c('0x47')]===_0xb81c('0x78')?this[_0xb81c('0x1c')][_0x2b3d52['queue']]:this[_0xb81c('0x1b')][_0x2b3d52[_0xb81c('0x199')]()];if(!this['isSuccess'](_0x1fbdb2['response'])){this[_0xb81c('0xb4')](_0x50cfc2);return this[_0xb81c('0x19a')](_0x2b3d52,_0x50cfc2,_0x1fbdb2)[_0xb81c('0xb8')](function(_0x579028){})[_0xb81c('0xb1')](loggerCatch('[callProgressDetecting]\x20'));}else{this['uniqueId'][_0x1fbdb2['uniqueid']]=_0x2b3d52;}}};Dialer[_0xb81c('0x16')]['checkRetriveMax']=function(_0x4a8951,_0x46715d,_0x192ce0){var _0x1804a6=new History(_0x46715d);if(_0x1804a6[_0xb81c('0xf1')]+_0x1804a6[_0xb81c('0x103')]+_0x1804a6[_0xb81c('0xf2')]+_0x1804a6[_0xb81c('0xf3')]+_0x1804a6[_0xb81c('0xf4')]+_0x1804a6[_0xb81c('0xf5')]+_0x1804a6[_0xb81c('0xed')]+_0x1804a6[_0xb81c('0xf6')]>=_0x192ce0[_0xb81c('0xf7')]-0x1){return!![];}switch(_0x4a8951){case 0x3:if(_0x1804a6[_0xb81c('0xf2')]>=_0x192ce0[_0xb81c('0x19b')]-0x1){return!![];}else{this[_0xb81c('0xc0')]({'active':![],'countnoanswerretry':_0x1804a6['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xb81c('0xfa')](_0x192ce0[_0xb81c('0x19c')],_0xb81c('0x106'))[_0xb81c('0x75')](_0xb81c('0xfc')),'ContactId':_0x1804a6[_0xb81c('0xd3')],'ListId':_0x1804a6[_0xb81c('0xd4')],'VoiceQueueId':_0x1804a6[_0xb81c('0xd6')]||undefined,'CampaignId':_0x1804a6[_0xb81c('0xd7')]||undefined})[_0xb81c('0xb1')](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x1804a6[_0xb81c('0xf1')]>=_0x192ce0['dialBusyMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x1804a6[_0xb81c('0xf1')]+=0x1,'scheduledat':moment()['add'](_0x192ce0['dialBusyRetryFrequency'],_0xb81c('0x106'))[_0xb81c('0x75')](_0xb81c('0xfc')),'ContactId':_0x1804a6[_0xb81c('0xd3')],'ListId':_0x1804a6[_0xb81c('0xd4')],'VoiceQueueId':_0x1804a6[_0xb81c('0xd6')]||undefined,'CampaignId':_0x1804a6[_0xb81c('0xd7')]||undefined})[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x19d')));}break;case 0x8:if(_0x1804a6[_0xb81c('0x103')]>=_0x192ce0[_0xb81c('0x19e')]-0x1){return!![];}else{this[_0xb81c('0xc0')]({'active':![],'countcongestionretry':_0x1804a6[_0xb81c('0x103')]+=0x1,'scheduledat':moment()[_0xb81c('0xfa')](_0x192ce0['dialCongestionRetryFrequency'],_0xb81c('0x106'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1804a6[_0xb81c('0xd3')],'ListId':_0x1804a6['ListId'],'VoiceQueueId':_0x1804a6[_0xb81c('0xd6')]||undefined,'CampaignId':_0x1804a6[_0xb81c('0xd7')]||undefined})[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x19f')));}break;case 0x0:if(_0x1804a6['countnosuchnumberretry']>=_0x192ce0[_0xb81c('0x1a0')]-0x1){return!![];}else{this[_0xb81c('0xc0')]({'active':![],'countnosuchnumberretry':_0x1804a6[_0xb81c('0xf3')]+=0x1,'scheduledat':moment()[_0xb81c('0xfa')](_0x192ce0[_0xb81c('0x1a1')],_0xb81c('0x106'))[_0xb81c('0x75')](_0xb81c('0xfc')),'ContactId':_0x1804a6[_0xb81c('0xd3')],'ListId':_0x1804a6[_0xb81c('0xd4')],'VoiceQueueId':_0x1804a6[_0xb81c('0xd6')]||undefined,'CampaignId':_0x1804a6['CampaignId']||undefined})[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x1a2')));}break;case 0xa:if(_0x1804a6['countdropretry']>=_0x192ce0['dialDropMaxRetry']-0x1){return!![];}else{this[_0xb81c('0xc0')]({'active':![],'countdropretry':_0x1804a6['countdropretry']+=0x1,'scheduledat':moment()[_0xb81c('0xfa')](_0x192ce0['dialDropRetryFrequency'],_0xb81c('0x106'))[_0xb81c('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1804a6[_0xb81c('0xd3')],'ListId':_0x1804a6[_0xb81c('0xd4')],'VoiceQueueId':_0x1804a6[_0xb81c('0xd6')]||undefined,'CampaignId':_0x1804a6['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));}break;case 0xb:if(_0x1804a6['countabandonedretry']>=_0x192ce0[_0xb81c('0x126')]-0x1){return!![];}else{this[_0xb81c('0xc0')]({'active':![],'countabandonedretry':_0x1804a6[_0xb81c('0xf5')]+=0x1,'scheduledat':moment()[_0xb81c('0xfa')](_0x192ce0[_0xb81c('0x127')],'minutes')[_0xb81c('0x75')](_0xb81c('0xfc')),'ContactId':_0x1804a6['ContactId'],'ListId':_0x1804a6[_0xb81c('0xd4')],'VoiceQueueId':_0x1804a6[_0xb81c('0xd6')]||undefined,'CampaignId':_0x1804a6['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));}break;case 0x13:if(_0x1804a6[_0xb81c('0xed')]>=_0x192ce0[_0xb81c('0x105')]-0x1){return!![];}else{this[_0xb81c('0xc0')]({'active':![],'countmachineretry':_0x1804a6['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x192ce0[_0xb81c('0xfb')],_0xb81c('0x106'))['format'](_0xb81c('0xfc')),'ContactId':_0x1804a6[_0xb81c('0xd3')],'ListId':_0x1804a6[_0xb81c('0xd4')],'VoiceQueueId':_0x1804a6[_0xb81c('0xd6')]||undefined,'CampaignId':_0x1804a6['CampaignId']||undefined})[_0xb81c('0xb1')](loggerCatch('[rescheduleContact][Machine]'));}break;case 0x14:if(_0x1804a6[_0xb81c('0xf6')]>=_0x192ce0[_0xb81c('0x1a3')]-0x1){return!![];}else{this[_0xb81c('0xc0')]({'active':![],'countagentrejectretry':_0x1804a6['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xb81c('0xfa')](_0x192ce0[_0xb81c('0x1a4')],_0xb81c('0x106'))[_0xb81c('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1804a6['ContactId'],'ListId':_0x1804a6[_0xb81c('0xd4')],'VoiceQueueId':_0x1804a6[_0xb81c('0xd6')]||undefined,'CampaignId':_0x1804a6[_0xb81c('0xd7')]||undefined})[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x1a5')));}break;default:return!![];}};Dialer[_0xb81c('0x16')]['callProgressDetecting']=function(_0x30a6b6,_0x148aa5,_0xa4ba25){var _0x4fd670=this;var _0x3a3a9a=new History(_0x30a6b6);return new BPromise(function(_0x427b89,_0x3d4b45){if(_['isUndefined'](_0x148aa5)&&_0xb81c('0x1a6')!==typeof _0x148aa5){return _0x3d4b45(msgResponse(_0xb81c('0x1a7'),'Failure','entity\x20is\x20undefine'));}if(_[_0xb81c('0x38')](_0xa4ba25)&&_0xb81c('0x1a6')!==typeof _0xa4ba25){return _0x3d4b45(msgResponse(_0xb81c('0x1a7'),_0xb81c('0x146'),_0xb81c('0x1a8')));}switch(_0xa4ba25[_0xb81c('0x10f')]){case'0':_0x148aa5[_0xb81c('0x1a9')]+=0x1;_0x3a3a9a['state']=0x0;_0x3a3a9a[_0xb81c('0xe7')]=_0xb81c('0x1aa');_0x3a3a9a[_0xb81c('0xf3')]+=0x1;_0x3a3a9a[_0xb81c('0xee')]+=0x1;ami[_0xb81c('0x46')](_0xb81c('0x1ab'),ut['buildObj'](_0x30a6b6,'nosuchnumber'));_0x4fd670[_0xb81c('0xcb')](_0x3a3a9a)[_0xb81c('0xb1')](loggerCatch(_0xb81c('0xf0')));if(_0x4fd670[_0xb81c('0x1ac')](0x0,_0x30a6b6,_0x148aa5)){if(_0x3a3a9a['countnosuchnumberretry']>=_0x148aa5['dialNoSuchNumberMaxRetry']){_0x4fd670['createStateFinal'](_0x3a3a9a,_0x427b89,_0x3d4b45,'reason\x200\x20no\x20such\x20number....');}else{_0x4fd670[_0xb81c('0x104')](_0x3a3a9a,_0x427b89,_0x3d4b45,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x148aa5[_0xb81c('0x5f')]+=0x1;_0x3a3a9a[_0xb81c('0xe6')]=0x3;_0x3a3a9a[_0xb81c('0xe7')]='NoAnswer';_0x3a3a9a[_0xb81c('0xf2')]+=0x1;_0x3a3a9a[_0xb81c('0xee')]+=0x1;ami[_0xb81c('0x46')](_0xb81c('0x1ad'),ut['buildObj'](_0x30a6b6,_0xb81c('0x1ae')));_0x4fd670[_0xb81c('0xcb')](_0x3a3a9a)[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x1af')));if(_0x4fd670[_0xb81c('0x1ac')](0x3,_0x30a6b6,_0x148aa5)){if(_0x3a3a9a['countnoanswerretry']>=_0x148aa5[_0xb81c('0x19b')]){_0x4fd670[_0xb81c('0x1b0')](_0x3a3a9a,_0x427b89,_0x3d4b45,_0xb81c('0x1b1'));}else{_0x4fd670['stateGlobal'](_0x3a3a9a,_0x427b89,_0x3d4b45,_0xb81c('0x1b1'));}}break;case'5':_0x148aa5[_0xb81c('0x5b')]+=0x1;_0x3a3a9a['state']=0x5;_0x3a3a9a[_0xb81c('0xe7')]='Busy';_0x3a3a9a[_0xb81c('0xf1')]+=0x1;_0x3a3a9a[_0xb81c('0xee')]+=0x1;ami[_0xb81c('0x46')]('custom:agentbusy',ut[_0xb81c('0x1b2')](_0x30a6b6,_0xb81c('0x1b3')));_0x4fd670['createHistory'](_0x3a3a9a)[_0xb81c('0xb1')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x4fd670[_0xb81c('0x1ac')](0x5,_0x30a6b6,_0x148aa5)){if(_0x3a3a9a['countbusyretry']>=_0x148aa5[_0xb81c('0x1b4')]){_0x4fd670[_0xb81c('0x1b0')](_0x3a3a9a,_0x427b89,_0x3d4b45,'reason\x205\x20busy');}else{_0x4fd670['stateGlobal'](_0x3a3a9a,_0x427b89,_0x3d4b45,'reason\x205\x20busy');}}break;case'8':_0x148aa5[_0xb81c('0x5c')]+=0x1;_0x3a3a9a['state']=0x8;_0x3a3a9a[_0xb81c('0xe7')]=_0xb81c('0x1b5');_0x3a3a9a[_0xb81c('0x103')]+=0x1;_0x3a3a9a[_0xb81c('0xee')]+=0x1;ami[_0xb81c('0x46')](_0xb81c('0x1b6'),ut[_0xb81c('0x1b2')](_0x30a6b6,_0xb81c('0x1b7')));_0x4fd670['createHistory'](_0x3a3a9a)[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x1b8')));if(_0x4fd670[_0xb81c('0x1ac')](0x8,_0x30a6b6,_0x148aa5)){if(_0x3a3a9a['countcongestionretry']>=_0x148aa5[_0xb81c('0x19e')]){_0x4fd670['createStateFinal'](_0x3a3a9a,_0x427b89,_0x3d4b45,_0xb81c('0x1b9'));}else{_0x4fd670[_0xb81c('0x104')](_0x3a3a9a,_0x427b89,_0x3d4b45,_0xb81c('0x1b9'));}}break;case'11':_0x148aa5[_0xb81c('0x1ba')]+=0x1;_0x3a3a9a[_0xb81c('0xe6')]=0xb;_0x3a3a9a['statedesc']=_0xb81c('0x123');_0x3a3a9a['countabandonedretry']+=0x1;_0x3a3a9a[_0xb81c('0xee')]+=0x1;_0x4fd670[_0xb81c('0xcb')](_0x3a3a9a)[_0xb81c('0xb1')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x4fd670[_0xb81c('0x1ac')](0xb,_0x30a6b6,_0x148aa5)){if(_0x3a3a9a[_0xb81c('0xf5')]>=_0x148aa5[_0xb81c('0x126')]){_0x4fd670[_0xb81c('0x1b0')](_0x3a3a9a,_0x427b89,_0x3d4b45,'reason\x2011\x20abandoned');}else{_0x4fd670[_0xb81c('0x104')](_0x3a3a9a,_0x427b89,_0x3d4b45,'reason\x2011\x20abandoned');}}break;case'20':_0x148aa5[_0xb81c('0x62')]+=0x1;_0x3a3a9a[_0xb81c('0xe6')]=0x14;_0x3a3a9a['statedesc']='AgentReject';_0x3a3a9a[_0xb81c('0xf6')]+=0x1;_0x3a3a9a[_0xb81c('0xee')]+=0x1;ami[_0xb81c('0x46')](_0xb81c('0x1bb'),ut[_0xb81c('0x1b2')](_0x30a6b6,_0xb81c('0x1bc')));_0x4fd670[_0xb81c('0xcb')](_0x3a3a9a)['catch'](loggerCatch(_0xb81c('0x1bd')));if(_0x4fd670['checkRetriveMax'](0x14,_0x30a6b6,_0x148aa5)){if(_0x3a3a9a[_0xb81c('0xf6')]>=_0x148aa5['dialAgentRejectMaxRetry']){_0x4fd670[_0xb81c('0x1b0')](_0x3a3a9a,_0x427b89,_0x3d4b45,_0xb81c('0x1be'));}else{_0x4fd670['stateGlobal'](_0x3a3a9a,_0x427b89,_0x3d4b45,_0xb81c('0x1be'));}}break;default:_0x148aa5[_0xb81c('0x10c')]+=0x1;_0x3a3a9a['state']=0xc;_0x3a3a9a[_0xb81c('0xe7')]=_0xa4ba25['reason'];_0x4fd670['createHistory'](_0x3a3a9a)['catch'](loggerCatch(_0xb81c('0x1bf')));if(_0x4fd670['checkRetriveMax'](_0xa4ba25[_0xb81c('0x10f')],_0x30a6b6,_0x148aa5)){if(_0x3a3a9a[_0xb81c('0xf1')]+_0x3a3a9a[_0xb81c('0x103')]+_0x3a3a9a[_0xb81c('0xf2')]+_0x3a3a9a[_0xb81c('0xf3')]+_0x3a3a9a[_0xb81c('0xf4')]+_0x3a3a9a[_0xb81c('0xf5')]+_0x3a3a9a['countmachineretry']+_0x3a3a9a['countagentrejectretry']>=_0x148aa5['dialGlobalMaxRetry']){_0x4fd670[_0xb81c('0x104')](_0x3a3a9a,_0x427b89,_0x3d4b45,_0xa4ba25[_0xb81c('0x10f')]);}else{_0x4fd670[_0xb81c('0x1b0')](_0x3a3a9a,_0x427b89,_0x3d4b45,_0xa4ba25[_0xb81c('0x10f')]);}}}});};Dialer[_0xb81c('0x16')]['stateGlobal']=function(_0x4feae8,_0x1caed3,_0x2fbc32,_0x1c1889){var _0x55e3cb=new Final(_0x4feae8);_0x55e3cb[_0xb81c('0xe6')]=0xf;_0x55e3cb[_0xb81c('0xe7')]=_0xb81c('0x1c0');this['createStateFinal'](_0x55e3cb,_0x1caed3,_0x2fbc32,_0x1c1889);};Dialer[_0xb81c('0x16')][_0xb81c('0x1b0')]=function(_0x68246c,_0x36b50c,_0x469457,_0x58bdfa){this['moveContactManagedDialer'](_0x68246c)[_0xb81c('0xb8')](function(_0x3b5061){return _0x36b50c(msgResponse(_0xb81c('0x1a7'),_0xb81c('0xdb'),_0x58bdfa));})[_0xb81c('0xb1')](function(_0x58f291){return _0x469457(msgResponse('[moveContactManagedDialer][0]','Failure',_0xb81c('0x1c1')));});};Dialer['prototype']['predictive']=function(_0x50d3ef){var _0xb4b0f0=this;var _0x40efa2=_0x50d3ef[_0xb81c('0x1c2')]/0x64;var _0x5853b9=_0x50d3ef['outboundDropCallsDayTimeout']/(_0x50d3ef[_0xb81c('0x119')]+_0x50d3ef[_0xb81c('0x59')]);var _0x3bdbe6=Math[_0xb81c('0x1c3')](_0x50d3ef[_0xb81c('0x6c')]*(_0x50d3ef[_0xb81c('0x1c4')]/0x64));var _0x21ec05=Math[_0xb81c('0x1c3')](_0x50d3ef[_0xb81c('0x6c')]*(_0x50d3ef[_0xb81c('0x1c5')]/0x64));var _0x56638f=_0x50d3ef[_0xb81c('0x4a')]+_0x50d3ef[_0xb81c('0x4d')];var _0x2310ed=Math['floor'](_0x50d3ef[_0xb81c('0x6e')]*_0x50d3ef[_0xb81c('0x89')]*_0x50d3ef[_0xb81c('0x6a')]*_0x50d3ef[_0xb81c('0x6b')]);if(_[_0xb81c('0x38')](_0x50d3ef[_0xb81c('0x23')])){if(!_[_0xb81c('0x38')](_0x50d3ef[_0xb81c('0x22')])){_0x50d3ef[_0xb81c('0x22')]=undefined;loggerPredictive['error'](_0xb81c('0x1c6'),_0xb81c('0x1c7'));}if(!_['isUndefined'](_0x50d3ef['handlePredictive'])){loggerPredictive[_0xb81c('0x91')](_0xb81c('0x1c6'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x50d3ef[_0xb81c('0x8d')]);_0x50d3ef['handlePredictive']=undefined;}_0x50d3ef[_0xb81c('0x23')]=moment()[_0xb81c('0x75')](_0xb81c('0xfc'));loggerPredictive[_0xb81c('0x7c')](_0x50d3ef[_0xb81c('0x3c')],_0xb81c('0x1c8'),_0x50d3ef['startProgressive']);this['handlePower'](_0x50d3ef,0x1);}else if(ifInterval(_0x50d3ef[_0xb81c('0x1c9')],_0x50d3ef[_0xb81c('0x23')])){this[_0xb81c('0x15a')](_0x50d3ef,0x1);loggerPredictiveCalls[_0xb81c('0x7c')](_0xb81c('0x1ca'),_0x50d3ef[_0xb81c('0x23')],_0x50d3ef[_0xb81c('0x3c')]);_0x50d3ef['erlangCalls']=0x0;_0x50d3ef[_0xb81c('0x69')]=0x0;}else if(_0x40efa2<_0x5853b9&&_0x50d3ef[_0xb81c('0x1cb')]===_0xb81c('0x1cc')){freeVariablesPredictive(_0x50d3ef);loggerPredictive[_0xb81c('0x7c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xb81c('0x1cd'),_0x5853b9,'startProgressive',_0x50d3ef[_0xb81c('0x3c')]);}else if(_0x2310ed<_0x50d3ef[_0xb81c('0x69')]&&_0x50d3ef[_0xb81c('0x1cb')]===_0xb81c('0x1cc')){freeVariablesPredictive(_0x50d3ef);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x1ce'),'Max\x20Drop\x20',_0x2310ed,_0xb81c('0x1cf'),_0x50d3ef[_0xb81c('0x69')],_0xb81c('0x23'),_0x50d3ef[_0xb81c('0x3c')]);}else if(!ifInterval(_0x50d3ef[_0xb81c('0x1c9')],_0x50d3ef['startProgressive'])&&_[_0xb81c('0x38')](_0x50d3ef['startPredictive'])&&!_[_0xb81c('0x38')](_0x50d3ef['startProgressive'])){_0x50d3ef[_0xb81c('0x22')]=moment()[_0xb81c('0x75')](_0xb81c('0xfc'));loggerPredictive[_0xb81c('0x7c')](_0x50d3ef[_0xb81c('0x3c')],_0xb81c('0x1d0'),_0x50d3ef[_0xb81c('0x22')]);this[_0xb81c('0xbd')](_0x50d3ef[_0xb81c('0x1c9')])['then'](this['getDataPredictive'](_0x50d3ef))[_0xb81c('0xb8')](mergeDataErlangB(_0x50d3ef))[_0xb81c('0xb8')](this[_0xb81c('0x1d1')](_0x50d3ef))[_0xb81c('0xb1')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x50d3ef));}else if(!ifInterval(_0x50d3ef['dialPredictiveInterval'],_0x50d3ef['startPredictive'])){_0x50d3ef[_0xb81c('0x69')]=0x0;_0x50d3ef[_0xb81c('0x22')]=moment()[_0xb81c('0x75')](_0xb81c('0xfc'));loggerPredictive['info'](_0x50d3ef[_0xb81c('0x3c')],_0xb81c('0x1d2'),_0x50d3ef[_0xb81c('0x22')]);clearInterval(_0x50d3ef[_0xb81c('0x8d')]);_0x50d3ef[_0xb81c('0x8d')]=undefined;this[_0xb81c('0xbd')](_0x50d3ef['dialPredictiveInterval'])[_0xb81c('0xb8')](this['getDataPredictive'](_0x50d3ef))[_0xb81c('0xb8')](mergeDataErlangB(_0x50d3ef))[_0xb81c('0xb8')](this[_0xb81c('0x1d1')](_0x50d3ef))['catch'](loggerCatchPredictive(_0xb81c('0x1d3'),_0x50d3ef));}else if(_0x50d3ef[_0xb81c('0x6c')]&&_0x56638f<_0x50d3ef['predictiveIntervalAvailable']-_0x21ec05){freeVariablesPredictive(_0x50d3ef);loggerPredictive['info'](_0x50d3ef['name'],_0xb81c('0x1d4'),_0x56638f,_0xb81c('0x1d5'),_0x50d3ef['predictiveIntervalAvailable'],'-',_0x21ec05,'=',_0x50d3ef['predictiveIntervalAvailable']-_0x21ec05,')');}else if(_0x50d3ef[_0xb81c('0x6c')]&&_0x56638f>_0x50d3ef[_0xb81c('0x6c')]+_0x3bdbe6){freeVariablesPredictive(_0x50d3ef);loggerPredictive[_0xb81c('0x7c')](_0x50d3ef['name'],_0xb81c('0x1d4'),_0x56638f,_0xb81c('0x1d6'),_0x50d3ef['predictiveIntervalAvailable'],'+',_0x3bdbe6,'=',_0x50d3ef[_0xb81c('0x6c')]+_0x3bdbe6,')');}};Dialer[_0xb81c('0x16')]['getDataPredictive']=function(_0x48c911){var _0x4a25aa=this;return function(_0x5b41c4){return new BPromise(function(_0x4f13b6,_0x3d7f47){_[_0xb81c('0xd1')](_0x48c911,_0x5b41c4[0x0]);if(checkGetDataPredictive(_0x5b41c4[0x0])){var _0x3e4df0=_0x48c911[_0xb81c('0x6c')]=_0x48c911[_0xb81c('0x4d')]+_0x48c911[_0xb81c('0x4a')];var _0x1c6443=_0x48c911[_0xb81c('0x1c9')]*0x3c;var _0x196b0a=_0x5b41c4[0x0][_0xb81c('0x65')]+_0x5b41c4[0x0]['predictiveIntervalAvgHoldtime'];var _0x1ace28=(_0x5b41c4[0x0][_0xb81c('0x63')]+_0x5b41c4[0x0][_0xb81c('0x67')]+_0x5b41c4[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5b41c4[0x0][_0xb81c('0x6d')];_0x48c911[_0xb81c('0x6a')]=_0x1ace28>0x0?_0x1ace28:0x1;switch(_0x48c911['dialPredictiveOptimization']){case _0xb81c('0x1cc'):var _0x5aa151=_0x48c911[_0xb81c('0x1c2')]/0x64;return _0x4a25aa[_0xb81c('0x1d7')](_0x3e4df0,_0x1c6443,_0x196b0a,_0x1ace28,_0x5aa151)['then'](function(_0x266074){return _0x4f13b6(_0x266074);});case'agentBusyFactor':var _0x428db7=_0x48c911['dialPredictiveOptimizationPercentage']/0x64;return _0x4a25aa[_0xb81c('0x1d8')](_0x3e4df0,_0x1c6443,_0x196b0a,_0x1ace28,_0x428db7)[_0xb81c('0xb8')](function(_0x32b9ee){return _0x4f13b6(_0x32b9ee);});default:return _0x3d7f47(msgResponse(_0xb81c('0x1d9'),_0xb81c('0x146'),_0xb81c('0x1da')));}}else{return _0x3d7f47(msgResponse(_0xb81c('0x1d9'),_0xb81c('0x146'),'check\x20failure'));}});};};Dialer[_0xb81c('0x16')]['getDataPredictiveOld']=function(_0x8329f1){var _0x20703f=this;return function(_0x508cae){return new BPromise(function(_0x3f0cf1,_0x3bb1a4){_[_0xb81c('0xd1')](_0x8329f1,_0x508cae[0x0]);if(checkGetDataPredictive(_0x508cae[0x0])){loggerPredictive[_0xb81c('0x7c')](JSON[_0xb81c('0x74')](_0x508cae[0x0]));if(_0x8329f1[_0xb81c('0x1cb')]===_0xb81c('0x1cc')){return _0x20703f[_0xb81c('0xc7')](_0x8329f1['id'])[_0xb81c('0xb8')](function(_0x4eb5c9){var _0x2a5057=_0x8329f1[_0xb81c('0x4b')]-_0x4eb5c9[0x0][_0xb81c('0x1db')];var _0x1dd423=_0x8329f1['dialPredictiveInterval']*0x3c;var _0x4d2f44=_0x508cae[0x0][_0xb81c('0x65')]+_0x508cae[0x0][_0xb81c('0x64')];var _0x5f59a1=(_0x508cae[0x0]['predictiveIntervalAnsweredCalls']+_0x508cae[0x0][_0xb81c('0x67')]+_0x508cae[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x508cae[0x0][_0xb81c('0x6d')];var _0x5646b5=_0x8329f1[_0xb81c('0x1c2')]/0x64;_0x8329f1['predictiveIntervalPauses']=_0x4eb5c9[0x0][_0xb81c('0x1db')]||0x0;_0x8329f1['predictiveIntervalHitRate']=_0x5f59a1>0x0?_0x5f59a1:0x1;return _0x20703f[_0xb81c('0x1d7')](_0x2a5057,_0x1dd423,_0x4d2f44,_0x5f59a1,_0x5646b5);})[_0xb81c('0xb8')](function(_0x531023){return _0x3f0cf1(_0x531023);})['catch'](function(_0x3cf0c9){return _0x3bb1a4(msgResponse(_0xb81c('0x1dc'),_0xb81c('0x146'),JSON[_0xb81c('0x74')](_0x3cf0c9)));});}if(_0x8329f1[_0xb81c('0x1cb')]===_0xb81c('0x1dd')){return _0x20703f[_0xb81c('0xc7')](_0x8329f1['id'])['then'](function(_0x54c047){var _0x44eb5b=_0x8329f1['loggedIn']-_0x54c047[0x0][_0xb81c('0x1db')];var _0x2865d4=_0x8329f1['dialPredictiveInterval']*0x3c;var _0xce399d=_0x508cae[0x0][_0xb81c('0x65')]+_0x508cae[0x0][_0xb81c('0x64')];var _0x1eea97=(_0x508cae[0x0][_0xb81c('0x63')]+_0x508cae[0x0][_0xb81c('0x67')]+_0x508cae[0x0][_0xb81c('0x66')])/_0x508cae[0x0]['predictiveIntervalTotalCalls'];var _0x49a50c=_0x8329f1['dialPredictiveOptimizationPercentage']/0x64;_0x8329f1[_0xb81c('0x1de')]=_0x54c047[0x0][_0xb81c('0x1db')]||0x0;_0x8329f1[_0xb81c('0x6a')]=_0x1eea97>0x0?_0x1eea97:0x1;return _0x20703f[_0xb81c('0x1d8')](_0x44eb5b,_0x2865d4,_0xce399d,_0x1eea97,_0x49a50c);})[_0xb81c('0xb8')](function(_0xcd553){return _0x3f0cf1(_0xcd553);})[_0xb81c('0xb1')](function(_0x398cf4){return _0x3bb1a4(msgResponse(_0xb81c('0x1dc'),'Failure',JSON[_0xb81c('0x74')](_0x398cf4)));});}}else{return _0x3bb1a4(msgResponse(_0xb81c('0x1d9'),_0xb81c('0x146'),_0xb81c('0x1df')));}});};};Dialer['prototype'][_0xb81c('0x1d1')]=function(_0xaf947b){var _0x4b372f=this;return function(){var _0x315e98=0x0;var _0x1f1b1e=Math[_0xb81c('0x1e0')](_0xaf947b[_0xb81c('0x6f')]*0x3e8);if(_0x1f1b1e>0x0){_0x1f1b1e=_0x1f1b1e<0x64?0x64:_0x1f1b1e;loggerPredictive[_0xb81c('0x7c')](_0xaf947b[_0xb81c('0x3c')],_0xb81c('0x1e1'),_0x1f1b1e,_0xb81c('0x43'));_0xaf947b[_0xb81c('0x8d')]=setInterval(function(){_0x4b372f[_0xb81c('0x8d')](_0xaf947b);loggerPredictiveCalls[_0xb81c('0x7c')](_0xb81c('0x1e2'),_0x315e98+=0x1);},_0x1f1b1e);}else{loggerPredictive[_0xb81c('0x7c')](_0xaf947b[_0xb81c('0x3c')],_0xb81c('0x1e3'));}};};Dialer[_0xb81c('0x16')][_0xb81c('0x1e4')]=function(_0x48e387,_0x1a28e0){var _0x145d61=this;return function(_0x19b5c1){if(_[_0xb81c('0x7a')](_0x19b5c1)){if(_[_0xb81c('0xad')](_0x1a28e0[_0xb81c('0xd5')])||!_0x1a28e0[_0xb81c('0x1e5')]){if(_0x48e387['dialMethod']===_0xb81c('0x8')){_0x48e387[_0xb81c('0x130')]=_['isUndefined'](_0x48e387['queueStatusComplete'])?!![]:_0x48e387[_0xb81c('0x130')];var _0x277f33=uuid['v4']();_0x145d61[_0xb81c('0xa8')][_0x277f33]=new Action(_0x48e387,_0x1a28e0,_0x277f33);loggerBooked['info'](_0xb81c('0x1e6'),_0x277f33,_0xb81c('0x1e7'),JSON[_0xb81c('0x74')](_0x48e387[_0xb81c('0x130')]),'Queue:\x20',_0x48e387[_0xb81c('0x3c')]);if(_0x48e387[_0xb81c('0x130')]){_0x48e387['queueStatusComplete']=![];_0x145d61[_0xb81c('0x24')][_0x145d61[_0xb81c('0xa8')][_0x277f33][_0xb81c('0xb3')]]=[];ami[_0xb81c('0xae')]({'actionid':_0x277f33,'action':_0xb81c('0x1e8'),'queue':_0x48e387[_0xb81c('0x3c')]})[_0xb81c('0xb1')](function(_0x48c2fe){_0x145d61[_0xb81c('0xb4')](_0x48e387);_0x145d61[_0xb81c('0xc0')]({'active':![],'ContactId':_0x145d61['actions'][_0x277f33]['ContactId'],'ListId':_0x145d61[_0xb81c('0xa8')][_0x277f33][_0xb81c('0xd4')],'VoiceQueueId':_0x145d61['actions'][_0x277f33][_0xb81c('0xd6')]||undefined,'CampaignId':_0x145d61[_0xb81c('0xa8')][_0x277f33][_0xb81c('0xd7')]||undefined})['catch'](loggerCatch(_0xb81c('0x1e9')));delete _0x145d61[_0xb81c('0xa8')][_0x277f33];});}else{loggerBooked[_0xb81c('0x7c')](_0xb81c('0x1ea'),JSON['stringify'](_0x48e387[_0xb81c('0x130')]),_0xb81c('0x1eb'),_0x48e387[_0xb81c('0x3c')]);_0x145d61[_0xb81c('0xb4')](_0x48e387);_0x145d61[_0xb81c('0xc0')]({'active':![],'ContactId':_0x145d61['actions'][_0x277f33][_0xb81c('0xd3')],'ListId':_0x145d61['actions'][_0x277f33][_0xb81c('0xd4')],'VoiceQueueId':_0x145d61[_0xb81c('0xa8')][_0x277f33][_0xb81c('0xd6')]||undefined,'CampaignId':_0x145d61[_0xb81c('0xa8')][_0x277f33][_0xb81c('0xd7')]||undefined})[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x1e9')));delete _0x145d61[_0xb81c('0xa8')][_0x277f33];}}else{return _0x145d61[_0xb81c('0x1ec')](_0x48e387,_0x1a28e0);}}else{if(getDiff(_0x1a28e0[_0xb81c('0x1ed')])<_0x48e387[_0xb81c('0x1ee')]*0x3c){if(_0x1a28e0[_0xb81c('0x1ef')]&&!_0x1a28e0[_0xb81c('0x1ef')][_0xb81c('0x1f0')]){_0x145d61[_0xb81c('0x1a')][_0xb81c('0x1f1')](_0x1a28e0['id'])[_0xb81c('0x19')](function(){_0x145d61[_0xb81c('0xb4')](_0x48e387);});}else{_0x145d61['unlockContact']({'active':![]},_0x1a28e0['id'],0x1)[_0xb81c('0x19')](function(){console[_0xb81c('0x1f2')]('Contact\x20updated');_0x145d61[_0xb81c('0xb4')](_0x48e387);});}}else{_0x48e387[_0xb81c('0x61')]+=0x1;_0x145d61[_0xb81c('0xb4')](_0x48e387);if(_0x48e387[_0xb81c('0x1f3')]){_0x145d61[_0xb81c('0xc0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1a28e0[_0xb81c('0xd3')],'ListId':_0x1a28e0[_0xb81c('0xd4')],'VoiceQueueId':_0x1a28e0[_0xb81c('0xd6')]||undefined,'CampaignId':_0x1a28e0[_0xb81c('0xd7')]||undefined})[_0xb81c('0xb1')](loggerCatch(_0xb81c('0x1f4')));_0x145d61[_0xb81c('0xcb')](createObjHistory(_0x48e387,_0x1a28e0,'RECALLINQUEUE',0x17,_0xb81c('0x1f5')))[_0xb81c('0xb1')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x145d61[_0xb81c('0xde')](createObjHistory(_0x48e387,_0x1a28e0,_0xb81c('0x1f6'),0x16,'RecallFailedTimeout'),_0xb81c('0x1f7'),_0xb81c('0x1f8'));}}}}else{_0x48e387['outboundBlacklistCallsDay']+=0x1;_0x145d61['saveInDb'](createObjHistory(_0x48e387,_0x1a28e0,_0xb81c('0x1f9'),0xd,_0xb81c('0x1fa')),'[Originate][historyBlacklist]',_0xb81c('0x1fb'));throw _0xb81c('0x1fc');}};};Dialer[_0xb81c('0x16')][_0xb81c('0x1fd')]=function(_0x283884){var _0x283b54=this;var _0x58bc37=[];var _0x41833a=_0x283884['limitCalls']-_0x283884[_0xb81c('0x95')]-_0x283884[_0xb81c('0x1fe')];emitCampaignSummary(_0x283884);if(_0x41833a>0x0){if(_0x41833a>this[_0xb81c('0x1f')]){_0x41833a=this[_0xb81c('0x1f')];}_0x283884[_0xb81c('0x1fe')]+=_0x41833a;this['getContactDialerIvr'](_0x283884['id'],_0x41833a,_0x283884[_0xb81c('0x1ff')])[_0xb81c('0xb8')](function(_0x2bf121){_0x283884[_0xb81c('0x1fe')]-=_0x41833a;_0x283884['temp']=_0x283884[_0xb81c('0x1fe')]>0x0?_0x283884['temp']:0x0;if(!checkContactEmpty(_0x2bf121)){_0x283884[_0xb81c('0x39')]=_0xb81c('0x9b');logger[_0xb81c('0x7c')](_0xb81c('0x200')+_0x283884[_0xb81c('0x3c')]);}else{_0x283884[_0xb81c('0x95')]+=_0x2bf121['length'];_0x283884[_0xb81c('0x39')]=_0xb81c('0x201');for(var _0x34670f=0x0;_0x34670f<_0x2bf121['length'];_0x34670f+=0x1){_0x283884[_0xb81c('0x202')]+=0x1;if(_[_0xb81c('0xad')](_0x2bf121[_0x34670f])||_[_0xb81c('0xad')](_0x2bf121[_0x34670f][_0xb81c('0x168')])||_[_0xb81c('0xad')](_0x2bf121[_0x34670f][_0xb81c('0x168')][_0xb81c('0x169')])){_0x283b54[_0xb81c('0x203')](_0xb81c('0x204'),_0x283884,_0x2bf121[_0x34670f]);}else{_0x283b54[_0xb81c('0xbb')](_[_0xb81c('0xd2')](_0x2bf121[_0x34670f],['CampaignId',_0xb81c('0x205')]))[_0xb81c('0xb8')](_0x283b54[_0xb81c('0x1e4')](_0x283884,_0x2bf121[_0x34670f]))['catch'](_0x283b54['loggerHandler']('[actionOriginateIvr]\x20',_0x283884));}}}})[_0xb81c('0xb1')](loggerGetContactDialer('[getContactCampaign2]',_0x283884,_0x41833a));}};Dialer['prototype']['handlePower']=function(_0x10a86a,_0xac28fc){var _0x24fce1=this;var _0x14807f=[];var _0x4bed02=_0xac28fc>=0x1?_0xac28fc:0x1;var _0x387e77=[];if(_0x10a86a[_0xb81c('0x54')]===_0xb81c('0x8')){_0x4bed02=0x1;}var _0x33c9fe=Math[_0xb81c('0x1e0')](_0x10a86a[_0xb81c('0x4a')]*_0x4bed02)-_0x10a86a[_0xb81c('0x95')]-_0x10a86a[_0xb81c('0x1fe')];emitVoiceQueueSummary(_0x10a86a);if(_0x10a86a[_0xb81c('0x206')]>0x0){var _0x2b686a=_0x10a86a['dialLimitQueue']-_0x10a86a['originated']-_0x10a86a[_0xb81c('0x4d')]-_0x10a86a[_0xb81c('0x1fe')]-_0x10a86a[_0xb81c('0x9d')];if(_0x33c9fe>_0x2b686a){_0x33c9fe=_0x2b686a;}}if(_0x33c9fe>0x0){if(_0x10a86a[_0xb81c('0x54')]==='booked'){_0x33c9fe=0x1;}if(_0x33c9fe>this[_0xb81c('0x1f')]){_0x33c9fe=this['maxNumberOriginate'];}_0x10a86a['temp']+=_0x33c9fe;for(var _0x135f7c in this[_0xb81c('0x1d')]){if(this[_0xb81c('0x1d')][_0xb81c('0xab')](_0x135f7c)){if(this[_0xb81c('0x1d')][_0x135f7c][_0xb81c('0xe6')]==='not_inuse'&&this[_0xb81c('0x1d')][_0x135f7c][_0xb81c('0xaf')]===_0xb81c('0xdd')){_0x14807f['push'](this[_0xb81c('0x1d')][_0x135f7c]['id']);}}}this[_0xb81c('0xc4')](_0x10a86a['id'],_0x14807f,_0x33c9fe,_0x10a86a[_0xb81c('0x1ff')])[_0xb81c('0xb8')](function(_0x257893){_0x10a86a[_0xb81c('0x1fe')]-=_0x33c9fe;_0x10a86a[_0xb81c('0x1fe')]=_0x10a86a[_0xb81c('0x1fe')]>0x0?_0x10a86a[_0xb81c('0x1fe')]:0x0;if(!checkContactEmpty(_0x257893)){_0x24fce1[_0xb81c('0xb6')](_0x10a86a)[_0xb81c('0xb8')](sendMessageReschedule(_0x10a86a))[_0xb81c('0xb1')](loggerCatch('[countReScheduled]\x20'));}else{_0x10a86a[_0xb81c('0x95')]+=_0x257893['length'];_0x10a86a[_0xb81c('0x39')]=_0x10a86a['dialMethod']===_0xb81c('0x8')?_0xb81c('0x207'):'RUNNING';for(var _0x408856=0x0;_0x408856<_0x257893[_0xb81c('0x94')];_0x408856+=0x1){if(_[_0xb81c('0xad')](_0x257893[_0x408856])||_['isNil'](_0x257893[_0x408856]['Contact'])||_[_0xb81c('0xad')](_0x257893[_0x408856][_0xb81c('0x168')][_0xb81c('0x169')])){_0x24fce1[_0xb81c('0x203')](_0xb81c('0x204'),_0x10a86a,_0x257893[_0x408856]);}else{_0x24fce1[_0xb81c('0xb9')](_[_0xb81c('0xd2')](_0x257893[_0x408856],[_0xb81c('0xd6'),_0xb81c('0x205')]))[_0xb81c('0xb8')](_0x24fce1[_0xb81c('0x1e4')](_0x10a86a,_0x257893[_0x408856]))['catch'](_0x24fce1[_0xb81c('0xcf')]('[actionOriginate]\x20',_0x10a86a));}}}})[_0xb81c('0xb1')](loggerGetContactDialer('[getContactDialer2]',_0x10a86a,_0x33c9fe));}};Dialer[_0xb81c('0x16')][_0xb81c('0x8d')]=function(_0x874212){var _0x34444f=this;if(_0x874212[_0xb81c('0x206')]>0x0){var _0x5027e1=_0x874212['dialLimitQueue']-_0x874212['originated']-_0x874212[_0xb81c('0x4d')];if(_0x5027e1>0x0){this[_0xb81c('0x208')](_0x874212);}else{loggerPredictiveCalls['info'](_0xb81c('0x209'));}}else{this['tryOriginatePredictive'](_0x874212);}};Dialer[_0xb81c('0x16')][_0xb81c('0x208')]=function(_0x4c12bb){var _0x15810e=this;var _0x10c84a=[];_0x4c12bb[_0xb81c('0x95')]+=0x1;for(var _0x47e0bc in this[_0xb81c('0x1d')]){if(this[_0xb81c('0x1d')][_0xb81c('0xab')](_0x47e0bc)){if(this[_0xb81c('0x1d')][_0x47e0bc][_0xb81c('0xe6')]===_0xb81c('0x20a')&&this[_0xb81c('0x1d')][_0x47e0bc][_0xb81c('0xaf')]===_0xb81c('0xdd')){_0x10c84a[_0xb81c('0x14c')](this[_0xb81c('0x1d')][_0x47e0bc]['id']);}}}this[_0xb81c('0xc4')](_0x4c12bb['id'],_0x10c84a,0x1,_0x4c12bb[_0xb81c('0x1ff')])[_0xb81c('0xb8')](function(_0x46f32d){if(!checkContactEmpty(_0x46f32d)){checkContactLowerLimitOriginate(_0x4c12bb,0x1,0x0);_0x15810e[_0xb81c('0xb6')](_0x4c12bb)[_0xb81c('0xb8')](sendMessageReschedule(_0x4c12bb))['catch'](loggerCatch(_0xb81c('0x20b')));}else{_0x4c12bb[_0xb81c('0x39')]=_0xb81c('0x201');if(_[_0xb81c('0xad')](_0x46f32d[0x0])||_[_0xb81c('0xad')](_0x46f32d[0x0]['Contact'])||_[_0xb81c('0xad')](_0x46f32d[0x0][_0xb81c('0x168')]['phone'])){_0x15810e[_0xb81c('0x203')](_0xb81c('0x204'),_0x4c12bb,_0x46f32d[0x0]);}else{_0x15810e[_0xb81c('0xb9')](_[_0xb81c('0xd2')](_0x46f32d[0x0],[_0xb81c('0xd6'),_0xb81c('0x205')]))['then'](_0x15810e['checkContactBlack'](_0x4c12bb,_0x46f32d[0x0]))[_0xb81c('0xb1')](_0x15810e['loggerHandler'](_0xb81c('0x20c'),_0x4c12bb));}}})[_0xb81c('0xb1')](loggerGetContactDialer(_0xb81c('0x20d'),_0x4c12bb,0x1));emitVoiceQueueSummary(_0x4c12bb);};Dialer[_0xb81c('0x16')][_0xb81c('0x1d7')]=function(_0xd47b40,_0x10497c,_0x477db9,_0x40711f,_0x4b90da,_0x4c520b){loggerPredictive['info'](_0xb81c('0x20e'));loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x20f'),_0xd47b40);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x210'),_0x10497c);loggerPredictive['info'](_0xb81c('0x211'),_0x477db9);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x212'),_0x40711f);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x213'),_0x4b90da);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x82'));return new BPromise(function(_0x15f16e,_0x197d73){if(_0xd47b40<=0x0||isNaN(_0xd47b40)){return _0x197d73(msgResponse(_0xb81c('0x214'),'Error',_0xb81c('0x215')+_0xd47b40));}if(_0x477db9<=0x0||isNaN(_0x477db9)){return _0x197d73(msgResponse(_0xb81c('0x214'),_0xb81c('0x216'),_0xb81c('0x217')+_0x477db9));}if(_0x40711f<=0x0||isNaN(_0x40711f)){return _0x197d73(msgResponse(_0xb81c('0x214'),_0xb81c('0x216'),'p\x20=\x20'+_0x40711f));}if(_0x10497c<=0x0||isNaN(_0x10497c)){return _0x197d73(msgResponse(_0xb81c('0x214'),'Error','interval\x20=\x20'+_0x10497c));}if(_0x4b90da<=0x0||isNaN(_0x4b90da)){return _0x197d73(msgResponse(_0xb81c('0x214'),_0xb81c('0x216'),_0xb81c('0x218')+_0x4b90da));}_0x4c520b=_0x4c520b||0x0;var _0x353bad=0x1/_0x477db9;var _0x305237=0x0;var _0x4875cb=0x0;var _0x3ef5ae=0x0;var _0x26f994=0x0;for(var _0x2aa2f7=0x0;_0x3ef5ae<_0x4b90da;_0x2aa2f7+=0x1){_0x4875cb=_0x2aa2f7/_0x10497c;_0x305237=(_0x40711f*_0x4875cb+_0x4c520b)/_0x353bad;_0x3ef5ae=erlangb(_0x305237,_0xd47b40);_0x26f994=_0x305237/_0xd47b40*(0x1-erlangb(_0x305237,_0xd47b40));}return _0x15f16e({'erlangCalls':_0x2aa2f7,'erlangCallToSecond':_0x10497c/_0x2aa2f7,'erlangAbandonmentRate':_0x3ef5ae,'erlangBusyFactor':_0x26f994});});};Dialer[_0xb81c('0x16')]['busyFactor']=function(_0x1edce6,_0x50f700,_0x251615,_0x45e628,_0x5ea4,_0x5d6b4b){loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x219'));loggerPredictive['info'](_0xb81c('0x20f'),_0x1edce6);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x210'),_0x50f700);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x211'),_0x251615);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x45e628);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5ea4);loggerPredictive[_0xb81c('0x7c')](_0xb81c('0x82'));return new BPromise(function(_0x431167,_0x11ff3b){if(_0x1edce6<=0x0||isNaN(_0x1edce6)){return _0x11ff3b(msgResponse(_0xb81c('0x21a'),_0xb81c('0x216'),_0xb81c('0x215')+_0x1edce6));}if(_0x251615<=0x0||isNaN(_0x251615)){return _0x11ff3b(msgResponse(_0xb81c('0x21a'),_0xb81c('0x216'),_0xb81c('0x217')+_0x251615));}if(_0x45e628<=0x0||isNaN(_0x45e628)){return _0x11ff3b(msgResponse(_0xb81c('0x21a'),_0xb81c('0x216'),_0xb81c('0x21b')+_0x45e628));}if(_0x50f700<=0x0||isNaN(_0x50f700)){return _0x11ff3b(msgResponse(_0xb81c('0x21a'),'Error',_0xb81c('0x21c')+_0x50f700));}if(_0x5ea4<=0x0||isNaN(_0x5ea4)){return _0x11ff3b(msgResponse('[busyFactor]',_0xb81c('0x216'),_0xb81c('0x21d')+_0x5ea4));}_0x5d6b4b=_0x5d6b4b||0x0;var _0x40103d=0x1/_0x251615;var _0x49159b=0x0;var _0x3cb8e4=0x0;var _0x20611=0x0;var _0x51457f=0x0;for(var _0x50f307=0x0;_0x51457f<_0x5ea4;_0x50f307+=0x1){_0x3cb8e4=_0x50f307/_0x50f700;_0x49159b=(_0x45e628*_0x3cb8e4+_0x5d6b4b)/_0x40103d;_0x20611=erlangb(_0x49159b,_0x1edce6);_0x51457f=_0x49159b/_0x1edce6*(0x1-erlangb(_0x49159b,_0x1edce6));}return _0x431167({'erlangCalls':_0x50f307,'erlangCallToSecond':_0x50f700/_0x50f307,'erlangAbandonmentRate':_0x20611,'erlangBusyFactor':_0x51457f});});};module[_0xb81c('0x21e')]=Dialer;
\ No newline at end of file
+var _0x6833=['[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','NoSuchNumber','buildObj','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','dialBusyMaxRetry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','log','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','temp','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','reachable','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','RUNNING','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','util','bluebird','md5','../../../config/logger','dialer','booked','predictive','syncQueueSummary','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','custom:queuesummary','hangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','outbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','total','type','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','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','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','talking','waiting','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','starttime','clearZombieChannels','[uniqueid]','[actions]','enqueue','isNil','Action','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','active','SIP/%s','status','unmonitored','saveInDb','uniqueid','variable','exten','value','HANGUP','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','amd','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','syncHangup','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','endtime','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','calleridname','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','push','idHopper','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','queueStatusComplete','preview','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','content','indexOf','true','command','all','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','Timezone:\x20','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','phone','Contact','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','tags','updatedAt','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','substring','TrunkBackup','dialCutDigit','from-sip','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x59e821,_0x86c723){var _0x5333f6=function(_0x5dc2c9){while(--_0x5dc2c9){_0x59e821['push'](_0x59e821['shift']());}};_0x5333f6(++_0x86c723);}(_0x6833,0x7e));var _0x3683=function(_0x191f72,_0x5b98c6){_0x191f72=_0x191f72-0x0;var _0x538636=_0x6833[_0x191f72];return _0x538636;};'use strict';var util=require(_0x3683('0x0'));var _=require('lodash');var BPromise=require(_0x3683('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0x3683('0x2'));var Redis=require('ioredis');var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x3683('0x3'))(_0x3683('0x4'));var loggerBooked=require(_0x3683('0x3'))(_0x3683('0x5'));var loggerPredictive=require(_0x3683('0x3'))(_0x3683('0x6'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x3683('0x3'))(_0x3683('0x7'));var ami=require('../ami');config[_0x3683('0x8')]=_[_0x3683('0x9')](config[_0x3683('0x8')],{'host':_0x3683('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x3683('0xb'));var cmHopperFinal=require(_0x3683('0xc'));var cmHopperHistory=require(_0x3683('0xd'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x3683('0xe'));var Action=require(_0x3683('0xf'));var History=require(_0x3683('0x10'));var Final=require('./final');var AgentComplete=require(_0x3683('0x11'));var QueueCallerAbandon=require(_0x3683('0x12'));var Hangup=require(_0x3683('0x13'));var ipAgi=process[_0x3683('0x14')][_0x3683('0x15')]||_0x3683('0x16');var strategy={'rrmemory':_0x3683('0x17'),'roundrobin':_0x3683('0x18')};var Sequence=function(){};Sequence[_0x3683('0x19')]['enqueue']=function(_0xb7e7c3){this[_0x3683('0x1a')]=this[_0x3683('0x1a')]?this['tail'][_0x3683('0x1b')](_0xb7e7c3):_0xb7e7c3();};function Dialer(_0x59796c,_0x3fb1ff){this[_0x3683('0x1c')]=new Sequence();this['preview']=_0x3fb1ff;this['voiceQueues']=_0x59796c[_0x3683('0x1d')];this[_0x3683('0x1e')]=_0x59796c[_0x3683('0x1e')];this[_0x3683('0x1f')]=_0x59796c['agents'];this[_0x3683('0x20')]=_0x59796c[_0x3683('0x20')];this[_0x3683('0x21')]=config['maxNumberOriginate']||0x2;this[_0x3683('0x22')]={};this[_0x3683('0x23')]={};this[_0x3683('0x24')]={};this[_0x3683('0x25')]={};this[_0x3683('0x26')]={};this['startPredictive']={};this['startProgressive']={};this[_0x3683('0x27')]={};this[_0x3683('0x28')]={};this[_0x3683('0x29')]={};ami['on'](_0x3683('0x2a'),this['syncAgentConnect'][_0x3683('0x2b')](this));ami['on'](_0x3683('0x2c'),this[_0x3683('0x2d')]['bind'](this));ami['on'](_0x3683('0x2e'),this[_0x3683('0x2f')][_0x3683('0x2b')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x3683('0x2b')](this));ami['on'](_0x3683('0x30'),this['syncQueueSummary']['bind'](this));ami['on'](_0x3683('0x31'),this['syncHangup'][_0x3683('0x2b')](this));ami['on']('newexten',this[_0x3683('0x32')][_0x3683('0x2b')](this));ami['on'](_0x3683('0x33'),this[_0x3683('0x34')][_0x3683('0x2b')](this));ami['on'](_0x3683('0x35'),this[_0x3683('0x36')][_0x3683('0x2b')](this));ami['on'](_0x3683('0x37'),this[_0x3683('0x38')][_0x3683('0x2b')](this));this[_0x3683('0x39')]();this[_0x3683('0x3a')]();}function isNotNull(_0x44bb2c){return _0x44bb2c!==null&&!_[_0x3683('0x3b')](_0x44bb2c);}function checkIsLoggedIn(_0x17e633,_0x5df6cc){return function(){if(_0x5df6cc<=0x0){_0x17e633['message']=_0x3683('0x3c');throw _0x17e633[_0x3683('0x3d')]+_0x3683('0x3e');}};}function isActive(_0x232548){return _0x232548;}function checkIsActive(_0x5be46c,_0x56e931){return function(){if(!isActive(_0x56e931)){_0x5be46c[_0x3683('0x3f')]=_0x3683('0x40');throw _0x5be46c[_0x3683('0x3d')]+_0x3683('0x41');}};}function checkInterval(_0x34656d){return function(){if(!isNotNull(_0x34656d[_0x3683('0x42')])){_0x34656d['message']=_0x3683('0x43');throw _0x34656d[_0x3683('0x3d')]+_0x3683('0x44');}if(!isNotNull(_0x34656d[_0x3683('0x42')][_0x3683('0x45')])){_0x34656d['message']='INTERVAL_IS_NULL';throw _0x34656d[_0x3683('0x3d')]+_0x3683('0x44');}if(!isNotNull(_[_0x3683('0x46')](_0x34656d[_0x3683('0x42')][_0x3683('0x45')]))){_0x34656d['message']=_0x3683('0x43');throw _0x34656d[_0x3683('0x3d')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x353cb7,_0x325c6d,_0x55d26b){return{'action':_0x353cb7,'response':_0x325c6d,'message':_0x55d26b,'stack':_0x55d26b};}function myreject(_0x24745f){return function(_0x25520e){return _0x24745f(msgResponse(_0x3683('0x47'),_0x3683('0x48'),JSON[_0x3683('0x49')](_0x25520e)));};}function getSeconds(_0x315336,_0x5741af){var _0x5c682c=moment(_0x315336)[_0x3683('0x4a')](0x0);var _0x3503cc=moment(_0x5741af)[_0x3683('0x4a')](0x0);return _0x5c682c[_0x3683('0x4b')](_0x3503cc,_0x3683('0x4c'));}function emit(_0x133a81,_0x1f07e1,_0x5b7d04){io['to'](_0x133a81)[_0x3683('0x4d')](_0x1f07e1,_0x5b7d04);}function emitVoiceQueueSummary(_0x4d3a42){if(_0x4d3a42['type']===_0x3683('0x4e')){var _0x2e9e20={'id':_0x4d3a42['id'],'name':_0x4d3a42[_0x3683('0x3d')],'strategy':_0x4d3a42[_0x3683('0x4f')],'answered':_0x4d3a42[_0x3683('0x50')],'available':_0x4d3a42[_0x3683('0x51')],'loggedIn':_0x4d3a42[_0x3683('0x52')],'pTalking':_0x4d3a42['pTalking'],'sumBillable':_0x4d3a42[_0x3683('0x53')],'sumDuration':_0x4d3a42[_0x3683('0x54')],'sumHoldTime':_0x4d3a42['sumHoldTime']||0x0,'talking':_0x4d3a42['talking'],'total':_0x4d3a42[_0x3683('0x55')],'type':_0x4d3a42[_0x3683('0x56')],'unmanaged':_0x4d3a42[_0x3683('0x57')],'abandoned':_0x4d3a42['abandoned'],'waiting':_0x4d3a42['waiting'],'loggedInDb':_0x4d3a42[_0x3683('0x58')],'dialActive':_0x4d3a42[_0x3683('0x59')],'dialMethod':_0x4d3a42[_0x3683('0x5a')],'dialOriginateCallerIdName':_0x4d3a42['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4d3a42[_0x3683('0x5b')],'dialOriginateTimeout':_0x4d3a42[_0x3683('0x5c')],'dialPrefix':_0x4d3a42['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4d3a42[_0x3683('0x5d')],'outboundAnswerCallsDay':_0x4d3a42[_0x3683('0x5e')],'outboundBlacklistCallsDay':_0x4d3a42[_0x3683('0x5f')],'outboundBusyCallsDay':_0x4d3a42[_0x3683('0x60')],'outboundCongestionCallsDay':_0x4d3a42[_0x3683('0x61')],'outboundDropCallsDayACS':_0x4d3a42[_0x3683('0x62')],'outboundDropCallsDayCallersExit':_0x4d3a42[_0x3683('0x63')],'outboundDropCallsDayTimeout':_0x4d3a42['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x4d3a42[_0x3683('0x64')],'outboundNoSuchCallsDay':_0x4d3a42[_0x3683('0x65')],'outboundOriginateFailureCallsDay':_0x4d3a42[_0x3683('0x66')],'outboundReCallsDay':_0x4d3a42[_0x3683('0x67')],'outboundRejectCallsDay':_0x4d3a42[_0x3683('0x68')],'outboundUnknownCallsDay':_0x4d3a42[_0x3683('0x69')],'predictiveIntervalAnsweredCalls':_0x4d3a42[_0x3683('0x6a')],'predictiveIntervalAvgHoldtime':_0x4d3a42[_0x3683('0x6b')],'predictiveIntervalAvgTalktime':_0x4d3a42[_0x3683('0x6c')],'predictiveIntervalDroppedCallsCallersExit':_0x4d3a42['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4d3a42[_0x3683('0x6d')],'predictiveIntervalErlangCalls':_0x4d3a42[_0x3683('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0x4d3a42[_0x3683('0x6f')],'predictiveIntervalHitRate':_0x4d3a42[_0x3683('0x70')],'predictiveIntervalMultiplicativeFactor':_0x4d3a42[_0x3683('0x71')],'predictiveIntervalPauses':_0x4d3a42['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4d3a42[_0x3683('0x72')],'predictiveIntervalTotalCalls':_0x4d3a42[_0x3683('0x73')],'message':_0x4d3a42['message'],'originated':_0x4d3a42['originated'],'erlangCalls':_0x4d3a42[_0x3683('0x74')],'erlangCallToSecond':_0x4d3a42[_0x3683('0x75')],'erlangAbandonmentRate':_0x4d3a42[_0x3683('0x76')],'erlangBusyFactor':_0x4d3a42[_0x3683('0x77')],'startPredictive':_0x4d3a42[_0x3683('0x78')],'startProgressive':_0x4d3a42[_0x3683('0x79')]};if(_0x4d3a42[_0x3683('0x7a')]){_0x2e9e20[_0x3683('0x7a')]={'id':_0x4d3a42[_0x3683('0x7a')]['id'],'name':_0x4d3a42[_0x3683('0x7a')][_0x3683('0x3d')],'active':_0x4d3a42[_0x3683('0x7a')]['active'],'callerid':_0x4d3a42['Trunk']['callerid']};}if(_0x4d3a42['Interval']){_0x2e9e20[_0x3683('0x42')]={'id':_0x4d3a42[_0x3683('0x42')]['id'],'name':_0x4d3a42[_0x3683('0x42')][_0x3683('0x3d')]};}var _0x546eae=md5(JSON[_0x3683('0x49')](_0x2e9e20));if(_0x4d3a42['md5']!==_0x546eae){_0x4d3a42[_0x3683('0x2')]=_0x546eae;emit(util[_0x3683('0x7b')](_0x3683('0x7c'),_0x2e9e20[_0x3683('0x3d')]),_0x3683('0x7d'),_0x2e9e20);}}}function emitCampaignSummary(_0x2f2cb0){if(_0x2f2cb0['type']===_0x3683('0x7e')){emit(util[_0x3683('0x7b')](_0x3683('0x7f'),_0x2f2cb0[_0x3683('0x3d')]),_0x3683('0x80'),_0x2f2cb0);}}function checkGetDataPredictive(_0x365d58){if(isNotNull(_0x365d58)){if(!_[_0x3683('0x46')](_0x365d58)){loggerPredictive[_0x3683('0x81')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x3683('0x81')](_0x3683('0x82'),_0x365d58[_0x3683('0x73')]);loggerPredictive['info'](_0x3683('0x83'),_0x365d58[_0x3683('0x6a')]);loggerPredictive[_0x3683('0x81')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x365d58[_0x3683('0x6d')]);loggerPredictive[_0x3683('0x81')](_0x3683('0x84'),_0x365d58[_0x3683('0x85')]);loggerPredictive[_0x3683('0x81')](_0x3683('0x86'),_0x365d58[_0x3683('0x6b')]);loggerPredictive[_0x3683('0x81')](_0x3683('0x87'),_0x365d58[_0x3683('0x6c')]);loggerPredictive[_0x3683('0x81')](_0x3683('0x88'));if(_0x365d58[_0x3683('0x73')]>0x0){if(!_[_0x3683('0x3b')](_0x365d58[_0x3683('0x6c')])&&_0x365d58['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x3683('0x81')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x3683('0x3b')](_0x365d58[_0x3683('0x6b')])&&_0x365d58[_0x3683('0x6b')]>0x0){return!![];}else{loggerPredictive['info'](_0x3683('0x89'));}}else{loggerPredictive['info'](_0x3683('0x8a'));}}else{loggerPredictive[_0x3683('0x81')](_0x3683('0x8b'));}}else{loggerPredictive[_0x3683('0x81')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x54187d){return function(_0x207218){loggerPredictive[_0x3683('0x81')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x3683('0x81')](_0x3683('0x8c'),_0x207218[_0x3683('0x74')]);loggerPredictive[_0x3683('0x81')](_0x3683('0x8d'),_0x207218[_0x3683('0x75')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x207218[_0x3683('0x76')]);loggerPredictive[_0x3683('0x81')](_0x3683('0x8e'),_0x207218[_0x3683('0x77')]);loggerPredictive[_0x3683('0x81')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x207218[_0x3683('0x76')]);loggerPredictive[_0x3683('0x81')](_0x3683('0x88'));_[_0x3683('0x8f')](_0x54187d,_0x207218);};}function getDiff(_0x331b11){var _0x3a1d6e=moment()['milliseconds'](0x0);var _0x2e05fe=moment(_0x331b11)[_0x3683('0x4a')](0x0);return _0x3a1d6e['diff'](_0x2e05fe,_0x3683('0x4c'));}function ifInterval(_0x74f561,_0x320b38){if(_['isUndefined'](_0x320b38)){return![];}if(getDiff(_0x320b38)<_0x74f561*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x4879bc){if(isNotNull(_0x4879bc)){if(!_['isUndefined'](_0x4879bc['startProgressive'])){_0x4879bc['startProgressive']=undefined;loggerPredictive['info'](_0x4879bc[_0x3683('0x3d')],_0x3683('0x90'));}if(!_[_0x3683('0x3b')](_0x4879bc[_0x3683('0x78')])){_0x4879bc[_0x3683('0x78')]=undefined;loggerPredictive[_0x3683('0x81')](_0x4879bc[_0x3683('0x3d')],_0x3683('0x91'));}if(!_[_0x3683('0x3b')](_0x4879bc[_0x3683('0x92')])){clearInterval(_0x4879bc[_0x3683('0x92')]);_0x4879bc['handlePredictive']=undefined;loggerPredictive[_0x3683('0x81')](_0x4879bc[_0x3683('0x3d')],_0x3683('0x93'));}}}function erlangb(_0x578ce9,_0x8c5bf0){if(_0x8c5bf0===0x0){return 0x0;}var _0x538a77=0x1;for(var _0x3ae54b=0x1;_0x3ae54b<=_0x8c5bf0;_0x3ae54b+=0x1){_0x538a77=0x1+_0x538a77*_0x3ae54b/_0x578ce9;}return 0x1/_0x538a77;}function isVoiceQueueOutbound(_0x23faa7){return _0x23faa7===_0x3683('0x4e');}function isNotPreview(_0x50df93){return _0x50df93!=='preview';}function isCampaignIvr(_0x3528db){return _0x3528db===_0x3683('0x7e');}function getCallerId(_0x56f90c,_0x37045e,_0x1f4750){if(!_[_0x3683('0x3b')](_0x1f4750)&&'string'===typeof _0x1f4750&&!_[_0x3683('0x46')](_0x1f4750)){if(!_[_0x3683('0x3b')](_0x37045e)&&_0x3683('0x94')===typeof _0x37045e&&!_[_0x3683('0x46')](_0x37045e)){return util[_0x3683('0x7b')](_0x3683('0x95'),_0x37045e,_0x1f4750);}return util[_0x3683('0x7b')](_0x3683('0x95'),_0x1f4750,_0x1f4750);}if(!_['isUndefined'](_0x56f90c)&&_0x3683('0x94')===typeof _0x56f90c&&!_[_0x3683('0x46')](_0x56f90c)){return _0x56f90c;}return _0x3683('0x96');}function loggerCatchQueueSummary(_0x50daeb,_0x3b439e){return function(_0x2b05d8){freeVariablesPredictive(_0x3b439e);emitVoiceQueueSummary(_0x3b439e);emitCampaignSummary(_0x3b439e);loggerSyncQueueSummary[_0x3683('0x97')](_0x50daeb,util[_0x3683('0x98')](_0x2b05d8,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xab0e8b,_0x5a1736){return function(_0x1dee4b){loggerPredictive[_0x3683('0x97')](_0x5a1736[_0x3683('0x3d')],_0xab0e8b);loggerPredictive[_0x3683('0x97')](_0x1dee4b[_0x3683('0x99')]);freeVariablesPredictive(_0x5a1736);};}function loggerCatch(_0x1f3a78){return function(_0x403d23){logger['error'](_0x1f3a78,util['inspect'](_0x403d23,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x15e016){return _0x15e016&&!_[_0x3683('0x3b')](_0x15e016)&&_0x15e016[_0x3683('0x9a')]>0x0;}function decremetOriginate(_0x7ac4b2){if(!_[_0x3683('0x3b')](_0x7ac4b2)&&_0x7ac4b2!==null){if(_0x7ac4b2[_0x3683('0x9b')]('originated')){if(_0x7ac4b2[_0x3683('0x9c')]>0x0){_0x7ac4b2['originated']-=0x1;}else{logger[_0x3683('0x97')](_0x3683('0x9d'));}}}else{logger[_0x3683('0x97')](_0x3683('0x9e'));}}function checkContactLowerLimitOriginate(_0x3f880e,_0x4d1a83,_0xb37754){if(_0x4d1a83>_0xb37754){for(var _0x4c5f56=0x0;_0x4c5f56<_0x4d1a83-_0xb37754;_0x4c5f56+=0x1){decremetOriginate(_0x3f880e);}}}function loggerGetContactDialer(_0x250512,_0x2b4c48,_0xfdc6c5){return function(_0x4e16dd){checkContactLowerLimitOriginate(_0x2b4c48,_0xfdc6c5,0x0);logger[_0x3683('0x97')](_0x250512,util[_0x3683('0x98')](_0x4e16dd,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2b7e36){return function(_0x5a8e13){if(isNotNull(_0x5a8e13)&&isNotNull(_0x5a8e13[0x0])){if(_0x5a8e13[0x0][_0x3683('0x9f')]>0x0){_0x2b7e36[_0x3683('0x3f')]=_0x3683('0xa0');logger[_0x3683('0x81')](_0x3683('0xa1')+_0x2b7e36['name'],_0x5a8e13[0x0][_0x3683('0x9f')],_0x3683('0xa2'));}else{_0x2b7e36[_0x3683('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x3683('0xa3')+_0x2b7e36[_0x3683('0x3d')]);}}};}function notSendMessagesQueue(_0x44c21a){if(_0x44c21a['sendMessageOneNotActive']){freeVariablesPredictive(_0x44c21a);if(_0x44c21a[_0x3683('0x9c')]===0x0&&_0x44c21a[_0x3683('0xa4')]===0x0&&_0x44c21a[_0x3683('0xa5')]===0x0&&(_0x44c21a['pTalking']||0x0)===0x0){_0x44c21a[_0x3683('0xa6')]=![];_0x44c21a[_0x3683('0x51')]=0x0;_0x44c21a[_0x3683('0x3f')]=_0x3683('0x40');loggerSyncQueueSummary[_0x3683('0x97')](_0x3683('0xa7'),_0x44c21a[_0x3683('0x3d')],_0x3683('0xa8'));}else{_0x44c21a[_0x3683('0x3f')]=_0x3683('0xa9');loggerSyncQueueSummary[_0x3683('0x97')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x44c21a[_0x3683('0x3d')],_0x3683('0xaa'));}emitVoiceQueueSummary(_0x44c21a);}}function notSendMessagesCampaign(_0x58710e){if(_0x58710e[_0x3683('0xa6')]){if(_0x58710e[_0x3683('0x9c')]===0x0){_0x58710e['sendMessageOneNotActive']=![];_0x58710e[_0x3683('0x3f')]=_0x3683('0x40');loggerSyncQueueSummary[_0x3683('0x97')](_0x3683('0xab'),_0x58710e[_0x3683('0x3d')],_0x3683('0xa8'));}else{_0x58710e[_0x3683('0x3f')]=_0x3683('0xa9');loggerSyncQueueSummary[_0x3683('0x97')](_0x3683('0xab'),_0x58710e[_0x3683('0x3d')],_0x3683('0xaa'));}emitCampaignSummary(_0x58710e);}}function createObjHistory(_0x34d5ab,_0x1c7ca9,_0x18feee,_0x2e5027,_0x4fc54f){_0x34d5ab[_0x3683('0x3f')]=_0x18feee;var _0x3a3980=new Action(_0x34d5ab,_0x1c7ca9);var _0x4855ce=new History(_0x3a3980);_0x4855ce[_0x3683('0xac')]=_0x2e5027;_0x4855ce[_0x3683('0xad')]=_0x4fc54f;_0x4855ce['endtime']=_0x3a3980[_0x3683('0xae')];return _0x4855ce;}Dialer[_0x3683('0x19')][_0x3683('0x3a')]=function(){var _0x110aaa=this;setInterval(function(){_0x110aaa[_0x3683('0xaf')](_0x110aaa[_0x3683('0x25')],_0x3683('0xb0'));_0x110aaa[_0x3683('0xaf')](_0x110aaa[_0x3683('0x23')],_0x3683('0xb1'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x180388,_0x3894ca){var _0xe2bccd=this;for(var _0x489306 in _0x180388){if(_0x180388[_0x3683('0x9b')](_0x489306)){this['sequence'][_0x3683('0xb2')](function(){if(!_[_0x3683('0xb3')](_0x180388[_0x489306])){return ami[_0x3683('0xb4')]({'action':'status','channel':_0x180388[_0x489306][_0x3683('0xb5')]})[_0x3683('0xb6')](function(_0x284a3e){if(_0x284a3e['message']===_0x3683('0xb7')){setTimeout(function(){if(_0x180388[_0x489306]&&_0x180388[_0x489306][_0x3683('0x56')]!=='ivr'){_0xe2bccd[_0x3683('0xb8')](_0xe2bccd[_0x3683('0x1d')][_0x180388[_0x489306][_0x3683('0xb9')]]);logger['error'](_0x3683('0xba'),_0x3894ca,_0x489306,_0x180388[_0x489306][_0x3683('0xb9')]);delete _0x180388[_0x489306];}if(_0x180388[_0x489306]&&_0x180388[_0x489306][_0x3683('0x56')]===_0x3683('0x7e')){_0xe2bccd['updateOriginated'](_0xe2bccd['campaigns'][_0x180388[_0x489306][_0x3683('0xb9')]]);logger['error'](_0x3683('0xbb'),_0x3894ca,_0x489306,_0x180388[_0x489306][_0x3683('0xb9')]);delete _0x180388[_0x489306];}},0x2328);}});}});}}};Dialer['prototype'][_0x3683('0xbc')]=function(_0x3787f2){return BPromise[_0x3683('0xbd')]()[_0x3683('0xbe')](cmHopper[_0x3683('0xbc')](_0x3787f2))[_0x3683('0xb6')](loggerCatch(_0x3683('0xbf')));};Dialer[_0x3683('0x19')][_0x3683('0xc0')]=function(_0x1ec9fb){return BPromise['resolve']()[_0x3683('0xbe')](cmHopperBlack[_0x3683('0xc0')](_0x1ec9fb))[_0x3683('0xb6')](loggerCatch(_0x3683('0xc1')));};Dialer['prototype'][_0x3683('0xc2')]=function(_0xa96fc2){return BPromise[_0x3683('0xbd')]()[_0x3683('0xbe')](cmHopperBlack['checkIsBlackListIvr'](_0xa96fc2))[_0x3683('0xb6')](loggerCatch(_0x3683('0xc3')));};Dialer[_0x3683('0x19')][_0x3683('0xc4')]=function(_0x2bef7b){return BPromise['resolve']()[_0x3683('0xbe')](cmHopperHistory[_0x3683('0xc5')](_0x2bef7b))[_0x3683('0xb6')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype'][_0x3683('0xc6')]=function(_0x16dcf0){return BPromise[_0x3683('0xbd')]()[_0x3683('0xbe')](cmHopper[_0x3683('0xc6')](_0x16dcf0))[_0x3683('0xb6')](loggerCatch(_0x3683('0xc7')));};Dialer['prototype'][_0x3683('0xc8')]=function(_0x1a9ae8,_0x2120fc,_0x1f073f){return BPromise[_0x3683('0xbd')]()[_0x3683('0xbe')](cmHopper[_0x3683('0xc8')](_0x1a9ae8,_0x2120fc,_0x1f073f))[_0x3683('0xb6')](loggerCatch(_0x3683('0xc9')));};Dialer[_0x3683('0x19')]['getContactDialer']=function(_0x4de097,_0x59e457,_0x256336,_0x318a39){return BPromise[_0x3683('0xbd')]()[_0x3683('0xbe')](cmHopper[_0x3683('0xca')](_0x4de097,_0x59e457,_0x256336,_0x318a39))[_0x3683('0xb6')](loggerCatch(_0x3683('0xcb')));};Dialer[_0x3683('0x19')][_0x3683('0xcc')]=function(_0xcad7ac,_0x3f2c38,_0x3e8a4b){return BPromise['resolve']()[_0x3683('0xbe')](cmHopper['getContactDialerIvr'](_0xcad7ac,_0x3f2c38,_0x3e8a4b))['catch'](loggerCatch(_0x3683('0xcb')));};Dialer['prototype'][_0x3683('0xcd')]=function(_0x29b2bc){return BPromise[_0x3683('0xbd')]()[_0x3683('0xbe')](voiceQueueRt[_0x3683('0xcd')](_0x29b2bc))['catch'](loggerCatch(_0x3683('0xce')));};Dialer[_0x3683('0x19')][_0x3683('0xcf')]=function(_0x3d02bf){return BPromise[_0x3683('0xbd')]()[_0x3683('0xbe')](cmHopper[_0x3683('0xcf')](_0x3d02bf))[_0x3683('0xb6')](loggerCatch(_0x3683('0xd0')));};Dialer[_0x3683('0x19')][_0x3683('0xd1')]=function(_0x59c975){return BPromise['resolve']()[_0x3683('0xbe')](cmHopperHistory[_0x3683('0xd1')](_0x59c975))['catch'](loggerCatch(_0x3683('0xd2')));};Dialer[_0x3683('0x19')][_0x3683('0xb8')]=function(_0x29f2ad){if(!_['isUndefined'](_0x29f2ad)&&_0x29f2ad!==null){if(_0x29f2ad[_0x3683('0x9b')](_0x3683('0x9c'))){if(_0x29f2ad[_0x3683('0x9c')]>0x0){_0x29f2ad[_0x3683('0x9c')]-=0x1;}else{logger['error'](_0x3683('0xd3'));}}}else{logger[_0x3683('0x97')](_0x3683('0xd4'));}};Dialer[_0x3683('0x19')][_0x3683('0xd5')]=function(_0x40cfb5,_0xccb8b9){var _0x5c752f=this;return function(_0x34e6a1){_0x5c752f[_0x3683('0xb8')](_0xccb8b9);logger[_0x3683('0x97')](_0x40cfb5,util[_0x3683('0x98')](_0x34e6a1,{'showHidden':![],'depth':null}));};};Dialer[_0x3683('0x19')][_0x3683('0xd6')]=function(_0x3c2fe4,_0x170e44,_0x139860){var _0x3c9a95={'state':0x19,'statedesc':_0x3683('0xd7')};this[_0x3683('0xb8')](_0x170e44);this['saveInDb'](_['merge'](_0x3c9a95,_[_0x3683('0xd8')](_0x139860,[_0x3683('0xd9'),_0x3683('0xda'),'UserId',_0x3683('0xdb'),_0x3683('0xdc')])),_0x3683('0xdd'),_0x3683('0xde'));logger[_0x3683('0x97')](_0x3c2fe4);};Dialer[_0x3683('0x19')][_0x3683('0xdf')]=function(_0x10c217){return _0x10c217===_0x3683('0xe0');};Dialer['prototype']['isTrunkReachable']=function(_0x285ab9){return!_['isUndefined'](_0x285ab9)&&_0x285ab9&&!_[_0x3683('0x3b')](_0x285ab9[_0x3683('0x3d')])&&!_[_0x3683('0x3b')](_0x285ab9['active'])&&_0x285ab9[_0x3683('0xe1')]&&(this['trunks'][util[_0x3683('0x7b')](_0x3683('0xe2'),_0x285ab9[_0x3683('0x3d')])]['status']==='reachable'||this[_0x3683('0x20')][util['format']('SIP/%s',_0x285ab9['name'])][_0x3683('0xe3')]===_0x3683('0xe4'));};Dialer[_0x3683('0x19')][_0x3683('0xe5')]=function(_0x33e72f,_0x49dc9b,_0x9b478b){this['createHistory'](_0x33e72f)[_0x3683('0xb6')](loggerCatch(_0x49dc9b));this[_0x3683('0xcf')](_0x33e72f)[_0x3683('0xb6')](loggerCatch(_0x9b478b));};Dialer[_0x3683('0x19')]['syncVarSet']=function(_0x220c27){var _0x5d1795=this['uniqueId'][_0x220c27[_0x3683('0xe6')]];var _0x4f8952;if(!_[_0x3683('0xb3')](_0x220c27)&&!_[_0x3683('0xb3')](_0x220c27[_0x3683('0xe7')])&&!_[_0x3683('0xb3')](_0x220c27['variable']['amdstatus'])&&_0x220c27[_0x3683('0xe8')]==='xcally-motion-dialer'&&_0x5d1795){if(_0x5d1795[_0x3683('0x56')]!=='ivr'&&this[_0x3683('0x1d')][_0x5d1795[_0x3683('0xb9')]]['dialAMDActive']&&_0x220c27[_0x3683('0xe9')]===_0x3683('0xea')){delete this['uniqueId'][_0x220c27[_0x3683('0xe6')]];this[_0x3683('0xb8')](this[_0x3683('0x1d')][_0x5d1795[_0x3683('0xb9')]]);this[_0x3683('0x1d')][_0x5d1795[_0x3683('0xb9')]][_0x3683('0x5e')]+=0x1;this[_0x3683('0x1d')][_0x5d1795['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x4f8952=new Hangup(_0x5d1795,_0x220c27);_0x4f8952['state']=0x12;_0x4f8952[_0x3683('0xad')]='HangupInAMD';_0x4f8952[_0x3683('0xeb')]=_0x3683('0xec');this['saveInDb'](_0x4f8952,_0x3683('0xed'),_0x3683('0xee'));}if(_0x5d1795[_0x3683('0x56')]!==_0x3683('0x7e')&&this['voiceQueues'][_0x5d1795['queue']][_0x3683('0xef')]&&_0x220c27[_0x3683('0xe9')]==='MACHINE'){var _0x37bd11=this;return new BPromise(function(_0x3cea03,_0x52b14d){delete _0x37bd11[_0x3683('0x25')][_0x220c27[_0x3683('0xe6')]];_0x37bd11[_0x3683('0xb8')](_0x37bd11['voiceQueues'][_0x5d1795[_0x3683('0xb9')]]);_0x37bd11['voiceQueues'][_0x5d1795[_0x3683('0xb9')]][_0x3683('0x5e')]+=0x1;_0x37bd11['voiceQueues'][_0x5d1795['queue']][_0x3683('0x5d')]+=0x1;var _0x3cb7ab=_0x37bd11['voiceQueues'][_0x5d1795[_0x3683('0xb9')]];var _0x4ad20d=new Hangup(_0x5d1795,_0x220c27);_0x4ad20d['state']=0x13;_0x4ad20d[_0x3683('0xad')]='Machine';_0x4ad20d[_0x3683('0xeb')]=_0x3683('0xec');_0x4ad20d[_0x3683('0xf0')]+=0x1;_0x4ad20d[_0x3683('0xf1')]+=0x1;_0x4ad20d['amd']=!![];_0x37bd11[_0x3683('0xd1')](_0x4ad20d)[_0x3683('0xb6')](loggerCatch(_0x3683('0xf2')));if(_0x4ad20d[_0x3683('0xf3')]+_0x4ad20d[_0x3683('0xf4')]+_0x4ad20d[_0x3683('0xf5')]+_0x4ad20d[_0x3683('0xf6')]+_0x4ad20d[_0x3683('0xf7')]+_0x4ad20d[_0x3683('0xf8')]+_0x4ad20d[_0x3683('0xf0')]+_0x4ad20d[_0x3683('0xf9')]>=_0x3cb7ab[_0x3683('0xfa')]){_0x37bd11[_0x3683('0xfb')](_0x4ad20d,_0x3cea03,_0x52b14d,_0x3683('0xfc'));}else{if(_0x4ad20d[_0x3683('0xf0')]>=_0x3cb7ab[_0x3683('0xfd')]){_0x37bd11['createStateFinal'](_0x4ad20d,_0x3cea03,_0x52b14d,_0x3683('0xfe'));}else{_0x37bd11[_0x3683('0xc6')]({'active':![],'countmachineretry':_0x4ad20d[_0x3683('0xf0')],'scheduledat':moment()[_0x3683('0xff')](_0x3cb7ab['dialMachineRetryFrequency'],_0x3683('0x100'))[_0x3683('0x7b')](_0x3683('0x101')),'ContactId':_0x4ad20d['ContactId'],'ListId':_0x4ad20d[_0x3683('0xda')],'VoiceQueueId':_0x4ad20d[_0x3683('0xdb')]||undefined,'CampaignId':_0x4ad20d[_0x3683('0xdc')]||undefined})[_0x3683('0xb6')](loggerCatch('[rescheduleContact][Machine]'));_0x3cea03({'reschedule':0x1});}}});}if(_0x5d1795['type']===_0x3683('0x7e')&&this['campaigns'][_0x5d1795['queue']]['dialAMDActive']&&_0x220c27[_0x3683('0xe9')]===_0x3683('0xea')){delete this[_0x3683('0x25')][_0x220c27[_0x3683('0xe6')]];this['updateOriginated'](this['campaigns'][_0x5d1795['queue']]);_0x4f8952=new Hangup(_0x5d1795,_0x220c27);_0x4f8952[_0x3683('0xac')]=0x12;_0x4f8952[_0x3683('0xad')]=_0x3683('0x102');_0x4f8952['membername']=_0x3683('0xec');this[_0x3683('0xe5')](_0x4f8952,_0x3683('0x103'),_0x3683('0x104'));}if(_0x5d1795[_0x3683('0x56')]===_0x3683('0x7e')&&this[_0x3683('0x1e')][_0x5d1795[_0x3683('0xb9')]][_0x3683('0xef')]&&_0x220c27[_0x3683('0xe9')]===_0x3683('0x105')){var _0x37bd11=this;return new BPromise(function(_0x41da11,_0x3f97c7){delete _0x37bd11['uniqueId'][_0x220c27[_0x3683('0xe6')]];_0x37bd11[_0x3683('0xb8')](_0x37bd11[_0x3683('0x1e')][_0x5d1795['queue']]);_0x37bd11['campaigns'][_0x5d1795['queue']][_0x3683('0x5e')]+=0x1;_0x37bd11[_0x3683('0x1e')][_0x5d1795['queue']][_0x3683('0x5d')]+=0x1;var _0x529524=_0x37bd11[_0x3683('0x1e')][_0x5d1795[_0x3683('0xb9')]];var _0x173168=new Hangup(_0x5d1795,_0x220c27);_0x173168[_0x3683('0xac')]=0x13;_0x173168[_0x3683('0xad')]=_0x3683('0x106');_0x173168[_0x3683('0xeb')]=_0x3683('0xec');_0x173168[_0x3683('0xf0')]+=0x1;_0x173168[_0x3683('0xf1')]+=0x1;_0x173168[_0x3683('0x107')]=!![];_0x37bd11[_0x3683('0xd1')](_0x173168)['catch'](loggerCatch(_0x3683('0xf2')));if(_0x173168[_0x3683('0xf3')]+_0x173168[_0x3683('0xf4')]+_0x173168['countnoanswerretry']+_0x173168[_0x3683('0xf6')]+_0x173168['countdropretry']+_0x173168[_0x3683('0xf8')]+_0x173168[_0x3683('0xf0')]+_0x173168[_0x3683('0xf9')]>=_0x529524[_0x3683('0xfa')]){_0x37bd11[_0x3683('0xfb')](_0x173168,_0x41da11,_0x3f97c7,_0x3683('0xfc'));}else{if(_0x173168[_0x3683('0xf0')]>=_0x529524[_0x3683('0xfd')]){_0x37bd11[_0x3683('0x108')](_0x173168,_0x41da11,_0x3f97c7,'reason\x2019\x20machine....');}else{_0x37bd11['rescheduleContact']({'active':![],'countmachineretry':_0x173168[_0x3683('0xf0')],'scheduledat':moment()[_0x3683('0xff')](_0x529524[_0x3683('0x109')],'minutes')[_0x3683('0x7b')](_0x3683('0x101')),'ContactId':_0x173168['ContactId'],'ListId':_0x173168[_0x3683('0xda')],'VoiceQueueId':_0x173168[_0x3683('0xdb')]||undefined,'CampaignId':_0x173168[_0x3683('0xdc')]||undefined})['catch'](loggerCatch(_0x3683('0x10a')));_0x41da11({'reschedule':0x1});}}});}}};Dialer[_0x3683('0x19')][_0x3683('0x10b')]=function(_0x3be21b){var _0x5abf00=this['uniqueId'][_0x3be21b[_0x3683('0xe6')]];var _0x350f3f=this;var _0x41026d;if(_0x5abf00&&_0x5abf00['type']===_0x3683('0x7e')){delete this[_0x3683('0x25')][_0x3be21b[_0x3683('0xe6')]];this[_0x3683('0xb8')](this[_0x3683('0x1e')][_0x5abf00['queue']]);this[_0x3683('0x1e')][_0x5abf00[_0x3683('0xb9')]]['ivrAnswerCallsDay']+=0x1;_0x41026d=new Hangup(_0x5abf00,_0x3be21b);this[_0x3683('0xd1')](_0x41026d)[_0x3683('0xb6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x3683('0xcf')](_0x41026d)['catch'](loggerCatch(_0x3683('0x10c')));}if(_0x5abf00&&_0x5abf00[_0x3683('0x56')]!=='ivr'&&isNotNull(this[_0x3683('0x1d')][_0x5abf00[_0x3683('0xb9')]][_0x3683('0x10d')])){delete this[_0x3683('0x25')][_0x3be21b[_0x3683('0xe6')]];this[_0x3683('0xb8')](this['voiceQueues'][_0x5abf00[_0x3683('0xb9')]]);this[_0x3683('0x1d')][_0x5abf00[_0x3683('0xb9')]][_0x3683('0x5e')]+=0x1;this[_0x3683('0x1d')][_0x5abf00[_0x3683('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;_0x41026d=new Hangup(_0x5abf00,_0x3be21b);_0x41026d[_0x3683('0xac')]=0x10;_0x41026d[_0x3683('0xad')]=_0x3683('0x10e');_0x41026d[_0x3683('0xeb')]=_0x3683('0x10f');this[_0x3683('0xd1')](_0x41026d)[_0x3683('0xb6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x3683('0xcf')](_0x41026d)['catch'](loggerCatch(_0x3683('0x10c')));}if(_0x5abf00&&_0x5abf00[_0x3683('0x56')]!==_0x3683('0x7e')&&!isNotNull(this['voiceQueues'][_0x5abf00['queue']]['dialQueueProject'])){delete this[_0x3683('0x25')][_0x3be21b[_0x3683('0xe6')]];this['updateOriginated'](this[_0x3683('0x1d')][_0x5abf00[_0x3683('0xb9')]]);this[_0x3683('0x1d')][_0x5abf00[_0x3683('0xb9')]][_0x3683('0x69')]+=0x1;_0x41026d=new Hangup(_0x5abf00,_0x3be21b);_0x41026d[_0x3683('0xac')]=0xc;_0x41026d[_0x3683('0xad')]=_0x3be21b[_0x3683('0x110')];_0x41026d['membername']=_0x3683('0x111');this[_0x3683('0xd1')](_0x41026d)[_0x3683('0xb6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x3683('0xcf')](_0x41026d)['catch'](loggerCatch(_0x3683('0x10c')));}};Dialer['prototype'][_0x3683('0x112')]=function(_0x160aaa){var _0x107919=this['uniqueId'][_0x160aaa[_0x3683('0xe6')]];var _0x395b85=this;if(this[_0x3683('0x1d')][_0x160aaa[_0x3683('0xb9')]]){if(_0x107919&&_0x107919['type']!=='ivr'){delete this[_0x3683('0x25')][_0x160aaa[_0x3683('0xe6')]];this[_0x3683('0x1d')][_0x160aaa[_0x3683('0xb9')]][_0x3683('0x5e')]+=0x1;var _0x1cff9b=new AgentComplete(_0x107919,_0x160aaa);if(_0x160aaa[_0x3683('0x113')]===_0x3683('0x114')){_0x1cff9b[_0x3683('0x115')]=this['voiceQueues'][_0x160aaa[_0x3683('0xb9')]]['dialQueueProject2']&&this[_0x3683('0x1d')][_0x160aaa['queue']][_0x3683('0x116')]?moment()[_0x3683('0x7b')](_0x3683('0x101')):undefined;}this[_0x3683('0xd1')](_0x1cff9b)[_0x3683('0xb6')](loggerCatch(_0x3683('0x117')));this['moveContactManagedDialer'](_0x1cff9b)[_0x3683('0xb6')](loggerCatch(_0x3683('0x118')));}}};Dialer[_0x3683('0x19')]['syncAgentConnect']=function(_0x2fceb0){if(this[_0x3683('0x1d')][_0x2fceb0[_0x3683('0xb9')]]){if(this[_0x3683('0x25')][_0x2fceb0['uniqueid']]&&this['uniqueId'][_0x2fceb0[_0x3683('0xe6')]][_0x3683('0x56')]!==_0x3683('0x7e')){this[_0x3683('0xb8')](this[_0x3683('0x1d')][_0x2fceb0[_0x3683('0xb9')]]);this[_0x3683('0x25')][_0x2fceb0[_0x3683('0xe6')]][_0x3683('0x119')]=moment()[_0x3683('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x3683('0x19')][_0x3683('0x11a')]=function(_0x458c38){this['createHistory'](_0x458c38)[_0x3683('0xb6')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x458c38)[_0x3683('0xb6')](loggerCatch(_0x3683('0x11b')));};Dialer[_0x3683('0x19')]['syncQueueCallerAbandon']=function(_0x39d9a3){var _0x17ae6c=this[_0x3683('0x25')][_0x39d9a3['uniqueid']];var _0x5b1ea4=this;if(this[_0x3683('0x1d')][_0x39d9a3[_0x3683('0xb9')]]){if(_0x17ae6c&&_0x17ae6c[_0x3683('0x56')]!==_0x3683('0x7e')){delete this[_0x3683('0x25')][_0x39d9a3[_0x3683('0xe6')]];this[_0x3683('0xb8')](this[_0x3683('0x1d')][_0x39d9a3[_0x3683('0xb9')]]);_0x17ae6c['droptime']=moment()[_0x3683('0x7b')](_0x3683('0x101'));var _0x45f9f2=new QueueCallerAbandon(_0x17ae6c,_0x39d9a3);if(getSeconds(_0x17ae6c['droptime'],_0x17ae6c[_0x3683('0x11c')])>=_0x17ae6c[_0x3683('0x11d')]){this[_0x3683('0x1d')][_0x39d9a3[_0x3683('0xb9')]][_0x3683('0x6d')]+=0x1;this[_0x3683('0x1d')][_0x39d9a3[_0x3683('0xb9')]][_0x3683('0x11e')]+=0x1;this[_0x3683('0x1d')][_0x39d9a3[_0x3683('0xb9')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x45f9f2[_0x3683('0xac')]=0xa;_0x45f9f2[_0x3683('0xad')]=_0x3683('0x11f');_0x45f9f2[_0x3683('0x120')]=_0x3683('0x121');_0x45f9f2[_0x3683('0x115')]=this[_0x3683('0x1d')][_0x39d9a3[_0x3683('0xb9')]][_0x3683('0x122')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x45f9f2[_0x3683('0xf7')]+=0x1;_0x45f9f2[_0x3683('0xf1')]+=0x1;if(_0x45f9f2[_0x3683('0xf7')]>=this[_0x3683('0x1d')][_0x39d9a3[_0x3683('0xb9')]][_0x3683('0x123')]){this['queueCallerAbandonCreateState'](_0x45f9f2);}else{this[_0x3683('0xc6')]({'active':![],'countdropretry':_0x45f9f2[_0x3683('0xf7')],'scheduledat':moment()['add'](this[_0x3683('0x1d')][_0x39d9a3['queue']][_0x3683('0x124')],_0x3683('0x100'))[_0x3683('0x7b')](_0x3683('0x101')),'ContactId':_0x17ae6c['ContactId'],'ListId':_0x17ae6c[_0x3683('0xda')],'VoiceQueueId':_0x17ae6c['VoiceQueueId']||undefined,'CampaignId':_0x17ae6c['CampaignId']||undefined})[_0x3683('0xb6')](loggerCatch(_0x3683('0x125')));var _0x241805=new History(_0x45f9f2);_0x241805[_0x3683('0xac')]=0xa;_0x241805[_0x3683('0xad')]='Drop';_0x241805[_0x3683('0xae')]=moment()[_0x3683('0x7b')](_0x3683('0x101'));_0x241805[_0x3683('0x126')]=_0x241805[_0x3683('0xae')];_0x241805['calleridname']=_0x45f9f2['calleridname'];_0x241805[_0x3683('0x127')]=_0x45f9f2[_0x3683('0x127')];this[_0x3683('0xd1')](_0x241805)['catch'](loggerCatch(_0x3683('0x128')));}}else{this['voiceQueues'][_0x39d9a3['queue']][_0x3683('0x85')]+=0x1;this[_0x3683('0x1d')][_0x39d9a3['queue']][_0x3683('0x63')]+=0x1;_0x45f9f2[_0x3683('0xac')]=0xb;_0x45f9f2[_0x3683('0xad')]=_0x3683('0x129');_0x45f9f2['dropreason']='CALLEREXIT';_0x45f9f2[_0x3683('0xf8')]+=0x1;_0x45f9f2[_0x3683('0xf1')]+=0x1;if(_0x45f9f2['countabandonedretry']>=this[_0x3683('0x1d')][_0x39d9a3[_0x3683('0xb9')]][_0x3683('0x12a')]){this['queueCallerAbandonCreateState'](_0x45f9f2);}else{this[_0x3683('0xc6')]({'active':![],'countabandonedretry':_0x45f9f2[_0x3683('0xf8')],'scheduledat':moment()[_0x3683('0xff')](this['voiceQueues'][_0x39d9a3[_0x3683('0xb9')]][_0x3683('0x12b')],'minutes')[_0x3683('0x7b')](_0x3683('0x101')),'ContactId':_0x17ae6c[_0x3683('0xd9')],'ListId':_0x17ae6c[_0x3683('0xda')],'VoiceQueueId':_0x17ae6c[_0x3683('0xdb')]||undefined,'CampaignId':_0x17ae6c[_0x3683('0xdc')]||undefined})[_0x3683('0xb6')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x241805=new History(_0x45f9f2);_0x241805[_0x3683('0xac')]=0xb;_0x241805[_0x3683('0xad')]=_0x3683('0x129');_0x241805[_0x3683('0xae')]=moment()[_0x3683('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');_0x241805['endtime']=_0x241805[_0x3683('0xae')];_0x241805[_0x3683('0x12c')]=_0x45f9f2[_0x3683('0x12c')];_0x241805['calleridnum']=_0x45f9f2['calleridnum'];this[_0x3683('0xd1')](_0x241805)[_0x3683('0xb6')](loggerCatch(_0x3683('0x12d')));}}}}};Dialer['prototype'][_0x3683('0x32')]=function(_0x4ae67e){if(this['actions'][_0x4ae67e[_0x3683('0xe6')]]){this[_0x3683('0x23')][_0x4ae67e['uniqueid']][_0x3683('0xb5')]=_0x4ae67e['channel'];}if(this[_0x3683('0x25')][_0x4ae67e[_0x3683('0xe6')]]){this[_0x3683('0x25')][_0x4ae67e['uniqueid']]['channel']=_0x4ae67e[_0x3683('0xb5')];}};Dialer['prototype'][_0x3683('0x36')]=function(_0x18239c){if(strategy[this[_0x3683('0x1d')][this[_0x3683('0x23')][_0x18239c['actionid']][_0x3683('0xb9')]][_0x3683('0x4f')]]===_0x3683('0x18')){if(this['actions'][_0x18239c[_0x3683('0x12e')]]&&_['isNil'](this[_0x3683('0x23')][_0x18239c[_0x3683('0x12e')]][_0x3683('0x12f')])&&_0x18239c[_0x3683('0xe3')]==='1'&&_0x18239c[_0x3683('0x130')]==='0'){if(this[_0x3683('0x1f')][_0x18239c[_0x3683('0x131')]]){if(!this[_0x3683('0x1f')][_0x18239c[_0x3683('0x131')]][_0x3683('0x12f')]){this['agents'][_0x18239c['stateinterface']][_0x3683('0x12f')]=!![];this[_0x3683('0x23')][_0x18239c[_0x3683('0x12e')]][_0x3683('0x12f')]=!![];this[_0x3683('0x23')][_0x18239c['actionid']][_0x3683('0x131')]=_0x18239c[_0x3683('0x131')];}}}}else if((strategy[this['voiceQueues'][this[_0x3683('0x23')][_0x18239c[_0x3683('0x12e')]]['queue']][_0x3683('0x4f')]]||_0x3683('0x17'))===_0x3683('0x17')){if(this[_0x3683('0x23')][_0x18239c[_0x3683('0x12e')]]){if(this[_0x3683('0x1f')][_0x18239c[_0x3683('0x131')]]){this[_0x3683('0x23')][_0x18239c[_0x3683('0x12e')]][_0x3683('0x131')]=_0x18239c[_0x3683('0x131')];if(_[_0x3683('0xb3')](this[_0x3683('0x28')][this['actions'][_0x18239c[_0x3683('0x12e')]][_0x3683('0xb9')]])){this[_0x3683('0x28')][this[_0x3683('0x23')][_0x18239c['actionid']]['queue']]=[];}this[_0x3683('0x28')][this[_0x3683('0x23')][_0x18239c['actionid']]['queue']][_0x3683('0x132')](_[_0x3683('0x8f')](_[_0x3683('0xd8')](this['actions'][_0x18239c[_0x3683('0x12e')]],[_0x3683('0x133'),_0x3683('0x131')]),{'status':_0x18239c[_0x3683('0xe3')],'paused':_0x18239c[_0x3683('0x130')]}));}}}};function unlockQueueStatus(_0x1a800d,_0x4b264e){setTimeout(function(){if(_['isUndefined'](_0x1a800d['queueStatusComplete'])){loggerBooked[_0x3683('0x97')](_0x3683('0x134'),_0x4b264e);}_0x1a800d['queueStatusComplete']=!![];loggerBooked[_0x3683('0x81')](_0x3683('0x135'),_0x4b264e,JSON[_0x3683('0x49')](_[_0x3683('0xd8')](_0x1a800d,[_0x3683('0x3d'),_0x3683('0x136')])));},0x1f3);}Dialer[_0x3683('0x19')][_0x3683('0x38')]=function(_0x109311){var _0xd32622=this;var _0x3cb56f=_0xd32622[_0x3683('0x1d')][_0xd32622[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]];if(strategy[this[_0x3683('0x1d')][this['actions'][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]][_0x3683('0x4f')]]===_0x3683('0x18')){if(this[_0x3683('0x23')][_0x109311['actionid']]&&this[_0x3683('0x23')][_0x109311['actionid']][_0x3683('0x131')]){this[_0x3683('0x137')][_0x3683('0x138')](this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0x133')],this['actions'][_0x109311[_0x3683('0x12e')]]['stateinterface'])[_0x3683('0xb6')](function(_0x259d4f){logger[_0x3683('0x97')](_0x3683('0x139'),util[_0x3683('0x98')](_0x259d4f,{'showHidden':![],'depth':null}));})[_0x3683('0x1b')](function(){_0xd32622[_0x3683('0xb8')](_0xd32622[_0x3683('0x1d')][_0xd32622[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]]);_0xd32622[_0x3683('0x1f')][_0xd32622['actions'][_0x109311['actionid']][_0x3683('0x131')]][_0x3683('0x12f')]=![];delete _0xd32622[_0x3683('0x23')][_0x109311['actionid']];unlockQueueStatus(_0x3cb56f);});}else{this['updateOriginated'](this[_0x3683('0x1d')][this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]]['queue']]);this[_0x3683('0xc6')]({'active':![],'ContactId':this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xd9')],'ListId':this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xda')],'VoiceQueueId':this[_0x3683('0x23')][_0x109311['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xdc')]||undefined})[_0x3683('0xb6')](loggerCatch(_0x3683('0x13a')));delete this['actions'][_0x109311[_0x3683('0x12e')]];unlockQueueStatus(_0x3cb56f);}}else if((strategy[this['voiceQueues'][this[_0x3683('0x23')][_0x109311['actionid']][_0x3683('0xb9')]][_0x3683('0x4f')]]||'rrmemory')===_0x3683('0x17')){var _0x1806fe;if(this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]]&&!_['isEmpty'](this[_0x3683('0x28')][this['actions'][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]])){if(this['queueBookedRR'][_0xd32622[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]]){this[_0x3683('0x29')][_0xd32622[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]]=this[_0x3683('0x29')][this[_0x3683('0x23')][_0x109311['actionid']]['queue']]?this[_0x3683('0x29')][this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]]:this['queueBooked'][this[_0x3683('0x23')][_0x109311['actionid']]['queue']]?this['queueBooked'][this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]][_0x3683('0x13b')]||0x0:0x0;}this['queueBooked'][this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]]['_rr']=this['queueBookedRR'][this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]];for(var _0x5ef050=0x0;_0x5ef050<this[_0x3683('0x28')][this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]]['length'];_0x5ef050+=0x1){_0x1806fe=rr(this['queueBooked'][this[_0x3683('0x23')][_0x109311['actionid']][_0x3683('0xb9')]]);this['queueBookedRR'][_0xd32622[_0x3683('0x23')][_0x109311['actionid']][_0x3683('0xb9')]]=this[_0x3683('0x28')][this[_0x3683('0x23')][_0x109311['actionid']][_0x3683('0xb9')]][_0x3683('0x13b')];if(_0x1806fe['status']==='1'&&_0x1806fe['paused']==='0'){break;}}if(!_[_0x3683('0xb3')](_0x1806fe)){this[_0x3683('0x1f')][_0x1806fe[_0x3683('0x131')]][_0x3683('0x13c')]=_[_0x3683('0x3b')](this[_0x3683('0x1f')][_0x1806fe[_0x3683('0x131')]][_0x3683('0x13c')])?!![]:this[_0x3683('0x1f')][_0x1806fe[_0x3683('0x131')]][_0x3683('0x13c')];}loggerBooked['info']('[booked][RR]',_0x109311['actionid'],_0x3683('0x13d'),JSON[_0x3683('0x49')](_[_0x3683('0xd8')](this[_0x3683('0x1f')][_0x1806fe[_0x3683('0x131')]],[_0x3683('0x3d'),_0x3683('0x13c')])),_0x3683('0x13e'),JSON[_0x3683('0x49')](_0x1806fe[_0x3683('0x133')]));if(!_[_0x3683('0xb3')](_0x1806fe)&&_0x1806fe[_0x3683('0xe3')]==='1'&&_0x1806fe[_0x3683('0x130')]==='0'&&this[_0x3683('0x1f')][_0x1806fe[_0x3683('0x131')]][_0x3683('0x13c')]){this[_0x3683('0x1f')][_0x1806fe['stateinterface']][_0x3683('0x13c')]=![];this[_0x3683('0x28')][_0xd32622['actions'][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]]=[];this[_0x3683('0x137')][_0x3683('0x138')](_0x1806fe[_0x3683('0x133')],_0x1806fe['stateinterface'])[_0x3683('0xb6')](function(_0x541283){logger[_0x3683('0x97')](_0x3683('0x139'),util['inspect'](_0x541283,{'showHidden':![],'depth':null}));})[_0x3683('0x1b')](function(){_0xd32622[_0x3683('0xb8')](_0xd32622[_0x3683('0x1d')][_0xd32622[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]]);setTimeout(function(){_0xd32622['agents'][_0x1806fe[_0x3683('0x131')]]['unlockRR']=!![];loggerBooked['info'](_0x3683('0x13f'),_0x109311[_0x3683('0x12e')],'Agent:\x20',JSON[_0x3683('0x49')](_['pick'](_0xd32622[_0x3683('0x1f')][_0x1806fe[_0x3683('0x131')]],[_0x3683('0x3d'),_0x3683('0x13c')])),'contactAgent-idHopper:\x20',JSON[_0x3683('0x49')](_0x1806fe[_0x3683('0x133')]));},0xc7);delete _0xd32622[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]];unlockQueueStatus(_0x3cb56f,_0x109311[_0x3683('0x12e')]);});}else{loggerBooked[_0x3683('0x81')](_0x3683('0x140'));this[_0x3683('0xb8')](this[_0x3683('0x1d')][this[_0x3683('0x23')][_0x109311['actionid']]['queue']]);this[_0x3683('0xc6')]({'active':![],'ContactId':this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xd9')],'ListId':this['actions'][_0x109311[_0x3683('0x12e')]][_0x3683('0xda')],'VoiceQueueId':this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xdb')]||undefined,'CampaignId':this['actions'][_0x109311['actionid']][_0x3683('0xdc')]||undefined})[_0x3683('0xb6')](loggerCatch(_0x3683('0x13a')));delete this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]];unlockQueueStatus(_0x3cb56f);}}else{loggerBooked[_0x3683('0x81')](_0x3683('0x141'));this['updateOriginated'](this[_0x3683('0x1d')][this['actions'][_0x109311[_0x3683('0x12e')]][_0x3683('0xb9')]]);this[_0x3683('0xc6')]({'active':![],'ContactId':this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xd9')],'ListId':this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xda')],'VoiceQueueId':this[_0x3683('0x23')][_0x109311['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xdc')]||undefined})[_0x3683('0xb6')](loggerCatch(_0x3683('0x142')));delete this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]];unlockQueueStatus(_0x3cb56f);}}else{loggerBooked[_0x3683('0x81')](_0x3683('0x143'));this[_0x3683('0xb8')](this[_0x3683('0x1d')][this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]]['queue']]);this[_0x3683('0xc6')]({'active':![],'ContactId':this['actions'][_0x109311[_0x3683('0x12e')]][_0x3683('0xd9')],'ListId':this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xda')],'VoiceQueueId':this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xdb')]||undefined,'CampaignId':this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]][_0x3683('0xdc')]||undefined})[_0x3683('0xb6')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x3683('0x23')][_0x109311[_0x3683('0x12e')]];unlockQueueStatus(_0x3cb56f);}};Dialer[_0x3683('0x19')][_0x3683('0x39')]=function(){var _0x4e986a=this;setInterval(function(){_0x4e986a[_0x3683('0x144')]();},0x3e8);};Dialer[_0x3683('0x19')]['checkIsTrunkReachable']=function(_0x146d4d){var _0x6a8a58=this;return function(){if(!_0x6a8a58['isTrunkReachable'](_0x146d4d['Trunk'])){if(!_0x6a8a58[_0x3683('0x145')](_0x146d4d['TrunkBackup'])){_0x146d4d[_0x3683('0x3f')]=_0x3683('0x146');throw _0x146d4d['name']+_0x3683('0x147');}}};};Dialer['prototype']['checkIfTime']=function(_0x125f9b,_0x31dc30,_0x3955e3,_0x7f8c4d){var _0x3ceb58=this;return function(){var _0x53e23c=!![];return _0x3ceb58[_0x3683('0x148')](_0x125f9b,_0x31dc30,_0x3955e3,_0x7f8c4d,_0x53e23c);};};Dialer['prototype'][_0x3683('0x149')]=function(_0x2617d9,_0x543d8e,_0x1e08eb,_0x19fdc5){var _0x483355=this;return function(){var _0xb4fa3d=![];return _0x483355[_0x3683('0x148')](_0x2617d9['Intervals'],_0x543d8e,_0x1e08eb,_0x19fdc5,_0xb4fa3d);};};Dialer['prototype'][_0x3683('0x148')]=function(_0x5201a6,_0x45d093,_0x577daf,_0x9fa6bf,_0x21cec6){var _0x135e50=[];return new BPromise(function(_0x553f43,_0x22255d){if(!isNotNull(_0x5201a6)){_0x9fa6bf['message']=_0x3683('0x43');return _0x22255d(msgResponse('ifTime',_0x3683('0x14a'),_0x577daf+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x3683('0x46')](_0x5201a6)){_0x9fa6bf[_0x3683('0x3f')]='INTERVAL_IS_EMPTY';return _0x22255d(msgResponse(_0x3683('0x148'),_0x3683('0x14a'),_0x577daf+_0x3683('0x14b')));}if(_0x45d093&&_['isUndefined'](config[_0x3683('0x14c')][_0x45d093])){_0x9fa6bf[_0x3683('0x3f')]=_0x3683('0x14d');return _0x22255d(msgResponse(_0x3683('0x148'),_0x3683('0x14a'),_0x577daf+_0x3683('0x14e')+_0x45d093));}if(_[_0x3683('0x14f')](_0x5201a6)){for(var _0x2e44ac=0x0;_0x2e44ac<_0x5201a6[_0x3683('0x9a')];_0x2e44ac+=0x1){_0x135e50['push'](ami[_0x3683('0xb4')]({'action':'command','command':util[_0x3683('0x7b')](_0x3683('0x150'),_0x5201a6[_0x2e44ac][_0x3683('0x151')],!_[_0x3683('0x3b')](config[_0x3683('0x14c')][_0x45d093])?_0x45d093:'')})[_0x3683('0xbe')](function(_0x509402){return _0x509402[_0x3683('0x152')][_0x3683('0x153')](_0x3683('0x154'))>=0x0?!![]:![];})['catch'](myreject(_0x22255d)));}}else{_0x135e50[_0x3683('0x132')](ami[_0x3683('0xb4')]({'action':_0x3683('0x155'),'command':util[_0x3683('0x7b')](_0x3683('0x150'),_0x5201a6,!_[_0x3683('0x3b')](config[_0x3683('0x14c')][_0x45d093])?_0x45d093:'')})['then'](function(_0x311b33){return _0x311b33[_0x3683('0x152')][_0x3683('0x153')](_0x3683('0x154'))>=0x0?!![]:![];})[_0x3683('0xb6')](myreject(_0x22255d)));}BPromise[_0x3683('0x156')](_0x135e50)[_0x3683('0xbe')](function(_0x5829ac){var _0x75fab7=_['some'](_0x5829ac);if(_0x75fab7){return _0x553f43(_0x75fab7);}else{_0x9fa6bf[_0x3683('0x3f')]=_0x21cec6?_0x3683('0x157'):'INTERVAL_IS_OVERTIME';return _0x22255d(msgResponse('[ifTime][promiseAll]',_0x3683('0x14a'),_0x3683('0x158')+_0x21cec6+'\x20'+_0x577daf+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x5201a6,{'showHidden':![],'depth':null})+_0x3683('0x159')+_0x45d093));}})[_0x3683('0xb6')](function(_0x342f89){return _0x22255d(msgResponse(_0x3683('0x148'),_0x3683('0x14a'),JSON[_0x3683('0x49')](_0x342f89)));});});};Dialer[_0x3683('0x19')]['checkDialMethod']=function(_0x3c3060){var _0x30fd06=this;return function(){switch(_0x3c3060[_0x3683('0x5a')]){case'progressive':freeVariablesPredictive(_0x3c3060);_0x30fd06[_0x3683('0x15a')](_0x3c3060,0x1);break;case _0x3683('0x15b'):freeVariablesPredictive(_0x3c3060);_0x30fd06[_0x3683('0x15a')](_0x3c3060,_0x3c3060[_0x3683('0x15c')]);break;case _0x3683('0x6'):_0x30fd06[_0x3683('0x6')](_0x3c3060);break;case _0x3683('0x5'):freeVariablesPredictive(_0x3c3060);_0x30fd06[_0x3683('0x15a')](_0x3c3060,0x1);break;default:freeVariablesPredictive(_0x3c3060);logger[_0x3683('0x97')](_0x3683('0x15d'),_0x3c3060[_0x3683('0x3d')],_0x3683('0x15e'));}};};Dialer[_0x3683('0x19')]['launchHandleIvr']=function(_0xc2cdc1){var _0x4be294=this;return function(){_0x4be294['handleIvr'](_0xc2cdc1);};};Dialer['prototype']['syncQueueSummary']=function(_0x359268){var _0x579a30=this;if(isNotPreview(_0x359268[_0x3683('0x5a')])){if(isVoiceQueueOutbound(_0x359268[_0x3683('0x56')])&&isActive(_0x359268[_0x3683('0x59')])){_0x359268[_0x3683('0xa6')]=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x359268,_0x359268[_0x3683('0x52')]))[_0x3683('0xbe')](checkIsActive(_0x359268,_0x359268[_0x3683('0x59')]))[_0x3683('0xbe')](checkInterval(_0x359268))[_0x3683('0xbe')](_0x579a30[_0x3683('0x15f')](_0x359268))[_0x3683('0xbe')](_0x579a30[_0x3683('0x160')](_0x359268[_0x3683('0x161')],_0x359268[_0x3683('0x162')],_0x359268[_0x3683('0x3d')],_0x359268))[_0x3683('0xbe')](_0x579a30[_0x3683('0x149')](_0x359268[_0x3683('0x42')],_0x359268[_0x3683('0x162')],_0x359268[_0x3683('0x3d')],_0x359268))[_0x3683('0xbe')](_0x579a30[_0x3683('0x163')](_0x359268))[_0x3683('0xb6')](loggerCatchQueueSummary(_0x3683('0x164'),_0x359268));}else{notSendMessagesQueue(_0x359268);}}else{freeVariablesPredictive(_0x359268);}};Dialer[_0x3683('0x19')][_0x3683('0x144')]=function(){var _0x23e137=this;var _0x38c591;for(var _0x211450 in this[_0x3683('0x1e')]){if(this['campaigns'][_0x3683('0x9b')](_0x211450)){_0x38c591=this['campaigns'][_0x211450];if(isCampaignIvr(_0x38c591[_0x3683('0x56')])&&isActive(_0x38c591[_0x3683('0xe1')])){_0x38c591['sendMessageOneNotActive']=!![];BPromise[_0x3683('0xbd')]()[_0x3683('0xbe')](checkIsActive(_0x38c591,_0x38c591[_0x3683('0xe1')]))[_0x3683('0xbe')](checkInterval(_0x38c591))[_0x3683('0xbe')](_0x23e137[_0x3683('0x15f')](_0x38c591))[_0x3683('0xbe')](_0x23e137[_0x3683('0x160')](_0x38c591[_0x3683('0x161')],_0x38c591[_0x3683('0x162')],_0x38c591['name'],_0x38c591))[_0x3683('0xbe')](_0x23e137[_0x3683('0x149')](_0x38c591[_0x3683('0x42')],_0x38c591[_0x3683('0x162')],_0x38c591[_0x3683('0x3d')],_0x38c591))[_0x3683('0xbe')](_0x23e137[_0x3683('0x165')](_0x38c591))['catch'](loggerCatchQueueSummary(_0x3683('0x166'),_0x38c591));}else{notSendMessagesCampaign(_0x38c591);}}}};function getCallerIdRandom(_0x228ea8,_0x48a860){var _0x16103d,_0x2528c9,_0x412034;if(_0x48a860<=0x0){_0x48a860=0x1;}_0x16103d=new RegExp(_0x3683('0x167')+_0x48a860+'}$');_0x2528c9=Math[_0x3683('0x168')](0xa,_0x48a860-0x1);_0x412034=Math[_0x3683('0x168')](0xa,_0x48a860)-0x1;return util[_0x3683('0x7b')]('%s',_[_0x3683('0x169')](_0x228ea8,_0x16103d,_[_0x3683('0x16a')](_0x2528c9,_0x412034)));}function extractCalleridName(_0x824dd7){var _0x4f48ad=_0x824dd7[_0x3683('0x16b')](/"(.*?)"/);return _0x4f48ad?_0x4f48ad[0x1]:_0x824dd7;}function extractCalleridNumber(_0x4d6b62){var _0x100428=_0x4d6b62[_0x3683('0x16b')](/<(.*?)>/);return _0x100428?_0x100428[0x1]:_0x4d6b62;}Dialer['prototype'][_0x3683('0x16c')]=function(_0x22543d,_0xf0e24c){var _0x47797b=this;var _0x555525=uuid['v4']();this[_0x3683('0x23')][_0x555525]=new Action(_0x22543d,_0xf0e24c,_0x555525);return new BPromise(function(_0x283d56,_0x5d05bd){if(_['isUndefined'](_0x22543d)&&_0x3683('0x16d')!==typeof _0x22543d){return _0x5d05bd(msgResponse('originate',_0x3683('0x14a'),'voiceQueue\x20is\x20undefine'));}if(_[_0x3683('0x3b')](_0xf0e24c['Contact'][_0x3683('0x16e')])||_0xf0e24c[_0x3683('0x16f')]['phone']===null){return _0x5d05bd(msgResponse(_0x3683('0x170'),'Failure',_0x3683('0x171')));}var _0x5daf91={'XMD-CALLERID':_0x47797b['actions'][_0x555525]['getCaller'](),'XMD-AGI':_0x22543d[_0x3683('0x10d')]?util['format'](_0x3683('0x172'),ipAgi,_0x22543d[_0x3683('0x10d')]):'NONE','XMD-AGIAFTER':_0x22543d['dialQueueProject2']?util[_0x3683('0x7b')](_0x3683('0x172'),ipAgi,_0x22543d['dialQueueProject2']):_0x3683('0x173'),'XMD-QUEUE':_0x22543d[_0x3683('0x56')]===_0x3683('0x4e')?util[_0x3683('0x7b')](_0x3683('0x174'),_0x22543d[_0x3683('0x3d')],_0x22543d[_0x3683('0x175')]||'',_0x22543d[_0x3683('0x116')]?'c':'',_0x22543d[_0x3683('0x11d')]||0x3):_0x3683('0x173'),'XMD-CONTACTID':_0xf0e24c[_0x3683('0xd9')],'XMD-CDRTYPE':_0x3683('0x4'),'CALLERID(all)':_0x47797b[_0x3683('0x23')][_0x555525]['getCaller'](),'XMD-AMD':_0x22543d[_0x3683('0xef')]?_0x3683('0x176'):'NONE','XMD-DESTINATION':_0x3683('0x177')};if(_0x22543d['dialAMDActive']){_0x5daf91['XMD-AMDINITIALSILENCE']=_0x22543d[_0x3683('0x178')]||0x9c4;_0x5daf91['XMD-AMDGREETING']=_0x22543d['dialAMDGreeting']||0x5dc;_0x5daf91[_0x3683('0x179')]=_0x22543d[_0x3683('0x17a')]||0x320;_0x5daf91[_0x3683('0x17b')]=_0x22543d[_0x3683('0x17c')]||0x1388;_0x5daf91[_0x3683('0x17d')]=_0x22543d[_0x3683('0x17e')]||0x64;_0x5daf91['XMD-AMDBETWEENWORDSSILENCE']=_0x22543d['dialAMDBetweenWordsSilence']||0x32;_0x5daf91[_0x3683('0x17f')]=_0x22543d[_0x3683('0x180')]||0x3;_0x5daf91[_0x3683('0x181')]=_0x22543d['dialAMDSilenceThreshold']||0x100;_0x5daf91[_0x3683('0x182')]=_0x22543d['dialAMDMaximumWordLength']||0x1388;}if(_0x22543d[_0x3683('0x56')]===_0x3683('0x4e')){_0x5daf91[_0x3683('0x183')]=_0xf0e24c[_0x3683('0xdb')];}else{_0x5daf91['XMD-CAMPAIGNID']=_0xf0e24c[_0x3683('0xdc')];}for(var _0x5869dd in _0xf0e24c['Contact']){if(_0xf0e24c[_0x3683('0x16f')][_0x3683('0x9b')](_0x5869dd)){if(isNotNull(_0xf0e24c[_0x3683('0x16f')][_0x5869dd])&&_0x5869dd!=='id'&&_0x5869dd!==_0x3683('0x184')&&_0x5869dd!=='createdAt'&&_0x5869dd!==_0x3683('0x185')){_0x5daf91[util['format']('%s%s',_0x3683('0x186'),_[_0x3683('0x187')](_0x5869dd))]=_0xf0e24c[_0x3683('0x16f')][_0x5869dd];}}}var _0x24b5ef=_0x47797b[_0x3683('0x145')](_0x22543d[_0x3683('0x7a')])?getCallerId(_0x22543d[_0x3683('0x7a')]['callerid'],_0x22543d[_0x3683('0x188')],_0x22543d[_0x3683('0x189')]>0x0?getCallerIdRandom(_0x22543d['dialOriginateCallerIdNumber'],_0x22543d['dialRandomLastDigitCallerIdNumber']):_0x22543d[_0x3683('0x5b')]):getCallerId(_[_0x3683('0xb3')](_0x22543d['TrunkBackup'])?_0x22543d[_0x3683('0x7a')][_0x3683('0x18a')]:_0x22543d['TrunkBackup'][_0x3683('0x18a')],_0x22543d[_0x3683('0x188')],_0x22543d[_0x3683('0x189')]>0x0?getCallerIdRandom(_0x22543d[_0x3683('0x5b')],_0x22543d[_0x3683('0x189')]):_0x22543d['dialOriginateCallerIdNumber']);if(_0x24b5ef){_0x5daf91[_0x3683('0x18b')]=_0x47797b[_0x3683('0x23')][_0x555525][_0x3683('0x18c')]=extractCalleridName(_0x24b5ef);_0x5daf91[_0x3683('0x18d')]=_0x47797b[_0x3683('0x23')][_0x555525]['originatecalleridnum']=extractCalleridNumber(_0x24b5ef);}return ami[_0x3683('0xb4')]({'actionid':_0x555525,'action':'originate','channel':_0x47797b['isTrunkReachable'](_0x22543d[_0x3683('0x7a')])?util[_0x3683('0x7b')](_0x3683('0x18e'),_0x22543d[_0x3683('0x7a')][_0x3683('0x3d')],isNotNull(_0x22543d[_0x3683('0x18f')])?_0x22543d[_0x3683('0x18f')][_0x3683('0x190')]()||'':'',_0x22543d['dialCutDigit']>0x0?_0xf0e24c['Contact'][_0x3683('0x16e')][_0x3683('0x191')](_0x22543d['dialCutDigit']):_0xf0e24c['Contact'][_0x3683('0x16e')]):util[_0x3683('0x7b')](_0x3683('0x18e'),_[_0x3683('0xb3')](_0x22543d[_0x3683('0x192')])?_0x22543d[_0x3683('0x7a')][_0x3683('0x3d')]:_0x22543d[_0x3683('0x192')][_0x3683('0x3d')],isNotNull(_0x22543d[_0x3683('0x18f')])?_0x22543d[_0x3683('0x18f')][_0x3683('0x190')]()||'':'',_0x22543d[_0x3683('0x193')]>0x0?_0xf0e24c[_0x3683('0x16f')][_0x3683('0x16e')][_0x3683('0x191')](_0x22543d[_0x3683('0x193')]):_0xf0e24c[_0x3683('0x16f')][_0x3683('0x16e')]),'callerid':_0x24b5ef,'Exten':_0x3683('0x177'),'Context':_0x3683('0x194'),'Priority':'1','variable':_0x5daf91,'timeout':(_0x22543d[_0x3683('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x555525})[_0x3683('0xbe')](function(_0x2bdb9c){return _0x283d56(_0x2bdb9c);})[_0x3683('0xb6')](function(_0x16b041){_0x22543d[_0x3683('0x66')]+=0x1;var _0x37722d=new History(_0x47797b[_0x3683('0x23')][_0x555525]);logger['error'](util['format']('[originateError]:\x20%s',JSON[_0x3683('0x49')](_0x16b041)));_0x37722d[_0x3683('0xac')]=0xe;_0x37722d[_0x3683('0xad')]=_0x3683('0x195');_0x37722d[_0x3683('0xae')]=moment()[_0x3683('0x7b')](_0x3683('0x101'));_0x37722d[_0x3683('0x126')]=_0x37722d[_0x3683('0xae')];_0x47797b[_0x3683('0xd1')](_0x37722d)[_0x3683('0xb6')](loggerCatch('[originate][error]'));_0x47797b[_0x3683('0xcf')](_0x37722d)[_0x3683('0xb6')](loggerCatch(_0x3683('0x196')))[_0x3683('0x1b')](function(){delete _0x47797b[_0x3683('0x23')][_0x555525];return _0x5d05bd(msgResponse(_0x3683('0x170'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0x3683('0x19')][_0x3683('0x2f')]=function(_0x1fe190){var _0x1777df=this[_0x3683('0x23')][_0x1fe190['actionid']];var _0x53ce55=this;if(_0x1777df){delete this[_0x3683('0x23')][_0x1fe190[_0x3683('0x12e')]];_0x1777df[_0x3683('0x11c')]=moment()[_0x3683('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');var _0x50794b=_0x1777df['type']===_0x3683('0x7e')?this[_0x3683('0x1e')][_0x1777df[_0x3683('0xb9')]]:this['voiceQueues'][_0x1777df[_0x3683('0x197')]()];if(!this[_0x3683('0xdf')](_0x1fe190[_0x3683('0x198')])){this['updateOriginated'](_0x50794b);return this[_0x3683('0x199')](_0x1777df,_0x50794b,_0x1fe190)[_0x3683('0xbe')](function(_0x4378ee){})[_0x3683('0xb6')](loggerCatch(_0x3683('0x19a')));}else{this[_0x3683('0x25')][_0x1fe190['uniqueid']]=_0x1777df;}}};Dialer[_0x3683('0x19')][_0x3683('0x19b')]=function(_0x31c28d,_0x1681cf,_0x26315b){var _0x3c2281=new History(_0x1681cf);if(_0x3c2281['countbusyretry']+_0x3c2281[_0x3683('0xf4')]+_0x3c2281[_0x3683('0xf5')]+_0x3c2281[_0x3683('0xf6')]+_0x3c2281['countdropretry']+_0x3c2281[_0x3683('0xf8')]+_0x3c2281[_0x3683('0xf0')]+_0x3c2281[_0x3683('0xf9')]>=_0x26315b[_0x3683('0xfa')]-0x1){return!![];}switch(_0x31c28d){case 0x3:if(_0x3c2281['countnoanswerretry']>=_0x26315b[_0x3683('0x19c')]-0x1){return!![];}else{this[_0x3683('0xc6')]({'active':![],'countnoanswerretry':_0x3c2281['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x3683('0xff')](_0x26315b[_0x3683('0x19d')],_0x3683('0x100'))[_0x3683('0x7b')](_0x3683('0x101')),'ContactId':_0x3c2281[_0x3683('0xd9')],'ListId':_0x3c2281['ListId'],'VoiceQueueId':_0x3c2281[_0x3683('0xdb')]||undefined,'CampaignId':_0x3c2281[_0x3683('0xdc')]||undefined})[_0x3683('0xb6')](loggerCatch(_0x3683('0x19e')));}break;case 0x5:if(_0x3c2281['countbusyretry']>=_0x26315b['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x3683('0xc6')]({'active':![],'countbusyretry':_0x3c2281[_0x3683('0xf3')]+=0x1,'scheduledat':moment()[_0x3683('0xff')](_0x26315b[_0x3683('0x19f')],_0x3683('0x100'))[_0x3683('0x7b')](_0x3683('0x101')),'ContactId':_0x3c2281[_0x3683('0xd9')],'ListId':_0x3c2281[_0x3683('0xda')],'VoiceQueueId':_0x3c2281['VoiceQueueId']||undefined,'CampaignId':_0x3c2281[_0x3683('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x3c2281[_0x3683('0xf4')]>=_0x26315b[_0x3683('0x1a0')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x3c2281[_0x3683('0xf4')]+=0x1,'scheduledat':moment()[_0x3683('0xff')](_0x26315b[_0x3683('0x1a1')],_0x3683('0x100'))[_0x3683('0x7b')](_0x3683('0x101')),'ContactId':_0x3c2281[_0x3683('0xd9')],'ListId':_0x3c2281[_0x3683('0xda')],'VoiceQueueId':_0x3c2281[_0x3683('0xdb')]||undefined,'CampaignId':_0x3c2281[_0x3683('0xdc')]||undefined})['catch'](loggerCatch(_0x3683('0x1a2')));}break;case 0x0:if(_0x3c2281['countnosuchnumberretry']>=_0x26315b[_0x3683('0x1a3')]-0x1){return!![];}else{this[_0x3683('0xc6')]({'active':![],'countnosuchnumberretry':_0x3c2281[_0x3683('0xf6')]+=0x1,'scheduledat':moment()[_0x3683('0xff')](_0x26315b[_0x3683('0x1a4')],_0x3683('0x100'))[_0x3683('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3c2281['ContactId'],'ListId':_0x3c2281['ListId'],'VoiceQueueId':_0x3c2281[_0x3683('0xdb')]||undefined,'CampaignId':_0x3c2281[_0x3683('0xdc')]||undefined})[_0x3683('0xb6')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x3c2281[_0x3683('0xf7')]>=_0x26315b[_0x3683('0x123')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countdropretry':_0x3c2281[_0x3683('0xf7')]+=0x1,'scheduledat':moment()['add'](_0x26315b[_0x3683('0x124')],_0x3683('0x100'))[_0x3683('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3c2281[_0x3683('0xd9')],'ListId':_0x3c2281['ListId'],'VoiceQueueId':_0x3c2281[_0x3683('0xdb')]||undefined,'CampaignId':_0x3c2281[_0x3683('0xdc')]||undefined})[_0x3683('0xb6')](loggerCatch(_0x3683('0x125')));}break;case 0xb:if(_0x3c2281[_0x3683('0xf8')]>=_0x26315b[_0x3683('0x12a')]-0x1){return!![];}else{this[_0x3683('0xc6')]({'active':![],'countabandonedretry':_0x3c2281[_0x3683('0xf8')]+=0x1,'scheduledat':moment()[_0x3683('0xff')](_0x26315b[_0x3683('0x12b')],_0x3683('0x100'))[_0x3683('0x7b')](_0x3683('0x101')),'ContactId':_0x3c2281[_0x3683('0xd9')],'ListId':_0x3c2281[_0x3683('0xda')],'VoiceQueueId':_0x3c2281[_0x3683('0xdb')]||undefined,'CampaignId':_0x3c2281['CampaignId']||undefined})[_0x3683('0xb6')](loggerCatch(_0x3683('0x1a5')));}break;case 0x13:if(_0x3c2281[_0x3683('0xf0')]>=_0x26315b[_0x3683('0xfd')]-0x1){return!![];}else{this[_0x3683('0xc6')]({'active':![],'countmachineretry':_0x3c2281['countmachineretry']+=0x1,'scheduledat':moment()[_0x3683('0xff')](_0x26315b['dialMachineRetryFrequency'],'minutes')[_0x3683('0x7b')](_0x3683('0x101')),'ContactId':_0x3c2281[_0x3683('0xd9')],'ListId':_0x3c2281['ListId'],'VoiceQueueId':_0x3c2281[_0x3683('0xdb')]||undefined,'CampaignId':_0x3c2281[_0x3683('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));}break;case 0x14:if(_0x3c2281['countagentrejectretry']>=_0x26315b[_0x3683('0x1a6')]-0x1){return!![];}else{this[_0x3683('0xc6')]({'active':![],'countagentrejectretry':_0x3c2281[_0x3683('0xf9')]+=0x1,'scheduledat':moment()[_0x3683('0xff')](_0x26315b['dialAgentRejectRetryFrequency'],'minutes')[_0x3683('0x7b')](_0x3683('0x101')),'ContactId':_0x3c2281[_0x3683('0xd9')],'ListId':_0x3c2281['ListId'],'VoiceQueueId':_0x3c2281[_0x3683('0xdb')]||undefined,'CampaignId':_0x3c2281[_0x3683('0xdc')]||undefined})[_0x3683('0xb6')](loggerCatch(_0x3683('0x1a7')));}break;default:return!![];}};Dialer[_0x3683('0x19')][_0x3683('0x199')]=function(_0x171a00,_0x5506fa,_0x3ba82f){var _0x19b5cc=this;var _0x75f1ae=new History(_0x171a00);return new BPromise(function(_0x3069be,_0x51b428){if(_[_0x3683('0x3b')](_0x5506fa)&&_0x3683('0x16d')!==typeof _0x5506fa){return _0x51b428(msgResponse('[callProgressDetecting]',_0x3683('0x14a'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x3ba82f)&&'object'!==typeof _0x3ba82f){return _0x51b428(msgResponse(_0x3683('0x1a8'),_0x3683('0x14a'),'evt\x20is\x20undefine'));}switch(_0x3ba82f[_0x3683('0x113')]){case'0':_0x5506fa['outboundNoSuchCallsDay']+=0x1;_0x75f1ae[_0x3683('0xac')]=0x0;_0x75f1ae['statedesc']=_0x3683('0x1a9');_0x75f1ae[_0x3683('0xf6')]+=0x1;_0x75f1ae['countglobal']+=0x1;ami[_0x3683('0x4d')]('custom:agentnosuchnumber',ut[_0x3683('0x1aa')](_0x171a00,_0x3683('0x1ab')));_0x19b5cc['createHistory'](_0x75f1ae)[_0x3683('0xb6')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x19b5cc[_0x3683('0x19b')](0x0,_0x171a00,_0x5506fa)){if(_0x75f1ae['countnosuchnumberretry']>=_0x5506fa[_0x3683('0x1a3')]){_0x19b5cc[_0x3683('0x108')](_0x75f1ae,_0x3069be,_0x51b428,'reason\x200\x20no\x20such\x20number....');}else{_0x19b5cc['stateGlobal'](_0x75f1ae,_0x3069be,_0x51b428,_0x3683('0x1ac'));}}break;case'3':_0x5506fa[_0x3683('0x64')]+=0x1;_0x75f1ae['state']=0x3;_0x75f1ae[_0x3683('0xad')]=_0x3683('0x1ad');_0x75f1ae[_0x3683('0xf5')]+=0x1;_0x75f1ae[_0x3683('0xf1')]+=0x1;ami[_0x3683('0x4d')]('custom:agentnoanswer',ut[_0x3683('0x1aa')](_0x171a00,_0x3683('0x1ae')));_0x19b5cc['createHistory'](_0x75f1ae)[_0x3683('0xb6')](loggerCatch(_0x3683('0x1af')));if(_0x19b5cc[_0x3683('0x19b')](0x3,_0x171a00,_0x5506fa)){if(_0x75f1ae[_0x3683('0xf5')]>=_0x5506fa[_0x3683('0x19c')]){_0x19b5cc['createStateFinal'](_0x75f1ae,_0x3069be,_0x51b428,_0x3683('0x1b0'));}else{_0x19b5cc['stateGlobal'](_0x75f1ae,_0x3069be,_0x51b428,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x5506fa[_0x3683('0x60')]+=0x1;_0x75f1ae['state']=0x5;_0x75f1ae[_0x3683('0xad')]=_0x3683('0x1b1');_0x75f1ae[_0x3683('0xf3')]+=0x1;_0x75f1ae[_0x3683('0xf1')]+=0x1;ami[_0x3683('0x4d')](_0x3683('0x1b2'),ut[_0x3683('0x1aa')](_0x171a00,_0x3683('0x1b3')));_0x19b5cc[_0x3683('0xd1')](_0x75f1ae)[_0x3683('0xb6')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x19b5cc[_0x3683('0x19b')](0x5,_0x171a00,_0x5506fa)){if(_0x75f1ae[_0x3683('0xf3')]>=_0x5506fa[_0x3683('0x1b4')]){_0x19b5cc[_0x3683('0x108')](_0x75f1ae,_0x3069be,_0x51b428,'reason\x205\x20busy');}else{_0x19b5cc[_0x3683('0xfb')](_0x75f1ae,_0x3069be,_0x51b428,_0x3683('0x1b5'));}}break;case'8':_0x5506fa[_0x3683('0x61')]+=0x1;_0x75f1ae[_0x3683('0xac')]=0x8;_0x75f1ae[_0x3683('0xad')]=_0x3683('0x1b6');_0x75f1ae[_0x3683('0xf4')]+=0x1;_0x75f1ae[_0x3683('0xf1')]+=0x1;ami[_0x3683('0x4d')]('custom:agentcongestion',ut['buildObj'](_0x171a00,'congestion'));_0x19b5cc[_0x3683('0xd1')](_0x75f1ae)[_0x3683('0xb6')](loggerCatch(_0x3683('0x1b7')));if(_0x19b5cc['checkRetriveMax'](0x8,_0x171a00,_0x5506fa)){if(_0x75f1ae[_0x3683('0xf4')]>=_0x5506fa[_0x3683('0x1a0')]){_0x19b5cc[_0x3683('0x108')](_0x75f1ae,_0x3069be,_0x51b428,_0x3683('0x1b8'));}else{_0x19b5cc['stateGlobal'](_0x75f1ae,_0x3069be,_0x51b428,_0x3683('0x1b8'));}}break;case'11':_0x5506fa['outboundAbandonedCallsDay']+=0x1;_0x75f1ae['state']=0xb;_0x75f1ae[_0x3683('0xad')]='Abandoned';_0x75f1ae[_0x3683('0xf8')]+=0x1;_0x75f1ae['countglobal']+=0x1;_0x19b5cc[_0x3683('0xd1')](_0x75f1ae)['catch'](loggerCatch(_0x3683('0x12d')));if(_0x19b5cc['checkRetriveMax'](0xb,_0x171a00,_0x5506fa)){if(_0x75f1ae[_0x3683('0xf8')]>=_0x5506fa[_0x3683('0x12a')]){_0x19b5cc['createStateFinal'](_0x75f1ae,_0x3069be,_0x51b428,'reason\x2011\x20abandoned');}else{_0x19b5cc['stateGlobal'](_0x75f1ae,_0x3069be,_0x51b428,_0x3683('0x1b9'));}}break;case'20':_0x5506fa[_0x3683('0x68')]+=0x1;_0x75f1ae[_0x3683('0xac')]=0x14;_0x75f1ae[_0x3683('0xad')]=_0x3683('0x1ba');_0x75f1ae['countagentrejectretry']+=0x1;_0x75f1ae['countglobal']+=0x1;ami[_0x3683('0x4d')](_0x3683('0x1bb'),ut[_0x3683('0x1aa')](_0x171a00,_0x3683('0x1bc')));_0x19b5cc['createHistory'](_0x75f1ae)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x19b5cc['checkRetriveMax'](0x14,_0x171a00,_0x5506fa)){if(_0x75f1ae['countagentrejectretry']>=_0x5506fa[_0x3683('0x1a6')]){_0x19b5cc[_0x3683('0x108')](_0x75f1ae,_0x3069be,_0x51b428,_0x3683('0x1bd'));}else{_0x19b5cc['stateGlobal'](_0x75f1ae,_0x3069be,_0x51b428,_0x3683('0x1bd'));}}break;default:_0x5506fa[_0x3683('0x69')]+=0x1;_0x75f1ae[_0x3683('0xac')]=0xc;_0x75f1ae[_0x3683('0xad')]=_0x3ba82f[_0x3683('0x113')];_0x19b5cc[_0x3683('0xd1')](_0x75f1ae)[_0x3683('0xb6')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x19b5cc[_0x3683('0x19b')](_0x3ba82f['reason'],_0x171a00,_0x5506fa)){if(_0x75f1ae[_0x3683('0xf3')]+_0x75f1ae[_0x3683('0xf4')]+_0x75f1ae['countnoanswerretry']+_0x75f1ae[_0x3683('0xf6')]+_0x75f1ae[_0x3683('0xf7')]+_0x75f1ae[_0x3683('0xf8')]+_0x75f1ae[_0x3683('0xf0')]+_0x75f1ae[_0x3683('0xf9')]>=_0x5506fa[_0x3683('0xfa')]){_0x19b5cc[_0x3683('0xfb')](_0x75f1ae,_0x3069be,_0x51b428,_0x3ba82f[_0x3683('0x113')]);}else{_0x19b5cc[_0x3683('0x108')](_0x75f1ae,_0x3069be,_0x51b428,_0x3ba82f[_0x3683('0x113')]);}}}});};Dialer[_0x3683('0x19')][_0x3683('0xfb')]=function(_0x2edc07,_0x235204,_0x373f31,_0x5c16df){var _0x86544d=new Final(_0x2edc07);_0x86544d[_0x3683('0xac')]=0xf;_0x86544d[_0x3683('0xad')]=_0x3683('0x1be');this['createStateFinal'](_0x86544d,_0x235204,_0x373f31,_0x5c16df);};Dialer[_0x3683('0x19')][_0x3683('0x108')]=function(_0x32e8f4,_0x198284,_0x33a290,_0x48e72d){this[_0x3683('0xcf')](_0x32e8f4)[_0x3683('0xbe')](function(_0x518f93){return _0x198284(msgResponse('[callProgressDetecting]',_0x3683('0xe0'),_0x48e72d));})[_0x3683('0xb6')](function(_0x29e614){return _0x33a290(msgResponse(_0x3683('0x1bf'),_0x3683('0x14a'),_0x3683('0x1c0')));});};Dialer[_0x3683('0x19')]['predictive']=function(_0x157ec0){var _0x586ec7=this;var _0x11538e=_0x157ec0[_0x3683('0x1c1')]/0x64;var _0x3c273e=_0x157ec0[_0x3683('0x11e')]/(_0x157ec0['outboundDropCallsDayTimeout']+_0x157ec0['outboundAnswerCallsDay']);var _0x2449fb=Math[_0x3683('0x1c2')](_0x157ec0[_0x3683('0x72')]*(_0x157ec0[_0x3683('0x1c3')]/0x64));var _0x22c099=Math[_0x3683('0x1c2')](_0x157ec0[_0x3683('0x72')]*(_0x157ec0['predictiveIntervalMinThreshold']/0x64));var _0x29eff9=_0x157ec0[_0x3683('0x51')]+_0x157ec0[_0x3683('0xa4')];var _0x25c7c6=Math[_0x3683('0x1c4')](_0x157ec0[_0x3683('0x74')]*_0x157ec0[_0x3683('0x76')]*_0x157ec0[_0x3683('0x70')]*_0x157ec0[_0x3683('0x71')]);if(_['isUndefined'](_0x157ec0[_0x3683('0x79')])){if(!_[_0x3683('0x3b')](_0x157ec0['startPredictive'])){_0x157ec0[_0x3683('0x78')]=undefined;loggerPredictive[_0x3683('0x97')](_0x3683('0x1c5'),_0x3683('0x1c6'));}if(!_['isUndefined'](_0x157ec0[_0x3683('0x92')])){loggerPredictive[_0x3683('0x97')](_0x3683('0x1c5'),_0x3683('0x1c7'));clearInterval(_0x157ec0[_0x3683('0x92')]);_0x157ec0[_0x3683('0x92')]=undefined;}_0x157ec0[_0x3683('0x79')]=moment()[_0x3683('0x7b')](_0x3683('0x101'));loggerPredictive[_0x3683('0x81')](_0x157ec0[_0x3683('0x3d')],_0x3683('0x1c8'),_0x157ec0['startProgressive']);this[_0x3683('0x15a')](_0x157ec0,0x1);}else if(ifInterval(_0x157ec0[_0x3683('0x1c9')],_0x157ec0[_0x3683('0x79')])){this[_0x3683('0x15a')](_0x157ec0,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x157ec0[_0x3683('0x79')],_0x157ec0[_0x3683('0x3d')]);_0x157ec0['erlangCalls']=0x0;_0x157ec0[_0x3683('0x6f')]=0x0;}else if(_0x11538e<_0x3c273e&&_0x157ec0[_0x3683('0x1ca')]===_0x3683('0x1cb')){freeVariablesPredictive(_0x157ec0);loggerPredictive[_0x3683('0x81')](_0x3683('0x1cc'),_0x3683('0x1cd'),_0x3c273e,_0x3683('0x79'),_0x157ec0[_0x3683('0x3d')]);}else if(_0x25c7c6<_0x157ec0[_0x3683('0x6f')]&&_0x157ec0['dialPredictiveOptimization']===_0x3683('0x1cb')){freeVariablesPredictive(_0x157ec0);loggerPredictive[_0x3683('0x81')](_0x3683('0x1ce'),_0x3683('0x1cf'),_0x25c7c6,'Drop\x20in\x20this\x20interval',_0x157ec0[_0x3683('0x6f')],'startProgressive',_0x157ec0[_0x3683('0x3d')]);}else if(!ifInterval(_0x157ec0[_0x3683('0x1c9')],_0x157ec0['startProgressive'])&&_[_0x3683('0x3b')](_0x157ec0['startPredictive'])&&!_[_0x3683('0x3b')](_0x157ec0[_0x3683('0x79')])){_0x157ec0[_0x3683('0x78')]=moment()['format'](_0x3683('0x101'));loggerPredictive[_0x3683('0x81')](_0x157ec0[_0x3683('0x3d')],_0x3683('0x1d0'),_0x157ec0['startPredictive']);this[_0x3683('0xc4')](_0x157ec0[_0x3683('0x1c9')])[_0x3683('0xbe')](this[_0x3683('0x1d1')](_0x157ec0))[_0x3683('0xbe')](mergeDataErlangB(_0x157ec0))['then'](this[_0x3683('0x1d2')](_0x157ec0))[_0x3683('0xb6')](loggerCatchPredictive(_0x3683('0x1d3'),_0x157ec0));}else if(!ifInterval(_0x157ec0[_0x3683('0x1c9')],_0x157ec0['startPredictive'])){_0x157ec0['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x157ec0[_0x3683('0x78')]=moment()[_0x3683('0x7b')](_0x3683('0x101'));loggerPredictive[_0x3683('0x81')](_0x157ec0[_0x3683('0x3d')],_0x3683('0x1d4'),_0x157ec0[_0x3683('0x78')]);clearInterval(_0x157ec0[_0x3683('0x92')]);_0x157ec0[_0x3683('0x92')]=undefined;this[_0x3683('0xc4')](_0x157ec0[_0x3683('0x1c9')])[_0x3683('0xbe')](this[_0x3683('0x1d1')](_0x157ec0))[_0x3683('0xbe')](mergeDataErlangB(_0x157ec0))['then'](this[_0x3683('0x1d2')](_0x157ec0))[_0x3683('0xb6')](loggerCatchPredictive(_0x3683('0x1d5'),_0x157ec0));}else if(_0x157ec0[_0x3683('0x72')]&&_0x29eff9<_0x157ec0[_0x3683('0x72')]-_0x22c099){freeVariablesPredictive(_0x157ec0);loggerPredictive[_0x3683('0x81')](_0x157ec0[_0x3683('0x3d')],_0x3683('0x1d6'),_0x29eff9,')\x20are\x20less\x20than\x20threshold\x20(',_0x157ec0[_0x3683('0x72')],'-',_0x22c099,'=',_0x157ec0[_0x3683('0x72')]-_0x22c099,')');}else if(_0x157ec0[_0x3683('0x72')]&&_0x29eff9>_0x157ec0[_0x3683('0x72')]+_0x2449fb){freeVariablesPredictive(_0x157ec0);loggerPredictive[_0x3683('0x81')](_0x157ec0[_0x3683('0x3d')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x29eff9,')\x20are\x20more\x20than\x20threshold\x20(',_0x157ec0['predictiveIntervalAvailable'],'+',_0x2449fb,'=',_0x157ec0['predictiveIntervalAvailable']+_0x2449fb,')');}};Dialer['prototype']['getDataPredictive']=function(_0x485e2c){var _0x1f8a76=this;return function(_0x2f4fe3){return new BPromise(function(_0x1146c1,_0x254fcf){_[_0x3683('0x8f')](_0x485e2c,_0x2f4fe3[0x0]);if(checkGetDataPredictive(_0x2f4fe3[0x0])){var _0x583c65=_0x485e2c[_0x3683('0x72')]=_0x485e2c[_0x3683('0xa4')]+_0x485e2c[_0x3683('0x51')];var _0x1f4874=_0x485e2c[_0x3683('0x1c9')]*0x3c;var _0x1b0b63=_0x2f4fe3[0x0]['predictiveIntervalAvgTalktime']+_0x2f4fe3[0x0][_0x3683('0x6b')];var _0x35b2bb=(_0x2f4fe3[0x0][_0x3683('0x6a')]+_0x2f4fe3[0x0][_0x3683('0x6d')]+_0x2f4fe3[0x0][_0x3683('0x85')])/_0x2f4fe3[0x0]['predictiveIntervalTotalCalls'];_0x485e2c['predictiveIntervalHitRate']=_0x35b2bb>0x0?_0x35b2bb:0x1;switch(_0x485e2c[_0x3683('0x1ca')]){case _0x3683('0x1cb'):var _0x42dfb1=_0x485e2c[_0x3683('0x1c1')]/0x64;return _0x1f8a76[_0x3683('0x1d7')](_0x583c65,_0x1f4874,_0x1b0b63,_0x35b2bb,_0x42dfb1)[_0x3683('0xbe')](function(_0x14795d){return _0x1146c1(_0x14795d);});case _0x3683('0x1d8'):var _0x3f17db=_0x485e2c[_0x3683('0x1c1')]/0x64;return _0x1f8a76[_0x3683('0x1d9')](_0x583c65,_0x1f4874,_0x1b0b63,_0x35b2bb,_0x3f17db)[_0x3683('0xbe')](function(_0x1cc28c){return _0x1146c1(_0x1cc28c);});default:return _0x254fcf(msgResponse(_0x3683('0x1da'),_0x3683('0x14a'),_0x3683('0x1db')));}}else{return _0x254fcf(msgResponse(_0x3683('0x1da'),_0x3683('0x14a'),_0x3683('0x1dc')));}});};};Dialer[_0x3683('0x19')][_0x3683('0x1dd')]=function(_0x17a896){var _0xc81f38=this;return function(_0x2bf94b){return new BPromise(function(_0x1ca3c4,_0x1bc6f4){_['merge'](_0x17a896,_0x2bf94b[0x0]);if(checkGetDataPredictive(_0x2bf94b[0x0])){loggerPredictive[_0x3683('0x81')](JSON[_0x3683('0x49')](_0x2bf94b[0x0]));if(_0x17a896[_0x3683('0x1ca')]==='dropRate'){return _0xc81f38[_0x3683('0xcd')](_0x17a896['id'])[_0x3683('0xbe')](function(_0xaacc64){var _0x116ca1=_0x17a896[_0x3683('0x52')]-_0xaacc64[0x0][_0x3683('0x1de')];var _0x217594=_0x17a896['dialPredictiveInterval']*0x3c;var _0x4c3c63=_0x2bf94b[0x0][_0x3683('0x6c')]+_0x2bf94b[0x0]['predictiveIntervalAvgHoldtime'];var _0x2d2cae=(_0x2bf94b[0x0][_0x3683('0x6a')]+_0x2bf94b[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2bf94b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2bf94b[0x0][_0x3683('0x73')];var _0x12e0d9=_0x17a896['dialPredictiveOptimizationPercentage']/0x64;_0x17a896['predictiveIntervalPauses']=_0xaacc64[0x0][_0x3683('0x1de')]||0x0;_0x17a896['predictiveIntervalHitRate']=_0x2d2cae>0x0?_0x2d2cae:0x1;return _0xc81f38[_0x3683('0x1d7')](_0x116ca1,_0x217594,_0x4c3c63,_0x2d2cae,_0x12e0d9);})['then'](function(_0x29311e){return _0x1ca3c4(_0x29311e);})[_0x3683('0xb6')](function(_0x4a4732){return _0x1bc6f4(msgResponse(_0x3683('0x1df'),_0x3683('0x14a'),JSON[_0x3683('0x49')](_0x4a4732)));});}if(_0x17a896[_0x3683('0x1ca')]===_0x3683('0x1d8')){return _0xc81f38[_0x3683('0xcd')](_0x17a896['id'])[_0x3683('0xbe')](function(_0x1b5ba7){var _0x5eff9c=_0x17a896[_0x3683('0x52')]-_0x1b5ba7[0x0]['outboundQueuePauses'];var _0x5761dd=_0x17a896[_0x3683('0x1c9')]*0x3c;var _0x1b1ffc=_0x2bf94b[0x0][_0x3683('0x6c')]+_0x2bf94b[0x0][_0x3683('0x6b')];var _0x2e86fd=(_0x2bf94b[0x0]['predictiveIntervalAnsweredCalls']+_0x2bf94b[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2bf94b[0x0][_0x3683('0x85')])/_0x2bf94b[0x0][_0x3683('0x73')];var _0xc0ee=_0x17a896[_0x3683('0x1c1')]/0x64;_0x17a896[_0x3683('0x1e0')]=_0x1b5ba7[0x0]['outboundQueuePauses']||0x0;_0x17a896[_0x3683('0x70')]=_0x2e86fd>0x0?_0x2e86fd:0x1;return _0xc81f38[_0x3683('0x1d9')](_0x5eff9c,_0x5761dd,_0x1b1ffc,_0x2e86fd,_0xc0ee);})[_0x3683('0xbe')](function(_0x1ab25b){return _0x1ca3c4(_0x1ab25b);})[_0x3683('0xb6')](function(_0x58085b){return _0x1bc6f4(msgResponse(_0x3683('0x1df'),'Failure',JSON[_0x3683('0x49')](_0x58085b)));});}}else{return _0x1bc6f4(msgResponse(_0x3683('0x1da'),_0x3683('0x14a'),_0x3683('0x1dc')));}});};};Dialer[_0x3683('0x19')][_0x3683('0x1d2')]=function(_0x445301){var _0x4b23a6=this;return function(){var _0x23868f=0x0;var _0x277bde=Math['floor'](_0x445301[_0x3683('0x75')]*0x3e8);if(_0x277bde>0x0){_0x277bde=_0x277bde<0x64?0x64:_0x277bde;loggerPredictive[_0x3683('0x81')](_0x445301[_0x3683('0x3d')],_0x3683('0x1e1'),_0x277bde,_0x3683('0x4a'));_0x445301[_0x3683('0x92')]=setInterval(function(){_0x4b23a6['handlePredictive'](_0x445301);loggerPredictiveCalls[_0x3683('0x81')](_0x3683('0x1e2'),_0x23868f+=0x1);},_0x277bde);}else{loggerPredictive['info'](_0x445301[_0x3683('0x3d')],_0x3683('0x1e3'));}};};Dialer[_0x3683('0x19')][_0x3683('0x1e4')]=function(_0x17d22e,_0x302afa){var _0xd0a48c=this;return function(_0x20bdf9){if(_['isEmpty'](_0x20bdf9)){if(_[_0x3683('0xb3')](_0x302afa[_0x3683('0x1e5')])||!_0x302afa['recallme']){if(_0x17d22e[_0x3683('0x5a')]===_0x3683('0x5')){_0x17d22e[_0x3683('0x136')]=_[_0x3683('0x3b')](_0x17d22e[_0x3683('0x136')])?!![]:_0x17d22e[_0x3683('0x136')];var _0x5d9c54=uuid['v4']();_0xd0a48c[_0x3683('0x23')][_0x5d9c54]=new Action(_0x17d22e,_0x302afa,_0x5d9c54);loggerBooked[_0x3683('0x81')](_0x3683('0x1e6'),_0x5d9c54,_0x3683('0x1e7'),JSON[_0x3683('0x49')](_0x17d22e[_0x3683('0x136')]),_0x3683('0x1e8'),_0x17d22e[_0x3683('0x3d')]);if(_0x17d22e[_0x3683('0x136')]){_0x17d22e[_0x3683('0x136')]=![];_0xd0a48c['queueBooked'][_0xd0a48c[_0x3683('0x23')][_0x5d9c54]['queue']]=[];ami[_0x3683('0xb4')]({'actionid':_0x5d9c54,'action':_0x3683('0x1e9'),'queue':_0x17d22e[_0x3683('0x3d')]})[_0x3683('0xb6')](function(_0x12cdc9){_0xd0a48c[_0x3683('0xb8')](_0x17d22e);_0xd0a48c[_0x3683('0xc6')]({'active':![],'ContactId':_0xd0a48c['actions'][_0x5d9c54][_0x3683('0xd9')],'ListId':_0xd0a48c[_0x3683('0x23')][_0x5d9c54][_0x3683('0xda')],'VoiceQueueId':_0xd0a48c[_0x3683('0x23')][_0x5d9c54][_0x3683('0xdb')]||undefined,'CampaignId':_0xd0a48c['actions'][_0x5d9c54][_0x3683('0xdc')]||undefined})['catch'](loggerCatch(_0x3683('0x1ea')));delete _0xd0a48c[_0x3683('0x23')][_0x5d9c54];});}else{loggerBooked[_0x3683('0x81')]('[booked][checkContactBlack][else]',JSON[_0x3683('0x49')](_0x17d22e[_0x3683('0x136')]),_0x3683('0x1e8'),_0x17d22e['name']);_0xd0a48c['updateOriginated'](_0x17d22e);_0xd0a48c[_0x3683('0xc6')]({'active':![],'ContactId':_0xd0a48c[_0x3683('0x23')][_0x5d9c54][_0x3683('0xd9')],'ListId':_0xd0a48c[_0x3683('0x23')][_0x5d9c54][_0x3683('0xda')],'VoiceQueueId':_0xd0a48c[_0x3683('0x23')][_0x5d9c54]['VoiceQueueId']||undefined,'CampaignId':_0xd0a48c[_0x3683('0x23')][_0x5d9c54]['CampaignId']||undefined})[_0x3683('0xb6')](loggerCatch(_0x3683('0x1ea')));delete _0xd0a48c[_0x3683('0x23')][_0x5d9c54];}}else{return _0xd0a48c['actionOriginate'](_0x17d22e,_0x302afa);}}else{if(getDiff(_0x302afa[_0x3683('0x1eb')])<_0x17d22e[_0x3683('0x1ec')]*0x3c){if(_0x302afa[_0x3683('0x1ed')]&&!_0x302afa[_0x3683('0x1ed')][_0x3683('0x1ee')]){_0xd0a48c[_0x3683('0x137')][_0x3683('0x138')](_0x302afa['id'])[_0x3683('0x1b')](function(){_0xd0a48c[_0x3683('0xb8')](_0x17d22e);});}else{_0xd0a48c[_0x3683('0xc8')]({'active':![]},_0x302afa['id'],0x1)[_0x3683('0x1b')](function(){console[_0x3683('0x1ef')](_0x3683('0x1f0'));_0xd0a48c[_0x3683('0xb8')](_0x17d22e);});}}else{_0x17d22e['outboundReCallsDay']+=0x1;_0xd0a48c['updateOriginated'](_0x17d22e);if(_0x17d22e[_0x3683('0x1f1')]){_0xd0a48c[_0x3683('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x302afa[_0x3683('0xd9')],'ListId':_0x302afa['ListId'],'VoiceQueueId':_0x302afa['VoiceQueueId']||undefined,'CampaignId':_0x302afa[_0x3683('0xdc')]||undefined})[_0x3683('0xb6')](loggerCatch(_0x3683('0x1f2')));_0xd0a48c[_0x3683('0xd1')](createObjHistory(_0x17d22e,_0x302afa,_0x3683('0x1f3'),0x17,_0x3683('0x1f4')))[_0x3683('0xb6')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0xd0a48c[_0x3683('0xe5')](createObjHistory(_0x17d22e,_0x302afa,_0x3683('0x1f5'),0x16,_0x3683('0x1f6')),'[Originate][HistoryRecallClose][historyCatch]',_0x3683('0x1f7'));}}}}else{_0x17d22e[_0x3683('0x5f')]+=0x1;_0xd0a48c[_0x3683('0xe5')](createObjHistory(_0x17d22e,_0x302afa,'BLACKLIST',0xd,'Blacklist'),_0x3683('0x1f8'),_0x3683('0x1f9'));throw _0x3683('0x1fa');}};};Dialer[_0x3683('0x19')][_0x3683('0x1fb')]=function(_0x333ea9){var _0x1d803a=this;var _0x3f03d6=[];var _0x17a15b=_0x333ea9['limitCalls']-_0x333ea9[_0x3683('0x9c')]-_0x333ea9[_0x3683('0x1fc')];emitCampaignSummary(_0x333ea9);if(_0x17a15b>0x0){if(_0x17a15b>this['maxNumberOriginate']){_0x17a15b=this[_0x3683('0x21')];}_0x333ea9['temp']+=_0x17a15b;this[_0x3683('0xcc')](_0x333ea9['id'],_0x17a15b,_0x333ea9[_0x3683('0x1fd')])[_0x3683('0xbe')](function(_0x2c17e7){_0x333ea9['temp']-=_0x17a15b;_0x333ea9[_0x3683('0x1fc')]=_0x333ea9[_0x3683('0x1fc')]>0x0?_0x333ea9['temp']:0x0;if(!checkContactEmpty(_0x2c17e7)){_0x333ea9[_0x3683('0x3f')]=_0x3683('0x1fe');logger[_0x3683('0x81')](_0x3683('0x1ff')+_0x333ea9[_0x3683('0x3d')]);}else{_0x333ea9[_0x3683('0x9c')]+=_0x2c17e7[_0x3683('0x9a')];_0x333ea9[_0x3683('0x3f')]='RUNNING';for(var _0x375b8b=0x0;_0x375b8b<_0x2c17e7[_0x3683('0x9a')];_0x375b8b+=0x1){_0x333ea9[_0x3683('0x200')]+=0x1;if(_[_0x3683('0xb3')](_0x2c17e7[_0x375b8b])||_[_0x3683('0xb3')](_0x2c17e7[_0x375b8b]['Contact'])||_[_0x3683('0xb3')](_0x2c17e7[_0x375b8b][_0x3683('0x16f')][_0x3683('0x16e')])){_0x1d803a[_0x3683('0xd6')](_0x3683('0x201'),_0x333ea9,_0x2c17e7[_0x375b8b]);}else{_0x1d803a[_0x3683('0xc2')](_[_0x3683('0xd8')](_0x2c17e7[_0x375b8b],[_0x3683('0xdc'),_0x3683('0x202')]))[_0x3683('0xbe')](_0x1d803a[_0x3683('0x1e4')](_0x333ea9,_0x2c17e7[_0x375b8b]))[_0x3683('0xb6')](_0x1d803a[_0x3683('0xd5')]('[actionOriginateIvr]\x20',_0x333ea9));}}}})['catch'](loggerGetContactDialer(_0x3683('0x203'),_0x333ea9,_0x17a15b));}};Dialer[_0x3683('0x19')][_0x3683('0x15a')]=function(_0x1d13a3,_0x16f910){var _0x436746=this;var _0x5887b3=[];var _0x2e43a4=_0x16f910>=0x1?_0x16f910:0x1;var _0x2990f5=[];if(_0x1d13a3[_0x3683('0x5a')]===_0x3683('0x5')){_0x2e43a4=0x1;}var _0x310101=Math[_0x3683('0x1c4')](_0x1d13a3[_0x3683('0x51')]*_0x2e43a4)-_0x1d13a3[_0x3683('0x9c')]-_0x1d13a3[_0x3683('0x1fc')];emitVoiceQueueSummary(_0x1d13a3);if(_0x1d13a3[_0x3683('0x204')]>0x0){var _0x500b6c=_0x1d13a3[_0x3683('0x204')]-_0x1d13a3[_0x3683('0x9c')]-_0x1d13a3[_0x3683('0xa4')]-_0x1d13a3[_0x3683('0x1fc')]-_0x1d13a3[_0x3683('0x205')];if(_0x310101>_0x500b6c){_0x310101=_0x500b6c;}}if(_0x310101>0x0){if(_0x1d13a3[_0x3683('0x5a')]===_0x3683('0x5')){_0x310101=0x1;}if(_0x310101>this[_0x3683('0x21')]){_0x310101=this[_0x3683('0x21')];}_0x1d13a3[_0x3683('0x1fc')]+=_0x310101;for(var _0x304af3 in this[_0x3683('0x1f')]){if(this[_0x3683('0x1f')][_0x3683('0x9b')](_0x304af3)){if(this[_0x3683('0x1f')][_0x304af3]['state']===_0x3683('0x206')&&this[_0x3683('0x1f')][_0x304af3]['status']===_0x3683('0x207')){_0x5887b3[_0x3683('0x132')](this['agents'][_0x304af3]['id']);}}}this['getContactDialer'](_0x1d13a3['id'],_0x5887b3,_0x310101,_0x1d13a3[_0x3683('0x1fd')])[_0x3683('0xbe')](function(_0x4f98a0){_0x1d13a3['temp']-=_0x310101;_0x1d13a3[_0x3683('0x1fc')]=_0x1d13a3[_0x3683('0x1fc')]>0x0?_0x1d13a3[_0x3683('0x1fc')]:0x0;if(!checkContactEmpty(_0x4f98a0)){_0x436746['countReScheduled'](_0x1d13a3)['then'](sendMessageReschedule(_0x1d13a3))['catch'](loggerCatch(_0x3683('0xbf')));}else{_0x1d13a3['originated']+=_0x4f98a0[_0x3683('0x9a')];_0x1d13a3['message']=_0x1d13a3[_0x3683('0x5a')]===_0x3683('0x5')?_0x3683('0x176'):'RUNNING';for(var _0x50297b=0x0;_0x50297b<_0x4f98a0[_0x3683('0x9a')];_0x50297b+=0x1){if(_[_0x3683('0xb3')](_0x4f98a0[_0x50297b])||_[_0x3683('0xb3')](_0x4f98a0[_0x50297b][_0x3683('0x16f')])||_[_0x3683('0xb3')](_0x4f98a0[_0x50297b]['Contact'][_0x3683('0x16e')])){_0x436746['emptyContact'](_0x3683('0x201'),_0x1d13a3,_0x4f98a0[_0x50297b]);}else{_0x436746[_0x3683('0xc0')](_[_0x3683('0xd8')](_0x4f98a0[_0x50297b],[_0x3683('0xdb'),'Contact.phone']))[_0x3683('0xbe')](_0x436746['checkContactBlack'](_0x1d13a3,_0x4f98a0[_0x50297b]))[_0x3683('0xb6')](_0x436746[_0x3683('0xd5')](_0x3683('0x201'),_0x1d13a3));}}}})['catch'](loggerGetContactDialer(_0x3683('0x208'),_0x1d13a3,_0x310101));}};Dialer[_0x3683('0x19')][_0x3683('0x92')]=function(_0x47ad56){var _0x559788=this;if(_0x47ad56['dialLimitQueue']>0x0){var _0x1bb88a=_0x47ad56[_0x3683('0x204')]-_0x47ad56[_0x3683('0x9c')]-_0x47ad56[_0x3683('0xa4')];if(_0x1bb88a>0x0){this['tryOriginatePredictive'](_0x47ad56);}else{loggerPredictiveCalls['info'](_0x3683('0x209'));}}else{this[_0x3683('0x20a')](_0x47ad56);}};Dialer[_0x3683('0x19')][_0x3683('0x20a')]=function(_0x465940){var _0x11af49=this;var _0x312d50=[];_0x465940[_0x3683('0x9c')]+=0x1;for(var _0x3082be in this[_0x3683('0x1f')]){if(this['agents'][_0x3683('0x9b')](_0x3082be)){if(this[_0x3683('0x1f')][_0x3082be][_0x3683('0xac')]===_0x3683('0x206')&&this[_0x3683('0x1f')][_0x3082be][_0x3683('0xe3')]===_0x3683('0x207')){_0x312d50[_0x3683('0x132')](this[_0x3683('0x1f')][_0x3082be]['id']);}}}this[_0x3683('0xca')](_0x465940['id'],_0x312d50,0x1,_0x465940[_0x3683('0x1fd')])['then'](function(_0x41d475){if(!checkContactEmpty(_0x41d475)){checkContactLowerLimitOriginate(_0x465940,0x1,0x0);_0x11af49[_0x3683('0xbc')](_0x465940)[_0x3683('0xbe')](sendMessageReschedule(_0x465940))[_0x3683('0xb6')](loggerCatch(_0x3683('0xbf')));}else{_0x465940['message']=_0x3683('0x20b');if(_[_0x3683('0xb3')](_0x41d475[0x0])||_['isNil'](_0x41d475[0x0]['Contact'])||_['isNil'](_0x41d475[0x0][_0x3683('0x16f')]['phone'])){_0x11af49[_0x3683('0xd6')](_0x3683('0x201'),_0x465940,_0x41d475[0x0]);}else{_0x11af49['checkIsBlackList'](_[_0x3683('0xd8')](_0x41d475[0x0],['VoiceQueueId',_0x3683('0x202')]))[_0x3683('0xbe')](_0x11af49[_0x3683('0x1e4')](_0x465940,_0x41d475[0x0]))[_0x3683('0xb6')](_0x11af49[_0x3683('0xd5')](_0x3683('0x20c'),_0x465940));}}})['catch'](loggerGetContactDialer(_0x3683('0x20d'),_0x465940,0x1));emitVoiceQueueSummary(_0x465940);};Dialer[_0x3683('0x19')][_0x3683('0x1d7')]=function(_0x2735bf,_0x45c1b0,_0x5b0ad5,_0x52b636,_0x35d815,_0x137f2f){loggerPredictive[_0x3683('0x81')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x3683('0x81')](_0x3683('0x20e'),_0x2735bf);loggerPredictive[_0x3683('0x81')](_0x3683('0x20f'),_0x45c1b0);loggerPredictive['info'](_0x3683('0x210'),_0x5b0ad5);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52b636);loggerPredictive[_0x3683('0x81')](_0x3683('0x211'),_0x35d815);loggerPredictive[_0x3683('0x81')](_0x3683('0x88'));return new BPromise(function(_0x4b5063,_0xcde425){if(_0x2735bf<=0x0||isNaN(_0x2735bf)){return _0xcde425(msgResponse(_0x3683('0x212'),'Error','m\x20=\x20'+_0x2735bf));}if(_0x5b0ad5<=0x0||isNaN(_0x5b0ad5)){return _0xcde425(msgResponse(_0x3683('0x212'),_0x3683('0x48'),_0x3683('0x213')+_0x5b0ad5));}if(_0x52b636<=0x0||isNaN(_0x52b636)){return _0xcde425(msgResponse(_0x3683('0x212'),_0x3683('0x48'),_0x3683('0x214')+_0x52b636));}if(_0x45c1b0<=0x0||isNaN(_0x45c1b0)){return _0xcde425(msgResponse(_0x3683('0x212'),_0x3683('0x48'),_0x3683('0x215')+_0x45c1b0));}if(_0x35d815<=0x0||isNaN(_0x35d815)){return _0xcde425(msgResponse(_0x3683('0x212'),'Error',_0x3683('0x216')+_0x35d815));}_0x137f2f=_0x137f2f||0x0;var _0x36b6e1=0x1/_0x5b0ad5;var _0x7fc56a=0x0;var _0x518660=0x0;var _0x456388=0x0;var _0x361619=0x0;for(var _0x4b544a=0x0;_0x456388<_0x35d815;_0x4b544a+=0x1){_0x518660=_0x4b544a/_0x45c1b0;_0x7fc56a=(_0x52b636*_0x518660+_0x137f2f)/_0x36b6e1;_0x456388=erlangb(_0x7fc56a,_0x2735bf);_0x361619=_0x7fc56a/_0x2735bf*(0x1-erlangb(_0x7fc56a,_0x2735bf));}return _0x4b5063({'erlangCalls':_0x4b544a,'erlangCallToSecond':_0x45c1b0/_0x4b544a,'erlangAbandonmentRate':_0x456388,'erlangBusyFactor':_0x361619});});};Dialer[_0x3683('0x19')][_0x3683('0x1d9')]=function(_0x29d955,_0x71c667,_0x3f6a1f,_0x71248f,_0xe7f46c,_0x4278b3){loggerPredictive['info'](_0x3683('0x217'));loggerPredictive[_0x3683('0x81')](_0x3683('0x20e'),_0x29d955);loggerPredictive['info'](_0x3683('0x20f'),_0x71c667);loggerPredictive[_0x3683('0x81')](_0x3683('0x210'),_0x3f6a1f);loggerPredictive[_0x3683('0x81')](_0x3683('0x218'),_0x71248f);loggerPredictive[_0x3683('0x81')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe7f46c);loggerPredictive[_0x3683('0x81')](_0x3683('0x88'));return new BPromise(function(_0x30347b,_0x118cac){if(_0x29d955<=0x0||isNaN(_0x29d955)){return _0x118cac(msgResponse(_0x3683('0x219'),_0x3683('0x48'),_0x3683('0x21a')+_0x29d955));}if(_0x3f6a1f<=0x0||isNaN(_0x3f6a1f)){return _0x118cac(msgResponse(_0x3683('0x219'),_0x3683('0x48'),_0x3683('0x213')+_0x3f6a1f));}if(_0x71248f<=0x0||isNaN(_0x71248f)){return _0x118cac(msgResponse(_0x3683('0x219'),_0x3683('0x48'),_0x3683('0x214')+_0x71248f));}if(_0x71c667<=0x0||isNaN(_0x71c667)){return _0x118cac(msgResponse(_0x3683('0x219'),'Error',_0x3683('0x215')+_0x71c667));}if(_0xe7f46c<=0x0||isNaN(_0xe7f46c)){return _0x118cac(msgResponse(_0x3683('0x219'),_0x3683('0x48'),_0x3683('0x21b')+_0xe7f46c));}_0x4278b3=_0x4278b3||0x0;var _0x1c8b3b=0x1/_0x3f6a1f;var _0x2b7d41=0x0;var _0x3d4d23=0x0;var _0x5a414b=0x0;var _0x410b8f=0x0;for(var _0xa112e2=0x0;_0x410b8f<_0xe7f46c;_0xa112e2+=0x1){_0x3d4d23=_0xa112e2/_0x71c667;_0x2b7d41=(_0x71248f*_0x3d4d23+_0x4278b3)/_0x1c8b3b;_0x5a414b=erlangb(_0x2b7d41,_0x29d955);_0x410b8f=_0x2b7d41/_0x29d955*(0x1-erlangb(_0x2b7d41,_0x29d955));}return _0x30347b({'erlangCalls':_0xa112e2,'erlangCallToSecond':_0x71c667/_0xa112e2,'erlangAbandonmentRate':_0x5a414b,'erlangBusyFactor':_0x410b8f});});};module['exports']=Dialer;
\ No newline at end of file
index 46f5a13..674194d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaabe=['connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','number','responsetime','droptime','endtime','ringtime','starttime','holdtime','membername'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xaabe,0x8f));var _0xeaab=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xaabe[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require('util');var _=require(_0xeaab('0x0'));var moment=require('moment');function getSeconds(_0x3f6110,_0x23b99c){var _0x81235e=moment(_0x3f6110)[_0xeaab('0x1')](0x0);var _0x3dc2a4=moment(_0x23b99c)['milliseconds'](0x0);return _0x81235e[_0xeaab('0x2')](_0x3dc2a4,_0xeaab('0x3'));}function QueueCallerAbandon(_0x1ff8b2,_0x374d35){this[_0xeaab('0x4')]=_0x1ff8b2['scheduledat'];this[_0xeaab('0x5')]=_0x1ff8b2[_0xeaab('0x5')];this[_0xeaab('0x6')]=_0x1ff8b2[_0xeaab('0x5')]===_0xeaab('0x7')?_0xeaab('0x8'):_0x1ff8b2['type'];this[_0xeaab('0x9')]=_0x1ff8b2['countbusyretry'];this[_0xeaab('0xa')]=_0x1ff8b2['countcongestionretry'];this[_0xeaab('0xb')]=_0x1ff8b2[_0xeaab('0xb')];this[_0xeaab('0xc')]=_0x1ff8b2[_0xeaab('0x9')]+_0x1ff8b2[_0xeaab('0xa')]+_0x1ff8b2['countnoanswerretry']+_0x1ff8b2['countnosuchnumberretry']+_0x1ff8b2[_0xeaab('0xd')]+_0x1ff8b2[_0xeaab('0xe')]+_0x1ff8b2['countmachineretry']+_0x1ff8b2[_0xeaab('0xf')];this['countnosuchnumberretry']=_0x1ff8b2[_0xeaab('0x10')];this[_0xeaab('0xd')]=_0x1ff8b2[_0xeaab('0xd')];this[_0xeaab('0xe')]=_0x1ff8b2[_0xeaab('0xe')];this[_0xeaab('0x11')]=_0x1ff8b2[_0xeaab('0x11')];this['countagentrejectretry']=_0x1ff8b2[_0xeaab('0xf')];this[_0xeaab('0x12')]=_0x374d35[_0xeaab('0x12')];this[_0xeaab('0x13')]=_0x1ff8b2[_0xeaab('0x14')];this['calleridnum']=_0x1ff8b2[_0xeaab('0x15')];this['starttime']=_0x1ff8b2['starttime'];this[_0xeaab('0x16')]=_0x1ff8b2['responsetime'];this[_0xeaab('0x17')]=_0x1ff8b2[_0xeaab('0x17')];this[_0xeaab('0x18')]=this[_0xeaab('0x17')];this[_0xeaab('0x19')]=getSeconds(_0x1ff8b2[_0xeaab('0x16')],_0x1ff8b2[_0xeaab('0x1a')]);this[_0xeaab('0x1b')]=getSeconds(this[_0xeaab('0x17')],_0x1ff8b2[_0xeaab('0x16')]);this['talktime']=0x0;this[_0xeaab('0x8')]=_0x374d35[_0xeaab('0x8')];this[_0xeaab('0x1c')]=_0x374d35[_0xeaab('0x1d')];this[_0xeaab('0x1e')]=_0x374d35[_0xeaab('0x1e')];this['callback']=_0x1ff8b2[_0xeaab('0x1f')];this[_0xeaab('0x20')]=_0x1ff8b2[_0xeaab('0x20')];this[_0xeaab('0x21')]=_0x1ff8b2[_0xeaab('0x21')];this['recallme']=_0x1ff8b2[_0xeaab('0x22')];this[_0xeaab('0x23')]=_0x1ff8b2['ContactId'];this[_0xeaab('0x24')]=_0x1ff8b2[_0xeaab('0x24')];this[_0xeaab('0x25')]=_0x1ff8b2[_0xeaab('0x25')];this[_0xeaab('0x26')]=_0x1ff8b2[_0xeaab('0x26')];this['CampaignId']=_0x1ff8b2[_0xeaab('0x27')];this[_0xeaab('0x28')]=_0x1ff8b2[_0xeaab('0x28')]||'';this[_0xeaab('0x29')]=_0x1ff8b2[_0xeaab('0x29')]||'';}module[_0xeaab('0x2a')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x901d=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x2301c1,_0x3c5a47){var _0x28f1eb=function(_0x6a6bb){while(--_0x6a6bb){_0x2301c1['push'](_0x2301c1['shift']());}};_0x28f1eb(++_0x3c5a47);}(_0x901d,0xb7));var _0xd901=function(_0x1f2b9a,_0x16f398){_0x1f2b9a=_0x1f2b9a-0x0;var _0x4d12a2=_0x901d[_0x1f2b9a];return _0x4d12a2;};'use strict';var util=require(_0xd901('0x0'));var _=require(_0xd901('0x1'));var moment=require('moment');function getSeconds(_0x51b4a7,_0x50e9df){var _0x182a6c=moment(_0x51b4a7)[_0xd901('0x2')](0x0);var _0xf51780=moment(_0x50e9df)[_0xd901('0x2')](0x0);return _0x182a6c[_0xd901('0x3')](_0xf51780,'seconds');}function QueueCallerAbandon(_0x1e5753,_0x332e38){this[_0xd901('0x4')]=_0x1e5753[_0xd901('0x4')];this[_0xd901('0x5')]=_0x1e5753[_0xd901('0x5')];this['campaigntype']=_0x1e5753[_0xd901('0x5')]===_0xd901('0x6')?_0xd901('0x7'):_0x1e5753[_0xd901('0x5')];this[_0xd901('0x8')]=_0x1e5753[_0xd901('0x8')];this[_0xd901('0x9')]=_0x1e5753[_0xd901('0x9')];this[_0xd901('0xa')]=_0x1e5753[_0xd901('0xa')];this[_0xd901('0xb')]=_0x1e5753[_0xd901('0x8')]+_0x1e5753['countcongestionretry']+_0x1e5753[_0xd901('0xa')]+_0x1e5753['countnosuchnumberretry']+_0x1e5753[_0xd901('0xc')]+_0x1e5753[_0xd901('0xd')]+_0x1e5753[_0xd901('0xe')]+_0x1e5753['countagentrejectretry'];this['countnosuchnumberretry']=_0x1e5753['countnosuchnumberretry'];this[_0xd901('0xc')]=_0x1e5753['countdropretry'];this['countabandonedretry']=_0x1e5753[_0xd901('0xd')];this['countmachineretry']=_0x1e5753[_0xd901('0xe')];this[_0xd901('0xf')]=_0x1e5753['countagentrejectretry'];this['uniqueid']=_0x332e38[_0xd901('0x10')];this[_0xd901('0x11')]=_0x1e5753['name'];this[_0xd901('0x12')]=_0x1e5753[_0xd901('0x13')];this[_0xd901('0x14')]=_0x1e5753[_0xd901('0x14')];this[_0xd901('0x15')]=_0x1e5753[_0xd901('0x15')];this[_0xd901('0x16')]=_0x1e5753[_0xd901('0x16')];this[_0xd901('0x17')]=this[_0xd901('0x16')];this[_0xd901('0x18')]=getSeconds(_0x1e5753[_0xd901('0x15')],_0x1e5753[_0xd901('0x14')]);this[_0xd901('0x19')]=getSeconds(this[_0xd901('0x16')],_0x1e5753[_0xd901('0x15')]);this['talktime']=0x0;this['queue']=_0x332e38[_0xd901('0x7')];this[_0xd901('0x1a')]=_0x332e38[_0xd901('0x1b')];this[_0xd901('0x1c')]=_0x332e38[_0xd901('0x1c')];this[_0xd901('0x1d')]=_0x1e5753['callback'];this[_0xd901('0x1e')]=_0x1e5753[_0xd901('0x1e')];this['callbackat']=_0x1e5753['callbackat'];this[_0xd901('0x1f')]=_0x1e5753[_0xd901('0x1f')];this[_0xd901('0x20')]=_0x1e5753[_0xd901('0x20')];this[_0xd901('0x21')]=_0x1e5753[_0xd901('0x21')];this['UserId']=_0x1e5753['UserId'];this[_0xd901('0x22')]=_0x1e5753['VoiceQueueId'];this[_0xd901('0x23')]=_0x1e5753[_0xd901('0x23')];this[_0xd901('0x24')]=_0x1e5753[_0xd901('0x24')]||'';this[_0xd901('0x25')]=_0x1e5753[_0xd901('0x25')]||'';}module[_0xd901('0x26')]=QueueCallerAbandon;
\ No newline at end of file
index 8e5d408..581b5a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea2f=['channel','format','%s/%s/%s','tech','Trunk','fax','localstationid','headerinfo','path','lodash','uniqueid'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xea2f,0x17f));var _0xfea2=function(_0x585d7b,_0x1ee816){_0x585d7b=_0x585d7b-0x0;var _0x4adfc9=_0xea2f[_0x585d7b];return _0x4adfc9;};'use strict';var util=require('util');var _=require(_0xfea2('0x0'));var moment=require('moment');function Action(_0x18fe5a,_0x597118,_0x56c9c6){this[_0xfea2('0x1')]=_0x18fe5a||undefined;this[_0xfea2('0x2')]=util[_0xfea2('0x3')](_0xfea2('0x4'),_0x597118[_0xfea2('0x5')],_0x597118[_0xfea2('0x6')]['name'],_0x56c9c6[_0xfea2('0x7')]);this[_0xfea2('0x8')]=_0x597118[_0xfea2('0x8')];this[_0xfea2('0x9')]=_0x597118['headerinfo'];this['path']=_0x56c9c6[_0xfea2('0xa')];this['AttachmentId']=_0x56c9c6['AttachmentId'];}module['exports']=Action;
\ No newline at end of file
+var _0x6300=['uniqueid','format','%s/%s/%s','name','fax','localstationid','headerinfo','path','AttachmentId','exports','util','lodash','moment'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0x6300,0x19d));var _0x0630=function(_0x58e2be,_0x26516a){_0x58e2be=_0x58e2be-0x0;var _0x324e60=_0x6300[_0x58e2be];return _0x324e60;};'use strict';var util=require(_0x0630('0x0'));var _=require(_0x0630('0x1'));var moment=require(_0x0630('0x2'));function Action(_0x2a5220,_0x43337d,_0xeefe95){this[_0x0630('0x3')]=_0x2a5220||undefined;this['channel']=util[_0x0630('0x4')](_0x0630('0x5'),_0x43337d['tech'],_0x43337d['Trunk'][_0x0630('0x6')],_0xeefe95[_0x0630('0x7')]);this[_0x0630('0x8')]=_0x43337d[_0x0630('0x8')];this[_0x0630('0x9')]=_0x43337d[_0x0630('0x9')];this[_0x0630('0xa')]=_0xeefe95[_0x0630('0xa')];this[_0x0630('0xb')]=_0xeefe95[_0x0630('0xb')];}module[_0x0630('0xc')]=Action;
\ No newline at end of file
index 2fa9f0a..59c9c4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37cf=['send','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','localstationid','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','then','catch','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','updateStatus','faxstatusstring'];(function(_0x169f51,_0x1d4cd1){var _0x1cfe54=function(_0x55e1cb){while(--_0x55e1cb){_0x169f51['push'](_0x169f51['shift']());}};_0x1cfe54(++_0x1d4cd1);}(_0x37cf,0x1f0));var _0xf37c=function(_0x192eee,_0x5c6d10){_0x192eee=_0x192eee-0x0;var _0xacfcd2=_0x37cf[_0x192eee];return _0xacfcd2;};'use strict';var util=require(_0xf37c('0x0'));var _=require(_0xf37c('0x1'));var BPromise=require('bluebird');var uuid=require(_0xf37c('0x2'));var moment=require(_0xf37c('0x3'));var path=require(_0xf37c('0x4'));var tiff2pdf=require(_0xf37c('0x5'));var gs=require(_0xf37c('0x6'));var logger=require(_0xf37c('0x7'))(_0xf37c('0x8'));var ami=require(_0xf37c('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0xf37c('0xa'));var ut=require(_0xf37c('0xb'));var Action=require(_0xf37c('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0xf37c('0xd'));function Fax(_0x351796){this[_0xf37c('0xe')]={};this['faxAccounts']=_0x351796[_0xf37c('0xf')];this[_0xf37c('0x10')]=_0x351796['trunks'];this[_0xf37c('0x11')]={};ami['on'](_0xf37c('0x12'),this['syncNewchannel'][_0xf37c('0x13')](this));ami['on'](_0xf37c('0x14'),this[_0xf37c('0x15')][_0xf37c('0x13')](this));ami['on'](_0xf37c('0x16'),this[_0xf37c('0x17')][_0xf37c('0x13')](this));ami['on'](_0xf37c('0x18'),this['syncNewExten'][_0xf37c('0x13')](this));ami['on'](_0xf37c('0x19'),this[_0xf37c('0x1a')][_0xf37c('0x13')](this));ami['on'](_0xf37c('0x1b'),this[_0xf37c('0x1c')][_0xf37c('0x13')](this));ami['on'](_0xf37c('0x1d'),this[_0xf37c('0x1e')]['bind'](this));ami['on'](_0xf37c('0x1f'),this['syncOriginateResponse'][_0xf37c('0x13')](this));}Fax[_0xf37c('0x20')]['syncNewchannel']=function(_0x1f7591){if(_0x1f7591[_0xf37c('0x21')]===_0xf37c('0x22')){for(var _0x1b4b45 in this[_0xf37c('0xf')]){if(this[_0xf37c('0xf')][_0xf37c('0x23')](_0x1b4b45)){if(_0x1f7591[_0xf37c('0x24')]===this[_0xf37c('0xf')][_0x1b4b45]['localstationid']){this[_0xf37c('0xe')][_0x1f7591[_0xf37c('0x25')]]={};this['channels'][_0x1f7591[_0xf37c('0x25')]][_0xf37c('0x26')]=_0x1f7591[_0xf37c('0x26')];this[_0xf37c('0xe')][_0x1f7591[_0xf37c('0x25')]]['id']=this[_0xf37c('0xf')][_0x1b4b45]['id'];this['channels'][_0x1f7591[_0xf37c('0x25')]][_0xf37c('0x27')]=this[_0xf37c('0xf')][_0x1b4b45][_0xf37c('0x27')];logger[_0xf37c('0x28')](_0x1f7591['uniqueid'],_0xf37c('0x29'));}}}}if(this['actions'][_0x1f7591[_0xf37c('0x25')]]){this[_0xf37c('0xe')][_0x1f7591[_0xf37c('0x25')]]={};this['channels'][_0x1f7591[_0xf37c('0x25')]][_0xf37c('0x26')]=_0x1f7591['channel'];logger[_0xf37c('0x28')](_0x1f7591['uniqueid'],_0xf37c('0x29'));}};Fax['prototype'][_0xf37c('0x15')]=function(_0x4b1a18){if(this[_0xf37c('0xe')][_0x4b1a18[_0xf37c('0x25')]]){for(var _0x3d1a72 in _0x4b1a18[_0xf37c('0x2a')]){if(_0x4b1a18['variable'][_0xf37c('0x23')](_0x3d1a72)){this[_0xf37c('0xe')][_0x4b1a18[_0xf37c('0x25')]][_0x3d1a72]=_0x4b1a18['value'];}}}};Fax[_0xf37c('0x20')][_0xf37c('0x17')]=function(_0x2ab974){if(this[_0xf37c('0xe')][_0x2ab974[_0xf37c('0x25')]]){this[_0xf37c('0xe')][_0x2ab974[_0xf37c('0x25')]][_0xf37c('0x2b')]=_0x2ab974[_0xf37c('0x2b')];this[_0xf37c('0xe')][_0x2ab974[_0xf37c('0x25')]][_0xf37c('0x2c')]=_0x2ab974[_0xf37c('0x2c')];}};Fax[_0xf37c('0x20')]['syncNewExten']=function(_0xdf45f){if(this[_0xf37c('0xe')][_0xdf45f['uniqueid']]){for(var _0xf32f6d in _0xdf45f[_0xf37c('0x2a')]){if(_0xdf45f['variable'][_0xf37c('0x23')](_0xf32f6d)){this[_0xf37c('0xe')][_0xdf45f[_0xf37c('0x25')]][_0xf32f6d]=_0xdf45f[_0xf37c('0x2d')];}}}};Fax[_0xf37c('0x20')]['syncFaxStatus']=function(_0x411af3){if(this[_0xf37c('0xe')][_0x411af3[_0xf37c('0x25')]]){this[_0xf37c('0xe')][_0x411af3[_0xf37c('0x25')]][_0xf37c('0x2e')]=_0x411af3['operation'];this[_0xf37c('0xe')][_0x411af3[_0xf37c('0x25')]]['status']=_0x411af3[_0xf37c('0x2f')];this['channels'][_0x411af3[_0xf37c('0x25')]][_0xf37c('0x30')]=_0x411af3['localstationid'];this[_0xf37c('0xe')][_0x411af3[_0xf37c('0x25')]][_0xf37c('0x31')]=_0x411af3[_0xf37c('0x31')];logger[_0xf37c('0x28')](_0x411af3['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0xf37c('0x20')]['syncReceiveFax']=function(_0x199e4e){var _0x27cb2b=this;if(this[_0xf37c('0xe')][_0x199e4e[_0xf37c('0x25')]]){var _0x4b848b=this['channels'][_0x199e4e['uniqueid']]['id'];this[_0xf37c('0xe')][_0x199e4e[_0xf37c('0x25')]][_0xf37c('0x32')]=_0x199e4e[_0xf37c('0x32')];this['channels'][_0x199e4e[_0xf37c('0x25')]][_0xf37c('0x33')]=_0x199e4e['pagestransferred'];this[_0xf37c('0xe')][_0x199e4e['uniqueid']]['localstationid']=_0x199e4e[_0xf37c('0x30')];this['channels'][_0x199e4e[_0xf37c('0x25')]]['resolution']=_0x199e4e[_0xf37c('0x34')];this[_0xf37c('0xe')][_0x199e4e[_0xf37c('0x25')]][_0xf37c('0x35')]=_0x199e4e[_0xf37c('0x35')];this[_0xf37c('0xe')][_0x199e4e[_0xf37c('0x25')]]['filename']=_0x199e4e[_0xf37c('0x31')];this['channels'][_0x199e4e[_0xf37c('0x25')]][_0xf37c('0x36')]=_0x199e4e[_0xf37c('0x36')];if(this[_0xf37c('0xe')][_0x199e4e[_0xf37c('0x25')]]['pagestransferred']>0x0){tiff2pdf(_0x199e4e['filename'],_0xf37c('0x37'),function(_0x3f99e6){logger[_0xf37c('0x28')](_0x199e4e['uniqueid'],_0xf37c('0x38'),_0x3f99e6[_0xf37c('0x39')]);attachment['create']({'name':path[_0xf37c('0x3a')](_0x199e4e[_0xf37c('0x31')])[_0xf37c('0x27')],'basename':path['parse'](_0x199e4e[_0xf37c('0x31')])[_0xf37c('0x27')]+_0xf37c('0x3b'),'type':'application/pdf'})[_0xf37c('0x3c')](function(_0x53806f){faxAccount['notify'](_0x4b848b,{'from':_0x199e4e[_0xf37c('0x36')],'mapKey':_0xf37c('0x8'),'body':path[_0xf37c('0x3a')](_0x199e4e[_0xf37c('0x31')])[_0xf37c('0x27')]+_0xf37c('0x3b'),'AttachmentId':_0x53806f['id']})[_0xf37c('0x3d')](function(_0x331562){logger['error'](_0x199e4e[_0xf37c('0x25')],'\x20notify\x20',JSON[_0xf37c('0x3e')](_0x331562));});})[_0xf37c('0x3d')](function(_0x40aeda){logger['error'](_0x199e4e[_0xf37c('0x25')],_0xf37c('0x3f'),JSON[_0xf37c('0x3e')](_0x40aeda));});});}logger['info'](_0x199e4e[_0xf37c('0x25')],_0xf37c('0x3f'));}};Fax['prototype'][_0xf37c('0x40')]=function(_0xf65943){if(this[_0xf37c('0x11')][_0xf65943[_0xf37c('0x25')]]){_[_0xf37c('0x41')](this[_0xf37c('0xe')][_0xf65943['uniqueid']],_[_0xf37c('0x42')](_0xf65943,['response',_0xf37c('0x43')]));}};function updateStatus(_0x42e668){if(_0x42e668[_0xf37c('0x44')]){faxMessage[_0xf37c('0x45')](_0x42e668[_0xf37c('0x44')],{'failMessage':_0xf37c('0x46')})['then'](function(_0x3bc079){ut[_0xf37c('0x47')](_0xf37c('0x48'),_0x3bc079);})['catch'](function(_0x30ddb3){ut['logger'](_0xf37c('0x49'),_0x30ddb3);});}else{ut[_0xf37c('0x47')](_0xf37c('0x4a'));}}Fax[_0xf37c('0x20')]['updateStatus']=function(_0x5b9b9f,_0x57e5ad,_0x575a4c){var _0x4ef10d=this;var _0x184d84={};if(_0x57e5ad){_0x184d84={'read':_0x57e5ad};}else{_0x184d84={'failMessage':_0x575a4c};}if(this[_0xf37c('0x11')][_0x5b9b9f][_0xf37c('0x44')]){faxMessage['update'](this[_0xf37c('0x11')][_0x5b9b9f]['AttachmentId'],_0x184d84)['then'](function(_0xf2e6dd){ut[_0xf37c('0x47')](_0xf37c('0x4b'),_0xf2e6dd);})[_0xf37c('0x3d')](function(_0x1a27db){ut[_0xf37c('0x47')](_0xf37c('0x4c'),_0x1a27db);})[_0xf37c('0x4d')](function(){delete _0x4ef10d['channels'][_0x5b9b9f];delete _0x4ef10d[_0xf37c('0x11')][_0x5b9b9f];});}else{ut[_0xf37c('0x47')](_0xf37c('0x4e'));delete this[_0xf37c('0xe')][_0x5b9b9f];delete this['actions'][_0x5b9b9f];}};Fax[_0xf37c('0x20')][_0xf37c('0x1e')]=function(_0x387839){var _0xea371f=this;if(this[_0xf37c('0xe')][_0x387839[_0xf37c('0x25')]]){if(this[_0xf37c('0x11')][_0x387839[_0xf37c('0x25')]]){this[_0xf37c('0xe')][_0x387839[_0xf37c('0x25')]]['id']=this[_0xf37c('0x11')][_0x387839['uniqueid']]['id'];this[_0xf37c('0xe')][_0x387839[_0xf37c('0x25')]][_0xf37c('0x27')]=this[_0xf37c('0x11')][_0x387839[_0xf37c('0x25')]]['name'];}logger[_0xf37c('0x28')](_0x387839[_0xf37c('0x25')],this[_0xf37c('0x11')][_0x387839['uniqueid']]?_0xf37c('0x4f'):_0xf37c('0x50'),JSON[_0xf37c('0x3e')](this['channels'][_0x387839['uniqueid']]));if(this[_0xf37c('0x11')][_0x387839['uniqueid']]){if(this['channels'][_0x387839['uniqueid']]['faxpages']>0x0&&this[_0xf37c('0xe')][_0x387839['uniqueid']][_0xf37c('0x19')]===_0xf37c('0x51')){this['updateStatus'](_0x387839[_0xf37c('0x25')],!![]);}else{this[_0xf37c('0x52')](_0x387839[_0xf37c('0x25')],![],this[_0xf37c('0xe')][_0x387839['uniqueid']]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0xf37c('0xe')][_0x387839[_0xf37c('0x25')]][_0xf37c('0x53')]:'SENDING\x20FAILED');}}}};Fax[_0xf37c('0x20')][_0xf37c('0x54')]=function(_0x1258f9){var _0x104eaa=this;return new BPromise(function(_0x259f0c,_0xcca2e1){_0x104eaa[_0xf37c('0x55')](_0x1258f9,_0x104eaa['faxAccounts'][_0x1258f9[_0xf37c('0x56')]])[_0xf37c('0x3c')](function(_0x38aa21){ut[_0xf37c('0x47')]('[Fax][execOriginate][success]',_0x38aa21);_0x259f0c(ut[_0xf37c('0x39')]('Fax\x20received'));})[_0xf37c('0x3d')](function(_0x1f4f00){ut[_0xf37c('0x47')](_0xf37c('0x57'),_0x1f4f00);updateStatus(_0x1258f9);_0xcca2e1(ut[_0xf37c('0x39')](_0xf37c('0x58')));});});};Fax[_0xf37c('0x20')][_0xf37c('0x59')]=function(_0x5b36e0){var _0x43088c=this;return new BPromise(function(_0x1b8c9c,_0x2c2cfb){var _0x4dd372=_0x43088c[_0xf37c('0x5a')](_0x43088c[_0xf37c('0xf')][_0x5b36e0[_0xf37c('0x56')]][_0xf37c('0x5b')],_0x5b36e0);if(_0x4dd372[_0xf37c('0x5c')]){_0x1b8c9c(ut[_0xf37c('0x39')](_0xf37c('0x5d')));}else{_0x2c2cfb(ut[_0xf37c('0x39')](_0x4dd372[_0xf37c('0x39')]));}});};function originate(_0x1c2062,_0x32f504,_0x902973){return new BPromise(function(_0x508966,_0x5c9760){if(_0x902973){var _0x46c442=util[_0xf37c('0x5e')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xf37c('0x3a')](_0x1c2062[_0xf37c('0x4')])[_0xf37c('0x27')],_0x1c2062[_0xf37c('0x4')]);gs['execute'](_0x46c442)['then'](function(){_0x1c2062[_0xf37c('0x4')]=util[_0xf37c('0x5e')](_0xf37c('0x5f'),path[_0xf37c('0x3a')](_0x1c2062[_0xf37c('0x4')])[_0xf37c('0x60')],path['parse'](_0x1c2062[_0xf37c('0x4')])['name']);_0x32f504[_0xf37c('0x61')]=_0x1c2062['path'];ut[_0xf37c('0x47')](_0xf37c('0x62'),'');ami[_0xf37c('0x63')](ut[_0xf37c('0x64')](_0x1c2062,_0x32f504))[_0xf37c('0x3c')](function(_0x36b7de){_0x508966(_0x36b7de);})['catch'](function(_0x317f3a){_0x5c9760(_0x317f3a);});})['catch'](function(_0x347b3c){_0x5c9760(_0x347b3c);});}else{ami[_0xf37c('0x63')](ut[_0xf37c('0x64')](_0x1c2062,_0x32f504))[_0xf37c('0x3c')](function(_0x4d91ef){_0x508966(_0x4d91ef);})['catch'](function(_0x39576a){_0x5c9760(_0x39576a);});}});}Fax[_0xf37c('0x20')][_0xf37c('0x55')]=function(_0x14f4a2,_0x37c3de){var _0x1d57ad=this;return new BPromise(function(_0x1e9f95,_0xc9a2a2){var _0x3e4114=uuid['v4']();var _0x2a6802=ut[_0xf37c('0x65')](_0x14f4a2,_0x37c3de);_0x1d57ad['actions'][_0x3e4114]=new Action(_0x3e4114,_0x37c3de,_0x14f4a2);var _0x2fa39b=_0x1d57ad[_0xf37c('0x11')][_0x3e4114];if(path[_0xf37c('0x3a')](_0x14f4a2[_0xf37c('0x4')])['ext']===_0xf37c('0x3b')){originate(_0x2fa39b,_0x2a6802,!![])[_0xf37c('0x3c')](function(_0x460fe2){_0x1e9f95(_0x460fe2);})[_0xf37c('0x3d')](function(_0x5cdf9e){_0xc9a2a2(_0x5cdf9e);});}else{originate(_0x2fa39b,_0x2a6802,![])[_0xf37c('0x3c')](function(_0x4dcdc9){_0x1e9f95(_0x4dcdc9);})[_0xf37c('0x3d')](function(_0x14829c){_0xc9a2a2(_0x14829c);});}});};Fax[_0xf37c('0x20')][_0xf37c('0x66')]=function(_0x5dd08e){return!_[_0xf37c('0x67')](_0x5dd08e)&&!_['isNil'](_0x5dd08e['name'])&&!_[_0xf37c('0x67')](_0x5dd08e['active'])&&_0x5dd08e[_0xf37c('0x68')]&&!_[_0xf37c('0x67')](this[_0xf37c('0x10')][util[_0xf37c('0x5e')](_0xf37c('0x69'),_0x5dd08e[_0xf37c('0x27')])])&&!_[_0xf37c('0x67')](this[_0xf37c('0x10')][util[_0xf37c('0x5e')](_0xf37c('0x69'),_0x5dd08e[_0xf37c('0x27')])][_0xf37c('0x2f')])&&(this[_0xf37c('0x10')][util[_0xf37c('0x5e')](_0xf37c('0x69'),_0x5dd08e[_0xf37c('0x27')])][_0xf37c('0x2f')]===_0xf37c('0x6a')||this[_0xf37c('0x10')][util['format']('SIP/%s',_0x5dd08e['name'])][_0xf37c('0x2f')]===_0xf37c('0x6b'));};Fax['prototype'][_0xf37c('0x5a')]=function(_0x3204cb,_0x4c0935){if(!this[_0xf37c('0x66')](_0x3204cb)){ut['logger'](_0xf37c('0x6c'),_[_0xf37c('0x67')](_0x3204cb)?'':_0x3204cb[_0xf37c('0x27')]+_0xf37c('0x6d'));return{'isValid':![],'message':_0xf37c('0x6e')};}if(_['isNil'](_0x4c0935[_0xf37c('0x8')])){ut[_0xf37c('0x47')](_0xf37c('0x6f'),JSON['stringify'](_0x4c0935));return{'isValid':![],'message':_0xf37c('0x70')};}if(_[_0xf37c('0x67')](_0x4c0935[_0xf37c('0x4')])){ut[_0xf37c('0x47')](_0xf37c('0x71'),JSON['stringify'](_0x4c0935));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xf37c('0x72')};};module[_0xf37c('0x73')]=Fax;
\ No newline at end of file
+var _0xc925=['./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','catch','error','stringify','\x20receiveFax\x20','merge','pick','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xc925,0xe8));var _0x5c92=function(_0x522a6a,_0x43cf01){_0x522a6a=_0x522a6a-0x0;var _0x55e3df=_0xc925[_0x522a6a];return _0x55e3df;};'use strict';var util=require(_0x5c92('0x0'));var _=require(_0x5c92('0x1'));var BPromise=require(_0x5c92('0x2'));var uuid=require('uuid');var moment=require(_0x5c92('0x3'));var path=require(_0x5c92('0x4'));var tiff2pdf=require(_0x5c92('0x5'));var gs=require(_0x5c92('0x6'));var logger=require(_0x5c92('0x7'))(_0x5c92('0x8'));var ami=require(_0x5c92('0x9'));var rpcDb=require(_0x5c92('0xa'));var Channel=require(_0x5c92('0xb'));var ut=require(_0x5c92('0xc'));var Action=require(_0x5c92('0xd'));var faxAccount=require(_0x5c92('0xe'));var attachment=require(_0x5c92('0xf'));var faxMessage=require(_0x5c92('0x10'));function Fax(_0x188c08){this[_0x5c92('0x11')]={};this[_0x5c92('0x12')]=_0x188c08['faxAccounts'];this[_0x5c92('0x13')]=_0x188c08[_0x5c92('0x13')];this[_0x5c92('0x14')]={};ami['on'](_0x5c92('0x15'),this[_0x5c92('0x16')][_0x5c92('0x17')](this));ami['on'](_0x5c92('0x18'),this[_0x5c92('0x19')][_0x5c92('0x17')](this));ami['on']('newstate',this[_0x5c92('0x1a')][_0x5c92('0x17')](this));ami['on'](_0x5c92('0x1b'),this[_0x5c92('0x1c')]['bind'](this));ami['on'](_0x5c92('0x1d'),this[_0x5c92('0x1e')][_0x5c92('0x17')](this));ami['on']('receivefax',this['syncReceiveFax'][_0x5c92('0x17')](this));ami['on'](_0x5c92('0x1f'),this[_0x5c92('0x20')][_0x5c92('0x17')](this));ami['on'](_0x5c92('0x21'),this[_0x5c92('0x22')][_0x5c92('0x17')](this));}Fax[_0x5c92('0x23')]['syncNewchannel']=function(_0x5c8442){if(_0x5c8442[_0x5c92('0x24')]===_0x5c92('0x25')){for(var _0x250a47 in this['faxAccounts']){if(this[_0x5c92('0x12')][_0x5c92('0x26')](_0x250a47)){if(_0x5c8442[_0x5c92('0x27')]===this[_0x5c92('0x12')][_0x250a47][_0x5c92('0x28')]){this['channels'][_0x5c8442[_0x5c92('0x29')]]={};this[_0x5c92('0x11')][_0x5c8442['uniqueid']]['channel']=_0x5c8442[_0x5c92('0x2a')];this[_0x5c92('0x11')][_0x5c8442[_0x5c92('0x29')]]['id']=this[_0x5c92('0x12')][_0x250a47]['id'];this['channels'][_0x5c8442[_0x5c92('0x29')]][_0x5c92('0x2b')]=this[_0x5c92('0x12')][_0x250a47][_0x5c92('0x2b')];logger[_0x5c92('0x2c')](_0x5c8442['uniqueid'],_0x5c92('0x2d'));}}}}if(this[_0x5c92('0x14')][_0x5c8442[_0x5c92('0x29')]]){this['channels'][_0x5c8442[_0x5c92('0x29')]]={};this[_0x5c92('0x11')][_0x5c8442['uniqueid']][_0x5c92('0x2a')]=_0x5c8442[_0x5c92('0x2a')];logger[_0x5c92('0x2c')](_0x5c8442[_0x5c92('0x29')],_0x5c92('0x2d'));}};Fax['prototype'][_0x5c92('0x19')]=function(_0xbe2e13){if(this['channels'][_0xbe2e13[_0x5c92('0x29')]]){for(var _0xe28d42 in _0xbe2e13[_0x5c92('0x2e')]){if(_0xbe2e13[_0x5c92('0x2e')][_0x5c92('0x26')](_0xe28d42)){this[_0x5c92('0x11')][_0xbe2e13[_0x5c92('0x29')]][_0xe28d42]=_0xbe2e13[_0x5c92('0x2f')];}}}};Fax[_0x5c92('0x23')][_0x5c92('0x1a')]=function(_0x38aaf1){if(this[_0x5c92('0x11')][_0x38aaf1[_0x5c92('0x29')]]){this[_0x5c92('0x11')][_0x38aaf1[_0x5c92('0x29')]][_0x5c92('0x30')]=_0x38aaf1['channelstate'];this[_0x5c92('0x11')][_0x38aaf1['uniqueid']][_0x5c92('0x31')]=_0x38aaf1[_0x5c92('0x31')];}};Fax['prototype'][_0x5c92('0x1c')]=function(_0x3a0ba0){if(this[_0x5c92('0x11')][_0x3a0ba0['uniqueid']]){for(var _0x5062b1 in _0x3a0ba0[_0x5c92('0x2e')]){if(_0x3a0ba0[_0x5c92('0x2e')][_0x5c92('0x26')](_0x5062b1)){this[_0x5c92('0x11')][_0x3a0ba0[_0x5c92('0x29')]][_0x5062b1]=_0x3a0ba0[_0x5c92('0x2f')];}}}};Fax['prototype'][_0x5c92('0x1e')]=function(_0x114497){if(this['channels'][_0x114497['uniqueid']]){this[_0x5c92('0x11')][_0x114497[_0x5c92('0x29')]][_0x5c92('0x32')]=_0x114497[_0x5c92('0x32')];this[_0x5c92('0x11')][_0x114497[_0x5c92('0x29')]][_0x5c92('0x33')]=_0x114497['status'];this[_0x5c92('0x11')][_0x114497[_0x5c92('0x29')]]['localstationid']=_0x114497[_0x5c92('0x28')];this[_0x5c92('0x11')][_0x114497[_0x5c92('0x29')]]['filename']=_0x114497[_0x5c92('0x34')];logger[_0x5c92('0x2c')](_0x114497[_0x5c92('0x29')],_0x5c92('0x35'));}};Fax['prototype'][_0x5c92('0x36')]=function(_0x15f901){var _0x187ad0=this;if(this[_0x5c92('0x11')][_0x15f901['uniqueid']]){var _0x582bef=this[_0x5c92('0x11')][_0x15f901[_0x5c92('0x29')]]['id'];this[_0x5c92('0x11')][_0x15f901[_0x5c92('0x29')]][_0x5c92('0x37')]=_0x15f901['remotestationid'];this[_0x5c92('0x11')][_0x15f901[_0x5c92('0x29')]][_0x5c92('0x38')]=_0x15f901[_0x5c92('0x38')];this['channels'][_0x15f901['uniqueid']][_0x5c92('0x28')]=_0x15f901[_0x5c92('0x28')];this['channels'][_0x15f901['uniqueid']][_0x5c92('0x39')]=_0x15f901[_0x5c92('0x39')];this[_0x5c92('0x11')][_0x15f901[_0x5c92('0x29')]][_0x5c92('0x3a')]=_0x15f901[_0x5c92('0x3a')];this[_0x5c92('0x11')][_0x15f901[_0x5c92('0x29')]][_0x5c92('0x34')]=_0x15f901[_0x5c92('0x34')];this['channels'][_0x15f901['uniqueid']][_0x5c92('0x3b')]=_0x15f901[_0x5c92('0x3b')];if(this['channels'][_0x15f901[_0x5c92('0x29')]][_0x5c92('0x38')]>0x0){tiff2pdf(_0x15f901[_0x5c92('0x34')],_0x5c92('0x3c'),function(_0x858a57){logger[_0x5c92('0x2c')](_0x15f901[_0x5c92('0x29')],_0x5c92('0x3d'),_0x858a57[_0x5c92('0x3e')]);attachment[_0x5c92('0x3f')]({'name':path['parse'](_0x15f901[_0x5c92('0x34')])['name'],'basename':path[_0x5c92('0x40')](_0x15f901[_0x5c92('0x34')])[_0x5c92('0x2b')]+_0x5c92('0x41'),'type':'application/pdf'})[_0x5c92('0x42')](function(_0x4420b7){faxAccount[_0x5c92('0x43')](_0x582bef,{'from':_0x15f901[_0x5c92('0x3b')],'mapKey':_0x5c92('0x8'),'body':path['parse'](_0x15f901[_0x5c92('0x34')])[_0x5c92('0x2b')]+'.pdf','AttachmentId':_0x4420b7['id']})[_0x5c92('0x44')](function(_0x245575){logger[_0x5c92('0x45')](_0x15f901[_0x5c92('0x29')],'\x20notify\x20',JSON[_0x5c92('0x46')](_0x245575));});})['catch'](function(_0x4a35f7){logger[_0x5c92('0x45')](_0x15f901[_0x5c92('0x29')],_0x5c92('0x47'),JSON[_0x5c92('0x46')](_0x4a35f7));});});}logger[_0x5c92('0x2c')](_0x15f901[_0x5c92('0x29')],_0x5c92('0x47'));}};Fax['prototype'][_0x5c92('0x22')]=function(_0x3c8dcb){if(this['actions'][_0x3c8dcb[_0x5c92('0x29')]]){_[_0x5c92('0x48')](this[_0x5c92('0x11')][_0x3c8dcb['uniqueid']],_[_0x5c92('0x49')](_0x3c8dcb,['response',_0x5c92('0x4a')]));}};function updateStatus(_0x2314ec){if(_0x2314ec[_0x5c92('0x4b')]){faxMessage[_0x5c92('0x4c')](_0x2314ec[_0x5c92('0x4b')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x5c92('0x42')](function(_0x4aaf8e){ut[_0x5c92('0x4d')](_0x5c92('0x4e'),_0x4aaf8e);})[_0x5c92('0x44')](function(_0x580d7c){ut[_0x5c92('0x4d')](_0x5c92('0x4f'),_0x580d7c);});}else{ut[_0x5c92('0x4d')](_0x5c92('0x50'));}}Fax[_0x5c92('0x23')][_0x5c92('0x51')]=function(_0x23441e,_0x2c3c1f,_0x3b08be){var _0x54554c=this;var _0x4bec8f={};if(_0x2c3c1f){_0x4bec8f={'read':_0x2c3c1f};}else{_0x4bec8f={'failMessage':_0x3b08be};}if(this[_0x5c92('0x14')][_0x23441e]['AttachmentId']){faxMessage[_0x5c92('0x4c')](this[_0x5c92('0x14')][_0x23441e][_0x5c92('0x4b')],_0x4bec8f)[_0x5c92('0x42')](function(_0x8019da){ut[_0x5c92('0x4d')](_0x5c92('0x52'),_0x8019da);})[_0x5c92('0x44')](function(_0x4d88d0){ut[_0x5c92('0x4d')](_0x5c92('0x53'),_0x4d88d0);})[_0x5c92('0x54')](function(){delete _0x54554c[_0x5c92('0x11')][_0x23441e];delete _0x54554c['actions'][_0x23441e];});}else{ut[_0x5c92('0x4d')](_0x5c92('0x55'));delete this[_0x5c92('0x11')][_0x23441e];delete this[_0x5c92('0x14')][_0x23441e];}};Fax['prototype'][_0x5c92('0x20')]=function(_0x2f0f6a){var _0x164f94=this;if(this[_0x5c92('0x11')][_0x2f0f6a[_0x5c92('0x29')]]){if(this[_0x5c92('0x14')][_0x2f0f6a[_0x5c92('0x29')]]){this[_0x5c92('0x11')][_0x2f0f6a[_0x5c92('0x29')]]['id']=this[_0x5c92('0x14')][_0x2f0f6a[_0x5c92('0x29')]]['id'];this[_0x5c92('0x11')][_0x2f0f6a[_0x5c92('0x29')]][_0x5c92('0x2b')]=this['actions'][_0x2f0f6a[_0x5c92('0x29')]][_0x5c92('0x2b')];}logger['info'](_0x2f0f6a[_0x5c92('0x29')],this[_0x5c92('0x14')][_0x2f0f6a[_0x5c92('0x29')]]?'\x20hangup\x20sendFile\x20':_0x5c92('0x56'),JSON['stringify'](this[_0x5c92('0x11')][_0x2f0f6a['uniqueid']]));if(this[_0x5c92('0x14')][_0x2f0f6a[_0x5c92('0x29')]]){if(this[_0x5c92('0x11')][_0x2f0f6a[_0x5c92('0x29')]][_0x5c92('0x57')]>0x0&&this[_0x5c92('0x11')][_0x2f0f6a[_0x5c92('0x29')]][_0x5c92('0x1d')]===_0x5c92('0x58')){this[_0x5c92('0x51')](_0x2f0f6a[_0x5c92('0x29')],!![]);}else{this[_0x5c92('0x51')](_0x2f0f6a['uniqueid'],![],this['channels'][_0x2f0f6a[_0x5c92('0x29')]]['faxstatusstring']?_0x5c92('0x59')+this[_0x5c92('0x11')][_0x2f0f6a[_0x5c92('0x29')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x5c92('0x23')][_0x5c92('0x5a')]=function(_0x489d1f){var _0x1f58e9=this;return new BPromise(function(_0x20f1f9,_0x10a894){_0x1f58e9[_0x5c92('0x5b')](_0x489d1f,_0x1f58e9[_0x5c92('0x12')][_0x489d1f[_0x5c92('0x5c')]])['then'](function(_0x164a90){ut[_0x5c92('0x4d')](_0x5c92('0x5d'),_0x164a90);_0x20f1f9(ut[_0x5c92('0x3e')](_0x5c92('0x5e')));})['catch'](function(_0x24cdf6){ut[_0x5c92('0x4d')]('[Fax][execOriginate][failure]',_0x24cdf6);updateStatus(_0x489d1f);_0x10a894(ut[_0x5c92('0x3e')]('Fax\x20failed'));});});};Fax['prototype'][_0x5c92('0x5f')]=function(_0x4552ef){var _0x51d637=this;return new BPromise(function(_0x4600c8,_0x3abac2){var _0x21188b=_0x51d637[_0x5c92('0x60')](_0x51d637['faxAccounts'][_0x4552ef['FaxAccountId']][_0x5c92('0x61')],_0x4552ef);if(_0x21188b[_0x5c92('0x62')]){_0x4600c8(ut[_0x5c92('0x3e')](_0x5c92('0x63')));}else{_0x3abac2(ut['message'](_0x21188b[_0x5c92('0x3e')]));}});};function originate(_0x25c415,_0x19d536,_0x10dc7e){return new BPromise(function(_0x2ec48c,_0x16df5f){if(_0x10dc7e){var _0x47c484=util[_0x5c92('0x64')](_0x5c92('0x65'),path['parse'](_0x25c415[_0x5c92('0x4')])[_0x5c92('0x2b')],_0x25c415[_0x5c92('0x4')]);gs[_0x5c92('0x66')](_0x47c484)[_0x5c92('0x42')](function(){_0x25c415[_0x5c92('0x4')]=util[_0x5c92('0x64')](_0x5c92('0x67'),path[_0x5c92('0x40')](_0x25c415[_0x5c92('0x4')])[_0x5c92('0x68')],path['parse'](_0x25c415[_0x5c92('0x4')])[_0x5c92('0x2b')]);_0x19d536[_0x5c92('0x69')]=_0x25c415[_0x5c92('0x4')];ut[_0x5c92('0x4d')](_0x5c92('0x6a'),'');ami[_0x5c92('0x6b')](ut[_0x5c92('0x6c')](_0x25c415,_0x19d536))[_0x5c92('0x42')](function(_0x100820){_0x2ec48c(_0x100820);})[_0x5c92('0x44')](function(_0x5b1af9){_0x16df5f(_0x5b1af9);});})[_0x5c92('0x44')](function(_0x1b98e9){_0x16df5f(_0x1b98e9);});}else{ami['Action'](ut[_0x5c92('0x6c')](_0x25c415,_0x19d536))['then'](function(_0x45b35b){_0x2ec48c(_0x45b35b);})['catch'](function(_0x18675f){_0x16df5f(_0x18675f);});}});}Fax[_0x5c92('0x23')]['execOriginate']=function(_0x35a60e,_0x375778){var _0x41e1c3=this;return new BPromise(function(_0x592ce6,_0x22495f){var _0xb8b140=uuid['v4']();var _0x5cca44=ut['addVariables'](_0x35a60e,_0x375778);_0x41e1c3[_0x5c92('0x14')][_0xb8b140]=new Action(_0xb8b140,_0x375778,_0x35a60e);var _0x25f83f=_0x41e1c3[_0x5c92('0x14')][_0xb8b140];if(path[_0x5c92('0x40')](_0x35a60e[_0x5c92('0x4')])[_0x5c92('0x6d')]===_0x5c92('0x41')){originate(_0x25f83f,_0x5cca44,!![])[_0x5c92('0x42')](function(_0x17032f){_0x592ce6(_0x17032f);})['catch'](function(_0x53d3d7){_0x22495f(_0x53d3d7);});}else{originate(_0x25f83f,_0x5cca44,![])[_0x5c92('0x42')](function(_0x1a36e4){_0x592ce6(_0x1a36e4);})[_0x5c92('0x44')](function(_0x47ce6d){_0x22495f(_0x47ce6d);});}});};Fax['prototype']['isTrunkReachable']=function(_0x4dcb29){return!_['isNil'](_0x4dcb29)&&!_[_0x5c92('0x6e')](_0x4dcb29['name'])&&!_[_0x5c92('0x6e')](_0x4dcb29[_0x5c92('0x6f')])&&_0x4dcb29[_0x5c92('0x6f')]&&!_['isNil'](this[_0x5c92('0x13')][util[_0x5c92('0x64')](_0x5c92('0x70'),_0x4dcb29['name'])])&&!_[_0x5c92('0x6e')](this[_0x5c92('0x13')][util[_0x5c92('0x64')](_0x5c92('0x70'),_0x4dcb29[_0x5c92('0x2b')])][_0x5c92('0x33')])&&(this[_0x5c92('0x13')][util[_0x5c92('0x64')](_0x5c92('0x70'),_0x4dcb29[_0x5c92('0x2b')])][_0x5c92('0x33')]===_0x5c92('0x71')||this[_0x5c92('0x13')][util[_0x5c92('0x64')](_0x5c92('0x70'),_0x4dcb29[_0x5c92('0x2b')])][_0x5c92('0x33')]===_0x5c92('0x72'));};Fax[_0x5c92('0x23')][_0x5c92('0x60')]=function(_0x13e4e4,_0xd8e703){if(!this[_0x5c92('0x73')](_0x13e4e4)){ut[_0x5c92('0x4d')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x5c92('0x6e')](_0x13e4e4)?'':_0x13e4e4[_0x5c92('0x2b')]+_0x5c92('0x74'));return{'isValid':![],'message':_0x5c92('0x75')};}if(_[_0x5c92('0x6e')](_0xd8e703[_0x5c92('0x8')])){ut[_0x5c92('0x4d')](_0x5c92('0x76'),JSON['stringify'](_0xd8e703));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x5c92('0x6e')](_0xd8e703[_0x5c92('0x4')])){ut[_0x5c92('0x4d')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0xd8e703));return{'isValid':![],'message':_0x5c92('0x77')};}return{'isValid':!![],'message':_0x5c92('0x78')};};module[_0x5c92('0x79')]=Fax;
\ No newline at end of file
index d62c824..b04a1ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff2d=['resolve','then','notify','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','error','inspect'];(function(_0x38ecda,_0x3b551e){var _0x3fa8f3=function(_0x4e196c){while(--_0x4e196c){_0x38ecda['push'](_0x38ecda['shift']());}};_0x3fa8f3(++_0x3b551e);}(_0xff2d,0x1a9));var _0xdff2=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xff2d[_0x4b2436];return _0x4f5ab2;};'use strict';var util=require(_0xdff2('0x0'));var BPromise=require(_0xdff2('0x1'));var logger=require(_0xdff2('0x2'))(_0xdff2('0x3'));var _=require(_0xdff2('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x3b09a9){return function(_0x1089d0){logger[_0xdff2('0x5')](_0x3b09a9,util[_0xdff2('0x6')](_0x1089d0,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x31963d,_0x25d26e){return BPromise[_0xdff2('0x7')]()[_0xdff2('0x8')](faxAccount[_0xdff2('0x9')](_0x31963d,_0x25d26e))[_0xdff2('0xa')](loggerCatch(_0xdff2('0xb')));};
\ No newline at end of file
+var _0xfd30=['resolve','catch','[Notify]\x20','util','bluebird','preview','lodash','../rpc/faxAccount','error','inspect','notify'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0xfd30,0x16e));var _0x0fd3=function(_0x3bcb0b,_0x255033){_0x3bcb0b=_0x3bcb0b-0x0;var _0x455caa=_0xfd30[_0x3bcb0b];return _0x455caa;};'use strict';var util=require(_0x0fd3('0x0'));var BPromise=require(_0x0fd3('0x1'));var logger=require('../../../config/logger')(_0x0fd3('0x2'));var _=require(_0x0fd3('0x3'));var faxAccount=require(_0x0fd3('0x4'));function loggerCatch(_0x1f0e5d){return function(_0x112002){logger[_0x0fd3('0x5')](_0x1f0e5d,util[_0x0fd3('0x6')](_0x112002,{'showHidden':![],'depth':null}));};}exports[_0x0fd3('0x7')]=function(_0x134243,_0x23dff4){return BPromise[_0x0fd3('0x8')]()['then'](faxAccount[_0x0fd3('0x7')](_0x134243,_0x23dff4))[_0x0fd3('0x9')](loggerCatch(_0x0fd3('0xa')));};
\ No newline at end of file
index 48fd227..5a9244c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dab=['inspect','../../../../config/logger','fax','bluebird','child_process','execute','Exec\x20gs','info','\x20Error\x20:'];(function(_0x70504d,_0x34e810){var _0x47e29b=function(_0x119dfe){while(--_0x119dfe){_0x70504d['push'](_0x70504d['shift']());}};_0x47e29b(++_0x34e810);}(_0x2dab,0x1b1));var _0xb2da=function(_0x23828f,_0x11d022){_0x23828f=_0x23828f-0x0;var _0x543a34=_0x2dab[_0x23828f];return _0x543a34;};'use strict';var util=require('util');var logger=require(_0xb2da('0x0'))(_0xb2da('0x1'));var BPromise=require(_0xb2da('0x2'));var exec=require(_0xb2da('0x3'))['exec'];exports[_0xb2da('0x4')]=function(_0x1dce47){return new BPromise(function(_0x1389ab,_0x919051){exec(_0x1dce47,function(_0x1fe4c3,_0xe6e27f,_0x29b90c){logger['info'](_0xb2da('0x5'),_0xe6e27f);if(_0x1fe4c3){logger[_0xb2da('0x6')]('Exec\x20gs',_0xb2da('0x7'),util[_0xb2da('0x8')](_0x1fe4c3,{'showHidden':![],'depth':null}),_0xe6e27f,_0x29b90c);_0x919051(_0x1fe4c3);}_0x1389ab(_0xe6e27f);});});};
\ No newline at end of file
+var _0x59dd=['exec','Exec\x20gs','info','\x20Error\x20:','util','../../../../config/logger','fax','child_process'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x59dd,0x16c));var _0xd59d=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0x59dd[_0x54defc];return _0x1955d3;};'use strict';var util=require(_0xd59d('0x0'));var logger=require(_0xd59d('0x1'))(_0xd59d('0x2'));var BPromise=require('bluebird');var exec=require(_0xd59d('0x3'))[_0xd59d('0x4')];exports['execute']=function(_0x166913){return new BPromise(function(_0x3b16aa,_0x484446){exec(_0x166913,function(_0x1d997c,_0x47c0c1,_0x1e195a){logger['info'](_0xd59d('0x5'),_0x47c0c1);if(_0x1d997c){logger[_0xd59d('0x6')](_0xd59d('0x5'),_0xd59d('0x7'),util['inspect'](_0x1d997c,{'showHidden':![],'depth':null}),_0x47c0c1,_0x1e195a);_0x484446(_0x1d997c);}_0x3b16aa(_0x47c0c1);});});};
\ No newline at end of file
index 60ac6a9..fa47c83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e5=['logger','info','inspect','addVariables','headerinfo','minrate','maxrate','modem','faxdetect','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','format','\x22%s\x22\x20<%s>','lodash','../../../../config/logger','fax','message'];(function(_0x54349c,_0x5252d0){var _0x50fea9=function(_0x3fefa0){while(--_0x3fefa0){_0x54349c['push'](_0x54349c['shift']());}};_0x50fea9(++_0x5252d0);}(_0x34e5,0x172));var _0x534e=function(_0x2c5b4f,_0x4c1d02){_0x2c5b4f=_0x2c5b4f-0x0;var _0x56cbcb=_0x34e5[_0x2c5b4f];return _0x56cbcb;};'use strict';var util=require('util');var _=require(_0x534e('0x0'));var moment=require('moment');var logger=require(_0x534e('0x1'))(_0x534e('0x2'));exports[_0x534e('0x3')]=function(_0x246650){return{'message':_0x246650};};exports[_0x534e('0x4')]=function(_0x50b790,_0x11a158){logger[_0x534e('0x5')](_0x50b790,util[_0x534e('0x6')](_0x11a158,{'showHidden':![],'depth':null}));};exports[_0x534e('0x7')]=function(_0x436a92,_0x2d0370){var _0x2760e7={'XMF-ECM':_0x2d0370['ecm'],'XMF-HEADERINFO':_0x2d0370[_0x534e('0x8')],'XMF-MINRATE':_0x2d0370[_0x534e('0x9')],'XMF-MAXRATE':_0x2d0370[_0x534e('0xa')],'XMF-MODEM':util['format']('\x22%s\x22',_0x2d0370[_0x534e('0xb')]),'XMF-GATEWAY':_0x2d0370['gateway'],'XMF-FAXDETECT':_0x2d0370[_0x534e('0xc')],'XMF-T38TIMEOUT':_0x2d0370['t38timeout'],'XMF-LOCALSTATIONID':_0x2d0370[_0x534e('0xd')],'XMF-PATH':_0x436a92[_0x534e('0xe')]};return _0x2760e7;};exports[_0x534e('0xf')]=function(_0x529726,_0x1b7a5a){return{'actionid':_0x529726[_0x534e('0x10')],'action':_0x534e('0x11'),'channel':_0x529726[_0x534e('0x12')],'Exten':_0x534e('0x13'),'Context':'from-sip','Priority':'1','callerid':util[_0x534e('0x14')](_0x534e('0x15'),_0x529726[_0x534e('0x8')]?_0x529726[_0x534e('0x8')]:'',_0x529726[_0x534e('0xd')]),'variable':_0x1b7a5a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x529726[_0x534e('0x10')]};};
\ No newline at end of file
+var _0x68fc=['from-sip','\x22%s\x22\x20<%s>','localstationid','util','lodash','moment','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax'];(function(_0xa2c0a3,_0x5bbac0){var _0x52c618=function(_0x20f7fd){while(--_0x20f7fd){_0xa2c0a3['push'](_0xa2c0a3['shift']());}};_0x52c618(++_0x5bbac0);}(_0x68fc,0xa5));var _0xc68f=function(_0x3279b2,_0x43cce9){_0x3279b2=_0x3279b2-0x0;var _0xfae8f2=_0x68fc[_0x3279b2];return _0xfae8f2;};'use strict';var util=require(_0xc68f('0x0'));var _=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0xc68f('0x3')]=function(_0x506fb5){return{'message':_0x506fb5};};exports[_0xc68f('0x4')]=function(_0x593648,_0x5899ea){logger[_0xc68f('0x5')](_0x593648,util[_0xc68f('0x6')](_0x5899ea,{'showHidden':![],'depth':null}));};exports[_0xc68f('0x7')]=function(_0x363cdf,_0x4fcce4){var _0x4a6f7d={'XMF-ECM':_0x4fcce4[_0xc68f('0x8')],'XMF-HEADERINFO':_0x4fcce4[_0xc68f('0x9')],'XMF-MINRATE':_0x4fcce4[_0xc68f('0xa')],'XMF-MAXRATE':_0x4fcce4[_0xc68f('0xb')],'XMF-MODEM':util[_0xc68f('0xc')](_0xc68f('0xd'),_0x4fcce4[_0xc68f('0xe')]),'XMF-GATEWAY':_0x4fcce4[_0xc68f('0xf')],'XMF-FAXDETECT':_0x4fcce4[_0xc68f('0x10')],'XMF-T38TIMEOUT':_0x4fcce4[_0xc68f('0x11')],'XMF-LOCALSTATIONID':_0x4fcce4['localstationid'],'XMF-PATH':_0x363cdf[_0xc68f('0x12')]};return _0x4a6f7d;};exports[_0xc68f('0x13')]=function(_0x1f2758,_0x1d4ae4){return{'actionid':_0x1f2758[_0xc68f('0x14')],'action':_0xc68f('0x15'),'channel':_0x1f2758[_0xc68f('0x16')],'Exten':_0xc68f('0x17'),'Context':_0xc68f('0x18'),'Priority':'1','callerid':util[_0xc68f('0xc')](_0xc68f('0x19'),_0x1f2758['headerinfo']?_0x1f2758[_0xc68f('0x9')]:'',_0x1f2758[_0xc68f('0x1a')]),'variable':_0x1d4ae4,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1f2758[_0xc68f('0x14')]};};
\ No newline at end of file
index ec73914..1fd5fc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03d0=['getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','bluebird','moment','./server','./realtime','./report','./acw','./trigger','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','get','hour','getAgents','then','getTelephones','initTelephones'];(function(_0x4456de,_0x1c23f9){var _0x17e180=function(_0xa404ad){while(--_0xa404ad){_0x4456de['push'](_0x4456de['shift']());}};_0x17e180(++_0x1c23f9);}(_0x03d0,0x1bd));var _0x003d=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x03d0[_0x13ea00];return _0x1f7347;};'use strict';var BPromise=require(_0x003d('0x0'));var util=require('util');var moment=require(_0x003d('0x1'));var server=require(_0x003d('0x2'));var Realtime=require(_0x003d('0x3'));var Report=require(_0x003d('0x4'));var Acw=require(_0x003d('0x5'));var Trigger=require(_0x003d('0x6'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x003d('0x7'));var user=require(_0x003d('0x8'));var voiceQueue=require(_0x003d('0x9'));var voiceQueueReport=require(_0x003d('0xa'));var voiceCallReport=require(_0x003d('0xb'));var trunk=require(_0x003d('0xc'));var trigger=require('./rpc/trigger');var template=require(_0x003d('0xd'));var cmHopperHistory=require(_0x003d('0xe'));var campaign=require(_0x003d('0xf'));var voiceExtension=require(_0x003d('0x10'));var faxAccount=require(_0x003d('0x11'));var zendesk=require(_0x003d('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x003d('0x13'));var freshdesk=require(_0x003d('0x14'));var desk=require(_0x003d('0x15'));var zoho=require(_0x003d('0x16'));var vtiger=require(_0x003d('0x17'));var freshsales=require(_0x003d('0x18'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x003d('0x19')](_0x003d('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x003d('0x19')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user[_0x003d('0x1b')]())['then'](realtime['initAgents']())[_0x003d('0x1c')](user[_0x003d('0x1d')]())[_0x003d('0x1c')](realtime[_0x003d('0x1e')]())[_0x003d('0x1c')](trunk[_0x003d('0x1f')]())['then'](realtime[_0x003d('0x20')]())[_0x003d('0x1c')](voiceQueue['getVoiceQueues']())[_0x003d('0x1c')](realtime[_0x003d('0x21')]())[_0x003d('0x1c')](trigger[_0x003d('0x22')]())['then'](realtime[_0x003d('0x23')]())['then'](template['getTemplates']())['then'](realtime['initTemplates']())[_0x003d('0x1c')](zendesk[_0x003d('0x24')]())[_0x003d('0x1c')](realtime[_0x003d('0x25')]())[_0x003d('0x1c')](salesforce[_0x003d('0x26')]())[_0x003d('0x1c')](realtime[_0x003d('0x27')]())[_0x003d('0x1c')](sugarcrm[_0x003d('0x28')]())[_0x003d('0x1c')](realtime[_0x003d('0x29')]())[_0x003d('0x1c')](freshdesk[_0x003d('0x2a')]())[_0x003d('0x1c')](realtime[_0x003d('0x2b')]())[_0x003d('0x1c')](desk['getDeskAccounts']())[_0x003d('0x1c')](realtime[_0x003d('0x2c')]())[_0x003d('0x1c')](zoho[_0x003d('0x2d')]())[_0x003d('0x1c')](realtime[_0x003d('0x2e')]())['then'](vtiger[_0x003d('0x2f')]())[_0x003d('0x1c')](realtime[_0x003d('0x30')]())['then'](freshsales[_0x003d('0x31')]())['then'](realtime[_0x003d('0x32')]())[_0x003d('0x1c')](servicenow['getServicenowAccounts']())[_0x003d('0x1c')](realtime[_0x003d('0x33')]())[_0x003d('0x1c')](dynamics365[_0x003d('0x34')]())['then'](realtime[_0x003d('0x35')]())[_0x003d('0x1c')](campaign[_0x003d('0x36')]())[_0x003d('0x1c')](realtime[_0x003d('0x37')]())['then'](voiceExtension[_0x003d('0x38')]())[_0x003d('0x1c')](realtime['initVoiceExtensions']())[_0x003d('0x1c')](faxAccount[_0x003d('0x39')]())[_0x003d('0x1c')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x003d('0x3a')]()['then'](voiceQueueReport[_0x003d('0x3b')]())[_0x003d('0x1c')](realtime['initVoiceQueueReports']())[_0x003d('0x1c')](cmHopperHistory[_0x003d('0x3c')]())[_0x003d('0x1c')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x003d('0x3d')]())['then'](realtime['initCampaignHopperHistory']())[_0x003d('0x1c')](voiceCallReport[_0x003d('0x3e')]())['then'](realtime[_0x003d('0x3f')]())[_0x003d('0x1c')](function(_0x561790){})[_0x003d('0x40')](function(_0x554b98){console[_0x003d('0x41')](_0x554b98);});}function main(){return server[_0x003d('0x42')](realtime,preview,fax)['then'](function(_0x20201f){return initRealtime();})[_0x003d('0x1c')](function(){return initParams();})['then'](function(){report[_0x003d('0x43')]();setInterval(initRealtime,0x1388);})[_0x003d('0x40')](function(_0x3dabb9){console[_0x003d('0x41')](_0x3dabb9);});}main();
\ No newline at end of file
+var _0x3072=['./report','./trigger','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','listen','sync','bluebird','util','./realtime'];(function(_0xa4f529,_0x36add4){var _0x3ce0df=function(_0x4ac770){while(--_0x4ac770){_0xa4f529['push'](_0xa4f529['shift']());}};_0x3ce0df(++_0x36add4);}(_0x3072,0x109));var _0x2307=function(_0xfaac52,_0x1fa8fc){_0xfaac52=_0xfaac52-0x0;var _0x4e1593=_0x3072[_0xfaac52];return _0x4e1593;};'use strict';var BPromise=require(_0x2307('0x0'));var util=require(_0x2307('0x1'));var moment=require('moment');var server=require('./server');var Realtime=require(_0x2307('0x2'));var Report=require(_0x2307('0x3'));var Acw=require('./acw');var Trigger=require(_0x2307('0x4'));var Dialer=require('./dialer');var Preview=require(_0x2307('0x5'));var Fax=require('./fax');var user=require(_0x2307('0x6'));var voiceQueue=require(_0x2307('0x7'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x2307('0x8'));var trunk=require(_0x2307('0x9'));var trigger=require('./rpc/trigger');var template=require(_0x2307('0xa'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x2307('0xb'));var voiceExtension=require(_0x2307('0xc'));var faxAccount=require(_0x2307('0xd'));var zendesk=require(_0x2307('0xe'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x2307('0xf'));var desk=require(_0x2307('0x10'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x2307('0x11'));var freshsales=require(_0x2307('0x12'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x2307('0x13'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x2307('0x14')](_0x2307('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x2307('0x14')](_0x2307('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x2307('0x16')](user[_0x2307('0x17')]())['then'](realtime[_0x2307('0x18')]())[_0x2307('0x16')](user[_0x2307('0x19')]())[_0x2307('0x16')](realtime[_0x2307('0x1a')]())[_0x2307('0x16')](trunk[_0x2307('0x1b')]())[_0x2307('0x16')](realtime['initTrunks']())[_0x2307('0x16')](voiceQueue[_0x2307('0x1c')]())[_0x2307('0x16')](realtime[_0x2307('0x1d')]())[_0x2307('0x16')](trigger[_0x2307('0x1e')]())[_0x2307('0x16')](realtime[_0x2307('0x1f')]())[_0x2307('0x16')](template[_0x2307('0x20')]())[_0x2307('0x16')](realtime[_0x2307('0x21')]())[_0x2307('0x16')](zendesk[_0x2307('0x22')]())[_0x2307('0x16')](realtime[_0x2307('0x23')]())[_0x2307('0x16')](salesforce[_0x2307('0x24')]())[_0x2307('0x16')](realtime[_0x2307('0x25')]())[_0x2307('0x16')](sugarcrm[_0x2307('0x26')]())[_0x2307('0x16')](realtime[_0x2307('0x27')]())['then'](freshdesk[_0x2307('0x28')]())[_0x2307('0x16')](realtime[_0x2307('0x29')]())[_0x2307('0x16')](desk[_0x2307('0x2a')]())['then'](realtime['initDeskAccounts']())[_0x2307('0x16')](zoho[_0x2307('0x2b')]())[_0x2307('0x16')](realtime[_0x2307('0x2c')]())[_0x2307('0x16')](vtiger[_0x2307('0x2d')]())[_0x2307('0x16')](realtime[_0x2307('0x2e')]())[_0x2307('0x16')](freshsales[_0x2307('0x2f')]())['then'](realtime[_0x2307('0x30')]())[_0x2307('0x16')](servicenow[_0x2307('0x31')]())[_0x2307('0x16')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x2307('0x32')]())[_0x2307('0x16')](realtime[_0x2307('0x33')]())['then'](campaign[_0x2307('0x34')]())[_0x2307('0x16')](realtime[_0x2307('0x35')]())[_0x2307('0x16')](voiceExtension[_0x2307('0x36')]())[_0x2307('0x16')](realtime[_0x2307('0x37')]())[_0x2307('0x16')](faxAccount[_0x2307('0x38')]())['then'](realtime[_0x2307('0x39')]())[_0x2307('0x16')](function(){return realtime;});}function initParams(){return BPromise[_0x2307('0x3a')]()[_0x2307('0x16')](voiceQueueReport['getVoiceQueueReports']())[_0x2307('0x16')](realtime[_0x2307('0x3b')]())[_0x2307('0x16')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x2307('0x16')](realtime[_0x2307('0x3c')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x2307('0x16')](realtime[_0x2307('0x3d')]())[_0x2307('0x16')](voiceCallReport['getVoiceCallReports']())[_0x2307('0x16')](realtime[_0x2307('0x3e')]())[_0x2307('0x16')](function(_0x5363bc){})[_0x2307('0x3f')](function(_0x210722){console[_0x2307('0x40')](_0x210722);});}function main(){return server[_0x2307('0x41')](realtime,preview,fax)[_0x2307('0x16')](function(_0x1dc187){return initRealtime();})[_0x2307('0x16')](function(){return initParams();})[_0x2307('0x16')](function(){report[_0x2307('0x42')]();setInterval(initRealtime,0x1388);})[_0x2307('0x3f')](function(_0xf633d1){console[_0x2307('0x40')](_0xf633d1);});}main();
\ No newline at end of file
index cbf5709..5d56b1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76ad=['onhold','md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','format','interface','user:%s','lodash','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x76ad,0x1bd));var _0xd76a=function(_0x33e48a,_0x33be28){_0x33e48a=_0x33e48a-0x0;var _0x219368=_0x76ad[_0x33e48a];return _0x219368;};'use strict';var _=require(_0xd76a('0x0'));var util=require('util');var moment=require(_0xd76a('0x1'));var md5=require('md5');var Redis=require(_0xd76a('0x2'));var config=require(_0xd76a('0x3'));config[_0xd76a('0x4')]=_[_0xd76a('0x5')](config[_0xd76a('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xd76a('0x6'))(new Redis(config['redis']));function Agent(_0x2f93c0){this['id']=_0x2f93c0['id']||0x0;this[_0xd76a('0x7')]=_0x2f93c0['name']||'';this[_0xd76a('0x8')]=_0x2f93c0[_0xd76a('0x8')]||'';this[_0xd76a('0x9')]=_0x2f93c0['accountcode']||'';this[_0xd76a('0xa')]=_0x2f93c0[_0xd76a('0xa')]||'';this[_0xd76a('0xb')]=_0xd76a('0xc');this[_0xd76a('0xd')]=0x0;this[_0xd76a('0xe')]=_0xd76a('0xc');this[_0xd76a('0xf')]='';this[_0xd76a('0x10')]='';this[_0xd76a('0x11')]='';this['interface']='';this[_0xd76a('0x12')]=_0x2f93c0[_0xd76a('0x12')]||![];this[_0xd76a('0x13')]=_0xd76a('0xc');this[_0xd76a('0x14')]=0x0;this[_0xd76a('0x15')]='';this[_0xd76a('0x16')]='';this[_0xd76a('0x17')]=![];this['local']=![];this[_0xd76a('0x18')]='';}Agent[_0xd76a('0x19')][_0xd76a('0x1a')]=function(_0x5ea5ea){var _0x5c8e72;if(_0x5ea5ea&&_0x5ea5ea['state']){_0x5c8e72=_0x5ea5ea[_0xd76a('0xb')][_0xd76a('0x1b')]();switch(_0x5c8e72){case _0xd76a('0x1c'):_0x5c8e72=_0xd76a('0x1d');break;case _0xd76a('0x1e'):_0x5c8e72=_0xd76a('0x1f');break;}}if(_0x5c8e72&&this[_0xd76a('0x13')]!==_0x5c8e72||_0x5ea5ea[_0xd76a('0x20')]){this[_0xd76a('0x14')]=_['toNumber'](moment()[_0xd76a('0x21')]('x'));}if(_0x5c8e72){this[_0xd76a('0x13')]=_0x5c8e72;}var _0x565ef7={'id':this['id'],'name':this[_0xd76a('0x7')],'email':this[_0xd76a('0x8')],'accountcode':this[_0xd76a('0x9')],'fullname':this[_0xd76a('0xa')],'state':this[_0xd76a('0xb')],'stateTime':this[_0xd76a('0xd')],'status':this[_0xd76a('0xe')],'address':this[_0xd76a('0xf')],'online':this[_0xd76a('0x12')],'voiceStatus':this[_0xd76a('0x13')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xd76a('0x22')],'onhold':this['onhold']};var _0x4b6d37=md5(JSON['stringify'](_0x565ef7));if(this['md5']!==_0x4b6d37){this[_0xd76a('0x18')]=_0x4b6d37;io['to'](util[_0xd76a('0x21')](_0xd76a('0x23'),_0x565ef7[_0xd76a('0x7')]))['emit']('user:save',_0x565ef7);}};module['exports']=Agent;
\ No newline at end of file
+var _0xb966=['voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','toNumber','stateTime','stringify','format','emit','user:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','name','email','accountcode','fullname','state','status','unknown','address','phone','mobile','interface','online','voiceStatus'];(function(_0x278dc9,_0x1d76c7){var _0x39dc09=function(_0xcc70af){while(--_0xcc70af){_0x278dc9['push'](_0x278dc9['shift']());}};_0x39dc09(++_0x1d76c7);}(_0xb966,0x19a));var _0x6b96=function(_0xeb3c97,_0x1b2ddb){_0xeb3c97=_0xeb3c97-0x0;var _0x41215b=_0xb966[_0xeb3c97];return _0x41215b;};'use strict';var _=require(_0x6b96('0x0'));var util=require(_0x6b96('0x1'));var moment=require('moment');var md5=require('md5');var Redis=require(_0x6b96('0x2'));var config=require(_0x6b96('0x3'));config[_0x6b96('0x4')]=_[_0x6b96('0x5')](config[_0x6b96('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6b96('0x4')]));function Agent(_0x1917c9){this['id']=_0x1917c9['id']||0x0;this[_0x6b96('0x6')]=_0x1917c9['name']||'';this['email']=_0x1917c9[_0x6b96('0x7')]||'';this[_0x6b96('0x8')]=_0x1917c9[_0x6b96('0x8')]||'';this['fullname']=_0x1917c9[_0x6b96('0x9')]||'';this[_0x6b96('0xa')]='unknown';this['stateTime']=0x0;this[_0x6b96('0xb')]=_0x6b96('0xc');this[_0x6b96('0xd')]='';this[_0x6b96('0xe')]='';this[_0x6b96('0xf')]='';this[_0x6b96('0x10')]='';this[_0x6b96('0x11')]=_0x1917c9[_0x6b96('0x11')]||![];this[_0x6b96('0x12')]=_0x6b96('0xc');this[_0x6b96('0x13')]=0x0;this[_0x6b96('0x14')]='';this[_0x6b96('0x15')]='';this[_0x6b96('0x16')]=![];this[_0x6b96('0x17')]=![];this[_0x6b96('0x18')]='';}Agent[_0x6b96('0x19')][_0x6b96('0x1a')]=function(_0x3107a1){var _0xe13fb8;if(_0x3107a1&&_0x3107a1['state']){_0xe13fb8=_0x3107a1['state'][_0x6b96('0x1b')]();switch(_0xe13fb8){case _0x6b96('0x1c'):_0xe13fb8=_0x6b96('0x1d');break;case _0x6b96('0x1e'):_0xe13fb8=_0x6b96('0x1f');break;}}if(_0xe13fb8&&this[_0x6b96('0x12')]!==_0xe13fb8||_0x3107a1['statePause']){this[_0x6b96('0x13')]=_[_0x6b96('0x20')](moment()['format']('x'));}if(_0xe13fb8){this[_0x6b96('0x12')]=_0xe13fb8;}var _0x40b75e={'id':this['id'],'name':this[_0x6b96('0x6')],'email':this[_0x6b96('0x7')],'accountcode':this[_0x6b96('0x8')],'fullname':this['fullname'],'state':this[_0x6b96('0xa')],'stateTime':this[_0x6b96('0x21')],'status':this[_0x6b96('0xb')],'address':this[_0x6b96('0xd')],'online':this[_0x6b96('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x6b96('0x13')],'voiceStatusCallerIdNumber':this[_0x6b96('0x14')],'voiceStatusQueue':this[_0x6b96('0x15')],'interface':this[_0x6b96('0x10')],'onhold':this[_0x6b96('0x16')]};var _0x5e4293=md5(JSON[_0x6b96('0x22')](_0x40b75e));if(this['md5']!==_0x5e4293){this['md5']=_0x5e4293;io['to'](util[_0x6b96('0x23')]('user:%s',_0x40b75e['name']))[_0x6b96('0x24')](_0x6b96('0x25'),_0x40b75e);}};module[_0x6b96('0x26')]=Agent;
\ No newline at end of file
index 64884b5..1ad61d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x672d=['dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','temp','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x372528,_0x5dfd79){var _0x133add=function(_0x5b7b62){while(--_0x5b7b62){_0x372528['push'](_0x372528['shift']());}};_0x133add(++_0x5dfd79);}(_0x672d,0x191));var _0xd672=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x672d[_0x565ed7];return _0x183ad7;};'use strict';function Campaign(_0x37a394){this['id']=_0x37a394['id']||0x0;this[_0xd672('0x0')]=_0x37a394[_0xd672('0x0')]||'';this[_0xd672('0x1')]=_0x37a394[_0xd672('0x1')]||'campaign';this[_0xd672('0x2')]=0x0;this[_0xd672('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xd672('0x4')]=0x0;this['message']='';this[_0xd672('0x5')]=!![];this['active']=_0x37a394[_0xd672('0x6')];this['limitCalls']=_0x37a394[_0xd672('0x7')];this['dialTimezone']=_0x37a394['dialTimezone']||null;this[_0xd672('0x8')]=_0x37a394[_0xd672('0x8')]?_0x37a394[_0xd672('0x8')]:null;this['dialOriginateCallerIdName']=_0x37a394['dialOriginateCallerIdName'];this[_0xd672('0x9')]=_0x37a394[_0xd672('0x9')];this[_0xd672('0xa')]=_0x37a394[_0xd672('0xa')]||0x1e;this[_0xd672('0xb')]=_0x37a394[_0xd672('0xb')];this[_0xd672('0xc')]=_0x37a394['dialCongestionRetryFrequency'];this[_0xd672('0xd')]=_0x37a394[_0xd672('0xd')];this['dialBusyRetryFrequency']=_0x37a394[_0xd672('0xe')];this[_0xd672('0xf')]=_0x37a394[_0xd672('0xf')];this[_0xd672('0x10')]=_0x37a394[_0xd672('0x10')];this['dialGlobalMaxRetry']=_0x37a394[_0xd672('0x11')];this['dialNoSuchNumberMaxRetry']=_0x37a394['dialNoSuchNumberMaxRetry']||0x3;this[_0xd672('0x12')]=_0x37a394[_0xd672('0x12')]||0x96;this[_0xd672('0x13')]=_0x37a394[_0xd672('0x13')]||0x3;this['dialDropRetryFrequency']=_0x37a394[_0xd672('0x14')]||0x96;this['dialAbandonedMaxRetry']=_0x37a394[_0xd672('0x15')]||0x3;this[_0xd672('0x16')]=_0x37a394[_0xd672('0x16')]||0x96;this[_0xd672('0x17')]=_0x37a394[_0xd672('0x17')]||0x3;this[_0xd672('0x18')]=_0x37a394[_0xd672('0x18')]||0x96;this['dialAgentRejectMaxRetry']=_0x37a394[_0xd672('0x19')]||0x3;this[_0xd672('0x1a')]=_0x37a394[_0xd672('0x1a')]||0x96;this[_0xd672('0x1b')]=_0x37a394['dialOrderByScheduledAt']||_0xd672('0x1c');this[_0xd672('0x1d')]=_0x37a394[_0xd672('0x1d')]||undefined;this[_0xd672('0x1e')]=_0x37a394['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x37a394[_0xd672('0x1f')]||undefined;this['TrunkBackup']=_0x37a394[_0xd672('0x20')]?_0x37a394['TrunkBackup']:undefined;this[_0xd672('0x21')]=_0x37a394[_0xd672('0x21')]?_0x37a394[_0xd672('0x21')]:undefined;this['Interval']=_0x37a394[_0xd672('0x22')]?_0x37a394['Interval']:undefined;this[_0xd672('0x23')]=_0x37a394[_0xd672('0x23')]?_0x37a394[_0xd672('0x23')]:undefined;this['dialQueueProject']=_0x37a394['SquareProject']?_0x37a394[_0xd672('0x23')][_0xd672('0x0')]:undefined;this[_0xd672('0x24')]=_0x37a394[_0xd672('0x24')]||![];this[_0xd672('0x25')]=_0x37a394[_0xd672('0x25')];this[_0xd672('0x26')]=_0x37a394[_0xd672('0x26')];this[_0xd672('0x27')]=_0x37a394['dialAMDAfterGreetingSilence'];this[_0xd672('0x28')]=_0x37a394[_0xd672('0x28')];this['dialAMDMinWordLength']=_0x37a394[_0xd672('0x29')];this[_0xd672('0x2a')]=_0x37a394[_0xd672('0x2a')];this[_0xd672('0x2b')]=_0x37a394[_0xd672('0x2b')];this[_0xd672('0x2c')]=_0x37a394[_0xd672('0x2c')];this[_0xd672('0x2d')]=_0x37a394[_0xd672('0x2d')];}module['exports']=Campaign;
\ No newline at end of file
+var _0x799a=['Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0x18a662,_0x49e08d){var _0xec6ae0=function(_0x25eb41){while(--_0x25eb41){_0x18a662['push'](_0x18a662['shift']());}};_0xec6ae0(++_0x49e08d);}(_0x799a,0x187));var _0xa799=function(_0x2b7836,_0x55385){_0x2b7836=_0x2b7836-0x0;var _0x11ac9f=_0x799a[_0x2b7836];return _0x11ac9f;};'use strict';function Campaign(_0x47a687){this['id']=_0x47a687['id']||0x0;this['name']=_0x47a687['name']||'';this[_0xa799('0x0')]=_0x47a687['type']||_0xa799('0x1');this['originated']=0x0;this[_0xa799('0x2')]=0x0;this[_0xa799('0x3')]=0x0;this[_0xa799('0x4')]=0x0;this[_0xa799('0x5')]='';this['sendMessageOneNotActive']=!![];this['active']=_0x47a687[_0xa799('0x6')];this[_0xa799('0x7')]=_0x47a687[_0xa799('0x7')];this[_0xa799('0x8')]=_0x47a687[_0xa799('0x8')]||null;this[_0xa799('0x9')]=_0x47a687[_0xa799('0x9')]?_0x47a687['dialGlobalInterval']:null;this[_0xa799('0xa')]=_0x47a687['dialOriginateCallerIdName'];this[_0xa799('0xb')]=_0x47a687['dialOriginateCallerIdNumber'];this[_0xa799('0xc')]=_0x47a687['dialOriginateTimeout']||0x1e;this[_0xa799('0xd')]=_0x47a687[_0xa799('0xd')];this['dialCongestionRetryFrequency']=_0x47a687[_0xa799('0xe')];this['dialBusyMaxRetry']=_0x47a687['dialBusyMaxRetry'];this[_0xa799('0xf')]=_0x47a687[_0xa799('0xf')];this[_0xa799('0x10')]=_0x47a687['dialNoAnswerMaxRetry'];this[_0xa799('0x11')]=_0x47a687[_0xa799('0x11')];this['dialGlobalMaxRetry']=_0x47a687['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x47a687[_0xa799('0x12')]||0x3;this[_0xa799('0x13')]=_0x47a687[_0xa799('0x13')]||0x96;this[_0xa799('0x14')]=_0x47a687[_0xa799('0x14')]||0x3;this[_0xa799('0x15')]=_0x47a687[_0xa799('0x15')]||0x96;this[_0xa799('0x16')]=_0x47a687[_0xa799('0x16')]||0x3;this[_0xa799('0x17')]=_0x47a687[_0xa799('0x17')]||0x96;this[_0xa799('0x18')]=_0x47a687[_0xa799('0x18')]||0x3;this[_0xa799('0x19')]=_0x47a687[_0xa799('0x19')]||0x96;this[_0xa799('0x1a')]=_0x47a687[_0xa799('0x1a')]||0x3;this[_0xa799('0x1b')]=_0x47a687[_0xa799('0x1b')]||0x96;this[_0xa799('0x1c')]=_0x47a687[_0xa799('0x1c')]||'DESC';this['dialPrefix']=_0x47a687['dialPrefix']||undefined;this[_0xa799('0x1d')]=_0x47a687['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x47a687[_0xa799('0x1e')]||undefined;this[_0xa799('0x1f')]=_0x47a687[_0xa799('0x1f')]?_0x47a687[_0xa799('0x1f')]:undefined;this[_0xa799('0x20')]=_0x47a687[_0xa799('0x20')]?_0x47a687[_0xa799('0x20')]:undefined;this[_0xa799('0x21')]=_0x47a687[_0xa799('0x21')]?_0x47a687['Interval']:undefined;this[_0xa799('0x22')]=_0x47a687[_0xa799('0x22')]?_0x47a687['SquareProject']:undefined;this[_0xa799('0x23')]=_0x47a687[_0xa799('0x22')]?_0x47a687[_0xa799('0x22')][_0xa799('0x24')]:undefined;this[_0xa799('0x25')]=_0x47a687['dialAMDActive']||![];this[_0xa799('0x26')]=_0x47a687['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x47a687['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x47a687[_0xa799('0x27')];this[_0xa799('0x28')]=_0x47a687[_0xa799('0x28')];this[_0xa799('0x29')]=_0x47a687[_0xa799('0x29')];this[_0xa799('0x2a')]=_0x47a687[_0xa799('0x2a')];this['dialAMDMaximumNumberOfWords']=_0x47a687[_0xa799('0x2b')];this[_0xa799('0x2c')]=_0x47a687[_0xa799('0x2c')];this[_0xa799('0x2d')]=_0x47a687['dialAMDMaximumWordLength'];}module[_0xa799('0x2e')]=Campaign;
\ No newline at end of file
index 809ac88..e27f861 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x500c=['transferconnectedlinenum','mohtime','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastdata','duration','billableseconds','holdtime','type','tag','monitor','queue'];(function(_0x14d673,_0x239860){var _0x556ef4=function(_0x57650c){while(--_0x57650c){_0x14d673['push'](_0x14d673['shift']());}};_0x556ef4(++_0x239860);}(_0x500c,0x188));var _0xc500=function(_0x39b1b0,_0xe83400){_0x39b1b0=_0x39b1b0-0x0;var _0x5eab07=_0x500c[_0x39b1b0];return _0x5eab07;};'use strict';function Channel(){this[_0xc500('0x0')]=null;this[_0xc500('0x1')]='';this[_0xc500('0x2')]='';this[_0xc500('0x3')]=0x0;this[_0xc500('0x4')]='';this[_0xc500('0x5')]=undefined;this[_0xc500('0x6')]=undefined;this[_0xc500('0x7')]=0x0;this[_0xc500('0x8')]='';this[_0xc500('0x9')]=0x0;this[_0xc500('0xa')]=0x0;this[_0xc500('0xb')]=0x0;this[_0xc500('0xc')]=![];this[_0xc500('0xd')]=null;this[_0xc500('0xe')]=null;this['unmanaged']=![];this[_0xc500('0xf')]=![];this['lastapplication']='';this[_0xc500('0x10')]='';this[_0xc500('0x11')]=0x0;this[_0xc500('0x12')]=0x0;this[_0xc500('0x13')]=0x0;this[_0xc500('0x14')]=null;this[_0xc500('0x15')]=null;this['disposition']=null;this[_0xc500('0x16')]=![];this['monitorFilename']=null;this[_0xc500('0x17')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0xc500('0x18')]=undefined;this[_0xc500('0x19')]=0x0;}module['exports']=Channel;
\ No newline at end of file
+var _0x223e=['type','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','exports','starttime','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','answered','answertime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime'];(function(_0x26db28,_0x30addf){var _0x482b0a=function(_0x4fadf6){while(--_0x4fadf6){_0x26db28['push'](_0x26db28['shift']());}};_0x482b0a(++_0x30addf);}(_0x223e,0x1b1));var _0xe223=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x223e[_0x3ab9ee];return _0x82ee88;};'use strict';function Channel(){this[_0xe223('0x0')]=null;this[_0xe223('0x1')]='';this[_0xe223('0x2')]='';this['calleridnum']=0x0;this[_0xe223('0x3')]='';this[_0xe223('0x4')]=undefined;this[_0xe223('0x5')]=undefined;this[_0xe223('0x6')]=0x0;this[_0xe223('0x7')]='';this[_0xe223('0x8')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0xe223('0x9')]=![];this[_0xe223('0xa')]=null;this['endtime']=null;this[_0xe223('0xb')]=![];this[_0xe223('0xc')]=![];this['lastapplication']='';this[_0xe223('0xd')]='';this[_0xe223('0xe')]=0x0;this[_0xe223('0xf')]=0x0;this[_0xe223('0x10')]=0x0;this[_0xe223('0x11')]=null;this['tag']=null;this[_0xe223('0x12')]=null;this['monitor']=![];this[_0xe223('0x13')]=null;this[_0xe223('0x14')]=null;this[_0xe223('0x15')]=[];this[_0xe223('0x16')]=undefined;this[_0xe223('0x17')]=undefined;this['mohtime']=0x0;}module[_0xe223('0x18')]=Channel;
\ No newline at end of file
index 518fa49..153af9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x746f=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x47b15d,_0x5586ec){var _0x54a269=function(_0x3d2477){while(--_0x3d2477){_0x47b15d['push'](_0x47b15d['shift']());}};_0x54a269(++_0x5586ec);}(_0x746f,0x9c));var _0xf746=function(_0x456ef3,_0x22bc37){_0x456ef3=_0x456ef3-0x0;var _0xbc980b=_0x746f[_0x456ef3];return _0xbc980b;};'use strict';function DeskAccount(_0x55867e){this['id']=_0x55867e['id']||0x0;this[_0xf746('0x0')]=_0x55867e[_0xf746('0x0')]||'';this[_0xf746('0x1')]=_0x55867e[_0xf746('0x1')]||'';this[_0xf746('0x2')]=_0x55867e[_0xf746('0x2')]||'';this[_0xf746('0x3')]=_0x55867e[_0xf746('0x3')]||'';this[_0xf746('0x4')]=_0x55867e[_0xf746('0x4')]||'';this[_0xf746('0x5')]=_0x55867e[_0xf746('0x5')]||'';this[_0xf746('0x6')]=_0x55867e[_0xf746('0x6')]||'';this[_0xf746('0x7')]=_0x55867e[_0xf746('0x7')]||'';this[_0xf746('0x8')]=_0x55867e[_0xf746('0x8')]||'';this[_0xf746('0x9')]=_0x55867e[_0xf746('0x9')]||'';this[_0xf746('0xa')]=_0x55867e[_0xf746('0xa')]||'';this[_0xf746('0xb')]=_0x55867e[_0xf746('0xb')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
+var _0x43fd=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x2f9f77,_0x3a721d){var _0x3445b2=function(_0x2cd4d2){while(--_0x2cd4d2){_0x2f9f77['push'](_0x2f9f77['shift']());}};_0x3445b2(++_0x3a721d);}(_0x43fd,0x1ec));var _0xd43f=function(_0x3f5ad1,_0x29d06c){_0x3f5ad1=_0x3f5ad1-0x0;var _0x13f01a=_0x43fd[_0x3f5ad1];return _0x13f01a;};'use strict';function DeskAccount(_0xa81b26){this['id']=_0xa81b26['id']||0x0;this[_0xd43f('0x0')]=_0xa81b26['name']||'';this['username']=_0xa81b26[_0xd43f('0x1')]||'';this[_0xd43f('0x2')]=_0xa81b26['remoteUri']||'';this[_0xd43f('0x3')]=_0xa81b26['authType']||'';this[_0xd43f('0x4')]=_0xa81b26[_0xd43f('0x4')]||'';this[_0xd43f('0x5')]=_0xa81b26[_0xd43f('0x5')]||'';this['consumerSecret']=_0xa81b26[_0xd43f('0x6')]||'';this[_0xd43f('0x7')]=_0xa81b26[_0xd43f('0x7')]||'';this[_0xd43f('0x8')]=_0xa81b26['tokenSecret']||'';this[_0xd43f('0x9')]=_0xa81b26[_0xd43f('0x9')]||'';this['serverUrl']=_0xa81b26[_0xd43f('0xa')]||'';this[_0xd43f('0xb')]=_0xa81b26[_0xd43f('0xb')]||{};}module[_0xd43f('0xc')]=DeskAccount;
\ No newline at end of file
index 96ff8b4..4a8604a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e69=['Configurations','exports','name','username','password','remoteUri','tenantId','clientId','serverUrl'];(function(_0x5c619e,_0x1bccdf){var _0x445cf8=function(_0x2eaa64){while(--_0x2eaa64){_0x5c619e['push'](_0x5c619e['shift']());}};_0x445cf8(++_0x1bccdf);}(_0x2e69,0x1df));var _0x92e6=function(_0x392cc9,_0x4fe2c0){_0x392cc9=_0x392cc9-0x0;var _0x46195e=_0x2e69[_0x392cc9];return _0x46195e;};'use strict';function Dynamics365Account(_0x4d3c00){this['id']=_0x4d3c00['id']||0x0;this[_0x92e6('0x0')]=_0x4d3c00[_0x92e6('0x0')]||'';this[_0x92e6('0x1')]=_0x4d3c00['username']||'';this[_0x92e6('0x2')]=_0x4d3c00[_0x92e6('0x2')]||'';this['remoteUri']=_0x4d3c00[_0x92e6('0x3')]||'';this[_0x92e6('0x4')]=_0x4d3c00[_0x92e6('0x4')]||'';this[_0x92e6('0x5')]=_0x4d3c00['clientId']||'';this['clientSecret']=_0x4d3c00['clientSecret']||{};this[_0x92e6('0x6')]=_0x4d3c00[_0x92e6('0x6')]||'';this[_0x92e6('0x7')]=_0x4d3c00[_0x92e6('0x7')]||{};}module[_0x92e6('0x8')]=Dynamics365Account;
\ No newline at end of file
+var _0x17da=['serverUrl','Configurations','exports','name','username','password','remoteUri','clientId','clientSecret'];(function(_0x16aaab,_0x427186){var _0x486ccc=function(_0x310be5){while(--_0x310be5){_0x16aaab['push'](_0x16aaab['shift']());}};_0x486ccc(++_0x427186);}(_0x17da,0x108));var _0xa17d=function(_0x283e8e,_0x2f3c9e){_0x283e8e=_0x283e8e-0x0;var _0x2efc59=_0x17da[_0x283e8e];return _0x2efc59;};'use strict';function Dynamics365Account(_0x2cc2c7){this['id']=_0x2cc2c7['id']||0x0;this[_0xa17d('0x0')]=_0x2cc2c7[_0xa17d('0x0')]||'';this['username']=_0x2cc2c7[_0xa17d('0x1')]||'';this[_0xa17d('0x2')]=_0x2cc2c7[_0xa17d('0x2')]||'';this['remoteUri']=_0x2cc2c7[_0xa17d('0x3')]||'';this['tenantId']=_0x2cc2c7['tenantId']||'';this[_0xa17d('0x4')]=_0x2cc2c7['clientId']||'';this[_0xa17d('0x5')]=_0x2cc2c7[_0xa17d('0x5')]||{};this[_0xa17d('0x6')]=_0x2cc2c7[_0xa17d('0x6')]||'';this[_0xa17d('0x7')]=_0x2cc2c7[_0xa17d('0x7')]||{};}module[_0xa17d('0x8')]=Dynamics365Account;
\ No newline at end of file
index d235ea3..30b2c2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16e0=['key','exports','name','description','ecm','headerinfo','localstationid','minrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0xcdaf9c,_0x9c5eb9){var _0x5a30cb=function(_0xaf2f64){while(--_0xaf2f64){_0xcdaf9c['push'](_0xcdaf9c['shift']());}};_0x5a30cb(++_0x9c5eb9);}(_0x16e0,0x1b2));var _0x016e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x16e0[_0x20a584];return _0x4b41a8;};'use strict';function FaxAccount(_0x184d90){this['id']=_0x184d90['id']||0x0;this['name']=_0x184d90[_0x016e('0x0')]||'';this[_0x016e('0x1')]=_0x184d90['description'];this['ecm']=_0x184d90[_0x016e('0x2')];this[_0x016e('0x3')]=_0x184d90[_0x016e('0x3')];this['localstationid']=_0x184d90[_0x016e('0x4')];this['minrate']=_0x184d90[_0x016e('0x5')]||0x960;this['maxrate']=_0x184d90['maxrate']||0x3840;this[_0x016e('0x6')]=_0x184d90[_0x016e('0x6')]||_0x016e('0x7');this['gateway']=_0x184d90[_0x016e('0x8')]||'no';this['faxdetect']=_0x184d90[_0x016e('0x9')]||'no';this[_0x016e('0xa')]=_0x184d90[_0x016e('0xa')]||0x1388;this[_0x016e('0xb')]=_0x184d90[_0x016e('0xb')]||_0x016e('0xc');this['Trunk']=_0x184d90[_0x016e('0xd')]?_0x184d90[_0x016e('0xd')]:undefined;this['ListId']=_0x184d90['ListId'];this[_0x016e('0xe')]=_0x184d90['key'];}module[_0x016e('0xf')]=FaxAccount;
\ No newline at end of file
+var _0x7a35=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm'];(function(_0x29ee83,_0x927e0a){var _0x156bcd=function(_0x13c0a7){while(--_0x13c0a7){_0x29ee83['push'](_0x29ee83['shift']());}};_0x156bcd(++_0x927e0a);}(_0x7a35,0x1ea));var _0x57a3=function(_0x41382c,_0xc3ffd1){_0x41382c=_0x41382c-0x0;var _0x4da35b=_0x7a35[_0x41382c];return _0x4da35b;};'use strict';function FaxAccount(_0x474512){this['id']=_0x474512['id']||0x0;this['name']=_0x474512[_0x57a3('0x0')]||'';this['description']=_0x474512[_0x57a3('0x1')];this[_0x57a3('0x2')]=_0x474512['ecm'];this[_0x57a3('0x3')]=_0x474512[_0x57a3('0x3')];this[_0x57a3('0x4')]=_0x474512[_0x57a3('0x4')];this[_0x57a3('0x5')]=_0x474512[_0x57a3('0x5')]||0x960;this[_0x57a3('0x6')]=_0x474512[_0x57a3('0x6')]||0x3840;this[_0x57a3('0x7')]=_0x474512['modem']||_0x57a3('0x8');this['gateway']=_0x474512[_0x57a3('0x9')]||'no';this['faxdetect']=_0x474512[_0x57a3('0xa')]||'no';this['t38timeout']=_0x474512[_0x57a3('0xb')]||0x1388;this[_0x57a3('0xc')]=_0x474512[_0x57a3('0xc')]||'SIP';this['Trunk']=_0x474512[_0x57a3('0xd')]?_0x474512[_0x57a3('0xd')]:undefined;this[_0x57a3('0xe')]=_0x474512[_0x57a3('0xe')];this[_0x57a3('0xf')]=_0x474512['key'];}module[_0x57a3('0x10')]=FaxAccount;
\ No newline at end of file
index b047157..d41aae9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3be=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x25e184,_0x4b4f16){var _0x5b14f6=function(_0x3efa19){while(--_0x3efa19){_0x25e184['push'](_0x25e184['shift']());}};_0x5b14f6(++_0x4b4f16);}(_0xd3be,0x194));var _0xed3b=function(_0x1dc8ce,_0x46f0a2){_0x1dc8ce=_0x1dc8ce-0x0;var _0xc1fadd=_0xd3be[_0x1dc8ce];return _0xc1fadd;};'use strict';function FreshdeskAccount(_0x3f297a){this['id']=_0x3f297a['id']||0x0;this['name']=_0x3f297a[_0xed3b('0x0')]||'';this[_0xed3b('0x1')]=_0x3f297a[_0xed3b('0x1')]||'';this['apiKey']=_0x3f297a[_0xed3b('0x2')]||'';this[_0xed3b('0x3')]=_0x3f297a[_0xed3b('0x3')]||'';this[_0xed3b('0x4')]=_0x3f297a[_0xed3b('0x4')]||'';this[_0xed3b('0x5')]=_0x3f297a[_0xed3b('0x5')]||{};}module[_0xed3b('0x6')]=FreshdeskAccount;
\ No newline at end of file
+var _0x4028=['token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x1fcddb,_0x304947){var _0x5a6b79=function(_0x4e152e){while(--_0x4e152e){_0x1fcddb['push'](_0x1fcddb['shift']());}};_0x5a6b79(++_0x304947);}(_0x4028,0x15a));var _0x8402=function(_0x4adcfc,_0xd67fcf){_0x4adcfc=_0x4adcfc-0x0;var _0x1295eb=_0x4028[_0x4adcfc];return _0x1295eb;};'use strict';function FreshdeskAccount(_0x8cf9c){this['id']=_0x8cf9c['id']||0x0;this['name']=_0x8cf9c[_0x8402('0x0')]||'';this[_0x8402('0x1')]=_0x8cf9c[_0x8402('0x1')]||'';this['apiKey']=_0x8cf9c[_0x8402('0x2')]||'';this[_0x8402('0x3')]=_0x8cf9c[_0x8402('0x3')]||'';this[_0x8402('0x4')]=_0x8cf9c[_0x8402('0x4')]||'';this['Configurations']=_0x8cf9c[_0x8402('0x5')]||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
index 6ba54e4..3107666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3ed=['name','username','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x2ebb0b,_0x38b95c){var _0x36a67e=function(_0x338914){while(--_0x338914){_0x2ebb0b['push'](_0x2ebb0b['shift']());}};_0x36a67e(++_0x38b95c);}(_0xe3ed,0x1d5));var _0xde3e=function(_0x3673d8,_0x204546){_0x3673d8=_0x3673d8-0x0;var _0x475a5b=_0xe3ed[_0x3673d8];return _0x475a5b;};'use strict';function FreshsalesAccount(_0x399b60){this['id']=_0x399b60['id']||0x0;this['name']=_0x399b60[_0xde3e('0x0')]||'';this[_0xde3e('0x1')]=_0x399b60[_0xde3e('0x1')]||'';this['apiKey']=_0x399b60[_0xde3e('0x2')]||'';this[_0xde3e('0x3')]=_0x399b60[_0xde3e('0x3')]||'';this[_0xde3e('0x4')]=_0x399b60[_0xde3e('0x4')]||'';this['Configurations']=_0x399b60[_0xde3e('0x5')]||{};}module[_0xde3e('0x6')]=FreshsalesAccount;
\ No newline at end of file
+var _0xd4e1=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x5e489e,_0x1f4b49){var _0x1832fb=function(_0x1246d7){while(--_0x1246d7){_0x5e489e['push'](_0x5e489e['shift']());}};_0x1832fb(++_0x1f4b49);}(_0xd4e1,0xb5));var _0x1d4e=function(_0x59f41b,_0x16ac45){_0x59f41b=_0x59f41b-0x0;var _0x1da0e6=_0xd4e1[_0x59f41b];return _0x1da0e6;};'use strict';function FreshsalesAccount(_0x59c9c3){this['id']=_0x59c9c3['id']||0x0;this[_0x1d4e('0x0')]=_0x59c9c3[_0x1d4e('0x0')]||'';this['username']=_0x59c9c3[_0x1d4e('0x1')]||'';this[_0x1d4e('0x2')]=_0x59c9c3[_0x1d4e('0x3')]||'';this[_0x1d4e('0x4')]=_0x59c9c3['remoteUri']||'';this[_0x1d4e('0x5')]=_0x59c9c3[_0x1d4e('0x5')]||'';this[_0x1d4e('0x6')]=_0x59c9c3[_0x1d4e('0x6')]||{};}module[_0x1d4e('0x7')]=FreshsalesAccount;
\ No newline at end of file
index ce4b85a..9eeb881 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60f6=['mohtime','variables','exports','inbound','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','context','priority','holdtime','assigned'];(function(_0x3ef2d5,_0x423d46){var _0x2fefb2=function(_0x54f82f){while(--_0x54f82f){_0x3ef2d5['push'](_0x3ef2d5['shift']());}};_0x2fefb2(++_0x423d46);}(_0x60f6,0x1bb));var _0x660f=function(_0x3f3529,_0x45a8ca){_0x3f3529=_0x3f3529-0x0;var _0x2271fc=_0x60f6[_0x3f3529];return _0x2271fc;};'use strict';function QueueReport(){this['type']=_0x660f('0x0');this[_0x660f('0x1')]='';this['calleridnum']='';this['calleridname']='';this[_0x660f('0x2')]='';this[_0x660f('0x3')]=null;this[_0x660f('0x4')]=null;this[_0x660f('0x5')]=0x1;this[_0x660f('0x6')]=0x1;this[_0x660f('0x7')]=![];this[_0x660f('0x8')]=null;this[_0x660f('0x9')]=![];this['queuecallercompleteAt']=null;this[_0x660f('0xa')]=![];this['queuecallerexitAt']=null;this[_0x660f('0xb')]=0x1;this[_0x660f('0xc')]='';this[_0x660f('0xd')]='';this[_0x660f('0xe')]='';this['accountcode']='';this[_0x660f('0xf')]='';this['exten']='';this[_0x660f('0x10')]='';this[_0x660f('0x11')]=0x0;this[_0x660f('0x12')]=![];this['lastAssignedTo']='';this[_0x660f('0x13')]=0x0;this[_0x660f('0x14')]={};}module[_0x660f('0x15')]=QueueReport;
\ No newline at end of file
+var _0x179e=['type','inbound','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned','variables','exports'];(function(_0x244a39,_0x6bcb51){var _0x26ffdc=function(_0x60c512){while(--_0x60c512){_0x244a39['push'](_0x244a39['shift']());}};_0x26ffdc(++_0x6bcb51);}(_0x179e,0x168));var _0xe179=function(_0x40ad05,_0x18c3ae){_0x40ad05=_0x40ad05-0x0;var _0x5cc00f=_0x179e[_0x40ad05];return _0x5cc00f;};'use strict';function QueueReport(){this[_0xe179('0x0')]=_0xe179('0x1');this[_0xe179('0x2')]='';this['calleridnum']='';this['calleridname']='';this[_0xe179('0x3')]='';this[_0xe179('0x4')]=null;this[_0xe179('0x5')]=null;this[_0xe179('0x6')]=0x1;this[_0xe179('0x7')]=0x1;this[_0xe179('0x8')]=![];this[_0xe179('0x9')]=null;this[_0xe179('0xa')]=![];this['queuecallercompleteAt']=null;this[_0xe179('0xb')]=![];this[_0xe179('0xc')]=null;this[_0xe179('0xd')]=0x1;this[_0xe179('0xe')]='';this[_0xe179('0xf')]='';this[_0xe179('0x10')]='';this[_0xe179('0x11')]='';this['context']='';this[_0xe179('0x12')]='';this[_0xe179('0x13')]='';this[_0xe179('0x14')]=0x0;this[_0xe179('0x15')]=![];this['lastAssignedTo']='';this['mohtime']=0x0;this[_0xe179('0x16')]={};}module[_0xe179('0x17')]=QueueReport;
\ No newline at end of file
index 161ffc8..09ea80a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3003=['type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3003,0x1c1));var _0x3300=function(_0x1a7d4f,_0x124139){_0x1a7d4f=_0x1a7d4f-0x0;var _0x540608=_0x3003[_0x1a7d4f];return _0x540608;};'use strict';function SalesforceAccount(_0x16f04e){this['id']=_0x16f04e['id']||0x0;this[_0x3300('0x0')]=_0x16f04e[_0x3300('0x0')]||'';this[_0x3300('0x1')]=_0x16f04e[_0x3300('0x1')]||'';this[_0x3300('0x2')]=_0x16f04e[_0x3300('0x2')]||'';this[_0x3300('0x3')]=_0x16f04e['password']||'';this[_0x3300('0x4')]=_0x16f04e[_0x3300('0x4')]||'';this[_0x3300('0x5')]=_0x16f04e['clientSecret']||'';this[_0x3300('0x6')]=_0x16f04e['securityToken']||'';this['type']=_0x16f04e[_0x3300('0x7')]||_0x3300('0x8');this['serverUrl']=_0x16f04e[_0x3300('0x9')]||'';this[_0x3300('0xa')]=_0x16f04e[_0x3300('0xa')]||{};}module[_0x3300('0xb')]=SalesforceAccount;
\ No newline at end of file
+var _0x452d=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','securityToken','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x452d,0x7d));var _0xd452=function(_0x17c7b6,_0x2384c2){_0x17c7b6=_0x17c7b6-0x0;var _0x27c064=_0x452d[_0x17c7b6];return _0x27c064;};'use strict';function SalesforceAccount(_0x3b9cd3){this['id']=_0x3b9cd3['id']||0x0;this[_0xd452('0x0')]=_0x3b9cd3[_0xd452('0x0')]||'';this['username']=_0x3b9cd3[_0xd452('0x1')]||'';this[_0xd452('0x2')]=_0x3b9cd3[_0xd452('0x2')]||'';this[_0xd452('0x3')]=_0x3b9cd3[_0xd452('0x3')]||'';this['clientId']=_0x3b9cd3[_0xd452('0x4')]||'';this['clientSecret']=_0x3b9cd3['clientSecret']||'';this[_0xd452('0x5')]=_0x3b9cd3[_0xd452('0x5')]||'';this[_0xd452('0x6')]=_0x3b9cd3['type']||_0xd452('0x7');this[_0xd452('0x8')]=_0x3b9cd3[_0xd452('0x8')]||'';this[_0xd452('0x9')]=_0x3b9cd3[_0xd452('0x9')]||{};}module[_0xd452('0xa')]=SalesforceAccount;
\ No newline at end of file
index 03e3ca4..419c2e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66af=['exports','name','username','password','remoteUri','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66af,0x18d));var _0xf66a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x66af[_0x19e35c];return _0x3e1fe8;};'use strict';function ServicenowAccount(_0x53ef3d){this['id']=_0x53ef3d['id']||0x0;this['name']=_0x53ef3d[_0xf66a('0x0')]||'';this[_0xf66a('0x1')]=_0x53ef3d['username']||'';this[_0xf66a('0x2')]=_0x53ef3d[_0xf66a('0x2')]||'';this[_0xf66a('0x3')]=_0x53ef3d[_0xf66a('0x3')]||'';this['serverUrl']=_0x53ef3d['serverUrl']||'';this[_0xf66a('0x4')]=_0x53ef3d[_0xf66a('0x4')]||{};}module[_0xf66a('0x5')]=ServicenowAccount;
\ No newline at end of file
+var _0x2374=['serverUrl','Configurations','exports','name','password','remoteUri'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2374,0x129));var _0x4237=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x2374[_0xfae23b];return _0x200640;};'use strict';function ServicenowAccount(_0xb5d1c6){this['id']=_0xb5d1c6['id']||0x0;this[_0x4237('0x0')]=_0xb5d1c6['name']||'';this['username']=_0xb5d1c6['username']||'';this['password']=_0xb5d1c6[_0x4237('0x1')]||'';this[_0x4237('0x2')]=_0xb5d1c6[_0x4237('0x2')]||'';this[_0x4237('0x3')]=_0xb5d1c6[_0x4237('0x3')]||'';this[_0x4237('0x4')]=_0xb5d1c6[_0x4237('0x4')]||{};}module[_0x4237('0x5')]=ServicenowAccount;
\ No newline at end of file
index ef74ea5..f356f17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcf6=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x3c9d09,_0x1dedb7){var _0x3a452c=function(_0x475999){while(--_0x475999){_0x3c9d09['push'](_0x3c9d09['shift']());}};_0x3a452c(++_0x1dedb7);}(_0xdcf6,0xab));var _0x6dcf=function(_0x3a28e2,_0x58325a){_0x3a28e2=_0x3a28e2-0x0;var _0xfd325a=_0xdcf6[_0x3a28e2];return _0xfd325a;};'use strict';function SugarcrmAccount(_0x4fa53e){this['id']=_0x4fa53e['id']||0x0;this[_0x6dcf('0x0')]=_0x4fa53e[_0x6dcf('0x0')]||'';this[_0x6dcf('0x1')]=_0x4fa53e[_0x6dcf('0x1')]||'';this[_0x6dcf('0x2')]=_0x4fa53e[_0x6dcf('0x2')]||'';this[_0x6dcf('0x3')]=_0x4fa53e[_0x6dcf('0x3')]||'';this[_0x6dcf('0x4')]=_0x4fa53e[_0x6dcf('0x4')]||'';this[_0x6dcf('0x5')]=_0x4fa53e['Configurations']||{};}module[_0x6dcf('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0xc528=['password','remoteUri','serverUrl','exports','name'];(function(_0x1a784b,_0x546ccf){var _0xfe3c85=function(_0xf70c3e){while(--_0xf70c3e){_0x1a784b['push'](_0x1a784b['shift']());}};_0xfe3c85(++_0x546ccf);}(_0xc528,0x1a3));var _0x8c52=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc528[_0x321bb2];return _0x9c12ed;};'use strict';function SugarcrmAccount(_0x4b625b){this['id']=_0x4b625b['id']||0x0;this[_0x8c52('0x0')]=_0x4b625b[_0x8c52('0x0')]||'';this['username']=_0x4b625b['username']||'';this['password']=_0x4b625b[_0x8c52('0x1')]||'';this[_0x8c52('0x2')]=_0x4b625b[_0x8c52('0x2')]||'';this[_0x8c52('0x3')]=_0x4b625b[_0x8c52('0x3')]||'';this['Configurations']=_0x4b625b['Configurations']||{};}module[_0x8c52('0x4')]=SugarcrmAccount;
\ No newline at end of file
index adec3e0..64190a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67d7=['accountcode','state','unknown','status','address','exports','name'];(function(_0x46ea9b,_0x305af0){var _0x10d2c5=function(_0x2a81c8){while(--_0x2a81c8){_0x46ea9b['push'](_0x46ea9b['shift']());}};_0x10d2c5(++_0x305af0);}(_0x67d7,0x117));var _0x767d=function(_0x5e452c,_0x3b33c9){_0x5e452c=_0x5e452c-0x0;var _0x3f2356=_0x67d7[_0x5e452c];return _0x3f2356;};'use strict';function Telephone(_0x29438d){this['id']=_0x29438d['id']||0x0;this[_0x767d('0x0')]=_0x29438d[_0x767d('0x0')]||'';this['accountcode']=_0x29438d[_0x767d('0x1')]||'';this[_0x767d('0x2')]=_0x767d('0x3');this['stateTime']=0x0;this[_0x767d('0x4')]='unknown';this[_0x767d('0x5')]='';}module[_0x767d('0x6')]=Telephone;
\ No newline at end of file
+var _0x4a6d=['address','exports','name','accountcode','state','unknown','stateTime','status'];(function(_0xbbaca3,_0x5c175a){var _0x2b6630=function(_0x5de5e4){while(--_0x5de5e4){_0xbbaca3['push'](_0xbbaca3['shift']());}};_0x2b6630(++_0x5c175a);}(_0x4a6d,0xfa));var _0xd4a6=function(_0x500d5b,_0x2c05da){_0x500d5b=_0x500d5b-0x0;var _0x227b31=_0x4a6d[_0x500d5b];return _0x227b31;};'use strict';function Telephone(_0x5a036f){this['id']=_0x5a036f['id']||0x0;this[_0xd4a6('0x0')]=_0x5a036f['name']||'';this[_0xd4a6('0x1')]=_0x5a036f[_0xd4a6('0x1')]||'';this[_0xd4a6('0x2')]=_0xd4a6('0x3');this[_0xd4a6('0x4')]=0x0;this[_0xd4a6('0x5')]='unknown';this[_0xd4a6('0x6')]='';}module[_0xd4a6('0x7')]=Telephone;
\ No newline at end of file
index c80b233..fc4217c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4cd=['name','html'];(function(_0xe814b9,_0x1391b3){var _0x4c2760=function(_0x3eda48){while(--_0x3eda48){_0xe814b9['push'](_0xe814b9['shift']());}};_0x4c2760(++_0x1391b3);}(_0xe4cd,0x84));var _0xde4c=function(_0x2feb2c,_0x57a0a9){_0x2feb2c=_0x2feb2c-0x0;var _0x5ebb67=_0xe4cd[_0x2feb2c];return _0x5ebb67;};'use strict';function template(_0x48f7a7){this['id']=_0x48f7a7['id']||0x0;this['name']=_0x48f7a7[_0xde4c('0x0')]||'';this[_0xde4c('0x1')]=_0x48f7a7['html']||'';}module['exports']=template;
\ No newline at end of file
+var _0x83e0=['exports','name','html'];(function(_0x55dbd8,_0x2d8f59){var _0x5de922=function(_0xa58490){while(--_0xa58490){_0x55dbd8['push'](_0x55dbd8['shift']());}};_0x5de922(++_0x2d8f59);}(_0x83e0,0x1a2));var _0x083e=function(_0x87ea2e,_0x42ccc4){_0x87ea2e=_0x87ea2e-0x0;var _0x4e8b6f=_0x83e0[_0x87ea2e];return _0x4e8b6f;};'use strict';function template(_0x4851a2){this['id']=_0x4851a2['id']||0x0;this[_0x083e('0x0')]=_0x4851a2[_0x083e('0x0')]||'';this[_0x083e('0x1')]=_0x4851a2['html']||'';}module[_0x083e('0x2')]=template;
\ No newline at end of file
index 327483f..104ad53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x5c62a4,_0x54fcb6){var _0x3d98b0=function(_0x30253b){while(--_0x30253b){_0x5c62a4['push'](_0x5c62a4['shift']());}};_0x3d98b0(++_0x54fcb6);}(_0xedd9,0xfc));var _0x9edd=function(_0x2966ea,_0x5ef657){_0x2966ea=_0x2966ea-0x0;var _0x255bf5=_0xedd9[_0x2966ea];return _0x255bf5;};'use strict';function Trigger(_0x265eb8){this['id']=_0x265eb8['id']||0x0;this[_0x9edd('0x0')]=_0x265eb8[_0x9edd('0x0')]||'';this[_0x9edd('0x1')]=_0x265eb8[_0x9edd('0x1')]||_0x9edd('0x2');this[_0x9edd('0x3')]=_0x265eb8[_0x9edd('0x3')]||![];this[_0x9edd('0x4')]=_0x265eb8['AllConditions']||[];this[_0x9edd('0x5')]=_0x265eb8[_0x9edd('0x5')]||[];this[_0x9edd('0x6')]=_0x265eb8[_0x9edd('0x6')]||[];}module['exports']=Trigger;
\ No newline at end of file
+var _0x4b84=['name','channel','status','AllConditions','Actions'];(function(_0x10aa92,_0x5e197f){var _0x453a17=function(_0x246e11){while(--_0x246e11){_0x10aa92['push'](_0x10aa92['shift']());}};_0x453a17(++_0x5e197f);}(_0x4b84,0x1cc));var _0x44b8=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0x4b84[_0x1e4f2f];return _0xccea89;};'use strict';function Trigger(_0x90ff31){this['id']=_0x90ff31['id']||0x0;this[_0x44b8('0x0')]=_0x90ff31['name']||'';this['channel']=_0x90ff31[_0x44b8('0x1')]||'voice';this['status']=_0x90ff31[_0x44b8('0x2')]||![];this[_0x44b8('0x3')]=_0x90ff31[_0x44b8('0x3')]||[];this['AnyConditions']=_0x90ff31['AnyConditions']||[];this['Actions']=_0x90ff31[_0x44b8('0x4')]||[];}module['exports']=Trigger;
\ No newline at end of file
index a781c5e..13bec13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x055d=['domain','domainport','refresh','stateRegistry','registrationtime','exports','active','name','state','unknown','stateTime','registry','indexOf','split','host','port'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0x055d,0x1b6));var _0xd055=function(_0x2e0ced,_0xfca909){_0x2e0ced=_0x2e0ced-0x0;var _0x2a4ea0=_0x055d[_0x2e0ced];return _0x2a4ea0;};'use strict';function Trunk(_0x537cad){this['id']=_0x537cad['id']||0x0;this[_0xd055('0x0')]=_0x537cad[_0xd055('0x0')]||![];this[_0xd055('0x1')]=_0x537cad[_0xd055('0x1')]||'';this[_0xd055('0x2')]=_0xd055('0x3');this[_0xd055('0x4')]=0x0;this['status']=_0xd055('0x3');this[_0xd055('0x5')]=_0x537cad['registry']&&_0x537cad[_0xd055('0x5')][_0xd055('0x6')](':')?_0x537cad[_0xd055('0x5')][_0xd055('0x7')](':')[0x0]:'';this[_0xd055('0x8')]='';this[_0xd055('0x9')]='';this[_0xd055('0xa')]='';this[_0xd055('0xb')]='';this[_0xd055('0xc')]='';this[_0xd055('0xd')]=_0xd055('0x3');this[_0xd055('0xe')]='';this['address']='';}module[_0xd055('0xf')]=Trunk;
\ No newline at end of file
+var _0x2b52=['state','unknown','registry','indexOf','host','refresh','stateRegistry','registrationtime','address','exports','active','name'];(function(_0x3c0b45,_0x2c45b6){var _0x402cdc=function(_0x23ff08){while(--_0x23ff08){_0x3c0b45['push'](_0x3c0b45['shift']());}};_0x402cdc(++_0x2c45b6);}(_0x2b52,0x12a));var _0x22b5=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x2b52[_0x271060];return _0x40540b;};'use strict';function Trunk(_0x55a356){this['id']=_0x55a356['id']||0x0;this[_0x22b5('0x0')]=_0x55a356['active']||![];this[_0x22b5('0x1')]=_0x55a356[_0x22b5('0x1')]||'';this[_0x22b5('0x2')]=_0x22b5('0x3');this['stateTime']=0x0;this['status']=_0x22b5('0x3');this[_0x22b5('0x4')]=_0x55a356[_0x22b5('0x4')]&&_0x55a356[_0x22b5('0x4')][_0x22b5('0x5')](':')?_0x55a356[_0x22b5('0x4')]['split'](':')[0x0]:'';this[_0x22b5('0x6')]='';this['port']='';this['domain']='';this['domainport']='';this[_0x22b5('0x7')]='';this[_0x22b5('0x8')]=_0x22b5('0x3');this[_0x22b5('0x9')]='';this[_0x22b5('0xa')]='';}module[_0x22b5('0xb')]=Trunk;
\ No newline at end of file
index 9fb4109..7bc152e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42fc=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x54c12e,_0x21335b){var _0xef9441=function(_0x1df81b){while(--_0x1df81b){_0x54c12e['push'](_0x54c12e['shift']());}};_0xef9441(++_0x21335b);}(_0x42fc,0xb9));var _0xc42f=function(_0x4472c1,_0x135b58){_0x4472c1=_0x4472c1-0x0;var _0x18aba7=_0x42fc[_0x4472c1];return _0x18aba7;};'use strict';function voiceExtension(_0x142f7b){this['id']=_0x142f7b['id']||0x0;this[_0xc42f('0x0')]=_0x142f7b['exten']||'';this[_0xc42f('0x1')]=_0x142f7b['recordingFormat']||_0xc42f('0x2');this[_0xc42f('0x3')]=_0x142f7b[_0xc42f('0x3')]||![];}module[_0xc42f('0x4')]=voiceExtension;
\ No newline at end of file
+var _0x84f6=['exten','recordingFormat','mandatoryDisposition'];(function(_0xc96f64,_0x348eab){var _0x7ed92c=function(_0x4e5749){while(--_0x4e5749){_0xc96f64['push'](_0xc96f64['shift']());}};_0x7ed92c(++_0x348eab);}(_0x84f6,0x81));var _0x684f=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x84f6[_0x465a0c];return _0x1e202e;};'use strict';function voiceExtension(_0x2b21c7){this['id']=_0x2b21c7['id']||0x0;this[_0x684f('0x0')]=_0x2b21c7[_0x684f('0x0')]||'';this[_0x684f('0x1')]=_0x2b21c7[_0x684f('0x1')]||'none';this[_0x684f('0x2')]=_0x2b21c7[_0x684f('0x2')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
index b089558..4817061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b75=['roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','ringing','ringinuse','onhold','wav','wav49','gsm'];(function(_0x2ec9e4,_0x1403a5){var _0x348e27=function(_0x50bb82){while(--_0x50bb82){_0x2ec9e4['push'](_0x2ec9e4['shift']());}};_0x348e27(++_0x1403a5);}(_0x9b75,0x1ea));var _0x59b7=function(_0x25c95b,_0x364526){_0x25c95b=_0x25c95b-0x0;var _0x462e87=_0x9b75[_0x25c95b];return _0x462e87;};'use strict';var statusDesc=[_0x59b7('0x0'),_0x59b7('0x1'),_0x59b7('0x2'),'busy',_0x59b7('0x3'),'unavailable',_0x59b7('0x4'),_0x59b7('0x5'),_0x59b7('0x6')];var monitorFormat={'wav':_0x59b7('0x7'),'wav49':_0x59b7('0x8'),'gsm':_0x59b7('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x59b7('0xa')};function VoiceQueue(_0x1734c7){this['id']=_0x1734c7['id']||0x0;this[_0x59b7('0xb')]=_0x1734c7['name']||'';this[_0x59b7('0xc')]=_0x1734c7['monitor_format']||'';this['type']=_0x1734c7[_0x59b7('0xd')]||_0x59b7('0xe');this[_0x59b7('0xf')]=0x0;this[_0x59b7('0x10')]=0x0;this[_0x59b7('0x11')]=0x0;this[_0x59b7('0x12')]=0x0;this['sumDuration']=0x0;this[_0x59b7('0x13')]=0x0;this[_0x59b7('0x14')]=0x0;this[_0x59b7('0x15')]=0x0;this[_0x59b7('0x16')]=0x0;this[_0x59b7('0x17')]=0x0;this[_0x59b7('0x18')]=0x0;this[_0x59b7('0x19')]=_0x1734c7[_0x59b7('0x19')]||![];this[_0x59b7('0x1a')]=_0x1734c7[_0x59b7('0x1a')]||0xa;this[_0x59b7('0x1b')]=_0x1734c7[_0x59b7('0x1b')]||'no';this[_0x59b7('0x1c')]=!![];this['message']='';this['originated']=0x0;this['temp']=0x0;this['dialTimezone']=_0x1734c7[_0x59b7('0x1d')]||null;this[_0x59b7('0x1e')]=_0x1734c7[_0x59b7('0x1e')]?_0x1734c7[_0x59b7('0x1e')]:null;this[_0x59b7('0x1f')]=_0x1734c7['dialActive'];this['dialMethod']=_0x1734c7[_0x59b7('0x20')]||_0x59b7('0x21');this['dialLimitChannel']=_0x1734c7[_0x59b7('0x22')]||0x0;this[_0x59b7('0x23')]=_0x1734c7[_0x59b7('0x23')]||0x0;this[_0x59b7('0x24')]=_0x1734c7['dialPowerLevel']||0x1;this[_0x59b7('0x25')]=_0x1734c7['dialPredictiveOptimization']||_0x59b7('0x26');this[_0x59b7('0x27')]=_0x1734c7[_0x59b7('0x27')]||0.03;this[_0x59b7('0x28')]=_0x1734c7[_0x59b7('0x28')]||0x258;this[_0x59b7('0x29')]=_0x1734c7[_0x59b7('0x29')]||_0x59b7('0x2a');this['dialOriginateCallerIdNumber']=_0x1734c7[_0x59b7('0x2b')]||_0x59b7('0x2a');this[_0x59b7('0x2c')]=_0x1734c7[_0x59b7('0x2c')]||0x1e;this[_0x59b7('0x2d')]=_0x1734c7['dialQueueOptions']||_0x59b7('0x2e');this[_0x59b7('0x2f')]=_0x1734c7[_0x59b7('0x2f')]||0x3;this[_0x59b7('0x30')]=_0x1734c7[_0x59b7('0x30')]||undefined;this['dialCongestionMaxRetry']=_0x1734c7[_0x59b7('0x31')]||0x3;this[_0x59b7('0x32')]=_0x1734c7[_0x59b7('0x32')]||0x96;this[_0x59b7('0x33')]=_0x1734c7[_0x59b7('0x33')]||0x3;this['dialBusyRetryFrequency']=_0x1734c7[_0x59b7('0x34')]||0x96;this[_0x59b7('0x35')]=_0x1734c7[_0x59b7('0x35')]||0x3;this[_0x59b7('0x36')]=_0x1734c7[_0x59b7('0x36')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x1734c7[_0x59b7('0x37')]||0x3;this[_0x59b7('0x38')]=_0x1734c7['dialNoSuchNumberRetryFrequency']||0x96;this[_0x59b7('0x39')]=_0x1734c7[_0x59b7('0x39')]||0x3;this['dialDropRetryFrequency']=_0x1734c7[_0x59b7('0x3a')]||0x96;this[_0x59b7('0x3b')]=_0x1734c7['dialAbandonedMaxRetry']||0x3;this[_0x59b7('0x3c')]=_0x1734c7[_0x59b7('0x3c')]||0x96;this[_0x59b7('0x3d')]=_0x1734c7['dialMachineMaxRetry']||0x3;this[_0x59b7('0x3e')]=_0x1734c7[_0x59b7('0x3e')]||0x96;this[_0x59b7('0x3f')]=_0x1734c7['dialAgentRejectMaxRetry']||0x3;this[_0x59b7('0x40')]=_0x1734c7[_0x59b7('0x40')]||0x96;this[_0x59b7('0x41')]=_0x1734c7[_0x59b7('0x41')]||0x4;this[_0x59b7('0x42')]=_0x1734c7[_0x59b7('0x42')]?_0x1734c7[_0x59b7('0x42')]:undefined;this[_0x59b7('0x43')]=_0x1734c7[_0x59b7('0x43')]?_0x1734c7[_0x59b7('0x43')]:undefined;this[_0x59b7('0x44')]=_0x1734c7[_0x59b7('0x44')]||undefined;this['Interval']=_0x1734c7[_0x59b7('0x45')]?_0x1734c7[_0x59b7('0x45')]:undefined;this[_0x59b7('0x46')]=_0x1734c7[_0x59b7('0x46')]||_0x59b7('0x47');this[_0x59b7('0x48')]=_0x1734c7[_0x59b7('0x48')]||undefined;this[_0x59b7('0x49')]=_0x1734c7[_0x59b7('0x49')]||undefined;this[_0x59b7('0x4a')]=strategy[_0x1734c7[_0x59b7('0x4a')]]||_0x59b7('0x4b');this[_0x59b7('0x4c')]=!![];this[_0x59b7('0x4d')]=_0x1734c7[_0x59b7('0x4d')]||![];this[_0x59b7('0x4e')]=_0x1734c7[_0x59b7('0x4e')];this['dialAMDGreeting']=_0x1734c7[_0x59b7('0x4f')];this['dialAMDAfterGreetingSilence']=_0x1734c7[_0x59b7('0x50')];this[_0x59b7('0x51')]=_0x1734c7[_0x59b7('0x51')];this[_0x59b7('0x52')]=_0x1734c7['dialAMDMinWordLength'];this[_0x59b7('0x53')]=_0x1734c7[_0x59b7('0x53')];this['dialAMDMaximumNumberOfWords']=_0x1734c7['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0x1734c7[_0x59b7('0x54')];this[_0x59b7('0x55')]=_0x1734c7[_0x59b7('0x55')];this[_0x59b7('0x56')]=0x0;this[_0x59b7('0x57')]=0x0;this[_0x59b7('0x58')]=_0x1734c7[_0x59b7('0x58')];this[_0x59b7('0x59')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x59b7('0x5a')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x59b7('0x5b')]=0x0;this[_0x59b7('0x5c')]=0x0;this[_0x59b7('0x5d')]=0x0;this[_0x59b7('0x5e')]=0x0;this[_0x59b7('0x5f')]=0x0;this[_0x59b7('0x60')]=0x0;this[_0x59b7('0x61')]=0x0;this[_0x59b7('0x62')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x59b7('0x63')]=undefined;this['startPredictive']=undefined;this[_0x59b7('0x64')]=undefined;this[_0x59b7('0x65')]=1.05;this[_0x59b7('0x66')]=0x0;this[_0x59b7('0x67')]=0x0;this[_0x59b7('0x68')]=0x0;this[_0x59b7('0x69')]=0x0;this[_0x59b7('0x6a')]=0x0;this[_0x59b7('0x6b')]=0x0;this[_0x59b7('0x6c')]=0x0;this[_0x59b7('0x6d')]=0x0;this[_0x59b7('0x6e')]=_0x1734c7[_0x59b7('0x6f')]||0x14;this[_0x59b7('0x70')]=_0x1734c7[_0x59b7('0x6f')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x59b7('0x71')]=0x1;this[_0x59b7('0x72')]=0x0;this[_0x59b7('0x73')]=0x0;this[_0x59b7('0x74')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x1734c7[_0x59b7('0x75')]||0x1e;this[_0x59b7('0x76')]=_0x1734c7['dialRecallInQueue']||![];this[_0x59b7('0x77')]=_0x1734c7[_0x59b7('0x77')]||undefined;this[_0x59b7('0x78')]=_0x1734c7[_0x59b7('0x78')]||![];this[_0x59b7('0x79')]=_0x1734c7['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x1734c7[_0x59b7('0xc')]]?monitorFormat[_0x1734c7[_0x59b7('0xc')]]:undefined;this['mandatoryDisposition']=_0x1734c7[_0x59b7('0x7a')]||![];this[_0x59b7('0x7b')]=_0x1734c7['mandatoryDispositionPause']?_0x1734c7[_0x59b7('0x7b')]:undefined;}module[_0x59b7('0x7c')]=VoiceQueue;
\ No newline at end of file
+var _0x7049=['outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','invalid','unavailable','ringinuse','onhold','wav','wav49','rrmemory','roundrobin','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit'];(function(_0x1e9b35,_0x319423){var _0x29f8ba=function(_0x284023){while(--_0x284023){_0x1e9b35['push'](_0x1e9b35['shift']());}};_0x29f8ba(++_0x319423);}(_0x7049,0x174));var _0x9704=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x7049[_0x45f951];return _0x24756c;};'use strict';var statusDesc=[_0x9704('0x0'),'not_inuse','inuse','busy',_0x9704('0x1'),_0x9704('0x2'),'ringing',_0x9704('0x3'),_0x9704('0x4')];var monitorFormat={'wav':_0x9704('0x5'),'wav49':_0x9704('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0x9704('0x7'),'roundrobin':_0x9704('0x8')};function VoiceQueue(_0x5af12d){this['id']=_0x5af12d['id']||0x0;this['name']=_0x5af12d['name']||'';this['monitor_format']=_0x5af12d[_0x9704('0x9')]||'';this['type']=_0x5af12d[_0x9704('0xa')]||_0x9704('0xb');this[_0x9704('0xc')]=0x0;this['talking']=0x0;this[_0x9704('0xd')]=0x0;this[_0x9704('0xe')]=0x0;this[_0x9704('0xf')]=0x0;this[_0x9704('0x10')]=0x0;this[_0x9704('0x11')]=0x0;this[_0x9704('0x12')]=0x0;this['abandoned']=0x0;this[_0x9704('0x13')]=0x0;this[_0x9704('0x14')]=0x0;this['acw']=_0x5af12d[_0x9704('0x15')]||![];this[_0x9704('0x16')]=_0x5af12d[_0x9704('0x16')]||0xa;this[_0x9704('0x17')]=_0x5af12d['autopause']||'no';this['sendMessageOneNotActive']=!![];this[_0x9704('0x18')]='';this[_0x9704('0x19')]=0x0;this[_0x9704('0x1a')]=0x0;this['dialTimezone']=_0x5af12d[_0x9704('0x1b')]||null;this['dialGlobalInterval']=_0x5af12d[_0x9704('0x1c')]?_0x5af12d[_0x9704('0x1c')]:null;this['dialActive']=_0x5af12d['dialActive'];this[_0x9704('0x1d')]=_0x5af12d[_0x9704('0x1d')]||_0x9704('0x1e');this[_0x9704('0x1f')]=_0x5af12d['dialLimitChannel']||0x0;this[_0x9704('0x20')]=_0x5af12d[_0x9704('0x20')]||0x0;this['dialPowerLevel']=_0x5af12d[_0x9704('0x21')]||0x1;this[_0x9704('0x22')]=_0x5af12d[_0x9704('0x22')]||'dropRate';this[_0x9704('0x23')]=_0x5af12d[_0x9704('0x23')]||0.03;this[_0x9704('0x24')]=_0x5af12d[_0x9704('0x24')]||0x258;this[_0x9704('0x25')]=_0x5af12d['dialOriginateCallerIdName']||_0x9704('0x26');this[_0x9704('0x27')]=_0x5af12d[_0x9704('0x27')]||'anonymous';this['dialOriginateTimeout']=_0x5af12d[_0x9704('0x28')]||0x1e;this[_0x9704('0x29')]=_0x5af12d['dialQueueOptions']||_0x9704('0x2a');this[_0x9704('0x2b')]=_0x5af12d[_0x9704('0x2b')]||0x3;this['dialQueueProject']=_0x5af12d[_0x9704('0x2c')]||undefined;this[_0x9704('0x2d')]=_0x5af12d[_0x9704('0x2d')]||0x3;this['dialCongestionRetryFrequency']=_0x5af12d[_0x9704('0x2e')]||0x96;this['dialBusyMaxRetry']=_0x5af12d[_0x9704('0x2f')]||0x3;this[_0x9704('0x30')]=_0x5af12d['dialBusyRetryFrequency']||0x96;this[_0x9704('0x31')]=_0x5af12d[_0x9704('0x31')]||0x3;this[_0x9704('0x32')]=_0x5af12d[_0x9704('0x32')]||0x96;this[_0x9704('0x33')]=_0x5af12d[_0x9704('0x33')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5af12d[_0x9704('0x34')]||0x96;this[_0x9704('0x35')]=_0x5af12d[_0x9704('0x35')]||0x3;this['dialDropRetryFrequency']=_0x5af12d[_0x9704('0x36')]||0x96;this[_0x9704('0x37')]=_0x5af12d[_0x9704('0x37')]||0x3;this[_0x9704('0x38')]=_0x5af12d[_0x9704('0x38')]||0x96;this[_0x9704('0x39')]=_0x5af12d[_0x9704('0x39')]||0x3;this[_0x9704('0x3a')]=_0x5af12d['dialMachineRetryFrequency']||0x96;this[_0x9704('0x3b')]=_0x5af12d[_0x9704('0x3b')]||0x3;this[_0x9704('0x3c')]=_0x5af12d[_0x9704('0x3c')]||0x96;this[_0x9704('0x3d')]=_0x5af12d[_0x9704('0x3d')]||0x4;this[_0x9704('0x3e')]=_0x5af12d[_0x9704('0x3e')]?_0x5af12d[_0x9704('0x3e')]:undefined;this[_0x9704('0x3f')]=_0x5af12d[_0x9704('0x3f')]?_0x5af12d[_0x9704('0x3f')]:undefined;this[_0x9704('0x40')]=_0x5af12d[_0x9704('0x40')]||undefined;this['Interval']=_0x5af12d[_0x9704('0x41')]?_0x5af12d[_0x9704('0x41')]:undefined;this[_0x9704('0x42')]=_0x5af12d['dialOrderByScheduledAt']||_0x9704('0x43');this[_0x9704('0x44')]=_0x5af12d[_0x9704('0x44')]||undefined;this[_0x9704('0x45')]=_0x5af12d[_0x9704('0x45')]||undefined;this[_0x9704('0x46')]=strategy[_0x5af12d[_0x9704('0x46')]]||_0x9704('0x7');this[_0x9704('0x47')]=!![];this['dialAMDActive']=_0x5af12d['dialAMDActive']||![];this[_0x9704('0x48')]=_0x5af12d['dialAMDInitialSilence'];this[_0x9704('0x49')]=_0x5af12d[_0x9704('0x49')];this[_0x9704('0x4a')]=_0x5af12d[_0x9704('0x4a')];this[_0x9704('0x4b')]=_0x5af12d[_0x9704('0x4b')];this[_0x9704('0x4c')]=_0x5af12d[_0x9704('0x4c')];this[_0x9704('0x4d')]=_0x5af12d[_0x9704('0x4d')];this[_0x9704('0x4e')]=_0x5af12d[_0x9704('0x4e')];this['dialAMDSilenceThreshold']=_0x5af12d[_0x9704('0x4f')];this['dialAMDMaximumWordLength']=_0x5af12d[_0x9704('0x50')];this[_0x9704('0x51')]=0x0;this['pTalking']=0x0;this[_0x9704('0x52')]=_0x5af12d[_0x9704('0x52')];this[_0x9704('0x53')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x9704('0x54')]=0x0;this[_0x9704('0x55')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x9704('0x56')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x9704('0x57')]=0x0;this[_0x9704('0x58')]=0x0;this[_0x9704('0x59')]=0x0;this[_0x9704('0x5a')]=0x0;this[_0x9704('0x5b')]=0x0;this[_0x9704('0x5c')]=undefined;this[_0x9704('0x5d')]=undefined;this[_0x9704('0x5e')]=undefined;this[_0x9704('0x5f')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x9704('0x60')]=0x0;this[_0x9704('0x61')]=0x0;this[_0x9704('0x62')]=0x0;this[_0x9704('0x63')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x9704('0x64')]=0x0;this[_0x9704('0x65')]=_0x5af12d['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x9704('0x66')]=_0x5af12d[_0x9704('0x67')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x9704('0x68')]=0x0;this[_0x9704('0x69')]=0x1;this[_0x9704('0x6a')]=0x0;this[_0x9704('0x6b')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x9704('0x6c')]=0x0;this['dialRecallMeTimeout']=_0x5af12d['dialRecallMeTimeout']||0x1e;this[_0x9704('0x6d')]=_0x5af12d['dialRecallInQueue']||![];this[_0x9704('0x6e')]=_0x5af12d[_0x9704('0x6e')]||undefined;this[_0x9704('0x6f')]=_0x5af12d[_0x9704('0x6f')]||![];this[_0x9704('0x70')]=_0x5af12d[_0x9704('0x70')]||![];this[_0x9704('0x9')]=monitorFormat[_0x5af12d[_0x9704('0x9')]]?monitorFormat[_0x5af12d[_0x9704('0x9')]]:undefined;this[_0x9704('0x71')]=_0x5af12d[_0x9704('0x71')]||![];this[_0x9704('0x72')]=_0x5af12d[_0x9704('0x72')]?_0x5af12d[_0x9704('0x72')]:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
index b375b4c..01987e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78c4=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x39dcae,_0x4b6d28){var _0x598df0=function(_0x38b3b3){while(--_0x38b3b3){_0x39dcae['push'](_0x39dcae['shift']());}};_0x598df0(++_0x4b6d28);}(_0x78c4,0x1aa));var _0x478c=function(_0x153633,_0x4f205f){_0x153633=_0x153633-0x0;var _0x4ac73e=_0x78c4[_0x153633];return _0x4ac73e;};'use strict';function VtigerAccount(_0x532a98){this['id']=_0x532a98['id']||0x0;this[_0x478c('0x0')]=_0x532a98[_0x478c('0x0')]||'';this['username']=_0x532a98[_0x478c('0x1')]||'';this[_0x478c('0x2')]=_0x532a98[_0x478c('0x2')]||'';this[_0x478c('0x3')]=_0x532a98[_0x478c('0x3')]||'';this[_0x478c('0x4')]=_0x532a98['serverUrl']||'';this[_0x478c('0x5')]=_0x532a98['Configurations']||{};}module[_0x478c('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x68da=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x2a0976,_0x3e070a){var _0x172bc1=function(_0x1dd90f){while(--_0x1dd90f){_0x2a0976['push'](_0x2a0976['shift']());}};_0x172bc1(++_0x3e070a);}(_0x68da,0x8b));var _0xa68d=function(_0x5bc75a,_0x38ce5c){_0x5bc75a=_0x5bc75a-0x0;var _0x51abb3=_0x68da[_0x5bc75a];return _0x51abb3;};'use strict';function VtigerAccount(_0x4c4255){this['id']=_0x4c4255['id']||0x0;this[_0xa68d('0x0')]=_0x4c4255[_0xa68d('0x0')]||'';this[_0xa68d('0x1')]=_0x4c4255[_0xa68d('0x1')]||'';this[_0xa68d('0x2')]=_0x4c4255[_0xa68d('0x2')]||'';this[_0xa68d('0x3')]=_0x4c4255['remoteUri']||'';this[_0xa68d('0x4')]=_0x4c4255[_0xa68d('0x4')]||'';this[_0xa68d('0x5')]=_0x4c4255[_0xa68d('0x5')]||{};}module[_0xa68d('0x6')]=VtigerAccount;
\ No newline at end of file
index 6ab464e..ab37f3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadb5,0xad));var _0x5adb=function(_0x49ba59,_0x349ed9){_0x49ba59=_0x49ba59-0x0;var _0x199daf=_0xadb5[_0x49ba59];return _0x199daf;};'use strict';function ZendeskAccount(_0x1f969c){this['id']=_0x1f969c['id']||0x0;this[_0x5adb('0x0')]=_0x1f969c['name']||'';this[_0x5adb('0x1')]=_0x1f969c[_0x5adb('0x1')]||'';this[_0x5adb('0x2')]=_0x1f969c['password']||'';this[_0x5adb('0x3')]=_0x1f969c[_0x5adb('0x3')]||'';this[_0x5adb('0x4')]=_0x1f969c['remoteUri']||'';this[_0x5adb('0x5')]=_0x1f969c[_0x5adb('0x5')]||'';this[_0x5adb('0x6')]=_0x1f969c[_0x5adb('0x6')]||_0x5adb('0x7');this[_0x5adb('0x8')]=_0x1f969c[_0x5adb('0x8')]||'';this[_0x5adb('0x9')]=_0x1f969c[_0x5adb('0x9')]||{};}module[_0x5adb('0xa')]=ZendeskAccount;
\ No newline at end of file
+var _0x2ef3=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x2b351d,_0x448855){var _0x219996=function(_0x258771){while(--_0x258771){_0x2b351d['push'](_0x2b351d['shift']());}};_0x219996(++_0x448855);}(_0x2ef3,0xba));var _0x32ef=function(_0x55066f,_0x320f9e){_0x55066f=_0x55066f-0x0;var _0x403b98=_0x2ef3[_0x55066f];return _0x403b98;};'use strict';function ZendeskAccount(_0x4d5ac8){this['id']=_0x4d5ac8['id']||0x0;this[_0x32ef('0x0')]=_0x4d5ac8[_0x32ef('0x0')]||'';this[_0x32ef('0x1')]=_0x4d5ac8[_0x32ef('0x1')]||'';this[_0x32ef('0x2')]=_0x4d5ac8['password']||'';this[_0x32ef('0x3')]=_0x4d5ac8[_0x32ef('0x3')]||'';this['remoteUri']=_0x4d5ac8[_0x32ef('0x4')]||'';this[_0x32ef('0x5')]=_0x4d5ac8['authType']||'';this['type']=_0x4d5ac8[_0x32ef('0x6')]||_0x32ef('0x7');this[_0x32ef('0x8')]=_0x4d5ac8[_0x32ef('0x8')]||'';this[_0x32ef('0x9')]=_0x4d5ac8[_0x32ef('0x9')]||{};}module[_0x32ef('0xa')]=ZendeskAccount;
\ No newline at end of file
index 134a4b2..ee41fba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x557d=['clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone'];(function(_0x45ac03,_0x6a371b){var _0x2adbbb=function(_0x588ed9){while(--_0x588ed9){_0x45ac03['push'](_0x45ac03['shift']());}};_0x2adbbb(++_0x6a371b);}(_0x557d,0xcb));var _0xd557=function(_0xab3a6a,_0xd509df){_0xab3a6a=_0xab3a6a-0x0;var _0x426706=_0x557d[_0xab3a6a];return _0x426706;};'use strict';function ZohoAccount(_0x2debe9){this['id']=_0x2debe9['id']||0x0;this[_0xd557('0x0')]=_0x2debe9[_0xd557('0x0')]||'';this[_0xd557('0x1')]=_0x2debe9['description']||'';this['host']=_0x2debe9[_0xd557('0x2')]||'';this[_0xd557('0x3')]=_0x2debe9['zone']||'';this['clientId']=_0x2debe9['clientId']||'';this[_0xd557('0x4')]=_0x2debe9['clientSecret']||'';this[_0xd557('0x5')]=_0x2debe9[_0xd557('0x5')]||'';this[_0xd557('0x6')]=_0x2debe9['code']||'';this[_0xd557('0x7')]=_0x2debe9['refreshToken']||'';this[_0xd557('0x8')]=_0x2debe9['Configurations']||{};}module['exports']=ZohoAccount;
\ No newline at end of file
+var _0xd05a=['code','refreshToken','Configurations','name','zone','clientId','clientSecret','serverUrl'];(function(_0x3e2540,_0x327f8b){var _0x5b86ef=function(_0x54f797){while(--_0x54f797){_0x3e2540['push'](_0x3e2540['shift']());}};_0x5b86ef(++_0x327f8b);}(_0xd05a,0x143));var _0xad05=function(_0x332603,_0x34d8e6){_0x332603=_0x332603-0x0;var _0x74ee2=_0xd05a[_0x332603];return _0x74ee2;};'use strict';function ZohoAccount(_0x441c8e){this['id']=_0x441c8e['id']||0x0;this[_0xad05('0x0')]=_0x441c8e[_0xad05('0x0')]||'';this['description']=_0x441c8e['description']||'';this['host']=_0x441c8e['host']||'';this[_0xad05('0x1')]=_0x441c8e[_0xad05('0x1')]||'';this[_0xad05('0x2')]=_0x441c8e[_0xad05('0x2')]||'';this[_0xad05('0x3')]=_0x441c8e['clientSecret']||'';this['serverUrl']=_0x441c8e[_0xad05('0x4')]||'';this[_0xad05('0x5')]=_0x441c8e[_0xad05('0x5')]||'';this['refreshToken']=_0x441c8e[_0xad05('0x6')]||'';this[_0xad05('0x7')]=_0x441c8e[_0xad05('0x7')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
index eea189f..b924fe3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf38e=['calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','callback','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','Contact','phone','firstName','lastName','active'];(function(_0x74f120,_0x6c5ded){var _0x3f5629=function(_0x37af0e){while(--_0x37af0e){_0x74f120['push'](_0x74f120['shift']());}};_0x3f5629(++_0x6c5ded);}(_0xf38e,0x1cf));var _0xef38=function(_0x3bc80f,_0x13f768){_0x3bc80f=_0x3bc80f-0x0;var _0x1dbeb7=_0xf38e[_0x3bc80f];return _0x1dbeb7;};'use strict';var util=require(_0xef38('0x0'));var _=require(_0xef38('0x1'));var moment=require(_0xef38('0x2'));function checkNameSurname(_0x340354,_0x126539,_0x42415b){var _0xaab971='';if(!_[_0xef38('0x3')](_0x126539)&&_0xef38('0x4')===typeof _0x126539){_0xaab971+=_0x126539;}if(!_[_0xef38('0x3')](_0x42415b)&&'string'===typeof _0x42415b){_0xaab971+='\x20'+_0x42415b;}if(_0xaab971!==''){return _0xaab971;}return _0x340354;}function Action(_0x52d608,_0x218810,_0x38afc3,_0xbf8111,_0x5ccb78){this['uniqueid']=_0x38afc3||undefined;this[_0xef38('0x5')]=_0x52d608['id'];this[_0xef38('0x6')]=_0x218810[_0xef38('0x7')];this[_0xef38('0x8')]=_0x218810[_0xef38('0x8')];this[_0xef38('0x9')]=_0xef38('0x6');this[_0xef38('0xa')]=![];this['membername']=_[_0xef38('0x3')](_0x52d608[_0xef38('0xb')])?undefined:_0x52d608['Agent'][_0xef38('0x7')];this[_0xef38('0xc')]=this[_0xef38('0xd')]?util[_0xef38('0xe')](_0xef38('0xf'),this[_0xef38('0xd')]):_0xbf8111||undefined;this['calleridname']=checkNameSurname(_0x52d608[_0xef38('0x10')][_0xef38('0x11')],_0x52d608[_0xef38('0x10')][_0xef38('0x12')],_0x52d608['Contact'][_0xef38('0x13')]);this[_0xef38('0x14')]=_0x52d608[_0xef38('0x14')]||![];this[_0xef38('0x15')]=_0x52d608[_0xef38('0x10')][_0xef38('0x11')];this[_0xef38('0x16')]=_0x52d608['scheduledat'];this[_0xef38('0x17')]=_0x52d608[_0xef38('0x17')]||0x0;this[_0xef38('0x18')]=_0x52d608[_0xef38('0x18')]||0x0;this[_0xef38('0x19')]=_0x52d608['countnoanswerretry']||0x0;this[_0xef38('0x1a')]=(_0x52d608[_0xef38('0x17')]||0x0)+(_0x52d608[_0xef38('0x18')]||0x0)+(_0x52d608[_0xef38('0x19')]||0x0)+(_0x52d608['countnosuchnumberretry']||0x0)+(_0x52d608[_0xef38('0x1b')]||0x0)+(_0x52d608['countabandonedretry']||0x0)+(_0x52d608[_0xef38('0x1c')]||0x0)+(_0x52d608[_0xef38('0x1d')]||0x0);this[_0xef38('0x1e')]=_0x52d608['countnosuchnumberretry']||0x0;this[_0xef38('0x1b')]=_0x52d608['countdropretry']||0x0;this['countabandonedretry']=_0x52d608[_0xef38('0x1f')]||0x0;this[_0xef38('0x1c')]=_0x52d608[_0xef38('0x1c')]||0x0;this['countagentrejectretry']=_0x52d608[_0xef38('0x1d')]||0x0;this['callback']=_0x52d608[_0xef38('0x20')];this['callbackuniqueid']=_0x52d608['callbackuniqueid'];this['callbackat']=_0x52d608['callbackat'];this[_0xef38('0x21')]=_0x52d608['recallme'];this[_0xef38('0x22')]=_0x52d608['ContactId'];this[_0xef38('0x23')]=_0x52d608[_0xef38('0x23')];this[_0xef38('0x24')]=_[_0xef38('0x3')](_0x52d608['Agent'])?_0x52d608[_0xef38('0x24')]:_0x52d608[_0xef38('0xb')]['id'];this[_0xef38('0x25')]=_0x52d608[_0xef38('0x25')];this['originatecalleridnum']='';this[_0xef38('0x26')]='';}Action[_0xef38('0x27')]['getCaller']=function(){return util['format'](_0xef38('0x28'),this[_0xef38('0x29')],this[_0xef38('0x2a')]);};module[_0xef38('0x2b')]=Action;
\ No newline at end of file
+var _0xcb55=['uniqueid','campaigntype','queue','dialAnswer','membername','Agent','name','channelAgent','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','lodash','moment','isNil','string'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xcb55,0x7a));var _0x5cb5=function(_0x5b8f60,_0x288ac5){_0x5b8f60=_0x5b8f60-0x0;var _0x2ab68e=_0xcb55[_0x5b8f60];return _0x2ab68e;};'use strict';var util=require('util');var _=require(_0x5cb5('0x0'));var moment=require(_0x5cb5('0x1'));function checkNameSurname(_0x4e81f5,_0xdf05d2,_0x4c8f38){var _0x504e63='';if(!_[_0x5cb5('0x2')](_0xdf05d2)&&_0x5cb5('0x3')===typeof _0xdf05d2){_0x504e63+=_0xdf05d2;}if(!_['isNil'](_0x4c8f38)&&_0x5cb5('0x3')===typeof _0x4c8f38){_0x504e63+='\x20'+_0x4c8f38;}if(_0x504e63!==''){return _0x504e63;}return _0x4e81f5;}function Action(_0x53e8ed,_0x2a91a2,_0x8806fe,_0x773103,_0x4d971f){this[_0x5cb5('0x4')]=_0x8806fe||undefined;this['idContact']=_0x53e8ed['id'];this['queue']=_0x2a91a2['name'];this['type']=_0x2a91a2['type'];this[_0x5cb5('0x5')]=_0x5cb5('0x6');this[_0x5cb5('0x7')]=![];this[_0x5cb5('0x8')]=_[_0x5cb5('0x2')](_0x53e8ed[_0x5cb5('0x9')])?undefined:_0x53e8ed[_0x5cb5('0x9')][_0x5cb5('0xa')];this[_0x5cb5('0xb')]=this[_0x5cb5('0x8')]?util['format'](_0x5cb5('0xc'),this['membername']):_0x773103||undefined;this[_0x5cb5('0xd')]=checkNameSurname(_0x53e8ed['Contact'][_0x5cb5('0xe')],_0x53e8ed[_0x5cb5('0xf')][_0x5cb5('0x10')],_0x53e8ed[_0x5cb5('0xf')][_0x5cb5('0x11')]);this['active']=_0x53e8ed[_0x5cb5('0x12')]||![];this[_0x5cb5('0x13')]=_0x53e8ed[_0x5cb5('0xf')]['phone'];this[_0x5cb5('0x14')]=_0x53e8ed[_0x5cb5('0x14')];this[_0x5cb5('0x15')]=_0x53e8ed[_0x5cb5('0x15')]||0x0;this[_0x5cb5('0x16')]=_0x53e8ed[_0x5cb5('0x16')]||0x0;this['countnoanswerretry']=_0x53e8ed[_0x5cb5('0x17')]||0x0;this[_0x5cb5('0x18')]=(_0x53e8ed['countbusyretry']||0x0)+(_0x53e8ed[_0x5cb5('0x16')]||0x0)+(_0x53e8ed['countnoanswerretry']||0x0)+(_0x53e8ed['countnosuchnumberretry']||0x0)+(_0x53e8ed[_0x5cb5('0x19')]||0x0)+(_0x53e8ed[_0x5cb5('0x1a')]||0x0)+(_0x53e8ed[_0x5cb5('0x1b')]||0x0)+(_0x53e8ed[_0x5cb5('0x1c')]||0x0);this['countnosuchnumberretry']=_0x53e8ed[_0x5cb5('0x1d')]||0x0;this[_0x5cb5('0x19')]=_0x53e8ed[_0x5cb5('0x19')]||0x0;this[_0x5cb5('0x1a')]=_0x53e8ed[_0x5cb5('0x1a')]||0x0;this[_0x5cb5('0x1b')]=_0x53e8ed[_0x5cb5('0x1b')]||0x0;this[_0x5cb5('0x1c')]=_0x53e8ed[_0x5cb5('0x1c')]||0x0;this['callback']=_0x53e8ed[_0x5cb5('0x1e')];this[_0x5cb5('0x1f')]=_0x53e8ed['callbackuniqueid'];this['callbackat']=_0x53e8ed[_0x5cb5('0x20')];this['recallme']=_0x53e8ed['recallme'];this[_0x5cb5('0x21')]=_0x53e8ed[_0x5cb5('0x21')];this[_0x5cb5('0x22')]=_0x53e8ed[_0x5cb5('0x22')];this['UserId']=_['isNil'](_0x53e8ed[_0x5cb5('0x9')])?_0x53e8ed[_0x5cb5('0x23')]:_0x53e8ed[_0x5cb5('0x9')]['id'];this['VoiceQueueId']=_0x53e8ed[_0x5cb5('0x24')];this[_0x5cb5('0x25')]='';this[_0x5cb5('0x26')]='';}Action[_0x5cb5('0x27')][_0x5cb5('0x28')]=function(){return util['format'](_0x5cb5('0x29'),this[_0x5cb5('0xd')],this['number']);};module['exports']=Action;
\ No newline at end of file
index e8c30d7..5c2dc9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa90=['originatecalleridnum','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','syncNewExten','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','callProgressDetectingCustomer','[syncHangup][talking][cause]','cause','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','waiting','loggedInDb','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','hasOwnProperty','dialMethod','clearZombieChannels','dialActive','setMessage','recallMe','enqueue','info','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','clearZombieChannel','then','isNil','length','getDiff','scheduledat','Agent','logger2','[RecallMe]','starttime','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','logCustomer','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','unlockAgent','activeContact','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','\x20Queue','linkedid','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','dialBusyMaxRetry','NOANSWER','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','scheduledAt','countnoanswerretry','countcongestionretry','Congestion','custom:agentcongestion','congestion','dialCongestionMaxRetry','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','outboundAbandonedCallsDay','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','countabandonedretry','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Queue','lookAgent','[Preview][execCall][success]','Queue:\x20','idContact','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','run','unlockContact','disableContact','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','substring','dialCutDigit','dialPrefix','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdName','originatecalleridname','extractCalleridName'];(function(_0x164c0f,_0x551d06){var _0xee3f29=function(_0x30741f){while(--_0x30741f){_0x164c0f['push'](_0x164c0f['shift']());}};_0xee3f29(++_0x551d06);}(_0xfa90,0x16e));var _0x0fa9=function(_0x338b0c,_0x30bfa3){_0x338b0c=_0x338b0c-0x0;var _0x48e837=_0xfa90[_0x338b0c];return _0x48e837;};'use strict';var util=require(_0x0fa9('0x0'));var _=require(_0x0fa9('0x1'));var BPromise=require(_0x0fa9('0x2'));var uuid=require(_0x0fa9('0x3'));var moment=require(_0x0fa9('0x4'));var md5=require(_0x0fa9('0x5'));var Redis=require(_0x0fa9('0x6'));var config=require(_0x0fa9('0x7'));var logger=require(_0x0fa9('0x8'))(_0x0fa9('0x9'));var loggerAction=require('../../../config/logger')(_0x0fa9('0xa'));var ami=require(_0x0fa9('0xb'));var rpcDb=require('./rpcDb');var Action=require(_0x0fa9('0xc'));var ut=require(_0x0fa9('0xd'));config[_0x0fa9('0xe')]=_[_0x0fa9('0xf')](config[_0x0fa9('0xe')],{'host':_0x0fa9('0x10'),'port':0x18eb});var io=require(_0x0fa9('0x11'))(new Redis(config[_0x0fa9('0xe')]));var Sequence=function(){};Sequence[_0x0fa9('0x12')]['enqueue']=function(_0x5cde0d){this[_0x0fa9('0x13')]=this[_0x0fa9('0x13')]?this[_0x0fa9('0x13')][_0x0fa9('0x14')](_0x5cde0d):_0x5cde0d();};function Preview(_0x140040){this[_0x0fa9('0x15')]=new Sequence();this[_0x0fa9('0x16')]=_0x140040[_0x0fa9('0x17')];this['trunks']=_0x140040[_0x0fa9('0x18')];this[_0x0fa9('0x19')]={};this[_0x0fa9('0x1a')]=_0x140040['agents'];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0x0fa9('0x1b')][_0x0fa9('0x1c')](this));ami['on'](_0x0fa9('0x1d'),this[_0x0fa9('0x1e')][_0x0fa9('0x1c')](this));ami['on'](_0x0fa9('0x1f'),this[_0x0fa9('0x20')][_0x0fa9('0x1c')](this));ami['on']('dialend',this[_0x0fa9('0x21')][_0x0fa9('0x1c')](this));ami['on'](_0x0fa9('0x22'),this['syncNewExten']['bind'](this));ami['on'](_0x0fa9('0x23'),this[_0x0fa9('0x24')][_0x0fa9('0x1c')](this));ami['on'](_0x0fa9('0x25'),this[_0x0fa9('0x26')][_0x0fa9('0x1c')](this));ami['on']('blindtransfer',this[_0x0fa9('0x27')]['bind'](this));this[_0x0fa9('0x28')](this[_0x0fa9('0x16')]);}function emit(_0x56568a,_0x53f93f,_0x5b6149){io['to'](_0x56568a)[_0x0fa9('0x29')](_0x53f93f,_0x5b6149);}function emitCampaignPreview(_0x4b4a1f){if(_0x4b4a1f[_0x0fa9('0x2a')]===_0x0fa9('0x2b')){var _0x14386e={'id':_0x4b4a1f['id'],'name':_0x4b4a1f[_0x0fa9('0x2c')],'strategy':_0x4b4a1f[_0x0fa9('0x2d')],'answered':_0x4b4a1f[_0x0fa9('0x2e')],'available':_0x4b4a1f['available'],'loggedIn':_0x4b4a1f[_0x0fa9('0x2f')],'pTalking':_0x4b4a1f[_0x0fa9('0x30')],'sumBillable':_0x4b4a1f[_0x0fa9('0x31')],'sumDuration':_0x4b4a1f[_0x0fa9('0x32')],'sumHoldTime':_0x4b4a1f[_0x0fa9('0x33')]||0x0,'talking':_0x4b4a1f['talking'],'total':_0x4b4a1f[_0x0fa9('0x34')],'type':_0x4b4a1f[_0x0fa9('0x2a')],'unmanaged':_0x4b4a1f[_0x0fa9('0x35')],'abandoned':_0x4b4a1f['abandoned'],'waiting':_0x4b4a1f[_0x0fa9('0x36')],'loggedInDb':_0x4b4a1f[_0x0fa9('0x37')],'dialActive':_0x4b4a1f['dialActive'],'dialMethod':_0x4b4a1f['dialMethod'],'dialOriginateCallerIdName':_0x4b4a1f['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4b4a1f[_0x0fa9('0x38')],'dialOriginateTimeout':_0x4b4a1f[_0x0fa9('0x39')],'dialPrefix':_0x4b4a1f['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4b4a1f[_0x0fa9('0x3a')],'outboundAnswerCallsDay':_0x4b4a1f[_0x0fa9('0x3b')],'outboundBlacklistCallsDay':_0x4b4a1f[_0x0fa9('0x3c')],'outboundBusyCallsDay':_0x4b4a1f[_0x0fa9('0x3d')],'outboundCongestionCallsDay':_0x4b4a1f[_0x0fa9('0x3e')],'outboundDropCallsDayACS':_0x4b4a1f[_0x0fa9('0x3f')],'outboundDropCallsDayCallersExit':_0x4b4a1f[_0x0fa9('0x40')],'outboundDropCallsDayTimeout':_0x4b4a1f[_0x0fa9('0x41')],'outboundNoAnswerCallsDay':_0x4b4a1f[_0x0fa9('0x42')],'outboundNoSuchCallsDay':_0x4b4a1f[_0x0fa9('0x43')],'outboundOriginateFailureCallsDay':_0x4b4a1f[_0x0fa9('0x44')],'outboundReCallsDay':_0x4b4a1f[_0x0fa9('0x45')],'outboundRejectCallsDay':_0x4b4a1f[_0x0fa9('0x46')],'outboundUnknownCallsDay':_0x4b4a1f[_0x0fa9('0x47')],'outboundAbandonedCallsDay':_0x4b4a1f['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x4b4a1f['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x4b4a1f[_0x0fa9('0x48')],'predictiveIntervalAvgTalktime':_0x4b4a1f[_0x0fa9('0x49')],'predictiveIntervalDroppedCallsCallersExit':_0x4b4a1f['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4b4a1f[_0x0fa9('0x4a')],'predictiveIntervalErlangCalls':_0x4b4a1f[_0x0fa9('0x4b')],'predictiveIntervalErlangCallsDroppedCalls':_0x4b4a1f[_0x0fa9('0x4c')],'predictiveIntervalHitRate':_0x4b4a1f['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4b4a1f[_0x0fa9('0x4d')],'predictiveIntervalPauses':_0x4b4a1f['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4b4a1f[_0x0fa9('0x4e')],'predictiveIntervalTotalCalls':_0x4b4a1f[_0x0fa9('0x4f')],'message':_0x4b4a1f[_0x0fa9('0x50')],'originated':_0x4b4a1f[_0x0fa9('0x51')],'erlangCalls':_0x4b4a1f[_0x0fa9('0x52')],'erlangCallToSecond':_0x4b4a1f[_0x0fa9('0x53')],'erlangAbandonmentRate':_0x4b4a1f[_0x0fa9('0x54')],'erlangBusyFactor':_0x4b4a1f['erlangBusyFactor'],'startPredictive':_0x4b4a1f[_0x0fa9('0x55')],'startProgressive':_0x4b4a1f['startProgressive']};if(_0x4b4a1f[_0x0fa9('0x56')]){_0x14386e[_0x0fa9('0x56')]={'id':_0x4b4a1f[_0x0fa9('0x56')]['id'],'name':_0x4b4a1f[_0x0fa9('0x56')][_0x0fa9('0x2c')],'active':_0x4b4a1f[_0x0fa9('0x56')][_0x0fa9('0x57')],'callerid':_0x4b4a1f[_0x0fa9('0x56')][_0x0fa9('0x58')]};}if(_0x4b4a1f['Interval']){_0x14386e['Interval']={'id':_0x4b4a1f['Interval']['id'],'name':_0x4b4a1f[_0x0fa9('0x59')][_0x0fa9('0x2c')]};}var _0x5e8044=md5(JSON[_0x0fa9('0x5a')](_0x14386e));if(_0x4b4a1f[_0x0fa9('0x5')]!==_0x5e8044){_0x4b4a1f[_0x0fa9('0x5')]=_0x5e8044;emit(util[_0x0fa9('0x5b')](_0x0fa9('0x5c'),_0x14386e['name']),_0x0fa9('0x5d'),_0x14386e);}}}function emitVoiceQueueChannelRemove(_0x3fe731){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x3fe731));emit(util[_0x0fa9('0x5b')](_0x0fa9('0x5c'),_0x3fe731[_0x0fa9('0x2c')]),_0x0fa9('0x5e'),_0x3fe731);}function notSendMessagesQueue(_0x4754ff){if(_0x4754ff['sendMessageOneNotActive']){if(_0x4754ff[_0x0fa9('0x51')]===0x0&&_0x4754ff[_0x0fa9('0x30')]===0x0){_0x4754ff[_0x0fa9('0x5f')]=![];_0x4754ff[_0x0fa9('0x60')]=0x0;_0x4754ff[_0x0fa9('0x61')]=0x0;_0x4754ff[_0x0fa9('0x50')]=_0x0fa9('0x62');ut[_0x0fa9('0x63')](_0x0fa9('0x64'),_0x4754ff[_0x0fa9('0x2c')]+_0x0fa9('0x65'));}else{_0x4754ff['message']=_0x0fa9('0x66');ut[_0x0fa9('0x63')](_0x0fa9('0x64'),_0x4754ff['name']+_0x0fa9('0x67'));}emitCampaignPreview(_0x4754ff);}}Preview[_0x0fa9('0x12')][_0x0fa9('0x28')]=function(){var _0x2e12ef=this;setInterval(function(){_0x2e12ef['syncCampaigns']();},0x7cf);};Preview[_0x0fa9('0x12')][_0x0fa9('0x68')]=function(){var _0x22a001=this[_0x0fa9('0x16')];this[_0x0fa9('0x69')]+=0x1;for(var _0x1625ab in _0x22a001){if(_0x22a001[_0x0fa9('0x6a')](_0x1625ab)&&(_0x22a001[_0x1625ab][_0x0fa9('0x6b')]===_0x0fa9('0x9')||_0x22a001[_0x1625ab][_0x0fa9('0x6b')]==='booked')&&_0x22a001[_0x1625ab][_0x0fa9('0x2a')]===_0x0fa9('0x2b')){if(this[_0x0fa9('0x69')]>0x7){this[_0x0fa9('0x69')]=0x0;this[_0x0fa9('0x6c')]();}}if(_0x22a001[_0x0fa9('0x6a')](_0x1625ab)&&_0x22a001[_0x1625ab]['dialMethod']===_0x0fa9('0x9')&&_0x22a001[_0x1625ab][_0x0fa9('0x2a')]===_0x0fa9('0x2b')){if(_0x22a001[_0x1625ab][_0x0fa9('0x6d')]){this[_0x0fa9('0x6e')](_0x22a001[_0x1625ab]);this[_0x0fa9('0x6f')](_0x22a001[_0x1625ab]);}else{notSendMessagesQueue(_0x22a001[_0x1625ab]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x55a09f){var _0x404a39=this;this[_0x0fa9('0x15')][_0x0fa9('0x70')](function(){if(!_['isNil'](_0x404a39[_0x0fa9('0x19')][_0x55a09f])){loggerAction[_0x0fa9('0x71')]('[clearZombieChannels][talking]',_0x55a09f,'Queue',_0x404a39[_0x0fa9('0x19')][_0x55a09f]['queue'],_0x0fa9('0x72'),JSON['stringify'](_0x404a39['campaignsPreview'][_0x404a39[_0x0fa9('0x19')][_0x55a09f][_0x0fa9('0x73')]][_0x0fa9('0x51')]),_0x0fa9('0x74'),JSON[_0x0fa9('0x5a')](_0x404a39[_0x0fa9('0x16')][_0x404a39['actions'][_0x55a09f][_0x0fa9('0x73')]][_0x0fa9('0x30')]),JSON[_0x0fa9('0x5a')](_0x404a39[_0x0fa9('0x19')][_0x55a09f][_0x0fa9('0x75')]),JSON[_0x0fa9('0x5a')](_[_0x0fa9('0x76')](_0x404a39[_0x0fa9('0x19')][_0x55a09f],[_0x0fa9('0x77'),_0x0fa9('0x78'),_0x0fa9('0x79'),_0x0fa9('0x7a')])));return ami[_0x0fa9('0x7b')]({'action':_0x0fa9('0x7c'),'channel':_0x404a39[_0x0fa9('0x19')][_0x55a09f][_0x0fa9('0x7d')]})[_0x0fa9('0x7e')](function(_0x3d475e){if(_0x3d475e[_0x0fa9('0x50')]===_0x0fa9('0x7f')){setTimeout(function(){if(_0x404a39[_0x0fa9('0x19')][_0x55a09f]){ut[_0x0fa9('0x80')](_0x404a39['campaignsPreview'][_0x404a39[_0x0fa9('0x19')][_0x55a09f][_0x0fa9('0x73')]],_0x0fa9('0x81'));if(_0x404a39[_0x0fa9('0x19')][_0x55a09f]['dialAnswer']===!![]){ut['decrementTalkink'](_0x404a39[_0x0fa9('0x16')][_0x404a39[_0x0fa9('0x19')][_0x55a09f][_0x0fa9('0x73')]],_0x0fa9('0x81'));ut[_0x0fa9('0x82')](_0x0fa9('0x83')+_0x55a09f,_0x404a39['actions'][_0x55a09f]['queue']);}ut[_0x0fa9('0x82')](_0x0fa9('0x84')+_0x55a09f,_0x404a39[_0x0fa9('0x19')][_0x55a09f][_0x0fa9('0x73')]);delete _0x404a39['actions'][_0x55a09f];}},0x2328);}});}});};Preview[_0x0fa9('0x12')][_0x0fa9('0x6c')]=function(){var _0x5d2f5b=this;loggerAction[_0x0fa9('0x71')]('[action]',_[_0x0fa9('0x85')](this[_0x0fa9('0x19')]));for(var _0x38ef68 in this['actions']){if(_0x5d2f5b[_0x0fa9('0x19')]['hasOwnProperty'](_0x38ef68)){_0x5d2f5b[_0x0fa9('0x86')](_0x38ef68);}}};Preview[_0x0fa9('0x12')][_0x0fa9('0x6f')]=function(_0x3a5bcc){var _0x41e39d=this;rpcDb['getContactRecallMe'](_0x3a5bcc['id'],ut['agentReadyId'](this['agents']))[_0x0fa9('0x87')](function(_0x2d3a24){if(!_[_0x0fa9('0x88')](_0x2d3a24)){for(var _0x1d98e8=0x0;_0x1d98e8<_0x2d3a24[_0x0fa9('0x89')];_0x1d98e8+=0x1){if(ut[_0x0fa9('0x8a')](_0x2d3a24[_0x1d98e8][_0x0fa9('0x8b')])<_0x3a5bcc['dialRecallMeTimeout']*0x3c){if(_0x2d3a24[_0x1d98e8][_0x0fa9('0x8c')]&&!_0x2d3a24[_0x1d98e8][_0x0fa9('0x8c')]['voicePause']){_0x41e39d['run'](_0x2d3a24[_0x1d98e8]['id'])[_0x0fa9('0x87')](ut[_0x0fa9('0x8d')](_0x0fa9('0x8e')))[_0x0fa9('0x7e')](ut[_0x0fa9('0x8d')]('[RecallMe]'));}else{rpcDb['disableContact'](_0x2d3a24[_0x1d98e8]['id']);}}else{var _0x2ff69f=new Action(_0x2d3a24[_0x1d98e8],_0x3a5bcc);_0x2ff69f[_0x0fa9('0x8f')]=moment()[_0x0fa9('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a5bcc[_0x0fa9('0x45')]+=0x1;ut['logCustomer'](_0x2ff69f,0x17,_0x0fa9('0x90'));if(_0x3a5bcc[_0x0fa9('0x91')]){rpcDb['rescheduleContactInQueue'](ut[_0x0fa9('0x92')](_0x2d3a24[_0x1d98e8]));rpcDb[_0x0fa9('0x93')](_0x2ff69f,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x0fa9('0x94')](_0x2ff69f,0x16,'RecallFailedTimeout');rpcDb[_0x0fa9('0x93')](_0x2ff69f,_0x0fa9('0x95'));rpcDb[_0x0fa9('0x96')](_0x2ff69f,_0x0fa9('0x95'));}}}}})['catch'](ut[_0x0fa9('0x8d')](_0x0fa9('0x97')));};Preview['prototype']['setMessage']=function(_0x114c66){_0x114c66['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x114c66['loggedIn'])){_0x114c66['message']=_0x0fa9('0x98');}else if(!ut[_0x0fa9('0x99')](_0x114c66[_0x0fa9('0x6d')])){_0x114c66[_0x0fa9('0x50')]=_0x0fa9('0x62');}else if(!this[_0x0fa9('0x9a')](_0x114c66[_0x0fa9('0x56')])){if(!this[_0x0fa9('0x9a')](_0x114c66[_0x0fa9('0x9b')])){_0x114c66['message']=_0x0fa9('0x9c');}else{_0x114c66[_0x0fa9('0x50')]='ACTIVE';}}else{_0x114c66[_0x0fa9('0x50')]='ACTIVE';}emitCampaignPreview(_0x114c66);};Preview[_0x0fa9('0x12')]['callProgressDetectingCustomer']=function(_0x3db612,_0xafb075,_0x3a6533){var _0x5914be=this;var _0x2aaacf=this[_0x0fa9('0x19')][_0xafb075];var _0xa885ad=this['campaignsPreview'][_0x2aaacf[_0x0fa9('0x73')]];var _0x5375e9;if(_0xa885ad){switch(_0x3a6533){case'1':_0xa885ad['outboundNoSuchCallsDay']+=0x1;_0x2aaacf[_0x0fa9('0x9d')]+=0x1;_0x2aaacf[_0x0fa9('0x9e')]=ut[_0x0fa9('0x9f')](_0x2aaacf);ut[_0x0fa9('0x94')](_0x2aaacf,0x0,_0x0fa9('0xa0'));ami[_0x0fa9('0x29')](_0x0fa9('0xa1'),ut[_0x0fa9('0xa2')](_0x2aaacf,_0x0fa9('0xa3')));rpcDb[_0x0fa9('0x93')](_0x2aaacf,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x2aaacf)>=_0xa885ad[_0x0fa9('0xa4')]){_0x5375e9=ut['cloneAction'](_0x2aaacf,0xf,_0x0fa9('0xa5'));rpcDb[_0x0fa9('0x96')](_0x5375e9,_0x0fa9('0xa6'));}else{if(_0x2aaacf[_0x0fa9('0x9d')]>=_0xa885ad[_0x0fa9('0xa7')]){rpcDb[_0x0fa9('0x96')](_0x2aaacf,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x0fa9('0xa8')](ut['scheduledAt'](_0x2aaacf,_0x0fa9('0x9d'),_0xa885ad['dialNoSuchNumberRetryFrequency']),_0x2aaacf[_0x0fa9('0xa9')],_0x2aaacf[_0x0fa9('0xaa')]);}}delete this['actions'][_0x3db612['linkedid']];break;case _0x0fa9('0xab'):var _0x41a1db=moment()[_0x0fa9('0x5b')](_0x0fa9('0xac'));_0x2aaacf[_0x0fa9('0xad')]=_0x41a1db;_0x2aaacf[_0x0fa9('0xae')]=_0x41a1db;_0x2aaacf['dialAnswer']=!![];_0xa885ad[_0x0fa9('0x30')]+=0x1;logger[_0x0fa9('0x71')](_0x0fa9('0xaf'),_0x2aaacf[_0x0fa9('0xb0')],'\x20Queue',_0xa885ad[_0x0fa9('0x2c')],_0x0fa9('0x74'),_0xa885ad[_0x0fa9('0x30')]);ami[_0x0fa9('0x29')](_0x0fa9('0xb1'),ut[_0x0fa9('0xa2')](_0x2aaacf,'connect'));if(_0xa885ad['acw']){ami[_0x0fa9('0x29')](_0x0fa9('0xb2'),ut[_0x0fa9('0xb3')](_0x2aaacf));}break;case'16':ami[_0x0fa9('0x29')](_0x0fa9('0xb4'),ut[_0x0fa9('0xa2')](_0x2aaacf,_0x0fa9('0xb5')));emitVoiceQueueChannelRemove(ut[_0x0fa9('0xa2')](_0x2aaacf,'complete'));_0xa885ad[_0x0fa9('0x3b')]+=0x1;_0xa885ad[_0x0fa9('0x34')]+=0x1;_0xa885ad['answered']+=0x1;ut['decrementTalkink'](_0xa885ad,_0x0fa9('0xb6'));_0x2aaacf[_0x0fa9('0x9e')]=ut[_0x0fa9('0x9f')](_0x2aaacf);ut['logCustomer'](_0x2aaacf,0x4,_0x0fa9('0xb7'));rpcDb[_0x0fa9('0x93')](_0x2aaacf,_0x0fa9('0xb8'));rpcDb[_0x0fa9('0x96')](_0x2aaacf,_0x0fa9('0xb9'));rpcDb['crateCustomerReportQueue'](_0x2aaacf);_0xa885ad['sumDuration']+=_0x2aaacf[_0x0fa9('0xba')];_0xa885ad[_0x0fa9('0x31')]+=_0x2aaacf['talktime'];logger[_0x0fa9('0x71')](_0x0fa9('0xbb'),_0x2aaacf[_0x0fa9('0xb0')],_0x0fa9('0xbc'),_0xa885ad['name'],'pTalking:\x20',_0xa885ad[_0x0fa9('0x30')]);delete this[_0x0fa9('0x19')][_0x3db612[_0x0fa9('0xbd')]];break;case'BUSY':_0xa885ad[_0x0fa9('0x3d')]+=0x1;_0x2aaacf[_0x0fa9('0xbe')]+=0x1;_0x2aaacf[_0x0fa9('0x9e')]=ut['totalGlobal'](_0x2aaacf);ut[_0x0fa9('0x94')](_0x2aaacf,0x5,'Busy');ami[_0x0fa9('0x29')](_0x0fa9('0xbf'),ut[_0x0fa9('0xa2')](_0x2aaacf,_0x0fa9('0xc0')));rpcDb[_0x0fa9('0x93')](_0x2aaacf,_0x0fa9('0xc1'));if(ut[_0x0fa9('0x9f')](_0x2aaacf)>=_0xa885ad[_0x0fa9('0xa4')]){_0x5375e9=ut[_0x0fa9('0xc2')](_0x2aaacf,0xf,_0x0fa9('0xa5'));rpcDb['createCustomerFinal'](_0x5375e9,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2aaacf[_0x0fa9('0xbe')]>=_0xa885ad[_0x0fa9('0xc3')]){rpcDb[_0x0fa9('0x96')](_0x2aaacf,_0x0fa9('0xc1'));}else{rpcDb[_0x0fa9('0xa8')](ut['scheduledAt'](_0x2aaacf,'countbusyretry',_0xa885ad['dialBusyRetryFrequency']),_0x2aaacf['unlockAgent'],_0x2aaacf[_0x0fa9('0xaa')]);}}break;case _0x0fa9('0xc4'):_0xa885ad[_0x0fa9('0x42')]+=0x1;_0x2aaacf['countnoanswerretry']+=0x1;_0x2aaacf[_0x0fa9('0x9e')]=ut[_0x0fa9('0x9f')](_0x2aaacf);ut['logCustomer'](_0x2aaacf,0x3,_0x0fa9('0xc5'));ami['emit'](_0x0fa9('0xc6'),ut[_0x0fa9('0xa2')](_0x2aaacf,_0x0fa9('0xc7')));rpcDb[_0x0fa9('0x93')](_0x2aaacf,_0x0fa9('0xc8'));if(ut[_0x0fa9('0x9f')](_0x2aaacf)>=_0xa885ad[_0x0fa9('0xa4')]){_0x5375e9=ut[_0x0fa9('0xc2')](_0x2aaacf,0xf,_0x0fa9('0xa5'));rpcDb[_0x0fa9('0x96')](_0x5375e9,_0x0fa9('0xc9'));}else{if(_0x2aaacf['countnoanswerretry']>=_0xa885ad[_0x0fa9('0xca')]){rpcDb['createCustomerFinal'](_0x2aaacf,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x0fa9('0xa8')](ut[_0x0fa9('0xcb')](_0x2aaacf,_0x0fa9('0xcc'),_0xa885ad['dialNoAnswerRetryFrequency']),_0x2aaacf[_0x0fa9('0xa9')],_0x2aaacf['activeContact']);}}break;case'CONGESTION':_0xa885ad['outboundCongestionCallsDay']+=0x1;_0x2aaacf[_0x0fa9('0xcd')]+=0x1;_0x2aaacf[_0x0fa9('0x9e')]=ut[_0x0fa9('0x9f')](_0x2aaacf);ut['logCustomer'](_0x2aaacf,0x8,_0x0fa9('0xce'));ami['emit'](_0x0fa9('0xcf'),ut[_0x0fa9('0xa2')](_0x2aaacf,_0x0fa9('0xd0')));rpcDb[_0x0fa9('0x93')](_0x2aaacf,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x0fa9('0x9f')](_0x2aaacf)>=_0xa885ad[_0x0fa9('0xa4')]){_0x5375e9=ut[_0x0fa9('0xc2')](_0x2aaacf,0xf,_0x0fa9('0xa5'));rpcDb['createCustomerFinal'](_0x5375e9,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2aaacf[_0x0fa9('0xcd')]>=_0xa885ad[_0x0fa9('0xd1')]){rpcDb[_0x0fa9('0x96')](_0x2aaacf,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x0fa9('0xa8')](ut[_0x0fa9('0xcb')](_0x2aaacf,_0x0fa9('0xcd'),_0xa885ad[_0x0fa9('0xd2')]),_0x2aaacf[_0x0fa9('0xa9')],_0x2aaacf[_0x0fa9('0xaa')]);}}break;case _0x0fa9('0xd3'):_0xa885ad[_0x0fa9('0x46')]+=0x1;_0x2aaacf[_0x0fa9('0xd4')]+=0x1;_0x2aaacf['countglobal']=ut[_0x0fa9('0x9f')](_0x2aaacf);ut[_0x0fa9('0x94')](_0x2aaacf,0x14,_0x0fa9('0xd5'));ami['emit'](_0x0fa9('0xd6'),ut['buildObj'](_0x2aaacf,_0x0fa9('0xd7')));rpcDb[_0x0fa9('0x93')](_0x2aaacf,'[syncHangupRequest][logAgentReject]');if(ut[_0x0fa9('0x9f')](_0x2aaacf)>=_0xa885ad[_0x0fa9('0xa4')]){_0x5375e9=ut[_0x0fa9('0xc2')](_0x2aaacf,0x14,_0x0fa9('0xd5'));rpcDb[_0x0fa9('0x96')](_0x5375e9,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x2aaacf['countagentrejectretry']>=_0xa885ad[_0x0fa9('0xd8')]){rpcDb[_0x0fa9('0x96')](_0x2aaacf,_0x0fa9('0xd9'));}else{rpcDb['rescheduleContact'](ut[_0x0fa9('0xcb')](_0x2aaacf,'countagentrejectretry',_0xa885ad['dialAgentRejectRetryFrequency']),_0x2aaacf[_0x0fa9('0xa9')],_0x2aaacf['activeContact']);}}break;case _0x0fa9('0xda'):_0xa885ad[_0x0fa9('0xdb')]+=0x1;_0x2aaacf['countabandonedretry']+=0x1;_0x2aaacf['countglobal']=ut['totalGlobal'](_0x2aaacf);ut['logCustomer'](_0x2aaacf,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x2aaacf,_0x0fa9('0xdc'));if(ut[_0x0fa9('0x9f')](_0x2aaacf)>=_0xa885ad[_0x0fa9('0xa4')]){_0x5375e9=ut[_0x0fa9('0xc2')](_0x2aaacf,0xf,_0x0fa9('0xa5'));rpcDb[_0x0fa9('0x96')](_0x5375e9,_0x0fa9('0xdc'));}else{if(_0x2aaacf[_0x0fa9('0xdd')]>=_0xa885ad['dialAbandonedMaxRety']){rpcDb[_0x0fa9('0x96')](_0x2aaacf,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x0fa9('0xa8')](ut['scheduledAt'](_0x2aaacf,_0x0fa9('0xde'),_0xa885ad['dialAbandonedRetryFrequency']),_0x2aaacf[_0x0fa9('0xa9')],_0x2aaacf[_0x0fa9('0xaa')]);}}break;default:if(_0x2aaacf[_0x0fa9('0x75')]){ut['decrementTalkink'](_0xa885ad,_0x0fa9('0xdf'));ut[_0x0fa9('0x82')](_0x0fa9('0xe0')+_0xa885ad['name'],_0x3db612);}_0xa885ad[_0x0fa9('0x47')]+=0x1;_0x2aaacf[_0x0fa9('0x9e')]=ut['totalGlobal'](_0x2aaacf);ut[_0x0fa9('0x94')](_0x2aaacf,0xc,_0x3db612[_0x0fa9('0xe1')]||_0x3db612[_0x0fa9('0xe2')]);rpcDb[_0x0fa9('0x93')](_0x2aaacf,_0x0fa9('0xe3'));if(ut[_0x0fa9('0x9f')](_0x2aaacf)>=_0xa885ad[_0x0fa9('0xa4')]){_0x5375e9=ut[_0x0fa9('0xc2')](_0x2aaacf,0xf,_0x0fa9('0xa5'));rpcDb[_0x0fa9('0x96')](_0x5375e9,_0x0fa9('0xe4'));}else{rpcDb[_0x0fa9('0x96')](_0x2aaacf,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x0fa9('0x19')][_0x3db612['linkedid']];}if(!(_0x2aaacf[_0x0fa9('0x75')]&&_0x3a6533==='16')){ut[_0x0fa9('0x80')](_0xa885ad,_0x0fa9('0xe5'));logger[_0x0fa9('0x71')](_0x0fa9('0xe6'),_0x2aaacf['uniqueid'],_0x0fa9('0xbc'),_0xa885ad[_0x0fa9('0x2c')],_0x0fa9('0x72'),_0xa885ad['originated']);}if(_0x3a6533!==_0x0fa9('0xab')){delete this[_0x0fa9('0x19')][_0x3db612[_0x0fa9('0xbd')]];delete this[_0x0fa9('0x19')][_0x3db612[_0x0fa9('0xe7')]];}}};Preview[_0x0fa9('0x12')][_0x0fa9('0xe8')]=function(_0x37a2cd,_0x2a827d,_0x301999){if(_[_0x0fa9('0xe9')](_0x2a827d)&&_0x0fa9('0xea')!==typeof _0x2a827d){return;}if(_[_0x0fa9('0xe9')](_0x301999)&&_0x0fa9('0xea')!==typeof _0x301999){return;}switch(_0x301999['reason']){case'0':ut['logAgent'](_0x37a2cd,0x0,'NoSuchNumber');rpcDb[_0x0fa9('0xeb')](_0x37a2cd,_0x0fa9('0xec'));break;case'3':ut['logAgent'](_0x37a2cd,0x3,_0x0fa9('0xc5'));rpcDb[_0x0fa9('0xeb')](_0x37a2cd,_0x0fa9('0xed'));break;case'5':ut[_0x0fa9('0xee')](_0x37a2cd,0x5,'Busy');rpcDb['createAgentHistory'](_0x37a2cd,_0x0fa9('0xef'));break;case'8':ut[_0x0fa9('0xee')](_0x37a2cd,0x8,_0x0fa9('0xce'));rpcDb[_0x0fa9('0xeb')](_0x37a2cd,_0x0fa9('0xf0'));break;case'22':ut[_0x0fa9('0xee')](_0x37a2cd,0x16,_0x0fa9('0xf1'));rpcDb[_0x0fa9('0xeb')](_0x37a2cd,_0x0fa9('0xf2'));break;default:ut[_0x0fa9('0xee')](_0x37a2cd,0xc,_0x301999[_0x0fa9('0xf3')]);rpcDb[_0x0fa9('0xeb')](_0x37a2cd,_0x0fa9('0xf0'));}ut[_0x0fa9('0x80')](_0x2a827d,_0x0fa9('0xf4'));logger['info'](_0x0fa9('0xf5'),_0x37a2cd['uniqueid'],_0x0fa9('0xbc'),_0x2a827d[_0x0fa9('0x2c')],_0x0fa9('0x72'),_0x2a827d[_0x0fa9('0x51')]);delete this['actions'][_0x37a2cd['uniqueid']];};Preview[_0x0fa9('0x12')]['checkInBlack']=function(_0x3833fc,_0x17219d,_0x1ed00e,_0xed6e76,_0x859721){var _0x36b318=this;return new BPromise(function(_0x22164c,_0x6dd175){if(_[_0x0fa9('0x88')](_0x17219d)||_['isNil'](_0x17219d['Contact'])||_[_0x0fa9('0x88')](_0x17219d[_0x0fa9('0xf6')][_0x0fa9('0xf7')])||_['isNil'](_0x17219d[_0x0fa9('0x79')])){_0x6dd175(ut[_0x0fa9('0x50')]('Contact\x20is\x20undefined',_0xed6e76,_0x859721));return;}var _0x34e5a3=uuid['v4']();var _0x156a97=_0x36b318[_0x0fa9('0x16')][_0x17219d[_0x0fa9('0xf8')][_0x0fa9('0x2c')]];var _0x1d1d4b=_0x1ed00e?_0x36b318[_0x0fa9('0x1a')][_0x1ed00e]['id']:undefined;_0x36b318['actions'][_0x34e5a3]=new Action(_0x17219d,_0x156a97,_0x34e5a3,_0x1ed00e,_0x1d1d4b);var _0xf8707b=_0x36b318['actions'][_0x34e5a3];_0xf8707b[_0x0fa9('0xa9')]=_0xed6e76;_0xf8707b[_0x0fa9('0xaa')]=_0x859721;_0xf8707b[_0x0fa9('0xf9')]=_0x1ed00e;if(_['isEmpty'](_0x3833fc)){_0x36b318['execCall'](_0xf8707b,_0x156a97,_0x17219d,_0x1ed00e)[_0x0fa9('0x87')](function(_0xce2219){logger[_0x0fa9('0x71')](_0x0fa9('0xfa'),_0x0fa9('0xfb')+_0xf8707b['queue']+'\x20IdHopper:\x20'+_0xf8707b[_0x0fa9('0xfc')],JSON[_0x0fa9('0x5a')](_0xce2219));ami[_0x0fa9('0x29')]('custom:agentcalled',ut[_0x0fa9('0xa2')](_0xf8707b,'called'));_0x22164c(ut['message'](_0x0fa9('0xfd')));})['catch'](function(_0x4a264b){ut[_0x0fa9('0x63')](_0x0fa9('0xfe'),_0x4a264b);_0x6dd175(ut[_0x0fa9('0x50')](_0x0fa9('0xff'),_0xed6e76,_0x859721));});}else{_0x156a97[_0x0fa9('0x3c')]+=0x1;ut[_0x0fa9('0x100')](_0xf8707b);rpcDb[_0x0fa9('0x101')](_0xf8707b,'[Blacklist][error]');delete _0x36b318['actions'][_0x34e5a3];_0x6dd175(ut[_0x0fa9('0x50')](_0x0fa9('0x102'),_0xed6e76,_0x859721));}});};Preview[_0x0fa9('0x12')]['isTrunkReachable']=function(_0x4cb2ea){return!_[_0x0fa9('0x88')](_0x4cb2ea)&&!_[_0x0fa9('0x88')](_0x4cb2ea[_0x0fa9('0x2c')])&&!_[_0x0fa9('0x88')](_0x4cb2ea['active'])&&_0x4cb2ea['active']&&!_['isNil'](this['trunks'][util['format'](_0x0fa9('0x103'),_0x4cb2ea[_0x0fa9('0x2c')])])&&!_[_0x0fa9('0x88')](this[_0x0fa9('0x18')][util[_0x0fa9('0x5b')]('SIP/%s',_0x4cb2ea[_0x0fa9('0x2c')])][_0x0fa9('0x7c')])&&(this[_0x0fa9('0x18')][util[_0x0fa9('0x5b')]('SIP/%s',_0x4cb2ea[_0x0fa9('0x2c')])][_0x0fa9('0x7c')]===_0x0fa9('0x104')||this[_0x0fa9('0x18')][util[_0x0fa9('0x5b')](_0x0fa9('0x103'),_0x4cb2ea[_0x0fa9('0x2c')])][_0x0fa9('0x7c')]===_0x0fa9('0x105'));};Preview['prototype'][_0x0fa9('0x106')]=function(_0x14520f,_0x1b7f91){var _0x344bb6=this;return new BPromise(function(_0x7fc20d,_0x45cdb8){_0x344bb6['execRun'](_0x14520f,_0x1b7f91)[_0x0fa9('0x87')](function(_0x3eafad){_0x7fc20d(_[_0x0fa9('0x76')](_0x3eafad,[_0x0fa9('0x50')]));})[_0x0fa9('0x7e')](function(_0x29d739){if(_0x29d739['unlock']){rpcDb[_0x0fa9('0x107')](_0x14520f);}if(_0x29d739['active']){rpcDb[_0x0fa9('0x108')](_0x14520f);}_0x45cdb8(_[_0x0fa9('0x76')](_0x29d739,['message']));});});};Preview[_0x0fa9('0x12')][_0x0fa9('0x109')]=function(_0x52fc26,_0x4d893b){var _0x557946=this;return new BPromise(function(_0x126a59,_0x4133fa){var _0x269c30,_0x3568c9;rpcDb[_0x0fa9('0x10a')](_0x52fc26)['then'](function(_0x3ecb83){if(!_['isNil'](_0x3ecb83[0x0])){_0x3568c9=_0x3ecb83[0x0][_0x0fa9('0x10b')]?![]:!![];_0x269c30=_0x3ecb83[0x0][_0x0fa9('0x10b')]?!![]:![];_0x269c30=_0x4d893b?!![]:_0x269c30;}var _0xe33cf6=_0x557946[_0x0fa9('0x10c')](_0x3ecb83);if(_0xe33cf6[_0x0fa9('0x10d')]){rpcDb[_0x0fa9('0x10e')](_[_0x0fa9('0x76')](_0x3ecb83[0x0],['VoiceQueueId','Contact.phone']))['then'](function(_0x1ca29e){_0x557946[_0x0fa9('0x10f')](_0x1ca29e,_0x3ecb83[0x0],_0x4d893b,_0x3568c9,_0x269c30)[_0x0fa9('0x87')](function(_0x551254){_0x126a59(_0x551254);})[_0x0fa9('0x7e')](function(_0x4b9ad3){_0x4133fa(_0x4b9ad3);});})[_0x0fa9('0x7e')](function(_0x143ab5){ut[_0x0fa9('0x63')](_0x0fa9('0x110'),_0x143ab5);_0x4133fa(ut[_0x0fa9('0x50')](_0x0fa9('0x111'),_0x3568c9,_0x269c30));});}else{_0x4133fa(ut[_0x0fa9('0x50')](_0xe33cf6[_0x0fa9('0x50')],_0x3568c9,_0x269c30));}})[_0x0fa9('0x7e')](function(_0x1c465c){ut[_0x0fa9('0x63')]('[Preview][getContactPreview]',_0x1c465c);_0x4133fa(ut[_0x0fa9('0x50')](_0x0fa9('0x111'),![],!![]));});});};Preview['prototype'][_0x0fa9('0x10c')]=function(_0x69d6fb){if(_['isNil'](_0x69d6fb)||_['isEmpty'](_0x69d6fb)||!_[_0x0fa9('0x88')](_0x69d6fb[0x0][_0x0fa9('0x8c')])&&_[_0x0fa9('0x88')](_0x69d6fb[0x0][_0x0fa9('0x8c')][_0x0fa9('0x2c')])){ut[_0x0fa9('0x63')](_0x0fa9('0x112'),_0x69d6fb);return{'isValid':![],'message':_0x0fa9('0x113')};}var _0xab2e90=this['campaignsPreview'][_0x69d6fb[0x0][_0x0fa9('0xf8')][_0x0fa9('0x2c')]];_0xab2e90['message']=_0x0fa9('0x114');if(_[_0x0fa9('0x88')](_0xab2e90)){ut[_0x0fa9('0x63')](_0x0fa9('0x115'),_0xab2e90);return{'isValid':![],'message':_0x0fa9('0x116')};}if(!this[_0x0fa9('0x9a')](_0xab2e90['Trunk'])){ut[_0x0fa9('0x63')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x0fa9('0x117')+_0xab2e90[_0x0fa9('0x2c')]+_0x0fa9('0x118'));if(!this[_0x0fa9('0x9a')](_0xab2e90[_0x0fa9('0x9b')])){ut['logger'](_0x0fa9('0x119'),_0xab2e90[_0x0fa9('0x2c')]+_0x0fa9('0x11a'));return{'isValid':![],'message':_0x0fa9('0x11b')};}}if(!ut[_0x0fa9('0x99')](_0xab2e90[_0x0fa9('0x6d')])){ut['logger'](_0x0fa9('0x11c'),_0xab2e90[_0x0fa9('0x2c')]+_0x0fa9('0x11d'));return{'isValid':![],'message':_0x0fa9('0x117')+_0xab2e90[_0x0fa9('0x2c')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x0fa9('0x11e')};};Preview[_0x0fa9('0x12')]['execCall']=function(_0x32666f,_0x4f1ddf,_0x5231f4,_0x290275){var _0x1fde04=this;return new BPromise(function(_0xcd3f16,_0x4085c1){var _0x23c82e=_0x32666f[_0x0fa9('0xb0')];var _0x3bf87c=_0x1fde04['isTrunkReachable'](_0x4f1ddf[_0x0fa9('0x56')])?util[_0x0fa9('0x5b')](_0x0fa9('0x11f'),_0x4f1ddf[_0x0fa9('0x56')][_0x0fa9('0x2c')],_[_0x0fa9('0x88')](_0x4f1ddf['dialPrefix'])?'':_0x4f1ddf['dialPrefix'][_0x0fa9('0x120')]()||'',_0x4f1ddf['dialCutDigit']>0x0?_0x5231f4['Contact'][_0x0fa9('0xf7')][_0x0fa9('0x121')](_0x4f1ddf[_0x0fa9('0x122')]):_0x5231f4[_0x0fa9('0xf6')]['phone']):util[_0x0fa9('0x5b')](_0x0fa9('0x11f'),_['isNil'](_0x4f1ddf[_0x0fa9('0x9b')])?_0x4f1ddf['Trunk']['name']:_0x4f1ddf[_0x0fa9('0x9b')][_0x0fa9('0x2c')],_[_0x0fa9('0x88')](_0x4f1ddf[_0x0fa9('0x123')])?'':_0x4f1ddf[_0x0fa9('0x123')][_0x0fa9('0x120')]()||'',_0x4f1ddf[_0x0fa9('0x122')]>0x0?_0x5231f4['Contact'][_0x0fa9('0xf7')][_0x0fa9('0x121')](_0x4f1ddf[_0x0fa9('0x122')]):_0x5231f4[_0x0fa9('0xf6')][_0x0fa9('0xf7')]);var _0x52f1f0=_0x1fde04[_0x0fa9('0x9a')](_0x4f1ddf[_0x0fa9('0x56')])?ut[_0x0fa9('0x124')](_0x4f1ddf[_0x0fa9('0x56')][_0x0fa9('0x58')],_0x4f1ddf['dialOriginateCallerIdName'],_0x4f1ddf[_0x0fa9('0x125')]>0x0?ut[_0x0fa9('0x126')](_0x4f1ddf[_0x0fa9('0x38')],_0x4f1ddf[_0x0fa9('0x125')]):_0x4f1ddf[_0x0fa9('0x38')]):ut[_0x0fa9('0x124')](_[_0x0fa9('0x88')](_0x4f1ddf['TrunkBackup'])?_0x4f1ddf[_0x0fa9('0x56')][_0x0fa9('0x58')]:_0x4f1ddf[_0x0fa9('0x9b')][_0x0fa9('0x58')],_0x4f1ddf[_0x0fa9('0x127')],_0x4f1ddf[_0x0fa9('0x125')]>0x0?ut['getCallerIdRandom'](_0x4f1ddf[_0x0fa9('0x38')],_0x4f1ddf[_0x0fa9('0x125')]):_0x4f1ddf[_0x0fa9('0x38')]);if(_0x52f1f0){_0x32666f[_0x0fa9('0x128')]=ut[_0x0fa9('0x129')](_0x52f1f0);_0x32666f[_0x0fa9('0x12a')]=ut['extractCalleridNumber'](_0x52f1f0);}var _0x4aa879=ut[_0x0fa9('0x12b')](_0x4f1ddf,_0x5231f4,_0x3bf87c,_0x52f1f0,_0x23c82e,_0x32666f);_[_0x0fa9('0x12c')](_0x32666f,ut[_0x0fa9('0x12d')](_0x4aa879));_0x32666f[_0x0fa9('0x8f')]=moment()[_0x0fa9('0x5b')](_0x0fa9('0xac'));ami[_0x0fa9('0x7b')](ut[_0x0fa9('0x12e')](_0x32666f,_0x4f1ddf,_0x4aa879,_0x32666f[_0x0fa9('0xaa')],_0x290275))['then'](function(_0x261b68){_0x4f1ddf[_0x0fa9('0x51')]+=0x1;logger[_0x0fa9('0x71')](_0x0fa9('0x12f'),_0x23c82e,_0x0fa9('0xbc'),_0x4f1ddf['name'],'originated:\x20',_0x4f1ddf['originated']);_0xcd3f16(_0x261b68);})['catch'](function(_0x1a672a){ut[_0x0fa9('0xee')](_0x32666f,0xe,_0x0fa9('0x130'));rpcDb['createAgentHistory'](_0x32666f,'[originateFailure][logOriginateFailure]');_0x4085c1(_0x1a672a);});});};Preview[_0x0fa9('0x12')][_0x0fa9('0x131')]=function(_0x16582e){if(this[_0x0fa9('0x19')][_0x16582e[_0x0fa9('0xbd')]]){this[_0x0fa9('0x19')][_0x16582e[_0x0fa9('0xbd')]][_0x0fa9('0x7d')]=_0x16582e[_0x0fa9('0x7d')];}};Preview[_0x0fa9('0x12')]['syncOriginateResponse']=function(_0x5d52dd){var _0x9f21b1=this;var _0x4e4f74=this[_0x0fa9('0x19')][_0x5d52dd[_0x0fa9('0x132')]];if(_0x4e4f74){if(_0x4e4f74[_0x0fa9('0xf9')]&&this[_0x0fa9('0x1a')][_0x4e4f74[_0x0fa9('0xf9')]]){ut[_0x0fa9('0x133')](_0x4e4f74,this[_0x0fa9('0x1a')][_0x4e4f74[_0x0fa9('0xf9')]][_0x0fa9('0x2c')],this[_0x0fa9('0x1a')][_0x4e4f74[_0x0fa9('0xf9')]]['id']);}var _0x5c5861=_[_0x0fa9('0x134')](_0x4e4f74);_0x5c5861[_0x0fa9('0xad')]=moment()[_0x0fa9('0x5b')](_0x0fa9('0xac'));var _0x574fba=_0x9f21b1['campaignsPreview'][_0x4e4f74[_0x0fa9('0x73')]];if(ut[_0x0fa9('0x135')](_0x5d52dd[_0x0fa9('0x136')])){if(_0x4e4f74['unlockAgent']){rpcDb[_0x0fa9('0x107')](_0x4e4f74['idContact']);}if(_0x4e4f74['activeContact']){rpcDb['disableContact'](_0x4e4f74['idContact']);}ami[_0x0fa9('0x29')](_0x0fa9('0x137'),ut['buildObj'](_0x4e4f74,_0x0fa9('0x138')));this[_0x0fa9('0xe8')](_0x5c5861,_0x574fba,_0x5d52dd);}else{_0x4e4f74['starttime']=moment()[_0x0fa9('0x5b')](_0x0fa9('0xac'));ut[_0x0fa9('0xee')](_0x5c5861,0x4,_0x0fa9('0xb7'));rpcDb[_0x0fa9('0xeb')](_0x5c5861,_0x0fa9('0x139'));}}};Preview['prototype'][_0x0fa9('0x1e')]=function(_0x3f4130){var _0x253a19=this;var _0x478cf2=this[_0x0fa9('0x19')][_0x3f4130[_0x0fa9('0xbd')]];var _0x103fe5;if(_0x478cf2){_0x103fe5=this[_0x0fa9('0x16')][_0x478cf2[_0x0fa9('0x73')]];logger[_0x0fa9('0x71')](_0x0fa9('0x13a'),_0x3f4130[_0x0fa9('0xbd')],'\x20Queue',_0x103fe5[_0x0fa9('0x2c')],_0x0fa9('0x74'),_0x103fe5[_0x0fa9('0x30')]);}if(this[_0x0fa9('0x19')][_0x3f4130[_0x0fa9('0xbd')]]&&_0x3f4130['linkedid']!==_0x3f4130[_0x0fa9('0xb0')]){if(_0x3f4130['cause']==='16'&&this['actions'][_0x3f4130[_0x0fa9('0xbd')]]['dialAnswer']){this[_0x0fa9('0x13b')](_0x3f4130,_0x3f4130[_0x0fa9('0xbd')],_0x3f4130['cause']);}else if(this['actions'][_0x3f4130[_0x0fa9('0xbd')]]['dialAnswer']){logger['info'](_0x0fa9('0x13c'),_0x3f4130[_0x0fa9('0xbd')],_0x3f4130[_0x0fa9('0x13d')],'\x20Queue',_0x103fe5[_0x0fa9('0x2c')],_0x0fa9('0x74'),_0x103fe5[_0x0fa9('0x30')]);this[_0x0fa9('0x13b')](_0x3f4130,_0x3f4130[_0x0fa9('0xbd')],_0x3f4130[_0x0fa9('0x13d')]);}}else if(_0x478cf2&&_[_0x0fa9('0x88')](_0x478cf2['statedesc'])&&_0x103fe5[_0x0fa9('0x13e')]&&_0x3f4130[_0x0fa9('0xbd')]===_0x3f4130[_0x0fa9('0xb0')]&&_[_0x0fa9('0x88')](_0x3f4130[_0x0fa9('0xf3')])&&_0x3f4130['cause']==='16'&&_0x3f4130[_0x0fa9('0x13f')]==='6'&&_['isUndefined'](_0x478cf2[_0x0fa9('0x140')])){if(_0x478cf2['unlockAgent']){rpcDb[_0x0fa9('0x107')](_0x478cf2[_0x0fa9('0xfc')]);}if(_0x478cf2['activeContact']){rpcDb[_0x0fa9('0x108')](_0x478cf2['idContact']);}_0x3f4130[_0x0fa9('0xf3')]='22';this[_0x0fa9('0xe8')](_0x478cf2,_0x103fe5,_0x3f4130);}else if(_0x478cf2&&_0x478cf2['transfer']){if(_0x3f4130[_0x0fa9('0x13d')]==='16'&&this[_0x0fa9('0x19')][_0x3f4130['linkedid']][_0x0fa9('0x75')]){logger[_0x0fa9('0x71')](_0x0fa9('0x141'),_0x3f4130[_0x0fa9('0xbd')],_0x3f4130[_0x0fa9('0x13d')],'\x20Queue',_0x103fe5['name'],_0x0fa9('0x74'),_0x103fe5['pTalking']);this[_0x0fa9('0x13b')](_0x3f4130,_0x3f4130[_0x0fa9('0xbd')],_0x3f4130['cause']);}else if(this[_0x0fa9('0x19')][_0x3f4130[_0x0fa9('0xbd')]]['dialAnswer']){logger['info']('[syncHangup][talking][cause]',_0x3f4130[_0x0fa9('0xbd')],_0x3f4130[_0x0fa9('0x13d')],_0x0fa9('0xbc'),_0x103fe5[_0x0fa9('0x2c')],_0x0fa9('0x74'),_0x103fe5[_0x0fa9('0x30')]);this['callProgressDetectingCustomer'](_0x3f4130,_0x3f4130[_0x0fa9('0xbd')],_0x3f4130[_0x0fa9('0x13d')]);}}};Preview[_0x0fa9('0x12')]['syncDialEnd']=function(_0x4f98bc){if(this[_0x0fa9('0x19')][_0x4f98bc[_0x0fa9('0xe7')]]&&_0x4f98bc[_0x0fa9('0xe7')]!==_0x4f98bc[_0x0fa9('0x142')]){this[_0x0fa9('0x13b')](_0x4f98bc,_0x4f98bc[_0x0fa9('0xe7')],_0x4f98bc[_0x0fa9('0xe2')]);}};Preview[_0x0fa9('0x12')][_0x0fa9('0x20')]=function(_0x564a4e){if(this['actions'][_0x564a4e[_0x0fa9('0xbd')]]&&_0x564a4e[_0x0fa9('0xbd')]!==_0x564a4e[_0x0fa9('0xb0')]&&!this[_0x0fa9('0x19')][_0x564a4e['linkedid']][_0x0fa9('0x75')]){if(_0x564a4e[_0x0fa9('0x13d')]==='1'){this[_0x0fa9('0x13b')](_0x564a4e,_0x564a4e[_0x0fa9('0xbd')],_0x564a4e['cause']);}}};Preview[_0x0fa9('0x12')]['addVariable']=function(_0x204b8b,_0x45d4d6,_0x3ad20e){if(this[_0x0fa9('0x19')][_0x204b8b]){if(_[_0x0fa9('0x88')](this[_0x0fa9('0x19')][_0x204b8b][_0x0fa9('0x143')])){this[_0x0fa9('0x19')][_0x204b8b]['variables']={};}this[_0x0fa9('0x19')][_0x204b8b][_0x0fa9('0x143')][_0x45d4d6]=_0x3ad20e;}};Preview['prototype'][_0x0fa9('0x24')]=function(_0x406bc0){try{if(!_[_0x0fa9('0x88')](_0x406bc0)){if(ut[_0x0fa9('0x144')](_[_0x0fa9('0x145')](_0x406bc0[_0x0fa9('0x146')])[0x0])){this['addVariable'](_0x406bc0[_0x0fa9('0xb0')],_['keys'](_0x406bc0[_0x0fa9('0x146')])[0x0],_0x406bc0[_0x0fa9('0x147')]);}}}catch(_0x17c7af){logger[_0x0fa9('0x148')](_0x0fa9('0x149'),util['inspect'](_0x17c7af,{'showHidden':![],'depth':null}));}};Preview[_0x0fa9('0x12')][_0x0fa9('0x26')]=function(_0x3bb379){if(_0x3bb379){if(this[_0x0fa9('0x19')][_0x3bb379[_0x0fa9('0x14a')]]){this['actions'][_0x3bb379[_0x0fa9('0x14a')]][_0x0fa9('0x140')]=!![];}}};Preview[_0x0fa9('0x12')][_0x0fa9('0x27')]=function(_0x211068){if(_0x211068){if(this[_0x0fa9('0x19')][_0x211068[_0x0fa9('0x14b')]]){this[_0x0fa9('0x19')][_0x211068[_0x0fa9('0x14b')]][_0x0fa9('0x140')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
+var _0x4329=['socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','available','loggedIn','pTalking','sumBillable','sumDuration','talking','unmanaged','abandoned','waiting','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','name','active','callerid','Interval','md5','voice_queue:save','stringify','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','loopCampaigns','syncCampaigns','hasOwnProperty','booked','outbound','setMessage','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','queue','dialAnswer','pick','UserId','VoiceQueueId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','Agent','run','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','answertime','\x20Queue','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','total','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','scheduledAt','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','AnswerAGI','[callProgressDetectingAgent][logCongestion]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','then','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','Action','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','clone','isFailure','response','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','pTalking:\x20','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','variable','keys','value','error','inspect','transfertargetlinkedid','transfererlinkedid','util','uuid','moment','../../../config/environment','preview','../ami','./rpcDb','./action','redis','defaults','localhost'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x4329,0x140));var _0x9432=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x4329[_0x110c3d];return _0x226d67;};'use strict';var util=require(_0x9432('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x9432('0x1'));var moment=require(_0x9432('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x9432('0x3'));var logger=require('../../../config/logger')(_0x9432('0x4'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x9432('0x5'));var rpcDb=require(_0x9432('0x6'));var Action=require(_0x9432('0x7'));var ut=require('./util/util');config[_0x9432('0x8')]=_[_0x9432('0x9')](config[_0x9432('0x8')],{'host':_0x9432('0xa'),'port':0x18eb});var io=require(_0x9432('0xb'))(new Redis(config[_0x9432('0x8')]));var Sequence=function(){};Sequence[_0x9432('0xc')][_0x9432('0xd')]=function(_0x1c6d51){this[_0x9432('0xe')]=this[_0x9432('0xe')]?this[_0x9432('0xe')][_0x9432('0xf')](_0x1c6d51):_0x1c6d51();};function Preview(_0x1642ce){this[_0x9432('0x10')]=new Sequence();this[_0x9432('0x11')]=_0x1642ce[_0x9432('0x12')];this[_0x9432('0x13')]=_0x1642ce[_0x9432('0x13')];this[_0x9432('0x14')]={};this[_0x9432('0x15')]=_0x1642ce[_0x9432('0x15')];this[_0x9432('0x16')]=0x0;ami['on'](_0x9432('0x17'),this[_0x9432('0x18')][_0x9432('0x19')](this));ami['on'](_0x9432('0x1a'),this[_0x9432('0x1b')][_0x9432('0x19')](this));ami['on'](_0x9432('0x1c'),this[_0x9432('0x1d')][_0x9432('0x19')](this));ami['on'](_0x9432('0x1e'),this[_0x9432('0x1f')][_0x9432('0x19')](this));ami['on'](_0x9432('0x20'),this[_0x9432('0x21')][_0x9432('0x19')](this));ami['on']('varset',this[_0x9432('0x22')][_0x9432('0x19')](this));ami['on']('attendedtransfer',this[_0x9432('0x23')]['bind'](this));ami['on'](_0x9432('0x24'),this[_0x9432('0x25')][_0x9432('0x19')](this));this['loopCampaigns'](this[_0x9432('0x11')]);}function emit(_0x2ceedd,_0x23ff2c,_0x3e2fe7){io['to'](_0x2ceedd)[_0x9432('0x26')](_0x23ff2c,_0x3e2fe7);}function emitCampaignPreview(_0x57149f){if(_0x57149f[_0x9432('0x27')]==='outbound'){var _0x3fbe38={'id':_0x57149f['id'],'name':_0x57149f['name'],'strategy':_0x57149f['strategy'],'answered':_0x57149f['answered'],'available':_0x57149f[_0x9432('0x28')],'loggedIn':_0x57149f[_0x9432('0x29')],'pTalking':_0x57149f[_0x9432('0x2a')],'sumBillable':_0x57149f[_0x9432('0x2b')],'sumDuration':_0x57149f[_0x9432('0x2c')],'sumHoldTime':_0x57149f['sumHoldTime']||0x0,'talking':_0x57149f[_0x9432('0x2d')],'total':_0x57149f['total'],'type':_0x57149f[_0x9432('0x27')],'unmanaged':_0x57149f[_0x9432('0x2e')],'abandoned':_0x57149f[_0x9432('0x2f')],'waiting':_0x57149f[_0x9432('0x30')],'loggedInDb':_0x57149f['loggedInDb'],'dialActive':_0x57149f['dialActive'],'dialMethod':_0x57149f[_0x9432('0x31')],'dialOriginateCallerIdName':_0x57149f['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x57149f[_0x9432('0x32')],'dialOriginateTimeout':_0x57149f[_0x9432('0x33')],'dialPrefix':_0x57149f[_0x9432('0x34')],'outboundAnswerAgiCallsDay':_0x57149f['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x57149f[_0x9432('0x35')],'outboundBlacklistCallsDay':_0x57149f[_0x9432('0x36')],'outboundBusyCallsDay':_0x57149f['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x57149f[_0x9432('0x37')],'outboundDropCallsDayACS':_0x57149f[_0x9432('0x38')],'outboundDropCallsDayCallersExit':_0x57149f[_0x9432('0x39')],'outboundDropCallsDayTimeout':_0x57149f[_0x9432('0x3a')],'outboundNoAnswerCallsDay':_0x57149f[_0x9432('0x3b')],'outboundNoSuchCallsDay':_0x57149f[_0x9432('0x3c')],'outboundOriginateFailureCallsDay':_0x57149f[_0x9432('0x3d')],'outboundReCallsDay':_0x57149f[_0x9432('0x3e')],'outboundRejectCallsDay':_0x57149f[_0x9432('0x3f')],'outboundUnknownCallsDay':_0x57149f[_0x9432('0x40')],'outboundAbandonedCallsDay':_0x57149f[_0x9432('0x41')],'predictiveIntervalAnsweredCalls':_0x57149f[_0x9432('0x42')],'predictiveIntervalAvgHoldtime':_0x57149f['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x57149f[_0x9432('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x57149f[_0x9432('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x57149f[_0x9432('0x45')],'predictiveIntervalErlangCalls':_0x57149f['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x57149f['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x57149f[_0x9432('0x46')],'predictiveIntervalMultiplicativeFactor':_0x57149f[_0x9432('0x47')],'predictiveIntervalPauses':_0x57149f[_0x9432('0x48')],'predictiveIntervalAvailable':_0x57149f[_0x9432('0x49')],'predictiveIntervalTotalCalls':_0x57149f['predictiveIntervalTotalCalls'],'message':_0x57149f[_0x9432('0x4a')],'originated':_0x57149f[_0x9432('0x4b')],'erlangCalls':_0x57149f[_0x9432('0x4c')],'erlangCallToSecond':_0x57149f[_0x9432('0x4d')],'erlangAbandonmentRate':_0x57149f[_0x9432('0x4e')],'erlangBusyFactor':_0x57149f[_0x9432('0x4f')],'startPredictive':_0x57149f[_0x9432('0x50')],'startProgressive':_0x57149f['startProgressive']};if(_0x57149f[_0x9432('0x51')]){_0x3fbe38['Trunk']={'id':_0x57149f[_0x9432('0x51')]['id'],'name':_0x57149f[_0x9432('0x51')][_0x9432('0x52')],'active':_0x57149f[_0x9432('0x51')][_0x9432('0x53')],'callerid':_0x57149f[_0x9432('0x51')][_0x9432('0x54')]};}if(_0x57149f[_0x9432('0x55')]){_0x3fbe38[_0x9432('0x55')]={'id':_0x57149f[_0x9432('0x55')]['id'],'name':_0x57149f[_0x9432('0x55')][_0x9432('0x52')]};}var _0x34b769=md5(JSON['stringify'](_0x3fbe38));if(_0x57149f[_0x9432('0x56')]!==_0x34b769){_0x57149f[_0x9432('0x56')]=_0x34b769;emit(util['format']('voice:queue:%s',_0x3fbe38[_0x9432('0x52')]),_0x9432('0x57'),_0x3fbe38);}}}function emitVoiceQueueChannelRemove(_0x11b782){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x9432('0x58')](_0x11b782));emit(util[_0x9432('0x59')](_0x9432('0x5a'),_0x11b782[_0x9432('0x52')]),_0x9432('0x5b'),_0x11b782);}function notSendMessagesQueue(_0x24844f){if(_0x24844f[_0x9432('0x5c')]){if(_0x24844f[_0x9432('0x4b')]===0x0&&_0x24844f[_0x9432('0x2a')]===0x0){_0x24844f['sendMessageOneNotActive']=![];_0x24844f[_0x9432('0x28')]=0x0;_0x24844f[_0x9432('0x5d')]=0x0;_0x24844f['message']=_0x9432('0x5e');ut[_0x9432('0x5f')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x24844f[_0x9432('0x52')]+_0x9432('0x60'));}else{_0x24844f[_0x9432('0x4a')]=_0x9432('0x61');ut[_0x9432('0x5f')](_0x9432('0x62'),_0x24844f[_0x9432('0x52')]+'\x20is\x20disactive');}emitCampaignPreview(_0x24844f);}}Preview['prototype'][_0x9432('0x63')]=function(){var _0x486028=this;setInterval(function(){_0x486028[_0x9432('0x64')]();},0x7cf);};Preview[_0x9432('0xc')][_0x9432('0x64')]=function(){var _0x5513ec=this[_0x9432('0x11')];this[_0x9432('0x16')]+=0x1;for(var _0x2b4d08 in _0x5513ec){if(_0x5513ec[_0x9432('0x65')](_0x2b4d08)&&(_0x5513ec[_0x2b4d08][_0x9432('0x31')]==='preview'||_0x5513ec[_0x2b4d08][_0x9432('0x31')]===_0x9432('0x66'))&&_0x5513ec[_0x2b4d08]['type']===_0x9432('0x67')){if(this[_0x9432('0x16')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x5513ec[_0x9432('0x65')](_0x2b4d08)&&_0x5513ec[_0x2b4d08][_0x9432('0x31')]===_0x9432('0x4')&&_0x5513ec[_0x2b4d08][_0x9432('0x27')]===_0x9432('0x67')){if(_0x5513ec[_0x2b4d08]['dialActive']){this[_0x9432('0x68')](_0x5513ec[_0x2b4d08]);this[_0x9432('0x69')](_0x5513ec[_0x2b4d08]);}else{notSendMessagesQueue(_0x5513ec[_0x2b4d08]);}}}};Preview['prototype'][_0x9432('0x6a')]=function(_0x8cb5da){var _0x1ec72c=this;this[_0x9432('0x10')][_0x9432('0xd')](function(){if(!_[_0x9432('0x6b')](_0x1ec72c[_0x9432('0x14')][_0x8cb5da])){loggerAction[_0x9432('0x6c')](_0x9432('0x6d'),_0x8cb5da,'Queue',_0x1ec72c['actions'][_0x8cb5da][_0x9432('0x6e')],'originated:\x20',JSON[_0x9432('0x58')](_0x1ec72c['campaignsPreview'][_0x1ec72c[_0x9432('0x14')][_0x8cb5da]['queue']]['originated']),'pTalking:\x20',JSON[_0x9432('0x58')](_0x1ec72c[_0x9432('0x11')][_0x1ec72c[_0x9432('0x14')][_0x8cb5da]['queue']][_0x9432('0x2a')]),JSON[_0x9432('0x58')](_0x1ec72c['actions'][_0x8cb5da][_0x9432('0x6f')]),JSON[_0x9432('0x58')](_[_0x9432('0x70')](_0x1ec72c['actions'][_0x8cb5da],['contactId',_0x9432('0x71'),_0x9432('0x72'),'ListId'])));return ami['Action']({'action':_0x9432('0x73'),'channel':_0x1ec72c[_0x9432('0x14')][_0x8cb5da][_0x9432('0x74')]})[_0x9432('0x75')](function(_0x4420b7){if(_0x4420b7[_0x9432('0x4a')]===_0x9432('0x76')){setTimeout(function(){if(_0x1ec72c[_0x9432('0x14')][_0x8cb5da]){ut[_0x9432('0x77')](_0x1ec72c[_0x9432('0x11')][_0x1ec72c[_0x9432('0x14')][_0x8cb5da][_0x9432('0x6e')]],_0x9432('0x78'));if(_0x1ec72c[_0x9432('0x14')][_0x8cb5da][_0x9432('0x6f')]===!![]){ut[_0x9432('0x79')](_0x1ec72c[_0x9432('0x11')][_0x1ec72c[_0x9432('0x14')][_0x8cb5da][_0x9432('0x6e')]],_0x9432('0x78'));ut[_0x9432('0x7a')](_0x9432('0x7b')+_0x8cb5da,_0x1ec72c[_0x9432('0x14')][_0x8cb5da][_0x9432('0x6e')]);}ut[_0x9432('0x7a')]('[Dialer][checkChannel][Preview]'+_0x8cb5da,_0x1ec72c['actions'][_0x8cb5da]['queue']);delete _0x1ec72c[_0x9432('0x14')][_0x8cb5da];}},0x2328);}});}});};Preview[_0x9432('0xc')]['clearZombieChannels']=function(){var _0x3b8650=this;loggerAction[_0x9432('0x6c')](_0x9432('0x7c'),_['size'](this[_0x9432('0x14')]));for(var _0x230f15 in this[_0x9432('0x14')]){if(_0x3b8650['actions'][_0x9432('0x65')](_0x230f15)){_0x3b8650[_0x9432('0x6a')](_0x230f15);}}};Preview[_0x9432('0xc')][_0x9432('0x69')]=function(_0x27d651){var _0x1f2456=this;rpcDb[_0x9432('0x7d')](_0x27d651['id'],ut[_0x9432('0x7e')](this['agents']))['then'](function(_0x308a35){if(!_[_0x9432('0x6b')](_0x308a35)){for(var _0x37b79a=0x0;_0x37b79a<_0x308a35[_0x9432('0x7f')];_0x37b79a+=0x1){if(ut[_0x9432('0x80')](_0x308a35[_0x37b79a][_0x9432('0x81')])<_0x27d651['dialRecallMeTimeout']*0x3c){if(_0x308a35[_0x37b79a]['Agent']&&!_0x308a35[_0x37b79a][_0x9432('0x82')]['voicePause']){_0x1f2456[_0x9432('0x83')](_0x308a35[_0x37b79a]['id'])['then'](ut[_0x9432('0x84')]('[RecallMe]'))[_0x9432('0x75')](ut[_0x9432('0x84')]('[RecallMe]'));}else{rpcDb[_0x9432('0x85')](_0x308a35[_0x37b79a]['id']);}}else{var _0x50467d=new Action(_0x308a35[_0x37b79a],_0x27d651);_0x50467d[_0x9432('0x86')]=moment()[_0x9432('0x59')](_0x9432('0x87'));_0x27d651[_0x9432('0x3e')]+=0x1;ut['logCustomer'](_0x50467d,0x17,_0x9432('0x88'));if(_0x27d651['dialRecallInQueue']){rpcDb[_0x9432('0x89')](ut[_0x9432('0x8a')](_0x308a35[_0x37b79a]));rpcDb[_0x9432('0x8b')](_0x50467d,_0x9432('0x8c'));}else{ut[_0x9432('0x8d')](_0x50467d,0x16,_0x9432('0x8e'));rpcDb[_0x9432('0x8b')](_0x50467d,_0x9432('0x8f'));rpcDb[_0x9432('0x90')](_0x50467d,_0x9432('0x8f'));}}}}})['catch'](ut[_0x9432('0x84')]('[getContactRecallMe]'));};Preview['prototype'][_0x9432('0x68')]=function(_0x1de81d){_0x1de81d[_0x9432('0x5c')]=!![];if(ut[_0x9432('0x91')](_0x1de81d[_0x9432('0x29')])){_0x1de81d['message']=_0x9432('0x92');}else if(!ut[_0x9432('0x93')](_0x1de81d['dialActive'])){_0x1de81d[_0x9432('0x4a')]='NOT_ACTIVE';}else if(!this[_0x9432('0x94')](_0x1de81d[_0x9432('0x51')])){if(!this[_0x9432('0x94')](_0x1de81d[_0x9432('0x95')])){_0x1de81d[_0x9432('0x4a')]='TRUNK_IS_NOT_REACHABLE';}else{_0x1de81d[_0x9432('0x4a')]='ACTIVE';}}else{_0x1de81d[_0x9432('0x4a')]=_0x9432('0x96');}emitCampaignPreview(_0x1de81d);};Preview[_0x9432('0xc')]['callProgressDetectingCustomer']=function(_0xa28d06,_0xcef885,_0x58244f){var _0x5944f7=this;var _0x3a7865=this[_0x9432('0x14')][_0xcef885];var _0x23d9fa=this[_0x9432('0x11')][_0x3a7865['queue']];var _0x58196c;if(_0x23d9fa){switch(_0x58244f){case'1':_0x23d9fa['outboundNoSuchCallsDay']+=0x1;_0x3a7865[_0x9432('0x97')]+=0x1;_0x3a7865[_0x9432('0x98')]=ut[_0x9432('0x99')](_0x3a7865);ut[_0x9432('0x8d')](_0x3a7865,0x0,_0x9432('0x9a'));ami[_0x9432('0x26')](_0x9432('0x9b'),ut[_0x9432('0x9c')](_0x3a7865,_0x9432('0x9d')));rpcDb[_0x9432('0x8b')](_0x3a7865,_0x9432('0x9e'));if(ut[_0x9432('0x99')](_0x3a7865)>=_0x23d9fa[_0x9432('0x9f')]){_0x58196c=ut[_0x9432('0xa0')](_0x3a7865,0xf,_0x9432('0xa1'));rpcDb[_0x9432('0x90')](_0x58196c,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x3a7865[_0x9432('0x97')]>=_0x23d9fa[_0x9432('0xa2')]){rpcDb['createCustomerFinal'](_0x3a7865,_0x9432('0xa3'));}else{rpcDb[_0x9432('0xa4')](ut['scheduledAt'](_0x3a7865,_0x9432('0x97'),_0x23d9fa[_0x9432('0xa5')]),_0x3a7865[_0x9432('0xa6')],_0x3a7865[_0x9432('0xa7')]);}}delete this[_0x9432('0x14')][_0xa28d06[_0x9432('0xa8')]];break;case _0x9432('0xa9'):var _0xc05fa5=moment()[_0x9432('0x59')](_0x9432('0x87'));_0x3a7865['responsetime']=_0xc05fa5;_0x3a7865[_0x9432('0xaa')]=_0xc05fa5;_0x3a7865[_0x9432('0x6f')]=!![];_0x23d9fa[_0x9432('0x2a')]+=0x1;logger[_0x9432('0x6c')]('[syncHangup][talking][increment]',_0x3a7865['uniqueid'],_0x9432('0xab'),_0x23d9fa[_0x9432('0x52')],'pTalking:\x20',_0x23d9fa['pTalking']);ami[_0x9432('0x26')](_0x9432('0xac'),ut[_0x9432('0x9c')](_0x3a7865,_0x9432('0xad')));if(_0x23d9fa[_0x9432('0xae')]){ami['emit']('custom:agentConnectPreview',ut[_0x9432('0xaf')](_0x3a7865));}break;case'16':ami['emit'](_0x9432('0xb0'),ut['buildObj'](_0x3a7865,'complete'));emitVoiceQueueChannelRemove(ut[_0x9432('0x9c')](_0x3a7865,'complete'));_0x23d9fa['outboundAnswerCallsDay']+=0x1;_0x23d9fa[_0x9432('0xb1')]+=0x1;_0x23d9fa[_0x9432('0xb2')]+=0x1;ut[_0x9432('0x79')](_0x23d9fa,_0x9432('0xb3'));_0x3a7865[_0x9432('0x98')]=ut[_0x9432('0x99')](_0x3a7865);ut['logCustomer'](_0x3a7865,0x4,_0x9432('0xb4'));rpcDb[_0x9432('0x8b')](_0x3a7865,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x9432('0x90')](_0x3a7865,_0x9432('0xb5'));rpcDb['crateCustomerReportQueue'](_0x3a7865);_0x23d9fa[_0x9432('0x2c')]+=_0x3a7865[_0x9432('0xb6')];_0x23d9fa[_0x9432('0x2b')]+=_0x3a7865[_0x9432('0xb6')];logger['info'](_0x9432('0xb7'),_0x3a7865[_0x9432('0xb8')],'\x20Queue',_0x23d9fa['name'],'pTalking:\x20',_0x23d9fa[_0x9432('0x2a')]);delete this['actions'][_0xa28d06['linkedid']];break;case _0x9432('0xb9'):_0x23d9fa[_0x9432('0xba')]+=0x1;_0x3a7865['countbusyretry']+=0x1;_0x3a7865['countglobal']=ut[_0x9432('0x99')](_0x3a7865);ut[_0x9432('0x8d')](_0x3a7865,0x5,_0x9432('0xbb'));ami[_0x9432('0x26')](_0x9432('0xbc'),ut[_0x9432('0x9c')](_0x3a7865,_0x9432('0xbd')));rpcDb[_0x9432('0x8b')](_0x3a7865,_0x9432('0xbe'));if(ut['totalGlobal'](_0x3a7865)>=_0x23d9fa[_0x9432('0x9f')]){_0x58196c=ut[_0x9432('0xa0')](_0x3a7865,0xf,_0x9432('0xa1'));rpcDb[_0x9432('0x90')](_0x58196c,_0x9432('0xbf'));}else{if(_0x3a7865[_0x9432('0xc0')]>=_0x23d9fa[_0x9432('0xc1')]){rpcDb['createCustomerFinal'](_0x3a7865,_0x9432('0xbe'));}else{rpcDb[_0x9432('0xa4')](ut['scheduledAt'](_0x3a7865,_0x9432('0xc0'),_0x23d9fa[_0x9432('0xc2')]),_0x3a7865[_0x9432('0xa6')],_0x3a7865[_0x9432('0xa7')]);}}break;case _0x9432('0xc3'):_0x23d9fa[_0x9432('0x3b')]+=0x1;_0x3a7865[_0x9432('0xc4')]+=0x1;_0x3a7865[_0x9432('0x98')]=ut[_0x9432('0x99')](_0x3a7865);ut[_0x9432('0x8d')](_0x3a7865,0x3,'NoAnswer');ami[_0x9432('0x26')](_0x9432('0xc5'),ut['buildObj'](_0x3a7865,'noanswer'));rpcDb[_0x9432('0x8b')](_0x3a7865,_0x9432('0xc6'));if(ut[_0x9432('0x99')](_0x3a7865)>=_0x23d9fa[_0x9432('0x9f')]){_0x58196c=ut['cloneAction'](_0x3a7865,0xf,_0x9432('0xa1'));rpcDb[_0x9432('0x90')](_0x58196c,_0x9432('0xc7'));}else{if(_0x3a7865[_0x9432('0xc4')]>=_0x23d9fa[_0x9432('0xc8')]){rpcDb[_0x9432('0x90')](_0x3a7865,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x9432('0xa4')](ut[_0x9432('0xc9')](_0x3a7865,'countnoanswerretry',_0x23d9fa[_0x9432('0xca')]),_0x3a7865['unlockAgent'],_0x3a7865[_0x9432('0xa7')]);}}break;case'CONGESTION':_0x23d9fa[_0x9432('0x37')]+=0x1;_0x3a7865[_0x9432('0xcb')]+=0x1;_0x3a7865[_0x9432('0x98')]=ut['totalGlobal'](_0x3a7865);ut[_0x9432('0x8d')](_0x3a7865,0x8,_0x9432('0xcc'));ami[_0x9432('0x26')](_0x9432('0xcd'),ut['buildObj'](_0x3a7865,_0x9432('0xce')));rpcDb[_0x9432('0x8b')](_0x3a7865,_0x9432('0xcf'));if(ut[_0x9432('0x99')](_0x3a7865)>=_0x23d9fa['dialGlobalMaxRetry']){_0x58196c=ut['cloneAction'](_0x3a7865,0xf,_0x9432('0xa1'));rpcDb['createCustomerFinal'](_0x58196c,_0x9432('0xd0'));}else{if(_0x3a7865[_0x9432('0xcb')]>=_0x23d9fa[_0x9432('0xd1')]){rpcDb[_0x9432('0x90')](_0x3a7865,_0x9432('0xcf'));}else{rpcDb[_0x9432('0xa4')](ut[_0x9432('0xc9')](_0x3a7865,_0x9432('0xcb'),_0x23d9fa['dialBusyRetryFrequency']),_0x3a7865[_0x9432('0xa6')],_0x3a7865['activeContact']);}}break;case _0x9432('0xd2'):_0x23d9fa[_0x9432('0x3f')]+=0x1;_0x3a7865['countagentrejectretry']+=0x1;_0x3a7865[_0x9432('0x98')]=ut['totalGlobal'](_0x3a7865);ut[_0x9432('0x8d')](_0x3a7865,0x14,'AgentReject');ami['emit'](_0x9432('0xd3'),ut[_0x9432('0x9c')](_0x3a7865,_0x9432('0xd4')));rpcDb[_0x9432('0x8b')](_0x3a7865,_0x9432('0xd5'));if(ut[_0x9432('0x99')](_0x3a7865)>=_0x23d9fa[_0x9432('0x9f')]){_0x58196c=ut[_0x9432('0xa0')](_0x3a7865,0x14,_0x9432('0xd6'));rpcDb[_0x9432('0x90')](_0x58196c,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3a7865[_0x9432('0xd7')]>=_0x23d9fa[_0x9432('0xd8')]){rpcDb['createCustomerFinal'](_0x3a7865,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0x9432('0xc9')](_0x3a7865,_0x9432('0xd7'),_0x23d9fa[_0x9432('0xd9')]),_0x3a7865['unlockAgent'],_0x3a7865[_0x9432('0xa7')]);}}break;case _0x9432('0xda'):_0x23d9fa[_0x9432('0x41')]+=0x1;_0x3a7865['countabandonedretry']+=0x1;_0x3a7865[_0x9432('0x98')]=ut[_0x9432('0x99')](_0x3a7865);ut['logCustomer'](_0x3a7865,0xb,_0x9432('0xdb'));rpcDb['createCustomerHistory'](_0x3a7865,_0x9432('0xdc'));if(ut[_0x9432('0x99')](_0x3a7865)>=_0x23d9fa['dialGlobalMaxRetry']){_0x58196c=ut[_0x9432('0xa0')](_0x3a7865,0xf,_0x9432('0xa1'));rpcDb['createCustomerFinal'](_0x58196c,_0x9432('0xdc'));}else{if(_0x3a7865[_0x9432('0xdd')]>=_0x23d9fa[_0x9432('0xde')]){rpcDb['createCustomerFinal'](_0x3a7865,_0x9432('0xdc'));}else{rpcDb[_0x9432('0xa4')](ut[_0x9432('0xc9')](_0x3a7865,'countabandonedretry',_0x23d9fa[_0x9432('0xdf')]),_0x3a7865['unlockAgent'],_0x3a7865['activeContact']);}}break;default:if(_0x3a7865['dialAnswer']){ut['decrementTalkink'](_0x23d9fa,_0x9432('0xe0'));ut[_0x9432('0x7a')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x23d9fa[_0x9432('0x52')],_0xa28d06);}_0x23d9fa[_0x9432('0x40')]+=0x1;_0x3a7865[_0x9432('0x98')]=ut['totalGlobal'](_0x3a7865);ut[_0x9432('0x8d')](_0x3a7865,0xc,_0xa28d06[_0x9432('0xe1')]||_0xa28d06[_0x9432('0xe2')]);rpcDb['createCustomerHistory'](_0x3a7865,_0x9432('0xe3'));if(ut[_0x9432('0x99')](_0x3a7865)>=_0x23d9fa[_0x9432('0x9f')]){_0x58196c=ut['cloneAction'](_0x3a7865,0xf,_0x9432('0xa1'));rpcDb[_0x9432('0x90')](_0x58196c,_0x9432('0xe4'));}else{rpcDb[_0x9432('0x90')](_0x3a7865,_0x9432('0xe4'));}delete this[_0x9432('0x14')][_0xa28d06[_0x9432('0xa8')]];}if(!(_0x3a7865[_0x9432('0x6f')]&&_0x58244f==='16')){ut['updateOriginated'](_0x23d9fa,'[callProgressDetectingCustomer]');logger[_0x9432('0x6c')](_0x9432('0xe5'),_0x3a7865[_0x9432('0xb8')],'\x20Queue',_0x23d9fa[_0x9432('0x52')],'originated:\x20',_0x23d9fa[_0x9432('0x4b')]);}if(_0x58244f!=='ANSWER'){delete this['actions'][_0xa28d06[_0x9432('0xa8')]];delete this['actions'][_0xa28d06[_0x9432('0xe6')]];}}};Preview[_0x9432('0xc')]['callProgressDetectingAgent']=function(_0x5cc5b5,_0x4ca877,_0xb712bc){if(_[_0x9432('0xe7')](_0x4ca877)&&_0x9432('0xe8')!==typeof _0x4ca877){return;}if(_[_0x9432('0xe7')](_0xb712bc)&&_0x9432('0xe8')!==typeof _0xb712bc){return;}switch(_0xb712bc[_0x9432('0xe9')]){case'0':ut[_0x9432('0xea')](_0x5cc5b5,0x0,_0x9432('0x9a'));rpcDb[_0x9432('0xeb')](_0x5cc5b5,_0x9432('0xec'));break;case'3':ut[_0x9432('0xea')](_0x5cc5b5,0x3,_0x9432('0xed'));rpcDb[_0x9432('0xeb')](_0x5cc5b5,_0x9432('0xee'));break;case'5':ut[_0x9432('0xea')](_0x5cc5b5,0x5,_0x9432('0xbb'));rpcDb[_0x9432('0xeb')](_0x5cc5b5,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x5cc5b5,0x8,_0x9432('0xcc'));rpcDb[_0x9432('0xeb')](_0x5cc5b5,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x9432('0xea')](_0x5cc5b5,0x16,_0x9432('0xef'));rpcDb[_0x9432('0xeb')](_0x5cc5b5,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x9432('0xea')](_0x5cc5b5,0xc,_0xb712bc[_0x9432('0xe9')]);rpcDb[_0x9432('0xeb')](_0x5cc5b5,_0x9432('0xf0'));}ut[_0x9432('0x77')](_0x4ca877,'[callProgressDetectingAgent]');logger[_0x9432('0x6c')](_0x9432('0xf1'),_0x5cc5b5[_0x9432('0xb8')],_0x9432('0xab'),_0x4ca877[_0x9432('0x52')],_0x9432('0xf2'),_0x4ca877[_0x9432('0x4b')]);delete this[_0x9432('0x14')][_0x5cc5b5[_0x9432('0xb8')]];};Preview['prototype'][_0x9432('0xf3')]=function(_0x3177ad,_0x434397,_0x254970,_0x54d7a4,_0x140984){var _0x56b127=this;return new BPromise(function(_0xec9b56,_0x50998d){if(_[_0x9432('0x6b')](_0x434397)||_['isNil'](_0x434397[_0x9432('0xf4')])||_[_0x9432('0x6b')](_0x434397[_0x9432('0xf4')][_0x9432('0xf5')])||_[_0x9432('0x6b')](_0x434397['VoiceQueueId'])){_0x50998d(ut['message'](_0x9432('0xf6'),_0x54d7a4,_0x140984));return;}var _0x1c890a=uuid['v4']();var _0x21461c=_0x56b127[_0x9432('0x11')][_0x434397[_0x9432('0xf7')][_0x9432('0x52')]];var _0x5cddd8=_0x254970?_0x56b127[_0x9432('0x15')][_0x254970]['id']:undefined;_0x56b127[_0x9432('0x14')][_0x1c890a]=new Action(_0x434397,_0x21461c,_0x1c890a,_0x254970,_0x5cddd8);var _0x10e00b=_0x56b127[_0x9432('0x14')][_0x1c890a];_0x10e00b['unlockAgent']=_0x54d7a4;_0x10e00b[_0x9432('0xa7')]=_0x140984;_0x10e00b[_0x9432('0xf8')]=_0x254970;if(_[_0x9432('0xf9')](_0x3177ad)){_0x56b127[_0x9432('0xfa')](_0x10e00b,_0x21461c,_0x434397,_0x254970)[_0x9432('0xfb')](function(_0x5a4a79){logger[_0x9432('0x6c')]('[Preview][execCall][success]',_0x9432('0xfc')+_0x10e00b[_0x9432('0x6e')]+_0x9432('0xfd')+_0x10e00b[_0x9432('0xfe')],JSON['stringify'](_0x5a4a79));ami[_0x9432('0x26')](_0x9432('0xff'),ut[_0x9432('0x9c')](_0x10e00b,_0x9432('0x100')));_0xec9b56(ut['message'](_0x9432('0x101')));})[_0x9432('0x75')](function(_0x3f5ac3){ut['logger']('[Preview][execCall][failure]',_0x3f5ac3);_0x50998d(ut[_0x9432('0x4a')](_0x9432('0x102'),_0x54d7a4,_0x140984));});}else{_0x21461c[_0x9432('0x36')]+=0x1;ut[_0x9432('0x103')](_0x10e00b);rpcDb[_0x9432('0x104')](_0x10e00b,_0x9432('0x105'));delete _0x56b127[_0x9432('0x14')][_0x1c890a];_0x50998d(ut['message'](_0x9432('0x106'),_0x54d7a4,_0x140984));}});};Preview[_0x9432('0xc')][_0x9432('0x94')]=function(_0x5169dc){return!_['isNil'](_0x5169dc)&&!_['isNil'](_0x5169dc[_0x9432('0x52')])&&!_[_0x9432('0x6b')](_0x5169dc['active'])&&_0x5169dc['active']&&!_['isNil'](this[_0x9432('0x13')][util[_0x9432('0x59')](_0x9432('0x107'),_0x5169dc[_0x9432('0x52')])])&&!_[_0x9432('0x6b')](this[_0x9432('0x13')][util[_0x9432('0x59')](_0x9432('0x107'),_0x5169dc[_0x9432('0x52')])]['status'])&&(this[_0x9432('0x13')][util[_0x9432('0x59')](_0x9432('0x107'),_0x5169dc[_0x9432('0x52')])]['status']===_0x9432('0x108')||this[_0x9432('0x13')][util[_0x9432('0x59')]('SIP/%s',_0x5169dc[_0x9432('0x52')])]['status']==='unmonitored');};Preview[_0x9432('0xc')]['run']=function(_0x355e8a,_0x3a6d98){var _0xe89ede=this;return new BPromise(function(_0xbe0e43,_0x217b0c){_0xe89ede[_0x9432('0x109')](_0x355e8a,_0x3a6d98)[_0x9432('0xfb')](function(_0x56d9ea){_0xbe0e43(_['pick'](_0x56d9ea,[_0x9432('0x4a')]));})[_0x9432('0x75')](function(_0xcb85d1){if(_0xcb85d1['unlock']){rpcDb[_0x9432('0x10a')](_0x355e8a);}if(_0xcb85d1['active']){rpcDb[_0x9432('0x85')](_0x355e8a);}_0x217b0c(_[_0x9432('0x70')](_0xcb85d1,[_0x9432('0x4a')]));});});};Preview[_0x9432('0xc')][_0x9432('0x109')]=function(_0x40f590,_0x43519d){var _0x2d612c=this;return new BPromise(function(_0x4071f3,_0x5ac09b){var _0x79fabe,_0x1bf85d;rpcDb[_0x9432('0x10b')](_0x40f590)['then'](function(_0x4d9f94){if(!_[_0x9432('0x6b')](_0x4d9f94[0x0])){_0x1bf85d=_0x4d9f94[0x0][_0x9432('0x10c')]?![]:!![];_0x79fabe=_0x4d9f94[0x0][_0x9432('0x10c')]?!![]:![];_0x79fabe=_0x43519d?!![]:_0x79fabe;}var _0x2afeb3=_0x2d612c[_0x9432('0x10d')](_0x4d9f94);if(_0x2afeb3[_0x9432('0x10e')]){rpcDb[_0x9432('0x10f')](_[_0x9432('0x70')](_0x4d9f94[0x0],['VoiceQueueId','Contact.phone']))[_0x9432('0xfb')](function(_0x316d6b){_0x2d612c[_0x9432('0xf3')](_0x316d6b,_0x4d9f94[0x0],_0x43519d,_0x1bf85d,_0x79fabe)[_0x9432('0xfb')](function(_0x37b724){_0x4071f3(_0x37b724);})[_0x9432('0x75')](function(_0xb95063){_0x5ac09b(_0xb95063);});})[_0x9432('0x75')](function(_0x3b506b){ut['logger'](_0x9432('0x110'),_0x3b506b);_0x5ac09b(ut[_0x9432('0x4a')]('Call\x20unsuccessful',_0x1bf85d,_0x79fabe));});}else{_0x5ac09b(ut['message'](_0x2afeb3[_0x9432('0x4a')],_0x1bf85d,_0x79fabe));}})[_0x9432('0x75')](function(_0x2b3cf5){ut[_0x9432('0x5f')](_0x9432('0x111'),_0x2b3cf5);_0x5ac09b(ut[_0x9432('0x4a')](_0x9432('0x112'),![],!![]));});});};Preview[_0x9432('0xc')][_0x9432('0x10d')]=function(_0xe59539){if(_[_0x9432('0x6b')](_0xe59539)||_[_0x9432('0xf9')](_0xe59539)||!_[_0x9432('0x6b')](_0xe59539[0x0]['Agent'])&&_['isNil'](_0xe59539[0x0][_0x9432('0x82')]['name'])){ut[_0x9432('0x5f')](_0x9432('0x113'),_0xe59539);return{'isValid':![],'message':_0x9432('0x114')};}var _0xce8f5c=this[_0x9432('0x11')][_0xe59539[0x0][_0x9432('0xf7')][_0x9432('0x52')]];_0xce8f5c[_0x9432('0x4a')]=_0x9432('0x96');if(_[_0x9432('0x6b')](_0xce8f5c)){ut[_0x9432('0x5f')](_0x9432('0x115'),_0xce8f5c);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x9432('0x94')](_0xce8f5c[_0x9432('0x51')])){ut[_0x9432('0x5f')]('[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20'+_0xce8f5c[_0x9432('0x52')]+_0x9432('0x116'));if(!this['isTrunkReachable'](_0xce8f5c['TrunkBackup'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0xce8f5c[_0x9432('0x52')]+_0x9432('0x117'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0xce8f5c['dialActive'])){ut[_0x9432('0x5f')](_0x9432('0x118'),_0xce8f5c[_0x9432('0x52')]+_0x9432('0x119'));return{'isValid':![],'message':_0x9432('0x11a')+_0xce8f5c[_0x9432('0x52')]+_0x9432('0x119')};}return{'isValid':!![],'message':_0x9432('0x11b')};};Preview[_0x9432('0xc')][_0x9432('0xfa')]=function(_0x309fdb,_0x41c4dc,_0x1504ef,_0x5f1ade){var _0x124b2f=this;return new BPromise(function(_0x4db9a3,_0x49c073){var _0x95f276=_0x309fdb[_0x9432('0xb8')];var _0x397310=_0x124b2f[_0x9432('0x94')](_0x41c4dc[_0x9432('0x51')])?util['format'](_0x9432('0x11c'),_0x41c4dc[_0x9432('0x51')][_0x9432('0x52')],_[_0x9432('0x6b')](_0x41c4dc['dialPrefix'])?'':_0x41c4dc[_0x9432('0x34')][_0x9432('0x11d')]()||'',_0x41c4dc[_0x9432('0x11e')]>0x0?_0x1504ef['Contact'][_0x9432('0xf5')][_0x9432('0x11f')](_0x41c4dc[_0x9432('0x11e')]):_0x1504ef['Contact'][_0x9432('0xf5')]):util[_0x9432('0x59')](_0x9432('0x11c'),_[_0x9432('0x6b')](_0x41c4dc['TrunkBackup'])?_0x41c4dc[_0x9432('0x51')][_0x9432('0x52')]:_0x41c4dc['TrunkBackup'][_0x9432('0x52')],_[_0x9432('0x6b')](_0x41c4dc['dialPrefix'])?'':_0x41c4dc[_0x9432('0x34')][_0x9432('0x11d')]()||'',_0x41c4dc['dialCutDigit']>0x0?_0x1504ef['Contact']['phone']['substring'](_0x41c4dc[_0x9432('0x11e')]):_0x1504ef[_0x9432('0xf4')][_0x9432('0xf5')]);var _0x1ae420=_0x124b2f[_0x9432('0x94')](_0x41c4dc[_0x9432('0x51')])?ut['getCallerId'](_0x41c4dc[_0x9432('0x51')][_0x9432('0x54')],_0x41c4dc[_0x9432('0x120')],_0x41c4dc[_0x9432('0x121')]>0x0?ut[_0x9432('0x122')](_0x41c4dc[_0x9432('0x32')],_0x41c4dc[_0x9432('0x121')]):_0x41c4dc[_0x9432('0x32')]):ut['getCallerId'](_[_0x9432('0x6b')](_0x41c4dc[_0x9432('0x95')])?_0x41c4dc[_0x9432('0x51')][_0x9432('0x54')]:_0x41c4dc[_0x9432('0x95')]['callerid'],_0x41c4dc[_0x9432('0x120')],_0x41c4dc[_0x9432('0x121')]>0x0?ut['getCallerIdRandom'](_0x41c4dc[_0x9432('0x32')],_0x41c4dc[_0x9432('0x121')]):_0x41c4dc[_0x9432('0x32')]);if(_0x1ae420){_0x309fdb[_0x9432('0x123')]=ut[_0x9432('0x124')](_0x1ae420);_0x309fdb[_0x9432('0x125')]=ut[_0x9432('0x126')](_0x1ae420);}var _0x2a5ceb=ut[_0x9432('0x127')](_0x41c4dc,_0x1504ef,_0x397310,_0x1ae420,_0x95f276,_0x309fdb);_[_0x9432('0x128')](_0x309fdb,ut[_0x9432('0x129')](_0x2a5ceb));_0x309fdb[_0x9432('0x86')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami[_0x9432('0x12a')](ut[_0x9432('0x12b')](_0x309fdb,_0x41c4dc,_0x2a5ceb,_0x309fdb['activeContact'],_0x5f1ade))[_0x9432('0xfb')](function(_0x171a5a){_0x41c4dc['originated']+=0x1;logger[_0x9432('0x6c')](_0x9432('0x12c'),_0x95f276,_0x9432('0xab'),_0x41c4dc['name'],_0x9432('0xf2'),_0x41c4dc[_0x9432('0x4b')]);_0x4db9a3(_0x171a5a);})[_0x9432('0x75')](function(_0x12301a){ut[_0x9432('0xea')](_0x309fdb,0xe,_0x9432('0x12d'));rpcDb[_0x9432('0xeb')](_0x309fdb,_0x9432('0x12e'));_0x49c073(_0x12301a);});});};Preview[_0x9432('0xc')]['syncNewExten']=function(_0x1a382d){if(this[_0x9432('0x14')][_0x1a382d[_0x9432('0xa8')]]){this['actions'][_0x1a382d[_0x9432('0xa8')]]['channel']=_0x1a382d[_0x9432('0x74')];}};Preview['prototype'][_0x9432('0x18')]=function(_0x91d2d8){var _0x57204b=this;var _0x3f9bc7=this[_0x9432('0x14')][_0x91d2d8[_0x9432('0x12f')]];if(_0x3f9bc7){if(_0x3f9bc7[_0x9432('0xf8')]&&this[_0x9432('0x15')][_0x3f9bc7[_0x9432('0xf8')]]){ut['logLookAgent'](_0x3f9bc7,this[_0x9432('0x15')][_0x3f9bc7['lookAgent']][_0x9432('0x52')],this[_0x9432('0x15')][_0x3f9bc7[_0x9432('0xf8')]]['id']);}var _0x25d710=_[_0x9432('0x130')](_0x3f9bc7);_0x25d710['responsetime']=moment()[_0x9432('0x59')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3eae44=_0x57204b[_0x9432('0x11')][_0x3f9bc7[_0x9432('0x6e')]];if(ut[_0x9432('0x131')](_0x91d2d8[_0x9432('0x132')])){if(_0x3f9bc7[_0x9432('0xa6')]){rpcDb[_0x9432('0x10a')](_0x3f9bc7[_0x9432('0xfe')]);}if(_0x3f9bc7[_0x9432('0xa7')]){rpcDb[_0x9432('0x85')](_0x3f9bc7[_0x9432('0xfe')]);}ami[_0x9432('0x26')](_0x9432('0x133'),ut[_0x9432('0x9c')](_0x3f9bc7,_0x9432('0x134')));this[_0x9432('0x135')](_0x25d710,_0x3eae44,_0x91d2d8);}else{_0x3f9bc7[_0x9432('0x86')]=moment()[_0x9432('0x59')](_0x9432('0x87'));ut[_0x9432('0xea')](_0x25d710,0x4,_0x9432('0xb4'));rpcDb[_0x9432('0xeb')](_0x25d710,_0x9432('0x136'));}}};Preview[_0x9432('0xc')][_0x9432('0x1b')]=function(_0x39c9a5){var _0x52af5d=this;var _0x32adc1=this[_0x9432('0x14')][_0x39c9a5[_0x9432('0xa8')]];var _0x2d0c1a;if(_0x32adc1){_0x2d0c1a=this[_0x9432('0x11')][_0x32adc1[_0x9432('0x6e')]];logger[_0x9432('0x6c')](_0x9432('0x137'),_0x39c9a5['linkedid'],'\x20Queue',_0x2d0c1a[_0x9432('0x52')],_0x9432('0x138'),_0x2d0c1a[_0x9432('0x2a')]);}if(this['actions'][_0x39c9a5[_0x9432('0xa8')]]&&_0x39c9a5[_0x9432('0xa8')]!==_0x39c9a5[_0x9432('0xb8')]){if(_0x39c9a5[_0x9432('0x139')]==='16'&&this[_0x9432('0x14')][_0x39c9a5[_0x9432('0xa8')]][_0x9432('0x6f')]){this[_0x9432('0x13a')](_0x39c9a5,_0x39c9a5[_0x9432('0xa8')],_0x39c9a5[_0x9432('0x139')]);}else if(this[_0x9432('0x14')][_0x39c9a5[_0x9432('0xa8')]][_0x9432('0x6f')]){logger[_0x9432('0x6c')](_0x9432('0x13b'),_0x39c9a5[_0x9432('0xa8')],_0x39c9a5[_0x9432('0x139')],'\x20Queue',_0x2d0c1a[_0x9432('0x52')],_0x9432('0x138'),_0x2d0c1a[_0x9432('0x2a')]);this[_0x9432('0x13a')](_0x39c9a5,_0x39c9a5[_0x9432('0xa8')],_0x39c9a5[_0x9432('0x139')]);}}else if(_0x32adc1&&_[_0x9432('0x6b')](_0x32adc1[_0x9432('0x13c')])&&_0x2d0c1a[_0x9432('0x13d')]&&_0x39c9a5[_0x9432('0xa8')]===_0x39c9a5[_0x9432('0xb8')]&&_[_0x9432('0x6b')](_0x39c9a5[_0x9432('0xe9')])&&_0x39c9a5[_0x9432('0x139')]==='16'&&_0x39c9a5['channelstate']==='6'&&_[_0x9432('0xe7')](_0x32adc1[_0x9432('0x13e')])){if(_0x32adc1[_0x9432('0xa6')]){rpcDb[_0x9432('0x10a')](_0x32adc1[_0x9432('0xfe')]);}if(_0x32adc1[_0x9432('0xa7')]){rpcDb['disableContact'](_0x32adc1[_0x9432('0xfe')]);}_0x39c9a5['reason']='22';this[_0x9432('0x135')](_0x32adc1,_0x2d0c1a,_0x39c9a5);}else if(_0x32adc1&&_0x32adc1['transfer']){if(_0x39c9a5['cause']==='16'&&this[_0x9432('0x14')][_0x39c9a5['linkedid']]['dialAnswer']){logger[_0x9432('0x6c')](_0x9432('0x13f'),_0x39c9a5[_0x9432('0xa8')],_0x39c9a5[_0x9432('0x139')],_0x9432('0xab'),_0x2d0c1a[_0x9432('0x52')],'pTalking:\x20',_0x2d0c1a[_0x9432('0x2a')]);this['callProgressDetectingCustomer'](_0x39c9a5,_0x39c9a5[_0x9432('0xa8')],_0x39c9a5[_0x9432('0x139')]);}else if(this[_0x9432('0x14')][_0x39c9a5[_0x9432('0xa8')]]['dialAnswer']){logger[_0x9432('0x6c')](_0x9432('0x13b'),_0x39c9a5[_0x9432('0xa8')],_0x39c9a5[_0x9432('0x139')],_0x9432('0xab'),_0x2d0c1a[_0x9432('0x52')],'pTalking:\x20',_0x2d0c1a[_0x9432('0x2a')]);this[_0x9432('0x13a')](_0x39c9a5,_0x39c9a5[_0x9432('0xa8')],_0x39c9a5[_0x9432('0x139')]);}}};Preview[_0x9432('0xc')][_0x9432('0x1f')]=function(_0x4badf0){if(this[_0x9432('0x14')][_0x4badf0[_0x9432('0xe6')]]&&_0x4badf0['destlinkedid']!==_0x4badf0[_0x9432('0x140')]){this[_0x9432('0x13a')](_0x4badf0,_0x4badf0[_0x9432('0xe6')],_0x4badf0[_0x9432('0xe2')]);}};Preview[_0x9432('0xc')][_0x9432('0x1d')]=function(_0x3b0be4){if(this[_0x9432('0x14')][_0x3b0be4[_0x9432('0xa8')]]&&_0x3b0be4[_0x9432('0xa8')]!==_0x3b0be4['uniqueid']&&!this['actions'][_0x3b0be4[_0x9432('0xa8')]][_0x9432('0x6f')]){if(_0x3b0be4['cause']==='1'){this['callProgressDetectingCustomer'](_0x3b0be4,_0x3b0be4[_0x9432('0xa8')],_0x3b0be4[_0x9432('0x139')]);}}};Preview['prototype'][_0x9432('0x141')]=function(_0x581b1c,_0x2cf4b6,_0x5a47ec){if(this['actions'][_0x581b1c]){if(_[_0x9432('0x6b')](this[_0x9432('0x14')][_0x581b1c][_0x9432('0x142')])){this[_0x9432('0x14')][_0x581b1c][_0x9432('0x142')]={};}this[_0x9432('0x14')][_0x581b1c]['variables'][_0x2cf4b6]=_0x5a47ec;}};Preview['prototype'][_0x9432('0x22')]=function(_0xb4c493){try{if(!_['isNil'](_0xb4c493)){if(ut[_0x9432('0x143')](_['keys'](_0xb4c493[_0x9432('0x144')])[0x0])){this[_0x9432('0x141')](_0xb4c493[_0x9432('0xb8')],_[_0x9432('0x145')](_0xb4c493['variable'])[0x0],_0xb4c493[_0x9432('0x146')]);}}}catch(_0x2461de){logger[_0x9432('0x147')]('[syncVarSet][Preview]',util[_0x9432('0x148')](_0x2461de,{'showHidden':![],'depth':null}));}};Preview[_0x9432('0xc')][_0x9432('0x23')]=function(_0xcd5c05){if(_0xcd5c05){if(this[_0x9432('0x14')][_0xcd5c05['transfertargetlinkedid']]){this[_0x9432('0x14')][_0xcd5c05[_0x9432('0x149')]][_0x9432('0x13e')]=!![];}}};Preview[_0x9432('0xc')][_0x9432('0x25')]=function(_0x1d94d7){if(_0x1d94d7){if(this[_0x9432('0x14')][_0x1d94d7[_0x9432('0x14a')]]){this[_0x9432('0x14')][_0x1d94d7[_0x9432('0x14a')]][_0x9432('0x13e')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
index 268d5fe..4afa2d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0faf=['rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','disableContact','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','connectedlinename','membername','from-sip','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','then','createHistory','resolve','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal'];(function(_0x251a9e,_0x5dfd0e){var _0x25e399=function(_0x114eae){while(--_0x114eae){_0x251a9e['push'](_0x251a9e['shift']());}};_0x25e399(++_0x5dfd0e);}(_0x0faf,0x132));var _0xf0fa=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0x0faf[_0x51a6d6];return _0x5ef1a8;};'use strict';var util=require(_0xf0fa('0x0'));var BPromise=require('bluebird');var logger=require(_0xf0fa('0x1'))(_0xf0fa('0x2'));var _=require(_0xf0fa('0x3'));var cmHopper=require(_0xf0fa('0x4'));var cmHopperFinal=require(_0xf0fa('0x5'));var cmHopperHistory=require(_0xf0fa('0x6'));var cmHopperBlack=require(_0xf0fa('0x7'));var voiceQueueRt=require(_0xf0fa('0x8'));var agentReportPreview=require(_0xf0fa('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x3637a3){return function(_0x44ffa0){logger[_0xf0fa('0xa')](_0x3637a3,util[_0xf0fa('0xb')](_0x44ffa0,{'showHidden':![],'depth':null}));};}function create(_0x2db1d9){return BPromise['resolve']()[_0xf0fa('0xc')](cmHopperHistory[_0xf0fa('0xd')](_0x2db1d9))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x3bda51){return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](agentReportPreview[_0xf0fa('0xd')](_0x3bda51))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x10')));}function moveContact(_0x379ff6){return BPromise[_0xf0fa('0xe')]()['then'](cmHopper[_0xf0fa('0x11')](_0x379ff6,!![]))['catch'](loggerCatch(_0xf0fa('0x12')));}exports['checkIsBlackList']=function(_0x39ae2b){return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](cmHopperBlack['checkIsBlackList'](_0x39ae2b))['catch'](loggerCatch(_0xf0fa('0x13')));};exports['getContactPreview']=function(_0x1f7159){return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](cmHopper[_0xf0fa('0x14')](_0x1f7159))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x15')));};exports[_0xf0fa('0xd')]=function(_0x3f3bb7,_0x497542){create(_0x3f3bb7)[_0xf0fa('0xf')](loggerCatch(_0x497542));moveContact(_0x3f3bb7)[_0xf0fa('0xf')](loggerCatch(_0x497542));};exports[_0xf0fa('0x16')]=function(_0x1d3c22,_0x2bdf82){createAgent(_0x1d3c22)[_0xf0fa('0xf')](loggerCatch(_0x2bdf82));};exports['createCustomerHistory']=function(_0x56ef81,_0x2f376d){create(_0x56ef81)[_0xf0fa('0xf')](loggerCatch(_0x2f376d));};exports[_0xf0fa('0x17')]=function(_0x2385e2,_0x1a3620){moveContact(_0x2385e2)[_0xf0fa('0xf')](loggerCatch(_0x1a3620));};exports[_0xf0fa('0x18')]=function(_0x3de639,_0x3b87a2,_0x15942b){if(_0x3b87a2){_0x3de639[_0xf0fa('0x19')]=null;}if(_0x15942b){_0x3de639['active']=![];}return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](cmHopper[_0xf0fa('0x18')](_0x3de639))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x1a')));};exports[_0xf0fa('0x1b')]=function(_0x3901aa){return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](cmHopper['countReScheduled'](_0x3901aa))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x1c')));};exports['unlockContact']=function(_0x3b5d7d){return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](cmHopper['unlockContact']({'UserId':null},_0x3b5d7d,0x1))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x1d')));};exports[_0xf0fa('0x1e')]=function(_0xf631f6){return BPromise['resolve']()['then'](cmHopper[_0xf0fa('0x1f')]({'active':![]},_0xf631f6,0x1))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x20')));};exports[_0xf0fa('0x21')]=function(_0x57b8e9){var _0x4058d6={};_0x4058d6[_0xf0fa('0x22')]=_0x57b8e9[_0xf0fa('0x22')];_0x4058d6['uniqueid']=_0x57b8e9[_0xf0fa('0x23')];_0x4058d6['calleridnum']=_0x57b8e9[_0xf0fa('0x24')];_0x4058d6[_0xf0fa('0x25')]=_0x57b8e9[_0xf0fa('0x25')];_0x4058d6['queue']=_0x57b8e9[_0xf0fa('0x26')];_0x4058d6[_0xf0fa('0x27')]=_0x57b8e9[_0xf0fa('0x28')];_0x4058d6[_0xf0fa('0x29')]=_0x57b8e9[_0xf0fa('0x28')];_0x4058d6[_0xf0fa('0x2a')]=0x1;_0x4058d6['queuecallercompleteAt']=_0x57b8e9['endtime'];_0x4058d6[_0xf0fa('0x2b')]=_0x57b8e9[_0xf0fa('0x2c')];_0x4058d6['context']=_0xf0fa('0x2d');_0x4058d6['exten']='xcally-motion-preview';_0x4058d6['holdtime']=0x0;_0x4058d6[_0xf0fa('0x2e')]=0x1;_0x4058d6['lastAssignedTo']=_0x57b8e9[_0xf0fa('0x2c')];_0x4058d6[_0xf0fa('0x2f')]=_0xf0fa('0x30');return BPromise[_0xf0fa('0xe')]()[_0xf0fa('0xc')](voiceQueueReport[_0xf0fa('0x31')](_0x4058d6))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x32')));};exports['getContactRecallMe']=function(_0x3abd96,_0x307aa8){return BPromise[_0xf0fa('0xe')]()['then'](cmHopper[_0xf0fa('0x33')](_0x3abd96,_0x307aa8))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x34')));};exports[_0xf0fa('0x35')]=function(_0x4879ef){return BPromise['resolve']()[_0xf0fa('0xc')](cmHopper[_0xf0fa('0x18')](_0x4879ef,!![],!![]))[_0xf0fa('0xf')](loggerCatch(_0xf0fa('0x36')));};
\ No newline at end of file
+var _0xc978=['checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','context','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20'];(function(_0x4ada02,_0x206e9a){var _0x1449ae=function(_0x389ebb){while(--_0x389ebb){_0x4ada02['push'](_0x4ada02['shift']());}};_0x1449ae(++_0x206e9a);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x8c97('0x0'));var BPromise=require(_0x8c97('0x1'));var logger=require(_0x8c97('0x2'))(_0x8c97('0x3'));var _=require(_0x8c97('0x4'));var cmHopper=require(_0x8c97('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x8c97('0x6'));var cmHopperBlack=require(_0x8c97('0x7'));var voiceQueueRt=require(_0x8c97('0x8'));var agentReportPreview=require(_0x8c97('0x9'));var voiceQueueReport=require(_0x8c97('0xa'));function loggerCatch(_0x2a9434){return function(_0xabd146){logger['error'](_0x2a9434,util[_0x8c97('0xb')](_0xabd146,{'showHidden':![],'depth':null}));};}function create(_0x1b5864){return BPromise[_0x8c97('0xc')]()[_0x8c97('0xd')](cmHopperHistory[_0x8c97('0xe')](_0x1b5864))[_0x8c97('0xf')](loggerCatch(_0x8c97('0x10')));}function createAgent(_0x4f2d78){return BPromise[_0x8c97('0xc')]()[_0x8c97('0xd')](agentReportPreview[_0x8c97('0xe')](_0x4f2d78))[_0x8c97('0xf')](loggerCatch(_0x8c97('0x10')));}function moveContact(_0x949a83){return BPromise[_0x8c97('0xc')]()[_0x8c97('0xd')](cmHopper[_0x8c97('0x11')](_0x949a83,!![]))['catch'](loggerCatch(_0x8c97('0x12')));}exports[_0x8c97('0x13')]=function(_0x4ffa19){return BPromise[_0x8c97('0xc')]()[_0x8c97('0xd')](cmHopperBlack['checkIsBlackList'](_0x4ffa19))[_0x8c97('0xf')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x57902c){return BPromise[_0x8c97('0xc')]()[_0x8c97('0xd')](cmHopper[_0x8c97('0x14')](_0x57902c))[_0x8c97('0xf')](loggerCatch(_0x8c97('0x15')));};exports[_0x8c97('0xe')]=function(_0x1ea67f,_0xe3be1){create(_0x1ea67f)[_0x8c97('0xf')](loggerCatch(_0xe3be1));moveContact(_0x1ea67f)['catch'](loggerCatch(_0xe3be1));};exports[_0x8c97('0x16')]=function(_0x3f7ac7,_0x18cffa){createAgent(_0x3f7ac7)[_0x8c97('0xf')](loggerCatch(_0x18cffa));};exports[_0x8c97('0x17')]=function(_0x1445db,_0xb502e7){create(_0x1445db)[_0x8c97('0xf')](loggerCatch(_0xb502e7));};exports[_0x8c97('0x18')]=function(_0x18e6fc,_0x3bb0fa){moveContact(_0x18e6fc)[_0x8c97('0xf')](loggerCatch(_0x3bb0fa));};exports[_0x8c97('0x19')]=function(_0x16e3c4,_0x3ea5a3,_0x2b83a8){if(_0x3ea5a3){_0x16e3c4['UserId']=null;}if(_0x2b83a8){_0x16e3c4[_0x8c97('0x1a')]=![];}return BPromise[_0x8c97('0xc')]()[_0x8c97('0xd')](cmHopper['rescheduleContact'](_0x16e3c4))['catch'](loggerCatch(_0x8c97('0x1b')));};exports['countReScheduled']=function(_0x41d276){return BPromise[_0x8c97('0xc')]()[_0x8c97('0xd')](cmHopper[_0x8c97('0x1c')](_0x41d276))[_0x8c97('0xf')](loggerCatch(_0x8c97('0x1d')));};exports[_0x8c97('0x1e')]=function(_0x5132c5){return BPromise['resolve']()[_0x8c97('0xd')](cmHopper[_0x8c97('0x1e')]({'UserId':null},_0x5132c5,0x1))[_0x8c97('0xf')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x25ef83){return BPromise[_0x8c97('0xc')]()[_0x8c97('0xd')](cmHopper[_0x8c97('0x1e')]({'active':![]},_0x25ef83,0x1))[_0x8c97('0xf')](loggerCatch(_0x8c97('0x1f')));};exports['crateCustomerReportQueue']=function(_0x443dfd){var _0x509520={};_0x509520[_0x8c97('0x20')]=_0x443dfd['type'];_0x509520[_0x8c97('0x21')]=_0x443dfd[_0x8c97('0x21')];_0x509520['calleridnum']=_0x443dfd[_0x8c97('0x22')];_0x509520['calleridname']=_0x443dfd[_0x8c97('0x23')];_0x509520[_0x8c97('0x24')]=_0x443dfd[_0x8c97('0x24')];_0x509520[_0x8c97('0x25')]=_0x443dfd[_0x8c97('0x26')];_0x509520[_0x8c97('0x27')]=_0x443dfd['answertime'];_0x509520['queuecallercomplete']=0x1;_0x509520[_0x8c97('0x28')]=_0x443dfd[_0x8c97('0x29')];_0x509520[_0x8c97('0x2a')]=_0x443dfd['membername'];_0x509520[_0x8c97('0x2b')]='from-sip';_0x509520['exten']=_0x8c97('0x2c');_0x509520[_0x8c97('0x2d')]=0x0;_0x509520[_0x8c97('0x2e')]=0x1;_0x509520[_0x8c97('0x2f')]=_0x443dfd[_0x8c97('0x30')];_0x509520[_0x8c97('0x31')]='COMPLETED';return BPromise[_0x8c97('0xc')]()[_0x8c97('0xd')](voiceQueueReport[_0x8c97('0x32')](_0x509520))[_0x8c97('0xf')](loggerCatch(_0x8c97('0x33')));};exports[_0x8c97('0x34')]=function(_0x157c7b,_0x20c33c){return BPromise['resolve']()[_0x8c97('0xd')](cmHopper[_0x8c97('0x34')](_0x157c7b,_0x20c33c))[_0x8c97('0xf')](loggerCatch(_0x8c97('0x35')));};exports[_0x8c97('0x36')]=function(_0x1166f1){return BPromise['resolve']()[_0x8c97('0xd')](cmHopper[_0x8c97('0x19')](_0x1166f1,!![],!![]))[_0x8c97('0xf')](loggerCatch(_0x8c97('0x37')));};
\ No newline at end of file
index 1ac9b84..d7ff29e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d9=['NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','buildAcw','queue','agentReadyId','not_inuse','status','push','getDiff','createBody','CampaignId','type','campaigntype','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22'];(function(_0x411727,_0x16b412){var _0x73913b=function(_0x208c2b){while(--_0x208c2b){_0x411727['push'](_0x411727['shift']());}};_0x73913b(++_0x16b412);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x901d('0x0'));var _=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var logger=require(_0x901d('0x3'))('preview');var ipAgi=process[_0x901d('0x4')][_0x901d('0x5')]||_0x901d('0x6');function getSeconds(_0x8f7b4,_0x214f38){var _0x456f31=moment(_0x8f7b4)[_0x901d('0x7')](0x0);var _0x4e7842=moment(_0x214f38)[_0x901d('0x7')](0x0);return _0x456f31[_0x901d('0x8')](_0x4e7842,_0x901d('0x9'));}exports[_0x901d('0xa')]=function(_0x313f85){return function(_0x39fc94){logger[_0x901d('0xb')](_0x313f85,util[_0x901d('0xc')](_0x39fc94,{'showHidden':![],'depth':null}));};};exports[_0x901d('0xd')]=function(_0xacff40,_0x440fb0){logger[_0x901d('0xe')](_0xacff40,util[_0x901d('0xc')](_0x440fb0,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x439f17,_0x5ba100){logger[_0x901d('0xb')](_0x439f17,util[_0x901d('0xc')](_0x5ba100,{'showHidden':![],'depth':null}));};exports[_0x901d('0xf')]=function(_0x42ce79){return function(_0x15ebaf){logger['info'](_0x42ce79,util[_0x901d('0xc')](_0x15ebaf,{'showHidden':![],'depth':null}));};};exports[_0x901d('0x10')]=function(_0x3d00e4,_0x1618a8,_0xb8869a){return{'message':_0x3d00e4,'unlock':_0x1618a8,'active':_0xb8869a};};exports[_0x901d('0x11')]=function(_0x530a2b,_0x991ee2,_0x13903c){if(!_[_0x901d('0x12')](_0x13903c)&&_0x901d('0x13')===typeof _0x13903c&&!_[_0x901d('0x14')](_0x13903c)){if(!_[_0x901d('0x12')](_0x991ee2)&&_0x901d('0x13')===typeof _0x991ee2&&!_[_0x901d('0x14')](_0x991ee2)){return util[_0x901d('0x15')](_0x901d('0x16'),_0x991ee2,_0x13903c);}return util[_0x901d('0x15')](_0x901d('0x16'),_0x13903c,_0x13903c);}if(!_[_0x901d('0x12')](_0x530a2b)&&_0x901d('0x13')===typeof _0x530a2b&&!_[_0x901d('0x14')](_0x530a2b)){return _0x530a2b;}return _0x901d('0x17');};exports[_0x901d('0x18')]=function(_0x31e1f7){if(_['isNil'](_0x31e1f7)){return![];}return _0x31e1f7;};exports[_0x901d('0x19')]=function(_0x2f32f8,_0x4d27db,_0x5bdff4,_0x496a06,_0x53f8ae,_0x316a9f){var _0x44ea6f={'XMD-QUEUE':_0x4d27db['Queue']?_0x4d27db[_0x901d('0x1a')][_0x901d('0x1b')]:'','XMD-CALLERID':_0x496a06,'XMD-CALLERID-PREVIEW':_0x316a9f?util['format'](_0x901d('0x16'),_0x316a9f[_0x901d('0x1c')],_0x316a9f[_0x901d('0x1d')]):_0x496a06,'XMD-DIALID':_0x53f8ae,'XMD-CONTACTID':_0x4d27db[_0x901d('0x1e')],'XMD-CDRTYPE':_0x901d('0x1f'),'CALLERID(all)':_0x496a06,'XMD-VOICEQUEUEID':_0x4d27db[_0x901d('0x20')],'XMD-DIALCHANNEL':_0x5bdff4,'XMD-DIALTIMEOUT':_0x2f32f8[_0x901d('0x21')]||0x1e,'XMD-DIALOPTIONS':util[_0x901d('0x15')]('\x22rtTxX%s%s\x22',_0x2f32f8[_0x901d('0x22')]?'g':'',_[_0x901d('0x14')](_0x2f32f8[_0x901d('0x23')])?'':_0x901d('0x24')),'XMD-DIALURL':_0x2f32f8['dialPreviewUrl']||'','XMD-AGI':_0x2f32f8[_0x901d('0x25')]?util[_0x901d('0x15')](_0x901d('0x26'),ipAgi,_0x2f32f8[_0x901d('0x25')]):_0x901d('0x27'),'XMD-AGIAFTER':_0x2f32f8['dialQueueProject2']?util[_0x901d('0x15')](_0x901d('0x26'),ipAgi,_0x2f32f8[_0x901d('0x22')]):_0x901d('0x27'),'XMD-ORIGINATECALLERIDNUM':_0x316a9f?_0x316a9f[_0x901d('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x316a9f?_0x316a9f[_0x901d('0x29')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x901d('0x14')](_0x2f32f8['monitor_format'])){_0x44ea6f[util[_0x901d('0x15')]('%s',_0x901d('0x2a'))]=_0x2f32f8[_0x901d('0x23')];_0x44ea6f[util[_0x901d('0x15')]('%s',_0x901d('0x2b'))]=_0x53f8ae;}if(_0x4d27db&&_0x4d27db[_0x901d('0x2c')]){for(var _0x4137b7 in _0x4d27db[_0x901d('0x2c')]){if(_0x4d27db[_0x901d('0x2c')][_0x901d('0x2d')](_0x4137b7)){if(!_[_0x901d('0x2e')](_0x4d27db[_0x901d('0x2c')][_0x4137b7])&&_0x4137b7!=='id'&&_0x4137b7!==_0x901d('0x2f')&&_0x4137b7!==_0x901d('0x30')&&_0x4137b7!==_0x901d('0x31')){_0x44ea6f[util['format'](_0x901d('0x32'),_0x901d('0x33'),_[_0x901d('0x34')](_0x4137b7))]=_0x4d27db['Contact'][_0x4137b7];}}}}return _0x44ea6f;};exports[_0x901d('0x35')]=function(_0x1c6e1c){var _0x339235={};for(var _0x410ef4 in _0x1c6e1c){if(_0x1c6e1c[_0x901d('0x2d')](_0x410ef4)){_0x339235[util[_0x901d('0x15')]('%s',_[_0x901d('0x36')](_0x410ef4))]=_0x1c6e1c[_0x410ef4];}}return{'variables':_0x339235};};exports[_0x901d('0x37')]=function(_0x3d8421,_0x20a58d){if(!_['isNil'](_0x3d8421)){if(_0x3d8421['hasOwnProperty'](_0x901d('0x38'))){if(_0x3d8421['originated']>0x0){_0x3d8421[_0x901d('0x38')]-=0x1;}else{logger[_0x901d('0xb')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x20a58d);}}}else{logger[_0x901d('0xb')](_0x901d('0x39'),_0x20a58d);}};exports[_0x901d('0x3a')]=function(_0x508ac6){var _0x1a1be6=moment()[_0x901d('0x15')](_0x901d('0x3b'));_0x508ac6[_0x901d('0x3c')]=0xd;_0x508ac6[_0x901d('0x3d')]=_0x901d('0x3e');_0x508ac6[_0x901d('0x3f')]=_0x1a1be6;_0x508ac6[_0x901d('0x40')]=_0x1a1be6;_0x508ac6[_0x901d('0x41')]=_0x1a1be6;};exports[_0x901d('0x42')]=function(_0x30adcd,_0x3d4f8b,_0x27b101){var _0x3a6b5f=moment()[_0x901d('0x15')](_0x901d('0x3b'));_0x30adcd['state']=_0x3d4f8b;_0x30adcd[_0x901d('0x3d')]=_0x27b101;_0x30adcd[_0x901d('0x40')]=_0x3a6b5f;_0x30adcd['ringtime']=getSeconds(_0x30adcd['responsetime'],_0x30adcd[_0x901d('0x3f')]);};exports['logLookAgent']=function(_0x2a5057,_0x3d0556,_0x4bebe){_0x2a5057[_0x901d('0x43')]=_0x3d0556;_0x2a5057[_0x901d('0x44')]=_0x4bebe;};exports[_0x901d('0x45')]=function(_0x5df4cb,_0x4ce6e4,_0x4ee804){var _0x4c4fd0=moment()[_0x901d('0x15')](_0x901d('0x3b'));_0x5df4cb['state']=_0x4ce6e4;_0x5df4cb[_0x901d('0x3d')]=_0x4ee804;_0x5df4cb[_0x901d('0x40')]=_0x5df4cb['responsetime']?_0x5df4cb[_0x901d('0x40')]:_0x4c4fd0;_0x5df4cb[_0x901d('0x41')]=_0x5df4cb[_0x901d('0x41')]?_0x5df4cb[_0x901d('0x41')]:_0x4c4fd0;_0x5df4cb['ringtime']=getSeconds(_0x5df4cb['responsetime']||0x0,_0x5df4cb[_0x901d('0x3f')]||0x0);_0x5df4cb[_0x901d('0x46')]=_0x5df4cb[_0x901d('0x47')]?getSeconds(_0x5df4cb[_0x901d('0x41')],_0x5df4cb[_0x901d('0x47')]):0x0;};exports[_0x901d('0x48')]=function(_0x88bb50){return _0x88bb50===_0x901d('0x49');};exports[_0x901d('0x4a')]=function(_0x2b23bc,_0x31be2d,_0x50a0c5,_0x276803,_0x4d2b1c){var _0x2b28a7=_0x276803?'RECALL':_0x2b23bc[_0x901d('0x1c')];_0x2b28a7=_0x4d2b1c?'BOOKED':_0x2b28a7;return{'actionid':_0x2b23bc[_0x901d('0x4b')],'action':_0x901d('0x4c'),'channel':_0x2b23bc[_0x901d('0x4d')],'callerid':util[_0x901d('0x15')](_0x901d('0x16'),_0x2b28a7,_0x2b23bc[_0x901d('0x1d')]),'Exten':_0x901d('0x4e'),'Context':_0x901d('0x4f'),'Priority':'1','variable':_0x50a0c5,'timeout':(_0x31be2d[_0x901d('0x50')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2b23bc[_0x901d('0x4b')]};};exports[_0x901d('0x51')]=function(_0x54fc19){return _0x54fc19[_0x901d('0x52')]+_0x54fc19[_0x901d('0x53')]+_0x54fc19[_0x901d('0x54')]+_0x54fc19[_0x901d('0x55')]+_0x54fc19[_0x901d('0x56')];};exports[_0x901d('0x57')]=function(_0x27459b){var _0x43135c=_[_0x901d('0x58')](_0x27459b);_0x43135c[_0x901d('0x3c')]=0xf;_0x43135c[_0x901d('0x3d')]=_0x901d('0x59');return _0x43135c;};exports[_0x901d('0x5a')]=function(_0x23f2a9,_0x4888e8,_0x505965){var _0x3b85e3={};_0x3b85e3[_0x4888e8]=_0x23f2a9[_0x4888e8];_0x3b85e3[_0x901d('0x5b')]=![];_0x3b85e3[_0x901d('0x5c')]=moment()[_0x901d('0x5d')](_0x505965,_0x901d('0x5e'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3b85e3[_0x901d('0x1e')]=_0x23f2a9[_0x901d('0x1e')];_0x3b85e3['ListId']=_0x23f2a9[_0x901d('0x5f')];_0x3b85e3[_0x901d('0x20')]=_0x23f2a9['VoiceQueueId']||undefined;return _0x3b85e3;};exports[_0x901d('0x60')]=function(_0x53dc43,_0x3d7c00){if(!_[_0x901d('0x2e')](_0x53dc43)){if(_0x53dc43[_0x901d('0x61')]>0x0){_0x53dc43[_0x901d('0x61')]-=0x1;}else{logger['error'](_0x3d7c00,_0x901d('0x62'));}}else{logger[_0x901d('0xb')](_0x3d7c00,_0x901d('0x63'));}};exports[_0x901d('0x64')]=function(_0x10c51c){if(_0x10c51c<=0x0){return!![];}return![];};exports[_0x901d('0x65')]=function(_0x17c716,_0x42ddd){_0x17c716[_0x901d('0x66')]=_0x42ddd;_0x17c716[_0x901d('0x1b')]=_0x17c716['queue'];_0x17c716[_0x901d('0x67')]=_0x17c716['channelAgent'];return _0x17c716;};exports[_0x901d('0x68')]=function(_0x26e6a2){var _0xaa7394={};_0xaa7394[_0x901d('0x69')]=_0x26e6a2[_0x901d('0x69')];_0xaa7394[_0x901d('0x67')]=_0x26e6a2[_0x901d('0x4d')];_0xaa7394[_0x901d('0x4b')]=_0x26e6a2['uniqueid'];return _0xaa7394;};exports[_0x901d('0x6a')]=function(_0x3eeca4){var _0x226b81=[];for(var _0x4b7e88 in _0x3eeca4){if(_0x3eeca4[_0x901d('0x2d')](_0x4b7e88)){if(!_['isNil'](_0x3eeca4[_0x4b7e88])&&_0x3eeca4[_0x4b7e88][_0x901d('0x3c')]===_0x901d('0x6b')&&_0x3eeca4[_0x4b7e88][_0x901d('0x6c')]==='reachable'){_0x226b81[_0x901d('0x6d')](_0x3eeca4[_0x4b7e88]['id']);}}}return _0x226b81;};exports[_0x901d('0x6e')]=function(_0x3740a3){var _0x45e4d5=moment()[_0x901d('0x7')](0x0);var _0x74cfc=moment(_0x3740a3)['milliseconds'](0x0);return _0x45e4d5[_0x901d('0x8')](_0x74cfc,_0x901d('0x9'));};exports[_0x901d('0x6f')]=function(_0x3229ae){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3229ae[_0x901d('0x1e')],'ListId':_0x3229ae[_0x901d('0x5f')],'VoiceQueueId':_0x3229ae['VoiceQueueId']||undefined,'CampaignId':_0x3229ae[_0x901d('0x70')]||undefined};};exports['filterKey']=function(_0x54cac2){if(_0x54cac2==='uniqueid'||_0x54cac2==='idContact'||_0x54cac2===_0x901d('0x69')||_0x54cac2===_0x901d('0x71')||_0x54cac2===_0x901d('0x72')||_0x54cac2==='dialAnswer'||_0x54cac2===_0x901d('0x43')||_0x54cac2==='channelAgent'||_0x54cac2===_0x901d('0x1c')||_0x54cac2===_0x901d('0x5b')||_0x54cac2===_0x901d('0x1d')||_0x54cac2===_0x901d('0x5c')||_0x54cac2===_0x901d('0x52')||_0x54cac2===_0x901d('0x53')||_0x54cac2===_0x901d('0x54')||_0x54cac2===_0x901d('0x73')||_0x54cac2===_0x901d('0x74')||_0x54cac2===_0x901d('0x75')||_0x54cac2===_0x901d('0x76')||_0x54cac2===_0x901d('0x77')||_0x54cac2===_0x901d('0x1e')||_0x54cac2===_0x901d('0x5f')||_0x54cac2==='UserId'||_0x54cac2==='VoiceQueueId'||_0x54cac2===_0x901d('0x78')||_0x54cac2===_0x901d('0x79')||_0x54cac2===_0x901d('0x7a')||_0x54cac2===_0x901d('0x7b')||_0x54cac2===_0x901d('0x7c')||_0x54cac2===_0x901d('0x7d')||_0x54cac2===_0x901d('0x7e')||_0x54cac2==='xmd-dialoptions'||_0x54cac2==='xmd-dialid'||_0x54cac2==='xmd-dialchannel'||_0x54cac2===_0x901d('0x7f')||_0x54cac2===_0x901d('0x80')||_0x54cac2===_0x901d('0x81')||_0x54cac2===_0x901d('0x82')||_0x54cac2===_0x901d('0x83')||_0x54cac2===_0x901d('0x84')||_0x54cac2===_0x901d('0x85')||_0x54cac2===_0x901d('0x86')||_0x54cac2===_0x901d('0x87')||_0x54cac2==='rtpaudioqosloss'||_0x54cac2==='rtpaudioqoslossbridged'||_0x54cac2===_0x901d('0x88')||_0x54cac2===_0x901d('0x89')||_0x54cac2===_0x901d('0x84')||_0x54cac2===_0x901d('0x85')||_0x54cac2===_0x901d('0x86')||_0x54cac2===_0x901d('0x87')||_0x54cac2===_0x901d('0x8a')||_0x54cac2===_0x901d('0x8b')||_0x54cac2===_0x901d('0x88')||_0x54cac2===_0x901d('0x89')||_0x54cac2==='bridgepeer'||_0x54cac2===_0x901d('0x8c')||_0x54cac2===_0x901d('0x3c')||_0x54cac2==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2a422d,_0x3cfd0c){var _0x4b156c,_0x242954,_0x16b025;if(_0x3cfd0c<=0x0){_0x3cfd0c=0x1;}_0x4b156c=new RegExp(_0x901d('0x8d')+_0x3cfd0c+'}$');_0x242954=Math[_0x901d('0x8e')](0xa,_0x3cfd0c-0x1);_0x16b025=Math['pow'](0xa,_0x3cfd0c)-0x1;return util[_0x901d('0x15')]('%s',_[_0x901d('0x8f')](_0x2a422d,_0x4b156c,_[_0x901d('0x90')](_0x242954,_0x16b025)));};exports[_0x901d('0x91')]=function(_0x25b089){var _0x11088a=_0x25b089['match'](/"(.*?)"/);return _0x11088a?_0x11088a[0x1]:_0x25b089;};exports[_0x901d('0x92')]=function(_0x302049){var _0x26b498=_0x302049['match'](/<(.*?)>/);return _0x26b498?_0x26b498[0x1]:_0x302049;};
\ No newline at end of file
+var _0xee2c=['active','scheduledat','minutes','ContactId','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','buildAcw','interface','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','membername','countbusyretry','callbackuniqueid','UserId','xmd-voicequeueid','xmd-queue','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','match','extractCalleridNumber','util','moment','../../../../config/logger','preview','env','milliseconds','diff','seconds','error','inspect','logger','info','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','endtime','state','responsetime','logLookAgent','logCustomer','ringtime','answertime','isFailure','Failure','variablesAction','calleridname','BOOKED','uniqueid','originate','channelAgent','\x22%s\x22\x20<%s>','xcally-motion-preview','from-sip','timeout','totalGlobal','countcongestionretry','countnosuchnumberretry','cloneAction','clone','scheduledAt'];(function(_0x4bb21c,_0x368fc7){var _0x2c154a=function(_0x2dd3fc){while(--_0x2dd3fc){_0x4bb21c['push'](_0x4bb21c['shift']());}};_0x2c154a(++_0x368fc7);}(_0xee2c,0x1c7));var _0xcee2=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xee2c[_0x45d3f0];return _0x314b79;};'use strict';var util=require(_0xcee2('0x0'));var _=require('lodash');var moment=require(_0xcee2('0x1'));var logger=require(_0xcee2('0x2'))(_0xcee2('0x3'));var ipAgi=process[_0xcee2('0x4')]['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0xc9b213,_0xb70cd1){var _0x49d04d=moment(_0xc9b213)[_0xcee2('0x5')](0x0);var _0x409944=moment(_0xb70cd1)[_0xcee2('0x5')](0x0);return _0x49d04d[_0xcee2('0x6')](_0x409944,_0xcee2('0x7'));}exports['loggerCatch']=function(_0x52a4ac){return function(_0xea6c3c){logger[_0xcee2('0x8')](_0x52a4ac,util[_0xcee2('0x9')](_0xea6c3c,{'showHidden':![],'depth':null}));};};exports[_0xcee2('0xa')]=function(_0x436ab6,_0x18286c){logger[_0xcee2('0xb')](_0x436ab6,util[_0xcee2('0x9')](_0x18286c,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0xca2c64,_0x214e78){logger[_0xcee2('0x8')](_0xca2c64,util[_0xcee2('0x9')](_0x214e78,{'showHidden':![],'depth':null}));};exports[_0xcee2('0xc')]=function(_0x4b97dd){return function(_0x25d11e){logger['info'](_0x4b97dd,util['inspect'](_0x25d11e,{'showHidden':![],'depth':null}));};};exports['message']=function(_0xfa663a,_0x34cc92,_0x2afc56){return{'message':_0xfa663a,'unlock':_0x34cc92,'active':_0x2afc56};};exports[_0xcee2('0xd')]=function(_0x54a718,_0x1cf4bb,_0x818e13){if(!_[_0xcee2('0xe')](_0x818e13)&&_0xcee2('0xf')===typeof _0x818e13&&!_[_0xcee2('0x10')](_0x818e13)){if(!_[_0xcee2('0xe')](_0x1cf4bb)&&_0xcee2('0xf')===typeof _0x1cf4bb&&!_[_0xcee2('0x10')](_0x1cf4bb)){return util[_0xcee2('0x11')]('\x22%s\x22\x20<%s>',_0x1cf4bb,_0x818e13);}return util[_0xcee2('0x11')]('\x22%s\x22\x20<%s>',_0x818e13,_0x818e13);}if(!_[_0xcee2('0xe')](_0x54a718)&&_0xcee2('0xf')===typeof _0x54a718&&!_[_0xcee2('0x10')](_0x54a718)){return _0x54a718;}return _0xcee2('0x12');};exports['isActive']=function(_0x245811){if(_[_0xcee2('0x13')](_0x245811)){return![];}return _0x245811;};exports[_0xcee2('0x14')]=function(_0x36af7f,_0x3395b1,_0x223f98,_0x42e222,_0x198500,_0x34f480){var _0x148023={'XMD-QUEUE':_0x3395b1[_0xcee2('0x15')]?_0x3395b1['Queue'][_0xcee2('0x16')]:'','XMD-CALLERID':_0x42e222,'XMD-CALLERID-PREVIEW':_0x34f480?util[_0xcee2('0x11')]('\x22%s\x22\x20<%s>',_0x34f480['calleridname'],_0x34f480[_0xcee2('0x17')]):_0x42e222,'XMD-DIALID':_0x198500,'XMD-CONTACTID':_0x3395b1['ContactId'],'XMD-CDRTYPE':_0xcee2('0x18'),'CALLERID(all)':_0x42e222,'XMD-VOICEQUEUEID':_0x3395b1[_0xcee2('0x19')],'XMD-DIALCHANNEL':_0x223f98,'XMD-DIALTIMEOUT':_0x36af7f[_0xcee2('0x1a')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x36af7f[_0xcee2('0x1b')]?'g':'',_[_0xcee2('0x10')](_0x36af7f[_0xcee2('0x1c')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x36af7f[_0xcee2('0x1d')]||'','XMD-AGI':_0x36af7f['dialQueueProject']?util[_0xcee2('0x11')](_0xcee2('0x1e'),ipAgi,_0x36af7f[_0xcee2('0x1f')]):_0xcee2('0x20'),'XMD-AGIAFTER':_0x36af7f[_0xcee2('0x1b')]?util[_0xcee2('0x11')](_0xcee2('0x1e'),ipAgi,_0x36af7f[_0xcee2('0x1b')]):_0xcee2('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x34f480?_0x34f480[_0xcee2('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x34f480?_0x34f480[_0xcee2('0x22')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0xcee2('0x10')](_0x36af7f[_0xcee2('0x1c')])){_0x148023[util[_0xcee2('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x36af7f[_0xcee2('0x1c')];_0x148023[util[_0xcee2('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x198500;}if(_0x3395b1&&_0x3395b1[_0xcee2('0x23')]){for(var _0x25ead9 in _0x3395b1['Contact']){if(_0x3395b1['Contact'][_0xcee2('0x24')](_0x25ead9)){if(!_['isNil'](_0x3395b1['Contact'][_0x25ead9])&&_0x25ead9!=='id'&&_0x25ead9!==_0xcee2('0x25')&&_0x25ead9!==_0xcee2('0x26')&&_0x25ead9!=='updatedAt'){_0x148023[util[_0xcee2('0x11')](_0xcee2('0x27'),_0xcee2('0x28'),_[_0xcee2('0x29')](_0x25ead9))]=_0x3395b1[_0xcee2('0x23')][_0x25ead9];}}}}return _0x148023;};exports[_0xcee2('0x2a')]=function(_0x3f727d){var _0x1a67d6={};for(var _0x1713ef in _0x3f727d){if(_0x3f727d[_0xcee2('0x24')](_0x1713ef)){_0x1a67d6[util[_0xcee2('0x11')]('%s',_[_0xcee2('0x2b')](_0x1713ef))]=_0x3f727d[_0x1713ef];}}return{'variables':_0x1a67d6};};exports['updateOriginated']=function(_0x4775ba,_0x349a2f){if(!_['isNil'](_0x4775ba)){if(_0x4775ba[_0xcee2('0x24')](_0xcee2('0x2c'))){if(_0x4775ba['originated']>0x0){_0x4775ba[_0xcee2('0x2c')]-=0x1;}else{logger[_0xcee2('0x8')](_0xcee2('0x2d'),_0x349a2f);}}}else{logger['error'](_0xcee2('0x2e'),_0x349a2f);}};exports[_0xcee2('0x2f')]=function(_0x475153){var _0x46e0cb=moment()[_0xcee2('0x11')](_0xcee2('0x30'));_0x475153['state']=0xd;_0x475153[_0xcee2('0x31')]=_0xcee2('0x32');_0x475153[_0xcee2('0x33')]=_0x46e0cb;_0x475153['responsetime']=_0x46e0cb;_0x475153[_0xcee2('0x34')]=_0x46e0cb;};exports['logAgent']=function(_0x594eab,_0x42c307,_0x20e3ed){var _0x16ae5c=moment()[_0xcee2('0x11')](_0xcee2('0x30'));_0x594eab[_0xcee2('0x35')]=_0x42c307;_0x594eab['statedesc']=_0x20e3ed;_0x594eab['responsetime']=_0x16ae5c;_0x594eab['ringtime']=getSeconds(_0x594eab[_0xcee2('0x36')],_0x594eab['starttime']);};exports[_0xcee2('0x37')]=function(_0x157220,_0x5ad17c,_0x15e2ab){_0x157220['membername']=_0x5ad17c;_0x157220['UserId']=_0x15e2ab;};exports[_0xcee2('0x38')]=function(_0x46880b,_0x5be207,_0x480e54){var _0x208139=moment()[_0xcee2('0x11')](_0xcee2('0x30'));_0x46880b[_0xcee2('0x35')]=_0x5be207;_0x46880b[_0xcee2('0x31')]=_0x480e54;_0x46880b[_0xcee2('0x36')]=_0x46880b[_0xcee2('0x36')]?_0x46880b[_0xcee2('0x36')]:_0x208139;_0x46880b[_0xcee2('0x34')]=_0x46880b['endtime']?_0x46880b[_0xcee2('0x34')]:_0x208139;_0x46880b[_0xcee2('0x39')]=getSeconds(_0x46880b[_0xcee2('0x36')]||0x0,_0x46880b[_0xcee2('0x33')]||0x0);_0x46880b['talktime']=_0x46880b[_0xcee2('0x3a')]?getSeconds(_0x46880b[_0xcee2('0x34')],_0x46880b[_0xcee2('0x3a')]):0x0;};exports[_0xcee2('0x3b')]=function(_0x8746a6){return _0x8746a6===_0xcee2('0x3c');};exports[_0xcee2('0x3d')]=function(_0x3f6705,_0x441dc2,_0x560e4f,_0x2c0009,_0x2a3d98){var _0x1a6ff7=_0x2c0009?'RECALL':_0x3f6705[_0xcee2('0x3e')];_0x1a6ff7=_0x2a3d98?_0xcee2('0x3f'):_0x1a6ff7;return{'actionid':_0x3f6705[_0xcee2('0x40')],'action':_0xcee2('0x41'),'channel':_0x3f6705[_0xcee2('0x42')],'callerid':util[_0xcee2('0x11')](_0xcee2('0x43'),_0x1a6ff7,_0x3f6705[_0xcee2('0x17')]),'Exten':_0xcee2('0x44'),'Context':_0xcee2('0x45'),'Priority':'1','variable':_0x560e4f,'timeout':(_0x441dc2[_0xcee2('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3f6705[_0xcee2('0x40')]};};exports[_0xcee2('0x47')]=function(_0xa98bc1){return _0xa98bc1['countbusyretry']+_0xa98bc1[_0xcee2('0x48')]+_0xa98bc1['countnoanswerretry']+_0xa98bc1['countagentrejectretry']+_0xa98bc1[_0xcee2('0x49')];};exports[_0xcee2('0x4a')]=function(_0x1b0fd4){var _0x1f8b75=_[_0xcee2('0x4b')](_0x1b0fd4);_0x1f8b75['state']=0xf;_0x1f8b75[_0xcee2('0x31')]='Global';return _0x1f8b75;};exports[_0xcee2('0x4c')]=function(_0x209877,_0x465e9a,_0x3dc102){var _0x3bea82={};_0x3bea82[_0x465e9a]=_0x209877[_0x465e9a];_0x3bea82[_0xcee2('0x4d')]=![];_0x3bea82[_0xcee2('0x4e')]=moment()['add'](_0x3dc102,_0xcee2('0x4f'))[_0xcee2('0x11')](_0xcee2('0x30'));_0x3bea82[_0xcee2('0x50')]=_0x209877[_0xcee2('0x50')];_0x3bea82[_0xcee2('0x51')]=_0x209877[_0xcee2('0x51')];_0x3bea82[_0xcee2('0x19')]=_0x209877[_0xcee2('0x19')]||undefined;return _0x3bea82;};exports['decrementTalkink']=function(_0x5d05c8,_0xabc3d7){if(!_[_0xcee2('0x13')](_0x5d05c8)){if(_0x5d05c8['pTalking']>0x0){_0x5d05c8[_0xcee2('0x52')]-=0x1;}else{logger[_0xcee2('0x8')](_0xabc3d7,_0xcee2('0x53'));}}else{logger[_0xcee2('0x8')](_0xabc3d7,_0xcee2('0x54'));}};exports[_0xcee2('0x55')]=function(_0x2ce4bd){if(_0x2ce4bd<=0x0){return!![];}return![];};exports['buildObj']=function(_0x5a2b58,_0x48cd5a){_0x5a2b58[_0xcee2('0x56')]=_0x48cd5a;_0x5a2b58[_0xcee2('0x16')]=_0x5a2b58[_0xcee2('0x57')];_0x5a2b58['interface']=_0x5a2b58[_0xcee2('0x42')];return _0x5a2b58;};exports[_0xcee2('0x58')]=function(_0x2f24d2){var _0x5d701b={};_0x5d701b[_0xcee2('0x57')]=_0x2f24d2[_0xcee2('0x57')];_0x5d701b[_0xcee2('0x59')]=_0x2f24d2['channelAgent'];_0x5d701b[_0xcee2('0x40')]=_0x2f24d2[_0xcee2('0x40')];return _0x5d701b;};exports[_0xcee2('0x5a')]=function(_0x1c10c0){var _0x52f582=[];for(var _0x4f5052 in _0x1c10c0){if(_0x1c10c0['hasOwnProperty'](_0x4f5052)){if(!_[_0xcee2('0x13')](_0x1c10c0[_0x4f5052])&&_0x1c10c0[_0x4f5052][_0xcee2('0x35')]===_0xcee2('0x5b')&&_0x1c10c0[_0x4f5052][_0xcee2('0x5c')]===_0xcee2('0x5d')){_0x52f582[_0xcee2('0x5e')](_0x1c10c0[_0x4f5052]['id']);}}}return _0x52f582;};exports[_0xcee2('0x5f')]=function(_0x4c9a97){var _0x3ca032=moment()[_0xcee2('0x5')](0x0);var _0x3f4a06=moment(_0x4c9a97)['milliseconds'](0x0);return _0x3ca032[_0xcee2('0x6')](_0x3f4a06,_0xcee2('0x7'));};exports[_0xcee2('0x60')]=function(_0x1bb852){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1bb852[_0xcee2('0x50')],'ListId':_0x1bb852[_0xcee2('0x51')],'VoiceQueueId':_0x1bb852[_0xcee2('0x19')]||undefined,'CampaignId':_0x1bb852[_0xcee2('0x61')]||undefined};};exports['filterKey']=function(_0x32c7ee){if(_0x32c7ee===_0xcee2('0x40')||_0x32c7ee===_0xcee2('0x62')||_0x32c7ee===_0xcee2('0x57')||_0x32c7ee===_0xcee2('0x63')||_0x32c7ee===_0xcee2('0x64')||_0x32c7ee===_0xcee2('0x65')||_0x32c7ee===_0xcee2('0x66')||_0x32c7ee===_0xcee2('0x42')||_0x32c7ee===_0xcee2('0x3e')||_0x32c7ee==='active'||_0x32c7ee==='calleridnum'||_0x32c7ee===_0xcee2('0x4e')||_0x32c7ee===_0xcee2('0x67')||_0x32c7ee===_0xcee2('0x48')||_0x32c7ee==='countnoanswerretry'||_0x32c7ee==='countglobal'||_0x32c7ee==='callback'||_0x32c7ee===_0xcee2('0x68')||_0x32c7ee==='callbackat'||_0x32c7ee==='recallme'||_0x32c7ee===_0xcee2('0x50')||_0x32c7ee==='ListId'||_0x32c7ee===_0xcee2('0x69')||_0x32c7ee===_0xcee2('0x19')||_0x32c7ee==='sipcallid'||_0x32c7ee===_0xcee2('0x6a')||_0x32c7ee===_0xcee2('0x6b')||_0x32c7ee==='xmd-phone'||_0x32c7ee==='xmd-listid'||_0x32c7ee===_0xcee2('0x6c')||_0x32c7ee===_0xcee2('0x6d')||_0x32c7ee===_0xcee2('0x6e')||_0x32c7ee===_0xcee2('0x6f')||_0x32c7ee===_0xcee2('0x70')||_0x32c7ee==='xmd-contactid'||_0x32c7ee===_0xcee2('0x71')||_0x32c7ee===_0xcee2('0x72')||_0x32c7ee===_0xcee2('0x73')||_0x32c7ee===_0xcee2('0x74')||_0x32c7ee===_0xcee2('0x75')||_0x32c7ee===_0xcee2('0x76')||_0x32c7ee===_0xcee2('0x77')||_0x32c7ee===_0xcee2('0x78')||_0x32c7ee===_0xcee2('0x79')||_0x32c7ee===_0xcee2('0x7a')||_0x32c7ee===_0xcee2('0x7b')||_0x32c7ee===_0xcee2('0x7c')||_0x32c7ee==='rtpaudioqos'||_0x32c7ee===_0xcee2('0x76')||_0x32c7ee===_0xcee2('0x77')||_0x32c7ee===_0xcee2('0x78')||_0x32c7ee==='rtpaudioqosloss'||_0x32c7ee==='rtpaudioqoslossbridged'||_0x32c7ee===_0xcee2('0x7b')||_0x32c7ee===_0xcee2('0x7c')||_0x32c7ee===_0xcee2('0x7d')||_0x32c7ee===_0xcee2('0x7e')||_0x32c7ee==='state'||_0x32c7ee==='statedesc'){return![];}return!![];};exports[_0xcee2('0x7f')]=function(_0x458d75,_0x81f30a){var _0x3bdd96,_0xe75e6e,_0x5f5dc5;if(_0x81f30a<=0x0){_0x81f30a=0x1;}_0x3bdd96=new RegExp('\x5cw{0,'+_0x81f30a+'}$');_0xe75e6e=Math[_0xcee2('0x80')](0xa,_0x81f30a-0x1);_0x5f5dc5=Math[_0xcee2('0x80')](0xa,_0x81f30a)-0x1;return util[_0xcee2('0x11')]('%s',_[_0xcee2('0x81')](_0x458d75,_0x3bdd96,_[_0xcee2('0x82')](_0xe75e6e,_0x5f5dc5)));};exports['extractCalleridName']=function(_0x3796cf){var _0x546ad3=_0x3796cf[_0xcee2('0x83')](/"(.*?)"/);return _0x546ad3?_0x546ad3[0x1]:_0x3796cf;};exports[_0xcee2('0x84')]=function(_0x2c9497){var _0x3f11e2=_0x2c9497['match'](/<(.*?)>/);return _0x3f11e2?_0x3f11e2[0x1]:_0x2c9497;};
\ No newline at end of file
index f343fe7..bb45dc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['voicequeuechannelhangup','queueadd','string','number','queueremove','queuepause','boolean','reload','voicechannel'];(function(_0x32d2e3,_0x447277){var _0x5116db=function(_0x3f8f9c){while(--_0x3f8f9c){_0x32d2e3['push'](_0x32d2e3['shift']());}};_0x5116db(++_0x447277);}(_0xb10b,0x12a));var _0xbb10=function(_0x20e375,_0xdc0dde){_0x20e375=_0x20e375-0x0;var _0x55ac5d=_0xb10b[_0x20e375];return _0x55ac5d;};'use strict';exports[_0xbb10('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]},'membername':{'type':_0xbb10('0x1'),'required':!![]},'penalty':{'type':_0xbb10('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbb10('0x3')]={'queue':{'type':_0xbb10('0x1'),'required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x4')]={'interface':{'type':_0xbb10('0x1'),'required':!![]},'paused':{'type':_0xbb10('0x5')},'reason':{'type':'string','required':![]}};exports[_0xbb10('0x6')]={'module':{'type':_0xbb10('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x7')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]},'filename':{'type':_0xbb10('0x1')},'format':{'type':_0xbb10('0x1')},'mixmonitorid':{'type':_0xbb10('0x1')}};exports[_0xbb10('0x8')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xbb10('0x1'),'required':!![]},'context':{'type':_0xbb10('0x1')}};
\ No newline at end of file
+var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x288bc5,_0x20dc74){var _0x4c04df=function(_0xe6ec74){while(--_0xe6ec74){_0x288bc5['push'](_0x288bc5['shift']());}};_0x4c04df(++_0x20dc74);}(_0x5f2f,0x73));var _0xf5f2=function(_0x286684,_0x59947e){_0x286684=_0x286684-0x0;var _0x5c2558=_0x5f2f[_0x286684];return _0x5c2558;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}};
\ No newline at end of file
index 7e3b3fd..8056510 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf6=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','mergeFromDatabase','prototype','length','isUndefined','initTelephones','initTrunks','initTriggers','initTemplates','initSalesforceAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','outbound','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xbaf6,0xd0));var _0x6baf=function(_0x1846e2,_0xe66a3a){_0x1846e2=_0x1846e2-0x0;var _0x626282=_0xbaf6[_0x1846e2];return _0x626282;};'use strict';var BPromise=require(_0x6baf('0x0'));var util=require(_0x6baf('0x1'));var _=require(_0x6baf('0x2'));var moment=require(_0x6baf('0x3'));var Agent=require(_0x6baf('0x4'));var Telephone=require(_0x6baf('0x5'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x6baf('0x6'));var Trigger=require(_0x6baf('0x7'));var Template=require(_0x6baf('0x8'));var Campaign=require(_0x6baf('0x9'));var VoiceExtension=require(_0x6baf('0xa'));var ZendeskAccount=require(_0x6baf('0xb'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x6baf('0xc'));var SugarcrmAccount=require(_0x6baf('0xd'));var ZohoAccount=require(_0x6baf('0xe'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x6baf('0xf'));var ServicenowAccount=require(_0x6baf('0x10'));var Dynamics365Account=require(_0x6baf('0x11'));var FreshsalesAccount=require(_0x6baf('0x12'));var FaxAccount=require(_0x6baf('0x13'));var Realtime=function(){this[_0x6baf('0x14')]={};this[_0x6baf('0x15')]={};this[_0x6baf('0x16')]={};this[_0x6baf('0x17')]={};this[_0x6baf('0x18')]={};this[_0x6baf('0x19')]={};this[_0x6baf('0x1a')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x6baf('0x1b')]={};this['channels']={};this['queueChannels']={};this[_0x6baf('0x1c')]={};this[_0x6baf('0x1d')]={};this[_0x6baf('0x1e')]={};this[_0x6baf('0x1f')]={};this[_0x6baf('0x20')]={};this[_0x6baf('0x21')]={};this[_0x6baf('0x22')]={};this['deskAccounts']={};this[_0x6baf('0x23')]={};this[_0x6baf('0x24')]={};this[_0x6baf('0x25')]={};this[_0x6baf('0x26')]={};this[_0x6baf('0x27')]={};};function freeIsNotKey(_0x523dbc,_0x33eba6,_0x4442f1){var _0x189184=_[_0x6baf('0x28')](_0x523dbc,function(_0x412bab,_0xddd21f){return _0x412bab[_0x4442f1];});for(var _0x3fd87d in _0x33eba6){if(_0x33eba6['hasOwnProperty'](_0x3fd87d)){if(!_0x189184[_0x3fd87d]){delete _0x33eba6[_0x3fd87d];}}}}function freeIsNotKeySip(_0x352b7a,_0x526d1d){var _0x9ec939=_[_0x6baf('0x28')](_0x352b7a,function(_0x845c8c,_0x458b40){return util[_0x6baf('0x29')](_0x6baf('0x2a'),_0x845c8c[_0x6baf('0x2b')]);});for(var _0x4ec0bf in _0x526d1d){if(_0x526d1d[_0x6baf('0x2c')](_0x4ec0bf)){if(!_0x9ec939[_0x4ec0bf]){delete _0x526d1d[_0x4ec0bf];}}}}function freeIsNotKeyAgent(_0x45f4c5,_0x38d63c){var _0x21d5c9=_[_0x6baf('0x28')](_0x45f4c5,function(_0x457196,_0x170b6e){var _0x5006c8=_[_0x6baf('0x2d')](_0x457196[_0x6baf('0x2e')])?util[_0x6baf('0x29')](_0x6baf('0x2a'),_0x457196[_0x6baf('0x2b')]):_0x457196['interface'];return _0x5006c8;});for(var _0x10bda2 in _0x38d63c){if(_0x38d63c['hasOwnProperty'](_0x10bda2)){if(!_0x21d5c9[_0x10bda2]){delete _0x38d63c[_0x10bda2];}}}}function clearVoiceCallReports(_0x380e2b){_0x380e2b[_0x6baf('0x2f')]=0x0;_0x380e2b['answered']=0x0;_0x380e2b[_0x6baf('0x30')]=0x0;_0x380e2b[_0x6baf('0x31')]=0x0;_0x380e2b[_0x6baf('0x32')]=0x0;}function clearCampaigns(_0x586003){if(!_[_0x6baf('0x33')](_0x586003)){for(var _0x48347c in _0x586003){if(_0x586003['hasOwnProperty'](_0x48347c)){_0x586003[_0x48347c][_0x6baf('0x34')]=0x0;_0x586003[_0x48347c][_0x6baf('0x35')]=0x0;}}}}function clearVoiceQueues(_0x180721){if(!_[_0x6baf('0x33')](_0x180721)){for(var _0x6c5f29 in _0x180721){if(_0x180721[_0x6baf('0x2c')](_0x6c5f29)){_0x180721[_0x6c5f29][_0x6baf('0x2f')]=0x0;_0x180721[_0x6c5f29][_0x6baf('0x36')]=0x0;_0x180721[_0x6c5f29]['unmanaged']=0x0;_0x180721[_0x6c5f29]['abandoned']=0x0;_0x180721[_0x6c5f29][_0x6baf('0x30')]=0x0;_0x180721[_0x6c5f29][_0x6baf('0x31')]=0x0;_0x180721[_0x6c5f29][_0x6baf('0x32')]=0x0;_0x180721[_0x6c5f29][_0x6baf('0x37')]=0x0;_0x180721[_0x6c5f29][_0x6baf('0x38')]=0x0;_0x180721[_0x6c5f29]['outboundBusyCallsDay']=0x0;_0x180721[_0x6c5f29][_0x6baf('0x39')]=0x0;_0x180721[_0x6c5f29][_0x6baf('0x3a')]=0x0;_0x180721[_0x6c5f29]['outboundUnknownCallsDay']=0x0;_0x180721[_0x6c5f29][_0x6baf('0x3b')]=0x0;_0x180721[_0x6c5f29][_0x6baf('0x3c')]=0x0;_0x180721[_0x6c5f29]['outboundBlacklistCallsDay']=0x0;_0x180721[_0x6c5f29][_0x6baf('0x3d')]=0x0;_0x180721[_0x6c5f29][_0x6baf('0x3e')]=0x0;_0x180721[_0x6c5f29][_0x6baf('0x3f')]=0x0;_0x180721[_0x6c5f29][_0x6baf('0x37')]=0x0;_0x180721[_0x6c5f29]['outboundAnswerCallsDay']=0x0;_0x180721[_0x6c5f29]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x6baf('0x40')]=function(_0x1da9c0,_0x2dc2d1){for(var _0x27df87 in _0x2dc2d1){if(_0x1da9c0[_0x6baf('0x2c')](_0x27df87)){_0x1da9c0[_0x27df87]=_0x2dc2d1[_0x27df87];}}};Realtime[_0x6baf('0x41')]['initAgents']=function(){var _0x5ad03a=this;return function(_0x79dd1c){if(_0x79dd1c){freeIsNotKeyAgent(_0x79dd1c,_0x5ad03a[_0x6baf('0x14')]);for(var _0x57684b=0x0,_0x22997e={},_0x216cd9={};_0x57684b<_0x79dd1c[_0x6baf('0x42')];_0x57684b+=0x1){_0x22997e=_0x79dd1c[_0x57684b];var _0x24c783=_[_0x6baf('0x2d')](_0x22997e[_0x6baf('0x2e')])?util[_0x6baf('0x29')](_0x6baf('0x2a'),_0x22997e[_0x6baf('0x2b')]):_0x22997e[_0x6baf('0x2e')];if(_[_0x6baf('0x43')](_0x5ad03a[_0x6baf('0x14')][_0x24c783])){_0x5ad03a[_0x6baf('0x14')][_0x24c783]=new Agent(_0x22997e);}else{_0x5ad03a[_0x6baf('0x40')](_0x5ad03a['agents'][_0x24c783],_0x22997e);}}}return _0x5ad03a[_0x6baf('0x14')];};};Realtime[_0x6baf('0x41')][_0x6baf('0x44')]=function(){var _0x864603=this;return function(_0x5a43a1){if(_0x5a43a1){freeIsNotKeySip(_0x5a43a1,_0x864603['telephones']);for(var _0x10e507=0x0,_0x5e74a6={},_0x434d30={};_0x10e507<_0x5a43a1[_0x6baf('0x42')];_0x10e507+=0x1){_0x5e74a6=_0x5a43a1[_0x10e507];if(_[_0x6baf('0x43')](_0x864603[_0x6baf('0x15')][util[_0x6baf('0x29')]('SIP/%s',_0x5e74a6[_0x6baf('0x2b')])])){_0x864603[_0x6baf('0x15')][util[_0x6baf('0x29')](_0x6baf('0x2a'),_0x5e74a6['name'])]=new Telephone(_0x5e74a6);}else{_0x864603['mergeFromDatabase'](_0x864603[_0x6baf('0x15')][util[_0x6baf('0x29')](_0x6baf('0x2a'),_0x5e74a6[_0x6baf('0x2b')])],_0x5e74a6);}}}return _0x864603[_0x6baf('0x15')];};};Realtime[_0x6baf('0x41')][_0x6baf('0x45')]=function(){var _0x422201=this;return function(_0x47ef8d){if(_0x47ef8d){freeIsNotKeySip(_0x47ef8d,_0x422201['trunks']);for(var _0x2b8909=0x0,_0x2d2390={},_0x3565f2={};_0x2b8909<_0x47ef8d['length'];_0x2b8909+=0x1){_0x2d2390=_0x47ef8d[_0x2b8909];if(_[_0x6baf('0x43')](_0x422201[_0x6baf('0x16')][util[_0x6baf('0x29')]('SIP/%s',_0x2d2390[_0x6baf('0x2b')])])){_0x422201[_0x6baf('0x16')][util[_0x6baf('0x29')]('SIP/%s',_0x2d2390[_0x6baf('0x2b')])]=new Trunk(_0x2d2390);}else{_0x422201[_0x6baf('0x40')](_0x422201[_0x6baf('0x16')][util[_0x6baf('0x29')](_0x6baf('0x2a'),_0x2d2390['name'])],_0x2d2390);}}}return _0x422201[_0x6baf('0x16')];};};Realtime[_0x6baf('0x41')]['initVoiceQueues']=function(){var _0x629d97=this;return function(_0x48386e){if(_0x48386e){freeIsNotKey(_0x48386e,_0x629d97[_0x6baf('0x17')],_0x6baf('0x2b'));for(var _0x59f007=0x0,_0x435dd6={},_0x1ce7b3={};_0x59f007<_0x48386e['length'];_0x59f007+=0x1){_0x435dd6=_0x48386e[_0x59f007];if(_['isUndefined'](_0x629d97['voiceQueues'][_0x435dd6[_0x6baf('0x2b')]])){_0x629d97[_0x6baf('0x17')][_0x435dd6[_0x6baf('0x2b')]]=new VoiceQueue(_0x435dd6);}else{_0x629d97['mergeFromDatabase'](_0x629d97[_0x6baf('0x17')][_0x435dd6[_0x6baf('0x2b')]],_0x435dd6);}}}return _0x629d97[_0x6baf('0x17')];};};Realtime[_0x6baf('0x41')][_0x6baf('0x46')]=function(){var _0x2533e6=this;return function(_0x57c0bc){if(_0x57c0bc){freeIsNotKey(_0x57c0bc,_0x2533e6[_0x6baf('0x18')],'id');for(var _0x4f94a2=0x0,_0x4065cf={},_0x3e8bdd={};_0x4f94a2<_0x57c0bc[_0x6baf('0x42')];_0x4f94a2+=0x1){_0x4065cf=_0x57c0bc[_0x4f94a2];if(_[_0x6baf('0x43')](_0x2533e6[_0x6baf('0x18')][_0x4065cf['id']])){_0x2533e6[_0x6baf('0x18')][_0x4065cf['id']]=new Trigger(_0x4065cf);}else{_0x2533e6[_0x6baf('0x40')](_0x2533e6[_0x6baf('0x18')][_0x4065cf['id']],_0x4065cf);}}}return _0x2533e6[_0x6baf('0x18')];};};Realtime['prototype'][_0x6baf('0x47')]=function(){var _0x5e2219=this;return function(_0x57d1f7){if(_0x57d1f7){freeIsNotKey(_0x57d1f7,_0x5e2219[_0x6baf('0x1a')],'id');for(var _0x1b455d=0x0,_0x22939c={},_0x3dd8f8={};_0x1b455d<_0x57d1f7[_0x6baf('0x42')];_0x1b455d+=0x1){_0x22939c=_0x57d1f7[_0x1b455d];if(_[_0x6baf('0x43')](_0x5e2219[_0x6baf('0x1a')][_0x22939c['id']])){_0x5e2219[_0x6baf('0x1a')][_0x22939c['id']]=new Template(_0x22939c);}else{_0x5e2219['mergeFromDatabase'](_0x5e2219[_0x6baf('0x1a')][_0x22939c['id']],_0x22939c);}}}return _0x5e2219[_0x6baf('0x1a')];};};Realtime[_0x6baf('0x41')]['initZendeskAccounts']=function(){var _0x4488cf=this;return function(_0x11ac09){if(_0x11ac09){freeIsNotKey(_0x11ac09,_0x4488cf[_0x6baf('0x1e')],'id');for(var _0xf9d085=0x0,_0x4b709b={},_0x1c660f={};_0xf9d085<_0x11ac09[_0x6baf('0x42')];_0xf9d085+=0x1){_0x4b709b=_0x11ac09[_0xf9d085];if(_[_0x6baf('0x43')](_0x4488cf[_0x6baf('0x1e')][_0x4b709b['id']])){_0x4488cf[_0x6baf('0x1e')][_0x4b709b['id']]=new ZendeskAccount(_0x4b709b);}else{_0x4488cf[_0x6baf('0x40')](_0x4488cf['zendeskAccounts'][_0x4b709b['id']],_0x4b709b);}}}return _0x4488cf['zendeskAccounts'];};};Realtime[_0x6baf('0x41')][_0x6baf('0x48')]=function(){var _0x95ee8b=this;return function(_0x1066cd){if(_0x1066cd){freeIsNotKey(_0x1066cd,_0x95ee8b[_0x6baf('0x1f')],'id');for(var _0xd64152=0x0,_0x122e11={},_0x6243c4={};_0xd64152<_0x1066cd[_0x6baf('0x42')];_0xd64152+=0x1){_0x122e11=_0x1066cd[_0xd64152];if(_['isUndefined'](_0x95ee8b[_0x6baf('0x1f')][_0x122e11['id']])){_0x95ee8b[_0x6baf('0x1f')][_0x122e11['id']]=new SalesforceAccount(_0x122e11);}else{_0x95ee8b[_0x6baf('0x40')](_0x95ee8b[_0x6baf('0x1f')][_0x122e11['id']],_0x122e11);}}}return _0x95ee8b[_0x6baf('0x1f')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x1cde7b=this;return function(_0x19709d){if(_0x19709d){freeIsNotKey(_0x19709d,_0x1cde7b['freshdeskAccounts'],'id');for(var _0x327145=0x0,_0x536ef9={},_0x2c9f46={};_0x327145<_0x19709d[_0x6baf('0x42')];_0x327145+=0x1){_0x536ef9=_0x19709d[_0x327145];if(_[_0x6baf('0x43')](_0x1cde7b[_0x6baf('0x21')][_0x536ef9['id']])){_0x1cde7b[_0x6baf('0x21')][_0x536ef9['id']]=new FreshdeskAccount(_0x536ef9);}else{_0x1cde7b[_0x6baf('0x40')](_0x1cde7b[_0x6baf('0x21')][_0x536ef9['id']],_0x536ef9);}}}return _0x1cde7b[_0x6baf('0x21')];};};Realtime[_0x6baf('0x41')]['initZohoAccounts']=function(){var _0x2c3b40=this;return function(_0x125027){if(_0x125027){freeIsNotKey(_0x125027,_0x2c3b40['zohoAccounts'],'id');for(var _0x32fece=0x0,_0x18ac5d={},_0x4baa08={};_0x32fece<_0x125027['length'];_0x32fece+=0x1){_0x18ac5d=_0x125027[_0x32fece];if(_[_0x6baf('0x43')](_0x2c3b40['zohoAccounts'][_0x18ac5d['id']])){_0x2c3b40[_0x6baf('0x22')][_0x18ac5d['id']]=new ZohoAccount(_0x18ac5d);}else{_0x2c3b40['mergeFromDatabase'](_0x2c3b40[_0x6baf('0x22')][_0x18ac5d['id']],_0x18ac5d);}}}return _0x2c3b40[_0x6baf('0x22')];};};Realtime[_0x6baf('0x41')][_0x6baf('0x49')]=function(){var _0x29e1ab=this;return function(_0x1f2a7b){if(_0x1f2a7b){freeIsNotKey(_0x1f2a7b,_0x29e1ab[_0x6baf('0x4a')],'id');for(var _0x496326=0x0,_0x258741={},_0x1d35e9={};_0x496326<_0x1f2a7b[_0x6baf('0x42')];_0x496326+=0x1){_0x258741=_0x1f2a7b[_0x496326];if(_[_0x6baf('0x43')](_0x29e1ab[_0x6baf('0x4a')][_0x258741['id']])){_0x29e1ab[_0x6baf('0x4a')][_0x258741['id']]=new DeskAccount(_0x258741);}else{_0x29e1ab['mergeFromDatabase'](_0x29e1ab['deskAccounts'][_0x258741['id']],_0x258741);}}}return _0x29e1ab[_0x6baf('0x4a')];};};Realtime[_0x6baf('0x41')][_0x6baf('0x4b')]=function(){var _0x58807a=this;return function(_0x4d4245){if(_0x4d4245){freeIsNotKey(_0x4d4245,_0x58807a[_0x6baf('0x20')],'id');for(var _0x1912cb=0x0,_0x388eee={},_0x3be676={};_0x1912cb<_0x4d4245['length'];_0x1912cb+=0x1){_0x388eee=_0x4d4245[_0x1912cb];if(_[_0x6baf('0x43')](_0x58807a[_0x6baf('0x20')][_0x388eee['id']])){_0x58807a[_0x6baf('0x20')][_0x388eee['id']]=new SugarcrmAccount(_0x388eee);}else{_0x58807a[_0x6baf('0x40')](_0x58807a[_0x6baf('0x20')][_0x388eee['id']],_0x388eee);}}}return _0x58807a[_0x6baf('0x20')];};};Realtime[_0x6baf('0x41')][_0x6baf('0x4c')]=function(){var _0x1037b9=this;return function(_0x54ca10){if(_0x54ca10){freeIsNotKey(_0x54ca10,_0x1037b9[_0x6baf('0x23')],'id');for(var _0x115d69=0x0,_0x352b59={},_0x7812f5={};_0x115d69<_0x54ca10['length'];_0x115d69+=0x1){_0x352b59=_0x54ca10[_0x115d69];if(_[_0x6baf('0x43')](_0x1037b9['vtigerAccounts'][_0x352b59['id']])){_0x1037b9[_0x6baf('0x23')][_0x352b59['id']]=new VtigerAccount(_0x352b59);}else{_0x1037b9[_0x6baf('0x40')](_0x1037b9[_0x6baf('0x23')][_0x352b59['id']],_0x352b59);}}}return _0x1037b9[_0x6baf('0x23')];};};Realtime[_0x6baf('0x41')][_0x6baf('0x4d')]=function(){var _0x40148a=this;return function(_0x3268f7){if(_0x3268f7){freeIsNotKey(_0x3268f7,_0x40148a['servicenowAccounts'],'id');for(var _0x224286=0x0,_0x38ec33={},_0x3f1561={};_0x224286<_0x3268f7[_0x6baf('0x42')];_0x224286+=0x1){_0x38ec33=_0x3268f7[_0x224286];if(_[_0x6baf('0x43')](_0x40148a[_0x6baf('0x24')][_0x38ec33['id']])){_0x40148a[_0x6baf('0x24')][_0x38ec33['id']]=new ServicenowAccount(_0x38ec33);}else{_0x40148a[_0x6baf('0x40')](_0x40148a[_0x6baf('0x24')][_0x38ec33['id']],_0x38ec33);}}}return _0x40148a[_0x6baf('0x24')];};};Realtime[_0x6baf('0x41')][_0x6baf('0x4e')]=function(){var _0x511caf=this;return function(_0x2a77cc){if(_0x2a77cc){freeIsNotKey(_0x2a77cc,_0x511caf[_0x6baf('0x25')],'id');for(var _0x33396b=0x0,_0x43fb2a={},_0x66f270={};_0x33396b<_0x2a77cc[_0x6baf('0x42')];_0x33396b+=0x1){_0x43fb2a=_0x2a77cc[_0x33396b];if(_['isUndefined'](_0x511caf[_0x6baf('0x25')][_0x43fb2a['id']])){_0x511caf[_0x6baf('0x25')][_0x43fb2a['id']]=new Dynamics365Account(_0x43fb2a);}else{_0x511caf['mergeFromDatabase'](_0x511caf['dynamics365Accounts'][_0x43fb2a['id']],_0x43fb2a);}}}return _0x511caf[_0x6baf('0x25')];};};Realtime[_0x6baf('0x41')][_0x6baf('0x4f')]=function(){var _0x5d1434=this;return function(_0x4f8771){if(_0x4f8771){freeIsNotKey(_0x4f8771,_0x5d1434[_0x6baf('0x26')],'id');for(var _0x16fe2b=0x0,_0xe2ffc2={},_0xd71ce={};_0x16fe2b<_0x4f8771[_0x6baf('0x42')];_0x16fe2b+=0x1){_0xe2ffc2=_0x4f8771[_0x16fe2b];if(_[_0x6baf('0x43')](_0x5d1434[_0x6baf('0x26')][_0xe2ffc2['id']])){_0x5d1434[_0x6baf('0x26')][_0xe2ffc2['id']]=new FreshsalesAccount(_0xe2ffc2);}else{_0x5d1434[_0x6baf('0x40')](_0x5d1434[_0x6baf('0x26')][_0xe2ffc2['id']],_0xe2ffc2);}}}return _0x5d1434['freshsalesAccounts'];};};Realtime['prototype'][_0x6baf('0x50')]=function(){var _0x38f3db=this;return function(_0x5bf6aa){for(var _0x5ac04a=0x0;_0x5ac04a<_0x5bf6aa[_0x6baf('0x42')];_0x5ac04a+=0x1){_[_0x6baf('0x51')](_0x38f3db['voiceQueues'][_0x5bf6aa[_0x5ac04a][_0x6baf('0x2b')]],_0x5bf6aa[_0x5ac04a]);}return _0x38f3db['voiceQueues'];};};Realtime[_0x6baf('0x41')][_0x6baf('0x52')]=function(){var _0x514e01=this;return function(_0x5b1eb){clearVoiceQueues(_0x514e01[_0x6baf('0x17')]);if(_0x5b1eb){_0x5b1eb=_[_0x6baf('0x53')](_0x5b1eb,_0x6baf('0x54'));for(var _0x249561 in _0x5b1eb){if(_0x5b1eb[_0x6baf('0x2c')](_0x249561)){var _0x596ad2={};for(var _0x4075b9=0x0;_0x4075b9<_0x5b1eb[_0x249561][_0x6baf('0x42')];_0x4075b9+=0x1){var _0xea179d=_0x5b1eb[_0x249561][_0x4075b9][_0x6baf('0x55')];if(_0x514e01['voiceQueues'][_0xea179d]){if(_0x5b1eb[_0x249561][_0x4075b9][_0x6baf('0x56')]){_0x514e01[_0x6baf('0x17')][_0xea179d][_0x6baf('0x57')]+=0x1;}if(_0x5b1eb[_0x249561][_0x4075b9][_0x6baf('0x58')]){_0x514e01['voiceQueues'][_0xea179d]['abandoned']+=0x1;}_0x514e01[_0x6baf('0x17')][_0xea179d][_0x6baf('0x30')]+=moment(_0x5b1eb[_0x249561][_0x4075b9][_0x6baf('0x59')])[_0x6baf('0x5a')](moment(_0x5b1eb[_0x249561][_0x4075b9][_0x6baf('0x5b')]),_0x6baf('0x5c'))||0x0;if(_0x4075b9===_0x5b1eb[_0x249561][_0x6baf('0x42')]-0x1){_0x514e01['voiceQueues'][_0xea179d]['sumDuration']+=moment(_0x5b1eb[_0x249561][_0x4075b9]['queuecallercompleteAt']||_0x5b1eb[_0x249561][_0x4075b9][_0x6baf('0x5d')]||_0x5b1eb[_0x249561][_0x4075b9][_0x6baf('0x5e')])[_0x6baf('0x5a')](moment(_0x5b1eb[_0x249561][_0x4075b9][_0x6baf('0x5b')]),_0x6baf('0x5c'))||0x0;_0x514e01['voiceQueues'][_0xea179d][_0x6baf('0x2f')]+=0x1;if(_0x5b1eb[_0x249561][_0x4075b9][_0x6baf('0x5f')]){_0x514e01[_0x6baf('0x17')][_0xea179d][_0x6baf('0x36')]+=0x1;_0x514e01['voiceQueues'][_0xea179d][_0x6baf('0x32')]+=moment(_0x5b1eb[_0x249561][_0x4075b9][_0x6baf('0x60')])[_0x6baf('0x5a')](moment(_0x5b1eb[_0x249561][_0x4075b9][_0x6baf('0x59')]),_0x6baf('0x5c'))||0x0;}}else{_0x514e01[_0x6baf('0x17')][_0xea179d]['sumDuration']+=_0x514e01[_0x6baf('0x17')][_0xea179d]['sumHoldTime']||0x0;}}}}}}return _0x514e01[_0x6baf('0x17')];};};Realtime[_0x6baf('0x41')][_0x6baf('0x61')]=function(){var _0x430196=this;return function(_0x22afea){clearVoiceCallReports(_0x430196[_0x6baf('0x62')]);if(_0x22afea){for(var _0x558733=0x0;_0x558733<_0x22afea[_0x6baf('0x42')];_0x558733+=0x1){_0x430196[_0x6baf('0x62')][_0x6baf('0x2f')]+=0x1;_0x430196[_0x6baf('0x62')][_0x6baf('0x31')]+=_0x22afea[_0x558733]['duration'];if(_0x22afea[_0x558733][_0x6baf('0x63')]===_0x6baf('0x64')){_0x430196[_0x6baf('0x62')][_0x6baf('0x36')]+=0x1;_0x430196['outbound'][_0x6baf('0x30')]+=_0x22afea[_0x558733][_0x6baf('0x65')]-_0x22afea[_0x558733][_0x6baf('0x66')]||0x0;_0x430196[_0x6baf('0x62')][_0x6baf('0x32')]+=_0x22afea[_0x558733][_0x6baf('0x66')];}}}return _0x430196[_0x6baf('0x62')];};};Realtime[_0x6baf('0x41')][_0x6baf('0x67')]=function(){var _0x61d902=this;return function(_0x56955){if(_0x56955){freeIsNotKey(_0x56955,_0x61d902[_0x6baf('0x19')],_0x6baf('0x2b'));for(var _0x500a87=0x0,_0x412363={};_0x500a87<_0x56955[_0x6baf('0x42')];_0x500a87+=0x1){_0x412363=_0x56955[_0x500a87];if(_[_0x6baf('0x43')](_0x61d902[_0x6baf('0x19')][_0x412363['name']])){_0x61d902['campaigns'][_0x412363[_0x6baf('0x2b')]]=new Campaign(_0x412363);}else{_0x61d902['mergeFromDatabase'](_0x61d902[_0x6baf('0x19')][_0x412363[_0x6baf('0x2b')]],_0x412363);_0x61d902['campaigns'][_0x412363['name']][_0x6baf('0x68')]=_0x412363[_0x6baf('0x69')]?_0x412363[_0x6baf('0x69')][_0x6baf('0x2b')]:undefined;}}}return _0x61d902[_0x6baf('0x19')];};};Realtime[_0x6baf('0x41')][_0x6baf('0x6a')]=function(){var _0x5d3841=this;return function(_0x295072){if(_0x295072){freeIsNotKey(_0x295072,_0x5d3841['voiceExtensions'],'id');for(var _0x4493be=0x0,_0x436123={};_0x4493be<_0x295072[_0x6baf('0x42')];_0x4493be+=0x1){_0x436123=_0x295072[_0x4493be];if(_[_0x6baf('0x43')](_0x5d3841['voiceExtensions'][_0x436123['id']])){_0x5d3841[_0x6baf('0x1b')][_0x436123['id']]=new VoiceExtension(_0x436123);}else{_0x5d3841['mergeFromDatabase'](_0x5d3841['voiceExtensions'][_0x436123['id']],_0x436123);}}}return _0x5d3841['voiceExtensions'];};};Realtime['prototype'][_0x6baf('0x6b')]=function(){var _0x565925=this;return function(_0x3afb78){clearCampaigns(_0x565925[_0x6baf('0x19')]);for(var _0x5bcf4c=0x0;_0x5bcf4c<_0x3afb78[_0x6baf('0x42')];_0x5bcf4c+=0x1){_['merge'](_0x565925['campaigns'][_0x3afb78[_0x5bcf4c][_0x6baf('0x2b')]],_0x3afb78[_0x5bcf4c]);}return _0x565925['campaigns'];};};Realtime[_0x6baf('0x41')]['initFaxAccounts']=function(){var _0x308625=this;return function(_0x1735f3){if(_0x1735f3){freeIsNotKey(_0x1735f3,_0x308625[_0x6baf('0x27')],'id');for(var _0x278ce0=0x0,_0x25edfc={},_0x3da0be={};_0x278ce0<_0x1735f3[_0x6baf('0x42')];_0x278ce0+=0x1){_0x25edfc=_0x1735f3[_0x278ce0];if(_[_0x6baf('0x43')](_0x308625[_0x6baf('0x27')][_0x25edfc['id']])){_0x308625[_0x6baf('0x27')][_0x25edfc['id']]=new FaxAccount(_0x25edfc);}else{_0x308625['mergeFromDatabase'](_0x308625[_0x6baf('0x27')][_0x25edfc['id']],_0x25edfc);}}}return _0x308625[_0x6baf('0x27')];};};module[_0x6baf('0x6c')]=Realtime;
\ No newline at end of file
+var _0x7184=['SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','exports','bluebird','util','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','outbound','queueChannels','outboundChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','hasOwnProperty','mapKeys','format','SIP/%s','name','interface','total','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isNil','isUndefined','initTelephones','initTrunks','initVoiceQueues','triggers','initZendeskAccounts','initSalesforceAccounts','freshdeskAccounts','initSugarcrmAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','answered','queuecallerleaveAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject'];(function(_0x5bf39c,_0x518ed5){var _0x249a26=function(_0x3256e0){while(--_0x3256e0){_0x5bf39c['push'](_0x5bf39c['shift']());}};_0x249a26(++_0x518ed5);}(_0x7184,0xd5));var _0x4718=function(_0xac21df,_0x4f3ba2){_0xac21df=_0xac21df-0x0;var _0x1faa60=_0x7184[_0xac21df];return _0x1faa60;};'use strict';var BPromise=require(_0x4718('0x0'));var util=require(_0x4718('0x1'));var _=require('lodash');var moment=require(_0x4718('0x2'));var Agent=require('../model/agent');var Telephone=require(_0x4718('0x3'));var Trunk=require(_0x4718('0x4'));var VoiceQueue=require(_0x4718('0x5'));var Trigger=require(_0x4718('0x6'));var Template=require(_0x4718('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x4718('0x8'));var ZendeskAccount=require(_0x4718('0x9'));var SalesforceAccount=require(_0x4718('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x4718('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x4718('0xc'));var VtigerAccount=require(_0x4718('0xd'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x4718('0xe'));var FreshsalesAccount=require(_0x4718('0xf'));var FaxAccount=require(_0x4718('0x10'));var Realtime=function(){this[_0x4718('0x11')]={};this[_0x4718('0x12')]={};this[_0x4718('0x13')]={};this[_0x4718('0x14')]={};this['triggers']={};this[_0x4718('0x15')]={};this[_0x4718('0x16')]={};this[_0x4718('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this[_0x4718('0x18')]={};this[_0x4718('0x19')]={};this['timers']={};this[_0x4718('0x1a')]={};this[_0x4718('0x1b')]={};this[_0x4718('0x1c')]={};this['freshdeskAccounts']={};this[_0x4718('0x1d')]={};this[_0x4718('0x1e')]={};this['vtigerAccounts']={};this[_0x4718('0x1f')]={};this[_0x4718('0x20')]={};this['freshsalesAccounts']={};this[_0x4718('0x21')]={};};function freeIsNotKey(_0x47e42c,_0x3516ff,_0x3c428c){var _0x3f25d5=_['mapKeys'](_0x47e42c,function(_0x136299,_0x2aaaaf){return _0x136299[_0x3c428c];});for(var _0x23385f in _0x3516ff){if(_0x3516ff[_0x4718('0x22')](_0x23385f)){if(!_0x3f25d5[_0x23385f]){delete _0x3516ff[_0x23385f];}}}}function freeIsNotKeySip(_0x3fb91d,_0x438edb){var _0x5174ce=_[_0x4718('0x23')](_0x3fb91d,function(_0x5ef5a0,_0x1ff8d0){return util[_0x4718('0x24')](_0x4718('0x25'),_0x5ef5a0[_0x4718('0x26')]);});for(var _0x31a83e in _0x438edb){if(_0x438edb[_0x4718('0x22')](_0x31a83e)){if(!_0x5174ce[_0x31a83e]){delete _0x438edb[_0x31a83e];}}}}function freeIsNotKeyAgent(_0xe50cb7,_0x3dd129){var _0x5d641=_[_0x4718('0x23')](_0xe50cb7,function(_0x172080,_0x26ab37){var _0x2ab57f=_['isNil'](_0x172080[_0x4718('0x27')])?util['format'](_0x4718('0x25'),_0x172080[_0x4718('0x26')]):_0x172080[_0x4718('0x27')];return _0x2ab57f;});for(var _0xafb8d1 in _0x3dd129){if(_0x3dd129[_0x4718('0x22')](_0xafb8d1)){if(!_0x5d641[_0xafb8d1]){delete _0x3dd129[_0xafb8d1];}}}}function clearVoiceCallReports(_0x276992){_0x276992[_0x4718('0x28')]=0x0;_0x276992['answered']=0x0;_0x276992[_0x4718('0x29')]=0x0;_0x276992[_0x4718('0x2a')]=0x0;_0x276992[_0x4718('0x2b')]=0x0;}function clearCampaigns(_0x1f9e54){if(!_['isEmpty'](_0x1f9e54)){for(var _0x47274d in _0x1f9e54){if(_0x1f9e54[_0x4718('0x22')](_0x47274d)){_0x1f9e54[_0x47274d][_0x4718('0x2c')]=0x0;_0x1f9e54[_0x47274d]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x4770f7){if(!_[_0x4718('0x2d')](_0x4770f7)){for(var _0x1f0852 in _0x4770f7){if(_0x4770f7['hasOwnProperty'](_0x1f0852)){_0x4770f7[_0x1f0852][_0x4718('0x28')]=0x0;_0x4770f7[_0x1f0852]['answered']=0x0;_0x4770f7[_0x1f0852][_0x4718('0x2e')]=0x0;_0x4770f7[_0x1f0852]['abandoned']=0x0;_0x4770f7[_0x1f0852][_0x4718('0x29')]=0x0;_0x4770f7[_0x1f0852]['sumDuration']=0x0;_0x4770f7[_0x1f0852]['sumBillable']=0x0;_0x4770f7[_0x1f0852]['outboundAnswerAgiCallsDay']=0x0;_0x4770f7[_0x1f0852][_0x4718('0x2f')]=0x0;_0x4770f7[_0x1f0852]['outboundBusyCallsDay']=0x0;_0x4770f7[_0x1f0852][_0x4718('0x30')]=0x0;_0x4770f7[_0x1f0852]['outboundNoSuchCallsDay']=0x0;_0x4770f7[_0x1f0852][_0x4718('0x31')]=0x0;_0x4770f7[_0x1f0852][_0x4718('0x32')]=0x0;_0x4770f7[_0x1f0852][_0x4718('0x33')]=0x0;_0x4770f7[_0x1f0852]['outboundBlacklistCallsDay']=0x0;_0x4770f7[_0x1f0852][_0x4718('0x34')]=0x0;_0x4770f7[_0x1f0852][_0x4718('0x35')]=0x0;_0x4770f7[_0x1f0852][_0x4718('0x36')]=0x0;_0x4770f7[_0x1f0852][_0x4718('0x37')]=0x0;_0x4770f7[_0x1f0852][_0x4718('0x38')]=0x0;_0x4770f7[_0x1f0852][_0x4718('0x39')]=!![];}}}}Realtime[_0x4718('0x3a')][_0x4718('0x3b')]=function(_0x41fe6c,_0x435cdb){for(var _0x56e21c in _0x435cdb){if(_0x41fe6c[_0x4718('0x22')](_0x56e21c)){_0x41fe6c[_0x56e21c]=_0x435cdb[_0x56e21c];}}};Realtime[_0x4718('0x3a')]['initAgents']=function(){var _0x266f2b=this;return function(_0x1ed330){if(_0x1ed330){freeIsNotKeyAgent(_0x1ed330,_0x266f2b[_0x4718('0x11')]);for(var _0x48154a=0x0,_0x59ba42={},_0x18eda0={};_0x48154a<_0x1ed330[_0x4718('0x3c')];_0x48154a+=0x1){_0x59ba42=_0x1ed330[_0x48154a];var _0x429d3c=_[_0x4718('0x3d')](_0x59ba42[_0x4718('0x27')])?util['format']('SIP/%s',_0x59ba42[_0x4718('0x26')]):_0x59ba42[_0x4718('0x27')];if(_[_0x4718('0x3e')](_0x266f2b[_0x4718('0x11')][_0x429d3c])){_0x266f2b[_0x4718('0x11')][_0x429d3c]=new Agent(_0x59ba42);}else{_0x266f2b[_0x4718('0x3b')](_0x266f2b[_0x4718('0x11')][_0x429d3c],_0x59ba42);}}}return _0x266f2b['agents'];};};Realtime['prototype'][_0x4718('0x3f')]=function(){var _0x10209a=this;return function(_0x3b1ed2){if(_0x3b1ed2){freeIsNotKeySip(_0x3b1ed2,_0x10209a[_0x4718('0x12')]);for(var _0x54bf8a=0x0,_0x46e2fc={},_0xa73f46={};_0x54bf8a<_0x3b1ed2[_0x4718('0x3c')];_0x54bf8a+=0x1){_0x46e2fc=_0x3b1ed2[_0x54bf8a];if(_[_0x4718('0x3e')](_0x10209a[_0x4718('0x12')][util[_0x4718('0x24')](_0x4718('0x25'),_0x46e2fc[_0x4718('0x26')])])){_0x10209a[_0x4718('0x12')][util[_0x4718('0x24')](_0x4718('0x25'),_0x46e2fc[_0x4718('0x26')])]=new Telephone(_0x46e2fc);}else{_0x10209a[_0x4718('0x3b')](_0x10209a[_0x4718('0x12')][util['format']('SIP/%s',_0x46e2fc[_0x4718('0x26')])],_0x46e2fc);}}}return _0x10209a[_0x4718('0x12')];};};Realtime[_0x4718('0x3a')][_0x4718('0x40')]=function(){var _0x4b451a=this;return function(_0x3af16b){if(_0x3af16b){freeIsNotKeySip(_0x3af16b,_0x4b451a['trunks']);for(var _0xa7a414=0x0,_0x919004={},_0x167658={};_0xa7a414<_0x3af16b[_0x4718('0x3c')];_0xa7a414+=0x1){_0x919004=_0x3af16b[_0xa7a414];if(_[_0x4718('0x3e')](_0x4b451a['trunks'][util[_0x4718('0x24')](_0x4718('0x25'),_0x919004[_0x4718('0x26')])])){_0x4b451a['trunks'][util['format'](_0x4718('0x25'),_0x919004['name'])]=new Trunk(_0x919004);}else{_0x4b451a[_0x4718('0x3b')](_0x4b451a['trunks'][util[_0x4718('0x24')]('SIP/%s',_0x919004['name'])],_0x919004);}}}return _0x4b451a[_0x4718('0x13')];};};Realtime[_0x4718('0x3a')][_0x4718('0x41')]=function(){var _0x53f441=this;return function(_0x1a936e){if(_0x1a936e){freeIsNotKey(_0x1a936e,_0x53f441['voiceQueues'],_0x4718('0x26'));for(var _0x2d6125=0x0,_0x91da47={},_0xaa910={};_0x2d6125<_0x1a936e['length'];_0x2d6125+=0x1){_0x91da47=_0x1a936e[_0x2d6125];if(_[_0x4718('0x3e')](_0x53f441[_0x4718('0x14')][_0x91da47['name']])){_0x53f441[_0x4718('0x14')][_0x91da47[_0x4718('0x26')]]=new VoiceQueue(_0x91da47);}else{_0x53f441[_0x4718('0x3b')](_0x53f441[_0x4718('0x14')][_0x91da47[_0x4718('0x26')]],_0x91da47);}}}return _0x53f441['voiceQueues'];};};Realtime[_0x4718('0x3a')]['initTriggers']=function(){var _0x1bde12=this;return function(_0x222d06){if(_0x222d06){freeIsNotKey(_0x222d06,_0x1bde12[_0x4718('0x42')],'id');for(var _0x25270c=0x0,_0x572ff1={},_0xf1d54d={};_0x25270c<_0x222d06[_0x4718('0x3c')];_0x25270c+=0x1){_0x572ff1=_0x222d06[_0x25270c];if(_[_0x4718('0x3e')](_0x1bde12['triggers'][_0x572ff1['id']])){_0x1bde12[_0x4718('0x42')][_0x572ff1['id']]=new Trigger(_0x572ff1);}else{_0x1bde12[_0x4718('0x3b')](_0x1bde12[_0x4718('0x42')][_0x572ff1['id']],_0x572ff1);}}}return _0x1bde12[_0x4718('0x42')];};};Realtime[_0x4718('0x3a')]['initTemplates']=function(){var _0x28c655=this;return function(_0x213526){if(_0x213526){freeIsNotKey(_0x213526,_0x28c655[_0x4718('0x16')],'id');for(var _0x4f0b62=0x0,_0x3d5a3a={},_0x515eb0={};_0x4f0b62<_0x213526[_0x4718('0x3c')];_0x4f0b62+=0x1){_0x3d5a3a=_0x213526[_0x4f0b62];if(_[_0x4718('0x3e')](_0x28c655[_0x4718('0x16')][_0x3d5a3a['id']])){_0x28c655[_0x4718('0x16')][_0x3d5a3a['id']]=new Template(_0x3d5a3a);}else{_0x28c655[_0x4718('0x3b')](_0x28c655[_0x4718('0x16')][_0x3d5a3a['id']],_0x3d5a3a);}}}return _0x28c655[_0x4718('0x16')];};};Realtime[_0x4718('0x3a')][_0x4718('0x43')]=function(){var _0x114549=this;return function(_0x35887c){if(_0x35887c){freeIsNotKey(_0x35887c,_0x114549['zendeskAccounts'],'id');for(var _0x4106a8=0x0,_0x306e89={},_0x1d3461={};_0x4106a8<_0x35887c[_0x4718('0x3c')];_0x4106a8+=0x1){_0x306e89=_0x35887c[_0x4106a8];if(_['isUndefined'](_0x114549[_0x4718('0x1a')][_0x306e89['id']])){_0x114549['zendeskAccounts'][_0x306e89['id']]=new ZendeskAccount(_0x306e89);}else{_0x114549[_0x4718('0x3b')](_0x114549[_0x4718('0x1a')][_0x306e89['id']],_0x306e89);}}}return _0x114549[_0x4718('0x1a')];};};Realtime[_0x4718('0x3a')][_0x4718('0x44')]=function(){var _0x5b7938=this;return function(_0x5d0964){if(_0x5d0964){freeIsNotKey(_0x5d0964,_0x5b7938[_0x4718('0x1b')],'id');for(var _0x36dadf=0x0,_0x1b4dd3={},_0x2a41ad={};_0x36dadf<_0x5d0964[_0x4718('0x3c')];_0x36dadf+=0x1){_0x1b4dd3=_0x5d0964[_0x36dadf];if(_[_0x4718('0x3e')](_0x5b7938['salesforceAccounts'][_0x1b4dd3['id']])){_0x5b7938['salesforceAccounts'][_0x1b4dd3['id']]=new SalesforceAccount(_0x1b4dd3);}else{_0x5b7938[_0x4718('0x3b')](_0x5b7938[_0x4718('0x1b')][_0x1b4dd3['id']],_0x1b4dd3);}}}return _0x5b7938[_0x4718('0x1b')];};};Realtime[_0x4718('0x3a')]['initFreshdeskAccounts']=function(){var _0x58c8e0=this;return function(_0x514be2){if(_0x514be2){freeIsNotKey(_0x514be2,_0x58c8e0[_0x4718('0x45')],'id');for(var _0x5491b8=0x0,_0x5cec6f={},_0x5f0ca7={};_0x5491b8<_0x514be2[_0x4718('0x3c')];_0x5491b8+=0x1){_0x5cec6f=_0x514be2[_0x5491b8];if(_[_0x4718('0x3e')](_0x58c8e0[_0x4718('0x45')][_0x5cec6f['id']])){_0x58c8e0[_0x4718('0x45')][_0x5cec6f['id']]=new FreshdeskAccount(_0x5cec6f);}else{_0x58c8e0[_0x4718('0x3b')](_0x58c8e0['freshdeskAccounts'][_0x5cec6f['id']],_0x5cec6f);}}}return _0x58c8e0[_0x4718('0x45')];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x46c557=this;return function(_0x469953){if(_0x469953){freeIsNotKey(_0x469953,_0x46c557[_0x4718('0x1d')],'id');for(var _0x1ed0a5=0x0,_0x1e8ebc={},_0x2908fe={};_0x1ed0a5<_0x469953['length'];_0x1ed0a5+=0x1){_0x1e8ebc=_0x469953[_0x1ed0a5];if(_['isUndefined'](_0x46c557['zohoAccounts'][_0x1e8ebc['id']])){_0x46c557[_0x4718('0x1d')][_0x1e8ebc['id']]=new ZohoAccount(_0x1e8ebc);}else{_0x46c557['mergeFromDatabase'](_0x46c557['zohoAccounts'][_0x1e8ebc['id']],_0x1e8ebc);}}}return _0x46c557[_0x4718('0x1d')];};};Realtime[_0x4718('0x3a')]['initDeskAccounts']=function(){var _0x1a5153=this;return function(_0x433f99){if(_0x433f99){freeIsNotKey(_0x433f99,_0x1a5153['deskAccounts'],'id');for(var _0x27b2d3=0x0,_0x4feb0d={},_0x59cbed={};_0x27b2d3<_0x433f99[_0x4718('0x3c')];_0x27b2d3+=0x1){_0x4feb0d=_0x433f99[_0x27b2d3];if(_[_0x4718('0x3e')](_0x1a5153[_0x4718('0x1e')][_0x4feb0d['id']])){_0x1a5153[_0x4718('0x1e')][_0x4feb0d['id']]=new DeskAccount(_0x4feb0d);}else{_0x1a5153[_0x4718('0x3b')](_0x1a5153['deskAccounts'][_0x4feb0d['id']],_0x4feb0d);}}}return _0x1a5153[_0x4718('0x1e')];};};Realtime[_0x4718('0x3a')][_0x4718('0x46')]=function(){var _0x495a31=this;return function(_0x1df058){if(_0x1df058){freeIsNotKey(_0x1df058,_0x495a31[_0x4718('0x1c')],'id');for(var _0xe3c907=0x0,_0x4ee73b={},_0x2890e2={};_0xe3c907<_0x1df058[_0x4718('0x3c')];_0xe3c907+=0x1){_0x4ee73b=_0x1df058[_0xe3c907];if(_[_0x4718('0x3e')](_0x495a31[_0x4718('0x1c')][_0x4ee73b['id']])){_0x495a31[_0x4718('0x1c')][_0x4ee73b['id']]=new SugarcrmAccount(_0x4ee73b);}else{_0x495a31[_0x4718('0x3b')](_0x495a31['sugarcrmAccounts'][_0x4ee73b['id']],_0x4ee73b);}}}return _0x495a31[_0x4718('0x1c')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x1c0026=this;return function(_0x12fc56){if(_0x12fc56){freeIsNotKey(_0x12fc56,_0x1c0026[_0x4718('0x47')],'id');for(var _0x57343a=0x0,_0x4563a2={},_0x1d1e37={};_0x57343a<_0x12fc56[_0x4718('0x3c')];_0x57343a+=0x1){_0x4563a2=_0x12fc56[_0x57343a];if(_[_0x4718('0x3e')](_0x1c0026['vtigerAccounts'][_0x4563a2['id']])){_0x1c0026[_0x4718('0x47')][_0x4563a2['id']]=new VtigerAccount(_0x4563a2);}else{_0x1c0026[_0x4718('0x3b')](_0x1c0026[_0x4718('0x47')][_0x4563a2['id']],_0x4563a2);}}}return _0x1c0026[_0x4718('0x47')];};};Realtime['prototype'][_0x4718('0x48')]=function(){var _0x514f6b=this;return function(_0x375871){if(_0x375871){freeIsNotKey(_0x375871,_0x514f6b['servicenowAccounts'],'id');for(var _0x5982c0=0x0,_0x17e04b={},_0x37c14d={};_0x5982c0<_0x375871[_0x4718('0x3c')];_0x5982c0+=0x1){_0x17e04b=_0x375871[_0x5982c0];if(_[_0x4718('0x3e')](_0x514f6b[_0x4718('0x1f')][_0x17e04b['id']])){_0x514f6b[_0x4718('0x1f')][_0x17e04b['id']]=new ServicenowAccount(_0x17e04b);}else{_0x514f6b[_0x4718('0x3b')](_0x514f6b[_0x4718('0x1f')][_0x17e04b['id']],_0x17e04b);}}}return _0x514f6b[_0x4718('0x1f')];};};Realtime[_0x4718('0x3a')][_0x4718('0x49')]=function(){var _0x1247d0=this;return function(_0x1bb935){if(_0x1bb935){freeIsNotKey(_0x1bb935,_0x1247d0['dynamics365Accounts'],'id');for(var _0x48c194=0x0,_0x235b42={},_0xc17e1={};_0x48c194<_0x1bb935['length'];_0x48c194+=0x1){_0x235b42=_0x1bb935[_0x48c194];if(_[_0x4718('0x3e')](_0x1247d0[_0x4718('0x20')][_0x235b42['id']])){_0x1247d0[_0x4718('0x20')][_0x235b42['id']]=new Dynamics365Account(_0x235b42);}else{_0x1247d0['mergeFromDatabase'](_0x1247d0['dynamics365Accounts'][_0x235b42['id']],_0x235b42);}}}return _0x1247d0[_0x4718('0x20')];};};Realtime[_0x4718('0x3a')][_0x4718('0x4a')]=function(){var _0x3ee3d9=this;return function(_0x54b142){if(_0x54b142){freeIsNotKey(_0x54b142,_0x3ee3d9['freshsalesAccounts'],'id');for(var _0x25cb2a=0x0,_0x4ccf51={},_0x36fc58={};_0x25cb2a<_0x54b142[_0x4718('0x3c')];_0x25cb2a+=0x1){_0x4ccf51=_0x54b142[_0x25cb2a];if(_[_0x4718('0x3e')](_0x3ee3d9['freshsalesAccounts'][_0x4ccf51['id']])){_0x3ee3d9[_0x4718('0x4b')][_0x4ccf51['id']]=new FreshsalesAccount(_0x4ccf51);}else{_0x3ee3d9[_0x4718('0x3b')](_0x3ee3d9['freshsalesAccounts'][_0x4ccf51['id']],_0x4ccf51);}}}return _0x3ee3d9[_0x4718('0x4b')];};};Realtime[_0x4718('0x3a')]['initVoiceQueueHopperHistory']=function(){var _0x56d583=this;return function(_0x2efa51){for(var _0x50a7a5=0x0;_0x50a7a5<_0x2efa51[_0x4718('0x3c')];_0x50a7a5+=0x1){_['merge'](_0x56d583['voiceQueues'][_0x2efa51[_0x50a7a5][_0x4718('0x26')]],_0x2efa51[_0x50a7a5]);}return _0x56d583['voiceQueues'];};};Realtime[_0x4718('0x3a')][_0x4718('0x4c')]=function(){var _0x31d63f=this;return function(_0x33ecde){clearVoiceQueues(_0x31d63f[_0x4718('0x14')]);if(_0x33ecde){_0x33ecde=_[_0x4718('0x4d')](_0x33ecde,_0x4718('0x4e'));for(var _0x6d7b9d in _0x33ecde){if(_0x33ecde[_0x4718('0x22')](_0x6d7b9d)){var _0x261b96={};for(var _0x1b683b=0x0;_0x1b683b<_0x33ecde[_0x6d7b9d][_0x4718('0x3c')];_0x1b683b+=0x1){var _0x26ab9f=_0x33ecde[_0x6d7b9d][_0x1b683b][_0x4718('0x4f')];if(_0x31d63f['voiceQueues'][_0x26ab9f]){if(_0x33ecde[_0x6d7b9d][_0x1b683b][_0x4718('0x50')]){_0x31d63f[_0x4718('0x14')][_0x26ab9f][_0x4718('0x2e')]+=0x1;}if(_0x33ecde[_0x6d7b9d][_0x1b683b][_0x4718('0x51')]){_0x31d63f[_0x4718('0x14')][_0x26ab9f][_0x4718('0x52')]+=0x1;}_0x31d63f['voiceQueues'][_0x26ab9f]['sumHoldTime']+=moment(_0x33ecde[_0x6d7b9d][_0x1b683b]['queuecallerleaveAt'])[_0x4718('0x53')](moment(_0x33ecde[_0x6d7b9d][_0x1b683b][_0x4718('0x54')]),_0x4718('0x55'))||0x0;if(_0x1b683b===_0x33ecde[_0x6d7b9d][_0x4718('0x3c')]-0x1){_0x31d63f[_0x4718('0x14')][_0x26ab9f]['sumDuration']+=moment(_0x33ecde[_0x6d7b9d][_0x1b683b][_0x4718('0x56')]||_0x33ecde[_0x6d7b9d][_0x1b683b][_0x4718('0x57')]||_0x33ecde[_0x6d7b9d][_0x1b683b][_0x4718('0x58')])[_0x4718('0x53')](moment(_0x33ecde[_0x6d7b9d][_0x1b683b]['queuecallerjoinAt']),_0x4718('0x55'))||0x0;_0x31d63f[_0x4718('0x14')][_0x26ab9f][_0x4718('0x28')]+=0x1;if(_0x33ecde[_0x6d7b9d][_0x1b683b][_0x4718('0x59')]){_0x31d63f[_0x4718('0x14')][_0x26ab9f][_0x4718('0x5a')]+=0x1;_0x31d63f[_0x4718('0x14')][_0x26ab9f]['sumBillable']+=moment(_0x33ecde[_0x6d7b9d][_0x1b683b][_0x4718('0x56')])[_0x4718('0x53')](moment(_0x33ecde[_0x6d7b9d][_0x1b683b][_0x4718('0x5b')]),_0x4718('0x55'))||0x0;}}else{_0x31d63f[_0x4718('0x14')][_0x26ab9f][_0x4718('0x2a')]+=_0x31d63f[_0x4718('0x14')][_0x26ab9f][_0x4718('0x29')]||0x0;}}}}}}return _0x31d63f[_0x4718('0x14')];};};Realtime['prototype'][_0x4718('0x5c')]=function(){var _0x10821=this;return function(_0x326f77){clearVoiceCallReports(_0x10821[_0x4718('0x17')]);if(_0x326f77){for(var _0x8f6e9=0x0;_0x8f6e9<_0x326f77[_0x4718('0x3c')];_0x8f6e9+=0x1){_0x10821[_0x4718('0x17')][_0x4718('0x28')]+=0x1;_0x10821[_0x4718('0x17')]['sumDuration']+=_0x326f77[_0x8f6e9][_0x4718('0x5d')];if(_0x326f77[_0x8f6e9][_0x4718('0x5e')]===_0x4718('0x5f')){_0x10821[_0x4718('0x17')][_0x4718('0x5a')]+=0x1;_0x10821[_0x4718('0x17')]['sumHoldTime']+=_0x326f77[_0x8f6e9]['duration']-_0x326f77[_0x8f6e9]['billableseconds']||0x0;_0x10821['outbound'][_0x4718('0x2b')]+=_0x326f77[_0x8f6e9][_0x4718('0x60')];}}}return _0x10821['outbound'];};};Realtime[_0x4718('0x3a')][_0x4718('0x61')]=function(){var _0x3bf25e=this;return function(_0x4ef21f){if(_0x4ef21f){freeIsNotKey(_0x4ef21f,_0x3bf25e[_0x4718('0x15')],_0x4718('0x26'));for(var _0xcf6595=0x0,_0x1baef8={};_0xcf6595<_0x4ef21f[_0x4718('0x3c')];_0xcf6595+=0x1){_0x1baef8=_0x4ef21f[_0xcf6595];if(_[_0x4718('0x3e')](_0x3bf25e[_0x4718('0x15')][_0x1baef8[_0x4718('0x26')]])){_0x3bf25e[_0x4718('0x15')][_0x1baef8['name']]=new Campaign(_0x1baef8);}else{_0x3bf25e['mergeFromDatabase'](_0x3bf25e[_0x4718('0x15')][_0x1baef8[_0x4718('0x26')]],_0x1baef8);_0x3bf25e[_0x4718('0x15')][_0x1baef8[_0x4718('0x26')]][_0x4718('0x62')]=_0x1baef8[_0x4718('0x63')]?_0x1baef8[_0x4718('0x63')][_0x4718('0x26')]:undefined;}}}return _0x3bf25e[_0x4718('0x15')];};};Realtime[_0x4718('0x3a')][_0x4718('0x64')]=function(){var _0x2ac6de=this;return function(_0x26335e){if(_0x26335e){freeIsNotKey(_0x26335e,_0x2ac6de[_0x4718('0x65')],'id');for(var _0x1e431f=0x0,_0x463bae={};_0x1e431f<_0x26335e[_0x4718('0x3c')];_0x1e431f+=0x1){_0x463bae=_0x26335e[_0x1e431f];if(_['isUndefined'](_0x2ac6de[_0x4718('0x65')][_0x463bae['id']])){_0x2ac6de[_0x4718('0x65')][_0x463bae['id']]=new VoiceExtension(_0x463bae);}else{_0x2ac6de[_0x4718('0x3b')](_0x2ac6de[_0x4718('0x65')][_0x463bae['id']],_0x463bae);}}}return _0x2ac6de[_0x4718('0x65')];};};Realtime['prototype'][_0x4718('0x66')]=function(){var _0x52176c=this;return function(_0x48444f){clearCampaigns(_0x52176c[_0x4718('0x15')]);for(var _0x388310=0x0;_0x388310<_0x48444f['length'];_0x388310+=0x1){_['merge'](_0x52176c[_0x4718('0x15')][_0x48444f[_0x388310]['name']],_0x48444f[_0x388310]);}return _0x52176c[_0x4718('0x15')];};};Realtime[_0x4718('0x3a')]['initFaxAccounts']=function(){var _0x22e133=this;return function(_0x1bf889){if(_0x1bf889){freeIsNotKey(_0x1bf889,_0x22e133[_0x4718('0x21')],'id');for(var _0x2b7429=0x0,_0x27a6a2={},_0x2774fb={};_0x2b7429<_0x1bf889[_0x4718('0x3c')];_0x2b7429+=0x1){_0x27a6a2=_0x1bf889[_0x2b7429];if(_[_0x4718('0x3e')](_0x22e133[_0x4718('0x21')][_0x27a6a2['id']])){_0x22e133[_0x4718('0x21')][_0x27a6a2['id']]=new FaxAccount(_0x27a6a2);}else{_0x22e133[_0x4718('0x3b')](_0x22e133[_0x4718('0x21')][_0x27a6a2['id']],_0x27a6a2);}}}return _0x22e133[_0x4718('0x21')];};};module[_0x4718('0x67')]=Realtime;
\ No newline at end of file
index caea519..5c0742c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dcd=['connectedlinename','membername','voiceAgentReport','forEach','startsWith','Local','indexOf','mobile','phone','lastIndexOf','exports','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','./voiceCallReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','format','voiceQueueReport','connectedlinenum','assigned','lastAssignedTo','SIP/%s','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','destination','exten','type','dialer','lastapplication','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','monitor','monitors','length','monitorFilename','filename','createdAt'];(function(_0x2f236e,_0x3f463d){var _0x580a2b=function(_0x1cdb8b){while(--_0x1cdb8b){_0x2f236e['push'](_0x2f236e['shift']());}};_0x580a2b(++_0x3f463d);}(_0x7dcd,0x153));var _0xd7dc=function(_0x26cd05,_0x1f7d74){_0x26cd05=_0x26cd05-0x0;var _0x3e13b9=_0x7dcd[_0x26cd05];return _0x3e13b9;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require(_0xd7dc('0x0'));var util=require(_0xd7dc('0x1'));var config=require(_0xd7dc('0x2'));var logger=require(_0xd7dc('0x3'))(_0xd7dc('0x4'));var ami=require(_0xd7dc('0x5'));var RpcVoiceAgentReport=require(_0xd7dc('0x6'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xd7dc('0x7'));var RpcMemberReport=require(_0xd7dc('0x8'));var RpcVoiceQueueReport=require(_0xd7dc('0x9'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xd7dc('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xd7dc('0xb'));function Report(_0x945434){this['realtime']=_0x945434;this[_0xd7dc('0xc')]=_0x945434['agents'];this[_0xd7dc('0xd')]=_0x945434[_0xd7dc('0xd')];}Report[_0xd7dc('0xe')][_0xd7dc('0xf')]=function(_0x866a78){var _0x4b2d27=new VoiceQueueReport(this[_0xd7dc('0x10')]);var _0x59a617=new VoiceAgentReport(this[_0xd7dc('0x10')]);var _0x524974=new VoiceDialReport(this['realtime']);var _0x1de593=new VoiceCallReport(this[_0xd7dc('0x10')]);var _0xa44f3a=new UserReport(this[_0xd7dc('0x10')]);if(config[_0xd7dc('0x11')]&&config[_0xd7dc('0x11')][_0xd7dc('0x12')]){ami['on'](_0xd7dc('0x13'),this['voiceQueueReport'][_0xd7dc('0x14')](this));ami['on'](_0xd7dc('0x15'),this['voiceCallReport']['bind'](this));ami['on'](_0xd7dc('0x16'),this['voiceAgentReport'][_0xd7dc('0x14')](this));ami['on'](_0xd7dc('0x17'),this[_0xd7dc('0x18')][_0xd7dc('0x14')](this));ami['on'](_0xd7dc('0x19'),this[_0xd7dc('0x1a')]['bind'](this));ami['on'](_0xd7dc('0x1b'),this[_0xd7dc('0x1c')][_0xd7dc('0x14')](this));}};Report[_0xd7dc('0xe')][_0xd7dc('0x1d')]=function(_0x1e07c6){var _0x3d881f=undefined;_0x3d881f=_[_0xd7dc('0x1e')](this['agents'],function(_0x1470b1){return _0x1470b1[_0xd7dc('0x1f')]==_0x1e07c6||_0x1470b1[_0xd7dc('0x20')]==_0x1e07c6;});if(_[_0xd7dc('0x21')](_0x3d881f)){var _0x3a3d58=_[_0xd7dc('0x1e')](this[_0xd7dc('0xd')],function(_0x13c1c0){return _0x13c1c0[_0xd7dc('0x1f')]==_0x1e07c6||_0x13c1c0[_0xd7dc('0x20')]==_0x1e07c6;});if(_0x3a3d58){_0x3d881f=_[_0xd7dc('0x1e')](this[_0xd7dc('0xc')],function(_0x468318){return _0x468318[_0xd7dc('0x22')]==util[_0xd7dc('0x23')]('SIP/%s',_0x3a3d58[_0xd7dc('0x20')]);});}}return _0x3d881f;};Report['prototype'][_0xd7dc('0x24')]=function(_0x3e680d){for(var _0x2c76f5=0x0;_0x2c76f5<_0x3e680d['length'];_0x2c76f5+=0x1){var _0x390127=this[_0xd7dc('0x1d')](_0x3e680d[_0x2c76f5][_0xd7dc('0x25')]);if(_0x390127){_0x3e680d[_0x2c76f5]['accountcode']=_0x390127[_0xd7dc('0x1f')];_0x3e680d[_0x2c76f5][_0xd7dc('0x26')]=!![];_0x3e680d[_0x2c76f5][_0xd7dc('0x27')]=_0x390127[_0xd7dc('0x20')];_0x3e680d[_0x2c76f5][_0xd7dc('0x22')]=_[_0xd7dc('0x21')](_0x390127[_0xd7dc('0x22')])?util[_0xd7dc('0x23')](_0xd7dc('0x28'),_0x390127[_0xd7dc('0x20')]):_0x390127[_0xd7dc('0x22')];if(_0x3e680d[_0x2c76f5]['queuecallercomplete']){_0x3e680d[_0x2c76f5]['queuecallercompleteAt']=moment()[_0xd7dc('0x23')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3e680d[_0x2c76f5][_0xd7dc('0x29')]){_0x3e680d[_0x2c76f5][_0xd7dc('0x2a')]=moment()['format'](_0xd7dc('0x2b'));}RpcMemberReport['voiceQueueReport'](_0x3e680d[_0x2c76f5]);}RpcVoiceQueueReport[_0xd7dc('0x2c')](_0x3e680d[_0x2c76f5]);}};function extractCalleridNumber(_0x7f6c58){var _0x1d45db=_0x7f6c58[_0xd7dc('0x2d')](/<(.*?)>/);return _0x1d45db?_0x1d45db[0x1]:_0x7f6c58;}Report[_0xd7dc('0xe')]['voiceCallReport']=function(_0x34f1fb){_0x34f1fb[_0xd7dc('0x2e')]=_0x34f1fb['destination']||_0x34f1fb[_0xd7dc('0x2f')];if(_0x34f1fb[_0xd7dc('0x30')]==_0xd7dc('0x31')){_0x34f1fb[_0xd7dc('0x32')]=_0xd7dc('0x33');_0x34f1fb[_0xd7dc('0x34')]=_0x34f1fb[_0xd7dc('0x33')];if(_0x34f1fb[_0xd7dc('0x35')]=='from-voip-provider'){_0x34f1fb['accountcode']='';_0x34f1fb[_0xd7dc('0x2e')]=extractCalleridNumber(_0x34f1fb[_0xd7dc('0x36')]);}else if(_0x34f1fb[_0xd7dc('0x35')]==_0xd7dc('0x37')){if(_0x34f1fb[_0xd7dc('0x2e')]==_0xd7dc('0x38')){_0x34f1fb[_0xd7dc('0x2e')]=extractCalleridNumber(_0x34f1fb[_0xd7dc('0x39')]);_0x34f1fb[_0xd7dc('0x3a')]=_0x34f1fb[_0xd7dc('0x3b')];_0x34f1fb['destinationchannel']=[_0x34f1fb[_0xd7dc('0x3c')],_0x34f1fb[_0xd7dc('0x3c')]=_0x34f1fb[_0xd7dc('0x3d')]][0x0];_0x34f1fb['callerid']=_0x34f1fb[_0xd7dc('0x39')];}else{_0x34f1fb['destination']=_0x34f1fb[_0xd7dc('0x3a')];_0x34f1fb[_0xd7dc('0x3a')]=_0x34f1fb[_0xd7dc('0x3b')];if(_0x34f1fb[_0xd7dc('0x3e')]==_0xd7dc('0x3f')){_0x34f1fb[_0xd7dc('0x1f')]=_0x34f1fb[_0xd7dc('0x25')];}else{_0x34f1fb[_0xd7dc('0x1f')]='';}}}}else{_0x34f1fb[_0xd7dc('0x36')]=util[_0xd7dc('0x23')](_0xd7dc('0x40'),_0x34f1fb['calleridname'],_0x34f1fb['calleridnum']);}RpcVoiceCallReport[_0xd7dc('0x2c')](_0x34f1fb);if(_0x34f1fb[_0xd7dc('0x41')]){for(var _0x1c18b3=0x0;_0x1c18b3<_0x34f1fb[_0xd7dc('0x42')][_0xd7dc('0x43')];_0x1c18b3+=0x1){_0x34f1fb[_0xd7dc('0x44')]=_0x34f1fb[_0xd7dc('0x42')][_0x1c18b3][_0xd7dc('0x45')];_0x34f1fb['createdAt']=_0x34f1fb['monitors'][_0x1c18b3][_0xd7dc('0x46')];if(_0x34f1fb[_0xd7dc('0x2f')]==_0xd7dc('0x38')){_0x34f1fb['calleridnum']=_0x34f1fb['connectedlinenum'];_0x34f1fb['calleridname']=_0x34f1fb[_0xd7dc('0x47')];_0x34f1fb[_0xd7dc('0x25')]=_0x34f1fb['accountcode'];_0x34f1fb['connectedlinename']=_0x34f1fb[_0xd7dc('0x48')];_0x34f1fb['exten']=_0x34f1fb['originatecalleridnum'];}else if(_0x34f1fb['exten']=='xcally-motion-dialer'){_0x34f1fb[_0xd7dc('0x3a')]=_0x34f1fb['destination'];_0x34f1fb[_0xd7dc('0x2f')]=_0x34f1fb[_0xd7dc('0x3b')];}RpcVoiceRecording[_0xd7dc('0x2c')](_0x34f1fb);}}};Report[_0xd7dc('0xe')][_0xd7dc('0x49')]=function(_0x120bf1){if(_['isArray'](_0x120bf1)){_0x120bf1[_0xd7dc('0x4a')](function(_0x4b76bf){RpcVoiceAgentReport[_0xd7dc('0x2c')](_0x4b76bf);});}else{RpcVoiceAgentReport[_0xd7dc('0x2c')](_0x120bf1);}};Report[_0xd7dc('0xe')][_0xd7dc('0x18')]=function(_0x3f3097){RpcVoiceDialReport[_0xd7dc('0x2c')](_0x3f3097);var _0x55d332=undefined;var _0x47a92b=_0x3f3097[_0xd7dc('0x3c')];if(_[_0xd7dc('0x4b')](_0x47a92b,_0xd7dc('0x4c'))){var _0x3bd032=_0x47a92b['substring'](_0x47a92b[_0xd7dc('0x4d')]('/')+0x1,_0x47a92b[_0xd7dc('0x4d')]('@'));_0x55d332=_[_0xd7dc('0x1e')](this['agents'],function(_0x323592){return _0x323592[_0xd7dc('0x4e')]==_0x3bd032||_0x323592[_0xd7dc('0x4f')]==_0x3bd032||_0x323592['accountcode']==_0x3bd032;});}else{var _0x3bd032=_0x47a92b['substring'](_0x47a92b['indexOf']('/')+0x1,_0x47a92b[_0xd7dc('0x50')]('-'));_0x55d332=this[_0xd7dc('0x1d')](_0x3bd032);}if(_0x55d332){_0x3f3097['interface']=_[_0xd7dc('0x21')](_0x55d332['interface'])?util[_0xd7dc('0x23')]('SIP/%s',_0x55d332[_0xd7dc('0x20')]):_0x55d332[_0xd7dc('0x22')];_0x3f3097[_0xd7dc('0x48')]=_0x55d332[_0xd7dc('0x20')];_0x3f3097[_0xd7dc('0x1f')]=_0x55d332[_0xd7dc('0x1f')];RpcMemberReport[_0xd7dc('0x18')](_0x3f3097);}};Report[_0xd7dc('0xe')][_0xd7dc('0x1a')]=function(_0x53d605){RpcVoiceTransferReport['blindTransfer'](_0x53d605);};Report[_0xd7dc('0xe')][_0xd7dc('0x1c')]=function(_0x7c2971){RpcVoiceTransferReport[_0xd7dc('0x1c')](_0x7c2971);};module[_0xd7dc('0x51')]=Report;
\ No newline at end of file
+var _0x2b05=['voiceCallReport','bind','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','accountcode','find','name','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','interface','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','destination','exten','dialer','queue','lastdata','context','from-voip-provider','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','membername','xcally-motion-dialer','isArray','startsWith','substring','indexOf','mobile','phone','isNil','attendedTransfer','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport'];(function(_0x50e9f0,_0x347951){var _0x216357=function(_0x23db93){while(--_0x23db93){_0x50e9f0['push'](_0x50e9f0['shift']());}};_0x216357(++_0x347951);}(_0x2b05,0x90));var _0x52b0=function(_0x1fc1d4,_0x14b420){_0x1fc1d4=_0x1fc1d4-0x0;var _0x3564b0=_0x2b05[_0x1fc1d4];return _0x3564b0;};'use strict';var BPromise=require(_0x52b0('0x0'));var _=require(_0x52b0('0x1'));var moment=require(_0x52b0('0x2'));var util=require(_0x52b0('0x3'));var config=require(_0x52b0('0x4'));var logger=require(_0x52b0('0x5'))('ami');var ami=require(_0x52b0('0x6'));var RpcVoiceAgentReport=require(_0x52b0('0x7'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x52b0('0x8'));var RpcMemberReport=require(_0x52b0('0x9'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x52b0('0xa'));var RpcVoiceTransferReport=require(_0x52b0('0xb'));var VoiceQueueReport=require(_0x52b0('0xc'));var VoiceCallReport=require(_0x52b0('0xd'));var VoiceAgentReport=require(_0x52b0('0xe'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x52b0('0xf'));function Report(_0x2ecbfd){this['realtime']=_0x2ecbfd;this[_0x52b0('0x10')]=_0x2ecbfd[_0x52b0('0x10')];this[_0x52b0('0x11')]=_0x2ecbfd[_0x52b0('0x11')];}Report[_0x52b0('0x12')][_0x52b0('0x13')]=function(_0x4c2c94){var _0x39be70=new VoiceQueueReport(this[_0x52b0('0x14')]);var _0x494f10=new VoiceAgentReport(this['realtime']);var _0xff2382=new VoiceDialReport(this[_0x52b0('0x14')]);var _0x515b13=new VoiceCallReport(this[_0x52b0('0x14')]);var _0x1c56bb=new UserReport(this['realtime']);if(config['xdr']&&config[_0x52b0('0x15')][_0x52b0('0x16')]){ami['on'](_0x52b0('0x17'),this[_0x52b0('0x18')]['bind'](this));ami['on'](_0x52b0('0x19'),this[_0x52b0('0x1a')][_0x52b0('0x1b')](this));ami['on']('custom:voiceAgentReport',this[_0x52b0('0x1c')][_0x52b0('0x1b')](this));ami['on'](_0x52b0('0x1d'),this[_0x52b0('0x1e')][_0x52b0('0x1b')](this));ami['on'](_0x52b0('0x1f'),this[_0x52b0('0x20')]['bind'](this));ami['on'](_0x52b0('0x21'),this['attendedTransfer'][_0x52b0('0x1b')](this));}};Report['prototype'][_0x52b0('0x22')]=function(_0x55cdc1){var _0x56838a=undefined;_0x56838a=_['find'](this['agents'],function(_0x32a36c){return _0x32a36c[_0x52b0('0x23')]==_0x55cdc1||_0x32a36c['name']==_0x55cdc1;});if(_['isNil'](_0x56838a)){var _0x468146=_[_0x52b0('0x24')](this[_0x52b0('0x11')],function(_0xcb6bd){return _0xcb6bd[_0x52b0('0x23')]==_0x55cdc1||_0xcb6bd[_0x52b0('0x25')]==_0x55cdc1;});if(_0x468146){_0x56838a=_[_0x52b0('0x24')](this[_0x52b0('0x10')],function(_0x45321b){return _0x45321b['interface']==util['format'](_0x52b0('0x26'),_0x468146[_0x52b0('0x25')]);});}}return _0x56838a;};Report['prototype']['voiceQueueReport']=function(_0x362f5c){for(var _0x57229f=0x0;_0x57229f<_0x362f5c[_0x52b0('0x27')];_0x57229f+=0x1){var _0x535c10=this[_0x52b0('0x22')](_0x362f5c[_0x57229f][_0x52b0('0x28')]);if(_0x535c10){_0x362f5c[_0x57229f][_0x52b0('0x23')]=_0x535c10[_0x52b0('0x23')];_0x362f5c[_0x57229f][_0x52b0('0x29')]=!![];_0x362f5c[_0x57229f][_0x52b0('0x2a')]=_0x535c10[_0x52b0('0x25')];_0x362f5c[_0x57229f][_0x52b0('0x2b')]=_['isNil'](_0x535c10[_0x52b0('0x2b')])?util[_0x52b0('0x2c')](_0x52b0('0x26'),_0x535c10[_0x52b0('0x25')]):_0x535c10[_0x52b0('0x2b')];if(_0x362f5c[_0x57229f][_0x52b0('0x2d')]){_0x362f5c[_0x57229f][_0x52b0('0x2e')]=moment()[_0x52b0('0x2c')](_0x52b0('0x2f'));}if(_0x362f5c[_0x57229f]['queuecallerexit']){_0x362f5c[_0x57229f][_0x52b0('0x30')]=moment()[_0x52b0('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x52b0('0x18')](_0x362f5c[_0x57229f]);}RpcVoiceQueueReport[_0x52b0('0x31')](_0x362f5c[_0x57229f]);}};function extractCalleridNumber(_0xb1fb60){var _0x5af3d2=_0xb1fb60[_0x52b0('0x32')](/<(.*?)>/);return _0x5af3d2?_0x5af3d2[0x1]:_0xb1fb60;}Report[_0x52b0('0x12')][_0x52b0('0x1a')]=function(_0x5079ab){_0x5079ab[_0x52b0('0x33')]=_0x5079ab[_0x52b0('0x33')]||_0x5079ab[_0x52b0('0x34')];if(_0x5079ab['type']==_0x52b0('0x35')){_0x5079ab['lastapplication']=_0x52b0('0x36');_0x5079ab[_0x52b0('0x37')]=_0x5079ab[_0x52b0('0x36')];if(_0x5079ab[_0x52b0('0x38')]==_0x52b0('0x39')){_0x5079ab[_0x52b0('0x23')]='';_0x5079ab['destination']=extractCalleridNumber(_0x5079ab['callerid']);}else if(_0x5079ab[_0x52b0('0x38')]=='from-sip'){if(_0x5079ab['destination']==_0x52b0('0x3a')){_0x5079ab[_0x52b0('0x33')]=extractCalleridNumber(_0x5079ab[_0x52b0('0x3b')]);_0x5079ab[_0x52b0('0x3c')]=_0x5079ab[_0x52b0('0x3d')];_0x5079ab[_0x52b0('0x3e')]=[_0x5079ab['channel'],_0x5079ab[_0x52b0('0x3f')]=_0x5079ab['destinationchannel']][0x0];_0x5079ab[_0x52b0('0x40')]=_0x5079ab['calleridpreview'];}else{_0x5079ab[_0x52b0('0x33')]=_0x5079ab[_0x52b0('0x3c')];_0x5079ab[_0x52b0('0x3c')]=_0x5079ab[_0x52b0('0x3d')];if(_0x5079ab[_0x52b0('0x41')]==_0x52b0('0x42')){_0x5079ab['accountcode']=_0x5079ab['connectedlinenum'];}else{_0x5079ab[_0x52b0('0x23')]='';}}}}else{_0x5079ab[_0x52b0('0x40')]=util[_0x52b0('0x2c')]('\x22%s\x22\x20<%s>',_0x5079ab['calleridname'],_0x5079ab[_0x52b0('0x3c')]);}RpcVoiceCallReport[_0x52b0('0x31')](_0x5079ab);if(_0x5079ab[_0x52b0('0x43')]){for(var _0x264c72=0x0;_0x264c72<_0x5079ab[_0x52b0('0x44')][_0x52b0('0x27')];_0x264c72+=0x1){_0x5079ab[_0x52b0('0x45')]=_0x5079ab['monitors'][_0x264c72][_0x52b0('0x46')];_0x5079ab[_0x52b0('0x47')]=_0x5079ab['monitors'][_0x264c72]['createdAt'];if(_0x5079ab['exten']==_0x52b0('0x3a')){_0x5079ab[_0x52b0('0x3c')]=_0x5079ab[_0x52b0('0x28')];_0x5079ab[_0x52b0('0x48')]=_0x5079ab[_0x52b0('0x49')];_0x5079ab[_0x52b0('0x28')]=_0x5079ab[_0x52b0('0x23')];_0x5079ab[_0x52b0('0x49')]=_0x5079ab[_0x52b0('0x4a')];_0x5079ab[_0x52b0('0x34')]=_0x5079ab[_0x52b0('0x3d')];}else if(_0x5079ab[_0x52b0('0x34')]==_0x52b0('0x4b')){_0x5079ab[_0x52b0('0x3c')]=_0x5079ab[_0x52b0('0x33')];_0x5079ab[_0x52b0('0x34')]=_0x5079ab['originatecalleridnum'];}RpcVoiceRecording[_0x52b0('0x31')](_0x5079ab);}}};Report[_0x52b0('0x12')]['voiceAgentReport']=function(_0x542c0c){if(_[_0x52b0('0x4c')](_0x542c0c)){_0x542c0c['forEach'](function(_0x579a01){RpcVoiceAgentReport['create'](_0x579a01);});}else{RpcVoiceAgentReport['create'](_0x542c0c);}};Report[_0x52b0('0x12')]['voiceDialReport']=function(_0x4b5fac){RpcVoiceDialReport[_0x52b0('0x31')](_0x4b5fac);var _0x9d47a8=undefined;var _0x34eaca=_0x4b5fac[_0x52b0('0x3f')];if(_[_0x52b0('0x4d')](_0x34eaca,'Local')){var _0x4b2523=_0x34eaca[_0x52b0('0x4e')](_0x34eaca[_0x52b0('0x4f')]('/')+0x1,_0x34eaca[_0x52b0('0x4f')]('@'));_0x9d47a8=_['find'](this[_0x52b0('0x10')],function(_0x1183a7){return _0x1183a7[_0x52b0('0x50')]==_0x4b2523||_0x1183a7[_0x52b0('0x51')]==_0x4b2523||_0x1183a7[_0x52b0('0x23')]==_0x4b2523;});}else{var _0x4b2523=_0x34eaca['substring'](_0x34eaca[_0x52b0('0x4f')]('/')+0x1,_0x34eaca['lastIndexOf']('-'));_0x9d47a8=this[_0x52b0('0x22')](_0x4b2523);}if(_0x9d47a8){_0x4b5fac[_0x52b0('0x2b')]=_[_0x52b0('0x52')](_0x9d47a8[_0x52b0('0x2b')])?util[_0x52b0('0x2c')](_0x52b0('0x26'),_0x9d47a8[_0x52b0('0x25')]):_0x9d47a8['interface'];_0x4b5fac[_0x52b0('0x4a')]=_0x9d47a8['name'];_0x4b5fac[_0x52b0('0x23')]=_0x9d47a8[_0x52b0('0x23')];RpcMemberReport['voiceDialReport'](_0x4b5fac);}};Report[_0x52b0('0x12')][_0x52b0('0x20')]=function(_0x11a238){RpcVoiceTransferReport[_0x52b0('0x20')](_0x11a238);};Report['prototype']['attendedTransfer']=function(_0x2970fc){RpcVoiceTransferReport[_0x52b0('0x53')](_0x2970fc);};module[_0x52b0('0x54')]=Report;
\ No newline at end of file
index 91d7fa7..c120117 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bd1=['registryentry','syncRegistry','bind','registry','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','actionSipShowRegistry','actionDeviceStateList','then','catch','[loopSyncRealTimeShow]','inspect','prototype','isNotNull','emit','username','stateRegistry','state','merge','actionid','format','trunk:%s','error','[syncRegistry][UserReport]','syncDeviceState','device','local','toLowerCase','inuse','stateTime','toNumber','telephone:%s','name','trunk:save','startsWith','Queue','Local','substring','indexOf','find','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','status','address','updateStatusRealtime','lodash','moment','bluebird','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','socket.io-emitter','trunks','agents','telephones'];(function(_0x2658c5,_0x21732f){var _0x51c2e2=function(_0x2f0d36){while(--_0x2f0d36){_0x2658c5['push'](_0x2658c5['shift']());}};_0x51c2e2(++_0x21732f);}(_0x5bd1,0x1f2));var _0x15bd=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x5bd1[_0x725a4c];return _0x37b2cc;};'use strict';var _=require(_0x15bd('0x0'));var moment=require(_0x15bd('0x1'));var BPromise=require(_0x15bd('0x2'));var util=require(_0x15bd('0x3'));var Redis=require(_0x15bd('0x4'));var config=require(_0x15bd('0x5'));var logger=require(_0x15bd('0x6'))(_0x15bd('0x7'));var ami=require(_0x15bd('0x8'));config['redis']=_[_0x15bd('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x15bd('0xa'))(new Redis(config['redis']));function UserReport(_0x58ac27){this['trunks']=_0x58ac27[_0x15bd('0xb')];this[_0x15bd('0xc')]=_0x58ac27['agents'];this[_0x15bd('0xd')]=_0x58ac27[_0x15bd('0xd')];ami['on'](_0x15bd('0xe'),this[_0x15bd('0xf')][_0x15bd('0x10')](this));ami['on'](_0x15bd('0x11'),this['syncRegistry'][_0x15bd('0x10')](this));ami['on']('devicestatechange',this['syncDeviceState'][_0x15bd('0x10')](this));ami['on'](_0x15bd('0x12'),this[_0x15bd('0x13')][_0x15bd('0x10')](this));this[_0x15bd('0x14')]();return BPromise[_0x15bd('0x15')]()['then'](ami[_0x15bd('0x16')]())['then'](ami[_0x15bd('0x17')]())[_0x15bd('0x18')](ami['actionSipPeerStatus']())[_0x15bd('0x19')](loggerCatch(_0x15bd('0x1a')));}function loggerCatch(_0x215b78){return function(_0x21dc66){logger['error'](_0x215b78,util[_0x15bd('0x1b')](_0x21dc66,{'showHidden':![],'depth':null}));};}UserReport[_0x15bd('0x1c')][_0x15bd('0x14')]=function(){setInterval(function(){BPromise['resolve']()[_0x15bd('0x18')](ami[_0x15bd('0x16')]())[_0x15bd('0x18')](ami[_0x15bd('0x17')]())[_0x15bd('0x18')](ami['actionSipPeerStatus']())[_0x15bd('0x19')](loggerCatch(_0x15bd('0x1a')));},0x32c8);};UserReport[_0x15bd('0x1c')][_0x15bd('0x1d')]=function(_0x296032){return _0x296032!==null&&!_['isUndefined'](_0x296032);};UserReport[_0x15bd('0x1c')][_0x15bd('0x1e')]=function(_0x301560,_0x7999c6,_0x32ce21){io['to'](_0x301560)[_0x15bd('0x1e')](_0x7999c6,_0x32ce21);};UserReport[_0x15bd('0x1c')][_0x15bd('0xf')]=function(_0x3a55f9){try{if(this['isNotNull'](_0x3a55f9)){var _0x5831af=_['find'](this[_0x15bd('0xb')],{'registry':_0x3a55f9[_0x15bd('0x1f')]});if(_0x5831af){_0x3a55f9[_0x15bd('0x20')]=_0x3a55f9[_0x15bd('0x21')];_[_0x15bd('0x22')](_0x5831af,_['omit'](_0x3a55f9,['event',_0x15bd('0x23'),_0x15bd('0x1f'),_0x15bd('0x21')]));this[_0x15bd('0x1e')](util[_0x15bd('0x24')](_0x15bd('0x25'),_0x5831af['name']),'trunk:save',_0x5831af);}}}catch(_0xaf73f6){logger[_0x15bd('0x26')](_0x15bd('0x27'),util[_0x15bd('0x1b')](_0xaf73f6,{'showHidden':![],'depth':null}));}};UserReport[_0x15bd('0x1c')][_0x15bd('0x28')]=function(_0x3e0b1a){try{if(this[_0x15bd('0x1d')](_0x3e0b1a)){if(this['agents'][_0x3e0b1a[_0x15bd('0x29')]]){if(!this['agents'][_0x3e0b1a[_0x15bd('0x29')]][_0x15bd('0x2a')]||_0x3e0b1a[_0x15bd('0x21')][_0x15bd('0x2b')]()==_0x15bd('0x2c')){this['agents'][_0x3e0b1a['device']][_0x15bd('0x2a')]=![];if(this[_0x15bd('0xc')][_0x3e0b1a['device']][_0x15bd('0x21')]!==_0x3e0b1a[_0x15bd('0x21')][_0x15bd('0x2b')]()){this[_0x15bd('0xc')][_0x3e0b1a[_0x15bd('0x29')]][_0x15bd('0x2d')]=_[_0x15bd('0x2e')](moment()[_0x15bd('0x24')]('x'));}this['agents'][_0x3e0b1a['device']]['state']=_0x3e0b1a['state'][_0x15bd('0x2b')]();this[_0x15bd('0xc')][_0x3e0b1a[_0x15bd('0x29')]]['updateStatusRealtime'](_0x3e0b1a);}}else if(this[_0x15bd('0xd')][_0x3e0b1a['device']]){if(this[_0x15bd('0xd')][_0x3e0b1a['device']][_0x15bd('0x21')]!==_0x3e0b1a[_0x15bd('0x21')][_0x15bd('0x2b')]()){this[_0x15bd('0xd')][_0x3e0b1a[_0x15bd('0x29')]][_0x15bd('0x2d')]=_[_0x15bd('0x2e')](moment()[_0x15bd('0x24')]('x'));}this[_0x15bd('0xd')][_0x3e0b1a['device']][_0x15bd('0x21')]=_0x3e0b1a[_0x15bd('0x21')][_0x15bd('0x2b')]();this[_0x15bd('0x1e')](util[_0x15bd('0x24')](_0x15bd('0x2f'),this[_0x15bd('0xd')][_0x3e0b1a[_0x15bd('0x29')]][_0x15bd('0x30')]),'telephone:save',this['telephones'][_0x3e0b1a['device']]);}else if(this[_0x15bd('0xb')][_0x3e0b1a['device']]){if(this[_0x15bd('0xb')][_0x3e0b1a[_0x15bd('0x29')]][_0x15bd('0x21')]!==_0x3e0b1a[_0x15bd('0x21')][_0x15bd('0x2b')]()){this[_0x15bd('0xb')][_0x3e0b1a[_0x15bd('0x29')]]['stateTime']=_[_0x15bd('0x2e')](moment()['format']('x'));}this[_0x15bd('0xb')][_0x3e0b1a['device']][_0x15bd('0x21')]=_0x3e0b1a[_0x15bd('0x21')][_0x15bd('0x2b')]();this[_0x15bd('0x1e')](util[_0x15bd('0x24')](_0x15bd('0x25'),this[_0x15bd('0xb')][_0x3e0b1a[_0x15bd('0x29')]][_0x15bd('0x30')]),_0x15bd('0x31'),this['trunks'][_0x3e0b1a['device']]);}else if(_[_0x15bd('0x32')](_0x3e0b1a[_0x15bd('0x29')],_0x15bd('0x33'))){}else if(_[_0x15bd('0x32')](_0x3e0b1a[_0x15bd('0x29')],_0x15bd('0x34'))){var _0x3cf1f2=_0x3e0b1a[_0x15bd('0x29')];var _0x2a0a92=_0x3cf1f2[_0x15bd('0x35')](_0x3cf1f2[_0x15bd('0x36')]('/')+0x1,_0x3cf1f2[_0x15bd('0x36')]('@'));var _0x40e0d9=_[_0x15bd('0x37')](this['agents'],function(_0x2acf2c){return _0x2acf2c['mobile']==_0x2a0a92||_0x2acf2c[_0x15bd('0x38')]==_0x2a0a92||_0x2acf2c[_0x15bd('0x39')]==_0x2a0a92;});if(_0x40e0d9){if(_0x40e0d9['state']!==_0x3e0b1a[_0x15bd('0x21')]['toLowerCase']()){_0x40e0d9[_0x15bd('0x2d')]=_['toNumber'](moment()[_0x15bd('0x24')]('x'));}_0x40e0d9[_0x15bd('0x21')]=_0x3e0b1a[_0x15bd('0x21')][_0x15bd('0x2b')]();_0x40e0d9['local']=!![];_0x40e0d9['updateStatusRealtime'](_0x3e0b1a);}}else{}}}catch(_0x1008cd){logger['error'](_0x15bd('0x3a'),util[_0x15bd('0x1b')](_0x1008cd,{'showHidden':![],'depth':null}));}};UserReport[_0x15bd('0x1c')][_0x15bd('0x13')]=function(_0x218b87){try{if(this['isNotNull'](_0x218b87)&&this['isNotNull'](_0x218b87[_0x15bd('0x12')])){if(this[_0x15bd('0xc')][_0x218b87['peer']]){if(!this['agents'][_0x218b87[_0x15bd('0x3b')]]['local']||_0x218b87['peerstatus']['toLowerCase']()==_0x15bd('0x3c')){this[_0x15bd('0xc')][_0x218b87['peer']]['local']=![];this[_0x15bd('0xc')][_0x218b87[_0x15bd('0x3b')]][_0x15bd('0x3d')]=_0x218b87[_0x15bd('0x12')]['toLowerCase']();this[_0x15bd('0xc')][_0x218b87[_0x15bd('0x3b')]][_0x15bd('0x3e')]=_0x218b87[_0x15bd('0x3e')];this['agents'][_0x218b87[_0x15bd('0x3b')]][_0x15bd('0x3f')](_0x218b87);}}else if(this[_0x15bd('0xd')][_0x218b87[_0x15bd('0x3b')]]){this[_0x15bd('0xd')][_0x218b87['peer']]['status']=_0x218b87[_0x15bd('0x12')][_0x15bd('0x2b')]();this['telephones'][_0x218b87[_0x15bd('0x3b')]][_0x15bd('0x3e')]=_0x218b87[_0x15bd('0x3e')];this[_0x15bd('0x1e')](util[_0x15bd('0x24')](_0x15bd('0x2f'),this['telephones'][_0x218b87[_0x15bd('0x3b')]][_0x15bd('0x30')]),'telephone:save',this[_0x15bd('0xd')][_0x218b87[_0x15bd('0x3b')]]);}else if(this[_0x15bd('0xb')][_0x218b87[_0x15bd('0x3b')]]){this[_0x15bd('0xb')][_0x218b87[_0x15bd('0x3b')]][_0x15bd('0x3d')]=_0x218b87['peerstatus'][_0x15bd('0x2b')]();this['trunks'][_0x218b87[_0x15bd('0x3b')]][_0x15bd('0x3e')]=_0x218b87['address'];this['emit'](util['format'](_0x15bd('0x25'),this[_0x15bd('0xb')][_0x218b87[_0x15bd('0x3b')]][_0x15bd('0x30')]),'trunk:save',this[_0x15bd('0xb')][_0x218b87[_0x15bd('0x3b')]]);}else{}}}catch(_0x2a4eb7){logger[_0x15bd('0x26')]('[syncPeerStatus][UserReport]',util[_0x15bd('0x1b')](_0x2a4eb7,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
+var _0xa179=['syncPeerStatus','registered','peer','status','address','telephone:save','exports','lodash','moment','bluebird','../../../config/environment','../../../config/logger','ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','error','inspect','prototype','loopSyncRealTimeShow','[loopSyncRealTimeShow]','isUndefined','emit','find','username','state','merge','omit','event','actionid','format','trunk:%s','name','[syncRegistry][UserReport]','isNotNull','device','toLowerCase','inuse','local','stateTime','toNumber','updateStatusRealtime','telephone:%s','trunk:save','startsWith','Queue','Local','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]'];(function(_0x35e162,_0x25d875){var _0x4d4566=function(_0x66ebe1){while(--_0x66ebe1){_0x35e162['push'](_0x35e162['shift']());}};_0x4d4566(++_0x25d875);}(_0xa179,0xd0));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a17('0x0'));var moment=require(_0x9a17('0x1'));var BPromise=require(_0x9a17('0x2'));var util=require('util');var Redis=require('ioredis');var config=require(_0x9a17('0x3'));var logger=require(_0x9a17('0x4'))(_0x9a17('0x5'));var ami=require('../ami');config[_0x9a17('0x6')]=_['defaults'](config[_0x9a17('0x6')],{'host':_0x9a17('0x7'),'port':0x18eb});var io=require(_0x9a17('0x8'))(new Redis(config['redis']));function UserReport(_0x4910fa){this['trunks']=_0x4910fa[_0x9a17('0x9')];this['agents']=_0x4910fa[_0x9a17('0xa')];this[_0x9a17('0xb')]=_0x4910fa[_0x9a17('0xb')];ami['on']('registryentry',this[_0x9a17('0xc')][_0x9a17('0xd')](this));ami['on'](_0x9a17('0xe'),this[_0x9a17('0xc')][_0x9a17('0xd')](this));ami['on'](_0x9a17('0xf'),this[_0x9a17('0x10')][_0x9a17('0xd')](this));ami['on'](_0x9a17('0x11'),this['syncPeerStatus'][_0x9a17('0xd')](this));this['loopSyncRealTimeShow']();return BPromise[_0x9a17('0x12')]()[_0x9a17('0x13')](ami[_0x9a17('0x14')]())['then'](ami[_0x9a17('0x15')]())[_0x9a17('0x13')](ami['actionSipPeerStatus']())[_0x9a17('0x16')](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x56786d){return function(_0x27d78e){logger[_0x9a17('0x17')](_0x56786d,util[_0x9a17('0x18')](_0x27d78e,{'showHidden':![],'depth':null}));};}UserReport[_0x9a17('0x19')][_0x9a17('0x1a')]=function(){setInterval(function(){BPromise[_0x9a17('0x12')]()['then'](ami[_0x9a17('0x14')]())[_0x9a17('0x13')](ami[_0x9a17('0x15')]())['then'](ami['actionSipPeerStatus']())[_0x9a17('0x16')](loggerCatch(_0x9a17('0x1b')));},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x269d1f){return _0x269d1f!==null&&!_[_0x9a17('0x1c')](_0x269d1f);};UserReport[_0x9a17('0x19')][_0x9a17('0x1d')]=function(_0x3abfac,_0x59ec5a,_0x3c38c4){io['to'](_0x3abfac)['emit'](_0x59ec5a,_0x3c38c4);};UserReport[_0x9a17('0x19')]['syncRegistry']=function(_0x5ac0fc){try{if(this['isNotNull'](_0x5ac0fc)){var _0x288fa7=_[_0x9a17('0x1e')](this[_0x9a17('0x9')],{'registry':_0x5ac0fc[_0x9a17('0x1f')]});if(_0x288fa7){_0x5ac0fc['stateRegistry']=_0x5ac0fc[_0x9a17('0x20')];_[_0x9a17('0x21')](_0x288fa7,_[_0x9a17('0x22')](_0x5ac0fc,[_0x9a17('0x23'),_0x9a17('0x24'),_0x9a17('0x1f'),'state']));this[_0x9a17('0x1d')](util[_0x9a17('0x25')](_0x9a17('0x26'),_0x288fa7[_0x9a17('0x27')]),'trunk:save',_0x288fa7);}}}catch(_0x40527f){logger[_0x9a17('0x17')](_0x9a17('0x28'),util[_0x9a17('0x18')](_0x40527f,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x9a17('0x10')]=function(_0x58102d){try{if(this[_0x9a17('0x29')](_0x58102d)){if(this[_0x9a17('0xa')][_0x58102d['device']]){if(!this[_0x9a17('0xa')][_0x58102d[_0x9a17('0x2a')]]['local']||_0x58102d[_0x9a17('0x20')][_0x9a17('0x2b')]()==_0x9a17('0x2c')){this['agents'][_0x58102d[_0x9a17('0x2a')]][_0x9a17('0x2d')]=![];if(this[_0x9a17('0xa')][_0x58102d[_0x9a17('0x2a')]][_0x9a17('0x20')]!==_0x58102d['state'][_0x9a17('0x2b')]()){this[_0x9a17('0xa')][_0x58102d[_0x9a17('0x2a')]][_0x9a17('0x2e')]=_[_0x9a17('0x2f')](moment()[_0x9a17('0x25')]('x'));}this['agents'][_0x58102d[_0x9a17('0x2a')]][_0x9a17('0x20')]=_0x58102d[_0x9a17('0x20')][_0x9a17('0x2b')]();this[_0x9a17('0xa')][_0x58102d[_0x9a17('0x2a')]][_0x9a17('0x30')](_0x58102d);}}else if(this['telephones'][_0x58102d[_0x9a17('0x2a')]]){if(this['telephones'][_0x58102d[_0x9a17('0x2a')]][_0x9a17('0x20')]!==_0x58102d[_0x9a17('0x20')][_0x9a17('0x2b')]()){this['telephones'][_0x58102d[_0x9a17('0x2a')]][_0x9a17('0x2e')]=_[_0x9a17('0x2f')](moment()['format']('x'));}this['telephones'][_0x58102d[_0x9a17('0x2a')]][_0x9a17('0x20')]=_0x58102d[_0x9a17('0x20')][_0x9a17('0x2b')]();this[_0x9a17('0x1d')](util[_0x9a17('0x25')](_0x9a17('0x31'),this[_0x9a17('0xb')][_0x58102d['device']][_0x9a17('0x27')]),'telephone:save',this[_0x9a17('0xb')][_0x58102d[_0x9a17('0x2a')]]);}else if(this[_0x9a17('0x9')][_0x58102d['device']]){if(this[_0x9a17('0x9')][_0x58102d[_0x9a17('0x2a')]][_0x9a17('0x20')]!==_0x58102d[_0x9a17('0x20')][_0x9a17('0x2b')]()){this[_0x9a17('0x9')][_0x58102d[_0x9a17('0x2a')]][_0x9a17('0x2e')]=_[_0x9a17('0x2f')](moment()[_0x9a17('0x25')]('x'));}this[_0x9a17('0x9')][_0x58102d[_0x9a17('0x2a')]][_0x9a17('0x20')]=_0x58102d['state'][_0x9a17('0x2b')]();this[_0x9a17('0x1d')](util['format'](_0x9a17('0x26'),this[_0x9a17('0x9')][_0x58102d[_0x9a17('0x2a')]][_0x9a17('0x27')]),_0x9a17('0x32'),this[_0x9a17('0x9')][_0x58102d[_0x9a17('0x2a')]]);}else if(_[_0x9a17('0x33')](_0x58102d[_0x9a17('0x2a')],_0x9a17('0x34'))){}else if(_['startsWith'](_0x58102d[_0x9a17('0x2a')],_0x9a17('0x35'))){var _0x25c9f1=_0x58102d['device'];var _0x24505b=_0x25c9f1[_0x9a17('0x36')](_0x25c9f1[_0x9a17('0x37')]('/')+0x1,_0x25c9f1['indexOf']('@'));var _0x547875=_[_0x9a17('0x1e')](this[_0x9a17('0xa')],function(_0x349dd0){return _0x349dd0[_0x9a17('0x38')]==_0x24505b||_0x349dd0[_0x9a17('0x39')]==_0x24505b||_0x349dd0[_0x9a17('0x3a')]==_0x24505b;});if(_0x547875){if(_0x547875[_0x9a17('0x20')]!==_0x58102d[_0x9a17('0x20')][_0x9a17('0x2b')]()){_0x547875[_0x9a17('0x2e')]=_[_0x9a17('0x2f')](moment()['format']('x'));}_0x547875[_0x9a17('0x20')]=_0x58102d[_0x9a17('0x20')][_0x9a17('0x2b')]();_0x547875[_0x9a17('0x2d')]=!![];_0x547875[_0x9a17('0x30')](_0x58102d);}}else{}}}catch(_0x18e443){logger['error'](_0x9a17('0x3b'),util[_0x9a17('0x18')](_0x18e443,{'showHidden':![],'depth':null}));}};UserReport[_0x9a17('0x19')][_0x9a17('0x3c')]=function(_0x3132e9){try{if(this[_0x9a17('0x29')](_0x3132e9)&&this[_0x9a17('0x29')](_0x3132e9[_0x9a17('0x11')])){if(this['agents'][_0x3132e9['peer']]){if(!this[_0x9a17('0xa')][_0x3132e9['peer']]['local']||_0x3132e9['peerstatus'][_0x9a17('0x2b')]()==_0x9a17('0x3d')){this[_0x9a17('0xa')][_0x3132e9[_0x9a17('0x3e')]][_0x9a17('0x2d')]=![];this[_0x9a17('0xa')][_0x3132e9[_0x9a17('0x3e')]][_0x9a17('0x3f')]=_0x3132e9['peerstatus'][_0x9a17('0x2b')]();this[_0x9a17('0xa')][_0x3132e9['peer']][_0x9a17('0x40')]=_0x3132e9[_0x9a17('0x40')];this[_0x9a17('0xa')][_0x3132e9[_0x9a17('0x3e')]]['updateStatusRealtime'](_0x3132e9);}}else if(this[_0x9a17('0xb')][_0x3132e9[_0x9a17('0x3e')]]){this[_0x9a17('0xb')][_0x3132e9['peer']]['status']=_0x3132e9[_0x9a17('0x11')][_0x9a17('0x2b')]();this[_0x9a17('0xb')][_0x3132e9[_0x9a17('0x3e')]][_0x9a17('0x40')]=_0x3132e9[_0x9a17('0x40')];this[_0x9a17('0x1d')](util['format'](_0x9a17('0x31'),this['telephones'][_0x3132e9['peer']][_0x9a17('0x27')]),_0x9a17('0x41'),this[_0x9a17('0xb')][_0x3132e9['peer']]);}else if(this[_0x9a17('0x9')][_0x3132e9['peer']]){this[_0x9a17('0x9')][_0x3132e9['peer']]['status']=_0x3132e9[_0x9a17('0x11')][_0x9a17('0x2b')]();this[_0x9a17('0x9')][_0x3132e9[_0x9a17('0x3e')]][_0x9a17('0x40')]=_0x3132e9[_0x9a17('0x40')];this[_0x9a17('0x1d')](util[_0x9a17('0x25')](_0x9a17('0x26'),this['trunks'][_0x3132e9[_0x9a17('0x3e')]][_0x9a17('0x27')]),_0x9a17('0x32'),this[_0x9a17('0x9')][_0x3132e9[_0x9a17('0x3e')]]);}else{}}}catch(_0x1999cb){logger[_0x9a17('0x17')]('[syncPeerStatus][UserReport]',util['inspect'](_0x1999cb,{'showHidden':![],'depth':null}));}};module[_0x9a17('0x42')]=UserReport;
\ No newline at end of file
index 8d35af8..f64a2ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4698=['custom:agentcalled','user:called','error','[syncAgentCalled][VoiceAgentReport]','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','user:%s','membername','user:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','inspect','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','agentcompleteAt','complete','transfer','agent','acwtime','acwTimeout','omit','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','syncVarSet','addVariable','keys','variable','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','includes','custom:voiceAgentReport','values','transfereeuniqueid','origtransfereruniqueid','talktime','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','syncMusicOnHoldStart','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','privilege'];(function(_0x5e78e0,_0x2ee185){var _0x583070=function(_0x3f9697){while(--_0x3f9697){_0x5e78e0['push'](_0x5e78e0['shift']());}};_0x583070(++_0x2ee185);}(_0x4698,0x1c4));var _0x8469=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x4698[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x8469('0x0'));var moment=require(_0x8469('0x1'));var util=require(_0x8469('0x2'));var Redis=require(_0x8469('0x3'));var config=require(_0x8469('0x4'));var logger=require(_0x8469('0x5'))(_0x8469('0x6'));var ami=require(_0x8469('0x7'));config[_0x8469('0x8')]=_[_0x8469('0x9')](config[_0x8469('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x8469('0xa'))(new Redis(config['redis']));function VoiceAgentReport(_0x3dca33){this[_0x8469('0xb')]={};this['voiceQueues']=_0x3dca33[_0x8469('0xc')];this[_0x8469('0xd')]=_0x3dca33[_0x8469('0xd')];this[_0x8469('0xe')]={};ami['on'](_0x8469('0xf'),this[_0x8469('0x10')][_0x8469('0x11')](this));ami['on'](_0x8469('0x12'),this['syncAgentConnect'][_0x8469('0x11')](this));ami['on'](_0x8469('0x13'),this[_0x8469('0x14')]['bind'](this));ami['on']('queuecallerabandon',this[_0x8469('0x15')][_0x8469('0x11')](this));ami['on'](_0x8469('0x16'),this[_0x8469('0x17')][_0x8469('0x11')](this));ami['on'](_0x8469('0x18'),this['syncVarSet']['bind'](this));ami['on'](_0x8469('0x19'),this[_0x8469('0x1a')][_0x8469('0x11')](this));ami['on'](_0x8469('0x1b'),this['syncMusicOnHoldStart'][_0x8469('0x11')](this));ami['on'](_0x8469('0x1c'),this[_0x8469('0x1d')][_0x8469('0x11')](this));ami['on'](_0x8469('0x1e'),this[_0x8469('0x1f')][_0x8469('0x11')](this));ami['on'](_0x8469('0x20'),this[_0x8469('0x21')]['bind'](this));}VoiceAgentReport[_0x8469('0x22')][_0x8469('0x23')]=function(_0x4186f2,_0x3933d7,_0x53b6ef){io['to'](_0x4186f2)[_0x8469('0x23')](_0x3933d7,_0x53b6ef);};VoiceAgentReport[_0x8469('0x22')][_0x8469('0x24')]=function(_0x5515ed){return _0x5515ed!==null&&!_[_0x8469('0x25')](_0x5515ed);};VoiceAgentReport[_0x8469('0x22')][_0x8469('0x10')]=function(_0x286afb){try{if(this[_0x8469('0x24')](_0x286afb)){if(_[_0x8469('0x25')](this[_0x8469('0xb')][_0x286afb[_0x8469('0x26')]])){this[_0x8469('0xb')][_0x286afb['uniqueid']]={};}if(_[_0x8469('0x25')](this[_0x8469('0xb')][_0x286afb['uniqueid']][_0x286afb[_0x8469('0x27')]])){this[_0x8469('0xb')][_0x286afb[_0x8469('0x26')]][_0x286afb[_0x8469('0x27')]]={'agentcalledAt':moment()[_0x8469('0x28')](_0x8469('0x29')),'lastevent':_0x8469('0x2a'),'variables':this[_0x8469('0xe')][_0x286afb[_0x8469('0x26')]],'type':this[_0x8469('0xc')][_0x286afb[_0x8469('0x2b')]]?this[_0x8469('0xc')][_0x286afb[_0x8469('0x2b')]][_0x8469('0x2c')]||_0x8469('0x2d'):_0x8469('0x2d')};}_[_0x8469('0x2e')](this['channels'][_0x286afb['uniqueid']][_0x286afb['destuniqueid']],_['omit'](_0x286afb,['event',_0x8469('0x2f')]));ami[_0x8469('0x23')](_0x8469('0x30'),this['channels'][_0x286afb[_0x8469('0x26')]][_0x286afb[_0x8469('0x27')]]);this[_0x8469('0x23')](util[_0x8469('0x28')]('user:%s',_0x286afb['membername']),_0x8469('0x31'),this[_0x8469('0xb')][_0x286afb['uniqueid']][_0x286afb[_0x8469('0x27')]]);}}catch(_0x34d863){logger[_0x8469('0x32')](_0x8469('0x33'),util['inspect'](_0x34d863,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8469('0x22')]['syncAgentConnect']=function(_0x565ba5){try{if(this[_0x8469('0x24')](_0x565ba5)){if(this['channels'][_0x565ba5['uniqueid']]){for(var _0x5d44bb in this[_0x8469('0xb')][_0x565ba5[_0x8469('0x26')]]){if(this['channels'][_0x565ba5[_0x8469('0x26')]][_0x8469('0x34')](_0x5d44bb)){if(_0x565ba5[_0x8469('0x27')]===_0x5d44bb){this[_0x8469('0xb')][_0x565ba5[_0x8469('0x26')]][_0x5d44bb][_0x8469('0x35')]=moment()[_0x8469('0x28')](_0x8469('0x29'));this['channels'][_0x565ba5[_0x8469('0x26')]][_0x5d44bb][_0x8469('0x36')]=_0x8469('0x37');this['channels'][_0x565ba5['uniqueid']][_0x5d44bb][_0x8469('0x38')]=_0x565ba5[_0x8469('0x38')];this[_0x8469('0xb')][_0x565ba5[_0x8469('0x26')]][_0x5d44bb][_0x8469('0x39')]=_0x565ba5[_0x8469('0x39')];this[_0x8469('0xb')][_0x565ba5['uniqueid']][_0x5d44bb][_0x8469('0x3a')]=_0x565ba5[_0x8469('0x3a')];this[_0x8469('0xb')][_0x565ba5['uniqueid']][_0x5d44bb][_0x8469('0x3b')]=_0x565ba5[_0x8469('0x3b')];this[_0x8469('0xb')][_0x565ba5[_0x8469('0x26')]][_0x5d44bb][_0x8469('0x3c')]=_0x565ba5['destchannelstatedesc'];_[_0x8469('0x2e')](this[_0x8469('0xd')][_0x565ba5[_0x8469('0x3d')]],_['pick'](_0x565ba5,[_0x8469('0x2b'),'destconnectedlinenum']));this[_0x8469('0x23')](util[_0x8469('0x28')](_0x8469('0x3e'),_0x565ba5[_0x8469('0x3f')]),_0x8469('0x40'),this[_0x8469('0xb')][_0x565ba5[_0x8469('0x26')]][_0x565ba5[_0x8469('0x27')]]);ami[_0x8469('0x23')]('custom:agentconnect',this[_0x8469('0xb')][_0x565ba5[_0x8469('0x26')]][_0x5d44bb]);}else if(!this[_0x8469('0xb')][_0x565ba5[_0x8469('0x26')]][_0x5d44bb][_0x8469('0x13')]&&!this[_0x8469('0xb')][_0x565ba5[_0x8469('0x26')]][_0x5d44bb][_0x8469('0x16')]){this['channels'][_0x565ba5[_0x8469('0x26')]][_0x5d44bb]['agentringnoanswer']=!![];this['channels'][_0x565ba5[_0x8469('0x26')]][_0x5d44bb][_0x8469('0x41')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x565ba5[_0x8469('0x26')]][_0x5d44bb][_0x8469('0x42')]=_0x8469('0x43');this[_0x8469('0xb')][_0x565ba5[_0x8469('0x26')]][_0x5d44bb][_0x8469('0x36')]='answered_elsewhere';this[_0x8469('0xb')][_0x565ba5[_0x8469('0x26')]][_0x5d44bb]['answeredelsewheredestinationuniqueid']=_0x565ba5[_0x8469('0x27')];this[_0x8469('0xb')][_0x565ba5[_0x8469('0x26')]][_0x5d44bb][_0x8469('0x44')]=_0x565ba5[_0x8469('0x3f')];ami[_0x8469('0x23')](_0x8469('0x45'),this[_0x8469('0xb')][_0x565ba5[_0x8469('0x26')]][_0x5d44bb]);}}}}}}catch(_0x30373d){logger['error'](_0x8469('0x46'),util[_0x8469('0x47')](_0x30373d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8469('0x22')][_0x8469('0x14')]=function(_0x5c2338){try{if(this[_0x8469('0x24')](_0x5c2338)){if(this[_0x8469('0xb')][_0x5c2338[_0x8469('0x26')]]&&this['channels'][_0x5c2338[_0x8469('0x26')]][_0x5c2338[_0x8469('0x27')]]){this['channels'][_0x5c2338[_0x8469('0x26')]][_0x5c2338[_0x8469('0x27')]][_0x8469('0x13')]=!![];this['channels'][_0x5c2338[_0x8469('0x26')]][_0x5c2338['destuniqueid']][_0x8469('0x41')]=moment()[_0x8469('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8469('0xb')][_0x5c2338['uniqueid']][_0x5c2338[_0x8469('0x27')]][_0x8469('0x42')]=_0x8469('0x48');this['channels'][_0x5c2338[_0x8469('0x26')]][_0x5c2338[_0x8469('0x27')]][_0x8469('0x36')]=_0x8469('0x48');ami[_0x8469('0x23')](_0x8469('0x49'),this[_0x8469('0xb')][_0x5c2338[_0x8469('0x26')]][_0x5c2338[_0x8469('0x27')]]);}}}catch(_0x3c7591){logger['error'](_0x8469('0x4a'),util[_0x8469('0x47')](_0x3c7591,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8469('0x22')][_0x8469('0x15')]=function(_0x48f36c){try{if(this[_0x8469('0x24')](_0x48f36c)){if(this[_0x8469('0xb')][_0x48f36c[_0x8469('0x26')]]){for(var _0xb38c52 in this[_0x8469('0xb')][_0x48f36c[_0x8469('0x26')]]){if(this[_0x8469('0xb')][_0x48f36c['uniqueid']][_0x8469('0x34')](_0xb38c52)&&!this[_0x8469('0xb')][_0x48f36c[_0x8469('0x26')]][_0xb38c52][_0x8469('0x13')]&&!this[_0x8469('0xb')][_0x48f36c[_0x8469('0x26')]][_0xb38c52][_0x8469('0x16')]){this[_0x8469('0xb')][_0x48f36c['uniqueid']][_0xb38c52]['agentringnoanswer']=!![];this[_0x8469('0xb')][_0x48f36c[_0x8469('0x26')]][_0xb38c52][_0x8469('0x41')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x48f36c[_0x8469('0x26')]][_0xb38c52]['reason']='abandoned';this['channels'][_0x48f36c[_0x8469('0x26')]][_0xb38c52]['lastevent']=_0x8469('0x4b');ami[_0x8469('0x23')](_0x8469('0x4c'),this['channels'][_0x48f36c['uniqueid']][_0xb38c52]);}}}}}catch(_0x2ae02a){logger[_0x8469('0x32')]('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0x8469('0x47')](_0x2ae02a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8469('0x22')]['syncAgentComplete']=function(_0x688a25){try{if(this[_0x8469('0x24')](_0x688a25)){if(this['channels'][_0x688a25[_0x8469('0x26')]]){for(var _0x170539 in this[_0x8469('0xb')][_0x688a25['uniqueid']]){if(this[_0x8469('0xb')][_0x688a25[_0x8469('0x26')]]['hasOwnProperty'](_0x170539)){if(this[_0x8469('0xb')][_0x688a25[_0x8469('0x26')]][_0x170539][_0x8469('0x35')]&&!this[_0x8469('0xb')][_0x688a25['uniqueid']][_0x170539][_0x8469('0x16')]){this['channels'][_0x688a25[_0x8469('0x26')]][_0x170539][_0x8469('0x16')]=!![];this[_0x8469('0xb')][_0x688a25[_0x8469('0x26')]][_0x170539][_0x8469('0x4d')]=moment()[_0x8469('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8469('0xb')][_0x688a25[_0x8469('0x26')]][_0x170539][_0x8469('0x36')]=_0x8469('0x4e');this[_0x8469('0xb')][_0x688a25['uniqueid']][_0x170539]['talktime']=_0x688a25['talktime'];this['channels'][_0x688a25['uniqueid']][_0x170539]['reason']=_0x688a25[_0x8469('0x42')]==_0x8469('0x4f')?_0x8469('0x50'):_0x688a25[_0x8469('0x42')];if(this['voiceQueues'][_0x688a25[_0x8469('0x2b')]]&&this[_0x8469('0xc')][_0x688a25[_0x8469('0x2b')]]['acw']){this[_0x8469('0xb')][_0x688a25[_0x8469('0x26')]][_0x170539]['agentacw']=!![];this[_0x8469('0xb')][_0x688a25['uniqueid']][_0x170539][_0x8469('0x51')]=this[_0x8469('0xc')][_0x688a25[_0x8469('0x2b')]][_0x8469('0x52')];}this[_0x8469('0xd')][_0x688a25['interface']]=_[_0x8469('0x53')](this[_0x8469('0xd')][_0x688a25[_0x8469('0x3d')]],['queue','destconnectedlinenum']);this[_0x8469('0x23')](util[_0x8469('0x28')]('user:%s',_0x688a25[_0x8469('0x3f')]),_0x8469('0x54'),this['channels'][_0x688a25[_0x8469('0x26')]][_0x170539]);ami['emit'](_0x8469('0x55'),this[_0x8469('0xb')][_0x688a25['uniqueid']][_0x170539]);}}}}}}catch(_0x5ec369){logger['error'](_0x8469('0x56'),util['inspect'](_0x5ec369,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8469('0x57')]=function(_0x231b4a){try{if(this['isNotNull'](_0x231b4a)){this[_0x8469('0x58')](_0x231b4a[_0x8469('0x26')],_[_0x8469('0x59')](_0x231b4a[_0x8469('0x5a')])[0x0],_0x231b4a[_0x8469('0x5b')]);if(this[_0x8469('0xb')][_0x231b4a['uniqueid']]){for(var _0x23f7ff in this[_0x8469('0xb')][_0x231b4a[_0x8469('0x26')]]){if(this['channels'][_0x231b4a[_0x8469('0x26')]][_0x8469('0x34')](_0x23f7ff)){if(_[_0x8469('0x25')](this[_0x8469('0xb')][_0x231b4a[_0x8469('0x26')]][_0x23f7ff][_0x8469('0xe')])){this[_0x8469('0xb')][_0x231b4a['uniqueid']][_0x23f7ff]['variables']={};}this['channels'][_0x231b4a['uniqueid']][_0x23f7ff][_0x8469('0xe')]=this[_0x8469('0xe')][_0x231b4a[_0x8469('0x26')]];}}}}}catch(_0x493ede){logger['error']('[syncVarSet][VoiceAgentReport]',util['inspect'](_0x493ede,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8469('0x22')][_0x8469('0x58')]=function(_0x25d6e0,_0x2d347b,_0x422703){var _0x211a96=[_0x8469('0x5c'),_0x8469('0x5d'),_0x8469('0x5e'),_0x8469('0x5f'),'rtpaudioqosloss',_0x8469('0x60'),_0x8469('0x61'),'rtpaudioqosrttbridged',_0x8469('0x62'),_0x8469('0x63'),'bridgepeer',_0x8469('0x64'),'membercalls',_0x8469('0x65'),_0x8469('0x66'),_0x8469('0x67'),'membername',_0x8469('0x68'),'memberrealtime'];if(!_[_0x8469('0x69')](_0x2d347b)&&!_[_0x8469('0x6a')](_0x211a96,_0x2d347b)){if(_[_0x8469('0x25')](this[_0x8469('0xe')][_0x25d6e0])){this[_0x8469('0xe')][_0x25d6e0]={};}this[_0x8469('0xe')][_0x25d6e0][_0x2d347b]=_0x422703;}};VoiceAgentReport[_0x8469('0x22')][_0x8469('0x1a')]=function(_0x58f472){try{if(this[_0x8469('0x24')](_0x58f472)){if(this[_0x8469('0xb')][_0x58f472[_0x8469('0x26')]]){for(var _0x4986b2 in this[_0x8469('0xb')][_0x58f472[_0x8469('0x26')]]){if(this[_0x8469('0xb')][_0x58f472[_0x8469('0x26')]][_0x8469('0x34')](_0x4986b2)){if(this['channels'][_0x58f472[_0x8469('0x26')]][_0x4986b2][_0x8469('0x42')]==_0x8469('0x4f')&&this['channels'][_0x58f472['uniqueid']][_0x4986b2]['agentcomplete']){this[_0x8469('0xb')][_0x58f472[_0x8469('0x26')]][_0x4986b2]['agentcompleteAt']=moment()[_0x8469('0x28')](_0x8469('0x29'));}}}ami[_0x8469('0x23')](_0x8469('0x6b'),_[_0x8469('0x6c')](this['channels'][_0x58f472['uniqueid']]));delete this[_0x8469('0xb')][_0x58f472['uniqueid']];}if(this[_0x8469('0xe')][_0x58f472[_0x8469('0x26')]]){delete this[_0x8469('0xe')][_0x58f472['uniqueid']];}}}catch(_0x44727c){logger[_0x8469('0x32')]('[syncHangup][VoiceAgentReport]',util[_0x8469('0x47')](_0x44727c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8469('0x22')][_0x8469('0x1f')]=function(_0x349d8a){try{if(this[_0x8469('0x24')](_0x349d8a)){if(this[_0x8469('0xb')][_0x349d8a[_0x8469('0x6d')]]){for(var _0x1efafa in this['channels'][_0x349d8a[_0x8469('0x6d')]]){if(this[_0x8469('0xb')][_0x349d8a['transfereeuniqueid']][_0x8469('0x34')](_0x1efafa)){if(_0x349d8a[_0x8469('0x6e')]===_0x1efafa){var _0x556f12=moment();this[_0x8469('0xb')][_0x349d8a[_0x8469('0x6d')]][_0x1efafa][_0x8469('0x16')]=!![];this[_0x8469('0xb')][_0x349d8a['transfereeuniqueid']][_0x1efafa]['agentcompleteAt']=moment()['format'](_0x8469('0x29'));this[_0x8469('0xb')][_0x349d8a[_0x8469('0x6d')]][_0x1efafa][_0x8469('0x42')]=_0x8469('0x4f');this[_0x8469('0xb')][_0x349d8a['transfereeuniqueid']][_0x1efafa][_0x8469('0x36')]=_0x8469('0x4e');this['channels'][_0x349d8a['transfereeuniqueid']][_0x1efafa][_0x8469('0x6f')]=_0x556f12[_0x8469('0x70')](this[_0x8469('0xb')][_0x349d8a[_0x8469('0x6d')]][_0x1efafa][_0x8469('0x35')],_0x8469('0x71'));}}}}if(this['channels'][_0x349d8a[_0x8469('0x72')]]){var _0x5a91e7=this[_0x8469('0xb')][_0x349d8a['secondtransfereruniqueid']];this[_0x8469('0xb')][_0x349d8a['secondtransfereruniqueid']]=this[_0x8469('0xb')][_0x349d8a[_0x8469('0x6d')]];this['channels'][_0x349d8a[_0x8469('0x6d')]]=_0x5a91e7;}}}catch(_0x1c6931){logger[_0x8469('0x32')](_0x8469('0x73'),util['inspect'](_0x1c6931,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8469('0x22')][_0x8469('0x21')]=function(_0x1acd12){try{if(this['isNotNull'](_0x1acd12)){if(this[_0x8469('0xb')][_0x1acd12[_0x8469('0x6d')]]){for(var _0x14bbad in this['channels'][_0x1acd12[_0x8469('0x6d')]]){if(this[_0x8469('0xb')][_0x1acd12[_0x8469('0x6d')]][_0x8469('0x34')](_0x14bbad)){if(_0x1acd12[_0x8469('0x74')]===_0x14bbad){var _0x507551=moment();this['channels'][_0x1acd12['transfereeuniqueid']][_0x14bbad][_0x8469('0x16')]=!![];this[_0x8469('0xb')][_0x1acd12[_0x8469('0x6d')]][_0x14bbad][_0x8469('0x4d')]=_0x507551;this[_0x8469('0xb')][_0x1acd12['transfereeuniqueid']][_0x14bbad][_0x8469('0x42')]=_0x8469('0x4f');this['channels'][_0x1acd12['transfereeuniqueid']][_0x14bbad][_0x8469('0x36')]='complete';this['channels'][_0x1acd12['transfereeuniqueid']][_0x14bbad][_0x8469('0x6f')]=_0x507551[_0x8469('0x70')](this[_0x8469('0xb')][_0x1acd12['transfereeuniqueid']][_0x14bbad][_0x8469('0x35')],_0x8469('0x71'));}}}}}}catch(_0x562a48){logger[_0x8469('0x32')](_0x8469('0x75'),util[_0x8469('0x47')](_0x562a48,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8469('0x22')][_0x8469('0x76')]=function(_0x474c81){var _0x40c87f='';try{if(this['isNotNull'](_0x474c81)){if(_0x474c81['channel']){_0x40c87f=_0x474c81[_0x8469('0x77')][_0x8469('0x78')](0x0,_0x474c81[_0x8469('0x77')][_0x8469('0x79')]('-'));if(this['agents'][_0x40c87f]){this[_0x8469('0xd')][_0x40c87f][_0x8469('0x7a')]=!![];}}}}catch(_0x152b31){logger[_0x8469('0x32')](_0x8469('0x7b'),util[_0x8469('0x47')](_0x152b31,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8469('0x22')][_0x8469('0x1d')]=function(_0x527159){var _0x480270='';try{if(this['isNotNull'](_0x527159)){if(_0x527159[_0x8469('0x77')]){_0x480270=_0x527159['channel'][_0x8469('0x78')](0x0,_0x527159[_0x8469('0x77')][_0x8469('0x79')]('-'));if(this[_0x8469('0xd')][_0x480270]){this[_0x8469('0xd')][_0x480270]['onhold']=![];}}}}catch(_0x342fd8){logger[_0x8469('0x32')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x8469('0x47')](_0x342fd8,{'showHidden':![],'depth':null}));}};module[_0x8469('0x7c')]=VoiceAgentReport;
\ No newline at end of file
+var _0xc2d6=['rtpaudioqosrttbridged','sipcallid','bridgepeer','membercalls','memberdynamic','memberinterface','memberrealtime','includes','hasOwnProperty','transfer','custom:voiceAgentReport','values','transfereeuniqueid','diff','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','transfereruniqueid','seconds','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','[syncMusicOnHoldStart][VoiceAgentReport]','onhold','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','../../../config/logger','redis','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','emit','prototype','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','event','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','connect','holdtime','connectedlinenum','destchannelstate','destchannelstatedesc','destconnectedlinenum','custom:agentconnect','reason','answered_elsewhere','lastevent','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','agentringnoanswerAt','abandoned','custom:agentqueuecallerabandon','agentconnectAt','agentcompleteAt','complete','talktime','agent','agentacw','acwtime','interface','omit','user:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','variable','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt'];(function(_0x51b610,_0x396cdf){var _0x285073=function(_0x44be5f){while(--_0x44be5f){_0x51b610['push'](_0x51b610['shift']());}};_0x285073(++_0x396cdf);}(_0xc2d6,0x1eb));var _0x6c2d=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xc2d6[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x6c2d('0x0'));var moment=require(_0x6c2d('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x6c2d('0x2'))('ami');var ami=require('../ami');config[_0x6c2d('0x3')]=_['defaults'](config['redis'],{'host':_0x6c2d('0x4'),'port':0x18eb});var io=require(_0x6c2d('0x5'))(new Redis(config[_0x6c2d('0x3')]));function VoiceAgentReport(_0x9df9ba){this[_0x6c2d('0x6')]={};this[_0x6c2d('0x7')]=_0x9df9ba[_0x6c2d('0x7')];this[_0x6c2d('0x8')]=_0x9df9ba[_0x6c2d('0x8')];this[_0x6c2d('0x9')]={};ami['on'](_0x6c2d('0xa'),this[_0x6c2d('0xb')][_0x6c2d('0xc')](this));ami['on'](_0x6c2d('0xd'),this['syncAgentConnect']['bind'](this));ami['on'](_0x6c2d('0xe'),this[_0x6c2d('0xf')][_0x6c2d('0xc')](this));ami['on']('queuecallerabandon',this[_0x6c2d('0x10')][_0x6c2d('0xc')](this));ami['on'](_0x6c2d('0x11'),this[_0x6c2d('0x12')][_0x6c2d('0xc')](this));ami['on'](_0x6c2d('0x13'),this[_0x6c2d('0x14')][_0x6c2d('0xc')](this));ami['on'](_0x6c2d('0x15'),this[_0x6c2d('0x16')][_0x6c2d('0xc')](this));ami['on'](_0x6c2d('0x17'),this[_0x6c2d('0x18')][_0x6c2d('0xc')](this));ami['on']('musiconholdstop',this[_0x6c2d('0x19')][_0x6c2d('0xc')](this));ami['on'](_0x6c2d('0x1a'),this[_0x6c2d('0x1b')][_0x6c2d('0xc')](this));ami['on'](_0x6c2d('0x1c'),this['syncBlindTransfer']['bind'](this));}VoiceAgentReport['prototype'][_0x6c2d('0x1d')]=function(_0x38d029,_0x140e4f,_0xd3c5d2){io['to'](_0x38d029)[_0x6c2d('0x1d')](_0x140e4f,_0xd3c5d2);};VoiceAgentReport[_0x6c2d('0x1e')][_0x6c2d('0x1f')]=function(_0x2960f9){return _0x2960f9!==null&&!_[_0x6c2d('0x20')](_0x2960f9);};VoiceAgentReport[_0x6c2d('0x1e')][_0x6c2d('0xb')]=function(_0x565c90){try{if(this[_0x6c2d('0x1f')](_0x565c90)){if(_[_0x6c2d('0x20')](this['channels'][_0x565c90[_0x6c2d('0x21')]])){this[_0x6c2d('0x6')][_0x565c90[_0x6c2d('0x21')]]={};}if(_[_0x6c2d('0x20')](this[_0x6c2d('0x6')][_0x565c90['uniqueid']][_0x565c90['destuniqueid']])){this[_0x6c2d('0x6')][_0x565c90[_0x6c2d('0x21')]][_0x565c90[_0x6c2d('0x22')]]={'agentcalledAt':moment()[_0x6c2d('0x23')](_0x6c2d('0x24')),'lastevent':_0x6c2d('0x25'),'variables':this['variables'][_0x565c90[_0x6c2d('0x21')]],'type':this[_0x6c2d('0x7')][_0x565c90[_0x6c2d('0x26')]]?this[_0x6c2d('0x7')][_0x565c90[_0x6c2d('0x26')]][_0x6c2d('0x27')]||_0x6c2d('0x28'):_0x6c2d('0x28')};}_['merge'](this['channels'][_0x565c90[_0x6c2d('0x21')]][_0x565c90['destuniqueid']],_['omit'](_0x565c90,[_0x6c2d('0x29'),'privilege']));ami[_0x6c2d('0x1d')](_0x6c2d('0x2a'),this[_0x6c2d('0x6')][_0x565c90[_0x6c2d('0x21')]][_0x565c90['destuniqueid']]);this['emit'](util[_0x6c2d('0x23')](_0x6c2d('0x2b'),_0x565c90[_0x6c2d('0x2c')]),_0x6c2d('0x2d'),this[_0x6c2d('0x6')][_0x565c90[_0x6c2d('0x21')]][_0x565c90['destuniqueid']]);}}catch(_0x4f3b4f){logger[_0x6c2d('0x2e')](_0x6c2d('0x2f'),util[_0x6c2d('0x30')](_0x4f3b4f,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentConnect']=function(_0x3679ff){try{if(this[_0x6c2d('0x1f')](_0x3679ff)){if(this[_0x6c2d('0x6')][_0x3679ff['uniqueid']]){for(var _0x2e00d8 in this[_0x6c2d('0x6')][_0x3679ff[_0x6c2d('0x21')]]){if(this[_0x6c2d('0x6')][_0x3679ff[_0x6c2d('0x21')]]['hasOwnProperty'](_0x2e00d8)){if(_0x3679ff[_0x6c2d('0x22')]===_0x2e00d8){this['channels'][_0x3679ff[_0x6c2d('0x21')]][_0x2e00d8]['agentconnectAt']=moment()[_0x6c2d('0x23')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6c2d('0x6')][_0x3679ff['uniqueid']][_0x2e00d8]['lastevent']=_0x6c2d('0x31');this[_0x6c2d('0x6')][_0x3679ff[_0x6c2d('0x21')]][_0x2e00d8][_0x6c2d('0x32')]=_0x3679ff['holdtime'];this[_0x6c2d('0x6')][_0x3679ff['uniqueid']][_0x2e00d8][_0x6c2d('0x33')]=_0x3679ff[_0x6c2d('0x33')];this[_0x6c2d('0x6')][_0x3679ff[_0x6c2d('0x21')]][_0x2e00d8]['connectedlinename']=_0x3679ff['connectedlinename'];this[_0x6c2d('0x6')][_0x3679ff[_0x6c2d('0x21')]][_0x2e00d8][_0x6c2d('0x34')]=_0x3679ff[_0x6c2d('0x34')];this[_0x6c2d('0x6')][_0x3679ff['uniqueid']][_0x2e00d8][_0x6c2d('0x35')]=_0x3679ff[_0x6c2d('0x35')];_['merge'](this[_0x6c2d('0x8')][_0x3679ff['interface']],_['pick'](_0x3679ff,['queue',_0x6c2d('0x36')]));this[_0x6c2d('0x1d')](util[_0x6c2d('0x23')]('user:%s',_0x3679ff['membername']),'user:agentconnect',this[_0x6c2d('0x6')][_0x3679ff['uniqueid']][_0x3679ff[_0x6c2d('0x22')]]);ami['emit'](_0x6c2d('0x37'),this[_0x6c2d('0x6')][_0x3679ff['uniqueid']][_0x2e00d8]);}else if(!this[_0x6c2d('0x6')][_0x3679ff[_0x6c2d('0x21')]][_0x2e00d8]['agentringnoanswer']&&!this[_0x6c2d('0x6')][_0x3679ff[_0x6c2d('0x21')]][_0x2e00d8]['agentcomplete']){this['channels'][_0x3679ff[_0x6c2d('0x21')]][_0x2e00d8]['agentringnoanswer']=!![];this[_0x6c2d('0x6')][_0x3679ff[_0x6c2d('0x21')]][_0x2e00d8]['agentringnoanswerAt']=moment()[_0x6c2d('0x23')](_0x6c2d('0x24'));this['channels'][_0x3679ff[_0x6c2d('0x21')]][_0x2e00d8][_0x6c2d('0x38')]=_0x6c2d('0x39');this[_0x6c2d('0x6')][_0x3679ff[_0x6c2d('0x21')]][_0x2e00d8][_0x6c2d('0x3a')]=_0x6c2d('0x39');this['channels'][_0x3679ff[_0x6c2d('0x21')]][_0x2e00d8][_0x6c2d('0x3b')]=_0x3679ff['destuniqueid'];this[_0x6c2d('0x6')][_0x3679ff['uniqueid']][_0x2e00d8][_0x6c2d('0x3c')]=_0x3679ff[_0x6c2d('0x2c')];ami[_0x6c2d('0x1d')](_0x6c2d('0x3d'),this[_0x6c2d('0x6')][_0x3679ff['uniqueid']][_0x2e00d8]);}}}}}}catch(_0x38dff3){logger[_0x6c2d('0x2e')](_0x6c2d('0x3e'),util[_0x6c2d('0x30')](_0x38dff3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c2d('0x1e')][_0x6c2d('0xf')]=function(_0x5c981a){try{if(this[_0x6c2d('0x1f')](_0x5c981a)){if(this[_0x6c2d('0x6')][_0x5c981a[_0x6c2d('0x21')]]&&this['channels'][_0x5c981a['uniqueid']][_0x5c981a['destuniqueid']]){this[_0x6c2d('0x6')][_0x5c981a[_0x6c2d('0x21')]][_0x5c981a[_0x6c2d('0x22')]][_0x6c2d('0xe')]=!![];this[_0x6c2d('0x6')][_0x5c981a['uniqueid']][_0x5c981a[_0x6c2d('0x22')]]['agentringnoanswerAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6c2d('0x6')][_0x5c981a[_0x6c2d('0x21')]][_0x5c981a[_0x6c2d('0x22')]]['reason']='rejected';this[_0x6c2d('0x6')][_0x5c981a[_0x6c2d('0x21')]][_0x5c981a['destuniqueid']]['lastevent']=_0x6c2d('0x3f');ami[_0x6c2d('0x1d')](_0x6c2d('0x40'),this[_0x6c2d('0x6')][_0x5c981a[_0x6c2d('0x21')]][_0x5c981a['destuniqueid']]);}}}catch(_0x2fc5af){logger[_0x6c2d('0x2e')](_0x6c2d('0x41'),util[_0x6c2d('0x30')](_0x2fc5af,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncQueueCallerAbandon']=function(_0x267494){try{if(this[_0x6c2d('0x1f')](_0x267494)){if(this[_0x6c2d('0x6')][_0x267494['uniqueid']]){for(var _0x5af51d in this[_0x6c2d('0x6')][_0x267494[_0x6c2d('0x21')]]){if(this['channels'][_0x267494[_0x6c2d('0x21')]]['hasOwnProperty'](_0x5af51d)&&!this[_0x6c2d('0x6')][_0x267494[_0x6c2d('0x21')]][_0x5af51d][_0x6c2d('0xe')]&&!this['channels'][_0x267494[_0x6c2d('0x21')]][_0x5af51d][_0x6c2d('0x11')]){this[_0x6c2d('0x6')][_0x267494[_0x6c2d('0x21')]][_0x5af51d]['agentringnoanswer']=!![];this['channels'][_0x267494[_0x6c2d('0x21')]][_0x5af51d][_0x6c2d('0x42')]=moment()[_0x6c2d('0x23')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6c2d('0x6')][_0x267494['uniqueid']][_0x5af51d]['reason']=_0x6c2d('0x43');this[_0x6c2d('0x6')][_0x267494['uniqueid']][_0x5af51d]['lastevent']=_0x6c2d('0x43');ami[_0x6c2d('0x1d')](_0x6c2d('0x44'),this['channels'][_0x267494[_0x6c2d('0x21')]][_0x5af51d]);}}}}}catch(_0x3a11d5){logger[_0x6c2d('0x2e')]('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0x6c2d('0x30')](_0x3a11d5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c2d('0x1e')][_0x6c2d('0x12')]=function(_0x4f56d6){try{if(this['isNotNull'](_0x4f56d6)){if(this[_0x6c2d('0x6')][_0x4f56d6[_0x6c2d('0x21')]]){for(var _0x3e619a in this[_0x6c2d('0x6')][_0x4f56d6[_0x6c2d('0x21')]]){if(this['channels'][_0x4f56d6[_0x6c2d('0x21')]]['hasOwnProperty'](_0x3e619a)){if(this['channels'][_0x4f56d6[_0x6c2d('0x21')]][_0x3e619a][_0x6c2d('0x45')]&&!this[_0x6c2d('0x6')][_0x4f56d6[_0x6c2d('0x21')]][_0x3e619a]['agentcomplete']){this[_0x6c2d('0x6')][_0x4f56d6['uniqueid']][_0x3e619a]['agentcomplete']=!![];this[_0x6c2d('0x6')][_0x4f56d6['uniqueid']][_0x3e619a][_0x6c2d('0x46')]=moment()[_0x6c2d('0x23')](_0x6c2d('0x24'));this[_0x6c2d('0x6')][_0x4f56d6[_0x6c2d('0x21')]][_0x3e619a][_0x6c2d('0x3a')]=_0x6c2d('0x47');this[_0x6c2d('0x6')][_0x4f56d6[_0x6c2d('0x21')]][_0x3e619a][_0x6c2d('0x48')]=_0x4f56d6['talktime'];this[_0x6c2d('0x6')][_0x4f56d6['uniqueid']][_0x3e619a][_0x6c2d('0x38')]=_0x4f56d6[_0x6c2d('0x38')]=='transfer'?_0x6c2d('0x49'):_0x4f56d6[_0x6c2d('0x38')];if(this[_0x6c2d('0x7')][_0x4f56d6['queue']]&&this[_0x6c2d('0x7')][_0x4f56d6[_0x6c2d('0x26')]]['acw']){this['channels'][_0x4f56d6[_0x6c2d('0x21')]][_0x3e619a][_0x6c2d('0x4a')]=!![];this[_0x6c2d('0x6')][_0x4f56d6['uniqueid']][_0x3e619a][_0x6c2d('0x4b')]=this['voiceQueues'][_0x4f56d6[_0x6c2d('0x26')]]['acwTimeout'];}this[_0x6c2d('0x8')][_0x4f56d6[_0x6c2d('0x4c')]]=_[_0x6c2d('0x4d')](this[_0x6c2d('0x8')][_0x4f56d6[_0x6c2d('0x4c')]],['queue',_0x6c2d('0x36')]);this['emit'](util[_0x6c2d('0x23')]('user:%s',_0x4f56d6['membername']),_0x6c2d('0x4e'),this['channels'][_0x4f56d6[_0x6c2d('0x21')]][_0x3e619a]);ami[_0x6c2d('0x1d')]('custom:agentcomplete',this[_0x6c2d('0x6')][_0x4f56d6[_0x6c2d('0x21')]][_0x3e619a]);}}}}}}catch(_0x5de06b){logger[_0x6c2d('0x2e')](_0x6c2d('0x4f'),util[_0x6c2d('0x30')](_0x5de06b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c2d('0x1e')]['syncVarSet']=function(_0x1eae95){try{if(this[_0x6c2d('0x1f')](_0x1eae95)){this[_0x6c2d('0x50')](_0x1eae95[_0x6c2d('0x21')],_['keys'](_0x1eae95[_0x6c2d('0x51')])[0x0],_0x1eae95['value']);if(this['channels'][_0x1eae95[_0x6c2d('0x21')]]){for(var _0x48c10d in this[_0x6c2d('0x6')][_0x1eae95[_0x6c2d('0x21')]]){if(this['channels'][_0x1eae95['uniqueid']]['hasOwnProperty'](_0x48c10d)){if(_[_0x6c2d('0x20')](this[_0x6c2d('0x6')][_0x1eae95[_0x6c2d('0x21')]][_0x48c10d]['variables'])){this['channels'][_0x1eae95['uniqueid']][_0x48c10d][_0x6c2d('0x9')]={};}this[_0x6c2d('0x6')][_0x1eae95['uniqueid']][_0x48c10d][_0x6c2d('0x9')]=this[_0x6c2d('0x9')][_0x1eae95[_0x6c2d('0x21')]];}}}}}catch(_0x5d01c0){logger[_0x6c2d('0x2e')](_0x6c2d('0x52'),util[_0x6c2d('0x30')](_0x5d01c0,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6c2d('0x50')]=function(_0x9a95a1,_0x173e16,_0x5430ea){var _0x4de132=[_0x6c2d('0x53'),_0x6c2d('0x54'),_0x6c2d('0x55'),'rtpaudioqosjitterbridged',_0x6c2d('0x56'),_0x6c2d('0x57'),_0x6c2d('0x58'),_0x6c2d('0x59'),_0x6c2d('0x5a'),'sipuri',_0x6c2d('0x5b'),'bridgepvtcallid',_0x6c2d('0x5c'),_0x6c2d('0x5d'),_0x6c2d('0x5e'),'memberlastcall','membername','memberpenalty',_0x6c2d('0x5f')];if(!_['isNil'](_0x173e16)&&!_[_0x6c2d('0x60')](_0x4de132,_0x173e16)){if(_[_0x6c2d('0x20')](this['variables'][_0x9a95a1])){this[_0x6c2d('0x9')][_0x9a95a1]={};}this[_0x6c2d('0x9')][_0x9a95a1][_0x173e16]=_0x5430ea;}};VoiceAgentReport['prototype'][_0x6c2d('0x16')]=function(_0x17d071){try{if(this['isNotNull'](_0x17d071)){if(this[_0x6c2d('0x6')][_0x17d071[_0x6c2d('0x21')]]){for(var _0x3dc1d2 in this['channels'][_0x17d071[_0x6c2d('0x21')]]){if(this[_0x6c2d('0x6')][_0x17d071['uniqueid']][_0x6c2d('0x61')](_0x3dc1d2)){if(this[_0x6c2d('0x6')][_0x17d071[_0x6c2d('0x21')]][_0x3dc1d2]['reason']==_0x6c2d('0x62')&&this['channels'][_0x17d071[_0x6c2d('0x21')]][_0x3dc1d2][_0x6c2d('0x11')]){this[_0x6c2d('0x6')][_0x17d071[_0x6c2d('0x21')]][_0x3dc1d2][_0x6c2d('0x46')]=moment()[_0x6c2d('0x23')](_0x6c2d('0x24'));}}}ami[_0x6c2d('0x1d')](_0x6c2d('0x63'),_[_0x6c2d('0x64')](this[_0x6c2d('0x6')][_0x17d071[_0x6c2d('0x21')]]));delete this[_0x6c2d('0x6')][_0x17d071[_0x6c2d('0x21')]];}if(this[_0x6c2d('0x9')][_0x17d071[_0x6c2d('0x21')]]){delete this[_0x6c2d('0x9')][_0x17d071[_0x6c2d('0x21')]];}}}catch(_0x18f395){logger[_0x6c2d('0x2e')]('[syncHangup][VoiceAgentReport]',util['inspect'](_0x18f395,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c2d('0x1e')][_0x6c2d('0x1b')]=function(_0x3b99e8){try{if(this['isNotNull'](_0x3b99e8)){if(this[_0x6c2d('0x6')][_0x3b99e8[_0x6c2d('0x65')]]){for(var _0x339918 in this['channels'][_0x3b99e8[_0x6c2d('0x65')]]){if(this['channels'][_0x3b99e8[_0x6c2d('0x65')]][_0x6c2d('0x61')](_0x339918)){if(_0x3b99e8['origtransfereruniqueid']===_0x339918){var _0x3514e7=moment();this['channels'][_0x3b99e8['transfereeuniqueid']][_0x339918][_0x6c2d('0x11')]=!![];this['channels'][_0x3b99e8['transfereeuniqueid']][_0x339918]['agentcompleteAt']=moment()[_0x6c2d('0x23')](_0x6c2d('0x24'));this[_0x6c2d('0x6')][_0x3b99e8[_0x6c2d('0x65')]][_0x339918][_0x6c2d('0x38')]=_0x6c2d('0x62');this[_0x6c2d('0x6')][_0x3b99e8['transfereeuniqueid']][_0x339918][_0x6c2d('0x3a')]='complete';this[_0x6c2d('0x6')][_0x3b99e8[_0x6c2d('0x65')]][_0x339918][_0x6c2d('0x48')]=_0x3514e7[_0x6c2d('0x66')](this[_0x6c2d('0x6')][_0x3b99e8['transfereeuniqueid']][_0x339918]['agentconnectAt'],'seconds');}}}}if(this[_0x6c2d('0x6')][_0x3b99e8[_0x6c2d('0x67')]]){var _0x2543ba=this[_0x6c2d('0x6')][_0x3b99e8[_0x6c2d('0x67')]];this[_0x6c2d('0x6')][_0x3b99e8[_0x6c2d('0x67')]]=this[_0x6c2d('0x6')][_0x3b99e8[_0x6c2d('0x65')]];this[_0x6c2d('0x6')][_0x3b99e8['transfereeuniqueid']]=_0x2543ba;}}}catch(_0x4d298e){logger[_0x6c2d('0x2e')](_0x6c2d('0x68'),util['inspect'](_0x4d298e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c2d('0x1e')][_0x6c2d('0x69')]=function(_0x7e6560){try{if(this[_0x6c2d('0x1f')](_0x7e6560)){if(this[_0x6c2d('0x6')][_0x7e6560['transfereeuniqueid']]){for(var _0x4bf65c in this[_0x6c2d('0x6')][_0x7e6560[_0x6c2d('0x65')]]){if(this[_0x6c2d('0x6')][_0x7e6560[_0x6c2d('0x65')]][_0x6c2d('0x61')](_0x4bf65c)){if(_0x7e6560[_0x6c2d('0x6a')]===_0x4bf65c){var _0x5596de=moment();this['channels'][_0x7e6560[_0x6c2d('0x65')]][_0x4bf65c][_0x6c2d('0x11')]=!![];this[_0x6c2d('0x6')][_0x7e6560['transfereeuniqueid']][_0x4bf65c][_0x6c2d('0x46')]=_0x5596de;this[_0x6c2d('0x6')][_0x7e6560[_0x6c2d('0x65')]][_0x4bf65c][_0x6c2d('0x38')]=_0x6c2d('0x62');this[_0x6c2d('0x6')][_0x7e6560[_0x6c2d('0x65')]][_0x4bf65c][_0x6c2d('0x3a')]=_0x6c2d('0x47');this['channels'][_0x7e6560[_0x6c2d('0x65')]][_0x4bf65c]['talktime']=_0x5596de[_0x6c2d('0x66')](this[_0x6c2d('0x6')][_0x7e6560[_0x6c2d('0x65')]][_0x4bf65c]['agentconnectAt'],_0x6c2d('0x6b'));}}}}}}catch(_0x487146){logger[_0x6c2d('0x2e')](_0x6c2d('0x6c'),util['inspect'](_0x487146,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6c2d('0x18')]=function(_0x27a478){var _0x5123f2='';try{if(this['isNotNull'](_0x27a478)){if(_0x27a478[_0x6c2d('0x6d')]){_0x5123f2=_0x27a478['channel'][_0x6c2d('0x6e')](0x0,_0x27a478[_0x6c2d('0x6d')][_0x6c2d('0x6f')]('-'));if(this['agents'][_0x5123f2]){this[_0x6c2d('0x8')][_0x5123f2]['onhold']=!![];}}}}catch(_0xe72fa2){logger[_0x6c2d('0x2e')](_0x6c2d('0x70'),util[_0x6c2d('0x30')](_0xe72fa2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c2d('0x1e')][_0x6c2d('0x19')]=function(_0x4a672e){var _0x24f9bf='';try{if(this[_0x6c2d('0x1f')](_0x4a672e)){if(_0x4a672e['channel']){_0x24f9bf=_0x4a672e[_0x6c2d('0x6d')][_0x6c2d('0x6e')](0x0,_0x4a672e[_0x6c2d('0x6d')][_0x6c2d('0x6f')]('-'));if(this['agents'][_0x24f9bf]){this['agents'][_0x24f9bf][_0x6c2d('0x71')]=![];}}}}catch(_0x437ef2){logger[_0x6c2d('0x2e')](_0x6c2d('0x72'),util[_0x6c2d('0x30')](_0x437ef2,{'showHidden':![],'depth':null}));}};module[_0x6c2d('0x73')]=VoiceAgentReport;
\ No newline at end of file
index 3bc4dce..aef39a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc19f=['value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','type','xmd-queue','originatecalleridnum','xmd-destination','xmd-callerid-preview','calleridpreview','xmcs-queue','parse','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','syncHangup','endtime','diff','answertime','billableseconds','context','destconnectedlinenum','user:agentcomplete','custom:voiceCallReport','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','mohstarttime','exports','bluebird','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','unavailable','ringing','onhold','queue','agi','dial','playback','NO\x20ANSWER','FAILED','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','bind','newexten','syncNewExten','newchannel','syncNewChannel','syncNewState','syncVarSet','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','actionCoreShowChannels','log','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','merge','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','channel','OutgoingSpoolFailed','starttime','format','disposition','toNumber','channelstate','pick','from-sip','split','exten','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','application','toLowerCase','appdata','applicationdata','subtract','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','answered','holdtime','calleridnum','connectedlinenum','connectedlinename','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','variable','mixmonitor_filename'];(function(_0x408e38,_0x23cda8){var _0x426b0e=function(_0x8f2898){while(--_0x8f2898){_0x408e38['push'](_0x408e38['shift']());}};_0x426b0e(++_0x23cda8);}(_0xc19f,0xbc));var _0xfc19=function(_0x1573d9,_0x3c39b4){_0x1573d9=_0x1573d9-0x0;var _0x5bd6af=_0xc19f[_0x1573d9];return _0x5bd6af;};'use strict';var BPromise=require(_0xfc19('0x0'));var _=require('lodash');var moment=require(_0xfc19('0x1'));var util=require(_0xfc19('0x2'));var path=require(_0xfc19('0x3'));var Redis=require(_0xfc19('0x4'));var config=require(_0xfc19('0x5'));var logger=require(_0xfc19('0x6'))(_0xfc19('0x7'));var ami=require(_0xfc19('0x8'));var Channel=require(_0xfc19('0x9'));var statusDesc=[_0xfc19('0xa'),_0xfc19('0xb'),_0xfc19('0xc'),_0xfc19('0xd'),'invalid',_0xfc19('0xe'),_0xfc19('0xf'),'ringinuse',_0xfc19('0x10')];var applications=['set',_0xfc19('0x11'),_0xfc19('0x12'),_0xfc19('0x13'),_0xfc19('0x14'),'voicemail'];var dispositions=[_0xfc19('0x15'),'FAILED',_0xfc19('0x16'),'NO\x20ANSWER','NO\x20ANSWER','NO\x20ANSWER','ANSWERED','BUSY',_0xfc19('0x16'),_0xfc19('0x16'),_0xfc19('0x16')];var actions={};config[_0xfc19('0x17')]=_[_0xfc19('0x18')](config['redis'],{'host':_0xfc19('0x19'),'port':0x18eb});var io=require(_0xfc19('0x1a'))(new Redis(config['redis']));function VoiceCallReport(_0x20f708){this[_0xfc19('0x1b')]=_0x20f708['channels'];this['agents']=_0x20f708[_0xfc19('0x1c')];ami['on'](_0xfc19('0x1d'),this['syncNewExten'][_0xfc19('0x1e')](this));ami['on'](_0xfc19('0x1f'),this[_0xfc19('0x20')]['bind'](this));ami['on'](_0xfc19('0x21'),this[_0xfc19('0x22')]['bind'](this));ami['on']('newstate',this[_0xfc19('0x23')][_0xfc19('0x1e')](this));ami['on']('varset',this[_0xfc19('0x24')][_0xfc19('0x1e')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xfc19('0x25'),this[_0xfc19('0x26')][_0xfc19('0x1e')](this));ami['on'](_0xfc19('0x27'),this[_0xfc19('0x28')][_0xfc19('0x1e')](this));ami['on'](_0xfc19('0x29'),this[_0xfc19('0x2a')][_0xfc19('0x1e')](this));ami['on'](_0xfc19('0x2b'),this[_0xfc19('0x2c')][_0xfc19('0x1e')](this));ami['on'](_0xfc19('0x2d'),this[_0xfc19('0x2e')][_0xfc19('0x1e')](this));return BPromise['resolve']()['then'](ami[_0xfc19('0x2f')]())['catch'](function(_0xa7172b){console[_0xfc19('0x30')](_0xa7172b);});}VoiceCallReport[_0xfc19('0x31')][_0xfc19('0x32')]=function(_0x1ece6d){return _0x1ece6d!==null&&!_[_0xfc19('0x33')](_0x1ece6d);};VoiceCallReport[_0xfc19('0x31')]['emit']=function(_0x2f359e,_0x63063c,_0x462fd8){io['to'](_0x2f359e)[_0xfc19('0x34')](_0x63063c,_0x462fd8);};VoiceCallReport[_0xfc19('0x31')]['syncNewCallerId']=function(_0x16c07c){try{if(this[_0xfc19('0x32')](_0x16c07c)){if(_0x16c07c[_0xfc19('0x35')]===_0x16c07c[_0xfc19('0x36')]){if(!_[_0xfc19('0x33')](this[_0xfc19('0x1b')][_0x16c07c['uniqueid']])){_[_0xfc19('0x37')](this['channels'][_0x16c07c['uniqueid']],_['pick'](_0x16c07c,_[_0xfc19('0x38')](this[_0xfc19('0x1b')][_0x16c07c[_0xfc19('0x35')]])));}}}}catch(_0x5a9829){logger[_0xfc19('0x39')](_0xfc19('0x3a'),util[_0xfc19('0x3b')](_0x5a9829,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfc19('0x31')][_0xfc19('0x22')]=function(_0x2a4bc6){try{if(this[_0xfc19('0x32')](_0x2a4bc6)){if(_0x2a4bc6['uniqueid']===_0x2a4bc6[_0xfc19('0x36')]&&_0x2a4bc6[_0xfc19('0x3c')]!=_0xfc19('0x3d')){if(_[_0xfc19('0x33')](this[_0xfc19('0x1b')][_0x2a4bc6['uniqueid']])){this['channels'][_0x2a4bc6['uniqueid']]=new Channel();this[_0xfc19('0x1b')][_0x2a4bc6[_0xfc19('0x35')]][_0xfc19('0x3e')]=moment()[_0xfc19('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x2a4bc6[_0xfc19('0x35')]][_0xfc19('0x40')]=dispositions[_[_0xfc19('0x41')](_0x2a4bc6[_0xfc19('0x42')])];_[_0xfc19('0x37')](this[_0xfc19('0x1b')][_0x2a4bc6[_0xfc19('0x35')]],_[_0xfc19('0x43')](_0x2a4bc6,_[_0xfc19('0x38')](this[_0xfc19('0x1b')][_0x2a4bc6[_0xfc19('0x35')]])));if(_0x2a4bc6['context']===_0xfc19('0x44')){if(this[_0xfc19('0x1c')][_0x2a4bc6[_0xfc19('0x3c')][_0xfc19('0x45')]('-')[0x0]]){this[_0xfc19('0x1c')][_0x2a4bc6[_0xfc19('0x3c')]['split']('-')[0x0]]['destconnectedlinenum']=_0x2a4bc6[_0xfc19('0x46')];this['emit'](util[_0xfc19('0x3f')](_0xfc19('0x47'),this['agents'][_0x2a4bc6[_0xfc19('0x3c')]['split']('-')[0x0]][_0xfc19('0x48')]),_0xfc19('0x49'),{'destaccountcode':this[_0xfc19('0x1c')][_0x2a4bc6[_0xfc19('0x3c')][_0xfc19('0x45')]('-')[0x0]][_0xfc19('0x4a')],'destconnectedlinenum':_0x2a4bc6[_0xfc19('0x46')]});}}}}}}catch(_0x118e50){logger[_0xfc19('0x39')](_0xfc19('0x4b'),util[_0xfc19('0x3b')](_0x118e50,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xfc19('0x20')]=function(_0x3b44d5){try{if(this[_0xfc19('0x32')](_0x3b44d5)){if(_0x3b44d5[_0xfc19('0x35')]===_0x3b44d5[_0xfc19('0x36')]&&_0x3b44d5[_0xfc19('0x46')]!='h'&&_0x3b44d5['channel']!=_0xfc19('0x3d')){_0x3b44d5[_0xfc19('0x4c')]=_0x3b44d5[_0xfc19('0x4c')][_0xfc19('0x4d')]();_0x3b44d5['applicationdata']=(_0x3b44d5[_0xfc19('0x4e')]||_0x3b44d5[_0xfc19('0x4f')])['toLowerCase']();if(_['isUndefined'](this[_0xfc19('0x1b')][_0x3b44d5['uniqueid']])){this[_0xfc19('0x1b')][_0x3b44d5[_0xfc19('0x35')]]=new Channel();this[_0xfc19('0x1b')][_0x3b44d5[_0xfc19('0x35')]][_0xfc19('0x3e')]=_0x3b44d5['duration']?moment()[_0xfc19('0x50')](moment[_0xfc19('0x51')](_0x3b44d5[_0xfc19('0x51')])[_0xfc19('0x52')](),_0xfc19('0x52'))[_0xfc19('0x3f')](_0xfc19('0x53')):moment()[_0xfc19('0x3f')](_0xfc19('0x53'));this[_0xfc19('0x1b')][_0x3b44d5['uniqueid']][_0xfc19('0x40')]=_0xfc19('0x15');}_[_0xfc19('0x37')](this[_0xfc19('0x1b')][_0x3b44d5[_0xfc19('0x35')]],_[_0xfc19('0x43')](_0x3b44d5,_[_0xfc19('0x38')](this['channels'][_0x3b44d5[_0xfc19('0x35')]])));if(_['includes'](applications,_0x3b44d5[_0xfc19('0x4c')])){this[_0xfc19('0x1b')][_0x3b44d5[_0xfc19('0x35')]]['lastapplication']=_0x3b44d5[_0xfc19('0x4c')];this[_0xfc19('0x1b')][_0x3b44d5['uniqueid']]['lastdata']=_0x3b44d5[_0xfc19('0x4f')];if(_0x3b44d5[_0xfc19('0x4c')]==='set'&&_[_0xfc19('0x54')](_0x3b44d5[_0xfc19('0x4f')],_0xfc19('0x55'))){var _0x59513e=_0x3b44d5[_0xfc19('0x4f')][_0xfc19('0x45')]('=');var _0x5bd99e=_0x59513e[0x0][_0xfc19('0x56')](/cdr\((.*)\)/);if(_0x5bd99e){this[_0xfc19('0x1b')][_0x3b44d5[_0xfc19('0x35')]][_0x5bd99e[0x1]]=_0x59513e[0x1];}}else if(_0x3b44d5[_0xfc19('0x4c')]===_0xfc19('0x11')){this['channels'][_0x3b44d5[_0xfc19('0x35')]]['queue']=_0x3b44d5[_0xfc19('0x4f')][_0xfc19('0x45')](',')[0x0];}}}}}catch(_0x2e59d4){logger[_0xfc19('0x39')](_0xfc19('0x57'),util['inspect'](_0x2e59d4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfc19('0x31')][_0xfc19('0x23')]=function(_0x599e47){try{if(this[_0xfc19('0x32')](_0x599e47)){if(_0x599e47[_0xfc19('0x35')]!==_0x599e47[_0xfc19('0x36')]){if(this['channels'][_0x599e47['linkedid']]){if(_0x599e47[_0xfc19('0x42')]==='6'){if(!this[_0xfc19('0x1b')][_0x599e47[_0xfc19('0x36')]]['answered']){var _0x3a2d9c=moment();this[_0xfc19('0x1b')][_0x599e47[_0xfc19('0x36')]][_0xfc19('0x58')]=!![];this['channels'][_0x599e47[_0xfc19('0x36')]]['answertime']=_0x3a2d9c[_0xfc19('0x3f')](_0xfc19('0x53'));if(this[_0xfc19('0x1b')][_0x599e47[_0xfc19('0x36')]][_0xfc19('0x3e')]){this[_0xfc19('0x1b')][_0x599e47['linkedid']][_0xfc19('0x59')]=_0x3a2d9c['diff'](this[_0xfc19('0x1b')][_0x599e47[_0xfc19('0x36')]]['starttime'],'seconds');}}this[_0xfc19('0x1b')][_0x599e47[_0xfc19('0x36')]]['linkedid']=_0x599e47[_0xfc19('0x35')];if(_0x599e47[_0xfc19('0x5a')]!=='xcally-motion-preview'){this['channels'][_0x599e47[_0xfc19('0x36')]][_0xfc19('0x5b')]=_0x599e47['calleridnum'];}this[_0xfc19('0x1b')][_0x599e47[_0xfc19('0x36')]][_0xfc19('0x5c')]=_0x599e47[_0xfc19('0x5d')];this['channels'][_0x599e47[_0xfc19('0x36')]][_0xfc19('0x5e')]=_0x599e47[_0xfc19('0x3c')];this[_0xfc19('0x1b')][_0x599e47['linkedid']][_0xfc19('0x40')]=dispositions[_['toNumber'](_0x599e47['channelstate'])];if(this[_0xfc19('0x1c')][_0x599e47[_0xfc19('0x3c')][_0xfc19('0x45')]('-')[0x0]]){this['channels'][_0x599e47['linkedid']][_0xfc19('0x5f')]=this['agents'][_0x599e47[_0xfc19('0x3c')][_0xfc19('0x45')]('-')[0x0]]['id'];this[_0xfc19('0x1b')][_0x599e47[_0xfc19('0x36')]][_0xfc19('0x60')]=this[_0xfc19('0x1c')][_0x599e47['channel']['split']('-')[0x0]][_0xfc19('0x48')];}}}}else{if(this['channels'][_0x599e47[_0xfc19('0x35')]]){if(_0x599e47[_0xfc19('0x42')]==='6'){if(this['agents'][_0x599e47[_0xfc19('0x3c')][_0xfc19('0x45')]('-')[0x0]]){this[_0xfc19('0x1b')][_0x599e47[_0xfc19('0x35')]]['UserId']=this[_0xfc19('0x1c')][_0x599e47[_0xfc19('0x3c')][_0xfc19('0x45')]('-')[0x0]]['id'];this[_0xfc19('0x1b')][_0x599e47['uniqueid']]['membername']=this['agents'][_0x599e47[_0xfc19('0x3c')][_0xfc19('0x45')]('-')[0x0]][_0xfc19('0x48')];}}}}}}catch(_0x2569d6){logger['error'](_0xfc19('0x61'),util[_0xfc19('0x3b')](_0x2569d6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfc19('0x31')][_0xfc19('0x62')]=function(_0x3c9ce7,_0x17ee93){if(this['channels'][_0x3c9ce7]){this[_0xfc19('0x1b')][_0x3c9ce7][_0xfc19('0x63')]=!![];if(_[_0xfc19('0x64')](_0x17ee93,_0xfc19('0x65'))){_0x17ee93=_0x17ee93[_0xfc19('0x66')](_0xfc19('0x65'),_0xfc19('0x67'));}this[_0xfc19('0x1b')][_0x3c9ce7][_0xfc19('0x68')]=_0x17ee93;var _0x43e840=_[_0xfc19('0x69')](this['channels'][_0x3c9ce7][_0xfc19('0x6a')],{'filename':_0x17ee93});if(_[_0xfc19('0x6b')](_0x43e840)){this[_0xfc19('0x1b')][_0x3c9ce7]['monitors']['push']({'filename':_0x17ee93,'createdAt':moment()[_0xfc19('0x3f')](_0xfc19('0x53')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0xfc19('0x31')]['syncVarSet']=function(_0x1ffcd4){try{if(this['isNotNull'](_0x1ffcd4)){if(this[_0xfc19('0x1b')][_0x1ffcd4['uniqueid']]&&_0x1ffcd4[_0xfc19('0x3c')]!='OutgoingSpoolFailed'){if(this[_0xfc19('0x32')](_0x1ffcd4[_0xfc19('0x6c')])){if(this[_0xfc19('0x32')](_0x1ffcd4[_0xfc19('0x6c')][_0xfc19('0x6d')])){this[_0xfc19('0x62')](_0x1ffcd4[_0xfc19('0x35')],_0x1ffcd4[_0xfc19('0x6e')]);}else if(this[_0xfc19('0x32')](_0x1ffcd4[_0xfc19('0x6c')][_0xfc19('0x6f')])){this[_0xfc19('0x1b')][_0x1ffcd4[_0xfc19('0x35')]][_0xfc19('0x5a')]=_0x1ffcd4[_0xfc19('0x6e')];}else if(this['isNotNull'](_0x1ffcd4[_0xfc19('0x6c')][_0xfc19('0x70')])){this[_0xfc19('0x1b')][_0x1ffcd4[_0xfc19('0x35')]][_0xfc19('0x71')]=_0x1ffcd4['value'];}else if(this[_0xfc19('0x32')](_0x1ffcd4[_0xfc19('0x6c')][_0xfc19('0x72')])){this[_0xfc19('0x1b')][_0x1ffcd4[_0xfc19('0x35')]][_0xfc19('0x73')]=_0x1ffcd4['value'];}else if(this['isNotNull'](_0x1ffcd4['variable'][_0xfc19('0x74')])){this[_0xfc19('0x1b')][_0x1ffcd4[_0xfc19('0x35')]]['queue']=_0x1ffcd4[_0xfc19('0x6e')][_0xfc19('0x45')](',')[0x0];}else if(this[_0xfc19('0x32')](_0x1ffcd4[_0xfc19('0x6c')]['xmd-originatecalleridnum'])){this[_0xfc19('0x1b')][_0x1ffcd4[_0xfc19('0x35')]][_0xfc19('0x75')]=_0x1ffcd4[_0xfc19('0x6e')];}else if(this[_0xfc19('0x32')](_0x1ffcd4['variable'][_0xfc19('0x76')])){this[_0xfc19('0x1b')][_0x1ffcd4['uniqueid']]['destination']=_0x1ffcd4[_0xfc19('0x6e')];}else if(this[_0xfc19('0x32')](_0x1ffcd4['variable'][_0xfc19('0x77')])){this[_0xfc19('0x1b')][_0x1ffcd4['uniqueid']][_0xfc19('0x78')]=_0x1ffcd4[_0xfc19('0x6e')];}else if(this[_0xfc19('0x32')](_0x1ffcd4[_0xfc19('0x6c')][_0xfc19('0x79')])){this[_0xfc19('0x1b')][_0x1ffcd4[_0xfc19('0x35')]][_0xfc19('0x11')]=_0x1ffcd4['value'];}else if(this[_0xfc19('0x32')](_0x1ffcd4[_0xfc19('0x6c')]['sipcallid'])){this['channels'][_0x1ffcd4[_0xfc19('0x35')]]['sipcalluniqueid']=_0x1ffcd4[_0xfc19('0x6e')];}}}else if(this[_0xfc19('0x32')](_0x1ffcd4[_0xfc19('0x6c')][_0xfc19('0x6d')])){if(_0x1ffcd4[_0xfc19('0x6e')]){var _0x3476f0=path[_0xfc19('0x7a')](_0x1ffcd4[_0xfc19('0x6e')])[_0xfc19('0x48')];this[_0xfc19('0x62')](_0x3476f0,_0x1ffcd4[_0xfc19('0x6e')]);}}else if(this[_0xfc19('0x1b')][_0x1ffcd4[_0xfc19('0x36')]]){if(this['isNotNull'](_0x1ffcd4[_0xfc19('0x6c')])){if(this[_0xfc19('0x32')](_0x1ffcd4['variable'][_0xfc19('0x7b')])){this[_0xfc19('0x1b')][_0x1ffcd4[_0xfc19('0x36')]][_0xfc19('0x7c')]=_0x1ffcd4[_0xfc19('0x6e')];}}}}}catch(_0x336d78){logger[_0xfc19('0x39')](_0xfc19('0x7d'),util[_0xfc19('0x3b')](_0x336d78,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfc19('0x31')][_0xfc19('0x7e')]=function(_0x231c87){try{if(this[_0xfc19('0x32')](_0x231c87)){if(this['channels'][_0x231c87[_0xfc19('0x35')]]){var _0x341bcf=moment();this[_0xfc19('0x1b')][_0x231c87[_0xfc19('0x35')]][_0xfc19('0x7f')]=_0x341bcf['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xfc19('0x1b')][_0x231c87[_0xfc19('0x35')]]['duration']=_0x341bcf['diff'](this[_0xfc19('0x1b')][_0x231c87[_0xfc19('0x35')]][_0xfc19('0x3e')],_0xfc19('0x52'));if(this[_0xfc19('0x1b')][_0x231c87['uniqueid']][_0xfc19('0x58')]){this[_0xfc19('0x1b')][_0x231c87[_0xfc19('0x35')]]['billableseconds']=_0x341bcf[_0xfc19('0x80')](this[_0xfc19('0x1b')][_0x231c87[_0xfc19('0x35')]][_0xfc19('0x81')],_0xfc19('0x52'));this[_0xfc19('0x1b')][_0x231c87['uniqueid']][_0xfc19('0x59')]=this[_0xfc19('0x1b')][_0x231c87[_0xfc19('0x35')]]['duration']-this[_0xfc19('0x1b')][_0x231c87[_0xfc19('0x35')]][_0xfc19('0x82')];}if(_0x231c87[_0xfc19('0x83')]===_0xfc19('0x44')){if(this['agents'][_0x231c87['channel']['split']('-')[0x0]]){this['agents'][_0x231c87[_0xfc19('0x3c')][_0xfc19('0x45')]('-')[0x0]]=_['omit'](this[_0xfc19('0x1c')][_0x231c87[_0xfc19('0x3c')][_0xfc19('0x45')]('-')[0x0]],[_0xfc19('0x84')]);this['emit'](util['format'](_0xfc19('0x47'),this[_0xfc19('0x1c')][_0x231c87['channel'][_0xfc19('0x45')]('-')[0x0]][_0xfc19('0x48')]),_0xfc19('0x85'),{'destaccountcode':this[_0xfc19('0x1c')][_0x231c87[_0xfc19('0x3c')][_0xfc19('0x45')]('-')[0x0]]['accountcode']});}}ami[_0xfc19('0x34')](_0xfc19('0x86'),this[_0xfc19('0x1b')][_0x231c87[_0xfc19('0x35')]]);delete this[_0xfc19('0x1b')][_0x231c87[_0xfc19('0x35')]];}}}catch(_0x49d226){logger['error']('[syncHangup][VoiceCallReport]',util['inspect'](_0x49d226,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfc19('0x31')][_0xfc19('0x28')]=function(_0xfb9a60){try{if(this['isNotNull'](_0xfb9a60)){if(this['channels'][_0xfb9a60[_0xfc19('0x87')]]){this['channels'][_0xfb9a60[_0xfc19('0x87')]][_0xfc19('0x88')]=_0xfb9a60[_0xfc19('0x89')];this[_0xfc19('0x1b')][_0xfb9a60[_0xfc19('0x87')]]['transferconnectedlinenum']=_0xfb9a60[_0xfc19('0x8a')];if(this[_0xfc19('0x1b')][_0xfb9a60[_0xfc19('0x8b')]]){var _0x1e3419=this[_0xfc19('0x1b')][_0xfb9a60[_0xfc19('0x8b')]];this['channels'][_0xfb9a60[_0xfc19('0x8b')]]=this['channels'][_0xfb9a60[_0xfc19('0x87')]];this['channels'][_0xfb9a60[_0xfc19('0x87')]]=_0x1e3419;}}else if(this['channels'][_0xfb9a60['transfertargetuniqueid']]){this['channels'][_0xfb9a60[_0xfc19('0x8c')]]['transfercalleridnum']=_0xfb9a60[_0xfc19('0x89')];this[_0xfc19('0x1b')][_0xfb9a60[_0xfc19('0x8c')]][_0xfc19('0x8d')]=_0xfb9a60[_0xfc19('0x8a')];if(this[_0xfc19('0x1b')][_0xfb9a60[_0xfc19('0x8e')]]){var _0x1e3419=this['channels'][_0xfb9a60[_0xfc19('0x8e')]];this[_0xfc19('0x1b')][_0xfb9a60[_0xfc19('0x8e')]]=this[_0xfc19('0x1b')][_0xfb9a60[_0xfc19('0x8c')]];this[_0xfc19('0x1b')][_0xfb9a60[_0xfc19('0x8c')]]=_0x1e3419;}}}}catch(_0x276577){logger['error'](_0xfc19('0x8f'),util[_0xfc19('0x3b')](_0x276577,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfc19('0x31')][_0xfc19('0x2a')]=function(_0x685a21){try{if(this['isNotNull'](_0x685a21)){if(this[_0xfc19('0x1b')][_0x685a21[_0xfc19('0x87')]]){this[_0xfc19('0x1b')][_0x685a21[_0xfc19('0x87')]][_0xfc19('0x88')]=_0x685a21[_0xfc19('0x90')];this[_0xfc19('0x1b')][_0x685a21['transfereeuniqueid']][_0xfc19('0x8d')]=_0x685a21[_0xfc19('0x91')];this[_0xfc19('0x7e')]({'event':_0xfc19('0x92'),'uniqueid':_0x685a21['transfereeuniqueid'],'context':_0x685a21[_0xfc19('0x83')],'channel':_0x685a21['transfererchannel']});}}}catch(_0x331a0a){logger[_0xfc19('0x39')]('[syncBlindTransfer][VoiceCallReport]',util[_0xfc19('0x3b')](_0x331a0a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfc19('0x31')][_0xfc19('0x2c')]=function(_0x2b22cb){try{if(this[_0xfc19('0x32')](_0x2b22cb)){if(this[_0xfc19('0x1b')][_0x2b22cb[_0xfc19('0x35')]]){if(!_['isNil'](this[_0xfc19('0x1b')][_0x2b22cb['uniqueid']][_0xfc19('0x81')])){this['channels'][_0x2b22cb[_0xfc19('0x35')]][_0xfc19('0x93')]=moment()['format'](_0xfc19('0x53'));}}}}catch(_0x133bff){logger[_0xfc19('0x39')]('[syncMusicOnHoldStart][VoiceCallReport]',util['inspect'](_0x133bff,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfc19('0x31')][_0xfc19('0x2e')]=function(_0x2da313){try{if(this[_0xfc19('0x32')](_0x2da313)){if(this['channels'][_0x2da313[_0xfc19('0x35')]]){if(!_[_0xfc19('0x6b')](this[_0xfc19('0x1b')][_0x2da313['uniqueid']]['mohstarttime'])){this[_0xfc19('0x1b')][_0x2da313['uniqueid']]['mohtime']+=moment()['milliseconds'](0x0)[_0xfc19('0x80')](this[_0xfc19('0x1b')][_0x2da313[_0xfc19('0x35')]]['mohstarttime'],_0xfc19('0x52'));delete this[_0xfc19('0x1b')][_0x2da313[_0xfc19('0x35')]]['mohstarttime'];}}}}catch(_0x557ce1){logger[_0xfc19('0x39')]('[syncMusicOnHoldStop][VoiceCallReport]',util[_0xfc19('0x3b')](_0x557ce1,{'showHidden':![],'depth':null}));}};module[_0xfc19('0x94')]=VoiceCallReport;
\ No newline at end of file
+var _0x59cf=['split','destconnectedlinenum','exten','format','user:%s','name','user:agentconnect','[syncNewChannel][VoiceCallReport]','inspect','application','toLowerCase','applicationdata','appdata','duration','subtract','seconds','merge','includes','lastdata','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','syncNewState','channelstate','answered','diff','calleridnum','connectedlinenum','connectedlinename','calleridname','destinationchannel','membername','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','variable','mixmonitor_filename','value','xmd-callerid','callerid','xmd-cdrtype','xmd-queue','xmd-destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcalluniqueid','parse','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','answertime','holdtime','billableseconds','context','omit','user:agentcomplete','accountcode','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfercalleridnum','origtransferercalleridnum','transfereeuniqueid','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transferconnectedlinenum','extension','BlindTransfer','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','syncMusicOnHoldStop','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','resolve','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','linkedid','uniqueid','pick','keys','error','[syncNewCallerId][VoiceCallReport]','channel','OutgoingSpoolFailed','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','from-sip'];(function(_0x2f2dd0,_0x242127){var _0x3c48d1=function(_0x4516b1){while(--_0x4516b1){_0x2f2dd0['push'](_0x2f2dd0['shift']());}};_0x3c48d1(++_0x242127);}(_0x59cf,0xf7));var _0xf59c=function(_0x1cc961,_0x2c42ee){_0x1cc961=_0x1cc961-0x0;var _0x471d86=_0x59cf[_0x1cc961];return _0x471d86;};'use strict';var BPromise=require(_0xf59c('0x0'));var _=require(_0xf59c('0x1'));var moment=require(_0xf59c('0x2'));var util=require(_0xf59c('0x3'));var path=require(_0xf59c('0x4'));var Redis=require(_0xf59c('0x5'));var config=require(_0xf59c('0x6'));var logger=require(_0xf59c('0x7'))(_0xf59c('0x8'));var ami=require(_0xf59c('0x9'));var Channel=require(_0xf59c('0xa'));var statusDesc=[_0xf59c('0xb'),_0xf59c('0xc'),'inuse','busy',_0xf59c('0xd'),_0xf59c('0xe'),_0xf59c('0xf'),_0xf59c('0x10'),_0xf59c('0x11')];var applications=[_0xf59c('0x12'),_0xf59c('0x13'),_0xf59c('0x14'),_0xf59c('0x15'),_0xf59c('0x16'),_0xf59c('0x17')];var dispositions=[_0xf59c('0x18'),_0xf59c('0x19'),_0xf59c('0x19'),_0xf59c('0x18'),_0xf59c('0x18'),_0xf59c('0x18'),_0xf59c('0x1a'),_0xf59c('0x1b'),_0xf59c('0x19'),_0xf59c('0x19'),_0xf59c('0x19')];var actions={};config[_0xf59c('0x1c')]=_[_0xf59c('0x1d')](config[_0xf59c('0x1c')],{'host':'localhost','port':0x18eb});var io=require(_0xf59c('0x1e'))(new Redis(config[_0xf59c('0x1c')]));function VoiceCallReport(_0x3c6a9d){this['channels']=_0x3c6a9d[_0xf59c('0x1f')];this[_0xf59c('0x20')]=_0x3c6a9d[_0xf59c('0x20')];ami['on'](_0xf59c('0x21'),this[_0xf59c('0x22')][_0xf59c('0x23')](this));ami['on'](_0xf59c('0x24'),this[_0xf59c('0x22')]['bind'](this));ami['on'](_0xf59c('0x25'),this[_0xf59c('0x26')][_0xf59c('0x23')](this));ami['on']('newstate',this['syncNewState'][_0xf59c('0x23')](this));ami['on'](_0xf59c('0x27'),this[_0xf59c('0x28')][_0xf59c('0x23')](this));ami['on'](_0xf59c('0x29'),this[_0xf59c('0x2a')][_0xf59c('0x23')](this));ami['on'](_0xf59c('0x2b'),this[_0xf59c('0x2c')]['bind'](this));ami['on'](_0xf59c('0x2d'),this[_0xf59c('0x2e')][_0xf59c('0x23')](this));ami['on'](_0xf59c('0x2f'),this[_0xf59c('0x30')][_0xf59c('0x23')](this));ami['on'](_0xf59c('0x31'),this[_0xf59c('0x32')][_0xf59c('0x23')](this));ami['on'](_0xf59c('0x33'),this['syncMusicOnHoldStop'][_0xf59c('0x23')](this));return BPromise[_0xf59c('0x34')]()['then'](ami[_0xf59c('0x35')]())[_0xf59c('0x36')](function(_0xf95f80){console[_0xf59c('0x37')](_0xf95f80);});}VoiceCallReport[_0xf59c('0x38')][_0xf59c('0x39')]=function(_0x3c0521){return _0x3c0521!==null&&!_[_0xf59c('0x3a')](_0x3c0521);};VoiceCallReport[_0xf59c('0x38')]['emit']=function(_0x9d4a0a,_0x514906,_0x2c3108){io['to'](_0x9d4a0a)[_0xf59c('0x3b')](_0x514906,_0x2c3108);};VoiceCallReport[_0xf59c('0x38')][_0xf59c('0x2c')]=function(_0x1aa41b){try{if(this[_0xf59c('0x39')](_0x1aa41b)){if(_0x1aa41b['uniqueid']===_0x1aa41b[_0xf59c('0x3c')]){if(!_[_0xf59c('0x3a')](this[_0xf59c('0x1f')][_0x1aa41b[_0xf59c('0x3d')]])){_['merge'](this[_0xf59c('0x1f')][_0x1aa41b[_0xf59c('0x3d')]],_[_0xf59c('0x3e')](_0x1aa41b,_[_0xf59c('0x3f')](this[_0xf59c('0x1f')][_0x1aa41b[_0xf59c('0x3d')]])));}}}}catch(_0x57a2ae){logger[_0xf59c('0x40')](_0xf59c('0x41'),util['inspect'](_0x57a2ae,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf59c('0x38')][_0xf59c('0x26')]=function(_0x548db5){try{if(this[_0xf59c('0x39')](_0x548db5)){if(_0x548db5[_0xf59c('0x3d')]===_0x548db5[_0xf59c('0x3c')]&&_0x548db5[_0xf59c('0x42')]!=_0xf59c('0x43')){if(_[_0xf59c('0x3a')](this['channels'][_0x548db5[_0xf59c('0x3d')]])){this[_0xf59c('0x1f')][_0x548db5[_0xf59c('0x3d')]]=new Channel();this[_0xf59c('0x1f')][_0x548db5[_0xf59c('0x3d')]][_0xf59c('0x44')]=moment()['format'](_0xf59c('0x45'));this[_0xf59c('0x1f')][_0x548db5[_0xf59c('0x3d')]][_0xf59c('0x46')]=dispositions[_[_0xf59c('0x47')](_0x548db5['channelstate'])];_['merge'](this[_0xf59c('0x1f')][_0x548db5['uniqueid']],_['pick'](_0x548db5,_[_0xf59c('0x3f')](this[_0xf59c('0x1f')][_0x548db5['uniqueid']])));if(_0x548db5['context']===_0xf59c('0x48')){if(this['agents'][_0x548db5[_0xf59c('0x42')][_0xf59c('0x49')]('-')[0x0]]){this[_0xf59c('0x20')][_0x548db5[_0xf59c('0x42')][_0xf59c('0x49')]('-')[0x0]][_0xf59c('0x4a')]=_0x548db5[_0xf59c('0x4b')];this[_0xf59c('0x3b')](util[_0xf59c('0x4c')](_0xf59c('0x4d'),this[_0xf59c('0x20')][_0x548db5[_0xf59c('0x42')][_0xf59c('0x49')]('-')[0x0]][_0xf59c('0x4e')]),_0xf59c('0x4f'),{'destaccountcode':this['agents'][_0x548db5[_0xf59c('0x42')][_0xf59c('0x49')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x548db5[_0xf59c('0x4b')]});}}}}}}catch(_0x6dc502){logger[_0xf59c('0x40')](_0xf59c('0x50'),util[_0xf59c('0x51')](_0x6dc502,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf59c('0x38')][_0xf59c('0x22')]=function(_0x523e7f){try{if(this['isNotNull'](_0x523e7f)){if(_0x523e7f[_0xf59c('0x3d')]===_0x523e7f[_0xf59c('0x3c')]&&_0x523e7f[_0xf59c('0x4b')]!='h'&&_0x523e7f[_0xf59c('0x42')]!=_0xf59c('0x43')){_0x523e7f[_0xf59c('0x52')]=_0x523e7f[_0xf59c('0x52')][_0xf59c('0x53')]();_0x523e7f[_0xf59c('0x54')]=(_0x523e7f[_0xf59c('0x55')]||_0x523e7f[_0xf59c('0x54')])[_0xf59c('0x53')]();if(_['isUndefined'](this[_0xf59c('0x1f')][_0x523e7f[_0xf59c('0x3d')]])){this['channels'][_0x523e7f[_0xf59c('0x3d')]]=new Channel();this[_0xf59c('0x1f')][_0x523e7f[_0xf59c('0x3d')]][_0xf59c('0x44')]=_0x523e7f[_0xf59c('0x56')]?moment()[_0xf59c('0x57')](moment[_0xf59c('0x56')](_0x523e7f[_0xf59c('0x56')])[_0xf59c('0x58')](),_0xf59c('0x58'))[_0xf59c('0x4c')](_0xf59c('0x45')):moment()['format'](_0xf59c('0x45'));this[_0xf59c('0x1f')][_0x523e7f[_0xf59c('0x3d')]][_0xf59c('0x46')]=_0xf59c('0x18');}_[_0xf59c('0x59')](this[_0xf59c('0x1f')][_0x523e7f[_0xf59c('0x3d')]],_['pick'](_0x523e7f,_['keys'](this['channels'][_0x523e7f[_0xf59c('0x3d')]])));if(_[_0xf59c('0x5a')](applications,_0x523e7f[_0xf59c('0x52')])){this[_0xf59c('0x1f')][_0x523e7f[_0xf59c('0x3d')]]['lastapplication']=_0x523e7f[_0xf59c('0x52')];this['channels'][_0x523e7f[_0xf59c('0x3d')]][_0xf59c('0x5b')]=_0x523e7f[_0xf59c('0x54')];if(_0x523e7f[_0xf59c('0x52')]===_0xf59c('0x12')&&_[_0xf59c('0x5c')](_0x523e7f[_0xf59c('0x54')],_0xf59c('0x5d'))){var _0x3d4ce7=_0x523e7f[_0xf59c('0x54')][_0xf59c('0x49')]('=');var _0x4f84fe=_0x3d4ce7[0x0][_0xf59c('0x5e')](/cdr\((.*)\)/);if(_0x4f84fe){this[_0xf59c('0x1f')][_0x523e7f['uniqueid']][_0x4f84fe[0x1]]=_0x3d4ce7[0x1];}}else if(_0x523e7f[_0xf59c('0x52')]===_0xf59c('0x13')){this[_0xf59c('0x1f')][_0x523e7f[_0xf59c('0x3d')]]['queue']=_0x523e7f['applicationdata'][_0xf59c('0x49')](',')[0x0];}}}}}catch(_0x27e186){logger['error'](_0xf59c('0x5f'),util[_0xf59c('0x51')](_0x27e186,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf59c('0x60')]=function(_0x755735){try{if(this[_0xf59c('0x39')](_0x755735)){if(_0x755735[_0xf59c('0x3d')]!==_0x755735[_0xf59c('0x3c')]){if(this[_0xf59c('0x1f')][_0x755735[_0xf59c('0x3c')]]){if(_0x755735[_0xf59c('0x61')]==='6'){if(!this[_0xf59c('0x1f')][_0x755735[_0xf59c('0x3c')]][_0xf59c('0x62')]){var _0x406e79=moment();this[_0xf59c('0x1f')][_0x755735[_0xf59c('0x3c')]][_0xf59c('0x62')]=!![];this['channels'][_0x755735[_0xf59c('0x3c')]]['answertime']=_0x406e79[_0xf59c('0x4c')](_0xf59c('0x45'));if(this[_0xf59c('0x1f')][_0x755735['linkedid']][_0xf59c('0x44')]){this[_0xf59c('0x1f')][_0x755735[_0xf59c('0x3c')]]['holdtime']=_0x406e79[_0xf59c('0x63')](this[_0xf59c('0x1f')][_0x755735[_0xf59c('0x3c')]][_0xf59c('0x44')],'seconds');}}this[_0xf59c('0x1f')][_0x755735[_0xf59c('0x3c')]][_0xf59c('0x3c')]=_0x755735['uniqueid'];if(_0x755735[_0xf59c('0x64')]!=='xcally-motion-preview'){this['channels'][_0x755735['linkedid']][_0xf59c('0x65')]=_0x755735[_0xf59c('0x64')];}this[_0xf59c('0x1f')][_0x755735[_0xf59c('0x3c')]][_0xf59c('0x66')]=_0x755735[_0xf59c('0x67')];this[_0xf59c('0x1f')][_0x755735[_0xf59c('0x3c')]][_0xf59c('0x68')]=_0x755735[_0xf59c('0x42')];this['channels'][_0x755735[_0xf59c('0x3c')]][_0xf59c('0x46')]=dispositions[_[_0xf59c('0x47')](_0x755735[_0xf59c('0x61')])];if(this['agents'][_0x755735['channel']['split']('-')[0x0]]){this[_0xf59c('0x1f')][_0x755735[_0xf59c('0x3c')]]['UserId']=this['agents'][_0x755735[_0xf59c('0x42')][_0xf59c('0x49')]('-')[0x0]]['id'];this[_0xf59c('0x1f')][_0x755735[_0xf59c('0x3c')]][_0xf59c('0x69')]=this[_0xf59c('0x20')][_0x755735[_0xf59c('0x42')]['split']('-')[0x0]]['name'];}}}}else{if(this['channels'][_0x755735[_0xf59c('0x3d')]]){if(_0x755735['channelstate']==='6'){if(this[_0xf59c('0x20')][_0x755735[_0xf59c('0x42')][_0xf59c('0x49')]('-')[0x0]]){this[_0xf59c('0x1f')][_0x755735[_0xf59c('0x3d')]][_0xf59c('0x6a')]=this[_0xf59c('0x20')][_0x755735['channel']['split']('-')[0x0]]['id'];this[_0xf59c('0x1f')][_0x755735['uniqueid']][_0xf59c('0x69')]=this[_0xf59c('0x20')][_0x755735[_0xf59c('0x42')]['split']('-')[0x0]]['name'];}}}}}}catch(_0x27886a){logger[_0xf59c('0x40')](_0xf59c('0x6b'),util[_0xf59c('0x51')](_0x27886a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf59c('0x38')][_0xf59c('0x6c')]=function(_0x232c15,_0x49d9b7){if(this[_0xf59c('0x1f')][_0x232c15]){this['channels'][_0x232c15][_0xf59c('0x6d')]=!![];if(_[_0xf59c('0x6e')](_0x49d9b7,_0xf59c('0x6f'))){_0x49d9b7=_0x49d9b7[_0xf59c('0x70')]('.wav49',_0xf59c('0x71'));}this[_0xf59c('0x1f')][_0x232c15][_0xf59c('0x72')]=_0x49d9b7;var _0x299ff3=_[_0xf59c('0x73')](this['channels'][_0x232c15][_0xf59c('0x74')],{'filename':_0x49d9b7});if(_[_0xf59c('0x75')](_0x299ff3)){this['channels'][_0x232c15]['monitors'][_0xf59c('0x76')]({'filename':_0x49d9b7,'createdAt':moment()['format'](_0xf59c('0x45')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0xf59c('0x38')][_0xf59c('0x28')]=function(_0x51b586){try{if(this[_0xf59c('0x39')](_0x51b586)){if(this[_0xf59c('0x1f')][_0x51b586[_0xf59c('0x3d')]]&&_0x51b586[_0xf59c('0x42')]!='OutgoingSpoolFailed'){if(this[_0xf59c('0x39')](_0x51b586[_0xf59c('0x77')])){if(this[_0xf59c('0x39')](_0x51b586['variable'][_0xf59c('0x78')])){this['syncMixMonitorFilename'](_0x51b586[_0xf59c('0x3d')],_0x51b586['value']);}else if(this[_0xf59c('0x39')](_0x51b586[_0xf59c('0x77')]['xmd-phone'])){this[_0xf59c('0x1f')][_0x51b586[_0xf59c('0x3d')]][_0xf59c('0x64')]=_0x51b586[_0xf59c('0x79')];}else if(this['isNotNull'](_0x51b586[_0xf59c('0x77')][_0xf59c('0x7a')])){this['channels'][_0x51b586[_0xf59c('0x3d')]][_0xf59c('0x7b')]=_0x51b586['value'];}else if(this['isNotNull'](_0x51b586[_0xf59c('0x77')][_0xf59c('0x7c')])){this['channels'][_0x51b586[_0xf59c('0x3d')]]['type']=_0x51b586[_0xf59c('0x79')];}else if(this[_0xf59c('0x39')](_0x51b586[_0xf59c('0x77')][_0xf59c('0x7d')])){this[_0xf59c('0x1f')][_0x51b586[_0xf59c('0x3d')]][_0xf59c('0x13')]=_0x51b586[_0xf59c('0x79')][_0xf59c('0x49')](',')[0x0];}else if(this[_0xf59c('0x39')](_0x51b586[_0xf59c('0x77')]['xmd-originatecalleridnum'])){this[_0xf59c('0x1f')][_0x51b586[_0xf59c('0x3d')]]['originatecalleridnum']=_0x51b586[_0xf59c('0x79')];}else if(this[_0xf59c('0x39')](_0x51b586[_0xf59c('0x77')][_0xf59c('0x7e')])){this['channels'][_0x51b586[_0xf59c('0x3d')]]['destination']=_0x51b586[_0xf59c('0x79')];}else if(this['isNotNull'](_0x51b586[_0xf59c('0x77')][_0xf59c('0x7f')])){this[_0xf59c('0x1f')][_0x51b586['uniqueid']][_0xf59c('0x80')]=_0x51b586[_0xf59c('0x79')];}else if(this[_0xf59c('0x39')](_0x51b586[_0xf59c('0x77')][_0xf59c('0x81')])){this[_0xf59c('0x1f')][_0x51b586[_0xf59c('0x3d')]][_0xf59c('0x13')]=_0x51b586[_0xf59c('0x79')];}else if(this[_0xf59c('0x39')](_0x51b586[_0xf59c('0x77')]['sipcallid'])){this['channels'][_0x51b586[_0xf59c('0x3d')]][_0xf59c('0x82')]=_0x51b586[_0xf59c('0x79')];}}}else if(this[_0xf59c('0x39')](_0x51b586[_0xf59c('0x77')]['mixmonitor_filename'])){if(_0x51b586[_0xf59c('0x79')]){var _0x5d8d2d=path[_0xf59c('0x83')](_0x51b586[_0xf59c('0x79')])[_0xf59c('0x4e')];this[_0xf59c('0x6c')](_0x5d8d2d,_0x51b586['value']);}}else if(this[_0xf59c('0x1f')][_0x51b586['linkedid']]){if(this[_0xf59c('0x39')](_0x51b586[_0xf59c('0x77')])){if(this[_0xf59c('0x39')](_0x51b586[_0xf59c('0x77')][_0xf59c('0x84')])){this['channels'][_0x51b586[_0xf59c('0x3c')]][_0xf59c('0x85')]=_0x51b586[_0xf59c('0x79')];}}}}}catch(_0x2bb28e){logger['error'](_0xf59c('0x86'),util[_0xf59c('0x51')](_0x2bb28e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf59c('0x38')][_0xf59c('0x2a')]=function(_0x252cb4){try{if(this[_0xf59c('0x39')](_0x252cb4)){if(this['channels'][_0x252cb4[_0xf59c('0x3d')]]){var _0x39df53=moment();this[_0xf59c('0x1f')][_0x252cb4['uniqueid']]['endtime']=_0x39df53[_0xf59c('0x4c')](_0xf59c('0x45'));this[_0xf59c('0x1f')][_0x252cb4[_0xf59c('0x3d')]][_0xf59c('0x56')]=_0x39df53[_0xf59c('0x63')](this[_0xf59c('0x1f')][_0x252cb4[_0xf59c('0x3d')]][_0xf59c('0x44')],_0xf59c('0x58'));if(this[_0xf59c('0x1f')][_0x252cb4[_0xf59c('0x3d')]][_0xf59c('0x62')]){this[_0xf59c('0x1f')][_0x252cb4[_0xf59c('0x3d')]]['billableseconds']=_0x39df53[_0xf59c('0x63')](this[_0xf59c('0x1f')][_0x252cb4['uniqueid']][_0xf59c('0x87')],'seconds');this['channels'][_0x252cb4[_0xf59c('0x3d')]][_0xf59c('0x88')]=this['channels'][_0x252cb4[_0xf59c('0x3d')]][_0xf59c('0x56')]-this[_0xf59c('0x1f')][_0x252cb4['uniqueid']][_0xf59c('0x89')];}if(_0x252cb4[_0xf59c('0x8a')]==='from-sip'){if(this[_0xf59c('0x20')][_0x252cb4[_0xf59c('0x42')]['split']('-')[0x0]]){this[_0xf59c('0x20')][_0x252cb4[_0xf59c('0x42')][_0xf59c('0x49')]('-')[0x0]]=_[_0xf59c('0x8b')](this[_0xf59c('0x20')][_0x252cb4[_0xf59c('0x42')][_0xf59c('0x49')]('-')[0x0]],['destconnectedlinenum']);this[_0xf59c('0x3b')](util['format'](_0xf59c('0x4d'),this[_0xf59c('0x20')][_0x252cb4['channel']['split']('-')[0x0]][_0xf59c('0x4e')]),_0xf59c('0x8c'),{'destaccountcode':this['agents'][_0x252cb4['channel']['split']('-')[0x0]][_0xf59c('0x8d')]});}}ami['emit'](_0xf59c('0x8e'),this[_0xf59c('0x1f')][_0x252cb4[_0xf59c('0x3d')]]);delete this['channels'][_0x252cb4['uniqueid']];}}}catch(_0x56212e){logger[_0xf59c('0x40')](_0xf59c('0x8f'),util[_0xf59c('0x51')](_0x56212e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf59c('0x38')][_0xf59c('0x2e')]=function(_0x28d79b){try{if(this['isNotNull'](_0x28d79b)){if(this[_0xf59c('0x1f')][_0x28d79b['transfereeuniqueid']]){this['channels'][_0x28d79b['transfereeuniqueid']][_0xf59c('0x90')]=_0x28d79b[_0xf59c('0x91')];this['channels'][_0x28d79b[_0xf59c('0x92')]]['transferconnectedlinenum']=_0x28d79b[_0xf59c('0x93')];if(this[_0xf59c('0x1f')][_0x28d79b['secondtransfereruniqueid']]){var _0x41889e=this[_0xf59c('0x1f')][_0x28d79b[_0xf59c('0x94')]];this[_0xf59c('0x1f')][_0x28d79b[_0xf59c('0x94')]]=this['channels'][_0x28d79b[_0xf59c('0x92')]];this[_0xf59c('0x1f')][_0x28d79b[_0xf59c('0x92')]]=_0x41889e;}}else if(this[_0xf59c('0x1f')][_0x28d79b[_0xf59c('0x95')]]){this[_0xf59c('0x1f')][_0x28d79b[_0xf59c('0x95')]][_0xf59c('0x90')]=_0x28d79b[_0xf59c('0x91')];this[_0xf59c('0x1f')][_0x28d79b[_0xf59c('0x95')]]['transferconnectedlinenum']=_0x28d79b[_0xf59c('0x93')];if(this['channels'][_0x28d79b['origtransfereruniqueid']]){var _0x41889e=this[_0xf59c('0x1f')][_0x28d79b[_0xf59c('0x96')]];this[_0xf59c('0x1f')][_0x28d79b[_0xf59c('0x96')]]=this['channels'][_0x28d79b[_0xf59c('0x95')]];this[_0xf59c('0x1f')][_0x28d79b['transfertargetuniqueid']]=_0x41889e;}}}}catch(_0x2d7bbe){logger[_0xf59c('0x40')](_0xf59c('0x97'),util[_0xf59c('0x51')](_0x2d7bbe,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf59c('0x38')][_0xf59c('0x30')]=function(_0x2fbe51){try{if(this[_0xf59c('0x39')](_0x2fbe51)){if(this[_0xf59c('0x1f')][_0x2fbe51[_0xf59c('0x92')]]){this['channels'][_0x2fbe51[_0xf59c('0x92')]][_0xf59c('0x90')]=_0x2fbe51['transfereecalleridnum'];this[_0xf59c('0x1f')][_0x2fbe51[_0xf59c('0x92')]][_0xf59c('0x98')]=_0x2fbe51[_0xf59c('0x99')];this[_0xf59c('0x2a')]({'event':_0xf59c('0x9a'),'uniqueid':_0x2fbe51[_0xf59c('0x92')],'context':_0x2fbe51[_0xf59c('0x8a')],'channel':_0x2fbe51['transfererchannel']});}}}catch(_0x7a4537){logger[_0xf59c('0x40')](_0xf59c('0x9b'),util['inspect'](_0x7a4537,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf59c('0x38')]['syncMusicOnHoldStart']=function(_0x3adf97){try{if(this[_0xf59c('0x39')](_0x3adf97)){if(this[_0xf59c('0x1f')][_0x3adf97['uniqueid']]){if(!_[_0xf59c('0x75')](this[_0xf59c('0x1f')][_0x3adf97[_0xf59c('0x3d')]][_0xf59c('0x87')])){this['channels'][_0x3adf97[_0xf59c('0x3d')]][_0xf59c('0x9c')]=moment()[_0xf59c('0x4c')](_0xf59c('0x45'));}}}}catch(_0x43ef6){logger[_0xf59c('0x40')](_0xf59c('0x9d'),util[_0xf59c('0x51')](_0x43ef6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf59c('0x38')][_0xf59c('0x9e')]=function(_0x41d874){try{if(this['isNotNull'](_0x41d874)){if(this[_0xf59c('0x1f')][_0x41d874['uniqueid']]){if(!_[_0xf59c('0x75')](this[_0xf59c('0x1f')][_0x41d874[_0xf59c('0x3d')]][_0xf59c('0x9c')])){this[_0xf59c('0x1f')][_0x41d874[_0xf59c('0x3d')]]['mohtime']+=moment()['milliseconds'](0x0)['diff'](this[_0xf59c('0x1f')][_0x41d874[_0xf59c('0x3d')]]['mohstarttime'],_0xf59c('0x58'));delete this[_0xf59c('0x1f')][_0x41d874[_0xf59c('0x3d')]]['mohstarttime'];}}}}catch(_0x389c41){logger[_0xf59c('0x40')](_0xf59c('0x9f'),util[_0xf59c('0x51')](_0x389c41,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
index 47b95db..285bf5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbbe=['substring','lastIndexOf','omit','event','privilege','voice_outbound_channel:save','channels','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','syncDialEnd','dialstatus','ANSWER','connectedlinename','answertime','connect','custom:dialconnect','voice:outbound','addVariable','keys','variable','value','[syncVarSet][VoiceDialReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','endtime','diff','starttime','seconds','lastevent','complete','total','answered','holdtime','billableseconds','sumHoldTime','sumDuration','duration','custom:voiceDialReport','custom:dialend','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','outboundChannels','outbound','variables','syncDialBegin','bind','dialend','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdbbe,0x148));var _0xedbb=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0xdbbe[_0x45d1fd];return _0xd0e542;};'use strict';var _=require('lodash');var moment=require(_0xedbb('0x0'));var util=require(_0xedbb('0x1'));var Redis=require(_0xedbb('0x2'));var config=require(_0xedbb('0x3'));var logger=require(_0xedbb('0x4'))(_0xedbb('0x5'));var ami=require('../ami');config[_0xedbb('0x6')]=_[_0xedbb('0x7')](config[_0xedbb('0x6')],{'host':_0xedbb('0x8'),'port':0x18eb});var io=require(_0xedbb('0x9'))(new Redis(config[_0xedbb('0x6')]));function VoiceDialReport(_0x2bb3dd){this['channels']=_0x2bb3dd[_0xedbb('0xa')];this[_0xedbb('0xb')]=_0x2bb3dd['outbound'];this[_0xedbb('0xc')]={};ami['on']('dialbegin',this[_0xedbb('0xd')][_0xedbb('0xe')](this));ami['on'](_0xedbb('0xf'),this['syncDialEnd'][_0xedbb('0xe')](this));ami['on']('varset',this[_0xedbb('0x10')][_0xedbb('0xe')](this));ami['on'](_0xedbb('0x11'),this[_0xedbb('0x12')]['bind'](this));}VoiceDialReport[_0xedbb('0x13')][_0xedbb('0x14')]=function(_0x420003){return _0x420003!==null&&!_[_0xedbb('0x15')](_0x420003);};VoiceDialReport[_0xedbb('0x13')][_0xedbb('0x16')]=function(_0x47fe18,_0x20c895,_0xaee7ac){io['to'](_0x47fe18)[_0xedbb('0x16')](_0x20c895,_0xaee7ac);};VoiceDialReport[_0xedbb('0x13')][_0xedbb('0xd')]=function(_0x3612d8){try{if(this['isNotNull'](_0x3612d8)){if(this['channels'][_0x3612d8[_0xedbb('0x17')]]){_[_0xedbb('0x18')](this['channels'][_0x3612d8[_0xedbb('0x17')]],{'starttime':moment()[_0xedbb('0x19')](_0xedbb('0x1a')),'lastevent':'called','interface':_0x3612d8[_0xedbb('0x1b')]['substring'](0x0,_0x3612d8['channel']['lastIndexOf']('-')),'membername':_0x3612d8['channel'][_0xedbb('0x1c')](_0x3612d8['channel']['lastIndexOf']('/')+0x1,_0x3612d8[_0xedbb('0x1b')][_0xedbb('0x1d')]('-'))},_[_0xedbb('0x1e')](_0x3612d8,[_0xedbb('0x1f'),_0xedbb('0x20')]));this[_0xedbb('0x16')]('voice:outbound',_0xedbb('0x21'),this[_0xedbb('0x22')][_0x3612d8[_0xedbb('0x17')]]);ami['emit'](_0xedbb('0x23'),this[_0xedbb('0x22')][_0x3612d8[_0xedbb('0x17')]]);}}}catch(_0x4f277e){logger[_0xedbb('0x24')](_0xedbb('0x25'),util[_0xedbb('0x26')](_0x4f277e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xedbb('0x13')][_0xedbb('0x27')]=function(_0x12af1c){try{if(this[_0xedbb('0x14')](_0x12af1c)){if(this[_0xedbb('0x22')][_0x12af1c[_0xedbb('0x17')]]){this['channels'][_0x12af1c[_0xedbb('0x17')]][_0xedbb('0x28')]=_0x12af1c[_0xedbb('0x28')];if(_0x12af1c['dialstatus']===_0xedbb('0x29')){this[_0xedbb('0x22')][_0x12af1c['uniqueid']]['connectedlinenum']=_0x12af1c['connectedlinenum'];this[_0xedbb('0x22')][_0x12af1c[_0xedbb('0x17')]][_0xedbb('0x2a')]=_0x12af1c[_0xedbb('0x2a')];this[_0xedbb('0x22')][_0x12af1c['uniqueid']][_0xedbb('0x2b')]=moment()[_0xedbb('0x19')](_0xedbb('0x1a'));this[_0xedbb('0x22')][_0x12af1c[_0xedbb('0x17')]]['lastevent']=_0xedbb('0x2c');ami[_0xedbb('0x16')](_0xedbb('0x2d'),this[_0xedbb('0x22')][_0x12af1c[_0xedbb('0x17')]]);}this[_0xedbb('0x16')](_0xedbb('0x2e'),'voice_outbound_channel:save',this[_0xedbb('0x22')][_0x12af1c[_0xedbb('0x17')]]);}}}catch(_0x1daa2a){logger['error']('[syncDialEnd][VoiceDialReport]',util[_0xedbb('0x26')](_0x1daa2a,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xedbb('0x10')]=function(_0x2f6862){try{if(this[_0xedbb('0x14')](_0x2f6862)){this[_0xedbb('0x2f')](_0x2f6862['uniqueid'],_[_0xedbb('0x30')](_0x2f6862[_0xedbb('0x31')])[0x0],_0x2f6862['value']);if(this[_0xedbb('0x14')](_0x2f6862[_0xedbb('0x31')])&&this['isNotNull'](_0x2f6862[_0xedbb('0x31')]['outboundrouteid'])){if(_[_0xedbb('0x15')](this[_0xedbb('0x22')][_0x2f6862['uniqueid']])){this['channels'][_0x2f6862['uniqueid']]={'routeId':_0x2f6862[_0xedbb('0x32')],'variables':this['variables'][_0x2f6862[_0xedbb('0x17')]]};this[_0xedbb('0x16')](_0xedbb('0x2e'),'voice_outbound_channel:save',this[_0xedbb('0x22')][_0x2f6862[_0xedbb('0x17')]]);}}}}catch(_0x1c2d6f){logger[_0xedbb('0x24')](_0xedbb('0x33'),util[_0xedbb('0x26')](_0x1c2d6f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xedbb('0x13')][_0xedbb('0x2f')]=function(_0x4d0b51,_0x14ef16,_0x1b0d0f){var _0x53bee6=['rtpaudioqos',_0xedbb('0x34'),_0xedbb('0x35'),_0xedbb('0x36'),_0xedbb('0x37'),_0xedbb('0x38'),_0xedbb('0x39'),'rtpaudioqosrttbridged',_0xedbb('0x3a'),_0xedbb('0x3b'),_0xedbb('0x3c'),_0xedbb('0x3d'),'membercalls',_0xedbb('0x3e'),_0xedbb('0x3f'),_0xedbb('0x40'),'membername','memberpenalty',_0xedbb('0x41')];if(!_[_0xedbb('0x42')](_0x14ef16)&&!_['includes'](_0x53bee6,_0x14ef16)){if(_[_0xedbb('0x15')](this[_0xedbb('0xc')][_0x4d0b51])){this[_0xedbb('0xc')][_0x4d0b51]={};}this[_0xedbb('0xc')][_0x4d0b51][_0x14ef16]=_0x1b0d0f;}};VoiceDialReport[_0xedbb('0x13')][_0xedbb('0x12')]=function(_0x42598d){try{if(this['isNotNull'](_0x42598d)){if(this[_0xedbb('0x22')][_0x42598d['uniqueid']]){this[_0xedbb('0x22')][_0x42598d['uniqueid']][_0xedbb('0x43')]=moment()[_0xedbb('0x19')](_0xedbb('0x1a'));this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]]['duration']=moment(this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]][_0xedbb('0x43')])[_0xedbb('0x44')](this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]][_0xedbb('0x45')],_0xedbb('0x46'));this['channels'][_0x42598d[_0xedbb('0x17')]][_0xedbb('0x47')]=_0xedbb('0x48');this[_0xedbb('0xb')][_0xedbb('0x49')]+=0x1;if(this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]]['answertime']){this[_0xedbb('0xb')][_0xedbb('0x4a')]+=0x1;this['channels'][_0x42598d['uniqueid']][_0xedbb('0x4b')]=moment(this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]][_0xedbb('0x2b')])[_0xedbb('0x44')](this['channels'][_0x42598d[_0xedbb('0x17')]]['starttime'],_0xedbb('0x46'));this[_0xedbb('0x22')][_0x42598d['uniqueid']][_0xedbb('0x4c')]=moment(this['channels'][_0x42598d['uniqueid']][_0xedbb('0x43')])[_0xedbb('0x44')](this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]][_0xedbb('0x2b')],'seconds');this[_0xedbb('0xb')][_0xedbb('0x4d')]+=this['channels'][_0x42598d[_0xedbb('0x17')]]['holdtime']||0x0;this[_0xedbb('0xb')]['sumBillable']+=this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]][_0xedbb('0x4c')];}this[_0xedbb('0xb')][_0xedbb('0x4e')]+=this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]][_0xedbb('0x4f')];ami[_0xedbb('0x16')](_0xedbb('0x50'),this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]]);ami[_0xedbb('0x16')](_0xedbb('0x51'),this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]]);this[_0xedbb('0x16')]('voice:outbound',_0xedbb('0x52'),this[_0xedbb('0xb')]);logger[_0xedbb('0x53')](_0xedbb('0x54'),JSON[_0xedbb('0x55')](this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]]));this[_0xedbb('0x16')]('voice:outbound',_0xedbb('0x56'),this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]]);delete this[_0xedbb('0x22')][_0x42598d[_0xedbb('0x17')]];}if(this['variables'][_0x42598d[_0xedbb('0x17')]]){delete this[_0xedbb('0xc')][_0x42598d[_0xedbb('0x17')]];}}}catch(_0x387756){logger[_0xedbb('0x24')](_0xedbb('0x57'),util[_0xedbb('0x26')](_0x387756,{'showHidden':![],'depth':null}));}};module[_0xedbb('0x58')]=VoiceDialReport;
\ No newline at end of file
+var _0x31af=['variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','isNil','isUndefined','duration','endtime','diff','starttime','seconds','complete','answertime','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','info','stringify','[syncHangup][VoiceDialReport]','exports','lodash','moment','util','../../../config/logger','../ami','redis','defaults','socket.io-emitter','channels','outbound','variables','dialbegin','bind','dialend','syncDialEnd','varset','hangup','syncHangup','isNotNull','prototype','emit','syncDialBegin','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','privilege','voice_outbound_channel:save','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','format','lastevent','connect','custom:dialconnect','voice:outbound','[syncDialEnd][VoiceDialReport]','syncVarSet','addVariable','keys'];(function(_0x24a833,_0x488360){var _0x5478be=function(_0x11795e){while(--_0x11795e){_0x24a833['push'](_0x24a833['shift']());}};_0x5478be(++_0x488360);}(_0x31af,0xde));var _0xf31a=function(_0x35f497,_0x3657f8){_0x35f497=_0x35f497-0x0;var _0xaf22ed=_0x31af[_0x35f497];return _0xaf22ed;};'use strict';var _=require(_0xf31a('0x0'));var moment=require(_0xf31a('0x1'));var util=require(_0xf31a('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xf31a('0x3'))('ami');var ami=require(_0xf31a('0x4'));config[_0xf31a('0x5')]=_[_0xf31a('0x6')](config[_0xf31a('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf31a('0x7'))(new Redis(config[_0xf31a('0x5')]));function VoiceDialReport(_0x405926){this[_0xf31a('0x8')]=_0x405926['outboundChannels'];this[_0xf31a('0x9')]=_0x405926[_0xf31a('0x9')];this[_0xf31a('0xa')]={};ami['on'](_0xf31a('0xb'),this['syncDialBegin'][_0xf31a('0xc')](this));ami['on'](_0xf31a('0xd'),this[_0xf31a('0xe')][_0xf31a('0xc')](this));ami['on'](_0xf31a('0xf'),this['syncVarSet'][_0xf31a('0xc')](this));ami['on'](_0xf31a('0x10'),this[_0xf31a('0x11')][_0xf31a('0xc')](this));}VoiceDialReport['prototype'][_0xf31a('0x12')]=function(_0x26b85e){return _0x26b85e!==null&&!_['isUndefined'](_0x26b85e);};VoiceDialReport[_0xf31a('0x13')][_0xf31a('0x14')]=function(_0x46bdd3,_0x18d266,_0x451107){io['to'](_0x46bdd3)[_0xf31a('0x14')](_0x18d266,_0x451107);};VoiceDialReport[_0xf31a('0x13')][_0xf31a('0x15')]=function(_0x3f7c35){try{if(this[_0xf31a('0x12')](_0x3f7c35)){if(this[_0xf31a('0x8')][_0x3f7c35[_0xf31a('0x16')]]){_[_0xf31a('0x17')](this[_0xf31a('0x8')][_0x3f7c35[_0xf31a('0x16')]],{'starttime':moment()['format'](_0xf31a('0x18')),'lastevent':_0xf31a('0x19'),'interface':_0x3f7c35[_0xf31a('0x1a')][_0xf31a('0x1b')](0x0,_0x3f7c35['channel'][_0xf31a('0x1c')]('-')),'membername':_0x3f7c35[_0xf31a('0x1a')][_0xf31a('0x1b')](_0x3f7c35[_0xf31a('0x1a')][_0xf31a('0x1c')]('/')+0x1,_0x3f7c35['channel'][_0xf31a('0x1c')]('-'))},_[_0xf31a('0x1d')](_0x3f7c35,['event',_0xf31a('0x1e')]));this[_0xf31a('0x14')]('voice:outbound',_0xf31a('0x1f'),this[_0xf31a('0x8')][_0x3f7c35['uniqueid']]);ami['emit']('custom:dialbegin',this[_0xf31a('0x8')][_0x3f7c35[_0xf31a('0x16')]]);}}}catch(_0x5c23db){logger[_0xf31a('0x20')](_0xf31a('0x21'),util[_0xf31a('0x22')](_0x5c23db,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf31a('0x13')]['syncDialEnd']=function(_0x5d8083){try{if(this[_0xf31a('0x12')](_0x5d8083)){if(this[_0xf31a('0x8')][_0x5d8083['uniqueid']]){this['channels'][_0x5d8083['uniqueid']]['dialstatus']=_0x5d8083[_0xf31a('0x23')];if(_0x5d8083[_0xf31a('0x23')]===_0xf31a('0x24')){this['channels'][_0x5d8083[_0xf31a('0x16')]][_0xf31a('0x25')]=_0x5d8083[_0xf31a('0x25')];this[_0xf31a('0x8')][_0x5d8083[_0xf31a('0x16')]]['connectedlinename']=_0x5d8083[_0xf31a('0x26')];this[_0xf31a('0x8')][_0x5d8083['uniqueid']]['answertime']=moment()[_0xf31a('0x27')](_0xf31a('0x18'));this['channels'][_0x5d8083[_0xf31a('0x16')]][_0xf31a('0x28')]=_0xf31a('0x29');ami['emit'](_0xf31a('0x2a'),this[_0xf31a('0x8')][_0x5d8083[_0xf31a('0x16')]]);}this[_0xf31a('0x14')](_0xf31a('0x2b'),_0xf31a('0x1f'),this['channels'][_0x5d8083[_0xf31a('0x16')]]);}}}catch(_0xa80955){logger[_0xf31a('0x20')](_0xf31a('0x2c'),util[_0xf31a('0x22')](_0xa80955,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf31a('0x13')][_0xf31a('0x2d')]=function(_0x34808e){try{if(this[_0xf31a('0x12')](_0x34808e)){this[_0xf31a('0x2e')](_0x34808e[_0xf31a('0x16')],_[_0xf31a('0x2f')](_0x34808e[_0xf31a('0x30')])[0x0],_0x34808e[_0xf31a('0x31')]);if(this[_0xf31a('0x12')](_0x34808e[_0xf31a('0x30')])&&this[_0xf31a('0x12')](_0x34808e[_0xf31a('0x30')][_0xf31a('0x32')])){if(_['isUndefined'](this[_0xf31a('0x8')][_0x34808e[_0xf31a('0x16')]])){this[_0xf31a('0x8')][_0x34808e[_0xf31a('0x16')]]={'routeId':_0x34808e[_0xf31a('0x31')],'variables':this['variables'][_0x34808e[_0xf31a('0x16')]]};this[_0xf31a('0x14')](_0xf31a('0x2b'),'voice_outbound_channel:save',this[_0xf31a('0x8')][_0x34808e[_0xf31a('0x16')]]);}}}}catch(_0xe141dd){logger[_0xf31a('0x20')](_0xf31a('0x33'),util['inspect'](_0xe141dd,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf31a('0x13')]['addVariable']=function(_0x44321d,_0x129409,_0x4bb705){var _0x35d5b6=[_0xf31a('0x34'),_0xf31a('0x35'),'rtpaudioqosjitter',_0xf31a('0x36'),_0xf31a('0x37'),_0xf31a('0x38'),_0xf31a('0x39'),_0xf31a('0x3a'),_0xf31a('0x3b'),_0xf31a('0x3c'),_0xf31a('0x3d'),_0xf31a('0x3e'),'membercalls',_0xf31a('0x3f'),_0xf31a('0x40'),'memberlastcall',_0xf31a('0x41'),_0xf31a('0x42'),_0xf31a('0x43')];if(!_[_0xf31a('0x44')](_0x129409)&&!_['includes'](_0x35d5b6,_0x129409)){if(_[_0xf31a('0x45')](this[_0xf31a('0xa')][_0x44321d])){this[_0xf31a('0xa')][_0x44321d]={};}this[_0xf31a('0xa')][_0x44321d][_0x129409]=_0x4bb705;}};VoiceDialReport['prototype'][_0xf31a('0x11')]=function(_0x58163c){try{if(this[_0xf31a('0x12')](_0x58163c)){if(this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]]){this['channels'][_0x58163c[_0xf31a('0x16')]]['endtime']=moment()[_0xf31a('0x27')](_0xf31a('0x18'));this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]][_0xf31a('0x46')]=moment(this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]][_0xf31a('0x47')])[_0xf31a('0x48')](this['channels'][_0x58163c[_0xf31a('0x16')]][_0xf31a('0x49')],_0xf31a('0x4a'));this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]][_0xf31a('0x28')]=_0xf31a('0x4b');this['outbound']['total']+=0x1;if(this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]][_0xf31a('0x4c')]){this[_0xf31a('0x9')][_0xf31a('0x4d')]+=0x1;this[_0xf31a('0x8')][_0x58163c['uniqueid']][_0xf31a('0x4e')]=moment(this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]][_0xf31a('0x4c')])[_0xf31a('0x48')](this[_0xf31a('0x8')][_0x58163c['uniqueid']][_0xf31a('0x49')],_0xf31a('0x4a'));this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]][_0xf31a('0x4f')]=moment(this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]][_0xf31a('0x47')])[_0xf31a('0x48')](this[_0xf31a('0x8')][_0x58163c['uniqueid']][_0xf31a('0x4c')],'seconds');this[_0xf31a('0x9')][_0xf31a('0x50')]+=this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]][_0xf31a('0x4e')]||0x0;this[_0xf31a('0x9')][_0xf31a('0x51')]+=this[_0xf31a('0x8')][_0x58163c['uniqueid']][_0xf31a('0x4f')];}this[_0xf31a('0x9')][_0xf31a('0x52')]+=this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]][_0xf31a('0x46')];ami['emit'](_0xf31a('0x53'),this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]]);ami[_0xf31a('0x14')](_0xf31a('0x54'),this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]]);this[_0xf31a('0x14')](_0xf31a('0x2b'),_0xf31a('0x55'),this[_0xf31a('0x9')]);logger[_0xf31a('0x56')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0xf31a('0x57')](this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]]));this['emit'](_0xf31a('0x2b'),'voice_outbound_channel:remove',this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]]);delete this[_0xf31a('0x8')][_0x58163c[_0xf31a('0x16')]];}if(this['variables'][_0x58163c[_0xf31a('0x16')]]){delete this[_0xf31a('0xa')][_0x58163c[_0xf31a('0x16')]];}}}catch(_0x33f81b){logger[_0xf31a('0x20')](_0xf31a('0x58'),util['inspect'](_0x33f81b,{'showHidden':![],'depth':null}));}};module[_0xf31a('0x59')]=VoiceDialReport;
\ No newline at end of file
index 63d47e2..b4ef2f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ba=['[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','format','name','voice_queue_channel:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice:queue:%s','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','abandoned','Trunk','Interval','voice_queue:save','isUndefined','loopQueueShow','clearZombieChannels','Action','queues','[queues]','flagQueueSummary','queuesummary','then','[queuesummary]','syncQueueSummary','isNotNull','queue','countBy','callers','toNumber','loggedin','custom:queuesummary','syncNewExten','syncQueueCallerJoin','uniqueid','YYYY-MM-DD\x20HH:mm:ss','position','merge','pick','keys','push','inspect','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','lastAssignedTo','queuecallerleaveAt','connectedlinenum','connectedlinename','emitVoiceQueueChannelSave','[syncQueueCallerLeave][VoiceQueueReport]','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','queuecallerabandon','queuecallerabandonAt','assigned','membername','reason','toLowerCase','local/','linkedid','queuecallerexit','queuecallerexitAt','seconds','FORWARDTRANSFER','transfertype','destexten','toUpperCase','syncVarSet','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','length','diff','queuecallerjoinAt','milliseconds','total','unmanaged','custom:queuecallerunmanaged','custom:queuecallerabandon','[syncHangup][VoiceQueueReport]','transfereeuniqueid','transferexten','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','transfer','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','transfererchannel','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','lodash','moment','bluebird','util','md5','ioredis','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','queueReports','agents','channels','voiceQueues','campaigns','variables','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','syncAgentConnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','switch','sequence','status','channel','catch','message','No\x20such\x20channel','error'];(function(_0x17a538,_0x2ef17a){var _0x288ace=function(_0x258bec){while(--_0x258bec){_0x17a538['push'](_0x17a538['shift']());}};_0x288ace(++_0x2ef17a);}(_0x53ba,0x14e));var _0xa53b=function(_0x1ef483,_0x319dbc){_0x1ef483=_0x1ef483-0x0;var _0x4f6c73=_0x53ba[_0x1ef483];return _0x4f6c73;};'use strict';var _=require(_0xa53b('0x0'));var moment=require(_0xa53b('0x1'));var BPromise=require(_0xa53b('0x2'));var util=require(_0xa53b('0x3'));var md5=require(_0xa53b('0x4'));var Redis=require(_0xa53b('0x5'));var config=require('../../../config/environment');var logger=require(_0xa53b('0x6'))(_0xa53b('0x7'));var ami=require('../ami');var QueueReport=require('../model/queueReport');config[_0xa53b('0x8')]=_[_0xa53b('0x9')](config[_0xa53b('0x8')],{'host':_0xa53b('0xa'),'port':0x18eb});var io=require(_0xa53b('0xb'))(new Redis(config[_0xa53b('0x8')]));var Sequence=function(){};Sequence[_0xa53b('0xc')][_0xa53b('0xd')]=function(_0x2fff64){this[_0xa53b('0xe')]=this[_0xa53b('0xe')]?this[_0xa53b('0xe')][_0xa53b('0xf')](_0x2fff64):_0x2fff64();};function VoiceQueueReport(_0x2373d0){this['sequence']=new Sequence();this[_0xa53b('0x10')]={};this['agents']=_0x2373d0[_0xa53b('0x11')];this[_0xa53b('0x12')]=_0x2373d0['queueChannels'];this[_0xa53b('0x13')]=_0x2373d0[_0xa53b('0x13')];this['flagQueueSummary']=!![];this[_0xa53b('0x14')]=_0x2373d0[_0xa53b('0x14')];this[_0xa53b('0x15')]={};ami['on']('queuesummary',this['syncQueueSummary'][_0xa53b('0x16')](this));ami['on'](_0xa53b('0x17'),this[_0xa53b('0x18')]['bind'](this));ami['on'](_0xa53b('0x19'),this['syncQueueCallerJoin'][_0xa53b('0x16')](this));ami['on']('queuecallerabandon',this[_0xa53b('0x1a')][_0xa53b('0x16')](this));ami['on'](_0xa53b('0x1b'),this[_0xa53b('0x1c')][_0xa53b('0x16')](this));ami['on']('agentcomplete',this[_0xa53b('0x1d')]['bind'](this));ami['on'](_0xa53b('0x1e'),this[_0xa53b('0x1f')][_0xa53b('0x16')](this));ami['on'](_0xa53b('0x20'),this['syncVarSet'][_0xa53b('0x16')](this));ami['on'](_0xa53b('0x21'),this[_0xa53b('0x22')][_0xa53b('0x16')](this));ami['on'](_0xa53b('0x23'),this[_0xa53b('0x24')][_0xa53b('0x16')](this));ami['on']('musiconholdstart',this[_0xa53b('0x25')][_0xa53b('0x16')](this));ami['on']('musiconholdstop',this[_0xa53b('0x26')][_0xa53b('0x16')](this));ami['on'](_0xa53b('0x27'),this[_0xa53b('0x28')][_0xa53b('0x16')](this));ami['on'](_0xa53b('0x29'),this[_0xa53b('0x2a')][_0xa53b('0x16')](this));this[_0xa53b('0x2b')]();this['loopQueueShow']();}function isNotNull(_0x4ef4d){return _0x4ef4d!==null&&!_['isUndefined'](_0x4ef4d);}function clearChannels(_0x14b8b8){if(!_[_0xa53b('0x2c')](_0x14b8b8)){for(var _0x18f033 in _0x14b8b8){if(_0x14b8b8[_0xa53b('0x2d')](_0x18f033)){delete _0x14b8b8[_0x18f033];}}}}function clearCampaigns(_0x49f86a){if(!_['isEmpty'](_0x49f86a)){for(var _0x2edf1f in _0x49f86a){if(_0x49f86a[_0xa53b('0x2d')](_0x2edf1f)){_0x49f86a[_0x2edf1f]['originated']=0x0;}}}}function clearVoiceQueues(_0x477acc){if(!_[_0xa53b('0x2c')](_0x477acc)){for(var _0xe98a71 in _0x477acc){if(_0x477acc[_0xa53b('0x2d')](_0xe98a71)){_0x477acc[_0xe98a71][_0xa53b('0x2e')]=0x0;_0x477acc[_0xe98a71][_0xa53b('0x2f')]=0x0;_0x477acc[_0xe98a71][_0xa53b('0x30')]=0x0;_0x477acc[_0xe98a71][_0xa53b('0x31')]=0x0;_0x477acc[_0xe98a71]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x234d81){if(!_[_0xa53b('0x2c')](_0x234d81)){for(var _0x35bc39 in _0x234d81){if(_0x234d81['hasOwnProperty'](_0x35bc39)){_0x234d81[_0x35bc39]['unlockRR']=!![];}}}}VoiceQueueReport[_0xa53b('0xc')]['clearZombieChannels']=function(){var _0x161d3c=this;for(var _0x2b280b in this[_0xa53b('0x12')]){if(this['channels'][_0xa53b('0x2d')](_0x2b280b)&&!this[_0xa53b('0x12')][_0x2b280b][_0xa53b('0x32')]){this[_0xa53b('0x33')][_0xa53b('0xd')](function(){if(!_['isNil'](_0x161d3c['channels'][_0x2b280b])){return ami['Action']({'action':_0xa53b('0x34'),'channel':_0x161d3c[_0xa53b('0x12')][_0x2b280b][_0xa53b('0x35')]})[_0xa53b('0x36')](function(_0xfcf749){if(_0xfcf749[_0xa53b('0x37')]===_0xa53b('0x38')){setTimeout(function(){if(_0x161d3c['channels'][_0x2b280b]){delete _0x161d3c[_0xa53b('0x12')][_0x2b280b];logger[_0xa53b('0x39')](_0xa53b('0x3a'),_0x2b280b);}if(_0x161d3c[_0xa53b('0x10')][_0x2b280b]){delete _0x161d3c[_0xa53b('0x10')][_0x2b280b];logger[_0xa53b('0x39')](_0xa53b('0x3b'),_0x2b280b);}if(_0x161d3c['variables'][_0x2b280b]){delete _0x161d3c[_0xa53b('0x15')][_0x2b280b];logger[_0xa53b('0x39')]('[voiceQueueReport][checkVariables]',_0x2b280b);}},0x1f40);}});}});}}};VoiceQueueReport[_0xa53b('0xc')]['syncFullyBooted']=function(){logger[_0xa53b('0x39')](_0xa53b('0x3c'));clearChannels(this['channels']);this[_0xa53b('0x3d')](this['queueReports']);clearAgentBooked(this[_0xa53b('0x11')]);clearVoiceQueues(this[_0xa53b('0x13')]);clearCampaigns(this[_0xa53b('0x14')]);};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x3d')]=function(_0x587ae9){var _0x2724a5=this;if(!_[_0xa53b('0x2c')](_0x587ae9)){for(var _0x3b1d17 in _0x587ae9){if(_0x587ae9['hasOwnProperty'](_0x3b1d17)){_0x2724a5[_0xa53b('0x3e')](_0x587ae9[_0x3b1d17]);delete _0x587ae9[_0x3b1d17];}}}};function loggerCatch(_0xce5c16){return function(_0x4f17c5){logger[_0xa53b('0x39')](_0xce5c16,util['inspect'](_0x4f17c5,{'showHidden':![],'depth':null}));};}VoiceQueueReport['prototype'][_0xa53b('0x3f')]=function(_0x2bc10e,_0x52cf81,_0x18d64f){io['to'](_0x2bc10e)[_0xa53b('0x3f')](_0x52cf81,_0x18d64f);};VoiceQueueReport['prototype']['emitVoiceQueueChannelSave']=function(_0x95b9ec){this[_0xa53b('0x3f')](util[_0xa53b('0x40')]('voice:queue:%s',_0x95b9ec[_0xa53b('0x41')]),_0xa53b('0x42'),_0x95b9ec);};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x3e')]=function(_0x4b8fa2){logger['info'](_0xa53b('0x43'),JSON[_0xa53b('0x44')](_0x4b8fa2));this['emit'](util[_0xa53b('0x40')](_0xa53b('0x45'),_0x4b8fa2[_0xa53b('0x41')]),_0xa53b('0x46'),_0x4b8fa2);};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x47')]=function(_0x294a96){if(_0x294a96[_0xa53b('0x48')]===_0xa53b('0x49')){var _0x36f084={'id':_0x294a96['id'],'name':_0x294a96[_0xa53b('0x41')],'strategy':_0x294a96[_0xa53b('0x4a')],'answered':_0x294a96[_0xa53b('0x4b')],'available':_0x294a96[_0xa53b('0x4c')],'loggedIn':_0x294a96[_0xa53b('0x4d')],'pTalking':_0x294a96[_0xa53b('0x30')],'sumBillable':_0x294a96[_0xa53b('0x4e')],'sumDuration':_0x294a96[_0xa53b('0x4f')],'sumHoldTime':_0x294a96[_0xa53b('0x50')]||0x0,'talking':_0x294a96[_0xa53b('0x2f')],'total':_0x294a96['total'],'type':_0x294a96[_0xa53b('0x48')],'unmanaged':_0x294a96['unmanaged'],'abandoned':_0x294a96[_0xa53b('0x51')],'waiting':_0x294a96[_0xa53b('0x31')]};if(_0x294a96[_0xa53b('0x52')]){_0x36f084[_0xa53b('0x52')]={'id':_0x294a96[_0xa53b('0x52')]['id'],'name':_0x294a96[_0xa53b('0x52')]['name'],'active':_0x294a96['Trunk']['active'],'callerid':_0x294a96[_0xa53b('0x52')]['callerid']};}if(_0x294a96['Interval']){_0x36f084[_0xa53b('0x53')]={'id':_0x294a96[_0xa53b('0x53')]['id'],'name':_0x294a96[_0xa53b('0x53')][_0xa53b('0x41')]};}var _0x2d5a43=md5(JSON[_0xa53b('0x44')](_0x36f084));if(_0x294a96[_0xa53b('0x4')]!==_0x2d5a43){_0x294a96[_0xa53b('0x4')]=_0x2d5a43;this[_0xa53b('0x3f')](util[_0xa53b('0x40')](_0xa53b('0x45'),_0x36f084[_0xa53b('0x41')]),_0xa53b('0x54'),_0x36f084);}}};VoiceQueueReport[_0xa53b('0xc')]['isNotNull']=function(_0x4eace8){return _0x4eace8!==null&&!_[_0xa53b('0x55')](_0x4eace8);};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x56')]=function(){var _0xd5bb28=this;setInterval(function(){_0xd5bb28[_0xa53b('0x57')]();ami[_0xa53b('0x58')]({'action':_0xa53b('0x59')})[_0xa53b('0x36')](loggerCatch(_0xa53b('0x5a')));},0x2710);};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x2b')]=function(){var _0x39a7da=this;setInterval(function(){if(_0x39a7da[_0xa53b('0x5b')]){return ami[_0xa53b('0x58')]({'action':_0xa53b('0x5c')})[_0xa53b('0x5d')](function(_0x1de687){_0x39a7da[_0xa53b('0x5b')]=![];})['catch'](loggerCatch(_0xa53b('0x5e')));}},0x3e8);};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x5f')]=function(_0xfa1931){try{if(this[_0xa53b('0x60')](_0xfa1931)&&this[_0xa53b('0x60')](_0xfa1931['queue'])){if(this[_0xa53b('0x13')][_0xfa1931[_0xa53b('0x61')]]){var _0x5e5109=_[_0xa53b('0x62')](this['channels'],_0xa53b('0x61'))[_0xfa1931['queue']]||0x0;var _0x38c8d2=_0x5e5109-_0xfa1931[_0xa53b('0x63')];if(this[_0xa53b('0x13')][_0xfa1931[_0xa53b('0x61')]]['waiting']!==_[_0xa53b('0x64')](_0xfa1931['callers'])||this[_0xa53b('0x13')][_0xfa1931['queue']][_0xa53b('0x4d')]!==_[_0xa53b('0x64')](_0xfa1931[_0xa53b('0x65')])||this['voiceQueues'][_0xfa1931[_0xa53b('0x61')]][_0xa53b('0x4c')]!==_[_0xa53b('0x64')](_0xfa1931[_0xa53b('0x4c')])||this['voiceQueues'][_0xfa1931[_0xa53b('0x61')]]['talking']!==_0x38c8d2){this[_0xa53b('0x13')][_0xfa1931['queue']][_0xa53b('0x31')]=_[_0xa53b('0x64')](_0xfa1931['callers']);this[_0xa53b('0x13')][_0xfa1931[_0xa53b('0x61')]][_0xa53b('0x4d')]=_[_0xa53b('0x64')](_0xfa1931[_0xa53b('0x65')]);this['voiceQueues'][_0xfa1931['queue']][_0xa53b('0x4c')]=_[_0xa53b('0x64')](_0xfa1931['available']);this[_0xa53b('0x13')][_0xfa1931['queue']][_0xa53b('0x2f')]=_0x38c8d2>0x0?_0x38c8d2:0x0;this['voiceQueues'][_0xfa1931['queue']]['talking']=this[_0xa53b('0x13')][_0xfa1931[_0xa53b('0x61')]]['talking']>_[_0xa53b('0x64')](_0xfa1931[_0xa53b('0x65')])?_['toNumber'](_0xfa1931[_0xa53b('0x65')]):this[_0xa53b('0x13')][_0xfa1931[_0xa53b('0x61')]][_0xa53b('0x2f')];this[_0xa53b('0x47')](this[_0xa53b('0x13')][_0xfa1931['queue']]);}ami[_0xa53b('0x3f')](_0xa53b('0x66'),this[_0xa53b('0x13')][_0xfa1931[_0xa53b('0x61')]]);}}}catch(_0x5a93e0){logger[_0xa53b('0x39')]('[syncQueueSummary][VoiceQueueReport]',util['inspect'](_0x5a93e0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x18')]=function(_0xdbe62d){this[_0xa53b('0x5b')]=!![];};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x67')]=function(_0x175427){};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x68')]=function(_0x14347f){try{if(this[_0xa53b('0x60')](_0x14347f)){if(_[_0xa53b('0x55')](this[_0xa53b('0x10')][_0x14347f[_0xa53b('0x69')]])){this['queueReports'][_0x14347f[_0xa53b('0x69')]]=[];this[_0xa53b('0x12')][_0x14347f[_0xa53b('0x69')]]={};}var _0x38e55f=new QueueReport();_0x38e55f['name']=_0x14347f[_0xa53b('0x61')];_0x38e55f['type']=this['voiceQueues'][_0x38e55f['name']]&&this[_0xa53b('0x13')][_0x38e55f[_0xa53b('0x41')]]['type']?this[_0xa53b('0x13')][_0x38e55f[_0xa53b('0x41')]]['type']||'inbound':_0xa53b('0x49');_0x38e55f[_0xa53b('0x61')]=_0x14347f[_0xa53b('0x61')];_0x38e55f['queuecallerjoinAt']=moment()[_0xa53b('0x40')](_0xa53b('0x6a'));_0x38e55f[_0xa53b('0x6b')]=_0x14347f[_0xa53b('0x6b')];_0x38e55f['count']=_0x14347f['count'];_[_0xa53b('0x6c')](_0x38e55f,_[_0xa53b('0x6d')](_0x14347f,_[_0xa53b('0x6e')](_0x38e55f)));this[_0xa53b('0x10')][_0x14347f[_0xa53b('0x69')]][_0xa53b('0x6f')](_0x38e55f);this[_0xa53b('0x12')][_0x14347f['uniqueid']]=_0x38e55f;this['emitVoiceQueueChannelSave'](_0x38e55f);}}catch(_0x422568){logger[_0xa53b('0x39')]('[syncQueueCallerJoin][VoiceQueueReport]',util[_0xa53b('0x70')](_0x422568,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x1a')]=function(_0x175b62){try{if(this[_0xa53b('0x60')](_0x175b62)){if(this[_0xa53b('0x10')][_0x175b62[_0xa53b('0x69')]]){var _0x2ac188=_[_0xa53b('0x71')](this[_0xa53b('0x10')][_0x175b62[_0xa53b('0x69')]]);_0x2ac188[_0xa53b('0x72')]=![];_0x2ac188[_0xa53b('0x73')]=null;_0x2ac188[_0xa53b('0x74')]=_0x175b62[_0xa53b('0x74')];_0x2ac188['originalposition']=_0x175b62[_0xa53b('0x75')];_0x2ac188['queuecallerabandon']=!![];_0x2ac188['queuecallerabandonAt']=moment()[_0xa53b('0x40')](_0xa53b('0x6a'));_0x2ac188[_0xa53b('0x76')]='ABANDONED';_0x2ac188[_0xa53b('0x77')]=null;this[_0xa53b('0x12')][_0x175b62['uniqueid']]=_0x2ac188;this[_0xa53b('0x3e')](_0x2ac188);}}}catch(_0x21eb90){logger[_0xa53b('0x39')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0xa53b('0x70')](_0x21eb90,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xa53b('0x1c')]=function(_0x4711a9){try{if(this[_0xa53b('0x60')](_0x4711a9)){if(this[_0xa53b('0x10')][_0x4711a9[_0xa53b('0x69')]]){var _0x88f6cb=_[_0xa53b('0x71')](this[_0xa53b('0x10')][_0x4711a9['uniqueid']]);_0x88f6cb[_0xa53b('0x78')]=moment()[_0xa53b('0x40')](_0xa53b('0x6a'));_0x88f6cb[_0xa53b('0x79')]=_0x4711a9[_0xa53b('0x79')];_0x88f6cb[_0xa53b('0x7a')]=_0x4711a9['connectedlinename'];this[_0xa53b('0x12')][_0x4711a9[_0xa53b('0x69')]]=_0x88f6cb;this[_0xa53b('0x7b')](_0x88f6cb);}}}catch(_0x53a5c0){logger[_0xa53b('0x39')](_0xa53b('0x7c'),util[_0xa53b('0x70')](_0x53a5c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x1f')]=function(_0x386d6f){try{if(this[_0xa53b('0x60')](_0x386d6f)){if(this['queueReports'][_0x386d6f['uniqueid']]){var _0x430fac=_[_0xa53b('0x71')](this[_0xa53b('0x10')][_0x386d6f['uniqueid']]);_0x430fac[_0xa53b('0x72')]=!![];_0x430fac[_0xa53b('0x76')]=_0xa53b('0x7d');}}}catch(_0x40b4a6){logger[_0xa53b('0x39')](_0xa53b('0x7e'),util[_0xa53b('0x70')](_0x40b4a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x1d')]=function(_0x20d1ec){try{if(this[_0xa53b('0x60')](_0x20d1ec)){if(this[_0xa53b('0x10')][_0x20d1ec[_0xa53b('0x69')]]){var _0x1e7466=_[_0xa53b('0x71')](this[_0xa53b('0x10')][_0x20d1ec[_0xa53b('0x69')]]);_0x1e7466[_0xa53b('0x7f')]=![];_0x1e7466[_0xa53b('0x80')]=null;_0x1e7466[_0xa53b('0x81')]=!![];_0x1e7466[_0xa53b('0x77')]=_0x20d1ec[_0xa53b('0x82')];_0x1e7466['holdtime']=_0x20d1ec[_0xa53b('0x74')];_0x1e7466[_0xa53b('0x72')]=!![];_0x1e7466['queuecallerexit']=![];_0x1e7466['queuecallerexitAt']=null;if(!_0x1e7466['transfer']){if(_0x20d1ec[_0xa53b('0x83')]=='transfer'){_0x1e7466[_0xa53b('0x76')]='COMPLETED';}else{if(_['startsWith'](_0x20d1ec[_0xa53b('0x35')][_0xa53b('0x84')](),_0xa53b('0x85'))){if(this[_0xa53b('0x10')][_0x20d1ec['linkedid']]){var _0x398c71=_['last'](this[_0xa53b('0x10')][_0x20d1ec[_0xa53b('0x86')]]);_0x398c71[_0xa53b('0x72')]=![];_0x398c71[_0xa53b('0x87')]=!![];_0x398c71[_0xa53b('0x88')]=moment(_0x1e7466['queuecallerjoinAt'])['add'](_0x20d1ec[_0xa53b('0x74')],_0xa53b('0x89'))['format'](_0xa53b('0x6a'));_0x398c71['queuecallerexitreason']=_0xa53b('0x8a');_0x398c71['transfer']=!![];_0x398c71[_0xa53b('0x8b')]='FORWARD';_0x398c71['transferexten']=_0x20d1ec[_0xa53b('0x8c')];_0x398c71['transferuniqueid']=_0x20d1ec[_0xa53b('0x69')];var _0x808ad2=this[_0xa53b('0x10')][_0x20d1ec[_0xa53b('0x86')]];this[_0xa53b('0x10')][_0x20d1ec[_0xa53b('0x86')]]=this[_0xa53b('0x10')][_0x20d1ec[_0xa53b('0x69')]];this[_0xa53b('0x10')][_0x20d1ec['uniqueid']]=_0x808ad2;}}else{_0x1e7466[_0xa53b('0x76')]='COMPLETEDBY'+_0x20d1ec[_0xa53b('0x83')][_0xa53b('0x8d')]();}}}this[_0xa53b('0x12')][_0x20d1ec[_0xa53b('0x69')]]=_0x1e7466;this[_0xa53b('0x3e')](_0x1e7466);}}}catch(_0x1f3f51){logger[_0xa53b('0x39')]('[syncAgentComplete][VoiceQueueReport]',util['inspect'](_0x1f3f51,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xa53b('0x8e')]=function(_0x1547b2){try{if(this[_0xa53b('0x60')](_0x1547b2)){this[_0xa53b('0x8f')](_0x1547b2[_0xa53b('0x69')],_[_0xa53b('0x6e')](_0x1547b2[_0xa53b('0x90')])[0x0],_0x1547b2[_0xa53b('0x91')]);if(this[_0xa53b('0x10')][_0x1547b2['uniqueid']]){var _0x54519a=_[_0xa53b('0x71')](this[_0xa53b('0x10')][_0x1547b2[_0xa53b('0x69')]]);if(_0x54519a){if(this[_0xa53b('0x60')](_0x1547b2[_0xa53b('0x90')])&&this[_0xa53b('0x60')](_0x1547b2[_0xa53b('0x90')][_0xa53b('0x92')])){switch(_0x1547b2[_0xa53b('0x91')]){case _0xa53b('0x93'):_0x54519a[_0xa53b('0x87')]=![];_0x54519a['queuecallerexitAt']=null;break;case _0xa53b('0x94'):_0x54519a[_0xa53b('0x95')]=_0xa53b('0x96');ami[_0xa53b('0x3f')]('custom:timeout',_0x54519a);break;default:_0x54519a[_0xa53b('0x87')]=!![];_0x54519a['queuecallerexitAt']=moment()[_0xa53b('0x40')]('YYYY-MM-DD\x20HH:mm:ss');_0x54519a[_0xa53b('0x78')]=moment()[_0xa53b('0x40')](_0xa53b('0x6a'));}_0x54519a[_0xa53b('0x7f')]=![];_0x54519a['queuecallerabandonAt']=null;_0x54519a[_0xa53b('0x76')]=_0x1547b2[_0xa53b('0x91')];this['channels'][_0x1547b2['uniqueid']]=_0x54519a;this['emitVoiceQueueChannelRemove'](_0x54519a);}else if(this[_0xa53b('0x60')](_0x1547b2[_0xa53b('0x90')])&&this[_0xa53b('0x60')](_0x1547b2[_0xa53b('0x90')][_0xa53b('0x97')])){if(!_0x54519a[_0xa53b('0x7f')]){_0x54519a[_0xa53b('0x87')]=!![];_0x54519a[_0xa53b('0x88')]=moment()[_0xa53b('0x40')](_0xa53b('0x6a'));_0x54519a['queuecallerexitreason']=_0xa53b('0x98');_0x54519a[_0xa53b('0x78')]=moment()[_0xa53b('0x40')](_0xa53b('0x6a'));this[_0xa53b('0x12')][_0x1547b2[_0xa53b('0x69')]]=_0x54519a;}}_0x54519a[_0xa53b('0x15')]=this['variables'][_0x1547b2[_0xa53b('0x69')]];}}}}catch(_0x915438){logger['error'](_0xa53b('0x99'),util[_0xa53b('0x70')](_0x915438,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xa53b('0x8f')]=function(_0x43520e,_0xa7f0d3,_0x4abddc){var _0x2b8fd4=[_0xa53b('0x9a'),_0xa53b('0x9b'),_0xa53b('0x9c'),'rtpaudioqosjitterbridged',_0xa53b('0x9d'),'rtpaudioqoslossbridged',_0xa53b('0x9e'),_0xa53b('0x9f'),'sipcallid',_0xa53b('0xa0'),_0xa53b('0xa1'),'bridgepvtcallid',_0xa53b('0xa2'),'memberdynamic','memberinterface',_0xa53b('0xa3'),_0xa53b('0x82'),_0xa53b('0xa4'),_0xa53b('0xa5')];if(!_[_0xa53b('0xa6')](_0xa7f0d3)&&!_[_0xa53b('0xa7')](_0x2b8fd4,_0xa7f0d3)){if(_[_0xa53b('0x55')](this[_0xa53b('0x15')][_0x43520e])){this['variables'][_0x43520e]={};}this[_0xa53b('0x15')][_0x43520e][_0xa7f0d3]=_0x4abddc;}};VoiceQueueReport['prototype']['syncHangup']=function(_0xaa34fe){try{if(this['isNotNull'](_0xaa34fe)){if(this['queueReports'][_0xaa34fe[_0xa53b('0x69')]]){for(var _0x5143d6=0x0,_0x325559={};_0x5143d6<this[_0xa53b('0x10')][_0xaa34fe[_0xa53b('0x69')]][_0xa53b('0xa8')];_0x5143d6+=0x1){_0x325559=this[_0xa53b('0x10')][_0xaa34fe[_0xa53b('0x69')]][_0x5143d6];if(this[_0xa53b('0x13')][_0x325559[_0xa53b('0x61')]]){if(_0x325559[_0xa53b('0x87')]){this[_0xa53b('0x13')][_0x325559[_0xa53b('0x61')]]['unmanaged']+=0x1;}if(_0x325559[_0xa53b('0x7f')]){this[_0xa53b('0x13')][_0x325559[_0xa53b('0x61')]][_0xa53b('0x51')]+=0x1;}this['voiceQueues'][_0x325559[_0xa53b('0x61')]][_0xa53b('0x50')]+=moment(_0x325559[_0xa53b('0x78')])[_0xa53b('0xa9')](_0x325559[_0xa53b('0xaa')],'seconds')||0x0;if(_0x5143d6===this[_0xa53b('0x10')][_0xaa34fe[_0xa53b('0x69')]][_0xa53b('0xa8')]-0x1){this[_0xa53b('0x13')][_0x325559[_0xa53b('0x61')]][_0xa53b('0x4f')]+=moment()[_0xa53b('0xab')](0x0)[_0xa53b('0xa9')](_0x325559[_0xa53b('0xaa')],_0xa53b('0x89'));this['voiceQueues'][_0x325559[_0xa53b('0x61')]][_0xa53b('0xac')]+=0x1;if(_0x325559[_0xa53b('0x72')]){this[_0xa53b('0x13')][_0x325559[_0xa53b('0x61')]]['answered']+=0x1;this['voiceQueues'][_0x325559['queue']][_0xa53b('0x4e')]+=moment()[_0xa53b('0xab')](0x0)[_0xa53b('0xa9')](_0x325559[_0xa53b('0x78')],_0xa53b('0x89'));_0x325559[_0xa53b('0x73')]=moment()['format'](_0xa53b('0x6a'));_0x325559[_0xa53b('0x87')]=![];_0x325559[_0xa53b('0x88')]=null;}if(_0x325559[_0xa53b('0x87')]){_0x325559[_0xa53b('0x95')]=_0xa53b('0xad');ami[_0xa53b('0x3f')](_0xa53b('0xae'),_0x325559);}if(_0x325559['queuecallerabandon']){_0x325559[_0xa53b('0x95')]=_0xa53b('0x51');ami[_0xa53b('0x3f')](_0xa53b('0xaf'),_0x325559);}}else{this['voiceQueues'][_0x325559['queue']]['sumDuration']+=this[_0xa53b('0x13')][_0x325559[_0xa53b('0x61')]][_0xa53b('0x50')];}this['channels'][_0xaa34fe[_0xa53b('0x69')]]=_0x325559;this[_0xa53b('0x3e')](_0x325559);this[_0xa53b('0x47')](this[_0xa53b('0x13')][_0x325559[_0xa53b('0x61')]]);}}ami[_0xa53b('0x3f')]('custom:voiceQueueReport',this[_0xa53b('0x10')][_0xaa34fe[_0xa53b('0x69')]]);delete this[_0xa53b('0x10')][_0xaa34fe['uniqueid']];delete this[_0xa53b('0x12')][_0xaa34fe[_0xa53b('0x69')]];}if(this['variables'][_0xaa34fe[_0xa53b('0x69')]]){delete this[_0xa53b('0x15')][_0xaa34fe[_0xa53b('0x69')]];}}}catch(_0x33ea85){logger[_0xa53b('0x39')](_0xa53b('0xb0'),util['inspect'](_0x33ea85,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x28')]=function(_0x4a4f44){try{if(this[_0xa53b('0x60')](_0x4a4f44)){var _0x35b50c;if(this['queueReports'][_0x4a4f44[_0xa53b('0xb1')]]){_0x35b50c=_[_0xa53b('0x71')](this[_0xa53b('0x10')][_0x4a4f44[_0xa53b('0xb1')]]);_0x35b50c[_0xa53b('0xb2')]=_0x4a4f44[_0xa53b('0xb3')];_0x35b50c[_0xa53b('0xb4')]=_0x4a4f44[_0xa53b('0xb5')];_0x35b50c[_0xa53b('0x76')]=_0xa53b('0xb6');_0x35b50c['transfer']=!![];_0x35b50c[_0xa53b('0x8b')]=_0xa53b('0xb7');if(this['queueReports'][_0x4a4f44['secondtransfereruniqueid']]){var _0x20476c=this[_0xa53b('0x10')][_0x4a4f44[_0xa53b('0xb5')]];this[_0xa53b('0x10')][_0x4a4f44['secondtransfereruniqueid']]=this[_0xa53b('0x10')][_0x4a4f44[_0xa53b('0xb1')]];this[_0xa53b('0x10')][_0x4a4f44['transfereeuniqueid']]=_0x20476c;var _0xa2c4c9=_[_0xa53b('0x71')](this[_0xa53b('0x10')][_0x4a4f44[_0xa53b('0xb1')]]);_0xa2c4c9[_0xa53b('0x32')]=!![];}}else if(this[_0xa53b('0x10')][_0x4a4f44[_0xa53b('0xb8')]]){_0x35b50c=_[_0xa53b('0x71')](this[_0xa53b('0x10')][_0x4a4f44[_0xa53b('0xb8')]]);_0x35b50c[_0xa53b('0xb2')]=_0x4a4f44[_0xa53b('0xb9')];_0x35b50c['transferuniqueid']=_0x4a4f44[_0xa53b('0xba')];_0x35b50c[_0xa53b('0x76')]=_0xa53b('0xb6');_0x35b50c[_0xa53b('0xbb')]=!![];_0x35b50c['transfertype']='ATTENDED';if(this[_0xa53b('0x10')][_0x4a4f44[_0xa53b('0xba')]]){var _0x20476c=this['queueReports'][_0x4a4f44[_0xa53b('0xba')]];this[_0xa53b('0x10')][_0x4a4f44[_0xa53b('0xba')]]=this[_0xa53b('0x10')][_0x4a4f44['transfertargetuniqueid']];this['queueReports'][_0x4a4f44[_0xa53b('0xb8')]]=_0x20476c;var _0xa2c4c9=_['last'](this[_0xa53b('0x10')][_0x4a4f44[_0xa53b('0xb8')]]);_0xa2c4c9[_0xa53b('0x32')]=!![];}}}}catch(_0x25c0c2){logger[_0xa53b('0x39')](_0xa53b('0xbc'),util['inspect'](_0x25c0c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x2a')]=function(_0x277205){try{if(this[_0xa53b('0x60')](_0x277205)){if(this[_0xa53b('0x10')][_0x277205[_0xa53b('0xb1')]]){var _0x4c734a=_['last'](this[_0xa53b('0x10')][_0x277205[_0xa53b('0xb1')]]);_0x4c734a['queuecallerexitreason']=_0xa53b('0xbd');_0x4c734a[_0xa53b('0xbb')]=!![];_0x4c734a[_0xa53b('0x8b')]=_0xa53b('0xbe');_0x4c734a[_0xa53b('0xb2')]=_0x277205['extension'];_0x4c734a[_0xa53b('0xb4')]=_0x277205[_0xa53b('0xb1')];this[_0xa53b('0x22')]({'event':'BlindTransfer','uniqueid':_0x277205['transfereeuniqueid'],'context':_0x277205['context'],'channel':_0x277205[_0xa53b('0xbf')]});}}}catch(_0xd51036){logger[_0xa53b('0x39')]('[syncBlindTransfer][VoiceQueueReport]',util['inspect'](_0xd51036,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa53b('0xc')]['syncMusicOnHoldStart']=function(_0x226400){try{if(this[_0xa53b('0x60')](_0x226400)){if(this[_0xa53b('0x10')][_0x226400[_0xa53b('0x69')]]){var _0x357c4b=_[_0xa53b('0x71')](this[_0xa53b('0x10')][_0x226400[_0xa53b('0x69')]]);if(!_[_0xa53b('0xa6')](_0x357c4b[_0xa53b('0x78')])){_0x357c4b[_0xa53b('0xc0')]=moment()['format'](_0xa53b('0x6a'));}}}}catch(_0x2cd449){logger[_0xa53b('0x39')](_0xa53b('0xc1'),util['inspect'](_0x2cd449,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa53b('0xc')][_0xa53b('0x26')]=function(_0x51524f){try{if(this[_0xa53b('0x60')](_0x51524f)){if(this[_0xa53b('0x10')][_0x51524f[_0xa53b('0x69')]]){var _0xf60176=_[_0xa53b('0x71')](this[_0xa53b('0x10')][_0x51524f[_0xa53b('0x69')]]);if(!_[_0xa53b('0xa6')](_0xf60176[_0xa53b('0xc0')])){_0xf60176[_0xa53b('0xc2')]+=moment()['milliseconds'](0x0)['diff'](_0xf60176[_0xa53b('0xc0')],'seconds');delete _0xf60176[_0xa53b('0xc0')];}}}}catch(_0x47fe3f){logger[_0xa53b('0x39')](_0xa53b('0xc3'),util[_0xa53b('0x70')](_0x47fe3f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0x04c3=['FORWARD','transferexten','destexten','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','syncVarSet','addVariable','variable','CONTINUE','TIMEOUT','lastevent','timeout','custom:timeout','value','queueposition','EXITWITHKEY','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','length','queuecallerleaveAt','milliseconds','answered','diff','custom:queuecallerunmanaged','custom:queuecallerabandon','custom:voiceQueueReport','transfereeuniqueid','transferuniqueid','ATTENDEDTRANSFER','secondtransfereruniqueid','switch','transfertargetuniqueid','ATTENDED','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','[syncMusicOnHoldStart][VoiceQueueReport]','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','moment','bluebird','util','md5','../../../config/environment','../../../config/logger','../model/queueReport','defaults','redis','localhost','prototype','enqueue','tail','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','blindtransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','unlockRR','isNil','Action','channel','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:save','stringify','inbound','strategy','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','Trunk','active','callerid','Interval','voice_queue:save','isNotNull','loopQueueShow','clearZombieChannels','queues','[queues]','then','[queuesummary]','syncQueueSummary','queue','countBy','callers','toNumber','loggedin','available','emitVoiceQueueSummary','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','uniqueid','type','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','syncQueueCallerAbandon','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','syncAgentConnect','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','syncAgentComplete','assigned','membername','queuecallerexit','transfer','reason','COMPLETED','startsWith','local/','linkedid','queuecallerexitAt','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype'];(function(_0x152ef7,_0x221f4c){var _0x33b535=function(_0x4d9ab7){while(--_0x4d9ab7){_0x152ef7['push'](_0x152ef7['shift']());}};_0x33b535(++_0x221f4c);}(_0x04c3,0x1d6));var _0x304c=function(_0x3d71d8,_0x15d0b4){_0x3d71d8=_0x3d71d8-0x0;var _0x480319=_0x04c3[_0x3d71d8];return _0x480319;};'use strict';var _=require('lodash');var moment=require(_0x304c('0x0'));var BPromise=require(_0x304c('0x1'));var util=require(_0x304c('0x2'));var md5=require(_0x304c('0x3'));var Redis=require('ioredis');var config=require(_0x304c('0x4'));var logger=require(_0x304c('0x5'))('ami');var ami=require('../ami');var QueueReport=require(_0x304c('0x6'));config['redis']=_[_0x304c('0x7')](config[_0x304c('0x8')],{'host':_0x304c('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x304c('0x8')]));var Sequence=function(){};Sequence[_0x304c('0xa')][_0x304c('0xb')]=function(_0x1a6c72){this[_0x304c('0xc')]=this[_0x304c('0xc')]?this[_0x304c('0xc')]['finally'](_0x1a6c72):_0x1a6c72();};function VoiceQueueReport(_0x7f5e3e){this[_0x304c('0xd')]=new Sequence();this[_0x304c('0xe')]={};this[_0x304c('0xf')]=_0x7f5e3e['agents'];this[_0x304c('0x10')]=_0x7f5e3e[_0x304c('0x11')];this[_0x304c('0x12')]=_0x7f5e3e[_0x304c('0x12')];this[_0x304c('0x13')]=!![];this[_0x304c('0x14')]=_0x7f5e3e['campaigns'];this[_0x304c('0x15')]={};ami['on'](_0x304c('0x16'),this['syncQueueSummary'][_0x304c('0x17')](this));ami['on'](_0x304c('0x18'),this[_0x304c('0x19')][_0x304c('0x17')](this));ami['on'](_0x304c('0x1a'),this[_0x304c('0x1b')][_0x304c('0x17')](this));ami['on'](_0x304c('0x1c'),this['syncQueueCallerAbandon'][_0x304c('0x17')](this));ami['on'](_0x304c('0x1d'),this[_0x304c('0x1e')][_0x304c('0x17')](this));ami['on'](_0x304c('0x1f'),this['syncAgentComplete'][_0x304c('0x17')](this));ami['on'](_0x304c('0x20'),this['syncAgentConnect'][_0x304c('0x17')](this));ami['on']('varset',this['syncVarSet'][_0x304c('0x17')](this));ami['on'](_0x304c('0x21'),this[_0x304c('0x22')][_0x304c('0x17')](this));ami['on'](_0x304c('0x23'),this['syncFullyBooted'][_0x304c('0x17')](this));ami['on'](_0x304c('0x24'),this[_0x304c('0x25')][_0x304c('0x17')](this));ami['on'](_0x304c('0x26'),this[_0x304c('0x27')][_0x304c('0x17')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0x304c('0x28'),this[_0x304c('0x29')][_0x304c('0x17')](this));this[_0x304c('0x2a')]();this['loopQueueShow']();}function isNotNull(_0x4be71d){return _0x4be71d!==null&&!_['isUndefined'](_0x4be71d);}function clearChannels(_0x293ca7){if(!_[_0x304c('0x2b')](_0x293ca7)){for(var _0x1cb7ce in _0x293ca7){if(_0x293ca7[_0x304c('0x2c')](_0x1cb7ce)){delete _0x293ca7[_0x1cb7ce];}}}}function clearCampaigns(_0x5c2c72){if(!_[_0x304c('0x2b')](_0x5c2c72)){for(var _0x1d2c9f in _0x5c2c72){if(_0x5c2c72['hasOwnProperty'](_0x1d2c9f)){_0x5c2c72[_0x1d2c9f][_0x304c('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x5897a0){if(!_['isEmpty'](_0x5897a0)){for(var _0x2d0056 in _0x5897a0){if(_0x5897a0[_0x304c('0x2c')](_0x2d0056)){_0x5897a0[_0x2d0056][_0x304c('0x2d')]=0x0;_0x5897a0[_0x2d0056]['talking']=0x0;_0x5897a0[_0x2d0056][_0x304c('0x2e')]=0x0;_0x5897a0[_0x2d0056][_0x304c('0x2f')]=0x0;_0x5897a0[_0x2d0056][_0x304c('0x30')]=!![];}}}}function clearAgentBooked(_0x4cd611){if(!_['isEmpty'](_0x4cd611)){for(var _0x5cb2de in _0x4cd611){if(_0x4cd611['hasOwnProperty'](_0x5cb2de)){_0x4cd611[_0x5cb2de][_0x304c('0x31')]=!![];}}}}VoiceQueueReport['prototype']['clearZombieChannels']=function(){var _0x39c6d1=this;for(var _0x376436 in this['channels']){if(this[_0x304c('0x10')][_0x304c('0x2c')](_0x376436)&&!this['channels'][_0x376436]['switch']){this[_0x304c('0xd')][_0x304c('0xb')](function(){if(!_[_0x304c('0x32')](_0x39c6d1[_0x304c('0x10')][_0x376436])){return ami[_0x304c('0x33')]({'action':'status','channel':_0x39c6d1['channels'][_0x376436][_0x304c('0x34')]})[_0x304c('0x35')](function(_0x29b811){if(_0x29b811[_0x304c('0x36')]===_0x304c('0x37')){setTimeout(function(){if(_0x39c6d1[_0x304c('0x10')][_0x376436]){delete _0x39c6d1[_0x304c('0x10')][_0x376436];logger[_0x304c('0x38')]('[voiceQueueReport][checkChannel]',_0x376436);}if(_0x39c6d1[_0x304c('0xe')][_0x376436]){delete _0x39c6d1[_0x304c('0xe')][_0x376436];logger[_0x304c('0x38')](_0x304c('0x39'),_0x376436);}if(_0x39c6d1['variables'][_0x376436]){delete _0x39c6d1['variables'][_0x376436];logger[_0x304c('0x38')](_0x304c('0x3a'),_0x376436);}},0x1f40);}});}});}}};VoiceQueueReport['prototype']['syncFullyBooted']=function(){logger[_0x304c('0x38')](_0x304c('0x3b'));clearChannels(this[_0x304c('0x10')]);this[_0x304c('0x3c')](this[_0x304c('0xe')]);clearAgentBooked(this[_0x304c('0xf')]);clearVoiceQueues(this[_0x304c('0x12')]);clearCampaigns(this[_0x304c('0x14')]);};VoiceQueueReport[_0x304c('0xa')][_0x304c('0x3c')]=function(_0x5478c2){var _0x2c74c9=this;if(!_[_0x304c('0x2b')](_0x5478c2)){for(var _0x79259b in _0x5478c2){if(_0x5478c2['hasOwnProperty'](_0x79259b)){_0x2c74c9[_0x304c('0x3d')](_0x5478c2[_0x79259b]);delete _0x5478c2[_0x79259b];}}}};function loggerCatch(_0x26b926){return function(_0x410990){logger[_0x304c('0x38')](_0x26b926,util[_0x304c('0x3e')](_0x410990,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x304c('0xa')][_0x304c('0x3f')]=function(_0x5df962,_0x2f9ef5,_0x4e0c02){io['to'](_0x5df962)[_0x304c('0x3f')](_0x2f9ef5,_0x4e0c02);};VoiceQueueReport[_0x304c('0xa')][_0x304c('0x40')]=function(_0x40f13e){this[_0x304c('0x3f')](util[_0x304c('0x41')](_0x304c('0x42'),_0x40f13e[_0x304c('0x43')]),_0x304c('0x44'),_0x40f13e);};VoiceQueueReport[_0x304c('0xa')][_0x304c('0x3d')]=function(_0x1c3362){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x304c('0x45')](_0x1c3362));this[_0x304c('0x3f')](util[_0x304c('0x41')](_0x304c('0x42'),_0x1c3362[_0x304c('0x43')]),'voice_queue_channel:remove',_0x1c3362);};VoiceQueueReport[_0x304c('0xa')]['emitVoiceQueueSummary']=function(_0x58b920){if(_0x58b920['type']===_0x304c('0x46')){var _0xfa398f={'id':_0x58b920['id'],'name':_0x58b920[_0x304c('0x43')],'strategy':_0x58b920[_0x304c('0x47')],'answered':_0x58b920['answered'],'available':_0x58b920['available'],'loggedIn':_0x58b920[_0x304c('0x48')],'pTalking':_0x58b920[_0x304c('0x2e')],'sumBillable':_0x58b920[_0x304c('0x49')],'sumDuration':_0x58b920[_0x304c('0x4a')],'sumHoldTime':_0x58b920[_0x304c('0x4b')]||0x0,'talking':_0x58b920[_0x304c('0x4c')],'total':_0x58b920[_0x304c('0x4d')],'type':_0x58b920['type'],'unmanaged':_0x58b920[_0x304c('0x4e')],'abandoned':_0x58b920[_0x304c('0x4f')],'waiting':_0x58b920['waiting']};if(_0x58b920[_0x304c('0x50')]){_0xfa398f[_0x304c('0x50')]={'id':_0x58b920[_0x304c('0x50')]['id'],'name':_0x58b920[_0x304c('0x50')][_0x304c('0x43')],'active':_0x58b920['Trunk'][_0x304c('0x51')],'callerid':_0x58b920[_0x304c('0x50')][_0x304c('0x52')]};}if(_0x58b920[_0x304c('0x53')]){_0xfa398f[_0x304c('0x53')]={'id':_0x58b920['Interval']['id'],'name':_0x58b920[_0x304c('0x53')][_0x304c('0x43')]};}var _0x8df3c0=md5(JSON['stringify'](_0xfa398f));if(_0x58b920['md5']!==_0x8df3c0){_0x58b920[_0x304c('0x3')]=_0x8df3c0;this['emit'](util[_0x304c('0x41')](_0x304c('0x42'),_0xfa398f[_0x304c('0x43')]),_0x304c('0x54'),_0xfa398f);}}};VoiceQueueReport['prototype'][_0x304c('0x55')]=function(_0x32a043){return _0x32a043!==null&&!_['isUndefined'](_0x32a043);};VoiceQueueReport[_0x304c('0xa')][_0x304c('0x56')]=function(){var _0x429bab=this;setInterval(function(){_0x429bab[_0x304c('0x57')]();ami[_0x304c('0x33')]({'action':_0x304c('0x58')})[_0x304c('0x35')](loggerCatch(_0x304c('0x59')));},0x2710);};VoiceQueueReport[_0x304c('0xa')][_0x304c('0x2a')]=function(){var _0x13b2d3=this;setInterval(function(){if(_0x13b2d3[_0x304c('0x13')]){return ami[_0x304c('0x33')]({'action':_0x304c('0x16')})[_0x304c('0x5a')](function(_0x574ecc){_0x13b2d3[_0x304c('0x13')]=![];})['catch'](loggerCatch(_0x304c('0x5b')));}},0x3e8);};VoiceQueueReport[_0x304c('0xa')][_0x304c('0x5c')]=function(_0x241d21){try{if(this[_0x304c('0x55')](_0x241d21)&&this[_0x304c('0x55')](_0x241d21[_0x304c('0x5d')])){if(this[_0x304c('0x12')][_0x241d21[_0x304c('0x5d')]]){var _0x361763=_[_0x304c('0x5e')](this[_0x304c('0x10')],_0x304c('0x5d'))[_0x241d21[_0x304c('0x5d')]]||0x0;var _0x321639=_0x361763-_0x241d21[_0x304c('0x5f')];if(this[_0x304c('0x12')][_0x241d21[_0x304c('0x5d')]][_0x304c('0x2f')]!==_[_0x304c('0x60')](_0x241d21['callers'])||this[_0x304c('0x12')][_0x241d21[_0x304c('0x5d')]]['loggedIn']!==_[_0x304c('0x60')](_0x241d21[_0x304c('0x61')])||this[_0x304c('0x12')][_0x241d21[_0x304c('0x5d')]][_0x304c('0x62')]!==_[_0x304c('0x60')](_0x241d21[_0x304c('0x62')])||this['voiceQueues'][_0x241d21[_0x304c('0x5d')]][_0x304c('0x4c')]!==_0x321639){this[_0x304c('0x12')][_0x241d21['queue']][_0x304c('0x2f')]=_[_0x304c('0x60')](_0x241d21['callers']);this[_0x304c('0x12')][_0x241d21[_0x304c('0x5d')]][_0x304c('0x48')]=_['toNumber'](_0x241d21[_0x304c('0x61')]);this['voiceQueues'][_0x241d21[_0x304c('0x5d')]][_0x304c('0x62')]=_[_0x304c('0x60')](_0x241d21[_0x304c('0x62')]);this[_0x304c('0x12')][_0x241d21[_0x304c('0x5d')]][_0x304c('0x4c')]=_0x321639>0x0?_0x321639:0x0;this[_0x304c('0x12')][_0x241d21[_0x304c('0x5d')]][_0x304c('0x4c')]=this[_0x304c('0x12')][_0x241d21['queue']][_0x304c('0x4c')]>_[_0x304c('0x60')](_0x241d21['loggedin'])?_[_0x304c('0x60')](_0x241d21['loggedin']):this[_0x304c('0x12')][_0x241d21[_0x304c('0x5d')]][_0x304c('0x4c')];this[_0x304c('0x63')](this['voiceQueues'][_0x241d21[_0x304c('0x5d')]]);}ami[_0x304c('0x3f')](_0x304c('0x64'),this[_0x304c('0x12')][_0x241d21[_0x304c('0x5d')]]);}}}catch(_0x3db201){logger[_0x304c('0x38')](_0x304c('0x65'),util['inspect'](_0x3db201,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x8afd0b){this[_0x304c('0x13')]=!![];};VoiceQueueReport[_0x304c('0xa')]['syncNewExten']=function(_0x3051d2){};VoiceQueueReport[_0x304c('0xa')]['syncQueueCallerJoin']=function(_0x4ac0bf){try{if(this[_0x304c('0x55')](_0x4ac0bf)){if(_['isUndefined'](this[_0x304c('0xe')][_0x4ac0bf[_0x304c('0x66')]])){this[_0x304c('0xe')][_0x4ac0bf[_0x304c('0x66')]]=[];this[_0x304c('0x10')][_0x4ac0bf[_0x304c('0x66')]]={};}var _0x547135=new QueueReport();_0x547135['name']=_0x4ac0bf[_0x304c('0x5d')];_0x547135[_0x304c('0x67')]=this['voiceQueues'][_0x547135[_0x304c('0x43')]]&&this[_0x304c('0x12')][_0x547135[_0x304c('0x43')]][_0x304c('0x67')]?this[_0x304c('0x12')][_0x547135[_0x304c('0x43')]][_0x304c('0x67')]||_0x304c('0x46'):_0x304c('0x46');_0x547135['queue']=_0x4ac0bf[_0x304c('0x5d')];_0x547135['queuecallerjoinAt']=moment()['format'](_0x304c('0x68'));_0x547135[_0x304c('0x69')]=_0x4ac0bf['position'];_0x547135[_0x304c('0x6a')]=_0x4ac0bf['count'];_[_0x304c('0x6b')](_0x547135,_[_0x304c('0x6c')](_0x4ac0bf,_[_0x304c('0x6d')](_0x547135)));this[_0x304c('0xe')][_0x4ac0bf[_0x304c('0x66')]][_0x304c('0x6e')](_0x547135);this[_0x304c('0x10')][_0x4ac0bf[_0x304c('0x66')]]=_0x547135;this[_0x304c('0x40')](_0x547135);}}catch(_0x358c04){logger[_0x304c('0x38')](_0x304c('0x6f'),util['inspect'](_0x358c04,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x304c('0xa')][_0x304c('0x70')]=function(_0x192fa4){try{if(this[_0x304c('0x55')](_0x192fa4)){if(this[_0x304c('0xe')][_0x192fa4[_0x304c('0x66')]]){var _0x1ca5cc=_[_0x304c('0x71')](this['queueReports'][_0x192fa4['uniqueid']]);_0x1ca5cc[_0x304c('0x72')]=![];_0x1ca5cc[_0x304c('0x73')]=null;_0x1ca5cc['holdtime']=_0x192fa4[_0x304c('0x74')];_0x1ca5cc[_0x304c('0x75')]=_0x192fa4[_0x304c('0x75')];_0x1ca5cc[_0x304c('0x1c')]=!![];_0x1ca5cc[_0x304c('0x76')]=moment()['format'](_0x304c('0x68'));_0x1ca5cc[_0x304c('0x77')]=_0x304c('0x78');_0x1ca5cc[_0x304c('0x79')]=null;this[_0x304c('0x10')][_0x192fa4['uniqueid']]=_0x1ca5cc;this[_0x304c('0x3d')](_0x1ca5cc);}}}catch(_0x5254d7){logger[_0x304c('0x38')](_0x304c('0x7a'),util[_0x304c('0x3e')](_0x5254d7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x304c('0xa')]['syncQueueCallerLeave']=function(_0x404c89){try{if(this['isNotNull'](_0x404c89)){if(this['queueReports'][_0x404c89[_0x304c('0x66')]]){var _0x3ac027=_['last'](this['queueReports'][_0x404c89[_0x304c('0x66')]]);_0x3ac027['queuecallerleaveAt']=moment()[_0x304c('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ac027[_0x304c('0x7b')]=_0x404c89[_0x304c('0x7b')];_0x3ac027[_0x304c('0x7c')]=_0x404c89['connectedlinename'];this[_0x304c('0x10')][_0x404c89[_0x304c('0x66')]]=_0x3ac027;this[_0x304c('0x40')](_0x3ac027);}}}catch(_0x2cc3a1){logger[_0x304c('0x38')](_0x304c('0x7d'),util[_0x304c('0x3e')](_0x2cc3a1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x304c('0xa')][_0x304c('0x7e')]=function(_0x241e18){try{if(this[_0x304c('0x55')](_0x241e18)){if(this[_0x304c('0xe')][_0x241e18[_0x304c('0x66')]]){var _0x34e321=_[_0x304c('0x71')](this[_0x304c('0xe')][_0x241e18[_0x304c('0x66')]]);_0x34e321[_0x304c('0x72')]=!![];_0x34e321[_0x304c('0x77')]=_0x304c('0x7f');}}}catch(_0x5420ec){logger['error'](_0x304c('0x80'),util[_0x304c('0x3e')](_0x5420ec,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x304c('0xa')][_0x304c('0x81')]=function(_0x42898e){try{if(this[_0x304c('0x55')](_0x42898e)){if(this[_0x304c('0xe')][_0x42898e['uniqueid']]){var _0x4e4c31=_['last'](this['queueReports'][_0x42898e[_0x304c('0x66')]]);_0x4e4c31[_0x304c('0x1c')]=![];_0x4e4c31['queuecallerabandonAt']=null;_0x4e4c31[_0x304c('0x82')]=!![];_0x4e4c31[_0x304c('0x79')]=_0x42898e[_0x304c('0x83')];_0x4e4c31[_0x304c('0x74')]=_0x42898e[_0x304c('0x74')];_0x4e4c31[_0x304c('0x72')]=!![];_0x4e4c31[_0x304c('0x84')]=![];_0x4e4c31['queuecallerexitAt']=null;if(!_0x4e4c31[_0x304c('0x85')]){if(_0x42898e[_0x304c('0x86')]==_0x304c('0x85')){_0x4e4c31['queuecallerexitreason']=_0x304c('0x87');}else{if(_[_0x304c('0x88')](_0x42898e[_0x304c('0x34')]['toLowerCase'](),_0x304c('0x89'))){if(this[_0x304c('0xe')][_0x42898e[_0x304c('0x8a')]]){var _0x4c6468=_[_0x304c('0x71')](this[_0x304c('0xe')][_0x42898e['linkedid']]);_0x4c6468[_0x304c('0x72')]=![];_0x4c6468[_0x304c('0x84')]=!![];_0x4c6468[_0x304c('0x8b')]=moment(_0x4e4c31[_0x304c('0x8c')])[_0x304c('0x8d')](_0x42898e[_0x304c('0x74')],_0x304c('0x8e'))['format'](_0x304c('0x68'));_0x4c6468[_0x304c('0x77')]=_0x304c('0x8f');_0x4c6468[_0x304c('0x85')]=!![];_0x4c6468[_0x304c('0x90')]=_0x304c('0x91');_0x4c6468[_0x304c('0x92')]=_0x42898e[_0x304c('0x93')];_0x4c6468['transferuniqueid']=_0x42898e[_0x304c('0x66')];var _0x1f61b2=this[_0x304c('0xe')][_0x42898e[_0x304c('0x8a')]];this['queueReports'][_0x42898e[_0x304c('0x8a')]]=this[_0x304c('0xe')][_0x42898e[_0x304c('0x66')]];this[_0x304c('0xe')][_0x42898e[_0x304c('0x66')]]=_0x1f61b2;}}else{_0x4e4c31[_0x304c('0x77')]=_0x304c('0x94')+_0x42898e[_0x304c('0x86')][_0x304c('0x95')]();}}}this[_0x304c('0x10')][_0x42898e['uniqueid']]=_0x4e4c31;this[_0x304c('0x3d')](_0x4e4c31);}}}catch(_0x4dcf69){logger[_0x304c('0x38')](_0x304c('0x96'),util[_0x304c('0x3e')](_0x4dcf69,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x304c('0xa')][_0x304c('0x97')]=function(_0x22486b){try{if(this[_0x304c('0x55')](_0x22486b)){this[_0x304c('0x98')](_0x22486b[_0x304c('0x66')],_['keys'](_0x22486b[_0x304c('0x99')])[0x0],_0x22486b['value']);if(this[_0x304c('0xe')][_0x22486b[_0x304c('0x66')]]){var _0x1c527b=_[_0x304c('0x71')](this['queueReports'][_0x22486b[_0x304c('0x66')]]);if(_0x1c527b){if(this[_0x304c('0x55')](_0x22486b['variable'])&&this[_0x304c('0x55')](_0x22486b[_0x304c('0x99')]['queuestatus'])){switch(_0x22486b['value']){case _0x304c('0x9a'):_0x1c527b[_0x304c('0x84')]=![];_0x1c527b[_0x304c('0x8b')]=null;break;case _0x304c('0x9b'):_0x1c527b[_0x304c('0x9c')]=_0x304c('0x9d');ami['emit'](_0x304c('0x9e'),_0x1c527b);break;default:_0x1c527b[_0x304c('0x84')]=!![];_0x1c527b[_0x304c('0x8b')]=moment()['format'](_0x304c('0x68'));_0x1c527b['queuecallerleaveAt']=moment()[_0x304c('0x41')](_0x304c('0x68'));}_0x1c527b['queuecallerabandon']=![];_0x1c527b[_0x304c('0x76')]=null;_0x1c527b[_0x304c('0x77')]=_0x22486b[_0x304c('0x9f')];this[_0x304c('0x10')][_0x22486b[_0x304c('0x66')]]=_0x1c527b;this[_0x304c('0x3d')](_0x1c527b);}else if(this[_0x304c('0x55')](_0x22486b[_0x304c('0x99')])&&this['isNotNull'](_0x22486b[_0x304c('0x99')][_0x304c('0xa0')])){if(!_0x1c527b[_0x304c('0x1c')]){_0x1c527b['queuecallerexit']=!![];_0x1c527b['queuecallerexitAt']=moment()['format'](_0x304c('0x68'));_0x1c527b['queuecallerexitreason']=_0x304c('0xa1');_0x1c527b['queuecallerleaveAt']=moment()[_0x304c('0x41')](_0x304c('0x68'));this[_0x304c('0x10')][_0x22486b[_0x304c('0x66')]]=_0x1c527b;}}_0x1c527b[_0x304c('0x15')]=this[_0x304c('0x15')][_0x22486b['uniqueid']];}}}}catch(_0x366bc3){logger['error']('[syncVarSet][VoiceQueueReport]',util[_0x304c('0x3e')](_0x366bc3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x304c('0xa')]['addVariable']=function(_0x2860d3,_0x448f00,_0x6f4d0a){var _0x280f34=[_0x304c('0xa2'),'rtpaudioqosbridged',_0x304c('0xa3'),_0x304c('0xa4'),_0x304c('0xa5'),_0x304c('0xa6'),'rtpaudioqosrtt',_0x304c('0xa7'),_0x304c('0xa8'),_0x304c('0xa9'),'bridgepeer',_0x304c('0xaa'),_0x304c('0xab'),_0x304c('0xac'),_0x304c('0xad'),_0x304c('0xae'),_0x304c('0x83'),'memberpenalty',_0x304c('0xaf')];if(!_[_0x304c('0x32')](_0x448f00)&&!_['includes'](_0x280f34,_0x448f00)){if(_['isUndefined'](this[_0x304c('0x15')][_0x2860d3])){this['variables'][_0x2860d3]={};}this[_0x304c('0x15')][_0x2860d3][_0x448f00]=_0x6f4d0a;}};VoiceQueueReport[_0x304c('0xa')]['syncHangup']=function(_0x319f76){try{if(this[_0x304c('0x55')](_0x319f76)){if(this[_0x304c('0xe')][_0x319f76[_0x304c('0x66')]]){for(var _0x2e4b37=0x0,_0x3e501c={};_0x2e4b37<this[_0x304c('0xe')][_0x319f76[_0x304c('0x66')]][_0x304c('0xb0')];_0x2e4b37+=0x1){_0x3e501c=this[_0x304c('0xe')][_0x319f76['uniqueid']][_0x2e4b37];if(this[_0x304c('0x12')][_0x3e501c[_0x304c('0x5d')]]){if(_0x3e501c[_0x304c('0x84')]){this[_0x304c('0x12')][_0x3e501c[_0x304c('0x5d')]][_0x304c('0x4e')]+=0x1;}if(_0x3e501c[_0x304c('0x1c')]){this[_0x304c('0x12')][_0x3e501c[_0x304c('0x5d')]][_0x304c('0x4f')]+=0x1;}this[_0x304c('0x12')][_0x3e501c['queue']][_0x304c('0x4b')]+=moment(_0x3e501c[_0x304c('0xb1')])['diff'](_0x3e501c[_0x304c('0x8c')],_0x304c('0x8e'))||0x0;if(_0x2e4b37===this[_0x304c('0xe')][_0x319f76[_0x304c('0x66')]][_0x304c('0xb0')]-0x1){this[_0x304c('0x12')][_0x3e501c[_0x304c('0x5d')]][_0x304c('0x4a')]+=moment()[_0x304c('0xb2')](0x0)['diff'](_0x3e501c[_0x304c('0x8c')],'seconds');this[_0x304c('0x12')][_0x3e501c['queue']][_0x304c('0x4d')]+=0x1;if(_0x3e501c['queuecallercomplete']){this['voiceQueues'][_0x3e501c[_0x304c('0x5d')]][_0x304c('0xb3')]+=0x1;this[_0x304c('0x12')][_0x3e501c['queue']]['sumBillable']+=moment()['milliseconds'](0x0)[_0x304c('0xb4')](_0x3e501c[_0x304c('0xb1')],_0x304c('0x8e'));_0x3e501c['queuecallercompleteAt']=moment()[_0x304c('0x41')](_0x304c('0x68'));_0x3e501c[_0x304c('0x84')]=![];_0x3e501c[_0x304c('0x8b')]=null;}if(_0x3e501c[_0x304c('0x84')]){_0x3e501c[_0x304c('0x9c')]='unmanaged';ami[_0x304c('0x3f')](_0x304c('0xb5'),_0x3e501c);}if(_0x3e501c[_0x304c('0x1c')]){_0x3e501c['lastevent']=_0x304c('0x4f');ami[_0x304c('0x3f')](_0x304c('0xb6'),_0x3e501c);}}else{this[_0x304c('0x12')][_0x3e501c[_0x304c('0x5d')]][_0x304c('0x4a')]+=this[_0x304c('0x12')][_0x3e501c['queue']][_0x304c('0x4b')];}this['channels'][_0x319f76['uniqueid']]=_0x3e501c;this['emitVoiceQueueChannelRemove'](_0x3e501c);this[_0x304c('0x63')](this[_0x304c('0x12')][_0x3e501c[_0x304c('0x5d')]]);}}ami[_0x304c('0x3f')](_0x304c('0xb7'),this['queueReports'][_0x319f76['uniqueid']]);delete this['queueReports'][_0x319f76[_0x304c('0x66')]];delete this[_0x304c('0x10')][_0x319f76[_0x304c('0x66')]];}if(this[_0x304c('0x15')][_0x319f76['uniqueid']]){delete this[_0x304c('0x15')][_0x319f76[_0x304c('0x66')]];}}}catch(_0x24a60d){logger['error']('[syncHangup][VoiceQueueReport]',util['inspect'](_0x24a60d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAttendedTransfer']=function(_0x4f3df2){try{if(this[_0x304c('0x55')](_0x4f3df2)){var _0x28d0ad;if(this['queueReports'][_0x4f3df2['transfereeuniqueid']]){_0x28d0ad=_[_0x304c('0x71')](this['queueReports'][_0x4f3df2[_0x304c('0xb8')]]);_0x28d0ad[_0x304c('0x92')]=_0x4f3df2['secondtransfererexten'];_0x28d0ad[_0x304c('0xb9')]=_0x4f3df2['secondtransfereruniqueid'];_0x28d0ad['queuecallerexitreason']=_0x304c('0xba');_0x28d0ad[_0x304c('0x85')]=!![];_0x28d0ad[_0x304c('0x90')]='ATTENDED';if(this[_0x304c('0xe')][_0x4f3df2[_0x304c('0xbb')]]){var _0x55a9d8=this[_0x304c('0xe')][_0x4f3df2[_0x304c('0xbb')]];this[_0x304c('0xe')][_0x4f3df2['secondtransfereruniqueid']]=this['queueReports'][_0x4f3df2[_0x304c('0xb8')]];this[_0x304c('0xe')][_0x4f3df2['transfereeuniqueid']]=_0x55a9d8;var _0x4026cb=_[_0x304c('0x71')](this[_0x304c('0xe')][_0x4f3df2[_0x304c('0xb8')]]);_0x4026cb[_0x304c('0xbc')]=!![];}}else if(this[_0x304c('0xe')][_0x4f3df2['transfertargetuniqueid']]){_0x28d0ad=_[_0x304c('0x71')](this[_0x304c('0xe')][_0x4f3df2[_0x304c('0xbd')]]);_0x28d0ad[_0x304c('0x92')]=_0x4f3df2['origtransfererexten'];_0x28d0ad[_0x304c('0xb9')]=_0x4f3df2['origtransfereruniqueid'];_0x28d0ad[_0x304c('0x77')]=_0x304c('0xba');_0x28d0ad['transfer']=!![];_0x28d0ad['transfertype']=_0x304c('0xbe');if(this['queueReports'][_0x4f3df2['origtransfereruniqueid']]){var _0x55a9d8=this[_0x304c('0xe')][_0x4f3df2[_0x304c('0xbf')]];this[_0x304c('0xe')][_0x4f3df2[_0x304c('0xbf')]]=this[_0x304c('0xe')][_0x4f3df2[_0x304c('0xbd')]];this[_0x304c('0xe')][_0x4f3df2[_0x304c('0xbd')]]=_0x55a9d8;var _0x4026cb=_[_0x304c('0x71')](this['queueReports'][_0x4f3df2[_0x304c('0xbd')]]);_0x4026cb[_0x304c('0xbc')]=!![];}}}}catch(_0x3f8b08){logger[_0x304c('0x38')](_0x304c('0xc0'),util[_0x304c('0x3e')](_0x3f8b08,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x304c('0x29')]=function(_0x520c7d){try{if(this['isNotNull'](_0x520c7d)){if(this['queueReports'][_0x520c7d[_0x304c('0xb8')]]){var _0x14d5c4=_['last'](this[_0x304c('0xe')][_0x520c7d['transfereeuniqueid']]);_0x14d5c4[_0x304c('0x77')]=_0x304c('0xc1');_0x14d5c4[_0x304c('0x85')]=!![];_0x14d5c4['transfertype']=_0x304c('0xc2');_0x14d5c4['transferexten']=_0x520c7d[_0x304c('0xc3')];_0x14d5c4[_0x304c('0xb9')]=_0x520c7d[_0x304c('0xb8')];this[_0x304c('0x22')]({'event':_0x304c('0xc4'),'uniqueid':_0x520c7d['transfereeuniqueid'],'context':_0x520c7d[_0x304c('0xc5')],'channel':_0x520c7d[_0x304c('0xc6')]});}}}catch(_0x544161){logger[_0x304c('0x38')](_0x304c('0xc7'),util['inspect'](_0x544161,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x304c('0xa')]['syncMusicOnHoldStart']=function(_0x40a4ef){try{if(this[_0x304c('0x55')](_0x40a4ef)){if(this[_0x304c('0xe')][_0x40a4ef[_0x304c('0x66')]]){var _0x1d792a=_[_0x304c('0x71')](this[_0x304c('0xe')][_0x40a4ef[_0x304c('0x66')]]);if(!_[_0x304c('0x32')](_0x1d792a['queuecallerleaveAt'])){_0x1d792a['mohstarttime']=moment()[_0x304c('0x41')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x1a8bba){logger[_0x304c('0x38')](_0x304c('0xc8'),util[_0x304c('0x3e')](_0x1a8bba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x304c('0xa')][_0x304c('0x27')]=function(_0x8be244){try{if(this[_0x304c('0x55')](_0x8be244)){if(this[_0x304c('0xe')][_0x8be244[_0x304c('0x66')]]){var _0x25e236=_[_0x304c('0x71')](this[_0x304c('0xe')][_0x8be244[_0x304c('0x66')]]);if(!_['isNil'](_0x25e236[_0x304c('0xc9')])){_0x25e236[_0x304c('0xca')]+=moment()[_0x304c('0xb2')](0x0)['diff'](_0x25e236['mohstarttime'],_0x304c('0x8e'));delete _0x25e236[_0x304c('0xc9')];}}}}catch(_0x5a7521){logger[_0x304c('0x38')](_0x304c('0xcb'),util['inspect'](_0x5a7521,{'showHidden':![],'depth':null}));}};module[_0x304c('0xcc')]=VoiceQueueReport;
\ No newline at end of file
index 40b0b79..c772655 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd481=['../client','campaign','Request','CreateReportAgentPreview'];(function(_0x532db8,_0x2a2ae8){var _0xfb62c4=function(_0x17cb45){while(--_0x17cb45){_0x532db8['push'](_0x532db8['shift']());}};_0xfb62c4(++_0x2a2ae8);}(_0xd481,0x1e4));var _0x1d48=function(_0x553ebf,_0x1cdce3){_0x553ebf=_0x553ebf-0x0;var _0x43123d=_0xd481[_0x553ebf];return _0x43123d;};'use strict';var client=require(_0x1d48('0x0'));exports['createHistory']=function(_0x23c6d0){return function(){_0x23c6d0[_0x1d48('0x1')]=_0x23c6d0['queue'];return client[_0x1d48('0x2')](_0x1d48('0x3'),{'body':_0x23c6d0,'log':_0x1d48('0x3')});};};
\ No newline at end of file
+var _0xcaaf=['../client','Request','CreateReportAgentPreview'];(function(_0x25c846,_0x1582a4){var _0x358256=function(_0x5a9d29){while(--_0x5a9d29){_0x25c846['push'](_0x25c846['shift']());}};_0x358256(++_0x1582a4);}(_0xcaaf,0x66));var _0xfcaa=function(_0x106be7,_0x1b934f){_0x106be7=_0x106be7-0x0;var _0x30f83a=_0xcaaf[_0x106be7];return _0x30f83a;};'use strict';var client=require(_0xfcaa('0x0'));exports['createHistory']=function(_0x56da71){return function(){_0x56da71['campaign']=_0x56da71['queue'];return client[_0xfcaa('0x1')](_0xfcaa('0x2'),{'body':_0x56da71,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
index 54153fa..2006d52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008e=['../client','create','CreateAttachment'];(function(_0x337fe1,_0x2810fa){var _0x55ba41=function(_0x2f5cff){while(--_0x2f5cff){_0x337fe1['push'](_0x337fe1['shift']());}};_0x55ba41(++_0x2810fa);}(_0x008e,0x1d1));var _0xe008=function(_0x272aa4,_0x4675d0){_0x272aa4=_0x272aa4-0x0;var _0x64ecae=_0x008e[_0x272aa4];return _0x64ecae;};'use strict';var client=require(_0xe008('0x0'));exports[_0xe008('0x1')]=function(_0x4ad747){return client['Request'](_0xe008('0x2'),{'body':_0x4ad747,'log':'CreateAttachment'});};
\ No newline at end of file
+var _0x5d17=['Request','CreateAttachment'];(function(_0x530e10,_0x307855){var _0x63794e=function(_0x46a0e0){while(--_0x46a0e0){_0x530e10['push'](_0x530e10['shift']());}};_0x63794e(++_0x307855);}(_0x5d17,0x134));var _0x75d1=function(_0x16851c,_0x2f22fc){_0x16851c=_0x16851c-0x0;var _0x4cd143=_0x5d17[_0x16851c];return _0x4cd143;};'use strict';var client=require('../client');exports['create']=function(_0xbc3fc7){return client[_0x75d1('0x0')](_0x75d1('0x1'),{'body':_0xbc3fc7,'log':_0x75d1('0x1')});};
\ No newline at end of file
index c665f5d..8b2c925 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25e7=['dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalInterval','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','callerid','Interval','Intervals','interval','SquareProject','../client','getCampaigns','Request','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x25e7,0x1d6));var _0x725e=function(_0x4b19e3,_0x2b63c3){_0x4b19e3=_0x4b19e3-0x0;var _0x2ce22a=_0x25e7[_0x4b19e3];return _0x2ce22a;};'use strict';var client=require(_0x725e('0x0'));exports[_0x725e('0x1')]=function(){return function(){return client[_0x725e('0x2')](_0x725e('0x3'),{'options':{'raw':![],'attributes':['id',_0x725e('0x4'),_0x725e('0x5'),_0x725e('0x6'),_0x725e('0x7'),_0x725e('0x8'),_0x725e('0x9'),'dialOriginateTimeout','dialCongestionMaxRetry',_0x725e('0xa'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x725e('0xb'),_0x725e('0xc'),_0x725e('0xd'),_0x725e('0xe'),_0x725e('0xf'),_0x725e('0x10'),_0x725e('0x11'),_0x725e('0x12'),_0x725e('0x13'),_0x725e('0x14'),_0x725e('0x15'),_0x725e('0x16'),'dialAgentRejectRetryFrequency','dialTimezone',_0x725e('0x17'),_0x725e('0x18'),'dialAMDInitialSilence','dialAMDGreeting',_0x725e('0x19'),_0x725e('0x1a'),'dialAMDMinWordLength',_0x725e('0x1b'),_0x725e('0x1c'),_0x725e('0x1d'),'dialAMDMaximumWordLength',_0x725e('0x1e'),_0x725e('0x1f'),_0x725e('0x20'),_0x725e('0x21')],'include':[{'model':_0x725e('0x22'),'as':_0x725e('0x22'),'attributes':['id','name',_0x725e('0x23'),_0x725e('0x6')]},{'model':_0x725e('0x22'),'as':'TrunkBackup','attributes':['id',_0x725e('0x4'),_0x725e('0x23'),_0x725e('0x6')]},{'model':_0x725e('0x24'),'as':_0x725e('0x24'),'attributes':['id',_0x725e('0x4')],'include':[{'model':'Interval','as':_0x725e('0x25'),'attributes':['id',_0x725e('0x4'),_0x725e('0x26')]}]},{'model':_0x725e('0x27'),'as':_0x725e('0x27'),'attributes':['id',_0x725e('0x4')]}]},'log':'getCampaign'});};};
\ No newline at end of file
+var _0x1e7b=['../client','getCampaigns','GetCampaign','name','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','callerid','TrunkBackup','Interval','Intervals','interval','SquareProject'];(function(_0x3cae30,_0x5d8b99){var _0x263f77=function(_0x308222){while(--_0x308222){_0x3cae30['push'](_0x3cae30['shift']());}};_0x263f77(++_0x5d8b99);}(_0x1e7b,0x12d));var _0xb1e7=function(_0x362a9c,_0x434fd5){_0x362a9c=_0x362a9c-0x0;var _0x159079=_0x1e7b[_0x362a9c];return _0x159079;};'use strict';var client=require(_0xb1e7('0x0'));exports[_0xb1e7('0x1')]=function(){return function(){return client['Request'](_0xb1e7('0x2'),{'options':{'raw':![],'attributes':['id',_0xb1e7('0x3'),'type',_0xb1e7('0x4'),_0xb1e7('0x5'),_0xb1e7('0x6'),_0xb1e7('0x7'),'dialOriginateTimeout',_0xb1e7('0x8'),_0xb1e7('0x9'),_0xb1e7('0xa'),_0xb1e7('0xb'),_0xb1e7('0xc'),'dialNoAnswerRetryFrequency',_0xb1e7('0xd'),_0xb1e7('0xe'),_0xb1e7('0xf'),_0xb1e7('0x10'),_0xb1e7('0x11'),_0xb1e7('0x12'),_0xb1e7('0x13'),_0xb1e7('0x14'),_0xb1e7('0x15'),_0xb1e7('0x16'),_0xb1e7('0x17'),_0xb1e7('0x18'),_0xb1e7('0x19'),_0xb1e7('0x1a'),_0xb1e7('0x1b'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0xb1e7('0x1c'),_0xb1e7('0x1d'),_0xb1e7('0x1e'),'dialAMDMaximumNumberOfWords',_0xb1e7('0x1f'),_0xb1e7('0x20'),_0xb1e7('0x21'),'dialPrefix',_0xb1e7('0x22'),_0xb1e7('0x23')],'include':[{'model':_0xb1e7('0x24'),'as':'Trunk','attributes':['id',_0xb1e7('0x3'),_0xb1e7('0x25'),_0xb1e7('0x4')]},{'model':_0xb1e7('0x24'),'as':_0xb1e7('0x26'),'attributes':['id',_0xb1e7('0x3'),_0xb1e7('0x25'),_0xb1e7('0x4')]},{'model':_0xb1e7('0x27'),'as':_0xb1e7('0x27'),'attributes':['id',_0xb1e7('0x3')],'include':[{'model':_0xb1e7('0x27'),'as':_0xb1e7('0x28'),'attributes':['id',_0xb1e7('0x3'),_0xb1e7('0x29')]}]},{'model':'SquareProject','as':_0xb1e7('0x2a'),'attributes':['id',_0xb1e7('0x3')]}]},'log':'getCampaign'});};};
\ No newline at end of file
index 4ad3477..ed00085 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86dc=['../client','createContact','Request','CreateCmContact','showContact','ShowCmContact'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x86dc,0x19e));var _0xc86d=function(_0x2ed6a6,_0x436a44){_0x2ed6a6=_0x2ed6a6-0x0;var _0x287e74=_0x86dc[_0x2ed6a6];return _0x287e74;};'use strict';var client=require(_0xc86d('0x0'));exports[_0xc86d('0x1')]=function(_0x399762){return function(){return client[_0xc86d('0x2')](_0xc86d('0x3'),{'body':_0x399762,'log':'CreateCmContact'});};};exports[_0xc86d('0x4')]=function(_0x3267b4){return function(){return client[_0xc86d('0x2')](_0xc86d('0x5'),{'options':_0x3267b4,'log':_0xc86d('0x5')});};};
\ No newline at end of file
+var _0x36d7=['ShowCmContact','../client','createContact','Request','CreateCmContact'];(function(_0x8eac50,_0x5ce34c){var _0x100f43=function(_0x2bed76){while(--_0x2bed76){_0x8eac50['push'](_0x8eac50['shift']());}};_0x100f43(++_0x5ce34c);}(_0x36d7,0xd8));var _0x736d=function(_0x5500d7,_0x1e6c6b){_0x5500d7=_0x5500d7-0x0;var _0x1ff879=_0x36d7[_0x5500d7];return _0x1ff879;};'use strict';var client=require(_0x736d('0x0'));exports[_0x736d('0x1')]=function(_0x57bc7f){return function(){return client[_0x736d('0x2')](_0x736d('0x3'),{'body':_0x57bc7f,'log':'CreateCmContact'});};};exports['showContact']=function(_0x21f862){return function(){return client[_0x736d('0x2')](_0x736d('0x4'),{'options':_0x21f862,'log':'ShowCmContact'});};};
\ No newline at end of file
index 5f0b9d6..239dd61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8126=['GetContactRecallMe','priority','DESC','voicePause','db.CmHopper.UserId','../client','moment','lodash','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','VoiceQueueId','CampaignId','DestroyCmHopper','getContactDialer','GetContactDialer','scheduledat','ASC','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','countReScheduled','getContactPreview','User','Agent','name','VoiceQueue','Queue','getContactRecallMe'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x8126,0x18b));var _0x6812=function(_0x5223f0,_0x12c73c){_0x5223f0=_0x5223f0-0x0;var _0x55dd06=_0x8126[_0x5223f0];return _0x55dd06;};'use strict';var client=require(_0x6812('0x0'));var moment=require(_0x6812('0x1'));var _=require(_0x6812('0x2'));exports[_0x6812('0x3')]=function(_0xbc1214,_0x1bf161){return function(){return client[_0x6812('0x4')](_0x6812('0x5'),{'options':{'where':{'VoiceQueueId':_0xbc1214},'include':[{'model':_0x6812('0x6'),'as':_0x6812('0x7')}],'limit':_0x1bf161,'raw':![]},'log':_0x6812('0x8')});};};exports[_0x6812('0x9')]=function(_0x5ac5fa,_0x1ea699,_0x232013){return function(){return client['Request'](_0x6812('0xa'),{'body':_0x5ac5fa,'options':{'where':{'VoiceQueueId':_0x1ea699,'scheduledat':{'$lte':moment()[_0x6812('0xb')](_0x6812('0xc'))}},'limit':_0x232013},'log':_0x6812('0xa')});};};exports[_0x6812('0xd')]=function(_0x2dab3a){return function(){return client[_0x6812('0x4')]('UpdateCmHopper',{'body':_0x2dab3a,'options':{'where':{'ContactId':_0x2dab3a[_0x6812('0xe')],'ListId':_0x2dab3a['ListId'],'VoiceQueueId':_0x2dab3a[_0x6812('0xf')],'CampaignId':_0x2dab3a[_0x6812('0x10')]}},'log':_0x6812('0xd')});};};exports['destroyContact']=function(_0x215934,_0x286d32,_0x4684ee){return function(){return client[_0x6812('0x4')](_0x6812('0x11'),{'options':{'where':{'VoiceQueueId':_0x215934,'ListId':_0x286d32,'ContactId':_0x4684ee}},'log':_0x6812('0x11')});};};exports[_0x6812('0x12')]=function(_0x1f45d0,_0x1b8cf1,_0x3f2bcb,_0x35a88d){return function(){return client[_0x6812('0x4')](_0x6812('0x13'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x1f45d0,'active':![],'scheduledat':{'$lte':moment()[_0x6812('0xb')](_0x6812('0xc'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x1b8cf1}}]},'order':[['priority','DESC'],[_0x6812('0x14'),_0x35a88d],['id',_0x6812('0x15')]],'raw':!![],'limit':_0x3f2bcb},'log':'GetContactDialer'});};};exports['getContactDialerIvr']=function(_0x42a5d4,_0x42fed8,_0x133ce9){return function(){return client[_0x6812('0x4')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x42a5d4,'active':![],'scheduledat':{'$lte':moment()['format'](_0x6812('0xc'))}},'include':[{'model':_0x6812('0x6'),'as':_0x6812('0x7')}],'order':[['priority','DESC'],['scheduledat',_0x133ce9],['id','ASC']],'raw':!![],'limit':_0x42fed8},'log':_0x6812('0x16')});};};exports[_0x6812('0x17')]=function(_0x5e4e3d,_0x439619){return function(){_0x5e4e3d[_0x6812('0x18')]=_0x5e4e3d[_0x6812('0x19')];return client[_0x6812('0x4')]('MoveContactManagedDialer',{'body':_0x5e4e3d,'options':{'where':{'ContactId':_0x5e4e3d['ContactId'],'ListId':_0x5e4e3d['ListId'],'VoiceQueueId':_0x5e4e3d[_0x6812('0xf')],'CampaignId':_0x5e4e3d[_0x6812('0x10')],'active':_0x439619?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports[_0x6812('0x1a')]=function(_0x56c9b8){return function(){return client[_0x6812('0x4')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x56c9b8['id']?_0x56c9b8['id']||null:null}},'log':_0x6812('0x1a')});};};exports[_0x6812('0x1b')]=function(_0x1d2055){return function(){return client[_0x6812('0x4')]('GetCmHopperPreview',{'options':{'where':{'id':_0x1d2055},'include':[{'model':_0x6812('0x6'),'as':_0x6812('0x7')},{'model':_0x6812('0x1c'),'as':_0x6812('0x1d'),'attributes':['id',_0x6812('0x1e')]},{'model':_0x6812('0x1f'),'as':_0x6812('0x20'),'attributes':['id',_0x6812('0x1e')]}],'raw':!![]},'log':_0x6812('0x8')});};};exports['unlockContact']=function(_0x505547,_0x556167,_0x1079cf){return function(){return client[_0x6812('0x4')]('UpdateCmHopper',{'body':_0x505547,'options':{'where':{'id':_0x556167},'limit':_0x1079cf},'log':_0x6812('0xa')});};};exports[_0x6812('0x21')]=function(_0xb620e3,_0x5544eb){return function(){return client[_0x6812('0x4')](_0x6812('0x22'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0xb620e3,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format'](_0x6812('0xc'))},'UserId':{'$in':_0x5544eb}},'order':[[_0x6812('0x23'),_0x6812('0x24')],['scheduledat','DESC'],['id',_0x6812('0x15')]],'include':[{'model':_0x6812('0x6'),'as':_0x6812('0x7')},{'model':_0x6812('0x1c'),'as':_0x6812('0x1d'),'attributes':['id','name',_0x6812('0x25')]}],'group':_0x6812('0x26'),'raw':!![]},'log':_0x6812('0x13')});};};
\ No newline at end of file
+var _0x5a22=['db.CmHopper.UserId','../client','moment','getContacts','Request','Contact','getCmHopper','UpdateCmHopper','ContactId','ListId','VoiceQueueId','CampaignId','rescheduleContact','DestroyCmHopper','getContactDialer','GetContactDialer','YYYY-MM-DD\x20HH:mm:ss','DESC','scheduledat','getContactDialerIvr','format','CmContact','GetContactDialerIvr','campaign','queue','MoveContactManagedDialer','countReScheduled','GetCmHopperPreview','User','Agent','name','VoiceQueue','Queue','getContactRecallMe','ASC'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5a22,0x1a5));var _0x25a2=function(_0x416a38,_0x5004e0){_0x416a38=_0x416a38-0x0;var _0xec6c28=_0x5a22[_0x416a38];return _0xec6c28;};'use strict';var client=require(_0x25a2('0x0'));var moment=require(_0x25a2('0x1'));var _=require('lodash');exports[_0x25a2('0x2')]=function(_0x58b434,_0x390af4){return function(){return client[_0x25a2('0x3')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x58b434},'include':[{'model':'CmContact','as':_0x25a2('0x4')}],'limit':_0x390af4,'raw':![]},'log':_0x25a2('0x5')});};};exports['updateContacts']=function(_0x2a3fa3,_0x19def0,_0x111b37){return function(){return client[_0x25a2('0x3')](_0x25a2('0x6'),{'body':_0x2a3fa3,'options':{'where':{'VoiceQueueId':_0x19def0,'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x111b37},'log':_0x25a2('0x6')});};};exports['rescheduleContact']=function(_0x1a4bc7){return function(){return client[_0x25a2('0x3')](_0x25a2('0x6'),{'body':_0x1a4bc7,'options':{'where':{'ContactId':_0x1a4bc7[_0x25a2('0x7')],'ListId':_0x1a4bc7[_0x25a2('0x8')],'VoiceQueueId':_0x1a4bc7[_0x25a2('0x9')],'CampaignId':_0x1a4bc7[_0x25a2('0xa')]}},'log':_0x25a2('0xb')});};};exports['destroyContact']=function(_0x1fb90a,_0x4cf926,_0x1731bd){return function(){return client[_0x25a2('0x3')](_0x25a2('0xc'),{'options':{'where':{'VoiceQueueId':_0x1fb90a,'ListId':_0x4cf926,'ContactId':_0x1731bd}},'log':_0x25a2('0xc')});};};exports[_0x25a2('0xd')]=function(_0x357ce2,_0x4fad5c,_0x4ba341,_0x2e1065){return function(){return client['Request'](_0x25a2('0xe'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x357ce2,'active':![],'scheduledat':{'$lte':moment()['format'](_0x25a2('0xf'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x4fad5c}}]},'order':[['priority',_0x25a2('0x10')],[_0x25a2('0x11'),_0x2e1065],['id','ASC']],'raw':!![],'limit':_0x4ba341},'log':'GetContactDialer'});};};exports[_0x25a2('0x12')]=function(_0x562579,_0x2fc4cd,_0x551236){return function(){return client[_0x25a2('0x3')](_0x25a2('0xe'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x562579,'active':![],'scheduledat':{'$lte':moment()[_0x25a2('0x13')](_0x25a2('0xf'))}},'include':[{'model':_0x25a2('0x14'),'as':_0x25a2('0x4')}],'order':[['priority',_0x25a2('0x10')],[_0x25a2('0x11'),_0x551236],['id','ASC']],'raw':!![],'limit':_0x2fc4cd},'log':_0x25a2('0x15')});};};exports['moveContactManagedDialer']=function(_0x562183,_0x4c9875){return function(){_0x562183[_0x25a2('0x16')]=_0x562183[_0x25a2('0x17')];return client['Request'](_0x25a2('0x18'),{'body':_0x562183,'options':{'where':{'ContactId':_0x562183[_0x25a2('0x7')],'ListId':_0x562183['ListId'],'VoiceQueueId':_0x562183[_0x25a2('0x9')],'CampaignId':_0x562183['CampaignId'],'active':_0x4c9875?undefined:!![]}},'log':_0x25a2('0x18')});};};exports['countReScheduled']=function(_0x1abded){return function(){return client[_0x25a2('0x3')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x1abded['id']?_0x1abded['id']||null:null}},'log':_0x25a2('0x19')});};};exports['getContactPreview']=function(_0x55175d){return function(){return client[_0x25a2('0x3')](_0x25a2('0x1a'),{'options':{'where':{'id':_0x55175d},'include':[{'model':'CmContact','as':'Contact'},{'model':_0x25a2('0x1b'),'as':_0x25a2('0x1c'),'attributes':['id',_0x25a2('0x1d')]},{'model':_0x25a2('0x1e'),'as':_0x25a2('0x1f'),'attributes':['id',_0x25a2('0x1d')]}],'raw':!![]},'log':_0x25a2('0x5')});};};exports['unlockContact']=function(_0x25a627,_0x206859,_0x4041c0){return function(){return client[_0x25a2('0x3')](_0x25a2('0x6'),{'body':_0x25a627,'options':{'where':{'id':_0x206859},'limit':_0x4041c0},'log':'UpdateCmHopper'});};};exports[_0x25a2('0x20')]=function(_0x12b190,_0x5ba73b){return function(){return client['Request']('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x12b190,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x25a2('0x13')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x5ba73b}},'order':[['priority',_0x25a2('0x10')],[_0x25a2('0x11'),_0x25a2('0x10')],['id',_0x25a2('0x21')]],'include':[{'model':_0x25a2('0x14'),'as':_0x25a2('0x4')},{'model':'User','as':_0x25a2('0x1c'),'attributes':['id',_0x25a2('0x1d'),'voicePause']}],'group':_0x25a2('0x22'),'raw':!![]},'log':_0x25a2('0xe')});};};
\ No newline at end of file
index 527f537..06250c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb03e=['swapAdditionalPhones','SwapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters','../client','moment','verifyAdditionalPhones','Request','VerifyAdditionalPhones'];(function(_0x1ce3fa,_0x2a15c2){var _0x27a3b5=function(_0xa3f501){while(--_0xa3f501){_0x1ce3fa['push'](_0x1ce3fa['shift']());}};_0x27a3b5(++_0x2a15c2);}(_0xb03e,0x1bd));var _0xeb03=function(_0x225e77,_0x5b16fd){_0x225e77=_0x225e77-0x0;var _0x2cabc0=_0xb03e[_0x225e77];return _0x2cabc0;};'use strict';var client=require(_0xeb03('0x0'));var moment=require(_0xeb03('0x1'));exports[_0xeb03('0x2')]=function(_0x274a96,_0x2a64aa,_0xc69940){return function(){return client[_0xeb03('0x3')]('VerifyAdditionalPhones',{'body':_0x274a96,'reason':_0x2a64aa,'entity':_0xc69940,'log':_0xeb03('0x4')});};};exports[_0xeb03('0x5')]=function(_0x4f102e,_0x474ea3,_0x2f9397){return function(){return client[_0xeb03('0x3')](_0xeb03('0x6'),{'body':_0x4f102e,'duration':_0x474ea3,'waitTime':_0x2f9397,'log':_0xeb03('0x6')});};};exports[_0xeb03('0x7')]=function(_0x41ff61){return function(){return client[_0xeb03('0x3')](_0xeb03('0x8'),{'body':_0x41ff61,'log':_0xeb03('0x8')});};};
\ No newline at end of file
+var _0x66d2=['verifyAdditionalPhones','Request','VerifyAdditionalPhones','SwapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters','../client'];(function(_0xf0e992,_0x55e838){var _0x2b0d21=function(_0x3a6063){while(--_0x3a6063){_0xf0e992['push'](_0xf0e992['shift']());}};_0x2b0d21(++_0x55e838);}(_0x66d2,0xca));var _0x266d=function(_0xbd80b4,_0x4d2c63){_0xbd80b4=_0xbd80b4-0x0;var _0xf0a526=_0x66d2[_0xbd80b4];return _0xf0a526;};'use strict';var client=require(_0x266d('0x0'));var moment=require('moment');exports[_0x266d('0x1')]=function(_0x11eea8,_0x105541,_0xf805d0){return function(){return client[_0x266d('0x2')](_0x266d('0x3'),{'body':_0x11eea8,'reason':_0x105541,'entity':_0xf805d0,'log':_0x266d('0x3')});};};exports['swapAdditionalPhones']=function(_0x431adf,_0x3b3c3a,_0x4fef6b){return function(){return client[_0x266d('0x2')](_0x266d('0x4'),{'body':_0x431adf,'duration':_0x3b3c3a,'waitTime':_0x4fef6b,'log':_0x266d('0x4')});};};exports[_0x266d('0x5')]=function(_0x1043e3){return function(){return client[_0x266d('0x2')](_0x266d('0x6'),{'body':_0x1043e3,'log':_0x266d('0x6')});};};
\ No newline at end of file
index 4938762..ffb1682 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d17=['phone','checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','Request','GetCmHopperBlack','Contact'];(function(_0x133c9d,_0x322539){var _0x524ef7=function(_0xe8120d){while(--_0xe8120d){_0x133c9d['push'](_0x133c9d['shift']());}};_0x524ef7(++_0x322539);}(_0x2d17,0x17e));var _0x72d1=function(_0x597804,_0x5574a6){_0x597804=_0x597804-0x0;var _0x426849=_0x2d17[_0x597804];return _0x426849;};'use strict';var client=require(_0x72d1('0x0'));exports[_0x72d1('0x1')]=function(_0x52078d){return function(){return client[_0x72d1('0x2')](_0x72d1('0x3'),{'options':{'where':{'VoiceQueueId':_0x52078d['VoiceQueueId'],'phone':_0x52078d[_0x72d1('0x4')][_0x72d1('0x5')]},'raw':![]},'log':'GetCmHopperBlack'});};};exports[_0x72d1('0x6')]=function(_0x4dfee1){return function(){return client[_0x72d1('0x2')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x4dfee1[_0x72d1('0x7')],'phone':_0x4dfee1[_0x72d1('0x4')]['phone']},'raw':![]},'log':_0x72d1('0x8')});};};
\ No newline at end of file
+var _0xec56=['phone','checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr','../client','Request','GetCmHopperBlack','VoiceQueueId','Contact'];(function(_0x59a959,_0x472b32){var _0x523004=function(_0x3bf6fa){while(--_0x3bf6fa){_0x59a959['push'](_0x59a959['shift']());}};_0x523004(++_0x472b32);}(_0xec56,0x1bd));var _0x6ec5=function(_0x48c58b,_0x1095d4){_0x48c58b=_0x48c58b-0x0;var _0x2b0a7c=_0xec56[_0x48c58b];return _0x2b0a7c;};'use strict';var client=require(_0x6ec5('0x0'));exports['checkIsBlackList']=function(_0x4d6dcd){return function(){return client[_0x6ec5('0x1')](_0x6ec5('0x2'),{'options':{'where':{'VoiceQueueId':_0x4d6dcd[_0x6ec5('0x3')],'phone':_0x4d6dcd[_0x6ec5('0x4')][_0x6ec5('0x5')]},'raw':![]},'log':_0x6ec5('0x2')});};};exports[_0x6ec5('0x6')]=function(_0x173aeb){return function(){return client[_0x6ec5('0x1')](_0x6ec5('0x2'),{'options':{'where':{'CampaignId':_0x173aeb[_0x6ec5('0x7')],'phone':_0x173aeb[_0x6ec5('0x4')][_0x6ec5('0x5')]},'raw':![]},'log':_0x6ec5('0x8')});};};
\ No newline at end of file
index 8e95902..f82329c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf072=['createContact','queue','CreateCmHopperFinal','../client'];(function(_0x3e1ee9,_0x112074){var _0x10f4f2=function(_0x1d3684){while(--_0x1d3684){_0x3e1ee9['push'](_0x3e1ee9['shift']());}};_0x10f4f2(++_0x112074);}(_0xf072,0x1cf));var _0x2f07=function(_0x329e21,_0x377892){_0x329e21=_0x329e21-0x0;var _0x2c9019=_0xf072[_0x329e21];return _0x2c9019;};'use strict';var client=require(_0x2f07('0x0'));exports[_0x2f07('0x1')]=function(_0x304ea5){return function(){_0x304ea5['campaign']=_0x304ea5[_0x2f07('0x2')];return client['Request'](_0x2f07('0x3'),{'body':_0x304ea5,'log':_0x2f07('0x3')});};};
\ No newline at end of file
+var _0xbd0a=['CreateCmHopperFinal','../client'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x2e1813,_0x43e8fd){_0x2e1813=_0x2e1813-0x0;var _0x56c4b9=_0xbd0a[_0x2e1813];return _0x56c4b9;};'use strict';var client=require(_0xabd0('0x0'));exports['createContact']=function(_0x3b0fc0){return function(){_0x3b0fc0['campaign']=_0x3b0fc0['queue'];return client['Request'](_0xabd0('0x1'),{'body':_0x3b0fc0,'log':_0xabd0('0x1')});};};
\ No newline at end of file
index a8f87ed..ebfae80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58a4=['startOf','day','endOf','getCampaignHopperHistory','../client','moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','GetVoiceQueueHopperHistory'];(function(_0x5bc1e6,_0x3001d6){var _0x50c81b=function(_0xedea63){while(--_0xedea63){_0x5bc1e6['push'](_0x5bc1e6['shift']());}};_0x50c81b(++_0x3001d6);}(_0x58a4,0xbf));var _0x458a=function(_0x22e11c,_0x32ef49){_0x22e11c=_0x22e11c-0x0;var _0x4fd8ed=_0x58a4[_0x22e11c];return _0x4fd8ed;};'use strict';var client=require(_0x458a('0x0'));var moment=require(_0x458a('0x1'));exports[_0x458a('0x2')]=function(_0x1e23ea){return function(){_0x1e23ea[_0x458a('0x3')]=_0x1e23ea[_0x458a('0x4')];return client[_0x458a('0x5')](_0x458a('0x6'),{'body':_0x1e23ea,'log':_0x458a('0x6')});};};exports[_0x458a('0x7')]=function(_0x2fde72){return function(){return client[_0x458a('0x5')](_0x458a('0x8'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x2fde72,'minutes')[_0x458a('0x9')](_0x458a('0xa')),moment()[_0x458a('0x9')](_0x458a('0xa'))]}},'raw':![]},'log':_0x458a('0xb')});};};exports['getVoiceQueueHopperHistory']=function(_0x4bedce){return function(){return client[_0x458a('0x5')](_0x458a('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x458a('0xd')](_0x458a('0xe'))[_0x458a('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x458a('0xf')](_0x458a('0xe'))['format'](_0x458a('0xa'))]},'campaigntype':_0x458a('0x4')},'raw':![]},'log':_0x458a('0xc')});};};exports[_0x458a('0x10')]=function(_0x2e788b){return function(){return client['Request']('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x458a('0xd')]('day')[_0x458a('0x9')](_0x458a('0xa')),moment()[_0x458a('0xf')](_0x458a('0xe'))[_0x458a('0x9')](_0x458a('0xa'))]},'campaigntype':'ivr'},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
+var _0xe2cf=['CreateCmHopperHistory','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','endOf','day','GetCampaignHopperHistory','ivr','moment','queue','Request'];(function(_0x4271f5,_0x114773){var _0x57b45f=function(_0x324bdd){while(--_0x324bdd){_0x4271f5['push'](_0x4271f5['shift']());}};_0x57b45f(++_0x114773);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x52ae40,_0x23c2bf){_0x52ae40=_0x52ae40-0x0;var _0xab6ed1=_0xe2cf[_0x52ae40];return _0xab6ed1;};'use strict';var client=require('../client');var moment=require(_0xfe2c('0x0'));exports['createHistory']=function(_0x11c3a4){return function(){_0x11c3a4['campaign']=_0x11c3a4[_0xfe2c('0x1')];return client[_0xfe2c('0x2')](_0xfe2c('0x3'),{'body':_0x11c3a4,'log':_0xfe2c('0x3')});};};exports['avgHandleTime']=function(_0xd40c31){return function(){return client[_0xfe2c('0x2')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0xd40c31,_0xfe2c('0x4'))[_0xfe2c('0x5')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['format'](_0xfe2c('0x6'))]}},'raw':![]},'log':_0xfe2c('0x7')});};};exports[_0xfe2c('0x8')]=function(_0x562414){return function(){return client['Request'](_0xfe2c('0x9'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xfe2c('0xa')]('day')[_0xfe2c('0x5')](_0xfe2c('0x6')),moment()[_0xfe2c('0xb')](_0xfe2c('0xc'))[_0xfe2c('0x5')](_0xfe2c('0x6'))]},'campaigntype':_0xfe2c('0x1')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports['getCampaignHopperHistory']=function(_0x59ecf8){return function(){return client['Request'](_0xfe2c('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')[_0xfe2c('0x5')](_0xfe2c('0x6')),moment()[_0xfe2c('0xb')](_0xfe2c('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0xfe2c('0xe')},'raw':![]},'log':_0xfe2c('0xd')});};};
\ No newline at end of file
index 01d956c..5ba9e50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa12b=['maxrate','gateway','faxdetect','t38timeout','TrunkId','ListId','key','Trunk','callerid','active','getFaxAccount','NotifyFaxAccount','../client','Request','GetFaxAccount','name','ecm','headerinfo','minrate'];(function(_0x36de4f,_0x350d30){var _0x1a91c2=function(_0x475034){while(--_0x475034){_0x36de4f['push'](_0x36de4f['shift']());}};_0x1a91c2(++_0x350d30);}(_0xa12b,0xf0));var _0xba12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa12b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xba12('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0xba12('0x1')](_0xba12('0x2'),{'options':{'raw':![],'attributes':['id',_0xba12('0x3'),'description',_0xba12('0x4'),_0xba12('0x5'),'localstationid',_0xba12('0x6'),_0xba12('0x7'),'modem',_0xba12('0x8'),_0xba12('0x9'),_0xba12('0xa'),'tech',_0xba12('0xb'),_0xba12('0xc'),_0xba12('0xd')],'include':[{'model':'Trunk','as':_0xba12('0xe'),'attributes':['id',_0xba12('0x3'),_0xba12('0xf'),_0xba12('0x10')]}]},'log':_0xba12('0x11')});};};exports['notify']=function(_0x16d360,_0x30a01a){return client[_0xba12('0x1')]('NotifyFaxAccount',{'account':{'id':_0x16d360},'body':_0x30a01a,'log':_0xba12('0x12')});};
\ No newline at end of file
+var _0x6985=['Request','GetFaxAccount','name','description','headerinfo','localstationid','minrate','maxrate','gateway','faxdetect','t38timeout','tech','TrunkId','ListId','Trunk','callerid','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts'];(function(_0x2535c4,_0x75b983){var _0x331a74=function(_0x43516b){while(--_0x43516b){_0x2535c4['push'](_0x2535c4['shift']());}};_0x331a74(++_0x75b983);}(_0x6985,0x67));var _0x5698=function(_0x422c73,_0x185974){_0x422c73=_0x422c73-0x0;var _0x3e82ea=_0x6985[_0x422c73];return _0x3e82ea;};'use strict';var client=require(_0x5698('0x0'));exports[_0x5698('0x1')]=function(){return function(){return client[_0x5698('0x2')](_0x5698('0x3'),{'options':{'raw':![],'attributes':['id',_0x5698('0x4'),_0x5698('0x5'),'ecm',_0x5698('0x6'),_0x5698('0x7'),_0x5698('0x8'),_0x5698('0x9'),'modem',_0x5698('0xa'),_0x5698('0xb'),_0x5698('0xc'),_0x5698('0xd'),_0x5698('0xe'),_0x5698('0xf'),'key'],'include':[{'model':_0x5698('0x10'),'as':_0x5698('0x10'),'attributes':['id',_0x5698('0x4'),_0x5698('0x11'),'active']}]},'log':_0x5698('0x12')});};};exports[_0x5698('0x13')]=function(_0x5b2253,_0x504e49){return client['Request']('NotifyFaxAccount',{'account':{'id':_0x5b2253},'body':_0x504e49,'log':_0x5698('0x14')});};
\ No newline at end of file
index 501d13a..b684837 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3934=['update','Request','../client'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x3934,0x197));var _0x4393=function(_0x4956b6,_0x37a247){_0x4956b6=_0x4956b6-0x0;var _0x291eab=_0x3934[_0x4956b6];return _0x291eab;};'use strict';var client=require(_0x4393('0x0'));exports[_0x4393('0x1')]=function(_0x4784a4,_0x3161c4){return client[_0x4393('0x2')]('UpdateFaxMessage',{'body':_0x3161c4,'options':{'where':{'AttachmentId':_0x4784a4}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
+var _0xc223=['../client','update','Request','UpdateFaxMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc223,0xe8));var _0x3c22=function(_0x241adc,_0x41421e){_0x241adc=_0x241adc-0x0;var _0x551d73=_0xc223[_0x241adc];return _0x551d73;};'use strict';var client=require(_0x3c22('0x0'));exports[_0x3c22('0x1')]=function(_0x5db803,_0x309269){return client[_0x3c22('0x2')](_0x3c22('0x3'),{'body':_0x309269,'options':{'where':{'AttachmentId':_0x5db803}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
index 2214631..c31c8ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad04=['name','Descriptions','keyType','variableName','Fields','idField','Tag','Tags','../../client','getDeskAccounts','Request','GetDeskAccount','description','username','password','remoteUri','authType','DeskConfiguration','DeskField','Subjects','type','content','Variable'];(function(_0x43a966,_0x3e7ab4){var _0x1adbdc=function(_0x570561){while(--_0x570561){_0x43a966['push'](_0x43a966['shift']());}};_0x1adbdc(++_0x3e7ab4);}(_0xad04,0x92));var _0x4ad0=function(_0x135ef5,_0x5df81e){_0x135ef5=_0x135ef5-0x0;var _0x49c945=_0xad04[_0x135ef5];return _0x49c945;};'use strict';var client=require(_0x4ad0('0x0'));exports[_0x4ad0('0x1')]=function(){return function(_0x5b2371){return client[_0x4ad0('0x2')](_0x4ad0('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x4ad0('0x4'),_0x4ad0('0x5'),_0x4ad0('0x6'),_0x4ad0('0x7'),_0x4ad0('0x8'),'type','serverUrl'],'include':[{'model':_0x4ad0('0x9'),'as':'Configurations','attributes':['id','name'],'include':[{'model':_0x4ad0('0xa'),'as':_0x4ad0('0xb'),'attributes':['id',_0x4ad0('0xc'),_0x4ad0('0xd'),'variableName'],'include':[{'model':'Variable','as':_0x4ad0('0xe'),'attributes':['id',_0x4ad0('0xf')]}]},{'model':'DeskField','as':_0x4ad0('0x10'),'attributes':['id',_0x4ad0('0xc'),_0x4ad0('0xd'),'key',_0x4ad0('0x11'),'keyContent',_0x4ad0('0x12')],'include':[{'model':'Variable','as':_0x4ad0('0xe'),'attributes':['id','name']}]},{'model':_0x4ad0('0xa'),'as':_0x4ad0('0x13'),'attributes':['id','type',_0x4ad0('0xd'),_0x4ad0('0x14'),'nameField','customField',_0x4ad0('0x12')],'include':[{'model':_0x4ad0('0xe'),'as':_0x4ad0('0xe'),'attributes':['id','name']}]},{'model':_0x4ad0('0x15'),'as':_0x4ad0('0x16'),'attributes':['id',_0x4ad0('0xf')]}]}]},'log':'GetDeskAccount'});};};
\ No newline at end of file
+var _0x51ed=['Fields','nameField','customField','Tag','Tags','../../client','getDeskAccounts','Request','name','description','username','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','DeskField','Subjects','variableName','Variable','Descriptions','content','key','keyType'];(function(_0x3f9c49,_0x1b315a){var _0x48b5d0=function(_0x1acd94){while(--_0x1acd94){_0x3f9c49['push'](_0x3f9c49['shift']());}};_0x48b5d0(++_0x1b315a);}(_0x51ed,0xef));var _0xd51e=function(_0x4b017a,_0x171787){_0x4b017a=_0x4b017a-0x0;var _0x19c799=_0x51ed[_0x4b017a];return _0x19c799;};'use strict';var client=require(_0xd51e('0x0'));exports[_0xd51e('0x1')]=function(){return function(_0x4ca489){return client[_0xd51e('0x2')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0xd51e('0x3'),_0xd51e('0x4'),_0xd51e('0x5'),_0xd51e('0x6'),_0xd51e('0x7'),_0xd51e('0x8'),_0xd51e('0x9'),_0xd51e('0xa')],'include':[{'model':_0xd51e('0xb'),'as':_0xd51e('0xc'),'attributes':['id',_0xd51e('0x3')],'include':[{'model':_0xd51e('0xd'),'as':_0xd51e('0xe'),'attributes':['id',_0xd51e('0x9'),'content',_0xd51e('0xf')],'include':[{'model':_0xd51e('0x10'),'as':_0xd51e('0x10'),'attributes':['id',_0xd51e('0x3')]}]},{'model':_0xd51e('0xd'),'as':_0xd51e('0x11'),'attributes':['id',_0xd51e('0x9'),_0xd51e('0x12'),_0xd51e('0x13'),_0xd51e('0x14'),'keyContent',_0xd51e('0xf')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xd51e('0x3')]}]},{'model':_0xd51e('0xd'),'as':_0xd51e('0x15'),'attributes':['id',_0xd51e('0x9'),_0xd51e('0x12'),'idField',_0xd51e('0x16'),_0xd51e('0x17'),_0xd51e('0xf')],'include':[{'model':_0xd51e('0x10'),'as':'Variable','attributes':['id',_0xd51e('0x3')]}]},{'model':_0xd51e('0x18'),'as':_0xd51e('0x19'),'attributes':['id',_0xd51e('0x3')]}]}]},'log':'GetDeskAccount'});};};
\ No newline at end of file
index 010af5d..eae6aec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a8=['idField','nameField','customField','GetDynamics365Account','../../client','getDynamics365Accounts','Request','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','description','Dynamics365Configuration','Configurations','ticketType','Dynamics365Field','Subjects','variableName','Variable','Descriptions','type','content','keyType','keyContent','Fields'];(function(_0x5e4759,_0x1f8793){var _0x1aefe3=function(_0x1be07e){while(--_0x1be07e){_0x5e4759['push'](_0x5e4759['shift']());}};_0x1aefe3(++_0x1f8793);}(_0xa8a8,0xec));var _0x8a8a=function(_0x5570d3,_0x31b527){_0x5570d3=_0x5570d3-0x0;var _0x10223e=_0xa8a8[_0x5570d3];return _0x10223e;};'use strict';var client=require(_0x8a8a('0x0'));exports[_0x8a8a('0x1')]=function(){return function(_0x1934ab){return client[_0x8a8a('0x2')]('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0x8a8a('0x3'),_0x8a8a('0x4'),_0x8a8a('0x5'),_0x8a8a('0x6'),_0x8a8a('0x7'),_0x8a8a('0x8'),_0x8a8a('0x9'),_0x8a8a('0xa'),_0x8a8a('0xb')],'include':[{'model':_0x8a8a('0xc'),'as':_0x8a8a('0xd'),'attributes':['id',_0x8a8a('0x3'),_0x8a8a('0xe')],'include':[{'model':_0x8a8a('0xf'),'as':_0x8a8a('0x10'),'attributes':['id','type','content',_0x8a8a('0x11')],'include':[{'model':'Variable','as':_0x8a8a('0x12'),'attributes':['id',_0x8a8a('0x3')]}]},{'model':'Dynamics365Field','as':_0x8a8a('0x13'),'attributes':['id',_0x8a8a('0x14'),_0x8a8a('0x15'),'key',_0x8a8a('0x16'),_0x8a8a('0x17'),_0x8a8a('0x11')],'include':[{'model':_0x8a8a('0x12'),'as':'Variable','attributes':['id',_0x8a8a('0x3')]}]},{'model':'Dynamics365Field','as':_0x8a8a('0x18'),'attributes':['id',_0x8a8a('0x14'),_0x8a8a('0x15'),_0x8a8a('0x19'),_0x8a8a('0x1a'),_0x8a8a('0x1b'),_0x8a8a('0x11')],'include':[{'model':'Variable','as':_0x8a8a('0x12'),'attributes':['id','name']}]}]}]},'log':_0x8a8a('0x1c')});};};
\ No newline at end of file
+var _0x3eea=['idField','customField','../../client','Request','GetDynamics365Account','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','ticketType','Subjects','content','Variable','Descriptions','type','keyType','keyContent','variableName','Fields'];(function(_0x25fd82,_0x394dfb){var _0x537ec6=function(_0x4fc937){while(--_0x4fc937){_0x25fd82['push'](_0x25fd82['shift']());}};_0x537ec6(++_0x394dfb);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x4c762d,_0x1e2f8b){_0x4c762d=_0x4c762d-0x0;var _0x31cdb5=_0x3eea[_0x4c762d];return _0x31cdb5;};'use strict';var client=require(_0xa3ee('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x8d10d0){return client[_0xa3ee('0x1')](_0xa3ee('0x2'),{'options':{'raw':![],'attributes':['id',_0xa3ee('0x3'),_0xa3ee('0x4'),_0xa3ee('0x5'),_0xa3ee('0x6'),_0xa3ee('0x7'),_0xa3ee('0x8'),_0xa3ee('0x9'),_0xa3ee('0xa'),'description'],'include':[{'model':'Dynamics365Configuration','as':_0xa3ee('0xb'),'attributes':['id','name',_0xa3ee('0xc')],'include':[{'model':'Dynamics365Field','as':_0xa3ee('0xd'),'attributes':['id','type',_0xa3ee('0xe'),'variableName'],'include':[{'model':_0xa3ee('0xf'),'as':_0xa3ee('0xf'),'attributes':['id',_0xa3ee('0x3')]}]},{'model':'Dynamics365Field','as':_0xa3ee('0x10'),'attributes':['id',_0xa3ee('0x11'),'content','key',_0xa3ee('0x12'),_0xa3ee('0x13'),_0xa3ee('0x14')],'include':[{'model':_0xa3ee('0xf'),'as':'Variable','attributes':['id',_0xa3ee('0x3')]}]},{'model':'Dynamics365Field','as':_0xa3ee('0x15'),'attributes':['id',_0xa3ee('0x11'),_0xa3ee('0xe'),_0xa3ee('0x16'),'nameField',_0xa3ee('0x17'),_0xa3ee('0x14')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]}]}]},'log':_0xa3ee('0x2')});};};
\ No newline at end of file
index a94eee1..72ddea7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3de5=['key','keyType','keyContent','Fields','nameField','customField','../../client','getFreshdeskAccounts','GetFreshdeskAccount','name','username','apiKey','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','content','variableName','Variable','Descriptions','type'];(function(_0x305369,_0x4f62ff){var _0x1669b6=function(_0x12cdc4){while(--_0x12cdc4){_0x305369['push'](_0x305369['shift']());}};_0x1669b6(++_0x4f62ff);}(_0x3de5,0xde));var _0x53de=function(_0x44ecd4,_0x2333c3){_0x44ecd4=_0x44ecd4-0x0;var _0x5dbe93=_0x3de5[_0x44ecd4];return _0x5dbe93;};'use strict';var client=require(_0x53de('0x0'));exports[_0x53de('0x1')]=function(){return function(_0x40611b){return client['Request'](_0x53de('0x2'),{'options':{'raw':![],'attributes':['id',_0x53de('0x3'),_0x53de('0x4'),_0x53de('0x5'),_0x53de('0x6'),_0x53de('0x7')],'include':[{'model':_0x53de('0x8'),'as':_0x53de('0x9'),'attributes':['id','name'],'include':[{'model':_0x53de('0xa'),'attributes':['id',_0x53de('0x3')]},{'model':_0x53de('0xb'),'as':_0x53de('0xc'),'attributes':['id','type',_0x53de('0xd'),_0x53de('0xe')],'include':[{'model':_0x53de('0xf'),'as':'Variable','attributes':['id',_0x53de('0x3')]}]},{'model':_0x53de('0xb'),'as':_0x53de('0x10'),'attributes':['id',_0x53de('0x11'),_0x53de('0xd'),_0x53de('0x12'),_0x53de('0x13'),_0x53de('0x14'),_0x53de('0xe')],'include':[{'model':'Variable','as':_0x53de('0xf'),'attributes':['id',_0x53de('0x3')]}]},{'model':_0x53de('0xb'),'as':_0x53de('0x15'),'attributes':['id',_0x53de('0x11'),_0x53de('0xd'),'idField',_0x53de('0x16'),_0x53de('0x17'),_0x53de('0xe')],'include':[{'model':_0x53de('0xf'),'as':_0x53de('0xf'),'attributes':['id',_0x53de('0x3')]}]}]}]},'log':_0x53de('0x2')});};};
\ No newline at end of file
+var _0xa932=['Descriptions','key','keyType','keyContent','Fields','idField','nameField','customField','../../client','Request','GetFreshdeskAccount','name','username','apiKey','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','type','content','variableName','Variable'];(function(_0x13f4b4,_0xb5c9e8){var _0x46d556=function(_0x59e51b){while(--_0x59e51b){_0x13f4b4['push'](_0x13f4b4['shift']());}};_0x46d556(++_0xb5c9e8);}(_0xa932,0x11b));var _0x2a93=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0xa932[_0x171fdc];return _0x3782ea;};'use strict';var client=require(_0x2a93('0x0'));exports['getFreshdeskAccounts']=function(){return function(_0x531a55){return client[_0x2a93('0x1')](_0x2a93('0x2'),{'options':{'raw':![],'attributes':['id',_0x2a93('0x3'),_0x2a93('0x4'),_0x2a93('0x5'),_0x2a93('0x6'),_0x2a93('0x7')],'include':[{'model':_0x2a93('0x8'),'as':_0x2a93('0x9'),'attributes':['id',_0x2a93('0x3')],'include':[{'model':_0x2a93('0xa'),'attributes':['id','name']},{'model':_0x2a93('0xb'),'as':_0x2a93('0xc'),'attributes':['id',_0x2a93('0xd'),_0x2a93('0xe'),_0x2a93('0xf')],'include':[{'model':'Variable','as':_0x2a93('0x10'),'attributes':['id',_0x2a93('0x3')]}]},{'model':_0x2a93('0xb'),'as':_0x2a93('0x11'),'attributes':['id',_0x2a93('0xd'),'content',_0x2a93('0x12'),_0x2a93('0x13'),_0x2a93('0x14'),_0x2a93('0xf')],'include':[{'model':_0x2a93('0x10'),'as':'Variable','attributes':['id',_0x2a93('0x3')]}]},{'model':_0x2a93('0xb'),'as':_0x2a93('0x15'),'attributes':['id',_0x2a93('0xd'),_0x2a93('0xe'),_0x2a93('0x16'),_0x2a93('0x17'),_0x2a93('0x18'),'variableName'],'include':[{'model':_0x2a93('0x10'),'as':'Variable','attributes':['id',_0x2a93('0x3')]}]}]}]},'log':_0x2a93('0x2')});};};
\ No newline at end of file
index 011af61..13aa0d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ae7=['GetFreshsalesAccount','name','username','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','type','variableName','Variable','Descriptions','content','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request'];(function(_0x10b665,_0x2c901e){var _0x1a07c5=function(_0x467aab){while(--_0x467aab){_0x10b665['push'](_0x10b665['shift']());}};_0x1a07c5(++_0x2c901e);}(_0x7ae7,0xd9));var _0x77ae=function(_0x45b4c3,_0xf3dc72){_0x45b4c3=_0x45b4c3-0x0;var _0x54e82c=_0x7ae7[_0x45b4c3];return _0x54e82c;};'use strict';var client=require(_0x77ae('0x0'));exports[_0x77ae('0x1')]=function(){return function(_0x4a7a13){return client[_0x77ae('0x2')](_0x77ae('0x3'),{'options':{'raw':![],'attributes':['id',_0x77ae('0x4'),_0x77ae('0x5'),_0x77ae('0x6'),_0x77ae('0x7'),_0x77ae('0x8')],'include':[{'model':_0x77ae('0x9'),'as':_0x77ae('0xa'),'attributes':['id',_0x77ae('0x4')],'include':[{'model':_0x77ae('0xb'),'as':_0x77ae('0xc'),'attributes':['id',_0x77ae('0xd'),'content',_0x77ae('0xe')],'include':[{'model':_0x77ae('0xf'),'as':_0x77ae('0xf'),'attributes':['id',_0x77ae('0x4')]}]},{'model':_0x77ae('0xb'),'as':_0x77ae('0x10'),'attributes':['id','type',_0x77ae('0x11'),'key','keyType',_0x77ae('0x12'),_0x77ae('0xe')],'include':[{'model':_0x77ae('0xf'),'as':'Variable','attributes':['id',_0x77ae('0x4')]}]}]}]},'log':_0x77ae('0x13')});};};
\ No newline at end of file
+var _0x65f4=['name','FreshsalesField','type','Variable','Descriptions','content','key','keyContent','variableName','GetFreshsalesccount','Request','GetFreshsalesAccount','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x65f4,0x19a));var _0x465f=function(_0x4119ed,_0x33b77b){_0x4119ed=_0x4119ed-0x0;var _0x1e1302=_0x65f4[_0x4119ed];return _0x1e1302;};'use strict';var client=require('../../client');exports['getFreshsalesAccounts']=function(){return function(_0x39de85){return client[_0x465f('0x0')](_0x465f('0x1'),{'options':{'raw':![],'attributes':['id','name','username',_0x465f('0x2'),_0x465f('0x3'),_0x465f('0x4')],'include':[{'model':'FreshsalesConfiguration','as':_0x465f('0x5'),'attributes':['id',_0x465f('0x6')],'include':[{'model':_0x465f('0x7'),'as':'Subjects','attributes':['id',_0x465f('0x8'),'content','variableName'],'include':[{'model':_0x465f('0x9'),'as':_0x465f('0x9'),'attributes':['id',_0x465f('0x6')]}]},{'model':_0x465f('0x7'),'as':_0x465f('0xa'),'attributes':['id',_0x465f('0x8'),_0x465f('0xb'),_0x465f('0xc'),'keyType',_0x465f('0xd'),_0x465f('0xe')],'include':[{'model':_0x465f('0x9'),'as':_0x465f('0x9'),'attributes':['id',_0x465f('0x6')]}]}]}]},'log':_0x465f('0xf')});};};
\ No newline at end of file
index e83362c..b8d07b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3164=['SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','SalesforceField','Subjects','Descriptions','Variable','../../client','getSalesforceAccounts','GetSalesforceAccount','name','username','clientId','clientSecret','serverUrl'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x3164,0xe6));var _0x4316=function(_0x1b9e3f,_0x5ea90b){_0x1b9e3f=_0x1b9e3f-0x0;var _0x27b608=_0x3164[_0x1b9e3f];return _0x27b608;};'use strict';var client=require(_0x4316('0x0'));exports[_0x4316('0x1')]=function(){return function(_0x260e97){return client['Request'](_0x4316('0x2'),{'options':{'raw':![],'attributes':['id',_0x4316('0x3'),_0x4316('0x4'),'password','remoteUri',_0x4316('0x5'),_0x4316('0x6'),'securityToken',_0x4316('0x7'),'type'],'include':[{'model':_0x4316('0x8'),'as':_0x4316('0x9'),'attributes':['id',_0x4316('0x3'),_0x4316('0xa'),_0x4316('0xb'),_0x4316('0xc')],'include':[{'model':_0x4316('0xd'),'as':_0x4316('0xe'),'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x4316('0x3')]}]},{'model':_0x4316('0xd'),'as':_0x4316('0xf'),'include':[{'model':_0x4316('0x10'),'as':_0x4316('0x10'),'attributes':['id',_0x4316('0x3')]}]},{'model':_0x4316('0xd'),'as':'Fields','include':[{'model':_0x4316('0x10'),'as':_0x4316('0x10'),'attributes':['id',_0x4316('0x3')]}]}]}]},'log':_0x4316('0x2')});};};
\ No newline at end of file
+var _0x706f=['username','password','remoteUri','clientSecret','securityToken','serverUrl','type','SalesforceConfiguration','Configurations','moduleSearch','Subjects','Variable','Descriptions','SalesforceField','Fields','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name'];(function(_0xe9e3ea,_0x17c24e){var _0x31fdf1=function(_0x503f6a){while(--_0x503f6a){_0xe9e3ea['push'](_0xe9e3ea['shift']());}};_0x31fdf1(++_0x17c24e);}(_0x706f,0x13b));var _0xf706=function(_0x3f2020,_0x170c9b){_0x3f2020=_0x3f2020-0x0;var _0x279bf6=_0x706f[_0x3f2020];return _0x279bf6;};'use strict';var client=require(_0xf706('0x0'));exports[_0xf706('0x1')]=function(){return function(_0x1f564a){return client[_0xf706('0x2')](_0xf706('0x3'),{'options':{'raw':![],'attributes':['id',_0xf706('0x4'),_0xf706('0x5'),_0xf706('0x6'),_0xf706('0x7'),'clientId',_0xf706('0x8'),_0xf706('0x9'),_0xf706('0xa'),_0xf706('0xb')],'include':[{'model':_0xf706('0xc'),'as':_0xf706('0xd'),'attributes':['id',_0xf706('0x4'),_0xf706('0xe'),'moduleCreate','ticketType'],'include':[{'model':'SalesforceField','as':_0xf706('0xf'),'include':[{'model':_0xf706('0x10'),'as':_0xf706('0x10'),'attributes':['id',_0xf706('0x4')]}]},{'model':'SalesforceField','as':_0xf706('0x11'),'include':[{'model':_0xf706('0x10'),'as':_0xf706('0x10'),'attributes':['id',_0xf706('0x4')]}]},{'model':_0xf706('0x12'),'as':_0xf706('0x13'),'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]}]}]},'log':_0xf706('0x3')});};};
\ No newline at end of file
index ebf3745..3802546 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['type','content','variableName','Variable','Descriptions','key','keyContent','name','Fields','idField','nameField','customField','GetServicenowkAccount','../../client','Request','GetServicenowAccount','username','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','ServicenowField','Subjects'];(function(_0x3c858f,_0x235201){var _0x198090=function(_0xc4c406){while(--_0xc4c406){_0x3c858f['push'](_0x3c858f['shift']());}};_0x198090(++_0x235201);}(_0x3e74,0x175));var _0x43e7=function(_0x147049,_0x391f64){_0x147049=_0x147049-0x0;var _0x2c92f0=_0x3e74[_0x147049];return _0x2c92f0;};'use strict';var client=require(_0x43e7('0x0'));exports['getServicenowAccounts']=function(){return function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'options':{'raw':![],'attributes':['id','name','description',_0x43e7('0x3'),'password',_0x43e7('0x4'),_0x43e7('0x5'),_0x43e7('0x6')],'include':[{'model':_0x43e7('0x7'),'as':_0x43e7('0x8'),'attributes':['id','name'],'include':[{'model':_0x43e7('0x9'),'as':_0x43e7('0xa'),'attributes':['id',_0x43e7('0xb'),_0x43e7('0xc'),_0x43e7('0xd')],'include':[{'model':'Variable','as':_0x43e7('0xe'),'attributes':['id','name']}]},{'model':'ServicenowField','as':_0x43e7('0xf'),'attributes':['id',_0x43e7('0xb'),'content',_0x43e7('0x10'),'keyType',_0x43e7('0x11'),_0x43e7('0xd')],'include':[{'model':'Variable','as':_0x43e7('0xe'),'attributes':['id',_0x43e7('0x12')]}]},{'model':_0x43e7('0x9'),'as':_0x43e7('0x13'),'attributes':['id','type','content',_0x43e7('0x14'),_0x43e7('0x15'),_0x43e7('0x16'),'variableName'],'include':[{'model':'Variable','as':_0x43e7('0xe'),'attributes':['id',_0x43e7('0x12')]}]}]}]},'log':_0x43e7('0x17')});};};
\ No newline at end of file
+var _0xf3cd=['password','email','serverUrl','ServicenowConfiguration','Configurations','ServicenowField','Subjects','content','Variable','Descriptions','type','key','keyType','keyContent','variableName','Fields','idField','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','GetServicenowAccount','name','username'];(function(_0x4191bc,_0x3096c5){var _0x1ffd4e=function(_0x36faed){while(--_0x36faed){_0x4191bc['push'](_0x4191bc['shift']());}};_0x1ffd4e(++_0x3096c5);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x6a734c,_0x1b2d9f){_0x6a734c=_0x6a734c-0x0;var _0x494d0d=_0xf3cd[_0x6a734c];return _0x494d0d;};'use strict';var client=require(_0xdf3c('0x0'));exports[_0xdf3c('0x1')]=function(){return function(_0x31e5a5){return client[_0xdf3c('0x2')](_0xdf3c('0x3'),{'options':{'raw':![],'attributes':['id',_0xdf3c('0x4'),'description',_0xdf3c('0x5'),_0xdf3c('0x6'),_0xdf3c('0x7'),'remoteUri',_0xdf3c('0x8')],'include':[{'model':_0xdf3c('0x9'),'as':_0xdf3c('0xa'),'attributes':['id',_0xdf3c('0x4')],'include':[{'model':_0xdf3c('0xb'),'as':_0xdf3c('0xc'),'attributes':['id','type',_0xdf3c('0xd'),'variableName'],'include':[{'model':'Variable','as':_0xdf3c('0xe'),'attributes':['id',_0xdf3c('0x4')]}]},{'model':'ServicenowField','as':_0xdf3c('0xf'),'attributes':['id',_0xdf3c('0x10'),_0xdf3c('0xd'),_0xdf3c('0x11'),_0xdf3c('0x12'),_0xdf3c('0x13'),_0xdf3c('0x14')],'include':[{'model':_0xdf3c('0xe'),'as':'Variable','attributes':['id',_0xdf3c('0x4')]}]},{'model':_0xdf3c('0xb'),'as':_0xdf3c('0x15'),'attributes':['id',_0xdf3c('0x10'),'content',_0xdf3c('0x16'),_0xdf3c('0x17'),_0xdf3c('0x18'),'variableName'],'include':[{'model':_0xdf3c('0xe'),'as':_0xdf3c('0xe'),'attributes':['id',_0xdf3c('0x4')]}]}]}]},'log':_0xdf3c('0x19')});};};
\ No newline at end of file
index efc8c32..576a5e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5078=['type','keyType','Fields','idField','nameField','customField','../../client','GetSugarcrmAccount','username','password','remoteUri','serverUrl','SugarcrmConfiguration','Configurations','name','SugarcrmField','content','variableName','Variable','Descriptions'];(function(_0x15be14,_0x1744f0){var _0x101637=function(_0xa491f9){while(--_0xa491f9){_0x15be14['push'](_0x15be14['shift']());}};_0x101637(++_0x1744f0);}(_0x5078,0x92));var _0x8507=function(_0x4f386e,_0x56ffdd){_0x4f386e=_0x4f386e-0x0;var _0x4694e2=_0x5078[_0x4f386e];return _0x4694e2;};'use strict';var client=require(_0x8507('0x0'));exports['getSugarcrmAccounts']=function(){return function(_0x1cf137){return client['Request'](_0x8507('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x8507('0x2'),_0x8507('0x3'),_0x8507('0x4'),_0x8507('0x5')],'include':[{'model':_0x8507('0x6'),'as':_0x8507('0x7'),'attributes':['id',_0x8507('0x8')],'include':[{'model':_0x8507('0x9'),'as':'Subjects','attributes':['id','type',_0x8507('0xa'),_0x8507('0xb')],'include':[{'model':_0x8507('0xc'),'as':_0x8507('0xc'),'attributes':['id',_0x8507('0x8')]}]},{'model':_0x8507('0x9'),'as':_0x8507('0xd'),'attributes':['id',_0x8507('0xe'),_0x8507('0xa'),'key',_0x8507('0xf'),'keyContent','variableName'],'include':[{'model':'Variable','as':_0x8507('0xc'),'attributes':['id',_0x8507('0x8')]}]},{'model':_0x8507('0x9'),'as':_0x8507('0x10'),'attributes':['id',_0x8507('0xe'),_0x8507('0xa'),_0x8507('0x11'),_0x8507('0x12'),_0x8507('0x13'),_0x8507('0xb')],'include':[{'model':'Variable','as':_0x8507('0xc'),'attributes':['id',_0x8507('0x8')]}]}]}]},'log':_0x8507('0x1')});};};
\ No newline at end of file
+var _0x1fdf=['key','keyType','Fields','idField','customField','GetSugarcrmAccount','../../client','getSugarcrmAccounts','name','username','password','remoteUri','SugarcrmConfiguration','Subjects','type','content','variableName','Variable','SugarcrmField'];(function(_0x576743,_0x5c07ff){var _0x3f8bd6=function(_0x4213ff){while(--_0x4213ff){_0x576743['push'](_0x576743['shift']());}};_0x3f8bd6(++_0x5c07ff);}(_0x1fdf,0x1a8));var _0xf1fd=function(_0x3f2a44,_0xf70f4b){_0x3f2a44=_0x3f2a44-0x0;var _0x50d3cb=_0x1fdf[_0x3f2a44];return _0x50d3cb;};'use strict';var client=require(_0xf1fd('0x0'));exports[_0xf1fd('0x1')]=function(){return function(_0x143b49){return client['Request']('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id',_0xf1fd('0x2'),_0xf1fd('0x3'),_0xf1fd('0x4'),_0xf1fd('0x5'),'serverUrl'],'include':[{'model':_0xf1fd('0x6'),'as':'Configurations','attributes':['id',_0xf1fd('0x2')],'include':[{'model':'SugarcrmField','as':_0xf1fd('0x7'),'attributes':['id',_0xf1fd('0x8'),_0xf1fd('0x9'),_0xf1fd('0xa')],'include':[{'model':_0xf1fd('0xb'),'as':_0xf1fd('0xb'),'attributes':['id',_0xf1fd('0x2')]}]},{'model':_0xf1fd('0xc'),'as':'Descriptions','attributes':['id',_0xf1fd('0x8'),_0xf1fd('0x9'),_0xf1fd('0xd'),_0xf1fd('0xe'),'keyContent',_0xf1fd('0xa')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xf1fd('0x2')]}]},{'model':'SugarcrmField','as':_0xf1fd('0xf'),'attributes':['id',_0xf1fd('0x8'),_0xf1fd('0x9'),_0xf1fd('0x10'),'nameField',_0xf1fd('0x11'),_0xf1fd('0xa')],'include':[{'model':_0xf1fd('0xb'),'as':_0xf1fd('0xb'),'attributes':['id',_0xf1fd('0x2')]}]}]}]},'log':_0xf1fd('0x12')});};};
\ No newline at end of file
index ac2eabd..d5d88b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['variableName','VtigerField','Descriptions','content','keyContent','Variable','Fields','idField','nameField','customField','../../client','getVtigerAccounts','GetVtigerAccount','name','username','accessKey','remoteUri','serverUrl','VtigerConfiguration','Subjects','type'];(function(_0x4a471c,_0x4dab35){var _0x4301fe=function(_0x180267){while(--_0x180267){_0x4a471c['push'](_0x4a471c['shift']());}};_0x4301fe(++_0x4dab35);}(_0x7a54,0x106));var _0x47a5=function(_0x5580ec,_0x3e45c9){_0x5580ec=_0x5580ec-0x0;var _0x3e35dd=_0x7a54[_0x5580ec];return _0x3e35dd;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(){return function(_0x44b31e){return client['Request'](_0x47a5('0x2'),{'options':{'raw':![],'attributes':['id',_0x47a5('0x3'),'description',_0x47a5('0x4'),_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7')],'include':[{'model':_0x47a5('0x8'),'as':'Configurations','attributes':['id',_0x47a5('0x3')],'include':[{'model':'VtigerField','as':_0x47a5('0x9'),'attributes':['id',_0x47a5('0xa'),'content',_0x47a5('0xb')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x47a5('0xc'),'as':_0x47a5('0xd'),'attributes':['id','type',_0x47a5('0xe'),'key','keyType',_0x47a5('0xf'),_0x47a5('0xb')],'include':[{'model':_0x47a5('0x10'),'as':_0x47a5('0x10'),'attributes':['id',_0x47a5('0x3')]}]},{'model':_0x47a5('0xc'),'as':_0x47a5('0x11'),'attributes':['id','type',_0x47a5('0xe'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0xb')],'include':[{'model':_0x47a5('0x10'),'as':_0x47a5('0x10'),'attributes':['id',_0x47a5('0x3')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
+var _0x7a54=['variableName','VtigerField','Descriptions','content','keyContent','Variable','Fields','idField','nameField','customField','../../client','getVtigerAccounts','GetVtigerAccount','name','username','accessKey','remoteUri','serverUrl','VtigerConfiguration','Subjects','type'];(function(_0x3a2979,_0x429062){var _0x53e07c=function(_0x21dea9){while(--_0x21dea9){_0x3a2979['push'](_0x3a2979['shift']());}};_0x53e07c(++_0x429062);}(_0x7a54,0x106));var _0x47a5=function(_0x2107c4,_0x2559b9){_0x2107c4=_0x2107c4-0x0;var _0x94efc5=_0x7a54[_0x2107c4];return _0x94efc5;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(){return function(_0x44b31e){return client['Request'](_0x47a5('0x2'),{'options':{'raw':![],'attributes':['id',_0x47a5('0x3'),'description',_0x47a5('0x4'),_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7')],'include':[{'model':_0x47a5('0x8'),'as':'Configurations','attributes':['id',_0x47a5('0x3')],'include':[{'model':'VtigerField','as':_0x47a5('0x9'),'attributes':['id',_0x47a5('0xa'),'content',_0x47a5('0xb')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x47a5('0xc'),'as':_0x47a5('0xd'),'attributes':['id','type',_0x47a5('0xe'),'key','keyType',_0x47a5('0xf'),_0x47a5('0xb')],'include':[{'model':_0x47a5('0x10'),'as':_0x47a5('0x10'),'attributes':['id',_0x47a5('0x3')]}]},{'model':_0x47a5('0xc'),'as':_0x47a5('0x11'),'attributes':['id','type',_0x47a5('0xe'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0xb')],'include':[{'model':_0x47a5('0x10'),'as':_0x47a5('0x10'),'attributes':['id',_0x47a5('0x3')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
index d54c91d..f5b1f1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x487d=['ZendeskConfiguration','Configurations','name','ZendeskField','content','variableName','Variable','Descriptions','key','Fields','idField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','username','password','token','remoteUri','authType','serverUrl','type'];(function(_0x3ce5f3,_0x244e89){var _0x50a95c=function(_0x238b9f){while(--_0x238b9f){_0x3ce5f3['push'](_0x3ce5f3['shift']());}};_0x50a95c(++_0x244e89);}(_0x487d,0xdb));var _0xd487=function(_0x10a96a,_0x2e8bda){_0x10a96a=_0x10a96a-0x0;var _0xf50a21=_0x487d[_0x10a96a];return _0xf50a21;};'use strict';var client=require(_0xd487('0x0'));exports[_0xd487('0x1')]=function(){return function(_0x33a8d4){return client[_0xd487('0x2')](_0xd487('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xd487('0x4'),_0xd487('0x5'),_0xd487('0x6'),_0xd487('0x7'),_0xd487('0x8'),_0xd487('0x9'),_0xd487('0xa')],'include':[{'model':_0xd487('0xb'),'as':_0xd487('0xc'),'attributes':['id',_0xd487('0xd')],'include':[{'model':'Tag','attributes':['id','name']},{'model':_0xd487('0xe'),'as':'Subjects','attributes':['id',_0xd487('0xa'),_0xd487('0xf'),_0xd487('0x10')],'include':[{'model':_0xd487('0x11'),'as':_0xd487('0x11'),'attributes':['id',_0xd487('0xd')]}]},{'model':_0xd487('0xe'),'as':_0xd487('0x12'),'attributes':['id',_0xd487('0xa'),_0xd487('0xf'),_0xd487('0x13'),'keyType','keyContent','variableName'],'include':[{'model':_0xd487('0x11'),'as':_0xd487('0x11'),'attributes':['id','name']}]},{'model':_0xd487('0xe'),'as':_0xd487('0x14'),'attributes':['id',_0xd487('0xa'),_0xd487('0xf'),_0xd487('0x15'),'nameField',_0xd487('0x16'),_0xd487('0x10')],'include':[{'model':_0xd487('0x11'),'as':_0xd487('0x11'),'attributes':['id',_0xd487('0xd')]}]}]}]},'log':_0xd487('0x3')});};};
\ No newline at end of file
+var _0x291d=['nameField','customField','../../client','getZendeskAccounts','GetZendeskAccount','name','username','password','token','remoteUri','authType','ZendeskConfiguration','Configurations','Tag','ZendeskField','type','content','variableName','Variable','Descriptions','key','keyContent','Fields'];(function(_0x143d34,_0x462642){var _0x4234d3=function(_0x5f2618){while(--_0x5f2618){_0x143d34['push'](_0x143d34['shift']());}};_0x4234d3(++_0x462642);}(_0x291d,0x144));var _0xd291=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x291d[_0x2b5eae];return _0x5f3ac9;};'use strict';var client=require(_0xd291('0x0'));exports[_0xd291('0x1')]=function(){return function(_0x4b2d41){return client['Request'](_0xd291('0x2'),{'options':{'raw':![],'attributes':['id',_0xd291('0x3'),_0xd291('0x4'),_0xd291('0x5'),_0xd291('0x6'),_0xd291('0x7'),_0xd291('0x8'),'serverUrl','type'],'include':[{'model':_0xd291('0x9'),'as':_0xd291('0xa'),'attributes':['id','name'],'include':[{'model':_0xd291('0xb'),'attributes':['id','name']},{'model':_0xd291('0xc'),'as':'Subjects','attributes':['id',_0xd291('0xd'),_0xd291('0xe'),_0xd291('0xf')],'include':[{'model':_0xd291('0x10'),'as':_0xd291('0x10'),'attributes':['id',_0xd291('0x3')]}]},{'model':_0xd291('0xc'),'as':_0xd291('0x11'),'attributes':['id','type',_0xd291('0xe'),_0xd291('0x12'),'keyType',_0xd291('0x13'),_0xd291('0xf')],'include':[{'model':_0xd291('0x10'),'as':_0xd291('0x10'),'attributes':['id',_0xd291('0x3')]}]},{'model':'ZendeskField','as':_0xd291('0x14'),'attributes':['id','type',_0xd291('0xe'),'idField',_0xd291('0x15'),_0xd291('0x16'),_0xd291('0xf')],'include':[{'model':_0xd291('0x10'),'as':_0xd291('0x10'),'attributes':['id',_0xd291('0x3')]}]}]}]},'log':_0xd291('0x2')});};};
\ No newline at end of file
index cc23a1c..72a758d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd398=['moduleSearch','ZohoField','Subjects','type','content','Variable','Descriptions','keyType','keyContent','variableName','Fields','nameField','customField','../../client','getZohoAccounts','Request','GetZohoAccount','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','name','moduleCreate'];(function(_0x4593a1,_0x567f96){var _0x1b20e4=function(_0x321fe7){while(--_0x321fe7){_0x4593a1['push'](_0x4593a1['shift']());}};_0x1b20e4(++_0x567f96);}(_0xd398,0x1dd));var _0x8d39=function(_0x46ff82,_0x59d48c){_0x46ff82=_0x46ff82-0x0;var _0x262d95=_0xd398[_0x46ff82];return _0x262d95;};'use strict';var client=require(_0x8d39('0x0'));exports[_0x8d39('0x1')]=function(){return function(_0x178c77){return client[_0x8d39('0x2')](_0x8d39('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8d39('0x4'),_0x8d39('0x5'),_0x8d39('0x6'),_0x8d39('0x7'),_0x8d39('0x8'),_0x8d39('0x9'),_0x8d39('0xa'),_0x8d39('0xb')],'include':[{'model':_0x8d39('0xc'),'as':_0x8d39('0xd'),'attributes':['id',_0x8d39('0xe'),_0x8d39('0xf'),_0x8d39('0x10'),'description'],'include':[{'model':_0x8d39('0x11'),'as':_0x8d39('0x12'),'attributes':['id',_0x8d39('0x13'),_0x8d39('0x14'),'variableName'],'include':[{'model':_0x8d39('0x15'),'as':_0x8d39('0x15'),'attributes':['id',_0x8d39('0xe')]}]},{'model':'ZohoField','as':_0x8d39('0x16'),'attributes':['id',_0x8d39('0x13'),'content','key',_0x8d39('0x17'),_0x8d39('0x18'),_0x8d39('0x19')],'include':[{'model':_0x8d39('0x15'),'as':'Variable','attributes':['id','name']}]},{'model':_0x8d39('0x11'),'as':_0x8d39('0x1a'),'attributes':['id',_0x8d39('0x13'),_0x8d39('0x14'),'idField',_0x8d39('0x1b'),_0x8d39('0x1c'),'variableName'],'include':[{'model':'Variable','as':_0x8d39('0x15'),'attributes':['id',_0x8d39('0xe')]}]}]}]},'log':_0x8d39('0x3')});};};
\ No newline at end of file
+var _0x968c=['moduleSearch','description','ZohoField','Subjects','type','content','variableName','Variable','Descriptions','key','keyContent','idField','nameField','name','../../client','getZohoAccounts','GetZohoAccount','host','clientSecret','serverUrl','code','ZohoConfiguration','moduleCreate'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x968c,0x195));var _0xc968=function(_0x56ab27,_0x1a5deb){_0x56ab27=_0x56ab27-0x0;var _0x41b83f=_0x968c[_0x56ab27];return _0x41b83f;};'use strict';var client=require(_0xc968('0x0'));exports[_0xc968('0x1')]=function(){return function(_0x4d3be2){return client['Request'](_0xc968('0x2'),{'options':{'raw':![],'attributes':['id','name','description',_0xc968('0x3'),'zone','clientId',_0xc968('0x4'),_0xc968('0x5'),_0xc968('0x6'),'refreshToken'],'include':[{'model':_0xc968('0x7'),'as':'Configurations','attributes':['id','name',_0xc968('0x8'),_0xc968('0x9'),_0xc968('0xa')],'include':[{'model':_0xc968('0xb'),'as':_0xc968('0xc'),'attributes':['id',_0xc968('0xd'),_0xc968('0xe'),_0xc968('0xf')],'include':[{'model':'Variable','as':_0xc968('0x10'),'attributes':['id','name']}]},{'model':_0xc968('0xb'),'as':_0xc968('0x11'),'attributes':['id',_0xc968('0xd'),'content',_0xc968('0x12'),'keyType',_0xc968('0x13'),_0xc968('0xf')],'include':[{'model':'Variable','as':_0xc968('0x10'),'attributes':['id','name']}]},{'model':_0xc968('0xb'),'as':'Fields','attributes':['id',_0xc968('0xd'),'content',_0xc968('0x14'),_0xc968('0x15'),'customField','variableName'],'include':[{'model':_0xc968('0x10'),'as':'Variable','attributes':['id',_0xc968('0x16')]}]}]}]},'log':_0xc968('0x2')});};};
\ No newline at end of file
index 6a9c0eb..7ae4865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f8f=['isNil','interface','lastAssignedTo','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','accountcode','uniqueid','voiceDialReport','membername','starttime','endtime','exten','dialstring','toNumber','lodash','../client','queuecallercompleteAt','Request','CreateMemberReport'];(function(_0x377252,_0x3d4fdc){var _0x5c2e82=function(_0x50c958){while(--_0x50c958){_0x377252['push'](_0x377252['shift']());}};_0x5c2e82(++_0x3d4fdc);}(_0x7f8f,0x199));var _0xf7f8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7f8f[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var _=require(_0xf7f8('0x0'));var util=require('util');var client=require(_0xf7f8('0x1'));exports['voiceQueueReport']=function(_0x4c4a66){var _0x4de6dd=_0x4c4a66[_0xf7f8('0x2')]||_0x4c4a66['queuecallerexitAt'];return client[_0xf7f8('0x3')](_0xf7f8('0x4'),{'body':{'channel':'voice','membername':_0x4c4a66['lastAssignedTo'],'interface':_[_0xf7f8('0x5')](_0x4c4a66[_0xf7f8('0x6')])?util['format']('SIP/%s',_0x4c4a66[_0xf7f8('0x7')]):_0x4c4a66['interface'],'type':_0xf7f8('0x8'),'enterAt':_0x4c4a66[_0xf7f8('0x9')],'exitAt':_0x4de6dd,'duration':moment(_0x4de6dd)[_0xf7f8('0xa')](_0x4c4a66['queuecallerleaveAt'],_0xf7f8('0xb')),'data1':_0xf7f8('0xc'),'data2':_0x4c4a66[_0xf7f8('0xd')],'data3':_0x4c4a66['exten'],'data4':null,'data5':_0x4c4a66['queue'],'role':'agent','internal':_0x4c4a66[_0xf7f8('0xe')]?_['toNumber'](_0x4c4a66[_0xf7f8('0xe')]):undefined,'uniqueid':_0x4c4a66[_0xf7f8('0xf')]},'log':_0xf7f8('0x4')});};exports[_0xf7f8('0x10')]=function(_0x1c1f34){return client[_0xf7f8('0x3')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x1c1f34[_0xf7f8('0x11')],'interface':_0x1c1f34[_0xf7f8('0x6')],'type':_0xf7f8('0x8'),'enterAt':_0x1c1f34[_0xf7f8('0x12')],'exitAt':_0x1c1f34[_0xf7f8('0x13')],'duration':moment(_0x1c1f34['endtime'])[_0xf7f8('0xa')](_0x1c1f34[_0xf7f8('0x12')],_0xf7f8('0xb'))>=0x0?moment(_0x1c1f34[_0xf7f8('0x13')])[_0xf7f8('0xa')](_0x1c1f34[_0xf7f8('0x12')],_0xf7f8('0xb')):null,'data1':'outbound','data2':_0x1c1f34[_0xf7f8('0xe')],'data3':_0x1c1f34[_0xf7f8('0x14')],'data4':_0x1c1f34[_0xf7f8('0x15')]||null,'role':'agent','internal':_0x1c1f34[_0xf7f8('0xe')]?_[_0xf7f8('0x16')](_0x1c1f34[_0xf7f8('0xe')]):undefined,'uniqueid':_0x1c1f34[_0xf7f8('0xf')]},'log':_0xf7f8('0x4')});};
\ No newline at end of file
+var _0x58f8=['voice','lastAssignedTo','format','SIP/%s','interface','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','agent','accountcode','uniqueid','CreateMemberReport','voiceDialReport','membername','endtime','starttime','dialstring','toNumber','moment','util','../client','queuecallercompleteAt','queuecallerexitAt','Request'];(function(_0x4e6e55,_0x136bbc){var _0x4b2cb5=function(_0x53df78){while(--_0x53df78){_0x4e6e55['push'](_0x4e6e55['shift']());}};_0x4b2cb5(++_0x136bbc);}(_0x58f8,0x1d6));var _0x858f=function(_0x20bd51,_0x4c65f6){_0x20bd51=_0x20bd51-0x0;var _0x8ff01c=_0x58f8[_0x20bd51];return _0x8ff01c;};'use strict';var moment=require(_0x858f('0x0'));var _=require('lodash');var util=require(_0x858f('0x1'));var client=require(_0x858f('0x2'));exports['voiceQueueReport']=function(_0x5b529c){var _0x3a4619=_0x5b529c[_0x858f('0x3')]||_0x5b529c[_0x858f('0x4')];return client[_0x858f('0x5')]('CreateMemberReport',{'body':{'channel':_0x858f('0x6'),'membername':_0x5b529c[_0x858f('0x7')],'interface':_['isNil'](_0x5b529c['interface'])?util[_0x858f('0x8')](_0x858f('0x9'),_0x5b529c['lastAssignedTo']):_0x5b529c[_0x858f('0xa')],'type':_0x858f('0xb'),'enterAt':_0x5b529c[_0x858f('0xc')],'exitAt':_0x3a4619,'duration':moment(_0x3a4619)[_0x858f('0xd')](_0x5b529c[_0x858f('0xc')],_0x858f('0xe')),'data1':_0x858f('0xf'),'data2':_0x5b529c[_0x858f('0x10')],'data3':_0x5b529c[_0x858f('0x11')],'data4':null,'data5':_0x5b529c['queue'],'role':_0x858f('0x12'),'internal':_0x5b529c[_0x858f('0x13')]?_['toNumber'](_0x5b529c[_0x858f('0x13')]):undefined,'uniqueid':_0x5b529c[_0x858f('0x14')]},'log':_0x858f('0x15')});};exports[_0x858f('0x16')]=function(_0x5d8079){return client[_0x858f('0x5')](_0x858f('0x15'),{'body':{'channel':_0x858f('0x6'),'membername':_0x5d8079[_0x858f('0x17')],'interface':_0x5d8079[_0x858f('0xa')],'type':_0x858f('0xb'),'enterAt':_0x5d8079['starttime'],'exitAt':_0x5d8079['endtime'],'duration':moment(_0x5d8079[_0x858f('0x18')])[_0x858f('0xd')](_0x5d8079[_0x858f('0x19')],_0x858f('0xe'))>=0x0?moment(_0x5d8079[_0x858f('0x18')])['diff'](_0x5d8079[_0x858f('0x19')],_0x858f('0xe')):null,'data1':'outbound','data2':_0x5d8079['accountcode'],'data3':_0x5d8079[_0x858f('0x11')],'data4':_0x5d8079[_0x858f('0x1a')]||null,'role':_0x858f('0x12'),'internal':_0x5d8079[_0x858f('0x13')]?_[_0x858f('0x1b')](_0x5d8079[_0x858f('0x13')]):undefined,'uniqueid':_0x5d8079['uniqueid']},'log':'CreateMemberReport'});};
\ No newline at end of file
index ff777f7..d31675c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2750=['../client','Request','GetTemplate','name','html'];(function(_0x35b4fb,_0x35459d){var _0x422af3=function(_0x2721ae){while(--_0x2721ae){_0x35b4fb['push'](_0x35b4fb['shift']());}};_0x422af3(++_0x35459d);}(_0x2750,0x13b));var _0x0275=function(_0x37aba2,_0x5ef575){_0x37aba2=_0x37aba2-0x0;var _0x5b28c4=_0x2750[_0x37aba2];return _0x5b28c4;};'use strict';var client=require(_0x0275('0x0'));exports['getTemplates']=function(_0xf4568){return function(_0xf2ae71){return client[_0x0275('0x1')](_0x0275('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0275('0x3'),_0x0275('0x4')]},'log':_0x0275('0x2')});};};
\ No newline at end of file
+var _0x9861=['Request','GetTemplate','name','html','../client'];(function(_0x5af490,_0x4a31d6){var _0xbfa6cf=function(_0x5ed3a3){while(--_0x5ed3a3){_0x5af490['push'](_0x5af490['shift']());}};_0xbfa6cf(++_0x4a31d6);}(_0x9861,0x176));var _0x1986=function(_0x39203d,_0x8af254){_0x39203d=_0x39203d-0x0;var _0x2accbf=_0x9861[_0x39203d];return _0x2accbf;};'use strict';var client=require(_0x1986('0x0'));exports['getTemplates']=function(_0x5071b2){return function(_0x3989f2){return client[_0x1986('0x1')](_0x1986('0x2'),{'options':{'raw':!![],'attributes':['id',_0x1986('0x3'),_0x1986('0x4')]},'log':_0x1986('0x2')});};};
\ No newline at end of file
index 7f63cff..be1b5b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x018c=['AnyConditions','field','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','channel','status','Condition','operator','value'];(function(_0x4ff093,_0x5d1a19){var _0x5360e0=function(_0x131a75){while(--_0x131a75){_0x4ff093['push'](_0x4ff093['shift']());}};_0x5360e0(++_0x5d1a19);}(_0x018c,0x1c5));var _0xc018=function(_0x36078f,_0x4d706b){_0x36078f=_0x36078f-0x0;var _0xa41d86=_0x018c[_0x36078f];return _0xa41d86;};'use strict';var client=require(_0xc018('0x0'));exports[_0xc018('0x1')]=function(_0xf3cac5){return function(_0xac4fc4){return client[_0xc018('0x2')](_0xc018('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xc018('0x4'),_0xc018('0x5')],'include':[{'model':_0xc018('0x6'),'as':'AllConditions','attributes':['id','field',_0xc018('0x7'),_0xc018('0x8')]},{'model':_0xc018('0x6'),'as':_0xc018('0x9'),'attributes':['id',_0xc018('0xa'),_0xc018('0x7'),_0xc018('0x8')]},{'model':_0xc018('0xb'),'as':_0xc018('0xc'),'attributes':['id',_0xc018('0xd'),_0xc018('0xe'),_0xc018('0xf'),_0xc018('0x10'),_0xc018('0x11'),_0xc018('0x12'),_0xc018('0x13'),_0xc018('0x14')]}]},'log':_0xc018('0x3')});};};
\ No newline at end of file
+var _0x752c=['getTriggers','Request','GetTrigger','name','status','Condition','AllConditions','field','operator','value','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','../client'];(function(_0x34b360,_0x4906ea){var _0x356583=function(_0x9c7144){while(--_0x9c7144){_0x34b360['push'](_0x34b360['shift']());}};_0x356583(++_0x4906ea);}(_0x752c,0x18e));var _0xc752=function(_0x3feac7,_0x30064f){_0x3feac7=_0x3feac7-0x0;var _0x5304bd=_0x752c[_0x3feac7];return _0x5304bd;};'use strict';var client=require(_0xc752('0x0'));exports[_0xc752('0x1')]=function(_0x7724c8){return function(_0x549271){return client[_0xc752('0x2')](_0xc752('0x3'),{'options':{'raw':![],'attributes':['id',_0xc752('0x4'),'channel',_0xc752('0x5')],'include':[{'model':_0xc752('0x6'),'as':_0xc752('0x7'),'attributes':['id',_0xc752('0x8'),_0xc752('0x9'),_0xc752('0xa')]},{'model':'Condition','as':'AnyConditions','attributes':['id',_0xc752('0x8'),'operator',_0xc752('0xa')]},{'model':_0xc752('0xb'),'as':_0xc752('0xc'),'attributes':['id',_0xc752('0xd'),_0xc752('0xe'),_0xc752('0xf'),_0xc752('0x10'),_0xc752('0x11'),_0xc752('0x12'),_0xc752('0x13'),_0xc752('0x14')]}]},'log':_0xc752('0x3')});};};
\ No newline at end of file
index 7e4cf6b..5435e22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ee2=['name','registry','../client','getTrunks','Request','GetTrunk'];(function(_0x5f36fb,_0x562c4f){var _0x2e9f8a=function(_0x473b4a){while(--_0x473b4a){_0x5f36fb['push'](_0x5f36fb['shift']());}};_0x2e9f8a(++_0x562c4f);}(_0x5ee2,0x6e));var _0x25ee=function(_0x15498a,_0x2a85c9){_0x15498a=_0x15498a-0x0;var _0x4560f7=_0x5ee2[_0x15498a];return _0x4560f7;};'use strict';var client=require(_0x25ee('0x0'));exports[_0x25ee('0x1')]=function(_0x90595d){return function(_0x371729){return client[_0x25ee('0x2')](_0x25ee('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x25ee('0x4'),_0x25ee('0x5')]},'log':_0x25ee('0x3')});};};
\ No newline at end of file
+var _0x3587=['name','../client','getTrunks','Request','GetTrunk'];(function(_0xa990b7,_0x26c527){var _0x52c99c=function(_0xf94328){while(--_0xf94328){_0xa990b7['push'](_0xa990b7['shift']());}};_0x52c99c(++_0x26c527);}(_0x3587,0x1b9));var _0x7358=function(_0x56ee1a,_0x35ee62){_0x56ee1a=_0x56ee1a-0x0;var _0x308355=_0x3587[_0x56ee1a];return _0x308355;};'use strict';var client=require(_0x7358('0x0'));exports[_0x7358('0x1')]=function(_0x5052dd){return function(_0x374a3c){return client[_0x7358('0x2')](_0x7358('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7358('0x4'),'registry']},'log':_0x7358('0x3')});};};
\ No newline at end of file
index 4985ca0..ddce2df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa219=['savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','pauseType','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','online','lastLoginAt','lastPauseAt','voicePause','mobile','interface','telephone','internal','getTelephones'];(function(_0x236673,_0x11daf2){var _0x44e60a=function(_0x10f2a5){while(--_0x10f2a5){_0x236673['push'](_0x236673['shift']());}};_0x44e60a(++_0x11daf2);}(_0xa219,0x11a));var _0x9a21=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0xa219[_0xb833b1];return _0x1ab87a;};'use strict';var client=require('../client');exports[_0x9a21('0x0')]=function(){return function(){return client[_0x9a21('0x1')](_0x9a21('0x2'),{'options':{'raw':![],'where':{'role':_0x9a21('0x3')},'attributes':['id',_0x9a21('0x4'),_0x9a21('0x5'),_0x9a21('0x6'),_0x9a21('0x7'),_0x9a21('0x8'),_0x9a21('0x9'),'pauseType',_0x9a21('0xa'),_0x9a21('0xb'),'phone',_0x9a21('0xc'),_0x9a21('0xd')]},'log':'getAgents'});};};exports['getTelephones']=function(){return function(){return client['Request'](_0x9a21('0x2'),{'options':{'raw':!![],'where':{'role':_0x9a21('0xe')},'attributes':['id',_0x9a21('0x4'),_0x9a21('0x6'),_0x9a21('0xf')]},'log':_0x9a21('0x10')});};};exports[_0x9a21('0x11')]=function(_0xe73511,_0x49fb08,_0x518e10){return client[_0x9a21('0x1')](_0x9a21('0x12'),{'body':{'type':_0x49fb08,'uniqueid':_0x518e10},'options':{'where':{'id':_0xe73511['id']}},'log':_0x9a21('0x11')});};exports[_0x9a21('0x13')]=function(_0x256922){return client[_0x9a21('0x1')](_0x9a21('0x14'),{'body':{},'options':{'where':{'id':_0x256922['id']}},'log':'savePause'});};exports[_0x9a21('0x15')]=function(_0x3a32c8){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x9a21('0x3'),'id':_0x3a32c8},'attributes':['id',_0x9a21('0x4'),_0x9a21('0x5'),_0x9a21('0x6'),_0x9a21('0x7'),'online','lastLoginAt',_0x9a21('0x16'),'lastPauseAt',_0x9a21('0xb'),_0x9a21('0xd')]},'log':_0x9a21('0x15')});};
\ No newline at end of file
+var _0x0fb1=['mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','fullname','lastLoginAt','getAgent','../client','getAgents','Request','GetUser','agent','name','email','accountcode','online','pauseType','lastPauseAt','voicePause','phone'];(function(_0x53208e,_0x4a1eb8){var _0xa97d9b=function(_0xefd3c1){while(--_0xefd3c1){_0x53208e['push'](_0x53208e['shift']());}};_0xa97d9b(++_0x4a1eb8);}(_0x0fb1,0x111));var _0x10fb=function(_0x19363c,_0x1597b1){_0x19363c=_0x19363c-0x0;var _0x334663=_0x0fb1[_0x19363c];return _0x334663;};'use strict';var client=require(_0x10fb('0x0'));exports[_0x10fb('0x1')]=function(){return function(){return client[_0x10fb('0x2')](_0x10fb('0x3'),{'options':{'raw':![],'where':{'role':_0x10fb('0x4')},'attributes':['id',_0x10fb('0x5'),_0x10fb('0x6'),_0x10fb('0x7'),'fullname',_0x10fb('0x8'),'lastLoginAt',_0x10fb('0x9'),_0x10fb('0xa'),_0x10fb('0xb'),_0x10fb('0xc'),_0x10fb('0xd'),_0x10fb('0xe')]},'log':_0x10fb('0x1')});};};exports[_0x10fb('0xf')]=function(){return function(){return client['Request'](_0x10fb('0x3'),{'options':{'raw':!![],'where':{'role':_0x10fb('0x10')},'attributes':['id','name',_0x10fb('0x7'),_0x10fb('0x11')]},'log':_0x10fb('0xf')});};};exports[_0x10fb('0x12')]=function(_0x41e421,_0x2cccf1,_0x331bfb){return client[_0x10fb('0x2')](_0x10fb('0x13'),{'body':{'type':_0x2cccf1,'uniqueid':_0x331bfb},'options':{'where':{'id':_0x41e421['id']}},'log':_0x10fb('0x12')});};exports[_0x10fb('0x14')]=function(_0x5a9ffa){return client[_0x10fb('0x2')](_0x10fb('0x15'),{'body':{},'options':{'where':{'id':_0x5a9ffa['id']}},'log':_0x10fb('0x12')});};exports['getAgent']=function(_0x5e2030){return client[_0x10fb('0x2')](_0x10fb('0x16'),{'options':{'raw':![],'where':{'role':_0x10fb('0x4'),'id':_0x5e2030},'attributes':['id',_0x10fb('0x5'),'email','accountcode',_0x10fb('0x17'),'online',_0x10fb('0x18'),_0x10fb('0x9'),_0x10fb('0xa'),_0x10fb('0xb'),_0x10fb('0xe')]},'log':_0x10fb('0x19')});};
\ No newline at end of file
index ee19255..1a0a305 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34ec=['update','Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x34ec,0x129));var _0xc34e=function(_0x5979f3,_0x924533){_0x5979f3=_0x5979f3-0x0;var _0x39927e=_0x34ec[_0x5979f3];return _0x39927e;};'use strict';var client=require(_0xc34e('0x0'));exports[_0xc34e('0x1')]=function(_0x5a03e3){return client['Request'](_0xc34e('0x2'),{'body':_0x5a03e3,'log':'CreateVoiceAgentReport'});};exports[_0xc34e('0x3')]=function(_0xeacd9b,_0x3711e3,_0x31b2bb){return client[_0xc34e('0x4')]('UpdateVoiceAgentReport',{'body':_0xeacd9b,'options':{'where':{'uniqueid':_0x3711e3,'interface':_0x31b2bb,'agentcomplete':!![]}},'log':_0xc34e('0x5')});};
\ No newline at end of file
+var _0x24ab=['UpdateVoiceAgentReport','../client','CreateVoiceAgentReport','update','Request'];(function(_0x57ebed,_0xfac0ac){var _0x3a0874=function(_0x271491){while(--_0x271491){_0x57ebed['push'](_0x57ebed['shift']());}};_0x3a0874(++_0xfac0ac);}(_0x24ab,0x13c));var _0xb24a=function(_0x55b89e,_0x385c49){_0x55b89e=_0x55b89e-0x0;var _0xad64f0=_0x24ab[_0x55b89e];return _0xad64f0;};'use strict';var client=require(_0xb24a('0x0'));exports['create']=function(_0x38a79c){return client['Request'](_0xb24a('0x1'),{'body':_0x38a79c,'log':'CreateVoiceAgentReport'});};exports[_0xb24a('0x2')]=function(_0x39d53b,_0x9479ff,_0x28c773){return client[_0xb24a('0x3')](_0xb24a('0x4'),{'body':_0x39d53b,'options':{'where':{'uniqueid':_0x9479ff,'interface':_0x28c773,'agentcomplete':!![]}},'log':_0xb24a('0x4')});};
\ No newline at end of file
index e14c078..c400e42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0908=['calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','billableseconds','GetVoiceCallReports','moment','util','lodash','create','CreateVoiceCallReport'];(function(_0x5857bb,_0x45bbfa){var _0x490455=function(_0x577524){while(--_0x577524){_0x5857bb['push'](_0x5857bb['shift']());}};_0x490455(++_0x45bbfa);}(_0x0908,0x160));var _0x8090=function(_0x34b21c,_0x30f6a2){_0x34b21c=_0x34b21c-0x0;var _0x11b2c1=_0x0908[_0x34b21c];return _0x11b2c1;};'use strict';var moment=require(_0x8090('0x0'));var util=require(_0x8090('0x1'));var _=require(_0x8090('0x2'));var client=require('../client');exports[_0x8090('0x3')]=function(_0x23195d){return client['Request'](_0x8090('0x4'),{'body':_['merge'](_0x23195d,{'source':_0x23195d[_0x8090('0x5')],'destinationcontext':_0x23195d[_0x8090('0x6')],'callerid':_0x23195d[_0x8090('0x7')],'amaflags':_0x8090('0x8')}),'log':_0x8090('0x4')});};exports[_0x8090('0x9')]=function(){return function(){return client[_0x8090('0xa')](_0x8090('0xb'),{'options':{'where':{'type':[_0x8090('0xc')],'createdAt':{'$between':[moment()[_0x8090('0xd')](_0x8090('0xe'))[_0x8090('0xf')](_0x8090('0x10')),moment()[_0x8090('0x11')](_0x8090('0xe'))[_0x8090('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type',_0x8090('0x12'),'duration',_0x8090('0x13')]},'log':_0x8090('0x14')});};};
\ No newline at end of file
+var _0x6e14=['lodash','../client','create','Request','merge','calleridnum','context','callerid','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','util'];(function(_0x51ef40,_0x48a870){var _0x3ff060=function(_0x25e0a2){while(--_0x25e0a2){_0x51ef40['push'](_0x51ef40['shift']());}};_0x3ff060(++_0x48a870);}(_0x6e14,0xdb));var _0x46e1=function(_0x59d015,_0x3531ce){_0x59d015=_0x59d015-0x0;var _0xa0511=_0x6e14[_0x59d015];return _0xa0511;};'use strict';var moment=require('moment');var util=require(_0x46e1('0x0'));var _=require(_0x46e1('0x1'));var client=require(_0x46e1('0x2'));exports[_0x46e1('0x3')]=function(_0x8bc0c7){return client[_0x46e1('0x4')]('CreateVoiceCallReport',{'body':_[_0x46e1('0x5')](_0x8bc0c7,{'source':_0x8bc0c7[_0x46e1('0x6')],'destinationcontext':_0x8bc0c7[_0x46e1('0x7')],'callerid':_0x8bc0c7[_0x46e1('0x8')],'amaflags':_0x46e1('0x9')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x46e1('0xa'),{'options':{'where':{'type':[_0x46e1('0xb')],'createdAt':{'$between':[moment()[_0x46e1('0xc')](_0x46e1('0xd'))[_0x46e1('0xe')](_0x46e1('0xf')),moment()[_0x46e1('0x10')](_0x46e1('0xd'))['format'](_0x46e1('0xf'))]}},'attributes':[_0x46e1('0x11'),_0x46e1('0x12'),_0x46e1('0x13'),_0x46e1('0x14')]},'log':_0x46e1('0x15')});};};
\ No newline at end of file
index dc49f47..84784b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfaa6=['CreateVoiceDialReport','../client','create','Request'];(function(_0x25c06f,_0x2e45a2){var _0x5657f2=function(_0x579264){while(--_0x579264){_0x25c06f['push'](_0x25c06f['shift']());}};_0x5657f2(++_0x2e45a2);}(_0xfaa6,0x17d));var _0x6faa=function(_0x4fda88,_0x1a4d19){_0x4fda88=_0x4fda88-0x0;var _0xe37511=_0xfaa6[_0x4fda88];return _0xe37511;};'use strict';var client=require(_0x6faa('0x0'));exports[_0x6faa('0x1')]=function(_0x114110){return client[_0x6faa('0x2')]('CreateVoiceDialReport',{'body':_0x114110,'log':_0x6faa('0x3')});};
\ No newline at end of file
+var _0x678c=['Request','CreateVoiceDialReport','../client'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x678c,0xce));var _0xc678=function(_0x877e1e,_0x46f5ba){_0x877e1e=_0x877e1e-0x0;var _0x2457c0=_0x678c[_0x877e1e];return _0x2457c0;};'use strict';var client=require(_0xc678('0x0'));exports['create']=function(_0x1e1dab){return client[_0xc678('0x1')]('CreateVoiceDialReport',{'body':_0x1e1dab,'log':_0xc678('0x2')});};
\ No newline at end of file
index 56d862e..bba5367 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf84a=['GetVoiceExtension','exten','recordingFormat','Request'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xf84a,0x97));var _0xaf84=function(_0x323414,_0x36eece){_0x323414=_0x323414-0x0;var _0xdb5790=_0xf84a[_0x323414];return _0xdb5790;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0xaf84('0x0')](_0xaf84('0x1'),{'options':{'raw':!![],'attributes':['id',_0xaf84('0x2'),_0xaf84('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
+var _0x1516=['recordingFormat','../client','getVoiceExtensions','Request','exten'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x1516,0xb0));var _0x6151=function(_0x11cf3b,_0x4de592){_0x11cf3b=_0x11cf3b-0x0;var _0xfc200b=_0x1516[_0x11cf3b];return _0xfc200b;};'use strict';var client=require(_0x6151('0x0'));exports[_0x6151('0x1')]=function(){return function(){return client[_0x6151('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x6151('0x3'),_0x6151('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x6151('0x1')});};};
\ No newline at end of file
index 23df6f3..5f039f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x349f=['dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel'];(function(_0x173902,_0x4566cb){var _0x51b113=function(_0x50aae9){while(--_0x50aae9){_0x173902['push'](_0x173902['shift']());}};_0x51b113(++_0x4566cb);}(_0x349f,0xa8));var _0xf349=function(_0x1fd5a6,_0x377a8a){_0x1fd5a6=_0x1fd5a6-0x0;var _0x5af876=_0x349f[_0x1fd5a6];return _0x5af876;};'use strict';var client=require(_0xf349('0x0'));exports[_0xf349('0x1')]=function(){return function(){return client[_0xf349('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xf349('0x3'),_0xf349('0x4'),_0xf349('0x5'),_0xf349('0x6'),_0xf349('0x7'),_0xf349('0x8'),_0xf349('0x9'),_0xf349('0xa'),_0xf349('0xb'),_0xf349('0xc'),'dialPowerLevel',_0xf349('0xd'),_0xf349('0xe'),_0xf349('0xf'),_0xf349('0x10'),_0xf349('0x11'),_0xf349('0x12'),_0xf349('0x13'),'dialQueueTimeout','dialQueueProject',_0xf349('0x14'),_0xf349('0x15'),_0xf349('0x16'),_0xf349('0x17'),_0xf349('0x18'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone',_0xf349('0x19'),_0xf349('0x1a'),_0xf349('0x1b'),_0xf349('0x1c'),_0xf349('0x1d'),'dialAMDGreeting',_0xf349('0x1e'),_0xf349('0x1f'),'dialAMDMinWordLength',_0xf349('0x20'),_0xf349('0x21'),'dialAMDSilenceThreshold',_0xf349('0x22'),'timeout',_0xf349('0x23'),_0xf349('0x24'),_0xf349('0x25'),_0xf349('0x26'),_0xf349('0x27'),_0xf349('0x28'),_0xf349('0x7'),'strategy',_0xf349('0x29'),'dialCutDigit',_0xf349('0x2a'),_0xf349('0x2b'),_0xf349('0x2c'),_0xf349('0x2d'),_0xf349('0x2e'),_0xf349('0x2f'),_0xf349('0x30'),_0xf349('0x31'),'dialAgentRejectMaxRetry',_0xf349('0x32'),'mandatoryDisposition',_0xf349('0x33'),_0xf349('0x34')],'include':[{'model':_0xf349('0x35'),'as':'Trunk','attributes':['id',_0xf349('0x3'),_0xf349('0x36'),_0xf349('0x37')]},{'model':'Pause','as':_0xf349('0x38'),'attributes':['id',_0xf349('0x3')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id','name',_0xf349('0x36'),_0xf349('0x37')]},{'model':_0xf349('0x39'),'as':'Interval','attributes':['id',_0xf349('0x3')],'include':[{'model':_0xf349('0x39'),'as':_0xf349('0x3a'),'attributes':['id',_0xf349('0x3'),_0xf349('0x3b')]}]}]},'log':_0xf349('0x1')});};};
\ No newline at end of file
+var _0x7755=['dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','autopause','monitor_format','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x5c950e,_0x5cfc84){var _0x2d6432=function(_0x445ff9){while(--_0x445ff9){_0x5c950e['push'](_0x5c950e['shift']());}};_0x2d6432(++_0x5cfc84);}(_0x7755,0x1e2));var _0x5775=function(_0x236607,_0x37f8e9){_0x236607=_0x236607-0x0;var _0x1a4b1e=_0x7755[_0x236607];return _0x1a4b1e;};'use strict';var client=require('../client');exports[_0x5775('0x0')]=function(){return function(){return client[_0x5775('0x1')](_0x5775('0x2'),{'options':{'raw':![],'attributes':['id',_0x5775('0x3'),'acw','acwTimeout',_0x5775('0x4'),_0x5775('0x5'),'type','dialActive','dialMethod',_0x5775('0x6'),_0x5775('0x7'),_0x5775('0x8'),_0x5775('0x9'),_0x5775('0xa'),_0x5775('0xb'),_0x5775('0xc'),'dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions',_0x5775('0xd'),'dialQueueProject',_0x5775('0xe'),_0x5775('0xf'),_0x5775('0x10'),_0x5775('0x11'),_0x5775('0x12'),_0x5775('0x13'),_0x5775('0x14'),_0x5775('0x15'),_0x5775('0x16'),_0x5775('0x17'),'dialCheckDuplicateType',_0x5775('0x18'),'dialAMDInitialSilence',_0x5775('0x19'),'dialAMDAfterGreetingSilence',_0x5775('0x1a'),_0x5775('0x1b'),_0x5775('0x1c'),_0x5775('0x1d'),_0x5775('0x1e'),_0x5775('0x1f'),_0x5775('0x20'),_0x5775('0x21'),'dialRecallInQueue',_0x5775('0x22'),_0x5775('0x23'),_0x5775('0x24'),_0x5775('0x25'),_0x5775('0x5'),_0x5775('0x26'),_0x5775('0x27'),_0x5775('0x28'),'dialNoSuchNumberMaxRetry',_0x5775('0x29'),_0x5775('0x2a'),_0x5775('0x2b'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry',_0x5775('0x2c'),_0x5775('0x2d'),_0x5775('0x2e'),_0x5775('0x2f'),_0x5775('0x30'),_0x5775('0x31')],'include':[{'model':_0x5775('0x32'),'as':_0x5775('0x32'),'attributes':['id',_0x5775('0x3'),_0x5775('0x33'),'active']},{'model':_0x5775('0x34'),'as':'mandatoryDispositionPause','attributes':['id',_0x5775('0x3')]},{'model':'Trunk','as':_0x5775('0x35'),'attributes':['id','name',_0x5775('0x33'),'active']},{'model':_0x5775('0x36'),'as':_0x5775('0x36'),'attributes':['id',_0x5775('0x3')],'include':[{'model':_0x5775('0x36'),'as':_0x5775('0x37'),'attributes':['id',_0x5775('0x3'),_0x5775('0x38')]}]}]},'log':_0x5775('0x0')});};};
\ No newline at end of file
index 71d4e41..dfaaf05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0413=['GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','queuecallerabandonAt','GetVoiceQueueReports','moment','../client','create','Request','getVoiceQueueReports'];(function(_0x1622a0,_0x2b55a9){var _0x2a2308=function(_0x38d05b){while(--_0x38d05b){_0x1622a0['push'](_0x1622a0['shift']());}};_0x2a2308(++_0x2b55a9);}(_0x0413,0xc3));var _0x3041=function(_0xc8cf1b,_0x6d738f){_0xc8cf1b=_0xc8cf1b-0x0;var _0x191604=_0x0413[_0xc8cf1b];return _0x191604;};'use strict';var moment=require(_0x3041('0x0'));var _=require('lodash');var client=require(_0x3041('0x1'));exports[_0x3041('0x2')]=function(_0x22fcc4){return client[_0x3041('0x3')]('CreateVoiceQueueReport',{'body':_0x22fcc4,'log':'CreateVoiceQueueReport'});};exports[_0x3041('0x4')]=function(){return function(){return client[_0x3041('0x3')](_0x3041('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x3041('0x6')](_0x3041('0x7'))[_0x3041('0x8')](_0x3041('0x9')),moment()[_0x3041('0xa')]('day')[_0x3041('0x8')](_0x3041('0x9'))]}},'attributes':[_0x3041('0xb'),_0x3041('0xc'),_0x3041('0xd'),_0x3041('0xe'),_0x3041('0xf'),_0x3041('0x10'),'queuecallerexit',_0x3041('0x11'),'queuecallerabandon',_0x3041('0x12')]},'log':_0x3041('0x13')});};};
\ No newline at end of file
+var _0xd73b=['queue','queuecallerjoinAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','create','CreateVoiceQueueReport','getVoiceQueueReports','Request','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid'];(function(_0x5eb1c6,_0x1989ef){var _0x584208=function(_0x46261a){while(--_0x46261a){_0x5eb1c6['push'](_0x5eb1c6['shift']());}};_0x584208(++_0x1989ef);}(_0xd73b,0x183));var _0xbd73=function(_0x26042e,_0x4338d7){_0x26042e=_0x26042e-0x0;var _0x16e92f=_0xd73b[_0x26042e];return _0x16e92f;};'use strict';var moment=require(_0xbd73('0x0'));var _=require(_0xbd73('0x1'));var client=require('../client');exports[_0xbd73('0x2')]=function(_0x54e94a){return client['Request'](_0xbd73('0x3'),{'body':_0x54e94a,'log':_0xbd73('0x3')});};exports[_0xbd73('0x4')]=function(){return function(){return client[_0xbd73('0x5')](_0xbd73('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xbd73('0x7')](_0xbd73('0x8'))[_0xbd73('0x9')](_0xbd73('0xa')),moment()[_0xbd73('0xb')](_0xbd73('0x8'))['format'](_0xbd73('0xa'))]}},'attributes':[_0xbd73('0xc'),_0xbd73('0xd'),_0xbd73('0xe'),'queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt',_0xbd73('0xf'),_0xbd73('0x10'),_0xbd73('0x11'),_0xbd73('0x12')]},'log':_0xbd73('0x13')});};};
\ No newline at end of file
index 69f15e8..a5c1be8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9882=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x5a3fb1,_0x14dbbc){var _0x49e026=function(_0xda57d4){while(--_0xda57d4){_0x5a3fb1['push'](_0x5a3fb1['shift']());}};_0x49e026(++_0x14dbbc);}(_0x9882,0x1f3));var _0x2988=function(_0x475e24,_0x30bee0){_0x475e24=_0x475e24-0x0;var _0x33194e=_0x9882[_0x475e24];return _0x33194e;};'use strict';var client=require(_0x2988('0x0'));exports[_0x2988('0x1')]=function(_0x337a9e){return function(){return client['Request'](_0x2988('0x2'),{'options':{'where':{'VoiceQueueId':_0x337a9e,'paused':!![]},'raw':!![]},'log':_0x2988('0x1')});};};
\ No newline at end of file
+var _0xb39a=['../client','getVoiceQueueRtPauses'];(function(_0x9c5775,_0x5d3504){var _0x5094f7=function(_0x2b3e04){while(--_0x2b3e04){_0x9c5775['push'](_0x9c5775['shift']());}};_0x5094f7(++_0x5d3504);}(_0xb39a,0xb2));var _0xab39=function(_0x4070e5,_0x3cba2c){_0x4070e5=_0x4070e5-0x0;var _0x421852=_0xb39a[_0x4070e5];return _0x421852;};'use strict';var client=require(_0xab39('0x0'));exports[_0xab39('0x1')]=function(_0x543881){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x543881,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
index d3e6ad5..53513b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8ef=['Request','CreateVoiceRecording','../client'];(function(_0x5dc441,_0x2fd3a1){var _0x3a3f06=function(_0x144bb6){while(--_0x144bb6){_0x5dc441['push'](_0x5dc441['shift']());}};_0x3a3f06(++_0x2fd3a1);}(_0xc8ef,0x6e));var _0xfc8e=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xc8ef[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var client=require(_0xfc8e('0x0'));exports['create']=function(_0xfee995){return client[_0xfc8e('0x1')]('CreateVoiceRecording',{'body':_['merge'](_0xfee995,{'value':_0xfee995['monitorFilename']}),'log':_0xfc8e('0x2')});};
\ No newline at end of file
+var _0x9776=['merge','../client','create','Request','CreateVoiceRecording'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9776,0x97));var _0x6977=function(_0x564421,_0x1a9a56){_0x564421=_0x564421-0x0;var _0x434711=_0x9776[_0x564421];return _0x434711;};'use strict';var _=require('lodash');var client=require(_0x6977('0x0'));exports[_0x6977('0x1')]=function(_0x371d52){return client[_0x6977('0x2')](_0x6977('0x3'),{'body':_[_0x6977('0x4')](_0x371d52,{'value':_0x371d52['monitorFilename']}),'log':_0x6977('0x3')});};
\ No newline at end of file
index 43b57bb..d7e6f4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86e1=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x86e1,0x1e0));var _0x186e=function(_0x2139d4,_0x1b5de3){_0x2139d4=_0x2139d4-0x0;var _0x4b6654=_0x86e1[_0x2139d4];return _0x4b6654;};'use strict';var client=require(_0x186e('0x0'));exports[_0x186e('0x1')]=function(_0x150562){return client[_0x186e('0x2')](_0x186e('0x3'),{'body':{'result':_0x150562[_0x186e('0x4')],'transfererchannel':_0x150562[_0x186e('0x5')],'transferercalleridnum':_0x150562[_0x186e('0x6')],'transferercalleridname':_0x150562[_0x186e('0x7')],'transfererconnectedlinenum':_0x150562[_0x186e('0x8')],'transfererconnectedlinename':_0x150562[_0x186e('0x9')],'transfereraccountcode':_0x150562[_0x186e('0xa')],'transferercontext':_0x150562[_0x186e('0xb')],'transfererexten':_0x150562['transfererexten'],'transfererlinkedid':_0x150562['transfererlinkedid'],'transfereechannel':_0x150562[_0x186e('0xc')],'transfereecalleridnum':_0x150562[_0x186e('0xd')],'transfereecalleridname':_0x150562[_0x186e('0xe')],'transfereeconnectedlinenum':_0x150562[_0x186e('0xf')],'transfereeconnectedlinename':_0x150562[_0x186e('0x10')],'transfereeaccountcode':_0x150562[_0x186e('0x11')],'transfereecontext':_0x150562[_0x186e('0x12')],'transfereeexten':_0x150562[_0x186e('0x13')],'transfereelinkedid':_0x150562[_0x186e('0x14')],'isexternal':_0x150562[_0x186e('0x15')],'context':_0x150562[_0x186e('0x16')],'extension':_0x150562[_0x186e('0x17')],'type':_0x186e('0x18')},'log':'CreateVoiceTransferReport'});};exports[_0x186e('0x19')]=function(_0x3beb81){return client[_0x186e('0x2')](_0x186e('0x3'),{'body':{'result':_0x3beb81[_0x186e('0x4')],'transfererchannel':_0x3beb81[_0x186e('0x1a')],'transferercalleridnum':_0x3beb81[_0x186e('0x1b')],'transferercalleridname':_0x3beb81[_0x186e('0x1c')],'transfererconnectedlinenum':_0x3beb81['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3beb81[_0x186e('0x1d')],'transfereraccountcode':_0x3beb81[_0x186e('0x1e')],'transferercontext':_0x3beb81[_0x186e('0x1f')],'transfererexten':_0x3beb81['secondtransfererexten'],'transfererlinkedid':_0x3beb81[_0x186e('0x20')],'transfereechannel':_0x3beb81[_0x186e('0x21')],'transfereecalleridnum':_0x3beb81[_0x186e('0x22')],'transfereecalleridname':_0x3beb81[_0x186e('0x23')],'transfereeconnectedlinenum':_0x3beb81['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3beb81[_0x186e('0x24')],'transfereeaccountcode':_0x3beb81[_0x186e('0x25')],'transfereecontext':_0x3beb81['transfertargetcontext'],'transfereeexten':_0x3beb81[_0x186e('0x26')],'transfereelinkedid':_0x3beb81[_0x186e('0x27')],'isexternal':_0x3beb81['isexternal'],'context':_0x3beb81[_0x186e('0x28')],'extension':_0x3beb81[_0x186e('0x29')],'type':_0x186e('0x2a')},'log':_0x186e('0x3')});};
\ No newline at end of file
+var _0x8455=['transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','isexternal','origtransferercontext','attended','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','context','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel'];(function(_0x39c92e,_0x717993){var _0x21763d=function(_0x5421d1){while(--_0x5421d1){_0x39c92e['push'](_0x39c92e['shift']());}};_0x21763d(++_0x717993);}(_0x8455,0x1c3));var _0x5845=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8455[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x5845('0x0')]=function(_0x2aaec0){return client[_0x5845('0x1')](_0x5845('0x2'),{'body':{'result':_0x2aaec0[_0x5845('0x3')],'transfererchannel':_0x2aaec0[_0x5845('0x4')],'transferercalleridnum':_0x2aaec0[_0x5845('0x5')],'transferercalleridname':_0x2aaec0['transferercalleridname'],'transfererconnectedlinenum':_0x2aaec0[_0x5845('0x6')],'transfererconnectedlinename':_0x2aaec0[_0x5845('0x7')],'transfereraccountcode':_0x2aaec0[_0x5845('0x8')],'transferercontext':_0x2aaec0[_0x5845('0x9')],'transfererexten':_0x2aaec0[_0x5845('0xa')],'transfererlinkedid':_0x2aaec0[_0x5845('0xb')],'transfereechannel':_0x2aaec0[_0x5845('0xc')],'transfereecalleridnum':_0x2aaec0[_0x5845('0xd')],'transfereecalleridname':_0x2aaec0[_0x5845('0xe')],'transfereeconnectedlinenum':_0x2aaec0[_0x5845('0xf')],'transfereeconnectedlinename':_0x2aaec0[_0x5845('0x10')],'transfereeaccountcode':_0x2aaec0['transfereeaccountcode'],'transfereecontext':_0x2aaec0[_0x5845('0x11')],'transfereeexten':_0x2aaec0[_0x5845('0x12')],'transfereelinkedid':_0x2aaec0[_0x5845('0x13')],'isexternal':_0x2aaec0['isexternal'],'context':_0x2aaec0[_0x5845('0x14')],'extension':_0x2aaec0['extension'],'type':'blind'},'log':_0x5845('0x2')});};exports[_0x5845('0x15')]=function(_0x59d746){return client[_0x5845('0x1')](_0x5845('0x2'),{'body':{'result':_0x59d746[_0x5845('0x3')],'transfererchannel':_0x59d746[_0x5845('0x16')],'transferercalleridnum':_0x59d746[_0x5845('0x17')],'transferercalleridname':_0x59d746['origtransferercalleridname'],'transfererconnectedlinenum':_0x59d746[_0x5845('0x18')],'transfererconnectedlinename':_0x59d746[_0x5845('0x19')],'transfereraccountcode':_0x59d746[_0x5845('0x1a')],'transferercontext':_0x59d746[_0x5845('0x1b')],'transfererexten':_0x59d746[_0x5845('0x1c')],'transfererlinkedid':_0x59d746['origtransfererlinkedid'],'transfereechannel':_0x59d746[_0x5845('0x1d')],'transfereecalleridnum':_0x59d746[_0x5845('0x1e')],'transfereecalleridname':_0x59d746[_0x5845('0x1f')],'transfereeconnectedlinenum':_0x59d746['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x59d746[_0x5845('0x20')],'transfereeaccountcode':_0x59d746[_0x5845('0x21')],'transfereecontext':_0x59d746['transfertargetcontext'],'transfereeexten':_0x59d746['transfertargetexten'],'transfereelinkedid':_0x59d746['transfertargetlinkedid'],'isexternal':_0x59d746[_0x5845('0x22')],'context':_0x59d746[_0x5845('0x23')],'extension':_0x59d746['origtransfererexten'],'type':_0x5845('0x24')},'log':_0x5845('0x2')});};
\ No newline at end of file
index 6fe5cd6..eafd70b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3429=['StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','name','timers','timer','agents','pause','error','asterisk','username','ami\x20disconnected','pick','keys','module','action','Reload','Action','then','message','catch','join','command','Command','content','voiceQueues','hasOwnProperty','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','abandoned','waiting','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','values','channels','length','isConnected','voicechannel','map','find','uniqueid','channel','%s.%s','filename','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve'];(function(_0x2329e5,_0x3b7b84){var _0x210561=function(_0x582357){while(--_0x582357){_0x2329e5['push'](_0x2329e5['shift']());}};_0x210561(++_0x3b7b84);}(_0x3429,0x1b0));var _0x9342=function(_0xcd3dec,_0xe3265d){_0xcd3dec=_0xcd3dec-0x0;var _0x453097=_0x3429[_0xcd3dec];return _0x453097;};'use strict';var _=require(_0x9342('0x0'));var util=require(_0x9342('0x1'));var jayson=require(_0x9342('0x2'));var schema=require(_0x9342('0x3'));var BPromise=require(_0x9342('0x4'));var moment=require('moment');var config=require(_0x9342('0x5'));var properties=require(_0x9342('0x6'));var ami=require(_0x9342('0x7'));exports[_0x9342('0x8')]=function(_0x57699a,_0x4a4801,_0x55d422){return new BPromise(function(_0x3b9c7c,_0x58e9f4){var _0x9be78f={'QueuePause':function(_0x5a3b16){return new Promise(function(_0x121dcc,_0x4d0761){var _0x310230=util['format'](_0x9342('0x9'),_0x9342('0xa'),_0x5a3b16[_0x9342('0xb')]);if(_0x57699a[_0x9342('0xc')]&&_0x57699a[_0x9342('0xc')][_0x310230]&&_0x57699a[_0x9342('0xc')][_0x310230][_0x9342('0xd')]){_0x57699a[_0x9342('0xc')][_0x310230]['updateAcw']();}if(_0x57699a[_0x9342('0xe')][_0x310230]){_0x57699a['agents'][_0x310230]['updateStatusRealtime']({'statePause':_0x5a3b16[_0x9342('0xf')]?!![]:![]});}_0x121dcc({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x1c8a9f){var _0x16a86b=this;return new Promise(function(_0x2fc1cb,_0x4f3a33){if(ami['isConnected']()==![]){return _0x4f3a33(_0x16a86b[_0x9342('0x10')](0x1f4,[config[_0x9342('0x11')]['ip'],config['asterisk'][_0x9342('0x12')],_0x9342('0x13')]['join']('\x20')));}_0x1c8a9f=_[_0x9342('0x14')](_0x1c8a9f,_[_0x9342('0x15')](properties[_0x9342('0x16')]));_0x1c8a9f[_0x9342('0x17')]=_0x9342('0x18');return ami[_0x9342('0x19')](_0x1c8a9f)[_0x9342('0x1a')](function(_0x329d7f){_0x2fc1cb({'code':0xc8,'message':_0x329d7f[_0x9342('0x1b')]});})[_0x9342('0x1c')](function(_0x5d157e){_0x4f3a33(_0x16a86b['error'](0x1f5,_0x5d157e['message']));});});},'Command':function(_0x5da313){var _0x16dbe1=this;return new Promise(function(_0x252bff,_0x531d5a){if(ami['isConnected']()==![]){return _0x531d5a(_0x16dbe1[_0x9342('0x10')](0x1f4,[config[_0x9342('0x11')]['ip'],config[_0x9342('0x11')][_0x9342('0x12')],_0x9342('0x13')][_0x9342('0x1d')]('\x20')));}_0x5da313=_[_0x9342('0x14')](_0x5da313,_0x9342('0x1e'));_0x5da313[_0x9342('0x17')]=_0x9342('0x1f');return ami[_0x9342('0x19')](_0x5da313)[_0x9342('0x1a')](function(_0x31ed10){_0x252bff({'code':0xc8,'message':_0x31ed10[_0x9342('0x20')]});})[_0x9342('0x1c')](function(_0x4e86c4){_0x531d5a(_0x16dbe1[_0x9342('0x10')](0x1f5,_0x4e86c4[_0x9342('0x1b')]));});});},'VoiceQueues':function(_0x10ce71){return new Promise(function(_0x13982b,_0x37707a){var _0x31f973=[];for(var _0x1b4a19 in _0x57699a['voiceQueues']){if(_0x57699a[_0x9342('0x21')][_0x9342('0x22')](_0x1b4a19)){var _0x5386ca=_0x57699a[_0x9342('0x21')][_0x1b4a19];var _0x3b1fdd={'id':_0x5386ca['id'],'name':_0x5386ca[_0x9342('0xb')],'strategy':_0x5386ca['strategy'],'answered':_0x5386ca['answered'],'available':_0x5386ca[_0x9342('0x23')],'loggedIn':_0x5386ca[_0x9342('0x24')],'pTalking':_0x5386ca[_0x9342('0x25')],'sumBillable':_0x5386ca[_0x9342('0x26')],'sumDuration':_0x5386ca['sumDuration'],'sumHoldTime':_0x5386ca[_0x9342('0x27')]||0x0,'talking':_0x5386ca[_0x9342('0x28')],'total':_0x5386ca[_0x9342('0x29')],'type':_0x5386ca['type'],'unmanaged':_0x5386ca['unmanaged'],'abandoned':_0x5386ca[_0x9342('0x2a')],'waiting':_0x5386ca[_0x9342('0x2b')],'loggedInDb':_0x5386ca['loggedInDb']};if(_0x5386ca[_0x9342('0x2c')]===_0x9342('0x2d')){_0x3b1fdd[_0x9342('0x2e')]=_0x5386ca[_0x9342('0x2e')];_0x3b1fdd[_0x9342('0x2f')]=_0x5386ca[_0x9342('0x2f')];_0x3b1fdd[_0x9342('0x30')]=_0x5386ca['dialOriginateCallerIdName'];_0x3b1fdd[_0x9342('0x31')]=_0x5386ca[_0x9342('0x31')];_0x3b1fdd[_0x9342('0x32')]=_0x5386ca[_0x9342('0x32')];_0x3b1fdd[_0x9342('0x33')]=_0x5386ca[_0x9342('0x33')];_0x3b1fdd['outboundAnswerAgiCallsDay']=_0x5386ca['outboundAnswerAgiCallsDay'];_0x3b1fdd['outboundAnswerCallsDay']=_0x5386ca[_0x9342('0x34')];_0x3b1fdd[_0x9342('0x35')]=_0x5386ca[_0x9342('0x35')];_0x3b1fdd[_0x9342('0x36')]=_0x5386ca[_0x9342('0x36')];_0x3b1fdd['outboundCongestionCallsDay']=_0x5386ca[_0x9342('0x37')];_0x3b1fdd[_0x9342('0x38')]=_0x5386ca[_0x9342('0x38')];_0x3b1fdd[_0x9342('0x39')]=_0x5386ca['outboundDropCallsDayCallersExit'];_0x3b1fdd['outboundDropCallsDayTimeout']=_0x5386ca[_0x9342('0x3a')];_0x3b1fdd['outboundNoAnswerCallsDay']=_0x5386ca[_0x9342('0x3b')];_0x3b1fdd[_0x9342('0x3c')]=_0x5386ca[_0x9342('0x3c')];_0x3b1fdd[_0x9342('0x3d')]=_0x5386ca['outboundOriginateFailureCallsDay'];_0x3b1fdd[_0x9342('0x3e')]=_0x5386ca[_0x9342('0x3e')];_0x3b1fdd[_0x9342('0x3f')]=_0x5386ca[_0x9342('0x3f')];_0x3b1fdd[_0x9342('0x40')]=_0x5386ca['outboundUnknownCallsDay'];_0x3b1fdd['predictiveIntervalAnsweredCalls']=_0x5386ca[_0x9342('0x41')];_0x3b1fdd[_0x9342('0x42')]=_0x5386ca[_0x9342('0x42')];_0x3b1fdd[_0x9342('0x43')]=_0x5386ca['predictiveIntervalAvgTalktime'];_0x3b1fdd[_0x9342('0x44')]=_0x5386ca[_0x9342('0x44')];_0x3b1fdd['predictiveIntervalDroppedCallsTimeout']=_0x5386ca[_0x9342('0x45')];_0x3b1fdd['predictiveIntervalErlangCalls']=_0x5386ca['predictiveIntervalErlangCalls'];_0x3b1fdd[_0x9342('0x46')]=_0x5386ca[_0x9342('0x46')];_0x3b1fdd[_0x9342('0x47')]=_0x5386ca[_0x9342('0x47')];_0x3b1fdd['predictiveIntervalMultiplicativeFactor']=_0x5386ca[_0x9342('0x48')];_0x3b1fdd['predictiveIntervalPauses']=_0x5386ca[_0x9342('0x49')];_0x3b1fdd['predictiveIntervalAvailable']=_0x5386ca[_0x9342('0x4a')];_0x3b1fdd[_0x9342('0x4b')]=_0x5386ca['predictiveIntervalTotalCalls'];_0x3b1fdd[_0x9342('0x1b')]=_0x5386ca[_0x9342('0x1b')];_0x3b1fdd[_0x9342('0x4c')]=_0x5386ca[_0x9342('0x4c')];_0x3b1fdd[_0x9342('0x4d')]=_0x5386ca['erlangCalls'];_0x3b1fdd[_0x9342('0x4e')]=_0x5386ca[_0x9342('0x4e')];_0x3b1fdd['erlangAbandonmentRate']=_0x5386ca['erlangAbandonmentRate'];_0x3b1fdd[_0x9342('0x4f')]=_0x5386ca[_0x9342('0x4f')];_0x3b1fdd[_0x9342('0x50')]=_0x5386ca['startPredictive'];_0x3b1fdd['startProgressive']=_0x5386ca[_0x9342('0x51')];}if(_0x5386ca[_0x9342('0x52')]){_0x3b1fdd[_0x9342('0x52')]={'id':_0x5386ca['Trunk']['id'],'name':_0x5386ca[_0x9342('0x52')]['name'],'active':_0x5386ca[_0x9342('0x52')]['active'],'callerid':_0x5386ca[_0x9342('0x52')][_0x9342('0x53')]};}if(_0x5386ca[_0x9342('0x54')]){_0x3b1fdd[_0x9342('0x54')]={'id':_0x5386ca[_0x9342('0x54')]['id'],'name':_0x5386ca[_0x9342('0x54')][_0x9342('0xb')]};}_0x31f973[_0x9342('0x55')](_0x3b1fdd);}}_0x13982b({'count':_0x31f973['length'],'rows':_0x31f973});});},'VoiceChannels':function(_0x5945d6){return new Promise(function(_0x1448cc,_0x203d61){var _0x1216af=_[_0x9342('0x56')](_0x57699a[_0x9342('0x57')]);_0x1448cc({'count':_0x1216af[_0x9342('0x58')],'rows':_0x1216af});});},'VoiceChannelMixMonitor':function(_0x1b61a2){var _0xbd4ce9=this;return new Promise(function(_0x15fb51,_0x39123f){if(ami[_0x9342('0x59')]()==![]){return _0x39123f(_0xbd4ce9[_0x9342('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x9342('0x11')][_0x9342('0x12')],_0x9342('0x13')][_0x9342('0x1d')]('\x20')));}var _0xeec2ed=schema(properties[_0x9342('0x5a')])['validate'](_0x1b61a2);if(_0xeec2ed[_0x9342('0x58')]>0x0){return _0x39123f(_0xbd4ce9[_0x9342('0x10')](0x1f4,_[_0x9342('0x5b')](_0xeec2ed,_0x9342('0x1b'))[_0x9342('0x1d')](',\x20')));}var _0x2f470d=_[_0x9342('0x5c')](_0x57699a['channels'],{'uniqueid':_0x1b61a2[_0x9342('0x5d')]});if(_0x2f470d&&_0x2f470d[_0x9342('0x5e')]){var _0x7265b3=util['format'](_0x9342('0x5f'),_0x1b61a2[_0x9342('0x60')]||_0x1b61a2[_0x9342('0x5d')],_0x1b61a2[_0x9342('0x61')]||_0x9342('0x62'));return ami[_0x9342('0x19')]({'action':_0x9342('0x63'),'channel':_0x2f470d['channel'],'file':_0x7265b3,'options':_0x9342('0x64')})[_0x9342('0x1a')](function(_0x5060d0){var _0x55d258=_[_0x9342('0x5c')](_0x2f470d[_0x9342('0x65')],{'filename':_0x9342('0x66')+_0x7265b3['toLowerCase']()});if(_[_0x9342('0x67')](_0x55d258)){_0x2f470d[_0x9342('0x65')][_0x9342('0x55')]({'filename':_0x9342('0x66')+_0x7265b3[_0x9342('0x68')](),'createdAt':moment()['format'](_0x9342('0x69')),'mixmonitorid':_0x5060d0[_0x9342('0x6a')],'status':'rec'});}else{_0x55d258['mixmonitorid']=_0x5060d0[_0x9342('0x6a')];_0x55d258[_0x9342('0x6b')]=_0x9342('0x6c');}_0x15fb51({'code':0xc8,'message':[_0x1b61a2[_0x9342('0x5d')],_0x9342('0x6d'),_0x5060d0[_0x9342('0x6a')]][_0x9342('0x1d')]('\x20'),'mixmonitorid':_0x5060d0['mixmonitorid']});})[_0x9342('0x1c')](function(_0x2f1567){_0x39123f(_0xbd4ce9[_0x9342('0x10')](0x1f5,[_0x1b61a2['uniqueid'],_0x2f1567[_0x9342('0x1b')]['toLowerCase']()][_0x9342('0x1d')]('\x20')));});}else{return _0x39123f(_0xbd4ce9[_0x9342('0x10')](0x1f5,_0x9342('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x3a2669){var _0x597d42=this;return new Promise(function(_0x4316ca,_0x315d29){if(ami[_0x9342('0x59')]()==![]){return _0x315d29(_0x597d42[_0x9342('0x10')](0x1f4,[config[_0x9342('0x11')]['ip'],config[_0x9342('0x11')]['username'],_0x9342('0x13')][_0x9342('0x1d')]('\x20')));}var _0x49a178=schema(properties['voicechannel'])['validate'](_0x3a2669);if(_0x49a178[_0x9342('0x58')]>0x0){return _0x315d29(_0x597d42[_0x9342('0x10')](0x1f4,_[_0x9342('0x5b')](_0x49a178,_0x9342('0x1b'))[_0x9342('0x1d')](',\x20')));}var _0x465514=_[_0x9342('0x5c')](_0x57699a['channels'],{'uniqueid':_0x3a2669[_0x9342('0x5d')]});if(_0x465514){return BPromise[_0x9342('0x6f')]()[_0x9342('0x1a')](function(){if(_0x465514[_0x9342('0x5e')]){return ami[_0x9342('0x19')]({'action':_0x9342('0x70'),'channel':_0x465514[_0x9342('0x5e')],'mixmonitorid':_0x3a2669[_0x9342('0x6a')]})['catch'](function(_0x48571c){});}})[_0x9342('0x1a')](function(){if(_0x465514[_0x9342('0x71')]){return ami[_0x9342('0x19')]({'action':_0x9342('0x70'),'channel':_0x465514[_0x9342('0x71')],'mixmonitorid':_0x3a2669[_0x9342('0x6a')]})['catch'](function(_0xc70724){});}})[_0x9342('0x1a')](function(_0x5b0572){var _0x30a03c=_[_0x9342('0x5c')](_0x465514[_0x9342('0x65')],{'mixmonitorid':_0x3a2669['mixmonitorid']});if(_0x30a03c){_0x30a03c[_0x9342('0x6b')]=_0x9342('0x72');}})[_0x9342('0x1a')](function(){var _0x32cb6f=util[_0x9342('0x61')](_0x9342('0x5f'),_0x3a2669[_0x9342('0x60')]||_0x3a2669[_0x9342('0x5d')],_0x3a2669[_0x9342('0x61')]||_0x9342('0x62'));var _0x536103=_[_0x9342('0x5c')](_0x465514[_0x9342('0x65')],{'filename':_0x9342('0x66')+_0x32cb6f[_0x9342('0x68')]()});if(_0x536103){_0x536103[_0x9342('0x6b')]=_0x9342('0x72');}})[_0x9342('0x1a')](function(){_0x4316ca({'code':0xc8,'message':[_0x3a2669[_0x9342('0x5d')],_0x9342('0x73')]['join']('\x20')});})[_0x9342('0x1c')](function(_0x51acb4){_0x315d29(_0x597d42['error'](0x1f5,[_0x3a2669['uniqueid'],_0x51acb4[_0x9342('0x1b')][_0x9342('0x68')]()][_0x9342('0x1d')]('\x20')));});}else{return _0x315d29(_0x597d42[_0x9342('0x10')](0x1f5,_0x9342('0x6e')));}});},'VoiceQueuesChannels':function(_0x29fd46){return new Promise(function(_0x24b79b,_0x2154a4){var _0x185126=_[_0x9342('0x56')](_0x57699a[_0x9342('0x74')]);_0x24b79b({'count':_0x185126[_0x9342('0x58')],'rows':_0x185126});});},'VoiceQueuesChannel':function(_0x5b4842){var _0x11404f=this;return new Promise(function(_0x5c1531,_0x5e4dea){var _0x957238=schema(properties[_0x9342('0x75')])[_0x9342('0x3')](_0x5b4842);if(_0x957238['length']>0x0){return _0x5e4dea(_0x11404f['error'](0x1f4,_[_0x9342('0x5b')](_0x957238,_0x9342('0x1b'))['join'](',\x20')));}var _0x250682=_[_0x9342('0x5c')](_0x57699a[_0x9342('0x74')],{'uniqueid':_0x5b4842['uniqueid']});if(_0x250682){_0x5c1531(_0x250682);}else{return _0x5e4dea(_0x11404f[_0x9342('0x10')](0x1f5,_0x9342('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x1306df){var _0x10a534=this;return new Promise(function(_0xe55acd,_0x2a1899){if(ami[_0x9342('0x59')]()==![]){return _0x2a1899(_0x10a534[_0x9342('0x10')](0x1f4,[config[_0x9342('0x11')]['ip'],config[_0x9342('0x11')][_0x9342('0x12')],_0x9342('0x13')][_0x9342('0x1d')]('\x20')));}var _0x1775a2=schema(properties[_0x9342('0x76')])[_0x9342('0x3')](_0x1306df);if(_0x1775a2[_0x9342('0x58')]>0x0){return _0x2a1899(_0x10a534[_0x9342('0x10')](0x1f4,_[_0x9342('0x5b')](_0x1775a2,_0x9342('0x1b'))['join'](',\x20')));}var _0x32e74a=_[_0x9342('0x5c')](_0x57699a['queueChannels'],{'uniqueid':_0x1306df[_0x9342('0x5d')]});if(_0x32e74a&&_0x32e74a['channel']){return ami[_0x9342('0x19')]({'action':_0x9342('0x77'),'channel':_0x32e74a[_0x9342('0x5e')]})[_0x9342('0x1a')](function(_0x1da116){_0xe55acd({'code':0xc8,'message':[_0x1306df[_0x9342('0x5d')],_0x1da116[_0x9342('0x1b')][_0x9342('0x68')]()]['join']('\x20')});})[_0x9342('0x1c')](function(_0x587181){_0x2a1899(_0x10a534[_0x9342('0x10')](0x1f5,[_0x1306df[_0x9342('0x5d')],_0x587181[_0x9342('0x1b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x2a1899(_0x10a534[_0x9342('0x10')](0x1f5,_0x9342('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x5a65d9){var _0x489349=this;return new Promise(function(_0x5b5e8f,_0x40a5b){if(ami[_0x9342('0x59')]()==![]){return _0x40a5b(_0x489349[_0x9342('0x10')](0x1f4,[config[_0x9342('0x11')]['ip'],config[_0x9342('0x11')][_0x9342('0x12')],'ami\x20disconnected'][_0x9342('0x1d')]('\x20')));}var _0x596bbb=schema(properties[_0x9342('0x78')])['validate'](_0x5a65d9);if(_0x596bbb[_0x9342('0x58')]>0x0){return _0x40a5b(_0x489349['error'](0x1f4,_[_0x9342('0x5b')](_0x596bbb,'message')[_0x9342('0x1d')](',\x20')));}var _0x46adf9=_['find'](_0x57699a['queueChannels'],{'uniqueid':_0x5a65d9[_0x9342('0x5d')]});if(_0x46adf9&&_0x46adf9[_0x9342('0x5e')]){return ami[_0x9342('0x19')]({'action':'Redirect','channel':_0x46adf9[_0x9342('0x5e')],'exten':_0x5a65d9[_0x9342('0x79')],'context':_0x5a65d9[_0x9342('0x7a')]||_0x46adf9[_0x9342('0x7a')],'priority':0x1})[_0x9342('0x1a')](function(_0x3fc2f0){_0x5b5e8f({'code':0xc8,'message':[_0x5a65d9[_0x9342('0x5d')],_0x3fc2f0['message'][_0x9342('0x68')]()][_0x9342('0x1d')]('\x20')});})[_0x9342('0x1c')](function(_0x109321){_0x40a5b(_0x489349[_0x9342('0x10')](0x1f5,[_0x5a65d9[_0x9342('0x5d')],_0x109321['message'][_0x9342('0x68')]()]['join']('\x20')));});}else{return _0x40a5b(_0x489349[_0x9342('0x10')](0x1f5,_0x9342('0x6e')));}});},'Agents':function(_0x1c8558){return new Promise(function(_0x573927,_0x215e5c){var _0x21f5fe=_[_0x9342('0x56')](_0x57699a['agents']);_0x573927({'count':_0x21f5fe['length'],'rows':_0x21f5fe});});},'Telephones':function(_0x2d43e1){return new Promise(function(_0xaddf03,_0x59431c){var _0x4735b0=_['values'](_0x57699a[_0x9342('0x7b')]);_0xaddf03({'count':_0x4735b0[_0x9342('0x58')],'rows':_0x4735b0});});},'Trunks':function(_0x530814){return new Promise(function(_0x2d38e6,_0xe2694a){var _0x13afde=_[_0x9342('0x56')](_0x57699a[_0x9342('0x7c')]);_0x2d38e6({'count':_0x13afde['length'],'rows':_0x13afde});});},'OutboundChannels':function(_0x28ad42){return new Promise(function(_0x49520a,_0x24f1bc){var _0x1cb7bd=_[_0x9342('0x56')](_0x57699a[_0x9342('0x7d')]);_0x49520a({'count':_0x1cb7bd[_0x9342('0x58')],'rows':_0x1cb7bd});});},'Outbound':function(_0x7e5e44){return new Promise(function(_0x1516b2,_0x15527e){_0x1516b2(_0x57699a['outbound']);});},'Campaigns':function(_0x29eecc){return new Promise(function(_0x2ee74f,_0x289631){var _0x58725f=_[_0x9342('0x56')](_0x57699a[_0x9342('0x7e')]);_0x2ee74f({'count':_0x58725f[_0x9342('0x58')],'rows':_0x58725f});});},'VoiceQueuesPreview':function(_0x2c7e4c){var _0x2ef0d7=this;return new Promise(function(_0x1b0f92,_0x3f7253){_0x4a4801[_0x9342('0x7f')](_0x2c7e4c['id'])[_0x9342('0x1a')](function(_0x4abf50){_0x1b0f92({'code':0xc8,'message':_0x4abf50[_0x9342('0x1b')]});})['catch'](function(_0x7cf44a){_0x3f7253(_0x2ef0d7[_0x9342('0x10')](0x1f4,_0x7cf44a['message']));});});},'EventManager':function(_0x29ba46){var _0x3d1ab7=this;return new Promise(function(_0x442980,_0x1e4405){if(!_0x29ba46[_0x9342('0x80')]){return _0x1e4405(_0x3d1ab7[_0x9342('0x10')](0x1f4,_0x9342('0x81')));}ami[_0x9342('0x82')](_0x9342('0x83')+_0x29ba46[_0x9342('0x80')],_0x29ba46[_0x9342('0x1b')]);_0x442980({'code':0xc8,'message':_0x29ba46});});},'FaxAccounts':function(_0x400192){return new Promise(function(_0x4ee3fd,_0xc9d10a){var _0x30f7b7=_[_0x9342('0x56')](_0x57699a['faxAccounts']);_0x4ee3fd({'count':_0x30f7b7[_0x9342('0x58')],'rows':_0x30f7b7});});},'SendFax':function(_0x37f093){var _0x48eb59=this;return new Promise(function(_0x48c79f,_0x4137a1){_0x55d422['send'](_0x37f093)[_0x9342('0x1a')](function(_0x1315e2){_0x48c79f({'code':0xc8,'message':_0x1315e2['message']});})['catch'](function(_0x11faad){_0x4137a1(_0x48eb59[_0x9342('0x10')](0x1f4,_0x11faad['message']));});});},'CheckAfterSend':function(_0x59aa36){var _0x2266a2=this;return new Promise(function(_0x3b733a,_0x2d5503){_0x55d422['checkAfterSend'](_0x59aa36)[_0x9342('0x1a')](function(_0x793b6d){_0x3b733a({'code':0xc8,'message':_0x793b6d[_0x9342('0x1b')]});})[_0x9342('0x1c')](function(_0x271b0d){_0x2d5503(_0x2266a2[_0x9342('0x10')](0x1f4,_0x271b0d[_0x9342('0x1b')]));});});}};var _0x16e350=jayson[_0x9342('0x84')](_0x9be78f)[_0x9342('0x85')]();_0x16e350['on'](_0x9342('0x10'),function(_0x45dd2d){return _0x58e9f4(_0x45dd2d);});_0x16e350[_0x9342('0x8')](0x232a,_0x9342('0x86'),function(){console['log'](_0x9342('0x87'),0x232a);return _0x3b9c7c('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
+var _0x1ae3=['message','catch','ami\x20disconnected','pick','command','Command','content','voiceQueues','hasOwnProperty','name','answered','available','sumBillable','sumDuration','talking','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','push','length','isConnected','voicechannel','map','find','channels','channel','%s.%s','filename','uniqueid','wav','MixMonitor','monitors','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','values','telephones','trunks','outboundChannels','outbound','run','event','Event\x20name\x20mandatory','emit','custom:','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','listen','format','%s/%s','SIP','timers','timer','updateAcw','agents','QueuePause','error','asterisk','username','join','keys','module','Action','then'];(function(_0x192add,_0x4490e4){var _0x1b9d9d=function(_0x55084d){while(--_0x55084d){_0x192add['push'](_0x192add['shift']());}};_0x1b9d9d(++_0x4490e4);}(_0x1ae3,0x16c));var _0x31ae=function(_0x216816,_0x56e87a){_0x216816=_0x216816-0x0;var _0x4e1886=_0x1ae3[_0x216816];return _0x4e1886;};'use strict';var _=require('lodash');var util=require('util');var jayson=require(_0x31ae('0x0'));var schema=require(_0x31ae('0x1'));var BPromise=require(_0x31ae('0x2'));var moment=require(_0x31ae('0x3'));var config=require(_0x31ae('0x4'));var properties=require('../properties');var ami=require(_0x31ae('0x5'));exports[_0x31ae('0x6')]=function(_0x19a976,_0x3b9502,_0x4e5b87){return new BPromise(function(_0x5cc4bb,_0x18eb56){var _0xdd8645={'QueuePause':function(_0x2629e2){return new Promise(function(_0x152dc2,_0x169183){var _0x3ecfa0=util[_0x31ae('0x7')](_0x31ae('0x8'),_0x31ae('0x9'),_0x2629e2['name']);if(_0x19a976[_0x31ae('0xa')]&&_0x19a976[_0x31ae('0xa')][_0x3ecfa0]&&_0x19a976['timers'][_0x3ecfa0][_0x31ae('0xb')]){_0x19a976['timers'][_0x3ecfa0][_0x31ae('0xc')]();}if(_0x19a976[_0x31ae('0xd')][_0x3ecfa0]){_0x19a976[_0x31ae('0xd')][_0x3ecfa0]['updateStatusRealtime']({'statePause':_0x2629e2['pause']?!![]:![]});}_0x152dc2({'code':0xc8,'message':_0x31ae('0xe')});});},'Reload':function(_0x26ab55){var _0x4eb406=this;return new Promise(function(_0x394cee,_0x342c52){if(ami['isConnected']()==![]){return _0x342c52(_0x4eb406[_0x31ae('0xf')](0x1f4,[config[_0x31ae('0x10')]['ip'],config[_0x31ae('0x10')][_0x31ae('0x11')],'ami\x20disconnected'][_0x31ae('0x12')]('\x20')));}_0x26ab55=_['pick'](_0x26ab55,_[_0x31ae('0x13')](properties[_0x31ae('0x14')]));_0x26ab55['action']='Reload';return ami[_0x31ae('0x15')](_0x26ab55)[_0x31ae('0x16')](function(_0x4ba174){_0x394cee({'code':0xc8,'message':_0x4ba174[_0x31ae('0x17')]});})[_0x31ae('0x18')](function(_0x22d6b2){_0x342c52(_0x4eb406[_0x31ae('0xf')](0x1f5,_0x22d6b2[_0x31ae('0x17')]));});});},'Command':function(_0x4cc653){var _0x415848=this;return new Promise(function(_0x1eb0cf,_0x468442){if(ami['isConnected']()==![]){return _0x468442(_0x415848[_0x31ae('0xf')](0x1f4,[config[_0x31ae('0x10')]['ip'],config[_0x31ae('0x10')]['username'],_0x31ae('0x19')][_0x31ae('0x12')]('\x20')));}_0x4cc653=_[_0x31ae('0x1a')](_0x4cc653,_0x31ae('0x1b'));_0x4cc653['action']=_0x31ae('0x1c');return ami[_0x31ae('0x15')](_0x4cc653)['then'](function(_0x1f67e1){_0x1eb0cf({'code':0xc8,'message':_0x1f67e1[_0x31ae('0x1d')]});})[_0x31ae('0x18')](function(_0x1ca236){_0x468442(_0x415848[_0x31ae('0xf')](0x1f5,_0x1ca236[_0x31ae('0x17')]));});});},'VoiceQueues':function(_0x267069){return new Promise(function(_0x5f0266,_0x17c663){var _0x3160aa=[];for(var _0x22516c in _0x19a976[_0x31ae('0x1e')]){if(_0x19a976[_0x31ae('0x1e')][_0x31ae('0x1f')](_0x22516c)){var _0x520d21=_0x19a976[_0x31ae('0x1e')][_0x22516c];var _0x3bbe9e={'id':_0x520d21['id'],'name':_0x520d21[_0x31ae('0x20')],'strategy':_0x520d21['strategy'],'answered':_0x520d21[_0x31ae('0x21')],'available':_0x520d21[_0x31ae('0x22')],'loggedIn':_0x520d21['loggedIn'],'pTalking':_0x520d21['pTalking'],'sumBillable':_0x520d21[_0x31ae('0x23')],'sumDuration':_0x520d21[_0x31ae('0x24')],'sumHoldTime':_0x520d21['sumHoldTime']||0x0,'talking':_0x520d21[_0x31ae('0x25')],'total':_0x520d21['total'],'type':_0x520d21[_0x31ae('0x26')],'unmanaged':_0x520d21['unmanaged'],'abandoned':_0x520d21[_0x31ae('0x27')],'waiting':_0x520d21[_0x31ae('0x28')],'loggedInDb':_0x520d21[_0x31ae('0x29')]};if(_0x520d21['type']==='outbound'){_0x3bbe9e[_0x31ae('0x2a')]=_0x520d21[_0x31ae('0x2a')];_0x3bbe9e[_0x31ae('0x2b')]=_0x520d21[_0x31ae('0x2b')];_0x3bbe9e[_0x31ae('0x2c')]=_0x520d21[_0x31ae('0x2c')];_0x3bbe9e['dialOriginateCallerIdNumber']=_0x520d21['dialOriginateCallerIdNumber'];_0x3bbe9e[_0x31ae('0x2d')]=_0x520d21['dialOriginateTimeout'];_0x3bbe9e[_0x31ae('0x2e')]=_0x520d21[_0x31ae('0x2e')];_0x3bbe9e[_0x31ae('0x2f')]=_0x520d21[_0x31ae('0x2f')];_0x3bbe9e[_0x31ae('0x30')]=_0x520d21['outboundAnswerCallsDay'];_0x3bbe9e[_0x31ae('0x31')]=_0x520d21['outboundBlacklistCallsDay'];_0x3bbe9e[_0x31ae('0x32')]=_0x520d21[_0x31ae('0x32')];_0x3bbe9e['outboundCongestionCallsDay']=_0x520d21['outboundCongestionCallsDay'];_0x3bbe9e[_0x31ae('0x33')]=_0x520d21[_0x31ae('0x33')];_0x3bbe9e[_0x31ae('0x34')]=_0x520d21[_0x31ae('0x34')];_0x3bbe9e[_0x31ae('0x35')]=_0x520d21['outboundDropCallsDayTimeout'];_0x3bbe9e['outboundNoAnswerCallsDay']=_0x520d21[_0x31ae('0x36')];_0x3bbe9e['outboundNoSuchCallsDay']=_0x520d21['outboundNoSuchCallsDay'];_0x3bbe9e[_0x31ae('0x37')]=_0x520d21[_0x31ae('0x37')];_0x3bbe9e[_0x31ae('0x38')]=_0x520d21['outboundReCallsDay'];_0x3bbe9e[_0x31ae('0x39')]=_0x520d21[_0x31ae('0x39')];_0x3bbe9e[_0x31ae('0x3a')]=_0x520d21['outboundUnknownCallsDay'];_0x3bbe9e[_0x31ae('0x3b')]=_0x520d21['predictiveIntervalAnsweredCalls'];_0x3bbe9e[_0x31ae('0x3c')]=_0x520d21['predictiveIntervalAvgHoldtime'];_0x3bbe9e['predictiveIntervalAvgTalktime']=_0x520d21[_0x31ae('0x3d')];_0x3bbe9e[_0x31ae('0x3e')]=_0x520d21[_0x31ae('0x3e')];_0x3bbe9e[_0x31ae('0x3f')]=_0x520d21[_0x31ae('0x3f')];_0x3bbe9e['predictiveIntervalErlangCalls']=_0x520d21['predictiveIntervalErlangCalls'];_0x3bbe9e['predictiveIntervalErlangCallsDroppedCalls']=_0x520d21['predictiveIntervalErlangCallsDroppedCalls'];_0x3bbe9e[_0x31ae('0x40')]=_0x520d21[_0x31ae('0x40')];_0x3bbe9e[_0x31ae('0x41')]=_0x520d21[_0x31ae('0x41')];_0x3bbe9e[_0x31ae('0x42')]=_0x520d21[_0x31ae('0x42')];_0x3bbe9e[_0x31ae('0x43')]=_0x520d21[_0x31ae('0x43')];_0x3bbe9e[_0x31ae('0x44')]=_0x520d21['predictiveIntervalTotalCalls'];_0x3bbe9e['message']=_0x520d21['message'];_0x3bbe9e[_0x31ae('0x45')]=_0x520d21['originated'];_0x3bbe9e[_0x31ae('0x46')]=_0x520d21[_0x31ae('0x46')];_0x3bbe9e[_0x31ae('0x47')]=_0x520d21[_0x31ae('0x47')];_0x3bbe9e[_0x31ae('0x48')]=_0x520d21[_0x31ae('0x48')];_0x3bbe9e[_0x31ae('0x49')]=_0x520d21[_0x31ae('0x49')];_0x3bbe9e[_0x31ae('0x4a')]=_0x520d21[_0x31ae('0x4a')];_0x3bbe9e['startProgressive']=_0x520d21['startProgressive'];}if(_0x520d21['Trunk']){_0x3bbe9e['Trunk']={'id':_0x520d21[_0x31ae('0x4b')]['id'],'name':_0x520d21['Trunk'][_0x31ae('0x20')],'active':_0x520d21[_0x31ae('0x4b')][_0x31ae('0x4c')],'callerid':_0x520d21[_0x31ae('0x4b')][_0x31ae('0x4d')]};}if(_0x520d21[_0x31ae('0x4e')]){_0x3bbe9e[_0x31ae('0x4e')]={'id':_0x520d21[_0x31ae('0x4e')]['id'],'name':_0x520d21[_0x31ae('0x4e')][_0x31ae('0x20')]};}_0x3160aa[_0x31ae('0x4f')](_0x3bbe9e);}}_0x5f0266({'count':_0x3160aa[_0x31ae('0x50')],'rows':_0x3160aa});});},'VoiceChannels':function(_0x569abe){return new Promise(function(_0x189f85,_0x48361f){var _0xfdf2b5=_['values'](_0x19a976['channels']);_0x189f85({'count':_0xfdf2b5['length'],'rows':_0xfdf2b5});});},'VoiceChannelMixMonitor':function(_0x6d02ee){var _0x26df37=this;return new Promise(function(_0x3d0848,_0x4ad031){if(ami[_0x31ae('0x51')]()==![]){return _0x4ad031(_0x26df37[_0x31ae('0xf')](0x1f4,[config[_0x31ae('0x10')]['ip'],config[_0x31ae('0x10')][_0x31ae('0x11')],'ami\x20disconnected'][_0x31ae('0x12')]('\x20')));}var _0x5a406d=schema(properties[_0x31ae('0x52')])[_0x31ae('0x1')](_0x6d02ee);if(_0x5a406d[_0x31ae('0x50')]>0x0){return _0x4ad031(_0x26df37[_0x31ae('0xf')](0x1f4,_[_0x31ae('0x53')](_0x5a406d,_0x31ae('0x17'))[_0x31ae('0x12')](',\x20')));}var _0x2b7a54=_[_0x31ae('0x54')](_0x19a976[_0x31ae('0x55')],{'uniqueid':_0x6d02ee['uniqueid']});if(_0x2b7a54&&_0x2b7a54[_0x31ae('0x56')]){var _0x402428=util[_0x31ae('0x7')](_0x31ae('0x57'),_0x6d02ee[_0x31ae('0x58')]||_0x6d02ee[_0x31ae('0x59')],_0x6d02ee['format']||_0x31ae('0x5a'));return ami['Action']({'action':_0x31ae('0x5b'),'channel':_0x2b7a54[_0x31ae('0x56')],'file':_0x402428,'options':'ai(mixmonitorid)'})[_0x31ae('0x16')](function(_0x1bbece){var _0x1b719c=_[_0x31ae('0x54')](_0x2b7a54[_0x31ae('0x5c')],{'filename':'/var/spool/asterisk/monitor/'+_0x402428['toLowerCase']()});if(_[_0x31ae('0x5d')](_0x1b719c)){_0x2b7a54['monitors'][_0x31ae('0x4f')]({'filename':'/var/spool/asterisk/monitor/'+_0x402428[_0x31ae('0x5e')](),'createdAt':moment()[_0x31ae('0x7')](_0x31ae('0x5f')),'mixmonitorid':_0x1bbece[_0x31ae('0x60')],'status':_0x31ae('0x61')});}else{_0x1b719c[_0x31ae('0x60')]=_0x1bbece[_0x31ae('0x60')];_0x1b719c['status']=_0x31ae('0x61');}_0x3d0848({'code':0xc8,'message':[_0x6d02ee[_0x31ae('0x59')],_0x31ae('0x62'),_0x1bbece[_0x31ae('0x60')]][_0x31ae('0x12')]('\x20'),'mixmonitorid':_0x1bbece[_0x31ae('0x60')]});})[_0x31ae('0x18')](function(_0x242e49){_0x4ad031(_0x26df37['error'](0x1f5,[_0x6d02ee[_0x31ae('0x59')],_0x242e49[_0x31ae('0x17')]['toLowerCase']()][_0x31ae('0x12')]('\x20')));});}else{return _0x4ad031(_0x26df37[_0x31ae('0xf')](0x1f5,_0x31ae('0x63')));}});},'VoiceChannelStopMixMonitor':function(_0x553a9a){var _0x50c3d5=this;return new Promise(function(_0x460576,_0x8fafa4){if(ami[_0x31ae('0x51')]()==![]){return _0x8fafa4(_0x50c3d5[_0x31ae('0xf')](0x1f4,[config[_0x31ae('0x10')]['ip'],config[_0x31ae('0x10')]['username'],'ami\x20disconnected'][_0x31ae('0x12')]('\x20')));}var _0xd780f3=schema(properties[_0x31ae('0x52')])[_0x31ae('0x1')](_0x553a9a);if(_0xd780f3[_0x31ae('0x50')]>0x0){return _0x8fafa4(_0x50c3d5[_0x31ae('0xf')](0x1f4,_[_0x31ae('0x53')](_0xd780f3,_0x31ae('0x17'))[_0x31ae('0x12')](',\x20')));}var _0x1cb85b=_['find'](_0x19a976[_0x31ae('0x55')],{'uniqueid':_0x553a9a[_0x31ae('0x59')]});if(_0x1cb85b){return BPromise[_0x31ae('0x64')]()[_0x31ae('0x16')](function(){if(_0x1cb85b[_0x31ae('0x56')]){return ami[_0x31ae('0x15')]({'action':_0x31ae('0x65'),'channel':_0x1cb85b[_0x31ae('0x56')],'mixmonitorid':_0x553a9a[_0x31ae('0x60')]})['catch'](function(_0x179b64){});}})[_0x31ae('0x16')](function(){if(_0x1cb85b[_0x31ae('0x66')]){return ami[_0x31ae('0x15')]({'action':_0x31ae('0x65'),'channel':_0x1cb85b[_0x31ae('0x66')],'mixmonitorid':_0x553a9a[_0x31ae('0x60')]})['catch'](function(_0x26aeda){});}})[_0x31ae('0x16')](function(_0x4cfc9e){var _0x4f7296=_[_0x31ae('0x54')](_0x1cb85b[_0x31ae('0x5c')],{'mixmonitorid':_0x553a9a[_0x31ae('0x60')]});if(_0x4f7296){_0x4f7296[_0x31ae('0x67')]='stop';}})['then'](function(){var _0x2391a0=util['format'](_0x31ae('0x57'),_0x553a9a['filename']||_0x553a9a[_0x31ae('0x59')],_0x553a9a['format']||_0x31ae('0x5a'));var _0x2ce42e=_['find'](_0x1cb85b[_0x31ae('0x5c')],{'filename':'/var/spool/asterisk/monitor/'+_0x2391a0[_0x31ae('0x5e')]()});if(_0x2ce42e){_0x2ce42e[_0x31ae('0x67')]=_0x31ae('0x68');}})[_0x31ae('0x16')](function(){_0x460576({'code':0xc8,'message':[_0x553a9a[_0x31ae('0x59')],_0x31ae('0x69')][_0x31ae('0x12')]('\x20')});})[_0x31ae('0x18')](function(_0x4e9c34){_0x8fafa4(_0x50c3d5[_0x31ae('0xf')](0x1f5,[_0x553a9a[_0x31ae('0x59')],_0x4e9c34[_0x31ae('0x17')][_0x31ae('0x5e')]()][_0x31ae('0x12')]('\x20')));});}else{return _0x8fafa4(_0x50c3d5[_0x31ae('0xf')](0x1f5,_0x31ae('0x63')));}});},'VoiceQueuesChannels':function(_0x482609){return new Promise(function(_0x2e3c7b,_0x25a109){var _0x3a8d47=_['values'](_0x19a976[_0x31ae('0x6a')]);_0x2e3c7b({'count':_0x3a8d47[_0x31ae('0x50')],'rows':_0x3a8d47});});},'VoiceQueuesChannel':function(_0x5cdfc9){var _0x1b78be=this;return new Promise(function(_0x497bb7,_0x238507){var _0x159e56=schema(properties[_0x31ae('0x6b')])[_0x31ae('0x1')](_0x5cdfc9);if(_0x159e56['length']>0x0){return _0x238507(_0x1b78be[_0x31ae('0xf')](0x1f4,_[_0x31ae('0x53')](_0x159e56,'message')[_0x31ae('0x12')](',\x20')));}var _0x43b212=_[_0x31ae('0x54')](_0x19a976['queueChannels'],{'uniqueid':_0x5cdfc9[_0x31ae('0x59')]});if(_0x43b212){_0x497bb7(_0x43b212);}else{return _0x238507(_0x1b78be[_0x31ae('0xf')](0x1f5,_0x31ae('0x63')));}});},'VoiceQueuesChannelHangup':function(_0x523fec){var _0x29c98e=this;return new Promise(function(_0x502ffc,_0xac2351){if(ami[_0x31ae('0x51')]()==![]){return _0xac2351(_0x29c98e[_0x31ae('0xf')](0x1f4,[config[_0x31ae('0x10')]['ip'],config['asterisk'][_0x31ae('0x11')],_0x31ae('0x19')][_0x31ae('0x12')]('\x20')));}var _0x3b5596=schema(properties[_0x31ae('0x6c')])[_0x31ae('0x1')](_0x523fec);if(_0x3b5596[_0x31ae('0x50')]>0x0){return _0xac2351(_0x29c98e[_0x31ae('0xf')](0x1f4,_['map'](_0x3b5596,_0x31ae('0x17'))['join'](',\x20')));}var _0x433b36=_['find'](_0x19a976[_0x31ae('0x6a')],{'uniqueid':_0x523fec[_0x31ae('0x59')]});if(_0x433b36&&_0x433b36[_0x31ae('0x56')]){return ami[_0x31ae('0x15')]({'action':_0x31ae('0x6d'),'channel':_0x433b36[_0x31ae('0x56')]})[_0x31ae('0x16')](function(_0x39a032){_0x502ffc({'code':0xc8,'message':[_0x523fec[_0x31ae('0x59')],_0x39a032[_0x31ae('0x17')][_0x31ae('0x5e')]()][_0x31ae('0x12')]('\x20')});})[_0x31ae('0x18')](function(_0x4c4f96){_0xac2351(_0x29c98e[_0x31ae('0xf')](0x1f5,[_0x523fec[_0x31ae('0x59')],_0x4c4f96[_0x31ae('0x17')][_0x31ae('0x5e')]()][_0x31ae('0x12')]('\x20')));});}else{return _0xac2351(_0x29c98e['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x4f5655){var _0x46b506=this;return new Promise(function(_0x17b9de,_0x564e3e){if(ami[_0x31ae('0x51')]()==![]){return _0x564e3e(_0x46b506['error'](0x1f4,[config['asterisk']['ip'],config[_0x31ae('0x10')]['username'],_0x31ae('0x19')][_0x31ae('0x12')]('\x20')));}var _0x1d66a5=schema(properties[_0x31ae('0x6e')])[_0x31ae('0x1')](_0x4f5655);if(_0x1d66a5[_0x31ae('0x50')]>0x0){return _0x564e3e(_0x46b506[_0x31ae('0xf')](0x1f4,_[_0x31ae('0x53')](_0x1d66a5,_0x31ae('0x17'))['join'](',\x20')));}var _0x55c499=_['find'](_0x19a976[_0x31ae('0x6a')],{'uniqueid':_0x4f5655[_0x31ae('0x59')]});if(_0x55c499&&_0x55c499['channel']){return ami['Action']({'action':_0x31ae('0x6f'),'channel':_0x55c499[_0x31ae('0x56')],'exten':_0x4f5655[_0x31ae('0x70')],'context':_0x4f5655[_0x31ae('0x71')]||_0x55c499['context'],'priority':0x1})['then'](function(_0x180f52){_0x17b9de({'code':0xc8,'message':[_0x4f5655[_0x31ae('0x59')],_0x180f52[_0x31ae('0x17')][_0x31ae('0x5e')]()]['join']('\x20')});})[_0x31ae('0x18')](function(_0x2066b5){_0x564e3e(_0x46b506[_0x31ae('0xf')](0x1f5,[_0x4f5655[_0x31ae('0x59')],_0x2066b5[_0x31ae('0x17')][_0x31ae('0x5e')]()][_0x31ae('0x12')]('\x20')));});}else{return _0x564e3e(_0x46b506['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x5c9c42){return new Promise(function(_0x4348d3,_0xbc9541){var _0x22c4f6=_['values'](_0x19a976[_0x31ae('0xd')]);_0x4348d3({'count':_0x22c4f6['length'],'rows':_0x22c4f6});});},'Telephones':function(_0x27646a){return new Promise(function(_0x1b3fc4,_0x9bcc4c){var _0x103e6a=_[_0x31ae('0x72')](_0x19a976[_0x31ae('0x73')]);_0x1b3fc4({'count':_0x103e6a['length'],'rows':_0x103e6a});});},'Trunks':function(_0x18372c){return new Promise(function(_0xe207bb,_0x3a251a){var _0x5f29f0=_['values'](_0x19a976[_0x31ae('0x74')]);_0xe207bb({'count':_0x5f29f0[_0x31ae('0x50')],'rows':_0x5f29f0});});},'OutboundChannels':function(_0x247632){return new Promise(function(_0x5a8abf,_0x2e06e4){var _0x2a6996=_['values'](_0x19a976[_0x31ae('0x75')]);_0x5a8abf({'count':_0x2a6996[_0x31ae('0x50')],'rows':_0x2a6996});});},'Outbound':function(_0x2ae517){return new Promise(function(_0x14093b,_0x50d34c){_0x14093b(_0x19a976[_0x31ae('0x76')]);});},'Campaigns':function(_0x208aca){return new Promise(function(_0x4765a5,_0x3ed67c){var _0x5c2ae3=_[_0x31ae('0x72')](_0x19a976['campaigns']);_0x4765a5({'count':_0x5c2ae3[_0x31ae('0x50')],'rows':_0x5c2ae3});});},'VoiceQueuesPreview':function(_0x25fe3b){var _0xe9fc20=this;return new Promise(function(_0x170312,_0xe5d355){_0x3b9502[_0x31ae('0x77')](_0x25fe3b['id'])['then'](function(_0x3568dc){_0x170312({'code':0xc8,'message':_0x3568dc['message']});})[_0x31ae('0x18')](function(_0x192f18){_0xe5d355(_0xe9fc20[_0x31ae('0xf')](0x1f4,_0x192f18[_0x31ae('0x17')]));});});},'EventManager':function(_0x249b01){var _0x58e698=this;return new Promise(function(_0x164afc,_0x271a6f){if(!_0x249b01[_0x31ae('0x78')]){return _0x271a6f(_0x58e698[_0x31ae('0xf')](0x1f4,_0x31ae('0x79')));}ami[_0x31ae('0x7a')](_0x31ae('0x7b')+_0x249b01['event'],_0x249b01[_0x31ae('0x17')]);_0x164afc({'code':0xc8,'message':_0x249b01});});},'FaxAccounts':function(_0x38fb9f){return new Promise(function(_0xe90630,_0x1ed244){var _0x18cc98=_['values'](_0x19a976['faxAccounts']);_0xe90630({'count':_0x18cc98[_0x31ae('0x50')],'rows':_0x18cc98});});},'SendFax':function(_0x533e94){var _0x42b65f=this;return new Promise(function(_0xf1a584,_0x16df98){_0x4e5b87['send'](_0x533e94)['then'](function(_0x3367c6){_0xf1a584({'code':0xc8,'message':_0x3367c6[_0x31ae('0x17')]});})[_0x31ae('0x18')](function(_0x24734e){_0x16df98(_0x42b65f['error'](0x1f4,_0x24734e[_0x31ae('0x17')]));});});},'CheckAfterSend':function(_0x4528ed){var _0x4e1de4=this;return new Promise(function(_0x30c1d5,_0x937532){_0x4e5b87['checkAfterSend'](_0x4528ed)[_0x31ae('0x16')](function(_0x16a857){_0x30c1d5({'code':0xc8,'message':_0x16a857[_0x31ae('0x17')]});})[_0x31ae('0x18')](function(_0x5204ba){_0x937532(_0x4e1de4[_0x31ae('0xf')](0x1f4,_0x5204ba['message']));});});}};var _0x51790a=jayson[_0x31ae('0x7c')](_0xdd8645)[_0x31ae('0x7d')]();_0x51790a['on'](_0x31ae('0xf'),function(_0x2250e){return _0x18eb56(_0x2250e);});_0x51790a['listen'](0x232a,_0x31ae('0x7e'),function(){console[_0x31ae('0x7f')](_0x31ae('0x80'),0x232a);return _0x5cc4bb('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
index b1332e2..d97ca17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x883b=['action','catch','error','[%s][%s]\x20Error\x20creating\x20contact','[%s][%s]\x20Autocreate\x20disabled','util','lodash','ioredis','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[%s][%s]','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','calleridname','<unknown>','uniqueid','firstName','destcalleridname','destcalleridnum','phone','resolve','then','showContact','format','user:%s','name','trigger:%s','toLowerCase','merge','[%s][%s]\x20Contact\x20not\x20found','xmd-contactid2'];(function(_0xfd0a86,_0x11bf5d){var _0x180539=function(_0x31dce8){while(--_0x31dce8){_0xfd0a86['push'](_0xfd0a86['shift']());}};_0x180539(++_0x11bf5d);}(_0x883b,0x15d));var _0xb883=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x883b[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require('bluebird');var util=require(_0xb883('0x0'));var _=require(_0xb883('0x1'));var Redis=require(_0xb883('0x2'));var config=require('../../../../config/environment');var logger=require(_0xb883('0x3'))('trigger');var cmContactRpc=require(_0xb883('0x4'));config[_0xb883('0x5')]=_[_0xb883('0x6')](config[_0xb883('0x5')],{'host':_0xb883('0x7'),'port':0x18eb});var io=require(_0xb883('0x8'))(new Redis(config[_0xb883('0x5')]));function emit(_0x37c207,_0x1d7f9e,_0x3495c7,_0x32674d){logger[_0xb883('0x9')](_0xb883('0xa'),_0x37c207,'',_0x1d7f9e,_0x3495c7,JSON[_0xb883('0xb')](_0x32674d));io['to'](_0x1d7f9e)[_0xb883('0xc')](_0x3495c7,_0x32674d);}exports[_0xb883('0xd')]=function(_0x5aa802,_0x3e212a,_0x520d0d){_0x520d0d[_0xb883('0xe')]=0x0;if(_0x3e212a['data2']&&parseInt(_0x3e212a[_0xb883('0xf')],0xa)){var _0x3b6c3b={'ListId':parseInt(_0x3e212a[_0xb883('0x10')],0xa),'phone':_0x520d0d[_0xb883('0x11')]};if(_[_0xb883('0x12')](_0x520d0d[_0xb883('0x13')])){_0x3b6c3b['firstName']=_0x520d0d[_0xb883('0x14')]&&_0x520d0d['calleridname']!==_0xb883('0x15')?_0x520d0d[_0xb883('0x14')]:_0x520d0d[_0xb883('0x11')]||_0x520d0d[_0xb883('0x16')];}else{_0x3b6c3b[_0xb883('0x17')]=_0x520d0d[_0xb883('0x18')]&&_0x520d0d[_0xb883('0x18')]!==_0xb883('0x15')?_0x520d0d[_0xb883('0x18')]:_0x520d0d[_0xb883('0x19')]||_0x520d0d['uniqueid'];_0x3b6c3b[_0xb883('0x1a')]=_0x520d0d[_0xb883('0x18')]&&_0x520d0d[_0xb883('0x18')]!=='<unknown>'?_0x520d0d[_0xb883('0x18')]:_0x520d0d['destcalleridnum']||_0x520d0d[_0xb883('0x16')];}BPromise[_0xb883('0x1b')]()[_0xb883('0x1c')](cmContactRpc[_0xb883('0x1d')]({'where':_['omit'](_0x3b6c3b,['firstName'])}))[_0xb883('0x1c')](function(_0x11e448){if(_0x11e448){logger[_0xb883('0x9')]('[%s][%s]\x20Contact\x20found:%s',_0x520d0d[_0xb883('0x16')],'',_0x11e448['id']);if(_0x5aa802){_0x520d0d['xmd-contactid2']=_0x11e448['id'];emit(_0x520d0d['uniqueid'],util[_0xb883('0x1e')](_0xb883('0x1f'),_0x5aa802[_0xb883('0x20')]),util[_0xb883('0x1e')](_0xb883('0x21'),_0x3e212a['action'][_0xb883('0x22')]()),_[_0xb883('0x23')](_0x520d0d,{'ListId':parseInt(_0x3e212a[_0xb883('0x10')],0xa)}));}return;}else{logger[_0xb883('0x9')](_0xb883('0x24'),_0x520d0d[_0xb883('0x16')],'');return BPromise[_0xb883('0x1b')]()[_0xb883('0x1c')](cmContactRpc['createContact'](_0x3b6c3b));}})[_0xb883('0x1c')](function(_0x12208e){if(_0x12208e){logger['info']('[%s][%s]\x20Contact\x20created:%s',_0x520d0d[_0xb883('0x16')],'',_0x12208e['id']);if(_0x5aa802){_0x520d0d[_0xb883('0x25')]=_0x12208e['id'];emit(_0x520d0d[_0xb883('0x16')],util[_0xb883('0x1e')](_0xb883('0x1f'),_0x5aa802[_0xb883('0x20')]),util[_0xb883('0x1e')](_0xb883('0x21'),_0x3e212a[_0xb883('0x26')][_0xb883('0x22')]()),_[_0xb883('0x23')](_0x520d0d,{'ListId':parseInt(_0x3e212a['data1'],0xa)}));}}})[_0xb883('0x27')](function(_0x5e61f0){logger[_0xb883('0x28')](_0xb883('0x29'),_0x520d0d[_0xb883('0x16')],'',JSON[_0xb883('0xb')](_0x5e61f0));});}else{if(_0x5aa802){logger[_0xb883('0x9')](_0xb883('0x2a'),_0x520d0d[_0xb883('0x16')],'');emit(_0x520d0d[_0xb883('0x16')],util['format'](_0xb883('0x1f'),_0x5aa802['name']),util[_0xb883('0x1e')](_0xb883('0x21'),_0x3e212a[_0xb883('0x26')][_0xb883('0x22')]()),_['merge']({'ListId':parseInt(_0x3e212a['data1'],0xa)},_0x520d0d));}}};
\ No newline at end of file
+var _0x9c30=['routeId','firstName','calleridname','uniqueid','destcalleridname','<unknown>','destcalleridnum','phone','resolve','then','showContact','omit','[%s][%s]\x20Contact\x20found:%s','xmd-contactid2','format','user:%s','name','trigger:%s','action','toLowerCase','merge','[%s][%s]\x20Contact\x20not\x20found','createContact','catch','bluebird','lodash','ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','localhost','socket.io-emitter','redis','info','[%s][%s]','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil'];(function(_0x3b0cea,_0xb40f2a){var _0x433186=function(_0x54b71f){while(--_0x54b71f){_0x3b0cea['push'](_0x3b0cea['shift']());}};_0x433186(++_0xb40f2a);}(_0x9c30,0x11a));var _0x09c3=function(_0xdaf0f,_0x8d9e81){_0xdaf0f=_0xdaf0f-0x0;var _0x5dea42=_0x9c30[_0xdaf0f];return _0x5dea42;};'use strict';var BPromise=require(_0x09c3('0x0'));var util=require('util');var _=require(_0x09c3('0x1'));var Redis=require(_0x09c3('0x2'));var config=require(_0x09c3('0x3'));var logger=require(_0x09c3('0x4'))('trigger');var cmContactRpc=require(_0x09c3('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0x09c3('0x6'),'port':0x18eb});var io=require(_0x09c3('0x7'))(new Redis(config[_0x09c3('0x8')]));function emit(_0x1b8916,_0x27358b,_0x4a39b7,_0x4aff86){logger[_0x09c3('0x9')](_0x09c3('0xa'),_0x1b8916,'',_0x27358b,_0x4a39b7,JSON[_0x09c3('0xb')](_0x4aff86));io['to'](_0x27358b)[_0x09c3('0xc')](_0x4a39b7,_0x4aff86);}exports[_0x09c3('0xd')]=function(_0x25dffd,_0x4acf0f,_0x844e70){_0x844e70[_0x09c3('0xe')]=0x0;if(_0x4acf0f[_0x09c3('0xf')]&&parseInt(_0x4acf0f['data2'],0xa)){var _0x1afb76={'ListId':parseInt(_0x4acf0f[_0x09c3('0x10')],0xa),'phone':_0x844e70[_0x09c3('0x11')]};if(_[_0x09c3('0x12')](_0x844e70[_0x09c3('0x13')])){_0x1afb76[_0x09c3('0x14')]=_0x844e70[_0x09c3('0x15')]&&_0x844e70[_0x09c3('0x15')]!=='<unknown>'?_0x844e70[_0x09c3('0x15')]:_0x844e70[_0x09c3('0x11')]||_0x844e70[_0x09c3('0x16')];}else{_0x1afb76['firstName']=_0x844e70[_0x09c3('0x17')]&&_0x844e70[_0x09c3('0x17')]!==_0x09c3('0x18')?_0x844e70[_0x09c3('0x17')]:_0x844e70[_0x09c3('0x19')]||_0x844e70[_0x09c3('0x16')];_0x1afb76[_0x09c3('0x1a')]=_0x844e70['destcalleridname']&&_0x844e70[_0x09c3('0x17')]!==_0x09c3('0x18')?_0x844e70[_0x09c3('0x17')]:_0x844e70[_0x09c3('0x19')]||_0x844e70[_0x09c3('0x16')];}BPromise[_0x09c3('0x1b')]()[_0x09c3('0x1c')](cmContactRpc[_0x09c3('0x1d')]({'where':_[_0x09c3('0x1e')](_0x1afb76,[_0x09c3('0x14')])}))[_0x09c3('0x1c')](function(_0x456b20){if(_0x456b20){logger[_0x09c3('0x9')](_0x09c3('0x1f'),_0x844e70[_0x09c3('0x16')],'',_0x456b20['id']);if(_0x25dffd){_0x844e70[_0x09c3('0x20')]=_0x456b20['id'];emit(_0x844e70[_0x09c3('0x16')],util[_0x09c3('0x21')](_0x09c3('0x22'),_0x25dffd[_0x09c3('0x23')]),util[_0x09c3('0x21')](_0x09c3('0x24'),_0x4acf0f[_0x09c3('0x25')][_0x09c3('0x26')]()),_[_0x09c3('0x27')](_0x844e70,{'ListId':parseInt(_0x4acf0f[_0x09c3('0x10')],0xa)}));}return;}else{logger[_0x09c3('0x9')](_0x09c3('0x28'),_0x844e70[_0x09c3('0x16')],'');return BPromise[_0x09c3('0x1b')]()[_0x09c3('0x1c')](cmContactRpc[_0x09c3('0x29')](_0x1afb76));}})[_0x09c3('0x1c')](function(_0x509798){if(_0x509798){logger[_0x09c3('0x9')]('[%s][%s]\x20Contact\x20created:%s',_0x844e70[_0x09c3('0x16')],'',_0x509798['id']);if(_0x25dffd){_0x844e70[_0x09c3('0x20')]=_0x509798['id'];emit(_0x844e70[_0x09c3('0x16')],util[_0x09c3('0x21')](_0x09c3('0x22'),_0x25dffd[_0x09c3('0x23')]),util[_0x09c3('0x21')](_0x09c3('0x24'),_0x4acf0f[_0x09c3('0x25')][_0x09c3('0x26')]()),_[_0x09c3('0x27')](_0x844e70,{'ListId':parseInt(_0x4acf0f[_0x09c3('0x10')],0xa)}));}}})[_0x09c3('0x2a')](function(_0xbaba46){logger['error']('[%s][%s]\x20Error\x20creating\x20contact',_0x844e70[_0x09c3('0x16')],'',JSON[_0x09c3('0xb')](_0xbaba46));});}else{if(_0x25dffd){logger[_0x09c3('0x9')]('[%s][%s]\x20Autocreate\x20disabled',_0x844e70['uniqueid'],'');emit(_0x844e70[_0x09c3('0x16')],util[_0x09c3('0x21')]('user:%s',_0x25dffd[_0x09c3('0x23')]),util[_0x09c3('0x21')](_0x09c3('0x24'),_0x4acf0f[_0x09c3('0x25')]['toLowerCase']()),_[_0x09c3('0x27')]({'ListId':parseInt(_0x4acf0f['data1'],0xa)},_0x844e70));}}};
\ No newline at end of file
index 06d416e..636485c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cff=['ioredis','./integration','./cmContact','./script','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','sugarcrmAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','info','prototype','clone','checkTriggers','interface','hasOwnProperty','status','checkTrigger','variables','Actions','length','toLowerCase','motionbar','browser','data1','popup','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','uriLocation','windowWidth','data5','800','windowHeight','600','data6','winapp','winArguments','emit','name','format','trigger:%s:%s','merge','jscripty','trigger:%s','action','user:%s','contactmanager','exec','integration','queue','script','query','replace','AllConditions','checkConditions','channel','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','membername','lastevent','routeId','exports','util','lodash','url','mustache'];(function(_0x19400e,_0x2a3a3f){var _0x444855=function(_0x461850){while(--_0x461850){_0x19400e['push'](_0x19400e['shift']());}};_0x444855(++_0x2a3a3f);}(_0x1cff,0x72));var _0xf1cf=function(_0x367dac,_0x2c94de){_0x367dac=_0x367dac-0x0;var _0x5bf905=_0x1cff[_0x367dac];return _0x5bf905;};'use strict';var util=require(_0xf1cf('0x0'));var _=require(_0xf1cf('0x1'));var url=require(_0xf1cf('0x2'));var Mustache=require(_0xf1cf('0x3'));var Redis=require(_0xf1cf('0x4'));var urlforward=require('./urlforward');var integration=require(_0xf1cf('0x5'));var cmContact=require(_0xf1cf('0x6'));var script=require(_0xf1cf('0x7'));var cmContactRpc=require('../rpc/cmContact');var config=require('../../../config/environment');var logger=require(_0xf1cf('0x8'))(_0xf1cf('0x9'));var ami=require('../ami');config[_0xf1cf('0xa')]=_[_0xf1cf('0xb')](config[_0xf1cf('0xa')],{'host':_0xf1cf('0xc'),'port':0x18eb});var io=require(_0xf1cf('0xd'))(new Redis(config[_0xf1cf('0xa')]));var operators={'equals':function(_0x2cf891,_0x517831){return _0x2cf891==_0x517831;},'not_equals':function(_0x41606f,_0x40db61){return _0x41606f!=_0x40db61;}};var barAndWebActions=['popup',_0xf1cf('0x2'),'winapp'];function Trigger(_0xb406ce){this[_0xf1cf('0xe')]=_0xb406ce[_0xf1cf('0xe')];this[_0xf1cf('0xf')]=_0xb406ce[_0xf1cf('0xf')];this[_0xf1cf('0x10')]=_0xb406ce[_0xf1cf('0x10')];this[_0xf1cf('0x11')]=_0xb406ce[_0xf1cf('0x11')];this[_0xf1cf('0x12')]=_0xb406ce[_0xf1cf('0x12')];this[_0xf1cf('0x13')]=_0xb406ce[_0xf1cf('0x13')];this[_0xf1cf('0x14')]=_0xb406ce['freshdeskAccounts'];this['salesforceAccounts']=_0xb406ce[_0xf1cf('0x15')];this['sugarcrmAccounts']=_0xb406ce['sugarcrmAccounts'];this[_0xf1cf('0x16')]=_0xb406ce[_0xf1cf('0x16')];this[_0xf1cf('0x17')]=_0xb406ce['deskAccounts'];this[_0xf1cf('0x18')]=_0xb406ce[_0xf1cf('0x18')];this[_0xf1cf('0x19')]=_0xb406ce[_0xf1cf('0x19')];this[_0xf1cf('0x1a')]=_0xb406ce[_0xf1cf('0x1a')];this[_0xf1cf('0x1b')]=_0xb406ce[_0xf1cf('0x1b')];this[_0xf1cf('0x1c')]={'zendesk':this[_0xf1cf('0x13')],'salesforce':this[_0xf1cf('0x15')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xf1cf('0x1d')],'zoho':this[_0xf1cf('0x16')],'desk':this[_0xf1cf('0x17')],'vtiger':this[_0xf1cf('0x18')],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xf1cf('0x19')]};ami['on'](_0xf1cf('0x1e'),this[_0xf1cf('0x1f')]['bind'](this));ami['on']('custom:agentconnect',this[_0xf1cf('0x1f')][_0xf1cf('0x20')](this));ami['on'](_0xf1cf('0x21'),this[_0xf1cf('0x1f')]['bind'](this));ami['on'](_0xf1cf('0x22'),this[_0xf1cf('0x1f')]['bind'](this));ami['on'](_0xf1cf('0x23'),this[_0xf1cf('0x1f')][_0xf1cf('0x20')](this));ami['on'](_0xf1cf('0x24'),this[_0xf1cf('0x1f')][_0xf1cf('0x20')](this));ami['on'](_0xf1cf('0x25'),this[_0xf1cf('0x1f')][_0xf1cf('0x20')](this));ami['on'](_0xf1cf('0x26'),this['syncCustomEvent'][_0xf1cf('0x20')](this));ami['on'](_0xf1cf('0x27'),this[_0xf1cf('0x1f')][_0xf1cf('0x20')](this));ami['on'](_0xf1cf('0x28'),this[_0xf1cf('0x1f')][_0xf1cf('0x20')](this));ami['on']('custom:timeout',this[_0xf1cf('0x1f')][_0xf1cf('0x20')](this));ami['on'](_0xf1cf('0x29'),this[_0xf1cf('0x2a')]['bind'](this));ami['on']('custom:dialconnect',this[_0xf1cf('0x2a')]['bind'](this));ami['on'](_0xf1cf('0x2b'),this[_0xf1cf('0x2a')][_0xf1cf('0x20')](this));ami['on'](_0xf1cf('0x2c'),this['syncCustomEvent'][_0xf1cf('0x20')](this));ami['on']('custom:closedinteraction',this[_0xf1cf('0x1f')][_0xf1cf('0x20')](this));ami['on'](_0xf1cf('0x2d'),this[_0xf1cf('0x1f')]['bind'](this));ami['on'](_0xf1cf('0x2e'),this[_0xf1cf('0x1f')][_0xf1cf('0x20')](this));ami['on'](_0xf1cf('0x2f'),this[_0xf1cf('0x1f')]['bind'](this));ami['on']('custom:rejectmessage',this[_0xf1cf('0x1f')][_0xf1cf('0x20')](this));}Trigger['prototype']['emit']=function(_0x24fb39,_0x49bd7f,_0x2cbe23){logger[_0xf1cf('0x30')](_0x24fb39,_0x49bd7f,JSON['stringify'](_0x2cbe23));io['to'](_0x24fb39)['emit'](_0x49bd7f,_0x2cbe23);};Trigger[_0xf1cf('0x31')]['syncCustomEvent']=function(_0x1076d1){var _0x1d72c5=_[_0xf1cf('0x32')](_0x1076d1);this[_0xf1cf('0x33')](_0x1d72c5);};Trigger[_0xf1cf('0x31')][_0xf1cf('0x2a')]=function(_0x30860a){if(this[_0xf1cf('0xf')][_0x30860a[_0xf1cf('0x34')]]){this[_0xf1cf('0x1f')](_0x30860a);}};Trigger['prototype'][_0xf1cf('0x33')]=function(_0x12c51a){var _0x35ce27;for(var _0x41bf71 in this[_0xf1cf('0xe')]){if(this[_0xf1cf('0xe')][_0xf1cf('0x35')](_0x41bf71)){if(this[_0xf1cf('0xe')][_0x41bf71][_0xf1cf('0x36')]){_0x35ce27=this[_0xf1cf('0x37')](this['triggers'][_0x41bf71],_0x12c51a);if(_0x35ce27){_['merge'](_0x12c51a,_0x12c51a[_0xf1cf('0x38')]);for(var _0x5a11e1=0x0,_0x7db4e7,_0x7bdb2a,_0x514069;_0x5a11e1<this[_0xf1cf('0xe')][_0x41bf71][_0xf1cf('0x39')][_0xf1cf('0x3a')];_0x5a11e1+=0x1){_0x7db4e7=this[_0xf1cf('0xe')][_0x41bf71]['Actions'][_0x5a11e1];if(this[_0xf1cf('0xf')][_0x12c51a[_0xf1cf('0x34')]]){switch(_0x7db4e7['action'][_0xf1cf('0x3b')]()){case'contactmanager':break;case _0xf1cf('0x3c'):case _0xf1cf('0x3d'):var _0x8fa98a={};switch(barAndWebActions[_0x7db4e7[_0xf1cf('0x3e')]]){case _0xf1cf('0x3f'):_0x8fa98a[_0xf1cf('0x40')]=_0x7db4e7[_0xf1cf('0x41')];_0x8fa98a[_0xf1cf('0x42')]=this[_0xf1cf('0x11')][_0x7db4e7[_0xf1cf('0x41')]]?Mustache[_0xf1cf('0x43')](this[_0xf1cf('0x11')][_0x7db4e7[_0xf1cf('0x41')]][_0xf1cf('0x42')],_0x12c51a):_0xf1cf('0x44');break;case _0xf1cf('0x2'):_0x8fa98a[_0xf1cf('0x45')]=this[_0xf1cf('0x46')](_0x7db4e7[_0xf1cf('0x41')],_0x12c51a,_[_0xf1cf('0x47')](_0x7db4e7[_0xf1cf('0x48')])?!![]:parseInt(_0x7db4e7[_0xf1cf('0x48')],0xa));if(_[_0xf1cf('0x47')](_0x7db4e7[_0xf1cf('0x49')])){_0x8fa98a['location']='0';}else{_0x8fa98a[_0xf1cf('0x4a')]=_0x7db4e7[_0xf1cf('0x49')];_0x8fa98a[_0xf1cf('0x4b')]=_['isNil'](_0x7db4e7[_0xf1cf('0x4c')])?_0xf1cf('0x4d'):_0x7db4e7[_0xf1cf('0x4c')];_0x8fa98a[_0xf1cf('0x4e')]=_[_0xf1cf('0x47')](_0x7db4e7['data6'])?_0xf1cf('0x4f'):_0x7db4e7[_0xf1cf('0x50')];}break;case _0xf1cf('0x51'):_0x8fa98a['winApplication']=_0x7db4e7['data2']?Mustache[_0xf1cf('0x43')](_0x7db4e7[_0xf1cf('0x41')],_0x12c51a):'';_0x8fa98a[_0xf1cf('0x52')]=_0x7db4e7[_0xf1cf('0x48')]?Mustache[_0xf1cf('0x43')](_0x7db4e7['data3'],_0x12c51a):'';break;}this[_0xf1cf('0x53')](util['format']('user:%s',this[_0xf1cf('0xf')][_0x12c51a[_0xf1cf('0x34')]][_0xf1cf('0x54')]),util[_0xf1cf('0x55')](_0xf1cf('0x56'),_0x7db4e7['action'][_0xf1cf('0x3b')](),barAndWebActions[_0x7db4e7[_0xf1cf('0x3e')]]),_[_0xf1cf('0x57')](_0x8fa98a,_0x12c51a));break;case _0xf1cf('0x58'):this[_0xf1cf('0x53')](util[_0xf1cf('0x55')]('user:%s',this[_0xf1cf('0xf')][_0x12c51a['interface']]['name']),util[_0xf1cf('0x55')](_0xf1cf('0x59'),_0x7db4e7[_0xf1cf('0x5a')]['toLowerCase']()),_[_0xf1cf('0x57')]({'ProjectId':parseInt(_0x7db4e7['data1'],0xa)},_0x12c51a));break;default:this[_0xf1cf('0x53')](util['format'](_0xf1cf('0x5b'),this[_0xf1cf('0xf')][_0x12c51a['interface']][_0xf1cf('0x54')]),util[_0xf1cf('0x55')](_0xf1cf('0x59'),_0x7db4e7['action']['toLowerCase']()),_[_0xf1cf('0x57')]({},_0x7db4e7,_0x12c51a));}}switch(_0x7db4e7['action'][_0xf1cf('0x3b')]()){case _0xf1cf('0x5c'):cmContact[_0xf1cf('0x5d')](this[_0xf1cf('0xf')][_0x12c51a[_0xf1cf('0x34')]],_0x7db4e7,_0x12c51a,cmContactRpc);break;case _0xf1cf('0x5e'):integration[_0xf1cf('0x5d')](_0x7db4e7,_0x12c51a,this[_0xf1cf('0x1c')],this[_0xf1cf('0xf')][_0x12c51a[_0xf1cf('0x34')]],this[_0xf1cf('0x10')][_0x12c51a[_0xf1cf('0x5f')]],this[_0xf1cf('0x12')][_0x12c51a['routeId']]);break;case'urlforward':urlforward[_0xf1cf('0x5d')](_0x7db4e7,_0x12c51a);break;case _0xf1cf('0x60'):script[_0xf1cf('0x5d')](_0x7db4e7,_0x12c51a);break;}}}}}}};Trigger[_0xf1cf('0x31')][_0xf1cf('0x46')]=function(_0x28cf4f,_0x45d2a2,_0x4073ff){var _0x580e4d=url['parse'](Mustache['render'](_0x28cf4f,_0x45d2a2),!![]);if(_0x4073ff){_[_0xf1cf('0x57')](_0x580e4d[_0xf1cf('0x61')],_0x45d2a2);}delete _0x580e4d['search'];var _0x416812=url[_0xf1cf('0x55')](_0x580e4d);_0x416812=_0x416812[_0xf1cf('0x62')](/\/\?/g,'?');return _0x416812;};Trigger['prototype']['checkTrigger']=function(_0x2b3718,_0x484d27){var _0x5cac89=!![],_0x991b0=!![];if(_0x2b3718[_0xf1cf('0x63')][_0xf1cf('0x3a')]){_0x5cac89=_['every'](_0x2b3718[_0xf1cf('0x63')],this[_0xf1cf('0x64')](_0x484d27,_0x2b3718[_0xf1cf('0x65')]));}if(_0x2b3718[_0xf1cf('0x66')][_0xf1cf('0x3a')]){_0x991b0=_[_0xf1cf('0x67')](_0x2b3718['AnyConditions'],this['checkConditions'](_0x484d27,_0x2b3718[_0xf1cf('0x65')]));}return _0x5cac89&&_0x991b0;};Trigger[_0xf1cf('0x31')][_0xf1cf('0x64')]=function(_0x134812,_0x55cad3){return function(_0x4a00f9){switch(_0x4a00f9[_0xf1cf('0x68')]){case _0xf1cf('0x69'):if(_0x134812[_0xf1cf('0x65')]===_0x55cad3){if(_0x55cad3===_0xf1cf('0x6a')){return _0x134812[_0xf1cf('0x6b')]?operators[_0x4a00f9[_0xf1cf('0x6c')]](Number(_0x4a00f9[_0xf1cf('0x6d')]),_0x134812['ChatWebsiteId']):![];}else{return _0x134812[_[_0xf1cf('0x6e')](_0x55cad3)+_0xf1cf('0x6f')]?operators[_0x4a00f9['operator']](Number(_0x4a00f9[_0xf1cf('0x6d')]),_0x134812[_[_0xf1cf('0x6e')](_0x55cad3)+'AccountId']):![];}}break;case _0xf1cf('0x70'):case _0xf1cf('0x71'):if(_0x134812[_0xf1cf('0x65')]===_0x55cad3){return _0x134812['event']?operators[_0x4a00f9[_0xf1cf('0x6c')]](_0x4a00f9[_0xf1cf('0x6d')],_0x134812['event']):![];}break;case _0xf1cf('0x5f'):return _0x134812[_0xf1cf('0x5f')]?operators[_0x4a00f9[_0xf1cf('0x6c')]](_0x4a00f9['value'],_0x134812[_0xf1cf('0x5f')]):![];case'agent':return _0x134812[_0xf1cf('0x72')]?operators[_0x4a00f9[_0xf1cf('0x6c')]](_0x4a00f9['value'],_0x134812['membername']):![];case _0xf1cf('0x73'):return _0x134812[_0xf1cf('0x73')]?operators[_0x4a00f9[_0xf1cf('0x6c')]](_0x4a00f9[_0xf1cf('0x6d')],_0x134812[_0xf1cf('0x73')]):![];case _0xf1cf('0x74'):return _0x134812[_0xf1cf('0x74')]?operators[_0x4a00f9[_0xf1cf('0x6c')]](_0x4a00f9[_0xf1cf('0x6d')],_0x134812[_0xf1cf('0x74')]):![];}return![];};};module[_0xf1cf('0x75')]=Trigger;
\ No newline at end of file
+var _0x79d2=['location','uriLocation','data4','windowWidth','data5','800','windowHeight','data6','winapp','winArguments','render','format','user:%s','name','trigger:%s:%s','merge','trigger:%s','exec','integration','queue','routeId','urlforward','script','buildUri','parse','query','search','replace','AllConditions','every','AnyConditions','checkConditions','channel','field','account','ChatWebsiteId','operator','value','AccountId','upperFirst','event','membername','lastevent','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','redis','defaults','localhost','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','accounts','servicenowAccounts','syncCustomEvent','custom:agentconnect','custom:agentringnoanswer','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','clone','interface','hasOwnProperty','status','checkTrigger','variables','length','Actions','action','toLowerCase','contactmanager','data1','html','data2','template\x20not\x20found','uri','isNil','data3'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79d2,0x118));var _0x279d=function(_0x92713a,_0x68f8b0){_0x92713a=_0x92713a-0x0;var _0x1893e1=_0x79d2[_0x92713a];return _0x1893e1;};'use strict';var util=require(_0x279d('0x0'));var _=require(_0x279d('0x1'));var url=require(_0x279d('0x2'));var Mustache=require(_0x279d('0x3'));var Redis=require(_0x279d('0x4'));var urlforward=require(_0x279d('0x5'));var integration=require(_0x279d('0x6'));var cmContact=require(_0x279d('0x7'));var script=require(_0x279d('0x8'));var cmContactRpc=require('../rpc/cmContact');var config=require(_0x279d('0x9'));var logger=require(_0x279d('0xa'))(_0x279d('0xb'));var ami=require('../ami');config[_0x279d('0xc')]=_[_0x279d('0xd')](config[_0x279d('0xc')],{'host':_0x279d('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var operators={'equals':function(_0x27e831,_0x163d2e){return _0x27e831==_0x163d2e;},'not_equals':function(_0x48f922,_0x1a6538){return _0x48f922!=_0x1a6538;}};var barAndWebActions=[_0x279d('0xf'),_0x279d('0x2'),'winapp'];function Trigger(_0x250bf7){this[_0x279d('0x10')]=_0x250bf7[_0x279d('0x10')];this[_0x279d('0x11')]=_0x250bf7[_0x279d('0x11')];this[_0x279d('0x12')]=_0x250bf7[_0x279d('0x12')];this[_0x279d('0x13')]=_0x250bf7[_0x279d('0x13')];this[_0x279d('0x14')]=_0x250bf7[_0x279d('0x14')];this[_0x279d('0x15')]=_0x250bf7[_0x279d('0x15')];this[_0x279d('0x16')]=_0x250bf7[_0x279d('0x16')];this['salesforceAccounts']=_0x250bf7[_0x279d('0x17')];this[_0x279d('0x18')]=_0x250bf7['sugarcrmAccounts'];this['zohoAccounts']=_0x250bf7[_0x279d('0x19')];this['deskAccounts']=_0x250bf7[_0x279d('0x1a')];this['vtigerAccounts']=_0x250bf7[_0x279d('0x1b')];this['servicenowAccounts']=_0x250bf7['servicenowAccounts'];this['dynamics365Accounts']=_0x250bf7[_0x279d('0x1c')];this['freshsalesAccounts']=_0x250bf7[_0x279d('0x1d')];this[_0x279d('0x1e')]={'zendesk':this[_0x279d('0x15')],'salesforce':this[_0x279d('0x17')],'freshdesk':this[_0x279d('0x16')],'sugarcrm':this[_0x279d('0x18')],'zoho':this['zohoAccounts'],'desk':this[_0x279d('0x1a')],'vtiger':this[_0x279d('0x1b')],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x279d('0x1f')]};ami['on']('custom:agentcalled',this[_0x279d('0x20')]['bind'](this));ami['on'](_0x279d('0x21'),this[_0x279d('0x20')]['bind'](this));ami['on'](_0x279d('0x22'),this['syncCustomEvent'][_0x279d('0x23')](this));ami['on'](_0x279d('0x24'),this[_0x279d('0x20')][_0x279d('0x23')](this));ami['on'](_0x279d('0x25'),this[_0x279d('0x20')][_0x279d('0x23')](this));ami['on'](_0x279d('0x26'),this['syncCustomEvent'][_0x279d('0x23')](this));ami['on'](_0x279d('0x27'),this['syncCustomEvent'][_0x279d('0x23')](this));ami['on'](_0x279d('0x28'),this['syncCustomEvent'][_0x279d('0x23')](this));ami['on'](_0x279d('0x29'),this['syncCustomEvent'][_0x279d('0x23')](this));ami['on'](_0x279d('0x2a'),this[_0x279d('0x20')]['bind'](this));ami['on'](_0x279d('0x2b'),this[_0x279d('0x20')]['bind'](this));ami['on'](_0x279d('0x2c'),this[_0x279d('0x2d')][_0x279d('0x23')](this));ami['on'](_0x279d('0x2e'),this[_0x279d('0x2d')][_0x279d('0x23')](this));ami['on'](_0x279d('0x2f'),this['syncAgentDial'][_0x279d('0x23')](this));ami['on']('custom:newinteraction',this[_0x279d('0x20')][_0x279d('0x23')](this));ami['on'](_0x279d('0x30'),this['syncCustomEvent'][_0x279d('0x23')](this));ami['on'](_0x279d('0x31'),this[_0x279d('0x20')][_0x279d('0x23')](this));ami['on'](_0x279d('0x32'),this['syncCustomEvent']['bind'](this));ami['on'](_0x279d('0x33'),this['syncCustomEvent'][_0x279d('0x23')](this));ami['on'](_0x279d('0x34'),this[_0x279d('0x20')][_0x279d('0x23')](this));}Trigger[_0x279d('0x35')][_0x279d('0x36')]=function(_0x2ee1ee,_0x264728,_0x402038){logger[_0x279d('0x37')](_0x2ee1ee,_0x264728,JSON['stringify'](_0x402038));io['to'](_0x2ee1ee)['emit'](_0x264728,_0x402038);};Trigger[_0x279d('0x35')]['syncCustomEvent']=function(_0x4d9f81){var _0x5ba72f=_[_0x279d('0x38')](_0x4d9f81);this['checkTriggers'](_0x5ba72f);};Trigger[_0x279d('0x35')][_0x279d('0x2d')]=function(_0x46d279){if(this[_0x279d('0x11')][_0x46d279[_0x279d('0x39')]]){this[_0x279d('0x20')](_0x46d279);}};Trigger[_0x279d('0x35')]['checkTriggers']=function(_0x1d3017){var _0x3fe49c;for(var _0x44652b in this[_0x279d('0x10')]){if(this[_0x279d('0x10')][_0x279d('0x3a')](_0x44652b)){if(this['triggers'][_0x44652b][_0x279d('0x3b')]){_0x3fe49c=this[_0x279d('0x3c')](this['triggers'][_0x44652b],_0x1d3017);if(_0x3fe49c){_['merge'](_0x1d3017,_0x1d3017[_0x279d('0x3d')]);for(var _0x4ee651=0x0,_0xac2cbf,_0x4e8422,_0x18b7d2;_0x4ee651<this[_0x279d('0x10')][_0x44652b]['Actions'][_0x279d('0x3e')];_0x4ee651+=0x1){_0xac2cbf=this['triggers'][_0x44652b][_0x279d('0x3f')][_0x4ee651];if(this['agents'][_0x1d3017[_0x279d('0x39')]]){switch(_0xac2cbf[_0x279d('0x40')][_0x279d('0x41')]()){case _0x279d('0x42'):break;case'motionbar':case'browser':var _0x3095e5={};switch(barAndWebActions[_0xac2cbf[_0x279d('0x43')]]){case _0x279d('0xf'):_0x3095e5['TemplateId']=_0xac2cbf['data2'];_0x3095e5[_0x279d('0x44')]=this[_0x279d('0x13')][_0xac2cbf[_0x279d('0x45')]]?Mustache['render'](this[_0x279d('0x13')][_0xac2cbf[_0x279d('0x45')]]['html'],_0x1d3017):_0x279d('0x46');break;case _0x279d('0x2'):_0x3095e5[_0x279d('0x47')]=this['buildUri'](_0xac2cbf['data2'],_0x1d3017,_[_0x279d('0x48')](_0xac2cbf[_0x279d('0x49')])?!![]:parseInt(_0xac2cbf['data3'],0xa));if(_[_0x279d('0x48')](_0xac2cbf['data4'])){_0x3095e5[_0x279d('0x4a')]='0';}else{_0x3095e5[_0x279d('0x4b')]=_0xac2cbf[_0x279d('0x4c')];_0x3095e5[_0x279d('0x4d')]=_[_0x279d('0x48')](_0xac2cbf[_0x279d('0x4e')])?_0x279d('0x4f'):_0xac2cbf[_0x279d('0x4e')];_0x3095e5[_0x279d('0x50')]=_['isNil'](_0xac2cbf[_0x279d('0x51')])?'600':_0xac2cbf['data6'];}break;case _0x279d('0x52'):_0x3095e5['winApplication']=_0xac2cbf[_0x279d('0x45')]?Mustache['render'](_0xac2cbf['data2'],_0x1d3017):'';_0x3095e5[_0x279d('0x53')]=_0xac2cbf[_0x279d('0x49')]?Mustache[_0x279d('0x54')](_0xac2cbf['data3'],_0x1d3017):'';break;}this[_0x279d('0x36')](util[_0x279d('0x55')](_0x279d('0x56'),this['agents'][_0x1d3017['interface']][_0x279d('0x57')]),util[_0x279d('0x55')](_0x279d('0x58'),_0xac2cbf['action'][_0x279d('0x41')](),barAndWebActions[_0xac2cbf[_0x279d('0x43')]]),_[_0x279d('0x59')](_0x3095e5,_0x1d3017));break;case'jscripty':this['emit'](util['format']('user:%s',this[_0x279d('0x11')][_0x1d3017['interface']][_0x279d('0x57')]),util[_0x279d('0x55')](_0x279d('0x5a'),_0xac2cbf[_0x279d('0x40')][_0x279d('0x41')]()),_[_0x279d('0x59')]({'ProjectId':parseInt(_0xac2cbf[_0x279d('0x43')],0xa)},_0x1d3017));break;default:this[_0x279d('0x36')](util[_0x279d('0x55')](_0x279d('0x56'),this[_0x279d('0x11')][_0x1d3017[_0x279d('0x39')]][_0x279d('0x57')]),util[_0x279d('0x55')](_0x279d('0x5a'),_0xac2cbf[_0x279d('0x40')]['toLowerCase']()),_[_0x279d('0x59')]({},_0xac2cbf,_0x1d3017));}}switch(_0xac2cbf[_0x279d('0x40')][_0x279d('0x41')]()){case _0x279d('0x42'):cmContact[_0x279d('0x5b')](this[_0x279d('0x11')][_0x1d3017[_0x279d('0x39')]],_0xac2cbf,_0x1d3017,cmContactRpc);break;case _0x279d('0x5c'):integration[_0x279d('0x5b')](_0xac2cbf,_0x1d3017,this[_0x279d('0x1e')],this[_0x279d('0x11')][_0x1d3017[_0x279d('0x39')]],this['voiceQueues'][_0x1d3017[_0x279d('0x5d')]],this['voiceExtensions'][_0x1d3017[_0x279d('0x5e')]]);break;case _0x279d('0x5f'):urlforward['exec'](_0xac2cbf,_0x1d3017);break;case _0x279d('0x60'):script['exec'](_0xac2cbf,_0x1d3017);break;}}}}}}};Trigger[_0x279d('0x35')][_0x279d('0x61')]=function(_0x5e3b02,_0x3736b3,_0x367fc8){var _0xc29ef8=url[_0x279d('0x62')](Mustache[_0x279d('0x54')](_0x5e3b02,_0x3736b3),!![]);if(_0x367fc8){_[_0x279d('0x59')](_0xc29ef8[_0x279d('0x63')],_0x3736b3);}delete _0xc29ef8[_0x279d('0x64')];var _0x3f5618=url[_0x279d('0x55')](_0xc29ef8);_0x3f5618=_0x3f5618[_0x279d('0x65')](/\/\?/g,'?');return _0x3f5618;};Trigger[_0x279d('0x35')][_0x279d('0x3c')]=function(_0x33d1ad,_0x293b79){var _0x1520d3=!![],_0x317b93=!![];if(_0x33d1ad[_0x279d('0x66')][_0x279d('0x3e')]){_0x1520d3=_[_0x279d('0x67')](_0x33d1ad['AllConditions'],this['checkConditions'](_0x293b79,_0x33d1ad['channel']));}if(_0x33d1ad[_0x279d('0x68')][_0x279d('0x3e')]){_0x317b93=_['some'](_0x33d1ad[_0x279d('0x68')],this[_0x279d('0x69')](_0x293b79,_0x33d1ad[_0x279d('0x6a')]));}return _0x1520d3&&_0x317b93;};Trigger['prototype'][_0x279d('0x69')]=function(_0x4e8773,_0x33af6a){return function(_0x235b9d){switch(_0x235b9d[_0x279d('0x6b')]){case _0x279d('0x6c'):if(_0x4e8773['channel']===_0x33af6a){if(_0x33af6a==='chat'){return _0x4e8773[_0x279d('0x6d')]?operators[_0x235b9d[_0x279d('0x6e')]](Number(_0x235b9d[_0x279d('0x6f')]),_0x4e8773[_0x279d('0x6d')]):![];}else{return _0x4e8773[_['upperFirst'](_0x33af6a)+_0x279d('0x70')]?operators[_0x235b9d[_0x279d('0x6e')]](Number(_0x235b9d['value']),_0x4e8773[_[_0x279d('0x71')](_0x33af6a)+_0x279d('0x70')]):![];}}break;case'interaction':case'message':if(_0x4e8773[_0x279d('0x6a')]===_0x33af6a){return _0x4e8773[_0x279d('0x72')]?operators[_0x235b9d['operator']](_0x235b9d['value'],_0x4e8773['event']):![];}break;case'queue':return _0x4e8773['queue']?operators[_0x235b9d[_0x279d('0x6e')]](_0x235b9d['value'],_0x4e8773[_0x279d('0x5d')]):![];case'agent':return _0x4e8773[_0x279d('0x73')]?operators[_0x235b9d[_0x279d('0x6e')]](_0x235b9d[_0x279d('0x6f')],_0x4e8773[_0x279d('0x73')]):![];case _0x279d('0x74'):return _0x4e8773[_0x279d('0x74')]?operators[_0x235b9d['operator']](_0x235b9d[_0x279d('0x6f')],_0x4e8773[_0x279d('0x74')]):![];case _0x279d('0x5e'):return _0x4e8773['routeId']?operators[_0x235b9d['operator']](_0x235b9d[_0x279d('0x6f')],_0x4e8773['routeId']):![];}return![];};};module[_0x279d('0x75')]=Trigger;
\ No newline at end of file
index b8ed92c..040199d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Getting\x20agent\x20with\x20email','format','total_entries','find','_embedded','entries','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','%s/customers/search','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','work','length','map','forEach','type','string','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','phone','Motion','CTI','Tags','Descriptions','user','Fields','%s/customers/%d/cases','POST','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','catch','monitor_format','lastevent','lodash','request-promise','md5','./util','../../../../config/logger','desk','redis','defaults','socket.io-emitter','emit','validateEmail','info'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var md5=require(_0x0a9e('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x0a9e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));config[_0x0a9e('0x6')]=_[_0x0a9e('0x7')](config[_0x0a9e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0x8'))(new Redis(config[_0x0a9e('0x6')]));function emit(_0x2cc193,_0x5f41ea,_0x503809){io['to'](_0x2cc193)[_0x0a9e('0x9')](_0x5f41ea,_0x503809);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x39753a,_0xf81284){if(intUtil[_0x0a9e('0xa')](_0xf81284)===!![]){logger[_0x0a9e('0xb')](_0x0a9e('0xc'),_0xf81284);return request({'uri':util[_0x0a9e('0xd')]('%s/users',_0x39753a['remoteUri'])})['then'](function(_0x4cfe67){if(_0x4cfe67[_0x0a9e('0xe')]){return _[_0x0a9e('0xf')](_0x4cfe67[_0x0a9e('0x10')][_0x0a9e('0x11')],{'email':_0xf81284});}})[_0x0a9e('0x12')](function(_0x69aeb7){if(_0x69aeb7){logger['info'](_0x0a9e('0x13'));return _0x69aeb7;}else{logger[_0x0a9e('0xb')](_0x0a9e('0x14'));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x15'),_0x39753a[_0x0a9e('0x16')])});}});}else{logger['info'](_0x0a9e('0x17'));return request({'uri':util['format'](_0x0a9e('0x15'),_0x39753a['remoteUri'])});}}function request(_0x16033c){logger[_0x0a9e('0x18')]('[HTTP]',JSON[_0x0a9e('0x19')](_0x16033c));return rp(_['defaults'](_0x16033c,{'method':_0x0a9e('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x478723){var _0x106033;if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x1c')){_0x106033=util[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x1f')]);}else if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x20')){_0x106033=util[_0x0a9e('0xd')]('%s/token:%s',_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x20')]);}return util['format'](_0x0a9e('0x21'),new Buffer(_0x106033)['toString']('base64'));}function getEndUser(_0x3a02e1,_0x432e56,_0x38e7c4){logger[_0x0a9e('0xb')]('Searching\x20enduser\x20with\x20phone',_0x38e7c4);return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x22'),_0x3a02e1[_0x0a9e('0x16')]),'qs':{'phone':_0x38e7c4}})[_0x0a9e('0x12')](function(_0x370d86){if(_0x370d86[_0x0a9e('0xe')]){logger[_0x0a9e('0xb')]('Enduser\x20found!');return _0x370d86['_embedded'][_0x0a9e('0x11')][0x0];}else{logger[_0x0a9e('0xb')](_0x0a9e('0x23'));return request({'uri':util[_0x0a9e('0xd')]('%s/customers',_0x3a02e1[_0x0a9e('0x16')]),'method':'POST','body':{'first_name':_0x432e56,'title':_0x432e56,'phone_numbers':[{'type':_0x0a9e('0x24'),'value':_0x38e7c4}]}});}});}function getTags(_0x5bfb33,_0x1dc186){var _0x34dc65=[];if(_0x5bfb33&&_0x5bfb33[_0x0a9e('0x25')]>0x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});};
\ No newline at end of file
+var _0xa9e0=['Getting\x20agent\x20with\x20email','format','total_entries','find','_embedded','entries','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','%s/customers/search','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','work','length','map','forEach','type','string','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','phone','Motion','CTI','Tags','Descriptions','user','Fields','%s/customers/%d/cases','POST','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','catch','monitor_format','lastevent','lodash','request-promise','md5','./util','../../../../config/logger','desk','redis','defaults','socket.io-emitter','emit','validateEmail','info'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var md5=require(_0x0a9e('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x0a9e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));config[_0x0a9e('0x6')]=_[_0x0a9e('0x7')](config[_0x0a9e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0x8'))(new Redis(config[_0x0a9e('0x6')]));function emit(_0x2cc193,_0x5f41ea,_0x503809){io['to'](_0x2cc193)[_0x0a9e('0x9')](_0x5f41ea,_0x503809);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x39753a,_0xf81284){if(intUtil[_0x0a9e('0xa')](_0xf81284)===!![]){logger[_0x0a9e('0xb')](_0x0a9e('0xc'),_0xf81284);return request({'uri':util[_0x0a9e('0xd')]('%s/users',_0x39753a['remoteUri'])})['then'](function(_0x4cfe67){if(_0x4cfe67[_0x0a9e('0xe')]){return _[_0x0a9e('0xf')](_0x4cfe67[_0x0a9e('0x10')][_0x0a9e('0x11')],{'email':_0xf81284});}})[_0x0a9e('0x12')](function(_0x69aeb7){if(_0x69aeb7){logger['info'](_0x0a9e('0x13'));return _0x69aeb7;}else{logger[_0x0a9e('0xb')](_0x0a9e('0x14'));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x15'),_0x39753a[_0x0a9e('0x16')])});}});}else{logger['info'](_0x0a9e('0x17'));return request({'uri':util['format'](_0x0a9e('0x15'),_0x39753a['remoteUri'])});}}function request(_0x16033c){logger[_0x0a9e('0x18')]('[HTTP]',JSON[_0x0a9e('0x19')](_0x16033c));return rp(_['defaults'](_0x16033c,{'method':_0x0a9e('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x478723){var _0x106033;if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x1c')){_0x106033=util[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x1f')]);}else if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x20')){_0x106033=util[_0x0a9e('0xd')]('%s/token:%s',_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x20')]);}return util['format'](_0x0a9e('0x21'),new Buffer(_0x106033)['toString']('base64'));}function getEndUser(_0x3a02e1,_0x432e56,_0x38e7c4){logger[_0x0a9e('0xb')]('Searching\x20enduser\x20with\x20phone',_0x38e7c4);return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x22'),_0x3a02e1[_0x0a9e('0x16')]),'qs':{'phone':_0x38e7c4}})[_0x0a9e('0x12')](function(_0x370d86){if(_0x370d86[_0x0a9e('0xe')]){logger[_0x0a9e('0xb')]('Enduser\x20found!');return _0x370d86['_embedded'][_0x0a9e('0x11')][0x0];}else{logger[_0x0a9e('0xb')](_0x0a9e('0x23'));return request({'uri':util[_0x0a9e('0xd')]('%s/customers',_0x3a02e1[_0x0a9e('0x16')]),'method':'POST','body':{'first_name':_0x432e56,'title':_0x432e56,'phone_numbers':[{'type':_0x0a9e('0x24'),'value':_0x38e7c4}]}});}});}function getTags(_0x5bfb33,_0x1dc186){var _0x34dc65=[];if(_0x5bfb33&&_0x5bfb33[_0x0a9e('0x25')]>0x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});};
\ No newline at end of file
index f267b12..d50f3c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e01=['systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','userId','catch','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','type','string','customField','idField','indexOf','content','ticketType','incidents','assign','getString','Subjects','/contacts(','phonecall','phonecalls','Descriptions','callDirection','queue','Fields','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','remoteUri','serverUrl','stripTrailingSlash','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','inspect','lodash','bluebird','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','then','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','info','toUpperCase',']\x20Agent\x20found\x20'];(function(_0x855b1c,_0x131bc8){var _0x5b4c9e=function(_0x44a9a8){while(--_0x44a9a8){_0x855b1c['push'](_0x855b1c['shift']());}};_0x5b4c9e(++_0x131bc8);}(_0x1e01,0x169));var _0x11e0=function(_0x3c26f7,_0x24eeca){_0x3c26f7=_0x3c26f7-0x0;var _0x2acf85=_0x1e01[_0x3c26f7];return _0x2acf85;};'use strict';var _=require(_0x11e0('0x0'));var BPromise=require(_0x11e0('0x1'));var rp=require('request-promise');var util=require(_0x11e0('0x2'));var intUtil=require(_0x11e0('0x3'));var md5=require(_0x11e0('0x4'));var Redis=require(_0x11e0('0x5'));var logger=require(_0x11e0('0x6'))(_0x11e0('0x7'));var config=require(_0x11e0('0x8'));config[_0x11e0('0x9')]=_[_0x11e0('0xa')](config['redis'],{'host':_0x11e0('0xb'),'port':0x18eb});var io=require(_0x11e0('0xc'))(new Redis(config[_0x11e0('0x9')]));function getAuthToken(_0x9072f7,_0x19abac,_0x1218fc){var _0x2f0475={'method':_0x11e0('0xd'),'uri':_0x19abac,'form':{'client_id':_0x9072f7[_0x11e0('0xe')],'resource':_0x9072f7['remoteUri'],'username':_0x9072f7[_0x11e0('0xf')],'password':_0x9072f7['password'],'grant_type':_0x11e0('0x10'),'client_secret':_0x9072f7[_0x11e0('0x11')]},'json':!![]};return rp(_0x2f0475)[_0x11e0('0x12')](function(_0x26d75d){return _0x26d75d['access_token'];})['catch'](function(_0x35435d){logger[_0x11e0('0x13')]('['+[_0x1218fc['toUpperCase']()]+_0x11e0('0x14'));return _0x35435d[_0x11e0('0x15')];});}function getUser(_0x563f3e,_0x5f10d7,_0x302939,_0x19e02f,_0x10d4cf,_0x41c2f0){return new BPromise(function(_0x19a22b,_0x1be035){return getAuthToken(_0x5f10d7,_0x19e02f,_0x41c2f0)[_0x11e0('0x12')](function(_0x371b29){var _0x921604={'method':_0x11e0('0x16'),'uri':_0x10d4cf+_0x11e0('0x17'),'headers':{'Authorization':_0x11e0('0x18')+_0x371b29,'OData-Version':_0x11e0('0x19')},'json':!![]};return rp(_0x921604);})[_0x11e0('0x12')](function(_0x5633d1){var _0x286d4e=_0x5633d1[_0x11e0('0x1a')];var _0x143368=![];var _0x2863fe=null;if(!_[_0x11e0('0x1b')](_0x302939)){if(intUtil[_0x11e0('0x1c')](_0x302939[_0x11e0('0x1d')])){_0x563f3e[_0x11e0('0x1e')]=_0x302939[_0x11e0('0x1d')];for(_0x2863fe=0x0;_0x2863fe<_0x286d4e[_0x11e0('0x1f')];_0x2863fe++){if(_0x286d4e[_0x2863fe]['internalemailaddress']===_0x302939[_0x11e0('0x1d')]&&!_0x286d4e[_0x2863fe]['isdisabled']){_0x143368=!![];logger[_0x11e0('0x20')]('['+[_0x41c2f0[_0x11e0('0x21')]()]+_0x11e0('0x22')+_0x286d4e[_0x2863fe][_0x11e0('0x23')]+'!');_0x563f3e['userId']=_0x286d4e[_0x2863fe][_0x11e0('0x23')];}}}}if(!_0x143368){logger['info']('['+[_0x41c2f0[_0x11e0('0x21')]()]+_0x11e0('0x24'));_0x563f3e[_0x11e0('0x1e')]=_0x5f10d7[_0x11e0('0xf')];for(_0x2863fe=0x0;_0x2863fe<_0x286d4e[_0x11e0('0x1f')];_0x2863fe++){if(_0x286d4e[_0x2863fe][_0x11e0('0x25')]===_0x5f10d7[_0x11e0('0xf')]){_0x563f3e[_0x11e0('0x26')]=_0x286d4e[_0x2863fe]['systemuserid'];}}}_0x19a22b(_0x563f3e);})[_0x11e0('0x27')](function(_0x5e5099){_0x1be035(_0x5e5099['message']);});});}function createEndUser(_0x5b7ea6,_0x56d6a1,_0x131647,_0x4de6f4,_0xe6f457,_0x3b3c67){return new BPromise(function(_0x3ca31b,_0x2b3358){return getAuthToken(_0x56d6a1,_0x131647,_0x3b3c67)[_0x11e0('0x12')](function(_0x2bc2bf){var _0x4f639f=_0x3b3c67[_0x11e0('0x28')]()===_0x11e0('0x29')?_0xe6f457[_0x11e0('0x2a')]:_0xe6f457[_0x11e0('0x2b')];var _0x3f77bd={'method':_0x11e0('0xd'),'uri':_0x4de6f4+_0x11e0('0x2c'),'body':{'telephone1':_0x4f639f,'fullname':_0x4f639f,'firstname':_0x4f639f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x11e0('0x2d')+_0x5b7ea6[_0x11e0('0x26')]+')'},'headers':{'Authorization':_0x11e0('0x18')+_0x2bc2bf,'OData-Version':_0x11e0('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3f77bd);})['then'](function(_0xb3dbef){var _0x3ea733=_0xb3dbef[_0x11e0('0x2e')][_0x11e0('0x2f')];var _0x37be95=_0x3ea733[_0x11e0('0x30')](_0x3ea733[_0x11e0('0x31')]('(')+0x1,_0x3ea733[_0x11e0('0x31')](')'));_0x5b7ea6[_0x11e0('0x32')]=_0x37be95;_0x3ca31b(_0x5b7ea6);})[_0x11e0('0x27')](function(_0x3c77c3){_0x2b3358(_0x3c77c3[_0x11e0('0x15')]);});});}function getEndUser(_0x180754,_0x1be745,_0x331534,_0x3e8580,_0x832917,_0x427e41){return new BPromise(function(_0x2d5e16,_0x5ad881){return getAuthToken(_0x1be745,_0x331534,_0x427e41)[_0x11e0('0x12')](function(_0xa56621){var _0x55cf4e={'method':_0x11e0('0x16'),'uri':_0x3e8580+_0x11e0('0x33'),'headers':{'Authorization':_0x11e0('0x18')+_0xa56621,'If-None-Match':null,'OData-Version':_0x11e0('0x19')},'json':!![]};return rp(_0x55cf4e);})[_0x11e0('0x12')](function(_0x425b6b){var _0x4772ab=null;if(_0x425b6b){var _0x478acf=_0x425b6b['value'];var _0x3a90f9=![];for(_0x4772ab=0x0;_0x4772ab<_0x478acf[_0x11e0('0x1f')];_0x4772ab++){var _0xf25c6b=_0x427e41[_0x11e0('0x28')]()===_0x11e0('0x29')?_0x832917[_0x11e0('0x2a')]:_0x832917[_0x11e0('0x2b')];if(_0x478acf[_0x4772ab][_0x11e0('0x34')]===_0xf25c6b){_0x3a90f9=!![];_0x180754[_0x11e0('0x32')]=_0x478acf[_0x4772ab]['contactid'];}}if(_0x3a90f9){_0x2d5e16(_0x180754);}else{return createEndUser(_0x180754,_0x1be745,_0x331534,_0x3e8580,_0x832917,_0x427e41)[_0x11e0('0x12')](function(_0x20cb20){logger['info']('['+[_0x427e41['toUpperCase']()]+_0x11e0('0x35'),_0x20cb20[_0x11e0('0x32')]);_0x2d5e16(_0x20cb20);});}}else{return createEndUser(_0x180754,_0x1be745,_0x331534,_0x3e8580,_0x832917,_0x427e41)[_0x11e0('0x12')](function(_0x3099c8){logger[_0x11e0('0x20')]('['+[_0x427e41['toUpperCase']()]+_0x11e0('0x36'),_0x3099c8[_0x11e0('0x32')]);_0x2d5e16(_0x3099c8);});}});});}function getCustomFields(_0x2eaf60,_0x3afb67,_0x1c66b3){var _0x2bff92={};if(_0x2eaf60['length']>0x0){_['forEach'](_0x2eaf60,function(_0x14e3bc){if(_0x14e3bc[_0x11e0('0x37')]===_0x11e0('0x38')&&_0x14e3bc['nameField']&&!_0x14e3bc[_0x11e0('0x39')]){var _0x4e2caf=_0x14e3bc[_0x11e0('0x3a')][_0x11e0('0x28')]();var _0x382337=_0x4e2caf[_0x11e0('0x30')](0x0,_0x4e2caf[_0x11e0('0x3b')]('_'));var _0x534225=_0x4e2caf[_0x11e0('0x30')](_0x4e2caf[_0x11e0('0x3b')]('_')+0x1);if(_0x382337===_0x1c66b3){_0x2bff92[_0x534225]=_0x14e3bc[_0x11e0('0x3c')];}}});}return _0x2bff92;}function getTicket(_0x201944,_0x1b663a,_0x50cba,_0x46f6ef,_0x3e6ff1,_0x27f6b9,_0x3682ed){return new BPromise(function(_0x598387,_0x2410a0){var _0x340a45;return getAuthToken(_0x1b663a,_0x50cba,_0x3682ed)['then'](function(_0x1d625f){if(_0x27f6b9[_0x11e0('0x3d')]==='incident'){_0x340a45={'method':'POST','uri':_0x46f6ef+_0x11e0('0x3e'),'body':Object[_0x11e0('0x3f')]({},{'title':intUtil[_0x11e0('0x40')](_0x27f6b9[_0x11e0('0x41')],_0x3e6ff1,'\x20'),'description':intUtil[_0x11e0('0x40')](_0x27f6b9['Descriptions'],_0x3e6ff1,'\x0a'),'customerid_contact@odata.bind':_0x11e0('0x42')+_0x201944[_0x11e0('0x32')]+')','ownerid@odata.bind':_0x11e0('0x2d')+_0x201944['userId']+')','caseorigincode':'1'},getCustomFields(_0x27f6b9['Fields'],_0x3e6ff1,_0x27f6b9[_0x11e0('0x3d')])),'headers':{'Authorization':_0x11e0('0x18')+_0x1d625f,'OData-Version':_0x11e0('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x27f6b9['ticketType']===_0x11e0('0x43')){_0x340a45={'method':_0x11e0('0xd'),'uri':_0x46f6ef+_0x11e0('0x44'),'body':Object[_0x11e0('0x3f')]({},{'subject':intUtil[_0x11e0('0x40')](_0x27f6b9[_0x11e0('0x41')],_0x3e6ff1,'\x20'),'phonenumber':String(_0x3e6ff1[_0x11e0('0x2b')]),'description':intUtil[_0x11e0('0x40')](_0x27f6b9[_0x11e0('0x45')],_0x3e6ff1,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x201944[_0x11e0('0x32')]+')','ownerid@odata.bind':_0x11e0('0x2d')+_0x201944[_0x11e0('0x26')]+')','directioncode':_0x201944['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x11e0('0x2d')+_0x201944[_0x11e0('0x26')]+')','participationtypemask':_0x201944[_0x11e0('0x46')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x11e0('0x42')+_0x201944[_0x11e0('0x32')]+')','participationtypemask':_0x201944[_0x11e0('0x46')]===_0x11e0('0x47')?0x1:0x2}]},getCustomFields(_0x27f6b9[_0x11e0('0x48')],_0x3e6ff1,_0x27f6b9['ticketType'])),'headers':{'Authorization':_0x11e0('0x18')+_0x1d625f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x340a45);})[_0x11e0('0x12')](function(_0x1b2ec4){var _0xedcd99=_0x1b2ec4[_0x11e0('0x2e')]['odata-entityid'];var _0x3e9ced=_0xedcd99[_0x11e0('0x30')](_0xedcd99['lastIndexOf']('(')+0x1,_0xedcd99[_0x11e0('0x31')](')'));_0x201944[_0x11e0('0x49')]=_0x3e9ced;_0x598387(_0x201944);})[_0x11e0('0x27')](function(_0x580352){_0x2410a0(_0x580352[_0x11e0('0x15')]);});});}function emit(_0x396ede,_0x39ea22,_0x517f6d,_0x49ddab){var _0x1537e9={'uri':util['format'](_0x11e0('0x4a'),_0x396ede,_0x517f6d,_0x49ddab)};io['to'](util[_0x11e0('0x4b')](_0x11e0('0x4c'),_0x39ea22))['emit'](_0x11e0('0x4d'),_0x1537e9);}exports['cs']=function(_0x2d3a9f,_0xe1c2e5,_0x5ee00f,_0x3e947e,_0x4d51e8,_0x4a4724,_0x4ac51b,_0x35590d){var _0x40f2a3={};_0x4a4724['remoteUri']=intUtil['stripTrailingSlash'](_0x4a4724[_0x11e0('0x4e')]);_0x4a4724[_0x11e0('0x4f')]=intUtil[_0x11e0('0x50')](_0x4a4724[_0x11e0('0x4f')]);_0x40f2a3[_0x11e0('0x46')]=_0x35590d==='queue'||_0x35590d==='unmanaged'?_0x11e0('0x47'):_0x11e0('0x29');var _0x3c2302=util['format'](_0x11e0('0x51'),_0x4a4724[_0x11e0('0x4e')]);var _0x564a78=util[_0x11e0('0x4b')](_0x11e0('0x52'),_0x4a4724[_0x11e0('0x53')]);var _0x4446f8=util[_0x11e0('0x4b')](_0x11e0('0x54'),_0x4a4724[_0x11e0('0x4f')],_0xe1c2e5['uniqueid'],md5(_0xe1c2e5[_0x11e0('0x55')]));if(_0x4d51e8&&_0x4d51e8[_0x11e0('0x56')]){logger[_0x11e0('0x20')]('[QUEUE]',_0x11e0('0x57'));_0xe1c2e5[_0x11e0('0x58')]=_0x4446f8;}else if(_0x4ac51b&&_0x4ac51b[_0x11e0('0x59')]&&_0x4ac51b[_0x11e0('0x59')]!==_0x11e0('0x5a')){logger[_0x11e0('0x20')](_0x11e0('0x5b'),_0x11e0('0x57'));_0xe1c2e5['recordingURL']=_0x4446f8;}else{_0xe1c2e5[_0x11e0('0x58')]='';}return getUser(_0x40f2a3,_0x4a4724,_0x3e947e,_0x564a78,_0x3c2302,_0x35590d)[_0x11e0('0x12')](function(_0x31982b){logger[_0x11e0('0x20')]('['+_0x35590d[_0x11e0('0x21')]()+_0x11e0('0x5c'),_0x31982b[_0x11e0('0x26')]);logger[_0x11e0('0x20')]('['+_0x35590d[_0x11e0('0x21')]()+']\x20The\x20User\x20email\x20is:',_0x31982b[_0x11e0('0x1e')]);return getEndUser(_0x31982b,_0x4a4724,_0x564a78,_0x3c2302,_0xe1c2e5,_0x35590d);})[_0x11e0('0x12')](function(_0x1f79a7){logger[_0x11e0('0x20')]('['+_0x35590d['toUpperCase']()+_0x11e0('0x5d'),_0x1f79a7[_0x11e0('0x32')]);logger[_0x11e0('0x20')]('['+_0x35590d[_0x11e0('0x21')]()+_0x11e0('0x5e'),_0xe1c2e5[_0x11e0('0x2b')]);return getTicket(_0x1f79a7,_0x4a4724,_0x564a78,_0x3c2302,_0xe1c2e5,_0x5ee00f,_0x35590d);})[_0x11e0('0x12')](function(_0xb22ede){logger['info'](util['format']('['+_0x35590d[_0x11e0('0x21')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x5ee00f['ticketType'],_0xb22ede['ticketId']));logger[_0x11e0('0x20')](util['format']('['+_0x35590d[_0x11e0('0x21')]()+']\x20Call\x20direction:\x20%s',_0x35590d));if(_0x35590d!==_0x11e0('0x5f')){logger[_0x11e0('0x20')]('['+_0x35590d[_0x11e0('0x21')]()+']',_0x11e0('0x60'));emit(_0x4a4724['remoteUri'],_0x3e947e[_0x11e0('0x61')],_0x5ee00f['ticketType'],_0xb22ede[_0x11e0('0x49')]);}})[_0x11e0('0x27')](function(_0x54de29){logger[_0x11e0('0x13')]('['+_0x35590d['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x11e0('0x62')](_0x54de29,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x9e3f=['isdisabled',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','length','userId','toLowerCase','outbound','calleridnum','POST','contacts','/systemusers(','odata-entityid','lastIndexOf','enduserId','contacts?$select=telephone1','destcalleridnum','telephone1',']\x20Enduser\x20created!','type','string','nameField','customField','substring','indexOf','content','ticketType','incident','incidents','Subjects','Descriptions','/contacts(','phonecall','phonecalls','assign','getString','queue','callDirection','headers','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','clientId','remoteUri','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','isNil','email','userEmail'];(function(_0x532a13,_0x6e605){var _0xb2f2a0=function(_0x3188cb){while(--_0x3188cb){_0x532a13['push'](_0x532a13['shift']());}};_0xb2f2a0(++_0x6e605);}(_0x9e3f,0x1bd));var _0xf9e3=function(_0x3ae721,_0x5cde85){_0x3ae721=_0x3ae721-0x0;var _0x488cb0=_0x9e3f[_0x3ae721];return _0x488cb0;};'use strict';var _=require('lodash');var BPromise=require(_0xf9e3('0x0'));var rp=require(_0xf9e3('0x1'));var util=require(_0xf9e3('0x2'));var intUtil=require(_0xf9e3('0x3'));var md5=require(_0xf9e3('0x4'));var Redis=require('ioredis');var logger=require(_0xf9e3('0x5'))(_0xf9e3('0x6'));var config=require(_0xf9e3('0x7'));config['redis']=_[_0xf9e3('0x8')](config[_0xf9e3('0x9')],{'host':_0xf9e3('0xa'),'port':0x18eb});var io=require(_0xf9e3('0xb'))(new Redis(config[_0xf9e3('0x9')]));function getAuthToken(_0xc5eb95,_0x2c1dcf,_0x36aa25){var _0x51c41e={'method':'POST','uri':_0x2c1dcf,'form':{'client_id':_0xc5eb95[_0xf9e3('0xc')],'resource':_0xc5eb95[_0xf9e3('0xd')],'username':_0xc5eb95[_0xf9e3('0xe')],'password':_0xc5eb95[_0xf9e3('0xf')],'grant_type':'password','client_secret':_0xc5eb95['clientSecret']},'json':!![]};return rp(_0x51c41e)[_0xf9e3('0x10')](function(_0x3a75ee){return _0x3a75ee[_0xf9e3('0x11')];})[_0xf9e3('0x12')](function(_0x23d342){logger[_0xf9e3('0x13')]('['+[_0x36aa25[_0xf9e3('0x14')]()]+_0xf9e3('0x15'));return _0x23d342[_0xf9e3('0x16')];});}function getUser(_0x5300bb,_0x4243c8,_0x4c4c7f,_0x5c6d2a,_0x47a345,_0x352e3a){return new BPromise(function(_0xc2e18b,_0x46a79e){return getAuthToken(_0x4243c8,_0x5c6d2a,_0x352e3a)['then'](function(_0x568cd6){var _0x26568d={'method':_0xf9e3('0x17'),'uri':_0x47a345+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xf9e3('0x18')+_0x568cd6,'OData-Version':_0xf9e3('0x19')},'json':!![]};return rp(_0x26568d);})[_0xf9e3('0x10')](function(_0x4421d3){var _0x584d09=_0x4421d3[_0xf9e3('0x1a')];var _0x116492=![];var _0x411105=null;if(!_[_0xf9e3('0x1b')](_0x4c4c7f)){if(intUtil['validateEmail'](_0x4c4c7f[_0xf9e3('0x1c')])){_0x5300bb[_0xf9e3('0x1d')]=_0x4c4c7f[_0xf9e3('0x1c')];for(_0x411105=0x0;_0x411105<_0x584d09['length'];_0x411105++){if(_0x584d09[_0x411105]['internalemailaddress']===_0x4c4c7f[_0xf9e3('0x1c')]&&!_0x584d09[_0x411105][_0xf9e3('0x1e')]){_0x116492=!![];logger['info']('['+[_0x352e3a[_0xf9e3('0x14')]()]+_0xf9e3('0x1f')+_0x584d09[_0x411105][_0xf9e3('0x20')]+'!');_0x5300bb['userId']=_0x584d09[_0x411105]['systemuserid'];}}}}if(!_0x116492){logger[_0xf9e3('0x21')]('['+[_0x352e3a['toUpperCase']()]+_0xf9e3('0x22'));_0x5300bb[_0xf9e3('0x1d')]=_0x4243c8['username'];for(_0x411105=0x0;_0x411105<_0x584d09[_0xf9e3('0x23')];_0x411105++){if(_0x584d09[_0x411105]['internalemailaddress']===_0x4243c8[_0xf9e3('0xe')]){_0x5300bb[_0xf9e3('0x24')]=_0x584d09[_0x411105][_0xf9e3('0x20')];}}}_0xc2e18b(_0x5300bb);})[_0xf9e3('0x12')](function(_0x5e297a){_0x46a79e(_0x5e297a[_0xf9e3('0x16')]);});});}function createEndUser(_0x2104ec,_0x22ac0d,_0x15f4a5,_0x70279c,_0x1b1781,_0x3fddc5){return new BPromise(function(_0x5cc3ab,_0x32bf17){return getAuthToken(_0x22ac0d,_0x15f4a5,_0x3fddc5)[_0xf9e3('0x10')](function(_0x4d0ccd){var _0xfa87e4=_0x3fddc5[_0xf9e3('0x25')]()===_0xf9e3('0x26')?_0x1b1781['destcalleridnum']:_0x1b1781[_0xf9e3('0x27')];var _0x204994={'method':_0xf9e3('0x28'),'uri':_0x70279c+_0xf9e3('0x29'),'body':{'telephone1':_0xfa87e4,'fullname':_0xfa87e4,'firstname':_0xfa87e4,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xf9e3('0x2a')+_0x2104ec[_0xf9e3('0x24')]+')'},'headers':{'Authorization':_0xf9e3('0x18')+_0x4d0ccd,'OData-Version':_0xf9e3('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x204994);})[_0xf9e3('0x10')](function(_0x339bb1){var _0x13cc83=_0x339bb1['headers'][_0xf9e3('0x2b')];var _0x3f5a9a=_0x13cc83['substring'](_0x13cc83[_0xf9e3('0x2c')]('(')+0x1,_0x13cc83['lastIndexOf'](')'));_0x2104ec[_0xf9e3('0x2d')]=_0x3f5a9a;_0x5cc3ab(_0x2104ec);})[_0xf9e3('0x12')](function(_0x49027c){_0x32bf17(_0x49027c[_0xf9e3('0x16')]);});});}function getEndUser(_0x3a8c35,_0x59dad3,_0x3f7efb,_0x1e5849,_0x30bd9e,_0x587023){return new BPromise(function(_0x406b20,_0x3ae7ff){return getAuthToken(_0x59dad3,_0x3f7efb,_0x587023)[_0xf9e3('0x10')](function(_0x129d4d){var _0x14dad0={'method':'GET','uri':_0x1e5849+_0xf9e3('0x2e'),'headers':{'Authorization':_0xf9e3('0x18')+_0x129d4d,'If-None-Match':null,'OData-Version':_0xf9e3('0x19')},'json':!![]};return rp(_0x14dad0);})[_0xf9e3('0x10')](function(_0x110a23){var _0x58c07e=null;if(_0x110a23){var _0x1f9e9d=_0x110a23['value'];var _0x128dc8=![];for(_0x58c07e=0x0;_0x58c07e<_0x1f9e9d[_0xf9e3('0x23')];_0x58c07e++){var _0x549994=_0x587023[_0xf9e3('0x25')]()===_0xf9e3('0x26')?_0x30bd9e[_0xf9e3('0x2f')]:_0x30bd9e[_0xf9e3('0x27')];if(_0x1f9e9d[_0x58c07e][_0xf9e3('0x30')]===_0x549994){_0x128dc8=!![];_0x3a8c35[_0xf9e3('0x2d')]=_0x1f9e9d[_0x58c07e]['contactid'];}}if(_0x128dc8){_0x406b20(_0x3a8c35);}else{return createEndUser(_0x3a8c35,_0x59dad3,_0x3f7efb,_0x1e5849,_0x30bd9e,_0x587023)[_0xf9e3('0x10')](function(_0x5a558d){logger['info']('['+[_0x587023['toUpperCase']()]+_0xf9e3('0x31'),_0x5a558d[_0xf9e3('0x2d')]);_0x406b20(_0x5a558d);});}}else{return createEndUser(_0x3a8c35,_0x59dad3,_0x3f7efb,_0x1e5849,_0x30bd9e,_0x587023)[_0xf9e3('0x10')](function(_0x3af495){logger[_0xf9e3('0x21')]('['+[_0x587023[_0xf9e3('0x14')]()]+']\x20Enduser\x20Created!',_0x3af495[_0xf9e3('0x2d')]);_0x406b20(_0x3af495);});}});});}function getCustomFields(_0x3acf59,_0x3f6b73,_0x318021){var _0x16f0a4={};if(_0x3acf59[_0xf9e3('0x23')]>0x0){_['forEach'](_0x3acf59,function(_0x41b87d){if(_0x41b87d[_0xf9e3('0x32')]===_0xf9e3('0x33')&&_0x41b87d[_0xf9e3('0x34')]&&!_0x41b87d[_0xf9e3('0x35')]){var _0x2bf7ad=_0x41b87d['idField'][_0xf9e3('0x25')]();var _0x40d0df=_0x2bf7ad['substring'](0x0,_0x2bf7ad['indexOf']('_'));var _0x230d7d=_0x2bf7ad[_0xf9e3('0x36')](_0x2bf7ad[_0xf9e3('0x37')]('_')+0x1);if(_0x40d0df===_0x318021){_0x16f0a4[_0x230d7d]=_0x41b87d[_0xf9e3('0x38')];}}});}return _0x16f0a4;}function getTicket(_0x52a05a,_0x3897f1,_0x54d4ae,_0x193e73,_0x60a6f4,_0xed20e,_0x330bfa){return new BPromise(function(_0x33c165,_0x4e7bbe){var _0x18ba08;return getAuthToken(_0x3897f1,_0x54d4ae,_0x330bfa)[_0xf9e3('0x10')](function(_0x332ece){if(_0xed20e[_0xf9e3('0x39')]===_0xf9e3('0x3a')){_0x18ba08={'method':'POST','uri':_0x193e73+_0xf9e3('0x3b'),'body':Object['assign']({},{'title':intUtil['getString'](_0xed20e[_0xf9e3('0x3c')],_0x60a6f4,'\x20'),'description':intUtil['getString'](_0xed20e[_0xf9e3('0x3d')],_0x60a6f4,'\x0a'),'customerid_contact@odata.bind':_0xf9e3('0x3e')+_0x52a05a[_0xf9e3('0x2d')]+')','ownerid@odata.bind':_0xf9e3('0x2a')+_0x52a05a[_0xf9e3('0x24')]+')','caseorigincode':'1'},getCustomFields(_0xed20e['Fields'],_0x60a6f4,_0xed20e[_0xf9e3('0x39')])),'headers':{'Authorization':_0xf9e3('0x18')+_0x332ece,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0xed20e[_0xf9e3('0x39')]===_0xf9e3('0x3f')){_0x18ba08={'method':'POST','uri':_0x193e73+_0xf9e3('0x40'),'body':Object[_0xf9e3('0x41')]({},{'subject':intUtil['getString'](_0xed20e[_0xf9e3('0x3c')],_0x60a6f4,'\x20'),'phonenumber':String(_0x60a6f4[_0xf9e3('0x27')]),'description':intUtil[_0xf9e3('0x42')](_0xed20e[_0xf9e3('0x3d')],_0x60a6f4,'\x0a'),'regardingobjectid_contact@odata.bind':_0xf9e3('0x3e')+_0x52a05a[_0xf9e3('0x2d')]+')','ownerid@odata.bind':_0xf9e3('0x2a')+_0x52a05a[_0xf9e3('0x24')]+')','directioncode':_0x52a05a['callDirection']===_0xf9e3('0x43')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xf9e3('0x2a')+_0x52a05a[_0xf9e3('0x24')]+')','participationtypemask':_0x52a05a['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x52a05a[_0xf9e3('0x2d')]+')','participationtypemask':_0x52a05a[_0xf9e3('0x44')]==='queue'?0x1:0x2}]},getCustomFields(_0xed20e['Fields'],_0x60a6f4,_0xed20e[_0xf9e3('0x39')])),'headers':{'Authorization':_0xf9e3('0x18')+_0x332ece,'OData-Version':_0xf9e3('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x18ba08);})[_0xf9e3('0x10')](function(_0x4acaa4){var _0x25dfa6=_0x4acaa4[_0xf9e3('0x45')][_0xf9e3('0x2b')];var _0x53f36b=_0x25dfa6[_0xf9e3('0x36')](_0x25dfa6[_0xf9e3('0x2c')]('(')+0x1,_0x25dfa6[_0xf9e3('0x2c')](')'));_0x52a05a['ticketId']=_0x53f36b;_0x33c165(_0x52a05a);})[_0xf9e3('0x12')](function(_0x2b2683){_0x4e7bbe(_0x2b2683['message']);});});}function emit(_0x3243cd,_0x224e66,_0x4e26f3,_0x4f995b){var _0x1fa7c5={'uri':util['format'](_0xf9e3('0x46'),_0x3243cd,_0x4e26f3,_0x4f995b)};io['to'](util[_0xf9e3('0x47')](_0xf9e3('0x48'),_0x224e66))['emit']('trigger:browser:url',_0x1fa7c5);}exports['cs']=function(_0x167b31,_0x1cf137,_0x5d1eb0,_0x150184,_0x32ec5f,_0x52547b,_0x2fa20a,_0x55cfc6){var _0x2b69ee={};_0x52547b['remoteUri']=intUtil[_0xf9e3('0x49')](_0x52547b[_0xf9e3('0xd')]);_0x52547b[_0xf9e3('0x4a')]=intUtil[_0xf9e3('0x49')](_0x52547b[_0xf9e3('0x4a')]);_0x2b69ee[_0xf9e3('0x44')]=_0x55cfc6==='queue'||_0x55cfc6===_0xf9e3('0x4b')?_0xf9e3('0x43'):_0xf9e3('0x26');var _0x8e7de=util[_0xf9e3('0x47')]('%s/api/data/v9.0/',_0x52547b['remoteUri']);var _0x130a2a=util[_0xf9e3('0x47')](_0xf9e3('0x4c'),_0x52547b[_0xf9e3('0x4d')]);var _0x269fc3=util['format'](_0xf9e3('0x4e'),_0x52547b[_0xf9e3('0x4a')],_0x1cf137['uniqueid'],md5(_0x1cf137[_0xf9e3('0x4f')]));if(_0x32ec5f&&_0x32ec5f[_0xf9e3('0x50')]){logger[_0xf9e3('0x21')](_0xf9e3('0x51'),_0xf9e3('0x52'));_0x1cf137[_0xf9e3('0x53')]=_0x269fc3;}else if(_0x2fa20a&&_0x2fa20a[_0xf9e3('0x54')]&&_0x2fa20a[_0xf9e3('0x54')]!=='none'){logger['info'](_0xf9e3('0x55'),'Recording\x20is\x20enabled!');_0x1cf137[_0xf9e3('0x53')]=_0x269fc3;}else{_0x1cf137[_0xf9e3('0x53')]='';}return getUser(_0x2b69ee,_0x52547b,_0x150184,_0x130a2a,_0x8e7de,_0x55cfc6)[_0xf9e3('0x10')](function(_0x5275ba){logger[_0xf9e3('0x21')]('['+_0x55cfc6[_0xf9e3('0x14')]()+_0xf9e3('0x56'),_0x5275ba['userId']);logger[_0xf9e3('0x21')]('['+_0x55cfc6[_0xf9e3('0x14')]()+_0xf9e3('0x57'),_0x5275ba['userEmail']);return getEndUser(_0x5275ba,_0x52547b,_0x130a2a,_0x8e7de,_0x1cf137,_0x55cfc6);})[_0xf9e3('0x10')](function(_0x466826){logger['info']('['+_0x55cfc6[_0xf9e3('0x14')]()+_0xf9e3('0x58'),_0x466826[_0xf9e3('0x2d')]);logger[_0xf9e3('0x21')]('['+_0x55cfc6[_0xf9e3('0x14')]()+_0xf9e3('0x59'),_0x1cf137[_0xf9e3('0x27')]);return getTicket(_0x466826,_0x52547b,_0x130a2a,_0x8e7de,_0x1cf137,_0x5d1eb0,_0x55cfc6);})['then'](function(_0x497b2e){logger['info'](util['format']('['+_0x55cfc6['toUpperCase']()+_0xf9e3('0x5a'),_0x5d1eb0[_0xf9e3('0x39')],_0x497b2e['ticketId']));logger[_0xf9e3('0x21')](util['format']('['+_0x55cfc6['toUpperCase']()+_0xf9e3('0x5b'),_0x55cfc6));if(_0x55cfc6!==_0xf9e3('0x4b')){logger[_0xf9e3('0x21')]('['+_0x55cfc6[_0xf9e3('0x14')]()+']',_0xf9e3('0x5c'));emit(_0x52547b[_0xf9e3('0xd')],_0x150184['name'],_0x5d1eb0[_0xf9e3('0x39')],_0x497b2e['ticketId']);}})[_0xf9e3('0x12')](function(_0x3c7f0b){logger['error']('['+_0x55cfc6[_0xf9e3('0x14')]()+_0xf9e3('0x5d'),util[_0xf9e3('0x5e')](_0x3c7f0b,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 51445dc..83f38a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4db3=['Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','stringify','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','lastevent','toUpperCase','The\x20User\x20ID\x20is:','lodash','md5','ioredis','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','<br>','name','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','then','validateEmail','%s/api/v2/agents','length','find','contact','email','%s/api/v2/agents/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','base64','debug','GET','map','forEach','type','string','customField','nameField','toLowerCase','content','push','toString','variableName','idField','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]'];(function(_0x11d92a,_0x1fc6d7){var _0x5739df=function(_0x4fe90a){while(--_0x4fe90a){_0x11d92a['push'](_0x11d92a['shift']());}};_0x5739df(++_0x1fc6d7);}(_0x4db3,0x17a));var _0x34db=function(_0x42b7e1,_0x28ba63){_0x42b7e1=_0x42b7e1-0x0;var _0x1b7eee=_0x4db3[_0x42b7e1];return _0x1b7eee;};'use strict';var _=require(_0x34db('0x0'));var rp=require('request-promise');var md5=require(_0x34db('0x1'));var util=require('util');var Redis=require(_0x34db('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x34db('0x3'))(_0x34db('0x4'));config[_0x34db('0x5')]=_[_0x34db('0x6')](config[_0x34db('0x5')],{'host':_0x34db('0x7'),'port':0x18eb});var io=require(_0x34db('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0x34db('0x9'),'Accept':_0x34db('0x9')};function emit(_0x1ebcf4,_0x5d623f,_0x26b56e){io['to'](_0x1ebcf4)[_0x34db('0xa')](_0x5d623f,_0x26b56e);}function getTicket(_0x1eb310,_0x5112f3,_0x496caf,_0x289a1b,_0x13e2a4){logger[_0x34db('0xb')](_0x34db('0xc'));var _0x138dc7=_[_0x34db('0xd')]({'responder_id':_0x5112f3['id'],'requester_id':_0x496caf['id'],'name':util['format'](_0x34db('0xe'),_0x13e2a4[_0x34db('0xf')]),'phone':_0x13e2a4[_0x34db('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x34db('0x11')](_0x289a1b[_0x34db('0x12')],_0x13e2a4,'\x20'),'description':intUtil[_0x34db('0x11')](_0x289a1b[_0x34db('0x13')],_0x13e2a4,_0x34db('0x14')),'tags':getTags(_0x289a1b['Tags'],_0x34db('0x15'))},getCustomFields(_0x289a1b[_0x34db('0x16')],_0x13e2a4));_0x138dc7[_0x34db('0x17')]=_[_0x34db('0x18')](_[_0x34db('0x19')](_0x138dc7['custom_fields'],'id'),_0x34db('0x1a'));return request({'uri':util[_0x34db('0x1b')](_0x34db('0x1c'),_0x1eb310['remoteUri']),'method':'POST','body':_0x138dc7})[_0x34db('0x1d')](function(_0x460fef){logger[_0x34db('0xb')]('Ticket\x20created!');return _0x460fef;});}function getUser(_0x53a591,_0x53b851){if(intUtil[_0x34db('0x1e')](_0x53b851)){return request({'uri':util[_0x34db('0x1b')](_0x34db('0x1f'),_0x53a591['remoteUri']),'qs':{'email':_0x53b851}})['then'](function(_0x7a6669){if(_0x7a6669[_0x34db('0x20')]){logger[_0x34db('0xb')]('Agent\x20found!');return _[_0x34db('0x21')](_0x7a6669,function(_0x5297c5){return _0x5297c5[_0x34db('0x22')][_0x34db('0x23')]===_0x53b851;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x34db('0x1b')](_0x34db('0x24'),_0x53a591[_0x34db('0x25')])})['then'](function(_0x3f61e4){logger[_0x34db('0xb')]('Admin\x20account\x20selected.');return _0x3f61e4;});}});}else{logger[_0x34db('0xb')](_0x34db('0x26'));return request({'uri':util[_0x34db('0x1b')](_0x34db('0x24'),_0x53a591[_0x34db('0x25')])})[_0x34db('0x1d')](function(_0x5c136f){logger[_0x34db('0xb')](_0x34db('0x27'));return _0x5c136f;});}}function getEndUser(_0x20bd15,_0x2230c1,_0x1bfe9a){logger[_0x34db('0xb')](_0x34db('0x28'),_0x1bfe9a);return request({'uri':util[_0x34db('0x1b')](_0x34db('0x29'),_0x20bd15[_0x34db('0x25')]),'qs':{'phone':_0x1bfe9a}})[_0x34db('0x1d')](function(_0x1cb28e){if(_0x1cb28e[_0x34db('0x20')]){logger[_0x34db('0xb')](_0x34db('0x2a'));return _[_0x34db('0x21')](_0x1cb28e,{'phone':_0x1bfe9a});}else{logger['info'](_0x34db('0x2b'));return request({'uri':util[_0x34db('0x1b')](_0x34db('0x29'),_0x20bd15[_0x34db('0x25')]),'method':'POST','body':{'name':_0x2230c1,'phone':_0x1bfe9a}})['then'](function(_0x57fe0b){logger[_0x34db('0xb')](_0x34db('0x2c'));return _0x57fe0b;});}});}function getAuth(_0x36e4fc){return util['format']('Basic\x20%s',new Buffer(_0x36e4fc[_0x34db('0x2d')]+':X')['toString'](_0x34db('0x2e')));}function request(_0xe1e06a){logger[_0x34db('0x2f')]('[HTTP]',JSON['stringify'](_0xe1e06a));return rp(_['defaults'](_0xe1e06a,{'method':_0x34db('0x30'),'headers':headers,'json':!![]}));}function getTags(_0xf040a4,_0x32d08c){var _0x55cb09=[];if(_0xf040a4&&_0xf040a4[_0x34db('0x20')]>0x0){_0x55cb09=_[_0x34db('0x31')](_0xf040a4,_0x32d08c);}return _0x55cb09;}function getCustomFields(_0x4c76ec,_0xc384c6){var _0x4485c9=[];var _0x62f72={'custom_fields':[]};if(_0x4c76ec[_0x34db('0x20')]>0x0){_[_0x34db('0x32')](_0x4c76ec,function(_0xd417fa){if(_0xd417fa[_0x34db('0x33')]===_0x34db('0x34')&&_0xd417fa['nameField']&&!_0xd417fa[_0x34db('0x35')]){_0x62f72[_0xd417fa[_0x34db('0x36')][_0x34db('0x37')]()]=_0xd417fa[_0x34db('0x38')]['toString']();}else if(_0xd417fa[_0x34db('0x33')]==='string'&&_0xd417fa['idField']&&_0xd417fa[_0x34db('0x35')]){_0x62f72[_0x34db('0x17')][_0x34db('0x39')]({'id':_0xd417fa['idField'],'value':_0xd417fa[_0x34db('0x38')][_0x34db('0x3a')]()});}else if(_0xd417fa['type']==='variable'&&_0xd417fa[_0x34db('0x3b')]&&_0xd417fa[_0x34db('0x3c')]&&_0xd417fa['customField']){_0xc384c6[_0xd417fa['variableName']]&&_0x62f72[_0x34db('0x17')][_0x34db('0x39')]({'id':_0xd417fa[_0x34db('0x3c')],'value':_0xc384c6[_0xd417fa[_0x34db('0x3b')]][_0x34db('0x3a')]()});}else if(_0xd417fa['type']===_0x34db('0x3d')&&_0xd417fa[_0x34db('0x3e')]&&_0xd417fa[_0x34db('0x3e')][_0x34db('0x15')]&&_0xd417fa[_0x34db('0x3c')]&&_0xd417fa[_0x34db('0x35')]){_0xc384c6[_0xd417fa[_0x34db('0x3e')][_0x34db('0x15')][_0x34db('0x37')]()]&&_0x62f72[_0x34db('0x17')]['push']({'id':_0xd417fa[_0x34db('0x3c')],'value':_0xc384c6[_0xd417fa[_0x34db('0x3e')][_0x34db('0x15')][_0x34db('0x37')]()][_0x34db('0x3a')]()});}});}return _0x62f72;}exports['queue']=function(_0x4e9809,_0x4a69da,_0x28d719,_0x4406f8,_0x20919c,_0x4e2815){var _0x2e0812,_0x253a55;_0x4e2815[_0x34db('0x25')]=intUtil[_0x34db('0x3f')](_0x4e2815['remoteUri']);_0x4e2815[_0x34db('0x40')]=intUtil[_0x34db('0x3f')](_0x4e2815[_0x34db('0x40')]);if(_0x20919c&&_0x20919c[_0x34db('0x41')]){logger[_0x34db('0xb')](_0x34db('0x42'),_0x34db('0x43'));_0x4a69da[_0x34db('0x44')]=util[_0x34db('0x1b')](_0x34db('0x45'),_0x4e2815[_0x34db('0x40')],_0x4a69da[_0x34db('0x46')],md5(_0x4a69da['uniqueid']));}else{_0x4a69da[_0x34db('0x44')]='';}headers[_0x34db('0x47')]=getAuth(_0x4e2815);return getUser(_0x4e2815,_0x4406f8[_0x34db('0x23')])['then'](function(_0x474b72){_0x2e0812=_0x474b72;logger[_0x34db('0xb')]('The\x20User\x20ID\x20is:',_0x2e0812['id']);return getEndUser(_0x4e2815,_0x4a69da['calleridname'],_0x4a69da[_0x34db('0x10')]);})[_0x34db('0x1d')](function(_0x3f17d6){_0x253a55=_0x3f17d6;logger['info'](_0x34db('0x48'),_0x253a55['id']);return getTicket(_0x4e2815,_0x2e0812,_0x253a55,_0x28d719,_0x4a69da);})[_0x34db('0x1d')](function(_0x3dd33c){if(_0x3dd33c&&_0x3dd33c['id']){logger[_0x34db('0xb')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x3dd33c['id']);logger[_0x34db('0xb')](_0x34db('0x42'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x34db('0x49'),_0x4406f8[_0x34db('0x15')]),_0x34db('0x4a'),{'uri':util[_0x34db('0x1b')](_0x34db('0x4b'),_0x4e2815[_0x34db('0x25')],_0x3dd33c['id'])});}})['catch'](function(_0x3aeff5){logger[_0x34db('0x4c')](_0x34db('0x42'),JSON[_0x34db('0x4d')](_0x3aeff5));});};exports[_0x34db('0x4e')]=function(_0x57df6c,_0x15a9cb,_0x3996cb,_0x419500,_0x9245f8,_0x4455dd,_0x143031){var _0x28900a,_0x557893;_0x4455dd[_0x34db('0x25')]=intUtil[_0x34db('0x3f')](_0x4455dd[_0x34db('0x25')]);_0x4455dd['serverUrl']=intUtil[_0x34db('0x3f')](_0x4455dd['serverUrl']);if(_0x143031&&_0x143031[_0x34db('0x4f')]&&_0x143031[_0x34db('0x4f')]!=='none'){logger[_0x34db('0xb')](_0x34db('0x50'),_0x34db('0x43'));_0x15a9cb[_0x34db('0x44')]=util[_0x34db('0x1b')](_0x34db('0x45'),_0x4455dd[_0x34db('0x40')],_0x15a9cb[_0x34db('0x46')],md5(_0x15a9cb['uniqueid']));}headers[_0x34db('0x47')]=getAuth(_0x4455dd);return getUser(_0x4455dd,_0x419500[_0x34db('0x23')])['then'](function(_0x53280b){_0x28900a=_0x53280b;logger['info']('The\x20User\x20ID\x20is:',_0x28900a['id']);return getEndUser(_0x4455dd,_0x15a9cb[_0x34db('0x51')],_0x15a9cb[_0x34db('0x52')]);})['then'](function(_0x437e50){_0x557893=_0x437e50;logger[_0x34db('0xb')](_0x34db('0x48'),_0x557893['id']);return getTicket(_0x4455dd,_0x28900a,_0x557893,_0x3996cb,_0x15a9cb);})['then'](function(_0x132680){if(_0x132680&&_0x132680['id']){logger[_0x34db('0xb')](_0x34db('0x53'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x132680['id']);logger[_0x34db('0xb')](_0x34db('0x50'),_0x34db('0x54'));emit(util[_0x34db('0x1b')](_0x34db('0x49'),_0x419500[_0x34db('0x15')]),_0x34db('0x4a'),{'uri':util['format'](_0x34db('0x4b'),_0x4455dd['remoteUri'],_0x132680['id'])});}})[_0x34db('0x55')](function(_0x6d03c7){logger['error'](_0x34db('0x50'),JSON[_0x34db('0x4d')](_0x6d03c7));});};exports['unmanaged']=function(_0xf1b823,_0xcd994c,_0x4a7b03,_0x3ca3f1,_0x44a439,_0x313d27){var _0x1734a5,_0x4e19c8;_0x313d27[_0x34db('0x25')]=intUtil[_0x34db('0x3f')](_0x313d27[_0x34db('0x25')]);_0x313d27[_0x34db('0x40')]=intUtil[_0x34db('0x3f')](_0x313d27['serverUrl']);if(_0x44a439&&_0x44a439[_0x34db('0x41')]){logger[_0x34db('0xb')]('['+_0xcd994c[_0x34db('0x56')][_0x34db('0x57')]()+']','Recording\x20is\x20enabled!');_0xcd994c[_0x34db('0x44')]=util[_0x34db('0x1b')](_0x34db('0x45'),_0x313d27['serverUrl'],_0xcd994c[_0x34db('0x46')],md5(_0xcd994c[_0x34db('0x46')]));}else{_0xcd994c['recordingURL']='';}headers[_0x34db('0x47')]=getAuth(_0x313d27);return getUser(_0x313d27,'')[_0x34db('0x1d')](function(_0x24401b){_0x1734a5=_0x24401b;logger[_0x34db('0xb')](_0x34db('0x58'),_0x1734a5['id']);return getEndUser(_0x313d27,_0xcd994c[_0x34db('0xf')],_0xcd994c[_0x34db('0x10')]);})[_0x34db('0x1d')](function(_0x132a12){_0x4e19c8=_0x132a12;logger['info'](_0x34db('0x48'),_0x4e19c8['id']);return getTicket(_0x313d27,_0x1734a5,_0x4e19c8,_0x4a7b03,_0xcd994c);})[_0x34db('0x1d')](function(_0x315959){if(_0x315959){logger['info'](_0x34db('0x53'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x315959['id']);}})[_0x34db('0x55')](function(_0x43d947){logger[_0x34db('0x4c')]('['+_0xcd994c['lastevent'][_0x34db('0x57')]()+']',JSON['stringify'](_0x43d947));});};
\ No newline at end of file
+var _0x0524=['find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','type','string','nameField','content','idField','customField','push','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','The\x20Ticket\x20ID\x20is:','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','Descriptions','<br>','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','info','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','then','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!'];(function(_0x5b8a68,_0x53e48d){var _0x50b7a5=function(_0x1db8d1){while(--_0x1db8d1){_0x5b8a68['push'](_0x5b8a68['shift']());}};_0x50b7a5(++_0x53e48d);}(_0x0524,0xf3));var _0x4052=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x0524[_0x1abb09];return _0xea1c07;};'use strict';var _=require(_0x4052('0x0'));var rp=require(_0x4052('0x1'));var md5=require(_0x4052('0x2'));var util=require(_0x4052('0x3'));var Redis=require(_0x4052('0x4'));var intUtil=require(_0x4052('0x5'));var config=require(_0x4052('0x6'));var logger=require(_0x4052('0x7'))(_0x4052('0x8'));config[_0x4052('0x9')]=_['defaults'](config[_0x4052('0x9')],{'host':_0x4052('0xa'),'port':0x18eb});var io=require(_0x4052('0xb'))(new Redis(config[_0x4052('0x9')]));var headers={'Content-Type':'application/json','Accept':_0x4052('0xc')};function emit(_0x2a1e14,_0x198c1d,_0x1b4a97){io['to'](_0x2a1e14)[_0x4052('0xd')](_0x198c1d,_0x1b4a97);}function getTicket(_0x2cb83b,_0x4cce17,_0x3579fd,_0x985797,_0x5d7275){logger['info'](_0x4052('0xe'));var _0x39e243=_[_0x4052('0xf')]({'responder_id':_0x4cce17['id'],'requester_id':_0x3579fd['id'],'name':util[_0x4052('0x10')](_0x4052('0x11'),_0x5d7275[_0x4052('0x12')]),'phone':_0x5d7275[_0x4052('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x985797[_0x4052('0x14')],_0x5d7275,'\x20'),'description':intUtil['getString'](_0x985797[_0x4052('0x15')],_0x5d7275,_0x4052('0x16')),'tags':getTags(_0x985797[_0x4052('0x17')],_0x4052('0x18'))},getCustomFields(_0x985797[_0x4052('0x19')],_0x5d7275));_0x39e243[_0x4052('0x1a')]=_[_0x4052('0x1b')](_[_0x4052('0x1c')](_0x39e243['custom_fields'],'id'),_0x4052('0x1d'));return request({'uri':util[_0x4052('0x10')](_0x4052('0x1e'),_0x2cb83b['remoteUri']),'method':'POST','body':_0x39e243})['then'](function(_0x246c83){logger[_0x4052('0x1f')](_0x4052('0x20'));return _0x246c83;});}function getUser(_0x452c71,_0x5ec14d){if(intUtil[_0x4052('0x21')](_0x5ec14d)){return request({'uri':util[_0x4052('0x10')](_0x4052('0x22'),_0x452c71[_0x4052('0x23')]),'qs':{'email':_0x5ec14d}})[_0x4052('0x24')](function(_0x2e9ebf){if(_0x2e9ebf[_0x4052('0x25')]){logger[_0x4052('0x1f')](_0x4052('0x26'));return _['find'](_0x2e9ebf,function(_0xe21cc1){return _0xe21cc1[_0x4052('0x27')][_0x4052('0x28')]===_0x5ec14d;});}else{logger[_0x4052('0x1f')](_0x4052('0x29'));return request({'uri':util[_0x4052('0x10')](_0x4052('0x2a'),_0x452c71[_0x4052('0x23')])})[_0x4052('0x24')](function(_0xcffaec){logger['info']('Admin\x20account\x20selected.');return _0xcffaec;});}});}else{logger[_0x4052('0x1f')](_0x4052('0x2b'));return request({'uri':util[_0x4052('0x10')](_0x4052('0x2a'),_0x452c71[_0x4052('0x23')])})['then'](function(_0x4c9f8b){logger[_0x4052('0x1f')](_0x4052('0x2c'));return _0x4c9f8b;});}}function getEndUser(_0x5036cf,_0x2311b1,_0x4941ee){logger['info'](_0x4052('0x2d'),_0x4941ee);return request({'uri':util['format'](_0x4052('0x2e'),_0x5036cf[_0x4052('0x23')]),'qs':{'phone':_0x4941ee}})[_0x4052('0x24')](function(_0xce7590){if(_0xce7590[_0x4052('0x25')]){logger['info'](_0x4052('0x2f'));return _[_0x4052('0x30')](_0xce7590,{'phone':_0x4941ee});}else{logger[_0x4052('0x1f')](_0x4052('0x31'));return request({'uri':util[_0x4052('0x10')](_0x4052('0x2e'),_0x5036cf[_0x4052('0x23')]),'method':_0x4052('0x32'),'body':{'name':_0x2311b1,'phone':_0x4941ee}})[_0x4052('0x24')](function(_0x1fb282){logger[_0x4052('0x1f')](_0x4052('0x33'));return _0x1fb282;});}});}function getAuth(_0x385bab){return util[_0x4052('0x10')](_0x4052('0x34'),new Buffer(_0x385bab[_0x4052('0x35')]+':X')[_0x4052('0x36')](_0x4052('0x37')));}function request(_0x321a38){logger[_0x4052('0x38')](_0x4052('0x39'),JSON[_0x4052('0x3a')](_0x321a38));return rp(_['defaults'](_0x321a38,{'method':_0x4052('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x37e64f,_0x28c5b3){var _0x17e76c=[];if(_0x37e64f&&_0x37e64f[_0x4052('0x25')]>0x0){_0x17e76c=_[_0x4052('0x3c')](_0x37e64f,_0x28c5b3);}return _0x17e76c;}function getCustomFields(_0x46ce52,_0x2e3202){var _0x3b3dd7=[];var _0x2b482f={'custom_fields':[]};if(_0x46ce52[_0x4052('0x25')]>0x0){_[_0x4052('0x3d')](_0x46ce52,function(_0x51fc31){if(_0x51fc31[_0x4052('0x3e')]===_0x4052('0x3f')&&_0x51fc31[_0x4052('0x40')]&&!_0x51fc31['customField']){_0x2b482f[_0x51fc31[_0x4052('0x40')]['toLowerCase']()]=_0x51fc31[_0x4052('0x41')][_0x4052('0x36')]();}else if(_0x51fc31[_0x4052('0x3e')]===_0x4052('0x3f')&&_0x51fc31[_0x4052('0x42')]&&_0x51fc31[_0x4052('0x43')]){_0x2b482f[_0x4052('0x1a')][_0x4052('0x44')]({'id':_0x51fc31[_0x4052('0x42')],'value':_0x51fc31[_0x4052('0x41')][_0x4052('0x36')]()});}else if(_0x51fc31[_0x4052('0x3e')]==='variable'&&_0x51fc31[_0x4052('0x45')]&&_0x51fc31[_0x4052('0x42')]&&_0x51fc31[_0x4052('0x43')]){_0x2e3202[_0x51fc31[_0x4052('0x45')]]&&_0x2b482f['custom_fields']['push']({'id':_0x51fc31[_0x4052('0x42')],'value':_0x2e3202[_0x51fc31[_0x4052('0x45')]]['toString']()});}else if(_0x51fc31[_0x4052('0x3e')]===_0x4052('0x46')&&_0x51fc31[_0x4052('0x47')]&&_0x51fc31[_0x4052('0x47')][_0x4052('0x18')]&&_0x51fc31[_0x4052('0x42')]&&_0x51fc31[_0x4052('0x43')]){_0x2e3202[_0x51fc31[_0x4052('0x47')][_0x4052('0x18')][_0x4052('0x48')]()]&&_0x2b482f[_0x4052('0x1a')][_0x4052('0x44')]({'id':_0x51fc31['idField'],'value':_0x2e3202[_0x51fc31[_0x4052('0x47')][_0x4052('0x18')][_0x4052('0x48')]()]['toString']()});}});}return _0x2b482f;}exports[_0x4052('0x49')]=function(_0x4c78e6,_0x4d5db8,_0x3b56a3,_0x2a44f8,_0x762071,_0x58c481){var _0xc0916d,_0xdf7161;_0x58c481[_0x4052('0x23')]=intUtil[_0x4052('0x4a')](_0x58c481[_0x4052('0x23')]);_0x58c481[_0x4052('0x4b')]=intUtil['stripTrailingSlash'](_0x58c481[_0x4052('0x4b')]);if(_0x762071&&_0x762071['monitor_format']){logger[_0x4052('0x1f')](_0x4052('0x4c'),_0x4052('0x4d'));_0x4d5db8['recordingURL']=util['format'](_0x4052('0x4e'),_0x58c481[_0x4052('0x4b')],_0x4d5db8[_0x4052('0x4f')],md5(_0x4d5db8[_0x4052('0x4f')]));}else{_0x4d5db8[_0x4052('0x50')]='';}headers[_0x4052('0x51')]=getAuth(_0x58c481);return getUser(_0x58c481,_0x2a44f8[_0x4052('0x28')])['then'](function(_0x45c7b8){_0xc0916d=_0x45c7b8;logger[_0x4052('0x1f')]('The\x20User\x20ID\x20is:',_0xc0916d['id']);return getEndUser(_0x58c481,_0x4d5db8['calleridname'],_0x4d5db8['calleridnum']);})[_0x4052('0x24')](function(_0x4f7185){_0xdf7161=_0x4f7185;logger[_0x4052('0x1f')](_0x4052('0x52'),_0xdf7161['id']);return getTicket(_0x58c481,_0xc0916d,_0xdf7161,_0x3b56a3,_0x4d5db8);})[_0x4052('0x24')](function(_0x1afc87){if(_0x1afc87&&_0x1afc87['id']){logger[_0x4052('0x1f')](_0x4052('0x20'));logger[_0x4052('0x1f')]('The\x20Ticket\x20ID\x20is:',_0x1afc87['id']);logger[_0x4052('0x1f')](_0x4052('0x4c'),_0x4052('0x53'));emit(util[_0x4052('0x10')](_0x4052('0x54'),_0x2a44f8[_0x4052('0x18')]),_0x4052('0x55'),{'uri':util[_0x4052('0x10')](_0x4052('0x56'),_0x58c481['remoteUri'],_0x1afc87['id'])});}})[_0x4052('0x57')](function(_0x2d24c7){logger[_0x4052('0x58')](_0x4052('0x4c'),JSON['stringify'](_0x2d24c7));});};exports[_0x4052('0x59')]=function(_0x16b9c4,_0x252111,_0x19e3e7,_0x51a41b,_0x7da0ee,_0x5e23ce,_0x182b49){var _0x480977,_0x32e3f4;_0x5e23ce[_0x4052('0x23')]=intUtil[_0x4052('0x4a')](_0x5e23ce['remoteUri']);_0x5e23ce[_0x4052('0x4b')]=intUtil['stripTrailingSlash'](_0x5e23ce[_0x4052('0x4b')]);if(_0x182b49&&_0x182b49[_0x4052('0x5a')]&&_0x182b49['recordingFormat']!=='none'){logger['info'](_0x4052('0x5b'),_0x4052('0x4d'));_0x252111[_0x4052('0x50')]=util['format'](_0x4052('0x4e'),_0x5e23ce[_0x4052('0x4b')],_0x252111[_0x4052('0x4f')],md5(_0x252111[_0x4052('0x4f')]));}headers[_0x4052('0x51')]=getAuth(_0x5e23ce);return getUser(_0x5e23ce,_0x51a41b[_0x4052('0x28')])[_0x4052('0x24')](function(_0x4ced66){_0x480977=_0x4ced66;logger[_0x4052('0x1f')](_0x4052('0x5c'),_0x480977['id']);return getEndUser(_0x5e23ce,_0x252111['destcalleridname'],_0x252111[_0x4052('0x5d')]);})[_0x4052('0x24')](function(_0x2e841d){_0x32e3f4=_0x2e841d;logger[_0x4052('0x1f')](_0x4052('0x52'),_0x32e3f4['id']);return getTicket(_0x5e23ce,_0x480977,_0x32e3f4,_0x19e3e7,_0x252111);})[_0x4052('0x24')](function(_0x5b447c){if(_0x5b447c&&_0x5b447c['id']){logger[_0x4052('0x1f')](_0x4052('0x20'));logger['info'](_0x4052('0x5e'),_0x5b447c['id']);logger['info'](_0x4052('0x5b'),_0x4052('0x53'));emit(util[_0x4052('0x10')](_0x4052('0x54'),_0x51a41b['name']),_0x4052('0x55'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x5e23ce['remoteUri'],_0x5b447c['id'])});}})['catch'](function(_0x412000){logger[_0x4052('0x58')]('[OUTBOUND]',JSON[_0x4052('0x3a')](_0x412000));});};exports['unmanaged']=function(_0x274f75,_0x5ad255,_0x3a7f4f,_0x4e47d0,_0x4ef871,_0x1f3b40){var _0xf77600,_0x3c8388;_0x1f3b40[_0x4052('0x23')]=intUtil[_0x4052('0x4a')](_0x1f3b40[_0x4052('0x23')]);_0x1f3b40['serverUrl']=intUtil[_0x4052('0x4a')](_0x1f3b40['serverUrl']);if(_0x4ef871&&_0x4ef871['monitor_format']){logger[_0x4052('0x1f')]('['+_0x5ad255[_0x4052('0x5f')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x5ad255[_0x4052('0x50')]=util[_0x4052('0x10')](_0x4052('0x4e'),_0x1f3b40[_0x4052('0x4b')],_0x5ad255[_0x4052('0x4f')],md5(_0x5ad255[_0x4052('0x4f')]));}else{_0x5ad255[_0x4052('0x50')]='';}headers[_0x4052('0x51')]=getAuth(_0x1f3b40);return getUser(_0x1f3b40,'')['then'](function(_0x550b3e){_0xf77600=_0x550b3e;logger[_0x4052('0x1f')](_0x4052('0x5c'),_0xf77600['id']);return getEndUser(_0x1f3b40,_0x5ad255['calleridname'],_0x5ad255[_0x4052('0x13')]);})[_0x4052('0x24')](function(_0x274f99){_0x3c8388=_0x274f99;logger[_0x4052('0x1f')](_0x4052('0x52'),_0x3c8388['id']);return getTicket(_0x1f3b40,_0xf77600,_0x3c8388,_0x3a7f4f,_0x5ad255);})[_0x4052('0x24')](function(_0x4435ca){if(_0x4435ca){logger[_0x4052('0x1f')]('Ticket\x20created!');logger[_0x4052('0x1f')](_0x4052('0x5e'),_0x4435ca['id']);}})['catch'](function(_0x20f23e){logger['error']('['+_0x5ad255[_0x4052('0x5f')][_0x4052('0x60')]()+']',JSON[_0x4052('0x3a')](_0x20f23e));});};
\ No newline at end of file
index aeec8fc..6024607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a9a=['/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','Getting\x20user\x20list','agentEmail','userId','User\x20found:','Admin\x20selected','error','/api/contacts/filters','filters','forEach','All\x20Contacts','/api/contacts/view/','contacts','find','work_number','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','contactNumber','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','/api/tasks','getString','Subjects','Descriptions','Contact','format','add','ticketId','task','Task\x20created:'];(function(_0x43cb07,_0x4efb96){var _0x54d9f8=function(_0x23fcd4){while(--_0x23fcd4){_0x43cb07['push'](_0x43cb07['shift']());}};_0x54d9f8(++_0x4efb96);}(_0x6a9a,0x1bd));var _0xa6a9=function(_0xa4c85,_0x2b52a7){_0xa4c85=_0xa4c85-0x0;var _0x172c1f=_0x6a9a[_0xa4c85];return _0x172c1f;};'use strict';var _=require(_0xa6a9('0x0'));var rp=require(_0xa6a9('0x1'));var md5=require('md5');var util=require(_0xa6a9('0x2'));var moment=require(_0xa6a9('0x3'));var Promise=require('bluebird');var Redis=require(_0xa6a9('0x4'));var intUtil=require('./util');var config=require(_0xa6a9('0x5'));var logger=require(_0xa6a9('0x6'))('freshsales');config[_0xa6a9('0x7')]=_[_0xa6a9('0x8')](config[_0xa6a9('0x7')],{'host':_0xa6a9('0x9'),'port':0x18eb});var io=require(_0xa6a9('0xa'))(new Redis(config[_0xa6a9('0x7')]));function getAdminId(_0x36823e,_0x21ecf2,_0x3c44e3,_0x173f79){return new Promise(function(_0x51a48b,_0x4eb380){var _0x2c140c=![];var _0xf898cb={'method':_0xa6a9('0xb'),'uri':_0x173f79+_0xa6a9('0xc'),'json':!![]};_0xf898cb[_0xa6a9('0xd')]=_0x3c44e3;logger[_0xa6a9('0xe')](_0xa6a9('0xf'));return rp(_0xf898cb)[_0xa6a9('0x10')](function(_0xd4e7e9){if(_0xd4e7e9){var _0x1c1d53=_0xd4e7e9[_0xa6a9('0x11')];var _0x4646d6=null;for(_0x4646d6=0x0;_0x4646d6<_0x1c1d53[_0xa6a9('0x12')];_0x4646d6++){if(_0x1c1d53[_0x4646d6][_0xa6a9('0x13')]===_0x36823e[_0xa6a9('0x14')]){_0x36823e[_0xa6a9('0x15')]=_0x1c1d53[_0x4646d6]['id'];_0x2c140c=!![];}}if(_0x2c140c){logger[_0xa6a9('0xe')](_0xa6a9('0x16'),_0x36823e[_0xa6a9('0x15')]);_0x51a48b(_0x36823e);}else{_0x4eb380({'statusCode':0x194,'message':_0xa6a9('0x17')});}}else{_0x4eb380({'statusCode':0x194,'message':_0xa6a9('0x17')});}})[_0xa6a9('0x18')](function(_0x4e26ea){logger['error']('['+[_0x21ecf2[_0xa6a9('0x19')]()]+']',_0x4e26ea[_0xa6a9('0x1a')]);_0x4eb380(_0x4e26ea);});});}function getUser(_0x2e676b,_0x82b9d,_0x523872){return function(_0x45037a){return new Promise(function(_0x5c46a5,_0x5415c7){var _0x36964d={'method':_0xa6a9('0xb'),'uri':_0x523872+_0xa6a9('0xc'),'json':!![]};_0x36964d[_0xa6a9('0xd')]=_0x82b9d;logger[_0xa6a9('0xe')](_0xa6a9('0x1b'));return rp(_0x36964d)['then'](function(_0x2a1f5f){if(_0x2a1f5f){var _0x21aa36=_0x2a1f5f[_0xa6a9('0x11')];var _0x4a4cc7=![];var _0x591347=null;if(_0x45037a[_0xa6a9('0x1c')]!==null){logger[_0xa6a9('0xe')]('Getting\x20user\x20with\x20email',_0x45037a[_0xa6a9('0x1c')]);_0x45037a['userEmail']=_0x45037a['agentEmail'];for(_0x591347=0x0;_0x591347<_0x21aa36[_0xa6a9('0x12')];_0x591347++){if(_0x21aa36[_0x591347][_0xa6a9('0x13')]===_0x45037a['agentEmail']){_0x4a4cc7=!![];_0x45037a[_0xa6a9('0x1d')]=_0x21aa36[_0x591347]['id'];logger[_0xa6a9('0xe')](_0xa6a9('0x1e'),_0x45037a[_0xa6a9('0x1d')]);}}}if(!_0x4a4cc7){logger[_0xa6a9('0xe')](_0xa6a9('0x1f'));_0x45037a['userEmail']=_0x45037a[_0xa6a9('0x14')];_0x45037a['userId']=_0x45037a['adminId'];_0x4a4cc7=!![];}if(_0x4a4cc7){_0x5c46a5(_0x45037a);}else{_0x5415c7({'statusCode':0x194,'message':_0xa6a9('0x17')});}}else{_0x5415c7({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xa6a9('0x18')](function(_0x40bb9e){logger[_0xa6a9('0x20')]('['+[_0x2e676b[_0xa6a9('0x19')]()]+']',_0x40bb9e[_0xa6a9('0x1a')]);_0x5415c7(_0x40bb9e);});});};}function getEndUser(_0x2f4835,_0x2fb9e7,_0x142628){return function(_0x474f35){return new Promise(function(_0x304ef6,_0x568ad8){var _0x30c843=0x0;var _0x59a42f={'method':_0xa6a9('0xb'),'uri':_0x142628+_0xa6a9('0x21'),'json':!![]};_0x59a42f[_0xa6a9('0xd')]=_0x2fb9e7;logger[_0xa6a9('0xe')]('Getting\x20contacts\x20filter');return rp(_0x59a42f)[_0xa6a9('0x10')](function(_0x2fd0cf){_0x2fd0cf[_0xa6a9('0x22')][_0xa6a9('0x23')](function(_0x237b8c){if(_0x237b8c['name']===_0xa6a9('0x24')){_0x30c843=_0x237b8c['id'];}});})[_0xa6a9('0x10')](function(){logger['info']('Getting\x20contact\x20list');var _0x1b7bd7={'method':_0xa6a9('0xb'),'uri':_0x142628+_0xa6a9('0x25')+_0x30c843,'json':!![]};_0x1b7bd7[_0xa6a9('0xd')]=_0x2fb9e7;return rp(_0x1b7bd7);})[_0xa6a9('0x10')](function(_0x56f756){logger[_0xa6a9('0xe')]('Searching\x20contact\x20with\x20phone',_0x474f35['contactNumber']);if(_0x56f756[_0xa6a9('0x26')][_0xa6a9('0x12')]>0x0){var _0x4bb289=_[_0xa6a9('0x27')](_0x56f756['contacts'],function(_0x1232f6){if(_0x1232f6[_0xa6a9('0x28')]===_0x474f35['contactNumber']||_0x1232f6[_0xa6a9('0x29')]===_0x474f35['contactNumber']){return _0x1232f6;}});if(_0x4bb289){_0x474f35[_0xa6a9('0x2a')]=_0x4bb289['id'];logger['info'](_0xa6a9('0x2b'),_0x474f35[_0xa6a9('0x2a')]);_0x304ef6(_0x474f35);}else{return createEndUser(_0x474f35,_0x2f4835,_0x2fb9e7,_0x142628)['then'](function(_0x582b55){logger[_0xa6a9('0xe')](_0xa6a9('0x2c'),_0x474f35[_0xa6a9('0x2a')]);_0x304ef6(_0x582b55);});}}else{return createEndUser(_0x474f35,_0x2f4835,_0x2fb9e7,_0x142628)[_0xa6a9('0x10')](function(_0x35a1e3){logger[_0xa6a9('0xe')](_0xa6a9('0x2c'),_0x474f35[_0xa6a9('0x2a')]);_0x304ef6(_0x35a1e3);});}})[_0xa6a9('0x18')](function(_0x491eba){throw new Error(_0x491eba[_0xa6a9('0x1a')]);});});};}function createEndUser(_0x674a51,_0x5b8728,_0x36187d,_0x20377b){return new Promise(function(_0x1494f1,_0x5a4207){var _0x117cc3=moment();var _0x801aa6={'method':_0xa6a9('0x2d'),'uri':_0x20377b+_0xa6a9('0x2e'),'body':{'contact':{'last_name':_0x674a51[_0xa6a9('0x2f')],'work_number':_0x674a51[_0xa6a9('0x2f')],'mobile_number':_0x674a51['contactNumber'],'owner_id':_0x674a51[_0xa6a9('0x1d')],'created_at':_0x117cc3['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x801aa6[_0xa6a9('0xd')]=_0x36187d;logger[_0xa6a9('0xe')](_0xa6a9('0x30'));return rp(_0x801aa6)['then'](function(_0x57fbc2){_0x674a51['endUserId']=_0x57fbc2['contact']['id'];_0x1494f1(_0x674a51);})[_0xa6a9('0x18')](function(_0x58a8cb){logger[_0xa6a9('0x20')]('['+[_0x5b8728[_0xa6a9('0x19')]()]+']',_0x58a8cb['message']);_0x5a4207(_0x58a8cb[_0xa6a9('0x1a')]);});});}function getTicket(_0x118947,_0x5e8d49,_0x3f8561,_0x1b7ae7,_0x4997ff){return function(_0x31bdc2){logger[_0xa6a9('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x47027e,_0x16c326){var _0x526cea=moment();var _0x5c554e={'method':_0xa6a9('0x2d'),'uri':_0x3f8561+_0xa6a9('0x31'),'body':{'title':intUtil[_0xa6a9('0x32')](_0x1b7ae7[_0xa6a9('0x33')],_0x4997ff,'\x20'),'description':intUtil['getString'](_0x1b7ae7[_0xa6a9('0x34')],_0x4997ff,'\x0a'),'owner_id':_0x31bdc2[_0xa6a9('0x1d')],'creater_id':_0x31bdc2[_0xa6a9('0x15')],'targetable_id':_0x31bdc2['endUserId'],'targetable_type':_0xa6a9('0x35'),'created_at':_0x526cea[_0xa6a9('0x36')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x526cea[_0xa6a9('0x37')](0x1e,'m')[_0xa6a9('0x36')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x5c554e[_0xa6a9('0xd')]=_0x5e8d49;return rp(_0x5c554e)[_0xa6a9('0x10')](function(_0x406940){_0x31bdc2[_0xa6a9('0x38')]=_0x406940[_0xa6a9('0x39')]['id'];logger[_0xa6a9('0xe')](_0xa6a9('0x3a'),_0x31bdc2['ticketId']);_0x47027e(_0x31bdc2);})[_0xa6a9('0x18')](function(_0x444708){logger[_0xa6a9('0x20')]('['+[_0x118947[_0xa6a9('0x19')]()]+']',_0x444708[_0xa6a9('0x1a')]);_0x16c326(_0x444708['message']);});});};}function emit(_0x48b75b,_0x105cd0,_0x2599e0){var _0x1395b9={'uri':_0x48b75b+_0xa6a9('0x3b')+_0x2599e0};io['to'](util[_0xa6a9('0x36')](_0xa6a9('0x3c'),_0x105cd0))[_0xa6a9('0x3d')]('trigger:browser:url',_0x1395b9);}exports['cs']=function(_0x3e59ba,_0x58dbe2,_0x3187e2,_0x44074a,_0xc4a54e,_0x42f59d,_0x159ff6,_0x47e54b){var _0x2f08ab={};var _0x3c082b={'Authorization':_0xa6a9('0x3e')+_0x42f59d[_0xa6a9('0x3f')]};_0x42f59d[_0xa6a9('0x40')]=intUtil[_0xa6a9('0x41')](_0x42f59d[_0xa6a9('0x40')]);_0x42f59d['serverUrl']=intUtil[_0xa6a9('0x41')](_0x42f59d[_0xa6a9('0x42')]);var _0x6fa535=_0x42f59d[_0xa6a9('0x40')];_0x2f08ab['adminEmail']=_0x42f59d[_0xa6a9('0x43')];_0x2f08ab['contactNumber']=_0x47e54b['toLowerCase']()===_0xa6a9('0x44')?_0x58dbe2[_0xa6a9('0x45')]:_0x58dbe2[_0xa6a9('0x46')];_0x2f08ab[_0xa6a9('0x47')]=_0x47e54b===_0xa6a9('0x48')||_0x47e54b===_0xa6a9('0x49')?_0xa6a9('0x48'):_0xa6a9('0x44');if(_0x44074a){_0x2f08ab['agentEmail']=_0x44074a['email'];}var _0x18153a=util[_0xa6a9('0x36')](_0xa6a9('0x4a'),_0x42f59d[_0xa6a9('0x42')],_0x58dbe2[_0xa6a9('0x4b')],md5(_0x58dbe2[_0xa6a9('0x4b')]));if(_0xc4a54e&&_0xc4a54e['monitor_format']){logger[_0xa6a9('0xe')](_0xa6a9('0x4c'),_0xa6a9('0x4d'));_0x58dbe2[_0xa6a9('0x4e')]=_0x18153a;}else if(_0x159ff6&&_0x159ff6[_0xa6a9('0x4f')]&&_0x159ff6['recordingFormat']!==_0xa6a9('0x50')){logger['info']('[OUTBOUND]',_0xa6a9('0x4d'));_0x58dbe2['recordingURL']=_0x18153a;}else{_0x58dbe2['recordingURL']='';}return getAdminId(_0x2f08ab,_0x47e54b,_0x3c082b,_0x6fa535)[_0xa6a9('0x10')](getUser(_0x47e54b,_0x3c082b,_0x6fa535))['then'](getEndUser(_0x47e54b,_0x3c082b,_0x6fa535))[_0xa6a9('0x10')](getTicket(_0x47e54b,_0x3c082b,_0x6fa535,_0x3187e2,_0x58dbe2))[_0xa6a9('0x10')](function(_0x141d3e){logger[_0xa6a9('0xe')](util[_0xa6a9('0x36')](_0xa6a9('0x51'),_0x141d3e[_0xa6a9('0x38')]));if(_0x47e54b!=='unmanaged'){logger[_0xa6a9('0xe')]('['+[_0x47e54b['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x6fa535,_0x44074a[_0xa6a9('0x52')],_0x141d3e['endUserId']);}})[_0xa6a9('0x18')](function(_0x4ba0d2){logger[_0xa6a9('0x20')]('['+[_0x47e54b[_0xa6a9('0x19')]()]+_0xa6a9('0x53'),util['inspect'](_0x4ba0d2,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x513f=['find','work_number','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','format','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','ticketId','/contacts/','user:%s','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','headers','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','info','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','/api/selector/owners','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','email','userId','User\x20found:','userEmail','error','message','/api/contacts/filters','Getting\x20contacts\x20filter','filters','forEach','name','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts'];(function(_0x5d2d01,_0x2b2941){var _0x3ddbfb=function(_0x14f3d6){while(--_0x14f3d6){_0x5d2d01['push'](_0x5d2d01['shift']());}};_0x3ddbfb(++_0x2b2941);}(_0x513f,0x85));var _0xf513=function(_0xf9c85b,_0x59c5c4){_0xf9c85b=_0xf9c85b-0x0;var _0x4231de=_0x513f[_0xf9c85b];return _0x4231de;};'use strict';var _=require(_0xf513('0x0'));var rp=require(_0xf513('0x1'));var md5=require(_0xf513('0x2'));var util=require(_0xf513('0x3'));var moment=require('moment');var Promise=require(_0xf513('0x4'));var Redis=require(_0xf513('0x5'));var intUtil=require('./util');var config=require(_0xf513('0x6'));var logger=require(_0xf513('0x7'))(_0xf513('0x8'));config[_0xf513('0x9')]=_[_0xf513('0xa')](config[_0xf513('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xf513('0xb'))(new Redis(config[_0xf513('0x9')]));function getAdminId(_0x59533d,_0x1dc11d,_0x32eb68,_0x2eed6b){return new Promise(function(_0x994565,_0x58e3e9){var _0x3f3b7c=![];var _0x2431cd={'method':_0xf513('0xc'),'uri':_0x2eed6b+'/api/selector/owners','json':!![]};_0x2431cd[_0xf513('0xd')]=_0x32eb68;logger['info'](_0xf513('0xe'));return rp(_0x2431cd)[_0xf513('0xf')](function(_0x5af835){if(_0x5af835){var _0x1c5cea=_0x5af835[_0xf513('0x10')];var _0x47d464=null;for(_0x47d464=0x0;_0x47d464<_0x1c5cea[_0xf513('0x11')];_0x47d464++){if(_0x1c5cea[_0x47d464]['email']===_0x59533d[_0xf513('0x12')]){_0x59533d[_0xf513('0x13')]=_0x1c5cea[_0x47d464]['id'];_0x3f3b7c=!![];}}if(_0x3f3b7c){logger[_0xf513('0x14')]('Admin\x20found:',_0x59533d[_0xf513('0x13')]);_0x994565(_0x59533d);}else{_0x58e3e9({'statusCode':0x194,'message':_0xf513('0x15')});}}else{_0x58e3e9({'statusCode':0x194,'message':_0xf513('0x15')});}})[_0xf513('0x16')](function(_0x2da2ca){logger['error']('['+[_0x1dc11d[_0xf513('0x17')]()]+']',_0x2da2ca['message']);_0x58e3e9(_0x2da2ca);});});}function getUser(_0x1d04d1,_0x7903c3,_0x2be5fc){return function(_0x440d89){return new Promise(function(_0xde365f,_0x30849a){var _0xaf5445={'method':_0xf513('0xc'),'uri':_0x2be5fc+_0xf513('0x18'),'json':!![]};_0xaf5445[_0xf513('0xd')]=_0x7903c3;logger[_0xf513('0x14')](_0xf513('0x19'));return rp(_0xaf5445)['then'](function(_0x5dc508){if(_0x5dc508){var _0x309f8e=_0x5dc508[_0xf513('0x10')];var _0x331aa9=![];var _0x33bfc2=null;if(_0x440d89['agentEmail']!==null){logger[_0xf513('0x14')](_0xf513('0x1a'),_0x440d89[_0xf513('0x1b')]);_0x440d89['userEmail']=_0x440d89['agentEmail'];for(_0x33bfc2=0x0;_0x33bfc2<_0x309f8e[_0xf513('0x11')];_0x33bfc2++){if(_0x309f8e[_0x33bfc2][_0xf513('0x1c')]===_0x440d89[_0xf513('0x1b')]){_0x331aa9=!![];_0x440d89[_0xf513('0x1d')]=_0x309f8e[_0x33bfc2]['id'];logger['info'](_0xf513('0x1e'),_0x440d89[_0xf513('0x1d')]);}}}if(!_0x331aa9){logger[_0xf513('0x14')]('Admin\x20selected');_0x440d89[_0xf513('0x1f')]=_0x440d89['adminEmail'];_0x440d89[_0xf513('0x1d')]=_0x440d89[_0xf513('0x13')];_0x331aa9=!![];}if(_0x331aa9){_0xde365f(_0x440d89);}else{_0x30849a({'statusCode':0x194,'message':_0xf513('0x15')});}}else{_0x30849a({'statusCode':0x194,'message':_0xf513('0x15')});}})[_0xf513('0x16')](function(_0x2d6364){logger[_0xf513('0x20')]('['+[_0x1d04d1[_0xf513('0x17')]()]+']',_0x2d6364[_0xf513('0x21')]);_0x30849a(_0x2d6364);});});};}function getEndUser(_0x4138cd,_0x47aa3a,_0x186c40){return function(_0x20e8e2){return new Promise(function(_0x2c884c,_0x48d078){var _0x589c00=0x0;var _0x56a6ee={'method':_0xf513('0xc'),'uri':_0x186c40+_0xf513('0x22'),'json':!![]};_0x56a6ee[_0xf513('0xd')]=_0x47aa3a;logger[_0xf513('0x14')](_0xf513('0x23'));return rp(_0x56a6ee)['then'](function(_0x599059){_0x599059[_0xf513('0x24')][_0xf513('0x25')](function(_0xa914ed){if(_0xa914ed[_0xf513('0x26')]===_0xf513('0x27')){_0x589c00=_0xa914ed['id'];}});})[_0xf513('0xf')](function(){logger['info'](_0xf513('0x28'));var _0x1e0e5c={'method':_0xf513('0xc'),'uri':_0x186c40+_0xf513('0x29')+_0x589c00,'json':!![]};_0x1e0e5c[_0xf513('0xd')]=_0x47aa3a;return rp(_0x1e0e5c);})[_0xf513('0xf')](function(_0x20987e){logger['info'](_0xf513('0x2a'),_0x20e8e2[_0xf513('0x2b')]);if(_0x20987e[_0xf513('0x2c')]['length']>0x0){var _0x225622=_[_0xf513('0x2d')](_0x20987e['contacts'],function(_0x560406){if(_0x560406[_0xf513('0x2e')]===_0x20e8e2['contactNumber']||_0x560406[_0xf513('0x2f')]===_0x20e8e2[_0xf513('0x2b')]){return _0x560406;}});if(_0x225622){_0x20e8e2[_0xf513('0x30')]=_0x225622['id'];logger[_0xf513('0x14')](_0xf513('0x31'),_0x20e8e2[_0xf513('0x30')]);_0x2c884c(_0x20e8e2);}else{return createEndUser(_0x20e8e2,_0x4138cd,_0x47aa3a,_0x186c40)[_0xf513('0xf')](function(_0x59565c){logger[_0xf513('0x14')](_0xf513('0x32'),_0x20e8e2['endUserId']);_0x2c884c(_0x59565c);});}}else{return createEndUser(_0x20e8e2,_0x4138cd,_0x47aa3a,_0x186c40)[_0xf513('0xf')](function(_0x7306f4){logger['info'](_0xf513('0x32'),_0x20e8e2[_0xf513('0x30')]);_0x2c884c(_0x7306f4);});}})['catch'](function(_0x4db7cf){throw new Error(_0x4db7cf[_0xf513('0x21')]);});});};}function createEndUser(_0x2cfab7,_0x2d7a7a,_0x6d4f39,_0x51b935){return new Promise(function(_0x1be18e,_0x215f5f){var _0xf3cd29=moment();var _0xf3af1e={'method':_0xf513('0x33'),'uri':_0x51b935+_0xf513('0x34'),'body':{'contact':{'last_name':_0x2cfab7[_0xf513('0x2b')],'work_number':_0x2cfab7[_0xf513('0x2b')],'mobile_number':_0x2cfab7[_0xf513('0x2b')],'owner_id':_0x2cfab7[_0xf513('0x1d')],'created_at':_0xf3cd29[_0xf513('0x35')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0xf3af1e[_0xf513('0xd')]=_0x6d4f39;logger[_0xf513('0x14')](_0xf513('0x36'));return rp(_0xf3af1e)['then'](function(_0x152e0f){_0x2cfab7[_0xf513('0x30')]=_0x152e0f[_0xf513('0x37')]['id'];_0x1be18e(_0x2cfab7);})[_0xf513('0x16')](function(_0x2e5e1e){logger['error']('['+[_0x2d7a7a[_0xf513('0x17')]()]+']',_0x2e5e1e['message']);_0x215f5f(_0x2e5e1e['message']);});});}function getTicket(_0x123468,_0x4f2721,_0x18b892,_0x422f83,_0x1c02b6){return function(_0x3283d9){logger[_0xf513('0x14')](_0xf513('0x38'));return new Promise(function(_0x1da969,_0x135897){var _0x5c2bf0=moment();var _0x5108cc={'method':_0xf513('0x33'),'uri':_0x18b892+_0xf513('0x39'),'body':{'title':intUtil['getString'](_0x422f83['Subjects'],_0x1c02b6,'\x20'),'description':intUtil[_0xf513('0x3a')](_0x422f83[_0xf513('0x3b')],_0x1c02b6,'\x0a'),'owner_id':_0x3283d9[_0xf513('0x1d')],'creater_id':_0x3283d9['adminId'],'targetable_id':_0x3283d9[_0xf513('0x30')],'targetable_type':_0xf513('0x3c'),'created_at':_0x5c2bf0[_0xf513('0x35')](_0xf513('0x3d')),'due_date':_0x5c2bf0['add'](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x5108cc['headers']=_0x4f2721;return rp(_0x5108cc)[_0xf513('0xf')](function(_0x246d27){_0x3283d9[_0xf513('0x3e')]=_0x246d27['task']['id'];logger[_0xf513('0x14')]('Task\x20created:',_0x3283d9['ticketId']);_0x1da969(_0x3283d9);})[_0xf513('0x16')](function(_0x2e133a){logger[_0xf513('0x20')]('['+[_0x123468['toUpperCase']()]+']',_0x2e133a[_0xf513('0x21')]);_0x135897(_0x2e133a['message']);});});};}function emit(_0x83030a,_0x2a9656,_0x3e5860){var _0x5d3321={'uri':_0x83030a+_0xf513('0x3f')+_0x3e5860};io['to'](util[_0xf513('0x35')](_0xf513('0x40'),_0x2a9656))['emit']('trigger:browser:url',_0x5d3321);}exports['cs']=function(_0x559be1,_0x349b9e,_0x4a4644,_0x19867d,_0x228b7d,_0x31f59d,_0x1089c9,_0x15c81d){var _0x29f874={};var _0x4d91ab={'Authorization':_0xf513('0x41')+_0x31f59d[_0xf513('0x42')]};_0x31f59d['remoteUri']=intUtil[_0xf513('0x43')](_0x31f59d[_0xf513('0x44')]);_0x31f59d[_0xf513('0x45')]=intUtil[_0xf513('0x43')](_0x31f59d['serverUrl']);var _0x137104=_0x31f59d[_0xf513('0x44')];_0x29f874[_0xf513('0x12')]=_0x31f59d[_0xf513('0x46')];_0x29f874[_0xf513('0x2b')]=_0x15c81d[_0xf513('0x47')]()===_0xf513('0x48')?_0x349b9e[_0xf513('0x49')]:_0x349b9e[_0xf513('0x4a')];_0x29f874['callDirection']=_0x15c81d===_0xf513('0x4b')||_0x15c81d===_0xf513('0x4c')?_0xf513('0x4b'):_0xf513('0x48');if(_0x19867d){_0x29f874[_0xf513('0x1b')]=_0x19867d['email'];}var _0x1ad047=util[_0xf513('0x35')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x31f59d[_0xf513('0x45')],_0x349b9e[_0xf513('0x4d')],md5(_0x349b9e['uniqueid']));if(_0x228b7d&&_0x228b7d[_0xf513('0x4e')]){logger[_0xf513('0x14')](_0xf513('0x4f'),_0xf513('0x50'));_0x349b9e[_0xf513('0x51')]=_0x1ad047;}else if(_0x1089c9&&_0x1089c9[_0xf513('0x52')]&&_0x1089c9['recordingFormat']!==_0xf513('0x53')){logger[_0xf513('0x14')](_0xf513('0x54'),_0xf513('0x50'));_0x349b9e[_0xf513('0x51')]=_0x1ad047;}else{_0x349b9e[_0xf513('0x51')]='';}return getAdminId(_0x29f874,_0x15c81d,_0x4d91ab,_0x137104)[_0xf513('0xf')](getUser(_0x15c81d,_0x4d91ab,_0x137104))[_0xf513('0xf')](getEndUser(_0x15c81d,_0x4d91ab,_0x137104))[_0xf513('0xf')](getTicket(_0x15c81d,_0x4d91ab,_0x137104,_0x4a4644,_0x349b9e))[_0xf513('0xf')](function(_0x20fbe8){logger[_0xf513('0x14')](util['format'](_0xf513('0x55'),_0x20fbe8[_0xf513('0x3e')]));if(_0x15c81d!=='unmanaged'){logger[_0xf513('0x14')]('['+[_0x15c81d[_0xf513('0x17')]()]+']',_0xf513('0x56'));emit(_0x137104,_0x19867d[_0xf513('0x26')],_0x20fbe8[_0xf513('0x30')]);}})[_0xf513('0x16')](function(_0x59b628){logger['error']('['+[_0x15c81d[_0xf513('0x17')]()]+_0xf513('0x57'),util[_0xf513('0x58')](_0x59b628,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 7b1f5e5..60c8aab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea28=['error','data2','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','toLowerCase','data1','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','../../../../config/logger','[EXEC]','format'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xea28,0x13a));var _0x8ea2=function(_0xe8ec19,_0x5dd614){_0xe8ec19=_0xe8ec19-0x0;var _0x232c53=_0xea28[_0xe8ec19];return _0x232c53;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var zendesk=require(_0x8ea2('0x2'));var salesforce=require(_0x8ea2('0x3'));var sugarcrm=require(_0x8ea2('0x4'));var freshdesk=require(_0x8ea2('0x5'));var zoho=require(_0x8ea2('0x6'));var desk=require(_0x8ea2('0x7'));var vtiger=require('./vtiger');var servicenow=require(_0x8ea2('0x8'));var dynamics365=require(_0x8ea2('0x9'));var freshsales=require(_0x8ea2('0xa'));var integrations=['zendesk',_0x8ea2('0xb'),_0x8ea2('0xc'),_0x8ea2('0xd'),_0x8ea2('0xe'),_0x8ea2('0xf'),_0x8ea2('0x10'),_0x8ea2('0x11'),_0x8ea2('0x12'),_0x8ea2('0x13')];exports[_0x8ea2('0x14')]=function(_0x3d0b35,_0x21ae3d,_0x500b82,_0x4da3b1,_0x4722f3,_0x2ac9be){if(_0x500b82){if(_[_0x8ea2('0x15')](integrations,_0x3d0b35['data1'][_0x8ea2('0x16')]())){try{var _0x101a15=null;var _0x1dfb6e='';var _0x10aead=_0x500b82[_0x3d0b35[_0x8ea2('0x17')]['toLowerCase']()];if(_0x10aead){var _0x2879d6=_0x10aead[_0x3d0b35['data2']];if(_0x2879d6){var _0x4b2192=_[_0x8ea2('0x18')](_0x2879d6[_0x8ea2('0x19')],{'id':parseInt(_0x3d0b35[_0x8ea2('0x1a')],0xa)});if(_0x4b2192){if(_0x4da3b1){if(_0x4722f3&&_0x21ae3d[_0x8ea2('0x1b')]){_0x1dfb6e=_0x8ea2('0x1b');}else if(_0x21ae3d[_0x8ea2('0x1c')]){_0x1dfb6e=_0x8ea2('0x1d');}else{console[_0x8ea2('0x1e')](_0x8ea2('0x1f'),_0x21ae3d);}}else{_0x1dfb6e=_0x8ea2('0x20');}switch(_0x3d0b35[_0x8ea2('0x17')][_0x8ea2('0x16')]()){case _0x8ea2('0x21'):zendesk[_0x1dfb6e](_0x3d0b35,_0x21ae3d,_0x4b2192,_0x4da3b1,_0x4722f3,_0x2879d6,_0x2ac9be);break;case _0x8ea2('0xb'):salesforce[_0x1dfb6e](_0x3d0b35,_0x21ae3d,_0x4b2192,_0x4da3b1,_0x4722f3,_0x2879d6,_0x2ac9be);break;case _0x8ea2('0xc'):sugarcrm[_0x1dfb6e](_0x3d0b35,_0x21ae3d,_0x4b2192,_0x4da3b1,_0x4722f3,_0x2879d6,_0x2ac9be);break;case _0x8ea2('0xd'):freshdesk[_0x1dfb6e](_0x3d0b35,_0x21ae3d,_0x4b2192,_0x4da3b1,_0x4722f3,_0x2879d6,_0x2ac9be);break;case _0x8ea2('0xe'):zoho[_0x1dfb6e](_0x3d0b35,_0x21ae3d,_0x4b2192,_0x4da3b1,_0x4722f3,_0x2879d6,_0x2ac9be);break;case _0x8ea2('0xf'):desk[_0x1dfb6e](_0x3d0b35,_0x21ae3d,_0x4b2192,_0x4da3b1,_0x4722f3,_0x2879d6,_0x2ac9be);break;case _0x8ea2('0x10'):vtiger[_0x1dfb6e](_0x3d0b35,_0x21ae3d,_0x4b2192,_0x4da3b1,_0x4722f3,_0x2879d6,_0x2ac9be);break;case _0x8ea2('0x12'):freshsales['cs'](_0x3d0b35,_0x21ae3d,_0x4b2192,_0x4da3b1,_0x4722f3,_0x2879d6,_0x2ac9be,_0x1dfb6e);break;case _0x8ea2('0x13'):servicenow['cs'](_0x3d0b35,_0x21ae3d,_0x4b2192,_0x4da3b1,_0x4722f3,_0x2879d6,_0x2ac9be,_0x1dfb6e);break;case _0x8ea2('0x11'):dynamics365['cs'](_0x3d0b35,_0x21ae3d,_0x4b2192,_0x4da3b1,_0x4722f3,_0x2879d6,_0x2ac9be,_0x1dfb6e);break;default:console['log']('unknown\x20integration');}}else{_0x101a15=require(_0x8ea2('0x22'))(_0x3d0b35[_0x8ea2('0x17')][_0x8ea2('0x16')]());_0x101a15['error'](_0x8ea2('0x23'),util[_0x8ea2('0x24')]('%s\x20configuration\x20#%s\x20not\x20found',_0x3d0b35[_0x8ea2('0x17')][_0x8ea2('0x16')](),_0x3d0b35[_0x8ea2('0x1a')]));}}else{_0x101a15=require(_0x8ea2('0x22'))(_0x3d0b35[_0x8ea2('0x17')][_0x8ea2('0x16')]());_0x101a15[_0x8ea2('0x25')](_0x8ea2('0x23'),util[_0x8ea2('0x24')]('%s\x20account\x20#%s\x20not\x20found',_0x3d0b35[_0x8ea2('0x17')]['toLowerCase'](),_0x3d0b35[_0x8ea2('0x26')]));}}else{}}catch(_0x42bec8){console[_0x8ea2('0x25')](_0x42bec8);}}}};
\ No newline at end of file
+var _0xda2d=['../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','servicenow','includes','data1','toLowerCase','data2','find','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','dynamics365','unknown\x20integration'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xda2d,0x102));var _0xdda2=function(_0x5258b7,_0x200e32){_0x5258b7=_0x5258b7-0x0;var _0x4d373c=_0xda2d[_0x5258b7];return _0x4d373c;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var zendesk=require(_0xdda2('0x1'));var salesforce=require(_0xdda2('0x2'));var sugarcrm=require(_0xdda2('0x3'));var freshdesk=require(_0xdda2('0x4'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0xdda2('0x5'));var dynamics365=require(_0xdda2('0x6'));var freshsales=require(_0xdda2('0x7'));var integrations=[_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'dynamics365',_0xdda2('0xf'),_0xdda2('0x10')];exports['exec']=function(_0x1c11b2,_0x2f3454,_0x42d990,_0x346119,_0x171123,_0x30ca9a){if(_0x42d990){if(_[_0xdda2('0x11')](integrations,_0x1c11b2[_0xdda2('0x12')]['toLowerCase']())){try{var _0x4f8d71=null;var _0x56d25d='';var _0xa6446b=_0x42d990[_0x1c11b2[_0xdda2('0x12')][_0xdda2('0x13')]()];if(_0xa6446b){var _0x1503a7=_0xa6446b[_0x1c11b2[_0xdda2('0x14')]];if(_0x1503a7){var _0x475222=_[_0xdda2('0x15')](_0x1503a7['Configurations'],{'id':parseInt(_0x1c11b2[_0xdda2('0x16')],0xa)});if(_0x475222){if(_0x346119){if(_0x171123&&_0x2f3454['queue']){_0x56d25d=_0xdda2('0x17');}else if(_0x2f3454[_0xdda2('0x18')]){_0x56d25d=_0xdda2('0x19');}else{console[_0xdda2('0x1a')](_0xdda2('0x1b'),_0x2f3454);}}else{_0x56d25d='unmanaged';}switch(_0x1c11b2['data1'][_0xdda2('0x13')]()){case'zendesk':zendesk[_0x56d25d](_0x1c11b2,_0x2f3454,_0x475222,_0x346119,_0x171123,_0x1503a7,_0x30ca9a);break;case _0xdda2('0x9'):salesforce[_0x56d25d](_0x1c11b2,_0x2f3454,_0x475222,_0x346119,_0x171123,_0x1503a7,_0x30ca9a);break;case _0xdda2('0xa'):sugarcrm[_0x56d25d](_0x1c11b2,_0x2f3454,_0x475222,_0x346119,_0x171123,_0x1503a7,_0x30ca9a);break;case _0xdda2('0xb'):freshdesk[_0x56d25d](_0x1c11b2,_0x2f3454,_0x475222,_0x346119,_0x171123,_0x1503a7,_0x30ca9a);break;case _0xdda2('0xc'):zoho[_0x56d25d](_0x1c11b2,_0x2f3454,_0x475222,_0x346119,_0x171123,_0x1503a7,_0x30ca9a);break;case _0xdda2('0xd'):desk[_0x56d25d](_0x1c11b2,_0x2f3454,_0x475222,_0x346119,_0x171123,_0x1503a7,_0x30ca9a);break;case _0xdda2('0xe'):vtiger[_0x56d25d](_0x1c11b2,_0x2f3454,_0x475222,_0x346119,_0x171123,_0x1503a7,_0x30ca9a);break;case _0xdda2('0xf'):freshsales['cs'](_0x1c11b2,_0x2f3454,_0x475222,_0x346119,_0x171123,_0x1503a7,_0x30ca9a,_0x56d25d);break;case _0xdda2('0x10'):servicenow['cs'](_0x1c11b2,_0x2f3454,_0x475222,_0x346119,_0x171123,_0x1503a7,_0x30ca9a,_0x56d25d);break;case _0xdda2('0x1c'):dynamics365['cs'](_0x1c11b2,_0x2f3454,_0x475222,_0x346119,_0x171123,_0x1503a7,_0x30ca9a,_0x56d25d);break;default:console[_0xdda2('0x1a')](_0xdda2('0x1d'));}}else{_0x4f8d71=require(_0xdda2('0x1e'))(_0x1c11b2['data1'][_0xdda2('0x13')]());_0x4f8d71['error'](_0xdda2('0x1f'),util[_0xdda2('0x20')](_0xdda2('0x21'),_0x1c11b2['data1'][_0xdda2('0x13')](),_0x1c11b2['data3']));}}else{_0x4f8d71=require(_0xdda2('0x1e'))(_0x1c11b2[_0xdda2('0x12')]['toLowerCase']());_0x4f8d71[_0xdda2('0x22')](_0xdda2('0x1f'),util[_0xdda2('0x20')](_0xdda2('0x23'),_0x1c11b2[_0xdda2('0x12')]['toLowerCase'](),_0x1c11b2[_0xdda2('0x14')]));}}else{}}catch(_0x4be5ea){console[_0xdda2('0x22')](_0x4be5ea);}}}};
\ No newline at end of file
index 916a830..191f8a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3f6=['[QUEUE]','stringify','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','ticketType','assign','getString','Case','Subjects','Descriptions','ContactId','sobject','isNil','validateEmail','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','Task','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','Contact','contact','lead','Enduser\x20with\x20phone\x20%s\x20found.','<unknown>','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','create','type','string','idField','content','variable','variableName','name','Variable','toLowerCase','toString','password','concat','securityToken','Connection','clientSecret','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch'];(function(_0x27f7ca,_0x218bf1){var _0x3275b3=function(_0x2b08f7){while(--_0x2b08f7){_0x27f7ca['push'](_0x27f7ca['shift']());}};_0x3275b3(++_0x218bf1);}(_0xc3f6,0xdf));var _0x6c3f=function(_0x50b14d,_0x5f27d6){_0x50b14d=_0x50b14d-0x0;var _0x29ed0a=_0xc3f6[_0x50b14d];return _0x29ed0a;};'use strict';var _=require(_0x6c3f('0x0'));var rp=require('request-promise');var moment=require(_0x6c3f('0x1'));var BPromise=require(_0x6c3f('0x2'));var md5=require(_0x6c3f('0x3'));var jsforce=require(_0x6c3f('0x4'));var util=require(_0x6c3f('0x5'));var Redis=require(_0x6c3f('0x6'));var intUtil=require(_0x6c3f('0x7'));var config=require('../../../../config/environment');var logger=require(_0x6c3f('0x8'))(_0x6c3f('0x9'));config[_0x6c3f('0xa')]=_[_0x6c3f('0xb')](config[_0x6c3f('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x6c3f('0xc'))(new Redis(config[_0x6c3f('0xa')]));function emit(_0xde54b8,_0x21e57f,_0x3bbb84){io['to'](_0xde54b8)['emit'](_0x21e57f,_0x3bbb84);}function getTicket(_0x376028,_0xa63a1b,_0x1917f5,_0x296591,_0x1a174a,_0x4cb297,_0x45eb3c,_0x3e7305){var _0x4e4d7d={};if(_0x296591[_0x6c3f('0xd')]==='Task'){_0x4e4d7d=Object[_0x6c3f('0xe')]({},{'OwnerId':_0xa63a1b['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x6c3f('0xf')](_0x296591['Subjects'],_0x1a174a,'\x20'),'Description':intUtil[_0x6c3f('0xf')](_0x296591['Descriptions'],_0x1a174a,'\x0a')},getCustomFields(_0x4cb297,_0x1a174a));if(_0x1917f5){_0x4e4d7d['WhoId']=_0x1917f5['id'];}}else if(_0x296591[_0x6c3f('0xd')]===_0x6c3f('0x10')){_0x4e4d7d=Object[_0x6c3f('0xe')]({},{'OwnerId':_0xa63a1b['id'],'Subject':intUtil[_0x6c3f('0xf')](_0x296591[_0x6c3f('0x11')],_0x1a174a,'\x20'),'Description':intUtil[_0x6c3f('0xf')](_0x296591[_0x6c3f('0x12')],_0x1a174a,'\x0a')},getCustomFields(_0x4cb297,_0x1a174a));if(_0x1917f5){_0x4e4d7d[_0x6c3f('0x13')]=_0x1917f5['id'];}}return _0x45eb3c[_0x6c3f('0x14')](_0x296591[_0x6c3f('0xd')])['create'](_0x4e4d7d);}function getUser(_0x319f48,_0x34542b,_0x1c7e55){if(!_[_0x6c3f('0x15')](_0x34542b)&&intUtil[_0x6c3f('0x16')](_0x34542b)){var _0x1d7339={'Email':_0x34542b};var _0x12e2ad={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1c7e55[_0x6c3f('0x14')]('User')[_0x6c3f('0x17')](_0x1d7339,_0x12e2ad)[_0x6c3f('0x18')]()[_0x6c3f('0x19')](function(_0xaa2d07){if(_0xaa2d07[_0x6c3f('0x1a')]){var _0x568ae8=_[_0x6c3f('0x17')](_0xaa2d07,function(_0x38f45d){return _0x38f45d[_0x6c3f('0x1b')]===_0x34542b;});if(_0x568ae8){logger['info'](_0x6c3f('0x1c'),_0x34542b);return BPromise[_0x6c3f('0x1d')]({'id':_0x568ae8['Id'],'name':_0x568ae8[_0x6c3f('0x1e')]});}}else{logger[_0x6c3f('0x1f')](_0x6c3f('0x20'),_0x34542b);return _0x1c7e55['identity']()[_0x6c3f('0x19')](function(_0x646593){return BPromise[_0x6c3f('0x1d')]({'id':_0x646593[_0x6c3f('0x21')],'name':_0x646593[_0x6c3f('0x22')]});});}});}else{logger['info'](_0x6c3f('0x20'),_0x34542b);return _0x1c7e55[_0x6c3f('0x23')]()[_0x6c3f('0x19')](function(_0x2eace5){return BPromise[_0x6c3f('0x1d')]({'id':_0x2eace5[_0x6c3f('0x21')],'name':_0x2eace5[_0x6c3f('0x22')]});});}}function getEndUser(_0x45d856,_0x446466,_0x4e802a,_0x4bfecb,_0x4a70e7){var _0x3147ba={'Phone':_0x4bfecb};var _0x26f873={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6c3f('0x1d')]()['then'](function(){if(_0x446466[_0x6c3f('0xd')]===_0x6c3f('0x24')){logger['info'](_0x6c3f('0x25'),_0x4bfecb,_0x446466['moduleSearch']);switch(_0x446466['moduleSearch']){case _0x6c3f('0x26'):return _0x4a70e7[_0x6c3f('0x14')](_0x6c3f('0x27'))[_0x6c3f('0x17')](_0x3147ba,_0x26f873)[_0x6c3f('0x18')]()[_0x6c3f('0x19')](function(_0x2fb524){if(_0x2fb524&&_0x2fb524[_0x6c3f('0x1a')]){return _0x2fb524;}else{return _0x4a70e7[_0x6c3f('0x14')]('Lead')['find'](_0x3147ba,_0x26f873);}});case _0x6c3f('0x28'):return _0x4a70e7[_0x6c3f('0x14')](_0x6c3f('0x27'))[_0x6c3f('0x17')](_0x3147ba,_0x26f873)[_0x6c3f('0x18')]();case _0x6c3f('0x29'):return _0x4a70e7[_0x6c3f('0x14')]('Lead')['find'](_0x3147ba,_0x26f873);default:return null;}}else if(_0x446466[_0x6c3f('0xd')]==='Case'){logger[_0x6c3f('0x1f')](_0x6c3f('0x25'),_0x4bfecb,_0x6c3f('0x28'));return _0x4a70e7[_0x6c3f('0x14')]('Contact')[_0x6c3f('0x17')](_0x3147ba,_0x26f873)[_0x6c3f('0x18')]();}})[_0x6c3f('0x19')](function(_0x5b97da){if(_0x5b97da&&_0x5b97da[_0x6c3f('0x1a')]){var _0x4192c9=_['find'](_0x5b97da,function(_0x15b67c){return _0x15b67c['Phone']===_0x4bfecb;});if(_0x4192c9){return BPromise[_0x6c3f('0x1d')]({'id':_0x4192c9['Id'],'name':_0x4192c9[_0x6c3f('0x1e')],'phone':_0x4192c9['Phone']});}}})['then'](function(_0x498383){if(_0x498383){logger[_0x6c3f('0x1f')](_0x6c3f('0x2a'),_0x4bfecb);return BPromise['resolve'](_0x498383);}else{logger[_0x6c3f('0x1f')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x4bfecb);var _0x1e6548={'LastName':_0x4e802a!==_0x6c3f('0x2b')?_0x4e802a:util[_0x6c3f('0x2c')](_0x6c3f('0x2d'),_0x4bfecb),'Phone':_0x4bfecb};if(_0x446466[_0x6c3f('0x2e')]){if(_0x446466[_0x6c3f('0x2e')]===_0x6c3f('0x28')){logger[_0x6c3f('0x1f')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4bfecb,_0x446466[_0x6c3f('0x2e')]);}else if(_0x446466['moduleCreate']===_0x6c3f('0x29')&&_0x446466['ticketType']===_0x6c3f('0x24')){logger['info'](_0x6c3f('0x2f'),_0x4bfecb,_0x446466['moduleCreate']);_0x1e6548[_0x6c3f('0x30')]=_0x6c3f('0x31');}else{return null;}}return _0x4a70e7[_0x6c3f('0x14')](_[_0x6c3f('0x32')](_0x446466[_0x6c3f('0x2e')]))[_0x6c3f('0x33')](_0x1e6548);}});}function getCustomFields(_0x27cdb1,_0x47cb71){var _0x192cc0={};if(_0x27cdb1[_0x6c3f('0x1a')]>0x0){_['forEach'](_0x27cdb1,function(_0xeba194){if(_0xeba194[_0x6c3f('0x34')]===_0x6c3f('0x35')&&_0xeba194['idField']){_0x192cc0[_0xeba194[_0x6c3f('0x36')]]=_0xeba194[_0x6c3f('0x37')]['toString']();}else if(_0xeba194[_0x6c3f('0x34')]===_0x6c3f('0x38')&&_0xeba194[_0x6c3f('0x39')]&&_0xeba194[_0x6c3f('0x36')]){_0x47cb71[_0xeba194[_0x6c3f('0x39')]]&&(_0x192cc0[_0xeba194[_0x6c3f('0x36')]]=_0x47cb71[_0xeba194['variableName']]['toString']());}else if(_0xeba194[_0x6c3f('0x34')]==='customVariable'&&_0xeba194['Variable']&&_0xeba194['Variable'][_0x6c3f('0x3a')]&&_0xeba194[_0x6c3f('0x36')]){_0x47cb71[_0xeba194[_0x6c3f('0x3b')]['name'][_0x6c3f('0x3c')]()]&&(_0x192cc0[_0xeba194['idField']]=_0x47cb71[_0xeba194[_0x6c3f('0x3b')]['name'][_0x6c3f('0x3c')]()][_0x6c3f('0x3d')]());}});}return _0x192cc0;}function getConnection(_0x55c55a){var _0x30793e=_0x55c55a[_0x6c3f('0x3e')][_0x6c3f('0x3f')](_0x55c55a[_0x6c3f('0x40')]);var _0xa4a0a8=new jsforce[(_0x6c3f('0x41'))]({'oauth2':{'loginUrl':_0x55c55a['remoteUri']||'https://login.salesforce.com','clientId':_0x55c55a['clientId'],'clientSecret':_0x55c55a[_0x6c3f('0x42')]}});return _0xa4a0a8['login'](_0x55c55a['username'],_0x30793e)[_0x6c3f('0x19')](function(){logger[_0x6c3f('0x1f')]('Connection\x20established.');return _0xa4a0a8;});}exports[_0x6c3f('0x43')]=function(_0x12cfa0,_0x55cbad,_0x3ddc1b,_0x11e7ff,_0x5ee4fd,_0x65edf1){var _0xc6e803,_0x692eb8,_0x5f38fd,_0x18ffe1;_0x65edf1[_0x6c3f('0x44')]=intUtil[_0x6c3f('0x45')](_0x65edf1['serverUrl']);_0x65edf1[_0x6c3f('0x46')]=intUtil[_0x6c3f('0x45')](_0x65edf1['remoteUri']);if(_0x5ee4fd&&_0x5ee4fd[_0x6c3f('0x47')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x55cbad[_0x6c3f('0x48')]=util['format'](_0x6c3f('0x49'),_0x65edf1['serverUrl'],_0x55cbad[_0x6c3f('0x4a')],md5(_0x55cbad[_0x6c3f('0x4a')]));}else{_0x55cbad['recordingURL']='';}return getConnection(_0x65edf1)[_0x6c3f('0x19')](function(_0x266354){_0x18ffe1=_0x266354;return getUser(_0x65edf1,_0x11e7ff[_0x6c3f('0x4b')],_0x18ffe1);})[_0x6c3f('0x19')](function(_0x47952c){_0xc6e803=_0x47952c;return getEndUser(_0x65edf1,_0x3ddc1b,_0x55cbad[_0x6c3f('0x4c')],_0x55cbad[_0x6c3f('0x4d')],_0x18ffe1);})['then'](function(_0x3bdc84){_0x692eb8=_0x3bdc84;return getTicket(_0x65edf1,_0xc6e803,_0x692eb8,_0x3ddc1b,_0x55cbad,_0x3ddc1b[_0x6c3f('0x4e')],_0x18ffe1,_0x6c3f('0x43'));})[_0x6c3f('0x19')](function(_0x3caa69){_0x5f38fd=_0x3caa69;logger['info'](_0x6c3f('0x4f'),_0x5f38fd['id']);logger[_0x6c3f('0x1f')](_0x6c3f('0x50'),_0x5f38fd['id'],_0x11e7ff[_0x6c3f('0x3a')],_0x65edf1[_0x6c3f('0x34')]);switch(_0x65edf1[_0x6c3f('0x34')]){case _0x6c3f('0x51'):emit(util[_0x6c3f('0x2c')](_0x6c3f('0x52'),_0x11e7ff[_0x6c3f('0x3a')]),'trigger:salesforce:display',{'recordId':_0x5f38fd['id']});break;case _0x6c3f('0x53'):emit(util[_0x6c3f('0x2c')](_0x6c3f('0x52'),_0x11e7ff[_0x6c3f('0x3a')]),_0x6c3f('0x54'),{'uri':util[_0x6c3f('0x2c')]('%s/%s/e',_0x18ffe1[_0x6c3f('0x55')],_0x5f38fd['id'])});break;default:logger[_0x6c3f('0x56')](_0x6c3f('0x57'));}})[_0x6c3f('0x58')](function(_0x2cb81d){logger[_0x6c3f('0x56')](_0x6c3f('0x59'),JSON[_0x6c3f('0x5a')](_0x2cb81d));});};exports['outbound']=function(_0x513aa6,_0x280a33,_0x4fc6e1,_0x4b315f,_0x2f6e4a,_0xc6616a,_0x2dfc28){var _0x46b72a,_0x266241,_0x130410,_0x1587ff;_0xc6616a['serverUrl']=intUtil[_0x6c3f('0x45')](_0xc6616a[_0x6c3f('0x44')]);_0xc6616a[_0x6c3f('0x46')]=intUtil[_0x6c3f('0x45')](_0xc6616a[_0x6c3f('0x46')]);if(_0x2dfc28&&_0x2dfc28[_0x6c3f('0x5b')]&&_0x2dfc28[_0x6c3f('0x5b')]!==_0x6c3f('0x5c')){logger[_0x6c3f('0x1f')](_0x6c3f('0x5d'),_0x6c3f('0x5e'));_0x280a33['recordingURL']=util['format'](_0x6c3f('0x49'),_0xc6616a[_0x6c3f('0x44')],_0x280a33['uniqueid'],md5(_0x280a33[_0x6c3f('0x4a')]));}return getConnection(_0xc6616a)[_0x6c3f('0x19')](function(_0x41a3e3){_0x1587ff=_0x41a3e3;return getUser(_0xc6616a,_0x4b315f[_0x6c3f('0x4b')],_0x1587ff);})[_0x6c3f('0x19')](function(_0x10b118){_0x46b72a=_0x10b118;return getEndUser(_0xc6616a,_0x4fc6e1,_0x280a33[_0x6c3f('0x5f')],_0x280a33[_0x6c3f('0x60')],_0x1587ff);})[_0x6c3f('0x19')](function(_0x20e1fb){_0x266241=_0x20e1fb;return getTicket(_0xc6616a,_0x46b72a,_0x266241,_0x4fc6e1,_0x280a33,_0x4fc6e1[_0x6c3f('0x4e')],_0x1587ff,'outbound');})[_0x6c3f('0x19')](function(_0x4fbc1f){_0x130410=_0x4fbc1f;logger[_0x6c3f('0x1f')](_0x6c3f('0x61'),_0x130410['id']);logger[_0x6c3f('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x130410['id'],_0x4b315f[_0x6c3f('0x3a')],_0xc6616a[_0x6c3f('0x34')]);switch(_0xc6616a['type']){case _0x6c3f('0x51'):emit(util[_0x6c3f('0x2c')](_0x6c3f('0x52'),_0x4b315f[_0x6c3f('0x3a')]),'trigger:salesforce:display',{'recordId':_0x130410['id']});break;case _0x6c3f('0x53'):emit(util[_0x6c3f('0x2c')]('user:%s',_0x4b315f[_0x6c3f('0x3a')]),_0x6c3f('0x54'),{'uri':util['format'](_0x6c3f('0x62'),_0x1587ff[_0x6c3f('0x55')],_0x130410['id'])});break;default:logger[_0x6c3f('0x56')]('[OUTBOUND]',_0x6c3f('0x63'));}})[_0x6c3f('0x58')](function(_0x4460c8){logger[_0x6c3f('0x56')](_0x6c3f('0x5d'),JSON[_0x6c3f('0x5a')](_0x4460c8));});};exports[_0x6c3f('0x64')]=function(_0x56193e,_0x4f6a2e,_0x1449ca,_0x490daf,_0x5ad2f4,_0x597c2a){var _0x563bf2,_0x5adbb1,_0xd69eb8,_0x59f4fc;_0x597c2a['serverUrl']=intUtil[_0x6c3f('0x45')](_0x597c2a[_0x6c3f('0x44')]);_0x597c2a[_0x6c3f('0x46')]=intUtil[_0x6c3f('0x45')](_0x597c2a[_0x6c3f('0x46')]);if(_0x5ad2f4&&_0x5ad2f4[_0x6c3f('0x47')]){logger[_0x6c3f('0x1f')]('['+_0x4f6a2e[_0x6c3f('0x65')][_0x6c3f('0x66')]()+']',_0x6c3f('0x5e'));_0x4f6a2e[_0x6c3f('0x48')]=util[_0x6c3f('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x597c2a['serverUrl'],_0x4f6a2e[_0x6c3f('0x4a')],md5(_0x4f6a2e['uniqueid']));}else{_0x4f6a2e[_0x6c3f('0x48')]='';}return getConnection(_0x597c2a)['then'](function(_0x38b77e){_0x59f4fc=_0x38b77e;if(!_[_0x6c3f('0x15')](_0x490daf)){return getUser(_0x597c2a,_0x490daf[_0x6c3f('0x3a')],_0x59f4fc);}else{return getUser(_0x597c2a,null,_0x59f4fc);}})[_0x6c3f('0x19')](function(_0x564a66){_0x563bf2=_0x564a66;return getEndUser(_0x597c2a,_0x1449ca,_0x4f6a2e[_0x6c3f('0x4c')],_0x4f6a2e[_0x6c3f('0x4d')],_0x59f4fc);})[_0x6c3f('0x19')](function(_0x2f2fbf){_0x5adbb1=_0x2f2fbf;return getTicket(_0x597c2a,_0x563bf2,_0x5adbb1,_0x1449ca,_0x4f6a2e,_0x1449ca['Fields'],_0x59f4fc);})[_0x6c3f('0x19')](function(_0x381605){_0xd69eb8=_0x381605;logger[_0x6c3f('0x1f')]('['+_0x4f6a2e[_0x6c3f('0x65')][_0x6c3f('0x66')]()+']\x20Ticket\x20%s\x20created.',_0xd69eb8['id']);logger[_0x6c3f('0x1f')]('['+_0x4f6a2e[_0x6c3f('0x65')][_0x6c3f('0x66')]()+_0x6c3f('0x67'),_0x597c2a[_0x6c3f('0x34')]);})['catch'](function(_0x2fd71c){logger[_0x6c3f('0x56')]('['+_0x4f6a2e['lastevent'][_0x6c3f('0x66')]()+']',JSON[_0x6c3f('0x5a')](_0x2fd71c));});};
\ No newline at end of file
+var _0x8efb=['redis','localhost','socket.io-emitter','ticketType','assign','utc','Subjects','getString','Case','ContactId','sobject','isNil','User','execute','then','length','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','identity','resolve','Task','Contact','find','Lead','lead','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','<unknown>','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','create','type','variableName','idField','Variable','name','toLowerCase','toString','password','concat','remoteUri','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','instanceUrl','error','catch','outbound','recordingFormat','[OUTBOUND]','uniqueid','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','stringify','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults'];(function(_0x451d04,_0x999e7d){var _0x32c6fe=function(_0x2be910){while(--_0x2be910){_0x451d04['push'](_0x451d04['shift']());}};_0x32c6fe(++_0x999e7d);}(_0x8efb,0x1e8));var _0xb8ef=function(_0x18f784,_0x2a538f){_0x18f784=_0x18f784-0x0;var _0x4cd072=_0x8efb[_0x18f784];return _0x4cd072;};'use strict';var _=require(_0xb8ef('0x0'));var rp=require(_0xb8ef('0x1'));var moment=require(_0xb8ef('0x2'));var BPromise=require('bluebird');var md5=require(_0xb8ef('0x3'));var jsforce=require(_0xb8ef('0x4'));var util=require(_0xb8ef('0x5'));var Redis=require(_0xb8ef('0x6'));var intUtil=require(_0xb8ef('0x7'));var config=require(_0xb8ef('0x8'));var logger=require(_0xb8ef('0x9'))(_0xb8ef('0xa'));config['redis']=_[_0xb8ef('0xb')](config[_0xb8ef('0xc')],{'host':_0xb8ef('0xd'),'port':0x18eb});var io=require(_0xb8ef('0xe'))(new Redis(config[_0xb8ef('0xc')]));function emit(_0x44a6cb,_0xf00c4f,_0x593745){io['to'](_0x44a6cb)['emit'](_0xf00c4f,_0x593745);}function getTicket(_0x4c06ac,_0x313a16,_0x423174,_0x590016,_0x1074a1,_0x2b69b8,_0x4751cf,_0x15cfd3){var _0x21ac3b={};if(_0x590016[_0xb8ef('0xf')]==='Task'){_0x21ac3b=Object[_0xb8ef('0x10')]({},{'OwnerId':_0x313a16['id'],'ActivityDate':moment[_0xb8ef('0x11')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x590016[_0xb8ef('0x12')],_0x1074a1,'\x20'),'Description':intUtil[_0xb8ef('0x13')](_0x590016['Descriptions'],_0x1074a1,'\x0a')},getCustomFields(_0x2b69b8,_0x1074a1));if(_0x423174){_0x21ac3b['WhoId']=_0x423174['id'];}}else if(_0x590016[_0xb8ef('0xf')]===_0xb8ef('0x14')){_0x21ac3b=Object['assign']({},{'OwnerId':_0x313a16['id'],'Subject':intUtil[_0xb8ef('0x13')](_0x590016[_0xb8ef('0x12')],_0x1074a1,'\x20'),'Description':intUtil[_0xb8ef('0x13')](_0x590016['Descriptions'],_0x1074a1,'\x0a')},getCustomFields(_0x2b69b8,_0x1074a1));if(_0x423174){_0x21ac3b[_0xb8ef('0x15')]=_0x423174['id'];}}return _0x4751cf[_0xb8ef('0x16')](_0x590016['ticketType'])['create'](_0x21ac3b);}function getUser(_0x311502,_0x2ef4f3,_0x4b68f9){if(!_[_0xb8ef('0x17')](_0x2ef4f3)&&intUtil['validateEmail'](_0x2ef4f3)){var _0x5d2121={'Email':_0x2ef4f3};var _0x389d80={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4b68f9[_0xb8ef('0x16')](_0xb8ef('0x18'))['find'](_0x5d2121,_0x389d80)[_0xb8ef('0x19')]()[_0xb8ef('0x1a')](function(_0x350530){if(_0x350530[_0xb8ef('0x1b')]){var _0xc9edf2=_['find'](_0x350530,function(_0x69815b){return _0x69815b['Email']===_0x2ef4f3;});if(_0xc9edf2){logger['info']('Agent\x20%s\x20found.',_0x2ef4f3);return BPromise['resolve']({'id':_0xc9edf2['Id'],'name':_0xc9edf2[_0xb8ef('0x1c')]});}}else{logger[_0xb8ef('0x1d')](_0xb8ef('0x1e'),_0x2ef4f3);return _0x4b68f9['identity']()[_0xb8ef('0x1a')](function(_0x100f2c){return BPromise['resolve']({'id':_0x100f2c[_0xb8ef('0x1f')],'name':_0x100f2c[_0xb8ef('0x20')]});});}});}else{logger[_0xb8ef('0x1d')](_0xb8ef('0x1e'),_0x2ef4f3);return _0x4b68f9[_0xb8ef('0x21')]()[_0xb8ef('0x1a')](function(_0x3f5f3c){return BPromise['resolve']({'id':_0x3f5f3c['user_id'],'name':_0x3f5f3c['display_name']});});}}function getEndUser(_0x54f62e,_0x209707,_0x48ea90,_0x5143ee,_0x46a210){var _0x3fb803={'Phone':_0x5143ee};var _0x8ae446={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xb8ef('0x22')]()[_0xb8ef('0x1a')](function(){if(_0x209707[_0xb8ef('0xf')]===_0xb8ef('0x23')){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x5143ee,_0x209707['moduleSearch']);switch(_0x209707['moduleSearch']){case'contact_lead':return _0x46a210[_0xb8ef('0x16')](_0xb8ef('0x24'))[_0xb8ef('0x25')](_0x3fb803,_0x8ae446)[_0xb8ef('0x19')]()['then'](function(_0x4e5d5d){if(_0x4e5d5d&&_0x4e5d5d[_0xb8ef('0x1b')]){return _0x4e5d5d;}else{return _0x46a210['sobject'](_0xb8ef('0x26'))['find'](_0x3fb803,_0x8ae446);}});case'contact':return _0x46a210[_0xb8ef('0x16')](_0xb8ef('0x24'))[_0xb8ef('0x25')](_0x3fb803,_0x8ae446)[_0xb8ef('0x19')]();case _0xb8ef('0x27'):return _0x46a210[_0xb8ef('0x16')](_0xb8ef('0x26'))['find'](_0x3fb803,_0x8ae446);default:return null;}}else if(_0x209707[_0xb8ef('0xf')]==='Case'){logger['info'](_0xb8ef('0x28'),_0x5143ee,_0xb8ef('0x29'));return _0x46a210['sobject']('Contact')[_0xb8ef('0x25')](_0x3fb803,_0x8ae446)[_0xb8ef('0x19')]();}})[_0xb8ef('0x1a')](function(_0x3396a0){if(_0x3396a0&&_0x3396a0['length']){var _0xcef791=_[_0xb8ef('0x25')](_0x3396a0,function(_0x3d19a1){return _0x3d19a1[_0xb8ef('0x2a')]===_0x5143ee;});if(_0xcef791){return BPromise[_0xb8ef('0x22')]({'id':_0xcef791['Id'],'name':_0xcef791[_0xb8ef('0x1c')],'phone':_0xcef791[_0xb8ef('0x2a')]});}}})['then'](function(_0x3444e6){if(_0x3444e6){logger[_0xb8ef('0x1d')](_0xb8ef('0x2b'),_0x5143ee);return BPromise[_0xb8ef('0x22')](_0x3444e6);}else{logger['info'](_0xb8ef('0x2c'),_0x5143ee);var _0x45ce01={'LastName':_0x48ea90!==_0xb8ef('0x2d')?_0x48ea90:util[_0xb8ef('0x2e')]('Caller\x20-\x20%s',_0x5143ee),'Phone':_0x5143ee};if(_0x209707[_0xb8ef('0x2f')]){if(_0x209707['moduleCreate']==='contact'){logger['info'](_0xb8ef('0x30'),_0x5143ee,_0x209707['moduleCreate']);}else if(_0x209707[_0xb8ef('0x2f')]===_0xb8ef('0x27')&&_0x209707['ticketType']===_0xb8ef('0x23')){logger[_0xb8ef('0x1d')](_0xb8ef('0x30'),_0x5143ee,_0x209707[_0xb8ef('0x2f')]);_0x45ce01[_0xb8ef('0x31')]=_0xb8ef('0x32');}else{return null;}}return _0x46a210['sobject'](_[_0xb8ef('0x33')](_0x209707[_0xb8ef('0x2f')]))[_0xb8ef('0x34')](_0x45ce01);}});}function getCustomFields(_0x4ff861,_0x54798b){var _0x48f33b={};if(_0x4ff861[_0xb8ef('0x1b')]>0x0){_['forEach'](_0x4ff861,function(_0x3e595b){if(_0x3e595b['type']==='string'&&_0x3e595b['idField']){_0x48f33b[_0x3e595b['idField']]=_0x3e595b['content']['toString']();}else if(_0x3e595b[_0xb8ef('0x35')]==='variable'&&_0x3e595b[_0xb8ef('0x36')]&&_0x3e595b[_0xb8ef('0x37')]){_0x54798b[_0x3e595b[_0xb8ef('0x36')]]&&(_0x48f33b[_0x3e595b[_0xb8ef('0x37')]]=_0x54798b[_0x3e595b[_0xb8ef('0x36')]]['toString']());}else if(_0x3e595b[_0xb8ef('0x35')]==='customVariable'&&_0x3e595b[_0xb8ef('0x38')]&&_0x3e595b[_0xb8ef('0x38')][_0xb8ef('0x39')]&&_0x3e595b['idField']){_0x54798b[_0x3e595b[_0xb8ef('0x38')][_0xb8ef('0x39')][_0xb8ef('0x3a')]()]&&(_0x48f33b[_0x3e595b[_0xb8ef('0x37')]]=_0x54798b[_0x3e595b['Variable'][_0xb8ef('0x39')][_0xb8ef('0x3a')]()][_0xb8ef('0x3b')]());}});}return _0x48f33b;}function getConnection(_0x163314){var _0x5e6da4=_0x163314[_0xb8ef('0x3c')][_0xb8ef('0x3d')](_0x163314['securityToken']);var _0x5b281a=new jsforce['Connection']({'oauth2':{'loginUrl':_0x163314[_0xb8ef('0x3e')]||'https://login.salesforce.com','clientId':_0x163314['clientId'],'clientSecret':_0x163314['clientSecret']}});return _0x5b281a['login'](_0x163314[_0xb8ef('0x3f')],_0x5e6da4)[_0xb8ef('0x1a')](function(){logger[_0xb8ef('0x1d')](_0xb8ef('0x40'));return _0x5b281a;});}exports[_0xb8ef('0x41')]=function(_0x2b6086,_0x1522be,_0x1a4a1f,_0x82cdab,_0x351669,_0x155e95){var _0x2a5408,_0x53871d,_0x12d92a,_0x161462;_0x155e95[_0xb8ef('0x42')]=intUtil[_0xb8ef('0x43')](_0x155e95['serverUrl']);_0x155e95['remoteUri']=intUtil[_0xb8ef('0x43')](_0x155e95['remoteUri']);if(_0x351669&&_0x351669[_0xb8ef('0x44')]){logger['info'](_0xb8ef('0x45'),_0xb8ef('0x46'));_0x1522be[_0xb8ef('0x47')]=util[_0xb8ef('0x2e')](_0xb8ef('0x48'),_0x155e95[_0xb8ef('0x42')],_0x1522be['uniqueid'],md5(_0x1522be['uniqueid']));}else{_0x1522be[_0xb8ef('0x47')]='';}return getConnection(_0x155e95)['then'](function(_0x47af9c){_0x161462=_0x47af9c;return getUser(_0x155e95,_0x82cdab[_0xb8ef('0x49')],_0x161462);})[_0xb8ef('0x1a')](function(_0x1c6d3a){_0x2a5408=_0x1c6d3a;return getEndUser(_0x155e95,_0x1a4a1f,_0x1522be[_0xb8ef('0x4a')],_0x1522be[_0xb8ef('0x4b')],_0x161462);})[_0xb8ef('0x1a')](function(_0x4a8a17){_0x53871d=_0x4a8a17;return getTicket(_0x155e95,_0x2a5408,_0x53871d,_0x1a4a1f,_0x1522be,_0x1a4a1f[_0xb8ef('0x4c')],_0x161462,_0xb8ef('0x41'));})[_0xb8ef('0x1a')](function(_0x113285){_0x12d92a=_0x113285;logger[_0xb8ef('0x1d')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x12d92a['id']);logger[_0xb8ef('0x1d')](_0xb8ef('0x4d'),_0x12d92a['id'],_0x82cdab[_0xb8ef('0x39')],_0x155e95['type']);switch(_0x155e95[_0xb8ef('0x35')]){case _0xb8ef('0x4e'):emit(util['format']('user:%s',_0x82cdab[_0xb8ef('0x39')]),_0xb8ef('0x4f'),{'recordId':_0x12d92a['id']});break;case _0xb8ef('0x50'):emit(util[_0xb8ef('0x2e')](_0xb8ef('0x51'),_0x82cdab[_0xb8ef('0x39')]),_0xb8ef('0x52'),{'uri':util[_0xb8ef('0x2e')]('%s/%s/e',_0x161462[_0xb8ef('0x53')],_0x12d92a['id'])});break;default:logger[_0xb8ef('0x54')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xb8ef('0x55')](function(_0x4c0c0a){logger[_0xb8ef('0x54')](_0xb8ef('0x45'),JSON['stringify'](_0x4c0c0a));});};exports[_0xb8ef('0x56')]=function(_0x4d228a,_0x53e621,_0x45c41a,_0x32e89a,_0x4ba5ae,_0x1a01d8,_0x193737){var _0x2c9a89,_0x77863e,_0x294446,_0x14fe21;_0x1a01d8['serverUrl']=intUtil['stripTrailingSlash'](_0x1a01d8['serverUrl']);_0x1a01d8[_0xb8ef('0x3e')]=intUtil[_0xb8ef('0x43')](_0x1a01d8['remoteUri']);if(_0x193737&&_0x193737[_0xb8ef('0x57')]&&_0x193737['recordingFormat']!=='none'){logger[_0xb8ef('0x1d')](_0xb8ef('0x58'),'Recording\x20is\x20enabled!');_0x53e621[_0xb8ef('0x47')]=util['format'](_0xb8ef('0x48'),_0x1a01d8['serverUrl'],_0x53e621['uniqueid'],md5(_0x53e621[_0xb8ef('0x59')]));}return getConnection(_0x1a01d8)[_0xb8ef('0x1a')](function(_0x58c1f1){_0x14fe21=_0x58c1f1;return getUser(_0x1a01d8,_0x32e89a['email'],_0x14fe21);})[_0xb8ef('0x1a')](function(_0x5842cc){_0x2c9a89=_0x5842cc;return getEndUser(_0x1a01d8,_0x45c41a,_0x53e621['destcalleridname'],_0x53e621[_0xb8ef('0x5a')],_0x14fe21);})[_0xb8ef('0x1a')](function(_0x13b82b){_0x77863e=_0x13b82b;return getTicket(_0x1a01d8,_0x2c9a89,_0x77863e,_0x45c41a,_0x53e621,_0x45c41a['Fields'],_0x14fe21,_0xb8ef('0x56'));})[_0xb8ef('0x1a')](function(_0x592e40){_0x294446=_0x592e40;logger[_0xb8ef('0x1d')](_0xb8ef('0x5b'),_0x294446['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x294446['id'],_0x32e89a[_0xb8ef('0x39')],_0x1a01d8[_0xb8ef('0x35')]);switch(_0x1a01d8[_0xb8ef('0x35')]){case'integrationTab':emit(util[_0xb8ef('0x2e')]('user:%s',_0x32e89a[_0xb8ef('0x39')]),_0xb8ef('0x4f'),{'recordId':_0x294446['id']});break;case _0xb8ef('0x50'):emit(util[_0xb8ef('0x2e')](_0xb8ef('0x51'),_0x32e89a[_0xb8ef('0x39')]),'trigger:browser:url',{'uri':util[_0xb8ef('0x2e')](_0xb8ef('0x5c'),_0x14fe21[_0xb8ef('0x53')],_0x294446['id'])});break;default:logger[_0xb8ef('0x54')](_0xb8ef('0x58'),_0xb8ef('0x5d'));}})[_0xb8ef('0x55')](function(_0x19e9f9){logger[_0xb8ef('0x54')](_0xb8ef('0x58'),JSON[_0xb8ef('0x5e')](_0x19e9f9));});};exports[_0xb8ef('0x5f')]=function(_0x7764d4,_0x2599f,_0x287b09,_0x80548a,_0x186538,_0x1021ec){var _0x3e284b,_0x3f55d8,_0x50ae4d,_0x3658dd;_0x1021ec[_0xb8ef('0x42')]=intUtil[_0xb8ef('0x43')](_0x1021ec[_0xb8ef('0x42')]);_0x1021ec[_0xb8ef('0x3e')]=intUtil[_0xb8ef('0x43')](_0x1021ec[_0xb8ef('0x3e')]);if(_0x186538&&_0x186538['monitor_format']){logger[_0xb8ef('0x1d')]('['+_0x2599f[_0xb8ef('0x60')][_0xb8ef('0x61')]()+']',_0xb8ef('0x46'));_0x2599f[_0xb8ef('0x47')]=util[_0xb8ef('0x2e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1021ec['serverUrl'],_0x2599f[_0xb8ef('0x59')],md5(_0x2599f[_0xb8ef('0x59')]));}else{_0x2599f[_0xb8ef('0x47')]='';}return getConnection(_0x1021ec)['then'](function(_0x41a221){_0x3658dd=_0x41a221;if(!_[_0xb8ef('0x17')](_0x80548a)){return getUser(_0x1021ec,_0x80548a[_0xb8ef('0x39')],_0x3658dd);}else{return getUser(_0x1021ec,null,_0x3658dd);}})[_0xb8ef('0x1a')](function(_0x1b0571){_0x3e284b=_0x1b0571;return getEndUser(_0x1021ec,_0x287b09,_0x2599f[_0xb8ef('0x4a')],_0x2599f[_0xb8ef('0x4b')],_0x3658dd);})['then'](function(_0x5cdbf1){_0x3f55d8=_0x5cdbf1;return getTicket(_0x1021ec,_0x3e284b,_0x3f55d8,_0x287b09,_0x2599f,_0x287b09['Fields'],_0x3658dd);})[_0xb8ef('0x1a')](function(_0xa3b596){_0x50ae4d=_0xa3b596;logger[_0xb8ef('0x1d')]('['+_0x2599f[_0xb8ef('0x60')]['toUpperCase']()+_0xb8ef('0x62'),_0x50ae4d['id']);logger[_0xb8ef('0x1d')]('['+_0x2599f[_0xb8ef('0x60')][_0xb8ef('0x61')]()+_0xb8ef('0x63'),_0x1021ec[_0xb8ef('0x35')]);})['catch'](function(_0x389b51){logger[_0xb8ef('0x54')]('['+_0x2599f['lastevent'][_0xb8ef('0x61')]()+']',JSON[_0xb8ef('0x5e')](_0x389b51));});};
\ No newline at end of file
index 8605dcf..56e4870 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['getString','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','true','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign'];(function(_0x1f3280,_0xec6845){var _0x50770f=function(_0x3edb5b){while(--_0x3edb5b){_0x1f3280['push'](_0x1f3280['shift']());}};_0x50770f(++_0xec6845);}(_0x7a54,0x106));var _0x47a5=function(_0x82739a,_0x38e782){_0x82739a=_0x82739a-0x0;var _0x43b2aa=_0x7a54[_0x82739a];return _0x43b2aa;};'use strict';var _=require(_0x47a5('0x0'));var Promise=require(_0x47a5('0x1'));var rp=require(_0x47a5('0x2'));var util=require('util');var md5=require(_0x47a5('0x3'));var Redis=require(_0x47a5('0x4'));var intUtil=require('./util');var config=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));config[_0x47a5('0x8')]=_[_0x47a5('0x9')](config['redis'],{'host':_0x47a5('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x47a5('0x8')]));function getAdminUser(_0x30e405,_0x506eda,_0x194fb0,_0x5077f3,_0x5d90b3,_0x582352){return new Promise(function(_0x2a0e98,_0x2baee7){var _0x5e31dd={'method':_0x47a5('0xb'),'uri':_0x5077f3+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x5d90b3+'&'+_0x582352,'auth':_0x506eda,'json':!![]};return rp(_0x5e31dd)['then'](function(_0x1f47f4){if(_0x1f47f4[_0x47a5('0xc')][_0x47a5('0xd')]>0x0){_0x194fb0[_0x47a5('0xe')]=_0x1f47f4[_0x47a5('0xc')][0x0][_0x47a5('0xf')];}logger[_0x47a5('0x10')]('['+[_0x30e405['toUpperCase']()]+_0x47a5('0x11'),_0x194fb0);_0x2a0e98(_0x194fb0);})[_0x47a5('0x12')](function(_0x1cf309){logger[_0x47a5('0x13')]('['+[_0x30e405[_0x47a5('0x14')]()]+']',_0x1cf309[_0x47a5('0x15')]);_0x2baee7(_0x1cf309[_0x47a5('0x15')]);});});}function getUser(_0x190faa,_0x4e99a8,_0x362359,_0x11faf5,_0x3b001e){return function(_0x2a2cbb){logger[_0x47a5('0x10')]('['+[_0x190faa['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x2a2cbb);return new Promise(function(_0x138bc0,_0x4b966e){if(intUtil['validateEmail'](_0x2a2cbb[_0x47a5('0x16')])){var _0xaf70a6={'method':_0x47a5('0xb'),'uri':_0x362359+_0x47a5('0x17')+_0x2a2cbb[_0x47a5('0x16')]+'&'+_0x11faf5+'&'+_0x3b001e,'auth':_0x4e99a8,'json':!![]};logger[_0x47a5('0x10')]('['+[_0x190faa[_0x47a5('0x14')]()]+_0x47a5('0x18'),_0xaf70a6);return rp(_0xaf70a6)[_0x47a5('0x19')](function(_0x4a9fcb){logger[_0x47a5('0x10')]('['+[_0x190faa[_0x47a5('0x14')]()]+'],\x20getUser\x20entity',_0x4a9fcb);if(_0x4a9fcb[_0x47a5('0xc')][_0x47a5('0xd')]>0x0&&String(_0x4a9fcb[_0x47a5('0xc')][0x0]['active'])===_0x47a5('0x1a')){_0x2a2cbb[_0x47a5('0x1b')]=_0x4a9fcb[_0x47a5('0xc')][0x0][_0x47a5('0xf')];}else{_0x2a2cbb['userId']=_0x2a2cbb[_0x47a5('0xe')];_0x2a2cbb[_0x47a5('0x16')]=_0x2a2cbb['adminEmail'];}logger[_0x47a5('0x10')]('['+[_0x190faa[_0x47a5('0x14')]()]+_0x47a5('0x1c'),_0x2a2cbb);_0x138bc0(_0x2a2cbb);})[_0x47a5('0x12')](function(_0x3abd6a){logger['error']('['+[_0x190faa['toUpperCase']()]+']',_0x3abd6a[_0x47a5('0x15')]);_0x4b966e(_0x3abd6a['message']);});}else{logger[_0x47a5('0x10')]('['+[_0x190faa['toUpperCase']()]+_0x47a5('0x1d'));_0x2a2cbb[_0x47a5('0x1b')]=_0x2a2cbb[_0x47a5('0xe')];_0x2a2cbb[_0x47a5('0x16')]=_0x2a2cbb[_0x47a5('0x1e')];_0x138bc0(_0x2a2cbb);}});};}function createEndUser(_0x3ba0b7,_0x24b162,_0x136b14,_0x16631f,_0x361bfa){logger[_0x47a5('0x10')]('['+[_0x3ba0b7[_0x47a5('0x14')]()]+_0x47a5('0x1f'),_0x136b14);return new Promise(function(_0x528582,_0x243210){var _0x51833b={'method':_0x47a5('0x20'),'uri':_0x16631f+_0x47a5('0x21')+_0x361bfa,'body':{'user_name':_0x136b14[_0x47a5('0x22')],'roles':'user','first_name':_0x136b14[_0x47a5('0x22')],'active':_0x47a5('0x1a'),'date_format':_0x47a5('0x23'),'phone':_0x136b14[_0x47a5('0x22')]},'auth':_0x24b162,'json':!![]};return rp(_0x51833b)['then'](function(_0x50d875){logger[_0x47a5('0x10')]('['+[_0x3ba0b7[_0x47a5('0x14')]()]+'],\x20EndUser\x20schema',_0x50d875['result']);_0x136b14[_0x47a5('0x24')]=_0x50d875[_0x47a5('0xc')]['sys_id'];_0x528582(_0x136b14);})[_0x47a5('0x12')](function(_0x53119b){logger[_0x47a5('0x13')]('['+[_0x3ba0b7[_0x47a5('0x14')]()]+']',_0x53119b['message']);_0x243210(_0x53119b['message']);});});}function getEndUser(_0x274e34,_0x5910bb,_0x403028,_0x87e4c9,_0xf269a8){return function(_0x52749b){logger[_0x47a5('0x10')]('['+[_0x274e34['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x52749b);return new Promise(function(_0x65542e,_0x5a8a7c){var _0x25cce0={'method':'GET','uri':_0x403028+_0x47a5('0x25')+_0x52749b[_0x47a5('0x22')]+'&'+_0x87e4c9+'&'+_0xf269a8,'auth':_0x5910bb,'json':!![]};return rp(_0x25cce0)[_0x47a5('0x19')](function(_0x199698){if(_0x199698[_0x47a5('0xc')][_0x47a5('0xd')]>0x0){_0x52749b[_0x47a5('0x24')]=_0x199698[_0x47a5('0xc')][0x0][_0x47a5('0xf')];logger['info']('['+[_0x274e34[_0x47a5('0x14')]()]+_0x47a5('0x26'),_0x52749b);_0x65542e(_0x52749b);}else{return createEndUser(_0x274e34,_0x5910bb,_0x52749b,_0x403028,_0x87e4c9)['then'](function(_0x2c50d6){logger[_0x47a5('0x10')]('['+[_0x274e34[_0x47a5('0x14')]()]+'],\x20createEndUser\x20crm',_0x2c50d6);_0x65542e(_0x2c50d6);});}})[_0x47a5('0x12')](function(_0x10f660){logger['error']('['+[_0x274e34[_0x47a5('0x14')]()]+']',_0x10f660[_0x47a5('0x15')]);_0x5a8a7c(_0x10f660['message']);});});};}function getCustomFields(_0x55c5eb,_0x5ebd8c){var _0x12d9f2={};if(_0x55c5eb['length']>0x0){_[_0x47a5('0x27')](_0x55c5eb,function(_0x1f9631){if(_0x1f9631[_0x47a5('0x28')]===_0x47a5('0x29')&&_0x1f9631[_0x47a5('0x2a')]&&!_0x1f9631[_0x47a5('0x2b')]){_0x12d9f2[_0x1f9631[_0x47a5('0x2c')][_0x47a5('0x2d')]()]=_0x1f9631[_0x47a5('0x2e')][_0x47a5('0x2f')]();}else if(_0x1f9631[_0x47a5('0x28')]===_0x47a5('0x29')&&_0x1f9631[_0x47a5('0x2c')]&&_0x1f9631['customField']){_0x12d9f2[_0x1f9631[_0x47a5('0x2c')][_0x47a5('0x2d')]()]=_0x1f9631[_0x47a5('0x2e')][_0x47a5('0x2f')]();}else if(_0x1f9631['type']===_0x47a5('0x30')&&_0x1f9631['variableName']&&_0x1f9631['idField']&&_0x1f9631['customField']){_0x12d9f2[_0x1f9631['idField'][_0x47a5('0x2d')]()]=_0x5ebd8c[_0x1f9631['variableName']][_0x47a5('0x2f')]();}else if(_0x1f9631[_0x47a5('0x28')]===_0x47a5('0x31')&&_0x1f9631['Variable']&&_0x1f9631[_0x47a5('0x32')][_0x47a5('0x33')]&&_0x1f9631['idField']&&_0x1f9631['customField']){_0x12d9f2[_0x1f9631[_0x47a5('0x2c')]['toLowerCase']()]=_0x5ebd8c[_0x1f9631[_0x47a5('0x32')][_0x47a5('0x33')][_0x47a5('0x2d')]()][_0x47a5('0x2f')]();}});}return _0x12d9f2;}function getTicket(_0x34a9ae,_0xf0edbb,_0x434227,_0x17cc42,_0xac9c15,_0x162fa0){return function(_0x24ecb1){logger[_0x47a5('0x10')]('['+[_0x34a9ae[_0x47a5('0x14')]()]+_0x47a5('0x34'),_0x24ecb1);return new Promise(function(_0x4e5e7,_0x3a2b38){var _0x512e65=_0x34a9ae[_0x47a5('0x2d')]()===_0x47a5('0x35')?_0x24ecb1['userId']:_0x24ecb1['endUserId'];var _0x3d0a88={'method':'POST','uri':_0x434227+_0x47a5('0x36')+'?'+_0x162fa0,'body':Object[_0x47a5('0x37')]({},{'active':'true','caller_id':_0x512e65,'assigned_to':_0x24ecb1['userId'],'short_description':intUtil[_0x47a5('0x38')](_0x17cc42['Subjects'],_0xac9c15,'\x20'),'description':intUtil[_0x47a5('0x38')](_0x17cc42[_0x47a5('0x39')],_0xac9c15,'\x0a')},getCustomFields(_0x17cc42[_0x47a5('0x3a')],_0xac9c15)),'auth':_0xf0edbb,'json':!![]};return rp(_0x3d0a88)[_0x47a5('0x19')](function(_0x44fe8a){logger[_0x47a5('0x10')]('['+[_0x34a9ae[_0x47a5('0x14')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x44fe8a['result']);_0x24ecb1[_0x47a5('0x3b')]=_0x44fe8a[_0x47a5('0xc')][_0x47a5('0xf')];_0x24ecb1[_0x47a5('0x3c')]=_0x44fe8a[_0x47a5('0xc')][_0x47a5('0x3d')];logger[_0x47a5('0x10')]('['+[_0x34a9ae['toUpperCase']()]+_0x47a5('0x3e'),_0x24ecb1);_0x4e5e7(_0x24ecb1);})[_0x47a5('0x12')](function(_0x5f6a){logger['error']('['+[_0x34a9ae[_0x47a5('0x14')]()]+']',_0x5f6a['message']);_0x3a2b38(_0x5f6a[_0x47a5('0x15')]);});});};}function createRemoteTag(_0xe31817,_0x46e90b,_0xf03bd5,_0x588551){return new Promise(function(_0x3adf14,_0x1e6de3){var _0x2f66e9={'method':_0x47a5('0x20'),'uri':_0xf03bd5+_0x47a5('0x3f')+'?'+_0x588551,'body':{'short_description':_0xe31817,'global':!![],'active':!![],'name':_0xe31817},'auth':_0x46e90b,'json':!![]};return rp(_0x2f66e9)[_0x47a5('0x19')](function(_0x24e9f4){var _0x481089=_0x24e9f4[_0x47a5('0xc')][_0x47a5('0xf')];_0x3adf14(_0x481089);});});}function getRemoteTag(_0x187d7e,_0x8da9fb,_0x3329aa,_0x1ab0bf,_0x572233){return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581={'method':'GET','uri':_0x3329aa+_0x47a5('0x3f')+_0x47a5('0x40')+_0x187d7e+'&'+_0x1ab0bf,'auth':_0x8da9fb,'json':!![]};return rp(_0x1aa581)[_0x47a5('0x19')](function(_0x5d8d4a){if(_0x5d8d4a['result'][_0x47a5('0xd')]>0x0){var _0x376e1d=_0x5d8d4a['result'][0x0]['sys_id'];_0x1ad6a9(_0x376e1d);}else{return createRemoteTag(_0x187d7e,_0x8da9fb,_0x3329aa,_0x1ab0bf)[_0x47a5('0x19')](function(_0x4d6a82){_0x1ad6a9(_0x4d6a82);});}});});}function assignTagToIncident(_0x16bb8a,_0x5d383d,_0x482de6,_0x389ed9,_0x46d2d3){return new Promise(function(_0x53eedf,_0x1b958b){var _0x72fe={'method':'POST','uri':_0x482de6+'label_entry'+'?'+_0x46d2d3,'body':{'label':_0x16bb8a,'table':_0x47a5('0x36'),'id_type':_0x47a5('0x41'),'table_key':_0x389ed9[_0x47a5('0x3b')],'title':_0x47a5('0x42')+_0x389ed9['ticketNumber'],'id_display':_0x389ed9[_0x47a5('0x3c')]},'auth':_0x5d383d,'json':!![]};return rp(_0x72fe)[_0x47a5('0x19')](function(_0x1af800){_0x53eedf();})['catch'](function(){_0x53eedf();});});}function manageTags(_0x30ea7a,_0x4db625,_0x485e3c,_0x470da6,_0x943a15,_0x1c485b,_0x3603b7){return new Promise(function(_0x4966af,_0x144af9){var _0x5d1550=[];_0x4db625['forEach'](function(_0x5eb150){_0x5d1550['push'](getRemoteTag(_0x5eb150,_0x485e3c,_0x470da6,_0x1c485b,_0x3603b7));});return Promise[_0x47a5('0x43')](_0x5d1550)[_0x47a5('0x19')](function(_0x1e2bb4){if(_0x1e2bb4['length']){logger['info']('['+[_0x30ea7a[_0x47a5('0x14')]()]+_0x47a5('0x44'),_0x1e2bb4);var _0x45d4b6=[];_0x1e2bb4[_0x47a5('0x27')](function(_0xc45e25){_0x45d4b6['push'](assignTagToIncident(_0xc45e25,_0x485e3c,_0x470da6,_0x943a15,_0x1c485b));});return Promise[_0x47a5('0x43')](_0x45d4b6)['then'](function(){_0x4966af();})[_0x47a5('0x12')](function(){_0x4966af();});}else{_0x4966af();}});});}function getTags(_0x274d31,_0x4d545f,_0x32b4de,_0x345104,_0x132854,_0x3e8274){return function(_0x2d6494){return new Promise(function(_0x215634,_0x35cca8){var _0x3ac38c=[];var _0x57ed0a=_0x345104[_0x47a5('0x45')];if(_0x57ed0a&&_0x57ed0a[_0x47a5('0xd')]>0x0){_0x3ac38c=_[_0x47a5('0x46')](_0x57ed0a,_0x47a5('0x33'));}if(_0x3ac38c[_0x47a5('0xd')]>0x0){return manageTags(_0x274d31,_0x3ac38c,_0x4d545f,_0x32b4de,_0x2d6494,_0x132854,_0x3e8274)['then'](function(){_0x215634(_0x2d6494);});}else{_0x215634(_0x2d6494);}});};}function emit(_0xbec033,_0xdfcecc,_0x1224bc){var _0x144aaa=_0x47a5('0x47')+_0x47a5('0x48')+_0x47a5('0x49')+_0x47a5('0x4a');var _0x350af8={'uri':_0xbec033+_0x47a5('0x4b')+_0x1224bc+_0x144aaa};io['to'](util[_0x47a5('0x4c')](_0x47a5('0x4d'),_0xdfcecc))[_0x47a5('0x4e')](_0x47a5('0x4f'),_0x350af8);}exports['cs']=function(_0x3edd17,_0x5a6161,_0x42dd7d,_0x284fb8,_0x30504e,_0x4b42f3,_0x37ac59,_0x2e46af){var _0x36c67={};var _0x26f1ac={'user':_0x4b42f3['username'],'pass':_0x4b42f3[_0x47a5('0x50')]};var _0x522ccf=_0x47a5('0x51');var _0x487e21=_0x47a5('0x52');_0x4b42f3['remoteUri']=intUtil[_0x47a5('0x53')](_0x4b42f3[_0x47a5('0x54')]);_0x4b42f3[_0x47a5('0x55')]=intUtil['stripTrailingSlash'](_0x4b42f3['serverUrl']);var _0x4b8084=util[_0x47a5('0x4c')](_0x47a5('0x56'),_0x4b42f3[_0x47a5('0x54')]);_0x36c67[_0x47a5('0x16')]=!_['isNil'](_0x284fb8)?_0x284fb8[_0x47a5('0x57')]:null;_0x36c67[_0x47a5('0x1e')]=_0x4b42f3[_0x47a5('0x57')];_0x36c67[_0x47a5('0x22')]=_0x2e46af[_0x47a5('0x2d')]()===_0x47a5('0x35')?_0x5a6161[_0x47a5('0x58')]:_0x5a6161[_0x47a5('0x59')];_0x36c67[_0x47a5('0x5a')]=_0x2e46af===_0x47a5('0x5b')||_0x2e46af===_0x47a5('0x5c')?_0x47a5('0x5b'):'outbound';var _0x1e3212=util['format'](_0x47a5('0x5d'),_0x4b42f3[_0x47a5('0x55')],_0x5a6161[_0x47a5('0x5e')],md5(_0x5a6161[_0x47a5('0x5e')]));if(_0x30504e&&_0x30504e[_0x47a5('0x5f')]){logger[_0x47a5('0x10')](_0x47a5('0x60'),_0x47a5('0x61'));_0x5a6161[_0x47a5('0x62')]=_0x1e3212;}else if(_0x37ac59&&_0x37ac59[_0x47a5('0x63')]&&_0x37ac59[_0x47a5('0x63')]!==_0x47a5('0x64')){logger[_0x47a5('0x10')](_0x47a5('0x65'),_0x47a5('0x61'));_0x5a6161['recordingURL']=_0x1e3212;}else{_0x5a6161['recordingURL']='';}return getAdminUser(_0x2e46af,_0x26f1ac,_0x36c67,_0x4b8084,_0x487e21,_0x522ccf)['then'](getUser(_0x2e46af,_0x26f1ac,_0x4b8084,_0x487e21,_0x522ccf))['then'](getEndUser(_0x2e46af,_0x26f1ac,_0x4b8084,_0x487e21,_0x522ccf))[_0x47a5('0x19')](getTicket(_0x2e46af,_0x26f1ac,_0x4b8084,_0x42dd7d,_0x5a6161,_0x487e21))[_0x47a5('0x19')](function(_0x5d6916){logger[_0x47a5('0x10')](util[_0x47a5('0x4c')](_0x47a5('0x66'),_0x5d6916[_0x47a5('0x3b')]));logger[_0x47a5('0x10')](util[_0x47a5('0x4c')](_0x47a5('0x67'),_0x2e46af));if(_0x2e46af!==_0x47a5('0x5c')){logger[_0x47a5('0x10')]('['+[_0x2e46af[_0x47a5('0x14')]()]+']',_0x47a5('0x68'));emit(_0x4b42f3['remoteUri'],_0x284fb8[_0x47a5('0x33')],_0x5d6916[_0x47a5('0x3b')]);}})[_0x47a5('0x12')](function(_0x4f35ff){logger[_0x47a5('0x13')]('['+[_0x2e46af[_0x47a5('0x14')]()]+_0x47a5('0x69'),util['inspect'](_0x4f35ff,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x1261=['recordingURL','The\x20ticket\x20ID\x20is:\x20%s','format','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','GET','],\x20getUser\x20rp\x20obj','then','length','active','true','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','userId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','type','string','nameField','toLowerCase','content','toString','idField','variable','variableName','customVariable','Variable','customField','name',']\x20getTicket\x20input\x20crm','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','?sysparm_query=name%3D','label_entry','Incident\x20-\x20',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','user:%s','emit','username','password','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','userEmail','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none'];(function(_0x3367b7,_0x1e0234){var _0x52bb97=function(_0x2155f2){while(--_0x2155f2){_0x3367b7['push'](_0x3367b7['shift']());}};_0x52bb97(++_0x1e0234);}(_0x1261,0x144));var _0x1126=function(_0x5dc755,_0x3254d0){_0x5dc755=_0x5dc755-0x0;var _0x24ce81=_0x1261[_0x5dc755];return _0x24ce81;};'use strict';var _=require('lodash');var Promise=require(_0x1126('0x0'));var rp=require(_0x1126('0x1'));var util=require(_0x1126('0x2'));var md5=require(_0x1126('0x3'));var Redis=require(_0x1126('0x4'));var intUtil=require(_0x1126('0x5'));var config=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));config[_0x1126('0x9')]=_['defaults'](config['redis'],{'host':_0x1126('0xa'),'port':0x18eb});var io=require(_0x1126('0xb'))(new Redis(config['redis']));function getAdminUser(_0x17e5f0,_0x28772d,_0x245be9,_0x3abb0b,_0x2d9033,_0x59cfa1){return new Promise(function(_0x3f09ac,_0x18dbe6){var _0x167ef1={'method':'GET','uri':_0x3abb0b+_0x1126('0xc')+'&'+_0x2d9033+'&'+_0x59cfa1,'auth':_0x28772d,'json':!![]};return rp(_0x167ef1)['then'](function(_0x52ef15){if(_0x52ef15[_0x1126('0xd')]['length']>0x0){_0x245be9[_0x1126('0xe')]=_0x52ef15[_0x1126('0xd')][0x0][_0x1126('0xf')];}logger[_0x1126('0x10')]('['+[_0x17e5f0[_0x1126('0x11')]()]+_0x1126('0x12'),_0x245be9);_0x3f09ac(_0x245be9);})[_0x1126('0x13')](function(_0x2048ad){logger[_0x1126('0x14')]('['+[_0x17e5f0['toUpperCase']()]+']',_0x2048ad['message']);_0x18dbe6(_0x2048ad[_0x1126('0x15')]);});});}function getUser(_0x154e20,_0x279455,_0x4be0c6,_0x45149c,_0x4794a7){return function(_0x35fe9f){logger[_0x1126('0x10')]('['+[_0x154e20[_0x1126('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x35fe9f);return new Promise(function(_0x245cd7,_0x1695f6){if(intUtil['validateEmail'](_0x35fe9f['userEmail'])){var _0x22ae0b={'method':_0x1126('0x16'),'uri':_0x4be0c6+'sys_user?sysparm_query=email%3D'+_0x35fe9f['userEmail']+'&'+_0x45149c+'&'+_0x4794a7,'auth':_0x279455,'json':!![]};logger[_0x1126('0x10')]('['+[_0x154e20['toUpperCase']()]+_0x1126('0x17'),_0x22ae0b);return rp(_0x22ae0b)[_0x1126('0x18')](function(_0x2f70ac){logger['info']('['+[_0x154e20[_0x1126('0x11')]()]+'],\x20getUser\x20entity',_0x2f70ac);if(_0x2f70ac['result'][_0x1126('0x19')]>0x0&&String(_0x2f70ac[_0x1126('0xd')][0x0][_0x1126('0x1a')])===_0x1126('0x1b')){_0x35fe9f['userId']=_0x2f70ac[_0x1126('0xd')][0x0][_0x1126('0xf')];}else{_0x35fe9f['userId']=_0x35fe9f[_0x1126('0xe')];_0x35fe9f['userEmail']=_0x35fe9f['adminEmail'];}logger['info']('['+[_0x154e20[_0x1126('0x11')]()]+_0x1126('0x1c'),_0x35fe9f);_0x245cd7(_0x35fe9f);})[_0x1126('0x13')](function(_0x34bcf1){logger[_0x1126('0x14')]('['+[_0x154e20[_0x1126('0x11')]()]+']',_0x34bcf1[_0x1126('0x15')]);_0x1695f6(_0x34bcf1[_0x1126('0x15')]);});}else{logger['info']('['+[_0x154e20[_0x1126('0x11')]()]+_0x1126('0x1d'));_0x35fe9f[_0x1126('0x1e')]=_0x35fe9f['adminId'];_0x35fe9f['userEmail']=_0x35fe9f[_0x1126('0x1f')];_0x245cd7(_0x35fe9f);}});};}function createEndUser(_0x39bf0e,_0x55e195,_0x2fb797,_0x23d2bc,_0x4a334a){logger[_0x1126('0x10')]('['+[_0x39bf0e['toUpperCase']()]+_0x1126('0x20'),_0x2fb797);return new Promise(function(_0x4bd50b,_0x771bb8){var _0x583ce6={'method':_0x1126('0x21'),'uri':_0x23d2bc+'sys_user?'+_0x4a334a,'body':{'user_name':_0x2fb797['endUserNumber'],'roles':'user','first_name':_0x2fb797[_0x1126('0x22')],'active':_0x1126('0x1b'),'date_format':_0x1126('0x23'),'phone':_0x2fb797['endUserNumber']},'auth':_0x55e195,'json':!![]};return rp(_0x583ce6)[_0x1126('0x18')](function(_0x226afb){logger['info']('['+[_0x39bf0e[_0x1126('0x11')]()]+_0x1126('0x24'),_0x226afb[_0x1126('0xd')]);_0x2fb797[_0x1126('0x25')]=_0x226afb['result']['sys_id'];_0x4bd50b(_0x2fb797);})[_0x1126('0x13')](function(_0x19e6e4){logger[_0x1126('0x14')]('['+[_0x39bf0e[_0x1126('0x11')]()]+']',_0x19e6e4['message']);_0x771bb8(_0x19e6e4[_0x1126('0x15')]);});});}function getEndUser(_0x6f4312,_0x313ebe,_0x22436c,_0x3b0f79,_0x5df232){return function(_0x2a0dfe){logger[_0x1126('0x10')]('['+[_0x6f4312[_0x1126('0x11')]()]+_0x1126('0x26'),_0x2a0dfe);return new Promise(function(_0x5c019d,_0x4ca51c){var _0x22827a={'method':_0x1126('0x16'),'uri':_0x22436c+'sys_user?sysparm_query=phone%3D'+_0x2a0dfe[_0x1126('0x22')]+'&'+_0x3b0f79+'&'+_0x5df232,'auth':_0x313ebe,'json':!![]};return rp(_0x22827a)[_0x1126('0x18')](function(_0x11b0f6){if(_0x11b0f6['result']['length']>0x0){_0x2a0dfe[_0x1126('0x25')]=_0x11b0f6[_0x1126('0xd')][0x0][_0x1126('0xf')];logger[_0x1126('0x10')]('['+[_0x6f4312['toUpperCase']()]+_0x1126('0x27'),_0x2a0dfe);_0x5c019d(_0x2a0dfe);}else{return createEndUser(_0x6f4312,_0x313ebe,_0x2a0dfe,_0x22436c,_0x3b0f79)['then'](function(_0x8abfe3){logger[_0x1126('0x10')]('['+[_0x6f4312[_0x1126('0x11')]()]+_0x1126('0x28'),_0x8abfe3);_0x5c019d(_0x8abfe3);});}})[_0x1126('0x13')](function(_0x5746f6){logger[_0x1126('0x14')]('['+[_0x6f4312[_0x1126('0x11')]()]+']',_0x5746f6[_0x1126('0x15')]);_0x4ca51c(_0x5746f6[_0x1126('0x15')]);});});};}function getCustomFields(_0x3469a2,_0x3442b8){var _0x3052f9={};if(_0x3469a2['length']>0x0){_[_0x1126('0x29')](_0x3469a2,function(_0x154c28){if(_0x154c28[_0x1126('0x2a')]===_0x1126('0x2b')&&_0x154c28[_0x1126('0x2c')]&&!_0x154c28['customField']){_0x3052f9[_0x154c28['idField'][_0x1126('0x2d')]()]=_0x154c28[_0x1126('0x2e')][_0x1126('0x2f')]();}else if(_0x154c28[_0x1126('0x2a')]===_0x1126('0x2b')&&_0x154c28[_0x1126('0x30')]&&_0x154c28['customField']){_0x3052f9[_0x154c28['idField']['toLowerCase']()]=_0x154c28[_0x1126('0x2e')]['toString']();}else if(_0x154c28[_0x1126('0x2a')]===_0x1126('0x31')&&_0x154c28[_0x1126('0x32')]&&_0x154c28[_0x1126('0x30')]&&_0x154c28['customField']){_0x3052f9[_0x154c28['idField'][_0x1126('0x2d')]()]=_0x3442b8[_0x154c28[_0x1126('0x32')]][_0x1126('0x2f')]();}else if(_0x154c28['type']===_0x1126('0x33')&&_0x154c28['Variable']&&_0x154c28[_0x1126('0x34')]['name']&&_0x154c28[_0x1126('0x30')]&&_0x154c28[_0x1126('0x35')]){_0x3052f9[_0x154c28[_0x1126('0x30')]['toLowerCase']()]=_0x3442b8[_0x154c28[_0x1126('0x34')][_0x1126('0x36')][_0x1126('0x2d')]()]['toString']();}});}return _0x3052f9;}function getTicket(_0x58ff3a,_0x4dd7f5,_0x6e78cf,_0x520b62,_0x1e197e,_0x507568){return function(_0x2f45b9){logger[_0x1126('0x10')]('['+[_0x58ff3a[_0x1126('0x11')]()]+_0x1126('0x37'),_0x2f45b9);return new Promise(function(_0xede3d8,_0x56732f){var _0x198173=_0x58ff3a[_0x1126('0x2d')]()==='outbound'?_0x2f45b9[_0x1126('0x1e')]:_0x2f45b9[_0x1126('0x25')];var _0x575f79={'method':_0x1126('0x21'),'uri':_0x6e78cf+_0x1126('0x38')+'?'+_0x507568,'body':Object['assign']({},{'active':_0x1126('0x1b'),'caller_id':_0x198173,'assigned_to':_0x2f45b9[_0x1126('0x1e')],'short_description':intUtil[_0x1126('0x39')](_0x520b62['Subjects'],_0x1e197e,'\x20'),'description':intUtil[_0x1126('0x39')](_0x520b62[_0x1126('0x3a')],_0x1e197e,'\x0a')},getCustomFields(_0x520b62[_0x1126('0x3b')],_0x1e197e)),'auth':_0x4dd7f5,'json':!![]};return rp(_0x575f79)[_0x1126('0x18')](function(_0x224456){logger[_0x1126('0x10')]('['+[_0x58ff3a[_0x1126('0x11')]()]+_0x1126('0x3c'),_0x224456['result']);_0x2f45b9[_0x1126('0x3d')]=_0x224456['result'][_0x1126('0xf')];_0x2f45b9[_0x1126('0x3e')]=_0x224456['result']['number'];logger[_0x1126('0x10')]('['+[_0x58ff3a[_0x1126('0x11')]()]+_0x1126('0x3f'),_0x2f45b9);_0xede3d8(_0x2f45b9);})['catch'](function(_0x3cb44c){logger[_0x1126('0x14')]('['+[_0x58ff3a[_0x1126('0x11')]()]+']',_0x3cb44c[_0x1126('0x15')]);_0x56732f(_0x3cb44c['message']);});});};}function createRemoteTag(_0x30d1b3,_0x46551f,_0x5c36b9,_0x4bcc08){return new Promise(function(_0x4abb4d,_0x526b07){var _0x386c10={'method':_0x1126('0x21'),'uri':_0x5c36b9+'label'+'?'+_0x4bcc08,'body':{'short_description':_0x30d1b3,'global':!![],'active':!![],'name':_0x30d1b3},'auth':_0x46551f,'json':!![]};return rp(_0x386c10)[_0x1126('0x18')](function(_0x1c7a2b){var _0x38093e=_0x1c7a2b[_0x1126('0xd')][_0x1126('0xf')];_0x4abb4d(_0x38093e);});});}function getRemoteTag(_0x4e4d49,_0x41cbb6,_0x267592,_0x5d6414,_0x322016){return new Promise(function(_0x476aca,_0xcc9499){var _0x36b61={'method':_0x1126('0x16'),'uri':_0x267592+'label'+_0x1126('0x40')+_0x4e4d49+'&'+_0x5d6414,'auth':_0x41cbb6,'json':!![]};return rp(_0x36b61)['then'](function(_0x868b2c){if(_0x868b2c[_0x1126('0xd')][_0x1126('0x19')]>0x0){var _0x590bc2=_0x868b2c[_0x1126('0xd')][0x0][_0x1126('0xf')];_0x476aca(_0x590bc2);}else{return createRemoteTag(_0x4e4d49,_0x41cbb6,_0x267592,_0x5d6414)['then'](function(_0x30812d){_0x476aca(_0x30812d);});}});});}function assignTagToIncident(_0x25038f,_0x9bad53,_0x5a5340,_0x2fe6dc,_0x3377db){return new Promise(function(_0x22ab18,_0x308ee4){var _0x128c94={'method':_0x1126('0x21'),'uri':_0x5a5340+_0x1126('0x41')+'?'+_0x3377db,'body':{'label':_0x25038f,'table':_0x1126('0x38'),'id_type':'Incident','table_key':_0x2fe6dc[_0x1126('0x3d')],'title':_0x1126('0x42')+_0x2fe6dc[_0x1126('0x3e')],'id_display':_0x2fe6dc[_0x1126('0x3e')]},'auth':_0x9bad53,'json':!![]};return rp(_0x128c94)[_0x1126('0x18')](function(_0x4f5772){_0x22ab18();})[_0x1126('0x13')](function(){_0x22ab18();});});}function manageTags(_0x315386,_0x5e0ea1,_0x3767e4,_0x5246aa,_0x272274,_0x10ff91,_0x478806){return new Promise(function(_0x3062d6,_0x21d4ef){var _0x375b76=[];_0x5e0ea1['forEach'](function(_0x13394f){_0x375b76['push'](getRemoteTag(_0x13394f,_0x3767e4,_0x5246aa,_0x10ff91,_0x478806));});return Promise['all'](_0x375b76)[_0x1126('0x18')](function(_0x40185f){if(_0x40185f[_0x1126('0x19')]){logger[_0x1126('0x10')]('['+[_0x315386[_0x1126('0x11')]()]+_0x1126('0x43'),_0x40185f);var _0x1a0e26=[];_0x40185f['forEach'](function(_0x191307){_0x1a0e26[_0x1126('0x44')](assignTagToIncident(_0x191307,_0x3767e4,_0x5246aa,_0x272274,_0x10ff91));});return Promise[_0x1126('0x45')](_0x1a0e26)[_0x1126('0x18')](function(){_0x3062d6();})[_0x1126('0x13')](function(){_0x3062d6();});}else{_0x3062d6();}});});}function getTags(_0x3cd788,_0x5a0804,_0x5b17d6,_0x16a343,_0x3921c2,_0x4bf2b3){return function(_0x5ee130){return new Promise(function(_0x5e9260,_0x51a28d){var _0x964a2=[];var _0x37b1ab=_0x16a343[_0x1126('0x46')];if(_0x37b1ab&&_0x37b1ab['length']>0x0){_0x964a2=_[_0x1126('0x47')](_0x37b1ab,_0x1126('0x36'));}if(_0x964a2[_0x1126('0x19')]>0x0){return manageTags(_0x3cd788,_0x964a2,_0x5a0804,_0x5b17d6,_0x5ee130,_0x3921c2,_0x4bf2b3)[_0x1126('0x18')](function(){_0x5e9260(_0x5ee130);});}else{_0x5e9260(_0x5ee130);}});};}function emit(_0x22d403,_0x3f007b,_0x131056){var _0x49a0a3=_0x1126('0x48')+_0x1126('0x49')+_0x1126('0x4a')+_0x1126('0x4b');var _0x288b9b={'uri':_0x22d403+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x131056+_0x49a0a3};io['to'](util['format'](_0x1126('0x4c'),_0x3f007b))[_0x1126('0x4d')]('trigger:browser:url',_0x288b9b);}exports['cs']=function(_0x3bf25d,_0x1fb2f0,_0x366675,_0x6a41c0,_0x2828d4,_0x30d240,_0x41ce78,_0x247f12){var _0xd20fbe={};var _0x3d5e15={'user':_0x30d240[_0x1126('0x4e')],'pass':_0x30d240[_0x1126('0x4f')]};var _0x3dad39='sysparm_limit=1';var _0x111f49=_0x1126('0x50');_0x30d240[_0x1126('0x51')]=intUtil['stripTrailingSlash'](_0x30d240['remoteUri']);_0x30d240[_0x1126('0x52')]=intUtil[_0x1126('0x53')](_0x30d240[_0x1126('0x52')]);var _0x3bfeb8=util['format']('%s/api/now/table/',_0x30d240['remoteUri']);_0xd20fbe[_0x1126('0x54')]=!_[_0x1126('0x55')](_0x6a41c0)?_0x6a41c0[_0x1126('0x56')]:null;_0xd20fbe[_0x1126('0x1f')]=_0x30d240['email'];_0xd20fbe[_0x1126('0x22')]=_0x247f12['toLowerCase']()===_0x1126('0x57')?_0x1fb2f0[_0x1126('0x58')]:_0x1fb2f0[_0x1126('0x59')];_0xd20fbe[_0x1126('0x5a')]=_0x247f12===_0x1126('0x5b')||_0x247f12===_0x1126('0x5c')?_0x1126('0x5b'):'outbound';var _0xfd2d9=util['format'](_0x1126('0x5d'),_0x30d240[_0x1126('0x52')],_0x1fb2f0['uniqueid'],md5(_0x1fb2f0[_0x1126('0x5e')]));if(_0x2828d4&&_0x2828d4[_0x1126('0x5f')]){logger['info'](_0x1126('0x60'),_0x1126('0x61'));_0x1fb2f0['recordingURL']=_0xfd2d9;}else if(_0x41ce78&&_0x41ce78['recordingFormat']&&_0x41ce78[_0x1126('0x62')]!==_0x1126('0x63')){logger[_0x1126('0x10')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1fb2f0['recordingURL']=_0xfd2d9;}else{_0x1fb2f0[_0x1126('0x64')]='';}return getAdminUser(_0x247f12,_0x3d5e15,_0xd20fbe,_0x3bfeb8,_0x111f49,_0x3dad39)['then'](getUser(_0x247f12,_0x3d5e15,_0x3bfeb8,_0x111f49,_0x3dad39))['then'](getEndUser(_0x247f12,_0x3d5e15,_0x3bfeb8,_0x111f49,_0x3dad39))[_0x1126('0x18')](getTicket(_0x247f12,_0x3d5e15,_0x3bfeb8,_0x366675,_0x1fb2f0,_0x111f49))['then'](function(_0x1f320e){logger[_0x1126('0x10')](util['format'](_0x1126('0x65'),_0x1f320e[_0x1126('0x3d')]));logger[_0x1126('0x10')](util[_0x1126('0x66')](_0x1126('0x67'),_0x247f12));if(_0x247f12!=='unmanaged'){logger[_0x1126('0x10')]('['+[_0x247f12[_0x1126('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x30d240[_0x1126('0x51')],_0x6a41c0[_0x1126('0x36')],_0x1f320e[_0x1126('0x3d')]);}})[_0x1126('0x13')](function(_0x2598a7){logger[_0x1126('0x14')]('['+[_0x247f12[_0x1126('0x11')]()]+_0x1126('0x68'),util[_0x1126('0x69')](_0x2598a7,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index fbc1a02..1fe85ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe558=['defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','assigned_user_id','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','toString','base64','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','Agent\x20found!','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','phone_home','length','Enduser\x20found!','first_name','<unknown>','Caller\x20-\x20%s','[HTTP]','merge','map','type','string','nameField','customField','content','idField','variable','customVariable','Variable','toLowerCase','POST','login','username','password','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','recordingFormat','none','[OUTBOUND]','destcalleridname','Fields','Outbound','error','unmanaged','lastevent','toUpperCase','The\x20User\x20ID\x20is:','calleridname','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0xe558,0x70));var _0x8e55=function(_0x4f5501,_0xfed08e){_0x4f5501=_0x4f5501-0x0;var _0x240024=_0xe558[_0x4f5501];return _0x240024;};'use strict';var _=require(_0x8e55('0x0'));var rp=require(_0x8e55('0x1'));var BPromise=require(_0x8e55('0x2'));var md5=require(_0x8e55('0x3'));var util=require(_0x8e55('0x4'));var Redis=require(_0x8e55('0x5'));var intUtil=require(_0x8e55('0x6'));var config=require(_0x8e55('0x7'));var logger=require(_0x8e55('0x8'))('sugarcrm');config[_0x8e55('0x9')]=_[_0x8e55('0xa')](config[_0x8e55('0x9')],{'host':_0x8e55('0xb'),'port':0x18eb});var io=require(_0x8e55('0xc'))(new Redis(config[_0x8e55('0x9')]));var def={'method':'POST','json':!![]};function emit(_0xe27f09,_0x429679,_0x59e61d){io['to'](_0xe27f09)[_0x8e55('0xd')](_0x429679,_0x59e61d);}function getTicket(_0x578110,_0x570b31,_0x50966f,_0x531361,_0x5a6168,_0x527ad3,_0x3d07f8,_0x39fa76){logger[_0x8e55('0xe')](_0x8e55('0xf'));var _0x5867c7=new Date();var _0x3b42e5=[{'name':'name','value':intUtil['getString'](_0x531361['Subjects'],_0x5a6168,'\x20')},{'name':_0x8e55('0x10'),'value':_0x570b31['id']},{'name':'created_by','value':_0x570b31['id']},{'name':_0x8e55('0x11'),'value':intUtil[_0x8e55('0x12')](_0x531361[_0x8e55('0x13')],_0x5a6168,'\x0a')},{'name':_0x8e55('0x14'),'value':_0x5867c7[_0x8e55('0x15')]()[_0x8e55('0x16')](0x0,0x13)[_0x8e55('0x17')]('T','\x20')},{'name':_0x8e55('0x18'),'value':'0'},{'name':_0x8e55('0x19'),'value':'15'},{'name':_0x8e55('0x1a'),'value':_0x50966f['id']},{'name':_0x8e55('0x1b'),'value':_0x8e55('0x1c')},{'name':_0x8e55('0x1d'),'value':_0x50966f[_0x8e55('0x1e')]},{'name':_0x8e55('0x1f'),'value':_0x39fa76}];if(_0x527ad3['length']){_[_0x8e55('0x20')](_0x527ad3,function(_0x1e5d1f){if(_0x5a6168[_0x1e5d1f[_0x8e55('0x21')]]){_0x3b42e5[_0x8e55('0x22')]({'name':_0x1e5d1f['idField'],'value':_0x5a6168[_0x1e5d1f[_0x8e55('0x21')]]});}});}return request({'form':{'method':_0x8e55('0x23'),'input_type':_0x8e55('0x24'),'response_type':_0x8e55('0x24'),'rest_data':JSON[_0x8e55('0x25')]({'session':_0x3d07f8['id'],'module_name':_0x8e55('0x26'),'name_value_list':_0x3b42e5})}});}function getAuth(_0x2b7e2e){return util[_0x8e55('0x27')]('Basic\x20%s',new Buffer(_0x2b7e2e['apiKey']+':X')[_0x8e55('0x28')](_0x8e55('0x29')));}function getServerInfo(_0x69d8a7){return request({'form':{'method':'get_server_info','input_type':_0x8e55('0x24'),'response_type':_0x8e55('0x24'),'rest_data':JSON[_0x8e55('0x25')]({'session':_0x69d8a7['id']})}});}function getUser(_0xa9484f,_0x12816e,_0x25a8f3){if(!_['isNil'](_0x12816e)){logger[_0x8e55('0xe')](_0x8e55('0x2a'),_0x12816e);return request({'form':{'method':'get_entry_list','input_type':_0x8e55('0x24'),'response_type':_0x8e55('0x24'),'rest_data':JSON[_0x8e55('0x25')]({'session':_0x25a8f3['id'],'module_name':_0x8e55('0x2b'),'query':util[_0x8e55('0x27')](_0x8e55('0x2c'),_0x12816e),'order_by':'','offset':'0','select_fields':['id',_0x8e55('0x1e'),_0x8e55('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8e55('0x2e')](function(_0x45fedf){if(_0x45fedf[_0x8e55('0x2f')]['length']){var _0xffe6cb=_[_0x8e55('0x30')](_0x45fedf[_0x8e55('0x2f')],function(_0x2a8ccb){return _0x2a8ccb['name_value_list'][_0x8e55('0x2d')]['value']===_0x12816e;});if(_0xffe6cb){logger[_0x8e55('0xe')](_0x8e55('0x31'));return BPromise['resolve']({'id':_0xffe6cb[_0x8e55('0x32')]['id'][_0x8e55('0x33')],'name':_0xffe6cb[_0x8e55('0x32')]['name'][_0x8e55('0x33')]});}}logger[_0x8e55('0xe')](_0x8e55('0x34'));return BPromise[_0x8e55('0x35')]({'id':_0x25a8f3[_0x8e55('0x32')][_0x8e55('0x36')][_0x8e55('0x33')],'name':_0x25a8f3[_0x8e55('0x32')]['user_name']['value']});});}else{logger['info'](_0x8e55('0x37'));return BPromise[_0x8e55('0x35')]({'id':_0x25a8f3[_0x8e55('0x32')]['user_id'][_0x8e55('0x33')],'name':_0x25a8f3['name_value_list']['user_name'][_0x8e55('0x33')]});}}function getEndUser(_0x33c44c,_0x519a3f,_0x260ca1,_0x1a33f1){logger[_0x8e55('0xe')](_0x8e55('0x38'),_0x260ca1);return request({'form':{'method':_0x8e55('0x39'),'input_type':'JSON','response_type':_0x8e55('0x24'),'rest_data':JSON[_0x8e55('0x25')]({'session':_0x1a33f1['id'],'module_name':_0x8e55('0x1c'),'query':util[_0x8e55('0x27')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x260ca1),'order_by':'','offset':'0','select_fields':['id',_0x8e55('0x1e'),_0x8e55('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8e55('0x2e')](function(_0x517048){if(_0x517048[_0x8e55('0x2f')][_0x8e55('0x3b')]){var _0x3690a1=_[_0x8e55('0x30')](_0x517048[_0x8e55('0x2f')],function(_0x117eb8){return _0x117eb8['name_value_list'][_0x8e55('0x3a')][_0x8e55('0x33')]===_0x260ca1;});if(_0x3690a1){logger[_0x8e55('0xe')](_0x8e55('0x3c'));return BPromise[_0x8e55('0x35')]({'id':_0x3690a1[_0x8e55('0x32')]['id']['value'],'name':_0x3690a1[_0x8e55('0x32')][_0x8e55('0x1e')][_0x8e55('0x33')],'phone':_0x3690a1[_0x8e55('0x32')][_0x8e55('0x3a')][_0x8e55('0x33')]});}}else{logger[_0x8e55('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':_0x8e55('0x24'),'response_type':_0x8e55('0x24'),'rest_data':JSON[_0x8e55('0x25')]({'session':_0x1a33f1['id'],'module_name':_0x8e55('0x1c'),'name_value_list':[{'name':_0x8e55('0x3d'),'value':_0x519a3f!==_0x8e55('0x3e')?_0x519a3f:util['format'](_0x8e55('0x3f'),_0x260ca1)},{'name':_0x8e55('0x3a'),'value':_0x260ca1}]})}})[_0x8e55('0x2e')](function(_0x1cd125){logger[_0x8e55('0xe')]('Enduser\x20created.');return BPromise[_0x8e55('0x35')]({'id':_0x1cd125['id'],'name':_0x1cd125['entry_list'][_0x8e55('0x3d')][_0x8e55('0x33')],'phone':_0x1cd125['entry_list'][_0x8e55('0x3a')][_0x8e55('0x33')]});});}});}function request(_0x57b688){logger['debug'](_0x8e55('0x40'),JSON[_0x8e55('0x25')](_0x57b688));return rp(_[_0x8e55('0x41')](def,_0x57b688));}function getTags(_0x1ed422,_0xab4ec5){var _0x20f27f=[];if(_0x1ed422&&_0x1ed422[_0x8e55('0x3b')]>0x0){_0x20f27f=_[_0x8e55('0x42')](_0x1ed422,_0xab4ec5);}return _0x20f27f;}function getCustomFields(_0x1d54b8,_0x18be24){var _0x4bef48=[];var _0x601618={'custom_fields':[]};if(_0x1d54b8[_0x8e55('0x3b')]>0x0){_['forEach'](_0x1d54b8,function(_0x46c0da){if(_0x46c0da[_0x8e55('0x43')]===_0x8e55('0x44')&&_0x46c0da[_0x8e55('0x45')]&&!_0x46c0da[_0x8e55('0x46')]){_0x601618[_0x46c0da['nameField']['toLowerCase']()]=_0x46c0da[_0x8e55('0x47')][_0x8e55('0x28')]();}else if(_0x46c0da[_0x8e55('0x43')]==='string'&&_0x46c0da[_0x8e55('0x48')]&&_0x46c0da['customField']){_0x601618['custom_fields'][_0x8e55('0x22')]({'id':_0x46c0da[_0x8e55('0x48')],'value':_0x46c0da[_0x8e55('0x47')][_0x8e55('0x28')]()});}else if(_0x46c0da[_0x8e55('0x43')]===_0x8e55('0x49')&&_0x46c0da[_0x8e55('0x21')]&&_0x46c0da[_0x8e55('0x48')]&&_0x46c0da['customField']){_0x18be24[_0x46c0da[_0x8e55('0x21')]]&&_0x601618['custom_fields']['push']({'id':_0x46c0da[_0x8e55('0x48')],'value':_0x18be24[_0x46c0da[_0x8e55('0x21')]][_0x8e55('0x28')]()});}else if(_0x46c0da[_0x8e55('0x43')]===_0x8e55('0x4a')&&_0x46c0da[_0x8e55('0x4b')]&&_0x46c0da[_0x8e55('0x4b')][_0x8e55('0x1e')]&&_0x46c0da[_0x8e55('0x48')]&&_0x46c0da[_0x8e55('0x46')]){_0x18be24[_0x46c0da[_0x8e55('0x4b')][_0x8e55('0x1e')][_0x8e55('0x4c')]()]&&_0x601618['custom_fields']['push']({'id':_0x46c0da[_0x8e55('0x48')],'value':_0x18be24[_0x46c0da[_0x8e55('0x4b')][_0x8e55('0x1e')]['toLowerCase']()][_0x8e55('0x28')]()});}});}return _0x601618;}function getConnection(_0x42e2fb){return request({'method':_0x8e55('0x4d'),'form':{'method':_0x8e55('0x4e'),'input_type':_0x8e55('0x24'),'response_type':_0x8e55('0x24'),'rest_data':JSON[_0x8e55('0x25')]({'user_auth':{'user_name':_0x42e2fb[_0x8e55('0x4f')],'password':_0x42e2fb[_0x8e55('0x50')],'encryption':'PLAIN'},'application':_0x8e55('0x51')})}})[_0x8e55('0x2e')](function(_0x329e76){var _0x289ee4=_0x329e76;if(_0x289ee4['id']){def['sessionID']=_0x289ee4['id'];return BPromise[_0x8e55('0x35')](_0x289ee4);}else{throw new Error(util[_0x8e55('0x27')](_0x8e55('0x52'),_0x42e2fb['id']));}});}function setRelationship(_0x474df9,_0x2e2098,_0x47778e,_0x1fbf99){return request({'form':{'method':_0x8e55('0x53'),'input_type':'JSON','response_type':_0x8e55('0x24'),'rest_data':JSON[_0x8e55('0x25')]({'session':_0x474df9['id'],'module_name':'Calls','module_id':_0x47778e['id'],'link_field_name':_0x1fbf99,'related_ids':[_0x2e2098['id']]})}});}exports['queue']=function(_0x9867fa,_0x4e7728,_0x20dabd,_0x3bbf28,_0x3677c4,_0xab6a2a){var _0x193e5a,_0x591f4c,_0x64f2f6,_0x324551;_0xab6a2a[_0x8e55('0x54')]=intUtil[_0x8e55('0x55')](_0xab6a2a[_0x8e55('0x54')]);_0xab6a2a[_0x8e55('0x56')]=intUtil['stripTrailingSlash'](_0xab6a2a[_0x8e55('0x56')]);def[_0x8e55('0x57')]=util['format'](_0x8e55('0x58'),_0xab6a2a['remoteUri']);if(_0x3677c4&&_0x3677c4[_0x8e55('0x59')]){logger[_0x8e55('0xe')](_0x8e55('0x5a'),_0x8e55('0x5b'));_0x4e7728[_0x8e55('0x5c')]=util[_0x8e55('0x27')](_0x8e55('0x5d'),_0xab6a2a[_0x8e55('0x56')],_0x4e7728[_0x8e55('0x5e')],md5(_0x4e7728[_0x8e55('0x5e')]));}else{_0x4e7728[_0x8e55('0x5c')]='';}return getConnection(_0xab6a2a)['then'](function(_0x3d76bd){_0x324551=_0x3d76bd;return getUser(_0xab6a2a,_0x3bbf28['name'],_0x324551);})[_0x8e55('0x2e')](function(_0xecb51c){_0x193e5a=_0xecb51c;logger[_0x8e55('0xe')]('The\x20User\x20ID\x20is:',_0x193e5a['id']);return getEndUser(_0xab6a2a,_0x4e7728['calleridname'],_0x4e7728[_0x8e55('0x5f')],_0x324551);})[_0x8e55('0x2e')](function(_0x194d9f){_0x591f4c=_0x194d9f;logger[_0x8e55('0xe')](_0x8e55('0x60'),_0x591f4c['id']);return getTicket(_0xab6a2a,_0x193e5a,_0x591f4c,_0x20dabd,_0x4e7728,_0x20dabd['Fields'],_0x324551,_0x8e55('0x61'));})[_0x8e55('0x2e')](function(_0x3b3ed4){_0x64f2f6=_0x3b3ed4;logger['info'](_0x8e55('0x62'));logger[_0x8e55('0xe')](_0x8e55('0x63'),_0x64f2f6['id']);return setRelationship(_0x324551,_0x193e5a,_0x64f2f6,_0x8e55('0x64'));})[_0x8e55('0x2e')](function(){return setRelationship(_0x324551,_0x591f4c,_0x64f2f6,_0x8e55('0x65'));})[_0x8e55('0x2e')](function(){return getServerInfo(_0x324551);})['then'](function(_0xb9f1ec){var _0x23d681=parseInt(_0xb9f1ec[_0x8e55('0x66')][_0x8e55('0x67')](0x0));var _0x5f25fd=util[_0x8e55('0x27')](_0x8e55('0x68'),_0xab6a2a['remoteUri'],_0x64f2f6['id']);if(_0x23d681>0x6){_0x5f25fd=util[_0x8e55('0x27')](_0x8e55('0x69'),_0xab6a2a[_0x8e55('0x54')],_0x64f2f6['id']);}logger[_0x8e55('0xe')]('[QUEUE]',_0x8e55('0x6a'));emit(util['format'](_0x8e55('0x6b'),_0x3bbf28[_0x8e55('0x1e')]),_0x8e55('0x6c'),{'uri':_0x5f25fd});})[_0x8e55('0x6d')](function(_0x28da47){logger['error'](_0x8e55('0x5a'),JSON[_0x8e55('0x25')](_0x28da47));});};exports['outbound']=function(_0x5cba04,_0x10f82b,_0x40bc32,_0x3fd1c3,_0x28efd2,_0x4b5bb2,_0x506353){var _0x6dafa7,_0x3de159,_0x5e99e7,_0x21f361;_0x4b5bb2[_0x8e55('0x54')]=intUtil['stripTrailingSlash'](_0x4b5bb2[_0x8e55('0x54')]);_0x4b5bb2[_0x8e55('0x56')]=intUtil[_0x8e55('0x55')](_0x4b5bb2[_0x8e55('0x56')]);def[_0x8e55('0x57')]=util[_0x8e55('0x27')](_0x8e55('0x58'),_0x4b5bb2[_0x8e55('0x54')]);if(_0x506353&&_0x506353[_0x8e55('0x6e')]&&_0x506353[_0x8e55('0x6e')]!==_0x8e55('0x6f')){logger[_0x8e55('0xe')](_0x8e55('0x70'),_0x8e55('0x5b'));_0x10f82b[_0x8e55('0x5c')]=util[_0x8e55('0x27')](_0x8e55('0x5d'),_0x4b5bb2['serverUrl'],_0x10f82b[_0x8e55('0x5e')],md5(_0x10f82b['uniqueid']));}return getConnection(_0x4b5bb2)['then'](function(_0xa1693e){_0x21f361=_0xa1693e;return getUser(_0x4b5bb2,_0x3fd1c3[_0x8e55('0x1e')],_0x21f361);})[_0x8e55('0x2e')](function(_0x30fc1a){_0x6dafa7=_0x30fc1a;logger[_0x8e55('0xe')]('The\x20User\x20ID\x20is:',_0x6dafa7['id']);return getEndUser(_0x4b5bb2,_0x10f82b[_0x8e55('0x71')],_0x10f82b['destcalleridnum'],_0x21f361);})[_0x8e55('0x2e')](function(_0x3026a8){_0x3de159=_0x3026a8;logger[_0x8e55('0xe')](_0x8e55('0x60'),_0x3de159['id']);return getTicket(_0x4b5bb2,_0x6dafa7,_0x3de159,_0x40bc32,_0x10f82b,_0x40bc32[_0x8e55('0x72')],_0x21f361,_0x8e55('0x73'));})['then'](function(_0x231b62){_0x5e99e7=_0x231b62;logger['info'](_0x8e55('0x62'));logger[_0x8e55('0xe')](_0x8e55('0x63'),_0x5e99e7['id']);return setRelationship(_0x21f361,_0x6dafa7,_0x5e99e7,'users');})[_0x8e55('0x2e')](function(){return setRelationship(_0x21f361,_0x3de159,_0x5e99e7,_0x8e55('0x65'));})['then'](function(){return getServerInfo(_0x21f361);})['then'](function(_0x15b756){var _0x3c6fab=parseInt(_0x15b756[_0x8e55('0x66')][_0x8e55('0x67')](0x0));var _0x3f97ac=util[_0x8e55('0x27')](_0x8e55('0x68'),_0x4b5bb2[_0x8e55('0x54')],_0x5e99e7['id']);if(_0x3c6fab>0x6){_0x3f97ac=util[_0x8e55('0x27')](_0x8e55('0x69'),_0x4b5bb2[_0x8e55('0x54')],_0x5e99e7['id']);}logger[_0x8e55('0xe')](_0x8e55('0x70'),_0x8e55('0x6a'));emit(util['format'](_0x8e55('0x6b'),_0x3fd1c3['name']),_0x8e55('0x6c'),{'uri':_0x3f97ac});})[_0x8e55('0x6d')](function(_0x1c7a76){logger[_0x8e55('0x74')]('[OUTBOUND]',JSON[_0x8e55('0x25')](_0x1c7a76));});};exports[_0x8e55('0x75')]=function(_0xb752dc,_0x32720d,_0x4ffaea,_0x2d5a90,_0x40466,_0x2bcab2){var _0x1d705d,_0x59110b,_0xf9e173,_0x2ae7ac;_0x2bcab2['remoteUri']=intUtil[_0x8e55('0x55')](_0x2bcab2['remoteUri']);_0x2bcab2[_0x8e55('0x56')]=intUtil[_0x8e55('0x55')](_0x2bcab2[_0x8e55('0x56')]);def[_0x8e55('0x57')]=util[_0x8e55('0x27')]('%s/service/v4_1/rest.php',_0x2bcab2['remoteUri']);if(_0x40466&&_0x40466[_0x8e55('0x59')]){logger[_0x8e55('0xe')]('['+_0x32720d[_0x8e55('0x76')][_0x8e55('0x77')]()+']',_0x8e55('0x5b'));_0x32720d[_0x8e55('0x5c')]=util[_0x8e55('0x27')](_0x8e55('0x5d'),_0x2bcab2[_0x8e55('0x56')],_0x32720d[_0x8e55('0x5e')],md5(_0x32720d[_0x8e55('0x5e')]));}else{_0x32720d[_0x8e55('0x5c')]='';}return getConnection(_0x2bcab2)[_0x8e55('0x2e')](function(_0xea70c1){_0x2ae7ac=_0xea70c1;if(!_['isNil'](_0x2d5a90)){return getUser(_0x2bcab2,_0x2d5a90[_0x8e55('0x1e')],_0x2ae7ac);}else{return getUser(_0x2bcab2,null,_0x2ae7ac);}})[_0x8e55('0x2e')](function(_0x27ddcd){_0x1d705d=_0x27ddcd;logger['info'](_0x8e55('0x78'),_0x1d705d['id']);return getEndUser(_0x2bcab2,_0x32720d[_0x8e55('0x79')],_0x32720d['calleridnum'],_0x2ae7ac);})['then'](function(_0xf6ec92){_0x59110b=_0xf6ec92;logger[_0x8e55('0xe')](_0x8e55('0x60'),_0x59110b['id']);return getTicket(_0x2bcab2,_0x1d705d,_0x59110b,_0x4ffaea,_0x32720d,_0x4ffaea[_0x8e55('0x72')],_0x2ae7ac,_0x8e55('0x61'));})[_0x8e55('0x2e')](function(_0x5a8004){_0xf9e173=_0x5a8004;logger[_0x8e55('0xe')](_0x8e55('0x62'));logger['info'](_0x8e55('0x63'),_0xf9e173['id']);return setRelationship(_0x2ae7ac,_0x1d705d,_0xf9e173,_0x8e55('0x64'));})['then'](function(){return setRelationship(_0x2ae7ac,_0x59110b,_0xf9e173,_0x8e55('0x65'));})[_0x8e55('0x2e')](function(){return getServerInfo(_0x2ae7ac);})[_0x8e55('0x6d')](function(_0x337ca5){logger[_0x8e55('0x74')]('['+_0x32720d['lastevent'][_0x8e55('0x77')]()+']',JSON[_0x8e55('0x25')](_0x337ca5));});};
\ No newline at end of file
+var _0xabce=['users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','outbound','recordingFormat','none','destcalleridnum','Outbound','[OUTBOUND]','trigger:browser:url','error','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','toISOString','slice','replace','duration_minutes','parent_id','parent_name','direction','length','forEach','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','set_entry','<unknown>','Caller\x20-\x20%s','first_name','debug','[HTTP]','merge','map','string','nameField','customField','toLowerCase','content','custom_fields','type','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0xabce,0x103));var _0xeabc=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xabce[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0xeabc('0x0'));var rp=require(_0xeabc('0x1'));var BPromise=require(_0xeabc('0x2'));var md5=require(_0xeabc('0x3'));var util=require(_0xeabc('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));config['redis']=_['defaults'](config[_0xeabc('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xeabc('0x9'))(new Redis(config['redis']));var def={'method':_0xeabc('0xa'),'json':!![]};function emit(_0x9417af,_0x8434c5,_0x5d59d5){io['to'](_0x9417af)[_0xeabc('0xb')](_0x8434c5,_0x5d59d5);}function getTicket(_0x341f16,_0x2f73e9,_0x1b4d1b,_0x4301e4,_0x283cdf,_0x111aaf,_0x28292c,_0xdb5022){logger[_0xeabc('0xc')](_0xeabc('0xd'));var _0x1c7eb0=new Date();var _0x435ea7=[{'name':_0xeabc('0xe'),'value':intUtil[_0xeabc('0xf')](_0x4301e4[_0xeabc('0x10')],_0x283cdf,'\x20')},{'name':'assigned_user_id','value':_0x2f73e9['id']},{'name':_0xeabc('0x11'),'value':_0x2f73e9['id']},{'name':_0xeabc('0x12'),'value':intUtil[_0xeabc('0xf')](_0x4301e4['Descriptions'],_0x283cdf,'\x0a')},{'name':'date_start','value':_0x1c7eb0[_0xeabc('0x13')]()[_0xeabc('0x14')](0x0,0x13)[_0xeabc('0x15')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xeabc('0x16'),'value':'15'},{'name':_0xeabc('0x17'),'value':_0x1b4d1b['id']},{'name':'parent_type','value':'Contacts'},{'name':_0xeabc('0x18'),'value':_0x1b4d1b['name']},{'name':_0xeabc('0x19'),'value':_0xdb5022}];if(_0x111aaf[_0xeabc('0x1a')]){_[_0xeabc('0x1b')](_0x111aaf,function(_0x16f08b){if(_0x283cdf[_0x16f08b[_0xeabc('0x1c')]]){_0x435ea7[_0xeabc('0x1d')]({'name':_0x16f08b[_0xeabc('0x1e')],'value':_0x283cdf[_0x16f08b[_0xeabc('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xeabc('0x1f'),'response_type':'JSON','rest_data':JSON[_0xeabc('0x20')]({'session':_0x28292c['id'],'module_name':_0xeabc('0x21'),'name_value_list':_0x435ea7})}});}function getAuth(_0x502947){return util[_0xeabc('0x22')](_0xeabc('0x23'),new Buffer(_0x502947[_0xeabc('0x24')]+':X')[_0xeabc('0x25')](_0xeabc('0x26')));}function getServerInfo(_0x4e99a4){return request({'form':{'method':_0xeabc('0x27'),'input_type':_0xeabc('0x1f'),'response_type':_0xeabc('0x1f'),'rest_data':JSON['stringify']({'session':_0x4e99a4['id']})}});}function getUser(_0x457f27,_0x3854d2,_0x214953){if(!_[_0xeabc('0x28')](_0x3854d2)){logger['info'](_0xeabc('0x29'),_0x3854d2);return request({'form':{'method':'get_entry_list','input_type':_0xeabc('0x1f'),'response_type':'JSON','rest_data':JSON[_0xeabc('0x20')]({'session':_0x214953['id'],'module_name':_0xeabc('0x2a'),'query':util[_0xeabc('0x22')](_0xeabc('0x2b'),_0x3854d2),'order_by':'','offset':'0','select_fields':['id',_0xeabc('0xe'),_0xeabc('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xeabc('0x2d')](function(_0x4c2693){if(_0x4c2693['entry_list'][_0xeabc('0x1a')]){var _0x5bf8f2=_[_0xeabc('0x2e')](_0x4c2693[_0xeabc('0x2f')],function(_0x48fb52){return _0x48fb52[_0xeabc('0x30')][_0xeabc('0x2c')][_0xeabc('0x31')]===_0x3854d2;});if(_0x5bf8f2){logger[_0xeabc('0xc')](_0xeabc('0x32'));return BPromise[_0xeabc('0x33')]({'id':_0x5bf8f2[_0xeabc('0x30')]['id'][_0xeabc('0x31')],'name':_0x5bf8f2[_0xeabc('0x30')]['name'][_0xeabc('0x31')]});}}logger['info'](_0xeabc('0x34'));return BPromise[_0xeabc('0x33')]({'id':_0x214953[_0xeabc('0x30')][_0xeabc('0x35')][_0xeabc('0x31')],'name':_0x214953[_0xeabc('0x30')][_0xeabc('0x2c')]['value']});});}else{logger[_0xeabc('0xc')](_0xeabc('0x36'));return BPromise[_0xeabc('0x33')]({'id':_0x214953['name_value_list'][_0xeabc('0x35')][_0xeabc('0x31')],'name':_0x214953[_0xeabc('0x30')]['user_name'][_0xeabc('0x31')]});}}function getEndUser(_0x36cc2f,_0x1f910d,_0x521091,_0xf98c7c){logger[_0xeabc('0xc')]('Searching\x20enduser\x20with\x20phone',_0x521091);return request({'form':{'method':'get_entry_list','input_type':_0xeabc('0x1f'),'response_type':_0xeabc('0x1f'),'rest_data':JSON['stringify']({'session':_0xf98c7c['id'],'module_name':_0xeabc('0x37'),'query':util[_0xeabc('0x22')](_0xeabc('0x38'),_0x521091),'order_by':'','offset':'0','select_fields':['id',_0xeabc('0xe'),_0xeabc('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x353e48){if(_0x353e48['entry_list'][_0xeabc('0x1a')]){var _0x2bda29=_[_0xeabc('0x2e')](_0x353e48['entry_list'],function(_0x532999){return _0x532999[_0xeabc('0x30')]['phone_home'][_0xeabc('0x31')]===_0x521091;});if(_0x2bda29){logger['info']('Enduser\x20found!');return BPromise['resolve']({'id':_0x2bda29['name_value_list']['id'][_0xeabc('0x31')],'name':_0x2bda29['name_value_list'][_0xeabc('0xe')][_0xeabc('0x31')],'phone':_0x2bda29['name_value_list'][_0xeabc('0x39')]['value']});}}else{logger[_0xeabc('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xeabc('0x3a'),'input_type':_0xeabc('0x1f'),'response_type':_0xeabc('0x1f'),'rest_data':JSON['stringify']({'session':_0xf98c7c['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x1f910d!==_0xeabc('0x3b')?_0x1f910d:util[_0xeabc('0x22')](_0xeabc('0x3c'),_0x521091)},{'name':'phone_home','value':_0x521091}]})}})['then'](function(_0x5cd62e){logger[_0xeabc('0xc')]('Enduser\x20created.');return BPromise[_0xeabc('0x33')]({'id':_0x5cd62e['id'],'name':_0x5cd62e['entry_list'][_0xeabc('0x3d')]['value'],'phone':_0x5cd62e['entry_list']['phone_home'][_0xeabc('0x31')]});});}});}function request(_0x37c926){logger[_0xeabc('0x3e')](_0xeabc('0x3f'),JSON['stringify'](_0x37c926));return rp(_[_0xeabc('0x40')](def,_0x37c926));}function getTags(_0x555d26,_0x7d5add){var _0x1a4bbe=[];if(_0x555d26&&_0x555d26[_0xeabc('0x1a')]>0x0){_0x1a4bbe=_[_0xeabc('0x41')](_0x555d26,_0x7d5add);}return _0x1a4bbe;}function getCustomFields(_0xc849c9,_0x48b988){var _0x482971=[];var _0x12ad6b={'custom_fields':[]};if(_0xc849c9['length']>0x0){_[_0xeabc('0x1b')](_0xc849c9,function(_0x2cdf59){if(_0x2cdf59['type']===_0xeabc('0x42')&&_0x2cdf59[_0xeabc('0x43')]&&!_0x2cdf59[_0xeabc('0x44')]){_0x12ad6b[_0x2cdf59[_0xeabc('0x43')][_0xeabc('0x45')]()]=_0x2cdf59[_0xeabc('0x46')][_0xeabc('0x25')]();}else if(_0x2cdf59['type']===_0xeabc('0x42')&&_0x2cdf59[_0xeabc('0x1e')]&&_0x2cdf59[_0xeabc('0x44')]){_0x12ad6b[_0xeabc('0x47')][_0xeabc('0x1d')]({'id':_0x2cdf59[_0xeabc('0x1e')],'value':_0x2cdf59[_0xeabc('0x46')][_0xeabc('0x25')]()});}else if(_0x2cdf59[_0xeabc('0x48')]===_0xeabc('0x49')&&_0x2cdf59['variableName']&&_0x2cdf59[_0xeabc('0x1e')]&&_0x2cdf59[_0xeabc('0x44')]){_0x48b988[_0x2cdf59[_0xeabc('0x1c')]]&&_0x12ad6b[_0xeabc('0x47')][_0xeabc('0x1d')]({'id':_0x2cdf59[_0xeabc('0x1e')],'value':_0x48b988[_0x2cdf59[_0xeabc('0x1c')]]['toString']()});}else if(_0x2cdf59[_0xeabc('0x48')]===_0xeabc('0x4a')&&_0x2cdf59[_0xeabc('0x4b')]&&_0x2cdf59[_0xeabc('0x4b')][_0xeabc('0xe')]&&_0x2cdf59['idField']&&_0x2cdf59[_0xeabc('0x44')]){_0x48b988[_0x2cdf59[_0xeabc('0x4b')][_0xeabc('0xe')][_0xeabc('0x45')]()]&&_0x12ad6b['custom_fields'][_0xeabc('0x1d')]({'id':_0x2cdf59[_0xeabc('0x1e')],'value':_0x48b988[_0x2cdf59['Variable'][_0xeabc('0xe')]['toLowerCase']()][_0xeabc('0x25')]()});}});}return _0x12ad6b;}function getConnection(_0x4f3cbc){return request({'method':_0xeabc('0xa'),'form':{'method':_0xeabc('0x4c'),'input_type':_0xeabc('0x1f'),'response_type':_0xeabc('0x1f'),'rest_data':JSON[_0xeabc('0x20')]({'user_auth':{'user_name':_0x4f3cbc[_0xeabc('0x4d')],'password':_0x4f3cbc[_0xeabc('0x4e')],'encryption':_0xeabc('0x4f')},'application':_0xeabc('0x50')})}})[_0xeabc('0x2d')](function(_0x48a13f){var _0x180a14=_0x48a13f;if(_0x180a14['id']){def[_0xeabc('0x51')]=_0x180a14['id'];return BPromise[_0xeabc('0x33')](_0x180a14);}else{throw new Error(util[_0xeabc('0x22')]('Account\x20%d\x20is\x20not\x20valid',_0x4f3cbc['id']));}});}function setRelationship(_0x1cef45,_0x392913,_0x10d56f,_0x21f972){return request({'form':{'method':'set_relationship','input_type':_0xeabc('0x1f'),'response_type':_0xeabc('0x1f'),'rest_data':JSON[_0xeabc('0x20')]({'session':_0x1cef45['id'],'module_name':_0xeabc('0x21'),'module_id':_0x10d56f['id'],'link_field_name':_0x21f972,'related_ids':[_0x392913['id']]})}});}exports[_0xeabc('0x52')]=function(_0x3b5e94,_0x14c322,_0x3ff38c,_0x17acf8,_0x58ab08,_0x4546c4){var _0x4cdb05,_0x5e09fc,_0x5e630a,_0x2d2d3b;_0x4546c4[_0xeabc('0x53')]=intUtil[_0xeabc('0x54')](_0x4546c4[_0xeabc('0x53')]);_0x4546c4[_0xeabc('0x55')]=intUtil[_0xeabc('0x54')](_0x4546c4['serverUrl']);def[_0xeabc('0x56')]=util[_0xeabc('0x22')](_0xeabc('0x57'),_0x4546c4[_0xeabc('0x53')]);if(_0x58ab08&&_0x58ab08[_0xeabc('0x58')]){logger[_0xeabc('0xc')](_0xeabc('0x59'),_0xeabc('0x5a'));_0x14c322['recordingURL']=util['format'](_0xeabc('0x5b'),_0x4546c4[_0xeabc('0x55')],_0x14c322[_0xeabc('0x5c')],md5(_0x14c322['uniqueid']));}else{_0x14c322[_0xeabc('0x5d')]='';}return getConnection(_0x4546c4)['then'](function(_0x5206eb){_0x2d2d3b=_0x5206eb;return getUser(_0x4546c4,_0x17acf8[_0xeabc('0xe')],_0x2d2d3b);})[_0xeabc('0x2d')](function(_0x13f04f){_0x4cdb05=_0x13f04f;logger[_0xeabc('0xc')](_0xeabc('0x5e'),_0x4cdb05['id']);return getEndUser(_0x4546c4,_0x14c322[_0xeabc('0x5f')],_0x14c322['calleridnum'],_0x2d2d3b);})[_0xeabc('0x2d')](function(_0x800880){_0x5e09fc=_0x800880;logger[_0xeabc('0xc')](_0xeabc('0x60'),_0x5e09fc['id']);return getTicket(_0x4546c4,_0x4cdb05,_0x5e09fc,_0x3ff38c,_0x14c322,_0x3ff38c[_0xeabc('0x61')],_0x2d2d3b,_0xeabc('0x62'));})['then'](function(_0xf3b0f3){_0x5e630a=_0xf3b0f3;logger[_0xeabc('0xc')](_0xeabc('0x63'));logger[_0xeabc('0xc')](_0xeabc('0x64'),_0x5e630a['id']);return setRelationship(_0x2d2d3b,_0x4cdb05,_0x5e630a,_0xeabc('0x65'));})[_0xeabc('0x2d')](function(){return setRelationship(_0x2d2d3b,_0x5e09fc,_0x5e630a,_0xeabc('0x66'));})[_0xeabc('0x2d')](function(){return getServerInfo(_0x2d2d3b);})['then'](function(_0xf74c56){var _0x590439=parseInt(_0xf74c56[_0xeabc('0x67')][_0xeabc('0x68')](0x0));var _0x3fea99=util[_0xeabc('0x22')](_0xeabc('0x69'),_0x4546c4[_0xeabc('0x53')],_0x5e630a['id']);if(_0x590439>0x6){_0x3fea99=util[_0xeabc('0x22')](_0xeabc('0x6a'),_0x4546c4[_0xeabc('0x53')],_0x5e630a['id']);}logger[_0xeabc('0xc')]('[QUEUE]',_0xeabc('0x6b'));emit(util[_0xeabc('0x22')](_0xeabc('0x6c'),_0x17acf8[_0xeabc('0xe')]),'trigger:browser:url',{'uri':_0x3fea99});})[_0xeabc('0x6d')](function(_0x49f059){logger['error'](_0xeabc('0x59'),JSON[_0xeabc('0x20')](_0x49f059));});};exports[_0xeabc('0x6e')]=function(_0x1c91e4,_0x4b7730,_0x51a0c7,_0x2e712e,_0x4ce3f4,_0x529b27,_0x44c0a6){var _0x4f1a4f,_0x4afc8e,_0xa44f2d,_0x1c84b5;_0x529b27['remoteUri']=intUtil['stripTrailingSlash'](_0x529b27[_0xeabc('0x53')]);_0x529b27['serverUrl']=intUtil[_0xeabc('0x54')](_0x529b27[_0xeabc('0x55')]);def['uri']=util['format'](_0xeabc('0x57'),_0x529b27[_0xeabc('0x53')]);if(_0x44c0a6&&_0x44c0a6[_0xeabc('0x6f')]&&_0x44c0a6[_0xeabc('0x6f')]!==_0xeabc('0x70')){logger['info']('[OUTBOUND]',_0xeabc('0x5a'));_0x4b7730['recordingURL']=util[_0xeabc('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x529b27[_0xeabc('0x55')],_0x4b7730['uniqueid'],md5(_0x4b7730[_0xeabc('0x5c')]));}return getConnection(_0x529b27)['then'](function(_0x449c29){_0x1c84b5=_0x449c29;return getUser(_0x529b27,_0x2e712e[_0xeabc('0xe')],_0x1c84b5);})[_0xeabc('0x2d')](function(_0x36cc41){_0x4f1a4f=_0x36cc41;logger['info'](_0xeabc('0x5e'),_0x4f1a4f['id']);return getEndUser(_0x529b27,_0x4b7730['destcalleridname'],_0x4b7730[_0xeabc('0x71')],_0x1c84b5);})[_0xeabc('0x2d')](function(_0x26d024){_0x4afc8e=_0x26d024;logger[_0xeabc('0xc')](_0xeabc('0x60'),_0x4afc8e['id']);return getTicket(_0x529b27,_0x4f1a4f,_0x4afc8e,_0x51a0c7,_0x4b7730,_0x51a0c7['Fields'],_0x1c84b5,_0xeabc('0x72'));})[_0xeabc('0x2d')](function(_0x4b9614){_0xa44f2d=_0x4b9614;logger[_0xeabc('0xc')]('Ticket\x20created!');logger[_0xeabc('0xc')](_0xeabc('0x64'),_0xa44f2d['id']);return setRelationship(_0x1c84b5,_0x4f1a4f,_0xa44f2d,_0xeabc('0x65'));})[_0xeabc('0x2d')](function(){return setRelationship(_0x1c84b5,_0x4afc8e,_0xa44f2d,'contacts');})[_0xeabc('0x2d')](function(){return getServerInfo(_0x1c84b5);})[_0xeabc('0x2d')](function(_0x287f88){var _0x460520=parseInt(_0x287f88['version']['charAt'](0x0));var _0x30e9eb=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x529b27[_0xeabc('0x53')],_0xa44f2d['id']);if(_0x460520>0x6){_0x30e9eb=util[_0xeabc('0x22')](_0xeabc('0x6a'),_0x529b27['remoteUri'],_0xa44f2d['id']);}logger[_0xeabc('0xc')](_0xeabc('0x73'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xeabc('0x22')](_0xeabc('0x6c'),_0x2e712e[_0xeabc('0xe')]),_0xeabc('0x74'),{'uri':_0x30e9eb});})[_0xeabc('0x6d')](function(_0x4bf9d8){logger[_0xeabc('0x75')]('[OUTBOUND]',JSON['stringify'](_0x4bf9d8));});};exports['unmanaged']=function(_0x953553,_0x1c8a51,_0x1b6e9e,_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961,_0x47fd82,_0x1795fe,_0x2f95c7;_0x51368f['remoteUri']=intUtil[_0xeabc('0x54')](_0x51368f['remoteUri']);_0x51368f['serverUrl']=intUtil[_0xeabc('0x54')](_0x51368f[_0xeabc('0x55')]);def[_0xeabc('0x56')]=util[_0xeabc('0x22')](_0xeabc('0x57'),_0x51368f['remoteUri']);if(_0x33fa74&&_0x33fa74[_0xeabc('0x58')]){logger[_0xeabc('0xc')]('['+_0x1c8a51[_0xeabc('0x76')][_0xeabc('0x77')]()+']',_0xeabc('0x5a'));_0x1c8a51[_0xeabc('0x5d')]=util[_0xeabc('0x22')](_0xeabc('0x5b'),_0x51368f[_0xeabc('0x55')],_0x1c8a51[_0xeabc('0x5c')],md5(_0x1c8a51['uniqueid']));}else{_0x1c8a51[_0xeabc('0x5d')]='';}return getConnection(_0x51368f)[_0xeabc('0x2d')](function(_0xba29f){_0x2f95c7=_0xba29f;if(!_['isNil'](_0x4424ce)){return getUser(_0x51368f,_0x4424ce['name'],_0x2f95c7);}else{return getUser(_0x51368f,null,_0x2f95c7);}})[_0xeabc('0x2d')](function(_0x273ca5){_0x39f961=_0x273ca5;logger[_0xeabc('0xc')](_0xeabc('0x5e'),_0x39f961['id']);return getEndUser(_0x51368f,_0x1c8a51[_0xeabc('0x5f')],_0x1c8a51['calleridnum'],_0x2f95c7);})[_0xeabc('0x2d')](function(_0x538190){_0x47fd82=_0x538190;logger['info'](_0xeabc('0x60'),_0x47fd82['id']);return getTicket(_0x51368f,_0x39f961,_0x47fd82,_0x1b6e9e,_0x1c8a51,_0x1b6e9e[_0xeabc('0x61')],_0x2f95c7,'Inbound');})[_0xeabc('0x2d')](function(_0x45c9c7){_0x1795fe=_0x45c9c7;logger[_0xeabc('0xc')](_0xeabc('0x63'));logger[_0xeabc('0xc')](_0xeabc('0x64'),_0x1795fe['id']);return setRelationship(_0x2f95c7,_0x39f961,_0x1795fe,_0xeabc('0x65'));})[_0xeabc('0x2d')](function(){return setRelationship(_0x2f95c7,_0x47fd82,_0x1795fe,_0xeabc('0x66'));})[_0xeabc('0x2d')](function(){return getServerInfo(_0x2f95c7);})[_0xeabc('0x6d')](function(_0x485c13){logger[_0xeabc('0x75')]('['+_0x1c8a51['lastevent'][_0xeabc('0x77')]()+']',JSON[_0xeabc('0x20')](_0x485c13));});};
\ No newline at end of file
index be728c0..d44dedd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb022=['lastIndexOf','validateEmail','util','getString','length','string','push','content','variable','variableName','type','customVariable','Variable','name','toLowerCase','toString','keyValue','key','format','%s:\x20%s','keyContent','keyType','join','stripTrailingSlash','slice'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xb022,0x192));var _0x2b02=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xb022[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x2b02('0x0'));exports[_0x2b02('0x1')]=function(_0x3fc520,_0x23b7f9,_0x1e04a3){var _0x16af78=[];if(_0x3fc520[_0x2b02('0x2')]>0x0){var _0x54f87d=_['sortBy'](_0x3fc520,['id']);for(var _0x39dbe5=0x0;_0x39dbe5<_0x54f87d['length'];_0x39dbe5++){var _0x52ca9f=_0x54f87d[_0x39dbe5];if(_0x52ca9f['type']===_0x2b02('0x3')){_0x16af78[_0x2b02('0x4')](_0x52ca9f[_0x2b02('0x5')]);}else if(_0x52ca9f['type']===_0x2b02('0x6')&&_0x52ca9f[_0x2b02('0x7')]){_0x23b7f9[_0x52ca9f[_0x2b02('0x7')]]&&_0x16af78[_0x2b02('0x4')](_0x23b7f9[_0x52ca9f['variableName']]['toString']());}else if(_0x52ca9f[_0x2b02('0x8')]===_0x2b02('0x9')&&_0x52ca9f[_0x2b02('0xa')]&&_0x52ca9f[_0x2b02('0xa')][_0x2b02('0xb')]){_0x23b7f9[_0x52ca9f[_0x2b02('0xa')]['name']['toLowerCase']()]&&_0x16af78[_0x2b02('0x4')](_0x23b7f9[_0x52ca9f[_0x2b02('0xa')]['name'][_0x2b02('0xc')]()][_0x2b02('0xd')]());}else if(_0x52ca9f[_0x2b02('0x8')]===_0x2b02('0xe')){if(_0x52ca9f['keyType']===_0x2b02('0x3')&&_0x52ca9f[_0x2b02('0xf')]){_0x16af78[_0x2b02('0x4')](util[_0x2b02('0x10')](_0x2b02('0x11'),_0x52ca9f[_0x2b02('0xf')],_0x52ca9f[_0x2b02('0x12')]));}else if(_0x52ca9f[_0x2b02('0x13')]===_0x2b02('0x6')&&_0x52ca9f[_0x2b02('0x7')]&&_0x52ca9f['key']){_0x23b7f9[_0x52ca9f[_0x2b02('0x7')]]&&_0x16af78[_0x2b02('0x4')](util[_0x2b02('0x10')](_0x2b02('0x11'),_0x52ca9f[_0x2b02('0xf')],_0x23b7f9[_0x52ca9f[_0x2b02('0x7')]]));}else if(_0x52ca9f[_0x2b02('0x13')]==='customVariable'&&_0x52ca9f[_0x2b02('0xa')]&&_0x52ca9f[_0x2b02('0xa')][_0x2b02('0xb')]&&_0x52ca9f[_0x2b02('0xf')]){_0x23b7f9[_0x52ca9f['Variable'][_0x2b02('0xb')][_0x2b02('0xc')]()]&&_0x16af78[_0x2b02('0x4')](util[_0x2b02('0x10')](_0x2b02('0x11'),_0x52ca9f['key'],_0x23b7f9[_0x52ca9f['Variable'][_0x2b02('0xb')][_0x2b02('0xc')]()]));}}}}return _0x16af78[_0x2b02('0x14')](_0x1e04a3);};exports[_0x2b02('0x15')]=function(_0x163ed5){var _0x4ee9b2=_0x163ed5[_0x2b02('0x16')](-0x1);if(_0x4ee9b2==='/'){_0x163ed5=_0x163ed5['substring'](0x0,_0x163ed5[_0x2b02('0x17')](_0x4ee9b2));}return _0x163ed5;};exports[_0x2b02('0x18')]=function(_0x4e7a36){if(!_['isNil'](_0x4e7a36)&&_0x4e7a36!==''){var _0x5d8b62=/^(([^<>()\[\]\\.,;:\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 _0x5d8b62['test'](String(_0x4e7a36)['toLowerCase']());}else{return![];}};
\ No newline at end of file
+var _0xd05f=['length','sortBy','type','string','content','variable','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','keyContent','keyType','stripTrailingSlash','substring','lastIndexOf','isNil','test','getString'];(function(_0x5a76fa,_0x627952){var _0x3d0053=function(_0x9db16b){while(--_0x9db16b){_0x5a76fa['push'](_0x5a76fa['shift']());}};_0x3d0053(++_0x627952);}(_0xd05f,0x1da));var _0xfd05=function(_0x3c9176,_0x1bc4de){_0x3c9176=_0x3c9176-0x0;var _0x4ffbdf=_0xd05f[_0x3c9176];return _0x4ffbdf;};'use strict';var _=require('lodash');var util=require('util');exports[_0xfd05('0x0')]=function(_0x838994,_0x162853,_0x1dec34){var _0x197edc=[];if(_0x838994[_0xfd05('0x1')]>0x0){var _0x196494=_[_0xfd05('0x2')](_0x838994,['id']);for(var _0x159799=0x0;_0x159799<_0x196494[_0xfd05('0x1')];_0x159799++){var _0x45a896=_0x196494[_0x159799];if(_0x45a896[_0xfd05('0x3')]===_0xfd05('0x4')){_0x197edc['push'](_0x45a896[_0xfd05('0x5')]);}else if(_0x45a896[_0xfd05('0x3')]===_0xfd05('0x6')&&_0x45a896[_0xfd05('0x7')]){_0x162853[_0x45a896['variableName']]&&_0x197edc[_0xfd05('0x8')](_0x162853[_0x45a896[_0xfd05('0x7')]][_0xfd05('0x9')]());}else if(_0x45a896[_0xfd05('0x3')]===_0xfd05('0xa')&&_0x45a896[_0xfd05('0xb')]&&_0x45a896[_0xfd05('0xb')][_0xfd05('0xc')]){_0x162853[_0x45a896[_0xfd05('0xb')][_0xfd05('0xc')][_0xfd05('0xd')]()]&&_0x197edc[_0xfd05('0x8')](_0x162853[_0x45a896[_0xfd05('0xb')]['name']['toLowerCase']()][_0xfd05('0x9')]());}else if(_0x45a896[_0xfd05('0x3')]===_0xfd05('0xe')){if(_0x45a896['keyType']===_0xfd05('0x4')&&_0x45a896[_0xfd05('0xf')]){_0x197edc[_0xfd05('0x8')](util[_0xfd05('0x10')](_0xfd05('0x11'),_0x45a896[_0xfd05('0xf')],_0x45a896[_0xfd05('0x12')]));}else if(_0x45a896[_0xfd05('0x13')]===_0xfd05('0x6')&&_0x45a896[_0xfd05('0x7')]&&_0x45a896[_0xfd05('0xf')]){_0x162853[_0x45a896[_0xfd05('0x7')]]&&_0x197edc[_0xfd05('0x8')](util[_0xfd05('0x10')]('%s:\x20%s',_0x45a896[_0xfd05('0xf')],_0x162853[_0x45a896[_0xfd05('0x7')]]));}else if(_0x45a896[_0xfd05('0x13')]==='customVariable'&&_0x45a896[_0xfd05('0xb')]&&_0x45a896['Variable']['name']&&_0x45a896[_0xfd05('0xf')]){_0x162853[_0x45a896[_0xfd05('0xb')][_0xfd05('0xc')]['toLowerCase']()]&&_0x197edc['push'](util['format'](_0xfd05('0x11'),_0x45a896[_0xfd05('0xf')],_0x162853[_0x45a896[_0xfd05('0xb')][_0xfd05('0xc')][_0xfd05('0xd')]()]));}}}}return _0x197edc['join'](_0x1dec34);};exports[_0xfd05('0x14')]=function(_0x1fb26){var _0x34d2b3=_0x1fb26['slice'](-0x1);if(_0x34d2b3==='/'){_0x1fb26=_0x1fb26[_0xfd05('0x15')](0x0,_0x1fb26[_0xfd05('0x16')](_0x34d2b3));}return _0x1fb26;};exports['validateEmail']=function(_0x3dcf40){if(!_[_0xfd05('0x17')](_0x3dcf40)&&_0x3dcf40!==''){var _0x13e9b8=/^(([^<>()\[\]\\.,;:\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 _0x13e9b8[_0xfd05('0x18')](String(_0x3dcf40)['toLowerCase']());}else{return![];}};
\ No newline at end of file
index 1d4ff6b..f670a0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbccb=['then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','info','Getting\x20agent\x20with\x20email','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','email1','first_name','admin','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','getUser','GET','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!','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','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!','user:%s','trigger:browser:url','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','lastevent','toUpperCase','lodash','request-promise','bluebird','ioredis','./util','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','string','idField','content','toString','variable','variableName','type','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','merge','Open','getString','Subjects','Descriptions','POST','format','%s/webservice.php','username','HelpDesk','stringify'];(function(_0x22f50a,_0x293bae){var _0xc90790=function(_0x16d718){while(--_0x16d718){_0x22f50a['push'](_0x22f50a['shift']());}};_0xc90790(++_0x293bae);}(_0xbccb,0x1d1));var _0xbbcc=function(_0x3480e9,_0x1ce980){_0x3480e9=_0x3480e9-0x0;var _0x389aad=_0xbccb[_0x3480e9];return _0x389aad;};'use strict';var _=require(_0xbbcc('0x0'));var rp=require(_0xbbcc('0x1'));var BPromise=require(_0xbbcc('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0xbbcc('0x3'));var intUtil=require(_0xbbcc('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('vTiger');config[_0xbbcc('0x5')]=_[_0xbbcc('0x6')](config['redis'],{'host':_0xbbcc('0x7'),'port':0x18eb});var io=require(_0xbbcc('0x8'))(new Redis(config[_0xbbcc('0x5')]));function emit(_0x1cdaf9,_0x3340cd,_0x547555){io['to'](_0x1cdaf9)[_0xbbcc('0x9')](_0x3340cd,_0x547555);}function getCustomFields(_0x1f2149,_0x18a8cd){var _0x4baae9={};if(_0x1f2149[_0xbbcc('0xa')]>0x0){_[_0xbbcc('0xb')](_0x1f2149,function(_0x325243){if(_0x325243['type']===_0xbbcc('0xc')&&_0x325243[_0xbbcc('0xd')]){_0x4baae9[_0x325243[_0xbbcc('0xd')]]=_0x325243[_0xbbcc('0xe')][_0xbbcc('0xf')]();}else if(_0x325243['type']===_0xbbcc('0x10')&&_0x325243['variableName']&&_0x325243[_0xbbcc('0xd')]&&_0x18a8cd[_0x325243['variableName']]){_0x4baae9[_0x325243[_0xbbcc('0xd')]]=_0x18a8cd[_0x325243[_0xbbcc('0x11')]][_0xbbcc('0xf')]();}else if(_0x325243[_0xbbcc('0x12')]===_0xbbcc('0x13')&&_0x325243['Variable']&&_0x325243[_0xbbcc('0x14')][_0xbbcc('0x15')]&&_0x325243['idField']&&_0x18a8cd[_0x325243['Variable'][_0xbbcc('0x15')][_0xbbcc('0x16')]()]){_0x4baae9[_0x325243['idField']]=_0x18a8cd[_0x325243[_0xbbcc('0x14')][_0xbbcc('0x15')][_0xbbcc('0x16')]()]['toString']();}});}return _0x4baae9;}function createTicket(_0x2e5231,_0x32a52e,_0x3493ef,_0x240562,_0x436ff4,_0x1c1be4,_0x47bf32){logger['info'](_0xbbcc('0x17'));var _0x5eea02=_[_0xbbcc('0x18')]({'parent_id':'','assigned_user_id':_0x32a52e['id'],'ticketpriorities':'Normal','ticketstatus':_0xbbcc('0x19'),'ticket_title':intUtil[_0xbbcc('0x1a')](_0x240562[_0xbbcc('0x1b')],_0x436ff4,'\x20'),'description':intUtil['getString'](_0x240562[_0xbbcc('0x1c')],_0x436ff4,'\x0a'),'contact_id':_0x3493ef['id']},getCustomFields(_0x1c1be4,_0x436ff4));var _0x352242={'method':_0xbbcc('0x1d'),'uri':util[_0xbbcc('0x1e')](_0xbbcc('0x1f'),_0x2e5231['remoteUri']),'form':{'operation':'create','username':_0x2e5231[_0xbbcc('0x20')],'sessionName':_0x47bf32['sessionName'],'elementType':_0xbbcc('0x21'),'element':JSON[_0xbbcc('0x22')](_0x5eea02)},'json':!![]};return request(_0x352242)[_0xbbcc('0x23')](function(_0x29e20b){if(_0x29e20b[_0xbbcc('0x24')]){return BPromise[_0xbbcc('0x25')]({'id':_0x29e20b['result']['id']});}else{throw new Error(util[_0xbbcc('0x1e')](_0xbbcc('0x26'),JSON['stringify'](_0x29e20b['error'])));}})[_0xbbcc('0x27')](function(_0x258592){var _0x5561ed=_0x258592[_0xbbcc('0x28')]||0x1f4;logger[_0xbbcc('0x29')](_0xbbcc('0x2a'),_0xbbcc('0x2b'),_0x5561ed,JSON[_0xbbcc('0x22')](_0x258592));});}function getUser(_0x3498e0,_0x38451e,_0x57249d){if(intUtil[_0xbbcc('0x2c')](_0x38451e)){logger[_0xbbcc('0x2d')](_0xbbcc('0x2e'),_0x38451e);return request({'method':'GET','uri':util[_0xbbcc('0x1e')]('%s/webservice.php',_0x3498e0['remoteUri']),'qs':{'operation':_0xbbcc('0x2f'),'username':_0x3498e0['username'],'sessionName':_0x57249d[_0xbbcc('0x30')],'query':util['format'](_0xbbcc('0x31'),_0x38451e)},'json':!![]})[_0xbbcc('0x23')](function(_0x5c18dc){if(_0x5c18dc['success']&&_0x5c18dc['result']['length']){logger[_0xbbcc('0x2d')]('Agent\x20found!');return BPromise['resolve']({'id':_0x5c18dc[_0xbbcc('0x32')][0x0]['id'],'email':_0x5c18dc['result'][0x0][_0xbbcc('0x33')],'name':_0x5c18dc[_0xbbcc('0x32')][0x0][_0xbbcc('0x34')]+'\x20'+_0x5c18dc[_0xbbcc('0x32')]['last_name']});}else{logger[_0xbbcc('0x2d')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x57249d['userId'],'email':_0x3498e0['username'],'name':_0xbbcc('0x35')});}})[_0xbbcc('0x27')](function(_0x35b379){var _0x6acde0=_0x35b379[_0xbbcc('0x28')]||0x1f4;logger['error'](_0xbbcc('0x2a'),'getUser',_0x6acde0,JSON['stringify'](_0x35b379));});}else{logger['info'](_0xbbcc('0x36'));return BPromise['resolve']({'id':_0x57249d['userId'],'email':_0x3498e0['username'],'name':_0xbbcc('0x35')})[_0xbbcc('0x27')](function(_0x2e8a2e){var _0x140a94=_0x2e8a2e[_0xbbcc('0x28')]||0x1f4;logger[_0xbbcc('0x29')](_0xbbcc('0x2a'),_0xbbcc('0x37'),_0x140a94,JSON[_0xbbcc('0x22')](_0x2e8a2e));});}}function getEndUser(_0xea4772,_0x264b36,_0x317785,_0x203b0b){logger['info']('Searching\x20end\x20user\x20with\x20phone',_0x317785);return request({'method':_0xbbcc('0x38'),'uri':util['format'](_0xbbcc('0x1f'),_0xea4772[_0xbbcc('0x39')]),'qs':{'operation':_0xbbcc('0x2f'),'username':_0xea4772[_0xbbcc('0x20')],'sessionName':_0x203b0b[_0xbbcc('0x30')],'query':util['format'](_0xbbcc('0x3a'),_0x317785,_0x317785,_0x317785,_0x317785,_0x317785)},'json':!![]})[_0xbbcc('0x23')](function(_0x5e6041){if(_0x5e6041[_0xbbcc('0x24')]&&_0x5e6041[_0xbbcc('0x32')][_0xbbcc('0xa')]){logger[_0xbbcc('0x2d')](_0xbbcc('0x3b'));return BPromise[_0xbbcc('0x25')]({'id':_0x5e6041[_0xbbcc('0x32')][0x0]['id'],'name':_0x5e6041[_0xbbcc('0x32')][0x0][_0xbbcc('0x3c')]+'\x20'+_0x5e6041['result'][0x0][_0xbbcc('0x3d')],'phone':_0x317785});}else{logger[_0xbbcc('0x2d')](_0xbbcc('0x3e'));return request({'method':'POST','uri':util[_0xbbcc('0x1e')]('%s/webservice.php',_0xea4772[_0xbbcc('0x39')]),'form':{'operation':'create','sessionName':_0x203b0b[_0xbbcc('0x30')],'elementType':'Contacts','element':JSON[_0xbbcc('0x22')]({'lastname':_0x264b36,'phone':_0x317785,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x14d45c){logger[_0xbbcc('0x2d')](_0xbbcc('0x3f'));return BPromise[_0xbbcc('0x25')]({'id':_0x14d45c[_0xbbcc('0x32')]['id'],'name':_0x14d45c[_0xbbcc('0x32')][_0xbbcc('0x3d')],'phone':_0x14d45c['result'][_0xbbcc('0x40')]});})[_0xbbcc('0x27')](function(_0x30ca9d){var _0x1bcb9f=_0x30ca9d[_0xbbcc('0x28')]||0x1f4;logger['error'](_0xbbcc('0x2a'),_0xbbcc('0x41'),_0x1bcb9f,JSON[_0xbbcc('0x22')](_0x30ca9d));});}});}function getConnection(_0x2626b1){var _0x15c83c=_0x2626b1[_0xbbcc('0x20')];var _0x19e86f=_0x2626b1[_0xbbcc('0x42')];return request({'method':_0xbbcc('0x38'),'uri':util['format'](_0xbbcc('0x1f'),_0x2626b1[_0xbbcc('0x39')]),'qs':{'operation':_0xbbcc('0x43'),'username':_0x15c83c},'json':!![]})['then'](function(_0x3d2ec7){if(_0x3d2ec7[_0xbbcc('0x24')]){return request({'method':_0xbbcc('0x1d'),'uri':util[_0xbbcc('0x1e')](_0xbbcc('0x1f'),_0x2626b1[_0xbbcc('0x39')]),'form':{'operation':_0xbbcc('0x44'),'username':_0x15c83c,'accessKey':md5(_0x3d2ec7[_0xbbcc('0x32')][_0xbbcc('0x45')]+_0x19e86f)},'json':!![]});}})[_0xbbcc('0x23')](function(_0x148e48){if(_0x148e48[_0xbbcc('0x24')]){return BPromise[_0xbbcc('0x25')](_0x148e48[_0xbbcc('0x32')]);}else{throw new Error(util['format'](_0xbbcc('0x46'),_0x2626b1['id']));}})[_0xbbcc('0x27')](function(_0x30e904){var _0x2aa3ff=_0x30e904[_0xbbcc('0x28')]||0x1f4;logger[_0xbbcc('0x29')](_0xbbcc('0x2a'),'getConnection',_0x2aa3ff,JSON[_0xbbcc('0x22')](_0x30e904));});}function request(_0x5a58cf){logger['info'](_0xbbcc('0x47'),JSON['stringify'](_0x5a58cf));return rp(_0x5a58cf);}exports[_0xbbcc('0x48')]=function(_0x57c965,_0x11aae2,_0x4a7038,_0x6c27fa,_0x13b48d,_0x4a10c1){var _0x278639,_0x353a86,_0x2724c3,_0x44d0d3;_0x4a10c1[_0xbbcc('0x39')]=intUtil['stripTrailingSlash'](_0x4a10c1[_0xbbcc('0x39')]);if(_0x13b48d&&_0x13b48d[_0xbbcc('0x49')]){logger['info'](_0xbbcc('0x4a'),_0xbbcc('0x4b'));_0x11aae2[_0xbbcc('0x4c')]=util[_0xbbcc('0x1e')](_0xbbcc('0x4d'),_0x4a10c1[_0xbbcc('0x4e')],_0x11aae2[_0xbbcc('0x4f')],md5(_0x11aae2['uniqueid']));}else{_0x11aae2['recordingURL']='';}return getConnection(_0x4a10c1)['then'](function(_0x2d1ac7){_0x44d0d3=_0x2d1ac7;return getUser(_0x4a10c1,_0x6c27fa[_0xbbcc('0x50')],_0x44d0d3);})[_0xbbcc('0x23')](function(_0x1e1d0b){_0x278639=_0x1e1d0b;logger[_0xbbcc('0x2d')](_0xbbcc('0x51'),_0x278639['id']);return getEndUser(_0x4a10c1,_0x11aae2[_0xbbcc('0x52')],_0x11aae2[_0xbbcc('0x53')],_0x44d0d3);})[_0xbbcc('0x23')](function(_0x2c2777){_0x353a86=_0x2c2777;logger['info'](_0xbbcc('0x54'),_0x353a86['id']);return createTicket(_0x4a10c1,_0x278639,_0x353a86,_0x4a7038,_0x11aae2,_0x4a7038[_0xbbcc('0x55')],_0x44d0d3);})[_0xbbcc('0x23')](function(_0x47d065){_0x2724c3=_0x47d065;logger[_0xbbcc('0x2d')](_0xbbcc('0x56'));logger[_0xbbcc('0x2d')]('The\x20Ticket\x20ID\x20is:',_0x2724c3['id']);var _0x13c9fe=util[_0xbbcc('0x1e')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4a10c1[_0xbbcc('0x39')],_['split'](_0x2724c3['id'],'x')[0x1]);logger[_0xbbcc('0x2d')](_0xbbcc('0x4a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xbbcc('0x57'),_0x6c27fa[_0xbbcc('0x15')]),_0xbbcc('0x58'),{'uri':_0x13c9fe});})[_0xbbcc('0x27')](function(_0x48fce4){logger['error'](_0xbbcc('0x4a'),JSON[_0xbbcc('0x22')](_0x48fce4));});};exports['outbound']=function(_0x5f51a1,_0x335e3f,_0x111742,_0x47cb5e,_0x577d55,_0x57f6b5,_0xd5f054){var _0x5c3af6,_0x5ef775,_0x1ad839,_0x19040b;_0x57f6b5[_0xbbcc('0x39')]=intUtil[_0xbbcc('0x59')](_0x57f6b5['remoteUri']);_0x57f6b5[_0xbbcc('0x4e')]=intUtil[_0xbbcc('0x59')](_0x57f6b5[_0xbbcc('0x4e')]);if(_0xd5f054&&_0xd5f054['recordingFormat']&&_0xd5f054[_0xbbcc('0x5a')]!==_0xbbcc('0x5b')){logger[_0xbbcc('0x2d')](_0xbbcc('0x5c'),_0xbbcc('0x4b'));_0x335e3f['recordingURL']=util[_0xbbcc('0x1e')](_0xbbcc('0x4d'),_0x57f6b5[_0xbbcc('0x4e')],_0x335e3f['uniqueid'],md5(_0x335e3f[_0xbbcc('0x4f')]));}return getConnection(_0x57f6b5)['then'](function(_0x3a6f9d){_0x19040b=_0x3a6f9d;return getUser(_0x57f6b5,_0x47cb5e[_0xbbcc('0x50')],_0x19040b);})[_0xbbcc('0x23')](function(_0x5333bf){_0x5c3af6=_0x5333bf;logger['info'](_0xbbcc('0x51'),_0x5c3af6['id']);return getEndUser(_0x57f6b5,_0x335e3f['destcalleridname'],_0x335e3f[_0xbbcc('0x5d')],_0x19040b);})[_0xbbcc('0x23')](function(_0x5ddd14){_0x5ef775=_0x5ddd14;logger[_0xbbcc('0x2d')](_0xbbcc('0x54'),_0x5ef775['id']);return createTicket(_0x57f6b5,_0x5c3af6,_0x5ef775,_0x111742,_0x335e3f,_0x111742[_0xbbcc('0x55')],_0x19040b);})[_0xbbcc('0x23')](function(_0x424d2a){_0x1ad839=_0x424d2a;logger['info']('Ticket\x20created!');logger[_0xbbcc('0x2d')](_0xbbcc('0x5e'),_0x1ad839['id']);var _0x217b92=util['format'](_0xbbcc('0x5f'),_0x57f6b5['remoteUri'],_[_0xbbcc('0x60')](_0x1ad839['id'],'x')[0x1]);logger[_0xbbcc('0x2d')]('[OUTBOUND]',_0xbbcc('0x61'));emit(util[_0xbbcc('0x1e')]('user:%s',_0x47cb5e[_0xbbcc('0x15')]),_0xbbcc('0x58'),{'uri':_0x217b92});})['catch'](function(_0x42274b){logger[_0xbbcc('0x29')]('[OUTBOUND]',JSON[_0xbbcc('0x22')](_0x42274b));});};exports['unmanaged']=function(_0x5d7849,_0x4ad99a,_0x54ef7f,_0x285fcd,_0x241261,_0xde426b){var _0x4509dc,_0x34445a,_0x524239,_0x3d3406;_0xde426b[_0xbbcc('0x39')]=intUtil[_0xbbcc('0x59')](_0xde426b[_0xbbcc('0x39')]);_0xde426b[_0xbbcc('0x4e')]=intUtil[_0xbbcc('0x59')](_0xde426b[_0xbbcc('0x4e')]);if(_0x241261&&_0x241261[_0xbbcc('0x49')]){logger[_0xbbcc('0x2d')]('['+_0x4ad99a[_0xbbcc('0x62')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x4ad99a[_0xbbcc('0x4c')]=util[_0xbbcc('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xde426b[_0xbbcc('0x4e')],_0x4ad99a[_0xbbcc('0x4f')],md5(_0x4ad99a[_0xbbcc('0x4f')]));}else{_0x4ad99a[_0xbbcc('0x4c')]='';}return getConnection(_0xde426b)[_0xbbcc('0x23')](function(_0xa77a1){_0x3d3406=_0xa77a1;return getUser(_0xde426b,'',_0x3d3406);})[_0xbbcc('0x23')](function(_0x32d033){_0x4509dc=_0x32d033;logger[_0xbbcc('0x2d')](_0xbbcc('0x51'),_0x4509dc['id']);return getEndUser(_0xde426b,_0x4ad99a[_0xbbcc('0x52')],_0x4ad99a[_0xbbcc('0x53')],_0x3d3406);})['then'](function(_0x4fade6){_0x34445a=_0x4fade6;logger[_0xbbcc('0x2d')](_0xbbcc('0x54'),_0x34445a['id']);return createTicket(_0xde426b,_0x4509dc,_0x34445a,_0x54ef7f,_0x4ad99a,_0x54ef7f[_0xbbcc('0x55')],_0x3d3406);})[_0xbbcc('0x23')](function(_0x3af235){_0x524239=_0x3af235;logger['info'](_0xbbcc('0x56'));logger[_0xbbcc('0x2d')]('The\x20Ticket\x20ID\x20is:',_0x524239['id']);})[_0xbbcc('0x27')](function(_0x13a6da){logger[_0xbbcc('0x29')]('['+_0x4ad99a['lastevent'][_0xbbcc('0x63')]()+']',JSON[_0xbbcc('0x22')](_0x13a6da));});};
\ No newline at end of file
+var _0x5084=['Open','getString','Subjects','Descriptions','POST','%s/webservice.php','remoteUri','create','sessionName','HelpDesk','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','stringify','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','format','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','then','Agent\x20found!','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','phone','getchallenge','login','token','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','split','[OUTBOUND]','lastevent','toUpperCase','calleridname','Fields','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','socket.io-emitter','emit','length','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','info','merge','Normal'];(function(_0x1b5c54,_0x11d5cc){var _0x18529b=function(_0x1810bb){while(--_0x1810bb){_0x1b5c54['push'](_0x1b5c54['shift']());}};_0x18529b(++_0x11d5cc);}(_0x5084,0x17f));var _0x4508=function(_0x44b9cc,_0x33014a){_0x44b9cc=_0x44b9cc-0x0;var _0x2dc906=_0x5084[_0x44b9cc];return _0x2dc906;};'use strict';var _=require(_0x4508('0x0'));var rp=require(_0x4508('0x1'));var BPromise=require(_0x4508('0x2'));var md5=require(_0x4508('0x3'));var util=require(_0x4508('0x4'));var Redis=require(_0x4508('0x5'));var intUtil=require(_0x4508('0x6'));var config=require(_0x4508('0x7'));var logger=require(_0x4508('0x8'))(_0x4508('0x9'));config[_0x4508('0xa')]=_[_0x4508('0xb')](config[_0x4508('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x4508('0xc'))(new Redis(config[_0x4508('0xa')]));function emit(_0x20a1d3,_0x567176,_0x27a5fc){io['to'](_0x20a1d3)[_0x4508('0xd')](_0x567176,_0x27a5fc);}function getCustomFields(_0x3643ec,_0x310869){var _0x13bbdb={};if(_0x3643ec[_0x4508('0xe')]>0x0){_[_0x4508('0xf')](_0x3643ec,function(_0x4a085a){if(_0x4a085a[_0x4508('0x10')]===_0x4508('0x11')&&_0x4a085a[_0x4508('0x12')]){_0x13bbdb[_0x4a085a['idField']]=_0x4a085a[_0x4508('0x13')][_0x4508('0x14')]();}else if(_0x4a085a[_0x4508('0x10')]===_0x4508('0x15')&&_0x4a085a[_0x4508('0x16')]&&_0x4a085a[_0x4508('0x12')]&&_0x310869[_0x4a085a[_0x4508('0x16')]]){_0x13bbdb[_0x4a085a['idField']]=_0x310869[_0x4a085a[_0x4508('0x16')]]['toString']();}else if(_0x4a085a[_0x4508('0x10')]===_0x4508('0x17')&&_0x4a085a['Variable']&&_0x4a085a[_0x4508('0x18')]['name']&&_0x4a085a[_0x4508('0x12')]&&_0x310869[_0x4a085a[_0x4508('0x18')][_0x4508('0x19')]['toLowerCase']()]){_0x13bbdb[_0x4a085a[_0x4508('0x12')]]=_0x310869[_0x4a085a[_0x4508('0x18')][_0x4508('0x19')]['toLowerCase']()][_0x4508('0x14')]();}});}return _0x13bbdb;}function createTicket(_0x16a690,_0xd53ab6,_0x1232bb,_0x52b5f3,_0x241084,_0x233215,_0x15e26d){logger[_0x4508('0x1a')]('Creating\x20new\x20ticket...');var _0x36a7fd=_[_0x4508('0x1b')]({'parent_id':'','assigned_user_id':_0xd53ab6['id'],'ticketpriorities':_0x4508('0x1c'),'ticketstatus':_0x4508('0x1d'),'ticket_title':intUtil[_0x4508('0x1e')](_0x52b5f3[_0x4508('0x1f')],_0x241084,'\x20'),'description':intUtil[_0x4508('0x1e')](_0x52b5f3[_0x4508('0x20')],_0x241084,'\x0a'),'contact_id':_0x1232bb['id']},getCustomFields(_0x233215,_0x241084));var _0x4948f5={'method':_0x4508('0x21'),'uri':util['format'](_0x4508('0x22'),_0x16a690[_0x4508('0x23')]),'form':{'operation':_0x4508('0x24'),'username':_0x16a690['username'],'sessionName':_0x15e26d[_0x4508('0x25')],'elementType':_0x4508('0x26'),'element':JSON['stringify'](_0x36a7fd)},'json':!![]};return request(_0x4948f5)['then'](function(_0x2cfd6d){if(_0x2cfd6d[_0x4508('0x27')]){return BPromise[_0x4508('0x28')]({'id':_0x2cfd6d[_0x4508('0x29')]['id']});}else{throw new Error(util['format'](_0x4508('0x2a'),JSON[_0x4508('0x2b')](_0x2cfd6d[_0x4508('0x2c')])));}})[_0x4508('0x2d')](function(_0x145d90){var _0x50e985=_0x145d90['statusCode']||0x1f4;logger[_0x4508('0x2c')](_0x4508('0x2e'),_0x4508('0x2f'),_0x50e985,JSON[_0x4508('0x2b')](_0x145d90));});}function getUser(_0x103ff4,_0x472b73,_0x4f5f86){if(intUtil[_0x4508('0x30')](_0x472b73)){logger['info'](_0x4508('0x31'),_0x472b73);return request({'method':_0x4508('0x32'),'uri':util[_0x4508('0x33')](_0x4508('0x22'),_0x103ff4['remoteUri']),'qs':{'operation':_0x4508('0x34'),'username':_0x103ff4[_0x4508('0x35')],'sessionName':_0x4f5f86[_0x4508('0x25')],'query':util[_0x4508('0x33')](_0x4508('0x36'),_0x472b73)},'json':!![]})[_0x4508('0x37')](function(_0x44a4b1){if(_0x44a4b1['success']&&_0x44a4b1[_0x4508('0x29')][_0x4508('0xe')]){logger[_0x4508('0x1a')](_0x4508('0x38'));return BPromise['resolve']({'id':_0x44a4b1[_0x4508('0x29')][0x0]['id'],'email':_0x44a4b1[_0x4508('0x29')][0x0][_0x4508('0x39')],'name':_0x44a4b1[_0x4508('0x29')][0x0][_0x4508('0x3a')]+'\x20'+_0x44a4b1['result']['last_name']});}else{logger[_0x4508('0x1a')](_0x4508('0x3b'));return BPromise['resolve']({'id':_0x4f5f86[_0x4508('0x3c')],'email':_0x103ff4[_0x4508('0x35')],'name':_0x4508('0x3d')});}})['catch'](function(_0x3e21eb){var _0x1f9593=_0x3e21eb[_0x4508('0x3e')]||0x1f4;logger[_0x4508('0x2c')](_0x4508('0x2e'),_0x4508('0x3f'),_0x1f9593,JSON[_0x4508('0x2b')](_0x3e21eb));});}else{logger['info'](_0x4508('0x3b'));return BPromise[_0x4508('0x28')]({'id':_0x4f5f86[_0x4508('0x3c')],'email':_0x103ff4[_0x4508('0x35')],'name':_0x4508('0x3d')})['catch'](function(_0x5c37b1){var _0x42fadb=_0x5c37b1['statusCode']||0x1f4;logger[_0x4508('0x2c')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x4508('0x3f'),_0x42fadb,JSON[_0x4508('0x2b')](_0x5c37b1));});}}function getEndUser(_0x3dae4b,_0x95599c,_0x5862a2,_0x4963cc){logger['info'](_0x4508('0x40'),_0x5862a2);return request({'method':_0x4508('0x32'),'uri':util[_0x4508('0x33')](_0x4508('0x22'),_0x3dae4b['remoteUri']),'qs':{'operation':_0x4508('0x34'),'username':_0x3dae4b[_0x4508('0x35')],'sessionName':_0x4963cc[_0x4508('0x25')],'query':util[_0x4508('0x33')](_0x4508('0x41'),_0x5862a2,_0x5862a2,_0x5862a2,_0x5862a2,_0x5862a2)},'json':!![]})[_0x4508('0x37')](function(_0x58511c){if(_0x58511c['success']&&_0x58511c[_0x4508('0x29')][_0x4508('0xe')]){logger[_0x4508('0x1a')](_0x4508('0x42'));return BPromise[_0x4508('0x28')]({'id':_0x58511c[_0x4508('0x29')][0x0]['id'],'name':_0x58511c[_0x4508('0x29')][0x0][_0x4508('0x43')]+'\x20'+_0x58511c['result'][0x0][_0x4508('0x44')],'phone':_0x5862a2});}else{logger['info'](_0x4508('0x45'));return request({'method':_0x4508('0x21'),'uri':util[_0x4508('0x33')]('%s/webservice.php',_0x3dae4b[_0x4508('0x23')]),'form':{'operation':_0x4508('0x24'),'sessionName':_0x4963cc[_0x4508('0x25')],'elementType':'Contacts','element':JSON[_0x4508('0x2b')]({'lastname':_0x95599c,'phone':_0x5862a2,'assigned_user_id':'\x20'})},'json':!![]})[_0x4508('0x37')](function(_0x560d77){logger[_0x4508('0x1a')](_0x4508('0x46'));return BPromise['resolve']({'id':_0x560d77[_0x4508('0x29')]['id'],'name':_0x560d77[_0x4508('0x29')]['lastname'],'phone':_0x560d77[_0x4508('0x29')][_0x4508('0x47')]});})[_0x4508('0x2d')](function(_0x3376c8){var _0x41f1c7=_0x3376c8[_0x4508('0x3e')]||0x1f4;logger[_0x4508('0x2c')](_0x4508('0x2e'),'getEndUser',_0x41f1c7,JSON[_0x4508('0x2b')](_0x3376c8));});}});}function getConnection(_0x447a54){var _0x3433d1=_0x447a54[_0x4508('0x35')];var _0x507089=_0x447a54['accessKey'];return request({'method':_0x4508('0x32'),'uri':util[_0x4508('0x33')](_0x4508('0x22'),_0x447a54['remoteUri']),'qs':{'operation':_0x4508('0x48'),'username':_0x3433d1},'json':!![]})[_0x4508('0x37')](function(_0x5d6f32){if(_0x5d6f32[_0x4508('0x27')]){return request({'method':_0x4508('0x21'),'uri':util[_0x4508('0x33')](_0x4508('0x22'),_0x447a54[_0x4508('0x23')]),'form':{'operation':_0x4508('0x49'),'username':_0x3433d1,'accessKey':md5(_0x5d6f32[_0x4508('0x29')][_0x4508('0x4a')]+_0x507089)},'json':!![]});}})[_0x4508('0x37')](function(_0x31b3cc){if(_0x31b3cc[_0x4508('0x27')]){return BPromise[_0x4508('0x28')](_0x31b3cc[_0x4508('0x29')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x447a54['id']));}})[_0x4508('0x2d')](function(_0x47cc0a){var _0x5b203c=_0x47cc0a['statusCode']||0x1f4;logger[_0x4508('0x2c')](_0x4508('0x2e'),_0x4508('0x4b'),_0x5b203c,JSON[_0x4508('0x2b')](_0x47cc0a));});}function request(_0x359bd8){logger[_0x4508('0x1a')](_0x4508('0x4c'),JSON[_0x4508('0x2b')](_0x359bd8));return rp(_0x359bd8);}exports[_0x4508('0x4d')]=function(_0x142c8c,_0x1fc97e,_0x907d29,_0x4c1030,_0x40b022,_0x12e1c0){var _0x82c7fa,_0x412791,_0x1b39c5,_0x27ec4e;_0x12e1c0[_0x4508('0x23')]=intUtil[_0x4508('0x4e')](_0x12e1c0[_0x4508('0x23')]);if(_0x40b022&&_0x40b022['monitor_format']){logger['info'](_0x4508('0x4f'),_0x4508('0x50'));_0x1fc97e['recordingURL']=util['format'](_0x4508('0x51'),_0x12e1c0[_0x4508('0x52')],_0x1fc97e[_0x4508('0x53')],md5(_0x1fc97e[_0x4508('0x53')]));}else{_0x1fc97e[_0x4508('0x54')]='';}return getConnection(_0x12e1c0)[_0x4508('0x37')](function(_0x85add9){_0x27ec4e=_0x85add9;return getUser(_0x12e1c0,_0x4c1030[_0x4508('0x55')],_0x27ec4e);})[_0x4508('0x37')](function(_0x3741a6){_0x82c7fa=_0x3741a6;logger[_0x4508('0x1a')](_0x4508('0x56'),_0x82c7fa['id']);return getEndUser(_0x12e1c0,_0x1fc97e['calleridname'],_0x1fc97e[_0x4508('0x57')],_0x27ec4e);})[_0x4508('0x37')](function(_0x454f40){_0x412791=_0x454f40;logger[_0x4508('0x1a')](_0x4508('0x58'),_0x412791['id']);return createTicket(_0x12e1c0,_0x82c7fa,_0x412791,_0x907d29,_0x1fc97e,_0x907d29['Fields'],_0x27ec4e);})[_0x4508('0x37')](function(_0x44b072){_0x1b39c5=_0x44b072;logger[_0x4508('0x1a')](_0x4508('0x59'));logger[_0x4508('0x1a')](_0x4508('0x5a'),_0x1b39c5['id']);var _0x333b0a=util[_0x4508('0x33')](_0x4508('0x5b'),_0x12e1c0['remoteUri'],_['split'](_0x1b39c5['id'],'x')[0x1]);logger['info'](_0x4508('0x4f'),_0x4508('0x5c'));emit(util[_0x4508('0x33')](_0x4508('0x5d'),_0x4c1030[_0x4508('0x19')]),_0x4508('0x5e'),{'uri':_0x333b0a});})['catch'](function(_0x354ca2){logger[_0x4508('0x2c')](_0x4508('0x4f'),JSON[_0x4508('0x2b')](_0x354ca2));});};exports[_0x4508('0x5f')]=function(_0x24a31d,_0x261586,_0x5d0e16,_0x370c89,_0x5a9d50,_0x1ed39d,_0x30651b){var _0x10c44c,_0x14d285,_0x106246,_0x36e09e;_0x1ed39d['remoteUri']=intUtil[_0x4508('0x4e')](_0x1ed39d[_0x4508('0x23')]);_0x1ed39d[_0x4508('0x52')]=intUtil[_0x4508('0x4e')](_0x1ed39d['serverUrl']);if(_0x30651b&&_0x30651b[_0x4508('0x60')]&&_0x30651b['recordingFormat']!=='none'){logger[_0x4508('0x1a')]('[OUTBOUND]',_0x4508('0x50'));_0x261586['recordingURL']=util['format'](_0x4508('0x51'),_0x1ed39d[_0x4508('0x52')],_0x261586[_0x4508('0x53')],md5(_0x261586[_0x4508('0x53')]));}return getConnection(_0x1ed39d)[_0x4508('0x37')](function(_0x3bf2d0){_0x36e09e=_0x3bf2d0;return getUser(_0x1ed39d,_0x370c89['email'],_0x36e09e);})[_0x4508('0x37')](function(_0x53d03b){_0x10c44c=_0x53d03b;logger[_0x4508('0x1a')](_0x4508('0x56'),_0x10c44c['id']);return getEndUser(_0x1ed39d,_0x261586['destcalleridname'],_0x261586['destcalleridnum'],_0x36e09e);})[_0x4508('0x37')](function(_0x29405c){_0x14d285=_0x29405c;logger[_0x4508('0x1a')](_0x4508('0x58'),_0x14d285['id']);return createTicket(_0x1ed39d,_0x10c44c,_0x14d285,_0x5d0e16,_0x261586,_0x5d0e16['Fields'],_0x36e09e);})[_0x4508('0x37')](function(_0x196a64){_0x106246=_0x196a64;logger[_0x4508('0x1a')](_0x4508('0x59'));logger[_0x4508('0x1a')](_0x4508('0x5a'),_0x106246['id']);var _0x436873=util[_0x4508('0x33')](_0x4508('0x5b'),_0x1ed39d[_0x4508('0x23')],_[_0x4508('0x61')](_0x106246['id'],'x')[0x1]);logger[_0x4508('0x1a')](_0x4508('0x62'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4508('0x33')](_0x4508('0x5d'),_0x370c89[_0x4508('0x19')]),_0x4508('0x5e'),{'uri':_0x436873});})[_0x4508('0x2d')](function(_0x10cedc){logger['error'](_0x4508('0x62'),JSON[_0x4508('0x2b')](_0x10cedc));});};exports['unmanaged']=function(_0x2d8d52,_0x9e3582,_0x71885b,_0x217350,_0x567f31,_0x59310b){var _0x439507,_0x103946,_0x595b0a,_0x577b1c;_0x59310b['remoteUri']=intUtil[_0x4508('0x4e')](_0x59310b[_0x4508('0x23')]);_0x59310b[_0x4508('0x52')]=intUtil[_0x4508('0x4e')](_0x59310b[_0x4508('0x52')]);if(_0x567f31&&_0x567f31['monitor_format']){logger[_0x4508('0x1a')]('['+_0x9e3582[_0x4508('0x63')][_0x4508('0x64')]()+']','Recording\x20is\x20enabled!');_0x9e3582[_0x4508('0x54')]=util['format'](_0x4508('0x51'),_0x59310b['serverUrl'],_0x9e3582['uniqueid'],md5(_0x9e3582[_0x4508('0x53')]));}else{_0x9e3582[_0x4508('0x54')]='';}return getConnection(_0x59310b)[_0x4508('0x37')](function(_0x399fab){_0x577b1c=_0x399fab;return getUser(_0x59310b,'',_0x577b1c);})['then'](function(_0x398394){_0x439507=_0x398394;logger['info'](_0x4508('0x56'),_0x439507['id']);return getEndUser(_0x59310b,_0x9e3582[_0x4508('0x65')],_0x9e3582[_0x4508('0x57')],_0x577b1c);})[_0x4508('0x37')](function(_0xb70ebe){_0x103946=_0xb70ebe;logger[_0x4508('0x1a')]('The\x20Enduser\x20ID\x20is:',_0x103946['id']);return createTicket(_0x59310b,_0x439507,_0x103946,_0x71885b,_0x9e3582,_0x71885b[_0x4508('0x66')],_0x577b1c);})[_0x4508('0x37')](function(_0xb47f53){_0x595b0a=_0xb47f53;logger[_0x4508('0x1a')](_0x4508('0x59'));logger[_0x4508('0x1a')](_0x4508('0x5a'),_0x595b0a['id']);})['catch'](function(_0x8ddac4){logger['error']('['+_0x9e3582['lastevent']['toUpperCase']()+']',JSON[_0x4508('0x2b')](_0x8ddac4));});};
\ No newline at end of file
index 30cff20..c5d9cdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf109=['error','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','%s/tickets.json','remoteUri','POST','Tags','name','getString','Descriptions','Fields','Ticket\x20created!','validateEmail','format','%s/search.json','then','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','toString','base64','debug','stringify','GET','map','forEach','string','nameField','customField','content','type','idField','custom_fields','push','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','[OUTBOUND]','email','destcalleridnum','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase'];(function(_0x4e6a81,_0x589ac5){var _0x1041dd=function(_0x13efad){while(--_0x13efad){_0x4e6a81['push'](_0x4e6a81['shift']());}};_0x1041dd(++_0x589ac5);}(_0xf109,0xce));var _0x9f10=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xf109[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0x9f10('0x0'));var rp=require(_0x9f10('0x1'));var md5=require(_0x9f10('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x9f10('0x3'));var logger=require(_0x9f10('0x4'))(_0x9f10('0x5'));config[_0x9f10('0x6')]=_[_0x9f10('0x7')](config[_0x9f10('0x6')],{'host':_0x9f10('0x8'),'port':0x18eb});var io=require(_0x9f10('0x9'))(new Redis(config[_0x9f10('0x6')]));function emit(_0x2a877e,_0x3fd82f,_0x5c8719){io['to'](_0x2a877e)[_0x9f10('0xa')](_0x3fd82f,_0x5c8719);}var headers={'Content-Type':_0x9f10('0xb'),'Accept':_0x9f10('0xb')};function getTicket(_0x1bde2e,_0x325f22,_0x5d5f53,_0x318776,_0x18995b){logger[_0x9f10('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0x9f10('0xd'),_0x1bde2e[_0x9f10('0xe')]),'method':_0x9f10('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x5d5f53['id'],'submitter_id':_0x325f22?_0x325f22['id']:undefined,'assignee_id':_0x325f22?_0x325f22['id']:undefined,'tags':getTags(_0x318776[_0x9f10('0x10')],_0x9f10('0x11')),'subject':intUtil[_0x9f10('0x12')](_0x318776['Subjects'],_0x18995b,'\x20'),'description':intUtil[_0x9f10('0x12')](_0x318776[_0x9f10('0x13')],_0x18995b,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x318776[_0x9f10('0x13')],_0x18995b,'\x0a')}},getCustomFields(_0x318776[_0x9f10('0x14')],_0x18995b))}})['then'](function(_0x59bcad){logger[_0x9f10('0xc')](_0x9f10('0x15'));return _0x59bcad['ticket'];});}function getUser(_0x11154b,_0x5ae255){if(intUtil[_0x9f10('0x16')](_0x5ae255)){logger[_0x9f10('0xc')]('Getting\x20agent\x20with\x20email',_0x5ae255);return request({'uri':util[_0x9f10('0x17')](_0x9f10('0x18'),_0x11154b['remoteUri']),'qs':{'query':util[_0x9f10('0x17')]('type:user\x20role:agent\x20email:%s',_0x5ae255)}})[_0x9f10('0x19')](function(_0x51ce03){if(_0x51ce03[_0x9f10('0x1a')]){logger['info']('Agent\x20found!');return _[_0x9f10('0x1b')](_0x51ce03[_0x9f10('0x1c')],{'email':_0x5ae255,'role':_0x9f10('0x1d')});}else{logger[_0x9f10('0xc')](_0x9f10('0x1e'));return request({'uri':util[_0x9f10('0x17')](_0x9f10('0x1f'),_0x11154b['remoteUri'])})[_0x9f10('0x19')](function(_0x58e6ba){logger[_0x9f10('0xc')](_0x9f10('0x20'));return _0x58e6ba[_0x9f10('0x21')];});}});}else{logger['info'](_0x9f10('0x1e'));return request({'uri':util[_0x9f10('0x17')](_0x9f10('0x1f'),_0x11154b['remoteUri'])})[_0x9f10('0x19')](function(_0x37e9ac){logger[_0x9f10('0xc')]('Admin\x20account\x20selected.');return _0x37e9ac[_0x9f10('0x21')];});}}function getEndUser(_0x23c2e7,_0x11cae7,_0x1647c0){logger['info']('Searching\x20enduser\x20with\x20phone',_0x1647c0);return request({'uri':util['format'](_0x9f10('0x18'),_0x23c2e7['remoteUri']),'qs':{'query':util[_0x9f10('0x17')](_0x9f10('0x22'),_0x1647c0)}})[_0x9f10('0x19')](function(_0x2ed95b){var _0x2e11b1;if(_0x2ed95b['results'][_0x9f10('0x23')]){_0x2ed95b[_0x9f10('0x1c')]=_[_0x9f10('0x24')](_0x2ed95b[_0x9f10('0x1c')],{'suspended':![],'role':_0x9f10('0x25')});if(_0x2ed95b[_0x9f10('0x1c')]['length']){_0x2e11b1=_[_0x9f10('0x26')](_0x2ed95b[_0x9f10('0x1c')]);}}if(_0x2e11b1){logger[_0x9f10('0xc')](_0x9f10('0x27'));return _0x2e11b1;}else{logger['info'](_0x9f10('0x28'));return request({'uri':util[_0x9f10('0x17')](_0x9f10('0x29'),_0x23c2e7['remoteUri']),'method':_0x9f10('0xf'),'body':{'user':{'role':'end-user','name':util[_0x9f10('0x17')](_0x9f10('0x2a'),_0x11cae7||_0x1647c0),'phone':_0x1647c0}}})[_0x9f10('0x19')](function(_0x5944e5){logger[_0x9f10('0xc')](_0x9f10('0x2b'));return _0x5944e5[_0x9f10('0x21')];});}});}function getAuth(_0x11f128){var _0x148a5b;if(_0x11f128['authType']===_0x9f10('0x2c')){_0x148a5b=util['format'](_0x9f10('0x2d'),_0x11f128[_0x9f10('0x2e')],_0x11f128[_0x9f10('0x2c')]);}else if(_0x11f128[_0x9f10('0x2f')]===_0x9f10('0x30')){_0x148a5b=util[_0x9f10('0x17')]('%s/token:%s',_0x11f128[_0x9f10('0x2e')],_0x11f128[_0x9f10('0x30')]);}return util[_0x9f10('0x17')]('Basic\x20%s',new Buffer(_0x148a5b)[_0x9f10('0x31')](_0x9f10('0x32')));}function request(_0x4c89fd){logger[_0x9f10('0x33')]('[HTTP]',JSON[_0x9f10('0x34')](_0x4c89fd));return rp(_[_0x9f10('0x7')](_0x4c89fd,{'method':_0x9f10('0x35'),'headers':headers,'json':!![]}));}function getTags(_0xc17ea2,_0x20605a){var _0x1ba4be=[];if(_0xc17ea2&&_0xc17ea2[_0x9f10('0x23')]>0x0){_0x1ba4be=_[_0x9f10('0x36')](_0xc17ea2,_0x20605a);}return _0x1ba4be;}function getCustomFields(_0x536841,_0x36b1e2){var _0x622030=[];var _0x2fa4bf={'custom_fields':[]};if(_0x536841['length']>0x0){_[_0x9f10('0x37')](_0x536841,function(_0x193b59){if(_0x193b59['type']===_0x9f10('0x38')&&_0x193b59[_0x9f10('0x39')]&&!_0x193b59[_0x9f10('0x3a')]){_0x2fa4bf[_0x193b59['nameField']['toLowerCase']()]=_0x193b59[_0x9f10('0x3b')][_0x9f10('0x31')]();}else if(_0x193b59[_0x9f10('0x3c')]===_0x9f10('0x38')&&_0x193b59[_0x9f10('0x3d')]&&_0x193b59[_0x9f10('0x3a')]){_0x2fa4bf[_0x9f10('0x3e')][_0x9f10('0x3f')]({'id':_0x193b59[_0x9f10('0x3d')],'value':_0x193b59[_0x9f10('0x3b')][_0x9f10('0x31')]()});}else if(_0x193b59[_0x9f10('0x3c')]==='variable'&&_0x193b59['variableName']&&_0x193b59['idField']&&_0x193b59[_0x9f10('0x3a')]){_0x36b1e2[_0x193b59['variableName']]&&_0x2fa4bf[_0x9f10('0x3e')][_0x9f10('0x3f')]({'id':_0x193b59[_0x9f10('0x3d')],'value':_0x36b1e2[_0x193b59['variableName']][_0x9f10('0x31')]()});}else if(_0x193b59[_0x9f10('0x3c')]===_0x9f10('0x40')&&_0x193b59[_0x9f10('0x41')]&&_0x193b59[_0x9f10('0x41')]['name']&&_0x193b59['idField']&&_0x193b59['customField']){_0x36b1e2[_0x193b59[_0x9f10('0x41')]['name'][_0x9f10('0x42')]()]&&_0x2fa4bf['custom_fields'][_0x9f10('0x3f')]({'id':_0x193b59[_0x9f10('0x3d')],'value':_0x36b1e2[_0x193b59[_0x9f10('0x41')][_0x9f10('0x11')]['toLowerCase']()][_0x9f10('0x31')]()});}});}return _0x2fa4bf;}exports[_0x9f10('0x43')]=function(_0x571101,_0x3a5705,_0x2a7d5e,_0x3c64a9,_0x1bd37c,_0x1b3529){var _0x3b3002,_0x4bedbe;_0x1b3529[_0x9f10('0xe')]=intUtil[_0x9f10('0x44')](_0x1b3529[_0x9f10('0xe')]);_0x1b3529['serverUrl']=intUtil[_0x9f10('0x44')](_0x1b3529[_0x9f10('0x45')]);if(_0x1bd37c&&_0x1bd37c['monitor_format']){logger[_0x9f10('0xc')](_0x9f10('0x46'),_0x9f10('0x47'));_0x3a5705[_0x9f10('0x48')]=util['format'](_0x9f10('0x49'),_0x1b3529[_0x9f10('0x45')],_0x3a5705[_0x9f10('0x4a')],md5(_0x3a5705[_0x9f10('0x4a')]));}else{_0x3a5705[_0x9f10('0x48')]='';}headers[_0x9f10('0x4b')]=getAuth(_0x1b3529);return getUser(_0x1b3529,_0x3c64a9['email'])[_0x9f10('0x19')](function(_0x3760d0){_0x3b3002=_0x3760d0;logger[_0x9f10('0xc')](_0x9f10('0x4c'),_0x3b3002['id']);return getEndUser(_0x1b3529,_0x3a5705[_0x9f10('0x4d')],_0x3a5705[_0x9f10('0x4e')]);})['then'](function(_0x3ec147){_0x4bedbe=_0x3ec147;logger[_0x9f10('0xc')](_0x9f10('0x4f'),_0x4bedbe['id']);return getTicket(_0x1b3529,_0x3b3002,_0x4bedbe,_0x2a7d5e,_0x3a5705);})[_0x9f10('0x19')](function(_0x39dae3){if(_0x39dae3){logger[_0x9f10('0xc')](_0x9f10('0x50'),_0x39dae3['id']);switch(_0x1b3529[_0x9f10('0x3c')]){case'integrationTab':logger[_0x9f10('0xc')]('[QUEUE]',_0x9f10('0x51'));return request({'uri':util['format'](_0x9f10('0x52'),_0x1b3529[_0x9f10('0xe')],_0x3b3002['id'],_0x39dae3['id']),'method':_0x9f10('0xf')});case _0x9f10('0x53'):logger[_0x9f10('0xc')]('[QUEUE]',_0x9f10('0x54'));emit(util[_0x9f10('0x17')](_0x9f10('0x55'),_0x3c64a9[_0x9f10('0x11')]),'trigger:browser:url',{'uri':util['format'](_0x9f10('0x56'),_0x1b3529[_0x9f10('0xe')],_0x39dae3['id'])});break;default:logger['error']('[QUEUE]',_0x9f10('0x57'));}}})[_0x9f10('0x58')](function(_0x23369b){logger['error'](_0x9f10('0x59'),util[_0x9f10('0x5a')](_0x23369b,{'showHidden':!![],'depth':null}));});};exports[_0x9f10('0x5b')]=function(_0x4c3d18,_0x37ae9c,_0x2adb6c,_0xe18852,_0x48a76e,_0x229671,_0x401623){var _0x5f180f,_0x2a99fa;_0x229671[_0x9f10('0xe')]=intUtil[_0x9f10('0x44')](_0x229671[_0x9f10('0xe')]);_0x229671[_0x9f10('0x45')]=intUtil['stripTrailingSlash'](_0x229671[_0x9f10('0x45')]);if(_0x401623&&_0x401623['recordingFormat']&&_0x401623['recordingFormat']!==_0x9f10('0x5c')){logger[_0x9f10('0xc')](_0x9f10('0x5d'),_0x9f10('0x47'));_0x37ae9c[_0x9f10('0x48')]=util[_0x9f10('0x17')](_0x9f10('0x49'),_0x229671['serverUrl'],_0x37ae9c['uniqueid'],md5(_0x37ae9c[_0x9f10('0x4a')]));}headers[_0x9f10('0x4b')]=getAuth(_0x229671);return getUser(_0x229671,_0xe18852[_0x9f10('0x5e')])[_0x9f10('0x19')](function(_0x2625ca){_0x5f180f=_0x2625ca;logger[_0x9f10('0xc')](_0x9f10('0x4c'),_0x5f180f['id']);return getEndUser(_0x229671,_0x37ae9c['destcalleridname'],_0x37ae9c[_0x9f10('0x5f')]);})[_0x9f10('0x19')](function(_0x5a777a){_0x2a99fa=_0x5a777a;logger[_0x9f10('0xc')](_0x9f10('0x4f'),_0x2a99fa['id']);return getTicket(_0x229671,_0x5f180f,_0x2a99fa,_0x2adb6c,_0x37ae9c);})['then'](function(_0x407c4d){if(_0x407c4d){logger[_0x9f10('0xc')]('The\x20Ticket\x20ID\x20is:',_0x407c4d['id']);switch(_0x229671[_0x9f10('0x3c')]){case'integrationTab':logger[_0x9f10('0xc')](_0x9f10('0x5d'),_0x9f10('0x51'));return request({'uri':util[_0x9f10('0x17')](_0x9f10('0x52'),_0x229671['remoteUri'],_0x5f180f['id'],_0x407c4d['id']),'method':_0x9f10('0xf')});case _0x9f10('0x53'):logger[_0x9f10('0xc')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9f10('0x17')](_0x9f10('0x55'),_0xe18852[_0x9f10('0x11')]),_0x9f10('0x60'),{'uri':util[_0x9f10('0x17')](_0x9f10('0x56'),_0x229671[_0x9f10('0xe')],_0x407c4d['id'])});break;default:logger['error'](_0x9f10('0x5d'),_0x9f10('0x57'));}}})['catch'](function(_0xb0f5e9){logger['error'](_0x9f10('0x61'),util[_0x9f10('0x5a')](_0xb0f5e9,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x3f669c,_0x4cbe80,_0x24a518,_0x25b3e2,_0x163165,_0x58e266){var _0x35bfbd,_0x53e320;_0x58e266[_0x9f10('0xe')]=intUtil[_0x9f10('0x44')](_0x58e266[_0x9f10('0xe')]);_0x58e266['serverUrl']=intUtil[_0x9f10('0x44')](_0x58e266['serverUrl']);if(_0x163165&&_0x163165['monitor_format']){logger[_0x9f10('0xc')]('['+_0x4cbe80[_0x9f10('0x62')][_0x9f10('0x63')]()+']','Recording\x20is\x20enabled!');_0x4cbe80[_0x9f10('0x48')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x58e266[_0x9f10('0x45')],_0x4cbe80['uniqueid'],md5(_0x4cbe80['uniqueid']));}else{_0x4cbe80[_0x9f10('0x48')]='';}headers['Authorization']=getAuth(_0x58e266);return getUser(_0x58e266)[_0x9f10('0x19')](function(_0x9f6f4b){_0x35bfbd=_0x9f6f4b;logger[_0x9f10('0xc')]('The\x20User\x20ID\x20is:',_0x35bfbd['id']);return getEndUser(_0x58e266,_0x4cbe80[_0x9f10('0x4d')],_0x4cbe80[_0x9f10('0x4e')]);})['then'](function(_0x2941dc){_0x53e320=_0x2941dc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x53e320['id']);return getTicket(_0x58e266,_0x35bfbd,_0x53e320,_0x24a518,_0x4cbe80);})[_0x9f10('0x19')](function(_0x3a5032){if(_0x3a5032){logger[_0x9f10('0xc')](_0x9f10('0x50'),_0x3a5032['id']);}})[_0x9f10('0x58')](function(_0x9688a7){logger[_0x9f10('0x64')]('['+_0x4cbe80['lastevent'][_0x9f10('0x63')]()+']'+_0x9f10('0x65'),util[_0x9f10('0x5a')](_0x9688a7,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xb903=['stringify','GET','map','forEach','type','string','nameField','customField','toLowerCase','toString','idField','custom_fields','push','content','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','POST','newTab','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','The\x20Ticket\x20ID\x20is:','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','merge','Tags','name','getString','Descriptions','Fields','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','format','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','results','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','password','%s:%s','authType','token','%s/token:%s','Basic\x20%s','debug','[HTTP]'];(function(_0x24618a,_0x2cd0f4){var _0x2e3d64=function(_0x28c59c){while(--_0x28c59c){_0x24618a['push'](_0x24618a['shift']());}};_0x2e3d64(++_0x2cd0f4);}(_0xb903,0x185));var _0x3b90=function(_0x57ca96,_0x553f7b){_0x57ca96=_0x57ca96-0x0;var _0x45ef70=_0xb903[_0x57ca96];return _0x45ef70;};'use strict';var _=require(_0x3b90('0x0'));var rp=require(_0x3b90('0x1'));var md5=require(_0x3b90('0x2'));var util=require(_0x3b90('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3b90('0x4'));var config=require(_0x3b90('0x5'));var logger=require(_0x3b90('0x6'))(_0x3b90('0x7'));config[_0x3b90('0x8')]=_[_0x3b90('0x9')](config[_0x3b90('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x3b90('0xa'))(new Redis(config['redis']));function emit(_0x55792c,_0x153283,_0x2e4c06){io['to'](_0x55792c)[_0x3b90('0xb')](_0x153283,_0x2e4c06);}var headers={'Content-Type':_0x3b90('0xc'),'Accept':'application/json'};function getTicket(_0x5cda1d,_0x52401e,_0x51f916,_0x56261b,_0x55db3f){logger[_0x3b90('0xd')](_0x3b90('0xe'));return request({'uri':util['format'](_0x3b90('0xf'),_0x5cda1d[_0x3b90('0x10')]),'method':'POST','body':{'ticket':_[_0x3b90('0x11')]({'requester_id':_0x51f916['id'],'submitter_id':_0x52401e?_0x52401e['id']:undefined,'assignee_id':_0x52401e?_0x52401e['id']:undefined,'tags':getTags(_0x56261b[_0x3b90('0x12')],_0x3b90('0x13')),'subject':intUtil['getString'](_0x56261b['Subjects'],_0x55db3f,'\x20'),'description':intUtil[_0x3b90('0x14')](_0x56261b['Descriptions'],_0x55db3f,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x56261b[_0x3b90('0x15')],_0x55db3f,'\x0a')}},getCustomFields(_0x56261b[_0x3b90('0x16')],_0x55db3f))}})['then'](function(_0x51fb66){logger[_0x3b90('0xd')](_0x3b90('0x17'));return _0x51fb66[_0x3b90('0x18')];});}function getUser(_0x1af265,_0x1efe01){if(intUtil['validateEmail'](_0x1efe01)){logger['info'](_0x3b90('0x19'),_0x1efe01);return request({'uri':util[_0x3b90('0x1a')]('%s/search.json',_0x1af265[_0x3b90('0x10')]),'qs':{'query':util[_0x3b90('0x1a')](_0x3b90('0x1b'),_0x1efe01)}})[_0x3b90('0x1c')](function(_0x4f388b){if(_0x4f388b[_0x3b90('0x1d')]){logger['info'](_0x3b90('0x1e'));return _[_0x3b90('0x1f')](_0x4f388b['results'],{'email':_0x1efe01,'role':_0x3b90('0x20')});}else{logger[_0x3b90('0xd')](_0x3b90('0x21'));return request({'uri':util[_0x3b90('0x1a')](_0x3b90('0x22'),_0x1af265[_0x3b90('0x10')])})[_0x3b90('0x1c')](function(_0x2f4270){logger[_0x3b90('0xd')](_0x3b90('0x23'));return _0x2f4270['user'];});}});}else{logger[_0x3b90('0xd')](_0x3b90('0x21'));return request({'uri':util[_0x3b90('0x1a')](_0x3b90('0x22'),_0x1af265[_0x3b90('0x10')])})[_0x3b90('0x1c')](function(_0x58fa12){logger['info'](_0x3b90('0x23'));return _0x58fa12[_0x3b90('0x24')];});}}function getEndUser(_0x103324,_0x2ffa1a,_0x583523){logger[_0x3b90('0xd')](_0x3b90('0x25'),_0x583523);return request({'uri':util[_0x3b90('0x1a')]('%s/search.json',_0x103324[_0x3b90('0x10')]),'qs':{'query':util[_0x3b90('0x1a')](_0x3b90('0x26'),_0x583523)}})[_0x3b90('0x1c')](function(_0x153d7c){var _0x7adf75;if(_0x153d7c['results'][_0x3b90('0x27')]){_0x153d7c['results']=_[_0x3b90('0x28')](_0x153d7c[_0x3b90('0x29')],{'suspended':![],'role':_0x3b90('0x2a')});if(_0x153d7c[_0x3b90('0x29')][_0x3b90('0x27')]){_0x7adf75=_[_0x3b90('0x2b')](_0x153d7c[_0x3b90('0x29')]);}}if(_0x7adf75){logger[_0x3b90('0xd')]('Enduser\x20found!');return _0x7adf75;}else{logger['info'](_0x3b90('0x2c'));return request({'uri':util[_0x3b90('0x1a')](_0x3b90('0x2d'),_0x103324[_0x3b90('0x10')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x3b90('0x1a')](_0x3b90('0x2e'),_0x2ffa1a||_0x583523),'phone':_0x583523}}})[_0x3b90('0x1c')](function(_0x4f3ab5){logger[_0x3b90('0xd')]('Enduser\x20created.');return _0x4f3ab5['user'];});}});}function getAuth(_0x208f3e){var _0x3fbc03;if(_0x208f3e['authType']===_0x3b90('0x2f')){_0x3fbc03=util[_0x3b90('0x1a')](_0x3b90('0x30'),_0x208f3e['username'],_0x208f3e['password']);}else if(_0x208f3e[_0x3b90('0x31')]===_0x3b90('0x32')){_0x3fbc03=util[_0x3b90('0x1a')](_0x3b90('0x33'),_0x208f3e['username'],_0x208f3e['token']);}return util[_0x3b90('0x1a')](_0x3b90('0x34'),new Buffer(_0x3fbc03)['toString']('base64'));}function request(_0x201712){logger[_0x3b90('0x35')](_0x3b90('0x36'),JSON[_0x3b90('0x37')](_0x201712));return rp(_['defaults'](_0x201712,{'method':_0x3b90('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x583842,_0x19533a){var _0x43bae5=[];if(_0x583842&&_0x583842[_0x3b90('0x27')]>0x0){_0x43bae5=_[_0x3b90('0x39')](_0x583842,_0x19533a);}return _0x43bae5;}function getCustomFields(_0x2cbae8,_0x3bf148){var _0x96f7f3=[];var _0x534bea={'custom_fields':[]};if(_0x2cbae8[_0x3b90('0x27')]>0x0){_[_0x3b90('0x3a')](_0x2cbae8,function(_0x2fd30c){if(_0x2fd30c[_0x3b90('0x3b')]===_0x3b90('0x3c')&&_0x2fd30c[_0x3b90('0x3d')]&&!_0x2fd30c[_0x3b90('0x3e')]){_0x534bea[_0x2fd30c[_0x3b90('0x3d')][_0x3b90('0x3f')]()]=_0x2fd30c['content'][_0x3b90('0x40')]();}else if(_0x2fd30c[_0x3b90('0x3b')]===_0x3b90('0x3c')&&_0x2fd30c[_0x3b90('0x41')]&&_0x2fd30c[_0x3b90('0x3e')]){_0x534bea[_0x3b90('0x42')][_0x3b90('0x43')]({'id':_0x2fd30c[_0x3b90('0x41')],'value':_0x2fd30c[_0x3b90('0x44')][_0x3b90('0x40')]()});}else if(_0x2fd30c[_0x3b90('0x3b')]===_0x3b90('0x45')&&_0x2fd30c[_0x3b90('0x46')]&&_0x2fd30c[_0x3b90('0x41')]&&_0x2fd30c[_0x3b90('0x3e')]){_0x3bf148[_0x2fd30c[_0x3b90('0x46')]]&&_0x534bea[_0x3b90('0x42')][_0x3b90('0x43')]({'id':_0x2fd30c[_0x3b90('0x41')],'value':_0x3bf148[_0x2fd30c[_0x3b90('0x46')]][_0x3b90('0x40')]()});}else if(_0x2fd30c['type']===_0x3b90('0x47')&&_0x2fd30c[_0x3b90('0x48')]&&_0x2fd30c[_0x3b90('0x48')][_0x3b90('0x13')]&&_0x2fd30c['idField']&&_0x2fd30c[_0x3b90('0x3e')]){_0x3bf148[_0x2fd30c['Variable']['name'][_0x3b90('0x3f')]()]&&_0x534bea[_0x3b90('0x42')]['push']({'id':_0x2fd30c[_0x3b90('0x41')],'value':_0x3bf148[_0x2fd30c[_0x3b90('0x48')][_0x3b90('0x13')][_0x3b90('0x3f')]()][_0x3b90('0x40')]()});}});}return _0x534bea;}exports[_0x3b90('0x49')]=function(_0x28a344,_0x443eec,_0x28882e,_0x59b693,_0x3f71b0,_0x2e8a90){var _0x4df41c,_0x1e9a21;_0x2e8a90[_0x3b90('0x10')]=intUtil[_0x3b90('0x4a')](_0x2e8a90[_0x3b90('0x10')]);_0x2e8a90[_0x3b90('0x4b')]=intUtil['stripTrailingSlash'](_0x2e8a90['serverUrl']);if(_0x3f71b0&&_0x3f71b0[_0x3b90('0x4c')]){logger['info'](_0x3b90('0x4d'),_0x3b90('0x4e'));_0x443eec[_0x3b90('0x4f')]=util[_0x3b90('0x1a')](_0x3b90('0x50'),_0x2e8a90['serverUrl'],_0x443eec['uniqueid'],md5(_0x443eec[_0x3b90('0x51')]));}else{_0x443eec[_0x3b90('0x4f')]='';}headers[_0x3b90('0x52')]=getAuth(_0x2e8a90);return getUser(_0x2e8a90,_0x59b693['email'])[_0x3b90('0x1c')](function(_0x291279){_0x4df41c=_0x291279;logger[_0x3b90('0xd')](_0x3b90('0x53'),_0x4df41c['id']);return getEndUser(_0x2e8a90,_0x443eec[_0x3b90('0x54')],_0x443eec[_0x3b90('0x55')]);})[_0x3b90('0x1c')](function(_0x13b364){_0x1e9a21=_0x13b364;logger[_0x3b90('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1e9a21['id']);return getTicket(_0x2e8a90,_0x4df41c,_0x1e9a21,_0x28882e,_0x443eec);})[_0x3b90('0x1c')](function(_0x407784){if(_0x407784){logger[_0x3b90('0xd')]('The\x20Ticket\x20ID\x20is:',_0x407784['id']);switch(_0x2e8a90[_0x3b90('0x3b')]){case'integrationTab':logger[_0x3b90('0xd')](_0x3b90('0x4d'),_0x3b90('0x56'));return request({'uri':util['format'](_0x3b90('0x57'),_0x2e8a90[_0x3b90('0x10')],_0x4df41c['id'],_0x407784['id']),'method':'POST'});case'newTab':logger[_0x3b90('0xd')](_0x3b90('0x4d'),_0x3b90('0x58'));emit(util[_0x3b90('0x1a')]('user:%s',_0x59b693['name']),_0x3b90('0x59'),{'uri':util[_0x3b90('0x1a')](_0x3b90('0x5a'),_0x2e8a90[_0x3b90('0x10')],_0x407784['id'])});break;default:logger[_0x3b90('0x5b')](_0x3b90('0x4d'),_0x3b90('0x5c'));}}})[_0x3b90('0x5d')](function(_0x30f446){logger['error'](_0x3b90('0x5e'),util[_0x3b90('0x5f')](_0x30f446,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x1d211a,_0x26b15f,_0x4d512e,_0x3677d1,_0x16c30f,_0x115232,_0x1bada9){var _0x451fae,_0x2b3cd5;_0x115232[_0x3b90('0x10')]=intUtil['stripTrailingSlash'](_0x115232[_0x3b90('0x10')]);_0x115232[_0x3b90('0x4b')]=intUtil[_0x3b90('0x4a')](_0x115232[_0x3b90('0x4b')]);if(_0x1bada9&&_0x1bada9[_0x3b90('0x60')]&&_0x1bada9[_0x3b90('0x60')]!==_0x3b90('0x61')){logger[_0x3b90('0xd')](_0x3b90('0x62'),_0x3b90('0x4e'));_0x26b15f[_0x3b90('0x4f')]=util[_0x3b90('0x1a')](_0x3b90('0x50'),_0x115232[_0x3b90('0x4b')],_0x26b15f[_0x3b90('0x51')],md5(_0x26b15f['uniqueid']));}headers[_0x3b90('0x52')]=getAuth(_0x115232);return getUser(_0x115232,_0x3677d1['email'])[_0x3b90('0x1c')](function(_0x290550){_0x451fae=_0x290550;logger[_0x3b90('0xd')](_0x3b90('0x53'),_0x451fae['id']);return getEndUser(_0x115232,_0x26b15f[_0x3b90('0x63')],_0x26b15f[_0x3b90('0x64')]);})['then'](function(_0x35af6e){_0x2b3cd5=_0x35af6e;logger[_0x3b90('0xd')](_0x3b90('0x65'),_0x2b3cd5['id']);return getTicket(_0x115232,_0x451fae,_0x2b3cd5,_0x4d512e,_0x26b15f);})[_0x3b90('0x1c')](function(_0x3d41c8){if(_0x3d41c8){logger[_0x3b90('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3d41c8['id']);switch(_0x115232[_0x3b90('0x3b')]){case _0x3b90('0x66'):logger[_0x3b90('0xd')]('[OUTBOUND]',_0x3b90('0x56'));return request({'uri':util[_0x3b90('0x1a')](_0x3b90('0x57'),_0x115232[_0x3b90('0x10')],_0x451fae['id'],_0x3d41c8['id']),'method':_0x3b90('0x67')});case _0x3b90('0x68'):logger[_0x3b90('0xd')](_0x3b90('0x62'),_0x3b90('0x58'));emit(util['format'](_0x3b90('0x69'),_0x3677d1['name']),'trigger:browser:url',{'uri':util[_0x3b90('0x1a')](_0x3b90('0x5a'),_0x115232['remoteUri'],_0x3d41c8['id'])});break;default:logger[_0x3b90('0x5b')](_0x3b90('0x62'),_0x3b90('0x5c'));}}})[_0x3b90('0x5d')](function(_0x39133d){logger[_0x3b90('0x5b')](_0x3b90('0x6a'),util['inspect'](_0x39133d,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x3e5532,_0x5e5efa,_0x2bdd3d,_0x5ad9d6,_0x1a6d33,_0x5e44ae){var _0x532e98,_0x5d00b6;_0x5e44ae[_0x3b90('0x10')]=intUtil[_0x3b90('0x4a')](_0x5e44ae[_0x3b90('0x10')]);_0x5e44ae[_0x3b90('0x4b')]=intUtil[_0x3b90('0x4a')](_0x5e44ae[_0x3b90('0x4b')]);if(_0x1a6d33&&_0x1a6d33[_0x3b90('0x4c')]){logger['info']('['+_0x5e5efa['lastevent']['toUpperCase']()+']',_0x3b90('0x4e'));_0x5e5efa[_0x3b90('0x4f')]=util['format'](_0x3b90('0x50'),_0x5e44ae[_0x3b90('0x4b')],_0x5e5efa[_0x3b90('0x51')],md5(_0x5e5efa[_0x3b90('0x51')]));}else{_0x5e5efa[_0x3b90('0x4f')]='';}headers[_0x3b90('0x52')]=getAuth(_0x5e44ae);return getUser(_0x5e44ae)[_0x3b90('0x1c')](function(_0x89933c){_0x532e98=_0x89933c;logger[_0x3b90('0xd')]('The\x20User\x20ID\x20is:',_0x532e98['id']);return getEndUser(_0x5e44ae,_0x5e5efa[_0x3b90('0x54')],_0x5e5efa['calleridnum']);})[_0x3b90('0x1c')](function(_0x2ddd93){_0x5d00b6=_0x2ddd93;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5d00b6['id']);return getTicket(_0x5e44ae,_0x532e98,_0x5d00b6,_0x2bdd3d,_0x5e5efa);})[_0x3b90('0x1c')](function(_0x4337f0){if(_0x4337f0){logger[_0x3b90('0xd')](_0x3b90('0x6b'),_0x4337f0['id']);}})[_0x3b90('0x5d')](function(_0x42e14f){logger['error']('['+_0x5e5efa[_0x3b90('0x6c')][_0x3b90('0x6d')]()+']'+_0x3b90('0x6e'),util['inspect'](_0x42e14f,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 6208708..7dada35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x707d=['stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','email','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','uri','Leads','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','talktime','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Called','complete','Call_Result','Answered','Rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','Inbound','merge','Fields','code','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','recordingFormat','none','[OUTBOUND]','com','destcalleridname','https://crm.','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','zoho.eu','lodash','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','emit','[HTTP]','stringify','length','forEach','type','string','idField','toString','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x707d,0x18b));var _0xd707=function(_0x51ae4e,_0x425f1c){_0x51ae4e=_0x51ae4e-0x0;var _0x4b2274=_0x707d[_0x51ae4e];return _0x4b2274;};'use strict';var _=require(_0xd707('0x0'));var rp=require(_0xd707('0x1'));var md5=require(_0xd707('0x2'));var util=require(_0xd707('0x3'));var intUtil=require(_0xd707('0x4'));var moment=require(_0xd707('0x5'));var Redis=require(_0xd707('0x6'));var BPromise=require('bluebird');var config=require(_0xd707('0x7'));var logger=require(_0xd707('0x8'))(_0xd707('0x9'));config[_0xd707('0xa')]=_['defaults'](config[_0xd707('0xa')],{'host':_0xd707('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd707('0xa')]));function emit(_0xf596b4,_0x11edc8,_0x5d95fa){io['to'](_0xf596b4)[_0xd707('0xc')](_0x11edc8,_0x5d95fa);}function request(_0x249b0d){logger['debug'](_0xd707('0xd'),JSON[_0xd707('0xe')](_0x249b0d));return rp(_0x249b0d);}function getCustomFields(_0x588b55,_0x5af991){var _0x238856={};if(_0x588b55[_0xd707('0xf')]>0x0){_[_0xd707('0x10')](_0x588b55,function(_0x53a412){if(_0x53a412[_0xd707('0x11')]===_0xd707('0x12')&&_0x53a412[_0xd707('0x13')]){_0x238856[_0x53a412['idField']]=_0x53a412['content'][_0xd707('0x14')]();}else if(_0x53a412[_0xd707('0x11')]==='variable'&&_0x53a412[_0xd707('0x15')]&&_0x53a412[_0xd707('0x13')]&&_0x5af991[_0x53a412['variableName']]){_0x238856[_0x53a412[_0xd707('0x13')]]=_0x5af991[_0x53a412[_0xd707('0x15')]]['toString']();}else if(_0x53a412['type']===_0xd707('0x16')&&_0x53a412['Variable']&&_0x53a412[_0xd707('0x17')][_0xd707('0x18')]&&_0x53a412['idField']&&_0x5af991[_0x53a412[_0xd707('0x17')][_0xd707('0x18')][_0xd707('0x19')]()]){_0x238856[_0x53a412[_0xd707('0x13')]]=_0x5af991[_0x53a412[_0xd707('0x17')][_0xd707('0x18')]['toLowerCase']()]['toString']();}});}return _0x238856;}function getName(_0x3d3dc5){if(_0x3d3dc5['indexOf']('\x20')>0x0){var _0x2307db=_0x3d3dc5[_0xd707('0x1a')](/ (.+)/);if(_0x2307db[0x1]){return _0x2307db;}}return[_0x3d3dc5,_0x3d3dc5];}var accountsTokens={};function getAccessToken(_0x1c5aba){return new Promise(function(_0x4c2e25,_0x5f152e){if(!_[_0xd707('0x1b')](accountsTokens[_0x1c5aba['id']])&&!_[_0xd707('0x1b')](accountsTokens[_0x1c5aba['id']][_0xd707('0x1c')])){if(moment()[_0xd707('0x1d')](accountsTokens[_0x1c5aba['id']][_0xd707('0x1e')])){_0x4c2e25(accountsTokens[_0x1c5aba['id']][_0xd707('0x1c')]);}}var _0x45c504;switch(_0x1c5aba['zone']){case'US':_0x45c504=_0xd707('0x1f');break;case'AU':_0x45c504='https://accounts.zoho.com.au';break;case'EU':_0x45c504=_0xd707('0x20');break;case'IN':_0x45c504='https://accounts.zoho.in';break;case'CN':_0x45c504=_0xd707('0x21');break;default:_0x45c504=_0xd707('0x20');break;}var _0x370dfd={'method':'POST','uri':_0x45c504+_0xd707('0x22'),'qs':{'refresh_token':_0x1c5aba[_0xd707('0x23')],'client_id':_0x1c5aba['clientId'],'client_secret':_0x1c5aba[_0xd707('0x24')],'grant_type':_0xd707('0x25')},'json':!![]};return rp(_0x370dfd)[_0xd707('0x26')](function(_0xdc96a5){accountsTokens[_0x1c5aba['id']]={'access_token':_0xdc96a5[_0xd707('0x1c')],'expires_in':moment()[_0xd707('0x27')](_0xdc96a5[_0xd707('0x1e')],_0xd707('0x28'))};_0x4c2e25(_0xdc96a5[_0xd707('0x1c')]);})[_0xd707('0x29')](function(_0x27d15b){logger['error'](_0xd707('0x2a'),_0x27d15b[_0xd707('0x2b')]);_0x5f152e(_0x27d15b);});});}function getUser(_0x17145b,_0x2cf61d,_0x47029e,_0x5c0310){logger[_0xd707('0x2c')](_0xd707('0x2d'));return request({'method':_0xd707('0x2e'),'uri':util[_0xd707('0x2f')](_0xd707('0x30'),_0x2cf61d),'qs':{'type':_0xd707('0x31')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x17145b},'json':!![]})[_0xd707('0x26')](function(_0x94486d){if(_0x94486d[_0xd707('0x32')]){var _0x4eb43c=-0x1;if(_['isArrayLikeObject'](_0x94486d[_0xd707('0x32')])){if(!_[_0xd707('0x1b')](_0x5c0310)){_0x4eb43c=_['findIndex'](_0x94486d[_0xd707('0x32')],function(_0x11b05b){return _0x11b05b[_0xd707('0x33')]===_0x5c0310;});}if(_0x4eb43c>=0x0){logger[_0xd707('0x2c')]('Agent\x20found!');}else{logger['info'](_0xd707('0x34'));_0x4eb43c=_[_0xd707('0x35')](_0x94486d['users'],function(_0x385378){return _0x385378[_0xd707('0x36')]['name']==='Administrator';});}return _0x94486d[_0xd707('0x32')][_0x4eb43c];}else{if(_0x94486d['user'][_0xd707('0x36')]['name']===_0xd707('0x37')){logger[_0xd707('0x2c')]('Using\x20the\x20admin\x20account!');user=_0x94486d[_0xd707('0x38')];return user;}else{logger[_0xd707('0x39')](_0xd707('0x3a'),JSON[_0xd707('0xe')](_0x94486d));throw new Error(_0xd707('0x3b')+JSON[_0xd707('0xe')](_0x94486d));}}}else{logger['error'](_0xd707('0x3a'),JSON[_0xd707('0xe')](_0x94486d));throw new Error(_0xd707('0x3b')+JSON[_0xd707('0xe')](_0x94486d));}})[_0xd707('0x29')](function(_0x15a45d){console[_0xd707('0x39')](_0x15a45d);});}function getZohoUser(_0x5e4237,_0x5beb41){return new BPromise(function(_0x5ecc38,_0x495c2a){request(_0x5e4237)[_0xd707('0x26')](function(_0x2db9ae){var _0x29fdf6=null;if(_0x2db9ae){_0x29fdf6=_0x2db9ae[_0xd707('0x3c')][0x0];_0x29fdf6[_0xd707('0x3d')]=_0x5beb41;}_0x5ecc38(_0x29fdf6);})['catch'](function(_0x511e16){_0x495c2a(_0x511e16);});});}function createEndUser(_0x998655,_0x21c473,_0x2ccada,_0x418d07,_0x3b728,_0x26ed13){var _0x2ccada=getName(_0x2ccada);return request({'method':'POST','uri':_0xd707('0x3e')+_0x21c473+'/crm/v2/'+_[_0xd707('0x3f')](_0x26ed13[_0xd707('0x40')])+'s','body':{'data':[{'Last_Name':_0x2ccada[0x1],'First_Name':_0x2ccada[0x0],'Phone':_0x418d07,'Owner':{'name':!_[_0xd707('0x1b')](_0x3b728[_0xd707('0x41')]['name'])?_0x3b728[_0xd707('0x41')][_0xd707('0x18')]:!_[_0xd707('0x1b')](_0x3b728[_0xd707('0x42')])?_0x3b728[_0xd707('0x42')]+'\x20'+_0x3b728[_0xd707('0x43')]:_0x3b728[_0xd707('0x43')],'id':_0x3b728['id']}}]},'headers':{'Authorization':_0xd707('0x44')+_0x998655},'json':!![]})[_0xd707('0x26')](function(_0x168359){if(_0x168359&&_0x168359[_0xd707('0x3c')][0x0]['code']===_0xd707('0x45')){var _0x5635b9=_0x168359[_0xd707('0x3c')][0x0][_0xd707('0x46')];_0x5635b9['enduserType']=_['startCase'](_0x26ed13['moduleCreate'])+'s';return _0x5635b9;}logger[_0xd707('0x39')](_0xd707('0x3a'),JSON[_0xd707('0xe')](data));throw new Error(_0xd707('0x47')+JSON[_0xd707('0xe')](data));})['catch'](function(_0x4c4932){console[_0xd707('0x48')](_0xd707('0x49'),_0x4c4932);});}function getEndUser(_0x3285eb,_0x15b120,_0x59523b,_0x34fb1a,_0xebff35,_0x3684ef,_0x26c7ff){var _0x2d4c52={'method':_0xd707('0x2e'),'uri':'','headers':{'Authorization':_0xd707('0x44')+_0x3285eb},'json':!![]};switch(_0x26c7ff[_0xd707('0x4a')]){case _0xd707('0x4b'):_0x2d4c52['uri']=_0xd707('0x3e')+_0x15b120+_0xd707('0x4c')+_0xebff35+'))';return getZohoUser(_0x2d4c52,_0xd707('0x4d'))['then'](function(_0x198d79){if(_0x198d79)return _0x198d79;_0x2d4c52['uri']='https://www.zohoapis.'+_0x15b120+_0xd707('0x4e')+_0xebff35+'))';return getZohoUser(_0x2d4c52,'Leads')[_0xd707('0x26')](function(_0x199f7d){if(_0x199f7d)return _0x199f7d;if(_0x26c7ff['moduleCreate']!=_0xd707('0x4f')){return createEndUser(_0x3285eb,_0x15b120,_0x34fb1a,_0xebff35,_0x3684ef,_0x26c7ff);}else{return{};}});});break;case _0xd707('0x50'):_0x2d4c52['uri']=_0xd707('0x3e')+_0x15b120+_0xd707('0x4c')+_0xebff35+'))';return getZohoUser(_0x2d4c52,_0xd707('0x4d'))[_0xd707('0x26')](function(_0x132302){if(_0x132302)return _0x132302;if(_0x26c7ff[_0xd707('0x40')]!=_0xd707('0x4f')){return createEndUser(_0x3285eb,_0x15b120,_0x34fb1a,_0xebff35,_0x3684ef,_0x26c7ff);}else{return{};}});break;case'lead':_0x2d4c52[_0xd707('0x51')]=_0xd707('0x3e')+_0x15b120+_0xd707('0x4e')+_0xebff35+'))';return getZohoUser(_0x2d4c52,_0xd707('0x52'))[_0xd707('0x26')](function(_0x209168){if(_0x209168)return _0x209168;if(_0x26c7ff['moduleCreate']!=_0xd707('0x4f')){return createEndUser(_0x3285eb,_0x15b120,_0x34fb1a,_0xebff35,_0x3684ef,_0x26c7ff);}else{return{};}});break;}}function getCall(_0x2d9736,_0x260c0a,_0x481a34,_0x462e46,_0x5afe37,_0x28bf15,_0x1ffc7e,_0x5b8c02){logger[_0xd707('0x2c')](_0xd707('0x53'));var _0x56d431={};_0x56d431[_0xd707('0x54')]={'name':!_[_0xd707('0x1b')](_0x462e46[_0xd707('0x41')]['name'])&&!_[_0xd707('0x1b')](_0x462e46[_0xd707('0x36')][_0xd707('0x18')])&&_0x462e46[_0xd707('0x36')][_0xd707('0x18')]==='administrator'?_0x462e46[_0xd707('0x41')][_0xd707('0x18')]:!_[_0xd707('0x1b')](_0x462e46['first_name'])?_0x462e46[_0xd707('0x42')]+'\x20'+_0x462e46['last_name']:_0x462e46[_0xd707('0x43')],'id':_0x462e46['id']};_0x56d431[_0xd707('0x55')]=intUtil[_0xd707('0x56')](_0x28bf15[_0xd707('0x57')],_0x1ffc7e,'\x20');_0x56d431[_0xd707('0x58')]=intUtil[_0xd707('0x56')](_0x28bf15[_0xd707('0x59')],_0x1ffc7e,'\x0a');if(_0x5afe37[_0xd707('0x3d')]===_0xd707('0x4d')){_0x56d431[_0xd707('0x5a')]={'name':!_[_0xd707('0x1b')](_0x5afe37[_0xd707('0x5b')])?_0x5afe37['Full_Name']:!_[_0xd707('0x1b')](_0x5afe37[_0xd707('0x5c')])?_0x5afe37['First_Name']+'\x20'+_0x5afe37[_0xd707('0x5d')]:_0x5afe37[_0xd707('0x5d')],'id':_0x5afe37['id']};}if(_0x5afe37[_0xd707('0x3d')]==='Leads'){_0x56d431['What_Id']={'name':!_['isNil'](_0x5afe37[_0xd707('0x5b')])?_0x5afe37['Full_Name']:!_[_0xd707('0x1b')](_0x5afe37[_0xd707('0x5c')])?_0x5afe37[_0xd707('0x5c')]+'\x20'+_0x5afe37[_0xd707('0x5d')]:_0x5afe37[_0xd707('0x5d')],'id':_0x5afe37['id']};_0x56d431['$se_module']=_['startCase'](_0x5afe37[_0xd707('0x3d')]);}if(_0x1ffc7e[_0xd707('0x5e')]){_0x56d431['Call_Duration']=moment[_0xd707('0x5f')](parseInt(_0x1ffc7e['talktime'])*0x3e8)[_0xd707('0x2f')](_0xd707('0x60'));}else if(_0x1ffc7e[_0xd707('0x61')]&&_0x1ffc7e[_0xd707('0x62')]){_0x56d431['Call_Duration']=moment[_0xd707('0x5f')](moment(_0x1ffc7e[_0xd707('0x62')],_0xd707('0x63'))[_0xd707('0x64')](moment(_0x1ffc7e[_0xd707('0x65')],_0xd707('0x63'))))['format'](_0xd707('0x60'));}switch(_0x1ffc7e[_0xd707('0x66')]){case _0xd707('0x67'):_0x56d431['Call_Result']=_0xd707('0x68');break;case _0xd707('0x69'):case'connect':_0x56d431[_0xd707('0x6a')]=_0xd707('0x6b');break;case'rejected':_0x56d431['Call_Result']=_0xd707('0x6c');break;case _0xd707('0x6d'):_0x56d431['Call_Result']='Abandoned';break;case _0xd707('0x6e'):_0x56d431[_0xd707('0x6a')]=_0xd707('0x6f');default:}_0x56d431[_0xd707('0x70')]=(_0x5b8c02===_0xd707('0x71')?moment(_0x1ffc7e['starttime'])[_0xd707('0x2f')](_0xd707('0x63')):moment(_0x1ffc7e['agentcalledAt'])[_0xd707('0x2f')](_0xd707('0x63')))||moment()[_0xd707('0x2f')](_0xd707('0x63'));_0x56d431['Call_Type']=_0x5b8c02||_0xd707('0x72');_0x56d431=_[_0xd707('0x73')](_0x56d431,getCustomFields(_0x28bf15[_0xd707('0x74')],_0x1ffc7e));return request({'method':'POST','uri':_0xd707('0x3e')+_0x260c0a+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2d9736},'body':{'data':[_0x56d431]},'json':!![]})['then'](function(_0x1ffd86){if(_0x1ffd86&&_0x1ffd86[_0xd707('0x3c')][0x0][_0xd707('0x75')]===_0xd707('0x45')){logger['info']('Call\x20created!');return{'id':_0x1ffd86[_0xd707('0x3c')][0x0][_0xd707('0x46')]['id']};}})[_0xd707('0x29')](function(_0x1f7d06){logger[_0xd707('0x2c')](_0xd707('0x76'),_0x1f7d06['stack']);console[_0xd707('0x48')]('err',_0x1f7d06);});}exports['queue']=function(_0x4eb2ec,_0x4731f8,_0x47d153,_0xd5c89b,_0x3cf38a,_0x372c83){var _0x1bea45,_0x10de5c,_0x380acc;_0x372c83[_0xd707('0x77')]=intUtil[_0xd707('0x78')](_0x372c83[_0xd707('0x77')]);_0x372c83[_0xd707('0x79')]=intUtil[_0xd707('0x78')](_0x372c83[_0xd707('0x79')]);if(_0x3cf38a&&_0x3cf38a[_0xd707('0x7a')]){logger['info'](_0xd707('0x7b'),_0xd707('0x7c'));_0x4731f8['recordingURL']=_0x372c83[_0xd707('0x79')]+_0xd707('0x7d')+_0x4731f8[_0xd707('0x7e')]+_0xd707('0x7f')+md5(_0x4731f8['uniqueid']);}else{_0x4731f8[_0xd707('0x80')]='';}var _0x36dabd=_0x372c83[_0xd707('0x77')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x372c83)['then'](function(_0x10fb2f){_0x380acc=_0x10fb2f;return getUser(_0x380acc,_0x36dabd,_0x372c83,_0xd5c89b[_0xd707('0x33')]);})[_0xd707('0x26')](function(_0x341173){_0x1bea45=_0x341173;logger[_0xd707('0x2c')](_0xd707('0x81'),_0x1bea45['id']);return getEndUser(_0x380acc,_0x36dabd,_0x372c83,_0x4731f8[_0xd707('0x82')],_0x4731f8[_0xd707('0x83')],_0x1bea45,_0x47d153);})[_0xd707('0x26')](function(_0x1a8868){_0x10de5c=_0x1a8868;return getCall(_0x380acc,_0x36dabd,_0x372c83,_0x1bea45,_0x10de5c,_0x47d153,_0x4731f8,_0xd707('0x72'));})[_0xd707('0x26')](function(_0x451bc2){if(_0x451bc2){logger[_0xd707('0x2c')](_0xd707('0x84'),_0x451bc2['id']);logger[_0xd707('0x2c')]('[QUEUE]',_0xd707('0x85'));emit(util[_0xd707('0x2f')](_0xd707('0x86'),_0xd5c89b[_0xd707('0x18')]),_0xd707('0x87'),{'uri':'https://crm.'+_0x372c83[_0xd707('0x77')]+'/crm/EntityInfo.do?module=Calls&id='+_0x451bc2['id']});}})['catch'](function(_0x14c278){logger[_0xd707('0x39')](_0xd707('0x7b'),JSON['stringify'](_0x14c278));});};exports['outbound']=function(_0x5deff0,_0x3fa0a2,_0x39e5f1,_0x910ff2,_0x44a7a5,_0x3b39ce,_0x4e7a7f){var _0x54115d,_0x55361f,_0x44317d;_0x3b39ce['host']=intUtil[_0xd707('0x78')](_0x3b39ce[_0xd707('0x77')]);_0x3b39ce[_0xd707('0x79')]=intUtil['stripTrailingSlash'](_0x3b39ce[_0xd707('0x79')]);if(_0x4e7a7f&&_0x4e7a7f['recordingFormat']&&_0x4e7a7f[_0xd707('0x88')]!==_0xd707('0x89')){logger[_0xd707('0x2c')](_0xd707('0x8a'),'Recording\x20is\x20enabled!');_0x3fa0a2[_0xd707('0x80')]=_0x3b39ce['serverUrl']+_0xd707('0x7d')+_0x3fa0a2[_0xd707('0x7e')]+_0xd707('0x7f')+md5(_0x3fa0a2[_0xd707('0x7e')]);}var _0x1ff17c=_0x3b39ce[_0xd707('0x77')]==='zoho.eu'?'eu':_0xd707('0x8b');return getAccessToken(_0x3b39ce)[_0xd707('0x26')](function(_0x2a451c){_0x44317d=_0x2a451c;return getUser(_0x44317d,_0x1ff17c,_0x3b39ce,_0x910ff2[_0xd707('0x33')]);})['then'](function(_0x3d1c3c){_0x54115d=_0x3d1c3c;logger['info']('The\x20User\x20ID\x20is:',_0x54115d['id']);return getEndUser(_0x44317d,_0x1ff17c,_0x3b39ce,_0x3fa0a2[_0xd707('0x8c')],_0x3fa0a2['destcalleridnum'],_0x54115d,_0x39e5f1);})[_0xd707('0x26')](function(_0x1b8306){_0x55361f=_0x1b8306;return getCall(_0x44317d,_0x1ff17c,_0x3b39ce,_0x54115d,_0x55361f,_0x39e5f1,_0x3fa0a2,'Outbound');})[_0xd707('0x26')](function(_0x5926b2){if(_0x5926b2){logger[_0xd707('0x2c')](_0xd707('0x84'),_0x5926b2['id']);logger[_0xd707('0x2c')](_0xd707('0x8a'),_0xd707('0x85'));emit(util[_0xd707('0x2f')](_0xd707('0x86'),_0x910ff2[_0xd707('0x18')]),'trigger:browser:url',{'uri':_0xd707('0x8d')+_0x3b39ce['host']+_0xd707('0x8e')+_0x5926b2['id']});}})[_0xd707('0x29')](function(_0x3724d8){logger['error'](_0xd707('0x8a'),JSON[_0xd707('0xe')](_0x3724d8));});};exports[_0xd707('0x8f')]=function(_0x26d2c1,_0x1c6da2,_0x5f515f,_0x3caf96,_0x38400b,_0x41afe4){var _0x3cc69f,_0x545acf,_0x22d34d;_0x41afe4[_0xd707('0x77')]=intUtil[_0xd707('0x78')](_0x41afe4[_0xd707('0x77')]);_0x41afe4[_0xd707('0x79')]=intUtil[_0xd707('0x78')](_0x41afe4['serverUrl']);if(_0x38400b&&_0x38400b[_0xd707('0x7a')]){logger[_0xd707('0x2c')]('['+_0x1c6da2['lastevent'][_0xd707('0x90')]()+']',_0xd707('0x7c'));_0x1c6da2[_0xd707('0x80')]=_0x41afe4[_0xd707('0x79')]+_0xd707('0x7d')+_0x1c6da2['uniqueid']+_0xd707('0x7f')+md5(_0x1c6da2[_0xd707('0x7e')]);}else{_0x1c6da2[_0xd707('0x80')]='';}var _0x51d956=_0x41afe4['host']===_0xd707('0x91')?'eu':_0xd707('0x8b');return getAccessToken(_0x41afe4)[_0xd707('0x26')](function(_0xfdab1e){_0x22d34d=_0xfdab1e;return getUser(_0x22d34d,_0x51d956,_0x41afe4);})[_0xd707('0x26')](function(_0x54d1cc){_0x3cc69f=_0x54d1cc;logger['info'](_0xd707('0x81'),_0x3cc69f['id']);return getEndUser(_0x22d34d,_0x51d956,_0x41afe4,_0x1c6da2[_0xd707('0x82')],_0x1c6da2[_0xd707('0x83')],_0x3cc69f,_0x5f515f);})[_0xd707('0x26')](function(_0x419ca1){_0x545acf=_0x419ca1;return getCall(_0x22d34d,_0x51d956,_0x41afe4,_0x3cc69f,_0x545acf,_0x5f515f,_0x1c6da2,_0xd707('0x72'));})[_0xd707('0x26')](function(_0xf43e73){if(_0xf43e73){logger[_0xd707('0x2c')](_0xd707('0x84'),_0xf43e73['id']);}})[_0xd707('0x29')](function(_0x357289){logger[_0xd707('0x39')]('['+_0x1c6da2[_0xd707('0x66')][_0xd707('0x90')]()+']',JSON[_0xd707('0xe')](_0x357289));});};
\ No newline at end of file
+var _0x60a5=['name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','refreshToken','clientId','then','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','CREATE\x20ERROR','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','Contacts','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','called','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','timeout','Timeout','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','stripTrailingSlash','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridnum','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','/crm/EntityInfo.do?module=Calls&id=','catch','unmanaged','lastevent','toUpperCase','The\x20Call\x20ID\x20is:','lodash','util','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','emit','[HTTP]','length','forEach','type','string','idField','content','toString','variable','variableName','Variable'];(function(_0x21ac47,_0x725076){var _0x899829=function(_0x3c9b65){while(--_0x3c9b65){_0x21ac47['push'](_0x21ac47['shift']());}};_0x899829(++_0x725076);}(_0x60a5,0x83));var _0x560a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x60a5[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x560a('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x560a('0x1'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x560a('0x2'));var BPromise=require(_0x560a('0x3'));var config=require(_0x560a('0x4'));var logger=require('../../../../config/logger')(_0x560a('0x5'));config[_0x560a('0x6')]=_[_0x560a('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x3ac39e,_0x1891ea,_0x33ddbd){io['to'](_0x3ac39e)[_0x560a('0x8')](_0x1891ea,_0x33ddbd);}function request(_0x52c52e){logger['debug'](_0x560a('0x9'),JSON['stringify'](_0x52c52e));return rp(_0x52c52e);}function getCustomFields(_0x2e3b88,_0x13c6a3){var _0x4f7df3={};if(_0x2e3b88[_0x560a('0xa')]>0x0){_[_0x560a('0xb')](_0x2e3b88,function(_0x35b589){if(_0x35b589[_0x560a('0xc')]===_0x560a('0xd')&&_0x35b589[_0x560a('0xe')]){_0x4f7df3[_0x35b589[_0x560a('0xe')]]=_0x35b589[_0x560a('0xf')][_0x560a('0x10')]();}else if(_0x35b589['type']===_0x560a('0x11')&&_0x35b589[_0x560a('0x12')]&&_0x35b589[_0x560a('0xe')]&&_0x13c6a3[_0x35b589['variableName']]){_0x4f7df3[_0x35b589[_0x560a('0xe')]]=_0x13c6a3[_0x35b589[_0x560a('0x12')]][_0x560a('0x10')]();}else if(_0x35b589[_0x560a('0xc')]==='customVariable'&&_0x35b589[_0x560a('0x13')]&&_0x35b589[_0x560a('0x13')][_0x560a('0x14')]&&_0x35b589[_0x560a('0xe')]&&_0x13c6a3[_0x35b589['Variable']['name'][_0x560a('0x15')]()]){_0x4f7df3[_0x35b589[_0x560a('0xe')]]=_0x13c6a3[_0x35b589[_0x560a('0x13')][_0x560a('0x14')]['toLowerCase']()][_0x560a('0x10')]();}});}return _0x4f7df3;}function getName(_0x44dc4b){if(_0x44dc4b[_0x560a('0x16')]('\x20')>0x0){var _0x2b484f=_0x44dc4b[_0x560a('0x17')](/ (.+)/);if(_0x2b484f[0x1]){return _0x2b484f;}}return[_0x44dc4b,_0x44dc4b];}var accountsTokens={};function getAccessToken(_0x4807f2){return new Promise(function(_0x32ff83,_0x155c2b){if(!_[_0x560a('0x18')](accountsTokens[_0x4807f2['id']])&&!_[_0x560a('0x18')](accountsTokens[_0x4807f2['id']][_0x560a('0x19')])){if(moment()[_0x560a('0x1a')](accountsTokens[_0x4807f2['id']][_0x560a('0x1b')])){_0x32ff83(accountsTokens[_0x4807f2['id']]['access_token']);}}var _0x292a5a;switch(_0x4807f2[_0x560a('0x1c')]){case'US':_0x292a5a=_0x560a('0x1d');break;case'AU':_0x292a5a=_0x560a('0x1e');break;case'EU':_0x292a5a=_0x560a('0x1f');break;case'IN':_0x292a5a=_0x560a('0x20');break;case'CN':_0x292a5a=_0x560a('0x21');break;default:_0x292a5a=_0x560a('0x1f');break;}var _0x4c2d8a={'method':'POST','uri':_0x292a5a+'/oauth/v2/token','qs':{'refresh_token':_0x4807f2[_0x560a('0x22')],'client_id':_0x4807f2[_0x560a('0x23')],'client_secret':_0x4807f2['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x4c2d8a)[_0x560a('0x24')](function(_0x4f718e){accountsTokens[_0x4807f2['id']]={'access_token':_0x4f718e[_0x560a('0x19')],'expires_in':moment()[_0x560a('0x25')](_0x4f718e['expires_in'],_0x560a('0x26'))};_0x32ff83(_0x4f718e[_0x560a('0x19')]);})['catch'](function(_0x1ddcf6){logger[_0x560a('0x27')](_0x560a('0x28'),_0x1ddcf6[_0x560a('0x29')]);_0x155c2b(_0x1ddcf6);});});}function getUser(_0x40a668,_0x4a21cf,_0x46ee1f,_0x3c4af2){logger['info'](_0x560a('0x2a'));return request({'method':_0x560a('0x2b'),'uri':util[_0x560a('0x2c')](_0x560a('0x2d'),_0x4a21cf),'qs':{'type':_0x560a('0x2e')},'headers':{'Authorization':_0x560a('0x2f')+_0x40a668},'json':!![]})[_0x560a('0x24')](function(_0x54817a){if(_0x54817a[_0x560a('0x30')]){var _0x339dc6=-0x1;if(_['isArrayLikeObject'](_0x54817a['users'])){if(!_[_0x560a('0x18')](_0x3c4af2)){_0x339dc6=_[_0x560a('0x31')](_0x54817a[_0x560a('0x30')],function(_0x546f45){return _0x546f45['email']===_0x3c4af2;});}if(_0x339dc6>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x560a('0x32')](_0x560a('0x33'));_0x339dc6=_[_0x560a('0x31')](_0x54817a[_0x560a('0x30')],function(_0x32a9cc){return _0x32a9cc[_0x560a('0x34')][_0x560a('0x14')]===_0x560a('0x35');});}return _0x54817a[_0x560a('0x30')][_0x339dc6];}else{if(_0x54817a[_0x560a('0x36')]['profile'][_0x560a('0x14')]===_0x560a('0x35')){logger[_0x560a('0x32')](_0x560a('0x33'));user=_0x54817a[_0x560a('0x36')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x560a('0x37')](_0x54817a));throw new Error(_0x560a('0x38')+JSON[_0x560a('0x37')](_0x54817a));}}}else{logger[_0x560a('0x27')](_0x560a('0x39'),JSON['stringify'](_0x54817a));throw new Error(_0x560a('0x38')+JSON[_0x560a('0x37')](_0x54817a));}})['catch'](function(_0x3b5e48){console[_0x560a('0x27')](_0x3b5e48);});}function getZohoUser(_0x207951,_0x384f39){return new BPromise(function(_0x47eff6,_0xc85f59){request(_0x207951)['then'](function(_0x12bcf4){var _0x3ff796=null;if(_0x12bcf4){_0x3ff796=_0x12bcf4[_0x560a('0x3a')][0x0];_0x3ff796[_0x560a('0x3b')]=_0x384f39;}_0x47eff6(_0x3ff796);})['catch'](function(_0x2a32ad){_0xc85f59(_0x2a32ad);});});}function createEndUser(_0x513e00,_0x40e1e2,_0x9c58bd,_0x2e7405,_0x21b999,_0x329f01){var _0x9c58bd=getName(_0x9c58bd);return request({'method':_0x560a('0x3c'),'uri':_0x560a('0x3d')+_0x40e1e2+_0x560a('0x3e')+_[_0x560a('0x3f')](_0x329f01[_0x560a('0x40')])+'s','body':{'data':[{'Last_Name':_0x9c58bd[0x1],'First_Name':_0x9c58bd[0x0],'Phone':_0x2e7405,'Owner':{'name':!_[_0x560a('0x18')](_0x21b999[_0x560a('0x41')]['name'])?_0x21b999[_0x560a('0x41')][_0x560a('0x14')]:!_[_0x560a('0x18')](_0x21b999[_0x560a('0x42')])?_0x21b999['first_name']+'\x20'+_0x21b999[_0x560a('0x43')]:_0x21b999['last_name'],'id':_0x21b999['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x513e00},'json':!![]})[_0x560a('0x24')](function(_0x335244){if(_0x335244&&_0x335244[_0x560a('0x3a')][0x0][_0x560a('0x44')]===_0x560a('0x45')){var _0xdb29b6=_0x335244['data'][0x0][_0x560a('0x46')];_0xdb29b6[_0x560a('0x3b')]=_['startCase'](_0x329f01['moduleCreate'])+'s';return _0xdb29b6;}logger['error'](_0x560a('0x39'),JSON[_0x560a('0x37')](data));throw new Error(_0x560a('0x47')+JSON['stringify'](data));})['catch'](function(_0x24752d){console['log'](_0x560a('0x48'),_0x24752d);});}function getEndUser(_0x21872a,_0x107340,_0x4a968f,_0x3ff955,_0x1991e4,_0x386e93,_0x4cfd92){var _0x105cfb={'method':_0x560a('0x2b'),'uri':'','headers':{'Authorization':_0x560a('0x2f')+_0x21872a},'json':!![]};switch(_0x4cfd92['moduleSearch']){case'contact_lead':_0x105cfb[_0x560a('0x49')]='https://www.zohoapis.'+_0x107340+_0x560a('0x4a')+_0x1991e4+'))';return getZohoUser(_0x105cfb,'Contacts')[_0x560a('0x24')](function(_0x35d803){if(_0x35d803)return _0x35d803;_0x105cfb[_0x560a('0x49')]=_0x560a('0x3d')+_0x107340+_0x560a('0x4b')+_0x1991e4+'))';return getZohoUser(_0x105cfb,_0x560a('0x4c'))[_0x560a('0x24')](function(_0x23caa2){if(_0x23caa2)return _0x23caa2;if(_0x4cfd92['moduleCreate']!=_0x560a('0x4d')){return createEndUser(_0x21872a,_0x107340,_0x3ff955,_0x1991e4,_0x386e93,_0x4cfd92);}else{return{};}});});break;case'contact':_0x105cfb['uri']=_0x560a('0x3d')+_0x107340+_0x560a('0x4a')+_0x1991e4+'))';return getZohoUser(_0x105cfb,_0x560a('0x4e'))[_0x560a('0x24')](function(_0x4d68e9){if(_0x4d68e9)return _0x4d68e9;if(_0x4cfd92[_0x560a('0x40')]!=_0x560a('0x4d')){return createEndUser(_0x21872a,_0x107340,_0x3ff955,_0x1991e4,_0x386e93,_0x4cfd92);}else{return{};}});break;case'lead':_0x105cfb[_0x560a('0x49')]=_0x560a('0x3d')+_0x107340+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1991e4+'))';return getZohoUser(_0x105cfb,_0x560a('0x4c'))[_0x560a('0x24')](function(_0x1199e7){if(_0x1199e7)return _0x1199e7;if(_0x4cfd92[_0x560a('0x40')]!='nothing'){return createEndUser(_0x21872a,_0x107340,_0x3ff955,_0x1991e4,_0x386e93,_0x4cfd92);}else{return{};}});break;}}function getCall(_0x38dae1,_0x2f85a7,_0x2f7878,_0x34be8b,_0x5b6740,_0x2e9bff,_0x20c529,_0x269c16){logger[_0x560a('0x32')](_0x560a('0x4f'));var _0x1281c5={};_0x1281c5[_0x560a('0x50')]={'name':!_[_0x560a('0x18')](_0x34be8b['role'][_0x560a('0x14')])&&!_[_0x560a('0x18')](_0x34be8b[_0x560a('0x34')][_0x560a('0x14')])&&_0x34be8b['profile'][_0x560a('0x14')]==='administrator'?_0x34be8b[_0x560a('0x41')]['name']:!_[_0x560a('0x18')](_0x34be8b['first_name'])?_0x34be8b[_0x560a('0x42')]+'\x20'+_0x34be8b[_0x560a('0x43')]:_0x34be8b[_0x560a('0x43')],'id':_0x34be8b['id']};_0x1281c5[_0x560a('0x51')]=intUtil[_0x560a('0x52')](_0x2e9bff[_0x560a('0x53')],_0x20c529,'\x20');_0x1281c5['Description']=intUtil['getString'](_0x2e9bff[_0x560a('0x54')],_0x20c529,'\x0a');if(_0x5b6740[_0x560a('0x3b')]===_0x560a('0x4e')){_0x1281c5[_0x560a('0x55')]={'name':!_[_0x560a('0x18')](_0x5b6740[_0x560a('0x56')])?_0x5b6740[_0x560a('0x56')]:!_[_0x560a('0x18')](_0x5b6740[_0x560a('0x57')])?_0x5b6740['First_Name']+'\x20'+_0x5b6740[_0x560a('0x58')]:_0x5b6740[_0x560a('0x58')],'id':_0x5b6740['id']};}if(_0x5b6740['enduserType']===_0x560a('0x4c')){_0x1281c5[_0x560a('0x59')]={'name':!_[_0x560a('0x18')](_0x5b6740['Full_Name'])?_0x5b6740[_0x560a('0x56')]:!_['isNil'](_0x5b6740[_0x560a('0x57')])?_0x5b6740[_0x560a('0x57')]+'\x20'+_0x5b6740[_0x560a('0x58')]:_0x5b6740['Last_Name'],'id':_0x5b6740['id']};_0x1281c5[_0x560a('0x5a')]=_[_0x560a('0x3f')](_0x5b6740[_0x560a('0x3b')]);}if(_0x20c529[_0x560a('0x5b')]){_0x1281c5['Call_Duration']=moment[_0x560a('0x5c')](parseInt(_0x20c529[_0x560a('0x5b')])*0x3e8)[_0x560a('0x2c')]('mm:ss');}else if(_0x20c529[_0x560a('0x5d')]&&_0x20c529['endtime']){_0x1281c5['Call_Duration']=moment['utc'](moment(_0x20c529[_0x560a('0x5e')],_0x560a('0x5f'))[_0x560a('0x60')](moment(_0x20c529[_0x560a('0x61')],_0x560a('0x5f'))))[_0x560a('0x2c')](_0x560a('0x62'));}switch(_0x20c529['lastevent']){case _0x560a('0x63'):_0x1281c5[_0x560a('0x64')]=_0x560a('0x65');break;case _0x560a('0x66'):case'connect':_0x1281c5[_0x560a('0x64')]=_0x560a('0x67');break;case _0x560a('0x68'):_0x1281c5[_0x560a('0x64')]=_0x560a('0x69');break;case _0x560a('0x6a'):_0x1281c5[_0x560a('0x64')]='Abandoned';break;case _0x560a('0x6b'):_0x1281c5['Call_Result']=_0x560a('0x6c');default:}_0x1281c5['Call_Start_Time']=(_0x269c16===_0x560a('0x6d')?moment(_0x20c529[_0x560a('0x61')])[_0x560a('0x2c')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x20c529[_0x560a('0x6e')])[_0x560a('0x2c')](_0x560a('0x5f')))||moment()[_0x560a('0x2c')]('YYYY-MM-DDTHH:mm:ss');_0x1281c5[_0x560a('0x6f')]=_0x269c16||_0x560a('0x70');_0x1281c5=_[_0x560a('0x71')](_0x1281c5,getCustomFields(_0x2e9bff[_0x560a('0x72')],_0x20c529));return request({'method':_0x560a('0x3c'),'uri':'https://www.zohoapis.'+_0x2f85a7+_0x560a('0x73'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x38dae1},'body':{'data':[_0x1281c5]},'json':!![]})[_0x560a('0x24')](function(_0x9cf833){if(_0x9cf833&&_0x9cf833[_0x560a('0x3a')][0x0]['code']===_0x560a('0x45')){logger[_0x560a('0x32')](_0x560a('0x74'));return{'id':_0x9cf833[_0x560a('0x3a')][0x0]['details']['id']};}})['catch'](function(_0x52facf){logger['info'](_0x560a('0x75'),_0x52facf[_0x560a('0x29')]);console[_0x560a('0x76')]('err',_0x52facf);});}exports[_0x560a('0x77')]=function(_0x457266,_0x34f8c5,_0x1ac52d,_0x2b4027,_0x22a2db,_0x14809e){var _0x2dc167,_0x1aa4b7,_0x28e722;_0x14809e['host']=intUtil[_0x560a('0x78')](_0x14809e[_0x560a('0x79')]);_0x14809e[_0x560a('0x7a')]=intUtil[_0x560a('0x78')](_0x14809e[_0x560a('0x7a')]);if(_0x22a2db&&_0x22a2db[_0x560a('0x7b')]){logger['info']('[QUEUE]',_0x560a('0x7c'));_0x34f8c5[_0x560a('0x7d')]=_0x14809e['serverUrl']+_0x560a('0x7e')+_0x34f8c5[_0x560a('0x7f')]+_0x560a('0x80')+md5(_0x34f8c5[_0x560a('0x7f')]);}else{_0x34f8c5['recordingURL']='';}var _0x361fac=_0x14809e[_0x560a('0x79')]===_0x560a('0x81')?'eu':_0x560a('0x82');return getAccessToken(_0x14809e)[_0x560a('0x24')](function(_0x59dfef){_0x28e722=_0x59dfef;return getUser(_0x28e722,_0x361fac,_0x14809e,_0x2b4027[_0x560a('0x83')]);})[_0x560a('0x24')](function(_0x4103d3){_0x2dc167=_0x4103d3;logger[_0x560a('0x32')](_0x560a('0x84'),_0x2dc167['id']);return getEndUser(_0x28e722,_0x361fac,_0x14809e,_0x34f8c5['calleridname'],_0x34f8c5[_0x560a('0x85')],_0x2dc167,_0x1ac52d);})[_0x560a('0x24')](function(_0x1e9d4b){_0x1aa4b7=_0x1e9d4b;return getCall(_0x28e722,_0x361fac,_0x14809e,_0x2dc167,_0x1aa4b7,_0x1ac52d,_0x34f8c5,_0x560a('0x70'));})[_0x560a('0x24')](function(_0x13e65e){if(_0x13e65e){logger['info']('The\x20Call\x20ID\x20is:',_0x13e65e['id']);logger[_0x560a('0x32')](_0x560a('0x86'),_0x560a('0x87'));emit(util[_0x560a('0x2c')](_0x560a('0x88'),_0x2b4027[_0x560a('0x14')]),_0x560a('0x89'),{'uri':_0x560a('0x8a')+_0x14809e[_0x560a('0x79')]+'/crm/EntityInfo.do?module=Calls&id='+_0x13e65e['id']});}})['catch'](function(_0x402606){logger[_0x560a('0x27')](_0x560a('0x86'),JSON['stringify'](_0x402606));});};exports[_0x560a('0x6d')]=function(_0x506ba7,_0x2444fa,_0x1b4693,_0x3ba45a,_0x3c7c45,_0x36af8b,_0x198a85){var _0x16d150,_0x29f194,_0x42ef64;_0x36af8b[_0x560a('0x79')]=intUtil['stripTrailingSlash'](_0x36af8b['host']);_0x36af8b['serverUrl']=intUtil[_0x560a('0x78')](_0x36af8b['serverUrl']);if(_0x198a85&&_0x198a85['recordingFormat']&&_0x198a85[_0x560a('0x8b')]!==_0x560a('0x8c')){logger[_0x560a('0x32')](_0x560a('0x8d'),'Recording\x20is\x20enabled!');_0x2444fa[_0x560a('0x7d')]=_0x36af8b[_0x560a('0x7a')]+_0x560a('0x7e')+_0x2444fa[_0x560a('0x7f')]+_0x560a('0x80')+md5(_0x2444fa['uniqueid']);}var _0x48d38e=_0x36af8b[_0x560a('0x79')]===_0x560a('0x81')?'eu':'com';return getAccessToken(_0x36af8b)[_0x560a('0x24')](function(_0x5f433e){_0x42ef64=_0x5f433e;return getUser(_0x42ef64,_0x48d38e,_0x36af8b,_0x3ba45a[_0x560a('0x83')]);})[_0x560a('0x24')](function(_0x178adf){_0x16d150=_0x178adf;logger[_0x560a('0x32')](_0x560a('0x84'),_0x16d150['id']);return getEndUser(_0x42ef64,_0x48d38e,_0x36af8b,_0x2444fa[_0x560a('0x8e')],_0x2444fa[_0x560a('0x8f')],_0x16d150,_0x1b4693);})[_0x560a('0x24')](function(_0x4b8c6d){_0x29f194=_0x4b8c6d;return getCall(_0x42ef64,_0x48d38e,_0x36af8b,_0x16d150,_0x29f194,_0x1b4693,_0x2444fa,_0x560a('0x90'));})[_0x560a('0x24')](function(_0xb9f04){if(_0xb9f04){logger['info']('The\x20Call\x20ID\x20is:',_0xb9f04['id']);logger[_0x560a('0x32')](_0x560a('0x8d'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x3ba45a[_0x560a('0x14')]),_0x560a('0x89'),{'uri':_0x560a('0x8a')+_0x36af8b[_0x560a('0x79')]+_0x560a('0x91')+_0xb9f04['id']});}})[_0x560a('0x92')](function(_0x31c4e9){logger[_0x560a('0x27')]('[OUTBOUND]',JSON[_0x560a('0x37')](_0x31c4e9));});};exports[_0x560a('0x93')]=function(_0x44dc90,_0x33c9cf,_0x27718a,_0x339b1f,_0x52adf2,_0x233421){var _0x30b9dc,_0x5406e3,_0x838382;_0x233421['host']=intUtil[_0x560a('0x78')](_0x233421[_0x560a('0x79')]);_0x233421[_0x560a('0x7a')]=intUtil['stripTrailingSlash'](_0x233421[_0x560a('0x7a')]);if(_0x52adf2&&_0x52adf2[_0x560a('0x7b')]){logger[_0x560a('0x32')]('['+_0x33c9cf[_0x560a('0x94')][_0x560a('0x95')]()+']',_0x560a('0x7c'));_0x33c9cf[_0x560a('0x7d')]=_0x233421[_0x560a('0x7a')]+_0x560a('0x7e')+_0x33c9cf[_0x560a('0x7f')]+_0x560a('0x80')+md5(_0x33c9cf[_0x560a('0x7f')]);}else{_0x33c9cf['recordingURL']='';}var _0x6dabbc=_0x233421[_0x560a('0x79')]==='zoho.eu'?'eu':_0x560a('0x82');return getAccessToken(_0x233421)[_0x560a('0x24')](function(_0x217c2a){_0x838382=_0x217c2a;return getUser(_0x838382,_0x6dabbc,_0x233421);})[_0x560a('0x24')](function(_0x124846){_0x30b9dc=_0x124846;logger['info'](_0x560a('0x84'),_0x30b9dc['id']);return getEndUser(_0x838382,_0x6dabbc,_0x233421,_0x33c9cf['calleridname'],_0x33c9cf['calleridnum'],_0x30b9dc,_0x27718a);})[_0x560a('0x24')](function(_0x10047b){_0x5406e3=_0x10047b;return getCall(_0x838382,_0x6dabbc,_0x233421,_0x30b9dc,_0x5406e3,_0x27718a,_0x33c9cf,_0x560a('0x70'));})[_0x560a('0x24')](function(_0x2ca8f6){if(_0x2ca8f6){logger[_0x560a('0x32')](_0x560a('0x96'),_0x2ca8f6['id']);}})['catch'](function(_0x9f1871){logger[_0x560a('0x27')]('['+_0x33c9cf['lastevent'][_0x560a('0x95')]()+']',JSON[_0x560a('0x37')](_0x9f1871));});};
\ No newline at end of file
index 0548509..43e934e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x5e3ebc,_0x1d193b){var _0x360cd8=function(_0x569f69){while(--_0x569f69){_0x5e3ebc['push'](_0x5e3ebc['shift']());}};_0x360cd8(++_0x1d193b);}(_0x7a54,0x106));var _0x47a5=function(_0x243b8f,_0x51ad29){_0x243b8f=_0x243b8f-0x0;var _0x285c51=_0x7a54[_0x243b8f];return _0x285c51;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});};
\ No newline at end of file
+var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x4fc63c,_0x40bf8b){var _0x2cbc65=function(_0x3dcf7a){while(--_0x3dcf7a){_0x4fc63c['push'](_0x4fc63c['shift']());}};_0x2cbc65(++_0x40bf8b);}(_0x7a54,0x106));var _0x47a5=function(_0xf7ff07,_0x31f003){_0xf7ff07=_0xf7ff07-0x0;var _0x567ac3=_0x7a54[_0xf7ff07];return _0x567ac3;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});};
\ No newline at end of file
index cc41859..cc7c734 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['number','headers','data6','parse','error','stack','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','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data5'];(function(_0x43c57b,_0x333d9c){var _0x58bcba=function(_0x3f3654){while(--_0x3f3654){_0x43c57b['push'](_0x43c57b['shift']());}};_0x58bcba(++_0x333d9c);}(_0xb10b,0x12a));var _0xbb10=function(_0x9be508,_0x10c8ba){_0x9be508=_0x9be508-0x0;var _0x16f3c3=_0xb10b[_0x9be508];return _0x16f3c3;};'use strict';var rp=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var Mustache=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('trigger');exports[_0xbb10('0x4')]=function(_0x9bbed,_0x460981){var _0x22320e,_0x49baf4;var _0x312b72={'method':_0x9bbed['data1'][_0xbb10('0x5')](),'uri':Mustache[_0xbb10('0x6')](_0x9bbed['data2'],_0x460981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9bbed[_0xbb10('0x7')])===_0xbb10('0x8')&&parseInt(_0x9bbed[_0xbb10('0x7')])>=0x1&&parseInt(_0x9bbed[_0xbb10('0x7')])<=0xa?parseInt(_0x9bbed[_0xbb10('0x7')])*0x3e8:0x5*0x3e8};try{_0x312b72[_0xbb10('0x9')]=_0x9bbed[_0xbb10('0xa')]?JSON[_0xbb10('0xb')](Mustache['render'](_0x9bbed['data6'],_0x460981)):{};}catch(_0x20bd61){logger[_0xbb10('0xc')](_0x20bd61[_0xbb10('0xd')]);}switch(_0x9bbed['data1'][_0xbb10('0x5')]()){case'GET':case _0xbb10('0xe'):_0x22320e=null;_0x312b72['qs']=_0x460981;break;case _0xbb10('0xf'):case _0xbb10('0x10'):if(_0x9bbed[_0xbb10('0x11')]){try{_0x22320e=JSON[_0xbb10('0xb')](Mustache[_0xbb10('0x6')](_0x9bbed['data7'],_0x460981));_0x312b72[_0xbb10('0x12')]=_0x22320e;}catch(_0x42d7e4){logger[_0xbb10('0xc')](_0x42d7e4[_0xbb10('0xd')]);logger[_0xbb10('0xc')](_0xbb10('0x13'));}}else{_0x22320e=_0x460981;_0x312b72[_0xbb10('0x12')]=_0x22320e;}break;}logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x16'),_0x9bbed['data1'],_0x9bbed[_0xbb10('0x17')],JSON[_0xbb10('0x18')](_0x312b72)));rp(_0x312b72)[_0xbb10('0x19')](function(_0x42db98){_0x22320e=!_[_0xbb10('0x1a')](_0x22320e)?_0xbb10('0x1b')+_0x22320e:'';_0x49baf4=typeof _0x42db98[_0xbb10('0x12')]===_0xbb10('0x1c')?JSON[_0xbb10('0x18')](_0x42db98[_0xbb10('0x12')]):_0x42db98['body'];logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x1d'),_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x42db98[_0xbb10('0x1f')],_0x49baf4));})['catch'](function(_0x12f888){logger[_0xbb10('0xc')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x12f888[_0xbb10('0x1f')],_0x12f888[_0xbb10('0x20')],_0x12f888[_0xbb10('0x21')]));});};
\ No newline at end of file
+var _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x18dd56,_0x5117d1){var _0x20a366=function(_0x33e7d9){while(--_0x33e7d9){_0x18dd56['push'](_0x18dd56['shift']());}};_0x20a366(++_0x5117d1);}(_0x7a54,0x106));var _0x47a5=function(_0x4f9d2b,_0x28120e){_0x4f9d2b=_0x4f9d2b-0x0;var _0x2ce399=_0x7a54[_0x4f9d2b];return _0x2ce399;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x1&&parseInt(_0x5f7f12['data5'])<=0xa?parseInt(_0x5f7f12['data5'])*0x3e8:0x5*0x3e8};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});};
\ No newline at end of file
index 7f6dd5f..cd2fc53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x891b=['routing','http','Request','request','error','rpc','message','result','catch','exports','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x891b,0xc5));var _0xb891=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x891b[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xb891('0x0'))(_0xb891('0x1'));var client=jayson['client'][_0xb891('0x2')]({'port':0x2329});client[_0xb891('0x3')]=function(_0x1c519f,_0x467558){return new BPromise(function(_0x587bf1,_0x379509){return client[_0xb891('0x4')](_0x1c519f,_0x467558)['then'](function(_0x3635be){logger['debug']('rpc','routing',_0x1c519f,_0x467558,_0x3635be);if(_0x3635be[_0xb891('0x5')]){logger[_0xb891('0x5')](_0xb891('0x6'),_0xb891('0x1'),_0x1c519f,_0x3635be[_0xb891('0x5')][_0xb891('0x7')],_0x467558);return _0x379509(_0x3635be[_0xb891('0x5')]['message']);}else{return _0x587bf1(_0x3635be[_0xb891('0x8')]);}})[_0xb891('0x9')](function(_0x2dd7d4){logger[_0xb891('0x5')](_0xb891('0x6'),_0xb891('0x1'),_0x1c519f,_0x2dd7d4,_0x467558);return _0x379509(_0x2dd7d4);});});};module[_0xb891('0xa')]=client;
\ No newline at end of file
+var _0x79d3=['catch','routing','exports','jayson/promise','../../config/logger','client','http','request','then','rpc','error','result'];(function(_0x278795,_0x384807){var _0x4b4fc5=function(_0x1747c1){while(--_0x1747c1){_0x278795['push'](_0x278795['shift']());}};_0x4b4fc5(++_0x384807);}(_0x79d3,0x15f));var _0x379d=function(_0x5bd948,_0x478409){_0x5bd948=_0x5bd948-0x0;var _0x52771a=_0x79d3[_0x5bd948];return _0x52771a;};'use strict';var jayson=require(_0x379d('0x0'));var BPromise=require('bluebird');var logger=require(_0x379d('0x1'))('routing');var client=jayson[_0x379d('0x2')][_0x379d('0x3')]({'port':0x2329});client['Request']=function(_0xde90b8,_0x2be235){return new BPromise(function(_0x30d8ba,_0x3888e0){return client[_0x379d('0x4')](_0xde90b8,_0x2be235)[_0x379d('0x5')](function(_0x2a1b43){logger['debug'](_0x379d('0x6'),'routing',_0xde90b8,_0x2be235,_0x2a1b43);if(_0x2a1b43[_0x379d('0x7')]){logger[_0x379d('0x7')](_0x379d('0x6'),'routing',_0xde90b8,_0x2a1b43[_0x379d('0x7')]['message'],_0x2be235);return _0x3888e0(_0x2a1b43['error']['message']);}else{return _0x30d8ba(_0x2a1b43[_0x379d('0x8')]);}})[_0x379d('0x9')](function(_0x7fb511){logger['error'](_0x379d('0x6'),_0x379d('0xa'),_0xde90b8,_0x7fb511,_0x2be235);return _0x3888e0(_0x7fb511);});});};module[_0x379d('0xb')]=client;
\ No newline at end of file
index 035e763..55fc9a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2086=['loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','Setting','findOne'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x2086,0x124));var _0x6208=function(_0x345ea9,_0x4b4198){_0x345ea9=_0x345ea9-0x0;var _0x1cf2d8=_0x2086[_0x345ea9];return _0x1cf2d8;};'use strict';var BPromise=require(_0x6208('0x0'));var server=require(_0x6208('0x1'));var Realtime=require(_0x6208('0x2'));var EmailChannel=require(_0x6208('0x3'));var mailAccount=require(_0x6208('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x6208('0x5'))['db'];function initRealtime(){return BPromise['resolve']()[_0x6208('0x6')](mailAccount[_0x6208('0x7')]())['then'](realtime[_0x6208('0x8')]())[_0x6208('0x6')](function(){email[_0x6208('0x9')](realtime[_0x6208('0xa')]);return realtime;});}function main(){return server[_0x6208('0xb')](realtime,email)['then'](function(_0x8f32fc){return initRealtime();})['then'](function(_0x58a6c1){return db[_0x6208('0xc')][_0x6208('0xd')]({'attributes':['id',_0x6208('0xe')],'raw':!![]});})[_0x6208('0x6')](function(_0x89fad2){return setInterval(initRealtime,_0x89fad2[_0x6208('0xe')]*0x3e8);})[_0x6208('0xf')](function(_0x4f1bfa){console[_0x6208('0x10')](_0x4f1bfa);});}main();
\ No newline at end of file
+var _0xa647=['then','getMailAccounts','initMailAccounts','mailAccounts','listen','Setting','findOne','loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve'];(function(_0x3c379e,_0x406745){var _0x401fc4=function(_0x46b511){while(--_0x46b511){_0x3c379e['push'](_0x3c379e['shift']());}};_0x401fc4(++_0x406745);}(_0xa647,0x81));var _0x7a64=function(_0x56ab54,_0x1b02c6){_0x56ab54=_0x56ab54-0x0;var _0x2a0b51=_0xa647[_0x56ab54];return _0x2a0b51;};'use strict';var BPromise=require(_0x7a64('0x0'));var server=require(_0x7a64('0x1'));var Realtime=require(_0x7a64('0x2'));var EmailChannel=require(_0x7a64('0x3'));var mailAccount=require(_0x7a64('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x7a64('0x5'))['db'];function initRealtime(){return BPromise[_0x7a64('0x6')]()[_0x7a64('0x7')](mailAccount[_0x7a64('0x8')]())[_0x7a64('0x7')](realtime[_0x7a64('0x9')]())[_0x7a64('0x7')](function(){email['refresh'](realtime[_0x7a64('0xa')]);return realtime;});}function main(){return server[_0x7a64('0xb')](realtime,email)['then'](function(_0x438197){return initRealtime();})[_0x7a64('0x7')](function(_0x13ea76){return db[_0x7a64('0xc')][_0x7a64('0xd')]({'attributes':['id',_0x7a64('0xe')],'raw':!![]});})[_0x7a64('0x7')](function(_0x8eb19b){return setInterval(initRealtime,_0x8eb19b[_0x7a64('0xe')]*0x3e8);})[_0x7a64('0xf')](function(_0x406494){console[_0x7a64('0x10')](_0x406494);});}main();
\ No newline at end of file
index f331040..6b1af78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58ba=['../../../config/logger','email','redis','localhost','socket.io-emitter','mailAccounts','imapAccounts','prototype','emit','name','active','status','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','smtp','send','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment'];(function(_0x355cb7,_0x2d1450){var _0x173aaf=function(_0x3232c6){while(--_0x3232c6){_0x355cb7['push'](_0x355cb7['shift']());}};_0x173aaf(++_0x2d1450);}(_0x58ba,0x192));var _0xa58b=function(_0x307049,_0x1e9968){_0x307049=_0x307049-0x0;var _0x2d3015=_0x58ba[_0x307049];return _0x2d3015;};'use strict';var _=require(_0xa58b('0x0'));var moment=require(_0xa58b('0x1'));var BPromise=require(_0xa58b('0x2'));var md5=require(_0xa58b('0x3'));var Redis=require(_0xa58b('0x4'));var config=require(_0xa58b('0x5'));var logger=require(_0xa58b('0x6'))(_0xa58b('0x7'));config['redis']=_['defaults'](config[_0xa58b('0x8')],{'host':_0xa58b('0x9'),'port':0x18eb});var io=require(_0xa58b('0xa'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x52b94b){logger['info']('start\x20email\x20channel');this[_0xa58b('0xb')]=_0x52b94b[_0xa58b('0xb')];this[_0xa58b('0xc')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xa58b('0xd')][_0xa58b('0xe')]=function(_0x552025){var _0x346873=this[_0xa58b('0xb')][_0x552025];var _0x599a54={'id':_0x346873['id'],'name':_0x346873[_0xa58b('0xf')],'key':_0x346873['key'],'active':_0x346873[_0xa58b('0x10')],'Imap':{'status':_0x346873['Imap'][_0xa58b('0x11')],'messageStatus':_0x346873[_0xa58b('0x12')][_0xa58b('0x13')],'total':_0x346873[_0xa58b('0x12')][_0xa58b('0x14')]}};if(_[_0xa58b('0x15')](md5Accounts[_0x552025])){md5Accounts[_0x552025]={};}var _0x5ea931=md5(JSON[_0xa58b('0x16')](_0x599a54));if(md5Accounts[_0x552025]['md5']!==_0x5ea931){md5Accounts[_0x552025][_0xa58b('0x3')]=_0x5ea931;io[_0xa58b('0xe')](_0xa58b('0x17'),_0x599a54);}};EmailChannel[_0xa58b('0xd')][_0xa58b('0x18')]=function(_0x3e974b){for(var _0x38db7d in _0x3e974b){if(_0x3e974b['hasOwnProperty'](_0x38db7d)){if(_0x3e974b[_0x38db7d][_0xa58b('0x12')]&&_0x3e974b[_0x38db7d][_0xa58b('0x10')]){var _0x41cbb5=_0x3e974b[_0x38db7d]['Imap'];if(!this['imapAccounts'][_0xa58b('0x19')](_0x41cbb5['id'])){this[_0xa58b('0xc')][_0x41cbb5['id']]=new EmailImap(_0x41cbb5,_0x3e974b[_0x38db7d][_0xa58b('0x7')]);this['imapAccounts'][_0x41cbb5['id']]['on'](_0xa58b('0x1a'),this[_0xa58b('0x1b')][_0xa58b('0x1c')](this,_0x38db7d));this[_0xa58b('0xc')][_0x41cbb5['id']]['on'](_0xa58b('0x7'),this[_0xa58b('0x1d')][_0xa58b('0x1c')](this,_0x38db7d));this[_0xa58b('0xc')][_0x41cbb5['id']]['on'](_0xa58b('0x1e'),this[_0xa58b('0x1f')]['bind'](this,_0x38db7d));this['imapAccounts'][_0x41cbb5['id']]['on'](_0xa58b('0x20'),this[_0xa58b('0x21')][_0xa58b('0x1c')](this,_0x38db7d));}}else{if(_['isNil'](this[_0xa58b('0xb')][_0x38db7d]['Imap'])){this['mailAccounts'][_0x38db7d][_0xa58b('0x12')]={};}this[_0xa58b('0xb')][_0x38db7d][_0xa58b('0x12')]['status']=_0xa58b('0x22');this['mailAccounts'][_0x38db7d][_0xa58b('0x12')][_0xa58b('0x13')]='';this[_0xa58b('0xe')](_0x38db7d);}}}};EmailChannel['prototype'][_0xa58b('0x1b')]=function(_0x512cb2,_0x1ef8f6){if(this[_0xa58b('0xb')][_0x512cb2]){this['mailAccounts'][_0x512cb2][_0xa58b('0x12')][_0xa58b('0x11')]='connected';this[_0xa58b('0xb')][_0x512cb2][_0xa58b('0x12')]['messageStatus']=_0x1ef8f6['name'];if(_0x1ef8f6[_0xa58b('0x23')]){this[_0xa58b('0xb')][_0x512cb2]['Imap'][_0xa58b('0x14')]=_0x1ef8f6[_0xa58b('0x23')][_0xa58b('0x14')];}return this['emit'](_0x512cb2);}};EmailChannel[_0xa58b('0xd')][_0xa58b('0x1d')]=function(_0x1fe24e,_0xff69c9){logger[_0xa58b('0x24')](_0xa58b('0x25'),_0xff69c9['firstName'],_0xff69c9[_0xa58b('0x26')],_0xff69c9[_0xa58b('0x27')],_0x1fe24e);if(this[_0xa58b('0xb')][_0x1fe24e]){return mailAccount['notify'](_0x1fe24e,_0xff69c9)[_0xa58b('0x28')](function(_0x4ae3b9){if(_0x4ae3b9){logger[_0xa58b('0x24')](_0xa58b('0x29'));}})[_0xa58b('0x2a')](function(_0x95a41b){logger[_0xa58b('0x20')](_0xa58b('0x2b'),JSON[_0xa58b('0x16')](_0x95a41b));});}};EmailChannel[_0xa58b('0xd')]['handleImapEnd']=function(_0x50aaae){if(this['mailAccounts'][_0x50aaae]&&this[_0xa58b('0xb')][_0x50aaae][_0xa58b('0x12')]){if(this[_0xa58b('0xc')][this[_0xa58b('0xb')][_0x50aaae][_0xa58b('0x12')]['id']]){delete this[_0xa58b('0xc')][this[_0xa58b('0xb')][_0x50aaae]['Imap']['id']];}this['mailAccounts'][_0x50aaae][_0xa58b('0x12')][_0xa58b('0x2c')]=moment();this['emit'](_0x50aaae);}};EmailChannel[_0xa58b('0xd')][_0xa58b('0x21')]=function(_0x5cbb1e,_0x2e1af6){if(this[_0xa58b('0xb')][_0x5cbb1e]){this[_0xa58b('0xb')][_0x5cbb1e][_0xa58b('0x12')]['status']=_0xa58b('0x20');this[_0xa58b('0xb')][_0x5cbb1e][_0xa58b('0x12')]['messageStatus']=_0x2e1af6;return this[_0xa58b('0xe')](_0x5cbb1e);}};EmailChannel['prototype']['sendMail']=function(_0x4824a3,_0x581ea9){return this[_0xa58b('0x2d')][_0xa58b('0x2e')](_0x4824a3,_0x581ea9);};EmailChannel['prototype']['verifySmtp']=function(_0x225b9f){var _0x527ab9=this;if(this[_0xa58b('0xb')][_0x225b9f['id']]){if(_[_0xa58b('0x15')](this[_0xa58b('0xb')][_0x225b9f['id']][_0xa58b('0x2f')])){this['mailAccounts'][_0x225b9f['id']][_0xa58b('0x2f')]={};}this[_0xa58b('0xb')][_0x225b9f['id']][_0xa58b('0x2f')][_0xa58b('0x2c')]=moment();return new BPromise(function(_0x23d80f,_0x58d310){return _0x527ab9[_0xa58b('0x2d')][_0xa58b('0x30')](_0x225b9f)[_0xa58b('0x28')](function(_0x3d57b0){_0x527ab9[_0xa58b('0xb')][_0x225b9f['id']]['Smtp'][_0xa58b('0x11')]=_0xa58b('0x31');_0x527ab9[_0xa58b('0xb')][_0x225b9f['id']][_0xa58b('0x2f')]['messageStatus']='';_0x527ab9['emit'](_0x225b9f['id']);_0x23d80f(_0x3d57b0);})[_0xa58b('0x2a')](function(_0x1528d2){_0x527ab9['mailAccounts'][_0x225b9f['id']]['Smtp'][_0xa58b('0x11')]=_0xa58b('0x20');_0x527ab9[_0xa58b('0xb')][_0x225b9f['id']][_0xa58b('0x2f')]['messageStatus']=_0x1528d2;_0x527ab9[_0xa58b('0xe')](_0x225b9f['id']);_0x58d310(_0x1528d2);});});}return this[_0xa58b('0x2d')][_0xa58b('0x30')](_0x225b9f);};module[_0xa58b('0x32')]=EmailChannel;
\ No newline at end of file
+var _0xa59d=['mailAccount:update','refresh','hasOwnProperty','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','messageStatus','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','then','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','active','Imap','status','total','isNil','stringify','emit'];(function(_0x26fb5e,_0x5a8cca){var _0x255321=function(_0x128173){while(--_0x128173){_0x26fb5e['push'](_0x26fb5e['shift']());}};_0x255321(++_0x5a8cca);}(_0xa59d,0x181));var _0xda59=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa59d[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xda59('0x0'));var moment=require(_0xda59('0x1'));var BPromise=require(_0xda59('0x2'));var md5=require(_0xda59('0x3'));var Redis=require(_0xda59('0x4'));var config=require(_0xda59('0x5'));var logger=require(_0xda59('0x6'))(_0xda59('0x7'));config[_0xda59('0x8')]=_[_0xda59('0x9')](config[_0xda59('0x8')],{'host':_0xda59('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0xda59('0xb'));var EmailSmtp=require(_0xda59('0xc'));var mailAccount=require(_0xda59('0xd'));var md5Accounts={};function EmailChannel(_0x78f5f1){logger[_0xda59('0xe')](_0xda59('0xf'));this[_0xda59('0x10')]=_0x78f5f1['mailAccounts'];this[_0xda59('0x11')]={};this[_0xda59('0x12')]=new EmailSmtp();}EmailChannel[_0xda59('0x13')]['emit']=function(_0x3ceea9){var _0x2397e2=this[_0xda59('0x10')][_0x3ceea9];var _0x932d58={'id':_0x2397e2['id'],'name':_0x2397e2[_0xda59('0x14')],'key':_0x2397e2['key'],'active':_0x2397e2[_0xda59('0x15')],'Imap':{'status':_0x2397e2[_0xda59('0x16')][_0xda59('0x17')],'messageStatus':_0x2397e2['Imap']['messageStatus'],'total':_0x2397e2[_0xda59('0x16')][_0xda59('0x18')]}};if(_[_0xda59('0x19')](md5Accounts[_0x3ceea9])){md5Accounts[_0x3ceea9]={};}var _0x2b0a99=md5(JSON[_0xda59('0x1a')](_0x932d58));if(md5Accounts[_0x3ceea9]['md5']!==_0x2b0a99){md5Accounts[_0x3ceea9][_0xda59('0x3')]=_0x2b0a99;io[_0xda59('0x1b')](_0xda59('0x1c'),_0x932d58);}};EmailChannel['prototype'][_0xda59('0x1d')]=function(_0x46e6d6){for(var _0x4e4eeb in _0x46e6d6){if(_0x46e6d6[_0xda59('0x1e')](_0x4e4eeb)){if(_0x46e6d6[_0x4e4eeb]['Imap']&&_0x46e6d6[_0x4e4eeb][_0xda59('0x15')]){var _0x5602d5=_0x46e6d6[_0x4e4eeb][_0xda59('0x16')];if(!this['imapAccounts'][_0xda59('0x1e')](_0x5602d5['id'])){this[_0xda59('0x11')][_0x5602d5['id']]=new EmailImap(_0x5602d5,_0x46e6d6[_0x4e4eeb][_0xda59('0x7')]);this[_0xda59('0x11')][_0x5602d5['id']]['on'](_0xda59('0x1f'),this['handleImapBox'][_0xda59('0x20')](this,_0x4e4eeb));this[_0xda59('0x11')][_0x5602d5['id']]['on']('email',this[_0xda59('0x21')]['bind'](this,_0x4e4eeb));this[_0xda59('0x11')][_0x5602d5['id']]['on'](_0xda59('0x22'),this[_0xda59('0x23')]['bind'](this,_0x4e4eeb));this[_0xda59('0x11')][_0x5602d5['id']]['on'](_0xda59('0x24'),this[_0xda59('0x25')][_0xda59('0x20')](this,_0x4e4eeb));}}else{if(_['isNil'](this[_0xda59('0x10')][_0x4e4eeb][_0xda59('0x16')])){this[_0xda59('0x10')][_0x4e4eeb][_0xda59('0x16')]={};}this[_0xda59('0x10')][_0x4e4eeb][_0xda59('0x16')][_0xda59('0x17')]=_0xda59('0x26');this[_0xda59('0x10')][_0x4e4eeb][_0xda59('0x16')][_0xda59('0x27')]='';this[_0xda59('0x1b')](_0x4e4eeb);}}}};EmailChannel['prototype'][_0xda59('0x28')]=function(_0x1a6dfb,_0x5b7204){if(this[_0xda59('0x10')][_0x1a6dfb]){this[_0xda59('0x10')][_0x1a6dfb]['Imap'][_0xda59('0x17')]=_0xda59('0x29');this['mailAccounts'][_0x1a6dfb][_0xda59('0x16')][_0xda59('0x27')]=_0x5b7204[_0xda59('0x14')];if(_0x5b7204[_0xda59('0x2a')]){this[_0xda59('0x10')][_0x1a6dfb]['Imap'][_0xda59('0x18')]=_0x5b7204[_0xda59('0x2a')][_0xda59('0x18')];}return this[_0xda59('0x1b')](_0x1a6dfb);}};EmailChannel[_0xda59('0x13')][_0xda59('0x21')]=function(_0x52dc43,_0x20075a){logger[_0xda59('0xe')](_0xda59('0x2b'),_0x20075a[_0xda59('0x2c')],_0x20075a[_0xda59('0x2d')],_0x20075a[_0xda59('0x2e')],_0x52dc43);if(this[_0xda59('0x10')][_0x52dc43]){return mailAccount[_0xda59('0x2f')](_0x52dc43,_0x20075a)['then'](function(_0x54a40d){if(_0x54a40d){logger[_0xda59('0xe')]('Mail\x20accepted\x20from\x20routing');}})[_0xda59('0x30')](function(_0x16e67f){logger[_0xda59('0x24')](_0xda59('0x31'),JSON[_0xda59('0x1a')](_0x16e67f));});}};EmailChannel[_0xda59('0x13')][_0xda59('0x23')]=function(_0x236b2c){if(this[_0xda59('0x10')][_0x236b2c]&&this['mailAccounts'][_0x236b2c][_0xda59('0x16')]){if(this[_0xda59('0x11')][this[_0xda59('0x10')][_0x236b2c][_0xda59('0x16')]['id']]){delete this[_0xda59('0x11')][this[_0xda59('0x10')][_0x236b2c][_0xda59('0x16')]['id']];}this[_0xda59('0x10')][_0x236b2c][_0xda59('0x16')][_0xda59('0x32')]=moment();this[_0xda59('0x1b')](_0x236b2c);}};EmailChannel['prototype'][_0xda59('0x25')]=function(_0x4c72ef,_0x16244d){if(this[_0xda59('0x10')][_0x4c72ef]){this[_0xda59('0x10')][_0x4c72ef][_0xda59('0x16')][_0xda59('0x17')]=_0xda59('0x24');this[_0xda59('0x10')][_0x4c72ef][_0xda59('0x16')][_0xda59('0x27')]=_0x16244d;return this[_0xda59('0x1b')](_0x4c72ef);}};EmailChannel[_0xda59('0x13')][_0xda59('0x33')]=function(_0x197df6,_0x586f3b){return this[_0xda59('0x12')][_0xda59('0x34')](_0x197df6,_0x586f3b);};EmailChannel['prototype'][_0xda59('0x35')]=function(_0x146908){var _0x151f3a=this;if(this['mailAccounts'][_0x146908['id']]){if(_[_0xda59('0x19')](this[_0xda59('0x10')][_0x146908['id']][_0xda59('0x36')])){this[_0xda59('0x10')][_0x146908['id']]['Smtp']={};}this[_0xda59('0x10')][_0x146908['id']][_0xda59('0x36')][_0xda59('0x32')]=moment();return new BPromise(function(_0x22392b,_0x5d048f){return _0x151f3a[_0xda59('0x12')][_0xda59('0x37')](_0x146908)[_0xda59('0x38')](function(_0x3b826e){_0x151f3a[_0xda59('0x10')][_0x146908['id']]['Smtp'][_0xda59('0x17')]=_0xda59('0x39');_0x151f3a[_0xda59('0x10')][_0x146908['id']][_0xda59('0x36')][_0xda59('0x27')]='';_0x151f3a['emit'](_0x146908['id']);_0x22392b(_0x3b826e);})[_0xda59('0x30')](function(_0x196ca9){_0x151f3a[_0xda59('0x10')][_0x146908['id']][_0xda59('0x36')][_0xda59('0x17')]=_0xda59('0x24');_0x151f3a[_0xda59('0x10')][_0x146908['id']]['Smtp'][_0xda59('0x27')]=_0x196ca9;_0x151f3a[_0xda59('0x1b')](_0x146908['id']);_0x5d048f(_0x196ca9);});});}return this[_0xda59('0x12')][_0xda59('0x37')](_0x146908);};module[_0xda59('0x3a')]=EmailChannel;
\ No newline at end of file
index 52a6b1a..cb3fdbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31c7=['email','mailbox','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','autotls','required','anonymous@xcally.com','prototype','handleOpenBox','handleError','emit','handleCloseBox','readUnseen','search','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleFetchEnd','closeBox','stringify','textCode','upperFirst','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','events','./utils'];(function(_0xf329b9,_0x926c36){var _0x2c2b0f=function(_0x2b0a85){while(--_0x2b0a85){_0xf329b9['push'](_0xf329b9['shift']());}};_0x2c2b0f(++_0x926c36);}(_0x31c7,0xd2));var _0x731c=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x31c7[_0x2070da];return _0x4f9fe1;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x731c('0x0'));var Imap=require(_0x731c('0x1'));var _=require(_0x731c('0x2'));var rs=require(_0x731c('0x3'));var simpleParser=require(_0x731c('0x4'))[_0x731c('0x5')];var Iconv=require(_0x731c('0x6'))[_0x731c('0x7')];var EventEmitter=require(_0x731c('0x8'))['EventEmitter'];var utils=require(_0x731c('0x9'));var logger=require('../../../config/logger')(_0x731c('0xa'));function EmailImap(_0x54ee93,_0x4be2b0){this[_0x731c('0xb')]='INBOX';this[_0x731c('0xc')]=this[_0x731c('0xd')](_0x54ee93,_0x4be2b0);this[_0x731c('0x1')]=new Imap(this[_0x731c('0xc')]);this[_0x731c('0x1')][_0x731c('0xe')](_0x731c('0xf'),this[_0x731c('0x10')][_0x731c('0x11')](this));this[_0x731c('0x1')][_0x731c('0xe')](_0x731c('0x12'),this[_0x731c('0x13')][_0x731c('0x11')](this));this[_0x731c('0x1')]['on'](_0x731c('0x14'),this['handleError'][_0x731c('0x11')](this));this[_0x731c('0x1')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x731c('0xd')]=function(_0x2ab877,_0x202df0){var _0x462f14={'connTimeout':_0x2ab877[_0x731c('0x15')]?_0x2ab877[_0x731c('0x15')]*0x3e8:0x2710,'authTimeout':_0x2ab877['authTimeout']?_0x2ab877[_0x731c('0x16')]*0x3e8:0x1388};if(_['isNil'](_0x2ab877[_0x731c('0x17')])){if(_0x2ab877[_0x731c('0x18')]){_0x462f14[_0x731c('0x19')]=_0x2ab877['user'];_0x462f14['password']=_0x2ab877[_0x731c('0x1a')];}_0x462f14[_0x731c('0x1b')]=_0x2ab877[_0x731c('0x1b')];_0x462f14[_0x731c('0x1c')]=_0x2ab877[_0x731c('0x1c')]||0x3e1;if(_0x2ab877[_0x731c('0x1d')]){_0x462f14[_0x731c('0x1d')]=!![];}else{_0x462f14['tls']=![];_0x462f14[_0x731c('0x1e')]=_0x731c('0x1f');}}else{_0x462f14[_0x731c('0x19')]=_0x2ab877[_0x731c('0x19')];_0x462f14[_0x731c('0x1a')]=_0x2ab877['password'];_0x462f14[_0x731c('0x1b')]=utils['getHost'](_0x2ab877[_0x731c('0x17')]);_0x462f14[_0x731c('0x1c')]=0x3e1;_0x462f14[_0x731c('0x1d')]=!![];}_0x462f14[_0x731c('0xa')]=_0x202df0||_0x2ab877[_0x731c('0x19')]||_0x731c('0x20');return _0x462f14;};EmailImap[_0x731c('0x21')]['handleReady']=function(){this['imap']['openBox'](this['mailbox'],![],this[_0x731c('0x22')][_0x731c('0x11')](this));};EmailImap[_0x731c('0x21')][_0x731c('0x22')]=function(_0x21ee1e,_0x25dda0){if(_0x21ee1e){this[_0x731c('0x23')](_0x21ee1e,!![]);}else{this[_0x731c('0x24')]('box',_0x25dda0);this['readUnseen']();}};EmailImap[_0x731c('0x21')][_0x731c('0x25')]=function(_0x2978cd){if(_0x2978cd){this[_0x731c('0x23')](_0x2978cd,!![]);}else{this[_0x731c('0x1')][_0x731c('0x12')]();}};EmailImap[_0x731c('0x21')][_0x731c('0x26')]=function(){this['imap'][_0x731c('0x27')](['UNSEEN'],this[_0x731c('0x28')][_0x731c('0x11')](this));};EmailImap[_0x731c('0x21')][_0x731c('0x28')]=function(_0x1432d8,_0x12e6e4){if(_0x1432d8){this['handleError'](_0x1432d8,!![]);}else{if(_0x12e6e4[_0x731c('0x29')]){try{var _0x49c65d=this[_0x731c('0x1')][_0x731c('0x2a')](_0x12e6e4,{'bodies':'','markSeen':!![]});_0x49c65d['on']('message',this[_0x731c('0x2b')]['bind'](this));_0x49c65d[_0x731c('0xe')]('error',this[_0x731c('0x2c')]['bind'](this));_0x49c65d['once'](_0x731c('0x12'),this['handleFetchEnd'][_0x731c('0x11')](this));}catch(_0x4d457d){logger[_0x731c('0x14')](_0x4d457d);}}else{this['imap']['closeBox'](!![],this['handleCloseBox']['bind'](this));}}};EmailImap['prototype'][_0x731c('0x2b')]=function(_0x196a4f,_0x3d1710){_0x196a4f['on'](_0x731c('0x2d'),this[_0x731c('0x2e')][_0x731c('0x11')](this));_0x196a4f[_0x731c('0xe')](_0x731c('0x2f'),this[_0x731c('0x30')][_0x731c('0x11')](this));_0x196a4f[_0x731c('0xe')](_0x731c('0x12'),this[_0x731c('0x31')]['bind'](this));};EmailImap[_0x731c('0x21')][_0x731c('0x2e')]=function(_0x457e51,_0x40b23b){simpleParser(_0x457e51,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x731c('0x21')][_0x731c('0x30')]=function(_0x3907e3){};EmailImap[_0x731c('0x21')]['handleMessageEnd']=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x1a699d,_0x148073){if(_0x1a699d){logger[_0x731c('0x14')](_0x1a699d);}else{var _0xa3602=this;utils['parser'](this['account'],_0x148073,function(_0x49d361){_0xa3602['emit'](_0x731c('0xa'),_0x49d361);});}};EmailImap[_0x731c('0x21')][_0x731c('0x32')]=function(){this[_0x731c('0x1')][_0x731c('0x33')](!![],this[_0x731c('0x25')]['bind'](this));};EmailImap[_0x731c('0x21')][_0x731c('0x2c')]=function(_0x3c25c7){this['handleError'](_0x3c25c7);this[_0x731c('0x1')][_0x731c('0x33')](!![],this[_0x731c('0x25')][_0x731c('0x11')](this));};EmailImap[_0x731c('0x21')][_0x731c('0x13')]=function(){this[_0x731c('0x24')](_0x731c('0x12'));};EmailImap['prototype']['handleError']=function(_0x229a8e,_0x452366){logger[_0x731c('0x14')]('handleError',this[_0x731c('0xc')]['email'],JSON[_0x731c('0x34')](_0x229a8e));var _0x4aa3a6='';if(_0x229a8e){if(_0x229a8e[_0x731c('0x35')]){_0x4aa3a6=_0x229a8e[_0x731c('0x35')];}else{for(var _0xba67b in _0x229a8e){if(_0x229a8e['hasOwnProperty'](_0xba67b)){_0x4aa3a6+=_[_0x731c('0x36')](_0xba67b)+':\x20'+_0x229a8e[_0xba67b]+'\x0a';}}}}if(_0x452366){this[_0x731c('0x1')][_0x731c('0x12')]();}else{this[_0x731c('0x24')](_0x731c('0x14'),_0x4aa3a6);this[_0x731c('0x24')](_0x731c('0x12'));}};module['exports']=EmailImap;
\ No newline at end of file
+var _0x7c7b=['inherits','prototype','getAccount','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','autotls','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','fetch','handleFetchEnd','handleCloseBox','handleMessageBody','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','email','handleFetchError','closeBox','textCode','hasOwnProperty','upperFirst','exports','path','util','lodash','randomstring','mailparser','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','account','imap','once','ready','handleReady','end','handleEnd','bind','error','handleError','connect'];(function(_0x470256,_0x47173e){var _0x4d859e=function(_0x302e66){while(--_0x302e66){_0x470256['push'](_0x470256['shift']());}};_0x4d859e(++_0x47173e);}(_0x7c7b,0xa2));var _0xb7c7=function(_0x1f74db,_0x46d348){_0x1f74db=_0x1f74db-0x0;var _0x4763c5=_0x7c7b[_0x1f74db];return _0x4763c5;};'use strict';var fs=require('fs');var path=require(_0xb7c7('0x0'));var util=require(_0xb7c7('0x1'));var Imap=require('imap');var _=require(_0xb7c7('0x2'));var rs=require(_0xb7c7('0x3'));var simpleParser=require(_0xb7c7('0x4'))[_0xb7c7('0x5')];var Iconv=require(_0xb7c7('0x6'))['Iconv'];var EventEmitter=require(_0xb7c7('0x7'))[_0xb7c7('0x8')];var utils=require(_0xb7c7('0x9'));var logger=require(_0xb7c7('0xa'))('email');function EmailImap(_0x1d37c0,_0x42cc85){this[_0xb7c7('0xb')]=_0xb7c7('0xc');this[_0xb7c7('0xd')]=this['getAccount'](_0x1d37c0,_0x42cc85);this[_0xb7c7('0xe')]=new Imap(this[_0xb7c7('0xd')]);this[_0xb7c7('0xe')][_0xb7c7('0xf')](_0xb7c7('0x10'),this[_0xb7c7('0x11')]['bind'](this));this[_0xb7c7('0xe')][_0xb7c7('0xf')](_0xb7c7('0x12'),this[_0xb7c7('0x13')][_0xb7c7('0x14')](this));this['imap']['on'](_0xb7c7('0x15'),this[_0xb7c7('0x16')][_0xb7c7('0x14')](this));this[_0xb7c7('0xe')][_0xb7c7('0x17')]();}util[_0xb7c7('0x18')](EmailImap,EventEmitter);EmailImap[_0xb7c7('0x19')][_0xb7c7('0x1a')]=function(_0x471a08,_0x4b5c62){var _0x1b90ea={'connTimeout':_0x471a08[_0xb7c7('0x1b')]?_0x471a08[_0xb7c7('0x1b')]*0x3e8:0x2710,'authTimeout':_0x471a08[_0xb7c7('0x1c')]?_0x471a08[_0xb7c7('0x1c')]*0x3e8:0x1388};if(_['isNil'](_0x471a08[_0xb7c7('0x1d')])){if(_0x471a08[_0xb7c7('0x1e')]){_0x1b90ea[_0xb7c7('0x1f')]=_0x471a08[_0xb7c7('0x1f')];_0x1b90ea[_0xb7c7('0x20')]=_0x471a08[_0xb7c7('0x20')];}_0x1b90ea[_0xb7c7('0x21')]=_0x471a08['host'];_0x1b90ea[_0xb7c7('0x22')]=_0x471a08[_0xb7c7('0x22')]||0x3e1;if(_0x471a08['tls']){_0x1b90ea[_0xb7c7('0x23')]=!![];}else{_0x1b90ea['tls']=![];_0x1b90ea[_0xb7c7('0x24')]='required';}}else{_0x1b90ea['user']=_0x471a08[_0xb7c7('0x1f')];_0x1b90ea[_0xb7c7('0x20')]=_0x471a08[_0xb7c7('0x20')];_0x1b90ea['host']=utils[_0xb7c7('0x25')](_0x471a08[_0xb7c7('0x1d')]);_0x1b90ea[_0xb7c7('0x22')]=0x3e1;_0x1b90ea[_0xb7c7('0x23')]=!![];}_0x1b90ea['email']=_0x4b5c62||_0x471a08[_0xb7c7('0x1f')]||_0xb7c7('0x26');return _0x1b90ea;};EmailImap[_0xb7c7('0x19')]['handleReady']=function(){this[_0xb7c7('0xe')][_0xb7c7('0x27')](this[_0xb7c7('0xb')],![],this[_0xb7c7('0x28')][_0xb7c7('0x14')](this));};EmailImap[_0xb7c7('0x19')][_0xb7c7('0x28')]=function(_0xc038a4,_0x506237){if(_0xc038a4){this[_0xb7c7('0x16')](_0xc038a4,!![]);}else{this[_0xb7c7('0x29')](_0xb7c7('0x2a'),_0x506237);this[_0xb7c7('0x2b')]();}};EmailImap[_0xb7c7('0x19')]['handleCloseBox']=function(_0x30db9e){if(_0x30db9e){this['handleError'](_0x30db9e,!![]);}else{this['imap'][_0xb7c7('0x12')]();}};EmailImap[_0xb7c7('0x19')][_0xb7c7('0x2b')]=function(){this[_0xb7c7('0xe')][_0xb7c7('0x2c')]([_0xb7c7('0x2d')],this[_0xb7c7('0x2e')][_0xb7c7('0x14')](this));};EmailImap[_0xb7c7('0x19')][_0xb7c7('0x2e')]=function(_0x4c403f,_0x2c202d){if(_0x4c403f){this[_0xb7c7('0x16')](_0x4c403f,!![]);}else{if(_0x2c202d['length']){try{var _0x5126b1=this[_0xb7c7('0xe')][_0xb7c7('0x2f')](_0x2c202d,{'bodies':'','markSeen':!![]});_0x5126b1['on']('message',this['handleFetchMessage']['bind'](this));_0x5126b1[_0xb7c7('0xf')]('error',this['handleFetchError'][_0xb7c7('0x14')](this));_0x5126b1['once'](_0xb7c7('0x12'),this[_0xb7c7('0x30')]['bind'](this));}catch(_0x5b5794){logger[_0xb7c7('0x15')](_0x5b5794);}}else{this[_0xb7c7('0xe')]['closeBox'](!![],this[_0xb7c7('0x31')][_0xb7c7('0x14')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x294e0d,_0x47c063){_0x294e0d['on']('body',this[_0xb7c7('0x32')]['bind'](this));_0x294e0d[_0xb7c7('0xf')]('attributes',this[_0xb7c7('0x33')][_0xb7c7('0x14')](this));_0x294e0d[_0xb7c7('0xf')](_0xb7c7('0x12'),this['handleMessageEnd'][_0xb7c7('0x14')](this));};EmailImap[_0xb7c7('0x19')][_0xb7c7('0x32')]=function(_0x41f83e,_0x4ff594){simpleParser(_0x41f83e,{'Iconv':Iconv},this[_0xb7c7('0x34')]['bind'](this));};EmailImap[_0xb7c7('0x19')][_0xb7c7('0x33')]=function(_0x4e0012){};EmailImap[_0xb7c7('0x19')][_0xb7c7('0x35')]=function(){};EmailImap[_0xb7c7('0x19')][_0xb7c7('0x34')]=function(_0x2ad633,_0x160a09){if(_0x2ad633){logger['error'](_0x2ad633);}else{var _0x471593=this;utils[_0xb7c7('0x36')](this['account'],_0x160a09,function(_0x5c6f42){_0x471593['emit'](_0xb7c7('0x37'),_0x5c6f42);});}};EmailImap[_0xb7c7('0x19')][_0xb7c7('0x30')]=function(){this['imap']['closeBox'](!![],this['handleCloseBox'][_0xb7c7('0x14')](this));};EmailImap['prototype'][_0xb7c7('0x38')]=function(_0x5a6e12){this[_0xb7c7('0x16')](_0x5a6e12);this[_0xb7c7('0xe')][_0xb7c7('0x39')](!![],this[_0xb7c7('0x31')][_0xb7c7('0x14')](this));};EmailImap['prototype']['handleEnd']=function(){this['emit'](_0xb7c7('0x12'));};EmailImap[_0xb7c7('0x19')][_0xb7c7('0x16')]=function(_0x76887b,_0x4c852e){logger['error'](_0xb7c7('0x16'),this[_0xb7c7('0xd')]['email'],JSON['stringify'](_0x76887b));var _0x198b50='';if(_0x76887b){if(_0x76887b[_0xb7c7('0x3a')]){_0x198b50=_0x76887b[_0xb7c7('0x3a')];}else{for(var _0x34b7d4 in _0x76887b){if(_0x76887b[_0xb7c7('0x3b')](_0x34b7d4)){_0x198b50+=_[_0xb7c7('0x3c')](_0x34b7d4)+':\x20'+_0x76887b[_0x34b7d4]+'\x0a';}}}}if(_0x4c852e){this[_0xb7c7('0xe')][_0xb7c7('0x12')]();}else{this[_0xb7c7('0x29')]('error',_0x198b50);this[_0xb7c7('0x29')](_0xb7c7('0x12'));}};module[_0xb7c7('0x3d')]=EmailImap;
\ No newline at end of file
index aa8696e..7b31a11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x765c=['nodemailer-plugin-inline-base64','prototype','send','use','compile','sendMail','toString','verify','createTransport','Not\x20verifired','exports','nodemailer','bluebird'];(function(_0x3888e3,_0x13e153){var _0x47bdfd=function(_0x403ebd){while(--_0x403ebd){_0x3888e3['push'](_0x3888e3['shift']());}};_0x47bdfd(++_0x13e153);}(_0x765c,0x1ab));var _0xc765=function(_0x5df728,_0x55f5a4){_0x5df728=_0x5df728-0x0;var _0x34176f=_0x765c[_0x5df728];return _0x34176f;};'use strict';var nodemailer=require(_0xc765('0x0'));var BPromise=require(_0xc765('0x1'));var inlineBase64=require(_0xc765('0x2'));function EmailSmtp(){}EmailSmtp[_0xc765('0x3')][_0xc765('0x4')]=function(_0x139ad0,_0x4c2b91){return new BPromise(function(_0x39c05c,_0x56a687){var _0x123256=nodemailer['createTransport'](_0x139ad0);_0x123256[_0xc765('0x5')](_0xc765('0x6'),inlineBase64());_0x123256[_0xc765('0x7')](_0x4c2b91,function(_0x114253,_0x349c14){if(_0x114253){_0x56a687(_0x114253[_0xc765('0x8')]());}else{_0x39c05c(_0x349c14);}});});};EmailSmtp[_0xc765('0x3')][_0xc765('0x9')]=function(_0x283870){return new BPromise(function(_0x24c1e0,_0x24e1e9){var _0x471a84=nodemailer[_0xc765('0xa')](_0x283870);_0x471a84[_0xc765('0x9')](function(_0x2e105d,_0x2b6c49){if(_0x2e105d){_0x24e1e9(_0x2e105d['toString']());}else{if(_0x2b6c49){_0x24c1e0(_0x2b6c49);}else{_0x24e1e9(_0xc765('0xb'));}}});});};module[_0xc765('0xc')]=EmailSmtp;
\ No newline at end of file
+var _0x86e7=['verify','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','toString'];(function(_0x5a0876,_0x1e363e){var _0x55969f=function(_0x3e12ce){while(--_0x3e12ce){_0x5a0876['push'](_0x5a0876['shift']());}};_0x55969f(++_0x1e363e);}(_0x86e7,0x1e1));var _0x786e=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x86e7[_0x3511d3];return _0x5d6321;};'use strict';var nodemailer=require(_0x786e('0x0'));var BPromise=require(_0x786e('0x1'));var inlineBase64=require(_0x786e('0x2'));function EmailSmtp(){}EmailSmtp[_0x786e('0x3')][_0x786e('0x4')]=function(_0xb709e1,_0x26dea8){return new BPromise(function(_0x2efee9,_0x430d43){var _0x16a9e5=nodemailer[_0x786e('0x5')](_0xb709e1);_0x16a9e5[_0x786e('0x6')](_0x786e('0x7'),inlineBase64());_0x16a9e5['sendMail'](_0x26dea8,function(_0x4656e0,_0x84b76c){if(_0x4656e0){_0x430d43(_0x4656e0[_0x786e('0x8')]());}else{_0x2efee9(_0x84b76c);}});});};EmailSmtp['prototype'][_0x786e('0x9')]=function(_0x1431c9){return new BPromise(function(_0x4550f2,_0x3a05c2){var _0x51aa86=nodemailer['createTransport'](_0x1431c9);_0x51aa86['verify'](function(_0xc5e0e9,_0x233a5f){if(_0xc5e0e9){_0x3a05c2(_0xc5e0e9[_0x786e('0x8')]());}else{if(_0x233a5f){_0x4550f2(_0x233a5f);}else{_0x3a05c2('Not\x20verifired');}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
index 570062f..a5336ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc25=['body','<a\x20target=\x22_blank\x22\x20','originTo','message','originCc','includes','bcc','attach','attachments','type','format','%s-%s','join','server/files/attachments/','content','push','parser','from','messageId','inReplyTo','date','textAsHtml','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','getHost','gmail','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','pop','isEmpty','html','test','replace'];(function(_0x27c867,_0x4c5547){var _0x2349cd=function(_0x5f202f){while(--_0x5f202f){_0x27c867['push'](_0x27c867['shift']());}};_0x2349cd(++_0x4c5547);}(_0xcc25,0x67));var _0x5cc2=function(_0x1c69ef,_0x4f0157){_0x1c69ef=_0x1c69ef-0x0;var _0x28d848=_0xcc25[_0x1c69ef];return _0x28d848;};'use strict';var _=require('lodash');var moment=require(_0x5cc2('0x0'));var random=require(_0x5cc2('0x1'));var fs=require('fs');var path=require(_0x5cc2('0x2'));var util=require(_0x5cc2('0x3'));var tnef=require(_0x5cc2('0x4'));var logger=require(_0x5cc2('0x5'))(_0x5cc2('0x6'));var config=require(_0x5cc2('0x7'));function getAddress(_0x17de01){var _0x2d0e18=_[_0x5cc2('0x8')](_0x17de01[_0x5cc2('0x9')]);return _0x2d0e18&&_0x2d0e18[_0x5cc2('0xa')]?_0x2d0e18[_0x5cc2('0xa')]:_0x5cc2('0xb')+random[_0x5cc2('0xc')](0x6)+_0x5cc2('0xd');}function getFirstName(_0xa4f973){var _0x4f54e8=_['head'](_0xa4f973[_0x5cc2('0x9')]);if(_0x4f54e8&&_0x4f54e8[_0x5cc2('0xe')]){var _0x135bdb=_0x4f54e8[_0x5cc2('0xe')][_0x5cc2('0xf')](/\s+/);return _0x135bdb[_0x5cc2('0x10')]?_0x135bdb[_0x5cc2('0x11')](0x0,-0x1)['join']('\x20'):_0x4f54e8['name'];}return'Anonymous';}function getLastName(_0x46ec20){var _0x41d1ad=_[_0x5cc2('0x8')](_0x46ec20[_0x5cc2('0x9')]);if(_0x41d1ad&&_0x41d1ad[_0x5cc2('0xe')]){var _0x12d4b4=_0x41d1ad[_0x5cc2('0xe')][_0x5cc2('0xf')](/\s+/);return _0x12d4b4[_0x5cc2('0x10')]>0x1?_0x12d4b4[_0x5cc2('0x12')]():'';}return'';}function getMails(_0x4605b7,_0x1e751b){var _0x4b2f82='';for(var _0x25b5f0=0x0;_0x25b5f0<_0x1e751b['value'][_0x5cc2('0x10')];_0x25b5f0+=0x1){if(_0x1e751b[_0x5cc2('0x9')][_0x25b5f0][_0x5cc2('0xa')]!==_0x4605b7){if(!_[_0x5cc2('0x13')](_0x4b2f82)){_0x4b2f82+=',';}_0x4b2f82+=_0x1e751b[_0x5cc2('0x9')][_0x25b5f0][_0x5cc2('0xe')]||_0x1e751b['value'][_0x25b5f0]['address']||'';_0x4b2f82+='\x20<';_0x4b2f82+=_0x1e751b[_0x5cc2('0x9')][_0x25b5f0]['address']?_0x1e751b[_0x5cc2('0x9')][_0x25b5f0][_0x5cc2('0xa')]:_0x5cc2('0xb')+random['generate'](0x6)+_0x5cc2('0xd');_0x4b2f82+='>';}}return _0x4b2f82;}function parseEmail(_0x11525,_0x4d2a1d,_0x5431ef){if(_0x4d2a1d[_0x5cc2('0x14')]){var _0x1e8d5c=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x1e8d5c[_0x5cc2('0x15')](_0x4d2a1d['html'])){_0x4d2a1d[_0x5cc2('0x14')]=_0x4d2a1d[_0x5cc2('0x14')][_0x5cc2('0x16')](_0x1e8d5c,'');}_0x5431ef[_0x5cc2('0x17')]=_0x4d2a1d[_0x5cc2('0x14')];}else{_0x5431ef[_0x5cc2('0x17')]=_0x4d2a1d['textAsHtml'];}if(_0x5431ef[_0x5cc2('0x17')]){_0x5431ef[_0x5cc2('0x17')]=_0x5431ef[_0x5cc2('0x17')][_0x5cc2('0x16')](/<a\s+/gi,_0x5cc2('0x18'));}if(_0x4d2a1d['to']){_0x5431ef['message'][_0x5cc2('0x19')]=getMails(null,_0x4d2a1d['to']);var _0x2e40ec=getMails(_0x11525[_0x5cc2('0x6')],_0x4d2a1d['to']);if(!_['isEmpty'](_0x2e40ec)){_0x5431ef[_0x5cc2('0x1a')]['cc']+=_0x2e40ec;}}if(_0x4d2a1d['cc']){_0x5431ef[_0x5cc2('0x1a')][_0x5cc2('0x1b')]=getMails(null,_0x4d2a1d['cc']);var _0x5115cf=getMails(_0x11525[_0x5cc2('0x6')],_0x4d2a1d['cc']);if(!_['isEmpty'](_0x5115cf)){if(!_[_0x5cc2('0x13')](_0x5431ef['message']['cc'])){_0x5431ef[_0x5cc2('0x1a')]['cc']+=',';}_0x5431ef[_0x5cc2('0x1a')]['cc']+=_0x5115cf;}}if(!_[_0x5cc2('0x1c')](_0x5431ef[_0x5cc2('0x1a')][_0x5cc2('0x19')],_0x11525[_0x5cc2('0x6')])&&!_[_0x5cc2('0x1c')](_0x5431ef['message'][_0x5cc2('0x1b')],_0x11525[_0x5cc2('0x6')])){_0x5431ef[_0x5cc2('0x1a')][_0x5cc2('0x1d')]=_0x11525[_0x5cc2('0x6')];}if(_0x4d2a1d['attachments']&&_0x4d2a1d['attachments'][_0x5cc2('0x10')]){_0x5431ef[_0x5cc2('0x1a')][_0x5cc2('0x1e')]=_0x4d2a1d['attachments'][_0x5cc2('0x10')];for(var _0x486999=0x0,_0x40dee3,_0x5492e0,_0x5757eb;_0x486999<_0x4d2a1d['attachments'][_0x5cc2('0x10')];_0x486999+=0x1){if(_0x4d2a1d[_0x5cc2('0x1f')][_0x486999][_0x5cc2('0x20')]==='attachment'){_0x5757eb=_0x4d2a1d[_0x5cc2('0x1f')][_0x486999]['filename']||'attachment-'+_0x486999;_0x40dee3=util[_0x5cc2('0x21')](_0x5cc2('0x22'),Date['now'](),_0x5757eb);_0x5492e0=path[_0x5cc2('0x23')](config['root'],_0x5cc2('0x24'),_0x40dee3);fs['writeFileSync'](_0x5492e0,_0x4d2a1d[_0x5cc2('0x1f')][_0x486999][_0x5cc2('0x25')]);_0x5431ef[_0x5cc2('0x1a')][_0x5cc2('0x1f')][_0x5cc2('0x26')]({'name':_0x5757eb,'basename':_0x40dee3,'type':_0x4d2a1d[_0x5cc2('0x1f')][_0x486999]['contentType'],'filepath':_0x5492e0});}}}return _0x5431ef;}exports[_0x5cc2('0x27')]=function(_0xad1650,_0x20ffa5,_0xb17ed5){var _0x38cfce={'from':getAddress(_0x20ffa5['from']),'firstName':getFirstName(_0x20ffa5['from']),'lastName':getLastName(_0x20ffa5[_0x5cc2('0x28')]),'mapKey':_0x5cc2('0x6'),'message':{'from':getMails(_0xad1650[_0x5cc2('0x6')],_0x20ffa5[_0x5cc2('0x28')]),'to':_0xad1650['email'],'cc':'','subject':_0x20ffa5['subject']||'','messageId':_0x20ffa5[_0x5cc2('0x29')],'inReplyTo':_0x20ffa5[_0x5cc2('0x2a')],'sentAt':moment(_0x20ffa5[_0x5cc2('0x2b')])[_0x5cc2('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x20ffa5[_0x5cc2('0x14')]&&!_0x20ffa5[_0x5cc2('0x2c')]){var _0x3cc71d=_[_0x5cc2('0x2d')](_0x20ffa5['attachments'],{'contentType':_0x5cc2('0x2e')});if(_0x3cc71d['length']){logger[_0x5cc2('0x2f')](util[_0x5cc2('0x21')](_0x5cc2('0x30'),_0x20ffa5['messageId']));tnef[_0x5cc2('0x31')](_[_0x5cc2('0x32')](_0x3cc71d)[_0x5cc2('0x25')],function(_0x446888,_0x2cb65a){if(_0x2cb65a){_0x20ffa5[_0x5cc2('0x14')]=_0x2cb65a[_0x5cc2('0x33')]||_0x5cc2('0x34');if(_0x2cb65a[_0x5cc2('0x35')]){for(var _0x342968=0x0;_0x342968<_0x2cb65a[_0x5cc2('0x35')][_0x5cc2('0x10')];_0x342968++){var _0x2f6bc0=_0x2cb65a[_0x5cc2('0x35')][_0x342968];_0x38cfce[_0x5cc2('0x1a')][_0x5cc2('0x1f')]['push']({'filename':_0x2f6bc0[_0x5cc2('0x36')],'content':new Buffer(_0x2f6bc0[_0x5cc2('0x37')])});}}}_0xb17ed5(parseEmail(_0xad1650,_0x20ffa5,_0x38cfce));});}else{_0x20ffa5[_0x5cc2('0x14')]=_0x5cc2('0x34');_0xb17ed5(parseEmail(_0xad1650,_0x20ffa5,_0x38cfce));}}else{_0xb17ed5(parseEmail(_0xad1650,_0x20ffa5,_0x38cfce));}};exports[_0x5cc2('0x38')]=function(_0x31f619){switch(_0x31f619){case _0x5cc2('0x39'):return'imap.gmail.com';case _0x5cc2('0x3a'):return'imap.mail.yahoo.com';case _0x5cc2('0x3b'):return _0x5cc2('0x3c');case _0x5cc2('0x3d'):return _0x5cc2('0x3e');}return'127.0.0.1';};
\ No newline at end of file
+var _0xbfc4=['name','split','length','slice','join','pop','isEmpty','generate','@xcally.com','test','html','replace','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','email','originCc','includes','bcc','attach','attachments','attachment','filename','attachment-','format','now','root','server/files/attachments/','writeFileSync','content','contentType','from','subject','messageId','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','<p>Empty\x20message</p>','Attachments','push','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','outlook365','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/environment','head','value','address','anonymous'];(function(_0x532685,_0x1a38c2){var _0x21426a=function(_0xa48343){while(--_0xa48343){_0x532685['push'](_0x532685['shift']());}};_0x21426a(++_0x1a38c2);}(_0xbfc4,0x77));var _0x4bfc=function(_0x41baca,_0x52574e){_0x41baca=_0x41baca-0x0;var _0x21aa2f=_0xbfc4[_0x41baca];return _0x21aa2f;};'use strict';var _=require(_0x4bfc('0x0'));var moment=require(_0x4bfc('0x1'));var random=require(_0x4bfc('0x2'));var fs=require('fs');var path=require(_0x4bfc('0x3'));var util=require(_0x4bfc('0x4'));var tnef=require(_0x4bfc('0x5'));var logger=require('../../../config/logger')('email');var config=require(_0x4bfc('0x6'));function getAddress(_0x957871){var _0x1e71b7=_[_0x4bfc('0x7')](_0x957871[_0x4bfc('0x8')]);return _0x1e71b7&&_0x1e71b7[_0x4bfc('0x9')]?_0x1e71b7[_0x4bfc('0x9')]:_0x4bfc('0xa')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x28a0c9){var _0xe73ce1=_[_0x4bfc('0x7')](_0x28a0c9['value']);if(_0xe73ce1&&_0xe73ce1[_0x4bfc('0xb')]){var _0x1f80f2=_0xe73ce1[_0x4bfc('0xb')][_0x4bfc('0xc')](/\s+/);return _0x1f80f2[_0x4bfc('0xd')]?_0x1f80f2[_0x4bfc('0xe')](0x0,-0x1)[_0x4bfc('0xf')]('\x20'):_0xe73ce1[_0x4bfc('0xb')];}return'Anonymous';}function getLastName(_0x540a1e){var _0x1a6fdf=_[_0x4bfc('0x7')](_0x540a1e[_0x4bfc('0x8')]);if(_0x1a6fdf&&_0x1a6fdf['name']){var _0x36ff14=_0x1a6fdf['name'][_0x4bfc('0xc')](/\s+/);return _0x36ff14[_0x4bfc('0xd')]>0x1?_0x36ff14[_0x4bfc('0x10')]():'';}return'';}function getMails(_0x12d588,_0x52bac9){var _0x3139f5='';for(var _0x4bc3b0=0x0;_0x4bc3b0<_0x52bac9[_0x4bfc('0x8')]['length'];_0x4bc3b0+=0x1){if(_0x52bac9['value'][_0x4bc3b0][_0x4bfc('0x9')]!==_0x12d588){if(!_[_0x4bfc('0x11')](_0x3139f5)){_0x3139f5+=',';}_0x3139f5+=_0x52bac9[_0x4bfc('0x8')][_0x4bc3b0][_0x4bfc('0xb')]||_0x52bac9[_0x4bfc('0x8')][_0x4bc3b0][_0x4bfc('0x9')]||'';_0x3139f5+='\x20<';_0x3139f5+=_0x52bac9['value'][_0x4bc3b0][_0x4bfc('0x9')]?_0x52bac9[_0x4bfc('0x8')][_0x4bc3b0]['address']:_0x4bfc('0xa')+random[_0x4bfc('0x12')](0x6)+_0x4bfc('0x13');_0x3139f5+='>';}}return _0x3139f5;}function parseEmail(_0x55b1be,_0x5d4379,_0x31ff96){if(_0x5d4379['html']){var _0x370ae3=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x370ae3[_0x4bfc('0x14')](_0x5d4379[_0x4bfc('0x15')])){_0x5d4379[_0x4bfc('0x15')]=_0x5d4379[_0x4bfc('0x15')][_0x4bfc('0x16')](_0x370ae3,'');}_0x31ff96[_0x4bfc('0x17')]=_0x5d4379[_0x4bfc('0x15')];}else{_0x31ff96[_0x4bfc('0x17')]=_0x5d4379[_0x4bfc('0x18')];}if(_0x31ff96[_0x4bfc('0x17')]){_0x31ff96['body']=_0x31ff96[_0x4bfc('0x17')][_0x4bfc('0x16')](/<a\s+/gi,_0x4bfc('0x19'));}if(_0x5d4379['to']){_0x31ff96[_0x4bfc('0x1a')][_0x4bfc('0x1b')]=getMails(null,_0x5d4379['to']);var _0x45394a=getMails(_0x55b1be[_0x4bfc('0x1c')],_0x5d4379['to']);if(!_[_0x4bfc('0x11')](_0x45394a)){_0x31ff96[_0x4bfc('0x1a')]['cc']+=_0x45394a;}}if(_0x5d4379['cc']){_0x31ff96[_0x4bfc('0x1a')][_0x4bfc('0x1d')]=getMails(null,_0x5d4379['cc']);var _0x1c2863=getMails(_0x55b1be[_0x4bfc('0x1c')],_0x5d4379['cc']);if(!_[_0x4bfc('0x11')](_0x1c2863)){if(!_[_0x4bfc('0x11')](_0x31ff96[_0x4bfc('0x1a')]['cc'])){_0x31ff96[_0x4bfc('0x1a')]['cc']+=',';}_0x31ff96[_0x4bfc('0x1a')]['cc']+=_0x1c2863;}}if(!_['includes'](_0x31ff96[_0x4bfc('0x1a')][_0x4bfc('0x1b')],_0x55b1be[_0x4bfc('0x1c')])&&!_[_0x4bfc('0x1e')](_0x31ff96[_0x4bfc('0x1a')][_0x4bfc('0x1d')],_0x55b1be[_0x4bfc('0x1c')])){_0x31ff96['message'][_0x4bfc('0x1f')]=_0x55b1be[_0x4bfc('0x1c')];}if(_0x5d4379['attachments']&&_0x5d4379['attachments'][_0x4bfc('0xd')]){_0x31ff96[_0x4bfc('0x1a')][_0x4bfc('0x20')]=_0x5d4379[_0x4bfc('0x21')][_0x4bfc('0xd')];for(var _0x433950=0x0,_0x571ac8,_0x251fc6,_0x499adf;_0x433950<_0x5d4379[_0x4bfc('0x21')]['length'];_0x433950+=0x1){if(_0x5d4379[_0x4bfc('0x21')][_0x433950]['type']===_0x4bfc('0x22')){_0x499adf=_0x5d4379['attachments'][_0x433950][_0x4bfc('0x23')]||_0x4bfc('0x24')+_0x433950;_0x571ac8=util[_0x4bfc('0x25')]('%s-%s',Date[_0x4bfc('0x26')](),_0x499adf);_0x251fc6=path[_0x4bfc('0xf')](config[_0x4bfc('0x27')],_0x4bfc('0x28'),_0x571ac8);fs[_0x4bfc('0x29')](_0x251fc6,_0x5d4379[_0x4bfc('0x21')][_0x433950][_0x4bfc('0x2a')]);_0x31ff96[_0x4bfc('0x1a')][_0x4bfc('0x21')]['push']({'name':_0x499adf,'basename':_0x571ac8,'type':_0x5d4379[_0x4bfc('0x21')][_0x433950][_0x4bfc('0x2b')],'filepath':_0x251fc6});}}}return _0x31ff96;}exports['parser']=function(_0x5e9e53,_0x1a4cb3,_0x304ad4){var _0x5b7ddb={'from':getAddress(_0x1a4cb3[_0x4bfc('0x2c')]),'firstName':getFirstName(_0x1a4cb3[_0x4bfc('0x2c')]),'lastName':getLastName(_0x1a4cb3[_0x4bfc('0x2c')]),'mapKey':_0x4bfc('0x1c'),'message':{'from':getMails(_0x5e9e53['email'],_0x1a4cb3[_0x4bfc('0x2c')]),'to':_0x5e9e53[_0x4bfc('0x1c')],'cc':'','subject':_0x1a4cb3[_0x4bfc('0x2d')]||'','messageId':_0x1a4cb3[_0x4bfc('0x2e')],'inReplyTo':_0x1a4cb3[_0x4bfc('0x2f')],'sentAt':moment(_0x1a4cb3['date'])[_0x4bfc('0x25')](_0x4bfc('0x30')),'attach':![],'attachments':[]}};if(!_0x1a4cb3[_0x4bfc('0x15')]&&!_0x1a4cb3[_0x4bfc('0x18')]){var _0x2f32e8=_['filter'](_0x1a4cb3[_0x4bfc('0x21')],{'contentType':'application/ms-tnef'});if(_0x2f32e8[_0x4bfc('0xd')]){logger['info'](util[_0x4bfc('0x25')](_0x4bfc('0x31'),_0x1a4cb3[_0x4bfc('0x2e')]));tnef[_0x4bfc('0x32')](_[_0x4bfc('0x33')](_0x2f32e8)[_0x4bfc('0x2a')],function(_0x169528,_0x2973b3){if(_0x2973b3){_0x1a4cb3['html']=_0x2973b3[_0x4bfc('0x34')]||_0x4bfc('0x35');if(_0x2973b3[_0x4bfc('0x36')]){for(var _0x556f9f=0x0;_0x556f9f<_0x2973b3[_0x4bfc('0x36')][_0x4bfc('0xd')];_0x556f9f++){var _0x17e40d=_0x2973b3[_0x4bfc('0x36')][_0x556f9f];_0x5b7ddb['message'][_0x4bfc('0x21')][_0x4bfc('0x37')]({'filename':_0x17e40d[_0x4bfc('0x38')],'content':new Buffer(_0x17e40d[_0x4bfc('0x39')])});}}}_0x304ad4(parseEmail(_0x5e9e53,_0x1a4cb3,_0x5b7ddb));});}else{_0x1a4cb3['html']=_0x4bfc('0x35');_0x304ad4(parseEmail(_0x5e9e53,_0x1a4cb3,_0x5b7ddb));}}else{_0x304ad4(parseEmail(_0x5e9e53,_0x1a4cb3,_0x5b7ddb));}};exports[_0x4bfc('0x3a')]=function(_0x42b1b0){switch(_0x42b1b0){case _0x4bfc('0x3b'):return _0x4bfc('0x3c');case _0x4bfc('0x3d'):return _0x4bfc('0x3e');case'hotmail':return'imap-mail.outlook.com';case _0x4bfc('0x3f'):return'outlook.office365.com';}return _0x4bfc('0x40');};
\ No newline at end of file
index 370e371..428a356 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77f3=['SERV','active','Imap','Smtp','exports','name','Service'];(function(_0x2b6150,_0xbe8230){var _0x10d147=function(_0xc804a7){while(--_0xc804a7){_0x2b6150['push'](_0x2b6150['shift']());}};_0x10d147(++_0xbe8230);}(_0x77f3,0xfa));var _0x377f=function(_0x4c3b27,_0x45a450){_0x4c3b27=_0x4c3b27-0x0;var _0x424155=_0x77f3[_0x4c3b27];return _0x424155;};'use strict';var _=require('lodash');function MailAccount(_0x16d33d){this['id']=_0x16d33d['id']||0x0;this[_0x377f('0x0')]=_0x16d33d[_0x377f('0x0')]||_0x377f('0x1');this['key']=_0x16d33d['key']||_0x377f('0x2');this['active']=_0x16d33d[_0x377f('0x3')]||![];this[_0x377f('0x4')]=_0x16d33d[_0x377f('0x4')]||[];this[_0x377f('0x5')]=_0x16d33d[_0x377f('0x5')]||[];}module[_0x377f('0x6')]=MailAccount;
\ No newline at end of file
+var _0xe062=['key','SERV','active','Imap','Smtp','lodash','Service'];(function(_0x3cd141,_0x22bd12){var _0x2897a1=function(_0x37be3c){while(--_0x37be3c){_0x3cd141['push'](_0x3cd141['shift']());}};_0x2897a1(++_0x22bd12);}(_0xe062,0x8a));var _0x2e06=function(_0x41a96b,_0x46e121){_0x41a96b=_0x41a96b-0x0;var _0x5e92d4=_0xe062[_0x41a96b];return _0x5e92d4;};'use strict';var _=require(_0x2e06('0x0'));function MailAccount(_0x310d94){this['id']=_0x310d94['id']||0x0;this['name']=_0x310d94['name']||_0x2e06('0x1');this['key']=_0x310d94[_0x2e06('0x2')]||_0x2e06('0x3');this[_0x2e06('0x4')]=_0x310d94[_0x2e06('0x4')]||![];this[_0x2e06('0x5')]=_0x310d94['Imap']||[];this[_0x2e06('0x6')]=_0x310d94[_0x2e06('0x6')]||[];}module['exports']=MailAccount;
\ No newline at end of file
index 12d77fa..f9f6d6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa855=['mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','exports','../model/mailAccount'];(function(_0x5bf3fc,_0xe5c88){var _0xe1eb71=function(_0x3d2bb2){while(--_0x3d2bb2){_0x5bf3fc['push'](_0x5bf3fc['shift']());}};_0xe1eb71(++_0xe5c88);}(_0xa855,0x127));var _0x5a85=function(_0x1c3dcf,_0x2bab00){_0x1c3dcf=_0x1c3dcf-0x0;var _0x343dc1=_0xa855[_0x1c3dcf];return _0x343dc1;};'use strict';var _=require('lodash');var MailAccount=require(_0x5a85('0x0'));var Realtime=function(){this[_0x5a85('0x1')]={};};function freeIsNotKey(_0x412448,_0x2cd855,_0x3de0f4){var _0x3280ce=_['mapKeys'](_0x412448,function(_0x356d2c,_0x411a5c){return _0x356d2c[_0x3de0f4];});for(var _0x58d773 in _0x2cd855){if(_0x2cd855[_0x5a85('0x2')](_0x58d773)){if(!_0x3280ce[_0x58d773]){delete _0x2cd855[_0x58d773];}}}}Realtime[_0x5a85('0x3')][_0x5a85('0x4')]=function(_0x3996fc,_0x29a3b0){for(var _0x121a54 in _0x29a3b0){if(_0x3996fc[_0x5a85('0x2')](_0x121a54)){_0x3996fc[_0x121a54]=_0x29a3b0[_0x121a54];}}};Realtime[_0x5a85('0x3')]['initMailAccounts']=function(){var _0x340860=this;return function(_0x10a720){if(_0x10a720){freeIsNotKey(_0x10a720,_0x340860['mailAccounts'],'id');for(var _0x5dcede=0x0,_0x42388c={},_0x225502={};_0x5dcede<_0x10a720[_0x5a85('0x5')];_0x5dcede+=0x1){_0x42388c=_0x10a720[_0x5dcede];if(_[_0x5a85('0x6')](_0x340860[_0x5a85('0x1')][_0x42388c['id']])){_0x340860[_0x5a85('0x1')][_0x42388c['id']]=new MailAccount(_0x42388c);}else{_['merge'](_0x340860[_0x5a85('0x1')][_0x42388c['id']],_0x42388c);}}}return _0x340860[_0x5a85('0x1')];};};module[_0x5a85('0x7')]=Realtime;
\ No newline at end of file
+var _0x1826=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length','isUndefined','merge'];(function(_0x2a7b50,_0x545d55){var _0x4224c9=function(_0x2b96f6){while(--_0x2b96f6){_0x2a7b50['push'](_0x2a7b50['shift']());}};_0x4224c9(++_0x545d55);}(_0x1826,0x1da));var _0x6182=function(_0xe24fc0,_0x444ff6){_0xe24fc0=_0xe24fc0-0x0;var _0x185c6b=_0x1826[_0xe24fc0];return _0x185c6b;};'use strict';var _=require(_0x6182('0x0'));var MailAccount=require(_0x6182('0x1'));var Realtime=function(){this[_0x6182('0x2')]={};};function freeIsNotKey(_0x4b9b6f,_0x456ed3,_0x5ad6b2){var _0x3051d0=_[_0x6182('0x3')](_0x4b9b6f,function(_0x205040,_0x508439){return _0x205040[_0x5ad6b2];});for(var _0xd0f62d in _0x456ed3){if(_0x456ed3[_0x6182('0x4')](_0xd0f62d)){if(!_0x3051d0[_0xd0f62d]){delete _0x456ed3[_0xd0f62d];}}}}Realtime[_0x6182('0x5')]['mergeFromDatabase']=function(_0x241bd7,_0x249764){for(var _0x297f9f in _0x249764){if(_0x241bd7['hasOwnProperty'](_0x297f9f)){_0x241bd7[_0x297f9f]=_0x249764[_0x297f9f];}}};Realtime[_0x6182('0x5')][_0x6182('0x6')]=function(){var _0x5e7de5=this;return function(_0x430085){if(_0x430085){freeIsNotKey(_0x430085,_0x5e7de5[_0x6182('0x2')],'id');for(var _0x32dea4=0x0,_0x13f71f={},_0x38726f={};_0x32dea4<_0x430085[_0x6182('0x7')];_0x32dea4+=0x1){_0x13f71f=_0x430085[_0x32dea4];if(_[_0x6182('0x8')](_0x5e7de5[_0x6182('0x2')][_0x13f71f['id']])){_0x5e7de5['mailAccounts'][_0x13f71f['id']]=new MailAccount(_0x13f71f);}else{_[_0x6182('0x9')](_0x5e7de5['mailAccounts'][_0x13f71f['id']],_0x13f71f);}}}return _0x5e7de5[_0x6182('0x2')];};};module[_0x6182('0xa')]=Realtime;
\ No newline at end of file
index e9b43c8..9642384 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcbe=['ListId','MailServerOut','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','service','email','key'];(function(_0x3fa8f4,_0x15cf59){var _0x4aae16=function(_0x4d34e3){while(--_0x4d34e3){_0x3fa8f4['push'](_0x3fa8f4['shift']());}};_0x4aae16(++_0x15cf59);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x1ffd31,_0x5a20cb){_0x1ffd31=_0x1ffd31-0x0;var _0x5a78d7=_0xfcbe[_0x1ffd31];return _0x5a78d7;};'use strict';var client=require('../client');exports[_0xefcb('0x0')]=function(){return function(){return client[_0xefcb('0x1')](_0xefcb('0x2'),{'options':{'attributes':['id',_0xefcb('0x3'),_0xefcb('0x4'),_0xefcb('0x5'),'active',_0xefcb('0x6'),_0xefcb('0x7'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':'Imap'},{'model':_0xefcb('0x8'),'as':'Smtp'}]},'log':'getMailAccount'});};};exports[_0xefcb('0x9')]=function(_0x55cad2,_0x100aa1){return client[_0xefcb('0x1')](_0xefcb('0xa'),{'account':{'id':_0x55cad2},'body':_0x100aa1,'log':'NotifyMailAccount'});};
\ No newline at end of file
+var _0xa630=['TemplateId','MailServerIn','Imap','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','name','email','key','ListId'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xa630,0xbe));var _0x0a63=function(_0x3e3691,_0x4bcae0){_0x3e3691=_0x3e3691-0x0;var _0x111500=_0xa630[_0x3e3691];return _0x111500;};'use strict';var client=require(_0x0a63('0x0'));exports[_0x0a63('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x0a63('0x2'),'service',_0x0a63('0x3'),'active',_0x0a63('0x4'),_0x0a63('0x5'),_0x0a63('0x6')],'raw':![],'include':[{'model':_0x0a63('0x7'),'as':_0x0a63('0x8')},{'model':'MailServerOut','as':_0x0a63('0x9')}]},'log':_0x0a63('0xa')});};};exports[_0x0a63('0xb')]=function(_0x41d21d,_0x12a7df){return client[_0x0a63('0xc')]('NotifyMailAccount',{'account':{'id':_0x41d21d},'body':_0x12a7df,'log':_0x0a63('0xd')});};
\ No newline at end of file
index 3d70c07..5cc5c21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x655d=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','../../../config/logger','email','sendMail','account','message','then','catch','verifySmtp','Verified','error','values','mailAccounts','length','Imap','Smtp','pass','server'];(function(_0x59b302,_0x17d531){var _0x4d49db=function(_0x1fd2f1){while(--_0x1fd2f1){_0x59b302['push'](_0x59b302['shift']());}};_0x4d49db(++_0x17d531);}(_0x655d,0x77));var _0xd655=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x655d[_0x4a9fb1];return _0x348672;};'use strict';var jayson=require(_0xd655('0x0'));var BPromise=require(_0xd655('0x1'));var _=require('lodash');var logger=require(_0xd655('0x2'))(_0xd655('0x3'));exports['listen']=function(_0x455e44,_0x5df229){return new BPromise(function(_0x2dfa45,_0x400d36){var _0x23b1d7={'SendMail':function(_0x40e226){var _0x441324=this;return new Promise(function(_0x38cc0f,_0x4f867d){_0x5df229[_0xd655('0x4')](_0x40e226[_0xd655('0x5')],_0x40e226[_0xd655('0x6')])[_0xd655('0x7')](function(_0x271b70){_0x38cc0f({'code':0xc8,'message':_0x271b70});})[_0xd655('0x8')](function(_0x571aa4){_0x4f867d(_0x441324['error'](0x1f4,_0x571aa4));});});},'VerifySmtp':function(_0xc1584f){var _0x483297=this;return new Promise(function(_0x30ae86,_0x2cf948){_0x5df229[_0xd655('0x9')](_0xc1584f[_0xd655('0x5')])[_0xd655('0x7')](function(_0x56d108){_0x30ae86({'code':0xc8,'message':_0xd655('0xa')});})['catch'](function(_0x9f0a2f){_0x2cf948(_0x483297[_0xd655('0xb')](0x1f4,_0x9f0a2f));});});},'MailAccounts':function(_0x4b7b46){return new Promise(function(_0xef88aa,_0x4a74f9){var _0x2ccad8=_[_0xd655('0xc')](_0x455e44[_0xd655('0xd')]);for(var _0x2c3c8a=0x0;_0x2c3c8a<_0x2ccad8[_0xd655('0xe')];_0x2c3c8a+=0x1){if(_0x2ccad8[_0x2c3c8a][_0xd655('0xf')]&&_0x2ccad8[_0x2c3c8a][_0xd655('0xf')]['password']){delete _0x2ccad8[_0x2c3c8a][_0xd655('0xf')]['password'];}if(_0x2ccad8[_0x2c3c8a][_0xd655('0x10')]&&_0x2ccad8[_0x2c3c8a][_0xd655('0x10')][_0xd655('0x11')]){delete _0x2ccad8[_0x2c3c8a][_0xd655('0x10')][_0xd655('0x11')];}}_0xef88aa({'count':_0x2ccad8[_0xd655('0xe')],'rows':_0x2ccad8});});}};var _0x1d4a02=jayson[_0xd655('0x12')](_0x23b1d7)[_0xd655('0x13')]();_0x1d4a02['on'](_0xd655('0xb'),function(_0x90aaf){logger[_0xd655('0xb')](JSON['stringify'](_0x90aaf));return _0x400d36(_0x90aaf);});_0x1d4a02['listen'](0x232b,_0xd655('0x14'),function(){console[_0xd655('0x15')]('Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232b);return _0x2dfa45(_0xd655('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xaacc=['email','listen','sendMail','message','catch','verifySmtp','account','then','error','values','mailAccounts','length','Imap','password','Smtp','server','http','stringify','127.0.0.1','log','RPC\x20listening\x20on\x20port:','jayson/promise','lodash'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xaacc,0x1b3));var _0xcaac=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xaacc[_0x9cd4c3];return _0x4c9025;};'use strict';var jayson=require(_0xcaac('0x0'));var BPromise=require('bluebird');var _=require(_0xcaac('0x1'));var logger=require('../../../config/logger')(_0xcaac('0x2'));exports[_0xcaac('0x3')]=function(_0x408a5d,_0x5b26fa){return new BPromise(function(_0x3ed184,_0x729101){var _0x1dce0a={'SendMail':function(_0x4003bc){var _0x151766=this;return new Promise(function(_0x386998,_0x3e9504){_0x5b26fa[_0xcaac('0x4')](_0x4003bc['account'],_0x4003bc[_0xcaac('0x5')])['then'](function(_0xec5de2){_0x386998({'code':0xc8,'message':_0xec5de2});})[_0xcaac('0x6')](function(_0x19d7fe){_0x3e9504(_0x151766['error'](0x1f4,_0x19d7fe));});});},'VerifySmtp':function(_0x456530){var _0x238b39=this;return new Promise(function(_0x57eab6,_0x353448){_0x5b26fa[_0xcaac('0x7')](_0x456530[_0xcaac('0x8')])[_0xcaac('0x9')](function(_0xe8649c){_0x57eab6({'code':0xc8,'message':'Verified'});})['catch'](function(_0x196393){_0x353448(_0x238b39[_0xcaac('0xa')](0x1f4,_0x196393));});});},'MailAccounts':function(_0x518ff7){return new Promise(function(_0x5a5042,_0x5bb26b){var _0x50a883=_[_0xcaac('0xb')](_0x408a5d[_0xcaac('0xc')]);for(var _0x49ae9d=0x0;_0x49ae9d<_0x50a883[_0xcaac('0xd')];_0x49ae9d+=0x1){if(_0x50a883[_0x49ae9d]['Imap']&&_0x50a883[_0x49ae9d][_0xcaac('0xe')][_0xcaac('0xf')]){delete _0x50a883[_0x49ae9d]['Imap'][_0xcaac('0xf')];}if(_0x50a883[_0x49ae9d]['Smtp']&&_0x50a883[_0x49ae9d][_0xcaac('0x10')]['pass']){delete _0x50a883[_0x49ae9d][_0xcaac('0x10')]['pass'];}}_0x5a5042({'count':_0x50a883['length'],'rows':_0x50a883});});}};var _0x5697b9=jayson[_0xcaac('0x11')](_0x1dce0a)[_0xcaac('0x12')]();_0x5697b9['on'](_0xcaac('0xa'),function(_0x6c74d){logger[_0xcaac('0xa')](JSON[_0xcaac('0x13')](_0x6c74d));return _0x729101(_0x6c74d);});_0x5697b9['listen'](0x232b,_0xcaac('0x14'),function(){console[_0xcaac('0x15')]('Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232b);return _0x3ed184(_0xcaac('0x16')+0x232b);});});};
\ No newline at end of file
index ff6698c..17ec1f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d31=['log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','ioredis','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening'];(function(_0x3a8789,_0x5bb70b){var _0x19e422=function(_0x49d386){while(--_0x49d386){_0x3a8789['push'](_0x3a8789['shift']());}};_0x19e422(++_0x5bb70b);}(_0x3d31,0x1cb));var _0x13d3=function(_0x4e09b5,_0x113a1f){_0x4e09b5=_0x4e09b5-0x0;var _0x2b304e=_0x3d31[_0x4e09b5];return _0x2b304e;};'use strict';var _=require('lodash');var http=require(_0x13d3('0x0'));var express=require(_0x13d3('0x1'));var sticky=require('sticky-session');var Redis=require(_0x13d3('0x2'));var config=require('../../config/environment');var app=express();var server=http[_0x13d3('0x3')](app);server[_0x13d3('0x4')]=0xdbba0;if(sticky[_0x13d3('0x5')](server,config[_0x13d3('0x6')])){var socketio=require(_0x13d3('0x7'))(server,{'transports':[_0x13d3('0x8'),_0x13d3('0x9')]});config[_0x13d3('0xa')]=_[_0x13d3('0xb')](config[_0x13d3('0xa')],{'host':'localhost','port':0x18eb});socketio[_0x13d3('0xc')](require(_0x13d3('0xd'))({'pubClient':new Redis(config[_0x13d3('0xa')]),'subClient':new Redis(config[_0x13d3('0xa')])}));require(_0x13d3('0xe'))['default']();require(_0x13d3('0xf'))[_0x13d3('0x10')](socketio);require(_0x13d3('0x11'))[_0x13d3('0x10')](app);require(_0x13d3('0x12'))[_0x13d3('0x10')](app);}else{server[_0x13d3('0x13')](_0x13d3('0x14'),function(){console[_0x13d3('0x15')](_0x13d3('0x16'),config[_0x13d3('0x6')]);});}exports=module[_0x13d3('0x17')]=app;
\ No newline at end of file
+var _0xad8b=['localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','listening','exports','lodash','http','express','sticky-session','ioredis','timeout','port','socket.io','websocket','polling','redis','defaults'];(function(_0x4f8dd8,_0x2c6ef6){var _0x558147=function(_0x27d819){while(--_0x27d819){_0x4f8dd8['push'](_0x4f8dd8['shift']());}};_0x558147(++_0x2c6ef6);}(_0xad8b,0xa4));var _0xbad8=function(_0x9c6c1c,_0x21ead9){_0x9c6c1c=_0x9c6c1c-0x0;var _0x594c42=_0xad8b[_0x9c6c1c];return _0x594c42;};'use strict';var _=require(_0xbad8('0x0'));var http=require(_0xbad8('0x1'));var express=require(_0xbad8('0x2'));var sticky=require(_0xbad8('0x3'));var Redis=require(_0xbad8('0x4'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0xbad8('0x5')]=0xdbba0;if(sticky['listen'](server,config[_0xbad8('0x6')])){var socketio=require(_0xbad8('0x7'))(server,{'transports':[_0xbad8('0x8'),_0xbad8('0x9')]});config[_0xbad8('0xa')]=_[_0xbad8('0xb')](config[_0xbad8('0xa')],{'host':_0xbad8('0xc'),'port':0x18eb});socketio[_0xbad8('0xd')](require(_0xbad8('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xbad8('0xa')])}));require(_0xbad8('0xf'))[_0xbad8('0x10')]();require(_0xbad8('0x11'))[_0xbad8('0x10')](socketio);require(_0xbad8('0x12'))[_0xbad8('0x10')](app);require(_0xbad8('0x13'))[_0xbad8('0x10')](app);}else{server['once'](_0xbad8('0x14'),function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xbad8('0x6')]);});}exports=module[_0xbad8('0x15')]=app;
\ No newline at end of file
index ee43231..18c8dee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb458=['bluebird','../../config/logger','http','Request','debug','rpc','routing','error','message','result','catch','exports','jayson/promise'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0xb458,0x103));var _0x8b45=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0xb458[_0x5b077b];return _0x16faf7;};'use strict';var jayson=require(_0x8b45('0x0'));var BPromise=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('routing');var client=jayson['client'][_0x8b45('0x3')]({'port':0x2329});client[_0x8b45('0x4')]=function(_0x141a44,_0x13a8c6){return new BPromise(function(_0x5d51e4,_0x333bc7){return client['request'](_0x141a44,_0x13a8c6)['then'](function(_0xe8d774){logger[_0x8b45('0x5')](_0x8b45('0x6'),_0x8b45('0x7'),_0x141a44,_0x13a8c6,_0xe8d774);if(_0xe8d774[_0x8b45('0x8')]){logger['error'](_0x8b45('0x6'),_0x8b45('0x7'),_0x141a44,_0xe8d774[_0x8b45('0x8')][_0x8b45('0x9')],_0x13a8c6);return _0x333bc7(_0xe8d774[_0x8b45('0x8')]['message']);}else{return _0x5d51e4(_0xe8d774[_0x8b45('0xa')]);}})[_0x8b45('0xb')](function(_0x57faf9){logger['error']('rpc','routing',_0x141a44,_0x57faf9,_0x13a8c6);return _0x333bc7(_0x57faf9);});});};module[_0x8b45('0xc')]=client;
\ No newline at end of file
+var _0x8ccb=['client','http','Request','request','debug','rpc','error','message','result','catch','jayson/promise','bluebird','routing'];(function(_0x447f33,_0x489af1){var _0x4e0bc7=function(_0x460d11){while(--_0x460d11){_0x447f33['push'](_0x447f33['shift']());}};_0x4e0bc7(++_0x489af1);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0x8ccb[_0x1809c5];return _0x5254a4;};'use strict';var jayson=require(_0xb8cc('0x0'));var BPromise=require(_0xb8cc('0x1'));var logger=require('../../config/logger')(_0xb8cc('0x2'));var client=jayson[_0xb8cc('0x3')][_0xb8cc('0x4')]({'port':0x2329});client[_0xb8cc('0x5')]=function(_0x5ede44,_0x4e1ed7){return new BPromise(function(_0x115fdc,_0x3672bc){return client[_0xb8cc('0x6')](_0x5ede44,_0x4e1ed7)['then'](function(_0x46ac6e){logger[_0xb8cc('0x7')](_0xb8cc('0x8'),'routing',_0x5ede44,_0x4e1ed7,_0x46ac6e);if(_0x46ac6e[_0xb8cc('0x9')]){logger[_0xb8cc('0x9')](_0xb8cc('0x8'),'routing',_0x5ede44,_0x46ac6e[_0xb8cc('0x9')][_0xb8cc('0xa')],_0x4e1ed7);return _0x3672bc(_0x46ac6e['error']['message']);}else{return _0x115fdc(_0x46ac6e[_0xb8cc('0xb')]);}})[_0xb8cc('0xc')](function(_0x57522f){logger['error'](_0xb8cc('0x8'),_0xb8cc('0x2'),_0x5ede44,_0x57522f,_0x4e1ed7);return _0x3672bc(_0x57522f);});});};module['exports']=client;
\ No newline at end of file
index a9e4d5b..2815de3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c2b=['then','getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve'];(function(_0x34e7b4,_0x253f27){var _0x400435=function(_0x5b0905){while(--_0x5b0905){_0x34e7b4['push'](_0x34e7b4['shift']());}};_0x400435(++_0x253f27);}(_0x0c2b,0x1b5));var _0xb0c2=function(_0x503444,_0x35bf4d){_0x503444=_0x503444-0x0;var _0x5dd68c=_0x0c2b[_0x503444];return _0x5dd68c;};'use strict';var BPromise=require('bluebird');var server=require(_0xb0c2('0x0'));var Realtime=require(_0xb0c2('0x1'));var user=require(_0xb0c2('0x2'));var interval=require(_0xb0c2('0x3'));var openchannelQueue=require(_0xb0c2('0x4'));var chatQueue=require(_0xb0c2('0x5'));var smsQueue=require(_0xb0c2('0x6'));var mailQueue=require(_0xb0c2('0x7'));var faxQueue=require(_0xb0c2('0x8'));var whatsappQueue=require(_0xb0c2('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xb0c2('0xa')]()[_0xb0c2('0xb')](user[_0xb0c2('0xc')]())[_0xb0c2('0xb')](realtime[_0xb0c2('0xd')]())[_0xb0c2('0xb')](interval[_0xb0c2('0xe')]())['then'](realtime['initIntervals']())[_0xb0c2('0xb')](openchannelQueue[_0xb0c2('0xf')]())[_0xb0c2('0xb')](realtime[_0xb0c2('0x10')]())[_0xb0c2('0xb')](chatQueue[_0xb0c2('0x11')]())[_0xb0c2('0xb')](realtime[_0xb0c2('0x12')]())[_0xb0c2('0xb')](smsQueue[_0xb0c2('0x13')]())['then'](realtime[_0xb0c2('0x14')]())[_0xb0c2('0xb')](mailQueue[_0xb0c2('0x15')]())[_0xb0c2('0xb')](realtime[_0xb0c2('0x16')]())[_0xb0c2('0xb')](faxQueue[_0xb0c2('0x17')]())[_0xb0c2('0xb')](realtime['initFaxQueues']())[_0xb0c2('0xb')](whatsappQueue[_0xb0c2('0x18')]())[_0xb0c2('0xb')](realtime[_0xb0c2('0x19')]())[_0xb0c2('0xb')](function(){return realtime;});}function main(){return server[_0xb0c2('0x1a')](realtime)[_0xb0c2('0xb')](function(_0x1bd016){return initRealtime();})['then'](function(_0x389897){return setInterval(initRealtime,0x1388);})[_0xb0c2('0x1b')](function(_0x3ec852){console['log'](_0x3ec852);});}main();
\ No newline at end of file
+var _0xa57e=['initWhatsappQueues','listen','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues'];(function(_0x9880a0,_0x2bfd2c){var _0x42437b=function(_0x391ad4){while(--_0x391ad4){_0x9880a0['push'](_0x9880a0['shift']());}};_0x42437b(++_0x2bfd2c);}(_0xa57e,0xb8));var _0xea57=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa57e[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0xea57('0x0'));var server=require(_0xea57('0x1'));var Realtime=require(_0xea57('0x2'));var user=require(_0xea57('0x3'));var interval=require(_0xea57('0x4'));var openchannelQueue=require(_0xea57('0x5'));var chatQueue=require(_0xea57('0x6'));var smsQueue=require(_0xea57('0x7'));var mailQueue=require(_0xea57('0x8'));var faxQueue=require(_0xea57('0x9'));var whatsappQueue=require(_0xea57('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xea57('0xb')]()[_0xea57('0xc')](user['getAgents']())[_0xea57('0xc')](realtime[_0xea57('0xd')]())[_0xea57('0xc')](interval[_0xea57('0xe')]())[_0xea57('0xc')](realtime['initIntervals']())[_0xea57('0xc')](openchannelQueue[_0xea57('0xf')]())['then'](realtime[_0xea57('0x10')]())[_0xea57('0xc')](chatQueue[_0xea57('0x11')]())[_0xea57('0xc')](realtime[_0xea57('0x12')]())[_0xea57('0xc')](smsQueue[_0xea57('0x13')]())[_0xea57('0xc')](realtime['initSmsQueues']())['then'](mailQueue['getMailQueues']())['then'](realtime[_0xea57('0x14')]())[_0xea57('0xc')](faxQueue[_0xea57('0x15')]())[_0xea57('0xc')](realtime[_0xea57('0x16')]())[_0xea57('0xc')](whatsappQueue[_0xea57('0x17')]())[_0xea57('0xc')](realtime[_0xea57('0x18')]())[_0xea57('0xc')](function(){return realtime;});}function main(){return server[_0xea57('0x19')](realtime)['then'](function(_0x560538){return initRealtime();})[_0xea57('0xc')](function(_0x314080){return setInterval(initRealtime,0x1388);})['catch'](function(_0x5c9e20){console['log'](_0x5c9e20);});}main();
\ No newline at end of file
index 0f41736..f4aca7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9031=['object','exports','lodash','util','events','init','inherits','rules','prototype','register','concat','isObject','push','sync','activeRules','filter','isNil','orderBy','execute','clone','ignoreFactChanges','ruleRef','name','nextTick','restart','length','condition','matchPath','noop','turn','findRules','prioritize','priority','toJSON','map','toString','consequence','fromJSON','isString','parse'];(function(_0x46a898,_0x1f73ad){var _0x4158ad=function(_0x495d91){while(--_0x495d91){_0x46a898['push'](_0x46a898['shift']());}};_0x4158ad(++_0x1f73ad);}(_0x9031,0x192));var _0x1903=function(_0x3e014d,_0x69433a){_0x3e014d=_0x3e014d-0x0;var _0x1a89a1=_0x9031[_0x3e014d];return _0x1a89a1;};'use strict';var _=require(_0x1903('0x0'));var util=require(_0x1903('0x1'));var EventEmitter=require(_0x1903('0x2'))['EventEmitter'];function RuleEngine(_0x264e17,_0x4f9910){this[_0x1903('0x3')]();if(!_['isNil'](_0x264e17)){this['register'](_0x264e17);}if(_0x4f9910){this['ignoreFactChanges']=_0x4f9910['ignoreFactChanges'];}return this;}util[_0x1903('0x4')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1903('0x3')]=function(_0x10f1d3){this[_0x1903('0x5')]=[];this['activeRules']=[];};RuleEngine[_0x1903('0x6')][_0x1903('0x7')]=function(_0x184b2f){if(Array['isArray'](_0x184b2f)){this[_0x1903('0x5')]=this[_0x1903('0x5')][_0x1903('0x8')](_0x184b2f);}else if(_0x184b2f!==null&&_[_0x1903('0x9')](_0x184b2f)){this[_0x1903('0x5')][_0x1903('0xa')](_0x184b2f);}this[_0x1903('0xb')]();};RuleEngine['prototype'][_0x1903('0xb')]=function(){this[_0x1903('0xc')]=this['rules'][_0x1903('0xd')](function(_0x1ffcb7){if(_[_0x1903('0xe')](_0x1ffcb7['on'])){_0x1ffcb7['on']=!![];}if(_0x1ffcb7['on']===!![]){return _0x1ffcb7;}});this['activeRules']=_[_0x1903('0xf')](this[_0x1903('0xc')],['p'],['asc']);};RuleEngine[_0x1903('0x6')][_0x1903('0x10')]=function(_0x410617,_0x4ea31e){var _0x1df6fe=![];_0x410617['result']=!![];var _0x462918=_[_0x1903('0x11')](_0x410617);var _0x376808=_[_0x1903('0x11')](_0x410617);var _0x182de2=this['activeRules'];var _0x37d848=[];var _0x5e4e49=this[_0x1903('0x12')];(function FnRuleLoop(_0x3c29c9){var _0x107c0a={'rules':function(){return _0x182de2;},'rule':function(){return _0x182de2[_0x3c29c9];},'when':function(_0x1ff228){if(_0x1ff228){var _0x651811=_0x182de2[_0x3c29c9]['consequence'];_0x651811[_0x1903('0x13')]=_0x182de2[_0x3c29c9]['id']||_0x182de2[_0x3c29c9][_0x1903('0x14')]||'index_'+_0x3c29c9;process[_0x1903('0x15')](function(){_0x37d848[_0x1903('0xa')](_0x651811['ruleRef']);_0x651811['call'](_0x462918,_0x107c0a);});}else{process[_0x1903('0x15')](function(){_0x107c0a['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x1df6fe=!![];return FnRuleLoop(0x0);},'next':function(_0x4265f9){if(!_0x5e4e49&&!_['isEqual'](_0x376808,_0x462918)){_0x376808=_[_0x1903('0x11')](_0x462918);process[_0x1903('0x15')](function(){_0x107c0a[_0x1903('0x16')]();});}else{process[_0x1903('0x15')](function(){if(_[_0x1903('0xe')](_0x4265f9)){return FnRuleLoop(_0x3c29c9+0x1);}else{return FnRuleLoop(_0x4265f9);}});}}};if(_0x3c29c9<_0x182de2[_0x1903('0x17')]&&_0x1df6fe===![]){var _0xa9a8d5=_0x182de2[_0x3c29c9][_0x1903('0x18')];_0xa9a8d5['call'](_0x462918,_0x107c0a);}else{process['nextTick'](function(){_0x462918[_0x1903('0x19')]=_0x37d848;return _0x4ea31e?_0x4ea31e(_0x462918):_[_0x1903('0x1a')]();});}}(0x0));};RuleEngine[_0x1903('0x6')]['findRules']=function(_0x389de7){if(_[_0x1903('0xe')](_0x389de7)){return this[_0x1903('0x5')];}else{var _0x48255a=_['matches'](_0x389de7);return _['filter'](this[_0x1903('0x5')],_0x48255a);}};RuleEngine['prototype'][_0x1903('0x1b')]=function(_0x47a4b1,_0x10192e){var _0x5cf5ad=_0x47a4b1==='on'||_0x47a4b1==='ON'?!![]:![];var _0xf93ea6=this[_0x1903('0x1c')](_0x10192e);for(var _0x19902a=0x0,_0x5f8f67=_0xf93ea6[_0x1903('0x17')];_0x19902a<_0x5f8f67;_0x19902a+=0x1){_0xf93ea6[_0x19902a]['on']=_0x5cf5ad;}this['sync']();};RuleEngine[_0x1903('0x6')][_0x1903('0x1d')]=function(_0x177e50,_0x3d109c){_0x177e50=parseInt(_0x177e50,0xa);var _0x5428b4=this[_0x1903('0x1c')](_0x3d109c);for(var _0x716781=0x0,_0x3bb0e7=_0x5428b4[_0x1903('0x17')];_0x716781<_0x3bb0e7;_0x716781+=0x1){_0x5428b4[_0x716781][_0x1903('0x1e')]=_0x177e50;}this['sync']();};RuleEngine['prototype'][_0x1903('0x1f')]=function(){var _0x3ed74e=this[_0x1903('0x5')];if(_0x3ed74e instanceof Array){_0x3ed74e=_0x3ed74e[_0x1903('0x20')](function(_0x47d537){_0x47d537['condition']=_0x47d537[_0x1903('0x18')][_0x1903('0x21')]();_0x47d537[_0x1903('0x22')]=_0x47d537[_0x1903('0x22')][_0x1903('0x21')]();return _0x47d537;});}else if(!_[_0x1903('0xe')](_0x3ed74e)){_0x3ed74e[_0x1903('0x18')]=_0x3ed74e['condition']['toString']();_0x3ed74e['consequence']=_0x3ed74e[_0x1903('0x22')][_0x1903('0x21')]();}return _0x3ed74e;};RuleEngine[_0x1903('0x6')][_0x1903('0x23')]=function(_0x3f325b){this[_0x1903('0x3')]();if(_[_0x1903('0x24')](_0x3f325b)){_0x3f325b=JSON[_0x1903('0x25')](_0x3f325b);}if(_0x3f325b instanceof Array){_0x3f325b=_0x3f325b[_0x1903('0x20')](function(_0x1decbc){_0x1decbc['condition']=eval('('+_0x1decbc[_0x1903('0x18')]+')');_0x1decbc[_0x1903('0x22')]=eval('('+_0x1decbc[_0x1903('0x22')]+')');return _0x1decbc;});}else if(_0x3f325b!==null&&typeof _0x3f325b==_0x1903('0x26')){_0x3f325b['condition']=eval('('+_0x3f325b['condition']+')');_0x3f325b['consequence']=eval('('+_0x3f325b[_0x1903('0x22')]+')');}this['register'](_0x3f325b);};module[_0x1903('0x27')]=RuleEngine;
\ No newline at end of file
+var _0x134e=['exports','lodash','util','events','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','call','nextTick','next','restart','length','condition','matchPath','findRules','matches','prioritize','priority','toJSON','map','toString','fromJSON','isString','object'];(function(_0x5696d6,_0x595027){var _0x1efc45=function(_0x1a16e8){while(--_0x1a16e8){_0x5696d6['push'](_0x5696d6['shift']());}};_0x1efc45(++_0x595027);}(_0x134e,0x1e5));var _0xe134=function(_0x18c6d5,_0x49beca){_0x18c6d5=_0x18c6d5-0x0;var _0x47b85a=_0x134e[_0x18c6d5];return _0x47b85a;};'use strict';var _=require(_0xe134('0x0'));var util=require(_0xe134('0x1'));var EventEmitter=require(_0xe134('0x2'))[_0xe134('0x3')];function RuleEngine(_0x2166b0,_0x316d35){this[_0xe134('0x4')]();if(!_[_0xe134('0x5')](_0x2166b0)){this[_0xe134('0x6')](_0x2166b0);}if(_0x316d35){this[_0xe134('0x7')]=_0x316d35[_0xe134('0x7')];}return this;}util[_0xe134('0x8')](RuleEngine,EventEmitter);RuleEngine[_0xe134('0x9')][_0xe134('0x4')]=function(_0x1c35be){this[_0xe134('0xa')]=[];this[_0xe134('0xb')]=[];};RuleEngine['prototype'][_0xe134('0x6')]=function(_0x34e98f){if(Array[_0xe134('0xc')](_0x34e98f)){this[_0xe134('0xa')]=this[_0xe134('0xa')][_0xe134('0xd')](_0x34e98f);}else if(_0x34e98f!==null&&_['isObject'](_0x34e98f)){this[_0xe134('0xa')][_0xe134('0xe')](_0x34e98f);}this[_0xe134('0xf')]();};RuleEngine['prototype'][_0xe134('0xf')]=function(){this[_0xe134('0xb')]=this[_0xe134('0xa')][_0xe134('0x10')](function(_0x394c67){if(_[_0xe134('0x5')](_0x394c67['on'])){_0x394c67['on']=!![];}if(_0x394c67['on']===!![]){return _0x394c67;}});this[_0xe134('0xb')]=_[_0xe134('0x11')](this[_0xe134('0xb')],['p'],[_0xe134('0x12')]);};RuleEngine['prototype'][_0xe134('0x13')]=function(_0x170db4,_0x3fb7ec){var _0x2b2199=![];_0x170db4[_0xe134('0x14')]=!![];var _0x349ceb=_[_0xe134('0x15')](_0x170db4);var _0x1bfa22=_[_0xe134('0x15')](_0x170db4);var _0x27561f=this[_0xe134('0xb')];var _0x2c1722=[];var _0x17df19=this[_0xe134('0x7')];(function FnRuleLoop(_0x4bdcc2){var _0x19dbbe={'rules':function(){return _0x27561f;},'rule':function(){return _0x27561f[_0x4bdcc2];},'when':function(_0x36d029){if(_0x36d029){var _0x2590a8=_0x27561f[_0x4bdcc2][_0xe134('0x16')];_0x2590a8[_0xe134('0x17')]=_0x27561f[_0x4bdcc2]['id']||_0x27561f[_0x4bdcc2][_0xe134('0x18')]||_0xe134('0x19')+_0x4bdcc2;process['nextTick'](function(){_0x2c1722[_0xe134('0xe')](_0x2590a8['ruleRef']);_0x2590a8[_0xe134('0x1a')](_0x349ceb,_0x19dbbe);});}else{process[_0xe134('0x1b')](function(){_0x19dbbe[_0xe134('0x1c')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x2b2199=!![];return FnRuleLoop(0x0);},'next':function(_0x70b03e){if(!_0x17df19&&!_['isEqual'](_0x1bfa22,_0x349ceb)){_0x1bfa22=_[_0xe134('0x15')](_0x349ceb);process['nextTick'](function(){_0x19dbbe[_0xe134('0x1d')]();});}else{process['nextTick'](function(){if(_['isNil'](_0x70b03e)){return FnRuleLoop(_0x4bdcc2+0x1);}else{return FnRuleLoop(_0x70b03e);}});}}};if(_0x4bdcc2<_0x27561f[_0xe134('0x1e')]&&_0x2b2199===![]){var _0x764bcd=_0x27561f[_0x4bdcc2][_0xe134('0x1f')];_0x764bcd[_0xe134('0x1a')](_0x349ceb,_0x19dbbe);}else{process[_0xe134('0x1b')](function(){_0x349ceb[_0xe134('0x20')]=_0x2c1722;return _0x3fb7ec?_0x3fb7ec(_0x349ceb):_['noop']();});}}(0x0));};RuleEngine[_0xe134('0x9')][_0xe134('0x21')]=function(_0x30765b){if(_['isNil'](_0x30765b)){return this[_0xe134('0xa')];}else{var _0x15bacc=_[_0xe134('0x22')](_0x30765b);return _[_0xe134('0x10')](this[_0xe134('0xa')],_0x15bacc);}};RuleEngine[_0xe134('0x9')]['turn']=function(_0x43ac81,_0x3a1f26){var _0xdba25e=_0x43ac81==='on'||_0x43ac81==='ON'?!![]:![];var _0x25a8d8=this[_0xe134('0x21')](_0x3a1f26);for(var _0x676935=0x0,_0x249727=_0x25a8d8[_0xe134('0x1e')];_0x676935<_0x249727;_0x676935+=0x1){_0x25a8d8[_0x676935]['on']=_0xdba25e;}this['sync']();};RuleEngine[_0xe134('0x9')][_0xe134('0x23')]=function(_0x514c35,_0x4b9630){_0x514c35=parseInt(_0x514c35,0xa);var _0x39ddfb=this[_0xe134('0x21')](_0x4b9630);for(var _0x5343d3=0x0,_0x477584=_0x39ddfb[_0xe134('0x1e')];_0x5343d3<_0x477584;_0x5343d3+=0x1){_0x39ddfb[_0x5343d3][_0xe134('0x24')]=_0x514c35;}this[_0xe134('0xf')]();};RuleEngine[_0xe134('0x9')][_0xe134('0x25')]=function(){var _0x448bfb=this[_0xe134('0xa')];if(_0x448bfb instanceof Array){_0x448bfb=_0x448bfb[_0xe134('0x26')](function(_0x2c0428){_0x2c0428[_0xe134('0x1f')]=_0x2c0428['condition'][_0xe134('0x27')]();_0x2c0428[_0xe134('0x16')]=_0x2c0428[_0xe134('0x16')][_0xe134('0x27')]();return _0x2c0428;});}else if(!_[_0xe134('0x5')](_0x448bfb)){_0x448bfb[_0xe134('0x1f')]=_0x448bfb[_0xe134('0x1f')][_0xe134('0x27')]();_0x448bfb[_0xe134('0x16')]=_0x448bfb[_0xe134('0x16')]['toString']();}return _0x448bfb;};RuleEngine[_0xe134('0x9')][_0xe134('0x28')]=function(_0x970a55){this[_0xe134('0x4')]();if(_[_0xe134('0x29')](_0x970a55)){_0x970a55=JSON['parse'](_0x970a55);}if(_0x970a55 instanceof Array){_0x970a55=_0x970a55[_0xe134('0x26')](function(_0x5d6782){_0x5d6782[_0xe134('0x1f')]=eval('('+_0x5d6782[_0xe134('0x1f')]+')');_0x5d6782['consequence']=eval('('+_0x5d6782[_0xe134('0x16')]+')');return _0x5d6782;});}else if(_0x970a55!==null&&typeof _0x970a55==_0xe134('0x2a')){_0x970a55[_0xe134('0x1f')]=eval('('+_0x970a55[_0xe134('0x1f')]+')');_0x970a55[_0xe134('0x16')]=eval('('+_0x970a55[_0xe134('0x16')]+')');}this['register'](_0x970a55);};module[_0xe134('0x2b')]=RuleEngine;
\ No newline at end of file
index 523855d..7205f69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x2a4d1e,_0x4ee12e){var _0x35c128=function(_0x6d1cd4){while(--_0x6d1cd4){_0x2a4d1e['push'](_0x2a4d1e['shift']());}};_0x35c128(++_0x4ee12e);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
+var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x19e764,_0x50f102){var _0x10e56f=function(_0x1c09f3){while(--_0x1c09f3){_0x19e764['push'](_0x19e764['shift']());}};_0x10e56f(++_0x50f102);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});};
\ No newline at end of file
index b56936e..3fd8f62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc9d=['lodash','moment','md5','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','CurrentCapacity','Capacity','working','idle','prototype','updateRealtime','mail','chat','openchannel','fax','whatsapp','length','getChannelStatus','StatusTime','toNumber','faxCurrentCapacity','smsStatusTime','busy','emit','user:save','exports'];(function(_0x28f323,_0x162d30){var _0x166aa5=function(_0x4fe808){while(--_0x4fe808){_0x28f323['push'](_0x28f323['shift']());}};_0x166aa5(++_0x162d30);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x231d9b,_0xcdd962){_0x231d9b=_0x231d9b-0x0;var _0x21a682=_0xbc9d[_0x231d9b];return _0x21a682;};'use strict';var _=require(_0xdbc9('0x0'));var moment=require(_0xdbc9('0x1'));var md5=require(_0xdbc9('0x2'));var Redis=require(_0xdbc9('0x3'));var config=require(_0xdbc9('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0xdbc9('0x5'),'port':0x18eb});var io=require(_0xdbc9('0x6'))(new Redis(config[_0xdbc9('0x7')]));function Agent(_0x4a32b4){this['id']=_0x4a32b4['id']||0x0;this[_0xdbc9('0x8')]=_0x4a32b4[_0xdbc9('0x8')]||'';this[_0xdbc9('0x9')]=_0x4a32b4['online']||!![];this[_0xdbc9('0xa')]=_0x4a32b4[_0xdbc9('0xa')]||![];this[_0xdbc9('0xb')]=_0x4a32b4['chatPause']||![];this[_0xdbc9('0xc')]=_0x4a32b4['mailPause']||![];this['faxPause']=_0x4a32b4[_0xdbc9('0xd')]||![];this[_0xdbc9('0xe')]=_0x4a32b4[_0xdbc9('0xe')]||![];this[_0xdbc9('0xf')]=_0x4a32b4['openchannelPause']||![];this[_0xdbc9('0x10')]=_0xdbc9('0x11');this[_0xdbc9('0x12')]=0x0;this[_0xdbc9('0x13')]=_0x4a32b4[_0xdbc9('0x13')]||0x0;this[_0xdbc9('0x14')]=0x0;this['mailStatus']='unknown';this[_0xdbc9('0x15')]=0x0;this[_0xdbc9('0x16')]=_0x4a32b4[_0xdbc9('0x16')]||0x0;this[_0xdbc9('0x17')]=0x0;this[_0xdbc9('0x18')]='unknown';this[_0xdbc9('0x19')]=0x0;this[_0xdbc9('0x1a')]=_0x4a32b4[_0xdbc9('0x1a')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xdbc9('0x1b')]=_0xdbc9('0x11');this['smsStatusTime']=0x0;this[_0xdbc9('0x1c')]=_0x4a32b4[_0xdbc9('0x1c')]||0x0;this[_0xdbc9('0x1d')]=0x0;this[_0xdbc9('0x1e')]=_0xdbc9('0x11');this[_0xdbc9('0x1f')]=0x0;this[_0xdbc9('0x20')]=_0x4a32b4[_0xdbc9('0x20')]||0x0;this[_0xdbc9('0x21')]=0x0;this[_0xdbc9('0x22')]='unknown';this[_0xdbc9('0x23')]=0x0;this['openchannelCapacity']=_0x4a32b4[_0xdbc9('0x24')]||0x0;this[_0xdbc9('0x25')]=0x0;this['busy']=![];this[_0xdbc9('0x26')]=undefined;this['md5']='';this['updateRealtime']();}Agent['prototype']['getChannelStatus']=function(_0x2f229c){if(this[_0x2f229c+_0xdbc9('0x27')]>0x0){if(this[_0x2f229c+'Capacity']>0x0&&this[_0x2f229c+_0xdbc9('0x27')]>=this[_0x2f229c+_0xdbc9('0x28')]){return'maxcapacity';}else{return _0xdbc9('0x29');}}else{return _0xdbc9('0x2a');}};Agent[_0xdbc9('0x2b')][_0xdbc9('0x2c')]=function(){var _0x3400e7=[_0xdbc9('0x2d'),_0xdbc9('0x2e'),_0xdbc9('0x2f'),_0xdbc9('0x30'),'sms',_0xdbc9('0x31')];for(var _0xe309ae=0x0;_0xe309ae<_0x3400e7[_0xdbc9('0x32')];_0xe309ae+=0x1){var _0x1053ca=this[_0xdbc9('0x33')](_0x3400e7[_0xe309ae]);if(this[_0x3400e7[_0xe309ae]+'Status']!==_0x1053ca){this[_0x3400e7[_0xe309ae]+_0xdbc9('0x34')]=_[_0xdbc9('0x35')](moment()['format']('x'));}this[_0x3400e7[_0xe309ae]+'Status']=_0x1053ca;}var _0x45aebe={'id':this['id'],'name':this[_0xdbc9('0x8')],'online':this[_0xdbc9('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0xdbc9('0xb')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0xdbc9('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xdbc9('0x12')],'chatCapacity':this[_0xdbc9('0x13')],'chatCurrentCapacity':this[_0xdbc9('0x14')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xdbc9('0x15')],'mailCapacity':this[_0xdbc9('0x16')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xdbc9('0x19')],'faxCapacity':this[_0xdbc9('0x1a')],'faxCurrentCapacity':this[_0xdbc9('0x36')],'smsStatus':this[_0xdbc9('0x1b')],'smsStatusTime':this[_0xdbc9('0x37')],'smsCapacity':this[_0xdbc9('0x1c')],'smsCurrentCapacity':this[_0xdbc9('0x1d')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xdbc9('0x1f')],'whatsappCapacity':this[_0xdbc9('0x20')],'whatsappCurrentCapacity':this[_0xdbc9('0x21')],'openchannelStatus':this[_0xdbc9('0x22')],'openchannelStatusTime':this[_0xdbc9('0x23')],'openchannelCapacity':this[_0xdbc9('0x24')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xdbc9('0x38')],'busyQueue':this['busyQueue']};var _0x4b0a16=md5(JSON['stringify'](_0x45aebe));if(this['md5']!==_0x4b0a16){this['md5']=_0x4b0a16;io[_0xdbc9('0x39')](_0xdbc9('0x3a'),_0x45aebe);}};module[_0xdbc9('0x3b')]=Agent;
\ No newline at end of file
+var _0x7e22=['mail','chat','openchannel','fax','whatsapp','getChannelStatus','toNumber','format','Status','mailStatus','faxStatusTime','smsCurrentCapacity','whatsappStatus','busyQueue','stringify','emit','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','CurrentCapacity','Capacity','maxcapacity','working'];(function(_0x2605b2,_0x463e51){var _0x47a047=function(_0x22dabf){while(--_0x22dabf){_0x2605b2['push'](_0x2605b2['shift']());}};_0x47a047(++_0x463e51);}(_0x7e22,0x1d8));var _0x27e2=function(_0x33f933,_0x12d7c3){_0x33f933=_0x33f933-0x0;var _0xf24bb8=_0x7e22[_0x33f933];return _0xf24bb8;};'use strict';var _=require(_0x27e2('0x0'));var moment=require('moment');var md5=require(_0x27e2('0x1'));var Redis=require(_0x27e2('0x2'));var config=require(_0x27e2('0x3'));config[_0x27e2('0x4')]=_[_0x27e2('0x5')](config[_0x27e2('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x27e2('0x6'))(new Redis(config['redis']));function Agent(_0x3b7d1e){this['id']=_0x3b7d1e['id']||0x0;this[_0x27e2('0x7')]=_0x3b7d1e[_0x27e2('0x7')]||'';this[_0x27e2('0x8')]=_0x3b7d1e['online']||!![];this[_0x27e2('0x9')]=_0x3b7d1e[_0x27e2('0x9')]||![];this[_0x27e2('0xa')]=_0x3b7d1e[_0x27e2('0xa')]||![];this[_0x27e2('0xb')]=_0x3b7d1e[_0x27e2('0xb')]||![];this[_0x27e2('0xc')]=_0x3b7d1e[_0x27e2('0xc')]||![];this['smsPause']=_0x3b7d1e[_0x27e2('0xd')]||![];this[_0x27e2('0xe')]=_0x3b7d1e['openchannelPause']||![];this[_0x27e2('0xf')]=_0x27e2('0x10');this[_0x27e2('0x11')]=0x0;this[_0x27e2('0x12')]=_0x3b7d1e['chatCapacity']||0x0;this[_0x27e2('0x13')]=0x0;this['mailStatus']=_0x27e2('0x10');this[_0x27e2('0x14')]=0x0;this[_0x27e2('0x15')]=_0x3b7d1e[_0x27e2('0x15')]||0x0;this[_0x27e2('0x16')]=0x0;this['faxStatus']=_0x27e2('0x10');this['faxStatusTime']=0x0;this[_0x27e2('0x17')]=_0x3b7d1e[_0x27e2('0x17')]||0x0;this[_0x27e2('0x18')]=0x0;this[_0x27e2('0x19')]=_0x27e2('0x10');this[_0x27e2('0x1a')]=0x0;this[_0x27e2('0x1b')]=_0x3b7d1e[_0x27e2('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']=_0x27e2('0x10');this[_0x27e2('0x1c')]=0x0;this['whatsappCapacity']=_0x3b7d1e[_0x27e2('0x1d')]||0x0;this[_0x27e2('0x1e')]=0x0;this[_0x27e2('0x1f')]=_0x27e2('0x10');this[_0x27e2('0x20')]=0x0;this['openchannelCapacity']=_0x3b7d1e[_0x27e2('0x21')]||0x0;this[_0x27e2('0x22')]=0x0;this[_0x27e2('0x23')]=![];this['busyQueue']=undefined;this[_0x27e2('0x1')]='';this[_0x27e2('0x24')]();}Agent['prototype']['getChannelStatus']=function(_0x227eab){if(this[_0x227eab+_0x27e2('0x25')]>0x0){if(this[_0x227eab+_0x27e2('0x26')]>0x0&&this[_0x227eab+_0x27e2('0x25')]>=this[_0x227eab+_0x27e2('0x26')]){return _0x27e2('0x27');}else{return _0x27e2('0x28');}}else{return'idle';}};Agent['prototype'][_0x27e2('0x24')]=function(){var _0x1f1b14=[_0x27e2('0x29'),_0x27e2('0x2a'),_0x27e2('0x2b'),_0x27e2('0x2c'),'sms',_0x27e2('0x2d')];for(var _0x30b0a9=0x0;_0x30b0a9<_0x1f1b14['length'];_0x30b0a9+=0x1){var _0x212e9a=this[_0x27e2('0x2e')](_0x1f1b14[_0x30b0a9]);if(this[_0x1f1b14[_0x30b0a9]+'Status']!==_0x212e9a){this[_0x1f1b14[_0x30b0a9]+'StatusTime']=_[_0x27e2('0x2f')](moment()[_0x27e2('0x30')]('x'));}this[_0x1f1b14[_0x30b0a9]+_0x27e2('0x31')]=_0x212e9a;}var _0x46ca56={'id':this['id'],'name':this[_0x27e2('0x7')],'online':this[_0x27e2('0x8')],'voicePause':this[_0x27e2('0x9')],'chatPause':this[_0x27e2('0xa')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0x27e2('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x27e2('0xf')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x27e2('0x12')],'chatCurrentCapacity':this[_0x27e2('0x13')],'mailStatus':this[_0x27e2('0x32')],'mailStatusTime':this[_0x27e2('0x14')],'mailCapacity':this[_0x27e2('0x15')],'mailCurrentCapacity':this[_0x27e2('0x16')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x27e2('0x33')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x27e2('0x19')],'smsStatusTime':this[_0x27e2('0x1a')],'smsCapacity':this[_0x27e2('0x1b')],'smsCurrentCapacity':this[_0x27e2('0x34')],'whatsappStatus':this[_0x27e2('0x35')],'whatsappStatusTime':this[_0x27e2('0x1c')],'whatsappCapacity':this[_0x27e2('0x1d')],'whatsappCurrentCapacity':this[_0x27e2('0x1e')],'openchannelStatus':this[_0x27e2('0x1f')],'openchannelStatusTime':this[_0x27e2('0x20')],'openchannelCapacity':this[_0x27e2('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x27e2('0x36')]};var _0x576678=md5(JSON[_0x27e2('0x37')](_0x46ca56));if(this['md5']!==_0x576678){this[_0x27e2('0x1')]=_0x576678;io[_0x27e2('0x38')]('user:save',_0x46ca56);}};module['exports']=Agent;
\ No newline at end of file
index 71b0146..ef82afa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc02=['strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','chatPause','available','format','emit','chat_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x1cb4ad,_0x43db46){var _0x1f3593=function(_0x2ecfcc){while(--_0x2ecfcc){_0x1cb4ad['push'](_0x1cb4ad['shift']());}};_0x1f3593(++_0x43db46);}(_0xdc02,0x118));var _0x2dc0=function(_0x2ee974,_0x1cceb5){_0x2ee974=_0x2ee974-0x0;var _0x20c5fb=_0xdc02[_0x2ee974];return _0x20c5fb;};'use strict';var _=require(_0x2dc0('0x0'));var md5=require(_0x2dc0('0x1'));var util=require('util');var Redis=require(_0x2dc0('0x2'));var config=require(_0x2dc0('0x3'));config[_0x2dc0('0x4')]=_[_0x2dc0('0x5')](config['redis'],{'host':_0x2dc0('0x6'),'port':0x18eb});var io=require(_0x2dc0('0x7'))(new Redis(config[_0x2dc0('0x4')]));function ChatQueue(_0x29a1b0){this['id']=_0x29a1b0['id']||0x0;this[_0x2dc0('0x8')]=_0x29a1b0[_0x2dc0('0x8')]||'';this[_0x2dc0('0x9')]=_0x29a1b0[_0x2dc0('0x9')]||0xa;this['strategy']=_0x29a1b0[_0x2dc0('0xa')]||_0x2dc0('0xb');this[_0x2dc0('0xc')]=_0x29a1b0[_0x2dc0('0xc')];this[_0x2dc0('0xd')]={};this[_0x2dc0('0xe')]=0x0;this['md5']='';this[_0x2dc0('0xf')]();this[_0x2dc0('0x10')]();}ChatQueue['prototype'][_0x2dc0('0xf')]=function(){var _0x8ca389=this[_0x2dc0('0xd')][_0x2dc0('0x11')];this[_0x2dc0('0xd')]=_[_0x2dc0('0x12')](this[_0x2dc0('0xc')],'id');this[_0x2dc0('0xd')][_0x2dc0('0x11')]=_0x8ca389;};ChatQueue[_0x2dc0('0x13')][_0x2dc0('0x10')]=function(){this[_0x2dc0('0x14')]=0x0;this[_0x2dc0('0x15')]=0x0;for(var _0x1f941d=0x0;_0x1f941d<this['Agents'][_0x2dc0('0x16')];_0x1f941d+=0x1){if(this['Agents'][_0x1f941d][_0x2dc0('0x17')]){this[_0x2dc0('0x14')]+=0x1;}if(this[_0x2dc0('0xc')][_0x1f941d][_0x2dc0('0x18')]){this['paused']+=0x1;}}this[_0x2dc0('0x19')]=this[_0x2dc0('0x14')]-this[_0x2dc0('0x15')];this['available']=this[_0x2dc0('0x19')]>=0x0?this[_0x2dc0('0x19')]:0x0;var _0x3ea85d={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2dc0('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x2dc0('0xe')]};var _0x35fef5=md5(JSON['stringify'](_0x3ea85d));if(this['md5']!==_0x35fef5){this[_0x2dc0('0x1')]=_0x35fef5;io['to'](util[_0x2dc0('0x1a')]('chat:queue:%s',_0x3ea85d[_0x2dc0('0x8')]))[_0x2dc0('0x1b')](_0x2dc0('0x1c'),_0x3ea85d);}};module['exports']=ChatQueue;
\ No newline at end of file
+var _0x735b=['mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','online','chatPause','paused','available','name','stringify','format','chat:queue:%s','lodash','md5','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents'];(function(_0x395efb,_0x476dae){var _0x3766dd=function(_0x3a1b82){while(--_0x3a1b82){_0x395efb['push'](_0x395efb['shift']());}};_0x3766dd(++_0x476dae);}(_0x735b,0x12e));var _0xb735=function(_0x305f04,_0x2d8bae){_0x305f04=_0x305f04-0x0;var _0x4d3d0b=_0x735b[_0x305f04];return _0x4d3d0b;};'use strict';var _=require(_0xb735('0x0'));var md5=require(_0xb735('0x1'));var util=require('util');var Redis=require(_0xb735('0x2'));var config=require(_0xb735('0x3'));config[_0xb735('0x4')]=_['defaults'](config[_0xb735('0x4')],{'host':_0xb735('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb735('0x4')]));function ChatQueue(_0x5f4ab5){this['id']=_0x5f4ab5['id']||0x0;this['name']=_0x5f4ab5['name']||'';this[_0xb735('0x6')]=_0x5f4ab5[_0xb735('0x6')]||0xa;this[_0xb735('0x7')]=_0x5f4ab5[_0xb735('0x7')]||_0xb735('0x8');this['Agents']=_0x5f4ab5[_0xb735('0x9')];this[_0xb735('0xa')]={};this[_0xb735('0xb')]=0x0;this[_0xb735('0x1')]='';this[_0xb735('0xc')]();this[_0xb735('0xd')]();}ChatQueue[_0xb735('0xe')][_0xb735('0xc')]=function(){var _0x5b4d2e=this[_0xb735('0xa')]['_rr'];this[_0xb735('0xa')]=_['map'](this[_0xb735('0x9')],'id');this[_0xb735('0xa')][_0xb735('0xf')]=_0x5b4d2e;};ChatQueue[_0xb735('0xe')][_0xb735('0xd')]=function(){this[_0xb735('0x10')]=0x0;this['paused']=0x0;for(var _0x192f29=0x0;_0x192f29<this[_0xb735('0x9')][_0xb735('0x11')];_0x192f29+=0x1){if(this['Agents'][_0x192f29][_0xb735('0x12')]){this[_0xb735('0x10')]+=0x1;}if(this[_0xb735('0x9')][_0x192f29][_0xb735('0x13')]){this[_0xb735('0x14')]+=0x1;}}this[_0xb735('0x15')]=this['loggedIn']-this['paused'];this[_0xb735('0x15')]=this[_0xb735('0x15')]>=0x0?this['available']:0x0;var _0x2022fa={'id':this['id'],'available':this[_0xb735('0x15')],'loggedIn':this[_0xb735('0x10')],'name':this[_0xb735('0x16')],'paused':this['paused'],'waiting':this[_0xb735('0xb')]};var _0x427ab2=md5(JSON[_0xb735('0x17')](_0x2022fa));if(this[_0xb735('0x1')]!==_0x427ab2){this[_0xb735('0x1')]=_0x427ab2;io['to'](util[_0xb735('0x18')](_0xb735('0x19'),_0x2022fa[_0xb735('0x16')]))['emit']('chat_queue:save',_0x2022fa);}};module['exports']=ChatQueue;
\ No newline at end of file
index 733553b..49cd9bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x4a092a,_0xe64422){var _0x2df711=function(_0x137c1c){while(--_0x137c1c){_0x4a092a['push'](_0x4a092a['shift']());}};_0x2df711(++_0xe64422);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227<this[_0x0a9e('0xf')][_0x0a9e('0x13')];_0x2b4227+=0x1){if(this[_0x0a9e('0xf')][_0x2b4227]['online']){this[_0x0a9e('0x11')]+=0x1;}if(this['Agents'][_0x2b4227][_0x0a9e('0x14')]){this['paused']+=0x1;}}this[_0x0a9e('0x15')]=this[_0x0a9e('0x11')]-this['paused'];this[_0x0a9e('0x15')]=this['available']>=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue;
\ No newline at end of file
+var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x464d83,_0x17252b){var _0x218af3=function(_0x217b0b){while(--_0x217b0b){_0x464d83['push'](_0x464d83['shift']());}};_0x218af3(++_0x17252b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227<this[_0x0a9e('0xf')][_0x0a9e('0x13')];_0x2b4227+=0x1){if(this[_0x0a9e('0xf')][_0x2b4227]['online']){this[_0x0a9e('0x11')]+=0x1;}if(this['Agents'][_0x2b4227][_0x0a9e('0x14')]){this['paused']+=0x1;}}this[_0x0a9e('0x15')]=this[_0x0a9e('0x11')]-this['paused'];this[_0x0a9e('0x15')]=this['available']>=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue;
\ No newline at end of file
index 5da18a2..29abc3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e22=['name','Intervals'];(function(_0x1b04ab,_0x2b45e6){var _0x499606=function(_0xf2cac9){while(--_0xf2cac9){_0x1b04ab['push'](_0x1b04ab['shift']());}};_0x499606(++_0x2b45e6);}(_0x1e22,0x1aa));var _0x21e2=function(_0x50eab9,_0x1a6d00){_0x50eab9=_0x50eab9-0x0;var _0x102a2f=_0x1e22[_0x50eab9];return _0x102a2f;};'use strict';function Interval(_0x1f4b7d){this['id']=_0x1f4b7d['id']||0x0;this[_0x21e2('0x0')]=_0x1f4b7d[_0x21e2('0x0')]||'';this[_0x21e2('0x1')]=_0x1f4b7d[_0x21e2('0x1')]||{};}module['exports']=Interval;
\ No newline at end of file
+var _0x22f0=['exports','name','Intervals'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0x22f0,0xd9));var _0x022f=function(_0x538967,_0x464c86){_0x538967=_0x538967-0x0;var _0x30bc9b=_0x22f0[_0x538967];return _0x30bc9b;};'use strict';function Interval(_0x8bbb86){this['id']=_0x8bbb86['id']||0x0;this['name']=_0x8bbb86[_0x022f('0x0')]||'';this[_0x022f('0x1')]=_0x8bbb86['Intervals']||{};}module[_0x022f('0x2')]=Interval;
\ No newline at end of file
index ca51b2a..75b419f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6546=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','mailPause','available','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','timeout','strategy','beepall'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6546,0x139));var _0x6654=function(_0x143737,_0x3f5145){_0x143737=_0x143737-0x0;var _0x1e153b=_0x6546[_0x143737];return _0x1e153b;};'use strict';var _=require(_0x6654('0x0'));var md5=require(_0x6654('0x1'));var util=require(_0x6654('0x2'));var Redis=require(_0x6654('0x3'));var config=require(_0x6654('0x4'));config[_0x6654('0x5')]=_['defaults'](config[_0x6654('0x5')],{'host':_0x6654('0x6'),'port':0x18eb});var io=require(_0x6654('0x7'))(new Redis(config[_0x6654('0x5')]));function MailQueue(_0x29aa8f){this['id']=_0x29aa8f['id']||0x0;this['name']=_0x29aa8f['name']||'';this[_0x6654('0x8')]=_0x29aa8f[_0x6654('0x8')]||0xa;this['strategy']=_0x29aa8f[_0x6654('0x9')]||_0x6654('0xa');this[_0x6654('0xb')]=_0x29aa8f[_0x6654('0xb')];this[_0x6654('0xc')]={};this[_0x6654('0xd')]=0x0;this[_0x6654('0x1')]='';this[_0x6654('0xe')]();this[_0x6654('0xf')]();}MailQueue[_0x6654('0x10')][_0x6654('0xe')]=function(){var _0x4037c1=this[_0x6654('0xc')][_0x6654('0x11')];this['mapAgentsId']=_[_0x6654('0x12')](this['Agents'],'id');this['mapAgentsId'][_0x6654('0x11')]=_0x4037c1;};MailQueue['prototype'][_0x6654('0xf')]=function(){this[_0x6654('0x13')]=0x0;this[_0x6654('0x14')]=0x0;for(var _0x361693=0x0;_0x361693<this[_0x6654('0xb')]['length'];_0x361693+=0x1){if(this[_0x6654('0xb')][_0x361693]['online']){this['loggedIn']+=0x1;}if(this[_0x6654('0xb')][_0x361693][_0x6654('0x15')]){this[_0x6654('0x14')]+=0x1;}}this[_0x6654('0x16')]=this[_0x6654('0x13')]-this[_0x6654('0x14')];this[_0x6654('0x16')]=this[_0x6654('0x16')]>=0x0?this[_0x6654('0x16')]:0x0;var _0x26e0e3={'id':this['id'],'available':this[_0x6654('0x16')],'loggedIn':this[_0x6654('0x13')],'name':this['name'],'paused':this[_0x6654('0x14')],'waiting':this[_0x6654('0xd')]};var _0x34e131=md5(JSON['stringify'](_0x26e0e3));if(this[_0x6654('0x1')]!==_0x34e131){this['md5']=_0x34e131;io['to'](util[_0x6654('0x17')](_0x6654('0x18'),_0x26e0e3['name']))['emit'](_0x6654('0x19'),_0x26e0e3);}};module[_0x6654('0x1a')]=MailQueue;
\ No newline at end of file
+var _0xb2e6=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','lodash','md5'];(function(_0x61aed4,_0x1d7894){var _0x10e5e3=function(_0x558c0b){while(--_0x558c0b){_0x61aed4['push'](_0x61aed4['shift']());}};_0x10e5e3(++_0x1d7894);}(_0xb2e6,0x1da));var _0x6b2e=function(_0x461ca5,_0x42954b){_0x461ca5=_0x461ca5-0x0;var _0xd9b668=_0xb2e6[_0x461ca5];return _0xd9b668;};'use strict';var _=require(_0x6b2e('0x0'));var md5=require(_0x6b2e('0x1'));var util=require('util');var Redis=require(_0x6b2e('0x2'));var config=require(_0x6b2e('0x3'));config[_0x6b2e('0x4')]=_[_0x6b2e('0x5')](config[_0x6b2e('0x4')],{'host':_0x6b2e('0x6'),'port':0x18eb});var io=require(_0x6b2e('0x7'))(new Redis(config[_0x6b2e('0x4')]));function MailQueue(_0x38e8ca){this['id']=_0x38e8ca['id']||0x0;this[_0x6b2e('0x8')]=_0x38e8ca[_0x6b2e('0x8')]||'';this[_0x6b2e('0x9')]=_0x38e8ca[_0x6b2e('0x9')]||0xa;this[_0x6b2e('0xa')]=_0x38e8ca[_0x6b2e('0xa')]||'beepall';this['Agents']=_0x38e8ca[_0x6b2e('0xb')];this[_0x6b2e('0xc')]={};this[_0x6b2e('0xd')]=0x0;this[_0x6b2e('0x1')]='';this[_0x6b2e('0xe')]();this['updateRealtime']();}MailQueue[_0x6b2e('0xf')][_0x6b2e('0xe')]=function(){var _0x43c0f2=this['mapAgentsId'][_0x6b2e('0x10')];this[_0x6b2e('0xc')]=_['map'](this[_0x6b2e('0xb')],'id');this['mapAgentsId'][_0x6b2e('0x10')]=_0x43c0f2;};MailQueue[_0x6b2e('0xf')][_0x6b2e('0x11')]=function(){this[_0x6b2e('0x12')]=0x0;this[_0x6b2e('0x13')]=0x0;for(var _0x40cdf1=0x0;_0x40cdf1<this[_0x6b2e('0xb')][_0x6b2e('0x14')];_0x40cdf1+=0x1){if(this[_0x6b2e('0xb')][_0x40cdf1][_0x6b2e('0x15')]){this[_0x6b2e('0x12')]+=0x1;}if(this[_0x6b2e('0xb')][_0x40cdf1][_0x6b2e('0x16')]){this[_0x6b2e('0x13')]+=0x1;}}this[_0x6b2e('0x17')]=this['loggedIn']-this[_0x6b2e('0x13')];this[_0x6b2e('0x17')]=this[_0x6b2e('0x17')]>=0x0?this[_0x6b2e('0x17')]:0x0;var _0xa77917={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x6b2e('0x8')],'paused':this[_0x6b2e('0x13')],'waiting':this[_0x6b2e('0xd')]};var _0xb19bfb=md5(JSON[_0x6b2e('0x18')](_0xa77917));if(this[_0x6b2e('0x1')]!==_0xb19bfb){this[_0x6b2e('0x1')]=_0xb19bfb;io['to'](util[_0x6b2e('0x19')](_0x6b2e('0x1a'),_0xa77917[_0x6b2e('0x8')]))[_0x6b2e('0x1b')]('mail_queue:save',_0xa77917);}};module['exports']=MailQueue;
\ No newline at end of file
index 61cfe2e..be26e17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ad1=['beepall','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','map','Agents','loggedIn','length','online','openchannelPause','available','paused','waiting','stringify','openchannel:queue:%s','emit','openchannel_queue:save','exports','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy'];(function(_0x55fc73,_0x39fb89){var _0x1490e4=function(_0x363d00){while(--_0x363d00){_0x55fc73['push'](_0x55fc73['shift']());}};_0x1490e4(++_0x39fb89);}(_0x1ad1,0x111));var _0x11ad=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x1ad1[_0x39096d];return _0x13da4f;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x11ad('0x0'));var config=require(_0x11ad('0x1'));config['redis']=_['defaults'](config[_0x11ad('0x2')],{'host':_0x11ad('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x11ad('0x2')]));function OpenchannelQueue(_0x18b6e6){this['id']=_0x18b6e6['id']||0x0;this['name']=_0x18b6e6[_0x11ad('0x4')]||'';this[_0x11ad('0x5')]=_0x18b6e6[_0x11ad('0x5')]||0xa;this[_0x11ad('0x6')]=_0x18b6e6[_0x11ad('0x6')]||_0x11ad('0x7');this['Agents']=_0x18b6e6['Agents'];this[_0x11ad('0x8')]={};this['waiting']=0x0;this[_0x11ad('0x9')]='';this[_0x11ad('0xa')]();this[_0x11ad('0xb')]();}OpenchannelQueue[_0x11ad('0xc')][_0x11ad('0xa')]=function(){var _0x1737c5=this[_0x11ad('0x8')][_0x11ad('0xd')];this['mapAgentsId']=_[_0x11ad('0xe')](this[_0x11ad('0xf')],'id');this[_0x11ad('0x8')]['_rr']=_0x1737c5;};OpenchannelQueue[_0x11ad('0xc')][_0x11ad('0xb')]=function(){this[_0x11ad('0x10')]=0x0;this['paused']=0x0;for(var _0x5047c7=0x0;_0x5047c7<this[_0x11ad('0xf')][_0x11ad('0x11')];_0x5047c7+=0x1){if(this['Agents'][_0x5047c7][_0x11ad('0x12')]){this['loggedIn']+=0x1;}if(this[_0x11ad('0xf')][_0x5047c7][_0x11ad('0x13')]){this['paused']+=0x1;}}this[_0x11ad('0x14')]=this[_0x11ad('0x10')]-this['paused'];this[_0x11ad('0x14')]=this[_0x11ad('0x14')]>=0x0?this[_0x11ad('0x14')]:0x0;var _0x344ad5={'id':this['id'],'available':this[_0x11ad('0x14')],'loggedIn':this[_0x11ad('0x10')],'name':this[_0x11ad('0x4')],'paused':this[_0x11ad('0x15')],'waiting':this[_0x11ad('0x16')]};var _0x1eb5e1=md5(JSON[_0x11ad('0x17')](_0x344ad5));if(this[_0x11ad('0x9')]!==_0x1eb5e1){this[_0x11ad('0x9')]=_0x1eb5e1;io['to'](util['format'](_0x11ad('0x18'),_0x344ad5[_0x11ad('0x4')]))[_0x11ad('0x19')](_0x11ad('0x1a'),_0x344ad5);}};module[_0x11ad('0x1b')]=OpenchannelQueue;
\ No newline at end of file
+var _0x9a63=['online','openchannelPause','paused','available','stringify','openchannel:queue:%s','emit','openchannel_queue:save','lodash','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','length'];(function(_0x2b1677,_0x3491d1){var _0x1be690=function(_0x547b27){while(--_0x547b27){_0x2b1677['push'](_0x2b1677['shift']());}};_0x1be690(++_0x3491d1);}(_0x9a63,0x164));var _0x39a6=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x9a63[_0x2b91c5];return _0xbd5531;};'use strict';var _=require(_0x39a6('0x0'));var md5=require('md5');var util=require(_0x39a6('0x1'));var Redis=require(_0x39a6('0x2'));var config=require(_0x39a6('0x3'));config[_0x39a6('0x4')]=_[_0x39a6('0x5')](config[_0x39a6('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x39a6('0x6'))(new Redis(config[_0x39a6('0x4')]));function OpenchannelQueue(_0x41e1f0){this['id']=_0x41e1f0['id']||0x0;this[_0x39a6('0x7')]=_0x41e1f0['name']||'';this[_0x39a6('0x8')]=_0x41e1f0[_0x39a6('0x8')]||0xa;this[_0x39a6('0x9')]=_0x41e1f0['strategy']||'beepall';this[_0x39a6('0xa')]=_0x41e1f0[_0x39a6('0xa')];this[_0x39a6('0xb')]={};this[_0x39a6('0xc')]=0x0;this[_0x39a6('0xd')]='';this[_0x39a6('0xe')]();this[_0x39a6('0xf')]();}OpenchannelQueue['prototype'][_0x39a6('0xe')]=function(){var _0x4e9c09=this[_0x39a6('0xb')]['_rr'];this[_0x39a6('0xb')]=_[_0x39a6('0x10')](this[_0x39a6('0xa')],'id');this[_0x39a6('0xb')][_0x39a6('0x11')]=_0x4e9c09;};OpenchannelQueue[_0x39a6('0x12')][_0x39a6('0xf')]=function(){this[_0x39a6('0x13')]=0x0;this['paused']=0x0;for(var _0x39d6d7=0x0;_0x39d6d7<this[_0x39a6('0xa')][_0x39a6('0x14')];_0x39d6d7+=0x1){if(this['Agents'][_0x39d6d7][_0x39a6('0x15')]){this[_0x39a6('0x13')]+=0x1;}if(this[_0x39a6('0xa')][_0x39d6d7][_0x39a6('0x16')]){this[_0x39a6('0x17')]+=0x1;}}this[_0x39a6('0x18')]=this[_0x39a6('0x13')]-this[_0x39a6('0x17')];this[_0x39a6('0x18')]=this[_0x39a6('0x18')]>=0x0?this['available']:0x0;var _0x39243e={'id':this['id'],'available':this[_0x39a6('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x39a6('0x7')],'paused':this[_0x39a6('0x17')],'waiting':this[_0x39a6('0xc')]};var _0x141b93=md5(JSON[_0x39a6('0x19')](_0x39243e));if(this['md5']!==_0x141b93){this['md5']=_0x141b93;io['to'](util['format'](_0x39a6('0x1a'),_0x39243e[_0x39a6('0x7')]))[_0x39a6('0x1b')](_0x39a6('0x1c'),_0x39243e);}};module['exports']=OpenchannelQueue;
\ No newline at end of file
index d6e6a93..40f4c1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','smsPause','available','stringify','format','sms:queue:%s','exports','lodash','md5','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x465f6f,_0x93b1c9){var _0x4eeda4=function(_0x56ebf0){while(--_0x56ebf0){_0x465f6f['push'](_0x465f6f['shift']());}};_0x4eeda4(++_0x93b1c9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var md5=require(_0x0d8b('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0d8b('0x2')]=_[_0x0d8b('0x3')](config[_0x0d8b('0x2')],{'host':_0x0d8b('0x4'),'port':0x18eb});var io=require(_0x0d8b('0x5'))(new Redis(config['redis']));function SmsQueue(_0x5e15e6){this['id']=_0x5e15e6['id']||0x0;this[_0x0d8b('0x6')]=_0x5e15e6[_0x0d8b('0x6')]||'';this[_0x0d8b('0x7')]=_0x5e15e6['timeout']||0xa;this[_0x0d8b('0x8')]=_0x5e15e6[_0x0d8b('0x8')]||'beepall';this[_0x0d8b('0x9')]=_0x5e15e6[_0x0d8b('0x9')];this[_0x0d8b('0xa')]={};this[_0x0d8b('0xb')]=0x0;this[_0x0d8b('0x1')]='';this[_0x0d8b('0xc')]();this[_0x0d8b('0xd')]();}SmsQueue[_0x0d8b('0xe')]['updateRouting']=function(){var _0x3c4bfa=this['mapAgentsId'][_0x0d8b('0xf')];this[_0x0d8b('0xa')]=_[_0x0d8b('0x10')](this[_0x0d8b('0x9')],'id');this[_0x0d8b('0xa')][_0x0d8b('0xf')]=_0x3c4bfa;};SmsQueue[_0x0d8b('0xe')][_0x0d8b('0xd')]=function(){this[_0x0d8b('0x11')]=0x0;this[_0x0d8b('0x12')]=0x0;for(var _0x5ad086=0x0;_0x5ad086<this[_0x0d8b('0x9')][_0x0d8b('0x13')];_0x5ad086+=0x1){if(this[_0x0d8b('0x9')][_0x5ad086]['online']){this[_0x0d8b('0x11')]+=0x1;}if(this[_0x0d8b('0x9')][_0x5ad086][_0x0d8b('0x14')]){this[_0x0d8b('0x12')]+=0x1;}}this[_0x0d8b('0x15')]=this['loggedIn']-this[_0x0d8b('0x12')];this[_0x0d8b('0x15')]=this[_0x0d8b('0x15')]>=0x0?this[_0x0d8b('0x15')]:0x0;var _0x333674={'id':this['id'],'available':this[_0x0d8b('0x15')],'loggedIn':this[_0x0d8b('0x11')],'name':this[_0x0d8b('0x6')],'paused':this['paused'],'waiting':this[_0x0d8b('0xb')]};var _0x23d58f=md5(JSON[_0x0d8b('0x16')](_0x333674));if(this[_0x0d8b('0x1')]!==_0x23d58f){this[_0x0d8b('0x1')]=_0x23d58f;io['to'](util[_0x0d8b('0x17')](_0x0d8b('0x18'),_0x333674[_0x0d8b('0x6')]))['emit']('sms_queue:save',_0x333674);}};module[_0x0d8b('0x19')]=SmsQueue;
\ No newline at end of file
+var _0xbaf0=['online','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var md5=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var Redis=require(_0x0baf('0x2'));var config=require(_0x0baf('0x3'));config[_0x0baf('0x4')]=_[_0x0baf('0x5')](config['redis'],{'host':_0x0baf('0x6'),'port':0x18eb});var io=require(_0x0baf('0x7'))(new Redis(config[_0x0baf('0x4')]));function SmsQueue(_0x39b8f3){this['id']=_0x39b8f3['id']||0x0;this[_0x0baf('0x8')]=_0x39b8f3[_0x0baf('0x8')]||'';this[_0x0baf('0x9')]=_0x39b8f3[_0x0baf('0x9')]||0xa;this[_0x0baf('0xa')]=_0x39b8f3['strategy']||_0x0baf('0xb');this['Agents']=_0x39b8f3[_0x0baf('0xc')];this[_0x0baf('0xd')]={};this[_0x0baf('0xe')]=0x0;this[_0x0baf('0x0')]='';this[_0x0baf('0xf')]();this[_0x0baf('0x10')]();}SmsQueue[_0x0baf('0x11')][_0x0baf('0xf')]=function(){var _0x1fc6b2=this[_0x0baf('0xd')][_0x0baf('0x12')];this['mapAgentsId']=_['map'](this[_0x0baf('0xc')],'id');this[_0x0baf('0xd')][_0x0baf('0x12')]=_0x1fc6b2;};SmsQueue[_0x0baf('0x11')]['updateRealtime']=function(){this[_0x0baf('0x13')]=0x0;this['paused']=0x0;for(var _0x1c76a8=0x0;_0x1c76a8<this[_0x0baf('0xc')][_0x0baf('0x14')];_0x1c76a8+=0x1){if(this[_0x0baf('0xc')][_0x1c76a8][_0x0baf('0x15')]){this[_0x0baf('0x13')]+=0x1;}if(this['Agents'][_0x1c76a8]['smsPause']){this[_0x0baf('0x16')]+=0x1;}}this[_0x0baf('0x17')]=this[_0x0baf('0x13')]-this[_0x0baf('0x16')];this[_0x0baf('0x17')]=this[_0x0baf('0x17')]>=0x0?this['available']:0x0;var _0x63c820={'id':this['id'],'available':this[_0x0baf('0x17')],'loggedIn':this[_0x0baf('0x13')],'name':this[_0x0baf('0x8')],'paused':this[_0x0baf('0x16')],'waiting':this[_0x0baf('0xe')]};var _0x4ff793=md5(JSON['stringify'](_0x63c820));if(this[_0x0baf('0x0')]!==_0x4ff793){this[_0x0baf('0x0')]=_0x4ff793;io['to'](util[_0x0baf('0x18')](_0x0baf('0x19'),_0x63c820[_0x0baf('0x8')]))[_0x0baf('0x1a')](_0x0baf('0x1b'),_0x63c820);}};module[_0x0baf('0x1c')]=SmsQueue;
\ No newline at end of file
index b36384e..b9ffd42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1093=['strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','whatsappPause','available','stringify','emit','whatsapp_queue:save','exports','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x1235a8,_0x2db48e){var _0x41a2cf=function(_0x2c30df){while(--_0x2c30df){_0x1235a8['push'](_0x1235a8['shift']());}};_0x41a2cf(++_0x2db48e);}(_0x1093,0x157));var _0x3109=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x1093[_0x9aada2];return _0x196dff;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x3109('0x0'));var Redis=require('ioredis');var config=require(_0x3109('0x1'));config[_0x3109('0x2')]=_[_0x3109('0x3')](config[_0x3109('0x2')],{'host':_0x3109('0x4'),'port':0x18eb});var io=require(_0x3109('0x5'))(new Redis(config[_0x3109('0x2')]));function WhatsappQueue(_0x5a1c3b){this['id']=_0x5a1c3b['id']||0x0;this[_0x3109('0x6')]=_0x5a1c3b[_0x3109('0x6')]||'';this[_0x3109('0x7')]=_0x5a1c3b[_0x3109('0x7')]||0xa;this['strategy']=_0x5a1c3b[_0x3109('0x8')]||'beepall';this[_0x3109('0x9')]=_0x5a1c3b[_0x3109('0x9')];this[_0x3109('0xa')]={};this[_0x3109('0xb')]=0x0;this[_0x3109('0xc')]='';this[_0x3109('0xd')]();this[_0x3109('0xe')]();}WhatsappQueue[_0x3109('0xf')][_0x3109('0xd')]=function(){var _0x2ae952=this[_0x3109('0xa')][_0x3109('0x10')];this[_0x3109('0xa')]=_[_0x3109('0x11')](this['Agents'],'id');this[_0x3109('0xa')][_0x3109('0x10')]=_0x2ae952;};WhatsappQueue[_0x3109('0xf')]['updateRealtime']=function(){this[_0x3109('0x12')]=0x0;this[_0x3109('0x13')]=0x0;for(var _0x3da4ae=0x0;_0x3da4ae<this[_0x3109('0x9')]['length'];_0x3da4ae+=0x1){if(this[_0x3109('0x9')][_0x3da4ae][_0x3109('0x14')]){this[_0x3109('0x12')]+=0x1;}if(this['Agents'][_0x3da4ae][_0x3109('0x15')]){this[_0x3109('0x13')]+=0x1;}}this[_0x3109('0x16')]=this[_0x3109('0x12')]-this['paused'];this[_0x3109('0x16')]=this[_0x3109('0x16')]>=0x0?this[_0x3109('0x16')]:0x0;var _0x4b77fe={'id':this['id'],'available':this[_0x3109('0x16')],'loggedIn':this[_0x3109('0x12')],'name':this[_0x3109('0x6')],'paused':this['paused'],'waiting':this[_0x3109('0xb')]};var _0x3f6874=md5(JSON[_0x3109('0x17')](_0x4b77fe));if(this[_0x3109('0xc')]!==_0x3f6874){this['md5']=_0x3f6874;io['to'](util['format']('whatsapp:queue:%s',_0x4b77fe[_0x3109('0x6')]))[_0x3109('0x18')](_0x3109('0x19'),_0x4b77fe);}};module[_0x3109('0x1a')]=WhatsappQueue;
\ No newline at end of file
+var _0x0f73=['../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','paused','length','available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util'];(function(_0x207114,_0x25902e){var _0x14d3b4=function(_0x4f8fe3){while(--_0x4f8fe3){_0x207114['push'](_0x207114['shift']());}};_0x14d3b4(++_0x25902e);}(_0x0f73,0x135));var _0x30f7=function(_0x17bf02,_0xb7217f){_0x17bf02=_0x17bf02-0x0;var _0x40e075=_0x0f73[_0x17bf02];return _0x40e075;};'use strict';var _=require(_0x30f7('0x0'));var md5=require(_0x30f7('0x1'));var util=require(_0x30f7('0x2'));var Redis=require('ioredis');var config=require(_0x30f7('0x3'));config[_0x30f7('0x4')]=_[_0x30f7('0x5')](config['redis'],{'host':_0x30f7('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x30f7('0x4')]));function WhatsappQueue(_0x37f63c){this['id']=_0x37f63c['id']||0x0;this['name']=_0x37f63c[_0x30f7('0x7')]||'';this[_0x30f7('0x8')]=_0x37f63c[_0x30f7('0x8')]||0xa;this['strategy']=_0x37f63c[_0x30f7('0x9')]||'beepall';this['Agents']=_0x37f63c[_0x30f7('0xa')];this[_0x30f7('0xb')]={};this[_0x30f7('0xc')]=0x0;this['md5']='';this[_0x30f7('0xd')]();this[_0x30f7('0xe')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0xd93a0e=this[_0x30f7('0xb')][_0x30f7('0xf')];this['mapAgentsId']=_[_0x30f7('0x10')](this[_0x30f7('0xa')],'id');this[_0x30f7('0xb')]['_rr']=_0xd93a0e;};WhatsappQueue[_0x30f7('0x11')][_0x30f7('0xe')]=function(){this['loggedIn']=0x0;this[_0x30f7('0x12')]=0x0;for(var _0x2963e9=0x0;_0x2963e9<this['Agents'][_0x30f7('0x13')];_0x2963e9+=0x1){if(this['Agents'][_0x2963e9]['online']){this['loggedIn']+=0x1;}if(this[_0x30f7('0xa')][_0x2963e9]['whatsappPause']){this[_0x30f7('0x12')]+=0x1;}}this[_0x30f7('0x14')]=this['loggedIn']-this[_0x30f7('0x12')];this[_0x30f7('0x14')]=this[_0x30f7('0x14')]>=0x0?this[_0x30f7('0x14')]:0x0;var _0xefad28={'id':this['id'],'available':this[_0x30f7('0x14')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x30f7('0x12')],'waiting':this[_0x30f7('0xc')]};var _0x4f628a=md5(JSON['stringify'](_0xefad28));if(this['md5']!==_0x4f628a){this[_0x30f7('0x1')]=_0x4f628a;io['to'](util[_0x30f7('0x15')](_0x30f7('0x16'),_0xefad28[_0x30f7('0x7')]))[_0x30f7('0x17')](_0x30f7('0x18'),_0xefad28);}};module[_0x30f7('0x19')]=WhatsappQueue;
\ No newline at end of file
index 26ce253..8c9a992 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','initAgents','length','isUndefined','initIntervals','initOpenchannelQueues','mergeFromDatabase','updateRealtime','chatQueues','updateRouting','initSmsQueues','initMailQueues','mailQueues','initFaxQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','agents','intervals','openchannelQueues','smsQueues'];(function(_0x4b8bd4,_0x8e2477){var _0x40274b=function(_0x5ab710){while(--_0x5ab710){_0x4b8bd4['push'](_0x4b8bd4['shift']());}};_0x40274b(++_0x8e2477);}(_0x008c,0x188));var _0xc008=function(_0x4d45fd,_0x16b74c){_0x4d45fd=_0x4d45fd-0x0;var _0x2b5aa5=_0x008c[_0x4d45fd];return _0x2b5aa5;};'use strict';var BPromise=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var _=require(_0xc008('0x2'));var moment=require(_0xc008('0x3'));var Agent=require(_0xc008('0x4'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xc008('0x5'));var ChatQueue=require(_0xc008('0x6'));var SmsQueue=require(_0xc008('0x7'));var MailQueue=require(_0xc008('0x8'));var FaxQueue=require(_0xc008('0x9'));var WhatsappQueue=require(_0xc008('0xa'));var Realtime=function(){this[_0xc008('0xb')]={};this[_0xc008('0xc')]={};this[_0xc008('0xd')]={};this['chatQueues']={};this[_0xc008('0xe')]={};this['mailQueues']={};this[_0xc008('0xf')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0xc008('0x10')]={};this[_0xc008('0x11')]={};this['smsQueuesWaitingInteractions']={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x1eacfa,_0xc881aa,_0x5b2004){var _0xae2dab=_[_0xc008('0x12')](_0x1eacfa,function(_0x2ea200,_0x2a5b4e){return _0x2ea200[_0x5b2004];});for(var _0x9ffa93 in _0xc881aa){if(_0xc881aa[_0xc008('0x13')](_0x9ffa93)){if(!_0xae2dab[_0x9ffa93]){delete _0xc881aa[_0x9ffa93];}}}}Realtime[_0xc008('0x14')]['mergeFromDatabase']=function(_0x560e28,_0x33f44c){for(var _0x50c1ab in _0x33f44c){if(_0x560e28[_0xc008('0x13')](_0x50c1ab)){_0x560e28[_0x50c1ab]=_0x33f44c[_0x50c1ab];}}};Realtime[_0xc008('0x14')][_0xc008('0x15')]=function(){var _0x339ffc=this;return function(_0x3f0ecf){if(_0x3f0ecf){freeIsNotKey(_0x3f0ecf,_0x339ffc['agents'],'id');for(var _0x5e894e=0x0,_0x4bd0f4={},_0x11ef38={};_0x5e894e<_0x3f0ecf[_0xc008('0x16')];_0x5e894e+=0x1){_0x4bd0f4=_0x3f0ecf[_0x5e894e];if(_[_0xc008('0x17')](_0x339ffc[_0xc008('0xb')][_0x4bd0f4['id']])){_0x339ffc['agents'][_0x4bd0f4['id']]=new Agent(_0x4bd0f4);}else{_0x339ffc['mergeFromDatabase'](_0x339ffc['agents'][_0x4bd0f4['id']],_0x4bd0f4);}}}return _0x339ffc['agents'];};};Realtime[_0xc008('0x14')][_0xc008('0x18')]=function(){var _0x501137=this;return function(_0x813397){if(_0x813397){freeIsNotKey(_0x813397,_0x501137['intervals'],'id');for(var _0x4bd611=0x0,_0x543e5d={},_0x50261c={};_0x4bd611<_0x813397[_0xc008('0x16')];_0x4bd611+=0x1){_0x543e5d=_0x813397[_0x4bd611];if(_['isUndefined'](_0x501137['intervals'][_0x543e5d['id']])){_0x501137['intervals'][_0x543e5d['id']]=new Interval(_0x543e5d);}else{_0x501137['mergeFromDatabase'](_0x501137['intervals'][_0x543e5d['id']],_0x543e5d);}}}return _0x501137[_0xc008('0xc')];};};Realtime[_0xc008('0x14')][_0xc008('0x19')]=function(){var _0x415af3=this;return function(_0x11cc75){if(_0x11cc75){freeIsNotKey(_0x11cc75,_0x415af3[_0xc008('0xd')],'id');for(var _0x4f43e2=0x0,_0x459fd9={},_0x5c85f2={};_0x4f43e2<_0x11cc75['length'];_0x4f43e2+=0x1){_0x459fd9=_0x11cc75[_0x4f43e2];if(_[_0xc008('0x17')](_0x415af3[_0xc008('0xd')][_0x459fd9['id']])){_0x415af3[_0xc008('0xd')][_0x459fd9['id']]=new OpenchannelQueue(_0x459fd9);}else{_0x415af3[_0xc008('0x1a')](_0x415af3['openchannelQueues'][_0x459fd9['id']],_0x459fd9);}_0x415af3['openchannelQueues'][_0x459fd9['id']]['updateRouting']();_0x415af3[_0xc008('0xd')][_0x459fd9['id']][_0xc008('0x1b')]();}}return _0x415af3[_0xc008('0xd')];};};Realtime[_0xc008('0x14')]['initChatQueues']=function(){var _0x5e2aca=this;return function(_0x4fce9c){if(_0x4fce9c){freeIsNotKey(_0x4fce9c,_0x5e2aca['chatQueues'],'id');for(var _0x4caaf4=0x0,_0x3865c0={},_0x29ba43={};_0x4caaf4<_0x4fce9c[_0xc008('0x16')];_0x4caaf4+=0x1){_0x3865c0=_0x4fce9c[_0x4caaf4];if(_['isUndefined'](_0x5e2aca[_0xc008('0x1c')][_0x3865c0['id']])){_0x5e2aca[_0xc008('0x1c')][_0x3865c0['id']]=new ChatQueue(_0x3865c0);}else{_0x5e2aca[_0xc008('0x1a')](_0x5e2aca[_0xc008('0x1c')][_0x3865c0['id']],_0x3865c0);}_0x5e2aca['chatQueues'][_0x3865c0['id']][_0xc008('0x1d')]();_0x5e2aca[_0xc008('0x1c')][_0x3865c0['id']]['updateRealtime']();}}return _0x5e2aca['chatQueues'];};};Realtime['prototype'][_0xc008('0x1e')]=function(){var _0x267abd=this;return function(_0xf831f2){if(_0xf831f2){freeIsNotKey(_0xf831f2,_0x267abd[_0xc008('0xe')],'id');for(var _0x1de04b=0x0,_0xceebc3={},_0x294f97={};_0x1de04b<_0xf831f2[_0xc008('0x16')];_0x1de04b+=0x1){_0xceebc3=_0xf831f2[_0x1de04b];if(_[_0xc008('0x17')](_0x267abd[_0xc008('0xe')][_0xceebc3['id']])){_0x267abd[_0xc008('0xe')][_0xceebc3['id']]=new SmsQueue(_0xceebc3);}else{_0x267abd[_0xc008('0x1a')](_0x267abd['smsQueues'][_0xceebc3['id']],_0xceebc3);}_0x267abd[_0xc008('0xe')][_0xceebc3['id']][_0xc008('0x1d')]();_0x267abd['smsQueues'][_0xceebc3['id']][_0xc008('0x1b')]();}}return _0x267abd[_0xc008('0xe')];};};Realtime[_0xc008('0x14')][_0xc008('0x1f')]=function(){var _0xd0e05a=this;return function(_0x3cd878){if(_0x3cd878){freeIsNotKey(_0x3cd878,_0xd0e05a[_0xc008('0x20')],'id');for(var _0x470e79=0x0,_0x29d4b3={},_0x4f14d2={};_0x470e79<_0x3cd878[_0xc008('0x16')];_0x470e79+=0x1){_0x29d4b3=_0x3cd878[_0x470e79];if(_[_0xc008('0x17')](_0xd0e05a[_0xc008('0x20')][_0x29d4b3['id']])){_0xd0e05a[_0xc008('0x20')][_0x29d4b3['id']]=new MailQueue(_0x29d4b3);}else{_0xd0e05a[_0xc008('0x1a')](_0xd0e05a[_0xc008('0x20')][_0x29d4b3['id']],_0x29d4b3);}_0xd0e05a[_0xc008('0x20')][_0x29d4b3['id']]['updateRouting']();_0xd0e05a[_0xc008('0x20')][_0x29d4b3['id']][_0xc008('0x1b')]();}}return _0xd0e05a['mailQueues'];};};Realtime[_0xc008('0x14')][_0xc008('0x21')]=function(){var _0x5e38d5=this;return function(_0x263473){if(_0x263473){freeIsNotKey(_0x263473,_0x5e38d5[_0xc008('0xf')],'id');for(var _0x280e9b=0x0,_0x55ff48={},_0x53b353={};_0x280e9b<_0x263473['length'];_0x280e9b+=0x1){_0x55ff48=_0x263473[_0x280e9b];if(_[_0xc008('0x17')](_0x5e38d5['faxQueues'][_0x55ff48['id']])){_0x5e38d5[_0xc008('0xf')][_0x55ff48['id']]=new FaxQueue(_0x55ff48);}else{_0x5e38d5[_0xc008('0x1a')](_0x5e38d5[_0xc008('0xf')][_0x55ff48['id']],_0x55ff48);}_0x5e38d5[_0xc008('0xf')][_0x55ff48['id']][_0xc008('0x1d')]();_0x5e38d5[_0xc008('0xf')][_0x55ff48['id']][_0xc008('0x1b')]();}}return _0x5e38d5[_0xc008('0xf')];};};Realtime[_0xc008('0x14')][_0xc008('0x22')]=function(){var _0x3ebb83=this;return function(_0xdfca2e){if(_0xdfca2e){freeIsNotKey(_0xdfca2e,_0x3ebb83[_0xc008('0x23')],'id');for(var _0x2bf3fd=0x0,_0x4cace5={},_0x3238b4={};_0x2bf3fd<_0xdfca2e[_0xc008('0x16')];_0x2bf3fd+=0x1){_0x4cace5=_0xdfca2e[_0x2bf3fd];if(_[_0xc008('0x17')](_0x3ebb83[_0xc008('0x23')][_0x4cace5['id']])){_0x3ebb83['whatsappQueues'][_0x4cace5['id']]=new WhatsappQueue(_0x4cace5);}else{_0x3ebb83[_0xc008('0x1a')](_0x3ebb83[_0xc008('0x23')][_0x4cace5['id']],_0x4cace5);}_0x3ebb83[_0xc008('0x23')][_0x4cace5['id']][_0xc008('0x1d')]();_0x3ebb83[_0xc008('0x23')][_0x4cace5['id']]['updateRealtime']();}}return _0x3ebb83[_0xc008('0x23')];};};module[_0xc008('0x24')]=Realtime;
\ No newline at end of file
+var _0xa41a=['../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','smsQueues','mailQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','initAgents','length','isUndefined','initIntervals','initOpenchannelQueues','openchannelQueues','initChatQueues','chatQueues','initSmsQueues','updateRouting','updateRealtime','initFaxQueues','faxQueues','bluebird','util','moment','../model/agent'];(function(_0x1dc3fe,_0x4bf30c){var _0x3507e5=function(_0x22d3cf){while(--_0x22d3cf){_0x1dc3fe['push'](_0x1dc3fe['shift']());}};_0x3507e5(++_0x4bf30c);}(_0xa41a,0x6b));var _0xaa41=function(_0x4191ee,_0x3fc07d){_0x4191ee=_0x4191ee-0x0;var _0x1037e1=_0xa41a[_0x4191ee];return _0x1037e1;};'use strict';var BPromise=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var _=require('lodash');var moment=require(_0xaa41('0x2'));var Agent=require(_0xaa41('0x3'));var Interval=require(_0xaa41('0x4'));var OpenchannelQueue=require(_0xaa41('0x5'));var ChatQueue=require(_0xaa41('0x6'));var SmsQueue=require(_0xaa41('0x7'));var MailQueue=require(_0xaa41('0x8'));var FaxQueue=require(_0xaa41('0x9'));var WhatsappQueue=require('../model/whatsappQueue');var Realtime=function(){this[_0xaa41('0xa')]={};this[_0xaa41('0xb')]={};this['openchannelQueues']={};this['chatQueues']={};this[_0xaa41('0xc')]={};this[_0xaa41('0xd')]={};this['faxQueues']={};this[_0xaa41('0xe')]={};this[_0xaa41('0xf')]={};this[_0xaa41('0x10')]={};this[_0xaa41('0x11')]={};this[_0xaa41('0x12')]={};this[_0xaa41('0x13')]={};this[_0xaa41('0x14')]={};};function freeIsNotKey(_0x423a19,_0x1c291e,_0x5c9fc7){var _0x1d3aac=_[_0xaa41('0x15')](_0x423a19,function(_0x524cab,_0x54827c){return _0x524cab[_0x5c9fc7];});for(var _0x1d0a54 in _0x1c291e){if(_0x1c291e['hasOwnProperty'](_0x1d0a54)){if(!_0x1d3aac[_0x1d0a54]){delete _0x1c291e[_0x1d0a54];}}}}Realtime[_0xaa41('0x16')][_0xaa41('0x17')]=function(_0x2f64bc,_0x889d44){for(var _0x6f9ade in _0x889d44){if(_0x2f64bc['hasOwnProperty'](_0x6f9ade)){_0x2f64bc[_0x6f9ade]=_0x889d44[_0x6f9ade];}}};Realtime[_0xaa41('0x16')][_0xaa41('0x18')]=function(){var _0x1934e9=this;return function(_0x1ef7d9){if(_0x1ef7d9){freeIsNotKey(_0x1ef7d9,_0x1934e9[_0xaa41('0xa')],'id');for(var _0x2005ae=0x0,_0x1e1e02={},_0x550ad5={};_0x2005ae<_0x1ef7d9[_0xaa41('0x19')];_0x2005ae+=0x1){_0x1e1e02=_0x1ef7d9[_0x2005ae];if(_[_0xaa41('0x1a')](_0x1934e9[_0xaa41('0xa')][_0x1e1e02['id']])){_0x1934e9[_0xaa41('0xa')][_0x1e1e02['id']]=new Agent(_0x1e1e02);}else{_0x1934e9[_0xaa41('0x17')](_0x1934e9[_0xaa41('0xa')][_0x1e1e02['id']],_0x1e1e02);}}}return _0x1934e9[_0xaa41('0xa')];};};Realtime[_0xaa41('0x16')][_0xaa41('0x1b')]=function(){var _0x4fe1a4=this;return function(_0x5cd936){if(_0x5cd936){freeIsNotKey(_0x5cd936,_0x4fe1a4[_0xaa41('0xb')],'id');for(var _0x22de55=0x0,_0x35c753={},_0x54c488={};_0x22de55<_0x5cd936[_0xaa41('0x19')];_0x22de55+=0x1){_0x35c753=_0x5cd936[_0x22de55];if(_[_0xaa41('0x1a')](_0x4fe1a4['intervals'][_0x35c753['id']])){_0x4fe1a4['intervals'][_0x35c753['id']]=new Interval(_0x35c753);}else{_0x4fe1a4[_0xaa41('0x17')](_0x4fe1a4['intervals'][_0x35c753['id']],_0x35c753);}}}return _0x4fe1a4[_0xaa41('0xb')];};};Realtime[_0xaa41('0x16')][_0xaa41('0x1c')]=function(){var _0x1f27f3=this;return function(_0x1d623c){if(_0x1d623c){freeIsNotKey(_0x1d623c,_0x1f27f3['openchannelQueues'],'id');for(var _0x43c430=0x0,_0x43a85c={},_0x448a21={};_0x43c430<_0x1d623c[_0xaa41('0x19')];_0x43c430+=0x1){_0x43a85c=_0x1d623c[_0x43c430];if(_[_0xaa41('0x1a')](_0x1f27f3[_0xaa41('0x1d')][_0x43a85c['id']])){_0x1f27f3['openchannelQueues'][_0x43a85c['id']]=new OpenchannelQueue(_0x43a85c);}else{_0x1f27f3['mergeFromDatabase'](_0x1f27f3[_0xaa41('0x1d')][_0x43a85c['id']],_0x43a85c);}_0x1f27f3['openchannelQueues'][_0x43a85c['id']]['updateRouting']();_0x1f27f3[_0xaa41('0x1d')][_0x43a85c['id']]['updateRealtime']();}}return _0x1f27f3['openchannelQueues'];};};Realtime[_0xaa41('0x16')][_0xaa41('0x1e')]=function(){var _0x392214=this;return function(_0x632fd2){if(_0x632fd2){freeIsNotKey(_0x632fd2,_0x392214[_0xaa41('0x1f')],'id');for(var _0xa7269f=0x0,_0x57ef96={},_0x30a174={};_0xa7269f<_0x632fd2[_0xaa41('0x19')];_0xa7269f+=0x1){_0x57ef96=_0x632fd2[_0xa7269f];if(_[_0xaa41('0x1a')](_0x392214[_0xaa41('0x1f')][_0x57ef96['id']])){_0x392214[_0xaa41('0x1f')][_0x57ef96['id']]=new ChatQueue(_0x57ef96);}else{_0x392214[_0xaa41('0x17')](_0x392214[_0xaa41('0x1f')][_0x57ef96['id']],_0x57ef96);}_0x392214[_0xaa41('0x1f')][_0x57ef96['id']]['updateRouting']();_0x392214[_0xaa41('0x1f')][_0x57ef96['id']]['updateRealtime']();}}return _0x392214['chatQueues'];};};Realtime[_0xaa41('0x16')][_0xaa41('0x20')]=function(){var _0x534a85=this;return function(_0x392b5d){if(_0x392b5d){freeIsNotKey(_0x392b5d,_0x534a85[_0xaa41('0xc')],'id');for(var _0x4e3b44=0x0,_0x5022fb={},_0x5c25fb={};_0x4e3b44<_0x392b5d[_0xaa41('0x19')];_0x4e3b44+=0x1){_0x5022fb=_0x392b5d[_0x4e3b44];if(_[_0xaa41('0x1a')](_0x534a85[_0xaa41('0xc')][_0x5022fb['id']])){_0x534a85[_0xaa41('0xc')][_0x5022fb['id']]=new SmsQueue(_0x5022fb);}else{_0x534a85['mergeFromDatabase'](_0x534a85[_0xaa41('0xc')][_0x5022fb['id']],_0x5022fb);}_0x534a85[_0xaa41('0xc')][_0x5022fb['id']][_0xaa41('0x21')]();_0x534a85['smsQueues'][_0x5022fb['id']][_0xaa41('0x22')]();}}return _0x534a85[_0xaa41('0xc')];};};Realtime[_0xaa41('0x16')]['initMailQueues']=function(){var _0x252c62=this;return function(_0x374117){if(_0x374117){freeIsNotKey(_0x374117,_0x252c62['mailQueues'],'id');for(var _0x23eb50=0x0,_0x13b6d4={},_0x2298ed={};_0x23eb50<_0x374117['length'];_0x23eb50+=0x1){_0x13b6d4=_0x374117[_0x23eb50];if(_[_0xaa41('0x1a')](_0x252c62['mailQueues'][_0x13b6d4['id']])){_0x252c62[_0xaa41('0xd')][_0x13b6d4['id']]=new MailQueue(_0x13b6d4);}else{_0x252c62[_0xaa41('0x17')](_0x252c62[_0xaa41('0xd')][_0x13b6d4['id']],_0x13b6d4);}_0x252c62['mailQueues'][_0x13b6d4['id']]['updateRouting']();_0x252c62['mailQueues'][_0x13b6d4['id']][_0xaa41('0x22')]();}}return _0x252c62[_0xaa41('0xd')];};};Realtime[_0xaa41('0x16')][_0xaa41('0x23')]=function(){var _0x4fbb92=this;return function(_0x53a2e4){if(_0x53a2e4){freeIsNotKey(_0x53a2e4,_0x4fbb92[_0xaa41('0x24')],'id');for(var _0x5673c=0x0,_0x951e52={},_0x4e8d2e={};_0x5673c<_0x53a2e4[_0xaa41('0x19')];_0x5673c+=0x1){_0x951e52=_0x53a2e4[_0x5673c];if(_[_0xaa41('0x1a')](_0x4fbb92[_0xaa41('0x24')][_0x951e52['id']])){_0x4fbb92['faxQueues'][_0x951e52['id']]=new FaxQueue(_0x951e52);}else{_0x4fbb92[_0xaa41('0x17')](_0x4fbb92[_0xaa41('0x24')][_0x951e52['id']],_0x951e52);}_0x4fbb92[_0xaa41('0x24')][_0x951e52['id']][_0xaa41('0x21')]();_0x4fbb92['faxQueues'][_0x951e52['id']]['updateRealtime']();}}return _0x4fbb92[_0xaa41('0x24')];};};Realtime[_0xaa41('0x16')]['initWhatsappQueues']=function(){var _0x4101ab=this;return function(_0x563687){if(_0x563687){freeIsNotKey(_0x563687,_0x4101ab[_0xaa41('0xe')],'id');for(var _0x25f2df=0x0,_0x1a2d11={},_0x466eee={};_0x25f2df<_0x563687[_0xaa41('0x19')];_0x25f2df+=0x1){_0x1a2d11=_0x563687[_0x25f2df];if(_[_0xaa41('0x1a')](_0x4101ab[_0xaa41('0xe')][_0x1a2d11['id']])){_0x4101ab[_0xaa41('0xe')][_0x1a2d11['id']]=new WhatsappQueue(_0x1a2d11);}else{_0x4101ab['mergeFromDatabase'](_0x4101ab[_0xaa41('0xe')][_0x1a2d11['id']],_0x1a2d11);}_0x4101ab[_0xaa41('0xe')][_0x1a2d11['id']][_0xaa41('0x21')]();_0x4101ab[_0xaa41('0xe')][_0x1a2d11['id']][_0xaa41('0x22')]();}}return _0x4101ab[_0xaa41('0xe')];};};module['exports']=Realtime;
\ No newline at end of file
index 4c56168..6e9ea8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2145=['addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','updateChatInteraction'];(function(_0x580d1b,_0x71036b){var _0x4c8a6f=function(_0x4ed635){while(--_0x4ed635){_0x580d1b['push'](_0x580d1b['shift']());}};_0x4c8a6f(++_0x71036b);}(_0x2145,0x1a8));var _0x5214=function(_0x36795b,_0x9fd0a2){_0x36795b=_0x36795b-0x0;var _0x395595=_0x2145[_0x36795b];return _0x395595;};'use strict';var client=require(_0x5214('0x0'));exports[_0x5214('0x1')]=function(_0x4d9878,_0x3a0283){return client['Request']('UpdateChatInteraction',{'body':_0x3a0283,'options':{'where':{'id':_0x4d9878}},'log':_0x5214('0x2')});};exports[_0x5214('0x3')]=function(_0x3df215,_0x1b995c){return client[_0x5214('0x4')](_0x5214('0x5'),{'body':_0x1b995c,'options':{'where':{'id':_0x3df215}},'log':_0x5214('0x6')});};
\ No newline at end of file
+var _0xc188=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x426c84,_0x1fe02a){var _0x155dd9=function(_0x2f04c6){while(--_0x2f04c6){_0x426c84['push'](_0x426c84['shift']());}};_0x155dd9(++_0x1fe02a);}(_0xc188,0x11a));var _0x8c18=function(_0x38e739,_0x3c2565){_0x38e739=_0x38e739-0x0;var _0x20fec9=_0xc188[_0x38e739];return _0x20fec9;};'use strict';var client=require(_0x8c18('0x0'));exports[_0x8c18('0x1')]=function(_0x2662e2,_0x2d1383){return client[_0x8c18('0x2')](_0x8c18('0x3'),{'body':_0x2d1383,'options':{'where':{'id':_0x2662e2}},'log':_0x8c18('0x4')});};exports[_0x8c18('0x5')]=function(_0x50868c,_0x1c2e44){return client[_0x8c18('0x2')](_0x8c18('0x6'),{'body':_0x1c2e44,'options':{'where':{'id':_0x50868c}},'log':_0x8c18('0x7')});};
\ No newline at end of file
index ea27786..fc59632 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd2f=['CreateChatMessage','createChatMessage','../client','Request'];(function(_0x1b24cb,_0x26e0fe){var _0x4160b2=function(_0x129733){while(--_0x129733){_0x1b24cb['push'](_0x1b24cb['shift']());}};_0x4160b2(++_0x26e0fe);}(_0xbd2f,0x1d2));var _0xfbd2=function(_0x29d618,_0x459034){_0x29d618=_0x29d618-0x0;var _0xb8ef40=_0xbd2f[_0x29d618];return _0xb8ef40;};'use strict';var client=require(_0xfbd2('0x0'));exports['create']=function(_0x28e748){return client[_0xfbd2('0x1')](_0xfbd2('0x2'),{'body':_0x28e748,'log':_0xfbd2('0x3')});};
\ No newline at end of file
+var _0x59ad=['create','Request','CreateChatMessage','createChatMessage'];(function(_0x5d1231,_0x476a7f){var _0x3f69b7=function(_0x3f4a49){while(--_0x3f4a49){_0x5d1231['push'](_0x5d1231['shift']());}};_0x3f69b7(++_0x476a7f);}(_0x59ad,0xd8));var _0xd59a=function(_0x4246bd,_0xdab764){_0x4246bd=_0x4246bd-0x0;var _0x20e0b7=_0x59ad[_0x4246bd];return _0x20e0b7;};'use strict';var client=require('../client');exports[_0xd59a('0x0')]=function(_0x129fbd){return client[_0xd59a('0x1')](_0xd59a('0x2'),{'body':_0x129fbd,'log':_0xd59a('0x3')});};
\ No newline at end of file
index 9124c88..ed950ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd997=['chatPause','getChatQueues','GetChatQueue','name','timeout','User','Agents','online'];(function(_0x2ffee8,_0x126cdd){var _0x432ebf=function(_0x521355){while(--_0x521355){_0x2ffee8['push'](_0x2ffee8['shift']());}};_0x432ebf(++_0x126cdd);}(_0xd997,0x1f2));var _0x7d99=function(_0x58df0d,_0x35089d){_0x58df0d=_0x58df0d-0x0;var _0x3f3afe=_0xd997[_0x58df0d];return _0x3f3afe;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client['Request'](_0x7d99('0x0'),{'options':{'raw':![],'attributes':['id',_0x7d99('0x1'),_0x7d99('0x2'),'strategy'],'include':[{'model':_0x7d99('0x3'),'as':_0x7d99('0x4'),'attributes':['id','name',_0x7d99('0x5'),_0x7d99('0x6')]}]},'log':_0x7d99('0x7')});};};
\ No newline at end of file
+var _0x4e0b=['chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','Agents','online'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4e0b,0x9b));var _0xb4e0=function(_0x297f78,_0x1cb820){_0x297f78=_0x297f78-0x0;var _0x17250b=_0x4e0b[_0x297f78];return _0x17250b;};'use strict';var client=require(_0xb4e0('0x0'));exports[_0xb4e0('0x1')]=function(){return function(){return client[_0xb4e0('0x2')](_0xb4e0('0x3'),{'options':{'raw':![],'attributes':['id',_0xb4e0('0x4'),_0xb4e0('0x5'),_0xb4e0('0x6')],'include':[{'model':_0xb4e0('0x7'),'as':_0xb4e0('0x8'),'attributes':['id','name',_0xb4e0('0x9'),_0xb4e0('0xa')]}]},'log':_0xb4e0('0x1')});};};
\ No newline at end of file
index e275b88..34d2488 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ebf=['../client','create','CreateChatQueueReport','Request','DESC','UpdateChatQueueReport'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x8ebf[_0x1cb18a];return _0x22442e;};'use strict';var client=require(_0xf8eb('0x0'));exports[_0xf8eb('0x1')]=function(_0x226e1d){return client['Request'](_0xf8eb('0x2'),{'body':_0x226e1d,'log':_0xf8eb('0x2')});};exports['update']=function(_0x311ae9,_0x59d6a7){return client[_0xf8eb('0x3')]('UpdateChatQueueReport',{'body':_0x59d6a7,'options':{'where':{'uniqueid':_0x311ae9},'order':[['id',_0xf8eb('0x4')]],'limit':0x1},'log':_0xf8eb('0x5')});};
\ No newline at end of file
+var _0x12c9=['UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport','update'];(function(_0x1c6751,_0x15d707){var _0xafa8c3=function(_0x24c120){while(--_0x24c120){_0x1c6751['push'](_0x1c6751['shift']());}};_0xafa8c3(++_0x15d707);}(_0x12c9,0x1c9));var _0x912c=function(_0x5890d6,_0x5648fe){_0x5890d6=_0x5890d6-0x0;var _0x54bdc6=_0x12c9[_0x5890d6];return _0x54bdc6;};'use strict';var client=require(_0x912c('0x0'));exports[_0x912c('0x1')]=function(_0x7a27c0){return client[_0x912c('0x2')](_0x912c('0x3'),{'body':_0x7a27c0,'log':'CreateChatQueueReport'});};exports[_0x912c('0x4')]=function(_0xcb7adc,_0x2c8059){return client[_0x912c('0x2')](_0x912c('0x5'),{'body':_0x2c8059,'options':{'where':{'uniqueid':_0xcb7adc},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});};
\ No newline at end of file
index 9ade943..e96bc58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4344=['../client','update','Request','updateFaxInteraction','addTags','addTagsToFaxInteraction'];(function(_0x48234e,_0x4b7445){var _0x2b0096=function(_0x4ec178){while(--_0x4ec178){_0x48234e['push'](_0x48234e['shift']());}};_0x2b0096(++_0x4b7445);}(_0x4344,0xde));var _0x4434=function(_0x1e40d9,_0x5d81b0){_0x1e40d9=_0x1e40d9-0x0;var _0xe50709=_0x4344[_0x1e40d9];return _0xe50709;};'use strict';var client=require(_0x4434('0x0'));exports[_0x4434('0x1')]=function(_0x1b60b7,_0x5d0157){return client[_0x4434('0x2')]('UpdateFaxInteraction',{'body':_0x5d0157,'options':{'where':{'id':_0x1b60b7}},'log':_0x4434('0x3')});};exports[_0x4434('0x4')]=function(_0xbd97f2,_0x500149){return client[_0x4434('0x2')]('AddTagsToFaxInteraction',{'body':_0x500149,'options':{'where':{'id':_0xbd97f2}},'log':_0x4434('0x5')});};
\ No newline at end of file
+var _0x5b7f=['../client','update','UpdateFaxInteraction','Request','AddTagsToFaxInteraction'];(function(_0x3ec485,_0x37cb44){var _0xa70abf=function(_0x21f249){while(--_0x21f249){_0x3ec485['push'](_0x3ec485['shift']());}};_0xa70abf(++_0x37cb44);}(_0x5b7f,0x181));var _0xf5b7=function(_0x57c52d,_0x3f4818){_0x57c52d=_0x57c52d-0x0;var _0x2c771f=_0x5b7f[_0x57c52d];return _0x2c771f;};'use strict';var client=require(_0xf5b7('0x0'));exports[_0xf5b7('0x1')]=function(_0x191fc9,_0x19678b){return client['Request'](_0xf5b7('0x2'),{'body':_0x19678b,'options':{'where':{'id':_0x191fc9}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x3cea42,_0x3f9a45){return client[_0xf5b7('0x3')](_0xf5b7('0x4'),{'body':_0x3f9a45,'options':{'where':{'id':_0x3cea42}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
index bf23eef..ab2a145 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c1e=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x20254b,_0x2da289){var _0x540963=function(_0x265a16){while(--_0x265a16){_0x20254b['push'](_0x20254b['shift']());}};_0x540963(++_0x2da289);}(_0x0c1e,0x111));var _0xe0c1=function(_0x5688a3,_0x48702f){_0x5688a3=_0x5688a3-0x0;var _0x11db27=_0x0c1e[_0x5688a3];return _0x11db27;};'use strict';var client=require('../client');exports[_0xe0c1('0x0')]=function(_0xc24d90){return client[_0xe0c1('0x1')](_0xe0c1('0x2'),{'body':_0xc24d90,'log':_0xe0c1('0x3')});};
\ No newline at end of file
+var _0x271f=['Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x25b9a1,_0x3e141b){var _0x2dff67=function(_0x1d5279){while(--_0x1d5279){_0x25b9a1['push'](_0x25b9a1['shift']());}};_0x2dff67(++_0x3e141b);}(_0x271f,0xb3));var _0xf271=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x271f[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xf271('0x0'));exports['create']=function(_0xfc0087){return client[_0xf271('0x1')](_0xf271('0x2'),{'body':_0xfc0087,'log':_0xf271('0x3')});};
\ No newline at end of file
index d93af0a..d5fa63a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7c5=['name','User','Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue'];(function(_0xb2f885,_0x581b93){var _0x33b676=function(_0x2a53ab){while(--_0x2a53ab){_0xb2f885['push'](_0xb2f885['shift']());}};_0x33b676(++_0x581b93);}(_0xd7c5,0x1ac));var _0x5d7c=function(_0x3e3606,_0x2d26a7){_0x3e3606=_0x3e3606-0x0;var _0x1557fd=_0xd7c5[_0x3e3606];return _0x1557fd;};'use strict';var client=require(_0x5d7c('0x0'));exports[_0x5d7c('0x1')]=function(){return function(){return client[_0x5d7c('0x2')](_0x5d7c('0x3'),{'options':{'raw':![],'attributes':['id',_0x5d7c('0x4'),'timeout','strategy'],'include':[{'model':_0x5d7c('0x5'),'as':_0x5d7c('0x6'),'attributes':['id',_0x5d7c('0x4'),_0x5d7c('0x7'),_0x5d7c('0x8')]}]},'log':_0x5d7c('0x1')});};};
\ No newline at end of file
+var _0xa414=['timeout','strategy','Agents','name','online','faxPause','getFaxQueues','Request','GetFaxQueue'];(function(_0x37efe0,_0x263b2f){var _0x47f700=function(_0x326978){while(--_0x326978){_0x37efe0['push'](_0x37efe0['shift']());}};_0x47f700(++_0x263b2f);}(_0xa414,0xde));var _0x4a41=function(_0x4ab1c6,_0x5e4ab4){_0x4ab1c6=_0x4ab1c6-0x0;var _0x455ea1=_0xa414[_0x4ab1c6];return _0x455ea1;};'use strict';var client=require('../client');exports[_0x4a41('0x0')]=function(){return function(){return client[_0x4a41('0x1')](_0x4a41('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x4a41('0x3'),_0x4a41('0x4')],'include':[{'model':'User','as':_0x4a41('0x5'),'attributes':['id',_0x4a41('0x6'),_0x4a41('0x7'),_0x4a41('0x8')]}]},'log':_0x4a41('0x0')});};};
\ No newline at end of file
index 8d628d8..f0418e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75dd=['../client','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x22c415,_0x273b84){var _0x3ef055=function(_0x5ef923){while(--_0x5ef923){_0x22c415['push'](_0x22c415['shift']());}};_0x3ef055(++_0x273b84);}(_0x75dd,0x6e));var _0xd75d=function(_0x5620b1,_0x1107b1){_0x5620b1=_0x5620b1-0x0;var _0x357957=_0x75dd[_0x5620b1];return _0x357957;};'use strict';var client=require(_0xd75d('0x0'));exports['create']=function(_0x54fce4){return client[_0xd75d('0x1')](_0xd75d('0x2'),{'body':_0x54fce4,'log':_0xd75d('0x2')});};exports[_0xd75d('0x3')]=function(_0xd4e8e0,_0x3f9892){return client['Request'](_0xd75d('0x4'),{'body':_0x3f9892,'options':{'where':{'uniqueid':_0xd4e8e0},'order':[['id','DESC']],'limit':0x1},'log':_0xd75d('0x4')});};
\ No newline at end of file
+var _0x2157=['update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x140e60,_0x1b27f1){var _0x18cded=function(_0x3aad4c){while(--_0x3aad4c){_0x140e60['push'](_0x140e60['shift']());}};_0x18cded(++_0x1b27f1);}(_0x2157,0x13b));var _0x7215=function(_0x1f5070,_0x5f0518){_0x1f5070=_0x1f5070-0x0;var _0x457c78=_0x2157[_0x1f5070];return _0x457c78;};'use strict';var client=require(_0x7215('0x0'));exports[_0x7215('0x1')]=function(_0x173d73){return client[_0x7215('0x2')]('CreateFaxQueueReport',{'body':_0x173d73,'log':'CreateFaxQueueReport'});};exports[_0x7215('0x3')]=function(_0x379e3d,_0x53f98b){return client[_0x7215('0x2')](_0x7215('0x4'),{'body':_0x53f98b,'options':{'where':{'uniqueid':_0x379e3d},'order':[['id',_0x7215('0x5')]],'limit':0x1},'log':_0x7215('0x4')});};
\ No newline at end of file
index 6a65a99..a6b82e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9a7=['name','interval','getIntervals','Interval'];(function(_0x51841c,_0x4667bd){var _0x48bbf3=function(_0x5d7a85){while(--_0x5d7a85){_0x51841c['push'](_0x51841c['shift']());}};_0x48bbf3(++_0x4667bd);}(_0xb9a7,0x112));var _0x7b9a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xb9a7[_0x199572];return _0x13cfa3;};'use strict';var client=require('../client');exports[_0x7b9a('0x0')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x7b9a('0x1'),'as':'Intervals','attributes':['id',_0x7b9a('0x2'),_0x7b9a('0x3')]}]},'log':_0x7b9a('0x0')});};};
\ No newline at end of file
+var _0xb10b=['name','Intervals','interval','getIntervals','../client','Request','GetInterval'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0xb10b,0x12a));var _0xbb10=function(_0x52711f,_0x4cf48b){_0x52711f=_0x52711f-0x0;var _0x736442=_0xb10b[_0x52711f];return _0x736442;};'use strict';var client=require(_0xbb10('0x0'));exports['getIntervals']=function(){return function(){return client[_0xbb10('0x1')](_0xbb10('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xbb10('0x3')],'include':[{'model':'Interval','as':_0xbb10('0x4'),'attributes':['id',_0xbb10('0x3'),_0xbb10('0x5')]}]},'log':_0xbb10('0x6')});};};
\ No newline at end of file
index 12652ff..ea8aa4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d2a=['addTags','AddTagsToMailInteraction','../client','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0xa353b5,_0x36d146){var _0x48231c=function(_0x7a12a){while(--_0x7a12a){_0xa353b5['push'](_0xa353b5['shift']());}};_0x48231c(++_0x36d146);}(_0x6d2a,0x11c));var _0xa6d2=function(_0x7d261d,_0x4e1d2f){_0x7d261d=_0x7d261d-0x0;var _0x1a992a=_0x6d2a[_0x7d261d];return _0x1a992a;};'use strict';var client=require(_0xa6d2('0x0'));exports['update']=function(_0x43556f,_0x27af54){return client[_0xa6d2('0x1')](_0xa6d2('0x2'),{'body':_0x27af54,'options':{'where':{'id':_0x43556f}},'log':_0xa6d2('0x3')});};exports[_0xa6d2('0x4')]=function(_0x25b38b,_0x136304){return client[_0xa6d2('0x1')](_0xa6d2('0x5'),{'body':_0x136304,'options':{'where':{'id':_0x25b38b}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0x1274=['addTags','Request','AddTagsToMailInteraction','../client','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x4fb377,_0x3210e3){var _0x592919=function(_0x5b61b5){while(--_0x5b61b5){_0x4fb377['push'](_0x4fb377['shift']());}};_0x592919(++_0x3210e3);}(_0x1274,0x18b));var _0x4127=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1274[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x4127('0x0'));exports[_0x4127('0x1')]=function(_0x32d1b2,_0x3f870d){return client['Request'](_0x4127('0x2'),{'body':_0x3f870d,'options':{'where':{'id':_0x32d1b2}},'log':_0x4127('0x3')});};exports[_0x4127('0x4')]=function(_0xa9f7dd,_0x1379cc){return client[_0x4127('0x5')](_0x4127('0x6'),{'body':_0x1379cc,'options':{'where':{'id':_0xa9f7dd}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index cc68f43..8252e69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7351=['Request','CreateMailMessage','createMailMessage','../client'];(function(_0xb2d17c,_0x487d49){var _0x576b82=function(_0x2df26d){while(--_0x2df26d){_0xb2d17c['push'](_0xb2d17c['shift']());}};_0x576b82(++_0x487d49);}(_0x7351,0xab));var _0x1735=function(_0x50b7e1,_0x23dd26){_0x50b7e1=_0x50b7e1-0x0;var _0x2af4fc=_0x7351[_0x50b7e1];return _0x2af4fc;};'use strict';var client=require(_0x1735('0x0'));exports['create']=function(_0x45d967){return client[_0x1735('0x1')](_0x1735('0x2'),{'body':_0x45d967,'log':_0x1735('0x3')});};
\ No newline at end of file
+var _0x5068=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0xfc70e6,_0xb4c897){var _0x5a0405=function(_0x501e6c){while(--_0x501e6c){_0xfc70e6['push'](_0xfc70e6['shift']());}};_0x5a0405(++_0xb4c897);}(_0x5068,0x1c0));var _0x8506=function(_0x4244fd,_0x16f4d9){_0x4244fd=_0x4244fd-0x0;var _0x1dd479=_0x5068[_0x4244fd];return _0x1dd479;};'use strict';var client=require(_0x8506('0x0'));exports[_0x8506('0x1')]=function(_0x429cf6){return client[_0x8506('0x2')](_0x8506('0x3'),{'body':_0x429cf6,'log':_0x8506('0x4')});};
\ No newline at end of file
index c8309be..b026b67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19f5=['name','timeout','User','Agents','online','mailPause','../client','GetMailQueue'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x19f5,0x96));var _0x519f=function(_0xb056b0,_0x35a666){_0xb056b0=_0xb056b0-0x0;var _0x41d831=_0x19f5[_0xb056b0];return _0x41d831;};'use strict';var client=require(_0x519f('0x0'));exports['getMailQueues']=function(){return function(){return client['Request'](_0x519f('0x1'),{'options':{'raw':![],'attributes':['id',_0x519f('0x2'),_0x519f('0x3'),'strategy'],'include':[{'model':_0x519f('0x4'),'as':_0x519f('0x5'),'attributes':['id','name',_0x519f('0x6'),_0x519f('0x7')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
+var _0xa038=['online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','strategy','User','Agents'];(function(_0x13d467,_0xbf18af){var _0x2d7438=function(_0x1dd54b){while(--_0x1dd54b){_0x13d467['push'](_0x13d467['shift']());}};_0x2d7438(++_0xbf18af);}(_0xa038,0x142));var _0x8a03=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xa038[_0x725b8e];return _0x43ac45;};'use strict';var client=require(_0x8a03('0x0'));exports[_0x8a03('0x1')]=function(){return function(){return client[_0x8a03('0x2')](_0x8a03('0x3'),{'options':{'raw':![],'attributes':['id',_0x8a03('0x4'),'timeout',_0x8a03('0x5')],'include':[{'model':_0x8a03('0x6'),'as':_0x8a03('0x7'),'attributes':['id',_0x8a03('0x4'),_0x8a03('0x8'),_0x8a03('0x9')]}]},'log':_0x8a03('0x1')});};};
\ No newline at end of file
index 069736e..31607b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca9a=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','../client'];(function(_0xc4feb4,_0x1c6f3c){var _0x446500=function(_0x4acfae){while(--_0x4acfae){_0xc4feb4['push'](_0xc4feb4['shift']());}};_0x446500(++_0x1c6f3c);}(_0xca9a,0x77));var _0xaca9=function(_0x4b4d05,_0x307617){_0x4b4d05=_0x4b4d05-0x0;var _0x3ac46a=_0xca9a[_0x4b4d05];return _0x3ac46a;};'use strict';var client=require(_0xaca9('0x0'));exports[_0xaca9('0x1')]=function(_0x27ab29){return client[_0xaca9('0x2')](_0xaca9('0x3'),{'body':_0x27ab29,'log':_0xaca9('0x3')});};exports[_0xaca9('0x4')]=function(_0xb338e9,_0x3c9273){return client[_0xaca9('0x2')](_0xaca9('0x5'),{'body':_0x3c9273,'options':{'where':{'uniqueid':_0xb338e9},'order':[['id','DESC']],'limit':0x1},'log':_0xaca9('0x5')});};
\ No newline at end of file
+var _0x2dc2=['update','UpdateMailQueueReport','DESC','create','Request','CreateMailQueueReport'];(function(_0x22fff0,_0x1c5a2e){var _0x573c17=function(_0x193882){while(--_0x193882){_0x22fff0['push'](_0x22fff0['shift']());}};_0x573c17(++_0x1c5a2e);}(_0x2dc2,0x17d));var _0x22dc=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x2dc2[_0x220dbb];return _0x2b77de;};'use strict';var client=require('../client');exports[_0x22dc('0x0')]=function(_0x3ff2e4){return client[_0x22dc('0x1')](_0x22dc('0x2'),{'body':_0x3ff2e4,'log':'CreateMailQueueReport'});};exports[_0x22dc('0x3')]=function(_0xb4eff8,_0x2d3e47){return client['Request'](_0x22dc('0x4'),{'body':_0x2d3e47,'options':{'where':{'uniqueid':_0xb4eff8},'order':[['id',_0x22dc('0x5')]],'limit':0x1},'log':_0x22dc('0x4')});};
\ No newline at end of file
index 89b27d3..d7ebff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde76=['Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','../client'];(function(_0x23dac2,_0x503821){var _0x2deffa=function(_0x3e8dbb){while(--_0x3e8dbb){_0x23dac2['push'](_0x23dac2['shift']());}};_0x2deffa(++_0x503821);}(_0xde76,0x18f));var _0x6de7=function(_0x25c3ac,_0x94bbfc){_0x25c3ac=_0x25c3ac-0x0;var _0x15657d=_0xde76[_0x25c3ac];return _0x15657d;};'use strict';var client=require(_0x6de7('0x0'));exports['update']=function(_0x2968e9,_0xedd2e7){return client[_0x6de7('0x1')](_0x6de7('0x2'),{'body':_0xedd2e7,'options':{'where':{'id':_0x2968e9}},'log':'updateOpenchannelInteraction'});};exports[_0x6de7('0x3')]=function(_0x7220a4,_0x1d64f0){return client[_0x6de7('0x1')](_0x6de7('0x4'),{'body':_0x1d64f0,'options':{'where':{'id':_0x7220a4}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0xc240=['Request','UpdateOpenchannelInteraction','addTagsToChatInteraction','update'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0xc240,0x11f));var _0x0c24=function(_0x338229,_0x5880ab){_0x338229=_0x338229-0x0;var _0x38af9e=_0xc240[_0x338229];return _0x38af9e;};'use strict';var client=require('../client');exports[_0x0c24('0x0')]=function(_0x12d122,_0x1e03e7){return client[_0x0c24('0x1')](_0x0c24('0x2'),{'body':_0x1e03e7,'options':{'where':{'id':_0x12d122}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x3701d5,_0x18a1f3){return client[_0x0c24('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x18a1f3,'options':{'where':{'id':_0x3701d5}},'log':_0x0c24('0x3')});};
\ No newline at end of file
index f619c68..19d4e2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x2f8316,_0x461097){var _0x3044ab=function(_0x12ace4){while(--_0x12ace4){_0x2f8316['push'](_0x2f8316['shift']());}};_0x3044ab(++_0x461097);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5dafd0,_0x3bcbb6){_0x5dafd0=_0x5dafd0-0x0;var _0x364354=_0xf3cd[_0x5dafd0];return _0x364354;};'use strict';var client=require(_0xdf3c('0x0'));exports[_0xdf3c('0x1')]=function(_0x31e5a5){return client[_0xdf3c('0x2')](_0xdf3c('0x3'),{'body':_0x31e5a5,'log':_0xdf3c('0x4')});};
\ No newline at end of file
+var _0x70e0=['createOpenchannelMessage','../client','create'];(function(_0x4aea3a,_0x3839f9){var _0x5a349e=function(_0x4d77c6){while(--_0x4d77c6){_0x4aea3a['push'](_0x4aea3a['shift']());}};_0x5a349e(++_0x3839f9);}(_0x70e0,0x17b));var _0x070e=function(_0xd9e8b5,_0x2940f2){_0xd9e8b5=_0xd9e8b5-0x0;var _0x45e8d6=_0x70e0[_0xd9e8b5];return _0x45e8d6;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateOpenchannelMessage',{'body':_0x198c2e,'log':_0x070e('0x2')});};
\ No newline at end of file
index bf50c9e..6dd79d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41ca=['../client','getOpenchannelQueues','GetOpenchannelQueue','timeout','User','online','openchannelPause'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x41ca,0x17a));var _0xa41c=function(_0x3d822c,_0x11cc25){_0x3d822c=_0x3d822c-0x0;var _0x5789a2=_0x41ca[_0x3d822c];return _0x5789a2;};'use strict';var client=require(_0xa41c('0x0'));exports[_0xa41c('0x1')]=function(){return function(){return client['Request'](_0xa41c('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xa41c('0x3'),'strategy'],'include':[{'model':_0xa41c('0x4'),'as':'Agents','attributes':['id','name',_0xa41c('0x5'),_0xa41c('0x6')]}]},'log':_0xa41c('0x1')});};};
\ No newline at end of file
+var _0xd608=['Request','GetOpenchannelQueue','timeout','strategy','User','name','online','openchannelPause','getOpenchannelQueues'];(function(_0x360e97,_0x2c8e2b){var _0x350314=function(_0x6d00bc){while(--_0x6d00bc){_0x360e97['push'](_0x360e97['shift']());}};_0x350314(++_0x2c8e2b);}(_0xd608,0x13b));var _0x8d60=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd608[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0x8d60('0x0')](_0x8d60('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x8d60('0x2'),_0x8d60('0x3')],'include':[{'model':_0x8d60('0x4'),'as':'Agents','attributes':['id',_0x8d60('0x5'),_0x8d60('0x6'),_0x8d60('0x7')]}]},'log':_0x8d60('0x8')});};};
\ No newline at end of file
index b42bf61..15296a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e3c=['UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2e3c,0x1f4));var _0xc2e3=function(_0x3d3eb7,_0x52203e){_0x3d3eb7=_0x3d3eb7-0x0;var _0x25324e=_0x2e3c[_0x3d3eb7];return _0x25324e;};'use strict';var client=require(_0xc2e3('0x0'));exports[_0xc2e3('0x1')]=function(_0x563a72){return client[_0xc2e3('0x2')](_0xc2e3('0x3'),{'body':_0x563a72,'log':_0xc2e3('0x3')});};exports['update']=function(_0x1f4855,_0x36749b){return client['Request'](_0xc2e3('0x4'),{'body':_0x36749b,'options':{'where':{'uniqueid':_0x1f4855},'order':[['id',_0xc2e3('0x5')]],'limit':0x1},'log':_0xc2e3('0x4')});};
\ No newline at end of file
+var _0x0338=['CreateOpenchannelQueueReport','update','DESC','../client','Request'];(function(_0x52067c,_0x22fa88){var _0x574b04=function(_0x454ba8){while(--_0x454ba8){_0x52067c['push'](_0x52067c['shift']());}};_0x574b04(++_0x22fa88);}(_0x0338,0xcb));var _0x8033=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x0338[_0x513aa5];return _0x1a1a7c;};'use strict';var client=require(_0x8033('0x0'));exports['create']=function(_0x5f56df){return client[_0x8033('0x1')]('CreateOpenchannelQueueReport',{'body':_0x5f56df,'log':_0x8033('0x2')});};exports[_0x8033('0x3')]=function(_0x56307e,_0x57d95e){return client[_0x8033('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x57d95e,'options':{'where':{'uniqueid':_0x56307e},'order':[['id',_0x8033('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
index 96423e6..ee49059 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba74=['Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','../client','update'];(function(_0x4f0191,_0x31a995){var _0x38b830=function(_0x38e278){while(--_0x38e278){_0x4f0191['push'](_0x4f0191['shift']());}};_0x38b830(++_0x31a995);}(_0xba74,0x130));var _0x4ba7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xba74[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x4ba7('0x0'));exports[_0x4ba7('0x1')]=function(_0x461c39,_0x3c267a){return client[_0x4ba7('0x2')](_0x4ba7('0x3'),{'body':_0x3c267a,'options':{'where':{'id':_0x461c39}},'log':_0x4ba7('0x4')});};exports['addTags']=function(_0x2cb709,_0x4d20f0){return client[_0x4ba7('0x2')](_0x4ba7('0x5'),{'body':_0x4d20f0,'options':{'where':{'id':_0x2cb709}},'log':'addTagsToSmsInteraction'});};
\ No newline at end of file
+var _0x8ff4=['../client','Request','UpdateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8ff4,0x1b3));var _0x48ff=function(_0x340c09,_0xc08941){_0x340c09=_0x340c09-0x0;var _0x1cc1b6=_0x8ff4[_0x340c09];return _0x1cc1b6;};'use strict';var client=require(_0x48ff('0x0'));exports['update']=function(_0x1851d,_0x3f700a){return client[_0x48ff('0x1')](_0x48ff('0x2'),{'body':_0x3f700a,'options':{'where':{'id':_0x1851d}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x189e03,_0x460a26){return client['Request'](_0x48ff('0x3'),{'body':_0x460a26,'options':{'where':{'id':_0x189e03}},'log':_0x48ff('0x4')});};
\ No newline at end of file
index e2b6fb0..4fce1f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9874=['Request','CreateSmsMessage','create'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x9874,0x155));var _0x4987=function(_0x41ff72,_0x48f1f7){_0x41ff72=_0x41ff72-0x0;var _0x2d1cd5=_0x9874[_0x41ff72];return _0x2d1cd5;};'use strict';var client=require('../client');exports[_0x4987('0x0')]=function(_0x5854d9){return client[_0x4987('0x1')](_0x4987('0x2'),{'body':_0x5854d9,'log':'createSmsMessage'});};
\ No newline at end of file
+var _0x49c3=['createSmsMessage','../client','create','CreateSmsMessage'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x49c3,0xb1));var _0x349c=function(_0x373653,_0x475406){_0x373653=_0x373653-0x0;var _0x322a31=_0x49c3[_0x373653];return _0x322a31;};'use strict';var client=require(_0x349c('0x0'));exports[_0x349c('0x1')]=function(_0x115d49){return client['Request'](_0x349c('0x2'),{'body':_0x115d49,'log':_0x349c('0x3')});};
\ No newline at end of file
index 76fd333..3d6d296 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda0c=['Request','GetSmsQueue','name','User','online','smsPause','../client','getSmsQueues'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0xda0c,0x16e));var _0xcda0=function(_0x56a180,_0x3ec6c5){_0x56a180=_0x56a180-0x0;var _0x240029=_0xda0c[_0x56a180];return _0x240029;};'use strict';var client=require(_0xcda0('0x0'));exports[_0xcda0('0x1')]=function(){return function(){return client[_0xcda0('0x2')](_0xcda0('0x3'),{'options':{'raw':![],'attributes':['id',_0xcda0('0x4'),'timeout','strategy'],'include':[{'model':_0xcda0('0x5'),'as':'Agents','attributes':['id','name',_0xcda0('0x6'),_0xcda0('0x7')]}]},'log':_0xcda0('0x1')});};};
\ No newline at end of file
+var _0xe862=['name','strategy','User','Agents','online','getSmsQueues','Request','GetSmsQueue'];(function(_0x590146,_0x35d961){var _0x1e4598=function(_0x26dac){while(--_0x26dac){_0x590146['push'](_0x590146['shift']());}};_0x1e4598(++_0x35d961);}(_0xe862,0x76));var _0x2e86=function(_0x4ca9cd,_0x4f9d6d){_0x4ca9cd=_0x4ca9cd-0x0;var _0x1cc56b=_0xe862[_0x4ca9cd];return _0x1cc56b;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x2e86('0x0')](_0x2e86('0x1'),{'options':{'raw':![],'attributes':['id',_0x2e86('0x2'),'timeout',_0x2e86('0x3')],'include':[{'model':_0x2e86('0x4'),'as':_0x2e86('0x5'),'attributes':['id',_0x2e86('0x2'),_0x2e86('0x6'),'smsPause']}]},'log':_0x2e86('0x7')});};};
\ No newline at end of file
index 429c383..93d3062 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb44f=['CreateSmsQueueReport','update','UpdateSmsQueueReport','../client','create','Request'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xb44f,0x165));var _0xfb44=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xb44f[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0xfb44('0x0'));exports[_0xfb44('0x1')]=function(_0x2e2124){return client[_0xfb44('0x2')](_0xfb44('0x3'),{'body':_0x2e2124,'log':_0xfb44('0x3')});};exports[_0xfb44('0x4')]=function(_0x179ac2,_0x3969c4){return client[_0xfb44('0x2')](_0xfb44('0x5'),{'body':_0x3969c4,'options':{'where':{'uniqueid':_0x179ac2},'order':[['id','DESC']],'limit':0x1},'log':_0xfb44('0x5')});};
\ No newline at end of file
+var _0xa936=['CreateSmsQueueReport','update','UpdateSmsQueueReport','Request'];(function(_0x53bcbb,_0x1efe34){var _0x245ff7=function(_0x5e32f0){while(--_0x5e32f0){_0x53bcbb['push'](_0x53bcbb['shift']());}};_0x245ff7(++_0x1efe34);}(_0xa936,0x107));var _0x6a93=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xa936[_0x2aea9e];return _0x430b92;};'use strict';var client=require('../client');exports['create']=function(_0x162268){return client[_0x6a93('0x0')](_0x6a93('0x1'),{'body':_0x162268,'log':'CreateSmsQueueReport'});};exports[_0x6a93('0x2')]=function(_0x16099e,_0x30f326){return client['Request'](_0x6a93('0x3'),{'body':_0x30f326,'options':{'where':{'uniqueid':_0x16099e},'order':[['id','DESC']],'limit':0x1},'log':_0x6a93('0x3')});};
\ No newline at end of file
index a95fd3a..bc1c009 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf334=['name','lastPauseAt','voicePause','chatPause','smsPause','openchannelPause','mailCapacity','smsCapacity','whatsappCapacity','openchannelCapacity','../client','getAgents','Request','GetUser'];(function(_0x1e93fa,_0x210f48){var _0xd4e1e6=function(_0x3149da){while(--_0x3149da){_0x1e93fa['push'](_0x1e93fa['shift']());}};_0xd4e1e6(++_0x210f48);}(_0xf334,0x14c));var _0x4f33=function(_0x10df56,_0x5da45e){_0x10df56=_0x10df56-0x0;var _0x3d200e=_0xf334[_0x10df56];return _0x3d200e;};'use strict';var client=require(_0x4f33('0x0'));exports[_0x4f33('0x1')]=function(){return function(){return client[_0x4f33('0x2')](_0x4f33('0x3'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x4f33('0x4'),'online','pauseType',_0x4f33('0x5'),_0x4f33('0x6'),_0x4f33('0x7'),'mailPause','faxPause',_0x4f33('0x8'),'whatsappPause',_0x4f33('0x9'),'chatCapacity',_0x4f33('0xa'),'faxCapacity',_0x4f33('0xb'),_0x4f33('0xc'),_0x4f33('0xd')]},'log':_0x4f33('0x1')});};};
\ No newline at end of file
+var _0x60a5=['name','pauseType','lastPauseAt','chatPause','faxPause','smsPause','whatsappPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','whatsappCapacity','openchannelCapacity','../client','getAgents','GetUser'];(function(_0x2ba6d1,_0x4ccd2b){var _0x5d912e=function(_0x5e10a7){while(--_0x5e10a7){_0x2ba6d1['push'](_0x2ba6d1['shift']());}};_0x5d912e(++_0x4ccd2b);}(_0x60a5,0x13d));var _0x560a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x60a5[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0x560a('0x0'));exports[_0x560a('0x1')]=function(){return function(){return client['Request'](_0x560a('0x2'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x560a('0x3'),'online',_0x560a('0x4'),_0x560a('0x5'),'voicePause',_0x560a('0x6'),'mailPause',_0x560a('0x7'),_0x560a('0x8'),_0x560a('0x9'),_0x560a('0xa'),_0x560a('0xb'),_0x560a('0xc'),_0x560a('0xd'),'smsCapacity',_0x560a('0xe'),_0x560a('0xf')]},'log':'getAgents'});};};
\ No newline at end of file
index 04a8348..ad37929 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37a4=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x2f0244,_0x5c752b){var _0x1699a1=function(_0x32d4f9){while(--_0x32d4f9){_0x2f0244['push'](_0x2f0244['shift']());}};_0x1699a1(++_0x5c752b);}(_0x37a4,0xcb));var _0x437a=function(_0x2157bf,_0x1cc3ea){_0x2157bf=_0x2157bf-0x0;var _0x44b4df=_0x37a4[_0x2157bf];return _0x44b4df;};'use strict';var client=require(_0x437a('0x0'));exports['update']=function(_0x222222,_0x55fda8){return client[_0x437a('0x1')](_0x437a('0x2'),{'body':_0x55fda8,'options':{'where':{'id':_0x222222}},'log':_0x437a('0x3')});};exports['addTags']=function(_0x5f2883,_0xf52f1a){return client[_0x437a('0x1')](_0x437a('0x4'),{'body':_0xf52f1a,'options':{'where':{'id':_0x5f2883}},'log':_0x437a('0x5')});};
\ No newline at end of file
+var _0xe06f=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request','../client'];(function(_0x16cab9,_0xe5e36d){var _0x4841c8=function(_0x3283a7){while(--_0x3283a7){_0x16cab9['push'](_0x16cab9['shift']());}};_0x4841c8(++_0xe5e36d);}(_0xe06f,0x65));var _0xfe06=function(_0x26e90c,_0x447c47){_0x26e90c=_0x26e90c-0x0;var _0x2f7f10=_0xe06f[_0x26e90c];return _0x2f7f10;};'use strict';var client=require(_0xfe06('0x0'));exports[_0xfe06('0x1')]=function(_0x53e2c9,_0x2ba5f3){return client['Request'](_0xfe06('0x2'),{'body':_0x2ba5f3,'options':{'where':{'id':_0x53e2c9}},'log':_0xfe06('0x3')});};exports[_0xfe06('0x4')]=function(_0x1f0dec,_0x3a07cc){return client[_0xfe06('0x5')]('AddTagsToWhatsappInteraction',{'body':_0x3a07cc,'options':{'where':{'id':_0x1f0dec}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
index f9da548..0f5f41c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f0=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x279f32,_0x19a015){var _0x42e7d1=function(_0x440ff6){while(--_0x440ff6){_0x279f32['push'](_0x279f32['shift']());}};_0x42e7d1(++_0x19a015);}(_0x13f0,0x1be));var _0x013f=function(_0x40da45,_0x29029f){_0x40da45=_0x40da45-0x0;var _0x29f717=_0x13f0[_0x40da45];return _0x29f717;};'use strict';var client=require(_0x013f('0x0'));exports[_0x013f('0x1')]=function(_0x138683){return client[_0x013f('0x2')](_0x013f('0x3'),{'body':_0x138683,'log':_0x013f('0x4')});};
\ No newline at end of file
+var _0x3767=['CreateWhatsappMessage'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x3767,0xa2));var _0x7376=function(_0x38edcf,_0x299af1){_0x38edcf=_0x38edcf-0x0;var _0x4054e3=_0x3767[_0x38edcf];return _0x4054e3;};'use strict';var client=require('../client');exports['create']=function(_0x36e5de){return client['Request'](_0x7376('0x0'),{'body':_0x36e5de,'log':'createWhatsappMessage'});};
\ No newline at end of file
index 0c2d451..69194e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x422f=['GetWhatsappQueue','name','strategy','User','Agents','online','whatsappPause','getWhatsappQueues'];(function(_0x4a745e,_0x468df6){var _0x150784=function(_0x2f0740){while(--_0x2f0740){_0x4a745e['push'](_0x4a745e['shift']());}};_0x150784(++_0x468df6);}(_0x422f,0x1c7));var _0xf422=function(_0x5c596a,_0x1af4f6){_0x5c596a=_0x5c596a-0x0;var _0x557977=_0x422f[_0x5c596a];return _0x557977;};'use strict';var client=require('../client');exports[_0xf422('0x0')]=function(){return function(){return client['Request'](_0xf422('0x1'),{'options':{'raw':![],'attributes':['id',_0xf422('0x2'),'timeout',_0xf422('0x3')],'include':[{'model':_0xf422('0x4'),'as':_0xf422('0x5'),'attributes':['id',_0xf422('0x2'),_0xf422('0x6'),_0xf422('0x7')]}]},'log':_0xf422('0x0')});};};
\ No newline at end of file
+var _0xdb94=['strategy','User','online','../client','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x2c3a8f,_0x374e56){var _0x189412=function(_0x560055){while(--_0x560055){_0x2c3a8f['push'](_0x2c3a8f['shift']());}};_0x189412(++_0x374e56);}(_0xdb94,0xab));var _0x4db9=function(_0x43c4ec,_0x17db71){_0x43c4ec=_0x43c4ec-0x0;var _0x5e212a=_0xdb94[_0x43c4ec];return _0x5e212a;};'use strict';var client=require(_0x4db9('0x0'));exports[_0x4db9('0x1')]=function(){return function(){return client[_0x4db9('0x2')](_0x4db9('0x3'),{'options':{'raw':![],'attributes':['id',_0x4db9('0x4'),'timeout',_0x4db9('0x5')],'include':[{'model':_0x4db9('0x6'),'as':'Agents','attributes':['id','name',_0x4db9('0x7'),'whatsappPause']}]},'log':'getWhatsappQueues'});};};
\ No newline at end of file
index 56b8075..5acc0b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe86a=['CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport','../client','create','Request'];(function(_0x4c62be,_0x4d408d){var _0x362bd6=function(_0x58909f){while(--_0x58909f){_0x4c62be['push'](_0x4c62be['shift']());}};_0x362bd6(++_0x4d408d);}(_0xe86a,0xf9));var _0xae86=function(_0x2f3e0b,_0xf31f13){_0x2f3e0b=_0x2f3e0b-0x0;var _0x460132=_0xe86a[_0x2f3e0b];return _0x460132;};'use strict';var client=require(_0xae86('0x0'));exports[_0xae86('0x1')]=function(_0x31829f){return client[_0xae86('0x2')]('CreateWhatsappQueueReport',{'body':_0x31829f,'log':_0xae86('0x3')});};exports[_0xae86('0x4')]=function(_0x557121,_0x4280e6){return client[_0xae86('0x2')]('UpdateWhatsappQueueReport',{'body':_0x4280e6,'options':{'where':{'uniqueid':_0x557121},'order':[['id',_0xae86('0x5')]],'limit':0x1},'log':_0xae86('0x6')});};
\ No newline at end of file
+var _0x9c12=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','../client'];(function(_0x239ce8,_0x191cb8){var _0x37963f=function(_0x1e9f2a){while(--_0x1e9f2a){_0x239ce8['push'](_0x239ce8['shift']());}};_0x37963f(++_0x191cb8);}(_0x9c12,0x10d));var _0x29c1=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x9c12[_0xc8a931];return _0x28bd27;};'use strict';var client=require(_0x29c1('0x0'));exports[_0x29c1('0x1')]=function(_0x331c7d){return client[_0x29c1('0x2')](_0x29c1('0x3'),{'body':_0x331c7d,'log':_0x29c1('0x3')});};exports['update']=function(_0x2c4424,_0x2d02b){return client[_0x29c1('0x2')]('UpdateWhatsappQueueReport',{'body':_0x2d02b,'options':{'where':{'uniqueid':_0x2c4424},'order':[['id','DESC']],'limit':0x1},'log':_0x29c1('0x4')});};
\ No newline at end of file
index 941458b..7d219ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58ac=['message','join','find','createQueue','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','log','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x58ac,0x121));var _0xc58a=function(_0x52a497,_0xc4c062){_0x52a497=_0x52a497-0x0;var _0x36d05f=_0x58ac[_0x52a497];return _0x36d05f;};'use strict';var schema=require(_0xc58a('0x0'));var _=require(_0xc58a('0x1'));var util=require('util');var seqqueue=require(_0xc58a('0x2'));var logger=require(_0xc58a('0x3'))(_0xc58a('0x4'));var strategy=require(_0xc58a('0x5'));var queue=schema({'name':{'type':_0xc58a('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xc58a('0x7'),'message':_0xc58a('0x8')}});function writeLog(_0x84ddfa,_0x151413,_0x320af5){return logger[_0xc58a('0x9')](util[_0xc58a('0xa')](_0xc58a('0xb'),_0x84ddfa,_0x151413[_0xc58a('0xc')],_0x320af5));}function handleFindAgent(_0x78a348){return function(_0x2e0cc6){return _0x2e0cc6['name'][_0xc58a('0xd')]()===_0x78a348['toLowerCase']();};}exports[_0xc58a('0xe')]=function(_0x1c7bca,_0x27fa14,_0x113dd8,_0x590128){return function(_0x1f7fb8){try{var _0x1139cb={'name':_0x27fa14[0x0],'timeout':_0x27fa14[0x1]};var _0xa00710=queue[_0xc58a('0x0')](_0x1139cb,{'typecast':!![]});if(_0xa00710['length']){logger['error'](_0xc58a('0xf'),_0x1c7bca,_[_0xc58a('0x10')](_0xa00710,_0xc58a('0x11'))[_0xc58a('0x12')](',\x20'));_0x1f7fb8['stop']();}else{var _0x16d114=_[_0xc58a('0x13')](_0x113dd8['agents'],handleFindAgent(_0x1139cb[_0xc58a('0xc')]));if(_0x16d114){var _0x1492f0=(_0x1139cb['timeout']||0xa)*0x3e8;var _0x5be539,_0xcc5c41;var _0x3dc902=seqqueue[_0xc58a('0x14')](_0x1492f0);_0x3dc902['id']=_0x1c7bca;_0x3dc902['atimeout']=_0x1492f0;_0x3dc902[_0xc58a('0x15')]=_0x590128[_0xc58a('0x15')];writeLog(_0x1c7bca,_0x16d114,util[_0xc58a('0xa')]('START:%s',_0x1492f0));_0x113dd8[_0xc58a('0x16')][_0x1c7bca]['on'](_0xc58a('0x17'),function(){logger[_0xc58a('0x9')](_0xc58a('0x18'),_0x1c7bca);clearTimeout(_0xcc5c41);_0xcc5c41=undefined;_0x3dc902[_0xc58a('0x19')]();if(_0x113dd8['rules'][_0x1c7bca]){delete _0x113dd8[_0xc58a('0x16')][_0x1c7bca];}_0x1f7fb8[_0xc58a('0x1a')]();});_0x113dd8[_0xc58a('0x16')][_0x1c7bca]['on']('complete',function(){if(_0x113dd8[_0xc58a('0x16')][_0x1c7bca]){delete _0x113dd8[_0xc58a('0x16')][_0x1c7bca];}});_0xcc5c41=setTimeout(function(){logger[_0xc58a('0x9')](_0xc58a('0x1b'),_0x1c7bca);clearTimeout(_0xcc5c41);_0x3dc902['close']();_0x1f7fb8[_0xc58a('0x1c')]();},_0x1492f0);strategy[_0xc58a('0x1d')](_0x3dc902,_0x16d114,_0x113dd8,_0x590128);}else{logger[_0xc58a('0x1e')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x1c7bca,_0x1139cb['name']);_0x1f7fb8['stop']();}}}catch(_0x23cb9d){console[_0xc58a('0x1f')](_0x23cb9d);logger[_0xc58a('0x1e')](_0xc58a('0x20'),_0x1c7bca,_0x23cb9d[_0xc58a('0x21')]);_0x1f7fb8[_0xc58a('0x1a')]();}};};
\ No newline at end of file
+var _0xe7d5=['[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','createQueue','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe7d5,0x16c));var _0x5e7d=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xe7d5[_0xefd519];return _0x4bb882;};'use strict';var schema=require('validate');var _=require(_0x5e7d('0x0'));var util=require(_0x5e7d('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x5e7d('0x2'))(_0x5e7d('0x3'));var strategy=require(_0x5e7d('0x4'));var queue=schema({'name':{'type':_0x5e7d('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x5e7d('0x6'),'message':_0x5e7d('0x7')}});function writeLog(_0x13f4c8,_0x383e9b,_0x1cc878){return logger[_0x5e7d('0x8')](util[_0x5e7d('0x9')](_0x5e7d('0xa'),_0x13f4c8,_0x383e9b[_0x5e7d('0xb')],_0x1cc878));}function handleFindAgent(_0x5a81a1){return function(_0x350b82){return _0x350b82[_0x5e7d('0xb')][_0x5e7d('0xc')]()===_0x5a81a1[_0x5e7d('0xc')]();};}exports[_0x5e7d('0xd')]=function(_0x408850,_0x4627f0,_0x2ad93e,_0x58911e){return function(_0x3ed947){try{var _0xcba293={'name':_0x4627f0[0x0],'timeout':_0x4627f0[0x1]};var _0x134fc8=queue['validate'](_0xcba293,{'typecast':!![]});if(_0x134fc8['length']){logger['error'](_0x5e7d('0xe'),_0x408850,_[_0x5e7d('0xf')](_0x134fc8,_0x5e7d('0x10'))[_0x5e7d('0x11')](',\x20'));_0x3ed947[_0x5e7d('0x12')]();}else{var _0x5cbb10=_[_0x5e7d('0x13')](_0x2ad93e[_0x5e7d('0x14')],handleFindAgent(_0xcba293['name']));if(_0x5cbb10){var _0xe267f2=(_0xcba293['timeout']||0xa)*0x3e8;var _0x3eb1c4,_0x8d338f;var _0x223d72=seqqueue[_0x5e7d('0x15')](_0xe267f2);_0x223d72['id']=_0x408850;_0x223d72[_0x5e7d('0x16')]=_0xe267f2;_0x223d72[_0x5e7d('0x17')]=_0x58911e[_0x5e7d('0x17')];writeLog(_0x408850,_0x5cbb10,util['format']('START:%s',_0xe267f2));_0x2ad93e[_0x5e7d('0x18')][_0x408850]['on'](_0x5e7d('0x19'),function(){logger[_0x5e7d('0x8')](_0x5e7d('0x1a'),_0x408850);clearTimeout(_0x8d338f);_0x8d338f=undefined;_0x223d72['close']();if(_0x2ad93e[_0x5e7d('0x18')][_0x408850]){delete _0x2ad93e[_0x5e7d('0x18')][_0x408850];}_0x3ed947['stop']();});_0x2ad93e['rules'][_0x408850]['on'](_0x5e7d('0x1b'),function(){if(_0x2ad93e[_0x5e7d('0x18')][_0x408850]){delete _0x2ad93e['rules'][_0x408850];}});_0x8d338f=setTimeout(function(){logger[_0x5e7d('0x8')](_0x5e7d('0x1c'),_0x408850);clearTimeout(_0x8d338f);_0x223d72['close']();_0x3ed947[_0x5e7d('0x1d')]();},_0xe267f2);strategy[_0x5e7d('0x1e')](_0x223d72,_0x5cbb10,_0x2ad93e,_0x58911e);}else{logger[_0x5e7d('0x1f')](_0x5e7d('0x20'),_0x408850,_0xcba293[_0x5e7d('0xb')]);_0x3ed947['stop']();}}}catch(_0x11481a){console[_0x5e7d('0x21')](_0x11481a);logger[_0x5e7d('0x1f')](_0x5e7d('0x22'),_0x408850,_0x11481a[_0x5e7d('0x23')]);_0x3ed947[_0x5e7d('0x12')]();}};};
\ No newline at end of file
index 95c9d2a..74a9e42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','finally','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','Message','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format'];(function(_0x218341,_0x4d44ea){var _0x2093d8=function(_0x3ffa0b){while(--_0x3ffa0b){_0x218341['push'](_0x218341['shift']());}};_0x2093d8(++_0x4d44ea);}(_0xabce,0x103));var _0xeabc=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xabce[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0xeabc('0x0'));var moment=require(_0xeabc('0x1'));var AWS=require(_0xeabc('0x2'));var utils=require(_0xeabc('0x3'));var logger=require(_0xeabc('0x4'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xeabc('0x5')),'mailMessage':require(_0xeabc('0x6')),'smsMessage':require(_0xeabc('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xeabc('0x8')]=function(_0x52a4d7,_0x229ba4){return function(_0x52ede8){try{if(!_[_0xeabc('0x9')](this[_0xeabc('0xa')][_0xeabc('0xb')])){logger['info'](_0xeabc('0xc'),_0x52a4d7,_0xeabc('0xd'));return _0x52ede8[_0xeabc('0xe')]();}var _0x1b4d1b={'ContactId':this[_0xeabc('0xf')]['id'],'sentAt':moment()[_0xeabc('0x10')](_0xeabc('0x11')),'direction':_0xeabc('0x12')};var _0xdb5022=this[_0xeabc('0x13')];if(_0xdb5022===_0xeabc('0x14')){_0x1b4d1b[_0xeabc('0x15')]=this[_0xeabc('0x16')]['id'];}else{_0x1b4d1b[_[_0xeabc('0x17')](_0xdb5022)+_0xeabc('0x18')]=this[_0xeabc('0x16')]['id'];}_0x1b4d1b[_['upperFirst'](_0xdb5022)+_0xeabc('0x19')]=this[_0xeabc('0xa')]['id'];if(this[_0xeabc('0xa')]['created']){var _0x5f4ee8=_0x229ba4[0x4];if(!_[_0xeabc('0x1a')](_0x5f4ee8)){_0x1b4d1b[_0xeabc('0x1b')]=utils[_0xeabc('0x1c')](_0x5f4ee8,this);return rpc[_0xdb5022+'Message'][_0xeabc('0x1d')](_0x1b4d1b)[_0xeabc('0x1e')](function(_0x49f2d8){logger['info'](_0xeabc('0xc'),_0x52a4d7,_0x1b4d1b['body']);})[_0xeabc('0x1f')](function(_0x1b64b9){logger[_0xeabc('0x20')](_0xeabc('0xc'),_0x52a4d7,JSON[_0xeabc('0x21')](_0x1b64b9));})[_0xeabc('0x22')](function(){logger[_0xeabc('0x23')](_0xeabc('0x24'),_0x52a4d7);_0x52ede8['stop']();});}else{logger[_0xeabc('0x23')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x52a4d7);_0x52ede8[_0xeabc('0x25')]();}}else{var _0x16530c=this;var _0x502947=new AWS[(_0xeabc('0x26'))]({'accessKeyId':_0x229ba4[0x0],'secretAccessKey':_0x229ba4[0x1],'region':_0x229ba4[0x2]});var _0x41d67a={'botAlias':_0xeabc('0x27'),'botName':_0x229ba4[0x3],'inputText':this[_0xeabc('0x28')][_0xeabc('0x1b')],'userId':this['channel']+':'+this[_0xeabc('0xa')]['id'][_0xeabc('0x29')]()};_0x502947[_0xeabc('0x2a')](_0x41d67a,function(_0x5bdd57,_0x457f27){if(_0x5bdd57){logger[_0xeabc('0x20')](_0xeabc('0xc'),_0x52a4d7,_0x5bdd57[_0xeabc('0x28')]);_0x52ede8['next']();}else if(_0x457f27&&_0x457f27[_0xeabc('0x28')]){_0x16530c['body'][_0xeabc('0x2b')]=_0x457f27;_0x1b4d1b['body']=_0x457f27[_0xeabc('0x28')];return rpc[_0xdb5022+_0xeabc('0x2c')][_0xeabc('0x1d')](_0x1b4d1b)[_0xeabc('0x1e')](function(_0x3a1a04){logger[_0xeabc('0x23')](_0xeabc('0xc'),_0x52a4d7,_0x1b4d1b['body']);if(_0x457f27['dialogState']==_0xeabc('0x2d')){_0x52ede8['next']();}else{_0x52ede8[_0xeabc('0x25')]();}})[_0xeabc('0x1f')](function(_0x48fb52){logger[_0xeabc('0x20')](_0xeabc('0xc'),_0x52a4d7,JSON[_0xeabc('0x21')](_0x48fb52));_0x52ede8[_0xeabc('0xe')]();});}else{_0x52ede8[_0xeabc('0xe')]();}});}}catch(_0x481ee1){logger[_0xeabc('0x20')](_0xeabc('0xc'),_0x52a4d7,JSON[_0xeabc('0x21')](_0x481ee1));_0x52ede8['stop']();}};};
\ No newline at end of file
+var _0x1261=['error','amazonlex','Message','then','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','create','catch','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','postText'];(function(_0x5467ab,_0x3b3fe8){var _0x2fcdd7=function(_0x31868d){while(--_0x31868d){_0x5467ab['push'](_0x5467ab['shift']());}};_0x2fcdd7(++_0x3b3fe8);}(_0x1261,0x144));var _0x1126=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0x1261[_0x403115];return _0x596ef3;};'use strict';var _=require('lodash');var moment=require(_0x1126('0x0'));var AWS=require(_0x1126('0x1'));var utils=require(_0x1126('0x2'));var logger=require(_0x1126('0x3'))(_0x1126('0x4'));var rpc={'chatMessage':require(_0x1126('0x5')),'openchannelMessage':require(_0x1126('0x6')),'mailMessage':require(_0x1126('0x7')),'smsMessage':require(_0x1126('0x8')),'faxMessage':require(_0x1126('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x40ba58,_0x907180){return function(_0x4f239c){try{if(!_[_0x1126('0xa')](this[_0x1126('0xb')][_0x1126('0xc')])){logger[_0x1126('0xd')](_0x1126('0xe'),_0x40ba58,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4f239c[_0x1126('0xf')]();}var _0x18dbe6={'ContactId':this[_0x1126('0x10')]['id'],'sentAt':moment()['format'](_0x1126('0x11')),'direction':'out'};var _0x52ef15=this[_0x1126('0x12')];if(_0x52ef15==='chat'){_0x18dbe6[_0x1126('0x13')]=this[_0x1126('0x14')]['id'];}else{_0x18dbe6[_[_0x1126('0x15')](_0x52ef15)+_0x1126('0x16')]=this[_0x1126('0x14')]['id'];}_0x18dbe6[_[_0x1126('0x15')](_0x52ef15)+_0x1126('0x17')]=this[_0x1126('0xb')]['id'];if(this[_0x1126('0xb')]['created']){var _0x5de9a7=_0x907180[0x4];if(!_[_0x1126('0x18')](_0x5de9a7)){_0x18dbe6[_0x1126('0x19')]=utils[_0x1126('0x1a')](_0x5de9a7,this);return rpc[_0x52ef15+'Message'][_0x1126('0x1b')](_0x18dbe6)['then'](function(_0x35fe9f){logger[_0x1126('0xd')](_0x1126('0xe'),_0x40ba58,_0x18dbe6['body']);})[_0x1126('0x1c')](function(_0x1695f6){logger['error']('[%s][AMAZONLEX]\x20%s',_0x40ba58,JSON[_0x1126('0x1d')](_0x1695f6));})[_0x1126('0x1e')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x40ba58);_0x4f239c[_0x1126('0x1f')]();});}else{logger['info'](_0x1126('0x20'),_0x40ba58);_0x4f239c[_0x1126('0x1f')]();}}else{var _0x2f70ac=this;var _0x54400a=new AWS[(_0x1126('0x21'))]({'accessKeyId':_0x907180[0x0],'secretAccessKey':_0x907180[0x1],'region':_0x907180[0x2]});var _0x49d209={'botAlias':'$LATEST','botName':_0x907180[0x3],'inputText':this[_0x1126('0x22')][_0x1126('0x19')],'userId':this[_0x1126('0x12')]+':'+this[_0x1126('0xb')]['id']['toString']()};_0x54400a[_0x1126('0x23')](_0x49d209,function(_0x477e6a,_0x48a08d){if(_0x477e6a){logger[_0x1126('0x24')]('[%s][AMAZONLEX]\x20%s',_0x40ba58,_0x477e6a['message']);_0x4f239c['next']();}else if(_0x48a08d&&_0x48a08d[_0x1126('0x22')]){_0x2f70ac[_0x1126('0x19')][_0x1126('0x25')]=_0x48a08d;_0x18dbe6[_0x1126('0x19')]=_0x48a08d[_0x1126('0x22')];return rpc[_0x52ef15+_0x1126('0x26')][_0x1126('0x1b')](_0x18dbe6)[_0x1126('0x27')](function(_0x589725){logger[_0x1126('0xd')](_0x1126('0xe'),_0x40ba58,_0x18dbe6[_0x1126('0x19')]);if(_0x48a08d['dialogState']=='Failed'){_0x4f239c[_0x1126('0xf')]();}else{_0x4f239c[_0x1126('0x1f')]();}})['catch'](function(_0x2fb797){logger[_0x1126('0x24')]('[%s][AMAZONLEX]\x20%s',_0x40ba58,JSON[_0x1126('0x1d')](_0x2fb797));_0x4f239c['next']();});}else{_0x4f239c[_0x1126('0xf')]();}});}}catch(_0x4bd50b){logger[_0x1126('0x24')]('[%s][AMAZONLEX]\x20%s',_0x40ba58,JSON[_0x1126('0x1d')](_0x4bd50b));_0x4f239c['stop']();}};};
\ No newline at end of file
index 13e07a3..d18f39c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ff5=['../../rpc/mailMessage','../../rpc/whatsappMessage','../../mailRpc','consequence','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','channel','getMustacheRender','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','mail','Smtp','service','host','port','secure','authentication','auth','user','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','body','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','stop','lodash','routing','../../rpc/openchannelMessage'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x6ff5,0xab));var _0x56ff=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6ff5[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x56ff('0x0'));var moment=require('moment');var utils=require('./utils');var logger=require('../../../../config/logger')(_0x56ff('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x56ff('0x2')),'mailMessage':require(_0x56ff('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x56ff('0x4'))};var mailRpc=require(_0x56ff('0x5'));exports[_0x56ff('0x6')]=function(_0x3f06be,_0x1f7c30){return function(_0x308195){try{if(_0x1f7c30[0x0]==='1'&&(_[_0x56ff('0x7')](this[_0x56ff('0x8')][_0x56ff('0x9')])||!this[_0x56ff('0x8')][_0x56ff('0x9')])){logger[_0x56ff('0xa')](_0x56ff('0xb'),_0x3f06be,_0x56ff('0xc'));return _0x308195[_0x56ff('0xd')]();}var _0x2ea094=this[_0x56ff('0xe')];var _0x27a815={'body':utils[_0x56ff('0xf')](_0x1f7c30[0x1],this),'ContactId':this[_0x56ff('0x10')]['id'],'sentAt':moment()[_0x56ff('0x11')](_0x56ff('0x12')),'direction':_0x56ff('0x13')};if(this[_0x56ff('0x14')]){_0x27a815['to']=this[_0x56ff('0x14')][_0x56ff('0x15')]||'';_0x27a815['cc']=this[_0x56ff('0x14')]['cc']||'';_0x27a815[_0x56ff('0x15')]=this[_0x56ff('0x14')]['to']||'';_0x27a815[_0x56ff('0x16')]=this[_0x56ff('0x14')][_0x56ff('0x16')]||'';_0x27a815[_0x56ff('0x17')]=!![];if(this['message'][_0x56ff('0x18')]){_0x27a815[_0x56ff('0x18')]='';_0x27a815[_0x56ff('0x18')]+=_[_0x56ff('0x19')](this[_0x56ff('0x14')]['subject'],'Re:')?'':_0x56ff('0x1a');_0x27a815[_0x56ff('0x18')]+=this['message'][_0x56ff('0x18')];}}if(this[_0x56ff('0xe')]===_0x56ff('0x1b')){_0x27a815[_0x56ff('0x1c')]=this['account']['id'];}else{_0x27a815[_[_0x56ff('0x1d')](this['channel'])+_0x56ff('0x1e')]=this[_0x56ff('0x1f')]['id'];}_0x27a815[_[_0x56ff('0x1d')](this['channel'])+_0x56ff('0x20')]=this[_0x56ff('0x8')]['id'];if(rpc[this[_0x56ff('0xe')]+_0x56ff('0x21')]){if(this[_0x56ff('0xe')]===_0x56ff('0x22')){var _0x365fb4={'tls':{'rejectUnauthorized':![]}};if(this[_0x56ff('0x1f')][_0x56ff('0x23')][_0x56ff('0x24')]){_0x365fb4[_0x56ff('0x24')]=this[_0x56ff('0x1f')][_0x56ff('0x23')]['service'];}else{_0x365fb4[_0x56ff('0x25')]=this['account']['Smtp']['host'];_0x365fb4['port']=this[_0x56ff('0x1f')][_0x56ff('0x23')][_0x56ff('0x26')];_0x365fb4[_0x56ff('0x27')]=this[_0x56ff('0x1f')][_0x56ff('0x23')]['secure'];}if(this[_0x56ff('0x1f')][_0x56ff('0x23')][_0x56ff('0x28')]){_0x365fb4[_0x56ff('0x29')]={'user':this[_0x56ff('0x1f')][_0x56ff('0x23')][_0x56ff('0x2a')],'pass':this[_0x56ff('0x1f')][_0x56ff('0x23')]['pass']};}_0x27a815[_0x56ff('0x2b')]=this[_0x56ff('0x14')][_0x56ff('0x2c')];_0x27a815[_0x56ff('0x2d')]=_0x56ff('0x2e')+_[_0x56ff('0x2f')](_0x27a815[_0x56ff('0x30')],'<div\x20id=\x22xm-mail-content\x22','<div')+'</div>';return mailRpc['sendMailMessage'](_0x365fb4,_0x27a815)[_0x56ff('0x31')](function(_0x4d604f){logger[_0x56ff('0xa')](_0x56ff('0x32'),_0x3f06be);_0x27a815[_0x56ff('0x2c')]=_0x4d604f['message'][_0x56ff('0x2c')];return rpc[_0x2ea094+_0x56ff('0x21')][_0x56ff('0x33')](_0x27a815);})['then'](function(_0x1287a6){logger[_0x56ff('0xa')]('[%s][AUTOREPLY]\x20%s',_0x3f06be,JSON[_0x56ff('0x34')](_0x1287a6));})[_0x56ff('0x35')](function(_0x186748){logger[_0x56ff('0x36')](_0x56ff('0x37'),_0x3f06be,JSON[_0x56ff('0x34')](_0x186748));})[_0x56ff('0x38')](function(){_0x308195[_0x56ff('0xd')]();});}else{return rpc[this['channel']+_0x56ff('0x21')][_0x56ff('0x33')](_0x27a815)[_0x56ff('0x31')](function(_0x4d7baf){logger[_0x56ff('0xa')](_0x56ff('0xb'),_0x3f06be,_0x27a815[_0x56ff('0x30')]);})[_0x56ff('0x35')](function(_0x4a2093){logger[_0x56ff('0x36')]('[%s][AUTOREPLY]\x20%s',_0x3f06be,JSON[_0x56ff('0x34')](_0x4a2093));})[_0x56ff('0x38')](function(){_0x308195[_0x56ff('0xd')]();});}}}catch(_0x3ce820){logger['error'](_0x56ff('0xb'),_0x3f06be,JSON[_0x56ff('0x34')](_0x3ce820));_0x308195[_0x56ff('0x39')]();}};};
\ No newline at end of file
+var _0x04d0=['Autoreply\x20already\x20sent','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','ChatWebsiteId','account','upperFirst','channel','AccountId','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','messageId','html','replace','body','<div\x20id=\x22xm-mail-content\x22','<div','</div>','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','[%s][AUTOREPLY]\x20%s','stringify','catch','error','finally','stop','lodash','moment','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','created','info'];(function(_0x8b68c2,_0x5af07f){var _0x596626=function(_0x4e00c6){while(--_0x4e00c6){_0x8b68c2['push'](_0x8b68c2['shift']());}};_0x596626(++_0x5af07f);}(_0x04d0,0x1bc));var _0x004d=function(_0x4e4f69,_0x234662){_0x4e4f69=_0x4e4f69-0x0;var _0x24459e=_0x04d0[_0x4e4f69];return _0x24459e;};'use strict';var _=require(_0x004d('0x0'));var moment=require(_0x004d('0x1'));var utils=require('./utils');var logger=require(_0x004d('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x004d('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x004d('0x4')),'faxMessage':require(_0x004d('0x5')),'whatsappMessage':require(_0x004d('0x6'))};var mailRpc=require('../../mailRpc');exports[_0x004d('0x7')]=function(_0x2a0c23,_0x35fafb){return function(_0x5706df){try{if(_0x35fafb[0x0]==='1'&&(_[_0x004d('0x8')](this[_0x004d('0x9')]['created'])||!this[_0x004d('0x9')][_0x004d('0xa')])){logger[_0x004d('0xb')]('[%s][AUTOREPLY]\x20%s',_0x2a0c23,_0x004d('0xc'));return _0x5706df[_0x004d('0xd')]();}var _0x46bc28=this['channel'];var _0x1b6d59={'body':utils['getMustacheRender'](_0x35fafb[0x1],this),'ContactId':this[_0x004d('0xe')]['id'],'sentAt':moment()[_0x004d('0xf')](_0x004d('0x10')),'direction':_0x004d('0x11')};if(this[_0x004d('0x12')]){_0x1b6d59['to']=this['message'][_0x004d('0x13')]||'';_0x1b6d59['cc']=this[_0x004d('0x12')]['cc']||'';_0x1b6d59[_0x004d('0x13')]=this[_0x004d('0x12')]['to']||'';_0x1b6d59[_0x004d('0x14')]=this[_0x004d('0x12')][_0x004d('0x14')]||'';_0x1b6d59[_0x004d('0x15')]=!![];if(this[_0x004d('0x12')][_0x004d('0x16')]){_0x1b6d59[_0x004d('0x16')]='';_0x1b6d59[_0x004d('0x16')]+=_[_0x004d('0x17')](this[_0x004d('0x12')][_0x004d('0x16')],_0x004d('0x18'))?'':'Re:\x20';_0x1b6d59['subject']+=this['message']['subject'];}}if(this['channel']==='chat'){_0x1b6d59[_0x004d('0x19')]=this[_0x004d('0x1a')]['id'];}else{_0x1b6d59[_[_0x004d('0x1b')](this[_0x004d('0x1c')])+_0x004d('0x1d')]=this[_0x004d('0x1a')]['id'];}_0x1b6d59[_[_0x004d('0x1b')](this[_0x004d('0x1c')])+'InteractionId']=this[_0x004d('0x9')]['id'];if(rpc[this['channel']+_0x004d('0x1e')]){if(this[_0x004d('0x1c')]==='mail'){var _0x2eb282={'tls':{'rejectUnauthorized':![]}};if(this[_0x004d('0x1a')][_0x004d('0x1f')]['service']){_0x2eb282[_0x004d('0x20')]=this[_0x004d('0x1a')]['Smtp']['service'];}else{_0x2eb282[_0x004d('0x21')]=this[_0x004d('0x1a')]['Smtp'][_0x004d('0x21')];_0x2eb282[_0x004d('0x22')]=this['account'][_0x004d('0x1f')][_0x004d('0x22')];_0x2eb282[_0x004d('0x23')]=this[_0x004d('0x1a')][_0x004d('0x1f')][_0x004d('0x23')];}if(this['account'][_0x004d('0x1f')][_0x004d('0x24')]){_0x2eb282['auth']={'user':this[_0x004d('0x1a')][_0x004d('0x1f')][_0x004d('0x25')],'pass':this[_0x004d('0x1a')][_0x004d('0x1f')][_0x004d('0x26')]};}_0x1b6d59[_0x004d('0x27')]=this[_0x004d('0x12')][_0x004d('0x28')];_0x1b6d59[_0x004d('0x29')]='<div\x20id=\x22xm-mail-content\x22>'+_[_0x004d('0x2a')](_0x1b6d59[_0x004d('0x2b')],_0x004d('0x2c'),_0x004d('0x2d'))+_0x004d('0x2e');return mailRpc[_0x004d('0x2f')](_0x2eb282,_0x1b6d59)[_0x004d('0x30')](function(_0x1ebd38){logger['info'](_0x004d('0x31'),_0x2a0c23);_0x1b6d59['messageId']=_0x1ebd38[_0x004d('0x12')]['messageId'];return rpc[_0x46bc28+_0x004d('0x1e')][_0x004d('0x32')](_0x1b6d59);})[_0x004d('0x30')](function(_0x1dd1c2){logger['info'](_0x004d('0x33'),_0x2a0c23,JSON[_0x004d('0x34')](_0x1dd1c2));})[_0x004d('0x35')](function(_0x458452){logger[_0x004d('0x36')]('[RPC][%s][AUTOREPLY]\x20%s',_0x2a0c23,JSON[_0x004d('0x34')](_0x458452));})['finally'](function(){_0x5706df[_0x004d('0xd')]();});}else{return rpc[this['channel']+_0x004d('0x1e')][_0x004d('0x32')](_0x1b6d59)[_0x004d('0x30')](function(_0x5c18b4){logger[_0x004d('0xb')]('[%s][AUTOREPLY]\x20%s',_0x2a0c23,_0x1b6d59[_0x004d('0x2b')]);})[_0x004d('0x35')](function(_0x140126){logger[_0x004d('0x36')]('[%s][AUTOREPLY]\x20%s',_0x2a0c23,JSON['stringify'](_0x140126));})[_0x004d('0x37')](function(){_0x5706df['next']();});}}}catch(_0x2fd358){logger[_0x004d('0x36')]('[%s][AUTOREPLY]\x20%s',_0x2a0c23,JSON[_0x004d('0x34')](_0x2fd358));_0x5706df[_0x004d('0x38')]();}};};
\ No newline at end of file
index 5b70151..042420c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e47=['Interaction','interaction','then','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel'];(function(_0x138d5f,_0x182a7f){var _0x4d8a0a=function(_0x5eaf9d){while(--_0x5eaf9d){_0x138d5f['push'](_0x138d5f['shift']());}};_0x4d8a0a(++_0x182a7f);}(_0x4e47,0x17f));var _0x74e4=function(_0x4680f9,_0x31837e){_0x4680f9=_0x4680f9-0x0;var _0x3e38dc=_0x4e47[_0x4680f9];return _0x3e38dc;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')(_0x74e4('0x0'));var rpc={'chatInteraction':require(_0x74e4('0x1')),'openchannelInteraction':require(_0x74e4('0x2')),'smsInteraction':require(_0x74e4('0x3')),'mailInteraction':require(_0x74e4('0x4')),'faxInteraction':require(_0x74e4('0x5')),'whatsappInteraction':require(_0x74e4('0x6'))};exports[_0x74e4('0x7')]=function(_0x5d03b8,_0x28055c,_0x19ec88,_0x504519){return function(_0x15f9e1){try{logger[_0x74e4('0x8')](_0x74e4('0x9'),_0x5d03b8,_0x28055c[0x0]);var _0x2e61b6={'closed':0x1,'closedAt':moment()[_0x74e4('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x74e4('0xb'),'disposition':_0x28055c[0x0]};if(rpc[_0x504519[_0x74e4('0xc')]+_0x74e4('0xd')]){rpc[_0x504519[_0x74e4('0xc')]+_0x74e4('0xd')]['update'](_0x504519[_0x74e4('0xe')]['id'],_0x2e61b6)[_0x74e4('0xf')](function(_0x55ef15){logger[_0x74e4('0x8')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5d03b8,_0x504519[_0x74e4('0xe')]['id']);})[_0x74e4('0x10')](function(_0x1c55cd){logger[_0x74e4('0x11')](_0x74e4('0x12'),_0x5d03b8,JSON[_0x74e4('0x13')](_0x1c55cd));})[_0x74e4('0x14')](function(){_0x15f9e1[_0x74e4('0x15')]();});}}catch(_0x1dda27){logger[_0x74e4('0x11')](_0x74e4('0x12'),_0x5d03b8,JSON['stringify'](_0x1dda27));_0x15f9e1['stop']();}};};
\ No newline at end of file
+var _0x095b=['format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s'];(function(_0x4d5389,_0x49a915){var _0x58e9da=function(_0x2c2a58){while(--_0x2c2a58){_0x4d5389['push'](_0x4d5389['shift']());}};_0x58e9da(++_0x49a915);}(_0x095b,0x6e));var _0xb095=function(_0xb9f710,_0x5070c7){_0xb9f710=_0xb9f710-0x0;var _0x23c4c7=_0x095b[_0xb9f710];return _0x23c4c7;};'use strict';var moment=require(_0xb095('0x0'));var logger=require('../../../../config/logger')(_0xb095('0x1'));var rpc={'chatInteraction':require(_0xb095('0x2')),'openchannelInteraction':require(_0xb095('0x3')),'smsInteraction':require(_0xb095('0x4')),'mailInteraction':require(_0xb095('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xb095('0x6'))};exports[_0xb095('0x7')]=function(_0x12979f,_0x2f5412,_0x10a03d,_0x3e4cc9){return function(_0x24deed){try{logger[_0xb095('0x8')](_0xb095('0x9'),_0x12979f,_0x2f5412[0x0]);var _0x47a5eb={'closed':0x1,'closedAt':moment()[_0xb095('0xa')](_0xb095('0xb')),'closeReason':_0xb095('0xc'),'disposition':_0x2f5412[0x0]};if(rpc[_0x3e4cc9[_0xb095('0xd')]+_0xb095('0xe')]){rpc[_0x3e4cc9[_0xb095('0xd')]+'Interaction']['update'](_0x3e4cc9[_0xb095('0xf')]['id'],_0x47a5eb)[_0xb095('0x10')](function(_0x52f0c5){logger[_0xb095('0x8')](_0xb095('0x11'),_0x12979f,_0x3e4cc9['interaction']['id']);})[_0xb095('0x12')](function(_0x5e0fb3){logger[_0xb095('0x13')](_0xb095('0x14'),_0x12979f,JSON[_0xb095('0x15')](_0x5e0fb3));})[_0xb095('0x16')](function(){_0x24deed[_0xb095('0x17')]();});}}catch(_0x394df0){logger[_0xb095('0x13')]('[%s][CLOSE]\x20%s',_0x12979f,JSON[_0xb095('0x15')](_0x394df0));_0x24deed[_0xb095('0x17')]();}};};
\ No newline at end of file
index 013d62e..5f9d4b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0fc=['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','message','result','fulfillment','metadata','catch','lodash','apiai-promise','md5','./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','upperFirst','InteractionId','created','body','getMustacheRender','Message','create','then','error'];(function(_0x2c7514,_0x3c0178){var _0xb80c34=function(_0x1ff3ea){while(--_0x1ff3ea){_0x2c7514['push'](_0x2c7514['shift']());}};_0xb80c34(++_0x3c0178);}(_0xa0fc,0x107));var _0xca0f=function(_0x5a7112,_0x1f9492){_0x5a7112=_0x5a7112-0x0;var _0x3147f7=_0xa0fc[_0x5a7112];return _0x3147f7;};'use strict';var _=require(_0xca0f('0x0'));var moment=require('moment');var apiai=require(_0xca0f('0x1'));var md5=require(_0xca0f('0x2'));var utils=require(_0xca0f('0x3'));var logger=require(_0xca0f('0x4'))(_0xca0f('0x5'));var rpc={'chatMessage':require(_0xca0f('0x6')),'openchannelMessage':require(_0xca0f('0x7')),'mailMessage':require(_0xca0f('0x8')),'smsMessage':require(_0xca0f('0x9')),'faxMessage':require(_0xca0f('0xa')),'whatsappMessage':require(_0xca0f('0xb'))};exports[_0xca0f('0xc')]=function(_0x266f94,_0x188d7a){return function(_0x5c63a8){try{if(!_[_0xca0f('0xd')](this[_0xca0f('0xe')][_0xca0f('0xf')])){logger[_0xca0f('0x10')](_0xca0f('0x11'),_0x266f94,_0xca0f('0x12'));return _0x5c63a8[_0xca0f('0x13')]();}var _0xca2113={'ContactId':this[_0xca0f('0x14')]['id'],'sentAt':moment()[_0xca0f('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};var _0x33185e=this['channel'];if(_0x33185e==='chat'){_0xca2113['ChatWebsiteId']=this['account']['id'];}else{_0xca2113[_[_0xca0f('0x16')](_0x33185e)+'AccountId']=this['account']['id'];}_0xca2113[_[_0xca0f('0x16')](_0x33185e)+_0xca0f('0x17')]=this[_0xca0f('0xe')]['id'];if(this['interaction'][_0xca0f('0x18')]){var _0x482a60=_0x188d7a[0x2];if(!_['isEmpty'](_0x482a60)){_0xca2113[_0xca0f('0x19')]=utils[_0xca0f('0x1a')](_0x482a60,this);return rpc[_0x33185e+_0xca0f('0x1b')][_0xca0f('0x1c')](_0xca2113)[_0xca0f('0x1d')](function(_0x5aa9ba){logger['info'](_0xca0f('0x11'),_0x266f94,_0xca2113[_0xca0f('0x19')]);})['catch'](function(_0x22861d){logger[_0xca0f('0x1e')](_0xca0f('0x11'),_0x266f94,JSON[_0xca0f('0x1f')](_0x22861d));})[_0xca0f('0x20')](function(){logger[_0xca0f('0x10')](_0xca0f('0x21'),_0x266f94);_0x5c63a8[_0xca0f('0x22')]();});}else{logger['info'](_0xca0f('0x23'),_0x266f94);_0x5c63a8['stop']();}}else{var _0x46245b=this;var _0x129d80=apiai(_0x188d7a[0x0],{'language':_0x188d7a[0x1]||'en'});return _0x129d80[_0xca0f('0x24')](this[_0xca0f('0x25')][_0xca0f('0x19')],{'sessionId':md5(this[_0xca0f('0xe')]['id'])})[_0xca0f('0x1d')](function(_0x1b6619){_0x46245b[_0xca0f('0x19')]['dialogflow']=_0x1b6619;_0xca2113[_0xca0f('0x19')]=_0x1b6619[_0xca0f('0x26')][_0xca0f('0x27')]['speech'];return rpc[_0x33185e+_0xca0f('0x1b')][_0xca0f('0x1c')](_0xca2113)[_0xca0f('0x1d')](function(_0x5257f3){logger['info'](_0xca0f('0x11'),_0x266f94,_0xca2113[_0xca0f('0x19')]);if(_0x1b6619[_0xca0f('0x26')][_0xca0f('0x28')]['endConversation']){_0x5c63a8['next']();}else{_0x5c63a8[_0xca0f('0x22')]();}})['catch'](function(_0x1f3e02){logger[_0xca0f('0x1e')]('[%s][DIALOGFLOW]\x20%s',_0x266f94,JSON[_0xca0f('0x1f')](_0x1f3e02));_0x5c63a8[_0xca0f('0x13')]();});})[_0xca0f('0x29')](function(_0x3ab93d){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x266f94,_0x3ab93d['message']);_0x5c63a8[_0xca0f('0x13')]();});}}catch(_0x3b31a1){logger[_0xca0f('0x1e')](_0xca0f('0x11'),_0x266f94,JSON[_0xca0f('0x1f')](_0x3b31a1));_0x5c63a8['stop']();}};};
\ No newline at end of file
+var _0x27d0=['body','getMustacheRender','create','then','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','message','dialogflow','result','fulfillment','Message','endConversation','catch','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','account','upperFirst','AccountId','InteractionId','interaction','created'];(function(_0x1bb058,_0x36f9fa){var _0x493b9e=function(_0xa7ecd0){while(--_0xa7ecd0){_0x1bb058['push'](_0x1bb058['shift']());}};_0x493b9e(++_0x36f9fa);}(_0x27d0,0x9f));var _0x027d=function(_0x427cd9,_0x1680e0){_0x427cd9=_0x427cd9-0x0;var _0x40f890=_0x27d0[_0x427cd9];return _0x40f890;};'use strict';var _=require(_0x027d('0x0'));var moment=require(_0x027d('0x1'));var apiai=require(_0x027d('0x2'));var md5=require(_0x027d('0x3'));var utils=require(_0x027d('0x4'));var logger=require(_0x027d('0x5'))(_0x027d('0x6'));var rpc={'chatMessage':require(_0x027d('0x7')),'openchannelMessage':require(_0x027d('0x8')),'mailMessage':require(_0x027d('0x9')),'smsMessage':require(_0x027d('0xa')),'faxMessage':require(_0x027d('0xb')),'whatsappMessage':require(_0x027d('0xc'))};exports['consequence']=function(_0x33dd70,_0x2c2ffb){return function(_0x4e957b){try{if(!_[_0x027d('0xd')](this['interaction']['UserId'])){logger[_0x027d('0xe')](_0x027d('0xf'),_0x33dd70,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4e957b[_0x027d('0x10')]();}var _0x168497={'ContactId':this[_0x027d('0x11')]['id'],'sentAt':moment()[_0x027d('0x12')](_0x027d('0x13')),'direction':_0x027d('0x14')};var _0x31fa54=this[_0x027d('0x15')];if(_0x31fa54===_0x027d('0x16')){_0x168497['ChatWebsiteId']=this[_0x027d('0x17')]['id'];}else{_0x168497[_[_0x027d('0x18')](_0x31fa54)+_0x027d('0x19')]=this[_0x027d('0x17')]['id'];}_0x168497[_[_0x027d('0x18')](_0x31fa54)+_0x027d('0x1a')]=this['interaction']['id'];if(this[_0x027d('0x1b')][_0x027d('0x1c')]){var _0x93610e=_0x2c2ffb[0x2];if(!_['isEmpty'](_0x93610e)){_0x168497[_0x027d('0x1d')]=utils[_0x027d('0x1e')](_0x93610e,this);return rpc[_0x31fa54+'Message'][_0x027d('0x1f')](_0x168497)[_0x027d('0x20')](function(_0x3bd4f0){logger[_0x027d('0xe')](_0x027d('0xf'),_0x33dd70,_0x168497[_0x027d('0x1d')]);})['catch'](function(_0x26bb5f){logger[_0x027d('0x21')](_0x027d('0xf'),_0x33dd70,JSON[_0x027d('0x22')](_0x26bb5f));})[_0x027d('0x23')](function(){logger['info'](_0x027d('0x24'),_0x33dd70);_0x4e957b[_0x027d('0x25')]();});}else{logger[_0x027d('0xe')](_0x027d('0x26'),_0x33dd70);_0x4e957b[_0x027d('0x25')]();}}else{var _0x46ebbf=this;var _0x5e5484=apiai(_0x2c2ffb[0x0],{'language':_0x2c2ffb[0x1]||'en'});return _0x5e5484[_0x027d('0x27')](this[_0x027d('0x28')][_0x027d('0x1d')],{'sessionId':md5(this['interaction']['id'])})[_0x027d('0x20')](function(_0x87fb7d){_0x46ebbf[_0x027d('0x1d')][_0x027d('0x29')]=_0x87fb7d;_0x168497['body']=_0x87fb7d[_0x027d('0x2a')][_0x027d('0x2b')]['speech'];return rpc[_0x31fa54+_0x027d('0x2c')][_0x027d('0x1f')](_0x168497)[_0x027d('0x20')](function(_0x4a2d6a){logger[_0x027d('0xe')](_0x027d('0xf'),_0x33dd70,_0x168497[_0x027d('0x1d')]);if(_0x87fb7d[_0x027d('0x2a')]['metadata'][_0x027d('0x2d')]){_0x4e957b[_0x027d('0x10')]();}else{_0x4e957b[_0x027d('0x25')]();}})[_0x027d('0x2e')](function(_0x16197a){logger['error'](_0x027d('0xf'),_0x33dd70,JSON[_0x027d('0x22')](_0x16197a));_0x4e957b['next']();});})[_0x027d('0x2e')](function(_0x1fc408){logger[_0x027d('0x21')](_0x027d('0xf'),_0x33dd70,_0x1fc408[_0x027d('0x28')]);_0x4e957b[_0x027d('0x10')]();});}}catch(_0x5c850c){logger[_0x027d('0x21')](_0x027d('0xf'),_0x33dd70,JSON[_0x027d('0x22')](_0x5c850c));_0x4e957b[_0x027d('0x25')]();}};};
\ No newline at end of file
index 10fa676..fafe952 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf320=['[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','getMustacheRender','replace','length','error'];(function(_0xa6ce28,_0x1f98da){var _0x40798a=function(_0x378aa7){while(--_0x378aa7){_0xa6ce28['push'](_0xa6ce28['shift']());}};_0x40798a(++_0x1f98da);}(_0xf320,0x11d));var _0x0f32=function(_0x34db17,_0x51dff0){_0x34db17=_0x34db17-0x0;var _0x5ba6b2=_0xf320[_0x34db17];return _0x5ba6b2;};'use strict';var schema=require(_0x0f32('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0x0f32('0x1'));var logger=require(_0x0f32('0x2'))(_0x0f32('0x3'));var gotoif=schema({'condition':{'type':_0x0f32('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x0f32('0x5'),'message':_0x0f32('0x6')},'priorityFalse':{'type':'number','message':_0x0f32('0x7')}});exports['consequence']=function(_0x4952f4,_0xdb5d19){return function(_0x17289e){try{var _0x4dd99a={'condition':htmlToText['fromString'](utils[_0x0f32('0x8')](_0xdb5d19[0x0],this),{'wordwrap':![]})[_0x0f32('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xdb5d19[0x1],'priorityFalse':_0xdb5d19[0x2]};var _0x3fed11=gotoif['validate'](_0x4dd99a,{'typecast':!![]});if(_0x3fed11[_0x0f32('0xa')]){logger[_0x0f32('0xb')](_0x0f32('0xc'),_0x4952f4,_[_0x0f32('0xd')](_0x3fed11,_0x0f32('0xe'))[_0x0f32('0xf')](',\x20'));_0x17289e[_0x0f32('0x10')]();}else{try{var _0x5eead8=eval('('+_0x4dd99a[_0x0f32('0x11')]+')');var _0x2eac4f=_0x5eead8?_0x4dd99a[_0x0f32('0x12')]:_0x4dd99a[_0x0f32('0x13')];logger['info'](_0x0f32('0x14'),_0x4952f4,_0x4dd99a['condition'],_0x5eead8,_0x2eac4f||_0x0f32('0x15'));if(_0x2eac4f){var _0x2d961a=_[_0x0f32('0x16')](_0x17289e[_0x0f32('0x17')](),{'p':_0x2eac4f});if(_0x2d961a>=0x0){logger[_0x0f32('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4952f4,_0x2eac4f||_0x0f32('0x15'),_0x2d961a);_0x17289e['next'](_0x2d961a);}else{logger[_0x0f32('0x18')](_0x0f32('0x19'),_0x4952f4,_0x2eac4f||'next');_0x17289e[_0x0f32('0x10')]();}}else{_0x17289e[_0x0f32('0x15')]();}}catch(_0x516220){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4952f4,_0x516220[_0x0f32('0xe')]);_0x17289e[_0x0f32('0x10')]();}}}catch(_0x326e56){logger['error'](_0x0f32('0xc'),_0x4952f4,JSON[_0x0f32('0x1a')](_0x326e56));_0x17289e[_0x0f32('0x10')]();}};};
\ No newline at end of file
+var _0xf3db=['next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','html-to-text','./utils','../../../../config/logger','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','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'];(function(_0xb2b3ae,_0x5f186d){var _0x2e18a3=function(_0x1743ce){while(--_0x1743ce){_0xb2b3ae['push'](_0xb2b3ae['shift']());}};_0x2e18a3(++_0x5f186d);}(_0xf3db,0x1aa));var _0xbf3d=function(_0xef9dc2,_0x28714f){_0xef9dc2=_0xef9dc2-0x0;var _0x1b1166=_0xf3db[_0xef9dc2];return _0x1b1166;};'use strict';var schema=require(_0xbf3d('0x0'));var _=require(_0xbf3d('0x1'));var htmlToText=require(_0xbf3d('0x2'));var utils=require(_0xbf3d('0x3'));var logger=require(_0xbf3d('0x4'))('routing');var gotoif=schema({'condition':{'type':_0xbf3d('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xbf3d('0x6'),'message':_0xbf3d('0x7')},'priorityFalse':{'type':'number','message':_0xbf3d('0x8')}});exports['consequence']=function(_0x43c926,_0x18107c){return function(_0xaf9f44){try{var _0x24707d={'condition':htmlToText['fromString'](utils[_0xbf3d('0x9')](_0x18107c[0x0],this),{'wordwrap':![]})[_0xbf3d('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x18107c[0x1],'priorityFalse':_0x18107c[0x2]};var _0x9ceca5=gotoif[_0xbf3d('0x0')](_0x24707d,{'typecast':!![]});if(_0x9ceca5[_0xbf3d('0xb')]){logger[_0xbf3d('0xc')]('[%s][GOTOIF]\x20%s',_0x43c926,_[_0xbf3d('0xd')](_0x9ceca5,_0xbf3d('0xe'))[_0xbf3d('0xf')](',\x20'));_0xaf9f44[_0xbf3d('0x10')]();}else{try{var _0x46253d=eval('('+_0x24707d[_0xbf3d('0x11')]+')');var _0x389e53=_0x46253d?_0x24707d[_0xbf3d('0x12')]:_0x24707d[_0xbf3d('0x13')];logger[_0xbf3d('0x14')](_0xbf3d('0x15'),_0x43c926,_0x24707d[_0xbf3d('0x11')],_0x46253d,_0x389e53||_0xbf3d('0x16'));if(_0x389e53){var _0x5b6d02=_[_0xbf3d('0x17')](_0xaf9f44[_0xbf3d('0x18')](),{'p':_0x389e53});if(_0x5b6d02>=0x0){logger[_0xbf3d('0x14')](_0xbf3d('0x19'),_0x43c926,_0x389e53||_0xbf3d('0x16'),_0x5b6d02);_0xaf9f44[_0xbf3d('0x16')](_0x5b6d02);}else{logger['info'](_0xbf3d('0x1a'),_0x43c926,_0x389e53||_0xbf3d('0x16'));_0xaf9f44[_0xbf3d('0x10')]();}}else{_0xaf9f44[_0xbf3d('0x16')]();}}catch(_0x4006ce){logger[_0xbf3d('0xc')](_0xbf3d('0x1b'),_0x43c926,_0x4006ce[_0xbf3d('0xe')]);_0xaf9f44[_0xbf3d('0x10')]();}}}catch(_0x20a858){logger['error']('[%s][GOTOIF]\x20%s',_0x43c926,JSON['stringify'](_0x20a858));_0xaf9f44[_0xbf3d('0x10')]();}};};
\ No newline at end of file
index ef7ae04..4c73756 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a80=['routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','lodash','../../../../config/logger'];(function(_0x43d9f0,_0x48f6d5){var _0x114ba9=function(_0x4eeab6){while(--_0x4eeab6){_0x43d9f0['push'](_0x43d9f0['shift']());}};_0x114ba9(++_0x48f6d5);}(_0x5a80,0x12f));var _0x05a8=function(_0x189102,_0x5f4493){_0x189102=_0x189102-0x0;var _0xf6e074=_0x5a80[_0x189102];return _0xf6e074;};'use strict';var schema=require(_0x05a8('0x0'));var _=require(_0x05a8('0x1'));var logger=require(_0x05a8('0x2'))(_0x05a8('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x05a8('0x4')}});exports['consequence']=function(_0x169a47,_0x24f546){return function(_0x14e594){try{var _0x2eb746={'priority':_0x24f546[0x0]};var _0x145fc6=gotop['validate'](_0x2eb746,{'typecast':!![]});if(_0x145fc6[_0x05a8('0x5')]){logger[_0x05a8('0x6')](_0x05a8('0x7'),_0x169a47,_[_0x05a8('0x8')](_0x145fc6,_0x05a8('0x9'))[_0x05a8('0xa')](',\x20'));_0x14e594[_0x05a8('0xb')]();}else{logger[_0x05a8('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x169a47,_0x2eb746[_0x05a8('0xd')]);if(_0x2eb746[_0x05a8('0xd')]){var _0x28e383=_[_0x05a8('0xe')](_0x14e594[_0x05a8('0xf')](),{'p':_0x2eb746[_0x05a8('0xd')]});if(_0x28e383>=0x0){logger[_0x05a8('0xc')](_0x05a8('0x10'),_0x169a47,_0x2eb746[_0x05a8('0xd')]||'next',_0x28e383);_0x14e594[_0x05a8('0x11')](_0x28e383);}else{logger[_0x05a8('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x169a47,_0x2eb746['priority']||_0x05a8('0x11'));_0x14e594[_0x05a8('0xb')]();}}else{_0x14e594[_0x05a8('0x11')]();}}}catch(_0x4f7046){logger[_0x05a8('0x6')](_0x05a8('0x7'),_0x169a47,JSON['stringify'](_0x4f7046));_0x14e594['stop']();}};};
\ No newline at end of file
+var _0xeeb1=['info','next','error','stringify','validate','lodash','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','[%s][GOTOP]\x20%s','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules'];(function(_0x2bbc07,_0x1e2168){var _0x6879e4=function(_0x290fa1){while(--_0x290fa1){_0x2bbc07['push'](_0x2bbc07['shift']());}};_0x6879e4(++_0x1e2168);}(_0xeeb1,0x100));var _0x1eeb=function(_0x4a9fb7,_0x4cbfd7){_0x4a9fb7=_0x4a9fb7-0x0;var _0x40b90e=_0xeeb1[_0x4a9fb7];return _0x40b90e;};'use strict';var schema=require(_0x1eeb('0x0'));var _=require(_0x1eeb('0x1'));var logger=require(_0x1eeb('0x2'))('routing');var gotop=schema({'priority':{'type':_0x1eeb('0x3'),'required':!![],'message':_0x1eeb('0x4')}});exports['consequence']=function(_0x4ac46e,_0x3700ef){return function(_0x1609ae){try{var _0x129a18={'priority':_0x3700ef[0x0]};var _0x31288d=gotop['validate'](_0x129a18,{'typecast':!![]});if(_0x31288d['length']){logger['error'](_0x1eeb('0x5'),_0x4ac46e,_[_0x1eeb('0x6')](_0x31288d,_0x1eeb('0x7'))[_0x1eeb('0x8')](',\x20'));_0x1609ae[_0x1eeb('0x9')]();}else{logger['info'](_0x1eeb('0xa'),_0x4ac46e,_0x129a18[_0x1eeb('0xb')]);if(_0x129a18['priority']){var _0x362e54=_[_0x1eeb('0xc')](_0x1609ae[_0x1eeb('0xd')](),{'p':_0x129a18['priority']});if(_0x362e54>=0x0){logger[_0x1eeb('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4ac46e,_0x129a18[_0x1eeb('0xb')]||'next',_0x362e54);_0x1609ae[_0x1eeb('0xf')](_0x362e54);}else{logger[_0x1eeb('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x4ac46e,_0x129a18['priority']||_0x1eeb('0xf'));_0x1609ae[_0x1eeb('0x9')]();}}else{_0x1609ae[_0x1eeb('0xf')]();}}}catch(_0x4e070f){logger[_0x1eeb('0x10')](_0x1eeb('0x5'),_0x4ac46e,JSON[_0x1eeb('0x11')](_0x4e070f));_0x1609ae[_0x1eeb('0x9')]();}};};
\ No newline at end of file
index 4a358dc..92fc994 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52b0=['stop','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','account','channel','AccountId','upperFirst','InteractionId','interaction','Message','create','then','body','catch','error','[%s][MESSAGE]\x20%s','stringify'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x52b0,0x160));var _0x052b=function(_0x53745a,_0x3eb8d6){_0x53745a=_0x53745a-0x0;var _0x34abf2=_0x52b0[_0x53745a];return _0x34abf2;};'use strict';var _=require('lodash');var utils=require(_0x052b('0x0'));var logger=require('../../../../config/logger')(_0x052b('0x1'));var rpc={'chatMessage':require(_0x052b('0x2')),'openchannelMessage':require(_0x052b('0x3')),'mailMessage':require(_0x052b('0x4')),'smsMessage':require(_0x052b('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x052b('0x6'))};exports[_0x052b('0x7')]=function(_0x1fed93,_0x42d01b){return function(_0x1980ef){try{var _0x2132e4={'body':utils[_0x052b('0x8')](_0x42d01b[0x0],this),'ContactId':this[_0x052b('0x9')]['id']};if(this['channel']===_0x052b('0xa')){_0x2132e4[_0x052b('0xb')]=this[_0x052b('0xc')]['id'];}else{_0x2132e4[_['upperFirst'](this[_0x052b('0xd')])+_0x052b('0xe')]=this['account']['id'];}_0x2132e4[_[_0x052b('0xf')](this['channel'])+_0x052b('0x10')]=this[_0x052b('0x11')]['id'];if(rpc[this['channel']+_0x052b('0x12')]){return rpc[this['channel']+'Message'][_0x052b('0x13')](_0x2132e4)[_0x052b('0x14')](function(_0x52c59f){logger['info']('[%s][MESSAGE]\x20%s',_0x1fed93,_0x2132e4[_0x052b('0x15')]);_0x1980ef['next']();})[_0x052b('0x16')](function(_0x21753a){logger[_0x052b('0x17')](_0x052b('0x18'),_0x1fed93,JSON[_0x052b('0x19')](_0x21753a));_0x1980ef[_0x052b('0x1a')]();});}}catch(_0x174713){logger[_0x052b('0x17')]('[%s][MESSAGE]\x20%s',_0x1fed93,JSON[_0x052b('0x19')](_0x174713));_0x1980ef[_0x052b('0x1a')]();}};};
\ No newline at end of file
+var _0x793e=['[%s][MESSAGE]\x20%s','next','catch','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','channel','create','then','info'];(function(_0x2a9e6f,_0x216211){var _0x1159d1=function(_0x86dcc0){while(--_0x86dcc0){_0x2a9e6f['push'](_0x2a9e6f['shift']());}};_0x1159d1(++_0x216211);}(_0x793e,0xfe));var _0xe793=function(_0x1bbb03,_0x18c084){_0x1bbb03=_0x1bbb03-0x0;var _0x1ae659=_0x793e[_0x1bbb03];return _0x1ae659;};'use strict';var _=require(_0xe793('0x0'));var utils=require('./utils');var logger=require(_0xe793('0x1'))(_0xe793('0x2'));var rpc={'chatMessage':require(_0xe793('0x3')),'openchannelMessage':require(_0xe793('0x4')),'mailMessage':require(_0xe793('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xe793('0x6'))};exports[_0xe793('0x7')]=function(_0x260c34,_0x28eb44){return function(_0x4ec63d){try{var _0x58c72e={'body':utils[_0xe793('0x8')](_0x28eb44[0x0],this),'ContactId':this[_0xe793('0x9')]['id']};if(this['channel']===_0xe793('0xa')){_0x58c72e[_0xe793('0xb')]=this[_0xe793('0xc')]['id'];}else{_0x58c72e[_[_0xe793('0xd')](this['channel'])+_0xe793('0xe')]=this[_0xe793('0xc')]['id'];}_0x58c72e[_['upperFirst'](this['channel'])+_0xe793('0xf')]=this[_0xe793('0x10')]['id'];if(rpc[this[_0xe793('0x11')]+'Message']){return rpc[this[_0xe793('0x11')]+'Message'][_0xe793('0x12')](_0x58c72e)[_0xe793('0x13')](function(_0x30d327){logger[_0xe793('0x14')](_0xe793('0x15'),_0x260c34,_0x58c72e['body']);_0x4ec63d[_0xe793('0x16')]();})[_0xe793('0x17')](function(_0x88b8ce){logger['error']('[%s][MESSAGE]\x20%s',_0x260c34,JSON['stringify'](_0x88b8ce));_0x4ec63d['stop']();});}}catch(_0x39f3e7){logger['error'](_0xe793('0x15'),_0x260c34,JSON['stringify'](_0x39f3e7));_0x4ec63d[_0xe793('0x18')]();}};};
\ No newline at end of file
index c335177..1acffcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1fd=['[%s][NOOP]\x20%s','getMustacheRender','next','stringify','stop','consequence'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0xa1fd,0xad));var _0xda1f=function(_0x83487c,_0x1104d8){_0x83487c=_0x83487c-0x0;var _0x25ce18=_0xa1fd[_0x83487c];return _0x25ce18;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')('routing');exports[_0xda1f('0x0')]=function(_0x591d8e,_0x444c9c){return function(_0x2b52ec){try{logger['info'](_0xda1f('0x1'),_0x591d8e,utils[_0xda1f('0x2')](_0x444c9c[0x0],this));_0x2b52ec[_0xda1f('0x3')]();}catch(_0x4e32ab){logger['error'](_0xda1f('0x1'),_0x591d8e,JSON[_0xda1f('0x4')](_0x4e32ab));_0x2b52ec[_0xda1f('0x5')]();}};};
\ No newline at end of file
+var _0xfd39=['[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger','routing','info'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0xfd39,0xec));var _0x9fd3=function(_0x2b955e,_0x2c289c){_0x2b955e=_0x2b955e-0x0;var _0x551669=_0xfd39[_0x2b955e];return _0x551669;};'use strict';var utils=require(_0x9fd3('0x0'));var logger=require(_0x9fd3('0x1'))(_0x9fd3('0x2'));exports['consequence']=function(_0x3221ec,_0xf53f95){return function(_0x25ff67){try{logger[_0x9fd3('0x3')](_0x9fd3('0x4'),_0x3221ec,utils[_0x9fd3('0x5')](_0xf53f95[0x0],this));_0x25ff67[_0x9fd3('0x6')]();}catch(_0x5c744e){logger[_0x9fd3('0x7')](_0x9fd3('0x4'),_0x3221ec,JSON[_0x9fd3('0x8')](_0x5c744e));_0x25ff67[_0x9fd3('0x9')]();}};};
\ No newline at end of file
index 4d934db..cfbd997 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','interaction','channel','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','map','join','find','Queues','createQueue','atimeout','rules','end','close','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove'];(function(_0x3dcac7,_0x1a47b0){var _0x13fee2=function(_0x25a187){while(--_0x25a187){_0x3dcac7['push'](_0x3dcac7['shift']());}};_0x13fee2(++_0x1a47b0);}(_0x55ca,0x126));var _0xa55c=function(_0x5bc95c,_0xfed759){_0x5bc95c=_0x5bc95c-0x0;var _0x3721fc=_0x55ca[_0x5bc95c];return _0x3721fc;};'use strict';var schema=require(_0xa55c('0x0'));var _=require(_0xa55c('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));var strategy=require(_0xa55c('0x5'));config[_0xa55c('0x6')]=_[_0xa55c('0x7')](config[_0xa55c('0x6')],{'host':_0xa55c('0x8'),'port':0x18eb});var io=require(_0xa55c('0x9'))(new Redis(config['redis']));var attributes=['id',_0xa55c('0xa'),_0xa55c('0xb'),'queue',_0xa55c('0xc'),_0xa55c('0xd')];function emit(_0x52a3bc,_0x5849ad,_0x473d0e){io['to'](_0x52a3bc)[_0xa55c('0xe')](_0x5849ad,_0x473d0e);}function emitChannelQueueInteraction(_0x381d07,_0x5d8e5a,_0x31646d,_0xe6d826,_0x508342,_0x70c2de,_0x3998f7,_0x15eec8){var _0x5d47ff=_['clone'](_0x31646d);_0x5d47ff[_0xa55c('0xa')]=_0x15eec8;_0x5d47ff['queue']=_0x5d8e5a;_0x5d47ff['account']=_0xe6d826;_0x5d47ff['id']=_0x508342;if(_0x70c2de){_0x3998f7[util['format'](_0xa55c('0xf'),_0x381d07)][_0x508342]=_[_0xa55c('0x10')](_0x5d47ff,attributes);}else{delete _0x3998f7[util[_0xa55c('0x11')](_0xa55c('0xf'),_0x381d07)][_0x508342];}emit(util[_0xa55c('0x11')](_0xa55c('0x12'),_0x381d07,_0x5d8e5a),util['format'](_0xa55c('0x13'),_0x381d07,_0x70c2de?_0xa55c('0x14'):_0xa55c('0x15')),_[_0xa55c('0x10')](_0x5d47ff,attributes));}var rpc={'openchannelQueueReport':require(_0xa55c('0x16')),'mailQueueReport':require(_0xa55c('0x17')),'chatQueueReport':require(_0xa55c('0x18')),'smsQueueReport':require(_0xa55c('0x19')),'faxQueueReport':require(_0xa55c('0x1a')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xa55c('0x1b'),'required':!![],'message':_0xa55c('0x1c')},'timeout':{'type':_0xa55c('0x1d'),'message':_0xa55c('0x1e')}});function startRouting(_0x23a1ae,_0x5426e5,_0x4c0daf,_0x5f5158){if(_0x23a1ae&&_0x5426e5&&_0x4c0daf){_0x5426e5[_0xa55c('0x1f')]+=0x1;var _0x3776ac={'uniqueid':_0x23a1ae,'from':_0x4c0daf[_0xa55c('0x20')]?_0x4c0daf['body'][_0xa55c('0xc')]:'','joinAt':moment()[_0xa55c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c0daf[_0xa55c('0x21')]?_0x4c0daf[_0xa55c('0x21')]['id']:null,'ListId':_0x4c0daf[_0xa55c('0x22')]?_0x4c0daf[_0xa55c('0x22')]['id']:null};_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf['channel'])+_0xa55c('0x24')]=_0x5426e5['id']||null;_0x3776ac[_['upperFirst'](_0x4c0daf['channel'])+'InteractionId']=_0x4c0daf[_0xa55c('0x25')]?_0x4c0daf['interaction']['id']:null;_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf[_0xa55c('0x26')])+_0xa55c('0x27')]=_0x4c0daf[_0xa55c('0x28')]?_0x4c0daf[_0xa55c('0x28')]['id']:null;_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf[_0xa55c('0x26')])+(_0x4c0daf[_0xa55c('0x26')]!==_0xa55c('0x29')?_0xa55c('0x2a'):_0xa55c('0x2b'))]=_0x4c0daf['account']?_0x4c0daf[_0xa55c('0xb')]['id']:null;logger[_0xa55c('0x2c')](util[_0xa55c('0x11')](_0xa55c('0x2d'),_0x23a1ae,_0x5426e5['name']));emitChannelQueueInteraction(_0x4c0daf[_0xa55c('0x26')],_0x5426e5[_0xa55c('0x2e')],_0x3776ac,_0x4c0daf[_0xa55c('0xb')][_0xa55c('0x2e')],_0x4c0daf[_0xa55c('0x28')]['id'],!![],_0x5f5158,_0x5426e5['id']);if(rpc[_0x4c0daf[_0xa55c('0x26')]+'QueueReport']){return rpc[_0x4c0daf[_0xa55c('0x26')]+'QueueReport'][_0xa55c('0x2f')](_0x3776ac)[_0xa55c('0x30')](function(_0x1cc53e){logger[_0xa55c('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x3d28fb,_0x2096ae,_0x331e58,_0x20da31){if(_0x3d28fb&&_0x2096ae){_0x2096ae[_0xa55c('0x1f')]-=0x1;var _0x1225c3={'leaveAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'acceptAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'reason':_0xa55c('0x33')};logger['info'](util['format'](_0xa55c('0x34'),_0x3d28fb,_0x2096ae[_0xa55c('0x2e')]));emitChannelQueueInteraction(_0x331e58['channel'],_0x2096ae[_0xa55c('0x2e')],_0x331e58[_0xa55c('0x20')],_0x331e58[_0xa55c('0xb')][_0xa55c('0x2e')],_0x331e58[_0xa55c('0x28')]['id'],![],_0x20da31,_0x2096ae['id']);if(rpc[_0x331e58[_0xa55c('0x26')]+_0xa55c('0x35')]){return rpc[_0x331e58[_0xa55c('0x26')]+_0xa55c('0x35')]['update'](_0x3d28fb,_0x1225c3)['catch'](function(_0x4b23d3){logger[_0xa55c('0x31')](_0xa55c('0x36'));});}}}function endRouting(_0x2bb4f0,_0x5802e4,_0x768408,_0x547930){if(_0x2bb4f0&&_0x5802e4){_0x5802e4[_0xa55c('0x1f')]-=0x1;var _0x4ad813={'leaveAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'exitAt':moment()[_0xa55c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa55c('0x37')};logger[_0xa55c('0x2c')](util['format'](_0xa55c('0x38'),_0x2bb4f0,_0x5802e4[_0xa55c('0x2e')]));emitChannelQueueInteraction(_0x768408['channel'],_0x5802e4['name'],_0x768408[_0xa55c('0x20')],_0x768408['account'][_0xa55c('0x2e')],_0x768408[_0xa55c('0x28')]['id'],![],_0x547930);if(rpc[_0x768408['channel']+'QueueReport']){return rpc[_0x768408['channel']+'QueueReport'][_0xa55c('0x39')](_0x2bb4f0,_0x4ad813)[_0xa55c('0x30')](function(_0x429336){logger[_0xa55c('0x31')](_0xa55c('0x36'));});}}}function handleFindQueue(_0x56d17c){return function(_0x3d52d8){return _0x3d52d8[_0xa55c('0x2e')][_0xa55c('0x3a')]()===_0x56d17c[_0xa55c('0x3a')]();};}exports[_0xa55c('0x3b')]=function(_0x23cef5,_0x554620,_0x386e34,_0x5ee63d){return function(_0x57a972){try{var _0x404e7f={'name':_0x554620[0x0],'timeout':_0x554620[0x1]};var _0x1f63d8=queue['validate'](_0x404e7f,{'typecast':!![]});if(_0x1f63d8[_0xa55c('0x3c')]){logger['error']('[%s][QUEUE]\x20%s',_0x23cef5,_[_0xa55c('0x3d')](_0x1f63d8,_0xa55c('0x28'))[_0xa55c('0x3e')](',\x20'));_0x57a972['stop']();}else{var _0x1b2708=_[_0xa55c('0x3f')](_0x386e34[_0x5ee63d['channel']+_0xa55c('0x40')],handleFindQueue(_0x404e7f['name']));if(_0x1b2708){startRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);var _0x39886a=(_0x1b2708[_0xa55c('0x37')]||0xa)*0x3e8;var _0x5be43f=(_0x404e7f[_0xa55c('0x37')]||0x14)*0x3e8;var _0x1dae70,_0x5d834d;if(_0x39886a>_0x5be43f){_0x5be43f=_0x39886a;}var _0x40c352=seqqueue[_0xa55c('0x41')](_0x39886a);_0x40c352['id']=_0x23cef5;_0x40c352[_0xa55c('0x42')]=_0x39886a;_0x40c352['qtimeout']=_0x5be43f;_0x40c352[_0xa55c('0x26')]=_0x5ee63d['channel'];_0x386e34[_0xa55c('0x43')][_0x23cef5]['on'](_0xa55c('0x44'),function(){logger[_0xa55c('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x23cef5);stopRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);clearTimeout(_0x1dae70);_0x1dae70=undefined;_0x40c352[_0xa55c('0x45')](!![]);if(_0x386e34[_0xa55c('0x43')][_0x23cef5]){delete _0x386e34['rules'][_0x23cef5];}_0x57a972[_0xa55c('0x46')]();});_0x386e34[_0xa55c('0x43')][_0x23cef5]['on']('complete',function(){if(_0x386e34[_0xa55c('0x43')][_0x23cef5]){delete _0x386e34[_0xa55c('0x43')][_0x23cef5];}});_0x1dae70=setTimeout(function(){logger['info'](_0xa55c('0x47'),_0x23cef5);endRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);clearTimeout(_0x1dae70);_0x40c352[_0xa55c('0x45')](!![]);_0x57a972[_0xa55c('0x48')]();},_0x5be43f);switch(_0x1b2708[_0xa55c('0x49')]){case'rrmemory':strategy[_0xa55c('0x4a')](_0x40c352,_0x1b2708,_0x386e34,_0x5ee63d);break;default:strategy['beepall'](_0x40c352,_0x1b2708,_0x386e34,_0x5ee63d);}}else{logger[_0xa55c('0x31')](_0xa55c('0x4b'),_0x23cef5,_0x404e7f[_0xa55c('0x2e')]);_0x57a972['stop']();}}}catch(_0x39bd3d){console[_0xa55c('0x4c')](_0x39bd3d);logger['error'](_0xa55c('0x4d'),_0x23cef5,_0x39bd3d[_0xa55c('0x4e')]);_0x57a972[_0xa55c('0x46')]();}};};
\ No newline at end of file
+var _0x34e8=['../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','InteractionId','interaction','channel','MessageId','chat','AccountId','WebsiteId','name','message','QueueReport','create','catch','error','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','Queues','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport'];(function(_0x75658c,_0x55af78){var _0x1b6108=function(_0x142797){while(--_0x142797){_0x75658c['push'](_0x75658c['shift']());}};_0x1b6108(++_0x55af78);}(_0x34e8,0x12c));var _0x834e=function(_0x2ab1ca,_0x13fd26){_0x2ab1ca=_0x2ab1ca-0x0;var _0x31be35=_0x34e8[_0x2ab1ca];return _0x31be35;};'use strict';var schema=require(_0x834e('0x0'));var _=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var seqqueue=require(_0x834e('0x3'));var moment=require('moment');var Redis=require(_0x834e('0x4'));var config=require(_0x834e('0x5'));var logger=require(_0x834e('0x6'))(_0x834e('0x7'));var strategy=require(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));var attributes=['id',_0x834e('0xc'),_0x834e('0xd'),_0x834e('0xe'),_0x834e('0xf'),_0x834e('0x10')];function emit(_0x363786,_0x1af45a,_0x3bdda9){io['to'](_0x363786)[_0x834e('0x11')](_0x1af45a,_0x3bdda9);}function emitChannelQueueInteraction(_0x1e41fe,_0x36e124,_0x14038b,_0x2e1a37,_0x293514,_0x1e00de,_0x2fd95c,_0x538bb3){var _0x5e5b6d=_[_0x834e('0x12')](_0x14038b);_0x5e5b6d['queue_id']=_0x538bb3;_0x5e5b6d[_0x834e('0xe')]=_0x36e124;_0x5e5b6d[_0x834e('0xd')]=_0x2e1a37;_0x5e5b6d['id']=_0x293514;if(_0x1e00de){_0x2fd95c[util[_0x834e('0x13')](_0x834e('0x14'),_0x1e41fe)][_0x293514]=_['pick'](_0x5e5b6d,attributes);}else{delete _0x2fd95c[util[_0x834e('0x13')](_0x834e('0x14'),_0x1e41fe)][_0x293514];}emit(util['format'](_0x834e('0x15'),_0x1e41fe,_0x36e124),util['format'](_0x834e('0x16'),_0x1e41fe,_0x1e00de?_0x834e('0x17'):'remove'),_[_0x834e('0x18')](_0x5e5b6d,attributes));}var rpc={'openchannelQueueReport':require(_0x834e('0x19')),'mailQueueReport':require(_0x834e('0x1a')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x834e('0x1b')),'faxQueueReport':require(_0x834e('0x1c')),'whatsappQueueReport':require(_0x834e('0x1d'))};var queue=schema({'name':{'type':_0x834e('0x1e'),'required':!![],'message':_0x834e('0x1f')},'timeout':{'type':_0x834e('0x20'),'message':_0x834e('0x21')}});function startRouting(_0x595515,_0x2545b4,_0x1fd2c6,_0x113ff4){if(_0x595515&&_0x2545b4&&_0x1fd2c6){_0x2545b4[_0x834e('0x22')]+=0x1;var _0x4ab05d={'uniqueid':_0x595515,'from':_0x1fd2c6[_0x834e('0x23')]?_0x1fd2c6[_0x834e('0x23')]['from']:'','joinAt':moment()[_0x834e('0x13')](_0x834e('0x24')),'ContactId':_0x1fd2c6[_0x834e('0x25')]?_0x1fd2c6['contact']['id']:null,'ListId':_0x1fd2c6['list']?_0x1fd2c6[_0x834e('0x26')]['id']:null};_0x4ab05d[_[_0x834e('0x27')](_0x1fd2c6['channel'])+_0x834e('0x28')]=_0x2545b4['id']||null;_0x4ab05d[_[_0x834e('0x27')](_0x1fd2c6['channel'])+_0x834e('0x29')]=_0x1fd2c6[_0x834e('0x2a')]?_0x1fd2c6[_0x834e('0x2a')]['id']:null;_0x4ab05d[_['upperFirst'](_0x1fd2c6[_0x834e('0x2b')])+_0x834e('0x2c')]=_0x1fd2c6['message']?_0x1fd2c6['message']['id']:null;_0x4ab05d[_[_0x834e('0x27')](_0x1fd2c6['channel'])+(_0x1fd2c6[_0x834e('0x2b')]!==_0x834e('0x2d')?_0x834e('0x2e'):_0x834e('0x2f'))]=_0x1fd2c6[_0x834e('0xd')]?_0x1fd2c6[_0x834e('0xd')]['id']:null;logger['info'](util['format']('[%s][START:QUEUE][NAME:%s]',_0x595515,_0x2545b4['name']));emitChannelQueueInteraction(_0x1fd2c6[_0x834e('0x2b')],_0x2545b4[_0x834e('0x30')],_0x4ab05d,_0x1fd2c6[_0x834e('0xd')]['name'],_0x1fd2c6[_0x834e('0x31')]['id'],!![],_0x113ff4,_0x2545b4['id']);if(rpc[_0x1fd2c6[_0x834e('0x2b')]+_0x834e('0x32')]){return rpc[_0x1fd2c6[_0x834e('0x2b')]+_0x834e('0x32')][_0x834e('0x33')](_0x4ab05d)[_0x834e('0x34')](function(_0xfaf716){logger[_0x834e('0x35')]('create\x20queue\x20report');});}}}function stopRouting(_0xef9ec2,_0x5cad11,_0x2c75c2,_0x3787b0){if(_0xef9ec2&&_0x5cad11){_0x5cad11[_0x834e('0x22')]-=0x1;var _0x2b3418={'leaveAt':moment()[_0x834e('0x13')](_0x834e('0x24')),'acceptAt':moment()[_0x834e('0x13')](_0x834e('0x24')),'reason':_0x834e('0x36')};logger[_0x834e('0x37')](util['format'](_0x834e('0x38'),_0xef9ec2,_0x5cad11[_0x834e('0x30')]));emitChannelQueueInteraction(_0x2c75c2[_0x834e('0x2b')],_0x5cad11[_0x834e('0x30')],_0x2c75c2['body'],_0x2c75c2[_0x834e('0xd')][_0x834e('0x30')],_0x2c75c2['message']['id'],![],_0x3787b0,_0x5cad11['id']);if(rpc[_0x2c75c2['channel']+'QueueReport']){return rpc[_0x2c75c2[_0x834e('0x2b')]+_0x834e('0x32')][_0x834e('0x39')](_0xef9ec2,_0x2b3418)[_0x834e('0x34')](function(_0x339e28){logger[_0x834e('0x35')]('update\x20queue\x20report');});}}}function endRouting(_0x2c2d94,_0x513f36,_0xe103fe,_0x6a3ac){if(_0x2c2d94&&_0x513f36){_0x513f36['waiting']-=0x1;var _0x18ac3b={'leaveAt':moment()[_0x834e('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0x834e('0x24')),'reason':_0x834e('0x3a')};logger[_0x834e('0x37')](util[_0x834e('0x13')](_0x834e('0x3b'),_0x2c2d94,_0x513f36['name']));emitChannelQueueInteraction(_0xe103fe[_0x834e('0x2b')],_0x513f36['name'],_0xe103fe['body'],_0xe103fe[_0x834e('0xd')]['name'],_0xe103fe[_0x834e('0x31')]['id'],![],_0x6a3ac);if(rpc[_0xe103fe[_0x834e('0x2b')]+_0x834e('0x32')]){return rpc[_0xe103fe[_0x834e('0x2b')]+_0x834e('0x32')]['update'](_0x2c2d94,_0x18ac3b)[_0x834e('0x34')](function(_0x26b847){logger[_0x834e('0x35')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x35380e){return function(_0x16ac45){return _0x16ac45['name'][_0x834e('0x3c')]()===_0x35380e['toLowerCase']();};}exports[_0x834e('0x3d')]=function(_0x585335,_0x4a18bb,_0x4a6942,_0x22ea21){return function(_0x16969b){try{var _0x3bcbf4={'name':_0x4a18bb[0x0],'timeout':_0x4a18bb[0x1]};var _0xbc1571=queue[_0x834e('0x0')](_0x3bcbf4,{'typecast':!![]});if(_0xbc1571[_0x834e('0x3e')]){logger[_0x834e('0x35')]('[%s][QUEUE]\x20%s',_0x585335,_[_0x834e('0x3f')](_0xbc1571,'message')[_0x834e('0x40')](',\x20'));_0x16969b['stop']();}else{var _0x1df5b0=_['find'](_0x4a6942[_0x22ea21[_0x834e('0x2b')]+_0x834e('0x41')],handleFindQueue(_0x3bcbf4['name']));if(_0x1df5b0){startRouting(_0x585335,_0x1df5b0,_0x22ea21,_0x4a6942);var _0x39e7b9=(_0x1df5b0[_0x834e('0x3a')]||0xa)*0x3e8;var _0xa880cb=(_0x3bcbf4[_0x834e('0x3a')]||0x14)*0x3e8;var _0x252ea0,_0x1a7149;if(_0x39e7b9>_0xa880cb){_0xa880cb=_0x39e7b9;}var _0xfa28da=seqqueue[_0x834e('0x42')](_0x39e7b9);_0xfa28da['id']=_0x585335;_0xfa28da[_0x834e('0x43')]=_0x39e7b9;_0xfa28da[_0x834e('0x44')]=_0xa880cb;_0xfa28da['channel']=_0x22ea21[_0x834e('0x2b')];_0x4a6942[_0x834e('0x45')][_0x585335]['on']('end',function(){logger[_0x834e('0x37')](_0x834e('0x46'),_0x585335);stopRouting(_0x585335,_0x1df5b0,_0x22ea21,_0x4a6942);clearTimeout(_0x252ea0);_0x252ea0=undefined;_0xfa28da[_0x834e('0x47')](!![]);if(_0x4a6942[_0x834e('0x45')][_0x585335]){delete _0x4a6942[_0x834e('0x45')][_0x585335];}_0x16969b[_0x834e('0x48')]();});_0x4a6942['rules'][_0x585335]['on']('complete',function(){if(_0x4a6942[_0x834e('0x45')][_0x585335]){delete _0x4a6942[_0x834e('0x45')][_0x585335];}});_0x252ea0=setTimeout(function(){logger[_0x834e('0x37')](_0x834e('0x49'),_0x585335);endRouting(_0x585335,_0x1df5b0,_0x22ea21,_0x4a6942);clearTimeout(_0x252ea0);_0xfa28da[_0x834e('0x47')](!![]);_0x16969b[_0x834e('0x4a')]();},_0xa880cb);switch(_0x1df5b0[_0x834e('0x4b')]){case _0x834e('0x4c'):strategy[_0x834e('0x4c')](_0xfa28da,_0x1df5b0,_0x4a6942,_0x22ea21);break;default:strategy[_0x834e('0x4d')](_0xfa28da,_0x1df5b0,_0x4a6942,_0x22ea21);}}else{logger[_0x834e('0x35')](_0x834e('0x4e'),_0x585335,_0x3bcbf4[_0x834e('0x30')]);_0x16969b[_0x834e('0x48')]();}}}catch(_0x2aa072){console[_0x834e('0x4f')](_0x2aa072);logger[_0x834e('0x35')](_0x834e('0x50'),_0x585335,_0x2aa072[_0x834e('0x51')]);_0x16969b[_0x834e('0x48')]();}};};
\ No newline at end of file
index 19850f7..0ba1d9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65c7=['busy','showNotification','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','writeLog','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','timeout','handleTimeout','prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x65c7,0x137));var _0x765c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x65c7[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var uuid=require(_0x765c('0x0'));var util=require(_0x765c('0x1'));var logger=require(_0x765c('0x2'))(_0x765c('0x3'));var Agent=function(_0x4edee3,_0x1cd45a,_0x4f1b68,_0x46860b){this[_0x765c('0x4')]=uuid['v4']();this[_0x765c('0x5')]=_0x4edee3;this[_0x765c('0x6')]=_0x1cd45a;this[_0x765c('0x7')]=_0x4f1b68;this[_0x765c('0x3')]=_0x46860b;this['squeue'][_0x765c('0x8')](this[_0x765c('0x9')][_0x765c('0xa')](this),this['handleTimeout']['bind'](this));this[_0x765c('0x5')]['on'](_0x765c('0xb'),this[_0x765c('0xc')]['bind'](this));this[_0x765c('0x5')]['on']('drained',this['handleDrained']['bind'](this));};Agent['prototype'][_0x765c('0x8')]=function(){this['squeue'][_0x765c('0x8')](this[_0x765c('0x9')]['bind'](this),this['handleTimeout'][_0x765c('0xa')](this));};Agent[_0x765c('0xd')][_0x765c('0xe')]=function(){this[_0x765c('0xc')](!![]);};Agent['prototype'][_0x765c('0x9')]=function(_0x35ab53){logger[_0x765c('0xf')](_0x765c('0x10'),this[_0x765c('0x5')]['id'],this[_0x765c('0x6')]['id']);if(_['isNil'](this[_0x765c('0x7')][_0x765c('0x11')][this[_0x765c('0x6')]['id']])){logger[_0x765c('0xf')](_0x765c('0x12'),this['squeue']['id'],this[_0x765c('0x6')]['id']);setTimeout(this[_0x765c('0x8')][_0x765c('0xa')](this),0x3e8);}else{if(this[_0x765c('0x3')]['forcedOwnership']||util['isAgentAvailable'](this[_0x765c('0x5')]['id'],this[_0x765c('0x7')][_0x765c('0x11')][this[_0x765c('0x6')]['id']],this['squeue']['channel'],![])){this[_0x765c('0x7')][_0x765c('0x11')][this[_0x765c('0x6')]['id']][_0x765c('0x13')]=!![];this[_0x765c('0x7')][_0x765c('0x11')][this['agent']['id']]['busyQueue']=undefined;util[_0x765c('0x14')](this[_0x765c('0x4')],this['squeue']['id'],this[_0x765c('0x7')][_0x765c('0x11')][this[_0x765c('0x6')]['id']],null,this[_0x765c('0x3')]);util['writeLog'](this[_0x765c('0x5')]['id'],this[_0x765c('0x7')]['agents'][this['agent']['id']],_0x765c('0x15')+(this[_0x765c('0x3')][_0x765c('0x16')]?_0x765c('0x17'):''));}else{logger[_0x765c('0xf')](_0x765c('0x18'),this[_0x765c('0x5')]['id'],this['agent']['id']);setTimeout(this[_0x765c('0x8')][_0x765c('0xa')](this),0x3e8);}}};Agent[_0x765c('0xd')]['handleTimeout']=function(_0x114df8){if(_[_0x765c('0x19')](this[_0x765c('0x7')]['agents'][this['agent']['id']])){return logger['info'](_0x765c('0x12'),this[_0x765c('0x5')]['id'],this[_0x765c('0x6')]['id']);}else{logger[_0x765c('0xf')](_0x765c('0x1a'),this['squeue']['id'],this[_0x765c('0x6')]['id']);util[_0x765c('0x1b')](this[_0x765c('0x4')],this['squeue']['id'],this[_0x765c('0x7')][_0x765c('0x11')][this[_0x765c('0x6')]['id']],null,this[_0x765c('0x3')]);this[_0x765c('0x7')][_0x765c('0x11')][this['agent']['id']][_0x765c('0x13')]=![];this[_0x765c('0x7')][_0x765c('0x11')][this[_0x765c('0x6')]['id']][_0x765c('0x1c')]=undefined;util[_0x765c('0x1d')](this['squeue']['id'],this['realtime'][_0x765c('0x11')][this[_0x765c('0x6')]['id']],_0x114df8?_0x765c('0x1e'):_0x765c('0x1f'));}if(!_0x114df8){setTimeout(this[_0x765c('0x8')][_0x765c('0xa')](this),0x3e8);}};function agent(_0x5191b9,_0x3ae1b0,_0x4c00ba,_0x15b732){return new Agent(_0x5191b9,_0x3ae1b0,_0x4c00ba,_0x15b732);}module[_0x765c('0x20')]=agent;
\ No newline at end of file
+var _0x06c4=['timeout','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','notificationId','writeLog','RINGING','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','exports','lodash','./util','routing','squeue','agent','realtime','push','handleRun','bind','handleTimeout'];(function(_0x4e804c,_0x5a93c2){var _0x598bc4=function(_0x488c2f){while(--_0x488c2f){_0x4e804c['push'](_0x4e804c['shift']());}};_0x598bc4(++_0x5a93c2);}(_0x06c4,0x122));var _0x406c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06c4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x406c('0x0'));var uuid=require('uuid');var util=require(_0x406c('0x1'));var logger=require('../../../../../config/logger')(_0x406c('0x2'));var Agent=function(_0x462ef1,_0xc52481,_0x2b88a0,_0x44db61){this['notificationId']=uuid['v4']();this[_0x406c('0x3')]=_0x462ef1;this[_0x406c('0x4')]=_0xc52481;this[_0x406c('0x5')]=_0x2b88a0;this['routing']=_0x44db61;this[_0x406c('0x3')][_0x406c('0x6')](this[_0x406c('0x7')][_0x406c('0x8')](this),this[_0x406c('0x9')]['bind'](this));this[_0x406c('0x3')]['on'](_0x406c('0xa'),this[_0x406c('0x9')][_0x406c('0x8')](this));this[_0x406c('0x3')]['on']('drained',this[_0x406c('0xb')][_0x406c('0x8')](this));};Agent[_0x406c('0xc')][_0x406c('0x6')]=function(){this[_0x406c('0x3')][_0x406c('0x6')](this[_0x406c('0x7')]['bind'](this),this[_0x406c('0x9')][_0x406c('0x8')](this));};Agent[_0x406c('0xc')]['handleDrained']=function(){this[_0x406c('0x9')](!![]);};Agent[_0x406c('0xc')][_0x406c('0x7')]=function(_0xecd600){logger[_0x406c('0xd')](_0x406c('0xe'),this['squeue']['id'],this[_0x406c('0x4')]['id']);if(_[_0x406c('0xf')](this[_0x406c('0x5')][_0x406c('0x10')][this[_0x406c('0x4')]['id']])){logger[_0x406c('0xd')](_0x406c('0x11'),this[_0x406c('0x3')]['id'],this[_0x406c('0x4')]['id']);setTimeout(this[_0x406c('0x6')][_0x406c('0x8')](this),0x3e8);}else{if(this[_0x406c('0x2')][_0x406c('0x12')]||util[_0x406c('0x13')](this[_0x406c('0x3')]['id'],this[_0x406c('0x5')][_0x406c('0x10')][this[_0x406c('0x4')]['id']],this['squeue'][_0x406c('0x14')],![])){this[_0x406c('0x5')]['agents'][this[_0x406c('0x4')]['id']][_0x406c('0x15')]=!![];this['realtime'][_0x406c('0x10')][this['agent']['id']][_0x406c('0x16')]=undefined;util['showNotification'](this[_0x406c('0x17')],this['squeue']['id'],this['realtime'][_0x406c('0x10')][this[_0x406c('0x4')]['id']],null,this[_0x406c('0x2')]);util[_0x406c('0x18')](this[_0x406c('0x3')]['id'],this['realtime'][_0x406c('0x10')][this[_0x406c('0x4')]['id']],_0x406c('0x19')+(this[_0x406c('0x2')][_0x406c('0x12')]?':FORCED':''));}else{logger[_0x406c('0xd')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x406c('0x3')]['id'],this[_0x406c('0x4')]['id']);setTimeout(this[_0x406c('0x6')][_0x406c('0x8')](this),0x3e8);}}};Agent[_0x406c('0xc')][_0x406c('0x9')]=function(_0x524848){if(_[_0x406c('0xf')](this[_0x406c('0x5')][_0x406c('0x10')][this[_0x406c('0x4')]['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x406c('0x3')]['id'],this['agent']['id']);}else{logger[_0x406c('0xd')](_0x406c('0x1a'),this[_0x406c('0x3')]['id'],this[_0x406c('0x4')]['id']);util[_0x406c('0x1b')](this['notificationId'],this[_0x406c('0x3')]['id'],this['realtime']['agents'][this[_0x406c('0x4')]['id']],null,this[_0x406c('0x2')]);this['realtime']['agents'][this[_0x406c('0x4')]['id']][_0x406c('0x15')]=![];this['realtime'][_0x406c('0x10')][this[_0x406c('0x4')]['id']][_0x406c('0x16')]=undefined;util['writeLog'](this[_0x406c('0x3')]['id'],this[_0x406c('0x5')][_0x406c('0x10')][this['agent']['id']],_0x524848?_0x406c('0x1c'):'TIMEOUT');}if(!_0x524848){setTimeout(this[_0x406c('0x6')]['bind'](this),0x3e8);}};function agent(_0x4f23c0,_0x385aa5,_0x1ef9a3,_0x32a00f){return new Agent(_0x4f23c0,_0x385aa5,_0x1ef9a3,_0x32a00f);}module[_0x406c('0x1d')]=agent;
\ No newline at end of file
index 839cf2e..c5e5924 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b5f=['realtime','handleRun','bind','handleTimeout','timeout','drained','prototype','push','handleDrained','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busy','name','showNotification','hideNotification','STOP','TIMEOUT','busyQueue','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','queue'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2b5f,0x159));var _0xf2b5=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2b5f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xf2b5('0x0'));var uuid=require('uuid');var util=require(_0xf2b5('0x1'));var logger=require(_0xf2b5('0x2'))(_0xf2b5('0x3'));var Beepall=function(_0x2361c2,_0x18c9df,_0x3c061d,_0x29ea71){this[_0xf2b5('0x4')]=uuid['v4']();this[_0xf2b5('0x5')]=_0x2361c2;this[_0xf2b5('0x6')]=_0x18c9df;this[_0xf2b5('0x7')]=_0x3c061d;this['routing']=_0x29ea71;this['squeue']['push'](this[_0xf2b5('0x8')][_0xf2b5('0x9')](this),this[_0xf2b5('0xa')][_0xf2b5('0x9')](this));this['squeue']['on'](_0xf2b5('0xb'),this[_0xf2b5('0xa')][_0xf2b5('0x9')](this));this['squeue']['on'](_0xf2b5('0xc'),this['handleDrained']['bind'](this));};Beepall[_0xf2b5('0xd')][_0xf2b5('0xe')]=function(){this[_0xf2b5('0x5')]['push'](this['handleRun'][_0xf2b5('0x9')](this),this[_0xf2b5('0xa')]['bind'](this));};Beepall[_0xf2b5('0xd')][_0xf2b5('0xf')]=function(_0x53871b){this[_0xf2b5('0xa')](!![]);};Beepall[_0xf2b5('0xd')]['handleRun']=function(_0x22d0a){var _0x55957b=!![];if(!_[_0xf2b5('0x10')](this[_0xf2b5('0x6')])&&!_[_0xf2b5('0x10')](this['queue'][_0xf2b5('0x11')])&&this[_0xf2b5('0x6')][_0xf2b5('0x11')][_0xf2b5('0x12')]>0x0){for(var _0x43a477=0x0,_0x1dca4d;_0x43a477<this[_0xf2b5('0x6')]['Agents'][_0xf2b5('0x12')];_0x43a477+=0x1){_0x1dca4d=this[_0xf2b5('0x6')]['Agents'][_0x43a477]['id'];if(_[_0xf2b5('0x10')](this[_0xf2b5('0x7')][_0xf2b5('0x13')][_0x1dca4d])){logger[_0xf2b5('0x14')](_0xf2b5('0x15'),this['squeue']['id'],_0x1dca4d);}else{if(util[_0xf2b5('0x16')](this[_0xf2b5('0x5')]['id'],this[_0xf2b5('0x7')][_0xf2b5('0x13')][_0x1dca4d],this[_0xf2b5('0x5')]['channel'],!![])){_0x55957b=![];util[_0xf2b5('0x17')](this[_0xf2b5('0x5')]['id'],this[_0xf2b5('0x7')][_0xf2b5('0x13')][_0x1dca4d],_0xf2b5('0x18'));this['realtime']['agents'][_0x1dca4d][_0xf2b5('0x19')]=!![];this[_0xf2b5('0x7')][_0xf2b5('0x13')][_0x1dca4d]['busyQueue']=this['queue'][_0xf2b5('0x1a')];util[_0xf2b5('0x1b')](this['notificationId'],this[_0xf2b5('0x5')]['id'],this['realtime'][_0xf2b5('0x13')][_0x1dca4d],this[_0xf2b5('0x6')],this[_0xf2b5('0x3')]);}}}if(_0x55957b){logger[_0xf2b5('0x14')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0xf2b5('0x5')]['id']);setTimeout(this['push'][_0xf2b5('0x9')](this),0x3e8);}}else{logger['info']('[%s][QUEUE]\x20EMPTY',this[_0xf2b5('0x5')]['id']);setTimeout(this[_0xf2b5('0xe')][_0xf2b5('0x9')](this),0x3e8);}};Beepall[_0xf2b5('0xd')][_0xf2b5('0xa')]=function(_0x5ed6e0){if(!_[_0xf2b5('0x10')](this[_0xf2b5('0x6')])&&!_['isNil'](this[_0xf2b5('0x6')]['Agents'])){for(var _0x2ead03=0x0,_0x48a605;_0x2ead03<this['queue'][_0xf2b5('0x11')][_0xf2b5('0x12')];_0x2ead03+=0x1){_0x48a605=this[_0xf2b5('0x6')][_0xf2b5('0x11')][_0x2ead03]['id'];if(_[_0xf2b5('0x10')](this[_0xf2b5('0x7')]['agents'][_0x48a605])){logger['info'](_0xf2b5('0x15'),this[_0xf2b5('0x5')]['id'],_0x48a605);}else{util[_0xf2b5('0x1c')](this[_0xf2b5('0x4')],this[_0xf2b5('0x5')]['id'],this[_0xf2b5('0x7')][_0xf2b5('0x13')][_0x48a605],this[_0xf2b5('0x6')],this[_0xf2b5('0x3')]);util['writeLog'](this['squeue']['id'],this[_0xf2b5('0x7')][_0xf2b5('0x13')][_0x48a605],_0x5ed6e0?_0xf2b5('0x1d'):_0xf2b5('0x1e'));this[_0xf2b5('0x7')][_0xf2b5('0x13')][_0x48a605][_0xf2b5('0x19')]=![];this[_0xf2b5('0x7')]['agents'][_0x48a605][_0xf2b5('0x1f')]=undefined;}}}if(!_0x5ed6e0){setTimeout(this[_0xf2b5('0xe')][_0xf2b5('0x9')](this),0x3e8);}};function beepall(_0x408bef,_0x584161,_0x3cfdbe,_0xdb9470){return new Beepall(_0x408bef,_0x584161,_0x3cfdbe,_0xdb9470);}module['exports']=beepall;
\ No newline at end of file
+var _0xee6e=['isNil','agents','info','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','exports','lodash','uuid','./util','routing','notificationId','realtime','squeue','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','queue','Agents','length'];(function(_0xde8fa2,_0x4fa3f8){var _0x38bb8e=function(_0x898f88){while(--_0x898f88){_0xde8fa2['push'](_0xde8fa2['shift']());}};_0x38bb8e(++_0x4fa3f8);}(_0xee6e,0xaf));var _0xeee6=function(_0x4ab03e,_0x1ebd79){_0x4ab03e=_0x4ab03e-0x0;var _0x176c2e=_0xee6e[_0x4ab03e];return _0x176c2e;};'use strict';var _=require(_0xeee6('0x0'));var uuid=require(_0xeee6('0x1'));var util=require(_0xeee6('0x2'));var logger=require('../../../../../config/logger')(_0xeee6('0x3'));var Beepall=function(_0x1c0c89,_0x560e47,_0x59df55,_0x5b8f4a){this[_0xeee6('0x4')]=uuid['v4']();this['squeue']=_0x1c0c89;this['queue']=_0x560e47;this[_0xeee6('0x5')]=_0x59df55;this[_0xeee6('0x3')]=_0x5b8f4a;this[_0xeee6('0x6')][_0xeee6('0x7')](this[_0xeee6('0x8')][_0xeee6('0x9')](this),this[_0xeee6('0xa')][_0xeee6('0x9')](this));this['squeue']['on'](_0xeee6('0xb'),this[_0xeee6('0xa')][_0xeee6('0x9')](this));this[_0xeee6('0x6')]['on']('drained',this[_0xeee6('0xc')][_0xeee6('0x9')](this));};Beepall[_0xeee6('0xd')][_0xeee6('0x7')]=function(){this[_0xeee6('0x6')][_0xeee6('0x7')](this['handleRun'][_0xeee6('0x9')](this),this[_0xeee6('0xa')][_0xeee6('0x9')](this));};Beepall[_0xeee6('0xd')][_0xeee6('0xc')]=function(_0x2d56cf){this['handleTimeout'](!![]);};Beepall['prototype'][_0xeee6('0x8')]=function(_0x5956a8){var _0x5e692b=!![];if(!_['isNil'](this[_0xeee6('0xe')])&&!_['isNil'](this[_0xeee6('0xe')][_0xeee6('0xf')])&&this['queue']['Agents'][_0xeee6('0x10')]>0x0){for(var _0x1155d5=0x0,_0x4ef240;_0x1155d5<this[_0xeee6('0xe')][_0xeee6('0xf')][_0xeee6('0x10')];_0x1155d5+=0x1){_0x4ef240=this[_0xeee6('0xe')][_0xeee6('0xf')][_0x1155d5]['id'];if(_[_0xeee6('0x11')](this[_0xeee6('0x5')][_0xeee6('0x12')][_0x4ef240])){logger[_0xeee6('0x13')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xeee6('0x6')]['id'],_0x4ef240);}else{if(util[_0xeee6('0x14')](this[_0xeee6('0x6')]['id'],this['realtime'][_0xeee6('0x12')][_0x4ef240],this[_0xeee6('0x6')][_0xeee6('0x15')],!![])){_0x5e692b=![];util[_0xeee6('0x16')](this[_0xeee6('0x6')]['id'],this[_0xeee6('0x5')][_0xeee6('0x12')][_0x4ef240],_0xeee6('0x17'));this['realtime'][_0xeee6('0x12')][_0x4ef240][_0xeee6('0x18')]=!![];this[_0xeee6('0x5')][_0xeee6('0x12')][_0x4ef240][_0xeee6('0x19')]=this[_0xeee6('0xe')][_0xeee6('0x1a')];util['showNotification'](this[_0xeee6('0x4')],this[_0xeee6('0x6')]['id'],this[_0xeee6('0x5')]['agents'][_0x4ef240],this['queue'],this[_0xeee6('0x3')]);}}}if(_0x5e692b){logger[_0xeee6('0x13')](_0xeee6('0x1b'),this[_0xeee6('0x6')]['id']);setTimeout(this['push'][_0xeee6('0x9')](this),0x3e8);}}else{logger[_0xeee6('0x13')]('[%s][QUEUE]\x20EMPTY',this['squeue']['id']);setTimeout(this[_0xeee6('0x7')]['bind'](this),0x3e8);}};Beepall['prototype'][_0xeee6('0xa')]=function(_0xc3406f){if(!_[_0xeee6('0x11')](this[_0xeee6('0xe')])&&!_['isNil'](this[_0xeee6('0xe')][_0xeee6('0xf')])){for(var _0x486f2e=0x0,_0x48bed2;_0x486f2e<this[_0xeee6('0xe')]['Agents'][_0xeee6('0x10')];_0x486f2e+=0x1){_0x48bed2=this['queue'][_0xeee6('0xf')][_0x486f2e]['id'];if(_['isNil'](this['realtime']['agents'][_0x48bed2])){logger[_0xeee6('0x13')](_0xeee6('0x1c'),this[_0xeee6('0x6')]['id'],_0x48bed2);}else{util[_0xeee6('0x1d')](this[_0xeee6('0x4')],this[_0xeee6('0x6')]['id'],this[_0xeee6('0x5')]['agents'][_0x48bed2],this[_0xeee6('0xe')],this[_0xeee6('0x3')]);util[_0xeee6('0x16')](this[_0xeee6('0x6')]['id'],this[_0xeee6('0x5')][_0xeee6('0x12')][_0x48bed2],_0xc3406f?_0xeee6('0x1e'):'TIMEOUT');this[_0xeee6('0x5')]['agents'][_0x48bed2]['busy']=![];this['realtime'][_0xeee6('0x12')][_0x48bed2][_0xeee6('0x19')]=undefined;}}}if(!_0xc3406f){setTimeout(this[_0xeee6('0x7')][_0xeee6('0x9')](this),0x3e8);}};function beepall(_0x4c80a6,_0x50d249,_0x172ace,_0x147304){return new Beepall(_0x4c80a6,_0x50d249,_0x172ace,_0x147304);}module[_0xeee6('0x1f')]=beepall;
\ No newline at end of file
index 3462672..06f5e07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e8a=['./beepall','./rrmemory'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x3300ee,_0xed60a9){_0x3300ee=_0x3300ee-0x0;var _0x714154=_0x2e8a[_0x3300ee];return _0x714154;};'use strict';module['exports']={'rrmemory':require(_0xa2e8('0x0')),'beepall':require(_0xa2e8('0x1')),'agent':require('./agent')};
\ No newline at end of file
+var _0x7fbe=['./beepall','./agent'];(function(_0x30d810,_0x2c3fc1){var _0x461823=function(_0x56e8a9){while(--_0x56e8a9){_0x30d810['push'](_0x30d810['shift']());}};_0x461823(++_0x2c3fc1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3b2e0a,_0x49a3f9){_0x3b2e0a=_0x3b2e0a-0x0;var _0x4a84bd=_0x7fbe[_0x3b2e0a];return _0x4a84bd;};'use strict';module['exports']={'rrmemory':require('./rrmemory'),'beepall':require(_0xe7fb('0x0')),'agent':require(_0xe7fb('0x1'))};
\ No newline at end of file
index 54b39c6..08856c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e76=['isAgentAvailable','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','name','showNotification','notificationId','writeLog','RINGING','hideNotification','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','intervals','push','handleRun','bind','module','timeout','drained','handleDrained','prototype','handleTimeout','handleCheckReject'];(function(_0x107283,_0x6a1220){var _0x5b47be=function(_0x2228ac){while(--_0x2228ac){_0x107283['push'](_0x107283['shift']());}};_0x5b47be(++_0x6a1220);}(_0x8e76,0x1c1));var _0x68e7=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x8e76[_0x6131cd];return _0x47e916;};'use strict';var rr=require('rr');var _=require(_0x68e7('0x0'));var uuid=require(_0x68e7('0x1'));var util=require(_0x68e7('0x2'));var logger=require(_0x68e7('0x3'))(_0x68e7('0x4'));var RRMemory=function(_0x4df215,_0x2a2a4b,_0x5fedea,_0x58b293){this['notificationId']=uuid['v4']();this[_0x68e7('0x5')]=_0x4df215;this[_0x68e7('0x6')]=_0x2a2a4b;this[_0x68e7('0x7')]=_0x5fedea;this[_0x68e7('0x4')]=_0x58b293;this[_0x68e7('0x8')]={};this['squeue'][_0x68e7('0x9')](this[_0x68e7('0xa')][_0x68e7('0xb')](this),this['handleTimeout'][_0x68e7('0xb')](this),this[_0x68e7('0xc')]);this['squeue']['on'](_0x68e7('0xd'),this['handleTimeout'][_0x68e7('0xb')](this));this[_0x68e7('0x5')]['on'](_0x68e7('0xe'),this[_0x68e7('0xf')][_0x68e7('0xb')](this));};RRMemory[_0x68e7('0x10')][_0x68e7('0x9')]=function(){this['squeue'][_0x68e7('0x9')](this[_0x68e7('0xa')]['bind'](this),this[_0x68e7('0x11')]['bind'](this));};RRMemory[_0x68e7('0x10')][_0x68e7('0xf')]=function(_0xf9f60a){this['handleTimeout'](!![]);};RRMemory['prototype'][_0x68e7('0x12')]=function(_0x4938bc){if(util[_0x68e7('0x13')](this[_0x68e7('0x5')]['id'],this[_0x68e7('0x7')][_0x68e7('0x14')][this[_0x68e7('0x15')]],this['squeue'][_0x68e7('0x16')],!![])){logger[_0x68e7('0x17')](_0x68e7('0x18'),this[_0x68e7('0x5')]['id'],this[_0x68e7('0x15')]);clearInterval(this[_0x68e7('0x8')][this['agentId']]);_0x4938bc[_0x68e7('0x19')]();setTimeout(this[_0x68e7('0x9')][_0x68e7('0xb')](this),0x3e8);}};RRMemory[_0x68e7('0x10')][_0x68e7('0xa')]=function(_0x56dce4){this[_0x68e7('0x15')]=rr(this[_0x68e7('0x6')][_0x68e7('0x1a')]);logger[_0x68e7('0x17')](_0x68e7('0x1b'),this['squeue']['id'],this[_0x68e7('0x15')]);if(_[_0x68e7('0x1c')](this[_0x68e7('0x7')][_0x68e7('0x14')][this[_0x68e7('0x15')]])){logger['info'](_0x68e7('0x1d'),this[_0x68e7('0x5')]['id'],this[_0x68e7('0x15')]);_0x56dce4['done']();setTimeout(this[_0x68e7('0x9')][_0x68e7('0xb')](this),0x3e8);}else{if(util[_0x68e7('0x13')](this[_0x68e7('0x5')]['id'],this[_0x68e7('0x7')]['agents'][this[_0x68e7('0x15')]],this[_0x68e7('0x5')][_0x68e7('0x16')],!![])){this[_0x68e7('0x7')][_0x68e7('0x14')][this[_0x68e7('0x15')]][_0x68e7('0x1e')]=!![];this[_0x68e7('0x7')][_0x68e7('0x14')][this['agentId']][_0x68e7('0x1f')]=this['queue'][_0x68e7('0x20')];util[_0x68e7('0x21')](this[_0x68e7('0x22')],this[_0x68e7('0x5')]['id'],this[_0x68e7('0x7')]['agents'][this[_0x68e7('0x15')]],this[_0x68e7('0x6')],this[_0x68e7('0x4')]);util[_0x68e7('0x23')](this[_0x68e7('0x5')]['id'],this['realtime'][_0x68e7('0x14')][this['agentId']],_0x68e7('0x24'));this['intervals'][this[_0x68e7('0x15')]]=setInterval(this['handleCheckReject'][_0x68e7('0xb')](this,_0x56dce4),0x3e8);}else{logger[_0x68e7('0x17')]('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this[_0x68e7('0x5')]['id'],this[_0x68e7('0x15')]);_0x56dce4[_0x68e7('0x19')]();setTimeout(this[_0x68e7('0x9')][_0x68e7('0xb')](this),0x3e8);}}};RRMemory[_0x68e7('0x10')][_0x68e7('0x11')]=function(_0x391150){logger[_0x68e7('0x17')]('[%s][QUEUE]\x20timeout\x20with\x20%s',this[_0x68e7('0x5')]['id'],this[_0x68e7('0x15')]);if(_[_0x68e7('0x1c')](this[_0x68e7('0x7')]['agents'][this[_0x68e7('0x15')]])){logger[_0x68e7('0x17')](_0x68e7('0x1d'),this[_0x68e7('0x5')]['id'],this[_0x68e7('0x15')]);}else{clearInterval(this[_0x68e7('0x8')][this['agentId']]);util[_0x68e7('0x25')](this[_0x68e7('0x22')],this['squeue']['id'],this[_0x68e7('0x7')]['agents'][this[_0x68e7('0x15')]],this[_0x68e7('0x6')],this['routing']);util[_0x68e7('0x23')](this[_0x68e7('0x5')]['id'],this['realtime'][_0x68e7('0x14')][this[_0x68e7('0x15')]],_0x68e7('0x26'));this[_0x68e7('0x7')][_0x68e7('0x14')][this[_0x68e7('0x15')]][_0x68e7('0x1e')]=![];this[_0x68e7('0x7')][_0x68e7('0x14')][this[_0x68e7('0x15')]][_0x68e7('0x1f')]=undefined;}if(!_0x391150){setTimeout(this[_0x68e7('0x9')][_0x68e7('0xb')](this),0x3e8);}};function rrmemory(_0x27aad8,_0x4febac,_0x15c8b2,_0x50ccd0){return new RRMemory(_0x27aad8,_0x4febac,_0x15c8b2,_0x50ccd0);}module['exports']=rrmemory;
\ No newline at end of file
+var _0x7358=['handleDrained','bind','prototype','agentId','info','[%s][QUEUE]\x20available\x20again\x20%s','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','agents','isAgentAvailable','busyQueue','name','showNotification','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','TIMEOUT','exports','lodash','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','intervals','push','handleRun','handleTimeout','module','timeout'];(function(_0x2c9b25,_0x20d598){var _0x54b93b=function(_0x204407){while(--_0x204407){_0x2c9b25['push'](_0x2c9b25['shift']());}};_0x54b93b(++_0x20d598);}(_0x7358,0xc5));var _0x8735=function(_0x3e0ac3,_0xb911e8){_0x3e0ac3=_0x3e0ac3-0x0;var _0x311d7c=_0x7358[_0x3e0ac3];return _0x311d7c;};'use strict';var rr=require('rr');var _=require(_0x8735('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x8735('0x1'))(_0x8735('0x2'));var RRMemory=function(_0x2e88e2,_0x4bb6fc,_0x76e561,_0x17032f){this[_0x8735('0x3')]=uuid['v4']();this[_0x8735('0x4')]=_0x2e88e2;this[_0x8735('0x5')]=_0x4bb6fc;this[_0x8735('0x6')]=_0x76e561;this['routing']=_0x17032f;this[_0x8735('0x7')]={};this[_0x8735('0x4')][_0x8735('0x8')](this[_0x8735('0x9')]['bind'](this),this[_0x8735('0xa')]['bind'](this),this[_0x8735('0xb')]);this[_0x8735('0x4')]['on'](_0x8735('0xc'),this[_0x8735('0xa')]['bind'](this));this['squeue']['on']('drained',this[_0x8735('0xd')][_0x8735('0xe')](this));};RRMemory[_0x8735('0xf')]['push']=function(){this[_0x8735('0x4')][_0x8735('0x8')](this[_0x8735('0x9')]['bind'](this),this[_0x8735('0xa')][_0x8735('0xe')](this));};RRMemory[_0x8735('0xf')][_0x8735('0xd')]=function(_0x1ceefd){this[_0x8735('0xa')](!![]);};RRMemory[_0x8735('0xf')]['handleCheckReject']=function(_0x473cce){if(util['isAgentAvailable'](this['squeue']['id'],this['realtime']['agents'][this[_0x8735('0x10')]],this[_0x8735('0x4')]['channel'],!![])){logger[_0x8735('0x11')](_0x8735('0x12'),this[_0x8735('0x4')]['id'],this['agentId']);clearInterval(this[_0x8735('0x7')][this[_0x8735('0x10')]]);_0x473cce[_0x8735('0x13')]();setTimeout(this[_0x8735('0x8')][_0x8735('0xe')](this),0x3e8);}};RRMemory[_0x8735('0xf')][_0x8735('0x9')]=function(_0x6cd69b){this['agentId']=rr(this[_0x8735('0x5')][_0x8735('0x14')]);logger[_0x8735('0x11')](_0x8735('0x15'),this[_0x8735('0x4')]['id'],this[_0x8735('0x10')]);if(_[_0x8735('0x16')](this['realtime'][_0x8735('0x17')][this[_0x8735('0x10')]])){logger[_0x8735('0x11')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x8735('0x4')]['id'],this[_0x8735('0x10')]);_0x6cd69b[_0x8735('0x13')]();setTimeout(this[_0x8735('0x8')]['bind'](this),0x3e8);}else{if(util[_0x8735('0x18')](this[_0x8735('0x4')]['id'],this[_0x8735('0x6')]['agents'][this[_0x8735('0x10')]],this['squeue']['channel'],!![])){this[_0x8735('0x6')][_0x8735('0x17')][this['agentId']]['busy']=!![];this[_0x8735('0x6')][_0x8735('0x17')][this[_0x8735('0x10')]][_0x8735('0x19')]=this[_0x8735('0x5')][_0x8735('0x1a')];util[_0x8735('0x1b')](this['notificationId'],this[_0x8735('0x4')]['id'],this[_0x8735('0x6')][_0x8735('0x17')][this[_0x8735('0x10')]],this[_0x8735('0x5')],this[_0x8735('0x2')]);util[_0x8735('0x1c')](this[_0x8735('0x4')]['id'],this[_0x8735('0x6')][_0x8735('0x17')][this[_0x8735('0x10')]],_0x8735('0x1d'));this[_0x8735('0x7')][this[_0x8735('0x10')]]=setInterval(this['handleCheckReject'][_0x8735('0xe')](this,_0x6cd69b),0x3e8);}else{logger[_0x8735('0x11')](_0x8735('0x1e'),this[_0x8735('0x4')]['id'],this[_0x8735('0x10')]);_0x6cd69b[_0x8735('0x13')]();setTimeout(this[_0x8735('0x8')][_0x8735('0xe')](this),0x3e8);}}};RRMemory[_0x8735('0xf')][_0x8735('0xa')]=function(_0x9fb945){logger[_0x8735('0x11')](_0x8735('0x1f'),this[_0x8735('0x4')]['id'],this['agentId']);if(_[_0x8735('0x16')](this[_0x8735('0x6')][_0x8735('0x17')][this[_0x8735('0x10')]])){logger[_0x8735('0x11')](_0x8735('0x20'),this[_0x8735('0x4')]['id'],this['agentId']);}else{clearInterval(this['intervals'][this['agentId']]);util['hideNotification'](this['notificationId'],this[_0x8735('0x4')]['id'],this[_0x8735('0x6')][_0x8735('0x17')][this[_0x8735('0x10')]],this[_0x8735('0x5')],this['routing']);util[_0x8735('0x1c')](this[_0x8735('0x4')]['id'],this[_0x8735('0x6')][_0x8735('0x17')][this[_0x8735('0x10')]],_0x8735('0x21'));this[_0x8735('0x6')][_0x8735('0x17')][this[_0x8735('0x10')]]['busy']=![];this[_0x8735('0x6')][_0x8735('0x17')][this[_0x8735('0x10')]]['busyQueue']=undefined;}if(!_0x9fb945){setTimeout(this[_0x8735('0x8')][_0x8735('0xe')](this),0x3e8);}};function rrmemory(_0x48b784,_0x173031,_0x29604c,_0x410332){return new RRMemory(_0x48b784,_0x173031,_0x29604c,_0x410332);}module[_0x8735('0x22')]=rrmemory;
\ No newline at end of file
index 590f4c4..7525130 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3a0=['hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','lodash','util','../utils','mustache','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','user:%s','name','user:save','split','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','format','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','Pause','PAUSE'];(function(_0x2214e7,_0xea4953){var _0x1cd07b=function(_0x5ebcbf){while(--_0x5ebcbf){_0x2214e7['push'](_0x2214e7['shift']());}};_0x1cd07b(++_0xea4953);}(_0xd3a0,0xaa));var _0x0d3a=function(_0x4adfcc,_0x4ef91a){_0x4adfcc=_0x4adfcc-0x0;var _0x566c4e=_0xd3a0[_0x4adfcc];return _0x566c4e;};'use strict';var _=require(_0x0d3a('0x0'));var util=require(_0x0d3a('0x1'));var utils=require(_0x0d3a('0x2'));var Mustache=require(_0x0d3a('0x3'));var Redis=require('ioredis');var config=require(_0x0d3a('0x4'));var logger=require(_0x0d3a('0x5'))(_0x0d3a('0x6'));config[_0x0d3a('0x7')]=_[_0x0d3a('0x8')](config['redis'],{'host':_0x0d3a('0x9'),'port':0x18eb});var io=require(_0x0d3a('0xa'))(new Redis(config[_0x0d3a('0x7')]));function emit(_0x437b06,_0x46b328,_0x50d6bb){io['to'](_0x437b06)[_0x0d3a('0xb')](_0x46b328,_0x50d6bb);}function sendNotification(_0x262ce7,_0x2b7d16,_0xa10301,_0x66d9b,_0x263571,_0x2c2496){io['to'](util['format'](_0x0d3a('0xc'),_0x66d9b[_0x0d3a('0xd')]))['emit'](_0x0d3a('0xe'),_0x66d9b);var _0x6388e6=_0x2c2496||{};var _0x17246d=_0xa10301[_0x0d3a('0xf')]('.');var _0x58625a={'uniqueid':_0x2b7d16,'channel':_0x17246d[0x0],'id':_0x17246d[0x1],'title':_0x17246d[0x0]+'\x20interaction','interactionId':_0x17246d[0x2],'queue':_0x263571?_0x263571[_0x0d3a('0xd')]:null,'sound':_0x6388e6[_0x0d3a('0x10')][_0x0d3a('0x11')],'shake':_0x6388e6[_0x0d3a('0x10')][_0x0d3a('0x12')]};try{if(!_0x6388e6[_0x0d3a('0x13')]){_0x6388e6[_0x0d3a('0x13')]={};}if(_0x263571){_0x6388e6[_0x0d3a('0x13')][_0x0d3a('0x14')]=_0x263571;}else if(_0x6388e6[_0x0d3a('0x13')][_0x0d3a('0x14')]){delete _0x6388e6['body']['queue'];}_0x58625a[_0x0d3a('0x15')]=utils[_0x0d3a('0x16')](_0x6388e6[_0x0d3a('0x10')][_0x0d3a('0x17')],_0x6388e6);}catch(_0x3b7350){_0x58625a[_0x0d3a('0x15')]=_0x0d3a('0x18');logger[_0x0d3a('0x19')](util['format'](_0x0d3a('0x1a'),_0x2b7d16,_0x3b7350['message']));}io['to'](util[_0x0d3a('0x1b')](_0x0d3a('0xc'),_0x66d9b[_0x0d3a('0xd')]))['emit'](util[_0x0d3a('0x1b')]('notification:%s',_0x262ce7?'save':_0x0d3a('0x1c')),_0x58625a);}function writeLog(_0x4b9ca4,_0x1a913c,_0x34278e){return logger[_0x0d3a('0x1d')](util[_0x0d3a('0x1b')](_0x0d3a('0x1e'),_0x4b9ca4,_0x1a913c[_0x0d3a('0xd')],_0x34278e));}exports[_0x0d3a('0x1f')]=function(_0x37728a,_0x2e82e8,_0x69e26d,_0x4c54f9){if(_0x2e82e8['busy']){writeLog(_0x37728a,_0x2e82e8,_0x0d3a('0x20'));return![];}if(!_0x2e82e8['online']){writeLog(_0x37728a,_0x2e82e8,'OFFLINE');return![];}if(_0x2e82e8[_0x69e26d+_0x0d3a('0x21')]){writeLog(_0x37728a,_0x2e82e8,_0x0d3a('0x22'));return![];}if(_0x4c54f9&&_0x2e82e8[_0x0d3a('0x23')](_0x69e26d+_0x0d3a('0x24'))&&_0x2e82e8[_0x0d3a('0x23')](_0x69e26d+_0x0d3a('0x25'))){if(_0x2e82e8[_0x69e26d+_0x0d3a('0x24')]>0x0&&_0x2e82e8[_0x69e26d+_0x0d3a('0x25')]>=_0x2e82e8[_0x69e26d+_0x0d3a('0x24')]){writeLog(_0x37728a,_0x2e82e8,_0x69e26d['toUpperCase']()+_0x0d3a('0x26'));return![];}}return!![];};exports[_0x0d3a('0x27')]=function(_0x5356bc,_0x1128a2,_0x45e1de,_0x2abf71,_0x19ada3){return sendNotification(!![],_0x5356bc,_0x1128a2,_0x45e1de,_0x2abf71,_0x19ada3);};exports[_0x0d3a('0x28')]=function(_0x4ab37b,_0x3b1875,_0x2d40d8,_0x1d54dc,_0x4910bb){return sendNotification(![],_0x4ab37b,_0x3b1875,_0x2d40d8,_0x1d54dc,_0x4910bb);};exports['writeLog']=writeLog;
\ No newline at end of file
+var _0x38e7=['util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','emit','format','name','account','notificationSound','notificationShake','body','queue','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','user:%s','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','OFFLINE','Pause','hasOwnProperty','CurrentCapacity','Capacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash'];(function(_0x25f433,_0xa7dc75){var _0x552c01=function(_0x54a249){while(--_0x54a249){_0x25f433['push'](_0x25f433['shift']());}};_0x552c01(++_0xa7dc75);}(_0x38e7,0x1eb));var _0x738e=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x38e7[_0x3a2a3c];return _0x50ac9a;};'use strict';var _=require(_0x738e('0x0'));var util=require(_0x738e('0x1'));var utils=require(_0x738e('0x2'));var Mustache=require(_0x738e('0x3'));var Redis=require(_0x738e('0x4'));var config=require(_0x738e('0x5'));var logger=require(_0x738e('0x6'))(_0x738e('0x7'));config[_0x738e('0x8')]=_[_0x738e('0x9')](config[_0x738e('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x282b59,_0x35db07,_0x26c0a7){io['to'](_0x282b59)[_0x738e('0xa')](_0x35db07,_0x26c0a7);}function sendNotification(_0x160926,_0x236c7b,_0x2fa718,_0x36f796,_0x46c692,_0x1e0d5b){io['to'](util[_0x738e('0xb')]('user:%s',_0x36f796['name']))[_0x738e('0xa')]('user:save',_0x36f796);var _0x10a266=_0x1e0d5b||{};var _0x12c9e0=_0x2fa718['split']('.');var _0xd0134={'uniqueid':_0x236c7b,'channel':_0x12c9e0[0x0],'id':_0x12c9e0[0x1],'title':_0x12c9e0[0x0]+'\x20interaction','interactionId':_0x12c9e0[0x2],'queue':_0x46c692?_0x46c692[_0x738e('0xc')]:null,'sound':_0x10a266[_0x738e('0xd')][_0x738e('0xe')],'shake':_0x10a266[_0x738e('0xd')][_0x738e('0xf')]};try{if(!_0x10a266[_0x738e('0x10')]){_0x10a266['body']={};}if(_0x46c692){_0x10a266[_0x738e('0x10')][_0x738e('0x11')]=_0x46c692;}else if(_0x10a266[_0x738e('0x10')][_0x738e('0x11')]){delete _0x10a266[_0x738e('0x10')][_0x738e('0x11')];}_0xd0134['msg']=utils[_0x738e('0x12')](_0x10a266[_0x738e('0xd')]['notificationTemplate'],_0x10a266);}catch(_0x3f2d3c){_0xd0134['msg']=_0x738e('0x13');logger[_0x738e('0x14')](util[_0x738e('0xb')](_0x738e('0x15'),_0x236c7b,_0x3f2d3c[_0x738e('0x16')]));}io['to'](util[_0x738e('0xb')](_0x738e('0x17'),_0x36f796['name']))[_0x738e('0xa')](util['format'](_0x738e('0x18'),_0x160926?_0x738e('0x19'):_0x738e('0x1a')),_0xd0134);}function writeLog(_0x5f2d11,_0x168491,_0x2bb2ff){return logger[_0x738e('0x1b')](util[_0x738e('0xb')](_0x738e('0x1c'),_0x5f2d11,_0x168491[_0x738e('0xc')],_0x2bb2ff));}exports[_0x738e('0x1d')]=function(_0x17ac1e,_0x31a704,_0x500473,_0x309187){if(_0x31a704[_0x738e('0x1e')]){writeLog(_0x17ac1e,_0x31a704,_0x738e('0x1f'));return![];}if(!_0x31a704['online']){writeLog(_0x17ac1e,_0x31a704,_0x738e('0x20'));return![];}if(_0x31a704[_0x500473+_0x738e('0x21')]){writeLog(_0x17ac1e,_0x31a704,'PAUSE');return![];}if(_0x309187&&_0x31a704[_0x738e('0x22')](_0x500473+'Capacity')&&_0x31a704['hasOwnProperty'](_0x500473+_0x738e('0x23'))){if(_0x31a704[_0x500473+_0x738e('0x24')]>0x0&&_0x31a704[_0x500473+_0x738e('0x23')]>=_0x31a704[_0x500473+_0x738e('0x24')]){writeLog(_0x17ac1e,_0x31a704,_0x500473['toUpperCase']()+_0x738e('0x25'));return![];}}return!![];};exports[_0x738e('0x26')]=function(_0x3b4a25,_0x471af6,_0x17b36a,_0x37c2dc,_0x2e3a94){return sendNotification(!![],_0x3b4a25,_0x471af6,_0x17b36a,_0x37c2dc,_0x2e3a94);};exports[_0x738e('0x27')]=function(_0x1dd816,_0x129fcb,_0x187475,_0xcb715f,_0x222fa5){return sendNotification(![],_0x1dd816,_0x129fcb,_0x187475,_0xcb715f,_0x222fa5);};exports[_0x738e('0x28')]=writeLog;
\ No newline at end of file
index 5f03597..85d0063 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacdf=['[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty'];(function(_0x494c37,_0x59f21c){var _0x5deef7=function(_0x1d34bf){while(--_0x1d34bf){_0x494c37['push'](_0x494c37['shift']());}};_0x5deef7(++_0x59f21c);}(_0xacdf,0xee));var _0xfacd=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xacdf[_0xbf8ebe];return _0x1e25e8;};'use strict';var schema=require(_0xfacd('0x0'));var sh=require(_0xfacd('0x1'));var _=require(_0xfacd('0x2'));var utils=require(_0xfacd('0x3'));var logger=require(_0xfacd('0x4'))(_0xfacd('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0xfacd('0x6')}});exports[_0xfacd('0x7')]=function(_0x29ad4f,_0x19ea16){return function(_0x27cc54){try{var _0x14f970={'command':_0x19ea16[0x0]};var _0x7665f=system[_0xfacd('0x0')](_0x14f970,{'typecast':!![]});if(_0x7665f[_0xfacd('0x8')]){logger[_0xfacd('0x9')](_0xfacd('0xa'),_0x29ad4f,_[_0xfacd('0xb')](_0x7665f,_0xfacd('0xc'))[_0xfacd('0xd')](',\x20'));logger[_0xfacd('0xe')](_0xfacd('0xf'),_0x29ad4f);_0x27cc54['next']();}else{var _0x1d705c=this;var _0x383eb3=utils[_0xfacd('0x10')](_0x19ea16[0x0],this);logger[_0xfacd('0xe')](_0xfacd('0x11'),_0x29ad4f,_0x383eb3);sh[_0xfacd('0x12')](_[_0xfacd('0x13')](_0x383eb3),function(_0x2a9c04,_0x37314c){logger[_0xfacd('0xe')](_0xfacd('0x14'),_0x29ad4f,_0x2a9c04);if(_0x2a9c04==0x0){var _0x3de564=_0x37314c[_0xfacd('0x15')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x19ea16[0x1])||_[_0xfacd('0x16')](_0x19ea16[0x1])){logger[_0xfacd('0xe')](_0xfacd('0x17'),_0x29ad4f);_0x1d705c[_0xfacd('0x18')][_0x19ea16[0x1]]=_0x3de564;}else{logger[_0xfacd('0xe')](_0xfacd('0x19'),_0x29ad4f,_0x19ea16[0x1],_0x3de564);_0x1d705c['body'][_0x19ea16[0x1]]=_0x3de564;}}_0x27cc54[_0xfacd('0x1a')]();});}}catch(_0x304411){logger[_0xfacd('0x9')](_0xfacd('0xa'),_0x29ad4f,_[_0xfacd('0x1b')](_0x304411)?JSON[_0xfacd('0x1c')](_0x304411):_0x304411);logger[_0xfacd('0xe')](_0xfacd('0xf'),_0x29ad4f);_0x27cc54['next']();}};};
\ No newline at end of file
+var _0x6d40=['validate','shelljs','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify'];(function(_0x318410,_0x451962){var _0x2898a3=function(_0x58e572){while(--_0x58e572){_0x318410['push'](_0x318410['shift']());}};_0x2898a3(++_0x451962);}(_0x6d40,0x168));var _0x06d4=function(_0x5055d8,_0x510147){_0x5055d8=_0x5055d8-0x0;var _0x303546=_0x6d40[_0x5055d8];return _0x303546;};'use strict';var schema=require(_0x06d4('0x0'));var sh=require(_0x06d4('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0x06d4('0x2'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x06d4('0x3')}});exports['consequence']=function(_0x187310,_0x3b0ec3){return function(_0x53cf8b){try{var _0x4a4dde={'command':_0x3b0ec3[0x0]};var _0x407a35=system[_0x06d4('0x0')](_0x4a4dde,{'typecast':!![]});if(_0x407a35[_0x06d4('0x4')]){logger['error'](_0x06d4('0x5'),_0x187310,_[_0x06d4('0x6')](_0x407a35,_0x06d4('0x7'))[_0x06d4('0x8')](',\x20'));logger[_0x06d4('0x9')](_0x06d4('0xa'),_0x187310);_0x53cf8b[_0x06d4('0xb')]();}else{var _0x43f6ad=this;var _0x25e4c0=utils[_0x06d4('0xc')](_0x3b0ec3[0x0],this);logger[_0x06d4('0x9')](_0x06d4('0xd'),_0x187310,_0x25e4c0);sh['exec'](_[_0x06d4('0xe')](_0x25e4c0),function(_0x4801d5,_0x3af061){logger[_0x06d4('0x9')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x187310,_0x4801d5);if(_0x4801d5==0x0){var _0x47920c=_0x3af061[_0x06d4('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x06d4('0x10')](_0x3b0ec3[0x1])||_[_0x06d4('0x11')](_0x3b0ec3[0x1])){logger['info'](_0x06d4('0x12'),_0x187310);_0x43f6ad[_0x06d4('0x13')][_0x3b0ec3[0x1]]=_0x47920c;}else{logger[_0x06d4('0x9')](_0x06d4('0x14'),_0x187310,_0x3b0ec3[0x1],_0x47920c);_0x43f6ad['body'][_0x3b0ec3[0x1]]=_0x47920c;}}_0x53cf8b[_0x06d4('0xb')]();});}}catch(_0x2b660a){logger[_0x06d4('0x15')](_0x06d4('0x5'),_0x187310,_[_0x06d4('0x16')](_0x2b660a)?JSON[_0x06d4('0x17')](_0x2b660a):_0x2b660a);logger['info'](_0x06d4('0xa'),_0x187310);_0x53cf8b[_0x06d4('0xb')]();}};};
\ No newline at end of file
index 8a95073..06ce667 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3662=['[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','[%s][TAG]\x20%s','stringify','finally','next','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','validate','error','map','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','info'];(function(_0x35b929,_0x57d9b9){var _0x22ea0b=function(_0x59d459){while(--_0x59d459){_0x35b929['push'](_0x35b929['shift']());}};_0x22ea0b(++_0x57d9b9);}(_0x3662,0xde));var _0x2366=function(_0x35fb94,_0x34811e){_0x35fb94=_0x35fb94-0x0;var _0x3da0ee=_0x3662[_0x35fb94];return _0x3da0ee;};'use strict';var schema=require('validate');var _=require(_0x2366('0x0'));var rpc={'chatInteraction':require(_0x2366('0x1')),'openchannelInteraction':require(_0x2366('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x2366('0x3')),'faxInteraction':require(_0x2366('0x4')),'whatsappInteraction':require(_0x2366('0x5'))};var logger=require(_0x2366('0x6'))(_0x2366('0x7'));var tag=schema({'tag':{'type':_0x2366('0x8'),'required':!![],'message':_0x2366('0x9')}});exports['consequence']=function(_0x2c0438,_0x156a24,_0x4944d9,_0x3b677c){return function(_0xca4306){try{var _0x53e578={'tag':_0x156a24[0x0]};var _0x20b5ed=tag[_0x2366('0xa')](_0x53e578,{'typecast':!![]});if(_0x20b5ed['length']){logger[_0x2366('0xb')]('[%s][TAG]\x20%s',_0x2c0438,_[_0x2366('0xc')](_0x20b5ed,'message')[_0x2366('0xd')](',\x20'));logger['info'](_0x2366('0xe'),_0x2c0438);_0xca4306['next']();}else{var _0x2bdc77={'ids':[_0x156a24[0x0]]};if(rpc[_0x3b677c[_0x2366('0xf')]+_0x2366('0x10')]){rpc[_0x3b677c[_0x2366('0xf')]+_0x2366('0x10')]['addTags'](_0x3b677c['interaction']['id'],_0x2bdc77)['then'](function(_0x3203e9){logger[_0x2366('0x11')](_0x2366('0x12'),_0x2c0438,_0x156a24[0x1],_0x3b677c[_0x2366('0xf')],_0x3b677c[_0x2366('0x13')]['id']);})['catch'](function(_0x24262d){logger[_0x2366('0xb')](_0x2366('0x14'),_0x2c0438,JSON[_0x2366('0x15')](_0x24262d));logger[_0x2366('0x11')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x2c0438);})[_0x2366('0x16')](function(){_0xca4306[_0x2366('0x17')]();});}}}catch(_0x52f6d3){logger[_0x2366('0xb')](_0x2366('0x14'),_0x2c0438,_['isObject'](_0x52f6d3)?JSON['stringify'](_0x52f6d3):_0x52f6d3);logger['info'](_0x2366('0xe'),_0x2c0438);_0xca4306[_0x2366('0x17')]();}};};
\ No newline at end of file
+var _0xda30=['TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','map','message','join','info','next','channel','addTags','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','[%s][TAG]\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number'];(function(_0x1ec849,_0x2d1189){var _0x32f9d6=function(_0x15f867){while(--_0x15f867){_0x1ec849['push'](_0x1ec849['shift']());}};_0x32f9d6(++_0x2d1189);}(_0xda30,0x164));var _0x0da3=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xda30[_0x24259d];return _0x5a701;};'use strict';var schema=require('validate');var _=require(_0x0da3('0x0'));var rpc={'chatInteraction':require(_0x0da3('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x0da3('0x2')),'mailInteraction':require(_0x0da3('0x3')),'faxInteraction':require(_0x0da3('0x4')),'whatsappInteraction':require(_0x0da3('0x5'))};var logger=require('../../../../config/logger')(_0x0da3('0x6'));var tag=schema({'tag':{'type':_0x0da3('0x7'),'required':!![],'message':_0x0da3('0x8')}});exports['consequence']=function(_0x145767,_0x1c5ab1,_0x46bd98,_0x311500){return function(_0x423248){try{var _0x12f9c9={'tag':_0x1c5ab1[0x0]};var _0x3f2189=tag['validate'](_0x12f9c9,{'typecast':!![]});if(_0x3f2189[_0x0da3('0x9')]){logger[_0x0da3('0xa')]('[%s][TAG]\x20%s',_0x145767,_[_0x0da3('0xb')](_0x3f2189,_0x0da3('0xc'))[_0x0da3('0xd')](',\x20'));logger[_0x0da3('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x145767);_0x423248[_0x0da3('0xf')]();}else{var _0x3d1017={'ids':[_0x1c5ab1[0x0]]};if(rpc[_0x311500[_0x0da3('0x10')]+'Interaction']){rpc[_0x311500['channel']+'Interaction'][_0x0da3('0x11')](_0x311500['interaction']['id'],_0x3d1017)['then'](function(_0x408782){logger[_0x0da3('0xe')](_0x0da3('0x12'),_0x145767,_0x1c5ab1[0x1],_0x311500['channel'],_0x311500[_0x0da3('0x13')]['id']);})[_0x0da3('0x14')](function(_0x488d63){logger[_0x0da3('0xa')](_0x0da3('0x15'),_0x145767,JSON[_0x0da3('0x16')](_0x488d63));logger[_0x0da3('0xe')](_0x0da3('0x17'),_0x145767);})[_0x0da3('0x18')](function(){_0x423248['next']();});}}}catch(_0x310989){logger[_0x0da3('0xa')](_0x0da3('0x15'),_0x145767,_[_0x0da3('0x19')](_0x310989)?JSON[_0x0da3('0x16')](_0x310989):_0x310989);logger[_0x0da3('0xe')](_0x0da3('0x17'),_0x145767);_0x423248['next']();}};};
\ No newline at end of file
index 130ca79..88514ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4746=['mustache','lodash','render','merge','body','contact','message','interaction','list'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4746,0xc6));var _0x6474=function(_0x86662c,_0x57ebb7){_0x86662c=_0x86662c-0x0;var _0x5be00e=_0x4746[_0x86662c];return _0x5be00e;};'use strict';var Mustache=require(_0x6474('0x0'));var _=require(_0x6474('0x1'));module['exports']={'getMustacheRender':function(_0x20751a,_0x59b95a){return Mustache[_0x6474('0x2')](_0x20751a,_[_0x6474('0x3')](_0x59b95a[_0x6474('0x4')],{'contact':_0x59b95a[_0x6474('0x5')],'message':_0x59b95a[_0x6474('0x6')],'account':_0x59b95a['account'],'interaction':_0x59b95a[_0x6474('0x7')],'list':_0x59b95a[_0x6474('0x8')]}))||'';}};
\ No newline at end of file
+var _0xd52a=['body','contact','message','account','lodash','render'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0xd52a,0xca));var _0xad52=function(_0x43c8ee,_0xe98237){_0x43c8ee=_0x43c8ee-0x0;var _0x2eac54=_0xd52a[_0x43c8ee];return _0x2eac54;};'use strict';var Mustache=require('mustache');var _=require(_0xad52('0x0'));module['exports']={'getMustacheRender':function(_0x14c488,_0x7b9789){return Mustache[_0xad52('0x1')](_0x14c488,_['merge'](_0x7b9789[_0xad52('0x2')],{'contact':_0x7b9789[_0xad52('0x3')],'message':_0x7b9789[_0xad52('0x4')],'account':_0x7b9789[_0xad52('0x5')],'interaction':_0x7b9789['interaction'],'list':_0x7b9789['list']}))||'';}};
\ No newline at end of file
index 2f57929..4bf4519 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2e5=['%s:%s:%s','condition','intervals','./applications/','consequence','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','info','Applications\x20executed','stringify','matchPath','emit','complete','stack','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','path','jayson/promise','bluebird','uuid','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','channel','message','interaction','applications','length','existsSync','join','app','toLowerCase','autoreply','appdata','push','dialogflow','split','slice'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb2e5,0x1d6));var _0x5b2e=function(_0x5e92c2,_0x184382){_0x5e92c2=_0x5e92c2-0x0;var _0xbc40b6=_0xb2e5[_0x5e92c2];return _0xbc40b6;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x5b2e('0x0'));var fs=require('fs');var jayson=require(_0x5b2e('0x1'));var BPromise=require(_0x5b2e('0x2'));var uuid=require(_0x5b2e('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x5b2e('0x4'));var rpc={'openchannelQueueReport':require(_0x5b2e('0x5')),'mailQueueReport':require(_0x5b2e('0x6')),'chatQueueReport':require(_0x5b2e('0x7')),'smsQueueReport':require(_0x5b2e('0x8')),'faxQueueReport':require(_0x5b2e('0x9')),'whatsappQueueReport':require(_0x5b2e('0xa'))};var RuleEngine=require(_0x5b2e('0xb'));function getId(_0x5a0903,_0x478436,_0x3346ff){return util['format'](_0x5b2e('0xc'),_0x5a0903,_0x478436||0x0,_0x3346ff||0x0);}function getIntervals(_0x5b6b6d,_0x2de981){var _0x15ea97=[];if(!_[_0x5b2e('0xd')](_0x2de981[_0x5b2e('0xe')])&&!_[_0x5b2e('0xd')](_0x5b6b6d[_0x2de981[_0x5b2e('0xe')]])&&!_[_0x5b2e('0xd')](_0x5b6b6d[_0x2de981['IntervalId']]['Intervals'])){_0x15ea97=_[_0x5b2e('0xf')](_0x5b6b6d[_0x2de981[_0x5b2e('0xe')]][_0x5b2e('0x10')],_0x5b2e('0x11'));}else if(!_[_0x5b2e('0xd')](_0x2de981[_0x5b2e('0x11')])){_0x15ea97=[_0x2de981['interval']];}return _0x15ea97;}exports[_0x5b2e('0x12')]=function(_0x5c16f5){_0x5c16f5['rules']={};return new BPromise(function(_0x4e3972,_0x681d18){var _0x43f741={'Start':function(_0x3746c2){var _0x54e9bd=this;return new Promise(function(_0x546c0e,_0x298932){if(_0x3746c2){try{var _0x4bffe9=[];var _0x1d187f=getId(_0x3746c2[_0x5b2e('0x13')],_0x3746c2['message']?_0x3746c2[_0x5b2e('0x14')]['id']:0x0,_0x3746c2['interaction']?_0x3746c2[_0x5b2e('0x15')]['id']:0x0);if(_0x3746c2['applications']&&_['isArray'](_0x3746c2[_0x5b2e('0x16')])&&_0x3746c2[_0x5b2e('0x16')][_0x5b2e('0x17')]){for(var _0xdcb561=0x0;_0xdcb561<_0x3746c2[_0x5b2e('0x16')][_0x5b2e('0x17')];_0xdcb561+=0x1){var _0x4aa197=_0x3746c2[_0x5b2e('0x16')][_0xdcb561];if(fs[_0x5b2e('0x18')](path[_0x5b2e('0x19')](__dirname,_0x5b2e('0x16'),_0x4aa197[_0x5b2e('0x1a')]+'.js'))){var _0x35ad73=[];switch(_0x4aa197[_0x5b2e('0x1a')][_0x5b2e('0x1b')]()){case _0x5b2e('0x1c'):var _0x3d118a=_0x4aa197[_0x5b2e('0x1d')]['split'](',');_0x35ad73[_0x5b2e('0x1e')](_0x3d118a[0x0]);_0x35ad73[_0x5b2e('0x1e')](_0x3d118a['slice'](0x1,_0x3d118a[_0x5b2e('0x17')])[_0x5b2e('0x19')](','));break;case _0x5b2e('0x1f'):var _0x19fc22=_0x4aa197[_0x5b2e('0x1d')][_0x5b2e('0x20')](',');_0x35ad73[_0x5b2e('0x1e')](_0x19fc22[0x0]);_0x35ad73[_0x5b2e('0x1e')](_0x19fc22[0x1]);_0x35ad73[_0x5b2e('0x1e')](_0x19fc22['slice'](0x2,_0x19fc22[_0x5b2e('0x17')])[_0x5b2e('0x19')](','));break;case'amazonlex':var _0x52393e=_0x4aa197[_0x5b2e('0x1d')][_0x5b2e('0x20')](',');_0x35ad73[_0x5b2e('0x1e')](_0x52393e[0x0]);_0x35ad73[_0x5b2e('0x1e')](_0x52393e[0x1]);_0x35ad73[_0x5b2e('0x1e')](_0x52393e[0x2]);_0x35ad73[_0x5b2e('0x1e')](_0x52393e[0x3]);_0x35ad73[_0x5b2e('0x1e')](_0x52393e[_0x5b2e('0x21')](0x4,_0x52393e[_0x5b2e('0x17')])[_0x5b2e('0x19')](','));break;case _0x5b2e('0x14'):_0x35ad73[_0x5b2e('0x1e')](_0x4aa197[_0x5b2e('0x1d')]);break;case'tag':_0x35ad73['push'](_0x4aa197['TagId']);_0x35ad73[_0x5b2e('0x1e')](_0x4aa197[_0x5b2e('0x1d')]);break;default:_0x35ad73=_[_0x5b2e('0xd')](_0x4aa197[_0x5b2e('0x1d')])?[]:_0x4aa197[_0x5b2e('0x1d')]['split'](',');}var _0x18ec09={'id':util['format'](_0x5b2e('0x22'),_0x1d187f,_0x4aa197['id'],_0x4aa197[_0x5b2e('0x1a')]),'condition':require('./interval')[_0x5b2e('0x23')](_0x1d187f,getIntervals(_0x5c16f5[_0x5b2e('0x24')],_0x4aa197),_0x5c16f5),'consequence':require(_0x5b2e('0x25')+_0x4aa197['app'])[_0x5b2e('0x26')](_0x1d187f,_0x35ad73,_0x5c16f5,_0x3746c2),'p':_0x4aa197['priority']||0x0};logger['info'](_0x5b2e('0x27'),_0x18ec09['id'],_0x5b2e('0x28'),getIntervals(_0x5c16f5[_0x5b2e('0x24')],_0x4aa197)[_0x5b2e('0x19')]('\x20|\x20'));_0x4bffe9['push'](_0x18ec09);}else{logger[_0x5b2e('0x29')](_0x5b2e('0x2a'),path[_0x5b2e('0x19')](__dirname,_0x5b2e('0x16'),_0x4aa197[_0x5b2e('0x1a')]+'.js'));}}_0x5c16f5['rules'][_0x1d187f]=new RuleEngine(_0x4bffe9);_0x5c16f5[_0x5b2e('0x2b')][_0x1d187f][_0x5b2e('0x2c')](_0x3746c2,function(_0x1f2cd7){logger[_0x5b2e('0x2d')](_0x5b2e('0x2e'),JSON[_0x5b2e('0x2f')](_0x1f2cd7[_0x5b2e('0x30')]));if(_0x5c16f5['rules'][_0x1d187f]){_0x5c16f5[_0x5b2e('0x2b')][_0x1d187f][_0x5b2e('0x31')](_0x5b2e('0x32'));}});return _0x546c0e({'code':0xc8,'message':_0x3746c2});}else{logger[_0x5b2e('0x2d')]('No\x20applications\x20to\x20execute');return _0x546c0e({'code':0xc8,'message':_0x3746c2});}}catch(_0x4a97f7){logger[_0x5b2e('0x29')](_0x4a97f7[_0x5b2e('0x33')]);return _0x298932(_0x54e9bd[_0x5b2e('0x29')](0x1f4,_0x4a97f7));}}return _0x298932('routing\x20is\x20empty');});},'AcceptMessage':function(_0x132d39){var _0x4b2907=this;return new Promise(function(_0xf92062,_0x740436){if(_0x132d39[_0x5b2e('0x14')]&&_0x132d39[_0x5b2e('0x14')]['id']){try{var _0x11d1b8=getId(_0x132d39[_0x5b2e('0x13')],_0x132d39['message']?_0x132d39[_0x5b2e('0x14')]['id']:0x0,_0x132d39['interaction']?_0x132d39[_0x5b2e('0x15')]['id']:0x0);if(_0x5c16f5[_0x5b2e('0x2b')][_0x11d1b8]){_0x5c16f5[_0x5b2e('0x2b')][_0x11d1b8][_0x5b2e('0x31')]('end');if(rpc[_0x132d39[_0x5b2e('0x13')]+_0x5b2e('0x34')]){rpc[_0x132d39['channel']+_0x5b2e('0x34')]['update'](_0x11d1b8,{'UserId':_0x132d39['message'][_0x5b2e('0x35')]})['catch'](function(_0x1c88cc){logger[_0x5b2e('0x29')](_0x5b2e('0x36'));});}}return _0xf92062({'code':0xc8,'message':_0x132d39});}catch(_0x2f84b0){logger['error'](_0x2f84b0[_0x5b2e('0x33')]);return _0x740436(_0x4b2907[_0x5b2e('0x29')](0x1f4,_0x2f84b0));}}logger['error'](_0x5b2e('0x37'));return _0x740436(_0x4b2907[_0x5b2e('0x29')](0x1f4,_0x5b2e('0x37')));});},'RejectMessage':function(_0x2069c5){var _0x3ed9a2=this;return new Promise(function(_0x53fdb9,_0x979994){if(_0x2069c5[_0x5b2e('0x38')]&&_0x2069c5['agent']['id']){try{if(_0x5c16f5['agents'][_0x2069c5[_0x5b2e('0x38')]['id']]){_0x5c16f5[_0x5b2e('0x39')][_0x2069c5[_0x5b2e('0x38')]['id']]['busy']=![];_0x5c16f5[_0x5b2e('0x39')][_0x2069c5[_0x5b2e('0x38')]['id']]['busyQueue']=undefined;}return _0x53fdb9({'code':0xc8,'message':_0x2069c5});}catch(_0x2fa95e){logger[_0x5b2e('0x29')](_0x2fa95e[_0x5b2e('0x33')]);return _0x979994(_0x3ed9a2[_0x5b2e('0x29')](0x1f4,_0x2fa95e));}}logger[_0x5b2e('0x29')](_0x5b2e('0x37'));return _0x979994(_0x3ed9a2[_0x5b2e('0x29')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x46707f){var _0x3a4527=this;return new Promise(function(_0x1863ef,_0xaea4ba){if(_0x46707f[_0x5b2e('0x13')]&&_0x46707f[_0x5b2e('0x15')]&&_0x46707f[_0x5b2e('0x15')]['id']){try{var _0x1897b3=getId(_0x46707f[_0x5b2e('0x13')],_0x46707f['message']?_0x46707f[_0x5b2e('0x14')]['id']:0x0,_0x46707f['interaction']?_0x46707f[_0x5b2e('0x15')]['id']:0x0);if(_0x5c16f5[_0x5b2e('0x2b')][_0x1897b3]){_0x5c16f5[_0x5b2e('0x2b')][_0x1897b3][_0x5b2e('0x31')](_0x5b2e('0x3a'));}return _0x1863ef({'code':0xc8,'message':_0x46707f});}catch(_0x566fce){logger[_0x5b2e('0x29')](_0x566fce[_0x5b2e('0x33')]);return _0xaea4ba(_0x3a4527[_0x5b2e('0x29')](0x1f4,_0x566fce));}}logger['error'](_0x5b2e('0x37'));return _0xaea4ba(_0x3a4527[_0x5b2e('0x29')](0x1f4,_0x5b2e('0x37')));});},'AgentCapacity':function(_0x295477){var _0x4ee8f8=this;return new Promise(function(_0x2fbeaf,_0x33f373){if(_0x5c16f5['agents']['hasOwnProperty'](_0x295477['id'])){for(var _0x983fb4 in _0x295477['capacity']){if(_0x295477[_0x5b2e('0x3b')][_0x5b2e('0x3c')](_0x983fb4)){if(_0x5c16f5[_0x5b2e('0x39')][_0x295477['id']][_0x5b2e('0x3c')](_0x983fb4+_0x5b2e('0x3d'))){_0x5c16f5[_0x5b2e('0x39')][_0x295477['id']][_0x983fb4+_0x5b2e('0x3d')]=parseInt(_0x295477[_0x5b2e('0x3b')][_0x983fb4],0xa);}}}_0x5c16f5['agents'][_0x295477['id']][_0x5b2e('0x3e')]();return _0x2fbeaf({'code':0xc8,'message':_0x5c16f5[_0x5b2e('0x39')][_0x295477['id']]});}else{return _0x33f373(_0x4ee8f8['error'](0x1f4,_0x5b2e('0x3f')));}});},'Agents':function(_0x355626){return new Promise(function(_0x5df645,_0x4abc87){var _0x39a797=_['values'](_0x5c16f5[_0x5b2e('0x39')]);_0x5df645({'count':_0x39a797[_0x5b2e('0x17')],'rows':_0x39a797});});},'ChatQueues':function(_0x13f15b){return new Promise(function(_0x126ce2,_0x18268c){var _0x3111c3=[];for(var _0x23a66e in _0x5c16f5[_0x5b2e('0x40')]){if(_0x5c16f5[_0x5b2e('0x40')][_0x5b2e('0x3c')](_0x23a66e)){var _0xcb3f6f=_0x5c16f5[_0x5b2e('0x40')][_0x23a66e];var _0x85407={'id':_0xcb3f6f['id'],'available':_0xcb3f6f[_0x5b2e('0x41')],'loggedIn':_0xcb3f6f[_0x5b2e('0x42')],'name':_0xcb3f6f[_0x5b2e('0x43')],'paused':_0xcb3f6f[_0x5b2e('0x44')],'waiting':_0xcb3f6f[_0x5b2e('0x45')]};_0x3111c3[_0x5b2e('0x1e')](_0x85407);}}_0x126ce2({'count':_0x3111c3['length'],'rows':_0x3111c3});});},'MailQueues':function(_0x25d83a){return new Promise(function(_0x76d8f5,_0x456cd4){var _0x1979ba=[];for(var _0x5df9bc in _0x5c16f5[_0x5b2e('0x46')]){if(_0x5c16f5[_0x5b2e('0x46')][_0x5b2e('0x3c')](_0x5df9bc)){var _0x1b8ba4=_0x5c16f5[_0x5b2e('0x46')][_0x5df9bc];var _0x4a6c63={'id':_0x1b8ba4['id'],'available':_0x1b8ba4[_0x5b2e('0x41')],'loggedIn':_0x1b8ba4['loggedIn'],'name':_0x1b8ba4[_0x5b2e('0x43')],'paused':_0x1b8ba4[_0x5b2e('0x44')],'waiting':_0x1b8ba4['waiting']};_0x1979ba[_0x5b2e('0x1e')](_0x4a6c63);}}_0x76d8f5({'count':_0x1979ba[_0x5b2e('0x17')],'rows':_0x1979ba});});},'OpenchannelQueues':function(_0x12856b){return new Promise(function(_0x49d042,_0x84c654){var _0xe8e3fd=[];for(var _0x30fce1 in _0x5c16f5[_0x5b2e('0x47')]){if(_0x5c16f5[_0x5b2e('0x47')]['hasOwnProperty'](_0x30fce1)){var _0x203c09=_0x5c16f5[_0x5b2e('0x47')][_0x30fce1];var _0x4d593b={'id':_0x203c09['id'],'available':_0x203c09[_0x5b2e('0x41')],'loggedIn':_0x203c09[_0x5b2e('0x42')],'name':_0x203c09[_0x5b2e('0x43')],'paused':_0x203c09['paused'],'waiting':_0x203c09['waiting']};_0xe8e3fd[_0x5b2e('0x1e')](_0x4d593b);}}_0x49d042({'count':_0xe8e3fd['length'],'rows':_0xe8e3fd});});},'SmsQueues':function(_0x43cf5){return new Promise(function(_0x51db7f,_0x486753){var _0x23bcb3=[];for(var _0x2d102b in _0x5c16f5['smsQueues']){if(_0x5c16f5[_0x5b2e('0x48')][_0x5b2e('0x3c')](_0x2d102b)){var _0x4c9a6d=_0x5c16f5[_0x5b2e('0x48')][_0x2d102b];var _0x3360ba={'id':_0x4c9a6d['id'],'available':_0x4c9a6d[_0x5b2e('0x41')],'loggedIn':_0x4c9a6d[_0x5b2e('0x42')],'name':_0x4c9a6d[_0x5b2e('0x43')],'paused':_0x4c9a6d[_0x5b2e('0x44')],'waiting':_0x4c9a6d[_0x5b2e('0x45')]};_0x23bcb3[_0x5b2e('0x1e')](_0x3360ba);}}_0x51db7f({'count':_0x23bcb3[_0x5b2e('0x17')],'rows':_0x23bcb3});});},'FaxQueues':function(_0x59469b){return new Promise(function(_0x1de755,_0x3afcf7){var _0x16507e=[];for(var _0x2b6927 in _0x5c16f5[_0x5b2e('0x49')]){if(_0x5c16f5['faxQueues'][_0x5b2e('0x3c')](_0x2b6927)){var _0x2d4df3=_0x5c16f5[_0x5b2e('0x49')][_0x2b6927];var _0x1a85c1={'id':_0x2d4df3['id'],'available':_0x2d4df3[_0x5b2e('0x41')],'loggedIn':_0x2d4df3['loggedIn'],'name':_0x2d4df3['name'],'paused':_0x2d4df3[_0x5b2e('0x44')],'waiting':_0x2d4df3['waiting']};_0x16507e[_0x5b2e('0x1e')](_0x1a85c1);}}_0x1de755({'count':_0x16507e['length'],'rows':_0x16507e});});},'WhatsappQueues':function(_0x34610d){return new Promise(function(_0x2a3278,_0xf272eb){var _0x58b3dc=[];for(var _0x8b50e9 in _0x5c16f5[_0x5b2e('0x4a')]){if(_0x5c16f5['whatsappQueues']['hasOwnProperty'](_0x8b50e9)){var _0xaf0ac3=_0x5c16f5[_0x5b2e('0x4a')][_0x8b50e9];var _0x298f57={'id':_0xaf0ac3['id'],'available':_0xaf0ac3[_0x5b2e('0x41')],'loggedIn':_0xaf0ac3[_0x5b2e('0x42')],'name':_0xaf0ac3[_0x5b2e('0x43')],'paused':_0xaf0ac3['paused'],'waiting':_0xaf0ac3[_0x5b2e('0x45')]};_0x58b3dc[_0x5b2e('0x1e')](_0x298f57);}}_0x2a3278({'count':_0x58b3dc['length'],'rows':_0x58b3dc});});},'ChatQueuesWaitingInteractions':function(_0x208257){return new Promise(function(_0x1b03c8,_0x155c58){var _0x5bbc7b=_[_0x5b2e('0x4b')](_0x5c16f5[_0x5b2e('0x4c')]);_0x1b03c8({'count':_0x5bbc7b[_0x5b2e('0x17')],'rows':_0x5bbc7b});});},'MailQueuesWaitingInteractions':function(_0x37d0de){return new Promise(function(_0x3c42ae,_0x1cfc94){var _0x223ffc=_[_0x5b2e('0x4b')](_0x5c16f5['mailQueuesWaitingInteractions']);_0x3c42ae({'count':_0x223ffc['length'],'rows':_0x223ffc});});},'OpenchannelQueuesWaitingInteractions':function(_0x5bacf4){return new Promise(function(_0x179ec6,_0x1f24d0){var _0x19c79a=_[_0x5b2e('0x4b')](_0x5c16f5[_0x5b2e('0x4d')]);_0x179ec6({'count':_0x19c79a[_0x5b2e('0x17')],'rows':_0x19c79a});});},'SmsQueuesWaitingInteractions':function(_0x152faf){return new Promise(function(_0x394385,_0x1c8977){var _0x427624=_[_0x5b2e('0x4b')](_0x5c16f5[_0x5b2e('0x4e')]);_0x394385({'count':_0x427624[_0x5b2e('0x17')],'rows':_0x427624});});},'FaxQueuesWaitingInteractions':function(_0x204531){return new Promise(function(_0x728e44,_0xdf69ea){var _0x4fa4c3=_[_0x5b2e('0x4b')](_0x5c16f5[_0x5b2e('0x4f')]);_0x728e44({'count':_0x4fa4c3['length'],'rows':_0x4fa4c3});});},'WhatsappQueuesWaitingInteractions':function(_0x2ccc94){return new Promise(function(_0x33d41f,_0x8ddf1b){var _0x1e25e5=_['values'](_0x5c16f5[_0x5b2e('0x50')]);_0x33d41f({'count':_0x1e25e5[_0x5b2e('0x17')],'rows':_0x1e25e5});});}};var _0x3f525f=jayson[_0x5b2e('0x51')](_0x43f741)['http']();_0x3f525f['on'](_0x5b2e('0x29'),function(_0x4ac4f4){logger[_0x5b2e('0x29')](JSON[_0x5b2e('0x2f')](_0x4ac4f4));return _0x681d18(_0x4ac4f4);});_0x3f525f['listen'](0x232c,'127.0.0.1',function(){console[_0x5b2e('0x52')](_0x5b2e('0x53'),0x232c);return _0x4e3972('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
+var _0x02ed=['condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','emit','No\x20applications\x20to\x20execute','stack','end','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agents','agent','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','path','jayson/promise','bluebird','../../../config/environment','../../../config/logger','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','IntervalId','isNil','map','Intervals','interval','listen','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','amazonlex','tag','TagId','./interval'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x02ed,0x1ea));var _0xd02e=function(_0x23724f,_0x19e182){_0x23724f=_0x23724f-0x0;var _0x17c793=_0x02ed[_0x23724f];return _0x17c793;};'use strict';var _=require(_0xd02e('0x0'));var util=require('util');var path=require(_0xd02e('0x1'));var fs=require('fs');var jayson=require(_0xd02e('0x2'));var BPromise=require(_0xd02e('0x3'));var uuid=require('uuid');var config=require(_0xd02e('0x4'));var logger=require(_0xd02e('0x5'))('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xd02e('0x6')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xd02e('0x7')),'whatsappQueueReport':require(_0xd02e('0x8'))};var RuleEngine=require(_0xd02e('0x9'));function getId(_0x5f2dab,_0x229220,_0x54be7c){return util['format'](_0xd02e('0xa'),_0x5f2dab,_0x229220||0x0,_0x54be7c||0x0);}function getIntervals(_0x534f17,_0x208494){var _0x52cc78=[];if(!_['isNil'](_0x208494[_0xd02e('0xb')])&&!_[_0xd02e('0xc')](_0x534f17[_0x208494[_0xd02e('0xb')]])&&!_[_0xd02e('0xc')](_0x534f17[_0x208494[_0xd02e('0xb')]]['Intervals'])){_0x52cc78=_[_0xd02e('0xd')](_0x534f17[_0x208494['IntervalId']][_0xd02e('0xe')],_0xd02e('0xf'));}else if(!_[_0xd02e('0xc')](_0x208494[_0xd02e('0xf')])){_0x52cc78=[_0x208494[_0xd02e('0xf')]];}return _0x52cc78;}exports[_0xd02e('0x10')]=function(_0x2f1c46){_0x2f1c46['rules']={};return new BPromise(function(_0xd99721,_0x459ec3){var _0x323c54={'Start':function(_0x10eb7e){var _0x4c598d=this;return new Promise(function(_0x36003f,_0x13e511){if(_0x10eb7e){try{var _0x3d0fd7=[];var _0x2ce452=getId(_0x10eb7e[_0xd02e('0x11')],_0x10eb7e[_0xd02e('0x12')]?_0x10eb7e['message']['id']:0x0,_0x10eb7e[_0xd02e('0x13')]?_0x10eb7e['interaction']['id']:0x0);if(_0x10eb7e[_0xd02e('0x14')]&&_[_0xd02e('0x15')](_0x10eb7e['applications'])&&_0x10eb7e[_0xd02e('0x14')]['length']){for(var _0x2f3a92=0x0;_0x2f3a92<_0x10eb7e[_0xd02e('0x14')][_0xd02e('0x16')];_0x2f3a92+=0x1){var _0x3d8ec1=_0x10eb7e[_0xd02e('0x14')][_0x2f3a92];if(fs[_0xd02e('0x17')](path[_0xd02e('0x18')](__dirname,_0xd02e('0x14'),_0x3d8ec1[_0xd02e('0x19')]+_0xd02e('0x1a')))){var _0x4bc607=[];switch(_0x3d8ec1['app'][_0xd02e('0x1b')]()){case _0xd02e('0x1c'):var _0x83c509=_0x3d8ec1[_0xd02e('0x1d')][_0xd02e('0x1e')](',');_0x4bc607[_0xd02e('0x1f')](_0x83c509[0x0]);_0x4bc607[_0xd02e('0x1f')](_0x83c509[_0xd02e('0x20')](0x1,_0x83c509[_0xd02e('0x16')])[_0xd02e('0x18')](','));break;case _0xd02e('0x21'):var _0x3d644d=_0x3d8ec1[_0xd02e('0x1d')][_0xd02e('0x1e')](',');_0x4bc607[_0xd02e('0x1f')](_0x3d644d[0x0]);_0x4bc607[_0xd02e('0x1f')](_0x3d644d[0x1]);_0x4bc607[_0xd02e('0x1f')](_0x3d644d[_0xd02e('0x20')](0x2,_0x3d644d['length'])[_0xd02e('0x18')](','));break;case _0xd02e('0x22'):var _0x59ce57=_0x3d8ec1['appdata'][_0xd02e('0x1e')](',');_0x4bc607['push'](_0x59ce57[0x0]);_0x4bc607[_0xd02e('0x1f')](_0x59ce57[0x1]);_0x4bc607[_0xd02e('0x1f')](_0x59ce57[0x2]);_0x4bc607[_0xd02e('0x1f')](_0x59ce57[0x3]);_0x4bc607[_0xd02e('0x1f')](_0x59ce57[_0xd02e('0x20')](0x4,_0x59ce57[_0xd02e('0x16')])[_0xd02e('0x18')](','));break;case'message':_0x4bc607[_0xd02e('0x1f')](_0x3d8ec1[_0xd02e('0x1d')]);break;case _0xd02e('0x23'):_0x4bc607[_0xd02e('0x1f')](_0x3d8ec1[_0xd02e('0x24')]);_0x4bc607[_0xd02e('0x1f')](_0x3d8ec1[_0xd02e('0x1d')]);break;default:_0x4bc607=_[_0xd02e('0xc')](_0x3d8ec1['appdata'])?[]:_0x3d8ec1[_0xd02e('0x1d')][_0xd02e('0x1e')](',');}var _0x2fc138={'id':util['format']('%s:%s:%s',_0x2ce452,_0x3d8ec1['id'],_0x3d8ec1['app']),'condition':require(_0xd02e('0x25'))[_0xd02e('0x26')](_0x2ce452,getIntervals(_0x2f1c46[_0xd02e('0x27')],_0x3d8ec1),_0x2f1c46),'consequence':require('./applications/'+_0x3d8ec1['app'])[_0xd02e('0x28')](_0x2ce452,_0x4bc607,_0x2f1c46,_0x10eb7e),'p':_0x3d8ec1[_0xd02e('0x29')]||0x0};logger[_0xd02e('0x2a')](_0xd02e('0x2b'),_0x2fc138['id'],_0xd02e('0x2c'),getIntervals(_0x2f1c46['intervals'],_0x3d8ec1)[_0xd02e('0x18')](_0xd02e('0x2d')));_0x3d0fd7['push'](_0x2fc138);}else{logger[_0xd02e('0x2e')](_0xd02e('0x2f'),path[_0xd02e('0x18')](__dirname,_0xd02e('0x14'),_0x3d8ec1[_0xd02e('0x19')]+'.js'));}}_0x2f1c46[_0xd02e('0x30')][_0x2ce452]=new RuleEngine(_0x3d0fd7);_0x2f1c46['rules'][_0x2ce452][_0xd02e('0x31')](_0x10eb7e,function(_0x5ddbe1){logger['info'](_0xd02e('0x32'),JSON['stringify'](_0x5ddbe1['matchPath']));if(_0x2f1c46['rules'][_0x2ce452]){_0x2f1c46['rules'][_0x2ce452][_0xd02e('0x33')]('complete');}});return _0x36003f({'code':0xc8,'message':_0x10eb7e});}else{logger[_0xd02e('0x2a')](_0xd02e('0x34'));return _0x36003f({'code':0xc8,'message':_0x10eb7e});}}catch(_0x1c29cf){logger[_0xd02e('0x2e')](_0x1c29cf[_0xd02e('0x35')]);return _0x13e511(_0x4c598d[_0xd02e('0x2e')](0x1f4,_0x1c29cf));}}return _0x13e511('routing\x20is\x20empty');});},'AcceptMessage':function(_0x4f8e7a){var _0x48b439=this;return new Promise(function(_0x2a0f1c,_0x3a5e79){if(_0x4f8e7a['message']&&_0x4f8e7a[_0xd02e('0x12')]['id']){try{var _0x44d131=getId(_0x4f8e7a[_0xd02e('0x11')],_0x4f8e7a['message']?_0x4f8e7a[_0xd02e('0x12')]['id']:0x0,_0x4f8e7a[_0xd02e('0x13')]?_0x4f8e7a[_0xd02e('0x13')]['id']:0x0);if(_0x2f1c46[_0xd02e('0x30')][_0x44d131]){_0x2f1c46['rules'][_0x44d131]['emit'](_0xd02e('0x36'));if(rpc[_0x4f8e7a['channel']+'QueueReport']){rpc[_0x4f8e7a[_0xd02e('0x11')]+'QueueReport'][_0xd02e('0x37')](_0x44d131,{'UserId':_0x4f8e7a[_0xd02e('0x12')][_0xd02e('0x38')]})[_0xd02e('0x39')](function(_0x4f5a76){logger[_0xd02e('0x2e')](_0xd02e('0x3a'));});}}return _0x2a0f1c({'code':0xc8,'message':_0x4f8e7a});}catch(_0x45a741){logger[_0xd02e('0x2e')](_0x45a741[_0xd02e('0x35')]);return _0x3a5e79(_0x48b439[_0xd02e('0x2e')](0x1f4,_0x45a741));}}logger[_0xd02e('0x2e')]('message\x20is\x20empty');return _0x3a5e79(_0x48b439['error'](0x1f4,_0xd02e('0x3b')));});},'RejectMessage':function(_0x290115){var _0x2040c8=this;return new Promise(function(_0x4286d6,_0x3dda19){if(_0x290115['agent']&&_0x290115['agent']['id']){try{if(_0x2f1c46[_0xd02e('0x3c')][_0x290115[_0xd02e('0x3d')]['id']]){_0x2f1c46[_0xd02e('0x3c')][_0x290115[_0xd02e('0x3d')]['id']]['busy']=![];_0x2f1c46['agents'][_0x290115[_0xd02e('0x3d')]['id']]['busyQueue']=undefined;}return _0x4286d6({'code':0xc8,'message':_0x290115});}catch(_0x8bc5e6){logger[_0xd02e('0x2e')](_0x8bc5e6['stack']);return _0x3dda19(_0x2040c8[_0xd02e('0x2e')](0x1f4,_0x8bc5e6));}}logger[_0xd02e('0x2e')](_0xd02e('0x3b'));return _0x3dda19(_0x2040c8[_0xd02e('0x2e')](0x1f4,_0xd02e('0x3b')));});},'AbandonInteraction':function(_0xd38c33){var _0xbb02e2=this;return new Promise(function(_0x3b45dd,_0x5739c4){if(_0xd38c33['channel']&&_0xd38c33['interaction']&&_0xd38c33[_0xd02e('0x13')]['id']){try{var _0x178b06=getId(_0xd38c33[_0xd02e('0x11')],_0xd38c33[_0xd02e('0x12')]?_0xd38c33[_0xd02e('0x12')]['id']:0x0,_0xd38c33[_0xd02e('0x13')]?_0xd38c33[_0xd02e('0x13')]['id']:0x0);if(_0x2f1c46[_0xd02e('0x30')][_0x178b06]){_0x2f1c46[_0xd02e('0x30')][_0x178b06]['emit'](_0xd02e('0x36'));}return _0x3b45dd({'code':0xc8,'message':_0xd38c33});}catch(_0x1f1585){logger[_0xd02e('0x2e')](_0x1f1585['stack']);return _0x5739c4(_0xbb02e2['error'](0x1f4,_0x1f1585));}}logger[_0xd02e('0x2e')](_0xd02e('0x3b'));return _0x5739c4(_0xbb02e2[_0xd02e('0x2e')](0x1f4,_0xd02e('0x3b')));});},'AgentCapacity':function(_0x4e33e0){var _0x2307ef=this;return new Promise(function(_0x3036c5,_0x37def6){if(_0x2f1c46[_0xd02e('0x3c')][_0xd02e('0x3e')](_0x4e33e0['id'])){for(var _0x31197a in _0x4e33e0['capacity']){if(_0x4e33e0[_0xd02e('0x3f')][_0xd02e('0x3e')](_0x31197a)){if(_0x2f1c46[_0xd02e('0x3c')][_0x4e33e0['id']][_0xd02e('0x3e')](_0x31197a+_0xd02e('0x40'))){_0x2f1c46[_0xd02e('0x3c')][_0x4e33e0['id']][_0x31197a+_0xd02e('0x40')]=parseInt(_0x4e33e0['capacity'][_0x31197a],0xa);}}}_0x2f1c46['agents'][_0x4e33e0['id']][_0xd02e('0x41')]();return _0x3036c5({'code':0xc8,'message':_0x2f1c46[_0xd02e('0x3c')][_0x4e33e0['id']]});}else{return _0x37def6(_0x2307ef[_0xd02e('0x2e')](0x1f4,_0xd02e('0x42')));}});},'Agents':function(_0x33719d){return new Promise(function(_0xff6ac1,_0x29e465){var _0xe38c47=_[_0xd02e('0x43')](_0x2f1c46[_0xd02e('0x3c')]);_0xff6ac1({'count':_0xe38c47[_0xd02e('0x16')],'rows':_0xe38c47});});},'ChatQueues':function(_0xd04a74){return new Promise(function(_0x910faf,_0x5710d1){var _0x233ea2=[];for(var _0x14087f in _0x2f1c46[_0xd02e('0x44')]){if(_0x2f1c46[_0xd02e('0x44')][_0xd02e('0x3e')](_0x14087f)){var _0x10a0e4=_0x2f1c46[_0xd02e('0x44')][_0x14087f];var _0x5a6957={'id':_0x10a0e4['id'],'available':_0x10a0e4[_0xd02e('0x45')],'loggedIn':_0x10a0e4[_0xd02e('0x46')],'name':_0x10a0e4[_0xd02e('0x47')],'paused':_0x10a0e4[_0xd02e('0x48')],'waiting':_0x10a0e4['waiting']};_0x233ea2[_0xd02e('0x1f')](_0x5a6957);}}_0x910faf({'count':_0x233ea2['length'],'rows':_0x233ea2});});},'MailQueues':function(_0x57f3){return new Promise(function(_0x3dedc5,_0x40db2e){var _0x17ab70=[];for(var _0x18fcd7 in _0x2f1c46['mailQueues']){if(_0x2f1c46[_0xd02e('0x49')]['hasOwnProperty'](_0x18fcd7)){var _0x76c9ae=_0x2f1c46[_0xd02e('0x49')][_0x18fcd7];var _0x4ec961={'id':_0x76c9ae['id'],'available':_0x76c9ae[_0xd02e('0x45')],'loggedIn':_0x76c9ae['loggedIn'],'name':_0x76c9ae['name'],'paused':_0x76c9ae['paused'],'waiting':_0x76c9ae[_0xd02e('0x4a')]};_0x17ab70['push'](_0x4ec961);}}_0x3dedc5({'count':_0x17ab70[_0xd02e('0x16')],'rows':_0x17ab70});});},'OpenchannelQueues':function(_0x6eaf78){return new Promise(function(_0x414ad3,_0x50ba04){var _0x31a686=[];for(var _0xa3cfbf in _0x2f1c46[_0xd02e('0x4b')]){if(_0x2f1c46[_0xd02e('0x4b')][_0xd02e('0x3e')](_0xa3cfbf)){var _0x41c41e=_0x2f1c46['openchannelQueues'][_0xa3cfbf];var _0x23dcbd={'id':_0x41c41e['id'],'available':_0x41c41e[_0xd02e('0x45')],'loggedIn':_0x41c41e[_0xd02e('0x46')],'name':_0x41c41e['name'],'paused':_0x41c41e[_0xd02e('0x48')],'waiting':_0x41c41e['waiting']};_0x31a686['push'](_0x23dcbd);}}_0x414ad3({'count':_0x31a686[_0xd02e('0x16')],'rows':_0x31a686});});},'SmsQueues':function(_0x489bab){return new Promise(function(_0x5702c4,_0x381b63){var _0x5d15c5=[];for(var _0x2ef4fb in _0x2f1c46[_0xd02e('0x4c')]){if(_0x2f1c46['smsQueues']['hasOwnProperty'](_0x2ef4fb)){var _0x5cdfa1=_0x2f1c46[_0xd02e('0x4c')][_0x2ef4fb];var _0x4688c={'id':_0x5cdfa1['id'],'available':_0x5cdfa1[_0xd02e('0x45')],'loggedIn':_0x5cdfa1['loggedIn'],'name':_0x5cdfa1[_0xd02e('0x47')],'paused':_0x5cdfa1['paused'],'waiting':_0x5cdfa1['waiting']};_0x5d15c5[_0xd02e('0x1f')](_0x4688c);}}_0x5702c4({'count':_0x5d15c5[_0xd02e('0x16')],'rows':_0x5d15c5});});},'FaxQueues':function(_0x24d11b){return new Promise(function(_0x4a6db2,_0x3da292){var _0x1ac67a=[];for(var _0xccf833 in _0x2f1c46[_0xd02e('0x4d')]){if(_0x2f1c46[_0xd02e('0x4d')][_0xd02e('0x3e')](_0xccf833)){var _0x1932e6=_0x2f1c46['faxQueues'][_0xccf833];var _0x3959a8={'id':_0x1932e6['id'],'available':_0x1932e6[_0xd02e('0x45')],'loggedIn':_0x1932e6[_0xd02e('0x46')],'name':_0x1932e6['name'],'paused':_0x1932e6[_0xd02e('0x48')],'waiting':_0x1932e6[_0xd02e('0x4a')]};_0x1ac67a[_0xd02e('0x1f')](_0x3959a8);}}_0x4a6db2({'count':_0x1ac67a['length'],'rows':_0x1ac67a});});},'WhatsappQueues':function(_0x53b8f1){return new Promise(function(_0x2634dd,_0x48d082){var _0x1c1928=[];for(var _0x4cfa5e in _0x2f1c46[_0xd02e('0x4e')]){if(_0x2f1c46[_0xd02e('0x4e')][_0xd02e('0x3e')](_0x4cfa5e)){var _0x36210a=_0x2f1c46[_0xd02e('0x4e')][_0x4cfa5e];var _0x30a941={'id':_0x36210a['id'],'available':_0x36210a['available'],'loggedIn':_0x36210a[_0xd02e('0x46')],'name':_0x36210a['name'],'paused':_0x36210a['paused'],'waiting':_0x36210a[_0xd02e('0x4a')]};_0x1c1928[_0xd02e('0x1f')](_0x30a941);}}_0x2634dd({'count':_0x1c1928[_0xd02e('0x16')],'rows':_0x1c1928});});},'ChatQueuesWaitingInteractions':function(_0x30bf5f){return new Promise(function(_0x17f418,_0x1882b9){var _0x496e83=_[_0xd02e('0x43')](_0x2f1c46[_0xd02e('0x4f')]);_0x17f418({'count':_0x496e83[_0xd02e('0x16')],'rows':_0x496e83});});},'MailQueuesWaitingInteractions':function(_0x1f527c){return new Promise(function(_0x40eeb4,_0x1b0ce0){var _0x428448=_[_0xd02e('0x43')](_0x2f1c46['mailQueuesWaitingInteractions']);_0x40eeb4({'count':_0x428448[_0xd02e('0x16')],'rows':_0x428448});});},'OpenchannelQueuesWaitingInteractions':function(_0x3a9f5a){return new Promise(function(_0x663240,_0x91a6e5){var _0x1ad387=_[_0xd02e('0x43')](_0x2f1c46[_0xd02e('0x50')]);_0x663240({'count':_0x1ad387['length'],'rows':_0x1ad387});});},'SmsQueuesWaitingInteractions':function(_0x2a9940){return new Promise(function(_0x23c4dd,_0x2f38a2){var _0x114fb9=_['values'](_0x2f1c46[_0xd02e('0x51')]);_0x23c4dd({'count':_0x114fb9[_0xd02e('0x16')],'rows':_0x114fb9});});},'FaxQueuesWaitingInteractions':function(_0xdffeb8){return new Promise(function(_0x4026d7,_0x208fe4){var _0x350e3d=_[_0xd02e('0x43')](_0x2f1c46['faxQueuesWaitingInteractions']);_0x4026d7({'count':_0x350e3d[_0xd02e('0x16')],'rows':_0x350e3d});});},'WhatsappQueuesWaitingInteractions':function(_0x29b552){return new Promise(function(_0x1d4b1f,_0x4fc6a4){var _0x2ae3f4=_[_0xd02e('0x43')](_0x2f1c46[_0xd02e('0x52')]);_0x1d4b1f({'count':_0x2ae3f4['length'],'rows':_0x2ae3f4});});}};var _0x186fec=jayson[_0xd02e('0x53')](_0x323c54)[_0xd02e('0x54')]();_0x186fec['on'](_0xd02e('0x2e'),function(_0x2f0e59){logger['error'](JSON['stringify'](_0x2f0e59));return _0x459ec3(_0x2f0e59);});_0x186fec['listen'](0x232c,_0xd02e('0x55'),function(){console[_0xd02e('0x56')](_0xd02e('0x57'),0x232c);return _0xd99721('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
index 048aa75..25d3aac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc2=['[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','lodash','../../../config/logger','routing','client','http','request','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','then','true'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xafc2,0x1bb));var _0x2afc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xafc2[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x2afc('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require(_0x2afc('0x1'));var logger=require(_0x2afc('0x2'))(_0x2afc('0x3'));var client=jayson[_0x2afc('0x4')][_0x2afc('0x5')]({'port':0x232a});function request(_0x1ef028,_0x164718){return new BPromise(function(_0x1a343e,_0x1a1a61){return client[_0x2afc('0x6')](_0x1ef028,_0x164718)['then'](function(_0xd9ccaa){if(_0xd9ccaa['error']){return _0x1a1a61(_0xd9ccaa['error'][_0x2afc('0x7')]);}else{return _0x1a343e(_0xd9ccaa[_0x2afc('0x8')]);}})[_0x2afc('0x9')](function(_0xd04ec1){return _0x1a1a61(_0xd04ec1);});});}exports[_0x2afc('0xa')]=function(_0x46cfa4,_0xc8f7d6,_0x309559){return function(_0x25d579){if(_0x309559[_0x2afc('0xb')]&&!_0x309559['rules'][_0x46cfa4]){logger[_0x2afc('0xc')](_0x2afc('0xd'),_0x46cfa4);return _0x25d579[_0x2afc('0xe')]();}var _0x4a909b=[];for(var _0x1aab3e=0x0;_0x1aab3e<_0xc8f7d6[_0x2afc('0xf')];_0x1aab3e+=0x1){_0x4a909b[_0x2afc('0x10')](request(_0x2afc('0x11'),{'command':util[_0x2afc('0x12')](_0x2afc('0x13'),_0xc8f7d6[_0x1aab3e])})[_0x2afc('0x14')](function(_0xc6a9f7){return _0xc6a9f7&&_0xc6a9f7[_0x2afc('0x7')]&&_0xc6a9f7[_0x2afc('0x7')]['indexOf'](_0x2afc('0x15'))>=0x0?!![]:![];})['catch'](function(_0x20d01f){logger['error'](_0x2afc('0x16'),_0x46cfa4,_0xc8f7d6[_0x1aab3e]);}));}BPromise[_0x2afc('0x17')](_0x4a909b)[_0x2afc('0x14')](function(_0x981f7f){var _0xe281f9=_[_0x2afc('0x18')](_0x981f7f);logger[_0x2afc('0xc')](_0x2afc('0x19'),_0x46cfa4,_0xc8f7d6[_0x2afc('0x1a')](_0x2afc('0x1b')),_0xe281f9);_0x25d579[_0x2afc('0x1c')](_0xe281f9);})['catch'](function(_0x1f18ef){console[_0x2afc('0x1d')](_0x1f18ef);logger['error'](_0x2afc('0x19'),_0x46cfa4,_0xc8f7d6['join'](_0x2afc('0x1b')),_0x1f18ef[_0x2afc('0x1e')]);_0x25d579[_0x2afc('0xe')]();});};};
\ No newline at end of file
+var _0xde6e=['../../../config/logger','routing','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','Command','[%s][INTERVAL]\x20%s','some','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stop','util','bluebird','lodash'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xde6e,0x174));var _0xede6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xde6e[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xede6('0x0'));var BPromise=require(_0xede6('0x1'));var jayson=require('jayson/promise');var _=require(_0xede6('0x2'));var logger=require(_0xede6('0x3'))(_0xede6('0x4'));var client=jayson['client']['http']({'port':0x232a});function request(_0x390c80,_0x4fe3c2){return new BPromise(function(_0x5b080f,_0xd7afd1){return client['request'](_0x390c80,_0x4fe3c2)[_0xede6('0x5')](function(_0x550a06){if(_0x550a06[_0xede6('0x6')]){return _0xd7afd1(_0x550a06[_0xede6('0x6')][_0xede6('0x7')]);}else{return _0x5b080f(_0x550a06[_0xede6('0x8')]);}})[_0xede6('0x9')](function(_0x50e920){return _0xd7afd1(_0x50e920);});});}exports[_0xede6('0xa')]=function(_0x4b8fee,_0x1baf4f,_0x24353d){return function(_0x4bffd7){if(_0x24353d[_0xede6('0xb')]&&!_0x24353d[_0xede6('0xb')][_0x4b8fee]){logger[_0xede6('0xc')](_0xede6('0xd'),_0x4b8fee);return _0x4bffd7['stop']();}var _0x44c5a2=[];for(var _0x6431c4=0x0;_0x6431c4<_0x1baf4f[_0xede6('0xe')];_0x6431c4+=0x1){_0x44c5a2[_0xede6('0xf')](request(_0xede6('0x10'),{'command':util['format']('iftime\x20%s',_0x1baf4f[_0x6431c4])})['then'](function(_0xd89306){return _0xd89306&&_0xd89306[_0xede6('0x7')]&&_0xd89306[_0xede6('0x7')]['indexOf']('true')>=0x0?!![]:![];})['catch'](function(_0x3a61c5){logger['error'](_0xede6('0x11'),_0x4b8fee,_0x1baf4f[_0x6431c4]);}));}BPromise['all'](_0x44c5a2)[_0xede6('0x5')](function(_0x34d354){var _0x4b156b=_[_0xede6('0x12')](_0x34d354);logger[_0xede6('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x4b8fee,_0x1baf4f[_0xede6('0x13')](_0xede6('0x14')),_0x4b156b);_0x4bffd7[_0xede6('0x15')](_0x4b156b);})['catch'](function(_0xa1e56a){console[_0xede6('0x16')](_0xa1e56a);logger['error'](_0xede6('0x17'),_0x4b8fee,_0x1baf4f[_0xede6('0x13')](_0xede6('0x14')),_0xa1e56a['stack']);_0x4bffd7[_0xede6('0x18')]();});};};
\ No newline at end of file
index 0fd6f33..468026c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9025=['attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','agentcalledAt','secondtransfererlinkedid','transfertargetuniqueid','hangup','cause','rejected','diffTime','agent','lodash','util','./utils','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','lastevent','then','type','agentcomplete','acw','agentacw','acwTimeout','CreateVoiceAgentReport','request','agentcalled','destuniqueid','now','called','connectedlinenum','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout','reason','holdtime','ringtime','push','queuecallerabandon','forIn','includes','abandoned','talktime','agentconnect','connect','answered_elsewhere','agentcompleteAt','agentconnectAt','complete','blindtransfer','transfereruniqueid','transfertype','transferexten','extension','transferuniqueid'];(function(_0x4678fd,_0x431892){var _0xfef9c0=function(_0x43afe){while(--_0x43afe){_0x4678fd['push'](_0x4678fd['shift']());}};_0xfef9c0(++_0x431892);}(_0x9025,0x1bd));var _0x5902=function(_0x4ea2a0,_0x4a39b4){_0x4ea2a0=_0x4ea2a0-0x0;var _0x3ec1b1=_0x9025[_0x4ea2a0];return _0x3ec1b1;};'use strict';var _=require(_0x5902('0x0'));var util=require(_0x5902('0x1'));var utils=require(_0x5902('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x12fcac,_0x389e52){utils['info'](util[_0x5902('0x3')](_0x5902('0x4'),_0x12fcac[_0x5902('0x5')],_0x12fcac[_0x5902('0x6')],_0x12fcac[_0x5902('0x7')],_0x12fcac[_0x5902('0x8')],_0x12fcac[_0x5902('0x9')],_0x12fcac['calleridnum'],_0x12fcac['connectedlinenum'],_0x12fcac[_0x5902('0xa')]));if(_0x12fcac[_0x5902('0x7')]){utils['getVoiceQueueByName'](_0x12fcac['queue'])[_0x5902('0xb')](function(_0x38fc4d){if(_0x38fc4d){_0x12fcac[_0x5902('0xc')]=_0x38fc4d['type'];_0x12fcac['agentacw']=_0x12fcac[_0x5902('0xd')]?_0x38fc4d[_0x5902('0xe')]:![];_0x12fcac['acwtime']=_0x12fcac[_0x5902('0xf')]?_0x38fc4d[_0x5902('0x10')]:0x0;}utils['request'](_0x5902('0x11'),_0x12fcac);});}else{utils[_0x5902('0x12')](_0x5902('0x11'),_0x12fcac);}if(_0x389e52){delete transfers[_0x12fcac['uniqueid']];}else{delete agents[_0x12fcac['destuniqueid']];}}exports[_0x5902('0x13')]=function(_0xacb590){try{agents[_0xacb590[_0x5902('0x14')]]=_0xacb590;agents[_0xacb590[_0x5902('0x14')]]['agentcalledAt']=utils[_0x5902('0x15')]();agents[_0xacb590[_0x5902('0x14')]][_0x5902('0xa')]=_0x5902('0x16');agents[_0xacb590['destuniqueid']][_0x5902('0x17')]=null;agents[_0xacb590['destuniqueid']][_0x5902('0x18')]=null;}catch(_0x168669){utils[_0x5902('0x19')](_0x168669[_0x5902('0x1a')]);}};exports[_0x5902('0x1b')]=function(_0x4a121f){try{if(!_[_0x5902('0x1c')](agents[_0x4a121f[_0x5902('0x14')]])){agents[_0x4a121f[_0x5902('0x14')]]['agentringnoanswer']=!![];agents[_0x4a121f[_0x5902('0x14')]][_0x5902('0x1d')]=utils[_0x5902('0x15')]();agents[_0x4a121f[_0x5902('0x14')]][_0x5902('0xa')]=_0x5902('0x1e');agents[_0x4a121f[_0x5902('0x14')]][_0x5902('0x1f')]=_0x5902('0x1e');agents[_0x4a121f[_0x5902('0x14')]][_0x5902('0x20')]=_0x4a121f[_0x5902('0x21')]?parseInt(_0x4a121f[_0x5902('0x21')])/0x3e8:0x0;agents[_0x4a121f[_0x5902('0x14')]]['talktime']=0x0;unanswered[_0x5902('0x22')](_0x4a121f[_0x5902('0x14')]);}}catch(_0x47e8f6){utils[_0x5902('0x19')](_0x47e8f6[_0x5902('0x1a')]);}};exports[_0x5902('0x23')]=function(_0x418ba7){try{_[_0x5902('0x24')](agents,function(_0x1300af,_0xc614ff){if(_0x1300af[_0x5902('0x5')]==_0x418ba7[_0x5902('0x5')]&&!_[_0x5902('0x25')](unanswered,_0x1300af['destuniqueid'])){_0x1300af['agentringnoanswer']=!![];_0x1300af[_0x5902('0x1d')]=utils[_0x5902('0x15')]();_0x1300af[_0x5902('0xa')]=_0x5902('0x26');_0x1300af[_0x5902('0x1f')]=_0x5902('0x26');_0x1300af[_0x5902('0x20')]=_0x418ba7[_0x5902('0x20')];_0x1300af[_0x5902('0x27')]=0x0;writeDB(_0x1300af);}});}catch(_0x32baf3){utils[_0x5902('0x19')](_0x32baf3[_0x5902('0x1a')]);}};exports[_0x5902('0x28')]=function(_0x4894fd){try{if(agents[_0x4894fd[_0x5902('0x14')]]){agents[_0x4894fd['destuniqueid']]['agentconnectAt']=utils[_0x5902('0x15')]();agents[_0x4894fd[_0x5902('0x14')]][_0x5902('0x17')]=_0x4894fd[_0x5902('0x17')];agents[_0x4894fd['destuniqueid']][_0x5902('0x18')]=_0x4894fd[_0x5902('0x18')];agents[_0x4894fd[_0x5902('0x14')]][_0x5902('0x20')]=_0x4894fd[_0x5902('0x21')];agents[_0x4894fd[_0x5902('0x14')]][_0x5902('0xa')]=_0x5902('0x29');_['forIn'](agents,function(_0xead5aa,_0x21e4a1){if(_0xead5aa[_0x5902('0x14')]!=_0x4894fd['destuniqueid']&&_0xead5aa['uniqueid']==_0x4894fd[_0x5902('0x5')]){_0xead5aa[_0x5902('0x27')]=0x0;_0xead5aa[_0x5902('0x20')]=_0x4894fd[_0x5902('0x21')];_0xead5aa[_0x5902('0x1b')]=!![];_0xead5aa[_0x5902('0x1d')]=utils[_0x5902('0x15')]();_0xead5aa[_0x5902('0xa')]=_0x5902('0x2a');_0xead5aa['reason']=_0x5902('0x2a');_0xead5aa['answeredelsewheredestinationuniqueid']=_0x4894fd[_0x5902('0x14')];_0xead5aa['answeredelsewheremembername']=_0x4894fd[_0x5902('0x8')];writeDB(_0xead5aa);}});}}catch(_0x4a9b4a){utils[_0x5902('0x19')](_0x4a9b4a[_0x5902('0x1a')]);}};exports[_0x5902('0xd')]=function(_0x2f8248){try{if(!_[_0x5902('0x1c')](agents[_0x2f8248[_0x5902('0x14')]])){agents[_0x2f8248[_0x5902('0x14')]][_0x5902('0xd')]=!![];agents[_0x2f8248[_0x5902('0x14')]][_0x5902('0x2b')]=utils[_0x5902('0x15')]();agents[_0x2f8248['destuniqueid']][_0x5902('0x27')]=utils['diffTime'](agents[_0x2f8248[_0x5902('0x14')]][_0x5902('0x2b')],agents[_0x2f8248[_0x5902('0x14')]][_0x5902('0x2c')]);agents[_0x2f8248[_0x5902('0x14')]][_0x5902('0x1f')]=_0x2f8248[_0x5902('0x1f')];agents[_0x2f8248['destuniqueid']][_0x5902('0xa')]=_0x5902('0x2d');writeDB(agents[_0x2f8248[_0x5902('0x14')]]);}}catch(_0x56138f){utils['error'](_0x56138f[_0x5902('0x1a')]);}};exports[_0x5902('0x2e')]=function(_0x56aab7){try{if(!_[_0x5902('0x1c')](agents[_0x56aab7[_0x5902('0x2f')]])){agents[_0x56aab7['transfereruniqueid']]['transfer']=!![];agents[_0x56aab7[_0x5902('0x2f')]][_0x5902('0x30')]='blind';agents[_0x56aab7[_0x5902('0x2f')]][_0x5902('0x31')]=_0x56aab7[_0x5902('0x32')];agents[_0x56aab7[_0x5902('0x2f')]][_0x5902('0x33')]=agents[_0x56aab7['transfereruniqueid']][_0x5902('0x5')];}}catch(_0x2d9b1e){utils[_0x5902('0x19')](_0x2d9b1e['stack']);}};exports[_0x5902('0x34')]=function(_0x8982f0){try{if(_0x8982f0[_0x5902('0x35')]==_0x8982f0[_0x5902('0x36')]){if(!_[_0x5902('0x1c')](agents[_0x8982f0[_0x5902('0x37')]])){agents[_0x8982f0[_0x5902('0x37')]][_0x5902('0x38')]=!![];agents[_0x8982f0[_0x5902('0x37')]]['transfertype']=_0x5902('0x39');agents[_0x8982f0[_0x5902('0x37')]][_0x5902('0x31')]=_0x8982f0['origtransfererexten'];agents[_0x8982f0['secondtransfereruniqueid']]['transferuniqueid']=_0x8982f0[_0x5902('0x35')];}if(_0x8982f0[_0x5902('0x3a')]&&agents[_0x8982f0[_0x5902('0x3a')]]){agents[_0x8982f0[_0x5902('0x3a')]][_0x5902('0x3b')]=0x1;transfers[_0x8982f0[_0x5902('0x3a')]]=_[_0x5902('0x3c')](agents[_0x8982f0['transfereeuniqueid']]);transfers[_0x8982f0[_0x5902('0x3a')]][_0x5902('0x3d')]=agents[_0x8982f0[_0x5902('0x37')]][_0x5902('0x3d')];transfers[_0x8982f0['transfereeuniqueid']][_0x5902('0x3e')]=agents[_0x8982f0[_0x5902('0x37')]][_0x5902('0x3e')];transfers[_0x8982f0['transfereeuniqueid']][_0x5902('0x3f')]=utils[_0x5902('0x15')]();transfers[_0x8982f0['transfereeuniqueid']][_0x5902('0x2c')]=utils[_0x5902('0x15')]();transfers[_0x8982f0['transfereeuniqueid']][_0x5902('0x20')]=0x0;transfers[_0x8982f0[_0x5902('0x3a')]][_0x5902('0x3b')]=0x2;}}else if(_0x8982f0[_0x5902('0x37')]==_0x8982f0[_0x5902('0x40')]){if(!_[_0x5902('0x1c')](agents[_0x8982f0[_0x5902('0x35')]])){agents[_0x8982f0['origtransfereruniqueid']][_0x5902('0x38')]=!![];agents[_0x8982f0['origtransfereruniqueid']][_0x5902('0x30')]=_0x5902('0x39');agents[_0x8982f0['origtransfereruniqueid']][_0x5902('0x31')]=_0x8982f0['secondtransfererexten'];agents[_0x8982f0['origtransfereruniqueid']][_0x5902('0x33')]=_0x8982f0[_0x5902('0x37')];}if(_0x8982f0['transfertargetuniqueid']&&agents[_0x8982f0[_0x5902('0x41')]]){agents[_0x8982f0[_0x5902('0x41')]][_0x5902('0x3b')]=0x1;transfers[_0x8982f0[_0x5902('0x41')]]=_[_0x5902('0x3c')](agents[_0x8982f0['transfertargetuniqueid']]);transfers[_0x8982f0[_0x5902('0x41')]][_0x5902('0x3d')]=agents[_0x8982f0['origtransfereruniqueid']]['calleridnum'];transfers[_0x8982f0['transfertargetuniqueid']][_0x5902('0x3e')]=agents[_0x8982f0['origtransfereruniqueid']][_0x5902('0x3e')];transfers[_0x8982f0['transfertargetuniqueid']]['agentcalledAt']=utils[_0x5902('0x15')]();transfers[_0x8982f0[_0x5902('0x41')]][_0x5902('0x2c')]=utils[_0x5902('0x15')]();transfers[_0x8982f0[_0x5902('0x41')]][_0x5902('0x20')]=0x0;transfers[_0x8982f0[_0x5902('0x41')]]['agententerreason']=0x2;}}}catch(_0x561ce5){utils[_0x5902('0x19')](_0x561ce5['stack']);}};exports[_0x5902('0x42')]=function(_0x1083ef){try{if(agents[_0x1083ef[_0x5902('0x5')]]&&agents[_0x1083ef[_0x5902('0x5')]]['reason']===_0x5902('0x1e')){if(_0x1083ef[_0x5902('0x43')]==='21'){agents[_0x1083ef['uniqueid']][_0x5902('0x1f')]=_0x5902('0x44');agents[_0x1083ef[_0x5902('0x5')]]['lastevent']='rejected';}writeDB(agents[_0x1083ef['uniqueid']]);var _0x2cb674=unanswered['indexOf'](_0x1083ef['uniqueid']);if(_0x2cb674>-0x1)unanswered['splice'](_0x2cb674,0x1);}if(transfers[_0x1083ef['uniqueid']]){transfers[_0x1083ef[_0x5902('0x5')]][_0x5902('0xd')]=!![];transfers[_0x1083ef[_0x5902('0x5')]][_0x5902('0x2b')]=utils[_0x5902('0x15')]();transfers[_0x1083ef[_0x5902('0x5')]][_0x5902('0x27')]=utils[_0x5902('0x45')](transfers[_0x1083ef['uniqueid']][_0x5902('0x2b')],transfers[_0x1083ef[_0x5902('0x5')]]['agentconnectAt']);transfers[_0x1083ef[_0x5902('0x5')]]['reason']=_0x5902('0x46');transfers[_0x1083ef[_0x5902('0x5')]]['lastevent']=_0x5902('0x2d');writeDB(transfers[_0x1083ef[_0x5902('0x5')]],!![]);}if(agents[_0x1083ef['uniqueid']]&&agents[_0x1083ef[_0x5902('0x5')]][_0x5902('0x2c')]){agents[_0x1083ef[_0x5902('0x5')]][_0x5902('0xd')]=!![];agents[_0x1083ef[_0x5902('0x5')]]['agentcompleteAt']=utils['now']();agents[_0x1083ef[_0x5902('0x5')]]['talktime']=utils[_0x5902('0x45')](agents[_0x1083ef[_0x5902('0x5')]][_0x5902('0x2b')],agents[_0x1083ef[_0x5902('0x5')]][_0x5902('0x2c')]);agents[_0x1083ef[_0x5902('0x5')]][_0x5902('0x1f')]=agents[_0x1083ef['uniqueid']][_0x5902('0x38')]?_0x5902('0x38'):'agent';agents[_0x1083ef[_0x5902('0x5')]][_0x5902('0xa')]=_0x5902('0x2d');writeDB(agents[_0x1083ef['uniqueid']]);}}catch(_0x57be51){utils[_0x5902('0x19')](_0x57be51[_0x5902('0x1a')]);}};
\ No newline at end of file
+var _0x8ccd=['agent','util','./utils','info','format','uniqueid','channel','queue','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','connectedlinename','error','agentringnoanswer','isNil','agentringnoanswerAt','now','timeout','reason','holdtime','ringtime','talktime','push','stack','queuecallerabandon','includes','abandoned','agentconnectAt','connect','answered_elsewhere','membername','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','cause','rejected','indexOf'];(function(_0x119d88,_0x12168f){var _0x305737=function(_0x31b511){while(--_0x31b511){_0x119d88['push'](_0x119d88['shift']());}};_0x305737(++_0x12168f);}(_0x8ccd,0x93));var _0xd8cc=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x8ccd[_0x4b7b62];return _0x2280df;};'use strict';var _=require('lodash');var util=require(_0xd8cc('0x0'));var utils=require(_0xd8cc('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x466d87,_0x538c63){utils[_0xd8cc('0x2')](util[_0xd8cc('0x3')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x466d87[_0xd8cc('0x4')],_0x466d87[_0xd8cc('0x5')],_0x466d87[_0xd8cc('0x6')],_0x466d87['membername'],_0x466d87[_0xd8cc('0x7')],_0x466d87[_0xd8cc('0x8')],_0x466d87[_0xd8cc('0x9')],_0x466d87[_0xd8cc('0xa')]));if(_0x466d87[_0xd8cc('0x6')]){utils[_0xd8cc('0xb')](_0x466d87[_0xd8cc('0x6')])[_0xd8cc('0xc')](function(_0x3f97aa){if(_0x3f97aa){_0x466d87[_0xd8cc('0xd')]=_0x3f97aa['type'];_0x466d87[_0xd8cc('0xe')]=_0x466d87[_0xd8cc('0xf')]?_0x3f97aa[_0xd8cc('0x10')]:![];_0x466d87[_0xd8cc('0x11')]=_0x466d87[_0xd8cc('0xe')]?_0x3f97aa[_0xd8cc('0x12')]:0x0;}utils[_0xd8cc('0x13')](_0xd8cc('0x14'),_0x466d87);});}else{utils['request'](_0xd8cc('0x14'),_0x466d87);}if(_0x538c63){delete transfers[_0x466d87['uniqueid']];}else{delete agents[_0x466d87[_0xd8cc('0x15')]];}}exports[_0xd8cc('0x16')]=function(_0x427ae4){try{agents[_0x427ae4['destuniqueid']]=_0x427ae4;agents[_0x427ae4[_0xd8cc('0x15')]][_0xd8cc('0x17')]=utils['now']();agents[_0x427ae4[_0xd8cc('0x15')]]['lastevent']='called';agents[_0x427ae4[_0xd8cc('0x15')]]['connectedlinenum']=null;agents[_0x427ae4[_0xd8cc('0x15')]][_0xd8cc('0x18')]=null;}catch(_0x3612f9){utils[_0xd8cc('0x19')](_0x3612f9['stack']);}};exports[_0xd8cc('0x1a')]=function(_0x3a0eda){try{if(!_[_0xd8cc('0x1b')](agents[_0x3a0eda['destuniqueid']])){agents[_0x3a0eda[_0xd8cc('0x15')]][_0xd8cc('0x1a')]=!![];agents[_0x3a0eda[_0xd8cc('0x15')]][_0xd8cc('0x1c')]=utils[_0xd8cc('0x1d')]();agents[_0x3a0eda[_0xd8cc('0x15')]]['lastevent']=_0xd8cc('0x1e');agents[_0x3a0eda[_0xd8cc('0x15')]][_0xd8cc('0x1f')]=_0xd8cc('0x1e');agents[_0x3a0eda['destuniqueid']][_0xd8cc('0x20')]=_0x3a0eda[_0xd8cc('0x21')]?parseInt(_0x3a0eda[_0xd8cc('0x21')])/0x3e8:0x0;agents[_0x3a0eda['destuniqueid']][_0xd8cc('0x22')]=0x0;unanswered[_0xd8cc('0x23')](_0x3a0eda[_0xd8cc('0x15')]);}}catch(_0x39011e){utils[_0xd8cc('0x19')](_0x39011e[_0xd8cc('0x24')]);}};exports[_0xd8cc('0x25')]=function(_0x2700a5){try{_['forIn'](agents,function(_0x117b25,_0x298000){if(_0x117b25[_0xd8cc('0x4')]==_0x2700a5[_0xd8cc('0x4')]&&!_[_0xd8cc('0x26')](unanswered,_0x117b25[_0xd8cc('0x15')])){_0x117b25[_0xd8cc('0x1a')]=!![];_0x117b25['agentringnoanswerAt']=utils[_0xd8cc('0x1d')]();_0x117b25[_0xd8cc('0xa')]=_0xd8cc('0x27');_0x117b25[_0xd8cc('0x1f')]=_0xd8cc('0x27');_0x117b25[_0xd8cc('0x20')]=_0x2700a5[_0xd8cc('0x20')];_0x117b25[_0xd8cc('0x22')]=0x0;writeDB(_0x117b25);}});}catch(_0x467b07){utils[_0xd8cc('0x19')](_0x467b07['stack']);}};exports['agentconnect']=function(_0x55f584){try{if(agents[_0x55f584['destuniqueid']]){agents[_0x55f584[_0xd8cc('0x15')]][_0xd8cc('0x28')]=utils['now']();agents[_0x55f584[_0xd8cc('0x15')]][_0xd8cc('0x9')]=_0x55f584[_0xd8cc('0x9')];agents[_0x55f584['destuniqueid']][_0xd8cc('0x18')]=_0x55f584[_0xd8cc('0x18')];agents[_0x55f584[_0xd8cc('0x15')]][_0xd8cc('0x20')]=_0x55f584[_0xd8cc('0x21')];agents[_0x55f584[_0xd8cc('0x15')]][_0xd8cc('0xa')]=_0xd8cc('0x29');_['forIn'](agents,function(_0x494f62,_0x1bd332){if(_0x494f62[_0xd8cc('0x15')]!=_0x55f584[_0xd8cc('0x15')]&&_0x494f62[_0xd8cc('0x4')]==_0x55f584[_0xd8cc('0x4')]){_0x494f62[_0xd8cc('0x22')]=0x0;_0x494f62['holdtime']=_0x55f584['ringtime'];_0x494f62[_0xd8cc('0x1a')]=!![];_0x494f62[_0xd8cc('0x1c')]=utils['now']();_0x494f62[_0xd8cc('0xa')]='answered_elsewhere';_0x494f62['reason']=_0xd8cc('0x2a');_0x494f62['answeredelsewheredestinationuniqueid']=_0x55f584[_0xd8cc('0x15')];_0x494f62['answeredelsewheremembername']=_0x55f584[_0xd8cc('0x2b')];writeDB(_0x494f62);}});}}catch(_0x4d6729){utils[_0xd8cc('0x19')](_0x4d6729[_0xd8cc('0x24')]);}};exports['agentcomplete']=function(_0x2acab9){try{if(!_['isNil'](agents[_0x2acab9[_0xd8cc('0x15')]])){agents[_0x2acab9['destuniqueid']][_0xd8cc('0xf')]=!![];agents[_0x2acab9['destuniqueid']][_0xd8cc('0x2c')]=utils[_0xd8cc('0x1d')]();agents[_0x2acab9[_0xd8cc('0x15')]][_0xd8cc('0x22')]=utils[_0xd8cc('0x2d')](agents[_0x2acab9['destuniqueid']][_0xd8cc('0x2c')],agents[_0x2acab9[_0xd8cc('0x15')]][_0xd8cc('0x28')]);agents[_0x2acab9[_0xd8cc('0x15')]][_0xd8cc('0x1f')]=_0x2acab9[_0xd8cc('0x1f')];agents[_0x2acab9[_0xd8cc('0x15')]]['lastevent']=_0xd8cc('0x2e');writeDB(agents[_0x2acab9[_0xd8cc('0x15')]]);}}catch(_0x10d135){utils['error'](_0x10d135[_0xd8cc('0x24')]);}};exports[_0xd8cc('0x2f')]=function(_0x1964c6){try{if(!_['isNil'](agents[_0x1964c6[_0xd8cc('0x30')]])){agents[_0x1964c6['transfereruniqueid']][_0xd8cc('0x31')]=!![];agents[_0x1964c6['transfereruniqueid']][_0xd8cc('0x32')]=_0xd8cc('0x33');agents[_0x1964c6[_0xd8cc('0x30')]][_0xd8cc('0x34')]=_0x1964c6[_0xd8cc('0x35')];agents[_0x1964c6[_0xd8cc('0x30')]][_0xd8cc('0x36')]=agents[_0x1964c6['transfereruniqueid']][_0xd8cc('0x4')];}}catch(_0x33d468){utils['error'](_0x33d468[_0xd8cc('0x24')]);}};exports[_0xd8cc('0x37')]=function(_0x3426c4){try{if(_0x3426c4[_0xd8cc('0x38')]==_0x3426c4[_0xd8cc('0x39')]){if(!_[_0xd8cc('0x1b')](agents[_0x3426c4[_0xd8cc('0x3a')]])){agents[_0x3426c4['secondtransfereruniqueid']]['transfer']=!![];agents[_0x3426c4[_0xd8cc('0x3a')]][_0xd8cc('0x32')]=_0xd8cc('0x3b');agents[_0x3426c4[_0xd8cc('0x3a')]][_0xd8cc('0x34')]=_0x3426c4[_0xd8cc('0x3c')];agents[_0x3426c4[_0xd8cc('0x3a')]][_0xd8cc('0x36')]=_0x3426c4[_0xd8cc('0x38')];}if(_0x3426c4[_0xd8cc('0x3d')]&&agents[_0x3426c4['transfereeuniqueid']]){agents[_0x3426c4[_0xd8cc('0x3d')]][_0xd8cc('0x3e')]=0x1;transfers[_0x3426c4['transfereeuniqueid']]=_[_0xd8cc('0x3f')](agents[_0x3426c4[_0xd8cc('0x3d')]]);transfers[_0x3426c4['transfereeuniqueid']][_0xd8cc('0x8')]=agents[_0x3426c4['secondtransfereruniqueid']][_0xd8cc('0x8')];transfers[_0x3426c4[_0xd8cc('0x3d')]][_0xd8cc('0x40')]=agents[_0x3426c4[_0xd8cc('0x3a')]][_0xd8cc('0x40')];transfers[_0x3426c4['transfereeuniqueid']]['agentcalledAt']=utils[_0xd8cc('0x1d')]();transfers[_0x3426c4[_0xd8cc('0x3d')]][_0xd8cc('0x28')]=utils['now']();transfers[_0x3426c4[_0xd8cc('0x3d')]]['holdtime']=0x0;transfers[_0x3426c4[_0xd8cc('0x3d')]][_0xd8cc('0x3e')]=0x2;}}else if(_0x3426c4[_0xd8cc('0x3a')]==_0x3426c4[_0xd8cc('0x41')]){if(!_['isNil'](agents[_0x3426c4[_0xd8cc('0x38')]])){agents[_0x3426c4[_0xd8cc('0x38')]][_0xd8cc('0x31')]=!![];agents[_0x3426c4[_0xd8cc('0x38')]][_0xd8cc('0x32')]=_0xd8cc('0x3b');agents[_0x3426c4[_0xd8cc('0x38')]]['transferexten']=_0x3426c4[_0xd8cc('0x42')];agents[_0x3426c4[_0xd8cc('0x38')]][_0xd8cc('0x36')]=_0x3426c4['secondtransfereruniqueid'];}if(_0x3426c4[_0xd8cc('0x43')]&&agents[_0x3426c4[_0xd8cc('0x43')]]){agents[_0x3426c4[_0xd8cc('0x43')]][_0xd8cc('0x3e')]=0x1;transfers[_0x3426c4[_0xd8cc('0x43')]]=_[_0xd8cc('0x3f')](agents[_0x3426c4[_0xd8cc('0x43')]]);transfers[_0x3426c4[_0xd8cc('0x43')]][_0xd8cc('0x8')]=agents[_0x3426c4[_0xd8cc('0x38')]][_0xd8cc('0x8')];transfers[_0x3426c4['transfertargetuniqueid']]['calleridname']=agents[_0x3426c4[_0xd8cc('0x38')]][_0xd8cc('0x40')];transfers[_0x3426c4[_0xd8cc('0x43')]][_0xd8cc('0x17')]=utils['now']();transfers[_0x3426c4[_0xd8cc('0x43')]][_0xd8cc('0x28')]=utils[_0xd8cc('0x1d')]();transfers[_0x3426c4[_0xd8cc('0x43')]][_0xd8cc('0x20')]=0x0;transfers[_0x3426c4[_0xd8cc('0x43')]][_0xd8cc('0x3e')]=0x2;}}}catch(_0x444701){utils[_0xd8cc('0x19')](_0x444701[_0xd8cc('0x24')]);}};exports[_0xd8cc('0x44')]=function(_0xe5102b){try{if(agents[_0xe5102b[_0xd8cc('0x4')]]&&agents[_0xe5102b['uniqueid']][_0xd8cc('0x1f')]===_0xd8cc('0x1e')){if(_0xe5102b[_0xd8cc('0x45')]==='21'){agents[_0xe5102b[_0xd8cc('0x4')]]['reason']=_0xd8cc('0x46');agents[_0xe5102b[_0xd8cc('0x4')]][_0xd8cc('0xa')]='rejected';}writeDB(agents[_0xe5102b[_0xd8cc('0x4')]]);var _0x596a0f=unanswered[_0xd8cc('0x47')](_0xe5102b[_0xd8cc('0x4')]);if(_0x596a0f>-0x1)unanswered['splice'](_0x596a0f,0x1);}if(transfers[_0xe5102b[_0xd8cc('0x4')]]){transfers[_0xe5102b[_0xd8cc('0x4')]][_0xd8cc('0xf')]=!![];transfers[_0xe5102b[_0xd8cc('0x4')]][_0xd8cc('0x2c')]=utils[_0xd8cc('0x1d')]();transfers[_0xe5102b[_0xd8cc('0x4')]][_0xd8cc('0x22')]=utils[_0xd8cc('0x2d')](transfers[_0xe5102b[_0xd8cc('0x4')]][_0xd8cc('0x2c')],transfers[_0xe5102b[_0xd8cc('0x4')]][_0xd8cc('0x28')]);transfers[_0xe5102b[_0xd8cc('0x4')]][_0xd8cc('0x1f')]=_0xd8cc('0x48');transfers[_0xe5102b[_0xd8cc('0x4')]][_0xd8cc('0xa')]=_0xd8cc('0x2e');writeDB(transfers[_0xe5102b[_0xd8cc('0x4')]],!![]);}if(agents[_0xe5102b[_0xd8cc('0x4')]]&&agents[_0xe5102b['uniqueid']]['agentconnectAt']){agents[_0xe5102b['uniqueid']][_0xd8cc('0xf')]=!![];agents[_0xe5102b[_0xd8cc('0x4')]][_0xd8cc('0x2c')]=utils['now']();agents[_0xe5102b[_0xd8cc('0x4')]]['talktime']=utils[_0xd8cc('0x2d')](agents[_0xe5102b['uniqueid']][_0xd8cc('0x2c')],agents[_0xe5102b[_0xd8cc('0x4')]][_0xd8cc('0x28')]);agents[_0xe5102b['uniqueid']][_0xd8cc('0x1f')]=agents[_0xe5102b[_0xd8cc('0x4')]]['transfer']?'transfer':'agent';agents[_0xe5102b[_0xd8cc('0x4')]][_0xd8cc('0xa')]='complete';writeDB(agents[_0xe5102b[_0xd8cc('0x4')]]);}}catch(_0x521dc1){utils[_0xd8cc('0x19')](_0x521dc1[_0xd8cc('0x24')]);}};
\ No newline at end of file
index d7ffb09..9aeb6a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb417=['xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','sipcallid','newexten','application','set','appdata','toLowerCase','cdr','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','uniqueid','channel','type','accountcode','source','destination','callerid','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','OutgoingSpoolFailed','calleridnum','exten','context','DOCUMENTATION','newstate','channelstate','isNil','systemanswertime','now','linkedid','destinationchannel','answertime','toNumber','error','calleridname','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','transfereechannel','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','xmd-originatecalleridnum','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue'];(function(_0x24b55f,_0x2d9432){var _0x489e82=function(_0x586141){while(--_0x586141){_0x24b55f['push'](_0x24b55f['shift']());}};_0x489e82(++_0x2d9432);}(_0xb417,0x11d));var _0x7b41=function(_0x2c830d,_0x1f9b85){_0x2c830d=_0x2c830d-0x0;var _0x1adc02=_0xb417[_0x2c830d];return _0x1adc02;};'use strict';var _=require(_0x7b41('0x0'));var util=require(_0x7b41('0x1'));var utils=require(_0x7b41('0x2'));var dispositions=[_0x7b41('0x3'),_0x7b41('0x4'),_0x7b41('0x4'),_0x7b41('0x3'),_0x7b41('0x3'),'NO\x20ANSWER',_0x7b41('0x5'),_0x7b41('0x6'),'FAILED',_0x7b41('0x4'),_0x7b41('0x4')];var channels={};function writeDB(_0x4c69c6){utils[_0x7b41('0x7')](util[_0x7b41('0x8')]('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x4c69c6[_0x7b41('0x9')],_0x4c69c6[_0x7b41('0xa')],_0x4c69c6[_0x7b41('0xb')],_0x4c69c6[_0x7b41('0xc')],_0x4c69c6[_0x7b41('0xd')],_0x4c69c6[_0x7b41('0xe')],_0x4c69c6[_0x7b41('0xf')],_0x4c69c6[_0x7b41('0x10')]));if(_0x4c69c6[_0x7b41('0xc')]){utils[_0x7b41('0x11')](_0x4c69c6['accountcode'])[_0x7b41('0x12')](function(_0x7940e6){if(_0x7940e6){_0x4c69c6[_0x7b41('0x13')]=_0x7940e6['id'];}utils[_0x7b41('0x14')](_0x7b41('0x15'),_0x4c69c6);});}else{utils[_0x7b41('0x14')]('CreateVoiceCallReport',_0x4c69c6);}if(channels[_0x4c69c6[_0x7b41('0x9')]]){delete channels[_0x4c69c6[_0x7b41('0x9')]];}}exports['newchannel']=function(_0x266cfa){try{if(_0x266cfa['uniqueid']==_0x266cfa['linkedid']&&_0x266cfa[_0x7b41('0xa')]!=_0x7b41('0x16')){channels[_0x266cfa['uniqueid']]={'uniqueid':_0x266cfa[_0x7b41('0x9')],'accountcode':_0x266cfa[_0x7b41('0xc')],'source':_0x266cfa[_0x7b41('0x17')],'destination':_0x266cfa[_0x7b41('0x18')],'destinationcontext':_0x266cfa[_0x7b41('0x19')],'channel':_0x266cfa[_0x7b41('0xa')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x7b41('0x3'),'amaflags':_0x7b41('0x1a')};}}catch(_0x2aa22e){utils['error'](_0x2aa22e['stack']);}};exports[_0x7b41('0x1b')]=function(_0x193489){try{if(!_['isNil'](channels[_0x193489[_0x7b41('0x9')]])&&_0x193489[_0x7b41('0x1c')]==0x6){if(_[_0x7b41('0x1d')](channels[_0x193489[_0x7b41('0x9')]]['systemanswertime'])){channels[_0x193489[_0x7b41('0x9')]][_0x7b41('0x1e')]=utils[_0x7b41('0x1f')]();}}else if(!_[_0x7b41('0x1d')](channels[_0x193489[_0x7b41('0x20')]])&&_0x193489[_0x7b41('0x1c')]==0x6&&_0x193489[_0x7b41('0x19')]!='transfer'){channels[_0x193489[_0x7b41('0x20')]][_0x7b41('0xc')]=_0x193489[_0x7b41('0xc')];channels[_0x193489['linkedid']][_0x7b41('0x21')]=_0x193489[_0x7b41('0xa')];if(_[_0x7b41('0x1d')](channels[_0x193489[_0x7b41('0x20')]][_0x7b41('0x22')])){channels[_0x193489[_0x7b41('0x20')]][_0x7b41('0x22')]=utils['now']();}channels[_0x193489[_0x7b41('0x20')]]['disposition']=dispositions[_[_0x7b41('0x23')](_0x193489[_0x7b41('0x1c')])]||'ANSWERED';}}catch(_0x4e0bbf){utils[_0x7b41('0x24')](_0x4e0bbf['stack']);}};exports['hangup']=function(_0x472068){try{if(!_[_0x7b41('0x1d')](channels[_0x472068['uniqueid']])){if(_['isNil'](channels[_0x472068[_0x7b41('0x9')]][_0x7b41('0xf')])){channels[_0x472068[_0x7b41('0x9')]][_0x7b41('0xf')]=_0x472068[_0x7b41('0x25')]+'\x20<'+_0x472068['calleridnum']+'>';}channels[_0x472068[_0x7b41('0x9')]][_0x7b41('0x26')]=utils['now']();channels[_0x472068[_0x7b41('0x9')]][_0x7b41('0x27')]=utils[_0x7b41('0x28')](channels[_0x472068[_0x7b41('0x9')]][_0x7b41('0x26')],channels[_0x472068[_0x7b41('0x9')]][_0x7b41('0x29')]);channels[_0x472068[_0x7b41('0x9')]][_0x7b41('0x2a')]=channels[_0x472068[_0x7b41('0x9')]][_0x7b41('0x22')]?utils['diffTime'](channels[_0x472068[_0x7b41('0x9')]]['endtime'],channels[_0x472068[_0x7b41('0x9')]]['answertime']):0x0;writeDB(channels[_0x472068[_0x7b41('0x9')]]);}}catch(_0x557bd1){utils[_0x7b41('0x24')](_0x557bd1['stack']);}};exports['attendedtransfer']=function(_0x43553f){try{if(!_['isNil'](channels[_0x43553f[_0x7b41('0x2b')]])){if(channels[_0x43553f[_0x7b41('0x2b')]][_0x7b41('0xa')]==_0x43553f[_0x7b41('0x2c')]){channels[_0x43553f[_0x7b41('0x2b')]][_0x7b41('0x21')]=_0x43553f[_0x7b41('0x2d')];channels[_0x43553f[_0x7b41('0x2b')]]['userfield']=_0x7b41('0x2e');}else if(channels[_0x43553f[_0x7b41('0x2b')]][_0x7b41('0xa')]=_0x43553f[_0x7b41('0x2f')]){channels[_0x43553f[_0x7b41('0x2b')]][_0x7b41('0x21')]=_0x43553f[_0x7b41('0x30')];channels[_0x43553f['localtwolinkedid']][_0x7b41('0x31')]=_0x7b41('0x2e');}}}catch(_0x205cb5){utils[_0x7b41('0x24')](_0x205cb5[_0x7b41('0x32')]);}};exports[_0x7b41('0x33')]=function(_0x17e054){try{if(!_[_0x7b41('0x1d')](channels[_0x17e054['uniqueid']])){channels[_0x17e054[_0x7b41('0x9')]][_0x7b41('0x34')]=utils['now']();}}catch(_0x3ddc1c){utils[_0x7b41('0x24')](_0x3ddc1c['stack']);}};exports[_0x7b41('0x35')]=function(_0x26adc9){try{if(!_[_0x7b41('0x1d')](channels[_0x26adc9[_0x7b41('0x9')]])){if(!_['isNil'](channels[_0x26adc9[_0x7b41('0x9')]][_0x7b41('0x34')])){channels[_0x26adc9[_0x7b41('0x9')]][_0x7b41('0x36')]+=utils[_0x7b41('0x28')](utils[_0x7b41('0x1f')](),channels[_0x26adc9['uniqueid']][_0x7b41('0x34')]);delete channels[_0x26adc9[_0x7b41('0x9')]][_0x7b41('0x34')];}}}catch(_0x5887fd){utils[_0x7b41('0x24')](_0x5887fd['stack']);}};exports[_0x7b41('0x37')]=function(_0xa8c6a1){try{if(!_[_0x7b41('0x1d')](channels[_0xa8c6a1[_0x7b41('0x9')]])){if(!_['isNil'](_0xa8c6a1[_0x7b41('0x38')][_0x7b41('0x39')])){channels[_0xa8c6a1[_0x7b41('0x9')]][_0x7b41('0xd')]=_0xa8c6a1[_0x7b41('0x3a')];}if(!_[_0x7b41('0x1d')](_0xa8c6a1['variable']['xmd-phone'])){channels[_0xa8c6a1[_0x7b41('0x9')]]['destination']=_0xa8c6a1[_0x7b41('0x3a')];channels[_0xa8c6a1['uniqueid']][_0x7b41('0xf')]='\x22'+_0xa8c6a1[_0x7b41('0x3a')]+_0x7b41('0x3b')+_0xa8c6a1[_0x7b41('0x3a')]+'>';}if(!_[_0x7b41('0x1d')](_0xa8c6a1[_0x7b41('0x38')][_0x7b41('0x3c')])||!_[_0x7b41('0x1d')](_0xa8c6a1[_0x7b41('0x38')][_0x7b41('0x3d')])){channels[_0xa8c6a1[_0x7b41('0x9')]][_0x7b41('0xf')]=_0xa8c6a1['value'];}if(!_[_0x7b41('0x1d')](_0xa8c6a1[_0x7b41('0x38')][_0x7b41('0x3e')])||!_[_0x7b41('0x1d')](_0xa8c6a1[_0x7b41('0x38')][_0x7b41('0x3f')])){channels[_0xa8c6a1[_0x7b41('0x9')]][_0x7b41('0x40')]=_0x7b41('0x41');channels[_0xa8c6a1[_0x7b41('0x9')]][_0x7b41('0x42')]=_0xa8c6a1['value'];channels[_0xa8c6a1[_0x7b41('0x9')]][_0x7b41('0x43')]=!![];}if(!_['isNil'](_0xa8c6a1[_0x7b41('0x38')][_0x7b41('0x44')])){channels[_0xa8c6a1[_0x7b41('0x9')]][_0x7b41('0x45')]=_0xa8c6a1[_0x7b41('0x3a')];}if(!_[_0x7b41('0x1d')](_0xa8c6a1[_0x7b41('0x38')][_0x7b41('0x46')])){channels[_0xa8c6a1['uniqueid']][_0x7b41('0xb')]=_0xa8c6a1['value'];}if(!_['isNil'](_0xa8c6a1['variable'][_0x7b41('0x47')])){channels[_0xa8c6a1[_0x7b41('0x9')]]['routeid']=_0xa8c6a1[_0x7b41('0x3a')];}if(!_[_0x7b41('0x1d')](_0xa8c6a1['variable'][_0x7b41('0x48')])){channels[_0xa8c6a1['uniqueid']][_0x7b41('0x48')]=_0xa8c6a1[_0x7b41('0x3a')];}}}catch(_0x4c0701){utils[_0x7b41('0x24')](_0x4c0701[_0x7b41('0x32')]);}};exports[_0x7b41('0x49')]=function(_0x3ce12f){try{if(!_[_0x7b41('0x1d')](channels[_0x3ce12f[_0x7b41('0x9')]])){if(_0x3ce12f[_0x7b41('0x4a')]['toLowerCase']()==_0x7b41('0x4b')&&_['startsWith'](_0x3ce12f[_0x7b41('0x4c')][_0x7b41('0x4d')](),_0x7b41('0x4e'))){var _0x3c0e7c=_0x3ce12f[_0x7b41('0x4c')][_0x7b41('0x4f')]('=');var _0xf05ff1=_0x3c0e7c[0x0][_0x7b41('0x50')](_0x3c0e7c[0x0][_0x7b41('0x51')]('(')+0x1,_0x3c0e7c[0x0][_0x7b41('0x51')](')'));var _0x30a947=_0x3c0e7c[0x1];channels[_0x3ce12f['uniqueid']][_0xf05ff1]=_0x30a947;}if(!_[_0x7b41('0x52')]([_0x7b41('0x53'),_0x7b41('0x54'),_0x7b41('0x55'),_0x7b41('0x4b'),_0x7b41('0x56')],_0x3ce12f[_0x7b41('0x4a')]['toLowerCase']())){channels[_0x3ce12f[_0x7b41('0x9')]][_0x7b41('0x40')]=_0x3ce12f['application'];channels[_0x3ce12f[_0x7b41('0x9')]][_0x7b41('0x42')]=_0x3ce12f[_0x7b41('0x4c')];}}}catch(_0x3ffcb1){utils['error'](_0x3ffcb1[_0x7b41('0x32')]);}};
\ No newline at end of file
+var _0x7759=['split','lastIndexOf','includes','hangup','noop','execif','gotoif','lodash','./utils','NO\x20ANSWER','FAILED','ANSWERED','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','accountcode','source','destination','callerid','disposition','UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','now','DOCUMENTATION','error','stack','newstate','isNil','systemanswertime','channelstate','transfer','destinationchannel','toNumber','calleridname','endtime','duration','starttime','billableseconds','answertime','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstartAt','musiconholdstop','diffTime','xmd-originatecalleridnum','value','variable','\x22\x20<','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','lastdata','queue','ContactId','xmd-cdrtype','type','outboundrouteid','routeid','sipcallid','application','toLowerCase','set','startsWith','appdata','cdr'];(function(_0x3f09a9,_0x2a1758){var _0x854a6d=function(_0x3eff89){while(--_0x3eff89){_0x3f09a9['push'](_0x3f09a9['shift']());}};_0x854a6d(++_0x2a1758);}(_0x7759,0x143));var _0x9775=function(_0x3ca801,_0x75d023){_0x3ca801=_0x3ca801-0x0;var _0x1f12ed=_0x7759[_0x3ca801];return _0x1f12ed;};'use strict';var _=require(_0x9775('0x0'));var util=require('util');var utils=require(_0x9775('0x1'));var dispositions=[_0x9775('0x2'),_0x9775('0x3'),_0x9775('0x3'),_0x9775('0x2'),_0x9775('0x2'),_0x9775('0x2'),_0x9775('0x4'),'BUSY','FAILED',_0x9775('0x3'),'FAILED'];var channels={};function writeDB(_0x249a09){utils['info'](util['format'](_0x9775('0x5'),_0x249a09[_0x9775('0x6')],_0x249a09[_0x9775('0x7')],_0x249a09['type'],_0x249a09[_0x9775('0x8')],_0x249a09[_0x9775('0x9')],_0x249a09[_0x9775('0xa')],_0x249a09[_0x9775('0xb')],_0x249a09[_0x9775('0xc')]));if(_0x249a09['accountcode']){utils['getUserByInternal'](_0x249a09[_0x9775('0x8')])['then'](function(_0x9e548){if(_0x9e548){_0x249a09[_0x9775('0xd')]=_0x9e548['id'];}utils[_0x9775('0xe')](_0x9775('0xf'),_0x249a09);});}else{utils[_0x9775('0xe')](_0x9775('0xf'),_0x249a09);}if(channels[_0x249a09[_0x9775('0x6')]]){delete channels[_0x249a09[_0x9775('0x6')]];}}exports[_0x9775('0x10')]=function(_0x5ce116){try{if(_0x5ce116[_0x9775('0x6')]==_0x5ce116[_0x9775('0x11')]&&_0x5ce116[_0x9775('0x7')]!=_0x9775('0x12')){channels[_0x5ce116[_0x9775('0x6')]]={'uniqueid':_0x5ce116[_0x9775('0x6')],'accountcode':_0x5ce116[_0x9775('0x8')],'source':_0x5ce116[_0x9775('0x13')],'destination':_0x5ce116[_0x9775('0x14')],'destinationcontext':_0x5ce116[_0x9775('0x15')],'channel':_0x5ce116['channel'],'starttime':utils[_0x9775('0x16')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9775('0x2'),'amaflags':_0x9775('0x17')};}}catch(_0x4b8025){utils[_0x9775('0x18')](_0x4b8025[_0x9775('0x19')]);}};exports[_0x9775('0x1a')]=function(_0x3c0949){try{if(!_[_0x9775('0x1b')](channels[_0x3c0949['uniqueid']])&&_0x3c0949['channelstate']==0x6){if(_['isNil'](channels[_0x3c0949[_0x9775('0x6')]][_0x9775('0x1c')])){channels[_0x3c0949[_0x9775('0x6')]][_0x9775('0x1c')]=utils[_0x9775('0x16')]();}}else if(!_[_0x9775('0x1b')](channels[_0x3c0949[_0x9775('0x11')]])&&_0x3c0949[_0x9775('0x1d')]==0x6&&_0x3c0949[_0x9775('0x15')]!=_0x9775('0x1e')){channels[_0x3c0949[_0x9775('0x11')]][_0x9775('0x8')]=_0x3c0949[_0x9775('0x8')];channels[_0x3c0949['linkedid']][_0x9775('0x1f')]=_0x3c0949[_0x9775('0x7')];if(_['isNil'](channels[_0x3c0949['linkedid']]['answertime'])){channels[_0x3c0949[_0x9775('0x11')]]['answertime']=utils[_0x9775('0x16')]();}channels[_0x3c0949[_0x9775('0x11')]][_0x9775('0xc')]=dispositions[_[_0x9775('0x20')](_0x3c0949[_0x9775('0x1d')])]||'ANSWERED';}}catch(_0x24c894){utils[_0x9775('0x18')](_0x24c894[_0x9775('0x19')]);}};exports['hangup']=function(_0x1e34b6){try{if(!_[_0x9775('0x1b')](channels[_0x1e34b6[_0x9775('0x6')]])){if(_['isNil'](channels[_0x1e34b6[_0x9775('0x6')]][_0x9775('0xb')])){channels[_0x1e34b6['uniqueid']][_0x9775('0xb')]=_0x1e34b6[_0x9775('0x21')]+'\x20<'+_0x1e34b6[_0x9775('0x13')]+'>';}channels[_0x1e34b6['uniqueid']][_0x9775('0x22')]=utils[_0x9775('0x16')]();channels[_0x1e34b6[_0x9775('0x6')]][_0x9775('0x23')]=utils['diffTime'](channels[_0x1e34b6['uniqueid']][_0x9775('0x22')],channels[_0x1e34b6[_0x9775('0x6')]][_0x9775('0x24')]);channels[_0x1e34b6['uniqueid']][_0x9775('0x25')]=channels[_0x1e34b6[_0x9775('0x6')]]['answertime']?utils['diffTime'](channels[_0x1e34b6[_0x9775('0x6')]]['endtime'],channels[_0x1e34b6[_0x9775('0x6')]][_0x9775('0x26')]):0x0;writeDB(channels[_0x1e34b6['uniqueid']]);}}catch(_0x28803f){utils[_0x9775('0x18')](_0x28803f['stack']);}};exports[_0x9775('0x27')]=function(_0x364e69){try{if(!_['isNil'](channels[_0x364e69[_0x9775('0x28')]])){if(channels[_0x364e69[_0x9775('0x28')]][_0x9775('0x7')]==_0x364e69[_0x9775('0x29')]){channels[_0x364e69[_0x9775('0x28')]][_0x9775('0x1f')]=_0x364e69[_0x9775('0x2a')];channels[_0x364e69[_0x9775('0x28')]][_0x9775('0x2b')]=_0x9775('0x2c');}else if(channels[_0x364e69[_0x9775('0x28')]][_0x9775('0x7')]=_0x364e69[_0x9775('0x2d')]){channels[_0x364e69[_0x9775('0x28')]][_0x9775('0x1f')]=_0x364e69[_0x9775('0x2e')];channels[_0x364e69[_0x9775('0x28')]]['userfield']=_0x9775('0x2c');}}}catch(_0x2b35b0){utils[_0x9775('0x18')](_0x2b35b0[_0x9775('0x19')]);}};exports['musiconholdstart']=function(_0x10cf7f){try{if(!_['isNil'](channels[_0x10cf7f[_0x9775('0x6')]])){channels[_0x10cf7f['uniqueid']][_0x9775('0x2f')]=utils[_0x9775('0x16')]();}}catch(_0x338e33){utils['error'](_0x338e33[_0x9775('0x19')]);}};exports[_0x9775('0x30')]=function(_0x2fc9cd){try{if(!_[_0x9775('0x1b')](channels[_0x2fc9cd[_0x9775('0x6')]])){if(!_['isNil'](channels[_0x2fc9cd[_0x9775('0x6')]]['musiconholdstartAt'])){channels[_0x2fc9cd[_0x9775('0x6')]]['mohtime']+=utils[_0x9775('0x31')](utils[_0x9775('0x16')](),channels[_0x2fc9cd[_0x9775('0x6')]][_0x9775('0x2f')]);delete channels[_0x2fc9cd[_0x9775('0x6')]][_0x9775('0x2f')];}}}catch(_0x92dcff){utils[_0x9775('0x18')](_0x92dcff[_0x9775('0x19')]);}};exports['varset']=function(_0x28e798){try{if(!_['isNil'](channels[_0x28e798[_0x9775('0x6')]])){if(!_[_0x9775('0x1b')](_0x28e798['variable'][_0x9775('0x32')])){channels[_0x28e798['uniqueid']][_0x9775('0x9')]=_0x28e798[_0x9775('0x33')];}if(!_[_0x9775('0x1b')](_0x28e798[_0x9775('0x34')]['xmd-phone'])){channels[_0x28e798[_0x9775('0x6')]]['destination']=_0x28e798['value'];channels[_0x28e798[_0x9775('0x6')]][_0x9775('0xb')]='\x22'+_0x28e798['value']+_0x9775('0x35')+_0x28e798[_0x9775('0x33')]+'>';}if(!_['isNil'](_0x28e798['variable'][_0x9775('0x36')])||!_[_0x9775('0x1b')](_0x28e798[_0x9775('0x34')]['xmd-callerid'])){channels[_0x28e798[_0x9775('0x6')]][_0x9775('0xb')]=_0x28e798[_0x9775('0x33')];}if(!_['isNil'](_0x28e798[_0x9775('0x34')][_0x9775('0x37')])||!_[_0x9775('0x1b')](_0x28e798['variable'][_0x9775('0x38')])){channels[_0x28e798[_0x9775('0x6')]][_0x9775('0x39')]='Queue';channels[_0x28e798[_0x9775('0x6')]][_0x9775('0x3a')]=_0x28e798[_0x9775('0x33')];channels[_0x28e798[_0x9775('0x6')]][_0x9775('0x3b')]=!![];}if(!_[_0x9775('0x1b')](_0x28e798['variable']['xmd-contactid'])){channels[_0x28e798[_0x9775('0x6')]][_0x9775('0x3c')]=_0x28e798[_0x9775('0x33')];}if(!_[_0x9775('0x1b')](_0x28e798[_0x9775('0x34')][_0x9775('0x3d')])){channels[_0x28e798[_0x9775('0x6')]][_0x9775('0x3e')]=_0x28e798[_0x9775('0x33')];}if(!_[_0x9775('0x1b')](_0x28e798[_0x9775('0x34')][_0x9775('0x3f')])){channels[_0x28e798['uniqueid']][_0x9775('0x40')]=_0x28e798[_0x9775('0x33')];}if(!_['isNil'](_0x28e798['variable'][_0x9775('0x41')])){channels[_0x28e798['uniqueid']][_0x9775('0x41')]=_0x28e798[_0x9775('0x33')];}}}catch(_0x1e06d1){utils[_0x9775('0x18')](_0x1e06d1[_0x9775('0x19')]);}};exports['newexten']=function(_0x5dfdf5){try{if(!_[_0x9775('0x1b')](channels[_0x5dfdf5[_0x9775('0x6')]])){if(_0x5dfdf5[_0x9775('0x42')][_0x9775('0x43')]()==_0x9775('0x44')&&_[_0x9775('0x45')](_0x5dfdf5[_0x9775('0x46')][_0x9775('0x43')](),_0x9775('0x47'))){var _0x559d85=_0x5dfdf5[_0x9775('0x46')][_0x9775('0x48')]('=');var _0x29e045=_0x559d85[0x0]['substring'](_0x559d85[0x0][_0x9775('0x49')]('(')+0x1,_0x559d85[0x0][_0x9775('0x49')](')'));var _0x438680=_0x559d85[0x1];channels[_0x5dfdf5['uniqueid']][_0x29e045]=_0x438680;}if(!_[_0x9775('0x4a')]([_0x9775('0x4b'),_0x9775('0x4c'),_0x9775('0x4d'),'set',_0x9775('0x4e')],_0x5dfdf5[_0x9775('0x42')][_0x9775('0x43')]())){channels[_0x5dfdf5[_0x9775('0x6')]]['lastapplication']=_0x5dfdf5[_0x9775('0x42')];channels[_0x5dfdf5[_0x9775('0x6')]]['lastdata']=_0x5dfdf5[_0x9775('0x46')];}}}catch(_0x57146b){utils[_0x9775('0x18')](_0x57146b[_0x9775('0x19')]);}};
\ No newline at end of file
index f52a92f..77c39fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x741c=['lodash','connect','info','CONNECTED','shutdown','fullybooted','FULLYBOOTED','error','close','CLOSE','./utils'];(function(_0xeaab61,_0xacb028){var _0x3ff9b3=function(_0x550c43){while(--_0x550c43){_0xeaab61['push'](_0xeaab61['shift']());}};_0x3ff9b3(++_0xacb028);}(_0x741c,0x196));var _0xc741=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x741c[_0x40a045];return _0x1a687c;};'use strict';var utils=require(_0xc741('0x0'));var _=require(_0xc741('0x1'));exports[_0xc741('0x2')]=function(){utils[_0xc741('0x3')](_0xc741('0x4'));};exports[_0xc741('0x5')]=function(){utils['info']('SHUTDOWN');};exports[_0xc741('0x6')]=function(){utils['info'](_0xc741('0x7'));};exports[_0xc741('0x8')]=function(_0x3708ae){utils[_0xc741('0x8')](_0x3708ae);};exports[_0xc741('0x9')]=function(){utils[_0xc741('0x3')](_0xc741('0xa'));};exports['managerevent']=function(_0x1ad6d9){};
\ No newline at end of file
+var _0xd8fb=['./utils','lodash','connect','info','SHUTDOWN','fullybooted','FULLYBOOTED','error','managerevent'];(function(_0xaba486,_0x13affa){var _0xcaa535=function(_0x2bfc98){while(--_0x2bfc98){_0xaba486['push'](_0xaba486['shift']());}};_0xcaa535(++_0x13affa);}(_0xd8fb,0x99));var _0xbd8f=function(_0x12527c,_0x2b28a6){_0x12527c=_0x12527c-0x0;var _0x27dc09=_0xd8fb[_0x12527c];return _0x27dc09;};'use strict';var utils=require(_0xbd8f('0x0'));var _=require(_0xbd8f('0x1'));exports[_0xbd8f('0x2')]=function(){utils[_0xbd8f('0x3')]('CONNECTED');};exports['shutdown']=function(){utils['info'](_0xbd8f('0x4'));};exports[_0xbd8f('0x5')]=function(){utils['info'](_0xbd8f('0x6'));};exports[_0xbd8f('0x7')]=function(_0x5543b2){utils[_0xbd8f('0x7')](_0x5543b2);};exports['close']=function(){utils[_0xbd8f('0x3')]('CLOSE');};exports[_0xbd8f('0x8')]=function(_0x403edc){};
\ No newline at end of file
index 7efefe6..1f96c07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc540=['uniqueid','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','stack','varset','isNil','variable','outboundrouteid','error','starttime','now','lastevent','called','dialend','ANSWER','assign','connect','hangup','complete','duration','diffTime','endtime','holdtime','answertime','billableseconds','format','DIAL|%s|%s|%s|%s|%s|%s'];(function(_0x32ad38,_0x199916){var _0x518e14=function(_0x508b49){while(--_0x508b49){_0x32ad38['push'](_0x32ad38['shift']());}};_0x518e14(++_0x199916);}(_0xc540,0x184));var _0x0c54=function(_0x53b57d,_0xde9609){_0x53b57d=_0x53b57d-0x0;var _0x106f76=_0xc540[_0x53b57d];return _0x106f76;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x352f45){utils['info'](util[_0x0c54('0x0')](_0x0c54('0x1'),_0x352f45[_0x0c54('0x2')],_0x352f45[_0x0c54('0x3')],_0x352f45[_0x0c54('0x4')],_0x352f45['calleridnum'],_0x352f45[_0x0c54('0x5')],_0x352f45[_0x0c54('0x6')]));utils[_0x0c54('0x7')](_0x0c54('0x8'),_0x352f45);delete dials[_0x352f45[_0x0c54('0x2')]];}exports[_0x0c54('0x9')]=function(_0x4067ac){try{if(_0x4067ac[_0x0c54('0xa')][_0x0c54('0xb')]()==_0x0c54('0xc')&&_[_0x0c54('0xd')](_0x4067ac[_0x0c54('0xe')]['toLowerCase'](),_0x0c54('0xf'))){var _0x4fd69a=_0x4067ac[_0x0c54('0xe')][_0x0c54('0x10')]('=');dials[_0x4067ac[_0x0c54('0x2')]]={'routeId':_0x4fd69a[0x1]};}}catch(_0x4884f9){utils['error'](_0x4884f9[_0x0c54('0x11')]);}};exports[_0x0c54('0x12')]=function(_0x186dde){try{if(!_[_0x0c54('0x13')](_0x186dde[_0x0c54('0x14')][_0x0c54('0x15')])){dials[_0x186dde['uniqueid']]={'routeId':_0x186dde['value']};}}catch(_0x42ab12){utils[_0x0c54('0x16')](_0x42ab12['stack']);}};exports['dialbegin']=function(_0x23d370){try{if(!_[_0x0c54('0x13')](dials[_0x23d370[_0x0c54('0x2')]])){dials[_0x23d370[_0x0c54('0x2')]]=_['assign'](dials[_0x23d370[_0x0c54('0x2')]],_0x23d370);dials[_0x23d370['uniqueid']][_0x0c54('0x17')]=utils[_0x0c54('0x18')]();dials[_0x23d370['uniqueid']][_0x0c54('0x19')]=_0x0c54('0x1a');}}catch(_0x3d18b9){utils['error'](_0x3d18b9[_0x0c54('0x11')]);}};exports[_0x0c54('0x1b')]=function(_0x5e18c0){try{if(!_[_0x0c54('0x13')](dials[_0x5e18c0[_0x0c54('0x2')]])){dials[_0x5e18c0[_0x0c54('0x2')]][_0x0c54('0x6')]=_0x5e18c0['dialstatus'];if(_0x5e18c0['dialstatus']==_0x0c54('0x1c')){dials[_0x5e18c0[_0x0c54('0x2')]]=_[_0x0c54('0x1d')](dials[_0x5e18c0['uniqueid']],_0x5e18c0);dials[_0x5e18c0['uniqueid']]['answertime']=utils[_0x0c54('0x18')]();dials[_0x5e18c0[_0x0c54('0x2')]][_0x0c54('0x19')]=_0x0c54('0x1e');}}}catch(_0x5765f9){utils[_0x0c54('0x16')](_0x5765f9[_0x0c54('0x11')]);}};exports[_0x0c54('0x1f')]=function(_0x4448f5){try{if(!_['isNil'](dials[_0x4448f5[_0x0c54('0x2')]])){dials[_0x4448f5[_0x0c54('0x2')]]=_[_0x0c54('0x1d')](dials[_0x4448f5[_0x0c54('0x2')]],{'endtime':utils[_0x0c54('0x18')](),'lastevent':_0x0c54('0x20')});dials[_0x4448f5[_0x0c54('0x2')]][_0x0c54('0x21')]=utils[_0x0c54('0x22')](dials[_0x4448f5[_0x0c54('0x2')]][_0x0c54('0x23')],dials[_0x4448f5[_0x0c54('0x2')]][_0x0c54('0x17')]);dials[_0x4448f5[_0x0c54('0x2')]][_0x0c54('0x24')]=utils[_0x0c54('0x22')](dials[_0x4448f5[_0x0c54('0x2')]][_0x0c54('0x25')]||dials[_0x4448f5[_0x0c54('0x2')]][_0x0c54('0x23')],dials[_0x4448f5[_0x0c54('0x2')]][_0x0c54('0x17')]);dials[_0x4448f5[_0x0c54('0x2')]][_0x0c54('0x26')]=dials[_0x4448f5[_0x0c54('0x2')]][_0x0c54('0x25')]?utils[_0x0c54('0x22')](dials[_0x4448f5[_0x0c54('0x2')]]['endtime'],dials[_0x4448f5[_0x0c54('0x2')]][_0x0c54('0x25')]):0x0;writeDB(dials[_0x4448f5[_0x0c54('0x2')]]);}}catch(_0x4e3924){utils[_0x0c54('0x16')](_0x4e3924[_0x0c54('0x11')]);}};
\ No newline at end of file
+var _0x81a4=['endtime','holdtime','answertime','starttime','billableseconds','util','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','calleridnum','dialstatus','request','newexten','application','startsWith','appdata','error','stack','isNil','variable','value','dialbegin','now','lastevent','called','dialend','ANSWER','assign','hangup','complete','duration','diffTime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x81a4,0x125));var _0x481a=function(_0x577519,_0x346daf){_0x577519=_0x577519-0x0;var _0x5b12f7=_0x81a4[_0x577519];return _0x5b12f7;};'use strict';var _=require('lodash');var util=require(_0x481a('0x0'));var utils=require(_0x481a('0x1'));var dials={};function writeDB(_0x16d588){utils[_0x481a('0x2')](util[_0x481a('0x3')](_0x481a('0x4'),_0x16d588[_0x481a('0x5')],_0x16d588[_0x481a('0x6')],_0x16d588[_0x481a('0x7')],_0x16d588[_0x481a('0x8')],_0x16d588['connectedlinenum'],_0x16d588[_0x481a('0x9')]));utils[_0x481a('0xa')]('CreateVoiceDialReport',_0x16d588);delete dials[_0x16d588[_0x481a('0x5')]];}exports[_0x481a('0xb')]=function(_0x37d8e2){try{if(_0x37d8e2[_0x481a('0xc')]['toLowerCase']()=='set'&&_[_0x481a('0xd')](_0x37d8e2[_0x481a('0xe')]['toLowerCase'](),'cdr(routeid)')){var _0x468e63=_0x37d8e2[_0x481a('0xe')]['split']('=');dials[_0x37d8e2[_0x481a('0x5')]]={'routeId':_0x468e63[0x1]};}}catch(_0x96066){utils[_0x481a('0xf')](_0x96066[_0x481a('0x10')]);}};exports['varset']=function(_0x1b3a94){try{if(!_[_0x481a('0x11')](_0x1b3a94[_0x481a('0x12')]['outboundrouteid'])){dials[_0x1b3a94[_0x481a('0x5')]]={'routeId':_0x1b3a94[_0x481a('0x13')]};}}catch(_0x2f837f){utils[_0x481a('0xf')](_0x2f837f['stack']);}};exports[_0x481a('0x14')]=function(_0x24e577){try{if(!_[_0x481a('0x11')](dials[_0x24e577[_0x481a('0x5')]])){dials[_0x24e577[_0x481a('0x5')]]=_['assign'](dials[_0x24e577[_0x481a('0x5')]],_0x24e577);dials[_0x24e577[_0x481a('0x5')]]['starttime']=utils[_0x481a('0x15')]();dials[_0x24e577['uniqueid']][_0x481a('0x16')]=_0x481a('0x17');}}catch(_0x56f848){utils[_0x481a('0xf')](_0x56f848[_0x481a('0x10')]);}};exports[_0x481a('0x18')]=function(_0x144e6d){try{if(!_[_0x481a('0x11')](dials[_0x144e6d[_0x481a('0x5')]])){dials[_0x144e6d[_0x481a('0x5')]]['dialstatus']=_0x144e6d[_0x481a('0x9')];if(_0x144e6d[_0x481a('0x9')]==_0x481a('0x19')){dials[_0x144e6d['uniqueid']]=_[_0x481a('0x1a')](dials[_0x144e6d[_0x481a('0x5')]],_0x144e6d);dials[_0x144e6d[_0x481a('0x5')]]['answertime']=utils[_0x481a('0x15')]();dials[_0x144e6d['uniqueid']][_0x481a('0x16')]='connect';}}}catch(_0x3397b7){utils[_0x481a('0xf')](_0x3397b7[_0x481a('0x10')]);}};exports[_0x481a('0x1b')]=function(_0x12010f){try{if(!_[_0x481a('0x11')](dials[_0x12010f['uniqueid']])){dials[_0x12010f[_0x481a('0x5')]]=_['assign'](dials[_0x12010f[_0x481a('0x5')]],{'endtime':utils[_0x481a('0x15')](),'lastevent':_0x481a('0x1c')});dials[_0x12010f[_0x481a('0x5')]][_0x481a('0x1d')]=utils[_0x481a('0x1e')](dials[_0x12010f[_0x481a('0x5')]][_0x481a('0x1f')],dials[_0x12010f[_0x481a('0x5')]]['starttime']);dials[_0x12010f[_0x481a('0x5')]][_0x481a('0x20')]=utils['diffTime'](dials[_0x12010f['uniqueid']][_0x481a('0x21')]||dials[_0x12010f[_0x481a('0x5')]]['endtime'],dials[_0x12010f[_0x481a('0x5')]][_0x481a('0x22')]);dials[_0x12010f['uniqueid']][_0x481a('0x23')]=dials[_0x12010f['uniqueid']][_0x481a('0x21')]?utils[_0x481a('0x1e')](dials[_0x12010f['uniqueid']]['endtime'],dials[_0x12010f['uniqueid']][_0x481a('0x21')]):0x0;writeDB(dials[_0x12010f[_0x481a('0x5')]]);}}catch(_0x191350){utils[_0x481a('0xf')](_0x191350[_0x481a('0x10')]);}};
\ No newline at end of file
index 9b5633c..2a9451b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1016=['keepConnected','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','../../config/environment','./utils','asterisk','port'];(function(_0x467ef6,_0x932cef){var _0x3e4aa2=function(_0xb56bb5){while(--_0xb56bb5){_0x467ef6['push'](_0x467ef6['shift']());}};_0x3e4aa2(++_0x932cef);}(_0x1016,0x1bf));var _0x6101=function(_0x191fa4,_0x20805b){_0x191fa4=_0x191fa4-0x0;var _0x2d70d1=_0x1016[_0x191fa4];return _0x2d70d1;};var AsteriskManager=require('asterisk-manager');var config=require(_0x6101('0x0'));var utils=require(_0x6101('0x1'));var ami=new AsteriskManager(config[_0x6101('0x2')][_0x6101('0x3')],config[_0x6101('0x2')]['ip'],config[_0x6101('0x2')]['username'],config[_0x6101('0x2')]['password'],!![]);ami[_0x6101('0x4')]();if(config[_0x6101('0x5')]&&config[_0x6101('0x5')][_0x6101('0x6')]){utils['info'](_0x6101('0x7'));}else{var agents=require(_0x6101('0x8'));var calls=require(_0x6101('0x9'));var queues=require(_0x6101('0xa'));var recordings=require(_0x6101('0xb'));var members=require(_0x6101('0xc'));var dials=require('./dials.controller');var transfers=require(_0x6101('0xd'));var core=require(_0x6101('0xe'));ami['on'](_0x6101('0xf'),core['connect']);ami['on'](_0x6101('0x10'),core[_0x6101('0x10')]);ami['on'](_0x6101('0x11'),core[_0x6101('0x11')]);ami['on'](_0x6101('0x12'),core[_0x6101('0x12')]);ami['on']('close',core[_0x6101('0x13')]);ami['on'](_0x6101('0x14'),core[_0x6101('0x14')]);ami['on'](_0x6101('0x15'),function(_0xf2ff05){try{members[_0x6101('0x15')](_0xf2ff05);}catch(_0x3b0652){utils[_0x6101('0x12')](_0x3b0652);}});ami['on'](_0x6101('0x16'),function(_0x2c6e50){try{agents[_0x6101('0x16')](_0x2c6e50);}catch(_0x2209e4){utils[_0x6101('0x12')](_0x2209e4);}});ami['on'](_0x6101('0x17'),function(_0x4456f2){try{agents[_0x6101('0x17')](_0x4456f2);}catch(_0x1a5fde){utils[_0x6101('0x12')](_0x1a5fde);}});ami['on']('agentconnect',function(_0x379d3c){try{agents[_0x6101('0x18')](_0x379d3c);queues[_0x6101('0x18')](_0x379d3c);}catch(_0x5b613d){utils[_0x6101('0x12')](_0x5b613d);}});ami['on'](_0x6101('0x19'),function(_0xcb7569){try{agents[_0x6101('0x19')](_0xcb7569);queues[_0x6101('0x19')](_0xcb7569);members[_0x6101('0x19')](_0xcb7569);}catch(_0x1603b2){utils['error'](_0x1603b2);}});ami['on'](_0x6101('0x1a'),function(_0x59621d){try{agents[_0x6101('0x1a')](_0x59621d);queues[_0x6101('0x1a')](_0x59621d);}catch(_0xdb6505){utils[_0x6101('0x12')](_0xdb6505);}});ami['on'](_0x6101('0x1b'),function(_0x7e9182){try{queues[_0x6101('0x1b')](_0x7e9182);recordings[_0x6101('0x1b')](_0x7e9182);}catch(_0x242ae0){utils[_0x6101('0x12')](_0x242ae0);}});ami['on'](_0x6101('0x1c'),function(_0x37822f){try{queues[_0x6101('0x1c')](_0x37822f);}catch(_0x1881aa){utils[_0x6101('0x12')](_0x1881aa);}});ami['on']('musiconholdstart',function(_0x173017){try{queues[_0x6101('0x1d')](_0x173017);calls[_0x6101('0x1d')](_0x173017);}catch(_0x3db975){utils['error'](_0x3db975);}});ami['on'](_0x6101('0x1e'),function(_0x18628a){try{queues['musiconholdstop'](_0x18628a);calls['musiconholdstop'](_0x18628a);}catch(_0x213ea3){utils[_0x6101('0x12')](_0x213ea3);}});ami['on'](_0x6101('0x1f'),function(_0x73fe9){try{calls[_0x6101('0x1f')](_0x73fe9);recordings[_0x6101('0x1f')](_0x73fe9);}catch(_0x12d9a1){utils[_0x6101('0x12')](_0x12d9a1);}});ami['on'](_0x6101('0x20'),function(_0x112473){try{calls[_0x6101('0x20')](_0x112473);recordings[_0x6101('0x20')](_0x112473);dials['hangup'](_0x112473);agents[_0x6101('0x20')](_0x112473);queues[_0x6101('0x20')](_0x112473);}catch(_0x178f5a){utils[_0x6101('0x12')](_0x178f5a);}});ami['on'](_0x6101('0x21'),function(_0x1ab368){try{members[_0x6101('0x21')](_0x1ab368);}catch(_0x25b7a3){utils[_0x6101('0x12')](_0x25b7a3);}});ami['on']('blindtransfer',function(_0xb79dc0){try{queues[_0x6101('0x22')](_0xb79dc0);agents[_0x6101('0x22')](_0xb79dc0);transfers['blindtransfer'](_0xb79dc0);}catch(_0x548e75){utils[_0x6101('0x12')](_0x548e75);}});ami['on']('attendedtransfer',function(_0x622fc1){try{queues[_0x6101('0x23')](_0x622fc1);transfers[_0x6101('0x23')](_0x622fc1);agents[_0x6101('0x23')](_0x622fc1);calls[_0x6101('0x23')](_0x622fc1);}catch(_0x45355c){utils[_0x6101('0x12')](_0x45355c);}});ami['on'](_0x6101('0x24'),function(_0x483e67){try{queues['varset'](_0x483e67);recordings['varset'](_0x483e67);calls['varset'](_0x483e67);dials[_0x6101('0x24')](_0x483e67);}catch(_0x5e0406){utils[_0x6101('0x12')](_0x5e0406);}});ami['on']('newexten',function(_0x3f54c6){try{calls[_0x6101('0x25')](_0x3f54c6);recordings[_0x6101('0x25')](_0x3f54c6);dials[_0x6101('0x25')](_0x3f54c6);}catch(_0x3e0a5e){utils['error'](_0x3e0a5e);}});ami['on'](_0x6101('0x26'),function(_0x4e1d14){try{calls[_0x6101('0x26')](_0x4e1d14);recordings['newchannel'](_0x4e1d14);}catch(_0x4c918c){utils[_0x6101('0x12')](_0x4c918c);}});ami['on'](_0x6101('0x27'),function(_0x5325f9){try{dials['dialbegin'](_0x5325f9);}catch(_0x31c021){utils['error'](_0x31c021);}});ami['on'](_0x6101('0x28'),function(_0x4e4c17){try{dials[_0x6101('0x28')](_0x4e4c17);}catch(_0x371933){utils[_0x6101('0x12')](_0x371933);}});}
\ No newline at end of file
+var _0xef47=['asterisk-manager','../../config/environment','asterisk','port','username','keepConnected','xdr','disabled','info','./agents.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend'];(function(_0x58745b,_0x2770e0){var _0x12914c=function(_0x45592d){while(--_0x45592d){_0x58745b['push'](_0x58745b['shift']());}};_0x12914c(++_0x2770e0);}(_0xef47,0x1e0));var _0x7ef4=function(_0x4ed02e,_0x23dd8a){_0x4ed02e=_0x4ed02e-0x0;var _0x1d9108=_0xef47[_0x4ed02e];return _0x1d9108;};var AsteriskManager=require(_0x7ef4('0x0'));var config=require(_0x7ef4('0x1'));var utils=require('./utils');var ami=new AsteriskManager(config[_0x7ef4('0x2')][_0x7ef4('0x3')],config[_0x7ef4('0x2')]['ip'],config['asterisk'][_0x7ef4('0x4')],config[_0x7ef4('0x2')]['password'],!![]);ami[_0x7ef4('0x5')]();if(config['xdr']&&config[_0x7ef4('0x6')][_0x7ef4('0x7')]){utils[_0x7ef4('0x8')]('XDR\x20DISABLED');}else{var agents=require(_0x7ef4('0x9'));var calls=require('./calls.controller');var queues=require(_0x7ef4('0xa'));var recordings=require('./recordings.controller');var members=require(_0x7ef4('0xb'));var dials=require(_0x7ef4('0xc'));var transfers=require(_0x7ef4('0xd'));var core=require('./core.controller');ami['on'](_0x7ef4('0xe'),core[_0x7ef4('0xe')]);ami['on'](_0x7ef4('0xf'),core['shutdown']);ami['on'](_0x7ef4('0x10'),core['fullybooted']);ami['on'](_0x7ef4('0x11'),core[_0x7ef4('0x11')]);ami['on'](_0x7ef4('0x12'),core[_0x7ef4('0x12')]);ami['on']('managerevent',core[_0x7ef4('0x13')]);ami['on'](_0x7ef4('0x14'),function(_0x229227){try{members[_0x7ef4('0x14')](_0x229227);}catch(_0x167f24){utils['error'](_0x167f24);}});ami['on']('agentcalled',function(_0x3d7d4b){try{agents[_0x7ef4('0x15')](_0x3d7d4b);}catch(_0x39a7dd){utils[_0x7ef4('0x11')](_0x39a7dd);}});ami['on'](_0x7ef4('0x16'),function(_0x4b3343){try{agents[_0x7ef4('0x16')](_0x4b3343);}catch(_0x48c58d){utils['error'](_0x48c58d);}});ami['on']('agentconnect',function(_0x2de385){try{agents['agentconnect'](_0x2de385);queues[_0x7ef4('0x17')](_0x2de385);}catch(_0x23fae9){utils['error'](_0x23fae9);}});ami['on']('agentcomplete',function(_0x302f4b){try{agents['agentcomplete'](_0x302f4b);queues[_0x7ef4('0x18')](_0x302f4b);members[_0x7ef4('0x18')](_0x302f4b);}catch(_0x162e21){utils['error'](_0x162e21);}});ami['on'](_0x7ef4('0x19'),function(_0x1bd53f){try{agents[_0x7ef4('0x19')](_0x1bd53f);queues['queuecallerabandon'](_0x1bd53f);}catch(_0x43da4f){utils['error'](_0x43da4f);}});ami['on']('queuecallerjoin',function(_0x14dabe){try{queues[_0x7ef4('0x1a')](_0x14dabe);recordings[_0x7ef4('0x1a')](_0x14dabe);}catch(_0xd914b8){utils['error'](_0xd914b8);}});ami['on'](_0x7ef4('0x1b'),function(_0x104d08){try{queues[_0x7ef4('0x1b')](_0x104d08);}catch(_0x527775){utils['error'](_0x527775);}});ami['on'](_0x7ef4('0x1c'),function(_0x38703a){try{queues['musiconholdstart'](_0x38703a);calls[_0x7ef4('0x1c')](_0x38703a);}catch(_0x1b1381){utils[_0x7ef4('0x11')](_0x1b1381);}});ami['on'](_0x7ef4('0x1d'),function(_0x387e71){try{queues[_0x7ef4('0x1d')](_0x387e71);calls[_0x7ef4('0x1d')](_0x387e71);}catch(_0x3d24e8){utils['error'](_0x3d24e8);}});ami['on'](_0x7ef4('0x1e'),function(_0x4a6f54){try{calls['newstate'](_0x4a6f54);recordings[_0x7ef4('0x1e')](_0x4a6f54);}catch(_0xe9050c){utils[_0x7ef4('0x11')](_0xe9050c);}});ami['on']('hangup',function(_0x4a9530){try{calls[_0x7ef4('0x1f')](_0x4a9530);recordings[_0x7ef4('0x1f')](_0x4a9530);dials[_0x7ef4('0x1f')](_0x4a9530);agents[_0x7ef4('0x1f')](_0x4a9530);queues[_0x7ef4('0x1f')](_0x4a9530);}catch(_0x11d39e){utils[_0x7ef4('0x11')](_0x11d39e);}});ami['on'](_0x7ef4('0x20'),function(_0xc8e5dc){try{members[_0x7ef4('0x20')](_0xc8e5dc);}catch(_0x463d71){utils[_0x7ef4('0x11')](_0x463d71);}});ami['on'](_0x7ef4('0x21'),function(_0x631c3){try{queues[_0x7ef4('0x21')](_0x631c3);agents[_0x7ef4('0x21')](_0x631c3);transfers['blindtransfer'](_0x631c3);}catch(_0x56f9c5){utils[_0x7ef4('0x11')](_0x56f9c5);}});ami['on']('attendedtransfer',function(_0xd556){try{queues['attendedtransfer'](_0xd556);transfers['attendedtransfer'](_0xd556);agents[_0x7ef4('0x22')](_0xd556);calls['attendedtransfer'](_0xd556);}catch(_0x4fce8c){utils['error'](_0x4fce8c);}});ami['on'](_0x7ef4('0x23'),function(_0x5e99d4){try{queues['varset'](_0x5e99d4);recordings[_0x7ef4('0x23')](_0x5e99d4);calls[_0x7ef4('0x23')](_0x5e99d4);dials[_0x7ef4('0x23')](_0x5e99d4);}catch(_0x69c584){utils[_0x7ef4('0x11')](_0x69c584);}});ami['on'](_0x7ef4('0x24'),function(_0x552f13){try{calls[_0x7ef4('0x24')](_0x552f13);recordings[_0x7ef4('0x24')](_0x552f13);dials[_0x7ef4('0x24')](_0x552f13);}catch(_0x6b8488){utils[_0x7ef4('0x11')](_0x6b8488);}});ami['on'](_0x7ef4('0x25'),function(_0x249f1a){try{calls[_0x7ef4('0x25')](_0x249f1a);recordings[_0x7ef4('0x25')](_0x249f1a);}catch(_0x38045b){utils['error'](_0x38045b);}});ami['on'](_0x7ef4('0x26'),function(_0x196caf){try{dials[_0x7ef4('0x26')](_0x196caf);}catch(_0x5eb689){utils['error'](_0x5eb689);}});ami['on'](_0x7ef4('0x27'),function(_0xd620b2){try{dials['dialend'](_0xd620b2);}catch(_0x1d87e5){utils[_0x7ef4('0x11')](_0x1d87e5);}});}
\ No newline at end of file
index 8581f3d..544d384 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x545f=['devicestatechange','state','INUSE','device','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','agentcomplete','assign','queue','split','source','data3','destinationchannel','data1','destination','lodash','util','./utils','Local/_attended@transfer','info','format','uniqueid','channel','data2','type','interface','getUserByInterface','then','membername','name','internal','request','CreateMemberReport','getUserByName','catch','error','some','startsWith'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x545f,0x70));var _0xf545=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x545f[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0xf545('0x0'));var util=require(_0xf545('0x1'));var utils=require(_0xf545('0x2'));var members={};var exclude=[_0xf545('0x3'),'Queue:'];function writeDB(_0x187dae){utils[_0xf545('0x4')](util[_0xf545('0x5')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x187dae[_0xf545('0x6')],_0x187dae['interface'],_0x187dae[_0xf545('0x7')],_0x187dae[_0xf545('0x8')],_0x187dae['membername'],_0x187dae[_0xf545('0x9')]));if(_0x187dae[_0xf545('0xa')]){utils[_0xf545('0xb')](_0x187dae[_0xf545('0xa')])[_0xf545('0xc')](function(_0x45516a){if(_0x45516a){_0x187dae[_0xf545('0xd')]=_0x45516a[_0xf545('0xe')];_0x187dae[_0xf545('0xf')]=_0x45516a['internal'];utils[_0xf545('0x10')](_0xf545('0x11'),_0x187dae);}else{utils[_0xf545('0x12')](_0x187dae['interface']['split']('/')[0x1])['then'](function(_0x20b671){if(_0x20b671){_0x187dae[_0xf545('0xd')]=_0x20b671[_0xf545('0xe')];_0x187dae[_0xf545('0xf')]=_0x20b671[_0xf545('0xf')];utils[_0xf545('0x10')](_0xf545('0x11'),_0x187dae);}});}})[_0xf545('0x13')](function(_0x27ae2b){utils[_0xf545('0x14')](_0x27ae2b);});}delete members[_0x187dae[_0xf545('0xa')]];}function startsWith(_0x37493a,_0x8f6867){return _[_0xf545('0x15')](_0x37493a,function(_0x120105){return _[_0xf545('0x16')](_0x8f6867,_0x120105);});}exports[_0xf545('0x17')]=function(_0x12682a){switch(_0x12682a[_0xf545('0x18')]){case _0xf545('0x19'):case'BUSY':if(!startsWith(exclude,_0x12682a[_0xf545('0x1a')])){members[_0x12682a[_0xf545('0x1a')]]={'channel':_0xf545('0x1b'),'interface':_0x12682a['device'],'type':_0xf545('0x1c'),'enterAt':utils[_0xf545('0x1d')](),'role':_0xf545('0x1e')};}break;case _0xf545('0x1f'):if(!_[_0xf545('0x20')](members[_0x12682a[_0xf545('0x1a')]])){members[_0x12682a[_0xf545('0x1a')]][_0xf545('0x21')]=utils[_0xf545('0x1d')]();members[_0x12682a[_0xf545('0x1a')]][_0xf545('0x22')]=utils[_0xf545('0x23')](members[_0x12682a[_0xf545('0x1a')]][_0xf545('0x21')],members[_0x12682a[_0xf545('0x1a')]]['enterAt']);if(members[_0x12682a[_0xf545('0x1a')]][_0xf545('0x6')]){writeDB(members[_0x12682a[_0xf545('0x1a')]]);}}default:break;}};exports[_0xf545('0x24')]=function(_0x5b318b){if(!_['isNil'](members[_0x5b318b['interface']])){members[_0x5b318b[_0xf545('0xa')]]=_[_0xf545('0x25')](members[_0x5b318b[_0xf545('0xa')]],{'data4':_0x5b318b[_0xf545('0x26')],'uniqueid':_0x5b318b[_0xf545('0x6')]});}};exports['cdr']=function(_0x1885d4){if(_0x1885d4[_0xf545('0x7')]){var _0x33c721=_0x1885d4[_0xf545('0x7')][_0xf545('0x27')]('-')[0x0];if(!_[_0xf545('0x20')](members[_0x33c721])){members[_0x33c721]=_[_0xf545('0x25')](members[_0x33c721],{'data1':members[_0x33c721]['data1']||_0x1885d4['type'],'data2':members[_0x33c721][_0xf545('0x8')]||_0x1885d4[_0xf545('0x28')],'data3':members[_0x33c721][_0xf545('0x29')]||_0x1885d4['destination'],'uniqueid':members[_0x33c721]['uniqueid']||_0x1885d4['uniqueid']});if(members[_0x33c721][_0xf545('0x21')]){writeDB(members[_0x33c721]);}}}if(_0x1885d4[_0xf545('0x2a')]){var _0x36ffbd=_0x1885d4['destinationchannel'][_0xf545('0x27')]('-')[0x0];if(!_['isNil'](members[_0x36ffbd])){members[_0x36ffbd]=_[_0xf545('0x25')](members[_0x36ffbd],{'data1':members[_0x36ffbd][_0xf545('0x2b')]||_0x1885d4['type'],'data2':members[_0x36ffbd][_0xf545('0x8')]||_0x1885d4[_0xf545('0x28')],'data3':members[_0x36ffbd][_0xf545('0x29')]||_0x1885d4[_0xf545('0x2c')],'uniqueid':members[_0x36ffbd][_0xf545('0x6')]||_0x1885d4[_0xf545('0x6')]});if(members[_0x36ffbd]['exitAt']){writeDB(members[_0x36ffbd]);}}}};
\ No newline at end of file
+var _0xe3cc=['devicestatechange','state','INUSE','BUSY','device','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','assign','queue','cdr','channel','data1','data3','destinationchannel','source','destination','util','Local/_attended@transfer','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','data2','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','split','then','error','some'];(function(_0x4b9290,_0x548f3c){var _0x2a585a=function(_0x19500f){while(--_0x19500f){_0x4b9290['push'](_0x4b9290['shift']());}};_0x2a585a(++_0x548f3c);}(_0xe3cc,0x19b));var _0xce3c=function(_0x1eae41,_0x3c1151){_0x1eae41=_0x1eae41-0x0;var _0x588453=_0xe3cc[_0x1eae41];return _0x588453;};'use strict';var _=require('lodash');var util=require(_0xce3c('0x0'));var utils=require('./utils');var members={};var exclude=[_0xce3c('0x1'),'Queue:'];function writeDB(_0x14656b){utils[_0xce3c('0x2')](util[_0xce3c('0x3')](_0xce3c('0x4'),_0x14656b[_0xce3c('0x5')],_0x14656b[_0xce3c('0x6')],_0x14656b['channel'],_0x14656b[_0xce3c('0x7')],_0x14656b[_0xce3c('0x8')],_0x14656b[_0xce3c('0x9')]));if(_0x14656b[_0xce3c('0x6')]){utils[_0xce3c('0xa')](_0x14656b[_0xce3c('0x6')])['then'](function(_0x1459dc){if(_0x1459dc){_0x14656b[_0xce3c('0x8')]=_0x1459dc[_0xce3c('0xb')];_0x14656b[_0xce3c('0xc')]=_0x1459dc[_0xce3c('0xc')];utils[_0xce3c('0xd')](_0xce3c('0xe'),_0x14656b);}else{utils['getUserByName'](_0x14656b[_0xce3c('0x6')][_0xce3c('0xf')]('/')[0x1])[_0xce3c('0x10')](function(_0x1532d0){if(_0x1532d0){_0x14656b['membername']=_0x1532d0['name'];_0x14656b[_0xce3c('0xc')]=_0x1532d0[_0xce3c('0xc')];utils[_0xce3c('0xd')](_0xce3c('0xe'),_0x14656b);}});}})['catch'](function(_0x57a97f){utils[_0xce3c('0x11')](_0x57a97f);});}delete members[_0x14656b['interface']];}function startsWith(_0x44741f,_0x5eef49){return _[_0xce3c('0x12')](_0x44741f,function(_0x184b41){return _['startsWith'](_0x5eef49,_0x184b41);});}exports[_0xce3c('0x13')]=function(_0x399f89){switch(_0x399f89[_0xce3c('0x14')]){case _0xce3c('0x15'):case _0xce3c('0x16'):if(!startsWith(exclude,_0x399f89[_0xce3c('0x17')])){members[_0x399f89[_0xce3c('0x17')]]={'channel':_0xce3c('0x18'),'interface':_0x399f89[_0xce3c('0x17')],'type':_0xce3c('0x19'),'enterAt':utils[_0xce3c('0x1a')](),'role':'agent'};}break;case _0xce3c('0x1b'):if(!_[_0xce3c('0x1c')](members[_0x399f89[_0xce3c('0x17')]])){members[_0x399f89[_0xce3c('0x17')]][_0xce3c('0x1d')]=utils['now']();members[_0x399f89[_0xce3c('0x17')]][_0xce3c('0x1e')]=utils[_0xce3c('0x1f')](members[_0x399f89[_0xce3c('0x17')]]['exitAt'],members[_0x399f89[_0xce3c('0x17')]][_0xce3c('0x20')]);if(members[_0x399f89[_0xce3c('0x17')]]['uniqueid']){writeDB(members[_0x399f89[_0xce3c('0x17')]]);}}default:break;}};exports[_0xce3c('0x21')]=function(_0x5a1a3d){if(!_[_0xce3c('0x1c')](members[_0x5a1a3d['interface']])){members[_0x5a1a3d[_0xce3c('0x6')]]=_[_0xce3c('0x22')](members[_0x5a1a3d[_0xce3c('0x6')]],{'data4':_0x5a1a3d[_0xce3c('0x23')],'uniqueid':_0x5a1a3d[_0xce3c('0x5')]});}};exports[_0xce3c('0x24')]=function(_0x241818){if(_0x241818['channel']){var _0x326584=_0x241818[_0xce3c('0x25')]['split']('-')[0x0];if(!_[_0xce3c('0x1c')](members[_0x326584])){members[_0x326584]=_[_0xce3c('0x22')](members[_0x326584],{'data1':members[_0x326584][_0xce3c('0x26')]||_0x241818[_0xce3c('0x9')],'data2':members[_0x326584]['data2']||_0x241818['source'],'data3':members[_0x326584][_0xce3c('0x27')]||_0x241818['destination'],'uniqueid':members[_0x326584][_0xce3c('0x5')]||_0x241818[_0xce3c('0x5')]});if(members[_0x326584][_0xce3c('0x1d')]){writeDB(members[_0x326584]);}}}if(_0x241818[_0xce3c('0x28')]){var _0x203f29=_0x241818[_0xce3c('0x28')][_0xce3c('0xf')]('-')[0x0];if(!_[_0xce3c('0x1c')](members[_0x203f29])){members[_0x203f29]=_[_0xce3c('0x22')](members[_0x203f29],{'data1':members[_0x203f29]['data1']||_0x241818[_0xce3c('0x9')],'data2':members[_0x203f29][_0xce3c('0x7')]||_0x241818[_0xce3c('0x29')],'data3':members[_0x203f29][_0xce3c('0x27')]||_0x241818[_0xce3c('0x2a')],'uniqueid':members[_0x203f29][_0xce3c('0x5')]||_0x241818['uniqueid']});if(members[_0x203f29][_0xce3c('0x1d')]){writeDB(members[_0x203f29]);}}}};
\ No newline at end of file
index 0da588e..052492c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x467f=['BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','transfereelinkedid','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','clone','stack','musiconholdstart','musiconholdstop','musiconholdstartAt','lodash','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','position','now','hangup','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','queuecallerenterreason','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queueposition','queuecallerexitAt','EXITWITHKEY','queuecallerleave','holdtime','diffTime','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','agentcomplete','queuecallercompleteAt','reason','transfer','COMPLETEDBY','transfereeuniqueid','transfertype','transferexten'];(function(_0x31701d,_0x25897a){var _0x422109=function(_0x3ca953){while(--_0x3ca953){_0x31701d['push'](_0x31701d['shift']());}};_0x422109(++_0x25897a);}(_0x467f,0x144));var _0xf467=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x467f[_0x486f4a];return _0x135d99;};'use strict';var _=require(_0xf467('0x0'));var util=require('util');var utils=require(_0xf467('0x1'));var queues={};function writeDB(_0x1dcdeb){utils[_0xf467('0x2')](util[_0xf467('0x3')](_0xf467('0x4'),_0x1dcdeb[_0xf467('0x5')],_0x1dcdeb[_0xf467('0x6')],_0x1dcdeb[_0xf467('0x7')],_0x1dcdeb[_0xf467('0x8')],_0x1dcdeb[_0xf467('0x9')],_0x1dcdeb[_0xf467('0xa')],_0x1dcdeb[_0xf467('0xb')]));if(_0x1dcdeb[_0xf467('0x7')]){utils[_0xf467('0xc')](_0x1dcdeb[_0xf467('0x7')])[_0xf467('0xd')](function(_0x439a75){if(_0x439a75){_0x1dcdeb['type']=_0x439a75[_0xf467('0xe')];}utils[_0xf467('0xf')](_0xf467('0x10'),_0x1dcdeb);});}else{utils[_0xf467('0xf')](_0xf467('0x10'),_0x1dcdeb);}if(_0x1dcdeb[_0xf467('0x11')]){delete queues[_0x1dcdeb['transfereduniqueid']];}else{delete queues[_0x1dcdeb[_0xf467('0x5')]];}}exports[_0xf467('0x12')]=function(_0x4731f9){queues[_0x4731f9[_0xf467('0x5')]]=_[_0xf467('0x13')](_0x4731f9,{'originalposition':_0x4731f9[_0xf467('0x14')],'queuecallerjoinAt':utils[_0xf467('0x15')](),'mohtime':0x0});};exports[_0xf467('0x16')]=function(_0x9e2a1b){if(!_['isNil'](queues[_0x9e2a1b[_0xf467('0x5')]])){if(queues[_0x9e2a1b[_0xf467('0x5')]][_0xf467('0x17')]){if(!queues[_0x9e2a1b['uniqueid']][_0xf467('0x18')]&&!queues[_0x9e2a1b['uniqueid']][_0xf467('0x19')]){queues[_0x9e2a1b[_0xf467('0x5')]][_0xf467('0x1a')]=!![];queues[_0x9e2a1b[_0xf467('0x5')]]['queuecallercompleteAt']=utils[_0xf467('0x15')]();queues[_0x9e2a1b[_0xf467('0x5')]][_0xf467('0xb')]=_0xf467('0x1b');}writeDB(queues[_0x9e2a1b[_0xf467('0x5')]]);}else{if(queues[_0x9e2a1b[_0xf467('0x5')]][_0xf467('0x11')]){queues[queues[_0x9e2a1b[_0xf467('0x5')]][_0xf467('0x11')]]=queues[_0x9e2a1b[_0xf467('0x5')]];queues[queues[_0x9e2a1b[_0xf467('0x5')]][_0xf467('0x11')]][_0xf467('0x1c')]=0x2;delete queues[_0x9e2a1b[_0xf467('0x5')]];}}}};exports['varset']=function(_0x4b79c3){if(!_[_0xf467('0x1d')](_0x4b79c3[_0xf467('0x1e')][_0xf467('0x1f')])&&_0x4b79c3[_0xf467('0x20')][_0xf467('0x21')]()!==_0xf467('0x22')){if(!_[_0xf467('0x1d')](queues[_0x4b79c3[_0xf467('0x5')]])){queues[_0x4b79c3[_0xf467('0x5')]][_0xf467('0x18')]=![];queues[_0x4b79c3['uniqueid']][_0xf467('0x23')]=null;queues[_0x4b79c3['uniqueid']][_0xf467('0x19')]=!![];queues[_0x4b79c3[_0xf467('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x4b79c3[_0xf467('0x5')]]['queuecallerexitreason']=_0x4b79c3[_0xf467('0x20')][_0xf467('0x21')]();writeDB(queues[_0x4b79c3[_0xf467('0x5')]]);}}else if(!_[_0xf467('0x1d')](_0x4b79c3[_0xf467('0x1e')][_0xf467('0x24')])){if(!_[_0xf467('0x1d')](queues[_0x4b79c3[_0xf467('0x5')]])&&!queues[_0x4b79c3[_0xf467('0x5')]][_0xf467('0x18')]){queues[_0x4b79c3[_0xf467('0x5')]]['queuecallerabandon']=![];queues[_0x4b79c3[_0xf467('0x5')]][_0xf467('0x23')]=null;queues[_0x4b79c3['uniqueid']][_0xf467('0x19')]=!![];queues[_0x4b79c3[_0xf467('0x5')]][_0xf467('0x25')]=utils['now']();queues[_0x4b79c3['uniqueid']]['queuecallerexitreason']=_0xf467('0x26');}}};exports[_0xf467('0x18')]=function(_0x1a15f0){if(!_['isNil'](queues[_0x1a15f0['uniqueid']])){queues[_0x1a15f0[_0xf467('0x5')]][_0xf467('0x19')]=![];queues[_0x1a15f0['uniqueid']][_0xf467('0x25')]=null;queues[_0x1a15f0[_0xf467('0x5')]]['queuecallerabandon']=!![];queues[_0x1a15f0['uniqueid']][_0xf467('0x23')]=utils['now']();queues[_0x1a15f0[_0xf467('0x5')]][_0xf467('0xb')]='ABANDONED';}};exports[_0xf467('0x27')]=function(_0xe93e63){if(!_[_0xf467('0x1d')](queues[_0xe93e63[_0xf467('0x5')]])){queues[_0xe93e63[_0xf467('0x5')]][_0xf467('0x27')]=!![];queues[_0xe93e63[_0xf467('0x5')]][_0xf467('0x17')]=utils[_0xf467('0x15')]();queues[_0xe93e63['uniqueid']][_0xf467('0x28')]=utils[_0xf467('0x29')](queues[_0xe93e63['uniqueid']][_0xf467('0x17')],queues[_0xe93e63[_0xf467('0x5')]]['queuecallerjoinAt']);queues[_0xe93e63[_0xf467('0x5')]][_0xf467('0x14')]=_0xe93e63[_0xf467('0x14')];queues[_0xe93e63[_0xf467('0x5')]][_0xf467('0x2a')]=_0xe93e63[_0xf467('0x2a')];queues[_0xe93e63[_0xf467('0x5')]][_0xf467('0x2b')]=_0xe93e63[_0xf467('0x2b')];queues[_0xe93e63[_0xf467('0x5')]][_0xf467('0x2c')]=_0xe93e63[_0xf467('0x2c')];}};exports[_0xf467('0x2d')]=function(_0x213da0){if(!_['isNil'](queues[_0x213da0[_0xf467('0x5')]])){queues[_0x213da0[_0xf467('0x5')]]['queuecallerabandon']=![];queues[_0x213da0[_0xf467('0x5')]][_0xf467('0x18')]=![];queues[_0x213da0[_0xf467('0x5')]]['queuecallerabandonAt']=null;queues[_0x213da0[_0xf467('0x5')]]['queuecallerexit']=![];queues[_0x213da0[_0xf467('0x5')]][_0xf467('0xb')]=null;queues[_0x213da0['uniqueid']][_0xf467('0x25')]=null;queues[_0x213da0['uniqueid']][_0xf467('0x2e')]=!![];queues[_0x213da0[_0xf467('0x5')]]['accountcode']=_0x213da0[_0xf467('0x2f')];queues[_0x213da0[_0xf467('0x5')]]['lastAssignedTo']=_0x213da0['membername'];}};exports[_0xf467('0x30')]=function(_0x170c66){if(!_['isNil'](queues[_0x170c66[_0xf467('0x5')]])){if(queues[_0x170c66['uniqueid']]['queuecallerleaveAt']){queues[_0x170c66[_0xf467('0x5')]][_0xf467('0x18')]=![];queues[_0x170c66[_0xf467('0x5')]][_0xf467('0x18')]=![];queues[_0x170c66['uniqueid']]['queuecallerabandonAt']=null;queues[_0x170c66[_0xf467('0x5')]]['queuecallerexit']=![];queues[_0x170c66[_0xf467('0x5')]][_0xf467('0x25')]=null;queues[_0x170c66[_0xf467('0x5')]][_0xf467('0x2e')]=!![];queues[_0x170c66[_0xf467('0x5')]][_0xf467('0x8')]=_0x170c66['membername'];queues[_0x170c66[_0xf467('0x5')]][_0xf467('0x1a')]=!![];queues[_0x170c66[_0xf467('0x5')]][_0xf467('0x31')]=utils[_0xf467('0x15')]();if(_0x170c66[_0xf467('0x32')]==_0xf467('0x33')){if(!queues[_0x170c66[_0xf467('0x5')]][_0xf467('0x33')]){queues[_0x170c66[_0xf467('0x5')]][_0xf467('0xb')]='TRANSFER';}}else{queues[_0x170c66[_0xf467('0x5')]][_0xf467('0xb')]=_0xf467('0x34')+_0x170c66[_0xf467('0x32')][_0xf467('0x21')]();}writeDB(queues[_0x170c66[_0xf467('0x5')]]);}}};exports['blindtransfer']=function(_0x2c0674){if(!_[_0xf467('0x1d')](queues[_0x2c0674[_0xf467('0x35')]])){queues[_0x2c0674[_0xf467('0x35')]]['transfer']=!![];queues[_0x2c0674[_0xf467('0x35')]][_0xf467('0x36')]='BLIND';queues[_0x2c0674['transfereeuniqueid']][_0xf467('0x37')]=_0x2c0674['extension'];queues[_0x2c0674[_0xf467('0x35')]]['transferuniqueid']=_0x2c0674[_0xf467('0x35')];queues[_0x2c0674['transfereeuniqueid']]['queuecallerexitreason']=_0xf467('0x38');}};exports['attendedtransfer']=function(_0x424de0){try{if(_0x424de0[_0xf467('0x39')]==_0x424de0[_0xf467('0x3a')]){if(!_[_0xf467('0x1d')](queues[_0x424de0['secondtransfererlinkedid']])){queues[_0x424de0[_0xf467('0x3b')]][_0xf467('0x33')]=!![];queues[_0x424de0['secondtransfererlinkedid']][_0xf467('0x36')]=_0xf467('0x3c');queues[_0x424de0[_0xf467('0x3b')]][_0xf467('0x37')]=_0x424de0[_0xf467('0x3d')];queues[_0x424de0[_0xf467('0x3b')]]['transferuniqueid']=_0x424de0['origtransfereruniqueid'];queues[_0x424de0['secondtransfererlinkedid']][_0xf467('0xb')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x424de0[_0xf467('0x3a')]])){if(_0x424de0[_0xf467('0x3e')]&&queues[_0x424de0[_0xf467('0x3e')]]){queues[_0x424de0[_0xf467('0x3e')]]['queuecallerenterreason']=0x1;queues[_0x424de0[_0xf467('0x35')]]=_['clone'](queues[_0x424de0[_0xf467('0x3e')]]);queues[_0x424de0['transfereeuniqueid']][_0xf467('0x11')]=_0x424de0[_0xf467('0x3f')];queues[_0x424de0[_0xf467('0x35')]][_0xf467('0x1c')]=0x2;queues[_0x424de0[_0xf467('0x35')]][_0xf467('0x9')]=queues[_0x424de0['secondtransfererlinkedid']][_0xf467('0x9')];queues[_0x424de0[_0xf467('0x35')]]['calleridname']=queues[_0x424de0['secondtransfererlinkedid']][_0xf467('0x40')];queues[_0x424de0['transfereeuniqueid']][_0xf467('0x41')]=utils[_0xf467('0x15')]();queues[_0x424de0['transfereeuniqueid']][_0xf467('0x17')]=utils[_0xf467('0x15')]();queues[_0x424de0[_0xf467('0x35')]][_0xf467('0x28')]=0x0;queues[_0x424de0['transfereeuniqueid']][_0xf467('0x42')]=0x0;}else{queues[_0x424de0['origtransfererlinkedid']][_0xf467('0x11')]=_0x424de0[_0xf467('0x3b')];}}}else if(_0x424de0[_0xf467('0x43')]==_0x424de0[_0xf467('0x3b')]){if(!_[_0xf467('0x1d')](queues[_0x424de0[_0xf467('0x3a')]])){queues[_0x424de0[_0xf467('0x3a')]][_0xf467('0x33')]=!![];queues[_0x424de0[_0xf467('0x3a')]][_0xf467('0x36')]='ATTENDED';queues[_0x424de0['origtransfererlinkedid']]['transferexten']=_0x424de0[_0xf467('0x44')];queues[_0x424de0[_0xf467('0x3a')]]['transferuniqueid']=_0x424de0[_0xf467('0x43')];queues[_0x424de0[_0xf467('0x3a')]][_0xf467('0xb')]=_0xf467('0x45');}if(!_[_0xf467('0x1d')](queues[_0x424de0[_0xf467('0x3b')]])){if(_0x424de0[_0xf467('0x46')]&&queues[_0x424de0[_0xf467('0x46')]]){queues[_0x424de0[_0xf467('0x46')]]['queuecallerenterreason']=0x1;queues[_0x424de0[_0xf467('0x3f')]]=_[_0xf467('0x47')](queues[_0x424de0['transfertargetlinkedid']]);queues[_0x424de0[_0xf467('0x3f')]][_0xf467('0x11')]=_0x424de0[_0xf467('0x3f')];queues[_0x424de0['transfertargetuniqueid']][_0xf467('0x1c')]=0x2;queues[_0x424de0['transfertargetuniqueid']]['calleridnum']=queues[_0x424de0['origtransfererlinkedid']][_0xf467('0x9')];queues[_0x424de0[_0xf467('0x3f')]][_0xf467('0x40')]=queues[_0x424de0[_0xf467('0x3a')]]['calleridname'];queues[_0x424de0[_0xf467('0x3f')]]['queuecallerjoinAt']=utils[_0xf467('0x15')]();queues[_0x424de0[_0xf467('0x3f')]][_0xf467('0x17')]=utils[_0xf467('0x15')]();queues[_0x424de0[_0xf467('0x3f')]]['holdtime']=0x0;queues[_0x424de0[_0xf467('0x3f')]][_0xf467('0x42')]=0x0;}else{queues[_0x424de0[_0xf467('0x3b')]][_0xf467('0x11')]=_0x424de0[_0xf467('0x3a')];}}}}catch(_0x5ec447){utils['error'](_0x5ec447[_0xf467('0x48')]);}};exports[_0xf467('0x49')]=function(_0x13abf6){if(!_[_0xf467('0x1d')](queues[_0x13abf6[_0xf467('0x5')]])){queues[_0x13abf6['uniqueid']]['musiconholdstartAt']=utils['now']();}};exports[_0xf467('0x4a')]=function(_0x399a19){if(!_[_0xf467('0x1d')](queues[_0x399a19['uniqueid']])){if(!_[_0xf467('0x1d')](queues[_0x399a19[_0xf467('0x5')]]['musiconholdstartAt'])){queues[_0x399a19[_0xf467('0x5')]][_0xf467('0x42')]+=utils['diffTime'](utils[_0xf467('0x15')](),queues[_0x399a19['uniqueid']]['musiconholdstartAt']);delete queues[_0x399a19[_0xf467('0x5')]][_0xf467('0x4b')];}}};
\ No newline at end of file
+var _0xcd45=['secondtransfererlinkedid','ATTENDED','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','secondtransfereruniqueid','transfertargetlinkedid','holdtime','mohtime','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','now','hangup','isNil','queuecallercomplete','queuecallercompleteAt','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','queueposition','queuecallerabandon','EXITWITHKEY','ABANDONED','queuecallerleave','queuecallerleaveAt','diffTime','queuecallerjoinAt','position','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','agentcomplete','membername','reason','transfer','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid'];(function(_0x99c621,_0x48b1c9){var _0x5d0f13=function(_0x1a3382){while(--_0x1a3382){_0x99c621['push'](_0x99c621['shift']());}};_0x5d0f13(++_0x48b1c9);}(_0xcd45,0x1a3));var _0x5cd4=function(_0x5d9f9a,_0x338fa2){_0x5d9f9a=_0x5d9f9a-0x0;var _0x322888=_0xcd45[_0x5d9f9a];return _0x322888;};'use strict';var _=require(_0x5cd4('0x0'));var util=require(_0x5cd4('0x1'));var utils=require(_0x5cd4('0x2'));var queues={};function writeDB(_0x528972){utils[_0x5cd4('0x3')](util[_0x5cd4('0x4')](_0x5cd4('0x5'),_0x528972[_0x5cd4('0x6')],_0x528972['channel'],_0x528972['queue'],_0x528972[_0x5cd4('0x7')],_0x528972[_0x5cd4('0x8')],_0x528972[_0x5cd4('0x9')],_0x528972[_0x5cd4('0xa')]));if(_0x528972[_0x5cd4('0xb')]){utils[_0x5cd4('0xc')](_0x528972[_0x5cd4('0xb')])[_0x5cd4('0xd')](function(_0x35bf39){if(_0x35bf39){_0x528972[_0x5cd4('0xe')]=_0x35bf39[_0x5cd4('0xe')];}utils[_0x5cd4('0xf')](_0x5cd4('0x10'),_0x528972);});}else{utils['request'](_0x5cd4('0x10'),_0x528972);}if(_0x528972[_0x5cd4('0x11')]){delete queues[_0x528972[_0x5cd4('0x11')]];}else{delete queues[_0x528972[_0x5cd4('0x6')]];}}exports[_0x5cd4('0x12')]=function(_0x54ae2d){queues[_0x54ae2d[_0x5cd4('0x6')]]=_[_0x5cd4('0x13')](_0x54ae2d,{'originalposition':_0x54ae2d['position'],'queuecallerjoinAt':utils[_0x5cd4('0x14')](),'mohtime':0x0});};exports[_0x5cd4('0x15')]=function(_0x556709){if(!_[_0x5cd4('0x16')](queues[_0x556709[_0x5cd4('0x6')]])){if(queues[_0x556709[_0x5cd4('0x6')]]['queuecallerleaveAt']){if(!queues[_0x556709[_0x5cd4('0x6')]]['queuecallerabandon']&&!queues[_0x556709['uniqueid']]['queuecallerexit']){queues[_0x556709[_0x5cd4('0x6')]][_0x5cd4('0x17')]=!![];queues[_0x556709[_0x5cd4('0x6')]][_0x5cd4('0x18')]=utils['now']();queues[_0x556709['uniqueid']][_0x5cd4('0xa')]='COMPLETEDBYAGENT';}writeDB(queues[_0x556709[_0x5cd4('0x6')]]);}else{if(queues[_0x556709[_0x5cd4('0x6')]]['transfereduniqueid']){queues[queues[_0x556709['uniqueid']]['transfereduniqueid']]=queues[_0x556709[_0x5cd4('0x6')]];queues[queues[_0x556709['uniqueid']][_0x5cd4('0x11')]][_0x5cd4('0x19')]=0x2;delete queues[_0x556709['uniqueid']];}}}};exports[_0x5cd4('0x1a')]=function(_0x2fbea3){if(!_['isNil'](_0x2fbea3[_0x5cd4('0x1b')][_0x5cd4('0x1c')])&&_0x2fbea3[_0x5cd4('0x1d')][_0x5cd4('0x1e')]()!==_0x5cd4('0x1f')){if(!_[_0x5cd4('0x16')](queues[_0x2fbea3[_0x5cd4('0x6')]])){queues[_0x2fbea3['uniqueid']]['queuecallerabandon']=![];queues[_0x2fbea3[_0x5cd4('0x6')]][_0x5cd4('0x20')]=null;queues[_0x2fbea3['uniqueid']][_0x5cd4('0x21')]=!![];queues[_0x2fbea3['uniqueid']][_0x5cd4('0x22')]=utils[_0x5cd4('0x14')]();queues[_0x2fbea3[_0x5cd4('0x6')]][_0x5cd4('0xa')]=_0x2fbea3[_0x5cd4('0x1d')][_0x5cd4('0x1e')]();writeDB(queues[_0x2fbea3[_0x5cd4('0x6')]]);}}else if(!_['isNil'](_0x2fbea3[_0x5cd4('0x1b')][_0x5cd4('0x23')])){if(!_[_0x5cd4('0x16')](queues[_0x2fbea3[_0x5cd4('0x6')]])&&!queues[_0x2fbea3[_0x5cd4('0x6')]][_0x5cd4('0x24')]){queues[_0x2fbea3[_0x5cd4('0x6')]][_0x5cd4('0x24')]=![];queues[_0x2fbea3[_0x5cd4('0x6')]][_0x5cd4('0x20')]=null;queues[_0x2fbea3[_0x5cd4('0x6')]][_0x5cd4('0x21')]=!![];queues[_0x2fbea3[_0x5cd4('0x6')]]['queuecallerexitAt']=utils['now']();queues[_0x2fbea3[_0x5cd4('0x6')]]['queuecallerexitreason']=_0x5cd4('0x25');}}};exports[_0x5cd4('0x24')]=function(_0x3f51c9){if(!_[_0x5cd4('0x16')](queues[_0x3f51c9[_0x5cd4('0x6')]])){queues[_0x3f51c9[_0x5cd4('0x6')]]['queuecallerexit']=![];queues[_0x3f51c9[_0x5cd4('0x6')]][_0x5cd4('0x22')]=null;queues[_0x3f51c9[_0x5cd4('0x6')]]['queuecallerabandon']=!![];queues[_0x3f51c9[_0x5cd4('0x6')]][_0x5cd4('0x20')]=utils[_0x5cd4('0x14')]();queues[_0x3f51c9[_0x5cd4('0x6')]][_0x5cd4('0xa')]=_0x5cd4('0x26');}};exports['queuecallerleave']=function(_0x42a21a){if(!_[_0x5cd4('0x16')](queues[_0x42a21a[_0x5cd4('0x6')]])){queues[_0x42a21a[_0x5cd4('0x6')]][_0x5cd4('0x27')]=!![];queues[_0x42a21a[_0x5cd4('0x6')]][_0x5cd4('0x28')]=utils[_0x5cd4('0x14')]();queues[_0x42a21a[_0x5cd4('0x6')]]['holdtime']=utils[_0x5cd4('0x29')](queues[_0x42a21a['uniqueid']]['queuecallerleaveAt'],queues[_0x42a21a[_0x5cd4('0x6')]][_0x5cd4('0x2a')]);queues[_0x42a21a[_0x5cd4('0x6')]][_0x5cd4('0x2b')]=_0x42a21a[_0x5cd4('0x2b')];queues[_0x42a21a['uniqueid']]['count']=_0x42a21a['count'];queues[_0x42a21a['uniqueid']]['connectedlinenum']=_0x42a21a[_0x5cd4('0x2c')];queues[_0x42a21a[_0x5cd4('0x6')]][_0x5cd4('0x2d')]=_0x42a21a[_0x5cd4('0x2d')];}};exports[_0x5cd4('0x2e')]=function(_0x187a13){if(!_[_0x5cd4('0x16')](queues[_0x187a13[_0x5cd4('0x6')]])){queues[_0x187a13[_0x5cd4('0x6')]][_0x5cd4('0x24')]=![];queues[_0x187a13[_0x5cd4('0x6')]][_0x5cd4('0x24')]=![];queues[_0x187a13['uniqueid']]['queuecallerabandonAt']=null;queues[_0x187a13[_0x5cd4('0x6')]]['queuecallerexit']=![];queues[_0x187a13[_0x5cd4('0x6')]][_0x5cd4('0xa')]=null;queues[_0x187a13[_0x5cd4('0x6')]]['queuecallerexitAt']=null;queues[_0x187a13[_0x5cd4('0x6')]][_0x5cd4('0x2f')]=!![];queues[_0x187a13['uniqueid']][_0x5cd4('0x9')]=_0x187a13[_0x5cd4('0x30')];queues[_0x187a13[_0x5cd4('0x6')]][_0x5cd4('0x7')]=_0x187a13['membername'];}};exports[_0x5cd4('0x31')]=function(_0x3eb7f8){if(!_[_0x5cd4('0x16')](queues[_0x3eb7f8[_0x5cd4('0x6')]])){if(queues[_0x3eb7f8[_0x5cd4('0x6')]][_0x5cd4('0x28')]){queues[_0x3eb7f8[_0x5cd4('0x6')]][_0x5cd4('0x24')]=![];queues[_0x3eb7f8['uniqueid']]['queuecallerabandon']=![];queues[_0x3eb7f8[_0x5cd4('0x6')]]['queuecallerabandonAt']=null;queues[_0x3eb7f8[_0x5cd4('0x6')]][_0x5cd4('0x21')]=![];queues[_0x3eb7f8[_0x5cd4('0x6')]]['queuecallerexitAt']=null;queues[_0x3eb7f8['uniqueid']][_0x5cd4('0x2f')]=!![];queues[_0x3eb7f8[_0x5cd4('0x6')]][_0x5cd4('0x7')]=_0x3eb7f8[_0x5cd4('0x32')];queues[_0x3eb7f8['uniqueid']]['queuecallercomplete']=!![];queues[_0x3eb7f8[_0x5cd4('0x6')]][_0x5cd4('0x18')]=utils[_0x5cd4('0x14')]();if(_0x3eb7f8[_0x5cd4('0x33')]==_0x5cd4('0x34')){if(!queues[_0x3eb7f8[_0x5cd4('0x6')]][_0x5cd4('0x34')]){queues[_0x3eb7f8[_0x5cd4('0x6')]][_0x5cd4('0xa')]='TRANSFER';}}else{queues[_0x3eb7f8[_0x5cd4('0x6')]][_0x5cd4('0xa')]='COMPLETEDBY'+_0x3eb7f8['reason'][_0x5cd4('0x1e')]();}writeDB(queues[_0x3eb7f8['uniqueid']]);}}};exports[_0x5cd4('0x35')]=function(_0x2e32cd){if(!_['isNil'](queues[_0x2e32cd['transfereeuniqueid']])){queues[_0x2e32cd[_0x5cd4('0x36')]][_0x5cd4('0x34')]=!![];queues[_0x2e32cd[_0x5cd4('0x36')]][_0x5cd4('0x37')]=_0x5cd4('0x38');queues[_0x2e32cd[_0x5cd4('0x36')]][_0x5cd4('0x39')]=_0x2e32cd['extension'];queues[_0x2e32cd[_0x5cd4('0x36')]]['transferuniqueid']=_0x2e32cd['transfereeuniqueid'];queues[_0x2e32cd[_0x5cd4('0x36')]][_0x5cd4('0xa')]=_0x5cd4('0x3a');}};exports[_0x5cd4('0x3b')]=function(_0xba48b9){try{if(_0xba48b9[_0x5cd4('0x3c')]==_0xba48b9['origtransfererlinkedid']){if(!_['isNil'](queues[_0xba48b9['secondtransfererlinkedid']])){queues[_0xba48b9[_0x5cd4('0x3d')]][_0x5cd4('0x34')]=!![];queues[_0xba48b9[_0x5cd4('0x3d')]][_0x5cd4('0x37')]=_0x5cd4('0x3e');queues[_0xba48b9['secondtransfererlinkedid']][_0x5cd4('0x39')]=_0xba48b9[_0x5cd4('0x3f')];queues[_0xba48b9[_0x5cd4('0x3d')]][_0x5cd4('0x40')]=_0xba48b9['origtransfereruniqueid'];queues[_0xba48b9[_0x5cd4('0x3d')]][_0x5cd4('0xa')]=_0x5cd4('0x41');}if(!_['isNil'](queues[_0xba48b9[_0x5cd4('0x42')]])){if(_0xba48b9[_0x5cd4('0x43')]&&queues[_0xba48b9[_0x5cd4('0x43')]]){queues[_0xba48b9[_0x5cd4('0x43')]][_0x5cd4('0x19')]=0x1;queues[_0xba48b9[_0x5cd4('0x36')]]=_[_0x5cd4('0x44')](queues[_0xba48b9[_0x5cd4('0x43')]]);queues[_0xba48b9[_0x5cd4('0x36')]]['transfereduniqueid']=_0xba48b9[_0x5cd4('0x45')];queues[_0xba48b9[_0x5cd4('0x36')]][_0x5cd4('0x19')]=0x2;queues[_0xba48b9[_0x5cd4('0x36')]]['calleridnum']=queues[_0xba48b9[_0x5cd4('0x3d')]][_0x5cd4('0x8')];queues[_0xba48b9[_0x5cd4('0x36')]][_0x5cd4('0x46')]=queues[_0xba48b9[_0x5cd4('0x3d')]][_0x5cd4('0x46')];queues[_0xba48b9[_0x5cd4('0x36')]][_0x5cd4('0x2a')]=utils[_0x5cd4('0x14')]();queues[_0xba48b9[_0x5cd4('0x36')]]['queuecallerleaveAt']=utils['now']();queues[_0xba48b9[_0x5cd4('0x36')]]['holdtime']=0x0;queues[_0xba48b9['transfereeuniqueid']]['mohtime']=0x0;}else{queues[_0xba48b9[_0x5cd4('0x42')]][_0x5cd4('0x11')]=_0xba48b9[_0x5cd4('0x3d')];}}}else if(_0xba48b9[_0x5cd4('0x47')]==_0xba48b9[_0x5cd4('0x3d')]){if(!_[_0x5cd4('0x16')](queues[_0xba48b9[_0x5cd4('0x42')]])){queues[_0xba48b9['origtransfererlinkedid']]['transfer']=!![];queues[_0xba48b9['origtransfererlinkedid']][_0x5cd4('0x37')]=_0x5cd4('0x3e');queues[_0xba48b9['origtransfererlinkedid']][_0x5cd4('0x39')]=_0xba48b9['secondtransfererexten'];queues[_0xba48b9[_0x5cd4('0x42')]][_0x5cd4('0x40')]=_0xba48b9['secondtransfereruniqueid'];queues[_0xba48b9[_0x5cd4('0x42')]][_0x5cd4('0xa')]=_0x5cd4('0x41');}if(!_[_0x5cd4('0x16')](queues[_0xba48b9[_0x5cd4('0x3d')]])){if(_0xba48b9['transfertargetlinkedid']&&queues[_0xba48b9['transfertargetlinkedid']]){queues[_0xba48b9[_0x5cd4('0x48')]][_0x5cd4('0x19')]=0x1;queues[_0xba48b9[_0x5cd4('0x45')]]=_[_0x5cd4('0x44')](queues[_0xba48b9[_0x5cd4('0x48')]]);queues[_0xba48b9[_0x5cd4('0x45')]][_0x5cd4('0x11')]=_0xba48b9[_0x5cd4('0x45')];queues[_0xba48b9[_0x5cd4('0x45')]][_0x5cd4('0x19')]=0x2;queues[_0xba48b9[_0x5cd4('0x45')]][_0x5cd4('0x8')]=queues[_0xba48b9[_0x5cd4('0x42')]][_0x5cd4('0x8')];queues[_0xba48b9[_0x5cd4('0x45')]][_0x5cd4('0x46')]=queues[_0xba48b9[_0x5cd4('0x42')]][_0x5cd4('0x46')];queues[_0xba48b9[_0x5cd4('0x45')]][_0x5cd4('0x2a')]=utils[_0x5cd4('0x14')]();queues[_0xba48b9[_0x5cd4('0x45')]][_0x5cd4('0x28')]=utils['now']();queues[_0xba48b9[_0x5cd4('0x45')]][_0x5cd4('0x49')]=0x0;queues[_0xba48b9[_0x5cd4('0x45')]][_0x5cd4('0x4a')]=0x0;}else{queues[_0xba48b9[_0x5cd4('0x3d')]][_0x5cd4('0x11')]=_0xba48b9[_0x5cd4('0x42')];}}}}catch(_0x57e5c0){utils[_0x5cd4('0x4b')](_0x57e5c0[_0x5cd4('0x4c')]);}};exports[_0x5cd4('0x4d')]=function(_0x515271){if(!_[_0x5cd4('0x16')](queues[_0x515271[_0x5cd4('0x6')]])){queues[_0x515271[_0x5cd4('0x6')]][_0x5cd4('0x4e')]=utils['now']();}};exports[_0x5cd4('0x4f')]=function(_0x180623){if(!_['isNil'](queues[_0x180623['uniqueid']])){if(!_[_0x5cd4('0x16')](queues[_0x180623[_0x5cd4('0x6')]][_0x5cd4('0x4e')])){queues[_0x180623[_0x5cd4('0x6')]]['mohtime']+=utils[_0x5cd4('0x29')](utils[_0x5cd4('0x14')](),queues[_0x180623[_0x5cd4('0x6')]][_0x5cd4('0x4e')]);delete queues[_0x180623[_0x5cd4('0x6')]]['musiconholdstartAt'];}}};
\ No newline at end of file
index 995c6dc..4327d20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','isNil','channelstate','stack','varset','variable','value','.WAV','find','monitors','hangup','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','accountcode','getUserByInternal','then','membername','name','UserId','request'];(function(_0x4586d9,_0x40009d){var _0xb3c27d=function(_0x530793){while(--_0x530793){_0x4586d9['push'](_0x4586d9['shift']());}};_0xb3c27d(++_0x40009d);}(_0xe706,0xa3));var _0x6e70=function(_0x4c9191,_0xe10c76){_0x4c9191=_0x4c9191-0x0;var _0x593642=_0xe706[_0x4c9191];return _0x593642;};'use strict';var _=require(_0x6e70('0x0'));var utils=require(_0x6e70('0x1'));var recordings={};function writeDB(_0x311951){utils['debug'](_0x311951);if(_0x311951[_0x6e70('0x2')]){utils[_0x6e70('0x3')](_0x311951[_0x6e70('0x2')])[_0x6e70('0x4')](function(_0x142c27){if(_0x142c27){_0x311951[_0x6e70('0x5')]=_0x142c27[_0x6e70('0x6')];_0x311951[_0x6e70('0x7')]=_0x142c27['id'];}utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);});}else{utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);}}exports[_0x6e70('0xa')]=function(_0x188ed3){try{if(_0x188ed3[_0x6e70('0xb')]==_0x188ed3[_0x6e70('0xc')]){recordings[_0x188ed3[_0x6e70('0xb')]]={'uniqueid':_0x188ed3[_0x6e70('0xb')],'accountcode':_0x188ed3[_0x6e70('0x2')],'exten':_0x188ed3[_0x6e70('0xd')],'context':_0x188ed3[_0x6e70('0xe')],'channel':_0x188ed3[_0x6e70('0xf')],'monitors':[]};}}catch(_0x37b3e0){utils[_0x6e70('0x10')](_0x37b3e0['stack']);}};exports['newstate']=function(_0x3594c1){try{if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xb')]])&&_0x3594c1[_0x6e70('0x12')]==0x6){}else if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xc')]])&&_0x3594c1[_0x6e70('0x12')]==0x6&&_0x3594c1[_0x6e70('0xe')]!='transfer'){recordings[_0x3594c1['linkedid']]['accountcode']=_0x3594c1[_0x6e70('0x2')];}}catch(_0x5a37a6){utils['error'](_0x5a37a6[_0x6e70('0x13')]);}};exports[_0x6e70('0x14')]=function(_0x5d9263){try{if(!_[_0x6e70('0x11')](_0x5d9263['variable'])&&!_[_0x6e70('0x11')](_0x5d9263[_0x6e70('0x15')]['mixmonitor_filename'])){if(_['endsWith'](_0x5d9263[_0x6e70('0x16')],'.wav49')){_0x5d9263[_0x6e70('0x16')]=_0x5d9263[_0x6e70('0x16')]['replace']('.wav49',_0x6e70('0x17'));}if(recordings[_0x5d9263[_0x6e70('0xc')]]){var _0x2368eb=_[_0x6e70('0x18')](recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')],{'value':_0x5d9263[_0x6e70('0x16')]});if(_[_0x6e70('0x11')](_0x2368eb)){recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')]['push']({'value':_0x5d9263[_0x6e70('0x16')]});}}}}catch(_0x344b65){utils[_0x6e70('0x10')](_0x344b65['stack']);}};exports[_0x6e70('0x1a')]=function(_0xa5d49){try{if(!_[_0x6e70('0x11')](recordings[_0xa5d49['uniqueid']])){recordings[_0xa5d49[_0x6e70('0xb')]]['calleridnum']=_0xa5d49['calleridnum'];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1b')]=_0xa5d49[_0x6e70('0x1b')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1c')]=_0xa5d49[_0x6e70('0x1c')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1d')]=_0xa5d49[_0x6e70('0x1d')];if(recordings[_0xa5d49[_0x6e70('0xb')]]['type']=='outbound'&&recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x2')]){recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1c')]=recordings[_0xa5d49[_0x6e70('0xb')]]['accountcode'];recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1d')]='';}recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x19')][_0x6e70('0x1e')](_0x20a225=>{var _0x3f78d2=_[_0x6e70('0x1f')](recordings[_0xa5d49[_0x6e70('0xb')]]);_0x3f78d2[_0x6e70('0x16')]=_0x20a225['value'];writeDB(_0x3f78d2);});delete recordings[_0xa5d49[_0x6e70('0xb')]];}}catch(_0x50d60b){utils[_0x6e70('0x10')](_0x50d60b['stack']);}};exports[_0x6e70('0x20')]=function(_0x2722e8){try{if(!_[_0x6e70('0x11')](recordings[_0x2722e8['uniqueid']])){if(_0x2722e8[_0x6e70('0x21')][_0x6e70('0x22')]()=='set'&&_[_0x6e70('0x23')](_0x2722e8[_0x6e70('0x24')]['toLowerCase'](),_0x6e70('0x25'))){var _0x3665a1=_0x2722e8[_0x6e70('0x24')][_0x6e70('0x26')]('=');var _0x3b4a13=_0x3665a1[0x0][_0x6e70('0x27')](_0x3665a1[0x0][_0x6e70('0x28')]('(')+0x1,_0x3665a1[0x0][_0x6e70('0x28')](')'));var _0xf146fd=_0x3665a1[0x1];recordings[_0x2722e8[_0x6e70('0xb')]][_0x3b4a13]=_0xf146fd;}}}catch(_0x4d32d8){utils[_0x6e70('0x10')](_0x4d32d8['stack']);}};exports[_0x6e70('0x29')]=function(_0x3222a2){try{if(!_[_0x6e70('0x11')](recordings[_0x3222a2[_0x6e70('0xb')]])){recordings[_0x3222a2[_0x6e70('0xb')]][_0x6e70('0x2a')]=_0x3222a2[_0x6e70('0x2a')];}}catch(_0xdd0bee){utils[_0x6e70('0x10')](_0xdd0bee[_0x6e70('0x13')]);}};
\ No newline at end of file
+var _0x008c=['then','membername','name','UserId','request','CreateVoiceRecording','newchannel','uniqueid','error','newstate','isNil','channelstate','linkedid','transfer','stack','variable','mixmonitor_filename','value','replace','.WAV','monitors','hangup','calleridnum','calleridname','connectedlinename','connectedlinenum','forEach','clone','newexten','application','toLowerCase','set','startsWith','cdr','appdata','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','debug','accountcode'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x008c,0x188));var _0xc008=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x008c[_0x541ea6];return _0x3c3e84;};'use strict';var _=require(_0xc008('0x0'));var utils=require(_0xc008('0x1'));var recordings={};function writeDB(_0x15aadc){utils[_0xc008('0x2')](_0x15aadc);if(_0x15aadc[_0xc008('0x3')]){utils['getUserByInternal'](_0x15aadc[_0xc008('0x3')])[_0xc008('0x4')](function(_0x10b33c){if(_0x10b33c){_0x15aadc[_0xc008('0x5')]=_0x10b33c[_0xc008('0x6')];_0x15aadc[_0xc008('0x7')]=_0x10b33c['id'];}utils[_0xc008('0x8')](_0xc008('0x9'),_0x15aadc);});}else{utils[_0xc008('0x8')]('CreateVoiceRecording',_0x15aadc);}}exports[_0xc008('0xa')]=function(_0x5aa09b){try{if(_0x5aa09b[_0xc008('0xb')]==_0x5aa09b['linkedid']){recordings[_0x5aa09b['uniqueid']]={'uniqueid':_0x5aa09b[_0xc008('0xb')],'accountcode':_0x5aa09b[_0xc008('0x3')],'exten':_0x5aa09b['exten'],'context':_0x5aa09b['context'],'channel':_0x5aa09b['channel'],'monitors':[]};}}catch(_0x1eacfa){utils[_0xc008('0xc')](_0x1eacfa['stack']);}};exports[_0xc008('0xd')]=function(_0x332fd4){try{if(!_[_0xc008('0xe')](recordings[_0x332fd4[_0xc008('0xb')]])&&_0x332fd4[_0xc008('0xf')]==0x6){}else if(!_[_0xc008('0xe')](recordings[_0x332fd4[_0xc008('0x10')]])&&_0x332fd4['channelstate']==0x6&&_0x332fd4['context']!=_0xc008('0x11')){recordings[_0x332fd4['linkedid']][_0xc008('0x3')]=_0x332fd4[_0xc008('0x3')];}}catch(_0x2073ef){utils[_0xc008('0xc')](_0x2073ef[_0xc008('0x12')]);}};exports['varset']=function(_0x5e894e){try{if(!_['isNil'](_0x5e894e[_0xc008('0x13')])&&!_[_0xc008('0xe')](_0x5e894e[_0xc008('0x13')][_0xc008('0x14')])){if(_['endsWith'](_0x5e894e['value'],'.wav49')){_0x5e894e['value']=_0x5e894e[_0xc008('0x15')][_0xc008('0x16')]('.wav49',_0xc008('0x17'));}if(recordings[_0x5e894e['linkedid']]){var _0x4bd611=_['find'](recordings[_0x5e894e['linkedid']][_0xc008('0x18')],{'value':_0x5e894e['value']});if(_['isNil'](_0x4bd611)){recordings[_0x5e894e['linkedid']]['monitors']['push']({'value':_0x5e894e[_0xc008('0x15')]});}}}}catch(_0x4777a6){utils[_0xc008('0xc')](_0x4777a6[_0xc008('0x12')]);}};exports[_0xc008('0x19')]=function(_0x110128){try{if(!_['isNil'](recordings[_0x110128[_0xc008('0xb')]])){recordings[_0x110128['uniqueid']]['calleridnum']=_0x110128[_0xc008('0x1a')];recordings[_0x110128[_0xc008('0xb')]][_0xc008('0x1b')]=_0x110128[_0xc008('0x1b')];recordings[_0x110128['uniqueid']]['connectedlinenum']=_0x110128['connectedlinenum'];recordings[_0x110128[_0xc008('0xb')]][_0xc008('0x1c')]=_0x110128[_0xc008('0x1c')];if(recordings[_0x110128[_0xc008('0xb')]]['type']=='outbound'&&recordings[_0x110128['uniqueid']]['accountcode']){recordings[_0x110128['uniqueid']][_0xc008('0x1d')]=recordings[_0x110128[_0xc008('0xb')]][_0xc008('0x3')];recordings[_0x110128['uniqueid']][_0xc008('0x1c')]='';}recordings[_0x110128[_0xc008('0xb')]][_0xc008('0x18')][_0xc008('0x1e')](_0x4c5dec=>{var _0xcdb32b=_[_0xc008('0x1f')](recordings[_0x110128['uniqueid']]);_0xcdb32b['value']=_0x4c5dec['value'];writeDB(_0xcdb32b);});delete recordings[_0x110128[_0xc008('0xb')]];}}catch(_0x267abd){utils[_0xc008('0xc')](_0x267abd[_0xc008('0x12')]);}};exports[_0xc008('0x20')]=function(_0xceebc3){try{if(!_[_0xc008('0xe')](recordings[_0xceebc3[_0xc008('0xb')]])){if(_0xceebc3[_0xc008('0x21')][_0xc008('0x22')]()==_0xc008('0x23')&&_[_0xc008('0x24')](_0xceebc3['appdata'][_0xc008('0x22')](),_0xc008('0x25'))){var _0x499754=_0xceebc3[_0xc008('0x26')][_0xc008('0x27')]('=');var _0x383be7=_0x499754[0x0][_0xc008('0x28')](_0x499754[0x0][_0xc008('0x29')]('(')+0x1,_0x499754[0x0][_0xc008('0x29')](')'));var _0x7cfbc5=_0x499754[0x1];recordings[_0xceebc3[_0xc008('0xb')]][_0x383be7]=_0x7cfbc5;}}}catch(_0x29d4b3){utils['error'](_0x29d4b3[_0xc008('0x12')]);}};exports[_0xc008('0x2a')]=function(_0x459df4){try{if(!_[_0xc008('0xe')](recordings[_0x459df4[_0xc008('0xb')]])){recordings[_0x459df4[_0xc008('0xb')]][_0xc008('0x2b')]=_0x459df4['queue'];}}catch(_0x35f360){utils[_0xc008('0xc')](_0x35f360['stack']);}};
\ No newline at end of file
index a6b0f76..50fa47a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde94=['transfereechannel','assign','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','lodash','util','./utils','info','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blind','error','stack','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','attended','isNil'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0xde94,0x134));var _0x4de9=function(_0x2f0c87,_0x1eefb3){_0x2f0c87=_0x2f0c87-0x0;var _0x45c260=_0xde94[_0x2f0c87];return _0x45c260;};'use strict';var _=require(_0x4de9('0x0'));var util=require(_0x4de9('0x1'));var utils=require(_0x4de9('0x2'));function writeDB(_0x20fb77){utils[_0x4de9('0x3')](util[_0x4de9('0x4')](_0x4de9('0x5'),_0x20fb77[_0x4de9('0x6')]));utils[_0x4de9('0x7')](_0x4de9('0x8'),_0x20fb77);}exports['blindtransfer']=function(_0x391b21){try{_0x391b21[_0x4de9('0x6')]=_0x4de9('0x9');writeDB(_0x391b21);}catch(_0x4d08ab){utils[_0x4de9('0xa')](_0x4d08ab[_0x4de9('0xb')]);}};exports['attendedtransfer']=function(_0x38a351){try{_0x38a351=_['assign'](_0x38a351,{'transfererchannel':_0x38a351[_0x4de9('0xc')],'transferercalleridnum':_0x38a351[_0x4de9('0xd')],'transferercalleridname':_0x38a351['origtransferercalleridname'],'transfererconnectedlinenum':_0x38a351[_0x4de9('0xe')],'transfererconnectedlinename':_0x38a351[_0x4de9('0xf')],'transfereraccountcode':_0x38a351[_0x4de9('0x10')],'transferercontext':_0x38a351[_0x4de9('0x11')],'transfererexten':_0x38a351[_0x4de9('0x12')],'transfererlinkedid':_0x38a351[_0x4de9('0x13')],'context':_0x38a351['origtransferercontext'],'extension':_0x38a351['origtransfererexten'],'type':_0x4de9('0x14')});if(_[_0x4de9('0x15')](_0x38a351[_0x4de9('0x16')])){_0x38a351=_[_0x4de9('0x17')](_0x38a351,{'transfereechannel':_0x38a351['transfertargetchannel'],'transfereecalleridnum':_0x38a351[_0x4de9('0x18')],'transfereecalleridname':_0x38a351[_0x4de9('0x19')],'transfereeconnectedlinenum':_0x38a351[_0x4de9('0x1a')],'transfereeconnectedlinename':_0x38a351[_0x4de9('0x1b')],'transfereeaccountcode':_0x38a351[_0x4de9('0x1c')],'transfereecontext':_0x38a351[_0x4de9('0x1d')],'transfereeexten':_0x38a351['transfertargetexten'],'transfereelinkedid':_0x38a351['transfertargetlinkedid']});}writeDB(_0x38a351);}catch(_0xa3dd05){utils[_0x4de9('0xa')](_0xa3dd05[_0x4de9('0xb')]);}};
\ No newline at end of file
+var _0x6a1d=['CreateVoiceTransferReport','blindtransfer','blind','error','attendedtransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','origtransferercontext','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','lodash','util','./utils','info','format','TRANSFER|%s','type'];(function(_0x4dbaa6,_0x1861e2){var _0x4e9889=function(_0xeb11e6){while(--_0xeb11e6){_0x4dbaa6['push'](_0x4dbaa6['shift']());}};_0x4e9889(++_0x1861e2);}(_0x6a1d,0xe1));var _0xd6a1=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x6a1d[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xd6a1('0x0'));var util=require(_0xd6a1('0x1'));var utils=require(_0xd6a1('0x2'));function writeDB(_0x5c5ac3){utils[_0xd6a1('0x3')](util[_0xd6a1('0x4')](_0xd6a1('0x5'),_0x5c5ac3[_0xd6a1('0x6')]));utils['request'](_0xd6a1('0x7'),_0x5c5ac3);}exports[_0xd6a1('0x8')]=function(_0x429bb8){try{_0x429bb8['type']=_0xd6a1('0x9');writeDB(_0x429bb8);}catch(_0x19efd9){utils[_0xd6a1('0xa')](_0x19efd9['stack']);}};exports[_0xd6a1('0xb')]=function(_0x24002c){try{_0x24002c=_['assign'](_0x24002c,{'transfererchannel':_0x24002c[_0xd6a1('0xc')],'transferercalleridnum':_0x24002c[_0xd6a1('0xd')],'transferercalleridname':_0x24002c[_0xd6a1('0xe')],'transfererconnectedlinenum':_0x24002c[_0xd6a1('0xf')],'transfererconnectedlinename':_0x24002c[_0xd6a1('0x10')],'transfereraccountcode':_0x24002c['origtransfereraccountcode'],'transferercontext':_0x24002c[_0xd6a1('0x11')],'transfererexten':_0x24002c['secondtransfererexten'],'transfererlinkedid':_0x24002c[_0xd6a1('0x12')],'context':_0x24002c[_0xd6a1('0x13')],'extension':_0x24002c['origtransfererexten'],'type':_0xd6a1('0x14')});if(_[_0xd6a1('0x15')](_0x24002c[_0xd6a1('0x16')])){_0x24002c=_['assign'](_0x24002c,{'transfereechannel':_0x24002c[_0xd6a1('0x17')],'transfereecalleridnum':_0x24002c[_0xd6a1('0x18')],'transfereecalleridname':_0x24002c[_0xd6a1('0x19')],'transfereeconnectedlinenum':_0x24002c[_0xd6a1('0x1a')],'transfereeconnectedlinename':_0x24002c['transfertargetconnectedlinename'],'transfereeaccountcode':_0x24002c[_0xd6a1('0x1b')],'transfereecontext':_0x24002c[_0xd6a1('0x1c')],'transfereeexten':_0x24002c['transfertargetexten'],'transfereelinkedid':_0x24002c['transfertargetlinkedid']});}writeDB(_0x24002c);}catch(_0x2f7fac){utils['error'](_0x2f7fac['stack']);}};
\ No newline at end of file
index 9e7334f..9d03e41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc695=['../../config/logger','debug','stringify','error','request','then','catch','stack','GetUser','internal','name','interface','result','FOUND','length','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','info','GETVOICEQUEUEBYNAME|','NOTFOUND','addTime','add','seconds','subtractTime','subtract','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','http'];(function(_0x55e5a4,_0x38cdee){var _0x54bb29=function(_0x39c55a){while(--_0x39c55a){_0x55e5a4['push'](_0x55e5a4['shift']());}};_0x54bb29(++_0x38cdee);}(_0xc695,0x154));var _0x5c69=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0xc695[_0x5179a5];return _0x15c8ce;};'use strict';var jayson=require(_0x5c69('0x0'));var moment=require(_0x5c69('0x1'));var BPromise=require(_0x5c69('0x2'));var client=jayson['client'][_0x5c69('0x3')]({'port':0x2329});var logger=require(_0x5c69('0x4'))('xdr');exports['info']=function(_0x28e593){logger['info'](_0x28e593);};exports[_0x5c69('0x5')]=function(_0x4570a1){logger[_0x5c69('0x5')](JSON[_0x5c69('0x6')](_0x4570a1));};exports[_0x5c69('0x7')]=function(_0x43c023){logger[_0x5c69('0x7')](_0x43c023['stack']);};exports[_0x5c69('0x8')]=function(_0x20696c,_0x48fe27){return client[_0x5c69('0x8')](_0x20696c,{'body':_0x48fe27})[_0x5c69('0x9')](function(_0x18b2b7){logger[_0x5c69('0x5')](JSON['stringify'](_0x18b2b7));})[_0x5c69('0xa')](function(_0x2251c4){logger[_0x5c69('0x7')](_0x2251c4[_0x5c69('0xb')]);});};function getUser(_0xeada58){return client[_0x5c69('0x8')](_0x5c69('0xc'),{'options':{'raw':!![],'attributes':['id',_0x5c69('0xd'),_0x5c69('0xe'),_0x5c69('0xf')],'where':_0xeada58,'limit':0x1}})['then'](function(_0x50b2cb){logger['info']('GETUSER|'+JSON[_0x5c69('0x6')](_0xeada58)+'|'+(_0x50b2cb[_0x5c69('0x10')]['length']?_0x5c69('0x11'):'NOTFOUND'));return _0x50b2cb[_0x5c69('0x10')][_0x5c69('0x12')]?_0x50b2cb[_0x5c69('0x10')][0x0]:null;});}exports[_0x5c69('0x13')]=function(_0x1e7aef){return new BPromise(function(_0x510aaf,_0x331924){if(_0x1e7aef){return getUser({'internal':_0x1e7aef})[_0x5c69('0x9')](function(_0x18b31c){return _0x510aaf(_0x18b31c);})[_0x5c69('0xa')](function(_0x1da5fd){logger[_0x5c69('0x7')](_0x1da5fd[_0x5c69('0xb')]);return _0x510aaf(null);});}else{return _0x510aaf(null);}});};exports[_0x5c69('0x14')]=function(_0x2c37fc){return new BPromise(function(_0x4db144,_0x888176){if(_0x2c37fc){return getUser({'interface':_0x2c37fc})[_0x5c69('0x9')](function(_0x4ea0fc){return _0x4db144(_0x4ea0fc);})['catch'](function(_0x158174){logger['error'](_0x158174[_0x5c69('0xb')]);return _0x4db144(null);});}else{return _0x4db144(null);}});};exports[_0x5c69('0x15')]=function(_0x3082c7){return new BPromise(function(_0x507d50,_0x1e5599){if(_0x3082c7){return getUser({'name':_0x3082c7})[_0x5c69('0x9')](function(_0x32583f){return _0x507d50(_0x32583f);})[_0x5c69('0xa')](function(_0xa64b92){logger[_0x5c69('0x7')](_0xa64b92[_0x5c69('0xb')]);return _0x507d50(null);});}else{return _0x507d50(null);}});};exports[_0x5c69('0x16')]=function(_0x2d5cea){return new BPromise(function(_0xa6f52b,_0x4ee28e){if(_0x2d5cea){return client['request'](_0x5c69('0x17'),{'options':{'raw':!![],'attributes':['id',_0x5c69('0xe'),_0x5c69('0x18'),_0x5c69('0x19'),_0x5c69('0x1a')],'where':{'name':_0x2d5cea},'limit':0x1}})[_0x5c69('0x9')](function(_0x5b2fc2){logger[_0x5c69('0x1b')](_0x5c69('0x1c')+_0x2d5cea+'|'+(_0x5b2fc2[_0x5c69('0x10')]['length']?_0x5c69('0x11'):_0x5c69('0x1d')));return _0xa6f52b(_0x5b2fc2[_0x5c69('0x10')][_0x5c69('0x12')]?_0x5b2fc2['result'][0x0]:null);})[_0x5c69('0xa')](function(_0x2bafc0){logger[_0x5c69('0x7')](_0x2bafc0[_0x5c69('0xb')]);return _0xa6f52b(null);});}else{return _0xa6f52b(null);}});};exports[_0x5c69('0x1e')]=function(_0x5a827b,_0x4dcafc){return moment(_0x5a827b)[_0x5c69('0x1f')](_0x4dcafc,_0x5c69('0x20'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x5c69('0x21')]=function(_0x4245cd,_0x4adb99){return moment(_0x4245cd)[_0x5c69('0x22')](_0x4adb99,'seconds')[_0x5c69('0x23')](_0x5c69('0x24'));};exports[_0x5c69('0x25')]=function(_0x24b0f3,_0x188bb7){return moment(_0x24b0f3)[_0x5c69('0x26')](moment(_0x188bb7),_0x5c69('0x20'));};exports[_0x5c69('0x27')]=function(_0x936378,_0x19beee){return parseInt(_0x936378,0xa)+parseInt(_0x19beee,0xa);};exports[_0x5c69('0x28')]=function(){return moment()['format'](_0x5c69('0x24'));};exports[_0x5c69('0x29')]=function(_0x28fdb1,_0x1560f7){if(_0x1560f7){return moment(_0x28fdb1)[_0x5c69('0x29')](_0x1560f7);}else{return!![];}};exports[_0x5c69('0x2a')]=function(_0x10e475,_0x2b1055){if(_0x2b1055){return moment(_0x10e475)['isBefore'](_0x2b1055);}else if(_0x10e475){return!![];}else{return![];}};
\ No newline at end of file
+var _0x7b36=['diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','client','http','../../config/logger','xdr','info','debug','error','then','stringify','request','GetUser','internal','name','interface','GETUSER|','result','length','FOUND','getUserByInternal','stack','getUserByInterface','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','NOTFOUND','catch','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime'];(function(_0xc7496f,_0x198920){var _0x16a05a=function(_0x5489d7){while(--_0x5489d7){_0xc7496f['push'](_0xc7496f['shift']());}};_0x16a05a(++_0x198920);}(_0x7b36,0x86));var _0x67b3=function(_0x29bed9,_0xe4b800){_0x29bed9=_0x29bed9-0x0;var _0x1c6fd7=_0x7b36[_0x29bed9];return _0x1c6fd7;};'use strict';var jayson=require(_0x67b3('0x0'));var moment=require(_0x67b3('0x1'));var BPromise=require('bluebird');var client=jayson[_0x67b3('0x2')][_0x67b3('0x3')]({'port':0x2329});var logger=require(_0x67b3('0x4'))(_0x67b3('0x5'));exports[_0x67b3('0x6')]=function(_0x553a01){logger['info'](_0x553a01);};exports[_0x67b3('0x7')]=function(_0x23f1f0){logger[_0x67b3('0x7')](JSON['stringify'](_0x23f1f0));};exports[_0x67b3('0x8')]=function(_0x5a85e1){logger[_0x67b3('0x8')](_0x5a85e1['stack']);};exports['request']=function(_0x16c733,_0x1aba7d){return client['request'](_0x16c733,{'body':_0x1aba7d})[_0x67b3('0x9')](function(_0x298225){logger[_0x67b3('0x7')](JSON[_0x67b3('0xa')](_0x298225));})['catch'](function(_0x5e2d56){logger[_0x67b3('0x8')](_0x5e2d56['stack']);});};function getUser(_0x1b27d6){return client[_0x67b3('0xb')](_0x67b3('0xc'),{'options':{'raw':!![],'attributes':['id',_0x67b3('0xd'),_0x67b3('0xe'),_0x67b3('0xf')],'where':_0x1b27d6,'limit':0x1}})[_0x67b3('0x9')](function(_0x6fdde){logger[_0x67b3('0x6')](_0x67b3('0x10')+JSON[_0x67b3('0xa')](_0x1b27d6)+'|'+(_0x6fdde[_0x67b3('0x11')][_0x67b3('0x12')]?_0x67b3('0x13'):'NOTFOUND'));return _0x6fdde[_0x67b3('0x11')]['length']?_0x6fdde[_0x67b3('0x11')][0x0]:null;});}exports[_0x67b3('0x14')]=function(_0x5f0a8e){return new BPromise(function(_0x5482d7,_0x35b222){if(_0x5f0a8e){return getUser({'internal':_0x5f0a8e})[_0x67b3('0x9')](function(_0x5b9164){return _0x5482d7(_0x5b9164);})['catch'](function(_0x3e4eb8){logger['error'](_0x3e4eb8[_0x67b3('0x15')]);return _0x5482d7(null);});}else{return _0x5482d7(null);}});};exports[_0x67b3('0x16')]=function(_0x2ff46a){return new BPromise(function(_0x5726cb,_0x5ce207){if(_0x2ff46a){return getUser({'interface':_0x2ff46a})[_0x67b3('0x9')](function(_0x2a5072){return _0x5726cb(_0x2a5072);})['catch'](function(_0x5a2a92){logger['error'](_0x5a2a92[_0x67b3('0x15')]);return _0x5726cb(null);});}else{return _0x5726cb(null);}});};exports['getUserByName']=function(_0x12e5a7){return new BPromise(function(_0x368199,_0xf16bb){if(_0x12e5a7){return getUser({'name':_0x12e5a7})[_0x67b3('0x9')](function(_0xbe28ad){return _0x368199(_0xbe28ad);})['catch'](function(_0x1428ae){logger[_0x67b3('0x8')](_0x1428ae[_0x67b3('0x15')]);return _0x368199(null);});}else{return _0x368199(null);}});};exports[_0x67b3('0x17')]=function(_0x2892ba){return new BPromise(function(_0x26b908,_0x5579a9){if(_0x2892ba){return client[_0x67b3('0xb')](_0x67b3('0x18'),{'options':{'raw':!![],'attributes':['id','name',_0x67b3('0x19'),_0x67b3('0x1a'),_0x67b3('0x1b')],'where':{'name':_0x2892ba},'limit':0x1}})['then'](function(_0x1eacad){logger['info'](_0x67b3('0x1c')+_0x2892ba+'|'+(_0x1eacad[_0x67b3('0x11')][_0x67b3('0x12')]?_0x67b3('0x13'):_0x67b3('0x1d')));return _0x26b908(_0x1eacad['result'][_0x67b3('0x12')]?_0x1eacad[_0x67b3('0x11')][0x0]:null);})[_0x67b3('0x1e')](function(_0x13cb89){logger[_0x67b3('0x8')](_0x13cb89[_0x67b3('0x15')]);return _0x26b908(null);});}else{return _0x26b908(null);}});};exports[_0x67b3('0x1f')]=function(_0x3f16c4,_0x421b9d){return moment(_0x3f16c4)['add'](_0x421b9d,_0x67b3('0x20'))[_0x67b3('0x21')](_0x67b3('0x22'));};exports[_0x67b3('0x23')]=function(_0x44b4ea,_0x33fad5){return moment(_0x44b4ea)[_0x67b3('0x24')](_0x33fad5,'seconds')[_0x67b3('0x21')](_0x67b3('0x22'));};exports[_0x67b3('0x25')]=function(_0x53e772,_0x2a0308){return moment(_0x53e772)[_0x67b3('0x26')](moment(_0x2a0308),_0x67b3('0x20'));};exports[_0x67b3('0x27')]=function(_0x482a97,_0x5f25f5){return parseInt(_0x482a97,0xa)+parseInt(_0x5f25f5,0xa);};exports[_0x67b3('0x28')]=function(){return moment()['format'](_0x67b3('0x22'));};exports[_0x67b3('0x29')]=function(_0x1ece54,_0x4a1008){if(_0x4a1008){return moment(_0x1ece54)[_0x67b3('0x29')](_0x4a1008);}else{return!![];}};exports[_0x67b3('0x2a')]=function(_0x45c879,_0x30bafa){if(_0x30bafa){return moment(_0x45c879)['isBefore'](_0x30bafa);}else if(_0x45c879){return!![];}else{return![];}};
\ No newline at end of file